X-Loop: help-debbugs@HIDDEN Subject: bug#22873: 25.1.50; Feature Request -- Multiple Cursors (built-in support) Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Tue, 01 Mar 2016 18:46:01 +0000 Resent-Message-ID: <handler.22873.B.145685791711961 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: report 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22873 <at> debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN Received: via spool by submit <at> debbugs.gnu.org id=B.145685791711961 (code B ref -1); Tue, 01 Mar 2016 18:46:01 +0000 Received: (at submit) by debbugs.gnu.org; 1 Mar 2016 18:45:17 +0000 Received: from localhost ([127.0.0.1]:56682 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1aapIL-00036q-0e for submit <at> debbugs.gnu.org; Tue, 01 Mar 2016 13:45:17 -0500 Received: from eggs.gnu.org ([208.118.235.92]:54806) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from <esq@HIDDEN>) id 1aapIJ-00036O-Aa for submit <at> debbugs.gnu.org; Tue, 01 Mar 2016 13:45:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <esq@HIDDEN>) id 1aapIC-0001w9-Rr for submit <at> debbugs.gnu.org; Tue, 01 Mar 2016 13:45:10 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:48484) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <esq@HIDDEN>) id 1aapIC-0001w4-OL for submit <at> debbugs.gnu.org; Tue, 01 Mar 2016 13:45:08 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45756) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <esq@HIDDEN>) id 1aapIB-0005B6-GS for bug-gnu-emacs@HIDDEN; Tue, 01 Mar 2016 13:45:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <esq@HIDDEN>) id 1aapI8-0001qr-4A for bug-gnu-emacs@HIDDEN; Tue, 01 Mar 2016 13:45:07 -0500 Received: from cobb.liquidweb.com ([50.28.13.150]:33699) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <esq@HIDDEN>) id 1aapI7-0001pt-Nz for bug-gnu-emacs@HIDDEN; Tue, 01 Mar 2016 13:45:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com; s=default; h=Content-Type:MIME-Version:Subject:To:From:Message-ID:Date; bh=Jc/2enNwnD+aKCt/JWi3djBpKqal2B+Ox+5o/lfi74A=; b=2uC6hWwzS8Gq0c3HPOPNa0S6Kl3FDN7u0yeraxvYObp6k3BrUtp4TZLJBViUVSuBaMNZTgnViDAo6RfiCI0UKfX8lxLOgmYjfFsJF4XF5TegEBR76GknoZKDRDGoTt7A; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:52000 helo=server.private.localhost) by cobb.liquidweb.com with esmtp (Exim 4.82) (envelope-from <esq@HIDDEN>) id 1aapI1-0005T6-9c for bug-gnu-emacs@HIDDEN; Tue, 01 Mar 2016 13:44:57 -0500 Date: Tue, 01 Mar 2016 10:44:58 -0800 Message-ID: <m2oaayavh1.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 (generated by - "") Content-Type: multipart/mixed; boundary="Multipart_Tue_Mar__1_10:44:58_2016-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cobb.liquidweb.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-Get-Message-Sender-Via: cobb.liquidweb.com: acl_c_relayhosts_text_entry: lawlist|lawlist.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -5.0 (-----) --Multipart_Tue_Mar__1_10:44:58_2016-1 Content-Type: text/plain; charset=US-ASCII As a feature request, it would be appreciated if the Emacs development team could please consider adding built-in support for multiple cursors similar to the Lisp library that Magnar Sveen has written: https://github.com/magnars [Out of the box, Emacs does not presently support a left vertical bar fake cursor overlay.] The multiple cursors API should please be made available to the user so that fake cursors of any style can be drawn anywhere on the visible window. [Available styles include those defined in the variable `cursor-type'.] The API available to the user should support standard points for positions, instead of x/y/vpos/hpos. In other words, the API should make it easy for the user to specifying a list of points -- e.g., '(5 6 7 8 9 10). In that scenario, fake cursors would be drawn at positions 5, 6, 7, 8, 9 and 10. Perhaps a cons cell with the `cursor-type' for each specified point would be appropriate -- that way a user would not be limited to the buffer-local or default cursor style for all fake cursors. This feature request has the added benefit that the user can create a vertical line the entire length of the screen by using multiple fake bar cursors in addition to a stretch space glyph and an XPM image that is thin (e.g., one pixel wide) with a pixel height equal to the line height at any location where no character exists -- e.g., overlays using the 'after-string property. An example would be the fill-column-indicator library written by Alp Aker: https://github.com/alpaker/Fill-Column-Indicator In the context of the fill-column-indicator example, a user can draw a vertical line that extends through the left side of each character to form a solid line the entire length of the window from top to bottom. In my own personal setup, I would be drawing a solid vertical line that tracks the cursor position -- the line would run through the left side of any character along that resides on vertical column. The following draft proof concept patch contains a variety of things including a sample of this particular feature request for multiple cursors. The example has been tested on Emacs master branch for OSX and Windows operating systems. On OSX the fake cursors draw immediately, but on Windows it is necessary to press any key after calling `multiple-cursors-test' for the fake cursors to appear. The fake cursors are designed to disappear during the next command loop. The internal function `move_it_to' provides for a conveniently quick method to convert PT to the necessary x/y/vpos/hpos. NOTE: `posn-at-point` is painfully slow to obtain x/y/vpos/hpos -- so we certainly want to avoid using that function when converting the list of PT for fake cursors each command loop. The following test function called `multiple-cursors-test` works with the proof concept draft patch attached below, which admittedly needs a lot more work. I tested using the bar `cursor-type'. (defun multiple-cursors-test (&optional list) "Draw fake cursors at all POS defined in the `multiple-cursor-list'. The list contains integers representing the various positions. The default list is for positions 5, 6, 7, 8, 9 and 10." (interactive) (setq cursor-type 'bar) (setq multiple-cursors-list (if list list (list 5 6 7 8 9 10)))) (global-set-key [f1] 'multiple-cursors-test) --Multipart_Tue_Mar__1_10:44:58_2016-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="multiple_cursors.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3NyYy9idWZmZXIuYyBiL3NyYy9idWZmZXIuYwppbmRleCA5OGI2MWMzLi5k NWEyZmMwIDEwMDY0NAotLS0gYS9zcmMvYnVmZmVyLmMKKysrIGIvc3JjL2J1ZmZlci5jCkBAIC01 MDczLDYgKzUwNzM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ludGVybmFsIChiKTsKKyAgICB9CisgIGlmICghTklMUCAoQlZBUiAoY3VycmVudF9idWZmZXIs IHdpbmRvd19zdGFydF9lbmRfaG9vaykpCisgICAgICAmJiB3LT53aW5kb3dfc3RhcnRfZW5kX2hv b2tfcGVuZGluZykKKyAgICB7CisgICAgICBpZiAoKHBvc2ludCA+PSBDSEFSUE9TIChzdGFydHAp ICYmIHBvc2ludCA8PSBCVUZfWlYgKGIpKQorICAgICAgICAgICYmIENIQVJQT1MgKHN0YXJ0cCkg Pj0gQlVGX0JFR1YgKGIpCisgICAgICAgICAgJiYgQ0hBUlBPUyAoc3RhcnRwKSA8PSBCVUZfWlYg KGIpCisgICAgICAgICAgJiYgcG9zX3Zpc2libGVfcCAodywgcG9zaW50LCAmeCwgJnksICZydG9w LCAmcmJvdCwgJnJvd2gsICZ2cG9zKSkKKyAgICAgICAgZnVsbHlfcCA9ICFydG9wICYmICFyYm90 OworICAgICAgaWYgKGZ1bGx5X3ApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBDTElQX1RFWFRf UE9TX0ZST01fTUFSS0VSIChzdGFydHAsIHctPnN0YXJ0KTsgICovCisgICAgICAgICAgaXRkYXRh ID0gYmlkaV9zaGVsdmVfY2FjaGUgKCk7CisgICAgICAgICAgc3RhcnRfZGlzcGxheSAoJml0LCB3 LCBzdGFydHApOworICAgICAgICAgIG1vdmVfaXRfdmVydGljYWxseSAoJml0LCB3aW5kb3dfYm94 X2hlaWdodCAodykpOworICAgICAgICAgIGlmIChpdC5jdXJyZW50X3kgPCBpdC5sYXN0X3Zpc2li bGVfeSkKKyAgICAgICAgICAgIG1vdmVfaXRfcGFzdF9lb2wgKCZpdCk7CisgICAgICAgICAgZW5k cCA9IChJVF9DSEFSUE9TIChpdCkpOworICAgICAgICAgIGJpZGlfdW5zaGVsdmVfY2FjaGUgKGl0 ZGF0YSwgZmFsc2UpOworICAgICAgICAgIFNFVF9QVCAoc3RhcnRwX2ludGVnZXIpOworICAgICAg ICAgI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b3RlY3RlZCBhZ2FpbnN0IGVycm9ycyBzaWdu YWxlZCBieSB0aGF0IExpc3AuICAqLworICAgICAgICAgIC8qIGZuLCBhcmcxLCBhcmcyLCBhcmcz LCBhcmc0LCBhcmc1LCBhcmc2LCBhcmc3ICAqLworICAgICAgICAgIHNhZmVfY2FsbCAoOCwKKyAg ICAgICAgICAgICAgUXJ1bl9ob29rX3dpdGhfYXJncywKKyAgICAgICAgICAgICAgUXdpbmRvd19z dGFydF9lbmRfaG9vaywKKyAgICAgICAgICAgICAgd2luZG93LAorICAgICAgICAgICAgICBtYWtl X251bWJlciAoc3RhcnRwX2ludGVnZXIpLAorICAgICAgICAgICAgICBtYWtlX251bWJlciAoZW5k cCksCisgICAgICAgICAgICAgIG1ha2VfbnVtYmVyIChwYm9sX3N0YXJ0cCksCisgICAgICAgICAg ICAgIG1ha2VfbnVtYmVyIChwZW9sX2VuZHApLAorICAgICAgICAgICAgICBmdWxseV9wID8gUXQg OiBRbmlsKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworI2lmZGVmIEdM WVBIX0RFQlVHCisgICAgICAgICAgICAvKiBTZWUgdGhlIGRvYy1zdHJpbmcgZm9yIGBwb3Mtdmlz aWJsZS1pbi13aW5kb3ctcCcuICAqLworICAgICAgICAgICAgZGVidWdfbWV0aG9kX2FkZCAodywg IiVzIC0tIHg6ICVkIHwgeTogJWQgfCBydG9wOiAlZCB8IHJib3QgJWQgfCByb3doOiAlZCB8IHZw b3M6ICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmluZywgeCwgeSwg cnRvcCwgcmJvdCwgcm93aCwgdnBvcyk7CisjZW5kaWYKKyAgICAgICAgICB9CisgICAgfQorICBp ZiAob2xkX2J1ZmZlcikKKyAgICBzZXRfYnVmZmVyX2ludGVybmFsIChvbGRfYnVmZmVyKTsKK30K IAogLyogUGVyaGFwcyBpbiB0aGUgZnV0dXJlIGF2b2lkIHJlY2VudGVy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3csIGl0LmN1cnJlbnQucG9zLAogCQkJICAgICAgIFRSWV9XSU5ET1dfQ0hFQ0tf TUFSR0lOUykpCi0JICAgIGdvdG8gZG9uZTsKKyAgICB7CisgICAgICBpZiAoIU5JTFAgKEJWQVIg KGN1cnJlbnRfYnVmZmVyLCB3aW5kb3dfc3RhcnRfZW5kX2hvb2spKQorICAgICAgICAgICYmIHct PndpbmRvd19zdGFydF9lbmRfaG9va19wZW5kaW5nKQorICAgICAgICB7CisgICAgICAgICAgcnVu X3dpbmRvd19zdGFydF9lbmRfaG9vayAod2luZG93LCBpdC5jdXJyZW50LnBvcywgaXQsICJyZWRp c3BsYXlfd2luZG93IChwb3N0LXJlY2VudGVyKSIpOworICAgICAgICAgIGNsZWFyX2dseXBoX21h dHJpeCAody0+ZGVzaXJlZF9tYXRyaXgpOworICAgICAgICAgIHRyeV93aW5kb3cgKHdpbmRvdywg aXQuY3VycmVudC5wb3MsIDApOworICAgICAgICB9CisgICAgICBnb3RvIGRvbmU7CisgICAgfQor CiAJfQogCiAgICAgICAvKiBJZiBjZW50ZXJpbmcgcG9pbnQgZmFpbGVkIHRvIG1ha2UgdGhlIHdo b2xlIGxpbmUgdmlzaWJsZSwKQEAgLTIzNjQzLDYgKzIzNzYyLDIwIEBAIGRlY29kZV9tb2RlX3Nw ZWMgKHN0cnVjdCB3aW5kb3cgKncsIHJlZ2lzdGVyIGludCBjLCBpbnQgZmllbGRfd2lkdGgsCiAJ ICByZXR1cm4gIkAiOwogICAgICAgfQogCisgICAgY2FzZSAndyc6CisgICAgICB7CisgIHB0cmRp ZmZfdCB3aW5kb3dfc3RhcnQgPSBtYXJrZXJfcG9zaXRpb24gKHctPnN0YXJ0KTsKKyAgcGludDJz dHIgKGRlY29kZV9tb2RlX3NwZWNfYnVmLCB3aWR0aCwgd2luZG93X3N0YXJ0KTsKKyAgcmV0dXJu IGRlY29kZV9tb2RlX3NwZWNfYnVmOworICAgICAgfQorCisgICAgY2FzZSAnVyc6CisgICAgICB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C0xKQorICAgIGdvdG8gbm9fdmFsdWU7 CisgIC8qIElmIHRoZSBidWZmZXIgaXMgdmVyeSBiaWcsIGRvbid0IHdhc3RlIHRpbWUuICAqLwor ICBpZiAoSU5URUdFUlAgKFZsaW5lX251bWJlcl9kaXNwbGF5X2xpbWl0KQorICAgICAgJiYgQlVG X1pWIChiKSAtIEJVRl9CRUdWIChiKSA+IFhJTlQgKFZsaW5lX251bWJlcl9kaXNwbGF5X2xpbWl0 KSkKKyAgICB7CisgICAgICB3LT5iYXNlX2xpbmVfcG9zID0gMDsKKyAgICAgIHctPmJhc2VfbGlu ZV9udW1iZXIgPSAwOworICAgICAgZ290byBub192YWx1ZTsKKyAgICB9CisgIGlmICh3LT5iYXNl X2xpbmVfbnVtYmVyID4gMAorICAgICAgJiYgdy0+YmFzZV9saW5lX3BvcyA+IDAKKyAgICAgICYm IHctPmJhc2VfbGluZV9wb3MgPD0gc3RhcnRwb3MpCisgICAgeworICAgICAgbGluZSA9IHctPmJh c2VfbGluZV9udW1iZXI7CisgICAgICBsaW5lcG9zID0gdy0+YmFzZV9saW5lX3BvczsKKyAgICAg IGxpbmVwb3NfYnl0ZSA9IGJ1Zl9jaGFycG9zX3RvX2J5dGVwb3MgKGIsIGxpbmVwb3MpOworICAg IH0KKyAgZWxzZQorICAgIHsKKyAgICAgIGxpbmUgPSAxOworICAgICAgbGluZXBvcyA9IEJVRl9C RUdWIChiKTsKKyAgICAgIGxpbmVwb3NfYnl0ZSA9IEJVRl9CRUdWX0JZVEUgKGIpOworICAgIH0K KyAgLyogQ291bnQgbGluZXMgZnJvbSBiYXNlIGxpbmUgdG8gd2luZG93IHN0YXJ0IHBvc2l0aW9u LiAgKi8KKyAgbmxpbmVzID0gZGlzcGxheV9jb3VudF9saW5lcyAobGluZXBvc19ieXRlLAorICAg ICAgICAgICAgICBzdGFydHBvc19ieXRlLAorICAgICAgICAgICAgICBzdGFydHBvcywgJmp1bmsp OworICB0b3BsaW5lID0gbmxpbmVzICsgb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AgICAg ICAgICBsaW1pdF9ieXRlLAorICAgICAgICAgICAgLSAoaGVpZ2h0ICogMiArIDMwKSwKKyAgICAg ICAgICAgICZwb3NpdGlvbik7CisgICAgICAvKiBJZiB3ZSBjb3VsZG4ndCBmaW5kIHRoZSBsaW5l cyB3ZSB3YW50ZWQgd2l0aGluCisgICAgICAgICBsaW5lX251bWJlcl9kaXNwbGF5X2xpbWl0X3dp ZHRoIGNoYXJzIHBlciBsaW5lLAorICAgICAgICAgZ2l2ZSB1cCBvbiBsaW5lIG51bWJlcnMgZm9y IHRoaXMgd2luZG93LiAgKi8KKyAgICAgIGlmIChwb3NpdGlvbiA9PSBsaW1pdF9ieXRlICYmIGxp bWl0ID09IHN0YXJ0cG9zIC0gZGlzdGFuY2UpCisgICAgICAgIHsKKyAgICB3LT5iYXNlX2xpbmVf cG9zID0gLTE7CisgICAgdy0+YmFzZV9saW5lX251bWJlciA9IDA7CisgICAgZ290byBub192YWx1 ZTsKKyAgICAgICAgfQorICAgICAgdy0+YmFzZV9saW5lX251bWJlciA9IHRvcGxpbmUgLSBubGlu ZXM7CisgICAgICB3LT5iYXNlX2xpbmVfcG9zID0gQllURV9UT19DSEFSIChwb3NpdGlvbik7Cisg ICAgfQorICAvKiBOb3cgY291bnQgbGluZXMgZnJvbSB0aGUgc3RhcnQgcG9zIHRvIHBvaW50LiAg Ki8KKyAgbmxpbmVzID0gZGlzcGxheV9jb3VudF9saW5lcyAoc3RhcnRwb3NfYnl0ZSwgUFRfQllU RSwgUFQsICZqdW5rKTsKKyAgLyogTWFrZSB0aGUgc3RyaW5nIHRvIHNob3cuICAqLworICBwaW50 MnN0ciAoZGVjb2RlX21vZGVfc3BlY19idWYsIHdpZHRoLCB0b3BsaW5lICsgbmxpbmVzKTsKKyAg cmV0dXJuIGRlY29kZV9tb2RlX3NwZWNfYnVmOworICAgIG5vX3ZhbHVlOgorICAgICAgICB7Cisg ICAgY2hhciAqcCA9IGRlY29kZV9tb2RlX3NwZWNfYnVmOworICAgIGludCBwYWQgPSB3aWR0aCAt IDI7CisgICAgd2hpbGUgKHBhZC0tID4gMCkKKyAgICAgICpwKysgPSAnICc7CisgICAgKnArKyA9 ICc/JzsKKyAgICAqcCsrID0gJz8nOworICAgICpwID0gJ1wwJzsKKyAgICByZXR1cm4gZGVjb2Rl X21vZGVfc3BlY19idWY7CisgIH0KKyAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgaWYg KFNUUklOR1AgKG9iaikpCisgICAgeworICAgICAgKnN0cmluZyA9IG9iajsKKyAgICAgIHJldHVy biBTU0RBVEEgKG9iaik7CisgICAgfQorICBlbHNlCisgICAgcmV0dXJuICIiOworfQorCitERUZV TiAoImxpbmUtbnVtYmVyLWF0LXBvc2l0aW9uIiwgRmxpbmVfbnVtYmVyX2F0X3Bvc2l0aW9uLCBT bGluZV9udW1iZXJfYXRfcG9zaXRpb24sIDEsIDIsIDAsCisgICAgICAgZG9jOiAvKiBSZXR1cm4g bGluZSBudW1iZXIgYXQgcG9zaXRpb24uICAqLykKKyAgKExpc3BfT2JqZWN0IHdpbmRvdywgTGlz cF9PYmplY3QgcG9zKQoreworICBzdHJ1Y3Qgd2luZG93ICp3ID0gZGVjb2RlX2xpdmVfd2luZG93 ICh3aW5kb3cpOworICBMaXNwX09iamVjdCBidWYsIGZvb19zdHJpbmcsIHZhbHVlOworICBzdHJ1 Y3QgYnVmZmVyICpiOworICBidWYgPSB3LT5jb250ZW50czsKKyAgQ0hFQ0tfQlVGRkVSIChidWYp OworICBiID0gWEJVRkZFUiAoYnVmKTsKKyAgc3RydWN0IGJ1ZmZlciAqb2xkX2J1ZmZlciA9IE5V TEw7CisgIGNvbnN0IGNoYXIgKnNwZWM7CisgIEVNQUNTX0lOVCBvcG9pbnQsIHBvc2ludDsKKyAg aWYgKGIgIT0gY3VycmVudF9idWZmZXIpCisgICAgeworICAgICAgb2xkX2J1ZmZlciA9IGN1cnJl bnRfYnVmZmVyOworICAgICAgc2V0X2J1ZmZlc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kZXJfbGluZV9oZWlnaHQ7ICAqLwor ICAgICAgLyogbXlfeSA9IGZyYW1lX2NoYXJfaGVpZ2h0ICogY291bnRlcjsgICovCisgICAgICBu ZXdfcGJvbCA9IFhJTlQgKEZsaW5lX2JlZ2lubmluZ19wb3NpdGlvbiAoUW5pbCkpOworICAgICAg bmV3X3Blb2wgPSBYSU5UIChGbGluZV9lbmRfcG9zaXRpb24gKFFuaWwpKTsKKyAgICAgIGlmIChQ VCA9PSBlbmQgJiYgIShQVCA9PSBuZXdfcGJvbCkpCisgICAgICAgIHBlb3ZsID0gZW5kOworICAg ICAgICBlbHNlIGlmIChvbGRfcGJvbCA9PSBvbGRfcGVvbCkKKyAgICAgICAgICB7CisgICAgICAg ICAgICBwYm92bCA9IG9sZF9wYm9sOworICAgICAgICAgICAgcGVvdmwgPSBvbGRfcGVvbDsKKyAg ICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgcGVvdmwgPSBQVCAtIDE7Cisg ICAgICBjb2xfZW92bCA9IHBlb3ZsIC0gcGJvdmw7CisgICAgICBwYm92bF9taW51c18xID0gcGJv dmwgLSAxOworICAgICAgcGVvdmxfcGx1c18xID0gcGVvdmwgKyAxOworICAgICAgaWYgKG9sZF9w Ym9sID09IG9sZF9wZW9sKQorICAgICAgICBwZmNpID0gb2xkX3Bib2w7CisgICAgICAgIGVsc2Ug aWYgKChwYm92bCArIHZjb2wpIDw9IHBlb3ZsKQorICAgICAgICAgIHBmY2kgPSBwYm92bCArIHZj b2w7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgcGZjaSA9IHBlb3ZsOworICAgICAgaWYg KHBmY2kgPiAwICYmICEocGZjaSA+PSBtYXgpKQorICAgICAgICB7CisgICAgICAgICAgLyogdGVt cCA9IEZwb3NuX2F0X3BvaW50IChtYWtlX251bWJlciAocGZjaSksIHdpbmRvdyk7CisgICAgICAg ICAgeCA9IFhJTlQgKFhDQVIgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgdGVtcCkpKTsKKyAgICAg ICAgICB5ID0gWElOVCAoWENEUiAoRm50aCAobWFrZV9udW1iZXIgKDIpLCB0ZW1wKSkpOworICAg ICAgICAgIGhwb3MgPSBYSU5UIChYQ0FSIChGbnRoIChtYWtlX251bWJlciAoNiksIHRlbXApKSk7 CisgICAgICAgICAgdnBvcyA9IFhJTlQgKFhDRFIgKEZudGggKG1ha2VfbnVtYmVyICg2KSwgdGVt cCkpKTsgICovCisgICAgICAgICAgcGZjaV9taW51c18xID0gcGZjaSAtIDE7CisgICAgICAgICAg cGZjaV9wbHVzXzEgPSBwZmNpICsgMTsKKyAgICAgICAgfQorICAgICAgaWYgKHBmY2kgPiAwICYm ICEocGZjaSA+PSBtYXgpKQorICAgICAgICBjaGFyX2F0X3BmY2kgPSAoRmNoYXJfYWZ0ZXIgKG1h a2VfbnVtYmVyIChwZmNpKSkpOworICAgICAgICBlbHNlCisgICAgICAgICAgY2hhcl9hdF9wZmNp ID0gUW5pbDsKKyAgICAgIGlmIChwZmNpX21pbnVzXzEgPiAwICYmICEocGZjaV9taW51c18xID49 IG1heCkpCisgICAgICAgIGNoYXJfYmVmb3JlX3BmY2kgPSAoRmNoYXJfYWZ0ZXIgKG1ha2VfbnVt YmVyIChwZmNpX21pbnVzXzEpKSk7CisgICAgICAgIGVsc2UKKyAgICAgICAgICBjaGFyX2JlZm9y ZV9wZmNpID0gUW5pbDsKKyAgICAgIGlmIChwZmNpX3BsdXNfMSA+IDAgJiYgIShwZmNpX3BsdXNf MSA+PSBtYXgpKQorICAgICAgICBjaGFyX2FmdGVyX3BmY2kgPSAoRmNoYXJfYWZ0ZXIgKG1ha2Vf bnVtYmVyIChwZmNpX3BsdXNfMSkpKTsKKyAgICAgICAgZWxzZQorICAgICAgICAgIGNoYXJfYWZ0 ZXJfcGZjaSA9IFFuaWw7CisgICAgICBpZiAocGVvdmwgPiAwICYmICEocGVvdmwgPj0gbWF4KSkK KyAgICAgICAgY2hhcl9hdF9wZW92bCA9ICh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rvcl9mZ19taW51c18xID0gQ0FMTE4gKEZ2ZWN0b3IsIG1ha2Vf bnVtYmVyICgxLjApLCBtYWtlX251bWJlciAoMS4wKSwgbWFrZV9udW1iZXIgKDEuMCkpOyAgKi8K KyAgICAgICAgICBjb2xvcl92ZWN0b3JfZmdfbWludXNfMSA9IFFuaWw7CisgICAgICB0ZW1wID0g bGlzdG4gKENPTlNUWVBFX1BVUkUsIDIyLAorICAgICAgICBGY29ucyAoYnVpbGRfcHVyZV9jX3N0 cmluZyAoInBib2wiKSwgbWFrZV9udW1iZXIgKG9sZF9wYm9sKSksCisgICAgICAgIEZjb25zIChi dWlsZF9wdXJlX2Nfc3RyaW5nICgicGVvbCIpLCBtYWtlX251bWJlciAob2xkX3Blb2wpKSwKKyAg ICAgICAgRmNvbnMgKGJ1aWxkX3B1cmVfY19zdHJpbmcgKCJwYm92bCIpLCBtYWtlX251bWJlciAo cGJvdmwpKSwKKyAgICAgICAgRmNvbnMgKGJ1aWxkX3B1cmVfY19zdHJpbmcgKCJwZW92bCIpLCBt YWtlX251bWJlciAocGVvdmwpKSwKKyAgICAgICAgRmNvbnMgKGJ1aWxkX3B1cmVfY19zdHJpbmcg KCJjb2wtZW92bCIpLCBtYWtlX251bWJlciAoY29sX2VvdmwpKSwKKyAgICAgICAgRmNvbnMgKGJ1 aWxkX3B1cmVfY19zdHJpbmcgKCJwYm92bC0xIiksIG1ha2VfbnVtYmVyIChwYm92bF9taW51c18x KSksCisgICAgICAgIEZjb25zIChidWlsZF9wdXJlX2Nfc3RyaW5nICgicGVvdmwrMSIpLCBtYWtl X251bWJlciAocGVvdmxfcGx1c18xKSksCisgICAgICAgIEZjb25zIChidWlsZF9wdXJlX2Nfc3Ry aW5nICgicGZjaSIpLCBtYWtlX251bWJlciAocGZjaSkpLAorICAgICAgICBGY29ucyAoYnVpbGRf cHVyZV9jX3N0cmluZyAoInBmY2ktMSIpLCBtYWtlX251bWJlciAocGZjaV9taW51c18xKSksCisg ICAgICAgIEZj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fc3RyaW5nICgiY29sb3It dmVjdG9yLWJnLTEiKSwgY29sb3JfdmVjdG9yX2JnX21pbnVzXzEpLAorICAgICAgICBGY29ucyAo YnVpbGRfcHVyZV9jX3N0cmluZyAoImNvbG9yLXZlY3Rvci1mZy0xIiksIGNvbG9yX3ZlY3Rvcl9m Z19taW51c18xKSk7CisgICAgICAgIC8qICBGY29ucyAoYnVpbGRfcHVyZV9jX3N0cmluZyAoIm15 X3Bvc24tYXQtcGZjaSAoeCwgeSwgaHBvcywgdnBvcykiKSwKKyAgICAgICAgICBGY29ucyAobGlz dG4gKENPTlNUWVBFX1BVUkUsIDQsIG1ha2VfbnVtYmVyIChteV94KSwgbWFrZV9udW1iZXIgKG15 X3kpLCBtYWtlX251bWJlciAodmNvbCksIG1ha2VfbnVtYmVyIChjb3VudGVyKSksIFFuaWwpKSwK KyAgICAgICAgRmNvbnMgKGJ1aWxkX3B1cmVfY19zdHJpbmcgKCJwb3NuLWF0LXBmY2kgKHgsIHks IGhwb3MsIHZwb3MpIiksCisgICAgICAgICAgRmNvbnMgKGxpc3RuIChDT05TVFlQRV9QVVJFLCA0 LCBtYWtlX251bWJlciAoeCksIG1ha2VfbnVtYmVyICh5KSwgbWFrZV9udW1iZXIgKGhwb3MpLCBt YWtlX251bWJlciAodnBvcykpLCBRbmlsKSkgICovCisgICAgICBpZiAoTklMUCAocmVzdWx0KSkK KyAgICAgICAgcmVzdWx0ID0gRmNvbnMgKHRlbXAsIFFuaWwpOworICAgICAgICBlbHNlCisgICAg ICAgICAgcmVzdWx0ID0gRmNvbnMgKHRlbXAsIHJlc3VsdCk7CisgICAgICBjb3VudGVyID0gMSAr IGNvdW50ZXI7CisgICAgICBpZiAoUFQgPj0gZW5kIHx8IFBUID09IG1heCkKKyAgICAgICAgYnJl YWs7CisgICAgfQorICBTRVRfUFQgKG9wb2ludCk7CisgIGlmIChvbGRfYnVmZmVyKQorICAgIHNl dF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIp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KQorICAgICAgICAg IHsKKyAgICAgICAgICAgIHctPnBoeXNfY3Vyc29yX3dpZHRoID0geDEgLSB4OworICAgICAgICAg ICAgaWYgKHJvdyA+IHctPmN1cnJlbnRfbWF0cml4LT5yb3dzCisgICAgICAgICAgICAgICAgJiYg TUFUUklYX1JPV19PVkVSTEFQU19TVUNDX1AgKHJvdyAtIDEpKQorICAgICAgICAgICAgICB4X2Zp eF9vdmVybGFwcGluZ19hcmVhICh3LCByb3cgLSAxLCBURVhUX0FSRUEsCisgICAgICAgICAgICAg ICAgICAgIE9WRVJMQVBTX0VSQVNFRF9DVVJTT1IpOworICAgICAgICAgICAgaWYgKE1BVFJJWF9S T1dfQk9UVE9NX1kgKHJvdykgPCB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAg ICAgICAmJiBNQVRSSVhfUk9XX09WRVJMQVBTX1BSRURfUCAocm93ICsgMSkpCisgICAgICAgICAg ICAgIHhfZml4X292ZXJsYXBwaW5nX2FyZWEgKHcsIHJvdyArIDEsIFRFWFRfQVJFQSwKKyAgICAg ICAgICAgICAgICAgICAgT1ZFUkxBUFNfRVJBU0VEX0NVUlNPUik7CisgICAgICAgICAgfQorICAg IH0KK30KKwordm9pZAorbXVsdGlwbGVfY3Vyc29yc19lcmFzZSAoc3RydWN0IHdpbmRvdyAqdywg aW50IHgsIGludCB5LCBpbnQgaHBvcywgaW50IHZwb3MpCit7CisgIGludCBoZWFkZXJfbGluZV9o ZWlnaHQgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgaHBvcyA9IFhJTlQgKGhw b3MpOworICBpZiAoaGVhZGVyX2xpbmVfaGVpZ2h0ID4gMCkKKyAgICB2cG9zID0gWElOVCAodnBv cykgKyAxOworICAgIGVsc2UKKyAgICAgIHZwb3MgPSBYSU5UICh2cG9zKTsKKyAgeCA9IFhJTlQg KHgpOworICB5ID0gWElOVCAoeSk7CisgIHN0cnVjdCBmcmFtZSAqZiA9IF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QsIHBvc2ludCwgLTEsIC0xLCAtMSwgTU9W RV9UT19QT1MpOworICB4ID0gaXQuY3VycmVudF94OworICB5ID0gaXQuY3VycmVudF95OworICBo cG9zID0gaXQuaHBvczsKKyAgdnBvcyA9IGl0LnZwb3M7CisgIG1vdmVfaXRfdG8gKCZpdCwgb3Bv aW50LCAtMSwgLTEsIC0xLCBNT1ZFX1RPX1BPUyk7CisgIHJldHVybiBsaXN0biAoQ09OU1RZUEVf UFVSRSwgNCwKKyAgICAgICAgICAgICAgICAgIG1ha2VfbnVtYmVyICh4KSwKKyAgICAgICAgICAg ICAgICAgIG1ha2VfbnVtYmVyICh5KSwKKyAgICAgICAgICAgICAgICAgIG1ha2VfbnVtYmVyICho cG9zKSwKKyAgICAgICAgICAgICAgICAgIG1ha2VfbnVtYmVyICh2cG9zKSk7Cit9CisKK3ZvaWQK K211bHRpcGxlX2N1cnNvcnNfZm4gKHN0cnVjdCB3aW5kb3cgKncpCit7CisgIGludCB4LCB5LCBo cG9zLCB2cG9zOworICBMaXNwX09iamVjdCB4X3lfaHBvc192cG9zX2xpc3QsIHZsaXN0LCB2YXJf cG9zLCBidWY7CisgIHN0cnVjdCB0ZXh0X3BvcyBzdGFydHA7CisgIHN0cnVjdCBidWZmZXIgKmI7 CisgIGJ1ZiA9IHctPmNvbnRlbnRzOworICBDSEVDS19CVUZGRVIgKGJ1Zik7CisgIGIgPSBYQlVG RkVSIChidWYpOworICBpZiAoIU5JTFAgKEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBtdWx0aXBsZV9j dXJzb3JzX3ByZXZpb3VzX2xpc3QpKSkKKyAgICB7CisgICAgICBmb3IgKHZsaXN0ID0gQlZBUiAo Y3VycmVudF9idWZmZXIsIG11bHRpcGxlX2N1cnNvcnNfcHJldmlvdXNfbGlzdCk7CisgICAgICAg ICAgIENPTlNQICh2bGlzdCk7CisgICAgICAgICAgIHZsaXN0ID0gWENEUiAodmxpc3QpKQorICAg ICAgICB7CisgICAgICAgICAgdmFyX3BvcyA9IFhDQVIgKHZsaXN0KTsKKyAgICAgICAgICBTRVRf VEVYVF9QT1NfRlJPTV9NQVJLRVIgKHN0YXJ0cCwgdy0+c3RhcnQpOworICAgICAgICAgIGlmICh2 YXJfcG9zCisgICAgICAgICAgICAgICYmIChYSU5UICh2YXJfcG9zKSA+PSBDSEFSUE9TIChzdGFy dHApICYmIFhJTlQgKHZhcl9wb3MpIDw9IEJVRl9aViAoYikpCisgICAgICAgICAgICAgICYmIENI QVJQT1MgKHN0YXJ0cCkgPj0gQlVGX0JFR1YgKGIpCisgICAgICAgICAgICAgICYmIENIQVJQT1Mg KHN0YXJ0cCkgPD0gQlVGX1pWIChiKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgeF95 X2hwb3NfdnBvc19saXN0ID0gbXVsdGlwbGVfY3Vyc29yc194X3lfaHBvc192cG9zICh3LCB2YXJf cG9zKTsKKyAgICAgICAgICAgICAgeCA9IChGbnRoIChtYWtlX251bWJlciAoMCksIHhfeV9ocG9z X3Zwb3NfbGlzdCkpOworICAgICAgICAgICAgICB5ID0gKEZudGggKG1ha2VfbnVtYmVyICgxKSwg eF95X2hwb3NfdnBvc19saXN0KSk7CisgICAgICAgICAgICAgIGhwb3MgPSAoRm50aCAobWFrZV9u dW1iZXIgKDIpLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAgdnBvcyA9IChG bnRoIChtYWtlX251bWJlciAoMyksIHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAgICAg ICBtdWx0aXBsZV9jdXJzb3JzX2VyYXNlICh3LCB4LCB5LCBocG9zLCB2cG9zKTsKKyAgICAgICAg ICAgIH0KKyAgICAgICAgfQorICAgICAgYnNldF9tdWx0aXBsZV9jdXJzb3JzX3ByZXZpb3VzX2xp c3QgKGN1cnJlbnRfYnVmZmVyLCBRbmlsKTsKKyAgICB9CisgIGlmICghTklMUCAoQlZBUiAoY3Vy cmVudF9idWZmZXIsIG11bHRpcGxlX2N1cnNvcnNfbGlzdCkpKQorICAgIHsKKyAgICAgIGZvciAo dmxpc3QgPSBCVkFSIChjdXJyZW50X2J1ZmZlciwgbXVsdGlwbGVfY3Vyc29yc19saXN0KTsKKyAg ICAgICAgICAgQ09OU1AgKHZsaXN0KTsKKyAgICAgICAgICAgdmxpc3QgPSBYQ0RSICh2bGlzdCkp CisgICAgICAgIHsKKyAgICAgICAgICB2YXJfcG9zID0gWENBUiAodmxpc3QpOworICAgICAgICAg IFNFVF9URVhUX1BPU19GUk9NX01BUktFUiAoc3RhcnRwLCB3LT5zdGFydCk7CisgICAgICAgICAg aWYgKHZhcl9wb3MKKyAgICAgICAgICAgICAgJiYgKFhJTlQgKHZhcl9wb3MpID49IENIQVJQT1Mg KHN0YXJ0cCkgJiYgWElOVCAodmFyX3BvcykgPD0gQlVGX1pWIChiKSkKKyAgICAgICAgICAgICAg JiYgQ0hBUlBPUyAoc3RhcnRwKSA+PSBCVUZfQkVHViAoYikKKyAgICAgICAgICAgICAgJiYgQ0hB UlBPUyAoc3RhcnRwKSA8PSBCVUZfWlYgKGIpKQorICAgICAgICAgICAgeworICAgICAgICAgICAg ICB4X3lfaHBvc192cG9zX2xpc3QgPSBtdWx0aXBsZV9jdXJzb3JzX3hfeV9ocG9zX3Zwb3MgKHcs IHZhcl9wb3MpOworICAgICAgICAgICAgICB4ID0gRm50aCAobWFrZV9udW1iZXIgKDApLCB4X3lf aHBvc192cG9zX2xpc3QpOworICAgICAgICAgICAgICB5ID0gRm50aCAobWFrZV9udW1iZXIgKDEp LCB4X3lfaHBvc192cG9zX2xpc3QpOworICAgICAgICAgICAgICBocG9zID0gRm50aCAobWFrZV9u dW1iZXIgKDIpLCB4X3lfaHBvc192cG9zX2xpc3QpOworICAgICAgICAgICAgICB2cG9zID0gRm50 aCAobWFrZV9udW1iZXIgKDMpLCB4X3lfaHBvc192cG9zX2xpc3QpOworICAgICAgICAgICAgICBt dWx0aXBsZV9jdXJzb3JzX3Nld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3MsICJp bmhpYml0LXBvaW50LW1vdGlvbi1ob29rcyIpOwo= --Multipart_Tue_Mar__1_10:44:58_2016-1--
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Keith David Bershatsky <esq@HIDDEN> Subject: bug#22873: Acknowledgement (25.1.50; Feature Request -- Multiple Cursors (built-in support)) Message-ID: <handler.22873.B.145685791711961.ack <at> debbugs.gnu.org> References: <m2oaayavh1.wl%esq@HIDDEN> X-Gnu-PR-Message: ack 22873 X-Gnu-PR-Package: emacs Reply-To: 22873 <at> debbugs.gnu.org Date: Tue, 01 Mar 2016 18:46:02 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): bug-gnu-emacs@HIDDEN If you wish to submit further information on this problem, please send it to 22873 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 22873: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D22873 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: Can we support multiple Cursors? Resent-From: John Wiegley <jwiegley@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Thu, 03 Mar 2016 06:31:02 +0000 Resent-Message-ID: <handler.22873.B22873.14569866499975 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Keith David Bershatsky <esq@HIDDEN> Cc: 22873 <at> debbugs.gnu.org, emacs-devel@HIDDEN Reply-To: John Wiegley <johnw@HIDDEN> Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.14569866499975 (code B ref 22873); Thu, 03 Mar 2016 06:31:02 +0000 Received: (at 22873) by debbugs.gnu.org; 3 Mar 2016 06:30:49 +0000 Received: from localhost ([127.0.0.1]:58460 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1abMmf-0002ap-Ck for submit <at> debbugs.gnu.org; Thu, 03 Mar 2016 01:30:49 -0500 Received: from mail-pf0-f172.google.com ([209.85.192.172]:33888) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from <jwiegley@HIDDEN>) id 1abMmc-0002ab-Vw for 22873 <at> debbugs.gnu.org; Thu, 03 Mar 2016 01:30:47 -0500 Received: by mail-pf0-f172.google.com with SMTP id 4so9119543pfd.1 for <22873 <at> debbugs.gnu.org>; Wed, 02 Mar 2016 22:30:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:in-reply-to:date:message-id:references :user-agent:reply-to:mail-followup-to:mime-version; bh=kTgBfVQcSvxLmhbfXIYA3GxChpR5h250pLMIcGYIAoQ=; b=wob6V9ogo0P1079wCFklKt0Hlabe6CcAI2JgDmm7bajzSWIXDSA7QtVxQuXITJMmXh sJEmWEobTfXQFylzJRBdUkahRokquNCIl4A1/RQqOok7mIIKK3ioLWGMa2n/9XdU63kI knsnGAnGHiFB/SQv0YdWByopsN0Y0gP8rxSnV6Vl5KlH5GjJl3BGg/xlqOrgiPZ3STgD EX53Gsh8jQvvLr0aciXT+A4TFaTsEu/ZcgtzomsfxcHDGFlfTGbl6Giz5yxvuxhD4Sp5 deKWlh0TxZLvtNTCUCZO91+crcKTyZw65yjKVH5vj5Hu+WWwlR7e7zZBziWCfApNewUK 4+3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:in-reply-to:date:message-id :references:user-agent:reply-to:mail-followup-to:mime-version; bh=kTgBfVQcSvxLmhbfXIYA3GxChpR5h250pLMIcGYIAoQ=; b=EdyIRVrKO0gl1/E0AdX7+AtZ/s54NeDVBDcwBgzjPW+86BR2lZykwlh6CIUvNdueYD EDRhgytpuFclo2NAkoLUdmO+Kvx5E+Td2B60+en47KLQ26I6i6i8jU1Jz1lOyZ78+ZXB zDFS2L1469C3ICY+cdKS77wBCa6inj8d0I+DrOAxI8KI0wpc7M4gqW0bZb5HoVOjEVLe pMVUFF+7OE7L0SfUenOngeJ2mFmICpBDmtGVtQ/HWu8C55gdB4mjshs2CSpGfeSTT3uZ LS0307Za0wdLhD2FXfw5CpfQkFN4jQbvnRDIm0SKGAjS2lVBt365ahj3Ol+Yre3W6PRo gtyA== X-Gm-Message-State: AD7BkJKi/EgDgeWmUgt+0KVimVx4P5FbBAh4eDyDHSHPHvHsNAGwkGIU7nL7IDw0K4BTNw== X-Received: by 10.98.17.26 with SMTP id z26mr1454619pfi.30.1456986641201; Wed, 02 Mar 2016 22:30:41 -0800 (PST) Received: from Vulcan.local (76-234-68-79.lightspeed.frokca.sbcglobal.net. [76.234.68.79]) by smtp.gmail.com with ESMTPSA id d65sm57399860pfb.74.2016.03.02.22.30.40 (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 02 Mar 2016 22:30:40 -0800 (PST) From: John Wiegley <jwiegley@HIDDEN> X-Google-Original-From: "John Wiegley" <johnw@HIDDEN> Received: by Vulcan.local (Postfix, from userid 501) id 6A98D133690D0; Wed, 2 Mar 2016 22:30:39 -0800 (PST) In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> (Keith David Bershatsky's message of "Tue, 01 Mar 2016 10:44:58 -0800") Date: Wed, 02 Mar 2016 22:30:38 -0800 Message-ID: <m2h9gocbu9.fsf@HIDDEN> References: <m2oaayavh1.wl%esq@HIDDEN> User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/24.5 (darwin) Mail-Followup-To: Keith David Bershatsky <esq@HIDDEN>, 22873 <at> debbugs.gnu.org, emacs-devel@HIDDEN MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.7 (/) >>>>> Keith David Bershatsky <esq@HIDDEN> writes: > As a feature request, it would be appreciated if the Emacs development team > could please consider adding built-in support for multiple cursors similar > to the Lisp library that Magnar Sveen has written: > https://github.com/magnars I like this request, but my spidey sense tells me that implementing this at the C level will introduce a huge number of ramifications that may not be immediately apparent. For example, (point) conceptually goes from being one position, to many. The implications of that are huge, which will mean introducing special cases to avoid them, which then has its own implications, etc. I'd like to see discussion on this idea in emacs-devel, so I'm copying there. This is something that deserves a larger audience than just those following bug #22873. Is multiple-cursor editing a realistic possibility? And is it worth the complexity? -- John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: Can we support multiple Cursors? Resent-From: Marcin Borkowski <mbork@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Thu, 03 Mar 2016 06:55:01 +0000 Resent-Message-ID: <handler.22873.B22873.145698806612551 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: John Wiegley <johnw@HIDDEN> Cc: Keith David Bershatsky <esq@HIDDEN>, 22873 <at> debbugs.gnu.org, emacs-devel@HIDDEN Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.145698806612551 (code B ref 22873); Thu, 03 Mar 2016 06:55:01 +0000 Received: (at 22873) by debbugs.gnu.org; 3 Mar 2016 06:54:26 +0000 Received: from localhost ([127.0.0.1]:58494 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1abN9W-0003GM-LC for submit <at> debbugs.gnu.org; Thu, 03 Mar 2016 01:54:26 -0500 Received: from mail.mojserwer.eu ([195.110.48.8]:50589) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from <mbork@HIDDEN>) id 1abN9U-0003GC-Vn for 22873 <at> debbugs.gnu.org; Thu, 03 Mar 2016 01:54:25 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 89BBC9D2003; Thu, 3 Mar 2016 07:54:23 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qHXmPKDPHuWa; Thu, 3 Mar 2016 07:54:20 +0100 (CET) Received: from localhost (unknown [109.232.24.28]) by mail.mojserwer.eu (Postfix) with ESMTPSA id BD2BD9D2002; Thu, 3 Mar 2016 07:54:20 +0100 (CET) References: <m2oaayavh1.wl%esq@HIDDEN> <m2h9gocbu9.fsf@HIDDEN> User-agent: mu4e 0.9.13; emacs 25.1.50.6 From: Marcin Borkowski <mbork@HIDDEN> In-reply-to: <m2h9gocbu9.fsf@HIDDEN> Date: Thu, 03 Mar 2016 07:54:17 +0100 Message-ID: <8760x49hly.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.7 (/) On 2016-03-03, at 07:30, John Wiegley <jwiegley@HIDDEN> wrote: >>>>>> Keith David Bershatsky <esq@HIDDEN> writes: > >> As a feature request, it would be appreciated if the Emacs development team >> could please consider adding built-in support for multiple cursors similar >> to the Lisp library that Magnar Sveen has written: >> https://github.com/magnars > > I like this request, but my spidey sense tells me that implementing this at > the C level will introduce a huge number of ramifications that may not be > immediately apparent. For example, (point) conceptually goes from being one > position, to many. The implications of that are huge, which will mean > introducing special cases to avoid them, which then has its own implications, > etc. > > I'd like to see discussion on this idea in emacs-devel, so I'm copying there. > This is something that deserves a larger audience than just those following > bug #22873. Is multiple-cursor editing a realistic possibility? And is it > worth the complexity? What would be the added value of having that built-in vs. having it on M?elpa? Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: Can we support multiple Cursors? Resent-From: Richard Stallman <rms@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Thu, 03 Mar 2016 11:22:02 +0000 Resent-Message-ID: <handler.22873.B22873.145700408710361 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Marcin Borkowski <mbork@HIDDEN> Cc: esq@HIDDEN, johnw@HIDDEN, 22873 <at> debbugs.gnu.org, emacs-devel@HIDDEN Reply-To: rms@HIDDEN Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.145700408710361 (code B ref 22873); Thu, 03 Mar 2016 11:22:02 +0000 Received: (at 22873) by debbugs.gnu.org; 3 Mar 2016 11:21:27 +0000 Received: from localhost ([127.0.0.1]:58649 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1abRJv-0002h2-CP for submit <at> debbugs.gnu.org; Thu, 03 Mar 2016 06:21:27 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50650) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from <rms@HIDDEN>) id 1abRJs-0002gc-Q7 for 22873 <at> debbugs.gnu.org; Thu, 03 Mar 2016 06:21:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <rms@HIDDEN>) id 1abRJn-0006jZ-10 for 22873 <at> debbugs.gnu.org; Thu, 03 Mar 2016 06:21:19 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51148) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <rms@HIDDEN>) id 1abRJT-0006Ud-I2; Thu, 03 Mar 2016 06:20:59 -0500 Received: from rms by fencepost.gnu.org with local (Exim 4.82) (envelope-from <rms@HIDDEN>) id 1abRJS-0002hO-PV; Thu, 03 Mar 2016 06:20:58 -0500 Content-Type: text/plain; charset=Utf-8 From: Richard Stallman <rms@HIDDEN> In-reply-to: <8760x49hly.fsf@HIDDEN> (message from Marcin Borkowski on Thu, 03 Mar 2016 07:54:17 +0100) References: <m2oaayavh1.wl%esq@HIDDEN> <m2h9gocbu9.fsf@HIDDEN> <8760x49hly.fsf@HIDDEN> Message-Id: <E1abRJS-0002hO-PV@HIDDEN> Date: Thu, 03 Mar 2016 06:20:58 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -5.0 (-----) [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > What would be the added value of having that built-in vs. having it on > M?elpa? Melpa and ELPA are totally different. ELPA is effectively an extension of Emacs, and we refer users there. Melpa is someone else's repository, which we cannot treat as part of Emacs. We do not steer users there. -- Dr Richard Stallman President, Free Software Foundation (gnu.org, fsf.org) Internet Hall-of-Famer (internethalloffame.org) Skype: No way! See stallman.org/skype.html.
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: Can we support multiple Cursors? Resent-From: Marcin Borkowski <mbork@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Thu, 03 Mar 2016 15:07:02 +0000 Resent-Message-ID: <handler.22873.B22873.14570175736429 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: rms@HIDDEN Cc: esq@HIDDEN, johnw@HIDDEN, 22873 <at> debbugs.gnu.org, emacs-devel@HIDDEN Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.14570175736429 (code B ref 22873); Thu, 03 Mar 2016 15:07:02 +0000 Received: (at 22873) by debbugs.gnu.org; 3 Mar 2016 15:06:13 +0000 Received: from localhost ([127.0.0.1]:60354 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1abUpR-0001fd-K6 for submit <at> debbugs.gnu.org; Thu, 03 Mar 2016 10:06:13 -0500 Received: from mail.mojserwer.eu ([195.110.48.8]:36035) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from <mbork@HIDDEN>) id 1abUpP-0001fU-2S for 22873 <at> debbugs.gnu.org; Thu, 03 Mar 2016 10:06:12 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id C2A249D2003; Thu, 3 Mar 2016 16:06:08 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tBLuhM6w6Clv; Thu, 3 Mar 2016 16:06:00 +0100 (CET) Received: from localhost (unknown [109.232.24.28]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 8C3439D2002; Thu, 3 Mar 2016 16:05:58 +0100 (CET) References: <m2oaayavh1.wl%esq@HIDDEN> <m2h9gocbu9.fsf@HIDDEN> <8760x49hly.fsf@HIDDEN> <E1abRJS-0002hO-PV@HIDDEN> User-agent: mu4e 0.9.13; emacs 25.1.50.6 From: Marcin Borkowski <mbork@HIDDEN> In-reply-to: <E1abRJS-0002hO-PV@HIDDEN> Date: Thu, 03 Mar 2016 16:05:52 +0100 Message-ID: <87ziuf8uun.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.7 (/) On 2016-03-03, at 12:20, Richard Stallman <rms@HIDDEN> wrote: > [[[ To any NSA and FBI agents reading my email: please consider ]]] > [[[ whether defending the US Constitution against all enemies, ]]] > [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > > > What would be the added value of having that built-in vs. having it on > > M?elpa? > > Melpa and ELPA are totally different. > > ELPA is effectively an extension of Emacs, and we refer users there. > > Melpa is someone else's repository, which we cannot treat as part of > Emacs. We do not steer users there. I understand all this. (In fact, I wanted to write Elpa, only to discover - to my surprise - that Magnar's multiple-cursors package is actually on Melpa. It is GPL'd, however.) Still, I think that trying to implement that in core would be duplicated effort, and the feature does not seem essential (it is roughly equivalent to keyboard macros, though admittedly way cooler). If anything, I'd check whether it can be put on Elpa. -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: Can we support multiple Cursors? Resent-From: Richard Stallman <rms@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 04 Mar 2016 09:20:01 +0000 Resent-Message-ID: <handler.22873.B22873.145708319217850 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Marcin Borkowski <mbork@HIDDEN> Cc: esq@HIDDEN, johnw@HIDDEN, 22873 <at> debbugs.gnu.org, emacs-devel@HIDDEN Reply-To: rms@HIDDEN Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.145708319217850 (code B ref 22873); Fri, 04 Mar 2016 09:20:01 +0000 Received: (at 22873) by debbugs.gnu.org; 4 Mar 2016 09:19:52 +0000 Received: from localhost ([127.0.0.1]:60809 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ablto-0004dq-M6 for submit <at> debbugs.gnu.org; Fri, 04 Mar 2016 04:19:52 -0500 Received: from eggs.gnu.org ([208.118.235.92]:43966) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from <rms@HIDDEN>) id 1abltm-0004dd-QZ for 22873 <at> debbugs.gnu.org; Fri, 04 Mar 2016 04:19:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <rms@HIDDEN>) id 1abltg-0006xM-UQ for 22873 <at> debbugs.gnu.org; Fri, 04 Mar 2016 04:19:45 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42855) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <rms@HIDDEN>) id 1abltS-0006sX-5T; Fri, 04 Mar 2016 04:19:30 -0500 Received: from rms by fencepost.gnu.org with local (Exim 4.82) (envelope-from <rms@HIDDEN>) id 1abltR-0000uv-EX; Fri, 04 Mar 2016 04:19:29 -0500 Content-Type: text/plain; charset=Utf-8 From: Richard Stallman <rms@HIDDEN> In-reply-to: <87ziuf8uun.fsf@HIDDEN> (message from Marcin Borkowski on Thu, 03 Mar 2016 16:05:52 +0100) References: <m2oaayavh1.wl%esq@HIDDEN> <m2h9gocbu9.fsf@HIDDEN> <8760x49hly.fsf@HIDDEN> <E1abRJS-0002hO-PV@HIDDEN> <87ziuf8uun.fsf@HIDDEN> Message-Id: <E1abltR-0000uv-EX@HIDDEN> Date: Fri, 04 Mar 2016 04:19:29 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -5.0 (-----) [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > I understand all this. (In fact, I wanted to write Elpa, only to > discover - to my surprise - that Magnar's multiple-cursors package is > actually on Melpa. It is GPL'd, however.) Would he / can he contribute it so we can put it in ELPA? -- Dr Richard Stallman President, Free Software Foundation (gnu.org, fsf.org) Internet Hall-of-Famer (internethalloffame.org) Skype: No way! See stallman.org/skype.html.
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: Can we support multiple Cursors? References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 04 Mar 2016 23:18:01 +0000 Resent-Message-ID: <handler.22873.B22873.145713342420372 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Marcin Borkowski <mbork@HIDDEN> Cc: John Wiegley <jwiegley@HIDDEN>, 22873 <at> debbugs.gnu.org, Richard Stallman <rms@HIDDEN> Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.145713342420372 (code B ref 22873); Fri, 04 Mar 2016 23:18:01 +0000 Received: (at 22873) by debbugs.gnu.org; 4 Mar 2016 23:17:04 +0000 Received: from localhost ([127.0.0.1]:34172 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1abyy0-0005IV-JI for submit <at> debbugs.gnu.org; Fri, 04 Mar 2016 18:17:04 -0500 Received: from cobb.liquidweb.com ([50.28.13.150]:47218) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from <esq@HIDDEN>) id 1abyxz-0005I0-Hy for 22873 <at> debbugs.gnu.org; Fri, 04 Mar 2016 18:17:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date; bh=lUOWp2Top3MXMSmBNwLQ0ZZmEOT1vYNh/sNT1Xw13sU=; b=CkfId+YKAxCHHKNLXXSyg6p7vWUiytNGJ7qIOJofwJVA+MQiiDzquC9rV2sGplFzt9StOl1dH3MQGFseahQReOSq4paWGHnHjhF6S567XOnTomgKytfq4cTgzJamLtp+; Received: from rrcs-74-62-211-60.west.biz.rr.com ([74.62.211.60]:49450 helo=MBP.local.localhost) by cobb.liquidweb.com with esmtp (Exim 4.82) (envelope-from <esq@HIDDEN>) id 1abyxs-0002j1-8R; Fri, 04 Mar 2016 18:16:56 -0500 Date: Fri, 04 Mar 2016 15:16:56 -0800 Message-ID: <m2mvqdu93r.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 (generated by - "") Content-Type: text/plain; charset=US-ASCII X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cobb.liquidweb.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-Get-Message-Sender-Via: cobb.liquidweb.com: acl_c_relayhosts_text_entry: -unknown-@lawlist.com|lawlist.com X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.7 (/) I see this feature request as having two (2) distinct, yet related components. The fake cursors being the first component that will operate similar to overlays, and are thus fairly innocuous as they won't have any real affect on where point is located after redisplay finishes. The second component, however, is the functionality that can be found in Magnar Sveen's library and also is present in a popular commercial editor known as Sublime Text. I enjoy using the multiple cursors library written by Magnar Sveen, but often find myself taking advantage of the wait times to pour myself a cup of coffee while making edits with a few hundred fake cursors in a large buffer. E.g., I will type the word I want inserted or tap the arrow key a few times in a particular direction and then walk away from the computer or surf the web while Emacs does its thing. I often have to use `M-x replace-string` when dealing with large numbers of edits instead of using my preferred choice of multiple cursors. Admittedly, I am using a slightly older customized version of Mr. Sveen's library -- but I don't think the basic functionality has changed all that much since I first started using it. I am not a programmer by trade, but I assume there could be some significant speed increases by having multiple cursor abilities baked into the C code base of the Emacs internals. I don't think (based on my limited programming knowledge) that all of the cursor-types are presently available as overlays. I need the left bar cursor so that I can draw my solid vertical line that tracks the cursor position, and so that is what motivated me to write a sample draft patch to the C internals. My draft is progressing nicely, but it is slow to perfect because I am learning a few of the basics to the C language as I go. I'll post to #22873 a revised draft of the first component (i.e., just fake cursors) in the next few days depending upon how many road blocks I encounter. I've set up a simple cache of x/y/hpos/vpos so that recalculation is not necessary when the list of fake cursors doesn't change -- cursors are redrawn more than once per command loop depending upon what happens, e.g., with the mouse, etc. And a user may not wish to change the positions of fake cursors every command loop, so the cache is helpful. It may be a very long time, however, before I have enough basic skills to be able to implement some of the functionality of the second component. I understand the implementation of feature 22873 is only a discussion at this point in time. The beauty of Emacs, however, is that it's open source and I can make modifications to a custom build for my in-house use. :) Keith ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; At Thu, 03 Mar 2016 07:54:17 +0100, Marcin Borkowski wrote: > > > * * * > > What would be the added value of having that built-in vs. having it on > M?elpa? > > Best, > > -- > Marcin Borkowski
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: Can we support multiple Cursors? Resent-From: Marcin Borkowski <mbork@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sat, 05 Mar 2016 07:01:01 +0000 Resent-Message-ID: <handler.22873.B22873.145716120330955 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Keith David Bershatsky <esq@HIDDEN> Cc: John Wiegley <jwiegley@HIDDEN>, 22873 <at> debbugs.gnu.org, Richard Stallman <rms@HIDDEN> Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.145716120330955 (code B ref 22873); Sat, 05 Mar 2016 07:01:01 +0000 Received: (at 22873) by debbugs.gnu.org; 5 Mar 2016 07:00:03 +0000 Received: from localhost ([127.0.0.1]:34247 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ac6C2-00083D-UB for submit <at> debbugs.gnu.org; Sat, 05 Mar 2016 02:00:03 -0500 Received: from mail.mojserwer.eu ([195.110.48.8]:52890) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from <mbork@HIDDEN>) id 1ac6C0-00082H-Ed for 22873 <at> debbugs.gnu.org; Sat, 05 Mar 2016 02:00:01 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 900E79D3BCC; Sat, 5 Mar 2016 07:59:57 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BO6DQXXdCG7f; Sat, 5 Mar 2016 07:59:53 +0100 (CET) Received: from localhost (unknown [109.232.24.28]) by mail.mojserwer.eu (Postfix) with ESMTPSA id A46E99D3BCA; Sat, 5 Mar 2016 07:59:53 +0100 (CET) References: <m2oaayavh1.wl%esq@HIDDEN> <m2mvqdu93r.wl%esq@HIDDEN> User-agent: mu4e 0.9.13; emacs 25.1.50.6 From: Marcin Borkowski <mbork@HIDDEN> In-reply-to: <m2mvqdu93r.wl%esq@HIDDEN> Date: Sat, 05 Mar 2016 07:59:52 +0100 Message-ID: <87d1r9mmtz.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.7 (/) On 2016-03-05, at 00:16, Keith David Bershatsky <esq@HIDDEN> wrote: > I enjoy using the multiple cursors library written by Magnar Sveen, > but often find myself taking advantage of the wait times to pour > myself a cup of coffee while making edits with a few hundred fake > cursors in a large buffer. E.g., I will type the word I want inserted > or tap the arrow key a few times in a particular direction and then > walk away from the computer or surf the web while Emacs does its > thing. I often have to use `M-x replace-string` when dealing with > large numbers of edits instead of using my preferred choice of > multiple cursors. Admittedly, I am using a slightly older customized > version of Mr. Sveen's library -- but I don't think the basic > functionality has changed all that much since I first started using > it. Out of curiosity: did you try iedit? How does it compare wrt speed in such extreme cases? (If it's applicable at all, that is - it's way simpler than multiple-cursors, of course.) > Keith Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: Can we support multiple Cursors? References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Wed, 09 Mar 2016 06:28:02 +0000 Resent-Message-ID: <handler.22873.B22873.14575048337478 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Marcin Borkowski <mbork@HIDDEN>, John Wiegley <jwiegley@HIDDEN>, Richard Stallman <rms@HIDDEN> Cc: 22873 <at> debbugs.gnu.org Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.14575048337478 (code B ref 22873); Wed, 09 Mar 2016 06:28:02 +0000 Received: (at 22873) by debbugs.gnu.org; 9 Mar 2016 06:27:13 +0000 Received: from localhost ([127.0.0.1]:40414 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1adXaS-0001wX-NB for submit <at> debbugs.gnu.org; Wed, 09 Mar 2016 01:27:12 -0500 Received: from cobb.liquidweb.com ([50.28.13.150]:38894) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from <esq@HIDDEN>) id 1adXaQ-0001wJ-Lc for 22873 <at> debbugs.gnu.org; Wed, 09 Mar 2016 01:27:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date; bh=kgmqyX7DfQTzbZBaYUw+d4U5F1ChPR0TLMEhJPpXHJA=; b=8S2uwGPGqsBecBkZ/+9AEGVrwULbFlxfPr1wT0sGruuAzcA+Rc8ws5JdVwSjSFbu1IDAn2zao/pTTItfjUQEoBXcTnGPyuk9jEjtQfEfJhpI9bJbKiFK4xR1uKf9z+lU; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:56454 helo=server.private.localhost) by cobb.liquidweb.com with esmtp (Exim 4.82) (envelope-from <esq@HIDDEN>) id 1adXaH-00031Q-Mw; Wed, 09 Mar 2016 01:27:02 -0500 Date: Tue, 08 Mar 2016 22:27:02 -0800 Message-ID: <m2twkg5fpl.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 (generated by - "") Content-Type: multipart/mixed; boundary="Multipart_Tue_Mar__8_22:27:01_2016-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cobb.liquidweb.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-Get-Message-Sender-Via: cobb.liquidweb.com: acl_c_relayhosts_text_entry: lawlist|lawlist.com X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.7 (/) --Multipart_Tue_Mar__8_22:27:01_2016-1 Content-Type: text/plain; charset=US-ASCII The second draft of the proposed feature for multiple fake cursors is attached. For the record, I'm not a programmer -- just a hobbyist -- and the draft patch is not meant to be a proposed official patch -- it is just a working proof concept. The patch contains a few extra things that I use for debugging and also for drawing my solid vertical line that tracks the cursor position. It has been tested to some extent on Emacs built for OSX 10.6.8 and Windows XP (SP-3). Different colors for each fake cursor have already been implemented on Emacs for OSX, but I haven't yet looked into how to accomplish that objective on Emacs for Windows. The draft concept patch is for the master branch as of March 8, 2016 bearing commit "e0400b72a24d67b53f71c8b97915cae599e36c37". After applying the patch, the new feature can be tested as follows: (defun mc-test (&optional list) "Draw fake cursors at all POS defined in the `mc-list'." (interactive) (setq mc-list '( (3 "hbar" [1.0 0.0 0.0]) (4 "bar" [0.0 1.0 0.0]) (5 "box" [0.0 0.0 1.0]) (6 "hollow" [1.0 1.0 1.0]) (7 ("hbar" 3) [1.0 0.0 1.0]) (8 ("bar" 3) [0.0 1.0 1.0])))) (global-set-key [f1] 'mc-test) To remove the cursors or change the cursors, just modify the buffer-local variable `mc-list' -- e.g., `(setq mc-list nil)` removes them all. The colors on OSX are the standard RGB color vector. Thank you, Marcin, for the referral to the ideit feature. I will certainly try that feature out in the next few days, but have been buried in life's daily activities and also in acquiring the necessary skills to implement the fake cursors feature. It sure would be great if a real programmer (instead of just a hobbyist like myself) could take this feature to the next level. If the Windows setup is anything similar to OSX, implementing colors should not be that difficult to achieve (at least I hope that is the case). I would like this feature to be similar to the original cursor such that a variable like `cursor-in-non-selected-windows' can be used to make the fake cursors displayed in only the selected window or in all windows where those points are visible. At the present time, I've set it up so that only the selected window receives the fake cursors (as that is my personal preference). Thank you for taking an interest in this potential new feature, Keith ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; At Sat, 05 Mar 2016 07:59:52 +0100, Marcin Borkowski wrote: > > * * * > > Out of curiosity: did you try iedit? How does it compare wrt speed in > such extreme cases? (If it's applicable at all, that is - it's way > simpler than multiple-cursors, of course.) --Multipart_Tue_Mar__8_22:27:01_2016-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="multiple_cursors.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3NyYy9idWZmZXIuYyBiL3NyYy9idWZmZXIuYwppbmRleCA5OGI2MWMzLi4w ZDNlYTc0IDEwMDY0NAotLS0gYS9zcmMvYnVmZmVyLmMKKysrIGIvc3JjL2J1ZmZlci5jCkBAIC01 MDczLDYgKzUwNzMsOSBAQCBpbml0X2J1ZmZlcl9vbmNlICh2b2lkKQogICBYU0VURkFTVElOVCAo QlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgZGlzcGxheV90YWJsZSksIGlkeCk7ICsraWR4Owog ICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgc3ludGF4X3RhYmxlKSwg aWR4KTsgKytpZHg7CiAgIFhTRVRGQVNUSU5UIChCVkFSICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBj YWNoZV9sb25nX3NjYW5zKSwgaWR4KTsgKytpZHg7CisgIFhTRVRGQVNUSU5UIChCVkFSICg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AgIGlu dCByZWQsIGludCBncmVlbiwgaW50IGJsdWUpOwogCiAgIC8qIERyYXcgdmVydGljYWwgYm9yZGVy IGZvciB3aW5kb3cgVyBmcm9tIChYLFlfMCkgdG8gKFgsWV8xKS4gICovCiAgIHZvaWQgKCpkcmF3 X3ZlcnRpY2FsX3dpbmRvd19ib3JkZXIpIChzdHJ1Y3Qgd2luZG93ICp3LApAQCAtMzI4NywxMSAr MzI4OCwxMSBAQCBleHRlcm4gdm9pZCB4X2ZpeF9vdmVybGFwcGluZ19hcmVhIChzdHJ1Y3Qgd2lu ZG93ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGVudW0gZ2x5cGhfcm93X2FyZWEsIGludCk7CiBleHRlcm4gdm9pZCBkcmF3X3BoeXNf Y3Vyc29yX2dseXBoIChzdHJ1Y3Qgd2luZG93ICosCiAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICosCi0gICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UpOworICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlLCBjaGFyICopOwogZXh0ZXJuIHZv aWQgZ2V0X3BoeXNfY3Vyc29yX2dlb21ldHJ5IChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlw aF9yb3cgKiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGds eXBoICosIGludCAqLCBpbnQgKiwgaW50ICopOwotZXh0ZXJuIHZvaWQgZXJhc2VfcGh5c19jdXJz b3IgKHN0cnVjdCB3aW5kb3cgKik7Ci1leHRlcm4gdm9pZCBkaXNwbGF5X2FuZF9zZXRfY3Vyc29y IChzdHJ1Y3Qgd2luZG93ICosIGJvb2wsIGludCwgaW50LCBpb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ciwgbWNfbGlzdCkpCisgICAgICAg ICAgICB8fCB3LT5tY19jYWNoZSkpCisgICAgeworICAgICAgaWYgKCgocG9zaW50ID49IENIQVJQ T1MgKHN0YXJ0cCkgJiYgcG9zaW50IDw9IEJVRl9aViAoYikpCisgICAgICAgICAgICAmJiBDSEFS UE9TIChzdGFydHApID49IEJVRl9CRUdWIChiKQorICAgICAgICAgICAgJiYgQ0hBUlBPUyAoc3Rh cnRwKSA8PSBCVUZfWlYgKGIpCisgICAgICAgICAgICAmJiBwb3NfdmlzaWJsZV9wICh3LCBwb3Np bnQsICZ4LCAmeSwgJnJ0b3AsICZyYm90LCAmcm93aCwgJnZwb3MpKSkKKyAgICAgICAgZnVsbHlf cCA9ICFydG9wICYmICFyYm90OworICAgICAgaWYgKGZ1bGx5X3ApCisgICAgICAgIHsKKyAgICAg ICAgICB3LT53aW5kb3dfc3RhcnRfZW5kX2hvb2tfaW50X3ByZXZpb3VzX3dpbmRvd19zdGFydCA9 IHctPndpbmRvd19zdGFydF9lbmRfaG9va19pbnRfd2luZG93X3N0YXJ0OworICAgICAgICAgIHct PndpbmRvd19zdGFydF9lbmRfaG9va19pbnRfd2luZG93X3N0YXJ0ID0gc3RhcnRwX2ludGVnZXI7 CisgICAgICAgICAgaXRkYXRhID0gYmlkaV9zaGVsdmVfY2FjaGUgKCk7CisgICAgICAgICAgc3Rh cnRfZGlzcGxheSAoJml0LCB3LCBzdGFydHApOworICAgICAgICAgIG1vdmVfaXRfdmVydGljYWxs eSAoJml0LCB3aW5kb3dfYm94X2hlaWdodCAodykpOworICAgICAgICAgIGlmIChpdC5jdXJyZW50 X3kgPCBpdC5sYXN0X3Zpc2libGVfeSkKKyAgICAgICAgICAgIG1vdmVfaXRfcGFzdF9lb2wgKCZp dCk7CisgICAgICAgICAgZW5kcCA9IChJVF9DSEFSUE9TIChpdCkpOworICAgICAgICAgIHctPndp bmRvd19zdGFydF9lbmRfaG9va19pbnRfcHJldmlvdXNfd2luZG93X2VuZCA9IHctPndpbmRvd19z dGFydF9lbmRfaG9va19pbnRfd2luZG93X2VuZDsKKyAgICAgICAgICB3LT53aW5kb3dfc3RhcnRf ZW5kX2hvb2tfaW50X3dpbmRvd19lbmQgPSBlbmRwOworICAgICAgICAgIGJpZGlfdW5zaGVsdmVf Y2FjaGUgKGl0ZGF0YSwgZmFsc2UpOworICAgICAgICAgIFNFVF9QVCAoc3RhcnRwX2ludGVnZXIp OworICAgICAgICAgIHBib2xfc3RhcnRwID0gWElOVCAoRmxpbmVfYmVnaW5uaW5nX3Bvc2l0aW9u IChRbmlsKSk7CisgICAgICAgICAgU0VUX1BUIChlbmRwKTsKKyAgICAgICAgICBwZW9sX2VuZHAg PSBYSU5UIChGbGluZV9lbmRfcG9zaXRpb24gKFFuaWwpKTsKKyAgICAgICAgICBTRVRfUFQgKHBv c2ludCk7CisjaWZkZWYgR0xZUEhfREVCVUcKKyAgICAgICAgICBkZWJ1Z19tZXRob2RfYWRkICh3 LCAiJXMgLS0geDogJWQgfCB5OiAlZCB8IHN0YXJ0cDogJWQgfCBlbmRwOiAlZCB8IHBib2xfc3Rh cnRwOiAlZCB8IHBlb2xfZW5kcDogJWQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHN0cmluZywgeCwgeSwgc3RhcnRwX2ludGVnZXIsIGVuZHAsIHBib2xfc3RhcnRwLCBwZW9sX2Vu ZHApOworI2VuZGlmCisgICAgICAgICAgLyogUmVzZXQgdGhlIGZsYWcgX2JlZm9yZV8gY2FsbGlu ZyBMaXNwLCBub3QgYWZ0ZXIsIHNvIHRoYXQKKyAgICAgICAgICAgICBpZiBMaXNwIGRvZXMgc2ln bmFsIGFuIGVycm9yLCB0aGUgZmxhZyB3aWxsIGJlIHJlc2V0LCBhbmQKKyAgICAgICAgICAgICB3 b24ndCBjYXVzZSB0aGUgaG9vayB0byBiZSBjYWxsZWQgYWQgbmF1c2VhbS4gICovCisgICAgICAg ICAgdy0+d2luZG93X3N0YXJ0X2VuZF9ob29rX3BlbmRpbmcgPSBmYWxzZTsKKyAgICAgICAgICAv KiBXaGVuIGNhbGxpbmcgTGlzcCBmcm9tIHJlZGlzcGxheSwgYWx3YXlzIHVzZSBzYWZlX2NhbGws IHRvIGJlCisgICAgICAgICAgICAgcHJvdGVjdGVkIGFnYWluc3QgZXJyb3JzIHNpZ25hbGVkIGJ5 IHRoYXQgTGlzcC4gICovCisgICAgICAgICAgLyogc2FmZV9jYWxsOiAgZm4sIGFyZzEsIGFyZzIs IGFyZzMsIGFyZzQsIGFyZzUsIGFyZzYsIGFyZzcgICovCisgICAgICAgICAgc2FmZV9jYWxsICg4 LAorICAgICAgICAgICAgICBRcnVuX2hvb2tfd2l0aF9hcmdzLAorICAgICAgICAgICAgICBRd2lu ZG93X3N0YXJ0X2VuZF9ob29rLAorICAgICAgICAgICAgICB3aW5kb3csCisgICAgICAgICAgICAg IG1ha2VfbnVtYmVyIChzdGFydHBfaW50ZWdlciksCisgICAgICAgICAgICAgIG1ha2VfbnVtYmVy IChlbmRwKSwKKyAgICAgICAgICAgICAgbWFrZV9udW1iZXIgKHBib2xfc3RhcnRwKSwKKyAgICAg ICAgICAgICAgbWFrZV9udW1iZXIgKHBlb2xfZW5kcCksCisgICAgICAgICAgICAgIGZ1bGx5X3Ag PyBRdCA6IFFuaWwpOworICAgICAgICAgIC8qIEF0IHRoZSBjYXRjaC1hbGwgd2hlbiBzY3JvbGxp bmcgd2l0aCB0aGUgbW91c2Ugd2hlZWwsIHRoaXMgbmV4dCBzZWN0aW9uIGNhdXNlcyBhIHZpc3Vh bCBmbGFzaAorICAgICAgICAgIG9mIGN1cnNvciBpbiB0aGUgd3JvbmcgcG9zaXRpb24gZHVlIHRv IFNFVF9QVCBhYm92ZS4gICovCisgICAgICAgICAgaWYgKGZvcmNlKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICBjbGVhcl9nbHlwaF9tYXRyaXggKHctPmRlc2lyZWRfbWF0cml4KTsKKyAg ICAgICAgICAgICAgdHJ5X3dpbmRvdyAod2luZG93LCBzdGFydHAsIDApOworICAgICAgICAgICAg fQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisjaWZkZWYgR0xZUEhfREVC VUcKKyAgICAgICAgICAgIC8qIFNlZSB0aGUgZG9jLXN0cmluZyBmb3IgYHBvcy12aXNpYmxlLWlu LXdpbmRvdy1wJy4gICovCisgICAgICAgICAgICBkZWJ1Z19tZXRob2RfYWRkICh3LCAiJXMgLS0g eDogJWQgfCB5OiAlZCB8IHJ0b3A6ICVkIHwgcmJvdCAlZCB8IHJvd2g6ICVkIHwgdnBvczogJWQi LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyaW5nLCB4LCB5LCBydG9wLCBy Ym90LCByb3doLCB2cG9zKTsKKyNlbmRpZgorICAgICAgICAgIH0KKyAgICB9CisgIGlmIChvbGRf YnVmZmVyKQorICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworfQogCiAvKiBQ ZXJoYXBzIGluIHRoZSBmdXR1cmUgYXZvaWQgcmVjZW50ZXJpbmcgd2luZG93cyBpZiBpdAogICAg aXMgbm90IG5lY2Vzc2FyeTsgY3VycmVudGx5IHRoYXQgY2F1c2VzIHNvbWUgcHJvYmxlbXMuICAq LwpAQCAtMTM2ODcsNiArMTM3NzQsNyBAQCByZWRpc3BsYXlfaW50ZXJuYWwgKHZvaWQpCiAgICAg ICAmJiBtYXRjaF9wCiAgICAgICAmJiAhdy0+Zm9yY2Vfc3RhcnQKICAgICAgICYmICF3LT5vcHRp b25hbF9uZXdfc3RhcnQKKyAgICAgICYmICF3LT53aW5kb3dfc3RhcnRfZW5kX2hvb2tfZm9yY2UK ICAgICAgIC8qIFBvaW50IG11c3QgYmUgb24gdGhlIGxpbmUgdGhhdCB3ZSBoYXZlIGluZm8gcmVj b3JkZWQgYWJvdXQuICAqLwogICAgICAgJiYgUFQgPj0gQ0hBUlBPUyAodGxidWZwb3MpCiAgICAg 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yAgICB7CisgICAgICBsaW5lID0gMTsKKyAgICAgIGxpbmVw b3MgPSBCVUZfQkVHViAoYik7CisgICAgICBsaW5lcG9zX2J5dGUgPSBCVUZfQkVHVl9CWVRFIChi KTsKKyAgICB9CisgIC8qIENvdW50IGxpbmVzIGZyb20gYmFzZSBsaW5lIHRvIHdpbmRvdyBzdGFy dCBwb3NpdGlvbi4gICovCisgIG5saW5lcyA9IGRpc3BsYXlfY291bnRfbGluZXMgKGxpbmVwb3Nf Ynl0ZSwKKyAgICAgICAgICAgICAgc3RhcnRwb3NfYnl0ZSwKKyAgICAgICAgICAgICAgc3RhcnRw b3MsICZqdW5rKTsKKyAgdG9wbGluZSA9IG5saW5lcyArIGxpbmU7CisgIC8qIERldGVybWluZSBh IG5ldyBiYXNlIGxpbmUsIGlmIHRoZSBvbGQgb25lIGlzIHRvbyBjbG9zZQorICAgICBvciB0b28g ZmFyIGF3YXksIG9yIGlmIHdlIGRpZCBub3QgaGF2ZSBvbmUuCisgICAgICJUb28gY2xvc2UiIG1l YW5zIGl0J3MgcGxhdXNpYmxlIGEgc2Nyb2xsLWRvd24gd291bGQKKyAgICAgZ28gYmFjayBwYXN0 IGl0LiAgKi8KKyAgaWYgKHN0YXJ0cG9zID09IEJVRl9CRUdWIChiKSkKKyAgICB7CisgICAgICB3 LT5iYXNlX2xpbmVfbnVtYmVyID0gdG9wbGluZTsKKyAgICAgIHctPmJhc2VfbGluZV9wb3MgPSBC VUZfQkVHViAoYik7CisgICAgfQorICBlbHNlIGlmIChubGluZXMgPCBoZWlnaHQgKyAyNSB8fCBu bGluZXMgPiBoZWlnaHQgKiAzICsgNTAKKyAgICAgfHwgbGluZXBvcyA9PSBCVUZfQkVHViAoYikp CisgICAgeworICAgICAgcHRyZGlmZl90IGxpbWl0ID0gQlVGX0JFR1YgKGIpOworICAgICAgcHRy ZGlmZl90IGxpbWl0X2J5dGUgPSBCVUZfQkVHVl9CWVRFIChiKTsKKyAgICAgIHB0cmRpZmZfdCBw b3NpdGlvbjsKKyAgICAgIHB0cmRpZmZfdCBkaXN0YW5jZSA9CisgICAgICAgIChoZWlnaHQgKiAy ICsgMzApICogbGluZV9udW1iZXJfZGlzcGxheV9saW1pdF93aWR0aDsKKyAgICAgIGlmIChzdGFy dHBvcyAtIGRpc3RhbmNlID4gbGltaXQpCisgICAgICAgIHsKKyAgICBsaW1pdCA9IHN0YXJ0cG9z IC0gZGlzdGFuY2U7CisgICAgbGltaXRfYnl0ZSA9IENIQVJfVE9fQllURSAobGltaXQpOworICAg ICAgICB9CisgICAgICBubGluZXMgPSBkaXNwbGF5X2NvdW50X2xpbmVzIChzdGFydHBvc19ieXRl LAorICAgICAgICAgICAgbGltaXRfYnl0ZSwKKyAgICAgICAgICAgIC0gKGhlaWdodCAqIDIgKyAz MCksCisgICAgICAgICAgICAmcG9zaXRpb24pOworICAgICAgLyogSWYgd2UgY291bGRuJ3QgZmlu ZCB0aGUgbGluZXMgd2Ugd2FudGVkIHdpdGhpbgorICAgICAgICAgbGluZV9udW1iZXJfZGlzcGxh eV9saW1pdF93aWR0aCBjaGFycyBwZXIgbGluZSwKKyAgICAgICAgIGdpdmUgdXAgb24gbGluZSBu dW1iZXJzIGZvciB0aGlzIHdpbmRvdy4gICovCisgICAgICBpZiAocG9zaXRpb24gPT0gbGltaXRf Ynl0ZSAmJiBsaW1pdCA9PSBzdGFydHBvcyAtIGRpc3RhbmNlKQorICAgICAgICB7CisgICAgdy0+ YmFzZV9saW5lX3BvcyA9IC0xOworICAgIHctPmJhc2VfbGluZV9udW1iZXIgPSAwOworICAgIGdv dG8gbm9fdmFsdWU7CisgICAgICAgIH0KKyAgICAgIHctPmJhc2VfbGluZV9udW1iZXIgPSB0b3Bs aW5lIC0gbmxpbmVzOworICAgICAgdy0+YmFzZV9saW5lX3BvcyA9IEJZVEVfVE9fQ0hBUiAocG9z aXRpb24pOworICAgIH0KKyAgLyogTm93IGNvdW50IGxpbmVzIGZyb20gdGhlIHN0YXJ0IHBvcyB0 byBwb2ludC4gICovCisgIG5saW5lcyA9IGRpc3BsYXlfY291bnRfbGluZXMgKHN0YXJ0cG9zX2J5 dGUsIFBUX0JZVEUsIFBULCAmanVuayk7CisgIC8qIE1ha2UgdGhlIHN0cmluZyB0byBzaG93LiAg Ki8KKyAgcGludDJzdHIgKGRlY29kZV9tb2RlX3NwZWNfYnVmLCB3aWR0aCwgdG9wbGluZSArIG5s aW5lcyk7CisgIHJldHVybiBkZWNvZGVfbW9kZV9zcGVjX2J1ZjsKKyAgICBub192YWx1ZToKKyAg ICAgICAgeworICAgIGNoYXIgKnAgPSBkZWNvZGVfbW9kZV9zcGVjX2J1ZjsKKyAgICBpbnQgcGFk ID0gd2lkdGggLSAyOworICAgIHdoaWxlIChwYWQtLSA+IDApCisgICAgICAqcCsrID0gJyAnOwor ICAgICpwKysgPSAnPyc7CisgICAgKnArKyA9ICc/JzsKKyAgICAqcCA9ICdcMCc7CisgICAgcmV0 dXJuIGRlY29kZV9tb2RlX3NwZWNfYnVmOworICB9CisgICAgICB9CisgICAgICBicmVhazsKKyAg ICB9CisgIGlmIChTVFJJTkdQIChvYmopKQorICAgIHsKKyAgICAgICpzdHJpbmcgPSBvYmo7Cisg ICAgICByZXR1cm4gU1NEQVRBIChvYmopOworICAgIH0KKyAgZWxzZQorICAgIHJldHVybiAiIjsK K30KKworREVGVU4gKCJsaW5lLW51bWJlci1hdC1wb3NpdGlvbiIsIEZsaW5lX251bWJlcl9hdF9w b3NpdGlvbiwgU2xpbmVfbnVtYmVyX2F0X3Bvc2l0aW9uLCAxLCAyLCAwLAorICAgICAgIGRvYzog LyogUmV0dXJuIGxpbmUgbnVtYmVyIGF0IHBvc2l0aW9uLiAgKi8pCisgIChMaXNwX09iamVjdCB3 aW5kb3csIExpc3BfT2JqZWN0IHBvcykKK3sKKyAgc3RydWN0IHdpbmRvdyAqdyA9IGRlY29kZV9s aXZlX3dpbmRvdyAod2luZG93KTsKKyAgTGlzcF9PYmplY3QgYnVmLCBmb29fc3R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KKyAgICAgIHNw ZWMgPSBpbnRlcm5hbF9saW5lX251bWJlcl9hdF9wb3NpdGlvbiAodywgJ2wnLCAwLCAmZm9vX3N0 cmluZyk7CisgICAgICBsaW5lID0gYnVpbGRfc3RyaW5nIChzcGVjKTsKKyAgICAgIGxpbmUgPSBG c3RyaW5nX3RvX251bWJlciAobGluZSwgbWFrZV9udW1iZXIgKDEwKSk7CisgICAgICBGdmVydGlj YWxfbW90aW9uIChtYWtlX251bWJlciAoMSksIHdpbmRvdywgUW5pbCk7CisgICAgICAvKiBteV95 ID0gKGZyYW1lX2NoYXJfaGVpZ2h0ICogY291bnRlcikgKyB3aW5kb3dfaGVhZGVyX2xpbmVfaGVp Z2h0OyAgKi8KKyAgICAgIC8qIG15X3kgPSBmcmFtZV9jaGFyX2hlaWdodCAqIGNvdW50ZXI7ICAq LworICAgICAgbmV3X3Bib2wgPSBYSU5UIChGbGluZV9iZWdpbm5pbmdfcG9zaXRpb24gKFFuaWwp KTsKKyAgICAgIG5ld19wZW9sID0gWElOVCAoRmxpbmVfZW5kX3Bvc2l0aW9uIChRbmlsKSk7Cisg ICAgICBpZiAoUFQgPT0gZW5kICYmICEoUFQgPT0gbmV3X3Bib2wpKQorICAgICAgICBwZW92bCA9 IGVuZDsKKyAgICAgICAgZWxzZSBpZiAob2xkX3Bib2wgPT0gb2xkX3Blb2wpCisgICAgICAgICAg eworICAgICAgICAgICAgcGJvdmwgPSBvbGRfcGJvbDsKKyAgICAgICAgICAgIHBlb3ZsID0gb2xk X3Blb2w7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHBlb3ZsID0g UFQgLSAxOworICAgICAgY29sX2VvdmwgPSBwZW92bCAtIHBib3ZsOworICAgICAgcGJvdmxfbWlu dXNfMSA9IHBib3ZsIC0gMTsKKyAgICAgIHBlb3ZsX3BsdXNfMSA9IHBlb3ZsICsgMTsKKyAgICAg IGlmIChvbGRfcGJvbCA9PSBvbGRfcGVvbCkKKyAgICAgICAgcGZjaSA9IG9sZF9wYm9sOworICAg ICAgICBlbHNlIGlmICgocGJvdmwgKyB2Y29sKSA8PSBwZW92bCkKKyAgICAgICAgICBwZmNpID0g cGJvdmwgKyB2Y29sOworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHBmY2kgPSBwZW92bDsK KyAgICAgIGlmIChwZmNpID4gMCAmJiAhKHBmY2kgPj0gbWF4KSkKKyAgICAgICAgeworICAgICAg ICAgIC8qIHRlbXAgPSBGcG9zbl9hdF9wb2ludCAobWFrZV9udW1iZXIgKHBmY2kpLCB3aW5kb3cp OworICAgICAgICAgIHggPSBYSU5UIChYQ0FSIChGbnRoIChtYWtlX251bWJlciAoMiksIHRlbXAp KSk7CisgICAgICAgICAgeSA9IFhJTlQgKFhDRFIgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgdGVt cCkpKTsKKyAgICAgICAgICBocG9zID0gWElOVCAoWENBUiAoRm50aCAobWFrZV9udW1iZXIgKDYp LCB0ZW1wKSkpOworICAgICAgICAgIHZwb3MgPSBYSU5UIChYQ0RSIChGbnRoIChtYWtlX251bWJl ciAoNiksIHRlbXApKSk7ICAqLworICAgICAgICAgIHBmY2lfbWludXNfMSA9IHBmY2kgLSAxOwor ICAgICAgICAgIHBmY2lfcGx1c18xID0gcGZjaSArIDE7CisgICAgICAgIH0KKyAgICAgIGlmIChw ZmNpID4gMCAmJiAhKHBmY2kgPj0gbWF4KSkKKyAgICAgICAgY2hhcl9hdF9wZmNpID0gKEZjaGFy X2FmdGVyIChtYWtlX251bWJlciAocGZjaSkpKTsKKyAgICAgICAgZWxzZQorICAgICAgICAgIGNo YXJfYXRfcGZjaSA9IFFuaWw7CisgICAgICBpZiAocGZjaV9taW51c18xID4gMCAmJiAhKHBmY2lf bWludXNfMSA+PSBtYXgpKQorICAgICAgICBjaGFyX2JlZm9yZV9wZmNpID0gKEZjaGFyX2FmdGVy IChtYWtlX251bWJlciAocGZjaV9taW51c18xKSkpOworICAgICAgICBlb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YnV0IHdlIGRyYXcgdGhlIGN1cnNv ciBhdCB0aGUgY29ycmVzcG9uZGluZworICAgICAgICAgICB3aW5kb3cgbWFyZ2luIGluIHRoYXQg Y2FzZS4gICovCisgICAgICAgICAgaWYgKCFjdXJzb3Jfcm93LT5yZXZlcnNlZF9wICYmIGhwb3Mg PCAwKQorICAgICAgICAgICAgaHBvcyA9IDA7CisgICAgICAgICAgaWYgKGN1cnNvcl9yb3ctPnJl dmVyc2VkX3AgJiYgaHBvcyA+PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAg ICAgICBocG9zID0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gMTsKKyAgICAgICAgfQor ICAgICAgaWYgKDAgPD0gaHBvcyAmJiBocG9zIDwgY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFd KQorICAgICAgICBjdXJzb3JfZ2x5cGggPSBjdXJzb3Jfcm93LT5nbHlwaHNbVEVYVF9BUkVBXSAr IGhwb3M7CisgICAgICBlbHNlCisgICAgICAgIGN1cnNvcl9nbHlwaCA9IE5VTEw7CisgICAgICBp ZiAoY3Vyc29yX2dseXBoID09IE5VTEwpCisgICAgICAgIGdvdG8gbWFya19jdXJzb3Jfb2ZmOwor ICAgICAgd2lkdGggPSBjdXJzb3JfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgaG9sbG93X3gg PSB4OworICAgICAgaWYgKHggPCAwKQorICAgICAgICB7CisgICAgICAgICAgd2lkdGggKz0gaG9s bG93X3g7CisgICAgICAgICAgaG9sbG93X3ggPSAwOworICAgICAgICB9CisgICAgICB3aWR0aCA9 IG1pbiAod2lkdGgsIHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSkgLSBob2xsb3dfeCk7 CisgICAgICBob2xsb3dfeSA9IFdJTkRPV19UT19GUkFNRV9QSVhFTF9ZICh3LCBtYXggKGhlYWRl cl9saW5lX2hlaWdodCwgY3Vyc29yX3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LTEsIE1PVkVfVE9f UE9TKTsKKyAgICAgIHBvcyA9IGl0LmN1cnJlbnQucG9zOworICAgICAgeCA9IGl0LmN1cnJlbnRf eDsKKyAgICAgIHkgPSBpdC5jdXJyZW50X3k7CisgICAgICBocG9zID0gaXQuaHBvczsKKyAgICAg IHZwb3MgPSBpdC52cG9zOworICAgICAgYmlkaV91bnNoZWx2ZV9jYWNoZSAoaXRkYXRhLCBmYWxz ZSk7CisgICAgfQorICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgeCA9IC0xOworICAgICAgICB5 ID0gLTE7CisgICAgICAgIGhwb3MgPSAtMTsKKyAgICAgICAgdnBvcyA9IC0xOworICAgICAgfQor ICByZXR1cm4gbGlzdG4gKENPTlNUWVBFX1BVUkUsIDQsIG1ha2VfbnVtYmVyICh4KSwgbWFrZV9u dW1iZXIgKHkpLCBtYWtlX251bWJlciAoaHBvcyksIG1ha2VfbnVtYmVyICh2cG9zKSk7Cit9CisK K2ludAorbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoTGlzcF9PYmplY3QgYXJnKQoreworICBjaGFy ICpzdHI7CisgIGlmIChYVFlQRSAoYXJnKSA9PSBMaXNwX1N0cmluZykKKyAgICBzdHIgPSBTU0RB VEEgKGFyZyk7CisgIGVsc2UgaWYgKFhUWVBFIChhcmcpID09IExpc3BfU3ltYm9sKQorICAgIHN0 ciA9IFNTREFUQSAoU1lNQk9MX05BTUUgKGFyZykpOworICBlbHNlIHJldHVybiAtMTsKKyAgaWYg KCFzdHJjbXAgKHN0ciwgImJveCIpKQorICAgIHJldHVybiBGSUxMRURfQk9YX0NVUlNPUjsKKyAg aWYgKCFzdHJjbXAgKHN0ciwgImhvbGxvdyIpKQorICAgIHJldHVybiBIT0xMT1dfQk9YX0NVUlNP UjsKKyAgaWYgKCFzdHJjbXAgKHN0ciwgImhiYXIiKSkKKyAgICByZXR1cm4gSEJBUl9DVVJTT1I7 CisgIGlmICghc3RyY21wIChzdHIsICJiYXIiKSkKKyAgICByZXR1cm4gQkFSX0NVUlNPUjsKKyAg aWYgKCFzdHJjbXAgKHN0ciwgIm5vIikpCisgICAgcmV0dXJuIE5PX0NVUlNPUjsKKyAgcmV0dXJu IC0xOworfQorCisvKiBFWEFNUExFICMxOiAgKHNldHEgbWMtbGlzdCAnKCgzICJoYmFyIiBbMS4w IDAuMCAwLjBdKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoNCAidmJhciIgWzAu MCAxLjAgMS4wXSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDUgImJveCIgWzEu MCAxLjAgMS4wXSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDYgImhvbGxvdyIg WzEuMCAwLjAgMS4wXSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDcgKCJoYmFy IiAzKSBbMS4wIDAuMCAwLjBdKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoOCAo InZiYXIiIDMpIFswLjAgMS4wIDEuMF0pKSkKKyAgIEVYQU1QTEUgIzI6ICAoc2V0cSBtYy1saXN0 IG5pbCkKK1RoZSBgbWNfY2FjaGUnIGlzIGtlcHQgaW4gdGhlIGZvbGxvd2luZyBleGFtcGxlIGZv cm1hdDoKKycoKAorICAoMyAiaGJhciIgWzEuMCAwLjAgMC4wXSkKKyAgKDQgInZiYXIiIFswLjAg MS4wIDEuMF0pCisgICg1ICJib3giIFsxLjAgMS4wIDEuMF0pCisgICg2ICJob2xsb3ciIFsxLjAg MC4wIDEuMF0pCisgICg3ICgiaGJhciIgMykgWzEuMCAwLjAgMC4wXSkKKyAgKDggKCJ2YmFyIiAz KSBbMC4wIDEuMCAxLjBdKSkKKyAoKDUKKyAgICg0NCAyMCA0IDApKQorICAoNgorICAgKDU1IDIw IDUgMCkpCisgICg3CisgICAoNjYgMjAgNiAwKSkKKyAgKDgKKyAgICg3NyAyMCA3IDApKQorICAo OQorICAgKDg4IDIwIDggMCkpCisgICgxMAorICA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QorICAgICAgICAgICAgY3Vyc29yX3R5cGUgPSBtY19saXNwX3RvX2N1cnNvcl90eXBlIChY Q0FSIChjdXJzb3Jfc3BlY190eXBlKSk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAg IGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoY3Vyc29yX3NwZWNfdHlwZSk7 CisgICAgICAgICAgaWYgKENPTlNQIChjdXJzb3Jfc3BlY190eXBlKSkKKyAgICAgICAgICAgIGN1 cnNvcl93aWR0aCA9IFhJTlQgKFhDQVIgKFhDRFIgKGN1cnNvcl9zcGVjX3R5cGUpKSk7CisgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCA9IDE7CisgICAgICAgICAg Y3Vyc29yX2NvbG9yX3ZlY3RvciA9IEZudGggKG1ha2VfbnVtYmVyICgyKSwgY3Vyc29yX3NwZWNf bGlzdCk7CisgICAgICAgICAgcmVkID0gWEZMT0FUX0RBVEEgKEFSRUYgKGN1cnNvcl9jb2xvcl92 ZWN0b3IsIDApKTsKKyAgICAgICAgICBncmVlbiA9IFhGTE9BVF9EQVRBIChBUkVGIChjdXJzb3Jf Y29sb3JfdmVjdG9yLCAxKSk7CisgICAgICAgICAgYmx1ZSA9IFhGTE9BVF9EQVRBIChBUkVGIChj dXJzb3JfY29sb3JfdmVjdG9yLCAyKSk7CisgICAgICAgICAgaWYgKHBvc2ludAorICAgICAgICAg ICAgICAmJiB3LT53aW5kb3dfc3RhcnRfZW5kX2hvb2tfaW50X3dpbmRvd19zdGFydAorICAgICAg ICAgICAgICAmJiB3LT53aW5kb3dfc3RhcnRfZW5kX2hvb2tfaW50X3dpbmRvd19lbmQKKyAgICAg ICAgICAgICAgJiYgcG9zaW50ID49IHctPndpbmRvd19zdGFydF9lbmRfaG9va19pbnRfd2luZG93 X3N0YXJ0CisgICAgICAgICAgICAgICYmIHBvc2ludCA8PSB3LT53aW5kb3dfc3RhcnRfZW5kX2hv b2tfaW50X3dpbmRvd19lbmQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHhfeV9ocG9z X3Zwb3NfbGlzdCA9IFhDQVIgKFhDRFIgKFhDQVIgKHZsaXN0KSkpOworICAgICAgICAgICAgICB4 ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAg ICAgICAgICAgICAgeSA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgxKSwgeF95X2hwb3NfdnBv c19saXN0KSk7CisgICAgICAgICAgICAgIGhwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAo MiksIHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAgICAgICB2cG9zID0gWElOVCAoRm50 aCAobWFrZV9udW1iZXIgKDMpLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAg bWNfZXJhc2UgKHcsIHgsIHksIGhwb3MsIHZwb3MsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgs IHJlZCwgZ3JlZW4sIGJsdWUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICB3LT5t Y19jYWNoZSA9IFFuaWw7CisgICAgfQorICAgIGVsc2UgaWYgKHcgPT0gc3cKKyAgICAgICAgICAg ICYmIHctPndpbmRvd19zdGFydF9lbmRfaG9va19pbnRfd2luZG93X3N0YXJ0CisgICAgICAgICAg ICAmJiB3LT53aW5kb3dfc3RhcnRfZW5kX2hvb2tfaW50X3dpbmRvd19lbmQKKyAgICAgICAgICAg ICYmIHctPndpbmRvd19zdGFydF9lbmRfaG9va19pbnRfcHJldmlvdXNfd2luZG93X3N0YXJ0Cisg ICAgICAgICAgICAmJiB3LT53aW5kb3dfc3RhcnRfZW5kX2hvb2tfaW50X3ByZXZpb3VzX3dpbmRv d19lbmQKKyAgICAgICAgICAgICYmIHctPndpbmRvd19zdGFydF9lbmRfaG9va19pbnRfd2luZG93 X3N0YXJ0ID09IHctPndpbmRvd19zdGFydF9lbmRfaG9va19pbnRfcHJldmlvdXNfd2luZG93X3N0 YXJ0CisgICAgICAgICAgICAmJiB3LT53aW5kb3dfc3RhcnRfZW5kX2hvb2tfaW50X3dpbmRvd19l bmQgPT0gdy0+d2luZG93X3N0YXJ0X2VuZF9ob29rX2ludF9wcmV2aW91c193aW5kb3dfZW5kCisg ICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoY3VycmVudF9idWZmZXIsIG1jX2xpc3QpKQorICAg ICAgICAgICAgJiYgdy0+bWNfY2FjaGUKKyAgICAgICAgICAgICYmICFOSUxQIChGZXF1YWwgKEZu dGggKG1ha2VfbnVtYmVyICgwKSwgdy0+bWNfY2FjaGUpLCBCVkFSIChjdXJyZW50X2J1ZmZlciwg bWNfbGlzdCkpKSkKKyAgICAgIHsKKyNpZmRlZiBHTFlQSF9ERUJVRworICBkZWJ1Z19tZXRob2Rf YWRkICh3LCAibWNfY2FsYzogIGRyYXcgY3Vyc29ycyB1c2luZyBjYWNoZSIpOworI2VuZGlmCisg ICAgICAgIGZvciAodmxpc3QgPSBYQ0FSIChYQ0RSICh3LT5tY19jYWNoZSkpOworICAgICAgICAg ICAgIENPTlNQICh2bGlzdCk7CisgICAgICAgICAgICAgdmxpc3QgPSBYQ0RSICh2bGlzdCkpCisg ICAgICAgICAgeworICAgICAgICAgICAgY3Vyc29yX3NwZWNfbGlzdCA9IFhDQVIgKFhDQVIgKHZs aXN0KSk7CisgICAgICAgICAgICBwb3NpbnQgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMCks IGN1cnNvcl9zcGVjX2xpc3QpKTsKKyAgICAgICAgICAgIGN1cnNvcl9zcGVjX3R5cGUgPSBGbnRo IChtYWtlX251bWJlciAoMSksIGN1cnNvcl9zcGVjX2xpc3QpOworICAgICAgICAgICAgaWYgKENP TlNQIChjdXJzb3Jfc3BlY190eXBlKSkKKyAgICAgICAgICAgICAgY3Vyc29yX3R5cGUgPSBtY19s aXNwX3RvX2N1cnNvcl90eXBlIChYQ0FSIChjdXJzb3Jfc3BlY190eXBlKSk7CisgICAgICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29y X3R5cGUgKGN1cnNvcl9zcGVjX3R5cGUpOworICAgICAgICAgICAgaWYgKENPTlNQIChjdXJzb3Jf c3BlY190eXBlKSkKKyAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoID0gWElOVCAoWENBUiAoWENE UiAoY3Vyc29yX3NwZWNfdHlwZSkpKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICAgIGN1cnNvcl93aWR0aCA9IDE7CisgICAgICAgICAgICBjdXJzb3JfY29sb3JfdmVjdG9yID0g Rm50aCAobWFrZV9udW1iZXIgKDIpLCBjdXJzb3Jfc3BlY19saXN0KTsKKyAgICAgICAgICAgIHJl ZCA9IFhGTE9BVF9EQVRBIChBUkVGIChjdXJzb3JfY29sb3JfdmVjdG9yLCAwKSk7CisgICAgICAg ICAgICBncmVlbiA9IFhGTE9BVF9EQVRBIChBUkVGIChjdXJzb3JfY29sb3JfdmVjdG9yLCAxKSk7 CisgICAgICAgICAgICBibHVlID0gWEZMT0FUX0RBVEEgKEFSRUYgKGN1cnNvcl9jb2xvcl92ZWN0 b3IsIDIpKTsKKyAgICAgICAgICAgIGlmIChwb3NpbnQKKyAgICAgICAgICAgICAgICAmJiB3LT53 aW5kb3dfc3RhcnRfZW5kX2hvb2tfaW50X3dpbmRvd19zdGFydAorICAgICAgICAgICAgICAgICYm IHctPndpbmRvd19zdGFydF9lbmRfaG9va19pbnRfd2luZG93X2VuZAorICAgICAgICAgICAgICAg ICYmIHBvc2ludCA+PSB3LT53aW5kb3dfc3RhcnRfZW5kX2hvb2tfaW50X3dpbmRvd19zdGFydAor ICAgICAgICAgICAgICAgICYmIHBvc2ludCA8PSB3LT53aW5kb3dfc3RhcnRfZW5kX2hvb2tfaW50 X3dpbmRvd19lbmQpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB4X3lfaHBvc192 cG9zX2xpc3QgPSBYQ0FSIChYQ0RSIChYQ0FSICh2bGlzdCkpKTsKKyAgICAgICAgICAgICAgICB4 ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAg ICAgICAgICAgICAgICB5ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB4X3lfaHBvc192 cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAgICBocG9zID0gWElOVCAoRm50aCAobWFrZV9udW1i ZXIgKDIpLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAgICB2cG9zID0gWElO VCAoRm50aCAobWFrZV9udW1iZXIgKDMpLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAg ICAgICAgICBtY19kcmF3ICh3LCAxLCB4LCB5LCBocG9zLCB2cG9zLCBjdXJzb3JfdHlwZSwgY3Vy c29yX3dpZHRoLCByZWQsIGdyZWVuLCBibHVlKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAg IH0KKyAgICAgIH0KKyAgICAgIGVsc2UgaWYgKHcgPT0gc3cKKyAgICAgICAgICAgICAgICYmICFO SUxQIChCVkFSIChjdXJyZW50X2J1ZmZlciwgbWNfbGlzdCkpKQorICAgICAgICB7CisjaWZkZWYg R0xZUEhfREVCVUcKKyAgZGVidWdfbWV0aG9kX2FkZCAodywgIm1jX2NhbGM6ICBkcmF3IGN1cnNv cnMgYW5ldyIpOworI2VuZGlmCisgICAgICAgICAgZm9yICh2bGlzdCA9IEJWQVIgKGN1cnJlbnRf YnVmZmVyLCBtY19saXN0KTsKKyAgICAgICAgICAgICAgIENPTlNQICh2bGlzdCk7CisgICAgICAg ICAgICAgICB2bGlzdCA9IFhDRFIgKHZsaXN0KSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgY3Vyc29yX3NwZWNfbGlzdCA9IFhDQVIgKHZsaXN0KTsKKyAgICAgICAgICAgICAgcG9zaW50 ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCBjdXJzb3Jfc3BlY19saXN0KSk7CisgICAg ICAgICAgICAgIGN1cnNvcl9zcGVjX3R5cGUgPSBGbnRoIChtYWtlX251bWJlciAoMSksIGN1cnNv cl9zcGVjX2xpc3QpOworICAgICAgICAgICAgICBpZiAoQ09OU1AgKGN1cnNvcl9zcGVjX3R5cGUp KQorICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAo WENBUiAoY3Vyc29yX3NwZWNfdHlwZSkpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoY3Vyc29yX3Nw ZWNfdHlwZSk7CisgICAgICAgICAgICAgIGlmIChDT05TUCAoY3Vyc29yX3NwZWNfdHlwZSkpCisg ICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoID0gWElOVCAoWENBUiAoWENEUiAoY3Vyc29yX3Nw ZWNfdHlwZSkpKTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXJz b3Jfd2lkdGggPSAxOworICAgICAgICAgICAgICBjdXJzb3JfY29sb3JfdmVjdG9yID0gRm50aCAo bWFrZV9udW1iZXIgKDIpLCBjdXJzb3Jfc3BlY19saXN0KTsKKyAgICAgICAgICAgICAgcmVkID0g WEZMT0FUX0RBVEEgKEFSRUYgKGN1cnNvcl9jb2xvcl92ZWN0b3IsIDApKTsKKyAgICAgICAgICAg ICAgZ3JlZW4gPSBYRkxPQVRfREFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3RvciwgMSkpOwor ICAgICAgICAgICAgICBibHVlID0gWEZMT0FUX0RBVEEgKEFSRUYgKGN1cnNvcl9jb2xvcl92ZWN0 b3IsIDIpKTsKKyAgICAgICAgICAgICAgaWYgKHBvc2ludCkKKyAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgICB4X3lfaHBvc192cG9zX2xpc3QgPSBtY194X3lfaHBvc192cG9zICh3 LCBwb3NpbnQpOworICAgICAgICAgICAgICAgICAgdGVtcCA9IEZjb25zIChjdXJzb3Jfc3BlY19s aXN0LCBGY29ucyAoeF95X2hwb3NfdnBvc19saXN0LCBRbmlsKSk7CisgICAgICAgICAgICAgICAg ICByZXN1bHQgPSBGY29ucyAodGVtcCwgcmVzdWx0KTsKKyAgICAgICAgICAgICAgICAgIHggPSBY SU5UIChGbnRoIChtYWtlX251bWJlciAoMCksIHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAg ICAgICAgICAgICAgeSA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgxKSwgeF95X2hwb3NfdnBv c19saXN0KSk7CisgICAgICAgICAgICAgICAgICBocG9zID0gWElOVCAoRm50aCAobWFrZV9udW1i ZXIgKDIpLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAgICAgIHZwb3MgPSBY SU5UIChGbnRoIChtYWtlX251bWJlciAoMyksIHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAg ICAgICAgICAgICAgaWYgKHctPndpbmRvd19zdGFydF9lbmRfaG9va19pbnRfd2luZG93X3N0YXJ0 CisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+d2luZG93X3N0YXJ0X2VuZF9ob29rX2ludF93 aW5kb3dfZW5kCisgICAgICAgICAgICAgICAgICAgICAgJiYgcG9zaW50ID49IHctPndpbmRvd19z dGFydF9lbmRfaG9va19pbnRfd2luZG93X3N0YXJ0CisgICAgICAgICAgICAgICAgICAgICAgJiYg cG9zaW50IDw9IHctPndpbmRvd19zdGFydF9lbmRfaG9va19pbnRfd2luZG93X2VuZCkKKyAgICAg ICAgICAgICAgICAgICAgb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UlNPUjoKLQkgICAgICBkcmF3X3BoeXNfY3Vyc29yX2dseXBoICh3LCBnbHlwaF9yb3csIERS QVdfQ1VSU09SKTsKKwkgICAgICBkcmF3X3BoeXNfY3Vyc29yX2dseXBoICh3LCBnbHlwaF9yb3cs IERSQVdfQ1VSU09SLCAieHRlcm0uYzo5MDczIik7CiAJICAgICAgYnJlYWs7CiAKIAkgICAgY2Fz ZSBCQVJfQ1VSU09SOgo= --Multipart_Tue_Mar__8_22:27:01_2016-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: Can we support multiple Cursors? Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Wed, 09 Mar 2016 16:04:01 +0000 Resent-Message-ID: <handler.22873.B22873.14575394153762 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Keith David Bershatsky <esq@HIDDEN> Cc: jwiegley@HIDDEN, mbork@HIDDEN, rms@HIDDEN, 22873 <at> debbugs.gnu.org Reply-To: Eli Zaretskii <eliz@HIDDEN> Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.14575394153762 (code B ref 22873); Wed, 09 Mar 2016 16:04:01 +0000 Received: (at 22873) by debbugs.gnu.org; 9 Mar 2016 16:03:35 +0000 Received: from localhost ([127.0.0.1]:41693 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1adgaF-0000yc-Bk for submit <at> debbugs.gnu.org; Wed, 09 Mar 2016 11:03:35 -0500 Received: from eggs.gnu.org ([208.118.235.92]:45139) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from <eliz@HIDDEN>) id 1adgaD-0000yO-8x for 22873 <at> debbugs.gnu.org; Wed, 09 Mar 2016 11:03:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <eliz@HIDDEN>) id 1adga2-0003aw-1l for 22873 <at> debbugs.gnu.org; Wed, 09 Mar 2016 11:03:28 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40504) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>) id 1adga1-0003as-Uu; Wed, 09 Mar 2016 11:03:21 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3664 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from <eliz@HIDDEN>) id 1adgZu-00044l-BG; Wed, 09 Mar 2016 11:03:14 -0500 Date: Wed, 09 Mar 2016 18:03:25 +0200 Message-Id: <83h9gfprjm.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-reply-to: <m2twkg5fpl.wl%esq@HIDDEN> (message from Keith David Bershatsky on Tue, 08 Mar 2016 22:27:02 -0800) References: <m2oaayavh1.wl%esq@HIDDEN> <m2twkg5fpl.wl%esq@HIDDEN> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -5.0 (-----) > Date: Tue, 08 Mar 2016 22:27:02 -0800 > From: Keith David Bershatsky <esq@HIDDEN> > Cc: 22873 <at> debbugs.gnu.org > > The second draft of the proposed feature for multiple fake cursors is attached. For the record, I'm not a programmer -- just a hobbyist -- and the draft patch is not meant to be a proposed official patch -- it is just a working proof concept. The patch contains a few extra things that I use for debugging and also for drawing my solid vertical line that tracks the cursor position. It has been tested to some extent on Emacs built for OSX 10.6.8 and Windows XP (SP-3). Different colors for each fake cursor have already been implemented on Emacs for OSX, but I haven't yet looked into how to accomplish that objective on Emacs for Windows. The draft concept patch is for the master branch as of March 8, 2016 bearing commit "e0400b72a24d67b53f71c8b97915cae599e36c37". After applying the patch, the new feature can be tested as follows: Looks like quite a few of the changes in the patch are not really related to multiple cursors. Did you produce diffs for all of your other local changes? > diff --git a/src/buffer.h b/src/buffer.h > index 5783bfb..01c3755 100644 > --- a/src/buffer.h > +++ b/src/buffer.h > @@ -643,6 +643,15 @@ struct buffer > cache are enabled. See search.c, indent.c and bidi.c for details. */ > Lisp_Object cache_long_scans_; > > + /* The name of the hook. */ > + Lisp_Object window_start_end_hook_; > + > + /* The name of list. */ > + Lisp_Object posn_list_; > + > + /* The name of list used by multiple cursors for next redisplay. */ > + Lisp_Object mc_list_; > + > /* If the width run cache is enabled, this table contains the > character widths width_run_cache (see above) assumes. When we > do a thorough redisplay, we compare this against the buffer's > @@ -885,6 +894,21 @@ struct buffer > buffer. (Some setters that are private to a single .c file are > defined as static in those files.) */ > INLINE void > +bset_window_start_end_hook (struct buffer *b, Lisp_Object val) > +{ > + b->window_start_end_hook_ = val; > +} The above inline function and the corresponding member of struct buffer seems unrelated. > diff --git a/src/keyboard.c b/src/keyboard.c > index 4e1ac15..329cba0 100644 > --- a/src/keyboard.c > +++ b/src/keyboard.c > @@ -1244,6 +1244,15 @@ static int read_key_sequence (Lisp_Object *, int, Lisp_Object, > bool, bool, bool, bool); > static void adjust_point_for_property (ptrdiff_t, bool); > > +static void > +set_window_start_end_hook (void) > +{ > + Lisp_Object window = (selected_window); > + struct window *w = decode_live_window (window); > + w->window_start_end_hook_force = true; > + w->window_start_end_hook_pending = true; > +} > + > Lisp_Object > command_loop_1 (void) > { > @@ -1269,6 +1278,8 @@ command_loop_1 (void) > if (!NILP (Vpost_command_hook) && !NILP (Vrun_hooks)) > safe_run_hooks (Qpost_command_hook); > > + set_window_start_end_hook (); > + > /* If displaying a message, resize the echo area window to fit > that message's size exactly. */ > if (!NILP (echo_area_buffer[0])) > @@ -1485,6 +1496,8 @@ command_loop_1 (void) > > safe_run_hooks (Qpost_command_hook); > > + set_window_start_end_hook (); > + > /* If displaying a message, resize the echo area window to fit > that message's size exactly. */ > if (!NILP (echo_area_buffer[0])) Likewise. > diff --git a/src/xdisp.c b/src/xdisp.c > index 5b96144..102ac23 100644 > --- a/src/xdisp.c > +++ b/src/xdisp.c > @@ -13414,6 +13414,93 @@ do { if (! polling_stopped_here) stop_polling (); \ > do { if (polling_stopped_here) start_polling (); \ > polling_stopped_here = false; } while (false) > > +static void > +run_window_start_end_hook (Lisp_Object window, struct text_pos startp, EMACS_INT posint, struct it it, char *string, bool force) > +{ Likewise. > + case 'w': > + { > + ptrdiff_t window_start = marker_position (w->start); > + pint2str (decode_mode_spec_buf, width, window_start); > + return decode_mode_spec_buf; > + } > + > + case 'W': > + { > + ptrdiff_t window_end = BUF_Z (b) - w->window_end_pos; > + pint2str (decode_mode_spec_buf, width, window_end); > + return decode_mode_spec_buf; > + } > + Likewise. > +static const char * > +internal_line_number_at_position (struct window *w, register int c, int field_width, Lisp_Object *string) > +{ Likewise. > +DEFUN ("line-number-at-position", Fline_number_at_position, Sline_number_at_position, 1, 2, 0, > + doc: /* Return line number at position. */) > + (Lisp_Object window, Lisp_Object pos) > +{ Likewise. Thanks.
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: Can we support multiple Cursors? References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Wed, 09 Mar 2016 18:31:02 +0000 Resent-Message-ID: <handler.22873.B22873.145754825723909 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: jwiegley@HIDDEN, mbork@HIDDEN, rms@HIDDEN, 22873 <at> debbugs.gnu.org Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.145754825723909 (code B ref 22873); Wed, 09 Mar 2016 18:31:02 +0000 Received: (at 22873) by debbugs.gnu.org; 9 Mar 2016 18:30:57 +0000 Received: from localhost ([127.0.0.1]:41790 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1adisr-0006DY-Ko for submit <at> debbugs.gnu.org; Wed, 09 Mar 2016 13:30:57 -0500 Received: from cobb.liquidweb.com ([50.28.13.150]:58814) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from <esq@HIDDEN>) id 1adisq-0006DN-Jq for 22873 <at> debbugs.gnu.org; Wed, 09 Mar 2016 13:30:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date; bh=yPmwxL8ML7DmehIiiCAFgca7ZNtPiknPdTCb1Bz9bs4=; b=qxoAXJQitQkKO8xIyJkifuvRVCKPbmWLZS5lwfMKXxSJzioeWxOTMWjesF3hw+HIfzkWdCqjaXFqhzvBhNFEWZ5uldE66R6WHYTxmKyylX3ucDgW5uH24h6kGVIHsH6N; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:49895 helo=server.private.localhost) by cobb.liquidweb.com with esmtp (Exim 4.82) (envelope-from <esq@HIDDEN>) id 1adish-0002RK-Vt; Wed, 09 Mar 2016 13:30:48 -0500 Date: Wed, 09 Mar 2016 10:30:48 -0800 Message-ID: <m2wppby04n.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 (generated by - "") Content-Type: text/plain; charset=US-ASCII X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cobb.liquidweb.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-Get-Message-Sender-Via: cobb.liquidweb.com: acl_c_relayhosts_text_entry: lawlist|lawlist.com X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.7 (/) Thank you, Eli, for taking a look at the second draft patch. I agree that the unrelated features need to be removed so that we can focus specifically on feature 22873. I would like some of my unrelated custom features to be available in-house while I am implementing fake cursors, but do not yet know how to easily separate them when creating a patch. Absent that git knowledge, I will be manually cutting out those unrelated features in the various source code files and then creating a new diff that is 22873 specific. The next phase will be for me to track down how to convert color vector RGB (three float numbers) to something that Emacs for Windows can recognize. Different colors for each fake cursor is already working in Emacs for OSX 10.6.8. When that next phase is implemented, I will ensure that the third draft patch is exclusively feature 22873 specific. Keith ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; At Wed, 09 Mar 2016 18:03:25 +0200, Eli Zaretskii wrote: > > * * * > > Looks like quite a few of the changes in the patch are not really > related to multiple cursors. Did you produce diffs for all of your > other local changes? > > * * *
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: Can we support multiple Cursors? References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 11 Mar 2016 07:19:02 +0000 Resent-Message-ID: <handler.22873.B22873.14576807335732 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: jwiegley@HIDDEN, mbork@HIDDEN, rms@HIDDEN, 22873 <at> debbugs.gnu.org Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.14576807335732 (code B ref 22873); Fri, 11 Mar 2016 07:19:02 +0000 Received: (at 22873) by debbugs.gnu.org; 11 Mar 2016 07:18:53 +0000 Received: from localhost ([127.0.0.1]:44244 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1aeHLZ-0001UO-4j for submit <at> debbugs.gnu.org; Fri, 11 Mar 2016 02:18:53 -0500 Received: from cobb.liquidweb.com ([50.28.13.150]:39932) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from <esq@HIDDEN>) id 1aeHLX-0001UB-Gu for 22873 <at> debbugs.gnu.org; Fri, 11 Mar 2016 02:18:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date; bh=hPdwjv/l+PycsWiRgTlwqwSlZp6vp+R4/spxTNn4+MY=; b=mvgqsX+m3hwCXehYamenfzVidpfxE+APTODG4iOSXF8sR+3JIRAo3B/9aFilwbVN/vTmLiiCOVQmrc+4OVSSFaVLGk1HbCeku3nLS91mZOPnTYwh5/7SWHsg3b+SGWTf; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:56561 helo=server.private.localhost) by cobb.liquidweb.com with esmtp (Exim 4.82) (envelope-from <esq@HIDDEN>) id 1aeHLM-0005Xx-LQ; Fri, 11 Mar 2016 02:18:41 -0500 Date: Thu, 10 Mar 2016 23:18:41 -0800 Message-ID: <m2twkdmqi6.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 (generated by - "") Content-Type: multipart/mixed; boundary="Multipart_Thu_Mar_10_23:18:39_2016-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cobb.liquidweb.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-Get-Message-Sender-Via: cobb.liquidweb.com: acl_c_relayhosts_text_entry: lawlist|lawlist.com X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.7 (/) --Multipart_Thu_Mar_10_23:18:39_2016-1 Content-Type: text/plain; charset=US-ASCII Attached is the third draft, multiple_cursors_003.diff, which applies to the master branch as of commit "ea626c72e590aa7a45fd26df42240854e4225cef" on March 10, 2015. Different colors for each fake cursor are now supported on Emacs for Windows (XP SP-3) and OSX (10.6.8). The next phase will be to separate the custom feature called `window-start-end-hook` from this new fake cursor feature 22873. Currently, I am using the existence of a definitive window-start and window-end derived from the `window-start-end-hook` as a guide and condition precedent to placing the fake cursors. Given that fake cursors are placed late in the stage of the redisplay process, I suspect that I can rely on other methods to extract the correct window-start and window-end. The other unrelated features that were present in my first couple of drafts have been removed from this third draft. The fake cursors feature works as follows -- to erase everything or change anything, just modify the `mc-list': (defun mc-test (&optional list) "Draw fake cursors at all POS defined in the `mc-list'. Color vector is LSL (The Linden Scripting Language), rather than standard RGB. `nsterm.m' uses `NSColor', which works well with LSL. `w32term.c' uses `PALETTERGB' or `RGB', and the conversion from LSL is done internally by multiplying each element of the LSL color vector by 255." (interactive) (setq mc-list '( (3 "hbar" [1.0 0.0 0.0]) (4 "bar" [0.0 1.0 0.0]) (5 "box" [0.0 0.0 1.0]) (6 "hollow" [0.8 0.4 0.2]) (7 ("hbar" 3) [1.0 0.0 1.0]) (8 ("bar" 3) [0.0 1.0 1.0])))) (global-set-key [f1] 'mc-test) --Multipart_Thu_Mar_10_23:18:39_2016-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="multiple_cursors_003.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3NyYy9idWZmZXIuYyBiL3NyYy9idWZmZXIuYwppbmRleCA5OGI2MWMzLi40 NTQ0NTdhIDEwMDY0NAotLS0gYS9zcmMvYnVmZmVyLmMKKysrIGIvc3JjL2J1ZmZlci5jCkBAIC01 MDczLDYgKzUwNzMsOCBAQCBpbml0X2J1ZmZlcl9vbmNlICh2b2lkKQogICBYU0VURkFTVElOVCAo QlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgZGlzcGxheV90YWJsZSksIGlkeCk7ICsraWR4Owog ICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgc3ludGF4X3RhYmxlKSwg aWR4KTsgKytpZHg7CiAgIFhTRVRGQVNUSU5UIChCVkFSICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBj YWNoZV9sb25nX3NjYW5zKSwgaWR4KTsgKytpZHg7CisgIFhTRVRGQVNUSU5UIChCVkFSICgmYnVm ZmVyX2xvY2FsX2ZsYWdzLCB3aW5kb3dfc3RhcnRfZW5kX2hvb2spLCBpZHgpOyArK2lkeDsKKyAg WFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIG1jX2xpc3QpLCBpZHgpOyAr K2lkeDsKICAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIGNhdGVnb3J5 X3RhYmxlKSwgaWR4KTsgKytpZHg7CiAgIFhTRVRGQVNUSU5UIChCVkFSICgmYnVmZmVyX2xvY2Fs X2ZsYWdzLCBiaWRpX2Rpc3BsYXlfcmVvcmRlcmluZyksIGlkeCk7ICsraWR4OwogICBYU0VURkFT VElOVCAoQlZBUiAoJ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bnQgY3Vyc29yX3dpZHRoLCBib29sIG9uX3AsIGJvb2wgYWN0aXZlX3AsCisJCQkgICAgICBk b3VibGUgcmVkLCBkb3VibGUgZ3JlZW4sIGRvdWJsZSBibHVlKTsKIAogICAvKiBEcmF3IHZlcnRp Y2FsIGJvcmRlciBmb3Igd2luZG93IFcgZnJvbSAoWCxZXzApIHRvIChYLFlfMSkuICAqLwogICB2 b2lkICgqZHJhd192ZXJ0aWNhbF93aW5kb3dfYm9yZGVyKSAoc3RydWN0IHdpbmRvdyAqdywKQEAg LTMyODcsMTEgKzMyODgsMTEgQEAgZXh0ZXJuIHZvaWQgeF9maXhfb3ZlcmxhcHBpbmdfYXJlYSAo c3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBlbnVtIGdseXBoX3Jvd19hcmVhLCBpbnQpOwogZXh0ZXJuIHZvaWQg ZHJhd19waHlzX2N1cnNvcl9nbHlwaCAoc3RydWN0IHdpbmRvdyAqLAogICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqLAotICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlKTsKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSwgY2hhciAqKTsK IGV4dGVybiB2b2lkIGdldF9waHlzX2N1cnNvcl9nZW9tZXRyeSAoc3RydWN0IHdpbmRvdyAqLCBz dHJ1Y3QgZ2x5cGhfcm93ICosCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHN0cnVjdCBnbHlwaCAqLCBpbnQgKiwgaW50ICosIGludCAqKTsKLWV4dGVybiB2b2lkIGVyYXNl X3BoeXNfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICopOwotZXh0ZXJuIHZvaWQgZ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vyc29yX2djLT5mb3JlZ3JvdW5kOworICAgICAgICBvcmlnX3ZhbF9iID0g Zi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MtPmJhY2tncm91bmQ7CisgICAgICAgIGludCBp bnRfcmVkID0gcmVkICogMjU1OworICAgICAgICBpbnQgaW50X2dyZWVuID0gZ3JlZW4gKiAyNTU7 CisgICAgICAgIGludCBpbnRfYmx1ZSA9IGJsdWUgKiAyNTU7CisgICAgICAgIC8qIEZJWE1FOiAg a2RiIHRvIGNvbnNpZGVyIGFkZGluZyBzdXBwb3J0IGZvciBtdWx0aXBsZSBjdXJzb3IgZm9yZWdy b3VuZAorICAgICAgICBjdXN0b21pemF0aW9uIG9mIGEgRklMTEVEX0JPWF9DVVJTT1IuICAqLwor ICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYy0+Zm9yZWdyb3VuZCA9IEZSQU1F X0JBQ0tHUk9VTkRfUElYRUwgKGYpOworICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNv cl9nYy0+YmFja2dyb3VuZCA9IFBBTEVUVEVSR0IgKGludF9yZWQsIGludF9ncmVlbiwgaW50X2Js dWUpOworICAgICAgICBkcmF3X3BoeXNfY3Vyc29yX2dseXBoICh3LCBnbHlwaF9yb3csIERSQVdf Q1VSU09SLCAidzMydGVybS5jOjU3MzAiKTsKKyAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5j dXJzb3JfZ2MtPmZvcmVncm91bmQgPSBvcmlnX3ZhbF9hOworICAgICAgICBmLT5vdXRwdXRfZGF0 YS53MzItPmN1cnNvcl9nYy0+YmFja2dyb3VuZCA9IG9yaWdfdmFsX2I7CisgICAgICB9CisgICAg ICBlbHNlCisgICAgICAgIGRyYXdfcGh5c19jdXJzb3JfZ2x5cGggKHcsIGdseXBoX3JvdywgRFJB V19DVVJTT1IsICJ3MzJ0ZXJtLmM6NTczNSIpOworICAgIGJyZWFrOworICB9CiAKIAljYXN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ksIHJ0b3AsIHJib3QsIHJvd2gsIHZwb3MsIHN0YXJ0cF9pbnRlZ2VyLCBl bmRwLCBwYm9sX3N0YXJ0cCwgcGVvbF9lbmRwOworICBzdGFydHBfaW50ZWdlciA9IENIQVJQT1Mg KHN0YXJ0cCk7CisgIGlmIChiICE9IGN1cnJlbnRfYnVmZmVyKQorICAgIHsKKyAgICAgIG9sZF9i dWZmZXIgPSBjdXJyZW50X2J1ZmZlcjsKKyAgICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKGIpOwor ICAgIH0KKyAgaWYgKHctPndpbmRvd19zdGFydF9lbmRfaG9va19wZW5kaW5nCisgICAgICAgICYm ICghTklMUCAoQlZBUiAoY3VycmVudF9idWZmZXIsIHdpbmRvd19zdGFydF9lbmRfaG9vaykpCisg ICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoY3VycmVudF9idWZmZXIsIG1jX2xpc3QpKQorICAg ICAgICAgICAgfHwgdy0+bWNfY2FjaGUpKQorICAgIHsKKyAgICAgIGlmICgoKHBvc2ludCA+PSBD SEFSUE9TIChzdGFydHApICYmIHBvc2ludCA8PSBCVUZfWlYgKGIpKQorICAgICAgICAgICAgJiYg Q0hBUlBPUyAoc3RhcnRwKSA+PSBCVUZfQkVHViAoYikKKyAgICAgICAgICAgICYmIENIQVJQT1Mg KHN0YXJ0cCkgPD0gQlVGX1pWIChiKQorICAgICAgICAgICAgJiYgcG9zX3Zpc2libGVfcCAodywg cG9zaW50LCAmeCwgJnksICZydG9wLCAmcmJvdCwgJnJvd2gsICZ2cG9zKSkpCisgICAgICAgIGZ1 bGx5X3AgPSAhcnRvcCAmJiAhcmJvdDsKKyAgICAgIGlmIChmdWxseV9wKQorICAgICAgICB7Cisg ICAgICAgICAgdy0+d2luZG93X3N0YXJ0X2VuZF9ob29rX2ludF9wcmV2aW91c193aW5kb3dfc3Rh cnQgPSB3LT53aW5kb3dfc3RhcnRfZW5kX2hvb2tfaW50X3dpbmRvd19zdGFydDsKKyAgICAg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TogJWQgfCBzdGFydHA6ICVkIHwgZW5kcDogJWQgfCBwYm9s X3N0YXJ0cDogJWQgfCBwZW9sX2VuZHA6ICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBzdHJpbmcsIHgsIHksIHN0YXJ0cF9pbnRlZ2VyLCBlbmRwLCBwYm9sX3N0YXJ0cCwgcGVv bF9lbmRwKTsKKyNlbmRpZgorICAgICAgICAgIC8qIFJlc2V0IHRoZSBmbGFnIF9iZWZvcmVfIGNh bGxpbmcgTGlzcCwgbm90IGFmdGVyLCBzbyB0aGF0CisgICAgICAgICAgICAgaWYgTGlzcCBkb2Vz IHNpZ25hbCBhbiBlcnJvciwgdGhlIGZsYWcgd2lsbCBiZSByZXNldCwgYW5kCisgICAgICAgICAg ICAgd29uJ3QgY2F1c2UgdGhlIGhvb2sgdG8gYmUgY2FsbGVkIGFkIG5hdXNlYW0uICAqLworICAg ICAgICAgIHctPndpbmRvd19zdGFydF9lbmRfaG9va19wZW5kaW5nID0gZmFsc2U7CisgICAgICAg ICAgLyogV2hlbiBjYWxsaW5nIExpc3AgZnJvbSByZWRpc3BsYXksIGFsd2F5cyB1c2Ugc2FmZV9j YWxsLCB0byBiZQorICAgICAgICAgICAgIHByb3RlY3RlZCBhZ2FpbnN0IGVycm9ycyBzaWduYWxl ZCBieSB0aGF0IExpc3AuICAqLworICAgICAgICAgIC8qIHNhZmVfY2FsbDogIGZuLCBhcmcxLCBh cmcyLCBhcmczLCBhcmc0LCBhcmc1LCBhcmc2LCBhcmc3ICAqLworICAgICAgICAgIHNhZmVfY2Fs bCAoOCwKKyAgICAgICAgICAgICAgUXJ1bl9ob29rX3dpdGhfYXJncywKKyAgICAgICAgICAgICAg UXdpbmRvd19zdGFydF9lbmRfaG9vaywKKyAgICAgICAgICAgICAgd2luZG93LAorICAgICAgICAg ICAgICBtYWtlX251bWJlciAoc3RhcnRwX2ludGVnZXIpLAorICAgICAgICAgICAgICBtYWtlX251 bWJlciAoZW5kcCksCisgICAgICAgICAgICAgIG1ha2VfbnVtYmVyIChwYm9sX3N0YXJ0cCksCisg ICAgICAgICAgICAgIG1ha2VfbnVtYmVyIChwZW9sX2VuZHApLAorICAgICAgICAgICAgICBmdWxs eV9wID8gUXQgOiBRbmlsKTsKKyAgICAgICAgICAvKiBBdCB0aGUgY2F0Y2gtYWxsIHdoZW4gc2Ny b2xsaW5nIHdpdGggdGhlIG1vdXNlIHdoZWVsLCB0aGlzIG5leHQgc2VjdGlvbiBjYXVzZXMgYSB2 aXN1YWwgZmxhc2gKKyAgICAgICAgICBvZiBjdXJzb3IgaW4gdGhlIHdyb25nIHBvc2l0aW9uIGR1 ZSB0byBTRVRfUFQgYWJvdmUuICAqLworICAgICAgICAgIGlmIChmb3JjZSkKKyAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgY2xlYXJfZ2x5cGhfbWF0cml4ICh3LT5kZXNpcmVkX21hdHJpeCk7 CisgICAgICAgICAgICAgIHRyeV93aW5kb3cgKHdpbmRvdywgc3RhcnRwLCAwKTsKKyAgICAgICAg ICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworI2lmZGVmIEdMWVBI X0RFQlVHCisgICAgICAgICAgICAvKiBTZWUgdGhlIGRvYy1zdHJpbmcgZm9yIGBwb3MtdmlzaWJs ZS1pbi13aW5kb3ctcCcuICAqLworICAgICAgICAgICAgZGVidWdfbWV0aG9kX2FkZCAodywgIiVz IC0tIHg6ICVkIHwgeTogJWQgfCBydG9wOiAlZCB8IHJib3QgJWQgfCByb3doOiAlZCB8IHZwb3M6 ICVkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmluZywgeCwgeSwgcnRv cCwgcmJvdCwgcm93aCwgdnBvcyk7CisjZW5kaWYKKyAgICAgICAgICB9CisgICAgfQorICBpZiAo b2xkX2J1ZmZlcikKKyAgICBzZXRfYnVmZmVyX2ludGVybmFsIChvbGRfYnVmZmVyKTsKK30KIAog LyogU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PmZvcmNlX3N0 YXJ0KQorICAgICAgICB3aW5kb3dfc3RhcnRfZW5kX2hvb2tfc3VwcHJlc3Nfd3NmID0gdHJ1ZTsK KwogICAgICAgcHRyZGlmZl90IGl0X2NoYXJwb3M7CiAKLSAgICAgIHctPm9wdGlvbmFsX25ld19z dGFydCA9IGZhbHNlOwogICAgICAgc3RhcnRfZGlzcGxheSAoJml0LCB3LCBzdGFydHApOwogICAg ICAgbW92ZV9pdF90byAoJml0LCBQVCwgMCwgaXQubGFzdF92aXNpYmxlX3ksIC0xLAogCQkgIE1P VkVfVE9fUE9TIHwgTU9WRV9UT19YIHwgTU9WRV9UT19ZKTsKQEAgLTE2MjcwLDE0ICsxNjM2NCwy OCBAQCByZWRpc3BsYXlfd2luZG93IChMaXNwX09iamVjdCB3aW5kb3csIGJvb2wganVzdF90aGlz X29uZV9wKQogCSAgICB3LT5mb3JjZV9zdGFydCA9IHRydWU7CiAjaWZkZWYgR0xZUEhfREVCVUcK IAkgIGlmICh3LT5mb3JjZV9zdGFydCkKLQkgICAgewotCSAgICAgIGlmICh3aW5kb3dfZnJvemVu X3AgKHcpKQotCQlkZWJ1Z19tZXRob2RfYWRkICh3LCAic2V0IGZvcmNlX3N0YXJ0IGZyb20gZnJv emVuIHdpbmRvdyBzdGFydCIpOwotCSAgICAgIGVsc2UKLQkJZGVidWdfbWV0aG9kX2FkZCAodywg InNldCBmb3JjZV9zdGFydCBmcm9tIG9wdGlvbmFsX25ld19zdGFydCIpOwotCSAgICB9CisgICAg eworICAgICAgaWYgKHdpbmRvd19mcm96ZW5fcCAodykpCisgICAgICAgIHsKKyAgICAgICAgZGVi dWdfbWV0aG9kX2FkZCAodywgInJlZGlzcGxheV93aW5kb3cgKGZvcmNlX3N0YXJ0KTogIHdpbmRv d19mcm96ZW5fcCAodykiKTsKKyAgICAgIH0KKyAgICAgIGVsc2UgaWYgKHctPm9wdGlvbmFsX25l d19zdGFydCkKKyAgICAgICAgeworICAgICAgICBkZWJ1Z19tZ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gYm91bmRzLCBidXQgd2UgZHJhdyB0aGUgY3Vyc29yIGF0IHRoZSBj b3JyZXNwb25kaW5nCisgICAgICAgICAgIHdpbmRvdyBtYXJnaW4gaW4gdGhhdCBjYXNlLiAgKi8K KyAgICAgICAgICBpZiAoIWN1cnNvcl9yb3ctPnJldmVyc2VkX3AgJiYgaHBvcyA8IDApCisgICAg ICAgICAgICBocG9zID0gMDsKKyAgICAgICAgICBpZiAoY3Vyc29yX3Jvdy0+cmV2ZXJzZWRfcCAm JiBocG9zID49IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgICAgICAgIGhwb3Mg PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxOworICAgICAgICB9CisgICAgICBpZiAo MCA8PSBocG9zICYmIGhwb3MgPCBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAg IGN1cnNvcl9nbHlwaCA9IGN1cnNvcl9yb3ctPmdseXBoc1tURVhUX0FSRUFdICsgaHBvczsKKyAg ICAgIGVsc2UKKyAgICAgICAgY3Vyc29yX2dseXBoID0gTlVMTDsKKyAgICAgIGlmIChjdXJzb3Jf Z2x5cGggPT0gTlVMTCkKKyAgICAgICAgZ290byBtYXJrX2N1cnNvcl9vZmY7CisgICAgICB3aWR0 aCA9IGN1cnNvcl9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICBob2xsb3dfeCA9IHg7CisgICAg ICBpZiAoeCA8IDApCisgICAgICAgIHsKKyAgICAgICAgICB3aWR0aCArPSBob2xsb3dfeDsKKyAg ICAgICAgICBob2xsb3dfeCA9IDA7CisgICAgICAgIH0KKyAgICAgIHdpZHRoID0gbWluICh3aWR0 aCwgd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKSAtIGhvbGxvd194KTsKKyAgICAgIGhv bGxvd195ID0gV0lORE9XX1RPX0ZSQU1FX1BJWEVMX1kgKHcsIG1heCAoaGVhZGVyX2xpbmVf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RfdG8gKCZpdCwgcG9zaW50LCAtMSwgLTEsIC0xLCBNT1ZFX1RP X1BPUyk7CisgICAgICBwb3MgPSBpdC5jdXJyZW50LnBvczsKKyAgICAgIHggPSBpdC5jdXJyZW50 X3g7CisgICAgICB5ID0gaXQuY3VycmVudF95OworICAgICAgaHBvcyA9IGl0Lmhwb3M7CisgICAg ICB2cG9zID0gaXQudnBvczsKKyAgICAgIGJpZGlfdW5zaGVsdmVfY2FjaGUgKGl0ZGF0YSwgZmFs c2UpOworICAgIH0KKyAgICBlbHNlCisgICAgICB7CisgICAgICAgIHggPSAtMTsKKyAgICAgICAg eSA9IC0xOworICAgICAgICBocG9zID0gLTE7CisgICAgICAgIHZwb3MgPSAtMTsKKyAgICAgIH0K KyAgcmV0dXJuIGxpc3RuIChDT05TVFlQRV9QVVJFLCA0LCBtYWtlX251bWJlciAoeCksIG1ha2Vf bnVtYmVyICh5KSwgbWFrZV9udW1iZXIgKGhwb3MpLCBtYWtlX251bWJlciAodnBvcykpOworfQor CitpbnQKK21jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKExpc3BfT2JqZWN0IGFyZykKK3sKKyAgY2hh ciAqc3RyOworICBpZiAoWFRZUEUgKGFyZykgPT0gTGlzcF9TdHJpbmcpCisgICAgc3RyID0gU1NE QVRBIChhcmcpOworICBlbHNlIGlmIChYVFlQRSAoYXJnKSA9PSBMaXNwX1N5bWJvbCkKKyAgICBz dHIgPSBTU0RBVEEgKFNZTUJPTF9OQU1FIChhcmcpKTsKKyAgZWxzZSByZXR1cm4gLTE7CisgIGlm ICghc3RyY21wIChzdHIsICJib3giKSkKKyAgICByZXR1cm4gRklMTEVEX0JPWF9DVVJTT1I7Cisg IGlmICghc3RyY21wIChzdHIsICJob2xsb3ciKSkKKyAgICByZXR1cm4gSE9MTE9XX0JPWF9DVVJT T1I7CisgIGlmICghc3RyY21wIChzdHIsICJoYmFyIikpCisgICAgcmV0dXJuIEhCQVJfQ1VSU09S OworICBpZiAoIXN0cmNtcCAoc3RyLCAiYmFyIikpCisgICAgcmV0dXJuIEJBUl9DVVJTT1I7Cisg IGlmICghc3RyY21wIChzdHIsICJubyIpKQorICAgIHJldHVybiBOT19DVVJTT1I7CisgIHJldHVy biAtMTsKK30KKworLyogRVhBTVBMRSAjMToKKyAgICAoc2V0cSBtYy1saXN0ICcoCisgICAgICAo MyAiaGJhciIgWzEuMCAwLjAgMC4wXSkKKyAgICAgICg0ICJiYXIiIFswLjAgMS4wIDAuMF0pCisg ICAgICAoNSAiYm94IiBbMC4wIDAuMCAxLjBdKQorICAgICAgKDYgImhvbGxvdyIgWzAuOCAwLjQg MC4yXSkKKyAgICAgICg3ICgiaGJhciIgMykgWzEuMCAwLjAgMS4wXSkKKyAgICAgICg4ICgiYmFy IiAzKSBbMC4wIDEuMCAxLjBdKSkpCisgICBFWEFNUExFICMyOiAgKHNldHEgbWMtbGlzdCBuaWwp CitUaGUgYG1jX2NhY2hlJyBpcyBrZXB0IGluIHRoZSBmb2xsb3dpbmcgZXhhbXBsZSBmb3JtYXQ6 CisgICgoCisgICAgKDMgaGJhciBbMS4wIDAuMCAwLjBdKQorICAgICg0IGJhciBbMC4wIDEuMCAw LjBdKQorICAgICg1IGJveCBbMC4wIDAuMCAxLjBdKQorICAgICg2IGhvbGxvdyBbMC44IDAuNCAw LjJdKQorICAgICg3IChoYmFyIDMpIFsxLjAgMC4wIDEuMF0pCisgICAgKDggKGJhciAzKSBbMC4w IDEuMCAxLjBdKSkKKyAgICgKKyAgICAoKDMgaGJhciBbMS4wIDAuMCAwLjBdKSAoMjIgMjAgMiAw KSkKKyAgICAoKDQgYmFyIFswLjAgMS4wIDAuMF0pICgzMyAyMCAzIDApKQorICAgICgoNSBib3gg WzAuMCAwLjAgMS4wXSkgKDQ0IDIwIDQgMCkpCisgICAgKCg2IGhvbGxvdyBbMC44IDAuNCAwLjJd KSAoNTUgMjAgNSAwKSkKKyAgICAoKDcgKGhiYXIgMykgWzEuMCAwLjAgMS4wXSkgKDY2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ctPm1jX2NhY2hl KSk7CisgICAgICAgICAgIENPTlNQICh2bGlzdCk7CisgICAgICAgICAgIHZsaXN0ID0gWENEUiAo dmxpc3QpKQorICAgICAgICB7CisgICAgICAgICAgY3Vyc29yX3NwZWNfbGlzdCA9IFhDQVIgKFhD QVIgKHZsaXN0KSk7CisgICAgICAgICAgcG9zaW50ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIg KDApLCBjdXJzb3Jfc3BlY19saXN0KSk7CisgICAgICAgICAgY3Vyc29yX3NwZWNfdHlwZSA9IEZu dGggKG1ha2VfbnVtYmVyICgxKSwgY3Vyc29yX3NwZWNfbGlzdCk7CisgICAgICAgICAgaWYgKENP TlNQIChjdXJzb3Jfc3BlY190eXBlKSkKKyAgICAgICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlz cF90b19jdXJzb3JfdHlwZSAoWENBUiAoY3Vyc29yX3NwZWNfdHlwZSkpOworICAgICAgICAgICAg ZWxzZQorICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUg KGN1cnNvcl9zcGVjX3R5cGUpOworICAgICAgICAgIGlmIChDT05TUCAoY3Vyc29yX3NwZWNfdHlw ZSkpCisgICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSBYSU5UIChYQ0FSIChYQ0RSIChjdXJzb3Jf c3BlY190eXBlKSkpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBjdXJzb3Jfd2lk dGggPSAxOworICAgICAgICAgIGN1cnNvcl9jb2xvcl92ZWN0b3IgPSBGbnRoIChtYWtlX251bWJl ciAoMiksIGN1cnNvcl9zcGVjX2xpc3QpOworICAgICAgICAgIHJlZCA9IFhGTE9BVF9EQVRBIChB UkVGIChjdXJzb3JfY29sb3JfdmVjdG9yLCAwKSk7CisgICAgICAgICAgZ3JlZW4gPSBYRkxPQVRf REFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3RvciwgMSkpOworICAgICAgICAgIGJsdWUgPSBY RkxPQVRfREFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3RvciwgMikpOworICAgICAgICAgIGlm IChwb3NpbnQKKyAgICAgICAgICAgICAgJiYgdy0+d2luZG93X3N0YXJ0X2VuZF9ob29rX2ludF93 aW5kb3dfc3RhcnQKKyAgICAgICAgICAgICAgJiYgdy0+d2luZG93X3N0YXJ0X2VuZF9ob29rX2lu dF93aW5kb3dfZW5kCisgICAgICAgICAgICAgICYmIHBvc2ludCA+PSB3LT53aW5kb3dfc3RhcnRf ZW5kX2hvb2tfaW50X3dpbmRvd19zdGFydAorICAgICAgICAgICAgICAmJiBwb3NpbnQgPD0gdy0+ d2luZG93X3N0YXJ0X2VuZF9ob29rX2ludF93aW5kb3dfZW5kKQorICAgICAgICAgICAgeworICAg ICAgICAgICAgICB4X3lfaHBvc192cG9zX2xpc3QgPSBYQ0FSIChYQ0RSIChYQ0FSICh2bGlzdCkp KTsKKyAgICAgICAgICAgICAgeCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgwKSwgeF95X2hw b3NfdnBvc19saXN0KSk7CisgICAgICAgICAgICAgIHkgPSBYSU5UIChGbnRoIChtYWtlX251bWJl ciAoMSksIHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAgICAgICBocG9zID0gWElOVCAo Rm50aCAobWFrZV9udW1iZXIgKDIpLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAgICAg ICAgdnBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgzKSwgeF95X2hwb3NfdnBvc19saXN0 KSk7CisgICAgICAgICAgICAgIG1jX2VyYXNlICh3LCB4LCB5LCBocG9zLCB2cG9zLCBjdXJzb3Jf dHlwZSwgY3Vyc29yX3dpZHRoLCByZWQsIGdyZWVuLCBibHVlKTsKKyAgICAgICAgICAgIH0KKyAg ICAgICAgfQorICAgICAgdy0+bWNfY2FjaGUgPSBRbmlsOworICAgIH0KKyAgICBlbHNlIGlmICh3 ID09IHN3CisgICAgICAgICAgICAmJiB3LT53aW5kb3dfc3RhcnRfZW5kX2hvb2tfaW50X3dpbmRv d19zdGFydAorICAgICAgICAgICAgJiYgdy0+d2luZG93X3N0YXJ0X2VuZF9ob29rX2ludF93aW5k b3dfZW5kCisgICAgICAgICAgICAmJiB3LT53aW5kb3dfc3RhcnRfZW5kX2hvb2tfaW50X3ByZXZp b3VzX3dpbmRvd19zdGFydAorICAgICAgICAgICAgJiYgdy0+d2luZG93X3N0YXJ0X2VuZF9ob29r X2ludF9wcmV2aW91c193aW5kb3dfZW5kCisgICAgICAgICAgICAmJiB3LT53aW5kb3dfc3RhcnRf ZW5kX2hvb2tfaW50X3dpbmRvd19zdGFydCA9PSB3LT53aW5kb3dfc3RhcnRfZW5kX2hvb2tfaW50 X3ByZXZpb3VzX3dpbmRvd19zdGFydAorICAgICAgICAgICAgJiYgdy0+d2luZG93X3N0YXJ0X2Vu ZF9ob29rX2ludF93aW5kb3dfZW5kID09IHctPndpbmRvd19zdGFydF9lbmRfaG9va19pbnRfcHJl dmlvdXNfd2luZG93X2VuZAorICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGN1cnJlbnRfYnVm ZmVyLCBtY19saXN0KSkKKyAgICAgICAgICAgICYmIHctPm1jX2NhY2hlCisgICAgICAgICAgICAm JiAhTklMUCAoRmVxdWFsIChGbnRoIChtYWtlX251bWJlciAoMCksIHctPm1jX2NhY2hlKSwgQlZB UiAoY3VycmVudF9idWZmZXIsIG1jX2xpc3QpKSkpCisgICAgICB7CisjaWZkZWYgR0xZUEhfREVC VUcKKyAgZGVidWdfbWV0aG9kX2FkZCAodywgIm1jX2NhbGM6ICBkcmF3IGN1cnNvcnMgdXNpbmcg Y2FjaGUiKTsKKyNlbmRpZgorICAgICAgICBmb3IgKHZsaXN0ID0gWENBUiAoWENEUiAody0+bWNf Y2FjaGUpKTsKKyAgICAgICAgICAgICBDT05TUCAodmxpc3QpOworICAgICAgICAgICAgIHZsaXN0 ID0gWENEUiAodmxpc3QpKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGN1cnNvcl9zcGVjX2xp c3QgPSBYQ0FSIChYQ0FSICh2bGlzdCkpOworICAgICAgICAgICAgcG9zaW50ID0gWElOVCAoRm50 aCAobWFrZV9udW1iZXIgKDApLCBjdXJzb3Jfc3BlY19saXN0KSk7CisgICAgICAgICAgICBjdXJz b3Jfc3BlY190eXBlID0gRm50aCAobWFrZV9udW1iZXIgKDEpLCBjdXJzb3Jfc3BlY19saXN0KTsK KyAgICAgICAgICAgIGlmIChDT05TUCAoY3Vyc29yX3NwZWNfdHlwZSkpCisgICAgICAgICAgICAg IGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoWENBUiAoY3Vyc29yX3NwZWNf dHlwZSkpOworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUg PSBtY19saXNwX3RvX2N1cnNvcl90eXBlIChjdXJzb3Jfc3BlY190eXBlKTsKKyAgICAgICAgICAg IGlmIChDT05TUCAoY3Vyc29yX3NwZWNfdHlwZSkpCisgICAgICAgICAgICAgIGN1cnNvcl93aWR0 aCA9IFhJTlQgKFhDQVIgKFhDRFIgKGN1cnNvcl9zcGVjX3R5cGUpKSk7CisgICAgICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSAxOworICAgICAgICAgICAgY3Vy c29yX2NvbG9yX3ZlY3RvciA9IEZudGggKG1ha2VfbnVtYmVyICgyKSwgY3Vyc29yX3NwZWNfbGlz dCk7CisgICAgICAgICAgICByZWQgPSBYRkxPQVRfREFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3Zl Y3RvciwgMCkpOworICAgICAgICAgICAgZ3JlZW4gPSBYRkxPQVRfREFUQSAoQVJFRiAoY3Vyc29y X2NvbG9yX3ZlY3RvciwgMSkpOworICAgICAgICAgICAgYmx1ZSA9IFhGTE9BVF9EQVRBIChBUkVG IChjdXJzb3JfY29sb3JfdmVjdG9yLCAyKSk7CisgICAgICAgICAgICBpZiAocG9zaW50CisgICAg ICAgICAgICAgICAgJiYgdy0+d2luZG93X3N0YXJ0X2VuZF9ob29rX2ludF93aW5kb3dfc3RhcnQK KyAgICAgICAgICAgICAgICAmJiB3LT53aW5kb3dfc3RhcnRfZW5kX2hvb2tfaW50X3dpbmRvd19l bmQKKyAgICAgICAgICAgICAgICAmJiBwb3NpbnQgPj0gdy0+d2luZG93X3N0YXJ0X2VuZF9ob29r X2ludF93aW5kb3dfc3RhcnQKKyAgICAgICAgICAgICAgICAmJiBwb3NpbnQgPD0gdy0+d2luZG93 X3N0YXJ0X2VuZF9ob29rX2ludF93aW5kb3dfZW5kKQorICAgICAgICAgICAgICB7CisgICAgICAg ICAgICAgICAgeF95X2hwb3NfdnBvc19saXN0ID0gWENBUiAoWENEUiAoWENBUiAodmxpc3QpKSk7 CisgICAgICAgICAgICAgICAgeCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgwKSwgeF95X2hw b3NfdnBvc19saXN0KSk7CisgICAgICAgICAgICAgICAgeSA9IFhJTlQgKEZudGggKG1ha2VfbnVt YmVyICgxKSwgeF95X2hwb3NfdnBvc19saXN0KSk7CisgICAgICAgICAgICAgICAgaHBvcyA9IFhJ TlQgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgeF95X2hwb3NfdnBvc19saXN0KSk7CisgICAgICAg ICAgICAgICAgdnBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgzKSwgeF95X2hwb3NfdnBv c19saXN0KSk7CisgICAgICAgICAgICAgICAgbWNfZHJhdyAodywgMSwgeCwgeSwgaHBvcywgdnBv cywgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcmVkLCBncmVlbiwgYmx1ZSk7CisgICAgICAg ICAgICAgIH0KKyAgICAgICAgICB9CisgICAgICB9CisgICAgICBlbHNlIGlmICh3ID09IHN3Cisg ICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoY3VycmVudF9idWZmZXIsIG1jX2xpc3QpKSkK KyAgICAgICAgeworI2lmZGVmIEdMWVBIX0RFQlVHCisgIGRlYnVnX21ldGhvZF9hZGQgKHcsICJt Y19jYWxjOiAgZHJhdyBjdXJzb3JzIGFuZXciKTsKKyNlbmRpZgorICAgICAgICAgIGZvciAodmxp c3QgPSBCVkFSIChjdXJyZW50X2J1ZmZlciwgbWNfbGlzdCk7CisgICAgICAgICAgICAgICBDT05T UCAodmxpc3QpOworICAgICAgICAgICAgICAgdmxpc3QgPSBYQ0RSICh2bGlzdCkpCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIGN1cnNvcl9zcGVjX2xpc3QgPSBYQ0FSICh2bGlzdCk7Cisg ICAgICAgICAgICAgIHBvc2ludCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgwKSwgY3Vyc29y X3NwZWNfbGlzdCkpOworICAgICAgICAgICAgICBjdXJzb3Jfc3BlY190eXBlID0gRm50aCAobWFr ZV9udW1iZXIgKDEpLCBjdXJzb3Jfc3BlY19saXN0KTsKKyAgICAgICAgICAgICAgaWYgKENPTlNQ IChjdXJzb3Jfc3BlY190eXBlKSkKKyAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xp c3BfdG9fY3Vyc29yX3R5cGUgKFhDQVIgKGN1cnNvcl9zcGVjX3R5cGUpKTsKKyAgICAgICAgICAg ICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vy c29yX3R5cGUgKGN1cnNvcl9zcGVjX3R5cGUpOworICAgICAgICAgICAgICBpZiAoQ09OU1AgKGN1 cnNvcl9zcGVjX3R5cGUpKQorICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCA9IFhJTlQgKFhD QVIgKFhDRFIgKGN1cnNvcl9zcGVjX3R5cGUpKSk7CisgICAgICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoID0gMTsKKyAgICAgICAgICAgICAgY3Vyc29yX2Nv bG9yX3ZlY3RvciA9IEZudGggKG1ha2VfbnVtYmVyICgyKSwgY3Vyc29yX3NwZWNfbGlzdCk7Cisg ICAgICAgICAgICAgIHJlZCA9IFhGTE9BVF9EQVRBIChBUkVGIChjdXJzb3JfY29sb3JfdmVjdG9y LCAwKSk7CisgICAgICAgICAgICAgIGdyZWVuID0gWEZMT0FUX0RBVEEgKEFSRUYgKGN1cnNvcl9j b2xvcl92ZWN0b3IsIDEpKTsKKyAgICAgICAgICAgICAgYmx1ZSA9IFhGTE9BVF9EQVRBIChBUkVG IChjdXJzb3JfY29sb3JfdmVjdG9yLCAyKSk7CisgICAgICAgICAgICAgIGlmIChwb3NpbnQpCisg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgeF95X2hwb3NfdnBvc19saXN0ID0g bWNfeF95X2hwb3NfdnBvcyAodywgcG9zaW50KTsKKyAgICAgICAgICAgICAgICAgIHRlbXAgPSBG Y29ucyAoY3Vyc29yX3NwZWNfbGlzdCwgRmNvbnMgKHhfeV9ocG9zX3Zwb3NfbGlzdCwgUW5pbCkp OworICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gRmNvbnMgKHRlbXAsIHJlc3VsdCk7CisgICAg ICAgICAgICAgICAgICB4ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB4X3lfaHBvc192 cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAgICAgIHkgPSBYSU5UIChGbnRoIChtYWtlX251bWJl ciAoMSksIHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAgICAgICAgICAgaHBvcyA9IFhJ TlQgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgeF95X2hwb3NfdnBvc19saXN0KSk7CisgICAgICAg ICAgICAgICAgICB2cG9zID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDMpLCB4X3lfaHBvc192 cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAgICAgIGlmICh3LT53aW5kb3dfc3RhcnRfZW5kX2hv b2tfaW50X3dpbmRvd19zdGFydAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPndpbmRvd19z dGFydF9lbmRfaG9va19pbnRfd2luZG93X2VuZAorICAgICAgICAgICAgICAgICAgICAgICYmIHBv c2ludCA+PSB3LT53aW5kb3dfc3RhcnRfZW5kX2hvb2tfaW50X3dpbmRvd19zdGFydAorICAgICAg ICAgICAgICAgICAgICAgICYmIHBvc2ludCA8PSB3LT53aW5kb3dfc3RhcnRfZW5kX2hvb2tfaW50 X3dpbmRvd19lbmQpCisgICAgICAgICAgICAgICAgICAgIG1jX2RyYXcgKHcsIDEsIHgsIHksIGhw b3MsIHZwb3MsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJlZCwgZ3JlZW4sIGJsdWUpOwor ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICB3LT5tY19jYWNoZSA9 IEZjb25zIChCVkFSIChjdXJyZW50X2J1ZmZlciwgbWNfbGlzdCksIEZjb25zIChGcmV2ZXJzZSAo cmVzdWx0KSwgUW5pbCkpOworICAgICAgICB9CisgIGRvbmU6CisgIGlmIChvbGRfYnVmZmVyKQor ICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworfQogCiAvKiBEaXNwbGF5IG9y IGNsZWFyIGN1cnNvciBvZiB3aW5kb3cgVy4gIElmICFPTiwgY2xlYXIgdGhlIGN1cnNvci4KICAg IElmIE9OLCBkaXNwbGF5IHRoZSBjdXJzb3I7IHdoZXJlIHRvIHB1dCB0aGUgY3Vyc29yIGlzIHNw ZWNpZmllZCBieQpAQCAtMjgzMjIsNyArMjg4NTcsNyBAQCBlcmFzZV9waHlzX2N1cnNvciAoc3Ry dWN0IHdpbmRvdyAqdykKIAogdm9pZAogZGlzcGxheV9hbmRfc2V0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yb3csIERSQVdfQ1VSU09SKTsKKwkgICAgICBkcmF3X3BoeXNfY3Vyc29yX2ds eXBoICh3LCBnbHlwaF9yb3csIERSQVdfQ1VSU09SLCAieHRlcm0uYzo5MDczIik7CiAJICAgICAg YnJlYWs7CiAKIAkgICAgY2FzZSBCQVJfQ1VSU09SOgo= --Multipart_Thu_Mar_10_23:18:39_2016-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: Can we support multiple Cursors? References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Mon, 14 Mar 2016 18:36:02 +0000 Resent-Message-ID: <handler.22873.B22873.14579805281393 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: John Wiegley <jwiegley@HIDDEN>, Marcin Borkowski <mbork@HIDDEN>, 22873 <at> debbugs.gnu.org, Richard Stallman <rms@HIDDEN> Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.14579805281393 (code B ref 22873); Mon, 14 Mar 2016 18:36:02 +0000 Received: (at 22873) by debbugs.gnu.org; 14 Mar 2016 18:35:28 +0000 Received: from localhost ([127.0.0.1]:48178 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1afXKy-0000MP-Cg for submit <at> debbugs.gnu.org; Mon, 14 Mar 2016 14:35:28 -0400 Received: from cobb.liquidweb.com ([50.28.13.150]:47707) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1afXKw-0000MC-RR for 22873 <at> debbugs.gnu.org; Mon, 14 Mar 2016 14:35:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date; bh=nBclj9sRymf6ku58AOpICMIF880jqImgTuXic+p/P80=; b=cI2LYvwWSzyNgzplGGwVAZ+vSwnlqk0O8zVsPd5uL4ndIM4+7s/ZTefZhPOvi4BRp+tfAkU0OazkrZj0nMXXHk5dJ3HcGyBm/Xf/6t8WyBkhOjY5D9qz/tBA6On4y1Ff; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:50993 helo=server.private.localhost) by cobb.liquidweb.com with esmtp (Exim 4.82) (envelope-from <esq@HIDDEN>) id 1afXKn-0005RJ-D0; Mon, 14 Mar 2016 14:35:17 -0400 Date: Mon, 14 Mar 2016 11:35:18 -0700 Message-ID: <m2bn6gx5zt.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 (generated by - "") Content-Type: text/plain; charset=US-ASCII X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cobb.liquidweb.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-Get-Message-Sender-Via: cobb.liquidweb.com: acl_c_relayhosts_text_entry: lawlist|lawlist.com X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.7 (/) Help, please: :) I reached a roadblock on Emacs for Windows and I haven't the slightest idea why my cached list of multiple cursors is being converted into a value `<optimized out>` sporadically when holding down the arrow key and moving the active cursor repetitively through plain text in a fundamental-mode buffer. Emacs crashes in that circumstance. The cache is a Lisp_Object pointer defined in `window.h` named mc_cache (aka `w->mc_cache`). The value of `w->mc_cache` is: '(( (3 hbar [1.0 0.0 0.0]) (4 bar [0.0 1.0 0.0]) (5 box [0.0 0.0 1.0]) (6 hollow [0.8 0.4 0.2]) (7 (hbar 3) [1.0 0.0 1.0]) (8 (bar 3) [0.0 1.0 1.0])) ( ((3 hbar [1.0 0.0 0.0]) (22 20 2 0)) ((4 bar [0.0 1.0 0.0]) (33 20 3 0)) ((5 box [0.0 0.0 1.0]) (44 20 4 0)) ((6 hollow [0.8 0.4 0.2]) (55 20 5 0)) ((7 (hbar 3) [1.0 0.0 1.0]) (66 20 6 0)) ((8 (bar 3) [0.0 1.0 1.0]) (77 20 7 0)) )) The "for" loop looks like this and Emacs crashes when reading the line containing "cursor_spec_list = XCAR (XCAR (vlist))". `cursor_spec_list` and `vlist` are both Lisp_Object: for (vlist = XCAR (XCDR (w->mc_cache)); CONSP (vlist); vlist = XCDR (vlist)) { cursor_spec_list = XCAR (XCAR (vlist)); *** Here is the gdb backtrace: Administrator@lawlistf0aa /c/docume~1/administrator/desktop/emacs $ gdb /c/docume~1/administrator/desktop/trunk/bin/emacs.exe GNU gdb (GDB) 7.6.1 Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "mingw32". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from c:\docume~1\administrator\desktop\trunk\bin\emacs.exe...don e. (gdb) run Starting program: c:/docume~1/administrator/desktop/trunk/bin/emacs.exe [New Thread 1784.0x360] [New Thread 1784.0x310] [New Thread 1784.0x75c] [New Thread 1784.0x1e8] [New Thread 1784.0x3ec] Program received signal SIGSEGV, Segmentation fault. mc_calc (w=w@entry=0x55d24b8) at xdisp.c:29025 29025 cursor_spec_list = XCAR (XCAR (vlist)); (gdb) print vlist $1 = -1006130013 (gdb) print cursor_spec_list $2 = <optimized out> (gdb) backtrace #0 mc_calc (w=w@entry=0x55d24b8) at xdisp.c:29025 #1 0x010448db in display_and_set_cursor (w=w@entry=0x55d24b8, on=on@entry=true, hpos=57, vpos=17, x=627, y=345) at xdisp.c:29286 #2 0x011665e0 in x_update_window_end (w=0x55d24b8, cursor_on_p=true, mouse_face_overwritten_p=false) at w32term.c:686 #3 0x01005c13 in update_window (w=w@entry=0x55d24b8, force_p=<optimized out>, force_p@entry=true) at dispnew.c:3539 #4 0x01006e72 in update_window_tree (w=w@entry=0x55d24b8, force_p=force_p@entry=true) at dispnew.c:3217 #5 0x01009450 in update_frame (f=f@entry=0x55d2350, force_p=<optimized out>, force_p@entry=false, inhibit_hairy_id_p=inhibit_hairy_id_p@entry=false) at dispnew.c:3106 #6 0x0103ab20 in redisplay_internal () at xdisp.c:14142 #7 0x0103b9d8 in redisplay () at xdisp.c:13171 #8 0x010a3aed in read_char (commandflag=commandflag@entry=1, map=map@entry=136502483, prev_event=0, used_mouse_menu=used_mouse_menu@entry=0x82f8db, end_time=end_time@entry=0x0) at keyboard.c:2483 #9 0x010a6006 in read_key_sequence (keybuf=keybuf@entry=0x82f978, prompt=prompt@entry=0, dont_downcase_last=dont_downcase_last@entry=false, can_return_switch_frame=can_return_switch_frame@entry=true, fix_current_buffer=fix_current_buffer@entry=true, prevent_redisplay=prevent_redisplay@entry=false, bufsize=30) at keyboard.c:9066 #10 0x010a786f in command_loop_1 () at keyboard.c:1369 #11 0x010ff9e7 in internal_condition_case ( bfun=bfun@entry=0x10a7697 <command_loop_1>, handlers=handlers@entry=12256, hfun=hfun@entry=0x109f644 <cmd_error>) at eval.c:1309 #12 0x0109b233 in command_loop_2 (ignore=0) at keyboard.c:1100 #13 0x010ff9ab in internal_catch (tag=tag@entry=32480, func=func@entry=0x109b214 <command_loop_2>, arg=arg@entry=0) at eval.c:1074 #14 0x0109b1f5 in command_loop () at keyboard.c:1079 #15 0x0109f2fc in recursive_edit_1 () at keyboard.c:685 #16 0x0109f58c in Frecursive_edit () at keyboard.c:756 #17 0x011b76fa in main (argc=<optimized out>, argv=0xa428b0) at emacs.c:1617 (gdb) Thanks, Keith
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: Can we support multiple Cursors? Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Mon, 14 Mar 2016 18:51:01 +0000 Resent-Message-ID: <handler.22873.B22873.14579814193085 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Keith David Bershatsky <esq@HIDDEN> Cc: jwiegley@HIDDEN, mbork@HIDDEN, 22873 <at> debbugs.gnu.org, rms@HIDDEN Reply-To: Eli Zaretskii <eliz@HIDDEN> Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.14579814193085 (code B ref 22873); Mon, 14 Mar 2016 18:51:01 +0000 Received: (at 22873) by debbugs.gnu.org; 14 Mar 2016 18:50:19 +0000 Received: from localhost ([127.0.0.1]:48187 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1afXZK-0000nh-Vo for submit <at> debbugs.gnu.org; Mon, 14 Mar 2016 14:50:19 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60210) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1afXZK-0000nQ-41 for 22873 <at> debbugs.gnu.org; Mon, 14 Mar 2016 14:50:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <eliz@HIDDEN>) id 1afXZA-0005Hf-L5 for 22873 <at> debbugs.gnu.org; Mon, 14 Mar 2016 14:50:12 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37003) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>) id 1afXYw-0005CO-De; Mon, 14 Mar 2016 14:49:54 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2801 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from <eliz@HIDDEN>) id 1afXYn-0002nH-Vb; Mon, 14 Mar 2016 14:49:46 -0400 Date: Mon, 14 Mar 2016 20:49:17 +0200 Message-Id: <837fh4dhea.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-reply-to: <m2bn6gx5zt.wl%esq@HIDDEN> (message from Keith David Bershatsky on Mon, 14 Mar 2016 11:35:18 -0700) References: <m2bn6gx5zt.wl%esq@HIDDEN> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -5.0 (-----) > Date: Mon, 14 Mar 2016 11:35:18 -0700 > From: Keith David Bershatsky <esq@HIDDEN> > Cc: 22873 <at> debbugs.gnu.org,John Wiegley <jwiegley@HIDDEN>,Marcin Borkowski <mbork@HIDDEN>,Richard Stallman <rms@HIDDEN> > > I reached a roadblock on Emacs for Windows and I haven't the slightest idea why my cached list of multiple cursors is being converted into a value `<optimized out>` sporadically when holding down the arrow key and moving the active cursor repetitively through plain text in a fundamental-mode buffer. Emacs crashes in that circumstance. The cache is a Lisp_Object pointer defined in `window.h` named mc_cache (aka `w->mc_cache`). The value of `w->mc_cache` is: > > '(( > (3 hbar [1.0 0.0 0.0]) > (4 bar [0.0 1.0 0.0]) > (5 box [0.0 0.0 1.0]) > (6 hollow [0.8 0.4 0.2]) > (7 (hbar 3) [1.0 0.0 1.0]) > (8 (bar 3) [0.0 1.0 1.0])) > ( > ((3 hbar [1.0 0.0 0.0]) (22 20 2 0)) > ((4 bar [0.0 1.0 0.0]) (33 20 3 0)) > ((5 box [0.0 0.0 1.0]) (44 20 4 0)) > ((6 hollow [0.8 0.4 0.2]) (55 20 5 0)) > ((7 (hbar 3) [1.0 0.0 1.0]) (66 20 6 0)) > ((8 (bar 3) [0.0 1.0 1.0]) (77 20 7 0)) > )) > > The "for" loop looks like this and Emacs crashes when reading the line containing "cursor_spec_list = XCAR (XCAR (vlist))". `cursor_spec_list` and `vlist` are both Lisp_Object: > > for (vlist = XCAR (XCDR (w->mc_cache)); > CONSP (vlist); > vlist = XCDR (vlist)) > { > cursor_spec_list = XCAR (XCAR (vlist)); > *** You maintain a Lisp object in a window object, but did you make sure it's declared before the place in 'struct window' where we have this comment: /* No Lisp data may follow below this point without changing mark_object in alloc.c. The member current_matrix must be the first non-Lisp member. */ If mc_cache is beyond this point, chances are it's being GC'ed behind your back.
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: Can we support multiple Cursors? References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Mon, 14 Mar 2016 22:40:02 +0000 Resent-Message-ID: <handler.22873.B22873.14579951454098 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: John Wiegley <jwiegley@HIDDEN>, Marcin Borkowski <mbork@HIDDEN>, 22873 <at> debbugs.gnu.org, Richard Stallman <rms@HIDDEN> Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.14579951454098 (code B ref 22873); Mon, 14 Mar 2016 22:40:02 +0000 Received: (at 22873) by debbugs.gnu.org; 14 Mar 2016 22:39:05 +0000 Received: from localhost ([127.0.0.1]:48278 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1afb8j-000141-Bi for submit <at> debbugs.gnu.org; Mon, 14 Mar 2016 18:39:05 -0400 Received: from cobb.liquidweb.com ([50.28.13.150]:54278) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1afb8h-00013X-R0 for 22873 <at> debbugs.gnu.org; Mon, 14 Mar 2016 18:39:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date; bh=xQt9jb1ae8O3BWMtpSJLydEq5hpTDeAyTWwZq+yzyM4=; b=UNBZ5hVDT3yud1pw/pXe8cAXH+meysHGXOePhMjreQsFdZjPM6OY4Y+79aYb2Ji4Bfg9e6yXaAhjlYLZP0xoRE16CxN5NBiKB5opwSrscdI2xm3C/4AfdrAbLkZ1luLR; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:52638 helo=server.private.localhost) by cobb.liquidweb.com with esmtp (Exim 4.82) (envelope-from <esq@HIDDEN>) id 1afb8Z-0000N3-2r; Mon, 14 Mar 2016 18:38:55 -0400 Date: Mon, 14 Mar 2016 15:38:55 -0700 Message-ID: <m2a8m0wups.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 (generated by - "") Content-Type: multipart/mixed; boundary="Multipart_Mon_Mar_14_15:38:53_2016-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cobb.liquidweb.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-Get-Message-Sender-Via: cobb.liquidweb.com: acl_c_relayhosts_text_entry: lawlist|lawlist.com X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.7 (/) --Multipart_Mon_Mar_14_15:38:53_2016-1 Content-Type: text/plain; charset=US-ASCII Thank you, Eli, for resolving the issue with the `mc_cache` being GC'ed behind my back. As per your suggestion, I moved the Lisp_Object definition of `mc_cache` in `window.h` to above the section beginning with the comment "No Lisp data may follow below this point . . . ." I also moved the other mc-realted `int` and `bool_bf` definitions into the section beginning with "#ifdef HAVE_WINDOW_SYSTEM". The enclosed `multiple_cursors_004.diff` applies to Emacs master branch from last night (March 13, 2016) bearing commit "181e92c4e060a7ce4740b561375f9ec9f473f144". Multiple fake cursors now have preliminary support on all three (3) window systems -- i.e., X (--with-x --with-x-toolkit=no), Windows (XP SP-3) and OSX (10.6.8). I will need to track down why (on Emacs for Windows) a fake cursor appearing as FILLED_BOX_CURSOR sometimes takes on the background color of the real active cursor. This seems to depend upon whether I start with Emacs -Q versus a full configuration, so perhaps it won't be that difficult to track down. I haven't done any calculations regarding the time needed to run `mc_x_y_hpos_vpos` on each position for fake cursors, so I don't really know how advantageous a cache is and whether more effort should be made to perfect a caching mechanism. I'm assuming that just multiplying the LSL color vector elements by 255 for Windows and by 65535 for X is sufficient to obtain the exact color, but it certainly appears to look okay to my untrained eyes. (defun mc-test (&optional list) "Draw fake cursors at all POS defined in the `mc-list'. Multiple fake cursors are supported by GUI versions of Emacs built for X, Windows and OSX. Color vector is LSL (The Linden Scripting Language), rather than standard RGB. `nsterm.m' uses `NSColor', which works well with LSL. `w32term.c' uses `PALETTERGB' or `RGB', and the conversion from LSL is done internally by multiplying each element of the LSL color vector by 255. `xterm.c' uses `x_make_truecolor_pixel', which uses 16-bit RGB -- the conversion from LSL happens internally by multiplying each element of the LSL color vector by 65535." (interactive) (setq mc-list (if list list '( (3 "hbar" [1.0 0.0 0.0]) (4 "bar" [0.0 1.0 0.0]) (5 "box" [0.0 0.0 1.0]) (6 "hollow" [0.8 0.4 0.2]) (7 ("hbar" 3) [1.0 0.0 1.0]) (8 ("bar" 3) [0.0 1.0 1.0]))))) (global-set-key [f1] 'mc-test) --Multipart_Mon_Mar_14_15:38:53_2016-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="multiple_cursors_004.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3NyYy9idWZmZXIuYyBiL3NyYy9idWZmZXIuYwppbmRleCA2MmIwYmM4Li4w NTk2MWVmIDEwMDY0NAotLS0gYS9zcmMvYnVmZmVyLmMKKysrIGIvc3JjL2J1ZmZlci5jCkBAIC01 MDczLDYgKzUwNzMsNyBAQCBpbml0X2J1ZmZlcl9vbmNlICh2b2lkKQogICBYU0VURkFTVElOVCAo QlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgZGlzcGxheV90YWJsZSksIGlkeCk7ICsraWR4Owog ICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgc3ludGF4X3RhYmxlKSwg aWR4KTsgKytpZHg7CiAgIFhTRVRGQVNUSU5UIChCVkFSICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBj YWNoZV9sb25nX3NjYW5zKSwgaWR4KTsgKytpZHg7CisgIFhTRVRGQVNUSU5UIChCVkFSICgmYnVm ZmVyX2xvY2FsX2ZsYWdzLCBtY19saXN0KSwgaWR4KTsgKytpZHg7CiAgIFhTRVRGQVNUSU5UIChC VkFSICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBjYXRlZ29yeV90YWJsZSksIGlkeCk7ICsraWR4Owog ICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgYmlkaV9kaXNwbGF5X3Jl b3JkZXJpbmcpL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MCAmJiBibHVlID49IDAgJiYgZ3JlZW4g Pj0gMCkKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLncz Mi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgICAgeworICAgICAgICAgICAgc3RydWN0IGZy YW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAgICAgICAgICAgIENPTE9SUkVG IG9yaWdfdmFsID0gZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWw7CisgICAgICAgICAg ICBpbnQgaW50X3JlZCA9IHJlZCAqIDI1NTsKKyAgICAgICAgICAgIGludCBpbnRfZ3JlZW4gPSBn cmVlbiAqIDI1NTsKKyAgICAgICAgICAgIGludCBpbnRfYmx1ZSA9IGJsdWUgKiAyNTU7CisgICAg ICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IFBBTEVUVEVSR0IgKGlu dF9yZWQsIGludF9ncmVlbiwgaW50X2JsdWUpOworICAgICAgICAgICAgeF9kcmF3X2hvbGxvd19j dXJzb3IgKHcsIGdseXBoX3Jvdyk7CisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1 cnNvcl9waXhlbCA9IG9yaWdfdmFsOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAg ICAgICAgICB4X2RyYXdfaG9sbG93X2N1cnNvciAodywgZ2x5cGhfcm93KTsKKyAgICAgICAgYnJl YWs7CisgICAgICB9CisgICAgICBjYXNlIEZJTExFRF9CT1hfQ1VSU09SOgorICAgICAgeworICAg ICAgICBpZiAocmVkID49IDAgJiYgYmx1ZSA+PSAwICYmIGdyZWVuID49IDApCisgICAgICAgICAg LyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYy0+Zm9y ZWdyb3VuZCcKKyAgICAgICAgICBhbmQgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djLT5i YWNrZ3JvdW5kJy4gICovCisgICAgICAgICAgeworICAgICAgICAgICAgc3RydWN0IGZyYW1lICpm ID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAgICAgICAgICAgIENPTE9SUkVGIG9yaWdf dmFsX2EsIG9yaWdfdmFsX2I7CisgICAgICAgICAgICBvcmlnX3ZhbF9hID0gZi0+b3V0cHV0X2Rh dGEudzMyLT5jdXJzb3JfZ2MtPmZvcmVncm91bmQ7CisgICAgICAgICAgICBvcmlnX3ZhbF9iID0g Zi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MtPmJhY2tncm91bmQ7CisgICAgICAgICAgICBp bnQgaW50X3JlZCA9IHJlZCAqIDI1NTsKKyAgICAgICAgICAgIGludCBpbnRfZ3JlZW4gPSBncmVl biAqIDI1NTsKKyAgICAgICAgICAgIGludCBpbnRfYmx1ZSA9IGJsdWUgKiAyNTU7CisgICAgICAg ICAgICAvKiBUT0RPOiAga2RiIHRvIGNvbnNpZGVyIGFkZGluZyBzdXBwb3J0IGZvciBtdWx0aXBs ZSBjdXJzb3IgZm9yZWdyb3VuZAorICAgICAgICAgICAgY3VzdG9taXphdGlvbiBvZiBhIEZJTExF RF9CT1hfQ1VSU09SLiAgKi8KKyAgICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29y X2djLT5mb3JlZ3JvdW5kID0gRlJBTUVfQkFDS0dST1VORF9QSVhFTCAoZik7CisgICAgICAgICAg ICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYy0+YmFja2dyb3VuZCA9IFBBTEVUVEVSR0Ig KGludF9yZWQsIGludF9ncmVlbiwgaW50X2JsdWUpOworICAgICAgICAgICAgZHJhd19waHlzX2N1 cnNvcl9nbHlwaCAodywgZ2x5cGhfcm93LCBEUkFXX0NVUlNPUik7CisgICAgICAgICAgICBmLT5v dXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYy0+Zm9yZWdyb3VuZCA9IG9yaWdfdmFsX2E7CisgICAg ICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYy0+YmFja2dyb3VuZCA9IG9yaWdf dmFsX2I7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGRyYXdfcGh5 c19jdXJzb3JfZ2x5cGggKHcsIGdseXBoX3JvdywgRFJBV19DVVJTT1IpOworICAgICAgICBicmVh azsKKyAgICAgIH0KKyAgICAgIGNhc2UgQkFSX0NVUlNPUjoKKyAgICAgIHsKKyAgICAgICAgaWYg KHJlZCA+PSAwICYmIGJsdWUgPj0gMCAmJiBncmVlbiA+PSAwKQorICAgICAgICAgIC8qIFRlbXBv cmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAg ICAgICAgICB7CisgICAgICAgICAgICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19G UkFNRSAodykpOworICAgICAgICAgICAgQ09MT1JSRUYgb3JpZ192YWwgPSBmLT5vdXRwdXRfZGF0 YS53MzItPmN1cnNvcl9waXhlbDsKKyAgICAgICAgICAgIGludCBpbnRfcmVkID0gcmVkICogMjU1 OworICAgICAgICAgICAgaW50IGludF9ncmVlbiA9IGdyZWVuICogMjU1OworICAgICAgICAgICAg aW50IGludF9ibHVlID0gYmx1ZSAqIDI1NTsKKyAgICAgICAgICAgIGYtPm91dHB1dF9kYXRhLncz Mi0+Y3Vyc29yX3BpeGVsID0gUEFMRVRURVJHQiAoaW50X3JlZCwgaW50X2dyZWVuLCBpbnRfYmx1 ZSk7CisgICAgICAgICAgICB4X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cGhfcm93LCBjdXJzb3Jf d2lkdGgsIEJBUl9DVVJTT1IpOworICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJz b3JfcGl4ZWwgPSBvcmlnX3ZhbDsKKyAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIGdseXBoX3JvdywgY3Vyc29yX3dpZHRoLCBCQVJf Q1VSU09SKTsKKyAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBjYXNlIEhCQVJfQ1VSU09S OgorICAgICAgeworICAgICAgICBpZiAocmVkID49IDAgJiYgYmx1ZSA+PSAwICYmIGdyZWVuID49 IDApCisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzIt PmN1cnNvcl9waXhlbCcuICAqLworICAgICAgICAgIHsKKyAgICAgICAgICAgIHN0cnVjdCBmcmFt ZSAqZiA9IFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7CisgICAgICAgICAgICBDT0xPUlJFRiBv cmlnX3ZhbCA9IGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsOworICAgICAgICAgICAg aW50IGludF9yZWQgPSByZWQgKiAyNTU7CisgICAgICAgICAgICBpbnQgaW50X2dyZWVuID0gZ3Jl ZW4gKiAyNTU7CisgICAgICAgICAgICBpbnQgaW50X2JsdWUgPSBibHVlICogMjU1OworICAgICAg ICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBQQUxFVFRFUkdCIChpbnRf cmVkLCBpbnRfZ3JlZW4sIGludF9ibHVlKTsKKyAgICAgICAgICAgIHhfZHJhd19iYXJfY3Vyc29y ICh3LCBnbHlwaF9yb3csIGN1cnNvcl93aWR0aCwgSEJBUl9DVVJTT1IpOworICAgICAgICAgICAg Zi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBvcmlnX3ZhbDsKKyAgICAgICAgICB9 CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeF9kcmF3X2Jhcl9jdXJzb3IgKHc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isgICAgICBo cG9zID0gaXQuaHBvczsKKyAgICAgIHZwb3MgPSBpdC52cG9zOworICAgICAgYmlkaV91bnNoZWx2 ZV9jYWNoZSAoaXRkYXRhLCBmYWxzZSk7CisgICAgfQorICAgIGVsc2UKKyAgICAgIHsKKyAgICAg ICAgeCA9IC0xOworICAgICAgICB5ID0gLTE7CisgICAgICAgIGhwb3MgPSAtMTsKKyAgICAgICAg dnBvcyA9IC0xOworICAgICAgfQorICByZXR1cm4gbGlzdG4gKENPTlNUWVBFX1BVUkUsIDQsIG1h a2VfbnVtYmVyICh4KSwgbWFrZV9udW1iZXIgKHkpLCBtYWtlX251bWJlciAoaHBvcyksIG1ha2Vf bnVtYmVyICh2cG9zKSk7Cit9CisKK2ludAorbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoTGlzcF9P YmplY3QgYXJnKQoreworICBjaGFyICpzdHI7CisgIGlmIChYVFlQRSAoYXJnKSA9PSBMaXNwX1N0 cmluZykKKyAgICBzdHIgPSBTU0RBVEEgKGFyZyk7CisgIGVsc2UgaWYgKFhUWVBFIChhcmcpID09 IExpc3BfU3ltYm9sKQorICAgIHN0ciA9IFNTREFUQSAoU1lNQk9MX05BTUUgKGFyZykpOworICBl bHNlIHJldHVybiAtMTsKKyAgaWYgKCFzdHJjbXAgKHN0ciwgImJveCIpKQorICAgIHJldHVybiBG SUxMRURfQk9YX0NVUlNPUjsKKyAgaWYgKCFzdHJjbXAgKHN0ciwgImhvbGxvdyIpKQorICAgIHJl dHVybiBIT0xMT1dfQk9YX0NVUlNPUjsKKyAgaWYgKCFzdHJjbXAgKHN0ciwgImhiYXIiKSkKKyAg ICByZXR1cm4gSEJBUl9DVVJTT1I7CisgIGlmICghc3RyY21wIChzdHIsICJiYXIiKSkKKyAgICBy ZXR1cm4gQkFSX0NVUlNPUjsKKyAgaWYgKCFzdHJjbXAgKHN0ciwgIm5vIikpCisgICAgcmV0dXJu IE5PX0NVUlNPUjsKKyAgcmV0dXJuIC0xOworfQorCisv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lNQICh2bGlzdCk7CisgICAgICAgICAgIHZsaXN0ID0gWENEUiAodmxp c3QpKQorICAgICAgICB7CisgICAgICAgICAgY3Vyc29yX3NwZWNfbGlzdCA9IFhDQVIgKFhDQVIg KHZsaXN0KSk7CisgICAgICAgICAgcG9zaW50ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDAp LCBjdXJzb3Jfc3BlY19saXN0KSk7CisgICAgICAgICAgY3Vyc29yX3NwZWNfdHlwZSA9IEZudGgg KG1ha2VfbnVtYmVyICgxKSwgY3Vyc29yX3NwZWNfbGlzdCk7CisgICAgICAgICAgaWYgKENPTlNQ IChjdXJzb3Jfc3BlY190eXBlKSkKKyAgICAgICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90 b19jdXJzb3JfdHlwZSAoWENBUiAoY3Vyc29yX3NwZWNfdHlwZSkpOworICAgICAgICAgICAgZWxz ZQorICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKGN1 cnNvcl9zcGVjX3R5cGUpOworICAgICAgICAgIGlmIChDT05TUCAoY3Vyc29yX3NwZWNfdHlwZSkp CisgICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSBYSU5UIChYQ0FSIChYQ0RSIChjdXJzb3Jfc3Bl Y190eXBlKSkpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgg PSAxOworICAgICAgICAgIGN1cnNvcl9jb2xvcl92ZWN0b3IgPSBGbnRoIChtYWtlX251bWJlciAo MiksIGN1cnNvcl9zcGVjX2xpc3QpOworICAgICAgICAgIHJlZCA9IFhGTE9BVF9EQVRBIChBUkVG IChjdXJzb3JfY29sb3JfdmVjdG9yLCAwKSk7CisgICAgICAgICAgZ3JlZW4gPSBYRkxPQVRfREFU QSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3RvciwgMSkpOworICAgICAgICAgIGJsdWUgPSBYRkxP QVRfREFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3RvciwgMikpOworICAgICAgICAgIGlmIChw b3NpbnQKKyAgICAgICAgICAgICAgJiYgdy0+bWNfd2luZG93X3N0YXJ0CisgICAgICAgICAgICAg ICYmIHctPm1jX3dpbmRvd19lbmQKKyAgICAgICAgICAgICAgJiYgcG9zaW50ID49IHctPm1jX3dp bmRvd19zdGFydAorICAgICAgICAgICAgICAmJiBwb3NpbnQgPD0gdy0+bWNfd2luZG93X2VuZCkK KyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgeF95X2hwb3NfdnBvc19saXN0ID0gWENBUiAo WENEUiAoWENBUiAodmxpc3QpKSk7CisgICAgICAgICAgICAgIHggPSBYSU5UIChGbnRoIChtYWtl X251bWJlciAoMCksIHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAgICAgICB5ID0gWElO VCAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAg ICAgICAgaHBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgeF95X2hwb3NfdnBvc19s aXN0KSk7CisgICAgICAgICAgICAgIHZwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMyks IHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAgICAgICBtY19lcmFzZSAodywgeCwgeSwg aHBvcywgdnBvcywgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcmVkLCBncmVlbiwgYmx1ZSk7 CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIHctPm1jX2NhY2hlID0gUW5pbDsKKyAg ICB9CisgICAgZWxzZSBpZiAodyA9PSBzdworICAgICAgICAgICAgJiYgdy0+bWNfd2luZG93X3N0 YXJ0CisgICAgICAgICAgICAmJiB3LT5tY193aW5kb3dfZW5kCisgICAgICAgICAgICAmJiB3LT5t Y19wcmV2aW91c193aW5kb3dfc3RhcnQKKyAgICAgICAgICAgICYmIHctPm1jX3ByZXZpb3VzX3dp bmRvd19lbmQKKyAgICAgICAgICAgICYmIHctPm1jX3dpbmRvd19zdGFydCA9PSB3LT5tY19wcmV2 aW91c193aW5kb3dfc3RhcnQKKyAgICAgICAgICAgICYmIHctPm1jX3dpbmRvd19lbmQgPT0gdy0+ bWNfcHJldmlvdXNfd2luZG93X2VuZAorICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGN1cnJl bnRfYnVmZmVyLCBtY19saXN0KSkKKyAgICAgICAgICAgICYmIHctPm1jX2NhY2hlCisgICAgICAg ICAgICAmJiAhTklMUCAoRmVxdWFsIChGbnRoIChtYWtlX251bWJlciAoMCksIHctPm1jX2NhY2hl KSwgQlZBUiAoY3VycmVudF9idWZmZXIsIG1jX2xpc3QpKSkpCisgICAgICB7CisjaWZkZWYgR0xZ UEhfREVCVUcKKyAgZGVidWdfbWV0aG9kX2FkZCAodywgIm1jX2NhbGM6ICBkcmF3IGN1cnNvcnMg dXNpbmcgY2FjaGUiKTsKKyNlbmRpZgorICAgICAgICBmb3IgKHZsaXN0ID0gWENBUiAoWENEUiAo dy0+bWNfY2FjaGUpKTsKKyAgICAgICAgICAgICBDT05TUCAodmxpc3QpOworICAgICAgICAgICAg IHZsaXN0ID0gWENEUiAodmxpc3QpKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGN1cnNvcl9z cGVjX2xpc3QgPSBYQ0FSIChYQ0FSICh2bGlzdCkpOworICAgICAgICAgICAgcG9zaW50ID0gWElO VCAoRm50aCAobWFrZV9udW1iZXIgKDApLCBjdXJzb3Jfc3BlY19saXN0KSk7CisgICAgICAgICAg ICBjdXJzb3Jfc3BlY190eXBlID0gRm50aCAobWFrZV9udW1iZXIgKDEpLCBjdXJzb3Jfc3BlY19s aXN0KTsKKyAgICAgICAgICAgIGlmIChDT05TUCAoY3Vyc29yX3NwZWNfdHlwZSkpCisgICAgICAg ICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoWENBUiAoY3Vyc29y X3NwZWNfdHlwZSkpOworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgY3Vyc29y X3R5cGUgPSBtY19saXNwX3RvX2N1cnNvcl90eXBlIChjdXJzb3Jfc3BlY190eXBlKTsKKyAgICAg ICAgICAgIGlmIChDT05TUCAoY3Vyc29yX3NwZWNfdHlwZSkpCisgICAgICAgICAgICAgIGN1cnNv cl93aWR0aCA9IFhJTlQgKFhDQVIgKFhDRFIgKGN1cnNvcl9zcGVjX3R5cGUpKSk7CisgICAgICAg ICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSAxOworICAgICAgICAg ICAgY3Vyc29yX2NvbG9yX3ZlY3RvciA9IEZudGggKG1ha2VfbnVtYmVyICgyKSwgY3Vyc29yX3Nw ZWNfbGlzdCk7CisgICAgICAgICAgICByZWQgPSBYRkxPQVRfREFUQSAoQVJFRiAoY3Vyc29yX2Nv bG9yX3ZlY3RvciwgMCkpOworICAgICAgICAgICAgZ3JlZW4gPSBYRkxPQVRfREFUQSAoQVJFRiAo Y3Vyc29yX2NvbG9yX3ZlY3RvciwgMSkpOworICAgICAgICAgICAgYmx1ZSA9IFhGTE9BVF9EQVRB IChBUkVGIChjdXJzb3JfY29sb3JfdmVjdG9yLCAyKSk7CisgICAgICAgICAgICBpZiAocG9zaW50 CisgICAgICAgICAgICAgICAgJiYgdy0+bWNfd2luZG93X3N0YXJ0CisgICAgICAgICAgICAgICAg JiYgdy0+bWNfd2luZG93X2VuZAorICAgICAgICAgICAgICAgICYmIHBvc2ludCA+PSB3LT5tY193 aW5kb3dfc3RhcnQKKyAgICAgICAgICAgICAgICAmJiBwb3NpbnQgPD0gdy0+bWNfd2luZG93X2Vu ZCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHhfeV9ocG9zX3Zwb3NfbGlzdCA9 IFhDQVIgKFhDRFIgKFhDQVIgKHZsaXN0KSkpOworICAgICAgICAgICAgICAgIHggPSBYSU5UIChG bnRoIChtYWtlX251bWJlciAoMCksIHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAgICAg ICAgIHkgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMSksIHhfeV9ocG9zX3Zwb3NfbGlzdCkp OworICAgICAgICAgICAgICAgIGhwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMiksIHhf eV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAgICAgICAgIHZwb3MgPSBYSU5UIChGbnRoICht YWtlX251bWJlciAoMyksIHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAgICAgICAgIG1j X2RyYXcgKHcsIHgsIHksIGhwb3MsIHZwb3MsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJl ZCwgZ3JlZW4sIGJsdWUpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgfQor ICAgICAgZWxzZSBpZiAodyA9PSBzdworICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGN1 cnJlbnRfYnVmZmVyLCBtY19saXN0KSkpCisgICAgICAgIHsKKyNpZmRlZiBHTFlQSF9ERUJVRwor ICBkZWJ1Z19tZXRob2RfYWRkICh3LCAibWNfY2FsYzogIGRyYXcgY3Vyc29ycyBhbmV3Iik7Cisj ZW5kaWYKKyAgICAgICAgICAvKiBFcmFzZSBhbGwgb2YgdGhlIG9sZCBjdXJzb3JzIGF0IHRoZSBw cmV2aW91c2x5IHJlY29yZGVkIHgveS9ocG9zL3Zwb3MgZXZlbgorICAgICAgICAgIHRob3VnaCB0 aGUgY29ycmVzcG9uZGluZyBgcG9zaW50JyBoYXMgY2hhbmdlZC4gICovCisgICAgICAgICAgaWYg KHctPm1jX2NhY2hlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBmb3IgKHZsaXN0ID0g WENBUiAoWENEUiAody0+bWNfY2FjaGUpKTsKKyAgICAgICAgICAgICAgICAgICBDT05TUCAodmxp c3QpOworICAgICAgICAgICAgICAgICAgIHZsaXN0ID0gWENEUiAodmxpc3QpKQorICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGN1cnNvcl9zcGVjX2xpc3QgPSBYQ0FSIChYQ0FS ICh2bGlzdCkpOworICAgICAgICAgICAgICAgICAgcG9zaW50ID0gWElOVCAoRm50aCAobWFrZV9u dW1iZXIgKDApLCBjdXJzb3Jfc3BlY19saXN0KSk7CisgICAgICAgICAgICAgICAgICBjdXJzb3Jf c3BlY190eXBlID0gRm50aCAobWFrZV9udW1iZXIgKDEpLCBjdXJzb3Jfc3BlY19saXN0KTsKKyAg ICAgICAgICAgICAgICAgIGlmIChDT05TUCAoY3Vyc29yX3NwZWNfdHlwZSkpCisgICAgICAgICAg ICAgICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoWENBUiAoY3Vy c29yX3NwZWNfdHlwZSkpOworICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAg ICAgICAgICAgY3Vyc29yX3R5cGUgPSBtY19saXNwX3RvX2N1cnNvcl90eXBlIChjdXJzb3Jfc3Bl Y190eXBlKTsKKyAgICAgICAgICAgICAgICAgIGlmIChDT05TUCAoY3Vyc29yX3NwZWNfdHlwZSkp CisgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCA9IFhJTlQgKFhDQVIgKFhDRFIgKGN1 cnNvcl9zcGVjX3R5cGUpKSk7CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSAxOworICAgICAgICAgICAgICAgICAgY3Vyc29yX2Nv bG9yX3ZlY3RvciA9IEZudGggKG1ha2VfbnVtYmVyICgyKSwgY3Vyc29yX3NwZWNfbGlzdCk7Cisg ICAgICAgICAgICAgICAgICByZWQgPSBYRkxPQVRfREFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3Zl Y3RvciwgMCkpOworICAgICAgICAgICAgICAgICAgZ3JlZW4gPSBYRkxPQVRfREFUQSAoQVJFRiAo Y3Vyc29yX2NvbG9yX3ZlY3RvciwgMSkpOworICAgICAgICAgICAgICAgICAgYmx1ZSA9IFhGTE9B VF9EQVRBIChBUkVGIChjdXJzb3JfY29sb3JfdmVjdG9yLCAyKSk7CisgICAgICAgICAgICAgICAg ICB4X3lfaHBvc192cG9zX2xpc3QgPSBYQ0FSIChYQ0RSIChYQ0FSICh2bGlzdCkpKTsKKyAgICAg ICAgICAgICAgICAgIHggPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMCksIHhfeV9ocG9zX3Zw b3NfbGlzdCkpOworICAgICAgICAgICAgICAgICAgeSA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVy ICgxKSwgeF95X2hwb3NfdnBvc19saXN0KSk7CisgICAgICAgICAgICAgICAgICBocG9zID0gWElO VCAoRm50aCAobWFrZV9udW1iZXIgKDIpLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAg ICAgICAgICAgIHZwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMyksIHhfeV9ocG9zX3Zw b3NfbGlzdCkpOworICAgICAgICAgICAgICAgICAgbWNfZXJhc2UgKHcsIHgsIHksIGhwb3MsIHZw b3MsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJlZCwgZ3JlZW4sIGJsdWUpOworICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgICAgdy0+bWNfY2FjaGUgPSBRbmlsOworICAgICAgICAg ICAgfQorICAgICAgICAgIGZvciAodmxpc3QgPSBCVkFSIChjdXJyZW50X2J1ZmZlciwgbWNfbGlz dCk7CisgICAgICAgICAgICAgICBDT05TUCAodmxpc3QpOworICAgICAgICAgICAgICAgdmxpc3Qg PSBYQ0RSICh2bGlzdCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGN1cnNvcl9zcGVj X2xpc3QgPSBYQ0FSICh2bGlzdCk7CisgICAgICAgICAgICAgIHBvc2ludCA9IFhJTlQgKEZudGgg KG1ha2VfbnVtYmVyICgwKSwgY3Vyc29yX3NwZWNfbGlzdCkpOworICAgICAgICAgICAgICBjdXJz b3Jfc3BlY190eXBlID0gRm50aCAobWFrZV9udW1iZXIgKDEpLCBjdXJzb3Jfc3BlY19saXN0KTsK KyAgICAgICAgICAgICAgaWYgKENPTlNQIChjdXJzb3Jfc3BlY190eXBlKSkKKyAgICAgICAgICAg ICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKFhDQVIgKGN1cnNvcl9z cGVjX3R5cGUpKTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXJz b3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKGN1cnNvcl9zcGVjX3R5cGUpOworICAg ICAgICAgICAgICBpZiAoQ09OU1AgKGN1cnNvcl9zcGVjX3R5cGUpKQorICAgICAgICAgICAgICAg IGN1cnNvcl93aWR0aCA9IFhJTlQgKFhDQVIgKFhDRFIgKGN1cnNvcl9zcGVjX3R5cGUpKSk7Cisg ICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoID0gMTsK KyAgICAgICAgICAgICAgY3Vyc29yX2NvbG9yX3ZlY3RvciA9IEZudGggKG1ha2VfbnVtYmVyICgy KSwgY3Vyc29yX3NwZWNfbGlzdCk7CisgICAgICAgICAgICAgIHJlZCA9IFhGTE9BVF9EQVRBIChB UkVGIChjdXJzb3JfY29sb3JfdmVjdG9yLCAwKSk7CisgICAgICAgICAgICAgIGdyZWVuID0gWEZM T0FUX0RBVEEgKEFSRUYgKGN1cnNvcl9jb2xvcl92ZWN0b3IsIDEpKTsKKyAgICAgICAgICAgICAg Ymx1ZSA9IFhGTE9BVF9EQVRBIChBUkVGIChjdXJzb3JfY29sb3JfdmVjdG9yLCAyKSk7CisgICAg ICAgICAgICAgIGlmIChwb3NpbnQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg ICAgeF95X2hwb3NfdnBvc19saXN0ID0gbWNfeF95X2hwb3NfdnBvcyAodywgcG9zaW50KTsKKyAg ICAgICAgICAgICAgICAgIHRlbXAgPSBGY29ucyAoY3Vyc29yX3NwZWNfbGlzdCwgRmNvbnMgKHhf eV9ocG9zX3Zwb3NfbGlzdCwgUW5pbCkpOworICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gRmNv bnMgKHRlbXAsIHJlc3VsdCk7CisgICAgICAgICAgICAgICAgICB4ID0gWElOVCAoRm50aCAobWFr ZV9udW1iZXIgKDApLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAgICAgIHkg PSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMSksIHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAg ICAgICAgICAgICAgICAgaHBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgeF95X2hw b3NfdnBvc19saXN0KSk7CisgICAgICAgICAgICAgICAgICB2cG9zID0gWElOVCAoRm50aCAobWFr ZV9udW1iZXIgKDMpLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAgICAgIGlm ICh3LT5tY193aW5kb3dfc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5tY193aW5k b3dfZW5kCisgICAgICAgICAgICAgICAgICAgICAgJiYgcG9zaW50ID49IHctPm1jX3dpbmRvd19z dGFydAorICAgICAgICAgICAgICAgICAgICAgICYmIHBvc2ludCA8PSB3LT5tY193aW5kb3dfZW5k KQorICAgICAgICAgICAgICAgICAgICBtY19kcmF3ICh3LCB4LCB5LCBocG9zLCB2cG9zLCBjdXJz b3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByZWQsIGdyZWVuLCBibHVlKTsKKyAgICAg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X3BpeGVsID0gb3JpZ192YWw7CisgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIHhfZHJh d19iYXJfY3Vyc29yICh3LCBnbHlwaF9yb3csIGN1cnNvcl93aWR0aCwgQkFSX0NVUlNPUik7Cisg ICAgYnJlYWs7CisgIH0KKyAgY2FzZSBIQkFSX0NVUlNPUjoKKyAgeworICAgIGlmIChyZWQgPj0g MCAmJiBibHVlID49IDAgJiYgZ3JlZW4gPj0gMCkKKyAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFj ayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICB7CisgICAgICAg IHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7CisgICAgICAgIHN0 cnVjdCB4X2Rpc3BsYXlfaW5mbyAqZHB5aW5mbyA9IEZSQU1FX0RJU1BMQVlfSU5GTyAoZik7Cisg ICAgICAgIHVuc2lnbmVkIGxvbmcgb3JpZ192YWwgPSBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3Jf cGl4ZWw7CisgICAgICAgIGludCBpbnRfcmVkID0gcmVkICogNjU1MzU7CisgICAgICAgIGludCBp bnRfZ3JlZW4gPSBncmVlbiAqIDY1NTM1OworICAgICAgICBpbnQgaW50X2JsdWUgPSBibHVlICog NjU1MzU7CisgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IHhfbWFrZV90 cnVlY29sb3JfcGl4ZWwgKGRweWluZm8sIGludF9yZWQsIGludF9ncmVlbiwgaW50X2JsdWUpOwor ICAgICAgICB4X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEhC QVJfQ1VSU09SKTsKKyAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3Jp Z192YWw7CisgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIHhfZHJhd19iYXJfY3Vyc29yICh3 LCBnbHlwaF9yb3csIGN1cnNvcl93aWR0aCwgSEJBUl9DVVJTT1IpOworICAgIGJyZWFrOworICB9 CisgIGNhc2UgTk9fQ1VSU09SOgorICAgIHctPnBoeXNfY3Vyc29yX3dpZHRoID0gMDsKKyAgICBi cmVhazsKKyAgZGVmYXVsdDoKKyAgICBlbWFjc19hYm9ydCAoKTsKKyAgfQogCX0KIAogI2lmZGVm IEhBVkVfWF9JMThOCg== --Multipart_Mon_Mar_14_15:38:53_2016-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: Can we support multiple Cursors? References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Wed, 16 Mar 2016 08:01:01 +0000 Resent-Message-ID: <handler.22873.B22873.145811525223544 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22873 <at> debbugs.gnu.org Cc: John Wiegley <jwiegley@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>, Marcin Borkowski <mbork@HIDDEN>, Richard Stallman <rms@HIDDEN> Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.145811525223544 (code B ref 22873); Wed, 16 Mar 2016 08:01:01 +0000 Received: (at 22873) by debbugs.gnu.org; 16 Mar 2016 08:00:52 +0000 Received: from localhost ([127.0.0.1]:49680 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ag6Nw-00067g-GT for submit <at> debbugs.gnu.org; Wed, 16 Mar 2016 04:00:52 -0400 Received: from cobb.liquidweb.com ([50.28.13.150]:51430) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1ag6Nu-00067S-9G for 22873 <at> debbugs.gnu.org; Wed, 16 Mar 2016 04:00:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date; bh=I89/gqf0/MHHZfPrgP4k7SUP2sPPaZlGmWa/Xg0Mldw=; b=CNp/DBw9RBmDOKn0as2Qm/0ZscGJR86/hS3yRq41zJ1ClXq6MBomFB9e4r32s/p9aQkHAk/KawSBbU2h7eTbRyDLuuQy1uvTnkkXAPySG4fqDaxxCc4K+b7d4VWYLCX2; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:53766 helo=server.private.localhost) by cobb.liquidweb.com with esmtp (Exim 4.82) (envelope-from <esq@HIDDEN>) id 1ag6Nm-0001AZ-El; Wed, 16 Mar 2016 04:00:42 -0400 Date: Wed, 16 Mar 2016 01:00:41 -0700 Message-ID: <m24mc66edy.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 (generated by - "") Content-Type: multipart/mixed; boundary="Multipart_Wed_Mar_16_01:00:38_2016-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cobb.liquidweb.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-Get-Message-Sender-Via: cobb.liquidweb.com: acl_c_relayhosts_text_entry: lawlist|lawlist.com X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.7 (/) --Multipart_Wed_Mar_16_01:00:38_2016-1 Content-Type: text/plain; charset=US-ASCII This fifth draft patch `multiple_cursors_005.diff` fixes the problem mentioned in my last email with the FILLED_BOX_CURSOR (a fake cursor) sometimes taking on the background color of the primary active cursor. I see that the fake cursors do not always appear immediately in Emacs for Windows after pressing the F1 key to trigger the Lisp function `mc-test` -- i.e., there is a delay before the screen updates, so that will be one of my next projects to debug. I didn't update the master branch tonight, so the patch applies as of the March 13, 2016 commit bearing "181e92c4e060a7ce4740b561375f9ec9f473f144". (defun mc-test (&optional list) "Draw fake cursors at all POS defined in the `mc-list'. Multiple fake cursors are supported by GUI versions of Emacs built for X, Windows and OSX. Color vector is LSL (The Linden Scripting Language), rather than standard RGB. `nsterm.m' uses `NSColor', which works well with LSL. `w32term.c' uses `PALETTERGB' or `RGB', and the conversion from LSL is done internally by multiplying each element of the LSL color vector by 255. `xterm.c' uses `x_make_truecolor_pixel', which uses 16-bit RGB -- the conversion from LSL happens internally by multiplying each element of the LSL color vector by 65535." (interactive) (setq mc-list (if list list '( (3 "hbar" [1.0 0.0 0.0]) (4 "bar" [0.0 1.0 0.0]) (5 "box" [0.0 0.0 1.0]) (6 "hollow" [0.8 0.4 0.2]) (7 ("hbar" 3) [1.0 0.0 1.0]) (8 ("bar" 3) [0.0 1.0 1.0]))))) (global-set-key [f1] 'mc-test) --Multipart_Wed_Mar_16_01:00:38_2016-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="multiple_cursors_005.diff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4X2RyYXdfaG9sbG93X2N1cnNvciAodywg Z2x5cGhfcm93KTsKKyAgICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVs ID0gb3JpZ192YWw7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHhf ZHJhd19ob2xsb3dfY3Vyc29yICh3LCBnbHlwaF9yb3cpOworICAgICAgICBicmVhazsKKyAgICAg IH0KKyAgICAgIGNhc2UgRklMTEVEX0JPWF9DVVJTT1I6CisgICAgICB7CisgICAgICAgIC8qIFRP RE86ICBrZGIgdG8gY29uc2lkZXIgYWRkaW5nIHN1cHBvcnQgZm9yIG11bHRpcGxlIGN1cnNvciBm b3JlZ3JvdW5kCisgICAgICAgIGN1c3RvbWl6YXRpb24gb2YgYSBGSUxMRURfQk9YX0NVUlNPUi4g ICovCisgICAgICAgIGlmIChyZWQgPj0gMCAmJiBibHVlID49IDAgJiYgZ3JlZW4gPj0gMCkKKyAg ICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29y X2djJyBieSBib3Jyb3dpbmcgdGhlCisgICAgICAgICAgZnVuY3Rpb25hbGl0eSBvZiBgeF9tYWtl X2djJyBpbiB3MzJmbnMuYy4gICovCisgICAgICAgICAgeworICAgICAgICAgICAgYmxvY2tfaW5w dXQgKCk7CisgICAgICAgICAgICBMaXNwX09iamVjdCB3aW5kb3cgPSAoc2VsZWN0ZWRfd2luZG93 KTsKKyAgICAgICAgICAgIHN0cnVjdCB3aW5kb3cgKncgPSBkZWNvZGVfbGl2ZV93aW5kb3cgKHdp bmRvdyk7CisgICAgICAgICAgICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFN RSAodykpOworICAgICAgICAgICAgaW50IGludF9yZWQgPSByZWQgKiAyNTU7CisgICAgICAgICAg ICBpbnQgaW50X2dyZWVuID0gZ3JlZW4gKiAyNTU7CisgICAgICAgICAgICBpbnQgaW50X2JsdWUg PSBibHVlICogMjU1OworICAgICAgICAgICAgWEdDVmFsdWVzIGdjX3ZhbHVlczsKKyAgICAgICAg ICAgIHVuc2lnbmVkIGxvbmcgbWFzayA9IEdDRm9udCB8IEdDRm9yZWdyb3VuZCB8IEdDQmFja2dy b3VuZDsKKyAgICAgICAgICAgIENPTE9SUkVGIG9yaWdfdmFsX2EgPSBGUkFNRV9CQUNLR1JPVU5E X1BJWEVMIChmKTsKKyAgICAgICAgICAgIENPTE9SUkVGIG9yaWdfdmFsX2IgPSBmLT5vdXRwdXRf ZGF0YS53MzItPmN1cnNvcl9waXhlbDsKKyAgICAgICAgICAgIGdjX3ZhbHVlcy5mb250ID0gRlJB TUVfRk9OVCAoZik7CisgICAgICAgICAgICBnY192YWx1ZXMuZm9yZWdyb3VuZCA9IEZSQU1FX0JB Q0tHUk9VTkRfUElYRUwgKGYpOworICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBQ QUxFVFRFUkdCIChpbnRfcmVkLCBpbnRfZ3JlZW4sIGludF9ibHVlKTsKKyAgICAgICAgICAgIGYt Pm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djCisgICAgICAgICAgICAgID0gWENyZWF0ZUdDIChO VUxMLCBGUkFNRV9XMzJfV0lORE9XIChmKSwgbWFzaywgJmdjX3ZhbHVlcyk7CisgICAgICAgICAg ICAvKiBXaGVuIGB3LT5tY19zZXRfY3Vyc29yX2djID0gdHJ1ZScsIGZvcmNlIGB4X3NldF9jdXJz b3JfZ2MnIHRvCisgICAgICAgICAgICB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29y X2djJy4gICovCisgICAgICAgICAgICB3LT5tY19zZXRfY3Vyc29yX2djID0gdHJ1ZTsKKyAgICAg ICAgICAgIGRyYXdfcGh5c19jdXJzb3JfZ2x5cGggKHcsIGdseXBoX3JvdywgRFJBV19DVVJTT1Ip OworICAgICAgICAgICAgdy0+bWNfc2V0X2N1cnNvcl9nYyA9IGZhbHNlOworICAgICAgICAgICAg Z2NfdmFsdWVzLmZvbnQgPSBGUkFNRV9GT05UIChmKTsKKyAgICAgICAgICAgIGdjX3ZhbHVlcy5m b3JlZ3JvdW5kID0gb3JpZ192YWxfYTsKKyAgICAgICAgICAgIGdjX3ZhbHVlcy5iYWNrZ3JvdW5k ID0gb3JpZ192YWxfYjsKKyAgICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2dj CisgICAgICAgICAgICAgID0gWENyZWF0ZUdDIChOVUxMLCBGUkFNRV9XMzJfV0lORE9XIChmKSwg bWFzaywgJmdjX3ZhbHVlcyk7CisgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAg ICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICBkcmF3X3BoeXNfY3Vyc29yX2dseXBo ICh3LCBnbHlwaF9yb3csIERSQVdfQ1VSU09SKTsKKyAgICAgICAgYnJlYWs7CisgICAgICB9Cisg ICAgICBjYXNlIEJBUl9DVVJTT1I6CisgICAgICB7CisgICAgICAgIGlmIChyZWQgPj0gMCAmJiBi bHVlID49IDAgJiYgZ3JlZW4gPj0gMCkKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sg YGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgICAgeworICAg ICAgICAgICAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAg ICAgICAgICAgIENPTE9SUkVGIG9yaWdfdmFsID0gZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3Jf cGl4ZWw7CisgICAgICAgICAgICBpbnQgaW50X3JlZCA9IHJlZCAqIDI1NTsKKyAgICAgICAgICAg IGludCBpbnRfZ3JlZW4gPSBncmVlbiAqIDI1NTsKKyAgICAgICAgICAgIGludCBpbnRfYmx1ZSA9 IGJsdWUgKiAyNTU7CisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhl bCA9IFBBTEVUVEVSR0IgKGludF9yZWQsIGludF9ncmVlbiwgaW50X2JsdWUpOworICAgICAgICAg ICAgeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIGdseXBoX3JvdywgY3Vyc29yX3dpZHRoLCBCQVJfQ1VS U09SKTsKKyAgICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3Jp Z192YWw7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHhfZHJhd19i YXJfY3Vyc29yICh3LCBnbHlwaF9yb3csIGN1cnNvcl93aWR0aCwgQkFSX0NVUlNPUik7CisgICAg ICAgIGJyZWFrOworICAgICAgfQorICAgICAgY2FzZSBIQkFSX0NVUlNPUjoKKyAgICAgIHsKKyAg ICAgICAgaWYgKHJlZCA+PSAwICYmIGJsdWUgPj0gMCAmJiBncmVlbiA+PSAwKQorICAgICAgICAg IC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwn LiAgKi8KKyAgICAgICAgICB7CisgICAgICAgICAgICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUg KFdJTkRPV19GUkFNRSAodykpOworICAgICAgICAgICAgQ09MT1JSRUYgb3JpZ192YWwgPSBmLT5v dXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbDsKKyAgICAgICAgICAgIGludCBpbnRfcmVkID0g cmVkICogMjU1OworICAgICAgICAgICAgaW50IGludF9ncmVlbiA9IGdyZWVuICogMjU1OworICAg ICAgICAgICAgaW50IGludF9ibHVlID0gYmx1ZSAqIDI1NTsKKyAgICAgICAgICAgIGYtPm91dHB1 dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gUEFMRVRURVJHQiAoaW50X3JlZCwgaW50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gIGlmICh3LT5oc2Nyb2xsKQorICAgICAgICB7 CisgICAgICAgICAgLyogV2hlbiB0aGUgd2luZG93IGlzIGhzY3JvbGxlZCwgY3Vyc29yIGhwb3Mg Y2FuIGxlZ2l0aW1hdGVseSBiZQorICAgICAgICAgICBvdXQgb2YgYm91bmRzLCBidXQgd2UgZHJh dyB0aGUgY3Vyc29yIGF0IHRoZSBjb3JyZXNwb25kaW5nCisgICAgICAgICAgIHdpbmRvdyBtYXJn aW4gaW4gdGhhdCBjYXNlLiAgKi8KKyAgICAgICAgICBpZiAoIWN1cnNvcl9yb3ctPnJldmVyc2Vk X3AgJiYgaHBvcyA8IDApCisgICAgICAgICAgICBocG9zID0gMDsKKyAgICAgICAgICBpZiAoY3Vy c29yX3Jvdy0+cmV2ZXJzZWRfcCAmJiBocG9zID49IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVB XSkKKyAgICAgICAgICAgIGhwb3MgPSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxOwor ICAgICAgICB9CisgICAgICBpZiAoMCA8PSBocG9zICYmIGhwb3MgPCBjdXJzb3Jfcm93LT51c2Vk W1RFWFRfQVJFQV0pCisgICAgICAgIGN1cnNvcl9nbHlwaCA9IGN1cnNvcl9yb3ctPmdseXBoc1tU RVhUX0FSRUFdICsgaHBvczsKKyAgICAgIGVsc2UKKyAgICAgICAgY3Vyc29yX2dseXBoID0gTlVM TDsKKyAgICAgIGlmIChjdXJzb3JfZ2x5cGggPT0gTlVMTCkKKyAgICAgICAgZ290byBkb25lOwor ICAgICAgd2lkdGggPSBjdXJzb3JfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgaG9sbG93X3gg PSB4OworICAgICAgaWYgKHggPCAwKQorICAgICAgICB7CisgICAgICAgICAgd2lkdGggKz0gaG9s bG93X3g7CisgICAgICAgICAgaG9sbG93X3ggPSAwOworICAgICAgICB9CisgICAgICB3aWR0aCA9 IG1pbiAod2lkdGgsIHdpbmR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iYgaHBvcyA8IDApCisg ICAgICAgIGhwb3MgPSAwOworICAgICAgaWYgKGN1cnNvcl9yb3ctPnJldmVyc2VkX3AgJiYgaHBv cyA+PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgIGhwb3MgPSBjdXJzb3Jf cm93LT51c2VkW1RFWFRfQVJFQV0gLSAxOworICAgICAgeDEgPSBkcmF3X2dseXBocyAodywgeCwg Y3Vyc29yX3JvdywgVEVYVF9BUkVBLCBocG9zLCBocG9zICsgMSwgRFJBV19OT1JNQUxfVEVYVCwg MCk7CisgICAgICBpZiAoY3Vyc29yX3Jvdy0+b3ZlcmxhcHBlZF9wKQorICAgICAgICB7CisgICAg ICAgICAgdy0+cGh5c19jdXJzb3Jfd2lkdGggPSB4MSAtIHg7CisgICAgICAgICAgaWYgKGN1cnNv cl9yb3cgPiB3LT5jdXJyZW50X21hdHJpeC0+cm93cworICAgICAgICAgICAgICAmJiBNQVRSSVhf Uk9XX09WRVJMQVBTX1NVQ0NfUCAoY3Vyc29yX3JvdyAtIDEpKQorICAgICAgICAgICAgeF9maXhf b3ZlcmxhcHBpbmdfYXJlYSAodywgY3Vyc29yX3JvdyAtIDEsIFRFWFRfQVJFQSwgT1ZFUkxBUFNf RVJBU0VEX0NVUlNPUik7CisgICAgICAgICAgaWYgKE1BVFJJWF9ST1dfQk9UVE9NX1kgKGN1cnNv cl9yb3cpIDwgd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICYmIE1BVFJJ WF9ST1dfT1ZFUkxBUFNfUFJFRF9QIChjdXJzb3Jfcm93ICsgMSkpCisgICAgICAgICAgICB4X2Zp eF9vdmVybGFwcGluZ19hcmVhICh3LCBjdXJzb3Jfcm93ICsgMSwgVEVYVF9BUkVBLCBPVkVSTEFQ U19FUkFTRURfQ1VSU09SKTsKKyAgICAgICAgfQorICAgIH0KKyAgZG9uZToKKyAgICBRbmlsOwor fQorCit2b2lkCittY19kcmF3IChzd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y0+cGh5c19jdXJzb3IueC95L2hwb3Mv dnBvcy4gICovCisgIHByaW9yX2hwb3MgPSB3LT5waHlzX2N1cnNvci5ocG9zOworICBwcmlvcl92 cG9zID0gdy0+cGh5c19jdXJzb3IudnBvczsKKyAgcHJpb3JfeCA9IHctPnBoeXNfY3Vyc29yLng7 CisgIHByaW9yX3kgPSB3LT5waHlzX2N1cnNvci55OworICAvKiBIaWphY2sgdy0+cGh5c19jdXJz b3IueC95L2hwb3MvdnBvcyBieSBzZXR0aW5nIG5ldyB2YWx1ZXMuICAqLworICB3LT5waHlzX2N1 cnNvci5ocG9zID0gaHBvczsKKyAgdy0+cGh5c19jdXJzb3IudnBvcyA9IHZwb3M7CisgIHctPnBo eXNfY3Vyc29yLnggPSB4OworICB3LT5waHlzX2N1cnNvci55ID0gZ2x5cGhfcm93LT55OworICBG UkFNRV9SSUYgKGYpLT5kcmF3X3dpbmRvd19jdXJzb3IgKHcsIGdseXBoX3JvdywgeCwgeSwgY3Vy c29yX3R5cGUsIGN1cnNvcl93aWR0aCwgMSwgMCwgcmVkLCBncmVlbiwgYmx1ZSk7CisgIC8qIFJl c3RvcmUgdGhlIHByZXZpb3VzIHZhbHVlcyBmb3Igdy0+cGh5c19jdXJzb3IueC95L2hwb3MvdnBv cy4gICovCisgIHctPnBoeXNfY3Vyc29yLmhwb3MgPSBwcmlvcl9ocG9zOworICB3LT5waHlzX2N1 cnNvci52cG9zID0gcHJpb3JfdnBvczsKKyAgdy0+cGh5c19jdXJzb3IueCA9IHByaW9yX3g7Cisg IHctPnBoeXNfY3Vyc29yLnkgPSBwcmlvcl95OworfQorCitMaXNwX09iamVjdAorbWNfeF95X2hw b3NfdnBvcyAoc3RydWN0IHdpbmRvdyAqdywgRU1BQ1NfSU5UIHBvc2ludCkKK3sKKyAgc3RydWN0 IGl0IGl0OworICB2b2lkICppdGRhdGEgPSBiaWRpX3NoZWx2ZV9jYWNoZSAoKTsKKyAgc3RydWN0 IHRleHRfcG9zIHB0LCBwb3M7CisgIGludCB4LCB5LCBocG9zLCB2cG9zOworICBpZiAody0+bWNf d2luZG93X3N0YXJ0CisgICAgICAmJiB3LT5tY193aW5kb3dfZW5kCisgICAgICAmJiBwb3NpbnQg Pj0gdy0+bWNfd2luZG93X3N0YXJ0CisgICAgICAmJiBwb3NpbnQgPD0gdy0+bWNfd2luZG93X2Vu ZCkKKyAgICB7CisgICAgICBTRVRfVEVYVF9QT1NfRlJPTV9NQVJLRVIgKHB0LCB3LT5zdGFydCk7 CisgICAgICBzdGFydF9kaXNwbGF5ICgmaXQsIHcsIHB0KTsKKyAgICAgIG1vdmVfaXRfdG8gKCZp dCwgcG9zaW50LCAtMSwgLTEsIC0xLCBNT1ZFX1RPX1BPUyk7CisgICAgICBwb3MgPSBpdC5jdXJy ZW50LnBvczsKKyAgICAgIHggPSBpdC5jdXJyZW50X3g7CisgICAgICB5ID0gaXQuY3VycmVudF95 OworICAgICAgaHBvcyA9IGl0Lmhwb3M7CisgICAgICB2cG9zID0gaXQudnBvczsKKyAgICAgIGJp ZGlfdW5zaGVsdmVfY2FjaGUgKGl0ZGF0YSwgZmFsc2UpOworICAgIH0KKyAgICBlbHNlCisgICAg ICB7CisgICAgICAgIHggPSAtMTsKKyAgICAgICAgeSA9IC0xOworICAgICAgICBocG9zID0gLTE7 CisgICAgICAgIHZwb3MgPSAtMTsKKyAgICAgIH0KKyAgcmV0dXJuIGxpc3RuIChDT05TVFlQRV9Q VVJFLCA0LCBtYWtlX251bWJlciAoeCksIG1ha2VfbnVtYmVyICh5KSwgbWFrZV9udW1iZXIgKGhw b3MpLCBtYWtlX251bWJlciAodnBvcykpOworfQorCitpbnQKK21jX2xpc3BfdG9fY3Vyc29yX3R5 cGUgKExpc3BfT2JqZWN0IGFyZykKK3sKKyAgY2hhciAqc3RyOworICBpZiAoWFRZUEUgKGFyZykg PT0gTGlzcF9TdHJpbmcpCisgICAgc3RyID0gU1NEQVRBIChhcmcpOworICBlbHNlIGlmIChYVFlQ RSAoYXJnKSA9PSBMaXNwX1N5bWJvbCkKKyAgICBzdHIgPSBTU0RBVEEgKFNZTUJPTF9OQU1FIChh cmcpKTsKKyAgZWxzZSByZXR1cm4gLTE7CisgIGlmICghc3RyY21wIChzdHIsICJib3giKSkKKyAg ICByZXR1cm4gRklMTEVEX0JPWF9DVVJTT1I7CisgIGlmICghc3RyY21wIChzdHIsICJob2xsb3ci KSkKKyAgICByZXR1cm4gSE9MTE9XX0JPWF9DVVJTT1I7CisgIGlmICghc3RyY21wIChzdHIsICJo YmFyIikpCisgICAgcmV0dXJuIEhCQVJfQ1VSU09SOworICBpZiAoIXN0cmNtcCAoc3RyLCAiYmFy IikpCisgICAgcmV0dXJuIEJBUl9DVVJTT1I7CisgIGlmICghc3RyY21wIChzdHIsICJubyIpKQor ICAgIHJldHVybiBOT19DVVJTT1I7CisgIHJldHVybiAtMTsKK30KKworLyogRVhBTVBMRSAjMToK KyAgICAoc2V0cSBtYy1saXN0ICcoCisgICAgICAoMyAiaGJhciIgWzEuMCAwLjAgMC4wXSkKKyAg ICAgICg0ICJiYXIiIFswLjAgMS4wIDAuMF0pCisgICAgICAoNSAiYm94IiBbMC4wIDAuMCAxLjBd KQorICAgICAgKDYgImhvbGxvdyIgWzAuOCAwLjQgMC4yXSkKKyAgICAgICg3ICgiaGJhciIgMykg WzEuMCAwLjAgMS4wXSkKKyAgICAgICg4ICgiYmFyIiAzKSBbMC4wIDEuMCAxLjBdKSkpCisgICBF WEFNUExFICMyOiAgKHNldHEgbWMtbGlzdCBuaWwpCitUaGUgYG1jX2NhY2hlJyBpcyBrZXB0IGlu IHRoZSBmb2xsb3dpbmcgZXhhbXBsZSBmb3JtYXQ6CisgICgoCisgICAgKDMgaGJhciBbMS4wIDAu MCAwLjBdKQorICAgICg0IGJhciBbMC4wIDEuMCAwLjBdKQorICAgICg1IGJveCBbMC4wIDAuMCAx LjBdKQorICAgICg2IGhvbGxvdyBbMC44IDAuNCAwLjJdKQorICAgICg3IChoYmFyIDMpI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isgICAgICBvbGRfYnVmZmVyID0gY3VycmVudF9idWZmZXI7CisgICAgICBzZXRfYnVm ZmVyX2ludGVybmFsIChiKTsKKyAgICB9CisgIGlmIChGbWluaWJ1ZmZlcnAgKGJ1ZikpCisgICAg Z290byBkb25lOworICBpZiAody0+bWNfY2FjaGUKKyAgICAgICYmIChOSUxQIChGZXF1YWwgKEZu dGggKG1ha2VfbnVtYmVyICgwKSwgdy0+bWNfY2FjaGUpLCBCVkFSIChjdXJyZW50X2J1ZmZlciwg bWNfbGlzdCkpKQorICAgICAgICAgIHx8IHcgIT0gc3cpKQorICAgIHsKKyNpZmRlZiBHTFlQSF9E RUJVRworICBkZWJ1Z19tZXRob2RfYWRkICh3LCAibWNfY2FsYzogIHJlbW92ZSBjdXJzb3JzIHVz aW5nIGNhY2hlIik7CisjZW5kaWYKKyAgICAgIGZvciAodmxpc3QgPSBYQ0FSIChYQ0RSICh3LT5t Y19jYWNoZSkpOworICAgICAgICAgICBDT05TUCAodmxpc3QpOworICAgICAgICAgICB2bGlzdCA9 IFhDRFIgKHZsaXN0KSkKKyAgICAgICAgeworICAgICAgICAgIGN1cnNvcl9zcGVjX2xpc3QgPSBY Q0FSIChYQ0FSICh2bGlzdCkpOworICAgICAgICAgIHBvc2ludCA9IFhJTlQgKEZudGggKG1ha2Vf bnVtYmVyICgwKSwgY3Vyc29yX3NwZWNfbGlzdCkpOworICAgICAgICAgIGN1cnNvcl9zcGVjX3R5 cGUgPSBGbnRoIChtYWtlX251bWJlciAoMSksIGN1cnNvcl9zcGVjX2xpc3QpOworICAgICAgICAg IGlmIChDT05TUCAoY3Vyc29yX3NwZWNfdHlwZSkpCisgICAgICAgICAgICBjdXJzb3JfdHlwZSA9 IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKFhDQVIgKGN1cnNvcl9zcGVjX3R5cGUpKTsKKyAgICAg ICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgY3Vyc29yX3R5cGUgPSBtY19saXNwX3RvX2N1cnNv cl90eXBlIChjdXJzb3Jfc3BlY190eXBlKTsKKyAgICAgICAgICBpZiAoQ09OU1AgKGN1cnNvcl9z cGVjX3R5cGUpKQorICAgICAgICAgICAgY3Vyc29yX3dpZHRoID0gWElOVCAoWENBUiAoWENEUiAo Y3Vyc29yX3NwZWNfdHlwZSkpKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgY3Vy c29yX3dpZHRoID0gMTsKKyAgICAgICAgICBjdXJzb3JfY29sb3JfdmVjdG9yID0gRm50aCAobWFr ZV9udW1iZXIgKDIpLCBjdXJzb3Jfc3BlY19saXN0KTsKKyAgICAgICAgICByZWQgPSBYRkxPQVRf REFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3RvciwgMCkpOworICAgICAgICAgIGdyZWVuID0g WEZMT0FUX0RBVEEgKEFSRUYgKGN1cnNvcl9jb2xvcl92ZWN0b3IsIDEpKTsKKyAgICAgICAgICBi bHVlID0gWEZMT0FUX0RBVEEgKEFSRUYgKGN1cnNvcl9jb2xvcl92ZWN0b3IsIDIpKTsKKyAgICAg ICAgICBpZiAocG9zaW50CisgICAgICAgICAgICAgICYmIHctPm1jX3dpbmRvd19zdGFydAorICAg ICAgICAgICAgICAmJiB3LT5tY193aW5kb3dfZW5kCisgICAgICAgICAgICAgICYmIHBvc2ludCA+ PSB3LT5tY193aW5kb3dfc3RhcnQKKyAgICAgICAgICAgICAgJiYgcG9zaW50IDw9IHctPm1jX3dp bmRvd19lbmQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHhfeV9ocG9zX3Zwb3NfbGlz dCA9IFhDQVIgKFhDRFIgKFhDQVIgKHZsaXN0KSkpOworICAgICAgICAgICAgICB4ID0gWElOVCAo Rm50aCAobWFrZV9udW1iZXIgKDApLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAgICAg ICAgeSA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgxKSwgeF95X2hwb3NfdnBvc19saXN0KSk7 CisgICAgICAgICAgICAgIGhwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMiksIHhfeV9o cG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAgICAgICB2cG9zID0gWElOVCAoRm50aCAobWFrZV9u dW1iZXIgKDMpLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAgbWNfZXJhc2Ug KHcsIHgsIHksIGhwb3MsIHZwb3MsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJlZCwgZ3Jl ZW4sIGJsdWUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICB3LT5tY19jYWNoZSA9 IFFuaWw7CisgICAgfQorICAgIGVsc2UgaWYgKHcgPT0gc3cKKyAgICAgICAgICAgICYmIHctPm1j X3dpbmRvd19zdGFydAorICAgICAgICAgICAgJiYgdy0+bWNfd2luZG93X2VuZAorICAgICAgICAg ICAgJiYgdy0+bWNfcHJldmlvdXNfd2luZG93X3N0YXJ0CisgICAgICAgICAgICAmJiB3LT5tY19w cmV2aW91c193aW5kb3dfZW5kCisgICAgICAgICAgICAmJiB3LT5tY193aW5kb3dfc3RhcnQgPT0g dy0+bWNfcHJldmlvdXNfd2luZG93X3N0YXJ0CisgICAgICAgICAgICAmJiB3LT5tY193aW5kb3df ZW5kID09IHctPm1jX3ByZXZpb3VzX3dpbmRvd19lbmQKKyAgICAgICAgICAgICYmICFOSUxQIChC VkFSIChjdXJyZW50X2J1ZmZlciwgbWNfbGlzdCkpCisgICAgICAgICAgICAmJiB3LT5tY19jYWNo ZQorICAgICAgICAgICAgJiYgIU5JTFAgKEZlcXVhbCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB3 LT5tY19jYWNoZSksIEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBtY19saXN0KSkpKQorICAgICAgewor I2lmZGVmIEdMWVBIX0RFQlVHCisgIGRlYnVnX21ldGhvZF9hZGQgKHcsICJtY19jYWxjOiAgZHJh dyBjdXJzb3JzIHVzaW5nIGNhY2hlIik7CisjZW5kaWYKKyAgICAgICAgZm9yICh2bGlzdCA9IFhD QVIgKFhDRFIgKHctPm1jX2NhY2hlKSk7CisgICAgICAgICAgICAgQ09OU1AgKHZsaXN0KTsKKyAg ICAgICAgICAgICB2bGlzdCA9IFhDRFIgKHZsaXN0KSkKKyAgICAgICAgICB7CisgICAgICAgICAg ICBjdXJzb3Jfc3BlY19saXN0ID0gWENBUiAoWENBUiAodmxpc3QpKTsKKyAgICAgICAgICAgIHBv c2ludCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgwKSwgY3Vyc29yX3NwZWNfbGlzdCkpOwor ICAgICAgICAgICAgY3Vyc29yX3NwZWNfdHlwZSA9IEZudGggKG1ha2VfbnVtYmVyICgxKSwgY3Vy c29yX3NwZWNfbGlzdCk7CisgICAgICAgICAgICBpZiAoQ09OU1AgKGN1cnNvcl9zcGVjX3R5cGUp KQorICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKFhD QVIgKGN1cnNvcl9zcGVjX3R5cGUpKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoY3Vyc29yX3NwZWNfdHlw ZSk7CisgICAgICAgICAgICBpZiAoQ09OU1AgKGN1cnNvcl9zcGVjX3R5cGUpKQorICAgICAgICAg ICAgICBjdXJzb3Jfd2lkdGggPSBYSU5UIChYQ0FSIChYQ0RSIChjdXJzb3Jfc3BlY190eXBlKSkp OworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoID0gMTsK KyAgICAgICAgICAgIGN1cnNvcl9jb2xvcl92ZWN0b3IgPSBGbnRoIChtYWtlX251bWJlciAoMiks IGN1cnNvcl9zcGVjX2xpc3QpOworICAgICAgICAgICAgcmVkID0gWEZMT0FUX0RBVEEgKEFSRUYg KGN1cnNvcl9jb2xvcl92ZWN0b3IsIDApKTsKKyAgICAgICAgICAgIGdyZWVuID0gWEZMT0FUX0RB VEEgKEFSRUYgKGN1cnNvcl9jb2xvcl92ZWN0b3IsIDEpKTsKKyAgICAgICAgICAgIGJsdWUgPSBY RkxPQVRfREFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3RvciwgMikpOworICAgICAgICAgICAg aWYgKHBvc2ludAorICAgICAgICAgICAgICAgICYmIHctPm1jX3dpbmRvd19zdGFydAorICAgICAg ICAgICAgICAgICYmIHctPm1jX3dpbmRvd19lbmQKKyAgICAgICAgICAgICAgICAmJiBwb3NpbnQg Pj0gdy0+bWNfd2luZG93X3N0YXJ0CisgICAgICAgICAgICAgICAgJiYgcG9zaW50IDw9IHctPm1j X3dpbmRvd19lbmQpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB4X3lfaHBvc192 cG9zX2xpc3QgPSBYQ0FSIChYQ0RSIChYQ0FSICh2bGlzdCkpKTsKKyAgICAgICAgICAgICAgICB4 ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAg ICAgICAgICAgICAgICB5ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB4X3lfaHBvc192 cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAgICBocG9zID0gWElOVCAoRm50aCAobWFrZV9udW1i ZXIgKDIpLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAgICB2cG9zID0gWElO VCAoRm50aCAobWFrZV9udW1iZXIgKDMpLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAg ICAgICAgICBtY19kcmF3ICh3LCB4LCB5LCBocG9zLCB2cG9zLCBjdXJzb3JfdHlwZSwgY3Vyc29y X3dpZHRoLCByZWQsIGdyZWVuLCBibHVlKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0K KyAgICAgIH0KKyAgICAgIGVsc2UgaWYgKHcgPT0gc3cKKyAgICAgICAgICAgICAgICYmICFOSUxQ IChCVkFSIChjdXJyZW50X2J1ZmZlciwgbWNfbGlzdCkpKQorICAgICAgICB7CisjaWZkZWYgR0xZ UEhfREVCVUcKKyAgZGVidWdfbWV0aG9kX2FkZCAodywgIm1jX2NhbGM6ICBkcmF3IGN1cnNvcnMg YW5ldyIpOworI2VuZGlmCisgICAgICAgICAgLyogRXJhc2UgYWxsIG9mIHRoZSBvbGQgY3Vyc29y cyBhdCB0aGUgcHJldmlvdXNseSByZWNvcmRlZCB4L3kvaHBvcy92cG9zIGV2ZW4KKyAgICAgICAg ICB0aG91Z2ggdGhlIGNvcnJlc3BvbmRpbmcgYHBvc2ludCcgaGFzIGNoYW5nZWQuICAqLworICAg ICAgICAgIGlmICh3LT5tY19jYWNoZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgZm9y ICh2bGlzdCA9IFhDQVIgKFhDRFIgKHctPm1jX2NhY2hlKSk7CisgICAgICAgICAgICAgICAgICAg Q09OU1AgKHZsaXN0KTsKKyAgICAgICAgICAgICAgICAgICB2bGlzdCA9IFhDRFIgKHZsaXN0KSkK KyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBjdXJzb3Jfc3BlY19saXN0ID0g WENBUiAoWENBUiAodmxpc3QpKTsKKyAgICAgICAgICAgICAgICAgIHBvc2ludCA9IFhJTlQgKEZu dGggKG1ha2VfbnVtYmVyICgwKSwgY3Vyc29yX3NwZWNfbGlzdCkpOworICAgICAgICAgICAgICAg ICAgY3Vyc29yX3NwZWNfdHlwZSA9IEZudGggKG1ha2VfbnVtYmVyICgxKSwgY3Vyc29yX3NwZWNf bGlzdCk7CisgICAgICAgICAgICAgICAgICBpZiAoQ09OU1AgKGN1cnNvcl9zcGVjX3R5cGUpKQor ICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUg KFhDQVIgKGN1cnNvcl9zcGVjX3R5cGUpKTsKKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAo Y3Vyc29yX3NwZWNfdHlwZSk7CisgICAgICAgICAgICAgICAgICBpZiAoQ09OU1AgKGN1cnNvcl9z cGVjX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSBYSU5UIChYQ0FS IChYQ0RSIChjdXJzb3Jfc3BlY190eXBlKSkpOworICAgICAgICAgICAgICAgICAgICBlbHNlCisg ICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoID0gMTsKKyAgICAgICAgICAgICAgICAg IGN1cnNvcl9jb2xvcl92ZWN0b3IgPSBGbnRoIChtYWtlX251bWJlciAoMiksIGN1cnNvcl9zcGVj X2xpc3QpOworICAgICAgICAgICAgICAgICAgcmVkID0gWEZMT0FUX0RBVEEgKEFSRUYgKGN1cnNv cl9jb2xvcl92ZWN0b3IsIDApKTsKKyAgICAgICAgICAgICAgICAgIGdyZWVuID0gWEZMT0FUX0RB VEEgKEFSRUYgKGN1cnNvcl9jb2xvcl92ZWN0b3IsIDEpKTsKKyAgICAgICAgICAgICAgICAgIGJs dWUgPSBYRkxPQVRfREFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3RvciwgMikpOworICAgICAg ICAgICAgICAgICAgeF95X2hwb3NfdnBvc19saXN0ID0gWENBUiAoWENEUiAoWENBUiAodmxpc3Qp KSk7CisgICAgICAgICAgICAgICAgICB4ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB4 X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAgICAgIHkgPSBYSU5UIChGbnRoICht YWtlX251bWJlciAoMSksIHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAgICAgICAgICAg aHBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgeF95X2hwb3NfdnBvc19saXN0KSk7 CisgICAgICAgICAgICAgICAgICB2cG9zID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDMpLCB4 X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAgICAgIG1jX2VyYXNlICh3LCB4LCB5 LCBocG9zLCB2cG9zLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByZWQsIGdyZWVuLCBibHVl KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIHctPm1jX2NhY2hlID0gUW5pbDsK KyAgICAgICAgICAgIH0KKyAgICAgICAgICBmb3IgKHZsaXN0ID0gQlZBUiAoY3VycmVudF9idWZm ZXIsIG1jX2xpc3QpOworICAgICAgICAgICAgICAgQ09OU1AgKHZsaXN0KTsKKyAgICAgICAgICAg ICAgIHZsaXN0ID0gWENEUiAodmxpc3QpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBj dXJzb3Jfc3BlY19saXN0ID0gWENBUiAodmxpc3QpOworICAgICAgICAgICAgICBwb3NpbnQgPSBY SU5UIChGbnRoIChtYWtlX251bWJlciAoMCksIGN1cnNvcl9zcGVjX2xpc3QpKTsKKyAgICAgICAg ICAgICAgY3Vyc29yX3NwZWNfdHlwZSA9IEZudGggKG1ha2VfbnVtYmVyICgxKSwgY3Vyc29yX3Nw ZWNfbGlzdCk7CisgICAgICAgICAgICAgIGlmIChDT05TUCAoY3Vyc29yX3NwZWNfdHlwZSkpCisg ICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUgPSBtY19saXNwX3RvX2N1cnNvcl90eXBlIChYQ0FS IChjdXJzb3Jfc3BlY190eXBlKSk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICAgICAgY3Vyc29yX3R5cGUgPSBtY19saXNwX3RvX2N1cnNvcl90eXBlIChjdXJzb3Jfc3BlY190 eXBlKTsKKyAgICAgICAgICAgICAgaWYgKENPTlNQIChjdXJzb3Jfc3BlY190eXBlKSkKKyAgICAg ICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSBYSU5UIChYQ0FSIChYQ0RSIChjdXJzb3Jfc3BlY190 eXBlKSkpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIGN1cnNvcl93 aWR0aCA9IDE7CisgICAgICAgICAgICAgIGN1cnNvcl9jb2xvcl92ZWN0b3IgPSBGbnRoIChtYWtl X251bWJlciAoMiksIGN1cnNvcl9zcGVjX2xpc3QpOworICAgICAgICAgICAgICByZWQgPSBYRkxP QVRfREFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3RvciwgMCkpOworICAgICAgICAgICAgICBn cmVlbiA9IFhGTE9BVF9EQVRBIChBUkVGIChjdXJzb3JfY29sb3JfdmVjdG9yLCAxKSk7CisgICAg ICAgICAgICAgIGJsdWUgPSBYRkxPQVRfREFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3Rvciwg MikpOworICAgICAgICAgICAgICBpZiAocG9zaW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgIHhfeV9ocG9zX3Zwb3NfbGlzdCA9IG1jX3hfeV9ocG9zX3Zwb3MgKHcsIHBv c2ludCk7CisgICAgICAgICAgICAgICAgICB0ZW1wID0gRmNvbnMgKGN1cnNvcl9zcGVjX2xpc3Qs IEZjb25zICh4X3lfaHBvc192cG9zX2xpc3QsIFFuaWwpKTsKKyAgICAgICAgICAgICAgICAgIHJl c3VsdCA9IEZjb25zICh0ZW1wLCByZXN1bHQpOworICAgICAgICAgICAgICAgICAgeCA9IFhJTlQg KEZudGggKG1ha2VfbnVtYmVyICgwKSwgeF95X2hwb3NfdnBvc19saXN0KSk7CisgICAgICAgICAg ICAgICAgICB5ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB4X3lfaHBvc192cG9zX2xp c3QpKTsKKyAgICAgICAgICAgICAgICAgIGhwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAo MiksIHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAgICAgICAgICAgdnBvcyA9IFhJTlQg KEZudGggKG1ha2VfbnVtYmVyICgzKSwgeF95X2hwb3NfdnBvc19saXN0KSk7CisgICAgICAgICAg ICAgICAgICBpZiAody0+bWNfd2luZG93X3N0YXJ0CisgICAgICAgICAgICAgICAgICAgICAgJiYg dy0+bWNfd2luZG93X2VuZAorICAgICAgICAgICAgICAgICAgICAgICYmIHBvc2ludCA+PSB3LT5t Y193aW5kb3dfc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgICAmJiBwb3NpbnQgPD0gdy0+bWNf d2luZG93X2VuZCkKKyAgICAgICAgICAgICAgICAgICAgbWNfZHJhdyAodywgeCwgeSwgaHBvcywg dnBvcywgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcmVkLCBncmVlbiwgYmx1ZSk7CisgICAg ICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgIGlmIChyZXN1bHQpCisgICAg ICAgICAgICB3LT5tY19jYWNoZSA9IEZjb25zIChCVkFSIChjdXJyZW50X2J1ZmZlciwgbWNfbGlz dCksIEZjb25zIChGcmV2ZXJzZSAocmVzdWx0KSwgUW5pbCkpOworICAgICAgICB9CisgIGRvbmU6 CisgIGlmIChvbGRfYnVmZmVyKQorICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIp OworfQogCiAvKiBEaXNwbGF5IG9yIGNsZWFyIGN1cnNvciBvZiB3aW5kb3cgVy4gIElmICFPTiwg Y2xlYXIgdGhlIGN1cnNvci4KICAgIElmIE9OLCBkaXNwbGF5IHRoZSBjdXJzb3I7IHdoZXJlIHRv IHB1dCB0aGUgY3Vyc29yIGlzIHNwZWNpZmllZCBieQpAQCAtMjgzMzAsNiArMjg3NDAsMTQgQEAg ZGlzcGxheV9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AgICAgIGludCBpbnRfZ3JlZW4gPSBncmVlbiAqIDY1NTM1 OworICAgICAgICBpbnQgaW50X2JsdWUgPSBibHVlICogNjU1MzU7CisgICAgICAgIGYtPm91dHB1 dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IHhfbWFrZV90cnVlY29sb3JfcGl4ZWwgKGRweWluZm8s IGludF9yZWQsIGludF9ncmVlbiwgaW50X2JsdWUpOworICAgICAgICB4X2RyYXdfaG9sbG93X2N1 cnNvciAodywgZ2x5cGhfcm93KTsKKyAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3Bp eGVsID0gb3JpZ192YWw7CisgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIHhfZHJhd19ob2xs b3dfY3Vyc29yICh3LCBnbHlwaF9yb3cpOworICAgIGJyZWFrOworICB9CisgIGNhc2UgRklMTEVE X0JPWF9DVVJTT1I6CisgIHsKKyAgICAgLyogVE9ETzogIGtkYiB0byBjb25zaWRlciBhZGRpbmcg c3VwcG9ydCBmb3IgbXVsdGlwbGUgY3Vyc29yIGZvcmVncm91bmQKKyAgICAgY3VzdG9taXphdGlv biBvZiBhIEZJTExFRF9CT1hfQ1VSU09SLiAgKi8KKyAgICBpZiAocmVkID49IDAgJiYgYmx1ZSA+ PSAwICYmIGdyZWVuID49IDApCisgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1 dF9kYXRhLngtPmN1cnNvcl9nYycgYnkgYm9ycm93aW5nIHRoZQorICAgICAgZnVuY3Rpb25hbGl0 eSBvZiBgeF9tYWtlX2djJyBpbiB4Zm5zLmMuICAqLworICAgICAgeworICAgICAgICBibG9ja19p bnB1dCAoKTsKKyAgICAgICAgTGlzcF9PYmplY3Qgd2luZG93ID0gKHNlbGVjdGVkX3dpbmRvdyk7 CisgICAgICAgIHN0cnVjdCB3aW5kb3cgKncgPSBkZWNvZGVfbGl2ZV93aW5kb3cgKHdpbmRvdyk7 CisgICAgICAgIHN0cnV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HV0X2RhdGEueC0+ Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICB7CisgICAgICAgIHN0cnVjdCBmcmFtZSAqZiA9IFhG UkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7CisgICAgICAgIHN0cnVjdCB4X2Rpc3BsYXlfaW5mbyAq ZHB5aW5mbyA9IEZSQU1FX0RJU1BMQVlfSU5GTyAoZik7CisgICAgICAgIHVuc2lnbmVkIGxvbmcg b3JpZ192YWwgPSBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWw7CisgICAgICAgIGludCBp bnRfcmVkID0gcmVkICogNjU1MzU7CisgICAgICAgIGludCBpbnRfZ3JlZW4gPSBncmVlbiAqIDY1 NTM1OworICAgICAgICBpbnQgaW50X2JsdWUgPSBibHVlICogNjU1MzU7CisgICAgICAgIGYtPm91 dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IHhfbWFrZV90cnVlY29sb3JfcGl4ZWwgKGRweWlu Zm8sIGludF9yZWQsIGludF9ncmVlbiwgaW50X2JsdWUpOworICAgICAgICB4X2RyYXdfYmFyX2N1 cnNvciAodywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEhCQVJfQ1VSU09SKTsKKyAgICAgICAg Zi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ192YWw7CisgICAgICB9CisgICAg ICBlbHNlCisgICAgICAgIHhfZHJhd19iYXJfY3Vyc29yICh3LCBnbHlwaF9yb3csIGN1cnNvcl93 aWR0aCwgSEJBUl9DVVJTT1IpOworICAgIGJyZWFrOworICB9CisgIGNhc2UgTk9fQ1VSU09SOgor ICAgIHctPnBoeXNfY3Vyc29yX3dpZHRoID0gMDsKKyAgICBicmVhazsKKyAgZGVmYXVsdDoKKyAg ICBlbWFjc19hYm9ydCAoKTsKKyAgfQogCX0KIAogI2lmZGVmIEhBVkVfWF9JMThOCg== --Multipart_Wed_Mar_16_01:00:38_2016-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: Can we support multiple Cursors? References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 18 Mar 2016 04:01:02 +0000 Resent-Message-ID: <handler.22873.B22873.14582736442396 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22873 <at> debbugs.gnu.org Cc: John Wiegley <jwiegley@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>, Marcin Borkowski <mbork@HIDDEN>, Richard Stallman <rms@HIDDEN> Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.14582736442396 (code B ref 22873); Fri, 18 Mar 2016 04:01:02 +0000 Received: (at 22873) by debbugs.gnu.org; 18 Mar 2016 04:00:44 +0000 Received: from localhost ([127.0.0.1]:51639 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1aglad-0000ca-TS for submit <at> debbugs.gnu.org; Fri, 18 Mar 2016 00:00:44 -0400 Received: from cobb.liquidweb.com ([50.28.13.150]:49767) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1aglab-0000cN-Vk for 22873 <at> debbugs.gnu.org; Fri, 18 Mar 2016 00:00:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date; bh=hDVf3qOU8DYIgailz6CWMt2ITwDAq7ZUS2EgP4fvp1c=; b=41bHz+dZKZ6xHXQxcoXFyjDMU4/mF8nRLpZQ0ei59gExsLc6o/sy80GLBeRBUjbn0YM7acP8bwlZKqNCG0QNAD4f9jIkm259CpD8uy15giuI1EbqY+FEhPL6DoNce+mD; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:52259 helo=server.private.localhost) by cobb.liquidweb.com with esmtp (Exim 4.82) (envelope-from <esq@HIDDEN>) id 1aglaS-0008Kc-Qp; Fri, 18 Mar 2016 00:00:33 -0400 Date: Thu, 17 Mar 2016 21:00:32 -0700 Message-ID: <m2fuvosae7.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 (generated by - "") Content-Type: multipart/mixed; boundary="Multipart_Thu_Mar_17_21:00:31_2016-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cobb.liquidweb.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-Get-Message-Sender-Via: cobb.liquidweb.com: acl_c_relayhosts_text_entry: lawlist|lawlist.com X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.7 (/) --Multipart_Thu_Mar_17_21:00:31_2016-1 Content-Type: text/plain; charset=US-ASCII Attached is the next draft patch -- multiple_cursors_006.diff -- that applies to Emacs master branch as of March 17, 2016, bearing commit "2fbdb1bb4c878f8ae17bd69d1b4ff51c47497e41". This patch resolves the issue relating to a delay of the fake cursors appearing in Emacs for Windows. The bug was caused because I had erroneously thought that the tail end of `redisplay_window' would be a sufficient location to calculate window-start/end for all circumstances, but it turned out that initializing fake cursors by merely setting the `mc-list` variable does not necessarily trigger the tail end of the former internal function. Thus, there is now a second location at the beginning of `mc_calc' to determine window-start/end if it has not already been determined. Other changes include setting up a struct prefix of `mc` in window.h for the pointers, except for the Lisp_Object `mc_cache' which apparently requires special treatment not lending itself to using a prefix. That was the last of the known problems with fake cursors, so the next phase will be for me to try it out with a custom minor mode over the next few weeks to see what else may be needed. The current draft patch has been lightly tested on Emacs for all three (3) window systems -- X11 (no toolkit), Windows (XP SP-3), and OSX (10.6.8). (defun mc-test (&optional list) "Draw fake cursors at all POS defined in the `mc-list'. Multiple fake cursors are supported by GUI versions of Emacs built for X, Windows and OSX. Color vector is LSL (The Linden Scripting Language), rather than standard RGB. `nsterm.m' uses `NSColor', which works well with LSL. `w32term.c' uses `PALETTERGB' or `RGB', and the conversion from LSL is done internally by multiplying each element of the LSL color vector by 255. `xterm.c' uses `x_make_truecolor_pixel', which uses 16-bit RGB -- the conversion from LSL happens internally by multiplying each element of the LSL color vector by 65535." (interactive) (setq mc-list (if list list '( (3 "hbar" [1.0 0.0 0.0]) (4 "bar" [0.0 1.0 0.0]) (5 "box" [0.0 0.0 1.0]) (6 "hollow" [0.8 0.4 0.2]) (7 ("hbar" 3) [1.0 0.0 1.0]) (8 ("bar" 3) [0.0 1.0 1.0]))))) (global-set-key [f1] 'mc-test) --Multipart_Thu_Mar_17_21:00:31_2016-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="multiple_cursors_006.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3NyYy9idWZmZXIuYyBiL3NyYy9idWZmZXIuYwppbmR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S X0NVUlNPUik7Ci0JICBicmVhazsKLQotCWNhc2UgSEJBUl9DVVJTT1I6Ci0JICB4X2RyYXdfYmFy X2N1cnNvciAodywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEhCQVJfQ1VSU09SKTsKLQkgIGJy ZWFrOwotCi0JY2FzZSBOT19DVVJTT1I6Ci0JICB3LT5waHlzX2N1cnNvcl93aWR0aCA9IDA7Ci0J ICBicmVhazsKIAotCWRlZmF1bHQ6Ci0JICBlbWFjc19hYm9ydCAoKTsKLQl9CisgIHN3aXRjaCAo Y3Vyc29yX3R5cGUpCisgICAgeworICAgICAgY2FzZSBIT0xMT1dfQk9YX0NVUlNPUjoKKyAgICAg IHsKKyAgICAgICAgaWYgKHJlZCA+PSAwICYmIGJsdWUgPj0gMCAmJiBncmVlbiA+PSAwKQorICAg ICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3Jf cGl4ZWwnLiAgKi8KKyAgICAgICAgICB7CisgICAgICAgICAgICBzdHJ1Y3QgZnJhbWUgKmYgPSBY RlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworICAgICAgICAgICAgQ09MT1JSRUYgb3JpZ192YWwg PSBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbDsKKyAgICAgICAgICAgIGludCBpbnRf cmVkID0gcmVkICogMjU1OworICAgICAgICAgICAgaW50IGludF9ncmVlbiA9IGdyZWVuICogMjU1 OworICAgICAgICAgICAgaW50IGludF9ibHVlID0gYmx1ZSAqIDI1NTsKKyAgICAgICAgICAgIGYt Pm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gUEFMRVRURVJHQiAoaW50X3JlZCwgaW50 X2dyZWVuLCBpbnRfYmx1ZSk7CisgICAgICAgICAgICB4X2RyYXdfaG9sbG93X2N1cnNvciAodywg Z2x5cGhfcm93KTsKKyAgICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVs ID0gb3JpZ192YWw7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHhf ZHJhd19ob2xsb3dfY3Vyc29yICh3LCBnbHlwaF9yb3cpOworICAgICAgICBicmVhazsKKyAgICAg IH0KKyAgICAgIGNhc2UgRklMTEVEX0JPWF9DVVJTT1I6CisgICAgICB7CisgICAgICAgIC8qIFRP RE86ICBrZGIgdG8gY29uc2lkZXIgYWRkaW5nIHN1cHBvcnQgZm9yIG11bHRpcGxlIGN1cnNvciBm b3JlZ3JvdW5kCisgICAgICAgIGN1c3RvbWl6YXRpb24gb2YgYSBGSUxMRURfQk9YX0NVUlNPUi4g ICovCisgICAgICAgIGlmIChyZWQgPj0gMCAmJiBibHVlID49IDAgJiYgZ3JlZW4gPj0gMCkKKyAg ICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29y X2djJyBieSBib3Jyb3dpbmcgdGhlCisgICAgICAgICAgZnVuY3Rpb25hbGl0eSBvZiBgeF9tYWtl X2djJyBpbiB3MzJmbnMuYy4gICovCisgICAgICAgICAgeworICAgICAgICAgICAgYmxvY2tfaW5w dXQgKCk7CisgICAgICAgICAgICBMaXNwX09iamVjdCB3aW5kb3cgPSAoc2VsZWN0ZWRfd2luZG93 KTsKKyAgICAgICAgICAgIHN0cnVjdCB3aW5kb3cgKncgPSBkZWNvZGVfbGl2ZV93aW5kb3cgKHdp bmRvdyk7CisgICAgICAgICAgICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFN RSAodykpOworICAgICAgICAgICAgaW50IGludF9yZWQgPSByZWQgKiAyNTU7CisgICAgICAgICAg ICBpbnQgaW50X2dyZWVuID0gZ3JlZW4gKiAyNTU7CisgICAgICAgICAgICBpbnQgaW50X2JsdWUg PSBibHVlICogMjU1OworICAgICAgICAgICAgWEdDVmFsdWVz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vbnQgPSBGUkFNRV9GT05UIChmKTsKKyAgICAgICAgICAgIGdjX3ZhbHVlcy5m b3JlZ3JvdW5kID0gb3JpZ192YWxfYTsKKyAgICAgICAgICAgIGdjX3ZhbHVlcy5iYWNrZ3JvdW5k ID0gb3JpZ192YWxfYjsKKyAgICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2dj CisgICAgICAgICAgICAgID0gWENyZWF0ZUdDIChOVUxMLCBGUkFNRV9XMzJfV0lORE9XIChmKSwg bWFzaywgJmdjX3ZhbHVlcyk7CisgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAg ICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICBkcmF3X3BoeXNfY3Vyc29yX2dseXBo ICh3LCBnbHlwaF9yb3csIERSQVdfQ1VSU09SKTsKKyAgICAgICAgYnJlYWs7CisgICAgICB9Cisg ICAgICBjYXNlIEJBUl9DVVJTT1I6CisgICAgICB7CisgICAgICAgIGlmIChyZWQgPj0gMCAmJiBi bHVlID49IDAgJiYgZ3JlZW4gPj0gMCkKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sg YGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgICAgeworICAg ICAgICAgICAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAg ICAgICAgICAgIENPTE9SUkVGIG9yaWdfdmFsID0gZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3Jf cGl4ZWw7CisgICAgICAgICAgICBpbnQgaW50X3JlZCA9IHJlZCAqIDI1NTsKKyAgICAgICAgICAg IGludCBpbnRfZ3JlZW4gPSBncmVlbiAqIDI1NTsKKyAgICAgICAgICAgIGludCBpbnRfYmx1ZSA9 IGJsdWUgKiAyNTU7CisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhl bCA9IFBBTEVUVEVSR0IgKGludF9yZWQsIGludF9ncmVlbiwgaW50X2JsdWUpOworICAgICAgICAg ICAgeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIGdseXBoX3JvdywgY3Vyc29yX3dpZHRoLCBCQVJfQ1VS U09SKTsKKyAgICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3Jp Z192YWw7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHhfZHJhd19i YXJfY3Vyc29yICh3LCBnbHlwaF9yb3csIGN1cnNvcl93aWR0aCwgQkFSX0NVUlNPUik7CisgICAg ICAgIGJyZWFrOworICAgICAgfQorICAgICAgY2FzZSBIQkFSX0NVUlNPUjoKKyAgICAgIHsKKyAg ICAgICAgaWYgKHJlZCA+PSAwICYmIGJsdWUgPj0gMCAmJiBncmVlbiA+PSAwKQorICAgICAgICAg IC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwn LiAgKi8KKyAgICAgICAgICB7CisgICAgICAgICAgICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUg KFdJTkRPV19GUkFNRSAodykpOworICAgICAgICAgICAgQ09MT1JSRUYgb3JpZ192YWwgPSBmLT5v dXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbDsKKyAgICAgICAgICAgIGludCBpbnRfcmVkID0g cmVkICogMjU1OworICAgICAgICAgICAgaW50IGludF9ncmVlbiA9IGdyZWVuICogMjU1OworICAg ICAgICAgICAgaW50IGludF9ibHVlID0gYmx1ZSAqIDI1NTsKKyAgICAgICAgICAgIGYtPm91dHB1 dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gUEFMRVRURVJHQiAoaW50X3JlZCwgaW50X2dyZWVu LCBpbnRfYmx1ZSk7CisgICAgICAgICAgICB4X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cG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mJiBwb3NpbnQgPj0gdy0+bWMuc3RhcnQKKyAg ICAgICYmIHBvc2ludCA8PSB3LT5tYy5lbmQpCisgICAgeworICAgICAgU0VUX1RFWFRfUE9TX0ZS T01fTUFSS0VSIChwdCwgdy0+c3RhcnQpOworICAgICAgc3RhcnRfZGlzcGxheSAoJml0LCB3LCBw dCk7CisgICAgICBtb3ZlX2l0X3RvICgmaXQsIHBvc2ludCwgLTEsIC0xLCAtMSwgTU9WRV9UT19Q T1MpOworICAgICAgcG9zID0gaXQuY3VycmVudC5wb3M7CisgICAgICB4ID0gaXQuY3VycmVudF94 OworICAgICAgeSA9IGl0LmN1cnJlbnRfeTsKKyAgICAgIGhwb3MgPSBpdC5ocG9zOworICAgICAg dnBvcyA9IGl0LnZwb3M7CisgICAgICBiaWRpX3Vuc2hlbHZlX2NhY2hlIChpdGRhdGEsIGZhbHNl KTsKKyAgICB9CisgICAgZWxzZQorICAgICAgeworICAgICAgICB4ID0gLTE7CisgICAgICAgIHkg PSAtMTsKKyAgICAgICAgaHBvcyA9IC0xOworICAgICAgICB2cG9zID0gLTE7CisgICAgICB9Cisg IHJldHVybiBsaXN0biAoQ09OU1RZUEVfUFVSRSwgNCwgbWFrZV9udW1iZXIgKHgpLCBtYWtlX251 bWJlciAoeSksIG1ha2VfbnVtYmVyIChocG9zKSwgbWFrZV9udW1iZXIgKHZwb3MpKTsKK30KKwor aW50CittY19saXNwX3RvX2N1cnNvcl90eXBlIChMaXNwX09iamVjdCBhcmcpCit7CisgIGNoYXIg KnN0cjsKKyAgaWYgKFhUWVBFIChhcmcpID09IExpc3BfU3RyaW5nKQorICAgIHN0ciA9IFNTREFU QSAoYXJnKTsKKyAgZWxzZSBpZiAoWFRZUEUgKGFyZykgPT0gTGlzcF9TeW1ib2wpCisgICAgc3Ry ID0gU1NEQVRBIChTWU1CT0xfTkFNRSAoYXJnKSk7CisgIGVsc2UgcmV0dXJuIC0xOworICBpZiAo IXN0cmNtcCAoc3RyLCAiYm94IikpCisgICAgcmV0dXJuIEZJTExFRF9CT1hfQ1VSU09SOworICBp ZiAoIXN0cmNtcCAoc3RyLCAiaG9sbG93IikpCisgICAgcmV0dXJuIEhPTExPV19CT1hfQ1VSU09S OworICBpZiAoIXN0cmNtcCAoc3RyLCAiaGJhciIpKQorICAgIHJldHVybiBIQkFSX0NVUlNPUjsK KyAgaWYgKCFzdHJjbXAgKHN0ciwgImJhciIpKQorICAgIHJldHVybiBCQVJfQ1VSU09SOworICBp ZiAoIXN0cmNtcCAoc3RyLCAibm8iKSkKKyAgICByZXR1cm4gTk9fQ1VSU09SOworICByZXR1cm4g LTE7Cit9CisKKy8qIEVYQU1QTEUgIzE6CisgICAgKHNldHEgbWMtbGlzdCAnKAorICAgICAgKDMg ImhiYXIiIFsxLjAgMC4wIDAuMF0pCisgICAgICAoNCAiYmFyIiBbMC4wIDEuMCAwLjBdKQorICAg ICAgKDUgImJveCIgWzAuMCAwLjAgMS4wXSkKKyAgICAgICg2ICJob2xsb3ciIFswLjggMC40IDAu Ml0pCisgICAgICAoNyAoImhiYXIiIDMpIFsxLjAgMC4wIDEuMF0pCisgICAgICAoOCAoImJhciIg MykgWzAuMCAxLjAgMS4wXSkpKQorICAgRVhBTVBMRSAjMjogIChzZXRxIG1jLWxpc3QgbmlsKQor VGhlIGBtY19jYWNoZScgaXMga2VwdCBpbiB0aGUgZm9sbG93aW5nIGV4YW1wbGUgZm9ybWF0Ogor ICAoKAorICAgICgzIGhiYXIgWzEuMCAwLjAgMC4wXSkKKyAgICAoNCBiYXIgWzAuMCAxLjAgMC4w XSkKKyAgICAoNSBib3ggWzAuMCAwLjAgMS4wXSkKKyAgICAoNiBob2xsb3cgWzAuOCAwLjQgMC4y XSkKKyAgICAoNyAoaGJhciAzKSBbMS4wIDAuMCAxLjBdKQorICAgICg4IChiYXIgMykgWzAuMCAx LjAgMS4wXSkpCisgICAoCisgICAgKCgzIGhiYXIgWzEuMCAwLjAgMC4wXSkgKDIyIDIwIDIgMCkp CisgICA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y1lbmQgcG9pbnRlcnMgYXJlIHNldCB3aXRo aW4gYHJlZGlzcGxheV93aW5kb3cnLCBob3dldmVyLAorICB0aGF0IHNlY3Rpb24gb2YgdGhlIGNv ZGUgbWF5IG5vdCBuZWNlc3NhcmlseSBydW4gd2hlbiBpbml0aWFsaXppbmcgdGhlIGBtY19saXN0 Jy4gICovCisgIGlmICh3LT5tYy5zdGFydCAmJiAhdy0+bWMucHJldl9zdGFydCkKKyAgICB3LT5t Yy5wcmV2X3N0YXJ0ID0gdy0+bWMuc3RhcnQ7CisgIGlmICh3LT5tYy5lbmQgJiYgIXctPm1jLnBy ZXZfZW5kKQorICAgIHctPm1jLnByZXZfZW5kID0gdy0+bWMuZW5kOworICBpZiAoIXctPm1jLnN0 YXJ0KQorICAgIHctPm1jLnN0YXJ0ID0gbWFya2VyX3Bvc2l0aW9uICh3LT5zdGFydCk7CisgIGlm ICghdy0+bWMuZW5kKQorICAgIHctPm1jLmVuZCA9IEJVRl9aIChYQlVGRkVSICh3LT5jb250ZW50 cykpIC0gdy0+d2luZG93X2VuZF9wb3M7CisgIGlmICh3LT5tY19jYWNoZQorICAgICAgJiYgKE5J TFAgKEZlcXVhbCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB3LT5tY19jYWNoZSksIEJWQVIgKGN1 cnJlbnRfYnVmZmVyLCBtY19saXN0KSkpCisgICAgICAgICAgfHwgdyAhPSBzdykpCisgICAgewor I2lmZGVmIEdMWVBIX0RFQlVHCisgIGRlYnVnX21ldGhvZF9hZGQgKHcsICJtY19jYWxjOiAgcmVt b3ZlIGN1cnNvcnMgdXNpbmcgY2FjaGUiKTsKKyNlbmRpZgorICAgICAgZm9yICh2bGlzdCA9IFhD QVIgKFhDRFIgKHctPm1jX2NhY2hlKSk7CisgICAgICAgICAgIENPTlNQICh2bGlzdCk7CisgICAg ICAgICAgIHZsaXN0ID0gWENEUiAodmxpc3QpKQorICAgICAgICB7CisgICAgICAgICAgY3Vyc29y X3NwZWNfbGlzdCA9IFhDQVIgKFhDQVIgKHZsaXN0KSk7CisgICAgICAgICAgcG9zaW50ID0gWElO VCAoRm50aCAobWFrZV9udW1iZXIgKDApLCBjdXJzb3Jfc3BlY19saXN0KSk7CisgICAgICAgICAg Y3Vyc29yX3NwZWNfdHlwZSA9IEZudGggKG1ha2VfbnVtYmVyICgxKSwgY3Vyc29yX3NwZWNfbGlz dCk7CisgICAgICAgICAgaWYgKENPTlNQIChjdXJzb3Jfc3BlY190eXBlKSkKKyAgICAgICAgICAg IGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoWENBUiAoY3Vyc29yX3NwZWNf dHlwZSkpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IG1j X2xpc3BfdG9fY3Vyc29yX3R5cGUgKGN1cnNvcl9zcGVjX3R5cGUpOworICAgICAgICAgIGlmIChD T05TUCAoY3Vyc29yX3NwZWNfdHlwZSkpCisgICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSBYSU5U IChYQ0FSIChYQ0RSIChjdXJzb3Jfc3BlY190eXBlKSkpOworICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSAxOworICAgICAgICAgIGN1cnNvcl9jb2xvcl92ZWN0 b3IgPSBGbnRoIChtYWtlX251bWJlciAoMiksIGN1cnNvcl9zcGVjX2xpc3QpOworICAgICAgICAg IHJlZCA9IFhGTE9BVF9EQVRBIChBUkVGIChjdXJzb3JfY29sb3JfdmVjdG9yLCAwKSk7CisgICAg ICAgICAgZ3JlZW4gPSBYRkxPQVRfREFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3RvciwgMSkp OworICAgICAgICAgIGJsdWUgPSBYRkxPQVRfREFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3Rv ciwgMikpOworICAgICAgICAgIGlmIChwb3NpbnQKKyAgICAgICAgICAgICAgJiYgdy0+bWMuc3Rh cnQKKyAgICAgICAgICAgICAgJiYgdy0+bWMuZW5kCisgICAgICAgICAgICAgICYmIHBvc2ludCA+ PSB3LT5tYy5zdGFydAorICAgICAgICAgICAgICAmJiBwb3NpbnQgPD0gdy0+bWMuZW5kKQorICAg ICAgICAgICAgeworICAgICAgICAgICAgICB4X3lfaHBvc192cG9zX2xpc3QgPSBYQ0FSIChYQ0RS IChYQ0FSICh2bGlzdCkpKTsKKyAgICAgICAgICAgICAgeCA9IFhJTlQgKEZudGggKG1ha2VfbnVt YmVyICgwKSwgeF95X2hwb3NfdnBvc19saXN0KSk7CisgICAgICAgICAgICAgIHkgPSBYSU5UIChG bnRoIChtYWtlX251bWJlciAoMSksIHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAgICAg ICBocG9zID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDIpLCB4X3lfaHBvc192cG9zX2xpc3Qp KTsKKyAgICAgICAgICAgICAgdnBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgzKSwgeF95 X2hwb3NfdnBvc19saXN0KSk7CisgICAgICAgICAgICAgIG1jX2VyYXNlICh3LCB4LCB5LCBocG9z LCB2cG9zLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByZWQsIGdyZWVuLCBibHVlKTsKKyAg ICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgdy0+bWNfY2FjaGUgPSBRbmlsOworICAgIH0K KyAgICBlbHNlIGlmICh3ID09IHN3CisgICAgICAgICAgICAmJiB3LT5tYy5zdGFydAorICAgICAg ICAgICAgJiYgdy0+bWMuZW5kCisgICAgICAgICAgICAmJiB3LT5tYy5wcmV2X3N0YXJ0CisgICAg ICAgICAgICAmJiB3LT5tYy5wcmV2X2VuZAorICAgICAgICAgICAgJiYgdy0+bWMuc3RhcnQgPT0g dy0+bWMucHJldl9zdGFydAorICAgICAgICAgICAgJiYgdy0+bWMuZW5kID09IHctPm1jLnByZXZf ZW5kCisgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoY3VycmVudF9idWZmZXIsIG1jX2xpc3Qp KQorICAgICAgICAgICAgJiYgdy0+bWNfY2FjaGUKKyAgICAgICAgICAgICYmICFOSUxQIChGZXF1 YWwgKEZudGggKG1ha2VfbnVtYmVyICgwKSwgdy0+bWNfY2FjaGUpLCBCVkFSIChjdXJyZW50X2J1 ZmZlciwgbWNfbGlzdCkpKSkKKyAgICAgIHsKKyNpZmRlZiBHTFlQSF9ERUJVRworICBkZWJ1Z19t ZXRob2RfYWRkICh3LCAibWNfY2FsYzogIGRyYXcgY3Vyc29ycyB1c2luZyBjYWNoZSIpOworI2Vu ZGlmCisgICAgICAgIGZvciAodmxpc3QgPSBYQ0FSIChYQ0RSICh3LT5tY19jYWNoZSkpOworICAg ICAgICAgICAgIENPTlNQICh2bGlzdCk7CisgICAgICAgICAgICAgdmxpc3QgPSBYQ0RSICh2bGlz dCkpCisgICAgICAgICAgeworICAgICAgICAgICAgY3Vyc29yX3NwZWNfbGlzdCA9IFhDQVIgKFhD QVIgKHZsaXN0KSk7CisgICAgICAgICAgICBwb3NpbnQgPSBYSU5UIChGbnRoIChtYWtlX251bWJl ciAoMCksIGN1cnNvcl9zcGVjX2xpc3QpKTsKKyAgICAgICAgICAgIGN1cnNvcl9zcGVjX3R5cGUg PSBGbnRoIChtYWtlX251bWJlciAoMSksIGN1cnNvcl9zcGVjX2xpc3QpOworICAgICAgICAgICAg aWYgKENPTlNQIChjdXJzb3Jfc3BlY190eXBlKSkKKyAgICAgICAgICAgICAgY3Vyc29yX3R5cGUg PSBtY19saXNwX3RvX2N1cnNvcl90eXBlIChYQ0FSIChjdXJzb3Jfc3BlY190eXBlKSk7CisgICAg ICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9f Y3Vyc29yX3R5cGUgKGN1cnNvcl9zcGVjX3R5cGUpOworICAgICAgICAgICAgaWYgKENPTlNQIChj dXJzb3Jfc3BlY190eXBlKSkKKyAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoID0gWElOVCAoWENB UiAoWENEUiAoY3Vyc29yX3NwZWNfdHlwZSkpKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICAgIGN1cnNvcl93aWR0aCA9IDE7CisgICAgICAgICAgICBjdXJzb3JfY29sb3JfdmVj dG9yID0gRm50aCAobWFrZV9udW1iZXIgKDIpLCBjdXJzb3Jfc3BlY19saXN0KTsKKyAgICAgICAg ICAgIHJlZCA9IFhGTE9BVF9EQVRBIChBUkVGIChjdXJzb3JfY29sb3JfdmVjdG9yLCAwKSk7Cisg ICAgICAgICAgICBncmVlbiA9IFhGTE9BVF9EQVRBIChBUkVGIChjdXJzb3JfY29sb3JfdmVjdG9y LCAxKSk7CisgICAgICAgICAgICBibHVlID0gWEZMT0FUX0RBVEEgKEFSRUYgKGN1cnNvcl9jb2xv cl92ZWN0b3IsIDIpKTsKKyAgICAgICAgICAgIGlmIChwb3NpbnQKKyAgICAgICAgICAgICAgICAm JiB3LT5tYy5zdGFydAorICAgICAgICAgICAgICAgICYmIHctPm1jLmVuZAorICAgICAgICAgICAg ICAgICYmIHBvc2ludCA+PSB3LT5tYy5zdGFydAorICAgICAgICAgICAgICAgICYmIHBvc2ludCA8 PSB3LT5tYy5lbmQpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB4X3lfaHBvc192 cG9zX2xpc3QgPSBYQ0FSIChYQ0RSIChYQ0FSICh2bGlzdCkpKTsKKyAgICAgICAgICAgICAgICB4 ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAg ICAgICAgICAgICAgICB5ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB4X3lfaHBvc192 cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAgICBocG9zID0gWElOVCAoRm50aCAobWFrZV9udW1i ZXIgKDIpLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAgICB2cG9zID0gWElO VCAoRm50aCAobWFrZV9udW1iZXIgKDMpLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAg ICAgICAgICBtY19kcmF3ICh3LCB4LCB5LCBocG9zLCB2cG9zLCBjdXJzb3JfdHlwZSwgY3Vyc29y X3dpZHRoLCByZWQsIGdyZWVuLCBibHVlKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0K KyAgICAgIH0KKyAgICAgIGVsc2UgaWYgKHcgPT0gc3cKKyAgICAgICAgICAgICAgICYmICFOSUxQ IChCVkFSIChjdXJyZW50X2J1ZmZlciwgbWNfbGlzdCkpKQorICAgICAgICB7CisjaWZkZWYgR0xZ UEhfREVCVUcKKyAgZGVidWdfbWV0aG9kX2FkZCAodywgIm1jX2NhbGM6ICBkcmF3IGN1cnNvcnMg YW5ldyIpOworI2VuZGlmCisgICAgICAgICAgLyogRXJhc2UgYWxsIG9mIHRoZSBvbGQgY3Vyc29y cyBhdCB0aGUgcHJldmlvdXNseSByZWNvcmRlZCB4L3kvaHBvcy92cG9zIGV2ZW4KKyAgICAgICAg ICB0aG91Z2ggdGhlIGNvcnJlc3BvbmRpbmcgYHBvc2ludCcgaGFzIGNoYW5nZWQuICAqLworICAg ICAgICAgIGlmICh3LT5tY19jYWNoZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgZm9y ICh2bGlzdCA9IFhDQVIgKFhDRFIgKHctPm1jX2NhY2hlKSk7CisgICAgICAgICAgICAgICAgICAg Q09OU1AgKHZsaXN0KTsKKyAgICAgICAgICAgICAgICAgICB2bGlzdCA9IFhDRFIgKHZsaXN0KSkK KyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBjdXJzb3Jfc3BlY19saXN0ID0g WENBUiAoWENBUiAodmxpc3QpKTsKKyAgICAgICAgICAgICAgICAgIHBvc2ludCA9IFhJTlQgKEZu dGggKG1ha2VfbnVtYmVyICgwKSwgY3Vyc29yX3NwZWNfbGlzdCkpOworICAgICAgICAgICAgICAg ICAgY3Vyc29yX3NwZWNfdHlwZSA9IEZudGggKG1ha2VfbnVtYmVyICgxKSwgY3Vyc29yX3NwZWNf bGlzdCk7CisgICAgICAgICAgICAgICAgICBpZiAoQ09OU1AgKGN1cnNvcl9zcGVjX3R5cGUpKQor ICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUg KFhDQVIgKGN1cnNvcl9zcGVjX3R5cGUpKTsKKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAo Y3Vyc29yX3NwZWNfdHlwZSk7CisgICAgICAgICAgICAgICAgICBpZiAoQ09OU1AgKGN1cnNvcl9z cGVjX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSBYSU5UIChYQ0FS IChYQ0RSIChjdXJzb3Jfc3BlY190eXBlKSkpOworICAgICAgICAgICAgICAgICAgICBlbHNlCisg ICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoID0gMTsKKyAgICAgICAgICAgICAgICAg IGN1cnNvcl9jb2xvcl92ZWN0b3IgPSBGbnRoIChtYWtlX251bWJlciAoMiksIGN1cnNvcl9zcGVj X2xpc3QpOworICAgICAgICAgICAgICAgICAgcmVkID0gWEZMT0FUX0RBVEEgKEFSRUYgKGN1cnNv cl9jb2xvcl92ZWN0b3IsIDApKTsKKyAgICAgICAgICAgICAgICAgIGdyZWVuID0gWEZMT0FUX0RB VEEgKEFSRUYgKGN1cnNvcl9jb2xvcl92ZWN0b3IsIDEpKTsKKyAgICAgICAgICAgICAgICAgIGJs dWUgPSBYRkxPQVRfREFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3RvciwgMikpOworICAgICAg ICAgICAgICAgICAgeF95X2hwb3NfdnBvc19saXN0ID0gWENBUiAoWENEUiAoWENBUiAodmxpc3Qp KSk7CisgICAgICAgICAgICAgICAgICB4ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB4 X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAgICAgIHkgPSBYSU5UIChGbnRoICht YWtlX251bWJlciAoMSksIHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAgICAgICAgICAg aHBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgeF95X2hwb3NfdnBvc19saXN0KSk7 CisgICAgICAgICAgICAgICAgICB2cG9zID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDMpLCB4 X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAgICAgIG1jX2VyYXNlICh3LCB4LCB5 LCBocG9zLCB2cG9zLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByZWQsIGdyZWVuLCBibHVl KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIHctPm1jX2NhY2hlID0gUW5pbDsK KyAgICAgICAgICAgIH0KKyAgICAgICAgICBmb3IgKHZsaXN0ID0gQlZBUiAoY3VycmVudF9idWZm ZXIsIG1jX2xpc3QpOworICAgICAgICAgICAgICAgQ09OU1AgKHZsaXN0KTsKKyAgICAgICAgICAg ICAgIHZsaXN0ID0gWENEUiAodmxpc3QpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBj dXJzb3Jfc3BlY19saXN0ID0gWENBUiAodmxpc3QpOworICAgICAgICAgICAgICBwb3NpbnQgPSBY SU5UIChGbnRoIChtYWtlX251bWJlciAoMCksIGN1cnNvcl9zcGVjX2xpc3QpKTsKKyAgICAgICAg ICAgICAgY3Vyc29yX3NwZWNfdHlwZSA9IEZudGggKG1ha2VfbnVtYmVyICgxKSwgY3Vyc29yX3Nw ZWNfbGlzdCk7CisgICAgICAgICAgICAgIGlmIChDT05TUCAoY3Vyc29yX3NwZWNfdHlwZSkpCisg ICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUgPSBtY19saXNwX3RvX2N1cnNvcl90eXBlIChYQ0FS IChjdXJzb3Jfc3BlY190eXBlKSk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICAgICAgY3Vyc29yX3R5cGUgPSBtY19saXNwX3RvX2N1cnNvcl90eXBlIChjdXJzb3Jfc3BlY190 eXBlKTsKKyAgICAgICAgICAgICAgaWYgKENPTlNQIChjdXJzb3Jfc3BlY190eXBlKSkKKyAgICAg ICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSBYSU5UIChYQ0FSIChYQ0RSIChjdXJzb3Jfc3BlY190 eXBlKSkpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIGN1cnNvcl93 aWR0aCA9IDE7CisgICAgICAgICAgICAgIGN1cnNvcl9jb2xvcl92ZWN0b3IgPSBGbnRoIChtYWtl X251bWJlciAoMiksIGN1cnNvcl9zcGVjX2xpc3QpOworICAgICAgICAgICAgICByZWQgPSBYRkxP QVRfREFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3RvciwgMCkpOworICAgICAgICAgICAgICBn cmVlbiA9IFhGTE9BVF9EQVRBIChBUkVGIChjdXJzb3JfY29sb3JfdmVjdG9yLCAxKSk7CisgICAg ICAgICAgICAgIGJsdWUgPSBYRkxPQVRfREFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3Rvciwg MikpOworICAgICAgICAgICAgICBpZiAocG9zaW50KQorICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgIHhfeV9ocG9zX3Zwb3NfbGlzdCA9IG1jX3hfeV9ocG9zX3Zwb3MgKHcsIHBv c2ludCk7CisgICAgICAgICAgICAgICAgICB0ZW1wID0gRmNvbnMgKGN1cnNvcl9zcGVjX2xpc3Qs IEZjb25zICh4X3lfaHBvc192cG9zX2xpc3QsIFFuaWwpKTsKKyAgICAgICAgICAgICAgICAgIHJl c3VsdCA9IEZjb25zICh0ZW1wLCByZXN1bHQpOworICAgICAgICAgICAgICAgICAgeCA9IFhJTlQg KEZudGggKG1ha2VfbnVtYmVyICgwKSwgeF95X2hwb3NfdnBvc19saXN0KSk7CisgICAgICAgICAg ICAgICAgICB5ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB4X3lfaHBvc192cG9zX2xp c3QpKTsKKyAgICAgICAgICAgICAgICAgIGhwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAo MiksIHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAgICAgICAgICAgdnBvcyA9IFhJTlQg KEZudGggKG1ha2VfbnVtYmVyICgzKSwgeF95X2hwb3NfdnBvc19saXN0KSk7CisgICAgICAgICAg ICAgICAgICBpZiAody0+bWMuc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5tYy5l bmQKKyAgICAgICAgICAgICAgICAgICAgICAmJiBwb3NpbnQgPj0gdy0+bWMuc3RhcnQKKyAgICAg ICAgICAgICAgICAgICAgICAmJiBwb3NpbnQgPD0gdy0+bWMuZW5kKQorICAgICAgICAgICAgICAg ICAgICBtY19kcmF3ICh3LCB4LCB5LCBocG9zLCB2cG9zLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dp ZHRoLCByZWQsIGdyZWVuLCBibHVlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9 CisgICAgICAgICAgaWYgKHJlc3VsdCkKKyAgICAgICAgICAgIHctPm1jX2NhY2hlID0gRmNvbnMg KEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBtY19saXN0KSwgRmNvbnMgKEZyZXZlcnNlIChyZXN1bHQp LCBRbmlsKSk7CisgICAgICAgIH0KKyAgaWYgKG9sZF9idWZmZXIpCisgICAgc2V0X2J1ZmZlcl9p bnRlcm5hbCAob2xkX2J1ZmZlcik7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7CisgIGNhc2UgSE9M TE9XX0JPWF9DVVJTT1I6CisgIHsKKyAgICBpZiAocmVkID49IDAgJiYgYmx1ZSA+PSAwICYmIGdy ZWVuID49IDApCisgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngt PmN1cnNvcl9waXhlbCcuICAqLworICAgICAgeworICAgICAgICBzdHJ1Y3QgZnJhbWUgKmYgPSBY RlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworICAgICAgICBzdHJ1Y3QgeF9kaXNwbGF5X2luZm8g KmRweWluZm8gPSBGUkFNRV9ESVNQTEFZX0lORk8gKGYpOworICAgICAgICB1bnNpZ25lZCBsb25n IG9yaWdfdmFsID0gZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsOworICAgICAgICBpbnQg aW50X3JlZCA9IHJlZCAqIDY1NTM1OworICAgICAgICBpbnQgaW50X2dyZWVuID0gZ3JlZW4gKiA2 NTUzNTsKKyAgICAgICAgaW50IGludF9ibHVlID0gYmx1ZSAqIDY1NTM1OworICAgICAgICBmLT5v dXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSB4X21ha2VfdHJ1ZWNvbG9yX3BpeGVsIChkcHlp bmZvLCBpbnRfcmVkLCBpbnRfZ3JlZW4sIGludF9ibHVlKTsKKyAgICAgICAgeF9kcmF3X2hvbGxv d19jdXJzb3IgKHcsIGdseXBoX3Jvdyk7CisgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNv cl9waXhlbCA9IG9yaWdfdmFsOworICAgICAgfQorICAgICAgZWxzZQorICAgICAgICB4X2RyYXdf aG9sbG93X2N1cnNvciAodywgZ2x5cGhfcm93KTsKKyAgICBicmVhazsKKyAgfQorICBjYXNlIEZJ TExFRF9CT1hfQ1VSU09SOgorICB7CisgICAgIC8qIFRPRE86ICBrZGIgdG8gY29uc2lkZXIgYWRk aW5nIHN1cHBvcnQgZm9yIG11bHRpcGxlIGN1cnNvciB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BpeGVsID0geF9tYWtlX3Ry dWVjb2xvcl9waXhlbCAoZHB5aW5mbywgaW50X3JlZCwgaW50X2dyZWVuLCBpbnRfYmx1ZSk7Cisg ICAgICAgIHhfZHJhd19iYXJfY3Vyc29yICh3LCBnbHlwaF9yb3csIGN1cnNvcl93aWR0aCwgQkFS X0NVUlNPUik7CisgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdf dmFsOworICAgICAgfQorICAgICAgZWxzZQorICAgICAgICB4X2RyYXdfYmFyX2N1cnNvciAodywg Z2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEJBUl9DVVJTT1IpOworICAgIGJyZWFrOworICB9Cisg IGNhc2UgSEJBUl9DVVJTT1I6CisgIHsKKyAgICBpZiAocmVkID49IDAgJiYgYmx1ZSA+PSAwICYm IGdyZWVuID49IDApCisgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRh LngtPmN1cnNvcl9waXhlbCcuICAqLworICAgICAgeworICAgICAgICBzdHJ1Y3QgZnJhbWUgKmYg PSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworICAgICAgICBzdHJ1Y3QgeF9kaXNwbGF5X2lu Zm8gKmRweWluZm8gPSBGUkFNRV9ESVNQTEFZX0lORk8gKGYpOworICAgICAgICB1bnNpZ25lZCBs b25nIG9yaWdfdmFsID0gZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsOworICAgICAgICBp bnQgaW50X3JlZCA9IHJlZCAqIDY1NTM1OworICAgICAgICBpbnQgaW50X2dyZWVuID0gZ3JlZW4g KiA2NTUzNTsKKyAgICAgICAgaW50IGludF9ibHVlID0gYmx1ZSAqIDY1NTM1OworICAgICAgICBm LT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSB4X21ha2VfdHJ1ZWNvbG9yX3BpeGVsIChk cHlpbmZvLCBpbnRfcmVkLCBpbnRfZ3JlZW4sIGludF9ibHVlKTsKKyAgICAgICAgeF9kcmF3X2Jh cl9jdXJzb3IgKHcsIGdseXBoX3JvdywgY3Vyc29yX3dpZHRoLCBIQkFSX0NVUlNPUik7CisgICAg ICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdfdmFsOworICAgICAgfQor ICAgICAgZWxzZQorICAgICAgICB4X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cGhfcm93LCBjdXJz b3Jfd2lkdGgsIEhCQVJfQ1VSU09SKTsKKyAgICBicmVhazsKKyAgfQorICBjYXNlIE5PX0NVUlNP UjoKKyAgICB3LT5waHlzX2N1cnNvcl93aWR0aCA9IDA7CisgICAgYnJlYWs7CisgIGRlZmF1bHQ6 CisgICAgZW1hY3NfYWJvcnQgKCk7CisgIH0KIAl9CiAKICNpZmRlZiBIQVZFX1hfSTE4Tgo= --Multipart_Thu_Mar_17_21:00:31_2016-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: Can we support multiple Cursors? Resent-From: John Wiegley <jwiegley@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sun, 27 Mar 2016 00:22:02 +0000 Resent-Message-ID: <handler.22873.B22873.145903806621298 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Keith David Bershatsky <esq@HIDDEN> Cc: Eli Zaretskii <eliz@HIDDEN>, Marcin Borkowski <mbork@HIDDEN>, 22873 <at> debbugs.gnu.org, Richard Stallman <rms@HIDDEN> Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.145903806621298 (code B ref 22873); Sun, 27 Mar 2016 00:22:02 +0000 Received: (at 22873) by debbugs.gnu.org; 27 Mar 2016 00:21:06 +0000 Received: from localhost ([127.0.0.1]:39008 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ajyS1-0005XP-S2 for submit <at> debbugs.gnu.org; Sat, 26 Mar 2016 20:21:06 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:34478) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <jwiegley@HIDDEN>) id 1ajyRx-0005Va-8m for 22873 <at> debbugs.gnu.org; Sat, 26 Mar 2016 20:21:01 -0400 Received: by mail-pa0-f44.google.com with SMTP id fe3so71273381pab.1 for <22873 <at> debbugs.gnu.org>; Sat, 26 Mar 2016 17:21:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:in-reply-to:date:message-id:references :user-agent:mime-version; bh=Pn4+PVLa+rG5WLbAglt+JK7Dx27WjwSjpNTp+3tibUs=; b=jfV3Y1Z9jSa/UJEHj82OCybIKSLm5wjZEIbC8zOx26dfCM6EZI1nneCoKvd+sX0OkJ p6GIMLDWBQTM6hapFIdQdMB37O+IDcu0Feoo8JbNU+EflbmQajHU4Gikqfp0VL8S+I+J ElTqf7oV2dcEgOpMVdH+bJ3yv2z9bR4IFVU2kVJfbMvVzKCYZ9ccdAs7sbs8hOqg5jXs ysHrK9kn9B2TYX1T8RHwskNcnxJkwhFzr4/UUXh1ElJFypK6OFRmHJmamTPUFH4BA+oI 0kJ7pCXOWIGr02WRVXMt5M0a3Ol9RInw5/ZyhBoNniB45RHhJCv3k370iDYJ33oBBe7W K3Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:in-reply-to:date:message-id :references:user-agent:mime-version; bh=Pn4+PVLa+rG5WLbAglt+JK7Dx27WjwSjpNTp+3tibUs=; b=D6J3WcwyvvfPpDGN65RgdZUvtYj//jWRXr/5Hbmj6orZiTID224jcdEf1vJXYd14Vt NpAHN98y2fEoZKVbZy4KUM8gYswqD5LZK5YV63MbVLAJSVvojPa9gzx5T8Rpm5hcNQS9 Aei9G2fdIrJm8HIE44qo6zuzBVRWD5xZhbkYnBWwV52C0JVQC5SGW8/b48W0jI/f6fuU pqcv+F/as0K83f428zpNZBry5TQsST8Aaa5HDzG3vOlITngaVk/n3E8pvfoFWZE9B2aC Vb4JxbVLtCGdjIjukxhA48EuAgg4MAOeKL9lexGqy/1LYGCCO22CZTe+lsDWxc4XdtsS eNsQ== X-Gm-Message-State: AD7BkJJD92adSkbNA8/ibKgNCVrItwdw1E0+cntR9KkH/gJ0sbyno/liow9TLxG0XxbraQ== X-Received: by 10.66.175.110 with SMTP id bz14mr31936469pac.41.1459038055944; Sat, 26 Mar 2016 17:20:55 -0700 (PDT) Received: from Hermes.local (76-234-68-79.lightspeed.frokca.sbcglobal.net. [76.234.68.79]) by smtp.gmail.com with ESMTPSA id qy7sm25509133pab.34.2016.03.26.17.20.52 (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 26 Mar 2016 17:20:54 -0700 (PDT) Received: by Hermes.local (Postfix, from userid 501) id 1EC474FB4C5D; Sat, 26 Mar 2016 17:20:52 -0700 (PDT) From: John Wiegley <jwiegley@HIDDEN> In-Reply-To: <m2fuvosae7.wl%esq@HIDDEN> (Keith David Bershatsky's message of "Thu, 17 Mar 2016 21:00:32 -0700") Date: Sat, 26 Mar 2016 16:58:05 -0700 Message-ID: <m2k2kordv6.fsf@HIDDEN> References: <m2fuvosae7.wl%esq@HIDDEN> User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.92 (darwin) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.7 (/) >>>>> Keith David Bershatsky <esq@HIDDEN> writes: > That was the last of the known problems with fake cursors, so the next phase > will be for me to try it out with a custom minor mode over the next few > weeks to see what else may be needed. The current draft patch has been > lightly tested on Emacs for all three (3) window systems -- X11 (no > toolkit), Windows (XP SP-3), and OSX (10.6.8). Thanks for carrying forward with this research, Keith! -- John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: Can we support multiple Cursors? References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Tue, 29 Mar 2016 03:46:02 +0000 Resent-Message-ID: <handler.22873.B22873.145922311923394 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22873 <at> debbugs.gnu.org Cc: John Wiegley <jwiegley@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>, Marcin Borkowski <mbork@HIDDEN>, Richard Stallman <rms@HIDDEN> Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.145922311923394 (code B ref 22873); Tue, 29 Mar 2016 03:46:02 +0000 Received: (at 22873) by debbugs.gnu.org; 29 Mar 2016 03:45:19 +0000 Received: from localhost ([127.0.0.1]:42704 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1akkak-00065G-LY for submit <at> debbugs.gnu.org; Mon, 28 Mar 2016 23:45:18 -0400 Received: from cobb.liquidweb.com ([50.28.13.150]:55666) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1akkai-000654-QA for 22873 <at> debbugs.gnu.org; Mon, 28 Mar 2016 23:45:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date; bh=5Ph/CdErNKMUcQyrUN0Dn562IZaTv4Z7RMs5OGDlO8Q=; b=kQiw1olgOWUOOOCPFX+1N+7Kf/lvaT1BdYUzviJegMGoxlg8SyasZehb3ln7yoKChI5crwpE6IqtPB/n2m7InR7gbduq0ryV7bfIMhW9YCKe1vAht7AxOzmFZ3+/ZDRf; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:55279 helo=server.local.localhost) by cobb.liquidweb.com with esmtp (Exim 4.82) (envelope-from <esq@HIDDEN>) id 1akkaX-0002yf-RZ; Mon, 28 Mar 2016 23:45:06 -0400 Date: Mon, 28 Mar 2016 20:45:07 -0700 Message-ID: <m2mvpiymkc.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 (generated by - "") Content-Type: multipart/mixed; boundary="Multipart_Mon_Mar_28_20:45:06_2016-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cobb.liquidweb.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-Get-Message-Sender-Via: cobb.liquidweb.com: acl_c_relayhosts_text_entry: lawlist|lawlist.com X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.7 (/) --Multipart_Mon_Mar_28_20:45:06_2016-1 Content-Type: text/plain; charset=US-ASCII The attached multiple_cursors_007.diff applies to the master branch as of today, March 28, 2016, bearing commit a30e7e12ed8465e2565dd318d921bc87f52ce18e. mc_calc now runs from the applicable nsterm.m/w32term.c/xterm.c, instead of xdisp.c. mc-calc has been broken down into 3 distinct sections, rather than if / if else / if else. A bool argument has been added to mc_calc -- true for remove/cleanup, false for draw fake cursors. The real cursor is redrawn if mc-list is set to Qnil (just in case it got erased during cleanup). I do not believe mc_calc needs to run inside xdisp.c where draw_window_cursor is called at either location. I've lightly tested this patch on Windows (XP SP-3), X11 (on an OSX box), and OSX (10.6.8). I've switched over my own in-house setup to use this latest patch and I will be making notes of any problems as they arise -- e.g., I see there are a few rare instances where some of the fake cursors are not getting erased on OSX, and I see that Windows is a little slow drawing fake cursors when dealing with about 50 on the screen [I'm testing in a virtual machine called Parallels). My primary usage of fake cursors is a vertical line that tracks the cursor position (compatible with word-wrap), and my secondary usage is with Magnar's library. The usage of this patch is as follows: (defun mc-test (&optional list) "Draw fake cursors at all POS defined in the `mc-list'. Multiple fake cursors are supported by GUI versions of Emacs built for X, Windows and OSX. Color vector is LSL (The Linden Scripting Language), rather than standard RGB. `nsterm.m' uses `NSColor', which works well with LSL. `w32term.c' uses `PALETTERGB' or `RGB', and the conversion from LSL is done internally by multiplying each element of the LSL color vector by 255. `xterm.c' uses `x_make_truecolor_pixel', which uses 16-bit RGB -- the conversion from LSL happens internally by multiplying each element of the LSL color vector by 65535." (interactive) (setq mc-list (if list list '( (3 "hbar" [1.0 0.0 0.0]) (4 "bar" [0.0 1.0 0.0]) (5 "box" [0.0 0.0 1.0]) (6 "hollow" [0.8 0.4 0.2]) (7 ("hbar" 3) [1.0 0.0 1.0]) (8 ("bar" 3) [0.0 1.0 1.0]))))) (global-set-key [f1] 'mc-test) For anyone interested in trying out this latest patch with Magnar's library, the following are the only modifications that I am are of that would be needed (as of today, 03/28/2016) -- blue colored bar cursor for even numbered columns, red colored bar cursor for odd numbered columns. One of the nifty things I see is that these fake cursors work well when placed at the very end of a line. (require 'multiple-cursors) (defun mc/clear-mc-list () (setq mc-list nil)) (add-hook 'multiple-cursors-mode-disabled-hook 'mc/clear-mc-list) (defun mc/create-fake-cursor-at-point (&optional id) "Add a fake cursor and possibly a fake active region overlay based on point and mark. Saves the current state in the overlay to be restored later." (unless mc--max-cursors-original (setq mc--max-cursors-original mc/max-cursors)) (when mc/max-cursors (unless (< (mc/num-cursors) mc/max-cursors) (if (yes-or-no-p (format "%d active cursors. Continue? " (mc/num-cursors))) (setq mc/max-cursors (read-number "Enter a new, temporary maximum: ")) (mc/remove-fake-cursors) (error "Aborted: too many cursors")))) (let ((overlay (make-overlay (point) (point)))) (overlay-put overlay 'mc-id (or id (mc/create-cursor-id))) (overlay-put overlay 'type 'fake-cursor) (overlay-put overlay 'priority 100) (mc/store-current-state-in-overlay overlay) (when (use-region-p) (overlay-put overlay 'region-overlay (mc/make-region-overlay-between-point-and-mark))) (let* ( (overlays (mc/all-fake-cursors)) (lst (mapcar (lambda (x) (save-excursion (let* ( current-column (pos (overlay-start x))) (goto-char pos) (setq current-column (current-column)) (cond ((oddp current-column) (list pos "bar" [1.0 0.0 0.0])) ;; red ((evenp current-column) (list pos "bar" [0.0 0.0 1.0])))))) ;; blue overlays)) ) (setq mc-list lst)) overlay)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; --Multipart_Mon_Mar_28_20:45:06_2016-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="multiple_cursors_007.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3NyYy9idWZmZXIuYyBiL3NyYy9idWZmZXIuYwppbmRleCA2MmIwYmM4Li4w NTk2MWVmIDEwMDY0NAotLS0gYS9zcmMvYnVmZmVyLmMKKysrIGIvc3JjL2J1ZmZlci5jCkBAIC01 MDczLDYgKzUwNzMsNyBAQCBpbml0X2J1ZmZlcl9vbmNlICh2b2lkKQogICBYU0VURkFTVElOVCAo QlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgZGlzcGxheV90YWJsZSksIGlkeCk7ICsraWR4Owog ICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgc3ludGF4X3RhYmxlKSwg aWR4KTsgKytpZHg7CiAgIFhTRVRGQVNUSU5UIChCVkFSICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBj YWNoZV9sb25nX3NjYW5zKSwgaWR4KTsgKytpZHg7CisgIFhTRVRGQVNUSU5UIChCVkFSICgmYnVm ZmVyX2xvY2FsX2ZsYWdzLCBtY19saXN0KSwgaWR4KTsgKytpZHg7CiAgIFhTRVRGQVNUSU5UIChC VkFSICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBjYXRlZ29yeV90YWJsZSksIGlkeCk7ICsraWR4Owog ICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgYmlkaV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ICAmJiAh TUlOSV9XSU5ET1dfUCAodykpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoTklMUCAoQlZBUiAo Y3VycmVudF9idWZmZXIsIG1jX2xpc3QpKSAmJiB3LT5tY19jYWNoZSkKKyAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgbWNfY2FsYyAodywgMSk7IC8qIFJlbW92ZSBmYWtlIGN1cnNvcnMuICAq LworICAgICAgICAgICAgICBpZiAoY3Vyc29yX29uX3ApIC8qIFJlZHJhdyByZWFsIGN1cnNvci4g ICovCisgICAgICAgICAgICAgICAgZGlzcGxheV9hbmRfc2V0X2N1cnNvciAodywgMSwKKyAgICAg ICAgICAgICAgICAgIHctPm91dHB1dF9jdXJzb3IuaHBvcywgdy0+b3V0cHV0X2N1cnNvci52cG9z LAorICAgICAgICAgICAgICAgICAgdy0+b3V0cHV0X2N1cnNvci54LCB3LT5vdXRwdXRfY3Vyc29y LnkpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBtY19j YWxjICh3LCAwKTsgLyogRHJhdyBmYWtlIGN1cnNvcnMgICovCisgICAgICAgIH0KKwogICAgICAg aWYgKGRyYXdfd2luZG93X2ZyaW5nZXMgKHcsIDEpKQogCXsKIAkgIGlmIChXSU5ET1dfUklHSFRf RElWSURFUl9XSURUSCAodykpCkBAIC0yODExLDcgKzI4MjksNyBAQCBzdGF0aWMgdm9pZCBoaWRl X2JlbGwgKCkKIHN0YXRpYyB2b2lkCiBuc19kcmF3X3dpbmRvd19jdXJzb3IgKHN0cnVjdCB3aW5k b3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKmdseXBoX3JvdywKIAkJICAgICAgIGludCB4LCBpbnQg eSwgZW51bSB0ZXh0X2N1cnNvcl9raW5kcyBjdXJzb3JfdHlwZSwKLQkJICAgICAgIGludCBjdXJz b3Jfd2lkdGgsIGJvb2wgb25fcCwgYm9vbCBhY3RpdmVfcCkKKwkJICAgICAgIGludCBjdXJz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0aGUgYG1jLWxpc3QnIGhhcyBqdXN0IGJlZW4KKyAg ICAgIHNldCB0byBgUW5pbCcsIHRoZW4gcmVtb3ZlIGZha2UgY3Vyc29ycyBhbmQgcmVkcmF3IHRo ZSByZWFsIGN1cnNvci4gICovCisgICAgICBpZiAoKCFOSUxQIChCVkFSIChjdXJyZW50X2J1ZmZl ciwgbWNfbGlzdCkpIHx8IHctPm1jX2NhY2hlKQorICAgICAgICAgICYmICFNSU5JX1dJTkRPV19Q ICh3KSkKKyAgICAgICAgeworICAgICAgICAgIGlmIChOSUxQIChCVkFSIChjdXJyZW50X2J1ZmZl ciwgbWNfbGlzdCkpICYmIHctPm1jX2NhY2hlKQorICAgICAgICAgICAgeworICAgICAgICAgICAg ICBtY19jYWxjICh3LCAxKTsgLyogUmVtb3ZlIGZha2UgY3Vyc29ycy4gICovCisgICAgICAgICAg ICAgIGlmIChjdXJzb3Jfb25fcCkgLyogUmVkcmF3IHJlYWwgY3Vyc29yLiAgKi8KKyAgICAgICAg ICAgICAgICBkaXNwbGF5X2FuZF9zZXRfY3Vyc29yICh3LCAxLAorICAgICAgICAgICAgICAgICAg dy0+b3V0cHV0X2N1cnNvci5ocG9zLCB3LT5vdXRwdXRfY3Vyc29yLnZwb3MsCisgICAgICAgICAg ICAgICAgICB3LT5vdXRwdXRfY3Vyc29yLngsIHctPm91dHB1dF9jdXJzb3IueSk7CisgICAgICAg ICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIG1jX2NhbGMgKHcsIDApOyAv KiBEcmF3IGZha2UgY3Vyc29ycyAgKi8KKyAgICAgICAgfQorCiAgICAgICBpZiAoZHJhd193aW5k b3dfZnJpbmdlcyAodywgdHJ1ZSkpCiAJewogCSAgaWYgKFdJTkRPV19SSUdIVF9ESVZJREVSX1dJ RFRIICh3KSkKQEAgLTkzNSwxMCArOTUzLDEzIEBAIHN0YXRpYyB2b2lkIHczMl9kcmF3X2JveF9y ZWN0IChzdHJ1Y3QgZ2x5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0gMCkKKyAgICAgICAgICAvKiBU ZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4gICov CisgICAgICAgICAgeworICAgICAgICAgICAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5E T1dfRlJBTUUgKHcpKTsKKyAgICAgICAgICAgIENPTE9SUkVGIG9yaWdfdmFsID0gZi0+b3V0cHV0 X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWw7CisgICAgICAgICAgICBpbnQgaW50X3JlZCA9IHJlZCAq IDI1NTsKKyAgICAgICAgICAgIGludCBpbnRfZ3JlZW4gPSBncmVlbiAqIDI1NTsKKyAgICAgICAg ICAgIGludCBpbnRfYmx1ZSA9IGJsdWUgKiAyNTU7CisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0 YS53MzItPmN1cnNvcl9waXhlbCA9IFBBTEVUVEVSR0IgKGludF9yZWQsIGludF9ncmVlbiwgaW50 X2JsdWUpOworICAgICAgICAgICAgeF9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIGdseXBoX3Jvdyk7 CisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9yaWdfdmFs OworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB4X2RyYXdfaG9sbG93 X2N1cnNvciAodywgZ2x5cGhfcm93KTsKKyAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBj YXNlIEZJTExFRF9CT1hfQ1VSU09SOgorICAgICAgeworICAgICAgICAvKiBUT0RPOiAga2RiIHRv IGNvbnNpZGVyIGFkZGluZyBzdXBwb3J0IGZvciBtdWx0aXBsZSBjdXJzb3IgZm9yZWdyb3VuZAor ICAgICAgICBjdXN0b21pemF0aW9uIG9mIGEgRklMTEVEX0JPWF9DVVJTT1IuICAqLworICAgICAg ICBpZiAocmVkID49IDAgJiYgYmx1ZSA+PSAwICYmIGdyZWVuID49IDApCisgICAgICAgICAgLyog VGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycgYnkgYm9y cm93aW5nIHRoZQorICAgICAgICAgIGZ1bmN0aW9uYWxpdHkgb2YgYHhfbWFrZV9nYycgaW4gdzMy Zm5zLmMuICAqLworICAgICAgICAgIHsKKyAgICAgICAgICAgIGJsb2NrX2lucHV0ICgpOworICAg ICAgICAgICAgTGlzcF9PYmplY3Qgd2luZG93ID0gKHNlbGVjdGVkX3dpbmRvdyk7CisgICAgICAg ICAgICBzdHJ1Y3Qgd2luZG93ICp3ID0gZGVjb2RlX2xpdmVfd2luZG93ICh3aW5kb3cpOworICAg ICAgICAgICAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAg ICAgICAgICAgIGludCBpbnRfcmVkID0gcmVkICogMjU1OworICAgICAgICAgICAgaW50IGludF9n cmVlbiA9IGdyZWVuICogMjU1OworICAgICAgICAgICAgaW50IGludF9ibHVlID0gYmx1ZSAqIDI1 NTsKKyAgICAgICAgICAgIFhHQ1ZhbHVlcyBnY192YWx1ZXM7CisgICAgICAgICAgICB1bnNpZ25l ZCBsb25nIG1hc2sgPSBHQ0ZvbnQgfCBHQ0ZvcmVncm91bmQgfCBHQ0JhY2tncm91bmQ7CisgICAg ICAgICAgICBDT0xPUlJFRiBvcmlnX3ZhbF9hID0gRlJBTUVfQkFDS0dST1VORF9QSVhFTCAoZik7 CisgICAgICAgICAgICBDT0xPUlJFRiBvcmlnX3ZhbF9iID0gZi0+b3V0cHV0X2RhdGEudzMyLT5j dXJzb3JfcGl4ZWw7CisgICAgICAgICAgICBnY192YWx1ZXMuZm9udCA9IEZSQU1FX0ZPTlQgKGYp OworICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBGUkFNRV9CQUNLR1JPVU5EX1BJ WEVMIChmKTsKKyAgICAgICAgICAgIGdjX3ZhbHVlcy5iYWNrZ3JvdW5kID0gUEFMRVRURVJHQiAo aW50X3JlZCwgaW50X2dyZWVuLCBpbnRfYmx1ZSk7CisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0 YS53MzItPmN1cnNvcl9nYworICAgICAgICAgICAgICA9IFhDcmVhdGVHQyAoTlVMTCwgRlJBTUVf VzMyX1dJTkRPVyAoZiksIG1hc2ssICZnY192YWx1ZXMpOworICAgICAgICAgICAgLyogV2hlbiBg dy0+bWMuc2V0X2N1cnNvcl9nYyA9IHRydWUnLCBmb3JjZSBgeF9zZXRfY3Vyc29yX2djJyB0bwor ICAgICAgICAgICAgdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycuICAqLwor ICAgICAgICAgICAgdy0+bWMuc2V0X2N1cnNvcl9nYyA9IHRydWU7CisgICAgICAgICAgICBkcmF3 X3BoeXNfY3Vyc29yX2dseXBoICh3LCBnbHlwaF9yb3csIERSQVdfQ1VSU09SKTsKKyAgICAgICAg ICAgIHctPm1jLnNldF9jdXJzb3JfZ2MgPSBmYWxzZTsKKyAgICAgICAgICAgIGdjX3ZhbHVlcy5m b250ID0gRlJBTUVfRk9OVCAoZik7CisgICAgICAgICAgICBnY192YWx1ZXMuZm9yZWdyb3VuZCA9 IG9yaWdfdmFsX2E7CisgICAgICAgICAgICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IG9yaWdfdmFs X2I7CisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYworICAgICAgICAg ICAgICA9IFhDcmVhdGVHQyAoTlVMTCwgRlJBTUVfVzMyX1dJTkRPVyAoZiksIG1hc2ssICZnY192 YWx1ZXMpOworICAgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICB9CisgICAg ICAgICAgZWxzZQorICAgICAgICAgICAgZHJhd19waHlzX2N1cnNvcl9nbHlwaCAodywgZ2x5cGhf cm93LCBEUkFXX0NVUlNPUik7CisgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgY2FzZSBC QVJfQ1VSU09SOgorICAgICAgeworICAgICAgICBpZiAocmVkID49IDAgJiYgYmx1ZSA+PSAwICYm IGdyZWVuID49IDApCisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRf ZGF0YS53MzItPmN1cnNvcl9waXhlbCcuICAqLworICAgICAgICAgIHsKKyAgICAgICAgICAgIHN0 cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7CisgICAgICAgICAgICBD T0xPUlJFRiBvcmlnX3ZhbCA9IGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsOworICAg ICAgICAgICAgaW50IGludF9yZWQgPSByZWQgKiAyNTU7CisgICAgICAgICAgICBpbnQgaW50X2dy ZWVuID0gZ3JlZW4gKiAyNTU7CisgICAgICAgICAgICBpbnQgaW50X2JsdWUgPSBibHVlICogMjU1 OworICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBQQUxFVFRF UkdCIChpbnRfcmVkLCBpbnRfZ3JlZW4sIGludF9ibHVlKTsKKyAgICAgICAgICAgIHhfZHJhd19i YXJfY3Vyc29yICh3LCBnbHlwaF9yb3csIGN1cnNvcl93aWR0aCwgQkFSX0NVUlNPUik7CisgICAg ICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9yaWdfdmFsOworICAg ICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB4X2RyYXdfYmFyX2N1cnNvciAo dywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEJBUl9DVVJTT1IpOworICAgICAgICBicmVhazsK KyAgICAgIH0KKyAgICAgIGNhc2UgSEJBUl9DVVJTT1I6CisgICAgICB7CisgICAgICAgIGlmIChy ZWQgPj0gMCAmJiBibHVlID49IDAgJiYgZ3JlZW4gPj0gMCkKKyAgICAgICAgICAvKiBUZW1wb3Jh cmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAg ICAgICAgeworICAgICAgICAgICAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJB TUUgKHcpKTsKKyAgICAgICAgICAgIENPTE9SUkVGIG9yaWdfdmFsID0gZi0+b3V0cHV0X2RhdGEu dzMyLT5jdXJzb3JfcGl4ZWw7CisgICAgICAgICAgICBpbnQgaW50X3JlZCA9IHJlZCAqIDI1NTsK KyAgICAgICAgICAgIGludCBpbnRfZ3JlZW4gPSBncmVlbiAqIDI1NTsKKyAgICAgICAgICAgIGlu dCBpbnRfYmx1ZSA9IGJsdWUgKiAyNTU7CisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzIt PmN1cnNvcl9waXhlbCA9IFBBTEVUVEVSR0IgKGludF9yZWQsIGludF9ncmVlbiwgaW50X2JsdWUp OworICAgICAgICAgICAgeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIGdseXBoX3JvdywgY3Vyc29yX3dp ZHRoLCBIQkFSX0NVUlNPUik7CisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNv cl9waXhlbCA9IG9yaWdfdmFsOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAg ICAgICB4X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEhCQVJf Q1VSU09SKTsKKyAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICBjYXNlIE5PX0NVUlNPUjoK KyAgICAgICAgdy0+cGh5c19jdXJzb3Jfd2lkdGggPSAwOworICAgICAgICBicmVhazsKKyAgICAg IGRlZmF1bHQ6CisgICAgICAgIGVtYWNzX2Fib3J0ICgpOworICB9CiAgICAgfQogfQogCmRpZmYg LS1naXQgYS9zcmMvd2lu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195LCB3aWR0 aDsKKyAgICAgIGlmICghKHZwb3MgPj0gMAorICAgICAgICAgICYmIHZwb3MgPCB3LT5jdXJyZW50 X21hdHJpeC0+bnJvd3MpKQorICAgICAgICBjdXJzb3JfZ2x5cGggPSBOVUxMOworICAgICAgaWYg KCFjdXJzb3Jfcm93LT5lbmFibGVkX3ApCisgICAgICAgIGN1cnNvcl9nbHlwaCA9IE5VTEw7Cisg ICAgICBpZiAody0+aHNjcm9sbCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFdoZW4gdGhlIHdp bmRvdyBpcyBoc2Nyb2xsZWQsIGN1cnNvciBocG9zIGNhbiBsZWdpdGltYXRlbHkgYmUKKyAgICAg ICAgICAgb3V0IG9mIGJvdW5kcywgYnV0IHdlIGRyYXcgdGhlIGN1cnNvciBhdCB0aGUgY29ycmVz cG9uZGluZworICAgICAgICAgICB3aW5kb3cgbWFyZ2luIGluIHRoYXQgY2FzZS4gICovCisgICAg ICAgICAgaWYgKCFjdXJzb3Jfcm93LT5yZXZlcnNlZF9wICYmIGhwb3MgPCAwKQorICAgICAgICAg ICAgaHBvcyA9IDA7CisgICAgICAgICAgaWYgKGN1cnNvcl9yb3ctPnJldmVyc2VkX3AgJiYgaHBv cyA+PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgICAgICBocG9zID0gY3Vy c29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gMTsKKyAgICAgICAgfQorICAgICAgaWYgKDAgPD0g aHBvcyAmJiBocG9zIDwgY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdKQorICAgICAgICBjdXJz b3JfZ2x5cGggPSBjdXJzb3Jfcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIGhwb3M7CisgICAgICBl bHNlCisgICAgICAgIGN1cnNvcl9nbHlwaCA9IE5VTEw7CisgICAgICBpZiAoY3Vyc29yX2dseXBo ID09IE5VTEwpCisgICAgICAgIGdvdG8gZG9uZTsKKyAgICAgIHdpZHRoID0gY3Vyc29yX2dseXBo LT5waXhlbF93aWR0aDsKKyAgICAgIGhvbGxvd194ID0geDsKKyAgICAgIGlmICh4IDwgMCkKKyAg ICAgICAgeworICAgICAgICAgIHdpZHRoICs9IGhvbGxvd194OworICAgICAgICAgIGhvbGxvd194 ID0gMDsKKyAgICAgICAgfQorICAgICAgd2lkdGggPSBtaW4gKHdpZHRoLCB3aW5kb3dfYm94X3dp ZHRoICh3LCBURVhUX0FSRUEpIC0gaG9sbG93X3gpOworICAgICAgaG9sbG93X3kgPSBXSU5ET1df VE9fRlJBTUVfUElYRUxfWSAodywgbWF4IChoZWFkZXJfbGluZV9oZWlnaHQsIGN1cnNvcl9yb3ct PnkpKTsKKyAgICAgIGhvbGxvd194ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywg aG9sbG93X3gpOworICAgICAgaWYgKHdpZHRoID4gMCkKKyAgICAgICAgRlJBTUVfUklGIChmKS0+ Y2xlYXJfZnJhbWVfYXJlYSAoZiwgaG9sbG93X3gsIGhvbGxvd195LCB3aWR0aCwgY3Vyc29yX3Jv dy0+dmlzaWJsZV9oZWlnaHQpOworICAgIH0KKyAgLyogSWYgY3Vyc29yIGhwb3MgaXMgb3V0IG9m IGJvdW5kcywgZG9uJ3QgZHJhdyBnYXJiYWdlLiAgVGhpcyBjYW4KKyAgICAgaGFwcGVuIGluIG1p bmktYnVmZmVyIHdpbmRvd3Mgd2hlbiBzd2l0Y2hpbmcgYmV0d2VlbiBlY2hvIGFyZWEKKyAgICAg Z2x5cGhzIGFuZCBtaW5pLWJ1ZmZlci4gICovCisgIGlmICgoY3Vyc29yX3Jvdy0+cmV2ZXJzZWRf cAorICAgICAgID8gKGhwb3MgPj0gMCkKKyAgICAgICA6IChocG9zIDwgY3Vyc29yX3Jvdy0+dXNl ZFtURVhUX0FSRUFdKSkpCisgICAgeworICAgICAgaW50IHgxOworICAgICAgLyogV2hlbiB0aGUg d2luZG93IGlzIGhzY3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PYmplY3QKK21jX3hfeV9ocG9z X3Zwb3MgKHN0cnVjdCB3aW5kb3cgKncsIEVNQUNTX0lOVCBwb3NpbnQpCit7CisgIHN0cnVjdCBp dCBpdDsKKyAgdm9pZCAqaXRkYXRhID0gYmlkaV9zaGVsdmVfY2FjaGUgKCk7CisgIHN0cnVjdCB0 ZXh0X3BvcyBwdCwgcG9zOworICBpbnQgeCwgeSwgaHBvcywgdnBvczsKKyAgaWYgKHctPm1jLnN0 YXJ0CisgICAgICAmJiB3LT5tYy5lbmQKKyAgICAgICYmIHBvc2ludCA+PSB3LT5tYy5zdGFydAor ICAgICAgJiYgcG9zaW50IDw9IHctPm1jLmVuZCkKKyAgICB7CisgICAgICBTRVRfVEVYVF9QT1Nf RlJPTV9NQVJLRVIgKHB0LCB3LT5zdGFydCk7CisgICAgICBzdGFydF9kaXNwbGF5ICgmaXQsIHcs IHB0KTsKKyAgICAgIG1vdmVfaXRfdG8gKCZpdCwgcG9zaW50LCAtMSwgLTEsIC0xLCBNT1ZFX1RP X1BPUyk7CisgICAgICBwb3MgPSBpdC5jdXJyZW50LnBvczsKKyAgICAgIHggPSBpdC5jdXJyZW50 X3g7CisgICAgICB5ID0gaXQuY3VycmVudF95OworICAgICAgaHBvcyA9IGl0Lmhwb3M7CisgICAg ICB2cG9zID0gaXQudnBvczsKKyAgICAgIGJpZGlfdW5zaGVsdmVfY2FjaGUgKGl0ZGF0YSwgZmFs c2UpOworICAgIH0KKyAgICBlbHNlCisgICAgICB7CisgICAgICAgIHggPSAtMTsKKyAgICAgICAg eSA9IC0xOworICAgICAgICBocG9zID0gLTE7CisgICAgICAgIHZwb3MgPSAtMTsKKyAgICAgIH0K KyAgcmV0dXJuIGxpc3RuIChDT05TVFlQRV9QVVJFLCA0LCBtYWtlX251bWJlciAoeCksIG1ha2Vf bnVtYmVyICh5KSwgbWFrZV9udW1iZXIgKGhwb3MpLCBtYWtlX251bWJlciAodnBvcykpOworfQor CitpbnQKK21jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKExpc3BfT2JqZWN0IGFyZykKK3sKKyAgY2hh ciAqc3RyOworICBpZiAoWFRZUEUgKGFyZykgPT0gTGlzcF9TdHJpbmcpCisgICAgc3RyID0gU1NE QVRBIChhcmcpOworICBlbHNlIGlmIChYVFlQRSAoYXJnKSA9PSBMaXNwX1N5bWJvbCkKKyAgICBz dHIgPSBTU0RBVEEgKFNZTUJPTF9OQU1FIChhcmcpKTsKKyAgZWxzZSByZXR1cm4gLTE7CisgIGlm ICghc3RyY21wIChzdHIsICJib3giKSkKKyAgICByZXR1cm4gRklMTEVEX0JPWF9DVVJTT1I7Cisg IGlmICghc3RyY21wIChzdHIsICJob2xsb3ciKSkKKyAgICByZXR1cm4gSE9MTE9XX0JPWF9DVVJT T1I7CisgIGlmICghc3RyY21wIChzdHIsICJoYmFyIikpCisgICAgcmV0dXJuIEhCQVJfQ1VSU09S OworICBpZiAoIXN0cmNtcCAoc3RyLCAiYmFyIikpCisgICAgcmV0dXJuIEJBUl9DVVJTT1I7Cisg IGlmICghc3RyY21wIChzdHIsICJubyIpKQorICAgIHJldHVybiBOT19DVVJTT1I7CisgIHJldHVy biAtMTsKK30KKworLyogRVhBTVBMRSAjMToKKyAgICAoc2V0cSBtYy1saXN0ICcoCisgICAgICAo MyAiaGJhciIgWzEuMCAwLjAgMC4wXSkKKyAgICAgICg0ICJiYXIiIFswLjAgMS4wIDAuMF0pCisg ICAgICAoNSAiYm94IiBbMC4wIDAuMCAxLjBdKQorICAgICAgKDYgImhvbGxvdyIgWzAuOCAwLjQg MC4yXSkKKyAgICAgICg3ICgiaGJhciIgMykgWzEuMCAwLjAgMS4wXSkKKyAgICAgICg4ICgiYmFy IiAzKSBbMC4wIDEuMCAxLjBdKSkpCisgICBFWEFNUExFICMyOiAgKHNldHEgbWMtbGlzdCBuaWwp CitUaGUgYG1jX2NhY2hlJyBpcyBrZXB0IGluIHRoZSBmb2xsb3dpbmcgZXhhbXBsZSBmb3JtYXQ6 CisgICg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2VfbnVt YmVyIChCRUdWKSwgbWFrZV9udW1iZXIgKFpWKSk7CisgICAgIExpc3BfT2JqZWN0IHRlbXBfbGlz dCA9IFFuaWw7CisgICAgIExpc3BfT2JqZWN0IG5ld19saXN0ID0gUW5pbDsKKyAgICAgTGlzcF9P YmplY3Qgb3YgPSBRbmlsOworICAgICBwdHJkaWZmX3Qgb3Zfc3RhcnQ7CisgICAgIExpc3BfT2Jq ZWN0IG92X3R5cGUgPSBRbmlsOworICAgICBMaXNwX09iamVjdCBvdl9saXN0ID0gUW5pbDsKKyAg ICAgTGlzcF9PYmplY3QgdHlwZSA9IGludGVybiAoInR5cGUiKTsKKyAgICAgTGlzcF9PYmplY3Qg ZmFrZV9jdXJzb3IgPSBpbnRlcm4gKCJmYWtlLWN1cnNvciIpOworICAgICBBVVRPX1NUUklORyAo Zm9ybWF0X29uZSwgIm92ZXJsYXlzOiAgJXMiKTsKKyAgICAgQ0FMTE4gKEZtZXNzYWdlLCBmb3Jt YXRfb25lLCBvdmVybGF5cyk7CisgICAgIGZvciAob3ZfbGlzdCA9IG92ZXJsYXlzOworICAgICAg ICAgIENPTlNQIChvdl9saXN0KTsKKyAgICAgICAgICBvdl9saXN0ID0gWENEUiAob3ZfbGlzdCkp CisgICAgICAgeworICAgICAgICAgb3YgPSBYQ0FSIChvdl9saXN0KTsKKyAgICAgICAgIG92X3R5 cGUgPSBGb3ZlcmxheV9nZXQgKG92LCB0eXBlKTsKKyAgICAgICAgIGlmIChFUSAob3ZfdHlwZSwg ZmFrZV9jdXJzb3IpKQorICAgICAgICAgeworICAgICAgICAgICBvdl9zdGFydCA9IG1ha2VfbnVt YmVyIChPVkVSTEFZX1BPU0lUSU9OIChPVkVSTEFZX1NUQVJUIChvdikpKTsKKyAgICAgICAgICAg dGVtcF9saXN0ID0gbGlzdG4gKENPTlNUWVBFX1BVUkUsIDMsCisgICAgICAgICAgICAgb3Zfc3Rh cnQsCisgICAgICAgICAgICAgYnVpbGRfcHVyZV9jX3N0cmluZyAoImJhciIpLAorICAgICAgICAg ICAgIENBTExOIChGdmVjdG9yLCBtYWtlX2Zsb2F0ICgwLjApLCBtYWtlX2Zsb2F0ICgwLjApLCBt YWtlX2Zsb2F0ICgxLjApKSk7CisgICAgICAgICAgIEFVVE9fU1RSSU5HIChmb3JtYXRfdHdvLCAi dGVtcF9saXN0OiAgJXMiKTsKKyAgICAgICAgICAgQ0FMTE4gKEZtZXNzYWdlLCBmb3JtYXRfdHdv LCB0ZW1wX2xpc3QpOworICAgICAgICAgICBuZXdfbGlzdCA9IEZjb25zICh0ZW1wX2xpc3QsIG5l d19saXN0KTsKKyAgICAgICAgIH0KKyAgICAgICB9CisgICAgIEFVVE9fU1RSSU5HIChmb3JtYXRf dGhyZWUsICJuZXdfbGlzdDogICVzIik7CisgICAgIENBTExOIChGbWVzc2FnZSwgZm9ybWF0X3Ro cmVlLCBuZXdfbGlzdCk7CisgICAgIGlmICghTklMUCAobmV3X2xpc3QpKQorICAgICAgIGJzZXRf bWNfbGlzdCAoY3VycmVudF9idWZmZXIsIG5ld19saXN0KTsgICovCisKKyAgaWYgKHJlbW92ZQor ICAgICAgfHwgKHctPm1jX2NhY2hlICYmIE5JTFAgKEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBtY19s aXN0KSkpCisgICAgICB8fCAody0+bWNfY2FjaGUgJiYgIU5JTFAgKEJWQVIgKGN1cnJlbnRfYnVm ZmVyLCBtY19saXN0KSkgJiYgdyAhPSBzdykpCisgICAgeworI2lmZGVmIEdMWVBIX0RFQlVHCisg IGRlYnVnX21ldGhvZF9hZGQgKHcsICJtY19jYWxjOiAgcmVtb3ZlIGN1cnNvcnMgdXNpbmcgY2Fj aGUiKTsKKyNlbmRpZgorICAgICAgZm9yICh2bGlzdCA9IFhDQVIgKFhDRFIgKHctPm1jX2NhY2hl KSk7CisgICAgICAgICAgIENPTlNQICh2bGlzdCk7CisgICAgICAgICAgIHZsaXN0ID0gWENEUiAo dmxpc3QpKQorICAgICAgICB7CisgICAgICAgICAgY3Vyc29yX3NwZWNfbGlzdCA9IFhDQVIgKFhD QVIgKHZsaXN0KSk7CisgICAgICAgICAgcG9zaW50ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIg KDApLCBjdXJzb3Jfc3BlY19saXN0KSk7CisgICAgICAgICAgY3Vyc29yX3NwZWNfdHlwZSA9IEZu dGggKG1ha2VfbnVtYmVyICgxKSwgY3Vyc29yX3NwZWNfbGlzdCk7CisgICAgICAgICAgaWYgKENP TlNQIChjdXJzb3Jfc3BlY190eXBlKSkKKyAgICAgICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlz cF90b19jdXJzb3JfdHlwZSAoWENBUiAoY3Vyc29yX3NwZWNfdHlwZSkpOworICAgICAgICAgICAg ZWxzZQorICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUg KGN1cnNvcl9zcGVjX3R5cGUpOworICAgICAgICAgIGlmIChDT05TUCAoY3Vyc29yX3NwZWNfdHlw ZSkpCisgICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSBYSU5UIChYQ0FSIChYQ0RSIChjdXJzb3Jf c3BlY190eXBlKSkpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBjdXJzb3Jfd2lk dGggPSAxOworICAgICAgICAgIGN1cnNvcl9jb2xvcl92ZWN0b3IgPSBGbnRoIChtYWtlX251bWJl ciAoMiksIGN1cnNvcl9zcGVjX2xpc3QpOworICAgICAgICAgIHJlZCA9IFhGTE9BVF9EQVRBIChB UkVGIChjdXJzb3JfY29sb3JfdmVjdG9yLCAwKSk7CisgICAgICAgICAgZ3JlZW4gPSBYRkxPQVRf REFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3RvciwgMSkpOworICAgICAgICAgIGJsdWUgPSBY RkxPQVRfREFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3RvciwgMikpOworICAgICAgICAgIGlm IChwb3NpbnQKKyAgICAgICAgICAgICAgJiYgcG9zaW50ICE9IFBUICAvKiBQcm90ZWN0IHRoZSBy ZWFsIGN1cnNvciBmcm9tIGJlaW5nIGVyYXNlZC4gICovCisgICAgICAgICAgICAgICYmIHctPm1j LnN0YXJ0CisgICAgICAgICAgICAgICYmIHctPm1jLmVuZAorICAgICAgICAgICAgICAmJiBwb3Np bnQgPj0gdy0+bWMuc3RhcnQKKyAgICAgICAgICAgICAgJiYgcG9zaW50IDw9IHctPm1jLmVuZCkK KyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgeF95X2hwb3NfdnBvc19saXN0ID0gWENBUiAo WENEUiAoWENBUiAodmxpc3QpKSk7CisgICAgICAgICAgICAgIHggPSBYSU5UIChGbnRoIChtYWtl X251bWJlciAoMCksIHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAgICAgICB5ID0gWElO VCAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAg ICAgICAgaHBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgeF95X2hwb3NfdnBvc19s aXN0KSk7CisgICAgICAgICAgICAgIHZwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMyks IHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAgICAgICBtY19lcmFzZSAodywgeCwgeSwg aHBvcywgdnBvcywgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcmVkLCBncmVlbiwgYmx1ZSk7 CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIHctPm1jX2NhY2hlID0gUW5pbDsKKyAg ICB9CisKKyAgaWYgKCFyZW1vdmUKKyAgICAgICYmIHcgPT0gc3cKKyAgICAgICYmIHctPm1jLnN0 YXJ0CisgICAgICAmJiB3LT5tYy5lbmQKKyAgICAgICYmIHctPm1jLnByZXZfc3RhcnQKKyAgICAg ICYmIHctPm1jLnByZXZfZW5kCisgICAgICAmJiB3LT5tYy5zdGFydCA9PSB3LT5tYy5wcmV2X3N0 YXJ0CisgICAgICAmJiB3LT5tYy5lbmQgPT0gdy0+bWMucHJldl9lbmQKKyAgICAgICYmICFOSUxQ IChCVkFSIChjdXJyZW50X2J1ZmZlciwgbWNfbGlzdCkpCisgICAgICAmJiB3LT5tY19jYWNoZQor ICAgICAgJiYgIU5JTFAgKEZlcXVhbCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB3LT5tY19jYWNo ZSksIEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBtY19saXN0KSkpKQorICAgIHsKKyNpZmRlZiBHTFlQ SF9ERUJVRworICBkZWJ1Z19tZXRob2RfYWRkICh3LCAibWNfY2FsYzogIGRyYXcgY3Vyc29ycyB1 c2luZyBjYWNoZSIpOworI2VuZGlmCisgICAgICBmb3IgKHZsaXN0ID0gWENBUiAoWENEUiAody0+ bWNfY2FjaGUpKTsKKyAgICAgICAgICAgQ09OU1AgKHZsaXN0KTsKKyAgICAgICAgICAgdmxpc3Qg PSBYQ0RSICh2bGlzdCkpCisgICAgICAgIHsKKyAgICAgICAgICBjdXJzb3Jfc3BlY19saXN0ID0g WENBUiAoWENBUiAodmxpc3QpKTsKKyAgICAgICAgICBwb3NpbnQgPSBYSU5UIChGbnRoIChtYWtl X251bWJlciAoMCksIGN1cnNvcl9zcGVjX2xpc3QpKTsKKyAgICAgICAgICBjdXJzb3Jfc3BlY190 eXBlID0gRm50aCAobWFrZV9udW1iZXIgKDEpLCBjdXJzb3Jfc3BlY19saXN0KTsKKyAgICAgICAg ICBpZiAoQ09OU1AgKGN1cnNvcl9zcGVjX3R5cGUpKQorICAgICAgICAgICAgY3Vyc29yX3R5cGUg PSBtY19saXNwX3RvX2N1cnNvcl90eXBlIChYQ0FSIChjdXJzb3Jfc3BlY190eXBlKSk7CisgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJz b3JfdHlwZSAoY3Vyc29yX3NwZWNfdHlwZSk7CisgICAgICAgICAgaWYgKENPTlNQIChjdXJzb3Jf c3BlY190eXBlKSkKKyAgICAgICAgICAgIGN1cnNvcl93aWR0aCA9IFhJTlQgKFhDQVIgKFhDRFIg KGN1cnNvcl9zcGVjX3R5cGUpKSk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGN1 cnNvcl93aWR0aCA9IDE7CisgICAgICAgICAgY3Vyc29yX2NvbG9yX3ZlY3RvciA9IEZudGggKG1h a2VfbnVtYmVyICgyKSwgY3Vyc29yX3NwZWNfbGlzdCk7CisgICAgICAgICAgcmVkID0gWEZMT0FU X0RBVEEgKEFSRUYgKGN1cnNvcl9jb2xvcl92ZWN0b3IsIDApKTsKKyAgICAgICAgICBncmVlbiA9 IFhGTE9BVF9EQVRBIChBUkVGIChjdXJzb3JfY29sb3JfdmVjdG9yLCAxKSk7CisgICAgICAgICAg Ymx1ZSA9IFhGTE9BVF9EQVRBIChBUkVGIChjdXJzb3JfY29sb3JfdmVjdG9yLCAyKSk7CisgICAg ICAgICAgaWYgKHBvc2ludAorICAgICAgICAgICAgICAmJiB3LT5tYy5zdGFydAorICAgICAgICAg ICAgICAmJiB3LT5tYy5lbmQKKyAgICAgICAgICAgICAgJiYgcG9zaW50ID49IHctPm1jLnN0YXJ0 CisgICAgICAgICAgICAgICYmIHBvc2ludCA8PSB3LT5tYy5lbmQpCisgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgIHhfeV9ocG9zX3Zwb3NfbGlzdCA9IFhDQVIgKFhDRFIgKFhDQVIgKHZsaXN0 KSkpOworICAgICAgICAgICAgICB4ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB4X3lf aHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAgeSA9IFhJTlQgKEZudGggKG1ha2VfbnVt YmVyICgxKSwgeF95X2hwb3NfdnBvc19saXN0KSk7CisgICAgICAgICAgICAgIGhwb3MgPSBYSU5U IChGbnRoIChtYWtlX251bWJlciAoMiksIHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAg ICAgICB2cG9zID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDMpLCB4X3lfaHBvc192cG9zX2xp c3QpKTsKKyAgICAgICAgICAgICAgbWNfZHJhdyAodywgeCwgeSwgaHBvcywgdnBvcywgY3Vyc29y X3R5cGUsIGN1cnNvcl93aWR0aCwgcmVkLCBncmVlbiwgYmx1ZSk7CisgICAgICAgICAgICB9Cisg ICAgICAgIH0KKyAgICB9CisKKyAgaWYgKCFyZW1vdmUKKyAgICAgICYmIHcgPT0gc3cKKyAgICAg ICYmIHctPm1jLnN0YXJ0CisgICAgICAmJiB3LT5tYy5lbmQKKyAgICAgICYmICFOSUxQIChCVkFS IChjdXJyZW50X2J1ZmZlciwgbWNfbGlzdCkpCisgICAgICAmJiAoIXctPm1jX2NhY2hlCisgICAg ICAgICAgfHwKKyAgICAgICAgICBOSUxQIChGZXF1YWwgKEZudGggKG1ha2VfbnVtYmVyICgwKSwg dy0+bWNfY2FjaGUpLCBCVkFSIChjdXJyZW50X2J1ZmZlciwgbWNfbGlzdCkpKSkpCisgICAgewor I2lmZGVmIEdMWVBIX0RFQlVHCisgIGRlYnVnX21ldGhvZF9hZGQgKHcsICJtY19jYWxjOiAgZHJh dyBjdXJzb3JzIGFuZXciKTsKKyNlbmRpZgorICAgICAgLyogRXJhc2UgYWxsIG9mIHRoZSBvbGQg Y3Vyc29ycyBhdCB0aGUgcHJldmlvdXNseSByZWNvcmRlZCB4L3kvaHBvcy92cG9zIGV2ZW4KKyAg ICAgIHRob3VnaCB0aGUgY29ycmVzcG9uZGluZyBgcG9zaW50JyBoYXMgY2hhbmdlZC4gICovCisg ICAgICBpZiAody0+bWNfY2FjaGUpCisgICAgICAgIHsKKyAgICAgICAgICBmb3IgKHZsaXN0ID0g WENBUiAoWENEUiAody0+bWNfY2FjaGUpKTsKKyAgICAgICAgICAgICAgIENPTlNQICh2bGlzdCk7 CisgICAgICAgICAgICAgICB2bGlzdCA9IFhDRFIgKHZsaXN0KSkKKyAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgY3Vyc29yX3NwZWNfbGlzdCA9IFhDQVIgKFhDQVIgKHZsaXN0KSk7CisgICAg ICAgICAgICAgIHBvc2ludCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgwKSwgY3Vyc29yX3Nw ZWNfbGlzdCkpOworICAgICAgICAgICAgICBjdXJzb3Jfc3BlY190eXBlID0gRm50aCAobWFrZV9u dW1iZXIgKDEpLCBjdXJzb3Jfc3BlY19saXN0KTsKKyAgICAgICAgICAgICAgaWYgKENPTlNQIChj dXJzb3Jfc3BlY190eXBlKSkKKyAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3Bf dG9fY3Vyc29yX3R5cGUgKFhDQVIgKGN1cnNvcl9zcGVjX3R5cGUpKTsKKyAgICAgICAgICAgICAg ICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29y X3R5cGUgKGN1cnNvcl9zcGVjX3R5cGUpOworICAgICAgICAgICAgICBpZiAoQ09OU1AgKGN1cnNv cl9zcGVjX3R5cGUpKQorICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCA9IFhJTlQgKFhDQVIg KFhDRFIgKGN1cnNvcl9zcGVjX3R5cGUpKSk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICAgICAgY3Vyc29yX3dpZHRoID0gMTsKKyAgICAgICAgICAgICAgY3Vyc29yX2NvbG9y X3ZlY3RvciA9IEZudGggKG1ha2VfbnVtYmVyICgyKSwgY3Vyc29yX3NwZWNfbGlzdCk7CisgICAg ICAgICAgICAgIHJlZCA9IFhGTE9BVF9EQVRBIChBUkVGIChjdXJzb3JfY29sb3JfdmVjdG9yLCAw KSk7CisgICAgICAgICAgICAgIGdyZWVuID0gWEZMT0FUX0RBVEEgKEFSRUYgKGN1cnNvcl9jb2xv cl92ZWN0b3IsIDEpKTsKKyAgICAgICAgICAgICAgYmx1ZSA9IFhGTE9BVF9EQVRBIChBUkVGIChj dXJzb3JfY29sb3JfdmVjdG9yLCAyKSk7CisgICAgICAgICAgICAgIHhfeV9ocG9zX3Zwb3NfbGlz dCA9IFhDQVIgKFhDRFIgKFhDQVIgKHZsaXN0KSkpOworICAgICAgICAgICAgICB4ID0gWElOVCAo Rm50aCAobWFrZV9udW1iZXIgKDApLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAgICAg ICAgeSA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgxKSwgeF95X2hwb3NfdnBvc19saXN0KSk7 CisgICAgICAgICAgICAgIGhwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMiksIHhfeV9o cG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAgICAgICB2cG9zID0gWElOVCAoRm50aCAobWFrZV9u dW1iZXIgKDMpLCB4X3lfaHBvc192cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAgbWNfZXJhc2Ug KHcsIHgsIHksIGhwb3MsIHZwb3MsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJlZCwgZ3Jl ZW4sIGJsdWUpOworICAgICAgICAgICAgfQorICAgICAgICAgIHctPm1jX2NhY2hlID0gUW5pbDsK KyAgICAgICAgfQorICAgICAgZm9yICh2bGlzdCA9IEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBtY19s aXN0KTsKKyAgICAgICAgICAgQ09OU1AgKHZsaXN0KTsKKyAgICAgICAgICAgdmxpc3QgPSBYQ0RS ICh2bGlzdCkpCisgICAgICAgIHsKKyAgICAgICAgICBjdXJzb3Jfc3BlY19saXN0ID0gWENBUiAo dmxpc3QpOworICAgICAgICAgIHBvc2ludCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgwKSwg Y3Vyc29yX3NwZWNfbGlzdCkpOworICAgICAgICAgIGN1cnNvcl9zcGVjX3R5cGUgPSBGbnRoICht YWtlX251bWJlciAoMSksIGN1cnNvcl9zcGVjX2xpc3QpOworICAgICAgICAgIGlmIChDT05TUCAo Y3Vyc29yX3NwZWNfdHlwZSkpCisgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9f Y3Vyc29yX3R5cGUgKFhDQVIgKGN1cnNvcl9zcGVjX3R5cGUpKTsKKyAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgY3Vyc29yX3R5cGUgPSBtY19saXNwX3RvX2N1cnNvcl90eXBlIChjdXJz b3Jfc3BlY190eXBlKTsKKyAgICAgICAgICBpZiAoQ09OU1AgKGN1cnNvcl9zcGVjX3R5cGUpKQor ICAgICAgICAgICAgY3Vyc29yX3dpZHRoID0gWElOVCAoWENBUiAoWENEUiAoY3Vyc29yX3NwZWNf dHlwZSkpKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoID0g MTsKKyAgICAgICAgICBjdXJzb3JfY29sb3JfdmVjdG9yID0gRm50aCAobWFrZV9udW1iZXIgKDIp LCBjdXJzb3Jfc3BlY19saXN0KTsKKyAgICAgICAgICByZWQgPSBYRkxPQVRfREFUQSAoQVJFRiAo Y3Vyc29yX2NvbG9yX3ZlY3RvciwgMCkpOworICAgICAgICAgIGdyZWVuID0gWEZMT0FUX0RBVEEg KEFSRUYgKGN1cnNvcl9jb2xvcl92ZWN0b3IsIDEpKTsKKyAgICAgICAgICBibHVlID0gWEZMT0FU X0RBVEEgKEFSRUYgKGN1cnNvcl9jb2xvcl92ZWN0b3IsIDIpKTsKKyAgICAgICAgICBpZiAocG9z aW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICB4X3lfaHBvc192cG9zX2xpc3QgPSBt Y194X3lfaHBvc192cG9zICh3LCBwb3NpbnQpOworICAgICAgICAgICAgICB0ZW1wID0gRmNvbnMg KGN1cnNvcl9zcGVjX2xpc3QsIEZjb25zICh4X3lfaHBvc192cG9zX2xpc3QsIFFuaWwpKTsKKyAg ICAgICAgICAgICAgcmVzdWx0ID0gRmNvbnMgKHRlbXAsIHJlc3VsdCk7CisgICAgICAgICAgICAg IHggPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMCksIHhfeV9ocG9zX3Zwb3NfbGlzdCkpOwor ICAgICAgICAgICAgICB5ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB4X3lfaHBvc192 cG9zX2xpc3QpKTsKKyAgICAgICAgICAgICAgaHBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVy ICgyKSwgeF95X2hwb3NfdnBvc19saXN0KSk7CisgICAgICAgICAgICAgIHZwb3MgPSBYSU5UIChG bnRoIChtYWtlX251bWJlciAoMyksIHhfeV9ocG9zX3Zwb3NfbGlzdCkpOworICAgICAgICAgICAg ICBpZiAody0+bWMuc3RhcnQKKyAgICAgICAgICAgICAgICAgICYmIHctPm1jLmVuZAorICAgICAg ICAgICAgICAgICAgJiYgcG9zaW50ID49IHctPm1jLnN0YXJ0CisgICAgICAgICAgICAgICAgICAm JiBwb3NpbnQgPD0gdy0+bWMuZW5kKQorICAgICAgICAgICAgICAgIG1jX2RyYXcgKHcsIHgsIHks IGhwb3MsIHZwb3MsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJlZCwgZ3JlZW4sIGJsdWUp OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBpZiAocmVzdWx0KQorICAgICAgICB3 LT5tY19jYWNoZSA9IEZjb25zIChCVkFSIChjdXJyZW50X2J1ZmZlciwgbWNfbGlzdCksIEZjb25z IChGcmV2ZXJzZSAocmVzdWx0KSwgUW5pbCkpOworICAgIH0KKyAgaWYgKG9sZF9idWZmZXIpCisg ICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7Cit9CiAKIC8qIERpc3BsYXkgb3Ig Y2xlYXIg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c29ycyBhbmQgcmVkcmF3IHRoZSByZWFs IGN1cnNvci4gICovCisgICAgICBpZiAoKCFOSUxQIChCVkFSIChjdXJyZW50X2J1ZmZlciwgbWNf bGlzdCkpIHx8IHctPm1jX2NhY2hlKQorICAgICAgICAgICYmICFNSU5JX1dJTkRPV19QICh3KSkK KyAgICAgICAgeworICAgICAgICAgIGlmIChOSUxQIChCVkFSIChjdXJyZW50X2J1ZmZlciwgbWNf bGlzdCkpICYmIHctPm1jX2NhY2hlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19j YWxjICh3LCAxKTsgLyogUmVtb3ZlIGZha2UgY3Vyc29ycy4gICovCisgICAgICAgICAgICAgIGlm IChjdXJzb3Jfb25fcCkgLyogUmVkcmF3IHJlYWwgY3Vyc29yLiAgKi8KKyAgICAgICAgICAgICAg ICBkaXNwbGF5X2FuZF9zZXRfY3Vyc29yICh3LCAxLAorICAgICAgICAgICAgICAgICAgdy0+b3V0 cHV0X2N1cnNvci5ocG9zLCB3LT5vdXRwdXRfY3Vyc29yLnZwb3MsCisgICAgICAgICAgICAgICAg ICB3LT5vdXRwdXRfY3Vyc29yLngsIHctPm91dHB1dF9jdXJzb3IueSk7CisgICAgICAgICAgICB9 CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIG1jX2NhbGMgKHcsIDApOyAvKiBEcmF3 IGZha2UgY3Vyc29ycyAgKi8KKyAgICAgICAgfQorCiAgICAgICBpZiAoZHJhd193aW5kb3dfZnJp bmdlcyAodywgdHJ1ZSkpCiAJewogCSAgaWYgKFdJTkRPV19SSUdIVF9ESVZJREVSX1dJRFRIICh3 KSkKQEAgLTE0NDksMTAgKzE0NjcsMTMgQEAgc3RhdGljIHZvaWQgeF9jaGVja19mb250IChzdHJ1 Y3QgZnJhbWUgKiwgc3RydWN0IGZvbnQgKik7CiBzdGF0aWMgdm9pZAogeF9zZXRfY3Vyc29yX2dj IChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzKQogewotICB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AgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRh LngtPmN1cnNvcl9waXhlbCcuICAqLworICAgICAgeworICAgICAgICBzdHJ1Y3QgZnJhbWUgKmYg PSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworICAgICAgICBzdHJ1Y3QgeF9kaXNwbGF5X2lu Zm8gKmRweWluZm8gPSBGUkFNRV9ESVNQTEFZX0lORk8gKGYpOworICAgICAgICB1bnNpZ25lZCBs b25nIG9yaWdfdmFsID0gZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsOworICAgICAgICBp bnQgaW50X3JlZCA9IHJlZCAqIDY1NTM1OworICAgICAgICBpbnQgaW50X2dyZWVuID0gZ3JlZW4g KiA2NTUzNTsKKyAgICAgICAgaW50IGludF9ibHVlID0gYmx1ZSAqIDY1NTM1OworICAgICAgICBm LT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSB4X21ha2VfdHJ1ZWNvbG9yX3BpeGVsIChk cHlpbmZvLCBpbnRfcmVkLCBpbnRfZ3JlZW4sIGludF9ibHVlKTsKKyAgICAgICAgeF9kcmF3X2hv bGxvd19jdXJzb3IgKHcsIGdseXBoX3Jvdyk7CisgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1 cnNvcl9waXhlbCA9IG9yaWdfdmFsOworICAgICAgfQorICAgICAgZWxzZQorICAgICAgICB4X2Ry YXdfaG9sbG93X2N1cnNvciAodywgZ2x5cGhfcm93KTsKKyAgICBicmVhazsKKyAgfQorICBjYXNl IEZJTExFRF9CT1hfQ1VSU09SOgorICB7CisgICAgIC8qIFRPRE86ICBrZGIgdG8gY29uc2lkZXIg YWRkaW5nIHN1cHBvcnQgZm9yIG11bHRpcGxlIGN1cnNvciBmb3JlZ3JvdW5kCisgICAgIGN1c3Rv bWl6YXRpb24gb2YgYSBGSUxMRURfQk9YX0NVUlNPUi4gICovCisgICAgaWYgKHJlZCA+PSAwICYm I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VUlNPUik7Cisg ICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdfdmFsOworICAgICAg fQorICAgICAgZWxzZQorICAgICAgICB4X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cGhfcm93LCBj dXJzb3Jfd2lkdGgsIEhCQVJfQ1VSU09SKTsKKyAgICBicmVhazsKKyAgfQorICBjYXNlIE5PX0NV UlNPUjoKKyAgICB3LT5waHlzX2N1cnNvcl93aWR0aCA9IDA7CisgICAgYnJlYWs7CisgIGRlZmF1 bHQ6CisgICAgZW1hY3NfYWJvcnQgKCk7CisgIH0KIAl9CiAKICNpZmRlZiBIQVZFX1hfSTE4Tgo= --Multipart_Mon_Mar_28_20:45:06_2016-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: Can we support multiple Cursors? Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Tue, 29 Mar 2016 15:00:02 +0000 Resent-Message-ID: <handler.22873.B22873.145926355428982 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Keith David Bershatsky <esq@HIDDEN> Cc: jwiegley@HIDDEN, mbork@HIDDEN, 22873 <at> debbugs.gnu.org, rms@HIDDEN Reply-To: Eli Zaretskii <eliz@HIDDEN> Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.145926355428982 (code B ref 22873); Tue, 29 Mar 2016 15:00:02 +0000 Received: (at 22873) by debbugs.gnu.org; 29 Mar 2016 14:59:14 +0000 Received: from localhost ([127.0.0.1]:43894 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1akv6v-0007XN-4s for submit <at> debbugs.gnu.org; Tue, 29 Mar 2016 10:59:14 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45318) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1akv6t-0007XC-WE for 22873 <at> debbugs.gnu.org; Tue, 29 Mar 2016 10:59:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <eliz@HIDDEN>) id 1akv6n-00035w-2p for 22873 <at> debbugs.gnu.org; Tue, 29 Mar 2016 10:59:05 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:60160) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>) id 1akv6X-00031X-UT; Tue, 29 Mar 2016 10:58:49 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1945 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from <eliz@HIDDEN>) id 1akv6Q-0001qg-SX; Tue, 29 Mar 2016 10:58:43 -0400 Date: Tue, 29 Mar 2016 17:58:21 +0300 Message-Id: <83shz9wctu.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-reply-to: <m2mvpiymkc.wl%esq@HIDDEN> (message from Keith David Bershatsky on Mon, 28 Mar 2016 20:45:07 -0700) References: <m2mvpiymkc.wl%esq@HIDDEN> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.0 (------) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -6.0 (------) > Date: Mon, 28 Mar 2016 20:45:07 -0700 > From: Keith David Bershatsky <esq@HIDDEN> > Cc: John Wiegley <jwiegley@HIDDEN>,Eli Zaretskii <eliz@HIDDEN>,Marcin Borkowski <mbork@HIDDEN>,Richard Stallman <rms@HIDDEN> > > The attached multiple_cursors_007.diff applies to the master branch as of today, March 28, 2016, bearing commit a30e7e12ed8465e2565dd318d921bc87f52ce18e. > > mc_calc now runs from the applicable nsterm.m/w32term.c/xterm.c, instead of xdisp.c. Why is that a good idea? You have 3 almost identical copies of the same code, which goes against our long-time trend to have terminal independent code only once, for easier maintenance. > ((oddp current-column) > (list pos "bar" [1.0 0.0 0.0])) ;; red > ((evenp current-column) > (list pos "bar" [0.0 0.0 1.0])))))) ;; blue That's not how we specify colors in Emacs, not on the user level, anyway. I don't think I like this design. Why not use the existing mechanisms for specifying the cursor color?
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: Can we support multiple Cursors? References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Tue, 29 Mar 2016 17:27:02 +0000 Resent-Message-ID: <handler.22873.B22873.145927239117126 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: John Wiegley <jwiegley@HIDDEN>, Marcin Borkowski <mbork@HIDDEN>, 22873 <at> debbugs.gnu.org, Richard Stallman <rms@HIDDEN> Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.145927239117126 (code B ref 22873); Tue, 29 Mar 2016 17:27:02 +0000 Received: (at 22873) by debbugs.gnu.org; 29 Mar 2016 17:26:31 +0000 Received: from localhost ([127.0.0.1]:44047 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1akxPS-0004SA-PB for submit <at> debbugs.gnu.org; Tue, 29 Mar 2016 13:26:30 -0400 Received: from cobb.liquidweb.com ([50.28.13.150]:45183) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1akxPR-0004Rk-FR for 22873 <at> debbugs.gnu.org; Tue, 29 Mar 2016 13:26:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date; bh=EIwsTlLvr1eCjb2eD47d+V22xEabu0NXRMCNLL86ybQ=; b=wgwlTW1vLqC5aGO5PR6KQTBIVhmPV9LidNjHVkEj97DfYRmplYUPTKoWtMMz8TNUe7InUxcMN/s1e0CXygjZ+SBuLmg1WUVHSP2OY14KKBGNM8D3iihDh/m1eiZR7ThF; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:50126 helo=server.local.localhost) by cobb.liquidweb.com with esmtp (Exim 4.82) (envelope-from <esq@HIDDEN>) id 1akxPI-0000fv-BI; Tue, 29 Mar 2016 13:26:20 -0400 Date: Tue, 29 Mar 2016 10:26:21 -0700 Message-ID: <m2vb45ureq.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 (generated by - "") Content-Type: text/plain; charset=US-ASCII X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cobb.liquidweb.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-Get-Message-Sender-Via: cobb.liquidweb.com: acl_c_relayhosts_text_entry: lawlist|lawlist.com X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.7 (/) Thank you, Eli, for taking a look at the 7th working draft of mc. Essentially, mc_calc is called at only one location depending on how Emacs was built: * nsterm.m when built --with-ns. * w32term.c when built for Windows. * xterm.c when built --with-x. All three of those files have similarities, and some of the functions in each file are either the same or similar. I felt that tacking mc_calc onto the heels of a function from `xdisp.c` and putting in exceptions (to prevent it from always being called), is not as clean as putting it only where it was truly needed. In a nutshell, I'm just following in the footsteps of my predecessors as to cursors for Emacs on Windows, OSX and X11. I have made a note on my todo-list to add support for alternative methods for the end user to define colors: [1.0 0.0 0.0]; "red"; "#FF0000"; (255, 0, 0); (65535, 0, 0) -- with some way to distinguish between the last two forms. (1.0 is used by OSX; 255 is used by Windows; and 65535 is used by X11). Keith ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; At Tue, 29 Mar 2016 17:58:21 +0300, Eli Zaretskii wrote: > > * * * > > > > mc_calc now runs from the applicable nsterm.m/w32term.c/xterm.c, instead of xdisp.c. > > Why is that a good idea? You have 3 almost identical copies of the > same code, which goes against our long-time trend to have terminal > independent code only once, for easier maintenance. > > > ((oddp current-column) > > (list pos "bar" [1.0 0.0 0.0])) ;; red > > ((evenp current-column) > > (list pos "bar" [0.0 0.0 1.0])))))) ;; blue > > That's not how we specify colors in Emacs, not on the user level, > anyway. I don't think I like this design. Why not use the existing > mechanisms for specifying the cursor color?
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: Can we support multiple Cursors? References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sun, 25 Jun 2017 22:10:02 +0000 Resent-Message-ID: <handler.22873.B22873.149842856324916 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: John Wiegley <jwiegley@HIDDEN>, Marcin Borkowski <mbork@HIDDEN>, 22873 <at> debbugs.gnu.org, Richard Stallman <rms@HIDDEN> Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.149842856324916 (code B ref 22873); Sun, 25 Jun 2017 22:10:02 +0000 Received: (at 22873) by debbugs.gnu.org; 25 Jun 2017 22:09:23 +0000 Received: from localhost ([127.0.0.1]:37732 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1dPFic-0006To-V2 for submit <at> debbugs.gnu.org; Sun, 25 Jun 2017 18:09:23 -0400 Received: from gateway34.websitewelcome.com ([192.185.150.114]:40746) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1dPFia-0006Tf-Fo for 22873 <at> debbugs.gnu.org; Sun, 25 Jun 2017 18:09:21 -0400 Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway34.websitewelcome.com (Postfix) with ESMTP id 023D71468 for <22873 <at> debbugs.gnu.org>; Sun, 25 Jun 2017 17:09:19 -0500 (CDT) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id PFi4dSDAT8mWRPFi4dXMWk; Sun, 25 Jun 2017 17:08:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Q8karhwnDyDq3XmeDQ9dKlYqkZ6cvgob6NQcsYCOUHo=; b=ajzuDMmKecAGDPVJQoVOmMuP09 CmY7cKLdBi7nx6suRHjnCqdo67f3qjVzq5rqVlcZhTmcCbctubTksGcYE9xrfC7jMOvtCPmRdfu6V IEhPFQIna3LP9KasXRdITg96933vWU9nMcDZIcE/d5XsndRzbh4U2smev6hVVnPe/fK+GsqixNUeL Q0dG90JtJXTsWSg6khV74MSRvsA2F6ZgpqsMdsABoNe1askFkSsoJrn7eA3cribOB/vUaLNwT+8TI /YsKJeh1rbEDYwB4B4VZmif5f2RA942Dcl4MVFxk4FC3xJSfDs5TzmfqteA6SMGTN+YKuUUBb2CoK 1kXCWAXg==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:52707 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.87) (envelope-from <esq@HIDDEN>) id 1dPFiX-0045XG-HX; Sun, 25 Jun 2017 17:09:17 -0500 Date: Sun, 25 Jun 2017 15:09:16 -0700 Message-ID: <m21sq7zpmb.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Sun_Jun_25_15:09:16_2017-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Exim-ID: 1dPFiX-0045XG-HX X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:52707 X-Source-Auth: lawlist X-Email-Count: 4 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Spam-Score: 1.8 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: WHAT'S NEW: - Fake cursors now only appear in the selected-window if the `mc-list' is defined -- i.e., the fake cursors are removed when the window loses focus, and they are added again when the window acquires focus. [...] Content analysis details: (1.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in bl.spamcop.net [Blocked - see <http://www.spamcop.net/bl.shtml?50.87.144.69>] 0.5 RCVD_IN_SORBS_SPAM RBL: SORBS: sender is a spam source [50.87.144.69 listed in dnsbl.sorbs.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [192.185.150.114 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> --Multipart_Sun_Jun_25_15:09:16_2017-1 Content-Type: text/plain; charset=US-ASCII WHAT'S NEW: - Fake cursors now only appear in the selected-window if the `mc-list' is defined -- i.e., the fake cursors are removed when the window loses focus, and they are added again when the window acquires focus. - `mc_color_vector_calculate` will take the familiar Emacs way of specifying colors (e.g., "red" and "#FF0000") and convert them internally to the LSL color vector. The conversion process is transparent to the user. - `mc_remove_when_scrolled` will remove multiple cursors when scrolling. This is important because `update_window_end` will not remove the cursors when scrolling. [There was an emacs-devel thread (about 1.5 years ago) where I had sought help tracking the multiple cursors when scrolling. It turned out that the method of tracking cursors was not the problem (since they don't move) -- it was simply that `update_window_end` was not being called in that circumstance.] - `mc_x_y_hpos_vpos' contains some extra `stuff` that is irrelevant to the functionality of this patch -- the extra `stuff` is used by me as a workaround to deal with the overlay after-string property that gets in the way of properly calculating coordinates. [See the TODO section below.] - The patch applies to commit a30e7e12ed8465e2565dd318d921bc87f52ce18e from 03/28/2016. [See apology for the inconvenience further down below.] TODO: - Optimize drawing and removal of multiple fake cursors. - Fix any bugs (there will surely be many). - Implement a way to properly calculate x, y, hpos, vpos when overlays are present -- e.g., the overlay after-string property wreaks havoc on the current method of calculating coordinates. - Try and convince one or more real programmers to take over from here, since we now have a working proof concept. [I am just a weekend hobbyist without any formal programming study.] SUGGESTION: I would respectfully suggest to the Emacs development team that multiple cursors be implemented in two stages: - The first stage would be the creation and removal of fake cursors to be used kind of like overlays. I.e., specify the `point`, cursor-style, and color. The suggestion by Eli Z. to support specifying colors with strings like "red" and "#FF0000" has now been implemented. - The second stage would be to implement built-in functionality similar to the multiple cursors library by Magnar Sveen. [In an earlier section of this thread, I mentioned a substantial slow-down that I experienced when using the library written by Mr. Sveen. I have since discovered that it was due to `line-number-at-pos', and I have already reached out to the author with an alternative suggestion to use (format-mode-line "%l").] INSTALLATION (for anyone a little less familiar): STEP #1 (clone master branch): git clone -b master git://git.sv.gnu.org/emacs.git STEP #2: cd over to the root of the `emacs` source directory cloned in the first step above. STEP #3 (hard reset): git reset --hard a30e7e12ed8465e2565dd318d921bc87f52ce18e You will see a message: "HEAD is now at a30e7e1 Mention the `M-q' changes" [We need to go back in time to 03/28/2016 as that is the master branch version that I am still using -- sorry for the inconvenience. I will update to the latest version of Emacs at some point in the future as time permits. Creating patches that apply to a "moving target" is challenging.] STEP #4 (put the patch in place): Copy the latest patch (multiple_cursors_008.diff) to the root of the emacs source directory cloned in the first step above. STEP #5 (apply the patch): git apply multiple_cursors_008.diff STEP #6: ./autogen.sh STEP #7: Configure the build for X, MS Windows, or OSX; e.g.,: ./configure --with-ns STEP #8: make STEP #9: make install STEP #10: Launch the newly built Emacs, and copy the following function to the `*scratch*` buffer, and type `M-x mc-test`. (defun mc-test () "Draw fake cursors at all POS defined in the `mc-list'. Multiple fake cursors are supported by GUI versions of Emacs built for X, Windows and OSX. Popular forms of specifying colors such as \"red\" and \"#FF0000\" are now supported, as well as LSL color vectors such as [1.0 0.0 0.0]. For those users who choose the former familiar methods of specifying colors with strings, `mc_color_vector_calculate' will convert those strings to LSL color vectors. The color vectors are commonly referred to as LSL (The Linden Scripting Language). `nsterm.m' uses `NSColor', which works well with LSL. `w32term.c' uses `PALETTERGB' or `RGB', and the conversion from LSL is done internally by multiplying each element of the LSL color vector by 255. `xterm.c' uses `x_make_truecolor_pixel', which uses 16-bit RGB -- the conversion from LSL happens internally by multiplying each element of the LSL color vector by 65535." (interactive) (let ((buffer (get-buffer-create "*MC-TEST*"))) (with-current-buffer buffer (erase-buffer) (insert "This is a test!") (setq mc-list '((1 "hbar" "red") (2 "bar" "yellow") (3 "box" "#00FF00") (4 "hollow" "#0000FF") (5 ("hbar" 3) [1.0 0.0 1.0]) (6 ("bar" 3) [0.0 1.0 1.0])))) (select-window (display-buffer buffer)) ;;; The trigger in `keyboard.c` is not activated in this example, so we ;;; Force the multiple cursors to be drawn. (mc-draw-erase (selected-window)))) --Multipart_Sun_Jun_25_15:09:16_2017-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="multiple_cursors_008.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3NyYy9idWZmZXIuYyBiL3NyYy9idWZmZXIuYwppbmRleCA2MmIwYmM4Li41 Yjk0NjliIDEwMDY0NAotLS0gYS9zcmMvYnVmZmVyLmMKKysrIGIvc3JjL2J1ZmZlci5jCkBAIC01 MDU2LDYgKzUwNTYsMTYgQEAgaW5pdF9idWZmZXJfb25jZSAodm9pZCkKICAgYnNldF9sYXN0X3Nl bGVjdGVkX3dpbmRvdyAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgbWFrZV9udW1iZXIgKDApKTsKIAog ICBpZHggPSAxOworCisKKy8qIDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Oz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7Ozs7OyAqLworLyogQkVHSU4gbXVsdGlwbGUgY3Vy c29ycyAqLworCisgICAgICBpZiAody0+bWMuZHJhd19lcmFzZQorICAgICAgICAgICYmICghTklM UCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19saXN0KSkKKyAgICAgICAgICAgICAg fHwgKHctPm1jX2NhY2hlICYmIChFUSAody0+Y29udGVudHMsIFhDQVIgKEZudGggKG1ha2VfbnVt YmVyICgyKSwgdy0+bWNfY2FjaGUpKSkpKSkKKyAgICAgICAgICAmJiAhTUlOSV9XSU5ET1dfUCAo dykpCisgICAgICAgIHsKKyAgICAgICAgICAvKiBSZW1vdmUgZmFrZSBjdXJzb3JzLiAgKi8KKyAg ICAgICAgICBpZiAoKHctPm1jX2NhY2hlICYmIChFUSAody0+Y29udGVudHMsIFhDQVIgKEZudGgg KG1ha2VfbnVtYmVyICgyKSwgdy0+bWNfY2FjaGUpKSkpKSkKKyAgICAgICAgICAgIG1jX2NhbGMg KHcsIDEpOworICAgICAgICAgIC8qIERyYXcgZmFrZSBjdXJzb3JzICAqLworICAgICAgICAgIGlm ICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19saXN0KSkpCisgICAgICAg ICAgICBtY19jYWxjICh3LCAwKTsKKyAgICAgICAgfQorCisgICAgICAvKiBGaXJzdCBhdHRlbXB0 IGF0IGRlYWxpbmcgd2l0aCBhIGByZWRpc3BsYXlfcHJlc2VydmVfZWNob19hcmVhJyBzaXR1YXRp b24uICAqLworICAgICAgaWYgKCF3LT5tYy5kcmF3X2VyYXNlCisgICAgICAgICAgJiYgIU5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfbGlzdCkpCisgICAgICAgICAgJiYgdy0+ bWNfY2FjaGUKKyAgICAgICAgICAmJiAoRVEgKHctPmNvbnRlbnRzLCBYQ0FSIChGbnRoIChtYWtl X251bWJlciAoMiksIHctPm1jX2NhY2hlKSkpKQorIC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2UgRklMTEVEX0JPWF9DVVJT T1I6CisgICAgeworICAgICAgLyogVE9ETzogIGtkYiB0byBjb25zaWRlciBhZGRpbmcgc3VwcG9y dCBmb3IgbXVsdGlwbGUgY3Vyc29yIGZvcmVncm91bmQKKyAgICAgIGN1c3RvbWl6YXRpb24gb2Yg YSBGSUxMRURfQk9YX0NVUlNPUi4gICovCisgICAgICBpZiAocmVkID49IDAgJiYgYmx1ZSA+PSAw ICYmIGdyZWVuID49IDApCisgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0 X2RhdGEudzMyLT5jdXJzb3JfZ2MnIGJ5IGJvcnJvd2luZyB0aGUKKyAgICAgICAgZnVuY3Rpb25h bGl0eSBvZiBgeF9tYWtlX2djJyBpbiB3MzJmbnMuYy4gICovCisgICAgICAgIHsKKyAgICAgICAg ICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICBMaXNwX09iamVjdCB3aW5kb3cgPSAoc2VsZWN0 ZWRfd2luZG93KTsKKyAgICAgICAgICBzdHJ1Y3Qgd2luZG93ICp3ID0gZGVjb2RlX2xpdmVfd2lu ZG93ICh3aW5kb3cpOworICAgICAgICAgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAoV0lORE9X X0ZSQU1FICh3KSk7CisgICAgICAgICAgaW50IGludF9yZWQgPSByZWQgKiAyNTU7CisgICAgICAg ICAgaW50IGludF9ncmVlbiA9IGdyZWVuICogMjU1OworICAgICAgICAgIGludCBpbnRfYmx1ZSA9 IGJsdWUgKiAyNTU7CisgICAgICAgICAgWEdDVmFsdWVzIGdjX3ZhbHVlczsKKyAgICAgICAgICB1 bnNpZ25lZCBsb25nIG1hc2sgPSBHQ0ZvbnQgfCBHQ0ZvcmVncm91bmQgfCBHQ0JhY2tncm91bmQ7 CisgICAgICAgICAgQ09MT1JSRUYgb3JpZ192YWxfYSA9IEZSQU1FX0JBQ0tHUk9VTkRfUElYRUwg KGYpOworICAgICAgICAgIENPTE9S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LCBGUkFN RV9XMzJfV0lORE9XIChmKSwgbWFzaywgJmdjX3ZhbHVlcyk7CisgICAgICAgICAgdW5ibG9ja19p bnB1dCAoKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgZHJhd19waHlzX2N1 cnNvcl9nbHlwaCAodywgZ2x5cGhfcm93LCBEUkFXX0NVUlNPUik7CisgICAgICBicmVhazsKKyAg ICB9CisgICAgY2FzZSBCQVJfQ1VSU09SOgorICAgIHsKKyAgICAgIGlmIChyZWQgPj0gMCAmJiBi bHVlID49IDAgJiYgZ3JlZW4gPj0gMCkKKyAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBm LT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcuICAqLworICAgICAgICB7CisgICAgICAg ICAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAgICAgICAg ICBDT0xPUlJFRiBvcmlnX3ZhbCA9IGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsOwor ICAgICAgICAgIGludCBpbnRfcmVkID0gcmVkICogMjU1OworICAgICAgICAgIGludCBpbnRfZ3Jl ZW4gPSBncmVlbiAqIDI1NTsKKyAgICAgICAgICBpbnQgaW50X2JsdWUgPSBibHVlICogMjU1Owor ICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gUEFMRVRURVJHQiAo aW50X3JlZCwgaW50X2dyZWVuLCBpbnRfYmx1ZSk7CisgICAgICAgICAgeF9kcmF3X2Jhcl9jdXJz b3IgKHcsIGdseXBoX3JvdywgY3Vyc29yX3dpZHRoLCBCQVJfQ1VSU09SKTsKKyAgICAgICAgICBm LT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9yaWdfdmFsOworICAgICAgICB9Cisg ICAgICAgIGVsc2UKKyAgICAgICAgICB4X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cGhfcm93LCBj dXJzb3Jfd2lkdGgsIEJBUl9DVVJTT1IpOworICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2Ug SEJBUl9DVVJTT1I6CisgICAgeworICAgICAgaWYgKHJlZCA+PSAwICYmIGJsdWUgPj0gMCAmJiBn cmVlbiA+PSAwKQorICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRh LnczMi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZnJh bWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworICAgICAgICAgIENPTE9SUkVGIG9y aWdfdmFsID0gZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWw7CisgICAgICAgICAgaW50 IGludF9yZWQgPSByZWQgKiAyNTU7CisgICAgICAgICAgaW50IGludF9ncmVlbiA9IGdyZWVuICog MjU1OworICAgICAgICAgIGludCBpbnRfYmx1ZSA9IGJsdWUgKiAyNTU7CisgICAgICAgICAgZi0+ b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBQQUxFVFRFUkdCIChpbnRfcmVkLCBpbnRf Z3JlZW4sIGludF9ibHVlKTsKKyAgICAgICAgICB4X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cGhf cm93LCBjdXJzb3Jfd2lkdGgsIEhCQVJfQ1VSU09SKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0 YS53MzItPmN1cnNvcl9waXhlbCA9IG9yaWdfdmFsOworICAgICAgICB9CisgICAgICAgIGVsc2UK KyAgICAgICAgICB4X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgs IEhCQVJfQ1VSU09SKTsKKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIE5PX0NVUlNPUjoK KyAgICAgIHctPnBoeXNfY3Vyc29yX3dpZ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ZW92bCIpOworICBMaXNwX09iamVjdCBvdl9yaWdodF9mcmluZ2UgPSBpbnRlcm5fY19zdHJpbmcg KCJyaWdodC1mcmluZ2UiKTsKKyAgTGlzcF9PYmplY3Qgb3ZfcXVlcnlfdHlwZSA9IFFuaWw7Cisg IExpc3BfT2JqZWN0IG92X3F1ZXJ5X2FmdGVyX3N0cmluZyA9IFFuaWw7CisgIExpc3BfT2JqZWN0 IG92X3F1ZXJ5X2Rpc3BsYXkgPSBRbmlsOworICBib29sIG92X2ZvdW5kX3R5cGVfY29sZW92bCA9 IGZhbHNlOworICBib29sIG92X2ZvdW5kX2FmdGVyc3RyaW5nID0gZmFsc2U7CisgIGJvb2wgb3Zf Zm91bmRfdHlwZV9yaWdodGZyaW5nZSA9IGZhbHNlOworICBpZiAocG9zaW50ID49IHN0YXJ0Cisg ICAgICAmJiBwb3NpbnQgPD0gZW5kKQorICAgIHsKKyAgICAgIG92ZXJsYXlzID0gRm92ZXJsYXlz X2luIChtYWtlX251bWJlciAocG9zaW50KSwgKG1ha2VfbnVtYmVyIChwb3NpbnQgKyAxKSkpOwor ICAgICAgaWYgKCFOSUxQIChvdmVybGF5cykpCisgICAgICAgIHsKKyAgICAgICAgICBmb3IgKG92 X2xpc3QgPSBvdmVybGF5czsKKyAgICAgICAgICAgICAgIENPTlNQIChvdl9saXN0KTsKKyAgICAg ICAgICAgICAgIG92X2xpc3QgPSBYQ0RSIChvdl9saXN0KSkKKyAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgb3YgPSBYQ0FSIChvdl9saXN0KTsKKyAgICAgICAgICAgICAgb3ZfcXVlcnlfdHlw ZSA9IEZvdmVybGF5X2dldCAob3YsIG92X3R5cGUpOworICAgICAgICAgICAgICBvdl9xdWVyeV9k aXNwbGF5ID0gRm92ZXJsYXlfZ2V0IChvdiwgUWRpc3BsYXkpOworICAgICAgICAgICAgICBvdl9x dWVyeV9hZnRlcl9zdHJpbmcgPSBGb3ZlcmxheV9nZXQgKG92LCBRYWZ0ZXJfc3RyaW5nKTsKKyAg ICAgICAgICAgICAgaWYgKEVRIChvdl9xdWVyeV90eXBlLCBvdl9jb2xfZW92bCkpCisgICAgICAg ICAgICAgICAgb3ZfZm91bmRfdHlwZV9jb2xlb3ZsID0gdHJ1ZTsKKyAgICAgICAgICAgICAgaWYg KEVRIChvdl9xdWVyeV90eXBlLCBvdl9yaWdodF9mcmluZ2UpKQorICAgICAgICAgICAgICAgIG92 X2ZvdW5kX3R5cGVfcmlnaHRmcmluZ2UgPSB0cnVlOworICAgICAgICAgICAgICBpZiAoIU5JTFAg KG92X3F1ZXJ5X2FmdGVyX3N0cmluZykpCisgICAgICAgICAgICAgICAgb3ZfZm91bmRfYWZ0ZXJz dHJpbmcgPSB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBTRVRfVEVYVF9Q T1NfRlJPTV9NQVJLRVIgKHB0LCB3LT5zdGFydCk7CisgICAgICBzdGFydF9kaXNwbGF5ICgmaXQs IHcsIHB0KTsKKyAgICAgIG1vdmVfaXRfdG8gKCZpdCwgcG9zaW50LCAtMSwgLTEsIC0xLCBNT1ZF X1RPX1BPUyk7CisgICAgICB5ID0gaXQuY3VycmVudF95OworICAgICAgdnBvcyA9IGl0LnZwb3M7 CisgICAgICBpZiAob3ZfZm91bmRfdHlwZV9jb2xlb3ZsKQorICAgICAgICB7CisgICAgICAgICAg VEVNUF9TRVRfUFRfQk9USCAoQ0hBUlBPUyAoaXQuY3VycmVudC5wb3MpLCBCWVRFUE9TIChpdC5j dXJyZW50LnBvcykpOworICAgICAgICAgIHBlb3ZsX2NvbCA9IGN1cnJlbnRfY29sdW1uICgpIC0g MTsKKyAgICAgICAgICBtb3ZlX2l0X2J5X2xpbmVzICgmaXQsIC0xKTsKKyAgICAgICAgICBURU1Q X1NFVF9QVF9CT1RIIChDSEFSUE9TIChpdC5jdXJyZW50LnBvcyksIEJZVEVQT1MgKGl0LmN1cnJl bnQucG9zKSk7CisgICAgICAgICAgcGJvdmxfY29sID0gY3VycmVudF9jb2x1bW4gKCk7CisgICAg ICAgICAgY29sX2VvdmwgPSBwZW92bF9jb2wgLSBwYm92bF9jb2w7CisgICAgICAgICAgeCA9IGNv bF9lb3ZsICogZnJhbWVfY2hhcl93aWR0aDsKKyAgICAgICAgICBocG9zID0gY29sX2Vvdmw7Cisg ICAgICAgICAgVEVNUF9TRVRfUFRfQk9USCAob3BvaW50LCBvYnl0ZXBvcyk7CisgICAgICAgIH0K KyAgICAgICAgLyogU3BlY2lhbCBoYW5kbGluZyBmb3IgYGFmdGVyLXN0cmluZycgYW5kIGVvYiBz aXR1YXRpb25zLiAgKi8KKyAgICAgICAgZWxzZSBpZiAob3ZfZm91bmRfYWZ0ZXJzdHJpbmcKKyAg ICAgICAgICAgICAgICAgfHwgRkVUQ0hfQllURSAoSVRfQllURVBPUyAoaXQpKSA9PSAnXG4nCisg ICAgICAgICAgICAgICAgIHx8IHBvc2ludCA9PSBaVikKKyAgICAgICAgICB7CisgICAgICAgICAg ICBURU1QX1NFVF9QVF9CT1RIIChDSEFSUE9TIChpdC5jdXJyZW50LnBvcyksIEJZVEVQT1MgKGl0 LmN1cnJlbnQucG9zKSk7CisgICAgICAgICAgICBwZW92bF9jb2wgPSBjdXJyZW50X2NvbHVtbiAo KTsKKyAgICAgICAgICAgIC8qIERWUE9TID09IDAgbWVhbnMgbW92ZSB0byB0aGUgc3RhcnQgb2Yg dGhlIHNjcmVlbiBsaW5lLiAgKi8KKyAgICAgICAgICAgIG1vdmVfaXRfYnlfbGluZXMgKCZpdCwg MCk7CisgICAgICAgICAgICBURU1QX1NFVF9QVF9CT1RIIChDSEFSUE9TIChpdC5jdXJyZW50LnBv cyksIEJZVEVQT1MgKGl0LmN1cnJlbnQucG9zKSk7CisgICAgICAgICAgICBwYm92bF9jb2wgPSBj dXJyZW50X2NvbHVtbiAoKTsKKyAgICAgICAgICAgIGNvbF9lb3ZsID0gcGVvdmxfY29sIC0gcGJv dmxfY29sOworICAgICAgICAgICAgeCA9IGNvbF9lb3ZsICogZnJhbWVfY2hhcl93aWR0aDsKKyAg ICAgICAgICAgIGhwb3MgPSBjb2xfZW92bDsKKyAgICAgICAgICAgIFRFTVBfU0VUX1BUX0JPVEgg KG9wb2ludCwgb2J5dGVwb3MpOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIHggPSBpdC5jdXJyZW50X3g7CisgICAgICAgICAgICAgIGhw b3MgPSBpdC5ocG9zOworICAgICAgICAgICAgfQorICAgICAgYmlkaV91bnNoZWx2ZV9jYWNoZSAo aXRkYXRhLCBmYWxzZSk7CisgICAgfQorICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgeCA9IC0x OworICAgICAgICB5ID0gLTE7CisgICAgICAgIGhwb3MgPSAtMTsKKyAgICAgICAgdnBvcyA9IC0x OworICAgICAgfQorICByZXR1cm4KKyAgICBsaXN0biAoQ09OU1RZUEVfSEVBUCwgNCwKKyAgICAg IGxpc3RuIChDT05TVFlQRV9IRUFQLCA0LCBtYWtlX251bWJlciAoeCksIG1ha2VfbnVtYmVyICh5 KSwgbWFrZV9udW1iZXIgKGhwb3MpLCBtYWtlX251bWJlciAodnBvcykpLAorICAgICAgRmNvbnMg KGJ1aWxkX3N0cmluZyAoInR5cGUiKSwgb3ZfcXVlcnlfdHlwZSksCisgICAgICBGY29ucyAoYnVp bGRfc3RyaW5nICgiZGlzcGxheSIpLCBvdl9xdWVyeV9kaXNwbGF5KSwKKyAgICAgIEZjb25zIChi dWlsZF9zdHJpbmcgKCJhZnRlci1zdHJpbmciKSwgb3ZfcXVlcnlfYWZ0ZXJfc3RyaW5nKSk7Cit9 CisKKy8qIFJldHVybiB0aGUgTFNMIGNvbG9yIHZlY3Rvci4gIEZSQU1FIGlzIGRlcml2ZWQgZnJv bSBXSU5ET1cuCitOb3RlIHRoYXQgdGhlIE5leHRzdGVwIHZlcnNpb24gb2YgeHdfY29sb3JfdmFs dWVzIG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0cnVjdCBnbHlwaF9yb3cgKmN1 cnNvcl9yb3cgPSBNQVRSSVhfUk9XICh3LT5jdXJyZW50X21hdHJpeCwgdnBvcyk7CisgIC8qIE1h eWJlIGNsZWFyIHRoZSBkaXNwbGF5IHVuZGVyIHRoZSBjdXJzb3IuICAqLworICBpZiAody0+cGh5 c19jdXJzb3JfdHlwZSA9PSBIT0xMT1dfQk9YX0NVUlNPUikKKyAgICB7CisgICAgICBpbnQgaG9s bG93X3gsIGhvbGxvd195LCB3aWR0aDsKKyAgICAgIGlmICghKHZwb3MgPj0gMAorICAgICAgICAg ICYmIHZwb3MgPCB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3MpKQorICAgICAgICBjdXJzb3JfZ2x5 cGggPSBOVUxMOworICAgICAgaWYgKCFjdXJzb3Jfcm93LT5lbmFibGVkX3ApCisgICAgICAgIGN1 cnNvcl9nbHlwaCA9IE5VTEw7CisgICAgICBpZiAody0+aHNjcm9sbCkKKyAgICAgICAgeworICAg ICAgICAgIC8qIFdoZW4gdGhlIHdpbmRvdyBpcyBoc2Nyb2xsZWQsIGN1cnNvciBocG9zIGNhbiBs ZWdpdGltYXRlbHkgYmUKKyAgICAgICAgICAgb3V0IG9mIGJvdW5kcywgYnV0IHdlIGRyYXcgdGhl IGN1cnNvciBhdCB0aGUgY29ycmVzcG9uZGluZworICAgICAgICAgICB3aW5kb3cgbWFyZ2luIGlu IHRoYXQgY2FzZS4gICovCisgICAgICAgICAgaWYgKCFjdXJzb3Jfcm93LT5yZXZlcnNlZF9wICYm IGhwb3MgPCAwKQorICAgICAgICAgICAgaHBvcyA9IDA7CisgICAgICAgICAgaWYgKGN1cnNvcl9y b3ctPnJldmVyc2VkX3AgJiYgaHBvcyA+PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0pCisg ICAgICAgICAgICBocG9zID0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gMTsKKyAgICAg ICAgfQorICAgICAgaWYgKDAgPD0gaHBvcyAmJiBocG9zIDwgY3Vyc29yX3Jvdy0+dXNlZFtURVhU X0FSRUFdKQorICAgICAgICBjdXJzb3JfZ2x5cGggPSBjdXJzb3Jfcm93LT5nbHlwaHNbVEVYVF9B UkVBXSArIGhwb3M7CisgICAgICBlbHNlCisgICAgICAgIGN1cnNvcl9nbHlwaCA9IE5VTEw7Cisg ICAgICBpZiAoY3Vyc29yX2dseXBoID09IE5VTEwpCisgICAgICAgIGdvdG8gZG9uZTsKKyAgICAg IHdpZHRoID0gY3Vyc29yX2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgIGhvbGxvd194ID0geDsK KyAgICAgIGlmICh4IDwgMCkKKyAgICAgICAgeworICAgICAgICAgIHdpZHRoICs9IGhvbGxvd194 OworICAgICAgICAgIGhvbGxvd194ID0gMDsKKyAgICAgICAgfQorICAgICAgd2lkdGggPSBtaW4g KHdpZHRoLCB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpIC0gaG9sbG93X3gpOworICAg ICAgaG9sbG93X3kgPSBXSU5ET1dfVE9fRlJBTUVfUElYRUxfWSAodywgbWF4IChoZWFkZXJfbGlu ZV9oZWlnaHQsIGN1cnNvcl9yb3ctPnkpKTsKKyAgICAgIGhvbGxvd194ID0gV0lORE9XX1RFWFRf VE9fRlJBTUVfUElYRUxfWCAodywgaG9sbG93X3gpOworICAgICAgaWYgKHdpZHRoID4gMCkKKyAg ICAgICAgRlJBTUVfUklGIChmKS0+Y2xlYXJfZnJhbWVfYXJlYSAoZiwgaG9sbG93X3gsIGhvbGxv d195LCB3aWR0aCwgY3Vyc29yX3Jvdy0+dmlzaWJsZV9oZWlnaHQpOworICAgIH0KKyAgaWYgKChj dXJzb3Jfcm93LT5yZXZlcnNlZF9wCisgICAgICAgPyAoaHBvcyA+PSAwKQorICAgICAgIDogKGhw b3MgPCBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0pKSkKKyAgICB7CisgICAgICBpbnQgeDE7 Cisg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JvbCkKKyAgICBzdHIgPSBT U0RBVEEgKFNZTUJPTF9OQU1FIChhcmcpKTsKKyAgZWxzZSByZXR1cm4gLTE7CisgIGlmICghc3Ry Y21wIChzdHIsICJib3giKSkKKyAgICByZXR1cm4gRklMTEVEX0JPWF9DVVJTT1I7CisgIGlmICgh c3RyY21wIChzdHIsICJob2xsb3ciKSkKKyAgICByZXR1cm4gSE9MTE9XX0JPWF9DVVJTT1I7Cisg IGlmICghc3RyY21wIChzdHIsICJoYmFyIikpCisgICAgcmV0dXJuIEhCQVJfQ1VSU09SOworICBp ZiAoIXN0cmNtcCAoc3RyLCAiYmFyIikpCisgICAgcmV0dXJuIEJBUl9DVVJTT1I7CisgIGlmICgh c3RyY21wIChzdHIsICJubyIpKQorICAgIHJldHVybiBOT19DVVJTT1I7CisgIHJldHVybiAtMTsK K30KKworLyogRVhBTVBMRSAjMToKKyAgICAoc2V0cSBtYy1saXN0ICcoCisgICAgICAoMyAiaGJh ciIgWzEuMCAwLjAgMC4wXSkKKyAgICAgICg0ICJiYXIiIFswLjAgMS4wIDAuMF0pCisgICAgICAo NSAiYm94IiBbMC4wIDAuMCAxLjBdKQorICAgICAgKDYgImhvbGxvdyIgWzAuOCAwLjQgMC4yXSkK KyAgICAgICg3ICgiaGJhciIgMykgWzEuMCAwLjAgMS4wXSkKKyAgICAgICg4ICgiYmFyIiAzKSBb MC4wIDEuMCAxLjBdKSkpCisgICBFWEFNUExFICMyOiAgKHNldHEgbWMtbGlzdCBuaWwpCitUaGUg YG1jX2NhY2hlJyBpcyBrZXB0IGluIHRoZSBmb2xsb3dpbmcgZXhhbXBsZSBmb3JtYXQ6CisgICgo CisgICAgKDMgaGJhciBbMS4wIDAuMCAwLjBdKQorICAgICg0IGJhciBbMC4wIDEuMCAwLjBdKQor ICAgICg1IGJveCBbMC4wIDAuMCAxLjBdKQorICAgICg2IGhvbGxvdyBbMC44IDAuNCAwLjJdKQor ICAgICg3IChoYmFyIDMpIFsxLjAgMC4wIDEuM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3BvaW50KQorICAgIHsKKyAgICAgIHctPm1jLm9wb2ludCA9IFBUOwor ICAgICAgeF95X2hwb3NfdnBvcyA9IEZudGggKG1ha2VfbnVtYmVyICgwKSwgbWNfeF95X2hwb3Nf dnBvcyAodywgdy0+bWMub3BvaW50LCBzdGFydCwgZW5kKSk7CisgICAgICB3LT5tYy5vcG9pbnRf eCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgwKSwgeF95X2hwb3NfdnBvcykpOworICAgICAg dy0+bWMub3BvaW50X3kgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMSksIHhfeV9ocG9zX3Zw b3MpKTsKKyAgICAgIHctPm1jLm9wb2ludF9ocG9zID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIg KDIpLCB4X3lfaHBvc192cG9zKSk7CisgICAgICB3LT5tYy5vcG9pbnRfdnBvcyA9IFhJTlQgKEZu dGggKG1ha2VfbnVtYmVyICgzKSwgeF95X2hwb3NfdnBvcykpOworICAgICAgdy0+bWMuc3RhcnQg PSBzdGFydDsKKyAgICAgIHhfeV9ocG9zX3Zwb3MgPSBGbnRoIChtYWtlX251bWJlciAoMCksIG1j X3hfeV9ocG9zX3Zwb3MgKHcsIHN0YXJ0LCBzdGFydCwgZW5kKSk7CisgICAgICB3LT5tYy5zdGFy dF94ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB4X3lfaHBvc192cG9zKSk7CisgICAg ICB3LT5tYy5zdGFydF95ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB4X3lfaHBvc192 cG9zKSk7CisgICAgICB3LT5tYy5zdGFydF9ocG9zID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIg KDIpLCB4X3lfaHBvc192cG9zKSk7CisgICAgICB3LT5tYy5zdGFydF92cG9zID0gWElOVCAoRm50 aCAobWFrZV9udW1iZXIgKDMpLCB4X3lfaHBvc192cG9zKSk7CisgICAgICB3LT5tYy5lbmQgPSBl bmQ7CisgICAgICB4X3lfaHBvc192cG9zID0gRm50aCAobWFrZV9udW1iZXIgKDApLCBtY194X3lf aHBvc192cG9zICh3LCBlbmQsIHN0YXJ0LCBlbmQpKTsKKyAgICAgIHctPm1jLmVuZF94ID0gWElO VCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB4X3lfaHBvc192cG9zKSk7CisgICAgICB3LT5tYy5l bmRfeSA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgxKSwgeF95X2hwb3NfdnBvcykpOworICAg ICAgdy0+bWMuZW5kX2hwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMiksIHhfeV9ocG9z X3Zwb3MpKTsKKyAgICAgIHctPm1jLmVuZF92cG9zID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIg KDMpLCB4X3lfaHBvc192cG9zKSk7CisgICAgICB3LT5tYy55X2RpZmYgPSAwOworICAgICAgdy0+ bWMudnBvc19kaWZmID0gMDsKKyAgICB9CisgIGlmICgocmVtb3ZlICYmIHctPm1jX2NhY2hlICYm IE5JTFAgKEJWQVIgKGIsIG1jX2xpc3QpKSkKKyAgICAgIHx8ICh3LT5tY19jYWNoZSAmJiBCVkFS IChiLCBtY19saXN0KSAmJiAocmVtb3ZlIHx8IHcgIT0gc3cpKSkKKyAgICB7CisjaWZkZWYgR0xZ UEhfREVCVUcKKyAgZGVidWdfbWV0aG9kX2FkZCAodywgIm1jX2NhbGM6ICByZW1vdmUgY3Vyc29y cyB1c2luZyBjYWNoZSIpOworI2VuZGlmCisgICAgICBmb3IgKHZsaXN0ID0gWENBUiAoWENEUiAo dy0+bWNfY2FjaGUpKTsKKyAgICAgICAgICAgQ09OU1AgKHZsaXN0KTsKKyAgICAgICAgICAgdmxp c3QgPSBYQ0RSICh2bGlzdCkpCisgICAgICAgIHsKKyAgICAgICAgICBjdXJzb3Jfc3BlY19saXN0 ID0gWENBUiAoWENBUiAodmxpc3QpKTsKKyAgICAgICAgICBwb3NpbnQgPSBYSU5UIChGbnRoICht YWtlX251bWJlciAoMCksIGN1cnNvcl9zcGVjX2xpc3QpKTsKKyAgICAgICAgICBjdXJzb3Jfc3Bl Y190eXBlID0gRm50aCAobWFrZV9udW1iZXIgKDEpLCBjdXJzb3Jfc3BlY19saXN0KTsKKyAgICAg ICAgICBpZiAoQ09OU1AgKGN1cnNvcl9zcGVjX3R5cGUpKQorICAgICAgICAgICAgY3Vyc29yX3R5 cGUgPSBtY19saXNwX3RvX2N1cnNvcl90eXBlIChYQ0FSIChjdXJzb3Jfc3BlY190eXBlKSk7Cisg ICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19j dXJzb3JfdHlwZSAoY3Vyc29yX3NwZWNfdHlwZSk7CisgICAgICAgICAgaWYgKENPTlNQIChjdXJz b3Jfc3BlY190eXBlKSkKKyAgICAgICAgICAgIGN1cnNvcl93aWR0aCA9IFhJTlQgKFhDQVIgKFhD RFIgKGN1cnNvcl9zcGVjX3R5cGUpKSk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAg IGN1cnNvcl93aWR0aCA9IDE7CisgICAgICAgICAgaWYgKHBvc2ludAorICAgICAgICAgICAgICAm JiB3LT5tYy5zdGFydAorICAgICAgICAgICAgICAmJiB3LT5tYy5lbmQKKyAgICAgICAgICAgICAg JiYgcG9zaW50ID49IHctPm1jLnN0YXJ0CisgICAgICAgICAgICAgICYmIHBvc2ludCA8PSB3LT5t Yy5lbmQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHhfeV9ocG9zX3Zwb3MgPSBYQ0FS IChYQ0RSIChYQ0FSICh2bGlzdCkpKTsKKyAgICAgICAgICAgICAgeCA9IFhJTlQgKEZudGggKG1h a2VfbnVtYmVyICgwKSwgeF95X2hwb3NfdnBvcykpOworICAgICAgICAgICAgICB5ID0gWElOVCAo Rm50aCAobWFrZV9udW1iZXIgKDEpLCB4X3lfaHBvc192cG9zKSk7CisgICAgICAgICAgICAgIGhw b3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMiksIHhfeV9ocG9zX3Zwb3MpKTsKKyAgICAg ICAgICAgICAgdnBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgzKSwgeF95X2hwb3NfdnBv cykpOworICAgICAgICAgICAgICBtY19lcmFzZSAodywgeCwgeSwgaHBvcywgdnBvcywgY3Vyc29y X3R5cGUsIGN1cnNvcl93aWR0aCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGlm IChOSUxQIChCVkFSIChiLCBtY19saXN0KSkpCisgICAgICAgIHdzZXRfbWNfY2FjaGUgKHcsIFFu aWwpOworICAgIH0KKyAgaWYgKCFyZW1vdmUKKyAgICAgICYmIHcgPT0gc3cKKyAgICAgICYmIHct Pm1jLnN0YXJ0CisgICAgICAmJiB3LT5tYy5lbmQKKyAgICAgICYmIHctPm1jLnByZXZfc3RhcnQK KyAgICAgICYmIHctPm1jLnByZXZfZW5kCisgICAgICAmJiB3LT5tYy5zdGFydCA9PSB3LT5tYy5w cmV2X3N0YXJ0CisgICAgICAmJiB3LT5tYy5lbmQgPT0gdy0+bWMucHJldl9lbmQKKyAgICAgICYm ICFOSUxQIChCVkFSIChiLCBtY19saXN0KSkKKyAgICAgICYmIHctPm1jX2NhY2hlCisgICAgICAm JiAhTklMUCAoRmVxdWFsIChGbnRoIChtYWtlX251bWJlciAoMCksIHctPm1jX2NhY2hlKSwgQlZB UiAoYiwgbWNfbGlzdCkpKSkKKyAgICB7CisjaWZkZWYgR0xZUEhfREVCVUcKKyAgZGVidWdfbWV0 aG9kX2FkZCAodywgIm1jX2NhbGM6ICBkcmF3IGN1cnNvcnMgdXNpbmcgY2FjaGUiKTsKKyNlbmRp ZgorICAgICAgZm9yICh2bGlzdCA9IFhDQVIgKFhDRFIgKHctPm1jX2NhY2hlKSk7CisgICAgICAg ICAgIENPTlNQICh2bGlzdCk7CisgICAgICAgICAgIHZsaXN0ID0gWENEUiAodmxpc3QpKQorICAg ICAgICB7CisgICAgICAgICAgY3Vyc29yX3NwZWNfbGlzdCA9IFhDQVIgKFhDQVIgKHZsaXN0KSk7 CisgICAgICAgICAgcG9zaW50ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCBjdXJzb3Jf c3BlY19saXN0KSk7CisgICAgICAgICAgY3Vyc29yX3NwZWNfdHlwZSA9IEZudGggKG1ha2VfbnVt YmVyICgxKSwgY3Vyc29yX3NwZWNfbGlzdCk7CisgICAgICAgICAgaWYgKENPTlNQIChjdXJzb3Jf c3BlY190eXBlKSkKKyAgICAgICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJzb3Jf dHlwZSAoWENBUiAoY3Vyc29yX3NwZWNfdHlwZSkpOworICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKGN1cnNvcl9zcGVj X3R5cGUpOworICAgICAgICAgIGlmIChDT05TUCAoY3Vyc29yX3NwZWNfdHlwZSkpCisgICAgICAg ICAgICBjdXJzb3Jfd2lkdGggPSBYSU5UIChYQ0FSIChYQ0RSIChjdXJzb3Jfc3BlY190eXBlKSkp OworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSAxOworICAg ICAgICAgIGN1cnNvcl9jb2xvcl92ZWN0b3IgPSBGbnRoIChtYWtlX251bWJlciAoMiksIGN1cnNv cl9zcGVjX2xpc3QpOworICAgICAgICAgIGlmIChTVFJJTkdQIChjdXJzb3JfY29sb3JfdmVjdG9y KSkKKyAgICAgICAgICAgIGN1cnNvcl9jb2xvcl92ZWN0b3IgPSBtY19jb2xvcl92ZWN0b3JfY2Fs Y3VsYXRlICh3LCBjdXJzb3JfY29sb3JfdmVjdG9yKTsKKyAgICAgICAgICByZWQgPSBYRkxPQVRf REFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3RvciwgMCkpOworICAgICAgICAgIGdyZWVuID0g WEZMT0FUX0RBVEEgKEFSRUYgKGN1cnNvcl9jb2xvcl92ZWN0b3IsIDEpKTsKKyAgICAgICAgICBi bHVlID0gWEZMT0FUX0RBVEEgKEFSRUYgKGN1cnNvcl9jb2xvcl92ZWN0b3IsIDIpKTsKKyAgICAg ICAgICBpZiAocG9zaW50CisgICAgICAgICAgICAgICYmIHctPm1jLnN0YXJ0CisgICAgICAgICAg ICAgICYmIHctPm1jLmVuZAorICAgICAgICAgICAgICAmJiBwb3NpbnQgPj0gdy0+bWMuc3RhcnQK KyAgICAgICAgICAgICAgJiYgcG9zaW50IDw9IHctPm1jLmVuZCkKKyAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgeF95X2hwb3NfdnBvcyA9IFhDQVIgKFhDRFIgKFhDQVIgKHZsaXN0KSkpOwor ICAgICAgICAgICAgICB4ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB4X3lfaHBvc192 cG9zKSk7CisgICAgICAgICAgICAgIHkgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMSksIHhf eV9ocG9zX3Zwb3MpKTsKKyAgICAgICAgICAgICAgaHBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVt YmVyICgyKSwgeF95X2hwb3NfdnBvcykpOworICAgICAgICAgICAgICB2cG9zID0gWElOVCAoRm50 aCAobWFrZV9udW1iZXIgKDMpLCB4X3lfaHBvc192cG9zKSk7CisgICAgICAgICAgICAgIG1jX2Ry YXcgKHcsIHgsIHksIGhwb3MsIHZwb3MsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJlZCwg Z3JlZW4sIGJsdWUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICBpZiAoIXJl bW92ZQorICAgICAgJiYgdyA9PSBzdworICAgICAgJiYgdy0+bWMuc3RhcnQKKyAgICAgICYmIHct Pm1jLmVuZAorICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIG1jX2xpc3QpKSkKKyAgICB7CisjaWZk ZWYgR0xZUEhfREVCVUcKKyAgZGVidWdfbWV0aG9kX2FkZCAodywgIm1jX2NhbGM6ICBkcmF3IGN1 cnNvcnMgYW5ldyIpOworI2VuZGlmCisgICAgICBmb3IgKHZsaXN0ID0gQlZBUiAoYiwgbWNfbGlz dCk7CisgICAgICAgICAgIENPTlNQICh2bGlzdCk7CisgICAgICAgICAgIHZsaXN0ID0gWENEUiAo dmxpc3QpKQorICAgICAgICB7CisgICAgICAgICAgY3Vyc29yX3NwZWNfbGlzdCA9IFhDQVIgKHZs aXN0KTsKKyAgICAgICAgICBwb3NpbnQgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMCksIGN1 cnNvcl9zcGVjX2xpc3QpKTsKKyAgICAgICAgICBjdXJzb3Jfc3BlY190eXBlID0gRm50aCAobWFr ZV9udW1iZXIgKDEpLCBjdXJzb3Jfc3BlY19saXN0KTsKKyAgICAgICAgICBpZiAoQ09OU1AgKGN1 cnNvcl9zcGVjX3R5cGUpKQorICAgICAgICAgICAgY3Vyc29yX3R5cGUgPSBtY19saXNwX3RvX2N1 cnNvcl90eXBlIChYQ0FSIChjdXJzb3Jfc3BlY190eXBlKSk7CisgICAgICAgICAgICBlbHNlCisg ICAgICAgICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoY3Vyc29y X3NwZWNfdHlwZSk7CisgICAgICAgICAgaWYgKENPTlNQIChjdXJzb3Jfc3BlY190eXBlKSkKKyAg ICAgICAgICAgIGN1cnNvcl93aWR0aCA9IFhJTlQgKFhDQVIgKFhDRFIgKGN1cnNvcl9zcGVjX3R5 cGUpKSk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCA9IDE7 CisgICAgICAgICAgY3Vyc29yX2NvbG9yX3ZlY3RvciA9IEZudGggKG1ha2VfbnVtYmVyICgyKSwg Y3Vyc29yX3NwZWNfbGlzdCk7CisgICAgICAgICAga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ICAgICAgICAgICAgICAgICAgICAgIEZj b25zIChidWYsIFFuaWwpKSk7CisgICAgfQorICB3LT5tYy5kcmF3X2VyYXNlID0gZmFsc2U7Cisg IGlmIChvbGRfYnVmZmVyKQorICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOwor fQorCit2b2lkCittY19yZW1vdmVfd2hlbl9zY3JvbGxlZCAoc3RydWN0IHdpbmRvdyAqdykKK3sK KyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIC8qIFJFTU9WRSBGQUtF IENVUlNPUlMKKyAgICAgdXBkYXRlX2JlZ2luIChmKSBhbmQgdXBkYXRlX2VuZCAoZikgYXJlIG5l ZWRlZCBmb3IgcXVpY2sgcmVtb3ZhbCBvZiBmYWtlIGN1cnNvcnM7CisgICAgIG90aGVyd2lzZSwg dGhlIHVzZXIgc2VlcyByZW1vdmFsIG9mIGVhY2ggZmFrZSBjdXJzb3IgaW4gIHMtbC1vLXcgIG0t by10LWktby1uISAqLworICB1cGRhdGVfYmVnaW4gKGYpOworICBpZiAoIXctPnBzZXVkb193aW5k b3dfcCkKKyAgICB7CisgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgIGlmICh3LT5tYy5kcmF3 X2VyYXNlCisgICAgICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBt Y19saXN0KSkKKyAgICAgICAgICAmJiAody0+bWNfY2FjaGUgJiYgKEVRICh3LT5jb250ZW50cywg WENBUiAoRm50aCAobWFrZV9udW1iZXIgKDIpLCB3LT5tY19jYWNoZSkpKSkpCisgICAgICAgICAg JiYgIU1JTklfV0lORE9XX1AgKHcpKQorICAgICAgICBtY19jYWxjICh3LCAxKTsKKyAgICAgIHVu YmxvY2tfaW5wdXQgKCk7CisgICAgfQorICB1cGRhdGVfZW5kIChmKTsKK30KKworREVGVU4gKCJt Yy1kcmF3LWZuIiwgRm1jX2RyYXdfZm4sIF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AobWFrZV9udW1iZXIgKDIpLCB4X3lfaHBvc192cG9zKSk7CisgICAgICAgICAgICAgIHct Pm1jLnByZXZfc3RhcnRfdnBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgzKSwgeF95X2hw b3NfdnBvcykpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgdy0+bWMucHJldl9zdGFydCA9IC0xOworICAgICAgICAgICAg ICAgIHctPm1jLnByZXZfc3RhcnRfeCA9IC0xOworICAgICAgICAgICAgICAgIHctPm1jLnByZXZf c3RhcnRfeSA9IC0xOworICAgICAgICAgICAgICAgIHctPm1jLnByZXZfc3RhcnRfaHBvcyA9IC0x OworICAgICAgICAgICAgICAgIHctPm1jLnByZXZfc3RhcnRfdnBvcyA9IC0xOworICAgICAgICAg ICAgICB9CisgICAgICAgICAgaWYgKHctPm1jLmVuZCkKKyAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgdy0+bWMucHJldl9lbmQgPSB3LT5tYy5lbmQ7CisgICAgICAgICAgICAgIC8qIGVvYiBJ UyB2aXNpYmxlLgorICAgICAgICAgICAgICBFeGNsdWRlcyBhIHNpdHVhdGlvbiB3aGVuIGxhc3Qg dmlzaWJsZSBsaW5lIGF0IGJvdHRvbSBvZiB3aW5kb3cgY29udGFpbnMgZW9iLiAgKi8KKyAgICAg ICAgICAgICAgaWYgKHctPm1jLnByZXZfZW5kID09IGVuZCkKKyAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgICB4X3lfaHBvc192cG9zID0gRm50aCAobWFrZV9udW1iZXIgKDApLCBt Y194X3lfaHBvc192cG9zICh3LCB3LT5tYy5wcmV2X2VuZCwgc3RhcnQsIGVuZCkpOworICAgICAg ICAgICAgICAgICAgdy0+bWMucHJldl9lbmRfeCA9IHctPm1jLmVuZF94OworICAgICAgICAgICAg ICAgICAgdy0+bWMucHJldl9lbmRfeSA9IHctPm1jLmVuZF95OworICAgICAgICAgICAgICAgICAg dy0+bWMucHJldl9lbmRfaHBvcyA9IHctPm1jLmVuZF9ocG9zOworICAgICAgICAgICAgICAgICAg dy0+bWMucHJldl9lbmRfdnBvcyA9IHctPm1jLmVuZF92cG9zOworICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgICAgICAvKiBlb2IgaXMgTk9UIHZpc2libGUuCisgICAgICAgICAgICAgICAg RXhjbHVkZXMgYSBzaXR1YXRpb24gd2hlbiBsYXN0IHZpc2libGUgbGluZSBhdCBib3R0b20gb2Yg d2luZG93IGNvbnRhaW5zIGVvYi4gICoqLworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgeF95X2hwb3NfdnBvcyA9IEZudGggKG1h a2VfbnVtYmVyICgwKSwgbWNfeF95X2hwb3NfdnBvcyAodywgdy0+bWMucHJldl9lbmQsIHN0YXJ0 LCBlbmQpKTsKKyAgICAgICAgICAgICAgICAgICAgdy0+bWMucHJldl9lbmRfeCA9IFhJTlQgKEZu dGggKG1ha2VfbnVtYmVyICgwKSwgeF95X2hwb3NfdnBvcykpOworICAgICAgICAgICAgICAgICAg ICB3LT5tYy5wcmV2X2VuZF95ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB4X3lfaHBv c192cG9zKSk7CisgICAgICAgICAgICAgICAgICAgIHctPm1jLnByZXZfZW5kX2hwb3MgPSBYSU5U IChGbnRoIChtYWtlX251bWJlciAoMiksIHhfeV9ocG9zX3Zwb3MpKTsKKyAgICAgICAgICAgICAg ICAgICAgdy0+bWMucHJldl9lbmRfdnBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgzKSwg eF95X2hwb3NfdnBvcykpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdy0+bWMucHJl dl9lbmQgPSAtMTsKKyAgICAgICAgICAgICAgICB3LT5tYy5wcmV2X2VuZF94ID0gLTE7CisgICAg ICAgICAgICAgICAgdy0+bWMucHJldl9lbmRfeSA9IC0xOworICAgICAgICAgICAgICAgIHctPm1j LnByZXZfZW5kX2hwb3MgPSAtMTsKKyAgICAgICAgICAgICAgICB3LT5tYy5wcmV2X2VuZF92cG9z ID0gLTE7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICBpZiAody0+bWMub3BvaW50KQorICAg ICAgICAgICAgeworICAgICAgICAgICAgICB3LT5tYy5wcmV2X29wb2ludCA9IHctPm1jLm9wb2lu dDsKKyAgICAgICAgICAgICAgdy0+bWMucHJldl9vcG9pbnRfeCA9IHctPm1jLm9wb2ludF94Owor ICAgICAgICAgICAgICB3LT5tYy5wcmV2X29wb2ludF95ID0gdy0+bWMub3BvaW50X3k7CisgICAg ICAgICAgICAgIHctPm1jLnByZXZfb3BvaW50X2hwb3MgPSB3LT5tYy5vcG9pbnRfaHBvczsKKyAg ICAgICAgICAgICAgdy0+bWMucHJldl9vcG9pbnRfdnBvcyA9IHctPm1jLm9wb2ludF92cG9zOwor ICAgICAgICAgICAgfQorCisgICAgICAgICAgdy0+bWMub3BvaW50ID0gUFQ7CisgICAgICAgICAg eF95X2hwb3NfdnBvcyA9IEZudGggKG1ha2VfbnVtYmVyICgwKSwgbWNfeF95X2hwb3NfdnBvcyAo dywgdy0+bWMub3BvaW50LCBzdGFydCwgZW5kKSk7CisgICAgICAgICAgdy0+bWMub3BvaW50X3gg PSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMCksIHhfeV9ocG9zX3Zwb3MpKTsKKyAgICAgICAg ICB3LT5tYy5vcG9pbnRfeSA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgxKSwgeF95X2hwb3Nf dnBvcykpOworICAgICAgICAgIHctPm1jLm9wb2ludF9ocG9zID0gWElOVCAoRm50aCAobWFrZV9u dW1iZXIgKDIpLCB4X3lfaHBvc192cG9zKSk7CisgICAgICAgICAgdy0+bWMub3BvaW50X3Zwb3Mg PSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMyksIHhfeV9ocG9zX3Zwb3MpKTsKKworICAgICAg ICAgIHctPm1jLnN0YXJ0ID0gc3RhcnQ7CisgICAgICAgICAgeF95X2hwb3NfdnBvcyA9IEZudGgg KG1ha2VfbnVtYmVyICgwKSwgbWNfeF95X2hwb3NfdnBvcyAodywgc3RhcnQsIHN0YXJ0LCBlbmQp KTsKKyAgICAgICAgICB3LT5tYy5zdGFydF94ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDAp LCB4X3lfaHBvc192cG9zKSk7CisgICAgICAgICAgdy0+bWMuc3RhcnRfeSA9IFhJTlQgKEZudGgg KG1ha2VfbnVtYmVyICgxKSwgeF95X2hwb3NfdnBvcykpOworICAgICAgICAgIHctPm1jLnN0YXJ0 X2hwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMiksIHhfeV9ocG9zX3Zwb3MpKTsKKyAg ICAgICAgICB3LT5tYy5zdGFydF92cG9zID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDMpLCB4 X3lfaHBvc192cG9zKSk7CisKKyAgICAgICAgICB3LT5tYy5lbmQgPSBlbmQ7CisgICAgICAgICAg eF95X2hwb3NfdnBvcyA9IEZudGggKG1ha2VfbnVtYmVyICgwKSwgbWNfeF95X2hwb3NfdnBvcyAo dywgZW5kLCBzdGFydCwgZW5kKSk7CisgICAgICAgICAgdy0+bWMuZW5kX3ggPSBYSU5UIChGbnRo IChtYWtlX251bWJlciAoMCksIHhfeV9ocG9zX3Zwb3MpKTsKKyAgICAgICAgICB3LT5tYy5lbmRf eSA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgxKSwgeF95X2hwb3NfdnBvcykpOworICAgICAg ICAgIHctPm1jLmVuZF9ocG9zID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDIpLCB4X3lfaHBv c192cG9zKSk7CisgICAgICAgICAgdy0+bWMuZW5kX3Zwb3MgPSBYSU5UIChGbnRoIChtYWtlX251 bWJlciAoMyksIHhfeV9ocG9zX3Zwb3MpKTsKKworICAgICAgICAgIC8qIFN0YXJ0IHJlbWFpbnMg dGhlIHNhbWUuICAqLworICAgICAgICAgIGlmICh3LT5tYy5wcmV2X3N0YXJ0X3Zwb3MgPT0gdy0+ bWMuc3RhcnRfdnBvcworICAgICAgICAgICAgICB8fCB3LT5tYy5wcmV2X2VuZCA8IHctPm1jLnN0 YXJ0KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICB3LT5tYy55X2RpZmYgPSAwOworICAg ICAgICAgICAgICB3LT5tYy52cG9zX2RpZmYgPSAwOworICAgICAgICAgICAgfQorICAgICAgICAg ICAgLyogU2NyZWVuIG1vdmVkIOKWvCAtLSBlLmcuLCBgcHJldmlvdXMtbGluZScsIGBzY3JvbGwt ZG93bicuICAqLworICAgICAgICAgICAgZWxzZSBpZiAody0+bWMucHJldl9zdGFydF92cG9zID4g MCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHctPm1jLnlfZGlmZiA9ICh3LT5t Yy5wcmV2X3N0YXJ0X3kgLSB3LT5tYy5zdGFydF95KSAqIC0xOworICAgICAgICAgICAgICAgIHct Pm1jLnZwb3NfZGlmZiA9ICh3LT5tYy5wcmV2X3N0YXJ0X3Zwb3MgLSB3LT5tYy5zdGFydF92cG9z KSAqIC0xOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIC8qIFNjcmVlbiBtb3ZlZCDi lrIgKGVvYiBOT1QgdmlzaWJsZSkgLS0gZS5nLiwgYG5leHQtbGluZScsIGBzY3JvbGwtdXAnLiAg Ki8KKyAgICAgICAgICAgICAgZWxzZSBpZiAody0+bWMuZW5kX3Zwb3MgPiB3LT5tYy5wcmV2X2Vu ZF92cG9zICYmIHctPm1jLnByZXZfZW5kICE9IC0xKQorICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgIHctPm1jLnlfZGlmZiA9IHctPm1jLmVuZF95IC0gdy0+bWMucHJldl9lbmRf eTsKKyAgICAgICAgICAgICAgICAgIHctPm1jLnZwb3NfZGlmZiA9IHctPm1jLmVuZF92cG9zIC0g dy0+bWMucHJldl9lbmRfdnBvczsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAg LyogU2NyZWVuIG1vdmVkIOKWsiAoZW9iIElTIHZpc2libGUpIC0tIGUuZy4sIGBuZXh0LWxpbmUn LCBgc2Nyb2xsLXVwJy4gICovCisgICAgICAgICAgICAgICAgZWxzZSBpZiAody0+bWMuZW5kX3Zw b3MgPCB3LT5tYy5wcmV2X2VuZF92cG9zICYmIHctPm1jLnByZXZfZW5kICE9IC0xKQorICAgICAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB3LT5tYy55X2RpZmYgPSB3LT5tYy5w cmV2X2VuZF95IC0gdy0+bWMuZW5kX3k7CisgICAgICAgICAgICAgICAgICAgIHctPm1jLnZwb3Nf ZGlmZiA9IHctPm1jLnByZXZfZW5kX3Zwb3MgLSB3LT5tYy5lbmRfdnBvczsKKyAgICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIC8qIFNjcmVlbiBtb3ZlZCDilrIgKGVvYiBqdXN0 IGJlY2FtZSB2aXNpYmxlKSAtLSBlLmcuLCBgbmV4dC1saW5lJywgYHNjcm9sbC11cCcuCisgICAg ICAgICAgICAgICAgICBBYnNlbnQgc3VidHJhY3RpbmcgMSBmcm9tIHctPm1jLnByZXZfZW5kLCB0 aGF0IHBvaW50IGFuZCB0aGUgbmV3IHctPm1jLmVuZCBhcmUKKyAgICAgICAgICAgICAgICAgIG9u IHRoZSBzYW1lIGxpbmUgYW5kIGl0IGFwcGVhcnMgdGhhdCBub3RoaW5nIGhhcyBjaGFuZ2VkIC0t IHctPm1jLnByZXZfZW5kIGlzCisgICAgICAgICAgICAgICAgICBvbiB0aGUgZmFyIGxlZnQgb2Yg dGhlIGxpbmUgYW5kIHctPm1jLmVuZCBpcyBvbiB0aGUgZmFyIHJpZ2h0IG9mIHRoZSBsaW5lLiAg Ki8KKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHctPm1jLmVuZF92cG9zID09IHctPm1jLnBy ZXZfZW5kX3Zwb3MpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAg ICB4X3lfaHBvc192cG9zID0gRm50aCAobWFrZV9udW1iZXIgKDApLCBtY194X3lfaHBvc192cG9z ICh3LCB3LT5tYy5wcmV2X2VuZCAtIDEsIHN0YXJ0LCBlbmQpKTsKKyAgICAgICAgICAgICAgICAg ICAgICB3LT5tYy5wcmV2X2VuZF94ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB4X3lf aHBvc192cG9zKSk7CisgICAgICAgICAgICAgICAgICAgICAgdy0+bWMucHJldl9lbmRfeSA9IFhJ TlQgKEZudGggKG1ha2VfbnVtYmVyICgxKSwgeF95X2hwb3NfdnBvcykpOworICAgICAgICAgICAg ICAgICAgICAgIHctPm1jLnByZXZfZW5kX2hwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAo MiksIHhfeV9ocG9zX3Zwb3MpKTsKKyAgICAgICAgICAgICAgICAgICAgICB3LT5tYy5wcmV2X2Vu ZF92cG9zID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDMpLCB4X3lfaHBvc192cG9zKSk7Cisg ICAgICAgICAgICAgICAgICAgICAgdy0+bWMueV9kaWZmID0gdy0+bWMuZW5kX3kgLSB3LT5tYy5w cmV2X2VuZF95OworICAgICAgICAgICAgICAgICAgICAgIHctPm1jLnZwb3NfZGlmZiA9IHctPm1j LmVuZF92cG9zIC0gdy0+bWMucHJldl9lbmRfdnBvczsKKyAgICAgICAgICAgICAgICAgICAgfQor ICAgICAgICAgICAgICAgIC8qIGBtYy1saXN0YCBoYXMganVzdCBiZWVuIGluaXRpYWxpemVkIC0t IHByZXZpb3VzIHN0YXJ0L2VuZCBhcmUgc2V0IHRvIC0xLiAgKi8KKyAgICAgICAgICAgICAgICAg ICAgZWxzZSBpZiAody0+bWMucHJldl9lbmQgPT0gLTEpCisgICAgICAgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgICAgICAgdy0+bWMueV9kaWZmID0gMDsKKyAgICAgICAgICAg ICAgICAgICAgICAgIHctPm1jLnZwb3NfZGlmZiA9IDA7CisgICAgICAgICAgICAgICAgICAgICAg fQorCisgICAgICAgICAgaWYgKHctPm1jLnlfZGlmZiA8IDApCisgICAgICAgICAgICB3LT5tYy55 X2RpZmYgPSBhYnMgKHctPm1jLnlfZGlmZik7CisgICAgICAgICAgICBlbHNlIGlmICh3LT5tYy55 X2RpZmYgPiAwKQorICAgICAgICAgICAgICB3LT5tYy55X2RpZmYgPSB3LT5tYy55X2RpZmYgKiAt MTsKKyAgICAgICAgICBpZiAody0+bWMudnBvc19kaWZmIDwgMCkKKyAgICAgICAgICAgIHctPm1j LnZwb3NfZGlmZiA9IGFicyAody0+bWMudnBvc19kaWZmKTsKKyAgICAgICAgICAgIGVsc2UgaWYg KHctPm1jLnZwb3NfZGlmZiA+IDApCisgICAgICAgICAgICB3LT5tYy52cG9zX2RpZmYgPSB3LT5t Yy52cG9zX2RpZmYgKiAtMTsKKworLyogI2lmZGVmIEdMWVBIX0RFQlVHCisgIGRlYnVnX21ldGhv ZF9hZGQgKHcsICJkaWZmOiAoJWQgJWQpIHwgcHJldl9zdGFydDogJWQgKCVkICVkICVkICVkKSB8 IHN0YXJ0OiAlZCAoJWQgJWQgJWQgJWQpIHwgcHJldl9lbmQ6ICVkICglZCAlZCAlZCAlZCkgfCBl bmQ6ICVkICglZCAlZCAlZCAlZCkiLAorICAgIHctPm1jLnlfZGlmZiwgdy0+bWMudnBvc19kaWZm LAorICAgIHctPm1jLnByZXZfc3RhcnQsIHctPm1jLnByZXZfc3RhcnRfeCwgdy0+bWMucHJldl9z dGFydF95LCB3LT5tYy5wcmV2X3N0YXJ0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VtYmVyICgyKSwgdy0+bWNfY2FjaGUpKSkpKSkKKyAgICAgICAgICAmJiAhTUlO SV9XSU5ET1dfUCAodykpCisgICAgICAgIHsKKyAgICAgICAgICAvKiBSZW1vdmUgZmFrZSBjdXJz b3JzLiAgKi8KKyAgICAgICAgICBpZiAoKHctPm1jX2NhY2hlICYmIChFUSAody0+Y29udGVudHMs IFhDQVIgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgdy0+bWNfY2FjaGUpKSkpKSkKKyAgICAgICAg ICAgIG1jX2NhbGMgKHcsIDEpOworICAgICAgICAgIC8qIERyYXcgZmFrZSBjdXJzb3JzICAqLwor ICAgICAgICAgIGlmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19saXN0 KSkpCisgICAgICAgICAgICBtY19jYWxjICh3LCAwKTsKKyAgICAgICAgfQorCisgICAgICAvKiBG aXJzdCBhdHRlbXB0IGF0IGRlYWxpbmcgd2l0aCBhIGByZWRpc3BsYXlfcHJlc2VydmVfZWNob19h cmVhJyBzaXR1YXRpb24uICAqLworICAgICAgaWYgKCF3LT5tYy5kcmF3X2VyYXNlCisgICAgICAg ICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfbGlzdCkpCisgICAg ICAgICAgJiYgdy0+bWNfY2FjaGUKKyAgICAgICAgICAmJiAoRVEgKHctPmNvbnRlbnRzLCBYQ0FS IChGbnRoIChtYWtlX251bWJlciAoMiksIHctPm1jX2NhY2hlKSkpKQorICAgICAgICAgICYmICFN SU5JX1dJTkRPV19QICh3KSkKKyAgICAgICAgeworICAgICAgICAgIC8qIFJlbW92ZSBmYWtlIGN1 cnNvcnMuICAqLworICAgICAgICAgIG1jX2NhbGMgKHcsIDEpOworICAgICAgICAgIC8qIERyYXcg ZmFrZSBjdXJzb3JzICAqLworICAgICAgICAgIG1jX2NhbGMgKHcsIDApOworICAgICAgICB9CisK Ky8qIEVORCBtdWx0aXBsZ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B9CisgICAgY2FzZSBG SUxMRURfQk9YX0NVUlNPUjoKKyAgICB7CisgICAgICAgLyogVE9ETzogIGtkYiB0byBjb25zaWRl ciBhZGRpbmcgc3VwcG9ydCBmb3IgbXVsdGlwbGUgY3Vyc29yIGZvcmVncm91bmQKKyAgICAgICBj dXN0b21pemF0aW9uIG9mIGEgRklMTEVEX0JPWF9DVVJTT1IuICAqLworICAgICAgaWYgKHJlZCA+ PSAwICYmIGJsdWUgPj0gMCAmJiBncmVlbiA+PSAwKQorICAgICAgICAvKiBUZW1wb3JhcmlseSBo aWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYycgYnkgYm9ycm93aW5nIHRoZQorICAg ICAgICBmdW5jdGlvbmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHhmbnMuYy4gICovCisgICAgICAg IHsKKyAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICBMaXNwX09iamVjdCB3aW5k b3cgPSAoc2VsZWN0ZWRfd2luZG93KTsKKyAgICAgICAgICBzdHJ1Y3Qgd2luZG93ICp3ID0gZGVj b2RlX2xpdmVfd2luZG93ICh3aW5kb3cpOworICAgICAgICAgIHN0cnVjdCBmcmFtZSAqZiA9IFhG UkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7CisgICAgICAgICAgc3RydWN0IHhfZGlzcGxheV9pbmZv ICpkcHlpbmZvID0gRlJBTUVfRElTUExBWV9JTkZPIChmKTsKKyAgICAgICAgICBpbnQgaW50X3Jl ZCA9IHJlZCAqIDY1NTM1OworICAgICAgICAgIGludCBpbnRfZ3JlZW4gPSBncmVlbiAqIDY1NTM1 OworICAgICAgICAgIGludCBpbnRfYmx1ZSA9IGJsdWUgKiA2NTUzNTsKKyAgICAgICAgICBYR0NW YWx1ZXMgZ2NfdmFsdWVzOworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgbWFzayA9IEdDRm9yZWdy b3VuZCB8IEdDQmFja2dyb3VuZCB8IEdDRmlsbF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z b3JfZ2MgPSBmYWxzZTsKKyAgICAgICAgICBnY192YWx1ZXMubGluZV93aWR0aCA9IDA7ICAvKiBN ZWFucyAxIHVzaW5nIGZhc3QgYWxnb3JpdGhtLiAgKi8KKyAgICAgICAgICBnY192YWx1ZXMuZm9y ZWdyb3VuZCA9IG9yaWdfdmFsX2E7CisgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBv cmlnX3ZhbF9iOworICAgICAgICAgIGdjX3ZhbHVlcy5maWxsX3N0eWxlID0gRmlsbE9wYXF1ZVN0 aXBwbGVkOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYworICAgICAgICAg ICAgPSBYQ3JlYXRlR0MgKEZSQU1FX1hfRElTUExBWSAoZiksIEZSQU1FX1hfV0lORE9XIChmKSwg bWFzaywgJmdjX3ZhbHVlcyk7CisgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAg fQorICAgICAgICBlbHNlCisgICAgICAgICAgZHJhd19waHlzX2N1cnNvcl9nbHlwaCAodywgZ2x5 cGhfcm93LCBEUkFXX0NVUlNPUik7CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBCQVJf Q1VSU09SOgorICAgIHsKKyAgICAgIGlmIChyZWQgPj0gMCAmJiBibHVlID49IDAgJiYgZ3JlZW4g Pj0gMCkKKyAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5j dXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBmcmFtZSAqZiA9 IFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7CisgICAgICAgICAgc3RydWN0IHhfZGlzcGxheV9p bmZvICpkcHlpbmZvID0gRlJBTUVfRElTUExBWV9JTkZPIChmKTsKKyAgICAgICAgICB1bnNpZ25l ZCBsb25nIG9yaWdfdmFsID0gZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsOworICAgICAg ICAgIGludCBpbnRfcmVkID0gcmVkICogNjU1MzU7CisgICAgICAgICAgaW50IGludF9ncmVlbiA9 IGdyZWVuICogNjU1MzU7CisgICAgICAgICAgaW50IGludF9ibHVlID0gYmx1ZSAqIDY1NTM1Owor ICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IHhfbWFrZV90cnVlY29s b3JfcGl4ZWwgKGRweWluZm8sIGludF9yZWQsIGludF9ncmVlbiwgaW50X2JsdWUpOworICAgICAg ICAgIHhfZHJhd19iYXJfY3Vyc29yICh3LCBnbHlwaF9yb3csIGN1cnNvcl93aWR0aCwgQkFSX0NV UlNPUik7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ192 YWw7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIHhfZHJhd19iYXJfY3Vyc29y ICh3LCBnbHlwaF9yb3csIGN1cnNvcl93aWR0aCwgQkFSX0NVUlNPUik7CisgICAgICBicmVhazsK KyAgICB9CisgICAgY2FzZSBIQkFSX0NVUlNPUjoKKyAgICB7CisgICAgICBpZiAocmVkID49IDAg JiYgYmx1ZSA+PSAwICYmIGdyZWVuID49IDApCisgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFj ayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgIHsKKyAgICAg ICAgICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworICAgICAg ICAgIHN0cnVjdCB4X2Rpc3BsYXlfaW5mbyAqZHB5aW5mbyA9IEZSQU1FX0RJU1BMQVlfSU5GTyAo Zik7CisgICAgICAgICAgdW5zaWduZWQgbG9uZyBvcmlnX3ZhbCA9IGYtPm91dHB1dF9kYXRhLngt PmN1cnNvcl9waXhlbDsKKyAgICAgICAgICBpbnQga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7Ci0JICAgIH0KIAl9CiAKICNpZmRlZiBIQVZFX1hf STE4Tgo= --Multipart_Sun_Jun_25_15:09:16_2017-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: Can we support multiple Cursors? References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sun, 30 Jul 2017 17:40:01 +0000 Resent-Message-ID: <handler.22873.B22873.15014363938750 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22873 <at> debbugs.gnu.org Cc: John Wiegley <jwiegley@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>, Marcin Borkowski <mbork@HIDDEN>, Richard Stallman <rms@HIDDEN> Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.15014363938750 (code B ref 22873); Sun, 30 Jul 2017 17:40:01 +0000 Received: (at 22873) by debbugs.gnu.org; 30 Jul 2017 17:39:53 +0000 Received: from localhost ([127.0.0.1]:34496 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1dbsC0-0002H1-Kn for submit <at> debbugs.gnu.org; Sun, 30 Jul 2017 13:39:52 -0400 Received: from gateway22.websitewelcome.com ([192.185.46.233]:39137) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1dbsBx-0002Gs-W9 for 22873 <at> debbugs.gnu.org; Sun, 30 Jul 2017 13:39:50 -0400 Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway22.websitewelcome.com (Postfix) with ESMTP id 7EAB514010 for <22873 <at> debbugs.gnu.org>; Sun, 30 Jul 2017 12:39:48 -0500 (CDT) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id bsBQd8cTAc72gbsBQd3GP4; Sun, 30 Jul 2017 12:39:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=+1JmwdhsNQdis9wfPVra/ezccOpuxefbHYi3b4D4y0w=; b=F+ay9fr+ZXW4HFTLF9PFSJLGHe i1pKYKfc2dfVf9NN/MPIwcGVTSE+7fWbKxJsq0J0sPIyJE5ik4hRSIXQjt5U/Es3vcgpTr82pYCg1 Ox4LNFF85Z/nWzFGg9lWNVDvtszWVZGYwiv+BgG24g41XsHas5UvIrNxQMelL+0j32KRQTFpqbzz3 oxWpuIVwG1pSEJfVbwASdHv1hL4Di+qP2ICTwTJG84VKSJgnHjuVY4QZNE46rxhkLPlxHBTfuJVq8 jswn7YutLD/Ld/ZDYt/1KPSJWq4Jb3qYTOlKOyeQXU6xGqD87aAzDmJV+EuMo8qMC1g6h5XVAXyKm 3DN/zXgg==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:50691 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.87) (envelope-from <esq@HIDDEN>) id 1dbsBu-000t09-J5; Sun, 30 Jul 2017 12:39:47 -0500 Date: Sun, 30 Jul 2017 10:39:45 -0700 Message-ID: <m2zibl963i.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Sun_Jul_30_10:39:45_2017-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Exim-ID: 1dbsBu-000t09-J5 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:50691 X-Source-Auth: lawlist X-Email-Count: 5 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: 0.0 (/) --Multipart_Sun_Jul_30_10:39:45_2017-1 Content-Type: text/plain; charset=US-ASCII VERSION: 009 - The patch applies to commit a30e7e12ed8465e2565dd318d921bc87f52ce18e from 03/28/2016. [@lawlist is unable to use the current master branch for daily workflow due to certain unrelated bugs. Until those unrelated bugs are resolved, @lawlist will continue using earlier versions of the master branch. @lawlist is tentatively thinking of moving forwards in time to October 1, 2016 bearing commit bb2ef5c6f7058b149adc9230a3db7d1fbd423c51, but testing will be needed prior thereto.] WHAT'S NEW: - `mc_store_previous_values': Recording values of the current command loop (to be compared against the previous command loop) has been consolidated into one function, which makes the modification to `xdisp.c` cleaner. - Bug Fixes: Enabling error checking when configuring the build revealed a few errors in the code that have now been corrected. It turned out that `update_window_end` is called in about 99% of the locations where multiple cursors need to be removed. A previous attempted optimization of `mc_calc` prevented cursor removal, and that bug has now been fixed. Fixed two crashes; one was caused by an improper usage of `intern_c_string`, and another was caused by attempting to remove cursors directly from `xdisp.c` instead of letting `update_window_end` do its job. TODO: - Track down the cause for the 1% of the time when multiple fake cursors are not being removed. [It may have something to do with redisplay being interrupted due to keyboard activity, or perhaps when windows/frames are changing size?] - Optimize drawing and removal of multiple fake cursors. - Implement a way to properly calculate x, y, hpos, vpos when overlays are present. The overlay after-string property wreaks havoc on the current method of calculating coordinates. - Try and motivate one or more real programmers to take over from here. ROAD MAP: - The first stage is the creation/removal of fake cursors. - The second stage will be built-in functionality similar to the multiple cursors library by Magnar Sveen. INSTALLATION: - STEP #1 (clone master branch): git clone -b master git://git.sv.gnu.org/emacs.git - STEP #2: cd over to the root of the `emacs` source directory cloned in the first step above. - STEP #3 (hard reset): git reset --hard a30e7e12ed8465e2565dd318d921bc87f52ce18e The following message is displayed in the terminal: "HEAD is now at a30e7e1 Mention the `M-q' changes" - STEP #4 (put the patch in place): Copy the latest patch (multiple_cursors_008.diff) to the root of the emacs source directory cloned in the first step above. - STEP #5 (apply the patch): git apply multiple_cursors_009.diff - STEP #6: ./autogen.sh - STEP #7: Configure the build for X, MS Windows, or OSX; e.g.,: ./configure --with-ns - STEP #8: make - STEP #9: make install - STEP #10: Launch the newly built Emacs, and copy the following function to the `*scratch*` buffer, and type `M-x mc-test`. (defun mc-test () "Draw fake cursors at all POS defined in the `mc-list'. Multiple fake cursors are supported by GUI versions of Emacs built for X, Windows and OSX. Popular forms of specifying colors such as \"red\" and \"#FF0000\" are now supported, as well as LSL color vectors such as [1.0 0.0 0.0]. For those users who choose the former familiar methods of specifying colors with strings, `mc_color_vector_calculate' will convert those strings to LSL color vectors. The color vectors are commonly referred to as LSL (The Linden Scripting Language). `nsterm.m' uses `NSColor', which works well with LSL. `w32term.c' uses `PALETTERGB' or `RGB', and the conversion from LSL is done internally by multiplying each element of the LSL color vector by 255. `xterm.c' uses `x_make_truecolor_pixel', which uses 16-bit RGB -- the conversion from LSL happens internally by multiplying each element of the LSL color vector by 65535." (interactive) (let ((buffer (get-buffer-create "*MC-TEST*"))) (with-current-buffer buffer (erase-buffer) (insert "This is a test!") (setq mc-list '((1 "hbar" "red") (2 "bar" "yellow") (3 "box" "#00FF00") (4 "hollow" "#0000FF") (5 ("hbar" 3) [1.0 0.0 1.0]) (6 ("bar" 3) [0.0 1.0 1.0])))) (select-window (display-buffer buffer)) ;;; The trigger in `keyboard.c` is not activated in this example, so we ;;; Force the multiple cursors to be drawn. (mc-draw-erase (selected-window)))) --Multipart_Sun_Jul_30_10:39:45_2017-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="multiple_cursors_009.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3NyYy9idWZmZXIuYyBiL3NyYy9idWZmZXIuYwppbmRleCA2MmIwYmM4Li41 Yjk0NjliIDEwMDY0NAotLS0gYS9zcmMvYnVmZmVyLmMKKysrIGIvc3JjL2J1ZmZlci5jCkBAIC01 MDU2LDYgKzUwNTYsMTYgQEAgaW5pdF9idWZmZXJfb25jZSAodm9pZCkKICAgYnNldF9sYXN0X3Nl bGVjdGVkX3dpbmRvdyAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgbWFrZV9udW1iZXIgKDApKTsKIAog ICBpZHggPSAxOworCisKKy8qIDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzsgKi8KKy8qIG11bHRpcGxl IGN1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HSU4gbXVsdGlwbGUgY3Vyc29ycyAqLworCisgICAgICBpZiAody0+bWMuZHJhd19l cmFzZQorICAgICAgICAgICYmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBt Y19saXN0KSkKKyAgICAgICAgICAgICAgfHwgKHctPm1jX2NhY2hlICYmIChFUSAody0+Y29udGVu dHMsIFhDQVIgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgdy0+bWNfY2FjaGUpKSkpKSkKKyAgICAg ICAgICAmJiAhTUlOSV9XSU5ET1dfUCAodykpCisgICAgICAgIHsKKyAgICAgICAgICAvKiBSZW1v dmUgZmFrZSBjdXJzb3JzLiAgKi8KKyAgICAgICAgICBpZiAoKHctPm1jX2NhY2hlICYmIChFUSAo dy0+Y29udGVudHMsIFhDQVIgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgdy0+bWNfY2FjaGUpKSkp KSkKKyAgICAgICAgICAgIG1jX2NhbGMgKHcsIDEpOworICAgICAgICAgIC8qIERyYXcgZmFrZSBj dXJzb3JzICAqLworICAgICAgICAgIGlmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBtY19saXN0KSkpCisgICAgICAgICAgICBtY19jYWxjICh3LCAwKTsKKyAgICAgICAgfQor CisgICAgICAvKiBGaXJzdCBhdHRlbXB0IGF0IGRlYWxpbmcgd2l0aCBhIGByZWRpc3BsYXlfcHJl c2VydmVfZWNob19hcmVhJyBzaXR1YXRpb24uICAqLworICAgICAgaWYgKCF3LT5tYy5kcmF3X2Vy YXNlCisgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNf bGlzdCkpCisgICAgICAgICAgJiYgdy0+bWNfY2FjaGUKKyAgICAgICAgICAmJiAoRVEgKHctPmNv bnRlbnRzLCBYQ0FSIChGbnRoIChtYWtlX251bWJlciAoMiksIHctPm1jX2NhY2hlKSkpKQorICAg ICAgICAgICYmICFNSU5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WF9DVVJTT1I6CisgICAgeworICAgICAgLyogVE9ETzogIGtkYiB0 byBjb25zaWRlciBhZGRpbmcgc3VwcG9ydCBmb3IgbXVsdGlwbGUgY3Vyc29yIGZvcmVncm91bmQK KyAgICAgIGN1c3RvbWl6YXRpb24gb2YgYSBGSUxMRURfQk9YX0NVUlNPUi4gICovCisgICAgICBp ZiAocmVkID49IDAgJiYgYmx1ZSA+PSAwICYmIGdyZWVuID49IDApCisgICAgICAgIC8qIFRlbXBv cmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MnIGJ5IGJvcnJvd2lu ZyB0aGUKKyAgICAgICAgZnVuY3Rpb25hbGl0eSBvZiBgeF9tYWtlX2djJyBpbiB3MzJmbnMuYy4g ICovCisgICAgICAgIHsKKyAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICBMaXNw X09iamVjdCB3aW5kb3cgPSAoc2VsZWN0ZWRfd2luZG93KTsKKyAgICAgICAgICBzdHJ1Y3Qgd2lu ZG93ICp3ID0gZGVjb2RlX2xpdmVfd2luZG93ICh3aW5kb3cpOworICAgICAgICAgIHN0cnVjdCBm cmFtZSAqZiA9IFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7CisgICAgICAgICAgaW50IGludF9y ZWQgPSByZWQgKiAyNTU7CisgICAgICAgICAgaW50IGludF9ncmVlbiA9IGdyZWVuICogMjU1Owor ICAgICAgICAgIGludCBpbnRfYmx1ZSA9IGJsdWUgKiAyNTU7CisgICAgICAgICAgWEdDVmFsdWVz IGdjX3ZhbHVlczsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIG1hc2sgPSBHQ0ZvbnQgfCBHQ0Zv cmVncm91bmQgfCBHQ0JhY2tncm91bmQ7CisgICAgICAgICAgQ09MT1JSRUYgb3JpZ192YWxfYSA9 IEZSQU1FX0JBQ0tHUk9VTkRfUElYRUwgKGYpOworICAgICAgICAgIENPTE9SUkVGIG9yaWdfdm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9XMzJfV0lORE9XIChmKSwgbWFzaywgJmdjX3ZhbHVl cyk7CisgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgfQorICAgICAgICBlbHNl CisgICAgICAgICAgZHJhd19waHlzX2N1cnNvcl9nbHlwaCAodywgZ2x5cGhfcm93LCBEUkFXX0NV UlNPUik7CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBCQVJfQ1VSU09SOgorICAgIHsK KyAgICAgIGlmIChyZWQgPj0gMCAmJiBibHVlID49IDAgJiYgZ3JlZW4gPj0gMCkKKyAgICAgICAg LyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcu ICAqLworICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5E T1dfRlJBTUUgKHcpKTsKKyAgICAgICAgICBDT0xPUlJFRiBvcmlnX3ZhbCA9IGYtPm91dHB1dF9k YXRhLnczMi0+Y3Vyc29yX3BpeGVsOworICAgICAgICAgIGludCBpbnRfcmVkID0gcmVkICogMjU1 OworICAgICAgICAgIGludCBpbnRfZ3JlZW4gPSBncmVlbiAqIDI1NTsKKyAgICAgICAgICBpbnQg aW50X2JsdWUgPSBibHVlICogMjU1OworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vy c29yX3BpeGVsID0gUEFMRVRURVJHQiAoaW50X3JlZCwgaW50X2dyZWVuLCBpbnRfYmx1ZSk7Cisg ICAgICAgICAgeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIGdseXBoX3JvdywgY3Vyc29yX3dpZHRoLCBC QVJfQ1VSU09SKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9 IG9yaWdfdmFsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB4X2RyYXdfYmFy X2N1cnNvciAodywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEJBUl9DVVJTT1IpOworICAgICAg YnJlYWs7CisgICAgfQorICAgIGNhc2UgSEJBUl9DVVJTT1I6CisgICAgeworICAgICAgaWYgKHJl ZCA+PSAwICYmIGJsdWUgPj0gMCAmJiBncmVlbiA+PSAwKQorICAgICAgICAvKiBUZW1wb3Jhcmls eSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAg IHsKKyAgICAgICAgICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykp OworICAgICAgICAgIENPTE9SUkVGIG9yaWdfdmFsID0gZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJz b3JfcGl4ZWw7CisgICAgICAgICAgaW50IGludF9yZWQgPSByZWQgKiAyNTU7CisgICAgICAgICAg aW50IGludF9ncmVlbiA9IGdyZWVuICogMjU1OworICAgICAgICAgIGludCBpbnRfYmx1ZSA9IGJs dWUgKiAyNTU7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBQ QUxFVFRFUkdCIChpbnRfcmVkLCBpbnRfZ3JlZW4sIGludF9ibHVlKTsKKyAgICAgICAgICB4X2Ry YXdfYmFyX2N1cnNvciAodywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEhCQVJfQ1VSU09SKTsK KyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9yaWdfdmFsOwor ICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB4X2RyYXdfYmFyX2N1cnNvciAodywg Z2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEhCQVJfQ1VSU09SKTsKKyAgICAgIGJyZWFrOworICAg IH0KKyAgICBjYXNlIE5PX0NVUlNPUjoKKyAgICAgIHctPnBoeXNfY3Vyc29yX3dpZHRoID0gMDsK KyAgICAg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s eWluZyBlYWNoIGVsZW1lbnQgb2YgdGhlIExTTCBjb2xvciB2ZWN0b3IgYnkgNjU1MzUuIgorKGlu dGVyYWN0aXZlKQorICAobGV0ICgoYnVmZmVyIChnZXQtYnVmZmVyLWNyZWF0ZSAiKk1DLVRFU1Qq IikpKQorICAgIChsYXdsaXN0LXdpdGgtY3VycmVudC1idWZmZXIgYnVmZmVyCisgICAgICAoZXJh c2UtYnVmZmVyKQorICAgICAgKGluc2VydCAiVGhpcyBpcyBhIHRlc3QhIikKKyAgICAgIChzZXRx IG1jLWxpc3QgJygoMSAiaGJhciIgIm1hZ2VudGEiKQorICAgICAgICAgICAgICAgICAgICAgICgy ICJiYXIiICJwdXJwbGUiKQorICAgICAgICAgICAgICAgICAgICAgICgzICJib3giICIjMDBGRjAw IikKKyAgICAgICAgICAgICAgICAgICAgICAoNCAiaG9sbG93IiAiIzAwMDBGRiIpCisgICAgICAg ICAgICAgICAgICAgICAgKDUgKCJoYmFyIiAzKSBbMS4wIDAuMCAxLjBdKQorICAgICAgICAgICAg ICAgICAgICAgICg2ICgiYmFyIiAzKSBbMC4wIDEuMCAxLjBdKSkpKQorICAgIChzZWxlY3Qtd2lu ZG93IChsYXdsaXN0LWRpc3BsYXktYnVmZmVyIGJ1ZmZlcikpCisgICAgOzs7IFRoZSB0cmlnZ2Vy IGluIGBrZXlib2FyZC5jYCBpcyBub3QgYWN0aXZhdGVkIGluIHRoaXMgZXhhbXBsZSwgc28gd2UK KyAgICA7OzsgZm9yY2UgdGhlIG11bHRpcGxlIGN1cnNvcnMgdG8gYmUgZHJhd24uCisgICAgKG1j LWRyYXctZXJhc2UgKHNlbGVjdGVkLXdpbmRvdykpKSkKKworKGRlZnVuIGN1cnNvci1vbiAoKQor KGludGVyYWN0aXZlKQorICAobGV0KiAoCisgICAgICAod2luZG93IChzZWxlY3RlZC13aW5kb3cp KQorICAgICAgKHBvc24gKHBvc24tYXQtcG9pbnQgKDEtIChwb2ludCkpKSkKKyAgICAgIChudGgt MiAobnRoIDIgcG9zbikpCisgICAgICAoeCAoY2FyIG50aC0yKSkKKyAgICAgICh5IChjZHIgbnRo LTIpKQorICAgICAgKG50aC02IChudGggNiBwb3NuKSkKKyAgICAgIChocG9zIChjYXIgbnRoLTYp KQorICAgICAgKHZwb3MgKGNkciBudGgtNikpCisgICAgICAoeC15LWhwb3MtdnBvcyAobGlzdCB4 IHkgaHBvcyB2cG9zKSkKKyAgICAgIChjdXJzb3ItdHlwZSAiYm94IikKKyAgICAgIChjdXJzb3It d2lkdGggMSkKKyAgICAgIChjb2xvci12ZWN0b3IgWzEuMCAwLjAgMS4wXSkgKQorICAgIChtYy1k cmF3LWZuIHdpbmRvdyB4LXktaHBvcy12cG9zIGN1cnNvci10eXBlIGN1cnNvci13aWR0aCBjb2xv ci12ZWN0b3IpKSkKKworKGRlZnVuIGN1cnNvci1vZmYgKCkKKyhpbnRlcmFjdGl2ZSkKKyAgKGxl dCogKAorICAgICAgKHdpbmRvdyAoc2VsZWN0ZWQtd2luZG93KSkKKyAgICAgIChwb3NuIChwb3Nu LWF0LXBvaW50ICgxLSAocG9pbnQpKSkpCisgICAgICAobnRoLTIgKG50aCAyIHBvc24pKQorICAg ICAgKHggKGNhciBudGgtMikpCisgICAgICAoeSAoY2RyIG50aC0yKSkKKyAgICAgIChudGgtNiAo bnRoIDYgcG9zbikpCisgICAgICAoaHBvcyAoY2FyIG50aC02KSkKKyAgICAgICh2cG9zIChjZHIg bnRoLTYpKQorICAgICAgKHgteS1ocG9zLXZwb3MgKGxpc3QgeCB5IGhwb3MgdnBvcykpCisgICAg ICAoY3Vyc29yLXR5cGUgImJveCIpCisgICAgICAoY3Vyc29yLXdpZHRoIDEpKQorICAgIChtYy1l cmFzZS1mbiB3aW5kb3cgeC15LWhwb3MtdnBvcyBjdXJzb3ItdHlwZSBjdXJzb3Itd2lkdGgpKSkK KworKGRlZnVuIHgteS1ocG9zLXZwb3MgKCkKKyJEZXNjcmliZSBjb29yZGluYXRlcywgdH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0IG92X3R5cGUgPSBpbnRlcm4gKCJ0eXBlIik7CisgIExpc3BfT2JqZWN0IG92X2NvbF9l b3ZsID0gaW50ZXJuICgiY29sLWVvdmwiKTsKKyAgTGlzcF9PYmplY3Qgb3ZfcmlnaHRfZnJpbmdl ID0gaW50ZXJuICgicmlnaHQtZnJpbmdlIik7CisgIExpc3BfT2JqZWN0IG92X3F1ZXJ5X3R5cGUg PSBRbmlsOworICBMaXNwX09iamVjdCBvdl9xdWVyeV9hZnRlcl9zdHJpbmcgPSBRbmlsOworICBM aXNwX09iamVjdCBvdl9xdWVyeV9kaXNwbGF5ID0gUW5pbDsKKyAgYm9vbCBvdl9mb3VuZF90eXBl X2NvbGVvdmwgPSBmYWxzZTsKKyAgYm9vbCBvdl9mb3VuZF9hZnRlcnN0cmluZyA9IGZhbHNlOwor ICBib29sIG92X2ZvdW5kX3R5cGVfcmlnaHRmcmluZ2UgPSBmYWxzZTsKKyAgaWYgKHBvc2ludCA+ PSBzdGFydAorICAgICAgJiYgcG9zaW50IDw9IGVuZCkKKyAgICB7CisgICAgICBvdmVybGF5cyA9 IEZvdmVybGF5c19pbiAobWFrZV9udW1iZXIgKHBvc2ludCksIChtYWtlX251bWJlciAocG9zaW50 ICsgMSkpKTsKKyAgICAgIGlmICghTklMUCAob3ZlcmxheXMpKQorICAgICAgICB7CisgICAgICAg ICAgZm9yIChvdl9saXN0ID0gb3ZlcmxheXM7CisgICAgICAgICAgICAgICBDT05TUCAob3ZfbGlz dCk7CisgICAgICAgICAgICAgICBvdl9saXN0ID0gWENEUiAob3ZfbGlzdCkpCisgICAgICAgICAg ICB7CisgICAgICAgICAgICAgIG92ID0gWENBUiAob3ZfbGlzdCk7CisgICAgICAgICAgICAgIG92 X3F1ZXJ5X3R5cGUgPSBGb3ZlcmxheV9nZXQgKG92LCBvdl90eXBlKTsKKyAgICAgICAgICAgICAg b3ZfcXVlcnlfZGlzcGxheSA9IEZvdmVybGF5X2dldCAob3YsIFFkaXNwbGF5KTsKKyAgICAgICAg ICAgICAgb3ZfcXVlcnlfYWZ0ZXJfc3RyaW5nID0gRm92ZXJsYXlfZ2V0IChvdiwgUWFmdGVyX3N0 cmluZyk7CisgICAgICAgICAgICAgIGlmIChFUSAob3ZfcXVlcnlfdHlwZSwgb3ZfY29sX2Vvdmwp KQorICAgICAgICAgICAgICAgIG92X2ZvdW5kX3R5cGVfY29sZW92bCA9IHRydWU7CisgICAgICAg ICAgICAgIGlmIChFUSAob3ZfcXVlcnlfdHlwZSwgb3ZfcmlnaHRfZnJpbmdlKSkKKyAgICAgICAg ICAgICAgICBvdl9mb3VuZF90eXBlX3JpZ2h0ZnJpbmdlID0gdHJ1ZTsKKyAgICAgICAgICAgICAg aWYgKCFOSUxQIChvdl9xdWVyeV9hZnRlcl9zdHJpbmcpKQorICAgICAgICAgICAgICAgIG92X2Zv dW5kX2FmdGVyc3RyaW5nID0gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAg U0VUX1RFWFRfUE9TX0ZST01fTUFSS0VSIChwdCwgdy0+c3RhcnQpOworICAgICAgc3RhcnRfZGlz cGxheSAoJml0LCB3LCBwdCk7CisgICAgICBtb3ZlX2l0X3RvICgmaXQsIHBvc2ludCwgLTEsIC0x LCAtMSwgTU9WRV9UT19QT1MpOworICAgICAgeSA9IGl0LmN1cnJlbnRfeTsKKyAgICAgIHZwb3Mg PSBpdC52cG9zOworICAgICAgaWYgKG92X2ZvdW5kX3R5cGVfY29sZW92bCkKKyAgICAgICAgewor ICAgICAgICAgIFRFTVBfU0VUX1BUX0JPVEggKENIQVJQT1MgKGl0LmN1cnJlbnQucG9zKSwgQllU RVBPUyAoaXQuY3VycmVudC5wb3MpKTsKKyAgICAgICAgICBwZW92bF9jb2wgPSBjdXJyZW50X2Nv bHVtbiAoKSAtIDE7CisgICAgICAgICAgbW92ZV9pdF9ieV9saW5lcyAoJml0LCAtMSk7CisgICAg ICAgICAgVEVNUF9TRVRfUFRfQk9USCAoQ0hBUlBPUyAoaXQuY3VycmVudC5wb3MpLCBCWVRFUE9T IChpdC5jdXJyZW50LnBvcykpOworICAgICAgICAgIHBib3ZsX2NvbCA9IGN1cnJlbnRfY29sdW1u ICgpOworICAgICAgICAgIGNvbF9lb3ZsID0gcGVvdmxfY29sIC0gcGJvdmxfY29sOworICAgICAg ICAgIHggPSBjb2xfZW92bCAqIGZyYW1lX2NoYXJfd2lkdGg7CisgICAgICAgICAgaHBvcyA9IGNv bF9lb3ZsOworICAgICAgICAgIFRFTVBfU0VUX1BUX0JPVEggKG9wb2ludCwgb2J5dGVwb3MpOwor ICAgICAgICB9CisgICAgICAgIC8qIFNwZWNpYWwgaGFuZGxpbmcgZm9yIGBhZnRlci1zdHJpbmcn IGFuZCBlb2Igc2l0dWF0aW9ucy4gICovCisgICAgICAgIGVsc2UgaWYgKG92X2ZvdW5kX2FmdGVy c3RyaW5nCisgICAgICAgICAgICAgICAgIHx8IEZFVENIX0JZVEUgKElUX0JZVEVQT1MgKGl0KSkg PT0gJ1xuJworICAgICAgICAgICAgICAgICB8fCBwb3NpbnQgPT0gWlYpCisgICAgICAgICAgewor ICAgICAgICAgICAgVEVNUF9TRVRfUFRfQk9USCAoQ0hBUlBPUyAoaXQuY3VycmVudC5wb3MpLCBC WVRFUE9TIChpdC5jdXJyZW50LnBvcykpOworICAgICAgICAgICAgcGVvdmxfY29sID0gY3VycmVu dF9jb2x1bW4gKCk7CisgICAgICAgICAgICAvKiBEVlBPUyA9PSAwIG1lYW5zIG1vdmUgdG8gdGhl IHN0YXJ0IG9mIHRoZSBzY3JlZW4gbGluZS4gICovCisgICAgICAgICAgICBtb3ZlX2l0X2J5X2xp bmVzICgmaXQsIDApOworICAgICAgICAgICAgVEVNUF9TRVRfUFRfQk9USCAoQ0hBUlBPUyAoaXQu Y3VycmVudC5wb3MpLCBCWVRFUE9TIChpdC5jdXJyZW50LnBvcykpOworICAgICAgICAgICAgcGJv dmxfY29sID0gY3VycmVudF9jb2x1bW4gKCk7CisgICAgICAgICAgICBjb2xfZW92bCA9IHBlb3Zs X2NvbCAtIHBib3ZsX2NvbDsKKyAgICAgICAgICAgIHggPSBjb2xfZW92bCAqIGZyYW1lX2NoYXJf d2lkdGg7CisgICAgICAgICAgICBocG9zID0gY29sX2Vvdmw7CisgICAgICAgICAgICBURU1QX1NF VF9QVF9CT1RIIChvcG9pbnQsIG9ieXRlcG9zKTsKKyAgICAgICAgICB9CisgICAgICAgICAgZWxz ZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICB4ID0gaXQuY3VycmVudF94OworICAgICAg ICAgICAgICBocG9zID0gaXQuaHBvczsKKyAgICAgICAgICAgIH0KKyAgICAgIGJpZGlfdW5zaGVs dmVfY2FjaGUgKGl0ZGF0YSwgZmFsc2UpOworICAgIH0KKyAgICBlbHNlCisgICAgICB7CisgICAg ICAgIHggPSAtMTsKKyAgICAgICAgeSA9IC0xOworICAgICAgICBocG9zID0gLTE7CisgICAgICAg IHZwb3MgPSAtMTsKKyAgICAgIH0KKyAgcmV0dXJuCisgICAgbGlzdG4gKENPTlNUWVBFX0hFQVAs IDQsCisgICAgICBsaXN0biAoQ09OU1RZUEVfSEVBUCwgNCwgbWFrZV9udW1iZXIgKHgpLCBtYWtl X251bWJlciAoeSksIG1ha2VfbnVtYmVyIChocG9zKSwgbWFrZV9udW1iZXIgKHZwb3MpKSwKKyAg ICAgIEZjb25zIChidWlsZF9zdHJpbmcgKCJ0eXBlIiksIG92X3F1ZXJ5X3R5cGUpLAorICAgICAg RmNvbnMgKGJ1aWxkX3N0cmluZyAoImRpc3BsYXkiKSwgb3ZfcXVlcnlfZGlzcGxheSksCisgICAg ICBGY29ucyAoYnVpbGRfc3RyaW5nICgiYWZ0ZXItc3RyaW5nIiksIG92X3F1ZXJ5X2FmdGVyX3N0 cmluZykpOworfQorCit2b2lkCittY19zdG9yZV9wcmV2aW91c192YWx1ZXMgKHN0cnVjdCB3aW5k b3cgKncpCit7CisgIHN0cnVjdCB0ZXh0X3BvcyBzdGFydHA7CisgIFNFVF9URVhUX1BPU19GUk9N X01BUktFUiAoc3RhcnRwLCB3LT5zdGFydCk7CisgIHN0cnVjdCBidWZmZXIgKmJ1ZmZlciA9IFhC VUZGRVIgKHctPmNvbnRlbnRzKTsKKyAgaWYgKCghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBtY19saXN0KSkgfHwgIU5JTFAgKHctPm1jX2NhY2hlKSkKKyAgICAgICYmICFNSU5J X1dJTkRPV19QICh3KSkKKyAgICB7CisgICAgICBMaXNwX09iamVjdCB4X3lfaHBvc192cG9zOwor ICAgICAgRU1BQ1NfSU5UIHN0YXJ0ID0gQ0hBUlBPUyAoc3RhcnRwKTsKKyAgICAgIEVNQUNTX0lO VCBlbmQgPSBCVUZfWiAoYnVmZmVyKSAtIHctPndpbmRvd19lbmRfcG9zOworICAgICAgaWYgKHct Pm1jLmRyYXdfZXJhc2UpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAody0+bWMuc3RhcnQpCisg ICAgICAgICAgICB7CisgICAgICAgICAgICAgIHctPm1jLnByZXZfc3RhcnQgPSB3LT5tYy5zdGFy dDsKKyAgICAgICAgICAgICAgeF95X2hwb3NfdnBvcyA9IEZudGggKG1ha2VfbnVtYmVyICgwKSwg bWNfeF95X2hwb3NfdnBvcyAodywgdy0+bWMucHJldl9zdGFydCwgc3RhcnQsIGVuZCkpOworICAg ICAgICAgICAgICB3LT5tYy5wcmV2X3N0YXJ0X3ggPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAo MCksIHhfeV9ocG9zX3Zwb3MpKTsKKyAgICAgICAgICAgICAgdy0+bWMucHJldl9zdGFydF95ID0g WElOVCAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB4X3lfaHBvc192cG9zKSk7CisgICAgICAgICAg ICAgIHctPm1jLnByZXZfc3RhcnRfaHBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgyKSwg eF95X2hwb3NfdnBvcykpOworICAgICAgICAgICAgICB3LT5tYy5wcmV2X3N0YXJ0X3Zwb3MgPSBY SU5UIChGbnRoIChtYWtlX251bWJlciAoMyksIHhfeV9ocG9zX3Zwb3MpKTsKKyAgICAgICAgICAg IH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHct Pm1jLnByZXZfc3RhcnQgPSAtMTsKKyAgICAgICAgICAgICAgICB3LT5tYy5wcmV2X3N0YXJ0X3gg PSAtMTsKKyAgICAgICAgICAgICAgICB3LT5tYy5wcmV2X3N0YXJ0X3kgPSAtMTsKKyAgICAgICAg ICAgICAgICB3LT5tYy5wcmV2X3N0YXJ0X2hwb3MgPSAtMTsKKyAgICAgICAgICAgICAgICB3LT5t Yy5wcmV2X3N0YXJ0X3Zwb3MgPSAtMTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIGlmICh3 LT5tYy5lbmQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHctPm1jLnByZXZfZW5kID0g dy0+bWMuZW5kOworICAgICAgICAgICAgICAvKiBlb2IgSVMgdmlzaWJsZS4KKyAgICAgICAgICAg ICAgRXhjbHVkZXMgYSBzaXR1YXRpb24gd2hlbiBsYXN0IHZpc2libGUgbGluZSBhdCBib3R0b20g b2Ygd2luZG93IGNvbnRhaW5zIGVvYi4gICovCisgICAgICAgICAgICAgIGlmICh3LT5tYy5wcmV2 X2VuZCA9PSBlbmQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgeF95X2hw b3NfdnBvcyA9IEZudGggKG1ha2VfbnVtYmVyICgwKSwgbWNfeF95X2hwb3NfdnBvcyAodywgdy0+ bWMucHJldl9lbmQsIHN0YXJ0LCBlbmQpKTsKKyAgICAgICAgICAgICAgICAgIHctPm1jLnByZXZf ZW5kX3ggPSB3LT5tYy5lbmRfeDsKKyAgICAgICAgICAgICAgICAgIHctPm1jLnByZXZfZW5kX3kg PSB3LT5tYy5lbmRfeTsKKyAgICAgICAgICAgICAgICAgIHctPm1jLnByZXZfZW5kX2hwb3MgPSB3 LT5tYy5lbmRfaHBvczsKKyAgICAgICAgICAgICAgICAgIHctPm1jLnByZXZfZW5kX3Zwb3MgPSB3 LT5tYy5lbmRfdnBvczsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLyogZW9i IGlzIE5PVCB2aXNpYmxlLgorICAgICAgICAgICAgICAgIEV4Y2x1ZGVzIGEgc2l0dWF0aW9uIHdo ZW4gbGFzdCB2aXNpYmxlIGxpbmUgYXQgYm90dG9tIG9mIHdpbmRvdyBjb250YWlucyBlb2IuICAq Ki8KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgICAgIHhfeV9ocG9zX3Zwb3MgPSBGbnRoIChtYWtlX251bWJlciAoMCksIG1jX3hfeV9o cG9zX3Zwb3MgKHcsIHctPm1jLnByZXZfZW5kLCBzdGFydCwgZW5kKSk7CisgICAgICAgICAgICAg ICAgICAgIHctPm1jLnByZXZfZW5kX3ggPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMCksIHhf eV9ocG9zX3Zwb3MpKTsKKyAgICAgICAgICAgICAgICAgICAgdy0+bWMucHJldl9lbmRfeSA9IFhJ TlQgKEZudGggKG1ha2VfbnVtYmVyICgxKSwgeF95X2hwb3NfdnBvcykpOworICAgICAgICAgICAg ICAgICAgICB3LT5tYy5wcmV2X2VuZF9ocG9zID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDIp LCB4X3lfaHBvc192cG9zKSk7CisgICAgICAgICAgICAgICAgICAgIHctPm1jLnByZXZfZW5kX3Zw b3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMyksIHhfeV9ocG9zX3Zwb3MpKTsKKyAgICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgIHctPm1jLnByZXZfZW5kID0gLTE7CisgICAgICAgICAg ICAgICAgdy0+bWMucHJldl9lbmRfeCA9IC0xOworICAgICAgICAgICAgICAgIHctPm1jLnByZXZf ZW5kX3kgPSAtMTsKKyAgICAgICAgICAgICAgICB3LT5tYy5wcmV2X2VuZF9ocG9zID0gLTE7Cisg ICAgICAgICAgICAgICAgdy0+bWMucHJldl9lbmRfdnBvcyA9IC0xOworICAgICAgICAgICAgICB9 CisgICAgICAgICAgaWYgKHctPm1jLm9wb2ludCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgdy0+bWMucHJldl9vcG9pbnQgPSB3LT5tYy5vcG9pbnQ7CisgICAgICAgICAgICAgIHctPm1j LnByZXZfb3BvaW50X3ggPSB3LT5tYy5vcG9pbnRfeDsKKyAgICAgICAgICAgICAgdy0+bWMucHJl dl9vcG9pbnRfeSA9IHctPm1jLm9wb2ludF95OworICAgICAgICAgICAgICB3LT5tYy5wcmV2X29w b2ludF9ocG9zID0gdy0+bWMub3BvaW50X2hwb3M7CisgICAgICAgICAgICAgIHctPm1jLnByZXZf b3BvaW50X3Zwb3MgPSB3LT5tYy5vcG9pbnRfdnBvczsKKyAgICAgICAgICAgIH0KKyAgICAgICAg ICB3LT5tYy5vcG9pbnQgPSBQVDsKKyAgICAgICAgICB4X3lfaHBvc192cG9zID0gRm50aCAobWFr ZV9udW1iZXIgKDApLCBtY194X3lfaHBvc192cG9zICh3LCB3LT5tYy5vcG9pbnQsIHN0YXJ0LCBl bmQpKTsKKyAgICAgICAgICB3LT5tYy5vcG9pbnRfeCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVy ICgwKSwgeF95X2hwb3NfdnBvcykpOworICAgICAgICAgIHctPm1jLm9wb2ludF95ID0gWElOVCAo Rm50aCAobWFrZV9udW1iZXIgKDEpLCB4X3lfaHBvc192cG9zKSk7CisgICAgICAgICAgdy0+bWMu b3BvaW50X2hwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMiksIHhfeV9ocG9zX3Zwb3Mp KTsKKyAgICAgICAgICB3LT5tYy5vcG9pbnRfdnBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVy ICgzKSwgeF95X2hwb3NfdnBvcykpOworICAgICAgICAgIHctPm1jLnN0YXJ0ID0gc3RhcnQ7Cisg ICAgICAgICAgeF95X2hwb3NfdnBvcyA9IEZudGggKG1ha2VfbnVtYmVyICgwKSwgbWNfeF95X2hw b3NfdnBvcyAodywgc3RhcnQsIHN0YXJ0LCBlbmQpKTsKKyAgICAgICAgICB3LT5tYy5zdGFydF94 ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB4X3lfaHBvc192cG9zKSk7CisgICAgICAg ICAgdy0+bWMuc3RhcnRfeSA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgxKSwgeF95X2hwb3Nf dnBvcykpOworICAgICAgICAgIHctPm1jLnN0YXJ0X2hwb3MgPSBYSU5UIChGbnRoIChtYWtlX251 bWJlciAoMiksIHhfeV9ocG9zX3Zwb3MpKTsKKyAgICAgICAgICB3LT5tYy5zdGFydF92cG9zID0g WElOVCAoRm50aCAobWFrZV9udW1iZXIgKDMpLCB4X3lfaHBvc192cG9zKSk7CisgICAgICAgICAg dy0+bWMuZW5kID0gZW5kOworICAgICAgICAgIHhfeV9ocG9zX3Zwb3MgPSBGbnRoIChtYWtlX251 bWJlciAoMCksIG1jX3hfeV9ocG9zX3Zwb3MgKHcsIGVuZCwgc3RhcnQsIGVuZCkpOworICAgICAg ICAgIHctPm1jLmVuZF94ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB4X3lfaHBvc192 cG9zKSk7CisgICAgICAgICAgdy0+bWMuZW5kX3kgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAo MSksIHhfeV9ocG9zX3Zwb3MpKTsKKyAgICAgICAgICB3LT5tYy5lbmRfaHBvcyA9IFhJTlQgKEZu dGggKG1ha2VfbnVtYmVyICgyKSwgeF95X2hwb3NfdnBvcykpOworICAgICAgICAgIHctPm1jLmVu ZF92cG9zID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDMpLCB4X3lfaHBvc192cG9zKSk7Cisg ICAgICAgICAgLyogU3RhcnQgcmVtYWlucyB0aGUgc2FtZS4gICovCisgICAgICAgICAgaWYgKHct Pm1jLnByZXZfc3RhcnRfdnBvcyA9PSB3LT5tYy5zdGFydF92cG9zCisgICAgICAgICAgICAgIHx8 IHctPm1jLnByZXZfZW5kIDwgdy0+bWMuc3RhcnQpCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIHctPm1jLnlfZGlmZiA9IDA7CisgICAgICAgICAgICAgIHctPm1jLnZwb3NfZGlmZiA9IDA7 CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvKiBTY3JlZW4gbW92ZWQg4pa8IC0tIGUuZy4s IGBwcmV2aW91cy1saW5lJywgYHNjcm9sbC1kb3duJy4gICovCisgICAgICAgICAgICBlbHNlIGlm ICh3LT5tYy5wcmV2X3N0YXJ0X3Zwb3MgPiAwKQorICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgdy0+bWMueV9kaWZmID0gKHctPm1jLnByZXZfc3RhcnRfeSAtIHctPm1jLnN0YXJ0X3kp ICogLTE7CisgICAgICAgICAgICAgICAgdy0+bWMudnBvc19kaWZmID0gKHctPm1jLnByZXZfc3Rh cnRfdnBvcyAtIHctPm1jLnN0YXJ0X3Zwb3MpICogLTE7CisgICAgICAgICAgICAgIH0KKyAgICAg ICAgICAgICAgLyogU2NyZWVuIG1vdmVkIOKWsiAoZW9iIE5PVCB2aXNpYmxlKSAtLSBlLmcuLCBg bmV4dC1saW5lJywgYHNjcm9sbC11cCcuICAqLworICAgICAgICAgICAgICBlbHNlIGlmICh3LT5t Yy5lbmRfdnBvcyA+IHctPm1jLnByZXZfZW5kX3Zwb3MgJiYgdy0+bWMucHJldl9lbmQgIT0gLTEp CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgdy0+bWMueV9kaWZmID0gdy0+ bWMuZW5kX3kgLSB3LT5tYy5wcmV2X2VuZF95OworICAgICAgICAgICAgICAgICAgdy0+bWMudnBv c19kaWZmID0gdy0+bWMuZW5kX3Zwb3MgLSB3LT5tYy5wcmV2X2VuZF92cG9zOworICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgICAgICAvKiBTY3JlZW4gbW92ZWQg4payIChlb2IgSVMgdmlz aWJsZSkgLS0gZS5nLiwgYG5leHQtbGluZScsIGBzY3JvbGwtdXAnLiAgKi8KKyAgICAgICAgICAg ICAgICBlbHNlIGlmICh3LT5tYy5lbmRfdnBvcyA8IHctPm1jLnByZXZfZW5kX3Zwb3MgJiYgdy0+ bWMucHJldl9lbmQgIT0gLTEpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICAgIHctPm1jLnlfZGlmZiA9IHctPm1jLnByZXZfZW5kX3kgLSB3LT5tYy5lbmRfeTsKKyAgICAg ICAgICAgICAgICAgICAgdy0+bWMudnBvc19kaWZmID0gdy0+bWMucHJldl9lbmRfdnBvcyAtIHct Pm1jLmVuZF92cG9zOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgLyog U2NyZWVuIG1vdmVkIOKWsiAoZW9iIGp1c3QgYmVjYW1lIHZpc2libGUpIC0tIGUuZy4sIGBuZXh0 LWxpbmUnLCBgc2Nyb2xsLXVwJy4KKyAgICAgICAgICAgICAgICAgIEFic2VudCBzdWJ0cmFjdGlu ZyAxIGZyb20gdy0+bWMucHJldl9lbmQsIHRoYXQgcG9pbnQgYW5kIHRoZSBuZXcgdy0+bWMuZW5k IGFyZQorICAgICAgICAgICAgICAgICAgb24gdGhlIHNhbWUgbGluZSBhbmQgaXQgYXBwZWFycyB0 aGF0IG5vdGhpbmcgaGFzIGNoYW5nZWQgLS0gdy0+bWMucHJldl9lbmQgaXMKKyAgICAgICAgICAg ICAgICAgIG9uIHRoZSBmYXIgbGVmdCBvZiB0aGUgbGluZSBhbmQgdy0+bWMuZW5kIGlzIG9uIHRo ZSBmYXIgcmlnaHQgb2YgdGhlIGxpbmUuICAqLworICAgICAgICAgICAgICAgICAgZWxzZSBpZiAo dy0+bWMuZW5kX3Zwb3MgPT0gdy0+bWMucHJldl9lbmRfdnBvcykKKyAgICAgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgICAgIHhfeV9ocG9zX3Zwb3MgPSBGbnRoIChtYWtlX251 bWJlciAoMCksIG1jX3hfeV9ocG9zX3Zwb3MgKHcsIHctPm1jLnByZXZfZW5kIC0gMSwgc3RhcnQs IGVuZCkpOworICAgICAgICAgICAgICAgICAgICAgIHctPm1jLnByZXZfZW5kX3ggPSBYSU5UIChG bnRoIChtYWtlX251bWJlciAoMCksIHhfeV9ocG9zX3Zwb3MpKTsKKyAgICAgICAgICAgICAgICAg ICAgICB3LT5tYy5wcmV2X2VuZF95ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB4X3lf aHBvc192cG9zKSk7CisgICAgICAgICAgICAgICAgICAgICAgdy0+bWMucHJldl9lbmRfaHBvcyA9 IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgeF95X2hwb3NfdnBvcykpOworICAgICAgICAg ICAgICAgICAgICAgIHctPm1jLnByZXZfZW5kX3Zwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJl ciAoMyksIHhfeV9ocG9zX3Zwb3MpKTsKKyAgICAgICAgICAgICAgICAgICAgICB3LT5tYy55X2Rp ZmYgPSB3LT5tYy5lbmRfeSAtIHctPm1jLnByZXZfZW5kX3k7CisgICAgICAgICAgICAgICAgICAg ICAgdy0+bWMudnBvc19kaWZmID0gdy0+bWMuZW5kX3Zwb3MgLSB3LT5tYy5wcmV2X2VuZF92cG9z OworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLyogYG1jLWxpc3RgIGhh cyBqdXN0IGJlZW4gaW5pdGlhbGl6ZWQgLS0gcHJldmlvdXMgc3RhcnQvZW5kIGFyZSBzZXQgdG8g LTEuICAqLworICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICh3LT5tYy5wcmV2X2VuZCA9PSAt MSkKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICB3LT5t Yy55X2RpZmYgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgdy0+bWMudnBvc19kaWZmID0g MDsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgaWYgKHctPm1jLnlfZGlmZiA8 IDApCisgICAgICAgICAgICB3LT5tYy55X2RpZmYgPSBhYnMgKHctPm1jLnlfZGlmZik7CisgICAg ICAgICAgICBlbHNlIGlmICh3LT5tYy55X2RpZmYgPiAwKQorICAgICAgICAgICAgICB3LT5tYy55 X2RpZmYgPSB3LT5tYy55X2RpZmYgKiAtMTsKKyAgICAgICAgICBpZiAody0+bWMudnBvc19kaWZm IDwgMCkKKyAgICAgICAgICAgIHctPm1jLnZwb3NfZGlmZiA9IGFicyAody0+bWMudnBvc19kaWZm KTsKKyAgICAgICAgICAgIGVsc2UgaWYgKHctPm1jLnZwb3NfZGlmZiA+IDApCisgICAgICAgICAg ICB3LT5tYy52cG9zX2RpZmYgPSB3LT5tYy52cG9zX2RpZmYgKiAtMTsKKy8qICNpZmRlZiBHTFlQ SF9ERUJVRworICBkZWJ1Z19tZXRob2RfYWRkICh3LCAiZGlmZjogKCVkICVkKSB8IHByZXZfc3Rh cnQ6ICVkICglZCAlZCAlZCAlZCkgfCBzdGFydDogJWQgKCVkICVkICVkICVkKSB8IHByZXZfZW5k OiAlZCAoJWQgJWQgJWQgJWQpIHwgZW5kOiAlZCAoJWQgJWQgJWQgJWQpIiwKKyAgICB3LT5tYy55 X2RpZmYsIHctPm1jLnZwb3NfZGlmZiwKKyAgICB3LT5tYy5wcmV2X3N0YXJ0LCB3LT5tYy5wcmV2 X3N0YXJ0X3gsIHctPm1jLnByZXZfc3RhcnRfeSwgdy0+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TsKKyAgc3RydWN0IGdseXBoICpjdXJzb3JfZ2x5cGg7CisgIHN0 cnVjdCBnbHlwaF9yb3cgKmN1cnNvcl9yb3cgPSBNQVRSSVhfUk9XICh3LT5jdXJyZW50X21hdHJp eCwgdnBvcyk7CisgIC8qIE1heWJlIGNsZWFyIHRoZSBkaXNwbGF5IHVuZGVyIHRoZSBjdXJzb3Iu ICAqLworICBpZiAody0+cGh5c19jdXJzb3JfdHlwZSA9PSBIT0xMT1dfQk9YX0NVUlNPUikKKyAg ICB7CisgICAgICBpbnQgaG9sbG93X3gsIGhvbGxvd195LCB3aWR0aDsKKyAgICAgIGlmICghKHZw b3MgPj0gMAorICAgICAgICAgICYmIHZwb3MgPCB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3MpKQor ICAgICAgICBjdXJzb3JfZ2x5cGggPSBOVUxMOworICAgICAgaWYgKCFjdXJzb3Jfcm93LT5lbmFi bGVkX3ApCisgICAgICAgIGN1cnNvcl9nbHlwaCA9IE5VTEw7CisgICAgICBpZiAody0+aHNjcm9s bCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFdoZW4gdGhlIHdpbmRvdyBpcyBoc2Nyb2xsZWQs IGN1cnNvciBocG9zIGNhbiBsZWdpdGltYXRlbHkgYmUKKyAgICAgICAgICAgb3V0IG9mIGJvdW5k cywgYnV0IHdlIGRyYXcgdGhlIGN1cnNvciBhdCB0aGUgY29ycmVzcG9uZGluZworICAgICAgICAg ICB3aW5kb3cgbWFyZ2luIGluIHRoYXQgY2FzZS4gICovCisgICAgICAgICAgaWYgKCFjdXJzb3Jf cm93LT5yZXZlcnNlZF9wICYmIGhwb3MgPCAwKQorICAgICAgICAgICAgaHBvcyA9IDA7CisgICAg ICAgICAgaWYgKGN1cnNvcl9yb3ctPnJldmVyc2VkX3AgJiYgaHBvcyA+PSBjdXJzb3Jfcm93LT51 c2VkW1RFWFRfQVJFQV0pCisgICAgICAgICAgICBocG9zID0gY3Vyc29yX3Jvdy0+dXNlZFtURVhU X0FSRUFdIC0gMTsKKyAgICAgICAgfQorICAgICAgaWYgKDAgPD0gaHBvcyAmJiBocG9zIDwgY3Vy c29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdKQorICAgICAgICBjdXJzb3JfZ2x5cGggPSBjdXJzb3Jf cm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIGhwb3M7CisgICAgICBlbHNlCisgICAgICAgIGN1cnNv cl9nbHlwaCA9IE5VTEw7CisgICAgICBpZiAoY3Vyc29yX2dseXBoID09IE5VTEwpCisgICAgICAg IGdvdG8gZG9uZTsKKyAgICAgIHdpZHRoID0gY3Vyc29yX2dseXBoLT5waXhlbF93aWR0aDsKKyAg ICAgIGhvbGxvd194ID0geDsKKyAgICAgIGlmICh4IDwgMCkKKyAgICAgICAgeworICAgICAgICAg IHdpZHRoICs9IGhvbGxvd194OworICAgICAgICAgIGhvbGxvd194ID0gMDsKKyAgICAgICAgfQor ICAgICAgd2lkdGggPSBtaW4gKHdpZHRoLCB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEp IC0gaG9sbG93X3gpOworICAgICAgaG9sbG93X3kgPSBXSU5ET1dfVE9fRlJBTUVfUElYRUxfWSAo dywgbWF4IChoZWFkZXJfbGluZV9oZWlnaHQsIGN1cnNvcl9yb3ctPnkpKTsKKyAgICAgIGhvbGxv d194ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgaG9sbG93X3gpOworICAgICAg aWYgKHdpZHRoID4gMCkKKyAgICAgICAgRlJBTUVfUklGIChmKS0+Y2xlYXJfZnJhbWVfYXJlYSAo ZiwgaG9sbG93X3gsIGhvbGxvd195LCB3aWR0aCwgY3Vyc29yX3Jvdy0+dmlzaWJsZV9oZWlnaHQp OworICAgIH0KKyAgaWYgKChjdXJzb3Jfcm93LT5yZXZlcnNlZF9wCisgICAgICAgPyAoaHBvcyA+ PSAwKQorICAgICAgIDogKGhwb3MgPCBjdXJzb3Jfcm93LT51c2VkW1RFW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Y190eXBlKSkKKyAgICAg ICAgICAgIGN1cnNvcl93aWR0aCA9IFhJTlQgKFhDQVIgKFhDRFIgKGN1cnNvcl9zcGVjX3R5cGUp KSk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCA9IDE7Cisg ICAgICAgICAgaWYgKHBvc2ludCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgeF95X2hw b3NfdnBvcyA9IFhDQVIgKFhDRFIgKFhDQVIgKHZsaXN0KSkpOworICAgICAgICAgICAgICB4ID0g WElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB4X3lfaHBvc192cG9zKSk7CisgICAgICAgICAg ICAgIHkgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMSksIHhfeV9ocG9zX3Zwb3MpKTsKKyAg ICAgICAgICAgICAgaHBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgeF95X2hwb3Nf dnBvcykpOworICAgICAgICAgICAgICB2cG9zID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDMp LCB4X3lfaHBvc192cG9zKSk7CisgICAgICAgICAgICAgIG1jX2VyYXNlICh3LCB4LCB5LCBocG9z LCB2cG9zLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoKTsKKyAgICAgICAgICAgIH0KKyAgICAg ICAgfQorICAgICAgaWYgKE5JTFAgKEJWQVIgKGIsIG1jX2xpc3QpKSkKKyAgICAgICAgd3NldF9t Y19jYWNoZSAodywgUW5pbCk7CisgICAgfQorICAvKiBJZiB0aGUgZmlyc3QgZWxlbWVudCBvZiB3 LT5tY19jYWNoZSBpcyB0aGUgc2FtZSBhcyB0aGUgbG9jYWwgdmFyaWFibGUgbWNfbGlzdCwKKyAg ICAgYW5kIHRoZSBwcmV2aW91cy9jdXJyZW50IHdpbmRvdy1zdGFydC93aW5kb3ctZW5kIGFyZSB0 aGUgc2FtZSAoZS5nLiwgbm8gc2Nyb2xsaW5nKSwKKyAgICAgdGhlbiByZWRyYXcgdGhlIGN1cnNv cnMgdXNpbmcgdGhlIGNhY2hlLiAgVGhpcyBhdm9pZHMgcmVjYWxjdWxhdGluZyBjb29yZGluYXRl cy4gKi8KKyAgaWYgKCFyZW1vdmUKKyAgICAgICYmIHcgPT0gc3cKKyAgICAgICYmIHctPm1jLnN0 YXJ0CisgICAgICAmJiB3LT5tYy5lbmQKKyAgICAgICYmIHctPm1jLnByZXZfc3RhcnQKKyAgICAg ICYmIHctPm1jLnByZXZfZW5kCisgICAgICAmJiB3LT5tYy5zdGFydCA9PSB3LT5tYy5wcmV2X3N0 YXJ0CisgICAgICAmJiB3LT5tYy5lbmQgPT0gdy0+bWMucHJldl9lbmQKKyAgICAgICYmICFOSUxQ IChCVkFSIChiLCBtY19saXN0KSkKKyAgICAgICYmICFOSUxQICh3LT5tY19jYWNoZSkKKyAgICAg ICYmICFOSUxQIChGZXF1YWwgKEZudGggKG1ha2VfbnVtYmVyICgwKSwgdy0+bWNfY2FjaGUpLCBC VkFSIChiLCBtY19saXN0KSkpKQorICAgIHsKKyNpZmRlZiBHTFlQSF9ERUJVRworICBkZWJ1Z19t ZXRob2RfYWRkICh3LCAibWNfY2FsYzogIGRyYXcgY3Vyc29ycyB1c2luZyBjYWNoZSIpOworI2Vu ZGlmCisgICAgICBmb3IgKHZsaXN0ID0gWENBUiAoWENEUiAody0+bWNfY2FjaGUpKTsKKyAgICAg ICAgICAgQ09OU1AgKHZsaXN0KTsKKyAgICAgICAgICAgdmxpc3QgPSBYQ0RSICh2bGlzdCkpCisg ICAgICAgIHsKKyAgICAgICAgICBjdXJzb3Jfc3BlY19saXN0ID0gWENBUiAoWENBUiAodmxpc3Qp KTsKKyAgICAgICAgICBwb3NpbnQgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMCksIGN1cnNv cl9zcGVjX2xpc3QpKTsKKyAgICAgICAgICBjdXJzb3Jfc3BlY190eXBlID0gRm50aCAobWFrZV9u dW1iZXIgKDE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3RhcnQKKyAgICAgICAg ICAgICAgJiYgdy0+bWMuZW5kCisgICAgICAgICAgICAgICYmIHBvc2ludCA+PSB3LT5tYy5zdGFy dAorICAgICAgICAgICAgICAmJiBwb3NpbnQgPD0gdy0+bWMuZW5kKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICB4X3lfaHBvc192cG9zID0gWENBUiAoWENEUiAoWENBUiAodmxpc3QpKSk7 CisgICAgICAgICAgICAgIHggPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMCksIHhfeV9ocG9z X3Zwb3MpKTsKKyAgICAgICAgICAgICAgeSA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgxKSwg eF95X2hwb3NfdnBvcykpOworICAgICAgICAgICAgICBocG9zID0gWElOVCAoRm50aCAobWFrZV9u dW1iZXIgKDIpLCB4X3lfaHBvc192cG9zKSk7CisgICAgICAgICAgICAgIHZwb3MgPSBYSU5UIChG bnRoIChtYWtlX251bWJlciAoMyksIHhfeV9ocG9zX3Zwb3MpKTsKKyAgICAgICAgICAgICAgbWNf ZHJhdyAodywgeCwgeSwgaHBvcywgdnBvcywgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcmVk LCBncmVlbiwgYmx1ZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgLyog RHJhdyB0aGUgY3Vyc29ycyBhbmV3IGJlY2F1c2Ugc29tZXRoaW5nIGhhcyBjaGFuZ2VkLCBlLmcu LCB0aGUgZmlyc3QgZWxlbWVudCBvZgorICAgICAgIHctPm1jX2NhY2hlIGlzIE5PVCB0aGUgc2Ft ZSBhcyB0aGUgbG9jYWwgdmFyaWFibGUgbWNfbGlzdDsgYW5kL29yLCB0aGUgcHJldmlvdXMvCisg ICAgICAgY3VycmVudCB3aW5kb3ctc3RhcnQvd2luZG93LWVuZCBhcmUgTk9UIHRoZSBzYW1lIChl LmcuLCBzY3JvbGxpbmcgaGFzIG9jY3VycmVkKS4KKyAgICAgICBTZW1pLWV4cGVuc2l2ZSBjYWxj dWxhdGlvbiBvZiBjb29yZGluYXRlcyBpcyByZXF1aXJlZC4gKi8KKyAgICBlbHNlIGlmICghcmVt b3ZlCisgICAgICAgICAgICAgJiYgdyA9PSBzdworICAgICAgICAgICAgICYmIHctPm1jLnN0YXJ0 CisgICAgICAgICAgICAgJiYgdy0+bWMuZW5kCisgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIg KGIsIG1jX2xpc3QpKSkKKyAgICAgIHsKKyAgI2lmZGVmIEdMWVBIX0RFQlVHCisgICAgZGVidWdf bWV0aG9kX2FkZCAodywgIm1jX2NhbGM6ICBkcmF3IGN1cnNvcnMgYW5ldyIpOworICAjZW5kaWYK KyAgICAgICAgZm9yICh2bGlzdCA9IEJWQVIgKGIsIG1jX2xpc3QpOworICAgICAgICAgICAgIENP TlNQICh2bGlzdCk7CisgICAgICAgICAgICAgdmxpc3QgPSBYQ0RSICh2bGlzdCkpCisgICAgICAg ICAgeworICAgICAgICAgICAgY3Vyc29yX3NwZWNfbGlzdCA9IFhDQVIgKHZsaXN0KTsKKyAgICAg ICAgICAgIHBvc2ludCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgwKSwgY3Vyc29yX3NwZWNf bGlzdCkpOworICAgICAgICAgICAgY3Vyc29yX3NwZWNfdHlwZSA9IEZudGggKG1ha2VfbnVtYmVy ICgxKSwgY3Vyc29yX3NwZWNfbGlzdCk7CisgICAgICAgICAgICBpZiAoQ09OU1AgKGN1cnNvcl9z cGVjX3R5cGUpKQorICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29y X3R5cGUgKFhDQVIgKGN1cnNvcl9zcGVjX3R5cGUpKTsKKyAgICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoY3Vyc29y X3NwZWNfdHlwZSk7CisgICAgICAgICAgICBpZiA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AgKEVRICh3LT5jb250 ZW50cywgWENBUiAoRm50aCAobWFrZV9udW1iZXIgKDIpLCB3LT5tY19jYWNoZSkpKSkgICovCisg ICAgICAgIGlmICghTklMUCAocmVzdWx0KSkKKyAgICAgICAgICB3c2V0X21jX2NhY2hlICh3LCBs aXN0biAoQ09OU1RZUEVfSEVBUCwgMywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBCVkFSIChiLCBtY19saXN0KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBGcmV2ZXJzZSAocmVzdWx0KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBGY29ucyAoYnVmLCBRbmlsKSkpOworICAgICAgfQorICB3LT5tYy5kcmF3X2VyYXNlID0g ZmFsc2U7CisgIGlmIChvbGRfYnVmZmVyKQorICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKG9sZF9i dWZmZXIpOworfQorCitERUZVTiAoIm1jLWRyYXctZm4iLCBGbWNfZHJhd19mbiwgU21jX2RyYXdf Zm4sIDUsIDUsIDAsCisgICAgICAgZG9jOiAvKiBEcmF3IG11bHRpcGxlIGZha2UgY3Vyc29ycy4g ICovKQorICAoTGlzcF9PYmplY3Qgd2luZG93LCBMaXNwX09iamVjdCB4X3lfaHBvc192cG9zLCBM aXNwX09iamVjdCBjdXJzb3JfdHlwZSwgTGlzcF9PYmplY3QgY3Vyc29yX3dpZHRoLCBMaXNwX09i amVjdCBjb2xvcl92ZWN0b3IpCit7CisgIHN0cnVjdCB3aW5kb3cgKncgPSBkZWNvZGVfbGl2ZV93 aW5kb3cgKHdpbmRvdyk7CisgIEVNQUNTX0lOVCB4LCB5LCBocG9zLCB2cG9zOworICBkb3VibGUg cmVkLCBncmVlbiwgYmx1ZTsKKyAgaW50IHR5cGU7CisgIHggPSBYSU5UIChGbnRoIChtYWtlX251 bWJlciAoMCksIHhfeV9ocG9zX3Zwb3MpKTsKKyAgeSA9IFhJTlQgKEZ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U7CisgICAgICAgICAgaW50IGludF9ibHVlID0gYmx1ZSAqIDY1NTM1 OworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IHhfbWFrZV90cnVl Y29sb3JfcGl4ZWwgKGRweWluZm8sIGludF9yZWQsIGludF9ncmVlbiwgaW50X2JsdWUpOworICAg ICAgICAgIHhfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBnbHlwaF9yb3cpOworICAgICAgICAgIGYt Pm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdfdmFsOworICAgICAgICB9CisgICAg ICAgIGVsc2UKKyAgICAgICAgICB4X2RyYXdfaG9sbG93X2N1cnNvciAodywgZ2x5cGhfcm93KTsK KyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIEZJTExFRF9CT1hfQ1VSU09SOgorICAgIHsK KyAgICAgICAvKiBUT0RPOiAga2RiIHRvIGNvbnNpZGVyIGFkZGluZyBzdXBwb3J0IGZvciBtdWx0 aXBsZSBjdXJzb3IgZm9yZWdyb3VuZAorICAgICAgIGN1c3RvbWl6YXRpb24gb2YgYSBGSUxMRURf Qk9YX0NVUlNPUi4gICovCisgICAgICBpZiAocmVkID49IDAgJiYgYmx1ZSA+PSAwICYmIGdyZWVu ID49IDApCisgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+ Y3Vyc29yX2djJyBieSBib3Jyb3dpbmcgdGhlCisgICAgICAgIGZ1bmN0aW9uYWxpdHkgb2YgYHhf bWFrZV9nYycgaW4geGZucy5jLiAgKi8KKyAgICAgICAgeworICAgICAgICAgIGJsb2NrX2lucHV0 ICgpOworICAgICAgICAgIExpc3BfT2JqZWN0IHdpbmRvdyA9IChzZWxlY3RlZF93aW5kb3cpOwor ICAgICAgICAgIHN0cnVjdCB3aW5kb3cgKncgPSBkZWNvZGVfbGl2ZV93aW5kb3cgKHdpbmRvdyk7 CisgICAgICAgICAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsK KyAgICAgICAgICBzdHJ1Y3QgeF9kaXNwbGF5X2luZm8gKmRweWluZm8gPSBGUkFNRV9ESVNQTEFZ X0lORk8gKGYpOworICAgICAgICAgIGludCBpbnRfcmVkID0gcmVkICogNjU1MzU7CisgICAgICAg ICAgaW50IGludF9ncmVlbiA9IGdyZWVuICogNjU1MzU7CisgICAgICAgICAgaW50IGludF9ibHVl ID0gYmx1ZSAqIDY1NTM1OworICAgICAgICAgIFhHQ1ZhbHVlcyBnY192YWx1ZXM7CisgICAgICAg ICAgdW5zaWduZWQgbG9uZyBtYXNrID0gR0NGb3JlZ3JvdW5kIHwgR0NCYWNrZ3JvdW5kIHwgR0NG aWxsU3R5bGUgfCBHQ0xpbmVXaWR0aDsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIG9yaWdfdmFs X2EgPSBGUkFNRV9CQUNLR1JPVU5EX1BJWEVMIChmKTsKKyAgICAgICAgICB1bnNpZ25lZCBsb25n IG9yaWdfdmFsX2IgPSBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWw7CisgICAgICAgICAg Z2NfdmFsdWVzLmxpbmVfd2lkdGggPSAwOyAgLyogTWVhbnMgMSB1c2luZyBmYXN0IGFsZ29yaXRo bS4gICovCisgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBGUkFNRV9CQUNLR1JPVU5E X1BJWEVMIChmKTsKKyAgICAgICAgICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IHhfbWFrZV90cnVl Y29sb3JfcGl4ZWwgKGRweWluZm8sIGludF9yZWQsIGludF9ncmVlbiwgaW50X2JsdWUpOworICAg ICAgICAgIGdjX3ZhbHVlcy5maWxsX3N0eWxlID0gRmlsbE9wYXF1ZVN0aXBwbGVkOworICAgICAg ICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYworICAgICAgICAgICAgPS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VJfQ1VS U09SOgorICAgIHsKKyAgICAgIGlmIChyZWQgPj0gMCAmJiBibHVlID49IDAgJiYgZ3JlZW4gPj0g MCkKKyAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJz b3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBmcmFtZSAqZiA9IFhG UkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7CisgICAgICAgICAgc3RydWN0IHhfZGlzcGxheV9pbmZv ICpkcHlpbmZvID0gRlJBTUVfRElTUExBWV9JTkZPIChmKTsKKyAgICAgICAgICB1bnNpZ25lZCBs b25nIG9yaWdfdmFsID0gZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsOworICAgICAgICAg IGludCBpbnRfcmVkID0gcmVkICogNjU1MzU7CisgICAgICAgICAgaW50IGludF9ncmVlbiA9IGdy ZWVuICogNjU1MzU7CisgICAgICAgICAgaW50IGludF9ibHVlID0gYmx1ZSAqIDY1NTM1OworICAg ICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IHhfbWFrZV90cnVlY29sb3Jf cGl4ZWwgKGRweWluZm8sIGludF9yZWQsIGludF9ncmVlbiwgaW50X2JsdWUpOworICAgICAgICAg IHhfZHJhd19iYXJfY3Vyc29yICh3LCBnbHlwaF9yb3csIGN1cnNvcl93aWR0aCwgSEJBUl9DVVJT T1IpOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdfdmFs OworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB4X2RyYXdfYmFyX2N1cnNvciAo dywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEhCQVJfQ1VSU09SKTsKKyAgICAgIGJyZWFrOwor ICAgIH0KKyAgICBjYXNlIE5PX0NVUlNPUjoKKyAgICAgIHctPnBoeXNfY3Vyc29yX3dpZHRoID0g MDsKKyAgICAgIGJyZWFrOworICAgIGRlZmF1bHQ6CisgICAgICBlbWFjc19hYm9ydCAoKTsKKyAg fQorLyogRU5EIG11bHRpcGxlIGN1cnNvcnMgKi8KKy8qIDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozsg Ki8KIAotCSAgICBjYXNlIE5PX0NVUlNPUjoKLQkgICAgICB3LT5waHlzX2N1cnNvcl93aWR0aCA9 IDA7Ci0JICAgICAgYnJlYWs7CiAKLQkgICAgZGVmYXVsdDoKLQkgICAgICBlbWFjc19hYm9ydCAo KTsKLQkgICAgfQogCX0KIAogI2lmZGVmIEhBVkVfWF9JMThOCg== --Multipart_Sun_Jul_30_10:39:45_2017-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: Can we support multiple cursors? References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 11 Aug 2017 00:01:02 +0000 Resent-Message-ID: <handler.22873.B22873.150240964130616 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22873 <at> debbugs.gnu.org Cc: John Wiegley <jwiegley@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>, Marcin Borkowski <mbork@HIDDEN>, Richard Stallman <rms@HIDDEN> Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.150240964130616 (code B ref 22873); Fri, 11 Aug 2017 00:01:02 +0000 Received: (at 22873) by debbugs.gnu.org; 11 Aug 2017 00:00:41 +0000 Received: from localhost ([127.0.0.1]:54854 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1dfxNY-0007xk-QJ for submit <at> debbugs.gnu.org; Thu, 10 Aug 2017 20:00:41 -0400 Received: from gateway24.websitewelcome.com ([192.185.51.110]:27971) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1dfxNU-0007xa-UG for 22873 <at> debbugs.gnu.org; Thu, 10 Aug 2017 20:00:37 -0400 Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway24.websitewelcome.com (Postfix) with ESMTP id 18B9528765 for <22873 <at> debbugs.gnu.org>; Thu, 10 Aug 2017 19:00:36 -0500 (CDT) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id fxMfd8on0dHTnfxMfdYE0U; Thu, 10 Aug 2017 18:59:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=40D+88mFpHwuhjTmvgBAICP2D+0ttqVpfeyCfXHugO4=; b=U+8ZOTpK63Y51rC4HOUyMSrG03 u8fYqNt4Zd3yCj76bq8CT/KCNHQT/SUSl5DgGvPu8L+ZDIQCUzvFgTSLRTKF/1IKJP6ay5FSULvQV yTcHRg0YW+sMOeLZ9f9lt2KCSIu4sfHNcgyL2/Rxx+1GRQElhpXGhwVfWqArni+IHkIx+6cmI6CiJ nurprZNXqXZzpjq9Xig/n5M2a8Wjly3qvDaZoJ4/8Rz65n5WMHVHcRjXIQyvqwrJ6vsCWPBRO3Fh9 aGtpi/pk8KFOTcY7LCy/v+cdl8n5FgLyTmLAJxboDZK+q+31NwGj2vGfADJLfjwbAMq8ReweUywcE ndHtcGjw==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:56498 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.87) (envelope-from <esq@HIDDEN>) id 1dfxNS-000jpJ-Lz; Thu, 10 Aug 2017 19:00:35 -0500 Date: Thu, 10 Aug 2017 17:00:33 -0700 Message-ID: <m2o9rnrn1a.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Thu_Aug_10_17:00:33_2017-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Exim-ID: 1dfxNS-000jpJ-Lz X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:56498 X-Source-Auth: lawlist X-Email-Count: 5 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: 0.5 (/) --Multipart_Thu_Aug_10_17:00:33_2017-1 Content-Type: text/plain; charset=US-ASCII PATCH VERSION: 010 - This patch applies to commit a30e7e12ed8465e2565dd318d921bc87f52ce18e from 03/28/2016. [@lawlist is presently unable to use the current master branch for daily workflow due to certain unrelated bugs.] WHAT'S NEW: - `update_frame` runs too late in the redisplay cycle to reliably remove all fake cursors when cutting/pasting text in conjunction with the current command loop. If we erase the fake cursors at the outset of `redisplay_window`, removal occurs too early in the redisplay cycle and the user sees the cursors being removed before the current command finishes. The very end of `redisplay_window` is a little closer to being the "sweet spot" for initial fake cursor removal, which is where it now occurs. Fake cursors are presently only being drawn whenever `update_frame` is called. Removal of fake cursors is faster on OSX, and slower on Windows and X11. - Recordation of prior values at the end of `redisplay_window` has been simplified to just four (4) values (current/previous window-start/window-end). - `mc_erase` has been simplified to use the existing function `erase_phys_cursor`. - Miscellaneous bug fixes, including, but not limited to checks to ensure that coordinates (X, Y, HPOS, VPOS) are within bounds. - Improved comments and doc-strings. TODO: - Set up a user option similar to `cursor-in-non-selected-windows'. - Explore the idea of whether we need additional code to handle removing/redrawing fake cursors when windows change sizes / layouts. - `w->phys_cursor.vpos` of the real cursor is accurate as to VPOS irrespective of whether the `header-line-format' exists. `mc_x_y_hpos_vpos' may need to adopt a similar approach as to VPOS instead of checking the `header-line-format' and potentially adding a value of 1 immediately before calling `mc_erase' / `mc_draw'. - Fake cursors are being redrawn too often when mousing over text (underneath the real cursor) with mouse-face properties, and also when non-selected windows/frames have an ongoing process that require frequent redisplay updates. - Optimize drawing/erasing fake cursors. - Implement a way to properly calculate X, Y, HPOS, VPOS when overlays are present. The overlay after-string wreaks havoc when calculating coordinates. - Fix any bugs (there will surely be many). - Try and convince one or more real programmers to take over from here. ROAD MAP: - The first stage of development is the creation and removal of fake cursors, which are specified with: buffer point, cursor-style, and cursor color. - The second stage of development is the built-in C implementation of functionality similar to the multiple cursors library by Magnar Sveen. INSTALLATION: - STEP #1 (clone master branch): git clone -b master git://git.sv.gnu.org/emacs.git - STEP #2: cd over to the root of the `emacs` source directory cloned in the first step above. - STEP #3 (hard reset): git reset --hard a30e7e12ed8465e2565dd318d921bc87f52ce18e The following message is displayed in the terminal: "HEAD is now at a30e7e1 Mention the `M-q' changes" - STEP #4 (put the patch in place): Copy the latest patch to the root of the emacs source directory cloned in the first step above. - STEP #5 (apply the patch): git apply [latest-patch.diff] - STEP #6: ./autogen.sh - STEP #7: Configure the build for X, MS Windows, or OSX; e.g.,: ./configure --with-ns - STEP #8: make - STEP #9: make install - STEP #10: Launch the newly built Emacs, and copy the following function to the `*scratch*` buffer, and type `M-x mc-test`. (defun mc-test () "Draw fake cursors at all POS defined in the `mc-list'. Multiple fake cursors are supported by GUI versions of Emacs built for X, Windows and OSX. Popular forms of specifying colors such as \"red\" and \"#FF0000\" are now supported, as well as LSL color vectors such as [1.0 0.0 0.0]. For those users who choose the former familiar methods of specifying colors with strings, `mc_color_vector_calculate' will convert those strings to LSL color vectors. The color vectors are commonly referred to as LSL (The Linden Scripting Language). `nsterm.m' uses `NSColor', which works well with LSL. `w32term.c' uses `PALETTERGB' or `RGB', and the conversion from LSL is done internally by multiplying each element of the LSL color vector by 255. `xterm.c' uses `x_make_truecolor_pixel', which uses 16-bit RGB -- the conversion from LSL happens internally by multiplying each element of the LSL color vector by 65535." (interactive) (let ((buffer (get-buffer-create "*MC-TEST*"))) (with-current-buffer buffer (erase-buffer) (insert "This is a test!") (setq mc-list '((1 "hbar" "red") (2 "bar" "yellow") (3 "box" "#00FF00") (4 "hollow" "#0000FF") (5 ("hbar" 3) [1.0 0.0 1.0]) (6 ("bar" 3) [0.0 1.0 1.0])))) (select-window (display-buffer buffer)) ;;; The trigger in `keyboard.c` is not activated in this example, so we ;;; Force the multiple cursors to be drawn. (mc-draw-erase (selected-window)))) --Multipart_Thu_Aug_10_17:00:33_2017-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="multiple_cursors_010.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3NyYy9idWZmZXIuYyBiL3NyYy9idWZmZXIuYwppbmRleCA2MmIwYmM4Li41 Yjk0NjliIDEwMDY0NAotLS0gYS9zcmMvYnVmZmVyLmMKKysrIGIvc3JjL2J1ZmZlci5jCkBAIC01 MDU2LDYgKzUwNTYsMTYgQEAgaW5pdF9idWZmZXJfb25jZSAodm9pZCkKICAgYnNldF9sYXN0X3Nl bGVjdGVkX3dpbmRvdyAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgbWFrZV9udW1iZXIgKDApKTsKIAog ICBpZHggPSAxOworCisKKy8qIDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzsgKi8KKy8qIG11bHRpcGxl IGN1cnNvcnMgKi8KKworICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywg bWNfbGlzdCksIGlkeCk7ICsraWR4OworCisvKiA7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7ICovCisK KwogICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgbW9kZV9saW5lX2Zv cm1hdCksIGlkeCk7ICsraWR4OwogICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9m bGFncywgYWJ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ody0+bWMuZXJhc2UKKyAgICAg ICAgICAmJiAhTUlOSV9XSU5ET1dfUCAodykKKyAgICAgICAgICAmJiAoIU5JTFAgKHctPm1jX2Nh Y2hlKSAmJiAoRVEgKHctPmNvbnRlbnRzLCBYQ0FSIChGbnRoIChtYWtlX251bWJlciAoMiksIHct Pm1jX2NhY2hlKSkpKSkpCisgICAgICAgIG1jX2NhbGMgKHcsIDEpOworCisgICAgICBpZiAody0+ bWMuZHJhdworICAgICAgICAgICYmICFNSU5JX1dJTkRPV19QICh3KQorICAgICAgICAgICYmICFO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2xpc3QpKSkKKyAgICAgICAgLyog RHJhdyBmYWtlIGN1cnNvcnMgICovCisgICAgICAgIG1jX2NhbGMgKHcsIDApOworICAgICAgICAv KiBGaXJzdCBhdHRlbXB0IGF0IGRlYWxpbmcgd2l0aCBhIGByZWRpc3BsYXlfcHJlc2VydmVfZWNo b19hcmVhJyBzaXR1YXRpb24uICAqLworICAgICAgICBlbHNlIGlmICghdy0+bWMuZHJhdworICAg ICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19s aXN0KSkKKyAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKHctPm1jX2NhY2hlKQorICAgICAgICAg ICAgICAgICAmJiAoRVEgKHctPmNvbnRlbnRzLCBYQ0FSIChGbnRoIChtYWtlX251bWJlciAoMiks IHctPm1jX2NhY2hlKSkpKQorICAgICAgICAgICAgICAgICAmJiAhTUlOSV9XSU5ET1dfUCAodykp CisgICAgICAgICAgeworICAgICAgICAgICAgLyogUmVtb3ZlIGZha2UgY3Vyc29ycy4gICovCisg ICAgICAgICAgICBtY19jYWxjICh3LCAxKTsKKyAgICAgICAgICAgIC8qIERyYXcgZmFrZSBjdXJz b3JzICAqLworICAgICAgICAgICAgbWNfY2FsYyAodywgMCk7CisgICAgICAgICAgfQorCisvKiBF TkQgbXVs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JlZW4sIGludF9ibHVlKTsK KyAgICAgICAgICB4X2RyYXdfaG9sbG93X2N1cnNvciAodywgZ2x5cGhfcm93KTsKKyAgICAgICAg ICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9yaWdfdmFsOworICAgICAgICB9 CisgICAgICAgIGVsc2UKKyAgICAgICAgICB4X2RyYXdfaG9sbG93X2N1cnNvciAodywgZ2x5cGhf cm93KTsKKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIEZJTExFRF9CT1hfQ1VSU09SOgor ICAgIHsKKyAgICAgIC8qIFRPRE86ICBrZGIgdG8gY29uc2lkZXIgYWRkaW5nIHN1cHBvcnQgZm9y IG11bHRpcGxlIGN1cnNvciBmb3JlZ3JvdW5kCisgICAgICBjdXN0b21pemF0aW9uIG9mIGEgRklM TEVEX0JPWF9DVVJTT1IuICAqLworICAgICAgaWYgKHJlZCA+PSAwICYmIGJsdWUgPj0gMCAmJiBn cmVlbiA+PSAwKQorICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRh LnczMi0+Y3Vyc29yX2djJyBieSBib3Jyb3dpbmcgdGhlCisgICAgICAgIGZ1bmN0aW9uYWxpdHkg b2YgYHhfbWFrZV9nYycgaW4gdzMyZm5zLmMuICAqLworICAgICAgICB7CisgICAgICAgICAgYmxv Y2tfaW5wdXQgKCk7CisgICAgICAgICAgTGlzcF9PYmplY3Qgd2luZG93ID0gKHNlbGVjdGVkX3dp bmRvdyk7CisgICAgICAgICAgc3RydWN0IHdpbmRvdyAqdyA9IGRlY29kZV9saXZlX3dpbmRvdyAo d2luZG93KTsKKyAgICAgICAgICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFN RSAodykpOworICAgICAgICAgIGludCBpbnRfcmVkID0gcmVkICogMjU1OworICAgICAgICAgIGlu dCBpbnRfZ3JlZW4gPSBncmVlbiAqIDI1NTsKKyAgICAgIC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dj ID0gZmFsc2U7CisgICAgICAgICAgZ2NfdmFsdWVzLmZvbnQgPSBGUkFNRV9GT05UIChmKTsKKyAg ICAgICAgICBnY192YWx1ZXMuZm9yZWdyb3VuZCA9IG9yaWdfdmFsX2E7CisgICAgICAgICAgZ2Nf dmFsdWVzLmJhY2tncm91bmQgPSBvcmlnX3ZhbF9iOworICAgICAgICAgIGYtPm91dHB1dF9kYXRh LnczMi0+Y3Vyc29yX2djCisgICAgICAgICAgICA9IFhDcmVhdGVHQyAoTlVMTCwgRlJBTUVfVzMy X1dJTkRPVyAoZiksIG1hc2ssICZnY192YWx1ZXMpOworICAgICAgICAgIHVuYmxvY2tfaW5wdXQg KCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIGRyYXdfcGh5c19jdXJzb3Jf Z2x5cGggKHcsIGdseXBoX3JvdywgRFJBV19DVVJTT1IpOworICAgICAgYnJlYWs7CisgICAgfQor ICAgIGNhc2UgQkFSX0NVUlNPUjoKKyAgICB7CisgICAgICBpZiAocmVkID49IDAgJiYgYmx1ZSA+ PSAwICYmIGdyZWVuID49IDApCisgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0 cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgeworICAgICAgICAgIHN0 cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7CisgICAgICAgICAgQ09M T1JSRUYgb3JpZ192YWwgPSBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbDsKKyAgICAg ICAgICBpbnQgaW50X3JlZCA9IHJlZCAqIDI1NTsKKyAgICAgICAgICBpbnQgaW50X2dyZWVuID0g Z3JlZW4gKiAyNTU7CisgICAgICAgICAgaW50IGludF9ibHVlID0gYmx1ZSAqIDI1NTsKKyAgICAg ICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IFBBTEVUVEVSR0IgKGludF9y ZWQsIGludF9ncmVlbiwgaW50X2JsdWUpOworICAgICAgICAgIHhfZHJhd19iYXJfY3Vyc29yICh3 LCBnbHlwaF9yb3csIGN1cnNvcl93aWR0aCwgQkFSX0NVUlNPUik7CisgICAgICAgICAgZi0+b3V0 cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBvcmlnX3ZhbDsKKyAgICAgICAgfQorICAgICAg ICBlbHNlCisgICAgICAgICAgeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIGdseXBoX3JvdywgY3Vyc29y X3dpZHRoLCBCQVJfQ1VSU09SKTsKKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIEhCQVJf Q1VSU09SOgorICAgIHsKKyAgICAgIGlmIChyZWQgPj0gMCAmJiBibHVlID49IDAgJiYgZ3JlZW4g Pj0gMCkKKyAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzIt PmN1cnNvcl9waXhlbCcuICAqLworICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGZyYW1lICpm ID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAgICAgICAgICBDT0xPUlJFRiBvcmlnX3Zh bCA9IGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsOworICAgICAgICAgIGludCBpbnRf cmVkID0gcmVkICogMjU1OworICAgICAgICAgIGludCBpbnRfZ3JlZW4gPSBncmVlbiAqIDI1NTsK KyAgICAgICAgICBpbnQgaW50X2JsdWUgPSBibHVlICogMjU1OworICAgICAgICAgIGYtPm91dHB1 dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gUEFMRVRURVJHQiAoaW50X3JlZCwgaW50X2dyZWVu LCBpbnRfYmx1ZSk7CisgICAgICAgICAgeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIGdseXBoX3Jvdywg Y3Vyc29yX3dpZHRoLCBIQkFSX0NVUl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VhZ2UpLgorICAgIGBuc3Rlcm0ubScgdXNlcyBgTlNDb2xvcicsIHdoaWNoIHdvcmtzIHdl bGwgd2l0aCBMU0wuICBgdzMydGVybS5jJyB1c2VzCisgICAgYFBBTEVUVEVSR0InIG9yIGBSR0In LCBhbmQgdGhlIGNvbnZlcnNpb24gZnJvbSBMU0wgaXMgZG9uZSBpbnRlcm5hbGx5IGJ5CisgICAg bXVsdGlwbHlpbmcgZWFjaCBlbGVtZW50IG9mIHRoZSBMU0wgY29sb3IgdmVjdG9yIGJ5IDI1NS4g IGB4dGVybS5jJyB1c2VzCisgICAgYHhfbWFrZV90cnVlY29sb3JfcGl4ZWwnLCB3aGljaCB1c2Vz IDE2LWJpdCBSR0IgLS0gdGhlIGNvbnZlcnNpb24gZnJvbSBMU0wKKyAgICBoYXBwZW5zIGludGVy bmFsbHkgYnkgbXVsdGlwbHlpbmcgZWFjaCBlbGVtZW50IG9mIHRoZSBMU0wgY29sb3IgdmVjdG9y IGJ5IDY1NTM1LiIKKyAgICAoaW50ZXJhY3RpdmUpCisgICAgICAobGV0ICgoYnVmZmVyIChnZXQt YnVmZmVyLWNyZWF0ZSAiKk1DLVRFU1QqIikpKQorICAgICAgICAod2l0aC1jdXJyZW50LWJ1ZmZl ciBidWZmZXIKKyAgICAgICAgICAoZXJhc2UtYnVmZmVyKQorICAgICAgICAgIChpbnNlcnQgIlRo aXMgaXMgYSB0ZXN0ISIpCisgICAgICAgICAgKHNldHEgbWMtbGlzdCAnKCgxICJoYmFyIiAibWFn ZW50YSIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICgyICJiYXIiICJwdXJwbGUiKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAoMyAiYm94IiAiIzAwRkYwMCIpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICg0ICJob2xsb3ciICIjMDAwMEZGIikKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgKDUgKCJoYmFyIiAzKSBbMS4wIDAuMCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAoNiAoImJhciIgMykgWzAuMCAxLjAgMS4wXSkpKSkKKyAgICAgICAgKHNlbGVjdC13aW5k b3cgKGRpc3BsYXktYnVmZmVyIGJ1ZmZlcikpCisgICAgICAgIDs7OyBUaGUgdHJpZ2dlciBpbiBg a2V5Ym9hcmQuY2AgaXMgbm90IGFjdGl2YXRlZCBpbiB0aGlzIGV4YW1wbGUsIHNvIHdlCisgICAg ICAgIDs7OyBmb3JjZSB0aGUgbXVsdGlwbGUgY3Vyc29ycyB0byBiZSBkcmF3bi4KKyAgICAgICAg KG1jLWRyYXctZXJhc2UgKHNlbGVjdGVkLXdpbmRvdykpKSkgICovCisKKy8qICAoZGVmdW4gbWMt Y3Vyc29yLW9uICgpCisgICAgIkZvciB0ZXN0aW5nIHB1cnBvc2VzIG9ubHksIGRyYXcgYSBmYWtl IGN1cnNvciBpbW1lZGlhdGVseSBiZWZvcmUgcG9pbnQuCisgICAgUGxlYXNlIHVzZSB0aGUgYG1j LWxpc3QnIGZvciByZWd1bGFyIHVzYWdlIG9mIG11bHRpcGxlIGZha2UgY3Vyc29ycy4iCisgICAg KGludGVyYWN0aXZlKQorICAgICAgKGxldCogKAorICAgICAgICAgICh3aW5kb3cgKHNlbGVjdGVk LXdpbmRvdykpCisgICAgICAgICAgKHBvc24gKHBvc24tYXQtcG9pbnQgKDEtIChwb2ludCkpKSkK KyAgICAgICAgICAobnRoLTIgKG50aCAyIHBvc24pKQorICAgICAgICAgICh4IChjYXIgbnRoLTIp KQorICAgICAgICAgICh5IChjZHIgbnRoLTIpKQorICAgICAgICAgIChudGgtNiAobnRoIDYgcG9z bikpCisgICAgICAgICAgKGhwb3MgKGNhciBudGgtNikpCisgICAgICAgICAgKHZwb3MgKGlmIGhl YWRlci1saW5lLWZvcm1hdAorICAgICAgICAgICAgICAgICAgKDErIChjZHIgbnRoLTYpKQorICAg ICAgICAgICAgICAgICAgKGNkciBudGgtNikpKQorICAgICAgICAgICh4LXktaHBvcy12cG9zIChs aXN0IHggeSBocG9zIHZwb3MpKQorICAgICAgICAgIChjdXJzb3ItdHlwZSAiYm94IikKKyAgICAg ICAgICAoY3Vyc29yLXdpZHRoIDEpCisgICAgICAgICAgKGNvbG9yLXZlY3RvciBbMS4wIDAuMCAx LjBdKSkKKyAgICAgICAgKG1jLWRyYXctZm4gd2luZG93IHgteS1ocG9zLXZwb3MgY3Vyc29yLXR5 cGUgY3Vyc29yLXdpZHRoIGNvbG9yLXZlY3RvcikpKSAgKi8KKworLyogIChkZWZ1biBtYy1jdXJz b3Itb2ZmICgpCisgICAgIkZvciB0ZXN0aW5nIHB1cnBvc2VzIG9ubHksIGVyYXNlIGEgZmFrZSBj dXJzb3IgaW1tZWRpYXRlbHkgYmVmb3JlIHBvaW50LgorICAgIFBsZWFzZSB1c2UgdGhlIGBtYy1s aXN0JyBmb3IgcmVndWxhciB1c2FnZSBvZiBtdWx0aXBsZSBmYWtlIGN1cnNvcnMuIgorICAgIChp bnRlcmFjdGl2ZSkKKyAgICAgIChsZXQqICgKKyAgICAgICAgICAod2luZG93IChzZWxlY3RlZC13 aW5kb3cpKQorICAgICAgICAgIChwb3NuIChwb3NuLWF0LXBvaW50ICgxLSAocG9pbnQpKSkpCisg ICAgICAgICAgKG50aC0yIChudGggMiBwb3NuKSkKKyAgICAgICAgICAoeCAoY2FyIG50aC0yKSkK KyAgICAgICAgICAoeSAoY2RyIG50aC0yKSkKKyAgICAgICAgICAobnRoLTYgKG50aCA2IHBvc24p KQorICAgICAgICAgIChocG9zIChjYXIgbnRoLTYpKQorICAgICAgICAgICh2cG9zIChpZiBoZWFk ZXItbGluZS1mb3JtYXQKKyAgICAgICAgICAgICAgICAgICgxKyAoY2RyIG50aC02KSkKKyAgICAg ICAgICAgICAgICAgIChjZHIgbnRoLTYpKSkKKyAgICAgICAgICAoeC15LWhwb3MtdnBvcyAobGlz dCB4IHkgaHBvcyB2cG9zKSkKKyAgICAgICAgICAoY3Vyc29yLXR5cGUgImJveCIpKQorICAgICAg ICAobWMtZXJhc2UtZm4gd2luZG93IHgteS1ocG9zLXZwb3MgY3Vyc29yLXR5cGUpKSkgICovCisK Ky8qICAoZGVmdW4gbWMteC15LWhwb3MtdnBvcyAoKQorICAgICJBdCB0aGUgY3VycmVudCBwb3Np dGlvbiwgZGVzY3JpYmUgdGhlIGNvb3JkaW5hdGVzIFgsIFksIEhQT1MsIFZQT1M7CisgICAgYW5k LCBkZXNjcmliZSB0aGUgb3ZlcmxheSBwcm9wZXJ0aWVzIFRZUEUsIERJU1BMQVkgYW5kIEFGVEVS LVNUUklORy4iCisgICAgKGludGVyYWN0aXZlKQorICAgICAgKGxldCogKAorICAgICAgICAgIChw b3NpbnQgKHBvaW50KSkKKyAgICAgICAgICAod2luIChzZWxlY3RlZC13aW5kb3cpKQorICAgICAg ICAgIChzdGFydCAod2luZG93LXN0YXJ0IHdpbikpCisgICAgICAgICAgKGVuZCAod2luZG93LWVu ZCB3aW4gdCkpCisgICAgICAgICAgKHJlc3VsdCAobWMteC15LWhwb3MtdnBvcy1mbiB3aW4gcG9z aW50IHN0YXJ0IGVuZCkpKQorICAgICAgICAobWVzc2FnZSAieC95L2hwb3MvdnBvczogICVzIiBy ZXN1bHQpKSkgICovCisKKy8qICAoZGVmdW4gbWMtcHJpbnQtY2FjaGUgKCkKKyAgICAiUHJpbnQg dGhlIGNhY2hlIGZvciBtdWx0aXBsZSBjdXJzb3JzLiIKKyAgICAoaW50ZXJhY3RpdmUpCisgICAg ICAobWVzc2FnZSAiJXMiIChtYy1jYWNoZS1mbikpKSAgKi8KKworLyogIChnbG9iYWwtc2V0LWtl eSBbZjFdICdtYy1jdXJzb3Itb24pCisgICAgKGdsb2JhbC1zZXQta2V5IFtmMl0gJ21jLWN1cnNv ci1vZmYpCisgICAgKGdsb2JhbC1zZXQta2V5IFtmM10gJ21jLXRlc3QpCisgICAgKGdsb2JhbC1z ZXQta2V5IFtmNF0gJ21jLXgteS1ocG9zLXZwb3MpCisgICAgKG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2VfbnVtYmVyIChwb3NpbnQgKyAxKSkpOworICAgICAgaWYgKCFOSUxQIChvdmVybGF5 cykpCisgICAgICAgIHsKKyAgICAgICAgICBmb3IgKG92X2xpc3QgPSBvdmVybGF5czsKKyAgICAg ICAgICAgICAgIENPTlNQIChvdl9saXN0KTsKKyAgICAgICAgICAgICAgIG92X2xpc3QgPSBYQ0RS IChvdl9saXN0KSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgb3YgPSBYQ0FSIChvdl9s aXN0KTsKKyAgICAgICAgICAgICAgb3ZfcXVlcnlfdHlwZSA9IEZvdmVybGF5X2dldCAob3YsIG92 X3R5cGUpOworICAgICAgICAgICAgICBvdl9xdWVyeV9kaXNwbGF5ID0gRm92ZXJsYXlfZ2V0IChv diwgUWRpc3BsYXkpOworICAgICAgICAgICAgICBvdl9xdWVyeV9hZnRlcl9zdHJpbmcgPSBGb3Zl cmxheV9nZXQgKG92LCBRYWZ0ZXJfc3RyaW5nKTsKKyAgICAgICAgICAgICAgaWYgKEVRIChvdl9x dWVyeV90eXBlLCBvdl9jb2xfZW92bCkpCisgICAgICAgICAgICAgICAgb3ZfZm91bmRfdHlwZV9j b2xlb3ZsID0gdHJ1ZTsKKyAgICAgICAgICAgICAgaWYgKEVRIChvdl9xdWVyeV90eXBlLCBvdl9y aWdodF9mcmluZ2UpKQorICAgICAgICAgICAgICAgIG92X2ZvdW5kX3R5cGVfcmlnaHRmcmluZ2Ug PSB0cnVlOworICAgICAgICAgICAgICBpZiAoIU5JTFAgKG92X3F1ZXJ5X2FmdGVyX3N0cmluZykp CisgICAgICAgICAgICAgICAgb3ZfZm91bmRfYWZ0ZXJzdHJpbmcgPSB0cnVlOworICAgICAgICAg ICAgfQorICAgICAgICB9CisgICAgICBTRVRfVEVYVF9QT1NfRlJPTV9NQVJLRVIgKHB0LCB3LT5z dGFydCk7CisgICAgICBzdGFydF9kaXNwbGF5ICgmaXQsIHcsIHB0KTsKKyAgICAgIG1vdmVfaXRf dG8gKCZpdCwgcG9zaW50LCAtMSwgLTEsIC0xLCBNT1ZFX1RPX1BPUyk7CisgICAgICB5ID0gaXQu Y3VycmVudF95OworICAgICAgdnBvcyA9IGl0LnZwb3M7CisgICAgICBpZiAob3ZfZm91bmRfdHlw ZV9jb2xlb3ZsKQorICAgICAgICB7CisgICAgICAgICAgVEVNUF9TRVRfUFRfQk9USCAoQ0hBUlBP UyAoaXQuY3VycmVudC5wb3MpLCBCWVRFUE9TIChpdC5jdXJyZW50LnBvcykpOworICAgICAgICAg IHBlb3ZsX2NvbCA9IGN1cnJlbnRfY29sdW1uICgpIC0gMTsKKyAgICAgICAgICBtb3ZlX2l0X2J5 X2xpbmVzICgmaXQsIC0xKTsKKyAgICAgICAgICBURU1QX1NFVF9QVF9CT1RIIChDSEFSUE9TIChp dC5jdXJyZW50LnBvcyksIEJZVEVQT1MgKGl0LmN1cnJlbnQucG9zKSk7CisgICAgICAgICAgcGJv dmxfY29sID0gY3VycmVudF9jb2x1bW4gKCk7CisgICAgICAgICAgY29sX2VvdmwgPSBwZW92bF9j b2wgLSBwYm92bF9jb2w7CisgICAgICAgICAgeCA9IGNvbF9lb3ZsICogZnJhbWVfY2hhcl93aWR0 aDsKKyAgICAgICAgICBocG9zID0gY29sX2Vvdmw7CisgICAgICAgICAgVEVNUF9TRVRfUFRfQk9U SCAob3BvaW50LCBvYnl0ZXBvcyk7CisgICAgICAgIH0KKyAgICAgICAgLyogU3BlY2lhbCBoYW5k bGluZyBmb3IgYGFmdGVyLXN0cmluZycgYW5kIGVvYiBzaXR1YXRpb25zLiAgKi8KKyAgICAgICAg ZWxzZSBpZiAob3ZfZm91bmRfYWZ0ZXJzdHJpbmcKKyAgICAgICAgICAgICAgICAgfHwgRkVUQ0hf QllURSAoSVRfQllURVBPUyAoaXQpKSA9PSAnXG4nCisgICAgICAgICAgICAgICAgIHx8IHBvc2lu dCA9PSBaVikKKyAgICAgICAgICB7CisgICAgICAgICAgICBURU1QX1NFVF9QVF9CT1RIIChDSEFS UE9TIChpdC5jdXJyZW50LnBvcyksIEJZVEVQT1MgKGl0LmN1cnJlbnQucG9zKSk7CisgICAgICAg ICAgICBwZW92bF9jb2wgPSBjdXJyZW50X2NvbHVtbiAoKTsKKyAgICAgICAgICAgIC8qIERWUE9T ID09IDAgbWVhbnMgbW92ZSB0byB0aGUgc3RhcnQgb2YgdGhlIHNjcmVlbiBsaW5lLiAgKi8KKyAg ICAgICAgICAgIG1vdmVfaXRfYnlfbGluZXMgKCZpdCwgMCk7CisgICAgICAgICAgICBURU1QX1NF VF9QVF9CT1RIIChDSEFSUE9TIChpdC5jdXJyZW50LnBvcyksIEJZVEVQT1MgKGl0LmN1cnJlbnQu cG9zKSk7CisgICAgICAgICAgICBwYm92bF9jb2wgPSBjdXJyZW50X2NvbHVtbiAoKTsKKyAgICAg ICAgICAgIGNvbF9lb3ZsID0gcGVvdmxfY29sIC0gcGJvdmxfY29sOworICAgICAgICAgICAgeCA9 IGNvbF9lb3ZsICogZnJhbWVfY2hhcl93aWR0aDsKKyAgICAgICAgICAgIGhwb3MgPSBjb2xfZW92 bDsKKyAgICAgICAgICAgIFRFTVBfU0VUX1BUX0JPVEggKG9wb2ludCwgb2J5dGVwb3MpOworICAg ICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHgg PSBpdC5jdXJyZW50X3g7CisgICAgICAgICAgICAgIGhwb3MgPSBpdC5ocG9zOworICAgICAgICAg ICAgfQorICAgICAgYmlkaV91bnNoZWx2ZV9jYWNoZSAoaXRkYXRhLCBmYWxzZSk7CisgICAgfQor ICAgIC8qIGBtY194X3lfaHBvc192cG9zJyBzZXRzIGFsbCBvZiB0aGUgY29vcmRpbmF0ZXMgdG8g LTEgaWYgUE9TSU5UIGlzIG91dCBvZiBib3VuZHMuICAqLworICAgIGVsc2UKKyAgICAgIHsKKyAg ICAgICAgeCA9IC0xOworICAgICAgICB5ID0gLTE7CisgICAgICAgIGhwb3Mg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0gWENBUiAoWENBUiAodmxpc3Qp KTsKKyAgICAgICAgICBjdXJzb3Jfc3BlY190eXBlID0gRm50aCAobWFrZV9udW1iZXIgKDEpLCBj dXJzb3Jfc3BlY19saXN0KTsKKyAgICAgICAgICBpZiAoQ09OU1AgKGN1cnNvcl9zcGVjX3R5cGUp KQorICAgICAgICAgICAgY3Vyc29yX3R5cGUgPSBtY19saXNwX3RvX2N1cnNvcl90eXBlIChYQ0FS IChjdXJzb3Jfc3BlY190eXBlKSk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGN1 cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoY3Vyc29yX3NwZWNfdHlwZSk7Cisg ICAgICAgICAgLyogYG1jX3hfeV9ocG9zX3Zwb3MnIHNldHMgYWxsIG9mIHRoZSBjb29yZGluYXRl cyB0byAtMSBpZiBQT1NJTlQgaXMgb3V0IG9mIGJvdW5kcy4KKyAgICAgICAgICAgICBAbGF3bGlz dCBoYXMgYWRkZWQgY29uZGl0aW9ucyB0byBgbWNfZXJhc2UnIHRoYXQgcmVxdWlyZSB0aGUgY29v cmRpbmF0ZXMgdG8gYmUgZ3JlYXRlciB0aGFuIG9yIGVxdWFsIHRvIDAuICAqLworICAgICAgICAg IHhfeV9ocG9zX3Zwb3MgPSBYQ0FSIChYQ0RSIChYQ0FSICh2bGlzdCkpKTsKKyAgICAgICAgICB4 ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB4X3lfaHBvc192cG9zKSk7CisgICAgICAg ICAgeSA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgxKSwgeF95X2hwb3NfdnBvcykpOworICAg ICAgICAgIGhwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMiksIHhfeV9ocG9zX3Zwb3Mp KTsKKyAgICAgICAgICB2cG9zID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDMpLCB4X3lfaHBv c192cG9zKSk7CisgICAgICAgICA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mcuLCBu byBzY3JvbGxpbmcpLAorICAgICB0aGVuIHJlZHJhdyB0aGUgY3Vyc29ycyB1c2luZyB0aGUgY2Fj aGUuICBUaGlzIGF2b2lkcyByZWNhbGN1bGF0aW5nIGNvb3JkaW5hdGVzLiAqLworICBpZiAoIXJl bW92ZQorICAgICAgJiYgdyA9PSBzdworICAgICAgJiYgdy0+bWMuc3RhcnQKKyAgICAgICYmIHct Pm1jLmVuZAorICAgICAgJiYgdy0+bWMucHJldl9zdGFydAorICAgICAgJiYgdy0+bWMucHJldl9l bmQKKyAgICAgICYmIHctPm1jLnN0YXJ0ID09IHctPm1jLnByZXZfc3RhcnQKKyAgICAgICYmIHct Pm1jLmVuZCA9PSB3LT5tYy5wcmV2X2VuZAorICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIG1jX2xp c3QpKQorICAgICAgJiYgIU5JTFAgKHctPm1jX2NhY2hlKQorICAgICAgJiYgIU5JTFAgKEZlcXVh bCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB3LT5tY19jYWNoZSksIEJWQVIgKGIsIG1jX2xpc3Qp KSkpCisgICAgeworI2lmZGVmIEdMWVBIX0RFQlVHCisgIGRlYnVnX21ldGhvZF9hZGQgKHcsICJt Y19jYWxjOiAgZHJhdyBjdXJzb3JzIHVzaW5nIGNhY2hlIHwgd2luZG93LWhlaWdodCAoJWQpIiwg d2luZG93X3RvdGFsX2hlaWdodCk7CisjZW5kaWYKKyAgICAgIGZvciAodmxpc3QgPSBYQ0FSIChY Q0RSICh3LT5tY19jYWNoZSkpOworICAgICAgICAgICBDT05TUCAodmxpc3QpOworICAgICAgICAg ICB2bGlzdCA9IFhDRFIgKHZsaXN0KSkKKyAgICAgICAgeworICAgICAgICAgIGN1cnNvcl9zcGVj X2xpc3QgPSBYQ0FSIChYQ0FSICh2bGlzdCkpOworICAgICAgICAgIHBvc2ludCA9IFhJTlQgKEZu dGggKG1ha2VfbnVtYmVyICgwKSwgY3Vyc29yX3NwZWNfbGlzdC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LCAyKSk7CisgICAgICAgICAgeF95X2hwb3NfdnBvcyA9IFhDQVIgKFhD RFIgKFhDQVIgKHZsaXN0KSkpOworICAgICAgICAgIHggPSBYSU5UIChGbnRoIChtYWtlX251bWJl ciAoMCksIHhfeV9ocG9zX3Zwb3MpKTsKKyAgICAgICAgICB5ID0gWElOVCAoRm50aCAobWFrZV9u dW1iZXIgKDEpLCB4X3lfaHBvc192cG9zKSk7CisgICAgICAgICAgaHBvcyA9IFhJTlQgKEZudGgg KG1ha2VfbnVtYmVyICgyKSwgeF95X2hwb3NfdnBvcykpOworICAgICAgICAgIHZwb3MgPSBYSU5U IChGbnRoIChtYWtlX251bWJlciAoMyksIHhfeV9ocG9zX3Zwb3MpKTsKKyAgICAgICAgICAvKiBQ cm92aWRlZCB0aGF0IFBPU0lOVCBpcyB3aXRoaW4gYm91bmRzLCB0aGUgY29vcmRpbmF0ZXMgWCwg WSwgSFBPUywgVlBPUworICAgICAgICAgIGBzaG91bGRgIGFsbCBiZSBncmVhdGVyIHRoYW4gb3Ig ZXF1YWwgdG8gMC4gICovCisgICAgICAgICAgaWYgKHctPm1jLnN0YXJ0CisgICAgICAgICAgICAg ICYmIHctPm1jLmVuZAorICAgICAgICAgICAgICAmJiBwb3NpbnQgPj0gdy0+bWMuc3RhcnQKKyAg ICAgICAgICAgICAgJiYgcG9zaW50IDw9IHctPm1jLmVuZCkKKyAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgaWYgKHdpbmRvd19oZWFkZXJfbGluZV9oZWlnaHQgPiAwKQorICAgICAgICAgICAg ICAgIHZwb3MgPSB2cG9zICsgMTsKKyAgICAgICAgICAgICAgbWNfZHJhdyAodywgeCwgeSwgaHBv cywgdnBvcywgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcmVkLCBncmVlbiwgYmx1ZSk7Cisg ICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIHctPm1jLmRyYXcgPSBmYWxzZTsKKyAgICB9 CisgICAgLyog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3Vyc29yX3NwZWNfbGlzdCkp OworICAgICAgICAgICAgY3Vyc29yX3NwZWNfdHlwZSA9IEZudGggKG1ha2VfbnVtYmVyICgxKSwg Y3Vyc29yX3NwZWNfbGlzdCk7CisgICAgICAgICAgICBpZiAoQ09OU1AgKGN1cnNvcl9zcGVjX3R5 cGUpKQorICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUg KFhDQVIgKGN1cnNvcl9zcGVjX3R5cGUpKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAg ICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoY3Vyc29yX3NwZWNf dHlwZSk7CisgICAgICAgICAgICBpZiAoQ09OU1AgKGN1cnNvcl9zcGVjX3R5cGUpKQorICAgICAg ICAgICAgICBjdXJzb3Jfd2lkdGggPSBYSU5UIChYQ0FSIChYQ0RSIChjdXJzb3Jfc3BlY190eXBl KSkpOworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoID0g MTsKKyAgICAgICAgICAgIGN1cnNvcl9jb2xvcl92ZWN0b3IgPSBGbnRoIChtYWtlX251bWJlciAo MiksIGN1cnNvcl9zcGVjX2xpc3QpOworICAgICAgICAgICAgaWYgKFNUUklOR1AgKGN1cnNvcl9j b2xvcl92ZWN0b3IpKQorICAgICAgICAgICAgICBjdXJzb3JfY29sb3JfdmVjdG9yID0gbWNfY29s b3JfdmVjdG9yX2NhbGN1bGF0ZSAodywgY3Vyc29yX2NvbG9yX3ZlY3Rvcik7CisgICAgICAgICAg ICByZWQgPSBYRkxPQVRfREFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3RvciwgMCkpOworICAg ICAgICAgICAgZ3JlZW4gPSBYRkxPQVRfREFUQSAoQVJFRiAoY3Vyc29yX2NvbG9yX3ZlY3Rvciwg MSkpOworICAgICAgICAgICAgYmx1ZSA9IFhGTE9BVF9EQVRBIChBUkVGIChjdXJzb3JfY29sb3Jf dmVjdG9yLCAyKSk7CisgICAgICAgICAgICB4X3lfaHBvc192cG9zID0gRm50aCAobWFrZV9udW1i ZXIgKDApLCBtY194X3lfaHBvc192cG9zICh3LCBwb3NpbnQsIHctPm1jLnN0YXJ0LCB3LT5tYy5l bmQpKTsKKyAgICAgICAgICAgIHRlbXAgPSBGY29ucyAoY3Vyc29yX3NwZWNfbGlzdCwgRmNvbnMg KHhfeV9ocG9zX3Zwb3MsIFFuaWwpKTsKKyAgICAgICAgICAgIHJlc3VsdCA9IEZjb25zICh0ZW1w LCByZXN1bHQpOworICAgICAgICAgICAgeCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgwKSwg eF95X2hwb3NfdnBvcykpOworICAgICAgICAgICAgeSA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVy ICgxKSwgeF95X2hwb3NfdnBvcykpOworICAgICAgICAgICAgaHBvcyA9IFhJTlQgKEZudGggKG1h a2VfbnVtYmVyICgyKSwgeF95X2hwb3NfdnBvcykpOworICAgICAgICAgICAgdnBvcyA9IFhJTlQg KEZudGggKG1ha2VfbnVtYmVyICgzKSwgeF95X2hwb3NfdnBvcykpOworICAgICAgICAgICAgLyog UHJvdmlkZWQgdGhhdCBQT1NJTlQgaXMgd2l0aGluIGJvdW5kcywgdGhlIGNvb3JkaW5hdGVzIFgs IFksIEhQT1MsIFZQT1MKKyAgICAgICAgICAgIGBzaG91bGRgIGFsbCBiZSBncmVhdGVyIHRoYW4g b3IgZXF1YWwgdG8gMC4gICovCisgICAgICAgICAgICBpZiAody0+bWMuc3RhcnQKKyAgICAgICAg ICAgICAgICAmJiB3LT5tYy5lbmQKKyAgICAgICAgICAgICAgICAmJiBwb3NpbnQgPj0gdy0+bWMu c3RhcnQKKyAgICAgICAgICAgICAgICAmJiBwb3NpbnQgPD0gdy0+bWMuZW5kKQorICAgICAgICAg ICAgICB7CisgICAgICAgICAgICAgICAgaWYgKHdpbmRvd19oZWFkZXJfbGluZV9oZWlnaHQgPiAw KQorICAgICAgICAgICAgICAgICAgdnBvcyA9IHZwb3MgKyAxOworICAgICAgICAgICAgICAgIG1j X2RyYXcgKHcsIHgsIHksIGhwb3MsIHZwb3MsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJl ZCwgZ3JlZW4sIGJsdWUpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorLyogYHctPm1j X2NhY2hlJyBpcyBzZXQgZm9yIHRoZSB3aW5kb3csIG5vdCBidWZmZXIrd2luZG93IC0tIGkuZS4s IGFsbCBidWZmZXJzIGFwcGVhcmluZworaW4gdGhlIHNhbWUgd2luZG93IHZpYSBgc3dpdGNoLXRv LWJ1ZmZlcicgd2lsbCBoYXZlIGB3LT5tY19jYWNoZScuICBUaGlzIGJlaGF2aW9yCitpcyBjb25z aXN0ZW50IHdpdGggZnVuY3Rpb25zIHN1Y2ggYXMgYHNldC13aW5kb3ctZGlzcGxheS10YWJsZScu ICBXZSBkZWFsIHdpdGggdGhpcyBpbgorYG5zdGVybS5tJyAvIGB3MzJ0ZXJtLmMnIC8gYHh0ZXJt LmMnIGJ5IGNvbXBhcmluZyBgdy0+Y29udGVudHMnIHRvIHRoZSB2YWx1ZSBvZiB0aGUgYGJ1ZicK K3N0b3JlZCBpbiBgdy0+bWNfY2FjaGUnOiAgKEVRICh3LT5jb250ZW50cywgWENBUiAoRm50aCAo bWFrZV9udW1iZXIgKDIpLCB3LT5tY19jYWNoZSkpKSkgICovCisgICAgICAgIGlmICghTklMUCAo cmVzdWx0KSkKKyAgICAgICAgICB3c2V0X21jX2NhY2hlICh3LCBsaXN0biAoQ09OU1RZUEVfSEVB UCwgMywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCVkFSIChiLCBtY19s aXN0KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGcmV2ZXJzZSAocmVz dWx0KSwKKyAgICAgIC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KworICAgICAgaWYgKHct Pm1jLmVyYXNlCisgICAgICAgICAgJiYgIU1JTklfV0lORE9XX1AgKHcpCisgICAgICAgICAgJiYg KCFOSUxQICh3LT5tY19jYWNoZSkgJiYgKEVRICh3LT5jb250ZW50cywgWENBUiAoRm50aCAobWFr ZV9udW1iZXIgKDIpLCB3LT5tY19jYWNoZSkpKSkpKQorICAgICAgICBtY19jYWxjICh3LCAxKTsK KworICAgICAgaWYgKHctPm1jLmRyYXcKKyAgICAgICAgICAmJiAhTUlOSV9XSU5ET1dfUCAodykK KyAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19saXN0 KSkpCisgICAgICAgIC8qIERyYXcgZmFrZSBjdXJzb3JzICAqLworICAgICAgICBtY19jYWxjICh3 LCAwKTsKKyAgICAgICAgLyogRmlyc3QgYXR0ZW1wdCBhdCBkZWFsaW5nIHdpdGggYSBgcmVkaXNw bGF5X3ByZXNlcnZlX2VjaG9fYXJlYScgc2l0dWF0aW9uLiAgKi8KKyAgICAgICAgZWxzZSBpZiAo IXctPm1jLmRyYXcKKyAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgbWNfbGlzdCkpCisgICAgICAgICAgICAgICAgICYmICFOSUxQICh3LT5tY19j YWNoZSkKKyAgICAgICAgICAgICAgICAgJiYgKEVRICh3LT5jb250ZW50cywgWENBUiAoRm50aCAo bWFrZV9udW1iZXIgKDIpLCB3LT5tY19jYWNoZSkpKSkKKyAgICAgICAgICAgICAgICAgJiYgIU1J TklfV0lORE9XX1AgKHcpKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIC8qIFJlbW92ZSBmYWtl IGN1cnNvcnMuICAqLworICAgICAgICAgICAgbWNfY2FsYyAodywgMSk7CisgICAgICAgICAgICAv KiBEcmF3IGZha2UgY3Vyc29ycyAgKi8KKyAgICAgICAgICAgIG1jX2NhbGMgKHcsIDApO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RUdJTiBtdWx0aXBsZSBjdXJzb3JzICovCisgIHN3aXRjaCAo Y3Vyc29yX3R5cGUpCisgIHsKKyAgICBjYXNlIEhPTExPV19CT1hfQ1VSU09SOgorICAgIHsKKyAg ICAgIGlmIChyZWQgPj0gMCAmJiBibHVlID49IDAgJiYgZ3JlZW4gPj0gMCkKKyAgICAgICAgLyog VGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwnLiAgKi8K KyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAoV0lORE9XX0ZS QU1FICh3KSk7CisgICAgICAgICAgc3RydWN0IHhfZGlzcGxheV9pbmZvICpkcHlpbmZvID0gRlJB TUVfRElTUExBWV9JTkZPIChmKTsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIG9yaWdfdmFsID0g Zi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsOworICAgICAgICAgIGludCBpbnRfcmVkID0g cmVkICogNjU1MzU7CisgICAgICAgICAgaW50IGludF9ncmVlbiA9IGdyZWVuICogNjU1MzU7Cisg ICAgICAgICAgaW50IGludF9ibHVlID0gYmx1ZSAqIDY1NTM1OworICAgICAgICAgIGYtPm91dHB1 dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IHhfbWFrZV90cnVlY29sb3JfcGl4ZWwgKGRweWluZm8s IGludF9yZWQsIGludF9ncmVlbiwgaW50X2JsdWUpOworICAgICAgICAgIHhfZHJhd19ob2xsb3df Y3Vyc29yICh3LCBnbHlwaF9yb3cpOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNv cl9waXhlbCA9IG9yaWdfdmFsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB4 X2RyYXdfaG9sbG93X2N1cnNvciAodywgZ2x5cGhfcm93KTsKKyAgICAgIGJyZWFrOworICAgIH0K KyAgICBjYXNlIEZJTExFRF9CT1hfQ1VSU09SOgorICAgIHsKKyAgICAgICAvKiBUT0RPOiAga2Ri IHRvIGNvbnNpZGVyIGFkZGluZyBzdXBwb3J0IGZvciBtdWx0aXBsZSBjdXJzb3IgZm9yZWdyb3Vu ZAorICAgICAgIGN1c3RvbWl6YXRpb24gb2YgYSBGSUxMRURfQk9YX0NVUlNPUi4gICovCisgICAg ICBpZiAocmVkID49IDAgJiYgYmx1ZSA+PSAwICYmIGdyZWVuID49IDApCisgICAgICAgIC8qIFRl bXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djJyBieSBib3Jyb3dp bmcgdGhlCisgICAgICAgIGZ1bmN0aW9uYWxpdHkgb2YgYHhfbWFrZV9nYycgaW4geGZucy5jLiAg Ki8KKyAgICAgICAgeworICAgICAgICAgIGJsb2NrX2lucHV0ICgpOworICAgICAgICAgIExpc3Bf T2JqZWN0IHdpbmRvdyA9IChzZWxlY3RlZF93aW5kb3cpOworICAgICAgICAgIHN0cnVjdCB3aW5k b3cgKncgPSBkZWNvZGVfbGl2ZV93aW5kb3cgKHdpbmRvdyk7CisgICAgICAgICAgc3RydWN0IGZy YW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAgICAgICAgICBzdHJ1Y3QgeF9k aXNwbGF5X2luZm8gKmRweWluZm8gPSBGUkFNRV9ESVNQTEFZX0lORk8gKGYpOworICAgICAgICAg IGludCBpbnRfcmVkID0gcmVkICogNjU1MzU7CisgICAgICAgICAgaW50IGludF9ncmVlbiA9IGdy ZWVuICogNjU1MzU7CisgICAgICAgICAgaW50IGludF9ibHVlID0gYmx1ZSAqIDY1NTM1OworICAg ICAgICAgIFhHQ1ZhbHVlcyBnY192YWx1ZXM7CisgICAgICAgICAgdW5zaWduZWQgbG9uZyBtYXNr ID0gR0NGb3JlZ3JvdW5kIHwgR0NCYWNrZ3JvdW5kIHwgR0NGaWxsU3R5bGUgfCBHQ0xpbmVXaWR0 aDsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIG9yaWdfdmFsX2EgPSBGUkFNRV9CQUNLR1JPVU5E X1BJWEVMIChmKTsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIG9yaWdfdmFsX2IgPSBmLT5vdXRw dXRfZGF0YS54LT5jdXJzb3JfcGl4ZWw7CisgICAgICAgICAgZ2NfdmFsdWVzLmxpbmVfd2lkdGgg PSAwOyAgLyogTWVhbnMgMSB1c2luZyBmYXN0IGFsZ29yaXRobS4gICovCisgICAgICAgICAgZ2Nf dmFsdWVzLmZvcmVncm91bmQgPSBGUkFNRV9CQUNLR1JPVU5EX1BJWEVMIChmKTsKKyAgICAgICAg ICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IHhfbWFrZV90cnVlY29sb3JfcGl4ZWwgKGRweWluZm8s IGludF9yZWQsIGludF9ncmVlbiwgaW50X2JsdWUpOworICAgICAgICAgIGdjX3ZhbHVlcy5maWxs X3N0eWxlID0gRmlsbE9wYXF1ZVN0aXBwbGVkOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngt PmN1cnNvcl9nYworICAgICAgICAgICAgPSBYQ3JlYXRlR0MgKEZSQU1FX1hfRElTUExBWSAoZiks IEZSQU1FX1hfV0lORE9XIChmKSwgbWFzaywgJmdjX3ZhbHVlcyk7CisgICAgICAgICAgLyogV2hl biBgdy0+bWMuc2V0X2N1cnNvcl9nYyA9IHRydWUnLCBmb3JjZSBgeF9zZXRfY3Vyc29yX2djJyB0 bworICAgICAgICAgIHVzZSBgcy0+Zi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djJy4gICovCisg ICAgICAgICAgdy0+bWMuc2V0X2N1cnNvcl9nYyA9IHRydWU7CisgICAgICAgICAgZHJhd19waHlz X2N1cnNvcl9nbHlwaCAodywgZ2x5cGhfcm93LCBEUkFXX0NVUlNPUik7CisgICAgICAgICAgdy0+ bWMuc2V0X2N1cnNvcl9nYyA9IGZhbHNlOworICAgICAgICAgIGd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VkVfWF9JMThOCg== --Multipart_Thu_Aug_10_17:00:33_2017-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: Can we support multiple cursors? References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sun, 13 Aug 2017 18:20:02 +0000 Resent-Message-ID: <handler.22873.B22873.150264837428959 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: John Wiegley <jwiegley@HIDDEN>, Marcin Borkowski <mbork@HIDDEN>, 22873 <at> debbugs.gnu.org, Richard Stallman <rms@HIDDEN> Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.150264837428959 (code B ref 22873); Sun, 13 Aug 2017 18:20:02 +0000 Received: (at 22873) by debbugs.gnu.org; 13 Aug 2017 18:19:34 +0000 Received: from localhost ([127.0.0.1]:60392 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1dgxU6-0007X1-El for submit <at> debbugs.gnu.org; Sun, 13 Aug 2017 14:19:34 -0400 Received: from gateway23.websitewelcome.com ([192.185.50.119]:23591) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1dgxU4-0007Wv-O6 for 22873 <at> debbugs.gnu.org; Sun, 13 Aug 2017 14:19:33 -0400 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway23.websitewelcome.com (Postfix) with ESMTP id 38447129E8 for <22873 <at> debbugs.gnu.org>; Sun, 13 Aug 2017 13:19:32 -0500 (CDT) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id gxTvdNI5uRtUXgxTvdnoC2; Sun, 13 Aug 2017 13:19:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=okTRj42cTIANA8TwwkrXx4Qb7rhheWSojFk58Svj3MI=; b=TXU1J9P54pimCgHz1CQBVdyhSF nChrPkQE1OKakBBLczWHxqRRWUzySVv4g00nHQyNRADAPELSl0Ewt1vwEn6Vh/NfqhOzfMr/urgDM LciiuMrZaaawUgqTsrbK38fsOTW4y2z86fCmY6psSo5V4sCTp6k70ps/roibASvaPPHMIHofn1MAV OCmxciijAsDwgui51kvwIzW+2srX/PnZyR+I3zi443BzZccTNDGSiCTcQkRVm7xByY1/RMNuhKm3T 3p6JHAA7NBcDxu8QGyfungvu/40Yy2tHj5PcRIqWW06zr9xk3+RgLJau+EYcE6jpkWfvXSCDBkEk3 5cTpsoVw==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:50923 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.87) (envelope-from <esq@HIDDEN>) id 1dgxU3-003tmT-9D; Sun, 13 Aug 2017 13:19:31 -0500 Date: Sun, 13 Aug 2017 11:19:30 -0700 Message-ID: <m2lgmnnxe5.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Exim-ID: 1dgxU3-003tmT-9D X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:50923 X-Source-Auth: lawlist X-Email-Count: 4 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: 0.5 (/) Dear Eli: I could use some help/guidance, please. I have encountered a situation where the Y and VPOS coordinates returned by `move_it_to` are sometimes out of bounds, and MATRIX_ROW crashes Emacs when drawing fake cursors that are out of bounds. The solution appears to be a test for whether Y and VPOS are out of bounds. I would like to use `window_box_height` to give me essentially the same value as `window-body-height` with a non-nil PIXELWISE argument. In my case, I have 998 pixels for the window body height as depicted in the diagram of the Emacs manual: https://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Sizes.html The last Y that I am interested in is at 1000 pixels because my `frame-char-height` -- aka `FRAME_LINE_HEIGHT (XFRAME (w->frame))` -- is 20. Two pixels are hidden by the mode-line, so the line of text is partially visible. `count-screen-lines` is not a viable option because using `vertical-motion` is too slow. The last VPOS that I am interested in is 50 -- again, same thing, partially visible wit h two pixels hidden underneath the mode-line. Testing and limiting the drawing of fake cursors with `y <= window_box_height (w)` gives me mixed results; i.e., sometimes fake cursors are drawn/erased only up to line 49, but sometimes it works up to line 50 (partially visible). I think I want to test for whether Y is less than or equal to 1000 and if VPOS is less than or equal to 50 -- if the test is true, then go ahead and draw fake cursors up to and including that location. However, I can foresee situations where there might be mixed line heights on the visible window, and relying upon the frame character height and window body height will not be reliable. In a simple case, we can take 1000 divided by 20 and know that the VPOS is 50. Is there a more reliable test for the last partially visible Y and VPOS within the window body height? Should I be using pos_visible_p in some capacity here? Thanks, Keith
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: Can we support multiple cursors? Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sun, 13 Aug 2017 18:38:01 +0000 Resent-Message-ID: <handler.22873.B22873.150264943429524 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Keith David Bershatsky <esq@HIDDEN> Cc: jwiegley@HIDDEN, mbork@HIDDEN, 22873 <at> debbugs.gnu.org, rms@HIDDEN Reply-To: Eli Zaretskii <eliz@HIDDEN> Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.150264943429524 (code B ref 22873); Sun, 13 Aug 2017 18:38:01 +0000 Received: (at 22873) by debbugs.gnu.org; 13 Aug 2017 18:37:14 +0000 Received: from localhost ([127.0.0.1]:60471 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1dgxlC-0007g8-HM for submit <at> debbugs.gnu.org; Sun, 13 Aug 2017 14:37:14 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42948) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1dgxlB-0007g2-6G for 22873 <at> debbugs.gnu.org; Sun, 13 Aug 2017 14:37:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <eliz@HIDDEN>) id 1dgxl4-00068A-Rs for 22873 <at> debbugs.gnu.org; Sun, 13 Aug 2017 14:37:07 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39289) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>) id 1dgxkp-00061W-ET; Sun, 13 Aug 2017 14:36:51 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3761 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from <eliz@HIDDEN>) id 1dgxkg-0006R3-Sq; Sun, 13 Aug 2017 14:36:44 -0400 Date: Sun, 13 Aug 2017 21:36:22 +0300 Message-Id: <831sofiac9.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-reply-to: <m2lgmnnxe5.wl%esq@HIDDEN> (message from Keith David Bershatsky on Sun, 13 Aug 2017 11:19:30 -0700) References: <m2lgmnnxe5.wl%esq@HIDDEN> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -5.0 (-----) > Date: Sun, 13 Aug 2017 11:19:30 -0700 > From: Keith David Bershatsky <esq@HIDDEN> > Cc: 22873 <at> debbugs.gnu.org,John Wiegley <jwiegley@HIDDEN>,Marcin Borkowski <mbork@HIDDEN>,Richard Stallman <rms@HIDDEN> > > I have encountered a situation where the Y and VPOS coordinates returned by `move_it_to` are sometimes out of bounds, and MATRIX_ROW crashes Emacs when drawing fake cursors that are out of bounds. The solution appears to be a test for whether Y and VPOS are out of bounds. Actually, the usual solution is to limit move_it_to to last_visible_y. Are you saying that you already do that, and the values of Y and VPOS are still out of bounds? That would be strange, because the display engine does that in many places. > I would like to use `window_box_height` to give me essentially the same value as `window-body-height` with a non-nil PIXELWISE argument. And that's not what you get? Can you show a simple example? `count-screen-lines` is not a viable option because using `vertical-motion` is too slow. It's strange that you say so because vertical-motion uses the same move_it_to subroutines that you'd like to use directly. > Testing and limiting the drawing of fake cursors with `y <= window_box_height (w)` gives me mixed results; i.e., sometimes fake cursors are drawn/erased only up to line 49, but sometimes it works up to line 50 (partially visible). I think I want to test for whether Y is less than or equal to 1000 and if VPOS is less than or equal to 50 -- if the test is true, then go ahead and draw fake cursors up to and including that location. Are you sure you account for the height of the cursor and the line on which it is shown? The Y coordinate is where the line begins; it ends several pixels lower, i.e. at a greater value of Y. > However, I can foresee situations where there might be mixed line heights on the visible window, and relying upon the frame character height and window body height will not be reliable. In a simple case, we can take 1000 divided by 20 and know that the VPOS is 50. For reliable calculations, you must do everything in pixels. > Is there a more reliable test for the last partially visible Y and VPOS within the window body height? Should I be using pos_visible_p in some capacity here? You could use pos_visible_p, although it, again, uses move_it_to. But I don't think I have a clear understanding of your problem, so maybe it's immaterial.
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: Can we support multiple cursors? References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Mon, 14 Aug 2017 03:21:01 +0000 Resent-Message-ID: <handler.22873.B22873.150268081720679 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: John Wiegley <jwiegley@HIDDEN>, Marcin Borkowski <mbork@HIDDEN>, 22873 <at> debbugs.gnu.org, Richard Stallman <rms@HIDDEN> Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.150268081720679 (code B ref 22873); Mon, 14 Aug 2017 03:21:01 +0000 Received: (at 22873) by debbugs.gnu.org; 14 Aug 2017 03:20:17 +0000 Received: from localhost ([127.0.0.1]:34274 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1dh5vN-0005NT-6a for submit <at> debbugs.gnu.org; Sun, 13 Aug 2017 23:20:17 -0400 Received: from gateway30.websitewelcome.com ([50.116.127.1]:11982) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1dh5vL-0005NL-B8 for 22873 <at> debbugs.gnu.org; Sun, 13 Aug 2017 23:20:15 -0400 Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway30.websitewelcome.com (Postfix) with ESMTP id 1D0BA16235 for <22873 <at> debbugs.gnu.org>; Sun, 13 Aug 2017 22:20:13 -0500 (CDT) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id h5ukdKCmhyM9yh5ukd7vkk; Sun, 13 Aug 2017 22:19:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=F1/aSfoId2ekyC6foCF16Iuc9Yi3YySp/0K7wFQKdQ4=; b=L7/w/QumlmqLwowcinp5SsH6qT Y5ZauPF+5IFqL082INRz7RqDngB1gnGdp/lW4lg+EzPvoDcKs05lb7ByZX6BvNjCWoNPK01VCPcsi gW3PRgiBGaLdoZiHEIuUa7E7Tyc+ZC47E7wN6a4I4Cqur8/TmvmGIS9HbA9Z4PAZG3mNB1MZuDUe3 4Qcn4IhmuWR/LOcz6EYoPgIC0qse2yWYO+jFXqtFwYq2DZ+iqjDRcRXkkcKWK6wFS45DDHaXmD0E6 kIzaLP/fL4TWoKhXL+HuMLwzzwzSRapRJzRWzhPINwbPpvb9bVx9tGm1d+L9HtExWPuMrTLjOK3yi K8lkOj3A==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:50834 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.87) (envelope-from <esq@HIDDEN>) id 1dh5vI-001VyV-3L; Sun, 13 Aug 2017 22:20:12 -0500 Date: Sun, 13 Aug 2017 20:20:10 -0700 Message-ID: <m2378u4yz9.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Exim-ID: 1dh5vI-001VyV-3L X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:50834 X-Source-Auth: lawlist X-Email-Count: 4 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.0 (/) I read through the comments in xdisp.c that immediately precede move_it_to and I also looked at all of it uses within xdisp.c, but I am still unclear how to limit move_it_to the it.last_visible_y. I got the impression that if I put it.last_visible_y as an argument of move_it_to, that `it` would move to that location instead of POS if POS cannot be found. I'd like the function mc_x_y_hpos_vpos to return valid coordinates if POSINT is on the visible window, or -1 for all four coordinates if it is not visible. I'm calling mc_x_y_hpos_vpos late in the redisplay cycle and the START/END arguments "should be" correct. I am unclear as why the Y and VPOS were sometimes out of bounds in a few corner cases (e.g., when I compiled a tex document that had errors in the LaTeX code) -- my best guess is that START/END may have been wrong because another window was opened displaying the tex compile messages. I was pretty sure that I could substitute window_box_height for window-body-height (with a non-nil PIXELWISE argument), and that is why I phrased that previous comment with a degree of uncertainty. Based on your comment, I now feel better about using window_box_height. I was unaware that my usage of move_it_to may have been incorrect, so that is why I was trying to come up with new ways to workaround coordinates that were out of bounds. If we can fix mc_x_y_hpos_vpos, then there would be no need to perform additional subsequent checks to see whether the values were correct. Drawing and erasing fake cursors is done by temporarily hijacking w->phys_cursor and then calling either erase_phys_cursor or draw_window_cursor. Today, I added "if (it.current_y >= it.last_visible_y) ... goto done" Lisp_Object mc_x_y_hpos_vpos (struct window *w, EMACS_INT posint, EMACS_INT start, EMACS_INT end) { struct it it; void *itdata = bidi_shelve_cache (); struct text_pos pt; int x, y, hpos, vpos; if (posint >= start && posint <= end) { SET_TEXT_POS_FROM_MARKER (pt, w->start); start_display (&it, w, pt); move_it_to (&it, posint, -1, -1, -1, MOVE_TO_POS); if (it.current_y >= it.last_visible_y) { bidi_unshelve_cache (itdata, false); goto done; } x = it.current_x; y = it.current_y; hpos = it.hpos; vpos = it.vpos; bidi_unshelve_cache (itdata, false); } else { done: x = -1; y = -1; hpos = -1; vpos = -1; } return listn (CONSTYPE_HEAP, 4, make_number (x), make_number (y), make_number (hpos), make_number (vpos)); }
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: Can we support multiple cursors? Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Mon, 14 Aug 2017 15:02:02 +0000 Resent-Message-ID: <handler.22873.B22873.150272290716944 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Keith David Bershatsky <esq@HIDDEN> Cc: jwiegley@HIDDEN, mbork@HIDDEN, 22873 <at> debbugs.gnu.org, rms@HIDDEN Reply-To: Eli Zaretskii <eliz@HIDDEN> Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.150272290716944 (code B ref 22873); Mon, 14 Aug 2017 15:02:02 +0000 Received: (at 22873) by debbugs.gnu.org; 14 Aug 2017 15:01:47 +0000 Received: from localhost ([127.0.0.1]:35413 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1dhGsE-0004PE-OW for submit <at> debbugs.gnu.org; Mon, 14 Aug 2017 11:01:46 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37367) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1dhGsD-0004P8-BE for 22873 <at> debbugs.gnu.org; Mon, 14 Aug 2017 11:01:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <eliz@HIDDEN>) id 1dhGs7-0003Mr-IR for 22873 <at> debbugs.gnu.org; Mon, 14 Aug 2017 11:01:40 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33738) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>) id 1dhGrn-0003Gy-2n; Mon, 14 Aug 2017 11:01:19 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4290 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from <eliz@HIDDEN>) id 1dhGrg-0007Ws-29; Mon, 14 Aug 2017 11:01:12 -0400 Date: Mon, 14 Aug 2017 18:01:07 +0300 Message-Id: <83y3qmgpn0.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-reply-to: <m2378u4yz9.wl%esq@HIDDEN> (message from Keith David Bershatsky on Sun, 13 Aug 2017 20:20:10 -0700) References: <m2378u4yz9.wl%esq@HIDDEN> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -5.0 (-----) > Date: Sun, 13 Aug 2017 20:20:10 -0700 > From: Keith David Bershatsky <esq@HIDDEN> > Cc: 22873 <at> debbugs.gnu.org,John Wiegley <jwiegley@HIDDEN>,Marcin Borkowski <mbork@HIDDEN>,Richard Stallman <rms@HIDDEN> > > I read through the comments in xdisp.c that immediately precede move_it_to and I also looked at all of it uses within xdisp.c, but I am still unclear how to limit move_it_to the it.last_visible_y. Like this: move_it_to (&it, POS, -1, it.last_visible_y - 1, -1, MOVE_TO_POS | MOVE_TO_Y); where POS is the buffer position. You can find many examples of this in xdisp.c. > I got the impression that if I put it.last_visible_y as an argument of move_it_to, that `it` would move to that location instead of POS if POS cannot be found. It stops when the first condition is satisfied. If it reaches POS before the window end, it stops there; otherwise it stops at the window end. It is then a simple matter of testing IT_CHARPOS(&it) against POS to see which of these conditions caused it to stop.
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: Can we support multiple cursors? References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Mon, 14 Aug 2017 20:36:01 +0000 Resent-Message-ID: <handler.22873.B22873.1502742932893 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: John Wiegley <jwiegley@HIDDEN>, Marcin Borkowski <mbork@HIDDEN>, 22873 <at> debbugs.gnu.org, Richard Stallman <rms@HIDDEN> Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.1502742932893 (code B ref 22873); Mon, 14 Aug 2017 20:36:01 +0000 Received: (at 22873) by debbugs.gnu.org; 14 Aug 2017 20:35:32 +0000 Received: from localhost ([127.0.0.1]:36803 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1dhM5E-0000EL-9W for submit <at> debbugs.gnu.org; Mon, 14 Aug 2017 16:35:32 -0400 Received: from gateway31.websitewelcome.com ([192.185.143.52]:11251) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1dhM5C-0000EF-QY for 22873 <at> debbugs.gnu.org; Mon, 14 Aug 2017 16:35:31 -0400 Received: from cm15.websitewelcome.com (cm15.websitewelcome.com [100.42.49.9]) by gateway31.websitewelcome.com (Postfix) with ESMTP id DEE9498E7B for <22873 <at> debbugs.gnu.org>; Mon, 14 Aug 2017 15:35:18 -0500 (CDT) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id hM5hdRTsrnlKZhM5hdVN8l; Mon, 14 Aug 2017 15:36:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=6nomPfBZeQbjD8SU1dl3h0nGPCUZhUe3iEHZ9O/WcvQ=; b=XmR3g3GjwB7XyEnmGWiawUK7fN ySAN66abPt/5TgSmG3IkXA70PJ+Z+z0PUN4DmfvuSYmqBAeq7jW5NV0rRUMc5yPvJQwDQykjdsi1Z KITChbibESXxQll3gilLdtsAFLhx+UiM5fIVU5DiwMUoFuG5Ca3poEoz5k737gnYiExc8yhCjb5jI dF0LzbjnyML6kG6G+WQnDXRg/pztOalvX6a7x8ad9e6gxtKqBGE3wBqYuk7z5ebhSSnMSKV0jVLq8 mury3H5S6eBvW2KLKgbi5VRn986Kr8efIHXZtp3DDlTKvdKfpKADUsGryPNfUKu77tk7Trqyw1Ll1 3nFrtz9w==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:52458 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.87) (envelope-from <esq@HIDDEN>) id 1dhM4z-002yqv-Rh; Mon, 14 Aug 2017 15:35:17 -0500 Date: Mon, 14 Aug 2017 13:35:17 -0700 Message-ID: <m21sodj3ay.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Exim-ID: 1dhM4z-002yqv-Rh X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:52458 X-Source-Auth: lawlist X-Email-Count: 4 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: 0.0 (/) Thank you, Eli, for teaching me how to better use move_it_to. In the tests that I ran today using: move_it_to (&it, POS, -1, it.last_visible_y - 1, -1, MOVE_TO_POS | MOVE_TO_Y); I observed that IT will stop at *the beginning of the last partially visible line* when POS is on the last partially visible line and POS's X coordinate is greater than 0. IT does *not* stop at the window-end. The following seems to work better when POS is on the last partially visible line and POS's x coordinate is greater than 0. move_it_to (&it, POS, it.last_visible_x, it.last_visible_y - 1, -1, MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y); I built a new working draft of Emacs based on the latter example and will be trying using it throughout the day. Keith
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs). References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Wed, 27 Dec 2017 17:14:02 +0000 Resent-Message-ID: <handler.22873.B22873.15143948333468 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22873 <at> debbugs.gnu.org,17684 <at> debbugs.gnu.org Cc: John Wiegley <jwiegley@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>, Marcin Borkowski <mbork@HIDDEN>, Richard Stallman <rms@HIDDEN> Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.15143948333468 (code B ref 22873); Wed, 27 Dec 2017 17:14:02 +0000 Received: (at 22873) by debbugs.gnu.org; 27 Dec 2017 17:13:53 +0000 Received: from localhost ([127.0.0.1]:54106 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1eUFH7-0000tr-M4 for submit <at> debbugs.gnu.org; Wed, 27 Dec 2017 12:13:53 -0500 Received: from gateway22.websitewelcome.com ([192.185.47.129]:39958) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1eUFH5-0000ti-IZ for 22873 <at> debbugs.gnu.org; Wed, 27 Dec 2017 12:13:51 -0500 Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway22.websitewelcome.com (Postfix) with ESMTP id 623F217952 for <22873 <at> debbugs.gnu.org>; Wed, 27 Dec 2017 11:13:41 -0600 (CST) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id UFGueJWiizzFjUFGue4FlU; Wed, 27 Dec 2017 11:13:41 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=NRTJeWWjSGIg0pJlsvCcvW+qan3smddS3z2pneLecx4=; b=ZKghtyq+W9QhUiRkdDvT2DdAbV f7+ibhS9Te6up9rP8/cE0KECl123cvneGanQldxG+qShuk3Om/6csHCgV5zUz7N+RrKd9ogUjp6cl 6hXCfdOfVHCo99IfshwhoiUggLP0JRWx3HOW1omb7JnZcNAPC/Isppo/rH5u+rk+gpO+Fh/s+xW85 CESbtoRCNMz33MN6kMIh87z5txgh40t+AhWDBTg5iq2joZUVemBjVS6XwccbrbG45hcHndCN19Z8E HUeBVOzwchF1Th2PS+A19DjquFLwW9PuZ3jyEJQQ3f0oFDGcXNJ1mBYO4dbKswORAVhEN9LYCixRh tYqGmlBw==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:50886 helo=server.private) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.89) (envelope-from <esq@HIDDEN>) id 1eUFGs-0039uk-9f; Wed, 27 Dec 2017 11:13:39 -0600 Date: Wed, 27 Dec 2017 09:13:37 -0800 Message-ID: <m28tdojdq6.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Wed_Dec_27_09:13:37_2017-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1eUFGs-0039uk-9f X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.private) [45.48.239.195]:50886 X-Source-Auth: lawlist X-Email-Count: 6 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> --Multipart_Wed_Dec_27_09:13:37_2017-1 Content-Type: text/plain; charset=US-ASCII The attached draft patch.diff applies to the Emacs 26 branch; bearing last commit da94ea92bc3ba6c236b394c00e6bbb725131a149; dated 12/26/2017. Feature request #17684 (crosshairs) uses the same mechanism as #22873 (multiple fake cursors), and the former was actually what inspired me to work on the latter. There is still no support to deal with placing fake cursors on text containing fancy overlays, text properties or combined characters. At this time, multiple fake cursors that persist are redrawn each command loop -- which can someday be optimized. Crosshairs are on an idle-timer. In my own setup, I have incorporated #22873 to work with Magnar's multiple cursors library using just a slight modification to a couple of his functions, and can provide that if anyone is interested. In a nutshell, Emacs can draw multiple fake cursors using #22873 instead of using the rectangle overlay chosen by Magnar. +-mode is pretty straight forward. Evaluate or load +-mode.el and type: M-x +-mode A simple interactive function demonstrating multiple fake cursors is named mc-test, which is within +-mode.el I will continue to work on this project as time goes by -- it is still a work in progress ... Keith --Multipart_Wed_Dec_27_09:13:37_2017-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="patch.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3NyYy9idWZmZXIuYyBiL3NyYy9idWZmZXIuYwppbmRleCA3YWU4ODlkLi5l YjdhNGJlIDEwMDY0NAotLS0gYS9zcmMvYnVmZmVyLmMKKysrIGIvc3JjL2J1ZmZlci5jCkBAIC01 MTI2LDYgKzUxMjYsMTUgQEAgaW5pdF9idWZmZXJfb25jZSAodm9pZCkKICAgYnNldF9sYXN0X3Nl bGVjdGVkX3dpbmRvdyAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgbWFrZV9udW1iZXIgKDApKTsKIAog ICBpZHggPSAxOworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBtdWx0aXBsZSBjdXJzb3Jz ICovCisKKyAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIG1jX2dseXBo X2xpc3QpLCBpZHgpOyArK2lkeDsKKyAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxf ZmxhZ3MsIGNyb3NzaGFpcnMpLCBpZHgpOyArK2lkeDsKKyAgWFNFVEZBU1RJTlQgKEJWQVIgKCZi dWZmZXJfbG9jYWxfZmxhZ3MsIGNyb3NzaGFpcnNfaG9yaXpvbnRhbF9ydWxlciksIGlkeCk7ICsr aWR4OworICBYU0VURkFTVElOVCAoQlZB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1 ZmZlcl9kZWZhdWx0cywgUXQpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KICAgYnNldF9t b2RlX2xpbmVfZm9ybWF0ICgmYnVmZmVyX2RlZmF1bHRzLCBidWlsZF9wdXJlX2Nfc3RyaW5nICgi JS0iKSk7CiAgIGJzZXRfaGVhZGVyX2xpbmVfZm9ybWF0ICgmYnVmZmVyX2RlZmF1bHRzLCBRbmls KTsKICAgYnNldF9hYmJyZXZfbW9kZSAoJmJ1ZmZlcl9kZWZhdWx0cywgUW5pbCk7CkBAIC01NDUz LDYgKzU0NzEsMTYgQEAgc3ltc19vZl9idWZmZXIgKHZvaWQpCiAgIHN0YXRpY3BybyAoJlFTRnVu ZGFtZW50YWwpOwogICBzdGF0aWNwcm8gKCZWYnVmZmVyX2FsaXN0KTsKIAorLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBtdWx0aXBsZSBjdXJzb3JzICovCisKKyAgREVGU1lNIChRbWNfZ2x5 cGhfbGlzdCwgIm1jLWdseXBoLWxpc3QiKTsKKyAgREVGU1lNIChRY3Jvc3NoYWlycywgImNyb3Nz aGFpcnMiKTsKKyAgREVGU1lNIChRY3Jvc3NoYWlyc19ob3Jpem9udGFsX3J1bGVyLCAiY3Jvc3No YWlycy1ob3Jpem9udGFsLXJ1bGVyIik7CisgIERFRlNZTSAoUWNyb3NzaGFpcnNfdmVydGljYWxf cnVsZXIsICJjcm9zc2hhaXJzLXZlcnRpY2FsLXJ1bGVyIik7CisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworCiAgIERFRlNZTSAoUWNob2ljZSwgImNob2ljZSIpOwogICBERUZTWU0gKFFsZWZ0 L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IGFjdGl2YXRlL2RlYWN0aXZhdGUgdGhlIGNyb3Nz aGFpcnMgaG9yaXpvbnRhbCBydWxlci4gICovKTsKKworICBERUZWQVJfUEVSX0JVRkZFUiAoImNy b3NzaGFpcnMtdmVydGljYWwtcnVsZXIiLCAmQlZBUiAoY3VycmVudF9idWZmZXIsIGNyb3NzaGFp cnNfdmVydGljYWxfcnVsZXIpLCBRbmlsLAorICAgIGRvYzogLyogQSBidWZlci1sb2NhbCB2YXJp YWJsZSB0byBhY3RpdmF0ZS9kZWFjdGl2YXRlIHRoZSBjcm9zc2hhaXJzIHZlcnRpY2FsIHJ1bGVy LiAgKi8pOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwogICBERUZWQVJfUEVSX0JVRkZF UiAoImhlYWRlci1saW5lLWZvcm1hdCIsCiAJCSAgICAgJkJWQVIgKGN1cnJlbnRfYnVmZmVyLCBo ZWFkZXJfbGluZV9mb3JtYXQpLAogCQkgICAgIFFuaWwsCmRpZmYgLS1naXQgYS9zcmMvYnVmZmVy LmggYi9zcmMvYnVmZmVyLmgKaW5kZXggZWNkMjM2MC4uMmFiNmQyZCAxMDA2NDQKLS0tIGEvc3Jj L2J1ZmZlci5oCisrKyBiL3NyYy9idWZmZXIuaApAQCAtNjU4LDYgKzY1OCwyMyBAQCBzdHJ1Y3Qg YnVmZmVyCiAgICAgIGNhY2hlIGFyZSBlbmFibGVkLiAgU2VlIHNlYXJjaC5jLCBpbmRlbnQuYyBh bmQgYmlkaS5jIGZvciBkZXRhaWxzLiAgKi8KICAgTGlzcF9PYmplY3QgY2FjaGVfbG9uZ19zY2Fu c187CiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogbXVsdGlwbGUgY3Vyc29ycyAqLwor CisgIC8qIFRoZSB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mUKICAgIGRlZmluZWQgYXMgc3RhdGlj IGluIHRob3NlIGZpbGVzLikgICovCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogbXVs dGlwbGUgY3Vyc29ycyAqLworCitJTkxJTkUgdm9pZAorYnNldF9ibHZfbWNfZ2x5cGhfbGlzdCAo c3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFsKQoreworICBiLT5tY19nbHlwaF9saXN0 XyA9IHZhbDsKK30KKworSU5MSU5FIHZvaWQKK2JzZXRfYmx2X2Nyb3NzaGFpcnMgKHN0cnVjdCBi dWZmZXIgKmIsIExpc3BfT2JqZWN0IHZhbCkKK3sKKyAgYi0+Y3Jvc3NoYWlyc18gPSB2YWw7Cit9 CisKK0lOTElORSB2b2lkCitic2V0X2Jsdl9jcm9zc2hhaXJzX2hvcml6b250YWxfcnVsZXIgKHN0 cnVjdCBidWZmZXIgKmIsIExpc3BfT2JqZWN0IHZhbCkKK3sKKyAgYi0+Y3Jvc3NoYWlyc19ob3Jp em9udGFsX3J1bGVyXyA9IHZhbDsKK30KKworSU5MSU5FIHZvaWQKK2JzZXRfYmx2X2Nyb3NzaGFp cnNfdmVydGljYWxfcnVsZXIgKHN0cnVjdCBidWZmZXIgKmIsIExpc3BfT2JqZWN0IHZhbCkKK3sK KyAgYi0+Y3Jvc3NoYWlyc192ZXJ0aWNhbF9ydWxlcl8gPSB2YWw7Cit9CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCiBJTkxJTkUgdm9pZAogYnNldF9iaWRpX3BhcmFncmFwaF9kaXJlY3Rp b24gKHN0cnVjdCBidWZmZXIgKmIsIExpc3BfT2JqZWN0IHZhbCkKIHsKZGlmZiAtLWdpdCBhL3Ny Yy9kaXNwZXh0ZXJuLmggYi9zcmMvZGlzcGV4dGVybi5oCmluZGV4IDQzMGFmYmYuLmYxZDU0MTUg MTAwNjQ0Ci0tLSBhL3NyYy9kaXNwZXh0ZXJuLmgKKysrIGIvc3JjL2Rpc3BleHRlcm4uaApAQCAt Mjg4OSw3ICsyODg5LDEzIEBAIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlCiAJCQkgICAgICBz dHJ1Y3QgZ2x5cGhfcm93ICpnbHlwaF9yb3csCiAJCQkgICAgICBpbnQgeCwgaW50IHksCiAJCQkg ICAgICBlbnVtIHRleHRfY3Vyc29yX2tpbmRzIGN1cnNvcl90eXBlLAotCQkJICAgICAgaW50IGN1 cnNvcl93aWR0aCwgYm9vbCBvbl9wLCBib29sIGFjdGl2ZV9wKTsKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogbXVsdGlwbGUgY3Vyc29ycyAqLworCisgICAgICAgICBpbnQgY3Vyc29yX3dp ZHRoLCBib29sIG9uX3AsIGJvb2wgYWN0aXZlX3AsCisgICAgICAgICBMaXNwX09iamVjdCBjb2xv cl92ZWN0b3IsIExpc3BfT2JqZWN0IGZsYXZvcik7CisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LwogCiAgIC8qIERyYXcgdmVydGljYWwgYm9yZGVyIGZvciB3aW5kb3cgVyBmcm9tIChYLFlfMCkg dG8gKFgsWV8xKS4gICovCiAgIHZvaWQgKCpkcmF3X3ZlcnRpY2FsX3dpbmRvd19ib3JkZXIpIChz dHJ1Y3Qgd2luZG93ICp3LApAQCAtMzI3NCw2ICszMjgwLDEzIEBAIGV4dGVybiB2b2lkIGdldF9m b250X2FzY2VudF9kZXNjZW50IChzdHJ1Y3QgZm9udCAqLCBpbnQgKiwgaW50ICopOwogCiAjaWZk ZWYgSEFWRV9XSU5ET1dfU1lTVEVNCiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogbXVs dGlwbGUgY3Vyc29ycyAqLworCit2b2lkIG1jX3BvcnRhbCAoc3RydWN0IHdpbmRvdyAqLCBib29s KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKICNpZmRlZiBHTFlQSF9ERUJVRwogZXh0 ZXJuIHZvaWQgZHVtcF9nbHlwaF9zdHJpbmcgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKikgRVhURVJO QUxMWV9WSVNJQkxFOwogI2VuZGlmCmRpZmYgLS1naXQgYS9zcmMvZnJpbmdlLmMgYi9zcmMvZnJp bmdlLmMKaW5kZXggMDg3ZWYzMy4uMWI1ZDg3YiAxMDA2NDQKLS0tIGEvc3JjL2ZyaW5nZS5jCisr KyBiL3NyYy9mcmluZ2UuYwpAQCAtNDMxLDYgKzQzMSwyMjQgQEAgc3RhdGljIHVuc2lnbmVkIHNo b3J0IGVtcHR5X2xpbmVfYml0c1tdID0gewogICAweDAwLCAweDNjLCAweDAwLCAweDAwLCAweDNj LCAweDAwLCAweDAwLCAweDNjLCAweDAwLAogICAweDAwLCAweDNjLCAweDAwLCAweDAwLCAweDNj LCAweDAwLCAweDAwLCAweDNjLCAweDAwfTsKIAorLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisv KiBtdWx0aXBsZSBjdXJzb3JzCisKKy8qICA7OyBBVVRIT1I6ICBOaWtvbGFqIFNjaHVtYWNoZXIg LS0gaHR0cHM6Ly9naXRodWIuY29tL25zY2h1bS9mcmluZ2UtaGVscGVyLmVsCisgICAgKGRlZnVu ICstZnJpbmdlLWhlbHBlci1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nVtIDIpIChpZiAoZXEg YyA/LikgMCAxKSkpKQorICAgICAgICAgICAgICAoZm9ybWF0ICIlIy14IiBudW0pKSkKKyAgICAg ICAgICBzdHJpbmdzKSkpCisqLworCisvKiAyNAorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRl Y2ltYWwKKyAgICAgICJ4Li4uLi4uLiIKKyAgICAgICJ4Li4uLi4uLiIKKyAgICAgICJ4Li4uLi4u LiIKKyAgICAgICJ4Li54eC4uLiIKKyAgICAgICJ4Li4ueHguLiIKKyAgICAgICJ4Li4uLnh4LiIK KyAgICAgICJ4Lnh4eHh4eCIKKyAgICAgICJ4Lnh4eHh4eCIKKyAgICAgICJ4Li4uLnh4LiIKKyAg ICAgICJ4Li4ueHguLiIKKyAgICAgICJ4Li54eC4uLiIKKyAgICAgICJ4Li4uLi4uLiIKKyAgICAg ICJ4Li4uLi4uLiIKKyAgICAgICJ4Li4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0 IG1jX3ZlcnRpY2FsX2Jhcl9yaWdodF9hbmdsZV9iaXRzW10gPXsKKyAgMHg4MCwgMHg4MCwgMHg4 MCwgMHg5OCwgMHg4YywgMHg4NiwgMHhiZiwKKyAgMHhiZiwgMHg4NiwgMHg4YywgMHg5OCwgMHg4 MCwgMHg4MCwgMHg4MH07CisKKy8qIDI1CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1h bAorICAgICAgInh4eHh4eHh4IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54Igor ICAgICAgInguLnh4Li54IgorICAgICAgInguLi54eC54IgorICAgICAgInguLi4ueHh4IgorICAg ICAgIngueHh4eHh4IgorICAgICAgIngueHh4eHh4IgorICAgICAgInguLi4ueHh4IgorICAgICAg InguLi54eC54IgorICAgICAgInguLnh4Li54IgorICAgICAgInguLi4uLi54IgorICAgICAgIngu Li4uLi54IgorICAgICAgInh4eHh4eHh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNf aG9sbG93X3JlY3RhbmdsZV9yaWdodF9hbmdsZV9iaXRzW10gPXsKKyAgMHhmZiwgMHg4MSwgMHg4 MSwgMHg5OSwgMHg4ZCwgMHg4NywgMHhiZiwKKyAgMHhiZiwgMHg4NywgMHg4ZCwgMHg5OSwgMHg4 MSwgMHg4MSwgMHhmZn07CisKKy8qIDI2CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1h bAorICAgICAgInh4eHh4eHh4IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54Igor ICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAg ICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAg InguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgIngu Li4uLi54IgorICAgICAgInh4eHh4eHh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNf aG9sbG93X3JlY3RhbmdsZV9iaXRzW10gPXsKKyAgMHhmZiwgMHg4MSwgMHg4MSwgMHg4MSwgMHg4 MSwgMHg4MSwgMHg4MSwKKyAgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwgMHhm Zn07CisKKy8qIDI3CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIngu Li4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4u Li4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4u IgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgor ICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAg ICAgInguLi4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdmVydGljYWxfYmFy X2JpdHNbXSA9eworICAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwLAor ICAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwfTsKKworLyogMjgKKyAg ICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHguLi4uLi4iCisgICAgICAi Lnh4Li4uLi4iCisgICAgICAiLi54eC4uLi4iCisgICAgICAiLi4ueHguLi4iCisgICAgICAiLi4u Lnh4Li4iCisgICAgICAiLi4uLi54eC4iCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi54 eC4iCisgICAgICAiLi4uLnh4Li4iCisgICAgICAiLi4ueHguLi4iCisgICAgICAiLi54eC4uLi4i CisgICAgICAiLnh4Li4uLi4iCisgICAgICAieHguLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25l ZCBzaG9ydCBtY19yaWdodF9hbmdsZV9iaXRzW10gPXsKKyAgMHhjMCwgMHg2MCwgMHgzMCwgMHgx OCwgMHhjLCAweDYsIDB4MywgMHg2LCAweGMsIDB4MTgsIDB4MzAsIDB4NjAsIDB4YzB9OworCisv KiAyOQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICJ4eC4uLi4uLiIK KyAgICAgICJ4eC4uLi4uLiIKKyAgICAgICIgeHguLi4uLiIKKyAgICAgICIueHguLi4uLiIKKyAg ICAgICIuLnh4Li4uLiIKKyAgICAgICIuLnh4Li4uLiIKKyAgICAgICIuLi54eC4uLiIKKyAgICAg ICIuLi54eC4uLiIKKyAgICAgICIuLi4ueHguLiIKKyAgICAgICIuLi4ueHguLiIKKyAgICAgICIu Li4uLnh4LiIKKyAgICAgICIuLi4uLnh4LiIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4u Li54eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX2JhY2tzbGFzaF9iaXRzW10gPXsK KyAgMHhjMCwgMHhjMCwgMHhlMCwgMHg2MCwgMHgzMCwgMHgzMCwgMHgxOCwgMHgxOCwgMHhjLCAw eGMsIDB4NiwgMHg2LCAweDMsIDB4M307CisKKy8qIDMwCisgICAgKCstZnJpbmdlLWhlbHBlci1o ZXhhZGVjaW1hbAorICAgICAgInh4Li4uLi4uIgorICAgICAgInh4Li4uLi4uIgorICAgICAgInh4 eC4uLi4uIgorICAgICAgInh4eC4uLi4uIgorICAgICAgIngueHguLi4uIgorICAgICAgIngueHgu Li4uIgorICAgICAgInguLnh4Li4uIgorICAgICAgInguLnh4Li4uIgorICAgICAgInguLi54eC4u IgorICAgICAgInguLi54eC4uIgorICAgICAgInguLi4ueHguIgorICAgICAgInguLi4ueHguIgor ICAgICAgInguLi4uLnh4IgorICAgICAgInguLi4uLnh4IikKKyovCitzdGF0aWMgdW5zaWduZWQg c2hvcnQgbWNfdmVydGljYWxfYmFyX2JhY2tzbGFzaF9iaXRzW10gPXsKKyAgMHhjMCwgMHhjMCwg MHhlMCwgMHhlMCwgMHhiMCwgMHhiMCwgMHg5OCwKKyAgMHg5OCwgMHg4YywgMHg4YywgMHg4Niwg MHg4NiwgMHg4MywgMHg4M307CisKKy8qIDMxCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVj aW1hbAorICAgICAgIi54eHh4eHguIgorICAgICAgInh4eHgueC4uIgorICAgICAgInh4eHgueC4u IgorICAgICAgInh4eHgueC4uIgorICAgICAgIi54eHgueC4uIgorICAgICAgIi4uLngueC4uIgor ICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAg ICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hv cnQgbWNfcGlsY3Jvd19iaXRzW10gPXsKKyAgMHg3ZSwgMHhmNCwgMHhmNCwgMHhmNCwgMHg3NCwg MHgxNCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNH07CisKKy8qIDMyCisgICAgKCstZnJp bmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Lnh4Li4uIgorICAgICAgIi54eC54eC4u IgorICAgICAgIi4ueHgueHguIgorICAgICAgIi4uLnh4Lnh4IgorICAgICAgIi4ueHgueHguIgor ICAgICAgIi54eC54eC4uIgorICAgICAgInh4Lnh4Li4uIikKKyovCitzdGF0aWMgdW5zaWduZWQg c2hvcnQgbWNfcmlnaHRfZG91YmxlX2FuZ2xlX2JpdHNbXSA9eworICAweGQ4LCAweDZjLCAweDM2 LCAweDFiLCAweDM2LCAweDZjLCAweGQ4fTsKKworLyogMzMKKyAgICAoKy1mcmluZ2UtaGVscGVy LWhleGFkZWNpbWFsCisgICAgICAiLi54eHh4Li4iCisgICAgICAiLnh4eHh4eC4iCisgICAgICAi eC4ueHguLngiCisgICAgICAieC4ueHguLngiCisgICAgICAieHh4eHh4eHgiCisgICAgICAieHgu Li4ueHgiCisgICAgICAieHh4Li54eHgiCisgICAgICAiLnh4eHh4eC4iCisgICAgICAiLi54eHh4 Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zbWlsZXlfZmFjZV9iaXRzW10gPXsK KyAgMHgzYywgMHg3ZSwgMHg5OSwgMHg5OSwgMHhmZiwgMHhjMywgMHhlNywgMHg3ZSwgMHgzY307 CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLwogCiAjZGVmaW5lIEJZVEVTX1BFUl9CSVRNQVBf Uk9XICAoc2l6ZW9mICh1bnNpZ25lZCBzaG9ydCkpCiAjZGVmaW5lIFNUQU5EQVJEX0JJVE1BUF9I RUlHSFQoYml0cykgKHNpemVvZiAoYml0cykvQllURVNfUEVSX0JJVE1BUF9ST1cpCkBAIC00NjUs NiArNjgzLDMxI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mxlLWFuZ2xlICdmcmluZ2UpID0+IDMyICovCisKKyAgLyogMzMgKi8KKyAgREVGU1lNIChR bWNfc21pbGV5X2ZhY2UsICIrLXNtaWxleS1mYWNlIik7CisgIFZmcmluZ2VfYml0bWFwcyA9IEZj b25zIChRbWNfc21pbGV5X2ZhY2UsIFZmcmluZ2VfYml0bWFwcyk7CisgIEZwdXQgKFFtY19zbWls ZXlfZmFjZSwgUWZyaW5nZSwgbWFrZV9udW1iZXIgKDMzKSk7CisgIC8qIChnZXQgJystc21pbGV5 LWZhY2UgJ2ZyaW5nZSkgPT4gMzMgKi8KKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKIH0K IAogLyogR2FyYmFnZSBjb2xsZWN0aW9uIGhvb2sgKi8KZGlmZiAtLWdpdCBhL3NyYy9rZXlib2Fy ZC5jIGIvc3JjL2tleWJvYXJkLmMKaW5kZXggNTc3NTdjZi4uMGI1NDQzMyAxMDA2NDQKLS0tIGEv c3JjL2tleWJvYXJkLmMKKysrIGIvc3JjL2tleWJvYXJkLmMKQEAgLTEyNTQsNiArMTI1NCwyNyBA QCBzdGF0aWMgaW50IHJlYWRfa2V5X3NlcXVlbmNlIChMaXNwX09iamVjdCAqLCBpbnQsIExpc3Bf T2JqZWN0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCwgYm9vbCwgYm9vbCwg Ym9vbCk7CiBzdGF0aWMgdm9pZCBhZGp1c3RfcG9pbnRfZm9yX3Byb3BlcnR5IChwdHJkaWZmX3Qs IGJvb2wpOwogCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIG11bHRpcGxlIGN1cnNvcnMg Ki8KKworc3RhdGljIHZvaWQKK2tiZF9tY19hY3RpdmF0ZV9jdXJzb3JzICh2b2lkKQoreworICBz dHJ1Y3Qgd2luZG93ICp3ID0gZGVjb2RlX2xpdmVfd2luZG93IChzZWxlY3RlZF93aW5kb3cpOwor ICB3LT5tYy5kcmF3X2dseXBoX2N1cnNvciA9IHRydWU7CisgIHctPm1jLmVyYXNlX2dseXBoX2N1 cnNvciA9IHRydWU7Cit9CisKK3N0YXRpYyB2b2lkCitrYmRfbWNfYWN0aXZhdGVfY3Jvc3NoYWly cyAodm9pZCkKK3sKKyAgc3RydWN0IHdpbmRvdyAqdyA9IGRlY29kZV9saXZlX3dpbmRvdyAoc2Vs ZWN0ZWRfd2luZG93KTsKKyAgdy0+bWMuZHJhd19jcm9zc2hhaXJzID0gdHJ1ZTsKKyAgdy0+bWMu ZXJhc2VfY3Jvc3NoYWlycyA9IHRydWU7Cit9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor CiBMaXNwX09iamVjdAogY29tbWFuZF9sb29wXzEgKHZvaWQpCiB7CkBAIC0xNDUwLDYgKzE0NzEs MTMgQEAgY29tbWFuZF9sb29wXzEgKHZvaWQpCiAgICAgICBWcmVhbF90aGlzX2NvbW1hbmQgPSBj bWQ7CiAgICAgICBzYWZlX3J1bl9ob29rcyAoUXByZV9jb21tYW5kX2hvb2spOwogCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKy8qIG11bHRpcGxlIGN1cnNvcnMgKi8KKworICAgICAga2JkX21j X2FjdGl2YXRlX2N1cnNvcnMgKCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCiAgICAg ICBhbHJlYWR5X2FkanVzdGVkID0gMDsKIAogICAgICAgaWYgKE5JTFAgKFZ0aGlzX2NvbW1hbmQp KQpkaWZmIC0tZ2l0IGEvc3JjL25zdGVybS5tIGIvc3JjL25zdGVybS5tCmluZGV4IDUwZTA2Yzku Ljk2NzkzNjIgMTAwNjQ0Ci0tLSBhL3NyYy9uc3Rlcm0ubQorKysgYi9zcmMvbnN0ZXJtLm0KQEAg LTExMzQsMTAgKzExMzQsMTIgQEAgc3RhdGljIE5TUmVjdCBjb25zdHJhaW5fZnJhbWVfcmVjdChO U1JlY3QgZnJhbWVSZWN0LCBib29sIGlzRnVsbHNjcmVlbikKICAgICB7CiAgICAgICBibG9ja19p bnB1dCAoKTsKIAotICAgICAgaWYgKGN1cnNvcl9vbl9wKQotCWRpc3BsYXlfYW5kX3NldF9jdXJz b3IgKHcsIDEsCi0JCQkJdy0+b3V0cHV0X2N1cnNvci5ocG9zLCB3LT5vdXRwdXRfY3Vyc29yLnZw b3MsCi0JCQkJdy0+b3V0cHV0X2N1cnNvci54LCB3LT5vdXRwdXRfY3Vyc29yLnkpOworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBtdWx0aXBsZSBjdXJzb3JzICovCisKKyAgICAgIG1jX3Bv cnRhbCAodywgY3Vyc29yX29uX3ApOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KIAogICAg ICAgaWYgKGRyYXdfd2luZG93X2ZyaW5nZXMgKHcsIDEpKQogCXsKQEAgLTMwMDUsNyArMzAwNywx MyBAQCBzbyBzb21lIGtleSBwcmVzc2VzIChUQUIpIGFyZSBzd2FsbG93ZWQgYnkgdGhlIHN5c3Rl bS4gKi8KIHN0YXRpYyB2b2lkCiBuc19kcmF3X3dpbmRvd19jdXJzb3IgKHN0cnVjdCB3aW5kb3cg KncsIHN0cnVjdCBnbHlwaF9yb3cgKmdseXBoX3JvdywKIAkJICAgICAgIGludCB4LCBpbnQgeSwg ZW51bSB0ZXh0X2N1cnNvcl9raW5kcyBjdXJzb3JfdHlwZSwKLQkJICAgICAgIGludCBjdXJzb3Jf d2lkdGgsIGJvb2wgb25fcCwgYm9vbCBhY3RpdmVfcCkKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogbXVsdGlwbGUgY3Vyc29ycyAqLworCisgIGludCBjdXJzb3Jfd2lkdGgsIGJvb2wgb25f cCwgYm9vbCBhY3RpdmVfcCwKKyAgTGlzcF9PYmplY3QgY29sb3JfdmVjdG9yLCBMaXNwX09iamVj dCBmbGF2b3IpCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwogLyogLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0KICAgICAgRXh0ZXJuYWwgY2FsbCAoUklGKTogZHJhdyBjdXJzb3IuCiAgICAgIE5vdGUgdGhh dCBDVVJTT1JfV0lEVEggaXMgbWVhbmluZ2Z1bCBvbmx5IGZvciAoaCliYXIgY3Vyc29ycy4KQEAg LTMwMzksOCArMzA0NywyOSBAQCBOb3RlIHRoYXQgQ1VSU09SX1dJRFRIIGlzIG1lYW5pbmdmdWwg b25seSBmb3IgKGgpYmFyIGN1cnNvcnMuCiAKICAgaWYgKChwaHlzX2N1cnNvcl9nbHlwaCA9IGdl dF9waHlzX2N1cnNvcl9nbHlwaCAodykpID09IE5VTEwpCiAgICAgewotICAgICAgaWYgKGdseXBo X3Jvdy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVfcAotICAgICAgICAgICYmIHctPnBoeXNfY3Vy c29yLmhwb3MgPj0gZ2x5cGhfcm93LT51c2VkW1RFWFRfQVJFQV0pC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IHctPnBoeXNfY3Vyc29yLnggKyBmcmFtZV9jaGFyX3dpZHRoID49 IHRleHRfYXJlYV93aWR0aDsKKyAgICAgIGlmICgoZ2x5cGhfcm93LT5leGFjdF93aW5kb3dfd2lk dGhfbGluZV9wCisgICAgICAgICAgICAmJiB3LT5waHlzX2N1cnNvci5ocG9zID49IGdseXBoX3Jv dy0+dXNlZFtURVhUX0FSRUFdKQorICAgICAgICAgIHx8IGN1cnNvcl9pbl9mcmluZ2VfcCkKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgICB7CiAgICAgICAgICAgZ2x5cGhf cm93LT5jdXJzb3JfaW5fZnJpbmdlX3AgPSAxOwogICAgICAgICAgIGRyYXdfZnJpbmdlX2JpdG1h cCAodywgZ2x5cGhfcm93LCAwKTsKQEAgLTMwODUsOCArMzExNCw0NyBAQCBOb3RlIHRoYXQgQ1VS U09SX1dJRFRIIGlzIG1lYW5pbmdmdWwgb25seSBmb3IgKGgpYmFyIGN1cnNvcnMuCiAKIAogICBm YWNlID0gRkFDRV9GUk9NX0lEX09SX05VTEwgKGYsIHBoeXNfY3Vyc29yX2dseXBoLT5mYWNlX2lk KTsKLSAgaWYgKGZhY2UgJiYgTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKQotICAgICAgPT0gbnNf aW5kZXhfY29sb3IgKEZSQU1FX0NVUlNPUl9DT0xPUiAoZiksIGYpKQorCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogbXVsdGlwbGUgY3Vyc29ycyAqLworCisvKiBFWEFNUExFIE9GIEhP VyBUTyBMT09LLVVQIEEgQ09MT1I6CisgIGVudW0gZmFjZV9pZCBmYWNlX2lkID0gbG9va3VwX25h bWVkX2ZhY2UgKGYsIGludGVybiAoIistdmVyd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ioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwog ICAgIHsKICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5E IChmYWNlKSwgZikgc2V0XTsKICAgICAgIGhvbGxvd19jb2xvciA9IEZSQU1FX0NVUlNPUl9DT0xP UiAoZik7CkBAIC0zMTMzLDkgKzMyMDEsMTYgQEAgTm90ZSB0aGF0IENVUlNPUl9XSURUSCBpcyBt ZWFuaW5nZnVsIG9ubHkgZm9yIChoKWJhciBjdXJzb3JzLgogICAgIH0KICAgbnNfdW5mb2N1cyAo Zik7CiAKLSAgLyogZHJhdyB0aGUgY2hhcmFjdGVyIHVuZGVyIHRoZSBjdXJzb3IgKi8KLSAgaWYg KGN1cnNvcl90eXBlICE9IE5PX0NVUlNPUikKLSAgICBkcmF3X3BoeXNfY3Vyc29yX2dseXBoICh3 LCBnbHlwaF9yb3csIERSQVdfQ1VSU09SKTsKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyog bXVsdGlwbGUgY3Vyc29ycyAqLworCisgICAvKiBkcmF3IHRoZSBjaGFyYWN0ZXIgdW5kZXIgdGhl IGN1cnNvciAqLworICBpZiAoY3Vyc29yX3R5cGUgIT0gTk9fQ1VSU09SCisgICAgICAmJiAhRVEg KGZsYXZvciwgUW1jX2dseXBobGVzcykKKyAgICAgICYmICFFUSAoZmxhdm9yLCBRbWNfZ2x5cGhf dGFiKSkKKyAgICAgZHJhd19waHlzX2N1cnNvcl9nbHlwaCAodywgZ2x5cGhfcm93LCBEUkFXX0NV UlNPUik7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwogCiAjaWZkZWYgTlNfSU1QTF9DT0NP QQogICBOU0VuYWJsZVNjcmVlblVwZGF0ZXMgKCk7CmRpZmYgLS1naXQgYS9zcmMvdzMydGVybS5j IGIvc3JjL3czMnRlcm0uYwppbmRleCA3YzJkODZiLi5iMDc5MTM1IDEwMDY0NAotLS0gYS9zcmMv dzMydGVybS5jCisrKyBiL3NyYy93MzJ0ZXJtLmMKQEAgLTcwNSwxMCArNzA1LDEyIEBAIHhfdXBk YXRlX3dpbmRvd19lbmQgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgY3Vyc29yX29uX3AsCiAgICAg ewogICAgICAgYmxvY2tfaW5wdXQgKCk7CiAKLSAgICAgIGlmIChjdXJzb3Jfb25fcCkKLQlkaXNw bGF5X2FuZF9zZXRfY3Vyc29yICh3LCB0cnVlLAotCQkJCXctPm91dHB1dF9jdXJzb3IuaHBvcywg dy0+b3V0cHV0X2N1cnNvci52cG9zLAotCQkJCXctPm91dHB1dF9jdXJzb3IueCwgdy0+b3V0cHV0 X2N1cnNvci55KTsKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogbXVsdGlwbGUgY3Vyc29y cyAqLworCisgICAgICBtY19wb3J0YWwgKHcsIGN1cnNvcl9vbl9wKTsKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCiAKICAgICAgIGlmIChkcmF3X3dpbmRvd19mcmluZ2VzICh3LCB0cnVlKSkK IAl7CkBAIC05NzMsNyArOTc1LDExIEBAIHN0YXRpYyB2b2lkIHczMl9kcmF3X2JveF9yZWN0IChz dHJ1Y3QgZ2x5cGhfc3RyaW5nICosIGludCwgaW50LCBpbnQsIGludCwKIHN0YXRpYyB2b2lkCiB4 X3NldF9jdXJzb3JfZ2MgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMpCiB7Ci0gIGlmIChzLT5mb250 ID09IEZSQU1FX0ZPTlQgKHMtPmYpCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIG11bHRp cGxlIGN1cnNvcnMgKi8KKworICBzdHJ1Y3Qgd2luZG93ICp3ID0gZGVjb2RlX2xpdmVfd2luZG93 IChzZWxlY3RlZF93aW5kb3cpOworICBpZiAoKHMtPmZvbnQgPT0gRlJBTUVfRk9OVCAocy0+ZikK ICAgICAgICYmIHMtPmZhY2UtPmJhY2tncm91bmQgPT0gRlJBTUVfQkFDS0dST1VORF9QSVhFTCAo cy0+ZikKICAgICAgICYmIHMtPmZhY2UtPmZvcmVncm91bmQgPT0gRlJBTUVfRk9SRUdST1VORF9Q SVhFTCAocy0+ZikKICAgICAgIC8qIFNvbWV0aW1lcyB3ZSBhcmUgbm90IGNhbGxlZCBmb3IgZWFj aCBjaGFuZ2UgaW4gdGhlIGRlZmF1bHQKQEAgLTk4MSw2ICs5ODcsOSBAQCB4X3NldF9jdXJzb3Jf Z2MgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMpCiAJIHRlc3QgaW4gdGhlIG5leHQgbGluZSBnaXZl cyB1cyBhIGNoYW5jZSB0byByZXN5bmMuICAqLwogICAgICAgJiYgcy0+Zi0+b3V0cHV0X2RhdGEu dzMyLT5jdXJzb3JfZ2MtPmZvcmVncm91bmQgPT0gcy0+ZmFjZS0+YmFja2dyb3VuZAogICAgICAg JiYgIXMtPmNtcCkKKyAgICAgIHx8IHctPm1jLmN1cnNvcl9nY19kZWZhdWx0KQorCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KICAgICBzLT5nYyA9IHMtPmYtPm91dHB1dF9kYXRhLnczMi0+Y3Vy c29yX2djOwogICBlbHNlCiAgICAgewpAQCAtNTc0Niw3ICs1NzU1LDEzIEBAIHhfZHJhd19iYXJf Y3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCiAJIGludmlz aWJsZS4gIFVzZSB0aGUgZ2x5cGgncyBmb3JlZ3JvdW5kIGNvbG9yIGluc3RlYWQgaW4gdGhpcwog CSBjYXNlLCBvbiB0aGUgYXNzdW1wdGlvbiB0aGF0IHRoZSBnbHlwaCdzIGNvbG9ycyBhcmUgY2hv c2VuIHNvCiAJIHRoYXQgdGhlIGdseXBoIGlzIGxlZ2libGUuICAqLwotICAgICAgaWYgKGZhY2Ut PmJhY2tncm91bmQgPT0gY3Vyc29yX2NvbG9yKQorLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisv KiBtdWx0aXBsZSBjdXJzb3JzICovCisKKyAgICAgIGlmIChmYWNlLT5iYWNrZ3JvdW5kID09IGN1 cnNvcl9jb2xvcgorICAgICAgICAgICYmICF3LT5tYy5jdXJzb3JfZ2NfaW52aXNpYmxlX29rYXkp CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLwogCWN1cnNvcl9jb2xvciA9IGZhY2UtPmZvcmVn cm91bmQ7CiAKICAgICAgIHggPSBXSU5ET1dfVEVYVF9UT19GUkFNRV9QSVhFTF9YICh3LCB3LT5w aHlzX2N1cnNvci54KTsKQEAgLTU4MjMsNyArNTgzOCwxMyBAQCB3MzJfY2xlYXJfZnJhbWVfYXJl YSAoc3RydWN0IGZyYW1lICpmLCBpbnQgeCwgaW50IHksIGludCB3aWR0aCwgaW50IGhlaWdodCkK IHN0YXRpYyB2b2lkCiB3MzJfZHJhd193aW5kb3dfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBz dHJ1Y3QgZ2x5cGhfcm93ICpnbHlwaF9yb3csCiAJCQlpbnQgeCwgaW50IHksIGVudW0gdGV4dF9j dXJzb3Jfa2luZHMgY3Vyc29yX3R5cGUsCi0JCQlpbnQgY3Vyc29yX3dpZHRoLCBib29sIG9uX3As IGJvb2wgYWN0aXZlX3ApCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIG11bHRpcGxlIGN1 cnNvcnMgKi8KKworICBpbnQgY3Vyc29yX3dpZHRoLCBib29sIG9uX3AsIGJvb2wgYWN0aXZlX3As CisgIExpc3BfT2JqZWN0IGNvbG9yX3ZlY3RvciwgTGlzcF9PYmplY3QgZmxhdm9yKQorCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KIHsKICAgaWYgKG9uX3ApCiAgICAgewpAQCAtNTg4OCwzMSAr NTkwOSwxMTggQEAgdzMyX2RyYXdfd2luZG93X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3Ry dWN0IGdseXBoX3JvdyAqZ2x5cGhfcm93LAogCSAgcmV0dXJuOwogCX0KIAotICAgICAgc3dpdGNo IChjdXJzb3JfdHlwZSkKLQl7Ci0JY2FzZSBIT0xMT1dfQk9YX0NVUlNPUjoKLQkgIHhfZHJhd19o b2xsb3dfY3Vyc29yICh3LCBnbHlwaF9yb3cpOwotCSAgYnJlYWs7Ci0KLQljYXNlIEZJTExFRF9C T1hfQ1VSU09SOgotCSAgZHJhd19waHlzX2N1cnNvcl9nbHlwaCAodywgZ2x5cGhfcm93LCBEUkFX X0NVUlNPUik7Ci0JICBicmVhazsKLQotCWNhc2UgQkFSX0NVUlNPUjoKLQkgIHhfZHJhd19iYXJf Y3Vyc29yICh3LCBnbHlwaF9yb3csIGN1cnNvcl93aWR0aCwgQkFSX0NVUlNPUik7Ci0JICBicmVh azsKLQotCWNhc2UgSEJBUl9DVVJTT1I6Ci0JICB4X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cGhf cm93LCBjdXJzb3Jfd2lkdGgsIEhCQVJfQ1VSU09SKTsKLQkgIGJyZWFrOwotCi0JY2FzZSBOT19D VVJTT1I6Ci0JICB3LT5waHlzX2N1cnNvcl93aWR0aCA9IDA7Ci0JICBicmVhazsKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogQkVHSU4gbXVsdGlwbGUgY3Vyc29ycyAqLworICBkb3VibGUg cmVkID0gWEZMT0FUX0RBVEEgKEFSRUYgKGNvbG9yX3ZlY3RvciwgMCkpOworICBkb3VibGUgZ3Jl ZW4gPSBYRkxPQVRfREFUQSAoQVJFRiAoY29sb3JfdmVjdG9yLCAxKSk7CisgIGRvdWJsZSBibHVl ID0gWEZMT0FUX0RBVEEgKEFSRUYgKGNvbG9yX3ZlY3RvciwgMikpOworICBzd2l0Y2ggKGN1cnNv cl90eXBlKQorICB7CisgICAgY2FzZSBIT0xMT1dfQk9YX0NVUlNPUjoKKyAgICB7CisgICAgICBp ZiAocmVkID49IDAgJiYgYmx1ZSA+PSAwICYmIGdyZWVuID49IDApCisgICAgICAgIC8qIFRlbXBv cmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAg ICAgICAgeworICAgICAgICAgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAoV0lORE9XX0ZSQU1F ICh3KSk7CisgICAgICAgICAgQ09MT1JSRUYgb3JpZ192YWwgPSBmLT5vdXRwdXRfZGF0YS53MzIt PmN1cnNvcl9waXhlbDsKKyAgICAgICAgICBpbnQgaW50X3JlZCA9IHJlZCAqIDI1NTsKKyAgICAg ICAgICBpbnQgaW50X2dyZWVuID0gZ3JlZW4gKiAyNTU7CisgICAgICAgICAgaW50IGludF9ibHVl ID0gYmx1ZSAqIDI1NTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhl bCA9IFBBTEVUVEVSR0IgKGludF9yZWQsIGludF9ncmVlbiwgaW50X2JsdWUpOworICAgICAgICAg IHhfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBnbHlwaF9yb3cpOworICAgICAgICAgIGYtPm91dHB1 dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ192YWw7CisgICAgICAgIH0KKyAgICAgICAg ZWxzZQorICAgICAgICAgIHhfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBnbHlwaF9yb3cpOworICAg ICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgRklMTEVEX0JPWF9DVVJTT1I6CisgICAgeworICAg ICAgaWYgKHJlZCA+PSAwICYmIGJsdWUgPj0gMCAmJiBncmVlbiA+PSAwKQorICAgICAgICAvKiBU ZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djJyBieSBib3Jy b3dpbmcgdGhlCisgICAgICAgIGZ1bmN0aW9uYWxpdHkgb2YgYHhfbWFrZV9nYycgaW4gdzMyZm5z LmMuICAqLworICAgICAgICB7CisgICAgICAgICAgYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAg TGlzcF9PYmplY3Qgd2luZG93ID0gKHNlbGVjdGVkX3dpbmRvdyk7CisgICAgICAgICAgc3RydWN0 IHdpbmRvdyAqdyA9IGRlY29kZV9saXZlX3dpbmRvdyAod2luZG93KTsKKyAgICAgICAgICBzdHJ1 Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworICAgICAgICAgIGludCBp bnRfcmVkID0gcmVkICogMjU1OworICAgICAgICAgIGludCBpbnRfZ3JlZW4gPSBncmVlbiAqIDI1 NTsKKyAgICAgICAgICBpbnQgaW50X2JsdWUgPSBibHVlICogMjU1OworICAgICAgICAgIFhHQ1Zh bHVlcyBnY192YWx1ZXM7CisgICAgICAg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gICAgICBnY192 YWx1ZXMuZm9yZWdyb3VuZCA9IG9yaWdfdmFsX2E7CisgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tn cm91bmQgPSBvcmlnX3ZhbF9iOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29y X2djCisgICAgICAgICAgICA9IFhDcmVhdGVHQyAoTlVMTCwgRlJBTUVfVzMyX1dJTkRPVyAoZiks IG1hc2ssICZnY192YWx1ZXMpOworICAgICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAg IH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIGRyYXdfcGh5c19jdXJzb3JfZ2x5cGggKHcsIGds eXBoX3JvdywgRFJBV19DVVJTT1IpOworICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgQkFS X0NVUlNPUjoKKyAgICB7CisgICAgICBpZiAocmVkID49IDAgJiYgYmx1ZSA+PSAwICYmIGdyZWVu ID49IDApCisgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMy LT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBmcmFtZSAq ZiA9IFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7CisgICAgICAgICAgQ09MT1JSRUYgb3JpZ192 YWwgPSBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbDsKKyAgICAgICAgICBpbnQgaW50 X3JlZCA9IHJlZCAqIDI1NTsKKyAgICAgICAgICBpbnQgaW50X2dyZWVuID0gZ3JlZW4gKiAyNTU7 CisgICAgICAgICAgaW50IGludF9ibHVlID0gYmx1ZSAqIDI1NTsKKyAgICAgICAgICBmLT5vdXRw dXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IFBBTEVUVEVSR0IgKGludF9yZWQsIGludF9ncmVl biwgaW50X2JsdWUpOworICAgICAgICAgIHctPm1jLmN1cnNvcl9nY19pbnZpc2libGVfb2theSA9 IHRydWU7CisgICAgICAgICAgeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIGdseXBoX3JvdywgY3Vyc29y X3dpZHRoLCBCQVJfQ1VSU09SKTsKKyAgICAgICAgICB3LT5tYy5jdXJzb3JfZ2NfaW52aXNpYmxl X29rYXkgPSBmYWxzZTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhl bCA9IG9yaWdfdmFsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB4X2RyYXdf YmFyX2N1cnNvciAodywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEJBUl9DVVJTT1IpOworICAg ICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgSEJBUl9DVVJTT1I6CisgICAgeworICAgICAgaWYg KHJlZCA+PSAwICYmIGJsdWUgPj0gMCAmJiBncmVlbiA+PSAwKQorICAgICAgICAvKiBUZW1wb3Jh cmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAg ICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAo dykpOworICAgICAgICAgIENPTE9SUkVGIG9yaWdfdmFsID0gZi0+b3V0cHV0X2RhdGEudzMyLT5j dXJzb3JfcGl4ZWw7CisgICAgICAgICAgaW50IGludF9yZWQgPSByZWQgKiAyNTU7CisgICAgICAg ICAgaW50IGludF9ncmVlbiA9IGdyZWVuICogMjU1OworICAgICAgICAgIGludCBpbnRfYmx1ZSA9 IGJsdWUgKiAyNTU7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwg PSBQQUxFVFRFUkdCIChpbnRfcmVkLCBpbnRfZ3JlZW4sIGludF9ibHVlKTsKKyAgICAgICAgICB3 LT5tYy5jdXJzb3JfZ2NfaW52aXNpYmxlX29rYXkgPSB0cnVlOworICAgICAgICAgIHhfZHJhd19i YXJfY3Vyc29yICh3LCBnbHlwaF9yb3csIGN1cnNvcl93aWR0aCwgSEJBUl9DVVJTT1IpOworICAg ICAgICAgIHctPm1jLmN1cnNvcl9nY19pbnZpc2libGVfb2theSA9IGZhbHNlOworICAgICAgICAg IGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ192YWw7CisgICAgICAgIH0K KyAgICAgICAgZWxzZQorICAgICAgICAgIHhfZHJhd19iYXJfY3Vyc29yICh3LCBnbHlwaF9yb3cs IGN1cnNvcl93aWR0aCwgSEJBUl9DVVJTT1IpOworICAgICAgYnJlYWs7CisgICAgfQorICAgIGNh c2UgTk9fQ1VSU09SOgorICAgICAgdy0+cGh5c19jdXJzb3Jfd2lkdGggPSAwOworICAgICAgYnJl YWs7CisgICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOworICB9CisvKiBFTkQgbXVs dGlwbGUgY3Vyc29ycyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCiAKLQlkZWZhdWx0Ogot CSAgZW1hY3NfYWJvcnQgKCk7Ci0JfQogICAgIH0KIH0KIApkaWZmIC0tZ2l0IGEvc3JjL3dpbmRv dy5jIGIvc3JjL3dpbmRvdy5jCmluZGV4IDUwNGRjZDMuLjhkYWVlMzUgMTAwNjQ0Ci0tLSBhL3Ny Yy93aW5kb3cuYworKysgYi9zcmMvd2luZG93LmMKQEAgLTY3ODksNiArNjc4OSwyNyBAQCBnZXRf cGh5c19jdXJzb3JfZ2x5cGggKHN0cnVjdCB3aW5kb3cgKncpCiAgIHN0cnVjdCBnbHlwaCAqZ2x5 cGg7CiAgIGludCBocG9zID0gdy0+cGh5c19jdXJzb3IuaHBvczsKIAorLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqK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aWR0aDsKKyAg aWYgKGN1cnNvcl9pbl9mcmluZ2VfcCkKKyAgICByZXR1cm4gTlVMTDsKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisKICAgaWYgKCEody0+cGh5c19jdXJzb3IudnBvcyA+PSAwCiAJJiYgdy0+ cGh5c19jdXJzb3IudnBvcyA8IHctPmN1cnJlbnRfbWF0cml4LT5ucm93cykpCiAgICAgcmV0dXJu IE5VTEw7CmRpZmYgLS1naXQgYS9zcmMvd2luZG93LmggYi9zcmMvd2luZG93LmgKaW5kZXggNTYz YTZmNi4uNmIzYzlkNSAxMDA2NDQKLS0tIGEvc3JjL3dpbmRvdy5oCisrKyBiL3NyYy93aW5kb3cu aApAQCAtNzYsNiArNzYsMzkgQEAgb25lIGFuZCB0aGUgc2FtZSwgc28gaXRzIHByZXYgYW5kIG5l eHQgbWVtYmVycyBhcmUgbmlsLgogCiBBIGRlYWQgd2luZG93IGhhcyBpdHMgY29udGVudHMgZmll bGQgc2V0IHRvIG5pbC4gICovCiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogQkVHSU4g bXVsdGlwbGUgY3Vyc29ycyAqLworCisvKiBTdWZmaXhlcyBmb3IgdGhlIGBtY2Agd2luZG93IHBv aW50ZXIgcHJlZml4LiAqLworc3RydWN0IG11bHRpcGxlX2N1cnNvcnMKK3sKKyAgLyogVmFsdWVz IGZvciBwcmV2aW91cyBhbmQgY3VycmVudCBgd2luZG93LXN0YXJ0JyBhbmQgYHdpbmRvdy1lbmQn LiAqLworICBFTUFDU19JTlQgY3VycmVudF9zdGFydCwgY3VycmVudF9lbmQsIHByZXZpb3VzX3N0 YXJ0LCBwcmV2aW91c19lbmQsIGN1cnJlbnRfeCwgcHJldmlvdXNfeDsKKworICAvKiBUcnVlIG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c29ycyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKIHN0cnVjdCBjdXJzb3Jf cG9zCiB7CiAgIC8qIFBpeGVsIHBvc2l0aW9uLiAgVGhlc2UgYXJlIGFsd2F5cyB3aW5kb3cgcmVs YXRpdmUuICAqLwpAQCAtMTc4LDYgKzIxMSwyMCBAQCBzdHJ1Y3Qgd2luZG93CiAgICAgLyogQW4g YWxpc3Qgd2l0aCBwYXJhbWV0ZXJzLiAgKi8KICAgICBMaXNwX09iamVjdCB3aW5kb3dfcGFyYW1l dGVyczsKIAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBtdWx0aXBsZSBjdXJzb3JzICov CisKKyAgICAvKiBUaGUgY2FjaGUgZm9yIG11bHRpcGxlIGdseXBoIGN1cnNvcnMuICBGb3IgYW4g ZXhhbXBsZSBvZiB0aGUgc3RydWN0dXJlIG9mCisgICAgdGhlIGxpc3QsIHNlZSB0aGUgY29tbWVu dHMgYXQgdGhlIGJlZ2lubmluZyBvZiBgbWNfY2FsYycgaW4geGRpc3AuYy4gICovCisgICAgTGlz cF9PYmplY3QgbWNfZ2x5cGhfY2FjaGU7CisKKyAgICAvKiBUaGUgY2FjaGUgZm9yIG11bHRpcGxl IGdseXBoL2dseXBobGVzcyBjdXJzb3JzIHRoYXQgZm9ybSBjcm9zc2hhaXJzLiAgRm9yIGFuCisg ICAgZXhhbXBsZSBvZiB0aGUgc3RydWN0dXJlIG9mIHRoZSBsaXN0LCBzZWUgdGhlIGNvbW1lbnRz IGF0IHRoZSBiZWdpbm5pbmcgb2YKKyAgICBgbWNfY3Jvc3NoYWlycycgaW4geGRpc3AuYy4gICov CisgICAgTGlzcF9PYmplY3QgY3Jvc3NoYWlyc19jYWNoZTsKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKICAgICAvKiBObyBMaXNwIGRhdGEgbWF5IGZvbGxvdyBiZWxvdyB0aGlzIHBvaW50 IHdpdGhvdXQgY2hhbmdpbmcKICAgICAgICBtYXJrX29iamVjdCBpbiBhbGxvYy5jLiAgVGhlIG1l bWJlciBjdXJyZW50X21hdHJpeCBtdXN0IGJlIHRoZQogICAgICAgIGZpcnN0IG5vbi1MaXNwIG1l bWJlci4gICovCkBAIC0yODAsNiArMzI3LDE0IEBAIHN0cnVjdCB3aW5kb3cKIAogI2lmZGVmIEhB VkVfV0lORE9XX1NZU1RFTQogCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIG11bHRpcGxl IGN1cnNvcnMgKi8KKworICAgIC8qIFRoZSBwcmVmaXggZm9yIHdpbmRvdyBwb2ludGVycyByZWxh dGluZyB0byBtdWx0aXBsZSBjdXJzb3JzLiAgKi8KKyAgICBzdHJ1Y3QgbXVsdGlwbGVfY3Vyc29y cyBtYzsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKICAgICAvKiBDdXJzb3IgdHlwZSBv ZiBsYXN0IGN1cnNvciBkcmF3biBvbiB0aGUgd2luZG93LiAgKi8KICAgICBlbnVtIHRleHRfY3Vy c29yX2tpbmRzIHBoeXNfY3Vyc29yX3R5cGU7CiAKQEAgLTQxOCw2ICs0NzMsMjMgQEAgWFdJTkRP VyAoTGlzcF9PYmplY3QgYSkKICAgcmV0dXJuIFhVTlRBRyAoYSwgTGlzcF9WZWN0b3JsaWtlKTsK IH0KIAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBtdWx0aXBsZSBjdXJzb3JzICovCisK K0lOTElORSB2b2lkCit3c2V0X21jX2dseXBoX2NhY2hlIChzdHJ1Y3Qgd2luZG93ICp3LCBMaXNw X09iamVjdCB2YWwpCit7CisgIHctPm1jX2dseXBoX2NhY2hlID0gdmFsOworfQorCitJTkxJTkUg dm9pZAord3NldF9jcm9zc2hhaXJzX2NhY2hlIChzdHJ1Y3Qgd2luZG93ICp3LCBMaXNwX09iamVj dCB2YWwpCit7CisgIHctPmNyb3NzaGFpcnNfY2FjaGUgPSB2YWw7Cit9CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCiAvKiBNb3N0IGNvZGUgc2hvdWxkIHVzZSB0aGVzZSBmdW5jdGlvbnMg dG8gc2V0IExpc3AgZmllbGRzIGluIHN0cnVjdAogICAgd2luZG93LiAgKi8KIElOTElORSB2b2lk CmRpZmYgLS1naXQgYS9zcmMveGRpc3AuYyBiL3NyYy94ZGlzcC5jCmluZGV4IGY2ZTk4ZGEuLjI4 ZjI4MWYgMTAwNjQ0Ci0tLSBhL3NyYy94ZGlzcC5jCisrKyBiL3NyYy94ZGlzcC5jCkBAIC05MDcs NiArOTA3LDE1NDYgQEAgc3RhdGljIHZvaWQgcHJvZHVjZV9zcGVjaWFsX2dseXBocyAoc3RydWN0 IGl0ICosIGVudW0gZGlzcGxheV9lbGVtZW50X3R5cGUpOwogc3RhdGljIHZvaWQgc2hvd19tb3Vz ZV9mYWNlIChNb3VzZV9ITEluZm8gKiwgZW51bSBkcmF3X2dseXBoc19mYWNlKTsKIHN0YXRpYyBi b29sIGNvb3Jkc19pbl9tb3VzZV9mYWNlX3AgKHN0cnVjdCB3aW5kb3cgKiwgaW50LCBpbnQpOwog CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKio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U0RBVEEgKGJ1aWxkX3N0cmluZyAoImZvbyIpKSwgNjkpOworCitpZiAoQlVGRkVSUCAody0+Y29u dGVudHMpICYmIFNUUklOR1AgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbmFtZSkpKQor ICBmcHJpbnRmIChzdGRlcnIsICJuc191cGRhdGVfd2luZG93X2VuZDogICVzXG4iLCBTU0RBVEEg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbmFtZSkpKTsKKworQVVUT19TVFJJTkcgKG15 X3N0cmluZ19vbmUsICJUaGlzIGlzIHRoZSB2YWx1ZSBvZiBgbXlfb2JqZWN0X29uZSc6ICAlcyIp OworTGlzcF9PYmplY3QgbXlfb2JqZWN0X29uZSA9IG1ha2VfZmxvYXQgKDAuMSk7CitDQUxMTiAo Rm1lc3NhZ2UsIG15X3N0cmluZ19vbmUsIG15X29iamVjdF9vbmUpOworCitBVVRPX1NUUklORyAo bXlfc3RyaW5nX3R3bywgIlRoaXMgaXMgdGhlIHZhbHVlIG9mIGBteV9vYmplY3RfdHdvJzogICVz Iik7CitMaXNwX09iamVjdCBteV9vYmplY3RfdHdvID0gbWFrZV9udW1iZXIgKDc3Nyk7CitDQUxM TiAoRm1lc3NhZ2UsIG15X3N0cmluZ190d28sIG15X29iamVjdF90d28pOworCitXSU5ET1c6ICB3 LT5jb250ZW50cworCitCVUZGRVI6ICBYQlVGRkVSICh3LT5jb250ZW50cykKKworQlVGRkVSIExP Q0FMIFZBUklBQkxFOiAgQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCB2YXJpYWJsZV9uYW1l KQorCitOTyBOQVJST1dJTkc6CisKK0JFRyA9PSBCZWdpbm5pbmcgb2YgQnVmZmVyICh3aW5kb3cg ZGlzcGxheXMgY3VycmVudCBidWZmZXIpCisKK1pWID09IEVuZCBvZiBCdWZmZXIgKHdpbmRvdyBk aXNwbGF5cyBjdXJyZW50IGJ1ZmZlcikKKworQkVHX0JZVEUgP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naHQg PSBnbHlwaF9yb3ctPmhlaWdodDsKKyAgLyogKGdldCAnKy1sZWZ0LWZyaW5nZS1vdmVybGF5LXBv c2l0aW9uICdvdmVybGF5LWFycm93LWJpdG1hcCkKKyAgICAgPT4gJystb3ZlcmxheS1hcnJvdy1i aXRtYXAKKyAgICAgPT4gUW1jX3NtaWxleV9mYWNlICovCisgIC8qIExpc3BfT2JqZWN0IHZhbCA9 IEZnZXQgKGludGVybiAoIistbGVmdC1mcmluZ2Utb3ZlcmxheS1wb3NpdGlvbiIpLCBRb3Zlcmxh eV9hcnJvd19iaXRtYXApOyAqLworICBMaXNwX09iamVjdCBtYXJrZXIgPSBmaW5kX3N5bWJvbF92 YWx1ZSAoaW50ZXJuICgib3ZlcmxheS1hcnJvdy1wb3NpdGlvbiIpKTsKKyAgaW50IGZyaW5nZV9i aXRtYXAgPSBOT19GUklOR0VfQklUTUFQOworICBpbnQgZmFjZV9pZCA9IERFRkFVTFRfRkFDRV9J RDsKKyAgaWYgKEVRIChmbGF2b3IsIFFvdmVybGF5X2Fycm93X2JpdG1hcCkpCisgICAgeworICAg ICAgTGlzcF9PYmplY3Qgdmxpc3Q7CisgICAgICBmb3IgKHZsaXN0ID0gVm92ZXJsYXlfYXJyb3df dmFyaWFibGVfbGlzdDsKKyAgICAgICAgICAgQ09OU1AgKHZsaXN0KTsKKyAgICAgICAgICAgdmxp c3QgPSBYQ0RSICh2bGlzdCkpCisgICAgICAgIHsKKyAgICAgICAgICBMaXNwX09iamVjdCB2YXIg PSBYQ0FSICh2bGlzdCk7CisgICAgICAgICAgTGlzcF9PYmplY3QgdmFsOworICAgICAgICAgIGlm ICghU1lNQk9MUCAodmFyKSkKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgIHZhbCA9 IGZpbmRfc3ltYm9sX3ZhbHVlICh2YXIpOworICAgICAgICAgIGlmICh2YWwgPSBGZ2V0ICh2YXIs IFFvdmVybGF5X2Fycm93X2JpdG1hcCksIFNZTUJPTFAgKHZhbCkpCisgICAgICAgICAgICBmcmlu Z2VfYml0bWFwID0gbG9va3VwX2ZyaW5nZV9iaXRtYXAgKHZhbCk7CisgICAgICAgIH0KKyAgICAg IGdseXBoX3Jvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAgPSAoY3Vyc29yX3R5cGUgIT0gTk9fQ1VS U09SKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZnJpbmdlX2Jp dG1hcCAvKiBsb29rdXBfZnJpbmdlX2JpdG1hcCAoZmxhdm9yKSAqLworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgIGRyYXdf ZnJpbmdlX2JpdG1hcCAodywgZ2x5cGhfcm93LCB0cnVlKTsKKyAgICAgIC8qIG9wdGltaXphdGlv biAzOiAgRFJBVyB0aGUgYG92ZXJsYXktYXJyb3ctYml0bWFwJyBpZiB0aGVyZSBpcyBhIG1hcmtl ci4gKi8KKyAgICAgIGlmIChNQVJLRVJQIChtYXJrZXIpCisgICAgICAgICAgJiYgWE1BUktFUiAo bWFya2VyKS0+YnVmZmVyCisgICAgICAgICAgJiYgQlVGRkVSX0xJVkVfUCAoWE1BUktFUiAobWFy a2VyKS0+YnVmZmVyKSkKKyAgICAgICAgeworICAgICAgICAgIGdseXBoX3Jvdy0+b3ZlcmxheV9h cnJvd19iaXRtYXAgPSBmcmluZ2VfYml0bWFwOworICAgICAgICAgIGRyYXdfZnJpbmdlX2JpdG1h cCAodywgZ2x5cGhfcm93LCB0cnVlKTsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlIGlmIChF USAoZmxhdm9yLCBRbWNfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9hbmdsZSkKKyAgICAgICAgICAg ICB8fCBFUSAoZmxhdm9yLCBRbWNfaG9sbG93X3JlY3RhbmdsZSkKKyAgICAgICAgICAgICB8fCBF USAoZmxhdm9yLCBRbWNfdmVydG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bGF2b3Is IFFtY19nbHlwaGxlc3MpCisgICAgICAgICAgICAgICB8fCBFUSAoZmxhdm9yLCBRbWNfZ2x5cGhf dGFiKSkKKyAgICAgICAgRlJBTUVfUklGIChmKS0+ZHJhd193aW5kb3dfY3Vyc29yICh3LCBnbHlw aF9yb3csIHgsIHksIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgdHJ1ZSwgZmFsc2UsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sb3JfdmVjdG9yLCBmbGF2b3IpOworICAvKiBS ZXN0b3JlIHRoZSBwcmV2aW91cyB2YWx1ZXMgZm9yIHctPnBoeXNfY3Vyc29yIGFuZCBnbHlwaF9y b3cuICovCisgIHctPnBoeXNfY3Vyc29yLnggPSBvcmlnaW5hbF94OworICB3LT5waHlzX2N1cnNv ci55ID0gb3JpZ2luYWxfeTsKKyAgdy0+cGh5c19jdXJzb3IuaHBvcyA9IG9yaWdpbmFsX2hwb3M7 CisgIHctPnBoeXNfY3Vyc29yLnZwb3MgPSBvcmlnaW5hbF92cG9zOworICB3LT5waHlzX2N1cnNv cl90eXBlID0gb3JpZ2luYWxfY3Vyc29yX3R5cGU7CisgIGdseXBoX3Jvdy0+Y3Vyc29yX2luX2Zy aW5nZV9wID0gb3JpZ2luYWxfY3Vyc29yX2luX2ZyaW5nZV9wOworICBnbHlwaF9yb3ctPnJldmVy c2VkX3AgPSBvcmlnaW5hbF9yZXZlcnNlZF9wOworICB3LT5waHlzX2N1cnNvcl9hc2NlbnQgPSBv cmlnaW5hbF9hc2NlbnQ7CisgIHctPnBoeXNfY3Vyc29yX2hlaWdodCA9IG9yaWdpbmFsX2hlaWdo dDsKK30KKworc3RhdGljIGludAorbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoTGlzcF9PYmplY3Qg YXJnKQoreworICBjaGFyICpzdHI7CisgIGlmIChYVFlQR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51bV93aWR0aCA9IGl0LmxudW1fd2lkdGg7Cisg ICAgICBsbnVtX3BpeGVsX3dpZHRoID0gaXQubG51bV9waXhlbF93aWR0aDsKKyAgICAgIFJFU1RP UkVfSVQgKCZpdCwgJnNhdmVkX2l0X2Zvcl93aW5kb3dfc3RhcnQsIHNhdmVkX2l0ZGF0YV9mb3Jf d2luZG93X3N0YXJ0KTsKKyAgICAgIGl0LmZpcnN0X3Zpc2libGVfeCA9IGZpcnN0X3g7CisgICAg ICBpdC5sYXN0X3Zpc2libGVfeCA9IGxhc3RfeDsKKyAgICAgIGl0LmxudW1fd2lkdGggPSBsbnVt X3dpZHRoOworICAgICAgaXQubG51bV9waXhlbF93aWR0aCA9IGxudW1fcGl4ZWxfd2lkdGg7Cisg ICAgICBTQVZFX0lUIChzYXZlZF9pdF9mb3Jfd2luZG93X3N0YXJ0LCBpdCwgc2F2ZWRfaXRkYXRh X2Zvcl93aW5kb3dfc3RhcnQpOworICAgIH0KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgUkVNT1ZFIEdMWVBIIENVUlNPUlMKKyoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworICAvKiBSZW1vdmUgdGhlIGN1cnNvcnMgdXNpbmcgdGhlIGNhY2hl IGlmIHRoZSBjb25kaXRpb25zIGFyZSBzYXRpc2ZpZWQuICovCisgIGlmICgocmVtb3ZlICYmICFO SUxQICh3LT5tY19nbHlwaF9jYWNoZSkgJiYgTklMUCAoQlZBUiAoYiwgbWNfZ2x5cGhfbGlzdCkp KQorICAgICAgfHwgKCFOSUxQICh3LT5tY19nbHlwaF9jYWNoZSkgJiYgIU5JTFAgKEJWQVIgKGIs IG1jX2dseXBoX2xpc3QpKSAmJiAocmVtb3ZlIHx8IHcgIT0gc3cpKSkKKyAgICB7CisgICAgICAv KiBFcmFzZSB0aGUgcmVhbCBjdXJzb3Igc28gdGhhdCB0aGUgd2hvbGUgdmVydGljYWwgbGluZSBn ZXRzIHJlbW92ZWQsIG5vdCBqdXN0IHRoZSBmYWtlIGN1cnNvcnMuICovCisgICAgICBtY19lcmFz ZV9nbHlwaF9jdXJzb3IgKHcsIHctPnBoeXNfY3Vyc29yLngsIHctPnBoeXNfY3Vyc29yLnksIHct PnBoeXNfY3Vyc29yLmhwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPnBoeXNf Y3Vyc29yLnZwb3MsIHctPnBoeXNfY3Vyc29yX3R5cGUpOworICAgICAgLyogUHJvY2VzcyB0aGUg TUNfR0xZUEhfQ0FDSEUuICovCisgICAgICBpZiAoIU5JTFAgKHctPm1jX2dseXBoX2NhY2hlKSkK KyAgICAgICAgeworICAgICAgICAgIGZvciAodmxpc3QgPSBYQ0FSIChYQ0RSICh3LT5tY19nbHlw aF9jYWNoZSkpOworICAgICAgICAgICAgICAgQ09OU1AgKHZsaXN0KTsKKyAgICAgICAgICAgICAg IHZsaXN0ID0gWENEUiAodmxpc3QpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzcGVj cyA9IFhDQVIgKFhDQVIgKHZsaXN0KSk7CisgICAgICAgICAgICAgIGxpc3BfdHlwZSA9IEZudGgg KG1ha2VfbnVtYmVyICgxKSwgc3BlY3MpOworICAgICAgICAgICAgIGlmIChDT05TUCAobGlzcF90 eXBlKSkKKyAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29yX3R5 cGUgKFhDQVIgKGxpc3BfdHlwZSkpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAobGlzcF90eXBlKTsK KyAgICAgICAgICAgICAgeF95X2hwb3NfdnBvcyA9IFhDQVIgKFhDRFIgKFhDQVIgKHZsaXN0KSkp OworICAgICAgICAgICAgICB4ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB4X3lfaHBv c192cG9zKSk7CisgICAgICAgICAgICAgIHkgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMSks IHhfeV9ocG9zX3Zwb3MpKTsKKyAgICAgICAgICAgICAgaHBvcyA9IFhJTlQgKEZudGggKG1ha2Vf bnVtYmVyICgyKSwgeF95X2hwb3NfdnBvcykpOworICAgICAgICAgICAgICB2cG9zID0gWElOVCAo Rm50aCAobWFrZV9udW1iZXIgKDMpLCB4X3lfaHBvc192cG9zKSk7CisgICAgICAgICAgICAgIG1j X2VyYXNlX2dseXBoX2N1cnNvciAodywgeCwgeSwgaHBvcywgdnBvcywgY3Vyc29yX3R5cGUpOwor ICAgICAgICAgICAgfQorICAgICAgICAgIGlmIChOSUxQIChCVkFSIChiLCBtY19nbHlwaF9saXN0 KSkpCisgICAgICAgICAgICB3c2V0X21jX2dseXBoX2NhY2hlICh3LCBRbmlsKTsKKyAgICAgICAg fQorICAgICAgdy0+bWMuZXJhc2VfZ2x5cGhfY3Vyc29yID0gZmFsc2U7CisgICAgfQorLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSRURSQVcg R0xZUEggQ1VSU09SUworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisgIC8qIElmIHRoZSBmaXJz dCBlbGVtZW50IG9mIHctPm1jX2dseXBoX2NhY2hlIGlzIHRoZSBzYW1lIGFzIHRoZSBsb2NhbCB2 YXJpYWJsZSBtY19nbHlwaF9saXN0LAorICAgICBhbmQgdGhlIHByZXZpb3VzL2N1cnJlbnQgd2lu ZG93LXN0YXJ0L3dpbmRvdy1lbmQgYXJlIHRoZSBzYW1lIChlLmcuLCBubyBzY3JvbGxpbmcpLAor ICAgICB0aGVuIHJlZHJhdyB0aGUgY3Vyc29ycyB1c2luZyB0aGUgY2FjaGUuICBUaGlzIGF2b2lk cyByZWNhbGN1bGF0aW5nIGNvb3JkaW5hdGVzLiAqLworICBpZiAoIXJlbW92ZQorICAgICAgJiYg dyA9PSBzdworICAgICAgJiYgdy0+bWMuY3VycmVudF9zdGFydAorICAgICAgJiYgdy0+bWMuY3Vy cmVudF9lbmQKKyAgICAgICYmIHctPm1jLnByZXZpb3VzX3N0YXJ0CisgICAgICAmJiB3LT5tYy5w cmV2aW91c19lbmQKKyAgICAgICYmIHctPm1jLmN1cnJlbnRfc3RhcnQgPT0gdy0+bWMucHJldmlv dXNfc3RhcnQKKyAgICAgICYmIHctPm1jLmN1cnJlbnRfZW5kID09IHctPm1jLnByZXZpb3VzX2Vu ZAorICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIG1jX2dseXBoX2xpc3QpKQorICAgICAgJiYgIU5J TFAgKHctPm1jX2dseXBoX2NhY2hlKQorICAgICAgJiYgIU5JTFAgKEZlcXVhbCAoRm50aCAobWFr ZV9udW1iZXIgKDApLCB3LT5tY19nbHlwaF9jYWNoZSksIEJWQVIgKGIsIG1jX2dseXBoX2xpc3Qp KSkpCisgICAgeworICAgICAgZm9yICh2bGlzdCA9IFhDQVIgKFhDRFIgKHctPm1jX2dseXBoX2Nh Y2hlKSk7CisgICAgICAgICAgIENPTlNQICh2bGlzdCk7CisgICAgICAgICAgIHZsaXN0ID0gWENE UiAodmxpc3QpKQorICAgICAgICB7CisgICAgICAgICAgc3BlY3MgPSBYQ0FSIChYQ0FSICh2bGlz dCkpOworICAgICAgICAgIHBvc2ludCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgwKSwgc3Bl Y3MpKTsKKyAgICAgICAgICBsaXNwX3R5cGUgPSBGbnRoIChtYWtlX251bWJlciAoMSksIHNwZWNz KTsKKyAgICAgICAgICBpZiAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICBjdXJzb3Jf dHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKFhDQVIgKGxpc3BfdHlwZSkpOworICAgICAg ICAgICAgZWxzZQorICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29y X3R5cGUgKGxpc3BfdHlwZSk7CisgICAgICAgICAgaWYgKENPTlNQIChsaXNwX3R5cGUpKQorICAg ICAgICAgICAgY3Vyc29yX3dpZHRoID0gWElOVCAoWENBUiAoWENEUiAobGlzcF90eXBlKSkpOwor ICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSAxOworICAgICAg ICAgIGNvbG9yX3ZlY3RvciA9IEZudGggKG1ha2VfbnVtYmVyICgyKSwgc3BlY3MpOworICAgICAg ICAgIGlmIChTVFJJTkdQIChjb2xvcl92ZWN0b3IpKQorICAgICAgICAgICAgY29sb3JfdmVjdG9y ID0gbWNfY29sb3JfdmVjdG9yX2NhbGMgKHcsIGNvbG9yX3ZlY3Rvcik7CisgICAgICAgICAgeF95 X2hwb3NfdnBvcyA9IFhDQVIgKFhDRFIgKFhDQVIgKHZsaXN0KSkpOworICAgICAgICAgIHggPSBY SU5UIChGbnRoIChtYWtlX251bWJlciAoMCksIHhfeV9ocG9zX3Zwb3MpKTsKKyAgICAgICAgICB5 ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB4X3lfaHBvc192cG9zKSk7CisgICAgICAg ICAgaHBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgeF95X2hwb3NfdnBvcykpOwor ICAgICAgICAgIHZwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMyksIHhfeV9ocG9zX3Zw b3MpKTsKKyAgICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgeCwgeSwgaHBvcywgdnBv cywgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgY29sb3JfdmVjdG9yLCBRbWNfZ2x5cGgpOwor ICAgICAgICB9CisgICAgICB3LT5tYy5kcmF3X2dseXBoX2N1cnNvciA9IGZhbHNlOworICAgIH0K Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBE UkFXIEdMWVBIIENVUlNPUlMgQU5FVworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisgICAgLyog RHJhdyB0aGUgY3Vyc29ycyBhbmV3IGJlY2F1c2Ugc29tZXRoaW5nIGhhcyBjaGFuZ2VkLCBlLmcu LCB0aGUgZmlyc3QgZWxlbWVudCBvZgorICAgICAgIHctPm1jX2dseXBoX2NhY2hlIGlzIE5PVCB0 aGUgc2FtZSBhcyB0aGUgbG9jYWwgdmFyaWFibGUgbWNfZ2x5cGhfbGlzdDsgYW5kL29yLCB0aGUg cHJldmlvdXMvCisgICAgICAgY3VycmVudCB3aW5kb3ctc3RhcnQvd2luZG93LWVuZCBhcmUgTk9U IHRoZSBzYW1lIChlLmcuLCBzY3JvbGxpbmcgaGFzIG9jY3VycmVkKS4KKyAgICAgICBTZW1pLWV4 cGVuc2l2ZSBjYWxjdWxhdGlvbiBvZiBjb29yZGluYXRlcyBpcyByZXF1aXJlZC4gKi8KKyAgICBl bHNlIGlmICghcmVtb3ZlCisgICAgICAgICAgICAgJiYgdyA9PSBzdworICAgICAgICAgICAgICYm IHctPm1jLmN1cnJlbnRfc3RhcnQKKyAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgbWNf Z2x5cGhfbGlzdCkpKQorICAgICAgeworICAgICAgICBmb3IgKHZsaXN0ID0gQlZBUiAoYiwgbWNf Z2x5cGhfbGlzdCk7CisgICAgICAgICAgICAgQ09OU1AgKHZsaXN0KTsKKyAgICAgICAgICAgICB2 bGlzdCA9IFhDRFIgKHZsaXN0KSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBzcGVjcyA9IFhD QVIgKHZsaXN0KTsKKyAgICAgICAgICAgIHBvc2ludCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVy ICgwKSwgc3BlY3MpKTsKKyAgICAgICAgICAgIGxpc3BfdHlwZSA9IEZudGggKG1ha2VfbnVtYmVy ICgxKSwgc3BlY3MpOworICAgICAgICAgICAgaWYgKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAg ICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKFhDQVIgKGxpc3Bf dHlwZSkpOworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUg PSBtY19saXNwX3RvX2N1cnNvcl90eXBlIChsaXNwX3R5cGUpOworICAgICAgICAgICAgaWYgKENP TlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSBYSU5UIChYQ0FS IChYQ0RSIChsaXNwX3R5cGUpKSk7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAg ICBjdXJzb3Jfd2lkdGggPSAxOworICAgICAgICAgICAgY29sb3JfdmVjdG9yID0gRm50aCAobWFr ZV9udW1iZXIgKDIpLCBzcGVjcyk7CisgICAgICAgICAgICBpZiAoU1RSSU5HUCAoY29sb3JfdmVj dG9yKSkKKyAgICAgICAgICAgICAgY29sb3JfdmVjdG9yID0gbWNfY29sb3JfdmVjdG9yX2NhbGMg KHcsIGNvbG9yX3ZlY3Rvcik7CisgICAgICAgICAgICBSRVNUT1JFX0lUICgmaXQsICZzYXZlZF9p dF9mb3Jfd2luZG93X3N0YXJ0LCBzYXZlZF9pdGRhdGFfZm9yX3dpbmRvd19zdGFydCk7CisgICAg ICAgICAgICAvKiBGSVhNRTogIFdoZW4gZGVhbGluZyB3aXRoIGEgbGluZSBmZWVkIGBidWZmZXIt ZGlzcGxheS10YWJsZScgaXNzdWUsCisgICAgICAgICAgICBpbXBsZW1lbnQgYSBzeXN0ZW0gdXNp bmcgYG1jX21vdmVfaXRfaW5fZGlzcGxheV9saW5lJyB0byBhdm9pZCBvdmVyc2hvb3RpbmcuCisg ICAgICAgICAgICBUaGUgY3VycmVudCBzdHJhdGVneSB0byBkbyB0aGlzIHdvdWxkIGJlIHRvIGZp cnN0IHVzZSBgbW92ZV9pdF90bycgYW5kIHNlZSBpZgorICAgICAgICAgICAgaXQgZW5jb3VudGVy ZWQgYSBsaW5lIGZlZWQuICBJZiBzbywgdGhlbiBjYWxsIGBtb3ZlX2l0X2J5X2xpbmVzICgmaXQs IDApYCBhbmQKKyAgICAgICAgICAgIHRoZW4gYG1jX21vdmVfaXRfaW5fZGlzcGxheV9saW5lJyAt LSBzdG9wcGluZyBhdCB0aGUgY29ycmVjdCBYLiAqLworICAgICAgICAgICAgbW92ZV9pdF90byAo Jml0LCBwb3NpbnQsIGl0Lmxhc3RfdmlzaWJsZV94LCBpdC5sYXN0X3Zpc2libGVfeSAtIDEsIC0x LCBNT1ZFX1RPX1BPUyB8IE1PVkVfVE9fWCB8IE1PVkVfVE9fWSk7CisgICAgICAgICAgICAvKiAo YXJlZiBidWZmZXItZGlzcGxheS10YWJsZSA/XG4pID09IFsoMTgyIC4gMTI3KSAxMF0gKi8KKyAg ICAgICAgICAgIGJvb2wgbGluZV9mZWVkX292ZXJzaG9vdCA9IChGRVRDSF9CWVRFIChJVF9CWVRF UE9TIChpdCkpID09ICdcbicKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBidWZmZXJfZGlzcGxheV90YWJsZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgVkVDVE9SUCAobGluZV9mZWVkX3ZlY3RvcikKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBBU0laRSAobGluZV9mZWVkX3ZlY3RvcikgPiAx CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgSVRFUkFUT1JfQVRf RU5EX09GX0xJTkVfUCAoJml0KSk7CisgICAgICAgICAgICBpbnQgYWRqdXN0X3ggPSAobGluZV9m ZWVkX292ZXJzaG9vdCkgPyBmcmFtZV9jaGFyX3dpZHRoIDogMDsKKyAgICAgICAgICAgIGludCBh ZGp1c3RfaHBvcyA9IChsaW5lX2ZlZWRfb3ZlcnNob290KSA/IDEgOiAwOworICAgICAgICAgICAg aWYgKElUX0NIQVJQT1MgKGl0KSAhPSBwb3NpbnQpCisgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICB4ID0gLTE7CisgICAgICAgICAgICAgICAgeSA9IC0xOworICAgICAgICAgICAgICAg IGhwb3MgPSAtMTsKKyAgICAgICAgICAgICAgICB2cG9zID0gLTE7CisgICAgICAgICAgICAgICAg Z290byBkb25lX29uZTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgeSA9IGl0LmN1cnJl bnRfeTsKKyAgICAgICAgICAgIGlmIChoZWFkZXJfbGluZV9oZWlnaHQgPiAwKQorICAgICAgICAg ICAgICB2cG9zID0gaXQudnBvcyArIDE7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICB2cG9zID0gaXQudnBvczsKKyAgICAgICAgICAgIGlmIChoc2NsKQorICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgeCA9IGl0LmN1cnJlbnRfeCAtIChoc2NsX2ZpcnN0X2hwb3Mg KiBmcmFtZV9jaGFyX3dpZHRoKSAtIGFkanVzdF94OworICAgICAgICAgICAgICAgIGhwb3MgPSBp dC5ocG9zIC0gaHNjbF9maXJzdF9ocG9zIC0gYWRqdXN0X2hwb3M7CisgICAgICAgICAgICAgIH0K KyAgICAgIC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isgICAgICAgICAgICAgICAg bWFrZV9udW1iZXIgKHgpLAorICAgICAgICAgICAgICAgIG1ha2VfbnVtYmVyICh5KSwKKyAgICAg ICAgICAgICAgICBtYWtlX251bWJlciAoaHBvcyksCisgICAgICAgICAgICAgICAgbWFrZV9udW1i ZXIgKHZwb3MpLAorICAgICAgICAgICAgICAgIG1jX2N1cnNvcl90eXBlX3RvX2xpc3AgKHR5cGUp LAorICAgICAgICAgICAgICAgIG1ha2VfbnVtYmVyICh3aWR0aCksCisgICAgICAgICAgICAgICAg Zm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAg IGZsYXZvciwKKyAgICAgICAgICAgICAgICBtYWtlX251bWJlciAocG9zKSk7CisgICpyZXN1bHQg PSBGY29ucyAodGVtcCwgKnJlc3VsdCk7Cit9CisKK3ZvaWQKK21jX2RyYXdfY3Jvc3NoYWlycyAo c3RydWN0IHdpbmRvdyAqdykKK3sKKyAgLyogRWxpIFouOiAgVGhpcyBkb2Vzbid0IGZlZWwgcmVs ZXZhbnQuICBZb3UgY2FuIGFsd2F5cyByZWRpc3BsYXkgYSB3aW5kb3cgdGhhdCBpcworICBub3Qg dGhlIHNlbGVjdGVkIHdpbmRvdywgcHJvdmlkZWQgdGhhdCB5b3UgdGFrZSBjYXJlIHRvIHN3aXRj aCB0byBpdHMgYnVmZmVyCisgIChyZWRpc3BsYXkgZG9lcyB0aGF0IGFscmVhZHkpLiAqLworICBp ZiAodyAhPSBYV0lORE9XIChzZWxlY3RlZF93aW5kb3cpKQorICAgIHJldHVybjsKKyAgLyogRWxp IFouOiAgSG93IGRpZCB5b3UgZ2V0IGludG8gdGhpcyBzaXR1YXRpb24/ICBJdCBzaG91bGRuJ3Qg aGFwcGVuIGR1cmluZyByZWRpc3BsYXkuICovCisgIGlmICghV0lORE9XX1ZBTElEX1AgKHNlbGVj dGVkX3dpbmRvdykpCisgICAgcmV0dXJuOworICBzdHJ1Y3QgZ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IFhJTlQgKEJWQVIgKGIsIGZpbGxfY29sdW1uKSk7Cisg IExpc3BfT2JqZWN0IHJlc3VsdCA9IFFuaWw7CisgIExpc3BfT2JqZWN0IGZsYXZvciA9IFFuaWw7 CisgIC8qIFZhbHVlcyBmb3IgdGhlIGN1cnJlbnQgY29sdW1uIG9mIHRoZSB2ZXJ0aWNhbCBsaW5l LiAqLworICBMaXNwX09iamVjdCBmb3JlZ3JvdW5kID0gRm1ha2VfdmVjdG9yIChtYWtlX251bWJl ciAoMyksIFFuaWwpOworICBzdHJ1Y3QgZ2x5cGggKnBoeXNfY3Vyc29yX2dseXBoOworICBlbnVt IGZhY2VfaWQgZmFjZV9pZCA9ICgocGh5c19jdXJzb3JfZ2x5cGggPSBnZXRfcGh5c19jdXJzb3Jf Z2x5cGggKHcpKSA9PSBOVUxMKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBERUZBVUxU X0ZBQ0VfSUQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIDogcGh5c19jdXJzb3JfZ2x5cGgt PmZhY2VfaWQ7CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgQ09MT1IgT0YgQ1JPU1NIQUlSUworKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisg IGVudW0gZmFjZV9pZCBldmVuX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAoZiwgaW50ZXJu ICgiKy1ldmVuLW51bWJlcmVkLWNvbHVtbi1mYWNlIiksIHRydWUpOworICBzdHJ1Y3QgZmFjZSAq ZXZlbl9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBldmVuX2ZhY2VfaWQpOworICBMaXNwX09iamVj dCBldmVuX2NvbG9yID0gZXZlbl9mYWNl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ByZWQgKi8KKyAgaWYgKGN1cnJlbnRfY29sICUgMiAhPSAw CisgICAgICAmJiAhZmlsbF9jb2x1bW5fcCkKKyAgICBmb3JlZ3JvdW5kID0gb2RkX2NvbG9yX3Zl Y3RvcjsKKyAgLyogeWVsbG93ICovCisgIGlmIChjdXJyZW50X2NvbCAlIDIgPT0gMAorICAgICAg JiYgIWZpbGxfY29sdW1uX3ApCisgICAgZm9yZWdyb3VuZCA9IGV2ZW5fY29sb3JfdmVjdG9yOwor ICAvKiByZWQgKi8KKyAgaWYgKGN1cnJlbnRfY29sICUgMiAhPSAwCisgICAgICAmJiBmaWxsX2Nv bHVtbl9wCisgICAgICAmJiBjdXJyZW50X2NvbCA8PSBmaWxsX2NvbCkKKyAgICBmb3JlZ3JvdW5k ID0gb2RkX2NvbG9yX3ZlY3RvcjsKKyAgLyogeWVsbG93ICovCisgIGlmIChjdXJyZW50X2NvbCAl IDIgPT0gMAorICAgICAgJiYgZmlsbF9jb2x1bW5fcAorICAgICAgJiYgY3VycmVudF9jb2wgPD0g ZmlsbF9jb2wpCisgICAgZm9yZWdyb3VuZCA9IGV2ZW5fY29sb3JfdmVjdG9yOworICAvKiBncmVl biAqLworICBpZiAoZmlsbF9jb2x1bW5fcAorICAgICAgJiYgY3VycmVudF9jb2wgPiBmaWxsX2Nv bCkKKyAgICBmb3JlZ3JvdW5kID0gZmlsbF9jb2xvcl92ZWN0b3I7CisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICBTVEFSVCBESVNQTEFZIEFORCBQUklNRSBJ VAorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisgIC8qIEJlZ2luIHRoZSBqb3VybmV5IGF0IHct PnN0YXJ0LiAqLworICBTRVRfVEVYVF9QT1NfRl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9pdF9mb3Jf d2luZG93X3N0YXJ0LCBpdCwgc2F2ZWRfaXRkYXRhX2Zvcl93aW5kb3dfc3RhcnQpOworICAgIH0K KyAgLyogVGhpcyBtaWdodCBoYXBwZW4gb24gT1NYIDEwLjExIHdoZW4gcmVzdG9yaW5nIGRlc2t0 b3AgYXQgdGhlIGJlZ2lubmluZworICBvZiBhIG5ldyBzZXNzaW9uPyAqLworICBpZiAoaXRfc3Rh cnQgPiBvcG9pbnRfcHQpCisgICAgcmV0dXJuOworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisg ICAgICAgICAgICAgICAgICAgICAgICAgUkVQTEFDRSBUSEUgUkVBTCBDVVJTT1IKKyoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworICBlcmFzZV9waHlzX2N1cnNvciAodyk7CisgIGdseXBoX3JvdyA9 IE1BVFJJWF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCBvcG9pbnRfdnBvcyk7CisgIGlmICghY3Vy c29yX2luX2ZyaW5nZV9wKQorICAgIGZsYXZvciA9IFFtY19nbHlwaDsKKyAgICAvKiBUaGlzIGNv bmRpdGlvbiBwcm9iYWJseSBkb2VzIG5vdCBleGlzdCBmb3IgdGhlIHJlYWwgZmFrZSBjdXJzb3Iu ICovCisgICAgZWxzZSBpZiAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAgJiYgZ2x5 cGhfcm93LT5jb250aW51ZWRfcCkKKyAgICAgIGZsYXZvciA9IFFtY19waWxjcm93OworICAgICAg ZWxzZSBpZiAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAmJiBnbHlwaF9yb3ct PnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICBmbGF2b3IgPSBRbWNfaG9sbG93X3JlY3Rh bmdsZV9yaWdodF9hbmdsZTsKKyAgICAgICAgZWxzZSBpZiAoY3Vyc29yX2luX2ZyaW5nZV9wCisg ICAgICAgICAgICAgICAgICYmICFnbHlwaF9yb3ctPmNvbnRpbnVlZF9wCisgICAgICAgICAgICAg ICAgICYmICFnbHlwaF9yb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgIGZsYXZv ciA9IFFtY19ob2xsb3dfcmVjdGFuZ2xlOworICBtY19jcm9zc2hhaXJzX2hlbHBlciAodywgb3Bv aW50X3gsIG9wb2ludF95LCBvcG9pbnRfaHBvcywgb3BvaW50X3Zwb3MsCisgICAgICAgICAgICAg ICAgICAgICAgICBIT0xMT1dfQk9YX0NVUlNPUiwgY3Vyc29yX3dpZHRoLAorICAgICAgICAgICAg ICAgICAgICAgICAgZm9yZWdyb3VuZCwgbWNfYmdfY29sb3JfdmVjdG9yICh3LCBmYWNlX2lkKSwK KyAgICAgICAgICAgICAgICAgICAgICAgIGZsYXZvciwgb3BvaW50X3B0LCAmcmVzdWx0KTsKKyAg bWNfY3Jvc3NoYWlyc19oZWxwZXIgKHcsIG9wb2ludF94LCBvcG9pbnRfeSwgb3BvaW50X2hwb3Ms IG9wb2ludF92cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgSE9MTE9XX0JPWF9DVVJTT1Is IGN1cnNvcl93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQsIG1jX2Jn X2NvbG9yX3ZlY3RvciAodywgZmFjZV9pZCksCisgICAgICAgICAgICAgICAgICAgICAgICBRb3Zl cmxheV9hcnJvd19iaXRtYXAsIG9wb2ludF9wdCwgJnJlc3VsdCk7CisgIGlmIChOSUxQIChCVkFS IChiLCBjcm9zc2hhaXJzX2hvcml6b250YWxfcnVsZXIpKSkKKyAgICBnb3RvIHZlcnRpY2FsX3J1 bGVyOworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgSE9S SVpPTlRBTCBSVUxFUjogIEdPVE8gTElORSBCRUdJTgorKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisgIC8qIFBsYWNlIHRoZSBJVCBvbiB0aGUgY3VycmVudCBsaW5lIGNvbnRhaW5pbmcgUFQuICov CisgIGludCB2b2Zmc2V0ID0gKGhlYWRlcl9saW5lX2hlaWdodCA+IDAKKyAgICAgICAgICAgICAg ICAgJiYgb3BvaW50X3Zwb3MgPiAwKQorICAgICAgICAgICAgICAgICAgPyBvcG9pbnRfdnBvcyAt IDEKKyAgICAgICAgICAgICAgICAgIDogb3BvaW50X3Zwb3M7CisgIGlmICh2b2Zmc2V0ID4gMCkK KyAgICBtb3ZlX2l0X2J5X2xpbmVzICgmaXQsIHZvZmZzZXQpOworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqCisgICAgICAgICAgICAgICAgSE9SSVpPTlRBTCBSVUxFUjogIEZJUlNUIFggPT4gUEVO VUxUSU1BVEUgRU9MCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAgd2hpbGUgKHRydWUpCisg ICAgeworICAgICAgZmxhdm9yID0gKGl0LmMgIT0gJ1x0JykgPyBRbWNfZ2x5cGggOiBRbWNfZ2x5 cGhfdGFiOworICAgICAgaWYgKGhzY2wpCisgICAgICAgIHsKKyAgICAgICAgICByZWxhdGl2ZV94 ID0gaXQuY3VycmVudF94IC0gKGhzY2xfZmlyc3RfaHBvcyAqIGZyYW1lX2NoYXJfd2lkdGgpOwor ICAgICAgICAgIGhwb3MgPSBpdC5ocG9zIC0gaHNjbF9maXJzdF9ocG9zOworICAgICAgICB9Cisg ICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICByZWxhdGl2ZV94ID0gaXQuY3Vy cmVudF94IC0gZmlyc3RfeDsKKyAgICAgICAgICAgIGhwb3MgPSBpdC5ocG9zOworICAgICAgICAg IH0KKyAgICAgIGlmIChoZWFkZXJfbGluZV9oZWlnaHQgPiAwKQorICAgICAgICB2cG9zID0gaXQu dnBvcyArIDE7CisgICAgICAgIGVsc2UKKyAgICAgICAgICB2cG9zID0gaXQudnBvczsKKyAgICAg IGJvb2wgbHB3X3JlYWNoZWRfcCA9ICgoaHNjbAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBpdC5jdXJyZW50X3ggPj0gaHNjbF9maXJzdF94ICsgbG51bV9waXhlbF93aWR0aCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAoIWhzY2wKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgaXQuY3VycmVudF94ID49IGZpcnN0X3ggKyBsbnVtX3BpeGVsX3dpZHRo KSk7CisgICAgICBib29sIGZpbmFsX2xvb3BfcCA9IChJVEVSQVRPUl9BVF9FTkRfT0ZfTElORV9Q ICgmaXQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBGRVRDSF9CWVRFIChJVF9CWVRF UE9TIChpdCkpID09ICdcbicKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IHJjID09IE1P VkVfUE9TX01BVENIX09SX1pWKTsKKyAgICAgIGJvb2wgdGFiX2ludmlzaWJsZV9wID0gKGl0LmMg PT0gJ1x0Jyk7CisgICAgICBib29sIHRhYl92aXNpYmxlX3AgPSAoaXQuYyAhPSAnXHQnCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgRkVUQ0hfQllURSAoSVRfQllURVBPUyAoaXQpKSA9 PSAnXHQnKTsKKyAgICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKG9wb2ludF94ID09IHJl bGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF95ID09 IGl0LmN1cnJlbnRfeQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50 X2hwb3MgPT0gaHBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50 X3Zwb3MgPT0gdnBvcyk7CisgICAgICAvKiBpdC5jID09ICdcdCcgd2hlbiBJVCBpcyBhdCBhIHRh Yi13aWR0aCBzcGFjZXIgZm9sbG93aW5nIGEKKyAgICAgIGBidWZmZXItZGlzcGxheS10YWJsZScg Z2x5cGggc3VjaCBhcyDCuy4gIEFub3RoZXIgd2F5IHRvIHRlc3QKKyAgICAgIGZvciB0aGlzIGNv bmRpdGlvbiBpcyB3aGVuIGl0LmMgPT0gRkVUQ0hfQllURSAoSVRfQllURVBPUyAoaXQpKS4gKi8K KyAgICAgIGlmICghcmVhbF9mYWtlX2N1cnNvcl9wCisgICAgICAgICAgJiYgbHB3X3JlYWNoZWRf cAorICAgICAgICAgICYmICF0YWJfaW52aXNpYmxlX3ApCisgICAgICAgIG1jX2Nyb3NzaGFpcnNf aGVscGVyICh3LCByZWxhdGl2ZV94LCBpdC5jdXJyZW50X3ksIGhwb3MsIHZwb3MsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBIQkFSX0NVUlNPUiwgY3Vyc29yX3dpZHRoLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZCwgbWNfYmdfY29sb3JfdmVjdG9yICh3 LCBpdC5mYWNlX2lkKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsYXZvciwgSVRf Q0hBUlBPUyAoaXQpLCAmcmVzdWx0KTsKKyAgICAgIC8qIEZJWE1FOiAgRHJhd2luZyBhIFFtY19n bHlwaCBIQkFSX0NVUlNPUiBvbiBjZXJ0YWluIGxldHRlcnMgKEEsIG0sIE0sIHcs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HsKKyAgICAgICAgICAgICAgbWNfY3Jvc3NoYWlyc19oZWxwZXIgKHcsIHJlbGF0 aXZlX3gsIGl0LmN1cnJlbnRfeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIEhCQVJfQ1VSU09SLCBjdXJzb3Jfd2lkdGgsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kLCBtY19iZ19jb2xvcl92ZWN0b3IgKHcsIGl0 LmZhY2VfaWQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxhdm9yLCBJ VF9DSEFSUE9TIChpdCksICZyZXN1bHQpOworICAgICAgICAgICAgICByZWxhdGl2ZV94ID0gcmVs YXRpdmVfeCArIGZyYW1lX2NoYXJfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAg ICAgIGlmIChmaW5hbF9sb29wX3ApCisgICAgICAgIGJyZWFrOworICAgICAgcmMgPSBtY19tb3Zl X2l0X2luX2Rpc3BsYXlfbGluZSAodywgJml0LCBpdC5jdXJyZW50X3ggKyBpdC5waXhlbF93aWR0 aCk7CisgICAgICBpZiAocmMgPT0gTU9WRV9MSU5FX0NPTlRJTlVFRCkKKyAgICAgICAgYnJlYWs7 CisgICAgICByZWxhdGl2ZV94ID0gKGhzY2wpCisgICAgICAgICAgICAgICAgICAgPyBpdC5jdXJy ZW50X3ggLSAoaHNjbF9maXJzdF9ocG9zICogZnJhbWVfY2hhcl93aWR0aCkKKyAgICAgICAgICAg ICAgICAgICA6IGl0LmN1cnJlbnRfeCAtIGZpcnN0X3g7CisgICAgICBpZiAocmVsYXRpdmVfeCAr IGZyYW1lX2NoYXJfd2lkdGggPj0gdGV4dF9hcmVhX3dpZHRoKQorICAgICAgICBicmVhazsKKyAg ICB9CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqK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ZiB0aGUgZnJhbWUsIGluc3RlYWQgb2YgdGhlIGFjdGl2ZSByZWdpb24u ICBUaGlzIGhhcHBlbnMgYmVjYXVzZSB3ZQorICAgICAgICAgZG8gbm90IGZvcmNlIGBtY19tb3Zl X2l0X2luX2Rpc3BsYXlfbGluZScgdG8ga2VlcCB0cmF2ZWxsaW5nIHRvCisgICAgICAgICBgZmly c3RfeCArIGxudW1fcGl4ZWxfd2lkdGhgLgorICAgICAgLSAgV2hlbiB0aGVyZSBpcyBhbiBpbWFn aW5hcnkgZW1wdHkgbGluZSBhdCB0aGUgZW5kIG9mIHRoZSBidWZmZXIgd2l0aAorICAgICAgICAg bm90aGluZyBvdGhlciB0aGFuIFpWLCB3ZSB3YW50IHRvIHVzZSB0aGUgZnJhbWUgZGVmYXVsdCBm YWNlIGlmIFpWCisgICAgICAgICBpcyBhdCB0aGUgZW5kIG9mIGFuIGFjdGl2ZSByZWdpb24uICAq LworICAgICAgaWYgKChoc2NsCisgICAgICAgICAgICYmIChJVEVSQVRPUl9BVF9FTkRfT0ZfTElO RV9QICgmaXQpCisgICAgICAgICAgICAgICB8fCBGRVRDSF9CWVRFIChJVF9CWVRFUE9TIChpdCkp ID09ICdcbicpCisgICAgICAgICAgICYmIGl0LmN1cnJlbnRfeCAtIGhzY2xfZmlyc3RfeCA9PSBv cG9pbnRfeCkKKyAgICAgICAgICB8fAorICAgICAgICAgICghaHNjbAorICAgICAgICAgICAmJiAo SVRFUkFUT1JfQVRfRU5EX09GX0xJTkVfUCAoJml0KQorICAgICAgICAgICAgICAgfHwgRkVUQ0hf QllURSAoSVRfQllURVBPUyAoaXQpKSA9PSAnXG4nKQorICAgICAgICAgICAmJiBpdC5jdXJyZW50 X3ggLSBmaXJzdF94IDwgbG51bV9waXhlbF93aWR0aCkpCisgICAgICAgIGl0LmZhY2VfaWQgPSBm YWNlX2lkOworICAgICAgICBlbHNlIGlmIChJVF9DSEFSUE9TIChpdCkgPT0gWlYpCisgICAgICAg ICAgaXQuZmFjZV9pZCA9IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgIHdoaWxlIChyZWxhdGl2ZV94 ICsgZnJhbWVfY2hhcl93aWR0aCA8IHRleHRfYXJlYV93aWR0aCkKKyAgICAgICAgeworICAgICAg ICAgIG1jX2Nyb3NzaGFpcnNfaGVscGVyICh3LCByZWxhdGl2ZV94LCBpdC5jdXJyZW50X3ksIGhw b3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhCQVJfQ1VSU09SLCBj dXJzb3Jfd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQs IG1jX2JnX2NvbG9yX3ZlY3RvciAodywgaXQuZmFjZV9pZCksCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIFFtY19nbHlwaGxlc3MsIElUX0NIQVJQT1MgKGl0KSwgJnJlc3VsdCk7Cisg ICAgICAgICAgcmVsYXRpdmVfeCA9IHJlbGF0aXZlX3ggKyBmcmFtZV9jaGFyX3dpZHRoOworICAg ICAgICB9CisgICAgfQorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgIFZFUlRJ Q0FMIFJVTEVSOiAgQ09NQklOQVRJT04gT0YgR0xZUEggJiBHTFlQSExFU1MgQ1VSU09SUworKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisgIHZlcnRpY2FsX3J1bGVyOgorICBpZiAoTklMUCAoQlZB UiAoYiwgY3Jvc3NoYWlyc192ZXJ0aWNhbF9ydWxlcikpKQorICAgIGdvdG8gY3Jvc3NoYWlyc19m aW5pc2g7CisgIFJFU1RPUkVfSVQgKCZpdCwgJnNhdmVkX2l0X2Zvcl93aW5kb3dfc3RhcnQsIHNh dmVkX2l0ZGF0YV9mb3Jfd2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KyAgICAg ICAgZmxhdm9yID0gUW1jX3ZlcnRpY2FsX2Jhcl9yaWdodF9hbmdsZTsKKyAgICAgICAgZWxzZSBp ZiAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICYmIGdseXBoX3Jvdy0+Y29u dGludWVkX3ApCisgICAgICAgICAgZmxhdm9yID0gUW1jX3ZlcnRpY2FsX2Jhcl9iYWNrc2xhc2g7 CisgICAgICAgICAgZWxzZSBpZiAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAg ICAgJiYgIWdseXBoX3Jvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3AKKyAgICAgICAgICAgICAgICAg ICAmJiAhZ2x5cGhfcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgIGZsYXZvciA9IFFtY192 ZXJ0aWNhbF9iYXI7CisgICAgICAgICAgICBlbHNlIGlmICgoRkVUQ0hfQllURSAoSVRfQllURVBP UyAoaXQpKSAhPSAnXG4nCisgICAgICAgICAgICAgICAgICAgICAgLyogV2UgYXJlIGF0IGEgbGlu ZSBmZWVkIGNoYXJhY3RlciBhbmQgdGhlIHZlcnRpY2FsIHJ1bGVyIGludGVyc2VjdHMuICovCisg ICAgICAgICAgICAgICAgICAgICAgfHwgKEZFVENIX0JZVEUgKElUX0JZVEVQT1MgKGl0KSkgPT0g J1xuJworICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByZWxhdGl2ZV94ID09IG9wb2ludF94 KSkKKyAgICAgICAgICAgICAgICAgICAgIC8qIElmIHdlIGFyZSBhdCBaViwgd2Ugd2FudCB0byB1 c2UgYSBnbHlwaGxlc3MgY3Vyc29yIGJlY2F1c2UgaXQgd2lsbAorICAgICAgICAgICAgICAgICAg ICAgbW9zdCBsaWtlbHkgYmUgZmxvYXRpbmcgc29tZXdoZXJlIG9mZiB0byB0aGUgcmlnaHQgb2Yg WlYuICBXZSBjb3VsZAorICAgICAgICAgICAgICAgICAgICAgcHJvYmFibHkgcGxhY2UgYSBnbHlw aCBjdXJzb3IgYXQgZXhhY3RseSBaViBieSBjcmVhdGluZyBhbiBhZGRpdGlvbmFsCisgICAgICAg ICAgICAgICAgICAgICBjb25kaXRpb24gaW4gdGhlIG5leHQgc2VjdGlvbiwgYnV0IGl0IGlzIG5v dCB0aGF0IGltcG9ydGFudC4gKi8KKyAgICAgICAgICAgICAgICAgICAgICYmIHJjICE9IE1PVkVf UE9TX01BVENIX09SX1pWCisgICAgICAgICAgICAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNv cl9wCisgICAgICAgICAgICAgICAgICAgICAmJiBpdC5jICE9ICdcdCcKKyAgICAgICAgICAgICAg ICAgICAgICYmIHJlbGF0aXZlX3ggLyBmcmFtZV9jaGFyX3dpZHRoID49IGxudW1fcGl4ZWxfd2lk dGgKKyAgICAgICAgICAgICAgICAgICAgICYmIHJjICE9IE1PVkVfTElORV9DT05USU5VRUQpCisg ICAgICAgICAgICAgIGZsYXZvciA9IFFtY19nbHlwaDsKKyAgICAgICAgICAgICAgZWxzZSBpZiAo aXQuYyA9PSAnXHQnKQorICAgICAgICAgICAgICAgIGZsYXZvciA9IFFtY19nbHlwaF90YWI7Cisg ICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIGZsYXZvciA9IFFtY19n bHlwaGxlc3M7CisgICAgICAvKiBDT1JORVIgQ0FTRVM6CisgICAgICAtICBXaGVuIHRoZSB2ZXJ0 aWNhbCBsaW5lIGlzIHRvIHRoZSBsZWZ0IG9mIHRoZSB0ZXh0IGFuZCBqdXN0IHRvIHRoZSByaWdo dAorICAgICAgICAgb2YgdGhlIGxpbmUgbnVtYmVycywgd2Ugd2FudCB0aGUgZGVmYXVsdCBmYWNl LgorICAgICAgLSAgV2hlbiB0aGVyZSBpcyBhbiBpbWFnaW5hcnkgZW1wdHkgbGluZSBhdCB0aGUg ZW5kIG9mIHRoZSBidWZmZXIgd2l0aAorICAgICAgICAgbm90aGluZy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FIG9mIHN1cHByZXNzaW5nIHRoZSBsaW5lIG51bWJlcnMgaW4gdGhpcyBz aXR1YXRpb24sIHdlIGRyYXcKKyAgICAgIGNyb3NzaGFpcnMgaW4gdGhhdCBzaXR1YXRpb24uICBg bWNfbW92ZV9pdF9pbl9kaXNwbGF5X2xpbmUnIGhhcyBiZWVuCisgICAgICBlcXVpcHBlZCB3aXRo IGEgY29uZGl0aW9uIHRvIHRlc3QgZm9yIFpWIGF0IHRoZSBvdXRzZXQgYW5kIHJldHVybiBpZiB0 cnVlLAorICAgICAgd2hpY2ggcHJldmVudHMgRW1hY3MgZnJvbSBjcmFzaGluZy4gKi8KKyAgICAg IGlmIChJVF9DSEFSUE9TIChpdCkgPT0gWlYpCisgICAgICAgIGJyZWFrOworICAgICAgbW92ZV9p dF9ieV9saW5lcyAoJml0LCAxKTsKKyAgICAgIGlmIChpdC5jdXJyZW50X3kgPj0gaXQubGFzdF92 aXNpYmxlX3kpCisgICAgICAgIGJyZWFrOworICAgIH0KKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTRVQgVEhFIENBQ0hFCisqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKyAgY3Jvc3NoYWlyc19maW5pc2g6CisgIGlmICghTklMUCAocmVz dWx0KSkKKyAgICB3c2V0X2Nyb3NzaGFpcnNfY2FjaGUgKHcsIGxpc3RuIChDT05TVFlQRV9IRUFQ LCAzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZyZXZlcnNlIChyZXN1 bHQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZjb25zIChzZWxlY3Rl ZF93aW5kb3csIFFuaWwpLAorICAgICAgICAgICAgICAgICAgIC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3IgKHZsaXN0ID0gWENBUiAody0+Y3Jvc3NoYWlyc19jYWNoZSk7CisgICAgICAgQ09OU1AgKHZs aXN0KTsKKyAgICAgICB2bGlzdCA9IFhDRFIgKHZsaXN0KSkKKyAgICB7CisgICAgICBzcGVjcyA9 IFhDQVIgKHZsaXN0KTsKKyAgICAgIHggPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMCksIHNw ZWNzKSk7CisgICAgICB5ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDEpLCBzcGVjcykpOwor ICAgICAgaHBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgc3BlY3MpKTsKKyAgICAg IHZwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMyksIHNwZWNzKSk7CisgICAgICBjdXJz b3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKEZudGggKG1ha2VfbnVtYmVyICg0KSwg c3BlY3MpKTsKKyAgICAgIGN1cnNvcl93aWR0aCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICg1 KSwgc3BlY3MpKTsKKyAgICAgIGZvcmVncm91bmQgPSBGbnRoIChtYWtlX251bWJlciAoNiksIHNw ZWNzKTsKKyAgICAgIGJhY2tncm91bmQgPSBGbnRoIChtYWtlX251bWJlciAoNyksIHNwZWNzKTsK KyAgICAgIGZsYXZvciA9IEZudGggKG1ha2VfbnVtYmVyICg4KSwgc3BlY3MpOworICAgICAgcG9z ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDkpLCBzcGVjcykpOworICAgICAgbWNfZHJhd19l cmFzZV9oeWJyaWQgKHcsIHgsIHksIGhwb3MsIHZwb3MsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lk dGgsIGZvcmVncm91bmQsIGZsYXZvcik7CisgICAgfQorLyoKKyNpZmRlZiBHTFlQSF9ERUJVRwor ICBlbmQgPSBjbG9jaygpOworICBjcHVfdGltZV91c2VkID0gKChkb3VibGU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ICBJIHRyaWVkIHJlc3RvcmluZyBwb2ludCBhZnRlciBkcmF3L2VyYXNlLAorICBidXQgdGhhdCBk aWRuJ3QgZml4IHRoZSBpc3N1ZS4gIFNvIGZvciBub3csIHdlIGp1c3QgZXJhc2UgdGhlIHJlYWwg Y3Vyc29yLiAqLworICBtY19lcmFzZV9nbHlwaF9jdXJzb3IgKHcsIHctPnBoeXNfY3Vyc29yLngs IHctPnBoeXNfY3Vyc29yLnksIHctPnBoeXNfY3Vyc29yLmhwb3MsCisgICAgICAgICAgICAgICAg ICAgICAgICAgdy0+cGh5c19jdXJzb3IudnBvcywgdy0+cGh5c19jdXJzb3JfdHlwZSk7CisgIGZv ciAodmxpc3QgPSBYQ0FSICh3LT5jcm9zc2hhaXJzX2NhY2hlKTsKKyAgICAgICBDT05TUCAodmxp c3QpOworICAgICAgIHZsaXN0ID0gWENEUiAodmxpc3QpKQorICAgIHsKKyAgICAgIHNwZWNzID0g WENBUiAodmxpc3QpOworICAgICAgeCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgwKSwgc3Bl Y3MpKTsKKyAgICAgIHkgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMSksIHNwZWNzKSk7Cisg ICAgICBocG9zID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDIpLCBzcGVjcykpOworICAgICAg dnBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgzKSwgc3BlY3MpKTsKKyAgICAgIGN1cnNv cl90eXBlID0gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoRm50aCAobWFrZV9udW1iZXIgKDQpLCBz cGVjcykpOworICAgICAgY3Vyc29yX3dpZHRoID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDUp LCBzcGVjcykpOworICAgICAgZm9yZWdyb3VuZCA9IEZudGggKG1ha2VfbnVtYmVyICg2KSwgc3Bl Y3MpOworICAgICAgYmFja2dyb3VuZCA9IEZudGggKG1ha2VfbnVtYmVyICg3KSwgc3BlY3MpOwor ICAgICAgZmxhdm9yID0gRm50aCAobWFrZV9udW1iZXIgKDgpLCBzcGVjcyk7CisgICAgICBwb3Mg PSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoOSksIHNwZWNzKSk7CisgICAgICBpZiAoRVEgKGZs YXZvciwgUW1jX2dseXBoKSkKKyAgICAgICAgbWNfZXJhc2VfZ2x5cGhfY3Vyc29yICh3LCB4LCB5 LCBocG9zLCB2cG9zLCBjdXJzb3JfdHlwZSk7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAg eworICAgICAgICAgICAgICBpZiAoRVEgKGZsYXZvciwgUW92ZXJsYXlfYXJyb3dfYml0bWFwKQor ICAgICAgICAgICAgICAgICAgfHwgRVEgKGZsYXZvciwgUW1jX2hvbGxvd19yZWN0YW5nbGVfcmln aHRfYW5nbGUpCisgICAgICAgICAgICAgICAgICB8fCBFUSAoZmxhdm9yLCBRbWNfaG9sbG93X3Jl Y3RhbmdsZSkKKyAgICAgICAgICAgICAgICAgIHx8IEVRIChmbGF2b3IsIFFtY192ZXJ0aWNhbF9i YXJfcmlnaHRfYW5nbGUpCisgICAgICAgICAgICAgICAgICB8fCBFUSAoZmxhdm9yLCBRbWNfdmVy dGljYWxfYmFyKQorICAgICAgICAgICAgICAgICAgfHwgRVEgKGZsYXZvciwgUW1jX3ZlcnRpY2Fs X2Jhcl9iYWNrc2xhc2gpKQorICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlID0gTk9fQ1VSU09S OworICAgICAgICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgeCwgeSwgaHBvcywgdnBv cywgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgYmFja2dyb3VuZCwgZmxhdm9yKTsKKyAgICAg ICAgICAgIH0KKyAgICB9CisgIGlmIChkZWxldGVfY2FjaGUpCisgICAgd3NldF9jcm9zc2hhaXJz X2NhY2hlICh3LCBRbmlsKTsKKyAgdy0+bWMuZXJhc2VfY3Jvc3NoYWlycyA9IGZhbHNlOworLyoK KyNpZmRlZiBHTFlQSF9ERUJVRworICBlbmQgPSBjbG9jaygpOworICBjcHVfdGltZV91c2VkID0g KChkb3VibGUpIChlbmQgLSBzdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7CisgIGR0b2FzdHIgKGJ1 Zl90aW1lLCBzaXplb2YgYnVmX3RpbWUsIDAsIDAsIGNwdV90aW1lX3VzZWQpOworICBkZWJ1Z19t ZXRob2RfYWRkICh3LCAibWNfZXJhc2VfY3Jvc3NoYWlyczogIFRJTUUgKCVzKSIsIGJ1Zl90aW1l KTsKKyNlbmRpZgorKi8KK30KKwordm9pZAorbWNfcG9ydGFsIChzdHJ1Y3Qgd2luZG93ICp3LCBi b29sIGN1cnNvcl9vbl9wKQoreworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBNVUxUSVBMRSBDVVJTT1JTCisqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKyAgaWYgKCFNSU5JX1dJTkRPV19QICh3KQorICAgICAgJiYgdy0+bWMuZXJhc2VfZ2x5 cGhfY3Vyc29yCisgICAgICAmJiAhTklMUCAody0+bWNfZ2x5cGhfY2FjaGUpCisgICAgICAmJiBF USAody0+Y29udGVudHMsIFhDQVIgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgdy0+bWNfZ2x5cGhf Y2FjaGUpKSkpCisgICAgbWNfY2FsYyAodywgMSk7CisgIGlmICh3ID09IFhXSU5ET1cgKHNlbGVj dGVkX3dpbmRvdykKKyAgICAgICYmIFdJTkRPV19WQUxJRF9QIChzZWxlY3RlZF93aW5kb3cpCisg ICAgICAmJiAhTUlOSV9XSU5ET1dfUCAodykKKyAgICAgICYmIHctPm1jLmRyYXdfZ2x5cGhfY3Vy c29yCisgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19nbHlw aF9saXN0KSkpCisgICAgLyogRHJhdyBmYWtlIGN1cnNvcnMgKi8KKyAgICBtY19jYWxjICh3LCAw KTsKKyAgICAvKiBGaXJzdCBhdHRlbXB0IGF0IGRlYWxpbmcgd2l0aCBhIGByZWRpc3BsYXlfcHJl c2VydmVfZWNob19hcmVhJyBzaXR1YXRpb24uICovCisgICAgZWxzZSBpZiAoIU1JTklfV0lORE9X X1AgKHcpCisgICAgICAgICAgICAgJiYgIXctPm1jLmRyYXdfZ2x5cGhfY3Vyc29yCisgICAgICAg ICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfZ2x5cGhfbGlz dCkpCisgICAgICAgICAgICAgJiYgIU5JTFAgKHctPm1jX2dseXBoX2NhY2hlKQorICAgICAgICAg ICAgICYmIEVRICh3LT5jb250ZW50cywgWENBUiAoRm50aCAobWFrZV9udW1iZXIgKDIpLCB3LT5t Y19nbHlwaF9jYWNoZSkpKSkKKyAgICAgIHsKKyAgICAgICAgLyogUmVtb3ZlIGZha2UgY3Vyc29y cy4gKi8KKyAgICAgICAgbWNfY2FsYyAodywgMSk7CisgICAgICAgIC8qIERyYXcgZmFrZSBjdXJz b3JzICovCisgICAgICAgIG1jX2NhbGMgKHcsIDApOworICAgICAgfQorLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDUk9TU0hBSVJTCisqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKyAgLyogUmVtb3ZlIGNyb3NzaGFpcnMgYW5kIGRlbGV0ZSB0 aGUgY2FjaGUsIGJ1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RPX1ggfCBNT1ZFX1RPX1kpOworICB0YXJnZXRfeCA9IGl0LmN1cnJlbnRfeDsKKyAgbW92 ZV9pdF9ieV9saW5lcyAoJml0LCAwKTsKKyAgcmMgPSBtY19tb3ZlX2l0X2luX2Rpc3BsYXlfbGlu ZSAodywgJml0LCB0YXJnZXRfeCk7CisgIGJpZGlfdW5zaGVsdmVfY2FjaGUgKGl0ZGF0YSwgZmFs c2UpOworICByZXR1cm4gbWFrZV9udW1iZXIgKHJjKTsKK30KKworLyogRU5EIG11bHRpcGxlIGN1 cnNvcnMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwogCiAMCiAvKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioK QEAgLTE0MTYyLDYgKzE1NzAyLDE5IEBAIHJlZGlzcGxheV9pbnRlcm5hbCAodm9pZCkKICNpZmRl ZiBIQVZFX1dJTkRPV19TWVNURU0KIAkgICAgICB1cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIGZh bHNlKTsKICNlbmRpZgorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIG11bHRpcGxlIGN1 cnNvcnMgKi8KKworLyogTk9URTogIEFuIGlkbGUtdGltZXIgZnVuY3Rpb24gbWF5IG5vdCBuZWNl c3NhcmlseSB0cmlnZ2VyIGByZWRpc3BsYXlfd2luZG93Jy4KK2BvcHRpbWl6YXRpb24gMWAgKHdo aWNoIGluY2x1ZGVzIGxlZnQvcmlnaHQgY3Vyc29yIG1vdmVtZW50IG9uIHRoZSBmaXJzdCBzY3Jl ZW4KK2xpbmUpLCBhbmQgYG9wdGltaXphdGlvbiAzYCAod2hpY2ggaW5jbHVkZXMgbGVmdC9yaWdo dCBjdXJzb3IgbW92ZW1lbnQgb24gc2NyZWVuCitsaW5lcyBzdWJzZXF1ZW50IHRvIHRoZSBmaXJz dCBzY3JlZW4gbGluZSksIGJ5cGFzcyBgcmVkaXNwbGF5X3dpbmRvdycuICovCisKKyAgICAgIG1j X3JlbW92ZV9ldmVyeXRoaW5nICh3KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKIAkg ICAgICBnb3RvIHVwZGF0ZTsKIAkgICAgfQogCSAgZWxzZQpAQCAtMTQxODQsNiArMTU3MzcsMTYg QEAgcmVkaXNwbGF5X2ludGVybmFsICh2b2lkKQogCQkgICYmICh3ID0gWFdJTkRPVyAoc2VsZWN0 ZWRfd2luZG93KSkgIT0gc3cpCiAJCWdvdG8gcmV0cnk7CiAKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBtdWx0aXBsZSBjdXJzb3JzICovCisKKyAgICAgICBpZiAobWNfd2l0aG91dF91 cGRhdGVfZnJhbWUgKHcpKQorICAgICAgICAgZ290byBlbmRfb2ZfcmVkaXNwbGF5OworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAJICAgICAgLyogV2UgdXNlZCB0byBhbHdheXMgZ290 byBlbmRfb2ZfcmVkaXNwbGF5IGhlcmUsIGJ1dCB0aGlzCiAJCSBpc24ndCBlbm91Z2ggaWYgd2Ug aGF2ZSBhIGJsaW5raW5nIGN1cnNvci4gICovCiAJICAgICAgaWYgKHctPmN1cnNvcl9vZmZfcCA9 PSB3LT5sYXN0X2N1cnNvcl9vZmZfcCkKQEAgLTE0MjI1LDYgKzE1Nzg4LDE5IEBAIHJlZGlzcGxh eV9pbnRlcm5hbCAodm9pZCkKIAkJICAqdy0+ZGVzaXJlZF9tYXRyaXgtPm1ldGhvZCA9IDA7CiAJ CSAgZGVidWdfbWV0aG9kX2FkZCAodywgIm9wdGltaXphdGlvbiAzIik7CiAjZW5kaWYKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBtdWx0aXBsZSBjdXJzb3JzICovCisKKy8qIE5PVEU6 ICBBbiBpZGxlLXRpbWVyIGZ1bmN0aW9uIG1heSBub3QgbmVjZXNzYXJpbHkgdHJpZ2dlciBgcmVk aXNwbGF5X3dpbmRvdycuCitgb3B0aW1pemF0aW9uIDFgICh3aGljaCBpbmNsdWRlcyBsZWZ0L3Jp Z2h0IGN1cnNvciBtb3ZlbWVudCBvbiB0aGUgZmlyc3Qgc2NyZWVuCitsaW5lKSwgYW5kIGBvcHRp bWl6YXRpb24gM2AgKHdoaWNoIGluY2x1ZGVzIGxlZnQvcmlnaHQgY3Vyc29yIG1vdmVtZW50IG9u IHNjcmVlbgorbGluZXMgc3Vic2VxdWVudCB0byB0aGUgZmlyc3Qgc2NyZWVuIGxpbmUpLCBieXBh c3MgYHJlZGlzcGxheV93aW5kb3cnLiAqLworCisgICAgICBtY19yZW1vdmVfZXZlcnl0aGluZyAo dyk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCiAJCSAgZ290byB1cGRhdGU7CiAJCX0K IAkgICAgICBlbHNlCkBAIC0xNDM1OCw2ICsxNTkzNCwxOCBAQCByZWRpc3BsYXlfaW50ZXJuYWwg KHZvaWQpCiAJCSAgICB1bnJlcXVlc3Rfc2lnaW8gKCk7CiAJCSAgU1RPUF9QT0xMSU5HOwogCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqK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ioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogQkVHSU4g bXVsdGlwbGUgY3Vyc29ycyAqLworCisvKiBOT1RFOiAgQW4gaWRsZS10aW1lciBmdW5jdGlvbiBt YXkgbm90IG5lY2Vzc2FyaWx5IHRyaWdnZXIgYHJlZGlzcGxheV93aW5kb3cnLgorYG9wdGltaXph dGlvbiAxYCAod2hpY2ggaW5jbHVkZXMgbGVmdC9yaWdodCBjdXJzb3IgbW92ZW1lbnQgb24gdGhl IGZpcnN0IHNjcmVlbgorbGluZSksIGFuZCBgb3B0aW1pemF0aW9uIDNgICh3aGljaCBpbmNsdWRl cyBsZWZ0L3JpZ2h0IGN1cnNvciBtb3ZlbWVudCBvbiBzY3JlZW4KK2xpbmVzIHN1YnNlcXVlbnQg dG8gdGhlIGZpcnN0IHNjcmVlbiBsaW5lKSwgYnlwYXNzIGByZWRpc3BsYXlfd2luZG93Jy4gKi8K KworICBtY19yZWNvcmRfeF93c3RhcnRfd2VuZCAodyk7CisKKyAgbWNfcmVtb3ZlX2V2ZXJ5dGhp bmcgKHcpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwogICBzZXRfYnVmZmVyX2ludGVy bmFsXzEgKG9sZCk7CiAgIC8qIEF2b2lkIGFuIGFib3J0IGluIFRFTVBfU0VUX1BUX0JPVEggaWYg dGhlIGJ1ZmZlciBoYXMgYmVjb21lCiAgICAgIHNob3J0ZXIuICBUaGlzIGNhbiBiZSBjYXVzZWQg YnkgbG9nIHRydW5jYXRpb24gaW4gKk1lc3NhZ2VzKi4gICovCkBAIC0yNDY0MCw2ICsyNjI0Miwy NSBAQCBkZWNvZGVfbW9kZV9zcGVjIChzdHJ1Y3Qgd2luZG93ICp3LCByZWdpc3RlciBpbnQgYywg aW50IGZpZWxkX3dpZHRoLAogCSAgcmV0dXJuICJAIjsKICAgICAgIH0KIAorLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBtdWx0aXBsZSBjdXJzb3JzICovCisKKyAgICBjYXNlICd3JzoKKyAg ICAgIHsKKyAgcHRyZGlmZl90IHdpbmRvd19zdGFydCA9IG1hcmtlcl9wb3NpdGlvbiAody0+c3Rh cnQpOworICBwaW50MnN0ciAoZGVjb2RlX21vZGVfc3BlY19idWYsIHdpZHRoLCB3aW5kb3dfc3Rh cnQpOworICByZXR1cm4gZGVjb2RlX21vZGVfc3BlY19idWY7CisgICAgICB9CisKKyAgICBjYXNl ICdXJzoKKyAgICAgIHsKKyAgcHRyZGlmZl90IHdpbmRvd19lbmQgPSBCVUZfWiAoYikgLSB3LT53 aW5kb3dfZW5kX3BvczsKKyAgcGludDJzdHIgKGRlY29kZV9tb2RlX3NwZWNfYnVmLCB3aWR0aCwg d2luZG93X2VuZCk7CisgIHJldHVybiBkZWNvZGVfbW9kZV9zcGVjX2J1ZjsKKyAgICAgIH0KKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKICAgICBjYXNlICd6JzoKICAgICAgIC8qIGNvZGlu Zy1zeXN0ZW0gKG5vdCBpbmNsdWRpbmcgZW5kLW9mLWxpbmUgZm9ybWF0KSAqLwogICAgIGNhc2Ug J1onOgpAQCAtMjk1MDYsOSArMzExMjcsMTkgQEAgZGlzcGxheV9hbmRfc2V0X2N1cnNvciAoc3Ry dWN0IHdpbmRvdyAqdywgYm9vbCBvbiwKICAgICAgIHctPnBoeXNfY3Vyc29yLnZwb3MgPSB2cG9z OwogICAgIH0KIAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBtdWx0aXBsZSBjdXJzb3Jz ICovCisKKyAgTGlzcF9PYmplY3QgY29sb3JfdmVjdG9yID0gKEZtYWtlX3ZlY3RvciAobWFrZV9u dW1iZXIgKDMpLCBRbmlsKSk7CisgIEFTRVQgKGNvbG9yX3ZlY3RvciwgMCwgbWFrZV9mbG9hdCAo LTEuMCkpOworICBBU0VUIChjb2xvcl92ZWN0b3IsIDEsIG1ha2VfZmxvYXQgKC0xLjApKTsKKyAg QVNFVCAoY29sb3JfdmVjdG9yLCAyLCBtYWtlX2Zsb2F0ICgtMS4wKSk7CiAgIEZSQU1FX1JJRiAo ZiktPmRyYXdfd2luZG93X2N1cnNvciAodywgZ2x5cGhfcm93LCB4LCB5LAogICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19jdXJzb3JfdHlwZSwgbmV3X2N1cnNvcl93aWR0 aCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbiwgYWN0aXZlX2N1cnNv cik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb24sIGFjdGl2ZV9jdXJz b3IsIGNvbG9yX3ZlY3RvciwgUW5pbCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCiB9 CiAKIApAQCAtMjk1NDAsMTAgKzMxMTcxLDI4IEBAIHVwZGF0ZV93aW5kb3dfY3Vyc29yIChzdHJ1 Y3Qgd2luZG93ICp3LCBib29sIG9uKQogICAgICAgaWYgKHJvdy0+cmV2ZXJzZWRfcCAmJiBocG9z ID49IHJvdy0+dXNlZFtURVhUX0FSRUFdKQogCWhwb3MgPSByb3ctPnVzZWRbVEVYVF9BUkVBXSAt IDE7CiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogbXVsdGlwbGUgY3Vyc29ycyAqLwor CisgICAgICAvKiBNb3ZpbmcgdGhlIG1vdXNlIHRyaWdnZXJzIGB1cGRhdGVfd2luZG93X2N1cnNv cicgd2hpY2ggY2FsbHMKKyAgICAgIGBkaXNwbGF5X2FuZF9zZXRfY3Vyc29yJyB0aGF0IHdvdWxk IG90aGVyd2lzZSByZW1vdmUgYSBwb3J0aW9uIG9mIHRoZQorICAgICAgaG9yaXpvbnRhbCBydWxl ciBmcm9tIHBvaW50IGF0IGVuZCBvZiB2aXN1YWwgbGluZSB0byB3aW5kb3cgZWRnZS4gKi8KKyAg ICAgIGJvb2wgY3Jvc3NoYWlyc19wID0gKCFNSU5JX1dJTkRPV19QICh3KQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgIXctPm1jLmRyYXdfY3Jvc3NoYWlycworICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgIU5JTFAgKHctPmNyb3NzaGFpcnNfY2FjaGUpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9z c2hhaXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHcgPT0gWFdJTkRPVyAoWENB UiAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB3LT5jcm9zc2hhaXJzX2NhY2hlKSkpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBFUSAody0+Y29udGVudHMsIFhDQVIgKEZudGggKG1ha2Vf bnVtYmVyICgyKSwgdy0+Y3Jvc3NoYWlyc19jYWNoZSkpKSk7CisgICAgICBpZiAoIWNyb3NzaGFp cnNfcCkKKyAgICAgICAgewogICAgICAgYmxvY2tfaW5wdXQgKCk7CiAgICAgICBkaXNwbGF5X2Fu ZF9zZXRfY3Vyc29yICh3LCBvbiwgaHBvcywgdnBvcywKIAkJCSAgICAgIHctPnBoeXNfY3Vyc29y LngsIHctPnBoeXNfY3Vyc29yLnkpOwogICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAg fQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwogICAgIH0KIH0KIApAQCAtMzIyNTQsNiAr MzM5MDMsMjYgQEAgeF9pbnRlcnNlY3RfcmVjdGFuZ2xlcyAoWFJlY3RhbmdsZSAqcjEsIFhSZWN0 YW5nbGUgKnIyLCBYUmVjdGFuZ2xlICpyZXN1bHQpCiB2b2lkCiBzeW1zX29mX3hkaXNwICh2b2lk KQogeworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIEJFR0lOIG11bHRpcGxlIGN1cnNv cnMgKi8KKworICBERUZTWU0gKFFtY19nbHlwaCwgIm1jLWdseXBoLWN1cnNvciIpOworICBERUZT WU0gKFFtY19nbHlwaGxlc3MsICJtYy1nbHlwbGVzcy1jdXJzb3IiKTsKKyAgREVGU1lNIChRbWNf Z2x5cGhfdGFiLCAibWMtZ2x5cGgtdGFiIik7CisKKyAgZGVmc3ViciAoJlNtY19hY3RpdmF0ZV9j dXJzb3JzKTsKKyAgREVGU1lNIChRbWNfYWN0aXZhdGVfY3Vyc29ycywgIm1jLWFjdGl2YXRlLWN1 cnNvcnMiKTsKKworICBkZWZzdWJyICgmU21jX2FjdGl2YXRlX2Nyb3NzaGFpcnMpOworICBERUZT WU0gKFFtY19hY3RpdmF0ZV9jcm9zc2hhaXJzLCAibWMtYWN0aXZhdGUtY3Jvc3NoYWlycyIpOwor CisgIGRlZnN1YnIgKCZTYnVnXzI4OTM2KTsKKyAgREVGU1lNIChRYnVnXzI4OTM2LCAiYnVnLTI4 OTM2Iik7CisKKy8qIEVORCBtdWx0aXBsZSBjdXJzb3JzICovCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqK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WUgPSBRd2luZG93X2RpdmlkZXJfZmlyc3RfcGl4ZWw7CWJyZWFrOwogICAgIGNhc2UgV0lORE9X X0RJVklERVJfTEFTVF9QSVhFTF9GQUNFX0lEOgluYW1lID0gUXdpbmRvd19kaXZpZGVyX2xhc3Rf cGl4ZWw7CWJyZWFrOwpkaWZmIC0tZ2l0IGEvc3JjL3h0ZXJtLmMgYi9zcmMveHRlcm0uYwppbmRl eCBlNDIyMTY4Li4xM2M1ZGJjIDEwMDY0NAotLS0gYS9zcmMveHRlcm0uYworKysgYi9zcmMveHRl cm0uYwpAQCAtMTE2MywxMCArMTE2MywxMiBAQCB4X3VwZGF0ZV93aW5kb3dfZW5kIChzdHJ1Y3Qg d2luZG93ICp3LCBib29sIGN1cnNvcl9vbl9wLAogICAgIHsKICAgICAgIGJsb2NrX2lucHV0ICgp OwogCi0gICAgICBpZiAoY3Vyc29yX29uX3ApCi0JZGlzcGxheV9hbmRfc2V0X2N1cnNvciAodywg dHJ1ZSwKLQkJCQl3LT5vdXRwdXRfY3Vyc29yLmhwb3MsIHctPm91dHB1dF9jdXJzb3IudnBvcywK LQkJCQl3LT5vdXRwdXRfY3Vyc29yLngsIHctPm91dHB1dF9jdXJzb3IueSk7CisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIG11bHRpcGxlIGN1cnNvcnMgKi8KKworICAgICAgbWNfcG9ydGFs ICh3LCBjdXJzb3Jfb25fcCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwogCiAgICAgICBp ZiAoZHJhd193aW5kb3dfZnJpbmdlcyAodywgdHJ1ZSkpCiAJewpAQCAtMTU1MCwxMCArMTU1Miwx NyBAQCBzdGF0aWMgdm9pZCB4X2NoZWNrX2ZvbnQgKHN0cnVjdCBmcmFtZSAqLCBzdHJ1Y3QgZm9u dCAqKTsKIHN0YXRpYyB2b2lkCiB4X3NldF9jdXJzb3JfZ2MgKHN0cnVjdCBnbHlwaF9zdHJpbmcg KnMpCiB7Ci0gIGlmIChzLT5mb250ID09IEZSQU1FX0ZPTlQgKHMtPmYpCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIG11bHRpcGxlIGN1cnNvcnMgKi8KKworICBzdHJ1Y3Qgd2luZG93ICp3 ID0gZGVjb2RlX2xpdmVfd2luZG93IChzZWxlY3RlZF93aW5kb3cpOworICBpZiAoKHMtPmZvbnQg PT0gRlJBTUVfRk9OVCAocy0+ZikKICAgICAgICYmIHMtPmZhY2UtPmJhY2tncm91bmQgPT0gRlJB TUVfQkFDS0dST1VORF9QSVhFTCAocy0+ZikKICAgICAgICYmIHMtPmZhY2UtPmZvcmVncm91bmQg PT0gRlJBTUVfRk9SRUdST1VORF9QSVhFTCAocy0+ZikKICAgICAgICYmICFzLT5jbXApCisgICAg ICB8fCB3LT5tYy5jdXJzb3JfZ2NfZGVmYXVsdCkKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CiAgICAgcy0+Z2MgPSBzLT5mLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2M7CiAgIGVsc2UKICAg ICB7CkBAIC05MzEwLDcgKzkzMTksMTYgQEAgeF9kcmF3X2Jhcl9jdXJzb3IgKHN0cnVjdCB3aW5k b3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgaW50IHdpZHRoLCBlbnVtIHRleHQKIAkgaW52 aXNpYmxlLiAgVXNlIHRoZSBnbHlwaCdzIGZvcmVncm91bmQgY29sb3IgaW5zdGVhZCBpbiB0aGlz CiAJIGNhc2UsIG9uIHRoZSBhc3N1bXB0aW9uIHRoYXQgdGhlIGdseXBoJ3MgY29sb3JzIGFyZSBj aG9zZW4gc28KIAkgdGhhdCB0aGUgZ2x5cGggaXMgbGVnaWJsZS4gICovCi0gICAgICBpZiAoZmFj ZS0+YmFja2dyb3VuZCA9PSBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwpCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogbXVsdGlwbGUgY3Vyc29ycyAqLworCisgICAgICBpZiAo ZmFjZS0+YmFja2dyb3VuZCA9PSBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwKKyAgICAg ICAgICAmJiAhdy0+bWMuY3Vyc29yX2djX2ludmlzaWJsZV9va2F5KQorCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCiAJeGdjdi5iYWNrZ3JvdW5kID0geGdjdi5mb3JlZ3JvdW5kID0gZmFj ZS0+Zm9yZWdyb3VuZDsKICAgICAgIGVsc2UKIAl4Z2N2LmJhY2tncm91bmQgPSB4Z2N2LmZvcmVn cm91bmQgPSBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWw7CkBAIC05Mzk4LDcgKzk0MTYs MTMgQEAgeF9jbGVhcl9mcmFtZV9hcmVhIChzdHJ1Y3QgZnJhbWUgKmYsIGludCB4LCBpbnQgeSwg aW50IHdpZHRoLCBpbnQgaGVpZ2h0KQogc3RhdGljIHZvaWQKIHhfZHJhd193aW5kb3dfY3Vyc29y IChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpnbHlwaF9yb3csIGludCB4LAog CQkgICAgICBpbnQgeSwgZW51bSB0ZXh0X2N1cnNvcl9raW5kcyBjdXJzb3JfdHlwZSwKLQkJICAg ICAgaW50IGN1cnNvcl93aWR0aCwgYm9vbCBvbl9wLCBib29sIGFjdGl2ZV9wKQorLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBtdWx0aXBsZSBjdXJzb3JzICovCisKKyAgaW50IGN1cnNvcl93 aWR0aCwgYm9vbCBvbl9wLCBib29sIGFjdGl2ZV9wLAorICBMaXNwX09iamVjdCBjb2xvcl92ZWN0 b3IsIExpc3BfT2JqZWN0IGZsYXZvcikKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCiB7CiAg IHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7CiAKQEAgLTk0MTcs MzEgKzk0NDEsMTI0IEBAIHhfZHJhd193aW5kb3dfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBz dHJ1Y3QgZ2x5cGhfcm93ICpnbHlwaF9yb3csIGludCB4LAogCX0KICAgICAgIGVsc2UKIAl7Ci0J ICBzd2l0Y2ggKGN1cnNvcl90eXBlKQotCSAgICB7Ci0JICAgIGNhc2UgSE9MTE9XX0JPWF9DVVJT T1I6Ci0JICAgICAgeF9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIGdseXBoX3Jvdyk7Ci0JICAgICAg YnJlYWs7CiAKLQkgICAgY2FzZSBGSUxMRURfQk9YX0NVUlNPUjoKLQkgICAgICBkcmF3X3BoeXNf Y3Vyc29yX2dseXBoICh3LCBnbHlwaF9yb3csIERSQVdfQ1VSU09SKTsKLQkgICAgICBicmVhazsK LQotCSAgICBjYXNlIEJBUl9DVVJTT1I6Ci0JICAgICAgeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIGds eXBoX3JvdywgY3Vyc29yX3dpZHRoLCBCQVJfQ1VSU09SKTsKLQkgICAgICBicmVhazsKLQotCSAg ICBjYXNlIEhCQVJfQ1VSU09SOgotCSAgICAgIHhfZHJhd19iYXJfY3Vyc29yICh3LCBnbHlwaF9y b3csIGN1cnNvcl93aWR0aCwgSEJBUl9DVVJTT1IpOwotCSAgICAgIGJyZWFrOwotCi0JICAgIGNh c2UgTk9fQ1VSU09SOgotCSAgICAgIHctPnBoeXNfY3Vyc29yX3dpZHRoID0gMDsKLQkgICAgICBi cmVhazsKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogQkVHSU4gbXVsdGlwbGUgY3Vyc29y cyAqLworICBkb3VibGUgcmVkID0gWEZMT0FUX0RBVEEgKEFSRUYgKGNvbG9yX3ZlY3RvciwgMCkp OworICBkb3VibGUgZ3JlZW4gPSBYRkxPQVRfREFUQSAoQVJFRiAoY29sb3JfdmVjdG9yLCAxKSk7 CisgIGRvdWJsZSBibHVlID0gWEZMT0FUX0RBVEEgKEFSRUYgKGNvbG9yX3ZlY3RvciwgMikpOwor ICBzd2l0Y2ggKGN1cnNvcl90eXBlKQorICB7CisgICAgY2FzZSBIT0xMT1dfQk9YX0NVUlNPUjoK KyAgICB7CisgICAgICBpZiAocmVkID49IDAgJiYgYmx1ZSA+PSAwICYmIGdyZWVuID49IDApCisg ICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3Bp eGVsJy4gICovCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUg KFdJTkRPV19GUkFNRSAodykpOworICAgICAgICAgIHN0cnVjdCB4X2Rpc3BsYXlfaW5mbyAqZHB5 aW5mbyA9IEZSQU1FX0RJU1BMQVlfSU5GTyAoZik7CisgICAgICAgICAgdW5zaWduZWQgbG9uZyBv cmlnX3ZhbCA9IGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbDsKKyAgICAgICAgICBpbnQg aW50X3JlZCA9IHJlZCAqIDY1NTM1OworICAgICAgICAgIGludCBpbnRfZ3JlZW4gPSBncmVlbiAq IDY1NTM1OworICAgICAgICAgIGludCBpbnRfYmx1ZSA9IGJsdWUgKiA2NTUzNTsKKyAgICAgICAg ICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSB4X21ha2VfdHJ1ZWNvbG9yX3BpeGVs IChkcHlpbmZvLCBpbnRfcmVkLCBpbnRfZ3JlZW4sIGludF9ibHVlKTsKKyAgICAgICAgICB4X2Ry YXdfaG9sbG93X2N1cnNvciAodywgZ2x5cGhfcm93KTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0 YS54LT5jdXJzb3JfcGl4ZWwgPSBvcmlnX3ZhbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisg ICAgICAgICAgeF9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIGdseXBoX3Jvdyk7CisgICAgICBicmVh azsKKyAgICB9CisgICAgY2FzZSBGSUxMRURfQk9YX0NVUlNPUjoKKyAgICB7CisgICAgICBpZiAo cmVkID49IDAgJiYgYmx1ZSA+PSAwICYmIGdyZWVuID49IDApCisgICAgICAgIC8qIFRlbXBvcmFy aWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djJyBieSBib3Jyb3dpbmcgdGhl CisgICAgICAgIGZ1bmN0aW9uYWxpdHkgb2YgYHhfbWFrZV9nYycgaW4geGZucy5jLiAgKi8KKyAg ICAgICAgeworICAgICAgICAgIGJsb2NrX2lucHV0ICgpOworICAgICAgICAgIExpc3BfT2JqZWN0 IHdpbmRvdyA9IChzZWxlY3RlZF93aW5kb3cpOworICAgICAgICAgIHN0cnVjdCB3aW5kb3cgKncg PSBkZWNvZGVfbGl2ZV93aW5kb3cgKHdpbmRvdyk7CisgICAgICAgICAgc3RydWN0IGZyYW1lICpm ID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAgICAgICAgICBzdHJ1Y3QgeF9kaXNwbGF5 X2luZm8gKmRweWluZm8gPSBGUkFNRV9ESVNQTEFZX0lORk8gKGYpOworICAgICAgICAgIGludCBp bnRfcmVkID0gcmVkICogNjU1MzU7CisgICAgICAgICAgaW50IGludF9ncmVlbiA9IGdyZWVuICog NjU1MzU7CisgICAgICAgICAgaW50IGludF9ibHVlID0gYmx1ZSAqIDY1NTM1OworICAgICAgICAg IFhHQ1ZhbHVlcyBnY192YWx1ZXM7CisgICAgICAgICAgdW5zaWduZWQgbG9uZyBtYXNrID0gR0NG b3JlZ3JvdW5kIHwgR0NCYWNrZ3JvdW5kIHwgR0NGaWxsU3R5bGUgfCBHQ0xpbmVXaWR0aDsKKyAg ICAgICAgICB1bnNpZ25lZCBsb25nIG9yaWdfdmFsX2EgPSBGUkFNRV9CQUNLR1JPVU5EX1BJWEVM IChmKTsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIG9yaWdfdmFsX2IgPSBmLT5vdXRwdXRfZGF0 YS54LT5jdXJzb3JfcGl4ZWw7CisgICAgICAgICAgZ2NfdmFsdWVzLmxpbmVfd2lkdGggPSAwOyAg LyogTWVhbnMgMSB1c2luZyBmYXN0IGFsZ29yaXRobS4gICovCisgICAgICAgICAgZ2NfdmFsdWVz LmZvcmVncm91bmQgPSBGUkFNRV9CQUNLR1JPVU5EX1BJWEVMIChmKTsKKyAgICAgICAgICBnY192 YWx1ZXMuYmFja2dyb3VuZCA9IHhfbWFrZV90cnVlY29sb3JfcGl4ZWwgKGRweWluZm8sIGludF9y ZWQsIGludF9ncmVlbiwgaW50X2JsdWUpOworICAgICAgICAgIGdjX3ZhbHVlcy5maWxsX3N0eWxl ID0gRmlsbE9wYXF1ZVN0aXBwbGVkOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNv cl9nYworICAgICAgICAgICAgPSBYQ3JlYXRlR0MgKEZSQU1FX1hfRElTUExBWSAoZiksIEZSQU1F X1hfV0lORE9XIChmKSwgbWFzaywgJmdjX3ZhbHVlcyk7CisgICAgICAgICAgLyogRm9yY2UgYHhf c2V0X2N1cnNvcl9nYycgdG8gdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MnLiAg Ki8KKyAgICAgICAgICB3LT5tYy5jdXJzb3JfZ2NfZGVmYXVsdCA9IHRydWU7CisgICAgICAgICAg ZHJhd19waHlzX2N1cnNvcl9nbHlwaCAodywgZ2x5cGhfcm93LCBEUkFXX0NVUlNPUik7CisgICAg ICAgICAgdy0+bWMuY3Vyc29yX2djX2RlZmF1bHQgPSBmYWxzZTsKKyAgICAgICAgICBnY192YWx1 ZXMubGluZV93aWR0aCA9IDA7ICAvKiBNZWFucyAxIHVzaW5nIGZhc3QgYWxnb3JpdGhtLiAgKi8K KyAgICAgICAgICBnY192YWx1ZXMuZm9yZWdyb3VuZCA9IG9yaWdfdmFsX2E7CisgICAgICAgICAg Z2NfdmFsdWVzLmJhY2tncm91bmQgPSBvcmlnX3ZhbF9iOworICAgICAgICAgIGdjX3ZhbHVlcy5m aWxsX3N0eWxlID0gRmlsbE9wYXF1ZVN0aXBwbGVkOworICAgICAgICAgIGYtPm91dHB1dF9kYXRh LngtPmN1cnNvcl9nYworICAgICAgICAgICAgPSBYQ3JlYXRlR0MgKEZSQU1FX1hfRElTUExBWSAo ZiksIEZSQU1FX1hfV0lORE9XIChmKSwgbWFzaywgJmdjX3ZhbHVlcyk7CisgICAgICAgICAgdW5i bG9ja19pbnB1dCAoKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgZHJhd19w aHlzX2N1cnNvcl9nbHlwaCAodywgZ2x5cGhfcm93LCBEUkFXX0NVUlNPUik7CisgICAgICBicmVh azsKKyAgICB9CisgICAgY2FzZSBCQVJfQ1VSU09SOgorICAgIHsKKyAgICAgIGlmIChyZWQgPj0g MCAmJiBibHVlID49IDAgJiYgZ3JlZW4gPj0gMCkKKyAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlq YWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgeworICAg ICAgICAgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7CisgICAg ICAgICAgc3RydWN0IHhfZGlzcGxheV9pbmZvICpkcHlpbmZvID0gRlJBTUVfRElTUExBWV9JTkZP IChmKTsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIG9yaWdfdmFsID0gZi0+b3V0cHV0X2RhdGEu eC0+Y3Vyc29yX3BpeGVsOworICAgICAgICAgIGludCBpbnRfcmVkID0gcmVkICogNjU1MzU7Cisg ICAgICAgICAgaW50IGludF9ncmVlbiA9IGdyZWVuICogNjU1MzU7CisgICAgICAgICAgaW50IGlu dF9ibHVlID0gYmx1ZSAqIDY1NTM1OworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNv cl9waXhlbCA9IHhfbWFrZV90cnVlY29sb3JfcGl4ZWwgKGRweWluZm8sIGludF9yZWQsIGludF9n cmVlbiwgaW50X2JsdWUpOworICAgICAgICAgIHctPm1jLmN1cnNvcl9nY19pbnZpc2libGVfb2th eSA9IHRydWU7CisgICAgICAgICAgeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIGdseXBoX3JvdywgY3Vy c29yX3dpZHRoLCBCQVJfQ1VSU09SKTsKKyAgICAgICAgICB3LT5tYy5jdXJzb3JfZ2NfaW52aXNp YmxlX29rYXkgPSBmYWxzZTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4 ZWwgPSBvcmlnX3ZhbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeF9kcmF3 X2Jhcl9jdXJzb3IgKHcsIGdseXBoX3JvdywgY3Vyc29yX3dpZHRoLCBCQVJfQ1VSU09SKTsKKyAg ICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIEhCQVJfQ1VSU09SOgorICAgIHsKKyAgICAgIGlm IChyZWQgPj0gMCAmJiBibHVlID49IDAgJiYgZ3JlZW4gPj0gMCkKKyAgICAgICAgLyogVGVtcG9y YXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAg ICAgeworICAgICAgICAgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3 KSk7CisgICAgICAgICAgc3RydWN0IHhfZGlzcGxheV9pbmZvICpkcHlpbmZvID0gRlJBTUVfRElT UExBWV9JTkZPIChmKTsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIG9yaWdfdmFsID0gZi0+b3V0 cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsOworICAgICAgICAgIGludCBpbnRfcmVkID0gcmVkICog NjU1MzU7CisgICAgICAgICAgaW50IGludF9ncmVlbiA9IGdyZWVuICogNjU1MzU7CisgICAgICAg ICAgaW50IGludF9ibHVlID0gYmx1ZSAqIDY1NTM1OworICAgICAgICAgIGYtPm91dHB1dF9kYXRh LngtPmN1cnNvcl9waXhlbCA9IHhfbWFrZV90cnVlY29sb3JfcGl4ZWwgKGRweWluZm8sIGludF9y ZWQsIGludF9ncmVlbiwgaW50X2JsdWUpOworICAgICAgICAgIHctPm1jLmN1cnNvcl9nY19pbnZp c2libGVfb2theSA9IHRydWU7CisgICAgICAgICAgeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIGdseXBo X3JvdywgY3Vyc29yX3dpZHRoLCBIQkFSX0NVUlNPUik7CisgICAgICAgICAgdy0+bWMuY3Vyc29y X2djX2ludmlzaWJsZV9va2F5ID0gZmFsc2U7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+ Y3Vyc29yX3BpeGVsID0gb3JpZ192YWw7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAg ICAgIHhfZHJhd19iYXJfY3Vyc29yICh3LCBnbHlwaF9yb3csIGN1cnNvcl93aWR0aCwgSEJBUl9D VVJTT1IpOworICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTk9fQ1VSU09SOgorICAgICAg dy0+cGh5c19jdXJzb3Jfd2lkdGggPSAwOworICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoKKyAg ICAgIGVtYWNzX2Fib3J0ICgpOworICB9CisvKiBFTkQgbXVsdGlwbGUgY3Vyc29ycyAqLworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCiAKLQkgICAgZGVmYXVsdDoKLQkgICAgICBlbWFjc19hYm9y dCAoKTsKLQkgICAgfQogCX0KIAogI2lmZGVmIEhBVkVfWF9JMThOCg== --Multipart_Wed_Dec_27_09:13:37_2017-1 Content-Type: application/el; type=lawlist-elisp Content-Disposition: attachment; filename="+-mode.el" Content-Transfer-Encoding: base64 KGRlZnVuIG1jLXRlc3QgKCkKIkRyYXcgZmFrZSBjdXJzb3JzIGF0IGFsbCBQT1MgZGVmaW5lZCBp biB0aGUgYG1jLWdseXBoLWxpc3QnLiAgTXVsdGlwbGUgZmFrZSBjdXJzb3JzCmFyZSBzdXBwb3J0 ZWQgYnkgR1VJIHZlcnNpb25zIG9mIEVtYWNzIGJ1aWx0IGZvciBYLCBXaW5kb3dzIGFuZCBPU1gu ClBvcHVsYXIgZm9ybXMgb2Ygc3BlY2lmeWluZyBjb2xvcnMgc3VjaCBhcyBcInJlZFwiIGFuZCBc IiNGRjAwMDBcIiBhcmUgbm93CnN1cHBvcnRlZCwgYXMgd2VsbCBhcyBMU0wgY29sb3IgdmVjdG9y cyBzdWNoIGFzIFsxLjAgMC4wIDAuMF0uICBGb3IgdGhvc2UgdXNlcnMKd2hvIGNob29zZSB0aGUg Zm9ybWVyIGZhbWlsaWFyIG1ldGhvZHMgb2Ygc3BlY2lmeWluZyBjb2xvcnMgd2l0aCBzdHJ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ICAgICAgOzsgKHNldHEgY3Jvc3NoYWlycy1ob3Jpem9udGFsLXJ1bGVyIG5pbCkKICAg ICAgOzsgKHNldHEgY3Jvc3NoYWlycy12ZXJ0aWNhbC1ydWxlciBuaWwpCiAgICAgIChzZXQgKG1h a2UtbG9jYWwtdmFyaWFibGUgJystLXNhdmVkLXN0YXRlKSBuaWwpCiAgICAgIDs7IFNhdmUgdGhl IGxvY2FsIHZhbHVlcyBvZiBzb21lIHZhcmlhYmxlcywgdG8gYmUgcmVzdG9yZWQgaWYgdmwtbW9k ZSBpcyB0dXJuZWQgb2ZmLgogICAgICAoZG9saXN0ICh2YXIgJygKICAgICAgICAgICAgICAgICAg ICAgIHRhYi13aWR0aAogICAgICAgICAgICAgICAgICAgICAgYnVmZmVyLWRpc3BsYXktdGFibGUK ICAgICAgICAgICAgICAgICAgICAgIGxpbmUtbW92ZS12aXN1YWwKICAgICAgICAgICAgICAgICAg ICAgIHRydW5jYXRlLXBhcnRpYWwtd2lkdGgtd2luZG93cwogICAgICAgICAgICAgICAgICAgICAg dHJ1bmNhdGUtbGluZXMKICAgICAgICAgICAgICAgICAgICAgIHdvcmQtd3JhcAogICAgICAgICAg ICAgICAgICAgICAgZnJpbmdlLWluZGljYXRvci1hbGlzdCkpCiAgICAgICAgKHdoZW4gKGxvY2Fs LXZhcmlhYmxlLXAgdmFyKQogICAgICAgICAgKHB1c2ggKGNvbnMgdmFyIChzeW1ib2wtdmFsdWUg dmFyKSkgKy0tc2F2ZWQtc3RhdGUpKSkKICAgICAgKHNldHEgZGlzcGxheS1saW5lLW51bWJlcnMg dCkKICAgICAgKHNldHEtbG9jYWwgYXV0by1oc2Nyb2xsLW1vZGUgJ2N1cnJlbnQtbGluZSkKICAg ICAgKHNldHEtbG9jYWwgaHNjcm9sbC1zdGVwIDUpCiAgICAgIChzZXRxIHRhYi13aWR0aCAyKQog ICAgICAoc2V0cSBidWZmZXItZGlzcGxheS10YWJsZSArLWJ1ZmZlci1kaXNwbGF5LXRhYmxlKQog ICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICdsaW5lLW1vdmUtdmlzdWFsKSB0KQogICAg ICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICd0cnVuY2F0ZS1wYXJ0aWFsLXdpZHRoLXdpbmRv d3MpIG5pbCkKICAgICAgKHNldHEgdHJ1bmNhdGUtbGluZXMgbmlsKQogICAgICAoc2V0cSB3b3Jk LXdyYXAgdCkKICAgICAgKHNldHEgaW5kaWNhdGUtZW1wdHktbGluZXMgdCkKICAgICAgKHNldHEg aW5kaWNhdGUtYnVmZmVyLWJvdW5kYXJpZXMgJ2xlZnQpCiAgICAgIChzZXRxIGZyaW5nZS1pbmRp Y2F0b3ItYWxpc3QgJygKICAgICAgICAodHJ1bmNhdGlvbiAuICgrLWZyaW5nZS1sZWZ0LWFycm93 ICstZnJpbmdlLXJpZ2h0LWFycm93KSkKICAgICAgICAoY29udGludWF0aW9uIC4gKCstZnJpbmdl LWxlZnQtY3VybHktYXJyb3cgKy1iYWNrc2xhc2gpKQogICAgICAgIChvdmVybGF5LWFycm93IC4g Ky1mcmluZ2UtcmlnaHQtdHJpYW5nbGUpCiAgICAgICAgKHVwIC4gKy1mcmluZ2UtdXAtYXJyb3cp CiAgICAgICAgKGRvd24gLiArLWZyaW5nZS1kb3duLWFycm93KQogICAgICAgICh0b3AgLiArLWZy aW5nZS10b3AtbGVmdC1hbmdsZSkKICAgICAgICAoYm90dG9tIC4gKy1mcmluZ2UtYm90dG9tLXJp Z2h0LWFuZ2xlKQogICAgICAgICh0b3AtYm90dG9tIC4gKCstZnJpbmdlLWxlZnQtYnJhY2tldAog ICAgICAgICAgICAgICAgICAgICAgICstZnJpbmdlLXJpZ2h0LWJyYWNrZXQKICAgICAgICAgICAg ICAgICAgICAgICArLWZyaW5nZS10b3AtcmlnaHQtYW5nbGUKICAgICAgICAgICAgICAgICAgICAg ICArLWZyaW5nZS10b3AtbGVmdC1hbmdsZSkpCiAgICAgICAgKGVtcHR5LWxpbmUgLiArLWZyaW5n ZS1lbXB0eS1saW5lKQogICAgICAgICh1bmtub3duIC4gKy1mcmluZ2UtcXVlc3Rpb24tbWFyaykp KQogICAgICA7OzsgUkVNQVAgREVGQVVMVCBCRUhBVklPUiAoaWYgdGhlIHVzZXIgd2FudHMgc29t ZXRoaW5nIGRpZmZlcmVudCkuCiAgICAgIChzZXRxIGZyaW5nZS1jdXJzb3ItYWxpc3QgJygoYm94 IC4gKy1mcmluZ2UtbGVmdC10cmlhbmdsZSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIChob2xsb3cgLiArLWhvbGxvdy1yZWN0YW5nbGUpCiAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAoYmFyIC4gKy12ZXJ0aWNhbC1iYXIpCiAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAoaGJhciAuICstZnJpbmdlLWhvcml6b250YWwtYmFyKQogICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgKGhvbGxvdy1zbWFsbCAuICstZnJpbmdlLWhvbGxvdy1zcXVh cmUpKSkKICAgICAgKHNldHEgdGFiLXN0b3AtbGlzdCAobnVtYmVyLXNlcXVlbmNlIDAgMTAwMCAy KSkKICAgICAgKHNldHEgZmlsbC1jb2x1bW4gODApCiAgICAgIChhZGQtaG9vayAncG9zdC1jb21t YW5kLWhvb2sgJystZHJhdy1ob3Jpem9udGFsLXJ1bGVyICdhcHBlbmQgJ2xvY2FsKQogICAgICAo YWRkLWhvb2sgJ3dpbmRvdy1jb25maWd1cmF0aW9uLWNoYW5nZS1ob29rICcrLXJlZHJhdy1mb3J0 aHdpdGggbmlsICdsb2NhbCkKICAgICAgKGFkZC1ob29rICdjaGFuZ2UtbWFqb3ItbW9kZS1ob29r ICd0dXJuLW9mZi0rLW1vZGUgbmlsICdsb2NhbCkKICAgICAgKHdoZW4gKGNhbGxlZC1pbnRlcmFj dGl2ZWx5LXAgJ2FueSkKICAgICAgICAob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9pbnQpKQog ICAgICAgICAoZnJvbQogICAgICAgICAgIChjb25kCiAgICAgICAgICAgICAoKG1lbXEgbWFqb3It bW9kZSAnKGMtbW9kZSBvYmpjLW1vZGUpKQogICAgICAgICAgICAgICAgKGNvbmRpdGlvbi1jYXNl IG5pbAogICAgICAgICAgICAgICAgICAoc2F2ZS1leGN1cnNpb24KICAgICAgICAgICAgICAgICAg ICAoYy1iZWdpbm5pbmctb2YtZGVmdW4pCiAgICAgICAgICAgICAgICAgICAgKHBvaW50KSkKICAg ICAgICAgICAgICAgICAgKGVycm9yIChwb2ludC1taW4pKSkpCiAgICAgICAgICAgICAoKGVxIG1h am9yLW1vZGUgJ2VsaXNwLW1vZGUpCiAgICAgICAgICAgICAgICAoY29uZGl0aW9uLWNhc2Ugbmls CiAgICAgICAgICAgICAgICAgIChzYXZlLWV4Y3Vyc2lvbgogICAgICAgICAgICAgICAgICAgIChi ZWdpbm5pbmctb2YtZGVmdW4pCiAgICAgICAgICAgICAgICAgICAgKHBvaW50KSkKICAgICAgICAg ICAgICAgICAgKHBvaW50LW1pbikpKQogICAgICAgICAgICAgKHQKICAgICAgICAgICAgICAgICht YXggKHBvaW50LW1pbikgKC0gb3BvaW50IDIwMDApKSkpKQogICAgICAgICAod2luIChzZWxlY3Rl ZC13aW5kb3cpKQogICAgICAgICAoaSAwKQogICAgICAgICAocHJlY2VkaW5nLWNoYXIgKHByZWNl ZGluZy1jaGFyKSkKICAgICAgICAgKG9jaGFyIChjaGFyLWFmdGVyIG9wb2ludCkpCiAgICAgICAg IChwb3MxCiAgICAgICAgICAgKGNvbmQKICAgICAgICAgICAgICgoYW5kIG9jaGFyCiAgICAgICAg ICAgICAgICAgICAob3IgOzs7IChjaGFyLXRvLXN0cmluZyA0MCkgPT4gb3BlbmluZyBwYXJlbnRo ZXNpcwogICAgICAgICAgICAgICAgICAgICAgICg9IG9jaGFyIDQwKQogICAgICAgICAgICAgICAg ICAgICAgIDs7OyAoY2hhci10by1zdHJpbmcgOTEpID0+IG9wZW5pbmcgc3F1YXJlIGJyYWNrZXQK ICAgICAgICAgICAgICAgICAgICAgICAoPSBvY2hhciA5MSkKICAgICAgICAgICAgICAgICAgICAg ICA7OzsgKGNoYXItdG8tc3RyaW5nIDEyMykgPT4gb3BlbmluZyB3YXZ5IGJyYWNrZXQKICAgICAg ICAgICAgICAgICAgICAgICAoPSBvY2hhciAxMjMpKSkKICAgICAgICAgICAgICAgIChtaW4gKDEr IG9wb2ludCkgKHBvaW50LW1heCkpKQogICAgICAgICAgICAgKChvciA7OzsgKGNoYXItdG8tc3Ry aW5nIDQxKSA9PiBjbG9zaW5nIHBhcmVudGhlc2lzCiAgICAgICAgICAgICAgICAgICg9IHByZWNl ZGluZy1jaGFyIDQxKQogICAgICAgICAgICAgICAgICA7OzsgKGNoYXItdG8tc3RyaW5nIDkzKSA9 PiBjbG9zaW5nIHNxdWFyZSBicmFja2V0CiAgICAgICAgICAgICAgICAgICg9IHByZWNlZGluZy1j aGFyIDkzKQogICAgICAgICAgICAgICAgICA7OzsgKGNoYXItdG8tc3RyaW5nIDEyNSkgPT4gY2xv c2luZyB3YXZ5IGJyYWNrZXQKICAgICAgICAgICAgICAgICAgKD0gcHJlY2VkaW5nLWNoYXIgMTI1 KSkKICAgICAgICAgICAgICAgIChtYXggKHBvaW50LW1pbikgKDEtIG9wb2ludCkpKQogICAgICAg ICAgICAgKHQKICAgICAgICAgICAgICAgIG9wb2ludCkpKQogICAgICAgICBwb3MyCiAgICAgICAg IHNlbGVjdGVkLWZhY2UpCiAgICAoc2F2ZS1leGN1cnNpb24KICAgICAgKGNvbmRpdGlvbi1jYXNl IG5pbAogICAgICAgICh3aGlsZSAoc2V0cSBwb3MxIChudGggMSAocGFyc2UtcGFydGlhbC1zZXhw IGZyb20gcG9zMSkpKQogICAgICAgICAgKHNldHEgcG9zMiAoc2Nhbi1zZXhwcyBwb3MxIDEpKQog ICAgICAgICAgKGlmICg9IGkgMTApCiAgICAgICAgICAgIChzZXRxIGkgMSkKICAgICAgICAgICAg KGluY2YgaSkpCiAgICAgICAgICAoc2V0cSBzZWxlY3RlZC1mYWNlIChjb25kCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgKCg9IGkgMSkKICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICcrLXBhcmVucy1vbmUtZmFjZSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAoKD0gaSAyKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLXR3 by1mYWNlKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDMpCiAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtdGhyZWUtZmFjZSkKICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA0KQogICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJystcGFyZW5zLWZvdXItZmFjZSkKICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAoKD0gaSA1KQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5z LWZpdmUtZmFjZSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA2KQogICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLXNpeC1mYWNlKQogICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDcpCiAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAnKy1wYXJlbnMtc2V2ZW4tZmFjZSkKICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAoKD0gaSA4KQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFy ZW5zLWVpZ2h0LWZhY2UpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgOSkK ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1uaW5lLWZhY2UpCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgMTApCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtdGVuLWZhY2UpKSkKICAgICAgICAgIChsZXQgKChv diAobWFrZS1vdmVybGF5IHBvczEgKDErIHBvczEpKSkpCiAgICAgICAgICAgIChvdmVybGF5LXB1 dCBvdiAnd2luZG93IHdpbikKICAgICAgICAgICAgKG92ZXJsYXktcHV0IG92ICdmYWNlIHNlbGVj dGVkLWZhY2UpKQogICAgICAgICAgKHdoZW4gcG9zMgogICAgICAgICAgICAobGV0ICgob3YgKG1h a2Utb3ZlcmxheSAoMS0gcG9zMikgcG9zMikpKQogICAgICAgICAgICAgIChvdmVybGF5LXB1dCBv diAnd2luZG93IHdpbikKICAgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ2ZhY2Ugc2VsZWN0 ZWQtZmFjZSkpKSkKICAgICAgICAoZXJyb3IgbmlsKSkpCiAgICAoc2V0cSArLXBhcmVucy1vdmVy bGF5cy1leGlzdC1wIHQpKSkKCihkZWZ1biArLXJlbW92ZS1vdmVybGF5cyAoYmVnIGVuZCBuYW1l IHZhbCkKIlJlbW92ZSB0aGUgb3ZlcmxheXMgdGhhdCBhcmUgYGVxdWFsLWluY2x1ZGluZy1wcm9w ZXJ0aWVzYC4KSW5jbHVkZXMgYSB1bmlxdWUgc2l0dWF0aW9uIHdoZW4gYW4gb3ZlcmxheSB3aXRo IGFuIGAnYWZ0ZXItc3RyaW5nYCBwcm9wZXJ0eQppcyBhdCB0aGUgdmVyeSBlbmQgb2YgYSBuYXJy b3dlZC1idWZmZXIuIgogIChsZXQqICgKICAgICAgKHBvaW50LW1heCAocG9pbnQtbWF4KSkKICAg ICAgKHBvaW50LW1pbiAocG9pbnQtbWluKSkKICAgICAgKG5hcnJvd2VkLXAgKGJ1ZmZlci1uYXJy b3dlZC1wKSkKICAgICAgKGJlZyAoaWYgYmVnIGJlZyBwb2ludC1taW4pKQogICAgICAoZW5kCiAg ICAgICAgKGNvbmQKICAgICAgICAgICgoYW5kCiAgICAgICAgICAgICAgKG5vdCBuYXJyb3dlZC1w KQogICAgICAgICAgICAgIGVuZCkKICAgICAgICAgICAgZW5kKQogICAgICAgICAgKChhbmQKICAg ICAgICAgICAgICAobm90IG5hcnJvd2VkLXApCiAgICAgICAgICAgICAgKG51bGwgZW5kKSkKICAg ICAgICAgICAgcG9pbnQtbWF4KQogICAgICAgICAgKChhbmQKICAgICAgICAgICAgICBuYXJyb3dl ZC1wCiAgICAgICAgICAgICAgZW5kCiAgICAgICAgICAgICAgKDwgZW5kIHBvaW50LW1heCkpCiAg ICAgICAgICAgIGVuZCkKICAgICAgICAgICgoYW5kCiAgICAgICAgICAgICAgbmFycm93ZWQtcAog ICAgICAgICAgICAgIGVuZAogICAgICAgICAgICAgICg9IGVuZCBwb2ludC1tYXgpKQogICAgICAg ICAgICAoMSsgZW5kKSkKICAgICAgICAgICgoYW5kCiAgICAgICAgICAgICAgbmFycm93ZWQtcAog ICAgICAgICAgICAgIChudWxsIGVuZCkpCiAgICAgICAgICAgICgxKyBwb2ludC1tYXgpKSApKQog ICAgICAob3ZlcmxheXMKICAgICAgICAocHJvZ24KICAgICAgICAgIChvdmVybGF5LXJlY2VudGVy IGVuZCkKICAgICAgICAgIChvdmVybGF5cy1pbiBiZWcgZW5kKSkpICkKICAgICh3aGVuIChhbmQg YmVnIGVuZCBuYW1lIHZhbCkKICAgICAgKGRvbGlzdCAobyBvdmVybGF5cykKICAgICAgICAoY29u ZAogICAgICAgICAgKChhbmQKICAgICAgICAgICAgICAgIChlcSBuYW1lICdmYWNlKQogICAgICAg ICAgICAgICAgKGVxIChvdmVybGF5LWdldCBvIG5hbWUpIHZhbCkpCiAgICAgICAgICAgIDs7IEVp dGhlciBwdXNoIHRoaXMgb3ZlcmxheSBvdXRzaWRlIGJlZy4uLmVuZAogICAgICAgICAgICA7OyBv ciBzcGxpdCBpdCB0byBleGNsdWRlIGJlZy4uLmVuZAogICAgICAgICAgICA7OyBvciBkZWxldGUg aXQgZW50aXJlbHkgKGlmIGl0IGlzIGNvbnRhaW5lZCBpbiBiZWcuLi5lbmQpLgogICAgICAgICAg ICAoaWYgKDwgKG92ZXJsYXktc3RhcnQgbykgYmVnKQogICAgICAgICAgICAgICAgKGlmICg+IChv dmVybGF5LWVuZCBvKSBlbmQpCiAgICAgICAgICAgICAgKHByb2duCiAgICAgICAgICAgICAgICAo bW92ZS1vdmVybGF5IChjb3B5LW92ZXJsYXkgbykKICAgICAgICAgICAgICAgICAgKG92ZXJsYXkt c3RhcnQgbykgYmVnKQogICAgICAgICAgICAgICAgKG1vdmUtb3ZlcmxheSBvIGVuZCAob3Zlcmxh eS1lbmQgbykpKQogICAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gKG92ZXJsYXktc3Rh cnQgbykgYmVnKSkKICAgICAgICAgICAgICAoaWYgKD4gKG92ZXJsYXktZW5kIG8pIGVuZCkKICAg ICAgICAgICAgICAgICAgKG1vdmUtb3ZlcmxheSBvIGVuZCAob3ZlcmxheS1lbmQgbykpCiAgICAg ICAgICAgICAgICAoZGVsZXRlLW92ZXJsYXkgbykpKSkKICAgICAgICAgICgoYW5kCiAgICAgICAg ICAgICAgICAobm90IChlcSBuYW1lICdmYWNlKSkKICAgICAgICAgICAgICAgIChlcXVhbC1pbmNs dWRpbmctcHJvcGVydGllcyAob3ZlcmxheS1nZXQgbyBuYW1lKSB2YWwpKQogICAgICAgICAgICAo ZGVsZXRlLW92ZXJsYXkgbykpKSkpKSkKCihkZWZ1biArLWRlbGV0ZS1wYXJlbnMtb3ZlcmxheXMg KCkKICAod2hlbiArLXBhcmVucy1vdmVybGF5cy1leGlzdC1wCiAgICAoZG9saXN0IChmYWNlICco CiAgICAgICAgKy1wYXJlbnMtb25lLWZhY2UKICAgICAgICArLXBhcmVucy10d28tZmFjZQogICAg ICAgICstcGFyZW5zLXRocmVlLWZhY2UKICAgICAgICArLXBhcmV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mxpbmstY3Vyc29yLW1vZGUg LTEp --Multipart_Wed_Dec_27_09:13:37_2017-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs). Resent-From: "John Wiegley" <johnw@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Wed, 27 Dec 2017 23:56:02 +0000 Resent-Message-ID: <handler.22873.B22873.151441895122664 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Keith David Bershatsky <esq@HIDDEN> Cc: 17684 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>, Marcin Borkowski <mbork@HIDDEN>, 22873 <at> debbugs.gnu.org, Richard Stallman <rms@HIDDEN> Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.151441895122664 (code B ref 22873); Wed, 27 Dec 2017 23:56:02 +0000 Received: (at 22873) by debbugs.gnu.org; 27 Dec 2017 23:55:51 +0000 Received: from localhost ([127.0.0.1]:54305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1eULY7-0005tU-GS for submit <at> debbugs.gnu.org; Wed, 27 Dec 2017 18:55:51 -0500 Received: from eggs.gnu.org ([208.118.235.92]:53540) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <johnw@HIDDEN>) id 1eULY6-0005tG-4V for 22873 <at> debbugs.gnu.org; Wed, 27 Dec 2017 18:55:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <johnw@HIDDEN>) id 1eULXx-0006IA-Rt for 22873 <at> debbugs.gnu.org; Wed, 27 Dec 2017 18:55:45 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46645) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <johnw@HIDDEN>) id 1eULXn-00065J-UF; Wed, 27 Dec 2017 18:55:32 -0500 Received: from auth2-smtp.messagingengine.com ([66.111.4.228]:47143) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from <johnw@HIDDEN>) id 1eULXg-0000zf-Lw; Wed, 27 Dec 2017 18:55:24 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id C7958212E6; Wed, 27 Dec 2017 18:55:23 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Wed, 27 Dec 2017 18:55:23 -0500 X-ME-Sender: <xms:6zJEWrUpTl1yRXriKAbsploOwEeUDUIb9FtTXI4WLYME-H3o3y01Aw> Received: from localhost (76-234-69-149.lightspeed.frokca.sbcglobal.net [76.234.69.149]) by mail.messagingengine.com (Postfix) with ESMTPA id 5DEE17E139; Wed, 27 Dec 2017 18:55:23 -0500 (EST) From: "John Wiegley" <johnw@HIDDEN> In-Reply-To: <m28tdojdq6.wl%esq@HIDDEN> (Keith David Bershatsky's message of "Wed, 27 Dec 2017 09:13:37 -0800") Date: Wed, 27 Dec 2017 15:55:16 -0800 Message-ID: <m2bmijn2u3.fsf@HIDDEN> References: <m28tdojdq6.wl%esq@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (darwin) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -5.0 (-----) >>>>> Keith David Bershatsky <esq@HIDDEN> writes: > In my own setup, I have incorporated #22873 to work with Magnar's multiple > cursors library using just a slight modification to a couple of his > functions, and can provide that if anyone is interested. In a nutshell, > Emacs can draw multiple fake cursors using #22873 instead of using the > rectangle overlay chosen by Magnar. I'm interested in that patch to multiple-cursors, Keith. -- John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: #22873 (multiple fake cursors) References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Thu, 28 Dec 2017 01:21:01 +0000 Resent-Message-ID: <handler.22873.B22873.151442405330823 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: "John Wiegley" <johnw@HIDDEN> Cc: Eli Zaretskii <eliz@HIDDEN>, Marcin Borkowski <mbork@HIDDEN>, 22873 <at> debbugs.gnu.org, Richard Stallman <rms@HIDDEN> Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.151442405330823 (code B ref 22873); Thu, 28 Dec 2017 01:21:01 +0000 Received: (at 22873) by debbugs.gnu.org; 28 Dec 2017 01:20:53 +0000 Received: from localhost ([127.0.0.1]:54331 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1eUMsO-000815-Go for submit <at> debbugs.gnu.org; Wed, 27 Dec 2017 20:20:52 -0500 Received: from gateway34.websitewelcome.com ([192.185.148.196]:20565) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1eUMsM-00080w-9y for 22873 <at> debbugs.gnu.org; Wed, 27 Dec 2017 20:20:51 -0500 Received: from cm15.websitewelcome.com (cm15.websitewelcome.com [100.42.49.9]) by gateway34.websitewelcome.com (Postfix) with ESMTP id 1FCB953CB0 for <22873 <at> debbugs.gnu.org>; Wed, 27 Dec 2017 19:20:48 -0600 (CST) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id UMsJeyIglmzEzUMsJeSt0a; Wed, 27 Dec 2017 19:20:48 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=rnRMbSukj55AMN9ZEwjrQDGwiladvvtPhGMpr/ApL8M=; b=IFKfxEa/TypDqpHNm8NpNAhrj1 Ol9O3TkHIOZq5+juRXNegHLTIu7QdcNX125vliS8CcGRFwgdBXhE+wDBp5Jsz66OZmoIcPiLjPpdE XfXlDopE8eVWgxzk2UlJTig2uZJC3IpEqtodOw6zr6Zdck9oZZ9WfZd/3cKUwo9eKh1w86vABi/jj w4aDxUedr3/YJnBuJ5IK978+LQ1847ptqmFvKDrpvRHB2NI6Io0sDOAw43MjS98lPlEqOD0mPwNDq q3wSF0/eRYJfzFGYPPxEL9See6IJ8hMqmJWIBXmY/cFKAmJ3Tl0Mto4p8SX5UaErtNXyVNBdKHpu7 J2JKoZLw==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:52472 helo=server.private) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.89) (envelope-from <esq@HIDDEN>) id 1eUMsJ-000qGA-0g; Wed, 27 Dec 2017 19:20:47 -0600 Date: Wed, 27 Dec 2017 17:20:46 -0800 Message-ID: <m2o9mjbqc1.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1eUMsJ-000qGA-0g X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.private) [45.48.239.195]:52472 X-Source-Auth: lawlist X-Email-Count: 4 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: 0.0 (/) John: Here is an example modification to the most recent version Magnar's multiple-cursors package to make use of #22873 with the patch.diff from earlier today for Emacs 26. I like yellow for even numbered columns and red for odd numbered columns, and I like the vertical bar fake cursor, so that is what is used in this example. (require 'multiple-cursors-core) (require 'cl) ;; for oddp and evenp (add-hook 'multiple-cursors-mode-disabled-hook (lambda () (kill-local-variable 'mc-glyph-list))) (defvar mc/use-built-in-cursors t "Whether to use the built-in fake cursors.") (defun mc/create-fake-cursor-at-point (&optional id) "Add a fake cursor and possibly a fake active region overlay based on point and mark. Saves the current state in the overlay to be restored later." (unless mc--max-cursors-original (setq mc--max-cursors-original mc/max-cursors)) (when mc/max-cursors (unless (< (mc/num-cursors) mc/max-cursors) (if (yes-or-no-p (format "%d active cursors. Continue? " (mc/num-cursors))) (setq mc/max-cursors (read-number "Enter a new, temporary maximum: ")) (mc/remove-fake-cursors) (error "Aborted: too many cursors")))) (let ((overlay (if mc/use-built-in-cursors (make-overlay (point) (point)) (mc/make-cursor-overlay-at-point)))) (overlay-put overlay 'mc-id (or id (mc/create-cursor-id))) (overlay-put overlay 'type 'fake-cursor) (overlay-put overlay 'priority 100) (mc/store-current-state-in-overlay overlay) (when (use-region-p) (overlay-put overlay 'region-overlay (mc/make-region-overlay-between-point-and-mark))) overlay)) (defun mc/execute-this-command-for-all-cursors-1 () "Used with post-command-hook to execute supported commands for all cursors. It uses two lists of commands to know what to do: the run-once list and the run-for-all list. If a command is in neither of these lists, it will prompt for the proper action and then save that preference. Some commands are so unsupported that they are even prevented for the original cursor, to inform about the lack of support." (unless mc--executing-command-for-fake-cursor (if (eq 1 (mc/num-cursors)) ;; no fake cursors? disable mc/mode (mc/mode 0) (when this-original-command (let ((original-command (or mc--this-command (command-remapping this-original-command) this-original-command))) ;; skip keyboard macros, since they will generate actual commands that are ;; also run in the command loop - we'll handle those later instead. (when (functionp original-command) ;; if it's a lambda, we can't know if it's supported or not ;; - so go ahead and assume it's ok, because we're just optimistic like that (if (or (not (symbolp original-command)) ;; lambda registered by smartrep (string-prefix-p "(" (symbol-name original-command))) (mc/execute-command-for-all-fake-cursors original-command) ;; smartrep `intern's commands into own obarray to help ;; `describe-bindings'. So, let's re-`intern' here to ;; make the command comparable by `eq'. (setq original-command (intern (symbol-name original-command))) ;; otherwise it's a symbol, and we can be more thorough (if (get original-command 'mc--unsupported) (message "%S is not supported with multiple cursors%s" original-command (get original-command 'mc--unsupported)) (when (and original-command (not (memq original-command mc--default-cmds-to-run-once)) (not (memq original-command mc/cmds-to-run-once)) (or (memq original-command mc--default-cmds-to-run-for-all) (memq original-command mc/cmds-to-run-for-all) (mc/prompt-for-inclusion-in-whitelist original-command))) (mc/execute-command-for-all-fake-cursors original-command)))) (when mc/use-built-in-cursors (let* ((win (selected-window)) (window-start (window-start win)) (window-end (window-end win)) (overlays (mc/all-fake-cursors)) (lst (mapcar (lambda (x) (let* ((pos (overlay-start x)) (current-column (if (and (>= pos window-start) (<= pos window-end)) (save-excursion (goto-char pos) (current-column)) 0))) (cond ((oddp current-column) (list pos "bar" "#FF0000")) ;; red or [1.0 0.0 0.0] ((evenp current-column) (list pos "bar" "yellow"))))) ;; [1.0 1.0 0.0] overlays))) (setq mc-glyph-list lst))))))))) (defun mc/execute-this-command-for-all-cursors-1 () "Used with post-command-hook to execute supported commands for all cursors. It uses two lists of commands to know what to do: the run-once list and the run-for-all list. If a command is in neither of these lists, it will prompt for the proper action and then save that preference. Some commands are so unsupported that they are even prevented for the original cursor, to inform about the lack of support." (unless mc--executing-command-for-fake-cursor (if (eq 1 (mc/num-cursors)) ;; no fake cursors? disable mc-mode (multiple-cursors-mode 0) (when this-original-command (let ((original-command (or mc--this-command (command-remapping this-original-command) this-original-command))) ;; skip keyboard macros, since they will generate actual commands that are ;; also run in the command loop - we'll handle those later instead. (when (functionp original-command) ;; if it's a lambda, we can't know if it's supported or not ;; - so go ahead and assume it's ok, because we're just optimistic like that (if (or (not (symbolp original-command)) ;; lambda registered by smartrep (string-prefix-p "(" (symbol-name original-command))) (mc/execute-command-for-all-fake-cursors original-command) ;; smartrep `intern's commands into own obarray to help ;; `describe-bindings'. So, let's re-`intern' here to ;; make the command comparable by `eq'. (setq original-command (intern (symbol-name original-command))) ;; otherwise it's a symbol, and we can be more thorough (if (get original-command 'mc--unsupported) (message "%S is not supported with multiple cursors%s" original-command (get original-command 'mc--unsupported)) (when (and original-command (not (memq original-command mc--default-cmds-to-run-once)) (not (memq original-command mc/cmds-to-run-once)) (or mc/always-run-for-all (memq original-command mc--default-cmds-to-run-for-all) (memq original-command mc/cmds-to-run-for-all) (mc/prompt-for-inclusion-in-whitelist original-command))) (mc/execute-command-for-all-fake-cursors original-command)))))) (when mc/use-built-in-cursors (let* ((win (selected-window)) (window-start (window-start win)) (window-end (window-end win)) (overlays (mc/all-fake-cursors)) (lst (mapcar (lambda (x) (let* ((pos (overlay-start x)) (current-column (if (and (>= pos window-start) (<= pos window-end)) (save-excursion (goto-char pos) (current-column)) 0))) (cond ((oddp current-column) (list pos "bar" "#FF0000")) ;; red or [1.0 0.0 0.0] ((evenp current-column) (list pos "bar" "yellow"))))) ;; [1.0 1.0 0.0] overlays))) (setq mc-glyph-list lst))) ))))
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: #22873 (multiple fake cursors) References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Thu, 28 Dec 2017 01:27:01 +0000 Resent-Message-ID: <handler.22873.B22873.151442439031356 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: John Wiegley <jwiegley@HIDDEN> Cc: Eli Zaretskii <eliz@HIDDEN>, Marcin Borkowski <mbork@HIDDEN>, 22873 <at> debbugs.gnu.org, Richard Stallman <rms@HIDDEN> Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.151442439031356 (code B ref 22873); Thu, 28 Dec 2017 01:27:01 +0000 Received: (at 22873) by debbugs.gnu.org; 28 Dec 2017 01:26:30 +0000 Received: from localhost ([127.0.0.1]:54336 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1eUMxp-00089f-CK for submit <at> debbugs.gnu.org; Wed, 27 Dec 2017 20:26:30 -0500 Received: from gateway20.websitewelcome.com ([192.185.58.11]:23135) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1eUMxm-00089W-0K for 22873 <at> debbugs.gnu.org; Wed, 27 Dec 2017 20:26:26 -0500 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway20.websitewelcome.com (Postfix) with ESMTP id B0C27400C46EC for <22873 <at> debbugs.gnu.org>; Wed, 27 Dec 2017 19:26:23 -0600 (CST) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id UMxjeO4QeBUMKUMxjeYO4o; Wed, 27 Dec 2017 19:26:23 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Gm6M+5hvubWjS33TbtqXChVwvEkMn6kMuXGr6scF5No=; b=jPiU3oE2bp64lRms12JULT/ga+ NnGEcBgNvAbQBuhr3o6uzsNubYYUtomvvMLWfpBp+8H86Iq1C2mMGZHIty19MrswxvrQAIC2b0MvC 9KTgrlvfTDUD1fNmo4QH4sbloV8485y9eq+3q8S1he7veUx3QyIN3Kta1g41RAD+WmzWcBW4OGIut cuUM4pakhGz98exFmwd/ogJCrmEKN1XnMLqTenzoTLRvcOZvI1fkKSzqEv64KuEwVZ9fHD+zy5p7R Snx10jJBXxTs8n1fExi4OPSDvzQ/syn8D8OihMDHopAMn+Fgd3Yjm5WlE+n4zm0oJl2ZkAR2uAXWt Q+y0fMEw==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:52512 helo=server.private) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.89) (envelope-from <esq@HIDDEN>) id 1eUMxi-000uzJ-FA; Wed, 27 Dec 2017 19:26:22 -0600 Date: Wed, 27 Dec 2017 17:26:21 -0800 Message-ID: <m2mv23bq2q.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1eUMxi-000uzJ-FA X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.private) [45.48.239.195]:52512 X-Source-Auth: lawlist X-Email-Count: 9 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: 0.0 (/) John: I had an extra function in the previous email, sorry. Here is the shortened version: (require 'multiple-cursors-core) (require 'cl) ;; for oddp and evenp (add-hook 'multiple-cursors-mode-disabled-hook (lambda () (kill-local-variable 'mc-glyph-list))) (defvar mc/use-built-in-cursors t "Whether to use the built-in fake cursors.") (defun mc/create-fake-cursor-at-point (&optional id) "Add a fake cursor and possibly a fake active region overlay based on point and mark. Saves the current state in the overlay to be restored later." (unless mc--max-cursors-original (setq mc--max-cursors-original mc/max-cursors)) (when mc/max-cursors (unless (< (mc/num-cursors) mc/max-cursors) (if (yes-or-no-p (format "%d active cursors. Continue? " (mc/num-cursors))) (setq mc/max-cursors (read-number "Enter a new, temporary maximum: ")) (mc/remove-fake-cursors) (error "Aborted: too many cursors")))) (let ((overlay (if mc/use-built-in-cursors (make-overlay (point) (point)) (mc/make-cursor-overlay-at-point)))) (overlay-put overlay 'mc-id (or id (mc/create-cursor-id))) (overlay-put overlay 'type 'fake-cursor) (overlay-put overlay 'priority 100) (mc/store-current-state-in-overlay overlay) (when (use-region-p) (overlay-put overlay 'region-overlay (mc/make-region-overlay-between-point-and-mark))) overlay)) (defun mc/execute-this-command-for-all-cursors-1 () "Used with post-command-hook to execute supported commands for all cursors. It uses two lists of commands to know what to do: the run-once list and the run-for-all list. If a command is in neither of these lists, it will prompt for the proper action and then save that preference. Some commands are so unsupported that they are even prevented for the original cursor, to inform about the lack of support." (unless mc--executing-command-for-fake-cursor (if (eq 1 (mc/num-cursors)) ;; no fake cursors? disable mc-mode (multiple-cursors-mode 0) (when this-original-command (let ((original-command (or mc--this-command (command-remapping this-original-command) this-original-command))) ;; skip keyboard macros, since they will generate actual commands that are ;; also run in the command loop - we'll handle those later instead. (when (functionp original-command) ;; if it's a lambda, we can't know if it's supported or not ;; - so go ahead and assume it's ok, because we're just optimistic like that (if (or (not (symbolp original-command)) ;; lambda registered by smartrep (string-prefix-p "(" (symbol-name original-command))) (mc/execute-command-for-all-fake-cursors original-command) ;; smartrep `intern's commands into own obarray to help ;; `describe-bindings'. So, let's re-`intern' here to ;; make the command comparable by `eq'. (setq original-command (intern (symbol-name original-command))) ;; otherwise it's a symbol, and we can be more thorough (if (get original-command 'mc--unsupported) (message "%S is not supported with multiple cursors%s" original-command (get original-command 'mc--unsupported)) (when (and original-command (not (memq original-command mc--default-cmds-to-run-once)) (not (memq original-command mc/cmds-to-run-once)) (or mc/always-run-for-all (memq original-command mc--default-cmds-to-run-for-all) (memq original-command mc/cmds-to-run-for-all) (mc/prompt-for-inclusion-in-whitelist original-command))) (mc/execute-command-for-all-fake-cursors original-command)))))) (when mc/use-built-in-cursors (let* ((win (selected-window)) (window-start (window-start win)) (window-end (window-end win)) (overlays (mc/all-fake-cursors)) (lst (mapcar (lambda (x) (let* ((pos (overlay-start x)) (current-column (if (and (>= pos window-start) (<= pos window-end)) (save-excursion (goto-char pos) (current-column)) 0))) (cond ((oddp current-column) (list pos "bar" "#FF0000")) ;; red or [1.0 0.0 0.0] ((evenp current-column) (list pos "bar" "yellow"))))) ;; [1.0 1.0 0.0] overlays))) (setq mc-glyph-list lst))) ))))
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs). References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Mon, 09 Jul 2018 05:30:03 +0000 Resent-Message-ID: <handler.22873.B22873.153111416029765 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22873 <at> debbugs.gnu.org,17684 <at> debbugs.gnu.org Cc: Eli Zaretskii <eliz@HIDDEN>, John Wiegley <johnw@HIDDEN>, Marcin Borkowski <mbork@HIDDEN>, Richard Stallman <rms@HIDDEN> Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.153111416029765 (code B ref 22873); Mon, 09 Jul 2018 05:30:03 +0000 Received: (at 22873) by debbugs.gnu.org; 9 Jul 2018 05:29:20 +0000 Received: from localhost ([127.0.0.1]:51641 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1fcOjg-0007jw-Bd for submit <at> debbugs.gnu.org; Mon, 09 Jul 2018 01:29:20 -0400 Received: from gateway32.websitewelcome.com ([192.185.145.1]:24269) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1fcOje-0007jg-7c for 22873 <at> debbugs.gnu.org; Mon, 09 Jul 2018 01:29:18 -0400 Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway32.websitewelcome.com (Postfix) with ESMTP id 238994D00 for <22873 <at> debbugs.gnu.org>; Mon, 9 Jul 2018 00:29:17 -0500 (CDT) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id cOixfY7WVRPojcOj5f7pUw; Mon, 09 Jul 2018 00:29:16 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=szxpmwUAdW3KDhBl+d93w4Rzxm1qdgFYukJ05yqeL3Y=; b=hd5nxeNhspyfxoRFTG7MsjQB4L sOB8oL56QwllZjDTfBMga3xzcSPxPq0J6VYHcmZpPc+wAzna9KXEQju+6QQ3WTXDuI0FDBrDNUk9z Dpwu7TibkiGT8VDJVcN9zwEiLoPLt/0lVDcJiBixwPhcwwQcDyyU/5gHJ8YQ72lvx7JVxVGc8OKw5 Skg1oAO8PeFPTHiF/pin4JELwYHvDAQa/cK4s+eDHg+DXYIa8mPqXnJk8iadsDgGHRT5qmZ96DyPE QCcF7yzqYOs8au7Vhl0A2U+L83Y8wiC1bIycV5Qq7vXSzfMhCe+JyvRBsdUOrMBDmGYIv4bf9jxHi AlBzVaCA==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:57117 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from <esq@HIDDEN>) id 1fcOiw-001Ia0-0L; Mon, 09 Jul 2018 00:28:35 -0500 Date: Sun, 08 Jul 2018 22:28:33 -0700 Message-ID: <m2y3elq8ou.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Sun_Jul__8_22:28:32_2018-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1fcOiw-001Ia0-0L X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:57117 X-Source-Auth: lawlist X-Email-Count: 6 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> --Multipart_Sun_Jul__8_22:28:32_2018-1 Content-Type: text/plain; charset=US-ASCII I am now at proof concept patch version 012. The patch applies to the master branch as of yesterday (07/07/2018). Multiple fake cursors and crosshairs now use the same function (mc_move_it) to obtain the relevant X/HPOS coordinates. This version provides better compatibility with horizontal scrolling. Crosshairs now works with X11 and Windows. 1. Download a current version of Emacs master branch. 2. Reset the repository to 07/07/2018: git reset --hard 98463bed07ecc9057094928ffdc2321eaaf3ab52 3. Apply the attached patch from the root repository directory. 4. Build a GUI version of Emacs: X11, NS, or Windows. 5. To try out real fake cursors with Magnar Sveen's library (multiple-fake-cursors), install that package first. 6. Open crosshairs.el (attached) and evaluate the buffer. 7. To play with crosshairs, type: M-x +-mode 8. To see an example of crosshairs playing nicely with tab stretches, open up something like simple.el and enable +-mode. 9. To see an example of a variety of cursor styles and widths, type: M-x mc-test X11 and NS are much quicker than Windows. At some point in the future, I will work on more efficient means of calculating X and HPOS and other ways to speed this up. Before moving on to more complicated aspects, I will continue working on compatibility with horizontal scrolling, tab stretches, and word-wrap/window-wrap/truncate. Keith --Multipart_Sun_Jul__8_22:28:32_2018-1 Content-Type: application/el; type=lawlist-elisp Content-Disposition: attachment; filename="crosshairs.el" Content-Transfer-Encoding: base64 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Cjs7OyBCRUdJTiBtb2RpZmljYXRpb24gb2YgdGhlIE11 bHRpcGxlIEN1cnNvcnMgbGlicmFyeSB3cml0dGVuIGJ5ICBNYWduYXIgU3ZlZW4uCgo7OzsgKHJl cXVpcmUgJ3BhY2thZ2UpCjs7OyAoYWRkLXRvLWxpc3QgJ3BhY2thZ2UtYXJjaGl2ZXMgJygibWVs cGEiIC4gImh0dHA6Ly9tZWxwYS5taWxrYm94Lm5ldC9wYWNrYWdlcy8iKSB0KQo7OzsgTS14IHBh Y2thZ2UtaW5zdGFsbCBtdWx0aXBsZS1jdXJzb3JzCjs7OyBUbyB1c2UgbXVsdGlwbGUtY3Vyc29y cyBhZnRlciByZXN0YXJ0aW5nIEVtYWNzLCBtYWtlIHN1cmUgdGhhdCB0aGUgZm9sbG93aW5nIGxp bmUKOzs7IGFwcGVhcnMgc29tZXdoZXJl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C1jb21tYW5kKSkKICAgICAgICAgICAgICAgICAgICAgIDs7IGxhbWJkYSByZWdpc3Rl cmVkIGJ5IHNtYXJ0cmVwCiAgICAgICAgICAgICAgICAgICAgICAoc3RyaW5nLXByZWZpeC1wICIo IiAoc3ltYm9sLW5hbWUgb3JpZ2luYWwtY29tbWFuZCkpKQogICAgICAgICAgICAgICAgICAobWMv ZXhlY3V0ZS1jb21tYW5kLWZvci1hbGwtZmFrZS1jdXJzb3JzIG9yaWdpbmFsLWNvbW1hbmQpCiAg ICAgICAgICAgICAgICA7OyBzbWFydHJlcCBgaW50ZXJuJ3MgY29tbWFuZHMgaW50byBvd24gb2Jh cnJheSB0byBoZWxwCiAgICAgICAgICAgICAgICA7OyBgZGVzY3JpYmUtYmluZGluZ3MnLiAgU28s IGxldCdzIHJlLWBpbnRlcm4nIGhlcmUgdG8KICAgICAgICAgICAgICAgIDs7IG1ha2UgdGhlIGNv bW1hbmQgY29tcGFyYWJsZSBieSBgZXEnLgogICAgICAgICAgICAgICAgKHNldHEgb3JpZ2luYWwt Y29tbWFuZCAoaW50ZXJuIChzeW1ib2wtbmFtZSBvcmlnaW5hbC1jb21tYW5kKSkpCiAgICAgICAg ICAgICAgICA7OyBvdGhlcndpc2UgaXQncyBhIHN5bWJvbCwgYW5kIHdlIGNhbiBiZSBtb3JlIHRo b3JvdWdoCiAgICAgICAgICAgICAgICAoaWYgKGdldCBvcmlnaW5hbC1jb21tYW5kICdtYy0tdW5z dXBwb3J0ZWQpCiAgICAgICAgICAgICAgICAgICAgKG1lc3NhZ2UgIiVTIGlzIG5vdCBzdXBwb3J0 ZWQgd2l0aCBtdWx0aXBsZSBjdXJzb3JzJXMiCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg b3JpZ2luYWwtY29tbWFuZAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIChnZXQgb3JpZ2lu YWwtY29tbWFuZCAnbWMtLXVuc3VwcG9ydGVkKSkKICAgICAgICAgICAgICAgICAgKHdoZW4gKGFu ZCBvcmlnaW5hbC1jb21tYW5kCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG5vdCAobWVt cSBvcmlnaW5hbC1jb21tYW5kIG1jLS1kZWZhdWx0LWNtZHMtdG8tcnVuLW9uY2UpKQogICAgICAg ICAgICAgICAgICAgICAgICAgICAgIChub3QgKG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy9jbWRz LXRvLXJ1bi1vbmNlKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAob3IgbWMvYWx3YXlz LXJ1bi1mb3ItYWxsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtZW1xIG9yaWdp bmFsLWNvbW1hbmQgbWMtLWRlZmF1bHQtY21kcy10by1ydW4tZm9yLWFsbCkKICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgKG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy9jbWRzLXRvLXJ1 bi1mb3ItYWxsKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWMvcHJvbXB0LWZv ci1pbmNsdXNpb24taW4td2hpdGVsaXN0IG9yaWdpbmFsLWNvbW1hbmQpKSkKICAgICAgICAgICAg ICAgICAgICAobWMvZXhlY3V0ZS1jb21tYW5kLWZvci1hbGwtZmFrZS1jdXJzb3JzIG9yaWdpbmFs LWNvbW1hbmQpKSkpKSkKICAgICAgICAgICAgICAod2hlbiBtYy91c2UtYnVpbHQtaW4tY3Vyc29y cwogICAgICAgICAgICAgICAgKGxldCogKCh3aW4gKHNlbGVjdGVkLXdpbmRvdykpCiAgICAgICAg ICAgICAgICAgICAgICAgKHdpbmRvdy1zdGFydCAod2luZG93LXN0YXJ0IHdpbikpCiAgICAgICAg ICAgICAgICAgICAgICAgKHdpbmRvdy1lbmQgKHdpbmRvdy1lbmQgd2luKSkKICAgICAgICAgICAg ICAgICAgICAgICAob3ZlcmxheXMgKG1jL2FsbC1mYWtlLWN1cnNvcnMpKQogICAgICAgICAgICAg ICAgICAgICAgIChsc3QKICAgICAgICAgICAgICAgICAgICAgICAgIChtYXBjYXIKICAgICAgICAg ICAgICAgICAgICAgICAgICAgKGxhbWJkYSAoeCkKICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAobGV0KiAoKHBvcyAob3ZlcmxheS1zdGFydCB4KSkKICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgKGN1cnJlbnQtY29sdW1uCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKGlmIChhbmQgKD49IHBvcyB3aW5kb3ctc3RhcnQpCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDw9IHBvcyB3aW5kb3ctZW5kKSkKICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChzYXZlLWV4Y3Vyc2lvbgogICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZ290by1jaGFyIHBvcykKICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGN1cnJlbnQtY29sdW1uKSkKICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApKSkKICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIChjb25kCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgo bWMtb2RkcCBjdXJyZW50LWNvbHVtbikKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAobGlzdCBwb3MgImJhciIgIiNGRjAwMDAiKSkgOzsgcmVkIG9yIFsxLjAgMC4wIDAuMF0KICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChtYy1ldmVucCBjdXJyZW50LWNvbHVtbikK ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobGlzdCBwb3MgImJhciIgInllbGxv dyIpKSkpKSA7OyAjRkZGRjAwIG9yIFsxLjAgMS4wIDAuMF0KICAgICAgICAgICAgICAgICAgICAg ICAgICAgb3Z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IgogIDprZXltYXAgbmlsCiAgOmdsb2JhbCBuaWwKICA6Z3Jv dXAgJystbW9kZQogIChjb25kCiAgICAoKy1tb2RlCiAgICAgIChpZiBibGluay1jdXJzb3ItbW9k ZQogICAgICAgIChibGluay1jdXJzb3ItbW9kZSAtMSkpCiAgICAgIChzZXRxIGNyb3NzaGFpcnMg dCkKICAgICAgOzs7IFJFTUlOREVSOiAgVGhlIHVzZXIgY2FuIHN1cHByZXNzIGVpdGhlciBvciBi b3RoIG9mIHRoZSBydWxlcnM6CiAgICAgIDs7IChzZXRxIGNyb3NzaGFpcnMtaG9yaXpvbnRhbC1y dWxlciBuaWwpCiAgICAgIDs7IChzZXRxIGNyb3NzaGFpcnMtdmVydGljYWwtcnVsZXIgbmlsKQog ICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICcrLS1zYXZlZC1zdGF0ZSkgbmlsKQogICAg ICA7OyBTYXZlIHRoZSBsb2NhbCB2YWx1ZXMgb2Ygc29tZSB2YXJpYWJsZXMsIHRvIGJlIHJlc3Rv cmVkIGlmIHZsLW1vZGUgaXMgdHVybmVkIG9mZi4KICAgICAgKGRvbGlzdCAodmFyICcoYnVmZmVy LWRpc3BsYXktdGFibGUKICAgICAgICAgICAgICAgICAgICAgZnJpbmdlLWluZGljYXRvci1hbGlz dAogICAgICAgICAgICAgICAgICAgICB0YWItd2lkdGgKICAgICAgICAgICAgICAgICAgICAgbGlu ZS1tb3ZlLXZpc3VhbAogICAgICAgICAgICAgICAgICAgICB0cnVuY2F0ZS1wYXJ0aWFsLXdpZHRo LXdpbmRvd3MKICAgICAgICAgICAgICAgICAgICAgdHJ1bmNhdGUtbGluZXMKICAgICAgICAgICAg ICAgICAgICAgd29yZC13cmFwKSkKICAgICAgICAod2hlbiAobG9jYWwtdmFyaWFibGUtcCB2YXIp CiAgICAgICAgICAocHVzaCAoY29ucyB2YXIgKHN5bWJvbC12YWx1ZSB2YXIpKSArLS1zYXZlZC1z dGF0ZSkpKQogICA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bmdlLXRvcC1sZWZ0 LWFuZ2xlKQogICAgICAgIChib3R0b20gLiArLWZyaW5nZS1ib3R0b20tcmlnaHQtYW5nbGUpCiAg ICAgICAgKHRvcC1ib3R0b20gLiAoKy1mcmluZ2UtbGVmdC1icmFja2V0CiAgICAgICAgICAgICAg ICAgICAgICAgKy1mcmluZ2UtcmlnaHQtYnJhY2tldAogICAgICAgICAgICAgICAgICAgICAgICst ZnJpbmdlLXRvcC1yaWdodC1hbmdsZQogICAgICAgICAgICAgICAgICAgICAgICstZnJpbmdlLXRv cC1sZWZ0LWFuZ2xlKSkKICAgICAgICAoZW1wdHktbGluZSAuICstZnJpbmdlLWVtcHR5LWxpbmUp CiAgICAgICAgKHVua25vd24gLiArLWZyaW5nZS1xdWVzdGlvbi1tYXJrKSkpCiAgICAgIDs7OyBS RU1BUCBERUZBVUxUIEJFSEFWSU9SIChpZiB0aGUgdXNlciB3YW50cyBzb21ldGhpbmcgZGlmZmVy ZW50KS4KICAgICAgKHNldHEgZnJpbmdlLWN1cnNvci1hbGlzdCAnKChib3ggLiArLWZyaW5nZS1s ZWZ0LXRyaWFuZ2xlKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGhvbGxvdyAu ICstaG9sbG93LXJlY3RhbmdsZSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChi YXIgLiArLXZlcnRpY2FsLWJhcikKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICho YmFyIC4gKy1mcmluZ2UtaG9yaXpvbnRhbC1iYXIpCiAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAoaG9sbG93LXNtYWxsIC4gKy1mcmluZ2UtaG9sbG93LXNxdWFyZSkpKQogICAgICAo c2V0cSBmaWxsLWNvbHVtbiA4MCkKICAgICAgKGFkZC1ob29rICdwb3N0LWNvbW1hbmQtaG9vayAn Ky1kcmF3LWhvcml6b250YWwtcnVsZXIgJ2FwcGVuZCAnbG9jYWwpCiAgICAgIChhZ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iVHVybmVk IE9GRiBgKy1tb2RlJy4iKSkpKSkKCihkZWZ1biB0dXJuLW9mZi0rLW1vZGUgKCkKICAoKy1tb2Rl IC0xKSkKCjs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OwoKKGRlZnVuICstcGFyZW5zLWZuICgpCiJE b2Mtc3RyaW5nLiIKICAobGV0KiAoKG9wb2ludCAocG9pbnQpKQogICAgICAgICAoZnJvbSAocG9p bnQtbWluKSkKICAgICAgICAgKHdpbiAoc2VsZWN0ZWQtd2luZG93KSkKICAgICAgICAgKGkgMCkK ICAgICAgICAgKHByZWNlZGluZy1jaGFyIChwcmVjZWRpbmctY2hhcikpCiAgICAgICAgIChvY2hh ciAoY2hhci1hZnRlciBvcG9pbnQpKQogICAgICAgICAocG9zMQogICAgICAgICAgIChjb25kCiAg ICAgICAgICAgICAoKGFuZCBvY2hhcgogICAgICAgICAgICAgICAgICAgKG9yIDs7OyAoY2hhci10 by1zdHJpbmcgNDApID0+IG9wZW5pbmcgcGFyZW50aGVzaXMKICAgICAgICAgICAgICAgICAgICAg ICAoPSBvY2hhciA0MCkKICAgICAgICAgICAgICAgICAgICAgICA7OzsgKGNoYXItdG8tc3RyaW5n IDkxKSA9PiBvcGVuaW5nIHNxdWFyZSBicmFja2V0CiAgICAgICAgICAgICAgICAgICAgICAgKD0g b2NoYXIgOTEpCiAgICAgICAgICAgICAgICAgICAgICAgOzs7IChjaGFyLXRvLXN0cmluZyAxMjMp ID0+IG9wZW5pbmcgd2F2eSBicmFja2V0CiAgICAgICAgICAgICAgICAgICAgICAgKD0gb2NoYXIg MTIzKSkpCiAgICAgICAgICAgICAgICAobWluICgxKyBvcG9pbnQpIChwb2ludC1tYXgpKSkKICAg ICAgICAgICAgICgob3IgOzs7IChjaGFyLXRvLXN0cmluZyA0MSkgPT4gY2xvc2luZyBwYXJlbnRo ZXNpcwogICAgICAgICAgICAgICAgICAoPSBwcmVjZWRpbmctY2hhciA0MSkKICAgICAgICAgICAg ICAgICAgOzs7IChjaGFyLXRvLXN0cmluZyA5MykgPT4gY2xvc2luZyBzcXVhcmUgYnJhY2tldAog ICAgICAgICAgICAgICAgICAoPSBwcmVjZWRpbmctY2hhciA5MykKICAgICAgICAgICAgICAgICAg Ozs7IChjaGFyLXRvLXN0cmluZyAxMjUpID0+IGNsb3Npbmcgd2F2eSBicmFja2V0CiAgICAgICAg ICAgICAgICAgICg9IHByZWNlZGluZy1jaGFyIDEyNSkpCiAgICAgICAgICAgICAgICAobWF4IChw b2ludC1taW4pICgxLSBvcG9pbnQpKSkKICAgICAgICAgICAgICh0CiAgICAgICAgICAgICAgICBv cG9pbnQpKSkKICAgICAgICAgcG9zMgogICAgICAgICBzZWxlY3RlZC1mYWNlKQogICAgKHNhdmUt ZXhjdXJzaW9uCiAgICAgIChjb25kaXRpb24tY2FzZSBuaWwKICAgICAgICAod2hpbGUgKHNldHEg cG9zMSAobnRoIDEgKHBhcnNlLXBhcnRpYWwtc2V4cCBmcm9tIHBvczEpKSkKICAgICAgICAgIChz ZXRxIHBvczIgKHNjYW4tc2V4cHMgcG9zMSAxKSkKICAgICAgICAgIChpZiAoPSBpIDEwKQogICAg ICAgICAgICAoc2V0cSBpIDEpCiAgICAgICAgICAgIChpbmNmIGkpKQogICAgICAgICAgKHNldHEg c2VsZWN0ZWQtZmFjZSAoY29uZAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBp IDEpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtb25lLWZhY2Up CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgMikKICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy10d28tZmFjZSkKICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAoKD0gaSAzKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JystcGFyZW5zLXRocmVlLWZhY2UpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9 IGkgNCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1mb3VyLWZh Y2UpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgNSkKICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1maXZlLWZhY2UpCiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgKCg9IGkgNikKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICcrLXBhcmVucy1zaXgtZmFjZSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo KD0gaSA3KQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLXNldmVu LWZhY2UpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgOCkKICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1laWdodC1mYWNlKQogICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDkpCiAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAnKy1wYXJlbnMtbmluZS1mYWNlKQogICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICgoPSBpIDEwKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5z LXRlbi1mYWNlKSkpCiAgICAgICAgICAobGV0ICgob3YgKG1ha2Utb3ZlcmxheSBwb3MxICgxKyBw b3MxKSkpKQogICAgICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ3dpbmRvdyB3aW4pCiAgICAgICAg ICAgIChvdmVybGF5LXB1dCBvdiAnZmFjZSBzZWxlY3RlZC1mYWNlKSkKICAgICAgICAgICh3aGVu IHBvczIKICAgICAgICAgICAgKGxldCAoKG92IChtYWtlLW92ZXJsYXkgKDEtIHBvczIpIHBvczIp KSkKICAgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ3dpbmRvdyB3aW4pCiAgICAgICAgICAg ICAgKG92ZXJsYXktcHV0IG92ICdmYWNlIHNlbGVjdGVkLWZhY2UpKSkpCiAgICAgICAgKGVycm9y IG5pbCkpKQogICAgKHNldHEgKy1wYXJlbnMtb3ZlcmxheXMtZXhpc3QtcCB0KSkpCgooZGVmdW4g Ky1yZW1vdmUtb3ZlcmxheXMgKGJlZyBlbmQgbmFtZSB2YWwpCiJSZW1vdmUgdGhlIG92ZXJsYXlz IHRoYXQgYXJlIGBlcXVhbC1pbmNsdWRpbmctcHJvcGVydGllc2AuCkluY2x1ZGVzIGEgdW5pcXVl IHNpdHVhdGlvbiB3aGVuIGFuIG92ZXJsYXkgd2l0aCBhbiBgJ2FmdGVyLXN0cmluZ2AgcHJvcGVy dHkKaXMgYXQgdGhlIHZlcnkgZW5kIG9mIGEgbmFycm93ZWQtYnVmZmVyLiIKICAobGV0KiAoCiAg ICAgIChwb2ludC1tYXggKHBvaW50LW1heCkpCiAgICAgIChwb2ludC1taW4gKHBvaW50LW1pbikp CiAgICAgIChuYXJyb3dlZC1wIChidWZmZXItbmFycm93ZWQtcCkpCiAgICAgIChiZWcgKGlmIGJl ZyBiZWcgcG9pbnQtbWluKSkKICAgICAgKGVuZAogICAgICAgIChjb25kCiAgICAgICAgICAoKGFu ZAogICAgICAgICAgICAgIChub3QgbmFycm93ZWQtcCkKICAgICAgICAgICAgICBlbmQpCiAgICAg ICAgICAgIGVuZCkKICAgICAgICAgICgoYW5kCiAgICAgICAgICAgICAgKG5vdCBuYXJyb3dlZC1w KQogICAgICAgICAgICAgIChudWxsIGVuZCkpCiAgICAgICAgICAgIHBvaW50LW1heCkKICAgICAg ICAgICgoYW5kCiAgICAgICAgICAgICAgbmFycm93ZWQtcAogICAgICAgICAgICAgIGVuZAogICAg ICAgICAgICAgICg8IGVuZCBwb2ludC1tYXgpKQogICAgICAgICAgICBlbmQpCiAgICAgICAgICAo KGFuZAogICAgICAgICAgICAgIG5hcnJvd2VkLXAKICAgICAgICAgICAgICBlbmQKICAgICAgICAg ICAgICAoPSBlbmQgcG9pbnQtbWF4KSkKICAgICAgICAgICAgKDErIGVuZCkpCiAgICAgICAgICAo KGFuZAogICAgICAgICAgICAgIG5hcnJvd2VkLXAKICAgICAgICAgICAgICAobnVsbCBlbmQpKQog ICAgICAgICAgICAoMSsgcG9pbnQtbWF4KSkgKSkKICAgICAgKG92ZXJsYXlzCiAgICAgICAgKHBy b2duCiAgICAgICAgICAob3ZlcmxheS1yZWNlbnRlciBlbmQpCiAgICAgICAgICAob3ZlcmxheXMt aW4gYmVnIGVuZCkpKSApCiAgICAod2hlbiAoYW5kIGJlZyBlbmQgbmFtZSB2YWwpCiAgICAgIChk b2xpc3QgKG8gb3ZlcmxheXMpCiAgICAgICAgKGNvbmQKICAgICAgICAgICgoYW5kCiAgICAgICAg ICAgICAgICAoZXEgbmFtZSAnZmFjZSkKICAgICAgICAgICAgICAgIChlcSAob3ZlcmxheS1nZXQg byBuYW1lKSB2YWwpKQogICAgICAgICAgICA7OyBFaXRoZXIgcHVzaCB0aGlzIG92ZXJsYXkgb3V0 c2lkZSBiZWcuLi5lbmQKICAgICAgICAgICAgOzsgb3Igc3BsaXQgaXQgdG8gZXhjbHVkZSBiZWcu Li5lbmQKICAgICAgICAgICAgOzsgb3IgZGVsZXRlIGl0IGVudGlyZWx5IChpZiBpdCBpcyBjb250 YWluZWQgaW4gYmVnLi4uZW5kKS4KICAgICAgICAgICAgKGlmICg8IChvdmVybGF5LXN0YXJ0IG8p IGJlZykKICAgICAgICAgICAgICAgIChpZiAoPiAob3ZlcmxheS1lbmQgbykgZW5kKQogICAgICAg ICAgICAgIChwcm9nbgogICAgICAgICAgICAgICAgKG1vdmUtb3ZlcmxheSAoY29weS1vdmVybGF5 IG8pCiAgICAgICAgICAgICAgICAgIChvdm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qKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIG11bHRpcGxlIGN1cnNvcnMgKi8KKworICBYU0VU RkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgbWNfZ2x5cGhfbGlzdCksIGlkeCk7 ICsraWR4OworICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgY3Jvc3No YWlycyksIGlkeCk7ICsraWR4OworICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9m bGFncywgY3Jvc3NoYWlyc19ob3Jpem9udGFsX3J1bGVyKSwgaWR4KTsgKytpZHg7CisgIFhTRVRG QVNUSU5UIChCVkFSICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBjcm9zc2hhaXJzX3ZlcnRpY2FsX3J1 bGVyKSwgaWR4KTsgKytpZHg7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwogICBYU0VURkFT VElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgbW9kZV9saW5lX2Zvcm1hdCksIGlkeCk7 ICsraWR4OwogICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgYWJicmV2 X21vZGUpLCBpZHgpOyArK2lkeDsKICAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxf ZmxhZ3MsIG92ZXJ3cml0ZV9tb2RlKSwgaWR4KTsgKytpZHg7CkBAIC01MjAwLDYgKzUyMDksMTUg QEAgaW5pdF9idWZmZXJfb25jZSAodm9pZCkKICAgLyogTXVzdCBkbyB0aGVzZSBiZWZvcmUgbWFr aW5nIHRoZSBmaXJzdCBidWZmZXIhICovCiAKICAgLyogcmVhbCBzZXR1cCBpcyBkb25lIGluIGJp bmRpbmdzLmVsICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIG11bHRpcGxlIGN1cnNv cnMgKi8KKworICBic2V0X2Jsdl9tY19nbHlwaF9saXN0ICgmYnVmZmVyX2RlZmF1bHRzLCBRbmls KTsKKyAgYnNldF9ibHZfY3Jvc3NoYWlycyAoJmJ1ZmZlcl9kZWZhdWx0cywgUW5pbCk7CisgIGJz ZXRfYmx2X2Nyb3NzaGFpcnNfaG9yaXpvbnRhbF9ydWxlciAoJmJ1ZmZlcl9kZWZhdWx0cywgUXQp OworICBic2V0X2Jsdl9jcm9zc2hhaXJzX3ZlcnRpY2FsX3J1bGVyICgmYnVmZmVyX2RlZmF1bHRz LCBRdCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwogICBic2V0X21vZGVfbGluZV9mb3Jt YXQgKCZidWZmZXJfZGVmYXVsdHMsIGJ1aWxkX3B1cmVfY19zdHJpbmcgKCIlLSIpKTsKICAgYnNl dF9oZWFkZXJfbGluZV9mb3JtYXQgKCZidWZmZXJfZGVmYXVsdHMsIFFuaWwpOwogICBic2V0X2Fi YnJldl9tb2RlICgmYnVmZmVyX2RlZmF1bHRzLCBRbmlsKTsKQEAgLTU0NDgsNiArNTQ2NiwxNiBA QCBzeW1zX29mX2J1ZmZlciAodm9pZCkKICAgc3RhdGljcHJvICgmUVNGdW5kYW1lbnRhbCk7CiAg IHN0YXRpY3BybyAoJlZidWZmZXJfYWxpc3QpOwogCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIG11bHRpcGxlIGN1cnNvcnMgKi8KKworICBERUZTWU0gKFFtY19nbHlwaF9saXN0LCAibWMt Z2x5cGgtbGlzdCIpOworICBERUZTWU0gKFFjcm9zc2hhaXJzLCAiY3Jvc3NoYWlycyIpOworICBE RUZTWU0gKFFjcm9zc2hhaXJzX2hvcml6b250YWxfcnVsZXIsICJjcm9zc2hhaXJzLWhvcml6b250 YWwtcnVsZXIiKTsKKyAgREVGU1lNIChRY3Jvc3NoYWlyc192ZXJ0aWNhbF9ydWxlciwgImNyb3Nz aGFpcnMtdmVydGljYWwtcnVsZXIiKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKICAg REVGU1lNIChRY2hvaWNlLCAiY2hvaWNlIik7CiAgIERFRlNZTSAoUWxlZnQsICJsZWZ0Iik7CiAg IERFRlNZTSAoUXJpZ2h0LCAicmlnaHQiKTsKQEAgLTU0ODUsNiArNTUxMywyNCBAQCBzeW1zX29m X2J1ZmZlciAodm9pZCkKICAgRnB1dCAoUXByb3RlY3RlZF9maWVsZCwgUWVycm9yX21lc3NhZ2Us CiAJYnVpbGRfcHVyZV9jX3N0cmluZyAoIkF0dGVtcHQgdG8gbW9kaWZ5IGEgcHJvdGVjdGVkIGZp ZWxkIikpOwogCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIG11bHRpcGxlIGN1cnNvcnMg Ki8KKworICBERUZWQVJfUEVSX0JVRkZFUiAoIm1jLWdseXBoLWxpc3QiLCAmQlZBUiAoY3VycmVu dF9idWZmZXIsIG1jX2dseXBoX2xpc3QpLCBRbmlsLAorICAgIGRvYzogLyogQSBidWZlci1sb2Nh bCB2YXJpYWJsZSB0byBzdG9yZSB0aGUgdmFsdWUgb2YgdGhlIG11bHRpcGxlIGN1cnNvcnMgdG8g YmUgZGlzcGxheWVkCitkdXJpbmcgdGhlIG5leHQgcmVkaXNwbGF5LiAgKi8pOworCisgIERFRlZB Ul9QRVJfQlVGRkVSICgiY3Jvc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YS9zcmMvYnVmZmVyLmgKKysr IGIvc3JjL2J1ZmZlci5oCkBAIC02NTgsNiArNjU4LDIzIEBAIHN0cnVjdCBidWZmZXIKICAgICAg Y2FjaGUgYXJlIGVuYWJsZWQuICBTZWUgc2VhcmNoLmMsIGluZGVudC5jIGFuZCBiaWRpLmMgZm9y IGRldGFpbHMuICAqLwogICBMaXNwX09iamVjdCBjYWNoZV9sb25nX3NjYW5zXzsKIAorLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBtdWx0aXBsZSBjdXJzb3JzICovCisKKyAgLyogVGhlIG5h bWUgb2YgbGlzdCB1c2VkIGJ5IG11bHRpcGxlIGN1cnNvcnMgZm9yIG5leHQgcmVkaXNwbGF5LiAg Ki8KKyAgTGlzcF9PYmplY3QgbWNfZ2x5cGhfbGlzdF87CisKKyAgLyogVGhlIG5hbWUgb2YgbGlz dC4gICovCisgIExpc3BfT2JqZWN0IGNyb3NzaGFpcnNfOworCisgIC8qIFRoZSBuYW1lIG9mIHRo ZSBjcm9zc2hhaXJzIGhvcml6b250YWwgcnVsZXIuICAqLworICBMaXNwX09iamVjdCBjcm9zc2hh aXJzX2hvcml6b250YWxfcnVsZXJfOworCisgIC8qIFRoZSBuYW1lIG9mIHRoZSBjcm9zc2hhaXJz IHZlcnRpY2FsIHJ1bGVyLiAgKi8KKyAgTGlzcF9PYmplY3QgY3Jvc3NoYWlyc192ZXJ0aWNhbF9y dWxlcl87CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCiAgIC8qIElmIHRoZSB3aWR0aCBy dW4gY2FjaGUgaXMgZW5hYmxlZCwgdGhpcyB0YWJsZSBjb250YWlucyB0aGUKICAgICAgY2hhcmFj dGVyIHdpZHRocyB3aWR0aF9ydW5fY2FjaGUgKHNlZSBh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ydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFsKQoreworICBiLT5jcm9zc2hh aXJzX3ZlcnRpY2FsX3J1bGVyXyA9IHZhbDsKK30KKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKIElOTElORSB2b2lkCiBic2V0X2JpZGlfcGFyYWdyYXBoX2RpcmVjdGlvbiAoc3RydWN0IGJ1 ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFsKQogewpkaWZmIC0tZ2l0IGEvc3JjL2Rpc3BleHRlcm4u aCBiL3NyYy9kaXNwZXh0ZXJuLmgKaW5kZXggMjE4MGM5YS4uNTA5NzBiMiAxMDA2NDQKLS0tIGEv c3JjL2Rpc3BleHRlcm4uaAorKysgYi9zcmMvZGlzcGV4dGVybi5oCkBAIC0yODk5LDcgKzI4OTks MTMgQEAgc3RydWN0IHJlZGlzcGxheV9pbnRlcmZhY2UKIAkJCSAgICAgIHN0cnVjdCBnbHlwaF9y b3cgKmdseXBoX3JvdywKIAkJCSAgICAgIGludCB4LCBpbnQgeSwKIAkJCSAgICAgIGVudW0gdGV4 dF9jdXJzb3Jfa2luZHMgY3Vyc29yX3R5cGUsCi0JCQkgICAgICBpbnQgY3Vyc29yX3dpZHRoLCBi b29sIG9uX3AsIGJvb2wgYWN0aXZlX3ApOworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBt dWx0aXBsZSBjdXJzb3JzICovCisKKyAgICAgICAgIGludCBjdXJzb3Jfd2lkdGgsIGJvb2wgb25f cCwgYm9vbCBhY3RpdmVfcCwKKyAgICAgICAgIExpc3BfT2JqZWN0IGNvbG9yX3ZlY3RvciwgTGlz cF9PYmplY3QgZmxhdm9yKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCiAKICAgLyogRHJh dyB2ZXJ0aWNhbCBib3JkZXIgZm9yIHdpbmRvdyBXIGZyb20gKFgsWV8wKSB0byAoWCxZXzEpLiAg Ki8KICAgdm9pZCAoKmRyYXdfdmVydGljYWxfd2luZG93X2JvcmRlcikgKHN0cnVjdCB3aW5kb3cg KncsCkBAIC0zMjg0LDYgKzMyOTAsMTMgQEAgZXh0ZXJuIHZvaWQgZ2V0X2ZvbnRfYXNjZW50X2Rl c2NlbnQgKHN0cnVjdCBmb250ICosIGludCAqLCBpbnQgKik7CiAKICNpZmRlZiBIQVZFX1dJTkRP V19TWVNURU0KIAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBtdWx0aXBsZSBjdXJzb3Jz ICovCisKK3ZvaWQgbWNfcG9ydGFsIChzdHJ1Y3Qgd2luZG93ICosIGJvb2wpOworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKwogI2lmZGVmIEdMWVBIX0RFQlVHCiBleHRlcm4gdm9pZCBkdW1w X2dseXBoX3N0cmluZyAoc3RydWN0IGdseXBoX3N0cmluZyAqKSBFWFRFUk5BTExZX1ZJU0lCTEU7 CiAjZW5kaWYKZGlmZiAtLWdpdCBhL3NyYy9mcmluZ2UuYyBiL3NyYy9mcmluZ2UuYwppbmRleCA2 MDY5MTg0Li5kNTFlNjUxIDEwMDY0NAotLS0gYS9zcmMvZnJpbmdlLmMKKysrIGIvc3JjL2ZyaW5n ZS5jCkBAIC00MzIsNiArNDMyLDIyNCBAQCBzdGF0aWMgdW5zaWduZWQgc2hvcnQgZW1wdHlfbGlu ZV9iaXRzW10gPSB7CiAgIDB4MDAsIDB4M2MsIDB4MDAsIDB4MDAsIDB4M2MsIDB4MDAsI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wiLi4uLlhYLi5cIgorICAgIFwiLi4uLi4uWFhcIlwpIgorICAg ICAgKHVubGVzcyAoY2RyIHN0cmluZ3MpCisgICAgICAgIChzZXRxIHN0cmluZ3MgKHNwbGl0LXN0 cmluZyAoY2FyIHN0cmluZ3MpICJcbiIpKSkKKyAgICAgIChhcHBseSAndmVjdG9yCisgICAgICAg IChtYXBjYXIKKyAgICAgICAgICAobGFtYmRhIChzdHIpCisgICAgICAgICAgICAobGV0ICgobnVt IDApKQorICAgICAgICAgICAgICAoZG9saXN0IChjIChzdHJpbmctdG8tbGlzdCBzdHIpKQorICAg ICAgICAgICAgICAgIChzZXRxIG51bSAoKyAoKiBudW0gMikgKGlmIChlcSBjID8uKSAwIDEpKSkp CisgICAgICAgICAgICAgIChmb3JtYXQgIiUjLXgiIG51bSkpKQorICAgICAgICAgIHN0cmluZ3Mp KSkKKyovCisKKy8qIDI0CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAg InguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgIngu Lnh4Li4uIgorICAgICAgInguLi54eC4uIgorICAgICAgInguLi4ueHguIgorICAgICAgIngueHh4 eHh4IgorICAgICAgIngueHh4eHh4IgorICAgICAgInguLi4ueHguIgorICAgICAgInguLi54eC4u IgorICAgICAgInguLnh4Li4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgor ICAgICAgInguLi4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdmVydGljYWxf YmFyX3JpZ2h0X2FuZ2xlX2JpdHNbXSA9eworICAweDgwLCAweDgwLCAweDgwLCAweDk4LCAweDhj LCAweDg2LCAweGJmLAorICAweGJmLCAweDg2LCAweDhjLCAweDk4LCAweDgwLCAweDgwLCAweDgw fTsKKworLyogMjUKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHh4 eHh4eHgiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4ueHgu LngiCisgICAgICAieC4uLnh4LngiCisgICAgICAieC4uLi54eHgiCisgICAgICAieC54eHh4eHgi CisgICAgICAieC54eHh4eHgiCisgICAgICAieC4uLi54eHgiCisgICAgICAieC4uLnh4LngiCisg ICAgICAieC4ueHguLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAg ICAieHh4eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19ob2xsb3dfcmVjdGFu Z2xlX3JpZ2h0X2FuZ2xlX2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweDk5LCAweDhk LCAweDg3LCAweGJmLAorICAweGJmLCAweDg3LCAweDhkLCAweDk5LCAweDgxLCAweDgxLCAweGZm fTsKKworLyogMjYKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHh4 eHh4eHgiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4u LngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngi CisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisg ICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAg ICAieHh4eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19ob2xsb3dfcmVjdGFu Z2xlX2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgx LAorICAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweGZmfTsKKworLyogMjcK KyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC4uLi4uLi4iCisgICAg ICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAi eC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4u Li4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4u Li4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4i KQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY192ZXJ0aWNhbF9iYXJfYml0c1tdID17Cisg IDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsCisgIDB4ODAsIDB4ODAs IDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODB9OworCisvKiAyOAorICAgICgrLWZyaW5nZS1o ZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICJ4eC4uLi4uLiIKKyAgICAgICIueHguLi4uLiIKKyAg ICAgICIuLnh4Li4uLiIKKyAgICAgICIuLi54eC4uLiIKKyAgICAgICIuLi4ueHguLiIKKyAgICAg ICIuLi4uLnh4LiIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLnh4LiIKKyAgICAgICIu Li4ueHguLiIKKyAgICAgICIuLi54eC4uLiIKKyAgICAgICIuLnh4Li4uLiIKKyAgICAgICIueHgu Li4uLiIKKyAgICAgICJ4eC4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3Jp Z2h0X2FuZ2xlX2JpdHNbXSA9eworICAweGMwLCAweDYwLCAweDMwLCAweDE4LCAweGMsIDB4Niwg MHgzLCAweDYsIDB4YywgMHgxOCwgMHgzMCwgMHg2MCwgMHhjMH07CisKKy8qIDI5CisgICAgKCst ZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Li4uLi4uIgorICAgICAgInh4Li4u Li4uIgorICAgICAgIiB4eC4uLi4uIgorICAgICAgIi54eC4uLi4uIgorICAgICAgIi4ueHguLi4u IgorICAgICAgIi4ueHguLi4uIgorICAgICAgIi4uLnh4Li4uIgorICAgICAgIi4uLnh4Li4uIgor ICAgICAgIi4uLi54eC4uIgorICAgICAgIi4uLi54eC4uIgorICAgICAgIi4uLi4ueHguIgorICAg ICAgIi4uLi4ueHguIgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IikKKyovCitz dGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfYmFja3NsYXNoX2JpdHNbXSA9eworICAweGMwLCAweGMw LCAweGUwLCAweDYwLCAweDMwLCAweDMwLCAweDE4LCAweDE4LCAweGMsIDB4YywgMHg2LCAweDYs IDB4MywgMHgzfTsKKworLyogMzAKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisg ICAgICAieHguLi4uLi4iCisgICAgICAieHguLi4uLi4iCisgICAgICAieHh4Li4uLi4iCisgICAg ICAieHh4Li4uLi4iCisgICAgICAieC54eC4uLi4iCisgICAgICAieC54eC4uLi4iCisgICAgICAi eC4ueHguLi4iCisgICAgICAieC4ueHguLi4iCisgICAgICAieC4uLnh4Li4iCisgICAgICAieC4u Lnh4Li4iCisgICAgICAieC4uLi54eC4iCisgICAgICAieC4uLi54eC4iCisgICAgICAieC4uLi4u eHgiCisgICAgICAieC4uLi4ueHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY192ZXJ0 aWNhbF9iYXJfYmFja3NsYXNoX2JpdHNbXSA9eworICAweGMwLCAweGMwLCAweGUwLCAweGUwLCAw eGIwLCAweGIwLCAweDk4LAorICAweDk4LCAweDhjLCAweDhjLCAweDg2LCAweDg2LCAweDgzLCAw eDgzfTsKKworLyogMzEKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAi Lnh4eHh4eC4iCisgICAgICAieHh4eC54Li4iCisgICAgICAieHh4eC54Li4iCisgICAgICAieHh4 eC54Li4iCisgICAgICAiLnh4eC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54 Li4iCisgICAgICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4i CisgICAgICAiLi4ueC54Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19waWxjcm93 X2JpdHNbXSA9eworICAweDdlLCAweGY0LCAweGY0LCAweGY0LCAweDc0LCAweDE0LCAweDE0LCAw eDE0LCAweDE0LCAweDE0LCAweDE0fTsKKworLyogMzIKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhl eGFkZWNpbWFsCisgICAgICAieHgueHguLi4iCisgICAgICAiLnh4Lnh4Li4iCisgICAgICAiLi54 eC54eC4iCisgICAgICAiLi4ueHgueHgiCisgICAgICAiLi54eC54eC4iCisgICAgICAiLnh4Lnh4 Li4iCisgICAgICAieHgueHguLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19yaWdo dF9kb3VibGVfYW5nbGVfYml0c1tdID17CisgIDB4ZDgsIDB4NmMsIDB4MzYsIDB4MWIsIDB4MzYs IDB4NmMsIDB4ZDh9OworCisvKiAzMworICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwK KyAgICAgICIuLnh4eHguLiIKKyAgICAgICIueHh4eHh4LiIKKyAgICAgICJ4Li54eC4ueCIKKyAg ICAgICJ4Li54eC4ueCIKKyAgICAgICJ4eHh4eHh4eCIKKyAgICAgICJ4eC4uLi54eCIKKyAgICAg ICJ4eHguLnh4eCIKKyAgICAgICIueHh4eHh4LiIKKyAgICAgICIuLnh4eHguLiIpCisqLworc3Rh dGljIHVuc2lnbmVkIHNob3J0IG1jX3NtaWxleV9mYWNlX2JpdHNbXSA9eworICAweDNjLCAweDdl LCAweDk5LCAweDk5LCAweGZmLCAweGMzLCAweGU3LCAweDdlLCAweDNjfTsKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCiAKICNkZWZpbmUgQllURVNfUEVSX0JJVE1BUF9ST1cgIChzaXplb2Yg KHVuc2lnbmVkIHNob3J0KSkKICNkZWZpbmUgU1RBTkRBUkRfQklUTUFQX0hFSUdIVChiaXRzKSAo c2l6ZW9mIChiaXRzKS9CWVRFU19QRVJfQklUTUFQX1JPVykKQEAgLTQ2Niw2ICs2ODQsMzEgQEAg c3RhdGljIHN0cnVjdCBmcmluZ2VfYml0bWFwIHN0YW5kYXJkX2JpdG1hcHNbXSA9CiAgIHsgRlJC SVRTICh2ZXJ0aWNhbF9iYXJfYml0cyksICAgICAgIDgsIDAsIEFMSUdOX0JJVE1BUF9DRU5URVIs IDAgfSwKICAgeyBGUkJJVFMgKGhvcml6b250YWxfYmFyX2JpdHMpLCAgICAgOCwgMCwgQUxJR05f QklUTUFQX0JPVFRPTSwgMCB9LAogICB7IEZSQklUUyAoZW1wdHlfbGluZV9iaXRzKSwgICAgICAg ICA4LCAzLCBBTElHTl9CSVRNQVBfVE9QLCAgICAwIH0sCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKy8qIG11bHRpcGxlIGN1cnNvcnMgKi8KKworICAvKiAyNCAqLworICB7IEZSQklUUyAobWNf dmVydGljYWxfYmFyX3JpZ2h0X2FuZ2xlX2JpdHMpLCAgICAgOCwgMCwgQUxJR05fQklUTUFQX0NF TlRFUiwgMCB9LAorICAvKiAyNSAqLworICB7IEZSQklUUyAobWNfaG9sbG93X3JlY3RhbmdsZV9y aWdodF9hbmdsZV9iaXRzKSwgOCwgMCwgQUxJR05fQklUTUFQX0NFTlRFUiwgMCB9LAorICAvKiAy NiAqLworICB7IEZSQklUUyAobWNfaG9sbG93X3JlY3RhbmdsZV9iaXRzKSwgICAgICAgICAgICAg OCwgMCwgQUxJR05fQklUTUFQX0NFTlRFUiwgMCB9LAorICAvKiAyNyAqLworICB7IEZSQklUUyAo bWNfdmVydGljYWxfYmFyX2JpdHMpLCAgICAgICAgICAgICAgICAgOCwgMCwgQUxJR05fQklUTUFQ X0NFTlRFUiwgMCB9LAorICAvKiAyOCAqLworICB7IEZSQklUUyAobWNfcmlnaHRfYW5nbGVfYml0 cyksICAgICAgICAgICAgICAgICAgOCwgMCwgQUxJR05fQklUTUFQX0NFTlRFUiwgMCB9LAorICAv KiAyOSAqLworICB7IEZSQklUUyAobWNfYmFja3NsYXNoX2JpdHMpLCAgICAgICAgICAgICAgICAg ICAgOCwgMCwgQUxJR05fQklUTUFQX0NFTlRFUiwgMCB9LAorICAvKiAzMCAqLworICB7IEZSQklU UyAobWNfdmVydGljYWxfYmFyX2JhY2tzbGFzaF9iaXRzKSwgICAgICAgOCwgMCwgQUxJR05fQklU TUFQX0NFTlRFUiwgMCB9LAorICAvKiAzMSAqLworICB7IEZSQklUUyAobWNfcGlsY3Jvd19iaXRz KSwgICAgICAgICAgICAgICAgICAgICAgOCwgMCwgQUxJR05fQklUTUFQX0NFTlRFUiwgMCB9LAor ICAvKiAzMiAqLworICB7IEZSQklUUyAobWNfcmlnaHRfZG91YmxlX2FuZ2xlX2JpdHMpLCAgICAg ICAgICAgOCwgMCwgQUxJR05fQklUTUFQX0NFTlRFUiwgMCB9LAorICAvKiAzMyAqLworICB7IEZS QklUUyAobWNfc21pbGV5X2ZhY2VfYml0cyksICAgICAgICAgICAgICAgICAgOCwgMCwgQUxJR05f QklUTUFQX0NFTlRFUiwgMCB9LAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KIH07CiAKICNk ZWZpbmUgTk9fRlJJTkdFX0JJVE1BUCAwCkBAIC0xNzE1LDYgKzE5NTgsNzYgQEAgSWYgbmlsLC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GUt YW5nbGUiKTsKKyAgVmZyaW5nZV9iaXRtYXBzID0gRmNvbnMgKFFtY19yaWdodF9kb3VibGVfYW5n bGUsIFZmcmluZ2VfYml0bWFwcyk7CisgIEZwdXQgKFFtY19yaWdodF9kb3VibGVfYW5nbGUsIFFm cmluZ2UsIG1ha2VfbnVtYmVyICgzMikpOworICAvKiAoZ2V0ICcrLXJpZ2h0LWRvdWJsZS1hbmds ZSAnZnJpbmdlKSA9PiAzMiAqLworCisgIC8qIDMzICovCisgIERFRlNZTSAoUW1jX3NtaWxleV9m YWNlLCAiKy1zbWlsZXktZmFjZSIpOworICBWZnJpbmdlX2JpdG1hcHMgPSBGY29ucyAoUW1jX3Nt aWxleV9mYWNlLCBWZnJpbmdlX2JpdG1hcHMpOworICBGcHV0IChRbWNfc21pbGV5X2ZhY2UsIFFm cmluZ2UsIG1ha2VfbnVtYmVyICgzMykpOworICAvKiAoZ2V0ICcrLXNtaWxleS1mYWNlICdmcmlu Z2UpID0+IDMzICovCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCiB9CiAKIC8qIEdhcmJh Z2UgY29sbGVjdGlvbiBob29rICovCmRpZmYgLS1naXQgYS9zcmMva2V5Ym9hcmQuYyBiL3NyYy9r ZXlib2FyZC5jCmluZGV4IGFhNThlMjYuLjg1Y2EwMDkgMTAwNjQ0Ci0tLSBhL3NyYy9rZXlib2Fy ZC5jCisrKyBiL3NyYy9rZXlib2FyZC5jCkBAIC0xMjI0LDYgKzEyMjQsMjcgQEAgc3RhdGljIGlu dCByZWFkX2tleV9zZXF1ZW5jZSAoTGlzcF9PYmplY3QgKiwgTGlzcF9PYmplY3QsCiAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBib29sLCBib29sLCBib29sLCBib29sKTsKIHN0YXRpYyB2 b2lkIGFkanVzdF9wb2ludF9mb3JfcHJvcGVydHkgKHB0cmRpZmZfdCwgYm9vbCk7CiAKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogbXVsdGlwbGUgY3Vyc29ycyAqLworCitzdGF0aWMgdm9p ZAora2JkX21jX2FjdGl2YXRlX2N1cnNvcnMgKHZvaWQpCit7CisgIHN0cnVjdCB3aW5kb3cgKncg PSBkZWNvZGVfbGl2ZV93aW5kb3cgKHNlbGVjdGVkX3dpbmRvdyk7CisgIHctPm1jLmRyYXdfZ2x5 cGhfY3Vyc29yID0gdHJ1ZTsKKyAgdy0+bWMuZXJhc2VfZ2x5cGhfY3Vyc29yID0gdHJ1ZTsKK30K Kworc3RhdGljIHZvaWQKK2tiZF9tY19hY3RpdmF0ZV9jcm9zc2hhaXJzICh2b2lkKQoreworICBz dHJ1Y3Qgd2luZG93ICp3ID0gZGVjb2RlX2xpdmVfd2luZG93IChzZWxlY3RlZF93aW5kb3cpOwor ICB3LT5tYy5kcmF3X2Nyb3NzaGFpcnMgPSB0cnVlOworICB3LT5tYy5lcmFzZV9jcm9zc2hhaXJz ID0gdHJ1ZTsKK30KKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKIExpc3BfT2JqZWN0CiBj b21tYW5kX2xvb3BfMSAodm9pZCkKIHsKQEAgLTE0MTksNiArMTQ0MCwxMyBAQCBjb21tYW5kX2xv b3BfMSAodm9pZCkKICAgICAgIFZyZWFsX3RoaXNfY29tbWFuZCA9IGNtZDsKICAgICAgIHNhZmVf cnVuX2hvb2tzIChRcHJlX2NvbW1hbmRfaG9vayk7CiAKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogbXVsdGlwbGUgY3Vyc29ycyAqLworCisgICAgICBrYmRfbWNfYWN0aXZhdGVfY3Vyc29y cyAoKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKICAgICAgIGFscmVhZHlfYWRqdXN0 ZWQgPSAwOwogCiAgICAgICBpZiAoTklMUCAoVnRoaXNfY29tbWFuZCkpCmRpZmYgLS1naXQgYS9z cmMvbnN0ZXJtLm0gYi9zcmMvbnN0ZXJtLm0KaW5kZXggYTE1Njg0ZC4uMmI3MDA2ZiAxMDA2NDQK LS0tIGEvc3JjL25zdGVybS5tCisrKyBiL3NyYy9uc3Rlcm0ubQpAQCAtMTE4OCwxMCArMTE4OCwx MiBAQCBzdGF0aWMgTlNSZWN0IGNvbnN0cmFpbl9mcmFtZV9yZWN0KE5TUmVjdCBmcmFtZVJlY3Qs IGJvb2wgaXNGdWxsc2NyZWVuKQogICAgIHsKICAgICAgIGJsb2NrX2lucHV0ICgpOwogCi0gICAg ICBpZiAoY3Vyc29yX29uX3ApCi0JZGlzcGxheV9hbmRfc2V0X2N1cnNvciAodywgMSwKLQkJCQl3 LT5vdXRwdXRfY3Vyc29yLmhwb3MsIHctPm91dHB1dF9jdXJzb3IudnBvcywKLQkJCQl3LT5vdXRw dXRfY3Vyc29yLngsIHctPm91dHB1dF9jdXJzb3IueSk7CisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKy8qIG11bHRpcGxlIGN1cnNvcnMgKi8KKworICAgICAgbWNfcG9ydGFsICh3LCBjdXJzb3Jf b25fcCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwogCiAgICAgICBpZiAoZHJhd193aW5k b3dfZnJpbmdlcyAodywgMSkpCiAJewpAQCAtMzE3Miw3ICszMTc0LDEzIEBAIHNvIHNvbWUga2V5 IHByZXNzZXMgKFRBQikgYXJlIHN3YWxsb3dlZCBieSB0aGUgc3lzdGVtLiAgKi8KIHN0YXRpYyB2 b2lkCiBuc19kcmF3X3dpbmRvd19jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlw aF9yb3cgKmdseXBoX3JvdywKIAkJICAgICAgIGludCB4LCBpbnQgeSwgZW51bSB0ZXh0X2N1cnNv cl9raW5kcyBjdXJzb3JfdHlwZSwKLQkJICAgICAgIGludCBjdXJzb3Jfd2lkdGgsIGJvb2wgb25f cCwgYm9vbCBhY3RpdmVfcCkKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogbXVsdGlwbGUg Y3Vyc29ycyAqLworCisgIGludCBjdXJzb3Jfd2lkdGgsIGJvb2wgb25fcCwgYm9vbCBhY3RpdmVf cCwKKyAgTGlzcF9PYmplY3QgY29sb3JfdmVjdG9yLCBMaXNwX09iamVjdCBmbGF2b3IpCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLwogLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KICAgICAgRXh0ZXJu YWwgY2FsbCAoUklGKTogZHJhdyBjdXJzb3IuCiAgICAgIE5vdGUgdGhhdCBDVVJTT1JfV0lEVEgg aXMgbWVhbmluZ2Z1bCBvbmx5IGZvciAoaCliYXIgY3Vyc29ycy4KQEAgLTMyMDYsOCArMzIxNCwy OSBAQCBOb3RlIHRoYXQgQ1VSU09SX1dJRFRIIGlzIG1lYW5pbmdmdWwgb25seSBmb3IgKGgpYmFy IGN1cnNvcnMuCiAKICAgaWYgKChwaHlzX2N1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J0 czogICMxNjg1NiBhbmQgIzI5MjMzLiAqLworICAgICAgaW50IGZyYW1lX2NoYXJfd2lkdGggPSBG UkFNRV9DT0xVTU5fV0lEVEggKGYpOworICAgICAgaW50IHRleHRfYXJlYV93aWR0aCA9IHdpbmRv d19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAgICBib29sIGN1cnNvcl9pbl9mcmluZ2Vf cCA9IHctPnBoeXNfY3Vyc29yLnggKyBmcmFtZV9jaGFyX3dpZHRoID49IHRleHRfYXJlYV93aWR0 aDsKKyAgICAgIGlmICgoZ2x5cGhfcm93LT5leGFjdF93aW5kb3dfd2lkdGhfbGluZV9wCisgICAg ICAgICAgICAmJiB3LT5waHlzX2N1cnNvci5ocG9zID49IGdseXBoX3Jvdy0+dXNlZFtURVhUX0FS RUFdKQorICAgICAgICAgIHx8IGN1cnNvcl9pbl9mcmluZ2VfcCkKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogICAgICAgICB7CiAgICAgICAgICAgZ2x5cGhfcm93LT5jdXJzb3JfaW5f ZnJpbmdlX3AgPSAxOwogICAgICAgICAgIGRyYXdfZnJpbmdlX2JpdG1hcCAodywgZ2x5cGhfcm93 LCAwKTsKQEAgLTMyNTIsOCArMzI4MSw0OCBAQCBOb3RlIHRoYXQgQ1VSU09SX1dJRFRIIGlzIG1l YW5pbmdmdWwgb25seSBmb3IgKGgpYmFyIGN1cnNvcnMuCiAKIAogICBmYWNlID0gRkFDRV9GUk9N X0lEX09SX05VTEwgKGYsIHBoeXNfY3Vyc29yX2dseXBoLT5mYWNlX2lkKTsKLSAgaWYgKGZhY2Ug JiYgTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKQotICAgICAgPT0gbnNfaW5kZXhfY29sb3IgKEZS QU1FX0NVUlNPUl9DT0xPUiAoZiksIGYpKQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogbXVsdGlwbGUgY3Vyc29ycyAqLworCisvKiBFWEFNUExFIE9GIEhPVyBUTyBMT09LLVVQIEEg Q09MT1I6CisgIGVudW0gZmFjZV9pZCBmYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKGYsIGlu dGVybiAoIistdmVydGljYWwtYmFyLWZhY2UiKSwgdHJ1ZSk7CisgIHN0cnVjdCBmYWNlICpmYWNl ID0gRkFDRV9GUk9NX0lEIChmLCBmYWNlX2lkKTsKKyAgTlNDb2xvciAqY29sb3IgPSBuc19sb29r dXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChmYWNlKSwgZik7CisqLworCisg IGlmIChFUSAoZmxhdm9yLCBRbWNfZ2x5cGgpCisgICAgICB8fCBFUSAoZmxhdm9yLCBRbWNfZ2x5 cGhsZXNzKQorICAgICAgfHwgRVEgKGZsYXZvciwgUW1jX2dseXBoX3RhYikpCisgICAgeworICAg ICAgTGlzcF9PYmplY3QgYnVmID0gdy0+Y29udGVudHM7CisgICAgICBDSEVDS19CVUZGRVIgKGJ1 Zik7CisgICAgICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAoYnVmKTsKKyAgICAgIGJvb2wg cmVnaW9uX2FjdGl2ZV9wID0gKCFOSUxQIChWdHJhbnNpZW50X21hcmtfbW9kZSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBtYXJrX2FjdGl2ZSkpKTsK KyAgICAgIHB0cmRpZmZfdCByZWdpb25fYmVnaW5uaW5nID0gKHJlZ2lvbl9hY3RpdmVfcCkgPyBY SU5UIChGcmVnaW9uX2JlZ2lubmluZyAoKSkgOiAtMTsKKyAgICAgIHB0cmRpZmZfdCByZWdpb25f ZW5kID0gKHJlZ2lvbl9hY3RpdmVfcCkgPyBYSU5UI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wcmlhdGUgY29s b3IgaWYgc28uICovCisgICAgfQorICBlbHNlIGlmIChmYWNlICYmIE5TX0ZBQ0VfQkFDS0dST1VO RCAoZmFjZSkKKyAgICAgICAgICAgPT0gbnNfaW5kZXhfY29sb3IgKEZSQU1FX0NVUlNPUl9DT0xP UiAoZiksIGYpKQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgewogICAgICAg W25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQgKGZhY2UpLCBmKSBz ZXRdOwogICAgICAgaG9sbG93X2NvbG9yID0gRlJBTUVfQ1VSU09SX0NPTE9SIChmKTsKQEAgLTMz MDAsOSArMzM2OSwxNiBAQCBOb3RlIHRoYXQgQ1VSU09SX1dJRFRIIGlzIG1lYW5pbmdmdWwgb25s eSBmb3IgKGgpYmFyIGN1cnNvcnMuCiAgICAgfQogICBuc191bmZvY3VzIChmKTsKIAotICAvKiBk cmF3IHRoZSBjaGFyYWN0ZXIgdW5kZXIgdGhlIGN1cnNvciAqLwotICBpZiAoY3Vyc29yX3R5cGUg IT0gTk9fQ1VSU09SKQotICAgIGRyYXdfcGh5c19jdXJzb3JfZ2x5cGggKHcsIGdseXBoX3Jvdywg RFJBV19DVVJTT1IpOworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBtdWx0aXBsZSBjdXJz b3JzICovCisKKyAgIC8qIGRyYXcgdGhlIGNoYXJhY3RlciB1bmRlciB0aGUgY3Vyc29yICovCisg IGlmIChjdXJzb3JfdHlwZSAhPSBOT19DVVJTT1IKKyAgICAgICYmICFFUSAoZmxhdm9yLCBRbWNf Z2x5cGhsZXNzKQorICAgICAgJiYgIUVRIChmbGF2b3IsIFFtY19nbHlwaF90YWIpKQorICAgICBk cmF3X3BoeXNfY3Vyc29yX2dseXBoICh3LCBnbHlwaF9yb3csIERSQVdfQ1VSU09SKTsKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCiAKICNpZmRlZiBOU19JTVBMX0NPQ09BCiAgIE5TRW5hYmxl U2NyZWVuVXBkYXRlcyAoKTsKZGlmZiAtLWdpdCBhL3NyYy93MzJ0ZXJtLmMgYi9zcmMvdzMydGVy bS5jCmluZGV4IGZmMGQyYmYuLjE0MDA2ZWIgMTAwNjQ0Ci0tLSBhL3NyYy93MzJ0ZXJtLmMKKysr IGIvc3JjL3czMnRlcm0uYwpAQCAtNzA1LDEwICs3MDUsMTIgQEAgeF91cGRhdGVfd2luZG93X2Vu ZCAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBjdXJzb3Jfb25fcCwKICAgICB7CiAgICAgICBibG9j a19pbnB1dCAoKTsKIAotICAgICAgaWYgKGN1cnNvcl9vbl9wKQotCWRpc3BsYXlfYW5kX3NldF9j dXJzb3IgKHcsIHRydWUsCi0JCQkJdy0+b3V0cHV0X2N1cnNvci5ocG9zLCB3LT5vdXRwdXRfY3Vy c29yLnZwb3MsCi0JCQkJdy0+b3V0cHV0X2N1cnNvci54LCB3LT5vdXRwdXRfY3Vyc29yLnkpOwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBtdWx0aXBsZSBjdXJzb3JzICovCisKKyAgICAg IG1jX3BvcnRhbCAodywgY3Vyc29yX29uX3ApOworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K IAogICAgICAgaWYgKGRyYXdfd2luZG93X2ZyaW5nZXMgKHcsIHRydWUpKQogCXsKQEAgLTk3Myw3 ICs5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mF1bHQpCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLwogICAgIHMtPmdjID0gcy0+Zi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2M7CiAgIGVs c2UKICAgICB7CkBAIC01NzUzLDcgKzU3NjIsMTMgQEAgeF9kcmF3X2Jhcl9jdXJzb3IgKHN0cnVj dCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKIAkgaW52aXNpYmxlLiAgVXNlIHRo ZSBnbHlwaCdzIGZvcmVncm91bmQgY29sb3IgaW5zdGVhZCBpbiB0aGlzCiAJIGNhc2UsIG9uIHRo ZSBhc3N1bXB0aW9uIHRoYXQgdGhlIGdseXBoJ3MgY29sb3JzIGFyZSBjaG9zZW4gc28KIAkgdGhh dCB0aGUgZ2x5cGggaXMgbGVnaWJsZS4gICovCi0gICAgICBpZiAoZmFjZS0+YmFja2dyb3VuZCA9 PSBjdXJzb3JfY29sb3IpCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIG11bHRpcGxlIGN1 cnNvcnMgKi8KKworICAgICAgaWYgKGZhY2UtPmJhY2tncm91bmQgPT0gY3Vyc29yX2NvbG9yCisg ICAgICAgICAgJiYgIXctPm1jLmN1cnNvcl9nY19pbnZpc2libGVfb2theSkKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCiAJY3Vyc29yX2NvbG9yID0gZmFjZS0+Zm9yZWdyb3VuZDsKIAogICAg ICAgeCA9IFdJTkRPV19URVhUX1RPX0ZSQU1FX1BJWEVMX1ggKHcsIHctPnBoeXNfY3Vyc29yLngp OwpAQCAtNTgzMCw3ICs1ODQ1LDEzIEBAIHczMl9jbGVhcl9mcmFtZV9hcmVhIChzdHJ1Y3QgZnJh bWUgKmYsIGludCB4LCBpbnQgeSwgaW50IHdpZHRoLCBpbnQgaGVpZ2h0KQogc3RhdGljIHZvaWQK IHczMl9kcmF3X3dpbmRvd19jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9y b3cgKmdseXBoX3JvdywKIAkJCWludCB4LCBpbnQgeSwgZW51bSB0ZXh0X2N1cnNvcl9raW5kcyBj dXJzb3JfdHlwZSwKLQkJCWludCBjdXJzb3Jfd2lkdGgsIGJvb2wgb25fcCwgYm9vbCBhY3RpdmVf cCkKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogbXVsdGlwbGUgY3Vyc29ycyAqLworCisg IGludCBjdXJzb3Jfd2lkdGgsIGJvb2wgb25fcCwgYm9vbCBhY3RpdmVfcCwKKyAgTGlzcF9PYmpl Y3QgY29sb3JfdmVjdG9yLCBMaXNwX09iamVjdCBmbGF2b3IpCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLwogewogICBpZiAob25fcCkKICAgICB7CkBAIC01ODk1LDMxICs1OTE2LDExOCBAQCB3 MzJfZHJhd193aW5kb3dfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93 ICpnbHlwaF9yb3csCiAJICByZXR1cm47CiAJfQogCi0gICAgICBzd2l0Y2ggKGN1cnNvcl90eXBl KQotCXsKLQljYXNlIEhPTExPV19CT1hfQ1VSU09SOgotCSAgeF9kcmF3X2hvbGxvd19jdXJzb3Ig KHcsIGdseXBoX3Jvdyk7Ci0JICBicmVhazsKIAotCWNhc2UgRklMTEVEX0JPWF9DVVJTT1I6Ci0J ICBkcmF3X3BoeXNfY3V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gID0gWENyZWF0ZUdDIChOVUxMLCBG UkFNRV9XMzJfV0lORE9XIChmKSwgbWFzaywgJmdjX3ZhbHVlcyk7CisgICAgICAgICAgLyogV2hl biBgdy0+bWMuY3Vyc29yX2djX2RlZmF1bHQgPSB0cnVlJywgZm9yY2UgYHhfc2V0X2N1cnNvcl9n YycgdG8KKyAgICAgICAgICB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djJy4g ICovCisgICAgICAgICAgdy0+bWMuY3Vyc29yX2djX2RlZmF1bHQgPSB0cnVlOworICAgICAgICAg IGRyYXdfcGh5c19jdXJzb3JfZ2x5cGggKHcsIGdseXBoX3JvdywgRFJBV19DVVJTT1IpOworICAg ICAgICAgIHctPm1jLmN1cnNvcl9nY19kZWZhdWx0ID0gZmFsc2U7CisgICAgICAgICAgZ2NfdmFs dWVzLmZvbnQgPSBGUkFNRV9GT05UIChmKTsKKyAgICAgICAgICBnY192YWx1ZXMuZm9yZWdyb3Vu ZCA9IGZyYW1lX2JnX3BpeGVsOworICAgICAgICAgIGdjX3ZhbHVlcy5iYWNrZ3JvdW5kID0gb3Jp Z2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29y X2djCisgICAgICAgICAgICA9IFhDcmVhdGVHQyAoTlVMTCwgRlJBTUVfVzMyX1dJTkRPVyAoZiks IG1hc2ssICZnY192YWx1ZXMpOworICAgICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAg IH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIGRyYXdfcGh5c19jdXJzb3JfZ2x5cGggKHcsIGds eXBoX3JvdywgRFJBV19DVVJTT1IpOworICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgQkFS X0NVUlNPUjoKKyAgICB7CisgICAgICBpZiAocmVkID49IDAgJiYgYmx1ZSA+PSAwICYmIGdyZWVu ID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91 dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgICAgZi0+b3V0cHV0X2Rh dGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBjb2xvcl9waXhlbDsKKyAgICAgICAgICB3LT5tYy5jdXJz b3JfZ2NfaW52aXNpYmxlX29rYXkgPSB0cnVlOworICAgICAgICAgIHhfZHJhd19iYXJfY3Vyc29y ICh3LCBnbHlwaF9yb3csIGN1cnNvcl93aWR0aCwgQkFSX0NVUlNPUik7CisgICAgICAgICAgdy0+ bWMuY3Vyc29yX2djX2ludmlzaWJsZV9va2F5ID0gZmFsc2U7CisgICAgICAgICAgZi0+b3V0cHV0 X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAg IH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIHhfZHJhd19iYXJfY3Vyc29yICh3LCBnbHlwaF9y b3csIGN1cnNvcl93aWR0aCwgQkFSX0NVUlNPUik7CisgICAgICBicmVhazsKKyAgICB9CisgICAg Y2FzZSBIQkFSX0NVUlNPUjoKKyAgICB7CisgICAgICBpZiAocmVkID49IDAgJiYgYmx1ZSA+PSAw ICYmIGdyZWVuID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWph Y2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgICAgZi0+ b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBjb2xvcl9waXhlbDsKKyAgICAgICAgICB3 LT5tYy5jdXJzb3JfZ2NfaW52aXNpYmxlX29rYXkgPSB0cnVlOworICAgICAgICAgIHhfZHJhd19i YXJfY3Vyc29yICh3LCBnbHlwaF9yb3csIGN1cnNvcl93aWR0aCwgSEJBUl9DVVJTT1IpOworICAg ICAgICAgIHctPm1jLmN1cnNvcl9nY19pbnZpc2libGVfb2theSA9IGZhbHNlOworICAgICAgICAg IGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVs OworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB4X2RyYXdfYmFyX2N1cnNvciAo dywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEhCQVJfQ1VSU09SKTsKKyAgICAgIGJyZWFrOwor ICAgIH0KKyAgICBjYXNlIE5PX0NVUlNPUjoKKyAgICAgIHctPnBoeXNfY3Vyc29yX3dpZHRoID0g MDsKKyAgICAgIGJyZWFrOworICAgIGRlZmF1bHQ6CisgICAgICBlbWFjc19hYm9ydCAoKTsKKyAg fQorLyogRU5EIG11bHRpcGxlIGN1cnNvcnMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwog Ci0JY2FzZSBOT19DVVJTT1I6Ci0JICB3LT5waHlzX2N1cnNvcl93aWR0aCA9IDA7Ci0JICBicmVh azsKIAotCWRlZmF1bHQ6Ci0JICBlbWFjc19hYm9ydCAoKTsKLQl9CiAgICAgfQogfQogCmRpZmYg LS1naXQgYS9zcmMvd2luZG93LmMgYi9zcmMvd2luZG93LmMKaW5kZXggNDIyYjA2YS4uY2QwZDlh ZSAxMDA2NDQKLS0tIGEvc3JjL3dpbmRvdy5jCisrKyBiL3NyYy93aW5kb3cuYwpAQCAtNjgxMCw2 ICs2ODEwLDI3IEBAIGdldF9waHlzX2N1cnNvcl9nbHlwaCAoc3RydWN0IHdpbmRvdyAqdykKICAg c3RydWN0IGdseXBoICpnbHlwaDsKICAgaW50IGhwb3MgPSB3LT5waHlzX2N1cnNvci5ocG9zOwog CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKio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BpZiAoY3Vyc29yX2luX2ZyaW5nZV9wKQorICAgIHJldHVybiBOVUxM OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwogICBpZiAoISh3LT5waHlzX2N1cnNvci52 cG9zID49IDAKIAkmJiB3LT5waHlzX2N1cnNvci52cG9zIDwgdy0+Y3VycmVudF9tYXRyaXgtPm5y b3dzKSkKICAgICByZXR1cm4gTlVMTDsKZGlmZiAtLWdpdCBhL3NyYy93aW5kb3cuaCBiL3NyYy93 aW5kb3cuaAppbmRleCAwMTMwODNlLi43OWVkYzI2IDEwMDY0NAotLS0gYS9zcmMvd2luZG93LmgK KysrIGIvc3JjL3dpbmRvdy5oCkBAIC03Niw2ICs3Niw0MSBAQCBvbmUgYW5kIHRoZSBzYW1lLCBz byBpdHMgcHJldiBhbmQgbmV4dCBtZW1iZXJzIGFyZSBuaWwuCiAKIEEgZGVhZCB3aW5kb3cgaGFz IGl0cyBjb250ZW50cyBmaWVsZCBzZXQgdG8gbmlsLiAgKi8KIAorCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIEJFR0lOIG11bHRpcGxlIGN1cnNvcnMgKi8KKworLyogU3VmZml4ZXMgZm9y IHRoZSBgbWNgIHdpbmRvdyBwb2ludGVyIHByZWZpeC4gKi8KK3N0cnVjdCBtdWx0aXBsZV9jdXJz b3JzCit7CisgIC8qIFZhbHVlcyBmb3IgcHJldmlvdXMgYW5kIGN1cnJlbnQgYHdpbmRvdy1zdGFy dCcgYW5kIGB3aW5kb3ctZW5kJy4gKi8KKyAgRU1BQ1NfSU5UIGN1cnJlbnRfc3RhcnQsIGN1cnJl bnRfZW5kLCBwcmV2aW91c19zdGFydCwgcHJldmlvdXNfZW5kLCBjdXJyZW50X3gsIHByZXZpb3Vz X3g7Cis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ZGlzcC5jLiAgKi8K KyAgICBMaXNwX09iamVjdCBjcm9zc2hhaXJzX2NhY2hlOworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKwogICAgIC8qIE5vIExpc3AgZGF0YSBtYXkgZm9sbG93IGJlbG93IHRoaXMgcG9pbnQg d2l0aG91dCBjaGFuZ2luZwogICAgICAgIG1hcmtfb2JqZWN0IGluIGFsbG9jLmMuICBUaGUgbWVt YmVyIGN1cnJlbnRfbWF0cml4IG11c3QgYmUgdGhlCiAgICAgICAgZmlyc3Qgbm9uLUxpc3AgbWVt YmVyLiAgKi8KQEAgLTI4Myw2ICszMzIsMTQgQEAgc3RydWN0IHdpbmRvdwogCiAjaWZkZWYgSEFW RV9XSU5ET1dfU1lTVEVNCiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogbXVsdGlwbGUg Y3Vyc29ycyAqLworCisgICAgLyogVGhlIHByZWZpeCBmb3Igd2luZG93IHBvaW50ZXJzIHJlbGF0 aW5nIHRvIG11bHRpcGxlIGN1cnNvcnMuICAqLworICAgIHN0cnVjdCBtdWx0aXBsZV9jdXJzb3Jz IG1jOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwogICAgIC8qIEN1cnNvciB0eXBlIG9m IGxhc3QgY3Vyc29yIGRyYXduIG9uIHRoZSB3aW5kb3cuICAqLwogICAgIGVudW0gdGV4dF9jdXJz b3Jfa2luZHMgcGh5c19jdXJzb3JfdHlwZTsKIApAQCAtNDIxLDYgKzQ3OCwyMyBAQCBYV0lORE9X IChMaXNwX09iamVjdCBhKQogICByZXR1cm4gWFVOVEFHIChhLCBMaXNwX1ZlY3Rvcmxpa2UsIHN0 cnVjdCB3aW5kb3cpOwogfQogCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIG11bHRpcGxl IGN1cnNvcnMgKi8KKworSU5MSU5FIHZvaWQKK3dzZXRfbWNfZ2x5cGhfY2FjaGUgKHN0cnVjdCB3 aW5kb3cgKncsIExpc3BfT2JqZWN0IHZhbCkKK3sKKyAgdy0+bWNfZ2x5cGhfY2FjaGUgPSB2YWw7 Cit9CisKK0lOTElORSB2b2lkCit3c2V0X2Nyb3NzaGFpcnNfY2FjaGUgKHN0cnVjdCB3aW5kb3cg KncsIExpc3BfT2JqZWN0IHZhbCkKK3sKKyAgdy0+Y3Jvc3NoYWlyc19jYWNoZSA9IHZhbDsKK30K KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisKIC8qIE1vc3QgY29kZSBzaG91bGQgdXNlIHRo ZXNlIGZ1bmN0aW9ucyB0byBzZXQgTGlzcCBmaWVsZHMgaW4gc3RydWN0CiAgICB3aW5kb3cuICAq LwogSU5MSU5FIHZvaWQKZGlmZiAtLWdpdCBhL3NyYy94ZGlzcC5jIGIvc3JjL3hkaXNwLmMKaW5k ZXggOWI0ZmViZC4uM2JjZDZjMiAxMDA2NDQKLS0tIGEvc3JjL3hkaXNwLmMKKysrIGIvc3JjL3hk aXNwLmMKQEAgLTkyMSw2ICs5MjEsMjMzMiBAQCBzdGF0aWMgdm9pZCBzaG93X21vdXNlX2ZhY2Ug KE1vdXNlX0hMSW5mbyAqLCBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UpOwogc3RhdGljIGJvb2wgY29v cmRzX2luX21vdXNlX2ZhY2VfcCAoc3RydWN0IHdpbmRvdyAqLCBpbnQsIGludCk7CiAKIAorLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBCRUdJTiBtdWx0aXBsZSBjdXJzb3JzICovCisKKy8q IE1VTFRJUExFIENVUlNPUlM6ICBFbWFjcyBCdWcgIzIyODczIChmZWF0dXJlIHJlcXVlc3QpCisK KyAgIENST1NTSEFJUlM6ICBFbWFjcyBCdWcgIzE3Njg0IChmZWF0dXJlIHJlcXVlc3QpCisKK1BB VENIIFZFUlNJT046ICAwMTIKK0FwcGx5IHBhdGNoIHRvIG1hc3RlciBicmFuY2g6ICBTYXQgSnVs IDcgMDk6NTk6NTMgMjAxOCAtMDcwMAorZ2l0IHJlc2V0IC0taGFyZCA5ODQ2M2JlZDA3ZWNjOTA1 NzA5NDkyOGZmZGMyMzIxZWFhZjNhYjUyCisKK0xhc3QgQ29tbWl0IDogU2F0IEp1bCA3IDA5OjU5 OjUzIDIwMTggLTA3MDAKKyAgICAgICAgICAgIDogR2xlbm4gTW9ycmlzIDxyZ21AZ251Lm9yZz4K KyAgICAgICAgICAgIDogOTg0NjNiZWQwN2VjYzkwNTcwOTQ5MjhmZmRjMjMyMWVhYWYzYWI1Mgor ICAgICAgICAgICAgOiAqIGxpc3AvaW1lbnUuZWw6IFJlcXVpcmUgY2wtbGliLCBub3QgaW50ZXJu YWwgY29tcG9uZW50cyBvZiBzYW1lLgorCitFWEFNUExFICMxOiAgKHNldHEgbWMtZ2x5cGgtbGlz dCAnKCgxICJoYmFyIiAibWFnZW50YSIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgy ICJiYXIiICJwdXJwbGUiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMyAiYm94IiAi IzAwRkYwMCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICg0ICJob2xsb3ciICIjMDAw MEZGIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDUgKCJoYmFyIiAzKSBbMS4wIDAu MCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAg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UAorCistICBIb3Jpem9udGFsIFNjcm9sbGlu ZyAtLSBUZW1wb3Jhcnk6ICAoc2Nyb2xsLWxlZnQgMSkKKworICAgKHNldHEtbG9jYWwgYXV0by1o c2Nyb2xsLW1vZGUgJ2N1cnJlbnQtbGluZSkKKworLSAgSG9yaXpvbnRhbCBTY3JvbGxpbmcgLS0g UGVybWFuZW50OiAgKHNjcm9sbC1sZWZ0IDEgdCkKKworICAgKHNldHEtbG9jYWwgYXV0by1oc2Ny b2xsLW1vZGUgJ2N1cnJlbnQtbGluZSkKKworLSAgKGZ1bmRhbWVudGFsLW1vZGUpCisgICAoc2V0 cSBkaXNwbGF5LWxpbmUtbnVtYmVycyB0KQorICAgKHNldHEgYnVmZmVyLWRpc3BsYXktdGFibGUg KG1ha2UtZGlzcGxheS10YWJsZSkpCisgICAoYXNldCBidWZmZXItZGlzcGxheS10YWJsZQorICAg ICAgICAgP1x0CisgICAgICAgICAodmVjdG9yIChtYWtlLWdseXBoLWNvZGUgP1x1MDBCQiAnZm9u dC1sb2NrLXdhcm5pbmctZmFjZSkKKyAgICAgICAgICAgICAgICAgKG1ha2UtZ2x5cGgtY29kZSA/ XHQgJ2hpZ2hsaWdodCkpKQorICAgKGFzZXQgYnVmZmVyLWRpc3BsYXktdGFibGUKKyAgICAgICAg ID9cbgorICAgICAgICAgKHZlY3RvciAobWFrZS1nbHlwaC1jb2RlID9cdTAwQjYgJ2ZvbnQtbG9j ay1jb21tZW50LWZhY2UpCisgICAgICAgICAgICAgICAgID9cbikpCisgICAoc2V0cSB0YWItd2lk dGggOCkKKyAgIChzZXRxLWxvY2FsIGF1dG8taHNjcm9sbC1tb2RlICdjdXJyZW50LWxpbmUpCisK Ky0gIE5vIExpbmUgTnVtYmVycworCitMRUdFTkQKKworZnByaW50ZiAoc3RkZXJyLCAiTXkgbGlz cCBvYmplY3Q6ICAlc1xuIiwgU1NEQVRBIChGY2hhcl90b19zdHJpbmcgKG1ha2VfbnVtYmVyICgx MDEpKSkpOwor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+cGh5c19jdXJzb3IudnBvcyA9IHZwb3M7 CisgIHctPnBoeXNfY3Vyc29yX3R5cGUgPSBjdXJzb3JfdHlwZTsKKyAgdy0+cGh5c19jdXJzb3Jf YXNjZW50ID0gZ2x5cGhfcm93LT5hc2NlbnQ7CisgIHctPnBoeXNfY3Vyc29yX2hlaWdodCA9IGds eXBoX3Jvdy0+aGVpZ2h0OworICAvKiAoZ2V0ICcrLWxlZnQtZnJpbmdlLW92ZXJsYXktcG9zaXRp b24gJ292ZXJsYXktYXJyb3ctYml0bWFwKQorICAgICA9PiAnKy1vdmVybGF5LWFycm93LWJpdG1h cAorICAgICA9PiBRbWNfc21pbGV5X2ZhY2UgKi8KKyAgLyogTGlzcF9PYmplY3QgdmFsID0gRmdl dCAoaW50ZXJuICgiKy1sZWZ0LWZyaW5nZS1vdmVybGF5LXBvc2l0aW9uIiksIFFvdmVybGF5X2Fy cm93X2JpdG1hcCk7ICovCisgIExpc3BfT2JqZWN0IG1hcmtlciA9IGZpbmRfc3ltYm9sX3ZhbHVl IChpbnRlcm4gKCJvdmVybGF5LWFycm93LXBvc2l0aW9uIikpOworICBpbnQgZnJpbmdlX2JpdG1h cCA9IE5PX0ZSSU5HRV9CSVRNQVA7CisgIGludCBmYWNlX2lkID0gREVGQVVMVF9GQUNFX0lEOwor ICBpZiAoRVEgKGZsYXZvciwgUW92ZXJsYXlfYXJyb3dfYml0bWFwKSkKKyAgICB7CisgICAgICBM aXNwX09iamVjdCB2bGlzdDsKKyAgICAgIGZvciAodmxpc3QgPSBWb3ZlcmxheV9hcnJvd192YXJp YWJsZV9saXN0OworICAgICAgICAgICBDT05TUCAodmxpc3QpOworICAgICAgICAgICB2bGlzdCA9 IFhDRFIgKHZsaXN0KSkKKyAgICAgICAgeworICAgICAgICAgIExpc3BfT2JqZWN0IHZhciA9IFhD QVIgKHZsaXN0KTsKKyAgICAgICAgICBMaXNwX09iamVjdCB2YWw7CisgICAgICAgICAgaWYgKCFT WU1CT0xQICh2YXIpKQorICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgdmFsID0gZmlu ZF9zeW1ib2xfdmFsdWUgKHZhcik7CisgICAgICAgICAgaWYgKHZhbCA9IEZnZXQgKHZhciwgUW92 ZXJsYXlfYXJyb3dfYml0bWFwKSwgU1lNQk9MUCAodmFsKSkKKyAgICAgICAgICAgIGZyaW5nZV9i aXRtYXAgPSBsb29rdXBfZnJpbmdlX2JpdG1hcCAodmFsKTsKKyAgICAgICAgfQorICAgICAgZ2x5 cGhfcm93LT5vdmVybGF5X2Fycm93X2JpdG1hcCA9IChjdXJzb3JfdHlwZSAhPSBOT19DVVJTT1Ip CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBmcmluZ2VfYml0bWFw IC8qIGxvb2t1cF9mcmluZ2VfYml0bWFwIChmbGF2b3IpICovCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiBOT19GUklOR0VfQklUTUFQOworICAgICAgZHJhd19mcmlu Z2VfYml0bWFwICh3LCBnbHlwaF9yb3csIHRydWUpOworICAgICAgLyogb3B0aW1pemF0aW9uIDM6 ICBEUkFXIHRoZSBgb3ZlcmxheS1hcnJvdy1iaXRtYXAnIGlmIHRoZXJlIGlzIGEgbWFya2VyLiAq LworICAgICAgaWYgKE1BUktFUlAgKG1hcmtlcikKKyAgICAgICAgICAmJiBYTUFSS0VSIChtYXJr ZXIpLT5idWZmZXIKKyAgICAgICAgICAmJiBCVUZGRVJfTElWRV9QIChYTUFSS0VSIChtYXJrZXIp LT5idWZmZXIpKQorICAgICAgICB7CisgICAgICAgICAgZ2x5cGhfcm93LT5vdmVybGF5X2Fycm93 X2JpdG1hcCA9IGZyaW5nZV9iaXRtYXA7CisgICAgICAgICAgZHJhd19mcmluZ2VfYml0bWFwICh3 LCBnbHlwaF9yb3csIHRydWUpOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UgaWYgKEVRIChm bGF2b3IsIFFtY19ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2FuZ2xlKQorICAgICAgICAgICAgIHx8 IEVRIChmbGF2b3IsIFFtY19ob2xsb3dfcmVjdGFuZ2xlKQorICAgICAgICAgICAgIHx8IEVRIChm bGF2b3IsIFFtY192ZXJ0aWNhbF9iYXJfcmlnaHRfYW5nbGUpCisgICAgICAgICAgICAgfHwgRVEg KGZsYXZvciwgUW1jX3ZlcnRpY2FsX2JhcikKKyAgICAgICAgICAgICB8fCBFUSAoZmxhdm9yLCBR bWNfdmVydGljYWxfYmFyX2JhY2tzbGFzaCkpCisgICAgICB7CisgICAgICAgIGZyaW5nZV9iaXRt YXAgPSAoY3Vyc29yX3R5cGUgIT0gTk9fQ1VSU09SKQorICAgICAgICAgICAgICAgICAgICAgICAg PyBsb29rdXBfZnJpbmdlX2JpdG1hcCAoZmxhdm9yKQorICAgICAgICAgICAgICAgICAgICAgICAg OiBOT19GUklOR0VfQklUTUFQOworICAgICAgICBmYWNlX2lkID0gKGN1cnNvcl90eXBlICE9IE5P X0NVUlNPUikKKyAgICAgICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGlu dGVybiAoIistdmVydGljYWwtYmFyLWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICAgIDog REVGQVVMVF9GQUNFX0lEOworICAgICAgICBnbHlwaF9yb3ctPmN1cnNvcl9pbl9mcmluZ2VfcCA9 IGZhbHNlOworICAgICAgICBnbHlwaF9yb3ctPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcCA9IDA7 CisgICAgICAgIGdseXBoX3Jvdy0+cmlnaHRfZnJpbmdlX2JpdG1hcCA9IGZyaW5nZV9iaXRtYXA7 CisgICAgICAgIGdseXBoX3Jvdy0+cmlnaHRfZnJpbmdlX2ZhY2VfaWQgPSBmYWNlX2lkOworICAg ICAgICBnbHlwaF9yb3ctPnJpZ2h0X2ZyaW5nZV9vZmZzZXQgPSAwOworICAgICAgICBkcmF3X2Zy a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GVpZ2h0ID0gb3JpZ2luYWxfaGVpZ2h0 OworfQorCitzdGF0aWMgaW50CittY19saXNwX3RvX2N1cnNvcl90eXBlIChMaXNwX09iamVjdCBh cmcpCit7CisgIGNoYXIgKnN0cjsKKyAgaWYgKFhUWVBFIChhcmcpID09IExpc3BfU3RyaW5nKQor ICAgIHN0ciA9IFNTREFUQSAoYXJnKTsKKyAgZWxzZSBpZiAoWFRZUEUgKGFyZykgPT0gTGlzcF9T eW1ib2wpCisgICAgc3RyID0gU1NEQVRBIChTWU1CT0xfTkFNRSAoYXJnKSk7CisgIGVsc2UgcmV0 dXJuIC0xOworICBpZiAoIXN0cmNtcCAoc3RyLCAiYm94IikpCisgICAgcmV0dXJuIEZJTExFRF9C T1hfQ1VSU09SOworICBpZiAoIXN0cmNtcCAoc3RyLCAiaG9sbG93IikpCisgICAgcmV0dXJuIEhP TExPV19CT1hfQ1VSU09SOworICBpZiAoIXN0cmNtcCAoc3RyLCAiaGJhciIpKQorICAgIHJldHVy biBIQkFSX0NVUlNPUjsKKyAgaWYgKCFzdHJjbXAgKHN0ciwgImJhciIpKQorICAgIHJldHVybiBC QVJfQ1VSU09SOworICBpZiAoIXN0cmNtcCAoc3RyLCAibm8iKSkKKyAgICByZXR1cm4gTk9fQ1VS U09SOworICByZXR1cm4gLTE7Cit9CisKK3N0YXRpYyBMaXNwX09iamVjdAorbWNfY3Vyc29yX3R5 cGVfdG9fbGlzcCAoaW50IGFyZykKK3sKKyAgc3dpdGNoIChhcmcpCisgICAgeworICAgIGNhc2Ug RklMTEVEX0JPWF9DVVJTT1I6IHJldHVybiBRYm94OworICAgIGNhc2UgSE9MTE9XX0JPWF9DVVJT T1I6IHJldHVybiBRaG9sbG93OworICAgIGNhc2UgSEJBUl9DVVJTT1I6IHJldHVybiBRaGJhcjsK KyAgICBjYXNlIEJBUl9DVVJTT1I6IHJldHVybiBRYmFyOworICAgIGNhc2UgTk9fQ1VSU09SOgor ICAgIGRlZmF1bHQ6IHJldHVybiBpbnRlcm4gKCJubyIpOworICAgIH0KK30KKworc3RhdGljIExp c3BfT2JqZWN0CittY19jb2xvcl92ZWN0b3JfY2FsYyAoc3RydWN0IHdpbmRvdyAqdywgTGlzcF9P YmplY3QgY29sb3IpCit7CisgIENIRUNLX1NUUklORyAoY29sb3IpOworICBMaXNwX09iamVjdCB0 YXJnZXRfZnJhbWUgPSB3LT5mcmFtZTsKKyAgTGlzcF9PYmplY3QgY29sb3JfdmFsdWVzOworICBk b3VibGUgdmFsbWF4ID0gWElOVCAoWENBUiAoRnh3X2NvbG9yX3ZhbHVlcyAoYnVpbGRfc3RyaW5n ICgiI2ZmZmZmZiIpLCB0YXJnZXRfZnJhbWUpKSk7CisgIExpc3BfT2JqZWN0IHZsaXN0OworICBw dHJkaWZmX3QgeDsKKyAgaW50IGkgPSAwOworICBMaXNwX09iamVjdCB0ZW1wID0gUW5pbDsKKyAg TGlzcF9PYmplY3QgdmVjdG9yID0gKEZtYWtlX3ZlY3RvciAobWFrZV9udW1iZXIgKDMpLCBRbmls KSk7CisgIGlmICghTklMUCAoRm1lbXEgKChGZnJhbWVwICh0YXJnZXRfZnJhbWUpKSwgbGlzdG4g KENPTlNUWVBFX0hFQVAsIDMsIGludGVybiAoIngiKSwgaW50ZXJuICgidzMyIiksIGludGVybiAo Im5zIikpKSkpCisgICAgeworICAgICAgY29sb3JfdmFsdWVzID0gKEZ4d19jb2xvcl92YWx1ZXMg KGNvbG9yLCB0YXJnZXRfZnJhbWUpKTsKKyAgICAgIGZvciAodmxpc3QgPSBjb2xvcl92YWx1ZXM7 CisgICAgICAgICAgIENPTlNQICh2bGlzdCk7CisgICAgICAgICAgIHZsaXN0ID0gWENEUiAodmxp c3QpKQorICAgICAgICB7CisgICAgICAgICAgeCA9IFhJTlQgKFhDQVIgKHZsaXN0KSk7CisgICAg ICAgICAgdGVtcCA9IG1ha2VfZmxvYXQgKHggLyB2YWxtYXgpOworICAgICAgICAgIEFTRVQgKHZl Y3RvciwgaSwgdGV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MAorICAgICAgICAgICAgICAgICAgICAgICAgICYmIGl0LT53 LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgYm9vbCBoc2NsX3Blcm1hbmVudCA9ICghaXQtPnctPnN1 c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgRVEgKEZidWZm ZXJfbG9jYWxfdmFsdWUgKFFhdXRvX2hzY3JvbGxfbW9kZSwgYnVmKSwgUWN1cnJlbnRfbGluZSkK KyAgICAgICAgICAgICAgICAgICAgICAgICAmJiBpdC0+dy0+aHNjcm9sbCA+IDAKKyAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBpdC0+dy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgaXQtPnctPm1pbl9oc2Nyb2xsICE9IGl0LT53LT5oc2Nyb2xsKTsKKyAg ZnByaW50ZiAoc3RkZXJyLCAiXG4lZC4gICVzJXMgLS0gKCVzKVxuXAorICAgIGl0LT5jICglZClc blwKKyAgICBmZXRjaF9ieXRlICglZClcblwKKyAgICBjaGFyYWN0ZXIgKCVzKVxuXAorICAgIElU X0NIQVJQT1MgKCVkKVxuXAorICAgIHctPmhzY3JvbGwgKCVkKVxuXAorICAgIHctPm1pbl9oc2Ny b2xsICglZClcblwKKyAgICBoc2NsX3RlbXBvcmFyeSAoJXMpXG5cCisgICAgaHNjbF9wZXJtYW5l bnQgKCVzKVxuXAorICAgIGl0LT5ocG9zICglZClcblwKKyAgICBpdC0+dnBvcyAoJWQpXG5cCisg ICAgaXQtPmN1cnJlbnRfeCAoJWQpXG5cCisgICAgbmV3X3ggKCVkKVxuXAorICAgIGZvbnQtPnNw YWNlX3dpZHRoICglZClcblwKKyAgICBpdC0+bG51bV9waXhlbF93aWR0aCAoJWQpXG5cCisgICAg aXQtPmxudW1fd2lkdGggKCVkKVxuXAorICAgIGl0LT5maXJzdF92aXNpYmxlX3ggKCVkKVxuXAor ICAgIGl0LT5sYXN0X3Zpc2libGVfeCAoJWQpXG5cCisgICAgcmVsYXRpdmVfeCAoJWQpXG5cCisg ICAgaXQtPmZhY2VfaWQgKCVkKVxuXAorICAgIGZvcmVncm91bmRfZmFjZSAoJXMpXG5cCisgICAg YmFja2dyb3VuZF9mYWNlICglcylcblwKKyAgICByYyAoJXMpXG4iLAorICAgICAgY291bnQsCisg ICAgICAoaXQtPmMgPT0gMAorICAgICAgICA/ICJOT1RISU5HIgorICAgICAgICA6IGl0LT5jID09 IDE4NworICAgICAgICAgID8gIlRBQiBDSEFSQUNURVIiCisgICAgICAgIDogaXQtPmMgPT0gJ1x0 JworICAgICAgICAgID8gIlRBQiBTVFJFVENIIgorICAgICAgICA6ICJURVhUIiksCisgICAgICAo cmVsYXRpdmVfeCA9PSBpdC0+bG51bV9waXhlbF93aWR0aAorICAgICAgICA/ICIgLS0gVEhFIEZV TiBTVEFSVFMgSEVSRSIKKyAgICAgICAgOiAiIiksCisgICAgICBTU0RBVEEgKGRpcmVjdGlvbiks CisgICAgICBpdC0+YywKKyAgICAgIEZFVENIX0JZVEUgKElUX0JZVEVQT1MgKCppdCkpLAorICAg ICAgKCFOSUxQIChGY2hhcl90b19zdHJpbmcgKG1ha2VfbnVtYmVyIChpdC0+YykpKQorICAgICAg ICA/IFNTREFUQSAoRmNoYXJfdG9fc3RyaW5nIChtYWtlX251bWJlciAoaXQtPmMpKSkKKyAgICAg ICAgOiAiTklMUCAtLSBpdC0+YyBhcyBhIHN0cmluZyIpLAorICAgICAgaXRfY2hhcnBvcywKKyAg ICAgIC8qIFdoZW4gYGl0LT53LT5oc2Nyb2xsYCBpcyBzZXQgdG8gYW4gYGludGAsIGdkYiByZXBv cnRzIHRoZSB2YWx1ZQorICAgICAgYXMgYmVpbmc6ICA8dmFyaWFibGUgb3B0aW1pemVkIGF3YXkg YnkgY29tcGlsZXI+ICovCisgICAgICB3X2hzY3JvbGwsCisgICAgICB3X21pbl9oc2Nyb2xsLAor ICAgICAgKGhzY2xfdGVtc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SBNT1ZFX1BPU19NQVRD SF9PUl9aVgorICAgICAgICAgID8gIk1PVkVfUE9TX01BVENIX09SX1pWIgorICAgICAgICA6IHJj ID09IE1PVkVfWF9SRUFDSEVECisgICAgICAgICAgPyAiTU9WRV9YX1JFQUNIRUQiCisgICAgICAg IDogcmMgPT0gTU9WRV9MSU5FX0NPTlRJTlVFRAorICAgICAgICAgID8gIk1PVkVfTElORV9DT05U SU5VRUQiCisgICAgICAgIDogcmMgPT0gTU9WRV9MSU5FX1RSVU5DQVRFRAorICAgICAgICAgID8g Ik1PVkVfTElORV9UUlVOQ0FURUQiCisgICAgICAgIDogcmMgPT0gTU9WRV9ORVdMSU5FX09SX0NS CisgICAgICAgICAgPyAiTU9WRV9ORVdMSU5FX09SX0NSIgorICAgICAgICA6ICJPT1BTIikpOwor fQorCitzdGF0aWMgdm9pZAorbWNfY3Jvc3NoYWlyc19oZWxwZXIgKHN0cnVjdCB3aW5kb3cgKncs IHB0cmRpZmZfdCB4LCBwdHJkaWZmX3QgeSwgcHRyZGlmZl90IGhwb3MsCisgICAgICAgICAgICAg ICAgICAgICAgcHRyZGlmZl90IHZwb3MsIGVudW0gdGV4dF9jdXJzb3Jfa2luZHMgdHlwZSwgaW50 IHdpZHRoLAorICAgICAgICAgICAgICAgICAgICAgIExpc3BfT2JqZWN0IGZvcmVncm91bmQsIExp c3BfT2JqZWN0IGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3Qg Zmxhdm9yLCBwdHJkaWZmX3QgcG9zLCBMaXNwX09iamVjdCAqcmVzdWx0KQoreworICBMaXNwX09i amVjdCB0ZW1wOworICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgeCwgeSwgaHBvcywgdnBvcywg dHlwZSwgd2lkdGgsIGZvcmVncm91bmQsIGZsYXZvcik7CisgIHRlbXAgPSBsaXN0biAoQ09OU1RZ UEVfSEVBUCwgMTAsCisgICAgICAgICAgICAgICAgbWFrZV9udW1iZXIgKHgpLAorICAgICAgICAg ICAgICAgIG1ha2VfbnVtYmVyICh5KSwKKyAgICAgICAgICAgICAgICBtYWtlX251bWJlciAoaHBv cyksCisgICAgICAgICAgICAgICAgbWFrZV9udW1iZXIgKHZwb3MpLAorICAgICAgICAgICAgICAg IG1jX2N1cnNvcl90eXBlX3RvX2xpc3AgKHR5cGUpLAorICAgICAgICAgICAgICAgIG1ha2VfbnVt YmVyICh3aWR0aCksCisgICAgICAgICAgICAgICAgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAg ICBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgIGZsYXZvciwKKyAgICAgICAgICAgICAgICBt YWtlX251bWJlciAocG9zKSk7CisgICpyZXN1bHQgPSBGY29ucyAodGVtcCwgKnJlc3VsdCk7Cit9 CisKK3N0YXRpYyB2b2lkCittY19jYWxjX2hlbHBlciAoc3RydWN0IHdpbmRvdyAqdywgcHRyZGlm Zl90IHgsIHB0cmRpZmZfdCB5LCBwdHJkaWZmX3QgaHBvcywKKyAgICAgICAgICAgICAgICBwdHJk aWZmX3QgdnBvcywgZW51bSB0ZXh0X2N1cnNvcl9raW5kcyB0eXBlLCBpbnQgd2lkdGgsCisgICAg ICAgICAgICAgICAgTGlzcF9PYmplY3QgZm9yZWdyb3VuZCwgTGlzcF9PYmplY3QgYmFja2dyb3Vu ZCwgTGlzcF9PYmplY3QgZmxhdm9yLAorICAgICAgICAgICAgICAgIHB0cmRpZmZfdCBwb3MsIExp c3BfT2JqZWN0IHNwZWNzLCBMaXNwX09iamVjdCAqcmVzdWx0KQoreworICBMaXNwX09iamVjdCB0 ZW5fZWxlbWVudHM7CisgIExpc3BfT2JqZWN0IHRlbXA7CisgIG1jX2RyYXdfZXJhc2VfaHlicmlk ICh3LCB4LCB5LCBocG9zLCB2cG9zLCB0eXBlLCB3aWR0aCwgZm9yZWdyb3VuZCwgZmxhdm9yKTsK KyAgdGVuX2VsZW1lbnRzID0gbGlzdG4gKENPTlNUWVBFX0hFQVAsIDEwLAorICAgICAgICAgICAg ICAgICAgICAgICAgbWFrZV9udW1iZXIgKHgpLAorICAgICAgICAgICAgICAgICAgICAgICAgbWFr ZV9udW1iZXIgKHkpLAorICAgICAgICAgICAgICAgICAgICAgICAgbWFrZV9udW1iZXIgKGhwb3Mp LAorICAgICAgICAgICAgICAgICAgICAgICAgbWFrZV9udW1iZXIgKHZwb3MpLAorICAgICAgICAg ICAgICAgICAgICAgICAgbWNfY3Vyc29yX3R5cGVfdG9fbGlzcCAodHlwZSksCisgICAgICAgICAg ICAgICAgICAgICAgICBtYWtlX251bWJlciAod2lkdGgpLAorICAgICAgICAgICAgICAgICAgICAg ICAgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQsCisgICAg ICAgICAgICAgICAgICAgICAgICBmbGF2b3IsCisgICAgICAgICAgICAgICAgICAgICAgICBtYWtl X251bWJlciAocG9zKSk7CisgIHRlbXAgPSBGY29ucyAoc3BlY3MsIEZjb25zICh0ZW5fZWxlbWVu dHMsIFFuaWwpKTsKKyAgKnJlc3VsdCA9IEZjb25zICh0ZW1wLCAqcmVzdWx0KTsKK30KKworLyog UmV0dXJuIHRoZSBzdGFydCBvciBlbmQgcG9zaXRpb24gb2YgdGhlIHJlZ2lvbi4KKyAgIEJFR0lO TklOR1AgbWVhbnMgcmV0dXJuIHRoZSBzdGFydC4KKyAgIElmIHRoZXJlIGlzIG5vIHJlZ2lvbiBh Y3RpdmUsIHNpZ25hbCBhbiBlcnJvci4KKyAgIEVYQU1QTEUgKHJlZ2lvbi1iZWdpbm5pbmcpOiAg cmVnaW9uX2xpbWl0ICgxKQorICAgRVhBTVBMRSAocmVnaW9uLWVuZCk6ICByZWdpb25fbGltaXQg KDApICovCitzdGF0aWMgTGlzcF9PYmplY3QKK21jX3JlZ2lvbl9saW1pdCAoYm9vbCBiZWdpbm5p bmdwKQoreworICBMaXNwX09iamVjdCBtOworICBpZiAoIU5JTFAgKFZ0cmFuc2llbnRfbWFya19t b2RlKQorICAgICAgJiYgTklMUCAoVm1hcmtfZXZlbl9pZl9pbmFjdGl2ZSkKKyAgICAgICYmIE5J TFAgKEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBtYXJrX2FjdGl2ZSkpKQorICAgIHJldHVybiBRbmls OworICBtID0gRm1hcmtlcl9wb3NpdGlvbiAoQlZBUiAoY3VycmVudF9idWZmZXIsIG1hcmspKTsK KyAgaWYgKE5JTFAgKG0pKQorICAgIHJldHVybiBRbmlsOworICAvKiBTZWUgYHJlZ2lvbi1hY3Rp dmUtcCcgYW5kIGByZWRpc3BsYXktLXVwZGF0ZS1yZWdpb24taGlnaGxpZ2h0Jy4gKi8KKyAgaWYg KCFOSUxQIChWdHJhbnNpZW50X21hcmtfbW9kZSkKKyAgICAgICYmICFOSUxQIChCVkFSIChjdXJy ZW50X2J1ZmZlciwgbWFya19hY3RpdmUpKQorICAgICAgJiYgIU5JTFAgKG0pKQorICAgIHJldHVy biBtYWtlX251bWJlciAoKFBUIDwgWEZBU1RJTlQgKG0pKSA9PSBiZWdpbm5pbmdwCisgICAgICAg ICAgICAgICAgICAgICAgICA/IFBUCisgICAgICAgICAgICAgICAgICAgICAgICA6IGNsaXBfdG9f Ym91bmRzIChCRUdWLCBYRkFTVElOVCAobSksIFpWKSk7CisgICAgICBlbHNlCisgICAgICAgIHJl dHVybiBRbmlsOworfQorCisvKiBTUEVDUyB3aWxsIGJlIGFuIExTTCBjb2xvciB2ZWN0b3IgaWYg Y29taW5nIGZyb20gYG1jX2RyYXdfY3Jvc3NoYWlycycuCitTUEVDUyB3aWxsIGJlIGEgY29uc3Ag bGlzdCBpZiBjb21pbmcgZnJvbSBgbWNfY2FsYycuICovCitzdGF0aWMgdm9pZAorbWNfbW92ZV9p dCAoc3RydWN0IGl0ICppdCwgTGlzcF9PYmplY3QgZGlyZWN0aW9uLCBMaXNwX09iamVjdCBzcGVj cywgTGlzcF9PYmplY3QgKnJlc3VsdCkKK3sKKyAgcHRyZGlmZl90IHBvc2ludCA9IChWRUNUT1JQ IChzcGVjcykpCisgICAgICAgICAgICAgICAgICAgICA/IC0xCisgICAgICAgICAgICAgICAgICAg ICA6IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgwKSwgc3BlY3MpKTsKKyAgTGlzcF9PYmplY3Qg bGlzcF90eXBlID0gKFZFQ1RPUlAgKHNwZWNzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg PyBRbmlsCisgICAgICAgICAgICAgICAgICAgICAgICAgIDogRm50aCAobWFrZV9udW1iZXIgKDEp LCBzcGVjcyk7CisgIGVudW0gdGV4dF9jdXJzb3Jfa2luZHMgY3Vyc29yX3R5cGUgPSAoVkVDVE9S UCAoc3BlY3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXN0 cmNtcCAoU1NEQVRBIChkaXJlY3Rpb24pLCAiSG9yaXpvbnRhbCBSdWxlciIpKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBIQkFSX0NVUlNPUgorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAgKFZFQ1RPUlAgKHNwZWNzKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFzdHJjbXAgKFNTREFUQSAoZGly ZWN0aW9uKSwgIlZlcnRpY2FsIFJ1bGVyIikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gQkFSX0NVUlNPUgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOiAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKFhDQVIgKGxpc3BfdHlw ZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IG1jX2xpc3BfdG9f Y3Vyc29yX3R5cGUgKGxpc3BfdHlwZSk7CisgIGludCBjdXJzb3Jfd2lkdGggPSAoVkVDVE9SUCAo c3BlY3MpKQorICAgICAgICAgICAgICAgICAgICAgPyAxCisgICAgICAgICAgICAgICAgICAgICA6 IChDT05TUCAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgID8gWElOVCAoWENB UiAoWENEUiAobGlzcF90eXBlKSkpCisgICAgICAgICAgICAgICAgICAgICA6IDE7CisgIExpc3Bf T2JqZWN0IGZvcmVncm91bmQgPSAoVkVDVE9SUCAoc3BlY3MpKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBzcGVjcworICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBGbnRoIChtYWtl X251bWJlciAoMiksIHNwZWNzKTsKKyAgaWYgKFNUUklOR1AgKGZvcmVncm91bmQpKQorICAgIGZv cmVncm91bmQgPSBtY19jb2xvcl92ZWN0b3JfY2FsYyAoaXQtPncsIGZvcmVncm91bmQpOworICBp bnQgb3BvaW50X3ggPSBpdC0+dy0+b3V0cHV0X2N1cnNvci54OworICBpbnQgb3BvaW50X3kgPSBp dC0+dy0+b3V0cHV0X2N1cnNvci55OworICBpbnQgb3BvaW50X2hwb3MgPSBpdC0+dy0+b3V0cHV0 X2N1cnNvci5ocG9zOworICBpbnQgb3BvaW50X3Zwb3MgPSBpdC0+dy0+b3V0cHV0X2N1cnNvci52 cG9zOworICBpbnQgcmVsYXRpdmVfeCA9IDA7CisgIGludCBwcmV2aW91c19ocG9zID0gLTE7Cisg IGVudW0gbW92ZV9pdF9yZXN1bHQgcmMgPSBNT1ZFX1hfUkVBQ0hFRDsKKyAgTGlzcF9PYmplY3Qg YnVmID0gaXQtPnctPmNvbnRlbnRzOworICBpbnQgZnJhbWVfY2hhcl93aWR0aCA9IEZSQU1FX0NP TFVNTl9XSURUSCAoaXQtPmYpOworICBpbnQgdGV4dF9hcmVhX3dpZHRoID0gd2luZG93X2JveF93 aWR0aCAoaXQtPncsIFRFWFRfQVJFQSk7CisgIGJvb2wgY3Vyc29yX2luX2ZyaW5nZV9wID0gb3Bv aW50X3ggKyBmcmFtZV9jaGFyX3dpZHRoID49IHRleHRfYXJlYV93aWR0aDsKKyAgYm9vbCBoc2Ns X3RlbXBvcmFyeSA9ICghaXQtPnctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgRVEgKEZidWZmZXJfbG9jYWxfdmFsdWUgKFFhdXRvX2hzY3JvbGxfbW9k ZSwgYnVmKSwgUWN1cnJlbnRfbGluZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiBpdC0+ dy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiBpdC0+dy0+bWluX2hz Y3JvbGwgPT0gMCk7CisgIGJvb2wgaHNjbF9wZXJtYW5lbnQgPSAoIWl0LT53LT5zdXNwZW5kX2F1 dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICYmIEVRIChGYnVmZmVyX2xvY2Fs X3ZhbHVlIChRYXV0b19oc2Nyb2xsX21vZGUsIGJ1ZiksIFFjdXJyZW50X2xpbmUpCisgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgaXQtPnctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgaXQtPnctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAg ICAgICYmIGl0LT53LT5taW5faHNjcm9sbCAhPSBpdC0+dy0+aHNjcm9sbCk7CisgIGludCBoc2Ns X2ZpcnN0X2hwb3MgPSB3aW5kb3dfaHNjcm9sbF9saW1pdGVkIChpdC0+dywgaXQtPmYpOworICBp bnQgaGVhZGVyX2xpbmVfaGVpZ2h0ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAoaXQtPncp OworICBpbnQgY291bnQgPSAwOworICBpbnQgdnBvcyA9IDA7CisgIGludCBuZXdfeCA9I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0X2ZhbHNlKQorICAgICAgICAgICAgICAgICAgICAgICAgIDogMDsKKyAgc3Ry dWN0IGdseXBoICpwaHlzX2N1cnNvcl9nbHlwaCA9IGdldF9waHlzX2N1cnNvcl9nbHlwaCAoaXQt PncpOworICBib29sIHJlZ2lvbl9hY3RpdmVfcCA9IChyZWdpb25fYmVnaW5uaW5nICE9IHJlZ2lv bl9lbmQpOworICB3aGlsZSAodHJ1ZSkKKyAgICB7CisgICAgICBjb3VudCArPSAxOworICAgICAg c3RydWN0IGZhY2UgKmZhY2UgPSBtY19sb29rdXBfZmFjZSAoaXQpOworICAgICAgc3RydWN0IGZv bnQgKmZvbnQgPSBmYWNlLT5mb250OworICAgICAgaW50IGZvbnRfc3BhY2Vfd2lkdGggPSAoZm9u dCA9PSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGZyYW1lX2NoYXJfd2lk dGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogZm9udC0+c3BhY2Vfd2lkdGgpOwor ICAgICAgaWYgKGhlYWRlcl9saW5lX2hlaWdodCA+IDApCisgICAgICAgIHZwb3MgPSBpdC0+dnBv cyArIDE7CisgICAgICAgIGVsc2UKKyAgICAgICAgICB2cG9zID0gaXQtPnZwb3M7CisgICAgICBp ZiAoaHNjbF9wZXJtYW5lbnQKKyAgICAgICAgICAmJiBuZXdfeCA+IDAKKyAgICAgICAgICAmJiBv cG9pbnRfdnBvcyA9PSB2cG9zKQorICAgICAgICAvKiByZWxhdGl2ZV94ID0gbmV3X3ggLSBpdC0+ Zmlyc3RfdmlzaWJsZV94OyAqLworICAgICAgICByZWxhdGl2ZV94ID0gbmV3X3ggLSAoaHNjbF9m aXJzdF9ocG9zICogZnJhbWVfY2hhcl93aWR0aCk7CisgICAgICAgIC8qIFRlbXBvcmFyeSBob3Jp em9udGFsIHNjcm9sbGluZyBvZiBfb25seV8gdGhlIGN1cnJlbnQgbGluZS4KKyAgICAgICAgVGhp cyB3YXMgZGlmZm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VhUIC0tIFRIRSBGVU4gU1RBUlRTIEhFUkUKKyAgICAgICAgICBpdC0+YyAo NzIpCisgICAgICAgICAgY2hhciAoSCkKKyAgICAgICAgICBpdC0+dy0+aHNjcm9sbCAoNCkKKyAg ICAgICAgICBoc2NsX3RlbXBvcmFyeSAoZmFsc2UpCisgICAgICAgICAgaXQtPmhwb3MgKDUpCisg ICAgICAgICAgaXQtPmN1cnJlbnRfeCAoMTMyKQorICAgICAgICAgIG5ld194ICg4OCkKKyAgICAg ICAgICBmb250X3NwYWNlX3dpZHRoICgxMSkKKyAgICAgICAgICBpdC0+bG51bV9waXhlbF93aWR0 aCAoNDQpCisgICAgICAgICAgcmVsYXRpdmVfeCAoNDQpCisgICAgICAgICAgcmMgKE1PVkVfWF9S RUFDSEVEKQorICAgICAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgICAgNy4g IFRBQiBTVFJFVENICisgICAgICAgICAgaXQtPmMgKDkpCisgICAgICAgICAgY2hhciAoCSkKKyAg ICAgICAgICBpdC0+dy0+aHNjcm9sbCAoMikKKyAgICAgICAgICBoc2NsX3RlbXBvcmFyeSAoZmFs c2UpCisgICAgICAgICAgaXQtPmhwb3MgKDApCisgICAgICAgICAgaXQtPmN1cnJlbnRfeCAoMTEp CisgICAgICAgICAgbmV3X3ggKDc3KQorICAgICAgICAgIGZvbnRfc3BhY2Vfd2lkdGggKDExKQor ICAgICAgICAgIGl0LT5sbnVtX3BpeGVsX3dpZHRoICg0NCkKKyAgICAgICAgICByZWxhdGl2ZV94 ICg1NSkKKyAgICAgICAgICByYyAoTU9WRV9YX1JFQUNIRUQpCisgICAgICAtLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICA4LiAgVEVYVAorICAgICAgICAgIGl0LT5jICg3MikK KyAgICAgICAgICBjaGFyIChIKQorICAgICAgICAgIGl0LT53LT5oc2Nyb2xsICgyKQorICAgICAg ICAgIGhzY2xfdGVtcG9yYXJ5IChmYWxzZSkKKyAgICAgICAgICBpdC0+aHBvcyAoNSkKKyAgICAg ICAgICBpdC0+Y3VycmVudF94ICgxMzIpCisgICAgICAgICAgbmV3X3ggKDg4KQorICAgICAgICAg IGZvbnRfc3BhY2Vfd2lkdGggKDExKQorICAgICAgICAgIGl0LT5sbnVtX3BpeGVsX3dpZHRoICg0 NCkKKyAgICAgICAgICByZWxhdGl2ZV94ICg2NikKKyAgICAgICAgICByYyAoTU9WRV9YX1JFQUNI RUQpICovCisgICAgICBib29sIGlzc3VlXzMxNzE2X3AgPSAoIWhzY2xfdGVtcG9yYXJ5CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgIWhzY2xfcGVybWFuZW50CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgaXQtPnctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgcHJldmlvdXNfaHBvcyA9PSAtMQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHByZXZpb3VzX2NoYXJhY3RlciA9PSAnXHQnCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgaXQtPmhwb3MgPiBpdC0+bG51bV9waXhlbF93aWR0aCAvIGZvbnRfc3BhY2Vfd2lk dGgpOworICAgICAgYm9vbCBscHdfcmVhY2hlZF9wID0gKHByZXZpb3VzX3JlbGF0aXZlX3ggPj0g aXQtPmxudW1fcGl4ZWxfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBpc3N1 ZV8zMTcxNl9wKTsKKyAgICAgIGludCB4ID0gKGhzY2xfdGVtcG9yYXJ5CisgICAgICAgICAgICAg ICB8fCBoc2NsX3Blcm1hbmVudCkKKyAgICAgICAgICAgICAgID8gaXQtPmN1cnJlbnRfeCAtICho c2NsX2ZpcnN0X2hwb3MgKiBmcmFtZV9jaGFyX3dpZHRoKQorICAgICAgICAgICAgICAgOiBpdC0+ Y3VycmVudF94IC0gaXQtPmZpcnN0X3Zpc2libGVfeDsKKyAgICAgIGJvb2wgZmluYWxfbG9vcF9w ID0gKChGRVRDSF9CWVRFIChJVF9CWVRFUE9TICgqaXQpKSA9PSAnXG4nCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgaXQtPmMgIT0gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg IC8qIHx8IElURVJBVE9SX0FUX0VORF9PRl9MSU5FX1AgKGl0KSAqLworICAgICAgICAgICAgICAg ICAgICAgICAgICAgfHwgcmMgPT0gTU9WRV9QT1NfTUFUQ0hfT1JfWlYKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgIHx8IHJjID09IE1PVkVfTElORV9DT05USU5VRUQKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgIHx8IHggKyBmcmFtZV9jaGFyX3dpZHRoID49IHRleHRfYXJlYV93aWR0aCk7 CisgICAgICBib29sIGFkdmFuY2VfaHBvc19wID0gKGdyZWVuX2xpZ2h0X3AKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgbHB3X3JlYWNoZWRfcCk7CisgICAgICBpZiAoYWR2YW5jZV9o cG9zX3ApCisgICAgICAgIHByZXZpb3VzX2hwb3MgKz0gKHByZXZpb3VzX2hwb3MgPT0gLTEKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChWZGlzcGxheV9saW5lX251bWJlcnMp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhRVEgKFZkaXNwbGF5X2xpbmVfbnVtYmVy cywgUXZpc3VhbCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgID8gKGl0LT5sbnVtX3BpeGVs X3dpZHRoIC8gZm9udF9zcGFjZV93aWR0aCkgKyAxCisgICAgICAgICAgICAgICAgICAgICAgICAg IDogKHJlbGF0aXZlX3ggPiAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gMQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogMDsKKyAgICAgICAgZWxzZSBpZiAoZmluYWxfbG9v cF9wCisgICAgICAgICAgICAgICAgICYmIHByZXZpb3VzX2hwb3MgPT0gLTEpCisgICAgICAgICAg cHJldmlvdXNfaHBvcyA9IDA7CisgICAgICBib29sIHRhYl9pbnZpc2libGVfcCA9IHByZXZpb3Vz X2NoYXJhY3RlciA9PSAnXHQnOworICAgICAgYm9vbCB0YWJfdmlzaWJsZV9wID0gKHByZXZpb3Vz X2NoYXJhY3RlciAhPSAnXHQnCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZmV0Y2hf Ynl0ZV9wcmV2aW91c19jaGFyYWN0ZXIgPT0gJ1x0Jyk7CisgICAgICBib29sIHJlYWxfZmFrZV9j dXJzb3JfcCA9ICghc3RyY21wIChTU0RBVEEgKGRpcmVjdGlvbiksICJWZXJ0aWNhbCBSdWxlciIp KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IChvcG9pbnRfeSA9PSBpdC0+Y3Vy cmVudF95CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHZwb3MgPT0gb3Bv aW50X3Zwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKG9wb2ludF94ID09 IHByZXZpb3VzX3JlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgb3BvaW50X3kgPT0gaXQtPmN1cnJlbnRfeQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBvcG9pbnRfaHBvcyA9PSBwcmV2aW91c19ocG9zCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF92cG9zID09IHZwb3MpOworICAgICAgLyogaXQt PmMgPT0gJ1x0JyB3aGVuIElUIGlzIGF0IGEgdGFiLXdpZHRoIHNwYWNlciBmb2xsb3dpbmcgYQor ICAgICAgYGJ1ZmZlci1kaXNwbGF5LXRhYmxlJyBnbHlwaCBzdWNoIGFzIMK7LiAgQW5vdGhlciB3 YXkgdG8gdGVzdAorICAgICAgZm9yIHRoaXMgY29uZGl0aW9uIGlzIHdoZW4gaXQtPmMgPT0gRkVU Q0hfQllURSAoSVRfQllURVBPUyAoKml0KSkuICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8K Ky8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVkVSVElDQUwgUlVMRVIgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAg ICBpZiAoIXN0cmNtcCAoU1NEQVRBIChkaXJlY3Rpb24pLCAiVmVydGljYWwgUnVsZXIiKQorICAg ICAgICAgICYmIChwcmV2aW91c19yZWxhdGl2ZV94ID09IG9wb2ludF94CisgICAgICAgICAgICAg IHx8IGZpbmFsX2xvb3BfcCkpCisgICAgICAgIHsKKyAgICAgICAgICAvKiBTa2lwIHRoaXMgbGlu ZS4gKi8KKyAgICAgICAgICBpZiAocmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAgICAgYnJl YWs7CisgICAgICAgICAgLyogSWYgcG9pbnQgaXMgdG8gdGhlIGxlZnQgb2YgdGhlIGxpbmUgbnVt YmVycyB3aGVuIHNjcm9sbGluZworICAgICAgICAgIGhvcml6b250YWxseSwgdGhlbiB3ZSB3YW50 IHRoZSB2ZXJ0aWNhbCBsaW5lIHRvIGFsaWduIHdpdGggcmlnaHQgZWRnZQorICAgICAgICAgIG9m IHRoZSBsaW5lIG51bWJlcnMuICovCisgICAgICAgICAgaWYgKGl0LT53LT5oc2Nyb2xsID4gMAor ICAgICAgICAgICAgICAmJiBwcmV2aW91c19yZWxhdGl2ZV94ID09IG9wb2ludF94CisgICAgICAg ICAgICAgICYmIG9wb2ludF94IDwgaXQtPmxudW1fcGl4ZWxfd2lkdGgKKyAgICAgICAgICAgICAg JiYgcHJldmlvdXNfaHBvcyA9PSAtMSkKKyAgICAgICAgICAgIHByZXZpb3VzX2hwb3MgPSAoaXQt PmxudW1fcGl4ZWxfd2lkdGggLyBmb250X3NwYWNlX3dpZHRoKSAtIDE7CisgICAgICAgICAgICBl bHNlIGlmIChmaW5hbF9sb29wX3AKKyAgICAgICAgICAgICAgICAgICAgICYmIHByZXZpb3VzX2hw b3MgIT0gMAorICAgICAgICAgICAgICAgICAgICAgJiYgcmMgPT0gTU9WRV9MSU5FX0NPTlRJTlVF RCkKKyAgICAgICAgICAgICAgcHJldmlvdXNfaHBvcyArPSAxOworICAgICAgICAgIExpc3BfT2Jq ZWN0IGZsYXZvciA9IFFuaWw7CisgICAgICAgICAgaWYgKGN1cnNvcl9pbl9mcmluZ2VfcAorICAg ICAgICAgICAgICAmJiBnbHlwaF9yb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAg ICAgZmxhdm9yID0gUW1jX3ZlcnRpY2FsX2Jhcl9yaWdodF9hbmdsZTsKKyAgICAgICAgICAgIGVs c2UgaWYgKGN1cnNvcl9pbl9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhf cm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgICAgZmxhdm9yID0gUW1jX3ZlcnRpY2FsX2Jh cl9iYWNrc2xhc2g7CisgICAgICAgICAgICAgIGVsc2UgaWYgKGN1cnNvcl9pbl9mcmluZ2VfcAor ICAgICAgICAgICAgICAgICAgICAgICAmJiAhZ2x5cGhfcm93LT50cnVuY2F0ZWRfb25fcmlnaHRf cAorICAgICAgICAgICAgICAgICAgICAgICAmJiAhZ2x5cGhfcm93LT5jb250aW51ZWRfcCkKKyAg ICAgICAgICAgICAgICBmbGF2b3IgPSBRbWNfdmVydGljYWxfYmFyOworICAgICAgICAgICAgICAg IC8qIFdoZW4gSVQgaXMgYXQgdGhlIGVuZCBvZiBhIGxpbmUsIHVzZSBgUW1jX2dseXBobGVzcycu CisgICAgICAgICAgICAgICAgSG93ZXZlciwgaXQgaXMgb2theSB0byB1c2UgUW1jX2dseXBoIGZv ciBhIHdvcmQtd3JhcHBlZCBsaW5lLiAqLworICAgICAgICAgICAgICAgIGVsc2UgaWYgKCFJVEVS QVRPUl9BVF9FTkRfT0ZfTElORV9QIChpdCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiBG RVRDSF9CWVRFIChJVF9CWVRFUE9TICgqaXQpKSAhPSAnXG4nCisgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgRkVUQ0hfQllURSAoSVRfQllURVBPUyAoKml0KSkgIT0gJ1xmJworICAgICAgICAg ICAgICAgICAgICAgICAgIC8qIGl0LT5jID09ICdcdCcgd2hlbiBJVCBpcyBhdCBhIHRhYi13aWR0 aCBzcGFjZXIgZm9sbG93aW5nIGEKKyAgICAgICAgICAgICAgICAgICAgICAgICBgYnVmZmVyLWRp c3BsYXktdGFibGUnIGdseXBoIHN1Y2ggYXMgwrsuICBBbm90aGVyIHdheSB0byB0ZXN0CisgICAg ICAgICAgICAgICAgICAgICAgICAgZm9yIHRoaXMgY29uZGl0aW9uIGlzIHdoZW4gaXQtPmMgPT0g RkVUQ0hfQllURSAoSVRfQllURVBPUyAoKml0KSkuICovCisgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgcHJldmlvdXNfY2hhcmFjdGVyICE9ICdcdCcKKyAgICAgICAgICAgICAgICAgICAgICAg ICAmJiByYyAhPSBNT1ZFX1BPU19NQVRDSF9PUl9aVgorICAgICAgICAgICAgICAgICAgICAgICAg ICYmIHJjICE9IE1PVkVfTElORV9DT05USU5VRUQKKyAgICAgICAgICAgICAgICAgICAgICAgICAm JiAhcmVhbF9mYWtlX2N1cnNvcl9wCisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcmVsYXRp dmVfeCAvIGZyYW1lX2NoYXJfd2lkdGggPj0gaXQtPmxudW1fcGl4ZWxfd2lkdGgpCisgICAgICAg ICAgICAgICAgICBmbGF2b3IgPSBRbWNfZ2x5cGg7CisgICAgICAgICAgICAgICAgICAvKiBJdCBp cyBva2F5IHRvIHVzZSBRbWNfZ2x5cGggZm9yIGEgd29yZC13cmFwcGVkIGxpbmUuICovCisgICAg ICAgICAgICAgICAgICBlbHNlIGlmIChyYyA9PSBNT1ZFX0xJTkVfQ09OVElOVUVECisgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBGRVRDSF9CWVRFIChJVF9CWVRFUE9TICgqaXQpKSA9PSAn ICcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHByZXZpb3VzX3JlbGF0aXZlX3ggPT0g b3BvaW50X3gpCisgICAgICAgICAgICAgICAgICAgIGZsYXZvciA9IFFtY19nbHlwaDsKKyAgICAg ICAgICAgICAgICAgICAgZWxzZSBpZiAocHJldmlvdXNfY2hhcmFjdGVyID09ICdcdCcpCisgICAg ICAgICAgICAgICAgICAgICAgZmxhdm9yID0gUW1jX2dseXBoX3RhYjsKKyAgICAgICAgICAgICAg ICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZmxhdm9yID0gUW1jX2ds eXBobGVzczsKKyAgZnByaW50ZiAoc3RkZXJyLCAiXG5cCisgICAgVFlQRSBPRiBHTFlQSCBUTyBE UkFXOlxuXAorICAgIHZwb3MgKCVkKVxuXAorICAgIGZsYXZvciAoJXMpXG5cCisgICAgb3BvaW50 X3ggKCVkKVxuXAorICAgIHByZXZpb3VzX2hwb3MgKCVkKVxuXAorICAgIGN1cnJlbnQgY2hhcmFj dGVyICglcylcbiIsCisgICAgdnBvcywKKyAgICAoRVEgKGZsYXZvciwgUW1jX2dseXBoKQorICAg ICAgPyAiUW1jX2dseXBoIgorICAgICAgOiBFUSAoZmxhdm9yLCBRbWNfZ2x5cGhfdGFiKQorICAg ICAgICA/ICJRbWNfZ2x5cGhfdGFiIgorICAgICA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ZSBmcmFt ZSBkZWZhdWx0IGZhY2UgaWYgWlYKKyAgICAgICAgICAgICBpcyBhdCB0aGUgZW5kIG9mIGFuIGFj dGl2ZSByZWdpb24uICovCisgICAgICAgICAgaWYgKHJlZ2lvbl9hY3RpdmVfcCkKKyAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgLyogU3Vic2VxdWVudCB0byBgcmVnaW9uX2VuZGAgYW5kIGF0 IHRoZSBlbmQgb2YgYSBsaW5lLiAqLworICAgICAgICAgICAgICBpZiAoSVRfQ0hBUlBPUyAoKml0 KSA+PSByZWdpb25fZW5kCisgICAgICAgICAgICAgICAgICAmJiAoSVRFUkFUT1JfQVRfRU5EX09G X0xJTkVfUCAoaXQpCisgICAgICAgICAgICAgICAgICAgICAgfHwgRkVUQ0hfQllURSAoSVRfQllU RVBPUyAoKml0KSkgPT0gJ1xuJykpCisgICAgICAgICAgICAgICAgcHJldmlvdXNfZmFjZV9pZCA9 IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICAgICAgICAvKiBQcmlvciB0byBgcmVnaW9uX2Jl Z2lubmluZ2AgYW5kIGF0IHRoZSBlbmQgb2YgYSBsaW5lLiAqLworICAgICAgICAgICAgICAgIGVs c2UgaWYgKElUX0NIQVJQT1MgKCppdCkgPCByZWdpb25fYmVnaW5uaW5nCisgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgKElURVJBVE9SX0FUX0VORF9PRl9MSU5FX1AgKGl0KQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICB8fCBGRVRDSF9CWVRFIChJVF9CWVRFUE9TICgqaXQpKSA9PSAn XG4nKSkKKyAgICAgICAgICAgICAgICAgIHByZXZpb3VzX2ZhY2VfaWQgPSBERUZBVUxUX0ZBQ0Vf SUQ7CisgICAgICAgICAgICAgICAgICAvKiAtICBXaXRoaW4gdGhlIHJlZ2lvbi4KKyAgICAgICAg ICAgICAgICAgICAgIC0gIGBwaHlzX2N1cnNvcl9nbHlwaGAgaXMgTlVMTC4gKi8KKyAgICAgICAg ICAgICAgICAgIGVsc2UgaWYgKElUX0NIQVJQT1MgKCppdCkgPj0gcmVnaW9uX2JlZ2lubmluZwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgSVRfQ0hBUlBPUyAoKml0KSA8IHJlZ2lvbl9l bmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHBoeXNfY3Vyc29yX2dseXBoID09IE5V TEwpCisgICAgICAgICAgICAgICAgICAgIHByZXZpb3VzX2ZhY2VfaWQgPSBwcmV2aW91c19mYWNl X2lkOworICAgICAgICAgICAgICAgICAgICAvKiAtICBXaXRoaW4gdGhlIHJlZ2lvbi4KKyAgICAg ICAgICAgICAgICAgICAgICAgLSAgYHBoeXNfY3Vyc29yX2dseXBoYCBpcyBub24tTlVMTC4KKyAg ICAgICAgICAgICAgICAgICAgICAgLSAgQXQgdGhlIGVuZCBvZiB0aGUgbGluZS4KKyAgICAgICAg ICAgICAgICAgICAgICAgLSAgUFQgaXMgYXQgYHJlZ2lvbl9iZWdpbm5pbmdgLiAqLworICAgICAg ICAgICAgICAgICAgICBlbHNlIGlmIChJVF9DSEFSUE9TICgqaXQpID49IHJlZ2lvbl9iZWdpbm5p bmcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgSVRfQ0hBUlBPUyAoKml0KSA8IHJl Z2lvbl9lbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgKElURVJBVE9SX0FUX0VO RF9PRl9MSU5FX1AgKGl0KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgRkVU Q0hfQllURSAoSVRfQllURVBPUyAoKml0KSkgPT0gJ1xuJykKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgcGh5c19jdXJzb3JfZ2x5cGggIT0gTlVMTAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBQVCA9PSByZWdpb25fYmVnaW5uaW5nKQorICAgICAgICAgICAgICAgICAg ICAgIHByZXZpb3VzX2ZhY2VfaWQgPSBwaHlzX2N1cnNvcl9nbHlwaC0+ZmFjZV9pZDsKKyAgICAg ICAgICAgICAgICAgICAgICAvKiAtICBXaXRoaW4gdGhlIHJlZ2lvbi4KKyAgICAgICAgICAgICAg ICAgICAgICAgICAtICBgcGh5c19jdXJzb3JfZ2x5cGhgIGlzIG5vbi1OVUxMLgorICAgICAgICAg ICAgICAgICAgICAgICAgIC0gIEF0IHRoZSBlbmQgb2YgdGhlIGxpbmUuCisgICAgICAgICAgICAg ICAgICAgICAgICAgLSAgUFQgaXMgYXQgYHJlZ2lvbl9yZWdpb25fZW5kYC4gKi8KKyAgICAgICAg ICAgICAgICAgICAgICBlbHNlIGlmIChJVF9DSEFSUE9TICgqaXQpID49IHJlZ2lvbl9iZWdpbm5p bmcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBJVF9DSEFSUE9TICgqaXQpIDwg cmVnaW9uX2VuZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIChJVEVSQVRPUl9B VF9FTkRfT0ZfTElORV9QIChpdCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg fHwgRkVUQ0hfQllURSAoSVRfQllURVBPUyAoKml0KSkgPT0gJ1xuJykKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBwaHlzX2N1cnNvcl9nbHlwaCAhPSBOVUxMCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgUFQgPT0gcmVnaW9uX2VuZCkKKyAgICAgICAgICAgICAg ICAgICAgICAgIC8qIHByZXZpb3VzX2ZhY2VfaWQgPSBwaHlzX2N1cnNvcl9nbHlwaC0+ZmFjZV9p ZDsgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgIC8qIHByZXZpb3VzX2ZhY2VfaWQgPSBsb29r dXBfbmFtZWRfZmFjZSAoaXQtPmYsIGludGVybiAoInJlZ2lvbiIpLCB0cnVlKTsgKi8KKyAgICAg ICAgICAgICAgICAgICAgICAgIHByZXZpb3VzX2ZhY2VfaWQgPSBpdC0+ZmFjZV9pZDsKKyAgICAg ICAgICAgICAgICAgICAgICAgIC8qIC0gIFdpdGhpbiB0aGUgcmVnaW9uLgorICAgICAgICAgICAg ICAgICAgICAgICAgICAgLSAgYHBoeXNfY3Vyc29yX2dseXBoYCBpcyBub24tTlVMTC4KKyAgICAg ICAgICAgICAgICAgICAgICAgICAgIC0gIE5vdCBhdCB0aGUgZW5kIG9mIHRoZSBsaW5lLiAqLwor ICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoSVRfQ0hBUlBPUyAoKml0KSA+PSByZWdp b25fYmVnaW5uaW5nCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBJVF9DSEFS UE9TICgqaXQpIDwgcmVnaW9uX2VuZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgKCFJVEVSQVRPUl9BVF9FTkRfT0ZfTElORV9QIChpdCkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICB8fCBGRVRDSF9CWVRFIChJVF9CWVRFUE9TICgqaXQpKSAhPSAnXG4n KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcGh5c19jdXJzb3JfZ2x5cGgg IT0gTlVMTCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcHJldmlvdXNfZmFjZV9pZCA9IHBy ZXZpb3VzX2ZhY2VfaWQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmICgoaXQt PnctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgcHJldmlvdXNfcmVsYXRp dmVfeCA9PSBvcG9pbnRfeAorICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF94IDwgaXQt PmxudW1fcGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICB8fCBJVF9DSEFSUE9TICgq aXQpID09IFpWKQorICAgICAgICAgICAgICBwcmV2aW91c19mYWNlX2lkID0gREVGQVVMVF9GQUNF X0lEOworICAgICAgICAgICAgICBlbHNlIGlmIChJVEVSQVRPUl9BVF9FTkRfT0ZfTElORV9QIChp dCkKKyAgICAgICAgICAgICAgICAgICAgICAgfHwgRkVUQ0hfQllURSAoSVRfQllURVBPUyAoKml0 KSkgPT0gJ1xuJykKKyAgICAgICAgICAgICAgICBwcmV2aW91c19mYWNlX2lkID0gaXQtPmZhY2Vf aWQ7CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoZ2hvc3Rfb2ZfY2hyaXN0bWFzX2Z1dHVyZV9w KQorICAgICAgICAgICAgICAgICAgcHJldmlvdXNfZmFjZV9pZCA9IGdob3N0X29mX2NocmlzdG1h c19mdXR1cmVfZmFjZV9pZDsKKyAgICAgICAgICBtY19jcm9zc2hhaXJzX2hlbHBlciAoaXQtPncs IG9wb2ludF94LCBpdC0+Y3VycmVudF95LCBwcmV2aW91c19ocG9zLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICB2cG9zLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3Jv dW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtY19iYWNrZ3JvdW5kIChpdC0+ dywgcHJldmlvdXNfZmFjZV9pZCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZs YXZvciwgSVRfQ0hBUlBPUyAoKml0KSAtMSwgcmVzdWx0KTsKKyAgICAgICAgICBicmVhazsKKyAg ICAgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgUW1jX2dseXBoICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg Ki8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgICAgaWYgKCFzdHJjbXAgKFNTREFUQSAo ZGlyZWN0aW9uKSwgIkhvcml6b250YWwgUnVsZXIiKQorICAgICAgICAgICYmIChncmVlbl9saWdo dF9wCisgICAgICAgICAgICAgIC8qIFBsYWNlIGFuIFFtY19nbHlwaCBvbiB0aGUgbGFzdCBzcGFj ZSBvZiBhIHdyYXBwZWQgbGluZS4gKi8KKyAgICAgICAgICAgICAgfHwgcmMgPT0gTU9WRV9MSU5F X0NPTlRJTlVFRCkKKyAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wCisgICAgICAgICAg JiYgbHB3X3JlYWNoZWRfcAorICAgICAgICAgICYmICF0YWJfaW52aXNpYmxlX3ApCisgICAgICAg IHsKKyAgICAgICAgICBwdHJkaWZmX3QgaXRfY2hhcnBvcyA9IChyYyA9PSBNT1ZFX0xJTkVfQ09O VElOVUVEKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gSVRfQ0hBUlBPUyAo Kml0KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogSVRfQ0hBUlBPUyAoKml0 KSAtIDE7CisgICAgICAgICAgaWYgKHJjID09IE1PVkVfTElORV9DT05USU5VRUQpCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIHByZXZpb3VzX2hwb3MgPSBwcmV2aW91c19ocG9zICsgMTsK KyAgICAgICAgICAgICAgcHJldmlvdXNfZmFjZV9pZCA9IGl0LT5mYWNlX2lkOworICAgICAgICAg ICAgfQorICAgICAgICAgIG1jX2Nyb3NzaGFpcnNfaGVscGVyIChpdC0+dywgcHJldmlvdXNfcmVs YXRpdmVfeCwgaXQtPmN1cnJlbnRfeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg cHJldmlvdXNfaHBvcywgdnBvcywgY3Vyc29yX3R5cGUsIGN1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AgUW1jX2dseXBoIGN1cnNvcnMgaGF2ZSBiZWVuIGxhaWQuICBIb3cgYWJvdXQgcHVzaGlu ZyBhbGwgdGhlIGNvb3JkaW5hdGVzCisgICAgICB0byB0aGUgY2FjaGUsIGFuZCB0aGVuIGV4ZWN1 dGluZyBhIHZhcmlhdGlvbiBvZiBgbWNfcmVkcmF3X2Nyb3NzaGFpcnMnCisgICAgICBbd2l0aCBz YWlkIHZlcnNpb24gYmVpbmcgcmV3cml0dGVuXSB0byBsb29wIHR3aWNlIG92ZXIgdGhlIGxpc3Qs IGZpcnN0CisgICAgICBmb3IgUW1jX2dseXBoLCBhbmQgdGhlbiBmb3IgUW1jX2dseXBobGVzcz8g Ki8KKyAgICAgIGlmICghc3RyY21wIChTU0RBVEEgKGRpcmVjdGlvbiksICJIb3Jpem9udGFsIFJ1 bGVyIikKKyAgICAgICAgICAmJiBncmVlbl9saWdodF9wCisgICAgICAgICAgJiYgIXJlYWxfZmFr ZV9jdXJzb3JfcAorICAgICAgICAgICYmIGxwd19yZWFjaGVkX3AKKyAgICAgICAgICAmJiB0YWJf aW52aXNpYmxlX3ApCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgaTsKKyAgICAgICAgICBpbnQg eCA9IChzYXZlZF9yZWxhdGl2ZV94X2Zvcl90YWIgPCBpdC0+bG51bV9waXhlbF93aWR0aCkKKyAg ICAgICAgICAgICAgICAgID8gaXQtPmxudW1fcGl4ZWxfd2lkdGgKKyAgICAgICAgICAgICAgICAg IDogc2F2ZWRfcmVsYXRpdmVfeF9mb3JfdGFiOworICAgICAgICAgIGludCBjb3VudCA9IChyZWxh dGl2ZV94IC0geCkgLyBmb250X3NwYWNlX3dpZHRoOworICAgICAgICAgIGZvciAoaSA9IDA7IGkg PCBjb3VudDsgaSsrKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19jcm9zc2hhaXJz X2hlbHBlciAoaXQtPncsIHgsIGl0LT5jdXJyZW50X3ksIHByZXZpb3VzX2hwb3MsIHZwb3MsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dp ZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZCwgbWNf YmFja2dyb3VuZCAoaXQtPncsIHByZXZpb3VzX2ZhY2VfaWQpLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgUW1jX2dseXBoX3RhYiwgSVRfQ0hBUlBPUyAoKml0KSAtIDEsIHJl c3VsdCk7CisgICAgICAgICAgICAgIHggKz0gZm9udF9zcGFjZV93aWR0aDsKKyAgICAgICAgICAg IH0KKyAgICAgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAg ICAgICAgIFN0b3JlIFZhbHVlcyBmb3IgTmV4dCBDb21tYW5kIExvb3AgICAgICAgICAgICAgICAg ICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgICAgLyogTXVzdCBjb21lIEFG VEVSIHdlIHVzZSB0aGUgcHJldmlvdXMgdmFsdWUgb2YgYHNhdmVkX3JlbGF0aXZlX3hfZm9yX3Rh YicuCisgICAgICBNdXN0IGNvbWUgQkVGT1JFIGBncmVlbl9saWdodF9wJyBpcyB0dXJuZWQgb2Zm LiAqLworICAgICAgaWYgKGdyZWVuX2xpZ2h0X3ApCisgICAgICAgIHNhdmVkX3JlbGF0aXZlX3hf Zm9yX3RhYiA9IHJlbGF0aXZlX3g7CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLSAqLworICAgICAgaWYgKCFzdHJjbXAgKFNTREFUQSAoZGlyZWN0aW9uKSwgIkhvcml6b250 YWwgUnVsZXIiKQorICAgICAgICAgICYmIGdyZWVuX2xpZ2h0X3AKKyAgICAgICAgICAmJiBnaG9z dF9vZl9jaHJpc3RtYXNfZnV0dXJlX3AKKyAgICAgICAgICAmJiBscHdfcmVhY2hlZF9wKQorICAg ICAgICB7CisgICAgICAgICAgaW50IGk7CisgICAgICAgICAgaW50IHggPSAoZ2hvc3Rfb2ZfY2hy aXN0bWFzX2Z1dHVyZV9yZWxhdGl2ZV94IDwgaXQtPmxudW1fcGl4ZWxfd2lkdGgpCisgICAgICAg ICAgICAgICAgICA/IGl0LT5sbnVtX3BpeGVsX3dpZHRoCisgICAgICAgICAgICAgICAgICA6IGdo b3N0X29mX2NocmlzdG1hc19mdXR1cmVfcmVsYXRpdmVfeDsKKyAgICAgICAgICBpbnQgY291bnQg PSAocHJldmlvdXNfcmVsYXRpdmVfeCAtIHgpIC8gZm9udF9zcGFjZV93aWR0aDsKKyAgICAgICAg ICBmb3IgKGkgPSAwOyBpIDwgY291bnQ7IGkrKykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgbWNfY3Jvc3NoYWlyc19oZWxwZXIgKGl0LT53LCB4LCBpdC0+Y3VycmVudF95LAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2hvc3Rfb2ZfY2hyaXN0bWFzX2Z1dHVyZV9o cG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5 cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIG1jX2JhY2tncm91bmQgKGl0LT53LCBnaG9zdF9vZl9jaHJpc3RtYXNfZnV0dXJl X2ZhY2VfaWQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUW1jX2dseXBo X3RhYiwgSVRfQ0hBUlBPUyAoKml0KSAtIDIsIHJlc3VsdCk7CisgICAgICAgICAgICAgIHggKz0g Zm9udF9zcGFjZV93aWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBnaG9zdF9vZl9jaHJp c3RtYXNfZnV0dXJlX3AgPSBmYWxzZTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmICgoIXN0 cmNtcCAoU1NEQVRBIChkaXJlY3Rpb24pLCAiVmVydGljYWwgUnVsZXIiKQorICAgICAgICAgICAg ICAgICAgfHwgIXN0cmNtcCAoU1NEQVRBIChkaXJlY3Rpb24pLCAiTXVsdGlwbGUgQ3Vyc29ycyIp KQorICAgICAgICAgICAgICAgICAmJiBncmVlbl9saWdodF9wCisgICAgICAgICAgICAgICAgICYm IGdob3N0X29mX2NocmlzdG1hc19mdXR1cmVfcAorICAgICAgICAgICAgICAgICAmJiBscHdfcmVh Y2hlZF9wKQorICAgICAgICAgIGdob3N0X29mX2NocmlzdG1hc19mdXR1cmVfcCA9IGZhbHNlOwor LyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgZmluYWxfbG9vcF9wICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLSAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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gICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gREVGQVVMVF9GQUNFX0lECisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IChJVF9DSEFSUE9TICgqaXQpID49IHJlZ2lvbl9l bmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IHJlZ2lvbl9iZWdpbm5pbmcg PT0gcmVnaW9uX2VuZCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBERUZBVUxU X0ZBQ0VfSUQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBwaHlzX2N1cnNvcl9n bHlwaC0+ZmFjZV9pZDsKKyAgICAgICAgICAvKiBBbiBlbXB0eSBuZXcgbGluZSAtLSBsb29wIGlu IHByZXZpb3VzIHNlY3Rpb24gYnJva2UgaW1tZWRpYXRlbHkuICovCisgICAgICAgICAgcHJldmlv dXNfaHBvcyA9IChyZWxhdGl2ZV94ID09IGl0LT5sbnVtX3BpeGVsX3dpZHRoKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gaXQtPmxudW1fcGl4ZWxfd2lkdGggLyBmcmFtZV9jaGFyX3dp ZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogTm8gbmVlZCB0byByZWFkanVzdCBi ZWNhdXNlIGl0IHdhcyBkb25lIGFib3ZlLiAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogcmMgPT0gTU9WRV9MSU5FX0NPTlRJTlVFRAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBwcmV2aW91c19ocG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBwcmV2aW91 c19ocG9zICsgMTsKKyAgICAgICAgICAvKiBBbiBlbXB0eSBuZXcgbGluZSAtLSBsb29wIGluIHBy ZXZpb3VzIHNlY3Rpb24gYnJva2UgaW1tZWRpYXRlbHkuICovCisgICAgICAgICAgcmVsYXRpdmVf eCA9IChyZWxhdGl2ZV94IDwgaXQtPmxudW1fcGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAg ICAgICAgID8gaXQtPmxudW1fcGl4ZWxfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgOiBy ZWxhdGl2ZV94OworICAgICAgICAgIHdoaWxlIChyZWxhdGl2ZV94ICsgZnJhbWVfY2hhcl93aWR0 aCA8IHRleHRfYXJlYV93aWR0aCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbWNfY3Jv c3NoYWlyc19oZWxwZXIgKGl0LT53LCByZWxhdGl2ZV94LCBpdC0+Y3VycmVudF95LAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJldmlvdXNfaHBvcywgdnBvcywgY3Vyc29y X3R5cGUsIGN1cnNvcl93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGZvcmVncm91bmQsIG1jX2JhY2tncm91bmQgKGl0LT53LCBwcmV2aW91c19mYWNlX2lkKSwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFFtY19nbHlwaGxlc3MsIElUX0NIQVJQ T1MgKCppdCksIHJlc3VsdCk7CisgICAgICAgICAgICAgIHJlbGF0aXZlX3ggPSByZWxhdGl2ZV94 ICsgZnJhbWVfY2hhcl93aWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYg KCghc3RyY21wIChTU0RBVEEgKGRpcmVjdGlvbiksICJIb3Jpem9udGFsIFJ1bGVyIikKKyAgICAg ICAgICAgfHwgIXN0cmNtcCAoU1NEQVRBIChkaXJlY3Rpb24pLCAiVmVydGljYWwgUnVsZXIiKSkK KyAgICAgICAgICAmJiBmaW5hbF9sb29wX3ApCisgICAgICAgIGJyZWFrOworICAgICAgICBlbHNl IGlmICghc3RyY21wIChTU0RBVEEgKGRpcmVjdGlvbiksICJNdWx0aXBsZSBDdXJzb3JzIikKKyAg ICAgICAgICAgICAgICAgJiYgKHByZXZpb3VzX3B0ID09IHBvc2ludAorICAgICAgICAgICAgICAg ICAgICAgfHwgRkVUQ0hfQllURSAoSVRfQllURVBPUyAoKml0KSkgPT0gJ1xuJykpCisgICAgICAg ICAgeworICAgICAgICAgICAgLyogQXMgdG8gYG1jX2NhbGMnLCB3ZSBhcmUgaW50ZXJlc3RlZCBp biB0aGUgY3VycmVudCBIUE9TIGFuZCB0aGUgY3VycmVudAorICAgICAgICAgICAgYHJlbGF0aXZl X3hgLiAgVGhlIGluY29taW5nIGFyZ3VtZW50IGZvciBwcmV2aW91c19ocG9zIGlzIGFjdHVhbGx5 IGhwb3MsCisgICAgICAgICAgICB3aGljaCBnZXRzIG1vZGlmaWVkIGFjY29yZGluZ2x5IGhlcmUg KGV2ZW4gdGhvdWdoIGEgZGlmZmVyZW50IG5hbWUpLiAqLworICAgICAgICAgICAgaWYgKHByZXZp b3VzX3B0ID09IHBvc2ludCkKKyAgICAgICAgICAgICAgLyogV2UgY291bGQsIGJ1dCBhcmUgbm90 IG1vZGlmeWluZyB0aGUgZ2xvYmFsIHByZXZpb3VzX3JlbGF0aXZlX3guICovCisgICAgICAgICAg ICAgIHJlbGF0aXZlX3ggPSBwcmV2aW91c19yZWxhdGl2ZV94OworICAgICAgICAgICAgICAvKiBX ZSBhcmUgYXQgdGhlIGVuZCBvZiB0aGUgbGluZS4gKi8KKyAgICAgICAgICAgICAgZWxzZSBpZiAo KElURVJBVE9SX0FUX0VORF9PRl9MSU5FX1AgKGl0KQorICAgICAgICAgICAgICAgICAgICAgICAg fHwgRkVUQ0hfQllURSAoSVRfQllURVBPUyAoKml0KSkgPT0gJ1xuJykKKyAgICAgICAgICAgICAg ICAgICAgICAgJiYgSVRfQ0hBUlBPUyAoKml0KSA9PSBwb3NpbnQpCisgICAgICAgICAgICAgICAg LyogYHJlbGF0aXZlX3hgIGlzIGFscmVhZHkgY29ycmVjdC4gKi8KKyAgICAgICAgICAgICAgICBw cmV2aW91c19ocG9zICs9IDE7CisgICAgICAgICAgICBMaXNwX09iamVjdCBmbGF2b3IgPSBRbmls OworICAgICAgICAgICAgaWYgKElUX0NIQVJQT1MgKCppdCkgPT0gcG9zaW50CisgICAgICAgICAg ICAgICAgJiYgKElURVJBVE9SX0FUX0VORF9PRl9MSU5FX1AgKGl0KQorICAgICAgICAgICAgICAg ICAgICB8fCBGRVRDSF9CWVRFIChJVF9CWVRFUE9TICgqaXQpKSA9PSAnXG4nKSkKKyAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgIGZsYXZvciA9IFFtY19nbHlwaGxlc3M7CisgICAgICAg ICAgICAgICAgcHJldmlvdXNfZmFjZV9pZCA9IGl0LT5mYWNlX2lkOworICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgZmxhdm9yID0gUW1jX2ds eXBoOworICAgICAgICAgICAgaWYgKHJjID09IE1PVkVfTElORV9DT05USU5VRUQpCisgICAgICAg ICAgICAgIHByZXZpb3VzX2hwb3MgKz0gMTsKKyAgICAgICAgICAgIG1jX2NhbGNfaGVscGVyIChp dC0+dywgcmVsYXRpdmVfeCwgaXQtPmN1cnJlbnRfeSwgcHJldmlvdXNfaHBvcywKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICB2cG9zLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3Jl Z3JvdW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2JhY2tncm91bmQgKGl0LT53 LCBwcmV2aW91c19mYWNlX2lkKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGF2b3Is IHBvc2ludCwgc3BlY3MsIHJlc3VsdCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICB9 CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgU3RvcmUg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KyAgICAgICAgICAgICAgICAgICAg ICA/IGZyYW1lX2NoYXJfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICA6IGZvbnRfc3BhY2Vf d2lkdGg7CisgICAgICBuZXdfeCArPSBpbmNyZW1lbnQ7CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0g Ki8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTW92ZSB0byBYICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisg ICAgICByYyA9IChJVF9DSEFSUE9TICgqaXQpID09IFpWKQorICAgICAgICAgICAgID8gTU9WRV9Q T1NfTUFUQ0hfT1JfWlYKKyAgICAgICAgICAgICA6IE1PVkVfWF9SRUFDSEVEOworICAgICAgLyog V2hlbiBgYXV0by1oc2Nyb2xsLW1vZGUnIGlzIHNldCB0byBgY3VycmVudC1saW5lYCBhbmQgd2Ug YXJlIGhvcml6b250YWwgc2Nyb2xsaW5nCisgICAgICBhIGxvbmcgbGluZSB0aGF0IGFwcHJvYWNo ZXMgb3IgZXhjZWVkcyBhbiBgaXQuY3VycmVudC54YCBvZiBhcHByb3hpbWF0ZWx5IDEwMDAsIGBy Y2AKKyAgICAgIHdpbGwgZXJyb25lb3VzbHkgcmV0dXJuIGVhcmx5IHdpdGggYSBNT1ZFX0xJTkVf VFJVTkNBVEVEIGluZGljYXRvciAgd2l0aG91dCBwdXNoaW5nCisgICAgICBmb3J3YXJkcyB1bnRp bCBJVCByZWFjaGVzIHRoZSBuZXdfeC4gIEFzIGEgd29ya2Fyb3VuZCwgaWdub3JlIE1PVkVfTElO RV9UUlVOQ0FURUQuICovCisgICAgICBpZiAoSVRfQ0hBUlBPUyAoKml0KSAhPSBaVgorICAgICAg ICAgIC8qIGBJVEVSQVRPUl9BVF9FTkRfT0ZfTElORV9QYCBtYXkgYmUgYHRydWVgIHdoZW4gSVQg aXMgYXQgdGhlIGJlZ2lubmluZyBvZiBhIGxpbmUuICovCisgICAgICAgICAgLyogJiYgIUlURVJB VE9SX0FUX0VORF9PRl9MSU5FX1AgKGl0KSAqLworICAgICAgICAgICYmIChGRVRDSF9CWVRFIChJ VF9CWVRFUE9TICgqaXQpKSAhPSAnXG4nCisgICAgICAgICAgICAgIHx8IChGRVRDSF9CWVRFIChJ VF9CWVRFUE9TICgqaXQpKSA9PSAnXG4nCisgICAgICAgICAgICAgICAgICAmJiBpdC0+YyA9PSAw KSkKKyAgICAgICAgICAmJiBpdC0+Y3VycmVudF94ICsgZm9udF9zcGFjZV93aWR0aCA8PSBuZXdf eAorICAgICAgICAgICYmIChyYyA9PSBNT1ZFX1hfUkVBQ0hFRAorICAgICAgICAgICAgICB8fCBy YyA9PSBNT1ZFX0xJTkVfVFJVTkNBVEVECisgICAgICAgICAgICAgIHx8IChpdC0+bGluZV93cmFw ID09IFdPUkRfV1JBUAorICAgICAgICAgICAgICAgICAgJiYgcmMgPT0gTU9WRV9QT1NfTUFUQ0hf T1JfWlYpKSkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBpdCBzYXZlZF9pdDsKKyAgICAg ICAgICB2b2lkICpzYXZlZF9pdGRhdGEgPSBiaWRpX3NoZWx2ZV9jYWNoZSAoKTsKKyAgICAgICAg ICBpbnQgcHJldl94OworICAgICAgICAgIFNBVkVfSVQgKHNhdmVkX2l0LCAqaXQsIHNhdmVkX2l0 ZGF0YSk7CisgICAgICAgICAgcmMgPSBtb3ZlX2l0X2luX2Rpc3BsYXlfbGluZV90byAoaXQsIFpW LCBuZXdfeCwgTU9WRV9UT19QT1MgfCBNT1ZFX1RPX1gpOworICAgICAgICAgIC8qIFdoZW4gd29y ZC13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isgICAg ICBpdC5maXJzdF92aXNpYmxlX3ggPSAwOworICAgICAgbW92ZV9pdF9ieV9saW5lcyAoJml0LCAx KTsKKyAgICAgIGxudW1fd2lkdGggPSBpdC5sbnVtX3dpZHRoOworICAgICAgbG51bV9waXhlbF93 aWR0aCA9IGl0LmxudW1fcGl4ZWxfd2lkdGg7CisgICAgICBSRVNUT1JFX0lUICgmaXQsICZzYXZl ZF9pdF9mb3Jfd2luZG93X3N0YXJ0LCBzYXZlZF9pdGRhdGFfZm9yX3dpbmRvd19zdGFydCk7Cisg ICAgICBpdC5maXJzdF92aXNpYmxlX3ggPSBmaXJzdF94OworICAgICAgaXQubGFzdF92aXNpYmxl X3ggPSBsYXN0X3g7CisgICAgICBpdC5sbnVtX3dpZHRoID0gbG51bV93aWR0aDsKKyAgICAgIGl0 LmxudW1fcGl4ZWxfd2lkdGggPSBsbnVtX3BpeGVsX3dpZHRoOworICAgICAgU0FWRV9JVCAoc2F2 ZWRfaXRfZm9yX3dpbmRvd19zdGFydCwgaXQsIHNhdmVkX2l0ZGF0YV9mb3Jfd2luZG93X3N0YXJ0 KTsKKyAgICB9CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIFJFTU9WRSBHTFlQSCBDVVJTT1JTCisqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KyAgLyogUmVtb3ZlIHRoZSBjdXJzb3JzIHVzaW5nIHRoZSBjYWNoZSBpZiB0aGUgY29uZGl0aW9u cyBhcmUgc2F0aXNmaWVkLiAqLworICBpZiAoKHJlbW92ZSAmJiAhTklMUCAody0+bWNfZ2x5cGhf Y2FjaGUpICYmIE5JTFAgKEJWQVIgKGIsIG1jX2dseXBoX2xpc3QpKSkKKyAgICAgIHx8ICghTklM UCAody0+bWNfZ2x5cGhfY2FjaGUpICYmICFOSUxQIChCVkFSIChiLCBtY19nbHlwaF9saXN0KSkg JiYgKHJlbW92ZSB8fCB3ICE9IHN3KSkpCisgICAgeworICAgICAgLyogRXJhc2UgdGhlIHJlYWwg Y3Vyc29yIHNvIHRoYXQgdGhlIHdob2xlIHZlcnRpY2FsIGxpbmUgZ2V0cyByZW1vdmVkLCBub3Qg anVzdCB0aGUgZmFrZSBjdXJzb3JzLiAqLworICAgICAgbWNfZXJhc2VfZ2x5cGhfY3Vyc29yICh3 LCB3LT5waHlzX2N1cnNvci54LCB3LT5waHlzX2N1cnNvci55LCB3LT5waHlzX2N1cnNvci5ocG9z LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5waHlzX2N1cnNvci52cG9zLCB3LT5w aHlzX2N1cnNvcl90eXBlKTsKKyAgICAgIC8qIFByb2Nlc3MgdGhlIE1DX0dMWVBIX0NBQ0hFLiAq LworICAgICAgaWYgKCFOSUxQICh3LT5tY19nbHlwaF9jYWNoZSkpCisgICAgICAgIHsKKyAgICAg ICAgICBmb3IgKHZsaXN0ID0gWENBUiAoWENEUiAody0+bWNfZ2x5cGhfY2FjaGUpKTsKKyAgICAg ICAgICAgICAgIENPTlNQICh2bGlzdCk7CisgICAgICAgICAgICAgICB2bGlzdCA9IFhDRFIgKHZs aXN0KSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgdGVuX2VsZW1lbnRzID0gWENBUiAo WENEUiAoWENBUiAodmxpc3QpKSk7CisgICAgICAgICAgICAgIHggPSBYSU5UIChGbnRoIChtYWtl X251bWJlciAoMCksIHRlbl9lbGVtZW50cykpOworICAgICAgICAgICAgICB5ID0gWElOVCAoRm50 aCAobWFrZV9udW1iZXIgKDEpLCB0ZW5fZWxlbWVudHMpKTsKKyAgICAgICAgICAgICAgaHBvcyA9 IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgdGVuX2VsZW1lbnRzKSk7CisgICAgICAgICAg ICAgIHZwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMyksIHRlbl9lbGVtZW50cykpOwor ICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKEZudGgg KG1ha2VfbnVtYmVyICg0KSwgdGVuX2VsZW1lbnRzKSk7CisgICAgICAgICAgICAgIGN1cnNvcl93 aWR0aCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICg1KSwgdGVuX2VsZW1lbnRzKSk7CisgICAg ICAgICAgICAgIGZvcmVncm91bmQgPSBGbnRoIChtYWtlX251bWJlciAoNiksIHRlbl9lbGVtZW50 cyk7CisgICAgICAgICAgICAgIGJhY2tncm91bmQgPSBGbnRoIChtYWtlX251bWJlciAoNyksIHRl bl9lbGVtZW50cyk7CisgICAgICAgICAgICAgIGZsYXZvciA9IEZudGggKG1ha2VfbnVtYmVyICg4 KSwgdGVuX2VsZW1lbnRzKTsKKyAgICAgICAgICAgICAgcG9zaW50ID0gWElOVCAoRm50aCAobWFr ZV9udW1iZXIgKDkpLCB0ZW5fZWxlbWVudHMpKTsKKyAgICAgICAgICAgICAgaWYgKEVRIChmbGF2 b3IsIFFtY19nbHlwaGxlc3MpKQorICAgICAgICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlk ICh3LCB4LCB5LCBocG9zLCB2cG9zLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBiYWNrZ3Jv dW5kLCBmbGF2b3IpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIG1j X2VyYXNlX2dseXBoX2N1cnNvciAodywgeCwgeSwgaHBvcywgdnBvcywgY3Vyc29yX3R5cGUpOwor ICAgICAgICAgICAgfQorICAgICAgICAgIGlmIChOSUxQIChCVkFSIChiLCBtY19nbHlwaF9saXN0 KSkpCisgICAgICAgICAgICB3c2V0X21jX2dseXBoX2NhY2hlICh3LCBRbmlsKTsKKyAgICAgICAg fQorICAgICAgdy0+bWMuZXJhc2VfZ2x5cGhfY3Vyc29yID0gZmFsc2U7CisgICAgfQorLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSRURSQVcg R0xZUEggQ1VSU09SUworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisgIC8qIElmIHRoZSBmaXJz dCBlbGVtZW50IG9mIHctPm1jX2dseXBoX2NhY2hlIGlzIHRoZSBzYW1lIGFzIHRoZSBsb2NhbCB2 YXJpYWJsZSBtY19nbHlwaF9saXN0LAorICAgICBhbmQgdGhlIHByZXZpb3VzL2N1cnJlbnQgd2lu ZG93LXN0YXJ0L3dpbmRvdy1lbmQgYXJlIHRoZSBzYW1lIChlLmcuLCBubyBzY3JvbGxpbmcpLAor ICAgICB0aGVuIHJlZHJhdyB0aGUgY3Vyc29ycyB1c2luZyB0aGUgY2FjaGUuICBUaGlzIGF2b2lk cyByZWNhbGN1bGF0aW5nIGNvb3JkaW5hdGVzLiAqLworICBpZiAoIXJlbW92ZQorICAgICAgJiYg dyA9PSBzdworICAgICAgJiYgdy0+bWMuY3VycmVudF9zdGFydAorICAgICAgJiYgdy0+bWMuY3Vy cmVudF9lbmQKKyAgICAgICYmIHctPm1jLnByZXZpb3VzX3N0YXJ0CisgICAgICAmJiB3LT5tYy5w cmV2aW91c19lbmQKKyAgICAgICYmIHctPm1jLmN1cnJlbnRfc3RhcnQgPT0gdy0+bWMucHJldmlv dXNfc3RhcnQKKyAgICAgICYmIHctPm1jLmN1cnJlbnRfZW5kID09IHctPm1jLnByZXZpb3VzX2Vu ZAorICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIG1jX2dseXBoX2xpc3QpKQorICAgICAgJiYgIU5J TFAgKHctPm1jX2dseXBoX2NhY2hlKQorICAgICAgJiYgIU5JTFAgKEZlcXVhbCAoRm50aCAobWFr ZV9udW1iZXIgKDApLCB3LT5tY19nbHlwaF9jYWNoZSksIEJWQVIgKGIsIG1jX2dseXBoX2xpc3Qp KSkpCisgICAgeworICAgICAgZm9yICh2bGlzdCA9IFhDQVIgKFhDRFIgKHctPm1jX2dseXBoX2Nh Y2hlKSk7CisgICAgICAgICAgIENPTlNQICh2bGlzdCk7CisgICAgICAgICAgIHZsaXN0ID0gWENE UiAodmxpc3QpKQorICAgICAgICB7CisgICAgICAgICAgdGVuX2VsZW1lbnRzID0gWENBUiAoWENE UiAoWENBUiAodmxpc3QpKSk7CisgICAgICAgICAgeCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVy ICgwKSwgdGVuX2VsZW1lbnRzKSk7CisgICAgICAgICAgeSA9IFhJTlQgKEZudGggKG1ha2VfbnVt YmVyICgxKSwgdGVuX2VsZW1lbnRzKSk7CisgICAgICAgICAgaHBvcyA9IFhJTlQgKEZudGggKG1h a2VfbnVtYmVyICgyKSwgdGVuX2VsZW1lbnRzKSk7CisgICAgICAgICAgdnBvcyA9IFhJTlQgKEZu dGggKG1ha2VfbnVtYmVyICgzKSwgdGVuX2VsZW1lbnRzKSk7CisgICAgICAgICAgY3Vyc29yX3R5 cGUgPSBtY19saXNwX3RvX2N1cnNvcl90eXBlIChGbnRoIChtYWtlX251bWJlciAoNCksIHRlbl9l bGVtZW50cykpOworICAgICAgICAgIGN1cnNvcl93aWR0aCA9IFhJTlQgKEZudGggKG1ha2VfbnVt YmVyICg1KSwgdGVuX2VsZW1lbnRzKSk7CisgICAgICAgICAgZm9yZWdyb3VuZCA9IEZudGggKG1h a2VfbnVtYmVyICg2KSwgdGVuX2VsZW1lbnRzKTsKKyAgICAgICAgICBiYWNrZ3JvdW5kID0gRm50 aCAobWFrZV9udW1iZXIgKDcpLCB0ZW5fZWxlbWVudHMpOworICAgICAgICAgIGZsYXZvciA9IEZu dGggKG1ha2VfbnVtYmVyICg4KSwgdGVuX2VsZW1lbnRzKTsKKyAgICAgICAgICBwb3NpbnQgPSBY SU5UIChGbnRoIChtYWtlX251bWJlciAoOSksIHRlbl9lbGVtZW50cykpOworICAgICAgICAgIG1j X2RyYXdfZXJhc2VfaHlicmlkICh3LCB4LCB5LCBocG9zLCB2cG9zLCBjdXJzb3JfdHlwZSwgY3Vy c29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBRbWNfZ2x5cGgpOworICAgICAgICB9CisgICAgICB3LT5t Yy5kcmF3X2dseXBoX2N1cnNvciA9IGZhbHNlOworICAgIH0KKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEUkFXIEdMWVBIIENVUlNPUlMgQU5F VworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisgICAgLyogRHJhdyB0aGUgY3Vyc29ycyBhbmV3 IGJlY2F1c2Ugc29tZXRoaW5nIGhhcyBjaGFuZ2VkLCBlLmcuLCB0aGUgZmlyc3QgZWxlbWVudCBv ZgorICAgICAgIHctPm1jX2dseXBoX2NhY2hlIGlzIE5PVCB0aGUgc2FtZSBhcyB0aGUgbG9jYWwg dmFyaWFibGUgbWNfZ2x5cGhfbGlzdDsgYW5kL29yLCB0aGUgcHJldmlvdXMvCisgICAgICAgY3Vy cmVudCB3aW5kb3ctc3RhcnQvd2luZG93LWVuZCBhcmUgTk9UIHRoZSBzYW1lIChlLmcuLCBzY3Jv bGxpbmcgaGFzIG9jY3VycmVkKS4KKyAgICAgICBTZW1pLWV4cGVuc2l2ZSBjYWxjdWxhdGlvbiBv ZiBjb29yZGluYXRlcyBpcyByZXF1aXJlZC4gKi8KKyAgICBlbHNlIGlmICghcmVtb3ZlCisgICAg ICAgICAgICAgJiYgdyA9PSBzdworICAgICAgICAgICAgICYmIHctPm1jLmN1cnJlbnRfc3RhcnQK KyAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgbWNfZ2x5cGhfbGlzdCkpKQorICAgICAg eworICAgICAgICBmb3IgKHZsaXN0ID0gQlZBUiAoYiwgbWNfZ2x5cGhfbGlzdCk7CisgICAgICAg ICAgICAgQ09OU1AgKHZsaXN0KTsKKyAgICAgICAgICAgICB2bGlzdCA9IFhDRFIgKHZsaXN0KSkK KyAgICAgICAgICB7CisgICAgICAgICAgICBzcGVjcyA9IFhDQVIgKHZsaXN0KTsKKyAgICAgICAg ICAgIHBvc2ludCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgwKSwgc3BlY3MpKTsKKyAgICAg ICAgICAgIGxpc3BfdHlwZSA9IEZudGggKG1ha2VfbnVtYmVyICgxKSwgc3BlY3MpOworICAgICAg ICAgICAgaWYgKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9 IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKFhDQVIgKGxpc3BfdHlwZSkpOworICAgICAgICAgICAg ICBlbHNlCisgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUgPSBtY19saXNwX3RvX2N1cnNvcl90 eXBlIChsaXNwX3R5cGUpOworICAgICAgICAgICAgaWYgKENPTlNQIChsaXNwX3R5cGUpKQorICAg ICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSBYSU5UIChYQ0FSIChYQ0RSIChsaXNwX3R5cGUpKSk7 CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSAxOwor ICAgICAgICAgICAgZm9yZWdyb3VuZCA9IEZudGggKG1ha2VfbnVtYmVyICgyKSwgc3BlY3MpOwor ICAgICAgICAgICAgaWYgKFNUUklOR1AgKGZvcmVncm91bmQpKQorICAgICAgICAgICAgICBmb3Jl Z3JvdW5kID0gbWNfY29sb3JfdmVjdG9yX2NhbGMgKHcsIGZvcmVncm91bmQpOworICAgICAgICAg ICAgUkVTVE9SRV9JVCAoJml0LCAmc2F2ZWRfaXRfZm9yX3dpbmRvd19zdGFydCwgc2F2ZWRfaXRk YXRhX2Zvcl93aW5kb3dfc3RhcnQpOworICAgICAgICAgICAgbW92ZV9pdF90byAoJml0LCBwb3Np bnQsIGl0Lmxhc3RfdmlzaWJsZV94LCBpdC5sYXN0X3Zpc2libGVfeSAtIDEsIC0xLAorICAgICAg ICAgICAgICAgICAgICAgICAgTU9WRV9UT19QT1MgfCBNT1ZFX1RPX1ggfCBNT1ZFX1RPX1kpOwor ICAgICAgICAgICAgaWYgKElUX0NIQVJQT1MgKGl0KSA9PSBwb3NpbnQpCisgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICBtb3ZlX2l0X2J5X2xpbmVzICgmaXQsIDApOworICAgICAgICAg ICAgICAgIExpc3BfT2JqZWN0IGRpcmVjdGlvbiA9IGJ1aWxkX3N0cmluZyAoIk11bHRpcGxlIEN1 cnNvcnMiKTsKKyAgICAgICAgICAgICAgICBtY19tb3ZlX2l0ICgmaXQsIGRpcmVjdGlvbiwgc3Bl Y3MsICZyZXN1bHQpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICB4ID0gLTE7CisgICAgICAgICAgICAgICAg ICB5ID0gLTE7CisgICAgICAgICAgICAgICAgICBocG9zID0gLTE7CisgICAgICAgICAgICAgICAg ICB2cG9zID0gLTE7CisgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kID0gbWNfYmFja2dyb3Vu ZCAoaXQudywgREVGQVVMVF9GQUNFX0lEKTsKKyAgICAgICAgICAgICAgICAgIGZsYXZvciA9IFFt Y19nbHlwaDsKKyAgICAgICAgICAgICAgICAgIHRlbl9lbGVtZW50cyA9IGxpc3RuIChDT05TVFlQ RV9IRUFQLCAxMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFr ZV9udW1iZXIgKHgpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBt YWtlX251bWJlciAoeSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IG1ha2VfbnVtYmVyIChocG9zKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgbWFrZV9udW1iZXIgKHZwb3MpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBtY19jdXJzb3JfdHlwZV90b19saXNwIChjdXJzb3JfdHlwZSksCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ha2VfbnVtYmVyIChjdXJzb3Jfd2lk dGgpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5k LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGF2b3IsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ha2VfbnVtYmVyIChwb3NpbnQpKTsK KyAgICAgICAgICAgICAgICAgIHRlbXAgPSBGY29ucyAoc3BlY3MsIEZjb25zICh0ZW5fZWxlbWVu dHMsIFFuaWwpKTsKKyAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IEZjb25zICh0ZW1wLCByZXN1 bHQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICB9CisvKiBgdy0+bWNfZ2x5cGhfY2Fj aGUnIGlzIHNldCBmb3IgdGhlIHdpbmRvdywgbm90IGJ1ZmZlcit3aW5kb3cgLS0gaS5lLiwgYWxs IGJ1ZmZlcnMgYXBwZWFyaW5nCitpbiB0aGUgc2FtZSB3aW5kb3cgdmlhIGBzd2l0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W5zIHRoZSB3aW5kb3cgbmVlZHMg dG8gYmUKKyAgcmVkaXNwbGF5ZWQuICBBZ2FpbiwgSSdtIG5vdCBzdXJlIEkgdW5kZXJzdGFuZCBo b3cgZG8geW91IGdldCBpbnRvIHRoaXMgc2l0dWF0aW9uCisgIGluIHRoZSBtaWRkbGUgb2YgcmVk aXNwbGF5LiAqLworICBib29sIGJhcmZfY3Jhc2hfb25lID0gKGNoYXJwb3MgPj0gQkVHViAmJiBj aGFycG9zIDw9IFpWKSA/IGZhbHNlIDogdHJ1ZTsKKyAgaWYgKGJhcmZfY3Jhc2hfb25lKQorICAg IHJldHVybjsKKyAgLyogRWxpIFouOiAgTGlrZXdpc2UuICBNYXJrZXJzIGFyZSB1cGRhdGVkIHdo ZW4gYSBidWZmZXIgaXMgbW9kaWZpZWQsIHNvIHRoaXMKKyAgc2hvdWxkIG5ldmVyIGhhcHBlbi4g Ki8KKyAgYm9vbCBiYXJmX2NyYXNoX3R3byA9IChjaGFycG9zID09IEJZVEVfVE9fQ0hBUiAoYnl0 ZXBvcykpID8gZmFsc2UgOiB0cnVlOworICBpZiAoYmFyZl9jcmFzaF90d28pCisgICAgcmV0dXJu OworICBpZiAoIUJVRkZFUlAgKGJ1ZikpCisgICAgcmV0dXJuOworICBpZiAoTklMUCAoQlZBUiAo YiwgY3Jvc3NoYWlycykpKQorICAgIHJldHVybjsKKyAgaWYgKE5JTFAgKEJWQVIgKGIsIGNyb3Nz aGFpcnNfaG9yaXpvbnRhbF9ydWxlcikpCisgICAgICAmJiBOSUxQIChCVkFSIChiLCBjcm9zc2hh aXJzX3ZlcnRpY2FsX3J1bGVyKSkpCisgICAgcmV0dXJuOworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTVEFSVCBUSEUgVElNRVIKKyoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyoKKyNpZmRlZiBHTFlQSF9ERUJVRworICBjbG9ja190IHN0 YXJ0LCBlbmQ7CisgIGRvdWJsZSBjcHVfdGltZV91c2VkOworICBjaGFyIGJ1Zl90aW1lW0RCTF9C VUZTSVpFX0JPVU5EXTsKKyAgc3RhcnQgPSBjbG9jaygpOworI2VuZGlmCisqLworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCRUdJTiBKT1VS TkVZIC4uLgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisgIHN0cnVjdCBpdCBpdDsKKyAgdm9p ZCAqaXRkYXRhID0gYmlkaV9zaGVsdmVfY2FjaGUgKCk7CisgIHN0cnVjdCBpdCBzYXZlZF9pdF9m b3Jfd2luZG93X3N0YXJ0OworICB2b2lkICpzYXZlZF9pdGRhdGFfZm9yX3dpbmRvd19zdGFydCA9 IE5VTEw7CisgIHN0cnVjdCBpdCBzYXZlZF9pdF9mb3JfaG9yaXpvbnRhbF9ydWxlcjsKKyAgdm9p ZCAqc2F2ZWRfaXRkYXRhX2Zvcl9ob3Jpem9udGFsX3J1bGVyID0gTlVMTDsKKyAgc3RydWN0IHRl eHRfcG9zIHN0YXJ0X3RleHRfcG9zaXRpb247CisgIHB0cmRpZmZfdCBpdF9zdGFydDsKKyAgaW50 IGZpcnN0X3gsIGxhc3RfeDsKKyAgaW50IGxudW1fd2lkdGggPSAwOworICBpbnQgbG51bV9waXhl bF93aWR0aCA9IDA7CisgIGludCBmcmFtZV9jaGFyX3dpZHRoID0gRlJBTUVfQ09MVU1OX1dJRFRI IChmKTsKKyAgaW50IHRleHRfYXJlYV93aWR0aCA9I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IGlm IChjdXJyZW50X2NvbCAlIDIgPT0gMAorICAgICAgJiYgZmlsbF9jb2x1bW5fcAorICAgICAgJiYg Y3VycmVudF9jb2wgPD0gZmlsbF9jb2wpCisgICAgZm9yZWdyb3VuZCA9IGV2ZW5fY29sb3JfdmVj dG9yOworICAvKiBncmVlbiAqLworICBpZiAoZmlsbF9jb2x1bW5fcAorICAgICAgJiYgY3VycmVu dF9jb2wgPiBmaWxsX2NvbCkKKyAgICBmb3JlZ3JvdW5kID0gZmlsbF9jb2xvcl92ZWN0b3I7Cisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICBTVEFSVCBESVNQ TEFZIEFORCBQUklNRSBJVAorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisgIC8qIEJlZ2luIHRo ZSBqb3VybmV5IGF0IHctPnN0YXJ0LiAqLworICBTRVRfVEVYVF9QT1NfRlJPTV9NQVJLRVIgKHN0 YXJ0X3RleHRfcG9zaXRpb24sIHctPnN0YXJ0KTsKKyAgc3RhcnRfZGlzcGxheSAoJml0LCB3LCBz dGFydF90ZXh0X3Bvc2l0aW9uKTsKKyAgZmlyc3RfeCA9IGl0LmZpcnN0X3Zpc2libGVfeDsKKyAg bGFzdF94ID0gaXQubGFzdF92aXNpYmxlX3g7CisgIGl0X3N0YXJ0ID0gSVRfQ0hBUlBPUyAoaXQp OworICBTQVZFX0lUIChzYXZlZF9pdF9mb3Jfd2luZG93X3N0YXJ0LCBpdCwgc2F2ZWRfaXRkYXRh X2Zvcl93aW5kb3dfc3RhcnQpOworICAvKiBGaW5pc2ggcHJpbWluZyB0aGUgSVQgZm9yIHBvdGVu dGlhbCBsaW5lIG51bWJlcnMuICovCisgIGlmICghTklMUCAoVmRpc3BsYXlfbGluZV9udW1iZXJz KQorICAgICAgJiYgIUVRIChWZGlzcGxheV9saW5lX251bWJlcnMsIFF2aXN1YWwpKQorICAgIHsK KyAgICAgIGl0LmZpcnN0X3Zpc2libGVfeCA9IDA7CisgICAgICBtb3ZlX2l0X2J5X2xpbmVzICgm aXQsIDEpOworICAgICAgbG51bV93aWR0aCA9IGl0LmxudW1fd2lkdGg7CisgICAgICBsbnVtX3Bp eGVsX3dpZHRoID0gaXQubG51bV9waXhlbF93aWR0aDsKKyAgICAgIFJFU1RPUkVfSVQgKCZpdCwg JnNhdmVkX2l0X2Zvcl93aW5kb3dfc3RhcnQsIHNhdmVkX2l0ZGF0YV9mb3Jfd2luZG93X3N0YXJ0 KTsKKyAgICAgIGl0LmZpcnN0X3Zpc2libGVfeCA9IGZpcnN0X3g7CisgICAgICBpdC5sYXN0X3Zp c2libGVfeCA9IGxhc3RfeDsKKyAgICAgIGl0LmxudW1fd2lkdGggPSBsbnVtX3dpZHRoOworICAg ICAgaXQubG51bV9waXhlbF93aWR0aCA9IGxudW1fcGl4ZWxfd2lkdGg7CisgICAgICBTQVZFX0lU IChzYXZlZF9pdF9mb3Jfd2luZG93X3N0YXJ0LCBpdCwgc2F2ZWRfaXRkYXRhX2Zvcl93aW5kb3df c3RhcnQpOworICAgIH0KKyAgLyogVGhpcyBtaWdodCBoYXBwZW4gb24gT1NYIDEwLjExIHdoZW4g cmVzdG9yaW5nIGRlc2t0b3AgYXQgdGhlIGJlZ2lubmluZworICBvZiBhIG5ldyBzZXNzaW9uPyAq LworICBpZiAoaXRfc3RhcnQgPiBvcG9pbnRfcHQpCisgICAgcmV0dXJuOworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgICBFUkFTRSBUSEUgUkVBTCBD VVJTT1IKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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gV2Ug dXNlIGB3LT5vdXRwdXRfY3Vyc29yLngveS9ocG9zL3Zwb3NgCitiZWNhdXNlIHRob3NlIGNvb3Jk aW5hdGVzIGFyZSBjb3JyZWN0LiAgV2UgZml4IGB3LT5waHlzX2N1cnNvci54L3kvaHBvcy92cG9z YAorQkVGT1JFIGNhbGxpbmcgYGVyYXNlX3BoeXNfY3Vyc29yJyBzbyB0aGF0IG90aGVyIGdvb2Rp ZXMgYXJlIHVwZGF0ZWQuICovCisgIHctPnBoeXNfY3Vyc29yLnggPSBvcG9pbnRfeDsKKyAgdy0+ cGh5c19jdXJzb3IueSA9IG9wb2ludF95OworICB3LT5waHlzX2N1cnNvci5ocG9zID0gb3BvaW50 X2hwb3M7CisgIHctPnBoeXNfY3Vyc29yLnZwb3MgPSBvcG9pbnRfdnBvczsKKyAgZXJhc2VfcGh5 c19jdXJzb3IgKHcpOworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAg ICAgICAgICAgIFJFUExBQ0UgVEhFIFJFQUwgQ1VSU09SCisqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKyAgZ2x5cGhfcm93ID0gTUFUUklYX1JPVyAody0+Y3VycmVudF9tYXRyaXgsIG9wb2ludF92 cG9zKTsKKyAgaWYgKCFjdXJzb3JfaW5fZnJpbmdlX3ApCisgICAgZmxhdm9yID0gUW1jX2dseXBo OworICAgIC8qIFRoaXMgY29uZGl0aW9uIHByb2JhYmx5IGRvZXMgbm90IGV4aXN0IGZvciB0aGUg cmVhbCBmYWtlIGN1cnNvci4gKi8KKyAgICBlbHNlIGlmIChjdXJzb3JfaW5fZnJpbmdlX3AKKyAg ICAgICAgICAgICAmJiBnbHlwaF9yb3ctPmNvbnRpbnVlZF9wKQorICAgICAgZmxhdm9yID0gUW1j X3BpbGNyb3c7CisgICAgICBlbHNlIGlmIChjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAgICAgICAg ICAgICYmIGdseXBoX3Jvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgIGZsYXZvciA9 IFFtY19ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2FuZ2xlOworICAgICAgICBlbHNlIGlmIChjdXJz b3JfaW5fZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgJiYgIWdseXBoX3Jvdy0+Y29udGludWVk X3AKKyAgICAgICAgICAgICAgICAgJiYgIWdseXBoX3Jvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3Ap CisgICAgICAgICAgZmxhdm9yID0gUW1jX2hvbGxvd19yZWN0YW5nbGU7CisgIGZhY2VfaWQgPSAo KHBoeXNfY3Vyc29yX2dseXBoID0gZ2V0X3BoeXNfY3Vyc29yX2dseXBoICh3KSkgPT0gTlVMTCkK KyAgICAgICAgICAgICAgPyBERUZBVUxUX0ZBQ0VfSUQKKyAgICAgICAgICAgICAgOiBwaHlzX2N1 cnNvcl9nbHlwaC0+ZmFjZV9pZDsKKyAgbWNfY3Jvc3NoYWlyc19oZWxwZXIgKHcsIG9wb2ludF94 LCBvcG9pbnRfeSwgb3BvaW50X2hwb3MsIG9wb2ludF92cG9zLAorICAgICAgICAgICAgICAgICAg ICAgICAgSE9MTE9XX0JPWF9DVVJTT1IsIGN1cnNvcl93aWR0aCwKKyAgICAgICAgICAgICAgICAg ICAgICAgIGZvcmVncm91bmQsIG1jX2JhY2tncm91bmQgKHcsIGZhY2VfaWQpLAorICAgICAgICAg ICAgICAgICAgICAgICAgZmxhdm9yLCBvcG9pbnRfcHQsICZyZXN1bHQpOworICBtY19jcm9zc2hh aXJzX2hlbHBlciAodywgb3BvaW50X3gsIG9wb2ludF95LCBvcG9pbnRfaHBvcywgb3BvaW50X3Zw b3MsCisgICAgICAgICAgICAgICAgICAgICAgICBIT0xMT1dfQk9YX0NVUlNPUiwgY3Vyc29yX3dp ZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZCwgbWNfYmFja2dyb3VuZCAo dywgZmFjZV9pZCksCisgICAgICAgICAgICAgICAgICAgICAgICBRb3ZlcmxheV9hcnJvd19iaXRt YXAsIG9wb2ludF9wdCwgJnJlc3VsdCk7CisgIGlmIChOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJz X2hvcml6b250YWxfcnVsZXIpKSkKKyAgICBnb3RvIHZlcnRpY2FsX3J1bGVyOworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgSE9SSVpPTlRBTCBSVUxFUjogIEZJUlNU IFggPT4gRU9MCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuZAorICAgICAgIEhP UklaT05UQUwgUlVMRVI6ICBEUkFXIEZMT0FUSU5HIEdMWVBITEVTUyBMSU5FIChFT0wgVE8gRlJJ TkdFKQorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisgIC8qIFBsYWNlIHRoZSBJVCBvbiB0aGUg Y3VycmVudCBsaW5lIGNvbnRhaW5pbmcgUFQuICovCisgIGludCB2b2Zmc2V0ID0gKGhlYWRlcl9s aW5lX2hlaWdodCA+IDAKKyAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3Zwb3MgPiAwKQorICAg ICAgICAgICAgICAgICAgPyBvcG9pbnRfdnBvcyAtIDEKKyAgICAgICAgICAgICAgICAgIDogb3Bv aW50X3Zwb3M7CisgIGlmICh2b2Zmc2V0ID4gMCkKKyAgICBtb3ZlX2l0X2J5X2xpbmVzICgmaXQs IHZvZmZzZXQpOworICBtY19tb3ZlX2l0ICgmaXQsIGJ1aWxkX3N0cmluZyAoIkhvcml6b250YWwg UnVsZXIiKSwgZm9yZWdyb3VuZCwgJnJlc3VsdCk7CisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioK KyAgICAgICAgICAgVkVSVElDQUwgUlVMRVI6ICBDT01CSU5BVElPTiBPRiBHTFlQSCAmIEdMWVBI TEVTUyBDVVJTT1JTCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAgdmVydGljYWxfcnVsZXI6 CisgIGlmIChOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzX3ZlcnRpY2FsX3J1bGVyKSkpCisgICAg Z290byBjcm9zc2hhaXJzX2ZpbmlzaDsKKyAgUkVTVE9SRV9JVCAoJml0LCAmc2F2ZWRfaXRfZm9y X3dpbmRvd19zdGFydCwgc2F2ZWRfaXRkYXRhX2Zvcl93aW5kb3dfc3RhcnQpOworICB3aGlsZSAo dHJ1ZSkKKyAgICB7CisgICAgICBtY19tb3ZlX2l0ICgmaXQsIGJ1aWxkX3N0cmluZyAoIlZlcnRp Y2FsIFJ1bGVyIiksIGZvcmVncm91bmQsICZyZXN1bHQpOworICAgICAgLyogVGhpcyBjb21iaW5h dGlvbiBvZiBhIFpWIGNoZWNrIGJlZm9yZSBgbW92ZV9pdF9ieV9saW5lcycgZm9sbG93ZWQgYnkg YQorICAgICAgWSBjaGVjayBzdWJzZXF1ZW50IHRoZXJldG8gZ2l2ZXMgdXMgdGhlIEZFQVRVUkUg b2YgaGF2aW5nIGEgdmVydGljYWwgbGluZQorICAgICAgZm9sbG93aW5nIGEgbGluZSB0ZXJtaW5h dGluZyB3aXRoIFpWLiAgV2hlcmVhcyBgZGlzcGxheS1saW5lLW51bWJlcnMtbW9kZScKKyAgICAg IGhhcyBhIEZFQVRVUkUgb2Ygc3VwcHJlc3NpbmcgdGhlIGxpbmUgbnVtYmVycyBpbiB0aGlzIHNp dHVhdGlvbiwgd2UgZHJhdworICAgICAgY3Jvc3NoYWlycyBpbiB0aGF0IHNpdHVhdGlvbi4gIGBt Y19tb3ZlX2l0JyBoYXMgYmVlbgorICAgICAgZXF1aXBwZWQgd2l0aCBhIGNvbmRpdGlvbiB0byB0 ZXN0IGZvciBaViBhdCB0aGUgb3V0c2V0IGFuZCByZXR1cm4gaWYgdHJ1ZSwKKyAgICAgIHdoaWNo IHByZXZlbnRzIEVtYWNzIGZyb20gY3Jhc2hpbmcuICovCisgICAgICBpZiAoSVRfQ0hBUlBPUyAo aXQpID09IFpWKQorICAgICAgICBicmVhazsKKyAgICAgIG1vdmVfaXRfYnlfbGluZXMgKCZpdCwg MSk7CisgICAgICBpZiAoaXQuY3VycmVudF95ID49IGl0Lmxhc3RfdmlzaWJsZV95KQorICAgICAg ICBicmVhazsKKyAgICB9CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgU0VUIFRIRSBDQUNIRQorKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisgIGNyb3NzaGFpcnNfZmluaXNoOgorICBpZiAoIU5JTFAgKHJlc3VsdCkpCisgICAgd3NldF9j cm9zc2hhaXJzX2NhY2hlICh3LCBsaXN0biAoQ09OU1RZUEVfSEVBUCwgMywKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBGcmV2ZXJzZSAocmVzdWx0KSwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBGY29ucyAoc2VsZWN0ZWRfd2luZG93LCBRbmlsKSwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGY29ucyAoYnVmLCBRbmlsKSkp OworICB3LT5tYy5kcmF3X2Nyb3NzaGFpcnMgPSBmYWxzZTsKKyAgYmlkaV91bnNoZWx2ZV9jYWNo ZSAoaXRkYXRhLCBmYWxzZSk7CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgU1RPUCBUSEUgVElNRVIKKyoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyoKKyNpZmRlZiBHTFlQSF9ERUJVRworICBlbmQgPSBjbG9jaygpOworICBjcHVfdGlt ZV91c2VkID0gKChkb3VibGUpIChlbmQgLSBzdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7CisgIGR0 b2FzdHIgKGJ1Zl90aW1lLCBzaXplb2YgYnVmX3RpbWUsIDAsIDAsIGNwdV90aW1lX3VzZWQpOwor ICBkZWJ1Z19tZXRob2RfYWRkICh3LCAibWNfZHJhd19jcm9zc2hhaXJzOiAgVElNRSAoJXMpIiwg YnVmX3RpbWUpOworI2VuZGlmCisqLworfXZvaWQKKworbWNfcmVkcmF3X2Nyb3NzaGFpcnMgKHN0 cnVjdCB3aW5kb3cgKncpCit7CisvKgorI2lmZGVmIEdMWVBIX0RFQlVHCisgIGNsb2NrX3Qgc3Rh cnQsIGVuZDsKKyAgZG91YmxlIGNwdV90aW1lX3VzZWQ7CisgIGNoYXIgYnVmX3RpbWVbREJMX0JV RlNJWkVfQk9VTkRdOworICBzdGFydCA9IGNsb2NrKCk7CisjZW5kaWYKKyovCisgIExpc3BfT2Jq ZWN0IHZsaXN0ID0gUW5pbDsKKyAgTGlzcF9PYmplY3QgdGVuX2VsZW1lbnRzID0gUW5pbDsKKyAg aW50IHgsIHksIGhwb3MsIHZwb3M7CisgIGVudW0gdGV4dF9jdXJzb3Jfa2luZHMgY3Vyc29yX3R5 cGU7CisgIGludCBjdXJzb3Jfd2lkdGg7CisgIExpc3BfT2JqZWN0IGZvcmVncm91bmQgPSBRbmls OworICBMaXNwX09iamVjdCBiYWNrZ3JvdW5kID0gUW5pbDsKKyAgTGlzcF9PYmplY3QgZmxhdm9y ID0gUW5pbDsKKyAgcHRyZGlmZl90IHBvczsKKyAgZm9yICh2bGlzdCA9IFhDQVIgKHctPmNyb3Nz aGFpcnNfY2FjaGUpOworICAgICAgIENPTlNQICh2bGlzdCk7CisgICAgICAgdmxpc3QgPSBYQ0RS ICh2bGlzdCkpCisgICAgeworICAgICAgdGVuX2VsZW1lbnRzID0gWENBUiAodmxpc3QpOworICAg ICAgeCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgwKSwgdGVuX2VsZW1lbnRzKSk7CisgICAg ICB5ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB0ZW5fZWxlbWVudHMpKTsKKyAgICAg IGhwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMiksIHRlbl9lbGVtZW50cykpOworICAg ICAgdnBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgzKSwgdGVuX2VsZW1lbnRzKSk7Cisg ICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKEZudGggKG1ha2VfbnVt YmVyICg0KSwgdGVuX2VsZW1lbnRzKSk7CisgICAgICBjdXJzb3Jfd2lkdGggPSBYSU5UIChGbnRo IChtYWtlX251bWJlciAoNSksIHRlbl9lbGVtZW50cykpOworICAgICAgZm9yZWdyb3VuZCA9IEZu dGggKG1ha2VfbnVtYmVyICg2KSwgdGVuX2VsZW1lbnRzKTsKKyAgICAgIGJhY2tncm91bmQgPSBG bnRoIChtYWtlX251bWJlciAoNyksIHRlbl9lbGVtZW50cyk7CisgICAgICBmbGF2b3IgPSBGbnRo IChtYWtlX251bWJlciAoOCksIHRlbl9lbGVtZW50cyk7CisgICAgICBwb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AobWFrZV9udW1i ZXIgKDMpLCB0ZW5fZWxlbWVudHMpKTsKKyAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19j dXJzb3JfdHlwZSAoRm50aCAobWFrZV9udW1iZXIgKDQpLCB0ZW5fZWxlbWVudHMpKTsKKyAgICAg IGN1cnNvcl93aWR0aCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICg1KSwgdGVuX2VsZW1lbnRz KSk7CisgICAgICBmb3JlZ3JvdW5kID0gRm50aCAobWFrZV9udW1iZXIgKDYpLCB0ZW5fZWxlbWVu dHMpOworICAgICAgYmFja2dyb3VuZCA9IEZudGggKG1ha2VfbnVtYmVyICg3KSwgdGVuX2VsZW1l bnRzKTsKKyAgICAgIGZsYXZvciA9IEZudGggKG1ha2VfbnVtYmVyICg4KSwgdGVuX2VsZW1lbnRz KTsKKyAgICAgIHBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICg5KSwgdGVuX2VsZW1lbnRz KSk7CisgICAgICBpZiAoRVEgKGZsYXZvciwgUW1jX2dseXBoKSkKKyAgICAgICAgbWNfZXJhc2Vf Z2x5cGhfY3Vyc29yICh3LCB4LCB5LCBocG9zLCB2cG9zLCBjdXJzb3JfdHlwZSk7CisgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAoRVEgKGZsYXZvciwgUW92 ZXJsYXlfYXJyb3dfYml0bWFwKQorICAgICAgICAgICAgICAgICAgfHwgRVEgKGZsYXZvciwgUW1j X2hvbGxvd19yZWN0YW5nbGVfcmlnaHRfYW5nbGUpCisgICAgICAgICAgICAgICAgICB8fCBFUSAo Zmxhdm9yLCBRbWNfaG9sbG93X3JlY3RhbmdsZSkKKyAgICAgICAgICAgICAgICAgIHx8IEVRIChm bGF2b3IsIFFtY192ZXJ0aWNhbF9iYXJfcmlnaHRfYW5nbGUpCisgICAgICAgICAgICAgICAgICB8 fCBFUSAoZmxhdm9yLCBRbWNfdmVydGljYWxfYmFyKQorICAgICAgICAgICAgICAgICAgfHwgRVEg KGZsYXZvciwgUW1jX3ZlcnRpY2FsX2Jhcl9iYWNrc2xhc2gpKQorICAgICAgICAgICAgICAgIGN1 cnNvcl90eXBlID0gTk9fQ1VSU09SOworICAgICAgICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJp ZCAodywgeCwgeSwgaHBvcywgdnBvcywgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgYmFja2dy b3VuZCwgZmxhdm9yKTsKKyAgICAgICAgICAgIH0KKyAgICB9CisgIGlmIChkZWxldGVfY2FjaGUp CisgICAgd3NldF9jcm9zc2hhaXJzX2NhY2hlICh3LCBRbmlsKTsKKyAgdy0+bWMuZXJhc2VfY3Jv c3NoYWlycyA9IGZhbHNlOworLyoKKyNpZmRlZiBHTFlQSF9ERUJVRworICBlbmQgPSBjbG9jaygp OworICBjcHVfdGltZV91c2VkID0gKChkb3VibGUpIChlbmQgLSBzdGFydCkpIC8gQ0xPQ0tTX1BF Ul9TRUM7CisgIGR0b2FzdHIgKGJ1Zl90aW1lLCBzaXplb2YgYnVmX3RpbWUsIDAsIDAsIGNwdV90 aW1lX3VzZWQpOworICBkZWJ1Z19tZXRob2RfYWRkICh3LCAibWNfZXJhc2VfY3Jvc3NoYWlyczog IFRJTUUgKCVzKSIsIGJ1Zl90aW1lKTsKKyNlbmRpZgorKi8KK30KKwordm9pZAorbWNfcG9ydGFs IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGN1cnNvcl9vbl9wKQoreworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNVUxUSVBMRSBDVVJTT1JT CisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAgaWYgKCFNSU5JX1dJTkRPV19QICh3KQorICAg ICAgJiYgdy0+bWMuZXJhc2VfZ2x5cGhfY3Vyc29yCisgICAgICAmJiAhTklMUCAody0+bWNfZ2x5 cGhfY2FjaGUpCisgICAgICAmJiBFUSAody0+Y29udGVudHMsIFhDQVIgKEZudGggKG1ha2VfbnVt YmVyICgyKSwgdy0+bWNfZ2x5cGhfY2FjaGUpKSkpCisgICAgbWNfY2FsYyAodywgMSk7CisgIGlm ICh3ID09IFhXSU5ET1cgKHNlbGVjdGVkX3dpbmRvdykKKyAgICAgICYmIFdJTkRPV19WQUxJRF9Q IChzZWxlY3RlZF93aW5kb3cpCisgICAgICAmJiAhTUlOSV9XSU5ET1dfUCAodykKKyAgICAgICYm IHctPm1jLmRyYXdfZ2x5cGhfY3Vyc29yCisgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBtY19nbHlwaF9saXN0KSkpCisgICAgLyogRHJhdyBmYWtlIGN1cnNvcnMg Ki8KKyAgICBtY19jYWxjICh3LCAwKTsKKyAgICAvKiBGaXJzdCBhdHRlbXB0IGF0IGRlYWxpbmcg d2l0aCBhIGByZWRpc3BsYXlfcHJlc2VydmVfZWNob19hcmVhJyBzaXR1YXRpb24uICovCisgICAg ZWxzZSBpZiAoIU1JTklfV0lORE9XX1AgKHcpCisgICAgICAgICAgICAgJiYgIXctPm1jLmRyYXdf Z2x5cGhfY3Vyc29yCisgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgbWNfZ2x5cGhfbGlzdCkpCisgICAgICAgICAgICAgJiYgIU5JTFAgKHctPm1jX2ds eXBoX2NhY2hlKQorICAgICAgICAgICAgICYmIEVRICh3LT5jb250ZW50cywgWENBUiAoRm50aCAo bWFrZV9udW1iZXIgKDIpLCB3LT5tY19nbHlwaF9jYWNoZSkpKSkKKyAgICAgIHsKKyAgICAgICAg LyogUmVtb3ZlIGZha2UgY3Vyc29ycy4gKi8KKyAgICAgICAgbWNfY2FsYyAodywgMSk7CisgICAg ICAgIC8qIERyYXcgZmFrZSBjdXJzb3JzICovCisgICAgICAgIG1jX2NhbGMgKHcsIDApOworICAg ICAgfQorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBDUk9TU0hBSVJTCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAgLyogUmVtb3ZlIGNy b3NzaGFpcnMgYW5kIGRlbGV0ZSB0aGUgY2FjaGUsIGJ1dCBPTkxZIGlmIHdlIHBsYW4gb24gcmVk cmF3aW5nIHRoZW0uCisgIEluIGEgdGltZXIgc2l0dWF0aW9uLCB3ZSB3YW50IHRvIGVyYXNlIGFu ZCByZWRyYXcgLS0gd2UgZ28gZnJvbSBgY2hlY2twb2ludF8yJworICBpbiBgcmVkaXNwbGF5X2lu dGVybmFsJyBhbmQgZm9yY2Ugb3VyIHdheSBvdmVyIHRvIGB1cGRhdGVfZnJhbWUnIDIgb2YgMy4K KyAgRW1hY3MgcmVmcmVzaGVzIHRoZSBzZWxlY3RlZCB3aW5kb3cgYWZ0ZXIgYWJvdXQgMSB0byAy IG1pbnV0ZXMgb2Ygbm8gYWN0aXZpdHkKKyAgZXZlbiB0aG91Z2ggdGhlcmUgaXMgbm90aGluZyBh dHRhY2hlZCB0byB0aGUgYHRpbWVfbGlzdCcvYGlkbGVfdGltZXJfbGlzdCcuCisgIEluIHRoYXQg cmVmcmVzaCBuby10aW1lciBzaXR1YXRpb24sIHdlIHdhbnQgdG8gZXJhc2UvZHJhdyB1c2luZyB0 aGUgY2FjaGUuICovCisgIGlmICghTUlOSV9XSU5ET1dfUCAodykKKyAgICAgICYmIHctPm1jLmVy YXNlX2Nyb3NzaGF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c3NoYWlyc192ZXJ0aWNhbF9ydWxl cikpKSkKKyAgICAgICYmIHctPm1jLmRyYXdfY3Jvc3NoYWlycykKKyAgICAvKiBEcmF3IGNyb3Nz aGFpcnMuICovCisgICAgbWNfZHJhd19jcm9zc2hhaXJzICh3KTsKKyAgICAvKiBBIHNpdHVhdGlv biB0aGF0IG9jY3VycyB3aXRoIGByZWRpc3BsYXlfcHJlc2VydmVfZWNob19hcmVhJy4gKi8KKyAg ICBlbHNlIGlmICghTUlOSV9XSU5ET1dfUCAodykKKyAgICAgICAgICAgICAmJiAhdy0+bWMuZHJh d19jcm9zc2hhaXJzCisgICAgICAgICAgICAgJiYgIU5JTFAgKHctPmNyb3NzaGFpcnNfY2FjaGUp CisgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jv c3NoYWlycykpCisgICAgICAgICAgICAgJiYgdyA9PSBYV0lORE9XIChYQ0FSIChGbnRoIChtYWtl X251bWJlciAoMSksIHctPmNyb3NzaGFpcnNfY2FjaGUpKSkKKyAgICAgICAgICAgICAmJiBFUSAo dy0+Y29udGVudHMsIFhDQVIgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgdy0+Y3Jvc3NoYWlyc19j YWNoZSkpKSkKKyAgICAgIHsKKyAgICAgICAgLyogUmVtb3ZlIGNyb3NzaGFpcnMsIGJ1dCBkbyBO T1QgZGVsZXRlIHRoZSBjYWNoZS4gKi8KKyAgICAgICAgbWNfZXJhc2VfY3Jvc3NoYWlycyAodywg ZmFsc2UpOworICAgICAgICAvKiBSZWRyYXcgdGhlIGNyb3NzaGFpcnMgdXNpbmcgdGhlIGNhY2hl LiAqLworICAgICAgICBtY19yZWRyYXdfY3Jvc3NoYWlycyAodyk7CisgICAgICB9CisgICAgICAv KiBDQVRDSEFMTDogIERSQVcgVEhFIFJFQUwgQ1VSU09SIChtYXliZSkhICovCisgICAgICBlbHNl IGlmIChjdXJzb3Jfb25fcCkKKyAgICAgICAgZGlzcGxheV9hbmRfc2V0X2N1cnNvciAodywgdHJ1 ZSwgdy0+b3V0cHV0X2N1cnNvci5ocG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICB3LT5vdXRwdXRfY3Vyc29yLnZwb3MsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHctPm91dHB1dF9jdXJzb3IueCwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgdy0+b3V0cHV0X2N1cnNvci55KTsKK30KKwordm9pZAor bWNfcmVjb3JkX3hfd3N0YXJ0X3dlbmQgKHN0cnVjdCB3aW5kb3cgKncpCit7CisgIC8qIFJlY29y ZCBwcmlvciB2YWx1ZXMgZm9yIGN1cnNvciBYLCB3aW5kb3ctc3RhcnQgYW5kIHdpbmRvdy1lbmQu CisgIFRoZSBnb2FsIGhlcmUgaXMgdG8gZmFjaWxpdGF0ZSBgbWNfY2FsYycgcmVkcmF3IG11bHRp cGxlIGZha2UKKyAgY3Vyc29ycyB1c2luZyB0aGUgY2FjaGUgaWYgbm90aGluZyBoYXMgY2hhbmdl ZC4gKi8KKyAgaWYgKCFNSU5JX1dJTkRPV19QICh3KQorICAgICAgJiYgdy0+bWMuZHJhd19nbHlw aF9jdXJzb3IKKyAgICAgICYmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBt Y19nbHlwaF9saXN0KSkKKyAgICAgICAgICB8fCAhTklMUCAody0+bWNfZ2x5cGhfY2FjaGUpKSkK KyAgICB7CisgICAgICBpZiAody0+bWMuY3VycmVudF9zdGFydCkKKyAgICAgICAgdy0+bWMucHJl dmlvdXNfc3RhcnQgPSB3LT5tYy5jdXJyZW50X3N0YXJ0OworICAgICAgICBlbHNlCisgICAgICAg ICAgdy0+bWMucHJldmlvdXNfc3RhcnQgPSAtMTsKKyAgICAgIGlmICh3LT5tYy5jdXJyZW50X2Vu ZCkKKyAgICAgICAg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b3IgKG1ha2UtZ2x5cGgtY29kZSA/XHUwMEJCICdmb250LWxv Y2std2FybmluZy1mYWNlKQorICAgICAgICAgICAgICAgICAgKG1ha2UtZ2x5cGgtY29kZSA/XHQg J2hpZ2hsaWdodCkpKQorICAgIChhc2V0IGJ1ZmZlci1kaXNwbGF5LXRhYmxlCisgICAgICAgICAg P1xuCisgICAgICAgICAgKHZlY3RvciAobWFrZS1nbHlwaC1jb2RlID9cdTAwQjYgJ2ZvbnQtbG9j ay1jb21tZW50LWZhY2UpCisgICAgICAgICAgICAgICAgICA/XG4pKQorICAgIChzZXRxIHRhYi13 aWR0aCA4KQorICAgIChzZXRxLWxvY2FsIGF1dG8taHNjcm9sbC1tb2RlICdjdXJyZW50LWxpbmUp ICovCisKK0RFRlVOICgiZGVidWdnaW5nIiwgRmRlYnVnZ2luZywgU2RlYnVnZ2luZywgMCwgMCwg MCwKKyAgICAgICBkb2M6IC8qIFRoaXMgaXMgYW4gZXhhbXBsZSBmdW5jdGlvbiB1c2VkIGZvciBk ZWJ1Z2dpbmcuICovKQorICAodm9pZCkKK3sKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAg ICAgICAgICAgICAgICAgICAgIFBSRUxJTUlOQVJZIFNUVUZGCisqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKyAgc3RydWN0IHdpbmRvdyAqdyA9IGRlY29kZV9saXZlX3dpbmRvdyAoc2VsZWN0ZWRf d2luZG93KTsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIHN0cnVj dCBpdCBpdDsKKyAgdm9pZCAqaXRkYXRhID0gYmlkaV9zaGVsdmVfY2FjaGUgKCk7CisgIGVudW0g bW92ZV9pdF9yZXN1bHQgcmMgPSBNT1ZFX1hfUkVBQ0hFRDsKKyAgc3RydWN0IHRleHRfcG9zIHN0 YXJ0X3RleHRfcG9zaXRpb247CisgIGludCBjb3VudCA9IDA7CisgIGludCBuZXdfeCA9IDA7Cisg IGludCByZWxhdGl2ZV94ID0gMDsKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAg ICAgICAgICAgICAgIFNUQVJUIERJU1BMQVkgLS0gdy0+c3RhcnQKKyoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworICAvKiBCZWdpbiB0aGUgam91cm5leSBhdCB3LT5zdGFydC4gKi8KKyAgU0VUX1RF WFRfUE9TX0ZST01fTUFSS0VSIChzdGFydF90ZXh0X3Bvc2l0aW9uLCB3LT5zdGFydCk7CisgIHN0 YXJ0X2Rpc3BsYXkgKCZpdCwgdywgc3RhcnRfdGV4dF9wb3NpdGlvbik7CisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioKKyAgICAgICAgICAgICAgICBHTyBUTyBUSEUgQkVHSU5OSU5HIE9GIFRIRSBD VVJSRU5UIExJTkUuCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAgLyogUGxhY2UgdGhlIElU IG9uIHRoZSBjdXJyZW50IGxpbmUgY29udGFpbmluZyBQVC4gKi8KKyAgaW50IHZvZmZzZXQgPSAo V0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodykgPiAwCisgICAgICAgICAgICAgICAgICYmIHct Pm91dHB1dF9jdXJzb3IudnBvcyA+IDApCisgICAgICAgICAgICAgICAgICA/IHctPm91dHB1dF9j dXJzb3IudnBvcyAtIDEKKyAgICAgICAgICAgICAgICAgIDogdy0+b3V0cHV0X2N1cnNvci52cG9z OworICBpZiAodm9mZnNldCA+IDApCisgICAgbW92ZV9pdF9ieV9saW5lcyAoJml0LCB2b2Zmc2V0 KTsKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgIE1PVkUgSVQgT1ZFUiBF QUNIIENIQVJBQ1RFUiBPTiBUSEUgQ1VSUkVOVCBMSU5FLgorKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisgIHdoaWxlICh0cnVlKQorICAgIHsKKyAgICAgIGNvdW50ICs9IDE7CisgICAgICBpZiAo bmV3X3ggPiAwKQorICAgICAgICByZWxhdGl2ZV94ID0gbmV3X3ggLSBpdC5maXJzdF92aXNpYmxl X3g7CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgRFVN UCBSRUxFVkFOVCBHTFlQSCBJTkZPUk1BVElPTgorKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisg IGludCB3X2hzY3JvbGwgPSBpdC53LT5oc2Nyb2xsOworICBpbnQgd19taW5faHNjcm9sbCA9IGl0 LnctPm1pbl9oc2Nyb2xsOworICBpbnQgaXRfY2hhcnBvcyA9IElUX0NIQVJQT1MgKGl0KTsKKyAg aW50IGZyYW1lX2NoYXJfd2lkdGggPSBGUkFNRV9DT0xVTU5fV0lEVEggKGYpOworICBzdHJ1Y3Qg ZmFjZSAqZmFjZSA9IG1jX2xvb2t1cF9mYWNlICgmaXQpOworICBzdHJ1Y3QgZm9udCAqZm9udCA9 IGZhY2UtPmZvbnQ7CisgIGludCBmb250X3NwYWNlX3dpZHRoID0gKGZvbnQgPT0gTlVMTAorICAg ICAgICAgICAgICAgICAgICAgICAgICA/IGZyYW1lX2NoYXJfd2lkdGgKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgOiBmb250LT5zcGFjZV93aWR0aCk7CisgIExpc3BfT2JqZWN0IGZvcmVncm91 bmRfZmFjZSA9IGZhY2UtPmxmYWNlW0xGQUNFX0ZPUkVHUk9VTkRfSU5ERVhdOworICBMaXNwX09i amVjdCBiYWNrZ3JvdW5kX2ZhY2UgPSBmYWNlLT5sZmFjZVtMRkFDRV9CQUNLR1JPVU5EX0lOREVY XTsKKyAgTGlzcF9PYmplY3QgYnVmID0gaXQudy0+Y29udGVudHM7CisgIGJvb2wgaHNjbCA9ICgh aXQudy0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICYmIEVRIChGYnVmZmVy X2xvY2FsX3ZhbHVlIChRYXV0b19oc2Nyb2xsX21vZGUsIGJ1ZiksIFFjdXJyZW50X2xpbmUpCisg ICAgICAgICAgICAgICAmJiBpdC53LT5oc2Nyb2xsID4gMCk7CisgIGZwcmludGYgKHN0ZGVyciwg IlxuJWQuICAlcyVzXG5cCisgICAgaXQuYyAoJWQpXG5cCisgICAgZmV0Y2hfYnl0ZSAoJWQpXG5c CisgICAgY2hhcmFjdGVyICglcylcblwKKyAgICBJVF9DSEFSUE9TICglZClcblwKKyAgICB3LT5o c2Nyb2xsICglZClcblwKKyAgICBoc2NsICglcylcblwKKyAgICB3LT5taW5faHNjcm9sbCAoJWQp XG5cCisgICAgaXQuaHBvcyAoJWQpXG5cCisgICAgaXQudnBvcyAoJWQpXG5cCisgICAgaXQuY3Vy cmVudF94ICglZClcblwKKyAgICBuZXdfeCAoJWQpXG5cCisgICAgZm9udC0+c3BhY2Vfd2lkdGgg KCVkKVxuXAorICAgIGl0LmxudW1fcGl4ZWxfd2lkdGggKCVkKVxuXAorICAgIGl0LmxudW1fd2lk dGggKCVkKVxuXAorICAgIGl0LmZpcnN0X3Zpc2libGVfeCAoJWQpXG5cCisgICAgcmVsYXRpdmVf eCAoJWQpXG5cCisgICAgaXQuZmFjZV9pZCAoJWQpXG5cCisgICAgZm9yZWdyb3VuZF9mYWNlICgl cylcblwKKyAgICBiYWNrZ3JvdW5kX2ZhY2UgKCVzKVxuXAorICAgIHJjICglcylcbiIsCisgICAg ICBjb3VudCwKKyAgICAgIChpdC5jID09IDAKKyAgICAgICAgPyAiTk9USElORyIKKyAgICAgICAg OiBpdC5jID09IDE4NworICAgICAgICAgID8gIlRBQiBDSEFSQUNURVIiCisgICAgICAgIDogaXQu YyA9PSAnXHQnCisgICAgICAgICAgPyAiVEFCIFNUUkVUQ0giCisgICAgICAgIDogIlRFWFQiKSwK KyAgICAgIChyZWxhdGl2ZV94ID09IGl0LmxudW1fcGl4ZWxfd2lkdGgKKyAgICAgICAgPyAiIC0t IFRIRSBGVU4gU1RBUlRTIEhFUkUiCisgICAgICAgIDogIiIpLAorICAgICAgaXQuYywKKyAgICAg IEZFVENIX0JZVEUgKElUX0JZVEVQT1MgKGl0KSksCisgICAgICAoIU5JTFAgKEZjaGFyX3RvX3N0 cmluZyAobWFrZV9udW1iZXIgKGl0LmMpKSkKKyAgICAgICAgPyBTU0RBVEEgKEZjaGFyX3RvX3N0 cmluZyAobWFrZV9udW1iZXIgKGl0LmMpKSkKKyAgICAgICAgOiAiTklMUCAtLSBpdC5jIGFzIGEg c3RyaW5nIiksCisgICAgICBpdF9jaGFycG9zLAorICAgICAgLyogV2hlbiBgaXQudy0+aHNjcm9s bGAgaXMgc2V0IHRvIGFuIGBpbnRgLCBnZGIgcmVwb3J0cyB0aGUgdmFsdWUKKyAgICAgIGFzIGJl aW5nOiAgPHZhcmlhYmxlIG9wdGltaXplZCBhd2F5IGJ5IGNvbXBpbGVyPiAqLworICAgICAgd19o c2Nyb2xsLAorICAgICAgKGhzY2wgPyAidHJ1ZSIgOiAiZmFsc2UiKSwKKyAgICAgIHdfbWluX2hz Y3JvbGwsCisgICAgICBpdC5ocG9zLAorICAgICAgaXQudnBvcywKKyAgICAgIGl0LmN1cnJlbnRf eCwKKyAgICAgIG5ld194LAorICAgICAgLyogQ2Fubm90IGFjY2VzcyBtZW1vcnkgYXQgYWRkcmVz cyAweGEwLiAgVGhpcyBjYW1lIGFib3V0IGJ5IHVzaW5nCisgICAgICBgP1xVMDAwMUQ0RDVgIHRv IGNyZWF0ZSBhIGZhbmN5IGZvcm0gZmVlZCBjaGFyYWN0ZXIgdGhhdCB3YXMgbm90CisgICAgICBy ZWNvZ25pemVkIGJ5IHRoZSBmb250IGNob3NlbiBvbiBYMTEuICovCisgICAgICAoZm9udCA9PSBO VUxMCisgICAgICAgPyAwCisgICAgICAgOiBmb250LT5zcGFjZV93aWR0aCksCisgICAgICBpdC5s bnVtX3BpeGVsX3dpZHRoLAorICAgICAgaXQubG51bV93aWR0aCwKKyAgICAgIGl0LmZpcnN0X3Zp c2libGVfeCwKKyAgICAgIHJlbGF0aXZlX3gsCisgICAgICBpdC5mYWNlX2lkLAorICAgICAgKCFO SUxQIChmb3JlZ3JvdW5kX2ZhY2UpCisgICAgICAgID8gU1NEQVRBIChmb3JlZ3JvdW5kX2ZhY2Up CisgICAgICAgIDogIk5JTFAgZm9yZWdyb3VuZF9mYWNlIiksCisgICAgICAoIU5JTFAgKGJhY2tn cm91bmRfZmFjZSkKKyAgICAgICAgPyBTU0RBVEEgKGJhY2tncm91bmRfZmFjZSkKKyAgICAgICAg OiAiTklMUCBiYWNrZ3JvdW5kX2ZhY2UiKSwKKyAgICAgIChyYyA9PSBNT1ZFX1VOREVGSU5FRAor ICAgICAgICA/ICJNT1ZFX1VOREVGSU5FRCIKKyAgICAgICAgOiByYyA9PSBNT1ZFX1BPU19NQVRD SF9PUl9aVgorICAgICAgICAgID8gIk1PVkVfUE9TX01BVENIX09SX1pWIgorICAgICAgICA6IHJj ID09IE1PVkVfWF9SRUFDSEVECisgICAgICAgICAgPyAiTU9WRV9YX1JFQUNIRUQiCisgICAgICAg IDogcmMgPT0gTU9WRV9MSU5FX0NPTlRJTlVFRAorICAgICAgICAgID8gIk1PVkVfTElORV9DT05U SU5VRUQiCisgICAgICAgIDogcmMgPT0gTU9WRV9MSU5FX1RSVU5DQVRFRAorICAgICAgICAgID8g Ik1PVkVfTElORV9UUlVOQ0FURUQiCisgICAgICAgIDogcmMgPT0gTU9WRV9ORVdMSU5FX09SX0NS CisgICAgICAgICAgPyAiTU9WRV9ORVdMSU5FX09SX0NSIgorICAgICAgICA6ICJPT1BTIikpOwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgIE1PVkUgSVQ6 ICBJTkNSRU1FTlQgPT0gRk9OVC5TUEFDRV9XSURUSAorKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisgICAgICBpZiAoKEZFVENIX0JZVEUgKElUX0JZVEVQT1MgKGl0KSkgPT0gJ1xuJworICAgICAg ICAgICAmJiBpdC5jICE9IDApCisgICAgICAgICAgLyogfHwgSVRFUkFUT1JfQVRfRU5EX09GX0xJ TkVfUCAoJml0KSAqLworICAgICAgICAgIHx8IHJjID09IE1PVkVfUE9TX01BVENIX09SX1pWKQor ICAgICAgICBicmVhazsKKyAgICAgIG5ld194ICs9IGZvbnRfc3BhY2Vfd2lkdGg7CisgICAgICBy YyA9IG1vdmVfaXRfaW5fZGlzcGxheV9saW5lX3RvICgmaXQsIFpWLCBuZXdfeCwgTU9WRV9UT19Q T1MgfCBNT1ZFX1RPX1gpOworICAgICAgaWYgKHJjID09IE1PVkVfTElORV9DT05USU5VRUQpCisg ICAgICAgIGJyZWFrOworICAgICAgaWYgKGl0LmN1cnJlbnRfeCAtIGl0LmZpcnN0X3Zpc2libGVf eCArIGZvbnRfc3BhY2Vfd2lkdGggPj0KKyAgICAgICAgICB3aW5kb3dfYm94X3dpZHRoICh3LCBU RVhUX0FSRUEpKQorICAgICAgICBicmVhazsKKyAgICB9CisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioKKyAgICAgICAgICAgICAgICAgICAgICAgICBSRURJU1BMQVkgQU5EIERVTVBfR0xQWUhfUk9X CisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAgcmVkaXNwbGF5X2ludGVybmFsICgpOworICBp bnQgdnBvcyA9IChXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUIChpdC53KSA+IDApCisgICAgICAg ICAgICAgPyBpdC52cG9zICsgMQorICAgICAgICAgICAgIDogaXQudnBvczsKKyAgc3RydWN0IGds eXBoX3JvdyAqZ2x5cGhfcm93ID0gTUFUUklYX1JPVyAody0+Y3VycmVudF9tYXRyaXgsIHZwb3Mp OworICBmcHJpbnRmIChzdGRlcnIsICJcbiIpOworICBkdW1wX2dseXBoX3JvdyAoZ2x5cGhfcm93 LCB2cG9zLCAyKTsKKyAgYmlkaV91bnNoZWx2ZV9jYWNoZSAoaXRkYXRhLCBmYWxzZSk7CisgIHJl dHVybiBRbmlsOworfQorCisvKiBFTkQgbXVsdGlwbGUgY3Vyc29ycyAqLworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisKKwogDAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAJCSAgICAgIFdpbmRvdyBkaXNw bGF5IGRpbWVuc2lvbnMKQEAgLTEzNjc3LDIwICsxNjAwMywzN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gICAgICAmJiBidWYKKyAgICAgICAgJiYgTUFSS0VSUCAodmFsKQorICAgICAg ICAmJiBCVUZGRVJfTElWRV9QIChidWYpKQorICAgICAgLyogYnNldF9yZWRpc3BsYXkgKGJ1Zik7 ICovCisgICAgICAvKiBFdmVuIGlmIHdlIGRvbid0IHNldCB3aW5kb3dzX29yX2J1ZmZlcnNfY2hh bmdlZCwgZG8gc2V0IGByZWRpc3BsYXknCisgICAgICBzbyB0aGF0IGlmIHdlIGxhdGVyIHNldCB3 aW5kb3dzX29yX2J1ZmZlcnNfY2hhbmdlZCwgdGhpcyBidWZmZXIgd2lsbAorICAgICAgbm90IGJl IG9taXR0ZWQuICAqLworICAgICAgYnVmLT50ZXh0LT5yZWRpc3BsYXkgPSB0cnVlOwogCSAgZWxz ZQogCSAgICByZXR1cm4gdHJ1ZTsKIAl9CisKICAgICB9CiAgIHJldHVybiBjaGFuZ2VkOworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiB9CiAKIC8qIE1hcmsgb3ZlcmxheSBhcnJvd3Mg dG8gYmUgdXBkYXRlZCBvbiBuZXh0IHJlZGlzcGxheS4gICovCkBAIC0xNDI4MSw2ICsxNjYyMywy MSBAQCByZWRpc3BsYXlfaW50ZXJuYWwgKHZvaWQpCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVN CiAJICAgICAgdXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCBmYWxzZSk7CiAjZW5kaWYKKworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIG11bHRpcGxlIGN1cnNvcnMgKi8KKworLyogTk9U RTogIEFuIGlkbGUtdGltZXIgZnVuY3Rpb24gbWF5IG5vdCBuZWNlc3NhcmlseSB0cmlnZ2VyIGBy ZWRpc3BsYXlfd2luZG93Jy4KK2BvcHRpbWl6YXRpb24gMWAgKHdoaWNoIGluY2x1ZGVzIGxlZnQv cmlnaHQgY3Vyc29yIG1vdmVtZW50IG9uIHRoZSBmaXJzdCBzY3JlZW4KK2xpbmUpLCBhbmQgYG9w dGltaXphdGlvbiAzYCAod2hpY2ggaW5jbHVkZXMgbGVmdC9yaWdodCBjdXJzb3IgbW92ZW1lbnQg b24gc2NyZWVuCitsaW5lcyBzdWJzZXF1ZW50IHRvIHRoZSBmaXJzdCBzY3JlZW4gbGluZSksIGJ5 cGFzcyBgcmVkaXNwbGF5X3dpbmRvdycuICovCisKKyAgICAgIG1jX3JlbW92ZV9ldmVyeXRoaW5n ICh3KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgICAgIGdvdG8gdXBkYXRl OwogCSAgICB9CiAJICBlbHNlCkBAIC0xNDMwMyw2ICsxNjY2MCwxNiBAQCByZWRpc3BsYXlfaW50 ZXJuYWwgKHZvaWQpCiAJCSAgJiYgKHcgPSBYV0lORE9XIChzZWxlY3RlZF93aW5kb3cpKSAhPSBz dykKIAkJZ290byByZXRyeTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIG11bHRp cGxlIGN1cnNvcnMgKi8KKworICAgICAgIGlmIChtY193aXRob3V0X3VwZGF0ZV9mcmFtZSAodykp CisgICAgICAgICBnb3RvIGVuZF9vZl9yZWRpc3BsYXk7CisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKIAkgICAgICAvKiBXZSB1c2VkIHRvIGFsd2F5cyBnb3RvIGVuZF9vZl9yZWRpc3Bs YXkgaGVyZSwgYnV0IHRoaXMKIAkJIGlzbid0IGVub3VnaCBpZiB3ZSBoYXZlIGEgYmxpbmtpbmcg Y3Vyc29yLiAgKi8KIAkgICAgICBpZiAody0+Y3Vyc29yX29mZl9wID09IHctPmxhc3RfY3Vyc29y X29mZl9wKQpAQCAtMTQzNDQsNiArMTY3MTEsMjEgQEAgcmVkaXNwbGF5X2ludGVybmFsICh2b2lk KQogCQkgICp3LT5kZXNpcmVkX21hdHJpeC0+bWV0aG9kID0gMDsKIAkJICBkZWJ1Z19tZXRob2Rf YWRkICh3LCAib3B0aW1pemF0aW9uIDMiKTsKICNlbmRpZgorCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogbXVsdGlwbGUgY3Vyc29ycyAqLworCisvKiBOT1RFOiAgQW4gaWRsZS10aW1l ciBmdW5jdGlvbiBtYXkgbm90IG5lY2Vzc2FyaWx5IHRyaWdnZXIgYHJlZGlzcGxheV93aW5kb3cn LgorYG9wdGltaXphdGlvbiAxYCAod2hpY2ggaW5jbHVkZXMgbGVmdC9yaWdodCBjdXJzb3IgbW92 ZW1lbnQgb24gdGhlIGZpcnN0IHNjcmVlbgorbGluZSksIGFuZCBgb3B0aW1pemF0aW9uIDNgICh3 aGljaCBpbmNsdWRlcyBsZWZ0L3JpZ2h0IGN1cnNvciBtb3ZlbWVudCBvbiBzY3JlZW4KK2xpbmVz IHN1YnNlcXVlbnQgdG8gdGhlIGZpcnN0IHNjcmVlbiBsaW5lKSwgYnlwYXNzIGByZWRpc3BsYXlf d2luZG93Jy4gKi8KKworICAgICAgbWNfcmVtb3ZlX2V2ZXJ5dGhpbmcgKHcpOworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKworCiAJCSAgZ290byB1cGRhdGU7CiAJCX0KIAkgICAgICBlbHNl CkBAIC0xN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TkwNTQsMTggQEAgcmVk aXNwbGF5X3dpbmRvdyAoTGlzcF9PYmplY3Qgd2luZG93LCBib29sIGp1c3RfdGhpc19vbmVfcCkK ICAgYm9vbCB1c2VfZGVzaXJlZF9tYXRyaXg7CiAgIHZvaWQgKml0ZGF0YSA9IE5VTEw7CiAKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBGZWF0dXJlIFJlcXVlc3QgIyAxNjQ3NQorICAg UmVtb3ZlIHZlcnRpY2FsIHNjcm9sbCBiYXIgYXV0b21hdGljYWxseSB3aGVuIG5vdCBuZWVkZWQu ICovCisKKyAgcHRyZGlmZl90IGJvYl9kaXNyZWdhcmRfbmFycm93LCBlb2JfZGlzcmVnYXJkX25h cnJvdywgYm9iX3Jlc3BlY3RfbmFycm93LAorICAgICAgICAgICAgZW9iX3Jlc3BlY3RfbmFycm93 LCB3aW5kb3dfc3RhcnQsIHdpbmRvd19lbmQsIGJ1ZmZlcl9zaXplLCBidWZmZXJfbmFycm93ZWRf cDsKKyAgYm9vbCB3aW5kb3dfY29udGVudHNfdmlzaWJsZV9wOworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKworCiAgIFNFVF9URVhUX1BPUyAobHBvaW50LCBQVCwgUFRfQllURSk7CiAgIG9w b2ludCA9IGxwb2ludDsKIApAQCAtMTc2ODksNiArMjAxMzMsMjIgQEAgcmVkaXNwbGF5X3dpbmRv dyAoTGlzcF9PYmplY3Qgd2luZG93LCBib29sIGp1c3RfdGhpc19vbmVfcCkKICAgZWxzZQogICAg IFRFTVBfU0VUX1BUX0JPVEggKENIQVJQT1MgKG9wb2ludCksIEJZVEVQT1MgKG9wb2ludCkpOwog CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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dCkKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKy8qIG11bHRpcGxlIGN1cnNvcnMgKi8KKworICBib29sIGJhcmZfY3Jhc2ggPSAoaXQtPmds eXBoX3JvdyA9PSBOVUxMCisgICAgICAgICAgICAgICAgICAgICB8fCBpdC0+Z2x5cGhfcm93LT51 c2VkW1RFWFRfQVJFQV0gPT0gMCkKKyAgICAgICAgICAgICAgICAgICAgPyBmYWxzZQorICAgICAg ICAgICAgICAgICAgICA6IHRydWU7CisgIGlmIChiYXJmX2NyYXNoKQorICAgcmV0dXJuOworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIHB0cmRpZmZfdCBsYXN0X2xpbmUgPSBpdC0+ bG51bTsKICAgcHRyZGlmZl90IHN0YXJ0X2Zyb20sIGJ5dGVwb3M7CiAgIHB0cmRpZmZfdCB0aGlz X2xpbmU7CkBAIC0yOTY5Miw5ICszMjE4OCwyMSBAQCBkaXNwbGF5X2FuZF9zZXRfY3Vyc29yIChz dHJ1Y3Qgd2luZG93ICp3LCBib29sIG9uLAogICAgICAgdy0+cGh5c19jdXJzb3IudnBvcyA9IHZw b3M7CiAgICAgfQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogbXVsdGlwbGUgY3Vy c29ycyAqLworCisgIExpc3BfT2JqZWN0IGNvbG9yX3ZlY3RvciA9IChGbWFrZV92ZWN0b3IgKG1h a2VfbnVtYmVyICgzKSwgUW5pbCkpOworICBBU0VUIChjb2xvcl92ZWN0b3IsIDAsIG1ha2VfZmxv YXQgKC0xLjApKTsKKyAgQVNFVCAoY29sb3JfdmVjdG9yLCAxLCBtYWtlX2Zsb2F0ICgtMS4wKSk7 CisgIEFTRVQgKGNvbG9yX3ZlY3RvciwgMiwgbWFrZV9mbG9hdCAoLTEuMCkpOwogICBGUkFNRV9S SUYgKGYpLT5kcmF3X3dpbmRvd19jdXJzb3IgKHcsIGdseXBoX3JvdywgeCwgeSwKICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfY3Vyc29yX3R5cGUsIG5ld19jdXJzb3Jf d2lkdGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb24sIGFjdGl2ZV9j dXJzb3IpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uLCBhY3RpdmVf Y3Vyc29yLCBjb2xvcl92ZWN0b3IsIFFuaWwpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiB9CiAKIApAQCAtMjk3MjYsMTAgKzMyMjM0LDMwIEBAIHVwZGF0ZV93aW5kb3dfY3Vyc29y IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIG9uKQogICAgICAgaWYgKHJvdy0+cmV2ZXJzZWRfcCAm JiBocG9zID49IHJvdy0+dXNlZFtURVhUX0FSRUFdKQogCWhwb3MgPSByb3ctPnVzZWRbVEVYVF9B UkVBXSAtIDE7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBtdWx0aXBsZSBjdXJz b3JzICovCisKKyAgICAgIC8qIE1vdmluZyB0aGUgbW91c2UgdHJpZ2dlcnMgYHVwZGF0ZV93aW5k b3dfY3Vyc29yJyB3aGljaCBjYWxscworICAgICAgYGRpc3BsYXlfYW5kX3NldF9jdXJzb3InIHRo YXQgd291bGQgb3RoZXJ3aXNlIHJlbW92ZSBhIHBvcnRpb24gb2YgdGhlCisgICAgICBob3Jpem9u dGFsIHJ1bGVyIGZyb20gcG9pbnQgYXQgZW5kIG9mIHZpc3VhbCBsaW5lIHRvIHdpbmRvdyBlZGdl LiAqLworICAgICAgYm9vbCBjcm9zc2hhaXJzX3AgPSAoIU1JTklfV0lORE9XX1AgKHcpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiAhdy0+bWMuZHJhd19jcm9zc2hhaXJzCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAody0+Y3Jvc3NoYWlyc19jYWNoZSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdyA9PSBYV0lO RE9XIChYQ0FSIChGbnRoIChtYWtlX251bWJlciAoMSksIHctPmNyb3NzaGFpcnNfY2FjaGUpKSkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIEVRICh3LT5jb250ZW50cywgWENBUiAoRm50 aCAobWFrZV9udW1iZXIgKDIpLCB3LT5jcm9zc2hhaXJzX2NhY2hlKSkpKTsKKyAgICAgIGlmICgh Y3Jvc3NoYWlyc19wKQorICAgICAgICB7CiAgICAgICBibG9ja19pbnB1dCAoKTsKICAgICAgIGRp c3BsYXlfYW5kX3NldF9jdXJzb3IgKHcsIG9uLCBocG9zLCB2cG9zLAogCQkJICAgICAgdy0+cGh5 c19jdXJzb3IueCwgdy0+cGh5c19jdXJzb3IueSk7CiAgICAgICB1bmJsb2NrX2lucHV0ICgpOwor ICAgICAgICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICB9CiB9CiAKQEAg LTMyNDM2LDYgKzM0OTY0LDI0IEBAIHhfaW50ZXJzZWN0X3JlY3RhbmdsZXMgKFhSZWN0YW5nbGUg KnIxLCBYUmVjdGFuZ2xlICpyMiwgWFJlY3RhbmdsZSAqcmVzdWx0KQogdm9pZAogc3ltc19vZl94 ZGlzcCAodm9pZCkKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIG11bHRpcGxl IGN1cnNvcnMgKi8KKworICBERUZTWU0gKFFtY19nbHlwaCwgIm1jLWdseXBoLWN1cnNvciIpOwor ICBERUZTWU0gKFFtY19nbHlwaGxlc3MsICJtYy1nbHlwbGVzcy1jdXJzb3IiKTsKKyAgREVGU1lN IChRbWNfZ2x5cGhfdGFiLCAibWMtZ2x5cGgtdGFiIik7CisKKyAgZGVmc3ViciAoJlNtY19hY3Rp dmF0ZV9jdXJzb3JzKTsKKworICBkZWZzdWJyICgmU21jX2FjdGl2YXRlX2Nyb3NzaGFpcnMpOwor CisgIGRlZnN1YnIgKCZTZGVidWdnaW5nKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisK KwogICBWd2l0aF9lY2hvX2FyZWFfc2F2ZV92ZWN0b3IgPSBRbmlsOwogICBzdGF0aWNwcm8gKCZW d2l0aF9lY2hvX2FyZWFfc2F2ZV92ZWN0b3IpOwogCmRpZmYgLS1naXQgYS9zcmMveHRlcm0uYyBi L3NyYy94dGVybS5jCmluZGV4IGFmMjhkYWIuLmViOTJjYmQgMTAwNjQ0Ci0tLSBhL3NyYy94dGVy bS5jCisrKyBiL3NyYy94dGVybS5jCkBAIC0xMTUxLDEwICsxMTUxLDEyIEBAIHhfdXBkYXRlX3dp bmRvd19lbmQgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgY3Vyc29yX29uX3AsCiAgICAgewogICAg ICAgYmxvY2tfaW5wdXQgKCk7CiAKLSAgICAgIGlmIChjdXJzb3Jfb25fcCkKLQlkaXNwbGF5X2Fu ZF9zZXRfY3Vyc29yICh3LCB0cnVlLAotCQkJCXctPm91dHB1dF9jdXJzb3IuaHBvcywgdy0+b3V0 cHV0X2N1cnNvci52cG9zLAotCQkJCXctPm91dHB1dF9jdXJzb3IueCwgdy0+b3V0cHV0X2N1cnNv ci55KTsKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogbXVsdGlwbGUgY3Vyc29ycyAqLwor CisgICAgICBtY19wb3J0YWwgKHcsIGN1cnNvcl9vbl9wKTsKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCiAKICAgICAgIGlmIChkcmF3X3dpbmRvd19mcmluZ2VzICh3LCB0cnVlKSkKIAl7CkBA IC0xNTMwLDEwICsxNTMyLDE3IEBAIHN0YXRpYyB2b2lkIHhfY2hlY2tfZm9udCAoc3RydWN0IGZy YW1lICosIHN0cnVjdCBmb250ICopOwogc3RhdGljIHZvaWQKIHhfc2V0X2N1cnNvcl9nYyAoc3Ry dWN0IGdseXBoX3N0cmluZyAqcykKIHsKLSAgaWYgKHMtPmZvbnQgPT0gRlJBTUVfRk9OVCAocy0+ ZikKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogbXVsdGlwbGUgY3Vyc29ycyAqLworCisg IHN0cnVjdCB3aW5kb3cgKncgPSBkZWNvZGVfbGl2ZV93aW5kb3cgKHNlbGVjdGVkX3dpbmRvdyk7 CisgIGlmICgocy0+Zm9udCA9PSBGUkFNRV9GT05UIChzLT5mKQogICAgICAgJiYgcy0+ZmFjZS0+ YmFja2dyb3VuZCA9PSBGUkFNRV9CQUNLR1JPVU5EX1BJWEVMIChzLT5mKQogICAgICAgJiYgcy0+ ZmFjZS0+Zm9yZWdyb3VuZCA9PSBGUkFNRV9GT1JFR1JPVU5EX1BJWEVMIChzLT5mKQogICAgICAg JiYgIXMtPmNtcCkKKyAgICAgIHx8IHctPm1jLmN1cnNvcl9nY19kZWZhdWx0KQorCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KICAgICBzLT5nYyA9IHMtPmYtPm91dHB1dF9kYXRhLngtPmN1cnNv cl9nYzsKICAgZWxzZQogICAgIHsKQEAgLTkzMjgsNyArOTMzNywxNiBAQCB4X2RyYXdfYmFyX2N1 cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqcm93LCBpbnQgd2lkdGgs IGVudW0gdGV4dAogCSBpbnZpc2libGUuICBVc2UgdGhlIGdseXBoJ3MgZm9yZWdyb3VuZCBjb2xv ciBpbnN0ZWFkIGluIHRoaXMKIAkgY2FzZSwgb24gdGhlIGFzc3VtcHRpb24gdGhhdCB0aGUgZ2x5 cGgncyBjb2xvcnMgYXJlIGNob3NlbiBzbwogCSB0aGF0IHRoZSBnbHlwaCBpcyBsZWdpYmxlLiAg Ki8KLSAgICAgIGlmIChmYWNlLT5iYWNrZ3JvdW5kID09IGYtPm91dHB1dF9kYXRhLngtPmN1cnNv cl9waXhlbCkKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBtdWx0aXBsZSBjdXJzb3Jz ICovCisKKyAgICAgIGlmIChmYWNlLT5iYWNrZ3JvdW5kID09IGYtPm91dHB1dF9kYXRhLngtPmN1 cnNvcl9waXhlbAorICAgICAgICAgICYmICF3LT5tYy5jdXJzb3JfZ2NfaW52aXNpYmxlX29rYXkp CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKIAl4Z2N2LmJhY2tncm91bmQgPSB4Z2N2 LmZvcmVncm91bmQgPSBmYWNlLT5mb3JlZ3JvdW5kOwogICAgICAgZWxzZQogCXhnY3YuYmFja2dy b3VuZCA9IHhnY3YuZm9yZWdyb3VuZCA9IGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbDsK QEAgLTk0MTYsNyArOTQzNCwxMyBAQCB4X2NsZWFyX2ZyYW1lX2FyZWEgKHN0cnVjdCBmcmFtZSAq ZiwgaW50IHgsIGludCB5LCBpbnQgd2lkdGgsIGludCBoZWlnaHQpCiBzdGF0aWMgdm9pZAogeF9k cmF3X3dpbmRvd19jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKmds eXBoX3JvdywgaW50IHgsCiAJCSAgICAgIGludCB5LCBlbnVtIHRleHRfY3Vyc29yX2tpbmRzIGN1 cnNvcl90eXBlLAotCQkgICAgICBpbnQgY3Vyc29yX3dpZHRoLCBib29sIG9uX3AsIGJvb2wgYWN0 aXZlX3ApCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIG11bHRpcGxlIGN1cnNvcnMgKi8K KworICBpbnQgY3Vyc29yX3dpZHRoLCBib29sIG9uX3AsIGJvb2wgYWN0aXZlX3AsCisgIExpc3Bf T2JqZWN0IGNvbG9yX3ZlY3RvciwgTGlzcF9PYmplY3QgZmxhdm9yKQorCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KIHsKICAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUg KHcpKTsKIApAQCAtOTQzNSwzMSArOTQ1OSwxMjcgQEAgeF9kcmF3X3dpbmRvd19jdXJzb3IgKHN0 cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKmdseXBoX3JvdywgaW50IHgsCiAJfQog ICAgICAgZWxzZQogCXsKLQkgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCi0JICAgIHsKLQkgICAgY2Fz ZSBIT0xMT1dfQk9YX0NVUlNPUjoKLQkgICAgICB4X2RyYXdfaG9sbG93X2N1cnNvciAodywgZ2x5 cGhfcm93KTsKLQkgICAgICBicmVhazsKIAotCSAgICBjYXNlIEZJTExFRF9CT1hfQ1VSU09SOgot CSAgICAgIGRyYXdfcGh5c19jdXJzb3JfZ2x5cGggKHcsIGdseXBoX3JvdywgRFJBV19DVVJTT1Ip OwotCSAgICAgIGJyZWFrOwogCi0JICAgIGNhc2UgQkFSX0NVUlNPUjoKLQkgICAgICB4X2RyYXdf YmFyX2N1cnNvciAodywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEJBUl9DVVJTT1IpOwotCSAg ICAgIGJyZWFrOworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBCRUdJTiBtdWx0aXBsZSBj dXJzb3JzICovCiAKLQkgICAgY2FzZSBIQkFSX0NVUlNPUjoKLQkgICAgICB4X2RyYXdfYmFyX2N1 cnNvciAodywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEhCQVJfQ1VSU09SKTsKLQkgICAgICBi cmVhazsKKyAgc3RydWN0IHhfZGlzcGxheV9pbmZvICpkcHlpbmZvID0gRlJBTUVfRElTUExBWV9J TkZPIChmKTsKKyAgQ29sb3JtYXAgY21hcCA9IEZSQU1FX1hfQ09MT1JNQVAgKGYpOworICB1bnNp Z25lZCBsb25nIG9yaWdpbmFsX2N1cnNvcl9waXhlbCA9IGYtPm91dHB1dF9kYXRhLngtPmN1cnNv cl9waXhlbDsKKyAgZG91YmxlIHJlZCA9IFhGTE9BVF9EQVRBIChBUkVGIChjb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U7CisgIC8qIGB4X2FsbG9jX25lYXJlc3RfY29sb3InIHNldHMgdGhlIGBjb2xvci5w aXhlbGAuICovCisgIHhfYWxsb2NfbmVhcmVzdF9jb2xvciAoZiwgY21hcCwgJmNvbG9yKTsKKwor ICBzd2l0Y2ggKGN1cnNvcl90eXBlKQorICB7CisgICAgY2FzZSBIT0xMT1dfQk9YX0NVUlNPUjoK KyAgICB7CisgICAgICBpZiAocmVkID49IDAgJiYgYmx1ZSA+PSAwICYmIGdyZWVuID49IDApCisg ICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRh LngtPmN1cnNvcl9waXhlbCcuICAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNv cl9waXhlbCA9IGNvbG9yLnBpeGVsOworICAgICAgICAgIHhfZHJhd19ob2xsb3dfY3Vyc29yICh3 LCBnbHlwaF9yb3cpOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9 IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAg ICAgeF9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIGdseXBoX3Jvdyk7CisgICAgICBicmVhazsKKyAg ICB9CisgICAgY2FzZSBGSUxMRURfQk9YX0NVUlNPUjoKKyAgICB7CisgICAgICBpZiAocmVkID49 IDAgJiYgYmx1ZSA+PSAwICYmIGdyZWVuID49IDApCisgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhp amFjayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djJyBieSBib3Jyb3dpbmcgdGhlCisgICAg ICAgIGZ1bmN0aW9uYWxpdHkgb2YgYHhfbWFrZV9nYycgaW4geGZucy5jLiAgKi8KKyAgICAgICAg eworICAgICAgICAgIGJsb2NrX2lucHV0ICgpOworICAgICAgICAgIHN0cnVjdCB3aW5kb3cgKncg PSBkZ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lOworICAgICAgICAg IHhfZHJhd19iYXJfY3Vyc29yICh3LCBnbHlwaF9yb3csIGN1cnNvcl93aWR0aCwgQkFSX0NVUlNP Uik7CisgICAgICAgICAgdy0+bWMuY3Vyc29yX2djX2ludmlzaWJsZV9va2F5ID0gZmFsc2U7Cisg ICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29y X3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB4X2RyYXdfYmFyX2N1 cnNvciAodywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEJBUl9DVVJTT1IpOworICAgICAgYnJl YWs7CisgICAgfQorICAgIGNhc2UgSEJBUl9DVVJTT1I6CisgICAgeworICAgICAgaWYgKHJlZCA+ PSAwICYmIGJsdWUgPj0gMCAmJiBncmVlbiA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyog VGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwnLiAgKi8K KyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBjb2xvci5waXhlbDsK KyAgICAgICAgICB3LT5tYy5jdXJzb3JfZ2NfaW52aXNpYmxlX29rYXkgPSB0cnVlOworICAgICAg ICAgIHhfZHJhd19iYXJfY3Vyc29yICh3LCBnbHlwaF9yb3csIGN1cnNvcl93aWR0aCwgSEJBUl9D VVJTT1IpOworICAgICAgICAgIHctPm1jLmN1cnNvcl9nY19pbnZpc2libGVfb2theSA9IGZhbHNl OworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1 cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeF9kcmF3X2Jh cl9jdXJzb3IgKHcsIGdseXBoX3JvdywgY3Vyc29yX3dpZHRoLCBIQkFSX0NVUlNPUik7CisgICAg ICBicmVhazsKKyAgICB9CisgICAgY2FzZSBOT19DVVJTT1I6CisgICAgICB3LT5waHlzX2N1cnNv cl93aWR0aCA9IDA7CisgICAgICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJv cnQgKCk7CisgIH0KKy8qIEVORCBtdWx0aXBsZSBjdXJzb3JzICovCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KIAotCSAgICBjYXNlIE5PX0NVUlNPUjoKLQkgICAgICB3LT5waHlzX2N1cnNvcl93 aWR0aCA9IDA7Ci0JICAgICAgYnJlYWs7CiAKLQkgICAgZGVmYXVsdDoKLQkgICAgICBlbWFjc19h Ym9ydCAoKTsKLQkgICAgfQogCX0KIAogI2lmZGVmIEhBVkVfWF9JMThOCg== --Multipart_Sun_Jul__8_22:28:32_2018-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs). References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Tue, 17 Jul 2018 19:12:02 +0000 Resent-Message-ID: <handler.22873.B22873.153185468217138 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN>, Marcin Borkowski <mbork@HIDDEN>, Richard Stallman <rms@HIDDEN>, John Wiegley <johnw@HIDDEN> Cc: 17684 <at> debbugs.gnu.org, 22873 <at> debbugs.gnu.org Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.153185468217138 (code B ref 22873); Tue, 17 Jul 2018 19:12:02 +0000 Received: (at 22873) by debbugs.gnu.org; 17 Jul 2018 19:11:22 +0000 Received: from localhost ([127.0.0.1]:45706 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ffVNZ-0004SG-Qr for submit <at> debbugs.gnu.org; Tue, 17 Jul 2018 15:11:21 -0400 Received: from gateway20.websitewelcome.com ([192.185.69.18]:26459) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1ffVNX-0004Rz-PW for 22873 <at> debbugs.gnu.org; Tue, 17 Jul 2018 15:11:20 -0400 Received: from cm15.websitewelcome.com (cm15.websitewelcome.com [100.42.49.9]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 114E1400F06CA for <22873 <at> debbugs.gnu.org>; Tue, 17 Jul 2018 14:11:19 -0500 (CDT) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id fVLdfDKu4bXuJfVLwfLCE9; Tue, 17 Jul 2018 14:11:18 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=jH79HZVb/AXIcDwjcz+t5f7Jw7e9WhD3/iwDCuf4Bz0=; b=g/A+19iP0s+3V52+BnwFCAjphP SBT51E5cjX1dXRQJ4ZHbeuFq7ucstSorwhHNjDk62xOiepjfww3NYnhGmebOD2d/v+EuIzTN2bX5k PCy4qsvzX5udRcbqE32svyu0LT/Ytcs1GCYi8jYgXILSEX2aQz/RX3CQQSTh19RTnaQ6/BquEJEI/ 5Q8aocCkLq3jOLa9PwhUV2d2l0OB8mgNN6vNz2pJl/T0hSJ+qfUtQMDgzmYrEc31D84yYAj3tha9L 3o8LUsekXrs63xI1UVJrJAKWNKi0aQObsutQv0njVtX+8O1DBLpx5K6te1Qygv9+mNY7sTPr3YgYZ s9nbtyeg==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:51669 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from <esq@HIDDEN>) id 1ffVLb-004GC8-EH; Tue, 17 Jul 2018 14:09:20 -0500 Date: Tue, 17 Jul 2018 12:09:18 -0700 Message-ID: <m2pnzl65nl.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Tue_Jul_17_12:09:17_2018-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1ffVLb-004GC8-EH X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:51669 X-Source-Auth: lawlist X-Email-Count: 2 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> --Multipart_Tue_Jul_17_12:09:17_2018-1 Content-Type: text/plain; charset=US-ASCII Proof concept patch version 013. Changes include, but are not limited to: - The previous problem with the speed of drawing multiple fake cursors on Emacs for Windows (which occurred with patch version 012) was caused by a plethora of useful debugging messages being sent to STDERR, which caused a tremendous slow down even when launching runemacs.exe (i.e., not the terminal). [Solution: turn off STDERR debugging messages when not needed.] - Debugging messages to STDERR is now controlled by the variable mc-stderr (non-nil for ON, and nil for OFF). - Miscellaneous cleanup of unused variables in various functions. - Minor bug fixes. - Reorganized/grouped sections within mc_move_it [MULTIPLE_CURSORS, HORIZONTAL_RULER, VERTICAL_RULER] and added more debugging details to STDERR. INSTALLATION: 1. Download a current version of Emacs master branch. 2. Reset the repository to 07/07/2018: git reset --hard 98463bed07ecc9057094928ffdc2321eaaf3ab52 3. Apply the attached patch from the root repository directory. 4. Build a GUI version of Emacs: X11, NS, or Windows. 5. To try out built-in fake cursors with Magnar Sveen's library (multiple-cursors), install that package first. 6. Load or evaluate the contents of crosshairs.el (attached), which includes code modifying a couple of functions used by Magnar Sveen's library. 7. To try out the crosshairs feature, open a simple buffer (nothing fancy, just code or text) and type: M-x +-mode 8. To see an example of crosshairs playing nicely with tab stretches, open up something like simple.el and type: M-x +-mode. 9. To see an example of a variety of built-in cursor styles and widths, type: M-x mc-test This is still a work in progress ... --Multipart_Tue_Jul_17_12:09:17_2018-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="patch_013.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvZmFjZXMuZW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GFpcnMpLCBpZHgpOyArK2lkeDsKKyAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9j YWxfZmxhZ3MsIGNyb3NzaGFpcnNfaG9yaXpvbnRhbF9ydWxlciksIGlkeCk7ICsraWR4OworICBY U0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgY3Jvc3NoYWlyc192ZXJ0aWNh bF9ydWxlciksIGlkeCk7ICsraWR4OworICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2Nh bF9mbGFncywgbWNfc3RkZXJyKSwgaWR4KTsgKytpZHg7CisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKICAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIG1vZGVf bGluZV9mb3JtYXQpLCBpZHgpOyArK2lkeDsKICAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJf bG9jYWxfZmxhZ3MsIGFiYnJldl9tb2RlKSwgaWR4KTsgKytpZHg7CiAgIFhTRVRGQVNUSU5UIChC VkFSICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBvdmVyd3JpdGVfbW9kZSksIGlkeCk7ICsraWR4OwpA QCAtNTIwMCw2ICs1MjE0LDIwIEBAIGluaXRfYnVmZmVyX29uY2UgKHZvaWQpCiAgIC8qIE11c3Qg ZG8gdGhlc2UgYmVmb3JlIG1ha2luZyB0aGUgZmlyc3QgYnVmZmVyISAqLwogCiAgIC8qIHJlYWwg c2V0dXAgaXMgZG9uZSBpbiBiaW5kaW5ncy5lbCAqLworCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgIGJzZXRfYmx2X21jX2dseXBoX2xpc3Qg KCZidWZmZXJfZGVmYXVsdHMsIFFuaWwpOworICBic2V0X2Jsdl9jcm9zc2hhaXJzICgmYnVmZmVy X2RlZmF1bHRzLCBRbmlsKTsKKyAgYnNldF9ibHZfY3Jvc3NoYWlyc19ob3Jpem9udGFsX3J1bGVy ICgmYnVmZmVyX2RlZmF1bHRzLCBRdCk7CisgIGJzZXRfYmx2X2Nyb3NzaGFpcnNfdmVydGljYWxf cnVsZXIgKCZidWZmZXJfZGVmYXVsdHMsIFF0KTsKKyAgYnNldF9ibHZfbWNfc3RkZXJyICgmYnVm ZmVyX2RlZmF1bHRzLCBRbmlsKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBi c2V0X21vZGVfbGluZV9mb3JtYXQgKCZidWZmZXJfZGVmYXVsdHMsIGJ1aWxkX3B1cmVfY19zdHJp bmcgKCIlLSIpKTsKICAgYnNldF9oZWFkZXJfbGluZV9mb3JtYXQgKCZidWZmZXJfZGVmYXVsdHMs IFFuaWwpOwogICBic2V0X2FiYnJldl9tb2RlICgmYnVmZmVyX2RlZmF1bHRzLCBRbmlsKTsKQEAg LTU0NDgsNiArNTQ3NiwxOSBAQCBzeW1zX29mX2J1ZmZlciAodm9pZCkKICAgc3RhdGljcHJvICgm UVNGdW5kYW1lbnRhbCk7CiAgIHN0YXRpY3BybyAoJlZidWZmZXJfYWxpc3QpOwogCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgIERFRlNZTSAo UW1jX2dseXBoX2xpc3QsICJtYy1nbHlwaC1saXN0Iik7CisgIERFRlNZTSAoUWNyb3NzaGFpcnMs ICJjcm9zc2hhaXJzIik7CisgIERFRlNZTSAoUWNyb3NzaGFpcnNfaG9yaXpvbnRhbF9ydWxlciwg ImNyb3NzaGFpcnMtaG9yaXpvbnRhbC1ydWxlciIpOworICBERUZTWU0gKFFjcm9zc2hhaXJzX3Zl cnRpY2FsX3J1bGVyLCAiY3Jvc3NoYWlycy12ZXJ0aWNhbC1ydWxlciIpOworICBERUZTWU0gKFFt Y19zdGRlcnIsICJtYy1zdGRlcnIiKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog ICBERUZTWU0gKFFjaG9pY2UsICJjaG9pY2UiKTsKICAgREVGU1lNIChRbGVmdCwgImxlZnQiKTsK ICAgREVGU1lNIChRcmlnaHQsICJyaWdodCIpOwpAQCAtNTQ4NSw2ICs1NTI2LDI5IEBAIHN5bXNf b2ZfYnVmZmVyICh2b2lkKQogICBGcHV0IChRcHJvdGVjdGVkX2ZpZWxkLCBRZXJyb3JfbWVzc2Fn ZSwKIAlidWlsZF9wdXJlX2Nfc3RyaW5nICgiQXR0ZW1wdCB0byBtb2RpZnkgYSBwcm90ZWN0ZWQg ZmllbGQiKSk7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJT T1JTICovCisKKyAgREVGVkFSX1BFUl9CVUZGRVIgKCJtYy1nbHlwaC1saXN0IiwgJkJWQVIgKGN1 cnJlbnRfYnVmZmVyLCBtY19nbHlwaF9saXN0KSwgUW5pbCwKKyAgICBkb2M6IC8qIEEgYnVmZXIt bG9jYWwgdmFyaWFibGUgdG8gc3RvcmUgdGhlIHZhbHVlIG9mIHRoZSBtdWx0aXBsZSBjdXJzb3Jz IHRvIGJlIGRpc3BsYXllZAorZHVyaW5nIHRoZSBuZXh0IHJlZGlzcGxheS4gKi8pOworCisgIERF RlZBUl9QRVJfQlVGRkVSICgiY3Jvc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SICgiaGVhZGVy LWxpbmUtZm9ybWF0IiwKIAkJICAgICAmQlZBUiAoY3VycmVudF9idWZmZXIsIGhlYWRlcl9saW5l X2Zvcm1hdCksCiAJCSAgICAgUW5pbCwKZGlmZiAtLWdpdCBhL3NyYy9idWZmZXIuaCBiL3NyYy9i dWZmZXIuaAppbmRleCA4NWI1NjMxLi43ZTAzYmU0IDEwMDY0NAotLS0gYS9zcmMvYnVmZmVyLmgK KysrIGIvc3JjL2J1ZmZlci5oCkBAIC02NTgsNiArNjU4LDI4IEBAIHN0cnVjdCBidWZmZXIKICAg ICAgY2FjaGUgYXJlIGVuYWJsZWQuICBTZWUgc2VhcmNoLmMsIGluZGVudC5jIGFuZCBiaWRpLmMg Zm9yIGRldGFpbHMuICAqLwogICBMaXNwX09iamVjdCBjYWNoZV9sb25nX3NjYW5zXzsKIAorCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworICAvKiBU aGUgbmFtZSBvZiBsaXN0IHVzZWQgYnkgbXVsdGlwbGUgY3Vyc29ycyBmb3IgbmV4dCByZWRpc3Bs YXkuICovCisgIExpc3BfT2JqZWN0IG1jX2dseXBoX2xpc3RfOworCisgIC8qIFRoZSBuYW1lIG9m IGxpc3QuICovCisgIExpc3BfT2JqZWN0IGNyb3NzaGFpcnNfOworCisgIC8qIFRoZSBuYW1lIG9m IHRoZSBjcm9zc2hhaXJzIGhvcml6b250YWwgcnVsZXIuICovCisgIExpc3BfT2JqZWN0IGNyb3Nz aGFpcnNfaG9yaXpvbnRhbF9ydWxlcl87CisKKyAgLyogVGhlIG5hbWUgb2YgdGhlIGNyb3NzaGFp cnMgdmVydGljYWwgcnVsZXIuICovCisgIExpc3BfT2JqZWN0IGNyb3NzaGFpcnNfdmVydGljYWxf cnVsZXJfOworCisgIC8qIFVzZWQgaW4gY29uanVuY3Rpb24gd2l0aCBnZW5lcmF0aW5nIHN0ZGVy ciBkZWJ1Z2dpbmcgbWVzc2FnZS4gKi8KKyAgTGlzcF9PYmplY3QgbWNfc3RkZXJyXzsKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBJZiB0aGUgd2lkdGggcnVuIGNhY2hlIGlz IGVuYWJsZWQsIHRoaXMgdGFibGUgY29udGFpbnMgdGhlCiAgICAgIGNoYXJhY3RlciB3aWR0aHMg d2lkdGhfcnVuX2NhY2hlIChzZWUgYWJvdmUpIGFzc3VtZXMuICBXaGVuIHdlCiAgICAgIGRvIGEg dGhvcm91Z2ggcmVkaXNwbGF5LCB3ZSBjb21wYXJlIHRoaXMgYWdhaW5zdCB0aGUgYnVmZmVyJ3MK QEAgLTkxOCw2ICs5NDAsNDQgQEAgWEJVRkZFUiAoTGlzcF9PYmplY3QgYSkKIC8qIE1vc3QgY29k ZSBzaG91bGQgdXNlIHRoZXNlIGZ1bmN0aW9ucyB0byBzZXQgTGlzcCBmaWVsZHMgaW4gc3RydWN0 CiAgICBidWZmZXIuICAoU29tZSBzZXR0ZXJzIHRoYXQgYXJlIHByaXZhdGUgdG8gYSBzaW5nbGUg LmMgZmlsZSBhcmUKICAgIGRlZmluZWQgYXMgc3RhdGljIGluIHRob3NlIGZpbGVzLikgICovCisK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKK0lO TElORSB2b2lkCitic2V0X2Jsdl9tY19nbHlwaF9saXN0IChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNw X09iamVjdCB2YWwpCit7CisgIGItPm1jX2dseXBoX2xpc3RfID0gdmFsOworfQorCitJTkxJTkUg dm9pZAorYnNldF9ibHZfY3Jvc3NoYWl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F9yb3csCiAJCQkg ICAgICBpbnQgeCwgaW50IHksCiAJCQkgICAgICBlbnVtIHRleHRfY3Vyc29yX2tpbmRzIGN1cnNv cl90eXBlLAotCQkJICAgICAgaW50IGN1cnNvcl93aWR0aCwgYm9vbCBvbl9wLCBib29sIGFjdGl2 ZV9wKTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMg Ki8KKworICAgICAgICAgaW50IGN1cnNvcl93aWR0aCwgYm9vbCBvbl9wLCBib29sIGFjdGl2ZV9w LAorICAgICAgICAgTGlzcF9PYmplY3QgY29sb3JfdmVjdG9yLCBMaXNwX09iamVjdCBmbGF2b3Ip OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwogCiAgIC8qIERyYXcgdmVydGljYWwgYm9y ZGVyIGZvciB3aW5kb3cgVyBmcm9tIChYLFlfMCkgdG8gKFgsWV8xKS4gICovCiAgIHZvaWQgKCpk cmF3X3ZlcnRpY2FsX3dpbmRvd19ib3JkZXIpIChzdHJ1Y3Qgd2luZG93ICp3LApAQCAtMzI4NCw2 ICszMjkzLDE1IEBAIGV4dGVybiB2b2lkIGdldF9mb250X2FzY2VudF9kZXNjZW50IChzdHJ1Y3Qg Zm9udCAqLCBpbnQgKiwgaW50ICopOwogCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCiAKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKK3ZvaWQg bWNfcG9ydGFsIChzdHJ1Y3Qgd2luZG93ICosIGJvb2wpOworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqK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ueHguLiIKKyAgICAgICJ4Li4uLnh4LiIKKyAgICAgICJ4Lnh4eHh4eCIKKyAg ICAgICJ4Lnh4eHh4eCIKKyAgICAgICJ4Li4uLnh4LiIKKyAgICAgICJ4Li4ueHguLiIKKyAgICAg ICJ4Li54eC4uLiIKKyAgICAgICJ4Li4uLi4uLiIKKyAgICAgICJ4Li4uLi4uLiIKKyAgICAgICJ4 Li4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3ZlcnRpY2FsX2Jhcl9yaWdo dF9hbmdsZV9iaXRzW10gPXsKKyAgMHg4MCwgMHg4MCwgMHg4MCwgMHg5OCwgMHg4YywgMHg4Niwg MHhiZiwKKyAgMHhiZiwgMHg4NiwgMHg4YywgMHg5OCwgMHg4MCwgMHg4MCwgMHg4MH07CisKKy8q IDI1CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4eHh4eHh4Igor ICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLnh4Li54IgorICAg ICAgInguLi54eC54IgorICAgICAgInguLi4ueHh4IgorICAgICAgIngueHh4eHh4IgorICAgICAg IngueHh4eHh4IgorICAgICAgInguLi4ueHh4IgorICAgICAgInguLi54eC54IgorICAgICAgIngu Lnh4Li54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInh4eHh4 eHh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfaG9sbG93X3JlY3RhbmdsZV9yaWdo dF9hbmdsZV9iaXRzW10gPXsKKyAgMHhmZiwgMHg4MSwgMHg4MSwgMHg5OSwgMHg4ZCwgMHg4Nywg MHhiZiwKKyAgMHhiZiwgMHg4NywgMHg4ZCwgMHg5OSwgMHg4MSwgMHg4MSwgMHhmZn07CisKKy8q IDI2CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4eHh4eHh4Igor ICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAg ICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAg InguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgIngu Li4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInh4eHh4 eHh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfaG9sbG93X3JlY3RhbmdsZV9iaXRz W10gPXsKKyAgMHhmZiwgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwKKyAgMHg4 MSwgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwgMHhmZn07CisKKy8qIDI3CisgICAgKCst ZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4u Li4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4u IgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgor ICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAg ICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIikKKyovCitz dGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdmVydGljYWxfYmFyX2JpdHNbXSA9eworICAweDgwLCAw eDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwLAorICAweDgwLCAweDgwLCAweDgwLCAw eDgwLCAweDgwLCAweDgwLCAweDgwfTsKKworLyogMjgKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhl eGFkZWNpbWFsCisgICAgICAieHguLi4uLi4iCisgICAgICAiLnh4Li4uLi4iCisgICAgICAiLi54 eC4uLi4iCisgICAgICAiLi4ueHguLi4iCisgICAgICAiLi4uLnh4Li4iCisgICAgICAiLi4uLi54 eC4iCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi54eC4iCisgICAgICAiLi4uLnh4Li4i CisgICAgICAiLi4ueHguLi4iCisgICAgICAiLi54eC4uLi4iCisgICAgICAiLnh4Li4uLi4iCisg ICAgICAieHguLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19yaWdodF9hbmds ZV9iaXRzW10gPXsKKyAgMHhjMCwgMHg2MCwgMHgzMCwgMHgxOCwgMHhjLCAweDYsIDB4MywgMHg2 LCAweGMsIDB4MTgsIDB4MzAsIDB4NjAsIDB4YzB9OworCisvKiAyOQorICAgICgrLWZyaW5nZS1o ZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICJ4eC4uLi4uLiIKKyAgICAgICJ4eC4uLi4uLiIKKyAg ICAgICIgeHguLi4uLiIKKyAgICAgICIueHguLi4uLiIKKyAgICAgICIuLnh4Li4uLiIKKyAgICAg ICIuLnh4Li4uLiIKKyAgICAgICIuLi54eC4uLiIKKyAgICAgICIuLi54eC4uLiIKKyAgICAgICIu Li4ueHguLiIKKyAgICAgICIuLi4ueHguLiIKKyAgICAgICIuLi4uLnh4LiIKKyAgICAgICIuLi4u Lnh4LiIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIpCisqLworc3RhdGljIHVu c2lnbmVkIHNob3J0IG1jX2JhY2tzbGFzaF9iaXRzW10gPXsKKyAgMHhjMCwgMHhjMCwgMHhlMCwg MHg2MCwgMHgzMCwgMHgzMCwgMHgxOCwgMHgxOCwgMHhjLCAweGMsIDB4NiwgMHg2LCAweDMsIDB4 M307CisKKy8qIDMwCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4 Li4uLi4uIgorICAgICAgInh4Li4uLi4uIgorICAgICAgInh4eC4uLi4uIgorICAgICAgInh4eC4u Li4uIgorICAgICAgIngueHguLi4uIgorICAgICAgIngueHguLi4uIgorICAgICAgInguLnh4Li4u IgorICAgICAgInguLnh4Li4uIgorICAgICAgInguLi54eC4uIgorICAgICAgInguLi54eC4uIgor ICAgICAgInguLi4ueHguIgorICAgICAgInguLi4ueHguIgorICAgICAgInguLi4uLnh4IgorICAg ICAgInguLi4uLnh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdmVydGljYWxfYmFy X2JhY2tzbGFzaF9iaXRzW10gPXsKKyAgMHhjMCwgMHhjMCwgMHhlMCwgMHhlMCwgMHhiMCwgMHhi MCwgMHg5OCwKKyAgMHg5OCwgMHg4YywgMHg4YywgMHg4NiwgMHg4NiwgMHg4MywgMHg4M307CisK Ky8qIDMxCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi54eHh4eHgu IgorICAgICAgInh4eHgueC4uIgorICAgICAgInh4eHgueC4uIgorICAgICAgInh4eHgueC4uIgor ICAgICAgIi54eHgueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAg ICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAg Ii4uLngueC4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcGlsY3Jvd19iaXRzW10g PXsKKyAgMHg3ZSwgMHhmNCwgMHhmNCwgMHhmNCwgMHg3NCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgx NCwgMHgxNCwgMHgxNH07CisKKy8qIDMyCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1h bAorICAgICAgInh4Lnh4Li4uIgorICAgICAgIi54eC54eC4uIgorICAgICAgIi4ueHgueHguIgor ICAgICAgIi4uLnh4Lnh4IgorICAgICAgIi4ueHgueHguIgorICAgICAgIi54eC54eC4uIgorICAg ICAgInh4Lnh4Li4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcmlnaHRfZG91Ymxl X2FuZ2xlX2JpdHNbXSA9eworICAweGQ4LCAweDZjLCAweDM2LCAweDFiLCAweDM2LCAweDZjLCAw eGQ4fTsKKworLyogMzMKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAi Li54eHh4Li4iCisgICAgICAiLnh4eHh4eC4iCisgICAgICAieC4ueHguLngiCisgICAgICAieC4u eHguLngiCisgICAgICAieHh4eHh4eHgiCisgICAgICAieHguLi4ueHgiCisgICAgICAieHh4Li54 eHgiCisgICAgICAiLnh4eHh4eC4iCisgICAgICAiLi54eHh4Li4iKQorKi8KK3N0YXRpYyB1bnNp Z25lZCBzaG9ydCBtY19zbWlsZXlfZmFjZV9iaXRzW10gPXsKKyAgMHgzYywgMHg3ZSwgMHg5OSwg MHg5OSwgMHhmZiwgMHhjMywgMHhlNywgMHg3ZSwgMHgzY307CisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworCisKICNkZWZpbmUgQllURVNfUEVSX0JJVE1BUF9ST1cgIChzaXplb2YgKHVuc2ln bmVkIHNob3J0KSkKICNkZWZpbmUgU1RBTkRBUkRfQklUTUFQX0hFSUdIVChiaXRzKSAoc2l6ZW9m IChiaXRzKS9CWVRFU19QRVJfQklUTUFQX1JPVykKICNkZWZpbmUgRlJCSVRTKGJpdHMpICBiaXRz LCBTVEFOREFSRF9CSVRNQVBfSEVJR0hUIChiaXRzKQpAQCAtNDY2LDYgKzY4NiwzNSBAQCBzdGF0 aWMgc3RydWN0IGZyaW5nZV9iaXRtYXAgc3RhbmRhcmRfYml0bWFwc1tdID0KICAgeyBGUkJJVFMg KHZlcnRpY2FsX2Jhcl9iaXRzKSwgICAgICAgOCwgMCwgQUxJR05fQklUTUFQX0NFTlRFUiwgMCB9 LAogICB7IEZSQklUUyAoaG9yaXpvbnRhbF9iYXJfYml0cyksICAgICA4LCAwLCBBTElHTl9CSVRN QVBfQk9UVE9NLCAwIH0sCiAgIHsgRlJCSVRTIChlbXB0eV9saW5lX2JpdHMpLCAgICAgICAgIDgs IDMsIEFMSUdOX0JJVE1BUF9UT1AsICAgIDAgfSwKKworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworICAvKiAyNCAqLworICB7IEZSQklUUyAobWNf dmVydGljYWxfYmFyX3JpZ2h0X2FuZ2xlX2JpdHMpLCAgICAgOCwgMCwgQUxJR05fQklUTUFQX0NF TlRFUiwgMCB9LAorICAvKiAyNSAqLworICB7IEZSQklUUyAobWNfaG9sbG93X3JlY3RhbmdsZV9y aWdodF9hbmdsZV9iaXRzKSwgOCwgMCwgQUxJR05fQklUTUFQX0NFTlRFUiwgMCB9LAorICAvKiAy NiAqLworICB7IEZSQklUUyAobWNfaG9sbG93X3JlY3RhbmdsZV9iaXRzKSwgICAgICAgICAgICAg OCwgMCwgQUxJR05fQklUTUFQX0NFTlRFUiwgMCB9LAorICAvKiAyNyAqLworICB7IEZSQklUUyAo bWNfdmVydGljYWxfYmFyX2JpdHMpLCAgICAgICAgICAgICAgICAgOCwgMCwgQUxJR05fQklUTUFQ X0NFTlRFUiwgMCB9LAorICAvKiAyOCAqLworICB7IEZSQklUUyAobWNfcmlnaHRfYW5nbGVfYml0 cyksICAgICAgICAgICAgICAgICAgOCwgMCwgQUxJR05fQklUTUFQX0NFTlRFUiwgMCB9LAorICAv KiAyOSAqLworICB7IEZSQklUUyAobWNfYmFja3NsYXNoX2JpdHMpLCAgICAgICAgICAgICAgICAg ICAgOCwgMCwgQUxJR05fQklUTUFQX0NFTlRFUiwgMCB9LAorICAvKiAzMCAqLworICB7IEZSQklU UyAobWNfdmVydGljYWxfYmFyX2JhY2tzbGFzaF9iaXRzKSwgICAgICAgOCwgMCwgQUxJR05fQklU TUFQX0NFTlRFUiwgMCB9LAorICAvKiAzMSAqLworICB7IEZSQklUUyAobWNfcGlsY3Jvd19iaXRz KSwgICAgICAgICAgICAgICAgICAgICAgOCwgMCwgQUxJR05fQklUTUFQX0NFTlRFUiwgMCB9LAor ICAvKiAzMiAqLworICB7IEZSQklUUyAobWNfcmlnaHRfZG91YmxlX2FuZ2xlX2JpdHMpLCAgICAg ICAgICAgOCwgMCwgQUxJR05fQklUTUFQX0NFTlRFUiwgMCB9LAorICAvKiAzMyAqLworICB7IEZS QklUUyAobWNfc21pbGV5X2ZhY2VfYml0cyksICAgICAgICAgICAgICAgICAgOCwgMCwgQUxJR05f QklUTUFQX0NFTlRFUiwgMCB9LAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiB9Owog CiAjZGVmaW5lIE5PX0ZSSU5HRV9CSVRNQVAgMApAQCAtMTcxNSw2ICsxOTY0LDc3IEBAIElmIG5p bCwgYWxzbyBjb250aW51ZSBsaW5lcyB3aGljaCBhcmUgZXhhY3RseSBhcyB3aWRlIGFzIHRoZSB3 aW5kb3cuICAqLyk7CiAgIERFRlZBUl9MSVNQICgiZnJpbmdlLWJpdG1hcHMiLCBWZnJpbmdlX2Jp dG1hcHMsCiAgICAgZG9jOiAvKiBMaXN0IG9mIGZyaW5nZSBiaXRtYXAgc3ltYm9scy4gICovKTsK ICAgVmZyaW5nZV9iaXRtYXBzID0gUW5pbDsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworICAvKiAoZ2V0ICdlbXB0eS1saW5lICdmcmluZ2Up ID0+IDIzID0+IHRoZSBsYXN0IHN0YW5kYXJkLWJpdG1hcCBiZWZvcm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JlciAoMzMpKTsKKyAgLyogKGdldCAnKy1zbWlsZXktZmFjZSAn ZnJpbmdlKSA9PiAzMyAqLworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiB9CiAKIC8q IEdhcmJhZ2UgY29sbGVjdGlvbiBob29rICovCmRpZmYgLS1naXQgYS9zcmMva2V5Ym9hcmQuYyBi L3NyYy9rZXlib2FyZC5jCmluZGV4IGFhNThlMjYuLjhmZDNhYzggMTAwNjQ0Ci0tLSBhL3NyYy9r ZXlib2FyZC5jCisrKyBiL3NyYy9rZXlib2FyZC5jCkBAIC0xMjI0LDYgKzEyMjQsMjkgQEAgc3Rh dGljIGludCByZWFkX2tleV9zZXF1ZW5jZSAoTGlzcF9PYmplY3QgKiwgTGlzcF9PYmplY3QsCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sLCBib29sLCBib29sLCBib29sKTsKIHN0 YXRpYyB2b2lkIGFkanVzdF9wb2ludF9mb3JfcHJvcGVydHkgKHB0cmRpZmZfdCwgYm9vbCk7CiAK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKK3N0 YXRpYyB2b2lkCitrYmRfbWNfYWN0aXZhdGVfY3Vyc29ycyAodm9pZCkKK3sKKyAgc3RydWN0IHdp bmRvdyAqdyA9IGRlY29kZV9saXZlX3dpbmRvdyAoc2VsZWN0ZWRfd2luZG93KTsKKyAgdy0+bWMu ZHJhd19nbHlwaF9jdXJzb3IgPSB0cnVlOworICB3LT5tYy5lcmFzZV9nbHlwaF9jdXJzb3IgPSB0 cnVlOworfQorCitzdGF0aWMgdm9pZAora2JkX21jX2FjdGl2YXRlX2Nyb3NzaGFpcnMgKHZvaWQp Cit7CisgIHN0cnVjdCB3aW5kb3cgKncgPSBkZWNvZGVfbGl2ZV93aW5kb3cgKHNlbGVjdGVkX3dp bmRvdyk7CisgIHctPm1jLmRyYXdfY3Jvc3NoYWlycyA9IHRydWU7CisgIHctPm1jLmVyYXNlX2Ny b3NzaGFpcnMgPSB0cnVlOworfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiBMaXNw X09iamVjdAogY29tbWFuZF9sb29wXzEgKHZvaWQpCiB7CkBAIC0xNDE5LDYgKzE0NDIsMTUgQEAg Y29tbWFuZF9sb29wXzEgKHZvaWQpCiAgICAgICBWcmVhbF90aGlzX2NvbW1hbmQgPSBjbWQ7CiAg ICAgICBzYWZlX3J1bl9ob29rcyAoUXByZV9jb21tYW5kX2hvb2spOwogCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgICAgICBrYmRfbWNfYWN0 aXZhdGVfY3Vyc29ycyAoKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAg YWxyZWFkeV9hZGp1c3RlZCA9IDA7CiAKICAgICAgIGlmIChOSUxQIChWdGhpc19jb21tYW5kKSkK ZGlmZiAtLWdpdCBhL3NyYy9uc3Rlcm0ubSBiL3NyYy9uc3Rlcm0ubQppbmRleCBhMTU2ODRkLi4w ZWU3Y2JmIDEwMDY0NAotLS0gYS9zcmMvbnN0ZXJtLm0KKysrIGIvc3JjL25zdGVybS5tCkBAIC0x MTg4LDEwICsxMTg4LDE0IEBAIHN0YXRpYyBOU1JlY3QgY29uc3RyYWluX2ZyYW1lX3JlY3QoTlNS ZWN0IGZyYW1lUmVjdCwgYm9vbCBpc0Z1bGxzY3JlZW4pCiAgICAgewogICAgICAgYmxvY2tfaW5w dXQgKCk7CiAKLSAgICAgIGlmIChjdXJzb3Jfb25fcCkKLQlkaXNwbGF5X2FuZF9zZXRfY3Vyc29y ICh3LCAxLAotCQkJCXctPm91dHB1dF9jdXJzb3IuaHBvcywgdy0+b3V0cHV0X2N1cnNvci52cG9z LAotCQkJCXctPm91dHB1dF9jdXJzb3IueCwgdy0+b3V0cHV0X2N1cnNvci55KTsKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgICAgIG1jX3Bv cnRhbCAodywgY3Vyc29yX29uX3ApOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwogCiAg ICAgICBpZiAoZHJhd193aW5kb3dfZnJpbmdlcyAodywgMSkpCiAJewpAQCAtMzE3Miw3ICszMTc2 LDE3IEBAIHNvIHNvbWUga2V5IHByZXNzZXMgKFRBQikgYXJlIHN3YWxsb3dlZCBieSB0aGUgc3lz dGVtLiAgKi8KIHN0YXRpYyB2b2lkCiBuc19kcmF3X3dpbmRvd19jdXJzb3IgKHN0cnVjdCB3aW5k b3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKmdseXBoX3JvdywKIAkJICAgICAgIGludCB4LCBpbnQg eSwgZW51bSB0ZXh0X2N1cnNvcl9raW5kcyBjdXJzb3JfdHlwZSwKLQkJICAgICAgIGludCBjdXJz b3Jfd2lkdGgsIGJvb2wgb25fcCwgYm9vbCBhY3RpdmVfcCkKKworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworICBpbnQgY3Vyc29yX3dpZHRoLCBi b29sIG9uX3AsIGJvb2wgYWN0aXZlX3AsCisgIExpc3BfT2JqZWN0IGNvbG9yX3ZlY3RvciwgTGlz cF9PYmplY3QgZmxhdm9yKQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiAtLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLQogICAgICBFeHRlcm5hbCBjYWxsIChSSUYpOiBkcmF3IGN1cnNvci4KICAg ICAgTm90ZSB0aGF0IENVUlNPUl9XSURUSCBpcyBtZWFuaW5nZnVsIG9ubHkgZm9yIChoKWJhciBj dXJzb3JzLgpAQCAtMzIwNiw4ICszMjIwLDI5IEBAIE5vdGUgdGhhdCBDVVJTT1JfV0lEVEggaXMg bWVhbmluZ2Z1bCBvbmx5IGZvciAoaCliYXIgY3Vyc29ycy4KIAogICBpZiAoKHBoeXNfY3Vyc29y X2dseXBoID0gZ2V0X3BoeXNfY3Vyc29yX2dseXBoICh3KSkgPT0gTlVMTCkKICAgICB7Ci0gICAg ICBpZiAoZ2x5cGhfcm93LT5leGFjdF93aW5kb3dfd2lkdGhfbGluZV9wCi0gICAgICAgICAgJiYg dy0+cGh5c19jdXJzb3IuaHBvcyA+PSBnbHlwaF9yb3ctPnVzZWRbVEVYVF9BUkVBXSkKKworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworICAgICAg LyogVGhpcyBtb2RpZmljYXRpb24gZW5hYmxlcyBwbGFjZW1lbnQgb2YgdGhlIGN1cnNvci1pbi1m cmluZ2UgYml0bWFwIHdoZW4KKyAgICAgIHRoZSB3aW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c29yX2luX2Zy aW5nZV9wKQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICAgIHsKICAgICAg ICAgICBnbHlwaF9yb3ctPmN1cnNvcl9pbl9mcmluZ2VfcCA9IDE7CiAgICAgICAgICAgZHJhd19m cmluZ2VfYml0bWFwICh3LCBnbHlwaF9yb3csIDApOwpAQCAtMzI1Miw4ICszMjg3LDQ4IEBAIE5v dGUgdGhhdCBDVVJTT1JfV0lEVEggaXMgbWVhbmluZ2Z1bCBvbmx5IGZvciAoaCliYXIgY3Vyc29y cy4KIAogCiAgIGZhY2UgPSBGQUNFX0ZST01fSURfT1JfTlVMTCAoZiwgcGh5c19jdXJzb3JfZ2x5 cGgtPmZhY2VfaWQpOwotICBpZiAoZmFjZSAmJiBOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpCi0g ICAgICA9PSBuc19pbmRleF9jb2xvciAoRlJBTUVfQ1VSU09SX0NPTE9SIChmKSwgZikpCisKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKy8qIEVY QU1QTEUgT0YgSE9XIFRPIExPT0stVVAgQSBDT0xPUjoKKyAgZW51bSBmYWNlX2lkIGZhY2VfaWQg PSBsb29rdXBfbmFtZWRfZmFjZSAoZiwgaW50ZXJuICgiKy12ZXJ0aWNhbC1iYXItZmFjZSIpLCB0 cnVlKTsKKyAgc3RydWN0IGZhY2UgKmZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGZhY2VfaWQpOwor ICBOU0NvbG9yICpjb2xvciA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVH Uk9VTkQgKGZhY2UpLCBmKTsKKyovCisKKyAgaWYgKEVRIChmbGF2b3IsIFFtY19nbHlwaCkKKyAg ICAgIHx8IEVRIChmbGF2b3IsIFFtY19nbHlwaGxlc3MpCisgICAgICB8fCBFUSAoZmxhdm9yLCBR bWNfZ2x5cGhfdGFiKSkKKyAgICB7CisgICAgICBMaXNwX09iamVjdCBidWYgPSB3LT5jb250ZW50 czsKKyAgICAgIENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgICAgIHN0cnVjdCBidWZmZXIgKmIgPSBY QlVGRkVSIChidWYpOworICAgICAgYm9vbCByZWdpb25fYWN0aXZlX3AgPSAoIU5JTFAgKFZ0cmFu c2llbnRfbWFya19tb2RlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAg KEJWQVIgKGIsIG1hcmtfYWN0aXZlKSkpOworICAgICAgcHRyZGlmZl90IHJlZ2lvbl9iZWdpbm5p bmcgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IFhJTlQgKEZyZWdpb25fYmVnaW5uaW5nICgpKSA6IC0x OworICAgICAgcHRyZGlmZl90IHJlZ2lvbl9lbmQgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IFhJTlQg KEZyZWdpb25fZW5kICgpKSA6IC0xOworICAgICAgYm9vbCByZWdpb25fcCA9IChyZWdpb25fYWN0 aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgUFQgPj0gcmVnaW9uX2JlZ2lubmluZwor ICAgICAgICAgICAgICAgICAgICAgICAmJiBQVCA8IHJlZ2lvbl9lbmQpOworICAgICAgZG91Ymxl IHJlZCA9IFhGTE9BVF9EQVRBIChBUkVGIChjb2xvcl92ZWN0b3IsIDApKTsKKyAgICAgIGRvdWJs ZSBncmVlbiA9IFhGTE9BVF9EQVRBIChBUkVGIChjb2xvcl92ZWN0b3IsIDEpKTsKKyAgICAgIGRv dWJsZSBibHVlID0gWEZMT0FUX0RBVEEgKEFSRUYgKGNvbG9yX3ZlY3RvciwgMikpOworICAgICAg W1tOU0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6IHJlZCBncmVlbjogZ3JlZW4gYmx1ZTog Ymx1ZSBhbHBoYTogMS4wXSBzZXRdOworICAgICAgaWYgKHJlZ2lvbl9wKQorICAgICAgICBob2xs b3dfY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5EIChm YWNlKSwgZik7CisgICAgICAgIGVsc2UgaWYgKGZhY2UgJiYgTlNfRkFDRV9CQUNLR1JPVU5EIChm YWNlKSA9PSBuc19pbmRleF9jb2xvciAoRlJBTUVfQ1VSU09SX0NPTE9SIChmKSwgZikpCisgICAg ICAgICAgaG9sbG93X2NvbG9yID0gRlJBTUVfQ1VSU09SX0NPTE9SIChmKTsKKyAgICAgIC8qIEZJ WE1FOiAgQWRkIGEgY29uZGl0aW9uIGZvciBgaG9sbG93X2NvbG9yYCBpZiB0aGUgcmVnaW9uIGZv cmVncm91bmQgaXMgdGhlCisgICAgICBzYW1lIGFzIHRoZSBkZWZhdWx0IGJhY2tncm91bmQgYW5k IGNob29zZSBhbiBhcHByb3ByaWF0ZSBjb2xvciBpZiBzby4gKi8KKyAgICB9CisgIGVsc2UgaWYg KGZhY2UgJiYgTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKQorICAgICAgICAgICA9PSBuc19pbmRl eF9jb2xvciAoRlJBTUVfQ1VSU09SX0NPTE9SIChmKSwgZikpCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworCisKICAgICB7CiAgICAgICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZB Q0VfRk9SRUdST1VORCAoZmFjZSksIGYpIHNldF07CiAgICAgICBob2xsb3dfY29sb3IgPSBGUkFN RV9DVVJTT1JfQ09MT1IgKGYpOwpAQCAtMzMwMCw5ICszMzc1LDE4IEBAIE5vdGUgdGhhdCBDVVJT T1JfV0lEVEggaXMgbWVhbmluZ2Z1bCBvbmx5IGZvciAoaCliYXIgY3Vyc29ycy4KICAgICB9CiAg IG5zX3VuZm9jdXMgKGYpOwogCi0gIC8qIGRyYXcgdGhlIGNoYXJhY3RlciB1bmRlciB0aGUgY3Vy c29yICovCi0gIGlmIChjdXJzb3JfdHlwZSAhPSBOT19DVVJTT1IpCi0gICAgZHJhd19waHlzX2N1 cnNvcl9nbHlwaCAodywgZ2x5cGhfcm93LCBEUkFXX0NVUlNPUik7CisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgICAvKiBkcmF3IHRoZSBjaGFy YWN0ZXIgdW5kZXIgdGhlIGN1cnNvciAqLworICBpZiAoY3Vyc29yX3R5cGUgIT0gTk9fQ1VSU09S CisgICAgICAmJiAhRVEgKGZsYXZvciwgUW1jX2dseXBobGVzcykKKyAgICAgICYmICFFUSAoZmxh dm9yLCBRbWNfZ2x5cGhfdGFiKSkKKyAgICAgZHJhd19waHlzX2N1cnNvcl9nbHlwaCAodywgZ2x5 cGhfcm93LCBEUkFXX0NVUlNPUik7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCiAKICNp ZmRlZiBOU19JTVBMX0NPQ09BCiAgIE5TRW5hYmxlU2NyZWVuVXBkYXRlcyAoKTsKZGlmZiAtLWdp dCBhL3NyYy93MzJ0ZXJtLmMgYi9zcmMvdzMydGVybS5jCmluZGV4IGZmMGQyYmYuLjEyOGI4ZDgg MTAwNjQ0Ci0tLSBhL3NyYy93MzJ0ZXJtLmMKKysrIGIvc3JjL3czMnRlcm0uYwpAQCAtNzA1LDEw ICs3MDUsMTQgQEAgeF91cGRhdGVfd2luZG93X2VuZCAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBj dXJzb3Jfb25fcCwKICAgICB7CiAgICAgICBibG9ja19pbnB1dCAoKTsKIAotICAgICAgaWYgKGN1 cnNvcl9vbl9wKQotCWRpc3BsYXlfYW5kX3NldF9jdXJzb3IgKHcsIHRydWUsCi0JCQkJdy0+b3V0 cHV0X2N1cnNvci5ocG9zLCB3LT5vdXRwdXRfY3Vyc29yLnZwb3MsCi0JCQkJdy0+b3V0cHV0X2N1 cnNvci54LCB3LT5vdXRwdXRfY3Vyc29yLnkpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworICAgICAgbWNfcG9ydGFsICh3LCBjdXJzb3Jfb25f cCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCiAKICAgICAgIGlmIChkcmF3X3dpbmRv d19mcmluZ2VzICh3LCB0cnVlKSkKIAl7CkBAIC05NzMsNyArOTc3LDEzIEBAIHN0YXRpYyB2b2lk IHczMl9kcmF3X2JveF9yZWN0IChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICosIGludCwgaW50LCBpbnQs IGludCwKIHN0YXRpYyB2b2lkCiB4X3NldF9jdXJzb3JfZ2MgKHN0cnVjdCBnbHlwaF9zdHJpbmcg KnMpCiB7Ci0gIGlmIChzLT5mb250ID09IEZSQU1FX0ZPTlQgKHMtPmYpCisKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgc3RydWN0IHdpbmRv dyAqdyA9IGRlY29kZV9saXZlX3dpbmRvdyAoc2VsZWN0ZWRfd2luZG93KTsKKyAgaWYgKChzLT5m b250ID09I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cmUgY2hvc2VuIHNvCiAJIHRoYXQgdGhlIGdseXBoIGlz IGxlZ2libGUuICAqLwotICAgICAgaWYgKGZhY2UtPmJhY2tncm91bmQgPT0gY3Vyc29yX2NvbG9y KQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLwor CisgICAgICBpZiAoZmFjZS0+YmFja2dyb3VuZCA9PSBjdXJzb3JfY29sb3IKKyAgICAgICAgICAm JiAhdy0+bWMuY3Vyc29yX2djX2ludmlzaWJsZV9va2F5KQorCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKworCiAJY3Vyc29yX2NvbG9yID0gZmFjZS0+Zm9yZWdyb3VuZDsKIAogICAgICAgeCA9 IFdJTkRPV19URVhUX1RPX0ZSQU1FX1BJWEVMX1ggKHcsIHctPnBoeXNfY3Vyc29yLngpOwpAQCAt NTgzMCw3ICs1ODU1LDE3IEBAIHczMl9jbGVhcl9mcmFtZV9hcmVhIChzdHJ1Y3QgZnJhbWUgKmYs IGludCB4LCBpbnQgeSwgaW50IHdpZHRoLCBpbnQgaGVpZ2h0KQogc3RhdGljIHZvaWQKIHczMl9k cmF3X3dpbmRvd19jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKmds eXBoX3JvdywKIAkJCWludCB4LCBpbnQgeSwgZW51bSB0ZXh0X2N1cnNvcl9raW5kcyBjdXJzb3Jf dHlwZSwKLQkJCWludCBjdXJzb3Jfd2lkdGgsIGJvb2wgb25fcCwgYm9vbCBhY3RpdmVfcCkKKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworICBp bnQgY3Vyc29yX3dpZHRoLCBib29sIG9uX3AsIGJvb2wgYWN0aXZlX3AsCisgIExpc3BfT2JqZWN0 IGNvbG9yX3ZlY3RvciwgTGlzcF9PYmplY3QgZmxhdm9yKQorCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKworCiB7CiAgIGlmIChvbl9wKQogICAgIHsKQEAgLTU4OTUsMzEgKzU5MzAsMTE4IEBA IHczMl9kcmF3X3dpbmRvd19jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9y b3cgKmdseXBoX3JvdywKIAkgIHJldHVybjsKIAl9CiAKLSAgICAgIHN3aXRjaCAoY3Vyc29yX3R5 cGUpCi0JewotCWNhc2UgSE9MTE9XX0JPWF9DVVJTT1I6Ci0JICB4X2RyYXdfaG9sbG93X2N1cnNv ciAodywgZ2x5cGhfcm93KTsKLQkgIGJyZWFrOwotCi0JY2FzZSBGSUxMRURfQk9YX0NVUlNPUjoK LQkgIGRyYXdfcGh5c19jdXJzb3JfZ2x5cGggKHcsIGdseXBoX3JvdywgRFJBV19DVVJTT1IpOwot CSAgYnJlYWs7CiAKLQljYXNlIEJBUl9DVVJTT1I6Ci0JICB4X2RyYXdfYmFyX2N1cnNvciAodywg Z2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEJBUl9DVVJTT1IpOwotCSAgYnJlYWs7CisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExFIENVUlNPUlMgKi8KIAotCWNhc2Ug SEJBUl9DVVJTT1I6Ci0JICB4X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cGhfcm93LCBjdXJzb3Jf d2lkdGgsIEhCQVJfQ1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F0YS53MzItPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAg ICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIGdseXBo X3JvdywgY3Vyc29yX3dpZHRoLCBCQVJfQ1VSU09SKTsKKyAgICAgIGJyZWFrOworICAgIH0KKyAg ICBjYXNlIEhCQVJfQ1VSU09SOgorICAgIHsKKyAgICAgIGlmIChyZWQgPj0gMCAmJiBibHVlID49 IDAgJiYgZ3JlZW4gPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhp amFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgICBm LT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAg IHctPm1jLmN1cnNvcl9nY19pbnZpc2libGVfb2theSA9IHRydWU7CisgICAgICAgICAgeF9kcmF3 X2Jhcl9jdXJzb3IgKHcsIGdseXBoX3JvdywgY3Vyc29yX3dpZHRoLCBIQkFSX0NVUlNPUik7Cisg ICAgICAgICAgdy0+bWMuY3Vyc29yX2djX2ludmlzaWJsZV9va2F5ID0gZmFsc2U7CisgICAgICAg ICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4 ZWw7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIHhfZHJhd19iYXJfY3Vyc29y ICh3LCBnbHlwaF9yb3csIGN1cnNvcl93aWR0aCwgSEJBUl9DVVJTT1IpOworICAgICAgYnJlYWs7 CisgICAgfQorICAgIGNhc2UgTk9fQ1VSU09SOgorICAgICAgdy0+cGh5c19jdXJzb3Jfd2lkdGgg PSAwOworICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOwor ICB9CisvKiBlbmQgTVVMVElQTEUgQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CiAKLQljYXNlIE5PX0NVUlNPUjoKLQkgIHctPnBoeXNfY3Vyc29yX3dpZHRoID0gMDsKLQkgIGJy ZWFrOwogCi0JZGVmYXVsdDoKLQkgIGVtYWNzX2Fib3J0ICgpOwotCX0KICAgICB9CiB9CiAKZGlm ZiAtLWdpdCBhL3NyYy93aW5kb3cuYyBiL3NyYy93aW5kb3cuYwppbmRleCA0MjJiMDZhLi42ZjNl NTlkIDEwMDY0NAotLS0gYS9zcmMvd2luZG93LmMKKysrIGIvc3JjL3dpbmRvdy5jCkBAIC02ODEw LDYgKzY4MTAsMjkgQEAgZ2V0X3BoeXNfY3Vyc29yX2dseXBoIChzdHJ1Y3Qgd2luZG93ICp3KQog ICBzdHJ1Y3QgZ2x5cGggKmdseXBoOwogICBpbnQgaHBvcyA9IHctPnBoeXNfY3Vyc29yLmhwb3M7 CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisK Ky8qIFRoaXMgbW9kaWZpY2F0aW9uIGVuYWJsZXMgcGxhY2VtZW50IG9mIHRoZSBjdXJzb3ItaW4t ZnJpbmdlIGJpdG1hcCB3aGVuCit0aGUgd2luZG93LXdpZHRoIGlzIHNsaWdodGx5IGxlc3MgdGhh biBgZ2x5cGhfcm93LT5leGFjdF93aW5kb3dfd2lkdGhfbGluZV9wYC4KK1RoaXMgbW9kaWZpY2F0 aW9uIGFsc28gcHJldmVudHMgZHJhd2luZyB0aGUgcmVhbCBjdXJzb3Igb24gdGhlIGZyaW5nZSAo aW5zdGVhZAorb2YgdXNpbmcgdGhlIGN1cnN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tZS4gIFRoZSBkZWZhdWx0IGJlaGF2aW9yIGRpc2FsbG93cyBhbiBp bnZpc2libGUgcmVzdWx0LiAqLworICBib29sX2JmIGN1cnNvcl9nY19pbnZpc2libGVfb2theSA6 IDE7CisKKyAgLyogVHJ1ZSBtZWFucyBgbWNfY2FsYycgaGFzIG5vdCBydW4geWV0IGRyYXduIGds eXBoIGZha2UgY3Vyc29ycy4gKi8KKyAgYm9vbF9iZiBkcmF3X2dseXBoX2N1cnNvciA6IDE7CisK KyAgLyogVHJ1ZSBtZWFucyBgbWNfY2FsYycgaGFzIG5vdCBydW4geWV0IGVyYXNlZCBnbHlwaCBm YWtlIGN1cnNvcnMuICovCisgIGJvb2xfYmYgZXJhc2VfZ2x5cGhfY3Vyc29yIDogMTsKKworICAv KiBUcnVlIG1lYW5zIGNyb3NzaGFpcnMgaGF2ZSBub3QgeWV0IGJlZW4gZHJhd24uICovCisgIGJv b2xfYmYgZHJhd19jcm9zc2hhaXJzIDogMTsKKworICAvKiBUcnVlIG1lYW5zIGNyb3NzaGFpcnMg aGF2ZSBub3QgeWV0IGJlZW4gZXJhc2VkLiAqLworICBib29sX2JmIGVyYXNlX2Nyb3NzaGFpcnMg OiAxOworfTsKKworLyogZW5kIE1VTFRJUExFIENVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworCisKIHN0cnVjdCBjdXJzb3JfcG9zCiB7CiAgIC8qIFBpeGVsIHBvc2l0aW9uLiAg VGhlc2UgYXJlIGFsd2F5cyB3aW5kb3cgcmVsYXRpdmUuICAqLwpAQCAtMTgxLDYgKzIxNiwyMiBA QCBzdHJ1Y3Qgd2luZG93CiAgICAgLyogVGhlIGhlbHAgZWNobyB0ZXh0IGZvciB0aGlzIHdpbmRv dy4gIFFuaWwgaWYgdGhlcmUncyBub25lLiAgKi8KICAgICBMaXNwX09iamVjdCBtb2RlX2xpbmVf aGVscF9lY2hvOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VS U09SUyAqLworCisgICAgLyogVGhlIGNhY2hlIGZvciBtdWx0aXBsZSBnbHlwaCBjdXJzb3JzLiAg Rm9yIGFuIGV4YW1wbGUgb2YgdGhlIHN0cnVjdHVyZSBvZgorICAgIHRoZSBsaXN0LCBzZWUgdGhl IGNvbW1lbnRzIGF0IHRoZSBiZWdpbm5pbmcgb2YgYG1jX2NhbGMnIGluIHhkaXNwLmMuICAqLwor ICAgIExpc3BfT2JqZWN0IG1jX2dseXBoX2NhY2hlOworCisgICAgLyogVGhlIGNhY2hlIGZvciBt dWx0aXBsZSBnbHlwaC9nbHlwaGxlc3MgY3Vyc29ycyB0aGF0IGZvcm0gY3Jvc3NoYWlycy4gIEZv ciBhbgorICAgIGV4YW1wbGUgb2YgdGhlIHN0cnVjdHVyZSBvZiB0aGUgbGlzdCwgc2VlIHRoZSBj b21tZW50cyBhdCB0aGUgYmVnaW5uaW5nIG9mCisgICAgYG1jX2Nyb3NzaGFpcnMnIGluIHhkaXNw LmMuICAqLworICAgIExpc3BfT2JqZWN0IGNyb3NzaGFpcnNfY2FjaGU7CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKICAgICAvKiBObyBMaXNwIGRhdGEgbWF5IGZvbGxvdyBiZWxvdyB0 aGlzIHBvaW50IHdpdGhvdXQgY2hhbmdpbmcKICAgICAgICBtYXJrX29iamVjdCBpbiBhbGxvYy5j LiAgVGhlIG1lbWJlciBjdXJyZW50X21hdHJpeCBtdXN0IGJlIHRoZQogICAgICAgIGZpcnN0IG5v bi1MaXNwIG1lbWJlci4gICovCkBAIC0yODMsNiArMzM0LDE2IEBAIHN0cnVjdCB3aW5kb3cKIAog I2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgICAgLyogVGhlIHByZWZpeCBmb3Igd2luZG93IHBv aW50ZXJzIHJlbGF0aW5nIHRvIG11bHRpcGxlIGN1cnNvcnMuICAqLworICAgIHN0cnVjdCBtdWx0 aXBsZV9jdXJzb3JzIG1jOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgLyog Q3Vyc29yIHR5cGUgb2YgbGFzdCBjdXJzb3IgZHJhd24gb24gdGhlIHdpbmRvdy4gICovCiAgICAg ZW51bSB0ZXh0X2N1cnNvcl9raW5kcyBwaHlzX2N1cnNvcl90eXBlOwogCkBAIC00MjEsNiArNDgy LDI1IEBAIFhXSU5ET1cgKExpc3BfT2JqZWN0IGEpCiAgIHJldHVybiBYVU5UQUcgKGEsIExpc3Bf VmVjdG9ybGlrZSwgc3RydWN0IHdpbmRvdyk7CiB9CiAKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKK0lOTElORSB2b2lkCit3c2V0X21jX2dseXBo X2NhY2hlIChzdHJ1Y3Qgd2luZG93ICp3LCBMaXNwX09iamVjdCB2YWwpCit7CisgIHctPm1jX2ds eXBoX2NhY2hlID0gdmFsOworfQorCitJTkxJTkUgdm9pZAord3NldF9jcm9zc2hhaXJzX2NhY2hl IChzdHJ1Y3Qgd2luZG93ICp3LCBMaXNwX09iamVjdCB2YWwpCit7CisgIHctPmNyb3NzaGFpcnNf Y2FjaGUgPSB2YWw7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isKK0xhc3QgQ29tbWl0 IDogU2F0IEp1bCA3IDA5OjU5OjUzIDIwMTggLTA3MDAKKyAgICAgICAgICAgIDogR2xlbm4gTW9y cmlzIDxyZ21AZ251Lm9yZz4KKyAgICAgICAgICAgIDogOTg0NjNiZWQwN2VjYzkwNTcwOTQ5Mjhm ZmRjMjMyMWVhYWYzYWI1MgorICAgICAgICAgICAgOiAqIGxpc3AvaW1lbnUuZWw6IFJlcXVpcmUg Y2wtbGliLCBub3QgaW50ZXJuYWwgY29tcG9uZW50cyBvZiBzYW1lLgorCitFWEFNUExFICMxOiAg KHNldHEgbWMtZ2x5cGgtbGlzdCAnKCgxICJoYmFyIiAibWFnZW50YSIpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICgyICJiYXIiICJwdXJwbGUiKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAoMyAiYm94IiAiIzAwRkYwMCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICg0ICJob2xsb3ciICIjMDAwMEZGIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDUg KCJoYmFyIiAzKSBbMS4wIDAuMCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo NiAoImJhciIgMykgWzAuMCAxLjAgMS4wXSkpKQorCitFWEFNUExFICMyOiAgKHNldHEgbWMtZ2x5 cGgtbGlzdCBuaWwpCisKK1RPRE86CisKKy0gIEZvbGxvdyB1cCB3aXRoIHRoZSBFbWFjcyB0ZWFt IHJlIGJ1ZyMzMjE3NzsgaS5lLiwKKyAgIChDdXJyZW50IGxpbmUgbnVtYmVyIHNoaWZ0cyBvbmUg Y29sdW1uIHRvIHRoZSBsZWZ0LikKKworLSAgRm9sbG93IHVwIHdpdGggdGhlIEVtYWNzIHRlYW0g cmUgYnVnIzMyMDYwOyBpLmUuLAorICAgKEhvcml6b250YWwgU2Nyb2xsaW5nIChDdXJyZW50IExp bmUpOiAgV3JvbmcgbGluZSBnZXRzIGgtc2Nyb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gICAoc2V0cS1sb2NhbCBh dXRvLWhzY3JvbGwtbW9kZSAnY3VycmVudC1saW5lKQorCistICAoZnVuZGFtZW50YWwtbW9kZSkK KyAgIChzZXRxIGRpc3BsYXktbGluZS1udW1iZXJzIHQpCisgICAoc2V0cSBidWZmZXItZGlzcGxh eS10YWJsZSAobWFrZS1kaXNwbGF5LXRhYmxlKSkKKyAgIChhc2V0IGJ1ZmZlci1kaXNwbGF5LXRh YmxlCisgICAgICAgICA/XHQKKyAgICAgICAgICh2ZWN0b3IgKG1ha2UtZ2x5cGgtY29kZSA/XHUw MEJCICdmb250LWxvY2std2FybmluZy1mYWNlKQorICAgICAgICAgICAgICAgICAobWFrZS1nbHlw aC1jb2RlID9cdCAnaGlnaGxpZ2h0KSkpCisgICAoYXNldCBidWZmZXItZGlzcGxheS10YWJsZQor ICAgICAgICAgP1xuCisgICAgICAgICAodmVjdG9yIChtYWtlLWdseXBoLWNvZGUgP1x1MDBCNiAn Zm9udC1sb2NrLWNvbW1lbnQtZmFjZSkKKyAgICAgICAgICAgICAgICAgP1xuKSkKKyAgIChzZXRx IHRhYi13aWR0aCA4KQorICAgKHNldHEtbG9jYWwgYXV0by1oc2Nyb2xsLW1vZGUgJ2N1cnJlbnQt bGluZSkKKworLSAgTm8gTGluZSBOdW1iZXJzCisKK0xFR0VORAorCitmcHJpbnRmIChzdGRlcnIs ICJNeSBsaXNwIG9iamVjdDogICVzXG4iLCBTU0RBVEEgKEZjaGFyX3RvX3N0cmluZyAobWFrZV9u dW1iZXIgKDEwMSkpKSk7CisKK2ZwcmludGYgKHN0ZGVyciwgInN0cmluZzogJXMgfCBpbnQ6ICVk XG4iLCBTU0RBVEEgKGJ1aWxkX3N0cmluZyAoImZvbyIpKSwgNjkpOworCitpZiAoQlVGRkVSUCAo dy0+Y29udGVudHMpICYmIFNUUklOR1AgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbmFt ZSkpKQorICBmcHJpbnRmIChzdGRlcnIsICJ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cnJvdy1iaXRtYXApCisgICAgID0+ICcrLW92ZXJsYXktYXJyb3ctYml0bWFwCisgICAg ID0+IFFtY19zbWlsZXlfZmFjZSAqLworICAvKiBMaXNwX09iamVjdCB2YWwgPSBGZ2V0IChpbnRl cm4gKCIrLWxlZnQtZnJpbmdlLW92ZXJsYXktcG9zaXRpb24iKSwgUW92ZXJsYXlfYXJyb3dfYml0 bWFwKTsgKi8KKyAgTGlzcF9PYmplY3QgbWFya2VyID0gZmluZF9zeW1ib2xfdmFsdWUgKGludGVy biAoIm92ZXJsYXktYXJyb3ctcG9zaXRpb24iKSk7CisgIGludCBmcmluZ2VfYml0bWFwID0gTk9f RlJJTkdFX0JJVE1BUDsKKyAgaW50IGZhY2VfaWQgPSBERUZBVUxUX0ZBQ0VfSUQ7CisgIGlmIChF USAoZmxhdm9yLCBRb3ZlcmxheV9hcnJvd19iaXRtYXApKQorICAgIHsKKyAgICAgIExpc3BfT2Jq ZWN0IHZsaXN0OworICAgICAgZm9yICh2bGlzdCA9IFZvdmVybGF5X2Fycm93X3ZhcmlhYmxlX2xp c3Q7CisgICAgICAgICAgIENPTlNQICh2bGlzdCk7CisgICAgICAgICAgIHZsaXN0ID0gWENEUiAo dmxpc3QpKQorICAgICAgICB7CisgICAgICAgICAgTGlzcF9PYmplY3QgdmFyID0gWENBUiAodmxp c3QpOworICAgICAgICAgIExpc3BfT2JqZWN0IHZhbDsKKyAgICAgICAgICBpZiAoIVNZTUJPTFAg KHZhcikpCisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICB2YWwgPSBmaW5kX3N5bWJv bF92YWx1ZSAodmFyKTsKKyAgICAgICAgICBpZiAodmFsID0gRmdldCAodmFyLCBRb3ZlcmxheV9h cnJvd19iaXRtYXApLCBTWU1CT0xQICh2YWwpKQorICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9 IGxvb2t1cF9mcmluZ2VfYml0bWFwICh2YWwpOworICAgICAgICB9CisgICAgICBnbHlwaF9yb3ct Pm92ZXJsYXlfYXJyb3dfYml0bWFwID0gKGN1cnNvcl90eXBlICE9IE5PX0NVUlNPUikKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGZyaW5nZV9iaXRtYXAgLyogbG9v a3VwX2ZyaW5nZV9iaXRtYXAgKGZsYXZvcikgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IE5PX0ZSSU5HRV9CSVRNQVA7CisgICAgICBkcmF3X2ZyaW5nZV9iaXRt YXAgKHcsIGdseXBoX3JvdywgdHJ1ZSk7CisgICAgICAvKiBvcHRpbWl6YXRpb24gMzogIERSQVcg dGhlIGBvdmVybGF5LWFycm93LWJpdG1hcCcgaWYgdGhlcmUgaXMgYSBtYXJrZXIuICovCisgICAg ICBpZiAoTUFSS0VSUCAobWFya2VyKQorICAgICAgICAgICYmIFhNQVJLRVIgKG1hcmtlciktPmJ1 ZmZlcgorICAgICAgICAgICYmIEJVRkZFUl9MSVZFX1AgKFhNQVJLRVIgKG1hcmtlciktPmJ1ZmZl cikpCisgICAgICAgIHsKKyAgICAgICAgICBnbHlwaF9yb3ctPm92ZXJsYXlfYXJyb3dfYml0bWFw ID0gZnJpbmdlX2JpdG1hcDsKKyAgICAgICAgICBkcmF3X2ZyaW5nZV9iaXRtYXAgKHcsIGdseXBo X3JvdywgdHJ1ZSk7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZiAoRVEgKGZsYXZvciwg UW1jX2hvbGxvd19yZWN0YW5nbGVfcmlnaHRfYW5nbGUpCisgICAgICAgICAgICAgfHwgRVEgKGZs YXZvciwgUW1jX2hvbGxvd19yZWN0YW5nbGUpCisgICAgICAgICAgICAgfHwgRVEgKGZsYXZvciwg UW1jX3ZlcnRpY2FsX2Jhcl9yaWdodF9hbmdsZSkKKyAgICAgICAgICAgICB8fCBFUSAoZmxhdm9y LCBRbWNfdmVydGljYWxfYmFyKQorICAgICAgICAgICAgIHx8IEVRIChmb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SBMaXNwX1N5bWJvbCkK KyAgICBzdHIgPSBTU0RBVEEgKFNZTUJPTF9OQU1FIChhcmcpKTsKKyAgZWxzZSByZXR1cm4gLTE7 CisgIGlmICghc3RyY21wIChzdHIsICJib3giKSkKKyAgICByZXR1cm4gRklMTEVEX0JPWF9DVVJT T1I7CisgIGlmICghc3RyY21wIChzdHIsICJob2xsb3ciKSkKKyAgICByZXR1cm4gSE9MTE9XX0JP WF9DVVJTT1I7CisgIGlmICghc3RyY21wIChzdHIsICJoYmFyIikpCisgICAgcmV0dXJuIEhCQVJf Q1VSU09SOworICBpZiAoIXN0cmNtcCAoc3RyLCAiYmFyIikpCisgICAgcmV0dXJuIEJBUl9DVVJT T1I7CisgIGlmICghc3RyY21wIChzdHIsICJubyIpKQorICAgIHJldHVybiBOT19DVVJTT1I7Cisg IHJldHVybiAtMTsKK30KKworc3RhdGljIExpc3BfT2JqZWN0CittY19jdXJzb3JfdHlwZV90b19s aXNwIChpbnQgYXJnKQoreworICBzd2l0Y2ggKGFyZykKKyAgICB7CisgICAgY2FzZSBGSUxMRURf Qk9YX0NVUlNPUjogcmV0dXJuIFFib3g7CisgICAgY2FzZSBIT0xMT1dfQk9YX0NVUlNPUjogcmV0 dXJuIFFob2xsb3c7CisgICAgY2FzZSBIQkFSX0NVUlNPUjogcmV0dXJuIFFoYmFyOworICAgIGNh c2UgQkFSX0NVUlNPUjogcmV0dXJuIFFiYXI7CisgICAgY2FzZSBOT19DVVJTT1I6CisgICAgZGVm YXVsdDogcmV0dXJuIGludGVybiAoIm5vIik7CisgICAgfQorfQorCitzdGF0aWMgTGlzcF9PYmpl Y3QKK21jX2NvbG9yX3ZlY3Rvcl9jYWxjIChzdHJ1Y3Qgd2luZG93ICp3LCBMaXNwX09iamVjdCBj b2xvcikKK3sKKyAgQ0hFQ0tfU1RSSU5HIChjb2xvcik7CisgIExpc3BfT2JqZWN0IHRhcmdldF9m cmFtZSA9IHctPmZyYW1lOworICBMaXNwX09iamVjdCBjb2x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yb2xsICglZClcblwKKyAgICBoc2NsX3RlbXBvcmFyeSAoJXMpXG5cCisg ICAgaHNjbF9wZXJtYW5lbnQgKCVzKVxuXAorICAgIGl0LT5ocG9zICglZClcblwKKyAgICBpdC0+ dnBvcyAoJWQpXG5cCisgICAgaXQtPmN1cnJlbnRfeCAoJWQpXG5cCisgICAgbmV3X3ggKCVkKVxu XAorICAgIGZvbnQtPnNwYWNlX3dpZHRoICglZClcblwKKyAgICBpdC0+bG51bV9waXhlbF93aWR0 aCAoJWQpXG5cCisgICAgaXQtPmxudW1fd2lkdGggKCVkKVxuXAorICAgIGl0LT5maXJzdF92aXNp YmxlX3ggKCVkKVxuXAorICAgIGl0LT5sYXN0X3Zpc2libGVfeCAoJWQpXG5cCisgICAgcmVsYXRp dmVfeCAoJWQpXG5cCisgICAgaXQtPmZhY2VfaWQgKCVkKVxuXAorICAgIGZvcmVncm91bmRfZmFj ZSAoJXMpXG5cCisgICAgYmFja2dyb3VuZF9mYWNlICglcylcblwKKyAgICBwcmV2aW91cyBjaGFy YWN0ZXIgKCVzKVxuXAorICAgIHByZXZpb3VzX2hwb3MgKCVkKVxuXAorICAgIGlzc3VlXzMxNzE2 X3AgKCVzKVxuXAorICAgIGZpbmFsX2xvb3BfcCAoJXMpXG5cCisgICAgbHB3X3JlYWNoZWRfcCAo JXMpXG5cCisgICAgZ3JlZW5fbGlnaHRfcCAoJXMpXG5cCisgICAgYWR2YW5jZV9ocG9zX3AgKCVz KVxuXAorICAgIHJjICglcylcbiIsCisgICAgICBjb3VudCwKKyAgICAgIChpdC0+YyA9PSAwCisg ICAgICAgID8gIk5PVEhJTkciCisgICAgICAgIDogaXQtPmMgPT0gMTg3CisgICAgICAgICAgPyAi VEFCIENIQVJBQ1RFUiIKKyAgICAgICAgOiBpdC0+YyA9PSAnXHQnCisgICAgICAgICAgPyAiVEFC IFNUUkVUQ0giCisgICAgICAgIDogIlRFWFQiKSwKKyAgICAgIChyZWxhdGl2ZV94ID09IGl0LT5s bnVtX3BpeGVsX3dpZHRoCisgICAgICAgID8gIiAtLSBUSEUgRlVOIFNUQVJUUyBIRVJFIgorICAg ICAgICA6ICIiKSwKKyAgICAgIChhY3Rpb25fdHlwZSA9PSBNVUxUSVBMRV9DVVJTT1JTCisgICAg ICAgPyAiTVVMVElQTEVfQ1VSU09SUyIKKyAgICAgICA6IGFjdGlvbl90eXBlID09IEhPUklaT05U QUxfUlVMRVIKKyAgICAgICAgID8gIkhPUklaT05UQUxfUlVMRVIiCisgICAgICAgOiBhY3Rpb25f dHlwZSA9PSBWRVJUSUNBTF9SVUxFUgorICAgICAgICAgPyAiVkVSVElDQUxfUlVMRVIiCisgICAg ICAgOiAiT09QUyIpLAorICAgICAgaXQtPmMsCisgICAgICBGRVRDSF9CWVRFIChJVF9CWVRFUE9T ICgqaXQpKSwKKyAgICAgICghTklMUCAoRmNoYXJfdG9fc3RyaW5nIChtYWtlX251bWJlciAoaXQt PmMpKSkKKyAgICAgICAgPyBTU0RBVEEgKEZjaGFyX3RvX3N0cmluZyAobWFrZV9udW1iZXIgKGl0 LT5jKSkpCisgICAgICAgIDogIk5JTFAgLS0gaXQtPmMgYXMgYSBzdHJpbmciKSwKKyAgICAgIGl0 X2NoYXJwb3MsCisgICAgICAvKiBXaGVuIGBpdC0+dy0+aHNjcm9sbGAgaXMgc2V0IHRvIGFuIGBp bnRgLCBnZGIgcmVwb3J0cyB0aGUgdmFsdWUKKyAgICAgIGFzIGJlaW5nOiAgPHZhcmlhYmxlIG9w dGltaXplZCBhd2F5IGJ5IGNvbXBpbGVyPiAqLworICAgICAgd19oc2Nyb2xsLAorICAgICAgd19t aW5faHNjcm9sbCwKKyAgICAgIChoc2NsX3RlbXBvcmFyeSA/ICJ0cnVlIiA6ICJmYWxzZSIpLAor ICAgICAgKGhzY2xfcGVybWFuZW50ID8gInRydWUiIDogImZhbHNlIiksCisgICAgICBpdC0+aHBv cywKKyAgICAgIGl0LT52cG9zLAorICAgICAgaXQtPmN1cnJlbnRfeCwKKyAgICAgIG5ld194LAor ICAgICAgLyogQ2Fubm90IGFjY2VzcyBtZW1vcnkgYXQgYWRkcmVzcyAweGEwLiAgVGhpcyBjYW1l IGFib3V0IGJ5IHVzaW5nCisgICAgICBgP1xVMDAwMUQ0RDVgIHRvIGNyZWF0ZSBhIGZhbmN5IGZv cm0gZmVlZCBjaGFyYWN0ZXIgdGhhdCB3YXMgbm90CisgICAgICByZWNvZ25pemVkIGJ5IHRoZSBm b250IGNob3NlbiBvbiBYMTEuICovCisgICAgICAoZm9udCA9PSBOVUxMCisgICAgICAgPyAwCisg ICAgICAgOiBmb250LT5zcGFjZV93aWR0aCksCisgICAgICBpdC0+bG51bV9waXhlbF93aWR0aCwK KyAgICAgIGl0LT5sbnVtX3dpZHRoLAorICAgICAgaXQtPmZpcnN0X3Zpc2libGVfeCwKKyAgICAg IGl0LT5sYXN0X3Zpc2libGVfeCwKKyAgICAgIHJlbGF0aXZlX3gsCisgICAgICBpdC0+ZmFjZV9p ZCwKKyAgICAgICghTklMUCAoZm9yZWdyb3VuZF9mYWNlKQorICAgICAgICA/IFNTREFUQSAoZm9y ZWdyb3VuZF9mYWNlKQorICAgICAgICA6ICJOSUxQIGZvcmVncm91bmRfZmFjZSIpLAorICAgICAg KCFOSUxQIChiYWNrZ3JvdW5kX2ZhY2UpCisgICAgICAgID8gU1NEQVRBIChiYWNrZ3JvdW5kX2Zh Y2UpCisgICAgICAgIDogIk5JTFAgYmFja2dyb3VuZF9mYWNlIiksCisgICAgICAoIU5JTFAgKEZj aGFyX3RvX3N0cmluZyAobWFrZV9udW1iZXIgKHByZXZpb3VzX2NoYXJhY3RlcikpKQorICAgICAg ICA/IFNTREFUQSAoRmNoYXJfdG9fc3RyaW5nIChtYWtlX251bWJlciAocHJldmlvdXNfY2hhcmFj dGVyKSkpCisgICAgICAgIDogIk5JTFAgLS0gcHJldmlvdXNfY2hhcmFjdGVyIGFzIGEgc3RyaW5n IiksCisgICAgICBwcmV2aW91c19ocG9zLAorICAgICAgKGlzc3VlXzMxNzE2X3AgPyAidHJ1ZSIg OiAiZmFsc2UiKSwKKyAgICAgIChmaW5hbF9sb29wX3AgPyAidHJ1ZSIgOiAiZmFsc2UiKSwKKyAg ICAgIChscHdfcmVhY2hlZF9wID8gInRydWUiIDogImZhbHNlIiksCisgICAgICAoZ3JlZW5fbGln aHRfcCA/ICJ0cnVlIiA6ICJmYWxzZSIpLAorICAgICAgKGFkdmFuY2VfaHBvc19wID8gInRydWUi IDogImZhbHNlIiksCisgICAgICAocmMgPT0gTU9WRV9VTkRFRklORUQKKyAgICAgICAgPyAiTU9W RV9VTkRFRklORUQiCisgICAgICAgIDogcmMgPT0gTU9WRV9QT1NfTUFUQ0hfT1JfWlYKKyAgICAg ICAgICA/ICJNT1ZFX1BPU19NQVRDSF9PUl9aViIKKyAgICAgICAgOiByYyA9PSBNT1ZFX1hfUkVB Q0hFRAorICAgICAgICAgID8gIk1PVkVfWF9SRUFDSEVEIgorICAgICAgICA6IHJjID09IE1PVkVf TElORV9DT05USU5VRUQKKyAgICAgICAgICA/ICJNT1ZFX0xJTkVfQ09OVElOVUVEIgorICAgICAg ICA6IHJjID09IE1PVkVfTElORV9UUlVOQ0FURUQKKyAgICAgICAgICA/ICJNT1ZFX0xJTkVfVFJV TkNBVEVEIgorICAgICAgICA6IHJjID09IE1PVkVfTkVXTElORV9PUl9DUgorICAgICAgICAgID8g Ik1PVkVfTkVXTElORV9PUl9DUiIKKyAgICAgICAgOiAiT09QUyIpKTsKK30KKworc3RhdGljIHZv aWQKK21jX2Nyb3NzaGFpcnNfaGVscGVyIChzdHJ1Y3Qgd2luZG93ICp3LCBwdHJkaWZmX3QgeCwg cHRyZGlmZl90IHksIHB0cmRpZmZfdCBocG9zLAorICAgICAgICAgICAgICAgICAgICAgIHB0cmRp ZmZfdCB2cG9zLCBlbnVtIHRleHRfY3Vyc29yX2tpbmRzIHR5cGUsIGludCB3aWR0aCwKKyAgICAg ICAgICAgICAgICAgICAgICBMaXNwX09iamVjdCBmb3JlZ3JvdW5kLCBMaXNwX09iamVjdCBiYWNr Z3JvdW5kLAorICAgICAgICAgICAgICAgICAgICAgIExpc3BfT2JqZWN0IGZsYXZvciwgcHRyZGlm Zl90IHBvcywgTGlzcF9PYmplY3QgKnJlc3VsdCkKK3sKKyAgTGlzcF9PYmplY3QgdGVtcDsKKyAg bWNfZHJhd19lcmFzZV9oeWJyaWQgKHcsIHgsIHksIGhwb3MsIHZwb3MsIHR5cGUsIHdpZHRoLCBm b3JlZ3JvdW5kLCBmbGF2b3IpOworICB0ZW1wID0gbGlzdG4gKENPTlNUWVBFX0hFQVAsIDEwLAor ICAgICAgICAgICAgICAgIG1ha2VfbnVtYmVyICh4KSwKKyAgICAgICAgICAgICAgICBtYWtlX251 bWJlciAoeSksCisgICAgICAgICAgICAgICAgbWFrZV9udW1iZXIgKGhwb3MpLAorICAgICAgICAg ICAgICAgIG1ha2VfbnVtYmVyICh2cG9zKSwKKyAgICAgICAgICAgICAgICBtY19jdXJzb3JfdHlw ZV90b19saXNwICh0eXBlKSwKKyAgICAgICAgICAgICAgICBtYWtlX251bWJlciAod2lkdGgpLAor ICAgICAgICAgICAgICAgIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgYmFja2dyb3VuZCwK KyAgICAgICAgICAgICAgICBmbGF2b3IsCisgICAgICAgICAgICAgICAgbWFrZV9udW1iZXIgKHBv cykpOworICAqcmVzdWx0ID0gRmNvbnMgKHRlbXAsICpyZXN1bHQpOworfQorCitzdGF0aWMgdm9p ZAorbWNfY2FsY19oZWxwZXIgKHN0cnVjdCB3aW5kb3cgKncsIHB0cmRpZmZfdCB4LCBwdHJkaWZm X3QgeSwgcHRyZGlmZl90IGhwb3MsCisgICAgICAgICAgICAgICAgcHRyZGlmZl90IHZwb3MsIGVu dW0gdGV4dF9jdXJzb3Jfa2luZHMgdHlwZSwgaW50IHdpZHRoLAorICAgICAgICAgICAgICAgIExp c3BfT2JqZWN0IGZvcmVncm91bmQsIExpc3BfT2JqZWN0IGJhY2tncm91bmQsIExpc3BfT2JqZWN0 IGZsYXZvciwKKyAgICAgICAgICAgICAgICBwdHJkaWZmX3QgcG9zLCBMaXNwX09iamVjdCBzcGVj cywgTGlzcF9PYmplY3QgKnJlc3VsdCkKK3sKKyAgTGlzcF9PYmplY3QgdGVuX2VsZW1lbnRzOwor ICBMaXNwX09iamVjdCB0ZW1wOworICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgeCwgeSwgaHBv cywgdnBvcywgdHlwZSwgd2lkdGgsIGZvcmVncm91bmQsIGZsYXZvcik7CisgIHRlbl9lbGVtZW50 cyA9IGxpc3RuIChDT05TVFlQRV9IRUFQLCAxMCwKKyAgICAgICAgICAgICAgICAgICAgICAgIG1h a2VfbnVtYmVyICh4KSwKKyAgICAgICAgICAgICAgICAgICAgICAgIG1ha2VfbnVtYmVyICh5KSwK KyAgICAgICAgICAgICAgICAgICAgICAgIG1ha2VfbnVtYmVyIChocG9zKSwKKyAgICAgICAgICAg ICAgICAgICAgICAgIG1ha2VfbnVtYmVyICh2cG9zKSwKKyAgICAgICAgICAgICAgICAgICAgICAg IG1jX2N1cnNvcl90eXBlX3RvX2xpc3AgKHR5cGUpLAorICAgICAgICAgICAgICAgICAgICAgICAg bWFrZV9udW1iZXIgKHdpZHRoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQs CisgICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICAg ICAgICAgZmxhdm9yLAorICAgICAgICAgICAgICAgICAgICAgICAgbWFrZV9udW1iZXIgKHBvcykp OworICB0ZW1wID0gRmNvbnMgKHNwZWNzLCBGY29ucyAodGVuX2VsZW1lbnRzLCBRbmlsKSk7Cisg ICpyZXN1bHQgPSBGY29ucyAodGVtcCwgKnJlc3VsdCk7Cit9CisKKy8qIFJldHVybiB0aGUgc3Rh cnQgb3IgZW5kIHBvc2l0aW9uIG9mIHRoZSByZWdpb24uCisgICBCRUdJTk5JTkdQIG1lYW5zIHJl dHVybiB0aGUgc3RhcnQuCisgICBJZiB0aGVyZSBpcyBubyByZWdpb24gYWN0aXZlLCBzaWduYWwg YW4gZXJyb3IuCisgICBFWEFNUExFIChyZWdpb24tYmVnaW5uaW5nKTogIHJlZ2lvbl9saW1pdCAo MSkKKyAgIEVYQU1QTEUgKHJlZ2lvbi1lbmQpOiAgcmVnaW9uX2xpbWl0ICgwKSAqLworCitzdGF0 aWMgTGlzcF9PYmplY3QKK21jX3JlZ2lvbl9saW1pdCAoYm9vbCBiZWdpbm5pbmdwKQoreworICBM aXNwX09iamVjdCBtOworICBpZiAoIU5JTFAgKFZ0cmFuc2llbnRfbWFya19tb2RlKQorICAgICAg JiYgTklMUCAoVm1hcmtfZXZlbl9pZl9pbmFjdGl2ZSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKGN1 cnJlbnRfYnVmZmVyLCBtYXJrX2FjdGl2ZSkpKQorICAgIHJldHVybiBRbmlsOworICBtID0gRm1h cmtlcl9wb3NpdGlvbiAoQlZBUiAoY3VycmVudF9idWZmZXIsIG1hcmspKTsKKyAgaWYgKE5JTFAg KG0pKQorICAgIHJldHVybiBRbmlsOworICAvKiBTZWUgYHJlZ2lvbi1hY3RpdmUtcCcgYW5kIGBy ZWRpc3BsYXktLXVwZGF0ZS1yZWdpb24taGlnaGxpZ2h0Jy4gKi8KKyAgaWYgKCFOSUxQIChWdHJh bnNpZW50X21hcmtfbW9kZSkKKyAgICAgICYmICFOSUxQIChCVkFSIChjdXJyZW50X2J1ZmZlciwg bWFya19hY3RpdmUpKQorICAgICAgJiYgIU5JTFAgKG0pKQorICAgIHJldHVybiBtYWtlX251bWJl ciAoKFBUIDwgWEZBU1RJTlQgKG0pKSA9PSBiZWdpbm5pbmdwCisgICAgICAgICAgICAgICAgICAg ICAgICA/IFBUCisgICAgICAgICAgICAgICAgICAgICAgICA6IGNsaXBfdG9fYm91bmRzIChCRUdW LCBYRkFTVElOVCAobSksIFpWKSk7CisgICAgICBlbHNlCisgICAgICAgIHJldHVybiBRbmlsOwor fQorCisvKiBTUEVDUyB3aWxsIGJlIGFuIExTTCBjb2xvciB2ZWN0b3IgaWYgY29taW5nIGZyb20g YG1jX2RyYXdfY3Jvc3NoYWlycycuCitTUEVDUyB3aWxsIGJlIGEgY29uc3AgbGlzdCBpZiBjb21p bmcgZnJvbSBgbWNfY2FsYycuICovCisKK3N0YXRpYyB2b2lkCittY19tb3ZlX2l0IChzdHJ1Y3Qg aXQgKml0LCBlbnVtIHR5cGVfb2ZfYWN0aW9uIGFjdGlvbl90eXBlLCBMaXNwX09iamVjdCBzcGVj cywgTGlzcF9PYmplY3QgKnJlc3VsdCkKK3sKKyAgcHRyZGlmZl90IHBvc2ludCA9IChWRUNUT1JQ IChzcGVjcykpCisgICAgICAgICAgICAgICAgICAgICA/IC0xCisgICAgICAgICAgICAgICAgICAg ICA6IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgwKSwgc3BlY3MpKTsKKyAgTGlzcF9PYmplY3Qg bGlzcF90eXBlID0gKFZFQ1RPUlAgKHNwZWNzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg PyBRbmlsCisgICAgICAgICAgICAgICAgICAgICAgICAgIDogRm50aCAobWFrZV9udW1iZXIgKDEp LCBzcGVjcyk7CisgIGVudW0gdGV4dF9jdXJzb3Jfa2luZHMgY3Vyc29yX3R5cGUgPSAoVkVDVE9S UCAoc3BlY3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYWN0 aW9uX3R5cGUgPT0gSE9SSVpPTlRBTF9SVUxFUikKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gSEJBUl9DVVJTT1IKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogIChWRUNUT1JQIChzcGVjcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBhY3Rpb25fdHlwZSA9PSBWRVJUSUNBTF9SVUxFUikKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBCQVJfQ1VSU09SCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChDT05TUCAobGlzcF90eXBlKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfbGlzcF90b19jdXJz b3JfdHlwZSAoWENBUiAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogbWNfbGlzcF90b19jdXJzb3JfdHlwZSAobGlzcF90eXBlKTsKKyAgaW50IGN1 cnNvcl93aWR0aCA9IChWRUNUT1JQIChzcGVjcykpCisgICAgICAgICAgICAgICAgICAgICA/IDEK KyAgICAgICAgICAgICAgICAgICAgIDogKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAg ICAgICAgICAgICAgPyBYSU5UIChYQ0FSIChYQ0RSIChsaXNwX3R5cGUpKSkKKyAgICAgICAgICAg ICAgICAgICAgIDogMTsKKyAgTGlzcF9PYmplY3QgZm9yZWdyb3VuZCA9IChWRUNUT1JQIChzcGVj cykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICA/IHNwZWNzCisgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IEZudGggKG1ha2VfbnVtYmVyICgyKSwgc3BlY3MpOworICBpZiAoU1RSSU5H UCAoZm9yZWdyb3VuZCkpCisgICAgZm9yZWdyb3VuZCA9IG1jX2NvbG9yX3ZlY3Rvcl9jYWxjIChp dC0+dywgZm9yZWdyb3VuZCk7CisgIGludCBvcG9pbnRfeCA9IGl0LT53LT5vdXRwdXRfY3Vyc29y Lng7CisgIGludCBvcG9pbnRfeSA9IGl0LT53LT5vdXRwdXRfY3Vyc29yLnk7CisgIGludCBvcG9p bnRfaHBvcyA9IGl0LT53LT5vdXRwdXRfY3Vyc29yLmhwb3M7CisgIGludCBv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wdHJkaWZmX3QgcmVnaW9uX2Jl Z2lubmluZyA9ICghTklMUCAocmVnaW9uX2xpbWl0X3RydWUpKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gWElOVCAocmVnaW9uX2xpbWl0X3RydWUpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAwOworICBMaXNwX09iamVjdCByZWdpb25fbGltaXRfZmFsc2UgPSBt Y19yZWdpb25fbGltaXQgKGZhbHNlKTsKKyAgcHRyZGlmZl90IHJlZ2lvbl9lbmQgPSAoIU5JTFAg KHJlZ2lvbl9saW1pdF9mYWxzZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgPyBYSU5UIChy ZWdpb25fbGltaXRfZmFsc2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgOiAwOworICBzdHJ1 Y3QgZ2x5cGggKnBoeXNfY3Vyc29yX2dseXBoID0gZ2V0X3BoeXNfY3Vyc29yX2dseXBoIChpdC0+ dyk7CisgIGJvb2wgcmVnaW9uX2FjdGl2ZV9wID0gKHJlZ2lvbl9iZWdpbm5pbmcgIT0gcmVnaW9u X2VuZCk7CisgIHdoaWxlICh0cnVlKQorICAgIHsKKyAgICAgIGNvdW50ICs9IDE7CisgICAgICBz dHJ1Y3QgZmFjZSAqZmFjZSA9IG1jX2xvb2t1cF9mYWNlIChpdCk7CisgICAgICBzdHJ1Y3QgZm9u dCAqZm9udCA9IGZhY2UtPmZvbnQ7CisgICAgICBpbnQgZm9udF9zcGFjZV93aWR0aCA9IChmb250 ID09IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZnJhbWVfY2hhcl93aWR0 aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBmb250LT5zcGFjZV93aWR0aCk7Cisg ICAgICBpZiAoaGVhZGVyX2xpbmVfaGVpZ2h0ID4gMCkKKyAgICAgICAgdnBvcyA9IGl0LT52cG9z ICsgMTsKKyAgICAgICAgZWxzZQorICAgICAgICAgIHZwb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9jaGFyX3dpZHRoKTsKKyAgICAgICAgICBlbHNlIGlmIChuZXdfeCA+IDApCisgICAg ICAgICAgICByZWxhdGl2ZV94ID0gbmV3X3ggLSBpdC0+Zmlyc3RfdmlzaWJsZV94OworICAgICAg ICAgICAgZWxzZQorICAgICAgICAgICAgICByZWxhdGl2ZV94ID0gMDsKKyAgICAgIC8qIFNlZSB0 aGUgZXhwbGFuYXRpb24gYnkgRWxpIFouIGFzIHRvIGlzc3VlICMzMTcxNi4gIEhvcml6b250YWwg c2Nyb2xsaW5nCisgICAgICAob2YgYWxsIGxpbmVzKSBpcyBhY3RpdmUuICBUaGUgYmVnaW5uaW5n IG9mIHRoZSBUQUIgU1RSRVRDSCBsaWVzIGJlZm9yZQorICAgICAgaXQtPmZpcnN0X3Zpc2libGVf eCArIGl0LT5sbnVtX3BpeGVsX3dpZHRoOyBhbmQsIHRoZSBuZXh0IGRpc3BsYXkgZWxlbWVudCBp cworICAgICAgc3Vic2VxdWVudCB0aGVyZXRvLgorICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLQorICAgICAgNy4gIFRBQiBTVFJFVENICisgICAgICAgICAgaXQtPmMgKDkpCisg ICAgICAgICAgY2hhciAoCSkKKyAgICAgICAgICBpdC0+dy0+aHNjcm9sbCAoNCkKKyAgICAgICAg ICBoc2NsX3RlbXBvcmFyeSAoZmFsc2UpCisgICAgICAgICAgaXQtPmhwb3MgKDApCisgICAgICAg ICAgaXQtPmN1cnJlbnRfeCAoMTEpCisgICAgICAgICAgbmV3X3ggKDc3KQorICAgICAgICAgIGZv bnRfc3BhY2Vfd2lkdGggKDExKQorICAgICAgICAgIGl0LT5sbnVtX3BpeGVsX3dpZHRoICg0NCkK KyAgICAgICAgICByZWxhdGl2ZV94ICgzMykKKyAgICAgICAgICByYyAoTU9WRV9YX1JFQUNIRUQp CisgICAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICA4LiAgVEVYVCAt LSBUSEUgRlVOIFNUQVJUUyBIRVJFCisgICAgICAgICAgaXQtPmMgKDcyKQorICAgICAgICAgIGNo YXIgKEgpCisgICAgICAgICAgaXQtPnctPmhzY3JvbGwgKDQpCisgICAgICAgICAgaHNjbF90ZW1w b3JhcnkgKGZhbHNlKQorICAgICAgICAgIGl0LT5ocG9zICg1KQorICAgICAgICAgIGl0LT5jdXJy ZW50X3ggKDEzMikKKyAgICAgICAgICBuZXdfeCAoODgpCisgICAgICAgICAgZm9udF9zcGFjZV93 aWR0aCAoMTEpCisgICAgICAgICAgaXQtPmxudW1fcGl4ZWxfd2lkdGggKDQ0KQorICAgICAgICAg IHJlbGF0aXZlX3ggKDQ0KQorICAgICAgICAgIHJjIChNT1ZFX1hfUkVBQ0hFRCkKKyAgICAgID09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgICAgIDcuICBUQUIgU1RSRVRDSAorICAg ICAgICAgIGl0LT5jICg5KQorICAgICAgICAgIGNoYXIgKAkpCisgICAgICAgICAgaXQtPnctPmhz Y3JvbGwgKDIpCisgICAgICAgICAgaHNjbF90ZW1wb3JhcnkgKGZhbHNlKQorICAgICAgICAgIGl0 LT5ocG9zICgwKQorICAgICAgICAgIGl0LT5jdXJyZW50X3ggKDExKQorICAgICAgICAgIG5ld194 ICg3NykKKyAgICAgICAgICBmb250X3NwYWNlX3dpZHRoICgxMSkKKyAgICAgICAgICBpdC0+bG51 bV9waXhlbF93aWR0aCAoNDQpCisgICAgICAgICAgcmVsYXRpdmVfeCAoNTUpCisgICAgICAgICAg cmMgKE1PVkVfWF9SRUFDSEVEKQorICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LQorICAgICAgOC4gIFRFWFQKKyAgICAgICAgICBpdC0+YyAoNzIpCisgICAgICAgICAgY2hhciAo SCkKKyAgICAgICAgICBpdC0+dy0+aHNjcm9sbCAoMikKKyAgICAgICAgICBoc2NsX3RlbXBvcmFy eSAoZmFsc2UpCisgICAgICAgICAgaXQtPmhwb3MgKDUpCisgICAgICAgICAgaXQtPmN1cnJlbnRf eCAoMTMyKQorICAgICAgICAgIG5ld194ICg4OCkKKyAgICAgICAgICBmb250X3NwYWNlX3dpZHRo ICgxMSkKKyAgICAgICAgICBpdC0+bG51bV9waXhlbF93aWR0aCAoNDQpCisgICAgICAgICAgcmVs YXRpdmVfeCAoNjYpCisgICAgICAgICAgcmMgKE1PVkVfWF9SRUFDSEVEKSAqLworICAgICAgYm9v bCBpc3N1ZV8zMTcxNl9wID0gKCFoc2NsX3RlbXBvcmFyeQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmICFoc2NsX3Blcm1hbmVudAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IGl0LT53LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHByaW9y X3ByZXZpb3VzX2hwb3MgPT0gLTEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBwcmV2 aW91c19jaGFyYWN0ZXIgPT0gJ1x0JworICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGl0 LT5ocG9zID4gaXQtPmxudW1fcGl4ZWxfd2lkdGggLyBmb250X3NwYWNlX3dpZHRoKTsKKyAgICAg IGludCBoc2NsX3ggPSAoaHNjbF90ZW1wb3JhcnkKKyAgICAgICAgICAgICAgICAgICAgfHwgaHNj bF9wZXJtYW5lbnQpCisgICAgICAgICAgICAgICAgICAgID8gaXQtPmN1cnJlbnRfeCAtIChoc2Ns X2ZpcnN0X2hwb3MgKiBmcmFtZV9jaGFyX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICA6IGl0 LT5jdXJyZW50X3ggLSBpdC0+Zmlyc3RfdmlzaWJsZV94OworICAgICAgYm9vbCBmaW5hbF9sb29w X3AgPSAoKEZFVENIX0JZVEUgKElUX0JZVEVQT1MgKCppdCkpID09ICdcbicKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBpdC0+YyAhPSAwKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgLyogfHwgSVRFUkFUT1JfQVRfRU5EX09GX0xJTkVfUCAoaXQpICovCisgICAgICAgICAgICAg ICAgICAgICAgICAgICB8fCByYyA9PSBNT1ZFX1BPU19NQVRDSF9PUl9aVgorICAgICAgICAgICAg ICAgICAgICAgICAgICAgfHwgcmMgPT0gTU9WRV9MSU5FX0NPTlRJTlVFRAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgfHwgaHNjbF94ICsgZnJhbWVfY2hhcl93aWR0aCA+PSB0ZXh0X2FyZWFf d2lkdGgpOworICAgICAgYm9vbCBscHdfcmVhY2hlZF9wID0gKHByZXZpb3VzX3JlbGF0aXZlX3gg Pj0gaXQtPmxudW1fcGl4ZWxfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBp c3N1ZV8zMTcxNl9wKTsKKyAgICAgIGJvb2wgZ3JlZW5fbGlnaHRfcCA9IChpdC0+Y3VycmVudF94 ID4gc2F2ZWRfY3VycmVudF94KSA/IHRydWUgOiBmYWxzZTsKKyAgICAgIGJvb2wgYWR2YW5jZV9o cG9zX3AgPSAoZ3JlZW5fbGlnaHRfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBs cHdfcmVhY2hlZF9wKTsKKyAgICAgIGlmIChhZHZhbmNlX2hwb3NfcCkKKyAgICAgICAgcHJldmlv dXNfaHBvcyArPSAocHJldmlvdXNfaHBvcyA9PSAtMQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgIU5JTFAgKFZkaXNwbGF5X2xpbmVfbnVtYmVycykKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmICFFUSAoVmRpc3BsYXlfbGluZV9udW1iZXJzLCBRdmlzdWFsKSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgPyAoaXQtPmxudW1fcGl4ZWxfd2lkdGggLyBmb250X3NwYWNlX3dp ZHRoKSArIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgOiAocmVsYXRpdmVfeCA+IDApCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAxCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiAwOworICAgICAgICBlbHNlIGlmIChmaW5hbF9sb29wX3AKKyAgICAgICAgICAgICAgICAg JiYgcHJldmlvdXNfaHBvcyA9PSAtMSkKKyAgICAgICAgICBwcmV2aW91c19ocG9zID0gMDsKKyAg ICAgIC8qIGl0LT5jID09ICdcdCcgd2hlbiBJVCBpcyBhdCBhIHRhYi13aWR0aCBzcGFjZXIgZm9s bG93aW5nIGEKKyAgICAgIGBidWZmZXItZGlzcGxheS10YWJsZScgZ2x5cGggc3VjaCBhcyDCuy4g IEFub3RoZXIgd2F5IHRvIHRlc3QKKyAgICAgIGZvciB0aGlzIGNvbmRpdGlvbiBpcyB3aGVuIGl0 LT5jID09IEZFVENIX0JZVEUgKElUX0JZVEVQT1MgKCppdCkpLiAqLworICAgICAgYm9vbCB0YWJf aW52aXNpYmxlX3AgPSBwcmV2aW91c19jaGFyYWN0ZXIgPT0gJ1x0JzsKKyAgICAgIGJvb2wgdGFi X3Zpc2libGVfcCA9IChwcmV2aW91c19jaGFyYWN0ZXIgIT0gJ1x0JworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIGZldGNoX2J5dGVfcHJldmlvdXNfY2hhcmFjdGVyID09ICdcdCcpOwor ICAgICAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3AgPSAoYWN0aW9uX3R5cGUgPT0gVkVSVElDQUxf UlVMRVIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gKG9wb2ludF95ID09IGl0 LT5jdXJyZW50X3kKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdnBvcyA9 PSBvcG9pbnRfdnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAob3BvaW50 X3ggPT0gcHJldmlvdXNfcmVsYXRpdmVfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBvcG9pbnRfeSA9PSBpdC0+Y3VycmVudF95CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIG9wb2ludF9ocG9zID09IHByZXZpb3VzX2hwb3MKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3Zwb3MgPT0gdnBvcyk7CisgICAgICBp ZiAoIU5JTFAgKEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBtY19zdGRlcnIpKSkKKyAgICAgICAgbWNf c3RkZXJyIChpdCwgY291bnQsIG5ld194LCByZWxhdGl2ZV94LCBwcmV2aW91c19jaGFyYWN0ZXIs CisgICAgICAgICAgICAgICAgICAgcHJldmlvdXNfaHBvcywgaXNzdWVfMzE3MTZfcCwgZmluYWxf bG9vcF9wLCBscHdfcmVhY2hlZF9wLAorICAgICAgICAgICAgICAgICAgIGdyZWVuX2xpZ2h0X3As IGFkdmFuY2VfaHBvc19wLCBoc2NsX3RlbXBvcmFyeSwgaHNjbF9wZXJtYW5lbnQsCisgICAgICAg ICAgICAgICAgICAgcmMsIGFjdGlvbl90eXBlKTsKKyAgc3dpdGNoIChhY3Rpb25fdHlwZSkKKyAg eworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgTVVMVElQTEUgQ1VSU09SUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8q IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgTVVMVElQTEVfQ1VSU09SUzoKKyAgICB7 CisgICAgICBpZiAocHJldmlvdXNfcHQgPT0gcG9zaW50CisgICAgICAgICAgfHwgRkVUQ0hfQllU RSAoSVRfQllURVBPUyAoKml0KSkgPT0gJ1xuJykKKyAgICAgICAgeworICAgICAgICAgIGVudW0g ZmFjZV9pZCB0ZW1wX2ZhY2VfaWQgPSBwcmV2aW91c19mYWNlX2lkOworICAgICAgICAgIGludCB0 ZW1wX3ggPSByZWxhdGl2ZV94OworICAgICAgICAgIGludCB0ZW1wX2hwb3MgPSBwcmV2aW91c19o cG9zOworICAgICAgICAgIC8qIEFzIHRvIGBtY19jYWxjJywgd2UgYXJlIGludGVyZXN0ZWQgaW4g dGhlIGN1cnJlbnQgSFBPUyBhbmQgdGhlIGN1cnJlbnQKKyAgICAgICAgICBgcmVsYXRpdmVfeGAu ICBUaGUgaW5jb21pbmcgYXJndW1lbnQgZm9yIHByZXZpb3VzX2hwb3MgaXMgYWN0dWFsbHkgaHBv cywKKyAgICAgICAgICB3aGljaCBnZXRzIG1vZGlmaWVkIGFjY29yZGluZ2x5IGhlcmUgKGV2ZW4g dGhvdWdoIGEgZGlmZmVyZW50IG5hbWUpLiAqLworICAgICAgICAgIGlmIChwcmV2aW91c19wdCA9 PSBwb3NpbnQpCisgICAgICAgICAgICAvKiBXZSBjb3VsZCwgYnV0IGFyZSBub3QgbW9kaWZ5aW5n IHRoZSBnbG9iYWwgcHJldmlvdXNfcmVsYXRpdmVfeC4gKi8KKyAgICAgICAgICAgIHRlbXBfeCA9 IHByZXZpb3VzX3JlbGF0aXZlX3g7CisgICAgICAgICAgICAvKiBXZSBhcmUgYXQgdGhlIGVuZCBv ZiB0aGUgbGluZS4gKi8KKyAgICAgICAgICAgIGVsc2UgaWYgKChJVEVSQVRPUl9BVF9FTkRfT0Zf TElORV9QIChpdCkKKyAgICAgICAgICAgICAgICAgICAgICB8fCBGRVRDSF9CWVRFIChJVF9CWVRF UE9TICgqaXQpKSA9PSAnXG4nKQorICAgICAgICAgICAgICAgICAgICAgJiYgSVRfQ0hBUlBPUyAo Kml0KSA9PSBwb3NpbnQpCisgICAgICAgICAgICAgIC8qIGByZWxhdGl2ZV94YCBpcyBhbHJlYWR5 IGNvcnJlY3QuICovCisgICAgICAgICAgICAgIHRlbXBfaHBvcyA9IHByZXZpb3VzX2hwb3MgKyAx OworICAgICAgICAgIExpc3BfT2JqZWN0IGZsYXZvciA9IFFuaWw7CisgICAgICAgICAgaWYgKElU X0NIQVJQT1MgKCppdCkgPT0gcG9zaW50CisgICAgICAgICAgICAgICYmIChJVEVSQVRPUl9BVF9F TkRfT0ZfTElORV9QIChpdCkKKyAgICAgICAgICAgICAgICAgIHx8IEZFVENIX0JZVEUgKElUX0JZ VEVQT1MgKCppdCkpID09ICdcbicpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBmbGF2 b3IgPSBRbWNfZ2x5cGhsZXNzOworICAgICAgICAgICAgICB0ZW1wX2ZhY2VfaWQgPSBpdC0+ZmFj ZV9pZDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAg IGZsYXZvciA9IFFtY19nbHlwaDsKKyAgICAgICAgICBpZiAocmMgPT0gTU9WRV9MSU5FX0NPTlRJ TlVFRCkKKyAgICAgICAgICAgIHRlbXBfaHBvcyA9IHByZXZpb3VzX2hwb3MgKyAxOworICAgICAg ICAgIG1jX2NhbGNfaGVscGVyIChpdC0+dywgdGVtcF94LCBpdC0+Y3VycmVudF95LCB0ZW1wX2hw b3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHZwb3MsIGN1cnNvcl90eXBlLCBjdXJzb3Jf d2lkdGgsIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAo aXQtPncsIHRlbXBfZmFjZV9pZCksIGZsYXZvciwgcG9zaW50LAorICAgICAgICAgICAgICAgICAg ICAgICAgICBzcGVjcywgcmVzdWx0KTsKKyAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAg ICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAg ICAgICAgICAgICAgICAgICAgIEhPUklaT05UQUwgUlVMRVIgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEhPUklaT05U QUxfUlVMRVI6CisgICAgeworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgUW1jX2dseXBoICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgICAgaWYgKChncmVlbl9s aWdodF9wCisgICAgICAgICAgIC8qIFBsYWNlIGFuIFFtY19nbHlwaCBvbiB0aGUgbGFzdCBzcGFj ZSBvZiBhIHdyYXBwZWQgbGluZS4gKi8KKyAgICAgICAgICAgfHwgcmMgPT0gTU9WRV9MSU5FX0NP TlRJTlVFRCkKKyAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wCisgICAgICAgICAgJiYg bHB3X3JlYWNoZWRfcAorICAgICAgICAgICYmICF0YWJfaW52aXNpYmxlX3ApCisgICAgICAgIHsK KyAgICAgICAgICBlbnVtIGZhY2VfaWQgdGVtcF9mYWNlX2lkID0gKHJjID09IE1PVkVfTElORV9D T05USU5VRUQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gaXQtPmZh Y2VfaWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBwcmV2aW91c19m YWNlX2lkOworICAgICAgICAgIGludCB0ZW1wX2hwb3MgPSAocmMgPT0gTU9WRV9MSU5FX0NPTlRJ TlVFRCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgPyBwcmV2aW91c19ocG9zICsgMQorICAg ICAgICAgICAgICAgICAgICAgICAgICA6IHByZXZpb3VzX2hwb3M7CisgICAgICAgICAgcHRyZGlm Zl90IGl0X2NoYXJwb3MgPSAocmMgPT0gTU9WRV9MSU5FX0NPTlRJTlVFRCkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IElUX0NIQVJQT1MgKCppdCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IElUX0NIQVJQT1MgKCppdCkgLSAxOworICAgICAgICAgIG1j X2Nyb3NzaGFpcnNfaGVscGVyIChpdC0+dywgcHJldmlvdXNfcmVsYXRpdmVfeCwgaXQtPmN1cnJl bnRfeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcF9ocG9zLCB2cG9zLCBj dXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBmb3JlZ3JvdW5kLCBtY19iZ19sc2wgKGl0LT53LCB0ZW1wX2ZhY2VfaWQpLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBRbWNfZ2x5cGgsIGl0X2NoYXJwb3MsIHJlc3VsdCk7Cisg ICAgICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIFFtY19nbHlwaF90YWIgIC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lmIChncmVlbl9saWdodF9wCisg ICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcAorICAgICAgICAgICYmIGxwd19yZWFjaGVk X3AKKyAgICAgICAgICAmJiB0YWJfaW52aXNpYmxlX3ApCisgICAgICAgIHsKKyAgICAgICAgICBp bnQgaTsKKyAgICAgICAgICBpbnQgdGVtcF94ID0gKHNhdmVkX3JlbGF0aXZlX3hfZm9yX3RhYiA8 IGl0LT5sbnVtX3BpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAgICAgPyBpdC0+bG51 bV9waXhlbF93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgOiBzYXZlZF9yZWxhdGl2ZV94 X2Zvcl90YWI7CisgICAgICAgICAgaW50IGNvdW50ID0gKHJlbGF0aXZlX3ggLSB0ZW1wX3gpIC8g Zm9udF9zcGFjZV93aWR0aDsKKyAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgY291bnQ7IGkrKykK KyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbWNfY3Jvc3NoYWlyc19oZWxwZXIgKGl0LT53 LCB0ZW1wX3gsIGl0LT5jdXJyZW50X3ksIHByZXZpb3VzX2hwb3MsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICB2cG9zLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3Jl Z3JvdW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWNfYmdfbHNsIChp dC0+dywgcHJldmlvdXNfZmFjZV9pZCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBRbWNfZ2x5cGhfdGFiLCBJVF9DSEFSUE9TICgqaXQpIC0gMSwgcmVzdWx0KTsKKyAgICAg ICAgICAgICAgdGVtcF94ICs9IGZvbnRfc3BhY2Vfd2lkdGg7CisgICAgICAgICAgICB9CisgICAg ICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgR2hv c3Qgb2YgQ2hyaXN0bWFzIEZ1dHVyZSAtLSBRbWNfZ2x5cGhfdGFiICAgICAgICAgICAgICAgICov CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICAgIGlmIChncmVlbl9saWdodF9wCisgICAg ICAgICAgJiYgZ2hvc3Rfb2ZfY2hyaXN0bWFzX2Z1dHVyZV9wCisgICAgICAgICAgJiYgbHB3X3Jl YWNoZWRfcCkKKyAgICAgICAgeworICAgICAgICAgIGludCBpOworICAgICAgICAgIGludCB0ZW1w X3ggPSAoZ2hvc3Rfb2ZfY2hyaXN0bWFzX2Z1dHVyZV9yZWxhdGl2ZV94IDwgaXQtPmxudW1fcGl4 ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICA/IGl0LT5sbnVtX3BpeGVsX3dpZHRo CisgICAgICAgICAgICAgICAgICAgICAgICA6IGdob3N0X29mX2NocmlzdG1hc19mdXR1cmVfcmVs YXRpdmVfeDsKKyAgICAgICAgICBpbnQgY291bnQgPSAocHJldmlvdXNfcmVsYXRpdmVfeCAtIHRl bXBfeCkgLyBmb250X3NwYWNlX3dpZHRoOworICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBjb3Vu dDsgaSsrKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19jcm9zc2hhaXJzX2hlbHBl ciAoaXQtPncsIHRlbXBfeCwgaXQtPmN1cnJlbnRfeSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGdob3N0X29mX2NocmlzdG1hc19mdXR1cmVfaHBvcywgdnBvcywKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgs IGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtY19iZ19s c2wgKGl0LT53LCBnaG9zdF9vZl9jaHJpc3RtYXNfZnV0dXJlX2ZhY2VfaWQpLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgUW1jX2dseXBoX3RhYiwgSVRfQ0hBUlBPUyAoKml0 KSAtIDIsIHJlc3VsdCk7CisgICAgICAgICAgICAgIHRlbXBfeCArPSBmb250X3NwYWNlX3dpZHRo OworICAgICAgICAgICAgfQorICAgICAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8q ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUW1jX2dseXBobGVzcyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgICBp ZiAoZmluYWxfbG9vcF9wKQorICAgICAgICB7CisgICAgICAgICAgLyogV2Ugd2FudCB0byBzdGFy dCBkcmF3aW5nIHRoZSBmbG9hdGluZyBob3Jpem9udGFsIGxpbmUgZnJvbSBJVAorICAgICAgICAg IChsaW5lIGZlZWQ7IFpWOyBvciBzcGFjZS13b3JkX3dyYXApIHVudGlsIHRoZSByaWdodCBmcmlu Z2UuCisgICAgICAgICAgSWYgdGhlIGxpbmUgaXMgZW1wdHkgb3IgaGlkZGVuIGJ5IGhvcml6b250 YWwgc2Nyb2xsaW5nLCB0aGVuIGBpdC5jdXJyZW50X3hgCisgICAgICAgICAgbWF5IGJlIHNvbWV3 aGVyZSBiZWZvcmUgYGxudW1fcGl4ZWxfd2lkdGhgLiAgVGhlIHJlYWwgY3Vyc29yIHdpbGwgYmUg dG8gdGhlCisgICAgICAgICAgbGVmdCBvZiBgbG51bV9waXhlbF93aWR0aGAgaWYgd2UgYXJlIGhv cml6b250YWwgc2Nyb2xsaW5nIGFuZCBwb2ludCBpcworICAgICAgICAgIGhpZGRlbiBzb21ld2hl cmUgdG8gdGhlIGxlZnQgdGhlcmVvZi4gKi8KKyAgICAgICAgICBlbnVtIGZhY2VfaWQgdGVtcF9m YWNlX2lkID0gKChwaHlzX2N1cnNvcl9nbHlwaCA9IGdldF9waHlzX2N1cnNvcl9nbHlwaCAoaXQt PncpKSA9PSBOVUxMKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g REVGQVVMVF9GQUNFX0lECisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiAoSVRfQ0hBUlBPUyAoKml0KSA+PSByZWdpb25fZW5kCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgfHwgcmVnaW9uX2JlZ2lubmluZyA9PSByZWdpb25fZW5kKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBERUZBVUxUX0ZBQ0Vf SUQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogcGh5c19jdXJz b3JfZ2x5cGgtPmZhY2VfaWQ7CisgICAgICAgICAgLyogQW4gZW1wdHkgbmV3IGxpbmUgLS0gbG9v cCBpbiBwcmV2aW91cyBzZWN0aW9uIGJyb2tlIGltbWVkaWF0ZWx5LiAqLworICAgICAgICAgIGlu dCB0ZW1wX2hwb3MgPSAocmVsYXRpdmVfeCA9PSBpdC0+bG51bV9waXhlbF93aWR0aCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gaXQtPmxudW1fcGl4ZWxfd2lkdGggLyBmcmFtZV9jaGFy X3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBObyBuZWVkIHRvIHJlYWRqdXN0 IGJlY2F1c2UgaXQgd2FzIGRvbmUgYWJvdmUuICovCisgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IHJjID09IE1PVkVfTElORV9DT05USU5VRUQKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBwcmV2aW91c19ocG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICA6IHByZXZpb3Vz X2hwb3MgKyAxOworICAgICAgICAgIC8qIEFuIGVtcHR5IG5ldyBsaW5lIC0tIGxvb3AgaW4gcHJl dmlvdXMgc2VjdGlvbiBicm9rZSBpbW1lZGlhdGVseS4gKi8KKyAgICAgICAgICBpbnQgdGVtcF94 ID0gKHJlbGF0aXZlX3ggPCBpdC0+bG51bV9waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAg ICAgICAgPyBpdC0+bG51bV9waXhlbF93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICA6IHJl bGF0aXZlX3g7CisgICAgICAgICAgd2hpbGUgKHRlbXBfeCArIGZyYW1lX2NoYXJfd2lkdGggPCB0 ZXh0X2FyZWFfd2lkdGgpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIG1jX2Nyb3NzaGFp cnNfaGVscGVyIChpdC0+dywgdGVtcF94LCBpdC0+Y3VycmVudF95LAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgdGVtcF9ocG9zLCB2cG9zLCBjdXJzb3JfdHlwZSwgY3Vyc29y X3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZCwg bWNfYmdfbHNsIChpdC0+dywgdGVtcF9mYWNlX2lkKSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIFFtY19nbHlwaGxlc3MsIElUX0NIQVJQT1MgKCppdCksIHJlc3VsdCk7Cisg ICAgICAgICAgICAgIHRlbXBfeCA9IHRlbXBfeCArIGZyYW1lX2NoYXJfd2lkdGg7CisgICAgICAg ICAgICB9CisgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9 CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgVkVSVElDQUwgUlVMRVIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyog LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBWRVJUSUNBTF9SVUxFUjoKKyAgICB7Cisg ICAgICBpZiAocHJldmlvdXNfcmVsYXRpdmVfeCA9PSBvcG9pbnRfeAorICAgICAgICAgIHx8IGZp bmFsX2xvb3BfcCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKmdseXBo X3JvdyA9ICBNQVRSSVhfUk9XIChpdC0+dy0+Y3VycmVudF9tYXRyaXgsIHZwb3MpOworICAgICAg ICAgIExpc3BfT2JqZWN0IGZsYXZvciA9IFFuaWw7CisgICAgICAgICAgZW51bSBmYWNlX2lkIHRl bXBfZmFjZV9pZCA9IHByZXZpb3VzX2ZhY2VfaWQ7CisgICAgICAgICAgaW50IHRlbXBfaHBvcyA9 IHByZXZpb3VzX2hwb3M7CisgICAgICAgICAgLyogU2tpcCB0aGlzIGxpbmUuICovCisgICAgICAg ICAgaWYgKHJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAg ICAvKiBJZiBwb2ludCBpcyB0byB0aGUgbGVmdCBvZiB0aGUgbGluZSBudW1iZXJzIHdoZW4gc2Ny b2xsaW5nCisgICAgICAgICAgaG9yaXpvbnRhbGx5LCB0aGVuIHdlIHdhbnQgdGhlIHZlcnRpY2Fs IGxpbmUgdG8gYWxpZ24gd2l0aCByaWdodCBlZGdlCisgICAgICAgICAgb2YgdGhlIGxpbmUgbnVt YmVycy4gKi8KKyAgICAgICAgICBpZiAoaXQtPnctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAg ICYmIHByZXZpb3VzX3JlbGF0aXZlX3ggPT0gb3BvaW50X3gKKyAgICAgICAgICAgICAgJiYgb3Bv aW50X3ggPCBpdC0+bG51bV9waXhlbF93aWR0aAorICAgICAgICAgICAgICAmJiBwcmV2aW91c19o cG9zID09IC0xKQorICAgICAgICAgICAgdGVtcF9ocG9zID0gKGl0LT5sbnVtX3BpeGVsX3dpZHRo IC8gZm9udF9zcGFjZV93aWR0aCkgLSAxOworICAgICAgICAgICAgZWxzZSBpZiAoZmluYWxfbG9v cF9wCisgICAgICAgICAgICAgICAgICAgICAmJiBwcmV2aW91c19ocG9zICE9IDAKKyAgICAgICAg ICAgICAgICAgICAgICYmIHJjID09IE1PVkVfTElORV9DT05USU5VRUQpCisgICAgICAgICAgICAg IHRlbXBfaHBvcyA9IHByZXZpb3VzX2hwb3MgKyAxOworICAgICAgICAgIGlmICgoaXQtPnctPmhz Y3JvbGwgPiAwCisgICAgICAgICAgICAgICAmJiBwcmV2aW91c19yZWxhdGl2ZV94ID09IG9wb2lu dF94CisgICAgICAgICAgICAgICAmJiBvcG9pbnRfeCA8IGl0LT5sbnVtX3BpeGVsX3dpZHRoKQor ICAgICAgICAgICAgICB8fCBJVF9DSEFSUE9TICgqaXQpID09IFpWKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICBmbGF2b3IgPSBRbWNfZ2x5cGhsZXNzOworICAgICAgICAgICAgICB0ZW1w X2ZhY2VfaWQgPSBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBl bHNlIGlmIChnaG9zdF9vZl9jaHJpc3RtYXNfZnV0dXJlX3ApCisgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICBmbGF2b3IgPSBRbWNfZ2x5cGhfdGFiOworICAgICAgICAgICAgICAgIHRl bXBfZmFjZV9pZCA9IGdob3N0X29mX2NocmlzdG1hc19mdXR1cmVfZmFjZV9pZDsKKyAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgICBlbHNlIGlmIChjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAg ICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAg ICAgICAgICAgICAgICBmbGF2b3IgPSBRbWNfdmVydGljYWxfYmFyX3JpZ2h0X2FuZ2xlOworICAg ICAgICAgICAgICAgIGVsc2UgaWYgKGN1cnNvcl9pbl9mcmluZ2VfcAorICAgICAgICAgICAgICAg ICAgICAgICAgICYmIGdseXBoX3Jvdy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAgICAgICBm bGF2b3IgPSBRbWNfdmVydGljYWxfYmFyX2JhY2tzbGFzaDsKKyAgICAgICAgICAgICAgICAgIGVs c2UgaWYgKGN1cnNvcl9pbl9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg IWdseXBoX3Jvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3AKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmICFnbHlwaF9yb3ctPmNvbnRpbnVlZF9wKQorICAgICAgICAgICAgICAgICAgICBmbGF2 b3IgPSBRbWNfdmVydGljYWxfYmFyOworICAgICAgICAgICAgICAgICAgICAvKiBXaGVuIElUIGlz IGF0IHRoZSBlbmQgb2YgYSBsaW5lLCB1c2UgYFFtY19nbHlwaGxlc3MnLgorICAgICAgICAgICAg ICAgICAgICBIb3dldmVyLCBpdCBpcyBva2F5IHRvIHVzZSBRbWNfZ2x5cGggZm9yIGEgd29yZC13 cmFwcGVkIGxpbmUuICovCisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKCFJVEVSQVRPUl9B VF9FTkRfT0ZfTElORV9QIChpdCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgRkVU Q0hfQllURSAoSVRfQllURVBPUyAoKml0KSkgIT0gJ1xuJworICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBGRVRDSF9CWVRFIChJVF9CWVRFUE9TICgqaXQpKSAhPSAnXGYnCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC8qIGl0LT5jID09ICdcdCcgd2hlbiBJVCBpcyBhdCBhIHRh Yi13aWR0aCBzcGFjZXIgZm9sbG93aW5nIGEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg YGJ1ZmZlci1kaXNwbGF5LXRhYmxlJyBnbHlwaCBzdWNoIGFzIMK7LiAgQW5vdGhlciB3YXkgdG8g dGVzdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgdGhpcyBjb25kaXRpb24gaXMg d2hlbiBpdC0+YyA9PSBGRVRDSF9CWVRFIChJVF9CWVRFUE9TICgqaXQpKS4gKi8KKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgcHJldmlvdXNfY2hhcmFjdGVyICE9ICdcdCcKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgcmMgIT0gTU9WRV9QT1NfTUFUQ0hfT1JfWlYKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcmMgIT0gTU9WRV9MSU5FX0NPTlRJTlVFRAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJlbGF0aXZlX3ggLyBmcmFtZV9jaGFyX3dpZHRo ID49IGl0LT5sbnVtX3BpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAgIGZsYXZvciA9 IFFtY19nbHlwaDsKKyAgICAgICAgICAgICAgICAgICAgICAvKiBJdCBpcyBva2F5IHRvIHVzZSBR bWNfZ2x5cGggZm9yIGEgd29yZC13cmFwcGVkIGxpbmUuICovCisgICAgICAgICAgICAgICAgICAg ICAgZWxzZSBpZiAocmMgPT0gTU9WRV9MSU5FX0NPTlRJTlVFRAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIEZFVENIX0JZVEUgKElUX0JZVEVQT1MgKCppdCkpID09ICcgJworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHByZXZpb3VzX3JlbGF0aXZlX3ggPT0gb3Bv aW50X3gpCisgICAgICAgICAgICAgICAgICAgICAgICBmbGF2b3IgPSBRbWNfZ2x5cGg7CisgICAg ICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChwcmV2aW91c19jaGFyYWN0ZXIgPT0gJ1x0Jwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcHJldmlvdXNfcmVsYXRpdmVfeCA9 PSBvcG9pbnRfeCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGZsYXZvciA9IFFtY19nbHlwaF90YWI7CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgdGVtcF9mYWNlX2lkID0gcHJldmlvdXNfZmFjZV9pZDsKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg Zmxhdm9yID0gUW1jX2dseXBobGVzczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg dGVtcF9mYWNlX2lkID0gREVGQVVMVF9GQUNFX0lEOworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgfQorICAgICAgICAgIC8qIENPUk5FUiBDQVNFUzoKKyAgICAgICAgICAtICBXaGVuIHRo ZSB2ZXJ0aWNhbCBsaW5lIGlzIHRvIHRoZSBsZWZ0IG9mIHRoZSB0ZXh0IGFuZCBqdXN0IHRvIHRo ZQorICAgICAgICAgICAgIHJpZ2h0IG9mIHRoZSBsaW5lIG51bWJlcnMsIHdlIHdhbnQgdGhlIGRl ZmF1bHQgZmFjZS4KKyAgICAgICAgICAtICBXaGVuIHRoZXJlIGlzIGFuIGltYWdpbmFyeSBlbXB0 eSBsaW5lIGF0IHRoZSBlbmQgb2YgdGhlIGJ1ZmZlciB3aXRoCisgICAgICAgICAgICAgbm90aGlu ZyBvdGhlciB0aGFuIFpWLCB3ZSB3YW50IHRvIHVzZSB0aGUgZnJhbWUgZGVmYXVsdCBmYWNlIGlm IFpWCisgICAgICAgICAgICAgaXMgYXQgdGhlIGVuZCBvZiBhbiBhY3RpdmUgcmVnaW9uLiAqLwor ICAgICAgICAgIGlmIChyZWdpb25fYWN0aXZlX3ApCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIC8qIFN1YnNlcXVlbnQgdG8gYHJlZ2lvbl9lbmRgIGFuZCBhdCB0aGUgZW5kIG9mIGEgbGlu ZS4gKi8KKyAgICAgICAgICAgICAgaWYgKElUX0NIQVJQT1MgKCppdCkgPj0gcmVnaW9uX2VuZAor ICAgICAgICAgICAgICAgICAgJiYgKElURVJBVE9SX0FUX0VORF9PRl9MSU5FX1AgKGl0KQorICAg ICAgICAgICAgICAgICAgICAgIHx8IEZFVENIX0JZVEUgKElUX0JZVEVQT1MgKCppdCkpID09ICdc bicpKQorICAgICAgICAgICAgICAgIHRlbXBfZmFjZV9pZCA9IERFRkFVTFRfRkFDRV9JRDsKKyAg ICAgICAgICAgICAgICAvKiBQcmlvciB0byBgcmVnaW9uX2JlZ2lubmluZ2AgYW5kIGF0IHRoZSBl bmQgb2YgYSBsaW5lLiAqLworICAgICAgICAgICAgICAgIGVsc2UgaWYgKElUX0NIQVJQT1MgKCpp dCkgPCByZWdpb25fYmVnaW5uaW5nCisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgKElURVJB VE9SX0FUX0VORF9PRl9MSU5FX1AgKGl0KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8 fCBGRVRDSF9CWVRFIChJVF9CWVRFUE9TICgqaXQpKSA9PSAnXG4nKSkKKyAgICAgICAgICAgICAg ICAgIHRlbXBfZmFjZV9pZCA9IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICAgICAgICAgIC8q IC0gIFdpdGhpbiB0aGUgcmVnaW9uLgorICAgICAgICAgICAgICAgICAgICAgLSAgYHBoeXNfY3Vy c29yX2dseXBoYCBpcyBOVUxMLiAqLworICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoSVRfQ0hB UlBPUyAoKml0KSA+PSByZWdpb25fYmVnaW5uaW5nCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBJVF9DSEFSUE9TICgqaXQpIDwgcmVnaW9uX2VuZAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgcGh5c19jdXJzb3JfZ2x5cGggPT0gTlVMTCkKKyAgICAgICAgICAgICAgICAgICAg dGVtcF9mYWNlX2lkID0gcHJldmlvdXNfZmFjZV9pZDsKKyAgICAgICAgICAgICAgICAgICAgLyog LSAgV2l0aGluIHRoZSByZWdpb24uCisgICAgICAgICAgICAgICAgICAgICAgIC0gIGBwaHlzX2N1 cnNvcl9nbHlwaGAgaXMgbm9uLU5VTEwuCisgICAgICAgICAgICAgICAgICAgICAgIC0gIEF0IHRo ZSBlbmQgb2YgdGhlIGxpbmUuCisgICAgICAgICAgICAgICAgICAgICAgIC0gIFBUIGlzIGF0IGBy ZWdpb25fYmVnaW5uaW5nYC4gKi8KKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoSVRfQ0hB UlBPUyAoKml0KSA+PSByZWdpb25fYmVnaW5uaW5nCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIElUX0NIQVJQT1MgKCppdCkgPCByZWdpb25fZW5kCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIChJVEVSQVRPUl9BVF9FTkRfT0ZfTElORV9QIChpdCkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHx8IEZFVENIX0JZVEUgKElUX0JZVEVQT1MgKCppdCkpID09 ICdcbicpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHBoeXNfY3Vyc29yX2dseXBo ICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgUFQgPT0gcmVnaW9uX2Jl Z2lubmluZykKKyAgICAgICAgICAgICAgICAgICAgICB0ZW1wX2ZhY2VfaWQgPSBwaHlzX2N1cnNv cl9nbHlwaC0+ZmFjZV9pZDsKKyAgICAgICAgICAgICAgICAgICAgICAvKiAtICBXaXRoaW4gdGhl IHJlZ2lvbi4KKyAgICAgICAgICAgICAgICAgICAgICAgICAtICBgcGh5c19jdXJzb3JfZ2x5cGhg IGlzIG5vbi1OVUxMLgorICAgICAgICAgICAgICAgICAgICAgICAgIC0gIEF0IHRoZSBlbmQgb2Yg dGhlIGxpbmUuCisgICAgICAgICAgICAgICAgICAgICAgICAgLSAgUFQgaXMgYXQgYHJlZ2lvbl9y ZWdpb25fZW5kYC4gKi8KKyAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChJVF9DSEFSUE9T ICgqaXQpID49IHJlZ2lvbl9iZWdpbm5pbmcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBJVF9DSEFSUE9TICgqaXQpIDwgcmVnaW9uX2VuZAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIChJVEVSQVRPUl9BVF9FTkRfT0ZfTElORV9QIChpdCkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgfHwgRkVUQ0hfQllURSAoSVRfQllURVBPUyAoKml0KSkg PT0gJ1xuJykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBwaHlzX2N1cnNvcl9n bHlwaCAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgUFQgPT0gcmVn aW9uX2VuZCkKKyAgICAgICAgICAgICAgICAgICAgICAgIC8qIHRlbXBfZmFjZV9pZCA9IHBoeXNf Y3Vyc29yX2dseXBoLT5mYWNlX2lkOyAqLworICAgICAgICAgICAgICAgICAgICAgICAgLyogdGVt cF9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKGl0LT5mLCBpbnRlcm4gKCJyZWdpb24iKSwg dHJ1ZSk7ICovCisgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wX2ZhY2VfaWQgPSBpdC0+ZmFj ZV9pZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8qIC0gIFdpdGhpbiB0aGUgcmVnaW9uLgor ICAgICAgICAgICAgICAgICAgICAgICAgICAgLSAgYHBoeXNfY3Vyc29yX2dseXBoYCBpcyBub24t TlVMTC4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gIE5vdCBhdCB0aGUgZW5kIG9mIHRo ZSBsaW5lLiAqLworICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoSVRfQ0hBUlBPUyAo Kml0KSA+PSByZWdpb25fYmVnaW5uaW5nCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBJVF9DSEFSUE9TICgqaXQpIDwgcmVnaW9uX2VuZAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgKCFJVEVSQVRPUl9BVF9FTkRfT0ZfTElORV9QIChpdCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBGRVRDSF9CWVRFIChJVF9CWVRFUE9TICgq aXQpKSAhPSAnXG4nKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcGh5c19j dXJzb3JfZ2x5cGggIT0gTlVMTCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcF9mYWNl X2lkID0gcHJldmlvdXNfZmFjZV9pZDsKKyAgICAgICAgICAgIH0KKyAgZG91YmxlIHJlZCA9IFhG TE9BVF9EQVRBIChBUkVGIChmb3JlZ3JvdW5kLCAwKSk7CisgIGRvdWJsZSBncmVlbiA9IFhGTE9B VF9EQVRBIChBUkVGIChmb3JlZ3JvdW5kLCAxKSk7CisgIGRvdWJsZSBibHVlID0gWEZMT0FUX0RB VEEgKEFSRUYgKGZvcmVncm91bmQsIDIpKTsKKyAgLyogU29tZSBvZiB0aGVzZSB2YWx1ZXMgY29t ZSB0aHJvdWdoIGFzIDEuMDAzOTA2LCB3aGljaCBjYXVzZXMgYSBicmVha2FnZQorICBvZiB0aGUg Y29sb3JzIGluIHRoYXQgbXVsdGlwbGljYXRpb24gYnkgdGhlIGJhc2Ugd2lsbCBleGNlZWQgdGhl IGJhc2UuICovCisgIGlmIChyZWQgPiAxLjApCisgICAgcmVkID0gMS4wOworICBpZiAoZ3JlZW4g PiAxLjApCisgICAgZ3JlZW4gPSAxLjA7CisgIGlmIChibHVlID4gMS4wKQorICAgIGJsdWUgPSAx LjA7CisgIGlmICghTklMUCAoQlZBUiAoY3VycmVudF9idWZmZXIsIG1jX3N0ZGVycikpKQorICAg IGZwcmludGYgKHN0ZGVyciwgIlxuXAorICAgIFZFUlRJQ0FMIFJVTEVSIC0tIFNQRUNTOlxuXAor ICAgIHggKCVkKVxuXAorICAgIHkgKCVkKVxuXAorICAgIGhwb3MgKCVkKVxuXAorICAgIHZwb3Mg KCVkKVxuXAorICAgIGZvcmVncm91bmQ6ICBSICglZikgfCBHICglZikgfCBCICglZilcblwKKyAg ICBiYWNrZ3JvdW5kICglcylcblwKKyAgICBmbGF2b3IgKCVzKVxuIiwKKyAgICBvcG9pbnRfeCwK KyAgICBpdC0+Y3VycmVudF95LAorICAgIHRlbXBfaHBvcywKKyAgICB2cG9zLAorICAgIHJlZCwg Z3JlZW4sIGJsdWUsCisgICAgU1NEQVRBIChtY19iZ19mYWNlIChpdC0+dywgdGVtcF9mYWNlX2lk KSksCisgICAgKEVRIChmbGF2b3IsIFFtY19nbHlwaCkKKyAgICAgID8gIlFtY19nbHlwaCIKKyAg ICAgIDogRVEgKGZsYXZvciwgUW1jX2dseXBoX3RhYikKKyAgICAgICAgPyAiUW1jX2dseXBoX3Rh YiIKKyAgICAgIDogRVEgKGZsYXZvciwgUW1jX2dseXBobGVzcykKKyAgICAgICAgPyAiUW1jX2ds eXBobGVzcyIKKyAgICAgIDogRVEgKGZsYXZvciwgUW1jX3ZlcnRpY2FsX2Jhcl9yaWdodF9hbmds ZSkKKyAgICAgICAgPyAiUW1jX3ZlcnRpY2FsX2Jhcl9yaWdodF9hbmdsZSIKKyAgICAgIDogRVEg KGZsYXZvciwgUW1jX3ZlcnRpY2FsX2Jhcl9iYWNrc2xhc2gpCisgICAgICAgID8gIlFtY192ZXJ0 aWNhbF9iYXJfYmFja3NsYXNoIgorICAgICAgOiBFUSAoZmxhdm9yLCBRbWNfdmVydGljYWxfYmFy KQorICAgICAgICA/ICJRbWNfdmVydGljYWxfYmFyIgorICAgICAgOiAiT09QUyIpKTsKKyAgICAg ICAgICBtY19jcm9zc2hhaXJzX2hlbHBlciAoaXQtPncsIG9wb2ludF94LCBpdC0+Y3VycmVudF95 LCB0ZW1wX2hwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZwb3MsIGN1cnNv cl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIG1jX2JnX2xzbCAoaXQtPncsIHRlbXBfZmFjZV9pZCksCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGZsYXZvciwgSVRfQ0hBUlBPUyAoKml0KSAtMSwgcmVzdWx0KTsK KyAgICAgICAgICByZXR1cm47CisgICAgICAgICAgLyogRG8gTk9UIHJlbW92ZSB0aGlzIGBicmVh a2AgdW5kZXIgYW55IGNpcmN1bXN0YW5jZXMhISEgIFdpdGhvdXQgdGhpcworICAgICAgICAgIGBi cmVha2AsIHRoZSBsb29wIGNvbnRpbnVlcyB1bnRpbCBgZmluYWxfbG9v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ICBnaG9zdF9vZl9jaHJpc3RtYXNfZnV0dXJlX2hwb3MgPSBpdC0+bG51bV9waXhlbF93aWR0 aCAvIGZvbnRfc3BhY2Vfd2lkdGg7CisgICAgICAgICAgZ2hvc3Rfb2ZfY2hyaXN0bWFzX2Z1dHVy ZV9mYWNlX2lkID0gcHJldmlvdXNfZmFjZV9pZDsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlm IChncmVlbl9saWdodF9wCisgICAgICAgICAgICAgICAgICYmIGdob3N0X29mX2NocmlzdG1hc19m dXR1cmVfcCkKKyAgICAgICAgICBnaG9zdF9vZl9jaHJpc3RtYXNfZnV0dXJlX3AgPSBmYWxzZTsK KyAgICAgIC8qIEBsYXdsaXN0IHByZXZpb3VzbHkgZW5jb3VudGVyZWQgYSBjcmFzaCB0aGF0IHdh cyBwcm9iYWJseSBjYXVzZWQgYnkKKyAgICAgIEZFVENIX0JZVEUgKElUX0JZVEVQT1MgKCppdCkg LSAxKSBub3QgZmluZGluZyBhbnl0aGluZyBhdCB0aGlzIGxvY2F0aW9uLiAqLworICAgICAgZmV0 Y2hfYnl0ZV9wcmV2aW91c19jaGFyYWN0ZXIgPSAoaXQtPmMgPiAwKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IEZFVENIX0JZVEUgKElUX0JZVEVQT1MgKCppdCkpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogMDsKKyAgICAgIHByZXZpb3Vz X2NoYXJhY3RlciA9IGl0LT5jOworICAgICAgcHJldmlvdXNfcHQgPSBJVF9DSEFSUE9TICgqaXQp OworICAgICAgcHJldmlvdXNfZmFjZV9pZCA9IGl0LT5mYWNlX2lkOworICAgICAgcHJldmlvdXNf cmVsYXRpdmVfeCA9IHJlbGF0aXZlX3g7CisgICAgICBpZiAoZ3JlZW5fbGlnaHRfcCkKKyAgICAg ICAgeworICAgICAgICAgIHNhdmVkX2N1cnJlbnRfeCA9IGl0LT5jdXJyZW50X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IHRvIGBjdXJyZW50LWxpbmVgIGFuZCB3ZSBhcmUgaG9y aXpvbnRhbCBzY3JvbGxpbmcKKyAgICAgIGEgbG9uZyBsaW5lIHRoYXQgYXBwcm9hY2hlcyBvciBl eGNlZWRzIGFuIGBpdC5jdXJyZW50LnhgIG9mIGFwcHJveGltYXRlbHkgMTAwMCwgYHJjYAorICAg ICAgd2lsbCBlcnJvbmVvdXNseSByZXR1cm4gZWFybHkgd2l0aCBhIE1PVkVfTElORV9UUlVOQ0FU RUQgaW5kaWNhdG9yICB3aXRob3V0IHB1c2hpbmcKKyAgICAgIGZvcndhcmRzIHVudGlsIElUIHJl YWNoZXMgdGhlIG5ld194LiAgQXMgYSB3b3JrYXJvdW5kLCBpZ25vcmUgTU9WRV9MSU5FX1RSVU5D QVRFRC4gKi8KKyAgICAgIGlmIChJVF9DSEFSUE9TICgqaXQpICE9IFpWCisgICAgICAgICAgLyog YElURVJBVE9SX0FUX0VORF9PRl9MSU5FX1BgIG1heSBiZSBgdHJ1ZWAgd2hlbiBJVCBpcyBhdCB0 aGUgYmVnaW5uaW5nIG9mIGEgbGluZS4gKi8KKyAgICAgICAgICAvKiAmJiAhSVRFUkFUT1JfQVRf RU5EX09GX0xJTkVfUCAoaXQpICovCisgICAgICAgICAgJiYgKEZFVENIX0JZVEUgKElUX0JZVEVQ T1MgKCppdCkpICE9ICdcbicKKyAgICAgICAgICAgICAgfHwgKEZFVENIX0JZVEUgKElUX0JZVEVQ T1MgKCppdCkpID09ICdcbicKKyAgICAgICAgICAgICAgICAgICYmIGl0LT5jID09IDApKQorICAg ICAgICAgICYmIGl0LT5jdXJyZW50X3ggKyBmb250X3NwYWNlX3dpZHRoIDw9IG5ld194CisgICAg ICAgICAgJiYgKHJjID09IE1PVkVfWF9SRUFDSEVECisgICAgICAgICAgICAgIHx8IHJjID09IE1P VkVfTElORV9UUlVOQ0FURUQKKyAgICAgICAgICAgICAgfHwgKGl0LT5saW5lX3dyYXAgPT0gV09S RF9XUkFQCisgICAgICAgICAgICAgICAgICAmJiByYyA9PSBNT1ZFX1BPU19NQVRDSF9PUl9aVikp KQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGl0IHNhdmVkX2l0OworICAgICAgICAgIHZv aWQgKnNhdmVkX2l0ZGF0YSA9IGJpZGlfc2hlbHZlX2NhY2hlICgpOworICAgICAgICAgIGludCBw cmV2X3g7CisgICAgICAgICAgU0FWRV9JVCAoc2F2ZWRfaXQsICppdCwgc2F2ZWRfaXRkYXRhKTsK KyAgICAgICAgICByYyA9IG1vdmVfaXRfaW5fZGlzcGxheV9saW5lX3RvIChpdCwgWlYsIG5ld194 LCBNT1ZFX1RPX1BPUyB8IE1PVkVfVE9fWCk7CisgICAgICAgICAgLyogV2hlbiB3b3JkLXdyYXAg aXMgb24sIFRPX1ggbWF5IGxpZSBwYXN0IHRoZSBlbmQgb2YgYSB3cmFwcGVkIGxpbmUuCisgICAg ICAgICAgVGhlbiBpdC0+Y3VycmVudCBpcyB0aGUgY2hhcmFjdGVyIG9uIHRoZSBuZXh0IGxpbmUs IHNvIGJhY2t0cmFjayB0byB0aGUKKyAgICAgICAgICBzcGFjZSBiZWZvcmUgdGhlIHdyYXAgcG9p bnQuICAqLworICAgICAgICAgIGlmIChpdC0+bGluZV93cmFwID09IFdPUkRfV1JBUAorICAgICAg ICAgICAgICAmJiByYyA9PSBNT1ZFX0xJTkVfQ09OVElOVUVEKQorICAgICAgICAgICAgeworICAg ICAgICAgICAgICBwcmV2X3ggPSBtYXggKGl0LT5jdXJyZW50X3ggLSAxLCAwKTsKKyAgICAgICAg ICAgICAgUkVTVE9SRV9JVCAoaXQsICZzYXZlZF9pdCwgc2F2ZWRfaXRkYXRhKTsKKyAgICAgICAg ICAgICAgbW92ZV9pdF9pbl9kaXNwbGF5X2xpbmVfdG8gKGl0LCAtMSwgcHJldl94LCBNT1ZFX1RP X1gpOworICAgICAgICAgICAgfQorICAgICAgICAgIC8qIFdvcmthcm91bmQgZm9yIGJ1ZyA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UIGZvciBwb3RlbnRpYWwgbGluZSBudW1iZXJzLiAqLworICBpZiAoIU5JTFAgKFZk aXNwbGF5X2xpbmVfbnVtYmVycykKKyAgICAgICYmICFFUSAoVmRpc3BsYXlfbGluZV9udW1iZXJz LCBRdmlzdWFsKSkKKyAgICB7CisgICAgICBpdC5maXJzdF92aXNpYmxlX3ggPSAwOworICAgICAg bW92ZV9pdF9ieV9saW5lcyAoJml0LCAxKTsKKyAgICAgIGxudW1fd2lkdGggPSBpdC5sbnVtX3dp ZHRoOworICAgICAgbG51bV9waXhlbF93aWR0aCA9IGl0LmxudW1fcGl4ZWxfd2lkdGg7CisgICAg ICBSRVNUT1JFX0lUICgmaXQsICZzYXZlZF9pdF9mb3Jfd2luZG93X3N0YXJ0LCBzYXZlZF9pdGRh dGFfZm9yX3dpbmRvd19zdGFydCk7CisgICAgICBpdC5maXJzdF92aXNpYmxlX3ggPSBmaXJzdF94 OworICAgICAgaXQubGFzdF92aXNpYmxlX3ggPSBsYXN0X3g7CisgICAgICBpdC5sbnVtX3dpZHRo ID0gbG51bV93aWR0aDsKKyAgICAgIGl0LmxudW1fcGl4ZWxfd2lkdGggPSBsbnVtX3BpeGVsX3dp ZHRoOworICAgICAgU0FWRV9JVCAoc2F2ZWRfaXRfZm9yX3dpbmRvd19zdGFydCwgaXQsIHNhdmVk X2l0ZGF0YV9mb3Jfd2luZG93X3N0YXJ0KTsKKyAgICB9CisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJFTU9WRSBHTFlQSCBDVVJTT1JTCisq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKyAgLyogUmVtb3ZlIHRoZSBjdXJzb3JzIHVzaW5nIHRo ZSBjYWNoZSBpZiB0aGUgY29uZGl0aW9ucyBhcmUgc2F0aXNmaWVkLiAqLworICBpZiAoKHJlbW92 ZSAmJiAhTklMUCAody0+bWNfZ2x5cGhfY2FjaGUpICYmIE5JTFAgKEJWQVIgKGIsIG1jX2dseXBo X2xpc3QpKSkKKyAgICAgIHx8ICghTklMUCAody0+bWNfZ2x5cGhfY2FjaGUpICYmICFOSUxQIChC VkFSIChiLCBtY19nbHlwaF9saXN0KSkgJiYgKHJlbW92ZSB8fCB3ICE9IHN3KSkpCisgICAgewor ICAgICAgLyogRXJhc2UgdGhlIHJlYWwgY3Vyc29yIHNvIHRoYXQgdGhlIHdob2xlIHZlcnRpY2Fs IGxpbmUgZ2V0cyByZW1vdmVkLCBub3QganVzdCB0aGUgZmFrZSBjdXJzb3JzLiAqLworICAgICAg bWNfZXJhc2VfZ2x5cGhfY3Vyc29yICh3LCB3LT5waHlzX2N1cnNvci54LCB3LT5waHlzX2N1cnNv ci55LCB3LT5waHlzX2N1cnNvci5ocG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3 LT5waHlzX2N1cnNvci52cG9zLCB3LT5waHlzX2N1cnNvcl90eXBlKTsKKyAgICAgIC8qIFByb2Nl c3MgdGhlIE1DX0dMWVBIX0NBQ0hFLiAqLworICAgICAgaWYgKCFOSUxQICh3LT5tY19nbHlwaF9j YWNoZSkpCisgICAgICAgIHsKKyAgICAgICAgICBmb3IgKHZsaXN0ID0gWENBUiAoWENEUiAody0+ bWNfZ2x5cGhfY2FjaGUpKTsKKyAgICAgICAgICAgICAgIENPTlNQICh2bGlzdCk7CisgICAgICAg ICAgICAgICB2bGlzdCA9IFhDRFIgKHZsaXN0KSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgdGVuX2VsZW1lbnRzID0gWENBUiAoWENEUiAoWENBUiAodmxpc3QpKSk7CisgICAgICAgICAg ICAgIHggPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMCksIHRlbl9lbGVtZW50cykpOworICAg ICAgICAgICAgICB5ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB0ZW5fZWxlbWVudHMp KTsKKyAgICAgICAgICAgICAgaHBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgdGVu X2VsZW1lbnRzKSk7CisgICAgICAgICAgICAgIHZwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJl ciAoMyksIHRlbl9lbGVtZW50cykpOworICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xp c3BfdG9fY3Vyc29yX3R5cGUgKEZudGggKG1ha2VfbnVtYmVyICg0KSwgdGVuX2VsZW1lbnRzKSk7 CisgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICg1 KSwgdGVuX2VsZW1lbnRzKSk7CisgICAgICAgICAgICAgIGZvcmVncm91bmQgPSBGbnRoIChtYWtl X251bWJlciAoNiksIHRlbl9lbGVtZW50cyk7CisgICAgICAgICAgICAgIGJhY2tncm91bmQgPSBG bnRoIChtYWtlX251bWJlciAoNyksIHRlbl9lbGVtZW50cyk7CisgICAgICAgICAgICAgIGZsYXZv ciA9IEZudGggKG1ha2VfbnVtYmVyICg4KSwgdGVuX2VsZW1lbnRzKTsKKyAgICAgICAgICAgICAg cG9zaW50ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDkpLCB0ZW5fZWxlbWVudHMpKTsKKyAg ICAgICAgICAgICAgaWYgKEVRIChmbGF2b3IsIFFtY19nbHlwaGxlc3MpKQorICAgICAgICAgICAg ICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCB4LCB5LCBocG9zLCB2cG9zLCBjdXJzb3JfdHlw ZSwgY3Vyc29yX3dpZHRoLCBiYWNrZ3JvdW5kLCBmbGF2b3IpOworICAgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICAgIG1jX2VyYXNlX2dseXBoX2N1cnNvciAodywgeCwgeSwgaHBv cywgdnBvcywgY3Vyc29yX3R5cGUpOworICAgICAgICAgICAgfQorICAgICAgICAgIGlmIChOSUxQ IChCVkFSIChiLCBtY19nbHlwaF9saXN0KSkpCisgICAgICAgICAgICB3c2V0X21jX2dseXBoX2Nh Y2hlICh3LCBRbmlsKTsKKyAgICAgICAgfQorICAgICAgdy0+bWMuZXJhc2VfZ2x5cGhfY3Vyc29y ID0gZmFsc2U7CisgICAgfQorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBSRURSQVcgR0xZUEggQ1VSU09SUworKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisgIC8qIElmIHRoZSBmaXJzdCBlbGVtZW50IG9mIHctPm1jX2dseXBoX2NhY2hlIGlz IHRoZSBzYW1lIGFzIHRoZSBsb2NhbCB2YXJpYWJsZSBtY19nbHlwaF9saXN0LAorICAgICBhbmQg dGhlIHByZXZpb3VzL2N1cnJlbnQgd2luZG93LXN0YXJ0L3dpbmRvdy1lbmQgYXJlIHRoZSBzYW1l IChlLmcuLCBubyBzY3JvbGxpbmcpLAorICAgICB0aGVuIHJlZHJhdyB0aGUgY3Vyc29ycyB1c2lu ZyB0aGUgY2FjaGUuICBUaGlzIGF2b2lkcyByZWNhbGN1bGF0aW5nIGNvb3JkaW5hdGVzLiAqLwor ICBpZiAoIXJlbW92ZQorICAgICAgJiYgdyA9PSBzdworICAgICAgJiYgdy0+bWMuY3VycmVudF9z dGFydAorICAgICAgJiYgdy0+bWMuY3VycmVudF9lbmQKKyAgICAgICYmIHctPm1jLnByZXZpb3Vz X3N0YXJ0CisgICAgICAmJiB3LT5tYy5wcmV2aW91c19lbmQKKyAgICAgICYmIHctPm1jLmN1cnJl bnRfc3RhcnQgPT0gdy0+bWMucHJldmlvdXNfc3RhcnQKKyAgICAgICYmIHctPm1jLmN1cnJlbnRf ZW5kID09IHctPm1jLnByZXZpb3VzX2VuZAorICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIG1jX2ds eXBoX2xpc3QpKQorICAgICAgJiYgIU5JTFAgKHctPm1jX2dseXBoX2NhY2hlKQorICAgICAgJiYg IU5JTFAgKEZlcXVhbCAoRm50aCAobWFrZV9udW1iZXIgKDApLCB3LT5tY19nbHlwaF9jYWNoZSks IEJWQVIgKGIsIG1jX2dseXBoX2xpc3QpKSkpCisgICAgeworICAgICAgZm9yICh2bGlzdCA9IFhD QVIgKFhDRFIgKHctPm1jX2dseXBoX2NhY2hlKSk7CisgICAgICAgICAgIENPTlNQICh2bGlzdCk7 CisgICAgICAgICAgIHZsaXN0ID0gWENEUiAodmxpc3QpKQorICAgICAgICB7CisgICAgICAgICAg dGVuX2VsZW1lbnRzID0gWENBUiAoWENEUiAoWENBUiAodmxpc3QpKSk7CisgICAgICAgICAgeCA9 IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgwKSwgdGVuX2VsZW1lbnRzKSk7CisgICAgICAgICAg eSA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgxKSwgdGVuX2VsZW1lbnRzKSk7CisgICAgICAg ICAgaHBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgdGVuX2VsZW1lbnRzKSk7Cisg ICAgICAgICAgdnBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgzKSwgdGVuX2VsZW1lbnRz KSk7CisgICAgICAgICAgY3Vyc29yX3R5cGUgPSBtY19saXNwX3RvX2N1cnNvcl90eXBlIChGbnRo IChtYWtlX251bWJlciAoNCksIHRlbl9lbGVtZW50cykpOworICAgICAgICAgIGN1cnNvcl93aWR0 aCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICg1KSwgdGVuX2VsZW1lbnRzKSk7CisgICAgICAg ICAgZm9yZWdyb3VuZCA9IEZudGggKG1ha2VfbnVtYmVyICg2KSwgdGVuX2VsZW1lbnRzKTsKKyAg ICAgICAgICBiYWNrZ3JvdW5kID0gRm50aCAobWFrZV9udW1iZXIgKDcpLCB0ZW5fZWxlbWVudHMp OworICAgICAgICAgIGZsYXZvciA9IEZudGggKG1ha2VfbnVtYmVyICg4KSwgdGVuX2VsZW1lbnRz KTsKKyAgICAgICAgICBwb3NpbnQgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoOSksIHRlbl9l bGVtZW50cykpOworICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCB4LCB5LCBocG9z LCB2cG9zLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBRbWNfZ2x5cGgp OworICAgICAgICB9CisgICAgICB3LT5tYy5kcmF3X2dseXBoX2N1cnNvciA9IGZhbHNlOworICAg IH0KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBEUkFXIEdMWVBIIENVUlNPUlMgQU5FVworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisgICAg LyogRHJhdyB0aGUgY3Vyc29ycyBhbmV3IGJlY2F1c2Ugc29tZXRoaW5nIGhhcyBjaGFuZ2VkLCBl LmcuLCB0aGUgZmlyc3QgZWxlbWVudCBvZgorICAgICAgIHctPm1jX2dseXBoX2NhY2hlIGlzIE5P VCB0aGUgc2FtZSBhcyB0aGUgbG9jYWwgdmFyaWFibGUgbWNfZ2x5cGhfbGlzdDsgYW5kL29yLCB0 aGUgcHJldmlvdXMvCisgICAgICAgY3VycmVudCB3aW5kb3ctc3RhcnQvd2luZG93LWVuZCBhcmUg Tk9UIHRoZSBzYW1lIChlLmcuLCBzY3JvbGxpbmcgaGFzIG9jY3VycmVkKS4KKyAgICAgICBTZW1p LWV4cGVuc2l2ZSBjYWxjdWxhdGlvbiBvZiBjb29yZGluYXRlcyBpcyByZXF1aXJlZC4gKi8KKyAg ICBlbHNlIGlmICghcmVtb3ZlCisgICAgICAgICAgICAgJiYgdyA9PSBzdworICAgICAgICAgICAg ICYmIHctPm1jLmN1cnJlbnRfc3RhcnQKKyAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwg bWNfZ2x5cGhfbGlzdCkpKQorICAgICAgeworICAgICAgICBmb3IgKHZsaXN0ID0gQlZBUiAoYiwg bWNfZ2x5cGhfbGlzdCk7CisgICAgICAgICAgICAgQ09OU1AgKHZsaXN0KTsKKyAgICAgICAgICAg ICB2bGlzdCA9IFhDRFIgKHZsaXN0KSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBzcGVjcyA9 IFhDQVIgKHZsaXN0KTsKKyAgICAgICAgICAgIHBvc2ludCA9IFhJTlQgKEZudGggKG1ha2VfbnVt YmVyICgwKSwgc3BlY3MpKTsKKyAgICAgICAgICAgIGxpc3BfdHlwZSA9IEZudGggKG1ha2VfbnVt YmVyICgxKSwgc3BlY3MpOworICAgICAgICAgICAgaWYgKENPTlNQIChsaXNwX3R5cGUpKQorICAg ICAgICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKFhDQVIgKGxp c3BfdHlwZSkpOworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgY3Vyc29yX3R5 cGUgPSBtY19saXNwX3RvX2N1cnNvcl90eXBlIChsaXNwX3R5cGUpOworICAgICAgICAgICAgaWYg KENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSBYSU5UIChY Q0FSIChYQ0RSIChsaXNwX3R5cGUpKSk7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICBjdXJzb3Jfd2lkdGggPSAxOworICAgICAgICAgICAgZm9yZWdyb3VuZCA9IEZudGggKG1h a2VfbnVtYmVyICgyKSwgc3BlY3MpOworICAgICAgICAgICAgaWYgKFNUUklOR1AgKGZvcmVncm91 bmQpKQorICAgICAgICAgICAgICBmb3JlZ3JvdW5kID0gbWNfY29sb3JfdmVjdG9yX2NhbGMgKHcs IGZvcmVncm91bmQpOworICAgICAgICAgICAgUkVTVE9SRV9JVCAoJml0LCAmc2F2ZWRfaXRfZm9y X3dpbmRvd19zdGFydCwgc2F2ZWRfaXRkYXRhX2Zvcl93aW5kb3dfc3RhcnQpOworICAgICAgICAg ICAgbW92ZV9pdF90byAoJml0LCBwb3NpbnQsIGl0Lmxhc3RfdmlzaWJsZV94LCBpdC5sYXN0X3Zp c2libGVfeSAtIDEsIC0xLAorICAgICAgICAgICAgICAgICAgICAgICAgTU9WRV9UT19QT1MgfCBN T1ZFX1RPX1ggfCBNT1ZFX1RPX1kpOworICAgICAgICAgICAgaWYgKElUX0NIQVJQT1MgKGl0KSA9 PSBwb3NpbnQpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBtb3ZlX2l0X2J5X2xp bmVzICgmaXQsIDApOworICAgICAgICAgICAgICAgIG1jX21vdmVfaXQgKCZpdCwgTVVMVElQTEVf Q1VSU09SUywgc3BlY3MsICZyZXN1bHQpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICB4ID0gLTE7CisgICAg ICAgICAgICAgICAgICB5ID0gLTE7CisgICAgICAgICAgICAgICAgICBocG9zID0gLTE7CisgICAg ICAgICAgICAgICAgICB2cG9zID0gLTE7CisgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kID0g bWNfYmdfbHNsIChpdC53LCBERUZBVUxUX0ZBQ0VfSUQpOworICAgICAgICAgICAgICAgICAgZmxh dm9yID0gUW1jX2dseXBoOworICAgICAgICAgICAgICAgICAgdGVuX2VsZW1lbnRzID0gbGlzdG4g KENPTlNUWVBFX0hFQVAsIDEwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBtYWtlX251bWJlciAoeCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIG1ha2VfbnVtYmVyICh5KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgbWFrZV9udW1iZXIgKGhwb3MpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBtYWtlX251bWJlciAodnBvcyksCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIG1jX2N1cnNvcl90eXBlX3RvX2xpc3AgKGN1cnNvcl90eXBlKSwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFrZV9udW1iZXIgKGN1 cnNvcl93aWR0aCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZv cmVncm91bmQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tn cm91bmQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsYXZvciwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFrZV9udW1iZXIgKHBv c2ludCkpOworICAgICAgICAgICAgICAgICAgdGVtcCA9IEZjb25zIChzcGVjcywgRmNvbnMgKHRl bl9lbGVtZW50cywgUW5pbCkpOworICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gRmNvbnMgKHRl bXAsIHJlc3VsdCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKy8qIGB3LT5tY19n bHlwaF9jYWNoZScgaXMgc2V0IGZvciB0aGUgd2luZG93LCBub3QgYnVmZmVyK3dpbmRvdyAtLSBp LmUuLCBhbGwgYnVmZmVycyBhcHBlYXJpbmcKK2luIHRoZSBzYW1lIHdpbmRvdyB2aWEgYHN3aXRj aC10by1idWZmZXInIHdpbGwgaGF2ZSBgdy0+bWNfZ2x5cGhfY2FjaGUnLiAgVGhpcyBiZWhhdmlv cgoraXMgY29uc2lzdGVudCB3aXRoIGZ1bmN0aW9ucyBzdWNoIGFzIGBzZXQtd2luZG93LWRpc3Bs YXktdGFibGUnLiAgV2UgZGVhbCB3aXRoIHRoaXMgaW4KK2Buc3Rlcm0ubScgLyBgdzMydGVybS5j JyAvIGB4dGVybS5jJyBieSBjb21wYXJpbmcgYHctPmNvbnRlbnRzJyB0byB0aGUgdmFsdWUgb2Yg dGhlIGBidWYnCitzdG9yZWQgaW4gYHctPm1jX2dseXBoX2NhY2hlJzogIChFUSAody0+Y29udGVu dHMsIFhDQVIgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgdy0+bWNfZ2x5cGhfY2FjaGUpKSkpICov CisgICAgICAgIGlmICghTklMUCAocmVzdWx0KSkKKyAgICAgICAgICB3c2V0X21jX2dseXBoX2Nh Y2hlICh3LCBsaXN0biAoQ09OU1RZUEVfSEVBUCwgMywKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBCVkFSIChiLCBtY19nbHlwaF9saXN0KSwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBGcmV2ZXJzZSAocmVzdWx0KSwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBGY29ucyAoYnVmLCBRbmlsKSkpOworICAgICAgICB3LT5tYy5k cmF3X2dseXBoX2N1cnNvciA9IGZhbHNlOworICAgICAgfQorICBiaWRpX3Vuc2hlbHZlX2NhY2hl IChpdGRhdGEsIGZhbHNlKTsKK30KKwordm9pZAorbWNfZHJhd19jcm9zc2hhaXJzIChzdHJ1Y3Qg d2luZG93ICp3KQoreworICAvKiBFbGkgWi46ICBUaGlzIGRvZXNuJ3QgZmVlbCByZWxldmFudC4g IFlvdSBjYW4gYWx3YXlzIHJlZGlzcGxheSBhIHdpbmRvdyB0aGF0IGl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HdpbmRv dyBuZWVkcyB0byBiZQorICByZWRpc3BsYXllZC4gIEFnYWluLCBJJ20gbm90IHN1cmUgSSB1bmRl cnN0YW5kIGhvdyBkbyB5b3UgZ2V0IGludG8gdGhpcyBzaXR1YXRpb24KKyAgaW4gdGhlIG1pZGRs ZSBvZiByZWRpc3BsYXkuICovCisgIGJvb2wgYmFyZl9jcmFzaF9vbmUgPSAoY2hhcnBvcyA+PSBC RUdWICYmIGNoYXJwb3MgPD0gWlYpID8gZmFsc2UgOiB0cnVlOworICBpZiAoYmFyZl9jcmFzaF9v bmUpCisgICAgcmV0dXJuOworICAvKiBFbGkgWi46ICBMaWtld2lzZS4gIE1hcmtlcnMgYXJlIHVw ZGF0ZWQgd2hlbiBhIGJ1ZmZlciBpcyBtb2RpZmllZCwgc28gdGhpcworICBzaG91bGQgbmV2ZXIg aGFwcGVuLiAqLworICBib29sIGJhcmZfY3Jhc2hfdHdvID0gKGNoYXJwb3MgPT0gQllURV9UT19D SEFSIChieXRlcG9zKSkgPyBmYWxzZSA6IHRydWU7CisgIGlmIChiYXJmX2NyYXNoX3R3bykKKyAg ICByZXR1cm47CisgIGlmICghQlVGRkVSUCAoYnVmKSkKKyAgICByZXR1cm47CisgIGlmIChOSUxQ IChCVkFSIChiLCBjcm9zc2hhaXJzKSkpCisgICAgcmV0dXJuOworICBpZiAoTklMUCAoQlZBUiAo YiwgY3Jvc3NoYWlyc19ob3Jpem9udGFsX3J1bGVyKSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKGIs IGNyb3NzaGFpcnNfdmVydGljYWxfcnVsZXIpKSkKKyAgICByZXR1cm47CisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNUQVJUIFRIRSBUSU1F UgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKgorI2lmZGVmIEdMWVBIX0RFQlVHCisgIGNs b2NrX3Qgc3RhcnQsIGVuZDsKKyAgZG91YmxlIGNwdV90aW1lX3VzZWQ7CisgIGNoYXIgYnVmX3Rp bWVbREJMX0JVRlNJWkVfQk9VTkRdOworICBzdGFydCA9IGNsb2NrKCk7CisjZW5kaWYKKyovCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJF R0lOIEpPVVJORVkgLi4uCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAgc3RydWN0IGl0IGl0 OworICB2b2lkICppdGRhdGEgPSBiaWRpX3NoZWx2ZV9jYWNoZSAoKTsKKyAgc3RydWN0IGl0IHNh dmVkX2l0X2Zvcl93aW5kb3dfc3RhcnQ7CisgIHZvaWQgKnNhdmVkX2l0ZGF0YV9mb3Jfd2luZG93 X3N0YXJ0ID0gTlVMTDsKKyAgc3RydWN0IGl0IHNhdmVkX2l0X2Zvcl9ob3Jpem9udGFsX3J1bGVy OworICB2b2lkICpzYXZlZF9pdGRhdGFfZm9yX2hvcml6b250YWxfcnVsZXIgPSBOVUxMOworICBz dHJ1Y3QgdGV4dF9wb3Mgc3RhcnRfdGV4dF9wb3NpdGlvbjsKKyAgcHRyZGlmZl90IGl0X3N0YXJ0 OworICBpbnQgZmlyc3RfeCwgbGFzdF94OworICBpbnQgbG51bV93aWR0aCA9IDA7CisgIGludCBs bnVtX3BpeGVsX3dpZHRoID0gMDsKKyAgaW50IGZyYW1lX2NoYXJfd2lkdGggPSBGUkFNRV9DT0xV TU5fV0lEVEggKGYpOworICBpbnQgdGV4dF9hcmVhX3dpZHRoID0gd2luZG93X2JveF93aWR0aCA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QgZmFjZV9pZDsKKyAgc3RydWN0IGdseXBoICpwaHlzX2N1cnNv cl9nbHlwaDsKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBDT0xPUiBPRiBDUk9TU0hBSVJTCisqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAg ZW51bSBmYWNlX2lkIGV2ZW5fZmFjZV9pZCA9CisgICAgbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYs IGludGVybiAoIistZXZlbi1udW1iZXJlZC1jb2x1bW4tZmFjZSIpLCB0cnVlKTsKKyAgc3RydWN0 IGZhY2UgKmV2ZW5fZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgZXZlbl9mYWNlX2lkKTsKKyAgTGlz cF9PYmplY3QgZXZlbl9jb2xvciA9IGV2ZW5fZmFjZS0+bGZhY2VbTEZBQ0VfRk9SRUdST1VORF9J TkRFWF07CisgIENIRUNLX1NUUklORyAoZXZlbl9jb2xvcik7CisgIExpc3BfT2JqZWN0IGV2ZW5f Y29sb3JfdmVjdG9yID0gbWNfY29sb3JfdmVjdG9yX2NhbGMgKHcsIGV2ZW5fY29sb3IpOworICBl bnVtIGZhY2VfaWQgb2RkX2ZhY2VfaWQgPQorICAgIGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBp bnRlcm4gKCIrLW9kZC1udW1iZXJlZC1jb2x1bW4tZmFjZSIpLCB0cnVlKTsKKyAgc3RydWN0IGZh Y2UgKm9kZF9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBvZGRfZmFjZV9pZCk7CisgIExpc3BfT2Jq ZWN0IG9kZF9jb2xvciA9IG9kZF9mYWNlLT5sZmFjZVtMRkFDRV9GT1JFR1JPVU5EX0lOREVYXTsK KyA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iA9PSAwCisgICAgICAmJiBmaWxsX2NvbHVtbl9wCisg ICAgICAmJiBjdXJyZW50X2NvbCA8PSBmaWxsX2NvbCkKKyAgICBmb3JlZ3JvdW5kID0gZXZlbl9j b2xvcl92ZWN0b3I7CisgIC8qIGdyZWVuICovCisgIGlmIChmaWxsX2NvbHVtbl9wCisgICAgICAm JiBjdXJyZW50X2NvbCA+IGZpbGxfY29sKQorICAgIGZvcmVncm91bmQgPSBmaWxsX2NvbG9yX3Zl Y3RvcjsKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgIFNU QVJUIERJU1BMQVkgQU5EIFBSSU1FIElUCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAgLyog QmVnaW4gdGhlIGpvdXJuZXkgYXQgdy0+c3RhcnQuICovCisgIFNFVF9URVhUX1BPU19GUk9NX01B UktFUiAoc3RhcnRfdGV4dF9wb3NpdGlvbiwgdy0+c3RhcnQpOworICBzdGFydF9kaXNwbGF5ICgm aXQsIHcsIHN0YXJ0X3RleHRfcG9zaXRpb24pOworICBmaXJzdF94ID0gaXQuZmlyc3RfdmlzaWJs ZV94OworICBsYXN0X3ggPSBpdC5sYXN0X3Zpc2libGVfeDsKKyAgaXRfc3RhcnQgPSBJVF9DSEFS UE9TIChpdCk7CisgIFNBVkVfSVQgKHNhdmVkX2l0X2Zvcl93aW5kb3dfc3RhcnQsIGl0LCBzYXZl ZF9pdGRhdGFfZm9yX3dpbmRvd19zdGFydCk7CisgIC8qIEZpbmlzaCBwcmltaW5nIHRoZSBJVCBm b3IgcG90ZW50aWFsIGxpbmUgbnVtYmVycy4gKi8KKyAgaWYgKCFOSUxQIChWZGlzcGxheV9saW5l X251bWJlcnMpCisgICAgICAmJiAhRVEgKFZkaXNwbGF5X2xpbmVfbnVtYmVycywgUXZpc3VhbCkp CisgICAgeworICAgICAgaXQuZmlyc3RfdmlzaWJsZV94ID0gMDsKKyAgICAgIG1vdmVfaXRfYnlf bGluZXMgKCZpdCwgMSk7CisgICAgICBsbnVtX3dpZHRoID0gaXQubG51bV93aWR0aDsKKyAgICAg IGxudW1fcGl4ZWxfd2lkdGggPSBpdC5sbnVtX3BpeGVsX3dpZHRoOworICAgICAgUkVTVE9SRV9J VCAoJml0LCAmc2F2ZWRfaXRfZm9yX3dpbmRvd19zdGFydCwgc2F2ZWRfaXRkYXRhX2Zvcl93aW5k b3dfc3RhcnQpOworICAgICAgaXQuZmlyc3RfdmlzaWJsZV94ID0gZmlyc3RfeDsKKyAgICAgIGl0 Lmxhc3RfdmlzaWJsZV94ID0gbGFzdF94OworICAgICAgaXQubG51bV93aWR0aCA9IGxudW1fd2lk dGg7CisgICAgICBpdC5sbnVtX3BpeGVsX3dpZHRoID0gbG51bV9waXhlbF93aWR0aDsKKyAgICAg IFNBVkVfSVQgKHNhdmVkX2l0X2Zvcl93aW5kb3dfc3RhcnQsIGl0LCBzYXZlZF9pdGRhdGFfZm9y X3dpbmRvd19zdGFydCk7CisgICAgfQorICAvKiBUaGlzIG1pZ2h0IGhhcHBlbiBvbiBPU1ggMTAu MTEgd2hlbiByZXN0b3JpbmcgZGVza3RvcCBhdCB0aGUgYmVnaW5uaW5nCisgIG9mIGEgbmV3IHNl c3Npb24/ICovCisgIGlmIChpdF9zdGFydCA+IG9wb2ludF9wdCkKKyAgICByZXR1cm47CisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIEVSQVNFIFRI RSBSRUFMIENVUlNPUgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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XJzb3IueC95L2hwb3MvdnBvc2AKK2JlY2F1c2UgdGhv c2UgY29vcmRpbmF0ZXMgYXJlIGNvcnJlY3QuICBXZSBmaXggYHctPnBoeXNfY3Vyc29yLngveS9o cG9zL3Zwb3NgCitCRUZPUkUgY2FsbGluZyBgZXJhc2VfcGh5c19jdXJzb3InIHNvIHRoYXQgb3Ro ZXIgZ29vZGllcyBhcmUgdXBkYXRlZC4gKi8KKyAgdy0+cGh5c19jdXJzb3IueCA9IG9wb2ludF94 OworICB3LT5waHlzX2N1cnNvci55ID0gb3BvaW50X3k7CisgIHctPnBoeXNfY3Vyc29yLmhwb3Mg PSBvcG9pbnRfaHBvczsKKyAgdy0+cGh5c19jdXJzb3IudnBvcyA9IG9wb2ludF92cG9zOworICBl cmFzZV9waHlzX2N1cnNvciAodyk7CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgUkVQTEFDRSBUSEUgUkVBTCBDVVJTT1IKKyoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworICBnbHlwaF9yb3cgPSBNQVRSSVhfUk9XICh3LT5jdXJyZW50X21hdHJpeCwg b3BvaW50X3Zwb3MpOworICBpZiAoIWN1cnNvcl9pbl9mcmluZ2VfcCkKKyAgICBmbGF2b3IgPSBR bWNfZ2x5cGg7CisgICAgLyogVGhpcyBjb25kaXRpb24gcHJvYmFibHkgZG9lcyBub3QgZXhpc3Qg Zm9yIHRoZSByZWFsIGZha2UgY3Vyc29yLiAqLworICAgIGVsc2UgaWYgKGN1cnNvcl9pbl9mcmlu Z2VfcAorICAgICAgICAgICAgICYmIGdseXBoX3Jvdy0+Y29udGludWVkX3ApCisgICAgICBmbGF2 b3IgPSBRbWNfcGlsY3JvdzsKKyAgICAgIGVsc2UgaWYgKGN1cnNvcl9pbl9mcmluZ2VfcAorICAg ICAgICAgICAgICAgJiYgZ2x5cGhfcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAg Zmxhdm9yID0gUW1jX2hvbGxvd19yZWN0YW5nbGVfcmlnaHRfYW5nbGU7CisgICAgICAgIGVsc2Ug aWYgKGN1cnNvcl9pbl9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAmJiAhZ2x5cGhfcm93LT5j b250aW51ZWRfcAorICAgICAgICAgICAgICAgICAmJiAhZ2x5cGhfcm93LT50cnVuY2F0ZWRfb25f cmlnaHRfcCkKKyAgICAgICAgICBmbGF2b3IgPSBRbWNfaG9sbG93X3JlY3RhbmdsZTsKKyAgZmFj ZV9pZCA9ICgocGh5c19jdXJzb3JfZ2x5cGggPSBnZXRfcGh5c19jdXJzb3JfZ2x5cGggKHcpKSA9 PSBOVUxMKQorICAgICAgICAgICAgICA/IERFRkFVTFRfRkFDRV9JRAorICAgICAgICAgICAgICA6 IHBoeXNfY3Vyc29yX2dseXBoLT5mYWNlX2lkOworICBtY19jcm9zc2hhaXJzX2hlbHBlciAodywg b3BvaW50X3gsIG9wb2ludF95LCBvcG9pbnRfaHBvcywgb3BvaW50X3Zwb3MsCisgICAgICAgICAg ICAgICAgICAgICAgICBIT0xMT1dfQk9YX0NVUlNPUiwgY3Vyc29yX3dpZHRoLAorICAgICAgICAg ICAgICAgICAgICAgICAgZm9yZWdyb3VuZCwgbWNfYmdfbHNsICh3LCBmYWNlX2lkKSwKKyAgICAg ICAgICAgICAgICAgICAgICAgIGZsYXZvciwgb3BvaW50X3B0LCAmcmVzdWx0KTsKKyAgbWNfY3Jv c3NoYWlyc19oZWxwZXIgKHcsIG9wb2ludF94LCBvcG9pbnRfeSwgb3BvaW50X2hwb3MsIG9wb2lu dF92cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgSE9MTE9XX0JPWF9DVVJTT1IsIGN1cnNv cl93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQsIG1jX2JnX2xzbCAo dywgZmFjZV9pZCksCisgICAgICAgICAgICAgICAgICAgICAgICBRb3ZlcmxheV9hcnJvd19iaXRt YXAsIG9wb2ludF9wdCwgJnJlc3VsdCk7CisgIGlmIChOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJz X2hvcml6b250YWxfcnVsZXIpKSkKKyAgICBnb3RvIHZlcnRpY2FsX3J1bGVyOworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgSE9SSVpPTlRBTCBSVUxFUjogIEZJUlNU IFggPT4gRU9MCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuZAorICAgICAgIEhP UklaT05UQUwgUlVMRVI6ICBEUkFXIEZMT0FUSU5HIEdMWVBITEVTUyBMSU5FIChFT0wgVE8gRlJJ TkdFKQorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisgIC8qIFBsYWNlIHRoZSBJVCBvbiB0aGUg Y3VycmVudCBsaW5lIGNvbnRhaW5pbmcgUFQuICovCisgIGludCB2b2Zmc2V0ID0gKGhlYWRlcl9s aW5lX2hlaWdodCA+IDAKKyAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3Zwb3MgPiAwKQorICAg ICAgICAgICAgICAgICAgPyBvcG9pbnRfdnBvcyAtIDEKKyAgICAgICAgICAgICAgICAgIDogb3Bv aW50X3Zwb3M7CisgIGlmICh2b2Zmc2V0ID4gMCkKKyAgICBtb3ZlX2l0X2J5X2xpbmVzICgmaXQs IHZvZmZzZXQpOworICBtY19tb3ZlX2l0ICgmaXQsIEhPUklaT05UQUxfUlVMRVIsIGZvcmVncm91 bmQsICZyZXN1bHQpOworLyogKioqKioqKioqKioqKioqKioqKioqKioqK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gYG1jX21vdmVfaXQnIGhhcyBiZWVuCisgICAgICBlcXVpcHBl ZCB3aXRoIGEgY29uZGl0aW9uIHRvIHRlc3QgZm9yIFpWIGF0IHRoZSBvdXRzZXQgYW5kIHJldHVy biBpZiB0cnVlLAorICAgICAgd2hpY2ggcHJldmVudHMgRW1hY3MgZnJvbSBjcmFzaGluZy4gKi8K KyAgICAgIGlmIChJVF9DSEFSUE9TIChpdCkgPT0gWlYpCisgICAgICAgIGJyZWFrOworICAgICAg bW92ZV9pdF9ieV9saW5lcyAoJml0LCAxKTsKKyAgICAgIGlmIChpdC5jdXJyZW50X3kgPj0gaXQu bGFzdF92aXNpYmxlX3kpCisgICAgICAgIGJyZWFrOworICAgIH0KKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTRVQgVEhFIENBQ0hFCisq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKyAgY3Jvc3NoYWlyc19maW5pc2g6CisgIGlmICghTklM UCAocmVzdWx0KSkKKyAgICB3c2V0X2Nyb3NzaGFpcnNfY2FjaGUgKHcsIGxpc3RuIChDT05TVFlQ RV9IRUFQLCAzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZyZXZlcnNl IChyZXN1bHQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZjb25zIChz ZWxlY3RlZF93aW5kb3csIFFuaWwpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIEZjb25zIChidWYsIFFuaWwpKSk7CisgIHctPm1jLmRyYXdfY3Jvc3NoYWlycyA9IGZhbHNl OworICBiaWRpX3Vuc2hlbHZlX2NhY2hlIChpdGRhdGEsIGZhbHNlKTsKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTVE9QIFRIRSBUSU1F UgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKgorI2lmZGVmIEdMWVBIX0RFQlVHCisgIGVu ZCA9IGNsb2NrKCk7CisgIGNwdV90aW1lX3VzZWQgPSAoKGRvdWJsZSkgKGVuZCAtIHN0YXJ0KSkg LyBDTE9DS1NfUEVSX1NFQzsKKyAgZHRvYXN0ciAoYnVmX3RpbWUsIHNpemVvZiBidWZfdGltZSwg MCwgMCwgY3B1X3RpbWVfdXNlZCk7CisgIGRlYnVnX21ldGhvZF9hZGQgKHcsICJtY19kcmF3X2Ny b3NzaGFpcnM6ICBUSU1FICglcykiLCBidWZfdGltZSk7CisjZW5kaWYKKyovCit9dm9pZAorCitt Y19yZWRyYXdfY3Jvc3NoYWlycyAoc3RydWN0IHdpbmRvdyAqdykKK3sKKy8qCisjaWZkZWYgR0xZ UEhfREVCVUcKKyAgY2xvY2tfdCBzdGFydCwgZW5kOworICBkb3VibGUgY3B1X3RpbWVfdXNlZDsK KyAgY2hhciBidWZfdGltZVtEQkxfQlVGU0laRV9CT1VORF07CisgIHN0YXJ0ID0gY2xvY2soKTsK KyNlbmRpZgorKi8KKyAgTGlzcF9PYmplY3Qgdmxpc3QgPSBRbmlsOworICBMaXNwX09iamVjdCB0 ZW5fZWxlbWVudHMgPSBRbmlsOworICBpbnQgeCwgeSwgaHBvcywgdnBvczsKKyAgZW51bSB0ZXh0 X2N1cnNvcl9raW5kcyBjdXJzb3JfdHlwZTsKKyAgaW50IGN1cnNvcl93aWR0aDsKKyAgTGlzcF9P YmplY3QgZm9yZWdyb3VuZCA9IFFuaWw7CisgIExpc3BfT2JqZWN0IGJhY2tncm91bmQgPSBRbmls OworICBMaXNwX09iamVjdCBmbGF2b3IgPSBRbmlsOworICBwdHJkaWZmX3QgcG9zOworICBmb3Ig KHZsaXN0ID0gWENBUiAody0+Y3Jvc3NoYWlyc19jYWNoZSk7CisgICAgICAgQ09OU1AgKHZsaXN0 KTsKKyAgICAgICB2bGlzdCA9IFhDRFIgKHZsaXN0KSkKKyAgICB7CisgICAgICB0ZW5fZWxlbWVu dHMgPSBYQ0FSICh2bGlzdCk7CisgICAgICB4ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDAp LCB0ZW5fZWxlbWVudHMpKTsKKyAgICAgIHkgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMSks IHRlbl9lbGVtZW50cykpOworICAgICAgaHBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgy KSwgdGVuX2VsZW1lbnRzKSk7CisgICAgICB2cG9zID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIg KDMpLCB0ZW5fZWxlbWVudHMpKTsKKyAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJz b3JfdHlwZSAoRm50aCAobWFrZV9udW1iZXIgKDQpLCB0ZW5fZWxlbWVudHMpKTsKKyAgICAgIGN1 cnNvcl93aWR0aCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICg1KSwgdGVuX2VsZW1lbnRzKSk7 CisgICAgICBmb3JlZ3JvdW5kID0gRm50aCAobWFrZV9udW1iZXIgKDYpLCB0ZW5fZWxlbWVudHMp OworICAgICAgYmFja2dyb3VuZCA9IEZudGggKG1ha2VfbnVtYmVyICg3KSwgdGVuX2VsZW1lbnRz KTsKKyAgICAgIGZsYXZvciA9IEZudGggKG1ha2VfbnVtYmVyICg4KSwgdGVuX2VsZW1lbnRzKTsK KyAgICAgIHBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICg5KSwgdGVuX2VsZW1lbnRzKSk7 CisgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodyw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yogRGVwZW5kaW5nIHVwb24g dGhlIGRpcmVjdGlvbiBvZiBtb3ZlbWVudCBhbmQgZGlzdGFuY2UgZnJvbSB0aGUgcmVhbCBjdXJz b3IgdGhlIGN1cnJlbnQgY29tbWFuZAorICB0YWtlcyB1cywgdGhlIHByZXZpb3VzIHJlYWwgY3Vy c29yIHdpbGwgYmUgbGVmdCBiZWhpbmQuICBJIHRyaWVkIHJlc3RvcmluZyBwb2ludCBhZnRlciBk cmF3L2VyYXNlLAorICBidXQgdGhhdCBkaWRuJ3QgZml4IHRoZSBpc3N1ZS4gIFNvIGZvciBub3cs IHdlIGp1c3QgZXJhc2UgdGhlIHJlYWwgY3Vyc29yLiAqLworICBtY19lcmFzZV9nbHlwaF9jdXJz b3IgKHcsIHctPnBoeXNfY3Vyc29yLngsIHctPnBoeXNfY3Vyc29yLnksIHctPnBoeXNfY3Vyc29y Lmhwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgdy0+cGh5c19jdXJzb3IudnBvcywgdy0+ cGh5c19jdXJzb3JfdHlwZSk7CisgIGZvciAodmxpc3QgPSBYQ0FSICh3LT5jcm9zc2hhaXJzX2Nh Y2hlKTsKKyAgICAgICBDT05TUCAodmxpc3QpOworICAgICAgIHZsaXN0ID0gWENEUiAodmxpc3Qp KQorICAgIHsKKyAgICAgIHRlbl9lbGVtZW50cyA9IFhDQVIgKHZsaXN0KTsKKyAgICAgIHggPSBY SU5UIChGbnRoIChtYWtlX251bWJlciAoMCksIHRlbl9lbGVtZW50cykpOworICAgICAgeSA9IFhJ TlQgKEZudGggKG1ha2VfbnVtYmVyICgxKSwgdGVuX2VsZW1lbnRzKSk7CisgICAgICBocG9zID0g WElOVCAoRm50aCAobWFrZV9udW1iZXIgKDIpLCB0ZW5fZWxlbWVudHMpKTsKKyAgICAgIHZwb3Mg PSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMyksIHRlbl9lbGVtZW50cykpOworICAgICAgY3Vy c29yX3R5cGUgPSBtY19saXNwX3RvX2N1cnNvcl90eXBlIChGbnRoIChtYWtlX251bWJlciAoNCks IHRlbl9lbGVtZW50cykpOworICAgICAgY3Vyc29yX3dpZHRoID0gWElOVCAoRm50aCAobWFrZV9u dW1iZXIgKDUpLCB0ZW5fZWxlbWVudHMpKTsKKyAgICAgIGZvcmVncm91bmQgPSBGbnRoIChtYWtl X251bWJlciAoNiksIHRlbl9lbGVtZW50cyk7CisgICAgICBiYWNrZ3JvdW5kID0gRm50aCAobWFr ZV9udW1iZXIgKDcpLCB0ZW5fZWxlbWVudHMpOworICAgICAgZmxhdm9yID0gRm50aCAobWFrZV9u dW1iZXIgKDgpLCB0ZW5fZWxlbWVudHMpOworICAgICAgcG9zID0gWElOVCAoRm50aCAobWFrZV9u dW1iZXIgKDkpLCB0ZW5fZWxlbWVudHMpKTsKKyAgICAgIGlmIChFUSAoZmxhdm9yLCBRbWNfZ2x5 cGgpKQorICAgICAgICBtY19lcmFzZV9nbHlwaF9jdXJzb3IgKHcsIHgsIHksIGhwb3MsIHZwb3Ms IGN1cnNvcl90eXBlKTsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIGlmIChFUSAoZmxhdm9yLCBRb3ZlcmxheV9hcnJvd19iaXRtYXApCisgICAgICAgICAgICAg ICAgICB8fCBFUSAoZmxhdm9yLCBRbWNfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9hbmdsZSkKKyAg ICAgICAgICAgICAgICAgIHx8IEVRIChmbGF2b3IsIFFtY19ob2xsb3dfcmVjdGFuZ2xlKQorICAg ICAgICAgICAgICAgICAgfHwgRVEgKGZsYXZvciwgUW1jX3ZlcnRpY2FsX2Jhcl9yaWdodF9hbmds ZSkKKyAgICAgICAgICAgICAgICAgIHx8IEVRIChmbGF2b3IsIFFtY192ZXJ0aWNhbF9iYXIpCisg ICAgICAgICAgICAgICAgICB8fCBFUSAoZmxhdm9yLCBRbWNfdmVydGljYWxfYmFyX2JhY2tzbGFz aCkpCisgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUgPSBOT19DVVJTT1I7CisgICAgICAgICAg ICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCB4LCB5LCBocG9zLCB2cG9zLCBjdXJzb3JfdHlw ZSwgY3Vyc29yX3dpZHRoLCBiYWNrZ3JvdW5kLCBmbGF2b3IpOworICAgICAgICAgICAgfQorICAg IH0KKyAgaWYgKGRlbGV0ZV9jYWNoZSkKKyAgICB3c2V0X2Nyb3NzaGFpcnNfY2FjaGUgKHcsIFFu aWwpOworICB3LT5tYy5lcmFzZV9jcm9zc2hhaXJzID0gZmFsc2U7CisvKgorI2lmZGVmIEdMWVBI X0RFQlVHCisgIGVuZCA9IGNsb2NrKCk7CisgIGNwdV90aW1lX3VzZWQgPSAoKGRvdWJsZSkgKGVu ZCAtIHN0YXJ0KSkgLyBDTE9DS1NfUEVSX1NFQzsKKyAgZHRvYXN0ciAoYnVmX3RpbWUsIHNpemVv ZiBidWZfdGltZSwgMCwgMCwgY3B1X3RpbWVfdXNlZCk7CisgIGRlYnVnX21ldGhvZF9hZGQgKHcs ICJtY19lcmFzZV9jcm9zc2hhaXJzOiAgVElNRSAoJXMpIiwgYnVmX3RpbWUpOworI2VuZGlmCisq LworfQorCit2b2lkCittY19wb3J0YWwgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgY3Vyc29yX29u X3ApCit7CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIE1VTFRJUExFIENVUlNPUlMKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICBpZiAo IU1JTklfV0lORE9XX1AgKHcpCisgICAgICAmJiB3LT5tYy5lcmFzZV9nbHlwaF9jdXJzb3IKKyAg ICAgICYmICFOSUxQICh3LT5tY19nbHlwaF9jYWNoZSkKKyAgICAgICYmIEVRICh3LT5jb250ZW50 cywgWENBUiAoRm50aCAobWFrZV9udW1iZXIgKDIpLCB3LT5tY19nbHlwaF9jYWNoZSkpKSkKKyAg ICBtY19jYWxjICh3LCAxKTsKKyAgaWYgKHcgPT0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93KQor ICAgICAgJiYgV0lORE9XX1ZBTElEX1AgKHNlbGVjdGVkX3dpbmRvdykKKyAgICAgICYmICFNSU5J X1dJTkRPV19QICh3KQorICAgICAgJiYgdy0+bWMuZHJhd19nbHlwaF9jdXJzb3IKKyAgICAgICYm ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2dseXBoX2xpc3QpKSkKKyAg ICAvKiBEcmF3IGZha2UgY3Vyc29ycyAqLworICAgIG1jX2NhbGMgKHcsIDApOworICAgIC8qIEZp cnN0IGF0dGVtcHQgYXQgZGVhbGluZyB3aXRoIGEgYHJlZGlzcGxheV9wcmVzZXJ2ZV9lY2hvX2Fy ZWEnIHNpdHVhdGlvbi4gKi8KKyAgICBlbHNlIGlmICghTUlOSV9XSU5ET1dfUCAodykKKyAgICAg ICAgICAgICAmJiAhdy0+bWMuZHJhd19nbHlwaF9jdXJzb3IKKyAgICAgICAgICAgICAmJiAhTklM UCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19nbHlwaF9saXN0KSkKKyAgICAgICAg ICAgICAmJiAhTklMUCAody0+bWNfZ2x5cGhfY2FjaGUpCisgICAgICAgICAgICAgJiYgRVEgKHct PmNvbnRlbnRzLCBYQ0FSIChGbnRoIChtYWtlX251bWJlciAoMiksIHctPm1jX2dseXBoX2NhY2hl KSkpKQorICAgICAgeworICAgICAgICAvKiBSZW1vdmUgZmFrZSBjdXJzb3JzLiAqLworICAgICAg ICBtY19jYWxjICh3LCAxKTsKKyAgICAgICAgLyogRHJhdyBmYWtlIGN1cnNvcnMgKi8KKyAgICAg ICAgbWNfY2FsYyAodywgMCk7CisgICAgICB9CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIENST1NTSEFJUlMKKyoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworICAvKiBSZW1vdmUgY3Jvc3NoYWlycyBhbmQgZGVsZXRlIHRoZSBjYWNoZSwgYnV0 IE9OTFkgaWYgd2UgcGxhbiBvbiByZWRyYXdpbmcgdGhlbS4KKyAgSW4gYSB0aW1lciBzaXR1YXRp b24sIHdlIHdhbnQgdG8gZXJhc2UgYW5kIHJlZHJhdyAtLSB3ZSBnbyBmcm9tIGBjaGVja3BvaW50 XzInCisgIGluIGByZWRpc3BsYXlfaW50ZXJuYWwnIGFuZCBmb3JjZSBvdXIgd2F5IG92ZXIgdG8g YHVwZGF0ZV9mcmFtZScgMiBvZiAzLgorICBFbWFjcyByZWZyZXNoZXMgdGhlIHNlbGVjdGVkIHdp bmRvdyBhZnRlciBhYm91dCAxIHRvIDIgbWludXRlcyBvZiBubyBhY3Rpdml0eQorICBldmVuIHRo b3VnaCB0aGVyZSBpcyBub3RoaW5nIGF0dGFjaGVkIHRvIHRoZSBgdGltZV9saXN0Jy9gaWRsZV90 aW1lcl9saXN0Jy4KKyAgSW4gdGhhdCByZWZyZXNoIG5vLXRpbWVyIHNpdHVhdGlvbiwgd2Ugd2Fu dCB0byBlcmFzZS9kcmF3IHVzaW5nIHRoZSBjYWNoZS4gKi8KKyAgaWYgKCFNSU5JX1dJTkRPV19Q ICh3KQorICAgICAgJiYgdy0+bWMuZXJhc2VfY3Jvc3NoYWlycworICAgICAgJiYgdy0+bWMuZHJh d19jcm9zc2hhaXJzCisgICAgICAmJiAhTklMUCAody0+Y3Jvc3NoYW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gICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPm91dHB1dF9jdXJzb3IudnBvcywK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+b3V0cHV0X2N1cnNv ci54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5vdXRwdXRf Y3Vyc29yLnkpOworfQorCit2b2lkCittY19yZWNvcmRfd2luZG93X2JvdW5kcyAoc3RydWN0IHdp bmRvdyAqdykKK3sKKyAgLyogUmVjb3JkIHByaW9yIHZhbHVlcyBmb3IgY3Vyc29yIFgsIHdpbmRv dy1zdGFydCBhbmQgd2luZG93LWVuZC4KKyAgVGhlIGdvYWwgaGVyZSBpcyB0byBmYWNpbGl0YXRl IGBtY19jYWxjJyByZWRyYXcgbXVsdGlwbGUgZmFrZQorICBjdXJzb3JzIHVzaW5nIHRoZSBjYWNo ZSBpZiBub3RoaW5nIGhhcyBjaGFuZ2VkLiAqLworICBpZiAoIU1JTklfV0lORE9XX1AgKHcpCisg ICAgICAmJiB3LT5tYy5kcmF3X2dseXBoX2N1cnNvcgorICAgICAgJiYgKCFOSUxQIChCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIG1jX2dseXBoX2xpc3QpKQorICAgICAgICAgIHx8ICFOSUxQ ICh3LT5tY19nbHlwaF9jYWNoZSkpKQorICAgIHsKKyAgICAgIGlmICh3LT5tYy5jdXJyZW50X3N0 YXJ0KQorICAgICAgICB3LT5tYy5wcmV2aW91c19zdGFydCA9IHctPm1jLmN1cnJlbnRfc3RhcnQ7 CisgICAgICAgIGVsc2UKKyAgICAgICAgICB3LT5tYy5wcmV2aW91c19zdGFydCA9IC0xOworICAg ICAgaWYgKHctPm1jLmN1cnJlbnRfZW5kKQorICAgICAgICB3LT5tYy5wcmV2aW91c19lbmQgPSB3 LT5tYy5jdXJyZW50X2VuZDsKKyAgICAgICAgZWxzZQorICAgICAgICAgIHctPm1jLnByZXZpb3Vz X2VuZCA9IC0xOworICAgICAgdy0+bWMuY3VycmVudF9zdGFydCA9IG1hcmtlcl9wb3NpdGlvbiAo dy0+c3RhcnQpOworICAgICAgdy0+bWMuY3VycmVudF9lbmQgPSBCVUZfWiAoWEJVRkZFUiAody0+ Y29udGVudHMpKSAtIHctPndpbmRvd19lbmRfcG9zOworICAgICAgLyogVGhlIGFzc3VtcHRpb24g aXMgdGhhdCBgdy0+b3V0cHV0X2N1cnNvci54YCBpcyB1cGRhdGVkIEFGVEVSIGByZWRpc3BsYXlf d2luZG93Jy4KKyAgICAgIFRoaXMgaXMgb25seSByZWxldmFudCB3aGVuIHVzaW5nIGdseXBobGVz cyBtdWx0aXBsZSBmYWtlIGN1cnNvcnMgYmVjYXVzZSBpdCBpcworICAgICAgcG9zc2libGUgdGhh dCB0aGUgYnVmZmVyIHBvaW50cyByZW1haW4gdGhlIHNhbWUsIGJ1dCB0aGUgWCBtYXkgaGF2ZSBj aGFuZ2VkLgorICAgICAgQ3Jvc3NoYWlycyBkbyBub3QgdXNlIGB3LT5tYy5wcmV2aW91c194YC4g IElmIGl0IHR1cm5zIG91dCB0aGF0IGB3LT5vdXRwdXRfY3Vyc29yLnhgCisgICAgICBpcyB1cGRh dGVkIERVUklORyBgcmVkaXNwbGF5X3dpbmRvdycsIHRoZW4gaXQgd2lsbCBiZSBuZWNlc3Nhcnkg dG8gY2hhbmdlIHRoaXMKKyAgICAgIHRvIHVzZSBgaXQuY3VycmVudF94JyBhbmQgcGVyaGFwcyBy dW4gYHN0YXJ0X2Rpc3BsYXknIHRvIGdldCB0aGF0IHZhbHVlLiAqLworICAgICAgaWYgKHctPm91 dHB1dF9jdXJzb3IueCkKKyAgICAgICAgdy0+bWMucHJldmlvdXNfeCA9IHctPm91dHB1dF9jdXJz b3IueDsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB3LT5tYy5wcmV2aW91c194ID0gLTE7 CisgICAgfQorfQorCit2b2lkCittY19yZW1vdmVfZXZlcnl0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WYg KCFOSUxQICh3LT5tY19nbHlwaF9jYWNoZSkKKyAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJV RkZFUiAody0+Y29udGVudHMpLCBtY19nbHlwaF9saXN0KSkKKyAgICAgICAgICB8fCB3LT5tYy5k cmF3X2Nyb3NzaGFpcnMKKyAgICAgICAgICB8fCBtY19jcm9zc2hhaXJzX3AgKHcpKQorICAgICAg ICB7CisgICAgICAgICAgLyogV2UgYXJlIGJ5cGFzc2luZyBgdXBkYXRlX2ZyYW1lJyBhbmQgZ29p bmcgc3RyYWlnaHQgdG8gYG1jX3BvcnRhbCcuICovCisgICAgICAgICAgc3RydWN0IGZyYW1lICpm ID0gWEZSQU1FICh3LT5mcmFtZSk7CisgICAgICAgICAgdXBkYXRlX2JlZ2luIChmKTsKKyAgICAg ICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICBtY19wb3J0YWwgKHcsIHRydWUpOworICAg ICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgdXBkYXRlX2VuZCAoZik7CisgICAg ICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIHJl dHVybiBmYWxzZTsKK30KKworREVGVU4gKCJtYy1hY3RpdmF0ZS1jcm9zc2hhaXJzIiwgRm1jX2Fj dGl2YXRlX2Nyb3NzaGFpcnMsIFNtY19hY3RpdmF0ZV9jcm9zc2hhaXJzLCAxLCAxLCAwLAorICAg ICAgIGRvYzogLyogRG9jLXN0cmluZy4gKi8pCisgIChMaXNwX09iamVjdCB3aW5kb3cpCit7Cisg IHN0cnVjdCB3aW5kb3cgKncgPSBkZWNvZGVfbGl2ZV93aW5kb3cgKHdpbmRvdyk7CisgIHctPm1j LmRyYXdfY3Jvc3NoYWlycyA9IHRydWU7CisgIHctPm1jLmVyYXNlX2Nyb3NzaGFpcnMgPSB0cnVl OworICByZXR1cm4gUW5pbDsKK30KKworREVGVU4gKCJtYy1hY3RpdmF0ZS1jdXJzb3JzIiwgRm1j X2FjdGl2YXRlX2N1cnNvcnMsIFNtY19hY3RpdmF0ZV9jdXJzb3JzLCAxLCAxLCAwLAorICAgICAg IGRvYzogLyogV2hlbiB1c2luZyBhIHRpbWVyLCBga2JkX21jX2FjdGl2YXRlX2N1cnNvcnMnIGlu IGBrZXlib2FyZC5jJyBpcyBub3QgY2FsbGVkLgorVGhlcmUgYXJlIGFsc28gc29tZSBvdGhlciBj aXJjdW1zdGFuY2VzIHdoZXJlIGBtYy1hY3RpdmF0ZS1jdXJzb3JzJyBpcyBoZWxwZnVsLiAqLykK KyAgKExpc3BfT2JqZWN0IHdpbmRvdykKK3sKKyAgc3RydWN0IHdpbmRvdyAqdyA9IGRlY29kZV9s aXZlX3dpbmRvdyAod2luZG93KTsKKyAgdy0+bWMuZHJhd19nbHlwaF9jdXJzb3IgPSB0cnVlOwor ICB3LT5tYy5lcmFzZV9nbHlwaF9jdXJzb3IgPSB0cnVlOworICByZXR1cm4gUW5pbDsKK30KKwor LyogIChmdW5kYW1lbnRhbC1tb2RlKQorICAgIChzZXRxIGRpc3BsYXktbGluZS1udW1iZXJzIHQp CisgICAgKHNldHEgYnVmZmVyLWRpc3BsYXktdGFibGUgKG1ha2UtZGlzcGxheS10YWJsZSkpCisg ICAgKGFzZXQgYnVmZmVyLWRpc3BsYXktdGFibGUKKyAgICAgICAgICA/XHQKKyAgICAgICAgICAo dmVjdG9yIChtYWtlLWdseXBoLWNvZGUgP1x1MDBCQiAnZm9udC1sb2NrLXdhcm5pbmctZmFjZSkK KyAgICAgICAgICAgICAgICAgIChtYWtlLWdseXBoLWNvZGUgP1x0ICdoaWdobGlnaHQpKSkKKyAg ICAoYXNldCBidWZmZXItZGlzcGxheS10YWJsZQorICAgICAgICAgID9cbgorICAgICAgICAgICh2 ZWN0b3IgKG1ha2UtZ2x5cGgtY29kZSA/XHUwMEI2ICdmb250LWxvY2stY29tbWVudC1mYWNlKQor ICAgICAgICAgICAgICAgICAgP1xuKSkKKyAgICAoc2V0cSB0YWItd2lkdGggOCkKKyAgICAoc2V0 cS1sb2NhbCBhdXRvLWhzY3JvbGwtbW9kZSAnY3VycmVudC1saW5lKSAqLworCitERUZVTiAoImRl YnVnZ2luZyIsIEZkZWJ1Z2dpbmcsIFNkZWJ1Z2dpbmcsIDAsIDAsIDAsCisgICAgICAgZG9jOiAv KiBUaGlzIGZ1bmN0aW9uIHVzZWQgZm9yIGRlYnVnZ2luZy4gKi8pCisgICh2b2lkKQoreworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgUFJFTElNSU5BUlkg U1RVRkYKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICBzdHJ1Y3Qgd2luZG93ICp3ID0gZGVj b2RlX2xpdmVfd2luZG93IChzZWxlY3RlZF93aW5kb3cpOworICBzdHJ1Y3QgZnJhbWUgKmYgPSBY RlJBTUUgKHctPmZyYW1lKTsKKyAgc3RydWN0IGl0IGl0OworICB2b2lkICppdGRhdGEgPSBiaWRp X3NoZWx2ZV9jYWNoZSAoKTsKKyAgZW51bSBtb3ZlX2l0X3Jlc3VsdCByYyA9IE1PVkVfWF9SRUFD SEVEOworICBzdHJ1Y3QgdGV4dF9wb3Mgc3RhcnRfdGV4dF9wb3NpdGlvbjsKKyAgaW50IGNvdW50 ID0gMDsKKyAgaW50IG5ld194ID0gMDsKKyAgaW50IHJlbGF0aXZlX3ggPSAwOworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgU1RBUlQgRElTUExBWSAtLSB3 LT5zdGFydAorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisgIC8qIEJlZ2luIHRoZSBqb3VybmV5 IGF0IHctPnN0YXJ0LiAqLworICBTRVRfVEVYVF9QT1NfRlJPTV9NQVJLRVIgKHN0YXJ0X3RleHRf cG9zaXRpb24sIHctPnN0YXJ0KTsKKyAgc3RhcnRfZGlzcGxheSAoJml0LCB3LCBzdGFydF90ZXh0 X3Bvc2l0aW9uKTsKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgIEdP IFRPIFRIRSBCRUdJTk5JTkcgT0YgVEhFIENVUlJFTlQgTElORS4KKyoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworICAvKiBQbGFjZSB0aGUgSVQgb24gdGhlIGN1cnJlbnQgbGluZSBjb250YWluaW5n IFBULiAqLworICBpbnQgdm9mZnNldCA9IChXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KSA+ IDAKKyAgICAgICAgICAgICAgICAgJiYgdy0+b3V0cHV0X2N1cnNvci52cG9zID4gMCkKKyAgICAg ICAgICAgICAgICAgID8gdy0+b3V0cHV0X2N1cnNvci52cG9zIC0gMQorICAgICAgICAgICAgICAg ICAgOiB3LT5vdXRwdXRfY3Vyc29yLnZwb3M7CisgIGlmICh2b2Zmc2V0ID4gMCkKKyAgICBtb3Zl X2l0X2J5X2xpbmVzICgmaXQsIHZvZmZzZXQpOworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisg ICAgICAgICAgICAgTU9WRSBJVCBPVkVSIEVBQ0ggQ0hBUkFDVEVSIE9OIFRIRSBDVVJSRU5UIExJ TkUuCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAgd2hpbGUgKHRydWUpCisgICAgeworICAg ICAgY291bnQgKz0gMTsKKyAgICAgIGlmIChuZXdfeCA+IDApCisgICAgICAgIHJlbGF0aXZlX3gg PSBuZXdfeCAtIGl0LmZpcnN0X3Zpc2libGVfeDsKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgor ICAgICAgICAgICAgICAgICAgICAgICBEVU1QIFJFTEVWQU5UIEdMWVBIIElORk9STUFUSU9OCisq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKyAgaW50IHdfaHNjcm9sbCA9IGl0LnctPmhzY3JvbGw7 CisgIGludCB3X21pbl9oc2Nyb2xsID0gaXQudy0+bWluX2hzY3JvbGw7CisgIGludCBpdF9jaGFy cG9zID0gSVRfQ0hBUlBPUyAoaXQpOworICBpbnQgZnJhbWVfY2hhcl93aWR0aCA9IEZSQU1FX0NP TFVNTl9XSURUSCAoZik7CisgIHN0cnVjdCBmYWNlICpmYWNlID0gbWNfbG9va3VwX2ZhY2UgKCZp dCk7CisgIHN0cnVjdCBmb250ICpmb250ID0gZmFjZS0+Zm9udDsKKyAgaW50IGZvbnRfc3BhY2Vf d2lkdGggPSAoZm9udCA9PSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgID8gZnJhbWVf Y2hhcl93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICA6IGZvbnQtPnNwYWNlX3dpZHRo KTsKKyAgTGlzcF9PYmplY3QgZm9yZWdyb3VuZF9mYWNlID0gZmFjZS0+bGZhY2VbTEZBQ0VfRk9S RUdST1VORF9JTkRFWF07CisgIExpc3BfT2JqZWN0IGJhY2tncm91bmRfZmFjZSA9IGZhY2UtPmxm YWNlW0xGQUNFX0JBQ0tHUk9VTkRfSU5ERVhdOworICBMaXNwX09iamVjdCBidWYgPSBpdC53LT5j b250ZW50czsKKyAgYm9vbCBoc2NsID0gKCFpdC53LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAg ICAgICAgICAgICAgJiYgRVEgKEZidWZmZXJfbG9jYWxfdmFsdWUgKFFhdXRvX2hzY3JvbGxfbW9k ZSwgYnVmKSwgUWN1cnJlbnRfbGluZSkKKyAgICAgICAgICAgICAgICYmIGl0LnctPmhzY3JvbGwg PiAwKTsKKyAgZnByaW50ZiAoc3RkZXJyLCAiXG4lZC4gICVzJXNcblwKKyAgICBpdC5jICglZClc blwKKyAgICBmZXRjaF9ieXRlICglZClcblwKKyAgICBjaGFyYWN0ZXIgKCVzKVxuXAorICAgIElU X0NIQVJQT1MgKCVkKVxuXAorICAgIHctPmhzY3JvbGwgKCVkKVxuXAorICAgIGhzY2wgKCVzKVxu XAorICAgIHctPm1pbl9oc2Nyb2xsICglZClcblwKKyAgICBpdC5ocG9zICglZClcblwKKyAgICBp dC52cG9zICglZClcblwKKyAgICBpdC5jdXJyZW50X3ggKCVkKVxuXAorICAgIG5ld194ICglZClc blwKKyAgICBmb250LT5zcGFjZV93aWR0aCAoJWQpXG5cCisgICAgaXQubG51bV9waXhlbF93aWR0 aCAoJWQpXG5cCisgICAgaXQubG51bV93aWR0aCAoJWQpXG5cCisgICAgaXQuZmlyc3RfdmlzaWJs ZV94ICglZClcblwKKyAgICByZWxhdGl2ZV94ICglZClcblwKKyAgICBpdC5mYWNlX2lkICglZClc blwKKyAgICBmb3JlZ3JvdW5kX2ZhY2UgKCVzKVxuXAorICAgIGJhY2tncm91bmRfZmFjZSAoJXMp XG5cCisgICAgcmMgKCVzKVxuIiwKKyAgICAgIGNvdW50LAorICAgICAgKGl0LmMgPT0gMAorICAg ICAgICA/ICJOT1RISU5HIgorICAgICAgICA6IGl0LmMgPT0gMTg3CisgICAgICAgICAgPyAiVEFC IENIQVJBQ1RFUiIKKyAgICAgICAgOiBpdC5jID09ICdcdCcKKyAgICAgICAgICA/ICJUQUIgU1RS RVRDSCIKKyAgICAgICAgOiAiVEVYVCIpLAorICAgICAgKHJlbGF0aXZlX3ggPT0gaXQubG51bV9w aXhlbF93aWR0aAorICAgICAgICA/ICIgLS0gVEhFIEZVTiBTVEFSVFMgSEVSRSIKKyAgICAgICAg OiAiIiksCisgICAgICBpdC5jLAorICAgICAgRkVUQ0hfQllURSAoSVRfQllURVBPUyAoaXQpKSwK KyAgICAgICghTklMUCAoRmNoYXJfdG9fc3RyaW5nIChtYWtlX251bWJlciAoaXQuYykpKQorICAg ICAgICA/IFNTREFUQSAoRmNoYXJfdG9fc3RyaW5nIChtYWtlX251bWJlciAoaXQuYykpKQorICAg ICAgICA6ICJOSUxQIC0tIGl0LmMgYXMgYSBzdHJpbmciKSwKKyAgICAgIGl0X2NoYXJwb3MsCisg ICAgICAvKiBXaGVuIGBpdC53LT5oc2Nyb2xsYCBpcyBzZXQgdG8gYW4gYGludGAsIGdkYiByZXBv cnRzIHRoZSB2YWx1ZQorICAgICAgYXMgYmVpbmc6ICA8dmFyaWFibGUgb3B0aW1pemVkIGF3YXkg YnkgY29tcGlsZXI+ICovCisgICAgICB3X2hzY3JvbGwsCisgICAgICAoaHNjbCA/ICJ0cnVlIiA6 ICJmYWxzZSIpLAorICAgICAgd19taW5faHNjcm9sbCwKKyAgICAgIGl0Lmhwb3MsCisgICAgICBp dC52cG9zLAorICAgICAgaXQuY3VycmVudF94LAorICAgICAgbmV3X3gsCisgICAgICAvKiBDYW5u b3QgYWNjZXNzIG1lbW9yeSBhdCBhZGRyZXNzIDB4YTAuICBUaGlzIGNhbWUgYWJvdXQgYnkgdXNp bmcKKyAgICAgIGA/XFUwMDAxRDRENWAgdG8gY3JlYXRlIGEgZmFuY3kgZm9ybSBmZWVkIGNoYXJh Y3RlciB0aGF0IHdhcyBub3QKKyAgICAgIHJlY29nbml6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gIDogIk9PUFMiKSk7CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAg ICAgICAgICAgICAgICAgICAgTU9WRSBJVDogIElOQ1JFTUVOVCA9PSBGT05ULlNQQUNFX1dJRFRI CisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAgICAgIGlmICgoRkVUQ0hfQllURSAoSVRfQllU RVBPUyAoaXQpKSA9PSAnXG4nCisgICAgICAgICAgICYmIGl0LmMgIT0gMCkKKyAgICAgICAgICAv KiB8fCBJVEVSQVRPUl9BVF9FTkRfT0ZfTElORV9QICgmaXQpICovCisgICAgICAgICAgfHwgcmMg PT0gTU9WRV9QT1NfTUFUQ0hfT1JfWlYpCisgICAgICAgIGJyZWFrOworICAgICAgbmV3X3ggKz0g Zm9udF9zcGFjZV93aWR0aDsKKyAgICAgIHJjID0gbW92ZV9pdF9pbl9kaXNwbGF5X2xpbmVfdG8g KCZpdCwgWlYsIG5ld194LCBNT1ZFX1RPX1BPUyB8IE1PVkVfVE9fWCk7CisgICAgICBpZiAocmMg PT0gTU9WRV9MSU5FX0NPTlRJTlVFRCkKKyAgICAgICAgYnJlYWs7CisgICAgICBpZiAoaXQuY3Vy cmVudF94IC0gaXQuZmlyc3RfdmlzaWJsZV94ICsgZm9udF9zcGFjZV93aWR0aCA+PQorICAgICAg ICAgIHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSkpCisgICAgICAgIGJyZWFrOworICAg IH0KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgIFJF RElTUExBWSBBTkQgRFVNUF9HTFBZSF9ST1cKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICBy ZWRpc3BsYXlfaW50ZXJuYWwgKCk7CisgIGludCB2cG9zID0gKFdJTkRPV19IRUFERVJfTElORV9I RUlHSFQgKGl0LncpID4gMCkKKyAgICAgICAgICAgICA/IGl0LnZwb3MgKyAxCisgICAgICAgICAg ICAgOiBpdC52cG9zOworICBzdHJ1Y3QgZ2x5cGhfcm93ICpnbHlwaF9yb3cgPSBNQVRSSVhfUk9X ICh3LT5jdXJyZW50X21hdHJpeCwgdnBvcyk7CisgIGZwcmludGYgKHN0ZGVyciwgIlxuIik7Cisg IGR1bXBfZ2x5cGhfcm93IChnbHlwaF9yb3csIHZwb3MsIDIpOworICBiaWRpX3Vuc2hlbHZlX2Nh Y2hlIChpdGRhdGEsIGZhbHNlKTsKKyAgcmV0dXJuIFFuaWw7Cit9CisKKy8qIGVuZCBNVUxUSVBM RSBDVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAMCiAvKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioKIAkJICAgICAgV2luZG93IGRpc3BsYXkgZGltZW5zaW9ucwpAQCAtMTMzNjYsOSArMTU3 ODMsMjMgQEAgaHNjcm9sbF93aW5kb3dfdHJlZSAoTGlzcF9PYmplY3Qgd2luZG93KQogCSAgICAg IGVsc2UKIAkJcHQgPSBjbGlwX3RvX2JvdW5kcyAoQkVHViwgbWFya2VyX3Bvc2l0aW9uICh3LT5w b2ludG0pLCBaVik7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBD VVJTT1JTICovCisKKyAg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AqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworLyogQGxhd2xpc3QgYWRkZWQgY2hlY2tz IGZvciBhIHZhbGlkIG1hcmtlciBhbmQgYSBsaXZlIGJ1ZmZlciB0byBhdm9pZCBjcmFzaGluZzsK K2FuZCwgaGUgb3B0ZWQgdG8gYnlwYXNzIGByZWRpc3BsYXlfb3RoZXJfd2luZG93cycgd2hlbiB0 aGUgYnVmZmVyIGlzIGRpc3BsYXllZAoraW4gbW9yZSB0aGFuIG9uZSB3aW5kb3cuICBPdGhlcndp c2UsIHVzaW5nIHRoaXMgZmVhdHVyZSBpcyB1bmJlYXJhYmx5IHNsb3cuICovCiAJewogCSAgc3Ry dWN0IGJ1ZmZlciAqYnVmID0gWE1BUktFUiAodmFsKS0+YnVmZmVyOwotCi0JICBpZiAoc2V0X3Jl ZGlzcGxheSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgaWYgKGJ1ZikKLQkgICAgICAg IGJzZXRfcmVkaXNwbGF5IChidWYpOwotICAgICAgICAgICAgICBjaGFuZ2VkID0gdHJ1ZTsKLSAg ICAgICAgICAgIH0KKwkgIGlmIChzZXRfcmVkaXNwbGF5CisgICAgICAgIC8qIFRvIGF2b2lkIGNy YXNoaW5nIGR1ZSB0bzogIzxtYXJrZXIgaW4gbm8gYnVmZmVyPiAqLworICAgICAgICAmJiBidWYK KyAgICAgICAgJiYgTUFSS0VSUCAodmFsKQorICAgICAgICAmJiBCVUZGRVJfTElWRV9QIChidWYp KQorICAgICAgLyogYnNldF9yZWRpc3BsYXkgKGJ1Zik7ICovCisgICAgICAvKiBFdmVuIGlmIHdl IGRvbid0IHNldCB3aW5kb3dzX29yX2J1ZmZlcnNfY2hhbmdlZCwgZG8gc2V0IGByZWRpc3BsYXkn CisgICAgICBzbyB0aGF0IGlmIHdlIGxhdGVyIHNldCB3aW5kb3dzX29yX2J1ZmZlcnNfY2hhbmdl ZCwgdGhpcyBidWZmZXIgd2lsbAorICAgICAgbm90IGJlIG9taXR0ZWQuICAqLworICAgICAgYnVm LT50ZXh0LT5yZWRpc3BsYXkgPSB0cnVlOwogCSAgZWxzZQogCSAgICByZXR1cm4gdHJ1ZTsKIAl9 CisKICAgICB9CiAgIHJldHVybiBjaGFuZ2VkOworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiB9CiAKIC8qIE1hcmsgb3ZlcmxheSBhcnJvd3MgdG8gYmUgdXBkYXRlZCBvbiBuZXh0IHJl ZGlzcGxheS4gICovCkBAIC0xNDI4MSw2ICsxNjcyOCwyMSBAQCByZWRpc3BsYXlfaW50ZXJuYWwg KHZvaWQpCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCiAJICAgICAgdXBkYXRlX3dpbmRvd19m cmluZ2VzICh3LCBmYWxzZSk7CiAjZW5kaWYKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworLyogTk9URTogIEFuIGlkbGUtdGltZXIgZnVuY3Rp b24gbWF5IG5vdCBuZWNlc3NhcmlseSB0cmlnZ2VyIGByZWRpc3BsYXlfd2luZG93Jy4KK2BvcHRp bWl6YXRpb24gMWAgKHdoaWNoIGluY2x1ZGVzIGxlZnQvcmlnaHQgY3Vyc29yIG1vdmVtZW50IG9u IHRoZSBmaXJzdCBzY3JlZW4KK2xpbmUpLCBhbmQgYG9wdGltaXphdGlvbiAzYCAod2hpY2ggaW5j bHVkZXMgbGVmdC9yaWdodCBjdXJzb3IgbW92ZW1lbnQgb24gc2NyZWVuCitsaW5lcyBzdWJzZXF1 ZW50IHRvIHRoZSBmaXJzdCBzY3JlZW4gbGluZSksIGJ5cGFzcyBgcmVkaXNwbGF5X3dpbmRvdycu ICovCisKKyAgICAgIG1jX3JlbW92ZV9ldmVyeXRoaW5nICh3KTsKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogCSAgICAgIGdvdG8gdXBkYXRlOwogCSAgICB9CiAJICBlbHNlCkBAIC0x NDMwMyw2ICsxNjc2NSwxNiBAQCByZWRpc3BsYXlfaW50ZXJuYWwgKHZvaWQpCiAJCSAgJiYgKHcg PSBYV0lORE9XIChzZWxlY3RlZF93aW5kb3cpKSAhPSBzdykKIAkJZ290byByZXRyeTsKIAorCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworICAgICAg IGlmIChtY193aXRob3V0X3VwZGF0ZV9mcmFtZSAodykpCisgICAgICAgICBnb3RvIGVuZF9vZl9y ZWRpc3BsYXk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgICAgICAvKiBXZSB1 c2VkIHRvIGFsd2F5cyBnb3RvIGVuZF9vZl9yZWRpc3BsYXkgaGVyZSwgYnV0IHRoaXMKIAkJIGlz bid0IGVub3VnaCBpZiB3ZSBoYXZlIGEgYmxpbmtpbmcgY3Vyc29yLiAgKi8KIAkgICAgICBpZiAo dy0+Y3Vyc29yX29mZl9wID09IHctPmxhc3RfY3Vyc29yX29mZl9wKQpAQCAtMTQzNDQsNiArMTY4 MTYsMjEgQEAgcmVkaXNwbGF5X2ludGVybmFsICh2b2lkKQogCQkgICp3LT5kZXNpcmVkX21hdHJp eC0+bWV0aG9kID0gMDsKIAkJICBkZWJ1Z19tZXRob2RfYWRkICh3LCAib3B0aW1pemF0aW9uIDMi KTsKICNlbmRpZgorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VS U09SUyAqLworCisvKiBOT1RFOiAgQW4gaWRsZS10aW1lciBmdW5jdGlvbiBtYXkgbm90IG5lY2Vz c2FyaWx5IHRyaWdnZXIgYHJlZGlzcGxheV93aW5kb3cnLgorYG9wdGltaXphdGlvbiAxYCAod2hp Y2ggaW5jbHVkZXMgbGVmdC9yaWdodCBjdXJzb3IgbW92ZW1lbnQgb24gdGhlIGZpcnN0IHNjcmVl bgorbGluZSksIGFuZCBgb3B0aW1pemF0aW9uIDNgICh3aGljaCBpbmNsdWRlcyBsZWZ0L3JpZ2h0 IGN1cnNvciBtb3ZlbWVudCBvbiBzY3JlZW4KK2xpbmVzIHN1YnNlcXVlbnQgdG8gdGhlIGZpcnN0 IHNjcmVlbiBsaW5lKSwgYnlwYXNzIGByZWRpc3BsYXlfd2luZG93Jy4gKi8KKworICAgICAgbWNf cmVtb3ZlX2V2ZXJ5dGhpbmcgKHcpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJ CSAgZ290byB1cGRhdGU7CiAJCX0KIAkgICAgICBlbHNlCkBAIC0xNDQ3Nyw2ICsxNjk2NCwyMCBA QCByZWRpc3BsYXlfaW50ZXJuYWwgKHZvaWQpCiAJCSAgICB1bnJlcXVlc3Rfc2lnaW8gKCk7CiAJ CSAgU1RPUF9QT0xMSU5HOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQ TEUgQ1VSU09SUyAqLworCisgICAgLyogT24gRW1hY3MgZm9yIFdpbmRvd3MsIGNyb3NzaGFpcnMg d2lsbCBub3QgZHJhdyBhdCB0aGUgYmVnaW5uaW5nIG9mIHRoZSBidWZmZXIKKyAgICB3aXRob3V0 IHRoaXMgY29uZGl0aW9uIHdoZW4gdGhlIGlkbGUtdGltZXIgc3dpdGNoZXMgYXJlIHRvZ2dsZWQu ICBUaGlzIG1heSBoYXZlCisgICAgYmVlbiBkdWUgdG8gdGhlIHBhcmVudGhlc2VzIG92ZXJsYXlz IHRoYXQgd2VyZSByZW1vdmVkIGFuZCBkaWQgbm90IG5lZWQgdG8gYmUKKyAgICByZWRyYXduIHNp bmNlIG9wZW5pbmcgcGFyZW50aGVzZXMgYXQgdGhlIGJlZ2lubmluZyBvZiB0aGUgYnVmZmVyIGFy ZSBub3QgaGlnaGxpZ2h0ZWQuICovCisgICAgaWYgKHctPm1jLmRyYXdfY3Jvc3NoYWlycykKKyAg ICAgIHctPm11c3RfYmVfdXBkYXRlZF9wID0gdHJ1ZTsKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogCQkgIHBlbmRpbmcgfD0gdXBkYXRlX2ZyYW1lIChmLCBmYWxzZSwgZmFsc2UpOwog CQkgIGYtPmN1cnNvcl90eXBlX2NoYW5nZWQgPSBmYWxzZTsKIAkJICBmLT51cGRhdGVkX3AgPSB0 cnVlOwpAQCAtMTc2ODksNiArMjAyMzgsMjIgQEAgcmVkaXNwbGF5X3dpbmRvdyAoTGlzcF9PYmpl Y3Qgd2luZG93LCBib29sIGp1c3RfdGhpc19vbmVfcCkKICAgZWxzZQogICAgIFRFTVBfU0VUX1BU X0JPVEggKENIQVJQT1MgKG9wb2ludCksIEJZVEVQT1MgKG9wb2ludCkpOwogCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKio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KioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJ UExFIENVUlNPUlMgKi8KKworICBib29sIGJhcmZfY3Jhc2ggPSAoaXQtPmdseXBoX3JvdyA9PSBO VUxMCisgICAgICAgICAgICAgICAgICAgICB8fCBpdC0+Z2x5cGhfcm93LT51c2VkW1RFWFRfQVJF QV0gPT0gMCkKKyAgICAgICAgICAgICAgICAgICAgPyBmYWxzZQorICAgICAgICAgICAgICAgICAg ICA6IHRydWU7CisgIGlmIChiYXJmX2NyYXNoKQorICAgcmV0dXJuOworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKworCiAgIHB0cmRpZmZfdCBsYXN0X2xpbmUgPSBpdC0+bG51bTsKICAgcHRy ZGlmZl90IHN0YXJ0X2Zyb20sIGJ5dGVwb3M7CiAgIHB0cmRpZmZfdCB0aGlzX2xpbmU7CkBAIC0y OTY5Miw5ICszMjI5MywyMSBAQCBkaXNwbGF5X2FuZF9zZXRfY3Vyc29yIChzdHJ1Y3Qgd2luZG93 ICp3LCBib29sIG9uLAogICAgICAgdy0+cGh5c19jdXJzb3IudnBvcyA9IHZwb3M7CiAgICAgfQog CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisg IExpc3BfT2JqZWN0IGNvbG9yX3ZlY3RvciA9IChGbWFrZV92ZWN0b3IgKG1ha2VfbnVtYmVyICgz KSwgUW5pbCkpOworICBBU0VUIChjb2xvcl92ZWN0b3IsIDAsIG1ha2VfZmxvYXQgKC0xLjApKTsK KyAgQVNFVCAoY29sb3JfdmVjdG9yLCAxLCBtYWtlX2Zsb2F0ICgtMS4wKSk7CisgIEFTRVQgKGNv bG9yX3ZlY3RvciwgMiwgbWFrZV9mbG9hdCAoLTEuMCkpOwogICBGUkFNRV9SSUYgKGYpLT5kcmF3 X3dpbmRvd19jdXJzb3IgKHcsIGdseXBoX3JvdywgeCwgeSwKICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBuZXdfY3Vyc29yX3R5cGUsIG5ld19jdXJzb3Jfd2lkdGgsCi0gICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb24sIGFjdGl2ZV9jdXJzb3IpOworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uLCBhY3RpdmVfY3Vyc29yLCBjb2xv cl92ZWN0b3IsIFFuaWwpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiB9CiAKIApA QCAtMjk3MjYsMTAgKzMyMzM5LDMwIEBAIHVwZGF0ZV93aW5kb3dfY3Vyc29yIChzdHJ1Y3Qgd2lu ZG93ICp3LCBib29sIG9uKQogICAgICAgaWYgKHJvdy0+cmV2ZXJzZWRfcCAmJiBocG9zID49IHJv dy0+dXNlZFtURVhUX0FSRUFdKQogCWhwb3MgPSByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDE7CiAK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAg ICAgIC8qIE1vdmluZyB0aGUgbW91c2UgdHJpZ2dlcnMgYHVwZGF0ZV93aW5kb3dfY3Vyc29yJyB3 aGljaCBjYWxscworICAgICAgYGRpc3BsYXlfYW5kX3NldF9jdXJzb3InIHRoYXQgd291bGQgb3Ro ZXJ3aXNlIHJlbW92ZSBhIHBvcnRpb24gb2YgdGhlCisgICAgICBob3Jpem9udGFsIHJ1bGVyIGZy b20gcG9pbnQgYXQgZW5kIG9mIHZpc3VhbCBsaW5lIHRvIHdpbmRvdyBlZGdlLiAqLworICAgICAg Ym9vbCBjcm9zc2hhaXJzX3AgPSAoIU1JTklfV0lORE9XX1AgKHcpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiAhdy0+bWMuZHJhd19jcm9zc2hhaXJzCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiAhTklMUCAody0+Y3Jvc3NoYWlyc19jYWNoZSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFp cnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdyA9PSBYV0lORE9XIChYQ0FSIChG bnRoIChtYWtlX251bWJlciAoMSksIHctPmNyb3NzaGFpcnNfY2FjaGUpKSkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIEVRICh3LT5jb250ZW50cywgWENBUiAoRm50aCAobWFrZV9udW1i ZXIgKDIpLCB3LT5jcm9zc2hhaXJzX2NhY2hlKSkpKTsKKyAgICAgIGlmICghY3Jvc3NoYWlyc19w KQorICAgICAgICB7CiAgICAgICBibG9ja19pbnB1dCAoKTsKICAgICAgIGRpc3BsYXlfYW5kX3Nl dF9jdXJzb3IgKHcsIG9uLCBocG9zLCB2cG9zLAogCQkJICAgICAgdy0+cGh5c19jdXJzb3IueCwg dy0+cGh5c19jdXJzb3IueSk7CiAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgICB9CisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICB9CiB9CiAKQEAgLTMyNDM2LDYgKzM1 MDY5LDI0IEBAIHhfaW50ZXJzZWN0X3JlY3RhbmdsZXMgKFhSZWN0YW5nbGUgKnIxLCBYUmVjdGFu Z2xlICpyMiwgWFJlY3RhbmdsZSAqcmVzdWx0KQogdm9pZAogc3ltc19vZl94ZGlzcCAodm9pZCkK IHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8K KworICBERUZTWU0gKFFtY19nbHlwaCwgIm1jLWdseXBoLWN1cnNvciIpOworICBERUZTWU0gKFFt Y19nbHlwaGxlc3MsICJtYy1nbHlwbGVzcy1jdXJzb3IiKTsKKyAgREVGU1lNIChRbWNfZ2x5cGhf dGFiLCAibWMtZ2x5cGgtdGFiIik7CisKKyAgZGVmc3ViciAoJlNtY19hY3RpdmF0ZV9jdXJzb3Jz KTsKKworICBkZWZzdWJyICgmU21jX2FjdGl2YXRlX2Nyb3NzaGFpcnMpOworCisgIGRlZnN1YnIg KCZTZGVidWdnaW5nKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBWd2l0aF9l Y2hvX2FyZWFfc2F2ZV92ZWN0b3IgPSBRbmlsOwogICBzdGF0aWNwcm8gKCZWd2l0aF9lY2hvX2Fy ZWFfc2F2ZV92ZWN0b3IpOwogCmRpZmYgLS1naXQgYS9zcmMveHRlcm0uYyBiL3NyYy94dGVybS5j CmluZGV4IGFmMjhkYWIuLmUwYjVhZjkgMTAwNjQ0Ci0tLSBhL3NyYy94dGVybS5jCisrKyBiL3Ny Yy94dGVybS5jCkBAIC0xMTUxLDEwICsxMTUxLDE0IEBAIHhfdXBkYXRlX3dpbmRvd19lbmQgKHN0 cnVjdCB3aW5kb3cgKncsIGJvb2wgY3Vyc29yX29uX3AsCiAgICAgewogICAgICAgYmxvY2tfaW5w dXQgKCk7CiAKLSAgICAgIGlmIChjdXJzb3Jfb25fcCkKLQlkaXNwbGF5X2FuZF9zZXRfY3Vyc29y ICh3LCB0cnVlLAotCQkJCXctPm91dHB1dF9jdXJzb3IuaHBvcywgdy0+b3V0cHV0X2N1cnNvci52 cG9zLAotCQkJCXctPm91dHB1dF9jdXJzb3IueCwgdy0+b3V0cHV0X2N1cnNvci55KTsKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgICAgIG1j X3BvcnRhbCAodywgY3Vyc29yX29uX3ApOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwog CiAgICAgICBpZiAoZHJhd193aW5kb3dfZnJpbmdlcyAodywgdHJ1ZSkpCiAJewpAQCAtMTUzMCwx MCArMTUzNCwyMSBAQCBzdGF0aWMgdm9pZCB4X2NoZWNrX2ZvbnQgKHN0cnVjdCBmcmFtZSAqLCBz dHJ1Y3QgZm9udCAqKTsKIHN0YXRpYyB2b2lkCiB4X3NldF9jdXJzb3JfZ2MgKHN0cnVjdCBnbHlw aF9zdHJpbmcgKnMpCiB7Ci0gIGlmIChzLT5mb250ID09IEZSQU1FX0ZPTlQgKHMtPmYpCisKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgc3Ry dWN0IHdpbmRvdyAqdyA9IGRlY29kZV9saXZlX3dpbmRvdyAoc2VsZWN0ZWRfd2luZG93KTsKKyAg aWYgKChzLT5mb250ID09IEZSQU1FX0ZPTlQgKHMtPmYpCiAgICAgICAmJiBzLT5mYWNlLT5iYWNr Z3JvdW5kID09IEZSQU1FX0JBQ0tHUk9VTkRfUElYRUwgKHMtPmYpCiAgICAgICAmJiBzLT5mYWNl LT5mb3JlZ3JvdW5kID09IEZSQU1FX0ZPUkVHUk9VTkRfUElYRUwgKHMtPmYpCiAgICAgICAmJiAh cy0+Y21wKQorICAgICAgfHwgdy0+bWMuY3Vyc29yX2djX2RlZmF1bHQpCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKICAgICBzLT5nYyA9IHMtPmYtPm91dHB1dF9kYXRhLngtPmN1cnNv cl9nYzsKICAgZWxzZQogICAgIHsKQEAgLTkzMjgsNyArOTM0MywxOCBAQCB4X2RyYXdfYmFyX2N1 cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqcm93LCBpbnQgd2lkdGgs IGVudW0gdGV4dAogCSBpbnZpc2libGUuICBVc2UgdGhlIGdseXBoJ3MgZm9yZWdyb3VuZCBjb2xv ciBpbnN0ZWFkIGluIHRoaXMKIAkgY2FzZSwgb24gdGhlIGFzc3VtcHRpb24gdGhhdCB0aGUgZ2x5 cGgncyBjb2xvcnMgYXJlIGNob3NlbiBzbwogCSB0aGF0IHRoZSBnbHlwaCBpcyBsZWdpYmxlLiAg Ki8KLSAgICAgIGlmIChmYWNlLT5iYWNrZ3JvdW5kID09IGYtPm91dHB1dF9kYXRhLngtPmN1cnNv cl9waXhlbCkKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNP UlMgKi8KKworICAgICAgaWYgKGZhY2UtPmJhY2tncm91bmQgPT0gZi0+b3V0cHV0X2RhdGEueC0+ Y3Vyc29yX3BpeGVsCisgICAgICAgICAgJiYgIXctPm1jLmN1cnNvcl9nY19pbnZpc2libGVfb2th eSkKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJeGdjdi5iYWNrZ3JvdW5kID0g eGdjdi5mb3JlZ3JvdW5kID0gZmFjZS0+Zm9yZWdyb3VuZDsKICAgICAgIGVsc2UKIAl4Z2N2LmJh Y2tncm91bmQgPSB4Z2N2LmZvcmVncm91bmQgPSBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4 ZWw7CkBAIC05NDE2LDcgKzk0NDIsMTcgQEAgeF9jbGVhcl9mcmFtZV9hcmVhIChzdHJ1Y3QgZnJh bWUgKmYsIGludCB4LCBpbnQgeSwgaW50IHdpZHRoLCBpbnQgaGVpZ2h0KQogc3RhdGljIHZvaWQK IHhfZHJhd193aW5kb3dfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93 ICpnbHlwaF9yb3csIGludCB4LAogCQkgICAgICBpbnQgeSwgZW51bSB0ZXh0X2N1cnNvcl9raW5k cyBjdXJzb3JfdHlwZSwKLQkJICAgICAgaW50IGN1cnNvcl93aWR0aCwgYm9vbCBvbl9wLCBib29s IGFjdGl2ZV9wKQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VS U09SUyAqLworCisgIGludCBjdXJzb3Jfd2lkdGgsIGJvb2wgb25fcCwgYm9vbCBhY3RpdmVfcCwK KyAgTGlzcF9PYmplY3QgY29sb3JfdmVjdG9yLCBMaXNwX09iamVjdCBmbGF2b3IpCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKIHsKICAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChX SU5ET1dfRlJBTUUgKHcpKTsKIApAQCAtOTQzNSwzMSArOTQ3MSwxMjcgQEAgeF9kcmF3X3dpbmRv d19jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKmdseXBoX3Jvdywg aW50IHgsCiAJfQogICAgICAgZWxzZQogCXsKLQkgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCi0JICAg IHsKLQkgICAgY2FzZSBIT0xMT1dfQk9YX0NVUlNPUjoKLQkgICAgICB4X2RyYXdfaG9sbG93X2N1 cnNvciAodywgZ2x5cGhfcm93KTsKLQkgICAgICBicmVhazsKIAotCSAgICBjYXNlIEZJTExFRF9C T1hfQ1VSU09SOgotCSAgICAgIGRyYXdfcGh5c19jdXJzb3JfZ2x5cGggKHcsIGdseXBoX3Jvdywg RFJBV19DVVJTT1IpOwotCSAgICAgIGJyZWFrOwogCi0JICAgIGNhc2UgQkFSX0NVUlNPUjoKLQkg ICAgICB4X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEJBUl9D VVJTT1IpOwotCSAgICAgIGJyZWFrOworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdp biBNVUxUSVBMRSBDVVJTT1JTICovCiAKLQkgICAgY2FzZSBIQkFSX0NVUlNPUjoKLQkgICAgICB4 X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEhCQVJfQ1VSU09S KTsKLQkgICAgICBicmVhazsKKyAgc3RydWN0IHhfZGlzcGxheV9pbmZvICpkcHlpbmZvID0gRlJB TUVfRElTUExBWV9JTkZPIChmKTsKKyAgQ29sb3JtYXAgY21hcCA9IEZSQU1FX1hfQ09MT1JNQVAg KGYpOworICB1bnNpZ25lZCBsb25nIG9yaWdpbmFsX2N1cnNvcl9waXhlbCA9IGYtPm91dHB1dF9k YXRhLngtPmN1cnNvcl9waXhlbDsKKyAgZG91YmxlIHJlZCA9IFhGTE9BVF9EQVRBIChBUkVGI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U7CisgIC8qIGB4X2FsbG9jX25lYXJlc3RfY29sb3InIHNldHMg dGhlIGBjb2xvci5waXhlbGAuICovCisgIHhfYWxsb2NfbmVhcmVzdF9jb2xvciAoZiwgY21hcCwg JmNvbG9yKTsKKworICBzd2l0Y2ggKGN1cnNvcl90eXBlKQorICB7CisgICAgY2FzZSBIT0xMT1df Qk9YX0NVUlNPUjoKKyAgICB7CisgICAgICBpZiAocmVkID49IDAgJiYgYmx1ZSA+PSAwICYmIGdy ZWVuID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYt Pm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCcuICAqLworICAgICAgICAgIGYtPm91dHB1dF9k YXRhLngtPmN1cnNvcl9waXhlbCA9IGNvbG9yLnBpeGVsOworICAgICAgICAgIHhfZHJhd19ob2xs b3dfY3Vyc29yICh3LCBnbHlwaF9yb3cpOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1 cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBl bHNlCisgICAgICAgICAgeF9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIGdseXBoX3Jvdyk7CisgICAg ICBicmVhazsKKyAgICB9CisgICAgY2FzZSBGSUxMRURfQk9YX0NVUlNPUjoKKyAgICB7CisgICAg ICBpZiAocmVkID49IDAgJiYgYmx1ZSA+PSAwICYmIGdyZWVuID49IDApCisgICAgICAgIC8qIFRl bXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djJyBieSBib3Jyb3dp bmcgdGhlCisgICAgICAgIGZ1bmN0aW9uYWxpdHkgb2YgYHhfbWFrZV9nYycgaW4geGZucy5jLiAg Ki8KKyAgICAgICAgeworICAgICAgICAgIGJsb2NrX2lucHV0ICgpOworICAgICAgICAgIHN0cnVj dCB3aW5kb3cgKncgPSBkZWNvZ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Vl OworICAgICAgICAgIHhfZHJhd19iYXJfY3Vyc29yICh3LCBnbHlwaF9yb3csIGN1cnNvcl93aWR0 aCwgQkFSX0NVUlNPUik7CisgICAgICAgICAgdy0+bWMuY3Vyc29yX2djX2ludmlzaWJsZV9va2F5 ID0gZmFsc2U7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3Jp Z2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB4 X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEJBUl9DVVJTT1Ip OworICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgSEJBUl9DVVJTT1I6CisgICAgeworICAg ICAgaWYgKHJlZCA+PSAwICYmIGJsdWUgPj0gMCAmJiBncmVlbiA+PSAwKQorICAgICAgICB7Cisg ICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3Jf cGl4ZWwnLiAgKi8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBj b2xvci5waXhlbDsKKyAgICAgICAgICB3LT5tYy5jdXJzb3JfZ2NfaW52aXNpYmxlX29rYXkgPSB0 cnVlOworICAgICAgICAgIHhfZHJhd19iYXJfY3Vyc29yICh3LCBnbHlwaF9yb3csIGN1cnNvcl93 aWR0aCwgSEJBUl9DVVJTT1IpOworICAgICAgICAgIHctPm1jLmN1cnNvcl9nY19pbnZpc2libGVf b2theSA9IGZhbHNlOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9 IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAg ICAgeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIGdseXBoX3JvdywgY3Vyc29yX3dpZHRoLCBIQkFSX0NV UlNPUik7CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBOT19DVVJTT1I6CisgICAgICB3 LT5waHlzX2N1cnNvcl93aWR0aCA9IDA7CisgICAgICBicmVhazsKKyAgICBkZWZhdWx0OgorICAg ICAgZW1hY3NfYWJvcnQgKCk7CisgIH0KKy8qIGVuZCBNVUxUSVBMRSBDVVJTT1JTICovCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KIAotCSAgICBjYXNlIE5PX0NVUlNPUjoKLQkgICAgICB3LT5w aHlzX2N1cnNvcl93aWR0aCA9IDA7Ci0JICAgICAgYnJlYWs7CiAKLQkgICAgZGVmYXVsdDoKLQkg ICAgICBlbWFjc19hYm9ydCAoKTsKLQkgICAgfQogCX0KIAogI2lmZGVmIEhBVkVfWF9JMThOCg== --Multipart_Tue_Jul_17_12:09:17_2018-1 Content-Type: application/el; type=lawlist-elisp Content-Disposition: attachment; filename="crosshairs.el" Content-Transfer-Encoding: base64 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Cjs7OyBCRUdJTiBtb2RpZmljYXRpb24gb2YgdGhlIE11 bHRpcGxlIEN1cnNvcnMgbGlicmFyeSB3cml0dGVuIGJ5ICBNYWduYXIgU3ZlZW4uCgo7OzsgKHJl cXVpcmUgJ3BhY2thZ2UpCjs7OyAoYWRkLXRvLWxpc3QgJ3BhY2thZ2UtYXJjaGl2ZXMgJygibWVs cGEiIC4gImh0dHA6Ly9tZWxwYS5taWxrYm94Lm5ldC9wYWNrYWdlcy8iKSB0KQo7OzsgTS14IHBh Y2thZ2UtaW5zdGFsbCBtdWx0aXBsZS1jdXJzb3JzCjs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yBhaGVhZCBhbmQgYXNzdW1lIGl0J3Mgb2ssIGJlY2F1c2Ugd2UncmUganVzdCBv cHRpbWlzdGljIGxpa2UgdGhhdAogICAgICAgICAgICAgIChpZiAob3IgKG5vdCAoc3ltYm9scCBv cmlnaW5hbC1jb21tYW5kKSkKICAgICAgICAgICAgICAgICAgICAgIDs7IGxhbWJkYSByZWdpc3Rl cmVkIGJ5IHNtYXJ0cmVwCiAgICAgICAgICAgICAgICAgICAgICAoc3RyaW5nLXByZWZpeC1wICIo IiAoc3ltYm9sLW5hbWUgb3JpZ2luYWwtY29tbWFuZCkpKQogICAgICAgICAgICAgICAgICAobWMv ZXhlY3V0ZS1jb21tYW5kLWZvci1hbGwtZmFrZS1jdXJzb3JzIG9yaWdpbmFsLWNvbW1hbmQpCiAg ICAgICAgICAgICAgICA7OyBzbWFydHJlcCBgaW50ZXJuJ3MgY29tbWFuZHMgaW50byBvd24gb2Jh cnJheSB0byBoZWxwCiAgICAgICAgICAgICAgICA7OyBgZGVzY3JpYmUtYmluZGluZ3MnLiAgU28s IGxldCdzIHJlLWBpbnRlcm4nIGhlcmUgdG8KICAgICAgICAgICAgICAgIDs7IG1ha2UgdGhlIGNv bW1hbmQgY29tcGFyYWJsZSBieSBgZXEnLgogICAgICAgICAgICAgICAgKHNldHEgb3JpZ2luYWwt Y29tbWFuZCAoaW50ZXJuIChzeW1ib2wtbmFtZSBvcmlnaW5hbC1jb21tYW5kKSkpCiAgICAgICAg ICAgICAgICA7OyBvdGhlcndpc2UgaXQncyBhIHN5bWJvbCwgYW5kIHdlIGNhbiBiZSBtb3JlIHRo b3JvdWdoCiAgICAgICAgICAgICAgICAoaWYgKGdldCBvcmlnaW5hbC1jb21tYW5kICdtYy0tdW5z dXBwb3J0ZWQpCiAgICAgICAgICAgICAgICAgICAgKG1lc3NhZ2UgIiVTIGlzIG5vdCBzdXBwb3J0 ZWQgd2l0aCBtdWx0aXBsZSBjdXJzb3JzJXMiCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg b3JpZ2luYWwtY29tbWFuZAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIChnZXQgb3JpZ2lu YWwtY29tbWFuZCAnbWMtLXVuc3VwcG9ydGVkKSkKICAgICAgICAgICAgICAgICAgKHdoZW4gKGFu ZCBvcmlnaW5hbC1jb21tYW5kCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG5vdCAobWVt cSBvcmlnaW5hbC1jb21tYW5kIG1jLS1kZWZhdWx0LWNtZHMtdG8tcnVuLW9uY2UpKQogICAgICAg ICAgICAgICAgICAgICAgICAgICAgIChub3QgKG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy9jbWRz LXRvLXJ1bi1vbmNlKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAob3IgbWMvYWx3YXlz LXJ1bi1mb3ItYWxsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtZW1xIG9yaWdp bmFsLWNvbW1hbmQgbWMtLWRlZmF1bHQtY21kcy10by1ydW4tZm9yLWFsbCkKICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgKG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy9jbWRzLXRvLXJ1 bi1mb3ItYWxsKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWMvcHJvbXB0LWZv ci1pbmNsdXNpb24taW4td2hpdGVsaXN0IG9yaWdpbmFsLWNvbW1hbmQpKSkKICAgICAgICAgICAg ICAgICAgICAobWMvZXhlY3V0ZS1jb21tYW5kLWZvci1hbGwtZmFrZS1jdXJzb3JzIG9yaWdpbmFs LWNvbW1hbmQpKSkpKSkKICAgICAgICAgICAgICAod2hlbiBtYy91c2UtYnVpbHQtaW4tY3Vyc29y cwogICAgICAgICAgICAgICAgKGxldCogKCh3aW4gKHNlbGVjdGVkLXdpbmRvdykpCiAgICAgICAg ICAgICAgICAgICAgICAgKHdpbmRvdy1zdGFydCAod2luZG93LXN0YXJ0IHdpbikpCiAgICAgICAg ICAgICAgICAgICAgICAgKHdpbmRvdy1lbmQgKHdpbmRvdy1lbmQgd2luKSkKICAgICAgICAgICAg ICAgICAgICAgICAob3ZlcmxheXMgKG1jL2FsbC1mYWtlLWN1cnNvcnMpKQogICAgICAgICAgICAg ICAgICAgICAgIChsc3QKICAgICAgICAgICAgICAgICAgICAgICAgIChtYXBjYXIKICAgICAgICAg ICAgICAgICAgICAgICAgICAgKGxhbWJkYSAoeCkKICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAobGV0KiAoKHBvcyAob3ZlcmxheS1zdGFydCB4KSkKICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgKGN1cnJlbnQtY29sdW1uCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKGlmIChhbmQgKD49IHBvcyB3aW5kb3ctc3RhcnQpCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDw9IHBvcyB3aW5kb3ctZW5kKSkKICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChzYXZlLWV4Y3Vyc2lvbgogICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZ290by1jaGFyIHBvcykKICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGN1cnJlbnQtY29sdW1uKSkKICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApKSkKICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIChjb25kCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgo bWMtb2RkcCBjdXJyZW50LWNvbHVtbikKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAobGlzdCBwb3MgImJhciIgIiNGRjAwMDAiKSkgOzsgcmVkIG9yIFsxLjAgMC4wIDAuMF0KICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChtYy1ldmVucCBjdXJyZW50LWNvbHVtbikK IC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xseSB3aGVuIGlu IGRpZmZlcmVudCBmcmFtZXMuICBUaGlzIGNhbiBiZSB2ZXJpZmllZCBieSByZWR1Y2luZwogICAg ICA7OzsgdGhlIG51bWJlciBvZiB3aW5kb3dzIHRvIGp1c3QgdGhlIG9uZSBkaXNwbGF5aW5nIHRo ZSBvdmVybGF5IGFycm93LAogICAgICA7OzsgYW5kIHRoZSBzcGVlZCByZXR1cm5zIHRvIGFuIGFj Y2VwdGFibGUgbGV2ZWwuIGBic2V0X3JlZGlzcGxheScgY2FsbHMKICAgICAgOzs7IGByZWRpc3Bs YXlfb3RoZXJfd2luZG93cycgaW4gdGhhdCBzaXR1YXRpb24sIGFuZCB0aGF0IHNsb3dzIHVzIGRv d24uCiAgICAgIChpZiAobm90IChhbmQgKGVvYnApIChib2xwKSkpCiAgICAgICAgKHNldHEgb3Zl cmxheS1hcnJvdy1wb3NpdGlvbiAoY29weS1tYXJrZXIgKGxpbmUtYmVnaW5uaW5nLXBvc2l0aW9u KSkpCiAgICAgICAgKHNldHEgb3ZlcmxheS1hcnJvdy1wb3NpdGlvbiBuaWwpKQogICAgICAod2hl biB2ci10aW1lcgogICAgICAgIChzZXRxIHRpbWVyLWlkbGUtbGlzdCAoZGVscSB2ci10aW1lciB0 aW1lci1pZGxlLWxpc3QpKQogICAgICAgIChzZXRxIHZyLXRpbWVyIG5pbCkpCiAgICAgICh1bmxl c3MgKG1lbXEgdGhpcy1jb21tYW5kICcobXdoZWVsLXNjcm9sbCkpCiAgICAgICAgKCstZGVsZXRl LXBhcmVucy1vdmVybGF5cykpCiAgICAgIChpZiBmb3JjZQogICAgICAgIChwcm9nbgogICAgICAg ICAgKCstcGFyZW5zLWZuKQogICAgICAgICAgKG1jLWFjdGl2YXRlLWNyb3NzaGFpcnMgKHNlbGVj dGVkLXdpbmRvdykpKQogICAgICAgIChzZXRxIHZyLXRpbWVyIChydW4td2l0aC1pZGxlLXRpbWVy IDAuNSBuaWwgIycrLXRpbWVyLWZuKSkpKSkpC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luZ2UtcmlnaHQtYXJyb3cpKQogICAg ICAgIChjb250aW51YXRpb24gLiAoKy1mcmluZ2UtbGVmdC1jdXJseS1hcnJvdyArLWJhY2tzbGFz aCkpCiAgICAgICAgKG92ZXJsYXktYXJyb3cgLiArLWZyaW5nZS1yaWdodC10cmlhbmdsZSkKICAg ICAgICAodXAgLiArLWZyaW5nZS11cC1hcnJvdykKICAgICAgICAoZG93biAuICstZnJpbmdlLWRv d24tYXJyb3cpCiAgICAgICAgKHRvcCAuICstZnJpbmdlLXRvcC1sZWZ0LWFuZ2xlKQogICAgICAg IChib3R0b20gLiArLWZyaW5nZS1ib3R0b20tcmlnaHQtYW5nbGUpCiAgICAgICAgKHRvcC1ib3R0 b20gLiAoKy1mcmluZ2UtbGVmdC1icmFja2V0CiAgICAgICAgICAgICAgICAgICAgICAgKy1mcmlu Z2UtcmlnaHQtYnJhY2tldAogICAgICAgICAgICAgICAgICAgICAgICstZnJpbmdlLXRvcC1yaWdo dC1hbmdsZQogICAgICAgICAgICAgICAgICAgICAgICstZnJpbmdlLXRvcC1sZWZ0LWFuZ2xlKSkK ICAgICAgICAoZW1wdHktbGluZSAuICstZnJpbmdlLWVtcHR5LWxpbmUpCiAgICAgICAgKHVua25v d24gLiArLWZyaW5nZS1xdWVzdGlvbi1tYXJrKSkpCiAgICAgIDs7OyBSRU1BUCBERUZBVUxUIEJF SEFWSU9SIChpZiB0aGUgdXNlciB3YW50cyBzb21ldGhpbmcgZGlmZmVyZW50KS4KICAgICAgKHNl dHEgZnJpbmdlLWN1cnNvci1hbGlzdCAnKChib3ggLiArLWZyaW5nZS1sZWZ0LXRyaWFuZ2xlKQog ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGhvbGxvdyAuICstaG9sbG93LXJlY3Rh bmdsZSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChiYXIgLiArLXZlcnRpY2Fs LWJhcikKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChoYmF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BicmFja2V0CiAgICAgICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgOTEpCiAgICAg ICAgICAgICAgICAgICAgICAgOzs7IChjaGFyLXRvLXN0cmluZyAxMjMpID0+IG9wZW5pbmcgd2F2 eSBicmFja2V0CiAgICAgICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgMTIzKSkpCiAgICAgICAg ICAgICAgICAobWluICgxKyBvcG9pbnQpIChwb2ludC1tYXgpKSkKICAgICAgICAgICAgICgob3Ig Ozs7IChjaGFyLXRvLXN0cmluZyA0MSkgPT4gY2xvc2luZyBwYXJlbnRoZXNpcwogICAgICAgICAg ICAgICAgICAoPSBwcmVjZWRpbmctY2hhciA0MSkKICAgICAgICAgICAgICAgICAgOzs7IChjaGFy LXRvLXN0cmluZyA5MykgPT4gY2xvc2luZyBzcXVhcmUgYnJhY2tldAogICAgICAgICAgICAgICAg ICAoPSBwcmVjZWRpbmctY2hhciA5MykKICAgICAgICAgICAgICAgICAgOzs7IChjaGFyLXRvLXN0 cmluZyAxMjUpID0+IGNsb3Npbmcgd2F2eSBicmFja2V0CiAgICAgICAgICAgICAgICAgICg9IHBy ZWNlZGluZy1jaGFyIDEyNSkpCiAgICAgICAgICAgICAgICAobWF4IChwb2ludC1taW4pICgxLSBv cG9pbnQpKSkKICAgICAgICAgICAgICh0CiAgICAgICAgICAgICAgICBvcG9pbnQpKSkKICAgICAg ICAgcG9zMgogICAgICAgICBzZWxlY3RlZC1mYWNlKQogICAgKHNhdmUtZXhjdXJzaW9uCiAgICAg IChjb25kaXRpb24tY2FzZSBuaWwKICAgICAgICAod2hpbGUgKHNldHEgcG9zMSAobnRoIDEgKHBh cnNlLXBhcnRpYWwtc2V4cCBmcm9tIHBvczEpKSkKICAgICAgICAgIChzZXRxIHBvczIgKHNjYW4t c2V4cHMgcG9zMSAxKSkKICAgICAgICAgIChpZiAoPSBpIDEwKQogICAgICAgICAgICAoc2V0cSBp IDEpCiAgICAgICAgICAgIChpbmNmIGkpKQogICAgICAgICAgKHNldHEgc2VsZWN0ZWQtZmFjZSAo Y29uZAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDEpCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtb25lLWZhY2UpCiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgKCg9IGkgMikKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICcrLXBhcmVucy10d28tZmFjZSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo KD0gaSAzKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLXRocmVl LWZhY2UpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgNCkKICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1mb3VyLWZhY2UpCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgKCg9IGkgNSkKICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICcrLXBhcmVucy1maXZlLWZhY2UpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgKCg9IGkgNikKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1z aXgtZmFjZSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA3KQogICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLXNldmVuLWZhY2UpCiAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgOCkKICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICcrLXBhcmVucy1laWdodC1mYWNlKQogICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICgoPSBpIDkpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJl bnMtbmluZS1mYWNlKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDEw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ICAgICAgICAoKGFuZAogICAgICAgICAgICAg IChub3QgbmFycm93ZWQtcCkKICAgICAgICAgICAgICBlbmQpCiAgICAgICAgICAgIGVuZCkKICAg ICAgICAgICgoYW5kCiAgICAgICAgICAgICAgKG5vdCBuYXJyb3dlZC1wKQogICAgICAgICAgICAg IChudWxsIGVuZCkpCiAgICAgICAgICAgIHBvaW50LW1heCkKICAgICAgICAgICgoYW5kCiAgICAg ICAgICAgICAgbmFycm93ZWQtcAogICAgICAgICAgICAgIGVuZAogICAgICAgICAgICAgICg8IGVu ZCBwb2ludC1tYXgpKQogICAgICAgICAgICBlbmQpCiAgICAgICAgICAoKGFuZAogICAgICAgICAg ICAgIG5hcnJvd2VkLXAKICAgICAgICAgICAgICBlbmQKICAgICAgICAgICAgICAoPSBlbmQgcG9p bnQtbWF4KSkKICAgICAgICAgICAgKDErIGVuZCkpCiAgICAgICAgICAoKGFuZAogICAgICAgICAg ICAgIG5hcnJvd2VkLXAKICAgICAgICAgICAgICAobnVsbCBlbmQpKQogICAgICAgICAgICAoMSsg cG9pbnQtbWF4KSkgKSkKICAgICAgKG92ZXJsYXlzCiAgICAgICAgKHByb2duCiAgICAgICAgICAo b3ZlcmxheS1yZWNlbnRlciBlbmQpCiAgICAgICAgICAob3ZlcmxheXMtaW4gYmVnIGVuZCkpKSAp CiAgICAod2hlbiAoYW5kIGJlZyBlbmQgbmFtZSB2YWwpCiAgICAgIChkb2xpc3QgKG8gb3Zlcmxh eXMpCiAgICAgICAgKGNvbmQKICAgICAgICAgICgoYW5kCiAgICAgICAgICAgICAgICAoZXEgbmFt ZSAnZmFjZSkKICAgICAgICAgICAgICAgIChlcSAob3ZlcmxheS1nZXQgbyBuYW1lKSB2YWwpKQog ICAgICAgICAgICA7OyBFaXRoZXIgcHVzaCB0aGlzIG92ZXJsYXkgb3V0c2lkZSBiZWcuLi5lbmQK ICAgICAgICAgICAgOzsgb3Igc3BsaXQgaXQgdG8gZXhjbHVkZSBiZWcuLi5lbmQKICAgICAgICAg ICAgOzsgb3IgZGVsZXRlIGl0IGVudGlyZWx5IChpZiBpdCBpcyBjb250YWluZWQgaW4gYmVnLi4u ZW5kKS4KICAgICAgICAgICAgKGlmICg8IChvdmVybGF5LXN0YXJ0IG8pIGJlZykKICAgICAgICAg ICAgICAgIChpZiAoPiAob3ZlcmxheS1lbmQgbykgZW5kKQogICAgICAgICAgICAgIChwcm9nbgog ICAgICAgICAgICAgICAgKG1vdmUtb3ZlcmxheSAoY29weS1vdmVybGF5IG8pCiAgICAgICAgICAg ICAgICAgIChvdmVybGF5LXN0YXJ0IG8pIGJlZykKICAgICAgICAgICAgICAgIChtb3ZlLW92ZXJs YXkgbyBlbmQgKG92ZXJsYXktZW5kIG8pKSkKICAgICAgICAgICAgICAgICAgKG1vdmUtb3Zlcmxh eSBvIChvdmVybGF5LXN0YXJ0IG8pIGJlZykpCiAgICAgICAgICAgICAgKGlmICg+IChvdmVybGF5 LWVuZCBvKSBlbmQpCiAgICAgICAgICAgICAgICAgIChtb3ZlLW92ZXJsYXkgbyBlbmQgKG92ZXJs YXktZW5kIG8pKQogICAgICAgICAgICAgICAgKGRlbGV0ZS1vdmVybGF5IG8pKSkpCiAgICAgICAg ICAoKGFuZAogICAgICAgICAgICAgICAgKG5vdCAoZXEgbmFtZSAnZmFjZSkpCiAgICAgICAgICAg ICAgICAoZXF1YWwtaW5jbHVkaW5nLXByb3BlcnRpZXMgKG92ZXJsYXktZ2V0IG8gbmFtZSkgdmFs KSkKICAgICAgICAgICAgKGRlbGV0ZS1vdmVybGF5IG8pKSkpKSkpCgooZGVmdW4gKy1kZWxldGUt cGFyZW5zLW92ZXJsYXlzICgpCiAgKHdoZW4gKy1wYXJlbnMtb3ZlcmxheXMtZXhpc3QtcAogICAg KGRvbGlzdCAoZmFjZSAnKAogICAgICAgICstcGFyZW5zLW9uZS1mYWNlCiAgICAgICAgKy1wYXJl bnMtdHdvLWZhY2UKICAgICAgICArLXBhcmVucy10aHJlZS1mYWNlCiAgICA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JlZ3JvdW5kICJEYXJrR3JlZW4iKSkpCiAgIkZhY2UgZm9yIGArLWZyaW5n ZS1lbXB0eS1saW5lLWZhY2UnLiIKICA6Z3JvdXAgJystbW9kZSkKCihzZXQtZnJpbmdlLWJpdG1h cC1mYWNlICcrLWZyaW5nZS1lbXB0eS1saW5lICcrLWZyaW5nZS1lbXB0eS1saW5lLWZhY2UpCgo7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzsKCihwcm92aWRlICdjcm9zc2hhaXJzKQ== --Multipart_Tue_Jul_17_12:09:17_2018-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs). References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Wed, 29 Aug 2018 06:41:02 +0000 Resent-Message-ID: <handler.22873.B22873.153552485929216 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN>, Marcin Borkowski <mbork@HIDDEN>, Richard Stallman <rms@HIDDEN>, John Wiegley <johnw@HIDDEN>, Akio Burns <akioburns@HIDDEN> Cc: 17684 <at> debbugs.gnu.org, 22873 <at> debbugs.gnu.org Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.153552485929216 (code B ref 22873); Wed, 29 Aug 2018 06:41:02 +0000 Received: (at 22873) by debbugs.gnu.org; 29 Aug 2018 06:40:59 +0000 Received: from localhost ([127.0.0.1]:36312 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1fuu9z-0007bA-4H for submit <at> debbugs.gnu.org; Wed, 29 Aug 2018 02:40:59 -0400 Received: from gateway22.websitewelcome.com ([192.185.47.179]:14487) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1fuu9w-0007au-H2 for 22873 <at> debbugs.gnu.org; Wed, 29 Aug 2018 02:40:56 -0400 Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway22.websitewelcome.com (Postfix) with ESMTP id E6F2F6B93 for <22873 <at> debbugs.gnu.org>; Wed, 29 Aug 2018 01:40:54 -0500 (CDT) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id uu8Xfd9isBcCXuu8kf7RFy; Wed, 29 Aug 2018 01:40:53 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=iGmVNKQhxJ3fuZW4ooR8ZDyNrn6YPaHBKYqEHTuMBd8=; b=h75n88EYTw7ARBHvsI9V9NEK47 +Z7vlL37X1UER35jSgBw/TqPmJaZO8S5YNSRu8nQ86kJn9Se9cQQtwOP96QgtSXSCNunx/nFbtK49 QwA+ntrWfoyCNOWGLH65idGYptqlLrhC+oLiDQU23wdMfTBBVPMoEGPAUlsKbltglykf745FIxpM/ imyaxUXfuu7svWR+nK1EOrQcWjNa4bDZrP2KpwbyutX5Ho7jygQu2qAiHae0HvK+AvVIbkkrHiiH4 LInIyA2D/e/04JUXkPRhTrjb9si9DLz+1jsr0dW9GdPmk2oiOJLm3zN1Zc7C/wfNFoUL9KVwwOp7F 7FZQ5R0Q==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:53587 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from <esq@HIDDEN>) id 1fuu8V-001I30-7V; Wed, 29 Aug 2018 01:39:28 -0500 Date: Tue, 28 Aug 2018 23:39:25 -0700 Message-ID: <m2h8jdvfqa.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Tue_Aug_28_23:39:25_2018-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1fuu8V-001I30-7V X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:53587 X-Source-Auth: lawlist X-Email-Count: 2 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> --Multipart_Tue_Aug_28_23:39:25_2018-1 Content-Type: text/plain; charset=US-ASCII Proof concept patch version 014. Changes include, but are not limited to: - Crosshairs now attempts to deal with variable pitch and nonstandard width characters. This is accomplished by permitting the vertical ruler to intersect a character anywhere along the X axis (vertically aligned with the left of point). The horizontal ruler now also plays nicer with nonstandard width characters. - Debugging messages to stderr are turned on/off with: M-x mc-stderr. - Bug fixes (elimination of an infinite loop; drawing multiple fake cursors only if they are within the bounds of the visible window; miscellaneous others...). - Reduced footprint of revisions to core Emacs code, which is now possible by using a few new window pointers: w->mc.[red, green, blue, fx, fy, h]. INSTALLATION: 1. Download a current version of Emacs master branch. 2. Reset the repository to 07/07/2018: git reset --hard 98463bed07ecc9057094928ffdc2321eaaf3ab52 3. Apply the attached patch from the root repository directory. 4. Build a GUI version of Emacs: X11, NS, or Windows. 5. To try out built-in fake cursors with Magnar Sveen's library (multiple-cursors), install that package first. (progn (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) (package-refresh-contents) (package-install 'multiple-cursors)) 6. Load or evaluate the contents of crosshairs.el (attached), which includes code modifying a couple of functions used by Magnar Sveen's library. 7. To try out the crosshairs feature, open a simple buffer (nothing fancy, just code or text) and type: M-x +-mode 8. To see an example of crosshairs playing nicely with tab stretches, open up something like simple.el and type: M-x +-mode. 9. To see an example of a variety of built-in cursor styles and widths, type: M-x mc-test This is still a work in progress ... --Multipart_Tue_Aug_28_23:39:25_2018-1 Content-Type: application/el; type=lawlist-elisp Content-Disposition: attachment; filename="crosshairs.el" Content-Transfer-Encoding: base64 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7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N1cnNvcnMp KQogICAgKHdoZW4gbWMvbWF4LWN1cnNvcnMKICAgICAgKHVubGVzcyAoPCAobWMvbnVtLWN1cnNv cnMpIG1jL21heC1jdXJzb3JzKQogICAgICAgIChpZiAoeWVzLW9yLW5vLXAgKGZvcm1hdCAiJWQg YWN0aXZlIGN1cnNvcnMuIENvbnRpbnVlPyAiIChtYy9udW0tY3Vyc29ycykpKQogICAgICAgICAg ICAoc2V0cSBtYy9tYXgtY3Vyc29ycyAocmVhZC1udW1iZXIgIkVudGVyIGEgbmV3LCB0ZW1wb3Jh cnkgbWF4aW11bTogIikpCiAgICAgICAgICAobWMvcmVtb3ZlLWZha2UtY3Vyc29ycykKICAgICAg ICAgIChlcnJvciAiQWJvcnRlZDogdG9vIG1hbnkgY3Vyc29ycyIpKSkpCiAgICAobGV0ICgob3Zl cmxheQogICAgICAgICAgICAoaWYgbWMvdXNlLWJ1aWx0LWluLWN1cnNvcnMKICAgICAgICAgICAg ICAobWFrZS1vdmVybGF5IChwb2ludCkgKHBvaW50KSkKICAgICAgICAgICAgICAobWMvbWFrZS1j dXJzb3Itb3ZlcmxheS1hdC1wb2ludCkpKSkKICAgICAgKG92ZXJsYXktcHV0IG92ZXJsYXkgJ21j LWlkIChvciBpZCAobWMvY3JlYXRlLWN1cnNvci1pZCkpKQogICAgICAob3ZlcmxheS1wdXQgb3Zl cmxheSAndHlwZSAnZmFrZS1jdXJzb3IpCiAgICAgIChvdmVybGF5LXB1dCBvdmVybGF5ICdwcmlv cml0eSAxMDApCiAgICAgIChtYy9zdG9yZS1jdXJyZW50LXN0YXRlLWluLW92ZXJsYXkgb3Zlcmxh eSkKICAgICAgKHdoZW4gKHVzZS1yZWdpb24tcCkKICAgICAgICAob3ZlcmxheS1wdXQgb3Zlcmxh eSAncmVnaW9uLW92ZXJsYXkKICAgICAgICAgICAgICAgICAgICAgKG1jL21ha2UtcmVnaW9uLW92 ZXJsYXktYmV0d2Vlbi1wb2ludC1hbmQtbWFyaykpKQogICA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HJlLWBpbnRlcm4nIGhlcmUgdG8KICAgICAg ICAgICAgICAgIDs7IG1ha2UgdGhlIGNvbW1hbmQgY29tcGFyYWJsZSBieSBgZXEnLgogICAgICAg ICAgICAgICAgKHNldHEgb3JpZ2luYWwtY29tbWFuZCAoaW50ZXJuIChzeW1ib2wtbmFtZSBvcmln aW5hbC1jb21tYW5kKSkpCiAgICAgICAgICAgICAgICA7OyBvdGhlcndpc2UgaXQncyBhIHN5bWJv bCwgYW5kIHdlIGNhbiBiZSBtb3JlIHRob3JvdWdoCiAgICAgICAgICAgICAgICAoaWYgKGdldCBv cmlnaW5hbC1jb21tYW5kICdtYy0tdW5zdXBwb3J0ZWQpCiAgICAgICAgICAgICAgICAgICAgKG1l c3NhZ2UgIiVTIGlzIG5vdCBzdXBwb3J0ZWQgd2l0aCBtdWx0aXBsZSBjdXJzb3JzJXMiCiAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgb3JpZ2luYWwtY29tbWFuZAogICAgICAgICAgICAgICAg ICAgICAgICAgICAgIChnZXQgb3JpZ2luYWwtY29tbWFuZCAnbWMtLXVuc3VwcG9ydGVkKSkKICAg ICAgICAgICAgICAgICAgKHdoZW4gKGFuZCBvcmlnaW5hbC1jb21tYW5kCiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgKG5vdCAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jLS1kZWZhdWx0LWNt ZHMtdG8tcnVuLW9uY2UpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIChub3QgKG1lbXEg b3JpZ2luYWwtY29tbWFuZCBtYy9jbWRzLXRvLXJ1bi1vbmNlKSkKICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAob3IgbWMvYWx3YXlzLXJ1bi1mb3ItYWxsCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIChtZW1xIG9yaWdpbmFsLWNvbW1hbmQgbWMtLWRlZmF1bHQtY21kcy10by1y dW4tZm9yLWFsbCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG1lbXEgb3JpZ2lu YWwtY29tbWFuZCBtYy9jbWRzLXRvLXJ1bi1mb3ItYWxsKQogICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAobWMvcHJvbXB0LWZvci1pbmNsdXNpb24taW4td2hpdGVsaXN0IG9yaWdpbmFs LWNvbW1hbmQpKSkKICAgICAgICAgICAgICAgICAgICAobWMvZXhlY3V0ZS1jb21tYW5kLWZvci1h bGwtZmFrZS1jdXJzb3JzIG9yaWdpbmFsLWNvbW1hbmQpKSkpKSkKICAgICAgICAgICAgICAod2hl biBtYy91c2UtYnVpbHQtaW4tY3Vyc29ycwogICAgICAgICAgICAgICAgKGxldCogKCh3aW4gKHNl bGVjdGVkLXdpbmRvdykpCiAgICAgICAgICAgICAgICAgICAgICAgKHdpbmRvdy1zdGFydCAod2lu ZG93LXN0YXJ0IHdpbikpCiAgICAgICAgICAgICAgICAgICAgICAgKHdpbmRvdy1lbmQgKHdpbmRv dy1lbmQgd2luKSkKICAgICAgICAgICAgICAgICAgICAgICAob3ZlcmxheXMgKG1jL2FsbC1mYWtl LWN1cnNvcnMpKQogICAgICAgICAgICAgICAgICAgICAgIChsc3QKICAgICAgICAgICAgICAgICAg ICAgICAgIChtYXBjYXIKICAgICAgICAgICAgICAgICAgICAgICAgICAgKGxhbWJkYSAoeCkKICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAobGV0KiAoKHBvcyAob3ZlcmxheS1zdGFydCB4KSkK ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGN1cnJlbnQtY29sdW1uCiAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGlmIChhbmQgKD49IHBvcyB3aW5kb3ct c3RhcnQpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDw9 IHBvcyB3aW5kb3ctZW5kKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IChzYXZlLWV4Y3Vyc2lvbgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAoZ290by1jaGFyIHBvcykKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgKGN1cnJlbnQtY29sdW1uKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDApKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjb25kCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICgobWMtb2RkcCBjdXJyZW50LWNvbHVtbikKICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAobGlzdCBwb3MgImJhciIgIiNGRjAwMDAiKSkgOzsg cmVkIG9yIFsxLjAgMC4wIDAuMF0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCht Yy1ldmVucCBjdXJyZW50LWNvbHVtbikKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAobGlzdCBwb3MgImJhciIgInllbGxvdyIpKSkpKSA7OyAjRkZGRjAwIG9yIFsxLjAgMS4wIDAu MF0KICAgICAgICAgICAgICAgICAgICAgICAgICAgb3ZlcmxheXMpKSkKICAgICAgICAgICAgICAg ICAgKHNldHEgbWMtZ2x5cGgtbGlzdCBsc3QpKSkpKSkpCgogIChkZWZ1biBtYy9tYXJrLW5leHQt bGlrZS10aGlzLWN5Y2xlLWZvcndhcmQgKCkKICAiTWFya3MgbmV4dCBvY2N1cmVuY2Ugb2Ygd29y ZCBsaWtlIHRoaXMgYW5kIGFkdmFuY2VzIGN1cnNvciB0byB0aGlzIG9jY3VycmVuY2UiCiAgKGlu dGVyYWN0aXZlKQogICAgKG1jL21hcmstbmV4dC1saWtlLXRoaXMgMSkpCgogIChkZWZ1biBtYy9t YXJrLXByZXZpb3VzLWxpa2UtdGhpcy1jeWNsZS1mb3J3YXJkICgpCiAgIk1hcmtzIG5leHQgb2Nj dXJyZW5jZSBvZiB3b3JkIGxpa2UgdGh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QogICAgICAoc2V0cSBtYy1nbHlwaC1saXN0ICco KDEgImhiYXIiICJtYWdlbnRhIikKICAgICAgICAgICAgICAgICAgICAgICgyICJiYXIiICJwdXJw bGUiKQogICAgICAgICAgICAgICAgICAgICAgKDMgImJveCIgIiMwMEZGMDAiKQogICAgICAgICAg ICAgICAgICAgICAgKDQgImhvbGxvdyIgIiMwMDAwRkYiKQogICAgICAgICAgICAgICAgICAgICAg KDUgKCJoYmFyIiAzKSBbMS4wIDAuMCAxLjBdKQogICAgICAgICAgICAgICAgICAgICAgKDYgKCJi YXIiIDMpIFswLjAgMS4wIDEuMF0pKSkpCiAgICAoc2VsZWN0LXdpbmRvdyAoZGlzcGxheS1idWZm ZXIgYnVmZmVyKSkKICAgIDs7OyBUaGUgdHJpZ2dlciBpbiBga2V5Ym9hcmQuY2AgaXMgbm90IGFj dGl2YXRlZCBpbiB0aGlzIGV4YW1wbGUsIHNvIHdlCiAgICA7OzsgZm9yY2UgdGhlIG11bHRpcGxl IGN1cnNvcnMgdG8gYmUgZHJhd24uCiAgICAobWMtYWN0aXZhdGUtY3Vyc29ycyAoc2VsZWN0ZWQt d2luZG93KSkpKQoKKGRlZnVuICstdGltZXItZm4gKCkKIlNpbmNlIHRoaXMgZmlyZXMgZ2xvYmFs bHksIHdlIG11c3QgY29udHJvbCB3aGljaCBidWZmZXJzIGNyb3NzaGFpcnMgYXBwZWFyIGluLiIK ICAod2hlbiArLW1vZGUKICAgIChzZXRxIG92ZXJsYXktYXJyb3ctcG9zaXRpb24gbmlsKQogICAg Ozs7IEF2b2lkIHBvdGVudGlhbCBjb25mbGljdHMgd2l0aCB1c2VyLWRlZmluZWQgYGZhY2UtcmVt YXBwaW5nLWFsaXN0Jy4KICAgICh3aGVuIChudWxsIChkZWZhdWx0LXZhbHVlICdmYWNlLXJlbWFw cGluZy1hbGlzdCkpCiAgICAgIChzZXRxLWxvY2FsIGZhY2UtcmVtYXBwaW5nLWFsaXN0ICcoKCst b3ZlcmxheS1hcn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b3NpdGlvbiBuaWwpKQogICAgICAod2hlbiB2ci10aW1lcgogICAgICAgIChzZXRxIHRpbWVyLWlk bGUtbGlzdCAoZGVscSB2ci10aW1lciB0aW1lci1pZGxlLWxpc3QpKQogICAgICAgIChzZXRxIHZy LXRpbWVyIG5pbCkpCiAgICAgICh1bmxlc3MgKG1lbXEgdGhpcy1jb21tYW5kICcobXdoZWVsLXNj cm9sbCkpCiAgICAgICAgKCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykpCiAgICAgIChpZiBmb3Jj ZQogICAgICAgIChwcm9nbgogICAgICAgICAgKCstcGFyZW5zLWZuKQogICAgICAgICAgKG1jLWFj dGl2YXRlLWNyb3NzaGFpcnMgKHNlbGVjdGVkLXdpbmRvdykpKQogICAgICAgIChzZXRxIHZyLXRp bWVyIChydW4td2l0aC1pZGxlLXRpbWVyIDAuNSBuaWwgIycrLXRpbWVyLWZuKSkpKSkpCgooZGVm aW5lLW1pbm9yLW1vZGUgKy1tb2RlCiJNaW5vciBtb2RlIGZvciBkaXNwbGF5aW5nIGEgaG9yaXpv bnRhbCBydWxlci4iCiAgOmluaXQtdmFsdWUgbmlsCiAgOmxpZ2h0ZXIgIiArIgogIDprZXltYXAg bmlsCiAgOmdsb2JhbCBuaWwKICA6Z3JvdXAgJystbW9kZQogIChjb25kCiAgICAoKy1tb2RlCiAg ICAgIChpZiBibGluay1jdXJzb3ItbW9kZQogICAgICAgIChibGluay1jdXJzb3ItbW9kZSAtMSkp CiAgICAgIChzZXRxIGNyb3NzaGFpcnMgdCkKICAgICAgOzs7IFJFTUlOREVSOiAgVGhlIHVzZXIg Y2FuIHN1cHByZXNzIGVpdGhlciBvciBib3RoIG9mIHRoZSBydWxlcnMuCiAgICAgIDs7IChzZXRx IGNyb3NzaGFpcnMtaG9yaXpvbnRhbC1ydWxlciBuaWwpCiAgICAgIDs7IChzZXRxIGNyb3NzaGFp cnMtdmVydGljYWwtcnVsZXIgbmlsKQogICAgICA7OzsgREVCVUdHSU5HOiAgVG8gZ2VuZXJhdGUg aGVscGZ1bCBtZXNzYWdlcyBvdXRwdXQgdG8gc3RkZXJyLgogICAgICA7OyAoc2V0cSBtYy1zdGRl cnIgbmlsKQogICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICcrLS1zYXZlZC1zdGF0ZSkg bmlsKQogICAgICA7OyBTYXZlIHRoZSBsb2NhbCB2YWx1ZXMgb2Ygc29tZSB2YXJpYWJsZXMsIHRv IGJlIHJlc3RvcmVkIGlmIHZsLW1vZGUgaXMgdHVybmVkIG9mZi4KICAgICAgKGRvbGlzdCAodmFy ICcoYnVmZmVyLWRpc3BsYXktdGFibGUKICAgICAgICAgICAgICAgICAgICAgZnJpbmdlLWluZGlj YXRvci1hbGlzdAogICAgICAgICAgICAgICAgICAgICB0YWItd2lkdGgKICAgICAgICAgICAgICAg ICAgICAgbGluZS1tb3ZlLXZpc3VhbAogICAgICAgICAgICAgICAgICAgICB0cnVuY2F0ZS1wYXJ0 aWFsLXdpZHRoLXdpbmRvd3MKICAgICAgICAgICAgICAgICAgICAgdHJ1bmNhdGUtbGluZXMKICAg ICAgICAgICAgICAgICAgICAgd29yZC13cmFwKSkKICAgICAgICAod2hlbiAobG9jYWwtdmFyaWFi bGUtcCB2YXIpCiAgICAgICAgICAocHVzaCAoY29ucyB2YXIgKHN5bWJvbC12YWx1ZSB2YXIpKSAr LS1zYXZlZC1zdGF0ZSkpKQogICAgICAoc2V0cSBkaXNwbGF5LWxpbmUtbnVtYmVycyB0KQogICAg ICAoc2V0cS1sb2NhbCBhdXRvLWhzY3JvbGwtbW9kZSAnY3VycmVudC1saW5lKQogICAgICAoc2V0 cS1sb2NhbCBoc2Nyb2xsLXN0ZXAgNSkKICAgICAgKHNldHEgYnVmZmVyLWRpc3BsYXktdGFibGUg Ky1idWZmZXItZGlzcGxheS10YWJsZSkKICAgICAgKHNldHEgdGFiLXdpZHRoIDQpCiAgICAgIChz ZXQgKG1ha2UtbG9jYWwtdmFyaWFibGUgJ2xpbmUtbW92ZS12aXN1YWwpIHQpCiAgICAgIChzZXQg KG1ha2UtbG9jYWwtdmFyaWFibGUgJ3RydW5jYXRlLXBhcnRpYWwtd2lkdGgtd2luZG93cykgbmls KQogICAgICAoc2V0cSB0cnVuY2F0ZS1saW5lcyBuaWwpCiAgICAgIChzZXRxIHdvcmQtd3JhcCB0 KQogICAgICAoc2V0cSBpbmRpY2F0ZS1lbXB0eS1saW5lcyB0KQogICAgICAoc2V0cSBpbmRpY2F0 ZS1idWZmZXItYm91bmRhcmllcyAnbGVmdCkKICAgICAgKHNldHEgZnJpbmdlLWluZGljYXRvci1h bGlzdCAnKAogICAgICAgICh0cnVuY2F0aW9uIC4gKCstZnJpbmdlLWxlZnQtYXJyb3cgKy1mcmlu Z2UtcmlnaHQtYXJyb3cpKQogICAgICAgIChjb250aW51YXRpb24gLiAoKy1mcmluZ2UtbGVmdC1j dXJseS1hcnJvdyArLWJhY2tzbGFzaCkpCiAgICAgICAgKG92ZXJsYXktYXJyb3cgLiArLWZyaW5n ZS1yaWdodC10cmlhbmdsZSkKICAgICAgICAodXAgLiArLWZyaW5nZS11cC1hcnJvdykKICAgICAg ICAoZG93biAuICstZnJpbmdlLWRvd24tYXJyb3cpCiAgICAgICAgKHRvcCAuICstZnJpbmdlLXRv cC1sZWZ0LWFuZ2xlKQogICAgICAgIChib3R0b20gLiArLWZyaW5nZS1ib3R0b20tcmlnaHQtYW5n bGUpCiAgICAgICAgKHRvcC1ib3R0b20gLiAoKy1mcmluZ2UtbGVmdC1icmFja2V0CiAgICAgICAg ICAgICAgICAgICAgICAgKy1mcmluZ2UtcmlnaHQtYnJhY2tldAogICAgICAgICAgICAgICAgICAg ICAgICstZnJpbmdlLXRvcC1yaWdodC1hbmdsZQogICAgICAgICAgICAgICAgICAgICAgICstZnJp bmdlLXRvcC1sZWZ0LWFuZ2xlKSkKICAgICAgICAoZW1wdHktbGluZSAuICstZnJpbmdlLWVtcHR5 LWxpbmUpCiAgICAgICAgKHVua25vd24gLiArLWZyaW5nZS1xdWVzdGlvbi1tYXJrKSkpCiAgICAg IDs7OyBSRU1BUCBERUZBVUxUIEJFSEFWSU9SIChpZiB0aGUgdXNlciB3YW50cyBzb21ldGhpbmcg ZGlmZmVyZW50KS4KICAgICAgKHNldHEgZnJpbmdlLWN1cnNvci1hbGlzdCAnKChib3ggLiArLWZy aW5nZS1sZWZ0LXRyaWFuZ2xlKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGhv bGxvdyAuICstaG9sbG93LXJlY3RhbmdsZSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIChiYXIgLiArLXZlcnRpY2FsLWJhcikKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIChoYmFyIC4gKy1mcmluZ2UtaG9yaXpvbnRhbC1iYXIpCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAoaG9sbG93LXNtYWxsIC4gKy1mcmluZ2UtaG9sbG93LXNxdWFyZSkpKQog ICAgICAoc2V0cSBmaWxsLWNvbHVtbiA4MCkKICAgICAgKGFkZC1ob29rICdwb3N0LWNvbW1hbmQt aG9vayAnKy1kcmF3LWhvcml6b250YWwtcnVsZXIgJ2FwcGVuZCAnbG9jYWwpCiAgICAgIChhZGQt aG9vayAnd2luZG93LWNvbmZpZ3VyYXRpb24tY2hhbmdlLWhvb2sgJystcmVkcmF3LWZvcnRod2l0 aCBuaWwgJ2xvY2FsKQogICAgICAoYWRkLWhvb2sgJ2NoYW5nZS1tYWpvci1tb2RlLWhvb2sgJ3R1 cm4tb2ZmLSstbW9kZSBuaWwgJ2xvY2FsKQogICAgICAod2hlbiAoY2FsbGVkLWludGVyYWN0aXZl bHktcCAnYW55KQogICAgICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScuIikpKQogICAg KHQKICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJystcGNoLXNpdC10aGlzLW9uZS1vdXQpCiAg ICAgIChraW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ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7OzsKCihkZWZ1biArLXBhcmVucy1mbiAoKQoiRG9jLXN0cmluZy4iCiAgKGxldCogKChvcG9p bnQgKHBvaW50KSkKICAgICAgICAgKGZyb20gKHBvaW50LW1pbikpCiAgICAgICAgICh3aW4gKHNl bGVjdGVkLXdpbmRvdykpCiAgICAgICAgIChpIDApCiAgICAgICAgIChwcmVjZWRpbmctY2hhciAo cHJlY2VkaW5nLWNoYXIpKQogICAgICAgICAob2NoYXIgKGNoYXItYWZ0ZXIgb3BvaW50KSkKICAg ICAgICAgKHBvczEKICAgICAgICAgICAoY29uZAogICAgICAgICAgICAgKChhbmQgb2NoYXIKICAg ICAgICAgICAgICAgICAgIChvciA7OzsgKGNoYXItdG8tc3RyaW5nIDQwKSA9PiBvcGVuaW5nIHBh cmVudGhlc2lzCiAgICAgICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgNDApCiAgICAgICAgICAg ICAgICAgICAgICAgOzs7IChjaGFyLXRvLXN0cmluZyA5MSkgPT4gb3BlbmluZyBzcXVhcmUgYnJh Y2tldAogICAgICAgICAgICAgICAgICAgICAgICg9IG9jaGFyIDkxKQogICAgICAgICAgICAgICAg ICAgICAgIDs7OyAoY2hhci10by1zdHJpbmcgMTIzKSA9PiBvcGVuaW5nIHdhdnkgYnJhY2tldAog ICAgICAgICAgICAgICAgICAgICAgICg9IG9jaGFyIDEyMykpKQogICAgICAgICAgICAgICAgKG1p biAoMSsgb3BvaW50KSAocG9pbnQtbWF4KSkpCiAgICAgICAgICAgICAoKG9yIDs7OyAoY2hhci10 by1zdHJpbmcgNDEpID0+IGNsb3NpbmcgcGFyZW50aGVzaXMKICAgICAgICAgICAgICAgICAgKD0g cHJlY2VkaW5nLWNoYXIgNDEpCiAgICAgICAgICAgICAgICAgIDs7OyAoY2hhci10by1zdHJpbmcg OTMpID0+IGNsb3Npbmcgc3F1YXJlIGJyYWNrZXQKICAgICAgICAgICAgICAgICAgKD0gcHJlY2Vk aW5nLWNoYXIgOTMpCiAgICAgICAgICAgICAgICAgIDs7OyAoY2hhci10by1zdHJpbmcgMTI1KSA9 PiBjbG9zaW5nIHdhdnkgYnJhY2tldAogICAgICAgICAgICAgICAgICAoPSBwcmVjZWRpbmctY2hh ciAxMjUpKQogICAgICAgICAgICAgICAgKG1heCAocG9pbnQtbWluKSAoMS0gb3BvaW50KSkpCiAg ICAgICAgICAgICAodAogICAgICAgICAgICAgICAgb3BvaW50KSkpCiAgICAgICAgIHBvczIKICAg ICAgICAgc2VsZWN0ZWQtZmFjZSkKICAgIChzYXZlLWV4Y3Vyc2lvbgogICAgICAoY29uZGl0aW9u LWNhc2UgbmlsCiAgICAgICAgKHdoaWxlIChzZXRxIHBvczEgKG50aCAxIChwYXJzZS1wYXJ0aWFs LXNleHAgZnJvbSBwb3MxKSkpCiAgICAgICAgICAoc2V0cSBwb3MyIChzY2FuLXNleHBzIHBvczEg MSkpCiAgICAgICAgICAoaWYgKD0gaSAxMCkKICAgICAgICAgICAgKHNldHEgaSAxKQogICAgICAg ICAgICAoaW5jZiBpKSkKICAgICAgICAgIChzZXRxIHNlbGVjdGVkLWZhY2UgKGNvbmQKICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSAxKQogICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJystcGFyZW5zLW9uZS1mYWNlKQogICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICgoPSBpIDIpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJl bnMtdHdvLWZhY2UpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgMykKICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy10aHJlZS1mYWNlKQogICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDQpCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAnKy1wYXJlbnMtZm91ci1mYWNlKQogICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICgoPSBpIDUpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1w YXJlbnMtZml2ZS1mYWNlKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDYp CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtc2l4LWZhY2UpCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgNykKICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICcrLXBhcmVucy1zZXZlbi1mYWNlKQogICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICgoPSBpIDgpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAn Ky1wYXJlbnMtZWlnaHQtZmFjZSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0g aSA5KQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLW5pbmUtZmFj ZSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSAxMCkKICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy10ZW4tZmFjZSkpKQogICAgICAgICAgKGxl dCAoKG92IChtYWtlLW92ZXJsYXkgcG9zMSAoMSsgcG9zMSkpKSkKICAgICAgICAgICAgKG92ZXJs YXktcHV0IG92ICd3aW5kb3cgd2luKQogICAgICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ2ZhY2Ug c2VsZWN0ZWQtZmFjZSkpCiAgICAgICAgICAod2hlbiBwb3MyCiAgICAgICAgICAgIChsZXQgKChv diAobWFrZS1vdmVybGF5ICgxLSBwb3MyKSBwb3MyKSkpCiAgICAgICAgICAgICAgKG92ZXJsYXkt cHV0IG92ICd3aW5kb3cgd2luKQogICAgICAgICAgICAgIChvdmVybGF5LXB1dCBvdiAnZmFjZSBz ZWxlY3RlZC1mYWNlKSkpKQogICAgICAgIChlcnJvciBuaWwpKSkKICAgIChzZXRxICstcGFyZW5z LW92ZXJsYXlzLWV4aXN0LXAgdCkpKQoKKGRlZnVuICstcmVtb3ZlLW92ZXJsYXlzIChiZWcgZW5k IG5hbWUgdmFsKQoiUmVtb3ZlIHRoZSBvdmVybGF5cyB0aGF0IGFyZSBgZXF1YWwtaW5jbHVkaW5n LXByb3BlcnRpZXNgLgpJbmNsdWRlcyBhIHVuaXF1ZSBzaXR1YXRpb24gd2hlbiBhbiBvdmVybGF5 IHdpdGggYW4gYCdhZnRlci1zdHJpbmdgIHByb3BlcnR5CmlzIGF0IHRoZSB2ZXJ5IGVuZCBvZiBh IG5hcnJvd2VkLWJ1ZmZlci4iCiAgKGxldCogKAogICAgICAocG9pbnQtbWF4IChwb2ludC1tYXgp KQogICAgICAocG9pbnQtbWluIChwb2ludC1taW4pKQogICAgICAobmFycm93ZWQtcCAoYnVmZmVy LW5hcnJvd2VkLXApKQogICAgICAoYmVnIChpZiBiZWcgYmVnIHBvaW50LW1pbikpCiAgICAgIChl bmQKICAgICAgICAoY29uZAogICAgICAgICAgKChhbmQKICAgICAgICAgICAgICAobm90IG5hcnJv d2VkLXApCiAgICAgICAgICAgICAgZW5kKQogICAgICAgICAgICBlbmQpCiAgICAgICAgICAoKGFu ZAogICAgICAgICAgICAgIChub3QgbmFycm93ZWQtcCkKICAgICAgICAgICAgICAobnVsbCBlbmQp KQogICAgICAgICAgICBwb2ludC1tYXgpCiAgICAgICAgICAoKGFuZAogICAgICAgICAgICAgIG5h cnJvd2VkLXAKICAgICAgICAgICAgICBlbmQKICAgICAgICAgICAgICAoPCBlbmQgcG9pbnQtbWF4 KSkKICAgICAgICAgICAgZW5kKQogICAgICAgICAgKChhbmQKICAgICAgICAgICAgICBuYXJyb3dl ZC1wCiAgICAgICAgICAgICAgZW5kCiAgICAgICAgICAgICAgKD0gZW5kIHBvaW50LW1heCkpCiAg ICAgICAgICAgICgxKyBlbmQpKQogICAgICAgICAgKChhbmQKICAgICAgICAgICAgICBuYXJyb3dl ZC1wCiAgICAgICAgICAgICAgKG51bGwgZW5kKSkKICAgICAgICAgICAgKDErIHBvaW50LW1heCkp ICkpCiAgICAgIChvdmVybGF5cwogICAgICAgIChwcm9nbgogICAgICAgICAgKG92ZXJsYXktcmVj ZW50ZXIgZW5kKQogICAgICAgICAgKG92ZXJsYXlzLWluIGJlZyBlbmQpKSkgKQogICAgKHdoZW4g KGFuZCBiZWcgZW5kIG5hbWUgdmFsKQogICAgICAoZG9saXN0IChvIG92ZXJsYXlzKQogICAgICAg IChjb25kCiAgICAgICAgICAoKGFuZAogICAgICAgICAgICAgICAgKGVxIG5hbWUgJ2ZhY2UpCiAg ICAgICAgICAgICAgICAoZXEgKG92ZXJsYXktZ2V0IG8gbmFtZSkgdmFsKSkKICAgICAgICAgICAg OzsgRWl0aGVyIHB1c2ggdGhpcyBvdmVybGF5IG91dHNpZGUgYmVnLi4uZW5kCiAgICAgICAgICAg IDs7IG9yIHNwbGl0IGl0IHRvIGV4Y2x1ZGUgYmVnLi4uZW5kCiAgICAgICAgICAgIDs7IG9yIGRl bGV0ZSBpdCBlbnRpcmVseSAoaWYgaXQgaXMgY29udGFpbmVkIGluIGJlZy4uLmVuZCkuCiAgICAg ICAgICAgIChpZiAoPCAob3ZlcmxheS1zdGFydCBvKSBiZWcpCiAgICAgICAgICAgICAgICAoaWYg KD4gKG92ZXJsYXktZW5kIG8pIGVuZCkKICAgICAgICAgICAgICAocHJvZ24KICAgICAgICAgICAg ICAgIChtb3ZlLW92ZXJsYXkgKGNvcHktb3ZlcmxheSBvKQogICAgICAgICAgICAgICAgICAob3Zl cmxheS1zdGFydCBvKSBiZWcpCiAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gZW5kIChv dmVybGF5LWVuZCBvKSkpCiAgICAgICAgICAgICAgICAgIChtb3ZlLW92ZXJsYXkgbyAob3Zlcmxh eS1zdGFydCBvKSBiZWcpKQ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kICJjaGFydHJldXNlIikpKQog ICJGYWNlIGZvciBgKy1mcmluZ2UtaG9yaXpvbnRhbC1iYXItZmFjZScuIgogIDpncm91cCAnKy1t b2RlKQoKKHNldC1mcmluZ2UtYml0bWFwLWZhY2UgJystZnJpbmdlLWhvcml6b250YWwtYmFyICcr LWZyaW5nZS1ob3Jpem9udGFsLWJhci1mYWNlKQoKCihkZWZpbmUtZnJpbmdlLWJpdG1hcCAnKy1m cmluZ2UtZW1wdHktbGluZSAoKy1mcmluZ2UtaGVscGVyLWRlY2ltYWwKIi4uLi4uLi4uIgoiLi54 eHh4Li4iCiIuLi4uLi4uLiIKIi4uLi4uLi4uIgoiLi54eHh4Li4iCiIuLi4uLi4uLiIpIG5pbCBu aWwgJyh0b3AgdCkpCgooZGVmZmFjZSArLWZyaW5nZS1lbXB0eS1saW5lLWZhY2UKICAnKCh0ICg6 Zm9yZWdyb3VuZCAiRGFya0dyZWVuIikpKQogICJGYWNlIGZvciBgKy1mcmluZ2UtZW1wdHktbGlu ZS1mYWNlJy4iCiAgOmdyb3VwICcrLW1vZGUpCgooc2V0LWZyaW5nZS1iaXRtYXAtZmFjZSAnKy1m cmluZ2UtZW1wdHktbGluZSAnKy1mcmluZ2UtZW1wdHktbGluZS1mYWNlKQoKOzs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7CgoocHJvdmlkZSAnY3Jvc3NoYWlycyk= --Multipart_Tue_Aug_28_23:39:25_2018-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="patch.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvZmFjZXMuZWwgYi9saXNwL2ZhY2VzLmVsCmluZGV4IDE4YjgyMWEu LjYxNDIwNWIgMTAwNjQ0Ci0tLSBhL2xpc3AvZmFjZXMuZW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zaGFpcnNfaG9yaXpvbnRhbF9ydWxlciksIGlkeCk7ICsraWR4OworICBY U0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgY3Jvc3NoYWlyc192ZXJ0aWNh bF9ydWxlciksIGlkeCk7ICsraWR4OworICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2Nh bF9mbGFncywgbWNfc3RkZXJyKSwgaWR4KTsgKytpZHg7CisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKICAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIG1vZGVf bGluZV9mb3JtYXQpLCBpZHgpOyArK2lkeDsKICAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJf bG9jYWxfZmxhZ3MsIGFiYnJldl9tb2RlKSwgaWR4KTsgKytpZHg7CiAgIFhTRVRGQVNUSU5UIChC VkFSICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBvdmVyd3JpdGVfbW9kZSksIGlkeCk7ICsraWR4OwpA QCAtNTIwMCw2ICs1MjE0LDIwIEBAIGluaXRfYnVmZmVyX29uY2UgKHZvaWQpCiAgIC8qIE11c3Qg ZG8gdGhlc2UgYmVmb3JlIG1ha2luZyB0aGUgZmlyc3QgYnVmZmVyISAqLwogCiAgIC8qIHJlYWwg c2V0dXAgaXMgZG9uZSBpbiBiaW5kaW5ncy5lbCAqLworCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgIGJzZXRfYmx2X21jX2dseXBoX2xpc3Qg KCZidWZmZXJfZGVmYXVsdHMsIFFuaWwpOworICBic2V0X2Jsdl9jcm9zc2hhaXJzICgmYnVmZmVy X2RlZmF1bHRzLCBRbmlsKTsKKyAgYnNldF9ibHZfY3Jvc3NoYWlyc19ob3Jpem9udGFsX3J1bGVy ICgmYnVmZmVyX2RlZmF1bHRzLCBRdCk7CisgIGJzZXRfYmx2X2Nyb3NzaGFpcnNfdmVydGljYWxf cnVsZXIgKCZidWZmZXJfZGVmYXVsdHMsIFF0KTsKKyAgYnNldF9ibHZfbWNfc3RkZXJyICgmYnVm ZmVyX2RlZmF1bHRzLCBRbmlsKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBi c2V0X21vZGVfbGluZV9mb3JtYXQgKCZidWZmZXJfZGVmYXVsdHMsIGJ1aWxkX3B1cmVfY19zdHJp bmcgKCIlLSIpKTsKICAgYnNldF9oZWFkZXJfbGluZV9mb3JtYXQgKCZidWZmZXJfZGVmYXVsdHMs IFFuaWwpOwogICBic2V0X2FiYnJldl9tb2RlICgmYnVmZmVyX2RlZmF1bHRzLCBRbmlsKTsKQEAg LTU0NDgsNiArNTQ3NiwxOSBAQCBzeW1zX29mX2J1ZmZlciAodm9pZCkKICAgc3RhdGljcHJvICgm UVNGdW5kYW1lbnRhbCk7CiAgIHN0YXRpY3BybyAoJlZidWZmZXJfYWxpc3QpOwogCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgIERFRlNZTSAo UW1jX2dseXBoX2xpc3QsICJtYy1nbHlwaC1saXN0Iik7CisgIERFRlNZTSAoUWNyb3NzaGFpcnMs ICJjcm9zc2hhaXJzIik7CisgIERFRlNZTSAoUWNyb3NzaGFpcnNfaG9yaXpvbnRhbF9ydWxlciwg ImNyb3NzaGFpcnMtaG9yaXpvbnRhbC1ydWxlciIpOworICBERUZTWU0gKFFjcm9zc2hhaXJzX3Zl cnRpY2FsX3J1bGVyLCAiY3Jvc3NoYWlycy12ZXJ0aWNhbC1ydWxlciIpOworICBERUZTWU0gKFFt Y19zdGRlcnIsICJtYy1zdGRlcnIiKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog ICBERUZTWU0gKFFjaG9pY2UsICJjaG9pY2UiKTsKICAgREVGU1lNIChRbGVmdCwgImxlZnQiKTsK ICAgREVGU1lNIChRcmlnaHQsICJyaWdodCIpOwpAQCAtNTQ4NSw2ICs1NTI2LDI5IEBAIHN5bXNf b2ZfYnVmZmVyICh2b2lkKQogICBGcHV0IChRcHJvdGVjdGVkX2ZpZWxkLCBRZXJyb3JfbWVzc2Fn ZSwKIAlidWlsZF9wdXJlX2Nfc3RyaW5nICgiQXR0ZW1wdCB0byBtb2RpZnkgYSBwcm90ZWN0ZWQg ZmllbGQiKSk7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJT T1JTICovCisKKyAgREVGVkFSX1BFUl9CVUZGRVIgKCJtYy1nbHlwaC1saXN0IiwgJkJWQVIgKGN1 cnJlbnRfYnVmZmVyLCBtY19nbHlwaF9saXN0KSwgUW5pbCwKKyAgICBkb2M6IC8qIEEgYnVmZXIt bG9jYWwgdmFyaWFibGUgdG8gc3RvcmUgdGhlIHZhbHVlIG9mIHRoZSBtdWx0aXBsZSBjdXJzb3Jz IHRvIGJlIGRpc3BsYXllZAorZHVyaW5nIHRoZSBuZXh0IHJlZGlzcGxheS4gKi8pOworCisgIERF RlZBUl9QRVJfQlVGRkVSICgiY3Jvc3NoYWlycyIsICZCVkFSIChjdXJyZW50X2J1ZmZlciwgY3Jv c3NoYWlycyksIFFuaWwsCisgICAgZG9jOiAvKiBBIGJ1ZmV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WNfc3RkZXJyXzsKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBJZiB0aGUgd2lkdGggcnVuIGNhY2hlIGlz IGVuYWJsZWQsIHRoaXMgdGFibGUgY29udGFpbnMgdGhlCiAgICAgIGNoYXJhY3RlciB3aWR0aHMg d2lkdGhfcnVuX2NhY2hlIChzZWUgYWJvdmUpIGFzc3VtZXMuICBXaGVuIHdlCiAgICAgIGRvIGEg dGhvcm91Z2ggcmVkaXNwbGF5LCB3ZSBjb21wYXJlIHRoaXMgYWdhaW5zdCB0aGUgYnVmZmVyJ3MK QEAgLTkxOCw2ICs5NDAsNDQgQEAgWEJVRkZFUiAoTGlzcF9PYmplY3QgYSkKIC8qIE1vc3QgY29k ZSBzaG91bGQgdXNlIHRoZXNlIGZ1bmN0aW9ucyB0byBzZXQgTGlzcCBmaWVsZHMgaW4gc3RydWN0 CiAgICBidWZmZXIuICAoU29tZSBzZXR0ZXJzIHRoYXQgYXJlIHByaXZhdGUgdG8gYSBzaW5nbGUg LmMgZmlsZSBhcmUKICAgIGRlZmluZWQgYXMgc3RhdGljIGluIHRob3NlIGZpbGVzLikgICovCisK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKK0lO TElORSB2b2lkCitic2V0X2Jsdl9tY19nbHlwaF9saXN0IChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNw X09iamVjdCB2YWwpCit7CisgIGItPm1jX2dseXBoX2xpc3RfID0gdmFsOworfQorCitJTkxJTkUg dm9pZAorYnNldF9ibHZfY3Jvc3NoYWlycyAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3Qg dmFsKQoreworICBiLT5jcm9zc2hhaXJzXyA9IHZhbDsKK30KKwor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gorICAgICAgInguLi4u Li54IgorICAgICAgInguLnh4Li54IgorICAgICAgInguLi54eC54IgorICAgICAgInguLi4ueHh4 IgorICAgICAgIngueHh4eHh4IgorICAgICAgIngueHh4eHh4IgorICAgICAgInguLi4ueHh4Igor ICAgICAgInguLi54eC54IgorICAgICAgInguLnh4Li54IgorICAgICAgInguLi4uLi54IgorICAg ICAgInguLi4uLi54IgorICAgICAgInh4eHh4eHh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hv cnQgbWNfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9hbmdsZV9iaXRzW10gPXsKKyAgMHhmZiwgMHg4 MSwgMHg4MSwgMHg5OSwgMHg4ZCwgMHg4NywgMHhiZiwKKyAgMHhiZiwgMHg4NywgMHg4ZCwgMHg5 OSwgMHg4MSwgMHg4MSwgMHhmZn07CisKKy8qIDI2CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhh ZGVjaW1hbAorICAgICAgInh4eHh4eHh4IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4u Li54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54 IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54Igor ICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAg ICAgInguLi4uLi54IgorICAgICAgInh4eHh4eHh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hv cnQgbWNfaG9sbG93X3JlY3RhbmdsZV9iaXRzW10gPXsKKyAgMHhmZiwgMHg4MSwgMHg4MSwgMHg4 MSwgMHg4MSwgMHg4MSwgMHg4MSwKKyAgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwgMHg4 MSwgMHhmZn07CisKKy8qIDI3CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAg ICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAg InguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgIngu Li4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4u Li4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4u IgorICAgICAgInguLi4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdmVydGlj YWxfYmFyX2JpdHNbXSA9eworICAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwLCAw eDgwLAorICAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwfTsKKworLyog MjgKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHguLi4uLi4iCisg ICAgICAiLnh4Li4uLi4iCisgICAgICAiLi54eC4uLi4iCisgICAgICAiLi4ueHguLi4iCisgICAg ICAiLi4uLnh4Li4iCisgICAgICAiLi4uLi54eC4iCisgICAgICAiLi4uLi4ueHgiCisgICAgICAi Li4uLi54eC4iCisgICAgICAiLi4uLnh4Li4iCisgICAgICAiLi4ueHguLi4iCisgICAgICAiLi54 eC4uLi4iCisgICAgICAiLnh4Li4uLi4iCisgICAgICAieHguLi4uLi4iKQorKi8KK3N0YXRpYyB1 bnNpZ25lZCBzaG9ydCBtY19yaWdodF9hbmdsZV9iaXRzW10gPXsKKyAgMHhjMCwgMHg2MCwgMHgz MCwgMHgxOCwgMHhjLCAweDYsIDB4MywgMHg2LCAweGMsIDB4MTgsIDB4MzAsIDB4NjAsIDB4YzB9 OworCisvKiAyOQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICJ4eC4u Li4uLiIKKyAgICAgICJ4eC4uLi4uLiIKKyAgICAgICIgeHguLi4uLiIKKyAgICAgICIueHguLi4u LiIKKyAgICAgICIuLnh4Li4uLiIKKyAgICAgICIuLnh4Li4uLiIKKyAgICAgICIuLi54eC4uLiIK KyAgICAgICIuLi54eC4uLiIKKyAgICAgICIuLi4ueHguLiIKKyAgICAgICIuLi4ueHguLiIKKyAg ICAgICIuLi4uLnh4LiIKKyAgICAgICIuLi4uLnh4LiIKKyAgICAgICIuLi4uLi54eCIKKyAgICAg ICIuLi4uLi54eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX2JhY2tzbGFzaF9iaXRz W10gPXsKKyAgMHhjMCwgMHhjMCwgMHhlMCwgMHg2MCwgMHgzMCwgMHgzMCwgMHgxOCwgMHgxOCwg MHhjLCAweGMsIDB4NiwgMHg2LCAweDMsIDB4M307CisKKy8qIDMwCisgICAgKCstZnJpbmdlLWhl bHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Li4uLi4uIgorICAgICAgInh4Li4uLi4uIgorICAg ICAgInh4eC4uLi4uIgorICAgICAgInh4eC4uLi4uIgorICAgICAgIngueHguLi4uIgorICAgICAg IngueHguLi4uIgorICAgICAgInguLnh4Li4uIgorICAgICAgInguLnh4Li4uIgorICAgICAgIngu Li54eC4uIgorICAgICAgInguLi54eC4uIgorICAgICAgInguLi4ueHguIgorICAgICAgInguLi4u eHguIgorICAgICAgInguLi4uLnh4IgorICAgICAgInguLi4uLnh4IikKKyovCitzdGF0aWMgdW5z aWduZWQgc2hvcnQgbWNfdmVydGljYWxfYmFyX2JhY2tzbGFzaF9iaXRzW10gPXsKKyAgMHhjMCwg MHhjMCwgMHhlMCwgMHhlMCwgMHhiMCwgMHhiMCwgMHg5OCwKKyAgMHg5OCwgMHg4YywgMHg4Yywg MHg4NiwgMHg4NiwgMHg4MywgMHg4M307CisKKy8qIDMxCisgICAgKCstZnJpbmdlLWhlbHBlci1o ZXhhZGVjaW1hbAorICAgICAgIi54eHh4eHguIgorICAgICAgInh4eHgueC4uIgorICAgICAgInh4 eHgueC4uIgorICAgICAgInh4eHgueC4uIgorICAgICAgIi54eHgueC4uIgorICAgICAgIi4uLngu eC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4u IgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIikKKyovCitzdGF0aWMgdW5zaWdu ZWQgc2hvcnQgbWNfcGlsY3Jvd19iaXRzW10gPXsKKyAgMHg3ZSwgMHhmNCwgMHhmNCwgMHhmNCwg MHg3NCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNH07CisKKy8qIDMyCisgICAg KCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Lnh4Li4uIgorICAgICAgIi54 eC54eC4uIgorICAgICAgIi4ueHgueHguIgorICAgICAgIi4uLnh4Lnh4IgorICAgICAgIi4ueHgu eHguIgorICAgICAgIi54eC54eC4uIgorICAgICAgInh4Lnh4Li4uIikKKyovCitzdGF0aWMgdW5z aWduZWQgc2hvcnQgbWNfcmlnaHRfZG91YmxlX2FuZ2xlX2JpdHNbXSA9eworICAweGQ4LCAweDZj LCAweDM2LCAweDFiLCAweDM2LCAweDZjLCAweGQ4fTsKKworLyogMzMKKyAgICAoKy1mcmluZ2Ut aGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi54eHh4Li4iCisgICAgICAiLnh4eHh4eC4iCisg ICAgICAieC4ueHguLngiCisgICAgICAieC4ueHguLngiCisgICAgICAieHh4eHh4eHgiCisgICAg ICAieHguLi4ueHgiCisgICAgICAieHh4Li54eHgiCisgICAgICAiLnh4eHh4eC4iCisgICAgICAi Li54eHh4Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zbWlsZXlfZmFjZV9iaXRz W10gPXsKKyAgMHgzYywgMHg3ZSwgMHg5OSwgMHg5OSwgMHhmZiwgMHhjMywgMHhlNywgMHg3ZSwg MHgzY307CisKKy8qIEFkZCB0aGUgZm9sbG93aW5nIGJpdG1hcHM6CisgIChkZWZpbmUtZnJpbmdl LWJpdG1hcCAnYnJlYWtwb2ludCAiXHgzY1x4N2VceGZmXHhmZlx4ZmZceGZmXHg3ZVx4M2MiKQor ICAoZGVmaW5lLWZyaW5nZS1iaXRtYXAgJ2hvbGxvdy1yaWdodC10cmlhbmdsZSAiXHhlMFx4OTBc eDg4XHg4NFx4ODRceDg4XHg5MFx4ZTAiKSAqLworCisvKiBlbmQgTVVMVElQTEUgQ1VSU09SUyAq LworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogI2RlZmluZSBCWVRFU19QRVJfQklUTUFQ X1JPVyAgKHNpemVvZiAodW5zaWduZWQgc2hvcnQpKQogI2RlZmluZSBTVEFOREFSRF9CSVRNQVBf SEVJR0hUKGJpdHMpIChzaXplb2YgKGJpdHMpL0JZVEVTX1BFUl9CSVRNQVBfUk9XKQogI2RlZmlu ZSBGUkJJVFMoYml0cykgIGJpdHMsIFNUQU5EQVJEX0JJVE1BUF9IRUlHSFQgKGJpdHMpCkBAIC00 NjYsNiArNjkxLDM1IEBAIHN0YXRpYyBzdHJ1Y3QgZnJpbmdlX2JpdG1hcCBzdGFuZGFyZF9iaXRt YXBzW10gPQogICB7IEZSQklUUyAodmVydGljYWxfYmFyX2JpdHMpLCAgICAgICA4LCAwLCBBTElH Tl9CSVRNQVBfQ0VOVEVSLCAwIH0sCiAgIHsgRlJCSVRTIChob3Jpem9udGFsX2Jhcl9iaXRzKSwg ICAgIDgsIDAsIEFMSUdOX0JJVE1BUF9CT1RUT00sIDAgfSwKICAgeyBGUkJJVFMgKGVtcHR5X2xp bmVfYml0cyksICAgICAgICAgOCwgMywgQUxJR05fQklUTUFQX1RPUCwgICAgMCB9LAorCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioq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kb3Vi bGVfYW5nbGVfYml0cyksICAgICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0s CisgIC8qIDMzICovCisgIHsgRlJCSVRTIChtY19zbWlsZXlfZmFjZV9iaXRzKSwgICAgICAgICAg ICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKIH07CiAKICNkZWZpbmUgTk9fRlJJTkdFX0JJVE1BUCAwCkBAIC0xNzE1 LDYgKzE5NjksNzcgQEAgSWYgbmlsLCBhbHNvIGNvbnRpbnVlIGxpbmVzIHdoaWNoIGFyZSBleGFj dGx5IGFzIHdpZGUgYXMgdGhlIHdpbmRvdy4gICovKTsKICAgREVGVkFSX0xJU1AgKCJmcmluZ2Ut Yml0bWFwcyIsIFZmcmluZ2VfYml0bWFwcywKICAgICBkb2M6IC8qIExpc3Qgb2YgZnJpbmdlIGJp dG1hcCBzeW1ib2xzLiAgKi8pOwogICBWZnJpbmdlX2JpdG1hcHMgPSBRbmlsOworCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgIC8qIChnZXQg J2VtcHR5LWxpbmUgJ2ZyaW5nZSkgPT4gMjMgPT4gdGhlIGxhc3Qgc3RhbmRhcmQtYml0bWFwIGJl Zm9yZSB0aGlzIG9uZS4KKyAgU2VlIGBmcmluZ2UuZWxgLiAqLworCisgIC8qIDI0ICovCisgIERF RlNZTSAoUW1jX3ZlcnRpY2FsX2Jhcl9yaWdodF9hbmdsZSwgIistdmVydGljYWwtYmFyLXJpZ2h0 LWFuZ2xlIik7CisgIFZmcmluZ2VfYml0bWFwcyA9IEZjb25zIChRbWNf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n Ky12ZXJ0aWNhbC1iYXItYmFja3NsYXNoICdmcmluZ2UpID0+IDMwICovCisKKyAgLyogMzEgKi8K KyAgREVGU1lNIChRbWNfcGlsY3JvdywgIistcGlsY3JvdyIpOworICBWZnJpbmdlX2JpdG1hcHMg PSBGY29ucyAoUW1jX3BpbGNyb3csIFZmcmluZ2VfYml0bWFwcyk7CisgIEZwdXQgKFFtY19waWxj cm93LCBRZnJpbmdlLCBtYWtlX251bWJlciAoMzEpKTsKKyAgLyogKGdldCAnKy1waWxjcm93ICdm cmluZ2UpID0+IDMxICovCisKKyAgLyogMzIgKi8KKyAgREVGU1lNIChRbWNfcmlnaHRfZG91Ymxl X2FuZ2xlLCAiKy1yaWdodC1kb3VibGUtYW5nbGUiKTsKKyAgVmZyaW5nZV9iaXRtYXBzID0gRmNv bnMgKFFtY19yaWdodF9kb3VibGVfYW5nbGUsIFZmcmluZ2VfYml0bWFwcyk7CisgIEZwdXQgKFFt Y19yaWdodF9kb3VibGVfYW5nbGUsIFFmcmluZ2UsIG1ha2VfbnVtYmVyICgzMikpOworICAvKiAo Z2V0ICcrLXJpZ2h0LWRvdWJsZS1hbmdsZSAnZnJpbmdlKSA9PiAzMiAqLworCisgIC8qIDMzICov CisgIERFRlNZTSAoUW1jX3NtaWxleV9mYWNlLCAiKy1zbWlsZXktZmFjZSIpOworICBWZnJpbmdl X2JpdG1hcHMgPSBGY29ucyAoUW1jX3NtaWxleV9mYWNlLCBWZnJpbmdlX2JpdG1hcHMpOworICBG cHV0IChRbWNfc21pbGV5X2ZhY2UsIFFmcmluZ2UsIG1ha2VfbnVtYmVyICgzMykpOworICAvKiAo Z2V0ICcrLXNtaWxleS1mYWNlICdmcmluZ2UpID0+IDMzICovCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworCisKIH0KIAogLyogR2FyYmFnZSBjb2xsZWN0aW9uIGhvb2sgKi8KZGlmZiAtLWdp dCBhL3NyYy9rZXlib2FyZC5jIGIvc3JjL2tleWJvYXJkLmMKaW5kZXggYWE1OGUyNi4uOGZkM2Fj OCAxMDA2NDQKLS0tIGEvc3JjL2tleWJvYXJkLmMKKysrIGIvc3JjL2tleWJvYXJkLmMKQEAgLTEy MjQsNiArMTIyNCwyOSBAQCBzdGF0aWMgaW50IHJlYWRfa2V5X3NlcXVlbmNlIChMaXNwX09iamVj dCAqLCBMaXNwX09iamVjdCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wsIGJv b2wsIGJvb2wsIGJvb2wpOwogc3RhdGljIHZvaWQgYWRqdXN0X3BvaW50X2Zvcl9wcm9wZXJ0eSAo cHRyZGlmZl90LCBib29sKTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJ UExFIENVUlNPUlMgKi8KKworc3RhdGljIHZvaWQKK2tiZF9tY19hY3RpdmF0ZV9jdXJzb3JzICh2 b2lkKQoreworICBzdHJ1Y3Qgd2luZG93ICp3ID0gZGVjb2RlX2xpdmVfd2luZG93IChzZWxlY3Rl ZF93aW5kb3cpOworICB3LT5tYy5kcmF3X2dseXBoX2N1cnNvciA9IHRydWU7CisgIHctPm1jLmVy YXNlX2dseXBoX2N1cnNvciA9IHRydWU7Cit9CisKK3N0YXRpYyB2b2lkCitrYmRfbWNfYWN0aXZh dGVfY3Jvc3NoYWlycyAodm9pZCkKK3sKKyAgc3RydWN0IHdpbmRvdyAqdyA9IGRlY29kZV9saXZl X3dpbmRvdyAoc2VsZWN0ZWRfd2luZG93KTsKKyAgdy0+bWMuZHJhd19jcm9zc2hhaXJzID0gdHJ1 ZTsKKyAgdy0+bWMuZXJhc2VfY3Jvc3NoYWlycyA9IHRydWU7Cit9CisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKIExpc3BfT2JqZWN0CiBjb21tYW5kX2xvb3BfMSAodm9pZCkKIHsKQEAg LTE0MTksNiArMTQ0MiwxNSBAQCBjb21tYW5kX2xvb3BfMSAodm9pZCkKICAgICAgIFZyZWFsX3Ro aXNfY29tbWFuZCA9IGNtZDsKICAgICAgIHNhZmVfcnVuX2hvb2tzIChRcHJlX2NvbW1hbmRfaG9v ayk7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICov CisKKyAgICAgIGtiZF9tY19hY3RpdmF0ZV9jdXJzb3JzICgpOworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKworCiAgICAgICBhbHJlYWR5X2FkanVzdGVkID0gMDsKIAogICAgICAgaWYgKE5J TFAgKFZ0aGlzX2NvbW1hbmQpKQpkaWZmIC0tZ2l0IGEvc3JjL25zdGVybS5tIGIvc3JjL25zdGVy bS5tCmluZGV4IGExNTY4NGQuLjI2MDI5MjAgMTAwNjQ0Ci0tLSBhL3NyYy9uc3Rlcm0ubQorKysg Yi9zcmMvbnN0ZXJtLm0KQEAgLTExODgsMTAgKzExODgsMTQgQEAgc3RhdGljIE5TUmVjdCBjb25z dHJhaW5fZnJhbWVfcmVjdChOU1JlY3QgZnJhbWVSZWN0LCBib29sIGlzRnVsbHNjcmVlbikKICAg ICB7CiAgICAgICBibG9ja19pbnB1dCAoKTsKIAotICAgICAgaWYgKGN1cnNvcl9vbl9wKQotCWRp c3BsYXlfYW5kX3NldF9jdXJzb3IgKHcsIDEsCi0JCQkJdy0+b3V0cHV0X2N1cnNvci5ocG9zLCB3 LT5vdXRwdXRfY3Vyc29yLnZwb3MsCi0JCQkJdy0+b3V0cHV0X2N1cnNvci54LCB3LT5vdXRwdXRf Y3Vyc29yLnkpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNP UlMgKi8KKworICAgICAgbWNfcG9ydGFsICh3LCBjdXJzb3Jfb25fcCk7CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCiAKICAgICAgIGlmIChkcmF3X3dpbmRvd19mcmluZ2VzICh3LCAxKSkK IAl7CkBAIC0zMjA2LDggKzMyMTAsMjkgQEAgTm90ZSB0aGF0IENVUlNPUl9XSURUSCBpcyBtZWFu aW5nZnVsIG9ubHkgZm9yIChoKWJhciBjdXJzb3JzLgogCiAgIGlmICgocGh5c19jdXJzb3JfZ2x5 cGggPSBnZXRfcGh5c19jdXJzb3JfZ2x5cGggKHcpKSA9PSBOVUxMKQogICAgIHsKLSAgICAgIGlm IChnbHlwaF9yb3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5lX3AKLSAgICAgICAgICAmJiB3LT5w aHlzX2N1cnNvci5ocG9zID49IGdseXBoX3Jvdy0+dXNlZFtURVhUX0FSRUFdKQorCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgICAgICAvKiBU aGlzIG1vZGlmaWNhdGlvbiBlbmFibGVzIHBsYWNlbWVudCBvZiB0aGUgY3Vyc29yLWluLWZyaW5n ZSBiaXRtYXAgd2hlbgorICAgICAgdGhlIHdpbmRvdy13aWR0aCBpcyBzbGlnaHRseSBsZXNzIHRo YW4gYGdseXBoX3Jvdy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVfcGAuCisgICAgICB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qKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgICAgewogICAgICAgICAg IGdseXBoX3Jvdy0+Y3Vyc29yX2luX2ZyaW5nZV9wID0gMTsKICAgICAgICAgICBkcmF3X2ZyaW5n ZV9iaXRtYXAgKHcsIGdseXBoX3JvdywgMCk7CkBAIC0zMjQzLDE3ICszMjY4LDY4IEBAIE5vdGUg dGhhdCBDVVJTT1JfV0lEVEggaXMgbWVhbmluZ2Z1bCBvbmx5IGZvciAoaCliYXIgY3Vyc29ycy4K ICAgICAgIGggPSBjdXJzb3JfaGVpZ2h0OwogICAgIH0KIAotICByLm9yaWdpbi54ID0gZngsIHIu b3JpZ2luLnkgPSBmeTsKLSAgci5zaXplLmhlaWdodCA9IGg7CisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgIHIub3JpZ2luLnggPSAody0+bWMu ZnggPiAwKQorICAgICAgICAgICAgICAgPyB3LT5tYy5meAorICAgICAgICAgICAgICAgOiBmeDsK KyAgci5vcmlnaW4ueSA9ICh3LT5tYy5meSA+IDApCisgICAgICAgICAgICAgICA/IHctPm1jLmZ5 CisgICAgICAgICAgICAgICA6IGZ5OworICByLnNpemUuaGVpZ2h0ID0gKHctPm1jLmggPiAwKQor ICAgICAgICAgICAgICAgICAgPyB3LT5tYy5oCisgICAgICAgICAgICAgICAgICA6IGg7CiAgIHIu c2l6ZS53aWR0aCA9IHctPnBoeXNfY3Vyc29yX3dpZHRoOwogCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKworCiAgIC8qIFByZXZlbnQgdGhlIGN1cnNvciBmcm9tIGJlaW5nIGRyYXduIG91dHNp ZGUgdGhlIHRleHQgYXJlYS4gICovCiAgIG5zX2NsaX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ICBBZGQgYSBjb25kaXRpb24gZm9yIGBo b2xsb3dfY29sb3JgIGlmIHRoZSByZWdpb24gZm9yZWdyb3VuZCBpcyB0aGUKKyAgICAgIHNhbWUg YXMgdGhlIGRlZmF1bHQgYmFja2dyb3VuZCBhbmQgY2hvb3NlIGFuIGFwcHJvcHJpYXRlIGNvbG9y IGlmIHNvLiAqLworICAgIH0KKyAgZWxzZSBpZiAoZmFjZSAmJiBOU19GQUNFX0JBQ0tHUk9VTkQg KGZhY2UpCisgICAgICAgICAgID09IG5zX2luZGV4X2NvbG9yIChGUkFNRV9DVVJTT1JfQ09MT1Ig KGYpLCBmKSkKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgIHsKICAgICAgIFtu c19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChmYWNlKSwgZikgc2V0 XTsKICAgICAgIGhvbGxvd19jb2xvciA9IEZSQU1FX0NVUlNPUl9DT0xPUiAoZik7CkBAIC0zMzAw LDEwICszMzc2LDE5IEBAIE5vdGUgdGhhdCBDVVJTT1JfV0lEVEggaXMgbWVhbmluZ2Z1bCBvbmx5 IGZvciAoaCliYXIgY3Vyc29ycy4KICAgICB9CiAgIG5zX3VuZm9jdXMgKGYpOwogCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCiAgIC8qIGRyYXcg dGhlIGNoYXJhY3RlciB1bmRlciB0aGUgY3Vyc29yICovCi0gIGlmIChjdXJzb3JfdHlwZSAhPSBO T19DVVJTT1IpCisgIGlmIChjdXJzb3JfdHlwZSAhPSBOT19DVVJTT1IKKyAgICAgICYmIHctPm1j LmdseXBoX2ZsYXZvciAhPSBNQ19HTFlQSExFU1MKKyAgICAgICYmIHctPm1jLmdseXBoX2ZsYXZv ciAhPSBNQ19HTFlQSF9UQUIpCiAgICAgZHJhd19waHlzX2N1cnNvcl9nbHlwaCAodywgZ2x5cGhf cm93LCBEUkFXX0NVUlNPUik7CiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICNpZmRl ZiBOU19JTVBMX0NPQ09BCiAgIE5TRW5hYmxlU2NyZWVuVXBkYXRlcyAoKTsKICNlbmRpZgpkaWZm IC0tZ2l0IGEvc3JjL3czMnRlcm0uYyBiL3NyYy93MzJ0ZXJtLmMKaW5kZXggZmYwZDJiZi4uODQw MDQyNiAxMDA2NDQKLS0tIGEvc3JjL3czMnRlcm0uYworKysgYi9zcmMvdzMydGVybS5jCkBAIC03 MDUsMTAgKzcwNSwxNCBAQCB4X3VwZGF0ZV93aW5kb3dfZW5kIChzdHJ1Y3Qgd2luZG93ICp3LCBi b29sIGN1cnNvcl9vbl9wLAogICAgIHsKICAgICAgIGJsb2NrX2lucHV0ICgpOwogCi0gICAgICBp ZiAoY3Vyc29yX29uX3ApCi0JZGlzcGxheV9hbmRfc2V0X2N1cnNvciAodywgdHJ1ZSwKLQkJCQl3 LT5vdXRwdXRfY3Vyc29yLmhwb3MsIHctPm91dHB1dF9jdXJzb3IudnBvcywKLQkJCQl3LT5vdXRw dXRfY3Vyc29yLngsIHctPm91dHB1dF9jdXJzb3IueSk7CisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgICAgICBtY19wb3J0YWwgKHcsIGN1cnNv cl9vbl9wKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKIAogICA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PmJhY2tncm91bmQKICAgICAgICYmICFzLT5jbXApCisgICAgICB8fCB3LT5t Yy5jdXJzb3JfZ2NfZGVmYXVsdCkKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAg IHMtPmdjID0gcy0+Zi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2M7CiAgIGVsc2UKICAgICB7 CkBAIC01NjkwLDYgKzU3MDUsMjYgQEAgeF9kcmF3X2hvbGxvd19jdXJzb3IgKHN0cnVjdCB3aW5k b3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdykKIAogICAvKiBDb21wdXRlIGZyYW1lLXJlbGF0 aXZlIGNvb3JkaW5hdGVzIGZvciBwaHlzIGN1cnNvci4gICovCiAgIGdldF9waHlzX2N1cnNvcl9n ZW9tZXRyeSAodywgcm93LCBjdXJzb3JfZ2x5cGgsICZsZWZ0LCAmdG9wLCAmaCk7CisKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKy8qIExFR0VO RDoKKworLSAgdG9wIHkgPT0gV0lORE9XX1RPX0ZSQU1FX1BJWEVMX1kgKHcsIHJvdy0+eSkKKwor LSAgYm90dG9tIHkgPT0gV0lORE9XX1RPX0ZSQU1FX1BJWEVMX1kgKHcsIHJvdy0+eSkgLSByb3ct PmhlaWdodAorCistICBoIG9mIEhPTExPV19CT1hfQ1VSU09SID09IHJvdy0+aGVpZ2h0CisgICBb VGhpcyBhdm9pZHMgYSB2aXNpYmxlIGdhcCBhYm92ZS9iZWxvdy5dICovCisKKyAgaWYgKHctPm1j LmggPiAwKQorICAgIGggPSByb3ctPmhlaWdodDsKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogICByZWN0LmxlZnQgPSBsZWZ0OwogICAvKiBXaGVuIG9uIFIyTCBjaGFyYWN0ZXIsIHNo b3cgY3Vyc29yIGF0IHRoZSByaWdodCBlZGdlIG9mIHRoZQogICAgICBnbHlwaCwgdW5sZXNzIHRo ZSBjdXJzb3IgYm94IGlzIGFzIHdpZGUgYXMgdGhlIGdseXBoIG9yIHdpZGVyCkBAIC01NzUzLDcg KzU3ODgsMTcgQEAgeF9kcmF3X2Jhcl9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBn bHlwaF9yb3cgKnJvdywKIAkgaW52aXNpYmxlLiAgVXNlIHRoZSBnbHlwaCdzIGZvcmVncm91bmQg Y29sb3IgaW5zdGVhZCBpbiB0aGlzCiAJIGNhc2UsIG9uIHRoZSBhc3N1bXB0aW9uIHRoYXQgdGhl IGdseXBoJ3MgY29sb3JzIGFyZSBjaG9zZW4gc28KIAkgdGhhdCB0aGUgZ2x5cGggaXMgbGVnaWJs ZS4gICovCi0gICAgICBpZiAoZmFjZS0+YmFja2dyb3VuZCA9PSBjdXJzb3JfY29sb3IpCisKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgICAg IGlmIChmYWNlLT5iYWNrZ3JvdW5kID09IGN1cnNvcl9jb2xvcgorICAgICAgICAgICYmICF3LT5t Yy5jdXJzb3JfZ2NfaW52aXNpYmxlX29rYXkpCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor CisKIAljdXJzb3JfY29sb3IgPSBmYWNlLT5mb3JlZ3JvdW5kOwogCiAgICAgICB4ID0gV0lORE9X X1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgdy0+cGh5c19jdXJzb3IueCk7CkBAIC01Nzc0LDYg KzU4MTksMTcgQEAgeF9kcmF3X2Jhcl9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBn bHlwaF9yb3cgKnJvdywKIAkgIGlmICgoY3Vyc29yX2dseXBoLT5yZXNvbHZlZF9sZXZlbCAmIDEp ICE9IDApCiAJICAgIHggKz0gY3Vyc29yX2dseXBoLT5waXhlbF93aWR0aCAtIHdpZHRoOwogCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgICAg LyogQWxpZ24gYWxsIGZha2UgQkFSX0NVUlNPUiBvZiB0aGUgVkVSVElDQUxfUlVMRVIgd2l0aCBg b3BvaW50X3gnLiAqLworICAgIGlmICh3LT5tYy5meCA+IDApCisgICAgICB4ID0gdy0+bWMuZng7 CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgIHczMl9maWxsX2FyZWEgKGYsIGhk YywgY3Vyc29yX2NvbG9yLCB4LAogCQkJIFdJTkRPV19UT19GUkFNRV9QSVhFTF9ZICh3LCB3LT5w aHlzX2N1cnNvci55KSwKIAkJCSB3aWR0aCwgcm93LT5oZWlnaHQpOwpAQCAtNTg5NSwzMSArNTk1 MSwxMDggQEAgdzMyX2RyYXdfd2luZG93X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0 IGdseXBoX3JvdyAqZ2x5cGhfcm93LAogCSAgcmV0dXJuOwogCX0KIAotICAgICAgc3dpdGNoIChj dXJzb3JfdHlwZSkKLQl7Ci0JY2FzZSBIT0xMT1dfQk9YX0NVUlNPUjoKLQkgIHhfZHJhd19ob2xs b3dfY3Vyc29yICh3LCBnbHlwaF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SR0IgKGludF9yZWQs IGludF9ncmVlbiwgaW50X2JsdWUpOworICBzd2l0Y2ggKGN1cnNvcl90eXBlKQorICB7CisgICAg Y2FzZSBIT0xMT1dfQk9YX0NVUlNPUjoKKyAgICB7CisgICAgICBpZiAody0+bWMucmVkID49IDAg JiYgdy0+bWMuYmx1ZSA+PSAwICYmIHctPm1jLmdyZWVuID49IDApCisgICAgICAgIHsKKyAgICAg ICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3Bp eGVsJy4gICovCisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBj b2xvcl9waXhlbDsKKyAgICAgICAgICB4X2RyYXdfaG9sbG93X2N1cnNvciAodywgZ2x5cGhfcm93 KTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFs X2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeF9kcmF3 X2hvbGxvd19jdXJzb3IgKHcsIGdseXBoX3Jvdyk7CisgICAgICBicmVhazsKKyAgICB9CisgICAg Y2FzZSBGSUxMRURfQk9YX0NVUlNPUjoKKyAgICB7CisgICAgICBpZiAody0+bWMucmVkID49IDAg JiYgdy0+bWMuYmx1ZSA+PSAwICYmIHctPm1jLmdyZWVuID49IDApCisgICAgICAgIHsKKyAgICAg ICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2dj JyBieSBib3Jyb3dpbmcgdGhlCisgICAgICAgICAgZnVuY3Rpb25hbGl0eSBvZiBgeF9tYWtlX2dj JyBpbiB3MzJmbnMuYy4gICovCisgICAgICAgICAgYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAg c3RydWN0IHdpbmRvdyAqdyA9IGRlY29kZV9saXZlX3dpbmRvdyA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bDsKKyAgICAgICAgICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IG9yaWdpbmFs X2N1cnNvcl9waXhlbDsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYwor ICAgICAgICAgICAgPSBYQ3JlYXRlR0MgKE5VTEwsIEZSQU1FX1czMl9XSU5ET1cgKGYpLCBtYXNr LCAmZ2NfdmFsdWVzKTsKKyAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgICB9Cisg ICAgICAgIGVsc2UKKyAgICAgICAgICBkcmF3X3BoeXNfY3Vyc29yX2dseXBoICh3LCBnbHlwaF9y b3csIERSQVdfQ1VSU09SKTsKKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIEJBUl9DVVJT T1I6CisgICAgeworICAgICAgaWYgKHctPm1jLnJlZCA+PSAwICYmIHctPm1jLmJsdWUgPj0gMCAm JiB3LT5tYy5ncmVlbiA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkg aGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcuICAqLworICAgICAgICAg IGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gY29sb3JfcGl4ZWw7CisgICAgICAg ICAgdy0+bWMuY3Vyc29yX2djX2ludmlzaWJsZV9va2F5ID0gdHJ1ZTsKKyAgICAgICAgICB4X2Ry YXdfYmFyX2N1cnNvciAodywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEJBUl9DVVJTT1IpOwor ICAgICAgICAgIHctPm1jLmN1cnNvcl9nY19pbnZpc2libGVfb2theSA9IGZhbHNlOworICAgICAg ICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3Bp eGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB4X2RyYXdfYmFyX2N1cnNv ciAodywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEJBUl9DVVJTT1IpOworICAgICAgYnJlYWs7 CisgICAgfQorICAgIGNhc2UgSEJBUl9DVVJTT1I6CisgICAgeworICAgICAgaWYgKHctPm1jLnJl ZCA+PSAwICYmIHctPm1jLmJsdWUgPj0gMCAmJiB3LT5tYy5ncmVlbiA+PSAwKQorICAgICAgICB7 CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1 cnNvcl9waXhlbCcuICAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3Bp eGVsID0gY29sb3JfcGl4ZWw7CisgICAgICAgICAgdy0+bWMuY3Vyc29yX2djX2ludmlzaWJsZV9v a2F5ID0gdHJ1ZTsKKyAgICAgICAgICB4X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cGhfcm93LCBj dXJzb3Jfd2lkdGgsIEhCQVJfQ1VSU09SKTsKKyAgICAgICAgICB3LT5tYy5jdXJzb3JfZ2NfaW52 aXNpYmxlX29rYXkgPSBmYWxzZTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNv cl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNl CisgICAgICAgICAgeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIGdseXBoX3JvdywgY3Vyc29yX3dpZHRo LCBIQkFSX0NVUlNPUik7CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBOT19DVVJTT1I6 CisgICAgICB3LT5waHlzX2N1cnNvcl93aWR0aCA9IDA7CisgICAgICBicmVhazsKKyAgICBkZWZh dWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7CisgIH0KIAotCWNhc2UgSEJBUl9DVVJTT1I6Ci0J ICB4X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEhCQVJfQ1VS U09SKTsKLQkgIGJyZWFrOworLyogZW5kIE1VTFRJUExFIENVUlNPUlMgKi8KKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLwogCi0JY2FzZSBOT19DVVJTT1I6Ci0JICB3LT5waHlzX2N1cnNvcl93aWR0 aCA9IDA7Ci0JICBicmVhazsKIAotCWRlZmF1bHQ6Ci0JICBlbWFjc19hYm9ydCAoKTsKLQl9CiAg ICAgfQogfQogCmRpZmYgLS1naXQgYS9zcmMvd2luZG93LmMgYi9zcmMvd2luZG93LmMKaW5kZXgg NDIyYjA2YS4uNmYzZTU5ZCAxMDA2NDQKLS0tIGEvc3JjL3dpbmRvdy5jCisrKyBiL3NyYy93aW5k b3cuYwpAQCAtNjgxMCw2ICs2ODEwLDI5IEBAIGdldF9waHlzX2N1cnNvcl9nbHlwaCAoc3RydWN0 IHdpbmRvdyAqdykKICAgc3RydWN0IGdseXBoICpnbHlwaDsKICAgaW50IGhwb3MgPSB3LT5waHlz X2N1cnNvci5ocG9zOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUg Q1VSU09SUyAqLworCisvKiBUaGlzIG1vZGlmaWNhdGlvbiBlbmFibGVzIHBsYWNlbWVudCBvZiB0 aGUgY3Vyc29yLWluLWZyaW5nZSBiaXRtYXAgd2hlbgordGhlIHdpbmRvdy13aWR0aCBpcyBzbGln aHRseSBsZXNzIHRoYW4gYGdseXBoX3Jvdy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVfcGAuCitU aGlzIG1vZGlmaWNhdGlvbiBhbHNvIHByZXZlbnRzIGRyYXdpbmcgdGhlIHJlYWwgY3Vyc29yIG9u IHRoZSBmcmluZ2UgKGluc3RlYWQKK29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ZWNlZiAxMDA2NDQK LS0tIGEvc3JjL3dpbmRvdy5oCisrKyBiL3NyYy93aW5kb3cuaApAQCAtNzYsNiArNzYsNTAgQEAg b25lIGFuZCB0aGUgc2FtZSwgc28gaXRzIHByZXYgYW5kIG5leHQgbWVtYmVycyBhcmUgbmlsLgog CiBBIGRlYWQgd2luZG93IGhhcyBpdHMgY29udGVudHMgZmllbGQgc2V0IHRvIG5pbC4gICovCiAK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRSBDVVJTT1JTICov CisKKy8qIFN1ZmZpeGVzIGZvciB0aGUgYG1jYCB3aW5kb3cgcG9pbnRlciBwcmVmaXguICovCitz dHJ1Y3QgbXVsdGlwbGVfY3Vyc29ycworeworICAvKiBWYWx1ZXMgZm9yIHByZXZpb3VzIGFuZCBj dXJyZW50IGB3aW5kb3ctc3RhcnQnIGFuZCBgd2luZG93LWVuZCcuICovCisgIEVNQUNTX0lOVCBj dXJyZW50X3N0YXJ0LCBjdXJyZW50X2VuZCwgcHJldmlvdXNfc3RhcnQsIHByZXZpb3VzX2VuZCwg Y3VycmVudF94LCBwcmV2aW91c194OworCisgIC8qIFRydWUgbWVhbnMgdG8gZm9yY2UgYHhfc2V0 X2N1cnNvcl9nYycgdG8gdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycKKyAg aW4gdzMydGVybS5jIG9yIGBzLT5mLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MnIGluIHh0ZXJt LmMuICovCisgIGJvb2xfYmYgY3Vyc29yX2djX2RlZmF1bHQgOiAxOworCisgIC8qIFRydWUgbWVh bnMgYHhfc2V0X2N1cnNvcl9nYycgc2hvdWxkIHBlcm1pdCB0aGUgZm9yZWdyb3VuZCBhbmQgYmFj a2dyb3VuZAorICBjb2xvcnMgdG8gYmUgdGhlI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KioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgIC8qIE5vIExp c3AgZGF0YSBtYXkgZm9sbG93IGJlbG93IHRoaXMgcG9pbnQgd2l0aG91dCBjaGFuZ2luZwogICAg ICAgIG1hcmtfb2JqZWN0IGluIGFsbG9jLmMuICBUaGUgbWVtYmVyIGN1cnJlbnRfbWF0cml4IG11 c3QgYmUgdGhlCiAgICAgICAgZmlyc3Qgbm9uLUxpc3AgbWVtYmVyLiAgKi8KQEAgLTI4Myw2ICsz NDMsMTYgQEAgc3RydWN0IHdpbmRvdwogCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCiAKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgICAv KiBUaGUgcHJlZml4IGZvciB3aW5kb3cgcG9pbnRlcnMgcmVsYXRpbmcgdG8gbXVsdGlwbGUgY3Vy c29ycy4gICovCisgICAgc3RydWN0IG11bHRpcGxlX2N1cnNvcnMgbWM7CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKICAgICAvKiBDdXJzb3IgdHlwZSBvZiBsYXN0IGN1cnNvciBkcmF3 biBvbiB0aGUgd2luZG93LiAgKi8KICAgICBlbnVtIHRleHRfY3Vyc29yX2tpbmRzIHBoeXNfY3Vy c29yX3R5cGU7CiAKQEAgLTQyMSw2ICs0OTEsMjUgQEAgWFdJTkRPVyAoTGlzcF9PYmplY3QgYSkK ICAgcmV0dXJuIFhVTlRBRyAoYSwgTGlzcF9WZWN0b3JsaWtlLCBzdHJ1Y3Qgd2luZG93KTsKIH0K IAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKwor SU5MSU5FIHZvaWQKK3dzZXRfbXVsdGlwbGVfY3Vyc29yc19jYWNoZSAoc3RydWN0IHdpbmRvdyAq dywgTGlzcF9PYmplY3QgdmFsKQoreworICB3LT5tdWx0aXBsZV9jdXJzb3JzX2NhY2hlID0gdmFs OworfQorCitJTkxJTkUgdm9pZAord3NldF9jcm9zc2hhaXJzX2NhY2hlIChzdHJ1Y3Qgd2luZG93 ICp3LCBMaXNwX09iamVjdCB2YWwpCit7CisgIHctPmNyb3NzaGFpcnNfY2FjaGUgPSB2YWw7Cit9 CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC8qIE1vc3QgY29kZSBzaG91bGQgdXNl IHRoZXNlIGZ1bmN0aW9ucyB0byBzZXQgTGlzcCBmaWVsZHMgaW4gc3RydWN0CiAgICB3aW5kb3cu ICAqLwogSU5MSU5FIHZvaWQKZGlmZiAtLWdpdCBhL3NyYy94ZGlzcC5jIGIvc3JjL3hkaXNwLmMK aW5kZXggOWI0ZmViZC4uZTQ0MjJmNiAxMDA2NDQKLS0tIGEvc3JjL3hkaXNwLmMKKysrIGIvc3Jj L3hkaXNwLmMKQEAgLTkyMSw2ICs5MjEsMjY3MyBAQCBzdGF0aWMgdm9pZCBzaG93X21vdXNlX2Zh Y2UgKE1vdXNlX0hMSW5mbyAqLCBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UpOwogc3RhdGljIGJvb2wg Y29vcmRzX2luX21vdXNlX2ZhY2VfcCAoc3RydWN0IHdpbmRvdyAqLCBpbnQsIGludCk7CiAKIAor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRSBDVVJTT1JTICovCisK Ky8qIE1VTFRJUExFIENVUlNPUlM6ICBFbWFjcyBCdWcgIzIyODczIChmZWF0dXJlIHJlcXVlc3Qp CisKKyAgIENST1NTSEFJUlM6ICBFbWFjcyBCdWcgIzE3Njg0IChmZWF0dXJlIHJlcXVlc3QpCisK K1BBVENIIFZFUlNJT046ICAwMTQKK0FwcGx5IHBhdGNoIHRvIG1hc3RlciBicmFuY2g6ICBTYXQg SnVsIDcgMDk6NTk6NTMgMjAxOCAtMDcwMAorZ2l0IHJlc2V0IC0taGFyZCA5ODQ2M2JlZDA3ZWNj OTA1NzA5NDkyOGZmZGMyMzIxZWFhZjNhYjUyCisKK0xhc3QgQ29tbWl0IDogU2F0IEp1bCA3IDA5 OjU5OjUzIDIwMTggLTA3MDAKKyAgICAgICAgICAgIDogR2xlbm4gTW9ycmlzIDxyZ21AZ251Lm9y Zz4KKyAgICAgICAgICAgIDogOTg0NjNiZWQwN2VjYzkwNTcwOTQ5MjhmZmRjMjMyMWVhYWYzYWI1 MgorICAgICAgICAgICAgOiAqIGxpc3AvaW1lbnUuZWw6IFJlcXVpcmUgY2wtbGliLCBub3QgaW50 ZXJuYWwgY29tcG9uZW50cyBvZiBzYW1lLgorCitFWEFNUExFICMxOiAgKHNldHEgbWMtZ2x5cGgt bGlzdCAnKCgxICJoYmFyIiAibWFnZW50YSIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICgyICJiYXIiICJwdXJwbGUiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMyAiYm94 IiAiIzAwRkYwMCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICg0ICJob2xsb3ciICIj MDAwMEZGIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDUgKCJoYmFyIiAzKSBbMS4w IDAuMCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoNiAoImJhciIgMykgWzAu MCAxLjAgMS4wXSkpKQorCitFWEFNUExFICMyOiA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A9IGZpbmRfc3ltYm9sX3ZhbHVlICh2YXIpOworICAgICAgICAgIGlmICh2YWwgPSBGZ2V0 ICh2YXIsIFFvdmVybGF5X2Fycm93X2JpdG1hcCksIFNZTUJPTFAgKHZhbCkpCisgICAgICAgICAg ICBmcmluZ2VfYml0bWFwID0gbG9va3VwX2ZyaW5nZV9iaXRtYXAgKHZhbCk7CisgICAgICAgIH0K KyAgICAgIGdseXBoX3Jvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAgPSAoY3Vyc29yX3R5cGUgIT0g Tk9fQ1VSU09SKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZnJp bmdlX2JpdG1hcCAvKiBsb29rdXBfZnJpbmdlX2JpdG1hcCAoZmxhdm9yKSAqLworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAg IGRyYXdfZnJpbmdlX2JpdG1hcCAodywgZ2x5cGhfcm93LCB0cnVlKTsKKyAgICAgIC8qIG9wdGlt aXphdGlvbiAzOiAgRFJBVyB0aGUgYG92ZXJsYXktYXJyb3ctYml0bWFwJyBpZiB0aGVyZSBpcyBh IG1hcmtlci4gKi8KKyAgICAgIGlmIChNQVJLRVJQIChtYXJrZXIpCisgICAgICAgICAgJiYgWE1B UktFUiAobWFya2VyKS0+YnVmZmVyCisgICAgICAgICAgJiYgQlVGRkVSX0xJVkVfUCAoWE1BUktF UiAobWFya2VyKS0+YnVmZmVyKSkKKyAgICAgICAgeworICAgICAgICAgIGdseXBoX3Jvdy0+b3Zl cmxheV9hcnJvd19iaXRtYXAgPSBmcmluZ2VfYml0bWFwOworICAgICAgICAgIGRyYXdfZnJpbmdl X2JpdG1hcCAodywgZ2x5cGhfcm93LCB0cnVlKTsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNl IGlmIChmbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BTkdMRQorICAgICAgICAg ICAgIHx8IGZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFCisgICAgICAgICAgICAgfHwgZmxh dm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BTkdMRQorICAgICAgICAgICAgIHx8IGZsYXZv ciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICB8fCBmbGF2b3IgPT0gTUNfVkVSVElD QUxfQkFSX0JBQ0tTTEFTSCkKKyAgICAgIHsKKyAgICAgICAgTGlzcF9PYmplY3QgYml0bWFwX2Zs YXZvciA9IChmbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BTkdMRSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hvbGxvd19yZWN0YW5nbGVfcmln aHRfYW5nbGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGZsYXZvciA9 PSBNQ19IT0xMT1dfUkVDVEFOR0xFKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IChmbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FOR0xFKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXJfcmlnaHRf YW5nbGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGZsYXZvciA9PSBN Q19WRVJUSUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g UW1jX3ZlcnRpY2FsX2JhcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAo Zmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jhcl9iYWNrc2xhc2gKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogUW5pbDsKKyAgICAgICAgZnJpbmdlX2JpdG1h cCA9IChjdXJzb3JfdHlwZSAhPSBOT19DVVJTT1IpCisgICAgICAgICAgICAgICAgICAgICAgICA/ IGxvb2t1cF9mcmluZ2VfYml0bWFwIChiaXRtYXBfZmxhdm9yKQorICAgICAgICAgICAgICAgICAg ICAgICAgOiBOT19GUklOR0VfQklUTUFQOworICAgICAgICBmYWNlX2lkID0gKGN1cnNvcl90eXBl ICE9IE5PX0NVUlNPUikKKyAgICAgICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcs IGYsIGludGVybiAoIistdmVydGljYWwtYmFyLWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAg ICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICBnbHlwaF9yb3ctPmN1cnNvcl9pbl9mcmlu Z2VfcCA9IGZhbHNlOworICAgICAgICBnbHlwaF9yb3ctPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNf cCA9IDA7CisgICAgICAgIGdseXBoX3Jvdy0+cmlnaHRfZnJpbmdlX2JpdG1hcCA9IGZyaW5nZV9i aXRtYXA7CisgICAgICAgIGdseXBoX3Jvdy0+cmlnaHRfZnJpbmdlX2ZhY2VfaWQgPSBmYWNlX2lk OworICAgICAgICBnbHlwaF9yb3ctPnJpZ2h0X2ZyaW5nZV9vZmZzZXQgPSAwOworICAgICAgICBk cmF3X2ZyaW5nZV9iaXRtYXAgKHcsIGdseXBoX3JvdywgZmFsc2UpOworICAgICAgfQorICAgICAg ZWxzZSBpZiAoZmxhdm9yID09IE1DX0dMWVBICisgICAgICAgICAgICAgICB8fCBmbGF2b3IgPT0g TUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICB8fCBmbGF2b3IgPT0gTUNfR0xZUEhfVEFCKQor ICAgICAgICB7CisgICAgICAgICAgdy0+bWMuaCA9IGg7CisgICAgICAgICAgdy0+bWMuZnggPSBm eDsKKyAgICAgICAgICB3LT5tYy5meSA9IGZ5OworICAgICAgICAgIHctPm1jLmdseXBoX2ZsYXZv ciA9IGZsYXZvcjsKKyAgICAgICAgICB3LT5tYy5yZWQgPSBYRkxPQVRfREFUQSAoQVJFRiAoY29s b3JfdmVjdG9yLCAwKSk7CisgICAgICAgICAgdy0+bWMuZ3JlZW4gPSBYRkxPQVRfREFUQSAoQVJF RiAoY29sb3JfdmVjdG9yLCAxKSk7CisgICAgICAgICAgdy0+bWMuYmx1ZSA9IFhGTE9BVF9EQVRB IChBUkVGIChjb2xvcl92ZWN0b3IsIDIpKTsKKyAgICAgICAgICAvKiBTb21lIG9mIHRoZXNlIHZh bHVlcyBjb21lIHRocm91Z2ggYXMgMS4wMDM5MDYsIHdoaWNoIGNhdXNlcyBhIGJyZWFrYWdlCisg ICAgICAgICAgb2YgdGhlIGNvbG9ycyBpbiB0aGF0IG11bHRpcGxpY2F0aW9uIGJ5IHRoZSBiYXNl IHdpbGwgZXhjZWVkIHRoZSBiYXNlLiAqLworICAgICAgICAgIGlmICh3LT5tYy5yZWQgPiAxLjAp CisgICAgICAgICAgICB3LT5tYy5yZWQgPSAxLjA7CisgICAgICAgICAgaWYgKHctPm1jLmdyZWVu ID4gMS4wKQorICAgICAgICAgICAgdy0+bWMuZ3JlZW4gPSAxLjA7CisgICAgICAgICAgaWYgKHct Pm1jLmJsdWUgPiAxLjApCisgICAgICAgICAgICB3LT5tYy5ibHVlID0gMS4wOworICAgICAgICAg IEZSQU1FX1JJRiAoZiktPmRyYXdfd2luZG93X2N1cnNvciAodywgZ2x5cGhfcm93LCB4LCB5LCBj dXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGN1cnNvcl93aWR0aCwgdHJ1ZSwgZmFsc2UpOworICAgICAgICB9CisgIC8qIF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yLCAiaG9sbG93IikpCisgICAgcmV0dXJuIEhPTExPV19CT1hfQ1VSU09SOworICBpZiAo IXN0cmNtcCAoc3RyLCAiaGJhciIpKQorICAgIHJldHVybiBIQkFSX0NVUlNPUjsKKyAgaWYgKCFz dHJjbXAgKHN0ciwgImJhciIpKQorICAgIHJldHVybiBCQVJfQ1VSU09SOworICBpZiAoIXN0cmNt cCAoc3RyLCAibm8iKSkKKyAgICByZXR1cm4gTk9fQ1VSU09SOworICByZXR1cm4gLTE7Cit9CisK K3N0YXRpYyBMaXNwX09iamVjdAorbWNfY3Vyc29yX3R5cGVfdG9fbGlzcCAoaW50IGFyZykKK3sK KyAgc3dpdGNoIChhcmcpCisgICAgeworICAgIGNhc2UgRklMTEVEX0JPWF9DVVJTT1I6IHJldHVy biBRYm94OworICAgIGNhc2UgSE9MTE9XX0JPWF9DVVJTT1I6IHJldHVybiBRaG9sbG93OworICAg IGNhc2UgSEJBUl9DVVJTT1I6IHJldHVybiBRaGJhcjsKKyAgICBjYXNlIEJBUl9DVVJTT1I6IHJl dHVybiBRYmFyOworICAgIGNhc2UgTk9fQ1VSU09SOgorICAgIGRlZmF1bHQ6IHJldHVybiBpbnRl cm4gKCJubyIpOworICAgIH0KK30KKworc3RhdGljIExpc3BfT2JqZWN0CittY19jb2xvcl92ZWN0 b3JfY2FsYyAoc3RydWN0IHdpbmRvdyAqdywgTGlzcF9PYmplY3QgY29sb3IpCit7CisgIENIRUNL X1NUUklORyAoY29sb3IpOworICBMaXNwX09iamVjdCB0YXJnZXRfZnJhbWUgPSB3LT5mcmFtZTsK KyAgTGlzcF9PYmplY3QgY29sb3JfdmFsdWVzOworICBkb3VibGUgdmFsbWF4ID0gWElOVCAoWENB UiAoRnh3X2NvbG9yX3ZhbHVlcyAoYnVpbGRfc3RyaW5nICgiI2ZmZmZmZiIpLCB0YXJnZXRfZnJh bWUpKSk7CisgIExpc3BfT2JqZWN0IHZsaXN0OworICBwdHJkaWZmX3QgeDsKKyAgaW50IGkgPSAw OworICBMaXNwX09iamVjdCB0ZW1wID0gUW5pbDsKKyAgTGlzcF9PYmplY3QgdmVjdG9yID0gKEZt YWtlX3ZlY3RvciAobWFrZV9udW1iZXIgKDMpLCBRbmlsKSk7CisgIGlmICghTklMUCAoRm1lbXEg KChGZnJhbWVwICh0YXJnZXRfZnJhbWUpKSwgbGlzdG4gKENPTlNUWVBFX0hFQVAsIDMsIGludGVy biAoIngiKSwgaW50ZXJuICgidzMyIiksIGludGVybiAoIm5zIikpKSkpCisgICAgeworICAgICAg Y29sb3JfdmFsdWVzID0gKEZ4d19jb2xvcl92YWx1ZXMgKGNvbG9yLCB0YXJnZXRfZnJhbWUpKTsK KyAgICAgIGZvciAodmxpc3QgPSBjb2xvcl92YWx1ZXM7CisgICAgICAgICAgIENPTlNQICh2bGlz dCk7CisgICAgICAgICAgIHZsaXN0ID0gWENEUiAodmxpc3QpKQorICAgICAgICB7CisgICAgICAg ICAgeCA9IFhJTlQgKFhDQVIgKHZsaXN0KSk7CisgICAgICAgICAgdGVtcCA9IG1ha2VfZmxvYXQg KHggLyB2YWxtYXgpOworICAgICAgICAgIEFTRVQgKHZlY3RvciwgaSwgdGVtcCk7CisgICAgICAg ICAgaSA9IGkgKyAxOworICAgICAgICB9CisgICAgfQorICByZXR1cm4gdmVjdG9yOworfQorCisv KiBZb3Ugb25seSBuZWVkIHRvIGNhbGwgbG9va3VwX2Jhc2ljX2ZhY2UgaWYgaXQuZmFjZV9pZCBp cyBhIGJhc2ljIGZhY2UKK0FORCBmYWNlLXJlbWFwcGluZy1hbGlzdCBpcyBub24tbmlsLiAgSWYg aXQuZmFjZV9pZCBpcyBub3QgYSBiYXNpYworZmFjZSwgbG9va3VwX2Jhc2ljX2ZhY2Ugd2lsbCBh Ym9ydCwgYW5kIHlvdSBzaG91bGQgY2FsbCBsb29rdXBfZmFjZQoraW5zdGVhZC4gIEZvciBhIHJl bWFwcGVkIG5vbi1iYXNpYyBmYWNlIHlvdSB3aWxsIGhhdmU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QpXG5cCisgICAgZm9udC0+c3BhY2Vfd2lkdGggKCVkKVxu XAorICAgIGl0LT5sbnVtX3BpeGVsX3dpZHRoICglZClcblwKKyAgICBpdC0+bG51bV93aWR0aCAo JWQpXG5cCisgICAgaXQtPnBpeGVsX3dpZHRoICglZClcblwKKyAgICBpdC0+Zmlyc3RfdmlzaWJs ZV94ICglZClcblwKKyAgICBpdC0+bGFzdF92aXNpYmxlX3ggKCVkKVxuXAorICAgIHJlbGF0aXZl X3ggKCVkKVxuXAorICAgIGl0LT5mYWNlX2lkICglZClcblwKKyAgICBmb3JlZ3JvdW5kX2ZhY2Ug KCVzKVxuXAorICAgIGJhY2tncm91bmRfZmFjZSAoJXMpXG5cCisgICAgcHJldmlvdXMgY2hhcmFj dGVyICglcylcblwKKyAgICBwcmV2aW91c19ocG9zICglZClcblwKKyAgICBpc3N1ZV8zMTcxNl9w ICglcylcblwKKyAgICBmaW5hbF9sb29wX3AgKCVzKVxuXAorICAgIGxwd19yZWFjaGVkX3AgKCVz KVxuXAorICAgIGdyZWVuX2xpZ2h0X3AgKCVzKVxuXAorICAgIGFkdmFuY2VfaHBvc19wICglcylc blwKKyAgICBnaG9zdF9jaHJpc3RtYXNfZnV0dXJlX3AgKCVzKVxuXAorICAgIHJjICglcylcbiIs CisgICAgICBjb3VudCwKKyAgICAgIChpdC0+YyA9PSAwCisgICAgICAgID8gIk5PVEhJTkciCisg ICAgICAgIDogaXQtPmMgPT0gMTg3CisgICAgICAgICAgPyAiVEFCIENIQVJBQ1RFUiIKKyAgICAg ICAgOiBpdC0+YyA9PSAnXHQnCisgICAgICAgICAgPyAiVEFCIFNUUkVUQ0giCisgICAgICAgIDog IlRFWFQiKSwKKyAgICAgIChyZWxhdGl2ZV94ID09IGl0LT5sbnVtX3BpeGVsX3dpZHRoCisgICAg ICAgID8gIiAtLSBUSEUgRlVOIFNUQVJUUyBIRVJFIgorICAgICAgICA6ICIiKSwKKyAgICAgIChh Y3Rpb25fdHlwZSA9PSBNVUxUSVBMRV9DVVJTT1JTCisgICAgICAgPyAiTVVMVElQTEVfQ1VSU09S UyIKKyAgICAgICA6IGFjdGlvbl90eXBlID09IEhPUklaT05UQUxfUlVMRVIKKyAgICAgICAgID8g IkhPUklaT05UQUxfUlVMRVIiCisgICAgICAgOiBhY3Rpb25fdHlwZSA9PSBWRVJUSUNBTF9SVUxF UgorICAgICAgICAgPyAiVkVSVElDQUxfUlVMRVIiCisgICAgICAgOiAiT09QUyIpLAorICAgICAg aXQtPmMsCisgICAgICBGRVRDSF9CWVRFIChJVF9CWVRFUE9TICgqaXQpKSwKKyAgICAgICghTklM UCAoRmNoYXJfdG9fc3RyaW5nIChtYWtlX251bWJlciAoaXQtPmMpKSkKKyAgICAgICAgPyBTU0RB VEEgKEZjaGFyX3RvX3N0cmluZyAobWFrZV9udW1iZXIgKGl0LT5jKSkpCisgICAgICAgIDogIk5J TFAgLS0gaXQtPmMgYXMgYSBzdHJpbmciKSwKKyAgICAgIGl0X2NoYXJwb3MsCisgICAgICAvKiBX aGVuIGBpdC0+dy0+aHNjcm9sbGAgaXMgc2V0IHRvIGFuIGBpbnRgLCBnZGIgcmVwb3J0cyB0aGUg dmFsdWUKKyAgICAgIGFzIGJlaW5nOiAgPHZhcmlhYmxlIG9wdGltaXplZCBhd2F5IGJ5IGNvbXBp bGVyPiAqLworICAgICAgd19oc2Nyb2xsLAorICAgICAgd19taW5faHNjcm9sbCwKKyAgICAgICho c2NsX3RlbXBvcmFyeSA/ICJ0cnVlIiA6ICJmYWxzZSIpLAorICAgICAgKGhzY2xfcGVybWFuZW50 ID8gInRydWUiIDogImZhbHNlIiksCisgICAgICBpdC0+aHBvcywKKyAgICAgIGl0LT52cG9zLAor ICAgICAgaXQtPmN1cnJlbnRfeCwKKyAgICAgIG5ld194LAorICAgICAgLyogQ2Fubm90IGFjY2Vz cyBtZW1vcnkgYXQgYWRkcmVzcyAweGEwLiAgVGhpcyBjYW1lIGFib3V0IGJ5IHVzaW5nCisgICAg ICBgP1xVMDAwMUQ0RDVgIHRvIGNyZWF0ZSBhIGZhbmN5IGZvcm0gZmVlZCBjaGFyYWN0ZXIgdGhh dCB3YXMgbm90CisgICAgICByZWNvZ25pemVkIGJ5IHRoZSBmb250IGNob3NlbiBvbiBYMTEuICov CisgICAgICAoZm9udCA9PSBOVUxMCisgICAgICAgPyAwCisgICAgICAgOiBmb250LT5zcGFjZV93 aWR0aCksCisgICAgICBpdC0+bG51bV9waXhlbF93aWR0aCwKKyAgICAgIGl0LT5sbnVtX3dpZHRo LAorICAgICAgaXQtPnBpeGVsX3dpZHRoLAorICAgICAgaXQtPmZpcnN0X3Zpc2libGVfeCwKKyAg ICAgIGl0LT5sYXN0X3Zpc2libGVfeCwKKyAgICAgIHJlbGF0aXZlX3gsCisgICAgICBpdC0+ZmFj ZV9pZCwKKyAgICAgICghTklMUCAoZm9yZWdyb3VuZF9mYWNlKQorICAgICAgICA/IFNTREFUQSAo Zm9yZWdyb3VuZF9mYWNlKQorICAgICAgICA6ICJOSUxQIGZvcmVncm91bmRfZmFjZSIpLAorICAg ICAgKCFOSUxQIChiYWNrZ3JvdW5kX2ZhY2UpCisgICAgICAgID8gU1NEQVRBIChiYWNrZ3JvdW5k X2ZhY2UpCisgICAgICAgIDogIk5JTFAgYmFja2dyb3VuZF9mYWNlIiksCisgICAgICAoIU5JTFAg KEZjaGFyX3RvX3N0cmluZyAobWFrZV9udW1iZXIgKHByZXZpb3VzX2NoYXJhY3RlcikpKQorICAg ICAgICA/IFNTREFUQSAoRmNoYXJfdG9fc3RyaW5nIChtYWtlX251bWJlciAocHJldmlvdXNfY2hh cmFjdGVyKSkpCisgICAgICAgIDogIk5JTFAgLS0gcHJldmlvdXNfY2hhcmFjdGVyIGFzIGEgc3Ry aW5nIiksCisgICAgICBwcmV2aW91c19ocG9zLAorICAgICAgKGlzc3VlXzMxNzE2X3AgPyAidHJ1 ZSIgOiAiZmFsc2UiKSwKKyAgICAgIChmaW5hbF9sb29wX3AgPyAidHJ1ZSIgOiAiZmFsc2UiKSwK KyAgICAgIChscHdfcmVhY2hlZF9wID8gInRydWUiIDogImZhbHNlIiksCisgICAgICAoZ3JlZW5f bGlnaHRfcCA/ICJ0cnVlIiA6ICJmYWxzZSIpLAorICAgICAgKGFkdmFuY2VfaHBvc19wID8gInRy dWUiIDogImZhbHNlIiksCisgICAgICAoZ2hvc3RfY2hyaXN0bWFzX2Z1dHVyZV9wID8gInRydWUi IDogImZhbHNlIiksCisgICAgICAocmMgPT0gTU9WRV9VTkRFRklORUQKKyAgICAgICAgPyAiTU9W RV9VTkRFRklORUQiCisgICAgICAgIDogcmMgPT0gTU9WRV9QT1NfTUFUQ0hfT1JfWlYKKyAgICAg ICAgICA/ICJNT1ZFX1BPU19NQVRDSF9PUl9aViIKKyAgICAgICAgOiByYyA9PSBNT1ZFX1hfUkVB Q0hFRAorICAgICAgICAgID8gIk1PVkVfWF9SRUFDSEVEIgorICAgICAgICA6IHJjID09IE1PVkVf TElORV9DT05USU5VRUQKKyAgICAgICAgICA/ICJNT1ZFX0xJTkVfQ09OVElOVUVEIgorICAgICAg ICA6IHJjID09IE1PVkVfTElORV9UUlVOQ0FURUQKKyAgICAgICAgICA/ICJNT1ZFX0xJTkVfVFJV TkNBVEVEIgorICAgICAgICA6IHJjID09IE1PVkVfTkVXTElORV9PUl9DUgorICAgICAgICAgID8g Ik1PVkVfTkVXTElORV9PUl9DUiIKKyAgICAgICAgOiAiT09QUyIpKTsKK30KKworc3RhdGljIHZv aWQKK21jX2Nyb3NzaGFpcnNfaGVscGVyIChzdHJ1Y3Qgd2luZG93ICp3LCBpbnQgeCwgaW50IGZ4 LCBpbnQgeSwgaW50IGZ5LCBpbnQgaHBvcywKKyAgICAgICAgICAgICAgICAgICAgICBpbnQgdnBv cywgaW50IGgsIGVudW0gdGV4dF9jdXJzb3Jfa2luZHMgdHlwZSwgaW50IHdpZHRoLAorICAgICAg ICAgICAgICAgICAgICAgIExpc3BfT2JqZWN0IGZvcmVncm91bmQsIExpc3BfT2JqZWN0IGJhY2tn cm91bmQsCisgICAgICAgICAgICAgICAgICAgICAgaW50IGZsYXZvciwgcHRyZGlmZl90IHBvcywg TGlzcF9PYmplY3QgKnJlc3VsdCkKK3sKKyAgTGlzcF9PYmplY3QgdGhpcnRlZW5fZWxlbWVudHM7 CisgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIGgs IHR5cGUsIHdpZHRoLCBmb3JlZ3JvdW5kLCBmbGF2b3IpOworICB0aGlydGVlbl9lbGVtZW50cyA9 IGxpc3RuIChDT05TVFlQRV9IRUFQLCAxMywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG1h a2VfbnVtYmVyICh4KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ha2VfbnVtYmVyIChm eCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICBtYWtlX251bWJlciAoeSksCisgICAgICAg ICAgICAgICAgICAgICAgICAgICBtYWtlX251bWJlciAoZnkpLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgbWFrZV9udW1iZXIgKGhwb3MpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg bWFrZV9udW1iZXIgKHZwb3MpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFrZV9udW1i ZXIgKGgpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgbWNfY3Vyc29yX3R5cGVfdG9fbGlz cCAodHlwZSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICBtYWtlX251bWJlciAod2lkdGgp LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBtYWtl X251bWJlciAoZmxhdm9yKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ha2VfbnVtYmVy IChwb3MpKTsKKyAgKnJlc3VsdCA9IEZjb25zICh0aGlydGVlbl9lbGVtZW50cywgKnJlc3VsdCk7 Cit9CisKK3N0YXRpYyB2b2lkCittY19jYWxjX2hlbHBlciAoc3RydWN0IHdpbmRvdyAqdywgaW50 IHgsIGludCBmeCwgaW50IHksIGludCBmeSwgaW50IGhwb3MsCisgICAgICAgICAgICAgICAgaW50 IHZwb3MsIGludCBoLCBlbnVtIHRleHRfY3Vyc29yX2tpbmRzIHR5cGUsIGludCB3aWR0aCwKKyAg ICAgICAgICAgICAgICBMaXNwX09iamVjdCBmb3JlZ3JvdW5kLCBMaXNwX09iamVjdCBiYWNrZ3Jv dW5kLCBpbnQgZmxhdm9yLAorICAgICAgICAgICAgICAgIHB0cmRpZmZfdCBwb3MsIExpc3BfT2Jq ZWN0IHNwZWNzLCBMaXNwX09iamVjdCAqcmVzdWx0KQoreworICBMaXNwX09iamVjdCB0aGlydGVl bl9lbGVtZW50czsKKyAgTGlzcF9PYmplY3QgdGVtcDsKKyAgbWNfZHJhd19lcmFzZV9oeWJyaWQg KHcsIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgaCwgdHlwZSwgd2lkdGgsIGZvcmVncm91bmQs IGZsYXZvcik7CisgIHRoaXJ0ZWVuX2VsZW1lbnRzID0gbGlzdG4gKENPTlNUWVBFX0hFQVAsIDEz LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFrZV9udW1iZXIgKHgpLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgbWFrZV9udW1iZXIgKGZ4KSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgIG1ha2VfbnVtYmVyICh5KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ha2Vf bnVtYmVyIChmeSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICBtYWtlX251bWJlciAoaHBv cyksCisgICAgICAgICAgICAgICAgICAgICAgICAgICBtYWtlX251bWJlciAodnBvcyksCisgICAg ICAgICAgICAgICAgICAgICAgICAgICBtYWtlX251bWJlciAoaCksCisgICAgICAgICAgICAgICAg ICAgICAgICAgICBtY19jdXJzb3JfdHlwZV90b19saXNwICh0eXBlKSwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgIG1ha2VfbnVtYmVyICh3aWR0aCksCisgICAgICAgICAgICAgICAgICAgICAg ICAgICBmb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ha2VfbnVtYmVyIChmbGF2b3IpLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgbWFrZV9udW1iZXIgKHBvcykpOworICB0ZW1wID0gRmNvbnMg KHNwZWNzLCBGY29ucyAodGhpcnRlZW5fZWxlbWVudHMsIFFuaWwpKTsKKyAgKnJlc3VsdCA9IEZj b25zICh0ZW1wLCAqcmVzdWx0KTsKK30KKworc3RhdGljIHZvaWQKK21jX2dldF9waHlzX2N1cnNv cl9nZW9tZXRyeSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqZ2x5cGhfcm93 LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgeCwgaW50ICpmeCwgaW50IHksIGlu dCAqZnksIGludCBocG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgdnBvcywg aW50ICpoLCBlbnVtIHRleHRfY3Vyc29yX2tpbmRzIHR5cGUsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGgpCit7CisgIGludCBjdXJzb3JfaGVpZ2h0OworICBi b29sIG9yaWdpbmFsX2N1cnNvcl9pbl9mcmluZ2VfcCA9IGdseXBoX3Jvdy0+Y3Vyc29yX2luX2Zy aW5nZV9wOworICBib29sIG9yaWdpbmFsX3JldmVyc2VkX3AgPSBnbHlwaF9yb3ctPnJldmVyc2Vk X3A7CisgIHB0cmRpZmZfdCBvcmlnaW5hbF94ID0gdy0+cGh5c19jdXJzb3IueDsKKyAgcH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Y3MpKQorICAgICAgICAgICAgICAgICAgICAgPyAtMQorICAgICAgICAgICAgICAgICAg ICAgOiBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMCksIHNwZWNzKSk7CisgIExpc3BfT2JqZWN0 IGxpc3BfdHlwZSA9IChWRUNUT1JQIChzcGVjcykpCisgICAgICAgICAgICAgICAgICAgICAgICAg ID8gUW5pbAorICAgICAgICAgICAgICAgICAgICAgICAgICA6IEZudGggKG1ha2VfbnVtYmVyICgx KSwgc3BlY3MpOworICBlbnVtIHRleHRfY3Vyc29yX2tpbmRzIGN1cnNvcl90eXBlID0gKFZFQ1RP UlAgKHNwZWNzKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGFj dGlvbl90eXBlID09IEhPUklaT05UQUxfUlVMRVIpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IEhCQVJfQ1VSU09SCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6ICAoVkVDVE9SUCAoc3BlY3MpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgYWN0aW9uX3R5cGUgPT0gVkVSVElDQUxfUlVMRVIpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gQkFSX0NVUlNPUgorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoQ09OU1AgKGxpc3BfdHlwZSkpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IG1jX2xpc3BfdG9fY3Vy c29yX3R5cGUgKFhDQVIgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKGxpc3BfdHlwZSk7CisgIGludCBj dXJzb3Jfd2lkdGggPSAoVkVDVE9SUCAoc3BlY3MpKQorICAgICAgICAgICAgICAgICAgICAgPyAx CisgICAgICAgICAgICAgICAgICAgICA6IChDT05TUCAobGlzcF90eXBlKSkKKyAgICAgICAgICAg ICAgICAgICAgICAgID8gWElOVCAoWENBUiAoWENEUiAobGlzcF90eXBlKSkpCisgICAgICAgICAg ICAgICAgICAgICA6IDE7CisgIExpc3BfT2JqZWN0IGZvcmVncm91bmQgPSAoVkVDVE9SUCAoc3Bl Y3MpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBzcGVjcworICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiBGbnRoIChtYWtlX251bWJlciAoMiksIHNwZWNzKTsKKyAgaWYgKFNUUklO R1AgKGZvcmVncm91bmQpKQorICAgIGZvcmVncm91bmQgPSBtY19jb2xvcl92ZWN0b3JfY2FsYyAo aXQtPncsIGZvcmVncm91bmQpOworICBpbnQgb3BvaW50X3ggPSBpdC0+dy0+b3V0cHV0X2N1cnNv ci54OworICBpbnQgb3BvaW50X3kgPSBpdC0+dy0+b3V0cHV0X2N1cnNvci55OworICBpbnQgb3Bv aW50X2hwb3MgPSBpdC0+dy0+b3V0cHV0X2N1cnNvci5ocG9zOworICBpbnQgb3BvaW50X3Zwb3Mg PSBpdC0+dy0+b3V0cHV0X2N1cnNvci52cG9zOworICBpbnQgcmVsYXRpdmVfeCA9IDA7CisgIGlu dCBwcmlvcl9wcmV2aW91c19ocG9zID0gLTE7CisgIGludCBwcmV2aW91c19ocG9zID0gLTE7Cisg IGVudW0gbW92ZV9pdF9yZXN1bHQgcmMgPSBNT1ZFX1hfUkVBQ0hFRDsKKyAgTGlzcF9PYmplY3Qg YnVmID0gaXQtPnctPmNvbnRlbnRzOworICBpbnQgZnJhbWVfY2hhcl93aWR0aCA9IEZSQU1FX0NP TFVNTl9XSURUSCAoaXQtPmYpOworICBpbnQgdGV4dF9hcmVhX3dpZHRoID0gd2luZG93X2JveF93 aWR0aCAoaXQtPncsIFRFWFRfQVJFQSk7CisgIGJvb2wgY3Vyc29yX2luX2ZyaW5nZV9wID0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ICghTklMUCAocmVnaW9uX2xpbWl0X3RydWUpKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gWElOVCAocmVnaW9uX2xpbWl0X3RydWUpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiAwOworICBMaXNwX09iamVjdCByZWdpb25fbGltaXRfZmFs c2UgPSBtY19yZWdpb25fbGltaXQgKGZhbHNlKTsKKyAgcHRyZGlmZl90IHJlZ2lvbl9lbmQgPSAo IU5JTFAgKHJlZ2lvbl9saW1pdF9mYWxzZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgPyBY SU5UIChyZWdpb25fbGltaXRfZmFsc2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgOiAwOwor ICBzdHJ1Y3QgZ2x5cGggKnJlYWxfcGh5c19jdXJzb3JfZ2x5cGggPSBnZXRfcGh5c19jdXJzb3Jf Z2x5cGggKGl0LT53KTsKKyAgYm9vbCByZWdpb25fYWN0aXZlX3AgPSAocmVnaW9uX2JlZ2lubmlu ZyAhPSByZWdpb25fZW5kKTsKKyAgd2hpbGUgKHRydWUpCisgICAgeworICAgICAgY291bnQgKz0g MTsKKyAgICAgIHN0cnVjdCBmYWNlICpmYWNlID0gbWNfbG9va3VwX2ZhY2UgKGl0KTsKKyAgICAg IHN0cnVjdCBmb250ICpmb250ID0gZmFjZS0+Zm9udDsKKyAgICAgIGludCBmb250X3NwYWNlX3dp ZHRoID0gKGZvbnQgPT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBmcmFt ZV9jaGFyX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGZvbnQtPnNwYWNl X3dpZHRoKTsKKyAgICAgIGlmIChoZWFkZXJfbGluZV9oZWlnaHQgPiAwKQorICAgICAgICB2cG9z ID0gaXQtPnZwb3MgKyAxOworICAgICAgICBlbHNlCisgICAgICAgICAgdnBvcyA9IGl0LT52cG9z OworICAgICAgYm9vbCBoc2NsX3RlbXBvcmFyeSA9ICghaXQtPnctPnN1c3BlbmRfYXV0b19oc2Ny b2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIEVRIChGYnVmZmVyX2xvY2FsX3Zh bHVlIChRYXV0b19oc2Nyb2xsX21vZGUsIGJ1ZiksIFFjdXJyZW50X2xpbmUpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIGl0LT53LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBpdC0+dy0+bWluX2hzY3JvbGwgPT0gMAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBvcG9pbnRfeSA9PSBpdC0+Y3VycmVudF95CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIG9wb2ludF92cG9zID09IHZwb3MpOworICAgICAgYm9vbCBoc2Ns X3Blcm1hbmVudCA9ICghaXQtPnctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIEVRIChGYnVmZmVyX2xvY2FsX3ZhbHVlIChRYXV0b19oc2Nyb2xs X21vZGUsIGJ1ZiksIFFjdXJyZW50X2xpbmUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIGl0LT53LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBp dC0+dy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGl0 LT53LT5taW5faHNjcm9sbCAhPSBpdC0+dy0+aHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBvcG9pbnRfeSA9PSBpdC0+Y3VycmVudF95CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIG9wb2ludF92cG9zID09IHZwb3MpOworICAgICAgLyogVGVtcG9yYXJ5IGhv cml6b250YWwgc2Nyb2xsaW5nIG9mIF9vbmx5XyB0aGUgY3VycmVudCBsaW5lLgorICAgICAg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lyc3RfdmlzaWJsZV94ICsgaXQtPmxudW1fcGl4ZWxfd2lkdGg7IGFuZCwgdGhlIG5l eHQgZGlzcGxheSBlbGVtZW50IGlzCisgICAgICBzdWJzZXF1ZW50IHRoZXJldG8uCisgICAgICAt LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICA3LiAgVEFCIFNUUkVUQ0gKKyAg ICAgICAgICBpdC0+YyAoOSkKKyAgICAgICAgICBjaGFyICgJKQorICAgICAgICAgIGl0LT53LT5o c2Nyb2xsICg0KQorICAgICAgICAgIGhzY2xfdGVtcG9yYXJ5IChmYWxzZSkKKyAgICAgICAgICBp dC0+aHBvcyAoMCkKKyAgICAgICAgICBpdC0+Y3VycmVudF94ICgxMSkKKyAgICAgICAgICBuZXdf eCAoNzcpCisgICAgICAgICAgZm9udF9zcGFjZV93aWR0aCAoMTEpCisgICAgICAgICAgaXQtPmxu dW1fcGl4ZWxfd2lkdGggKDQ0KQorICAgICAgICAgIHJlbGF0aXZlX3ggKDMzKQorICAgICAgICAg IHJjIChNT1ZFX1hfUkVBQ0hFRCkKKyAgICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0KKyAgICAgIDguICBURVhUIC0tIFRIRSBGVU4gU1RBUlRTIEhFUkUKKyAgICAgICAgICBpdC0+ YyAoNzIpCisgICAgICAgICAgY2hhciAoSCkKKyAgICAgICAgICBpdC0+dy0+aHNjcm9sbCAoNCkK KyAgICAgICAgICBoc2NsX3RlbXBvcmFyeSAoZmFsc2UpCisgICAgICAgICAgaXQtPmhwb3MgKDUp CisgICAgICAgICAgaXQtPmN1cnJlbnRfeCAoMTMyKQorICAgICAgICAgIG5ld194ICg4OCkKKyAg ICAgICAgICBmb250X3NwYWNlX3dpZHRoICgxMSkKKyAgICAgICAgICBpdC0+bG51bV9waXhlbF93 aWR0aCAoNDQpCisgICAgICAgICAgcmVsYXRpdmVfeCAoNDQpCisgICAgICAgICAgcmMgKE1PVkVf WF9SRUFDSEVEKQorICAgICAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgICAg Ny4gIFRBQiBTVFJFVENICisgICAgICAgICAgaXQtPmMgKDkpCisgICAgICAgICAgY2hhciAoCSkK KyAgICAgICAgICBpdC0+dy0+aHNjcm9sbCAoMikKKyAgICAgICAgICBoc2NsX3RlbXBvcmFyeSAo ZmFsc2UpCisgICAgICAgICAgaXQtPmhwb3MgKDApCisgICAgICAgICAgaXQtPmN1cnJlbnRfeCAo MTEpCisgICAgICAgICAgbmV3X3ggKDc3KQorICAgICAgICAgIGZvbnRfc3BhY2Vfd2lkdGggKDEx KQorICAgICAgICAgIGl0LT5sbnVtX3BpeGVsX3dpZHRoICg0NCkKKyAgICAgICAgICByZWxhdGl2 ZV94ICg1NSkKKyAgICAgICAgICByYyAoTU9WRV9YX1JFQUNIRUQpCisgICAgICAtLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICA4LiAgVEVYVAorICAgICAgICAgIGl0LT5jICg3 MikKKyAgICAgICAgICBjaGFyIChIKQorICAgICAgICAgIGl0LT53LT5oc2Nyb2xsICgyKQorICAg ICAgICAgIGhzY2xfdGVtcG9yYXJ5IChmYWxzZSkKKyAgICAgICAgICBpdC0+aHBvcyAoNSkKKyAg ICAgICAgICBpdC0+Y3VycmVudF94ICgxMzIpCisgICAgICAgICAgbmV3X3ggKDg4KQorICAgICAg ICAgIGZvbnRfc3BhY2Vfd2lkdGggKDExKQorICAgICAgICAgIGl0LT5sbnVtX3BpeGVsX3dpZHRo ICg0NCkKKyAgICAgICAgICByZWxhdGl2ZV94ICg2NikKKyAgICAgICAgICByYyAoTU9WRV9YX1JF QUNIRUQpICovCisgICAgICBib29sIGlzc3VlXzMxNzE2X3AgPSAoIWhzY2xfdGVtcG9yYXJ5Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIWhzY2xfcGVybWFuZW50CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgaXQtPnctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgcHJpb3JfcHJldmlvdXNfaHBvcyA9PSAtMQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHByZXZpb3VzX2NoYXJhY3RlciA9PSAnXHQnCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgaXQtPmhwb3MgPiBpdC0+bG51bV9waXhlbF93aWR0aCAvIGZvbnRf c3BhY2Vfd2lkdGgpOworICAgICAgaW50IGhzY2xfeCA9IChoc2NsX3RlbXBvcmFyeQorICAgICAg ICAgICAgICAgICAgICB8fCBoc2NsX3Blcm1hbmVudCkKKyAgICAgICAgICAgICAgICAgICAgPyBp dC0+Y3VycmVudF94IC0gKGhzY2xfZmlyc3RfaHBvcyAqIGZyYW1lX2NoYXJfd2lkdGgpCisgICAg ICAgICAgICAgICAgICAgIDogaXQtPmN1cnJlbnRfeCAtIGl0LT5maXJzdF92aXNpYmxlX3g7Cisg ICAgICBib29sIGZpbmFsX2xvb3BfcCA9ICghaHNjbF90ZW1wb3JhcnkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmICFoc2NsX3Blcm1hbmVudCkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgPyAoKEZFVENIX0JZVEUgKElUX0JZVEVQT1MgKCppdCkpID09ICdcbicKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIGl0LT5jICE9IDAKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIC8qIFdlIGtlZXAgZ29pbmcgdW50aWwgYHJlbGF0aXZlX3hgIGNhdGNoZXMgdXAgd2l0 aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYGl0LT5jdXJyZW50X3hgIGZvciBhIHNp dHVhdGlvbiBzdWNoIGFzIGEgbGluZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29u dGFpbmluZyBvbmx5IGEgdGFiIGZvbGxlZCBieSBhIG5ldyBsaW5lOyBlLmcuLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgaXNzdWVfMzE3MTZfcCBmb2xsb3dlZCBieSBhIEdob3N0IG9m IENocmlzdG1hcyBmdXR1cmUuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXZSB1c2Ug Pj0gYmVjYXVzZSB0aGVyZSBpcyBubyBndWFyYW50ZWUgdGhhdCBhbGwgb2YKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGNoYXJhY3RlcnMgd2lsbCBiZSBleGFjdGx5IGBmb250X2NoYXJf d2lkdGgnLiAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgKHJlbGF0aXZlX3gg Pj0gaXQtPmN1cnJlbnRfeCAtIGl0LT5maXJzdF92aXNpYmxlX3gKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAvKiBQZXJtYW5lbnRseSBoLXNjcm9sbGVkIGFuZCBvbmx5IGEgbmV3 IGxpbmUuICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgaXQtPmN1cnJl bnRfeCA9PSAwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogfHwgSVRFUkFUT1Jf QVRfRU5EX09GX0xJTkVfUCAoaXQpICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8 IHJjID09IE1PVkVfUE9TX01BVENIX09SX1pWCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHx8IHJjID09IE1PVkVfTElORV9DT05USU5VRUQKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgfHwgaHNjbF94ICsgZnJhbWVfY2hhcl93aWR0aCA+PSB0ZXh0X2FyZWFfd2lkdGgpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiB0cnVlCisgICAgICAgICAgICAgICAgICAgICAgICAg ID8gKGhzY2xfdGVtcG9yYXJ5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGhzY2xf cGVybWFuZW50KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gKChGRVRDSF9CWVRFIChJ VF9CWVRFUE9TICgqaXQpKSA9PSAnXG4nCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIGl0LT5jICE9IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogV2Uga2Vl cCBnb2luZyB1bnRpbCBgcmVsYXRpdmVfeGAgY2F0Y2hlcyB1cCB3aXRoCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGBpdC0+Y3VycmVudF94YCBmb3IgYSBzaXR1YXRpb24gc3VjaCBh cyBhIGxpbmUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGFpbmluZyBvbmx5 IGEgdGFiIGZvbGxlZCBieSBhIG5ldyBsaW5lOyBlLmcuLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBpc3N1ZV8zMTcxNl9wIGZvbGxvd2VkIGJ5IGEgR2hvc3Qgb2YgQ2hyaXN0bWFz IGZ1dHVyZS4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV2UgdXNlID49IGJlY2F1 c2UgdGhlcmUgaXMgbm8gZ3VhcmFudGVlIHRoYXQgYWxsIG9mCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGNoYXJhY3RlcnMgd2lsbCBiZSBleGFjdGx5IGBmb250X2NoYXJfd2lkdGgn LiAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByZWxhdGl2ZV94ID49IGl0 LT5jdXJyZW50X3ggLSAoaHNjbF9maXJzdF9ocG9zICogZnJhbWVfY2hhcl93aWR0aCkpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogfHwgSVRFUkFUT1JfQVRfRU5EX09GX0xJTkVf UCAoaXQpICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgcmMgPT0gTU9WRV9Q T1NfTUFUQ0hfT1JfWlYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCByYyA9PSBN T1ZFX0xJTkVfQ09OVElOVUVECisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgaHNj bF94ICsgZnJhbWVfY2hhcl93aWR0aCA+PSB0ZXh0X2FyZWFfd2lkdGgpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IHRydWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgOiBmYWxz ZTsKKyAgICAgIGJvb2wgbHB3X3JlYWNoZWRfcCA9IChwcmV2aW91c19yZWxhdGl2ZV94ID49IGl0 LT5sbnVtX3BpeGVsX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgaXNzdWVf MzE3MTZfcCk7CisgICAgICBib29sIGdyZWVuX2xpZ2h0X3AgPSAoaXQtPmN1cnJlbnRfeCA+IHNh dmVkX2N1cnJlbnRfeCkgPyB0cnVlIDogZmFsc2U7CisgICAgICBib29sIGFkdmFuY2VfaHBvc19w ID0gKGdyZWVuX2xpZ2h0X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgbHB3X3Jl YWNoZWRfcCk7CisgICAgICBpZiAoYWR2YW5jZV9ocG9zX3ApCisgICAgICAgIHByZXZpb3VzX2hw b3MgKz0gKHByZXZpb3VzX2hwb3MgPT0gLTEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYm ICFOSUxQIChWZGlzcGxheV9saW5lX251bWJlcnMpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiAhRVEgKFZkaXNwbGF5X2xpbmVfbnVtYmVycywgUXZpc3VhbCkpCisgICAgICAgICAgICAg ICAgICAgICAgICAgID8gKGl0LT5sbnVtX3BpeGVsX3dpZHRoIC8gZm9udF9zcGFjZV93aWR0aCkg KyAxCisgICAgICAgICAgICAgICAgICAgICAgICAgIDogKHJlbGF0aXZlX3ggPiAwKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog MDsKKyAgICAgICAgZWxzZSBpZiAoZmluYWxfbG9vcF9wCisgICAgICAgICAgICAgICAgICYmIHBy ZXZpb3VzX2hwb3MgPT0gLTEpCisgICAgICAgICAgcHJldmlvdXNfaHBvcyA9IDA7CisgICAgICAv KiBpdC0+YyA9PSAnXHQnIHdoZW4gSVQgaXMgYXQgYSB0YWItd2lkdGggc3BhY2VyIGZvbGxvd2lu ZyBhCisgICAgICBgYnVmZmVyLWRpc3BsYXktdGFibGUnIGdseXBoIHN1Y2ggYXMgwrsuICovCisg ICAgICBib29sIHRhYl9pbnZpc2libGVfcCA9IHByZXZpb3VzX2NoYXJhY3RlciA9PSAnXHQnOwor ICAgICAgYm9vbCB0YWJfdmlzaWJsZV9wID0gKHByZXZpb3VzX2NoYXJhY3RlciAhPSAnXHQnCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZmV0Y2hfYnl0ZV9wcmV2aW91c19jaGFyYWN0 ZXIgPT0gJ1x0Jyk7CisgICAgICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9IChhY3Rpb25fdHlw ZSA9PSBWRVJUSUNBTF9SVUxFUikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAo b3BvaW50X3kgPT0gaXQtPmN1cnJlbnRfeQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBvcG9pbnRfdnBvcyA9PSB2cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IChvcG9pbnRfeCA9PSBwcmV2aW91c19yZWxhdGl2ZV94CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF95ID09IGl0LT5jdXJyZW50X3kKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X2hwb3MgPT0gcHJldmlvdXNfaHBv cworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfdnBvcyA9PSB2 cG9zKTsKKyAgICAgIGlmICghTklMUCAoQlZBUiAoY3VycmVudF9idWZmZXIsIG1jX3N0ZGVycikp KQorICAgICAgICBtY19zdGRlcnIgKGl0LCBjb3VudCwgbmV3X3gsIHJlbGF0aXZlX3gsIHByZXZp b3VzX2NoYXJhY3RlciwKKyAgICAgICAgICAgICAgICAgICBwcmV2aW91c19ocG9zLCBpc3N1ZV8z MTcxNl9wLCBmaW5hbF9sb29wX3AsIGxwd19yZWFjaGVkX3AsCisgICAgICAgICAgICAgICAgICAg Z3JlZW5fbGlnaHRfcCwgYWR2YW5jZV9ocG9zX3AsIGdob3N0X2NocmlzdG1hc19mdXR1cmVfcCwK KyAgICAgICAgICAgICAgICAgICBoc2NsX3RlbXBvcmFyeSwgaHNjbF9wZXJtYW5lbnQsIHJjLCBh Y3Rpb25fdHlwZSk7CisgIHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1VTFRJUExFIENV UlNPUlMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KKyAgICBjYXNlIE1VTFRJUExFX0NVUlNPUlM6CisgICAgeworICAgICAgaWYgKChncmVl bl9saWdodF9wCisgICAgICAgICAgLyogV09SRF9XUkFQOiAgV2hlbiBwb3NpbnQgaXMgb24gdGhl IHNwYWNlIGNoYXJhY3RlciBhdCB0aGUgZW5kIG9mIGEKKyAgICAgICAgICBXT1JEX1dSQVAgbGlu ZSwgYGdyZWVuX2xpZ2h0X3AnIGFuZCBgYWR2YW5jZV9ocG9zX3AnIGFyZSBib3RoIGBmYWxzZWAu CisgICAgICAgICAgSW4gY2FzZSB3ZSBuZWVkIHRvIGFkZCBtb3JlIGNvbmRpdGlvbnMsIGByY2Ag PWlzIE1PVkVfTElORV9DT05USU5VRUQuICovCisgICAgICAgICAgfHwgZmluYWxfbG9vcF9wKQor ICAgICAgICAgICYmIChwcmV2aW91c19wdCA9PSBwb3NpbnQKKyAgICAgICAgICAgICAgfHwgRkVU Q0hfQllURSAoSVRfQllURVBPUyAoKml0KSkgPT0gJ1xuJykpCisgICAgICAgIHsKKyAgICAgICAg ICBlbnVtIGZhY2VfaWQgdGVtcF9mYWNlX2lkID0gcHJldmlvdXNfZmFjZV9pZDsKKyAgICAgICAg ICBpbnQgdGVtcF94ID0gcmVsYXRpdmVfeDsKKyAgICAgICAgICBpbnQgdGVtcF9ocG9zID0gcHJl dmlvdXNfaHBvczsKKyAgICAgICAgICAvKiBBcyB0byBgbWNfY2FsYycsIHdlIGFyZSBpbnRlcmVz dGVkIGluIHRoZSBjdXJyZW50IEhQT1MgYW5kIHRoZSBjdXJyZW50CisgICAgICAgICAgYHJlbGF0 aXZlX3hgLiAgVGhlIGluY29taW5nIGFyZ3VtZW50IGZvciBwcmV2aW91c19ocG9zIGlzIGFjdHVh bGx5IGhwb3MsCisgICAgICAgICAgd2hpY2ggZ2V0cyBtb2RpZmllZCBhY2NvcmRpbmdseSBoZXJl IChldmVuIHRob3VnaCBhIGRpZmZlcmVudCBuYW1lKS4gKi8KKyAgICAgICAgICBpZiAocHJldmlv dXNfcHQgPT0gcG9zaW50KQorICAgICAgICAgICAgLyogV2UgY291bGQsIGJ1dCBhcmUgbm90IG1v ZGlmeWluZyB0aGUgZ2xvYmFsIHByZXZpb3VzX3JlbGF0aXZlX3guICovCisgICAgICAgICAgICB0 ZW1wX3ggPSBwcmV2aW91c19yZWxhdGl2ZV94OworICAgICAgICAgICAgLyogV2UgYXJlIGF0IHRo ZSBlbmQgb2YgdGhlIGxpbmUuICovCisgICAgICAgICAgICBlbHNlIGlmIChJVF9DSEFSUE9TICgq aXQpID09IHBvc2ludAorICAgICAgICAgICAgICAgICAgICAgJiYgKElURVJBVE9SX0FUX0VORF9P Rl9MSU5FX1AgKGl0KQorICAgICAgICAgICAgICAgICAgICAgICAgIHx8IEZFVENIX0JZVEUgKElU X0JZVEVQT1MgKCppdCkpID09ICdcbicpKQorICAgICAgICAgICAgICAvKiBgcmVsYXRpdmVfeGAg aXMgYWxyZWFkeSBjb3JyZWN0LiAqLworICAgICAgICAgICAgICB0ZW1wX2hwb3MgPSBwcmV2aW91 c19ocG9zICsgMTsKKyAgICAgICAgICBpZiAocmMgPT0gTU9WRV9MSU5FX0NPTlRJTlVFRCkKKyAg ICAgICAgICAgIHRlbXBfaHBvcyA9IHByZXZpb3VzX2hwb3MgKyAxOworICAgICAgICAgIGludCBm bGF2b3I7CisgICAgICAgICAgaWYgKElUX0NIQVJQT1MgKCppdCkgPT0gcG9zaW50CisgICAgICAg ICAgICAgICYmIChJVEVSQVRPUl9BVF9FTkRfT0ZfTElORV9QIChpdCkKKyAgICAgICAgICAgICAg ICAgIHx8IEZFVENIX0JZVEUgKElUX0JZVEVQT1MgKCppdCkpID09ICdcbicpKQorICAgICAgICAg ICAgeworICAgICAgICAgICAgICBmbGF2b3IgPSBNQ19HTFlQSExFU1M7CisgICAgICAgICAgICAg IHRlbXBfZmFjZV9pZCA9IGl0LT5mYWNlX2lkOworICAgICAgICAgICAgfQorICAgICAgICAgICAg ICBlbHNlCisgICAgICAgICAgICAgICAgZmxhdm9yID0gTUNfR0xZUEg7CisgICAgICAgICAgbWNf Y2FsY19oZWxwZXIgKGl0LT53LCB0ZW1wX3gsIC0xLCBpdC0+Y3VycmVudF95LCAtMSwgdGVtcF9o cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCAtMSwgY3Vyc29yX3R5cGUsIGN1 cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgbWNfYmdf bHNsIChpdC0+dywgdGVtcF9mYWNlX2lkKSwgZmxhdm9yLCBwb3NpbnQsCisgICAgICAgICAgICAg ICAgICAgICAgICAgIHNwZWNzLCByZXN1bHQpOworICAgICAgICAgIHJldHVybjsKKyAgICAgICAg fQorICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgSE9SSVpPTlRBTCBSVUxFUiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgSE9S SVpPTlRBTF9SVUxFUjoKKyAgICB7CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQ19HTFlQSCAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgICBpZiAoKGdy ZWVuX2xpZ2h0X3AKKyAgICAgICAgICAgLyogUGxhY2UgYW4gTUNfR0xZUEggb24gdGhlIGxhc3Qg c3BhY2Ugb2YgYSB3cmFwcGVkIGxpbmUuICovCisgICAgICAgICAgIHx8IHJjID09IE1PVkVfTElO RV9DT05USU5VRUQpCisgICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcAorICAgICAgICAg ICYmIGxwd19yZWFjaGVkX3AKKyAgICAgICAgICAmJiAhdGFiX2ludmlzaWJsZV9wKQorICAgICAg ICB7CisgICAgICAgICAgZW51bSBmYWNlX2lkIHRlbXBfZmFjZV9pZCA9IChyYyA9PSBNT1ZFX0xJ TkVfQ09OVElOVUVEKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGl0 LT5mYWNlX2lkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogcHJldmlv dXNfZmFjZV9pZDsKKyAgICAgICAgICBpbnQgdGVtcF94ID0gcHJldmlvdXNfcmVsYXRpdmVfeDsK KyAgICAgICAgICBwdHJkaWZmX3QgaXRfY2hhcnBvcyA9IChyYyA9PSBNT1ZFX0xJTkVfQ09OVElO VUVEKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gSVRfQ0hBUlBPUyAoKml0 KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogSVRfQ0hBUlBPUyAoKml0KSAt IDE7CisgICAgICAgICAgaW50IHRlbXBfaHBvcyA9IChyYyA9PSBNT1ZFX0xJTkVfQ09OVElOVUVE KQorICAgICAgICAgICAgICAgICAgICAgICAgICA/IHByZXZpb3VzX2hwb3MgKyAxCisgICAgICAg ICAgICAgICAgICAgICAgICAgIDogcHJldmlvdXNfaHBvczsKKyAgICAgICAgICAvKiBSZWNvcmQg c29tZSBvZiB0aGUgY3VycmVudCB2YWx1ZXMgZm9yIHRoZSBjdXJzb3IgYW5kIGdseXBoX3Jvdy4g Ki8KKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpnbHlwaF9yb3cgPSAgTUFUUklYX1JPVyAo aXQtPnctPmN1cnJlbnRfbWF0cml4LCB2cG9zKTsKKyAgICAgICAgICBpbnQgZngsIGZ5LCBoOwor ICAgICAgICAgIG1jX2dldF9waHlzX2N1cnNvcl9nZW9tZXRyeSAoaXQtPncsIGdseXBoX3Jvdywg dGVtcF94LCAmZngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnbHlw aF9yb3ctPnksICZmeSwgdGVtcF9ocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJmgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgpOworICAgICAgICAg IG1jX2Nyb3NzaGFpcnNfaGVscGVyIChpdC0+dywgdGVtcF94LCAtMSwgaXQtPmN1cnJlbnRfeSwg ZnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBfaHBvcywgdnBvcywgLTEs IGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGZvcmVncm91bmQsIG1jX2JnX2xzbCAoaXQtPncsIHRlbXBfZmFjZV9pZCksCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIE1DX0dMWVBILCBpdF9jaGFycG9zLCByZXN1bHQpOwor ICAgICAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBNQ19HTFlQSF9UQUIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgICAvKiBGSVhNRTogIERyYXdpbmcg YSBNQ19HTFlQSCBIQkFSX0NVUlNPUiBvbiBjZXJ0YWluIGxldHRlcnMgKEEsIG0sIE0sIHcsIFcp CisgICAgICBsb2NhdGVkIHRvIHRoZSBpbW1lZGlhdGUg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1fcGl4 ZWxfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgIDogc2F2ZWRfcmVsYXRpdmVfeF9mb3Jf dGFiOworICAgICAgICAgIGludCBjb3VudCA9IChyZWxhdGl2ZV94IC0gdGVtcF94KSAvIGZvbnRf c3BhY2Vfd2lkdGg7CisgICAgICAgICAgZm9yIChpID0gMDsgaSA8IGNvdW50OyBpKyspCisgICAg ICAgICAgICB7CisgICAgICAgICAgICAgIG1jX2Nyb3NzaGFpcnNfaGVscGVyIChpdC0+dywgdGVt cF94LCAtMSwgaXQtPmN1cnJlbnRfeSwgLTEsIHByZXZpb3VzX2hwb3MsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCAtMSwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0 aCwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2Jn X2xzbCAoaXQtPncsIHByZXZpb3VzX2ZhY2VfaWQpLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgTUNfR0xZUEhfVEFCLCBJVF9DSEFSUE9TICgqaXQpIC0gMSwgcmVzdWx0KTsK KyAgICAgICAgICAgICAgdGVtcF94ICs9IGZvbnRfc3BhY2Vfd2lkdGg7CisgICAgICAgICAgICB9 CisgICAgICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAg ICAgR2hvc3Qgb2YgQ2hyaXN0bWFzIEZ1dHVyZSAtLSBNQ19HTFlQSF9UQUIgICAgICAgICAgICAg ICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICAgIGlmIChncmVlbl9saWdodF9w CisgICAgICAgICAgJiYgZ2hvc3RfY2hyaXN0bWFzX2Z1dHVyZV9wCisgICAgICAgICAgJiYgbHB3 X3JlYWNoZWRfcCkKKyAgICAgICAgeworICAgICAgICAgIGludCBpOworICAgICAgICAgIGludCB0 ZW1wX3ggPSAoZ2hvc3RfY2hyaXN0bWFzX2Z1dHVyZV9yZWxhdGl2ZV94IDwgaXQtPmxudW1fcGl4 ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICA/IGl0LT5sbnVtX3BpeGVsX3dpZHRo CisgICAgICAgICAgICAgICAgICAgICAgICA6IGdob3N0X2NocmlzdG1hc19mdXR1cmVfcmVsYXRp dmVfeDsKKyAgICAgICAgICBpbnQgY291bnQgPSAocHJldmlvdXNfcmVsYXRpdmVfeCAtIHRlbXBf eCkgLyBmb250X3NwYWNlX3dpZHRoOworICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBjb3VudDsg aSsrKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19jcm9zc2hhaXJzX2hlbHBlciAo aXQtPncsIHRlbXBfeCwgLTEsIGl0LT5jdXJyZW50X3ksIC0xLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgZ2hvc3RfY2hyaXN0bWFzX2Z1dHVyZV9ocG9zLCB2cG9zLCAtMSwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCBjdXJzb3Jf d2lkdGgsIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBt Y19iZ19sc2wgKGl0LT53LCBnaG9zdF9jaHJpc3RtYXNfZnV0dXJlX2ZhY2VfaWQpLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUNfR0xZUEhfVEFCLCBJVF9DSEFSUE9TICgq aXQpIC0gMiwgcmVzdWx0KTsKKyAgICAgICAgICAgICAgdGVtcF94ICs9IGZ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AocmVhbF9waHlzX2N1cnNvcl9nbHlwaCA9PSBOVUxMKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBERUZBVUxUX0ZBQ0VfSUQKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKElUX0NIQVJQT1MgKCppdCkgPj0gcmVnaW9u X2VuZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgcmVnaW9u X2JlZ2lubmluZyA9PSByZWdpb25fZW5kKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IERFRkFVTFRfRkFDRV9JRAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IHJlYWxfcGh5c19jdXJzb3JfZ2x5cGgtPmZhY2VfaWQ7CisgICAgICAg ICAgLyogQW4gZW1wdHkgbmV3IGxpbmUgLS0gbG9vcCBpbiBwcmV2aW91cyBzZWN0aW9uIGJyb2tl IGltbWVkaWF0ZWx5LiAqLworICAgICAgICAgIGludCB0ZW1wX2hwb3MgPSAocmVsYXRpdmVfeCA9 PSBpdC0+bG51bV9waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgID8gaXQt PmxudW1fcGl4ZWxfd2lkdGggLyBmcmFtZV9jaGFyX3dpZHRoCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAvKiBObyBuZWVkIHRvIHJlYWRqdXN0IGJlY2F1c2UgaXQgd2FzIGRvbmUgYWJvdmUu ICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICA6IHJjID09IE1PVkVfTElORV9DT05USU5V RUQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBwcmV2aW91c19ocG9zCisgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IHByZXZpb3VzX2hwb3MgKyAxOworICAgICAgICAgIC8qIEFu IGVtcHR5IG5ldyBsaW5lIC0tIGxvb3AgaW4gcHJldmlvdXMgc2VjdGlvbiBicm9rZSBpbW1lZGlh dGVseS4gKi8KKyAgICAgICAgICBpbnQgdGVtcF94ID0gKHJlbGF0aXZlX3ggPCBpdC0+bG51bV9w aXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgICAgICAgPyBpdC0+bG51bV9waXhlbF93aWR0 aAorICAgICAgICAgICAgICAgICAgICAgICA6IHJlbGF0aXZlX3g7CisgICAgICAgICAgd2hpbGUg KHRlbXBfeCArIGZyYW1lX2NoYXJfd2lkdGggPCB0ZXh0X2FyZWFfd2lkdGgpCisgICAgICAgICAg ICB7CisgICAgICAgICAgICAgIG1jX2Nyb3NzaGFpcnNfaGVscGVyIChpdC0+dywgdGVtcF94LCAt MSwgaXQtPmN1cnJlbnRfeSwgLTEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICB0ZW1wX2hwb3MsIHZwb3MsIC0xLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZCwgbWNfYmdfbHNsIChpdC0+ dywgdGVtcF9mYWNlX2lkKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1D X0dMWVBITEVTUywgSVRfQ0hBUlBPUyAoKml0KSwgcmVzdWx0KTsKKyAgICAgICAgICAgICAgdGVt cF94ID0gdGVtcF94ICsgZnJhbWVfY2hhcl93aWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAg ICByZXR1cm47CisgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWRVJUSUNBTCBSVUxF UiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KKyAgICBjYXNlIFZFUlRJQ0FMX1JVTEVSOgorICAgIHsKKyAgICAgIGlmICgoIWZpbmFs X2xvb3BfcAorICAgICAgICAgICAvKiBXaGVuIHRoZSBjdXJyZW50IGxpbmUgY29udGFpbnMgc3Bl Y2lhbCBjaGFyYWN0ZXJzIGxpa2UgSmFwYW5lc2UsCisgICAgICAgICAgIHRoZW4gb3BvaW50X3gg YW5kIHByZXZpb3VzX3JlbGF0aXZlX3ggbWF5IG5vdCBuZWNlc3NhcmlseSBiZSB0aGUgc2FtZS4K KyAgICAgICAgICAgV2Ugd2FudCB0byBzdG9wIG9uIHRoZSBjaGFyYWN0ZXIgX2NvbnRhaW5pbmdf IGBvcG9pbnRfeGAuICovCisgICAgICAgICAgICYmIHByZXZpb3VzX3JlbGF0aXZlX3ggPj0gb3Bv aW50X3gpCisgICAgICAgICAgfHwgZmluYWxfbG9vcF9wKQorICAgICAgICB7CisgICAgICAgICAg c3RydWN0IGdseXBoX3JvdyAqZ2x5cGhfcm93ID0gIE1BVFJJWF9ST1cgKGl0LT53LT5jdXJyZW50 X21hdHJpeCwgdnBvcyk7CisgICAgICAgICAgaW50IGZsYXZvcjsKKyAgICAgICAgICBlbnVtIGZh Y2VfaWQgdGVtcF9iZ19mYWNlX2lkID0gcHJldmlvdXNfZmFjZV9pZDsKKyAgICAgICAgICBpbnQg dGVtcF94OworICAgICAgICAgIGludCB0ZW1wX2hwb3MgPSBwcmV2aW91c19ocG9zOworICAgICAg ICAgIC8qIFNraXAgdGhpcyBsaW5lLiAqLworICAgICAgICAgIGlmIChyZWFsX2Zha2VfY3Vyc29y X3ApCisgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgLyogSWYgcG9pbnQgaXMgdG8gdGhl IGxlZnQgb2YgdGhlIGxpbmUgbnVtYmVycyB3aGVuIHNjcm9sbGluZworICAgICAgICAgIGhvcml6 b250YWxseSwgdGhlbiB3ZSB3YW50IHRoZSB2ZXJ0aWNhbCBsaW5lIHRvIGFsaWduIHdpdGggcmln aHQgZWRnZQorICAgICAgICAgIG9mIHRoZSBsaW5lIG51bWJlcnMuICovCisgICAgICAgICAgaWYg KGl0LT53LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAmJiBwcmV2aW91c19yZWxhdGl2ZV94 ID09IG9wb2ludF94CisgICAgICAgICAgICAgICYmIG9wb2ludF94IDwgaXQtPmxudW1fcGl4ZWxf d2lkdGgKKyAgICAgICAgICAgICAgJiYgcHJldmlvdXNfaHBvcyA9PSAtMSkKKyAgICAgICAgICAg IHRlbXBfaHBvcyA9IChpdC0+bG51bV9waXhlbF93aWR0aCAvIGZvbnRfc3BhY2Vfd2lkdGgpIC0g MTsKKyAgICAgICAgICAgIGVsc2UgaWYgKGZpbmFsX2xvb3BfcAorICAgICAgICAgICAgICAgICAg ICAgJiYgcHJldmlvdXNfaHBvcyAhPSAwCisgICAgICAgICAgICAgICAgICAgICAmJiByYyA9PSBN T1ZFX0xJTkVfQ09OVElOVUVEKQorICAgICAgICAgICAgICB0ZW1wX2hwb3MgPSBwcmV2aW91c19o cG9zICsgMTsKKyAgICAgICAgICBpZiAoKGl0LT53LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAg ICAgJiYgcHJldmlvdXNfcmVsYXRpdmVfeCA9PSBvcG9pbnRfeAorICAgICAgICAgICAgICAgJiYg b3BvaW50X3ggPCBpdC0+bG51bV9waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgfHwgSVRfQ0hB UlBPUyAoKml0KSA9PSBaVikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgZmxhdm9yID0g TUNfR0xZUEhMRVNTOworICAgICAgICAgICAgICB0ZW1wX2JnX2ZhY2VfaWQgPSBERUZBVUxUX0ZB Q0VfSUQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmIChnaG9zdF9jaHJpc3Rt YXNfZnV0dXJlX3AKKyAgICAgICAgICAgICAgICAgICAgICYmIHByZXZpb3VzX3JlbGF0aXZlX3gg PT0gb3BvaW50X3gpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBmbGF2b3IgPSBN Q19HTFlQSF9UQUI7CisgICAgICAgICAgICAgICAgdGVtcF9iZ19mYWNlX2lkID0gZ2hvc3RfY2hy aXN0bWFzX2Z1dHVyZV9mYWNlX2lkOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVs c2UgaWYgKGN1cnNvcl9pbl9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlw aF9yb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgIGZsYXZvciA9IE1D X1ZFUlRJQ0FMX0JBUl9SSUdIVF9BTkdMRTsKKyAgICAgICAgICAgICAgICBlbHNlIGlmIChjdXJz b3JfaW5fZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9yb3ctPmNv bnRpbnVlZF9wKQorICAgICAgICAgICAgICAgICAgZmxhdm9yID0gTUNfVkVSVElDQUxfQkFSX0JB Q0tTTEFTSDsKKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGN1cnNvcl9pbl9mcmluZ2VfcAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIWdseXBoX3Jvdy0+dHJ1bmNhdGVkX29uX3Jp Z2h0X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFnbHlwaF9yb3ctPmNvbnRpbnVl ZF9wKQorICAgICAgICAgICAgICAgICAgICBmbGF2b3IgPSBNQ19WRVJUSUNBTF9CQVI7CisgICAg ICAgICAgICAgICAgICAgIC8qIFdoZW4gSVQgaXMgYXQgdGhlIGVuZCBvZiBhIGxpbmUsIHVzZSBg TUNfR0xZUEhMRVNTJy4KKyAgICAgICAgICAgICAgICAgICAgSG93ZXZlciwgaXQgaXMgb2theSB0 byB1c2UgTUNfR0xZUEggZm9yIGEgd29yZC13cmFwcGVkIGxpbmUuICovCisgICAgICAgICAgICAg ICAgICAgIGVsc2UgaWYgKCFJVEVSQVRPUl9BVF9FTkRfT0ZfTElORV9QIChpdCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgRkVUQ0hfQllURSAoSVRfQllURVBPUyAoKml0KSkgIT0g J1xuJworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBGRVRDSF9CWVRFIChJVF9CWVRF UE9TICgqaXQpKSAhPSAnXGYnCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGl0LT5j ID09ICdcdCcgd2hlbiBJVCBpcyBhdCBhIHRhYi13aWR0aCBzcGFjZXIgZm9sbG93aW5nIGEKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgYGJ1ZmZlci1kaXNwbGF5LXRhYmxlJyBnbHlwaCBz dWNoIGFzIMK7LiAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBwcmV2aW91c19j aGFyYWN0ZXIgIT0gJ1x0JworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByYyAhPSBN T1ZFX1BPU19NQVRDSF9PUl9aVgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByYyAh PSBNT1ZFX0xJTkVfQ09OVElOVUVECisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJl bGF0aXZlX3ggPj0gaXQtPmxudW1fcGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAg Zmxhdm9yID0gTUNfR0xZUEg7CisgICAgICAgICAgICAgICAgICAgICAgLyogSXQgaXMgb2theSB0 byB1c2UgTUNfR0xZUEggZm9yIGEgd29yZC13cmFwcGVkIGxpbmUuICovCisgICAgICAgICAgICAg ICAgICAgICAgZWxzZSBpZiAocmMgPT0gTU9WRV9MSU5FX0NPTlRJTlVFRAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIEZFVENIX0JZVEUgKElUX0JZVEVQT1MgKCppdCkpID09ICcg JworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHByZXZpb3VzX3JlbGF0aXZlX3gg PT0gb3BvaW50X3gpCisgICAgICAgICAgICAgICAgICAgICAgICBmbGF2b3IgPSBNQ19HTFlQSDsK KyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHByZXZpb3VzX2NoYXJhY3RlciA9PSAn XHQnCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBwcmV2aW91c19yZWxhdGl2 ZV94ID09IG9wb2ludF94KQorICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgZmxhdm9yID0gTUNfR0xZUEhfVEFCOworICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHRlbXBfYmdfZmFjZV9pZCA9IHByZXZpb3VzX2ZhY2VfaWQ7CisgICAgICAg ICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAo ZmluYWxfbG9vcF9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIChwcmV2 aW91c19yZWxhdGl2ZV94ID49IG9wb2ludF94CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICB8fCBvcG9pbnRfeCA8IHJlbGF0aXZlX3gpKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGZsYXZvciA9IE1DX0dMWVBIOworICAgICAgICAgICAgICAgICAgICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgZmxhdm9yID0gTUNfR0xZUEhMRVNTOworICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICB0ZW1wX2JnX2ZhY2VfaWQgPSBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgLyogQ09STkVSIENBU0VTOgorICAg ICAgICAgIC0gIFdoZW4gdGhlIHZlcnRpY2FsIGxpbmUgaXMgdG8gdGhlIGxlZnQgb2YgdGhlIHRl eHQgYW5kIGp1c3QgdG8gdGhlCisgICAgICAgICAgICAgcmlnaHQgb2YgdGhlIGxpbmUgbnVtYmVy cywgd2Ugd2FudCB0aGUgZGVmYXVsdCBmYWNlLgorICAgICAgICAgIC0gIFdoZW4gdGhlcmUgaXMg YW4gaW1hZ2luYXJ5IGVtcHR5IGxpbmUgYXQgdGhlIGVuZCBvZiB0aGUgYnVmZmVyIHdpdGgKKyAg ICAgICAgICAgICBub3RoaW5nIG90aGVyIHRoYW4gWlYsIHdlIHdhbnQgdG8gdXNlIHRoZSBmcmFt ZSBkZWZhdWx0IGZhY2UgaWYgWlYKKyAgICAgICAgICAgICBpcyBhdCB0aGUgZW5kIG9mIGFuIGFj dGl2ZSByZWdpb24uICovCisgICAgICAgICAgaWYgKHJlZ2lvbl9hY3RpdmVfcCkKKyAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgLyogU3Vic2VxdWVudCB0byBgcmVnaW9uX2VuZGAgYW5kIGF0 IHRoZSBlbmQgb2YgYSBsaW5lLiAqLworICAgICAgICAgICAgICBpZiAoSVRfQ0hBUlBPUyAoKml0 KSA+PSByZWdpb25fZW5kCisgICAgICAgICAgICAgICAgICAmJiAoSVRFUkFUT1JfQVRfRU5EX09G X0xJTkVfUCAoaXQpCisgICAgICAgICAgICAgICAgICAgICAgfHwgRkVUQ0hfQllURSAoSVRfQllU RVBPUyAoKml0KSkgPT0gJ1xuJykpCisgICAgICAgICAgICAgICAgdGVtcF9iZ19mYWNlX2lkID0g REVGQVVMVF9GQUNFX0lEOworICAgICAgICAgICAgICAgIC8qIFByaW9yIHRvIGByZWdpb25fYmVn aW5uaW5nYCBhbmQgYXQgdGhlIGVuZCBvZiBhIGxpbmUuICovCisgICAgICAgICAgICAgICAgZWxz ZSBpZiAoSVRfQ0hBUlBPUyAoKml0KSA8IHJlZ2lvbl9iZWdpbm5pbmcKKyAgICAgICAgICAgICAg ICAgICAgICAgICAmJiAoSVRFUkFUT1JfQVRfRU5EX09GX0xJTkVfUCAoaXQpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHx8IEZFVENIX0JZVEUgKElUX0JZVEVQT1MgKCppdCkpID09ICdc bicpKQorICAgICAgICAgICAgICAgICAgdGVtcF9iZ19mYWNlX2lkID0gREVGQVVMVF9GQUNFX0lE OworICAgICAgICAgICAgICAgICAgLyogLSAgV2l0aGluIHRoZSByZWdpb24uCisgICAgICAgICAg ICAgICAgICAgICAtICBgcmVhbF9waHlzX2N1cnNvcl9nbHlwaGAgaXMgTlVMTC4gKi8KKyAgICAg ICAgICAgICAgICAgIGVsc2UgaWYgKElUX0NIQVJQT1MgKCppdCkgPj0gcmVnaW9uX2JlZ2lubmlu ZworICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgSVRfQ0hBUlBPUyAoKml0KSA8IHJlZ2lv bl9lbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJlYWxfcGh5c19jdXJzb3JfZ2x5 cGggPT0gTlVMTCkKKyAgICAgICAgICAgICAgICAgICAgdGVtcF9iZ19mYWNlX2lkID0gcHJldmlv dXNfZmFjZV9pZDsKKyAgICAgICAgICAgICAgICAgICAgLyogLSAgV2l0aGluIHRoZSByZWdpb24u CisgICAgICAgICAgICAgICAgICAgICAgIC0gIGByZWFsX3BoeXNfY3Vyc29yX2dseXBoYCBpcyBu b24tTlVMTC4KKyAgICAgICAgICAgICAgICAgICAgICAgLSAgQXQgdGhlIGVuZCBvZiB0aGUgbGlu ZS4KKyAgICAgICAgICAgICAgICAgICAgICAgLSAgUFQgaXMgYXQgYHJlZ2lvbl9iZWdpbm5pbmdg LiAqLworICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChJVF9DSEFSUE9TICgqaXQpID49IHJl Z2lvbl9iZWdpbm5pbmcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgSVRfQ0hBUlBP UyAoKml0KSA8IHJlZ2lvbl9lbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgKElU RVJBVE9SX0FUX0VORF9PRl9MSU5FX1AgKGl0KQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgfHwgRkVUQ0hfQllURSAoSVRfQllURVBPUyAoKml0KSkgPT0gJ1xuJykKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgcmVhbF9waHlzX2N1cnNvcl9nbHlwaCAhPSBOVUxMCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIFBUID09IHJlZ2lvbl9iZWdpbm5pbmcpCisg ICAgICAgICAgICAgICAgICAgICAgdGVtcF9iZ19mYWNlX2lkID0gcmVhbF9waHlzX2N1cnNvcl9n bHlwaC0+ZmFjZV9pZDsKKyAgICAgICAgICAgICAgICAgICAgICAvKiAtICBXaXRoaW4gdGhlIHJl Z2lvbi4KKyAgICAgICAgICAgICAgICAgICAgICAgICAtICBgcmVhbF9waHlzX2N1cnNvcl9nbHlw aGAgaXMgbm9uLU5VTEwuCisgICAgICAgICAgICAgICAgICAgICAgICAgLSAgQXQgdGhlIGVuZCBv ZiB0aGUgbGluZS4KKyAgICAgICAgICAgICAgICAgICAgICAgICAtICBQVCBpcyBhdCBgcmVnaW9u X3JlZ2lvbl9lbmRgLiAqLworICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKElUX0NIQVJQ T1MgKCppdCkgPj0gcmVnaW9uX2JlZ2lubmluZworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIElUX0NIQVJQT1MgKCppdCkgPCByZWdpb25fZW5kCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgKElURVJBVE9SX0FUX0VORF9PRl9MSU5FX1AgKGl0KQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBGRVRDSF9CWVRFIChJVF9CWVRFUE9TICgqaXQp KSA9PSAnXG4nKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJlYWxfcGh5c19j dXJzb3JfZ2x5cGggIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIFBU ID09IHJlZ2lvbl9lbmQpCisgICAgICAgICAgICAgICAgICAgICAgICAvKiB0ZW1wX2JnX2ZhY2Vf aWQgPSByZWFsX3BoeXNfY3Vyc29yX2dseXBoLT5mYWNlX2lkOyAqLworICAgICAgICAgICAgICAg ICAgICAgICAgLyogdGVtcF9iZ19mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKGl0LT5mLCBp bnRlcm4gKCJyZWdpb24iKSwgdHJ1ZSk7ICovCisgICAgICAgICAgICAgICAgICAgICAgICB0ZW1w X2JnX2ZhY2VfaWQgPSBpdC0+ZmFjZV9pZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8qIC0g IFdpdGhpbiB0aGUgcmVnaW9uLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgLSAgYHJlYWxf cGh5c19jdXJzb3JfZ2x5cGhgIGlzIG5vbi1OVUxMLgorICAgICAgICAgICAgICAgICAgICAgICAg ICAgLSAgTm90IGF0IHRoZSBlbmQgb2YgdGhlIGxpbmUuICovCisgICAgICAgICAgICAgICAgICAg ICAgICBlbHNlIGlmIChJVF9DSEFSUE9TICgqaXQpID49IHJlZ2lvbl9iZWdpbm5pbmcKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIElUX0NIQVJQT1MgKCppdCkgPCByZWdpb25f ZW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAoIUlURVJBVE9SX0FUX0VO RF9PRl9MSU5FX1AgKGl0KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8 IEZFVENIX0JZVEUgKElUX0JZVEVQT1MgKCppdCkpICE9ICdcbicpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiByZWFsX3BoeXNfY3Vyc29yX2dseXBoICE9IE5VTEwpCisgICAg ICAgICAgICAgICAgICAgICAgICAgIHRlbXBfYmdfZmFjZV9pZCA9IHByZXZpb3VzX2ZhY2VfaWQ7 CisgICAgICAgICAgICB9CisgIGRvdWJsZSByZWQgPSBYRkxPQVRfREFUQSAoQVJFRiAoZm9yZWdy b3VuZCwgMCkpOworICBkb3VibGUgZ3JlZW4gPSBYRkxPQVRfREFUQSAoQVJFRiAoZm9yZWdyb3Vu ZCwgMSkpOworICBkb3VibGUgYmx1ZSA9IFhGTE9BVF9EQVRBIChBUkVGIChmb3JlZ3JvdW5kLCAy KSk7CisgIC8qIFNvbWUgb2YgdGhlc2UgdmFsdWVzIGNvbWUgdGhyb3VnaCBhcyAxLjAwMzkwNiwg d2hpY2ggY2F1c2VzIGEgYnJlYWthZ2UKKyAgb2YgdGhlIGNvbG9ycyBpbiB0aGF0IG11bHRpcGxp Y2F0aW9uIGJ5IHRoZSBiYXNlIHdpbGwgZXhjZWVkIHRoZSBiYXNlLiAqLworICBpZiAocmVkID4g MS4wKQorICAgIHJlZCA9IDEuMDsKKyAgaWYgKGdyZWVuID4gMS4wKQorICAgIGdyZWVuID0gMS4w OworICBpZiAoYmx1ZSA+IDEuMCkKKyAgICBibHVlID0gMS4wOworICBpZiAoIU5JTFAgKEJWQVIg KGN1cnJlbnRfYnVmZmVyLCBtY19zdGRlcnIpKSkKKyAgICBmcHJpbnRmIChzdGRlcnIsICJcblwK KyAgICBWRVJUSUNBTCBSVUxFUiAtLSBTUEVDUzpcblwKKyAgICB4L29wb2ludF94ICglZClcblwK KyAgICB5ICglZClcblwKKyAgICBocG9zICglZClcblwKKyAgICB2cG9zICglZClcblwKKyAgICBm b3JlZ3JvdW5kOiAgUiAoJWYpIHwgRyAoJWYpIHwgQiAoJWYpXG5cCisgICAgYmFja2dyb3VuZCAo JXMpXG5cCisgICAgZmxhdm9yICglcylcbiIsCisgICAgb3BvaW50X3gsCisgICAgaXQtPmN1cnJl bnRfeSwKKyAgICB0ZW1wX2hwb3MsCisgICAgdnBvcywKKyAgICByZWQsIGdyZWVuLCBibHVlLAor ICAgIFNTREFUQSAobWNfYmdfZmFjZSAoaXQtPncsIHRlbXBfYmdfZmFjZV9pZCkpLAorICAgIChm bGF2b3IgPT0gTUNfR0xZUEgKKyAgICAgID8gIk1DX0dMWVBIIgorICAgICAgOiBmbGF2b3IgPT0g TUNfR0xZUEhfVEFCCisgICAgICAgID8gIk1DX0dMWVBIX1RBQiIKKyAgICAgIDogZmxhdm9yID09 IE1DX0dMWVBITEVTUworICAgICAgICA/ICJNQ19HTFlQSExFU1MiCisgICAgICA6IGZsYXZvciA9 PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQU5HTEUKKyAgICAgICAgPyAiTUNfVkVSVElDQUxfQkFS X1JJR0hUX0FOR0xFIgorICAgICAgOiBmbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFT SAorICAgICAgICA/ICJNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIIgorICAgICAgOiBmbGF2b3Ig PT0gTUNfVkVSVElDQUxfQkFSCisgICAgICAgID8gIk1DX1ZFUlRJQ0FMX0JBUiIKKyAgICAgIDog Ik9PUFMiKSk7CisgICAgICAgICAgaWYgKGZsYXZvciA9PSBNQ19HTFlQSAorICAgICAgICAgICAg ICAmJiBwcmV2aW91c19yZWxhdGl2ZV94ID4gb3BvaW50X3gpCisgICAgICAgICAgICB7CisgICAg ICAgICAgICAgIHRlbXBfeCA9IHByaW9yX3ByZXZpb3VzX3JlbGF0aXZlX3g7CisgICAgICAgICAg ICAgIHRlbXBfaHBvcyA9IHByaW9yX3ByZXZpb3VzX2hwb3M7CisgICAgICAgICAgICB9CisgICAg ICAgICAgICBlbHNlIGlmIChmbGF2b3IgPT0gTUNfR0xZUEgKKyAgICAgICAgICAgICAgICAgICAg ICYmIGZpbmFsX2xvb3BfcAorICAgICAgICAgICAgICAgICAgICAgJiYgcmMgIT0gTU9WRV9MSU5F X0NPTlRJTlVFRAorICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3ggPCByZWxhdGl2ZV94 KQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdGVtcF94ID0gcHJldmlvdXNfcmVs YXRpdmVfeDsKKyAgICAgICAgICAgICAgICB0ZW1wX2hwb3MgPSBwcmV2aW91c19ocG9zOworICAg ICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB0ZW1wX3gg PSBvcG9pbnRfeDsKKyAgICAgICAgICBpbnQgZngsIGZ5LCBoOworICAgICAgICAgIG1jX2dldF9w aHlzX2N1cnNvcl9nZW9tZXRyeSAoaXQtPncsIGdseXBoX3JvdywgdGVtcF94LCAmZngsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaF9yb3ctPnksICZmeSwgdGVt cF9ocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmgs IGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgpOworICAgICAgICAgIGZ4ID0gV0lORE9XX1RFWFRf VE9fRlJBTUVfUElYRUxfWCAoaXQtPncsIG9wb2ludF94KTsKKyAgICAgICAgICBtY19jcm9zc2hh aXJzX2hlbHBlciAoaXQtPncsIHRlbXBfeCwgZngsIGl0LT5jdXJyZW50X3ksIC0xLCB0ZW1wX2hw b3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZwb3MsIGgsIGN1cnNvcl90eXBl LCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIG1jX2JnX2xzbCAoaXQtPncsIHRlbXBfYmdfZmFjZV9pZCksCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGZsYXZvciwg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X3Ag PSB0cnVlOworICAgICAgICAgIC8qIFVzZSBgcmVsYXRpdmVfeCcgYmVjYXVzZSB0aGlzIGlzIHdo ZXJlIHRoZSBwcmV2aW91cyBtY19nbHlwaF90YWIgZW5kcy4gKi8KKyAgICAgICAgICBnaG9zdF9j aHJpc3RtYXNfZnV0dXJlX3JlbGF0aXZlX3ggPSByZWxhdGl2ZV94OworICAgICAgICAgIGdob3N0 X2NocmlzdG1hc19mdXR1cmVfaHBvcyA9IGl0LT5sbnVtX3BpeGVsX3dpZHRoIC8gZm9udF9zcGFj ZV93aWR0aDsKKyAgICAgICAgICBnaG9zdF9jaHJpc3RtYXNfZnV0dXJlX2ZhY2VfaWQgPSBwcmV2 aW91c19mYWNlX2lkOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKGdyZWVuX2xpZ2h0X3AK KyAgICAgICAgICAgICAgICAgJiYgZ2hvc3RfY2hyaXN0bWFzX2Z1dHVyZV9wKQorICAgICAgICAg IGdob3N0X2NocmlzdG1hc19mdXR1cmVfcCA9IGZhbHNlOworICAgICAgLyogQGxhd2xpc3QgcHJl dmlvdXNseSBlbmNvdW50ZXJlZCBhIGNyYXNoIHRoYXQgd2FzIHByb2JhYmx5IGNhdXNlZCBieQor ICAgICAgRkVUQ0hfQllURSAoSVRfQllURVBPUyAoKml0KSAtIDEpIG5vdCBmaW5kaW5nIGFueXRo aW5nIGF0IHRoaXMgbG9jYXRpb24uICovCisgICAgICBmZXRjaF9ieXRlX3ByZXZpb3VzX2NoYXJh Y3RlciA9IChpdC0+YyA+IDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gRkVUQ0hfQllURSAoSVRfQllURVBPUyAoKml0KSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAwOworICAgICAgcHJpb3JfcHJldmlvdXNfY2hhcmFjdGVyID0gcHJl dmlvdXNfY2hhcmFjdGVyOworICAgICAgcHJldmlvdXNfY2hhcmFjdGVy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pb25zLiAqLworICAgICAgaW50IGluY3JlbWVudCA9IChpdC0+cGl4ZWxfd2lkdGggPiAwCisg ICAgICAgICAgICAgICAgICAgICAgICYmIGl0LT5jICE9ICdcdCcKKyAgICAgICAgICAgICAgICAg ICAgICAgJiYgaXQtPmMgIT0gMCkKKyAgICAgICAgICAgICAgICAgICAgICA/IGl0LT5waXhlbF93 aWR0aAorICAgICAgICAgICAgICAgICAgICAgIDogKGZvbnRfc3BhY2Vfd2lkdGggIT0gZnJhbWVf Y2hhcl93aWR0aCkKKyAgICAgICAgICAgICAgICAgICAgICAgID8gZnJhbWVfY2hhcl93aWR0aAor ICAgICAgICAgICAgICAgICAgICAgICAgOiBmb250X3NwYWNlX3dpZHRoOworICAgICAgbmV3X3gg Kz0gaW5jcmVtZW50OworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIE1vdmUgdG8gWCAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgICAgcmMgPSAoSVRfQ0hBUlBP UyAoKml0KSA9PSBaVikKKyAgICAgICAgICAgICA/IE1PVkVfUE9TX01BVENIX09SX1pWCisgICAg ICAgICAgICAgOiBNT1ZFX1hfUkVBQ0hFRDsKKyAgICAgIC8qIFdoZW4gYGF1dG8taHNjcm9sbC1t b2RlJyBpcyBzZXQgdG8gYGN1cnJlbnQtbGluZWAgYW5kIHdlIGFyZSBob3Jpem9udGFsIHNjcm9s bGluZworICAgICAgYSBsb25nIGxpbmUgdGhhdCBhcHByb2FjaGVzIG9yIGV4Y2VlZHMgYW4gYGl0 LmN1cnJlbnQueGAgb2YgYXBwcm94aW1hdGVseSAxMDAwLCBgcmNgCisgICAgICB3aWxsIGVycm9u ZW91c2x5IHJldHVybiBlYXJseSB3aXRoIGEgTU9WRV9MSU5FX1RSVU5DQVRFRCBpbmRpY2F0b3Ig IHdpdGhvdXQgcHVzaGluZworICAgICAgZm9yd2FyZHMgdW50aWwgSVQgcmVhY2hlcyB0aGUgbmV3 X3guICBBcyBhIHdvcmthcm91bmQsIGlnbm9yZSBNT1ZFX0xJTkVfVFJVTkNBVEVELiAqLworICAg ICAgaWYgKElUX0NIQVJQT1MgKCppdCkgIT0gWlYKKyAgICAgICAgICAvKiBgSVRFUkFUT1JfQVRf RU5EX09GX0xJTkVfUGAgbWF5IGJlIGB0cnVlYCB3aGVuIElUIGlzIGF0IHRoZSBiZWdpbm5pbmcg b2YgYSBsaW5lLiAqLworICAgICAgICAgIC8qICYmICFJVEVSQVRPUl9BVF9FTkRfT0ZfTElORV9Q IChpdCkgKi8KKyAgICAgICAgICAmJiAoRkVUQ0hfQllURSAoSVRfQllURVBPUyAoKml0KSkgIT0g J1xuJworICAgICAgICAgICAgICB8fCAoRkVUQ0hfQllURSAoSVRfQllURVBPUyAoKml0KSkgPT0g J1xuJworICAgICAgICAgICAgICAgICAgJiYgaXQtPmMgPT0gMCkpCisgICAgICAgICAgJiYgaXQt PmN1cnJlbnRfeCArIGZvbnRfc3BhY2Vfd2lkdGggPD0gbmV3X3gKKyAgICAgICAgICAmJiAocmMg PT0gTU9WRV9YX1JFQUNIRUQKKyAgICAgICAgICAgICAgfHwgcmMgPT0gTU9WRV9MSU5FX1RSVU5D QVRFRAorICAgICAgICAgICAgICB8fCAoaXQtPmxpbmVfd3JhcCA9PSBXT1JEX1dSQVAKKyAgICAg ICAgICAgICAgICAgICYmIHJjID09IE1PVkVfUE9TX01BVENIX09SX1pWKSkpCisgICAgICAgIHsK KyAgICAgICAgICBzdHJ1Y3QgaXQgc2F2ZWRfaXQ7CisgICAgICAgICAgdm9pZCAqc2F2ZWRfaXRk YXRhID0gYmlkaV9zaGVsdmVfY2FjaGUgKCk7CisgICAgICAgICAgaW50IHByZXZfeDsKKyAgICAg ICAgICBTQVZFX0lUIChzYXZlZF9pdCwgKml0LCBzYXZlZF9pdGRhdGEpOworICAgICAgICAgIHJj ID0gbW92ZV9pdF9pbl9kaXNwbGF5X2xpbmVfdG8gKGl0LCBaViwgbmV3X3gsIE1PVkVfVE9fUE9T IHwgTU9WRV9UT19YKTsKKyAgICAgICAgICAvKiBXaGVuIHdvcmQtd3JhcCBpcyBvbiwgVE9fWCBt YXkgbGllIHBhc3QgdGhlIGVuZCBvZiBhIHdyYXBwZWQgbGluZS4KKyAgICAgICAgICBUaGVuIGl0 LT5jdXJyZW50IGlzIHRoZSBjaGFyYWN0ZXIgb24gdGhlIG5leHQgbGluZSwgc28gYmFja3RyYWNr IHRvIHRoZQorICAgICAgICAgIHNwYWNlIGJlZm9yZSB0aGUgd3JhcCBwb2ludC4gICovCisgICAg ICAgICAgaWYgKGl0LT5saW5lX3dyYXAgPT0gV09SRF9XUkFQCisgICAgICAgICAgICAgICYmIHJj ID09IE1PVkVfTElORV9DT05USU5VRUQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHBy ZXZfeCA9IG1heCAoaXQtPmN1cnJlbnRfeCAtIDEsIDApOworICAgICAgICAgICAgICBSRVNUT1JF X0lUIChpdCwgJnNhdmVkX2l0LCBzYXZlZF9pdGRhdGEpOworICAgICAgICAgICAgICBtb3ZlX2l0 X2luX2Rpc3BsYXlfbGluZV90byAoaXQsIC0xLCBwcmV2X3gsIE1PVkVfVE9fWCk7CisgICAgICAg ICAgICB9CisgICAgICAgICAgLyogV29ya2Fyb3VuZCBmb3IgYnVnICMyODkzNiAtLSBjb3JyZWN0 IHRoZSBlcnJvbmVvdXMgTU9WRV9QT1NfTUFUQ0hfT1JfWlYuCisgICAgICAgICAgIzI4OTM2OiAg YG1vdmVfaXRfaW5fZGlzcGxheV9saW5lX3R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zKQorICAgICAgJiYgIUVR IChWZGlzcGxheV9saW5lX251bWJlcnMsIFF2aXN1YWwpKQorICAgIHsKKyAgICAgIGl0LmZpcnN0 X3Zpc2libGVfeCA9IDA7CisgICAgICBtb3ZlX2l0X2J5X2xpbmVzICgmaXQsIDEpOworICAgICAg bG51bV93aWR0aCA9IGl0LmxudW1fd2lkdGg7CisgICAgICBsbnVtX3BpeGVsX3dpZHRoID0gaXQu bG51bV9waXhlbF93aWR0aDsKKyAgICAgIFJFU1RPUkVfSVQgKCZpdCwgJnNhdmVkX2l0X2Zvcl93 aW5kb3dfc3RhcnQsIHNhdmVkX2l0ZGF0YV9mb3Jfd2luZG93X3N0YXJ0KTsKKyAgICAgIGl0LmZp cnN0X3Zpc2libGVfeCA9IGZpcnN0X3g7CisgICAgICBpdC5sYXN0X3Zpc2libGVfeCA9IGxhc3Rf eDsKKyAgICAgIGl0LmxudW1fd2lkdGggPSBsbnVtX3dpZHRoOworICAgICAgaXQubG51bV9waXhl bF93aWR0aCA9IGxudW1fcGl4ZWxfd2lkdGg7CisgICAgICBTQVZFX0lUIChzYXZlZF9pdF9mb3Jf d2luZG93X3N0YXJ0LCBpdCwgc2F2ZWRfaXRkYXRhX2Zvcl93aW5kb3dfc3RhcnQpOworICAgIH0K Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg UkVNT1ZFIEdMWVBIIENVUlNPUlMKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICAvKiBSZW1v dmUgdGhlIGN1cnNvcnMgdXNpbmcgdGhlIGNhY2hlIGlmIHRoZSBjb25kaXRpb25zIGFyZSBzYXRp c2ZpZWQuICovCisgIGlmICgocmVtb3ZlICYmICFOSUxQICh3LT5tdWx0aXBsZV9jdXJzb3JzX2Nh Y2hlKSAmJiBOSUxQIChCVkFSIChiLCBtY19nbHlwaF9saXN0KSkpCisgICAgICB8fCAoIU5JTFAg KHctPm11bHRpcGxlX2N1cnNvcnNfY2FjaGUpICYmICFOSUxQIChCVkFSIChiLCBtY19nbHlwaF9s aXN0KSkgJiYgKHJlbW92ZSB8fCB3ICE9IHN3KSkpCisgICAgeworICAgICAgLyogRXJhc2UgdGhl IHJlYWwgY3Vyc29yIHNvIHRoYXQgdGhlIHdob2xlIHZlcnRpY2FsIGxpbmUgZ2V0cyByZW1vdmVk LCBub3QganVzdCB0aGUgZmFrZSBjdXJzb3JzLiAqLworICAgICAgbWNfZXJhc2VfZ2x5cGhfY3Vy c29yICh3LCB3LT5waHlzX2N1cnNvci54LCB3LT5waHlzX2N1cnNvci55LCB3LT5waHlzX2N1cnNv ci5ocG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5waHlzX2N1cnNvci52cG9z LCB3LT5waHlzX2N1cnNvcl90eXBlKTsKKyAgICAgIC8qIFByb2Nlc3MgdGhlIE1DX0dMWVBIX0NB Q0hFLiAqLworICAgICAgaWYgKCFOSUxQICh3LT5tdWx0aXBsZV9jdXJzb3JzX2NhY2hlKSkKKyAg ICAgICAgeworICAgICAgICAgIGZvciAodmxpc3QgPSBYQ0FSIChYQ0RSICh3LT5tdWx0aXBsZV9j dXJzb3JzX2NhY2hlKSk7CisgICAgICAgICAgICAgICBDT05TUCAodmxpc3QpOworICAgICAgICAg ICAgICAgdmxpc3QgPSBYQ0RSICh2bGlzdCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAg IHRoaXJ0ZWVuX2VsZW1lbnRzID0gWENBUiAoWENEUiAoWENBUiAodmxpc3QpKSk7CisgICAgICAg ICAgICAgIHggPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMCksIHRoaXJ0ZWVuX2VsZW1lbnRz KSk7CisgICAgICAgICAgICAgIGZ4ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB0aGly dGVlbl9lbGVtZW50cykpOworICAgICAgICAgICAgICB5ID0gWElOVCAoRm50aCAobWFrZV9udW1i ZXIgKDIpLCB0aGlydGVlbl9lbGVtZW50cykpOworICAgICAgICAgICAgICBmeSA9IFhJTlQgKEZu dGggKG1ha2VfbnVtYmVyICgzKSwgdGhpcnRlZW5fZWxlbWVudHMpKTsKKyAgICAgICAgICAgICAg aHBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICg0KSwgdGhpcnRlZW5fZWxlbWVudHMpKTsK KyAgICAgICAgICAgICAgdnBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICg1KSwgdGhpcnRl ZW5fZWxlbWVudHMpKTsKKyAgICAgICAgICAgICAgaCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVy ICg2KSwgdGhpcnRlZW5fZWxlbWVudHMpKTsKKyAgICAgICAgICAgICAgY3Vyc29yX3R5cGUgPSBt Y19saXNwX3RvX2N1cnNvcl90eXBlIChGbnRoIChtYWtlX251bWJlciAoNyksIHRoaXJ0ZWVuX2Vs ZW1lbnRzKSk7CisgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCA9IFhJTlQgKEZudGggKG1ha2Vf bnVtYmVyICg4KSwgdGhpcnRlZW5fZWxlbWVudHMpKTsKKyAgICAgICAgICAgICAgZm9yZWdyb3Vu ZCA9IEZudGggKG1ha2VfbnVtYmVyICg5KSwgdGhpcnRlZW5fZWxlbWVudHMpOworICAgICAgICAg ICAgICBiYWNrZ3JvdW5kID0gRm50aCAobWFrZV9udW1iZXIgKDEwKSwgdGhpcnRlZW5fZWxlbWVu dHMpOworICAgICAgICAgICAgICBmbGF2b3IgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMTEp LCB0aGlydGVlbl9lbGVtZW50cykpOworICAgICAgICAgICAgICBwb3NpbnQgPSBYSU5UIChGbnRo IChtYWtlX251bWJlciAoMTIpLCB0aGlydGVlbl9lbGVtZW50cykpOworICAgICAgICAgICAgICBp ZiAoZmxhdm9yID09IE1DX0dMWVBITEVTUykKKyAgICAgICAgICAgICAgICBtY19kcmF3X2VyYXNl X2h5YnJpZCAodywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCBoLCBjdXJzb3JfdHlwZSwgY3Vy c29yX3dpZHRoLCBiYWNrZ3JvdW5kLCBmbGF2b3IpOworICAgICAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgICAgIG1jX2VyYXNlX2dseXBoX2N1cnNvciAodywgeCwgeSwgaHBvcywgdnBv cywgY3Vyc29yX3R5cGUpOworICAgICAgICAgICAgfQorICAgICAgICAgIGlmIChOSUxQIChCVkFS IChiLCBtY19nbHlwaF9saXN0KSkpCisgICAgICAgICAgICB3c2V0X211bHRpcGxlX2N1cnNvcnNf Y2FjaGUgKHcsIFFuaWwpOworICAgICAgICB9CisgICAgICB3LT5tYy5lcmFzZV9nbHlwaF9jdXJz b3IgPSBmYWxzZTsKKyAgICB9CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIFJFRFJBVyBHTFlQSCBDVVJTT1JTCisqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKyAgLyogSWYgdGhlIGZpcnN0IGVsZW1lbnQgb2Ygdy0+bXVsdGlwbGVfY3Vyc29y c19jYWNoZSBpcyB0aGUgc2FtZSBhcyB0aGUgbG9jYWwgdmFyaWFibGUgbWNfZ2x5cGhfbGlzdCwK KyAgICAgYW5kIHRoZSBwcmV2aW91cy9jdXJyZW50IHdpbmRvdy1zdGFydC93aW5kb3ctZW5kIGFy ZSB0aGUgc2FtZSAoZS5nLiwgbm8gc2Nyb2xsaW5nKSwKKyAgICAgdGhlbiByZWR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RlZW5fZWxlbWVudHMpKTsKKyAgICAgICAgICB5ID0g WElOVCAoRm50aCAobWFrZV9udW1iZXIgKDIpLCB0aGlydGVlbl9lbGVtZW50cykpOworICAgICAg ICAgIGZ5ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDMpLCB0aGlydGVlbl9lbGVtZW50cykp OworICAgICAgICAgIGhwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoNCksIHRoaXJ0ZWVu X2VsZW1lbnRzKSk7CisgICAgICAgICAgdnBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICg1 KSwgdGhpcnRlZW5fZWxlbWVudHMpKTsKKyAgICAgICAgICBoID0gWElOVCAoRm50aCAobWFrZV9u dW1iZXIgKDYpLCB0aGlydGVlbl9lbGVtZW50cykpOworICAgICAgICAgIGN1cnNvcl90eXBlID0g bWNfbGlzcF90b19jdXJzb3JfdHlwZSAoRm50aCAobWFrZV9udW1iZXIgKDcpLCB0aGlydGVlbl9l bGVtZW50cykpOworICAgICAgICAgIGN1cnNvcl93aWR0aCA9IFhJTlQgKEZudGggKG1ha2VfbnVt YmVyICg4KSwgdGhpcnRlZW5fZWxlbWVudHMpKTsKKyAgICAgICAgICBmb3JlZ3JvdW5kID0gRm50 aCAobWFrZV9udW1iZXIgKDkpLCB0aGlydGVlbl9lbGVtZW50cyk7CisgICAgICAgICAgYmFja2dy b3VuZCA9IEZudGggKG1ha2VfbnVtYmVyICgxMCksIHRoaXJ0ZWVuX2VsZW1lbnRzKTsKKyAgICAg ICAgICBmbGF2b3IgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMTEpLCB0aGlydGVlbl9lbGVt ZW50cykpOworICAgICAgICAgIHBvc2ludCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgxMiks IHRoaXJ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICAgICAgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHcs IHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwg Zm9yZWdyb3VuZCwgTUNfR0xZUEgpOworICAgICAgICB9CisgICAgICB3LT5tYy5kcmF3X2dseXBo X2N1cnNvciA9IGZhbHNlOworICAgIH0KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBEUkFXIEdMWVBIIENVUlNPUlMgQU5FVworKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisgICAgLyogRHJhdyB0aGUgY3Vyc29ycyBhbmV3IGJlY2F1c2Ugc29t ZXRoaW5nIGhhcyBjaGFuZ2VkLCBlLmcuLCB0aGUgZmlyc3QgZWxlbWVudCBvZgorICAgICAgIHct Pm11bHRpcGxlX2N1cnNvcnNfY2FjaGUgaXMgTk9UIHRoZSBzYW1lIGFzIHRoZSBsb2NhbCB2YXJp YWJsZSBtY19nbHlwaF9saXN0OyBhbmQvb3IsIHRoZSBwcmV2aW91cy8KKyAgICAgICBjdXJyZW50 IHdpbmRvdy1zdGFydC93aW5kb3ctZW5kIGFyZSBOT1QgdGhlIHNhbWUgKGUuZy4sIHNjcm9sbGlu ZyBoYXMgb2NjdXJyZWQpLgorICAgICAgIFNlbWktZXhwZW5zaXZlIGNhbGN1bGF0aW9uIG9mIGNv b3JkaW5hdGVzIGlzIHJlcXVpcmVkLiAqLworICAgIGVsc2UgaWYgKCFyZW1vdmUKKyAgICAgICAg ICAgICAmJiB3ID09IHN3CisgICAgICAgICAgICAgJiYgdy0+bWMuY3VycmVudF9zdGFydAorICAg ICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBtY19nbHlwaF9saXN0KSkpCisgICAgICB7Cisg ICAgICAgIGZvciAodmxpc3QgPSBCVkFSIChiLCBtY19nbHlwaF9saXN0KTsKKyAgICAgICAgICAg ICBDT05TUCAodmxpc3QpOworICAgICAgICAgICAgIHZsaXN0ID0gWENEUiAodmxpc3QpKQorICAg ICAgICAgIHsKKyAgICAgICAgICAgIHNwZWNzID0gWENBUiAodmxpc3QpOworICAgICAgICAgICAg cG9zaW50ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCBzcGVjcykpOworICAgICAgICAg ICAgbGlzcF90eXBlID0gRm50aCAobWFrZV9udW1iZXIgKDEpLCBzcGVjcyk7CisgICAgICAgICAg ICBpZiAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgIGN1cnNvcl90eXBlID0gbWNf bGlzcF90b19jdXJzb3JfdHlwZSAoWENBUiAobGlzcF90eXBlKSk7CisgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUg KGxpc3BfdHlwZSk7CisgICAgICAgICAgICBpZiAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAg ICAgICAgIGN1cnNvcl93aWR0aCA9IFhJTlQgKFhDQVIgKFhDRFIgKGxpc3BfdHlwZSkpKTsKKyAg ICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCA9IDE7CisgICAg ICAgICAgICBmb3JlZ3JvdW5kID0gRm50aCAobWFrZV9udW1iZXIgKDIpLCBzcGVjcyk7CisgICAg ICAgICAgICBpZiAoU1RSSU5HUCAoZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgIGZvcmVncm91 bmQgPSBtY19jb2xvcl92ZWN0b3JfY2FsYyAodywgZm9yZWdyb3VuZCk7CisgICAgICAgICAgICBp ZiAocG9zaW50ID49IHctPm1jLmN1cnJlbnRfc3RhcnQKKyAgICAgICAgICAgICAgICAmJiBwb3Np bnQgPD0gdy0+bWMuY3VycmVudF9lbmQpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg ICBSRVNUT1JFX0lUICgmaXQsICZzYXZlZF9pdF9mb3Jfd2luZG93X3N0YXJ0LCBzYXZlZF9pdGRh dGFfZm9yX3dpbmRvd19zdGFydCk7CisgICAgICAgICAgICAgICAgbW92ZV9pdF90byAoJml0LCBw b3NpbnQsIGl0Lmxhc3RfdmlzaWJsZV94LCBpdC5sYXN0X3Zpc2libGVfeSAtIDEsIC0xLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgIE1PVkVfVE9fUE9TIHwgTU9WRV9UT19YIHwgTU9WRV9U T19ZKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKElUX0NIQVJQT1MgKGl0KSA9 PSBwb3NpbnQpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpbnQgdm9mZnNldCA9 IGl0LnZwb3M7CisgICAgICAgICAgICAgICAgUkVTVE9SRV9JVCAoJml0LCAmc2F2ZWRfaXRfZm9y X3dpbmRvd19zdGFydCwgc2F2ZWRfaXRkYXRhX2Zvcl93aW5kb3dfc3RhcnQpOworICAgICAgICAg ICAgICAgIG1vdmVfaXRfYnlfbGluZXMgKCZpdCwgdm9mZnNldCk7CisgICAgICAgICAgICAgICAg bWNfbW92ZV9pdCAoJml0LCBNVUxUSVBMRV9DVVJTT1JTLCBzcGVjcywgJnJlc3VsdCk7CisgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgIHggPSAtMTsKKyAgICAgICAgICAgICAgICAgIGZ4ID0gLTE7CisgICAgICAg ICAgICAgICAgICB5ID0gLTE7CisgICAgICAgICAgICAgICAgICBmeSA9IC0xOworICAgICAgICAg ICAgICAgICAgaHBvcyA9IC0xOworICAgICAgICAgICAgICAgICAgdnBvcyA9IC0xOworICAgICAg ICAgICAgICAgICAgaCA9IC0xOworICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZCA9IG1jX2Jn X2xzbCAoaXQudywgREVGQVVMVF9GQUNFX0lEKTsKKyAgICAgICAgICAgICAgICAgIGZsYXZvciA9 IE1DX0dMWVBIOworICAgICAgICAgICAgICAgICAgdGhpcnRlZW5fZWxlbWVudHMgPSBsaXN0biAo Q09OU1RZUEVfSEVBUCwgMTMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgbWFrZV9udW1iZXIgKHgpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIG1ha2VfbnVtYmVyIChmeCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgbWFrZV9udW1iZXIgKHkpLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIG1ha2VfbnVtYmVyIChmeSksCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgbWFrZV9udW1iZXIgKGhwb3MpLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ha2VfbnVtYmVyICh2cG9zKSwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYWtlX251bWJlciAoaCksCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWNfY3Vyc29yX3R5cGVf dG9fbGlzcCAoY3Vyc29yX3R5cGUpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIG1ha2VfbnVtYmVyIChjdXJzb3Jfd2lkdGgpLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBtYWtlX251bWJlciAoZmxhdm9yKSwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYWtlX251bWJlciAocG9zaW50KSk7Cisg ICAgICAgICAgICAgICAgICB0ZW1wID0gRmNvbnMgKHNwZWNzLCBGY29ucyAodGhpcnRlZW5fZWxl bWVudHMsIFFuaWwpKTsKKyAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IEZjb25zICh0ZW1wLCBy ZXN1bHQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICB9CisvKiBgdy0+bXVsdGlwbGVf Y3Vyc29yc19jYWNoZScgaXMgc2V0IGZvciB0aGUgd2luZG93LCBub3QgYnVmZmVyK3dpbmRvdyAt LSBpLmUuLCBhbGwgYnVmZmVycyBhcHBlYXJpbmcKK2luIHRoZSBzYW1lIHdpbmRvdyB2aWEgYHN3 aXRjaC10by1idWZmZXInIHdpbGwgaGF2ZSBgdy0+bXVsdGlwbGVfY3Vyc29yc19jYWNoZScuICBU aGlzIGJlaGF2aW9yCitpcyBjb25zaXN0ZW50IHdpdGggZnVuY3Rpb25zIHN1Y2ggYXMgYHNldC13 aW5kb3ctZGlzcGxheS10YWJsZScuICBXZSBkZWFsIHdpdGggdGhpcyBpbgorYG5zdGVybS5tJyAv IGB3MzJ0ZXJtLmMnIC8gYHh0ZXJtLmMnIGJ5IGNvbXBhcmluZyBgdy0+Y29udGVudHMnIHRvIHRo ZSB2YWx1ZSBvZiB0aGUgYGJ1ZicKK3N0b3JlZCBpbiBgdy0+bXVsdGlwbGVfY3Vyc29yc19jYWNo ZSc6ICAoRVEgKHctPmNvbnRlbnRzLCBYQ0FSIChGbnRoIChtYWtlX251bWJlciAoMiksIHctPm11 bHRpcGxlX2N1cnNvcnNfY2FjaGUpKSkpICovCisgICAgICAgIGlmICghTklMUCAocmVzdWx0KSkK KyAgICAgICAgICB3c2V0X211bHRpcGxlX2N1cnNvcnNfY2FjaGUgKHcsIGxpc3RuIChDT05TVFlQ RV9IRUFQLCAzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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jhc2hfdHdvKQorICAgIHJldHVybjsKKyAgaWYg KCFCVUZGRVJQIChidWYpKQorICAgIHJldHVybjsKKyAgaWYgKE5JTFAgKEJWQVIgKGIsIGNyb3Nz aGFpcnMpKSkKKyAgICByZXR1cm47CisgIGlmIChOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzX2hv cml6b250YWxfcnVsZXIpKQorICAgICAgJiYgTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlyc192ZXJ0 aWNhbF9ydWxlcikpKQorICAgIHJldHVybjsKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgU1RBUlQgVEhFIFRJTUVSCisqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qCisjaWZkZWYgR0xZUEhfREVCVUcKKyAgY2xvY2tfdCBzdGFydCwgZW5k OworICBkb3VibGUgY3B1X3RpbWVfdXNlZDsKKyAgY2hhciBidWZfdGltZVtEQkxfQlVGU0laRV9C T1VORF07CisgIHN0YXJ0ID0gY2xvY2soKTsKKyNlbmRpZgorKi8KKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQkVHSU4gSk9VUk5FWSAuLi4K KyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworICBzdHJ1Y3QgaXQgaXQ7CisgIHZvaWQgKml0ZGF0 YSA9IGJpZGlfc2hlbHZlX2NhY2hlICgpOworICBzdHJ1Y3QgaXQgc2F2ZWRfaXRfZm9yX3dpbmRv d19zdGFydDsKKyA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dXRwdXRfY3Vyc29yLnZwb3M7CisgIHB0cmRpZmZf dCBjdXJyZW50X2NvbCA9IGN1cnJlbnRfY29sdW1uICgpOworICBib29sIGZpbGxfY29sdW1uX3Ag PSAhTklMUCAoQlZBUiAoYiwgZmlsbF9jb2x1bW4pKTsKKyAgcHRyZGlmZl90IGZpbGxfY29sID0g WElOVCAoQlZBUiAoYiwgZmlsbF9jb2x1bW4pKTsKKyAgTGlzcF9PYmplY3QgcmVzdWx0ID0gUW5p bDsKKyAgaW50IGZsYXZvcjsKKyAgLyogVmFsdWVzIGZvciB0aGUgY3VycmVudCBjb2x1bW4gb2Yg dGhlIHZlcnRpY2FsIGxpbmUuICovCisgIExpc3BfT2JqZWN0IGZvcmVncm91bmQgPSBGbWFrZV92 ZWN0b3IgKG1ha2VfbnVtYmVyICgzKSwgUW5pbCk7CisgIGVudW0gZmFjZV9pZCBmYWNlX2lkOwor ICBzdHJ1Y3QgZ2x5cGggKnBoeXNfY3Vyc29yX2dseXBoOworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENPTE9SIE9GIENST1NTSEFJUlMKKyoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworICBlbnVtIGZhY2VfaWQgZXZlbl9mYWNlX2lkID0KKyAg ICBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1ldmVuLW51bWJlcmVkLWNvbHVt bi1mYWNlIiksIHRydWUpOworICBzdHJ1Y3QgZmFjZSAqZXZlbl9mYWNlID0gRkFDRV9GUk9NX0lE IChmLCBldmVuX2ZhY2VfaWQpOworICBMaXNwX09iamVjdCBldmVuX2NvbG9yID0gZXZlbl9mYWNl LT5sZmFjZVtMRkFDRV9GT1JFR1JPVU5EX0l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ZW50X2NvbCAlIDIgIT0gMAorICAgICAg JiYgIWZpbGxfY29sdW1uX3ApCisgICAgZm9yZWdyb3VuZCA9IG9kZF9jb2xvcl92ZWN0b3I7Cisg IC8qIHllbGxvdyAqLworICBpZiAoY3VycmVudF9jb2wgJSAyID09IDAKKyAgICAgICYmICFmaWxs X2NvbHVtbl9wKQorICAgIGZvcmVncm91bmQgPSBldmVuX2NvbG9yX3ZlY3RvcjsKKyAgLyogcmVk ICovCisgIGlmIChjdXJyZW50X2NvbCAlIDIgIT0gMAorICAgICAgJiYgZmlsbF9jb2x1bW5fcAor ICAgICAgJiYgY3VycmVudF9jb2wgPD0gZmlsbF9jb2wpCisgICAgZm9yZWdyb3VuZCA9IG9kZF9j b2xvcl92ZWN0b3I7CisgIC8qIHllbGxvdyAqLworICBpZiAoY3VycmVudF9jb2wgJSAyID09IDAK KyAgICAgICYmIGZpbGxfY29sdW1uX3AKKyAgICAgICYmIGN1cnJlbnRfY29sIDw9IGZpbGxfY29s KQorICAgIGZvcmVncm91bmQgPSBldmVuX2NvbG9yX3ZlY3RvcjsKKyAgLyogZ3JlZW4gKi8KKyAg aWYgKGZpbGxfY29sdW1uX3AKKyAgICAgICYmIGN1cnJlbnRfY29sID4gZmlsbF9jb2wpCisgICAg Zm9yZWdyb3VuZCA9IGZpbGxfY29sb3JfdmVjdG9yOworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq CisgICAgICAgICAgICAgICAgICAgICAgU1RBUlQgRElTUExBWSBBTkQgUFJJTUUgSVQKKyoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworICAvKiBCZWdpbiB0aGUgam91cm5leSBhdCB3LT5zdGFydC4g Ki8KKyAgU0VUX1RFWFRfUE9TX0ZST01fTUFSS0VSIChzdGFydF90ZXh0X3Bvc2l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IHRoaXMgaXMgbW9z dCBsaWtlbHkgZHVlIHRvIGFuIGluY29ycmVjdCBIUE9TLgorVGhpcyBwaGVub21lbmEgZG9lcyBu b3Qgb2NjdXIgd2hlbiAoc2Nyb2xsLWxlZnQgMSkgaXMgY2FsbGVkIGludGVyYWN0aXZlbHk7IGUu Zy4sCitob3Jpem9udGFsIHNjcm9sbCB3aGVlbC4gIEluYXNtdWNoIGFzIGBlcmFzZV9waHlzX2N1 cnNvcicgdXBkYXRlcyBtb3JlIHRoYW4KK21lcmVseSB0aGUgYWZvcmVtZW50aW9uZWQgY29vcmRp bmF0ZXMsIHJlc2V0dGluZyB0aG9zZSBjb29yZGluYXRlcyBhZnRlciB0aGUgZmFjdAoraXMgaW5z dWZmaWNpZW50IHRvIGZpeCB0aGUgcHJvYmxlbS4gIFdlIHVzZSBgdy0+b3V0cHV0X2N1cnNvci54 L3kvaHBvcy92cG9zYAorYmVjYXVzZSB0aG9zZSBjb29yZGluYXRlcyBhcmUgY29ycmVjdC4gIFdl IGZpeCBgdy0+cGh5c19jdXJzb3IueC95L2hwb3MvdnBvc2AKK0JFRk9SRSBjYWxsaW5nIGBlcmFz ZV9waHlzX2N1cnNvcicgc28gdGhhdCBvdGhlciBnb29kaWVzIGFyZSB1cGRhdGVkLiAqLworICB3 LT5waHlzX2N1cnNvci54ID0gb3BvaW50X3g7CisgIHctPnBoeXNfY3Vyc29yLnkgPSBvcG9pbnRf eTsKKyAgdy0+cGh5c19jdXJzb3IuaHBvcyA9IG9wb2ludF9ocG9zOworICB3LT5waHlzX2N1cnNv ci52cG9zID0gb3BvaW50X3Zwb3M7CisgIGVyYXNlX3BoeXNfY3Vyc29yICh3KTsKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICBSRVBMQUNFIFRIRSBS RUFMIENVUlNPUgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisgIGdseXBoX3JvdyA9IE1BVFJJ WF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCBvcG9pbnRfdnBvcyk7CisgIGlmICghY3Vyc29yX2lu X2ZyaW5nZV9wKQorICAgIGZsYXZvciA9IE1DX0dMWVBIOworICAgIC8qIFRoaXMgY29uZGl0aW9u IHByb2JhYmx5IGRvZXMgbm90IGV4aXN0IGZvciB0aGUgcmVhbCBmYWtlIGN1cnNvci4gKi8KKyAg ICBlbHNlIGlmIChjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAgICAgICAgICAmJiBnbHlwaF9yb3ct PmNvbnRpbnVlZF9wKQorICAgICAgZmxhdm9yID0gTUNfUElMQ1JPVzsKKyAgICAgIGVsc2UgaWYg KGN1cnNvcl9pbl9mcmluZ2VfcAorICAgICAgICAgICAgICAgJiYgZ2x5cGhfcm93LT50cnVuY2F0 ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgZmxhdm9yID0gTUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdI VF9BTkdMRTsKKyAgICAgICAgZWxzZSBpZiAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAg ICAgICAgICYmICFnbHlwaF9yb3ctPmNvbnRpbnVlZF9wCisgICAgICAgICAgICAgICAgICYmICFn bHlwaF9yb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgIGZsYXZvciA9IE1DX0hP TExPV19SRUNUQU5HTEU7CisgIGZhY2VfaWQgPSAoKHBoeXNfY3Vyc29yX2dseXBoID0gZ2V0X3Bo eXNfY3Vyc29yX2dseXBoICh3KSkgPT0gTlVMTCkKKyAgICAgICAgICAgICAgPyBERUZBVUxUX0ZB Q0VfSUQKKyAgICAgICAgICAgICAgOiBwaHlzX2N1cnNvcl9nbHlwaC0+ZmFjZV9pZDsKKyAgaW50 IG9wb2ludF9meCA9IC0xOworICBpbnQgb3BvaW50X2Z5ID0gLTE7CisgIGludCBvcG9pbnRfaCA9 IC0xOworICBpZiAoZmxhdm9yID09IE1DX0dMWVBIKQorICAgIG1jX2dldF9waHlzX2N1cnNvcl9n ZW9tZXRyeSAodywgZ2x5cGhfcm93LCBvcG9pbnRfeCwgJm9wb2ludF9meCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIG9wb2ludF95LCAmb3BvaW50X2Z5LCBvcG9pbnRfaHBvcywg b3BvaW50X3Zwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmb3BvaW50X2gs IEhPTExPV19CT1hfQ1VSU09SLCBjdXJzb3Jfd2lkdGgpOworICBtY19jcm9zc2hhaXJzX2hlbHBl ciAodywgb3BvaW50X3gsIG9wb2ludF9meCwgb3BvaW50X3ksIG9wb2ludF9meSwKKyAgICAgICAg ICAgICAgICAgICAgICAgIG9wb2ludF9ocG9zLCBvcG9pbnRfdnBvcywgb3BvaW50X2gsCisgICAg ICAgICAgICAgICAgICAgICAgICBIT0xMT1dfQk9YX0NVUlNPUiwgY3Vyc29yX3dpZHRoLAorICAg ICAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZCwgbWNfYmdfbHNsICh3LCBmYWNlX2lkKSwK KyAgICAgICAgICAgICAgICAgICAgICAgIGZsYXZvciwgb3BvaW50X3B0LCAmcmVzdWx0KTsKKyAg bWNfY3Jvc3NoYWlyc19oZWxwZXIgKHcsIG9wb2ludF94LCBvcG9pbnRfZngsIG9wb2ludF95LCBv cG9pbnRfZnksCisgICAgICAgICAgICAgICAgICAgICAgICBvcG9pbnRfaHBvcywgb3BvaW50X3Zw b3MsIG9wb2ludF9oLAorICAgICAgICAgICAgICAgICAgICAgICAgSE9MTE9XX0JPWF9DVVJTT1Is IGN1cnNvcl93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQsIG1jX2Jn X2xzbCAodywgZmFjZV9pZCksCisgICAgICAgICAgICAgICAgICAgICAgICBPVkVSTEFZX0FSUk9X X0JJVE1BUCwgb3BvaW50X3B0LCAmcmVzdWx0KTsKKyAgaWYgKE5JTFAgKEJWQVIgKGIsIGNyb3Nz aGFpcnNfaG9yaXpvbnRhbF9ydWxlcikpKQorICAgIGdvdG8gdmVydGljYWxfcnVsZXI7CisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICBIT1JJWk9OVEFMIFJVTEVSOiAg RklSU1QgWCA9PiBFT0wKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5kCisgICAg ICAgSE9SSVpPTlRBTCBSVUxFUjogIERSQVcgRkxPQVRJTkcgR0xZUEhMRVNTIExJTkUgKEVPTCBU TyBGUklOR0UpCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAgLyogUGxhY2UgdGhlIElUIG9u IHRoZSBjdXJyZW50IGxpbmUgY29udGFpbmluZyBQVC4gKi8KKyAgaW50IHZvZmZzZXQgPSAoaGVh ZGVyX2xpbmVfaGVpZ2h0ID4gMAorICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfdnBvcyA+IDAp CisgICAgICAgICAgICAgICAgICA/IG9wb2ludF92cG9zIC0gMQorICAgICAgICAgICAgICAgICAg OiBvcG9pbnRfdnBvczsKKyAgaWYgKHZvZmZzZXQgPiAwKQorICAgIG1vdmVfaXRfYnlfbGluZXMg KCZpdCwgdm9mZnNldCk7CisgIG1jX21vdmVfaXQgKCZpdCwgSE9SSVpPTlRBTF9SVUxFUiwgZm9y ZWdyb3VuZCwgJnJlc3VsdCk7CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKK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pdGggYSBjb25kaXRpb24gdG8gdGVzdCBmb3IgWlYgYXQgdGhlIG91dHNldCBhbmQg cmV0dXJuIGlmIHRydWUsCisgICAgICB3aGljaCBwcmV2ZW50cyBFbWFjcyBmcm9tIGNyYXNoaW5n LiAqLworICAgICAgaWYgKElUX0NIQVJQT1MgKGl0KSA9PSBaVikKKyAgICAgICAgYnJlYWs7Cisg ICAgICBtb3ZlX2l0X2J5X2xpbmVzICgmaXQsIDEpOworICAgICAgaWYgKGl0LmN1cnJlbnRfeSA+ PSBpdC5sYXN0X3Zpc2libGVfeSkKKyAgICAgICAgYnJlYWs7CisgICAgfQorLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNFVCBUSEUgQ0FD SEUKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICBjcm9zc2hhaXJzX2ZpbmlzaDoKKyAgaWYg KCFOSUxQIChyZXN1bHQpKQorICAgIHdzZXRfY3Jvc3NoYWlyc19jYWNoZSAodywgbGlzdG4gKENP TlNUWVBFX0hFQVAsIDMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRnJl dmVyc2UgKHJlc3VsdCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmNv bnMgKHNlbGVjdGVkX3dpbmRvdywgUW5pbCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgRmNvbnMgKGJ1ZiwgUW5pbCkpKTsKKyAgdy0+bWMuZHJhd19jcm9zc2hhaXJzID0g ZmFsc2U7CisgIGJpZGlfdW5zaGVsdmVfY2FjaGUgKGl0ZGF0YSwgZmFsc2UpOworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNUT1AgVEhF IFRJTUVSCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qCisjaWZkZWYgR0xZUEhfREVCVUcK KyAgZW5kID0gY2xvY2soKTsKKyAgY3B1X3RpbWVfdXNlZCA9ICgoZG91YmxlKSAoZW5kIC0gc3Rh cnQpKSAvIENMT0NLU19QRVJfU0VDOworICBkdG9hc3RyIChidWZfdGltZSwgc2l6ZW9mIGJ1Zl90 aW1lLCAwLCAwLCBjcHVfdGltZV91c2VkKTsKKyAgZGVidWdfbWV0aG9kX2FkZCAodywgIm1jX2Ry YXdfY3Jvc3NoYWlyczogIFRJTUUgKCVzKSIsIGJ1Zl90aW1lKTsKKyNlbmRpZgorKi8KK312b2lk CisKK21jX3JlZHJhd19jcm9zc2hhaXJzIChzdHJ1Y3Qgd2luZG93ICp3KQoreworLyoKKyNpZmRl ZiBHTFlQSF9ERUJVRworICBjbG9ja190IHN0YXJ0LCBlbmQ7CisgIGRvdWJsZSBjcHVfdGltZV91 c2VkOworICBjaGFyIGJ1Zl90aW1lW0RCTF9CVUZTSVpFX0JPVU5EXTsKKyAgc3RhcnQgPSBjbG9j aygpOworI2VuZGlmCisqLworICBMaXNwX09iamVjdCB2bGlzdCA9IFFuaWw7CisgIExpc3BfT2Jq ZWN0IHRoaXJ0ZWVuX2VsZW1lbnRzID0gUW5pbDsKKyAgaW50IHgsIGZ4LCB5LCBmeSwgaHBvcywg dnBvcywgaDsKKyAgZW51bSB0ZXh0X2N1cnNvcl9raW5kcyBjdXJzb3JfdHlwZTsKKyAgaW50IGN1 cnNvcl93aWR0aDsKKyAgTGlzcF9PYmplY3QgZm9yZWdyb3VuZCA9IFFuaWw7CisgIExpc3BfT2Jq ZWN0IGJhY2tncm91bmQgPSBRbmlsOworICBpbnQgZmxhdm9yOworICBwdHJkaWZmX3QgcG9zOwor ICBmb3IgKHZsaXN0ID0gWENBUiAody0+Y3Jvc3NoYWlyc19jYWNoZSk7CisgICAgICAgQ09OU1Ag KHZsaXN0KTsKKyAgICAgICB2bGlzdCA9IFhDRFIgKHZsaXN0KSkKKyAgICB7CisgICAgICB0aGly dGVlbl9lbGVtZW50cyA9IFhDQVIgKHZsaXN0KTsKKyAgICAgIHggPSBYSU5UIChGbnRoIChtYWtl X251bWJlciAoMCksIHRoaXJ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICBmeCA9IFhJTlQgKEZudGgg KG1ha2VfbnVtYmVyICgxKSwgdGhpcnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIHkgPSBYSU5UIChG bnRoIChtYWtlX251bWJlciAoMiksIHRoaXJ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICBmeSA9IFhJ TlQgKEZudGggKG1ha2VfbnVtYmVyICgzKSwgdGhpcnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIGhw b3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoNCksIHRoaXJ0ZWVuX2VsZW1lbnRzKSk7Cisg ICAgICB2cG9zID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDUpLCB0aGlydGVlbl9lbGVtZW50 cykpOworICAgICAgaCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICg2KSwgdGhpcnRlZW5fZWxl bWVudHMpKTsKKyAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoRm50 aCAobWFrZV9udW1iZXIgKDcpLCB0aGlydGVlbl9lbGVtZW50cykpOworICAgICAgY3Vyc29yX3dp ZHRoID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDgpLCB0aGlydGVlbl9lbGVtZW50cykpOwor ICAgICAgZm9yZWdyb3VuZCA9IEZudGggKG1ha2VfbnVtYmVyICg5KSwgdGhpcnRlZW5fZWxlbWVu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0KTsKKyAgICAgIHggPSBYSU5UIChGbnRoICht YWtlX251bWJlciAoMCksIHRoaXJ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICBmeCA9IFhJTlQgKEZu dGggKG1ha2VfbnVtYmVyICgxKSwgdGhpcnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIHkgPSBYSU5U IChGbnRoIChtYWtlX251bWJlciAoMiksIHRoaXJ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICBmeSA9 IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgzKSwgdGhpcnRlZW5fZWxlbWVudHMpKTsKKyAgICAg IGhwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoNCksIHRoaXJ0ZWVuX2VsZW1lbnRzKSk7 CisgICAgICB2cG9zID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDUpLCB0aGlydGVlbl9lbGVt ZW50cykpOworICAgICAgaCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICg2KSwgdGhpcnRlZW5f ZWxlbWVudHMpKTsKKyAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAo Rm50aCAobWFrZV9udW1iZXIgKDcpLCB0aGlydGVlbl9lbGVtZW50cykpOworICAgICAgY3Vyc29y X3dpZHRoID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDgpLCB0aGlydGVlbl9lbGVtZW50cykp OworICAgICAgZm9yZWdyb3VuZCA9IEZudGggKG1ha2VfbnVtYmVyICg5KSwgdGhpcnRlZW5fZWxl bWVudHMpOworICAgICAgYmFja2dyb3VuZCA9IEZudGggKG1ha2VfbnVtYmVyICgxMCksIHRoaXJ0 ZWVuX2VsZW1lbnRzKTsKKyAgICAgIGZsYXZvciA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgx MSksIHRoaXJ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICBwb3MgPSBYSU5UIChGbnRoIChtYWtlX251 bWJlciAoMTIpLCB0aGlydGVlbl9lbGVtZW50cykpOworICAgICAgaWYgKGZsYXZvciA9PSBNQ19H TFlQSCkKKyAgICAgICAgbWNfZXJhc2VfZ2x5cGhfY3Vyc29yICh3LCB4LCB5LCBocG9zLCB2cG9z LCBjdXJzb3JfdHlwZSk7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAg ICAgICBpZiAoZmxhdm9yID09IE9WRVJMQVlfQVJST1dfQklUTUFQCisgICAgICAgICAgICAgICAg ICB8fCBmbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BTkdMRQorICAgICAgICAg ICAgICAgICAgfHwgZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEUKKyAgICAgICAgICAgICAg ICAgIHx8IGZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQU5HTEUKKyAgICAgICAgICAg ICAgICAgIHx8IGZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgIHx8 IGZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIKQorICAgICAgICAgICAgICAgIGN1 cnNvcl90eXBlID0gTk9fQ1VSU09SOworICAgICAgICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJp ZCAodywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dp ZHRoLCBiYWNrZ3JvdW5kLCBmbGF2b3IpOworICAgICAgICAgICAgfQorICAgIH0KKyAgaWYgKGRl bGV0ZV9jYWNoZSkKKyAgICB3c2V0X2Nyb3NzaGFpcnNfY2FjaGUgKHcsIFFuaWwpOworICB3LT5t Yy5lcmFzZV9jcm9zc2hhaXJzID0gZmFsc2U7CisvKgorI2lmZGVmIEdMWVBIX0RFQlVHCisgIGVu ZCA9IGNsb2NrKCk7CisgIGNwdV90aW1lX3VzZWQgPSAoKGRvdWJsZSkgKGVuZCAtIHN0YXJ0KSkg LyBDTE9DS1NfUEVSX1NFQzsKKyAgZHRvYXN0ciAoYnVmX3RpbWUsIHNpemVvZiBidWZfdGltZSwg MCwgMCwgY3B1X3RpbWVfdXNlZCk7CisgIGRlYnVnX21ldGhvZF9hZGQgKHcsICJtY19lcmFzZV9j cm9zc2hhaXJzOiAgVElNRSAoJXMpIiwgYnVmX3RpbWUpOworI2VuZGlmCisqLworfQorCit2b2lk CittY19wb3J0YWwgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgY3Vyc29yX29uX3ApCit7CisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1VTFRJ UExFIENVUlNPUlMKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICBpZiAoIU1JTklfV0lORE9X X1AgKHcpCisgICAgICAmJiB3LT5tYy5lcmFzZV9nbHlwaF9jdXJzb3IKKyAgICAgICYmICFOSUxQ ICh3LT5tdWx0aXBsZV9jdXJzb3JzX2NhY2hlKQorICAgICAgJiYgRVEgKHctPmNvbnRlbnRzLCBY Q0FSIChGbnRoIChtYWtlX251bWJlciAoMiksIHctPm11bHRpcGxlX2N1cnNvcnNfY2FjaGUpKSkp CisgICAgbWNfY2FsYyAodywgMSk7CisgIGlmICh3ID09IFhXSU5ET1cgKHNlbGVjdGVkX3dpbmRv dykKKyAgICAgICYmIFdJTkRPV19WQUxJRF9QIChzZWxlY3RlZF93aW5kb3cpCisgICAgICAmJiAh TUlOSV9XSU5ET1dfUCAodykKKyAgICAgICYmIHctPm1jLmRyYXdfZ2x5cGhfY3Vyc29yCisgICAg ICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19nbHlwaF9saXN0KSkp CisgICAgLyogRHJhdyBmYWtlIGN1cnNvcnMgKi8KKyAgICBtY19jYWxjICh3LCAwKTsKKyAgICAv KiBGaXJzdCBhdHRlbXB0IGF0IGRlYWxpbmcgd2l0aCBhIGByZWRpc3BsYXlfcHJlc2VydmVfZWNo b19hcmVhJyBzaXR1YXRpb24uICovCisgICAgZWxzZSBpZiAoIU1JTklfV0lORE9XX1AgKHcpCisg ICAgICAgICAgICAgJiYgIXctPm1jLmRyYXdfZ2x5cGhfY3Vyc29yCisgICAgICAgICAgICAgJiYg IU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfZ2x5cGhfbGlzdCkpCisgICAg ICAgICAgICAgJiYgIU5JTFAgKHctPm11bHRpcGxlX2N1cnNvcnNfY2FjaGUpCisgICAgICAgICAg ICAgJiYgRVEgKHctPmNvbnRlbnRzLCBYQ0FSIChGbnRoIChtYWtlX251bWJlciAoMiksIHctPm11 bHRpcGxlX2N1cnNvcnNfY2FjaGUpKSkpCisgICAgICB7CisgICAgICAgIC8qIFJlbW92ZSBmYWtl IGN1cnNvcnMuICovCisgICAgICAgIG1jX2NhbGMgKHcsIDEpOworICAgICAgICAvKiBEcmF3IGZh a2UgY3Vyc29ycyAqLworICAgICAgICBtY19jYWxjICh3LCAwKTsKKyAgICAgIH0KKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ1JPU1NIQUlS UworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisgIC8qIFJlbW92ZSBjcm9zc2hhaXJzIGFuZCBk ZWxldGUgdGhlIGNhY2hlLCBidXQgT05MWSBpZiB3ZSBwbGFuIG9uIHJlZHJhd2luZyB0aGVtLgor ICBJbiBhIHRpbWVyIHNpdHVhdGl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AgICAmJiAoIU5JTFAgKEJWQVIgKFhC VUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgLyogQSByYXJlIGNp cmN1bXN0YW5jZSB3aGVyZSBjcm9zc2hhaXJzIG1vZGUgaXMgbm9uLW5pbCwgYnV0IHRoZQorICAg ICAgICAgIHVzZXIgaGFzIHVud2l0dGluZ2x5IHNldCBib3RoIGBjcm9zc2hhaXJzLWhvcml6b250 YWwtcnVsZXInIHRvIG5pbCBhbmQgYWxzbworICAgICAgICAgIHNldCBgY3Jvc3NoYWlycy12ZXJ0 aWNhbC1ydWxlcicgdG8gbmlsIC0tIGkuZS4sIHRoZXJlIGlzIG5vdGhpbmcgdG8gZG8uICovCisg ICAgICAgICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFp cnNfaG9yaXpvbnRhbF9ydWxlcikpCisgICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVG RkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnNfdmVydGljYWxfcnVsZXIpKSkpCisgICAgICAm JiB3LT5tYy5kcmF3X2Nyb3NzaGFpcnMpCisgICAgLyogRHJhdyBjcm9zc2hhaXJzLiAqLworICAg IG1jX2RyYXdfY3Jvc3NoYWlycyAodyk7CisgICAgLyogQSBzaXR1YXRpb24gdGhhdCBvY2N1cnMg d2l0aCBgcmVkaXNwbGF5X3ByZXNlcnZlX2VjaG9fYXJlYScuICovCisgICAgZWxzZSBpZiAoIU1J TklfV0lORE9XX1AgKHcpCisgICAgICAgICAgICAgJiYgIXctPm1jLmRyYXdfY3Jvc3NoYWlycwor ICAgICAgICAgICAgICYmICFOSUxQICh3LT5jcm9zc2hhaXJzX2NhY2hlKQorICAgICAgICAgICAg ICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAg ICAgICAgICAgICYmIHcgPT0gWFdJTkRPVyAoWENBUiAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB3 LT5jcm9zc2hhaXJzX2NhY2hlKSkpCisgICAgICAgICAgICAgJiYgRVEgKHctPmNvbnRlbnRzLCBY Q0FSIChGbnRoIChtYWtlX251bWJlciAoMiksIHctPmNyb3NzaGFpcnNfY2FjaGUpKSkpCisgICAg ICB7CisgICAgICAgIC8qIFJlbW92ZSBjcm9zc2hhaXJzLCBidXQgZG8gTk9UIGRlbGV0ZSB0aGUg Y2FjaGUuICovCisgICAgICAgIG1jX2VyYXNlX2Nyb3NzaGFpcnMgKHcsIGZhbHNlKTsKKyAgICAg ICAgLyogUmVkcmF3IHRoZSBjcm9zc2hhaXJzIHVzaW5nIHRoZSBjYWNoZS4gKi8KKyAgICAgICAg bWNfcmVkcmF3X2Nyb3NzaGFpcnMgKHcpOworICAgICAgfQorICAgICAgLyogQ0FUQ0hBTEw6ICBE UkFXIFRIRSBSRUFMIENVUlNPUiAobWF5YmUpISAqLworICAgICAgZWxzZSBpZiAoY3Vyc29yX29u X3ApCisgICAgICAgIGRpc3BsYXlfYW5kX3NldF9jdXJzb3IgKHcsIHRydWUsIHctPm91dHB1dF9j dXJzb3IuaHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+ b3V0cHV0X2N1cnNvci52cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICB3LT5vdXRwdXRfY3Vyc29yLngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHctPm91dHB1dF9jdXJzb3IueSk7Cit9CisKK3ZvaWQKK21jX3JlY29yZF93aW5k b3dfYm91bmRzIChzdHJ1Y3Qgd2luZG93ICp3KQoreworICAvKiBSZWNvcmQgcHJpb3IgdmFsdWVz IGZvciBjdXJzb3IgWCwgd2luZG93LXN0YXJ0IGFuZCB3aW5kb3ctZW5kLgorICBUaGUgZ29hbCBo ZXJlIGlzIHRvIGZh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ovCisgIGJvb2wgcmVt b3ZlX2N1cnNvcnMgPSBmYWxzZTsKKyAgYm9vbCByZW1vdmVfY3Jvc3NoYWlycyA9IGZhbHNlOwor ICBpZiAoIXctPnBzZXVkb193aW5kb3dfcAorICAgICAgJiYgdyA9PSBYV0lORE9XIChzZWxlY3Rl ZF93aW5kb3cpCisgICAgICAmJiAhTUlOSV9XSU5ET1dfUCAodykKKyAgICAgICYmICFOSUxQICh3 LT5tdWx0aXBsZV9jdXJzb3JzX2NhY2hlKQorICAgICAgJiYgRVEgKHctPmNvbnRlbnRzLCBYQ0FS IChGbnRoIChtYWtlX251bWJlciAoMiksIHctPm11bHRpcGxlX2N1cnNvcnNfY2FjaGUpKSkpCisg ICAgcmVtb3ZlX2N1cnNvcnMgPSB0cnVlOworICBpZiAoIXctPnBzZXVkb193aW5kb3dfcAorICAg ICAgLyogVGhlIGNyb3NzaGFpcnMgaW50ZXJmZXJlIHdpdGggdGhlIGJyb3dzZS1raWxsLXJpbmcg bGlicmFyeS4gKi8KKyAgICAgIC8qICYmIHcgPT0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93KSAq LworICAgICAgJiYgIU1JTklfV0lORE9XX1AgKHcpCisgICAgICAmJiAhTklMUCAody0+Y3Jvc3No YWlyc19jYWNoZSkKKyAgICAgICYmIHcgPT0gWFdJTkRPVyAoWENBUiAoRm50aCAobWFrZV9udW1i ZXIgKDEpLCB3LT5jcm9zc2hhaXJzX2NhY2hlKSkpCisgICAgICAmJiBFUSAody0+Y29udGVudHMs IFhDQVIgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgdy0+Y3Jvc3NoYWlyc19jYWNoZSkpKSkKKyAg ICByZW1vdmVfY3Jvc3NoYWlycyA9IHRydWU7CisgIGlmIChyZW1vdmVfY3Vyc29ycworICAgICAg fHwgcmVtb3ZlX2Nyb3NzaGFpcnMpCisgICAgeworICAgICAgc3RydWN0IGZyYW1lICpmID0gWEZS QU1FICh3LT5mcmFtZSk7CisgICAgICB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IChiLCBRbmlsKTsKKyAgcmV0dXJuIFFuaWw7Cit9CisK Ky8qICAoZnVuZGFtZW50YWwtbW9kZSkKKyAgICAoc2V0cSBkaXNwbGF5LWxpbmUtbnVtYmVycyB0 KQorICAgIChzZXRxIGJ1ZmZlci1kaXNwbGF5LXRhYmxlIChtYWtlLWRpc3BsYXktdGFibGUpKQor ICAgIChhc2V0IGJ1ZmZlci1kaXNwbGF5LXRhYmxlCisgICAgICAgICAgP1x0CisgICAgICAgICAg KHZlY3RvciAobWFrZS1nbHlwaC1jb2RlID9cdTAwQkIgJ2ZvbnQtbG9jay13YXJuaW5nLWZhY2Up CisgICAgICAgICAgICAgICAgICAobWFrZS1nbHlwaC1jb2RlID9cdCAnaGlnaGxpZ2h0KSkpCisg ICAgKGFzZXQgYnVmZmVyLWRpc3BsYXktdGFibGUKKyAgICAgICAgICA/XG4KKyAgICAgICAgICAo dmVjdG9yIChtYWtlLWdseXBoLWNvZGUgP1x1MDBCNiAnZm9udC1sb2NrLWNvbW1lbnQtZmFjZSkK KyAgICAgICAgICAgICAgICAgID9cbikpCisgICAgKHNldHEgdGFiLXdpZHRoIDgpCisgICAgKHNl dHEtbG9jYWwgYXV0by1oc2Nyb2xsLW1vZGUgJ2N1cnJlbnQtbGluZSkgKi8KKworREVGVU4gKCJk ZWJ1Z2dpbmciLCBGZGVidWdnaW5nLCBTZGVidWdnaW5nLCAwLCAwLCAwLAorICAgICAgIGRvYzog LyogVGhpcyBmdW5jdGlvbiB1c2VkIGZvciBkZWJ1Z2dpbmcuICovKQorICAodm9pZCkKK3sKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgIFBSRUxJTUlOQVJZ IFNUVUZGCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAgc3RydWN0IHdpbmRvdyAqdyA9IGRl Y29kZV9saXZlX3dpbmRvdyAoc2VsZWN0ZWRfd2luZG93KTsKKyAgc3RydWN0IGZyYW1lICpmID0g WEZSQU1FICh3LT5mcmFtZSk7CisgIHN0cnVjdCBpdCBpdDsKKyAgdm9pZCAqaXRkYXRhID0gYmlk aV9zaGVsdmVfY2FjaGUgKCk7CisgIGVudW0gbW92ZV9pdF9yZXN1bHQgcmMgPSBNT1ZFX1hfUkVB Q0hFRDsKKyAgc3RydWN0IHRleHRfcG9zIHN0YXJ0X3RleHRfcG9zaXRpb247CisgIGludCBjb3Vu dCA9IDA7CisgIGludCBuZXdfeCA9IDA7CisgIGludCByZWxhdGl2ZV94ID0gMDsKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgIFNUQVJUIERJU1BMQVkgLS0g dy0+c3RhcnQKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICAvKiBCZWdpbiB0aGUgam91cm5l eSBhdCB3LT5zdGFydC4gKi8KKyAgU0VUX1RFWFRfUE9TX0ZST01fTUFSS0VSIChzdGFydF90ZXh0 X3Bvc2l0aW9uLCB3LT5zdGFydCk7CisgIHN0YXJ0X2Rpc3BsYXkgKCZpdCwgdywgc3RhcnRfdGV4 dF9wb3NpdGlvbik7CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICBH TyBUTyBUSEUgQkVHSU5OSU5HIE9GIFRIRSBDVVJSRU5UIExJTkUuCisqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKyAgLyogUGxhY2UgdGhlIElUIG9uIHRoZSBjdXJyZW50IGxpbmUgY29udGFpbmlu ZyBQVC4gKi8KKyAgaW50IHZvZmZzZXQgPSAoV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodykg PiAwCisgICAgICAgICAgICAgICAgICYmIHctPm91dHB1dF9jdXJzb3IudnBvcyA+IDApCisgICAg ICAgICAgICAgICAgICA/IHctPm91dHB1dF9jdXJzb3IudnBvcyAtIDEKKyAgICAgICAgICAgICAg ICAgIDogdy0+b3V0cHV0X2N1cnNvci52cG9zOworICBpZiAodm9mZnNldCA+IDApCisgICAgbW92 ZV9pdF9ieV9saW5lcyAoJml0LCB2b2Zmc2V0KTsKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgor ICAgICAgICAgICAgIE1PVkUgSVQgT1ZFUiBFQUNIIENIQVJBQ1RFUiBPTiBUSEUgQ1VSUkVOVCBM SU5FLgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisgIHdoaWxlICh0cnVlKQorICAgIHsKKyAg ICAgIGNvdW50ICs9IDE7CisgICAgICBpZiAobmV3X3ggPiAwKQorICAgICAgICByZWxhdGl2ZV94 ID0gbmV3X3ggLSBpdC5maXJzdF92aXNpYmxlX3g7CisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioK KyAgICAgICAgICAgICAgICAgICAgICAgRFVNUCBSRUxFVkFOVCBHTFlQSCBJTkZPUk1BVElPTgor KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisgIGludCB3X2hzY3JvbGwgPSBpdC53LT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T5oc2Nyb2xsICglZClcblwKKyAgICBoc2NsICglcylc blwKKyAgICB3LT5taW5faHNjcm9sbCAoJWQpXG5cCisgICAgaXQuaHBvcyAoJWQpXG5cCisgICAg aXQudnBvcyAoJWQpXG5cCisgICAgaXQuY3VycmVudF94ICglZClcblwKKyAgICBuZXdfeCAoJWQp XG5cCisgICAgZm9udC0+c3BhY2Vfd2lkdGggKCVkKVxuXAorICAgIGl0LmxudW1fcGl4ZWxfd2lk dGggKCVkKVxuXAorICAgIGl0LmxudW1fd2lkdGggKCVkKVxuXAorICAgIGl0LmZpcnN0X3Zpc2li bGVfeCAoJWQpXG5cCisgICAgcmVsYXRpdmVfeCAoJWQpXG5cCisgICAgaXQuZmFjZV9pZCAoJWQp XG5cCisgICAgZm9yZWdyb3VuZF9mYWNlICglcylcblwKKyAgICBiYWNrZ3JvdW5kX2ZhY2UgKCVz KVxuXAorICAgIHJjICglcylcbiIsCisgICAgICBjb3VudCwKKyAgICAgIChpdC5jID09IDAKKyAg ICAgICAgPyAiTk9USElORyIKKyAgICAgICAgOiBpdC5jID09IDE4NworICAgICAgICAgID8gIlRB QiBDSEFSQUNURVIiCisgICAgICAgIDogaXQuYyA9PSAnXHQnCisgICAgICAgICAgPyAiVEFCIFNU UkVUQ0giCisgICAgICAgIDogIlRFWFQiKSwKKyAgICAgIChyZWxhdGl2ZV94ID09IGl0LmxudW1f cGl4ZWxfd2lkdGgKKyAgICAgICAgPyAiIC0tIFRIRSBGVU4gU1RBUlRTIEhFUkUiCisgICAgICAg IDogIiIpLAorICAgICAgaXQuYywKKyAgICAgIEZFVENIX0JZVEUgKElUX0JZVEVQT1MgKGl0KSks CisgICAgICAoIU5JTFAgKEZjaGFyX3RvX3N0cmluZyAobWFrZV9udW1iZXIgKGl0LmMpKSkKKyAg ICAgICAgPyBTU0RBVEEgKEZjaGFyX3RvX3N0cmluZyAobWFrZV9udW1iZXIgKGl0LmMpKSkKKyAg ICAgICAgOiAiTklMUCAtLSBpdC5jIGFz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hY2tncm91bmRfZmFjZSkKKyAgICAgICAgOiAiTklMUCBiYWNrZ3JvdW5kX2ZhY2UiKSwKKyAg ICAgIChyYyA9PSBNT1ZFX1VOREVGSU5FRAorICAgICAgICA/ICJNT1ZFX1VOREVGSU5FRCIKKyAg ICAgICAgOiByYyA9PSBNT1ZFX1BPU19NQVRDSF9PUl9aVgorICAgICAgICAgID8gIk1PVkVfUE9T X01BVENIX09SX1pWIgorICAgICAgICA6IHJjID09IE1PVkVfWF9SRUFDSEVECisgICAgICAgICAg PyAiTU9WRV9YX1JFQUNIRUQiCisgICAgICAgIDogcmMgPT0gTU9WRV9MSU5FX0NPTlRJTlVFRAor ICAgICAgICAgID8gIk1PVkVfTElORV9DT05USU5VRUQiCisgICAgICAgIDogcmMgPT0gTU9WRV9M SU5FX1RSVU5DQVRFRAorICAgICAgICAgID8gIk1PVkVfTElORV9UUlVOQ0FURUQiCisgICAgICAg IDogcmMgPT0gTU9WRV9ORVdMSU5FX09SX0NSCisgICAgICAgICAgPyAiTU9WRV9ORVdMSU5FX09S X0NSIgorICAgICAgICA6ICJPT1BTIikpOworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAg ICAgICAgICAgICAgICAgICAgIE1PVkUgSVQ6ICBJTkNSRU1FTlQgPT0gRk9OVC5TUEFDRV9XSURU SAorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisgICAgICBpZiAoKEZFVENIX0JZVEUgKElUX0JZ VEVQT1MgKGl0KSkgPT0gJ1xuJworICAgICAgICAgICAmJiBpdC5jICE9IDApCisgICAgICAgICAg LyogfHwgSVRFUkFUT1JfQVRfRU5EX09GX0xJTkVfUCAoJml0KSAqLworICAgICAgICAgIHx8IHJj ID09IE1PVkVfUE9TX01BVENIX09SX1pWKQorICAgICAgICBicmVhazsKKyAgICAgIG5ld194ICs9 IGZvbnRfc3BhY2Vfd2lkdGg7CisgICAgICByYyA9IG1vdmVfaXRfaW5fZGlzcGxheV9saW5lX3Rv ICgmaXQsIFpWLCBuZXdfeCwgTU9WRV9UT19QT1MgfCBNT1ZFX1RPX1gpOworICAgICAgaWYgKHJj ID09IE1PVkVfTElORV9DT05USU5VRUQpCisgICAgICAgIGJyZWFrOworICAgICAgaWYgKGl0LmN1 cnJlbnRfeCAtIGl0LmZpcnN0X3Zpc2libGVfeCArIGZvbnRfc3BhY2Vfd2lkdGggPj0KKyAgICAg ICAgICB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpKQorICAgICAgICBicmVhazsKKyAg ICB9CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICBS RURJU1BMQVkgQU5EIERVTVBfR0xQWUhfUk9XCisqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAg cmVkaXNwbGF5X2ludGVybmFsICgpOworICBpbnQgdnBvcyA9IChXSU5ET1dfSEVBREVSX0xJTkVf SEVJR0hUIChpdC53KSA+IDApCisgICAgICAgICAgICAgPyBpdC52cG9zICsgMQorICAgICAgICAg ICAgIDogaXQudnBvczsKKyAgc3RydWN0IGdseXBoX3JvdyAqZ2x5cGhfcm93ID0gTUFUUklYX1JP VyAody0+Y3VycmVudF9tYXRyaXgsIHZwb3MpOworICBmcHJpbnRmIChzdGRlcnIsICJcbiIpOwor ICBkdW1wX2dseXBoX3JvdyAoZ2x5cGhfcm93LCB2cG9zLCAyKTsKKyAgYmlkaV91bnNoZWx2ZV9j YWNoZSAoaXRkYXRhLCBmYWxzZSk7CisgIHJldHVybiBRbmlsOworfQorCisvKiBlbmQgTVVMVElQ TEUgQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogDAogLyoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqCiAJCSAgICAgIFdpbmRvdyBkaXNwbGF5IGRpbWVuc2lvbnMKQEAgLTEzMzY2LDkgKzE2 MDMzLDIzIEBAIGhzY3JvbGxfd2luZG93X3RyZWUgKExpc3BfT2JqZWN0IHdpbmRvdykKIAkgICAg ICBlbHNlCiAJCXB0ID0gY2xpcF90b19ib3VuZHMgKEJFR1YsIG1hcmtlcl9wb3NpdGlvbiAody0+ cG9pbnRtKSwgWlYpOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUg Q1VSU09SUyAqLworCisgIHN0cnVjdCBkaXNwbGF5X3BvcyAqcG9zID0gJmN1cnNvcl9yb3ctPnN0 YXJ0OworICBwdHJkaWZmX3QgY2hhcnBvcyA9IENIQVJQT1MgKHBvcy0+cG9zKTsKKyAgYm9vbCBi YXJmX2NyYXNoID0gKGNoYXJwb3MgPCAwIHx8IChjaGFycG9zID49IEJVRl9CRUcgKGN1cnJlbnRf YnVmZmVyKSAmJiBjaGFycG9zIDw9IFpWKSkgPyBmYWxzZSA6IHRydWU7CisgIGlmIChiYXJmX2Ny YXNoKQorICAgIHJldHVybiBoc2Nyb2xsZWRfcDsKKyAgICBlbHNlCiAJICAgICAgLyogTW92ZSBp dGVyYXRvciB0byBwdCBzdGFydGluZyBhdCBjdXJzb3Jfcm93LT5zdGFydCBpbgogCQkgYSBsaW5l IHdpdGggaW5maW5pdGUgd2lkdGguICAqLwogCSAgICAgIGluaXRfdG9fcm93X3N0YXJ0ICgmaXQs IHcsIGN1cnNvcl9y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aWYgKHNldF9y ZWRpc3BsYXkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgIGlmIChidWYpCi0JICAgICAg ICBic2V0X3JlZGlzcGxheSAoYnVmKTsKLSAgICAgICAgICAgICAgY2hhbmdlZCA9IHRydWU7Ci0g ICAgICAgICAgICB9CisJICBpZiAoc2V0X3JlZGlzcGxheQorICAgICAgICAvKiBUbyBhdm9pZCBj cmFzaGluZyBkdWUgdG86ICM8bWFya2VyIGluIG5vIGJ1ZmZlcj4gKi8KKyAgICAgICAgJiYgYnVm CisgICAgICAgICYmIE1BUktFUlAgKHZhbCkKKyAgICAgICAgJiYgQlVGRkVSX0xJVkVfUCAoYnVm KSkKKyAgICAgIC8qIGJzZXRfcmVkaXNwbGF5IChidWYpOyAqLworICAgICAgLyogRXZlbiBpZiB3 ZSBkb24ndCBzZXQgd2luZG93c19vcl9idWZmZXJzX2NoYW5nZWQsIGRvIHNldCBgcmVkaXNwbGF5 JworICAgICAgc28gdGhhdCBpZiB3ZSBsYXRlciBzZXQgd2luZG93c19vcl9idWZmZXJzX2NoYW5n ZWQsIHRoaXMgYnVmZmVyIHdpbGwKKyAgICAgIG5vdCBiZSBvbWl0dGVkLiAgKi8KKyAgICAgIGJ1 Zi0+dGV4dC0+cmVkaXNwbGF5ID0gdHJ1ZTsKIAkgIGVsc2UKIAkgICAgcmV0dXJuIHRydWU7CiAJ fQorCiAgICAgfQogICByZXR1cm4gY2hhbmdlZDsKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogfQogCiAvKiBNYXJrIG92ZXJsYXkgYXJyb3dzIHRvIGJlIHVwZGF0ZWQgb24gbmV4dCBy ZWRpc3BsYXkuICAqLwpAQCAtMTQyODEsNiArMTY5NzgsMjEgQEAgcmVkaXNwbGF5X2ludGVybmFs ICh2b2lkKQogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQogCSAgICAgIHVwZGF0ZV93aW5kb3df ZnJpbmdlcyAodywgZmFsc2UpOwogI2VuZGlmCisKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKy8qIE5PVEU6ICBBbiBpZGxlLXRpbWVyIGZ1bmN0 aW9uIG1heSBub3QgbmVjZXNzYXJpbHkgdHJpZ2dlciBgcmVkaXNwbGF5X3dpbmRvdycuCitgb3B0 aW1pemF0aW9uIDFgICh3aGljaCBpbmNsdWRlcyBsZWZ0L3JpZ2h0IGN1cnNvciBtb3ZlbWVudCBv biB0aGUgZmlyc3Qgc2NyZWVuCitsaW5lKSwgYW5kIGBvcHRpbWl6YXRpb24gM2AgKHdoaWNoIGlu Y2x1ZGVzIGxlZnQvcmlnaHQgY3Vyc29yIG1vdmVtZW50IG9uIHNjcmVlbgorbGluZXMgc3Vic2Vx dWVudCB0byB0aGUgZmlyc3Qgc2NyZWVuIGxpbmUpLCBieXBhc3MgYHJlZGlzcGxheV93aW5kb3cn LiAqLworCisgICAgICBtY19yZW1vdmVfZXZlcnl0aGluZyAodyk7CisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKIAkgICAgICBnb3RvIHVwZGF0ZTsKIAkgICAgfQogCSAgZWxzZQpAQCAt MTQzMDMsNiArMTcwMTUsMTYgQEAgcmVkaXNwbGF5X2ludGVybmFsICh2b2lkKQogCQkgICYmICh3 ID0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93KSkgIT0gc3cpCiAJCWdvdG8gcmV0cnk7CiAKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgICAg ICBpZiAobWNfd2l0aG91dF91cGRhdGVfZnJhbWUgKHcpKQorICAgICAgICAgZ290byBlbmRfb2Zf cmVkaXNwbGF5OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAgICAgLyogV2Ug dXNlZCB0byBhbHdheXMgZ290byBlbmRfb2ZfcmVkaXNwbGF5IGhlcmUsIGJ1dCB0aGlzCiAJCSBp c24ndCBlbm91Z2ggaWYgd2UgaGF2ZSBhIGJsaW5raW5nIGN1cnNvci4gICovCiAJICAgICAgaWYg KHctPmN1cnNvcl9vZmZfcCA9PSB3LT5sYXN0X2N1cnNvcl9vZmZfcCkKQEAgLTE0MzQ0LDYgKzE3 MDY2LDIxIEBAIHJlZGlzcGxheV9pbnRlcm5hbCAodm9pZCkKIAkJICAqdy0+ZGVzaXJlZF9tYXRy aXgtPm1ldGhvZCA9IDA7CiAJCSAgZGVidWdfbWV0aG9kX2FkZCAodywgIm9wdGltaXphdGlvbiAz Iik7CiAjZW5kaWYKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENV UlNPUlMgKi8KKworLyogTk9URTogIEFuIGlkbGUtdGltZXIgZnVuY3Rpb24gbWF5IG5vdCBuZWNl c3NhcmlseSB0cmlnZ2VyIGByZWRpc3BsYXlfd2luZG93Jy4KK2BvcHRpbWl6YXRpb24gMWAgKHdo aWNoIGluY2x1ZGVzIGxlZnQvcmlnaHQgY3Vyc29yIG1vdmVtZW50IG9uIHRoZSBmaXJzdCBzY3Jl ZW4KK2xpbmUpLCBhbmQgYG9wdGltaXphdGlvbiAzYCAod2hpY2ggaW5jbHVkZXMgbGVmdC9yaWdo dCBjdXJzb3IgbW92ZW1lbnQgb24gc2NyZWVuCitsaW5lcyBzdWJzZXF1ZW50IHRvIHRoZSBmaXJz dCBzY3JlZW4gbGluZSksIGJ5cGFzcyBgcmVkaXNwbGF5X3dpbmRvdycuICovCisKKyAgICAgIG1j X3JlbW92ZV9ldmVyeXRoaW5nICh3KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog CQkgIGdvdG8gdXBkYXRlOwogCQl9CiAJICAgICAgZWxzZQpAQCAtMTQ0NzcsNiArMTcyMTQsMjAg QEAgcmVkaXNwbGF5X2ludGVybmFsICh2b2lkKQogCQkgICAgdW5yZXF1ZXN0X3NpZ2lvICgpOwog CQkgIFNUT1BfUE9MTElORzsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJ UExFIENVUlNPUlMgKi8KKworICAgIC8qIE9uIEVtYWNzIGZvciBXaW5kb3dzLCBjcm9zc2hhaXJz IHdpbGwgbm90IGRyYXcgYXQgdGhlIGJlZ2lubmluZyBvZiB0aGUgYnVmZmVyCisgICAgd2l0aG91 dCB0aGlzIGNvbmRpdGlvbiB3aGVuIHRoZSBpZGxlLXRpbWVyIHN3aXRjaGVzIGFyZSB0b2dnbGVk LiAgVGhpcyBtYXkgaGF2ZQorICAgIGJlZW4gZHVlIHRvIHRoZSBwYXJlbnRoZXNlcyBvdmVybGF5 cyB0aGF0IHdlcmUgcmVtb3ZlZCBhbmQgZGlkIG5vdCBuZWVkIHRvIGJlCisgICAgcmVkcmF3biBz aW5jZSBvcGVuaW5nIHBhcmVudGhlc2VzIGF0IHRoZSBiZWdpbm5pbmcgb2YgdGhlIGJ1ZmZlciBh cmUgbm90IGhpZ2hsaWdodGVkLiAqLworICAgIGlmICh3LT5tYy5kcmF3X2Nyb3NzaGFpcnMpCisg ICAgICB3LT5tdXN0X2Jl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ZHMgKHcpOwor CisgIG1jX3JlbW92ZV9ldmVyeXRoaW5nICh3KTsKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogICBzZXRfYnVmZmVyX2ludGVybmFsXzEgKG9sZCk7CiAgIC8qIEF2b2lkIGFuIGFib3J0 IGluIFRFTVBfU0VUX1BUX0JPVEggaWYgdGhlIGJ1ZmZlciBoYXMgYmVjb21lCiAgICAgIHNob3J0 ZXIuICBUaGlzIGNhbiBiZSBjYXVzZWQgYnkgbG9nIHRydW5jYXRpb24gaW4gKk1lc3NhZ2VzKi4g ICovCkBAIC0yMTA0MSw2ICsyMzg1OCwzMCBAQCBkaXNwbGF5X2NvdW50X2xpbmVzX3Zpc3VhbGx5 IChzdHJ1Y3QgaXQgKml0KQogc3RhdGljIHZvaWQKIG1heWJlX3Byb2R1Y2VfbGluZV9udW1iZXIg KHN0cnVjdCBpdCAqaXQpCiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRSBDVVJTT1JTICovCisKKyAgYm9vbCBiYXJmX2NyYXNoID0gKGl0LT5nbHlwaF9yb3cgPT0g TlVMTAorICAgICAgICAgICAgICAgICAgICAgfHwgaXQtPmdseXBoX3Jvdy0+dXNlZFtURVhUX0FS RUFdID09IDApCisgICAgICAgICAgICAgICAgICAgID8gZmFsc2UKKyAgICAgICAgICAgICAgICAg ICAgOiB0cnVlOworICBpZiAoYmFyZl9jcmFzaCkKKyAgIHJldHVybjsKKworICAvKiBUaGlzIGNv ZGUgd2lsbCBiZSByZXBsYWNlZCB3aXRoOgorICBjb21taXQgZmUwNmZjYzU5NTU3MzFiMTM3M2Fh NzRhNTg2ZGEwNGY1YzJjMTFmNworICBBdXRob3I6IEVsaSBaYXJldHNraWkgPGVsaXpAZ251Lm9y Zz4KKyAgRGF0ZTogICBUdWUgQXVnIDI4IDE0OjExOjEyIDIwMTggKzAzMDAgKi8KKyAgaW50IHRl eHRfYXJlYV93aWR0aCA9IHdpbmRvd19ib3hfd2lkdGggKGl0LT53LCBURVhUX0FSRUEpOworICBp ZiAoIU5JTFAgKFZkaXNwbGF5X2xpbmVfbnVtYmVycykKKyAgICAgICYmIHRleHRfYXJlYV93aWR0 aCA8IGl0LT5sbnVtX3BpeGVsX3dpZHRoKQorICAgIHJldHVybjsKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogICBwdHJkaWZmX3QgbGFzdF9saW5lID0gaXQtPmxudW07CiAgIHB0cmRp ZmZfdCBzdGFydF9mcm9tLCBieXRlcG9zOwogICBwdHJkaWZmX3QgdGhpc19saW5lOwpAQCAtMjk2 OTIsOSArMzI1NTQsMjQgQEAgZGlzcGxheV9hbmRfc2V0X2N1cnNvciAoc3RydWN0IHdpbmRvdyAq dywgYm9vbCBvbiwKICAgICAgIHctPnBoeXNfY3Vyc29yLnZwb3MgPSB2cG9zOwogICAgIH0KIAor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworICB3 LT5tYy5oID0gLTE7CisgIHctPm1jLmZ4ID0gLTE7CisgIHctPm1jLmZ5ID0gLTE7CisgIHctPm1j LmdseXBoX2ZsYXZvciA9IE5PX0ZMQVZPUjsKKyAgdy0+bWMucmVkID0gLTEuMDsKKyAgdy0+bWMu Z3JlZW4gPSAtMS4wOworICB3LT5tYy5ibHVlID0gLTEuMDsKICAgRlJBTUVfUklGIChmKS0+ZHJh d193aW5kb3dfY3Vyc29yICh3LCBnbHlwaF9yb3csIHgsIHksCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgbmV3X2N1cnNvcl90eXBlLCBuZXdfY3Vyc29yX3dpZHRoLAogICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uLCBhY3RpdmVfY3Vyc29yKTsKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAKQEAgLTI5NzI2LDEwICszMjYwMywz MCBAQCB1cGRhdGVfd2luZG93X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBvbikKICAg ICAgIGlmIChyb3ctPnJldmVyc2VkX3AgJiYgaHBvcyA+PSByb3ctPnVzZWRbVEVYVF9BUkVBXSkK IAlocG9zID0gcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxOwogCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgICAgICAvKiBNb3ZpbmcgdGhlIG1v dXNlIHRyaWdnZXJzIGB1cGRhdGVfd2luZG93X2N1cnNvcicgd2hpY2ggY2FsbHMKKyAgICAgIGBk aXNwbGF5X2FuZF9zZXRfY3Vyc29yJyB0aGF0IHdvdWxkIG90aGVyd2lzZSByZW1vdmUgYSBwb3J0 aW9uIG9mIHRoZQorICAgICAgaG9yaXpvbnRhbCBydWxlciBmcm9tIHBvaW50IGF0IGVuZCBvZiB2 aXN1YWwgbGluZSB0byB3aW5kb3cgZWRnZS4gKi8KKyAgICAgIGJvb2wgY3Jvc3NoYWlyc19wID0g KCFNSU5JX1dJTkRPV19QICh3KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXctPm1j LmRyYXdfY3Jvc3NoYWlycworICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKHct PmNyb3NzaGFpcnNfY2FjaGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHcgPT0gWFdJTkRPVyAoWENBUiAoRm50aCAobWFrZV9udW1iZXIgKDEp LCB3LT5jcm9zc2hhaXJzX2NhY2hlKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBF USAody0+Y29udGVudHMsIFhDQVIgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgdy0+Y3Jvc3NoYWly c19jYWNoZSkpKSk7CisgICAgICBpZiAoIWNyb3NzaGFpcnNfcCkKKyAgICAgICAgewogICAgICAg YmxvY2tfaW5wdXQgKCk7CiAgICAgICBkaXNwbGF5X2FuZF9zZXRfY3Vyc29yICh3LCBvbiwgaHBv cywgdnBvcywKIAkJCSAgICAgIHctPnBoeXNfY3Vyc29yLngsIHctPnBoeXNfY3Vyc29yLnkpOwog ICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgfQorCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKworCiAgICAgfQogfQogCkBAIC0zMjQzNiw2ICszNTMzMywyMiBAQCB4X2ludGVyc2Vj dF9yZWN0YW5nbGVzIChYUmVjdGFuZ2xlICpyMSwgWFJlY3RhbmdsZSAqcjIsIFhSZWN0YW5nbGUg KnJlc3VsdCkKIHZvaWQKIHN5bXNfb2ZfeGRpc3AgKHZvaWQpCiB7CisKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgZGVmc3ViciAoJlNtY19h Y3RpdmF0ZV9jdXJzb3JzKTsKKworICBkZWZzdWJyICgmU21jX2FjdGl2YXRlX2Nyb3NzaGFpcnMp OworCisgIGRlZnN1YnIgKCZTbWNfc3RkZXJyKTsKKworICBkZWZzdWJyICgmU2RlYnVnZ2luZyk7 CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgVndpdGhfZWNob19hcmVhX3NhdmVf dmVjdG9yID0gUW5pbDsKICAgc3RhdGljcHJvICgmVndpdGhfZWNob19hcmVhX3NhdmVfdmVjdG9y KTsKIApkaWZmIC0tZ2l0IGEvc3JjL3h0ZXJtLmMgYi9zcmMveHRlcm0uYwppbmRleCBhZjI4ZGFi Li5kM2Y1ZTlhIDEwMDY0NAotLS0gYS9zcmMveHRlcm0uYworKysgYi9zcmMveHRlcm0uYwpAQCAt MTE1MSwxMCArMTE1MSwxNCBAQCB4X3VwZGF0ZV93aW5kb3dfZW5kIChzdHJ1Y3Qgd2luZG93ICp3 LCBib29sIGN1cnNvcl9vbl9wLAogICAgIHsKICAgICAgIGJsb2NrX2lucHV0ICgpOwogCi0gICAg ICBpZiAoY3Vyc29yX29uX3ApCi0JZGlzcGxheV9hbmRfc2V0X2N1cnNvciAodywgdHJ1ZSwKLQkJ CQl3LT5vdXRwdXRfY3Vyc29yLmhwb3MsIHctPm91dHB1dF9jdXJzb3IudnBvcywKLQkJCQl3LT5v dXRwdXRfY3Vyc29yLngsIHctPm91dHB1dF9jdXJzb3IueSk7CisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgICAgICBtY19wb3J0YWwgKHcsIGN1 cnNvcl9vbl9wKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKIAogICAgICAgaWYgKGRy YXdfd2luZG93X2ZyaW5nZXMgKHcsIHRydWUpKQogCXsKQEAgLTE1MzAsMTAgKzE1MzQsMjEgQEAg c3RhdGljIHZvaWQgeF9jaGVja19mb250IChzdHJ1Y3QgZnJhbWUgKiwgc3RydWN0IGZvbnQgKik7 CiBzdGF0aWMgdm9pZAogeF9zZXRfY3Vyc29yX2djIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzKQog ewotICBpZiAocy0+Zm9udCA9PSBGUkFNRV9GT05UIChzLT5mKQorCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgIHN0cnVjdCB3aW5kb3cgKncg PSBkZWNvZGVfbGl2ZV93aW5kb3cgKHNlbGVjdGVkX3dpbmRvdyk7CisgIGlmICgocy0+Zm9udCA9 PSBGUkFNRV9GT05UIChzLT5mKQogICAgICAgJiYgcy0+ZmFjZS0+YmFja2dyb3VuZCA9PSBGUkFN RV9CQUNLR1JPVU5EX1BJWEVMIChzLT5mKQogICAgICAgJiYgcy0+ZmFjZS0+Zm9yZWdyb3VuZCA9 PSBGUkFNRV9GT1JFR1JPVU5EX1BJWEVMIChzLT5mKQogICAgICAgJiYgIXMtPmNtcCkKKyAgICAg IHx8IHctPm1jLmN1cnNvcl9nY19kZWZhdWx0KQorCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiAgICAgcy0+Z2MgPSBzLT5mLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2M7CiAgIGVsc2UK ICAgICB7CkBAIC05MjUyLDYgKzkyNjcsMjYgQEAgeF9kcmF3X2hvbGxvd19jdXJzb3IgKHN0cnVj dCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdykKIAogICAvKiBDb21wdXRlIGZyYW1l LXJlbGF0aXZlIGNvb3JkaW5hdGVzIGZvciBwaHlzIGN1cnNvci4gICovCiAgIGdldF9waHlzX2N1 cnNvcl9nZW9tZXRyeSAodywgcm93LCBjdXJzb3JfZ2x5cGgsICZ4LCAmeSwgJmgpOworCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisvKiBMRUdF TkQ6CisKKy0gIHRvcCB5ID09IFdJTkRPV19UT19GUkFNRV9QSVhFTF9ZICh3LCByb3ctPnkpCisK Ky0gIGJvdHRvbSB5ID09IFdJTkRPV19UT19GUkFNRV9QSVhFTF9ZICh3LCByb3ctPnkpIC0gcm93 LT5oZWlnaHQKKworLSAgaCBvZiBIT0xMT1dfQk9YX0NVUlNPUiA9PSByb3ctPmhlaWdodAorICAg W1RoaXMgYXZvaWRzIGEgdmlzaWJsZSBnYXAgYWJvdmUvYmVsb3cuXSAqLworCisgIGlmICh3LT5t Yy5oID4gMCkKKyAgICBoID0gcm93LT5oZWlnaHQ7CisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKICAgd2QgPSB3LT5waHlzX2N1cnNvcl93aWR0aCAtIDE7CiAKICAgLyogVGhlIGZvcmVn cm91bmQgb2YgY3Vyc29yX2djIGlzIHR5cGljYWxseSB0aGUgc2FtZSBhcyB0aGUgbm9ybWFsCkBA IC05MzI4LDcgKzkzNjMsMTggQEAgeF9kcmF3X2Jhcl9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncs IHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgaW50IHdpZHRoLCBlbnVtIHRleHQKIAkgaW52aXNpYmxl LiAgVXNlIHRoZSBnbHlwaCdzIGZvcmVncm91bmQgY29sb3IgaW5zdGVhZCBpbiB0aGlzCiAJIGNh c2UsIG9uIHRoZSBhc3N1bXB0aW9uIHRoYXQgdGhlIGdseXBoJ3MgY29sb3JzIGFyZSBjaG9zZW4g c28KIAkgdGhhdCB0aGUgZ2x5cGggaXMgbGVnaWJsZS4gICovCi0gICAgICBpZiAoZmFjZS0+YmFj a2dyb3VuZCA9PSBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwpCisKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgICAgIGlmIChmYWNl LT5iYWNrZ3JvdW5kID09IGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbAorICAgICAgICAg ICYmICF3LT5tYy5jdXJzb3JfZ2NfaW52aXNpYmxlX29rYXkpCisKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogCXhnY3YuYmFja2dyb3VuZCA9IHhnY3YuZm9yZWdyb3VuZCA9IGZhY2Ut PmZvcmVncm91bmQ7CiAgICAgICBlbHNlCiAJeGdjdi5iYWNrZ3JvdW5kID0geGdjdi5mb3JlZ3Jv dW5kID0gZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsOwpAQCAtOTM1OSw2ICs5NDA1LDE3 IEBAIHhfZHJhd19iYXJfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93 ICpyb3csIGludCB3aWR0aCwgZW51bSB0ZXh0CiAJICBpZiAoKGN1cnNvcl9nbHlwaC0+cmVzb2x2 ZWRfbGV2ZWwgJiAxKSAhPSAwKQogCSAgICB4ICs9IGN1cnNvcl9nbHlwaC0+cGl4ZWxfd2lkdGgg LSB3aWR0aDsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNP UlMgKi8KKworICAgIC8qIEFsaWduIGFsbCBmYWtlIEJBUl9DVVJTT1Igb2YgdGhlIFZFUlRJQ0FM X1JVTEVSIHdpdGggYG9wb2ludF94Jy4gKi8KKyAgICBpZiAody0+bWMuZnggPiAwKQorICAgICAg eCA9IHctPm1jLmZ4OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICB4X2ZpbGxf cmVjdGFuZ2xlIChmLCBnYywgeCwKIAkJCSAgV0lORE9XX1RPX0ZSQU1FX1BJWEVMX1kgKHcsIHct PnBoeXNfY3Vyc29yLnkpLAogCQkJICB3aWR0aCwgcm93LT5oZWlnaHQpOwpAQCAtOTQzNSwzMSAr OTQ5MiwxMTYgQEAgeF9kcmF3X3dpbmRvd19jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVj dCBnbHlwaF9yb3cgKmdseXBoX3JvdywgaW50IHgsCiAJfQogICAgICAgZWxzZQogCXsKLQkgIHN3 aXRjaCAoY3Vyc29yX3R5cGUpCi0JICAgIHsKLQkgICAgY2FzZSBIT0xMT1dfQk9YX0NVUlNPUjoK LQkgICAgICB4X2RyYXdfaG9sbG93X2N1cnNvciAodywgZ2x5cGhfcm93KTsKLQkgICAgICBicmVh azsKIAotCSAgICBjYXNlIEZJTExFRF9CT1hfQ1VSU09SOgotCSAgICAgIGRyYXdfcGh5c19jdXJz b3JfZ2x5cGggKHcsIGdseXBoX3JvdywgRFJBV19DVVJTT1IpOwotCSAgICAgIGJyZWFrOwogCi0J ICAgIGNhc2UgQkFSX0NVUlNPUjoKLQkgICAgICB4X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cGhf cm93LCBjdXJzb3Jfd2lkd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3JlZW4gPSBp bnRfZ3JlZW47CisgIGNvbG9yLmJsdWUgPSBpbnRfYmx1ZTsKKyAgLyogYHhfYWxsb2NfbmVhcmVz dF9jb2xvcicgc2V0cyB0aGUgYGNvbG9yLnBpeGVsYC4gKi8KKyAgeF9hbGxvY19uZWFyZXN0X2Nv bG9yIChmLCBjbWFwLCAmY29sb3IpOworICBzd2l0Y2ggKGN1cnNvcl90eXBlKQorICB7CisgICAg Y2FzZSBIT0xMT1dfQk9YX0NVUlNPUjoKKyAgICB7CisgICAgICBpZiAody0+bWMucmVkID49IDAg JiYgdy0+bWMuYmx1ZSA+PSAwICYmIHctPm1jLmdyZWVuID49IDApCisgICAgICAgIHsKKyAgICAg ICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhl bCcuICAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IGNvbG9y LnBpeGVsOworICAgICAgICAgIHhfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBnbHlwaF9yb3cpOwor ICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNv cl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeF9kcmF3X2hvbGxv d19jdXJzb3IgKHcsIGdseXBoX3Jvdyk7CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBG SUxMRURfQk9YX0NVUlNPUjoKKyAgICB7CisgICAgICBpZiAody0+bWMucmVkID49IDAgJiYgdy0+ bWMuYmx1ZSA+PSAwICYmIHctPm1jLmdyZWVuID49IDApCisgICAgICAgIC8qIFRlbXBvcmFyaWx5 IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djJyBieSBib3Jyb3dpbmcgdGhlCisg ICAgICAgIGZ1bmN0aW9uYWxpdHkgb2YgYHhfbWFrZV9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ICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4 ZWwgPSBjb2xvci5waXhlbDsKKyAgICAgICAgICB3LT5tYy5jdXJzb3JfZ2NfaW52aXNpYmxlX29r YXkgPSB0cnVlOworICAgICAgICAgIHhfZHJhd19iYXJfY3Vyc29yICh3LCBnbHlwaF9yb3csIGN1 cnNvcl93aWR0aCwgQkFSX0NVUlNPUik7CisgICAgICAgICAgdy0+bWMuY3Vyc29yX2djX2ludmlz aWJsZV9va2F5ID0gZmFsc2U7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3Bp eGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAg ICAgICAgICB4X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEJB Ul9DVVJTT1IpOworICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgSEJBUl9DVVJTT1I6Cisg ICAgeworICAgICAgaWYgKHctPm1jLnJlZCA+PSAwICYmIHctPm1jLmJsdWUgPj0gMCAmJiB3LT5t Yy5ncmVlbiA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNr IGBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgICBmLT5vdXRw dXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBjb2xvci5waXhlbDsKKyAgICAgICAgICB3LT5tYy5j dXJzb3JfZ2NfaW52aXNpYmxlX29rYXkgPSB0cnVlOworICAgICAgICAgIHhfZHJhd19iYXJfY3Vy c29yICh3LCBnbHlwaF9yb3csIGN1cnNvcl93aWR0aCwgSEJBUl9DVVJTT1IpOworICAgICAgICAg IHctPm1jLmN1cnNvcl9nY19pbnZpc2libGVfb2theSA9IGZhbHNlOworICAgICAgICAgIGYtPm91 dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAg ICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIGdseXBo X3JvdywgY3Vyc29yX3dpZHRoLCBIQkFSX0NVUlNPUik7CisgICAgICBicmVhazsKKyAgICB9Cisg ICAgY2FzZSBOT19DVVJTT1I6CisgICAgICB3LT5waHlzX2N1cnNvcl93aWR0aCA9IDA7CisgICAg ICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7CisgIH0KKworLyog ZW5kIE1VTFRJUExFIENVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwogCi0JICAg IGNhc2UgTk9fQ1VSU09SOgotCSAgICAgIHctPnBoeXNfY3Vyc29yX3dpZHRoID0gMDsKLQkgICAg ICBicmVhazsKIAotCSAgICBkZWZhdWx0OgotCSAgICAgIGVtYWNzX2Fib3J0ICgpOwotCSAgICB9 CiAJfQogCiAjaWZkZWYgSEFWRV9YX0kxOE4K --Multipart_Tue_Aug_28_23:39:25_2018-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs). References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sun, 11 Nov 2018 03:37:02 +0000 Resent-Message-ID: <handler.22873.B22873.154190738625056 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN>, Marcin Borkowski <mbork@HIDDEN>, Richard Stallman <rms@HIDDEN>, John Wiegley <johnw@HIDDEN>, Akio Burns <akioburns@HIDDEN>, Alan Third <athird@HIDDEN> Cc: 17684 <at> debbugs.gnu.org, 22873 <at> debbugs.gnu.org Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.154190738625056 (code B ref 22873); Sun, 11 Nov 2018 03:37:02 +0000 Received: (at 22873) by debbugs.gnu.org; 11 Nov 2018 03:36:26 +0000 Received: from localhost ([127.0.0.1]:45223 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1gLgXx-0006W3-Uj for submit <at> debbugs.gnu.org; Sat, 10 Nov 2018 22:36:26 -0500 Received: from gateway30.websitewelcome.com ([192.185.144.21]:41860) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1gLgXv-0006Vq-Ke for 22873 <at> debbugs.gnu.org; Sat, 10 Nov 2018 22:36:24 -0500 Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway30.websitewelcome.com (Postfix) with ESMTP id 9BA804B76 for <22873 <at> debbugs.gnu.org>; Sat, 10 Nov 2018 21:36:22 -0600 (CST) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id LgXtggNujkBj6LgXugfzwg; Sat, 10 Nov 2018 21:36:22 -0600 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Z34wTUNCMb9TdQ9TWp0lWN4nN4RN4AAs/x63M2+rMqY=; b=gK9jMXa0mqeHfKrNYzFSXNxzPi d73ywq9QtnVJguH5J8UdTFl7EsoBfC1a6aW1gQnPxy7djBZywaKRE95lPKge3v73Fo5JaSoRqYI4x zsUoNF6E6f6as1edr0tKKZOtXGoNjDA+XisSa6a1rL2t5/ZhbFPlaipjFUG4GQqndVfrOtmcPscGN jDHJyiOeqXtd/8P/pQlHjvOCC09OXCUE8GvHFEa/J/ol8zHLUUQDMa0Kicf7B7J2B3jeSa7CYOzD9 HHoJMazrjcIpmHLZ4Ey6hSam4mUfb/Z2sq2P31u3i1VC2ccCnPkgg0f0gz04JP3DI4WktWFOVm1le dLl6R8Cw==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:55387 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from <esq@HIDDEN>) id 1gLgXq-000nU9-DR; Sat, 10 Nov 2018 21:36:21 -0600 Date: Sat, 10 Nov 2018 19:36:17 -0800 Message-ID: <m2k1lkb80e.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Sat_Nov_10_19:36:17_2018-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1gLgXq-000nU9-DR X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:55387 X-Source-Auth: lawlist X-Email-Count: 3 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> --Multipart_Sat_Nov_10_19:36:17_2018-1 Content-Type: text/plain; charset=US-ASCII Proof concept patch version 015. Changes include, but are not limited to: - Coordinates for the fake cursors are now obtained by effectively dumping the glyph matrix and looking for the desired glyph; e.g., based upon a particular character position in the buffer, or a particular window relative X. [The previous versions relied upon moving IT.] - Multiple fake cursors and crosshairs are now supported in the inactive window. - The foreground filled color of a hollow cursor is now configurable, including, but not limited to when the region inactive, and active region beginning and/or the active region end. - Colors of fake cursors in inactive window can be customized to be different than the active window. - New fringe indicators when engaging different forms of horizontal scrolling. - New fringe indicators when the idle timer for crosshairs is pending. - Other miscellaneous new stuff, but not too significant. - Miscellaneous bug fixes. There are miscellaneous changes to the core of Emacs to facilitate generate tracing/debugging information. Said modifications will eventually be removed. Due to the fact that I do not presently have a computer set up with MacOS Mojave, I cannot test a current version of Emacs master branch that includes the Mojave changes to nsterm.m made by Alan Third some time ago. Based upon the help I received from Alan on the Emacs Devel mailing list, it would appear that simply restoring update_window_cursor to its unmodified state will permit drawing crosshairs and multiple fake cursors on a platform of Emacs for MacOS Mojave. My recollection is that those restrictions were instituted to prevent redisplaying the crosshairs in certain mouseover situations. SETUP: Step 1: git clone -b master git://git.sv.gnu.org/emacs.git Step 2: In the new emacs folder, go back to an Emacs version from 07/07/2018: git reset --hard 98463bed07ecc9057094928ffdc2321eaaf3ab52 [Going back in time to 07/07/2018 saves @lawlist a couple of hours by not having to deal with unrelated recent changes to the master branch by the Emacs team.] Step 3: From within the new emacs folder created in Step 1, apply the patch: git apply /path/to/the/11_10_2018__18_53_09_703.diff [There should not be any error messages at this point; i.e, you should be returned to a new command prompt.] Step 4: ./autogen.sh Step 5: ./configure ... [your custom options] Step 6: make Step 7: make install - To try out built-in fake cursors with Magnar Sveen's library (multiple-cursors), install that package first. If the multiple-cursors package by Magnar Sveen is not already installed, then there are two easy ways to install that package: Type: M-x mc-install OR, evaluate the following snippet: (progn (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) (package-refresh-contents) (package-install 'multiple-cursors)) - To try out the crosshairs feature, open a relatively simple buffer (e.g., just code or text) and type: M-x +-mode The default setting is on an idle timer, so just move around or type something to see how it works. - To see an example of a variety of built-in cursor styles and widths, type: M-x mc-test --Multipart_Sat_Nov_10_19:36:17_2018-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="11_10_2018__18_53_09_703.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvY3Jvc3NoYWlycy5lbCBiL2xpc3AvY3Jvc3NoYWlycy5lbApuZXcg ZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5lMmIxNmFkCi0tLSAvZGV2L251bGwKKysr IGIvbGlzcC9jcm9zc2hhaXJzLmVsCkBAIC0wLDAgKzEsMTI0OCBAQAorOzs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Cis7OzsgQkVHSU4gbW9kaWZpY2F0aW9uIG9mIHRoZSBNdWx0aXBsZS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7OyBza2lwIGtleWJvYXJkIG1hY3Jvcywgc2luY2UgdGhleSB3aWxsIGdlbmVyYXRlIGFjdHVh bCBjb21tYW5kcyB0aGF0IGFyZQorICAgICAgICAgICAgOzsgYWxzbyBydW4gaW4gdGhlIGNvbW1h bmQgbG9vcCAtIHdlJ2xsIGhhbmRsZSB0aG9zZSBsYXRlciBpbnN0ZWFkLgorICAgICAgICAgICAg KHdoZW4gKGZ1bmN0aW9ucCBvcmlnaW5hbC1jb21tYW5kKQorICAgICAgICAgICAgICA7OyBpZiBp dCdzIGEgbGFtYmRhLCB3ZSBjYW4ndCBrbm93IGlmIGl0J3Mgc3VwcG9ydGVkIG9yIG5vdAorICAg ICAgICAgICAgICA7OyAtIHNvIGdvIGFoZWFkIGFuZCBhc3N1bWUgaXQncyBvaywgYmVjYXVzZSB3 ZSdyZSBqdXN0IG9wdGltaXN0aWMgbGlrZSB0aGF0CisgICAgICAgICAgICAgIChpZiAob3IgKG5v dCAoc3ltYm9scCBvcmlnaW5hbC1jb21tYW5kKSkKKyAgICAgICAgICAgICAgICAgICAgICA7OyBs YW1iZGEgcmVnaXN0ZXJlZCBieSBzbWFydHJlcAorICAgICAgICAgICAgICAgICAgICAgIChzdHJp bmctcHJlZml4LXAgIigiIChzeW1ib2wtbmFtZSBvcmlnaW5hbC1jb21tYW5kKSkpCisgICAgICAg ICAgICAgICAgICAobWMvZXhlY3V0ZS1jb21tYW5kLWZvci1hbGwtZmFrZS1jdXJzb3JzIG9yaWdp bmFsLWNvbW1hbmQpCisgICAgICAgICAgICAgICAgOzsgc21hcnRyZXAgYGludGVybidzIGNvbW1h bmRzIGludG8gb3duIG9iYXJyYXkgdG8gaGVscAorICAgICAgICAgICAgICAgIDs7IGBkZXNjcmli ZS1iaW5kaW5ncycuICBTbywgbGV0J3MgcmUtYGludGVybicgaGVyZSB0bworICAgICAgICAgICAg ICAgIDs7IG1ha2UgdGhlIGNvbW1hbmQgY29tcGFyYWJsZSBieSBgZXEnLgorICAgICAgICAgICAg ICAgIChzZXRxIG9yaWdpbmFsLWNvbW1hbmQgKGludGVybiAoc3ltYm9sLW5hbWUgb3JpZ2luYWwt Y29tbWFuZCkpKQorICAgICAgICAgICAgICAgIDs7IG90aGVyd2lzZSBpdCdzIGEgc3ltYm9sLCBh bmQgd2UgY2FuIGJlIG1vcmUgdGhvcm91Z2gKKyAgICAgICAgICAgICAgICAoaWYgKGdldCBvcmln aW5hbC1jb21tYW5kICdtYy0tdW5zdXBwb3J0ZWQpCisgICAgICAgICAgICAgICAgICAgIChtZXNz YWdlICIlUyBpcyBub3Qgc3VwcG9ydGVkIHdpdGggbXVsdGlwbGUgY3Vyc29ycyVzIgorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBvcmlnaW5hbC1jb21tYW5kCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIChnZXQgb3JpZ2luYWwtY29tbWFuZCAnbWMtLXVuc3VwcG9ydGVkKSkKKyAg ICAgICAgICAgICAgICAgICh3aGVuIChhbmQgb3JpZ2luYWwtY29tbWFuZAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAobm90IChtZW1xIG9yaWdpbmFsLWNvbW1hbmQgbWMtLWRlZmF1bHQt Y21kcy10by1ydW4tb25jZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChub3QgKG1l bXEgb3JpZ2luYWwtY29tbWFuZCBtYy9jbWRzLXRvLXJ1bi1vbmNlKSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgKG9yIG1jL2Fsd2F5cy1ydW4tZm9yLWFsbAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgKG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy0tZGVmYXVsdC1jbWRz LXRvLXJ1bi1mb3ItYWxsKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG1lbXEg b3JpZ2luYWwtY29tbWFuZCBtYy9jbWRzLXRvLXJ1bi1mb3ItYWxsKQorICAgICAgICAgICAgICA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gKFRoZSBMaW5kZW4gU2NyaXB0aW5nIExhbmd1YWdl KS4KK2Buc3Rlcm0ubScgdXNlcyBgTlNDb2xvcicsIHdoaWNoIHdvcmtzIHdlbGwgd2l0aCBMU0wu ICBgdzMydGVybS5jJyB1c2VzCitgUEFMRVRURVJHQicgb3IgYFJHQicsIGFuZCB0aGUgY29udmVy c2lvbiBmcm9tIExTTCBpcyBkb25lIGludGVybmFsbHkgYnkKK211bHRpcGx5aW5nIGVhY2ggZWxl bWVudCBvZiB0aGUgTFNMIGNvbG9yIHZlY3RvciBieSAyNTUuICBgeHRlcm0uYycgdXNlcworYHhf bWFrZV90cnVlY29sb3JfcGl4ZWwnLCB3aGljaCB1c2VzIDE2LWJpdCBSR0IgLS0gdGhlIGNvbnZl cnNpb24gZnJvbSBMU0wKK2hhcHBlbnMgaW50ZXJuYWxseSBieSBtdWx0aXBseWluZyBlYWNoIGVs ZW1lbnQgb2YgdGhlIExTTCBjb2xvciB2ZWN0b3IgYnkgNjU1MzUuIgorKGludGVyYWN0aXZlKQor ICAobGV0ICgoYnVmZmVyIChnZXQtYnVmZmVyLWNyZWF0ZSAiKk1DLVRFU1QqIikpKQorICAgICh3 aXRoLWN1cnJlbnQtYnVmZmVyIGJ1ZmZlcgorICAgICAgKGVyYXNlLWJ1ZmZlcikKKyAgICAgIChp bnNlcnQgIlRoaXMgaXMgYSB0ZXN0ISIpCisgICAgICAoc2V0cSBtdWx0aXBsZS1jdXJzb3JzLWNv bmYgJygoMSAiaGJhciIgIm1hZ2VudGEiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgKDIgImJhciIgInB1cnBsZSIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAoMyAiYm94IiAiIzAwRkYwMCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAoNCAiaG9sbG93IiAiIzAwMDBGRiIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAoNSAoIm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yAnZm9yY2UpKQorCisoZGVmdW4g Ky1kcmF3LWNyb3NzaGFpcnMgKCZvcHRpb25hbCBmb3JjZSkKKyAgKHdoZW4gKy1tb2RlCisgICAg KHdoZW4gKy10aW1lci12YXIKKyAgICAgIChzZXRxIHRpbWVyLWlkbGUtbGlzdCAoZGVscSArLXRp bWVyLXZhciB0aW1lci1pZGxlLWxpc3QpKQorICAgICAgKHNldHEgKy10aW1lci12YXIgbmlsKSkK KyAgICAodW5sZXNzIChtZW1xIHRoaXMtY29tbWFuZCArLXBhcmVucy1leGNsdXNpb25zKQorICAg ICAgKCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykpCisgICAgKGlmIGZvcmNlCisgICAgICAocHJv Z24KKyAgICAgICAgKCstcGFyZW5zLWZuKQorICAgICAgICAodW5sZXNzIGNyb3NzaGFpcnMtZHJh dy1mb3J0aHdpdGgKKyAgICAgICAgICAobWMtYWN0aXZhdGUtY3Jvc3NoYWlycyAoc2VsZWN0ZWQt d2luZG93KSkpKQorICAgICAgKHNldHEgKy10aW1lci12YXIgKHJ1bi13aXRoLWlkbGUtdGltZXIg Ky1pZGxlLXRpbWVyLXNlY29uZHMgbmlsICMnKy10aW1lci1mbikpKSkpCisKKzs7OyMjI2F1dG9s b2FkCisoZGVmaW5lLW1pbm9yLW1vZGUgKy1tb2RlCisiTWlub3IgbW9kZSBmb3IgZGlzcGxheWlu ZyBhIGhvcml6b250YWwgcnVsZXIuIgorICA6aW5pdC12YWx1ZSBuaWwKKyAgOmxpZ2h0ZXIgIiAr IgorICA6a2V5bWFwIG5pbAorICA6Z2xvYmFsIG5pbAorICA6Z3JvdXAgJystbW9kZQorICAoY29u ZAorICAgICgrLW1vZGUKKyAgICAgICh3aGVuIChhbmQgZ2xvYmFsLWVsZG9jLW1vZGUKKyAgICAg ICAgICAgICAgICAgKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAgJ2FueSkKKyAgICAgICAgICAgICAg ICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAgICAgICAgKGdsb2JhbC1lbGRv Yy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgaml0LWxvY2stY29udGV4dC10aW1lcgorICAg ICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAgICAg ICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAod2hlbiAodGlt ZXJwIGppdC1sb2NrLWNvbnRleHQtdGltZXIpCisgICAgICAgICAgKGNhbmNlbC10aW1lciBqaXQt bG9jay1jb250ZXh0LXRpbWVyKSkKKyAgICAgICAgOzsgKHNldHEgaml0LWxvY2stY29udGV4dC10 aW1lciAocnVuLXdpdGgtaWRsZS10aW1lciA1LjAgJ3JlcGVhdCAnaml0LWxvY2stY29udGV4dC1m b250aWZ5KSkKKyAgICAgICAgKHNldHEgaml0LWxvY2stY29udGV4dC10aW1lciBuaWwpKQorICAg ICAgKHdoZW4gKGFuZCAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAgICAg ICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAod2hlbiAodGlt ZXJwIHVuZG8tYXV0by1jdXJyZW50LWJvdW5kYXJ5LXRpbWVyKQorICAgICAgICAgIChjYW5jZWwt dGltZXIgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpKQorICAgICAgICAoZnNldCAn dW5kby1hdXRvLS11bmRvYWJsZS1jaGFuZ2UKKyAgICAgICAgICAgICAgKGxhbWJkYSAoKSAoYWRk LXRvLWxpc3QgJ3VuZG8tYXV0by0tdW5kb2FibHktY2hhbmdlZC1idWZmZXJzIChjdXJyZW50LWJ1 ZmZlcikpKSkKKyAgICAgICAgKGZzZXQgJ3VuZG8tYXV0by1hbWFsZ2FtYXRlICdpZ25vcmUpKQor ICAgICAgKHdoZW4gYmxpbmstY3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pc3QKKyAg ICAgIDs7OyBib2dzIEVtYWNzIGRvd24gdW5sZXNzIGBiaWRpLWRpc3BsYXktcmVvcmRlcmluZycg aXMgc2V0IHRvIGEgbmlsIHZhbHVlLgorICAgICAgOzs7IEhvd2V2ZXIsIG1vc3QgdXNlcnMgd2ls bCBwcm9iYWJseSBub3Qgd2FudCB0aGlzIHBhcnRpY3VsYXIgc2V0dGluZy4KKyAgICAgICh1bmxl c3MgKG51bGwgYmlkaS1kaXNwbGF5LXJlb3JkZXJpbmcpCisgICAgICAgIChzZXRxIGJpZGktZGlz cGxheS1yZW9yZGVyaW5nIG5pbCkpCisgICAgICAodW5sZXNzIChhbmQgKGNhbGxlZC1pbnRlcmFj dGl2ZWx5LXAgJ2FueSkKKyAgICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgt YXJnICcoNCkpKQorICAgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICcrLS1zYXZlZC1z dGF0ZSkgbmlsKQorICAgICAgICAoZG9saXN0ICh2YXIgJyhidWZmZXItZGlzcGxheS10YWJsZQor ICAgICAgICAgICAgICAgICAgICAgICBmcmluZ2UtaW5kaWNhdG9yLWFsaXN0CisgICAgICAgICAg ICAgICAgICAgICAgIHRhYi13aWR0aAorICAgICAgICAgICAgICAgICAgICAgICBsaW5lLW1vdmUt dmlzdWFsCisgICAgICAgICAgICAgICAgICAgICAgIHRydW5jYXRlLWxpbmVzCisgICAgICAgICAg ICAgICAgICAgICAgIHRydW5jYXRlLXBhcnRpYWwtd2lkdGgtd2luZG93cworICAgICAgICAgICAg ICAgICAgICAgICB3b3JkLXdyYXApKQorICAgICAgICAgICh3aGVuIChsb2NhbC12YXJpYWJsZS1w IHZhcikKKyAgICAgICAgICAgIChwdXNoIChjb25zIHZhciAoc3ltYm9sLXZhbHVlIHZhcikpICst LXNhdmVkLXN0YXRlKSkpCisgICAgICAgIChzZXRxIGZpbGwtY29sdW1uIDgwKQorICAgICAgICAo c2V0cSBkaXNwbGF5LWxpbmUtbnVtYmVycyB0KQorICAgICAgICAoc2V0cS1sb2NhbCBhdXRvLWhz Y3JvbGwtbW9kZSAnY3VycmVudC1saW5lKQorICAgICAgICAoc2V0cS1sb2NhbCBoc2Nyb2xsLXN0 ZXAgNSkKKyAgICAgICAgKHNldHEgYnVmZmVyLWRpc3BsYXktdGFibGUgKy1idWZmZXItZGlzcGxh eS10YWJsZSkKKyAgICAgICAgKHNldHEgdGFiLXdpZHRoIDQpCisgICAgICAgIChzZXQgKG1ha2Ut bG9jYWwtdmFyaWFibGUgJ2xpbmUtbW92ZS12aXN1YWwpIHQpCisgICAgICAgIChzZXRxIHRydW5j YXRlLWxpbmVzCisgICAgICAgICAgKGNvbmQKKyAgICAgICAgICAgICgobGV0ICgobHN0ICstdHJ1 bmNhdGUtbGluZXMtZGVyaXZlZC1tb2RlcykKKyAgICAgICAgICAgICAgICAgICAgbW9kZSkKKyAg ICAgICAgICAgICAgKGNhdGNoICdmb3VuZAorICAgICAgICAgICAgICAgICh3aGlsZSAoc2V0cSBt b2RlIChwb3AgbHN0KSkKKyAgICAgICAgICAgICAgICAgICh3aGVuIChkZXJpdmVkLW1vZGUtcCBt b2RlKQorICAgICAgICAgICAgICAgICAgICAodGhyb3cgJ2ZvdW5kIHQpKSkpKSkKKyAgICAgICAg ICAgICAoKG1lbXEgbWFqb3ItbW9kZSArLXRydW5jYXRlLWxpbmVzLW1ham9yLW1vZGVzKSkKKyAg ICAgICAgICAgICAodAorICAgICAgICAgICAgICAgbmlsKSkpCisgICAgICAgIChzZXQgKG1ha2Ut bG9jYWwtdmFyaWFibGUgJ3RydW5jYXRlLXBhcnRpYWwtd2lkdGgtd2luZG93cykgbmlsKQorICAg ICAgICAoc2V0cSB3b3JkLXdyYXAgdCkKKyAgICAgICAgKHNldHEgaW5kaWNhdGUtZW1wdHktbGlu ZXMgdCkKKyAgICAgICAgKHNldHEgaW5kaWNhdGUtYnVmZmVyLWJvdW5kYXJpZXMgJ2xlZnQpCisg ICAgICAgIChzZXRxIGZyaW5nZS1pbmRpY2F0b3ItYWxpc3QKKyAgICAgICAgICAgIDs7OyBoc2Ns X2FsbF90ZW1wX3AgfCBoc2NsX3RlbXBfcAorICAgICAgICAgICcoKCstaHNjbC10ZW1wIC4gKCst c2luZ2xlLWFuZ2xlLWxlZnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArLWRvdWJsZS1h bmdsZS1sZWZ0KSkKKyAgICAgICAgICAgIDs7OyBoc2NsX2FsbF9wZXJtXzBfcCB8IGhzY2xfYWxs X3Blcm1fMV9wIHwgaHNjbF9hbGxfcGVybV8yX3AgfCBoc2NsX3Blcm1fcAorICAgICAgICAgICAg KCstaHNjbC1wZXJtIC4gKCstc2luZ2xlLWFuZ2xlLXVwCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgKy1kb3VibGUtYW5nbGUtdXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArLXRy aXBsZS1hbmdsZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICstcXVhZHJ1cGxlLWFu Z2xlLXVwKSkKKyAgICAgICAgICAgICgrLW92ZXJsYXktYXJyb3cgLiAoKy1mcmluZ2UtbGVmdC1h cnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArLWZyaW5nZS1yaWdodC1hcnJv dykpCisgICAgICAgICAgICAodHJ1bmNhdGlvbiAuICgrLWZyaW5nZS1sZWZ0LWFycm93CisgICAg ICAgICAgICAgICAgICAgICAgICAgICArLWZyaW5nZS1yaWdodC1hcnJvdykpCisgICAgICAgICAg ICAoY29udGludWF0aW9uIC4gKCstZnJpbmdlLWxlZnQtY3VybHktYXJyb3cKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgKy1iYWNrc2xhc2gpKQorICAgICAgICAgICAgKG92ZXJsYXktYXJy b3cgLiArLWZyaW5nZS1yaWdodC10cmlhbmdsZSkKKyAgICAgICAgICAgICh1cCAuICstZnJpbmdl LXVwLWFycm93KQorICAgICAgICAgICAgKGRvd24gLiArLWZyaW5nZS1kb3duLWFycm93KQorICAg ICAgICAgICAgKHRvcCAuICstZnJpbmdlLXRvcC1sZWZ0LWFuZ2xlKQorICAgICAgICAgICAgKGJv dHRvbSAuICstZnJpbmdlLWJvdHRvbS1yaWdodC1hbmdsZSkKKyAgICAgICAgICAgICh0b3AtYm90 dG9tIC4gKCstZnJpbmdlLWxlZnQtYnJhY2tldAorICAgICAgICAgICAgICAgICAgICAgICAgICAg Ky1mcmluZ2UtcmlnaHQtYnJhY2tldAorICAgICAgICAgICAgICAgICAgICAgICAgICAgKy1mcmlu Z2UtdG9wLXJpZ2h0LWFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgICArLWZyaW5nZS10 b3AtbGVmdC1hbmdsZSkpCisgICAgICAgICAgICAoZW1wdHktbGluZSAuICstZnJpbmdlLWVtcHR5 LWxpbmUpCisgICAgICAgICAgICAodW5rbm93biAuICstZnJpbmdlLXF1ZXN0aW9uLW1hcmspKSkK KyAgICAgICAgKHNldHEgZnJpbmdlLWN1cnNvci1hbGlzdCAnKChib3ggLiArLWZyaW5nZS1sZWZ0 LXRyaWFuZ2xlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGhvbGxvdyAu ICstaG9sbG93LXJlY3RhbmdsZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IChiYXIgLiArLXZlcnRpY2FsLWJhcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIChoYmFyIC4gKy1mcmluZ2UtaG9yaXpvbnRhbC1iYXIpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAoaG9sbG93LXNtYWxsIC4gKy1mcmluZ2UtaG9sbG93LXNxdWFyZSkp KQorICAgICAgICAoaWYgY3Jvc3NoYWlycy1kcmF3LWZvcnRod2l0aAorICAgICAgICAgIChhZGQt aG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJh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uKQorICAgICAgICAgICAgICAgICAocG9pbnQtbWluKSkpCisgICAgICAgICAod2luIChzZWxl Y3RlZC13aW5kb3cpKQorICAgICAgICAgKGkgMCkKKyAgICAgICAgIChwcmVjZWRpbmctY2hhciAo cHJlY2VkaW5nLWNoYXIpKQorICAgICAgICAgKG9jaGFyIChjaGFyLWFmdGVyIG9wb2ludCkpCisg ICAgICAgICAocG9zMQorICAgICAgICAgICAoY29uZAorICAgICAgICAgICAgICgoYW5kIG9jaGFy CisgICAgICAgICAgICAgICAgICAgKG9yIDs7OyAoY2hhci10by1zdHJpbmcgNDApID0+IG9wZW5p bmcgcGFyZW50aGVzaXMKKyAgICAgICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgNDApCisgICAg ICAgICAgICAgICAgICAgICAgIDs7OyAoY2hhci10by1zdHJpbmcgOTEpID0+IG9wZW5pbmcgc3F1 YXJlIGJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgOTEpCisgICAgICAg ICAgICAgICAgICAgICAgIDs7OyAoY2hhci10by1zdHJpbmcgMTIzKSA9PiBvcGVuaW5nIHdhdnkg YnJhY2tldAorICAgICAgICAgICAgICAgICAgICAgICAoPSBvY2hhciAxMjMpKSkKKyAgICAgICAg ICAgICAgICAobWluICgxKyBvcG9pbnQpIChwb2ludC1tYXgpKSkKKyAgICAgICAgICAgICAoKG9y IDs7OyAoY2hhci10by1zdHJpbmcgNDEpID0+IGNsb3NpbmcgcGFyZW50aGVzaXMKKyAgICAgICAg ICAgICAgICAgICg9IHByZWNlZGluZy1jaGFyIDQxKQorICAgICAgICAgICAgICAgICAgOzs7IChj aGFyLXRvLXN0cmluZyA5MykgPT4gY2xvc2luZyBzcXVhcmUgYnJhY2tldAorICAgICAgICAgICAg ICAgICAgKD0gcHJlY2VkaW5nLWNoYXIgOTMpCisgICAgICAgICAgICAgICAgICA7OzsgKGNoYXIt dG8tc3RyaW5nIDEyNSkgPT4gY2xvc2luZyB3YXZ5IGJyYWNrZXQKKyAgICAgICAgICAgICAgICAg ICg9IHByZWNlZGluZy1jaGFyIDEyNSkpCisgICAgICAgICAgICAgICAgKG1heCAocG9pbnQtbWlu KSAoMS0gb3BvaW50KSkpCisgICAgICAgICAgICAgKHQKKyAgICAgICAgICAgICAgICBvcG9pbnQp KSkKKyAgICAgICAgIHBvczIKKyAgICAgICAgIHNlbGVjdGVkLWZhY2UpCisgICAgKHNhdmUtZXhj dXJzaW9uCisgICAgICAoY29uZGl0aW9uLWNhc2UgbmlsCisgICAgICAgICh3aGlsZSAoc2V0cSBw b3MxIChudGggMSAocGFyc2UtcGFydGlhbC1zZXhwIGZyb20gcG9zMSkpKQorICAgICAgICAgIChz ZXRxIHBvczIgKHNjYW4tc2V4cHMgcG9zMSAxKSkKKyAgICAgICAgICAoaWYgKD0gaSAxMCkKKyAg ICAgICAgICAgIChzZXRxIGkgMSkKKyAgICAgICAgICAgIChzZXRxIGkgKDErIGkpKSkKKyAgICAg ICAgICAoc2V0cSBzZWxlY3RlZC1mYWNlIChjb25kCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICgoPSBpIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFy ZW5zLW9uZS1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSAyKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy10d28tZmFjZSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgMykKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtdGhyZWUtZmFjZSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgKCg9IGkgNCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAnKy1wYXJlbnMtZm91ci1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo KD0gaSA1KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1maXZl LWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDYpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLXNpeC1mYWNlKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA3KQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICcrLXBhcmVucy1zZXZlbi1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAoKD0gaSA4KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBh cmVucy1laWdodC1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA5 KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1uaW5lLWZhY2Up CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDEwKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy10ZW4tZmFjZSkpKQorICAgICAgICAgIChs ZXQgKChvdiAobWFrZS1vdmVybGF5IHBvczEgKDErIHBvczEpKSkpCisgICAgICAgICAgICAodW5s ZXNzICstcGFyZW5zLWluYWN0aXZlLXdpbmRvd3MKKyAgICAgICAgICAgICAgKG92ZXJsYXktcHV0 IG92ICd3aW5kb3cgd2luKSkKKyAgICAgICAgICAgIChvdmVybGF5LXB1dCBvdiAnZmFjZSBzZWxl Y3RlZC1mYWNlKSkKKyAgICAgICAgICAod2hlbiBwb3MyCisgICAgICAgICAgICAobGV0ICgob3Yg KG1ha2Utb3ZlcmxheSAoMS0gcG9zMikgcG9zMikpKQorICAgICAgICAgICAgICAodW5sZXNzICst cGFyZW5zLWluYWN0aXZlLXdpbmRvd3MKKyAgICAgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3Yg J3dpbmRvdyB3aW4pKQorICAgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ2ZhY2Ugc2VsZWN0 ZWQtZmFjZSkpKSkKKyAgICAgICAgKGVycm9yIG5pbCkpKQorICAgIChzZXRxICstcGFyZW5zLW92 ZXJsYXlzLWV4aXN0LXAgdCkpKQorCisoZGVmdW4gKy1yZW1vdmUtb3ZlcmxheXMgKGJlZyBlbmQg bmFtZSB2YWwpCisiUmVtb3ZlIHRoZSBvdmVybGF5cyB0aGF0IGFyZSBgZXF1YWwtaW5jbHVkaW5n LXByb3BlcnRpZXNgLgorSW5jbHVkZXMgYSB1bmlxdWUgc2l0dWF0aW9uIHdoZW4gYW4gb3Zlcmxh eSB3aXRoIGFuIGAnYWZ0ZXItc3RyaW5nYCBwcm9wZXJ0eQoraXMgYXQgdGhlIHZlcnkgZW5kIG9m IGEgbmFycm93ZWQtYnVmZmVyLiIKKyAgKGxldCogKChwb2ludC1tYXggKHBvaW50LW1heCkpCisg ICAgICAgICAocG9pbnQtbWluIChwb2ludC1taW4pKQorICAgICAgICAgKG5hcnJvd2VkLXAgKGJ1 ZmZlci1uYXJyb3dlZC1wKSkKKyAgICAgICAgIChiZWcgKGlmIGJlZyBiZWcgcG9pbnQtbWluKSkK KyAgICAgICAgIChlbmQKKyAgICAgICAgICAgKGNvbmQKKyAgICAgICAgICAgICAoKGFuZAorICAg ICAgICAgICAgICAgICAobm90IG5hcnJvd2VkLXApCisgICAgICAgICAgICAgICAgIGVuZCkKKyAg ICAgICAgICAgICAgIGVuZCkKKyAgICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAo bm90IG5hcnJvd2VkLXApCisgICAgICAgICAgICAgICAgIChudWxsIGVuZCkpCisgICAgICAgICAg ICAgICBwb2ludC1tYXgpCisgICAgICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFy cm93ZWQtcAorICAgICAgICAgICAgICAgICBlbmQKKyAgICAgICAgICAgICAgICAgKDwgZW5kIHBv aW50LW1heCkpCisgICAgICAgICAgICAgICBlbmQpCisgICAgICAgICAgICAgKChhbmQKKyAgICAg ICAgICAgICAgICAgbmFycm93ZWQtcAorICAgICAgICAgICAgICAgICBlbmQKKyAgICAgICAgICAg ICAgICAgKD0gZW5kIHBvaW50LW1heCkpCisgICAgICAgICAgICAgICAoMSsgZW5kKSkKKyAgICAg ICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICBuYXJyb3dlZC1wCisgICAgICAgICAgICAg ICAgIChudWxsIGVuZCkpCisgICAgICAgICAgICAgICAoMSsgcG9pbnQtbWF4KSkgKSkKKyAgICAg ICAgIChvdmVybGF5cworICAgICAgICAgICAocHJvZ24KKyAgICAgICAgICAgICAob3ZlcmxheS1y ZWNlbnRlciBlbmQpCisgICAgICAgICAgICAgKG92ZXJsYXlzLWluIGJlZyBlbmQpKSkpCisgICAg KHdoZW4gKGFuZCBiZWcgZW5kIG5hbWUgdmFsKQorICAgICAgKGRvbGlzdCAobyBvdmVybGF5cykK KyAgICAgICAgKGNvbmQKKyAgICAgICAgICAoKGFuZCAoZXEgbmFtZSAnZmFjZSkKKyAgICAgICAg ICAgICAgICAoZXEgKG92ZXJsYXktZ2V0IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIDs7IEVp dGhlciBwdXNoIHRoaXMgb3ZlcmxheSBvdXRzaWRlIGJlZy4uLmVuZAorICAgICAgICAgICAgOzsg b3Igc3BsaXQgaXQgdG8gZXhjbHVkZSBiZWcuLi5lbmQKKyAgICAgICAgICAgIDs7IG9yIGRlbGV0 ZSBpdCBlbnRpcmVseSAoaWYgaXQgaXMgY29udGFpbmVkIGluIGJlZy4uLmVuZCkuCisgICAgICAg ICAgICAoaWYgKDwgKG92ZXJsYXktc3RhcnQgbykgYmVnKQorICAgICAgICAgICAgICAgIChpZiAo PiAob3ZlcmxheS1lbmQgbykgZW5kKQorICAgICAgICAgICAgICAocHJvZ24KKyAgICAgICAgICAg ICAgICAobW92ZS1vdmVybGF5IChjb3B5LW92ZXJsYXkgbykKKyAgICAgICAgICAgICAgICAgIChv dmVybGF5LXN0YXJ0IG8pIGJlZykKKyAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gZW5k IChvdmVybGF5LWVuZCBvKSkpCisgICAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gKG92 ZXJsYXktc3RhcnQgbykgYmVnKSkKKyAgICAgICAgICAgICAgKGlmICg+IChvdmVybGF5LWVuZCBv KSBlbmQpCisgICAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVu ZCBvKSkKKyAgICAgICAgICAgICAgICAoZGVsZXRlLW92ZXJsYXkgbykpKSkKKyAgICAgICAgICAo KGFuZCAobm90IChlcSBuYW1lICdmYWNlKSkKKyAgICAgICAgICAgICAgICAoZXF1YWwtaW5jbHVk aW5nLXByb3BlcnRpZXMgKG92ZXJsYXktZ2V0IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIChk ZWxldGUtb3ZlcmxheSBvKSkpKSkpKQorCisoZGVmdW4gKy1kZWxldGUtcGFyZW5zLW92ZXJsYXlz ICgpCisgICh3aGVuICstcGFyZW5zLW92ZXJsYXlzLWV4aXN0LXAKKyAgICAoZG9saXN0IChmYWNl ICcoKy1wYXJlbnMtb25lLWZhY2UKKyAgICAgICAgICAgICAgICAgICAgKy1wYXJlbnMtdHdvLWZh Y2UKKyAgICAgICAgICAgICAgICAgICAgKy1wYXJlbnMtdGhyZWUtZmFjZQorICAgICAgICAgICAg ICAgICAgICArLXBhcmVucy1mb3VyLWZhY2UKKyAgICAgICAgICAgICAgICAgICAgKy1wYXJlbnMt Zml2ZS1mYWNlCisgICAgICAgICAgICAgICAgICAgICstcGFyZW5zLXNpeC1mYWNlCisgICAgICAg ICAgICAgICAgICAgICstcGFyZW5zLXNldmVuLWZhY2UKKyAgICAgICAgICAgICAgICAgICAgKy1w YXJlbnMtZWlnaHQtZmFjZQorICAgICAgICAgICAgICAgICAgICArLXBhcmVucy1uaW5l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SBjaGFyYWN0 ZXIgcmV0YWlucyBpdHMgb3duIGZvcmVncm91bmQgY29sb3IgYW5kIGlzIHVuYWZmZWN0ZWQgYnkg dGhpcworcGFydGljdWxhciBmYWNlLiIKKyAgOmdyb3VwICcrLW1vZGUpCisKKyhkZWZmYWNlICst b3ZlcmxheS1hcnJvdy1mYWNlCisgICcoKHQgKDpmb3JlZ3JvdW5kICJyZWQiKSkpCisgICJGYWNl IGZvciBgKy1vdmVybGF5LWFycm93LWZhY2UnLiIKKyAgOmdyb3VwICcrLW1vZGUpCisKKyhkZWZm YWNlICstb3ZlcmxheS1hcnJvdy1taW5pbWFsLWZhY2UKKyAgJygodCAoOmZvcmVncm91bmQgImJs dWUiKSkpCisgICJGYWNlIGZvciBgKy1vdmVybGF5LWFycm93LW1pbmltYWwtZmFjZScuIgorICA6 Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1vdmVybGF5LWFycm93LWluYWN0aXZlLWZhY2UK KyAgJygodCAoOmZvcmVncm91bmQgIkRhcmtTbGF0ZUdyZXkiKSkpCisgICJGYWNlIGZvciBgKy1v dmVybGF5LWFycm93LWluYWN0aXZlLWZhY2UnLiIKKyAgOmdyb3VwICcrLW1vZGUpCisKKyhkZWZm YWNlICstb3ZlcmxheS1hcnJvdy1oc2NsLWZhY2UKKyAgJygodCAoOmZvcmVncm91bmQgIkRhcmtH cmVlbiIpKSkKKyAgIkZhY2UgZm9yIGArLW92ZXJsYXktYXJyb3ctaHNjbC1mYWNlJy4iCisgIDpn cm91cCAnKy1tb2RlKQorCisoZGVmZmFjZSArLW92ZXJsYXktYXJyb3ctaHNjbC1taW5pbWFsLWZh Y2UKKyAgJygodCAoOmZvcmVncm91bmQgIlNhZGRsZUJyb3duIikpKQorICAiRmFjZSBmb3IgYCst b3ZlcmxheS1hcnJvdy1oc2NsLW1pbmltYWwtZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKwor KGRlZmZhY2UgKy1vdmVybGF5LWFycm93LWhzY2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ioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisjZGVm aW5lIE1BWF9QRVJfQlVGRkVSX1ZBUlMgNjAKICAgY2hhciBsb2NhbF9mbGFnc1tNQVhfUEVSX0JV RkZFUl9WQVJTXTsKIAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBTZXQgdG8g dGhlIG1vZHRpbWUgb2YgdGhlIHZpc2l0ZWQgZmlsZSB3aGVuIHJlYWQgb3Igd3JpdHRlbi4KICAg ICAgbW9kdGltZS50dl9uc2VjID09IE5PTkVYSVNURU5UX01PRFRJTUVfTlNFQ1MgbWVhbnMKICAg ICAgdmlzaXRlZCBmaWxlIHdhcyBub25leGlzdGVudC4gIG1vZHRpbWUudHZfbnNlYyA9PQpAQCAt OTE4LDYgKzk2Myw3NCBAQCBYQlVGRkVSIChMaXNwX09iamVjdCBhKQogLyogTW9zdCBjb2RlIHNo b3VsZCB1c2UgdGhlc2UgZnVuY3Rpb25zIHRvIHNldCBMaXNwIGZpZWxkcyBpbiBzdHJ1Y3QKICAg IGJ1ZmZlci4gIChTb21lIHNldHRlcnMgdGhhdCBhcmUgcHJpdmF0ZSB0byBhIHNpbmdsZSAuYyBm aWxlIGFyZQogICAgZGVmaW5lZCBhcyBzdGF0aWMgaW4gdGhvc2UgZmlsZXMuKSAgKi8KKworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworSU5MSU5F IHZvaWQKK2JzZXRfYmx2X21jX3JlYWxfZmFrZV9jdXJzb3IgKHN0cnVjdCBidWZmZXIgKmIsIExp c3BfT2JqZWN0IHZhbCkKK3sK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qKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKK2VudW0g bWNfdHlwZXMKK3sKKyAgTk9fRkxBVk9SLAorICBNQ19HTFlQSCwKKyAgTUNfR0xZUEhMRVNTLAor ICBNQ19HTFlQSF9UQUIsCisgIE1DX09WRVJMQVlfQVJST1dfQklUTUFQLAorICBNQ19QSUxDUk9X LAorICBNQ19IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XLAorICBNQ19IT0xMT1dfUkVDVEFO R0xFLAorICBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1csCisgIE1DX1ZFUlRJQ0FMX0JBUiwK KyAgTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorfTsKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogLyogVGV4dCBjdXJzb3IgdHlwZXMuICAqLwogCiBlbnVtIHRleHRfY3Vyc29yX2tp bmRzCkBAIC0zNzYsNiArMzk4LDE4IEBAIHN0cnVjdCBnbHlwaF9zbGljZQogCiBzdHJ1Y3QgZ2x5 cGgKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMg Ki8KKworICBpbnQgeCwgeSwgaHBvcywgdnBvczsKKworICBib29sX2JmIHp2X3AgOiAxOworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIFBvc2l0aW9uIGZyb20gd2hpY2ggdGhp cyBnbHlwaCB3YXMgZHJhd24uICBJZiBgb2JqZWN0JyBiZWxvdyBpcyBhCiAgICAgIExpc3Agc3Ry aW5nLCB0aGlzIGlzIGFuIGluZGV4IGludG8gdGhhdCBzdHJpbmcuICBJZiBpdCBpcyBhCiAgICAg IGJ1ZmZlciwgdGhpcyBpcyBhIHBvc2l0aW9uIGluIHRoYXQgYnVmZmVyLiAgSW4gYWRkaXRpb24s IHNvbWUKQEAgLTIyMTAsNiArMjI0NCwxNiBAQCBzdHJ1Y3QgY29tcG9zaXRpb25faXQKIAogc3Ry dWN0IGl0CiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJT T1JTICovCisKKyAgYm9vbF9iZiB6dl9wIDogMTsKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogICAvKiBUaGUgd2luZG93IGluIHdoaWNoIHdlIGl0ZXJhdGUgb3ZlciBjdXJyZW50X2J1 ZmZlciAob3IgYSBzdHJpbmcpLiAgKi8KICAgTGlzcF9PYmplY3Qgd2luZG93OwogICBzdHJ1Y3Qg d2luZG93ICp3OwpkaWZmIC0tZ2l0IGEvc3JjL2ZyaW5nZS5jIGIvc3JjL2ZyaW5nZS5jCmluZGV4 IDYwNjkxODQuLmI1YzJkYzIgMTAwNjQ0Ci0tLSBhL3NyYy9mcmluZ2UuYworKysgYi9zcmMvZnJp bmdlLmMKQEAgLTQzMyw2ICs0MzMsNDAyIEBAIHN0YXRpYyB1bnNpZ25lZCBzaG9ydCBlbXB0eV9s aW5lX2JpdHNbXSA9IHsKICAgMHgwMCwgMHgzYywgMHgwMCwgMHgwMCwgMHgzYywgMHgwMCwgMHgw MCwgMHgzYywgMHgwMH07CiAKIAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBN VUxUSVBMRSBDVVJTT1JTICovCisKKy8qIGArLWZyaW5nZS1oZWxwZXItZGVjaW1hbCcgZGVmaW5l ZCBpbiBgY3Jvc3NoYWlycy5lbGAgKi8KKworLyogMjQKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhl eGFkZWNpbWFsCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4u Li4uLi4iCisgICAgICAieC4ueHguLi4iCisgICAgICAieC4uLnh4Li4iCisgICAgICAieC4uLi54 eC4iCisgICAgICAieC54eHh4eHgiCisgICAgICAieC54eHh4eHgiCisgICAgICAieC4uLi54eC4i CisgICAgICAieC4uLnh4Li4iCisgICAgICAieC4ueHguLi4iCisgICAgICAieC4uLi4uLi4iCisg ICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBz aG9ydCBtY192ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3dfYml0c1tdID17CisgIDB4ODAsIDB4ODAs IDB4ODAsIDB4OTgsIDB4OGMsIDB4ODYsIDB4YmYsCisgIDB4YmYsIDB4ODYsIDB4OGMsIDB4OTgs IDB4ODAsIDB4ODAsIDB4ODB9OworCisvKiAyNQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRl Y2ltYWwKKyAgICAgICJ4eHh4eHh4eCIKKyAgICAgICJ4Li4uLi4ueCIKKyAgICAgICJ4Li4uLi4u eCIKKyAgICAgICJ4Li54eC4ueCIKKyAgICAgICJ4Li4ueHgueCIKKyAgICAgICJ4Li4uLnh4eCIK KyAgICAgICJ4Lnh4eHh4eCIKKyAgICAgICJ4Lnh4eHh4eCIKKyAgICAgICJ4Li4uLnh4eCIKKyAg ICAgICJ4Li4ueHgueCIKKyAgICAgICJ4Li54eC4ueCIKKyAgICAgICJ4Li4uLi4ueCIKKyAgICAg ICJ4Li4uLi4ueCIKKyAgICAgICJ4eHh4eHh4eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0 I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gICAgICJ4Li4uLi4uLiIKKyAgICAgICJ4Li4uLi4uLiIKKyAgICAgICJ4Li4uLi4uLiIK KyAgICAgICJ4Li4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3ZlcnRpY2Fs X2Jhcl9iaXRzW10gPXsKKyAgMHg4MCwgMHg4MCwgMHg4MCwgMHg4MCwgMHg4MCwgMHg4MCwgMHg4 MCwKKyAgMHg4MCwgMHg4MCwgMHg4MCwgMHg4MCwgMHg4MCwgMHg4MCwgMHg4MH07CisKKy8qIDI4 CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Li4uLi4uIgorICAg ICAgInh4Li4uLi4uIgorICAgICAgIiB4eC4uLi4uIgorICAgICAgIi54eC4uLi4uIgorICAgICAg Ii4ueHguLi4uIgorICAgICAgIi4ueHguLi4uIgorICAgICAgIi4uLnh4Li4uIgorICAgICAgIi4u Lnh4Li4uIgorICAgICAgIi4uLi54eC4uIgorICAgICAgIi4uLi54eC4uIgorICAgICAgIi4uLi4u eHguIgorICAgICAgIi4uLi4ueHguIgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4 IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfYmFja3NsYXNoX2JpdHNbXSA9eworICAw eGMwLCAweGMwLCAweGUwLCAweDYwLCAweDMwLCAweDMwLCAweDE4LCAweDE4LCAweGMsIDB4Yywg MHg2LCAweDYsIDB4MywgMHgzfTsKKworLyogMjkKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFk ZWNpbWFsCisgICAgICAieHguLi4uLi4iCisgICAgICAieHguLi4uLi4iCisgICAgICAieHh4Li4u Li4iCisgICAgICAieHh4Li4uLi4iCisgICAgICAieC54eC4uLi4iCisgICAgICAieC54eC4uLi4i CisgICAgICAieC4ueHguLi4iCisgICAgICAieC4ueHguLi4iCisgICAgICAieC4uLnh4Li4iCisg ICAgICAieC4uLnh4Li4iCisgICAgICAieC4uLi54eC4iCisgICAgICAieC4uLi54eC4iCisgICAg ICAieC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9y dCBtY192ZXJ0aWNhbF9iYXJfYmFja3NsYXNoX2JpdHNbXSA9eworICAweGMwLCAweGMwLCAweGUw LCAweGUwLCAweGIwLCAweGIwLCAweDk4LAorICAweDk4LCAweDhjLCAweDhjLCAweDg2LCAweDg2 LCAweDgzLCAweDgzfTsKKworLyogMzAKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFs CisgICAgICAiLnh4eHh4eC4iCisgICAgICAieHh4eC54Li4iCisgICAgICAieHh4eC54Li4iCisg ICAgICAieHh4eC54Li4iCisgICAgICAiLnh4eC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAg ICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAgICAi Li4ueC54Li4iCisgICAgICAiLi4ueC54Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBt Y19waWxjcm93X2JpdHNbXSA9eworICAweDdlLCAweGY0LCAweGY0LCAweGY0LCAweDc0LCAweDE0 LCAweDE0LCAweDE0LCAweDE0LCAweDE0LCAweDE0fTsKKworLyogMzEKKyAgICAoKy1mcmluZ2Ut aGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi54eHh4Li4iCisgICAgICAiLnh4eHh4eC4iCisg ICAgICAieC4ueHguLngiCisgICAgICAieC4ueHguLngiCisgICAgICAieHh4eHh4eHgiCisgICAg ICAieHguLi4ueHgiCisgICAgICAieHh4Li54eHgiCisgICAgICAiLnh4eHh4eC4iCisgICAgICAi Li54eHh4Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zbWlsZXlfZmFjZV9iaXRz W10gPXsKKyAgMHgzYywgMHg3ZSwgMHg5OSwgMHg5OSwgMHhmZiwgMHhjMywgMHhlNywgMHg3ZSwg MHgzY307CisKKy8qIDMyCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAg Ii4ueC4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4u Li4ueC4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC4u Li4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX3JpZ2h0X2Jp dHNbXSA9eworICAweDIwLCAweDEwLCAweDgsIDB4NCwgMHg4LCAweDEwLCAweDIwfTsKKworLyog MzMKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi54Li4iCisg ICAgICAiLi4uLnguLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54Li4uLi4iCisgICAg ICAiLi4ueC4uLi4iCisgICAgICAiLi4uLnguLi4iCisgICAgICAiLi4uLi54Li4iKQorKi8KK3N0 YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zaW5nbGVfYW5nbGVfbGVmdF9iaXRzW10gPXsKKyAgMHg0 LCAweDgsIDB4MTAsIDB4MjAsIDB4MTAsIDB4OCwgMHg0fTsKKworLyogMzQKKyAgICAoKy1mcmlu Z2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHgueHguLi4iCisgICAgICAiLnh4Lnh4Li4i CisgICAgICAiLi54eC54eC4iCisgICAgICAiLi4ueHgueHgiCisgICAgICAiLi54eC54eC4iCisg ICAgICAiLnh4Lnh4Li4iCisgICAgICAieHgueHguLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBz aG9ydCBtY19kb3VibGVfYW5nbGVfcmlnaHRfYml0c1tdID17CisgIDB4ZDgsIDB4NmMsIDB4MzYs IDB4MWIsIDB4MzYsIDB4NmMsIDB4ZDh9OworCisvKiAzNQorICAgICgrLWZyaW5nZS1oZWxwZXIt aGV4YWRlY2ltYWwKKyAgICAgICIuLi54eC54eCIKKyAgICAgICIuLnh4Lnh4LiIKKyAgICAgICIu eHgueHguLiIKKyAgICAgICJ4eC54eC4uLiIKKyAgICAgICIueHgueHguLiIKKyAgICAgICIuLnh4 Lnh4LiIKKyAgICAgICIuLi54eC54eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX2Rv dWJsZV9hbmdsZV9sZWZ0X2JpdHNbXSA9eworICAweDFiLCAweDM2LCAweDZjLCAweGQ4LCAweDZj LCAweDM2LCAweDFifTsKKworLyogMzYKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFs CisgICAgICAieC54LnguLi4iCisgICAgICAiLngueC54Li4iCisgICAgICAiLi54LngueC4iCisg ICAgICAiLi4ueC54LngiCisgICAgICAiLi54LngueC4iCisgICAgICAiLngueC54Li4iCisgICAg ICAieC54LnguLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190cmlwbGVfYW5nbGVf cmlnaHRfYml0c1tdID17CisgIDB4YTgsIDB4NTQsIDB4MmEsIDB4MTUsIDB4MmEsIDB4NTQsIDB4 YTh9OworCisvKiAzNworICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIu Li54LngueCIKKyAgICAgICIuLngueC54LiIKKyAgICAgICIueC54LnguLiIKKyAgICAgICJ4Lngu eC4uLiIKKyAgICAgICIueC54LnguLiIKKyAgICAgICIuLngueC54LiIKKyAgICAgICIuLi54Lngu eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3RyaXBsZV9hbmdsZV9sZWZ0X2JpdHNb XSA9eworICAweDE1LCAweDJhLCAweDU0LCAweGE4LCAweDU0LCAweDJhLCAweDE1fTsKKworLyog MzgKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisg ICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAg ICAiLi4ueC4uLi4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAi eC4uLi4ueC4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4u Li4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19z aW5nbGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MTAs IDB4MjgsIDB4NDQsIDB4ODIsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9OworCisvKiAzOQorICAg ICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIu Li4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICJ4Li4u Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIuLi54Li4u LiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIK KyAgICAgICIuLi4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3NpbmdsZV9h bmdsZV9kb3duX2JpdHNbXSA9eworICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDgyLCAweDQ0 LCAweDI4LCAweDEwLCAweDAwLCAweDAwLCAweDAwLCAweDAwfTsKKworLyogNDAKKyAgICAoKy1m cmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4u Li4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54LnguLi4i CisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisg ICAgICAiLnguLi54Li4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLi4uLi4uLi4iCisgICAg ICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9y dCBtY19kb3VibGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4MDAsIDB4MDAsIDB4MDAsIDB4MTAs IDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4ODIsIDB4MDAsIDB4MDAsIDB4MDB9Owor CisvKiA0MQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4u LiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICJ4Li4uLi54LiIK KyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAg ICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAg ICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIpCisqLworc3Rh dGljIHVuc2lnbmVkIHNob3J0IG1jX2RvdWJsZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAweDAw LCAweDAwLCAweDAwLCAweDgyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDEwLCAw eDAwLCAweDAwLCAweDAwfTsKKworLyogNDIKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNp bWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54LnguLi4i CisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisg ICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAg ICAiLnguLi54Li4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0 YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190cmlwbGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4MDAs IDB4MTAsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4 ODIsIDB4MDB9OworCisvKiA0MworICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAg ICAgICIuLi4uLi4uLiIKKyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAg ICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIu LngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngu eC4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLi4uLi4uLiIpCisqLworc3RhdGljIHVu c2lnbmVkIHNob3J0IG1jX3F1YWRydXBsZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAweDAwLCAw eDgyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDEw LCAweDAwfTsKKworLyogNDQKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAg ICAiLi4ueC4uLi4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAi eC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4u eC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4u eC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4uLi4ueC4i KQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19xdWFkcnVwbGVfYW5nbGVfdXBfYml0c1td ID17CisgIDB4MTAsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4 NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4ODJ9OworCisvKiA0NQorICAgICgrLWZyaW5nZS1oZWxw ZXItaGV4YWRlY2ltYWwKKyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAg ICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIu LngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngu eC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4u LiIKKyAgICAgICIuLi54Li4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3RyaXBs ZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAweDgyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAw eDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDEwfTsKKworLyogVE9E TzogIEFkZCB0aGUgZm9sbG93aW5nIGJpdG1hcHM6CisgIChkZWZpbmUtZnJpbmdlLWJpdG1hcCAn YnJlYWtwb2ludCAiXHgzY1x4N2VceGZmXHhmZlx4ZmZceGZmXHg3ZVx4M2MiKQorICAoZGVmaW5l LWZyaW5nZS1iaXRtYXAgJ2hvbGxvdy1yaWdodC10cmlhbmdsZSAiXHhlMFx4OTBceDg4XHg4NFx4 ODRceDg4XHg5MFx4ZTAiKSAqLworCisvKiBlbmQgTVVMVElQTEUgQ1VSU09SUyAqLworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogI2RlZmluZSBCWVRFU19QRVJfQklUTUFQX1JPVyAgKHNp emVvZiAodW5zaWduZWQgc2hvcnQpKQogI2RlZmluZSBTVEFOREFSRF9CSVRNQVBfSEVJR0hUKGJp dHMpIChzaXplb2YgKGJpdHMpL0JZVEVTX1BFUl9CSVRNQVBfUk9XKQogI2RlZmluZSBGUkJJVFMo Yml0cykgIGJpdHMsIFNUQU5EQVJEX0JJVE1BUF9IRUlHSFQgKGJpdHMpCkBAIC00NjYsNiArODYy LDU5IEBAIHN0YXRpYyBzdHJ1Y3QgZnJpbmdlX2JpdG1hcCBzdGFuZGFyZF9iaXRtYXBzW10gPQog ICB7IEZSQklUUyAodmVydGljYWxfYmFyX2JpdHMpLCAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBf Q0VOVEVSLCAwIH0sCiAgIHsgRlJCSVRTIChob3Jpem9udGFsX2Jhcl9iaXRzKSwgICAgIDgsIDAs IEFMSUdOX0JJVE1BUF9CT1RUT00sIDAgfSwKICAgeyBGUkJJVFMgKGVtcHR5X2xpbmVfYml0cyks ICAgICAgICAgOCwgMywgQUxJR05fQklUTUFQX1RPUCwgICAgMCB9LAorCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgIC8qIDI0ICovCisgIHsg RlJCSVRTIChtY192ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3dfYml0cyksICAgICA4LCAwLCBBTElH Tl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDI1ICovCisgIHsgRlJCSVRTIChtY19ob2xsb3df cmVjdGFuZ2xlX3JpZ2h0X2Fycm93X2JpdHMpLCA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAw IH0sCisgIC8qIDI2ICovCisgIHsgRlJCSVRTIChtY19ob2xsb3dfcmVjdGFuZ2xlX2JpdHMpLCAg ICAgICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDI3ICovCisg IHsgRlJCSVRTIChtY192ZXJ0aWNhbF9iYXJfYml0cyksICAgICAgICAgICAgICAgICA4LCAwLCBB TElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDI4ICovCisgIHsgRlJCSVRTIChtY19iYWNr c2xhc2hfYml0cyksICAgICAgICAgICAgICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVS LCAwIH0sCisgIC8qIDI5ICovCisgIHsgRlJCSVRTIChtY192ZXJ0aWNhbF9iYXJfYmFja3NsYXNo X2JpdHMpLCAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDMwICov CisgIHsgRlJCSVRTIChtY19waWxjcm93X2JpdHMpLCAgICAgICAgICAgICAgICAgICAgICA4LCAw LCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDMxICovCisgIHsgRlJCSVRTIChtY19z bWlsZXlfZmFjZV9iaXRzKSwgICAgICAgICAgICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VO VEVSLCAwIH0sCisgIC8qIDMyICovCisgIHsgRlJCSVRTIChtY19zaW5nbGVfYW5nbGVfcmlnaHRf Yml0cyksICAgICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDMz ICovCisgIHsgRlJCSVRTIChtY19zaW5nbGVfYW5nbGVfbGVmdF9iaXRzKSwgICAgICAgICAgICA4 LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDM0ICovCisgIHsgRlJCSVRTICht Y19kb3VibGVfYW5nbGVfcmlnaHRfYml0cyksICAgICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBf Q0VOVEVSLCAwIH0sCisgIC8qIDM1ICovCisgIHsgRlJCSVRTIChtY19kb3VibGVfYW5nbGVfbGVm dF9iaXRzKSwgICAgICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8q IDM2ICovCisgIHsgRlJCSVRTIChtY190cmlwbGVfYW5nbGVfcmlnaHRfYml0cyksICAgICAgICAg ICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDM3ICovCisgIHsgRlJCSVRT IChtY190cmlwbGVfYW5nbGVfbGVmdF9iaXRzKSwgICAgICAgICAgICA4LCAwLCBBTElHTl9CSVRN QVBfQ0VOVEVSLCAwIH0sCisgIC8qIDM4ICovCisgIHsgRlJCSVRTIChtY19zaW5nbGVfYW5nbGVf dXBfYml0cyksICAgICAgICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisg IC8qIDM5ICovCisgIHsgRlJCSVRTIChtY19zaW5nbGVfYW5nbGVfZG93bl9iaXRzKSwgICAgICAg ICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDQwICovCisgIHsgRlJC SVRTIChtY19kb3VibGVfYW5nbGVfdXBfYml0cyksICAgICAgICAgICAgICA4LCAwLCBBTElHTl9C SVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDQxICovCisgIHsgRlJCSVRTIChtY19kb3VibGVfYW5n bGVfZG93bl9iaXRzKSwgICAgICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0s CisgIC8qIDQyICovCisgIHsgRlJCSVRTIChtY190cmlwbGVfYW5nbGVfdXBfYml0cyksICAgICAg ICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDQzICovCisgIHsg RlJCSVRTIChtY190cmlwbGVfYW5nbGVfZG93bl9iaXRzKSwgICAgICAgICAgICA4LCAwLCBBTElH Tl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDQ0ICovCisgIHsgRlJCSVRTIChtY19xdWFkcnVw bGVfYW5nbGVfdXBfYml0cyksICAgICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAw IH0sCisgIC8qIDQ1ICovCisgIHsgRlJCSVRTIChtY19xdWFkcnVwbGVfYW5nbGVfZG93bl9iaXRz KSwgICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKIH07CiAKICNkZWZpbmUgTk9fRlJJTkdFX0JJVE1BUCAwCkBAIC0x NzE1LDYgKzIxNjQsMTUwIEBAIElmIG5pbCwgYWxzbyBjb250aW51ZSBsaW5lcyB3aGljaCBhcmUg ZXhhY3RseSBhcyB3aWRlIGFzIHRoZSB3aW5kb3cuICAqLyk7CiAgIERFRlZBUl9MSVNQICgiZnJp bmdlLWJpdG1hcHMiLCBWZnJpbmdlX2JpdG1hcHMsCiAgICAgZG9jOiAvKiBMaXN0IG9mIGZyaW5n ZSBiaXRtYXAgc3ltYm9scy4gICovKTsKICAgVmZyaW5nZV9iaXRtYXBzID0gUW5pbDsKKworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExFIENVUlNPUlMgKi8KKwor ICAvKiAoZ2V0ICdlbXB0eS1saW5lICdmcmluZ2UpID0+IDIzID0+IHRoZSBsYXN0IHN0YW5kYXJk LWJpdG1hcCBiZWZvcmUgdGhpcyBvbmUuCisgIFNlZSBgZnJpbmdlLmVsYC4gKi8KKworICAvKiAy NCAqLworICBERUZTWU0gKFFtY192ZXJ0aWNhbF9iYXJfcmlnaHR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Ym9hcmQuYwpAQCAt MTIyNCw2ICsxMjI0LDI5IEBAIHN0YXRpYyBpbnQgcmVhZF9rZXlfc2VxdWVuY2UgKExpc3BfT2Jq ZWN0ICosIExpc3BfT2JqZWN0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCwg Ym9vbCwgYm9vbCwgYm9vbCk7CiBzdGF0aWMgdm9pZCBhZGp1c3RfcG9pbnRfZm9yX3Byb3BlcnR5 IChwdHJkaWZmX3QsIGJvb2wpOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUgQ1VSU09SUyAqLworCitzdGF0aWMgdm9pZAora2JkX21jX2FjdGl2YXRlX211bHRpcGxl X2N1cnNvcnMgKHZvaWQpCit7CisgIHN0cnVjdCB3aW5kb3cgKncgPSBkZWNvZGVfbGl2ZV93aW5k b3cgKHNlbGVjdGVkX3dpbmRvdyk7CisgIHctPm1jLmRyYXdfbXVsdGlwbGVfY3Vyc29ycyA9IHRy dWU7CisgIHctPm1jLmVyYXNlX211bHRpcGxlX2N1cnNvcnMgPSB0cnVlOworfQorCitzdGF0aWMg dm9pZAora2JkX21jX2FjdGl2YXRlX2Nyb3NzaGFpcnMgKHZvaWQpCit7CisgIHN0cnVjdCB3aW5k b3cgKncgPSBkZWNvZGVfbGl2ZV93aW5kb3cgKHNlbGVjdGVkX3dpbmRvdyk7CisgIHctPm1jLmRy YXdfY3Jvc3NoYWlycyA9IHRydWU7CisgIHctPm1jLmVyYXNlX2Nyb3NzaGFpcnMgPSB0cnVlOwor fQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiBMaXNwX09iamVjdAogY29tbWFuZF9s b29wXzEgKHZvaWQpCiB7CkBAIC0xNDE5LDYgKzE0NDIsMTUgQEAgY29tbWFuZF9sb29wXzEgKHZv aWQpCiAgICAgICBWcmVhbF90aGlzX2NvbW1hbmQgPSBjbWQ7CiAgICAgICBzYWZlX3J1bl9ob29r cyAoUXByZV9jb21tYW5kX2hvb2spOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyog TVVMVElQTEUgQ1VSU09SUyAqLworCisgICAgICBrYmRfbWNfYWN0aXZhdGVfbXVsdGlwbGVfY3Vy c29ycyAoKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgYWxyZWFkeV9h ZGp1c3RlZCA9IDA7CiAKICAgICAgIGlmIChOSUxQIChWdGhpc19jb21tYW5kKSkKQEAgLTI0NDgs NyArMjQ4MCw3IEBAIHJlYWRfY2hhciAoaW50IGNvbW1hbmRmbGFnLCBMaXNwX09iamVjdCBtYXAs CiAJICBpZiAoaGVscF9lY2hvX3Nob3dpbmdfcCAmJiAhRVEgKHNlbGVjdGVkX3dpbmRvdywgbWlu aWJ1Zl93aW5kb3cpKQogCSAgICByZWRpc3BsYXlfcHJlc2VydmVfZWNob19hcmVhICg1KTsKIAkg IGVsc2UKLQkgICAgcmVkaXNwbGF5ICgpOworCSAgICByZWRpc3BsYXkgKDEpOwogCiAJICBpZiAo IWlucHV0X3BlbmRpbmcpCiAJICAgIC8qIE5vcm1hbCBjYXNlOiBubyBpbnB1dCBhcnJpdmVkIGR1 cmluZyByZWRpc3BsYXkuICAqLwpAQCAtMjYyOCw3ICsyNjYwLDcgQEAgcmVhZF9jaGFyIChpbnQg Y29tbWFuZGZsYWcsIExpc3BfT2JqZWN0IG1hcCwKICAgICB7CiAgICAgICBGZG9fYXV0b19zYXZl IChRbmlsLCBRbmlsKTsKICAgICAgIC8qIEhvb2tzIGNhbiBhY3R1YW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ioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworICByLm9yaWdpbi54ID0g KHctPm1jLmZ4ID4gMCkKKyAgICAgICAgICAgICAgID8gdy0+bWMuZngKKyAgICAgICAgICAgICAg IDogZng7CisgIHIub3JpZ2luLnkgPSAody0+bWMuZnkgPiAwKQorICAgICAgICAgICAgICAgPyB3 LT5tYy5meQorICAgICAgICAgICAgICAgOiBmeTsKKyAgci5zaXplLmhlaWdodCA9ICh3LT5tYy5o ID4gMCkKKyAgICAgICAgICAgICAgICAgID8gdy0+bWMuaAorICAgICAgICAgICAgICAgICAgOiBo OwogICByLnNpemUud2lkdGggPSB3LT5waHlzX2N1cnNvcl93aWR0aDsKIAorLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisKKwogICAvKiBQcmV2ZW50IHRoZSBjdXJzb3IgZnJvbSBiZWluZyBkcmF3 biBvdXRzaWRlIHRoZSB0ZXh0IGFyZWEuICAqLwogICBuc19jbGlwX3RvX3JvdyAodywgZ2x5cGhf cm93LCBURVhUX0FSRUEsIE5PKTsgLyogZG8gbnNfZm9jdXMoZiwgJnIsIDEpOyBpZiByZW1vdmUg Ki8KIAogCiAgIGZhY2UgPSBGQUNFX0ZST01fSURfT1JfTlVMTCAoZiwgcGh5c19jdXJzb3JfZ2x5 cGgtPmZhY2VfaWQpOwotICBpZiAoZmFjZSAmJiBOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpCi0g ICAgICA9PSBuc19pbmRleF9jb2xvciAoRlJBTUVfQ1VSU09SX0NPTE9SIChmKSwgZikpCi0gICAg ewotICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQgKGZh Y2UpLCBmKSBzZXRdOwotICAgICAgaG9sbG93X2NvbG9yID0gRlJBTUVfQ1VSU09SX0NPTE9SIChm KTsKLSAgICB9Ci0gIGVsc2UKLSAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChmKSBzZXRdOworCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4gTVVMVElQTEUgQ1VSU09SUyAqLwor CisvKiBFWEFNUExFIE9GIEhPVyBUTyBMT09LLVVQIEEgQ09MT1I6CisgIGVudW0gZmFjZV9pZCBm YWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistdmVydGljYWwtYmFy LWZhY2UiKSwgdHJ1ZSk7CisgIHN0cnVjdCBmYWNlICpmYWNlID0gRkFDRV9GUk9NX0lEIChmLCBm YWNlX2lkKTsKKyAgTlNDb2xvciAqY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNf RkFDRV9GT1JFR1JPVU5EIChmYWNlKSwgZik7CisgIExpc3BfT2JqZWN0IGZvcmVncm91bmQgPSBm YWNlLT5sZmFjZVtMRkFDRV9GT1JFR1JPVU5EX0lOREVYXTsKKyAgTGlzcF9PYmplY3QgYmFja2dy b3VuZCA9IGZhY2UtPmxmYWNlW0xGQUNFX0JBQ0tHUk9VTkRfSU5ERVhdOworICBmcHJpbnRmIChz dGRlcnIsICJcbmZvcmVncm91bmQgKCVzKSB8IGJhY2tncm91bmQgKCVzKVxuIiwKKyAgICAgICAg ICAgICAgICAgICAoIU5JTFAgKGZvcmVncm91bmQpID8gU1NEQVRBIChmb3JlZ3JvdW5kKSA6ICJO SUxQIiksCisgICAgICAgICAgICAgICAgICAgKCFOSUxQIChiYWNrZ3JvdW5kKSA/IFNTREFUQSAo YmFja2dyb3VuZCkgOiAiTklMUCIpKTsgKi8KKworICBpZiAody0+bWMuZ2x5cGhfZmxhdm9yID09 IE1DX0dMWVBICisgICAgICB8fCB3LT5tYy5nbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEhMRVNTCisg ICAgICB8fCB3LT5tYy5nbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEhfVEFCKQorICAgIHsKKyAgICAg IFtbTlNDb2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiB3LT5tYy5yZWQgZ3JlZW46IHctPm1j LmdyZWVuIGJsdWU6IHctPm1jLmJsdWUgYWxwaGE6IDEuMF0gc2V0XTsKKyAgICAgIExpc3BfT2Jq ZWN0IGJ1ZiA9IHctPmNvbnRlbnRzOworICAgICAgQ0hFQ0tfQlVGRkVSIChidWYpOworICAgICAg c3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKGJ1Zik7CisgICAgICBib29sIHJlZ2lvbl9hY3Rp dmVfcCA9ICghTklMUCAoVnRyYW5zaWVudF9tYXJrX21vZGUpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgbWFya19hY3RpdmUpKSk7CisgICAgICBwdHJk aWZmX3QgcmVnaW9uX2JlZ2lubmluZyA9IChyZWdpb25fYWN0aXZlX3ApID8gWElOVCAoRnJlZ2lv bl9iZWdpbm5pbmcgKCkpIDogLTE7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2VuZCA9IChyZWdp b25fYWN0aXZlX3ApID8gWElOVCAoRnJlZ2lvbl9lbmQgKCkpIDogLTE7CisgICAgICBib29sIHJl Z2lvbl9pbl9ib3VuZHNfcCA9IChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPm1jLnBvc2ludCA+PSByZWdpb25fYmVnaW5uaW5nCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5tYy5wb3NpbnQgPCByZWdpb25fZW5kKTsK KyAgICAgIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAmJiByZWdpb25faW5fYm91bmRz X3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gICAgICAg eworICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCA9 IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItaW5h Y3RpdmUtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93 X2luYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lk KTsKKyAgICAgICAgICAgICAgICBOU0NvbG9yICpob2xsb3dfaW5hY3RpdmVfY29sb3IgPSBuc19s b29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5EIChob2xsb3dfaW5hY3RpdmVf ZmFjZSksIGYpOworICAgICAgICAgICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19pbmFjdGl2 ZV9jb2xvcjsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlIGlmIChmYWNlICYm IE5TX0ZBQ0VfQkFDS0dST1VORCAoZmFjZSkgPT0gbnNfaW5kZXhfY29sb3IgKEZSQU1FX0NVUlNP Ul9DT0xPUiAoZiksIGYpKQorICAgICAgICAgICAgICAgIGhvbGxvd19jb2xvciA9IEZSQU1FX0NV UlNPUl9DT0xPUiAoZik7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqZGVmYXVsdF9iZ19mYWNlID0gRkFD RV9GUk9NX0lEIChmLCBERUZBVUxUX0ZBQ0VfSUQpOworICAgICAgICAgICAgICAgICAgICBbbnNf bG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoZGVmYXVsdF9iZ19mYWNl KSwgZikgc2V0XTsKKyAgICAgICAgICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gRlJBTUVfQ1VS U09SX0NPTE9SIChmKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZiAo ZmFjZSAmJiBOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpID09IG5zX2luZGV4X2NvbG9yIChGUkFN RV9DVVJTT1JfQ09MT1IgKGYpLCBmKSkKKyAgICAgIHsKKyAgICAgICAgW25zX2xvb2t1cF9pbmRl eGVkX2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQgKGZhY2UpLCBmKSBzZXRdOworICAgICAgICBo b2xsb3dfY29sb3IgPSBGUkFNRV9DVVJTT1JfQ09MT1IgKGYpOworICAgICAgfQorICAgICAgZWxz ZQorICAgICAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChmKSBzZXRdOworCisvKiBlbmQgTVVMVElQ TEUgQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKIAogI2lmZGVmIE5TX0lN UExfQ09DT0EKICAgLyogVE9ETzogVGhpcyBtYWtlcyBkcmF3aW5nIG9mIGN1cnNvciBwbHVzIHRo YXQgb2YgcGh5c19jdXJzb3JfZ2x5cGgKQEAgLTMyODksMjEgKzMzNzgsNDUgQEAgTm90ZSB0aGF0 IENVUlNPUl9XSURUSCBpcyBtZWFuaW5nZnVsIG9ubHkgZm9yIChoKWJhciBjdXJzb3JzLgogICAg ICAgYnJlYWs7CiAgICAgY2FzZSBCQVJfQ1VSU09SOgogICAgICAgcyA9IHI7CisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgICAvKiBAbGF3 bGlzdCBpcyBmb2N1c2luZyB0aGUgaW5pdGlhbCBkZXZlbG9wbWVudCBvZiBmZWF0dXJlIHJlcXVl c3RzICMxNzY4NAorICAgIGFuZCAjMjI4NzMgb24gTDJSIGxhbmd1YWdlcy4gKi8KKyAgICBpZiAo dy0+bWMuZ2x5cGhfZmxhdm9yICE9IE1DX0dMWVBICisgICAgICAgICYmIHctPm1jLmdseXBoX2Zs YXZvciAhPSBNQ19HTFlQSExFU1MKKyAgICAgICAgJiYgdy0+bWMuZ2x5cGhfZmxhdm9yICE9IE1D X0dMWVBIX1RBQikKKyAgICAgIHsKICAgICAgIC8qIElmIHRoZSBjaGFyYWN0ZXIgdW5kZXIgY3Vy c29yIGlzIFIyTCwgZHJhdyB0aGUgYmFyIGN1cnNvcgogICAgICAgICAgb24gdGhlIHJpZ2h0IG9m IGl0cyBnbHlwaCwgcmF0aGVyIHRoYW4gb24gdGhlIGxlZnQuICAqLwogICAgICAgY3Vyc29yX2ds eXBoID0gZ2V0X3BoeXNfY3Vyc29yX2dseXBoICh3KTsKICAgICAgIGlmICgoY3Vyc29yX2dseXBo LT5yZXNvbHZlZF9sZXZlbCAmIDEpICE9IDApCiAgICAgICAgIHMub3JpZ2luLnggKz0gY3Vyc29y X2dseXBoLT5waXhlbF93aWR0aCAtIHMuc2l6ZS53aWR0aDsKKyAgICAgIH0KKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKIAogICAgICAgTlNSZWN0RmlsbCAocyk7CiAgICAgICBicmVhazsK ICAgICB9CiAgIG5zX3VuZm9jdXMgKGYpOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUgQ1VSU09SUyAqLworCiAgIC8qIGRyYXcgdGhlIGNoYXJhY3RlciB1bmRlciB0 aGUgY3Vyc29yICovCi0gIGlmIChjdXJzb3JfdHlwZSAhPSBOT19DVVJTT1IpCisgIGlmIChjdXJz b3JfdHlwZSAhPSBOT19DVVJTT1IKKyAgICAgICYmIHctPm1jLmdseXBoX2ZsYXZvciAhPSBNQ19H TFlQSExFU1MKKyAgICAgICYmIHctPm1jLmdseXBoX2ZsYXZvciAhPSBNQ19HTFlQSF9UQUIpCiAg ICAgZHJhd19waHlzX2N1cnNvcl9nbHlwaCAodywgZ2x5cGhfcm93LCBEUkFXX0NVUlNPUik7CiAK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICNpZmRlZiBOU19JTVBMX0NPQ09BCiAgIE5T RW5hYmxlU2NyZWVuVXBkYXRlcyAoKTsKICNlbmRpZgpkaWZmIC0tZ2l0IGEvc3JjL3czMnRlcm0u YyBiL3NyYy93MzJ0ZXJtLmMKaW5kZXggZmYwZDJiZi4uMDJmODcyOSAxMDA2NDQKLS0tIGEvc3Jj L3czMnRlcm0uYworKysgYi9zcmMvdzMydGVybS5jCkBAIC05NzMsNiArOTczLDIwIEBAIHN0YXRp YyB2b2lkIHczMl9kcmF3X2JveF9yZWN0IChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICosIGludCwgaW50 LCBpbnQsIGludCwKIHN0YXRpYyB2b2lkCiB4X3NldF9jdXJzb3JfZ2MgKHN0cnVjdCBnbHlwaF9z dHJpbmcgKnMpCiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBD VVJTT1JTICovCisKKyAgaWYgKHMtPnctPm1jLmN1cnNvcl9nY19kZWZhdWx0KQorICAgIHsKKyAg ICAgIHMtPmdjID0gcy0+Zi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2M7CisgICAgICByZXR1 cm47CisgICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIGlmIChzLT5mb250 ID09IEZSQU1FX0ZPTlQgKHMtPmYpCiAgICAgICAmJiBzLT5mYWNlLT5iYWNrZ3JvdW5kID09IEZS QU1FX0JBQ0tHUk9VTkRfUElYRUwgKHMtPmYpCiAgICAgICAmJiBzLT5mYWNlLT5mb3JlZ3JvdW5k ID09IEZSQU1FX0ZPUkVHUk9VTkRfUElYRUwgKHMtPmYpCkBAIC01NjkwLDYgKzU3MDQsMjYgQEAg eF9kcmF3X2hvbGxvd19jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cg KnJvdykKIAogICAvKiBDb21wdXRlIGZyYW1lLXJlbGF0aXZlIGNvb3JkaW5hdGVzIGZvciBwaHlz IGN1cnNvci4gICovCiAgIGdldF9waHlzX2N1cnNvcl9nZW9tZXRyeSAodywgcm93LCBjdXJzb3Jf Z2x5cGgsICZsZWZ0LCAmdG9wLCAmaCk7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisv KiBNVUxUSVBMRSBDVVJTT1JTICovCisKKy8qIExFR0VORDoKKworLSAgdG9wIHkgPT0gV0lORE9X X1RPX0ZSQU1FX1BJWEVMX1kgKHcsIHJvdy0+eSkKKworLSAgYm90dG9tIHkgPT0gV0lORE9XX1RP X0ZSQU1FX1BJWEVMX1kgKHcsIHJvdy0+eSkgLSByb3ctPmhlaWdodAorCistICBoIG9mIEhPTExP V19CT1hfQ1VSU09SID09IHJvdy0+aGVpZ2h0CisgICBbVGhpcyBhdm9pZHMgYSB2aXNpYmxlIGdh cCBhYm92ZS9iZWxvdy5dICovCisKKyAgaWYgKHctPm1jLmggPiAwKQorICAgIGggPSByb3ctPmhl aWdodDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICByZWN0LmxlZnQgPSBsZWZ0 OwogICAvKiBXaGVuIG9uIFIyTCBjaGFyYWN0ZXIsIHNob3cgY3Vyc29yIGF0IHRoZSByaWdodCBl ZGdlIG9mIHRoZQogICAgICBnbHlwaCwgdW5sZXNzIHRoZSBjdXJzb3IgYm94IGlzIGFzIHdpZGUg YXMgdGhlIGdseXBoIG9yIHdpZGVyCkBAIC01NzUzLDcgKzU3ODcsMTcgQEAgeF9kcmF3X2Jhcl9j dXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKIAkgaW52aXNp YmxlLiAgVXNlIHRoZSBnbHlwaCdzIGZvcmVncm91bmQgY29sb3IgaW5zdGVhZCBpbiB0aGlzCiAJ IGNhc2UsIG9uIHRoZSBhc3N1bXB0aW9uIHRoYXQgdGhlIGdseXBoJ3MgY29sb3JzIGFyZSBjaG9z ZW4gc28KIAkgdGhhdCB0aGUgZ2x5cGggaXMgbGVnaWJsZS4gICovCi0gICAgICBpZiAoZmFjZS0+ YmFja2dyb3VuZCA9PSBjdXJzb3JfY29sb3IpCisKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgICAgIGlmIChmYWNlLT5iYWNrZ3JvdW5kID09 IGN1cnNvcl9jb2xvcgorICAgICAgICAgICYmICF3LT5tYy5jdXJzb3JfZ2NfaW52aXNpYmxlX29r YXkpCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAljdXJzb3JfY29sb3IgPSBmYWNl LT5mb3JlZ3JvdW5kOwogCiAgICAgICB4ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAo dywgdy0+cGh5c19jdXJzb3IueCk7CkBAIC01Nzc0LDYgKzU4MTgsMTcgQEAgeF9kcmF3X2Jhcl9j dXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKIAkgIGlmICgo Y3Vyc29yX2dseXBoLT5yZXNvbHZlZF9sZXZlbCAmIDEpICE9IDApCiAJICAgIHggKz0gY3Vyc29y X2dseXBoLT5waXhlbF93aWR0aCAtIHdpZHRoOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgICAgLyogQWxpZ24gYWxsIGZha2UgQkFSX0NV UlNPUiBvZiB0aGUgVkVSVElDQUxfUlVMRVIgd2l0aCBgb3BvaW50X3gnLiAqLworICAgIGlmICh3 LT5tYy5meCA+IDApCisgICAgICB4ID0gdy0+bWMuZng7CisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKIAkgIHczMl9maWxsX2FyZWEgKGYsIGhkYywgY3Vyc29yX2NvbG9yLCB4LAogCQkJ IFdJTkRPV19UT19GUkFNRV9QSVhFTF9ZICh3LCB3LT5waHlzX2N1cnNvci55KSwKIAkJCSB3aWR0 aCwgcm93LT5oZWlnaHQpOwpAQCAtNTg5NSwzMSArNTk1MCwxNTkgQEAgdzMyX2RyYXdfd2luZG93 X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqZ2x5cGhfcm93LAog CSAgcmV0dXJuOwogCX0KIAotICAgICAgc3dpdGNoIChjdXJzb3JfdHlwZSkKLQl7Ci0JY2FzZSBI T0xMT1dfQk9YX0NVUlNPUjoKLQkgIHhfZHJhd19ob2xsb3dfY3Vyc29y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ID0gWElOVCAoRnRydW5jYXRlIChtYWtlX2Zsb2F0ICh0ZXJtX2dyZWVuKSwgUW5p bCkpOzsKKyAgaW50IGludF9ibHVlID0gWElOVCAoRnRydW5jYXRlIChtYWtlX2Zsb2F0ICh0ZXJt X2JsdWUpLCBRbmlsKSk7OworICBDT0xPUlJFRiBjb2xvcl9waXhlbCA9IFBBTEVUVEVSR0IgKGlu dF9yZWQsIGludF9ncmVlbiwgaW50X2JsdWUpOworICBzd2l0Y2ggKGN1cnNvcl90eXBlKQorICB7 CisgICAgY2FzZSBIT0xMT1dfQk9YX0NVUlNPUjoKKyAgICB7CisgICAgICBpZiAody0+bWMucmVk ID49IDAgJiYgdy0+bWMuYmx1ZSA+PSAwICYmIHctPm1jLmdyZWVuID49IDApCisgICAgICAgIHsK KyAgICAgICAgICBYR0NWYWx1ZXMgZ2NfdmFsdWVzOworICAgICAgICAgIHVuc2lnbmVkIGxvbmcg bWFzayA9IEdDRm9udCB8IEdDRm9yZWdyb3VuZCB8IEdDQmFja2dyb3VuZDsKKyAgICAgICAgICBn Y192YWx1ZXMuZm9udCA9IEZSQU1FX0ZPTlQgKGYpOworICAgICAgICAgIHN0cnVjdCBmYWNlICpk ZWZhdWx0X2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIERFRkFVTFRfRkFDRV9JRCk7CisgICAgICAg ICAgTGlzcF9PYmplY3QgYnVmID0gdy0+Y29udGVudHM7CisgICAgICAgICAgQ0hFQ0tfQlVGRkVS IChidWYpOworICAgICAgICAgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSIChidWYpOworICAg ICAgICAgIGJvb2wgcmVnaW9uX2FjdGl2ZV9wID0gKCFOSUxQIChWdHJhbnNpZW50X21hcmtfbW9k ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwg bWFya19hY3RpdmUpKSk7CisgICAgICAgICAgcHRyZGlmZl90IHJlZ2lvbl9iZWdpbm5p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gICAgICAgICAgIGdjX3ZhbHVlcy5mb3JlZ3JvdW5k ID0gZGVmYXVsdF9mYWNlLT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICBnY192YWx1ZXMuYmFj a2dyb3VuZCA9IGhvbGxvd19hY3RpdmVfcmVnaW9uX2ZhY2UtPmJhY2tncm91bmQ7CisgICAgICAg ICAgICB9CisgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAg ICAgICAgICAgICYmICFyZWdpb25faW5fYm91bmRzX3AKKyAgICAgICAgICAgICAgICAgICAgICYm IGFjdGl2ZV9wKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lk IGhvbGxvd19hY3RpdmVfcmVnaW9uX291dF9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcs IGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1yZWdpb24tZmFjZSIpLCB0cnVlKTsKKyAg ICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9yZWdpb25fb3V0X2ZhY2Ug PSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfcmVnaW9uX291dF9mYWNlX2lkKTsKKyAg ICAgICAgICAgICAgICBnY192YWx1ZXMuZm9yZWdyb3VuZCA9IGRlZmF1bHRfZmFjZS0+Zm9yZWdy b3VuZDsKKyAgICAgICAgICAgICAgICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IGhvbGxvd19hY3Rp dmVfcmVnaW9uX291dF9mYWNlLT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgIGVsc2UgaWYgKCFyZWdpb25fYWN0aXZlX3AgJiYgYWN0aXZlX3ApCisgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfZmFj ZV9pZCA9IGxvb2t1cF9uYW1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JfZ2x5cGgg KHcsIGdseXBoX3JvdywgRFJBV19DVVJTT1IpOworICAgICAgICAgIHctPm1jLmN1cnNvcl9nY19k ZWZhdWx0ID0gZmFsc2U7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2Mg PSBvcmlnaW5hbF9jdXJzb3JfZ2M7CisgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAg ICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgZHJhd19waHlzX2N1cnNvcl9nbHlwaCAodywg Z2x5cGhfcm93LCBEUkFXX0NVUlNPUik7CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBC QVJfQ1VSU09SOgorICAgIHsKKyAgICAgIGlmICh3LT5tYy5yZWQgPj0gMCAmJiB3LT5tYy5ibHVl ID49IDAgJiYgdy0+bWMuZ3JlZW4gPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBv cmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAg ICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOwor ICAgICAgICAgIHctPm1jLmN1cnNvcl9nY19pbnZpc2libGVfb2theSA9IHRydWU7CisgICAgICAg ICAgeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIGdseXBoX3JvdywgY3Vyc29yX3dpZHRoLCBCQVJfQ1VS U09SKTsKKyAgICAgICAgICB3LT5tYy5jdXJzb3JfZ2NfaW52aXNpYmxlX29rYXkgPSBmYWxzZTsK KyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1 cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeF9kcmF3X2Jh cl9jdXJzb3IgKHcsIGdseXBoX3JvdywgY3Vyc29y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UlNPUik7Ci0JICBicmVhazsKKy8qIGVuZCBNVUxUSVBMRSBDVVJTT1JTICovCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KIAotCWNhc2UgTk9fQ1VSU09SOgotCSAgdy0+cGh5c19jdXJz b3Jfd2lkdGggPSAwOwotCSAgYnJlYWs7CiAKLQlkZWZhdWx0OgotCSAgZW1hY3NfYWJvcnQgKCk7 Ci0JfQogICAgIH0KIH0KIApkaWZmIC0tZ2l0IGEvc3JjL3dpbmRvdy5oIGIvc3JjL3dpbmRvdy5o CmluZGV4IDAxMzA4M2UuLjU3M2UzNTkgMTAwNjQ0Ci0tLSBhL3NyYy93aW5kb3cuaAorKysgYi9z cmMvd2luZG93LmgKQEAgLTc2LDYgKzc2LDU2IEBAIG9uZSBhbmQgdGhlIHNhbWUsIHNvIGl0cyBw cmV2IGFuZCBuZXh0IG1lbWJlcnMgYXJlIG5pbC4KIAogQSBkZWFkIHdpbmRvdyBoYXMgaXRzIGNv bnRlbnRzIGZpZWxkIHNldCB0byBuaWwuICAqLwogCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogYmVnaW4gTVVMVElQTEUgQ1VSU09SUyAqLworCisvKiBTdWZmaXhlcyBmb3IgdGhlIGBt Y2Agd2luZG93IHBvaW50ZXIgcHJlZml4LiAqLworc3RydWN0IG11bHRpcGxlX2N1cnNvcnMKK3sK KyAgLyogVmFsdWVzIGZvciBwcmV2aW91cyBhbmQgY3VycmVudCBgd2luZG93LXN0YXJ0JyBhbmQg YHdpbmRvdy1lbmQnLiAqLworICBFTUFDU19JTlQgY3VycmVudF9zdGFydCwgY3VycmVudF9lbmQs IHByZXZpb3VzX3N0YXJ0LCBwcmV2aW91c19lbmQsIGN1cnJlbnRfeCwgcHJldmlvdXNfeD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X2JmIGVyYXNlX2Nyb3NzaGFpcnMgOiAxOworCisgIC8qIFRoZSBmbGF2b3Igb2Yg dGhlIGdseXBoIHVzZWQgYnkgYGRyYXdfd2luZG93X2N1cnNvcicuICovCisgIGludCBnbHlwaF9m bGF2b3I7CisKKyAgLyogTC5TLkwuIGNvbG9ycy4gKi8KKyAgZG91YmxlIHJlZCwgZ3JlZW4sIGJs dWU7CisKKyAgLyogVGhlIGJ1ZmZlciBwb3NpdGlvbiBwb2ludCBvZiBhIGZha2UgY3Vyc29yLiAq LworICBpbnQgcG9zaW50OworCisgIC8qIFBpeGVsIHBvc2l0aW9uICh3aW5kb3cgcmVsYXRpdmUp IG9mIGhvcml6b250YWwvdmVydGljYWwgcnVsZXJzLiAqLworICBpbnQgZngsIGZ5LCBoOworCisg IC8qIFJlY29yZCBGUk9NX1dIRVJFIHdoZW4gYHJlZGlzcGxheV9wcmVzZXJ2ZV9lY2hvX2FyZWEn IGlzIGNhbGxlZC4gKi8KKyAgaW50IHJlZGlzcGxheV9wcmVzZXJ2ZV9lY2hvX2FyZWE7Cit9Owor CisvKiBlbmQgTVVMVElQTEUgQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisK Kwogc3RydWN0IGN1cnNvcl9wb3MKIHsKICAgLyogUGl4ZWwgcG9zaXRpb24uICBUaGVzZSBhcmUg YWx3YXlzIHdpbmRvdyByZWxhdGl2ZS4gICovCkBAIC0xODEsNiArMjMxLDIyIEBAIHN0cnVjdCB3 aW5kb3cKICAgICAvKiBUaGUgaGVscCBlY2hvIHRleHQgZm9yIHRoaXMgd2luZG93LiAgUW5pbCBp ZiB0aGVyZSdzIG5vbmUuICAqLwogICAgIExpc3BfT2JqZWN0IG1vZGVfbGluZV9oZWxwX2VjaG87 CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisK KyAgICAvKiBUaGUgY2FjaGUgZm9yIG11bHRpcGxlIGdseXBoIGN1cnNvcnMuICBGb3IgYW4gZXhh bXBsZSBvZiB0aGUgc3RydWN0dXJlIG9mCisgICAgdGhlIGxpc3QsIHNlZSB0aGUgY29tbWVudHMg YXQgdGhlIGJlZ2lubmluZyBvZiBgbWNfY2FsYycgaW4geGRpc3AuYy4gICovCisgICAgTGlzcF9P YmplY3QgbXVsdGlwbGVfY3Vyc29yc19jYWNoZTsKKworICAgIC8qIFRoZSBjYWNoZSBmb3IgbXVs dGlwbGUgZ2x5cGgvZ2x5cGhsZXNzIGN1cnNvcnMgdGhhdCBmb3JtIGNyb3NzaGFpcnMuICBGb3Ig YW4KKyAgICBleGFtcGxlIG9mIHRoZSBzdHJ1Y3R1cmUgb2YgdGhlIGxpc3QsIHNlZSB0aGUgY29t bWVudHMgYXQgdGhlIGJlZ2lubmluZyBvZgorICAgIGBtY19jcm9zc2hhaXJzJyBpbiB4ZGlzcC5j LiAgKi8KKyAgICBMaXNwX09iamVjdCBjcm9zc2hhaXJzX2NhY2hlOworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKworCiAgICAgLyogTm8gTGlzcCBkYXRhIG1heSBmb2xsb3cgYmVsb3cgdGhp cyBwb2ludCB3aXRob3V0IGNoYW5naW5nCiAgICAgICAgbWFya19vYmplY3QgaW4gYWxsb2MuYy4g IFRoZSBtZW1iZXIgY3VycmVudF9tYXRyaXggbXVzdCBiZSB0aGUKICAgICAgICBmaXJzdCBub24t TGlzcCBtZW1iZXIuICAqLwpAQCAtMjgzLDYgKzM0OSwxNiBAQCBzdHJ1Y3Qgd2luZG93CiAKICNp ZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFIENVUlNPUlMgKi8KKworICAgIC8qIFRoZSBwcmVmaXggZm9yIHdpbmRvdyBwb2lu dGVycyByZWxhdGluZyB0byBtdWx0aXBsZSBjdXJzb3JzLiAgKi8KKyAgICBzdHJ1Y3QgbXVsdGlw bGVfY3Vyc29ycyBtYzsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgIC8qIEN1 cnNvciB0eXBlIG9mIGxhc3QgY3Vyc29yIGRyYXduIG9uIHRoZSB3aW5kb3cuICAqLwogICAgIGVu dW0gdGV4dF9jdXJzb3Jfa2luZHMgcGh5c19jdXJzb3JfdHlwZTsKIApAQCAtNDIxLDYgKzQ5Nywy NSBAQCBYV0lORE9XIChMaXNwX09iamVjdCBhKQogICByZXR1cm4gWFVOVEFHIChhLCBMaXNwX1Zl Y3Rvcmxpa2UsIHN0cnVjdCB3aW5kb3cpOwogfQogCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCitJTkxJTkUgdm9pZAord3NldF9tdWx0aXBsZV9j dXJzb3JzX2NhY2hlIChzdHJ1Y3Qgd2luZG93ICp3LCBMaXNwX09iamVjdCB2YWwpCit7CisgIHct Pm11bHRpcGxlX2N1cnNvcnNfY2FjaGUgPSB2YWw7Cit9CisKK0lOTElORSB2b2lkCit3c2V0X2Ny b3NzaGFpcnNfY2FjaGUgKHN0cnVjdCB3aW5kb3cgKncsIExpc3BfT2JqZWN0IHZhbCkKK3sKKyAg dy0+Y3Jvc3NoYWlyc19jYWNoZSA9IHZhbDsKK30KKworLyogKioqKioqKioqKioqKioqKioqK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CBjb29yZHNfaW5fbW91c2VfZmFjZV9wIChzdHJ1Y3Qgd2luZG93ICosIGludCwg aW50KTsKIAogCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExFIENV UlNPUlMgKi8KKworLyogTVVMVElQTEUgQ1VSU09SUzogIEVtYWNzIEJ1ZyAjMjI4NzMgKGZlYXR1 cmUgcmVxdWVzdCkKKworICAgQ1JPU1NIQUlSUzogIEVtYWNzIEJ1ZyAjMTc2ODQgKGZlYXR1cmUg cmVxdWVzdCkKKworCitQQVRDSCBWRVJTSU9OOiAgMDE0LjAwMCBbMDgvMjgvMjAxOF0KKyAgICAg ICAgICAgICAgICAwMTQuMDAxIFswOS8wMS8yMDE4XQorICAgICAgICAgICAgICAgIDAxNC4wMDIg WzA5LzAyLzIwMThdCisgICAgICAgICAgICAgICAgMDE0LjAwMyBbMDkvMDUvMjAxOF0KKyAgICAg ICAgICAgICAgICAwMTQuMDA0IFswOS8wOC8yMDE4XQorICAgICAgICAgICAgICAgIDAxNC4wMDUg WzA5LzA5LzIwMThdCisgICAgICAgICAgICAgICAgMDE0LjAwNiBbMDkvMDkvMjAxOF0KKyAgICAg ICAgICAgICAgICAwMTQuMDA3IFswOS8xMC8yMDE4XQorICAgICAgICAgICAgICAgIDAxNC4wMDgg WzA5LzEwLzIwMThdCisgICAgICAgICAgICAgICAgMDE0LjAwOSBbMDkvMTEvMjAxOF0KKyAgICAg ICAgICAgICAgICAwMTQuMDEwIFswOS8xMy8yMDE4XQorICAgICAgICAgICAgICAgIDAxNC4wMTEg WzA5LzE0LzIwMThdCisgICAgICAgICAgICAgICAgMDE0LjAxMiBbMDkvMTcvMjAxOF0KKyAgICAg ICAgICAgICAgICAwMTQuMDEzIFswOS8xOC8yMDE4XQorICAgICAgICAgICAgICAgIDAxNC4wMTQg WzA5LzE5LzIwMThdCisgICAgICAgICAgICAgICAgMDE0LjAxNSBbMDkvMjMvMjAxOF0KKyAgICAg ICAgICAgICAgICAwMTQuMDE2IFswOS8yNC8yMDE4XQorICAgICAgICAgICAgICAgIDAxNC4wMTcg WzA5LzI1LzIwMThdCisgICAgICAgICAgICAgICAgMDE0LjAxOCBbMDkvMjYvMjAxOF0KKyAgICAg ICAgICAgICAgICAwMTQuMDE5IFsxMC8wMS8yMDE4XQorICAgICAgICAgICAgICAgIDAxNC4wMjAg WzEwLzAyLzIwMThdCisgICAgICAgICAgICAgICAgMDE0LjAyMSBbMTAvMDkvMjAxOF0KKyAgICAg ICAgICAgICAgICAwMTQuMDIyIFsxMC8xMC8yMDE4XQorICAgICAgICAgICAgICAgIDAxNC4wMjMg WzEwLzEwLzIwMThdCisgICAgICAgICAgICAgICAgMDE0LjAyNCBbMTAvMTMvMjAxOF0KKyAgICAg ICAgICAgICAgICAwMTQuMDI1IFsxMS8xMC8yMDE4XQorICAgICAgICAgICAgICAgIDAxNS4wMDAg WzExLzEwLzIwMThdCisKK0FwcGx5IHBhdGNoIHRvIG1hc3RlciBicmFuY2g6ICBTYXQgSnVsIDcg MDk6NTk6NTMgMjAxOCAtMDcwMAorZ2l0IHJlc2V0IC0taGFyZCA5ODQ2M2JlZDA3ZWNjOTA1NzA5 NDkyOGZmZGMyMzIxZWFhZjNhYjUyCisKK0xhc3QgQ29tbWl0IDogU2F0IEp1bCA3IDA5OjU5OjUz IDIwMTggLTA3MDAKKyAgICAgICAgICAgIDogR2xlbm4gTW9ycmlzIDxyZ21AZ251Lm9yZz4KKyAg ICAgICAgICAgIDogOTg0NjNiZWQwN2VjYzkwNTcwOTQ5MjhmZmRjMjMyMWVhYWYzYWI1MgorICAg ICAgICAgICAgOiAqIGxpc3AvaW1lbnUuZWw6IFJlcXVpcmUgY2wtbGliLCBub3QgaW50ZXJuYWwg Y29tcG9uZW50cyBvZiBzYW1lLgorCisKK1NFVFVQOgorCitTdGVwIDE6ICBnaXQgY2xvbmUgL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ICAgICAgICAgICAgICAgICAgICAgICAgICAoMiAiYmFyIiAicHVycGxl IikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDMgImJveCIgIiMwMEZGMDAiKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoNCAiaG9sbG93IiAiIzAwMDBGRiIpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICg1ICgiaGJhciIgMykgWzEuMCAwLjAgMS4w XSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDYgKCJiYXIiIDMpIFswLjAgMS4w IDEuMF0pKSkKKworICA7OzsgVFVSTiBPRkYuCisgIChzZXRxIG11bHRpcGxlLWN1cnNvcnMtY29u ZiBuaWwpCisKKworVE9ETzoKKworLSAgTXVsdGlwbGUgQ3Vyc29yczogIElmIHBvaW50IGlzIGlu IHRoZSBtaWRkbGUgb2YgYSBjb21wb3NpdGUgY2hhcmFjdGVyLCB0aGVuCisgICBrZWVwIGdvaW5n IHVudGlsIHRoZSBuZXh0IGZ1bGwgY2hhcmFjdGVyLgorCistICBXb3JrIG9uIGNvbXBhdGFiaWxp dHkgd2l0aCBNYWNPUyBNb2phdmUuICBbSXNzdWUgIyA0MC5dCisKKy0gIEhvcml6b250YWwgUnVs ZXI6ICBEZXBlbmRpbmcgdXBvbiB0aGUgZm9udCwgY2VydGFpbiBsZXR0ZXJzIHRoYXQgZm9sbG93 IGEgdGFiCisgICBTVFJFVENIIGNhdXNlIHRoZSBwcmVjZWRpbmcgaG9yaXpvbnRhbCBoYmFyIHRv IGJlIGVyYXNlZDsgZS5nLiwgIkEiLgorICAgW0lzc3VlICMgMzAuXQorCistICBGYWtlIGN1cnNv cnMgYXJlIGJlaW5nIHJlZHJhd24gdG9vIG9mdGVuIHdoZW4gbm9uLXNlbGVjdGVkIHZpc2libGUg d2luZG93cworICAgaGF2ZSBhbiBvbmdvaW5nIHByb2Nlc3MgdGhhdCByZXF1aXJlIGZyZXF1ZW50 IHJlZGlz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W50cyksIGNyb3NzaGFpcnMpKSkp CisgICAgeworICAgICAgTGlzcF9PYmplY3Qgd2luZG93OworICAgICAgWFNFVFdJTkRPVyAod2lu ZG93LCB3KTsKKyAgICAgIExpc3BfT2JqZWN0IHdpbmRvd19zdHJpbmcgPSBGcHJpbjFfdG9fc3Ry aW5nICh3aW5kb3csIFFuaWwpOworICAgICAgY2hhciAqd2luZG93X2NoYXIgPSBTU0RBVEEgKHdp bmRvd19zdHJpbmcpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiXG53aW5kb3cgKCVzKVxuIiwg d2luZG93X2NoYXIpOworICAgIH0KKyNlbmRpZgorCisjaWZkZWYgR0xZUEhfREVCVUcKKyAgc3Ry dWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIGludCB0ZW1wX2Z4ID0gV0lORE9X X1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgdy0+cGh5c19jdXJzb3IueCk7CisgIGludCB0ZW1w X2Z5ID0gV0lORE9XX1RPX0ZSQU1FX1BJWEVMX1kgKHcsIHctPnBoeXNfY3Vyc29yLnkpOworICBl bnVtIHdpbmRvd19wYXJ0IHBhcnQgPSBPTl9OT1RISU5HOworICBMaXNwX09iamVjdCB3aW5kb3cg PSB3aW5kb3dfZnJvbV9jb29yZGluYXRlcyAoZiwgdGVtcF9meCwgdGVtcF9meSwgJnBhcnQsIGZh bHNlKTsKKyAgTGlzcF9PYmplY3Qgd2luZG93X3N0cmluZyA9IEZwcmluMV90b19zdHJpbmcgKHdp bmRvdywgUW5pbCk7CisgIGRlYnVnX21ldGhvZF9hZGQgKHcsICJ3aW5kb3cgKCVzKSIsIFNTREFU QSAod2luZG93X3N0cmluZykpOworI2VuZGlmCisKK2NoYXIgKndfY29udGVudHMgPSAoQlVGRkVS UCAody0+Y29udGVudHMpICYmIFNUUklOR1AgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg bmFtZSkpKQorICAgICAgICAgICAgICAgIC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VzZSBjYWxjX3BpeGVsX3dpZHRoX29y X2hlaWdodC4gICovCisgICAgICBMaXNwX09iamVjdCBwbGlzdCA9IFhDRFIgKHZhbCksIHByb3A7 CisgICAgICBpbnQgd2lkdGggPSAtMTsKKyAgICAgIEVNQUNTX0lOVCBhbGlnbl90b19tYXggPQor ICAoY29sIDwgTU9TVF9QT1NJVElWRV9GSVhOVU0gLSBJTlRfTUFYCisgICA/IChFTUFDU19JTlQp IElOVF9NQVggKyBjb2wKKyAgIDogTU9TVF9QT1NJVElWRV9GSVhOVU0pOworICAgICAgaWYgKChw cm9wID0gRnBsaXN0X2dldCAocGxpc3QsIFFDd2lkdGgpLAorICAgICBSQU5HRURfSU5URUdFUlAg KDAsIHByb3AsIElOVF9NQVgpKQorICAgIHx8IChwcm9wID0gRnBsaXN0X2dldCAocGxpc3QsIFFD cmVsYXRpdmVfd2lkdGgpLAorICAgICAgICBSQU5HRURfSU5URUdFUlAgKDAsIHByb3AsIElOVF9N QVgpKSkKKyAgd2lkdGggPSBYSU5UIChwcm9wKTsKKyAgICAgIGVsc2UgaWYgKEZMT0FUUCAocHJv cCkgJiYgMCA8PSBYRkxPQVRfREFUQSAocHJvcCkKKyAgICAgICAgICYmIFhGTE9BVF9EQVRBIChw cm9wKSA8PSBJTlRfTUFYKQorICB3aWR0aCA9IChpbnQpKFhGTE9BVF9EQVRBIChwcm9wKSArIDAu NSk7CisgICAgICBlbHNlIGlmICgocHJvcCA9IEZwbGlzdF9nZXQgKHBsaXN0LCBRQ2FsaWduX3Rv KSwKKyAgICBSQU5HRURfSU5URUdFUlAgKGNvbCwgcHJvcCwgYWxpZ25fdG9fbWF4KSkpCisgIHdp ZHRoID0gWElOVCAocHJvcCkgLSBjb2w7CisgICAgICBlbHNlIGlmIChGTE9BVFAgKHByb3ApICYm IGNvbCA8PSBYRkxPQVRfREFUQSAocHJvcCkKKyAgICAgICAgICYmIChYRkxPQVRfREFUQSAocHJv cCkgPD0gYWxpZ25fdG9fbWF4KSk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lci4gICovCisgICAgICBpZiAoZHAg IT0gMAorICAgICYmICEgKG11bHRpYnl0ZSAmJiBMRUFESU5HX0NPREVfUCAoYykpCisgICAgJiYg VkVDVE9SUCAoRElTUF9DSEFSX1ZFQ1RPUiAoZHAsIGMpKSkKKyAgeworICAgIExpc3BfT2JqZWN0 IGNoYXJ2ZWM7CisgICAgcHRyZGlmZl90IGksIG47CisgICAgLyogVGhpcyBjaGFyYWN0ZXIgaXMg ZGlzcGxheWVkIHVzaW5nIGEgdmVjdG9yIG9mIGdseXBocy4KKyAgICAgICBVcGRhdGUgdGhlIGNv bHVtbi9wb3NpdGlvbiBiYXNlZCBvbiB0aG9zZSBnbHlwaHMuICAqLworICAgIGNoYXJ2ZWMgPSBE SVNQX0NIQVJfVkVDVE9SIChkcCwgYyk7CisgICAgbiA9IEFTSVpFIChjaGFydmVjKTsKKyAgICBm b3IgKGkgPSAwOyBpIDwgbjsgaSsrKQorICAgICAgeworICAgICAgICAvKiBUaGlzIHNob3VsZCBi ZSBoYW5kbGVkIHRoZSBzYW1lIGFzCisgICAgIG5leHRfZWxlbWVudF9mcm9tX2Rpc3BsYXlfdmVj dG9yIGRvZXMgaXQuICAqLworICAgICAgICBMaXNwX09iamVjdCBlbnRyeSA9IEFSRUYgKGNoYXJ2 ZWMsIGkpOworICAgICAgICBpZiAoR0xZUEhfQ09ERV9QIChlbnRyeSkpCisgICAgYyA9IEdMWVBI X0NPREVfQ0hBUiAoZW50cnkpOworICAgICAgICBlbHNlCisgICAgYyA9ICcgJzsKKyAgICAgICAg aWYgKGMgPT0gJ1xuJykKKyAgICBnb3RvIGVuZGxvb3A7CisgICAgICAgIGlmIChjID09ICdccicg JiYgRVEgKEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBzZWxlY3RpdmVfZGlzcGxheSksIFF0KSkKKyAg ICBnb3RvIGVuZGxvb3A7CisgICAgICAgIGlmIChjID09ICdcdCcpCisgICAgeworICAgICAgY29s ICs9IHRhYl93aWR0aDsKKyAgICAgIGNvbCA9IGNvbCAvIHRhYl93aWR0aCAqIHRhYl93aWR0aDsK KyAgICB9CisgICAgICAgIGVsc2UKKyAgICArK2NvbDsKKyAgICAgIH0KKyAgfQorICAgICAgZWxz ZQorICB7CisgICAgLyogVGhlIGRpc3BsYXkgdGFibGUgZG9lc24ndCBhZmZlY3QgdGhpcyBjaGFy YWN0ZXI7CisgICAgICAgaXQgZGlzcGxheXMgYXMgaXRzZWxmLiAgKi8KKyAgICBpZiAoYyA9PSAn XG4nKQorICAgICAgZ290byBlbmRsb29wOworICAgIGlmIChjID09ICdccicgJiYgRVEgKEJWQVIg KGN1cnJlbnRfYnVmZmVyLCBzZWxlY3RpdmVfZGlzcGxheSksIFF0KSkKKyAgICAgIGdvdG8gZW5k bG9vcDsKKyAgICBpZiAoYyA9PSAnXHQnKQorICAgICAgeworICAgICAgICBjb2wgKz0gdGFiX3dp ZHRoOworICAgICAgICBjb2wgPSBjb2wgLyB0YWJfd2lkdGggKiB0YWJfd2lkdGg7CisgICAgICB9 CisgICAgZWxzZSBpZiAobXVsdGlieXRlICYmIExFQURJTkdfQ09ERV9QIChjKSkKKyAgICAgIHsK KyAgICAgICAgLyogU3RhcnQgb2YgbXVsdGktYnl0ZSBmb3JtLiAgKi8KKyAgICAgICAgdW5zaWdu ZWQgY2hhciAqcHRyOworICAgICAgICBpbnQgYnl0ZXMsIHdpZHRoOworICAgICAgICBwdHIgPSBC WVRFX1BPU19BRERSIChzY2FuX2J5dGUpOworICAgICAgICBNQ19NVUxUSUJZVEVfQllURVNfV0lE VEggKHB0ciwgZHAsIGJ5dGVzLCB3aWR0aCk7CisgICAgICAgIC8qIFN1YnRyYWN0IG9uZSB0byBj b21wZW5zYXRlIGZvciB0aGUgaW5jcmVtZW50CisgICAgIHRoYXQgaXMgZ29pbmcgdG8gaGFwcGVu IGJlbG93LiAgKi8KKyAgICAgICAgc2Nhbl9ieXRlICs9IGJ5dGVzIC0gMTsKKyAgICAgICAgY29s ICs9IHdpZHR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2RpZmllZCA9IDA7Cisg IHB0cmRpZmZfdCBsYXN0X2tub3duX2NvbHVtbiA9IDA7CisgIHB0cmRpZmZfdCBjb2w7CisgIHVu c2lnbmVkIGNoYXIgKnB0ciwgKnN0b3A7CisgIGJvb2wgdGFiX3NlZW47CisgIHB0cmRpZmZfdCBw b3N0X3RhYjsKKyAgaW50IGM7CisgIGludCB0YWJfd2lkdGggPSBTQU5FX1RBQl9XSURUSCAoY3Vy cmVudF9idWZmZXIpOworICBib29sIGN0bF9hcnJvdyA9ICFOSUxQIChCVkFSIChjdXJyZW50X2J1 ZmZlciwgY3RsX2Fycm93KSk7CisgIHN0cnVjdCBMaXNwX0NoYXJfVGFibGUgKmRwID0gYnVmZmVy X2Rpc3BsYXlfdGFibGUgKCk7CisgIGlmIChwdCA9PSBsYXN0X2tub3duX2NvbHVtbl9wb2ludAor ICAgICAgJiYgTU9ESUZGID09IGxhc3Rfa25vd25fY29sdW1uX21vZGlmaWVkKQorICAgIHJldHVy biBsYXN0X2tub3duX2NvbHVtbjsKKyAgLyogSWYgdGhlIGJ1ZmZlciBoYXMgb3ZlcmxheXMsIHRl eHQgcHJvcGVydGllcywKKyAgICAgb3IgbXVsdGlieXRlIGNoYXJhY3RlcnMsIHVzZSBhIG1vcmUg Z2VuZXJhbCBhbGdvcml0aG0uICAqLworICBpZiAoYnVmZmVyX2ludGVydmFscyAoY3VycmVudF9i dWZmZXIpCisgICAgICB8fCBidWZmZXJfaGFzX292ZXJsYXlzICgpCisgICAgICB8fCBaICE9IFpf QllURSkKKyAgICB7CisgICAgICBFTUFDU19JTlQgY29sID0gTU9TVF9QT1NJVElWRV9GSVhOVU07 CisgICAgICBtY19zY2FuX2Zvcl9jb2x1bW4gKCZwdCwgJmNvbCwgTlVMTCwgcHQpOworICAgICAg cmV0dXJuIGNvbDsKKyAgICB9CisgIC8qIFNjYW4gYmFja3dhcmRzIGZyb20gcG9pbnQgdG8gdGhl IHByZXZpb3VzIG5ld2xpbmUsCisgICAgI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2lubmluZyBv ZiBidWZmZXIuICAqLworICAgIGlmIChCRUdWID49IEdQVCkKKyAgICAgIGJyZWFrOworICB9Cisg ICAgICBjID0gKi0tcHRyOworICAgICAgaWYgKGRwICYmIFZFQ1RPUlAgKERJU1BfQ0hBUl9WRUNU T1IgKGRwLCBjKSkpCisgIHsKKyAgICBjaGFydmVjID0gRElTUF9DSEFSX1ZFQ1RPUiAoZHAsIGMp OworICAgIG4gPSBBU0laRSAoY2hhcnZlYyk7CisgIH0KKyAgICAgIGVsc2UKKyAgeworICAgIGNo YXJ2ZWMgPSBRbmlsOworICAgIG4gPSAxOworICB9CisgICAgICBmb3IgKGkgPSBuIC0gMTsgaSA+ PSAwOyAtLWkpCisgIHsKKyAgICBpZiAoVkVDVE9SUCAoY2hhcnZlYykpCisgICAgICB7CisgICAg ICAgIC8qIFRoaXMgc2hvdWxkIGJlIGhhbmRsZWQgdGhlIHNhbWUgYXMKKyAgICAgbmV4dF9lbGVt ZW50X2Zyb21fZGlzcGxheV92ZWN0b3IgZG9lcyBpdC4gICovCisgICAgICAgIExpc3BfT2JqZWN0 IGVudHJ5ID0gQVJFRiAoY2hhcnZlYywgaSk7CisgICAgICAgIGlmIChHTFlQSF9DT0RFX1AgKGVu dHJ5KSkKKyAgICBjID0gR0xZUEhfQ09ERV9DSEFSIChlbnRyeSk7CisgICAgICAgIGVsc2UKKyAg ICBjID0gJyAnOworICAgICAgfQorICAgIGlmIChjID49IDA0MCAmJiBjIDwgMDE3NykKKyAgICAg IGNvbCsrOworICAgIGVsc2UgaWYgKGMgPT0gJ1xuJworICAgICAgIHx8IChjID09ICdccicKKyAg ICAgICAgICAgJiYgRVEgKEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBzZWxlY3RpdmVfZGlzcGxheSks IFF0KSkpCisgICAgICB7CisgICAgICAgIHB0cisrOworICAgICAgICBnb3RvIHN0YXJ0X29mX2xp bmVfZm91bmQ7CisgICAgICB9CisgICAgZWxzZSBpZiAoYyA9PSAnXHQnKQorICAgICAgeworICAg ICAgICBpZiAodGFiX3NlZW4pCisgICAgY29sID0gKChjb2wgKyB0YWJfd2lkdGgpIC8gdGFiX3dp ZHRoKSAqIHRhYl93aWR0aDsKKyAgICAgICAgcG9zdF90YWIgKz0gY29sOworICAgICAgICBjb2wg PSAwOworICAgICAgICB0YWJfc2VlbiA9IDE7CisgICAgICB9CisgICAgZWxzZSBpZiAoVkVDVE9S UCAoY2hhcnZlYykpCisgICAgICAvKiBXaXRoIGEgZGlzcGxheSB0YWJsZSBlbnRyeSwgQyBpcyBk aXNwbGF5ZWQgYXMgaXMsIGFuZAorICAgICAgICAgbm90IGRpc3BsYXllZCBhcyBcTk5OIG9yIGFz IF5OLiAgSWYgQyBpcyBhIHNpbmdsZS1ieXRlCisgICAgICAgICBjaGFyYWN0ZXIsIGl0IHRha2Vz IG9uZSBjb2x1bW4uICBJZiBDIGlzIG11bHRpLWJ5dGUgaW4KKyAgICAgICAgIGEgdW5pYnl0ZSBi dWZmZXIsIGl0J3MgdHJhbnNsYXRlZCB0byB1bmlieXRlLCBzbyBpdAorICAgICAgICAgYWxzbyB0 YWtlcyBvbmUgY29sdW1uLiAgKi8KKyAgICAgICsrY29sOworICAgIGVsc2UKKyAgICAgIGNvbCAr PSAoY3RsX2Fycm93ICYmIGMgPCAwMjAwKSA/IDIgOiA0OworICB9CisgICAgfQorIHN0YXJ0X29m X2xpbmVfZm91bmQ6CisgIGlmICh0YWJfc2VlbikKKyAgICB7CisgICAgICBjb2wgPSAoKGNvbCAr IHRhYl93aWR0aCkgLyB0YWJfd2lkdGgpICogdGFiX3dpZHRoOworICAgICAgY29sICs9IHBvc3Rf dGFiOworICAgIH0KKyAgbGFzdF9rbm93bl9jb2x1bW4gPSBjb2w7CisgIGxhc3Rfa25vd25fY29s dW1uX3BvaW50ID0gcHQ7CisgIGxhc3Rfa25vd25fY29sdW1uX21vZGlmaWVkID0gTU9ESUZGOwor ICByZXR1cm4gY29sOworfQorCitzdGF0aWMgaW50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4gKCJucyIpKSkpKQorICAgIHsKKyAgICAgIGNvbG9yX3ZhbHVlcyA9 IChGeHdfY29sb3JfdmFsdWVzIChjb2xvciwgdGFyZ2V0X2ZyYW1lKSk7CisgICAgICBmb3IgKHZs aXN0ID0gY29sb3JfdmFsdWVzOworICAgICAgICAgICBDT05TUCAodmxpc3QpOworICAgICAgICAg ICB2bGlzdCA9IFhDRFIgKHZsaXN0KSkKKyAgICAgICAgeworICAgICAgICAgIHggPSBYSU5UIChY Q0FSICh2bGlzdCkpOworICAgICAgICAgIHRlbXAgPSBtYWtlX2Zsb2F0ICh4IC8gdmFsbWF4KTsK KyAgICAgICAgICBBU0VUICh2ZWN0b3IsIGksIHRlbXApOworICAgICAgICAgIGkgPSBpICsgMTsK KyAgICAgICAgfQorICAgIH0KKyAgcmV0dXJuIHZlY3RvcjsKK30KKworc3RhdGljIExpc3BfT2Jq ZWN0CittY19iZ19sc2wgKHN0cnVjdCB3aW5kb3cgKncsIGVudW0gZmFjZV9pZCBmYWNlX2lkKQor eworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgc3RydWN0IGZhY2Ug KmZhY2U7CisgIExpc3BfT2JqZWN0IGNvbG9yLCBjb2xvcl92ZWN0b3I7CisgIGlmICghTklMUCAo VmZhY2VfcmVtYXBwaW5nX2FsaXN0KQorICAgICAgJiYgKGZhY2VfaWQgPT0gREVGQVVMVF9GQUNF X0lEIC8qIFFkZWZhdWx0ICovCisgICAgICAgICAgfHwgZmFjZV9pZCA9PSBNT0RFX0xJTkVfRkFD RV9JRCAvKiBRbW9kZV9saW5lICovCisgICAgICAgICAgfHwgZmFjZV9pZCA9PSBNT0RFX0xJTkVf SU5BQ1RJVkVfRkFDRV9JRCAvKiBRbW9kZV9saW5lX2luYWN0aXZlICovCisgICAgICAgICAgfHwg ZmFjZV9pZCA9PSBIRUFERVJfTElORV9GQUNFX0lEIC8qIFFoZWFkZXJfbGluZSAqLworICAgICAg IC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GlzcF9PYmplY3QgY21hcCwgYm0xID0gUW5pbCwgYm0yID0gUW5pbCwgYm07 CisgIEVNQUNTX0lOVCBsbjEgPSAwLCBsbjIgPSAwOworICBpbnQgaXgxID0gcmlnaHRfcDsKKyAg aW50IGl4MiA9IGl4MSArIChwYXJ0aWFsX3AgPyAyIDogMCk7CisgIGlmICgoY21hcCA9IEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpLCAhTklMUCAo Y21hcCkpCisgICAgeworICAgICAgYm0xID0gRmFzc3EgKGJpdG1hcCwgY21hcCk7CisgICAgICBp ZiAoQ09OU1AgKGJtMSkpCisgIHsKKyAgICBpZiAoKGJtMSA9IFhDRFIgKGJtMSkpLCBOSUxQIChi bTEpKQorICAgICAgcmV0dXJuIE5PX0ZSSU5HRV9CSVRNQVA7CisgICAgaWYgKENPTlNQIChibTEp KQorICAgICAgeworICAgICAgICBsbjEgPSBYSU5UIChGbGVuZ3RoIChibTEpKTsKKyAgICAgICAg aWYgKHBhcnRpYWxfcCkKKyAgICB7CisgICAgICBpZiAobG4xID4gaXgyKQorICAgICAgICB7Cisg ICAgICAgICAgYm0gPSBGbnRoIChtYWtlX251bWJlciAoaXgyKSwgYm0xKTsKKyAgICAgICAgICBp ZiAoIUVRIChibSwgUXQpKQorICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgfQorICAgIH0KKyAg ICAgICAgZWxzZQorICAgIHsKKyAgICAgIGlmIChsbjEgPiBpeDEpCisgICAgICAgIHsKKyAgICAg ICAgICBibSA9IEZudGggKG1ha2VfbnVtYmVyIChpeDEpLCBibTEpOworICAgICAgICAgIGlmICgh RVEgKGJtLCBRdCkpCisgICAgICBnb3RvIGZvdW5kOworICAgICAgICB9CisgICAgfQorICAgICAg fQorICAgIGVsc2UgaWYgKChibSA9IGJtMSwgIUVRIChibSwgUXQpKSkKKyAgICAgIGdvdG8gZm91 bmQ7CisgIH0KKyAgICB9CisgIGlmICghRVEgKGNtYXAsIEJWQVIgKCZidWZmZXJfZGVmYXVsdHMs IGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKQorICAgICAgJiYgIU5JTFAgKEJWQVIgKCZidWZmZXJf ZGVmYXVsdHMsIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKSkKKyAgICB7CisgICAgICBibTIgPSBG YXNzcSAoYml0bWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2Fs aXN0KSk7CisgICAgICBpZiAoQ09OU1AgKGJtMikpCisgIHsKKyAgICBpZiAoKGJtMiA9IFhDRFIg KGJtMikpLCAhTklMUCAoYm0yKSkKKyAgICAgIHsKKyAgICAgICAgaWYgKENPTlNQIChibTIpKQor ICAgIHsKKyAgICAgIGxuMiA9IFhJTlQgKEZsZW5ndGggKGJtMikpOworICAgICAgaWYgKHBhcnRp YWxfcCkKKyAgICAgICAgeworICAgICAgICAgIGlmIChsbjIgPiBpeDIpCisgICAgICB7CisgICAg ICAgIGJtID0gRm50aCAobWFrZV9udW1iZXIgKGl4MiksIGJtMik7CisgICAgICAgIGlmICghRVEg KGJtLCBRdCkpCisgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgIH0KKyAgICAgICAgfQorICAg IH0KKyAgICAgIH0KKyAgfQorICAgIH0KKyAgaWYgKGxuMSA+IGl4MSkKKyAgICB7CisgICAgICBi bSA9IEZudGggKG1ha2VfbnVtYmVyIChpeDEpLCBibTEpOworICAgICAgaWYgKCFFUSAoYm0sIFF0 KSkKKyAgZ290byBmb3VuZDsKKyAgICB9CisgIGlmIChsbjIgPiBpeDEpCisgICAgeworICAgICAg Ym0gPSBGbnRoIChtYWtlX251bWJlciAoaXgxKSwgYm0yKTsKKyAgICAgIGlmICghRVEgKGJtLCBR dCkpCisgIGdvdG8gZm91bmQ7CisgICAgICByZXR1cm4gTk9fRlJJTkdFX0JJVE1BUDsKKyAgICB9 CisgIGVsc2UgaW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gICAgICBpbnQgaGVhZGVyX2xpbmVfaGVpZ2h0ID0gV0lORE9X X0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgICAgICBpbnQgd2lkdGg7CisgICAgICBjdXJzb3Jf Z2x5cGggPSBnZXRfcGh5c19jdXJzb3JfZ2x5cGggKHcpOworICAgICAgaWYgKGN1cnNvcl9nbHlw aCA9PSBOVUxMKQorICAgICAgICBnb3RvIG1hcmtfY3Vyc29yX29mZjsKKyAgICAgIHdpZHRoID0g Y3Vyc29yX2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgIHggPSB3LT5waHlzX2N1cnNvci54Owor ICAgICAgaWYgKHggPCAwKQorICAgICAgICB7CisgICAgICAgICAgd2lkdGggKz0geDsKKyAgICAg ICAgICB4ID0gMDsKKyAgICAgICAgfQorICAgICAgd2lkdGggPSBtaW4gKHdpZHRoLCB3aW5kb3df Ym94X3dpZHRoICh3LCBURVhUX0FSRUEpIC0geCk7CisgICAgICB5ID0gV0lORE9XX1RPX0ZSQU1F X1BJWEVMX1kgKHcsIG1heCAoaGVhZGVyX2xpbmVfaGVpZ2h0LCBjdXJzb3Jfcm93LT55KSk7Cisg ICAgICB4ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgeCk7CisgICAgICBpZiAo d2lkdGggPiAwKQorICBGUkFNRV9SSUYgKGYpLT5jbGVhcl9mcmFtZV9hcmVhIChmLCB4LCB5LCB3 aWR0aCwgY3Vyc29yX3Jvdy0+dmlzaWJsZV9oZWlnaHQpOworICAgIH0KKyAgLyogRXJhc2UgdGhl IGN1cnNvciBieSByZWRyYXdpbmcgdGhlIGNoYXJhY3RlciB1bmRlcm5lYXRoIGl0LiAgKi8KKyAg aWYgKG1vdXNlX2ZhY2VfaGVyZV9wKQorICAgIGhsID0gRFJBV19NT1VTRV9GQUNFOworICBlbHNl CisgICAgaGwgPSBEUkFXX05PUk1BTF9URVhUOworICBkcmF3X3BoeXNfY3Vyc29yX2dseXBoICh3 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1ZiksIFFjdXJy ZW50X2xpbmUpOworICAvKiBFWEFNUExFOiAgKHNjcm9sbC1sZWZ0IDUpICovCisgIGJvb2wgaHNj bF9hbGxfdGVtcF9wID0gKHctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWlu X2hzY3JvbGwgPT0gMCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIG5vdGhpbmcu ICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8wX3AgPSAody0+c3VzcGVuZF9hdXRvX2hzY3JvbGwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSB3LT5oc2Nyb2xsKTsKKyAgLyogRVhBTVBMRTog IEMtdSBDLXggPCBhbmQgZG8gc29tZXRoaW5nIGVsc2UgYmVzaWRlcyBob3Jpem9udGFsbHkgc2Ny b2xsaW5nIHRoZQorICAgICAgICAgICAgICAgY3VycmVudCBsaW5lIGRpZmZlcmVudGx5LgorICAg ICAgICAgICAgICAgQ3VycmVudCBsaW5lIGlzIF9ub3RfIGhvcml6b250YWxseSBzY3JvbGxlZCBk aWZmZXJlbnRseS4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzFfcCA9ICghdy0+c3VzcGVuZF9h dXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxf bW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSB3LT5oc2Nyb2xsKTsKKyAg LyogRVhBTVBMRTogIEMtdSBDLXggPCBhbmQgLi4uCisgICAgICAgICAgICAgICBDdXJyZW50IGxp bmUgaXMgX25vdF8gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29s IGhzY2xfYWxsX3Blcm1fMl9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID09IDAKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiB3LT5taW5faHNjcm9sbCAhPSB3LT5oc2Nyb2xsKTsKKyAgLyogRVhBTVBMRTogIChzY3JvbGwt bGVmdCA1KTsgYW5kLCB0aGVuIHByZXNzIHRoZSBsZWZ0IGFycm93IGtleSBvbmUgdGltZS4KKyAg ICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBfaXNfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZm ZXJlbnRseS4qLworICBib29sIGhzY2xfdGVtcF9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9s bAorICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAg ICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICYm IH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fcAorICAg ICAgJiYgZmxhdm9yID09IE1DX09WRVJMQVlfQVJST1dfQklUTUFQCisgICAgICAmJiAhaHNjbF9h bGxfdGVtcF9wCisgICAgICAmJiAhaHNjbF90ZW1wX3AKKyAgICAgICYmICFoc2NsX3Blcm1fcAor ICAgICAgJiYgIWhzY2xfYWxsX3Blcm1fMF9wCisgICAgICAmJiAhaHNjbF9hbGxfcGVybV8xX3AK KyAgICAgICYmICFoc2NsX2FsbF9wZXJtXzJfcCkKKyAgICB7CisgICAgICBlbnVtIGZhY2VfaWQg b3ZlcmxheV9hcnJvd19mYWNlX2lkID0KKyAgICAgICAgKCFhY3RpdmVfY3Vyc29yX3AKKyAgICAg ICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnNfaW5h Y3RpdmVfd2luZG93cykpKQorICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRl cm4gKCIrLW92ZXJsYXktYXJyb3ctaW5hY3RpdmUtZmFjZSIpLCB0cnVlKQorICAgICAgICA6IChh Y3RpdmVfY3Vyc29yX3AKKyAgICAgICAgICAgJiYgbWluaW1hbF9wKQorICAgICAgICAgID8gbG9v a3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1taW5pbWFsLWZh Y2UiKSwgdHJ1ZSkKKyAgICAgICAgOiAoYWN0aXZlX2N1cnNvcl9wCisgICAgICAgICAgICYmICFt aW5pbWFsX3ApCisgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgi Ky1vdmVybGF5LWFycm93LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7 CisgICAgICBmYWNlX2lkID0gKGN1cnNvcl90eXBlID09IExFRlRfRlJJTkdFX0JJVE1BUCkKKyAg ICAgICAgICAgICAgICA/IG92ZXJsYXlfYXJyb3dfZmFj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HNjbF9hbGxfcGVybV8wX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxf cGVybV8xX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8yX3AKKyAgICAgICAg ICAgICAgICAgfHwgaHNjbF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF9wZXJtX3Ap KQorICAgICAgeworICAgICAgICBlbnVtIGZhY2VfaWQgb3ZlcmxheV9hcnJvd19mYWNlX2lkID0K KyAgICAgICAgICAoIWFjdGl2ZV9jdXJzb3JfcAorICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAg ICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJy b3ctaHNjbC1pbmFjdGl2ZS1mYWNlIiksIHRydWUpCisgICAgICAgICAgOiAoYWN0aXZlX2N1cnNv cl9wCisgICAgICAgICAgICAgJiYgbWluaW1hbF9wKQorICAgICAgICAgICAgPyBsb29rdXBfbmFt ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtbWluaW1hbC1mYWNl IiksIHRydWUpCisgICAgICAgICAgOiAoYWN0aXZlX2N1cnNvcl9wCisgICAgICAgICAgICAgJiYg IW1pbmltYWxfcCkKKyAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVy biAoIistb3ZlcmxheS1hcnJvdy1oc2NsLWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICA6IERFRkFV TFRfRkFDRV9JRDsKKyAgICAgICAgZmFjZV9pZCA9IChjdXJzb3JfdHlwZSA9PSBMRUZUX0ZSSU5H RV9CSVRNQVApCisgICAgICAgICAgICAgICAgICA/IG92ZXJsYXlfYXJyb3dfZmFjZV9pZAorICAg ICAg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F0IHRoaXMgdGltZSwgQGxhd2xp c3QgcHJlZmVycyBub3QgdG8KKyAgICAgICAgcmVseSB1cG9uIGEgTGlzcCBzZXR0aW5nIHVzaW5n IGBzZXQtZnJpbmdlLWJpdG1hcC1mYWNlJy4gKi8KKyAgICAgICAgZ2x5cGhfcm93LT5sZWZ0X2Zy aW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0gTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBmcmluZ2VfYml0bWFwCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5PX0ZSSU5HRV9CSVRNQVA7 CisgICAgICAgIGdseXBoX3Jvdy0+bGVmdF9mcmluZ2Vfb2Zmc2V0ID0gMDsKKyAgICAgICAgZHJh d19mcmluZ2VfYml0bWFwICh3LCBnbHlwaF9yb3csIHRydWUpOworICAgICAgfQorICAgICAgZWxz ZSBpZiAoIXJlbW92ZV9wCisgICAgICAgICAgICAgICAmJiAoZmxhdm9yID09IE1DX0hPTExPV19S RUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICB8fCBmbGF2b3IgPT0gTUNf SE9MTE9XX1JFQ1RBTkdMRQorICAgICAgICAgICAgICAgICAgIHx8IGZsYXZvciA9PSBNQ19WRVJU SUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICB8fCBmbGF2b3IgPT0gTUNf VkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgfHwgZmxhdm9yID09IE1DX1ZFUlRJQ0FM X0JBUl9CQUNLU0xBU0gpKQorICAgICAgICB7CisgICAgICAgICAgTGlzcF9PYmplY3QgYml0bWFw X2ZsYXZvciA9IChmbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVykKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfaG9sbG93X3JlY3Rhbmds ZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChm bGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xlCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogKGZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJS T1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGlj YWxfYmFyX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogKGZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogKGZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jh cl9iYWNrc2xhc2gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBRbmls OworICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0gUklHSFRfRlJJTkdF X0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgPyBsb29rdXBfZnJpbmdlX2JpdG1h cCAoYml0bWFwX2ZsYXZvcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOT19GUklOR0Vf QklUTUFQOworICAgICAgICAgIGZhY2VfaWQgPSAoY3Vyc29yX3R5cGUgPT0gUklHSFRfRlJJTkdF X0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwg aW50ZXJuICgiKy12ZXJ0aWNhbC1iYXItZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICAgICAg ICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICBnbHlwaF9yb3ctPmN1cnNvcl9pbl9mcmlu Z2VfcCA9IGZhbHNlOworICAgICAgICAgIGdseXBoX3Jvdy0+ZnJpbmdlX2JpdG1hcF9wZXJpb2Rp Y19wID0gMDsKKyAgICAgICAgICBnbHlwaF9yb3ctPnJpZ2h0X2ZyaW5nZV9iaXRtYXAgPSBmcmlu Z2VfYml0bWFwOworICAgICAgICAgIGdseXBoX3Jvdy0+cmlnaHRfZnJpbmdlX2ZhY2VfaWQgPSBm YWNlX2lkOworICAgICAgICAgIGdseXBoX3Jvdy0+cmlnaHRfZnJpbmdlX29mZnNldCA9IDA7Cisg ICAgICAgICAgZHJhd19mcmluZ2VfYml0bWFwICh3LCBnbHlwaF9yb3csIGZhbHNlKTsKKyAgICAg ICAgfQorICAgICAgICBlbHNlIGlmIChmbGF2b3IgPT0gTUNfR0xZUEgKKyAgICAgICAgICAgICAg ICAgfHwgZmxhdm9yID09IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICB8fCBmbGF2b3Ig PT0gTUNfR0xZUEhfVEFCKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIHctPm1jLmggPSBoOwor ICAgICAgICAgICAgdy0+bWMuZnggPSBmeDsKKyAgICAgICAgICAgIHctPm1jLmZ5ID0gZnk7Cisg ICAgICAgICAgICB3LT5tYy5nbHlwaF9mbGF2b3IgPSBmbGF2b3I7CisgICAgICAgICAgICB3LT5t Yy5yZWQgPSBYRkxPQVRfREFUQSAoQVJFRiAoY29sb3JfdmVjdG9yLCAwKSk7CisgICAgICAgICAg ICB3LT5tYy5ncmVlbiA9IFhGTE9BVF9EQVRBIChBUkVGIChjb2xvcl92ZWN0b3IsIDEpKTsKKyAg ICAgICAgICAgIHctPm1jLmJsdWUgPSBYRkxPQVRfREFUQSAoQVJFRiAoY29sb3JfdmVjdG9yLCAy KSk7CisgICAgICAgICAgICB3LT5tYy5wb3NpbnQgPSBwb3NpbnQ7CisgICAgICAgICAgICAvKiBT b21lIG9mIHRoZXNlIHZhbHVlcyBjb21lIHRocm91Z2ggYXMgMS4wMDM5MDYsIHdoaWNoIGNhdXNl cyBhIGJyZWFrYWdlCisgICAgICAgICAgICBvZiB0aGUgY29sb3JzIGluIHRoYXQgbXVsdGlwbGlj YXRpb24gYnkgdGhlIGJhc2Ugd2lsbCBleGNlZWQgdGhlIGJhc2UuICovCisgICAgICAgICAgICBp ZiAody0+bWMucmVkID4gMS4wKQorICAgICAgICAgICAgICB3LT5tYy5yZWQgPSAxLjA7CisgICAg ICAgICAgICBpZiAody0+bWMuZ3JlZW4gPiAxLjApCisgICAgICAgICAgICAgIHctPm1jLmdyZWVu ID0gMS4wOworICAgICAgICAgICAgaWYgKHctPm1jLmJsdWUgPiAxLjApCisgICAgICAgICAgICAg IHctPm1jLmJsdWUgPSAxLjA7CisgICAgICAgICAgICBGUkFNRV9SSUYgKGYpLT5kcmF3X3dpbmRv d19jdXJzb3IgKHcsIGdseXBoX3JvdywgeCwgeSwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgdHJ1ZSwgYWN0 aXZlX2N1cnNvcl9wKTsKKyAgICAgICAgICB9CisgIC8qIFJlc3RvcmUgdGhlIHByZXZpb3VzIHZh bHVlcyBmb3Igdy0+cGh5c19jdXJzb3IgYW5kIGdseXBoX3Jvdy4gKi8KKyAgdy0+cGh5c19jdXJz b3Jfb25fcCA9IHBoeXNfY3Vyc29yX29uX3A7CisgIHctPnBoeXNfY3Vyc29yLnggPSBwaHlzX2N1 cnNvcl94OworICB3LT5waHlzX2N1cnNvci55ID0gcGh5c19jdXJzb3Jfe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cGUgPT0gR0xZUEhMRVNTX0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwK KyAgICAgICAgIiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQg JTEuMWQlMS4xZCAlNWQgJTRkICAlM2QgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5cGggLSBy b3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/ IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAg KGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgICAgID8gJ0MnCisgICAgICAgICA6ICdH JyksCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9i amVjdCkKKyAgICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0 KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3Qp CisgICAgICAgICAgICAgICA/ICcwJworICAgICAgICAgICAgICAgOiAnLScpKSksCisgICAgICAg IGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgZ2x5cGgtPnUuY2gsCisgICAgICAgIGdseXBo LT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlw aC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+ aHBvcywgZ2x5cGgtPnZwb3MsIGdseXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICgo IU5JTFAgKGNoYXJhY3RlcikKKyAgICAgICAgICYmIGdseXBoLT51LmNoID09IDkpCisgICAgICAg ICAgID8gIlxcdCIKKyAgICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAm JiBnbHlwaC0+dS5jaCA9PSAxMCkKKyAgICAgICAgICAgPyAiXFxuIgorICAgICAgICAgOiAoIU5J TFAgKGNoYXJhY3RlcikKKyAgICAgICAgICAgICYmIGdseXBoLT51LmNoID09IDMyKQorICAgICAg ICAgICA/ICJcXHMiCisgICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAg JiYgZ2x5cGgtPnUuY2ggIT0gOQorICAgICAgICAgICAgJiYgZ2x5cGgtPnUuY2ggIT0gMTAKKyAg ICAgICAgICAgICYmIGdseXBoLT51LmNoICE9IDMyKQorICAgICAgICAgICA/IFNTREFUQSAoY2hh cmFjdGVyKQorICAgICAgICAgOiAiXFw/IikpOworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5 cGUgPT0gU1RSRVRDSF9HTFlQSCkKKyAgICB7CisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAg ICAgICIgJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNnggJTRkICUxLjFk JTEuMWQgJTVkICU0ZCAgJTNkICAlM2QgJXMgJXNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5n bHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDog cm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdTJywK KyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0 KQorICAgICAgICAgICAgPyAnQicKKyAgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0 KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQor ICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICA6ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBp eGVsX3dpZHRoLAorICAgICAgICAwdSwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAg IGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9w LAorICAgICAgICBnbHlwaC0+eCwgZ2x5cGgtPnksIGdseXBoLT5ocG9zLCBnbHlwaC0+dnBvcywg Z2x5cGgtPnp2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgIlxcUyIpOworICAgIH0KKyAgZWxz ZSBpZiAoZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgICAgeworICAgICAgZnByaW50ZiAo c3RkZXJyLAorICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHgl MDZ4ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNkICVzICVjXG4iLAorICAgICAgICBn bHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2VkW2FyZWFd ID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94LAor ICAgICAgICAnSScsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAo Z2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ0InCisgICAgICAgICAgOiAoU1RSSU5HUCAo Z2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgOiAoTklMUCAoZ2x5 cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgOiAnLScpKSksCisgICAg ICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgKHVuc2lnbmVkIGludCkgZ2x5cGgtPnUu aW1nX2lkLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94 X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBo LT54LCBnbHlwaC0+eSwgZ2x5cGgtPmhwb3MsIGdseXBoLT52cG9zLCBnbHlwaC0+enZfcCA/ICJa ViIgOiAiLS0iLAorICAgICAgICAnLicpOworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUg PT0gQ09NUE9TSVRFX0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAg ICAgIiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCIsCisgICAgICAg IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJl YV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gs CisgICAgICAgICcrJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQ IChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnQicKKyAgICAgICAgICA6IChTVFJJTkdQ IChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICA6IChOSUxQIChn bHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICA6ICctJykpKSwKKyAg ICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAodW5zaWduZWQgaW50KSBnbHlwaC0+ dS5jbXAuaWQpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICU0ZCAlMS4xZCUxLjFkIiwKKyAg ICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisg ICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wKTsKKyAgICAgIGlmIChnbHlwaC0+dS5jbXAu YXV0b21hdGljKQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIgJTVkICU0ZCAgJTNkICAlM2Qg JXMgLiBbJWQtJWRdXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoLT54LCBnbHlw aC0+eSwgZ2x5cGgtPmhwb3MsIGdseXBoLT52cG9zLCBnbHlwaC0+enZfcCA/ICJaViIgOiAiLS0i LAorICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoLT5zbGljZS5jbXAuZnJvbSwgZ2x5cGgt PnNsaWNlLmNtcC50byk7CisgICAgICAgIGVsc2UKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAi XG4iKTsKKyAgICB9CisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IFhXSURHRVRfR0xZUEgpCisg ICAgeworI2lmbmRlZiBIQVZFX1hXSURHRVRTCisgICAgICBlYXNzdW1lIChmYWxzZSk7CisjZWxz ZQorICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICAlNWQvJS01ZCAlNWQgJTRjICU2 ZCAlYyAlM2QgMHglMDV4ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNkICVzICVjXG4i LAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93 LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICBy ZWxhdGl2ZV94LAorICAgICAgICAnWCcsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAg ICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgPyAnQicKKyAgICAgICAgIDog KFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgOiAn LScpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICBnbHlwaC0+ZmFjZV9p ZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0 X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT51Lnh3aWRnZXQsCisgICAgICAgIGdseXBoLT54 LCBnbHlwaC0+eSwgZ2x5cGgtPmhwb3MsIGdseXBoLT52cG9zLCBnbHlwaC0+enZfcCA/ICJaViIg OiAiLS0iLAorICAgICAgICAnLicpOworI2VuZGlmCisgICAgfQorfQorCisvKiBEdW1wIHRoZSBj b250ZW50cyBvZiBnbHlwaCByb3cgYXQgVlBPUyBpbiBNQVRSSVggdG8gc3RkZXJyLgorICAgR0xZ UEhTIDAgbWVhbnMgZG9uJ3Qgc2hvdyBnbHlwaCBjb250ZW50cy4KKyAgIEdMWVBIUyAxIG1lYW5z IHNob3cgZ2x5cGhzIGluIHNob3J0IGZvcm0KKyAgIEdMWVBIUyA+IDEgbWVhbnMgc2hvdyBnbHlw aHMgaW4gbG9uZyBmb3JtLiAgKi8KKwordm9pZAorbWNfZHVtcF9nbHlwaF9yb3cgKHN0cnVjdCBn bHlwaF9yb3cgKnJvdywgaW50IHZwb3MsIGludCBnbHlwaHMpCit7CisgIGludCByZWxhdGl2ZV94 ID0gMDsKKyAgaWYgKGdseXBocyAhPSAxKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwg IlxuRFVNUCBHTFlQSCBST1dcbiIpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiUm93ICAgICBT dGFydCAgICAgICBFbmQgVXNlZCBvRT48XFxDVFpGZXNtICAgICBYICAgIFkgICAgVyAgICBIICAg IFYgICAgQSAgICBQXG4iKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIj09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PVxuIik7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIlM2QgJTkicEQiZCAlOSJwRCJk ICU0ZCAlMS4xZCUxLjFkJTEuMWQlMS4xZFwKKyUxLjFkJTEuMWQlMS4xZCUxLjFkJTEuMWQlMS4x ZCUxLjFkJTEuMWQgICU0ZCAlNGQgJTRkICU0ZCAlNGQgJTRkICU0ZFxuIiwKKyAgICAgICAgIHZw b3MsCisgICAgICAgICBNQVRSSVhfUk9XX1NUQVJUX0NIQVJQT1MgKHJvdyksCisgICAgICAgICBN QVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpLAorICAgICAgICAgcm93LT51c2VkW1RFWFRfQVJF QV0sCisgICAgICAgICByb3ctPmNvbnRhaW5zX292ZXJsYXBwaW5nX2dseXBoc19wLAorICAgICAg ICAgcm93LT5lbmFibGVkX3AsCisgICAgICAgICByb3ctPnRydW5jYXRlZF9vbl9sZWZ0X3AsCisg ICAgICAgICByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wLAorICAgICAgICAgcm93LT5jb250aW51 ZWRfcCwKKyAgICAgICAgIE1BVFJJWF9ST1dfQ09OVElOVUFUSU9OX0xJTkVfUCAocm93KSwKKyAg ICAgICAgIE1BVFJJWF9ST1dfRElTUExBWVNfVEVYVF9QIChyb3cpLAorICAgICAgICAgcm93LT5l bmRzX2F0X3p2X3AsCisgICAgICAgICByb3ctPmZpbGxfbGluZV9wLAorICAgICAgICAgcm93LT5l bmRzX2luX21pZGRsZV9vZl9jaGFyX3AsCisgICAgICAgICByb3ctPnN0YXJ0c19pbl9taWRkbGVf b2ZfY2hhcl9wLAorICAgICAgICAgcm93LT5tb3VzZV9mYWNlX3AsCisgICAgICAgICByb3ctPngs CisgICAgICAgICByb3ctPnksCisgICAgICAgICByb3ctPnBpeGVsX3dpZHRoLAorICAgICAgICAg cm93LT5oZWlnaHQsCisgICAgICAgICByb3ctPnZpc2libGVfaGVpZ2h0LAorICAgICAgICAgcm93 LT5hc2NlbnQsCisgICAgICAgICByb3ctPnBoeXNfYXNjZW50KTsKKyAgICAgIC8qIFRoZSBuZXh0 IDMgbGluZXMgc2hvdWxkIGFsaWduIHRvICJTdGFydCIgaW4gdGhlIGhlYWRlci4gICovCisgICAg ICBmcHJpbnRmIChzdGRlcnIsICIgICAgJTkicEQiZCAlOSJwRCJkXHQlNWRcbiIsIHJvdy0+c3Rh cnQub3ZlcmxheV9zdHJpbmdfaW5kZXgsCisgICAgICAgICByb3ctPmVuZC5vdmVybGF5X3N0cmlu Z19pbmRleCwKKyAgICAgICAgIHJvdy0+Y29udGludWF0aW9uX2xpbmVzX3dpZHRoKTsKKyAgICAg IGZwcmludGYgKHN0ZGVyciwgIiAgICAlOSJwRCJkICU5InBEImRcbiIsCisgICAgICAgICBDSEFS UE9TIChyb3ctPnN0YXJ0LnN0cmluZ19wb3MpLAorICAgICAgICAgQ0hBUlBPUyAocm93LT5lbmQu c3RyaW5nX3BvcykpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICAgICU5ZCAlOWRcbiIsIHJv dy0+c3RhcnQuZHB2ZWNfaW5kZXgsCisgICAgICAgICByb3ctPmVuZC5kcHZlY19pbmRleCk7Cisg ICAgfQorICBpZiAoZ2x5cGhzID4gMSkKKyAgICB7CisgICAgICBpbnQgYXJlYTsKKyAgICAgIGZv ciAoYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFyZWEgPCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAg eworICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSByb3ctPmdseXBoc1thcmVhXTsKKyAgICBzdHJ1 Y3QgZ2x5cGggKmdseXBoX2VuZCA9IGdseXBoICsgcm93LT51c2VkW2FyZWFdOworICAgIC8qIEds eXBoIGZvciBhIGxpbmUgZW5kIGluIHRleHQuICAqLworICAgIGlmIChhcmVhID09IFRFWFRfQVJF QSAmJiBnbHlwaCA9PSBnbHlwaF9lbmQgJiYgZ2x5cGgtPmNoYXJwb3MgPiAwKQorICAgICAgKytn bHlwaF9lbmQ7CisgICAgaWYgKGdseXBoIDwgZ2x5cGhfZW5kKQorICAgICAgZnByaW50ZiAoc3Rk ZXJyLCAiR2x5cGgjL1RvdGFsIFJlbC5YIFQgICAgICAgUG9zIE8gICBXICAgICBDb2RlIEZhY2Ug TFIgICAgIFggICAgWSBIUE9TIFZQT1MgWlYgQ1xuIik7CisgICAgZm9yICg7IGdseXBoIDwgZ2x5 cGhfZW5kOyArK2dseXBoKQorICAgICAgeworICAgICAgICBtY19kdW1wX2dseXBoIChyb3csIGds eXBoLCBhcmVhLCByZWxhdGl2ZV94KTsKKyAgICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4 ZWxfd2lkdGg7CisgICAgICB9CisgIH0KKyAgICB9CisgIGVsc2UgaWYgKGdseXBocyA9PSAxKQor ICAgIHsKKyAgICAgIGludCBhcmVhOworICAgICAgY2hhciBzW1NIUlRfTUFYICsgNF07CisgICAg ICBmb3IgKGFyZWEgPSBMRUZUX01BUkdJTl9BUkVBOyBhcmVhIDwgTEFTVF9BUkVBOyArK2FyZWEp CisgIHsKKyAgICBpbnQgaTsKKyAgICBmb3IgKGkgPSAwOyBpIDwgcm93LT51c2VkW2FyZWFdOyAr K2kpCisgICAgICB7CisgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSByb3ctPmdseXBoc1th cmVhXSArIGk7CisgICAgICAgIGlmIChpID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICYm IGFyZWEgPT0gVEVYVF9BUkVBCisgICAgICAmJiBOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAg JiYgZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgJiYgZ2x5cGgtPnUuY2ggPT0gJyAn KQorICAgIHsKKyAgICAgIHN0cmNweSAoJnNbaV0sICJbXFxuXSIpOworICAgICAgaSArPSA0Owor ICAgIH0KKyAgICAgICAgZWxzZSBpZiAoZ2x5c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CBkMSwgZDIs IGQzLCBkNCwgZDUsIHlwb3M7CisgICAgICBib29sIHZpc2libGVfcCA9IHBvc192aXNpYmxlX3Ag KHcsIFBULCAmZDEsICZkMiwgJmQzLCAmZDQsICZkNSwgJnlwb3MpOworICAgICAgaW50IGhlYWRl cl9saW5lX2hlaWdodCA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICAgICAgaW50 IHZvZmZzZXQgPSAoaGVhZGVyX2xpbmVfaGVpZ2h0ID4gMAorICAgICAgICAgICAgICAgICAgICAg JiYgeXBvcyA+IDApCisgICAgICAgICAgICAgICAgICAgICAgPyB5cG9zICsgMQorICAgICAgICAg ICAgICAgICAgICAgIDogeXBvczsKKyAgICAgIGlmICh2aXNpYmxlX3ApCisgICAgICAgIHZwb3Mg PSB2b2Zmc2V0OworICAgICAgICBlbHNlCisgICAgICAgICAgdnBvcyA9IDA7CisgICAgfQorICAg IGVsc2UKKyAgICAgIHsKKyAgICAgICAgQ0hFQ0tfTlVNQkVSIChyb3cpOworICAgICAgICB2cG9z ID0gWElOVCAocm93KTsKKyAgICAgIH0KKyAgbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7Cisg IGlmICh2cG9zID49IDAgJiYgdnBvcyA8IG1hdHJpeC0+bnJvd3MpCisgICAgbWNfZHVtcF9nbHlw aF9yb3cgKE1BVFJJWF9ST1cgKG1hdHJpeCwgdnBvcyksCisgICAgICAgIHZwb3MsCisgICAgICAg IFRZUEVfUkFOR0VEX0lOVEVHRVJQIChpbnQsIGdseXBocykgPyBYSU5UIChnbHlwaHMpIDogMik7 CisgIHJldHVybiBRbmlsOworfQorCit2b2lkCittY19kdW1wX2dseXBoX21hdHJpeCAoc3RydWN0 IGdseXBoX21hdHJpeCAqbWF0cml4LCBpbnQgZ2x5cGhzKQoreworICBpbnQgaTsKKyAgZm9yIChp ID0gMDsgaSA8IG1hdHJpeC0+bnJvd3M7ICsraSkKKyAgICBtY19kdW1wX2dseXBoX3JvdyA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wgeSA9ICVkLCBocG9zID0gJWQsIHZwb3MgPSAlZFxuIiwKKwkgICB3LT5jdXJzb3IueCwg dy0+Y3Vyc29yLnksIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcyk7CisgIGZwcmludGYg KHN0ZGVyciwgIj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxu Iik7CisgIG1jX2R1bXBfZ2x5cGhfbWF0cml4ICh3LT5jdXJyZW50X21hdHJpeCwKKwkJICAgICBU WVBFX1JBTkdFRF9JTlRFR0VSUCAoaW50LCBnbHlwaHMpID8gWElOVCAoZ2x5cGhzKSA6IDApOwor ICByZXR1cm4gUW5pbDsKK30KKworc3RhdGljIHZvaWQKK21jX2hlbHBlciAoc3RydWN0IHdpbmRv dyAqdywgaW50IHgsIGludCBmeCwgaW50IHksIGludCBmeSwgaW50IGhwb3MsCisgICAgICAgICAg IGludCB2cG9zLCBpbnQgaCwgZW51bSB0ZXh0X2N1cnNvcl9raW5kcyBjdXJzb3JfdHlwZSwgaW50 IGN1cnNvcl93aWR0aCwKKyAgICAgICAgICAgTGlzcF9PYmplY3QgZm9yZWdyb3VuZCwgTGlzcF9P YmplY3QgYmFja2dyb3VuZCwgYm9vbCBhY3RpdmVfY3Vyc29yX3AsCisgICAgICAgICAgIGJvb2wg bWluaW1hbF9wLCBpbnQgZmxhdm9yLCBpbnQgcG9zaW50LCBMaXNwX09iamVjdCAqcmVzdWx0KQor eworICBib29sIG1jX3N0ZGVycl9wID0gIU5JTFAgKEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBtY19z dGRlcnIpKTsKKyAgTGlzcF9PYmplY3Qgd2luZG93OworICBYU0VUV0lORE9XICh3aW5kb3csIHcp OworICBMaXNwX09iamVjdCB3aW5kb3dfc3RyaW5nID0gRnByaW4xX3RvX3N0cmluZyAod2luZG93 LCBRbmlsKTsKKyAgY2hhciAqd2luZG93X2NoYXIgPSBTU0RBVEEgKHdpbmRvd19zdHJpb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CVzKSB8IHBvc2ludCAoJWQpXG5cCisgIEZHLVJHQiAoJWYv JWYvJWYpIHwgQkctUkdCICglZi8lZi8lZilcbiIsCisgIHdpbmRvd19jaGFyLAorICB4LCBmeCwg eSwgZnksIGhwb3MsIHZwb3MsIGgsCisgIFNTREFUQSAoRnByaW4xX3RvX3N0cmluZyAobWNfY3Vy c29yX3R5cGVfdG9fbGlzcCAoY3Vyc29yX3R5cGUpLCBRbmlsKSksCisgIGN1cnNvcl93aWR0aCwK KyAgKGFjdGl2ZV9jdXJzb3JfcCA/ICJ0cnVlIiA6ICJmYWxzZSIpLAorICAobWluaW1hbF9wID8g InRydWUiIDogImZhbHNlIiksCisgIChmbGF2b3IgPT0gTk9fRkxBVk9SCisgICAgICA/ICJOT19G TEFWT1IiCisgICAgOiBmbGF2b3IgPT0gTUNfR0xZUEgKKyAgICAgID8gIk1DX0dMWVBIIgorICAg IDogZmxhdm9yID09IE1DX0dMWVBITEVTUworICAgICAgPyAiTUNfR0xZUEhMRVNTIgorICAgIDog Zmxhdm9yID09IE1DX0dMWVBIX1RBQgorICAgICAgPyAiTUNfR0xZUEhfVEFCIgorICAgIDogZmxh dm9yID09IE1DX09WRVJMQVlfQVJST1dfQklUTUFQCisgICAgICA/ICJNQ19PVkVSTEFZX0FSUk9X X0JJVE1BUCIKKyAgICA6IGZsYXZvciA9PSBNQ19QSUxDUk9XCisgICAgICA/ICJNQ19QSUxDUk9X IgorICAgIDogZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAg ID8gIk1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1ciCisgICAgOiBmbGF2b3IgPT0gTUNf SE9MTE9XX1JFQ1RBTkdMRQorICAgICAgPyAiTUNfSE9MTE9XX1JFQ1RBTkdMRSIKKyAgICA6IGZs YXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgID8gIk1DX1ZFUlRJQ0FM X0JBUl9SSUdIVF9BUlJPVyIKKyAgICA6IGZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAg ID8gIk1DX1ZFUlRJQ0FMX0JBUiIKKyAgICA6IGZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFD S1NMQVNICisgICAgICA/ICJNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIIgorICAgIDogIk9PUFMi KSwKKyAgcG9zaW50LAorICByZWRfZmcsIGdyZWVuX2ZnLCBibHVlX2ZnLCByZWRfYmcsIGdyZWVu X2JnLCBibHVlX2JnKTsKKyAgYm9vbCByZW1vdmVfcCA9IGZhbHNlOworICBtY19kcmF3X2VyYXNl X2h5YnJpZCAodywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCBoLCBjdXJzb3JfdHlwZSwKKyAg ICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYWN0aXZlX2N1 cnNvcl9wLCBtaW5pbWFsX3AsCisgICAgICAgICAgICAgICAgICAgICAgICBmbGF2b3IsIHBvc2lu dCwgcmVtb3ZlX3ApOworICBMaXNwX09iamVjdCBmaWZ0ZWVuX2VsZW1lbnRzID0gbGlzdG4gKENP TlNUWVBFX0hFQVAsIDE1LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBtYWtlX251bWJlciAoeCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIG1ha2VfbnVtYmVyIChmeCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIG1ha2VfbnVtYmVyICh5KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgbWFrZV9udW1iZXIgKGZ5KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgbWFrZV9udW1iZXIgKGhwb3MpLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBtYWtlX251bWJlciAodnBvcyksCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIG1ha2VfbnVtYmVyIChoKSwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgbWNfY3Vyc29yX3R5cGVfdG9fbGlzcCAoY3Vyc29yX3R5 cGUpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYWtlX251bWJl ciAoY3Vyc29yX3dpZHRoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg YmFja2dyb3VuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFr ZV9udW1iZXIgKGFjdGl2ZV9jdXJzb3JfcCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIG1ha2VfbnVtYmVyIChtaW5pbWFsX3ApLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBtYWtlX251bWJlciAoZmxhdm9yKSwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFrZV9udW1iZXIgKHBvc2ludCkpOworICAq cmVzdWx0ID0gRmNvbnMgKGZpZnRlZW5fZWxlbWVudHMsICpyZXN1bHQpOworfQorCisvKiBSZXR1 cm4gYSBwb2ludGVyIHRvIHRoZSBnbHlwaCBXJ3MgcGh5c2ljYWwgY3Vyc29yIGlzIG9uLiAgVmFs dWUgaXMKKyAgIG51bGwgaWYgVydzIGN1cnJlbnQgbWF0cml4IGlzIGludmFsaWQsIHNvIHRoYXQg bm8gbWVhbmluZ2Z1bCBnbHlwaAorICAgY2FuIGJlIHJldHVybmVkLiAgKi8KKworc3RydWN0IGds eXBoICoKK21jX2dldF9waHlzX2N1cnNvcl9nbHlwaCAoc3RydWN0IHdpbmRvdyAqdywgaW50IHgs IGludCBocG9zLCBpbnQgdnBvcykKK3sKKyAgc3RydWN0IGdseXBoX3JvdyAqcm93OworICBzdHJ1 Y3QgZ2x5cGggKmdseXBoOworICBpZiAoISh2cG9zID49IDAKKyAgICAgICAgJiYgdnBvcyA8IHct PmN1cnJlbnRfbWF0cml4LT5ucm93cykpCisgICAgcmV0dXJuIE5VTEw7CisgIHJvdyA9IE1BVFJJ WF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB2cG9zKTsKKyAgaWYgKCFyb3ctPmVuYWJsZWRfcCkK KyAgICByZXR1cm4gTlVMTDsKKyAgaWYgKHctPmhzY3JvbGwpCisgICAgeworICAgICAgLyogV2hl biB0aGUgd2luZG93IGlzIGhzY3JvbGxlZCwgY3Vyc29yIGhwb3MgY2FuIGxlZ2l0aW1hdGVseSBi ZQorICAgICAgb3V0IG9mIGJvdW5kcywgYnV0IHdlIGRyYXcgdGhlIGN1cnNvciBhdCB0aGUgY29y cmVzcG9uZGluZworICAgICAgd2luZG93IG1hcmdpbiBpbiB0aGF0IGNhc2UuICAqLworICAgICAg aWYgKCFyb3ctPnJldmVyc2VkX3AgJiYgaHBvcyA8IDApCisgICAgICAgIGhwb3MgPSAwOworICAg ICAgaWYgKHJvdy0+cmV2ZXJzZWRfcCAmJiBocG9zID49IHJvdy0+dXNlZFtURVhUX0FSRUFdKQor ICAgICAgICBocG9zID0gcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxOworICAgIH0KKyAgaWYgKDAg PD0gaHBvcyAmJiBocG9zIDwgcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgZ2x5cGggPSByb3ct PmdseXBoc1tURVhUX0FSRUFdICsgaHBvczsKKyAgICBlbHNlCisgICAgICBnbHlwaCA9IE5VTEw7 CisgIHJldHVybiBnbHlwaDsKK30KKworLyogTVVMVElQTEVfQ1VSU09SUzogIFdlIGRvIG5vdCB1 c2UgdGhpcyBmdW5jdGlvbi4KKyAgIEhPUklaT05UQ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sIGFuZCBgeC1zdHJldGNoLWJsb2NrLWN1cnNvcicgaXMgbmlsLCBkb24ndCBkcmF3 IGEKKyAgICAgICAgIHJlY3RhbmdsZSBhcyB3aWRlIGFzIHRoZSBnbHlwaCwgYnV0IHVzZSBhIGNh bm9uaWNhbCBjaGFyYWN0ZXIKKyAgICAgICAgIHdpZHRoIGluc3RlYWQuICAqLworICAgICAgKndk ID0gc2NyYXRjaF9nbHlwaHMtPnBpeGVsX3dpZHRoOworICAgICAgaWYgKHggPCAwKQorICAgICAg ICB7CisgICAgICAgICAgKndkICs9IHg7CisgICAgICAgICAgeCA9IDA7CisgICAgICAgIH0KKyAg ICAgIGlmIChzY3JhdGNoX2dseXBocy0+dHlwZSA9PSBTVFJFVENIX0dMWVBICisgICAgICAgICAg JiYgIXhfc3RyZXRjaF9jdXJzb3JfcCkKKyAgICAgICAgKndkID0gbWluIChGUkFNRV9DT0xVTU5f V0lEVEggKGYpLCAqd2QpOworICAgICAgLyogRG9uJ3QgbGV0IHRoZSBob2xsb3cgY3Vyc29yIGds eXBoIGRlc2NlbmQgYmVsb3cgdGhlIGdseXBoIHJvdydzCisgICAgICAgICBhc2NlbnQgdmFsdWUs IGxlc3QgdGhlIGhvbGxvdyBjdXJzb3IgbG9va3MgZnVubnkuICAqLworICAgICAgYXNjZW50ID0g Z2x5cGhfcm93LT5hc2NlbnQ7CisgICAgICBpZiAoZ2x5cGhfcm93LT5hc2NlbnQgPCBzY3JhdGNo X2dseXBocy0+YXNjZW50KQorICAgICAgICB7CisgICAgICAgICAgeSAtPSBzY3JhdGNoX2dseXBo cy0+YXNjZW50IC0gZ2x5cGhfcm93LT5hc2NlbnQ7CisgICAgICAgICAgYXNjZW50ID0gc2NyYXRj aF9nbHlwaHMtPmFzY2VudDsKKyAgICAgICAgfQorICAgICAgLyogSWYgeSBpcyBiZWxvdyB3aW5k b3cgYm90dG9tLCBlbnN1cmUgdGhhdCB3ZSBzdGlsbCBzZWUgYSBjdXJzb3IuICAqLworICAgICAg aDAgPSBtaW4gKEZSQU1FX0xJTkVfSEVJR0hUIChmKSwgZ2x5cGhfcm93LT52aXNpYmxlX2hlaWdo dCk7CisgICAgICBoX3RlbXAgPSBtYXggKGgwLCBhc2NlbnQgKyBzY3JhdGNoX2dseXBocy0+ZGVz Y2VudCk7CisgICAgICBoMCA9IG1pbiAoaDAsIGFzY2VudCArIHNjcmF0Y2hfZ2x5cGhzLT5kZXNj ZW50KTsKKyAgICAgIHkwID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgICAgICBp ZiAoeSA8IHkwKQorICAgICAgICB7CisgICAgICAgICAgaF90ZW1wID0gbWF4IChoX3RlbXAgLSAo eTAgLSB5KSArIDEsIGgwKTsKKyAgICAgICAgICB5ID0geTAgLSAxOworICAgICAgICB9CisgICAg ICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICB5MCA9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3 KSAtIGgwOworICAgICAgICAgIGlmICh5ID4geTApCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIGhfdGVtcCArPSB5IC0geTA7CisgICAgICAgICAgICAgIHkgPSB5MDsKKyAgICAgICAgICAg IH0KKyAgICAgICAgfQorICAgICAgKmZ4ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAo dywgeCk7CisgICAgICAqZnkgPSBXSU5ET1dfVE9fRlJBTUVfUElYRUxfWSAodywgeSk7CisgICAg ICAqaCA9IGhfdGVtcDsKKyAgICAgIGlmIChjdXJzb3JfdHlwZSA9PSBIQkFSX0NVUlNPUikKKyAg ICAgICAgeworICAgICAgICAgIGludCBjdXJzb3JfaGVpZ2h0ID0gKGN1cnNvcl93aWR0aCA8IDEp ID8gbHJpbnQgKDAuMjUgKiAqaCkgOiBjdXJzb3Jfd2lkdGg7CisgICAgICAgICAgaWYgKGN1cnNv cl9oZWlnaHQgPiBnbHlwaF9yb3ctPmhlaWdodCkKKyAgICAgICAgICAgIGN1c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kKKyAgICAgICYmICFOSUxQIChCVkFSIChjdXJyZW50X2J1ZmZlciwgbWFy a19hY3RpdmUpKQorICAgICAgJiYgIU5JTFAgKG0pKQorICAgIHJldHVybiBtYWtlX251bWJlciAo KFBUIDwgWEZBU1RJTlQgKG0pKSA9PSBiZWdpbm5pbmdwCisgICAgICAgICAgICAgICAgICAgICAg ICA/IFBUCisgICAgICAgICAgICAgICAgICAgICAgICA6IGNsaXBfdG9fYm91bmRzIChCRUdWLCBY RkFTVElOVCAobSksIFpWKSk7CisgICAgICBlbHNlCisgICAgICAgIHJldHVybiBRbmlsOworfQor Cit2b2lkCittY19lbmdpbmUgKHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgc3RydWN0IGdseXBoICpn bHlwaCwgaW50IGFyZWEsIGludCByZWxhdGl2ZV94LAorICAgICAgICAgICAgc3RydWN0IHdpbmRv dyAqdywgcHRyZGlmZl90IHBvc2ludCwgZW51bSB0ZXh0X2N1cnNvcl9raW5kcyBjdXJzb3JfdHlw ZSwKKyAgICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGgsIExpc3BfT2JqZWN0IGZvcmVncm91bmQs IGJvb2wgYWN0aXZlX2N1cnNvcl9wLAorICAgICAgICAgICAgYm9vbCBtaW5pbWFsX3AsIGVudW0g dHlwZV9vZl9hY3Rpb24gYWN0aW9uX3R5cGUsIExpc3BfT2JqZWN0ICpyZXN1bHQpCit7CisgIGJv b2wgbWNfc3RkZXJyX3AgPSAhTklMUCAoQlZBUiAoY3VycmVudF9idWZmZXIsIG1jX3N0ZGVycikp OworICBpbnQgb3BvaW50X3ggPSB3LT5vdXRwdXRfY3Vyc29yLng7CisgIGludCBvcG9pbnRfeSA9 IHctPm91dHB1dF9jdXJzb3IueTsKKyAgaW50IG9wb2ludF9ocG9zID0gdy0+b3V0cHV0X2N1cnNv ci5ocG9zOworICBpbnQgb3BvaW50X3Zwb3MgPSB3LT5vdXRwdXRfY3Vyc29yLnZwb3M7CisgIExp c3BfT2JqZWN0IGNoYXJhY3RlciA9IChDSEFSQUNURVJQIChtYWtlX251bWJlciAoZ2x5cGgtPnUu Y2gpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgPyBGY2hhcl90b19zdHJpbmcgKG1ha2Vf bnVtYmVyIChnbHlwaC0+dS5jaCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgIDogUW5pbDsK KyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIGludCB0ZXh0X2FyZWFf d2lkdGggPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOworICBpbnQgZnJhbWVfY2hh cl93aWR0aCA9IEZSQU1FX0NPTFVNTl9XSURUSCAoZik7CisgIGludCB0ZW1wX3ggPSByZWxhdGl2 ZV94OworICBpbnQgdGVtcF95ID0gcm93LT55OworICBpbnQgdGVtcF9ocG9zID0gZ2x5cGggLSBy b3ctPmdseXBoc1tURVhUX0FSRUFdOworICBpbnQgdGVtcF92cG9zID0gTUFUUklYX1JPV19WUE9T IChyb3csIHctPmN1cnJlbnRfbWF0cml4KTsKKyAgaW50IHRlbXBfZmFjZV9pZCA9IGdseXBoLT5m YWNlX2lkOworICBpbnQgdGVtcF9jaGFycG9zID0gZ2x5cGgtPmNoYXJwb3M7CisKKy8qIC0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgIEJFR0lOOiAgQ0hBUl9H TFlQSCB8IEdMWVBITEVTU19HTFlQSCAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0gKi8KKyAgaWYgKGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgIHx8IGds eXBoLT50eXBlID09IEdMWVBITEVTU19HTFlQSCkKKyAgeworICAgIGlmIChtY19zdGRlcnJfcCkK KyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQgJWMg JTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNkICVz ICVzXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAg ICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAg ICAgICByZWxhdGl2ZV94LAorICAgICAgICAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAg ICAgICAgPyAnQycKKyAgICAgICAgIDogJ0cnKSwKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisg ICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAg IDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAg ICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgID8gJzAnCisgICAgICAg ICAgICAgICA6ICctJykpKSwKKyAgICAgICAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAg ICAgICBnbHlwaC0+dS5jaCwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBo LT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAg ICAgICBnbHlwaC0+eCwgZ2x5cGgtPnksIGdseXBoLT5ocG9zLCBnbHlwaC0+dnBvcywgZ2x5cGgt Pnp2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgKCghTklMUCAoY2hhcmFjdGVyKQorICAgICAg ICAgJiYgZ2x5cGgtPnUuY2ggPT0gOSkKKyAgICAgICAgICAgPyAiXFx0IgorICAgICAgICAgOiAo IU5JTFAgKGNoYXJhY3RlcikKKyAgICAgICAgICAgICYmIGdseXBoLT51LmNoID09IDEwKQorICAg ICAgICAgICA/ICJcXG4iCisgICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAg ICAgJiYgZ2x5cGgtPnUuY2ggPT0gMzIpCisgICAgICAgICAgID8gIlxccyIKKyAgICAgICAgIDog KCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAmJiBnbHlwaC0+dS5jaCAhPSA5CisgICAg ICAgICAgICAmJiBnbHlwaC0+dS5jaCAhPSAxMAorICAgICAgICAgICAgJiYgZ2x5cGgtPnUuY2gg IT0gMzIpCisgICAgICAgICAgID8gU1NEQVRBIChjaGFyYWN0ZXIpCisgICAgICAgICA6ICJcXD8i KSk7CisgIHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAq LworLyogICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTOiAgQ0hBUl9HTFlQSCB8IEdMWVBI TEVTU19HTFlQSCAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAg ICBjYXNlIE1VTFRJUExFX0NVUlNPUlM6CisgICAgeworICAgICAgbWNfaGVscGVyICh3LCB0ZW1w X3gsIC0xLCB0ZW1wX3ksIC0xLCB0ZW1wX2hwb3MsIHRlbXBfdnBvcywKKyAgICAgICAgICAgICAg ICAgLTEsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsCisgICAgICAgICAg ICAgICAgIG1jX2JnX2xzbCAodywgdGVtcF9mYWNlX2lkKSwgYWN0aXZlX2N1cnNvcl9wLAorICAg ICAgICAgICAgICAgICBtaW5pbWFsX3AsIE1DX0dMWVBILCB0ZW1wX2NoYXJwb3MsIHJlc3VsdCk7 CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAg ICAgICAgICAgSE9SSVpPTlRBTF9SVUxFUjogIENIQVJfR0xZUEggfCBHTFlQSExFU1NfR0xZUEgg ICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBIT1JJ Wk9OVEFMX1JVTEVSOgorICAgIHsKKyAgICAgIGludCB0ZW1wX3Zwb3MgPSBNQVRSSVhfUk9XX1ZQ T1MgKHJvdywgdy0+Y3VycmVudF9tYXRyaXgpOworICAgICAgaW50IHRlbXBfaHBvcyA9IGdseXBo IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9w ID0gKG9wb2ludF94ID09IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIG9wb2ludF9ocG9zID09IHRlbXBfaHBvcworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgb3BvaW50X3kgPT0gZ2x5cGgtPnkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIG9wb2ludF92cG9zID09IHRlbXBfdnBvcyk7CisgICAgICBpbnQgX2Z4LCBm eSwgX2gsIF93ZDsK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W50IF9meCwgZnksIF9o LCBfd2Q7CisgICAgICAgICAgbWNfZ2V0X3BoeXNfY3Vyc29yX2dlb21ldHJ5ICh3LCByb3csIHRl bXBfeCwgJl9meCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBf eSwgJmZ5LCB0ZW1wX2hwb3MsIHRlbXBfdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICZfaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgJl93ZCk7CisgICAg ICAgICAgdGVtcF94ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICB3aGlsZSAodGVt cF94IDw9IHRleHRfYXJlYV93aWR0aCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbWNf aGVscGVyICh3LCB0ZW1wX3gsIC0xLCB0ZW1wX3ksIGZ5LCB0ZW1wX2hwb3MsIHRlbXBfdnBvcywK KyAgICAgICAgICAgICAgICAgICAgICAgICAtMSwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwg Zm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBtY19iZ19sc2wgKHcsIHRlbXBf ZmFjZV9pZCksIGFjdGl2ZV9jdXJzb3JfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBtaW5p bWFsX3AsIE1DX0dMWVBITEVTUywgdGVtcF9jaGFycG9zLCByZXN1bHQpOworICAgICAgICAgICAg ICB0ZW1wX3ggKz0gZnJhbWVfY2hhcl93aWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQor ICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAg ICAgICAgIFZFUlRJQ0FMX1JVTEVSOiAgQ0hBUl9HTF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AgIGJvb2wgY3Vyc29yX2luX2ZyaW5nZV9wID0gb3BvaW50X3ggKyBmcmFtZV9jaGFyX3dpZHRo ID49IHRleHRfYXJlYV93aWR0aDsKKyAgICAgIGludCBmbGF2b3IgPSAoY3Vyc29yX2luX2ZyaW5n ZV9wCisgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisg ICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAg ICAgICAgICAgICAgIDogKGN1cnNvcl9pbl9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAg ICYmIHJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FM X0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfaW5fZnJpbmdlX3AK KyAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcAorICAg ICAgICAgICAgICAgICAgICAgICYmICFyb3ctPmNvbnRpbnVlZF9wKQorICAgICAgICAgICAgICAg ICAgICAgPyBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICA6IChnbHlwaCAtIHJv dy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAg ICAgICAgICAgICYmIG9wb2ludF94ID4gcmVsYXRpdmVfeCkKKyAgICAgICAgICAgICAgICAgICAg ID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgOiAoenZfcCkKKyAgICAgICAgICAg ICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSDsK KyAgICAgIGludCB0ZW1wX3ggPSAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJv dy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3ggPiByZWxh dGl2ZV94KQorICAgICAgICAgICAgICAgICAgICA/IG9wb2ludF94CisgICAgICAgICAgICAgICAg ICAgIDogcmVsYXRpdmVfeDsKKyAgICAgIGlmIChmbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJ R0hUX0FSUk9XCisgICAgICAgICAgfHwgZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xB U0gKKyAgICAgICAgICB8fCBmbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSKQorICAgICAgICBjdXJz b3JfdHlwZSA9IFJJR0hUX0ZSSU5HRV9CSVRNQVA7CisgICAgICBpbnQgX2Z4LCBfZnksIGgsIF93 ZDsKKyAgICAgIG1jX2dldF9waHlzX2N1cnNvcl9nZW9tZXRyeSAodywgcm93LCB0ZW1wX3gsICZf ZngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBfeSwgJl9meSwgdGVt cF9ocG9zLCB0ZW1wX3Zwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZo LCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCAmX3dkKTsKKyAgICAgIGludCBmeCA9IFdJTkRP V19URVhUX1RPX0ZSQU1FX1BJWEVMX1ggKHcsIG9wb2ludF94KTsKKyAgICAgIG1jX2hlbHBlciAo dywgdGVtcF94LCBmeCwgdGVtcF95LCAtMSwgdGVtcF9ocG9zLCB0ZW1wX3Zwb3MsCisgICAgICAg ICAgICAgICAgIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsCisgICAg ICAgICAgICAgICAgIG1jX2JnX2xzbCAodywgdGVtcF9mYWNlX2lkKSwgYWN0aXZlX2N1cnNvcl9w LAorICAgICAgICAgICAgICAgICBtaW5pbWFsX3AsIGZsYXZvciwgdGVtcF9jaGFycG9zLCByZXN1 bHQpOworICAgICAgYnJlYWs7CisgICAgfQorICB9CisgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICBFTkQ6ICBDSEFSX0dMWVBIIHwgR0xZUEhM RVNTX0dMWVBIICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8K KworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgQkVHSU46ICBTVFJFVENIX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8q IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBTVFJFVENI X0dMWVBIKQorICB7CisgICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAgZnByaW50ZiAoc3RkZXJy LAorICAgICAgICAiXG4gJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNngg JTRkICUxLjFkJTEuMWQgJTVkICU0ZCAgJTNkICAlM2QgJXMgJXNcbiIsCisgICAgICAgIGdseXBo IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0g MCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAg ICAgICdTJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlw aC0+b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5v YmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9i amVjdCkKKyAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAgICA6ICctJykpKSwKKyAg ICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAwdSwKKyAgICAgICAgZ2x5cGgtPmZh Y2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5y aWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+eCwgZ2x5cGgtPnksIGdseXBoLT5ocG9z LCBnbHlwaC0+dnBvcywgZ2x5cGgtPnp2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgIlxcUyIp OworICBzd2l0Y2ggKGFjdGlvbl90eXBlKQorICB7CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8K Ky8qICAgICAgICAgICAgICAgICAgICAgICAgTVVMVElQTEVfQ1VSU09SUzogIFNUUkVUQ0hfR0xZ UEggICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAg Y2FzZSBNVUxUSVBMRV9DVVJTT1JTOgorICAgIHsKKyAgICAgIG1jX2hlbHBlciAodywgdGVtcF94 LCAtMSwgdGVtcF95LCAtMSwgdGVtcF9ocG9zLCB0ZW1wX3Zwb3MsCisgICAgICAgICAgICAgICAg IC0xLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLAorICAgICAgICAgICAg ICAgICBtY19iZ19sc2wgKHcsIHRlbXBfZmFjZV9pZCksIGFjdGl2ZV9jdXJzb3JfcCwKKyAgICAg ICAgICAgICAgICAgbWluaW1hbF9wLCBNQ19HTFlQSCwgdGVtcF9jaGFycG9zLCByZXN1bHQpOwor ICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAg ICAgICAgICAgICAgICAgIEhPUklaT05UQUxfUlVMRVI6ICBTVFJFVENIX0dMWVBIICAgICAgICAg ICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgSE9SSVpP TlRBTF9SVUxFUjoKKyAgICB7CisgICAgICBpbnQgdGVtcF92cG9zID0gTUFUUklYX1JPV19WUE9T IChyb3csIHctPmN1cnJlbnRfbWF0cml4KTsKKyAgICAgIGludCB0ZW1wX2hwb3MgPSBnbHlwaCAt IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9 IChvcG9pbnRfeCA9PSByZWxhdGl2ZV94CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBvcG9pbnRfaHBvcyA9PSB0ZW1wX2hwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIG9wb2ludF95ID09IGdseXBoLT55CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBvcG9pbnRfdnBvcyA9PSB0ZW1wX3Zwb3MpOworICAgICAgaW50IF9meCwgZnks IF9oLCBfd2Q7CisgICAgICBtY19nZXRfcGh5c19jdXJzb3JfZ2VvbWV0cnkgKHcsIHJvdywgdGVt cF94LCAmX2Z4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wX3ksICZm eSwgdGVtcF9ocG9zLCB0ZW1wX3Zwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICZfaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgJl93ZCk7CisgICAgICBpZiAodGVt cF94IDw9IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3Ap CisgICAgICAgIHdoaWxlICh0ZW1wX3ggPCByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRo KQorICAgICAgICAgIHsKKyAgICAgICAgICAgIG1jX2hlbHBlciAodywgdGVtcF94LCAtMSwgdGVt cF95LCBmeSwgdGVtcF9ocG9zLCB0ZW1wX3Zwb3MsCisgICAgICAgICAgICAgICAgICAgICAgIC0x LCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAg ICAgICAgICBtY19iZ19sc2wgKHcsIHRlbXBfZmFjZV9pZCksIGFjdGl2ZV9jdXJzb3JfcCwKKyAg ICAgICAgICAgICAgICAgICAgICAgbWluaW1hbF9wLCBNQ19HTFlQSF9UQUIsIHRlbXBfY2hhcnBv cywgcmVzdWx0KTsKKyAgICAgICAgICAgIHRlbXBfeCArPSBmcmFtZV9jaGFyX3dpZHRoOworICAg ICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAodGVtcF94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoIDwg dGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICYmIHJlYWxfZmFrZV9jdXJzb3JfcAor ICAgICAgICAgICAgICAgICAmJiBnbHlwaC0+cGl4ZWxfd2lkdGggPiBmcmFtZV9jaGFyX3dpZHRo KQorICAgICAgICAgIHsKKyAgICAgICAgICAgIHRlbXBfeCArPSBmcmFtZV9jaGFyX3dpZHRoOwor ICAgICAgICAgICAgd2hpbGUgKHRlbXBfeCA8IHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lk dGgpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBtY19oZWxwZXIgKHcsIHRlbXBf eCwgLTEsIHRlbXBfeSwgZnksIHRlbXBfaHBvcywgdGVtcF92cG9zLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgLTEsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICBtY19iZ19sc2wgKHcsIHRlbXBfZmFjZV9pZCksIGFj dGl2ZV9jdXJzb3JfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG1pbmltYWxfcCwgTUNf R0xZUEhfVEFCLCB0ZW1wX2NoYXJwb3MsIHJlc3VsdCk7CisgICAgICAgICAgICAgICAgdGVtcF94 ICs9IGZyYW1lX2NoYXJfd2lkdGg7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICB9CisgICAg ICAvKiBJdCBpcyBwb3NzaWJsZSB0byB1c2UgTUNfR0xZUEggYW5kIGFkanVzdCB0aGUgZnggY29v cmRpbmF0ZTsgaG93ZXZlciwKKyAgICAgIHRoZSBtaWRkbGUtZG90IC8gc3BhY2UgZ2x5cGggb24g YSB3b3JkLXdyYXBwZWQgbGluZSB3aWxsIGJlIG92ZXJ3cml0dGVuCisgICAgICBudW1lcm91cyB0 aW1lcyBhbmQgaXMgdW5zaWdodGx5LiAqLworICAgICAgaWYgKGdseXBoIC0gcm93LT5nbHlwaHNb VEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxKQorICAgICAgICB7CisgICAgICAgICAg aW50IF9meCwgZnksIF9oLCBfd2Q7CisgICAgICAgICAgbWNfZ2V0X3BoeXNfY3Vyc29yX2dlb21l dHJ5ICh3LCByb3csIHRlbXBfeCwgJl9meCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHRlbXBfeSwgJmZ5LCB0ZW1wX2hwb3MsIHRlbXBfdnBvcywKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICZfaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0 aCwgJl93ZCk7CisgICAgICAgICAgLyogdGVtcF94ICs9IGdseXBoLT5waXhlbF93aWR0aDsgKi8K KyAgICAgICAgICB3aGlsZSAodGVtcF94IDw9IHRleHRfYXJlYV93aWR0aCkKKyAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgbWNfaGVscGVyICh3LCB0ZW1wX3gsIC0xLCB0ZW1wX3ksIGZ5LCB0 ZW1wX2hwb3MsIHRlbXBfdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAtMSwgY3Vyc29y X3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgICAgICAg ICBtY19iZ19sc2wgKHcsIHRlbXBfZmFjZV9pZCksIGFjdGl2ZV9jdXJzb3JfcCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICBtaW5pbWFsX3AsIE1DX0dMWVBITEVTUywgdGVtcF9jaGFycG9zLCBy ZXN1bHQpOworICAgICAgICAgICAgICB0ZW1wX3ggKz0gZnJhbWVfY2hhcl93aWR0aDsKKyAgICAg ICAgICAgIH0KKyAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgVkVSVElDQUxf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yAgICAgIGJvb2wgY3Vyc29yX2luX2ZyaW5nZV9wID0gb3BvaW50 X3ggKyBmcmFtZV9jaGFyX3dpZHRoID49IHRleHRfYXJlYV93aWR0aDsKKyAgICAgIGludCBmbGF2 b3IgPSAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1 bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JB Ul9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9pbl9mcmluZ2VfcAor ICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAg ICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICAgICAgICAgICA6 IChjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVu Y2F0ZWRfb25fcmlnaHRfcAorICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPmNvbnRpbnVl ZF9wKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAg ICAgICAgICA6IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2Fy ZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF94ID4gcmVsYXRpdmVfeCkK KyAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAg OiAoenZfcCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAg ICAgICAgICAgOiBNQ19HTFlQSF9UQUI7CisgICAgICBpbnQgdGVtcF94ID0gb3BvaW50X3g7Cisg ICAgICBpZiAoZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAg IHx8IGZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgfHwgZmxh dm9yID09IE1DX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgY3Vyc29yX3R5cGUgPSBSSUdIVF9GUklO R0VfQklUTUFQOworICAgICAgaW50IF9meCwgX2Z5LCBoLCBfd2Q7CisgICAgICBtY19nZXRfcGh5 c19jdXJzb3JfZ2VvbWV0cnkgKHcsIHJvdywgdGVtcF94LCAmX2Z4LAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICB0ZW1wX3ksICZfZnksIHRlbXBfaHBvcywgdGVtcF92cG9zLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmaCwgY3Vyc29yX3R5cGUsIGN1cnNv cl93aWR0aCwgJl93ZCk7CisgICAgICBpbnQgZnggPSBXSU5ET1dfVEVYVF9UT19GUkFNRV9QSVhF TF9YICh3LCBvcG9pbnRfeCk7CisgICAgICBtY19oZWxwZXIgKHcsIHRlbXBfeCwgZngsIHRlbXBf eSwgLTEsIHRlbXBfaHBvcywgdGVtcF92cG9zLAorICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jf dHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICBtY19iZ19s c2wgKHcsIHRlbXBfZmFjZV9pZCksIGFjdGl2ZV9jdXJzb3JfcCwKKyAgICAgICAgICAgICAgICAg bWluaW1hbF9wLCBmbGF2b3IsIHRlbXBfY2hhcnBvcywgcmVzdWx0KTsKKyAgICAgIGJyZWFrOwor ICAgIH0KKyAgfQorICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIEVORDogIFNUUkVUQ0hfR0xZUEggICAgICAgICAgICAgICAgICAg ICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisKKy8qIC0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCRUdJTjogIElNQUdFX0dM WVBIICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0g Ki8KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgIHsKKyAgICBpZiAo bWNfc3RkZXJyX3ApCisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICJcbiAlNSJwRCJk LyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4xZCAlNWQgJTRk ICAlM2QgICUzZCAlcyAlY1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FS RUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJl YV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ0knLAorICAgICAgICBnbHlw aC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICA/ ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8g J1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgICAg PyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lk dGgsCisgICAgICAgICh1bnNpZ25lZCBpbnQpIGdseXBoLT51LmltZ19pZCwKKyAgICAgICAgZ2x5 cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGds eXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+eCwgZ2x5cGgtPnksIGdseXBo LT5ocG9zLCBnbHlwaC0+dnBvcywgZ2x5cGgtPnp2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAg Jy4nKTsKKyAgc3dpdGNoIChhY3Rpb25fdHlwZSkKKyAgeworLyogLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t ICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTOiAgSU1BR0Vf R0xZUEggICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLwor ICAgIGNhc2UgTVVMVElQTEVfQ1VSU09SUzoKKyAgICB7CisgICAgICBtY19oZWxwZXIgKHcsIHRl bXBfeCwgLTEsIHRlbXBfeSwgLTEsIHRlbXBfaHBvcywgdGVtcF92cG9zLAorICAgICAgICAgICAg ICAgICAtMSwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwKKyAgICAgICAg ICAgICAgICAgbWNfYmdfbHNsICh3LCB0ZW1wX2ZhY2VfaWQpLCBhY3RpdmVfY3Vyc29yX3AsCisg ICAgICAgICAgICAgICAgIG1pbmltYWxfcCwgTUNfR0xZUEgsIHRlbXBfY2hhcnBvcywgcmVzdWx0 KTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAg ICAgICAgICAgICAgICAgICAgICAgSE9SSVpPTlRBTF9SVUxFUjogIElNQUdFX0dMWVBIICAgICAg ICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEhP UklaT05UQUxfUlVMRVI6CisgICAgeworICAgICAgaW50IHRlbXBfdnBvcyA9IE1BVFJJWF9ST1df VlBPUyAocm93LCB3LT5jdXJyZW50X21hdHJpeCk7CisgICAgICBpbnQgdGVtcF9ocG9zID0gZ2x5 cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgYm9vbCByZWFsX2Zha2VfY3Vyc29y X3AgPSAob3BvaW50X3ggPT0gcmVsYXRpdmVfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgb3BvaW50X2hwb3MgPT0gdGVtcF9ocG9zCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBvcG9pbnRfeSA9PSBnbHlwaC0+eQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgb3BvaW50X3Zwb3MgPT0gdGVtcF92cG9zKTsKKyAgICAgIGludCBfZngs IGZ5LCBfaCwgX3dkOworICAgICAgbWNfZ2V0X3BoeXNfY3Vyc29yX2dlb21ldHJ5ICh3LCByb3cs IHRlbXBfeCwgJl9meCwKKyAg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dywg dGVtcF94LCAmX2Z4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVt cF95LCAmZnksIHRlbXBfaHBvcywgdGVtcF92cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJl9oLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCAmX3dkKTsKKyAg ICAgICAgICB0ZW1wX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgIHdoaWxlICh0 ZW1wX3ggPD0gdGV4dF9hcmVhX3dpZHRoKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBt Y19oZWxwZXIgKHcsIHRlbXBfeCwgLTEsIHRlbXBfeSwgZnksIHRlbXBfaHBvcywgdGVtcF92cG9z LAorICAgICAgICAgICAgICAgICAgICAgICAgIC0xLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRo LCBmb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAodywgdGVt cF9mYWNlX2lkKSwgYWN0aXZlX2N1cnNvcl9wLAorICAgICAgICAgICAgICAgICAgICAgICAgIG1p bmltYWxfcCwgTUNfR0xZUEhMRVNTLCB0ZW1wX2NoYXJwb3MsIHJlc3VsdCk7CisgICAgICAgICAg ICAgIHRlbXBfeCArPSBmcmFtZV9jaGFyX3dpZHRoOworICAgICAgICAgICAgfQorICAgICAgICB9 CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAg ICAgICAgICAgICAgICAgICAgICAgVkVSVElDQUxfUlVMRVI6ICBJTUFHRV9HTFlQSCAgICAgICAg ICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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j0gdGV4dF9hcmVhX3dpZHRoOworICAgICAgaW50IGZsYXZvciA9IChjdXJzb3JfaW5fZnJp bmdlX3AKKyAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkK KyAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAg ICAgICAgICAgICAgICAgOiAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAg ICAgJiYgcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElD QUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9pbl9mcmluZ2Vf cAorICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wCisg ICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAg ICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgIDogKGdseXBoIC0g cm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAg ICAgICAgICAgICAgJiYgb3BvaW50X3ggPiByZWxhdGl2ZV94KQorICAgICAgICAgICAgICAgICAg ICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICA6ICh6dl9wKQorICAgICAgICAg ICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBI OworICAgICAgaWYgKGZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAg ICAgICB8fCBmbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgIHx8 IGZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIpCisgICAgICAgIGN1cnNvcl90eXBlID0gUklHSFRf RlJJTkdFX0JJVE1BUDsKKyAgICAgIGludCBfZngsIF9meSwgaCwgX3dkOworICAgICAgbWNfZ2V0 X3BoeXNfY3Vyc29yX2dlb21ldHJ5ICh3LCByb3csIHRlbXBfeCwgJl9meCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgdGVtcF95LCAmX2Z5LCB0ZW1wX2hwb3MsIHRlbXBfdnBv cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmgsIGN1cnNvcl90eXBlLCBj dXJzb3Jfd2lkdGgsICZfd2QpOworICAgICAgaW50IGZ4ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVf UElYRUxfWCAodywgb3BvaW50X3gpOworICAgICAgbWNfaGVscGVyICh3LCB0ZW1wX3gsIGZ4LCB0 ZW1wX3ksIC0xLCB0ZW1wX2hwb3MsIHRlbXBfdnBvcywKKyAgICAgICAgICAgICAgICAgaCwgY3Vy c29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgbWNf YmdfbHNsICh3LCB0ZW1wX2ZhY2VfaWQpLCBhY3RpdmVfY3Vyc29yX3AsCisgICAgICAgICAgICAg ICAgIG1pbmltYWxfcCwgZmxhdm9yLCB0ZW1wX2NoYXJwb3MsIHJlc3VsdCk7CisgICAgICBicmVh azsKKyAgICB9CisgIH0KKyAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgRU5EOiAgSU1BR0VfR0xZUEggICAgICAgICAgICAgICAg ICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworCisvKiAtLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJFR0lOOiAgQ09NUE9T SVRFX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tICovCisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IENPTVBPU0lURV9HTFlQSCkKKyAgewor ICAgIGlmIChtY19zdGRlcnJfcCkKKyAgICAgIHsKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLAor ICAgICAgICAgICJcbiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCIs CisgICAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAgICgo cm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAg ICAgIHJlbGF0aXZlX3gsCisgICAgICAgICAgJysnLAorICAgICAgICAgIGdseXBoLT5jaGFycG9z LAorICAgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICA/ICdCJwor ICAgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgICA/ICdT JworICAgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgICAg ICA/ICcwJworICAgICAgICAgICAgICAgICA6ICctJykpKSwKKyAgICAgICAgICBnbHlwaC0+cGl4 ZWxfd2lkdGgsCisgICAgICAgICAgKHVuc2lnbmVkIGludCkgZ2x5cGgtPnUuY21wLmlkKTsKKyAg ICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICU0ZCAlMS4xZCUxLjFkIiwKKyAgICAgICAgICBnbHlw aC0+ZmFjZV9pZCwKKyAgICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICAg IGdseXBoLT5yaWdodF9ib3hfbGluZV9wKTsKKyAgICAgIGlmIChnbHlwaC0+dS5jbXAuYXV0b21h dGljKQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIgJTVkICU0ZCAgJTNkICAlM2QgJXMgLiBb JWQtJWRdXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoLT54LCBnbHlwaC0+eSwg Z2x5cGgtPmhwb3MsIGdseXBoLT52cG9zLCBnbHlwaC0+enZfcCA/ICJaViIgOiAiLS0iLAorICAg ICAgICAgICAgICAgICAgICAgICAgIGdseXBoLT5zbGljZS5jbXAuZnJvbSwgZ2x5cGgtPnNsaWNl LmNtcC50byk7CisgICAgICAgIGVsc2UKKyAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJcbiIp OworICAgICAgfQorICBzd2l0Y2ggKGFjdGlvbl90eXBlKQorICB7CisvKiAtLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTOiAgQ09N UE9TSVRFX0dMWVBIICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t ICovCisgICAgY2FzZSBNVUxUSVBMRV9DVVJTT1JTOgorICAgIHsKKyAgICAgIG1jX2hlbHBlciAo dywgdGVtcF94LCAtMSwgdGVtcF95LCAtMSwgdGVtcF9ocG9zLCB0ZW1wX3Zwb3MsCisgICAgICAg ICAgICAgICAgIC0xLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLAorICAg ICAgICAgICAgICAgICBtY19iZ19sc2wgKHcsIHRlbXBfZmFjZV9pZCksIGFjdGl2ZV9jdXJzb3Jf cCwKKyAgICAgICAgICAgICAgICAgbWluaW1hbF9wLCBNQ19HTFlQSCwgdGVtcF9jaGFycG9zLCBy ZXN1bHQpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisv KiAgICAgICAgICAgICAgICAgICAgICAgSE9SSVpPTlRBTF9SVUxFUjogIENPTVBPU0lURV9HTFlQ SCAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNh c2UgSE9SSVpPTlRBTF9SVUxFUjoKKyAgICB7CisgICAgICBpbnQgdGVtcF92cG9zID0gTUFUUklY X1JPV19WUE9TIChyb3csIHctPmN1cnJlbnRfbWF0cml4KTsKKyAgICAgIGludCB0ZW1wX2hwb3Mg PSBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICBib29sIHJlYWxfZmFrZV9j dXJzb3JfcCA9IChvcG9pbnRfeCA9PSByZWxhdGl2ZV94CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBvcG9pbnRfaHBvcyA9PSB0ZW1wX2hwb3MKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIG9wb2ludF95ID09IGdseXBoLT55CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfdnBvcyA9PSB0ZW1wX3Zwb3MpOworICAgICAgaW50 IF9meCwgZnksIF9oLCBfd2Q7CisgICAgICBtY19nZXRfcGh5c19jdXJzb3JfZ2VvbWV0cnkgKHcs IHJvdywgdGVtcF94LCAmX2Z4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0 ZW1wX3ksICZmeSwgdGVtcF9ocG9zLCB0ZW1wX3Zwb3MsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICZfaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgJl93ZCk7CisgICAg ICBpZiAodGVtcF94IDw9IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICYmICFyZWFsX2Zha2Vf Y3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgdGVtcF94LCAtMSwgdGVtcF95LCBmeSwg dGVtcF9ocG9zLCB0ZW1wX3Zwb3MsCisgICAgICAgICAgICAgICAgICAgLTEsIGN1cnNvcl90eXBl LCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgICAgbWNfYmdfbHNs ICh3LCB0ZW1wX2ZhY2VfaWQpLCBhY3RpdmVfY3Vyc29yX3AsCisgICAgICAgICAgICAgICAgICAg bWluaW1hbF9wLCBNQ19HTFlQSCwgdGVtcF9jaGFycG9zLCByZXN1bHQpOworICAgICAgLyogSXQg aXMgcG9zc2libGUgdG8gdXNlIE1DX0dMWVBIIGFuZCBhZGp1c3QgdGhlIGZ4IGNvb3JkaW5hdGU7 IGhvd2V2ZXIsCisgICAgICB0aGUgbWlkZGxlLWRvdCAvIHNwYWNlIGdseXBoIG9uIGEgd29yZC13 cmFwcGVkIGxpbmUgd2lsbCBiZSBvdmVyd3JpdHRlbgorICAgICAgbnVtZXJvdXMgdGltZXMgYW5k IGlzIHVuc2lnaHRseS4gKi8KKyAgICAgIGlmIChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJF QV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMSkKKyAgICAgICAgeworICAgICAgICAgIGludCBfZngs IGZ5LCBfaCwgX3dkOworICAgICAgICAgIG1jX2dldF9waHlzX2N1cnNvcl9nZW9tZXRyeSAodywg cm93LCB0ZW1wX3gsICZfZngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICB0ZW1wX3ksICZmeSwgdGVtcF9ocG9zLCB0ZW1wX3Zwb3MsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmX2gsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsICZfd2Qp OworICAgICAgICAgIHRlbXBfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgd2hp bGUgKHRlbXBfeCA8PSB0ZXh0X2FyZWFfd2lkdGgpCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIG1jX2hlbHBlciAodywgdGVtcF94LCAtMSwgdGVtcF95LCBmeSwgdGVtcF9ocG9zLCB0ZW1w X3Zwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgLTEsIGN1cnNvcl90eXBlLCBjdXJzb3Jf d2lkdGgsIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgICAgICAgICAgbWNfYmdfbHNsICh3 LCB0ZW1wX2ZhY2VfaWQpLCBhY3RpdmVfY3Vyc29yX3AsCisgICAgICAgICAgICAgICAgICAgICAg ICAgbWluaW1hbF9wLCBNQ19HTFlQSExFU1MsIHRlbXBfY2hhcnBvcywgcmVzdWx0KTsKKyAgICAg ICAgICAgICAgdGVtcF94ICs9IGZyYW1lX2NoYXJfd2lkdGg7CisgICAgICAgICAgICB9CisgICAg ICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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zZWRbYXJlYV0gLSAx CisgICAgICAgICAgICAgICAgICAgJiYgTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSA9PSBa Vik7CisgICAgICBib29sIGN1cnNvcl9pbl9mcmluZ2VfcCA9IG9wb2ludF94ICsgZnJhbWVfY2hh cl93aWR0aCA+PSB0ZXh0X2FyZWFfd2lkdGg7CisgICAgICBpbnQgZmxhdm9yID0gKGN1cnNvcl9p bl9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdo dF9wKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cK KyAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAgICAgICAgICAg ICAgICAgICAmJiByb3ctPmNvbnRpbnVlZF9wKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19W RVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2luX2Zy aW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0 X3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAg ICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgOiAoZ2x5 cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAg ICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeCA+IHJlbGF0aXZlX3gpCisgICAgICAgICAgICAg ICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgIDogKHp2X3ApCisgICAg ICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgIDogTUNf R0xZUEg7CisgICA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VRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICA/ ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8g J1MnCisgICAgICAgICAgICA6ICctJykpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisg ICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAor ICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnUueHdpZGdl dCwKKyAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgZ2x5cGgtPnZwb3Ms IGdseXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7CisjZW5kaWYKKyAgc3dp dGNoIChhY3Rpb25fdHlwZSkKKyAgeworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAg ICAgICAgICAgICAgICAgICAgIE1VTFRJUExFX0NVUlNPUlM6ICBYV0lER0VUX0dMWVBIICAgICAg ICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgTVVM VElQTEVfQ1VSU09SUzoKKyAgICB7CisgICAgICBtY19oZWxwZXIgKHcsIHRlbXBfeCwgLTEsIHRl bXBfeSwgLTEsIHRlbXBfaHBvcywgdGVtcF92cG9zLAorICAgICAgICAgICAgICAgICAtMSwgY3Vy c29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgbWNf YmdfbHNsICh3LCB0ZW1wX2ZhY2VfaWQpLCBhY3RpdmVfY3Vyc29yX3AsCisgICAgICAgICAgICAg ICAgIG1pbmltYWxfcCwgTUNfR0xZUEgsIHRlbXBfY2hhcnBvcywgcmVzdWx0KTsKKyAgICAgIGJy ZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAg ICAgICAgICBIT1JJWk9OVEFMX1JVTEVSOiAgWFdJREdFVF9HTFlQSCAgICAgICAgICAgICAgICAg ICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEhPUklaT05UQUxfUlVM RVI6CisgICAgeworICAgICAgaW50IHRlbXBfdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCB3 LT5jdXJyZW50X21hdHJpeCk7CisgICAgICBpbnQgdGVtcF9ocG9zID0gZ2x5cGggLSByb3ctPmds eXBoc1tURVhUX0FSRUFdOworICAgICAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3AgPSAob3BvaW50 X3ggPT0gcmVsYXRpdmVfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3Bv aW50X2hwb3MgPT0gdGVtcF9ocG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvcG9pbnRfeSA9PSBnbHlwaC0+eQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgb3BvaW50X3Zwb3MgPT0gdGVtcF92cG9zKTsKKyAgICAgIGludCBfZngsIGZ5LCBfaCwgX3dk OworICAgICAgbWNfZ2V0X3BoeXNfY3Vyc29yX2dlb21ldHJ5ICh3LCByb3csIHRlbXBfeCwgJl9m eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcF95LCAmZnksIHRlbXBf aHBvcywgdGVtcF92cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmX2gs IGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsICZfd2QpOworICAgICAgaWYgKHRlbXBfeCA8PSB0 ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAg ICBtY19oZWxwZXIgKHcsIHRlbXBfeCwgLTEsIHRlbXBfeSwgZnksIHRlbXBfaHBvcywgdGVtcF92 cG9zLAorICAgICAgICAgICAgICAgICAgIC0xLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBm b3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAodywgdGVtcF9mYWNlX2lk KSwgYWN0aXZlX2N1cnNvcl9wLAorICAgICAgICAgICAgICAgICAgIG1pbmltYWxfcCwgTUNfR0xZ UEgsIHRlbXBfY2hhcnBvcywgcmVzdWx0KTsKKyAgICAgIC8qIEl0IGlzIHBvc3NpYmxlIHRvIHVz ZSBNQ19HTFlQSCBhbmQgYWRqdXN0IHRoZSBmeCBjb29yZGluYXRlOyBob3dldmVyLAorICAgICAg dGhlIG1pZGRsZS1kb3QgLyBzcGFjZSBnbHlwaCBvbiBhIHdvcmQtd3JhcHBlZCBsaW5lIHdpbGwg YmUgb3ZlcndyaXR0ZW4KKyAgICAgIG51bWVyb3VzIHRpbWVzIGFuZCBpcyB1bnNpZ2h0bHkuICov CisgICAgICBpZiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFth cmVhXSAtIDEpCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgX2Z4LCBmeSwgX2gsIF93ZDsKKyAg ICAgICAgICBtY19nZXRfcGh5c19jdXJzb3JfZ2VvbWV0cnkgKHcsIHJvdywgdGVtcF94LCAmX2Z4 LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcF95LCAmZnksIHRl bXBfaHBvcywgdGVtcF92cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJl9oLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCAmX3dkKTsKKyAgICAgICAgICB0ZW1w X3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgIHdoaWxlICh0ZW1wX3ggPD0gdGV4 dF9hcmVhX3dpZHRoKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19oZWxwZXIgKHcs IHRlbXBfeCwgLTEsIHRlbXBfeSwgZnksIHRlbXBfaHBvcywgdGVtcF92cG9zLAorICAgICAgICAg ICAgICAgICAgICAgICAgIC0xLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5k LAorICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAodywgdGVtcF9mYWNlX2lkKSwg YWN0aXZlX2N1cnNvcl9wLAorICAgICAgICAgICAgICAgICAgICAgICAgIG1pbmltYWxfcCwgTUNf R0xZUEhMRVNTLCB0ZW1wX2NoYXJwb3MsIHJlc3VsdCk7CisgICAgICAgICAgICAgIHRlbXBfeCAr PSBmcmFtZV9jaGFyX3dpZHRoOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBicmVh azsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAg ICAgICAgICBWRVJUSUNBTF9SVUxFUjogIFhXSURHRVRfR0xZUEggICAgICAgICAgICAgICAgICAg ICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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fd2lkdGggPj0gdGV4dF9h cmVhX3dpZHRoOworICAgICAgaW50IGZsYXZvciA9IChjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAg ICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAg ICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAg ICAgOiAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT5j b250aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX0JBQ0tT TEFTSAorICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9pbl9mcmluZ2VfcAorICAgICAgICAg ICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wCisgICAgICAgICAgICAg ICAgICAgICAgJiYgIXJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAgICAgICAgICA/IE1D X1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgIDogKGdseXBoIC0gcm93LT5nbHlwaHNb VEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAg JiYgb3BvaW50X3ggPiByZWxhdGl2ZV94KQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQ SExFU1MKKyAgICAgICAgICAgICAgICAgICA6ICh6dl9wKQorICAgICAgICAgICAgICAgICAgICAg PyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgaWYg KGZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBmbGF2 b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgIHx8IGZsYXZvciA9PSBN Q19WRVJUSUNBTF9CQVIpCisgICAgICAgIGN1cnNvcl90eXBlID0gUklHSFRfRlJJTkdFX0JJVE1B UDsKKyAgICAgIGludCBfZngsIF9meSwgaCwgX3dkOworICAgICAgbWNfZ2V0X3BoeXNfY3Vyc29y X2dlb21ldHJ5ICh3LCByb3csIHRlbXBfeCwgJl9meCwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgdGVtcF95LCAmX2Z5LCB0ZW1wX2hwb3MsIHRlbXBfdnBvcywKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJmgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgs ICZfd2QpOworICAgICAgaW50IGZ4ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywg b3BvaW50X3gpOworICAgICAgbWNfaGVscGVyICh3LCB0ZW1wX3gsIGZ4LCB0ZW1wX3ksIC0xLCB0 ZW1wX2hwb3MsIHRlbXBfdnBvcywKKyAgICAgICAgICAgICAgICAgaCwgY3Vyc29yX3R5cGUsIGN1 cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgbWNfYmdfbHNsICh3LCB0 ZW1wX2ZhY2VfaWQpLCBhY3RpdmVfY3Vyc29yX3AsCisgICAgICAgICAgICAgICAgIG1pbmltYWxf cCwgZmxhdm9yLCB0ZW1wX2NoYXJwb3MsIHJlc3VsdCk7CisgICAgICBicmVhazsKKyAgICB9Cisg IH0KKyAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBFTkQ6ICBYV0lER0VUX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICAgICAg Ki8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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wICYmIEJVRkZFUlAg KHctPmNvbnRlbnRzKQorICAgICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIG11bHRpcGxlX2N1cnNvcnNfY29uZikpCisgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhC VUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKSkKKyAgICB7CisgICAgICBMaXNwX09i amVjdCB3aW5kb3c7CisgICAgICBYU0VUV0lORE9XICh3aW5kb3csIHcpOworICAgICAgTGlzcF9P YmplY3Qgd2luZG93X3N0cmluZyA9IEZwcmluMV90b19zdHJpbmcgKHdpbmRvdywgUW5pbCk7Cisg ICAgICBjaGFyICp3aW5kb3dfY2hhciA9IFNTREFUQSAod2luZG93X3N0cmluZyk7CisgICAgICBm cHJpbnRmIChzdGRlcnIsICJtY19kcmF3X211bHRpcGxlX2N1cnNvcnMgKCVzKVxuIiwgd2luZG93 X2NoYXIpOworICAgIH0KKyNlbmRpZgorICBib29sIG1jX3N0ZGVycl9wID0gIU5JTFAgKEJWQVIg KGN1cnJlbnRfYnVmZmVyLCBtY19zdGRlcnIpKTsKKyAgcHRyZGlmZl90IG9wb2ludF9wdCA9IFBU OworICBpbnQgb3BvaW50X3ggPSB3LT5waHlzX2N1cnNvci54OworICBpbnQgb3BvaW50X3kgPSB3 LT5waHlzX2N1cnNvci55OworICBpbnQgb3BvaW50X2hwb3MgPSB3LT5waHlzX2N1cnNvci5ocG9z OworICBpbnQgb3BvaW50X3Zwb3MgPSB3LT5waHlzX2N1cnNvci52cG9zOworICBzdHJ1Y3QgZnJh bWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgTGlzcF9PYmplY3QgYnVmID0gdy0+Y29udGVu dHM7CisgIENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIg KGJ1Zik7CisgIHN0cnVjdCBidWZmZXIgKm9sZF9idWZmZXI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HctPnN0YXJ0KTsKKyAg c3RydWN0IHRleHRfcG9zIHN0YXJ0X3RleHRfcG9zaXRpb247CisgIFNFVF9URVhUX1BPU19GUk9N X01BUktFUiAoc3RhcnRfdGV4dF9wb3NpdGlvbiwgdy0+c3RhcnQpOworICBwdHJkaWZmX3QgYnl0 ZXBvcyA9IEJZVEVQT1MgKHN0YXJ0X3RleHRfcG9zaXRpb24pOworICBib29sIGJhcmZfY3Jhc2hf b25lID0gKGNoYXJwb3MgPCAwIHx8IChjaGFycG9zID49IEJVRl9CRUcgKGN1cnJlbnRfYnVmZmVy KSAmJiBjaGFycG9zIDw9IFpWKSkgPyBmYWxzZSA6IHRydWU7CisgIGlmIChiYXJmX2NyYXNoX29u ZSkKKyAgICB7CisgICAgICBpZiAob2xkX2J1ZmZlcikKKyAgICAgICAgc2V0X2J1ZmZlcl9pbnRl cm5hbCAob2xkX2J1ZmZlcik7CisgICAgICByZXR1cm47CisgICAgfQorICBib29sIGJhcmZfY3Jh c2hfdHdvID0gKGNoYXJwb3MgPT0gQllURV9UT19DSEFSIChieXRlcG9zKSkgPyBmYWxzZSA6IHRy dWU7CisgIGlmIChiYXJmX2NyYXNoX3R3bykKKyAgICB7CisgICAgICBpZiAob2xkX2J1ZmZlcikK KyAgICAgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7CisgICAgICByZXR1cm47 CisgICAgfQorICAvKiBgbWF0cml4X3JvdycgaW4gYGRpc3BuZXcuY2AgY29udGFpbnMgdGhlIGZv bGxvd2luZyB0ZXN0cywKKyAgZWFzc2VydCAobWF0cml4ICYmIG1hdHJpeC0+cm93cyk7CisgIGVh c3NlcnQgKHJvdyA+PSAwICYmIHJvdyA8IG1hdHJpeC0+bnJvd3MpOyAqLworICBib29sIGJhcmZf Y3Jhc2hfdGhyZWUgPSAody0+Y3VycmVudF9tYXRyaXggJiYgdy0+Y3VycmVudF9tYXRyaXgtPnJv d3MpID8gZmFsc2UgOiB0cnVlOworIC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AgICAgICAg Ki8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICBmb3IgKHZsaXN0ID0gQlZBUiAoYiwgbXVs dGlwbGVfY3Vyc29yc19jb25mKTsKKyAgICAgICBDT05TUCAodmxpc3QpOworICAgICAgIHZsaXN0 ID0gWENEUiAodmxpc3QpKQorICAgIHsKKyAgICAgIHNwZWNzID0gWENBUiAodmxpc3QpOworICAg ICAgcG9zaW50ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCBzcGVjcykpOworICAgICAg bGlzcF90eXBlID0gRm50aCAobWFrZV9udW1iZXIgKDEpLCBzcGVjcyk7CisgICAgICBpZiAoQ09O U1AgKGxpc3BfdHlwZSkpCisgICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJzb3Jf dHlwZSAoWENBUiAobGlzcF90eXBlKSk7CisgICAgICAgIGVsc2UKKyAgICAgICAgICBjdXJzb3Jf dHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKGxpc3BfdHlwZSk7CisgICAgICBpZiAoQ09O U1AgKGxpc3BfdHlwZSkpCisgICAgICAgIGN1cnNvcl93aWR0aCA9IFhJTlQgKFhDQVIgKFhDRFIg KGxpc3BfdHlwZSkpKTsKKyAgICAgICAgZWxzZQorICAgICAgICAgIGN1cnNvcl93aWR0aCA9IDE7 CisgICAgICBmb3JlZ3JvdW5kID0gRm50aCAobWFrZV9udW1iZXIgKDIpLCBzcGVjcyk7CisgICAg ICBpZiAoU1RSSU5HUCAoZm9yZWdyb3VuZCkpCisgICAgICAgIGZvcmVncm91bmQgPSBtY19jb2xv cl92ZWN0b3JfY2FsYyAodywgZm9yZWdyb3VuZCk7CisgICAgICBzdHJ1Y3QgZ2x5cGhfbWF0cml4 ICptYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAgICAgIGludCByb3dfc3RhcnQsIHJvd19l bmQsIHdpbmRvd19yb3dfc3RhcnQsIHdpbmRvd19yb3dfZW5kOworICAgICAgaW50IGk7CisgICAg ICBMaXNwX09iamVjdCB0ZW1wID0gUW5pbDsKKyAgICAgIExpc3BfT2JqZWN0IHZzcGVjcyA9IFFu aWw7CisgICAgICBmb3IgKGkgPSAwOyBpIDwgbWF0cml4LT5ucm93czsgKytpKQorICAgICAgICB7 CisgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93ID0gTUFUUklYX1JPVyAobWF0cml4LCBp KTsKKyAgICAgICAgICByb3dfc3RhcnQgPSBNQVRSSVhfUk9XX1NUQVJUX0NIQVJQT1MgKHJvdyk7 CisgICAgICAgICAgaWYgKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIGkgPT0gMSkKKyAgICAg ICAgICAgICAgIHx8IChoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCAmJiBpID09IDApKQorICAgICAg ICAgICAgd2luZG93X3Jvd19zdGFydCA9IHJvd19zdGFydDsKKyAgICAgICAgICBpZiAoIXJvdy0+ ZW5hYmxlZF9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICB3aW5kb3dfcm93X2VuZCA9 IHJvd19lbmQ7CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcm93X2VuZCA9IE1BVFJJ WF9ST1dfRU5EX0NIQVJQT1MgKHJvdyk7CisgICAgICAgICAgICAgICAgdGVtcCA9IGxpc3RuIChD T05TVFlQRV9IRUFQLCAzLCBtYWtlX251bWJlciAoaSksCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBtYWtlX251bWJlciAocm93X3N0YXJ0KSwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ha2VfbnVtYmVyIChy b3dfZW5kKSk7CisgICAgICAgICAgICAgICAgdnNwZWNzID0gRmNvbnMgKHRlbXAsIHZzcGVjcyk7 CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKHBvc2ludCA+PSB3aW5kb3df cm93X3N0YXJ0CisgICAgICAgICAgJiYgcG9zaW50IDw9IHdpbmRvd19yb3dfZW5kKQorICAgICAg ICB7CisgICAgICAgIExpc3BfT2JqZWN0IHZsaXN0OworICAgICAgICBmb3IgKHZsaXN0ID0gRm5y ZXZlcnNlICh2c3BlY3MpOworICAgICAgICAgICAgIENPTlNQICh2bGlzdCk7CisgICAgICAgICAg ICAgdmxpc3QgPSBYQ0RSICh2bGlzdCkpCisgICAgICAgICAgeworICAgICAgICAgICAgaW50IGNv dW50ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCBYQ0FSICh2bGlzdCkpKTsKKyAgICAg ICAgICAgIGludCBwb3Nfc3RhcnQgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMSksIFhDQVIg KHZsaXN0KSkpOworICAgICAgICAgICAgaW50IHBvc19lbmQgPSBYSU5UIChGbnRoIChtYWtlX251 bWJlciAoMiksIFhDQVIgKHZsaXN0KSkpOworICAgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAq cm93ID0gTUFUUklYX1JPVyAody0+Y3VycmVudF9tYXRyaXgsIGNvdW50KTsKKyAgICAgICAgICAg IGludCBhcmVhOworICAgICAgICAgICAgaW50IHJlbGF0aXZlX3ggPSAwOworICAgICAgICAgICAg Zm9yIChhcmVhID0gTEVGVF9NQVJHSU5fQVJFQTsgYXJlYSA8IExBU1RfQVJFQTsgKythcmVhKQor ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoICpnbHlwaCA9IHJv dy0+Z2x5cGhzW2FyZWFdOworICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGhfZW5k ID0gZ2x5cGggKyByb3ctPnVzZWRbYXJlYV07CisgICAgICAgICAgICAgICAgaWYgKGFyZWEgPT0g VEVYVF9BUkVBICYmIGdseXBoID09IGdseXBoX2VuZCAmJiBnbHlwaC0+Y2hhcnBvcyA+IDApCisg ICAgICAgICAgICAgICAgICArK2dseXBoX2VuZDsKKyAgICAgICAgICAgICAgICBpZiAobWNfc3Rk ZXJyX3AKKyAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGggPCBnbHlwaF9lbmQpCisgICAgICAg ICAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsCisiXG5jb3VudCAoJWQpIHwgd2luZG93X3Jvd19z dGFydC9lbmQgKCVkLyVkKSB8IHJvd19zdGFydC9lbmQgKCVkLyVkKVxuXAorPT09PT09PT09PT09 PT09PT09PT09PT09PT09PSBNVUxUSVBMRSBDVVJTT1JTID09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PVxuXAorR2x5cGgjL1RvdGFsIFJlbC5YIFQgICAgICAgUG9zIE8gICBXICAgICBD b2RlIEZhY2UgTFIgICAgIFggICAgWSBIUE9TIFZQT1MgWlYgQ1xuIiwKK2NvdW50LCB3aW5kb3df cm93X3N0YXJ0LCB3aW5kb3dfcm93X2VuZCwgcG9zX3N0YXJ0LCBwb3NfZW5kKTsKKyAgICAgICAg ICAgICAgICBmb3IgKDsgZ2x5cGggPCBnbHlwaF9lbmQ7ICsrZ2x5cGgpCisgICAgICAgICAgICAg ICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAg JiYgY291bnQgPiAwKQorICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zv cm1hdCA9PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGgtPmNoYXJwb3MgPT0g cG9zaW50CisgICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaC0+eSA8PSB3aW5kb3dfdGV4 dF9ib3R0b21feSAodykpCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg ICAgICAgICAgY3VycmVudF9jb2wgPSBtY19jdXJyZW50X2NvbHVtbiAodywgcG9zaW50KTsKKyAg ICAgICAgICAgICAgICAgICAgICAgIGlmIChOSUxQIChmb3JlZ3JvdW5kKSkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHJlZCAqLwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjdXJyZW50X2NvbCAlIDIgIT0gMAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhZmlsbF9jb2x1bW5fcCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQgPSBvZGRfY29sb3JfdmVjdG9yOworICAg ICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHllbGxvdyAqLworICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGlmIChjdXJyZW50X2NvbCAlIDIgPT0gMAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiAhZmlsbF9jb2x1bW5fcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGZvcmVncm91bmQgPSBldmVuX2NvbG9yX3ZlY3RvcjsKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAvKiByZWQgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY3VycmVu dF9jb2wgJSAyICE9IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZmlsbF9j b2x1bW5fcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJyZW50X2NvbCA8 PSBmaWxsX2NvbCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQgPSBv ZGRfY29sb3JfdmVjdG9yOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHllbGxvdyAq LworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjdXJyZW50X2NvbCAlIDIgPT0gMAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBmaWxsX2NvbHVtbl9wCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnJlbnRfY29sIDw9IGZpbGxfY29sKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZCA9IGV2ZW5fY29sb3JfdmVjdG9y OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGdyZWVuICovCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgaWYgKGZpbGxfY29sdW1uX3AKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgY3VycmVudF9jb2wgPiBmaWxsX2NvbCkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGZvcmVncm91bmQgPSBmaWxsX2NvbG9yX3ZlY3RvcjsKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgbWNfZW5naW5lIChyb3csIGds eXBoLCBhcmVhLCByZWxhdGl2ZV94LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICB3LCBwb3NpbnQsIEJBUl9DVVJTT1IsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYWN0aXZl X2N1cnNvcl9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtaW5pbWFsX3As IE1VTFRJUExFX0NVUlNPUlMsICZyZXN1bHQpOworICAgICAgICAgICAgICAgICAgICAgICAgYnJl YWs7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgIGVsc2Ug aWYgKG1jX3N0ZGVycl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgbWNfZHVtcF9nbHlwaCAo cm93LCBnbHlwaCwgYXJlYSwgcmVsYXRpdmVfeCk7CisgICAgICAgICAgICAgICAgICAgIHJlbGF0 aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorLyogYHctPm11bHRpcGxl X2N1cnNvcnNfY2FjaGUnIGlzIHNldCBmb3IgdGhlIHdpbmRvdywgbm90IGJ1ZmZlcit3aW5kb3cg LS0gaS5lLiwgYWxsIGJ1ZmZlcnMgYXBwZWFyaW5nCitpbiB0aGUgc2FtZSB3aW5kb3cgdmlhIGBz d2l0Y2gtdG8tYnVmZmVyJyB3aWxsIGhhdmUgYHctPm11bHRpcGxlX2N1cnNvcnNfY2FjaGUnLiAg VGhpcyBiZWhhdmlvcgoraXMgY29uc2lzdGVudCB3aXRoIGZ1bmN0aW9ucyBzdWNoIGFzIGBzZXQt d2luZG93LWRpc3BsYXktdGFibGUnLiAgV2UgZGVhbCB3aXRoIHRoaXMgaW4KK2Buc3Rlcm0ubScg LyBgdzMydGVybS5jJyAvIGB4dGVybS5jJyBieSBjb21wYXJpbmcgYHctPmNvbnRlbnRzJyB0byB0 aGUgdmFsdWUgb2YgdGhlIGBidWYnCitzdG9yZWQgaW4gYHctPm11bHRpcGxlX2N1cnNvcnNfY2Fj aGUnLiAqLworICBpZiAoIU5JTFAgKHJlc3VsdCkpCisgICAgd3NldF9tdWx0aXBsZV9jdXJzb3Jz X2NhY2hlICh3LCBsaXN0biAoQ09OU1RZUEVfSEVBUCwgMywKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIEZyZXZlcnNlIChyZXN1bHQpLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgRmNvbnMgKHdpbmRvdywgUW5pbCksCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBGY29ucyAody0+Y29udGVudHMsIFFuaWwpKSk7CisgIHctPm1jLmRyYXdfbXVsdGlw bGVfY3Vyc29ycyA9IGZhbHNlOworICBpZiAob2xkX2J1ZmZlcikKKyAgICBzZXRfYnVmZmVyX2lu dG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KSwgZmlmdGVlbl9lbGVtZW50cykpOworICAgICAgaHBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVt YmVyICg0KSwgZmlmdGVlbl9lbGVtZW50cykpOworICAgICAgdnBvcyA9IFhJTlQgKEZudGggKG1h a2VfbnVtYmVyICg1KSwgZmlmdGVlbl9lbGVtZW50cykpOworICAgICAgaCA9IFhJTlQgKEZudGgg KG1ha2VfbnVtYmVyICg2KSwgZmlmdGVlbl9lbGVtZW50cykpOworICAgICAgY3Vyc29yX3R5cGUg PSBtY19saXNwX3RvX2N1cnNvcl90eXBlIChGbnRoIChtYWtlX251bWJlciAoNyksIGZpZnRlZW5f ZWxlbWVudHMpKTsKKyAgICAgIGN1cnNvcl93aWR0aCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVy ICg4KSwgZmlmdGVlbl9lbGVtZW50cykpOworICAgICAgZm9yZWdyb3VuZCA9IEZudGggKG1ha2Vf bnVtYmVyICg5KSwgZmlmdGVlbl9lbGVtZW50cyk7CisgICAgICBiYWNrZ3JvdW5kID0gRm50aCAo bWFrZV9udW1iZXIgKDEwKSwgZmlmdGVlbl9lbGVtZW50cyk7CisgICAgICBhY3RpdmVfY3Vyc29y X3AgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMTEpLCBmaWZ0ZWVuX2VsZW1lbnRzKSk7Cisg ICAgICBtaW5pbWFsX3AgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMTIpLCBmaWZ0ZWVuX2Vs ZW1lbnRzKSk7CisgICAgICBmbGF2b3IgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMTMpLCBm aWZ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICBwb3NpbnQgPSBYSU5UIChGbnRoIChtYWtlX251bWJl ciAoMTQpLCBmaWZ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICBib29sIHJlbW92ZV9wID0gZmFsc2U7 CisgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgeCwgZng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Bvcywgdy0+cGh5c19jdXJzb3JfdHlwZSwgdy0+ cGh5c19jdXJzb3Jfd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgIGZsYXZvcik7Cisg IGZvciAodmxpc3QgPSBYQ0FSICh3LT5tdWx0aXBsZV9jdXJzb3JzX2NhY2hlKTsKKyAgICAgICBD T05TUCAodmxpc3QpOworICAgICAgIHZsaXN0ID0gWENEUiAodmxpc3QpKQorICAgIHsKKyAgICAg IGZpZnRlZW5fZWxlbWVudHMgPSBYQ0FSICh2bGlzdCk7CisgICAgICB4ID0gWElOVCAoRm50aCAo bWFrZV9udW1iZXIgKDApLCBmaWZ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICBmeCA9IFhJTlQgKEZu dGggKG1ha2VfbnVtYmVyICgxKSwgZmlmdGVlbl9lbGVtZW50cykpOworICAgICAgeSA9IFhJTlQg KEZudGggKG1ha2VfbnVtYmVyICgyKSwgZmlmdGVlbl9lbGVtZW50cykpOworICAgICAgZnkgPSBY SU5UIChGbnRoIChtYWtlX251bWJlciAoMyksIGZpZnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIGhw b3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoNCksIGZpZnRlZW5fZWxlbWVudHMpKTsKKyAg ICAgIHZwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoNSksIGZpZnRlZW5fZWxlbWVudHMp KTsKKyAgICAgIGggPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoNiksIGZpZnRlZW5fZWxlbWVu dHMpKTsKKyAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoRm50aCAo bWFrZV9udW1iZXIgKDcpLCBmaWZ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICBjdXJzb3Jfd2lkdGgg PSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoOCksIGZpZnRlZW5fZWxlbWVudHMpKTsKKyAgICAg IGZvcmVncm91bmQgPSBGbnRoIChtYWtlX251bWJlciAoOSksIGZpZnRlZW5fZWxlbWVudHMpOwor ICAgICAgYmFja2dyb3VuZCA9IEZudGggKG1ha2VfbnVtYmVyICgxMCksIGZpZnRlZW5fZWxlbWVu dHMpOworICAgICAgYWN0aXZlX2N1cnNvcl9wID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDEx KSwgZmlmdGVlbl9lbGVtZW50cykpOworICAgICAgbWluaW1hbF9wID0gWElOVCAoRm50aCAobWFr ZV9udW1iZXIgKDEyKSwgZmlmdGVlbl9lbGVtZW50cykpOworICAgICAgZmxhdm9yID0gWElOVCAo Rm50aCAobWFrZV9udW1iZXIgKDEzKSwgZmlmdGVlbl9lbGVtZW50cykpOworICAgICAgcG9zaW50 ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDE0KSwgZmlmdGVlbl9lbGVtZW50cykpOworICAg ICAgaWYgKGZsYXZvciA9PSBNQ19HTFlQSCkKKyAgICAgICAgbWNfZXJhc2VfZ2x5cGhfY3Vyc29y cyAodywgeCwgeSwgaHBvcywgdnBvcywgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZmxhdm9y KTsKKyAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgcmVtb3ZlX3Ag PSB0cnVlOworICAgICAgICAgICAgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHcsIHgsIGZ4LCB5LCBm eSwgaHBvcywgdnBvcywgaCwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgY3Vyc29yX3dpZHRoLCBiYWNrZ3JvdW5kLCBhY3RpdmVfY3Vyc29yX3AsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWluaW1hbF9wLCBmbGF2b3IsIHBvc2ludCwg cmVtb3ZlX3ApOworICAgICAgICAgIH0KKyAgICB9CisgIGlmIChkZWxldGVfY2FjaGUpCisgICAg d3NldF9tdWx0aXBsZV9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AgICAgTGlzcF9PYmplY3Qg d2luZG93X3N0cmluZyA9IEZwcmluMV90b19zdHJpbmcgKHdpbmRvdywgUW5pbCk7CisgICAgICBj aGFyICp3aW5kb3dfY2hhciA9IFNTREFUQSAod2luZG93X3N0cmluZyk7CisgICAgICBmcHJpbnRm IChzdGRlcnIsICJtY19kcmF3X2Nyb3NzaGFpcnMgKCVzKTogIGFjdGl2ZV9jdXJzb3JfcCAoJWQp IHwgbWluaW1hbF9wICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3dfY2hh ciwgYWN0aXZlX2N1cnNvcl9wLCBtaW5pbWFsX3ApOworICAgIH0KKyNlbmRpZgorICBib29sIG1j X3N0ZGVycl9wID0gIU5JTFAgKEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBtY19zdGRlcnIpKTsKKyAg cHRyZGlmZl90IG9wb2ludF9wdCA9ICh3ID09IFhXSU5ET1cgKHNlbGVjdGVkX3dpbmRvdykpCisg ICAgICAgICAgICAgICAgICAgICAgICA/IFBUCisgICAgICAgICAgICAgICAgICAgICAgICA6IFhJ TlQgKEZtYXJrZXJfcG9zaXRpb24gKHctPnBvaW50bSkpOworICBpbnQgb3BvaW50X3ggPSB3LT5w aHlzX2N1cnNvci54OworICBpbnQgb3BvaW50X3kgPSB3LT5waHlzX2N1cnNvci55OworICBpbnQg b3BvaW50X2hwb3MgPSB3LT5waHlzX2N1cnNvci5ocG9zOworICBpbnQgb3BvaW50X3Zwb3MgPSB3 LT5waHlzX2N1cnNvci52cG9zOworICBzdHJ1Y3QgZ2x5cGggKnJlYWxfcGh5c19jdXJzb3JfZ2x5 cGggPQorICAgIG1jX2dldF9waHlzX2N1cnNvcl9nbHlwaCAodywgb3BvaW50X3gsIG9wb2ludF9o cG9zLCBvcG9pbnRfdnBvcyk7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUp OworICBMaXNwX09iamVjdCBidWYgPSB3LT5jb250ZW50czsKKy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zc2VydCAobWF0cml4ICYmIG1hdHJpeC0+cm93cyk7CisgIGVhc3NlcnQgKHJv dyA+PSAwICYmIHJvdyA8IG1hdHJpeC0+bnJvd3MpOyAqLworICBib29sIGJhcmZfY3Jhc2hfdGhy ZWUgPSAody0+Y3VycmVudF9tYXRyaXggJiYgdy0+Y3VycmVudF9tYXRyaXgtPnJvd3MpID8gZmFs c2UgOiB0cnVlOworICBpZiAoYmFyZl9jcmFzaF90aHJlZSkKKyAgICB7CisgICAgICBpZiAob2xk X2J1ZmZlcikKKyAgICAgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7CisgICAg ICByZXR1cm47CisgICAgfQorICBib29sIGJhcmZfY3Jhc2hfZm91ciA9IChvcG9pbnRfdnBvcyA+ PSAwICYmIG9wb2ludF92cG9zIDwgdy0+Y3VycmVudF9tYXRyaXgtPm5yb3dzKSA/IGZhbHNlIDog dHJ1ZTsKKyAgaWYgKGJhcmZfY3Jhc2hfZm91cikKKyAgICB7CisgICAgICBpZiAob2xkX2J1ZmZl cikKKyAgICAgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7CisgICAgICByZXR1 cm47CisgICAgfQorICBpZiAoIUJVRkZFUlAgKGJ1ZikpCisgICAgeworICAgICAgaWYgKG9sZF9i dWZmZXIpCisgICAgICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworICAgICAg cmV0dXJuOworICAgIH0KKyAgaWYgKE5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKSkKKyAgICB7 CisgICAgICBpZiAob2xkX2J1ZmZlcikKKyAgICAgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAob2xk X2J1ZmZlcik7CisgICAgICByZXR1cm47CisgICAgfQorICBpZiAoTklMUCAoQlZBUiAoYiwgY3Jv c3NoYWlyc19ob3Jpem9udGFsX3J1bGVyKSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKGIsIGNyb3Nz aGFpcnNfdmVydGljYWxfcnVsZXIpKSkKKyAgICB7CisgICAgICBpZiAob2xkX2J1ZmZlcikKKyAg ICAgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7CisgICAgICByZXR1cm47Cisg ICAgfQorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBCRUdJTiBKT1VSTkVZIC4uLgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisgIGludCBm cmFtZV9jaGFyX3dpZHRoID0gRlJBTUVfQ09MVU1OX1dJRFRIIChmKTsKKyAgaW50IHRleHRfYXJl YV93aWR0aCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgIGJvb2wgY3Vyc29y X2luX2ZyaW5nZV9wID0gdy0+b3V0cHV0X2N1cnNvci54ICsgZnJhbWVfY2hhcl93aWR0aCA+PSB0 ZXh0X2FyZWFfd2lkdGg7CisgIHN0cnVjdCBnbHlwaF9yb3cgKmdseXBoX3JvdzsKKyAgaW50IGN1 cnNvcl93aWR0aCA9IDE7CisgIHB0cmRpZmZfdCBwb3NpbnQgPSAtMTsKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgIFNUQVJUIERJU1BMQVkgQU5EIFBSSU1F IElUCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAgcHRyZGlmZl90IGN1cnJlbnRfY29sID0g bWNfY3VycmVudF9jb2x1bW4gKHcsIG9wb2ludF9wdCk7CisgIGJvb2wgZmlsbF9jb2x1bW5fcCA9 ICFOSUxQIChCVkFSIChiLCBmaWxsX2NvbHVtbikpOworICBwdHJkaWZmX3QgZmlsbF9jb2wgPSBY SU5UIChCVkFSIChiLCBmaWxsX2NvbHVtbikpOworICBMaXNwX09iamVjdCByZXN1bHQgPSBRbmls OworICBpbnQgZmxhdm9yOworICAvKiBWYWx1ZXMgZm9yIHRoZSBjdXJyZW50IGNvbHVtbiBvZiB0 aGUgdmVydGljYWwgbGluZS4gKi8KKyAgTGlzcF9PYmplY3QgZm9yZWdyb3VuZCA9IEZtYWtlX3Zl Y3RvciAobWFrZV9udW1iZXIgKDMpLCBRbmlsKTsKKyAgZW51bSBmYWNlX2lkIGZhY2VfaWQ7Cisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ09M T1IgT0YgQ1JPU1NIQUlSUworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisgIGVudW0gZmFjZV9p ZCBldmVuX2ZhY2VfaWQgPQorICAgICghYWN0aXZlX2N1cnNvcl9wCisgICAgICYmICFOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnNfaW5hY3RpdmVfd2luZG93cykp KQorICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistZXZlbi1udW1iZXJl ZC1jb2x1bW4taW5hY3RpdmUtZmFjZSIpLCB0cnVlKQorICAgIDogbG9va3VwX25hbWVkX2ZhY2Ug KHcsIGYsIGludGVybiAoIistZXZlbi1udW1iZXJlZC1jb2x1bW4tZmFjZSIpLCB0cnVlKTsKKyAg c3RydWN0IGZhY2UgKmV2ZW5fZmFjZSA9IEZBQ0VfRlJPTV9JRC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gICAgJiYgZmlsbF9jb2x1bW5fcAorICAgICAgJiYgY3VycmVudF9jb2wg PD0gZmlsbF9jb2wpCisgICAgZm9yZWdyb3VuZCA9IGV2ZW5fY29sb3JfdmVjdG9yOworICAvKiBn cmVlbiAqLworICBpZiAoZmlsbF9jb2x1bW5fcAorICAgICAgJiYgY3VycmVudF9jb2wgPiBmaWxs X2NvbCkKKyAgICBmb3JlZ3JvdW5kID0gZmlsbF9jb2xvcl92ZWN0b3I7CisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIEVSQVNFIFRIRSBSRUFMIENV UlNPUgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBgdy0+cGh5c19jdXJzb3IueC95L2hw b3MvdnBvc2AgYXJlIGluY29ycmVjdCBhZnRlciBldmFsdWF0aW5nIChzY3JvbGwtbGVmdCAxKQor YSBjb3VwbGUgb2YgdGltZXMuICBSZWRpc3BsYXkgZXJhc2VzIHRoZSByZWFsIGN1cnNvciBhbG1v c3QgaW1tZWRpYXRlbHkgYWZ0ZXIKK2BtY19kcmF3X2Nyb3NzaGFpcnMnIHJ1bnMgaXRzIGNvdXJz ZSAtLSBhbG1vc3QgdG9vIHF1aWNrbHkgdG8gc2VlIGl0IGhhcHBlbmluZy4KK1RoZSBjaGFyYWN0 ZXIgd2hlcmUgRW1hY3MgdGhpbmtzIHRoZSByZWFsIGN1cnNvciBpcyBsb2NhdGVkIGdldHMgcmVk cmF3biwgYWxiaWV0Cit3aXRob3V0IHRoZSByZWFsIGN1cnNvci4gIEVtYWNzIHRoaW5rcyB0aGUg cmVhbCBjdXJzb3IgaXMgb25lIGNoYXJhY3RlciB0byB0aGUKK3JpZ2h0IG9mIHdoZXJlIGl0IHNo b3VsZC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AqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgUkVQTEFDRSBUSEUgUkVBTCBDVVJTT1IKKyoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworICBnbHlwaF9yb3cgPSBNQVRSSVhfUk9XICh3LT5jdXJyZW50X21hdHJpeCwgb3BvaW50X3Zw b3MpOworICBpZiAoIWN1cnNvcl9pbl9mcmluZ2VfcCkKKyAgICBmbGF2b3IgPSBNQ19HTFlQSDsK KyAgICAvKiBUaGlzIGNvbmRpdGlvbiBwcm9iYWJseSBkb2VzIG5vdCBleGlzdCBmb3IgdGhlIHJl YWwgZmFrZSBjdXJzb3IuICovCisgICAgZWxzZSBpZiAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAg ICAgICAgICAgJiYgZ2x5cGhfcm93LT5jb250aW51ZWRfcCkKKyAgICAgIGZsYXZvciA9IE1DX1BJ TENST1c7CisgICAgICBlbHNlIGlmIChjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAgICAgICAgICAg ICYmIGdseXBoX3Jvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgIGZsYXZvciA9IE1D X0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1c7CisgICAgICAgIGVsc2UgaWYgKGN1cnNvcl9p bl9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAmJiAhZ2x5cGhfcm93LT5jb250aW51ZWRfcAor ICAgICAgICAgICAgICAgICAmJiAhZ2x5cGhfcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAg ICAgICAgICBmbGF2b3IgPSBNQ19IT0xMT1dfUkVDVEFOR0xFOworICBmYWNlX2lkID0gKHJlYWxf cGh5c19jdXJzb3JfZ2x5cGggPT0gTlVMTCkKKyAgICAgICAgICAgICAgPyBERUZBVUxUX0ZBQ0Vf SUQKKyAgICAgICAgICAgICAgOiByZWFsX3BoeXNfY3Vyc29yX2dseXBoLT5mYWNlX2lkOworICBp bnQgb3BvaW50X2Z4ID0gLTE7CisgIGludCBvcG9pbnRfZnkgPSAtMTsKKyAgaW50IG9wb2ludF9o ID0gLTE7CisgIC8qIEZJWE1FOiAgUHV0IGluIHNvbWUgY29kZSB0byBkZWZhdWx0IHRvIEhPTExP V19CT1hfQ1VSU09SIGlmIHRoZSB1c2VyIGhhcworICB1bndpdHRpbmdseSBjb21lIHVwIHdpdGgg c29tZSB1bmFjY2VwdGFibGUgZm9ybSBvZiB1bnJlY29nbml6ZWQgY3Vyc29yIHR5cGUuICovCisg IExpc3BfT2JqZWN0IGN1cnNvcl9saXNwX3R5cGUgPSBCVkFSIChiLCBtY19yZWFsX2Zha2VfY3Vy c29yKTsKKyAgZW51bSB0ZXh0X2N1cnNvcl9raW5kcyB0ZW1wX2N1cnNvcl90eXBlID0gKENPTlNQ IChjdXJzb3JfbGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoWENBUiAoY3Vyc29yX2xpc3BfdHlw ZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IG1jX2xp c3BfdG9fY3Vyc29yX3R5cGUgKGN1cnNvcl9saXNwX3R5cGUpOworICBpZiAoZmxhdm9yID09IE1D X1BJTENST1cKKyAgICAgIHx8IGZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FS Uk9XCisgICAgICB8fCBmbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRSkKKyAgICB0ZW1wX2N1 cnNvcl90eXBlID0gUklHSFRfRlJJTkdFX0JJVE1BUDsKKyAgaW50IGluaXRpYWxfY3Vyc29yX3dp ZHRoID0gKENPTlNQIChjdXJzb3JfbGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gWElOVCAoWENBUiAoWENEUiAoY3Vyc29yX2xpc3BfdHlwZSkpKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiAxOworICBlbnVtIGZhY2VfaWQgY3Vyc29yX2ZhY2VfaWQg PQorICAgICghYWN0aXZlX2N1cnNvcl9wCisgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3 LT5jb250ZW50cyksIGNyb3NzaGFpcnNfaW5hY3RpdmVfd2luZG93cykpKQorICAgID8gbG9va3Vw X25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1m YWNlIiksIHRydWUpCisgICAgOiBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1y ZWFsLWZha2UtY3Vyc29yLWZhY2UiKSwgdHJ1ZSk7CisgIHN0cnVjdCBmYWNlICpjdXJzb3JfZmFj ZSA9IEZBQ0VfRlJPTV9JRCAoZiwgY3Vyc29yX2ZhY2VfaWQpOworICBMaXNwX09iamVjdCBjdXJz b3JfY29sb3IgPSBjdXJzb3JfZmFjZS0+bGZhY2VbTEZBQ0VfRk9SRUdST1VORF9JTkRFWF07Cisg IENIRUNLX1NUUklORyAoY3Vyc29yX2NvbG9yKTsKKyAgTGlzcF9PYmplY3QgY3Vyc29yX2ZnID0g KHRlbXBfY3Vyc29yX3R5cGUgPT0gTk9fQ1VSU09SKQorICAgICAgICAgICAgICAgICAgICAgICAg ICA/IGZvcmVncm91bmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgOiBtY19jb2xvcl92ZWN0 b3JfY2FsYyAodywgY3Vyc29yX2NvbG9yKTsKKyAgLyogRklYTUU6ICBUaGlzIGNyZWF0ZXMgdHdv IE1DX0dMWVBIIGF0IHRoZSBzYW1lIGxvY2F0aW9uIGFuZCBuZWVkcy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AgICAgICAgICAgICAgIG9wb2ludF9wdCwgJnJlc3VsdCk7CisgICAg ICBpZiAoZmxhdm9yID09IE1DX0dMWVBIKQorICAgICAgICBtY19nZXRfcGh5c19jdXJzb3JfZ2Vv bWV0cnkgKHcsIGdseXBoX3Jvdywgb3BvaW50X3gsICZvcG9pbnRfZngsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgb3BvaW50X3ksICZvcG9pbnRfZnksIG9wb2ludF9ocG9z LCBvcG9pbnRfdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmb3Bv aW50X2gsIEJBUl9DVVJTT1IsIGluaXRpYWxfY3Vyc29yX3dpZHRoLCAmX3dkKTsKKyAgICAgIG1j X2hlbHBlciAodywgb3BvaW50X3gsIG9wb2ludF9meCwgb3BvaW50X3ksIG9wb2ludF9meSwgb3Bv aW50X2hwb3MsCisgICAgICAgICAgICAgICAgIG9wb2ludF92cG9zLCBvcG9pbnRfaCwgQkFSX0NV UlNPUiwgY3Vyc29yX3dpZHRoLCBjdXJzb3JfZmcsCisgICAgICAgICAgICAgICAgIG1jX2JnX2xz bCAodywgZmFjZV9pZCksIGFjdGl2ZV9jdXJzb3JfcCwgbWluaW1hbF9wLCBmbGF2b3IsCisgICAg ICAgICAgICAgICAgIG9wb2ludF9wdCwgJnJlc3VsdCk7CisgICAgfQorICAgIGVsc2UgaWYgKCFt aW5pbWFsX3ApCisgICAgICB7CisgICAgICAgIGludCBfd2Q7CisgICAgICAgIGlmIChmbGF2b3Ig PT0gTUNfR0xZUEgpCisgICAgICAgICAgbWNfZ2V0X3BoeXNfY3Vyc29yX2dlb21ldHJ5ICh3LCBn bHlwaF9yb3csIG9wb2ludF94LCAmb3BvaW50X2Z4LAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgb3BvaW50X3ksICZvcG9pbnRfZnksIG9wb2ludF9ocG9zLCBvcG9pbnRf dnBvcywKKyAgICAgICAgICAgICAg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X3gsIG9w b2ludF9meCwgb3BvaW50X3ksIG9wb2ludF9meSwgb3BvaW50X2hwb3MsCisgICAgICAgICAgICAg b3BvaW50X3Zwb3MsIG9wb2ludF9oLCBMRUZUX0ZSSU5HRV9CSVRNQVAsIGluaXRpYWxfY3Vyc29y X3dpZHRoLAorICAgICAgICAgICAgIGZvcmVncm91bmRfbHNsLCBtY19iZ19sc2wgKHcsIGZhY2Vf aWQpLCBhY3RpdmVfY3Vyc29yX3AsIG1pbmltYWxfcCwKKyAgICAgICAgICAgICBNQ19PVkVSTEFZ X0FSUk9XX0JJVE1BUCwgb3BvaW50X3B0LCAmcmVzdWx0KTsKKyAgaWYgKG1pbmltYWxfcCkKKyAg ICBnb3RvIGNyb3NzaGFpcnNfZmluaXNoOworICBpZiAoTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWly c19ob3Jpem9udGFsX3J1bGVyKSkpCisgICAgZ290byB2ZXJ0aWNhbF9ydWxlcjsKKyAgICBlbHNl CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICBIT1JJWk9OVEFMIFJV TEVSOiAgRklSU1QgWCA9PiBFT0wKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5k CisgICAgICAgSE9SSVpPTlRBTCBSVUxFUjogIERSQVcgRkxPQVRJTkcgR0xZUEhMRVNTIExJTkUg KEVPTCBUTyBGUklOR0UpCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAgICB7CisgICAgICBz dHJ1Y3QgZ2x5cGhfcm93ICpyb3cgPSBNQVRSSVhfUk9XICh3LT5jdXJyZW50X21hdHJpeCwgb3Bv aW50X3Zwb3MpOworICAgICAgaW50IGFyZWE7CisgICAgICBpbnQgcmVsYXRpdmVfeCA9IDA7Cisg ICAgICBmb3IgKGFyZWEgPSBMRUZUX01BUkdJTl9BUkVBOyBhcmVhIDwgTEFTVF9BUkVBOyArK2Fy ZWEpCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoID0gcm93LT5nbHlw aHNbYXJlYV07CisgICAgICAgICAgc3RydWN0IGdseXBoICpnbHlwaF9lbmQgPSBnbHlwaCArIHJv dy0+dXNlZFthcmVhXTsKKyAgICAgICAgICAvKiBHbHlwaCBmb3IgYSBsaW5lIGVuZCBpbiB0ZXh0 LiAgKi8KKyAgICAgICAgICBpZiAoYXJlYSA9PSBURVhUX0FSRUEgJiYgZ2x5cGggPT0gZ2x5cGhf ZW5kICYmIGdseXBoLT5jaGFycG9zID4gMCkKKyAgICAgICAgICAgICsrZ2x5cGhfZW5kOworICAg ICAgICAgIGlmIChtY19zdGRlcnJfcAorICAgICAgICAgICAgICAmJiBnbHlwaCA8IGdseXBoX2Vu ZCkKKyAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwKKyJcbj09PT09PT09PT09PT09PT09PT09 PT09PT09PT0gSE9SSVpPTlRBTCBSVUxFUiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09XG5cCitHbHlwaCMvVG90YWwgUmVsLlggVCAgICAgICBQb3MgTyAgIFcgICAgIENvZGUgRmFj ZSBMUiAgICAgWCAgICBZIEhQT1MgVlBPUyBaViBDXG4iKTsKKyAgICAgICAgICBmb3IgKDsgZ2x5 cGggPCBnbHlwaF9lbmQ7ICsrZ2x5cGgpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIG1j X2VuZ2luZSAocm93LCBnbHlwaCwgYXJlYSwgcmVsYXRpdmVfeCwKKyAgICAgICAgICAgICAgICAg ICAgICAgICB3LCBwb3NpbnQsIEhCQVJfQ1VSU09SLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQs IGFjdGl2ZV9jdXJzb3JfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBtaW5pbWFsX3AsIEhP UklaT05UQUxfUlVMRVIsICZyZXN1bHQpOworICAgICAgICAgICAgICByZWxhdGl2ZV94ICs9IGds eXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICBWRVJUSUNBTCBSVUxFUjogIENPTUJJTkFU SU9OIE9GIEdMWVBIICYgR0xZUEhMRVNTIENVUlNPUlMKKyoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworICB2ZXJ0aWNhbF9ydWxlcjoKKyAgaWYgKE5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnNfdmVy dGljYWxfcnVsZXIpKSkKKyAgICBnb3RvIGNyb3NzaGFpcnNfZmluaXNoOworICAgIGVsc2UKKyAg ICAgIHsKKyAgICAgICAgaW50IGhlYWRlcl9saW5lX2Zvcm1hdCA9IFdJTkRPV19IRUFERVJfTElO RV9IRUlHSFQgKHcpOworICAgICAgICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXggPSB3LT5j dXJyZW50X21hdHJpeDsKKyAgICAgICAgaW50IHJvd19zdGFydCwgcm93X2VuZCwgd2luZG93X3Jv d19zdGFydCwgd2luZG93X3Jvd19lbmQ7CisgICAgICAgIGludCBpOworICAgICAgICBMaXNwX09i amVjdCB0ZW1wID0gUW5pbDsKKyAgICAgICAgTGlzcF9PYmplY3QgdnNwZWNzID0gUW5pbDsKKyAg ICAgICAgZm9yIChpID0gMDsgaSA8IG1hdHJpeC0+bnJvd3M7ICsraSkKKyAgICAgICAgICB7Cisg ICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cgPSBNQVRSSVhfUk9XIChtYXRyaXgsIGkp OworICAgICAgICAgICAgcm93X3N0YXJ0ID0gTUFUUklYX1JPV19TVEFSVF9DSEFSUE9TIChyb3cp OworICAgICAgICAgICAgaWYgKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIGkgPT0gMSkKKyAg ICAgICAgICAgICAgICAgfHwgKGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwICYmIGkgPT0gMCkpCisg ICAgICAgICAgICAgIHdpbmRvd19yb3dfc3RhcnQgPSByb3dfc3RhcnQ7CisgICAgICAgICAgICBp ZiAoIXJvdy0+ZW5hYmxlZF9wKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgd2lu ZG93X3Jvd19lbmQgPSByb3dfZW5kOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAg ICAgICB9CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgICByb3dfZW5kID0gTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KTsKKyAgICAgICAg ICAgICAgICAgIHRlbXAgPSBsaXN0biAoQ09OU1RZUEVfSEVBUCwgMywgbWFrZV9udW1iZXIgKGkp LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYWtl X251bWJlciAocm93X3N0YXJ0KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgbWFrZV9udW1iZXIgKHJvd19lbmQpKTsKKyAgICAgICAgICAgICAgICAg IHZzcGVjcyA9IEZjb25zICh0ZW1wLCB2c3BlY3MpOworICAgICAgICAgICAgICAgIH0KKyAgICAg ICAgICB9CisgICAgICAgIExpc3BfT2JqZWN0IHZsaXN0OworICAgICAgICBmb3IgKHZsaXN0ID0g Rm5yZXZlcnNlICh2c3BlY3MpOworICAgICAgICAgICAgIENPTlNQICh2bGlzdCk7CisgICAgICAg ICAgICAgdmxpc3QgPSBYQ0RSICh2bGlzdCkpCisgICAgICAgICAgeworICAgICAgICAgICAgaW50 IGNvdW50ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCBYQ0FSICh2bGlzdCkpKTsKKyAg ICAgICAgICAgIGludCBwb3Nfc3RhcnQgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMSksIFhD QVIgKHZsaXN0KSkpOworICAgICAgICAgICAgaW50IHBvc19lbmQgPSBYSU5UIChGbnRoIChtYWtl X251bWJlciAoMiksIFhDQVIgKHZsaXN0KSkpOworICAgICAgICAgICAgc3RydWN0IGdseXBoX3Jv dyAqcm93ID0gTUFUUklYX1JPVyAody0+Y3VycmVudF9tYXRyaXgsIGNvdW50KTsKKyAgICAgICAg ICAgIGludCB0ZW1wX3Zwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgdy0+Y3VycmVudF9tYXRy aXgpOworICAgICAgICAgICAgaW50IGFyZWE7CisgICAgICAgICAgICBpbnQgcmVsYXRpdmVfeCA9 IDA7CisgICAgICAgICAgICBmb3IgKGFyZWEgPSBMRUZUX01BUkdJTl9BUkVBOyBhcmVhIDwgTEFT VF9BUkVBOyArK2FyZWEpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzdHJ1Y3Qg Z2x5cGggKmdseXBoID0gcm93LT5nbHlwaHNbYXJlYV07CisgICAgICAgICAgICAgICAgc3RydWN0 IGdseXBoICpnbHlwaF9lbmQgPSBnbHlwaCArIHJvdy0+dXNlZFthcmVhXTsKKyAgICAgICAgICAg ICAgICBpZiAoYXJlYSA9PSBURVhUX0FSRUEgJiYgZ2x5cGggPT0gZ2x5cGhfZW5kICYmIGdseXBo LT5jaGFycG9zID4gMCkKKyAgICAgICAgICAgICAgICAgICsrZ2x5cGhfZW5kOworICAgICAgICAg ICAgICAgIGlmIChtY19zdGRlcnJfcAorICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaCA8IGds eXBoX2VuZCkKKyAgICAgICAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwKKyJcbmNvdW50ICgl ZCkgfCB3aW5kb3dfcm93X3N0YXJ0L2VuZCAoJWQvJWQpIHwgcm93X3N0YXJ0L2VuZCAoJWQvJWQp XG5cCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PSBWRVJUSUNBTCBSVUxFUiA9PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09XG5cCitHbHlwaCMvVG90YWwgUmVsLlggVCAgICAg ICBQb3MgTyAgIFcgICAgIENvZGUgRmFjZSBMUiAgICAgWCAgICBZIEhQT1MgVlBPUyBaViBDXG4i LAorY291bnQsIHdpbmRvd19yb3dfc3RhcnQsIHdpbmRvd19yb3dfZW5kLCBwb3Nfc3RhcnQsIHBv c19lbmQpOworICAgICAgICAgICAgICAgIGZvciAoOyBnbHlwaCA8IGdseXBoX2VuZDsgKytnbHlw aCkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgYm9vbCByZWFsX2Zh a2VfY3Vyc29yX3AgPSAob3BvaW50X3kgPT0gZ2x5cGgtPnkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3Zwb3MgPT0gdGVtcF92cG9zKTsK KyAgICAgICAgICAgICAgICAgICAgaWYgKCgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiBjb3Vu dCA+IDApCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09 IDApCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAocmVsYXRpdmVfeCArIGdseXBoLT5waXhl bF93aWR0aCA+IG9wb2ludF94CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGgg PT0gZ2x5cGhfZW5kIC0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT55IDw9 IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJl YWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAg ICAgICAgICAgICBtY19lbmdpbmUgKHJvdywgZ2x5cGgsIGFyZWEsIHJlbGF0aXZlX3gsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcsIHBvc2ludCwgQkFSX0NVUlNPUiwgY3Vy c29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBhY3RpdmVfY3Vyc29yX3AsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIG1pbmltYWxfcCwgVkVSVElDQUxfUlVMRVIsICZyZXN1bHQpOwor ICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgfQor ICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKG1jX3N0ZGVycl9wKQorICAgICAgICAgICAg ICAgICAgICAgICAgbWNfZHVtcF9nbHlwaCAocm93LCBnbHlwaCwgYXJlYSwgcmVsYXRpdmVfeCk7 CisgICAgICAgICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOwor ICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAg fQorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIFNFVCBUSEUgQ0FDSEUKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICBjcm9zc2hhaXJz X2ZpbmlzaDoKKyAgaWYgKCFOSUxQIChyZXN1bHQpKQorICAgIHdzZXRfY3Jvc3NoYWlyc19jYWNo ZSAodywgbGlzdG4gKENPTlNUWVBFX0hFQVAsIDMsCisgICAgICAgICA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vyc29yc19jb25mKSkKKyAgICAgICAgICB8fCAhTklMUCAoQlZB UiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpKQorICAgIHsKKyAgICAgIExp c3BfT2JqZWN0IHdpbmRvdzsKKyAgICAgIFhTRVRXSU5ET1cgKHdpbmRvdywgdyk7CisgICAgICBM aXNwX09iamVjdCB3aW5kb3dfc3RyaW5nID0gRnByaW4xX3RvX3N0cmluZyAod2luZG93LCBRbmls KTsKKyAgICAgIGNoYXIgKndpbmRvd19jaGFyID0gU1NEQVRBICh3aW5kb3dfc3RyaW5nKTsKKyAg ICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX3JlZHJhd19jcm9zc2hhaXJzICglcylcbiIsIHdpbmRv d19jaGFyKTsKKyAgICB9CisjZW5kaWYKKyAgTGlzcF9PYmplY3Qgdmxpc3QgPSBRbmlsOworICBM aXNwX09iamVjdCBmaWZ0ZWVuX2VsZW1lbnRzID0gUW5pbDsKKyAgaW50IHgsIGZ4LCB5LCBmeSwg aHBvcywgdnBvcywgaDsKKyAgZW51bSB0ZXh0X2N1cnNvcl9raW5kcyBjdXJzb3JfdHlwZTsKKyAg aW50IGN1cnNvcl93aWR0aDsKKyAgTGlzcF9PYmplY3QgZm9yZWdyb3VuZCA9IFFuaWw7CisgIExp c3BfT2JqZWN0IGJhY2tncm91bmQgPSBRbmlsOworICBib29sIGFjdGl2ZV9jdXJzb3JfcCA9IGZh bHNlOworICBib29sIG1pbmltYWxfcCA9IGZhbHNlOworICBpbnQgZmxhdm9yOworICBwdHJkaWZm X3QgcG9zaW50OworICBmb3IgKHZsaXN0ID0gWENBUiAody0+Y3Jvc3NoYWlyc19jYWNoZSk7Cisg ICAgICAgQ09OU1AgKHZsaXN0KTsKKyAgICAgICB2bGlzdCA9IFhDRFIgKHZsaXN0KSkKKyAgICB7 CisgICAgICBmaWZ0ZWVuX2VsZW1lbnRzID0gWENBUiAodmxpc3QpOworICAgICAgeCA9IFhJTlQg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lNJWkVfQk9VTkRdOwor ICBzdGFydCA9IGNsb2NrKCk7CisjZW5kaWYKKyovCisjaWZkZWYgR0xZUEhfREVCVUcKKyAgaWYg KHRyYWNlX3JlZGlzcGxheV9wICYmIEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgJiYgKCFO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG11bHRpcGxlX2N1cnNvcnNfY29uZikp CisgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3No YWlycykpKSkKKyAgICB7CisgICAgICBMaXNwX09iamVjdCB3aW5kb3c7CisgICAgICBYU0VUV0lO RE9XICh3aW5kb3csIHcpOworICAgICAgTGlzcF9PYmplY3Qgd2luZG93X3N0cmluZyA9IEZwcmlu MV90b19zdHJpbmcgKHdpbmRvdywgUW5pbCk7CisgICAgICBjaGFyICp3aW5kb3dfY2hhciA9IFNT REFUQSAod2luZG93X3N0cmluZyk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19lcmFzZV9j cm9zc2hhaXJzICglcyk6ICBkZWxldGVfY2FjaGUgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAg ICAgICAgd2luZG93X2NoYXIsIGRlbGV0ZV9jYWNoZSk7CisgICAgfQorI2VuZGlmCisgIExpc3Bf T2JqZWN0IHZsaXN0ID0gUW5pbDsKKyAgTGlzcF9PYmplY3QgZmlmdGVlbl9lbGVtZW50cyA9IFFu aWw7CisgIGludCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIGg7CisgIGVudW0gdGV4dF9jdXJz b3Jfa2luZHMgY3Vyc29yX3R5cGU7CisgIGludCBjdXJzb3Jfd2lkdGg7CisgIExpc3BfT2JqZWN0 IGZvcmVncm91bmQgPSBRbmlsOworICBMaXNwX09iamVjdCBiYWNrZ3JvdW5kID0gUW5pbDsKKyAg Ym9vbCBhY3RpdmVfY3Vyc29yX3AgPSBmYWxzZTsKKyAgYm9vbCBtaW5pbWFsX3AgPSBmYWxzZTsK KyAgaW50IGZsYXZvciA9IE5PX0ZMQVZPUjsKKyAgcHRyZGlmZl90IHBvc2ludDsKKyAgbWNfZXJh c2VfZ2x5cGhfY3Vyc29ycyAodywgdy0+cGh5c19jdXJzb3IueCwgdy0+cGh5c19jdXJzb3IueSwg dy0+cGh5c19jdXJzb3IuaHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+cGh5c19j dXJzb3IudnBvcywgdy0+cGh5c19jdXJzb3JfdHlwZSwgdy0+cGh5c19jdXJzb3Jfd2lkdGgsCisg ICAgICAgICAgICAgICAgICAgICAgICAgIGZsYXZvcik7CisgIGZvciAodmxpc3QgPSBYQ0FSICh3 LT5jcm9zc2hhaXJzX2NhY2hlKTsKKyAgICAgICBDT05TUCAodmxpc3QpOworICAgICAgIHZsaXN0 ID0gWENEUiAodmxpc3QpKQorICAgIHsKKyAgICAgIGZpZnRlZW5fZWxlbWVudHMgPSBYQ0FSICh2 bGlzdCk7CisgICAgICB4ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCBmaWZ0ZWVuX2Vs ZW1lbnRzKSk7CisgICAgICBmeCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgxKSwgZmlmdGVl bl9lbGVtZW50cykpOworICAgICAgeSA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgZmlm dGVlbl9lbGVtZW50cykpOworICAgICAgZnkgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMyks IGZpZnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIGhwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJl ciAoNCksIGZpZnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIHZwb3MgPSBYSU5UIChGbnRoIChtYWtl X251bWJlciAoNSksIGZpZnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIGggPSBYSU5UIChGbnRoICht YWtlX251bWJlciAoNiksIGZpZnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIGN1cnNvcl90eXBlID0g bWNfbGlzcF90b19jdXJzb3JfdHlwZSAoRm50aCAobWFrZV9udW1iZXIgKDcpLCBmaWZ0ZWVuX2Vs ZW1lbnRzKSk7CisgICAgICBjdXJzb3Jfd2lkdGggPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAo OCksIGZpZnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIGZvcmVncm91bmQgPSBGbnRoIChtYWtlX251 bWJlciAoOSksIGZpZnRlZW5fZWxlbWVudHMpOworICAgICAgYmFja2dyb3VuZCA9IEZudGggKG1h a2VfbnVtYmVyICgxMCksIGZpZnRlZW5fZWxlbWVudHMpOworICAgICAgYWN0aXZlX2N1cnNvcl9w ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDExKSwgZmlmdGVlbl9lbGVtZW50cykpOworICAg ICAgbWluaW1hbF9wID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDEyKSwgZmlmdGVlbl9lbGVt ZW50cykpOworICAgICAgZmxhdm9yID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDEzKSwgZmlm dGVlbl9lbGVtZW50cykpOworICAgICAgcG9zaW50ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIg KDE0KSwgZmlmdGVlbl9lbGVtZW50cykpOworICAgICAgaWYgKGZsYXZvciA9PSBNQ19HTFlQSCkK KyAgICAgICAgbWNfZXJhc2VfZ2x5cGhfY3Vyc29ycyAodywgeCwgeSwgaHBvcywgdnBvcywgY3Vy c29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZmxhdm9yKTsKKyAgICAgICAgZWxzZQorICAgICAgICAg IHsKKyAgICAgICAgICAgIGJvb2wgcmVtb3ZlX3AgPSB0cnVlOworICAgICAgICAgICAgbWNfZHJh d19lcmFzZV9oeWJyaWQgKHcsIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgaCwgY3Vyc29yX3R5 cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoLCBiYWNr Z3JvdW5kLCBhY3RpdmVfY3Vyc29yX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgbWluaW1hbF9wLCBmbGF2b3IsIHBvc2ludCwgcmVtb3ZlX3ApOworICAgICAgICAgIH0KKyAg ICB9CisgIGlmIChkZWxldGVfY2FjaGUpCisgICAgd3NldF9jcm9zc2hhaXJzX2NhY2hlICh3LCBR bmlsKTsKKyAgdy0+bWMuZXJhc2VfY3Jvc3NoYWlycyA9IGZhbHNlOworLyoKKyNpZmRlZiBHTFlQ SF9ERUJVRworICBlbmQgPSBjbG9jaygpOworICBjcHVfdGltZV91c2VkID0gKChkb3VibGUpIChl bmQgLSBzdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7CisgIGR0b2FzdHIgKGJ1Zl90aW1lLCBzaXpl b2YgYnVmX3RpbWUsIDAsIDAsIGNwdV90aW1lX3VzZWQpOworICBkZWJ1Z19tZXRob2RfYWRkICh3 LCAibWNfZXJhc2VfY3Jvc3NoYWlyczogIFRJTUUgKCVzKSIsIGJ1Zl90aW1lKTsKKyNlbmRpZgor Ki8KK30KKwordm9pZAorbWNfcmVtb3ZlX211bHRpcGxlX2N1cnNvcnMgKHN0cnVjdCB3aW5kb3cg KncpCit7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBib29sIGRl bGV0ZV9jYWNoZSA9ICh3LT5tYy5yZWRpc3BsYXlfcHJlc2VydmVfZWNob19hcmVhID09IDgKKyAg ICAgICAgICAgICAgICAgICAgICAgfHwgbWNfcmVkaXNwbGF5ID09IDMpCisgICAgICAgICAgICAg ICAgICAgICAgPyBmYWxzZQorICAgICAgICAgICAgICAgICAgICAgIDogdHJ1ZTsKKyNpZmRlZiBH TFlQSF9ERUJVRworICBpZiAodHJhY2VfcmVkaXNwbGF5X3AgJiYgQlVGRkVSUCAody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gICYmIFdJTkRPV1AgKFhDQVIgKEZudGggKG1ha2VfbnVtYmVy ICgxKSwgdy0+bXVsdGlwbGVfY3Vyc29yc19jYWNoZSkpKQorICAgICAgJiYgdyA9PSBYV0lORE9X IChYQ0FSIChGbnRoIChtYWtlX251bWJlciAoMSksIHctPm11bHRpcGxlX2N1cnNvcnNfY2FjaGUp KSkKKyAgICAgICYmIEVRICh3LT5jb250ZW50cywgWENBUiAoRm50aCAobWFrZV9udW1iZXIgKDIp LCB3LT5tdWx0aXBsZV9jdXJzb3JzX2NhY2hlKSkpKQorICAgIHsKKyAgICAgIHVwZGF0ZV9iZWdp biAoZik7CisgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgIG1jX2VyYXNlX211bHRpcGxlX2N1 cnNvcnMgKHcsIGRlbGV0ZV9jYWNoZSk7CisgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAg dXBkYXRlX2VuZCAoZik7CisgICAgfQorfQorCit2b2lkCittY19yZW1vdmVfY3Jvc3NoYWlycyAo c3RydWN0IHdpbmRvdyAqdykKK3sKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFt ZSk7CisgIGJvb2wgZGVsZXRlX2NhY2hlID0gKCh3LT5tYy5yZWRpc3BsYXlfcHJlc2VydmVfZWNo b19hcmVhID09IDgKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8IG1jX3JlZGlzcGxheSA9PSAz KQorICAgICAgICAgICAgICAgICAgICAgICAmJiAhdy0+bWMuZHJhd19jcm9zc2hhaXJzCisgICAg ICAgICAgICAgICAgICAgICAgICYmICF3LT5tYy5lcmFzZV9jcm9zc2hhaXJzKQorICAgICAgICAg ICAgICAgICAgICAgID8gZmFsc2UKKyAgICAgICAgICAgICAgICAgICAgICA6IHRydWU7CisjaWZk ZWYgR0xZUEhfREVCVUcKKyAgaWYgKHRyYWNlX3JlZGlzcGxheV9wICYmIEJVRkZFUlAgKHctPmNv bnRlbnRzKQorICAgICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG11 bHRpcGxlX2N1cnNvcnNfY29uZikpCisgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIg KHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKSkKKyAgICB7CisgICAgICBMaXNwX09iamVjdCB3 aW5kb3c7CisgICAgICBYU0VUV0lORE9XICh3aW5kb3csIHcpOworICAgICAgTGlzcF9PYmplY3Qg d2luZG93X3N0cmluZyA9IEZwcmluMV90b19zdHJpbmcgKHdpbmRvdywgUW5pbCk7CisgICAgICBj aGFyICp3aW5kb3dfY2hhciA9IFNTREFUQSAod2luZG93X3N0cmluZyk7CisgICAgICBmcHJpbnRm IChzdGRlcnIsICJtY19yZW1vdmVfY3Jvc3NoYWlycyAoJXMpOiAgZGVsZXRlX2NhY2hlICglZClc biIsCisgICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3dfY2hhciwgZGVsZXRlX2NhY2hlKTsK KyAgICB9CisjZW5kaWYKKyAgLyogUmVtb3ZlIGZha2UgY3Vyc29ycy4gIElmIHdlIHJlbHkgdXBv biBgdXBkYXRlX2ZyYW1lJyB0byByZW1vdmUgZmFrZSBjdXJzb3JzLAorICB0aGVuIGl0IHdvdWxk IGJlIHRvbyBsYXRlIHRvIHJlbW92ZSBmYWtlIGN1cnNvcnMgZnJvbSBhbGwgYXJlYXMgb2YgdGhl IHZpc2libGUKKyAgd2luZG93IHdoZW4gY3V0dGluZy9wYXN0aW5nIHRleHQgYW5kIHBlcmhhcHMg YSBmZXcgb3RoZXIgc2l0dWF0aW9ucy4gKi8KKyAgaWYgKCF3LT5wc2V1ZG9fd2luZG93X3AKKyAg ICAgICYmICFNSU5JX1dJTkRPV19QICh3KQorICAgICAgJiYgIU5JTFAgKHctPmNyb3NzaGFpcnNf Y2FjaGUpCisgICAgICAmJiBXSU5ET1dQIChYQ0FSIChGbnRoIChtYWtlX251bWJlciAoMSksIHct PmNyb3NzaGFpcnNfY2FjaGUpKSkKKyAgICAgICYmIHcgPT0gWFdJTkRPVyAoWENBUiAoRm50aCAo bWFrZV9udW1iZXIgKDEpLCB3LT5jcm9zc2hhaXJzX2NhY2hlKSkpCisgICAgICAmJiBFUSAody0+ Y29udGVudHMsIFhDQVIgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgdy0+Y3Jvc3NoYWlyc19jYWNo ZSkpKSkKKyAgICB7CisgICAgICB1cGRhdGVfYmVnaW4gKGYpOworICAgICAgYmxvY2tfaW5wdXQg KCk7CisgICAgICBtY19lcmFzZV9jcm9zc2hhaXJzICh3LCBkZWxldGVfY2FjaGUpOworICAgICAg dW5ibG9ja19pbnB1dCAoKTsKKyAgICAgIHVwZGF0ZV9lbmQgKGYpOworICAgIH0KK30KKwordm9p ZAorbWNfbXVsdGlwbGVfY3Vyc29yc19wb3J0YWwgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgb24s IGJvb2wgYWN0aXZlX2N1cnNvcl9wKQoreworI2lmZGVmIEdMWVBIX0RFQlVHCisgIGlmICh0cmFj ZV9yZWRpc3BsYXlfcCAmJiBCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICYmICghTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtdWx0aXBsZV9jdXJzb3JzX2NvbmYpKQorICAg ICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMp KSkpCisgICAgeworICAgICAgTGlzcF9PYmplY3Qgd2luZG93OworICAgICAgWFNFVFdJTkRPVyAo d2luZG93LCB3KTsKKyAgICAgIExpc3BfT2JqZWN0IHdpbmRvd19zdHJpbmcgPSBGcHJpbjFfdG9f c3RyaW5nICh3aW5kb3csIFFuaWwpOworICAgICAgY2hhciAqd2luZG93X2NoYXIgPSBTU0RBVEEg KHdpbmRvd19zdHJpbmcpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfbXVsdGlwbGVfY3Vy c29yc19wb3J0YWwgKCVzKTogIG9uICglZCkgfCBhY3RpdmVfY3Vyc29yX3AgKCVkKVxuIiwKKyAg ICAgICAgICAgICAgICAgICAgICAgIHdpbmRvd19jaGFyLCBvbiwgYWN0aXZlX2N1cnNvcl9wKTsK KyAgICB9CisjZW5kaWYKKyAgYm9vbCBtaW5pbWFsX3AgPSAoIXctPm1jLmRyYXdfbXVsdGlwbGVf Y3Vyc29ycworICAgICAgICAgICAgICAgICAgICAmJiBtY19yZWRpc3BsYXlfcHJlc2VydmVfZWNo b19hcmVhICE9IDgKKyAgICAgICAgICAgICAgICAgICAgJiYgbWNfcmVkaXNwbGF5ICE9IDMKKyAg ICAgICAgICAgICAgICAgICAgJiYgdyA9PSBYV0lORE9XIChzZWxlY3RlZF93aW5kb3cpCisgICAg ICAgICAgICAgICAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbXVs dGlwbGVfY3Vyc29yc19kcmF3X2ZvcnRod2l0aCkpKTsKKyAgaWYgKHctPm1jLmVyYXNlX211bHRp cGxlX2N1cnNvcnMgJiYgdy0+bWMuZHJhd19tdWx0aXBsZV9jdXJzb3JzCisgICAgICAmJiAhTUlO SV9XSU5ET1dfUCAodykKKyAgICAgICYmICFOSUxQICh3LT5tdWx0aXBsZV9jdXJzb3JzX2NhY2hl KQorICAgICAgJiYgV0lORE9XUCAoWENBUiAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB3LT5tdWx0 aXBsZV9jdXJzb3JzX2NhY2hlKSkpCisgICAgICAmJiB3ID09IFhXSU5ET1cgKFhDQVIgKEZudGgg KG1ha2VfbnVtYmVyICgxKSwgdy0+bXVsdGlwbGVfY3Vyc29yc19jYWNoZSkpKQorICAgICAgJiYg RVEgKHctPmNvbnRlbnRzLCBYQ0FSIChGbnRoIChtYWtlX251bWJlciAoMiksIHctPm11bHRpcGxl X2N1cnNvcnNfY2FjaGUpKSkpCisgICAgbWNfZXJ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AoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtdWx0aXBsZV9jdXJzb3JzX2NvbmYpKSkK KyAgICBtY19kcmF3X211bHRpcGxlX2N1cnNvcnMgKHcsIGFjdGl2ZV9jdXJzb3JfcCwgbWluaW1h bF9wKTsKKyAgICBlbHNlIGlmIChvbgorICAgICAgICAgICAgICYmICFNSU5JX1dJTkRPV19QICh3 KQorICAgICAgICAgICAgICYmICFOSUxQICh3LT5tdWx0aXBsZV9jdXJzb3JzX2NhY2hlKQorICAg ICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG11bHRpcGxl X2N1cnNvcnNfY29uZikpCisgICAgICAgICAgICAgJiYgV0lORE9XUCAoWENBUiAoRm50aCAobWFr ZV9udW1iZXIgKDEpLCB3LT5tdWx0aXBsZV9jdXJzb3JzX2NhY2hlKSkpCisgICAgICAgICAgICAg JiYgdyA9PSBYV0lORE9XIChYQ0FSIChGbnRoIChtYWtlX251bWJlciAoMSksIHctPm11bHRpcGxl X2N1cnNvcnNfY2FjaGUpKSkKKyAgICAgICAgICAgICAmJiBFUSAody0+Y29udGVudHMsIFhDQVIg KEZudGggKG1ha2VfbnVtYmVyICgyKSwgdy0+bXVsdGlwbGVfY3Vyc29yc19jYWNoZSkpKSkKKyAg ICAgIHsKKyAgICAgICAgbWNfZXJhc2VfbXVsdGlwbGVfY3Vyc29ycyAodywgZmFsc2UpOworICAg ICAgICBtY19yZWRyYXdfbXVsdGlwbGVfY3Vyc29ycyAodyk7CisgICAgICB9Cit9CisKK3ZvaWQK K21jX2Nyb3NzaGFpcnNfcG9ydGFsIChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIG9uLCBib29sIGFj dGl2ZV9jdXJzb3JfcCkKK3sKKyAgLyogUmVtb3ZlIGNyb3NzaGFpcnMgYW5kIGRlbGV0ZSB0aGUg Y2FjaGUsIGJ1dCBPTkxZIGlmIHdlIHBsYW4gb24gcmVkcmF3aW5n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19jcm9zc2hhaXJzX3BvcnRhbCAoJXMpOiAgb24gKCVkKSB8IGFjdGl2ZV9jdXJzb3Jf cCAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93X2NoYXIsIG9uLCBhY3Rp dmVfY3Vyc29yX3ApOworICAgIH0KKyNlbmRpZgorICBib29sIG1pbmltYWxfcCA9ICghdy0+bWMu ZHJhd19jcm9zc2hhaXJzCisgICAgICAgICAgICAgICAgICAgICYmIG1jX3JlZGlzcGxheV9wcmVz ZXJ2ZV9lY2hvX2FyZWEgIT0gOAorICAgICAgICAgICAgICAgICAgICAmJiBtY19yZWRpc3BsYXkg IT0gMworICAgICAgICAgICAgICAgICAgICAmJiB3ID09IFhXSU5ET1cgKHNlbGVjdGVkX3dpbmRv dykKKyAgICAgICAgICAgICAgICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBjcm9zc2hhaXJzX2RyYXdfZm9ydGh3aXRoKSkpOworICBpZiAody0+bWMuZXJhc2VfY3Jv c3NoYWlycyAmJiB3LT5tYy5kcmF3X2Nyb3NzaGFpcnMKKyAgICAgICYmICFNSU5JX1dJTkRPV19Q ICh3KQorICAgICAgJiYgIU5JTFAgKHctPmNyb3NzaGFpcnNfY2FjaGUpCisgICAgICAmJiBXSU5E T1dQIChYQ0FSIChGbnRoIChtYWtlX251bWJlciAoMSksIHctPmNyb3NzaGFpcnNfY2FjaGUpKSkK KyAgICAgICYmIHcgPT0gWFdJTkRPVyAoWENBUiAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB3LT5j cm9zc2hhaXJzX2NhY2hlKSkpCisgICAgICAmJiBFUSAody0+Y29udGVudHMsIFhDQVIgKEZudGgg KG1ha2VfbnVtYmVyICgyKSwgdy0+Y3Jvc3NoYWlyc19jYWNoZSkpKSkKKyAgICBtY19lcmFzZV9j cm9zc2hhaXJzICh3LCB0cnVlKTsKKyAgLyogYHctPmNyb3NzaGFpcnNfY2FjaGVgIGJlbG9uZ3Mg dG8gdGhlIHdpbmRvdywgbm90IHRoZSBidWZmZXIuICBTd2l0Y2hpbmcKKyAgYnVmZmVycyB3aXRo aW4gdGhlIHNhbWUgd2luZG93IHJlbmRlcnMgdGhlIGNhY2hlIHVzZWxlc3MuICovCisgIGlmICgh TUlOSV9XSU5ET1dfUCAodykKKyAgICAgICYmICFOSUxQICh3LT5jcm9zc2hhaXJzX2NhY2hlKQor ICAgICAgJiYgV0lORE9XUCAoWENBUiAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB3LT5jcm9zc2hh aXJzX2NhY2hlKSkpCisgICAgICAmJiB3ID09IFhXSU5ET1cgKFhDQVIgKEZudGggKG1ha2VfbnVt YmVyICgxKSwgdy0+Y3Jvc3NoYWlyc19jYWNoZSkpKQorICAgICAgJiYgIUVRICh3LT5jb250ZW50 cywgWENBUiAoRm50aCAobWFrZV9udW1iZXIgKDIpLCB3LT5jcm9zc2hhaXJzX2NhY2hlKSkpKQor ICAgIHsKKyAgICAgIHdzZXRfY3Jvc3NoYWlyc19jYWNoZSAodywgUW5pbCk7CisgICAgICB3LT5t Yy5lcmFzZV9jcm9zc2hhaXJzID0gZmFsc2U7CisgICAgfQorICBpZiAob24KKyAgICAgICYmICFN SU5JX1dJTkRPV19QICh3KQorICAgICAgJiYgKHcgPT0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93 KQorICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3Nz aGFpcnNfaW5hY3RpdmVfd2luZG93cykpKQorICAgICAgJiYgTklMUCAody0+Y3Jvc3NoYWlyc19j YWNoZSkKKyAgICAgICYmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9z c2hhaXJzKSkpKQorICAgIG1jX2RyYXdfY3Jvc3NoYWlycyAodywgYWN0aXZlX2N1cnNvcl9wLCBt aW5pbWFsX3ApOworICAgIGVsc2UgaWYgKG9uCisgICAgICAgICAgICAgJiYgIU1JTklfV0lORE9X X1AgKHcpCisgICAgICAgICAgICAgJiYgIU5JTFAgKHctPmNyb3NzaGFpcnNfY2FjaGUpCisgICAg ICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWly cykpCisgICAgICAgICAgICAgJiYgV0lORE9XUCAoWENBUiAoRm50aCAobWFrZV9udW1iZXIgKDEp LCB3LT5jcm9zc2hhaXJzX2NhY2hlKSkpCisgICAgICAgICAgICAgJiYgdyA9PSBYV0lORE9XIChY Q0FSIChGbnRoIChtYWtlX251bWJlciAoMSksIHctPmNyb3NzaGFpcnNfY2FjaGUpKSkKKyAgICAg ICAgICAgICAmJiBFUSAody0+Y29udGVudHMsIFhDQVIgKEZudGggKG1ha2VfbnVtYmVyICgyKSwg dy0+Y3Jvc3NoYWlyc19jYWNoZSkpKSkKKyAgICAgIHsKKyAgICAgICAgbWNfZXJhc2VfY3Jvc3No YWlycyAodywgZmFsc2UpOworICAgICAgICBtY19yZWRyYXdfY3Jvc3NoYWlycyAodyk7CisgICAg ICB9Cit9CisKK2Jvb2wKK21jX211bHRpcGxlX2N1cnNvcnNfcCAoc3RydWN0IHdpbmRvdyAqdykK K3sKKyNpZmRlZiBHTFlQSF9ERUJVRworICBpZiAodHJhY2VfcmVkaXNwbGF5X3AgJiYgQlVGRkVS UCAody0+Y29udGVudHMpCisgICAgICAmJiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRl bnRzKSwgbXVsdGlwbGVfY3Vyc29yc19jb25mKSkKKyAgICAgICAgICB8fCAhTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpKQorICAgIHsKKyAgICAgIExpc3Bf T2JqZWN0IHdpbmRvdzsKKyAgICAgIFhTRVRXSU5ET1cgKHdpbmRvdywgdyk7CisgICAgICBMaXNw X09iamVjdCB3aW5kb3dfc3RyaW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ChtYWtlX251bWJlciAoMSks IHctPm11bHRpcGxlX2N1cnNvcnNfY2FjaGUpKSkKKyAgICAgICYmIEVRICh3LT5jb250ZW50cywg WENBUiAoRm50aCAobWFrZV9udW1iZXIgKDIpLCB3LT5tdWx0aXBsZV9jdXJzb3JzX2NhY2hlKSkp KQorICAgIHJldHVybiB0cnVlOworICAgIGVsc2UKKyAgICAgIHJldHVybiBmYWxzZTsKK30KKwor Ym9vbAorbWNfY3Jvc3NoYWlyc19wIChzdHJ1Y3Qgd2luZG93ICp3KQoreworI2lmZGVmIEdMWVBI X0RFQlVHCisgIGlmICh0cmFjZV9yZWRpc3BsYXlfcCAmJiBCVUZGRVJQICh3LT5jb250ZW50cykK KyAgICAgICYmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtdWx0aXBsZV9j dXJzb3JzX2NvbmYpKQorICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIGNyb3NzaGFpcnMpKSkpCisgICAgeworICAgICAgTGlzcF9PYmplY3Qgd2luZG93Owor ICAgICAgWFNFVFdJTkRPVyAod2luZG93LCB3KTsKKyAgICAgIExpc3BfT2JqZWN0IHdpbmRvd19z dHJpbmcgPSBGcHJpbjFfdG9fc3RyaW5nICh3aW5kb3csIFFuaWwpOworICAgICAgY2hhciAqd2lu ZG93X2NoYXIgPSBTU0RBVEEgKHdpbmRvd19zdHJpbmcpOworICAgICAgZnByaW50ZiAoc3RkZXJy LCAibWNfY3Jvc3NoYWlyc19wICglcylcbiIsIHdpbmRvd19jaGFyKTsKKyAgICB9CisjZW5kaWYK Ky8qIE1vdmluZyB0aGUgbW91c2UgdHJpZ2dlcnMgYHVwZGF0ZV93aW5kb3dfY3Vyc29yJyB3aGlj aCBjYWxscworYGRpc3BsYXlfYW5kX3NldF9jdXJzb3InIHRoYXQgd291bGQgb3RoZXJ3aXNlIHJl bW92ZSBhIHBvcnRpb24gb2YgdGhlCitob3Jpem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GVycl9wID0gKCFOSUxQIChCVkFSIChjdXJyZW50X2J1ZmZlciwg bWNfc3RkZXJyKSkpCisgICAgICAgICAgICAgICAgICAgPyB0cnVlCisgICAgICAgICAgICAgICAg ICAgOiBmYWxzZTsKKyAgaWYgKE5JTFAgKGFyZykpCisgICAgbWNfc3RkZXJyX3AgPSAhbWNfc3Rk ZXJyX3A7CisgIGVsc2UKKyAgICB7CisgICAgICBhcmcgPSBGcHJlZml4X251bWVyaWNfdmFsdWUg KGFyZyk7CisgICAgICBtY19zdGRlcnJfcCA9IFhJTlQgKGFyZykgPiAwOworICAgIH0KKyAgaWYg KG1jX3N0ZGVycl9wKQorICAgIGJzZXRfYmx2X21jX3N0ZGVyciAoYiwgUXQpOworICAgIGVsc2UK KyAgICAgIGJzZXRfYmx2X21jX3N0ZGVyciAoYiwgUW5pbCk7CisgIHJldHVybiBRbmlsOworfQor CisvKiAgKGZ1bmRhbWVudGFsLW1vZGUpCisgICAgKHNldHEgZGlzcGxheS1saW5lLW51bWJlcnMg dCkKKyAgICAoc2V0cSBidWZmZXItZGlzcGxheS10YWJsZSAobWFrZS1kaXNwbGF5LXRhYmxlKSkK KyAgICAoYXNldCBidWZmZXItZGlzcGxheS10YWJsZQorICAgICAgICAgID9cdAorICAgICAgICAg ICh2ZWN0b3IgKG1ha2UtZ2x5cGgtY29kZSA/XHUwMEJCICdmb250LWxvY2std2FybmluZy1mYWNl KQorICAgICAgICAgICAgICAgICAgKG1ha2UtZ2x5cGgtY29kZSA/XHQgJ2hpZ2hsaWdodCkpKQor ICAgIChhc2V0IGJ1ZmZlci1kaXNwbGF5LXRhYmxlCisgICAgICAgICAgP1xuCisgICAgICAgICAg KHZlY3RvciAobWFrZS1nbHlwaC1jb2RlID9cdTAwQjYgJ2ZvbnQtbG9jay1jb21tZW50LWZhY2Up CisgICAgICAgICAgICAgICAgICA/XG4pKQorICAgIChzZXRxIHRhYi13aWR0aCA4KQorICAgIChz ZXRxLWxvY2FsIGF1dG8taHNjcm9sbC1tb2RlICdjdXJyZW50LWxpbmUpICovCisKK0RFRlVOICgi bWMtZGVidWciLCBGbWNfZGVidWcsIFNtY19kZWJ1ZywgMCwgMCwgIiIsCisgICAgICAgZG9jOiAv KiBUaGlzIGZ1bmN0aW9uIHVzZWQgZm9yIGRlYnVnZ2luZy4gKi8pCisgICh2b2lkKQoreworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgUFJFTElNSU5BUlkg U1RVRkYKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICBzdHJ1Y3Qgd2luZG93ICp3ID0gZGVj b2RlX2xpdmVfd2luZG93IChzZWxlY3RlZF93aW5kb3cpOworICBzdHJ1Y3QgaXQgaXQ7CisgIHZv aWQgKml0ZGF0YSA9IGJpZGlfc2hlbHZlX2NhY2hlICgpOworICBzdHJ1Y3QgaXQgaXQyOworICB2 b2lkICppdDJkYXRhID0gTlVMTDsKKyAgc3RydWN0IGl0IGl0MzsKKyAgdm9pZCAqaXQzZGF0YSA9 IE5VTEw7CisgIGVudW0gbW92ZV9pdF9yZXN1bHQgcmMgPSBNT1ZFX1hfUkVBQ0hFRDsKKyAgc3Ry dWN0IHRleHRfcG9zIHN0YXJ0X3RleHRfcG9zaXRpb247CisgIGludCBjb3VudCA9IDA7CisgIGlu dCBuZXdfeCA9IDA7CisgIGludCBwcmV2aW91c19pdF9jID0gMDsKKyAgaW50IHByZXZpb3VzX2l0 X2ZldGNoYnl0ZSA9IDA7CisgIGludCBwcmV2aW91c19pdF9jdXJyZW50X3ggPSAwOworICBpbnQg cHJldmlvdXNfaXRfY2hhcnBvcyA9IDA7CisgIGludCBwcmV2aW91c19pdF9waXhlbF93aWR0aCA9 IDA7CisgIGJvb2wgZmluYWxfbG9vcF9wID0gZmFsc2U7CisgIGludCB0ZXh0X2FyZWFfd2lkdGgg PSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqCisgICAgICAgICAgICAgICAgICAgICAgU1RBUlQgRElTUExBWSAtLSB3LT5zdGFydAorKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisgIC8qIEJlZ2luIHRoZSBqb3VybmV5IGF0IHctPnN0YXJ0 LiAqLworICBTRVRfVEVYVF9QT1NfRlJPTV9NQVJLRVIgKHN0YXJ0X3RleHRfcG9zaXRpb24sIHct PnN0YXJ0KTsKKyAgc3RhcnRfZGlzcGxheSAoJml0LCB3LCBzdGFydF90ZXh0X3Bvc2l0aW9uKTsK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgIEdPIFRPIFRIRSBCRUdJ Tk5JTkcgT0YgVEhFIENVUlJFTlQgTElORS4KKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICAv KiBQbGFjZSB0aGUgSVQgb24gdGhlIGN1cnJlbnQgbGluZSBjb250YWluaW5nIFBULiAqLworICBp bnQgdm9mZnNldCA9IChXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KSA+IDAKKyAgICAgICAg ICAgICAgICAgJiYgdy0+b3V0cHV0X2N1cnNvci52cG9zID4gMCkKKyAgICAgICAgICAgICAgICAg ID8gdy0+b3V0cHV0X2N1cnNvci52cG9zIC0gMQorICAgICAgICAgICAgICAgICAgOiB3LT5vdXRw dXRfY3Vyc29yLnZwb3M7CisgIGlmICh2b2Zmc2V0ID4gMCkKKyAgICBtb3ZlX2l0X2J5X2xpbmVz ICgmaXQsIHZvZmZzZXQpOworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAg ICAgICAgICAgIE1PVkUgSVQ6ICBJTkNSRU1FTlQgPT0gMSBwaXhlbAorKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisgIGZwcmludGYgKHN0ZGVyciwgIlxuaXQuZmlyc3RfdmlzaWJsZV94ICglZClc biIsIGl0LmZpcnN0X3Zpc2libGVfeCk7CisgIHdoaWxlICghZmluYWxfbG9vcF9wKQorICAgIHsK KyAgICAgIG1jX2RlYnVnX3AgPSB0cnVlOworICAgICAgZmluYWxfbG9vcF9wID0gKElUX0NIQVJQ T1MgKGl0KSA9PSBaVikKKyAgICAgICAgICAgICAgICAgICAgICAgPyB0cnVlCisgICAgICAgICAg ICAgICAgICAgICA6IChGRVRDSF9CWVRFIChJVF9CWVRFUE9TIChpdCkpID09ICdcbicKKyAgICAg ICAgICAgICAgICAgICAgICAgICYmIGl0LmMgIT0gMCkKKyAgICAgICAgICAgICAgICAgICAgICAg PyB0cnVlCisgICAgICAgICAgICAgICAgICAgICA6IChyYyA9PSBNT1ZFX0xJTkVfQ09OVElOVUVE KQorICAgICAgICAgICAgICAgICAgICAgICA/IHRydWUKKyAgICAgICAgICAgICAgICAgICAgIDog KHJjID09IE1PVkVfTElORV9UUlVOQ0FURUQKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIGl0 LmN1cnJlbnRfeCAtIGl0LmZpcnN0X3Zpc2libGVfeCA+IHRleHRfYXJlYV93aWR0aCkKKyAgICAg ICAgICAgICAgICAgICAgICAgPyB0cnVlCisgICAgICAgICAgICAgICAgICAgICA6IGZhbHNlOwor ICAgICAgaWYgKGl0LmN1cnJlbnRfeCA+IHByZXZpb3VzX2l0X2N1cnJlbnRfeAorICAgICAgICAg IHx8IElUX0NIQVJQT1MgKGl0KSA+IHByZXZpb3VzX2l0X2NoYXJwb3MKKyAgICAgICAgICB8fCBp dC5jICE9IHByZXZpb3VzX2l0X2MKKyAgICAgICAgICB8fCBpdC5jID09IDAKKyAgICAgICAgICB8 fCBpdC5jID09IDEwKQorICAgICAgICB7CisgICAgICAgICAgTGlzcF9PYmplY3QgY2hhcmFjdGVy ID0gRmNoYXJfdG9fc3RyaW5nIChtYWtlX251bWJlciAoaXQuYykpOworICAgICAgICAgIGludCBj aGFycG9zID0gSVRfQ0hBUlBPUyAoaXQpOworICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIlxu Y2hhcnBvcyAoJWQvJWQvJWQpIHwgZmlyc3RfeCAoJWQpIHwgcHJldmlvdXNfeCAoJWQpIHwgeCAo JWQpIHwgYyAoJXMpIHwgcHcgKCVkKSB8IGhwb3MgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgIGNoYXJwb3MsIHByZXZpb3VzX2l0X2NoYXJwb3MsIEZFVENIX0JZVEUgKElUX0JZ VEVQT1MgKGl0KSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICBpdC5maXJzdF92aXNpYmxl X3gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmV2aW91c19pdF9jdXJyZW50X3gsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICBpdC5jdXJyZW50X3gsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAoKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIGl0LmMgPT0gOSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICJcXHQi CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGl0LmMgPT0gMTApCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyAiXFxuIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBp dC5jICE9IDkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgaXQuYyAhPSAxMCkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFNTREFUQSAoY2hhcmFjdGVyKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6ICI/IiksCisgICAgICAgICAgICAgICAgICAgICAg ICAgICBpdC5waXhlbF93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0Lmhwb3Mp OworICAgICAgICAgIHByZXZpb3VzX2l0X2MgPSBpdC5jOworICAgICAgICAgIHByZXZpb3VzX2l0 X2N1cnJlbnRfeCA9IGl0LmN1cnJlbnRfeDsKKyAgICAgICAgICBwcmV2aW91c19pdF9jaGFycG9z ID0gSVRfQ0hBUlBPUyAoaXQpOworICAgICAgICAgIHByZXZpb3VzX2l0X2ZldGNoYnl0ZSA9IEZF VENIX0JZVEUgKElUX0JZVEVQT1MgKGl0KSk7CisgICAgICAgICAgcHJldmlvdXNfaXRfcGl4ZWxf d2lkdGggPSBpdC5waXhlbF93aWR0aDsKKyAgICAgICAgICBjb3VudCArPSAxOworICAgICAgICB9 CisgICAgICBuZXdfeCArPSAxOworICAgICAgU0FWRV9JVCAoaXQyLCBpdCwgaXQyZGF0YSk7Cisg ICAgICByYyA9IG1vdmVfaXRfaW5fZGlzcGxheV9saW5lX3RvICgmaXQsIFpWLCBuZXdfeCwgTU9W RV9UT19QT1MgfCBNT1ZFX1RPX1gpOworICAgICAgU0FWRV9JVCAoaXQzLCBpdCwgaXQzZGF0YSk7 CisgICAgfQorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBUSEUgRU5ECisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAgbWNfZGVidWdf cCA9IGZhbHNlOworICBiaWRpX3Vuc2hlbHZlX2NhY2hlIChpdGRhdGEsIGZhbHNlKTsKKyAgcmV0 dXJuIFFuaWw7Cit9CisKKy8qIGVuZCBNVUxUSVBMRSBDVVJTT1JTICovCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKworCiAMCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKIAkJICAgICAgV2luZG93IGRpc3Bs YXkgZGltZW5zaW9ucwpAQCAtMTEyMDAsNyArMTU1NTQsOSBAQCByZXNpemVfZWNob19hcmVhX2V4 YWN0bHkgKHZvaWQpCiAJewogCSAgd2luZG93c19vcl9idWZmZXJzX2NoYW5nZWQgPSA0MjsKIAkg IHVwZGF0ZV9tb2RlX2xpbmVzID0gMzA7Ci0JICByZWRpc3BsYXlfaW50ZXJuYWwgKCk7CisgICAg ICBtY19yZWRpc3BsYXlfaW50ZXJuYWwgPSAxOworICAgICAgcmVkaXNwbGF5X2ludGVybmFsICgx KTsKKyAgICAgIG1jX3JlZGlzcGxheV9pbnRlcm5hbCA9IDA7CiAJfQogICAgIH0KIH0KQEAgLTEx Njg3LDcgKzE2MDQzLDkgQEAgZWNob19hcmVhX2Rpc3BsYXkgKGJvb2wgdXBkYXRlX2ZyYW1lX3Ap CiAJICAgICAgcHRyZGlmZl90IGNvdW50ID0gU1BFQ1BETF9JTkRFWCAoKTsKIAkgICAgICBzcGVj YmluZCAoUXJlZGlzcGxheV9kb250X3BhdXNlLCBRdCk7CiAJICAgICAgZnNldF9yZWRpc3BsYXkg KGYpOwotCSAgICAgIHJlZGlzcGxheV9pbnRlcm5hbCAoKTsKKyAgICAgICAgICBtY19yZWRpc3Bs YXlfaW50ZXJuYWwgPSAyOworICAgICAgICAgIHJlZGlzcGxheV9pbnRlcm5hbCAoMik7CisgICAg ICAgICAgbWNfcmVkaXNwbGF5X2ludGVybmFsID0gMDsKIAkgICAgICB1bmJpbmRfdG8gKGNvdW50 LCBRbmlsKTsKIAkgICAgfQogCSAgZWxzZSBpZiAoRlJBTUVfV0lORE9XX1AgKGYpICYmIG4gPT0g MCkKQEAgLTEzMzY2LDYgKzE3NzI0LDE5IEBAIGhzY3JvbGxfd2luZG93X3RyZWUgKExpc3BfT2Jq ZWN0IHdpbmRvdykKIAkgICAgICBlbHNlCiAJCXB0ID0gY2xpcF90b19ib3VuZHMgKEJFR1YsIG1h cmtlcl9wb3NpdGlvbiAody0+cG9pbnRtKSwgWlYpOwogCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgIHN0cnVjdCBkaXNwbGF5X3BvcyAqcG9z ID0gJmN1cnNvcl9yb3ctPnN0YXJ0OworICBwdHJkaWZmX3QgY2hhcnBvcyA9IENIQVJQT1MgKHBv cy0+cG9zKTsKKyAgYm9vbCBiYXJmX2NyYXNoID0gKGNoYXJwb3MgPCAwIHx8IChjaGFycG9zID49 IEJVRl9CRUcgKGN1cnJlbnRfYnVmZmVyKSAmJiBjaGFycG9zIDw9IFpWKSkgPyBmYWxzZSA6IHRy dWU7CisgIGlmIChiYXJmX2NyYXNoKQorICAgIHJldHVybiBoc2Nyb2xsZWRfcDsKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqIC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zIGByZWRpc3BsYXlfd2luZG93Jy4gKi8KKworICAgICAgbWNfcmVtb3ZlX211bHRpcGxlX2N1 cnNvcnMgKHcpOworICAgICAgbWNfcmVtb3ZlX2Nyb3NzaGFpcnMgKHcpOworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAJICAgICAgZ290byB1cGRhdGU7CiAJICAgIH0KIAkgIGVsc2UK QEAgLTE0MzAzLDYgKzE4NzAzLDIyIEBAIHJlZGlzcGxheV9pbnRlcm5hbCAodm9pZCkKIAkJICAm JiAodyA9IFhXSU5ET1cgKHNlbGVjdGVkX3dpbmRvdykpICE9IHN3KQogCQlnb3RvIHJldHJ5Owog CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisv KiBOT1RFOiAgQW4gaWRsZS10aW1lciBmdW5jdGlvbiBtYXkgbm90IG5lY2Vzc2FyaWx5IHRyaWdn ZXIgYHJlZGlzcGxheV93aW5kb3cnLgorICAgYHctPm11c3RfYmVfdXBkYXRlZF9wJyBpcyBzZXQg dG8gdHJ1ZSB3aXRoaW4gYG1jLWFjdGl2YXRlLWNyb3NzaGFpcnMnLgorLSAgYG9wdGltaXphdGlv biAxYCAoZS5nLiwgbGVmdC9yaWdodCBjdXJzb3IgbW92ZW1lbnQgb24gdGhlIGZpcnN0IHNjcmVl biBsaW5lKS4KKy0gIGBvcHRpbWl6YXRpb24gM2AgKGUuZy4sIGxlZnQvcmlnaHQgY3Vyc29yIG1v dmVtZW50IG9uIHNjcmVlbiBsaW5lcyBzdWJzZXF1ZW50CisgICAgdG8gdGhlIGZpcnN0IHNjcmVl biBsaW5lKSwgYnlwYXNzIGByZWRpc3BsYXlfd2luZG93Jy4gKi8KKworICAgIGlmICh3LT5tdXN0 X2JlX3VwZGF0ZWRfcCkKKyAgICAgIGdvdG8gdXBkYXRlOworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKworCiAJICAgICAgLyogV2UgdXNlZCB0byBhbHdheXMgZ290byBlbmRfb2ZfcmVkaXNw bGF5IGhlcmUsIGJ1dCB0aGlzCiAJCSBpc24ndCBlbm91Z2ggaWYgd2UgaGF2ZSBhIGJsaW5raW5n IGN1cnNvci4gICovCiAJICAgICAgaWYgKHctPmN1cnNvcl9vZmZfcCA9PSB3LT5sYXN0X2N1cnNv cl9vZmZfcCkKQEAgLTE0MzQ0LDYgKzE4NzYwLDIzIEBAIHJlZGlzcGxheV9pbnRlcm5hbCAodm9p ZCkKIAkJICAqdy0+ZGVzaXJlZF9tYXRyaXgtPm1ldGhvZCA9IDA7CiAJCSAgZGVidWdfbWV0aG9k X2FkZCAodywgIm9wdGltaXphdGlvbiAzIik7CiAjZW5kaWYKKworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworLyogTk9URTogIEFuIGlkbGUtdGlt ZXIgZnVuY3Rpb24gbWF5IG5vdCBuZWNlc3NhcmlseSB0cmlnZ2VyIGByZWRpc3BsYXlfd2luZG93 Jy4KKyAgIGB3LT5tdXN0X2JlX3VwZGF0ZWRfcCcgaXMgc2V0IHRvIHRydWUgd2l0aGluIGBtYy1h Y3RpdmF0ZS1jcm9zc2hhaXJzJy4KKy0gIGBvcHRpbWl6YXRpb24gMWAgKGUuZy4sIGxlZnQvcmln aHQgY3Vyc29yIG1vdmVtZW50IG9uIHRoZSBmaXJzdCBzY3JlZW4gbGluZSkuCistICBgb3B0aW1p emF0aW9uIDNgIChlLmcuLCBsZWZ0L3JpZ2h0IGN1cnNvciBtb3ZlbWVudCBvbiBzY3JlZW4gbGlu ZXMgc3Vic2VxdWVudAorICAgIHRvIHRoZSBmaXJzdCBzY3JlZW4gbGluZSksIGJ5cGFzcyBgcmVk aXNwbGF5X3dpbmRvdycuICovCisKKyAgICAgIG1jX3JlbW92ZV9tdWx0aXBsZV9jdXJzb3JzICh3 KTsKKyAgICAgIG1jX3JlbW92ZV9jcm9zc2hhaXJzICh3KTsKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogCQkgIGdvdG8gdXBkYXRlOwogCQl9CiAJICAgICAgZWxzZQpAQCAtMTQ3MjQs MTYgKzE5MTU3LDM2IEBAIHJlZGlzcGxheV9wcmVzZXJ2ZV9lY2hvX2FyZWEgKGludCBmcm9tX3do ZXJlKQogICBibG9ja19idWZmZXJfZmxpcHMgKCk7CiAgIHVuYmxvY2tfaW5wdXQgKCk7CiAKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgc3Ry dWN0IHdpbmRvdyAqdyA9IGRlY29kZV9saXZlX3dpbmRvdyAoc2VsZWN0ZWRfd2luZG93KTsKKyAg dy0+bWMucmVkaXNwbGF5X3ByZXNlcnZlX2VjaG9fYXJlYSA9IGZyb21fd2hlcmU7CisgIG1jX3Jl ZGlzcGxheV9wcmVzZXJ2ZV9lY2hvX2FyZWEgPSBmcm9tX3doZXJlOworCiAgIGlmICghTklMUCAo ZWNob19hcmVhX2J1ZmZlclsxXSkpCiAgICAgewogICAgICAgLyogV2UgaGF2ZSBhIHByZXZpb3Vz bHkgZGlzcGxheWVkIG1lc3NhZ2UsIGJ1dCBubyBjdXJyZW50CiAJIG1lc3NhZ2UuICBSZWRpc3Bs YXkgdGhlIHByZXZpb3VzIG1lc3NhZ2UuICAqLwogICAgICAgZGlzcGxheV9sYXN0X2Rpc3BsYXll ZF9tZXNzYWdlX3AgPSB0cnVlOwotICAgICAgcmVkaXNwbGF5X2ludGVybmFsICgpOworICAgICAg bWNfcmVkaXNwbGF5X2ludGVybmFsID0gNDsKKyAgICAgIHJlZGlzcGxheV9pbnRlcm5hbCAoNCk7 CisgICAgICBtY19yZWRpc3BsYXlfaW50ZXJuYWwgPSAwOwogICAgICAgZGlzcGxheV9sYXN0X2Rp c3BsYXllZF9tZXNzYWdlX3AgPSBmYWxzZTsKICAgICB9CiAgIGVsc2UKLSAgICByZWRpc3BsYXlf aW50ZXJuYWwgKCk7CisgICAgeworICAgICAgbWNfcmVkaXNwbGF5X2ludGVybmFsID0gNTsKKyAg ICAgIHJlZGlzcGxheV9pbnRlcm5hbCAoNSk7CisgICAgICBtY19yZWRpc3BsYXlfaW50ZXJuYWwg PSAwOworICAgIH0KKworICB3LT5tYy5yZWRpc3BsYXlfcHJlc2VydmVfZWNob19hcmVhID0gMDsK KyAgbWNfcmVkaXNwbGF5X3ByZXNlcnZlX2VjaG9fYXJlYSA9IDA7CisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCiAKICAgZmx1c2hfZnJhbWUgKFNFTEVDVEVEX0ZSQU1FICgpKTsKICAgdW5i aW5kX3RvIChjb3VudCwgUW5pbCk7CkBAIC0xNzI1OSw2ICsyMTcxMiwxNiBAQCByZWRpc3BsYXlf d2luZG93IChMaXNwX09iamVjdCB3aW5kb3csIGJvb2wganVzdF90aGlzX29uZV9wKQogICBkZWJ1 Z19tZXRob2RfYWRkICh3LCAicmVjZW50ZXIiKTsKICNlbmRpZgogCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgIG1jX3JlbW92ZV9tdWx0aXBs ZV9jdXJzb3JzICh3KTsKKyAgbWNfcmVtb3ZlX2Nyb3NzaGFpcnMgKHcpOworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAgIC8qIEZvcmdldCBhbnkgcHJldmlvdXNseSByZWNvcmRlZCBi YXNlIGxpbmUgZm9yIGxpbmUgbnVtYmVyIGRpc3BsYXkuICAqLwogICBpZiAoIWJ1ZmZlcl91bmNo YW5nZWRfcCkKICAgICB3LT5iYXNlX2xpbmVfbnVtYmVyID0gMDsKQEAgLTE3Njg5LDYgKzIyMTUy LDIyIEBAIHJlZGlzcGxheV93aW5kb3cgKExpc3BfT2JqZWN0IHdpbmRvdywgYm9vbCBqdXN0X3Ro aXNfb25lX3ApCiAgIGVsc2UKICAgICBURU1QX1NFVF9QVF9CT1RIIChDSEFSUE9TIChvcG9pbnQp LCBCWVRFUE9TIChvcG9pbnQpKTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1V TFRJUExFIENVUlNPUlMgKi8KKworLyogTk9URTogIEFuIGlkbGUtdGltZXIgZnVuY3Rpb24gbWF5 IG5vdCBuZWNlc3NhcmlseSB0cmlnZ2VyIGByZWRpc3BsYXlfd2luZG93Jy4KKyAgIGB3LT5tdXN0 X2JlX3VwZGF0ZWRfcCcgaXMgc2V0IHRvIHRydWUgd2l0aGluIGBtYy1hY3RpdmF0ZS1jcm9zc2hh aXJzJy4KKy0gIGBvcHRpbWl6YXRpb24gMWAgKGUuZy4sIGxlZnQvcmlnaHQgY3Vyc29yIG1vdmVt ZW50IG9uIHRoZSBmaXJzdCBzY3JlZW4gbGluZSkuCistICBgb3B0aW1pemF0aW9uIDNgIChlLmcu LCBsZWZ0L3JpZ2h0IGN1cnNvciBtb3ZlbWVudCBvbiBzY3JlZW4gbGluZXMgc3Vic2VxdWVudAor ICAgIHRvIHRoZSBmaXJzdCBzY3JlZW4gbGluZSksIGJ5cGFzcyBgcmVkaXNwbGF5X3dpbmRvdycu ICovCisKKyAgbWNfcmVtb3ZlX211bHRpcGxlX2N1cnNvcnMgKHcpOworICBtY19yZW1vdmVfY3Jv c3NoYWlycyAodyk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgc2V0X2J1ZmZl cl9pbnRlcm5hbF8xIChvbGQpOwogICAvKiBBdm9pZCBhbiBhYm9ydCBpbiBURU1QX1NFVF9QVF9C T1RIIGlmIHRoZSBidWZmZXIgaGFzIGJlY29tZQogICAgICBzaG9ydGVyLiAgVGhpcyBjYW4gYmUg Y2F1c2VkIGJ5IGxvZyB0cnVuY2F0aW9uIGluICpNZXNzYWdlcyouICAqLwpAQCAtMjAwNzgsNiAr MjQ1NTcsMTcgQEAgYXBwZW5kX3NwYWNlX2Zvcl9uZXdsaW5lIChzdHJ1Y3QgaXQgKml0LCBib29s IGRlZmF1bHRfZmFjZV9wKQogCSAgbWVtc2V0ICgmaXQtPnBvc2l0aW9uLCAwLCBzaXplb2YgaXQt PnBvc2l0aW9uKTsKIAkgIGl0LT5vYmplY3QgPSBRbmlsOwogCSAgaXQtPmMgPSBpdC0+Y2hhcl90 b19kaXNwbGF5ID0gJyAnOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQ TEUgQ1VSU09SUyAqLworCisgICAgICBpZiAoSVRfQllURVBPUyAoKml0KSA+PSBaVl9CWVRFKQor ICAgICAgICBpdC0+enZfcCA9IHRydWU7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK IAkgIGl0LT5sZW4gPSAxOwogCiAJICAvKiBJZiB0aGUgZGVmYXVsdCBmYWNlIHdhcyByZW1hcHBl ZCwgYmUgc3VyZSB0byB1c2UgdGhlCkBAIC0yMTA0MSw2ICsyNTUzMSwyMSBAQCBkaXNwbGF5X2Nv dW50X2xpbmVzX3Zpc3VhbGx5IChzdHJ1Y3QgaXQgKml0KQogc3RhdGljIHZvaWQKIG1heWJlX3By b2R1Y2VfbGluZV9udW1iZXIgKHN0cnVjdCBpdCAqaXQpCiB7CisKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgYm9vbCBiYXJmX2NyYXNoID0g KGl0LT5nbHlwaF9yb3cgPT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgfHwgaXQtPmdseXBo X3Jvdy0+dXNlZFtURVhUX0FSRUFdID09IDApCisgICAgICAgICAgICAgICAgICAgID8gZmFsc2UK KyAgICAgICAgICAgICAgICAgICAgOiB0cnVlOworICBpZiAoYmFyZl9jcmFzaCkKKyAgICByZXR1 cm47CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgcHRyZGlmZl90IGxhc3RfbGlu ZSA9IGl0LT5sbnVtOwogICBwdHJkaWZmX3Qgc3RhcnRfZnJvbSwgYnl0ZXBvczsKICAgcHRyZGlm Zl90IHRoaXNfbGluZTsKQEAgLTIxMTg1LDggKzI1NjkwLDEyIEBAIG1heWJlX3Byb2R1Y2VfbGlu ZV9udW1iZXIgKHN0cnVjdCBpdCAqaXQpCiAgICAgIGFuIEwyUiBwYXJhZ3JhcGguICAqLwogICB0 ZW1faXQuYmlkaV9pdC5yZXNv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VtX3BpeGVsX3dpZHRoID0gMDsKKwkgIGJpZGlf dW5zaGVsdmVfY2FjaGUgKGl0ZGF0YSwgZmFsc2UpOworCSAgcmV0dXJuOwogCX0KICAgICB9CiAK QEAgLTI2OTk3LDYgKzMxNTE5LDI0IEBAIGFwcGVuZF9nbHlwaCAoc3RydWN0IGl0ICppdCkKIAkg ICAgZ1sxXSA9ICpnOwogCSAgZ2x5cGggPSBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJlYV07CiAJ fQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLwor CisgICAgICBnbHlwaC0+eCA9IGl0LT5jdXJyZW50X3g7CisKKyAgICAgIGdseXBoLT55ID0gaXQt PmN1cnJlbnRfeTsKKworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKworICAgICAgZ2x5 cGgtPnZwb3MgPSBpdC0+dnBvczsKKworICAgICAgZ2x5cGgtPnp2X3AgPSBpdC0+enZfcDsKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFS UE9TIChpdC0+cG9zaXRpb24pOwogICAgICAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAg ICAgICBpZiAoaXQtPnBpeGVsX3dpZHRoID4gMCkKQEAgLTI3MDgwLDYgKzMxNjIwLDI0IEBAIGFw cGVuZF9jb21wb3NpdGVfZ2x5cGggKHN0cnVjdCBpdCAqaXQpCiAJICAgIGdbMV0gPSAqZzsKIAkg IGdseXBoID0gaXQtPmdseXBoX3Jvdy0+Z2x5cGhzW2l0LT5hcmVhXTsKIAl9CisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgICAgIGdseXBo LT54ID0gaXQtPmN1cnJlbnRfeDsKKworICAgICAgZ2x5cGgtPnkgPSBpdC0+Y3VycmVudF95Owor CisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworCisgICAgICBnbHlwaC0+dnBvcyA9IGl0 LT52cG9zOworCisgICAgICBnbHlwaC0+enZfcCA9IGl0LT56dl9wOworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKworCiAgICAgICBnbHlwaC0+Y2hhcnBvcyA9IGl0LT5jbXBfaXQuY2hhcnBv czsKICAgICAgIGdseXBoLT5vYmplY3QgPSBpdC0+b2JqZWN0OwogICAgICAgZWFzc2VydCAoaXQt PnBpeGVsX3dpZHRoIDw9IFNIUlRfTUFYKTsKQEAgLTI3Mjg4LDYgKzMxODQ2LDI0IEBAIHByb2R1 Y2VfaW1hZ2VfZ2x5cGggKHN0cnVjdCBpdCAqaXQpCiAJfQogICAgICAgaWYgKGdseXBoIDwgaXQt PmdseXBoX3Jvdy0+Z2x5cGhzW2FyZWEgKyAxXSkKIAl7CisKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgICAgIGdseXBoLT54ID0gaXQtPmN1 cnJlbnRfeDsKKworICAgICAgZ2x5cGgtPnkgPSBpdC0+Y3VycmVudF95OworCisgICAgICBnbHlw aC0+aHBvcyA9IGl0LT5ocG9zOworCisgICAgICBnbHlwaC0+dnBvcyA9IGl0LT52cG9zOworCisg ICAgICBnbHlwaC0+enZfcCA9IGl0LT56dl9wOworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiAJICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAJICBnbHlw aC0+b2JqZWN0ID0gaXQtPm9iamVjdDsKIAkgIGdseXBoLT5waXhlbF93aWR0aCA9IGNsaXBfdG9f Ym91bmRzICgtMSwgaXQtPnBpeGVsX3dpZHRoLCBTSFJUX01BWCk7CkBAIC0yNzM5MSw2ICszMTk2 NywyNCBAQCBwcm9kdWNlX3h3aWRnZXRfZ2x5cGggKHN0cnVjdCBpdCAqaXQpCiAJfQogICAgICAg aWYgKGdseXBoIDwgaXQtPmdseXBoX3Jvdy0+Z2x5cGhzW2FyZWEgKyAxXSkKIAl7CisKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgICAgIGds eXBoLT54ID0gaXQtPmN1cnJlbnRfeDsKKworICAgICAgZ2x5cGgtPnkgPSBpdC0+Y3VycmVudF95 OworCisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworCisgICAgICBnbHlwaC0+dnBvcyA9 IGl0LT52cG9zOworCisgICAgICBnbHlwaC0+enZfcCA9IGl0LT56dl9wOworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAJICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1MgKGl0LT5wb3Np dGlvbik7CiAJICBnbHlwaC0+b2JqZWN0ID0gaXQtPm9iamVjdDsKIAkgIGdseXBoLT5waXhlbF93 aWR0aCA9IGNsaXBfdG9fYm91bmRzICgtMSwgaXQtPnBpeGVsX3dpZHRoLCBTSFJUX01BWCk7CkBA IC0yNzQ3Nyw2ICszMjA3MSwyNCBAQCBhcHBlbmRfc3RyZXRjaF9nbHlwaCAoc3RydWN0IGl0ICpp dCwgTGlzcF9PYmplY3Qgb2JqZWN0LAogCSAgICB3aWR0aCAtPSBpdC0+Zmlyc3RfdmlzaWJsZV94 IC0gaXQtPmN1cnJlbnRfeDsKIAkgIGVhc3NlcnQgKHdpZHRoID4gMCk7CiAJfQorCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgICAgICBnbHlw aC0+eCA9IGl0LT5jdXJyZW50X3g7CisKKyAgICAgIGdseXBoLT55ID0gaXQtPmN1cnJlbnRfeTsK KworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKworICAgICAgZ2x5cGgtPnZwb3MgPSBp dC0+dnBvczsKKworICAgICAgZ2x5cGgtPnp2X3AgPSBpdC0+enZfcDsKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisKKwogICAgICAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9z aXRpb24pOwogICAgICAgZ2x5cGgtPm9iamVjdCA9IG9iamVjdDsKICAgICAgIC8qIEZJWE1FOiBJ dCB3b3VsZCBiZSBiZXR0ZXIgdG8gdXNlIFRZUEVfTUFYIGhlcmUsIGJ1dApAQCAtMjc5MjYsNiAr MzI1MzgsMjQgQEAgYXBwZW5kX2dseXBobGVzc19nbHlwaCAoc3RydWN0IGl0ICppdCwgaW50IGZh Y2VfaWQsIGJvb2wgZm9yX25vX2ZvbnQsIGludCBsZW4sCiAJICAgIGdbMV0gPSAqZzsKIAkgIGds eXBoID0gaXQtPmdseXBoX3Jvdy0+Z2x5cGhzW2FyZWFdOwogCX0KKworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPnggPSBp dC0+Y3VycmVudF94OworCisgICAgICBnbHlwaC0+eSA9IGl0LT5jdXJyZW50X3k7CisKKyAgICAg IGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisKKyAgICAgIGdseXBoLT52cG9zID0gaXQtPnZwb3M7 CisKKyAgICAgIGdseXBoLT56dl9wID0gaXQtPnp2X3A7CisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKICAgICAgIGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsK ICAgICAgIGdseXBoLT5vYmplY3QgPSBpdC0+b2JqZWN0OwogICAgICAgZWFzc2VydCAoaXQtPnBp eGVsX3dpZHRoIDw9IFNIUlRfTUFYKTsKQEAgLTI5NjkyLDkgKzM0MzIyLDMyIEBAIGRpc3BsYXlf YW5kX3NldF9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgb24sCiAgICAgICB3LT5waHlz X2N1cnNvci52cG9zID0gdnBvczsKICAgICB9CiAKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgdy0+bWMuaCA9IC0xOworICB3LT5tYy5meCA9 IC0xOworICB3LT5tYy5meSA9IC0xOworICB3LT5tYy5nbHlwaF9mbGF2b3IgPSBOT19GTEFWT1I7 CisgIHctPm1jLnJlZCA9IC0xLjA7CisgIHctPm1jLmdyZWVuID0gLTEuMDsKKyAgdy0+bWMuYmx1 ZSA9IC0xLjA7CisgIHctPm1jLnBvc2ludCA9IC0xOworCiAgIEZSQU1FX1JJRiAoZiktPmRyYXdf d2luZG93X2N1cnNvciAodywgZ2x5cGhfcm93LCB4LCB5LAogICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIG5ld19jdXJzb3JfdHlwZSwgbmV3X2N1cnNvcl93aWR0aCwKICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbiwgYWN0aXZlX2N1cnNvcik7CisKKyAg bWNfbXVsdGlwbGVfY3Vyc29yc19wb3J0YWwgKHcsIG9uLCBhY3RpdmVfY3Vyc29yKTsKKworICAv KiBUaGUgcmVhbCBjdXJzb3IgKGRyYXduIGFib3ZlKSBpcyBnZXRzIHJlbW92ZWQgYnkgY3Jvc3No YWlycy4KKyAgYG1jX2RyYXdfY3Jvc3NoYWlycycgcmVsaWVzIHVwb24gYHctPnBoeXNfY3Vyc29y LngveS9ocG9zL3Zwb3MnIHdoZW4gT04uICovCisgIG1jX2Nyb3NzaGFpcnNfcG9ydGFsICh3LCBv biwgYWN0aXZlX2N1cnNvcik7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIH0KIAog CkBAIC0yOTcyNiwxMCArMzQzNzksMjUgQEAgdXBkYXRlX3dpbmRvd19jdXJzb3IgKHN0cnVjdCB3 aW5kb3cgKncsIGJvb2wgb24pCiAgICAgICBpZiAocm93LT5yZXZlcnNlZF9wICYmIGhwb3MgPj0g cm93LT51c2VkW1RFWFRfQVJFQV0pCiAJaHBvcyA9IHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMTsK IAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKwor ICAgICAgLyogRklYTUU6ICBUaGVzZSByZXN0cmljdGlvbnMgYXJlIGxpa2VseSB0aGUgcmVhc29u cyB0aGF0IGNyb3NzaGFpcnMgYW5kCisgICAgICBtdWx0aXBsZSBmYWtlIGN1cnNvcnMgYXJlIG5v dCB3b3JraW5nIG9uIE1hY09TIE1vamF2ZS4gIEBsYXdsaXN0IGRvZXMgbm90CisgICAgICBwcmVz ZW50bHkgaGF2ZSBhY2Nlc3MgdG8gYSBjb21wdXRlciB3aXRoIHRoYXQgdmVyc2lvbiBvZiB0aGUg T1MuICovCisgICAgICBpZiAoIW1jX2Nyb3NzaGFpcnNfcCAodykKKyAgICAgICAgICAmJiAhbWNf bXVsdGlwbGVfY3Vyc29yc19wICh3KSkKKyAgICAgICAgewogICAgICAgYmxvY2tfaW5wdXQgKCk7 CiAgICAgICBkaXNwbGF5X2FuZF9zZXRfY3Vyc29yICh3LCBvbiwgaHBvcywgdnBvcywKIAkJCSAg ICAgIHctPnBoeXNfY3Vyc29yLngsIHctPnBoeXNfY3Vyc29yLnkpOwogICAgICAgdW5ibG9ja19p bnB1dCAoKTsKKyAgICAgICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAg fQogfQogCkBAIC0zMjQzNiw2ICszNzEwNCwyNiBAQCB4X2ludGVyc2VjdF9yZWN0YW5nbGVzIChY UmVjdGFuZ2xlICpyMSwgWFJlY3RhbmdsZSAqcjIsIFhSZWN0YW5nbGUgKnJlc3VsdCkKIHZvaWQK IHN5bXNfb2ZfeGRpc3AgKHZvaWQpCiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisv KiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgZGVmc3ViciAoJlNtY19kdW1wX2dseXBoX3Jvdyk7 CisKKyAgZGVmc3ViciAoJlNtY19kdW1wX2dseXBoX21hdHJpeCk7CisKKyAgZGVmc3ViciAoJlNt Y19hY3RpdmF0ZV9tdWx0aXBsZV9jdXJzb3JzKTsKKworICBkZWZzdWJyICgmU21jX2FjdGl2YXRl X2Nyb3NzaGFpcnMpOworCisgIGRlZnN1YnIgKCZTbWNfc3RkZXJyKTsKKworICBkZWZzdWJyICgm U21jX2RlYnVnKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBWd2l0aF9lY2hv X2FyZWFfc2F2ZV92ZWN0b3IgPSBRbmlsOwogICBzdGF0aWNwcm8gKCZWd2l0aF9lY2hvX2FyZWFf c2F2ZV92ZWN0b3IpOwogCmRpZmYgLS1naXQgYS9zcmMveHRlcm0uYyBiL3NyYy94dGVybS5jCmlu ZGV4IGFmMjhkYWIuLmQ5OWI5ZTcgMTAwNjQ0Ci0tLSBhL3NyYy94dGVybS5jCisrKyBiL3NyYy94 dGVybS5jCkBAIC0xNTMwLDYgKzE1MzAsMjAgQEAgc3RhdGljIHZvaWQgeF9jaGVja19mb250IChz dHJ1Y3QgZnJhbWUgKiwgc3RydWN0IGZvbnQgKik7CiBzdGF0aWMgdm9pZAogeF9zZXRfY3Vyc29y X2djIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzKQogeworCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgIGlmIChzLT53LT5tYy5jdXJzb3JfZ2Nf ZGVmYXVsdCkKKyAgICB7CisgICAgICBzLT5nYyA9IHMtPmYtPm91dHB1dF9kYXRhLngtPmN1cnNv cl9nYzsKKyAgICAgIHJldHVybjsKKyAgICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor CisKICAgaWYgKHMtPmZvbnQgPT0gRlJBTUVfRk9OVCAocy0+ZikKICAgICAgICYmIHMtPmZhY2Ut PmJhY2tncm91bmQgPT0gRlJBTUVfQkFDS0dST1VORF9QSVhFTCAocy0+ZikKICAgICAgICYmIHMt PmZhY2UtPmZvcmVncm91bmQgPT0gRlJBTUVfRk9SRUdST1VORF9QSVhFTCAocy0+ZikKQEAgLTky NTIsNiArOTI2NiwyNiBAQCB4X2RyYXdfaG9sbG93X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywg c3RydWN0IGdseXBoX3JvdyAqcm93KQogCiAgIC8qIENvbXB1dGUgZnJhbWUtcmVsYXRpdmUgY29v cmRpbmF0ZXMgZm9yIHBoeXMgY3Vyc29yLiAgKi8KICAgZ2V0X3BoeXNfY3Vyc29yX2dlb21ldHJ5 ICh3LCByb3csIGN1cnNvcl9nbHlwaCwgJngsICZ5LCAmaCk7CisKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKy8qIExFR0VORDoKKworLSAgdG9w IHkgPT0gV0lORE9XX1RPX0ZSQU1FX1BJWEVMX1kgKHcsIHJvdy0+eSkKKworLSAgYm90dG9tIHkg PT0gV0lORE9XX1RPX0ZSQU1FX1BJWEVMX1kgKHcsIHJvdy0+eSkgLSByb3ctPmhlaWdodAorCist ICBoIG9mIEhPTExPV19CT1hfQ1VSU09SID09IHJvdy0+aGVpZ2h0CisgICBbVGhpcyBhdm9pZHMg YSB2aXNpYmxlIGdhcCBhYm92ZS9iZWxvdy5dICovCisKKyAgaWYgKHctPm1jLmggPiAwKQorICAg IGggPSByb3ctPmhlaWdodDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICB3ZCA9 IHctPnBoeXNfY3Vyc29yX3dpZHRoIC0gMTsKIAogICAvKiBUaGUgZm9yZWdyb3VuZCBvZiBjdXJz b3JfZ2MgaXMgdHlwaWNhbGx5IHRoZSBzYW1lIGFzIHRoZSBub3JtYWwKQEAgLTkzMjgsNyArOTM2 MiwxOCBAQCB4X2RyYXdfYmFyX2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBo X3JvdyAqcm93LCBpbnQgd2lkdGgsIGVudW0gdGV4dAogCSBpbnZpc2libGUuICBVc2UgdGhlIGds eXBoJ3MgZm9yZWdyb3VuZCBjb2xvciBpbnN0ZWFkIGluIHRoaXMKIAkgY2FzZSwgb24gdGhlIGFz c3VtcHRpb24gdGhhdCB0aGUgZ2x5cGgncyBjb2xvcnMgYXJlIGNob3NlbiBzbwogCSB0aGF0IHRo ZSBnbHlwaCBpcyBsZWdpYmxlLiAgKi8KLSAgICAgIGlmIChmYWNlLT5iYWNrZ3JvdW5kID09IGYt Pm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCkKKworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworICAgICAgaWYgKGZhY2UtPmJhY2tncm91bmQg PT0gZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsCisgICAgICAgICAgJiYgIXctPm1jLmN1 cnNvcl9nY19pbnZpc2libGVfb2theSkKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAJeGdjdi5iYWNrZ3JvdW5kID0geGdjdi5mb3JlZ3JvdW5kID0gZmFjZS0+Zm9yZWdyb3VuZDsK ICAgICAgIGVsc2UKIAl4Z2N2LmJhY2tncm91bmQgPSB4Z2N2LmZvcmVncm91bmQgPSBmLT5vdXRw dXRfZGF0YS54LT5jdXJzb3JfcGl4ZWw7CkBAIC05MzU5LDYgKzk0MDQsMTcgQEAgeF9kcmF3X2Jh cl9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgaW50IHdp ZHRoLCBlbnVtIHRleHQKIAkgIGlmICgoY3Vyc29yX2dseXBoLT5yZXNvbHZlZF9sZXZlbCAmIDEp ICE9IDApCiAJICAgIHggKz0gY3Vyc29yX2dseXBoLT5waXhlbF93aWR0aCAtIHdpZHRoOwogCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgICAg LyogQWxpZ24gYWxsIGZha2UgQkFSX0NVUlNPUiBvZiB0aGUgVkVSVElDQUxfUlVMRVIgd2l0aCBg b3BvaW50X3gnLiAqLworICAgIGlmICh3LT5tYy5meCA+IDApCisgICAgICB4ID0gdy0+bWMuZng7 CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgIHhfZmlsbF9yZWN0YW5nbGUgKGYs IGdjLCB4LAogCQkJICBXSU5ET1dfVE9fRlJBTUVfUElYRUxfWSAodywgdy0+cGh5c19jdXJzb3Iu eSksCiAJCQkgIHdpZHRoLCByb3ctPmhlaWdodCk7CkBAIC05NDM1LDMxICs5NDkxLDE2MyBAQCB4 X2RyYXdfd2luZG93X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAq Z2x5cGhfcm93LCBpbnQgeCwKIAl9CiAgICAgICBlbHNlCiAJewotCSAgc3dpdGNoIChjdXJzb3Jf dHlwZSkKLQkgICAgewotCSAgICBjYXNlIEhPTExPV19CT1hfQ1VSU09S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gICAgc3RydWN0IGJ1ZmZl ciAqYiA9IFhCVUZGRVIgKGJ1Zik7CisgICAgICAgICAgYm9vbCByZWdpb25fYWN0aXZlX3AgPSAo IU5JTFAgKFZ0cmFuc2llbnRfbWFya19tb2RlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmICFOSUxQIChCVkFSIChiLCBtYXJrX2FjdGl2ZSkpKTsKKyAgICAgICAgICBwdHJk aWZmX3QgcmVnaW9uX2JlZ2lubmluZyA9IChyZWdpb25fYWN0aXZlX3ApID8gWElOVCAoRnJlZ2lv bl9iZWdpbm5pbmcgKCkpIDogLTE7CisgICAgICAgICAgcHRyZGlmZl90IHJlZ2lvbl9lbmQgPSAo cmVnaW9uX2FjdGl2ZV9wKSA/IFhJTlQgKEZyZWdpb25fZW5kICgpKSA6IC0xOworICAgICAgICAg IGJvb2wgcmVnaW9uX2luX2JvdW5kc19wID0gKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1jLnBvc2ludCA+PSByZWdpb25fYmVnaW5u aW5nCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWMucG9zaW50 IDwgcmVnaW9uX2VuZCk7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRw dXRfZGF0YS54LT5jdXJzb3JfZ2MnIGJ5IGJvcnJvd2luZyB0aGUKKyAgICAgICAgICBmdW5jdGlv bmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHhmbnMuYy4gICovCisgICAgICAgICAgaWYgKHJlZ2lv bl9hY3RpdmVfcAorICAgICAgICAgICAgICAmJiByZWdpb25faW5fYm91bmRzX3AKKyAgICAgICAg ICAgICAgJiYgYWN0aXZlX3ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGVudW0gZmFj ZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9mYWNlX2lkID0gb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sJy4gICovCisgICAgICAgICAgZi0+b3V0cHV0X2Rh dGEueC0+Y3Vyc29yX3BpeGVsID0gY29sb3IucGl4ZWw7CisgICAgICAgICAgdy0+bWMuY3Vyc29y X2djX2ludmlzaWJsZV9va2F5ID0gdHJ1ZTsKKyAgICAgICAgICB4X2RyYXdfYmFyX2N1cnNvciAo dywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEhCQVJfQ1VSU09SKTsKKyAgICAgICAgICB3LT5t Yy5jdXJzb3JfZ2NfaW52aXNpYmxlX29rYXkgPSBmYWxzZTsKKyAgICAgICAgICBmLT5vdXRwdXRf ZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgIH0K KyAgICAgICAgZWxzZQorICAgICAgICAgIHhfZHJhd19iYXJfY3Vyc29yICh3LCBnbHlwaF9yb3cs IGN1cnNvcl93aWR0aCwgSEJBUl9DVVJTT1IpOworICAgICAgYnJlYWs7CisgICAgfQorICAgIGNh c2UgTk9fQ1VSU09SOgorICAgICAgdy0+cGh5c19jdXJzb3Jfd2lkdGggPSAwOworICAgICAgYnJl YWs7CisgICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOworICB9CisKKy8qIGVuZCBN VUxUSVBMRSBDVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KIAotCSAgICBjYXNl IE5PX0NVUlNPUjoKLQkgICAgICB3LT5waHlzX2N1cnNvcl93aWR0aCA9IDA7Ci0JICAgICAgYnJl YWs7CiAKLQkgICAgZGVmYXVsdDoKLQkgICAgICBlbWFjc19hYm9ydCAoKTsKLQkgICAgfQogCX0K IAogI2lmZGVmIEhBVkVfWF9JMThOCg== --Multipart_Sat_Nov_10_19:36:17_2018-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs). References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sun, 11 Nov 2018 16:52:02 +0000 Resent-Message-ID: <handler.22873.B22873.154195512118876 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN>, Marcin Borkowski <mbork@HIDDEN>, Richard Stallman <rms@HIDDEN>, John Wiegley <johnw@HIDDEN>, Akio Burns <akioburns@HIDDEN>, Alan Third <athird@HIDDEN> Cc: 17684 <at> debbugs.gnu.org, 22873 <at> debbugs.gnu.org Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.154195512118876 (code B ref 22873); Sun, 11 Nov 2018 16:52:02 +0000 Received: (at 22873) by debbugs.gnu.org; 11 Nov 2018 16:52:01 +0000 Received: from localhost ([127.0.0.1]:46637 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1gLsxt-0004uJ-NV for submit <at> debbugs.gnu.org; Sun, 11 Nov 2018 11:52:01 -0500 Received: from gateway33.websitewelcome.com ([192.185.146.85]:42064) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1gLsxr-0004u2-Ht for 22873 <at> debbugs.gnu.org; Sun, 11 Nov 2018 11:51:59 -0500 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway33.websitewelcome.com (Postfix) with ESMTP id 7CE6857476 for <22873 <at> debbugs.gnu.org>; Sun, 11 Nov 2018 10:51:58 -0600 (CST) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id LsxpgjtomFxNhLsxqgyMox; Sun, 11 Nov 2018 10:51:58 -0600 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=KumgPGVOwMFXa3vMU/V5hulPVRNV33tMt0vlx5+b1x4=; b=ReBh+TD1w/1b+PxgZE5smzeU1L sFVuaBCO17MzfUpIAt2XCqPKzalL/LIjx3vSS7O+aIRq1Xh6uqJzQQISoxPUU0YP9D5Xkp4yxa8dU rYyg/UwQqkV9BblWcEfyGgpNtAFVxRxkLeriutqA8GfLvOh2OtNx5Wb/WKndnIxrwVI/PTVJc1Q61 z2jSYLchiGQxtw5fqaPNccI/hbg1It6AJNaCcGWJFwurp9JrNeKwK4SiCh/q8Rxunm5SEacn/5SYZ 9zOV7xna7+FeOxVhoiDYsRCiqWSTVn6WIXPq/0/l79aVEbQJCNFLmDcfZmEU4R1HUCQjxyjfkrp1u lCOu7cVA==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:49469 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from <esq@HIDDEN>) id 1gLsxn-003slj-Ev; Sun, 11 Nov 2018 10:51:57 -0600 Date: Sun, 11 Nov 2018 08:51:54 -0800 Message-ID: <m2bm6vv9p1.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Sun_Nov_11_08:51:54_2018-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1gLsxn-003slj-Ev X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:49469 X-Source-Auth: lawlist X-Email-Count: 3 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> --Multipart_Sun_Nov_11_08:51:54_2018-1 Content-Type: text/plain; charset=US-ASCII Proof concept patch version 015.001. Changes include, but are not limited to: - Fixed mc-test. [When switching over from the move IT method to the dump glyph matrix method, cursor_type inadvertently got hard-coded as a BAR_CURSOR instead of respecting the user-defined cursor type/width for multiple fake cursors.] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; SETUP: Step 1: git clone -b master git://git.sv.gnu.org/emacs.git Step 2: In the new emacs folder, go back to an Emacs version from 07/07/2018: git reset --hard 98463bed07ecc9057094928ffdc2321eaaf3ab52 [Going back in time to 07/07/2018 saves @lawlist a couple of hours by not having to deal with unrelated recent changes to the master branch by the Emacs team.] Step 3: From within the new emacs folder created in Step 1, apply the patch: git apply /path/to/the/11_11_2018__08_30_42_690.diff [There should not be any error messages at this point; i.e, you should be returned to a new command prompt.] Step 4: ./autogen.sh Step 5: ./configure ... [your custom options] Step 6: make Step 7: make install - To try out built-in fake cursors with Magnar Sveen's library (multiple-cursors), install that package first. [If the multiple-cursors package is installed, an eval-after-load "multiple-cursors-core" statement within crosshairs.el will redefine a couple of functions and set up a few keyboard shortcuts.] If the multiple-cursors package by Magnar Sveen is not already installed, then there are two easy ways to install that package: Type: M-x mc-install OR, evaluate the following snippet: (progn (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) (package-refresh-contents) (package-install 'multiple-cursors)) - To try out the crosshairs feature, open a relatively simple buffer (e.g., just code or text) and type: M-x +-mode The default setting is on an idle timer, so just move around or type something to see how it works. - To see an example of a variety of built-in cursor styles and widths, type: M-x mc-test --Multipart_Sun_Nov_11_08:51:54_2018-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="11_11_2018__08_30_42_690.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvY3Jvc3NoYWlycy5lbCBiL2xpc3AvY3Jvc3NoYWlycy5lbApuZXcg ZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5lMmIxNmFkCi0tLSAvZGV2L251bGwKKysr IGIvbGlzcC9jcm9zc2hhaXJzLmVsCkBAIC0wLDAgKzEsMTI0OCBAQAorOzs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Cis7OzsgQkVHSU4gbW9kaW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5hbC1jb21tYW5kKSkpCisgICAgICAgICAg ICA7OyBza2lwIGtleWJvYXJkIG1hY3Jvcywgc2luY2UgdGhleSB3aWxsIGdlbmVyYXRlIGFjdHVh bCBjb21tYW5kcyB0aGF0IGFyZQorICAgICAgICAgICAgOzsgYWxzbyBydW4gaW4gdGhlIGNvbW1h bmQgbG9vcCAtIHdlJ2xsIGhhbmRsZSB0aG9zZSBsYXRlciBpbnN0ZWFkLgorICAgICAgICAgICAg KHdoZW4gKGZ1bmN0aW9ucCBvcmlnaW5hbC1jb21tYW5kKQorICAgICAgICAgICAgICA7OyBpZiBp dCdzIGEgbGFtYmRhLCB3ZSBjYW4ndCBrbm93IGlmIGl0J3Mgc3VwcG9ydGVkIG9yIG5vdAorICAg ICAgICAgICAgICA7OyAtIHNvIGdvIGFoZWFkIGFuZCBhc3N1bWUgaXQncyBvaywgYmVjYXVzZSB3 ZSdyZSBqdXN0IG9wdGltaXN0aWMgbGlrZSB0aGF0CisgICAgICAgICAgICAgIChpZiAob3IgKG5v dCAoc3ltYm9scCBvcmlnaW5hbC1jb21tYW5kKSkKKyAgICAgICAgICAgICAgICAgICAgICA7OyBs YW1iZGEgcmVnaXN0ZXJlZCBieSBzbWFydHJlcAorICAgICAgICAgICAgICAgICAgICAgIChzdHJp bmctcHJlZml4LXAgIigiIChzeW1ib2wtbmFtZSBvcmlnaW5hbC1jb21tYW5kKSkpCisgICAgICAg ICAgICAgICAgICAobWMvZXhlY3V0ZS1jb21tYW5kLWZvci1hbGwtZmFrZS1jdXJzb3JzIG9yaWdp bmFsLWNvbW1hbmQpCisgICAgICAgICAgICAgICAgOzsgc21hcnRyZXAgYGludGVybidzIGNvbW1h bmRzIGludG8gb3duIG9iYXJyYXkgdG8gaGVscAorICAgICAgICAgICAgICAgIDs7IGBkZXNjcmli ZS1iaW5kaW5ncycuICBTbywgbGV0J3MgcmUtYGludGVybicgaGVyZSB0bworICAgICAgICAgICAg ICAgIDs7IG1ha2UgdGhlIGNvbW1hbmQgY29tcGFyYWJsZSBieSBgZXEnLgorICAgICAgICAgICAg ICAgIChzZXRxIG9yaWdpbmFsLWNvbW1hbmQgKGludGVybiAoc3ltYm9sLW5hbWUgb3JpZ2luYWwt Y29tbWFuZCkpKQorICAgICAgICAgICAgICAgIDs7IG90aGVyd2lzZSBpdCdzIGEgc3ltYm9sLCBh bmQgd2UgY2FuIGJlIG1vcmUgdGhvcm91Z2gKKyAgICAgICAgICAgICAgICAoaWYgKGdldCBvcmln aW5hbC1jb21tYW5kICdtYy0tdW5zdXBwb3J0ZWQpCisgICAgICAgICAgICAgICAgICAgIChtZXNz YWdlICIlUyBpcyBub3Qgc3VwcG9ydGVkIHdpdGggbXVsdGlwbGUgY3Vyc29ycyVzIgorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBvcmlnaW5hbC1jb21tYW5kCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIChnZXQgb3JpZ2luYWwtY29tbWFuZCAnbWMtLXVuc3VwcG9ydGVkKSkKKyAg ICAgICAgICAgICAgICAgICh3aGVuIChhbmQgb3JpZ2luYWwtY29tbWFuZAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAobm90IChtZW1xIG9yaWdpbmFsLWNvbW1hbmQgbWMtLWRlZmF1bHQt Y21kcy10by1ydW4tb25jZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChub3QgKG1l bXEgb3JpZ2luYWwtY29tbWFuZCBtYy9jbWRzLXRvLXJ1bi1vbmNlKSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgKG9yIG1jL2Fsd2F5cy1ydW4tZm9yLWFsbAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgKG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy0tZGVmYXVsdC1jbWRz LXRvLXJ1bi1mb3ItYWxsKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG1lbXEg b3JpZ2luYWwtY29tbWFuZCBtYy9jbWRzLXRvLX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Bj b21tb25seSByZWZlcnJlZCB0byBhcyBMU0wgKFRoZSBMaW5kZW4gU2NyaXB0aW5nIExhbmd1YWdl KS4KK2Buc3Rlcm0ubScgdXNlcyBgTlNDb2xvcicsIHdoaWNoIHdvcmtzIHdlbGwgd2l0aCBMU0wu ICBgdzMydGVybS5jJyB1c2VzCitgUEFMRVRURVJHQicgb3IgYFJHQicsIGFuZCB0aGUgY29udmVy c2lvbiBmcm9tIExTTCBpcyBkb25lIGludGVybmFsbHkgYnkKK211bHRpcGx5aW5nIGVhY2ggZWxl bWVudCBvZiB0aGUgTFNMIGNvbG9yIHZlY3RvciBieSAyNTUuICBgeHRlcm0uYycgdXNlcworYHhf bWFrZV90cnVlY29sb3JfcGl4ZWwnLCB3aGljaCB1c2VzIDE2LWJpdCBSR0IgLS0gdGhlIGNvbnZl cnNpb24gZnJvbSBMU0wKK2hhcHBlbnMgaW50ZXJuYWxseSBieSBtdWx0aXBseWluZyBlYWNoIGVs ZW1lbnQgb2YgdGhlIExTTCBjb2xvciB2ZWN0b3IgYnkgNjU1MzUuIgorKGludGVyYWN0aXZlKQor ICAobGV0ICgoYnVmZmVyIChnZXQtYnVmZmVyLWNyZWF0ZSAiKk1DLVRFU1QqIikpKQorICAgICh3 aXRoLWN1cnJlbnQtYnVmZmVyIGJ1ZmZlcgorICAgICAgKGVyYXNlLWJ1ZmZlcikKKyAgICAgIChp bnNlcnQgIlRoaXMgaXMgYSB0ZXN0ISIpCisgICAgICAoc2V0cSBtdWx0aXBsZS1jdXJzb3JzLWNv bmYgJygoMSAiaGJhciIgIm1hZ2VudGEiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgKDIgImJhciIgInB1cnBsZSIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAoMyAiYm94IiAiIzAwRkYwMCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAoNCAiaG9sbG93IiAiIzAwMDBGRiIpCisgICAgICAgICAgIC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F3bi4iCisgICgrLWRyYXctY3Jvc3NoYWlycyAnZm9yY2UpKQorCisoZGVmdW4g Ky1kcmF3LWNyb3NzaGFpcnMgKCZvcHRpb25hbCBmb3JjZSkKKyAgKHdoZW4gKy1tb2RlCisgICAg KHdoZW4gKy10aW1lci12YXIKKyAgICAgIChzZXRxIHRpbWVyLWlkbGUtbGlzdCAoZGVscSArLXRp bWVyLXZhciB0aW1lci1pZGxlLWxpc3QpKQorICAgICAgKHNldHEgKy10aW1lci12YXIgbmlsKSkK KyAgICAodW5sZXNzIChtZW1xIHRoaXMtY29tbWFuZCArLXBhcmVucy1leGNsdXNpb25zKQorICAg ICAgKCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykpCisgICAgKGlmIGZvcmNlCisgICAgICAocHJv Z24KKyAgICAgICAgKCstcGFyZW5zLWZuKQorICAgICAgICAodW5sZXNzIGNyb3NzaGFpcnMtZHJh dy1mb3J0aHdpdGgKKyAgICAgICAgICAobWMtYWN0aXZhdGUtY3Jvc3NoYWlycyAoc2VsZWN0ZWQt d2luZG93KSkpKQorICAgICAgKHNldHEgKy10aW1lci12YXIgKHJ1bi13aXRoLWlkbGUtdGltZXIg Ky1pZGxlLXRpbWVyLXNlY29uZHMgbmlsICMnKy10aW1lci1mbikpKSkpCisKKzs7OyMjI2F1dG9s b2FkCisoZGVmaW5lLW1pbm9yLW1vZGUgKy1tb2RlCisiTWlub3IgbW9kZSBmb3IgZGlzcGxheWlu ZyBhIGhvcml6b250YWwgcnVsZXIuIgorICA6aW5pdC12YWx1ZSBuaWwKKyAgOmxpZ2h0ZXIgIiAr IgorICA6a2V5bWFwIG5pbAorICA6Z2xvYmFsIG5pbAorICA6Z3JvdXAgJystbW9kZQorICAoY29u ZAorICAgICgrLW1vZGUKKyAgICAgICh3aGVuIChhbmQgZ2xvYmFsLWVsZG9jLW1vZGUKKyAgICAg ICAgICAgICAgICAgKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAgJ2FueSkKKyAgICAgICAgICAgICAg ICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAgICAgICAgKGdsb2JhbC1lbGRv Yy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgaml0LWxvY2stY29udGV4dC10aW1lcgorICAg ICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAgICAg ICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAod2hlbiAodGlt ZXJwIGppdC1sb2NrLWNvbnRleHQtdGltZXIpCisgICAgICAgICAgKGNhbmNlbC10aW1lciBqaXQt bG9jay1jb250ZXh0LXRpbWVyKSkKKyAgICAgICAgOzsgKHNldHEgaml0LWxvY2stY29udGV4dC10 aW1lciAocnVuLXdpdGgtaWRsZS10aW1lciA1LjAgJ3JlcGVhdCAnaml0LWxvY2stY29udGV4dC1m b250aWZ5KSkKKyAgICAgICAgKHNldHEgaml0LWxvY2stY29udGV4dC10aW1lciBuaWwpKQorICAg ICAgKHdoZW4gKGFuZCAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAgICAg ICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAod2hlbiAodGlt ZXJwIHVuZG8tYXV0by1jdXJyZW50LWJvdW5kYXJ5LXRpbWVyKQorICAgICAgICAgIChjYW5jZWwt dGltZXIgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpKQorICAgICAgICAoZnNldCAn dW5kby1hdXRvLS11bmRvYWJsZS1jaGFuZ2UKKyAgICAgICAgICAgICAgKGxhbWJkYSAoKSAoYWRk LXRvLWxpc3QgJ3VuZG8tYXV0by0tdW5kb2FibHktY2hhbmdlZC1idWZmZXJzIChjdXJyZW50LWJ1 ZmZlcikpKSkKKyAgICAgICAgKGZzZXQgJ3VuZG8tYXV0by1hbWFsZ2FtYXRlICdpZ25v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gdGVzdCBmaWxlIHVzZWQgYnkgQGxhd2xpc3QKKyAg ICAgIDs7OyBib2dzIEVtYWNzIGRvd24gdW5sZXNzIGBiaWRpLWRpc3BsYXktcmVvcmRlcmluZycg aXMgc2V0IHRvIGEgbmlsIHZhbHVlLgorICAgICAgOzs7IEhvd2V2ZXIsIG1vc3QgdXNlcnMgd2ls bCBwcm9iYWJseSBub3Qgd2FudCB0aGlzIHBhcnRpY3VsYXIgc2V0dGluZy4KKyAgICAgICh1bmxl c3MgKG51bGwgYmlkaS1kaXNwbGF5LXJlb3JkZXJpbmcpCisgICAgICAgIChzZXRxIGJpZGktZGlz cGxheS1yZW9yZGVyaW5nIG5pbCkpCisgICAgICAodW5sZXNzIChhbmQgKGNhbGxlZC1pbnRlcmFj dGl2ZWx5LXAgJ2FueSkKKyAgICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgt YXJnICcoNCkpKQorICAgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICcrLS1zYXZlZC1z dGF0ZSkgbmlsKQorICAgICAgICAoZG9saXN0ICh2YXIgJyhidWZmZXItZGlzcGxheS10YWJsZQor ICAgICAgICAgICAgICAgICAgICAgICBmcmluZ2UtaW5kaWNhdG9yLWFsaXN0CisgICAgICAgICAg ICAgICAgICAgICAgIHRhYi13aWR0aAorICAgICAgICAgICAgICAgICAgICAgICBsaW5lLW1vdmUt dmlzdWFsCisgICAgICAgICAgICAgICAgICAgICAgIHRydW5jYXRlLWxpbmVzCisgICAgICAgICAg ICAgICAgICAgICAgIHRydW5jYXRlLXBhcnRpYWwtd2lkdGgtd2luZG93cworICAgICAgICAgICAg ICAgICAgICAgICB3b3JkLXdyYXApKQorICAgICAgICAgICh3aGVuIChsb2NhbC12YXJpYWJsZS1w IHZhcikKKyAgICAgICAgICAgIChwdXNoIChjb25zIHZhciAoc3ltYm9sLXZhbHVlIHZhcikpICst LXNhdmVkLXN0YXRlKSkpCisgICAgICAgIChzZXRxIGZpbGwtY29sdW1uIDgwKQorICAgICAgICAo c2V0cSBkaXNwbGF5LWxpbmUtbnVtYmVycyB0KQorICAgICAgICAoc2V0cS1sb2NhbCBhdXRvLWhz Y3JvbGwtbW9kZSAnY3VycmVudC1saW5lKQorICAgICAgICAoc2V0cS1sb2NhbCBoc2Nyb2xsLXN0 ZXAgNSkKKyAgICAgICAgKHNldHEgYnVmZmVyLWRpc3BsYXktdGFibGUgKy1idWZmZXItZGlzcGxh eS10YWJsZSkKKyAgICAgICAgKHNldHEgdGFiLXdpZHRoIDQpCisgICAgICAgIChzZXQgKG1ha2Ut bG9jYWwtdmFyaWFibGUgJ2xpbmUtbW92ZS12aXN1YWwpIHQpCisgICAgICAgIChzZXRxIHRydW5j YXRlLWxpbmVzCisgICAgICAgICAgKGNvbmQKKyAgICAgICAgICAgICgobGV0ICgobHN0ICstdHJ1 bmNhdGUtbGluZXMtZGVyaXZlZC1tb2RlcykKKyAgICAgICAgICAgICAgICAgICAgbW9kZSkKKyAg ICAgICAgICAgICAgKGNhdGNoICdmb3VuZAorICAgICAgICAgICAgICAgICh3aGlsZSAoc2V0cSBt b2RlIChwb3AgbHN0KSkKKyAgICAgICAgICAgICAgICAgICh3aGVuIChkZXJpdmVkLW1vZGUtcCBt b2RlKQorICAgICAgICAgICAgICAgICAgICAodGhyb3cgJ2ZvdW5kIHQpKSkpKSkKKyAgICAgICAg ICAgICAoKG1lbXEgbWFqb3ItbW9kZSArLXRydW5jYXRlLWxpbmVzLW1ham9yLW1vZGVzKSkKKyAg ICAgICAgICAgICAodAorICAgICAgICAgICAgICAgbmlsKSkpCisgICAgICAgIChzZXQgKG1ha2Ut bG9jYWwtdmFyaWFibGUgJ3RydW5jYXRlLXBhcnRpYWwtd2lkdGgtd2luZG93cykgbmlsKQorICAg ICAgICAoc2V0cSB3b3JkLXdyYXAgdCkKKyAgICAgICAgKHNldHEgaW5kaWNhdGUtZW1wdHktbGlu ZXMgdCkKKyAgICAgICAgKHNldHEgaW5kaWNhdGUtYnVmZmVyLWJvdW5kYXJpZXMgJ2xlZnQpCisg ICAgICAgIChzZXRxIGZyaW5nZS1pbmRpY2F0b3ItYWxpc3QKKyAgICAgICAgICAgIDs7OyBoc2Ns X2FsbF90ZW1wX3AgfCBoc2NsX3RlbXBfcAorICAgICAgICAgICcoKCstaHNjbC10ZW1wIC4gKCst c2luZ2xlLWFuZ2xlLWxlZnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArLWRvdWJsZS1h bmdsZS1sZWZ0KSkKKyAgICAgICAgICAgIDs7OyBoc2NsX2FsbF9wZXJtXzBfcCB8IGhzY2xfYWxs X3Blcm1fMV9wIHwgaHNjbF9hbGxfcGVybV8yX3AgfCBoc2NsX3Blcm1fcAorICAgICAgICAgICAg KCstaHNjbC1wZXJtIC4gKCstc2luZ2xlLWFuZ2xlLXVwCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgKy1kb3VibGUtYW5nbGUtdXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArLXRy aXBsZS1hbmdsZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICstcXVhZHJ1cGxlLWFu Z2xlLXVwKSkKKyAgICAgICAgICAgICgrLW92ZXJsYXktYXJyb3cgLiAoKy1mcmluZ2UtbGVmdC1h cnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArLWZyaW5nZS1yaWdodC1hcnJv dykpCisgICAgICAgICAgICAodHJ1bmNhdGlvbiAuICgrLWZyaW5nZS1sZWZ0LWFycm93CisgICAg ICAgICAgICAgICAgICAgICAgICAgICArLWZyaW5nZS1yaWdodC1hcnJvdykpCisgICAgICAgICAg ICAoY29udGludWF0aW9uIC4gKCstZnJpbmdlLWxlZnQtY3VybHktYXJyb3cKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgKy1iYWNrc2xhc2gpKQorICAgICAgICAgICAgKG92ZXJsYXktYXJy b3cgLiArLWZyaW5nZS1yaWdodC10cmlhbmdsZSkKKyAgICAgICAgICAgICh1cCAuICstZnJpbmdl LXVwLWFycm93KQorICAgICAgICAgICAgKGRvd24gLiArLWZyaW5nZS1kb3duLWFycm93KQorICAg ICAgICAgICAgKHRvcCAuICstZnJpbmdlLXRvcC1sZWZ0LWFuZ2xlKQorICAgICAgICAgICAgKGJv dHRvbSAuICstZnJpbmdlLWJvdHRvbS1yaWdodC1hbmdsZSkKKyAgICAgICAgICAgICh0b3AtYm90 dG9tIC4gKCstZnJpbmdlLWxlZnQtYnJhY2tldAorICAgICAgICAgICAgICAgICAgICAgICAgICAg Ky1mcmluZ2UtcmlnaHQtYnJhY2tldAorICAgICAgICAgICAgICAgICAgICAgICAgICAgKy1mcmlu Z2UtdG9wLXJpZ2h0LWFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgICArLWZyaW5nZS10 b3AtbGVmdC1hbmdsZSkpCisgICAgICAgICAgICAoZW1wdHktbGluZSAuICstZnJpbmdlLWVtcHR5 LWxpbmUpCisgICAgICAgICAgICAodW5rbm93biAuICstZnJpbmdlLXF1ZXN0aW9uLW1hcmspKSkK KyAgICAgICAgKHNldHEgZnJpbmdlLWN1cnNvci1hbGlzdCAnKChib3ggLiArLWZyaW5nZS1sZWZ0 LXRyaWFuZ2xlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGhvbGxvdyAu ICstaG9sbG93LXJlY3RhbmdsZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IChiYXIgLiArLXZlcnRpY2FsLWJhcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIChoYmFyIC4gKy1mcmluZ2UtaG9yaXpvbnRhbC1iYXIpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAoaG9sbG93LXNtYWxsIC4gKy1mcmluZ2UtaG9sbG93LXNxdWFyZSkp KQorICAgICAgICAoaWYgY3Jvc3NoYWlycy1kcmF3LWZvcnRod2l0aAorICAgICAgICAgIChhZGQt aG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJhdy1mb3J0aHdpdGggJ2FwcGVuZCAnbG9jYWwp CisgICAgICAgICAgKGFkZC1ob29rICdwb3N0LWNvbW1hbmQtaG9vayAnKy1kcmF3LWNyb3NzaGFp cnMgJ2FwcGVuZCAnbG9jYWwpKQorICAgICAgICAod2hlbiBjcm9zc2hhaXJzLWRyYXctZm9ydGh3 aXRoCisgICAgICAgICAgKGFkZC1ob29rICd3aW5kb3ctY29uZmlndXJhdGlvbi1jaGFuZ2UtaG9v ayAnKy1kcmF3LWZvcnRod2l0aCBuaWwgJ2xvY2FsKSkKKyAgICAgICAgKGFkZC1ob29rICdjaGFu Z2UtbWFqb3ItbW9kZS1ob29rICd0dXJuLW9mZi0rLW1vZGUgbmlsICdsb2NhbCkpCisgICAgICAo d2hlbiAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAoaWYgKGVxdWFsIGN1 cnJlbnQtcHJlZml4LWFyZyAnKDQpKQorICAgICAgICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCst bW9kZScgLS0gZGVidWdnaW5nIG1vZGUuIikKKyAgICAgICAgICAobWVzc2FnZSAiVHVybmVkIE9O IGArLW1vZGUnLiIpKSkpCisgICAgKHQKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdmaWxs LWNvbHVtbikKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdhdXRvLWhzY3JvbGwtbW9kZSkK KyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdoc2Nyb2xsLXN0ZXApCisgICAgICAoa2lsbC1s b2NhbC12YXJpYWJsZSAnY3Jvc3NoYWlycykKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdk aXNwbGF5LWxpbmUtbnVtYmVycykKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdkaXNwbGF5 LWxpbmUtbnVtYmVycy13aWR0aCkKKyAgICAgIChraWxsLWxvY2FsL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ICAoZnVuY2FsbCArLXBhcmVucy1mcm9t LWZuKQorICAgICAgICAgICAgICAgICAocG9pbnQtbWluKSkpCisgICAgICAgICAod2luIChzZWxl Y3RlZC13aW5kb3cpKQorICAgICAgICAgKGkgMCkKKyAgICAgICAgIChwcmVjZWRpbmctY2hhciAo cHJlY2VkaW5nLWNoYXIpKQorICAgICAgICAgKG9jaGFyIChjaGFyLWFmdGVyIG9wb2ludCkpCisg ICAgICAgICAocG9zMQorICAgICAgICAgICAoY29uZAorICAgICAgICAgICAgICgoYW5kIG9jaGFy CisgICAgICAgICAgICAgICAgICAgKG9yIDs7OyAoY2hhci10by1zdHJpbmcgNDApID0+IG9wZW5p bmcgcGFyZW50aGVzaXMKKyAgICAgICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgNDApCisgICAg ICAgICAgICAgICAgICAgICAgIDs7OyAoY2hhci10by1zdHJpbmcgOTEpID0+IG9wZW5pbmcgc3F1 YXJlIGJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgOTEpCisgICAgICAg ICAgICAgICAgICAgICAgIDs7OyAoY2hhci10by1zdHJpbmcgMTIzKSA9PiBvcGVuaW5nIHdhdnkg YnJhY2tldAorICAgICAgICAgICAgICAgICAgICAgICAoPSBvY2hhciAxMjMpKSkKKyAgICAgICAg ICAgICAgICAobWluICgxKyBvcG9pbnQpIChwb2ludC1tYXgpKSkKKyAgICAgICAgICAgICAoKG9y IDs7OyAoY2hhci10by1zdHJpbmcgNDEpID0+IGNsb3NpbmcgcGFyZW50aGVzaXMKKyAgICAgICAg ICAgICAgICAgICg9IHByZWNlZGluZy1jaGFyIDQxKQorICAgICAgICAgICAgICAgICAgOzs7IChj aGFyLXRvLXN0cmluZyA5MykgPT4gY2xvc2luZyBzcXVhcmUgYnJhY2tldAorICAgICAgICAgICAg ICAgICAgKD0gcHJlY2VkaW5nLWNoYXIgOTMpCisgICAgICAgICAgICAgICAgICA7OzsgKGNoYXIt dG8tc3RyaW5nIDEyNSkgPT4gY2xvc2luZyB3YXZ5IGJyYWNrZXQKKyAgICAgICAgICAgICAgICAg ICg9IHByZWNlZGluZy1jaGFyIDEyNSkpCisgICAgICAgICAgICAgICAgKG1heCAocG9pbnQtbWlu KSAoMS0gb3BvaW50KSkpCisgICAgICAgICAgICAgKHQKKyAgICAgICAgICAgICAgICBvcG9pbnQp KSkKKyAgICAgICAgIHBvczIKKyAgICAgICAgIHNlbGVjdGVkLWZhY2UpCisgICAgKHNhdmUtZXhj dXJzaW9uCisgICAgICAoY29uZGl0aW9uLWNhc2UgbmlsCisgICAgICAgICh3aGlsZSAoc2V0cSBw b3MxIChudGggMSAocGFyc2UtcGFydGlhbC1zZXhwIGZyb20gcG9zMSkpKQorICAgICAgICAgIChz ZXRxIHBvczIgKHNjYW4tc2V4cHMgcG9zMSAxKSkKKyAgICAgICAgICAoaWYgKD0gaSAxMCkKKyAg ICAgICAgICAgIChzZXRxIGkgMSkKKyAgICAgICAgICAgIChzZXRxIGkgKDErIGkpKSkKKyAgICAg ICAgICAoc2V0cSBzZWxlY3RlZC1mYWNlIChjb25kCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICgoPSBpIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFy ZW5zLW9uZS1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSAyKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy10d28tZmFjZSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgMykKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtdGhyZWUtZmFjZSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgKCg9IGkgNCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAnKy1wYXJlbnMtZm91ci1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo KD0gaSA1KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1maXZl LWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDYpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLXNpeC1mYWNlKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA3KQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICcrLXBhcmVucy1zZXZlbi1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAoKD0gaSA4KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBh cmVucy1laWdodC1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA5 KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1uaW5lLWZhY2Up CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDEwKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy10ZW4tZmFjZSkpKQorICAgICAgICAgIChs ZXQgKChvdiAobWFrZS1vdmVybGF5IHBvczEgKDErIHBvczEpKSkpCisgICAgICAgICAgICAodW5s ZXNzICstcGFyZW5zLWluYWN0aXZlLXdpbmRvd3MKKyAgICAgICAgICAgICAgKG92ZXJsYXktcHV0 IG92ICd3aW5kb3cgd2luKSkKKyAgICAgICAgICAgIChvdmVybGF5LXB1dCBvdiAnZmFjZSBzZWxl Y3RlZC1mYWNlKSkKKyAgICAgICAgICAod2hlbiBwb3MyCisgICAgICAgICAgICAobGV0ICgob3Yg KG1ha2Utb3ZlcmxheSAoMS0gcG9zMikgcG9zMikpKQorICAgICAgICAgICAgICAodW5sZXNzICst cGFyZW5zLWluYWN0aXZlLXdpbmRvd3MKKyAgICAgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3Yg J3dpbmRvdyB3aW4pKQorICAgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ2ZhY2Ugc2VsZWN0 ZWQtZmFjZSkpKSkKKyAgICAgICAgKGVycm9yIG5pbCkpKQorICAgIChzZXRxICstcGFyZW5zLW92 ZXJsYXlzLWV4aXN0LXAgdCkpKQorCisoZGVmdW4gKy1yZW1vdmUtb3ZlcmxheXMgKGJlZyBlbmQg bmFtZSB2YWwpCisiUmVtb3ZlIHRoZSBvdmVybGF5cyB0aGF0IGFyZSBgZXF1YWwtaW5jbHVkaW5n LXByb3BlcnRpZXNgLgorSW5jbHVkZXMgYSB1bmlxdWUgc2l0dWF0aW9uIHdoZW4gYW4gb3Zlcmxh eSB3aXRoIGFuIGAnYWZ0ZXItc3RyaW5nYCBwcm9wZXJ0eQoraXMgYXQgdGhlIHZlcnkgZW5kIG9m IGEgbmFycm93ZWQtYnVmZmVyLiIKKyAgKGxldCogKChwb2ludC1tYXggKHBvaW50LW1heCkpCisg ICAgICAgICAocG9pbnQtbWluIChwb2ludC1taW4pKQorICAgICAgICAgKG5hcnJvd2VkLXAgKGJ1 ZmZlci1uYXJyb3dlZC1wKSkKKyAgICAgICAgIChiZWcgKGlmIGJlZyBiZWcgcG9pbnQtbWluKSkK KyAgICAgICAgIChlbmQKKyAgICAgICAgICAgKGNvbmQKKyAgICAgICAgICAgICAoKGFuZAorICAg ICAgICAgICAgICAgICAobm90IG5hcnJvd2VkLXApCisgICAgICAgICAgICAgICAgIGVuZCkKKyAg ICAgICAgICAgICAgIGVuZCkKKyAgICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAo bm90IG5hcnJvd2VkLXApCisgICAgICAgICAgICAgICAgIChudWxsIGVuZCkpCisgICAgICAgICAg ICAgICBwb2ludC1tYXgpCisgICAgICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFy cm93ZWQtcAorICAgICAgICAgICAgICAgICBlbmQKKyAgICAgICAgICAgICAgICAgKDwgZW5kIHBv aW50LW1heCkpCisgICAgICAgICAgICAgICBlbmQpCisgICAgICAgICAgICAgKChhbmQKKyAgICAg ICAgICAgICAgICAgbmFycm93ZWQtcAorICAgICAgICAgICAgICAgICBlbmQKKyAgICAgICAgICAg ICAgICAgKD0gZW5kIHBvaW50LW1heCkpCisgICAgICAgICAgICAgICAoMSsgZW5kKSkKKyAgICAg ICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICBuYXJyb3dlZC1wCisgICAgICAgICAgICAg ICAgIChudWxsIGVuZCkpCisgICAgICAgICAgICAgICAoMSsgcG9pbnQtbWF4KSkgKSkKKyAgICAg ICAgIChvdmVybGF5cworICAgICAgICAgICAocHJvZ24KKyAgICAgICAgICAgICAob3ZlcmxheS1y ZWNlbnRlciBlbmQpCisgICAgICAgICAgICAgKG92ZXJsYXlzLWluIGJlZyBlbmQpKSkpCisgICAg KHdoZW4gKGFuZCBiZWcgZW5kIG5hbWUgdmFsKQorICAgICAgKGRvbGlzdCAobyBvdmVybGF5cykK KyAgICAgICAgKGNvbmQKKyAgICAgICAgICAoKGFuZCAoZXEgbmFtZSAnZmFjZSkKKyAgICAgICAg ICAgICAgICAoZXEgKG92ZXJsYXktZ2V0IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIDs7IEVp dGhlciBwdXNoIHRoaXMgb3ZlcmxheSBvdXRzaWRlIGJlZy4uLmVuZAorICAgICAgICAgICAgOzsg b3Igc3BsaXQgaXQgdG8gZXhjbHVkZSBiZWcuLi5lbmQKKyAgICAgICAgICAgIDs7IG9yIGRlbGV0 ZSBpdCBlbnRpcmVseSAoaWYgaXQgaXMgY29udGFpbmVkIGluIGJlZy4uLmVuZCkuCisgICAgICAg ICAgICAoaWYgKDwgKG92ZXJsYXktc3RhcnQgbykgYmVnKQorICAgICAgICAgICAgICAgIChpZiAo PiAob3ZlcmxheS1lbmQgbykgZW5kKQorICAgICAgICAgICAgICAocHJvZ24KKyAgICAgICAgICAg ICAgICAobW92ZS1vdmVybGF5IChjb3B5LW92ZXJsYXkgbykKKyAgICAgICAgICAgICAgICAgIChv dmVybGF5LXN0YXJ0IG8pIGJlZykKKyAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gZW5k IChvdmVybGF5LWVuZCBvKSkpCisgICAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gKG92 ZXJsYXktc3RhcnQgbykgYmVnKSkKKyAgICAgICAgICAgICAgKGlmICg+IChvdmVybGF5LWVuZCBv KSBlbmQpCisgICAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVu ZCBvKSkKKyAgICAgICAgICAgICAgICAoZGVsZXRlLW92ZXJsYXkgbykpKSkKKyAgICAgICAgICAo KGFuZCAobm90IChlcSBuYW1lICdmYWNlKSkKKyAgICAgICAgICAgICAgICAoZXF1YWwtaW5jbHVk aW5nLXByb3BlcnRpZXMgKG92ZXJsYXktZ2V0IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIChk ZWxldGUtb3ZlcmxheSBvKSkpKSkpKQorCisoZGVmdW4gKy1kZWxldGUtcGFyZW5zLW92ZXJsYXlz ICgpCisgICh3aGVuICstcGFyZW5zLW92ZXJsYXlzLWV4aXN0LXAKKyAgICAoZG9saXN0IChmYWNl ICcoKy1wYXJlbnMtb25lLWZhY2UKKyAgICAgICAgICAgICAgICAgICAgKy1wYXJlbnMtdHdvLWZh Y2UKKyAgICAgICAgICAgICAgICAgICAgKy1wYXJlbnMtdGhyZWUtZmFjZQorICAgICAgICAgICAg ICAgICAgICArLXBhcmVucy1mb3VyLWZhY2UKKyAgICAgICAgICAgICAgICAgICAgKy1wYXJlbnMt Zml2ZS1mYWNlCisgICAgICAgICAgICAgICAgICAgICstcGFyZW5zLXNpeC1mYWNlCisgICAgICAg ICAgICAgICAgICAgICstcGFyZW5zLXNldmVuLWZhY2UKKyAgICAgICAgICAgICAgICAgICAgKy1w YXJlbnMtZWlnaHQtZmFjZQorICAg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qKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBYU0VU RkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgbW9kZV9saW5lX2Zvcm1hdCksIGlk eCk7ICsraWR4OwogICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgYWJi cmV2X21vZGUpLCBpZHgpOyArK2lkeDsKICAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9j YWxfZmxhZ3MsIG92ZXJ3cml0ZV9tb2RlKSwgaWR4KTsgKytpZHg7CkBAIC01MjAwLDYgKzUyMTks MjUgQEAgaW5pdF9idWZmZXJfb25jZSAodm9pZCkKICAgLyogTXVzdCBkbyB0aGVzZSBiZWZvcmUg bWFraW5nIHRoZSBmaXJzdCBidWZmZXIhICovCiAKICAgLyogcmVhbCBzZXR1cCBpcyBkb25lIGlu IGJpbmRpbmdzLmVsICovCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RSBDVVJTT1JTICovCisKKyAgYnNldF9ibHZfbWNfcmVhbF9mYWtlX2N1cnNvciAoJmJ1ZmZlcl9k ZWZhdWx0cywgUWhvbGxvdyk7CisgIGJzZXRfYmx2X211bHRpcGxlX2N1cnNvcnNfY29uZiAoJmJ1 ZmZlcl9kZWZhdWx0cywgUW5pbCk7CisgIGJzZXRfYmx2X211bHRpcGxlX2N1cnNvcnNfZHJhd19m b3J0aHdpdGggKCZidWZmZXJfZGVmYXVsdHMsIFF0KTsKKyAgYnNldF9ibHZfbXVsdGlwbGVfY3Vy c29yc19pbmFjdGl2ZV93aW5kb3dzICgmYnVmZmVyX2RlZmF1bHRzLCBRdCk7CisgIGJzZXRfYmx2 X2Nyb3NzaGFpcnMgKCZidWZmZXJfZGVmYXVsdHMsIFFuaWwpOworICBic2V0X2Jsdl9j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SUyA1MAorCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisjZGVm aW5lIE1BWF9QRVJfQlVGRkVSX1ZBUlMgNjAKICAgY2hhciBsb2NhbF9mbGFnc1tNQVhfUEVSX0JV RkZFUl9WQVJTXTsKIAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBTZXQgdG8g dGhlIG1vZHRpbWUgb2YgdGhlIHZpc2l0ZWQgZmlsZSB3aGVuIHJlYWQgb3Igd3JpdHRlbi4KICAg ICAgbW9kdGltZS50dl9uc2VjID09IE5PTkVYSVNURU5UX01PRFRJTUVfTlNFQ1MgbWVhbnMKICAg ICAgdmlzaXRlZCBmaWxlIHdhcyBub25leGlzdGVudC4gIG1vZHRpbWUudHZfbnNlYyA9PQpAQCAt OTE4LDYgKzk2Myw3NCBAQCBYQlVGRkVSIChMaXNwX09iamVjdCBhKQogLyogTW9zdCBjb2RlIHNo b3VsZCB1c2UgdGhlc2UgZnVuY3Rpb25zIHRvIHNldCBMaXNwIGZpZWxkcyBpbiBzdHJ1Y3QKICAg IGJ1ZmZlci4gIChTb21lIHNldHRlcnMgdGhhdCBhcmUgcHJpdmF0ZSB0byBhIHNpbmdsZSAuYyBm aWxlIGFyZQogICAgZGVmaW5lZCBhcyBzdGF0aWMgaW4gdGhvc2UgZmlsZXMuKSAgKi8KKworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworSU5MSU5F IHZvaWQKK2JzZXRfYmx2X21jX3JlYWxfZmFrZV9jdXJzb3IgKHN0cnVjdCBidWZmZXI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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKK2VudW0g bWNfdHlwZXMKK3sKKyAgTk9fRkxBVk9SLAorICBNQ19HTFlQSCwKKyAgTUNfR0xZUEhMRVNTLAor ICBNQ19HTFlQSF9UQUIsCisgIE1DX09WRVJMQVlfQVJST1dfQklUTUFQLAorICBNQ19QSUxDUk9X LAorICBNQ19IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XLAorICBNQ19IT0xMT1dfUkVDVEFO R0xFLAorICBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1csCisgIE1DX1ZFUlRJQ0FMX0JBUiwK KyAgTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorfTsKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogLyogVGV4dCBjdXJzb3IgdHlwZXMuICAqLwogCiBlbnVtIHRleHRfY3Vyc29yX2tp bmRzCkBAIC0zNzYsNiArMzk4LDE4IEBAIHN0cnVjdCBnbHlwaF9zbGljZQogCiBzdHJ1Y3QgZ2x5 cGgKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMg Ki8KKworICBpbnQgeCwgeSwgaHBvcywgdnBvczsKKworICBib29sX2JmIHp2X3AgOiAxOworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIFBvc2l0aW9uIGZyb20gd2hpY2ggdGhp cyBnbHlwaCB3YXMgZHJhd24uICBJZiBgb2JqZWN0JyBiZWxvdyBpcyBhCiAgICAgIExpc3Agc3Ry aW5nLCB0aGlzIGlzIGFuIGluZGV4IGludG8gdGhhdCBzdHJpbmcuICBJZiBpdCBpcyBhCiAgICAg IGJ1ZmZlciwgdGhpcyBpcyBhIHBvc2l0aW9uIGluIHRoYXQgYnVmZmVyLiAgSW4gYWRkaXRpb24s IHNvbWUKQEAgLTIyMTAsNiArMjI0NCwxNiBAQCBzdHJ1Y3QgY29tcG9zaXRpb25faXQKIAogc3Ry dWN0IGl0CiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJT T1JTICovCisKKyAgYm9vbF9iZiB6dl9wIDogMTsKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogICAvKiBUaGUgd2luZG93IGluIHdoaWNoIHdlIGl0ZXJhdGUgb3ZlciBjdXJyZW50X2J1 ZmZlciAob3IgYSBzdHJpbmcpLiAgKi8KICAgTGlzcF9PYmplY3Qgd2luZG93OwogICBzdHJ1Y3Qg d2luZG93ICp3OwpkaWZmIC0tZ2l0IGEvc3JjL2ZyaW5nZS5jIGIvc3JjL2ZyaW5nZS5jCmluZGV4 IDYwNjkxODQuLmI1YzJkYzIgMTAwNjQ0Ci0tLSBhL3NyYy9mcmluZ2UuYworKysgYi9zcmMvZnJp bmdlLmMKQEAgLTQzMyw2ICs0MzMsNDAyIEBAIHN0YXRpYyB1bnNpZ25lZCBzaG9ydCBlbXB0eV9s aW5lX2JpdHNbXSA9IHsKICAgMHgwMCwgMHgzYywgMHgwMCwgMHgwMCwgMHgzYywgMHgwMCwgMHgw MCwgMHgzYywgMHgwMH07CiAKIAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBN VUxUSVBMRSBDVVJTT1JTICovCisKKy8qIGArLWZyaW5nZS1oZWxwZXItZGVjaW1hbCcgZGVmaW5l ZCBpbiBgY3Jvc3NoYWlycy5lbGAgKi8KKworLyogMjQKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhl eGFkZWNpbWFsCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4u Li4uLi4iCisgICAgICAieC4ueHguLi4iCisgICAgICAieC4uLnh4Li4iCisgICAgICAieC4uLi54 eC4iCisgICAgICAieC54eHh4eHgiCisgICAgICAieC54eHh4eHgiCisgICAgICAieC4uLi54eC4i CisgICAgICAieC4uLnh4Li4iCisgICAgICAieC4ueHguLi4iCisgICAgICAieC4uLi4uLi4iCisg ICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBz aG9ydCBtY192ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3dfYml0c1tdID17CisgIDB4ODAsIDB4ODAs IDB4ODAsIDB4OTgsIDB4OGMsIDB4ODYsIDB4YmYsCisgIDB4YmYsIDB4ODYsIDB4OGMsIDB4OTgs IDB4ODAsIDB4ODAsIDB4ODB9OworCisvKiAyNQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRl Y2ltYWwKKyAgICAgICJ4eHh4eHh4eCIKKyAgICAgICJ4Li4uLi4ueCIKKyAgICAgICJ4Li4uLi4u eCIKKyAgICAgICJ4Li54eC4ueCIKKyAgICAgICJ4Li4ueHgueCIKKyAgICAgICJ4Li4uLnh4eCIK KyAgICAgICJ4Lnh4eHh4eCIKKyAgICAgICJ4Lnh4eHh4eCIKKyAgICAgICJ4Li4uLnh4eCIKKyAg ICAgICJ4Li4ueHgueCIKKyAgICAgICJ4Li54eC4ueCIKKyAgICAgICJ4Li4uLi4ueCIKKyAgICAg ICJ4Li4uLi4ueCIKKyAgICAgICJ4eHh4eHh4eCIpC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4uLiIKKyAgICAgICJ4Li4uLi4u LiIKKyAgICAgICJ4Li4uLi4uLiIKKyAgICAgICJ4Li4uLi4uLiIKKyAgICAgICJ4Li4uLi4uLiIK KyAgICAgICJ4Li4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3ZlcnRpY2Fs X2Jhcl9iaXRzW10gPXsKKyAgMHg4MCwgMHg4MCwgMHg4MCwgMHg4MCwgMHg4MCwgMHg4MCwgMHg4 MCwKKyAgMHg4MCwgMHg4MCwgMHg4MCwgMHg4MCwgMHg4MCwgMHg4MCwgMHg4MH07CisKKy8qIDI4 CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Li4uLi4uIgorICAg ICAgInh4Li4uLi4uIgorICAgICAgIiB4eC4uLi4uIgorICAgICAgIi54eC4uLi4uIgorICAgICAg Ii4ueHguLi4uIgorICAgICAgIi4ueHguLi4uIgorICAgICAgIi4uLnh4Li4uIgorICAgICAgIi4u Lnh4Li4uIgorICAgICAgIi4uLi54eC4uIgorICAgICAgIi4uLi54eC4uIgorICAgICAgIi4uLi4u eHguIgorICAgICAgIi4uLi4ueHguIgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4 IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfYmFja3NsYXNoX2JpdHNbXSA9eworICAw eGMwLCAweGMwLCAweGUwLCAweDYwLCAweDMwLCAweDMwLCAweDE4LCAweDE4LCAweGMsIDB4Yywg MHg2LCAweDYsIDB4MywgMHgzfTsKKworLyogMjkKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFk ZWNpbWFsCisgICAgICAieHguLi4uLi4iCisgICAgICAieHguLi4uLi4iCisgICAgICAieHh4Li4u Li4iCisgICAgICAieHh4Li4uLi4iCisgICAgICAieC54eC4uLi4iCisgICAgICAieC54eC4uLi4i CisgICAgICAieC4ueHguLi4iCisgICAgICAieC4ueHguLi4iCisgICAgICAieC4uLnh4Li4iCisg ICAgICAieC4uLnh4Li4iCisgICAgICAieC4uLi54eC4iCisgICAgICAieC4uLi54eC4iCisgICAg ICAieC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9y dCBtY192ZXJ0aWNhbF9iYXJfYmFja3NsYXNoX2JpdHNbXSA9eworICAweGMwLCAweGMwLCAweGUw LCAweGUwLCAweGIwLCAweGIwLCAweDk4LAorICAweDk4LCAweDhjLCAweDhjLCAweDg2LCAweDg2 LCAweDgzLCAweDgzfTsKKworLyogMzAKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFs CisgICAgICAiLnh4eHh4eC4iCisgICAgICAieHh4eC54Li4iCisgICAgICAieHh4eC54Li4iCisg ICAgICAieHh4eC54Li4iCisgICAgICAiLnh4eC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAg ICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAgICAi Li4ueC54Li4iCisgICAgICAiLi4ueC54Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBt Y19waWxjcm93X2JpdHNbXSA9eworICAweDdlLCAweGY0LCAweGY0LCAweGY0LCAweDc0LCAweDE0 LCAweDE0LCAweDE0LCAweDE0LCAweDE0LCAweDE0fTsKKworLyogMzEKKyAgICAoKy1mcmluZ2Ut aGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi54eHh4Li4iCisgICAgICAiLnh4eHh4eC4iCisg ICAgICAieC4ueHguLngiCisgICAgICAieC4ueHguLngiCisgICAgICAieHh4eHh4eHgiCisgICAg ICAieHguLi4ueHgiCisgICAgICAieHh4Li54eHgiCisgICAgICAiLnh4eHh4eC4iCisgICAgICAi Li54eHh4Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zbWlsZXlfZmFjZV9iaXRz W10gPXsKKyAgMHgzYywgMHg3ZSwgMHg5OSwgMHg5OSwgMHhmZiwgMHhjMywgMHhlNywgMHg3ZSwg MHgzY307CisKKy8qIDMyCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAg Ii4ueC4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4u Li4ueC4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC4u Li4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX3JpZ2h0X2Jp dHNbXSA9eworICAweDIwLCAweDEwLCAweDgsIDB4NCwgMHg4LCAweDEwLCAweDIwfTsKKworLyog MzMKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi54Li4iCisg ICAgICAiLi4uLnguLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54Li4uLi4iCisgICAg ICAiLi4ueC4uLi4iCisgICAgICAiLi4uLnguLi4iCisgICAgICAiLi4uLi54Li4iKQorKi8KK3N0 YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zaW5nbGVfYW5nbGVfbGVmdF9iaXRzW10gPXsKKyAgMHg0 LCAweDgsIDB4MTAsIDB4MjAsIDB4MTAsIDB4OCwgMHg0fTsKKworLyogMzQKKyAgICAoKy1mcmlu Z2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHgueHguLi4iCisgICAgICAiLnh4Lnh4Li4i CisgICAgICAiLi54eC54eC4iCisgICAgICAiLi4ueHgueHgiCisgICAgICAiLi54eC54eC4iCisg ICAgICAiLnh4Lnh4Li4iCisgICAgICAieHgueHguLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBz aG9ydCBtY19kb3VibGVfYW5nbGVfcmlnaHRfYml0c1tdID17CisgIDB4ZDgsIDB4NmMsIDB4MzYs IDB4MWIsIDB4MzYsIDB4NmMsIDB4ZDh9OworCisvKiAzNQorICAgICgrLWZyaW5nZS1oZWxwZXIt aGV4YWRlY2ltYWwKKyAgICAgICIuLi54eC54eCIKKyAgICAgICIuLnh4Lnh4LiIKKyAgICAgICIu eHgueHguLiIKKyAgICAgICJ4eC54eC4uLiIKKyAgICAgICIueHgueHguLiIKKyAgICAgICIuLnh4 Lnh4LiIKKyAgICAgICIuLi54eC54eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX2Rv dWJsZV9hbmdsZV9sZWZ0X2JpdHNbXSA9eworICAweDFiLCAweDM2LCAweDZjLCAweGQ4LCAweDZj LCAweDM2LCAweDFifTsKKworLyogMzYKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFs CisgICAgICAieC54LnguLi4iCisgICAgICAiLngueC54Li4iCisgICAgICAiLi54LngueC4iCisg ICAgICAiLi4ueC54LngiCisgICAgICAiLi54LngueC4iCisgICAgICAiLngueC54Li4iCisgICAg ICAieC54LnguLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190cmlwbGVfYW5nbGVf cmlnaHRfYml0c1tdID17CisgIDB4YTgsIDB4NTQsIDB4MmEsIDB4MTUsIDB4MmEsIDB4NTQsIDB4 YTh9OworCisvKiAzNworICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIu Li54LngueCIKKyAgICAgICIuLngueC54LiIKKyAgICAgICIueC54LnguLiIKKyAgICAgICJ4Lngu eC4uLiIKKyAgICAgICIueC54LnguLiIKKyAgICAgICIuLngueC54LiIKKyAgICAgICIuLi54Lngu eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3RyaXBsZV9hbmdsZV9sZWZ0X2JpdHNb XSA9eworICAweDE1LCAweDJhLCAweDU0LCAweGE4LCAweDU0LCAweDJhLCAweDE1fTsKKworLyog MzgKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisg ICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAg ICAiLi4ueC4uLi4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAi eC4uLi4ueC4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4u Li4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19z aW5nbGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MTAs IDB4MjgsIDB4NDQsIDB4ODIsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9OworCisvKiAzOQorICAg ICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIu Li4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICJ4Li4u Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIuLi54Li4u LiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIK KyAgICAgICIuLi4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3NpbmdsZV9h bmdsZV9kb3duX2JpdHNbXSA9eworICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDgyLCAweDQ0 LCAweDI4LCAweDEwLCAweDAwLCAweDAwLCAweDAwLCAweDAwfTsKKworLyogNDAKKyAgICAoKy1m cmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4u Li4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54LnguLi4i CisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisg ICAgICAiLnguLi54Li4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLi4uLi4uLi4iCisgICAg ICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9y dCBtY19kb3VibGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4MDAsIDB4MDAsIDB4MDAsIDB4MTAs IDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4ODIsIDB4MDAsIDB4MDAsIDB4MDB9Owor CisvKiA0MQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4u LiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICJ4Li4uLi54LiIK KyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAg ICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAg ICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIpCisqLworc3Rh dGljIHVuc2lnbmVkIHNob3J0IG1jX2RvdWJsZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAweDAw LCAweDAwLCAweDAwLCAweDgyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDEwLCAw eDAwLCAweDAwLCAweDAwfTsKKworLyogNDIKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNp bWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54LnguLi4i CisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisg ICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAg ICAiLnguLi54Li4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0 YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190cmlwbGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4MDAs IDB4MTAsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4 ODIsIDB4MDB9OworCisvKiA0MworICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAg ICAgICIuLi4uLi4uLiIKKyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAg ICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIu LngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngu eC4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLi4uLi4uLiIpCisqLworc3RhdGljIHVu c2lnbmVkIHNob3J0IG1jX3F1YWRydXBsZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAweDAwLCAw eDgyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDEw LCAweDAwfTsKKworLyogNDQKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAg ICAiLi4ueC4uLi4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAi eC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4u eC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4u eC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4uLi4ueC4i KQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19xdWFkcnVwbGVfYW5nbGVfdXBfYml0c1td ID17CisgIDB4MTAsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4 NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4ODJ9OworCisvKiA0NQorICAgICgrLWZyaW5nZS1oZWxw ZXItaGV4YWRlY2ltYWwKKyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAg ICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIu LngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngu eC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4u LiIKKyAgICAgICIuLi54Li4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3RyaXBs ZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAweDgyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAw eDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDEwfTsKKworLyogVE9E TzogIEFkZCB0aGUgZm9sbG93aW5nIGJpdG1hcHM6CisgIChkZWZpbmUtZnJpbmdlLWJpdG1hcCAn YnJlYWtwb2ludCAiXHgzY1x4N2VceGZmXHhmZlx4ZmZceGZmXHg3ZVx4M2MiKQorICAoZGVmaW5l LWZyaW5nZS1iaXRtYXAgJ2hvbGxvdy1yaWdodC10cmlhbmdsZSAiXHhlMFx4OTBceDg4XHg4NFx4 ODRceDg4XHg5MFx4ZTAiKSAqLworCisvKiBlbmQgTVVMVElQTEUgQ1VSU09SUyAqLworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogI2RlZmluZSBCWVRFU19QRVJfQklUTUFQX1JPVyAgKHNp emVvZiAodW5zaWduZWQgc2hvcnQpKQogI2RlZmluZSBTVEFOREFSRF9CSVRNQVBfSEVJR0hUKGJp dHMpIChzaXplb2YgKGJpdHMpL0JZVEVTX1BFUl9CSVRNQVBfUk9XKQogI2RlZmluZSBGUkJJVFMo Yml0cykgIGJpdHMsIFNUQU5EQVJEX0JJVE1BUF9IRUlHSFQgKGJpdHMpCkBAIC00NjYsNiArODYy LDU5IEBAIHN0YXRpYyBzdHJ1Y3QgZnJpbmdlX2JpdG1hcCBzdGFuZGFyZF9iaXRtYXBzW10gPQog ICB7IEZSQklUUyAodmVydGljYWxfYmFyX2JpdHMpLCAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBf Q0VOVEVSLCAwIH0sCiAgIHsgRlJCSVRTIChob3Jpem9udGFsX2Jhcl9iaXRzKSwgICAgIDgsIDAs IEFMSUdOX0JJVE1BUF9CT1RUT00sIDAgfSwKICAgeyBGUkJJVFMgKGVtcHR5X2xpbmVfYml0cyks ICAgICAgICAgOCwgMywgQUxJR05fQklUTUFQX1RPUCwgICAgMCB9LAorCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgIC8qIDI0ICovCisgIHsg RlJCSVRTIChtY192ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3dfYml0cyksICAgICA4LCAwLCBBTElH Tl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDI1ICovCisgIHsgRlJCSVRTIChtY19ob2xsb3df cmVjdGFuZ2xlX3JpZ2h0X2Fycm93X2JpdHMpLCA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAw IH0sCisgIC8qIDI2ICovCisgIHsgRlJCSVRTIChtY19ob2xsb3dfcmVjdGFuZ2xlX2JpdHMpLCAg ICAgICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDI3ICovCisg IHsgRlJCSVRTIChtY192ZXJ0aWNhbF9iYXJfYml0cyksICAgICAgICAgICAgICAgICA4LCAwLCBB TElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDI4ICovCisgIHsgRlJCSVRTIChtY19iYWNr c2xhc2hfYml0cyksICAgICAgICAgICAgICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVS LCAwIH0sCisgIC8qIDI5ICovCisgIHsgRlJCSVRTIChtY192ZXJ0aWNhbF9iYXJfYmFja3NsYXNo X2JpdHMpLCAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDMwICov CisgIHsgRlJCSVRTIChtY19waWxjcm93X2JpdHMpLCAgICAgICAgICAgICAgICAgICAgICA4LCAw LCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDMxICovCisgIHsgRlJCSVRTIChtY19z bWlsZXlfZmFjZV9iaXRzKSwgICAgICAgICAgICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VO VEVSLCAwIH0sCisgIC8qIDMyICovCisgIHsgRlJCSVRTIChtY19zaW5nbGVfYW5nbGVfcmlnaHRf Yml0cyksICAgICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDMz ICovCisgIHsgRlJCSVRTIChtY19zaW5nbGVfYW5nbGVfbGVmdF9iaXRzKSwgICAgICAgICAgICA4 LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDM0ICovCisgIHsgRlJCSVRTICht Y19kb3VibGVfYW5nbGVfcmlnaHRfYml0cyksICAgICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBf Q0VOVEVSLCAwIH0sCisgIC8qIDM1ICovCisgIHsgRlJCSVRTIChtY19kb3VibGVfYW5nbGVfbGVm dF9iaXRzKSwgICAgICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8q IDM2ICovCisgIHsgRlJCSVRTIChtY190cmlwbGVfYW5nbGVfcmlnaHRfYml0cyksICAgICAgICAg ICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDM3ICovCisgIHsgRlJCSVRT IChtY190cmlwbGVfYW5nbGVfbGVmdF9iaXRzKSwgICAgICAgICAgICA4LCAwLCBBTElHTl9CSVRN QVBfQ0VOVEVSLCAwIH0sCisgIC8qIDM4ICovCisgIHsgRlJCSVRTIChtY19zaW5nbGVfYW5nbGVf dXBfYml0cyksICAgICAgICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisg IC8qIDM5ICovCisgIHsgRlJCSVRTIChtY19zaW5nbGVfYW5nbGVfZG93bl9iaXRzKSwgICAgICAg ICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDQwICovCisgIHsgRlJC SVRTIChtY19kb3VibGVfYW5nbGVfdXBfYml0cyksICAgICAgICAgICAgICA4LCAwLCBBTElHTl9C SVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDQxICovCisgIHsgRlJCSVRTIChtY19kb3VibGVfYW5n bGVfZG93bl9iaXRzKSwgICAgICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0s CisgIC8qIDQyICovCisgIHsgRlJCSVRTIChtY190cmlwbGVfYW5nbGVfdXBfYml0cyksICAgICAg ICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDQzICovCisgIHsg RlJCSVRTIChtY190cmlwbGVfYW5nbGVfZG93bl9iaXRzKSwgICAgICAgICAgICA4LCAwLCBBTElH Tl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDQ0ICovCisgIHsgRlJCSVRTIChtY19xdWFkcnVw bGVfYW5nbGVfdXBfYml0cyksICAgICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAw IH0sCisgIC8qIDQ1ICovCisgIHsgRlJCSVRTIChtY19xdWFkcnVwbGVfYW5nbGVfZG93bl9iaXRz KSwgICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKIH07CiAKICNkZWZpbmUgTk9fRlJJTkdFX0JJVE1BUCAwCkBAIC0x NzE1LDYgKzIxNjQsMTUwIEBAIElmIG5pbCwgYWxzbyBjb250aW51ZSBsaW5lcyB3aGljaCBhcmUg ZXhhY3RseSBhcyB3aWRlIGFzIHRoZSB3aW5kb3cuICAqLyk7CiAgIERFRlZBUl9MSVNQICgiZnJp bmdlLWJpdG1hcHMiLCBWZnJpbmdlX2JpdG1hcHMsCiAgICAgZG9jOiAvKiBMaXN0IG9mIGZyaW5n ZSBiaXRtYXAgc3ltYm9scy4gICovKTsKICAgVmZyaW5nZV9iaXRtYXBzID0gUW5pbDsKKworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExFIENVUlNPUlMgKi8KKwor ICAvKiAoZ2V0ICdlbXB0eS1saW5lICdmcmluZ2UpID0+IDIzID0+IHRoZSBsYXN0IHN0YW5kYXJk LWJpdG1hcCBiZWZvcmUgdGhpcyBvbmUuCisgIFNlZSBgZnJpbmdlLmVsYC4gKi8KKworICAvKiAy NCAqLworICBERUZTWU0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cmMva2V5Ym9hcmQuYworKysgYi9zcmMva2V5Ym9hcmQuYwpAQCAt MTIyNCw2ICsxMjI0LDI5IEBAIHN0YXRpYyBpbnQgcmVhZF9rZXlfc2VxdWVuY2UgKExpc3BfT2Jq ZWN0ICosIExpc3BfT2JqZWN0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCwg Ym9vbCwgYm9vbCwgYm9vbCk7CiBzdGF0aWMgdm9pZCBhZGp1c3RfcG9pbnRfZm9yX3Byb3BlcnR5 IChwdHJkaWZmX3QsIGJvb2wpOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUgQ1VSU09SUyAqLworCitzdGF0aWMgdm9pZAora2JkX21jX2FjdGl2YXRlX211bHRpcGxl X2N1cnNvcnMgKHZvaWQpCit7CisgIHN0cnVjdCB3aW5kb3cgKncgPSBkZWNvZGVfbGl2ZV93aW5k b3cgKHNlbGVjdGVkX3dpbmRvdyk7CisgIHctPm1jLmRyYXdfbXVsdGlwbGVfY3Vyc29ycyA9IHRy dWU7CisgIHctPm1jLmVyYXNlX211bHRpcGxlX2N1cnNvcnMgPSB0cnVlOworfQorCitzdGF0aWMg dm9pZAora2JkX21jX2FjdGl2YXRlX2Nyb3NzaGFpcnMgKHZvaWQpCit7CisgIHN0cnVjdCB3aW5k b3cgKncgPSBkZWNvZGVfbGl2ZV93aW5kb3cgKHNlbGVjdGVkX3dpbmRvdyk7CisgIHctPm1jLmRy YXdfY3Jvc3NoYWlycyA9IHRydWU7CisgIHctPm1jLmVyYXNlX2Nyb3NzaGFpcnMgPSB0cnVlOwor fQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiBMaXNwX09iamVjdAogY29tbWFuZF9s b29wXzEgKHZvaWQpCiB7CkBAIC0xNDE5LDYgKzE0NDIsMTUgQEAgY29tbWFuZF9sb29wXzEgKHZv aWQpCiAgICAgICBWcmVhbF90aGlzX2NvbW1hbmQgPSBjbWQ7CiAgICAgICBzYWZlX3J1bl9ob29r cyAoUXByZV9jb21tYW5kX2hvb2spOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyog TVVMVElQTEUgQ1VSU09SUyAqLworCisgICAgICBrYmRfbWNfYWN0aXZhdGVfbXVsdGlwbGVfY3Vy c29ycyAoKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgYWxyZWFkeV9h ZGp1c3RlZCA9IDA7CiAKICAgICAgIGlmIChOSUxQIChWdGhpc19jb21tYW5kKSkKQEAgLTI0NDgs NyArMjQ4MCw3IEBAIHJlYWRfY2hhciAoaW50IGNvbW1hbmRmbGFnLCBMaXNwX09iamVjdCBtYXAs CiAJICBpZiAoaGVscF9lY2hvX3Nob3dpbmdfcCAmJiAhRVEgKHNlbGVjdGVkX3dpbmRvdywgbWlu aWJ1Zl93aW5kb3cpKQogCSAgICByZWRpc3BsYXlfcHJlc2VydmVfZWNob19hcmVhICg1KTsKIAkg IGVsc2UKLQkgICAgcmVkaXNwbGF5ICgpOworCSAgICByZWRpc3BsYXkgKDEpOwogCiAJICBpZiAo IWlucHV0X3BlbmRpbmcpCiAJICAgIC8qIE5vcm1hbCBjYXNlOiBubyBpbnB1dCBhcnJpdmVkIGR1 cmluZyByZWRpc3BsYXkuICAqLwpAQCAtMjYyOCw3ICsyNjYwLDcgQEAgcmVhZF9jaGFyIChpbnQg Y29tbWFuZGZsYWcsIExpc3BfT2JqZWN0IG1hcCwKICAgICB7CiAgICAgICBGZG9fYXV0b19zYXZl IChRbmlsLCBRbmlsKTsK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PSBoOworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworICByLm9yaWdpbi54ID0g KHctPm1jLmZ4ID4gMCkKKyAgICAgICAgICAgICAgID8gdy0+bWMuZngKKyAgICAgICAgICAgICAg IDogZng7CisgIHIub3JpZ2luLnkgPSAody0+bWMuZnkgPiAwKQorICAgICAgICAgICAgICAgPyB3 LT5tYy5meQorICAgICAgICAgICAgICAgOiBmeTsKKyAgci5zaXplLmhlaWdodCA9ICh3LT5tYy5o ID4gMCkKKyAgICAgICAgICAgICAgICAgID8gdy0+bWMuaAorICAgICAgICAgICAgICAgICAgOiBo OwogICByLnNpemUud2lkdGggPSB3LT5waHlzX2N1cnNvcl93aWR0aDsKIAorLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisKKwogICAvKiBQcmV2ZW50IHRoZSBjdXJzb3IgZnJvbSBiZWluZyBkcmF3 biBvdXRzaWRlIHRoZSB0ZXh0IGFyZWEuICAqLwogICBuc19jbGlwX3RvX3JvdyAodywgZ2x5cGhf cm93LCBURVhUX0FSRUEsIE5PKTsgLyogZG8gbnNfZm9jdXMoZiwgJnIsIDEpOyBpZiByZW1vdmUg Ki8KIAogCiAgIGZhY2UgPSBGQUNFX0ZST01fSURfT1JfTlVMTCAoZiwgcGh5c19jdXJzb3JfZ2x5 cGgtPmZhY2VfaWQpOwotICBpZiAoZmFjZSAmJiBOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpCi0g ICAgICA9PSBuc19pbmRleF9jb2xvciAoRlJBTUVfQ1VSU09SX0NPTE9SIChmKSwgZikpCi0gICAg ewotICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQgKGZh Y2UpLCBmKSBzZXRdOwotICAgICAgaG9sbG93X2NvbG9yID0gRlJBTUVfQ1VSU09SX0NPTE9SIChm KTsKLSAgICB9Ci0gIGVsc2UKLSAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChmKSBzZXRdOworCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4gTVVMVElQTEUgQ1VSU09SUyAqLwor CisvKiBFWEFNUExFIE9GIEhPVyBUTyBMT09LLVVQIEEgQ09MT1I6CisgIGVudW0gZmFjZV9pZCBm YWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistdmVydGljYWwtYmFy LWZhY2UiKSwgdHJ1ZSk7CisgIHN0cnVjdCBmYWNlICpmYWNlID0gRkFDRV9GUk9NX0lEIChmLCBm YWNlX2lkKTsKKyAgTlNDb2xvciAqY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNf RkFDRV9GT1JFR1JPVU5EIChmYWNlKSwgZik7CisgIExpc3BfT2JqZWN0IGZvcmVncm91bmQgPSBm YWNlLT5sZmFjZVtMRkFDRV9GT1JFR1JPVU5EX0lOREVYXTsKKyAgTGlzcF9PYmplY3QgYmFja2dy b3VuZCA9IGZhY2UtPmxmYWNlW0xGQUNFX0JBQ0tHUk9VTkRfSU5ERVhdOworICBmcHJpbnRmIChz dGRlcnIsICJcbmZvcmVncm91bmQgKCVzKSB8IGJhY2tncm91bmQgKCVzKVxuIiwKKyAgICAgICAg ICAgICAgICAgICAoIU5JTFAgKGZvcmVncm91bmQpID8gU1NEQVRBIChmb3JlZ3JvdW5kKSA6ICJO SUxQIiksCisgICAgICAgICAgICAgICAgICAgKCFOSUxQIChiYWNrZ3JvdW5kKSA/IFNTREFUQSAo YmFja2dyb3VuZCkgOiAiTklMUCIpKTsgKi8KKworICBpZiAody0+bWMuZ2x5cGhfZmxhdm9yID09 IE1DX0dMWVBICisgICAgICB8fCB3LT5tYy5nbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEhMRVNTCisg ICAgICB8fCB3LT5tYy5nbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEhfVEFCKQorICAgIHsKKyAgICAg IFtbTlNDb2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiB3LT5tYy5yZWQgZ3JlZW46IHctPm1j LmdyZWVuIGJsdWU6IHctPm1jLmJsdWUgYWxwaGE6IDEuMF0gc2V0XTsKKyAgICAgIExpc3BfT2Jq ZWN0IGJ1ZiA9IHctPmNvbnRlbnRzOworICAgICAgQ0hFQ0tfQlVGRkVSIChidWYpOworICAgICAg c3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKGJ1Zik7CisgICAgICBib29sIHJlZ2lvbl9hY3Rp dmVfcCA9ICghTklMUCAoVnRyYW5zaWVudF9tYXJrX21vZGUpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgbWFya19hY3RpdmUpKSk7CisgICAgICBwdHJk aWZmX3QgcmVnaW9uX2JlZ2lubmluZyA9IChyZWdpb25fYWN0aXZlX3ApID8gWElOVCAoRnJlZ2lv bl9iZWdpbm5pbmcgKCkpIDogLTE7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2VuZCA9IChyZWdp b25fYWN0aXZlX3ApID8gWElOVCAoRnJlZ2lvbl9lbmQgKCkpIDogLTE7CisgICAgICBib29sIHJl Z2lvbl9pbl9ib3VuZHNfcCA9IChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPm1jLnBvc2ludCA+PSByZWdpb25fYmVnaW5uaW5nCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5tYy5wb3NpbnQgPCByZWdpb25fZW5kKTsK KyAgICAgIGlmIChyZWdpb25fYWN0aXZlX3AKKyA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2UgaWYgKCFhY3RpdmVfcCkKKyAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCA9 IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItaW5h Y3RpdmUtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93 X2luYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lk KTsKKyAgICAgICAgICAgICAgICBOU0NvbG9yICpob2xsb3dfaW5hY3RpdmVfY29sb3IgPSBuc19s b29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5EIChob2xsb3dfaW5hY3RpdmVf ZmFjZSksIGYpOworICAgICAgICAgICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19pbmFjdGl2 ZV9jb2xvcjsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlIGlmIChmYWNlICYm IE5TX0ZBQ0VfQkFDS0dST1VORCAoZmFjZSkgPT0gbnNfaW5kZXhfY29sb3IgKEZSQU1FX0NVUlNP Ul9DT0xPUiAoZiksIGYpKQorICAgICAgICAgICAgICAgIGhvbGxvd19jb2xvciA9IEZSQU1FX0NV UlNPUl9DT0xPUiAoZik7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqZGVmYXVsdF9iZ19mYWNlID0gRkFD RV9GUk9NX0lEIChmLCBERUZBVUxUX0ZBQ0VfSUQpOworICAgICAgICAgICAgICAgICAgICBbbnNf bG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoZGVmYXVsdF9iZ19mYWNl KSwgZikgc2V0XTsKKyAgICAgICAgICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gRlJBTUVfQ1VS U09SX0NPTE9SIChmKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZiAo ZmFjZSAmJiBOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpID09IG5zX2luZGV4X2NvbG9yIChGUkFN RV9DVVJTT1JfQ09MT1IgKGYpLCBmKSkKKyAgICAgIHsKKyAgICAgICAgW25zX2xvb2t1cF9pbmRl eGVkX2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQgKGZhY2UpLCBmKSBzZXRdOworICAgICAgICBo b2xsb3dfY29sb3IgPSBGUkFNRV9DVVJTT1JfQ09MT1IgKGYpOworICAgICAgfQorICAgICAgZWxz ZQorICAgICAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChmKSBzZXRdOworCisvKiBlbmQgTVVMVElQ TEUgQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKIAogI2lmZGVmIE5TX0lN UExfQ09DT0EKICAgLyogVE9ETzogVGhpcyBtYWtlcyBkcmF3aW5nIG9mIGN1cnNvciBwbHVzIHRo YXQgb2YgcGh5c19jdXJzb3JfZ2x5cGgKQEAgLTMyODksMjEgKzMzNzgsNDUgQEAgTm90ZSB0aGF0 IENVUlNPUl9XSURUSCBpcyBtZWFuaW5nZnVsIG9ubHkgZm9yIChoKWJhciBjdXJzb3JzLgogICAg ICAgYnJlYWs7CiAgICAgY2FzZSBCQVJfQ1VSU09SOgogICAgICAgcyA9IHI7CisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgICAvKiBAbGF3 bGlzdCBpcyBmb2N1c2luZyB0aGUgaW5pdGlhbCBkZXZlbG9wbWVudCBvZiBmZWF0dXJlIHJlcXVl c3RzICMxNzY4NAorICAgIGFuZCAjMjI4NzMgb24gTDJSIGxhbmd1YWdlcy4gKi8KKyAgICBpZiAo dy0+bWMuZ2x5cGhfZmxhdm9yICE9IE1DX0dMWVBICisgICAgICAgICYmIHctPm1jLmdseXBoX2Zs YXZvciAhPSBNQ19HTFlQSExFU1MKKyAgICAgICAgJiYgdy0+bWMuZ2x5cGhfZmxhdm9yICE9IE1D X0dMWVBIX1RBQikKKyAgICAgIHsKICAgICAgIC8qIElmIHRoZSBjaGFyYWN0ZXIgdW5kZXIgY3Vy c29yIGlzIFIyTCwgZHJhdyB0aGUgYmFyIGN1cnNvcgogICAgICAgICAgb24gdGhlIHJpZ2h0IG9m IGl0cyBnbHlwaCwgcmF0aGVyIHRoYW4gb24gdGhlIGxlZnQuICAqLwogICAgICAgY3Vyc29yX2ds eXBoID0gZ2V0X3BoeXNfY3Vyc29yX2dseXBoICh3KTsKICAgICAgIGlmICgoY3Vyc29yX2dseXBo LT5yZXNvbHZlZF9sZXZlbCAmIDEpICE9IDApCiAgICAgICAgIHMub3JpZ2luLnggKz0gY3Vyc29y X2dseXBoLT5waXhlbF93aWR0aCAtIHMuc2l6ZS53aWR0aDsKKyAgICAgIH0KKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKIAogICAgICAgTlNSZWN0RmlsbCAocyk7CiAgICAgICBicmVhazsK ICAgICB9CiAgIG5zX3VuZm9jdXMgKGYpOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUgQ1VSU09SUyAqLworCiAgIC8qIGRyYXcgdGhlIGNoYXJhY3RlciB1bmRlciB0 aGUgY3Vyc29yICovCi0gIGlmIChjdXJzb3JfdHlwZSAhPSBOT19DVVJTT1IpCisgIGlmIChjdXJz b3JfdHlwZSAhPSBOT19DVVJTT1IKKyAgICAgICYmIHctPm1jLmdseXBoX2ZsYXZvciAhPSBNQ19H TFlQSExFU1MKKyAgICAgICYmIHctPm1jLmdseXBoX2ZsYXZvciAhPSBNQ19HTFlQSF9UQUIpCiAg ICAgZHJhd19waHlzX2N1cnNvcl9nbHlwaCAodywgZ2x5cGhfcm93LCBEUkFXX0NVUlNPUik7CiAK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICNpZmRlZiBOU19JTVBMX0NPQ09BCiAgIE5T RW5hYmxlU2NyZWVuVXBkYXRlcyAoKTsKICNlbmRpZgpkaWZmIC0tZ2l0IGEvc3JjL3czMnRlcm0u YyBiL3NyYy93MzJ0ZXJtLmMKaW5kZXggZmYwZDJiZi4uMDJmODcyOSAxMDA2NDQKLS0tIGEvc3Jj L3czMnRlcm0uYworKysgYi9zcmMvdzMydGVybS5jCkBAIC05NzMsNiArOTczLDIwIEBAIHN0YXRp YyB2b2lkIHczMl9kcmF3X2JveF9yZWN0IChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICosIGludCwgaW50 LCBpbnQsIGludCwKIHN0YXRpYyB2b2lkCiB4X3NldF9jdXJzb3JfZ2MgKHN0cnVjdCBnbHlwaF9z dHJpbmcgKnMpCiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBD VVJTT1JTICovCisKKyAgaWYgKHMtPnctPm1jLmN1cnNvcl9nY19kZWZhdWx0KQorICAgIHsKKyAg ICAgIHMtPmdjID0gcy0+Zi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2M7CisgICAgICByZXR1 cm47CisgICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIGlmIChzLT5mb250 ID09IEZSQU1FX0ZPTlQgKHMtPmYpCiAgICAgICAmJiBzLT5mYWNlLT5iYWNrZ3JvdW5kID09IEZS QU1FX0JBQ0tHUk9VTkRfUElYRUwgKHMtPmYpCiAgICAgICAmJiBzLT5mYWNlLT5mb3JlZ3JvdW5k ID09IEZSQU1FX0ZPUkVHUk9VTkRfUElYRUwgKHMtPmYpCkBAIC01NjkwLDYgKzU3MDQsMjYgQEAg eF9kcmF3X2hvbGxvd19jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cg KnJvdykKIAogICAvKiBDb21wdXRlIGZyYW1lLXJlbGF0aXZlIGNvb3JkaW5hdGVzIGZvciBwaHlz IGN1cnNvci4gICovCiAgIGdldF9waHlzX2N1cnNvcl9nZW9tZXRyeSAodywgcm93LCBjdXJzb3Jf Z2x5cGgsICZsZWZ0LCAmdG9wLCAmaCk7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisv KiBNVUxUSVBMRSBDVVJTT1JTICovCisKKy8qIExFR0VORDoKKworLSAgdG9wIHkgPT0gV0lORE9X X1RPX0ZSQU1FX1BJWEVMX1kgKHcsIHJvdy0+eSkKKworLSAgYm90dG9tIHkgPT0gV0lORE9XX1RP X0ZSQU1FX1BJWEVMX1kgKHcsIHJvdy0+eSkgLSByb3ctPmhlaWdodAorCistICBoIG9mIEhPTExP V19CT1hfQ1VSU09SID09IHJvdy0+aGVpZ2h0CisgICBbVGhpcyBhdm9pZHMgYSB2aXNpYmxlIGdh cCBhYm92ZS9iZWxvdy5dICovCisKKyAgaWYgKHctPm1jLmggPiAwKQorICAgIGggPSByb3ctPmhl aWdodDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICByZWN0LmxlZnQgPSBsZWZ0 OwogICAvKiBXaGVuIG9uIFIyTCBjaGFyYWN0ZXIsIHNob3cgY3Vyc29yIGF0IHRoZSByaWdodCBl ZGdlIG9mIHRoZQogICAgICBnbHlwaCwgdW5sZXNzIHRoZSBjdXJzb3IgYm94IGlzIGFzIHdpZGUg YXMgdGhlIGdseXBoIG9yIHdpZGVyCkBAIC01NzUzLDcgKzU3ODcsMTcgQEAgeF9kcmF3X2Jhcl9j dXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKIAkgaW52aXNp YmxlLiAgVXNlIHRoZSBnbHlwaCdzIGZvcmVncm91bmQgY29sb3IgaW5zdGVhZCBpbiB0aGlzCiAJ IGNhc2UsIG9uIHRoZSBhc3N1bXB0aW9uIHRoYXQgdGhlIGdseXBoJ3MgY29sb3JzIGFyZSBjaG9z ZW4gc28KIAkgdGhhdCB0aGUgZ2x5cGggaXMgbGVnaWJsZS4gICovCi0gICAgICBpZiAoZmFjZS0+ YmFja2dyb3VuZCA9PSBjdXJzb3JfY29sb3IpCisKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgICAgIGlmIChmYWNlLT5iYWNrZ3JvdW5kID09 IGN1cnNvcl9jb2xvcgorICAgICAgICAgICYmICF3LT5tYy5jdXJzb3JfZ2NfaW52aXNpYmxlX29r YXkpCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAljdXJzb3JfY29sb3IgPSBmYWNl LT5mb3JlZ3JvdW5kOwogCiAgICAgICB4ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAo dywgdy0+cGh5c19jdXJzb3IueCk7CkBAIC01Nzc0LDYgKzU4MTgsMTcgQEAgeF9kcmF3X2Jhcl9j dXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKIAkgIGlmICgo Y3Vyc29yX2dseXBoLT5yZXNvbHZlZF9sZXZlbCAmIDEpICE9IDApCiAJICAgIHggKz0gY3Vyc29y X2dseXBoLT5waXhlbF93aWR0aCAtIHdpZHRoOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgICAgLyogQWxpZ24gYWxsIGZha2UgQkFSX0NV UlNPUiBvZiB0aGUgVkVSVElDQUxfUlVMRVIgd2l0aCBgb3BvaW50X3gnLiAqLworICAgIGlmICh3 LT5tYy5meCA+IDApCisgICAgICB4ID0gdy0+bWMuZng7CisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKIAkgIHczMl9maWxsX2FyZWEgKGYsIGhkYywgY3Vyc29yX2NvbG9yLCB4LAogCQkJ IFdJTkRPV19UT19GUkFNRV9QSVhFTF9ZICh3LCB3LT5waHlzX2N1cnNvci55KSwKIAkJCSB3aWR0 aCwgcm93LT5oZWlnaHQpOwpAQCAtNTg5NSwzMSArNTk1MCwxNTkgQEAgdzMyX2RyYXdfd2luZG93 X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqZ2x5cGhfcm93LAog CSAgcmV0dXJuOwogCX0KIAotICAgICAgc3dpdGNoIChjdXJzb3JfdHlwZSkKLQl7Ci0JY2FzZSBI T0xMT1dfQk9YX0NVUlNPUjo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KSwgUW5pbCkpOworICBpbnQg aW50X2dyZWVuID0gWElOVCAoRnRydW5jYXRlIChtYWtlX2Zsb2F0ICh0ZXJtX2dyZWVuKSwgUW5p bCkpOzsKKyAgaW50IGludF9ibHVlID0gWElOVCAoRnRydW5jYXRlIChtYWtlX2Zsb2F0ICh0ZXJt X2JsdWUpLCBRbmlsKSk7OworICBDT0xPUlJFRiBjb2xvcl9waXhlbCA9IFBBTEVUVEVSR0IgKGlu dF9yZWQsIGludF9ncmVlbiwgaW50X2JsdWUpOworICBzd2l0Y2ggKGN1cnNvcl90eXBlKQorICB7 CisgICAgY2FzZSBIT0xMT1dfQk9YX0NVUlNPUjoKKyAgICB7CisgICAgICBpZiAody0+bWMucmVk ID49IDAgJiYgdy0+bWMuYmx1ZSA+PSAwICYmIHctPm1jLmdyZWVuID49IDApCisgICAgICAgIHsK KyAgICAgICAgICBYR0NWYWx1ZXMgZ2NfdmFsdWVzOworICAgICAgICAgIHVuc2lnbmVkIGxvbmcg bWFzayA9IEdDRm9udCB8IEdDRm9yZWdyb3VuZCB8IEdDQmFja2dyb3VuZDsKKyAgICAgICAgICBn Y192YWx1ZXMuZm9udCA9IEZSQU1FX0ZPTlQgKGYpOworICAgICAgICAgIHN0cnVjdCBmYWNlICpk ZWZhdWx0X2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIERFRkFVTFRfRkFDRV9JRCk7CisgICAgICAg ICAgTGlzcF9PYmplY3QgYnVmID0gdy0+Y29udGVudHM7CisgICAgICAgICAgQ0hFQ0tfQlVGRkVS IChidWYpOworICAgICAgICAgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSIChidWYpOworICAg ICAgICAgIGJvb2wgcmVnaW9uX2FjdGl2ZV9wID0gKCFOSUxQIChWdHJhbnNpZW50X21hcmtfbW9k ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwg bWFya19hY3RpdmUpKSk7CisgICAgICAgICAg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Gl2ZV9yZWdpb25fZmFjZV9pZCk7CisgICAgICAgICAgICAgIGdjX3ZhbHVlcy5mb3JlZ3JvdW5k ID0gZGVmYXVsdF9mYWNlLT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICBnY192YWx1ZXMuYmFj a2dyb3VuZCA9IGhvbGxvd19hY3RpdmVfcmVnaW9uX2ZhY2UtPmJhY2tncm91bmQ7CisgICAgICAg ICAgICB9CisgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAg ICAgICAgICAgICYmICFyZWdpb25faW5fYm91bmRzX3AKKyAgICAgICAgICAgICAgICAgICAgICYm IGFjdGl2ZV9wKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lk IGhvbGxvd19hY3RpdmVfcmVnaW9uX291dF9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcs IGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1yZWdpb24tZmFjZSIpLCB0cnVlKTsKKyAg ICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9yZWdpb25fb3V0X2ZhY2Ug PSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfcmVnaW9uX291dF9mYWNlX2lkKTsKKyAg ICAgICAgICAgICAgICBnY192YWx1ZXMuZm9yZWdyb3VuZCA9IGRlZmF1bHRfZmFjZS0+Zm9yZWdy b3VuZDsKKyAgICAgICAgICAgICAgICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IGhvbGxvd19hY3Rp dmVfcmVnaW9uX291dF9mYWNlLT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgIGVsc2UgaWYgKCFyZWdpb25fYWN0aXZlX3AgJiYgYWN0aXZlX3ApCisgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3Rp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OworICAgICAgICAgIGRyYXdfcGh5c19jdXJzb3JfZ2x5cGgg KHcsIGdseXBoX3JvdywgRFJBV19DVVJTT1IpOworICAgICAgICAgIHctPm1jLmN1cnNvcl9nY19k ZWZhdWx0ID0gZmFsc2U7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2Mg PSBvcmlnaW5hbF9jdXJzb3JfZ2M7CisgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAg ICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgZHJhd19waHlzX2N1cnNvcl9nbHlwaCAodywg Z2x5cGhfcm93LCBEUkFXX0NVUlNPUik7CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBC QVJfQ1VSU09SOgorICAgIHsKKyAgICAgIGlmICh3LT5tYy5yZWQgPj0gMCAmJiB3LT5tYy5ibHVl ID49IDAgJiYgdy0+bWMuZ3JlZW4gPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBv cmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAg ICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOwor ICAgICAgICAgIHctPm1jLmN1cnNvcl9nY19pbnZpc2libGVfb2theSA9IHRydWU7CisgICAgICAg ICAgeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIGdseXBoX3JvdywgY3Vyc29yX3dpZHRoLCBCQVJfQ1VS U09SKTsKKyAgICAgICAgICB3LT5tYy5jdXJzb3JfZ2NfaW52aXNpYmxlX29rYXkgPSBmYWxzZTsK KyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1 cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeF9kcmF3X2Jh cl9jdX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vdywgY3Vyc29yX3dpZHRoLCBI QkFSX0NVUlNPUik7Ci0JICBicmVhazsKKy8qIGVuZCBNVUxUSVBMRSBDVVJTT1JTICovCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KIAotCWNhc2UgTk9fQ1VSU09SOgotCSAgdy0+cGh5c19jdXJz b3Jfd2lkdGggPSAwOwotCSAgYnJlYWs7CiAKLQlkZWZhdWx0OgotCSAgZW1hY3NfYWJvcnQgKCk7 Ci0JfQogICAgIH0KIH0KIApkaWZmIC0tZ2l0IGEvc3JjL3dpbmRvdy5oIGIvc3JjL3dpbmRvdy5o CmluZGV4IDAxMzA4M2UuLjU3M2UzNTkgMTAwNjQ0Ci0tLSBhL3NyYy93aW5kb3cuaAorKysgYi9z cmMvd2luZG93LmgKQEAgLTc2LDYgKzc2LDU2IEBAIG9uZSBhbmQgdGhlIHNhbWUsIHNvIGl0cyBw cmV2IGFuZCBuZXh0IG1lbWJlcnMgYXJlIG5pbC4KIAogQSBkZWFkIHdpbmRvdyBoYXMgaXRzIGNv bnRlbnRzIGZpZWxkIHNldCB0byBuaWwuICAqLwogCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogYmVnaW4gTVVMVElQTEUgQ1VSU09SUyAqLworCisvKiBTdWZmaXhlcyBmb3IgdGhlIGBt Y2Agd2luZG93IHBvaW50ZXIgcHJlZml4LiAqLworc3RydWN0IG11bHRpcGxlX2N1cnNvcnMKK3sK KyAgLyogVmFsdWVzIGZvciBwcmV2aW91cyBhbmQgY3VycmVudCBgd2luZG93LXN0YXJ0JyBhbmQg YHdpbmRvdy1lbmQnLiAqLworICBFTUFDU19JTlQgY3VycmVudF9zdGFydCwgY3VycmVudF9lbmQs IHByZXZpb3VzX3N0YXJ0LCBwcmV2aW91c19lb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geWV0IGJlZW4gZXJhc2VkLiAq LworICBib29sX2JmIGVyYXNlX2Nyb3NzaGFpcnMgOiAxOworCisgIC8qIFRoZSBmbGF2b3Igb2Yg dGhlIGdseXBoIHVzZWQgYnkgYGRyYXdfd2luZG93X2N1cnNvcicuICovCisgIGludCBnbHlwaF9m bGF2b3I7CisKKyAgLyogTC5TLkwuIGNvbG9ycy4gKi8KKyAgZG91YmxlIHJlZCwgZ3JlZW4sIGJs dWU7CisKKyAgLyogVGhlIGJ1ZmZlciBwb3NpdGlvbiBwb2ludCBvZiBhIGZha2UgY3Vyc29yLiAq LworICBpbnQgcG9zaW50OworCisgIC8qIFBpeGVsIHBvc2l0aW9uICh3aW5kb3cgcmVsYXRpdmUp IG9mIGhvcml6b250YWwvdmVydGljYWwgcnVsZXJzLiAqLworICBpbnQgZngsIGZ5LCBoOworCisg IC8qIFJlY29yZCBGUk9NX1dIRVJFIHdoZW4gYHJlZGlzcGxheV9wcmVzZXJ2ZV9lY2hvX2FyZWEn IGlzIGNhbGxlZC4gKi8KKyAgaW50IHJlZGlzcGxheV9wcmVzZXJ2ZV9lY2hvX2FyZWE7Cit9Owor CisvKiBlbmQgTVVMVElQTEUgQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisK Kwogc3RydWN0IGN1cnNvcl9wb3MKIHsKICAgLyogUGl4ZWwgcG9zaXRpb24uICBUaGVzZSBhcmUg YWx3YXlzIHdpbmRvdyByZWxhdGl2ZS4gICovCkBAIC0xODEsNiArMjMxLDIyIEBAIHN0cnVjdCB3 aW5kb3cKICAgICAvKiBUaGUgaGVscCBlY2hvIHRleHQgZm9yIHRoaXMgd2luZG93LiAgUW5pbCBp ZiB0aGVyZSdzIG5vbmUuICAqLwogICAgIExpc3BfT2JqZWN0IG1vZGVfbGluZV9oZWxwX2VjaG87 CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisK KyAgICAvKiBUaGUgY2FjaGUgZm9yIG11bHRpcGxlIGdseXBoIGN1cnNvcnMuICBGb3IgYW4gZXhh bXBsZSBvZiB0aGUgc3RydWN0dXJlIG9mCisgICAgdGhlIGxpc3QsIHNlZSB0aGUgY29tbWVudHMg YXQgdGhlIGJlZ2lubmluZyBvZiBgbWNfY2FsYycgaW4geGRpc3AuYy4gICovCisgICAgTGlzcF9P YmplY3QgbXVsdGlwbGVfY3Vyc29yc19jYWNoZTsKKworICAgIC8qIFRoZSBjYWNoZSBmb3IgbXVs dGlwbGUgZ2x5cGgvZ2x5cGhsZXNzIGN1cnNvcnMgdGhhdCBmb3JtIGNyb3NzaGFpcnMuICBGb3Ig YW4KKyAgICBleGFtcGxlIG9mIHRoZSBzdHJ1Y3R1cmUgb2YgdGhlIGxpc3QsIHNlZSB0aGUgY29t bWVudHMgYXQgdGhlIGJlZ2lubmluZyBvZgorICAgIGBtY19jcm9zc2hhaXJzJyBpbiB4ZGlzcC5j LiAgKi8KKyAgICBMaXNwX09iamVjdCBjcm9zc2hhaXJzX2NhY2hlOworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKworCiAgICAgLyogTm8gTGlzcCBkYXRhIG1heSBmb2xsb3cgYmVsb3cgdGhp cyBwb2ludCB3aXRob3V0IGNoYW5naW5nCiAgICAgICAgbWFya19vYmplY3QgaW4gYWxsb2MuYy4g IFRoZSBtZW1iZXIgY3VycmVudF9tYXRyaXggbXVzdCBiZSB0aGUKICAgICAgICBmaXJzdCBub24t TGlzcCBtZW1iZXIuICAqLwpAQCAtMjgzLDYgKzM0OSwxNiBAQCBzdHJ1Y3Qgd2luZG93CiAKICNp ZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFIENVUlNPUlMgKi8KKworICAgIC8qIFRoZSBwcmVmaXggZm9yIHdpbmRvdyBwb2lu dGVycyByZWxhdGluZyB0byBtdWx0aXBsZSBjdXJzb3JzLiAgKi8KKyAgICBzdHJ1Y3QgbXVsdGlw bGVfY3Vyc29ycyBtYzsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgIC8qIEN1 cnNvciB0eXBlIG9mIGxhc3QgY3Vyc29yIGRyYXduIG9uIHRoZSB3aW5kb3cuICAqLwogICAgIGVu dW0gdGV4dF9jdXJzb3Jfa2luZHMgcGh5c19jdXJzb3JfdHlwZTsKIApAQCAtNDIxLDYgKzQ5Nywy NSBAQCBYV0lORE9XIChMaXNwX09iamVjdCBhKQogICByZXR1cm4gWFVOVEFHIChhLCBMaXNwX1Zl Y3Rvcmxpa2UsIHN0cnVjdCB3aW5kb3cpOwogfQogCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCitJTkxJTkUgdm9pZAord3NldF9tdWx0aXBsZV9j dXJzb3JzX2NhY2hlIChzdHJ1Y3Qgd2luZG93ICp3LCBMaXNwX09iamVjdCB2YWwpCit7CisgIHct Pm11bHRpcGxlX2N1cnNvcnNfY2FjaGUgPSB2YWw7Cit9CisKK0lOTElORSB2b2lkCit3c2V0X2Ny b3NzaGFpcnNfY2FjaGUgKHN0cnVjdCB3aW5kb3cgKncsIExpc3BfT2JqZWN0IHZhbCkKK3sKKyAg dy0+Y3Jvc3NoYWlyc19jYWNoZSA9IHZ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bHlwaHNfZmFjZSk7CiBz dGF0aWMgYm9vbCBjb29yZHNfaW5fbW91c2VfZmFjZV9wIChzdHJ1Y3Qgd2luZG93ICosIGludCwg aW50KTsKIAogCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExFIENV UlNPUlMgKi8KKworLyogTVVMVElQTEUgQ1VSU09SUzogIEVtYWNzIEJ1ZyAjMjI4NzMgKGZlYXR1 cmUgcmVxdWVzdCkKKworICAgQ1JPU1NIQUlSUzogIEVtYWNzIEJ1ZyAjMTc2ODQgKGZlYXR1cmUg cmVxdWVzdCkKKworCitQQVRDSCBWRVJTSU9OOiAgMDE0LjAwMCBbMDgvMjgvMjAxOF0KKyAgICAg ICAgICAgICAgICAwMTQuMDAxIFswOS8wMS8yMDE4XQorICAgICAgICAgICAgICAgIDAxNC4wMDIg WzA5LzAyLzIwMThdCisgICAgICAgICAgICAgICAgMDE0LjAwMyBbMDkvMDUvMjAxOF0KKyAgICAg ICAgICAgICAgICAwMTQuMDA0IFswOS8wOC8yMDE4XQorICAgICAgICAgICAgICAgIDAxNC4wMDUg WzA5LzA5LzIwMThdCisgICAgICAgICAgICAgICAgMDE0LjAwNiBbMDkvMDkvMjAxOF0KKyAgICAg ICAgICAgICAgICAwMTQuMDA3IFswOS8xMC8yMDE4XQorICAgICAgICAgICAgICAgIDAxNC4wMDgg WzA5LzEwLzIwMThdCisgICAgICAgICAgICAgICAgMDE0LjAwOSBbMDkvMTEvMjAxOF0KKyAgICAg ICAgICAgICAgICAwMTQuMDEwIFswOS8xMy8yMDE4XQorICAgICAgICAgICAgICAgIDAxNC4wMTEg WzA5LzE0LzIwMThdCisgICAgICAgICAgICAgICAgMDE0LjAxMiBbMDkvMTcvMjAxOF0KKyAgICAg ICAgICAgICAgICAwMTQuMDEzIFswOS8xOC8yMDE4XQorICAgICAgICAgICAgICAgIDAxNC4wMTQg WzA5LzE5LzIwMThdCisgICAgICAgICAgICAgICAgMDE0LjAxNSBbMDkvMjMvMjAxOF0KKyAgICAg ICAgICAgICAgICAwMTQuMDE2IFswOS8yNC8yMDE4XQorICAgICAgICAgICAgICAgIDAxNC4wMTcg WzA5LzI1LzIwMThdCisgICAgICAgICAgICAgICAgMDE0LjAxOCBbMDkvMjYvMjAxOF0KKyAgICAg ICAgICAgICAgICAwMTQuMDE5IFsxMC8wMS8yMDE4XQorICAgICAgICAgICAgICAgIDAxNC4wMjAg WzEwLzAyLzIwMThdCisgICAgICAgICAgICAgICAgMDE0LjAyMSBbMTAvMDkvMjAxOF0KKyAgICAg ICAgICAgICAgICAwMTQuMDIyIFsxMC8xMC8yMDE4XQorICAgICAgICAgICAgICAgIDAxNC4wMjMg WzEwLzEwLzIwMThdCisgICAgICAgICAgICAgICAgMDE0LjAyNCBbMTAvMTMvMjAxOF0KKyAgICAg ICAgICAgICAgICAwMTQuMDI1IFsxMS8xMC8yMDE4XQorICAgICAgICAgICAgICAgIDAxNS4wMDAg WzExLzEwLzIwMThdCisgICAgICAgICAgICAgICAgMDE1LjAwMSBbMTEvMTEvMjAxOF0KKworQXBw bHkgcGF0Y2ggdG8gbWFzdGVyIGJyYW5jaDogIFNhdCBKdWwgNyAwOTo1OTo1MyAyMDE4IC0wNzAw CitnaXQgcmVzZXQgLS1oYXJkIDk4NDYzYmVkMDdlY2M5MDU3MDk0OTI4ZmZkYzIzMjFlYWFmM2Fi NTIKKworTGFzdCBDb21taXQgOiBTYXQgSnVsIDcgMDk6NTk6NTMgMjAxOCAtMDcwMAorICAgICAg ICAgICAgOiBHbGVubiBNb3JyaXMgPHJnbUBnbnUub3JnPgorICAgICAgICAgICAgOiA5ODQ2M2Jl ZDA3ZWNjOTA1NzA5NDkyOGZmZGMyMzIxZWFhZjNhYjUyCisgICAgICAgICAgICA6ICogbGlzcC9p bWVudS5lbDogUmVxdWlyZSBjbC1saWIsIG5vdCBpbnRlcm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TT1ItQ09MT1IpCisgIChzZXRx IG11bHRpcGxlLWN1cnNvcnMtY29uZiAnKCgxICJoYmFyIiAibWFnZW50YSIpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICgyICJiYXIiICJwdXJwbGUiKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAoMyAiYm94IiAiIzAwRkYwMCIpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICg0ICJob2xsb3ciICIjMDAwMEZGIikKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgKDUgKCJoYmFyIiAzKSBbMS4wIDAuMCAxLjBdKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAoNiAoImJhciIgMykgWzAuMCAxLjAgMS4wXSkpKQorCisgIDs7OyBU VVJOIE9GRi4KKyAgKHNldHEgbXVsdGlwbGUtY3Vyc29ycy1jb25mIG5pbCkKKworCitUT0RPOgor CistICBNdWx0aXBsZSBDdXJzb3JzOiAgSWYgcG9pbnQgaXMgaW4gdGhlIG1pZGRsZSBvZiBhIGNv bXBvc2l0ZSBjaGFyYWN0ZXIsIHRoZW4KKyAgIGtlZXAgZ29pbmcgdW50aWwgdGhlIG5leHQgZnVs bCBjaGFyYWN0ZXIuCisKKy0gIFdvcmsgb24gY29tcGF0YWJpbGl0eSB3aXRoIE1hY09TIE1vamF2 ZS4gIFtJc3N1ZSAjIDQwLl0KKworLSAgSG9yaXpvbnRhbCBSdWxlcjogIERlcGVuZGluZyB1cG9u IHRoZSBmb250LCBjZXJ0YWluIGxldHRlcnMgdGhhdCBmb2xsb3cgYSB0YWIKKyAgIFNUUkVUQ0gg Y2F1c2UgdGhlIHByZWNlZGluZyBob3Jpem9udGFsIGhiYXIgdG8gYmUgZXJhc2VkOyBlLmcuLCAi QSIuCisgICBbSXNzdWUgIyAzMC5dCisKKy0gIEZha2UgY3Vyc29ycyBhcmUgYmVpbmcgcmVkcmF3 biB0b28gb2Z0ZW4gd2hlbiBub24tc2V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iYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIG11bHRpcGxlX2N1cnNvcnNfY29uZikpCisgICAgICAgICAgfHwgIU5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKSkKKyAgICB7CisgICAgICBMaXNw X09iamVjdCB3aW5kb3c7CisgICAgICBYU0VUV0lORE9XICh3aW5kb3csIHcpOworICAgICAgTGlz cF9PYmplY3Qgd2luZG93X3N0cmluZyA9IEZwcmluMV90b19zdHJpbmcgKHdpbmRvdywgUW5pbCk7 CisgICAgICBjaGFyICp3aW5kb3dfY2hhciA9IFNTREFUQSAod2luZG93X3N0cmluZyk7CisgICAg ICBmcHJpbnRmIChzdGRlcnIsICJcbndpbmRvdyAoJXMpXG4iLCB3aW5kb3dfY2hhcik7CisgICAg fQorI2VuZGlmCisKKyNpZmRlZiBHTFlQSF9ERUJVRworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJB TUUgKHctPmZyYW1lKTsKKyAgaW50IHRlbXBfZnggPSBXSU5ET1dfVEVYVF9UT19GUkFNRV9QSVhF TF9YICh3LCB3LT5waHlzX2N1cnNvci54KTsKKyAgaW50IHRlbXBfZnkgPSBXSU5ET1dfVE9fRlJB TUVfUElYRUxfWSAodywgdy0+cGh5c19jdXJzb3IueSk7CisgIGVudW0gd2luZG93X3BhcnQgcGFy dCA9IE9OX05PVEhJTkc7CisgIExpc3BfT2JqZWN0IHdpbmRvdyA9IHdpbmRvd19mcm9tX2Nvb3Jk aW5hdGVzIChmLCB0ZW1wX2Z4LCB0ZW1wX2Z5LCAmcGFydCwgZmFsc2UpOworICBMaXNwX09iamVj dCB3aW5kb3dfc3RyaW5nID0gRnByaW4xX3RvX3N0cmluZyAod2luZG93LCBRbmlsKTsKKyAgZGVi dWdfbWV0aG9kX2FkZCAodywgIndpbmRvdyAoJXMpIiwgU1NEQVRBICh3aW5kb3dfc3RyaW5nKSk7 CisjZW5kaWYKKworY2hhciAqd19jb250ZW50cyA9IChCVUZGRVJQICh3LT5jb250ZW50cykgJiYg U1RSSU5HUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBuYW1lKSkpCisgICAgICAgICAg ICAgICAgICAgPyBTU0RBVEEgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbmFtZSkpCisg ICAgICAgICAgICAgICAgICAgOiAibmlsIjsKK2ZwcmludGYgKHN0ZGVyciwgIlxuQnVmZmVyICgl cylcbiIsIHdfY29udGVudHMpOworCitzdHJ1Y3QgZmFjZSAqZmFjZSA9IG1jX2xvb2t1cF9mYWNl IChpdCk7CitMaXNwX09iamVjdCBmb3JlZ3JvdW5kID0gZmFjZS0+bGZhY2VbTEZBQ0VfRk9SRUdS T1VORF9JTkRFWF07CitMaXNwX09iamVjdCBiYWNrZ3JvdW5kID0gZmFjZS0+bGZhY2VbTEZBQ0Vf QkFDS0dST1VORF9JTkRFWF07CitmcHJpbnRmIChzdGRlcnIsICJcbmZvcmVncm91bmQgKCVzKSB8 IGJhY2tncm91bmQgKCVzKVxuIiwKKyAgICAgICAgICAgICAgICAgKCFOSUxQIChmb3JlZ3JvdW5k KSA/IFNTREFUQSAoZm9yZWdyb3VuZCkgOiAiTklMUCIpLAorICAgICAgICAgICAgICAgICAoIU5J TFAgKGJhY2tncm91bmQpID8gU1NEQVRBIChiYWNrZ3JvdW5kKSA6ICJOSUxQIikpOworCitmcHJp bnRmIChzdGRlcnIsICJNeSBsaXNwIG9iamVjdDogICVzXG4iLCBTU0RBVEEgKEZjaGFyX3RvX3N0 cmluZyAobWFrZV9udW1iZXIgKDEwMSkpKSk7CisKK2ZwcmludGYgKHN0ZGVyciwgInN0cmluZzog JXMgfCBpbnQ6ICVkXG4iLCBTU0RBVEEgKGJ1aWxkX3N0cmluZyAoImZvbyIpKSwgNjkpOworCitp ZiAoQlVGRkVSUCAody0+Y29udGVudHMpICYmIFNUUklOR1AgKEJWQVIgKFh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Rpb24uICAqLworICB3aGlsZSAoc2Nh biA8IGVuZCkKKyAgICB7CisgICAgICBpbnQgYzsKKyAgICAgIC8qIE9jY2FzaW9uYWxseSB3ZSBt YXkgbmVlZCB0byBza2lwIGludmlzaWJsZSB0ZXh0LiAgKi8KKyAgICAgIHdoaWxlIChzY2FuID09 IG5leHRfYm91bmRhcnkpCisgIHsKKyAgICBwdHJkaWZmX3Qgb2xkX3NjYW4gPSBzY2FuOworICAg IC8qIFRoaXMgdXBkYXRlcyBORVhUX0JPVU5EQVJZIHRvIHRoZSBuZXh0IHBsYWNlCisgICAgICAg d2hlcmUgd2UgbWlnaHQgbmVlZCB0byBza2lwIG1vcmUgaW52aXNpYmxlIHRleHQuICAqLworICAg IHNjYW4gPSBza2lwX2ludmlzaWJsZSAoc2NhbiwgJm5leHRfYm91bmRhcnksIGVuZCwgUW5pbCk7 CisgICAgaWYgKHNjYW4gIT0gb2xkX3NjYW4pCisgICAgICBzY2FuX2J5dGUgPSBDSEFSX1RPX0JZ VEUgKHNjYW4pOworICAgIGlmIChzY2FuID49IGVuZCkKKyAgICAgIGdvdG8gZW5kbG9vcDsKKyAg fQorICAgICAgLyogVGVzdCByZWFjaGluZyB0aGUgZ29hbCBjb2x1bW4uICBXZSBkbyB0aGlzIGFm dGVyIHNraXBwaW5nCisgICBpbnZpc2libGUgY2hhcmFjdGVycywgc28gdGhhdCB3ZSBwdXQgcG9p bnQgYmVmb3JlIHRoZQorICAgY2hhcmFjdGVyIG9uIHdoaWNoIHRoZSBjdXJzb3Igd2lsbCBhcHBl YXIuICAqLworICAgICAgaWYgKGNvbCA+PSBnb2FsKQorICBicmVhazsKKyAgICAgIHByZXZfY29s ID0gY29sOworICAgICAgeyAvKiBDaGVjayBkaXNwbGF5IHByb3BlcnR5LiAgKi8KKyAgcHRyZGlm Zl90IGVuZHA7CisgIGludCB3aWR0aCA9IG1jX2NoZWNrX2Rpc3BsYXlfd2lkdGggKHNjYW4sIGNv bCwgJmVuZHApOworICBpZiAod2lkdGggPj0gMCkKKyAgICB7CisgICAgICBjb2wgKz0gd2lkdGg7 CisgICAgICBpZiAoZW5kcCA+IHNjYW4pIC8qIEF2b2lkIGluZmluaXRlIGxvb3BzIHdpdGggMC13 aWR0aCBvdmVybGF5cy4gICovCisgICAgICAgIHsKKyAgICBzY2FuID0gZW5kcDsKKyAgICBzY2Fu X2J5dGUgPSBDSEFSX1RPX0JZVEUgKHNjYW4pOworICAgIGNvbnRpbnVlOworICAgICAgICB9Cisg ICAgfQorICAgICAgfQorICAgICAgLyogQ2hlY2sgY29tcG9zaXRpb24gc2VxdWVuY2UuICAqLwor ICAgICAgaWYgKGNtcF9pdC5pZCA+PSAwCisgICAgfHwgKHNjYW4gPT0gY21wX2l0LnN0b3BfcG9z CisgICAgICAgICYmIGNvbXBvc2l0aW9uX3Jlc2VhdF9pdCAoJmNtcF9pdCwgc2Nhbiwgc2Nhbl9i eXRlLCBlbmQsCisgICAgICAgICAgdywgTlVMTCwgUW5pbCkpKQorICBjb21wb3NpdGlvbl91cGRh dGVfaXQgKCZjbXBfaXQsIHNjYW4sIHNjYW5fYnl0ZSwgUW5pbCk7CisgICAgICBpZiAoY21wX2l0 LmlkID49IDApCisgIHsKKyAgICBzY2FuICs9IGNtcF9pdC5uY2hhcnM7CisgICAgc2Nhbl9ieXRl ICs9IGNtcF9pdC5uYnl0ZXM7CisgICAgaWYgKHNjYW4gPD0gZW5kKQorICAgICAgY29sICs9IGNt cF9pdC53aWR0aDsKKyAgICBpZiAoY21wX2l0LnRvID09IGNtcF9pdC5uZ2x5cGhzKQorICAgICAg eworICAgICAgICBjbXBfaXQuaWQgPSAtMTsKKyAgICAgICAgY29tcG9zaXRpb25fY29tcHV0ZV9z dG9wX3BvcyAoJmNtcF9pdCwgc2Nhbiwgc2Nhbl9ieXRlLCBlbmQsCisgICAgICAgICAgICAgIFFu aWwpOworICAgICAgfQorICAgIGVsc2UKKyAgICAgIGNtcF9pdC5mcm9tID0gY21wX2l0LnRvOwor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gKGMgPT0gJ1xyJyAmJiBFUSAoQlZBUiAoY3VycmVu dF9idWZmZXIsIHNlbGVjdGl2ZV9kaXNwbGF5KSwgUXQpKQorICAgIGdvdG8gZW5kbG9vcDsKKyAg ICAgICAgaWYgKGMgPT0gJ1x0JykKKyAgICB7CisgICAgICBjb2wgKz0gdGFiX3dpZHRoOworICAg ICAgY29sID0gY29sIC8gdGFiX3dpZHRoICogdGFiX3dpZHRoOworICAgIH0KKyAgICAgICAgZWxz ZQorICAgICsrY29sOworICAgICAgfQorICB9CisgICAgICBlbHNlCisgIHsKKyAgICAvKiBUaGUg ZGlzcGxheSB0YWJsZSBkb2Vzbid0IGFmZmVjdCB0aGlzIGNoYXJhY3RlcjsKKyAgICAgICBpdCBk aXNwbGF5cyBhcyBpdHNlbGYuICAqLworICAgIGlmIChjID09ICdcbicpCisgICAgICBnb3RvIGVu ZGxvb3A7CisgICAgaWYgKGMgPT0gJ1xyJyAmJiBFUSAoQlZBUiAoY3VycmVudF9idWZmZXIsIHNl bGVjdGl2ZV9kaXNwbGF5KSwgUXQpKQorICAgICAgZ290byBlbmRsb29wOworICAgIGlmIChjID09 ICdcdCcpCisgICAgICB7CisgICAgICAgIGNvbCArPSB0YWJfd2lkdGg7CisgICAgICAgIGNvbCA9 IGNvbCAvIHRhYl93aWR0aCAqIHRhYl93aWR0aDsKKyAgICAgIH0KKyAgICBlbHNlIGlmIChtdWx0 aWJ5dGUgJiYgTEVBRElOR19DT0RFX1AgKGMpKQorICAgICAgeworICAgICAgICAvKiBTdGFydCBv ZiBtdWx0aS1ieXRlIGZvcm0uICAqLworICAgICAgICB1bnNpZ25lZCBjaGFyICpwdHI7CisgICAg ICAgIGludCBieXRlcywgd2lkdGg7CisgICAgICAgIHB0ciA9IEJZVEVfUE9TX0FERFIgKHNjYW5f Ynl0ZSk7CisgICAgICAgIE1DX01VTFRJQllURV9CWVRFU19XSURUSCAocHRyLCBkcCwgYnl0ZXMs IHdpZHRoKTsKKyAgICAgICAgLy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RUdWX0FERFIpCisgICAg ICBicmVhazsKKyAgICAvKiBJdCB3YXMgdGhlIGdhcC4gIEp1bXAgYmFjayBvdmVyIGl0LiAgKi8K KyAgICBzdG9wID0gQkVHVl9BRERSOworICAgIHB0ciA9IEdQVF9BRERSOworICAgIC8qIENoZWNr IHdoZXRoZXIgdGhhdCBicmluZ3MgdXMgdG8gYmVnaW5uaW5nIG9mIGJ1ZmZlci4gICovCisgICAg aWYgKEJFR1YgPj0gR1BUKQorICAgICAgYnJlYWs7CisgIH0KKyAgICAgIGMgPSAqLS1wdHI7Cisg ICAgICBpZiAoZHAgJiYgVkVDVE9SUCAoRElTUF9DSEFSX1ZFQ1RPUiAoZHAsIGMpKSkKKyAgewor ICAgIGNoYXJ2ZWMgPSBESVNQX0NIQVJfVkVDVE9SIChkcCwgYyk7CisgICAgbiA9IEFTSVpFIChj aGFydmVjKTsKKyAgfQorICAgICAgZWxzZQorICB7CisgICAgY2hhcnZlYyA9IFFuaWw7CisgICAg biA9IDE7CisgIH0KKyAgICAgIGZvciAoaSA9IG4gLSAxOyBpID49IDA7IC0taSkKKyAgeworICAg IGlmIChWRUNUT1JQIChjaGFydmVjKSkKKyAgICAgIHsKKyAgICAgICAgLyogVGhpcyBzaG91bGQg YmUgaGFuZGxlZCB0aGUgc2FtZSBhcworICAgICBuZXh0X2VsZW1lbnRfZnJvbV9kaXNwbGF5X3Zl Y3RvciBkb2VzIGl0LiAgKi8KKyAgICAgICAgTGlzcF9PYmplY3QgZW50cnkgPSBBUkVGIChjaGFy dmVjLCBpKTsKKyAgICAgICAgaWYgKEdMWVBIX0NPREVfUCAoZW50cnkpKQorICAgIGMgPSBHTFlQ SF9DT0RFX0NIQVIgKGVudHJ5KTsKKyAgICAgICAgZWxzZQorICAgIGMgPSAnICc7CisgICAgICB9 CisgICAgaWYgKGMgPj0gMDQwICYmIGMgPCAwMTc3KQorICAgICAgY29sKys7CisgICAgZWxzZSBp ZiAoYyA9PSAnXG4nCisgICAgICAgfHwgKGMgPT0gJ1xyJworICAgICAgICAgICAmJiBFUSAoQlZB UiAoY3VycmVudF9idWZmZXIsIHNlbGVjdGl2ZV9kaXNwbGF5KSwgUXQpKSkKKyAgICAgIHsKKyAg ICAgICAgcHRyKys7CisgICAgICAgIGdvdG8gc3RhcnRfb2ZfbGluZV9mb3VuZDsKKyAgICAgIH0K KyAgICBlbHNlIGlmIChjID09ICdcdCcpCisgICAgICB7CisgICAgICAgIGlmICh0YWJfc2VlbikK KyAgICBjb2wgPSAoKGNvbCArIHRhYl93aWR0aCkgLyB0YWJfd2lkdGgpICogdGFiX3dpZHRoOwor ICAgICAgICBwb3N0X3RhYiArPSBjb2w7CisgICAgICAgIGNvbCA9IDA7CisgICAgICAgIHRhYl9z ZWVuID0gMTsKKyAgICAgIH0KKyAgICBlbHNlIGlmIChWRUNUT1JQIChjaGFydmVjKSkKKyAgICAg IC8qIFdpdGggYSBkaXNwbGF5IHRhYmxlIGVudHJ5LCBDIGlzIGRpc3BsYXllZCBhcyBpcywgYW5k CisgICAgICAgICBub3QgZGlzcGxheWVkIGFzIFxOTk4gb3IgYXMgXk4uICBJZiBDIGlzIGEgc2lu Z2xlLWJ5dGUKKyAgICAgICAgIGNoYXJhY3RlciwgaXQgdGFrZXMgb25lIGNvbHVtbi4gIElmIEMg aXMgbXVsdGktYnl0ZSBpbgorICAgICAgICAgYSB1bmlieXRlIGJ1ZmZlciwgaXQncyB0cmFuc2xh dGVkIHRvIHVuaWJ5dGUsIHNvIGl0CisgICAgICAgICBhbHNvIHRha2VzIG9uZSBjb2x1bW4uICAq LworICAgICAgKytjb2w7CisgICAgZWxzZQorICAgICAgY29sICs9IChjdGxfYXJyb3cgJiYgYyA8 IDAyMDApID8gMiA6IDQ7CisgIH0KKyAgICB9Cisgc3RhcnRfb2ZfbGluZV9mb3VuZDoKKyAgaWYg KHRhYl9zZWVuKQorICAgIHsKKyAgICAgIGNvbCA9ICgoY29sICsgdGFiX3dpZHRoKSAvIHRhYl93 aWR0aCkgKiB0YWJfd2lkdGg7CisgICAgICBjb2wgKz0gcG9zdF90YWI7CisgICAgfQorICBsYXN0 X2tub3duX2NvbHVtbiA9IGNvbDsKKyAgbGFzdF9rbm93bl9jb2x1bW5fcG9pbnQgPSBwdDsKKyAg bGFzdF9rbm93bl9jb2x1bW5fbW9kaWZpZWQgPSBNT0RJRkY7CisgIHJldHVybiBjb2w7Cit9CisK K3N0YXRpYyBpbnQKK21jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKExpc3BfT2JqZWN0IGFyZykKK3sK KyAgY2hhciAqc3RyOworICBpZiAoWFRZUEUgKGFyZykgPT0gTGlzcF9TdHJpbmcpCisgICAgc3Ry ID0gU1NEQVRBIChhcmcpOworICBlbHNlIGlmIChYVFlQRSAoYXJnKSA9PSBMaXNwX1N5bWJvbCkK KyAgICBzdHIgPSBTU0RBVEEgKFNZTUJPTF9OQU1FIChhcmcpKTsKKyAgZWxzZSByZXR1cm4gLTE7 CisgIGlmICghc3RyY21wIChzdHIsICJib3giKSkKKyAgICByZXR1cm4gRklMTEVEX0JPWF9DVVJT T1I7CisgIGlmICghc3RyY21wIChzdHIsICJob2xsb3ciKSkKKyAgICByZXR1cm4gSE9MTE9XX0JP WF9DVVJTT1I7CisgIGlmICghc3RyY21wIChzdHIsICJoYmFyIikpCisgICAgcmV0dXJuIEhCQVJf Q1VSU09SOworICBpZiAoIXN0cmNtcCAoc3RyLCAiYmFyIikpCisgICAgcmV0dXJuIEJBUl9DVVJT T1I7CisgIGlmICghc3RyY21wIChzdHIsICJsZWZ0LWZyaW5nZS1iaXRtYXAiKSkKKyAgICByZXR1 cm4gTEVGVF9GUklOR0VfQklUTUFQOworICBpZiAoIXN0cmNtcCAoc3RyLCAicmlnaHQtZnJpbmdl LWJpdG1hcCIpKQorICAgIHJldHVybiBSSUdIVF9GUklOR0VfQklUTUFQOworICBpZiAoIXN0cmNt cCAoc3RyLCAibm8iKSkKKyAgICByZXR1cm4gTk9fQ1VSU09SOworICByZXR1cm4gLTE7Cit9CisK K3N0YXRpYyBMaXNwX09iamVjdAorbWNfY3Vyc29yX3R5cGVfdG9fbGlzcCAoaW50IGFyZykKK3sK KyAgc3dpdGNoIChhcmcpCisgICAgeworICAgIGNhc2UgRklMTEVEX0JPWF9DVVJTT1I6IHJldHVy biBRYm94OworICAgIGNhc2UgSE9MTE9XX0JPWF9DVVJTT1I6IHJldHVybiBRaG9sbG93OworICAg IGNhc2UgSEJBUl9DVVJTT1I6IHJldHVybiBRaGJhcjsKKyAgICBjYXNlIEJBUl9DVVJTT1I6IHJl dHVybiBRYmFyOworICAgIGNhc2UgTEVGVF9GUklOR0VfQklUTUFQOiByZXR1cm4gaW50ZXJuICgi bGVmdC1mcmluZ2UtYml0bWFwIik7CisgICAgY2FzZSBSSUdIVF9GUklOR0VfQklUTUFQOiByZXR1 cm4gaW50ZXJuICgicmlnaHQtZnJpbmdlLWJpdG1hcCIpOworICAgIGNhc2UgTk9fQ1VSU09SOgor ICAgIGRlZmF1bHQ6IHJldHVybiBpbnRlcm4gKCJubyIpOworICAgIH0KK30KKworc3RhdGljIExp c3BfT2JqZWN0CittY19jb2xvcl92ZWN0b3JfY2FsYyAoc3RydWN0IHdpbmRvdyAqdywgTGlzcF9P YmplY3QgY29sb3IpCit7CisgIENIRUNLX1NUUklORyAoY29sb3IpOworICBMaXNwX09iamVjdCB0 YXJnZXRfZnJhbWUgPSB3LT5mcmFtZTsKKyAgTGlzcF9PYmplY3QgY29sb3JfdmFsdWVzOworICBk b3VibGUgdmFsbWF4ID0gWElOVCAoWENBUiAoRnh3X2NvbG9yX3ZhbHVlcyAoYnVpbGRfc3RyaW5n ICgiI2ZmZmZmZiIpLCB0YXJnZXRfZnJhbWUpKSk7CisgIExpc3BfT2JqZWN0IHZsaXN0OworICBw dHJkaWZmX3QgeDsKKyAgaW50IGkgPSAwOworICBMaXNwX09iamVjdCB0ZW1wID0gUW5pbDsKKyAg TGlzcF9PYmplY3QgdmVjdG9yID0gKEZtYWtlX3ZlY3RvciAobWFrZV9udW1iZXIgKDMpLCBRbmls KSk7CisgIGlmICghTklMUCAoRm1lbXEgKChGZnJhbWVwICh0YXJnZXRfZnJhbWUpKSwgbGlzdG4g KENPTlNUWVBFX0hFQVAsIDMsIGludGVybiAoIngiKSwgaW50ZXJuICgidzMyIiksIGludGVybiAo Im5zIikpKSkpCisgICAgeworICAgICAgY29sb3JfdmFsdWVzID0gKEZ4d19jb2xvcl92YWx1ZXMg KGNvbG9yLCB0YXJnZXRfZnJhbWUpKTsKKyAgICAgIGZvciAodmxpc3QgPSBjb2xvcl92YWx1ZXM7 CisgICAgICAgICAgIENPTlNQICh2bGlzdCk7CisgICAgICAgICAgIHZsaXN0ID0gWENEUiAodmxp c3QpKQorICAgICAgICB7CisgICAgICAgICAgeCA9IFhJTlQgKFhDQVIgKHZsaXN0KSk7CisgICAg ICAgICAgdGVtcCA9IG1ha2VfZmxvYXQgKHggLyB2YWxtYXgpOworICAgICAgICAgIEFTRVQgKHZl Y3RvciwgaSwgdGVtcCk7CisgICAgICAgICAgaSA9IGkgKyAxOworICAgICAgICB9CisgICAgfQor ICByZXR1cm4gdmVjdG9yOworfQorCitzdGF0aWMgTGlzcF9PYmplY3QKK21jX2JnX2xzbCAoc3Ry dWN0IHdpbmRvdyAqdywgZW51bSBmYWNlX2lkIGZhY2VfaWQpCit7CisgIHN0cnVjdCBmcmFtZSAq ZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBzdHJ1Y3QgZmFjZSAqZmFjZTsKKyAgTGlzcF9PYmpl Y3QgY29sb3IsIGNvbG9yX3ZlY3RvcjsKKyAgaWYgKCFOSUxQIChWZmFjZV9yZW1hcHBpbmdfYWxp c3QpCisgICAgICAmJiAoZmFjZV9pZCA9PSBERUZBVUxUX0ZBQ0VfSUQgLyogUWRlZmF1bHQgKi8K KyAgICAgICAgICB8fCBmYWNlX2lkID09IE1PREVfTElORV9GQUNFX0lEIC8qIFFtb2RlX2xpbmUg Ki8KKyAgICAgICAgIC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AuICAqLworCitzdGF0aWMg aW50CittY19nZXRfbG9naWNhbF9mcmluZ2VfYml0bWFwIChzdHJ1Y3Qgd2luZG93ICp3LCBMaXNw X09iamVjdCBiaXRtYXAsIGludCByaWdodF9wLCBpbnQgcGFydGlhbF9wKQoreworICBMaXNwX09i amVjdCBjbWFwLCBibTEgPSBRbmlsLCBibTIgPSBRbmlsLCBibTsKKyAgRU1BQ1NfSU5UIGxuMSA9 IDAsIGxuMiA9IDA7CisgIGludCBpeDEgPSByaWdodF9wOworICBpbnQgaXgyID0gaXgxICsgKHBh cnRpYWxfcCA/IDIgOiAwKTsKKyAgaWYgKChjbWFwID0gQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSksICFOSUxQIChjbWFwKSkKKyAgICB7CisgICAg ICBibTEgPSBGYXNzcSAoYml0bWFwLCBjbWFwKTsKKyAgICAgIGlmIChDT05TUCAoYm0xKSkKKyAg eworICAgIGlmICgoYm0xID0gWENEUiAoYm0xKSksIE5JTFAgKGJtMSkpCisgICAgICByZXR1cm4g Tk9fRlJJTkdFX0JJVE1BUDsKKyAgICBpZiAoQ09OU1AgKGJtMSkpCisgICAgICB7CisgICAgICAg IGxuMSA9IFhJTlQgKEZsZW5ndGggKGJtMSkpOworICAgICAgICBpZiAocGFydGlhbF9wKQorICAg IHsKKyAgICAgIGlmIChsbjEgPiBpeDIpCisgICAgICAgIHsKKyAgICAgICAgICBibSA9IEZudGgg KG1ha2VfbnVtYmVyIChpeDIpLCBibTEpOworICAgICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisg ICAgICBnb3RvIGZvdW5kOworICAgICAgICB9CisgICAgfQorICAgICAgICBlbHNlCisgICAgewor ICAgICAgaWYgKGxuMSA+IGl4MSkKKyAgICAgICAgeworICAgICAgICAgIGJtID0gRm50aCAobWFr ZV9udW1iZXIgKGl4MSksIGJtMSk7CisgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAg IGdvdG8gZm91bmQ7CisgICAgICAgIH0KKyAgICB9CisgICAgICB9CisgICAgZWxzZSBpZiAoKGJt ID0gYm0xLCAhRVEgKGJtLCBRdCkpKQorICAgICAgZ290byBmb3VuZDsKKyAgfQorICAgIH0KKyAg aWYgKCFFUSAoY21hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRvcl9h bGlzdCkpCisgICAgICAmJiAhTklMUCAoQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2lu ZGljYXRvcl9hbGlzdCkpKQorICAgIHsKKyAgICAgIGJtMiA9IEZhc3NxIChiaXRtYXAsIEJWQVIg KCZidWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKTsKKyAgICAgIGlmIChD T05TUCAoYm0yKSkKKyAgeworICAgIGlmICgoYm0yID0gWENEUiAoYm0yKSksICFOSUxQIChibTIp KQorICAgICAgeworICAgICAgICBpZiAoQ09OU1AgKGJtMikpCisgICAgeworICAgICAgbG4yID0g WElOVCAoRmxlbmd0aCAoYm0yKSk7CisgICAgICBpZiAocGFydGlhbF9wKQorICAgICAgICB7Cisg ICAgICAgICAgaWYgKGxuMiA+IGl4MikKKyAgICAgIHsKKyAgICAgICAgYm0gPSBGbnRoIChtYWtl X251bWJlciAoaXgyKSwgYm0yKTsKKyAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAg ICBnb3RvIGZvdW5kOworICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgICAgfQorICB9Cisg ICAgfQorICBpZiAobG4xID4gaXgxKQorICAgIHsKKyAgICAgIGJtID0gRm50aCAobWFrZV9udW1i ZXIgKGl4MSksIGJtMSk7CisgICAgICBpZiAoIUVRIChibSwgUXQpKQorICBnb3RvIGZvdW5kOwor ICAgIH0KKyAgaWYgKGxuMiA+IGl4MSkKKyAgICB7CisgICAgICBibSA9IEZudGggKG1ha2Vf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WFyIHRoZSBkaXNwbGF5IHVuZGVyIHRoZSBjdXJzb3IuICAqLworICBpZiAody0+cGh5c19j dXJzb3JfdHlwZSA9PSBIT0xMT1dfQk9YX0NVUlNPUikKKyAgICB7CisgICAgICBpbnQgeCwgeTsK KyAgICAgIGludCBoZWFkZXJfbGluZV9oZWlnaHQgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hU ICh3KTsKKyAgICAgIGludCB3aWR0aDsKKyAgICAgIGN1cnNvcl9nbHlwaCA9IGdldF9waHlzX2N1 cnNvcl9nbHlwaCAodyk7CisgICAgICBpZiAoY3Vyc29yX2dseXBoID09IE5VTEwpCisgICAgICAg IGdvdG8gbWFya19jdXJzb3Jfb2ZmOworICAgICAgd2lkdGggPSBjdXJzb3JfZ2x5cGgtPnBpeGVs X3dpZHRoOworICAgICAgeCA9IHctPnBoeXNfY3Vyc29yLng7CisgICAgICBpZiAoeCA8IDApCisg ICAgICAgIHsKKyAgICAgICAgICB3aWR0aCArPSB4OworICAgICAgICAgIHggPSAwOworICAgICAg ICB9CisgICAgICB3aWR0aCA9IG1pbiAod2lkdGgsIHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRf QVJFQSkgLSB4KTsKKyAgICAgIHkgPSBXSU5ET1dfVE9fRlJBTUVfUElYRUxfWSAodywgbWF4ICho ZWFkZXJfbGluZV9oZWlnaHQsIGN1cnNvcl9yb3ctPnkpKTsKKyAgICAgIHggPSBXSU5ET1dfVEVY VF9UT19GUkFNRV9QSVhFTF9YICh3LCB4KTsKKyAgICAgIGlmICh3aWR0aCA+IDApCisgIEZSQU1F X1JJRiAoZiktPmNsZWFyX2ZyYW1lX2FyZWEgKGYsIHgsIHksIHdpZHRoLCBjdXJzb3Jfcm93LT52 aXNpYmxlX2hlaWdodCk7CisgICAgfQorICAvKiBFcmFzZSB0aGUgY3Vyc29yIGJ5IHJlZHJhd2lu ZyB0aGUgY2hhcmFjdGVyIHVuZGVybmVhdGggaXQuICAqLworICBpZiAob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YyB2b2lk CittY19kcmF3X2VyYXNlX2h5YnJpZCAoc3RydWN0IHdpbmRvdyAqdywgaW50IHgsIGludCBmeCwg aW50IHksIGludCBmeSwgaW50IGhwb3MsIGludCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAg IGludCBoLCBlbnVtIHRleHRfY3Vyc29yX2tpbmRzIGN1cnNvcl90eXBlLCBpbnQgY3Vyc29yX3dp ZHRoLAorICAgICAgICAgICAgICAgICAgICAgIExpc3BfT2JqZWN0IGNvbG9yX3ZlY3RvciwgYm9v bCBhY3RpdmVfY3Vyc29yX3AsIGJvb2wgbWluaW1hbF9wLAorICAgICAgICAgICAgICAgICAgICAg IGludCBmbGF2b3IsIGludCBwb3NpbnQsIGJvb2wgcmVtb3ZlX3ApCit7CisgIC8qIGBtYXRyaXhf cm93JyBpbiBgZGlzcG5ldy5jYCBjb250YWlucyB0aGUgZm9sbG93aW5nIHRlc3RzLAorICBlYXNz ZXJ0IChtYXRyaXggJiYgbWF0cml4LT5yb3dzKTsKKyAgZWFzc2VydCAocm93ID49IDAgJiYgcm93 IDwgbWF0cml4LT5ucm93cyk7ICovCisgIGJvb2wgYmFyZl9jcmFzaF9vbmUgPSAody0+Y3VycmVu dF9tYXRyaXggJiYgdy0+Y3VycmVudF9tYXRyaXgtPnJvd3MpID8gZmFsc2UgOiB0cnVlOworICBp ZiAoYmFyZl9jcmFzaF9vbmUpCisgICAgcmV0dXJuOworICBib29sIGJhcmZfY3Jhc2hfdHdvID0g KHZwb3MgPj0gMCAmJiB2cG9zIDwgdy0+Y3VycmVudF9tYXRyaXgtPm5yb3dzKSA/IGZhbHNlIDog dHJ1ZTsKKyAgaWYgKGJhcmZfY3Jhc2hfdHdvKQorICAgIHJldHVybjsKKyAgaWYgKHggPCAwCisg ICAgICB8fCB5IDwgMAorICAgICAgfHwgaHBvcyA8IDAKKyAgICAgIHx8IHZwb3MgPCAwKQorICAg IHJldHVybjsKKyAgTGlzcF9PYmplY3QgYnVmID0gdy0+Y29udGVudHM7CisgIENIRUNLX0JVRkZF UiAoYnVmKTsKKyAgYm9vbCBhdXRvX2hzY3JvbGxfbW9kZV9wID0gRVEgKEZidWZmZXJfbG9jYWxf dmFsdWUgKFFhdXRvX2hzY3JvbGxfbW9kZSwgYnVmKSwgUWN1cnJlbnRfbGluZSk7CisgIC8qIEVY QU1QTEU6ICAoc2Nyb2xsLWxlZnQgNSkgKi8KKyAgYm9vbCBoc2NsX2FsbF90ZW1wX3AgPSAody0+ c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19o c2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4g MAorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAg LyogRVhBTVBMRTogIEMtdSBDLXggPCBhbmQgZG8gbm90aGluZy4gKi8KKyAgYm9vbCBoc2NsX2Fs bF9wZXJtXzBfcCA9ICh3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHct Pm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9o c2Nyb2xsID09IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBz b21ldGhpbmcgZWxzZSBiZXNpZGVzIGhvcml6b250YWxseSBzY3JvbGxpbmcgdGhlCisgICAgICAg ICAgICAgICBjdXJyZW50IGxpbmUgZGlmZmVyZW50bHkuCisgICAgICAgICAgICAgICBDdXJyZW50 IGxpbmUgaXMgX25vdF8gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBi b29sIGhzY2xfYWxsX3Blcm1fMV9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgQy11IEMt eCA8IGFuZCAuLi4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9u dGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8yX3Ag PSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHct PmhzY3JvbGwgPT0gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Ny b2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsICE9 IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgKHNjcm9sbC1sZWZ0IDUpOyBhbmQsIHRoZW4g cHJlc3MgdGhlIGxlZnQgYXJyb3cga2V5IG9uZSB0aW1lLgorICAgICAgICAgICAgICAgQ3VycmVu dCBsaW5lIF9pc18gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiovCisgIGJvb2wg aHNjbF90ZW1wX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAg ICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICYmIHct PmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0g MCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIHNvbWV0aGluZyB0aGF0IGNhdXNl cyB0aGUgY3VycmVudCBsaW5lIHRvIGJlCisgICAgICAgICAgICAgICBob3Jpem9udGFsbHkgc2Ny b2xsZWQgZGlmZmVyZW50bHkuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jp em9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9wZXJtX3AgPSAo IXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19o c2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAg ICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgIT0gdy0+aHNjcm9sbCk7CisgIHN0cnVjdCBmcmFt ZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICAvKiBSZWNvcmQgc29tZSBvZiB0aGUgY3VycmVu dCB2YWx1ZXMgZm9yIHRoZSBjdXJzb3IgYW5kIGdseXBoX3Jvdy4gKi8KKyAgYm9vbCBwaHlzX2N1 cnNvcl9vbl9wID0gdy0+cGh5c19jdXJzb3Jfb25fcDsKKyAgc3RydWN0IGdseXBoX3JvdyAqZ2x5 cGhfcm93ID0gTUFUUklYX1JPVyAody0+Y3VycmVudF9tYXRyaXgsIHZwb3MpOworICBib29sIGN1 cnNvcl9pbl9mcmluZ2VfcCA9IGdseXBoX3Jvdy0+Y3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gJiYgZmxhdm9yID09IE1DX09WRVJMQVlfQVJST1dfQklUTUFQCisgICAgICAg ICAgICAgJiYgKGhzY2xfYWxsX3RlbXBfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9w ZXJtXzBfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzFfcAorICAgICAgICAg ICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzJfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX3Rl bXBfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX3Blcm1fcCkpCisgICAgICB7CisgICAgICAg IGVudW0gZmFjZV9pZCBvdmVybGF5X2Fycm93X2ZhY2VfaWQgPQorICAgICAgICAgICghYWN0aXZl X2N1cnNvcl9wCisgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIGNyb3NzaGFpcnNfaW5hY3RpdmVfd2luZG93cykpKQorICAgICAgICAgID8gbG9va3VwX25h bWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1oc2NsLWluYWN0aXZlLWZh Y2UiKSwgdHJ1ZSkKKyAgICAgICAgICA6IChhY3RpdmVfY3Vyc29yX3AKKyAgICAgICAgICAgICAm JiBtaW5pbWFsX3ApCisgICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRl cm4gKCIrLW92ZXJsYXktYXJyb3ctaHNjbC1taW5pbWFsLWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAg ICA6IChhY3RpdmVfY3Vyc29yX3AKKyAgICAgICAgICAgICAmJiAhbWluaW1hbF9wKQorICAgICAg ICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93 LWhzY2wtZmFjZSIpLCB0cnVlKQorICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAg ICBmYWNlX2lkID0gKGN1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WVzIHRoZSBmaXJzdCBjb25kaXRpb24KKyAgICAgICAgb2YgKHdoaWNoICE9IE5P X0ZSSU5HRV9CSVRNQVApLiAgQXQgdGhpcyB0aW1lLCBAbGF3bGlzdCBwcmVmZXJzIG5vdCB0bwor ICAgICAgICByZWx5IHVwb24gYSBMaXNwIHNldHRpbmcgdXNpbmcgYHNldC1mcmluZ2UtYml0bWFw LWZhY2UnLiAqLworICAgICAgICBnbHlwaF9yb3ctPmxlZnRfZnJpbmdlX2JpdG1hcCA9IChjdXJz b3JfdHlwZSA9PSBMRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IGZyaW5nZV9iaXRtYXAKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgZ2x5cGhfcm93 LT5sZWZ0X2ZyaW5nZV9vZmZzZXQgPSAwOworICAgICAgICBkcmF3X2ZyaW5nZV9iaXRtYXAgKHcs IGdseXBoX3JvdywgdHJ1ZSk7CisgICAgICB9CisgICAgICBlbHNlIGlmICghcmVtb3ZlX3AKKyAg ICAgICAgICAgICAgICYmIChmbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJP VworICAgICAgICAgICAgICAgICAgIHx8IGZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFCisg ICAgICAgICAgICAgICAgICAgfHwgZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJP VworICAgICAgICAgICAgICAgICAgIHx8IGZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAg ICAgICAgICAgICAgICB8fCBmbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSCkpCisg ICAgICAgIHsKKyAgICAgICAgICBMaXNwX09iamVjdCBiaXRtYXBfZmxhdm9yID0gKGZsYXZvciA9 PSBNQ19IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGZsYXZvciA9PSBNQ19IT0xMT1df UkVDVEFOR0xFKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1j X2hvbGxvd19yZWN0YW5nbGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiAoZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVykKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3cK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZmxhdm9yID09IE1DX1ZF UlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFt Y192ZXJ0aWNhbF9iYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAo Zmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyX2JhY2tzbGFzaAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFFuaWw7CisgICAgICAgICAgZnJpbmdl X2JpdG1hcCA9IChjdXJzb3JfdHlwZSA9PSBSSUdIVF9GUklOR0VfQklUTUFQKQorICAgICAgICAg ICAgICAgICAgICAgICAgICA/IGxvb2t1cF9mcmluZ2VfYml0bWFwIChiaXRtYXBfZmxhdm9yKQor ICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgICAg ZmFjZV9pZCA9IChjdXJzb3JfdHlwZSA9PSBSSUdIVF9GUklOR0VfQklUTUFQKQorICAgICAgICAg ICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXZlcnRpY2Fs LWJhci1mYWNlIiksIHRydWUpCisgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lE OworICAgICAgICAgIGdseXBoX3Jvdy0+Y3Vyc29yX2luX2ZyaW5nZV9wID0gZmFsc2U7CisgICAg ICAgICAgZ2x5cGhfcm93LT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3AgPSAwOworICAgICAgICAg IGdseXBoX3Jvdy0+cmlnaHRfZnJpbmdlX2JpdG1hcCA9IGZyaW5nZV9iaXRtYXA7CisgICAgICAg ICAgZ2x5cGhfcm93LT5yaWdodF9mcmluZ2VfZmFjZV9pZCA9IGZhY2VfaWQ7CisgICAgICAgICAg Z2x5cGhfcm93LT5yaWdodF9mcmluZ2Vfb2Zmc2V0ID0gMDsKKyAgICAgICAgICBkcmF3X2ZyaW5n ZV9iaXRtYXAgKHcsIGdseXBoX3JvdywgZmFsc2UpOworICAgICAgICB9CisgICAgICAgIGVsc2Ug aWYgKGZsYXZvciA9PSBNQ19HTFlQSAorICAgICAgICAgICAgICAgICB8fCBmbGF2b3IgPT0gTUNf R0xZUEhMRVNTCisgICAgICAgICAgICAgICAgIHx8IGZsYXZvciA9PSBNQ19HTFlQSF9UQUIpCisg ICAgICAgICAgeworICAgICAgICAgICAgdy0+bWMuaCA9IGg7CisgICAgICAgICAgICB3LT5tYy5m eCA9IGZ4OworICAgICAgICAgICAgdy0+bWMuZnkgPSBmeTsKKyAgICAgICAgICAgIHctPm1jLmds eXBoX2ZsYXZvciA9IGZsYXZvcjsKKyAgICAgICAgICAgIHctPm1jLnJlZCA9IFhGTE9BVF9EQVRB IChBUkVGIChjb2xvcl92ZW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QorICAgICAgICAgICAgICAgICAgICAgICAgICA6IFFuaWw7CisgIGlmIChnbHlw aC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICB8fCBnbHlwaC0+dHlwZSA9PSBHTFlQSExFU1Nf R0xZUEgpCisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBEImQv JS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQg ICUzZCAgJTNkICVzICVzXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJF QV0sCisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVh XSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAoZ2x5cGgtPnR5cGUgPT0gQ0hB Ul9HTFlQSAorICAgICAgICAgPyAnQycKKyAgICAgICAgIDogJ0cnKSwKKyAgICAgICAgZ2x5cGgt PmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAn QicKKyAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdT JworICAgICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgID8g JzAnCisgICAgICAgICAgICAgICA6ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRo LAorICAgICAgICBnbHlwaC0+dS5jaCwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAg IGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9w LAorICAgICAgICBnbHlwaC0+eCwgZ2x5cGgtPnksIGdseXBoLT5ocG9zLCBnbHlwaC0+dnBvcywg Z2x5cGgtPnp2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgKCghTklMUCAoY2hhcmFjdGVyKQor ICAgICAgICAgJiYgZ2x5cGgtPnUuY2ggPT0gOSkKKyAgICAgICAgICAgPyAiXFx0IgorICAgICAg ICAgOiAoIU5JTFAgKGNoYXJhY3RlcikKKyAgICAgICAgICAgICYmIGdseXBoLT51LmNoID09IDEw KQorICAgICAgICAgICA/ICJcXG4iCisgICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQorICAg ICAgICAgICAgJiYgZ2x5cGgtPnUuY2ggPT0gMzIpCisgICAgICAgICAgID8gIlxccyIKKyAgICAg ICAgIDogKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAmJiBnbHlwaC0+dS5jaCAhPSA5 CisgICAgICAgICAgICAmJiBnbHlwaC0+dS5jaCAhPSAxMAorICAgICAgICAgICAgJiYgZ2x5cGgt PnUuY2ggIT0gMzIpCisgICAgICAgICAgID8gU1NEQVRBIChjaGFyYWN0ZXIpCisgICAgICAgICA6 ICJcXD8iKSk7CisgICAgfQorICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBI KQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIiAlNSJwRCJkLyUtNWQg JTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4xZCAlNWQgJTRkICAlM2Qg ICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAor ICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAx KSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ1MnLAorICAgICAgICBnbHlwaC0+Y2hh cnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdC JworICAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdT JworICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICcwJwor ICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAg IDB1LAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xp bmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT54 LCBnbHlwaC0+eSwgZ2x5cGgtPmhwb3MsIGdseXBoLT52cG9zLCBnbHlwaC0+enZfcCA/ICJaViIg OiAiLS0iLAorICAgICAgICAiXFxTIik7CisgICAgfQorICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9 PSBJTUFHRV9HTFlQSCkKKyAgICB7CisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICIg JTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNnggJTRkICUxLjFkJTEuMWQg JTVkICU0ZCAgJTNkICAlM2QgJXMgJWNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNb VEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51 c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdJJywKKyAgICAg ICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAg ICAgICAgICAgPyAnQicKKyAgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAg ICAgICAgICAgPyAnUycKKyAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAg ICAgICAgPyAnMCcKKyAgICAgICAgICA6ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dp ZHRoLAorICAgICAgICAodW5zaWduZWQgaW50KSBnbHlwaC0+dS5pbWdfaWQsCisgICAgICAgIGds eXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBn bHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlw aC0+aHBvcywgZ2x5cGgtPnZwb3MsIGdseXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAg ICcuJyk7CisgICAgfQorICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgp CisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBEImQvJS01ZCAl NWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4IiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBo c1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ct PnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJysnLAorICAg ICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisg ICAgICAgICAgICA/ICdCJworICAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisg ICAgICAgICAgICA/ICdTJworICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAg ICAgICAgICA/ICcwJworICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxf d2lkdGgsCisgICAgICAgICh1bnNpZ25lZCBpbnQpIGdseXBoLT51LmNtcC5pZCk7CisgICAgICBm cHJpbnRmIChzdGRlcnIsICIgJTRkICUxLjFkJTEuMWQiLAorICAgICAgICBnbHlwaC0+ZmFjZV9p ZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0 X2JveF9saW5lX3ApOworICAgICAgaWYgKGdseXBoLT51LmNtcC5hdXRvbWF0aWMpCisgICAgICAg IGZwcmludGYgKHN0ZGVyciwgIiAlNWQgJTRkICAlM2QgICUzZCAlcyAuIFslZC0lZF1cbiIsCisg ICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywg Z2x5cGgtPnZwb3MsIGdseXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICAgICAgICAg ICAgICAgICAgZ2x5cGgtPnNsaWNlLmNtcC5mcm9tLCBnbHlwaC0+c2xpY2UuY21wLnRvKTsKKyAg ICAgICAgZWxzZQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJcbiIpOworICAgIH0KKyAgZWxz ZSBpZiAoZ2x5cGgtPnR5cGUgPT0gWFdJREdFVF9HTFlQSCkKKyAgICB7CisjaWZuZGVmIEhBVkVf WFdJREdFVFMKKyAgICAgIGVhc3N1bWUgKGZhbHNlKTsKKyNlbHNlCisgICAgICBmcHJpbnRmIChz dGRlcnIsCisgICAgICAgICIgICU1ZC8lLTVkICU1ZCAlNGMgJTZkICVjICUzZCAweCUwNXggJTRk ICUxLjFkJTEuMWQgJTVkICU0ZCAgJTNkICAlM2QgJXMgJWNcbiIsCisgICAgICAgIGdseXBoIC0g cm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkg PyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAg ICdYJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+ b2JqZWN0KQorICAgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9i amVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICA6ICctJykpLAorICAgICAgICBnbHlw aC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+ bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAg ICAgZ2x5cGgtPnUueHdpZGdldCwKKyAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+ aHBvcywgZ2x5cGgtPnZwb3MsIGdseXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcu Jyk7CisjZW5kaWYKKyAgICB9Cit9CisKKy8qIER1bXAgdGhlIGNvbnRlbnRzIG9mIGdseXBoIHJv dyBhdCBWUE9TIGluIE1BVFJJWCB0byBzdGRlcnIuCisgICBHTFlQSFMgMCBtZWFucyBkb24ndCBz aG93IGdseXBoIGNvbnRlbnRzLgorICAgR0xZUEhTIDEgbWVhbnMgc2hvdyBnbHlwaHMgaW4gc2hv cnQgZm9ybQorICAgR0xZUEhTID4gMSBtZWFucyBzaG93IGdseXBocyBpbiBsb25nIGZvcm0uICAq LworCit2b2lkCittY19kdW1wX2dseXBoX3JvdyAoc3RydWN0IGdseXBoX3JvdyAqcm93LCBpbnQg dnBvcywgaW50IGdseXBocykKK3sKKyAgaW50IHJlbGF0aXZlX3ggPSAwOworICBpZiAoZ2x5cGhz ICE9IDEpCisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiXG5EVU1QIEdMWVBIIFJPV1xu Iik7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICJSb3cgICAgIFN0YXJ0ICAgICAgIEVuZCBVc2Vk IG9FPjxcXENUWkZlc20gICAgIFggICAgWSAgICBXICAgIEggICAgViAgICBBICAgIFBcbiIpOwor ICAgICAgZnByaW50ZiAoc3RkZXJyLCAiPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4iKTsKKyAgICAg IGZwcmludGYgKHN0ZGVyciwgIiUzZCAlOSJwRCJkICU5InBEImQgJTRkICUxLjFkJTEuMWQlMS4x ZCUxLjFkXAorJTEuMWQlMS4xZCUxLjFkJTEuMWQlMS4xZCUxLjFkJTEuMWQlMS4xZCAgJTRkICU0 ZCAlNGQgJTRkICU0ZCAlNGQgJTRkXG4iLAorICAgICAgICAgdnBvcywKKyAgICAgICAgIE1BVFJJ WF9ST1dfU1RBUlRfQ0hBUlBPUyAocm93KSwKKyAgICAgICAgIE1BVFJJWF9ST1dfRU5EX0NIQVJQ T1MgKHJvdyksCisgICAgICAgICByb3ctPnVzZWRbVEVYVF9BUkVBXSwKKyAgICAgICAgIHJvdy0+ Y29udGFpbnNfb3ZlcmxhcHBpbmdfZ2x5cGhzX3AsCisgICAgICAgICByb3ctPmVuYWJsZWRfcCwK KyAgICAgICAgIHJvdy0+dHJ1bmNhdGVkX29uX2xlZnRfcCwKKyAgICAgICAgIHJvdy0+dHJ1bmNh dGVkX29uX3JpZ2h0X3AsCisgICAgICAgICByb3ctPmNvbnRpbnVlZF9wLAorICAgICAgICAgTUFU UklYX1JPV19DT05USU5VQVRJT05fTElORV9QIChyb3cpLAorICAgICAgICAgTUFUUklYX1JPV19E SVNQTEFZU19URVhUX1AgKHJvdyksCisgICAgICAgICByb3ctPmVuZHNfYXRfenZfcCwKKyAgICAg ICAgIHJvdy0+ZmlsbF9saW5lX3AsCisgICAgICAgICByb3ctPmVuZHNfaW5fbWlkZGxlX29mX2No YXJfcCwKKyAgICAgICAgIHJvdy0+c3RhcnRzX2luX21pZGRsZV9vZl9jaGFyX3AsCisgICAgICAg ICByb3ctPm1vdXNlX2ZhY2VfcCwKKyAgICAgICAgIHJvdy0+eCwKKyAgICAgICAgIHJvdy0+eSwK KyAgICAgICAgIHJvdy0+cGl4ZWxfd2lkdGgsCisgICAgICAgICByb3ctPmhlaWdodCwKKyAgICAg ICAgIHJvdy0+dmlzaWJsZV9oZWlnaHQsCisgICAgICAgICByb3ctPmFzY2VudCwKKyAgICAgICAg IHJvdy0+cGh5c19hc2NlbnQpOworICAgICAgLyogVGhlIG5leHQgMyBsaW5lcyBzaG91bGQgYWxp Z24gdG8gIlN0YXJ0IiBpbiB0aGUgaGVhZGVyLiAgKi8KKyAgICAgIGZwcmludGYgKHN0ZGVyciwg IiAgICAlOSJwRCJkICU5InBEImRcdCU1ZFxuIiwgcm93LT5zdGFydC5vdmVybGF5X3N0cmluZ19p bmRleCwKKyAgICAgICAgIHJvdy0+ZW5kLm92ZXJsYXlfc3RyaW5nX2luZGV4LAorICAgICAgICAg cm93LT5jb250aW51YXRpb25fbGluZXNfd2lkdGgpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAi ICAgICU5InBEImQgJTkicEQiZFxuIiwKKyAgICAgICAgIENIQVJQT1MgKHJvdy0+c3RhcnQuc3Ry aW5nX3BvcyksCisgICAgICAgICBDSEFSUE9TIChyb3ctPmVuZC5zdHJpbmdfcG9zKSk7CisgICAg ICBmcHJpbnRmIChzdGRlcnIsICIgICAgJTlkICU5ZFxuIiwgcm93LT5zdGFydC5kcHZlY19pbmRl eCwKKyAgICAgICAgIHJvdy0+ZW5kLmRwdmVjX2luZGV4KTsKKyAgICB9CisgIGlmIChnbHlwaHMg PiAxKQorICAgIHsKKyAgICAgIGludCBhcmVhOworICAgICAgZm9yIChhcmVhID0gTEVGVF9NQVJH SU5fQVJFQTsgYXJlYSA8IExBU1RfQVJFQTsgKythcmVhKQorICB7CisgICAgc3RydWN0IGdseXBo ICpnbHlwaCA9IHJvdy0+Z2x5cGhzW2FyZWFdOworICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGhfZW5k ID0gZ2x5cGggKyByb3ctPnVzZWRbYXJlYV07CisgICAgLyogR2x5cGggZm9yIGEgbGluZSBlbmQg aW4gdGV4dC4gICovCisgICAgaWYgKGFyZWEgPT0gVEVYVF9BUkVBICYmIGdseXBoID09IGdseXBo X2VuZCAmJiBnbHlwaC0+Y2hhcnBvcyA+IDApCisgICAgICArK2dseXBoX2VuZDsKKyAgICBpZiAo Z2x5cGggPCBnbHlwaF9lbmQpCisgICAgICBmcHJpbnRmIChzdGRlcnIsICJHbHlwaCMvVG90YWwg UmVsLlggVCAgICAgICBQb3MgTyAgIFcgICAgIENvZGUgRmFjZSBMUiAgICAgWCAgICBZIEhQT1Mg VlBPUyBaViBDXG4iKTsKKyAgICBmb3IgKDsgZ2x5cGggPCBnbHlwaF9lbmQ7ICsrZ2x5cGgpCisg ICAgICB7CisgICAgICAgIG1jX2R1bXBfZ2x5cGggKHJvdywgZ2x5cGgsIGFyZWEsIHJlbGF0aXZl X3gpOworICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgIH0K KyAgfQorICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGhzID09IDEpCisgICAgeworICAgICAgaW50IGFy ZWE7CisgICAgICBjaGFyIHNbU0hSVF9NQVggKyA0XTsKKyAgICAgIGZvciAoYXJlYSA9IExFRlRf TUFSR0lOX0FSRUE7IGFyZWEgPCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAgeworICAgIGludCBpOwor ICAgIGZvciAoaSA9IDA7IGkgPCByb3ctPnVzZWRbYXJlYV07ICsraSkKKyAgICAgIHsKKyAgICAg ICAgc3RydWN0IGdseXBoICpnbHlwaCA9IHJvdy0+Z2x5cGhzW2FyZWFdICsgaTsKKyAgICAgICAg aWYgKGkgPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgJiYgYXJlYSA9PSBURVhUX0FSRUEK KyAgICAgICYmIE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAmJiBnbHlwaC0+dHlwZSA9PSBD SEFSX0dMWVBICisgICAgICAmJiBnbHlwaC0+dS5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ydWN0IGdseXBoX21hdHJpeCAqbWF0cml4OworICBFTUFDU19JTlQgdnBvczsKKyAgaWYg KE5JTFAgKHJvdykpCisgICAgeworICAgICAgaW50IGQxLCBkMiwgZDMsIGQ0LCBkNSwgeXBvczsK KyAgICAgIGJvb2wgdmlzaWJsZV9wID0gcG9zX3Zpc2libGVfcCAodywgUFQsICZkMSwgJmQyLCAm ZDMsICZkNCwgJmQ1LCAmeXBvcyk7CisgICAgICBpbnQgaGVhZGVyX2xpbmVfaGVpZ2h0ID0gV0lO RE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgICAgICBpbnQgdm9mZnNldCA9IChoZWFkZXJf bGluZV9oZWlnaHQgPiAwCisgICAgICAgICAgICAgICAgICAgICAmJiB5cG9zID4gMCkKKyAgICAg ICAgICAgICAgICAgICAgICA/IHlwb3MgKyAxCisgICAgICAgICAgICAgICAgICAgICAgOiB5cG9z OworICAgICAgaWYgKHZpc2libGVfcCkKKyAgICAgICAgdnBvcyA9IHZvZmZzZXQ7CisgICAgICAg IGVsc2UKKyAgICAgICAgICB2cG9zID0gMDsKKyAgICB9CisgICAgZWxzZQorICAgICAgeworICAg ICAgICBDSEVDS19OVU1CRVIgKHJvdyk7CisgICAgICAgIHZwb3MgPSBYSU5UIChyb3cpOworICAg ICAgfQorICBtYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAgaWYgKHZwb3MgPj0gMCAmJiB2 cG9zIDwgbWF0cml4LT5ucm93cykKKyAgICBtY19kdW1wX2dseXBoX3JvdyAoTUFUUklYX1JPVyAo bWF0cml4LCB2cG9zKSwKKyAgICAgICAgdnBvcywKKyAgICAgICAgVFlQRV9SQU5HRURfSU5URUdF UlAgKGludCwgZ2x5cGhzKSA/IFhJTlQgKGdseXBocykgOiAyKTsKKyAgcmV0dXJuIFFuaWw7Cit9 CisKK3ZvaWQKK21jX2R1bXBfZ2x5cGhfbWF0cml4IChzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRy a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0xFCisg ICAgICA/ICJNQ19IT0xMT1dfUkVDVEFOR0xFIgorICAgIDogZmxhdm9yID09IE1DX1ZFUlRJQ0FM X0JBUl9SSUdIVF9BUlJPVworICAgICAgPyAiTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XIgor ICAgIDogZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgPyAiTUNfVkVSVElDQUxfQkFS IgorICAgIDogZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgID8gIk1D X1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0giCisgICAgOiAiT09QUyIpLAorICBwb3NpbnQsCisgIHJl ZF9mZywgZ3JlZW5fZmcsIGJsdWVfZmcsIHJlZF9iZywgZ3JlZW5fYmcsIGJsdWVfYmcpOworICBi b29sIHJlbW92ZV9wID0gZmFsc2U7CisgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCB4LCBmeCwg eSwgZnksIGhwb3MsIHZwb3MsIGgsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAg ICAgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBhY3RpdmVfY3Vyc29yX3AsIG1pbmltYWxfcCwK KyAgICAgICAgICAgICAgICAgICAgICAgIGZsYXZvciwgcG9zaW50LCByZW1vdmVfcCk7CisgIExp c3BfT2JqZWN0IGZpZnRlZW5fZWxlbWVudHMgPSBsaXN0biAoQ09OU1RZUEVfSEVBUCwgMTUsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ha2VfbnVtYmVyICh4KSwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFrZV9udW1iZXIgKGZ4 KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFrZV9udW1iZXIg KHkpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYWtlX251bWJl ciAoZnkpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYWtlX251 bWJlciAoaHBvcyksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1h a2VfbnVtYmVyICh2cG9zKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgbWFrZV9udW1iZXIgKGgpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBtY19jdXJzb3JfdHlwZV90b19saXNwIChjdXJzb3JfdHlwZSksCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ha2VfbnVtYmVyIChjdXJzb3Jfd2lkdGgpLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYWtlX251bWJlciAoYWN0aXZlX2N1 cnNvcl9wKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFrZV9u dW1iZXIgKG1pbmltYWxfcCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIG1ha2VfbnVtYmVyIChmbGF2b3IpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBtYWtlX251bWJlciAocG9zaW50KSk7CisgICpyZXN1bHQgPSBGY29ucyAoZmlm dGVlbl9lbGVtZW50cywgKnJlc3VsdCk7Cit9CisKKy8qIFJldHVybiBhIHBvaW50ZXIgdG8gdGhl IGdseXBoIFcncyBwaHlzaWNhbCBjdXJzb3IgaXMgb24uICBWYWx1ZSBpcworICAgbnVsbCBpZiBX J3MgY3VycmVudCBtYXRyaXggaXMgaW52YWxpZCwgc28gdGhhdCBubyBtZWFuaW5n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KKyAgICAgICAgICBhc2NlbnQgPSBzY3JhdGNoX2dseXBocy0+YXNjZW50Owor ICAgICAgICB9CisgICAgICAvKiBJZiB5IGlzIGJlbG93IHdpbmRvdyBib3R0b20sIGVuc3VyZSB0 aGF0IHdlIHN0aWxsIHNlZSBhIGN1cnNvci4gICovCisgICAgICBoMCA9IG1pbiAoRlJBTUVfTElO RV9IRUlHSFQgKGYpLCBnbHlwaF9yb3ctPnZpc2libGVfaGVpZ2h0KTsKKyAgICAgIGhfdGVtcCA9 IG1heCAoaDAsIGFzY2VudCArIHNjcmF0Y2hfZ2x5cGhzLT5kZXNjZW50KTsKKyAgICAgIGgwID0g bWluIChoMCwgYXNjZW50ICsgc2NyYXRjaF9nbHlwaHMtPmRlc2NlbnQpOworICAgICAgeTAgPSBX SU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgICAgIGlmICh5IDwgeTApCisgICAgICAg IHsKKyAgICAgICAgICBoX3RlbXAgPSBtYXggKGhfdGVtcCAtICh5MCAtIHkpICsgMSwgaDApOwor ICAgICAgICAgIHkgPSB5MCAtIDE7CisgICAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgICAgewor ICAgICAgICAgIHkwID0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpIC0gaDA7CisgICAgICAgICAg aWYgKHkgPiB5MCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaF90ZW1wICs9IHkgLSB5 MDsKKyAgICAgICAgICAgICAgeSA9IHkwOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAg ICAqZnggPSBXSU5ET1dfVEVYVF9UT19GUkFNRV9QSVhFTF9YICh3LCB4KTsKKyAgICAgICpmeSA9 IFdJTkRPV19UT19GUkFNRV9QSVhFTF9ZICh3LCB5KTsKKyAgICAgICpoID0gaF90ZW1wOworICAg ICAgaWYgKGN1cnNvcl90eXBlID09IEhCQVJfQ1VSU09SKQorICAgICAgICB7CisgICAgICAgICAg aW50IGN1cnNvcl9oZWlnaHQgPSAoY3Vyc29yX3dpZHRoIDwgMSkgPyBscmludCAoMC4yNSAqICpo KSA6IGN1cnNvcl93aWR0aDsKKyAgICAgICAgICBpZiAoY3Vyc29yX2hlaWdodCA+IGdseXBoX3Jv dy0+aGVpZ2h0KQorICAgICAgICAgICAgY3Vyc29yX2hlaWdodCA9IGdseXBoX3Jvdy0+aGVpZ2h0 OworICAgICAgICAgIGlmICgqaCA+IGN1cnNvcl9oZWlnaHQpCisgICAgICAgICAgICAqZnkgKz0g KmggLSBjdXJzb3JfaGVpZ2h0OworICAgICAgICAgICpoID0gY3Vyc29yX2hlaWdodDsKKyAgICAg ICAgfQorICAgIH0KK30KKworLyogUmV0dXJuIHRoZSBzdGFydCBvciBlbmQgcG9zaXRpb24gb2Yg dGhlIHJlZ2lvbi4KKyAgIEJFR0lOTklOR1AgbWVhbnMgcmV0dXJuIHRoZSBzdGFydC4KKyAgIElm IHRoZXJlIGlzIG5vIHJlZ2lvbiBhY3RpdmUsIHNpZ25hbCBhbiBlcnJvci4KKyAgIEVYQU1QTEUg KHJlZ2lvbi1iZWdpbm5pbmcpOiAgcmVnaW9uX2xpbWl0ICgxKQorICAgRVhBTVBMRSAocmVnaW9u LWVuZCk6ICByZWdpb25fbGltaXQgKDApICovCisKK3N0YXRpYyBMaXNwX09iamVjdAorbWNfcmVn aW9uX2xpbWl0IChib29sIGJlZ2lubmluZ3ApCit7CisgIExpc3BfT2JqZWN0IG07CisgIGlmICgh TklMUCAoVnRyYW5zaWVudF9tYXJrX21vZGUpCisgICAgICAmJiBOSUxQIChWbWFya19ldmVuX2lm X2luYWN0aXZlKQorICAgICAgJiYgTklMUCAoQlZBUiAoY3VycmVudF9idWZmZXIsIG1hcmtfYWN0 aXZlKSkpCisgICAgcmV0dXJuIFFuaWw7CisgIG0gPSBGbWFya2VyX3Bvc2l0aW9uIChCVkFSIChj dXJyZW50X2J1ZmZlciwgbWFyaykpOworICBpZiAoTklMUCAobSkpCisgICAgcmV0dXJuI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EhMRVNTX0dM WVBIICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICBpZiAo Z2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgfHwgZ2x5cGgtPnR5cGUgPT0gR0xZUEhM RVNTX0dMWVBIKQorICB7CisgICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAgZnByaW50ZiAoc3Rk ZXJyLAorICAgICAgICAiXG4gJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUw NnggJTRkICUxLjFkJTEuMWQgJTVkICU0ZCAgJTNkICAlM2QgJXMgJXNcbiIsCisgICAgICAgIGds eXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0g PT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisg ICAgICAgIChnbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAgICA/ICdDJworICAgICAg ICAgOiAnRycpLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGds eXBoLT5vYmplY3QpCisgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgt Pm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+ b2JqZWN0KQorICAgICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAor ICAgICAgICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIGdseXBoLT51LmNoLAor ICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwK KyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT54LCBnbHlw aC0+eSwgZ2x5cGgtPmhwb3MsIGdseXBoLT52cG9zLCBnbHlwaC0+enZfcCA/ICJaViIgOiAiLS0i LAorICAgICAgICAoKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAmJiBnbHlwaC0+dS5jaCA9 PSA5KQorICAgICAgICAgICA/ICJcXHQiCisgICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQor ICAgICAgICAgICAgJiYgZ2x5cGgtPnUuY2ggPT0gMTApCisgICAgICAgICAgID8gIlxcbiIKKyAg ICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAmJiBnbHlwaC0+dS5jaCA9 PSAzMikKKyAgICAgICAgICAgPyAiXFxzIgorICAgICAgICAgOiAoIU5JTFAgKGNoYXJhY3RlcikK KyAgICAgICAgICAgICYmIGdseXBoLT51LmNoICE9IDkKKyAgICAgICAgICAgICYmIGdseXBoLT51 LmNoICE9IDEwCisgICAgICAgICAgICAmJiBnbHlwaC0+dS5jaCAhPSAzMikKKyAgICAgICAgICAg PyBTU0RBVEEgKGNoYXJhY3RlcikKKyAgICAgICAgIDogIlxcPyIpKTsKKyAgc3dpdGNoIChhY3Rp b25fdHlwZSkKKyAgeworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAg IE1VTFRJUExFX0NVUlNPUlM6ICBDSEFSX0dMWVBIIHwgR0xZUEhMRVNTX0dMWVBIICAgICAgICAg ICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgTVVMVElQTEVfQ1VS U09SUzoKKyAgICB7CisgICAgICBtY19oZWxwZXIgKHcsIHRlbXBfeCwgLTEsIHRlbXBfeSwgLTEs IHRlbXBfaHBvcywgdGVtcF92cG9zLAorICAgICAgICAgICAgICAgICAtMSwgY3Vyc29yX3R5cGUs IGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgbWNfYmdfbHNsICh3 LCB0ZW1wX2ZhY2VfaWQpLCBhY3RpdmVfY3Vyc29yX3AsCisgICAgICAgICAgICAgICAgIG1pbmlt YWxfcCwgTUNfR0xZUEgsIHRlbXBfY2hhcnBvcywgcmVzdWx0KTsKKyAgICAgIGJyZWFrOworICAg IH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICBIT1JJWk9OVEFM X1JVTEVSOiAgQ0hBUl9HTFlQSCB8IEdMWVBITEVTU19HTFlQSCAgICAgICAgICAgICAgICovCisv KiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEhPUklaT05UQUxfUlVMRVI6CisgICAg eworICAgICAgaW50IHRlbXBfdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCB3LT5jdXJyZW50 X21hdHJpeCk7CisgICAgICBpbnQgdGVtcF9ocG9zID0gZ2x5cGggLSByb3ctPmdseXBoc1tURVhU X0FSRUFdOworICAgICAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3AgPSAob3BvaW50X3ggPT0gcmVs YXRpdmVfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X2hwb3Mg PT0gdGVtcF9ocG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRf eSA9PSBnbHlwaC0+eQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50 X3Zwb3MgPT0gdGVtcF92cG9zKTsKKyAgICAgIGludCBfZngsIGZ5LCBfaCwgX3dkOworICAgICAg bWNfZ2V0X3BoeXNfY3Vyc29yX2dlb21ldHJ5ICh3LCByb3csIHRlbXBfeCwgJl9meCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcF95LCAmZnksIHRlbXBfaHBvcywgdGVt cF92cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmX2gsIGN1cnNvcl90 eXBlLCBjdXJzb3Jfd2lkdGgsICZfd2QpOworICAgICAgaWYgKHRlbXBfeCA8PSB0ZXh0X2FyZWFf d2lkdGgKKyAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICBtY19oZWxw ZXIgKHcsIHRlbXBfeCwgLTEsIHRlbXBfeSwgZnksIHRlbXBfaHBvcywgdGVtcF92cG9zLAorICAg ICAgICAgICAgICAgICAgIC0xLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5k LAorICAgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAodywgdGVtcF9mYWNlX2lkKSwgYWN0aXZl X2N1cnNvcl9wLAorICAgICAgICAgICAgICAgICAgIG1pbmltYWxfcCwgTUNfR0xZUEgsIHRlbXBf Y2hhcnBvcywgcmVzdWx0KTsKKyAgICAgIC8qIEl0IGlzIHBvc3NpYmxlIHRvIHVzZSBNQ19HTFlQ SCBhbmQgYWRqdXN0IHRoZSBmeCBjb29yZGluYXRlOyBob3dldmVyLAorICAgICAgdGhlIG1pZGRs ZS1kb3QgLyBzcGFjZSBnbHlwaCBvbiBhIHdvcmQtd3JhcHBlZCBsaW5lIHdpbGwgYmUgb3Zlcndy aXR0ZW4KKyAgICAgIG51bWVyb3VzIHRpbWVzIGFuZCBpcyB1bnNpZ2h0bHkuICovCisgICAgICBp ZiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEp CisgICAgICAgIHsKKyAgICAgICAgICBpbnQgX2Z4LCBmeSwgX2gsIF93ZDsKKyAgICAgICAgICBt Y19nZXRfcGh5c19jdXJzb3JfZ2VvbWV0cnkgKHcsIHJvdywgdGVtcF94LCAmX2Z4LAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcF95LCAmZnksIHRlbXBfaHBvcywg dGVtcF92cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJl9oLCBj dXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCAmX3dkKTsKKyAgICAgICAgICB0ZW1wX3ggKz0gZ2x5 cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgIHdoaWxlICh0ZW1wX3ggPD0gdGV4dF9hcmVhX3dp ZHRoKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19oZWxwZXIgKHcsIHRlbXBfeCwg LTEsIHRlbXBfeSwgZnksIHRlbXBfaHBvcywgdGVtcF92cG9zLAorICAgICAgICAgICAgICAgICAg ICAgICAgIC0xLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLAorICAgICAg ICAgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAodywgdGVtcF9mYWNlX2lkKSwgYWN0aXZlX2N1 cnNvcl9wLAorICAgICAgICAgICAgICAgICAgICAgICAgIG1pbmltYWxfcCwgTUNfR0xZUEhMRVNT LCB0ZW1wX2NoYXJwb3MsIHJlc3VsdCk7CisgICAgICAgICAgICAgIHRlbXBfeCArPSBmcmFtZV9j aGFyX3dpZHRoOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBicm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G5vIGxp bmUgbnVtYmVycy4gKi8KKyAgICAgIGJvb2wgenZfcCA9IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RF WFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICYmIE1B VFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgPT0gWlYpOworICAgICAgYm9vbCBjdXJzb3JfaW5f ZnJpbmdlX3AgPSBvcG9pbnRfeCArIGZyYW1lX2NoYXJfd2lkdGggPj0gdGV4dF9hcmVhX3dpZHRo OworICAgICAgaW50IGZsYXZvciA9IChjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAgICAgICAgICAg ICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAg ID8gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgOiAoY3Vy c29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT5jb250aW51ZWRf cCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAg ICAgICAgICAgICAgICAgIDogKGN1cnNvcl9pbl9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAg ICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wCisgICAgICAgICAgICAgICAgICAgICAg JiYgIXJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FM X0JBUgorICAgICAgICAgICAgICAgICAgIDogKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVB XSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50 X3ggPiByZWxhdGl2ZV94KQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAg ICAgICAgICAgICAgICAgICA6ICh6dl9wKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQ SExFU1MKKyAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgaW50IHRlbXBfeCA9 IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQor ICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeCA+IHJlbGF0aXZlX3gpCisgICAgICAgICAg ICAgICAgICAgID8gb3BvaW50X3gKKyAgICAgICAgICAgICAgICAgICAgOiByZWxhdGl2ZV94Owor ICAgICAgaWYgKGZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAg ICB8fCBmbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgIHx8IGZs YXZvciA9PSBNQ19WRVJUSUNBTF9CQVIpCisgICAgICAgIGN1cnNvcl90eXBlID0gUklHSFRfRlJJ TkdFX0JJVE1BUDsKKyAgICAgIGludCBfZngsIF9meSwgaCwgX3dkOworICAgICAgbWNfZ2V0X3Bo eXNfY3Vyc29yX2dlb21ldHJ5ICh3LCByb3csIHRlbXBfeCwgJl9meCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgdGVtcF95LCAmX2Z5LCB0ZW1wX2hwb3MsIHRlbXBfdnBvcywK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmgsIGN1cnNvcl90eXBlLCBjdXJz b3Jfd2lkdGgsICZfd2QpOworICAgICAgaW50IGZ4ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElY RUxfWCAodywgb3BvaW50X3gpOworICAgICAgbWNfaGVscGVyICh3LCB0ZW1wX3gsIGZ4LCB0ZW1w X3ksIC0xLCB0ZW1wX2hwb3MsIHRlbXBfdnBvcywKKyAgICAgICAgICAgICAgICAgaCwgY3Vyc29y X3R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eCAlNGQgJTEuMWQlMS4xZCAlNWQg JTRkICAlM2QgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhU X0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRb YXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ1MnLAorICAgICAgICBn bHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAg ID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAg ICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxf d2lkdGgsCisgICAgICAgIDB1LAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5 cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisg ICAgICAgIGdseXBoLT54LCBnbHlwaC0+eSwgZ2x5cGgtPmhwb3MsIGdseXBoLT52cG9zLCBnbHlw aC0+enZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAiXFxTIik7CisgIHN3aXRjaCAoYWN0aW9u X3R5cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAg ICAgICAgICBNVUxUSVBMRV9DVVJTT1JTOiAgU1RSRVRDSF9HTFlQSCAgICAgICAgICAgICAgICAg ICAgICovCisvKiAtLS0tLS0tLS0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ludF94ID09IHJlbGF0 aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF9ocG9zID09 IHRlbXBfaHBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3kg PT0gZ2x5cGgtPnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF92 cG9zID09IHRlbXBfdnBvcyk7CisgICAgICBpbnQgX2Z4LCBmeSwgX2gsIF93ZDsKKyAgICAgIG1j X2dldF9waHlzX2N1cnNvcl9nZW9tZXRyeSAodywgcm93LCB0ZW1wX3gsICZfZngsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBfeSwgJmZ5LCB0ZW1wX2hwb3MsIHRlbXBf dnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJl9oLCBjdXJzb3JfdHlw ZSwgY3Vyc29yX3dpZHRoLCAmX3dkKTsKKyAgICAgIGlmICh0ZW1wX3ggPD0gdGV4dF9hcmVhX3dp ZHRoCisgICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgd2hpbGUgKHRl bXBfeCA8IHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgeworICAg ICAgICAgICAgbWNfaGVscGVyICh3LCB0ZW1wX3gsIC0xLCB0ZW1wX3ksIGZ5LCB0ZW1wX2hwb3Ms IHRlbXBfdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgLTEsIGN1cnNvcl90eXBlLCBjdXJz b3Jfd2lkdGgsIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAo dywgdGVtcF9mYWNlX2lkKSwgYWN0aXZlX2N1cnNvcl9wLAorICAgICAgICAgICAgICAgICAgICAg ICBtaW5pbWFsX3AsIE1DX0dMWVBIX1RBQiwgdGVtcF9jaGFycG9zLCByZXN1bHQpOworICAgICAg ICAgICAgdGVtcF94ICs9IGZyYW1lX2NoYXJfd2lkdGg7CisgICAgICAgICAgfQorICAgICAgICBl bHNlIGlmICh0ZW1wX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGggPCB0ZXh0X2FyZWFfd2lkdGgKKyAg ICAgICAgICAgICAgICAgJiYgcmVhbF9mYWtlX2N1cnNvcl9wCisgICAgICAgICAgICAgICAgICYm IGdseXBoLT5waXhlbF93aWR0aCA+IGZyYW1lX2NoYXJfd2lkdGgpCisgICAgICAgICAgeworICAg ICAgICAgICAgdGVtcF94ICs9IGZyYW1lX2NoYXJfd2lkdGg7CisgICAgICAgICAgICB3aGlsZSAo dGVtcF94IDwgcmVsYXRpdmVfeCArIGdseXBoLT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgIG1jX2hlbHBlciAodywgdGVtcF94LCAtMSwgdGVtcF95LCBmeSwg dGVtcF9ocG9zLCB0ZW1wX3Zwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAtMSwgY3Vy c29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgIG1jX2JnX2xzbCAodywgdGVtcF9mYWNlX2lkKSwgYWN0aXZlX2N1cnNvcl9wLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgbWluaW1hbF9wLCBNQ19HTFlQSF9UQUIsIHRlbXBfY2hh cnBvcywgcmVzdWx0KTsKKyAgICAgICAgICAgICAgICB0ZW1wX3ggKz0gZnJhbWVfY2hhcl93aWR0 aDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgIC8qIEl0IGlzIHBvc3NpYmxl IHRvIHVzZSBNQ19HTFlQSCBhbmQgYWRqdXN0IHRoZSBmeCBjb29yZGluYXRlOyBob3dldmVyLAor ICAgICAgdGhlIG1pZGRsZS1kb3QgLyBzcGFjZSBnbHlwaCBvbiBhIHdvcmQtd3JhcHBlZCBsaW5l IHdpbGwgYmUgb3ZlcndyaXR0ZW4KKyAgICAgIG51bWVyb3VzIHRpbWVzIGFuZCBpcyB1bnNpZ2h0 bHkuICovCisgICAgICBpZiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+ dXNlZFthcmVhXSAtIDEpCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgX2Z4LCBmeSwgX2gsIF93 ZDsKKyAgICAgICAgICBtY19nZXRfcGh5c19jdXJzb3JfZ2VvbWV0cnkgKHcsIHJvdywgdGVtcF94 LCAmX2Z4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcF95LCAm ZnksIHRlbXBfaHBvcywgdGVtcF92cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJl9oLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCAmX3dkKTsKKyAgICAgICAg ICAvKiB0ZW1wX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOyAqLworICAgICAgICAgIHdoaWxlICh0 ZW1wX3ggPD0gdGV4dF9hcmVhX3dpZHRoKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBt Y19oZWxwZXIgKHcsIHRlbXBfeCwgLTEsIHRlbXBfeSwgZnksIHRlbXBfaHBvcywgdGVtcF92cG9z LAorICAgICAgICAgICAgICAgICAgICAgICAgIC0xLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRo LCBmb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAodywgdGVt cF9mYWNlX2lkKSwgYWN0aXZlX2N1cnNvcl9wLAorICAgICAgICAgICAgICAgICAgICAgICAgIG1p bmltYWxfcCwgTUNfR0xZUEhMRVNTLCB0ZW1wX2NoYXJwb3MsIHJlc3VsdCk7CisgICAgICAgICAg ICAgIHRlbXBfeCArPSBmcmFtZV9jaGF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gb3IganVzdCBvbmUgc3Bh Y2UgaWYgdGhlcmUgYXJlIG5vIGxpbmUgbnVtYmVycy4gKi8KKyAgICAgIGJvb2wgenZfcCA9IChn bHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAg ICAgICAgICAgICAgICAgICYmIE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgPT0gWlYpOwor ICAgICAgYm9vbCBjdXJzb3JfaW5fZnJpbmdlX3AgPSBvcG9pbnRfeCArIGZyYW1lX2NoYXJfd2lk dGggPj0gdGV4dF9hcmVhX3dpZHRoOworICAgICAgaW50IGZsYXZvciA9IChjdXJzb3JfaW5fZnJp bmdlX3AKKyAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkK KyAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAg ICAgICAgICAgICAgICAgOiAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAg ICAgJiYgcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElD QUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9pbl9mcmluZ2Vf cAorICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wCisg ICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAg ICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgIDogKGdseXBoIC0g cm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAg ICAgICAgICAgICAgJiYgb3BvaW50X3ggPiByZWxhdGl2ZV94KQorICAgICAgICAgICAgICAgICAg ICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICA6ICh6dl9wKQorICAgICAgICAg ICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBI X1RBQjsKKyAgICAgIGludCB0ZW1wX3ggPSBvcG9pbnRfeDsKKyAgICAgIGlmIChmbGF2b3IgPT0g TUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZmxhdm9yID09IE1DX1ZF UlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICB8fCBmbGF2b3IgPT0gTUNfVkVSVElDQUxf QkFSKQorICAgICAgICBjdXJzb3JfdHlwZSA9IFJJR0hUX0ZSSU5HRV9CSVRNQVA7CisgICAgICBp bnQgX2Z4LCBfZnksIGgsIF93ZDsKKyAgICAgIG1jX2dldF9waHlzX2N1cnNvcl9nZW9tZXRyeSAo dywgcm93LCB0ZW1wX3gsICZfZngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHRlbXBfeSwgJl9meSwgdGVtcF9ocG9zLCB0ZW1wX3Zwb3MsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICZoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCAmX3dkKTsKKyAg ICAgIGludCBmeCA9IFdJTkRPV19URVhUX1RPX0ZSQU1FX1BJWEVMX1ggKHcsIG9wb2ludF94KTsK KyAgICAgIG1jX2hlbHBlciAodywgdGVtcF94LCBmeCwgdGVtcF95LCAtMSwgdGVtcF9ocG9zLCB0 ZW1wX3Zwb3MsCisgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgs IGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAodywgdGVtcF9mYWNlX2lk KSwgYWN0aXZlX2N1cnNvcl9wLAorICAgICAgICAgICAgICAgICBtaW5pbWFsX3AsIGZsYXZvciwg dGVtcF9jaGFycG9zLCByZXN1bHQpOworICAgICAgYnJlYWs7CisgICAgfQorICB9CisgIH0KKy8q IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg RU5EOiAgU1RSRVRDSF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0gKi8KKworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIEJFR0lOOiAgSU1BR0VfR0xZUEggICAgICAgICAgICAgICAg ICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICBlbHNlIGlmIChnbHlw aC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkKKyAgeworICAgIGlmIChtY19zdGRlcnJfcCkKKyAgICAg IGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQi ZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNkICVzICVjXG4i LAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93 LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICBy ZWxhdGl2ZV94LAorICAgICAgICAnSScsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAg ICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0InCisgICAgICAgICA6IChT VFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICAgIDog KE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICA/ICcwJworICAgICAgICAgICAg ICAgOiAnLScpKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgKHVuc2ln bmVkIGludCkgZ2x5cGgtPnUuaW1nX2lkLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAg ICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5l X3AsCisgICAgICAgIGdseXBoLT54LCBnbHlwaC0+eSwgZ2x5cGgtPmhwb3MsIGdseXBoLT52cG9z LCBnbHlwaC0+enZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAnLicpOworICBzd2l0Y2ggKGFj dGlvbl90eXBlKQorICB7CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAg ICAgICAgICAgICAgIE1VTFRJUExFX0NVUlNPUlM6ICBJTUFHRV9HTFlQSCAgICAgICAgICAgICAg ICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBNVUxUSVBMRV9D VVJTT1JTOgorICA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gICYmIG9wb2lu dF95ID09IGdseXBoLT55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9p bnRfdnBvcyA9PSB0ZW1wX3Zwb3MpOworICAgICAgaW50IF9meCwgZnksIF9oLCBfd2Q7CisgICAg ICBtY19nZXRfcGh5c19jdXJzb3JfZ2VvbWV0cnkgKHcsIHJvdywgdGVtcF94LCAmX2Z4LAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wX3ksICZmeSwgdGVtcF9ocG9zLCB0 ZW1wX3Zwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZfaCwgY3Vyc29y X3R5cGUsIGN1cnNvcl93aWR0aCwgJl93ZCk7CisgICAgICBpZiAodGVtcF94IDw9IHRleHRfYXJl YV93aWR0aAorICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hl bHBlciAodywgdGVtcF94LCAtMSwgdGVtcF95LCBmeSwgdGVtcF9ocG9zLCB0ZW1wX3Zwb3MsCisg ICAgICAgICAgICAgICAgICAgLTEsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91 bmQsCisgICAgICAgICAgICAgICAgICAgbWNfYmdfbHNsICh3LCB0ZW1wX2ZhY2VfaWQpLCBhY3Rp dmVfY3Vyc29yX3AsCisgICAgICAgICAgICAgICAgICAgbWluaW1hbF9wLCBNQ19HTFlQSCwgdGVt cF9jaGFycG9zLCByZXN1bHQpOworICAgICAgLyogSXQgaXMgcG9zc2libGUgdG8gdXNlIE1DX0dM WVBIIGFuZCBhZGp1c3QgdGhlIGZ4IGNvb3JkaW5hdGU7IGhvd2V2ZXIsCisgICAgICB0aGUgbWlk ZGxlLWRvdCAvIHNwYWNlIGdseXBoIG9uIGEgd29yZC13cmFwcGVkIGxpbmUgd2lsbCBiZSBvdmVy d3JpdHRlbgorICAgICAgbnVtZXJvdXMgdGltZXMgYW5kIGlzIHVuc2lnaHRseS4gKi8KKyAgICAg IGlmIChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0g MSkKKyAgICAgICAgeworICAgICAgICAgIGludCBfZngsIGZ5LCBfaCwgX3dkOworICAgICAgICAg IG1jX2dldF9waHlzX2N1cnNvcl9nZW9tZXRyeSAodywgcm93LCB0ZW1wX3gsICZfZngsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wX3ksICZmeSwgdGVtcF9ocG9z LCB0ZW1wX3Zwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmX2gs IGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsICZfd2QpOworICAgICAgICAgIHRlbXBfeCArPSBn bHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgd2hpbGUgKHRlbXBfeCA8PSB0ZXh0X2FyZWFf d2lkdGgpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIG1jX2hlbHBlciAodywgdGVtcF94 LCAtMSwgdGVtcF95LCBmeSwgdGVtcF9ocG9zLCB0ZW1wX3Zwb3MsCisgICAgICAgICAgICAgICAg ICAgICAgICAgLTEsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsCisgICAg ICAgICAgICAgICAgICAgICAgICAgbWNfYmdfbHNsICh3LCB0ZW1wX2ZhY2VfaWQpLCBhY3RpdmVf Y3Vyc29yX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgbWluaW1hbF9wLCBNQ19HTFlQSExF U1MsIHRlbXBfY2hhcnBvcywgcmVzdWx0KTsKKyAgICAgICAgICAgICAgdGVtcF94ICs9IGZyYW1l X2NoYXJfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAg IH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgJiYg TUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSA9PSBaVik7CisgICAgICBib29sIGN1cnNvcl9p bl9mcmluZ2VfcCA9IG9wb2ludF94ICsgZnJhbWVfY2hhcl93aWR0aCA+PSB0ZXh0X2FyZWFfd2lk dGg7CisgICAgICBpbnQgZmxhdm9yID0gKGN1cnNvcl9pbl9mcmluZ2VfcAorICAgICAgICAgICAg ICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAg ICAgPyBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICA6IChj dXJzb3JfaW5fZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPmNvbnRpbnVl ZF9wKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisg ICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAg ICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3AKKyAgICAgICAgICAgICAgICAgICAg ICAmJiAhcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElD QUxfQkFSCisgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FS RUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9p bnRfeCA+IHJlbGF0aXZlX3gpCisgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUwor ICAgICAgICAgICAgICAgICAgIDogKHp2X3ApCisgICAgICAgICAgICAgICAgICAgICA/IE1DX0dM WVBITEVTUworICAgICAgICAgICAgICAgICAgIDogTUNfR0xZUEg7CisgICAgICBpZiAoZmxhdm9y ID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGZsYXZvciA9PSBN Q19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgfHwgZmxhdm9yID09IE1DX1ZFUlRJ Q0FMX0JBUikKKyAgICAgICAgY3Vyc29yX3R5cGUgPSBSSUdIVF9GUklOR0VfQklUTUFQOworICAg ICAgaW50IF9meCwgX2Z5LCBoLCBfd2Q7CisgICAgICBtY19nZXRfcGh5c19jdXJzb3JfZ2VvbWV0 cnkgKHcsIHJvdywgdGVtcF94LCAmX2Z4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICB0ZW1wX3ksICZfZnksIHRlbXBfaHBvcywgdGVtcF92cG9zLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgJl93ZCk7 CisgICAgICBpbnQgZnggPSBXSU5ET1dfVEVYVF9UT19GUkFNRV9QSVhFTF9YICh3LCBvcG9pbnRf eCk7CisgICAgICBtY19oZWxwZXIgKHcsIHRlbXBfeCwgZngsIHRlbXBfeSwgLTEsIHRlbXBfaHBv cywgdGVtcF92cG9zLAorICAgICAgICAgICAgICAgICBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dp ZHRoLCBmb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICBtY19iZ19sc2wgKHcsIHRlbXBfZmFj ZV9pZCksIGFjdGl2ZV9jdXJzb3JfcCwKKyAgICAgICAgICAgICAgICAgbWluaW1hbF9wLCBmbGF2 b3IsIHRlbXBfY2hhcnBvcywgcmVzdWx0KTsKKyAgICAgIGJyZWFrOworICAgIH0KKyAgfQorICB9 CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBFTkQ6ICBJTUFHRV9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyog LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tICovCisKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAg ICAgICAgICAgICAgICAgICAgICAgICAgQkVHSU46ICBDT01QT1NJVEVfR0xZUEggICAgICAgICAg ICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgZWxzZSBpZiAo Z2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKQorICB7CisgICAgaWYgKG1jX3N0ZGVycl9w KQorICAgICAgeworICAgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICAgIlxuICU1InBE ImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4IiwKKyAgICAgICAgICBnbHlwaCAt IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0g MCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgICAgcmVsYXRpdmVfeCwKKyAg ICAgICAgICAnKycsCisgICAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgICAgKEJVRkZF UlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgID8gJ0InCisgICAgICAgICAgIDogKFNUUklO R1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICAgIDog KE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAg ICAgICAgIDogJy0nKSkpLAorICAgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAg ICAodW5zaWduZWQgaW50KSBnbHlwaC0+dS5jbXAuaWQpOworICAgICAgICBmcHJpbnRmIChzdGRl cnIsICIgJTRkICUxLjFkJTEuMWQiLAorICAgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAg ICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9s aW5lX3ApOworICAgICAgaWYgKGdseXBoLT51LmNtcC5hdXRvbWF0aWMpCisgICAgICAgIGZwcmlu dGYgKHN0ZGVyciwgIiAlNWQgJTRkICAlM2QgICUzZCAlcyAuIFslZC0lZF1cbiIsCisgICAgICAg ICAgICAgICAgICAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgZ2x5cGgt PnZwb3MsIGdseXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICAgICAgICAgICAgICAg ICAgZ2x5cGgtPnNsaWNlLmNtcC5mcm9tLCBnbHlwaC0+c2xpY2UuY21wLnRvKTsKKyAgICAgICAg ZWxzZQorICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIlxuIik7CisgICAgICB9CisgIHN3aXRj aCAoYWN0aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAg ICAgICAgICAgICAgICAgIE1VTFRJUExFX0NVUlNPUlM6ICBDT01QT1NJVEVfR0xZUEggICAgICAg ICAgICA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mVhbF9mYWtlX2N1cnNvcl9wID0gKG9wb2ludF94 ID09IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2lu dF9ocG9zID09IHRlbXBfaHBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg b3BvaW50X3kgPT0gZ2x5cGgtPnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IG9wb2ludF92cG9zID09IHRlbXBfdnBvcyk7CisgICAgICBpbnQgX2Z4LCBmeSwgX2gsIF93ZDsK KyAgICAgIG1jX2dldF9waHlzX2N1cnNvcl9nZW9tZXRyeSAodywgcm93LCB0ZW1wX3gsICZfZngs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBfeSwgJmZ5LCB0ZW1wX2hw b3MsIHRlbXBfdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJl9oLCBj dXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCAmX3dkKTsKKyAgICAgIGlmICh0ZW1wX3ggPD0gdGV4 dF9hcmVhX3dpZHRoCisgICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAg bWNfaGVscGVyICh3LCB0ZW1wX3gsIC0xLCB0ZW1wX3ksIGZ5LCB0ZW1wX2hwb3MsIHRlbXBfdnBv cywKKyAgICAgICAgICAgICAgICAgICAtMSwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9y ZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgICBtY19iZ19sc2wgKHcsIHRlbXBfZmFjZV9pZCks IGFjdGl2ZV9jdXJzb3JfcCwKKyAgICAgICAgICAgICAgICAgICBtaW5pbWFsX3AsIE1DX0dMWVBI LCB0ZW1wX2NoYXJwb3MsIHJlc3VsdCk7CisgICAgICAvKiBJdCBpcyBwb3NzaWJsZSB0byB1c2Ug TUNfR0xZUEggYW5kIGFkanVzdCB0aGUgZnggY29vcmRpbmF0ZTsgaG93ZXZlciwKKyAgICAgIHRo ZSBtaWRkbGUtZG90IC8gc3BhY2UgZ2x5cGggb24gYSB3b3JkLXdyYXBwZWQgbGluZSB3aWxsIGJl IG92ZXJ3cml0dGVuCisgICAgICBudW1lcm91cyB0aW1lcyBhbmQgaXMgdW5zaWdodGx5LiAqLwor ICAgICAgaWYgKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJl YV0gLSAxKQorICAgICAgICB7CisgICAgICAgICAgaW50IF9meCwgZnksIF9oLCBfd2Q7CisgICAg ICAgICAgbWNfZ2V0X3BoeXNfY3Vyc29yX2dlb21ldHJ5ICh3LCByb3csIHRlbXBfeCwgJl9meCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBfeSwgJmZ5LCB0ZW1w X2hwb3MsIHRlbXBfdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICZfaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgJl93ZCk7CisgICAgICAgICAgdGVtcF94 ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICB3aGlsZSAodGVtcF94IDw9IHRleHRf YXJlYV93aWR0aCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbWNfaGVscGVyICh3LCB0 ZW1wX3gsIC0xLCB0ZW1wX3ksIGZ5LCB0ZW1wX2hwb3MsIHRlbXBfdnBvcywKKyAgICAgICAgICAg ICAgICAgICAgICAgICAtMSwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwK KyAgICAgICAgICAgICAgICAgICAgICAgICBtY19iZ19sc2wgKHcsIHRlbXBfZmFjZV9pZCksIGFj dGl2ZV9jdXJzb3JfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBtaW5pbWFsX3AsIE1DX0dM WVBITEVT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RvIGBpdC0+bG51bV9waXhlbF93aWR0aGAg LyBmcmFtZV9jaGFyX3dpZHRoLAorICAgICAgIG9yIGp1c3Qgb25lIHNwYWNlIGlmIHRoZXJlIGFy ZSBubyBsaW5lIG51bWJlcnMuICovCisgICAgICBib29sIHp2X3AgPSAoZ2x5cGggLSByb3ctPmds eXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAg ICAmJiBNQVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpID09IFpWKTsKKyAgICAgIGJvb2wgY3Vy c29yX2luX2ZyaW5nZV9wID0gb3BvaW50X3ggKyBmcmFtZV9jaGFyX3dpZHRoID49IHRleHRfYXJl YV93aWR0aDsKKyAgICAgIGludCBmbGF2b3IgPSAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAg ICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAg ICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAg IDogKGN1cnNvcl9pbl9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+Y29u dGludWVkX3ApCisgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xB U0gKKyAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAgICAgICAg ICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcAorICAgICAgICAgICAgICAg ICAgICAgICYmICFyb3ctPmNvbnRpbnVlZF9wKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19W RVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICA6IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RF WFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICYm IG9wb2ludF94ID4gcmVsYXRpdmVfeCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhM RVNTCisgICAgICAgICAgICAgICAgICAgOiAoenZfcCkKKyAgICAgICAgICAgICAgICAgICAgID8g TUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIGlmIChm bGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZmxhdm9y ID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICB8fCBmbGF2b3IgPT0gTUNf VkVSVElDQUxfQkFSKQorICAgICAgICBjdXJzb3JfdHlwZSA9IFJJR0hUX0ZSSU5HRV9CSVRNQVA7 CisgICAgICBpbnQgX2Z4LCBfZnksIGgsIF93ZDsKKyAgICAgIG1jX2dldF9waHlzX2N1cnNvcl9n ZW9tZXRyeSAodywgcm93LCB0ZW1wX3gsICZfZngsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHRlbXBfeSwgJl9meSwgdGVtcF9ocG9zLCB0ZW1wX3Zwb3MsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICZoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCAm X3dkKTsKKyAgICAgIGludCBmeCA9IFdJTkRPV19URVhUX1RPX0ZSQU1FX1BJWEVMX1ggKHcsIG9w b2ludF94KTsKKyAgICAgIG1jX2hlbHBlciAodywgdGVtcF94LCBmeCwgdGVtcF95LCAtMSwgdGVt cF9ocG9zLCB0ZW1wX3Zwb3MsCisgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl90eXBlLCBjdXJz b3Jfd2lkdGgsIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAodywgdGVt cF9mYWNlX2lkKSwgYWN0aXZlX2N1cnNvcl9wLAorICAgICAgICAgICAgICAgICBtaW5pbWFsX3As IGZsYXZvciwgdGVtcF9jaGFycG9zLCByZXN1bHQpOworICAgICAgYnJlYWs7CisgICAgfQorICB9 CisgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBFTkQ6ICBDT01QT1NJVEVfR0xZUEggICAgICAgICAgICAgICAgICAgICAgICAgICov CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisv KiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQkVHSU46ICBYV0lER0VUX0dMWVBIICAgICAg ICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICBlbHNl IGlmIChnbHlwaC0+dHlwZSA9PSBYV0lER0VUX0dMWVBIKQorICB7CisjaWZuZGVmIEhBVkVfWFdJ REdFVFMKKyAgICBlYXNzdW1lIChmYWxzZSk7CisjZWxzZQorICAgIGlmIChtY19zdGRlcnJfcCkK KyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIlxuICAlNWQvJS01ZCAlNWQgJTRjICU2 ZCAlYyAlM2QgMHglMDV4ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNkICVzICVjXG4i LAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93 LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICBy ZWxhdGl2ZV94LAorICAgICAgICAnWCcsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAg ICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0InCisgICAgICAgICA6IChT VFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICAgIDog Jy0nKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgZ2x5cGgtPmZhY2Vf aWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdo dF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+dS54d2lkZ2V0LAorICAgICAgICBnbHlwaC0+ eCwgZ2x5cGgtPnksIGdseXBoLT5ocG9zLCBnbHlwaC0+dnBvcywgZ2x5cGgtPnp2X3AgPyAiWlYi IDogIi0tIiwKKyAgICAgICAgJy4nKTsKKyNlbmRpZgorICBzd2l0Y2ggKGFjdGlvbl90eXBlKQor ICB7CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAg TVVMVElQTEVfQ1VSU09SUzogIFhXSURHRVRfR0xZUEggICAgICAgICAgICAgICAgICAgICAqLwor LyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBNVUxUSVBMRV9DVVJTT1JTOgorICAg IHsKKyAgICAgIG1jX2hlbHBlciAodywgdGVtcF94LCAtMSwgdGVtcF95LCAtMSwgdGVtcF9ocG9z LCB0ZW1wX3Zwb3MsCisgICAgICAgICAgICAgICAgIC0xLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dp ZHRoLCBmb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICBtY19iZ19sc2wgKHcsIHRlbXBfZmFj ZV9pZCksIGFjdGl2ZV9jdXJzb3JfcCwKKyAgICAgICAgICAgICAgICAgbWluaW1hbF9wLCBNQ19H TFlQSCwgdGVtcF9jaGFycG9zLCByZXN1bHQpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgIEhPUklaT05UQUxf UlVMRVI6ICBYV0lER0VUX0dMWVBIICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLSAqLworICAgIGNhc2UgSE9SSVpPTlRBTF9SVUxFUjoKKyAgICB7CisgICAgICBp bnQgdGVtcF92cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIHctPmN1cnJlbnRfbWF0cml4KTsK KyAgICAgIGludCB0ZW1wX2hwb3MgPSBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07Cisg ICAgICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9IChvcG9pbnRfeCA9PSByZWxhdGl2ZV94Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfaHBvcyA9PSB0ZW1wX2hw b3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF95ID09IGdseXBo LT55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfdnBvcyA9PSB0 ZW1wX3Zwb3MpOworICAgICAgaW50IF9meCwgZnksIF9oLCBfd2Q7CisgICAgICBtY19nZXRfcGh5 c19jdXJzb3JfZ2VvbWV0cnkgKHcsIHJvdywgdGVtcF94LCAmX2Z4LAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICB0ZW1wX3ksICZmeSwgdGVtcF9ocG9zLCB0ZW1wX3Zwb3MsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZfaCwgY3Vyc29yX3R5cGUsIGN1cnNv cl93aWR0aCwgJl93ZCk7CisgICAgICBpZiAodGVtcF94IDw9IHRleHRfYXJlYV93aWR0aAorICAg ICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgdGVt cF94LCAtMSwgdGVtcF95LCBmeSwgdGVtcF9ocG9zLCB0ZW1wX3Zwb3MsCisgICAgICAgICAgICAg ICAgICAgLTEsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsCisgICAgICAg ICAgICAgICAgICAgbWNfYmdfbHNsICh3LCB0ZW1wX2ZhY2VfaWQpLCBhY3RpdmVfY3Vyc29yX3As CisgICAgICAgICAgICAgICAgICAgbWluaW1hbF9wLCBNQ19HTFlQSCwgdGVtcF9jaGFycG9zLCBy ZXN1bHQpOworICAgICAgLyogSXQgaXMgcG9zc2libGUgdG8gdXNlIE1DX0dMWVBIIGFuZCBhZGp1 c3QgdGhlIGZ4IGNvb3JkaW5hdGU7IGhvd2V2ZXIsCisgICAgICB0aGUgbWlkZGxlLWRvdCAvIHNw YWNlIGdseXBoIG9uIGEgd29yZC13cmFwcGVkIGxpbmUgd2lsbCBiZSBvdmVyd3JpdHRlbgorICAg ICAgbnVtZXJvdXMgdGltZXMgYW5kIGlzIHVuc2lnaHRseS4gKi8KKyAgICAgIGlmIChnbHlwaCAt IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMSkKKyAgICAgICAg eworICAgICAgICAgIGludCBfZngsIGZ5LCBfaCwgX3dkOworICAgICAgICAgIG1jX2dldF9waHlz X2N1cnNvcl9nZW9tZXRyeSAodywgcm93LCB0ZW1wX3gsICZfZngsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICB0ZW1wX3ksICZmeSwgdGVtcF9ocG9zLCB0ZW1wX3Zwb3Ms CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmX2gsIGN1cnNvcl90eXBl LCBjdXJzb3Jfd2lkdGgsICZfd2QpOworICAgICAgICAgIHRlbXBfeCArPSBnbHlwaC0+cGl4ZWxf d2lkdGg7CisgICAgICAgICAgd2hpbGUgKHRlbXBfeCA8PSB0ZXh0X2FyZWFfd2lkdGgpCisgICAg ICAgICAgICB7CisgICAgICAgICAgICAgIG1jX2hlbHBlciAodywgdGVtcF94LCAtMSwgdGVtcF95 LCBmeSwgdGVtcF9ocG9zLCB0ZW1wX3Zwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgLTEs IGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAg ICAgICAgICAgbWNfYmdfbHNsICh3LCB0ZW1wX2ZhY2VfaWQpLCBhY3RpdmVfY3Vyc29yX3AsCisg ICAgICAgICAgICAgICAgICAgICAgICAgbWluaW1hbF9wLCBNQ19HTFlQSExFU1MsIHRlbXBfY2hh cnBvcywgcmVzdWx0KTsKKyAgICAgICAgICAgICAgdGVtcF94ICs9IGZyYW1lX2NoYXJfd2lkdGg7 CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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YVF9BUkVBXSA9 PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgJiYgTUFUUklYX1JPV19F TkRfQ0hBUlBPUyAocm93KSA9PSBaVik7CisgICAgICBib29sIGN1cnNvcl9pbl9mcmluZ2VfcCA9 IG9wb2ludF94ICsgZnJhbWVfY2hhcl93aWR0aCA+PSB0ZXh0X2FyZWFfd2lkdGg7CisgICAgICBp bnQgZmxhdm9yID0gKGN1cnNvcl9pbl9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAmJiBy b3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJU SUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfaW5fZnJp bmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPmNvbnRpbnVlZF9wKQorICAgICAg ICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgICAg ICAgICAgOiAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgIXJv dy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT5j b250aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAg ICAgICAgICAgICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+ dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeCA+IHJlbGF0 aXZlX3gpCisgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAg ICAgICAgIDogKHp2X3ApCisgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAg ICAgICAgICAgICAgICAgIDogTUNfR0xZUEg7CisgICAgICBpZiAoZmxhdm9yID09IE1DX1ZFUlRJ Q0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGZsYXZvciA9PSBNQ19WRVJUSUNBTF9C QVJfQkFDS1NMQVNICisgICAgICAgICAgfHwgZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUikKKyAg ICAgICAgY3Vyc29yX3R5cGUgPSBSSUdIVF9GUklOR0VfQklUTUFQOworICAgICAgaW50IF9meCwg X2Z5LCBoLCBfd2Q7CisgICAgICBtY19nZXRfcGh5c19jdXJzb3JfZ2VvbWV0cnkgKHcsIHJvdywg dGVtcF94LCAmX2Z4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wX3ks ICZfZnksIHRlbXBfaHBvcywgdGVtcF92cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgJl93ZCk7CisgICAgICBpbnQg ZnggPSBXSU5ET1dfVEVYVF9UT19GUkFNRV9QSVhFTF9YICh3LCBvcG9pbnRfeCk7CisgICAgICBt Y19oZWxwZXIgKHcsIHRlbXBfeCwgZngsIHRlbXBfeSwgLTEsIHRlbXBfaHBvcywgdGVtcF92cG9z LAorICAgICAgICAgICAgICAgICBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3Jv dW5kLAorICAgICAgICAgICAgICAgICBtY19iZ19sc2wgKHcsIHRlbXBfZmFjZV9pZCksIGFjdGl2 ZV9jdXJzb3JfcCwKKyAgICAgICAgICAgICAgICAgbWluaW1hbF9wLCBmbGF2b3IsIHRlbXBfY2hh cnBvcywgcmVzdWx0KTsKKyAgICAgIGJyZWFrOworICAgIH0KKyAgfQorICB9CisvKiAtLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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AoZiwgZmlsbF9mYWNlX2lkKTsKKyAgTGlz cF9PYmplY3QgZmlsbF9jb2xvciA9IGZpbGxfZmFjZS0+bGZhY2VbTEZBQ0VfRk9SRUdST1VORF9J TkRFWF07CisgIENIRUNLX1NUUklORyAoZmlsbF9jb2xvcik7CisgIExpc3BfT2JqZWN0IGZpbGxf Y29sb3JfdmVjdG9yID0gbWNfY29sb3JfdmVjdG9yX2NhbGMgKHcsIGZpbGxfY29sb3IpOworICAv KiBGSVhNRTogIFB1dCBpbiBzb21lIGNvZGUgdG8gZGVmYXVsdCB0byBIT0xMT1dfQk9YX0NVUlNP UiBpZiB0aGUgdXNlciBoYXMKKyAgdW53aXR0aW5nbHkgY29tZSB1cCB3aXRoIHNvbWUgdW5hY2Nl cHRhYmxlIGZvcm0gb2YgdW5yZWNvZ25pemVkIGN1cnNvciB0eXBlLiAqLworICBMaXNwX09iamVj dCBjdXJzb3JfbGlzcF90eXBlID0gQlZBUiAoYiwgbWNfcmVhbF9mYWtlX2N1cnNvcik7CisgIGVu dW0gdGV4dF9jdXJzb3Jfa2luZHMgdGVtcF9jdXJzb3JfdHlwZSA9IChDT05TUCAoY3Vyc29yX2xp c3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKFhDQVIgKGN1cnNvcl9saXNwX3R5cGUpKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBtY19saXNwX3RvX2N1cnNv cl90eXBlIChjdXJzb3JfbGlzcF90eXBlKTsKKyAgaW50IHRlbXBfY3Vyc29yX3dpZHRoID0gKENP TlNQIChjdXJzb3JfbGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgID8gWElO VCAoWENBUiAoWENEUiAoY3Vyc29yX2xpc3BfdHlwZSkpKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAxOworICBlbnVtIGZhY2VfaWQgY3Vyc29yX2ZhY2VfaWQgPQorICAgICghYWN0aXZl X2N1cnNvcl9wCisgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNy b3NzaGFpcnNfaW5hY3RpdmVfd2luZG93cykpKQorICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcs IGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1mYWNlIiksIHRydWUpCisg ICAgOiBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29y LWZhY2UiKSwgdHJ1ZSk7CisgIHN0cnVjdCBmYWNlICpjdXJzb3JfZmFjZSA9IEZBQ0VfRlJPTV9J RCAoZiwgY3Vyc29yX2ZhY2VfaWQpOworICBMaXNwX09iamVjdCBjdXJzb3JfY29sb3IgPSBjdXJz b3JfZmFjZS0+bGZhY2VbTEZBQ0VfRk9SRUdST1VORF9JTkRFWF07CisgIENIRUNLX1NUUklORyAo Y3Vyc29yX2NvbG9yKTsKKyAgY3VycmVudF9jb2wgPSBtY19jdXJyZW50X2NvbHVtbiAodywgb3Bv aW50X3B0KTsKKyAgLyogcmVkICovCisgIGlmIChjdXJyZW50X2NvbCAlIDIgIT0gMAorICAgICAg JiYgIWZpbGxfY29sdW1uX3ApCisgICAgZm9yZWdyb3VuZCA9IG9kZF9jb2xvcl92ZWN0b3I7Cisg IC8qIHllbGxvdyAqLworICBpZiAoY3VycmVudF9jb2wgJSAyID09IDAKKyAgICAgICYmICFmaWxs X2NvbHVtbl9wKQorICAgIGZvcmVncm91bmQgPSBldmVuX2NvbG9yX3ZlY3RvcjsKKyAgLyogcmVk ICovCisgIGlmIChjdXJyZW50X2NvbCAlIDIgIT0gMAorICAgICAgJiYgZmlsbF9jb2x1bW5fcAor ICAgICAgJiYgY3VycmVudF9jb2wgPD0gZmlsbF9jb2wpCisgICAgZm9yZWdyb3VuZCA9IG9kZF9j b2xvcl92ZWN0b3I7CisgIC8qIHllbGxvdyAqLworICBpZiAoY3VycmVudF9jb2wgJSAyID09IDAK KyAgICAgICYmIGZpbGxfY29sdW1uX3AKKyAgICAgICYmIGN1cnJlbnRfY29sIDw9IGZpbGxfY29s KQorICAgIGZvcmVncm91bmQgPSBldmVuX2NvbG9yX3ZlY3RvcjsKKyAgLyogZ3JlZW4gKi8KKyAg aWYgKGZpbGxfY29sdW1uX3AKKyAgICAgICYmIGN1cnJlbnRfY29sID4gZmlsbF9jb2wpCisgICAg Zm9yZWdyb3VuZCA9IGZpbGxfY29sb3JfdmVjdG9yOworICBMaXNwX09iamVjdCBjdXJzb3JfZmcg PSAoYWN0aXZlX2N1cnNvcl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICA/IGZvcmVncm91 bmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgOiBtY19jb2xvcl92ZWN0b3JfY2FsYyAodywg Y3Vyc29yX2NvbG9yKTsKKyAgc3RydWN0IGdseXBoICpjdXJzb3JfZ2x5cGggPQorICAgICAgICAg ICAgbWNfZ2V0X3BoeXNfY3Vyc29yX2dseXBoICh3LCBvcG9pbnRfeCwgb3BvaW50X2hwb3MsIG9w b2ludF92cG9zKTsKKyAgbWNfaGVscGVyICh3LCBvcG9pbnRfeCwgLTEsIG9wb2ludF95LCAtMSwg b3BvaW50X2hwb3MsIG9wb2ludF92cG9zLAorICAgICAgICAgICAgIC0xLCB0ZW1wX2N1cnNvcl90 eXBlLCB0ZW1wX2N1cnNvcl93aWR0aCwgY3Vyc29yX2ZnLAorICAgICAgICAgICAgIG1jX2JnX2xz bCAodywgY3Vyc29yX2dseXBoLT5mYWNlX2lkKSwgYWN0aXZlX2N1cnNvcl9wLAorICAgICAgICAg ICAgIG1pbmltYWxfcCwgTUNfR0xZUEgsIG9wb2ludF9wdCwgJnJlc3VsdCk7CisvKiAtLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgRFJBVyAvIFJFQ09SRCBN VUxUSVBMRSBDVVJTT1JTICAgICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tICovCisgIGZvciAodmxpc3QgPSBCVkFSIChiLCBtdWx0aXBsZV9jdXJzb3JzX2NvbmYp OworICAgICAgIENPTlNQICh2bGlzdCk7CisgICAgICAgdmxpc3QgPSBYQ0RSICh2bGlzdCkpCisg ICAgeworICAgICAgc3BlY3MgPSBYQ0FSICh2bGlzdCk7CisgICAgICBwb3NpbnQgPSBYSU5UIChG bnRoIChtYWtlX251bWJlciAoMCksIHNwZWNzKSk7CisgICAgICBsaXNwX3R5cGUgPSBGbnRoICht YWtlX251bWJlciAoMSksIHNwZWNzKTsKKyAgICAgIGlmIChDT05TUCAobGlzcF90eXBlKSkKKyAg ICAgICAgY3Vyc29yX3R5cGUgPSBtY19saXNwX3RvX2N1cnNvcl90eXBlIChYQ0FSIChsaXNwX3R5 cGUpKTsKKyAgICAgICAgZWxzZQorICAgICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19j dXJzb3JfdHlwZSAobGlzcF90eXBlKTsKKyAgICAgIGlmIChDT05TUCAobGlzcF90eXBlKSkKKyAg ICAgICAgY3Vyc29yX3dpZHRoID0gWElOVCAoWENBUiAoWENEUiAobGlzcF90eXBlKSkpOworICAg ICAgICBlbHNlCisgICAgICAgICAgY3Vyc29yX3dpZHRoID0gMTsKKyAgICAgIGZvcmVncm91bmQg PSBGbnRoIChtYWtlX251bWJlciAoMiksIHNwZWNzKTsKKyAgICAgIGlmIChTVFJJTkdQIChmb3Jl Z3JvdW5kKSkKKyAgICAgICAgZm9yZWdyb3VuZCA9IG1jX2NvbG9yX3ZlY3Rvcl9jYWxjICh3LCBm b3JlZ3JvdW5kKTsKKyAgICAgIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJl bnRfbWF0cml4OworICAgICAgaW50IHJvd19zdGFydCwgcm93X2VuZCwgd2luZG93X3Jvd19zdGFy dCwgd2luZG93X3Jvd19lbmQ7CisgICAgICBpbnQgaTsKKyAgICAgIExpc3BfT2JqZWN0IHRlbXAg PSBRbmlsOworICAgICAgTGlzcF9PYmplY3QgdnNwZWNzID0gUW5pbDsKKyAgICAgIGZvciAoaSA9 IDA7IGkgPCBtYXRyaXgtPm5yb3dzOyArK2kpCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3Qg Z2x5cGhfcm93ICpyb3cgPSBNQVRSSVhfUk9XIChtYXRyaXgsIGkpOworICAgICAgICAgIHJvd19z dGFydCA9IE1BVFJJWF9ST1dfU1RBUlRfQ0hBUlBPUyAocm93KTsKKyAgICAgICAgICBpZiAoKGhl YWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgaSA9PSAxKQorICAgICAgICAgICAgICAgfHwgKGhlYWRl cl9saW5lX2Zvcm1hdCA9PSAwICYmIGkgPT0gMCkpCisgICAgICAgICAgICB3aW5kb3dfcm93X3N0 YXJ0ID0gcm93X3N0YXJ0OworICAgICAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIHdpbmRvd19yb3dfZW5kID0gcm93X2VuZDsKKyAgICAgICAg ICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICByb3dfZW5kID0gTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAo cm93KTsKKyAgICAgICAgICAgICAgICB0ZW1wID0gbGlzdG4gKENPTlNUWVBFX0hFQVAsIDMsIG1h a2VfbnVtYmVyIChpKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIG1ha2VfbnVtYmVyIChyb3dfc3RhcnQpLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgbWFrZV9udW1iZXIgKHJvd19lbmQpKTsKKyAgICAgICAg ICAgICAgICB2c3BlY3MgPSBGY29ucyAodGVtcCwgdnNwZWNzKTsKKyAgICAgICAgICAgICAgfQor ICAgICAgICB9CisgICAgICBpZiAocG9zaW50ID49IHdpbmRvd19yb3dfc3RhcnQKKyAgICAgICAg ICAmJiBwb3NpbnQgPD0gd2luZG93X3Jvd19lbmQpCisgICAgICAgIHsKKyAgICAgICAgTGlzcF9P YmplY3Qgdmxpc3Q7CisgICAgICAgIGZvciAodmxpc3QgPSBGbnJldmVyc2UgKHZzcGVjcyk7Cisg ICAgICAgICAgICAgQ09OU1AgKHZsaXN0KTsKKyAgICAgICAgICAgICB2bGlzdCA9IFhDRFIgKHZs aXN0KSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpbnQgY291bnQgPSBYSU5UIChGbnRoICht YWtlX251bWJlciAoMCksIFhDQVIgKHZsaXN0KSkpOworICAgICAgICAgICAgaW50IHBvc19zdGFy dCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgxKSwgWENBUiAodmxpc3QpKSk7CisgICAgICAg ICAgICBpbnQgcG9zX2VuZCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgWENBUiAodmxp c3QpKSk7CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cgPSBNQVRSSVhfUk9XICh3 LT5jdXJyZW50X21hdHJpeCwgY291bnQpOworICAgICAgICAgICAgaW50IGFyZWE7CisgICAgICAg ICAgICBpbnQgcmVsYXRpdmVfeCA9IDA7CisgICAgICAgICAgICBmb3IgKGFyZWEgPSBMRUZUX01B UkdJTl9BUkVBOyBhcmVhIDwgTEFTVF9BUkVBOyArK2FyZWEpCisgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoID0gcm93LT5nbHlwaHNbYXJlYV07Cisg ICAgICAgICAgICAgICAgc3RydWN0IGdseXBoICpnbHlwaF9lbmQgPSBnbHlwaCArIHJvdy0+dXNl ZFthcmVhXTsKKyAgICAgICAgICAgICAgICBpZiAoYXJlYSA9PSBURVhUX0FSRUEgJiYgZ2x5cGgg PT0gZ2x5cGhfZW5kICYmIGdseXBoLT5jaGFycG9zID4gMCkKKyAgICAgICAgICAgICAgICAgICsr Z2x5cGhfZW5kOworICAgICAgICAgICAgICAgIGlmIChtY19zdGRlcnJfcAorICAgICAgICAgICAg ICAgICAgICAmJiBnbHlwaCA8IGdseXBoX2VuZCkKKyAgICAgICAgICAgICAgICAgIGZwcmludGYg KHN0ZGVyciwKKyJcbmNvdW50ICglZCkgfCB3aW5kb3dfcm93X3N0YXJ0L2VuZCAoJWQvJWQpIHwg cm93X3N0YXJ0L2VuZCAoJWQvJWQpXG5cCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09IE1V TFRJUExFIENVUlNPUlMgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG5cCitHbHlw aCMvVG90YWwgUmVsLlggVCAgICAgICBQb3MgTyAgIFcgICAgIENvZGUgRmFjZSBMUiAgICAgWCAg ICBZIEhQT1MgVlBPUyBaViBDXG4iLAorY291bnQsIHdpbmRvd19yb3dfc3RhcnQsIHdpbmRvd19y b3dfZW5kLCBwb3Nfc3RhcnQsIHBvc19lbmQpOworICAgICAgICAgICAgICAgIGZvciAoOyBnbHlw aCA8IGdseXBoX2VuZDsgKytnbHlwaCkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICAgICAgaWYgKCgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiBjb3VudCA+IDApCisgICAg ICAgICAgICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAg ICAgICAgICAgICAgICAgICAmJiBnbHlwaC0+Y2hhcnBvcyA9PSBwb3NpbnQKKyAgICAgICAgICAg ICAgICAgICAgICAgICYmIGdseXBoLT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KSkKKyAg ICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50X2Nv bCA9IG1jX2N1cnJlbnRfY29sdW1uICh3LCBwb3NpbnQpOworICAgICAgICAgICAgICAgICAgICAg ICAgaWYgKE5JTFAgKGZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogcmVkICovCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgaWYgKGN1cnJlbnRfY29sICUgMiAhPSAwCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmICFmaWxsX2NvbHVtbl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgZm9yZWdyb3VuZCA9IG9kZF9jb2xvcl92ZWN0b3I7CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgLyogeWVsbG93ICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnJl bnRfY29sICUgMiA9PSAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFmaWxs X2NvbHVtbl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZCA9IGV2 ZW5fY29sb3JfdmVjdG9yOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHJlZCAqLwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjdXJyZW50X2NvbCAlIDIgIT0gMAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBmaWxsX2NvbHVtbl9wCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnJlbnRfY29sIDw9IGZpbGxfY29sKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZCA9IG9kZF9jb2xvcl92ZWN0b3I7Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogeWVsbG93ICovCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgaWYgKGN1cnJlbnRfY29sICUgMiA9PSAwCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIGZpbGxfY29sdW1uX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgY3VycmVudF9jb2wgPD0gZmlsbF9jb2wpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBmb3JlZ3JvdW5kID0gZXZlbl9jb2xvcl92ZWN0b3I7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgLyogZ3JlZW4gKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAo ZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJyZW50 X2NvbCA+IGZpbGxfY29sKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3Vu ZCA9IGZpbGxfY29sb3JfdmVjdG9yOworICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAg ICAgICAgICAgICAgICAgICAgICBtY19lbmdpbmUgKHJvdywgZ2x5cGgsIGFyZWEsIHJlbGF0aXZl X3gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcsIHBvc2ludCwgY3Vyc29y X3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYWN0aXZlX2N1cnNvcl9wLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtaW5pbWFsX3AsIE1VTFRJUExFX0NVUlNPUlMs ICZyZXN1bHQpOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAg ICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKG1jX3N0ZGVycl9wKQor ICAgICAgICAgICAgICAgICAgICAgICAgbWNfZHVtcF9nbHlwaCAocm93LCBnbHlwaCwgYXJlYSwg cmVsYXRpdmVfeCk7CisgICAgICAgICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBp eGVsX3dpZHRoOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICB9CisgICAgICAg ICAgfQorICAgICAgICB9CisgICAgfQorLyogYHctPm11bHRpcGxlX2N1cnNvcnNfY2FjaGUnIGlz IHNldCBmb3IgdGhlIHdpbmRvdywgbm90IGJ1ZmZlcit3aW5kb3cgLS0gaS5lLiwgYWxsIGJ1ZmZl cnMgYXBwZWFyaW5nCitpbiB0aGUgc2FtZSB3aW5kb3cgdmlhIGBzd2l0Y2gtdG8tYnVmZmVyJyB3 aWxsIGhhdmUgYHctPm11bHRpcGxlX2N1cnNvcnNfY2FjaGUnLiAgVGhpcyBiZWhhdmlvcgoraXMg Y29uc2lzdGVudCB3aXRoIGZ1bmN0aW9ucyBzdWNoIGFzIGBzZXQtd2luZG93LWRpc3BsYXktdGFi bGUnLiAgV2UgZGVhbCB3aXRoIHRoaXMgaW4KK2Buc3Rlcm0ubScgLyBgdzMydGVybS5jJyAvIGB4 dGVybS5jJyBieSBjb21wYXJpbmcgYHctPmNvbnRlbnRzJyB0byB0aGUgdmFsdWUgb2YgdGhlIGBi dWYnCitzdG9yZWQgaW4gYHctPm11bHRpcGxlX2N1cnNvcnNfY2FjaGUnLiAqLworICBpZiAoIU5J TFAgKHJlc3VsdCkpCisgICAgd3NldF9tdWx0aXBsZV9jdXJzb3JzX2NhY2hlICh3LCBsaXN0biAo Q09OU1RZUEVfSEVBUCwgMywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZyZXZl cnNlIChyZXN1bHQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmNvbnMgKHdp bmRvdywgUW5pbCksCisgICAgICAgIC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i amVjdCB3aW5kb3c7CisgICAgICBYU0VUV0lORE9XICh3aW5kb3csIHcpOworICAgICAgTGlzcF9P YmplY3Qgd2luZG93X3N0cmluZyA9IEZwcmluMV90b19zdHJpbmcgKHdpbmRvdywgUW5pbCk7Cisg ICAgICBjaGFyICp3aW5kb3dfY2hhciA9IFNTREFUQSAod2luZG93X3N0cmluZyk7CisgICAgICBm cHJpbnRmIChzdGRlcnIsICJtY19yZWRyYXdfbXVsdGlwbGVfY3Vyc29ycyAoJXMpXG4iLCB3aW5k b3dfY2hhcik7CisgICAgfQorI2VuZGlmCisgIExpc3BfT2JqZWN0IHZsaXN0ID0gUW5pbDsKKyAg TGlzcF9PYmplY3QgZmlmdGVlbl9lbGVtZW50cyA9IFFuaWw7CisgIGludCB4LCBmeCwgeSwgZnks IGhwb3MsIHZwb3MsIGg7CisgIGVudW0gdGV4dF9jdXJzb3Jfa2luZHMgY3Vyc29yX3R5cGU7Cisg IGludCBjdXJzb3Jfd2lkdGg7CisgIExpc3BfT2JqZWN0IGZvcmVncm91bmQgPSBRbmlsOworICBM aXNwX09iamVjdCBiYWNrZ3JvdW5kID0gUW5pbDsKKyAgYm9vbCBhY3RpdmVfY3Vyc29yX3AgPSBm YWxzZTsKKyAgYm9vbCBtaW5pbWFsX3AgPSBmYWxzZTsKKyAgaW50IGZsYXZvcjsKKyAgcHRyZGlm Zl90IHBvc2ludDsKKyAgZm9yICh2bGlzdCA9IFhDQVIgKHctPm11bHRpcGxlX2N1cnNvcnNfY2Fj aGUpOworICAgICAgIENPTlNQICh2bGlzdCk7CisgICAgICAgdmxpc3QgPSBYQ0RSICh2bGlzdCkp CisgICAgeworICAgICAgZmlmdGVlbl9lbGVtZW50cyA9IFhDQVIgKHZsaXN0KTsKKyAgICAgIHgg PSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMCksIGZpZnRlZW5fZWxlbWVudHMpKTsKKyAgICAg IGZ4ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDEpLCBmaWZ0ZWVuX2VsZW1lbnRzKSk7Cisg ICAgICB5ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDIpLCBmaWZ0ZWVuX2VsZW1lbnRzKSk7 CisgICAgICBmeSA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgzKSwgZmlmdGVlbl9lbGVtZW50 cykpOworICAgICAgaHBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICg0KSwgZmlmdGVlbl9l bGVtZW50cykpOworICAgICAgdnBvcyA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICg1KSwgZmlm dGVlbl9lbGVtZW50cykpOworICAgICAgaCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICg2KSwg ZmlmdGVlbl9lbGVtZW50cykpOworICAgICAgY3Vyc29yX3R5cGUgPSBtY19saXNwX3RvX2N1cnNv cl90eXBlIChGbnRoIChtYWtlX251bWJlciAoNyksIGZpZnRlZW5fZWxlbWVudHMpKTsKKyAgICAg IGN1cnNvcl93aWR0aCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICg4KSwgZmlmdGVlbl9lbGVt ZW50cykpOworICAgICAgZm9yZWdyb3VuZCA9IEZudGggKG1ha2VfbnVtYmVyICg5KSwgZmlmdGVl bl9lbGVtZW50cyk7CisgICAgICBiYWNrZ3JvdW5kID0gRm50aCAobWFrZV9udW1iZXIgKDEwKSwg ZmlmdGVlbl9lbGVtZW50cyk7CisgICAgICBhY3RpdmVfY3Vyc29yX3AgPSBYSU5UIChGbnRoICht YWtlX251bWJlciAoMTEpLCBmaWZ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICBtaW5pbWFsX3AgPSBY SU5UIChGbnRoIChtYWtlX251bWJlciAoMTIpLCBmaWZ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICBm bGF2b3IgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMTMpLCBmaWZ0ZWVuX2VsZW1lbnRzKSk7 CisgICAgICBwb3NpbnQ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5cGhfY3Vyc29ycyAodywgdy0+cGh5c19jdXJzb3IueCwgdy0+cGh5c19jdXJzb3Iu eSwgdy0+cGh5c19jdXJzb3IuaHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+cGh5 c19jdXJzb3IudnBvcywgdy0+cGh5c19jdXJzb3JfdHlwZSwgdy0+cGh5c19jdXJzb3Jfd2lkdGgs CisgICAgICAgICAgICAgICAgICAgICAgICAgIGZsYXZvcik7CisgIGZvciAodmxpc3QgPSBYQ0FS ICh3LT5tdWx0aXBsZV9jdXJzb3JzX2NhY2hlKTsKKyAgICAgICBDT05TUCAodmxpc3QpOworICAg ICAgIHZsaXN0ID0gWENEUiAodmxpc3QpKQorICAgIHsKKyAgICAgIGZpZnRlZW5fZWxlbWVudHMg PSBYQ0FSICh2bGlzdCk7CisgICAgICB4ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCBm aWZ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICBmeCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgx KSwgZmlmdGVlbl9lbGVtZW50cykpOworICAgICAgeSA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVy ICgyKSwgZmlmdGVlbl9lbGVtZW50cykpOworICAgICAgZnkgPSBYSU5UIChGbnRoIChtYWtlX251 bWJlciAoMyksIGZpZnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIGhwb3MgPSBYSU5UIChGbnRoICht YWtlX251bWJlciAoNCksIGZpZnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIHZwb3MgPSBYSU5UIChG bnRoIChtYWtlX251bWJlciAoNSksIGZpZnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIGggPSBYSU5U IChGbnRoIChtYWtlX251bWJlciAoNiksIGZpZnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIGN1cnNv cl90eXBlID0gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoRm50aCAobWFrZV9udW1iZXIgKDcpLCBm aWZ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICBjdXJzb3Jfd2lkdGggPSBYSU5UIChGbnRoIChtYWtl X251bWJlciAoOCksIGZpZnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIGZvcmVncm91bmQgPSBGbnRo IChtYWtlX251bWJlciAoOSksIGZpZnRlZW5fZWxlbWVudHMpOworICAgICAgYmFja2dyb3VuZCA9 IEZudGggKG1ha2VfbnVtYmVyICgxMCksIGZpZnRlZW5fZWxlbWVudHMpOworICAgICAgYWN0aXZl X2N1cnNvcl9wID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDExKSwgZmlmdGVlbl9lbGVtZW50 cykpOworICAgICAgbWluaW1hbF9wID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDEyKSwgZmlm dGVlbl9lbGVtZW50cykpOworICAgICAgZmxhdm9yID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIg KDEzKSwgZmlmdGVlbl9lbGVtZW50cykpOworICAgICAgcG9zaW50ID0gWElOVCAoRm50aCAobWFr ZV9udW1iZXIgKDE0KSwgZmlmdGVlbl9lbGVtZW50cykpOworICAgICAgaWYgKGZsYXZvciA9PSBN Q19HTFlQSCkKKyAgICAgICAgbWNfZXJhc2VfZ2x5cGhfY3Vyc29ycyAodywgeCwgeSwgaHBvcywg dnBvcywgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZmxhdm9yKTsKKyAgICAgICAgZWxzZQor ICAgICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgcmVtb3ZlX3AgPSB0cnVlOworICAgICAgICAg ICAgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHcsIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgaCwg Y3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dp ZHRoLCBiYWNrZ3JvdW5kLCBhY3RpdmVfY3Vyc29yX3AsCisgICAgICAgICAgICAgICAgICAgICA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AgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jv c3NoYWlycykpKSkKKyAgICB7CisgICAgICBMaXNwX09iamVjdCB3aW5kb3c7CisgICAgICBYU0VU V0lORE9XICh3aW5kb3csIHcpOworICAgICAgTGlzcF9PYmplY3Qgd2luZG93X3N0cmluZyA9IEZw cmluMV90b19zdHJpbmcgKHdpbmRvdywgUW5pbCk7CisgICAgICBjaGFyICp3aW5kb3dfY2hhciA9 IFNTREFUQSAod2luZG93X3N0cmluZyk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19kcmF3 X2Nyb3NzaGFpcnMgKCVzKTogIGFjdGl2ZV9jdXJzb3JfcCAoJWQpIHwgbWluaW1hbF9wICglZClc biIsCisgICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3dfY2hhciwgYWN0aXZlX2N1cnNvcl9w LCBtaW5pbWFsX3ApOworICAgIH0KKyNlbmRpZgorICBib29sIG1jX3N0ZGVycl9wID0gIU5JTFAg KEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBtY19zdGRlcnIpKTsKKyAgcHRyZGlmZl90IG9wb2ludF9w dCA9ICh3ID09IFhXSU5ET1cgKHNlbGVjdGVkX3dpbmRvdykpCisgICAgICAgICAgICAgICAgICAg ICAgICA/IFBUCisgICAgICAgICAgICAgICAgICAgICAgICA6IFhJTlQgKEZtYXJrZXJfcG9zaXRp b24gKHctPnBvaW50bSkpOworICBpbnQgb3BvaW50X3ggPSB3LT5waHlzX2N1cnNvci54OworICBp bnQgb3BvaW50X3kgPSB3LT5waHlzX2N1cnNvci55OworICBpbnQgb3BvaW50X2hwb3MgPSB3LT5w aHlzX2N1cnNvci5ocG9zOworICBpbnQgb3BvaW50X3Zwb3MgPSB3LT5waHlzX2N1cnNvci52cG9z OworICBzdHJ1Y3QgZ2x5cGggKnJlYWxfcGh5c19jdXJzb3JfZ2x5cGggPQorICAgIG1jX2dldF9w aHlzX2N1cnNvcl9nbHlwaCAodywgb3Bv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5h bCAob2xkX2J1ZmZlcik7CisgICAgICByZXR1cm47CisgICAgfQorICAvKiBgbWF0cml4X3Jvdycg aW4gYGRpc3BuZXcuY2AgY29udGFpbnMgdGhlIGZvbGxvd2luZyB0ZXN0cywKKyAgZWFzc2VydCAo bWF0cml4ICYmIG1hdHJpeC0+cm93cyk7CisgIGVhc3NlcnQgKHJvdyA+PSAwICYmIHJvdyA8IG1h dHJpeC0+bnJvd3MpOyAqLworICBib29sIGJhcmZfY3Jhc2hfdGhyZWUgPSAody0+Y3VycmVudF9t YXRyaXggJiYgdy0+Y3VycmVudF9tYXRyaXgtPnJvd3MpID8gZmFsc2UgOiB0cnVlOworICBpZiAo YmFyZl9jcmFzaF90aHJlZSkKKyAgICB7CisgICAgICBpZiAob2xkX2J1ZmZlcikKKyAgICAgICAg c2V0X2J1ZmZlcl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7CisgICAgICByZXR1cm47CisgICAgfQor ICBib29sIGJhcmZfY3Jhc2hfZm91ciA9IChvcG9pbnRfdnBvcyA+PSAwICYmIG9wb2ludF92cG9z IDwgdy0+Y3VycmVudF9tYXRyaXgtPm5yb3dzKSA/IGZhbHNlIDogdHJ1ZTsKKyAgaWYgKGJhcmZf Y3Jhc2hfZm91cikKKyAgICB7CisgICAgICBpZiAob2xkX2J1ZmZlcikKKyAgICAgICAgc2V0X2J1 ZmZlcl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7CisgICAgICByZXR1cm47CisgICAgfQorICBpZiAo IUJVRkZFUlAgKGJ1ZikpCisgICAgeworICAgICAgaWYgKG9sZF9idWZmZXIpCisgICAgICAgIHNl dF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworICAgICAgcmV0dXJuOworICAgIH0KKyAg aWYgKE5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKSkKKyAgICB7CisgICAgICBpZiAob2xkX2J1 ZmZlcikKKyAgICAgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7CisgICAgICBy ZXR1cm47CisgICAgfQorICBpZiAoTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlyc19ob3Jpem9udGFs X3J1bGVyKSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnNfdmVydGljYWxfcnVs ZXIpKSkKKyAgICB7CisgICAgICBpZiAob2xkX2J1ZmZlcikKKyAgICAgICAgc2V0X2J1ZmZlcl9p bnRlcm5hbCAob2xkX2J1ZmZlcik7CisgICAgICByZXR1cm47CisgICAgfQorLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCRUdJTiBKT1VSTkVZ IC4uLgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisgIGludCBmcmFtZV9jaGFyX3dpZHRoID0g RlJBTUVfQ09MVU1OX1dJRFRIIChmKTsKKyAgaW50IHRleHRfYXJlYV93aWR0aCA9IHdpbmRvd19i b3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgIGJvb2wgY3Vyc29yX2luX2ZyaW5nZV9wID0gdy0+ b3V0cHV0X2N1cnNvci54ICsgZnJhbWVfY2hhcl93aWR0aCA+PSB0ZXh0X2FyZWFfd2lkdGg7Cisg IHN0cnVjdCBnbHlwaF9yb3cgKmdseXBoX3JvdzsKKyAgaW50IGN1cnNvcl93aWR0aCA9IDE7Cisg IHB0cmRpZmZfdCBwb3NpbnQgPSAtMTsKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAg ICAgICAgICAgICAgICAgIFNUQVJUIERJU1BMQVkgQU5EIFBSSU1FIElUCisqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKyAgcHRyZGlmZl90IGN1cnJlbnRfY29sID0gbWNfY3VycmVudF9jb2x1bW4g KHcsIG9wb2ludF9wdCk7CisgIGJvb2wgZmlsbF9jb2x1bW5fcCA9ICFOSUxQIChCVkFSIChiLCBm aWxsX2NvbHVtbikpOworICBwdHJkaWZmX3QgZmlsbF9jb2wgPSBYSU5UIChCVkFSIChiLCBmaWxs X2NvbHVtbikpOworICBMaXNwX09iamVjdCByZXN1bHQgPSBRbmlsOworICBpbnQgZmxhdm9yOwor ICAvKiBWYWx1ZXMgZm9yIHRoZSBjdXJyZW50IGNvbHVtbiBvZiB0aGUgdmVydGljYWwgbGluZS4g Ki8KKyAgTGlzcF9PYmplY3QgZm9yZWdyb3VuZCA9IEZtYWtlX3ZlY3RvciAobWFrZV9udW1iZXIg KDMpLCBRbmlsKTsKKyAgZW51bSBmYWNlX2lkIGZhY2VfaWQ7CisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ09MT1IgT0YgQ1JPU1NIQUlSUwor KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisgIGVudW0gZmFjZV9pZCBldmVuX2ZhY2VfaWQgPQor ICAgICghYWN0aXZlX2N1cnNvcl9wCisgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIGNyb3NzaGFpcnNfaW5hY3RpdmVfd2luZG93cykpKQorICAgID8gbG9va3VwX25h bWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistZXZlbi1udW1iZXJlZC1jb2x1bW4taW5hY3RpdmUt ZmFjZSIpLCB0cnVlKQorICAgIDogbG9va3VwX25hbW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2NvbCA8PSBmaWxsX2NvbCkKKyAgICBmb3JlZ3JvdW5kID0gb2RkX2NvbG9yX3Zl Y3RvcjsKKyAgLyogeWVsbG93ICovCisgIGlmIChjdXJyZW50X2NvbCAlIDIgPT0gMAorICAgICAg JiYgZmlsbF9jb2x1bW5fcAorICAgICAgJiYgY3VycmVudF9jb2wgPD0gZmlsbF9jb2wpCisgICAg Zm9yZWdyb3VuZCA9IGV2ZW5fY29sb3JfdmVjdG9yOworICAvKiBncmVlbiAqLworICBpZiAoZmls bF9jb2x1bW5fcAorICAgICAgJiYgY3VycmVudF9jb2wgPiBmaWxsX2NvbCkKKyAgICBmb3JlZ3Jv dW5kID0gZmlsbF9jb2xvcl92ZWN0b3I7CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgIEVSQVNFIFRIRSBSRUFMIENVUlNPUgorKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBgdy0+cGh5c19jdXJzb3IueC95L2hwb3MvdnBvc2AgYXJlIGluY29y cmVjdCBhZnRlciBldmFsdWF0aW5nIChzY3JvbGwtbGVmdCAxKQorYSBjb3VwbGUgb2YgdGltZXMu ICBSZWRpc3BsYXkgZXJhc2VzIHRoZSByZWFsIGN1cnNvciBhbG1vc3QgaW1tZWRpYXRlbHkgYWZ0 ZXIKK2BtY19kcmF3X2Nyb3NzaGFpcnMnIHJ1bnMgaXRzIGNvdXJzZSAtLSBhbG1vc3QgdG9vIHF1 aWNrbHkgdG8gc2VlIGl0IGhhcHBlbmluZy4KK1RoZSBjaGFyYWN0ZXIgd2hlcmUgRW1hY3MgdGhp bmtzIHRoZSByZWFsIGN1cnNvciBpcyBsb2NhdGVkIGdldHMgcmVkcmF3biwgYWxiaWV0Cit3aXRo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yAgICAgIHctPnBoeXNfY3Vyc29yLnZwb3MgPSB3LT5vdXRwdXRfY3Vyc29yLnZwb3M7Cisg ICAgfQorICBpZiAoIW1pbmltYWxfcCkKKyAgICBlcmFzZV9waHlzX2N1cnNvciAodyk7CisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgUkVQTEFDRSBU SEUgUkVBTCBDVVJTT1IKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICBnbHlwaF9yb3cgPSBN QVRSSVhfUk9XICh3LT5jdXJyZW50X21hdHJpeCwgb3BvaW50X3Zwb3MpOworICBpZiAoIWN1cnNv cl9pbl9mcmluZ2VfcCkKKyAgICBmbGF2b3IgPSBNQ19HTFlQSDsKKyAgICAvKiBUaGlzIGNvbmRp dGlvbiBwcm9iYWJseSBkb2VzIG5vdCBleGlzdCBmb3IgdGhlIHJlYWwgZmFrZSBjdXJzb3IuICov CisgICAgZWxzZSBpZiAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAgJiYgZ2x5cGhf cm93LT5jb250aW51ZWRfcCkKKyAgICAgIGZsYXZvciA9IE1DX1BJTENST1c7CisgICAgICBlbHNl IGlmIChjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAgICAgICAgICAgICYmIGdseXBoX3Jvdy0+dHJ1 bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgIGZsYXZvciA9IE1DX0hPTExPV19SRUNUQU5HTEVf UklHSFRfQVJST1c7CisgICAgICAgIGVsc2UgaWYgKGN1cnNvcl9pbl9mcmluZ2VfcAorICAgICAg ICAgICAgICAgICAmJiAhZ2x5cGhfcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAgICAm JiAhZ2x5cGhfcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICBmbGF2b3IgPSBN Q19IT0xMT1dfUkVDVEFOR0xFOworICBmYWNlX2lkID0gKHJlYWxfcGh5c19jdXJzb3JfZ2x5cGgg PT0gTlVMTCkKKyAgICAgICAgICAgICAgPyBERUZBVUxUX0ZBQ0VfSUQKKyAgICAgICAgICAgICAg OiByZWFsX3BoeXNfY3Vyc29yX2dseXBoLT5mYWNlX2lkOworICBpbnQgb3BvaW50X2Z4ID0gLTE7 CisgIGludCBvcG9pbnRfZnkgPSAtMTsKKyAgaW50IG9wb2ludF9oID0gLTE7CisgIC8qIEZJWE1F OiAgUHV0IGluIHNvbWUgY29kZSB0byBkZWZhdWx0IHRvIEhPTExPV19CT1hfQ1VSU09SIGlmIHRo ZSB1c2VyIGhhcworICB1bndpdHRpbmdseSBjb21lIHVwIHdpdGggc29tZSB1bmFjY2VwdGFibGUg Zm9ybSBvZiB1bnJlY29nbml6ZWQgY3Vyc29yIHR5cGUuICovCisgIExpc3BfT2JqZWN0IGN1cnNv cl9saXNwX3R5cGUgPSBCVkFSIChiLCBtY19yZWFsX2Zha2VfY3Vyc29yKTsKKyAgZW51bSB0ZXh0 X2N1cnNvcl9raW5kcyB0ZW1wX2N1cnNvcl90eXBlID0gKENPTlNQIChjdXJzb3JfbGlzcF90eXBl KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfbGlz cF90b19jdXJzb3JfdHlwZSAoWENBUiAoY3Vyc29yX2xpc3BfdHlwZSkpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUg KGN1cnNvcl9saXNwX3R5cGUpOworICBpZiAoZmxhdm9yID09IE1DX1BJTENST1cKKyAgICAgIHx8 IGZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICB8fCBmbGF2 b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRSkKKyAgICB0ZW1wX2N1cnNvcl90eXBlID0gUklHSFRf RlJJTkdFX0JJVE1BUDsKKyAgaW50IGluaXRpYWxfY3Vyc29yX3dpZHRoID0gKENPTlNQIChjdXJz b3JfbGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gWElOVCAoWENB UiAoWENEUiAoY3Vyc29yX2xpc3BfdHlwZSkpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiAxOworICBlbnVtIGZhY2VfaWQgY3Vyc29yX2ZhY2VfaWQgPQorICAgICghYWN0aXZlX2N1 cnNvcl9wCisgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3Nz aGFpcnNfaW5hY3RpdmVfd2luZG93cykpKQorICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYs IGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1mYWNlIiksIHRydWUpCisgICAg OiBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWZh Y2UiKSwgdHJ1ZSk7CisgIHN0cnVjdCBmYWNlICpjdXJzb3JfZmFjZSA9IEZBQ0VfRlJPTV9JRCAo ZiwgY3Vyc29yX2ZhY2VfaWQpOworICBMaXNwX09iamVjdCBjdXJzb3JfY29sb3IgPSBjdXJzb3Jf ZmFjZS0+bGZhY2VbTEZBQ0VfRk9SRUdST1VORF9JTkRFWF07CisgIENIRUNLX1NUUklORyAoY3Vy c29yX2NvbG9yKTsKKyAgTGlzcF9PYmplY3QgY3Vyc29yX2ZnID0gKHRlbXBfY3Vyc29yX3R5cGUg PT0gTk9fQ1VSU09SKQorICAgICAgICAgICAgICAgICAgICAgICAgICA/IGZvcmVncm91bmQKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgOiBtY19jb2xvcl92ZW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pZHRoLCBjdXJzb3JfZmcsCisgICAgICAgICAgICAgICAgIG1jX2JnX2xz bCAodywgZmFjZV9pZCksIGFjdGl2ZV9jdXJzb3JfcCwgbWluaW1hbF9wLCBmbGF2b3IsCisgICAg ICAgICAgICAgICAgIG9wb2ludF9wdCwgJnJlc3VsdCk7CisgICAgICBpZiAoZmxhdm9yID09IE1D X0dMWVBIKQorICAgICAgICBtY19nZXRfcGh5c19jdXJzb3JfZ2VvbWV0cnkgKHcsIGdseXBoX3Jv dywgb3BvaW50X3gsICZvcG9pbnRfZngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgb3BvaW50X3ksICZvcG9pbnRfZnksIG9wb2ludF9ocG9zLCBvcG9pbnRfdnBvcywKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmb3BvaW50X2gsIEJBUl9DVVJTT1Is IGluaXRpYWxfY3Vyc29yX3dpZHRoLCAmX3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywgb3BvaW50 X3gsIG9wb2ludF9meCwgb3BvaW50X3ksIG9wb2ludF9meSwgb3BvaW50X2hwb3MsCisgICAgICAg ICAgICAgICAgIG9wb2ludF92cG9zLCBvcG9pbnRfaCwgQkFSX0NVUlNPUiwgY3Vyc29yX3dpZHRo LCBjdXJzb3JfZmcsCisgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAodywgZmFjZV9pZCksIGFj dGl2ZV9jdXJzb3JfcCwgbWluaW1hbF9wLCBmbGF2b3IsCisgICAgICAgICAgICAgICAgIG9wb2lu dF9wdCwgJnJlc3VsdCk7CisgICAgfQorICAgIGVsc2UgaWYgKCFtaW5pbWFsX3ApCisgICAgICB7 CisgICAgICAgIGludCBfd2Q7CisgICAgICAgIGlmIChmbGF2b3IgPT0gTUNfR0xZUEgpCisgICAg ICAgICAgbWNfZ2V0X3BoeXNfY3Vyc29yX2dlb21ldHJ5ICh3LCBnbHlwaF9yb3csIG9wb2ludF94 LCAmb3BvaW50X2Z4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3Bv aW50X3ksICZvcG9pbnRfZnksIG9wb2ludF9ocG9zLCBvcG9pbnRfdnBvcywKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICZvcG9pbnRfaCwgdGVtcF9jdXJzb3JfdHlwZSwg aW5pdGlhbF9jdXJzb3Jfd2lkdGgsICZfd2QpOworICAgICAgICBtY19oZWxwZXIgKHcsIG9wb2lu dF94LCBvcG9pbnRfZngsIG9wb2ludF95LCBvcG9pbnRfZnksIG9wb2ludF9ocG9zLAorICAgICAg ICAgICAgICAgICAgIG9wb2ludF92cG9zLCBvcG9pbnRfaCwgdGVtcF9jdXJzb3JfdHlwZSwgY3Vy c29yX3dpZHRoLAorICAgICAgICAgICAgICAgICAgIGN1cnNvcl9mZywgbWNfYmdfbHNsICh3LCBm YWNlX2lkKSwgYWN0aXZlX2N1cnNvcl9wLCBtaW5pbWFsX3AsCisgICAgICAgICAgICAgICAgICAg Zmxhdm9yLCBvcG9pbnRfcHQsICZyZXN1bHQpOworICAgICAgfQorICAvKiBmcmluZ2UgYml0bWFw cyB1c2UgZmFjZV9pZCB0byBzZXQgdGhlIGZvcmVncm91bmQgY29sb3IuICBUaGUgb3ZlcmxheS1h cnJvdworICBpcyBwcmVzZW50bHkgdGhlIG9ubHkgc2l0dWF0aW9uIHdoZXJlIHRoZSBgYWN0aXZl X2N1cnNvcl9wYCBhbmQgYG1pbmltYWxfcGAgYXJlCisgIHVzZWQgdG8gZGV0ZXJtaW5lIHRoZSBh cHBsaWNhYmxlIGZhY2VfaWQuICovCisgIExpc3BfT2JqZWN0IGZvcmVncm91bmRfbHNsID0gKEZt YWtlX3ZlY3RvciAobWFrZV9udW1iZXIgKDMpLCBRbmlsKSk7CisgIEFTRVQgKGZvcmVncm91bmRf bHNsLCAwLCBtYWtlX2Zsb2F0ICgtMS4wKSk7CisgIEFTRVQgKGZvcmVncm91bmRfbHNsLCAxLCBt YWtlX2Zsb2F0ICgtMS4wKSk7CisgIEFTRVQgKGZvcmVncm91bmRfbHNsLCAyLCBtYWtlX2Zsb2F0 ICgtMS4wKSk7CisgIG1jX2hlbHBlciAodywgb3BvaW50X3gsIG9wb2ludF9meCwgb3BvaW50X3ks IG9wb2ludF9meSwgb3BvaW50X2hwb3MsCisgICAgICAgICAgICAgb3BvaW50X3Zwb3MsIG9wb2lu dF9oLCBMRUZUX0ZSSU5HRV9CSVRNQVAsIGluaXRpYWxfY3Vyc29yX3dpZHRoLAorICAgICAgICAg ICAgIGZvcmVncm91bmRfbHNsLCBtY19iZ19sc2wgKHcsIGZhY2VfaWQpLCBhY3RpdmVfY3Vyc29y X3AsIG1pbmltYWxfcCwKKyAgICAgICAgICAgICBNQ19PVkVSTEFZX0FSUk9XX0JJVE1BUCwgb3Bv aW50X3B0LCAmcmVzdWx0KTsKKyAgaWYgKG1pbmltYWxfcCkKKyAgICBnb3RvIGNyb3NzaGFpcnNf ZmluaXNoOworICBpZiAoTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlyc19ob3Jpem9udGFsX3J1bGVy KSkpCisgICAgZ290byB2ZXJ0aWNhbF9ydWxlcjsKKyAgICBlbHNlCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioKKyAgICAgICAgICAgICAgICBIT1JJWk9OVEFMIFJVTEVSOiAgRklSU1QgWCA9PiBF T0wKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5kCisgICAgICAgSE9SSVpPTlRB TCBSVUxFUjogIERSQVcgRkxPQVRJTkcgR0xZUEhMRVNTIExJTkUgKEVPTCBUTyBGUklOR0UpCisq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKyAgICB7CisgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpy b3cgPSBNQVRSSVhfUk9XICh3LT5jdXJyZW50X21hdHJpeCwgb3BvaW50X3Zwb3MpOworICAgICAg aW50IGFyZWE7CisgICAgICBpbnQgcmVsYXRpdmVfeCA9IDA7CisgICAgICBmb3IgKGFyZWEgPSBM RUZUX01BUkdJTl9BUkVBOyBhcmVhIDwgTEFTVF9BUkVBOyArK2FyZWEpCisgICAgICAgIHsKKyAg ICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoID0gcm93LT5nbHlwaHNbYXJlYV07CisgICAgICAg ICAgc3RydWN0IGdseXBoICpnbHlwaF9lbmQgPSBnbHlwaCArIHJvdy0+dXNlZFthcmVhXTsKKyAg ICAgICAgICAvKiBHbHlwaCBmb3IgYSBsaW5lIGVuZCBpbiB0ZXh0LiAgKi8KKyAgICAgICAgICBp ZiAoYXJlYSA9PSBURVhUX0FSRUEgJiYgZ2x5cGggPT0gZ2x5cGhfZW5kICYmIGdseXBoLT5jaGFy cG9zID4gMCkKKyAgICAgICAgICAgICsrZ2x5cGhfZW5kOworICAgICAgICAgIGlmIChtY19zdGRl cnJfcAorICAgICAgICAgICAgICAmJiBnbHlwaCA8IGdseXBoX2VuZCkKKyAgICAgICAgICAgIGZw cmludGYgKHN0ZGVyciwKKyJcbj09PT09PT09PT09PT09PT09PT09PT09PT09PT0gSE9SSVpPTlRB TCBSVUxFUiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG5cCitHbHlwaCMvVG90 YWwgUmVsLlggVCAgICAgICBQb3MgTyAgIFcgICAgIENvZGUgRmFjZSBMUiAgICAgWCAgICBZIEhQ T1MgVlBPUyBaViBDXG4iKTsKKyAgICAgICAgICBmb3IgKDsgZ2x5cGggPCBnbHlwaF9lbmQ7ICsr Z2x5cGgpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIG1jX2VuZ2luZSAocm93LCBnbHlw aCwgYXJlYSwgcmVsYXRpdmVfeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICB3LCBwb3NpbnQs IEhCQVJfQ1VSU09SLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGFjdGl2ZV9jdXJzb3JfcCwK KyAgICAgICAgICAgICAgICAgICAgICAgICBtaW5pbWFsX3AsIEhPUklaT05UQUxfUlVMRVIsICZy ZXN1bHQpOworICAgICAgICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0aDsK KyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KgorICAgICAgICAgICBWRVJUSUNBTCBSVUxFUjogIENPTUJJTkFUSU9OIE9GIEdMWVBIICYgR0xZ UEhMRVNTIENVUlNPUlMKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICB2ZXJ0aWNhbF9ydWxl cjoKKyAgaWYgKE5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnNfdmVydGljYWxfcnVsZXIpKSkKKyAg ICBnb3RvIGNyb3NzaGFpcnNfZmluaXNoOworICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgaW50 IGhlYWRlcl9saW5lX2Zvcm1hdCA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICAg ICAgICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAg ICAgICAgaW50IHJvd19zdGFydCwgcm93X2VuZCwgd2luZG93X3Jvd19zdGFydCwgd2luZG93X3Jv d19lbmQ7CisgICAgICAgIGludCBpOworICAgICAgICBMaXNwX09iamVjdCB0ZW1wID0gUW5pbDsK KyAgICAgICAgTGlzcF9PYmplY3QgdnNwZWNzID0gUW5pbDsKKyAgICAgICAgZm9yIChpID0gMDsg aSA8IG1hdHJpeC0+bnJvd3M7ICsraSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBzdHJ1Y3Qg Z2x5cGhfcm93ICpyb3cgPSBNQVRSSVhfUk9XIChtYXRyaXgsIGkpOworICAgICAgICAgICAgcm93 X3N0YXJ0ID0gTUFUUklYX1JPV19TVEFSVF9DSEFSUE9TIChyb3cpOworICAgICAgICAgICAgaWYg KChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIGkgPT0gMSkKKyAgICAgICAgICAgICAgICAgfHwg KGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwICYmIGkgPT0gMCkpCisgICAgICAgICAgICAgIHdpbmRv d19yb3dfc3RhcnQgPSByb3dfc3RhcnQ7CisgICAgICAgICAgICBpZiAoIXJvdy0+ZW5hYmxlZF9w KQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgd2luZG93X3Jvd19lbmQgPSByb3df ZW5kOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICB9CisgICAgICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICByb3dfZW5kID0g TUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KTsKKyAgICAgICAgICAgICAgICAgIHRlbXAgPSBs aXN0biAoQ09OU1RZUEVfSEVBUCwgMywgbWFrZV9udW1iZXIgKGkpLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYWtlX251bWJlciAocm93X3N0YXJ0 KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFr ZV9udW1iZXIgKHJvd19lbmQpKTsKKyAgICAgICAgICAgICAgICAgIHZzcGVjcyA9IEZjb25zICh0 ZW1wLCB2c3BlY3MpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICB9CisgICAgICAgIExp c3BfT2JqZWN0IHZsaXN0OworICAgICAgICBmb3IgKHZsaXN0ID0gRm5yZXZlcnNlICh2c3BlY3Mp OworICAgICAgICAgICAgIENPTlNQICh2bGlzdCk7CisgICAgICAgICAgICAgdmxpc3QgPSBYQ0RS ICh2bGlzdCkpCisgICAgICAgICAgeworICAgICAgICAgICAgaW50IGNvdW50ID0gWElOVCAoRm50 aCAobWFrZV9udW1iZXIgKDApLCBYQ0FSICh2bGlzdCkpKTsKKyAgICAgICAgICAgIGludCBwb3Nf c3RhcnQgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMSksIFhDQVIgKHZsaXN0KSkpOworICAg ICAgICAgICAgaW50IHBvc19lbmQgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMiksIFhDQVIg KHZsaXN0KSkpOworICAgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93ID0gTUFUUklYX1JP VyAody0+Y3VycmVudF9tYXRyaXgsIGNvdW50KTsKKyAgICAgICAgICAgIGludCB0ZW1wX3Zwb3Mg PSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgdy0+Y3VycmVudF9tYXRyaXgpOworICAgICAgICAgICAg aW50IGFyZWE7CisgICAgICAgICAgICBpbnQgcmVsYXRpdmVfeCA9IDA7CisgICAgICAgICAgICBm b3IgKGFyZWEgPSBMRUZUX01BUkdJTl9BUkVBOyBhcmVhIDwgTEFTVF9BUkVBOyArK2FyZWEpCisg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoID0gcm93 LT5nbHlwaHNbYXJlYV07CisgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoICpnbHlwaF9lbmQg PSBnbHlwaCArIHJvdy0+dXNlZFthcmVhXTsKKyAgICAgICAgICAgICAgICBpZiAoYXJlYSA9PSBU RVhUX0FSRUEgJiYgZ2x5cGggPT0gZ2x5cGhfZW5kICYmIGdseXBoLT5jaGFycG9zID4gMCkKKyAg ICAgICAgICAgICAgICAgICsrZ2x5cGhfZW5kOworICAgICAgICAgICAgICAgIGlmIChtY19zdGRl cnJfcAorICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaCA8IGdseXBoX2VuZCkKKyAgICAgICAg ICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwKKyJcbmNvdW50ICglZCkgfCB3aW5kb3dfcm93X3N0 YXJ0L2VuZCAoJWQvJWQpIHwgcm93X3N0YXJ0L2VuZCAoJWQvJWQpXG5cCis9PT09PT09PT09PT09 PT09PT09PT09PT09PT09PSBWRVJUSUNBTCBSVUxFUiA9PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09XG5cCitHbHlwaCMvVG90YWwgUmVsLlggVCAgICAgICBQb3MgTyAgIFcgICAgIENv ZGUgRmFjZSBMUiAgICAgWCAgICBZIEhQT1MgVlBPUyBaViBDXG4iLAorY291bnQsIHdpbmRvd19y b3dfc3RhcnQsIHdpbmRvd19yb3dfZW5kLCBwb3Nfc3RhcnQsIHBvc19lbmQpOworICAgICAgICAg ICAgICAgIGZvciAoOyBnbHlwaCA8IGdseXBoX2VuZDsgKytnbHlwaCkKKyAgICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgICAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3AgPSAob3Bv aW50X3kgPT0gZ2x5cGgtPnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgb3BvaW50X3Zwb3MgPT0gdGVtcF92cG9zKTsKKyAgICAgICAgICAgICAgICAg ICAgaWYgKCgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiBjb3VudCA+IDApCisgICAgICAgICAg ICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAg ICAgICAgICAgICAmJiAocmVsYXRpdmVfeCArIGdseXBoLT5waXhlbF93aWR0aCA+IG9wb2ludF94 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGggPT0gZ2x5cGhfZW5kIC0gMSkK KyAgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT55IDw9IHdpbmRvd190ZXh0X2JvdHRv bV95ICh3KQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkK KyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBtY19lbmdp bmUgKHJvdywgZ2x5cGgsIGFyZWEsIHJlbGF0aXZlX3gsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHcsIHBvc2ludCwgQkFSX0NVUlNPUiwgY3Vyc29yX3dpZHRoLCBmb3JlZ3Jv dW5kLCBhY3RpdmVfY3Vyc29yX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IG1pbmltYWxfcCwgVkVSVElDQUxfUlVMRVIsICZyZXN1bHQpOworICAgICAgICAgICAgICAgICAg ICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAg ICAgIGVsc2UgaWYgKG1jX3N0ZGVycl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgbWNfZHVt cF9nbHlwaCAocm93LCBnbHlwaCwgYXJlYSwgcmVsYXRpdmVfeCk7CisgICAgICAgICAgICAgICAg ICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgfQorLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNFVCBUSEUgQ0FDSEUK KyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworICBjcm9zc2hhaXJzX2ZpbmlzaDoKKyAgaWYgKCFO SUxQIChyZXN1bHQpKQorICAgIHdzZXRfY3Jvc3NoYWlyc19jYWNoZSAodywgbGlzdG4gKENPTlNU WVBFX0hFQVAsIDMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRnJldmVy c2UgKHJlc3VsdCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmNvbnMg KHdpbmRvdywgUW5pbCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmNv bnMgKHctPmNvbnRlbnRzLCBRbmlsKSkpOworICB3LT5tYy5kcmF3X2Nyb3NzaGFpcnMgPSBmYWxz ZTsKKyAgaWYgKG9sZF9idWZmZXIpCisgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAob2xkX2J1ZmZl cik7CisvKgorI2lmZGVmIEdMWVBIX0RFQlVHCisgIGVuZCA9IGNsb2NrKCk7CisgIGNwdV90aW1l X3VzZWQgPSAoKGRvdWJsZSkgKGVuZCAtIHN0YXJ0KSkgLyBDTE9DS1NfUEVSX1NFQzsKKyAgZHRv YXN0ciAoYnVmX3RpbWUsIHNpemVvZiBidWZfdGltZSwgMCwgMCwgY3B1X3RpbWVfdXNlZCk7Cisg IGRlYnVnX21ldGhvZF9hZGQgKHcsICJtY19kcmF3X2Nyb3NzaGFpcnM6ICBUSU1FICglcykiLCBi dWZfdGltZSk7CisjZW5kaWYKKyovCit9Cit2b2lkCittY19yZWRyYXdfY3Jvc3NoYWlycyAoc3Ry dWN0IHdpbmRvdyAqdykKK3sKKy8qCisjaWZkZWYgR0xZUEhfREVCVUcKKyAgY2xvY2tfdCBzdGFy dCwgZW5kOworICBkb3VibGUgY3B1X3RpbWVfdXNlZDsKKyAgY2hhciBidWZfdGltZVtEQkxfQlVG U0laRV9CT1VORF07CisgIHN0YXJ0ID0gY2xvY2soKTsKKyNlbmRpZgorKi8KKyNpZmRlZiBHTFlQ SF9ERUJVRworICBpZiAodHJhY2VfcmVkaXNwbGF5X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CisgIExpc3BfT2JqZWN0IGZvcmVncm91bmQgPSBRbmls OworICBMaXNwX09iamVjdCBiYWNrZ3JvdW5kID0gUW5pbDsKKyAgYm9vbCBhY3RpdmVfY3Vyc29y X3AgPSBmYWxzZTsKKyAgYm9vbCBtaW5pbWFsX3AgPSBmYWxzZTsKKyAgaW50IGZsYXZvciA9IE5P X0ZMQVZPUjsKKyAgcHRyZGlmZl90IHBvc2ludDsKKyAgbWNfZXJhc2VfZ2x5cGhfY3Vyc29ycyAo dywgdy0+cGh5c19jdXJzb3IueCwgdy0+cGh5c19jdXJzb3IueSwgdy0+cGh5c19jdXJzb3IuaHBv cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+cGh5c19jdXJzb3IudnBvcywgdy0+cGh5 c19jdXJzb3JfdHlwZSwgdy0+cGh5c19jdXJzb3Jfd2lkdGgsCisgICAgICAgICAgICAgICAgICAg ICAgICAgIGZsYXZvcik7CisgIGZvciAodmxpc3QgPSBYQ0FSICh3LT5jcm9zc2hhaXJzX2NhY2hl KTsKKyAgICAgICBDT05TUCAodmxpc3QpOworICAgICAgIHZsaXN0ID0gWENEUiAodmxpc3QpKQor ICAgIHsKKyAgICAgIGZpZnRlZW5fZWxlbWVudHMgPSBYQ0FSICh2bGlzdCk7CisgICAgICB4ID0g WElOVCAoRm50aCAobWFrZV9udW1iZXIgKDApLCBmaWZ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICBm eCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgxKSwgZmlmdGVlbl9lbGVtZW50cykpOworICAg ICAgeSA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgZmlmdGVlbl9lbGVtZW50cykpOwor ICAgICAgZnkgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoMyksIGZpZnRlZW5fZWxlbWVudHMp KTsKKyAgICAgIGhwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoNCksIGZpZnRlZW5fZWxl bWVudHMpKTsKKyAgICAgIHZwb3MgPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoNSksIGZpZnRl ZW5fZWxlbWVudHMpKTsKKyAgICAgIGggPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoNiksIGZp ZnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJzb3Jf dHlwZSAoRm50aCAobWFrZV9udW1iZXIgKDcpLCBmaWZ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICBj dXJzb3Jfd2lkdGggPSBYSU5UIChGbnRoIChtYWtlX251bWJlciAoOCksIGZpZnRlZW5fZWxlbWVu dHMpKTsKKyAgICAgIGZvcmVncm91bmQgPSBGbnRoIChtYWtlX251bWJlciAoOSksIGZpZnRlZW5f ZWxlbWVudHMpOworICAgICAgYmFja2dyb3VuZCA9IEZudGggKG1ha2VfbnVtYmVyICgxMCksIGZp ZnRlZW5fZWxlbWVudHMpOworICAgICAgYWN0aXZlX2N1cnNvcl9wID0gWElOVCAoRm50aCAobWFr ZV9udW1iZXIgKDExKSwgZmlmdGVlbl9lbGVtZW50cykpOworICAgICAgbWluaW1hbF9wID0gWElO VCAoRm50aCAobWFrZV9udW1iZXIgKDEyKSwgZmlmdGVlbl9lbGVtZW50cykpOworICAgICAgZmxh dm9yID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDEzKSwgZmlmdGVlbl9lbGVtZW50cykpOwor ICAgICAgcG9zaW50ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDE0KSwgZmlmdGVlbl9lbGVt ZW50cykpOworICAgICAgaWYgKGZsYXZvciA9PSBNQ19HTFlQSCkKKyAgICAgICAgbWNfZXJhc2Vf Z2x5cGhfY3Vyc29ycyAodywgeCwgeSwgaHBvcywgdnBvcywgY3Vyc29yX3R5cGUsIGN1cnNvcl93 aWR0aCwgZmxhdm9yKTsKKyAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGJv b2wgcmVtb3ZlX3AgPSB0cnVlOworICAgICAgICAgICAgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHcs IHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgaCwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoLCBiYWNrZ3JvdW5kLCBhY3RpdmVfY3Vy c29yX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWluaW1hbF9wLCBmbGF2 b3IsIHBvc2ludCwgcmVtb3ZlX3ApOworICAgICAgICAgIH0KKyAgICB9CisgIGlmIChkZWxldGVf Y2FjaGUpCisgICAgd3NldF9jcm9zc2hhaXJzX2NhY2hlICh3LCBRbmlsKTsKKyAgdy0+bWMuZXJh c2VfY3Jvc3NoYWlycyA9IGZhbHNlOworLyoKKyNpZmRlZiBHTFlQSF9ERUJVRworICBlbmQgPSBj bG9jaygpOworICBjcHVfdGltZV91c2VkID0gKChkb3VibGUpIChlbmQgLSBzdGFydCkpIC8gQ0xP Q0tTX1BFUl9TRUM7CisgIGR0b2FzdHIgKGJ1Zl90aW1lLCBzaXplb2YgYnVmX3RpbWUsIDAsIDAs IGNwdV90aW1lX3VzZWQpOworICBkZWJ1Z19tZXRob2RfYWRkICh3LCAibWNfZXJhc2VfY3Jvc3No YWlyczogIFRJTUUgKCVzKSIsIGJ1Zl90aW1lKTsKKyNlbmRpZgorKi8KK30KKwordm9pZAorbWNf cmVtb3ZlX211bHRpcGxlX2N1cnNvcnMgKHN0cnVjdCB3aW5kb3cgKncpCit7CisgIHN0cnVjdCBm cmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBib29sIGRlbGV0ZV9jYWNoZSA9ICh3LT5t Yy5yZWRpc3BsYXlfcHJlc2VydmVfZWNob19hcmVhID09IDgKKyAgICAgICAgICAgICAgICAgICAg ICAgfHwgbWNfcmVkaXNwbGF5ID09IDMpCisgICAgICAgICAgICAgIC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ICBpZiAoIXctPnBzZXVkb193aW5kb3dfcAorICAgICAgJiYgIU1JTklfV0lO RE9XX1AgKHcpCisgICAgICAmJiAhTklMUCAody0+bXVsdGlwbGVfY3Vyc29yc19jYWNoZSkKKyAg ICAgICYmIFdJTkRPV1AgKFhDQVIgKEZudGggKG1ha2VfbnVtYmVyICgxKSwgdy0+bXVsdGlwbGVf Y3Vyc29yc19jYWNoZSkpKQorICAgICAgJiYgdyA9PSBYV0lORE9XIChYQ0FSIChGbnRoIChtYWtl X251bWJlciAoMSksIHctPm11bHRpcGxlX2N1cnNvcnNfY2FjaGUpKSkKKyAgICAgICYmIEVRICh3 LT5jb250ZW50cywgWENBUiAoRm50aCAobWFrZV9udW1iZXIgKDIpLCB3LT5tdWx0aXBsZV9jdXJz b3JzX2NhY2hlKSkpKQorICAgIHsKKyAgICAgIHVwZGF0ZV9iZWdpbiAoZik7CisgICAgICBibG9j a19pbnB1dCAoKTsKKyAgICAgIG1jX2VyYXNlX211bHRpcGxlX2N1cnNvcnMgKHcsIGRlbGV0ZV9j YWNoZSk7CisgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgdXBkYXRlX2VuZCAoZik7Cisg ICAgfQorfQorCit2b2lkCittY19yZW1vdmVfY3Jvc3NoYWlycyAoc3RydWN0IHdpbmRvdyAqdykK K3sKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIGJvb2wgZGVsZXRl X2NhY2hlID0gKCh3LT5tYy5yZWRpc3BsYXlfcHJlc2VydmVfZWNob19hcmVhID09IDgKKyAgICAg ICAgICAgICAgICAgICAgICAgIHx8IG1jX3JlZGlzcGxheSA9PSAzKQorICAgICAgICAgICAgICAg ICAgICAgICAmJiAhdy0+bWMuZHJhd19jcm9zc2hhaXJzCisgICAgICAgICAgICAgICAgICAgICAg ICYmICF3LT5tYy5lcmFzZV9jcm9zc2hhaXJzKQorICAgICAgICAgICAgICAgICAgICAgID8gZmFs c2UKKyAgICAgICAgICAgICAgICAgICAgICA6IHRydWU7CisjaWZkZWYgR0xZUEhfREVCVUcKKyAg aWYgKHRyYWNlX3JlZGlzcGxheV9wICYmIEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgJiYg KCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG11bHRpcGxlX2N1cnNvcnNfY29u ZikpCisgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jv c3NoYWlycykpKSkKKyAgICB7CisgICAgICBMaXNwX09iamVjdCB3aW5kb3c7CisgICAgICBYU0VU V0lORE9XICh3aW5kb3csIHcpOworICAgICAgTGlzcF9PYmplY3Qgd2luZG93X3N0cmluZyA9IEZw cmluMV90b19zdHJpbmcgKHdpbmRvdywgUW5pbCk7CisgICAgICBjaGFyICp3aW5kb3dfY2hhciA9 IFNTREFUQSAod2luZG93X3N0cmluZyk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19yZW1v dmVfY3Jvc3NoYWlycyAoJXMpOiAgZGVsZXRlX2NhY2hlICglZClcbiIsCisgICAgICAgICAgICAg ICAgICAgICAgICB3aW5kb3dfY2hhciwgZGVsZXRlX2NhY2hlKTsKKyAgICB9CisjZW5kaWYKKyAg LyogUmVtb3ZlIGZha2UgY3Vyc29ycy4gIElmIHdlIHJlbHkgdXBvbiBgdXBkYXRlX2ZyYW1lJyB0 byByZW1vdmUgZmFrZSBjdXJzb3JzLAorICB0aGVuIGl0IHdvdWxkIGJlIHRvbyBsYXRlIHRvIHJl bW92ZSBmYWtlIGN1cnNvcnMgZnJvbSBhbGwgYXJlYXMgb2YgdGhlIHZpc2libGUKKyAgd2luZG93 IHdoZW4gY3V0dGluZy9wYXN0aW5nIHRleHQgYW5kIHBlcmhhcHMgYSBmZXcgb3RoZXIgc2l0dWF0 aW9ucy4gKi8KKyAgaWYgKCF3LT5wc2V1ZG9fd2luZG93X3AKKyAgICAgICYmICFNSU5JX1dJTkRP V19QICh3KQorICAgICAgJiYgIU5JTFAgKHctPmNyb3NzaGFpcnNfY2FjaGUpCisgICAgICAmJiBX SU5ET1dQIChYQ0FSIChGbnRoIChtYWtlX251bWJlciAoMSksIHctPmNyb3NzaGFpcnNfY2FjaGUp KSkKKyAgICAgICYmIHcgPT0gWFdJTkRPVyAoWENBUiAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB3 LT5jcm9zc2hhaXJzX2NhY2hlKSkpCisgICAgICAmJiBFUSAody0+Y29udGVudHMsIFhDQVIgKEZu dGggKG1ha2VfbnVtYmVyICgyKSwgdy0+Y3Jvc3NoYWlyc19jYWNoZSkpKSkKKyAgICB7CisgICAg ICB1cGRhdGVfYmVnaW4gKGYpOworICAgICAgYmxvY2tfaW5wdXQgKCk7CisgICAgICBtY19lcmFz ZV9jcm9zc2hhaXJzICh3LCBkZWxldGVfY2FjaGUpOworICAgICAgdW5ibG9ja19pbnB1dCAoKTsK KyAgICAgIHVwZGF0ZV9lbmQgKGYpOworICAgIH0KK30KKwordm9pZAorbWNfbXVsdGlwbGVfY3Vy c29yc19wb3J0YWwgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgb24sIGJvb2wgYWN0aXZlX2N1cnNv cl9wKQoreworI2lmZGVmIEdMWVBIX0RFQlVHCisgIGlmICh0cmFjZV9yZWRpc3BsYXlfcCAmJiBC VUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICYmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBtdWx0aXBsZV9jdXJzb3JzX2NvbmYpKQorICAgICAgICAgIHx8ICFOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkpCisgICAgeworICAgICAg TGlzcF9PYmplY3Qgd2luZG93OworICAgICAgWFNFVFdJTkRPVyAod2luZG93LCB3KTsKKyAgICAg IExpc3BfT2JqZWN0IHdpbmRvd19zdHJpbmcgPSBGcHJpbjFfdG9fc3RyaW5nICh3aW5kb3csIFFu aWwpOworICAgICAgY2hhciAqd2luZG93X2NoYXIgPSBTU0RBVEEgKHdpbmRvd19zdHJpbmcpOwor ICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfbXVsdGlwbGVfY3Vyc29yc19wb3J0YWwgKCVzKTog IG9uICglZCkgfCBhY3RpdmVfY3Vyc29yX3AgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAg ICAgIHdpbmRvd19jaGFyLCBvbiwgYWN0aXZlX2N1cnNvcl9wKTsKKyAgICB9CisjZW5kaWYKKyAg Ym9vbCBtaW5pbWFsX3AgPSAoIXctPm1jLmRyYXdfbXVsdGlwbGVfY3Vyc29ycworICAgICAgICAg ICAgICAgICAgICAmJiBtY19yZWRpc3BsYXlfcHJlc2VydmVfZWNob19hcmVhICE9IDgKKyAgICAg ICAgICAgICAgICAgICAgJiYgbWNfcmVkaXNwbGF5ICE9IDMKKyAgICAgICAgICAgICAgICAgICAg JiYgdyA9PSBYV0lORE9XIChzZWxlY3RlZF93aW5kb3cpCisgICAgICAgICAgICAgICAgICAgICYm IE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbXVsdGlwbGVfY3Vyc29yc19kcmF3 X2ZvcnRod2l0aCkpKTsKKyAgaWYgKHctPm1jLmVyYXNlX211bHRpcGxlX2N1cnNvcnMgJiYgdy0+ bWMuZHJhd19tdWx0aXBsZV9jdXJzb3JzCisgICAgICAmJiAhTUlOSV9XSU5ET1dfUCAodykKKyAg ICAgICYmICFOSUxQICh3LT5tdWx0aXBsZV9jdXJzb3JzX2NhY2hlKQorICAgICAgJiYgV0lORE9X UCAoWENBUiAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB3LT5tdWx0aXBsZV9jdXJzb3JzX2NhY2hl KSkpCisgICAgICAmJiB3ID09IFhXSU5ET1cgKFhDQVIgKEZudGggKG1ha2VfbnVtYmVyICgxKSwg dy0+bXVsdGlwbGVfY3Vyc29y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Y29udGVudHMp LCBtdWx0aXBsZV9jdXJzb3JzX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICYmIE5JTFAgKHct Pm11bHRpcGxlX2N1cnNvcnNfY2FjaGUpCisgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBtdWx0aXBsZV9jdXJzb3JzX2NvbmYpKSkKKyAgICBtY19kcmF3X211bHRp cGxlX2N1cnNvcnMgKHcsIGFjdGl2ZV9jdXJzb3JfcCwgbWluaW1hbF9wKTsKKyAgICBlbHNlIGlm IChvbgorICAgICAgICAgICAgICYmICFNSU5JX1dJTkRPV19QICh3KQorICAgICAgICAgICAgICYm ICFOSUxQICh3LT5tdWx0aXBsZV9jdXJzb3JzX2NhY2hlKQorICAgICAgICAgICAgICYmICFOSUxQ IChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG11bHRpcGxlX2N1cnNvcnNfY29uZikpCisg ICAgICAgICAgICAgJiYgV0lORE9XUCAoWENBUiAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB3LT5t dWx0aXBsZV9jdXJzb3JzX2NhY2hlKSkpCisgICAgICAgICAgICAgJiYgdyA9PSBYV0lORE9XIChY Q0FSIChGbnRoIChtYWtlX251bWJlciAoMSksIHctPm11bHRpcGxlX2N1cnNvcnNfY2FjaGUpKSkK KyAgICAgICAgICAgICAmJiBFUSAody0+Y29udGVudHMsIFhDQVIgKEZudGggKG1ha2VfbnVtYmVy ICgyKSwgdy0+bXVsdGlwbGVfY3Vyc29yc19jYWNoZSkpKSkKKyAgICAgIHsKKyAgICAgICAgbWNf ZXJhc2VfbXVsdGlwbGVfY3Vyc29ycyAodywgZmFsc2UpOworICAgICAgICBtY19yZWRyYXdfbXVs dGlwbGVfY3Vyc29ycyAodyk7CisgICAgICB9Cit9CisKK3ZvaWQKK21jX2Nyb3NzaGFpcnNfcG9y dGFsIChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIG9uLCBib29sI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EZwcmluMV90 b19zdHJpbmcgKHdpbmRvdywgUW5pbCk7CisgICAgICBjaGFyICp3aW5kb3dfY2hhciA9IFNTREFU QSAod2luZG93X3N0cmluZyk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19jcm9zc2hhaXJz X3BvcnRhbCAoJXMpOiAgb24gKCVkKSB8IGFjdGl2ZV9jdXJzb3JfcCAoJWQpXG4iLAorICAgICAg ICAgICAgICAgICAgICAgICAgd2luZG93X2NoYXIsIG9uLCBhY3RpdmVfY3Vyc29yX3ApOworICAg IH0KKyNlbmRpZgorICBib29sIG1pbmltYWxfcCA9ICghdy0+bWMuZHJhd19jcm9zc2hhaXJzCisg ICAgICAgICAgICAgICAgICAgICYmIG1jX3JlZGlzcGxheV9wcmVzZXJ2ZV9lY2hvX2FyZWEgIT0g OAorICAgICAgICAgICAgICAgICAgICAmJiBtY19yZWRpc3BsYXkgIT0gMworICAgICAgICAgICAg ICAgICAgICAmJiB3ID09IFhXSU5ET1cgKHNlbGVjdGVkX3dpbmRvdykKKyAgICAgICAgICAgICAg ICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzX2Ry YXdfZm9ydGh3aXRoKSkpOworICBpZiAody0+bWMuZXJhc2VfY3Jvc3NoYWlycyAmJiB3LT5tYy5k cmF3X2Nyb3NzaGFpcnMKKyAgICAgICYmICFNSU5JX1dJTkRPV19QICh3KQorICAgICAgJiYgIU5J TFAgKHctPmNyb3NzaGFpcnNfY2FjaGUpCisgICAgICAmJiBXSU5ET1dQIChYQ0FSIChGbnRoICht YWtlX251bWJlciAoMSksIHctPmNyb3NzaGFpcnNfY2FjaGUpKSkKKyAgICAgICYmIHcgPT0gWFdJ TkRPVyAoWENBUiAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB3LT5jcm9zc2hhaXJzX2NhY2hlKSkp CisgICAgICAmJiBFUSAody0+Y29udGVudHMsIFhDQVIgKEZudGggKG1ha2Vf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0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpKQorICAgIG1j X2RyYXdfY3Jvc3NoYWlycyAodywgYWN0aXZlX2N1cnNvcl9wLCBtaW5pbWFsX3ApOworICAgIGVs c2UgaWYgKG9uCisgICAgICAgICAgICAgJiYgIU1JTklfV0lORE9XX1AgKHcpCisgICAgICAgICAg ICAgJiYgIU5JTFAgKHctPmNyb3NzaGFpcnNfY2FjaGUpCisgICAgICAgICAgICAgJiYgIU5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAg JiYgV0lORE9XUCAoWENBUiAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB3LT5jcm9zc2hhaXJzX2Nh Y2hlKSkpCisgICAgICAgICAgICAgJiYgdyA9PSBYV0lORE9XIChYQ0FSIChGbnRoIChtYWtlX251 bWJlciAoMSksIHctPmNyb3NzaGFpcnNfY2FjaGUpKSkKKyAgICAgICAgICAgICAmJiBFUSAody0+ Y29udGVudHMsIFhDQVIgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgdy0+Y3Jvc3NoYWlyc19jYWNo ZSkpKSkKKyAgICAgIHsKKyAgICAgICAgbWNfZXJhc2VfY3Jvc3NoYWlycyAodywgZmFsc2UpOwor ICAgICAgICBtY19yZWRyYXdfY3Jvc3NoYWlycyAodyk7CisgICAgICB9Cit9CisKK2Jvb2wKK21j X211bHRpcGxlX2N1cnNvcnNfcCAoc3RydWN0IHdpbmRvdyAqdykKK3sKKyNpZmRlZiBHTFlQSF9E RUJVRworICBpZiAodHJhY2VfcmVkaXNwbGF5X3AgJiYgQlVGRkVSUCAody0+Y29udGVudHMpCisg ICAgICAmJiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbXVsdGlwbGVfY3Vy c29yc19jb25mKSkKKyAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBj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AgICAgICYmIFdJTkRPV1AgKFhDQVIgKEZudGggKG1h a2VfbnVtYmVyICgxKSwgdy0+bXVsdGlwbGVfY3Vyc29yc19jYWNoZSkpKQorICAgICAgJiYgdyA9 PSBYV0lORE9XIChYQ0FSIChGbnRoIChtYWtlX251bWJlciAoMSksIHctPm11bHRpcGxlX2N1cnNv cnNfY2FjaGUpKSkKKyAgICAgICYmIEVRICh3LT5jb250ZW50cywgWENBUiAoRm50aCAobWFrZV9u dW1iZXIgKDIpLCB3LT5tdWx0aXBsZV9jdXJzb3JzX2NhY2hlKSkpKQorICAgIHJldHVybiB0cnVl OworICAgIGVsc2UKKyAgICAgIHJldHVybiBmYWxzZTsKK30KKworYm9vbAorbWNfY3Jvc3NoYWly c19wIChzdHJ1Y3Qgd2luZG93ICp3KQoreworI2lmZGVmIEdMWVBIX0RFQlVHCisgIGlmICh0cmFj ZV9yZWRpc3BsYXlfcCAmJiBCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICYmICghTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtdWx0aXBsZV9jdXJzb3JzX2NvbmYpKQorICAg ICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMp KSkpCisgICAgeworICAgICAgTGlzcF9PYmplY3Qgd2luZG93OworICAgICAgWFNFVFdJTkRPVyAo d2luZG93LCB3KTsKKyAgICAgIExpc3BfT2JqZWN0IHdpbmRvd19zdHJpbmcgPSBGcHJpbjFfdG9f c3RyaW5nICh3aW5kb3csIFFuaWwpOworICAgICAgY2hhciAqd2luZG93X2NoYXIgPSBTU0RBVEEg KHdpbmRvd19zdHJpbmcpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfY3Jvc3NoYWlyc19w ICglcylcbiIsIHdpbmRvd19jaGFyKTsKKyAgICB9CisjZW5kaWYKKy8qIE1vdmluZyB0aGUgbW91 c2UgdHJpZ2dlcnMgYHVwZGF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SBgZGlzcGxheV9hbmRf c2V0X2N1cnNvcicgd291bGQgbm90IGJlIGNhbGxlZCBpbiB0aGF0CisgICAgc2l0dWF0aW9uLiAg VGhlcmVmb3JlLCB3ZSBtdXN0IGZvcmNlIGNhbGwgYGRpc3BsYXlfYW5kX3NldF9jdXJzb3InLiAq LworICAgIGVsc2UgaWYgKCFNSU5JX1dJTkRPV19QICh3KQorICAgICAgICAgICAgICYmIHctPm1j LmRyYXdfY3Jvc3NoYWlycworICAgICAgICAgICAgICYmIHctPmN1cnNvcl9vZmZfcCA9PSB3LT5s YXN0X2N1cnNvcl9vZmZfcAorICAgICAgICAgICAgICYmICFOSUxQICh3LT5jcm9zc2hhaXJzX2Nh Y2hlKQorICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICYmIFdJTkRPV1AgKFhDQVIgKEZudGggKG1ha2Vf bnVtYmVyICgxKSwgdy0+Y3Jvc3NoYWlyc19jYWNoZSkpKQorICAgICAgICAgICAgICYmIHcgPT0g WFdJTkRPVyAoWENBUiAoRm50aCAobWFrZV9udW1iZXIgKDEpLCB3LT5jcm9zc2hhaXJzX2NhY2hl KSkpCisgICAgICAgICAgICAgJiYgRVEgKHctPmNvbnRlbnRzLCBYQ0FSIChGbnRoIChtYWtlX251 bWJlciAoMiksIHctPmNyb3NzaGFpcnNfY2FjaGUpKSkpCisgICAgICByZXR1cm4gdHJ1ZTsKKyAg ICAgIGVsc2UKKyAgICAgICAgcmV0dXJuIGZhbHNlOworfQorCitERUZVTiAoIm1jLWFjdGl2YXRl LW11bHRpcGxlLWN1cnNvcnMiLCBGbWNfYWN0aXZhdGVfbXVsdGlwbGVfY3Vyc29ycywgU21jX2Fj dGl2YXRlX211bHRpcGxlX2N1cnNvcnMsIDEsIDEsIDAsCisgICAgICAgZG9jOiAvKiBXaGVuIHVz aW5nIGEgdGltZXIsIGBtY19zd2l0Y2hlc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QVJHIGlzIHBvc2l0aXZlLiAqLykKKyAgKExpc3BfT2JqZWN0IGFy ZykKK3sKKyAgc3RydWN0IGJ1ZmZlciAqYiA9IGN1cnJlbnRfYnVmZmVyOworICBib29sIG1jX3N0 ZGVycl9wID0gKCFOSUxQIChCVkFSIChjdXJyZW50X2J1ZmZlciwgbWNfc3RkZXJyKSkpCisgICAg ICAgICAgICAgICAgICAgPyB0cnVlCisgICAgICAgICAgICAgICAgICAgOiBmYWxzZTsKKyAgaWYg KE5JTFAgKGFyZykpCisgICAgbWNfc3RkZXJyX3AgPSAhbWNfc3RkZXJyX3A7CisgIGVsc2UKKyAg ICB7CisgICAgICBhcmcgPSBGcHJlZml4X251bWVyaWNfdmFsdWUgKGFyZyk7CisgICAgICBtY19z dGRlcnJfcCA9IFhJTlQgKGFyZykgPiAwOworICAgIH0KKyAgaWYgKG1jX3N0ZGVycl9wKQorICAg IGJzZXRfYmx2X21jX3N0ZGVyciAoYiwgUXQpOworICAgIGVsc2UKKyAgICAgIGJzZXRfYmx2X21j X3N0ZGVyciAoYiwgUW5pbCk7CisgIHJldHVybiBRbmlsOworfQorCisvKiAgKGZ1bmRhbWVudGFs LW1vZGUpCisgICAgKHNldHEgZGlzcGxheS1saW5lLW51bWJlcnMgdCkKKyAgICAoc2V0cSBidWZm ZXItZGlzcGxheS10YWJsZSAobWFrZS1kaXNwbGF5LXRhYmxlKSkKKyAgICAoYXNldCBidWZmZXIt ZGlzcGxheS10YWJsZQorICAgICAgICAgID9cdAorICAgICAgICAgICh2ZWN0b3IgKG1ha2UtZ2x5 cGgtY29kZSA/XHUwMEJCICdmb250LWxvY2std2FybmluZy1mYWNlKQorICAgICAgICAgICAgICAg ICAgKG1ha2UtZ2x5cGgtY29kZSA/XHQgJ2hpZ2hsaWdodCkpKQorICAgIChhc2V0IGJ1ZmZlci1k aXNwbGF5LXRhYmxlCisgICAgICAgICAgP1xuCisgICAgICAgICAgKHZlY3RvciAobWFrZS1nbHlw aC1jb2RlID9cdTAwQjYgJ2ZvbnQtbG9jay1jb21tZW50LWZhY2UpCisgICAgICAgICAgICAgICAg ICA/XG4pKQorICAgIChzZXRxIHRhYi13aWR0aCA4KQorICAgIChzZXRxLWxvY2FsIGF1dG8taHNj cm9sbC1tb2RlICdjdXJyZW50LWxpbmUpICovCisKK0RFRlVOICgibWMtZGVidWciLCBGbWNfZGVi dWcsIFNtY19kZWJ1ZywgMCwgMCwgIiIsCisgICAgICAgZG9jOiAvKiBUaGlzIGZ1bmN0aW9uIHVz ZWQgZm9yIGRlYnVnZ2luZy4gKi8pCisgICh2b2lkKQoreworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqCisgICAgICAgICAgICAgICAgICAgICAgUFJFTElNSU5BUlkgU1RVRkYKKyoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworICBzdHJ1Y3Qgd2luZG93ICp3ID0gZGVjb2RlX2xpdmVfd2luZG93IChz ZWxlY3RlZF93aW5kb3cpOworICBzdHJ1Y3QgaXQgaXQ7CisgIHZvaWQgKml0ZGF0YSA9IGJpZGlf c2hlbHZlX2NhY2hlICgpOworICBzdHJ1Y3QgaXQgaXQyOworICB2b2lkICppdDJkYXRhID0gTlVM TDsKKyAgc3RydWN0IGl0IGl0MzsKKyAgdm9pZCAqaXQzZGF0YSA9IE5VTEw7CisgIGVudW0gbW92 ZV9pdF9yZXN1bHQgcmMgPSBNT1ZFX1hfUkVBQ0hFRDsKKyAgc3RydWN0IHRleHRfcG9zIHN0YXJ0 X3RleHRfcG9zaXRpb247CisgIGludCBjb3VudCA9IDA7CisgIGludCBuZXdfeCA9IDA7CisgIGlu dCBwcmV2aW91c19pdF9jID0gMDsKKyAgaW50IHByZXZpb3VzX2l0X2ZldGNoYnl0ZSA9IDA7Cisg IGludCBwcmV2aW91c19pdF9jdXJyZW50X3ggPSAwOworICBpbnQgcHJldmlvdXNfaXRfY2hhcnBv cyA9IDA7CisgIGludCBwcmV2aW91c19pdF9waXhlbF93aWR0aCA9IDA7CisgIGJvb2wgZmluYWxf bG9vcF9wID0gZmFsc2U7CisgIGludCB0ZXh0X2FyZWFfd2lkdGggPSB3aW5kb3dfYm94X3dpZHRo ICh3LCBURVhUX0FSRUEpOworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAg ICAgICAgICAgU1RBUlQgRElTUExBWSAtLSB3LT5zdGFydAorKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisgIC8qIEJlZ2luIHRoZSBqb3VybmV5IGF0IHctPnN0YXJ0LiAqLworICBTRVRfVEVYVF9Q T1NfRlJPTV9NQVJLRVIgKHN0YXJ0X3RleHRfcG9zaXRpb24sIHctPnN0YXJ0KTsKKyAgc3RhcnRf ZGlzcGxheSAoJml0LCB3LCBzdGFydF90ZXh0X3Bvc2l0aW9uKTsKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKgorICAgICAgICAgICAgICAgIEdPIFRPIFRIRSBCRUdJTk5JTkcgT0YgVEhFIENVUlJF TlQgTElORS4KKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICAvKiBQbGFjZSB0aGUgSVQgb24g dGhlIGN1cnJlbnQgbGluZSBjb250YWluaW5nIFBULiAqLworICBpbnQgdm9mZnNldCA9IChXSU5E T1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KSA+IDAKKyAgICAgICAgICAgICAgICAgJiYgdy0+b3V0 cHV0X2N1cnNvci52cG9zID4gMCkKKyAgICAgICAgICAgICAgICAgID8gdy0+b3V0cHV0X2N1cnNv ci52cG9zIC0gMQorICAgICAgICAgICAgICAgICAgOiB3LT5vdXRwdXRfY3Vyc29yLnZwb3M7Cisg IGlmICh2b2Zmc2V0ID4gMCkKKyAgICBtb3ZlX2l0X2J5X2xpbmVzICgmaXQsIHZvZmZzZXQpOwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgIE1PVkUgSVQ6 ICBJTkNSRU1FTlQgPT0gMSBwaXhlbAorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisgIGZwcmlu dGYgKHN0ZGVyciwgIlxuaXQuZmlyc3RfdmlzaWJsZV94ICglZClcbiIsIGl0LmZpcnN0X3Zpc2li bGVfeCk7CisgIHdoaWxlICghZmluYWxfbG9vcF9wKQorICAgIHsKKyAgICAgIG1jX2RlYnVnX3Ag PSB0cnVlOworICAgICAgZmluYWxfbG9vcF9wID0gKElUX0NIQVJQT1MgKGl0KSA9PSBaVikKKyAg ICAgICAgICAgICAgICAgICAgICAgPyB0cnVlCisgICAgICAgICAgICAgICAgICAgICA6IChGRVRD SF9CWVRFIChJVF9CWVRFUE9TIChpdCkpID09ICdcbicKKyAgICAgICAgICAgICAgICAgICAgICAg ICYmIGl0LmMgIT0gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgPyB0cnVlCisgICAgICAgICAg ICAgICAgICAgICA6IChyYyA9PSBNT1ZFX0xJTkVfQ09OVElOVUVEKQorICAgICAgICAgICAgICAg ICAgICAgICA/IHRydWUKKyAgICAgICAgICAgICAgICAgICAgIDogKHJjID09IE1PVkVfTElORV9U UlVOQ0FURUQKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIGl0LmN1cnJlbnRfeCAtIGl0LmZp cnN0X3Zpc2libGVfeCA+IHRleHRfYXJlYV93aWR0aCkKKyAgICAgICAgICAgICAgICAgICAgICAg PyB0cnVlCisgICAgICAgICAgICAgICAgICAgICA6IGZhbHNlOworICAgICAgaWYgKGl0LmN1cnJl bnRfeCA+IHByZXZpb3VzX2l0X2N1cnJlbnRfeAorICAgICAgICAgIHx8IElUX0NIQVJQT1MgKGl0 KSA+IHByZXZpb3VzX2l0X2NoYXJwb3MKKyAgICAgICAgICB8fCBpdC5jICE9IHByZXZpb3VzX2l0 X2MKKyAgICAgICAgICB8fCBpdC5jID09IDAKKyAgICAgICAgICB8fCBpdC5jID09IDEwKQorICAg ICAgICB7CisgICAgICAgICAgTGlzcF9PYmplY3QgY2hhcmFjdGVyID0gRmNoYXJfdG9fc3RyaW5n IChtYWtlX251bWJlciAoaXQuYykpOworICAgICAgICAgIGludCBjaGFycG9zID0gSVRfQ0hBUlBP UyAoaXQpOworICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIlxuY2hhcnBvcyAoJWQvJWQvJWQp IHwgZmlyc3RfeCAoJWQpIHwgcHJldmlvdXNfeCAoJWQpIHwgeCAoJWQpIHwgYyAoJXMpIHwgcHcg KCVkKSB8IGhwb3MgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXJwb3Ms IHByZXZpb3VzX2l0X2NoYXJwb3MsIEZFVENIX0JZVEUgKElUX0JZVEVQT1MgKGl0KSksCisgICAg ICAgICAgICAgICAgICAgICAgICAgICBpdC5maXJzdF92aXNpYmxlX3gsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICBwcmV2aW91c19pdF9jdXJyZW50X3gsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICBpdC5jdXJyZW50X3gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAoKCFOSUxQ IChjaGFyYWN0ZXIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGl0LmMgPT0gOSkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICJcXHQiCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIGl0LmMgPT0gMTApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyAiXFxuIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVy KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBpdC5jICE9IDkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgaXQuYyAhPSAxMCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IFNTREFUQSAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6ICI/IiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICBpdC5waXhlbF93aWR0 aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0Lmhwb3MpOworICAgICAgICAgIHByZXZp b3VzX2l0X2MgPSBpdC5jOworICAgICAgICAgIHByZXZpb3VzX2l0X2N1cnJlbnRfeCA9IGl0LmN1 cnJlbnRfeDsKKyAgICAgICAgICBwcmV2aW91c19pdF9jaGFycG9zID0gSVRfQ0hBUlBPUyAoaXQp OworICAgICAgICAgIHByZXZpb3VzX2l0X2ZldGNoYnl0ZSA9IEZFVENIX0JZVEUgKElUX0JZVEVQ T1MgKGl0KSk7CisgICAgICAgICAgcHJldmlvdXNfaXRfcGl4ZWxfd2lkdGggPSBpdC5waXhlbF93 aWR0aDsKKyAgICAgICAgICBjb3VudCArPSAxOworICAgICAgICB9CisgICAgICBuZXdfeCArPSAx OworICAgICAgU0FWRV9JVCAoaXQyLCBpdCwgaXQyZGF0YSk7CisgICAgICByYyA9IG1vdmVfaXRf aW5fZGlzcGxheV9saW5lX3RvICgmaXQsIFpWLCBuZXdfeCwgTU9WRV9UT19QT1MgfCBNT1ZFX1RP X1gpOworICAgICAgU0FWRV9JVCAoaXQzLCBpdCwgaXQzZGF0YSk7CisgICAgfQorLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUSEUgRU5E CisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAgbWNfZGVidWdfcCA9IGZhbHNlOworICBiaWRp X3Vuc2hlbHZlX2NhY2hlIChpdGRhdGEsIGZhbHNlKTsKKyAgcmV0dXJuIFFuaWw7Cit9CisKKy8q IGVuZCBNVUxUSVBMRSBDVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAM CiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioKIAkJICAgICAgV2luZG93IGRpc3BsYXkgZGltZW5zaW9ucwpAQCAt MTEyMDAsNyArMTU1NTUsOSBAQCByZXNpemVfZWNob19hcmVhX2V4YWN0bHkgKHZvaWQpCiAJewog CSAgd2luZG93c19vcl9idWZmZXJzX2NoYW5nZWQgPSA0MjsKIAkgIHVwZGF0ZV9tb2RlX2xpbmVz ID0gMzA7Ci0JICByZWRpc3BsYXlfaW50ZXJuYWwgKCk7CisgICAgICBtY19yZWRpc3BsYXlfaW50 ZXJuYWwgPSAxOworICAgICAgcmVkaXNwbGF5X2ludGVybmFsICgxKTsKKyAgICAgIG1jX3JlZGlz cGxheV9pbnRlcm5hbCA9IDA7CiAJfQogICAgIH0KIH0KQEAgLTExNjg3LDcgKzE2MDQ0LDkgQEAg ZWNob19hcmVhX2Rpc3BsYXkgKGJvb2wgdXBkYXRlX2ZyYW1lX3ApCiAJICAgICAgcHRyZGlmZl90 IGNvdW50ID0gU1BFQ1BETF9JTkRFWCAoKTsKIAkgICAgICBzcGVjYmluZCAoUXJlZGlzcGxheV9k b250X3BhdXNlLCBRdCk7CiAJICAgICAgZnNldF9yZWRpc3BsYXkgKGYpOwotCSAgICAgIHJlZGlz cGxheV9pbnRlcm5hbCAoKTsKKyAgICAgICAgICBtY19yZWRpc3BsYXlfaW50ZXJuYWwgPSAyOwor ICAgICAgICAgIHJlZGlzcGxheV9pbnRlcm5hbCAoMik7CisgICAgICAgICAgbWNfcmVkaXNwbGF5 X2ludGVybmFsID0gMDsKIAkgICAgICB1bmJpbmRfdG8gKGNvdW50LCBRbmlsKTsKIAkgICAgfQog CSAgZWxzZSBpZiAoRlJBTUVfV0lORE9XX1AgKGYpICYmIG4gPT0gMCkKQEAgLTEzMzY2LDYgKzE3 NzI1LDE5IEBAIGhzY3JvbGxfd2luZG93X3RyZWUgKExpc3BfT2JqZWN0IHdpbmRvdykKIAkgICAg ICBlbHNlCiAJCXB0ID0gY2xpcF90b19ib3VuZHMgKEJFR1YsIG1hcmtlcl9wb3NpdGlvbiAody0+ cG9pbnRtKSwgWlYpOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUg Q1VSU09SUyAqLworCisgIHN0cnVjdCBkaXNwbGF5X3BvcyAqcG9zID0gJmN1cnNvcl9yb3ctPnN0 YXJ0OworICBwdHJkaWZmX3QgY2hhcnBvcyA9IENIQVJQT1MgKHBvcy0+cG9zKTsKKyAgYm9vbCBi YXJmX2NyYXNoID0gKGNoYXJwb3MgPCAwIHx8IChjaGFycG9zID49IEJVRl9CRUcgKGN1cnJlbnRf YnVmZmVyKSAmJiBjaGFycG9zIDw9IFpWKSkgPyBmYWxzZSA6IHRydWU7CisgIGlmIChiYXJm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4sIGxlZnQvcmlnaHQgY3Vyc29yIG1vdmVtZW50IG9uIHNjcmVlbiBsaW5lcyBzdWJzZXF1 ZW50CisgICAgdG8gdGhlIGZpcnN0IHNjcmVlbiBsaW5lKSwgYnlwYXNzIGByZWRpc3BsYXlfd2lu ZG93Jy4gKi8KKworICAgICAgbWNfcmVtb3ZlX211bHRpcGxlX2N1cnNvcnMgKHcpOworICAgICAg bWNfcmVtb3ZlX2Nyb3NzaGFpcnMgKHcpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAJICAgICAgZ290byB1cGRhdGU7CiAJICAgIH0KIAkgIGVsc2UKQEAgLTE0MzAzLDYgKzE4NzA0 LDIyIEBAIHJlZGlzcGxheV9pbnRlcm5hbCAodm9pZCkKIAkJICAmJiAodyA9IFhXSU5ET1cgKHNl bGVjdGVkX3dpbmRvdykpICE9IHN3KQogCQlnb3RvIHJldHJ5OwogCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisvKiBOT1RFOiAgQW4gaWRsZS10 aW1lciBmdW5jdGlvbiBtYXkgbm90IG5lY2Vzc2FyaWx5IHRyaWdnZXIgYHJlZGlzcGxheV93aW5k b3cnLgorICAgYHctPm11c3RfYmVfdXBkYXRlZF9wJyBpcyBzZXQgdG8gdHJ1ZSB3aXRoaW4gYG1j LWFjdGl2YXRlLWNyb3NzaGFpcnMnLgorLSAgYG9wdGltaXphdGlvbiAxYCAoZS5nLiwgbGVmdC9y aWdodCBjdXJzb3IgbW92ZW1lbnQgb24gdGhlIGZpcnN0IHNjcmVlbiBsaW5lKS4KKy0gIGBvcHRp bWl6YXRpb24gM2AgKGUuZy4sIGxlZnQvcmlnaHQgY3Vyc29yIG1vdmVtZW50I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KGUuZy4sIGxlZnQvcmlnaHQgY3Vyc29yIG1vdmVtZW50 IG9uIHRoZSBmaXJzdCBzY3JlZW4gbGluZSkuCistICBgb3B0aW1pemF0aW9uIDNgIChlLmcuLCBs ZWZ0L3JpZ2h0IGN1cnNvciBtb3ZlbWVudCBvbiBzY3JlZW4gbGluZXMgc3Vic2VxdWVudAorICAg IHRvIHRoZSBmaXJzdCBzY3JlZW4gbGluZSksIGJ5cGFzcyBgcmVkaXNwbGF5X3dpbmRvdycuICov CisKKyAgICAgIG1jX3JlbW92ZV9tdWx0aXBsZV9jdXJzb3JzICh3KTsKKyAgICAgIG1jX3JlbW92 ZV9jcm9zc2hhaXJzICh3KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCQkgIGdv dG8gdXBkYXRlOwogCQl9CiAJICAgICAgZWxzZQpAQCAtMTQ3MjQsMTYgKzE5MTU4LDM2IEBAIHJl ZGlzcGxheV9wcmVzZXJ2ZV9lY2hvX2FyZWEgKGludCBmcm9tX3doZXJlKQogICBibG9ja19idWZm ZXJfZmxpcHMgKCk7CiAgIHVuYmxvY2tfaW5wdXQgKCk7CiAKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgc3RydWN0IHdpbmRvdyAqdyA9IGRl Y29kZV9saXZlX3dpbmRvdyAoc2VsZWN0ZWRfd2luZG93KTsKKyAgdy0+bWMucmVkaXNwbGF5X3By ZXNlcnZlX2VjaG9fYXJlYSA9IGZyb21fd2hlcmU7CisgIG1jX3JlZGlzcGxheV9wcmVzZXJ2ZV9l Y2hvX2FyZWEgPSBmcm9tX3doZXJlOworCiAgIGlmICghTklMUCAoZWNob19hcmVhX2J1ZmZlclsx XSkpCiAgICAgewogICAgICAgLyogV2UgaGF2ZSBhIHByZXZpb3VzbHkgZGlzcGxheWVkIG1lc3Nh Z2UsIGJ1dCBubyBjdXJyZW50CiAJIG1lc3NhZ2UuICBSZWRpc3BsYXkgdGhlIHByZXZpb3VzIG1l c3NhZ2UuICAqLwogICAgICAgZGlzcGxheV9sYXN0X2Rpc3BsYXllZF9tZXNzYWdlX3AgPSB0cnVl OwotICAgICAgcmVkaXNwbGF5X2ludGVybmFsICgpOworICAgICAgbWNfcmVkaXNwbGF5X2ludGVy bmFsID0gNDsKKyAgICAgIHJlZGlzcGxheV9pbnRlcm5hbCAoNCk7CisgICAgICBtY19yZWRpc3Bs YXlfaW50ZXJuYWwgPSAwOwogICAgICAgZGlzcGxheV9sYXN0X2Rpc3BsYXllZF9tZXNzYWdlX3Ag PSBmYWxzZTsKICAgICB9CiAgIGVsc2UKLSAgICByZWRpc3BsYXlfaW50ZXJuYWwgKCk7CisgICAg eworICAgICAgbWNfcmVkaXNwbGF5X2ludGVybmFsID0gNTsKKyAgICAgIHJlZGlzcGxheV9pbnRl cm5hbCAoNSk7CisgICAgICBtY19yZWRpc3BsYXlfaW50ZXJuYWwgPSAwOworICAgIH0KKworICB3 LT5tYy5yZWRpc3BsYXlfcHJlc2VydmVfZWNob19hcmVhID0gMDsKKyAgbWNfcmVkaXNwbGF5X3By ZXNlcnZlX2VjaG9fYXJlYSA9IDA7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCiAKICAg Zmx1c2hfZnJhbWUgKFNFTEVDVEVEX0ZSQU1FICgpKTsKICAgdW5iaW5kX3RvIChjb3VudCwgUW5p bCk7CkBAIC0xNzI1OSw2ICsyMTcxMywxNiBAQCByZWRpc3BsYXlfd2luZG93IChMaXNwX09iamVj dCB3aW5kb3csIGJvb2wganVzdF90aGlzX29uZV9wKQogICBkZWJ1Z19tZXRob2RfYWRkICh3LCAi cmVjZW50ZXIiKTsKICNlbmRpZgogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUgQ1VSU09SUyAqLworCisgIG1jX3JlbW92ZV9tdWx0aXBsZV9jdXJzb3JzICh3KTsKKyAg bWNfcmVtb3ZlX2Nyb3NzaGFpcnMgKHcpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAgIC8qIEZvcmdldCBhbnkgcHJldmlvdXNseSByZWNvcmRlZCBiYXNlIGxpbmUgZm9yIGxpbmUg bnVtYmVyIGRpc3BsYXkuICAqLwogICBpZiAoIWJ1ZmZlcl91bmNoYW5nZWRfcCkKICAgICB3LT5i YXNlX2xpbmVfbnVtYmVyID0gMDsKQEAgLTE3Njg5LDYgKzIyMTUzLDIyIEBAIHJlZGlzcGxheV93 aW5kb3cgKExpc3BfT2JqZWN0IHdpbmRvdywgYm9vbCBqdXN0X3RoaXNfb25lX3ApCiAgIGVsc2UK ICAgICBURU1QX1NFVF9QVF9CT1RIIChDSEFSUE9TIChvcG9pbnQpLCBCWVRFUE9TIChvcG9pbnQp KTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8K KworLyogTk9URTogIEFuIGlkbGUtdGltZXIgZnVuY3Rpb24gbWF5IG5vdCBuZWNlc3NhcmlseSB0 cmlnZ2VyIGByZWRpc3BsYXlfd2luZG93Jy4KKyAgIGB3LT5tdXN0X2JlX3VwZGF0ZWRfcCcgaXMg c2V0IHRvIHRydWUgd2l0aGluIGBtYy1hY3RpdmF0ZS1jcm9zc2hhaXJzJy4KKy0gIGBvcHRpbWl6 YXRpb24gMWAgKGUuZy4sIGxlZnQvcmlnaHQgY3Vyc29yIG1vdmVtZW50IG9uIHRoZSBmaXJzdCBz Y3JlZW4gbGluZSkuCistICBgb3B0aW1pemF0aW9uIDNgIChlLmcuLCBsZWZ0L3JpZ2h0IGN1cnNv ciBtb3ZlbWVudCBvbiBzY3JlZW4gbGluZXMgc3Vic2VxdWVudAorICAgIHRvIHRoZSBmaXJzdCBz Y3JlZW4gbGluZSksIGJ5cGFzcyBgcmVkaXNwbGF5X3dpbmRvdycuICovCisKKyAgbWNfcmVtb3Zl X211bHRpcGxlX2N1cnNvcnMgKHcpOworICBtY19yZW1vdmVfY3Jvc3NoYWlycyAodyk7CisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKICAgc2V0X2J1ZmZlcl9pbnRlcm5hbF8xIChvbGQp OwogICAvKiBBdm9pZCBhbiBhYm9ydCBpbiBURU1QX1NFVF9QVF9CT1RIIGlmIHRoZSBidWZmZXIg aGFzIGJlY29tZQogICAgICBzaG9ydGVyLiAgVGhpcyBjYW4gYmUgY2F1c2VkIGJ5IGxvZyB0cnVu Y2F0aW9uIGluICpNZXNzYWdlcyouICAqLwpAQCAtMjAwNzgsNiArMjQ1NTgsMTcgQEAgYXBwZW5k X3NwYWNlX2Zvcl9uZXdsaW5lIChzdHJ1Y3QgaXQgKml0LCBib29sIGRlZmF1bHRfZmFjZV9wKQog CSAgbWVtc2V0ICgmaXQtPnBvc2l0aW9uLCAwLCBzaXplb2YgaXQtPnBvc2l0aW9uKTsKIAkgIGl0 LT5vYmplY3QgPSBRbmlsOwogCSAgaXQtPmMgPSBpdC0+Y2hhcl90b19kaXNwbGF5ID0gJyAnOwor CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisg ICAgICBpZiAoSVRfQllURVBPUyAoKml0KSA+PSBaVl9CWVRFKQorICAgICAgICBpdC0+enZfcCA9 IHRydWU7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgIGl0LT5sZW4gPSAxOwog CiAJICAvKiBJZiB0aGUgZGVmYXVsdCBmYWNlIHdhcyByZW1hcHBlZCwgYmUgc3VyZSB0byB1c2Ug dGhlCkBAIC0yMTA0MSw2ICsyNTUzMiwyMSBAQCBkaXNwbGF5X2NvdW50X2xpbmVzX3Zpc3VhbGx5 IChzdHJ1Y3QgaXQgKml0KQogc3RhdGljIHZvaWQKIG1heWJlX3Byb2R1Y2VfbGluZV9udW1iZXIg KHN0cnVjdCBpdCAqaXQpCiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRSBDVVJTT1JTICovCisKKyAgYm9vbCBiYXJmX2NyYXNoID0gKGl0LT5nbHlwaF9yb3cgPT0g TlVMTAorICAgICAgICAgICAgICAgICAgICAgfHwgaXQtPmdseXBoX3Jvdy0+dXNlZFtURVhUX0FS RUFdID09IDApCisgICAgICAgICAgICAgICAgICAgID8gZmFsc2UKKyAgICAgICAgICAgICAgICAg ICAgOiB0cnVlOworICBpZiAoYmFyZl9jcmFzaCkKKyAgICByZXR1cm47CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKICAgcHRyZGlmZl90IGxhc3RfbGluZSA9IGl0LT5sbnVtOwogICBw dHJkaWZmX3Qgc3RhcnRfZnJvbSwgYnl0ZXBvczsKICAgcHRyZGlmZl90IHRoaXNfbGluZTsKQEAg LTIxMTg1LDggKzI1Njk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qKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgICAgICBpZiAoYmV5 b25kX3p2KQorICAgICAgICB0ZW1faXQuenZfcCA9IHRydWU7CisgICAgICB0ZW1faXQuY3VycmVu dF95ID0gaXQtPmN1cnJlbnRfeTsKKyAgICAgIHRlbV9pdC52cG9zID0gaXQtPnZwb3M7CiAgICAg ICAvKiBNYWtlIHN1cmUgdGhlc2UgZ2x5cGhzIHdpbGwgaGF2ZSBhICJwb3NpdGlvbiIgb2YgLTEu ICAqLwogICAgICAgU0VUX1RFWFRfUE9TICh0ZW1faXQucG9zaXRpb24sIC0xLCAtMSk7CiAgICAg ICBQUk9EVUNFX0dMWVBIUyAoJnRlbV9pdCk7CisgICAgICB0ZW1faXQuaHBvcyArPSAxOworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KIAotICAgICAgLyogU3RvcCBwcm9kdWNpbmcgZ2x5cGhz IGlmIHdlIGRvbid0IGhhdmUgZW5vdWdoIHNwYWNlIG9uCi0JIHRoaXMgbGluZS4gIEZJWE1FOiBz aG91bGQgd2UgcmVmcmFpbiBmcm9tIHByb2R1Y2luZyB0aGUKLQkgbGluZSBudW1iZXIgYXQgYWxs IGluIHRoYXQgY2FzZT8gICovCi0gICAgICBpZiAodGVtX2l0LmN1cnJlbnRfeCA+IHRlbV9pdC5s YXN0X3Zpc2libGVfeCkKKworICAgICAgLyogU3RvcCBwcm9kdWNpbmcgZ2x5cGhzLCBhbmQgcmVm cmFpbiBmcm9tIHByb2R1Y2luZyB0aGUgbGluZQorCSBudW1iZXIsIGlmIHdlIGRvbid0IGhhdmUg ZW5vdWdoIHNwYWNlIG9uIHRoaXMgbGluZS4gICovCisgICAgICBpZiAodGVtX2l0LmN1cnJlbnRf eCA+PSB3aWR0aF9saW1pdCkKIAl7Ci0JICBzY3JhdGNoX2dseXBoX3Jvdy51c2VkW1RFWFRfQVJF QV0gPSBuX2dseXBoc19iZWZvcmU7Ci0JICBicmVhazsKKwkgIGl0LT5sbnVtX3dpZHRoID0gMDsK KwkgIGl0LT5sbnVtX3BpeGVsX3dpZHRoID0gMDsKKwkgIGJpZGlfdW5zaGVsdmVfY2FjaGUgKGl0 ZGF0YSwgZmFsc2UpOworCSAgcmV0dXJuOwogCX0KICAgICB9CiAKQEAgLTI2OTk3LDYgKzMxNTIw LDI0IEBAIGFwcGVuZF9nbHlwaCAoc3RydWN0IGl0ICppdCkKIAkgICAgZ1sxXSA9ICpnOwogCSAg Z2x5cGggPSBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJlYV07CiAJfQorCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+eCA9 IGl0LT5jdXJyZW50X3g7CisKKyAgICAgIGdseXBoLT55ID0gaXQtPmN1cnJlbnRfeTsKKworICAg ICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKworICAgICAgZ2x5cGgtPnZwb3MgPSBpdC0+dnBv czsKKworICAgICAgZ2x5cGgtPnp2X3AgPSBpdC0+enZfcDsKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogICAgICAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9zaXRpb24p OwogICAgICAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAgICAgICBpZiAoaXQtPnBpeGVs X3dpZHRoID4gMCkKQEAgLTI3MDgwLDYgKzMxNjIxLDI0IEBAIGFwcGVuZF9jb21wb3NpdGVfZ2x5 cGggKHN0cnVjdCBpdCAqaXQpCiAJICAgIGdbMV0gPSAqZzsKIAkgIGdseXBoID0gaXQtPmdseXBo X3Jvdy0+Z2x5cGhzW2l0LT5hcmVhXTsKIAl9CisKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgICAgIGdseXBoLT54ID0gaXQtPmN1cnJlbnRf eDsKKworICAgICAgZ2x5cGgtPnkgPSBpdC0+Y3VycmVudF95OworCisgICAgICBnbHlwaC0+aHBv cyA9IGl0LT5ocG9zOworCisgICAgICBnbHlwaC0+dnBvcyA9IGl0LT52cG9zOworCisgICAgICBn bHlwaC0+enZfcCA9IGl0LT56dl9wOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAg ICAgICBnbHlwaC0+Y2hhcnBvcyA9IGl0LT5jbXBfaXQuY2hhcnBvczsKICAgICAgIGdseXBoLT5v YmplY3QgPSBpdC0+b2JqZWN0OwogICAgICAgZWFzc2VydCAoaXQtPnBpeGVsX3dpZHRoIDw9IFNI UlRfTUFYKTsKQEAgLTI3Mjg4LDYgKzMxODQ3LDI0IEBAIHByb2R1Y2VfaW1hZ2VfZ2x5cGggKHN0 cnVjdCBpdCAqaXQpCiAJfQogICAgICAgaWYgKGdseXBoIDwgaXQtPmdseXBoX3Jvdy0+Z2x5cGhz W2FyZWEgKyAxXSkKIAl7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RSBDVVJTT1JTICovCisKKyAgICAgIGdseXBoLT54ID0gaXQtPmN1cnJlbnRfeDsKKworICAgICAg Z2x5cGgtPnkgPSBpdC0+Y3VycmVudF95OworCisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9z OworCisgICAgICBnbHlwaC0+dnBvcyA9IGl0LT52cG9zOworCisgICAgICBnbHlwaC0+enZfcCA9 IGl0LT56dl9wOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICBnbHlwaC0+Y2hh cnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAJICBnbHlwaC0+b2JqZWN0ID0gaXQtPm9i amVjdDsKIAkgIGdseXBoLT5waXhlbF93aWR0aCA9IGNsaXBfdG9fYm91bmRzICgtMSwgaXQtPnBp eGVsX3dpZHRoLCBTSFJUX01BWCk7CkBAIC0yNzM5MSw2ICszMTk2OCwyNCBAQCBwcm9kdWNlX3h3 aWRnZXRfZ2x5cGggKHN0cnVjdCBpdCAqaXQpCiAJfQogICAgICAgaWYgKGdseXBoIDwgaXQtPmds eXBoX3Jvdy0+Z2x5cGhzW2FyZWEgKyAxXSkKIAl7CisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgICAgIGdseXBoLT54ID0gaXQtPmN1cnJl bnRfeDsKKworICAgICAgZ2x5cGgtPnkgPSBpdC0+Y3VycmVudF95OworCisgICAgICBnbHlwaC0+ aHBvcyA9IGl0LT5ocG9zOworCisgICAgICBnbHlwaC0+dnBvcyA9IGl0LT52cG9zOworCisgICAg ICBnbHlwaC0+enZfcCA9IGl0LT56dl9wOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAJICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAJICBnbHlwaC0+ b2JqZWN0ID0gaXQtPm9iamVjdDsKIAkgIGdseXBoLT5waXhlbF93aWR0aCA9IGNsaXBfdG9fYm91 bmRzICgtMSwgaXQtPnBpeGVsX3dpZHRoLCBTSFJUX01BWCk7CkBAIC0yNzQ3Nyw2ICszMjA3Miwy NCBAQCBhcHBlbmRfc3RyZXRjaF9nbHlwaCAoc3RydWN0IGl0ICppdCwgTGlzcF9PYmplY3Qgb2Jq ZWN0LAogCSAgICB3aWR0aCAtPSBpdC0+Zmlyc3RfdmlzaWJsZV94IC0gaXQtPmN1cnJlbnRfeDsK IAkgIGVhc3NlcnQgKHdpZHRoID4gMCk7CiAJfQorCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+eCA9IGl0LT5jdXJyZW50 X3g7CisKKyAgICAgIGdseXBoLT55ID0gaXQtPmN1cnJlbnRfeTsKKworICAgICAgZ2x5cGgtPmhw b3MgPSBpdC0+aHBvczsKKworICAgICAgZ2x5cGgtPnZwb3MgPSBpdC0+dnBvczsKKworICAgICAg Z2x5cGgtPnp2X3AgPSBpdC0+enZfcDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog ICAgICAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9zaXRpb24pOwogICAgICAgZ2x5 cGgtPm9iamVjdCA9IG9iamVjdDsKICAgICAgIC8qIEZJWE1FOiBJdCB3b3VsZCBiZSBiZXR0ZXIg dG8gdXNlIFRZUEVfTUFYIGhlcmUsIGJ1dApAQCAtMjc5MjYsNiArMzI1MzksMjQgQEAgYXBwZW5k X2dseXBobGVzc19nbHlwaCAoc3RydWN0IGl0ICppdCwgaW50IGZhY2VfaWQsIGJvb2wgZm9yX25v X2ZvbnQsIGludCBsZW4sCiAJICAgIGdbMV0gPSAqZzsKIAkgIGdseXBoID0gaXQtPmdseXBoX3Jv dy0+Z2x5cGhzW2FyZWFdOwogCX0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1V TFRJUExFIENVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPnggPSBpdC0+Y3VycmVudF94OworCisg ICAgICBnbHlwaC0+eSA9IGl0LT5jdXJyZW50X3k7CisKKyAgICAgIGdseXBoLT5ocG9zID0gaXQt Pmhwb3M7CisKKyAgICAgIGdseXBoLT52cG9zID0gaXQtPnZwb3M7CisKKyAgICAgIGdseXBoLT56 dl9wID0gaXQtPnp2X3A7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIGds eXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5vYmpl Y3QgPSBpdC0+b2JqZWN0OwogICAgICAgZWFzc2VydCAoaXQtPnBpeGVsX3dpZHRoIDw9IFNIUlRf TUFYKTsKQEAgLTI5NjkyLDkgKzM0MzIzLDMyIEBAIGRpc3BsYXlfYW5kX3NldF9jdXJzb3IgKHN0 cnVjdCB3aW5kb3cgKncsIGJvb2wgb24sCiAgICAgICB3LT5waHlzX2N1cnNvci52cG9zID0gdnBv czsKICAgICB9CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJT T1JTICovCisKKyAgdy0+bWMuaCA9IC0xOworICB3LT5tYy5meCA9IC0xOworICB3LT5tYy5meSA9 IC0xOworICB3LT5tYy5nbHlwaF9mbGF2b3IgPSBOT19GTEFWT1I7CisgIHctPm1jLnJlZCA9IC0x LjA7CisgIHctPm1jLmdyZWVuID0gLTEuMDsKKyAgdy0+bWMuYmx1ZSA9IC0xLjA7CisgIHctPm1j LnBvc2ludCA9IC0xOworCiAgIEZSQU1FX1JJRiAoZiktPmRyYXdfd2luZG93X2N1cnNvciAodywg Z2x5cGhfcm93LCB4LCB5LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5l d19jdXJzb3JfdHlwZSwgbmV3X2N1cnNvcl93aWR0aCwKICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBvbiwgYWN0aXZlX2N1cnNvcik7CisKKyAgbWNfbXVsdGlwbGVfY3Vyc29y c19wb3J0YWwgKHcsIG9uLCBhY3RpdmVfY3Vyc29yKTsKKworICAvKiBUaGUgcmVhbCBjdXJzb3Ig KGRyYXduIGFib3ZlKSBpcyBnZXRzIHJlbW92ZWQgYnkgY3Jvc3NoYWlycy4KKyAgYG1jX2RyYXdf Y3Jvc3NoYWlycycgcmVsaWVzIHVwb24gYHctPnBoeXNfY3Vyc29yLngveS9ocG9zL3Zwb3MnIHdo ZW4gT04uICovCisgIG1jX2Nyb3NzaGFpcnNfcG9ydGFsICh3LCBvbiwgYWN0aXZlX2N1cnNvcik7 CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIH0KIAogCkBAIC0yOTcyNiwxMCArMzQz ODAsMjUgQEAgdXBkYXRlX3dpbmRvd19jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgb24p CiAgICAgICBpZiAocm93LT5yZXZlcnNlZF9wICYmIGhwb3MgPj0gcm93LT51c2VkW1RFWFRfQVJF QV0pCiAJaHBvcyA9IHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMTsKIAorCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworICAgICAgLyogRklYTUU6ICBU aGVzZSByZXN0cmljdGlvbnMgYXJlIGxpa2VseSB0aGUgcmVhc29ucyB0aGF0IGNyb3NzaGFpcnMg YW5kCisgICAgICBtdWx0aXBsZSBmYWtlIGN1cnNvcnMgYXJlIG5vdCB3b3JraW5nIG9uIE1hY09T IE1vamF2ZS4gIEBsYXdsaXN0IGRvZXMgbm90CisgICAgICBwcmVzZW50bHkgaGF2ZSBhY2Nlc3Mg dG8gYSBjb21wdXRlciB3aXRoIHRoYXQgdmVyc2lvbiBvZiB0aGUgT1MuICovCisgICAgICBpZiAo IW1jX2Nyb3NzaGFpcnNfcCAodykKKyAgICAgICAgICAmJiAhbWNfbXVsdGlwbGVfY3Vyc29yc19w ICh3KSkKKyAgICAgICAgewogICAgICAgYmxvY2tfaW5wdXQgKCk7CiAgICAgICBkaXNwbGF5X2Fu ZF9zZXRfY3Vyc29yICh3LCBvbiwgaHBvcywgdnBvcywKIAkJCSAgICAgIHctPnBoeXNfY3Vyc29y LngsIHctPnBoeXNfY3Vyc29yLnkpOwogICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAg fQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgfQogfQogCkBAIC0zMjQzNiw2 ICszNzEwNSwyNiBAQCB4X2ludGVyc2VjdF9yZWN0YW5nbGVzIChYUmVjdGFuZ2xlICpyMSwgWFJl Y3RhbmdsZSAqcjIsIFhSZWN0YW5nbGUgKnJlc3VsdCkKIHZvaWQKIHN5bXNfb2ZfeGRpc3AgKHZv aWQpCiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JT ICovCisKKyAgZGVmc3ViciAoJlNtY19kdW1wX2dseXBoX3Jvdyk7CisKKyAgZGVmc3ViciAoJlNt Y19kdW1wX2dseXBoX21hdHJpeCk7CisKKyAgZGVmc3ViciAoJlNtY19hY3RpdmF0ZV9tdWx0aXBs ZV9jdXJzb3JzKTsKKworICBkZWZzdWJyICgmU21jX2FjdGl2YXRlX2Nyb3NzaGFpcnMpOworCisg IGRlZnN1YnIgKCZTbWNfc3RkZXJyKTsKKworICBkZWZzdWJyICgmU21jX2RlYnVnKTsKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogICBWd2l0aF9lY2hvX2FyZWFfc2F2ZV92ZWN0b3Ig PSBRbmlsOwogICBzdGF0aWNwcm8gKCZWd2l0aF9lY2hvX2FyZWFfc2F2ZV92ZWN0b3IpOwogCmRp ZmYgLS1naXQgYS9zcmMveHRlcm0uYyBiL3NyYy94dGVybS5jCmluZGV4IGFmMjhkYWIuLmQ5OWI5 ZTcgMTAwNjQ0Ci0tLSBhL3NyYy94dGVybS5jCisrKyBiL3NyYy94dGVybS5jCkBAIC0xNTMwLDYg KzE1MzAsMjAgQEAgc3RhdGljIHZvaWQgeF9jaGVja19mb250IChzdHJ1Y3QgZnJhbWUgKiwgc3Ry dWN0IGZvbnQgKik7CiBzdGF0aWMgdm9pZAogeF9zZXRfY3Vyc29yX2djIChzdHJ1Y3QgZ2x5cGhf c3RyaW5nICpzKQogeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUg Q1VSU09SUyAqLworCisgIGlmIChzLT53LT5tYy5jdXJzb3JfZ2NfZGVmYXVsdCkKKyAgICB7Cisg ICAgICBzLT5nYyA9IHMtPmYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYzsKKyAgICAgIHJldHVy bjsKKyAgICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgaWYgKHMtPmZvbnQg PT0gRlJBTUVfRk9OVCAocy0+ZikKICAgICAgICYmIHMtPmZhY2UtPmJhY2tncm91bmQgPT0gRlJB TUVfQkFDS0dST1VORF9QSVhFTCAocy0+ZikKICAgICAgICYmIHMtPmZhY2UtPmZvcmVncm91bmQg PT0gRlJBTUVfRk9SRUdST1VORF9QSVhFTCAocy0+ZikKQEAgLTkyNTIsNiArOTI2NiwyNiBAQCB4 X2RyYXdfaG9sbG93X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAq cm93KQogCiAgIC8qIENvbXB1dGUgZnJhbWUtcmVsYXRpdmUgY29vcmRpbmF0ZXMgZm9yIHBoeXMg Y3Vyc29yLiAgKi8KICAgZ2V0X3BoeXNfY3Vyc29yX2dlb21ldHJ5ICh3LCByb3csIGN1cnNvcl9n bHlwaCwgJngsICZ5LCAmaCk7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRSBDVVJTT1JTICovCisKKy8qIExFR0VORDoKKworLSAgdG9wIHkgPT0gV0lORE9XX1RPX0ZS QU1FX1BJWEVMX1kgKHcsIHJvdy0+eSkKKworLSAgYm90dG9tIHkgPT0gV0lORE9XX1RPX0ZSQU1F X1BJWEVMX1kgKHcsIHJvdy0+eSkgLSByb3ctPmhlaWdodAorCistICBoIG9mIEhPTExPV19CT1hf Q1VSU09SID09IHJvdy0+aGVpZ2h0CisgICBbVGhpcyBhdm9pZHMgYSB2aXNpYmxlIGdhcCBhYm92 ZS9iZWxvdy5dICovCisKKyAgaWYgKHctPm1jLmggPiAwKQorICAgIGggPSByb3ctPmhlaWdodDsK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICB3ZCA9IHctPnBoeXNfY3Vyc29yX3dp ZHRoIC0gMTsKIAogICAvKiBUaGUgZm9yZWdyb3VuZCBvZiBjdXJzb3JfZ2MgaXMgdHlwaWNhbGx5 IHRoZSBzYW1lIGFzIHRoZSBub3JtYWwKQEAgLTkzMjgsNyArOTM2MiwxOCBAQCB4X2RyYXdfYmFy X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqcm93LCBpbnQgd2lk dGgsIGVudW0gdGV4dAogCSBpbnZpc2libGUuICBVc2UgdGhlIGdseXBoJ3MgZm9yZWdyb3VuZCBj b2xvciBpbnN0ZWFkIGluIHRoaXMKIAkgY2FzZSwgb24gdGhlIGFzc3VtcHRpb24gdGhhdCB0aGUg Z2x5cGgncyBjb2xvcnMgYXJlIGNob3NlbiBzbwogCSB0aGF0IHRoZSBnbHlwaCBpcyBsZWdpYmxl LiAgKi8KLSAgICAgIGlmIChmYWNlLT5iYWNrZ3JvdW5kID09IGYtPm91dHB1dF9kYXRhLngtPmN1 cnNvcl9waXhlbCkKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENV UlNPUlMgKi8KKworICAgICAgaWYgKGZhY2UtPmJhY2tncm91bmQgPT0gZi0+b3V0cHV0X2RhdGEu eC0+Y3Vyc29yX3BpeGVsCisgICAgICAgICAgJiYgIXctPm1jLmN1cnNvcl9nY19pbnZpc2libGVf b2theSkKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJeGdjdi5iYWNrZ3JvdW5k ID0geGdjdi5mb3JlZ3JvdW5kID0gZmFjZS0+Zm9yZWdyb3VuZDsKICAgICAgIGVsc2UKIAl4Z2N2 LmJhY2tncm91bmQgPSB4Z2N2LmZvcmVncm91bmQgPSBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3Jf cGl4ZWw7CkBAIC05MzU5LDYgKzk0MDQsMTcgQEAgeF9kcmF3X2Jhcl9jdXJzb3IgKHN0cnVjdCB3 aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgaW50IHdpZHRoLCBlbnVtIHRleHQKIAkg IGlmICgoY3Vyc29yX2dseXBoLT5yZXNvbHZlZF9sZXZlbCAmIDEpICE9IDApCiAJICAgIHggKz0g Y3Vyc29yX2dseXBoLT5waXhlbF93aWR0aCAtIHdpZHRoOwogCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgICAgLyogQWxpZ24gYWxsIGZha2Ug QkFSX0NVUlNPUiBvZiB0aGUgVkVSVElDQUxfUlVMRVIgd2l0aCBgb3BvaW50X3gnLiAqLworICAg IGlmICh3LT5tYy5meCA+IDApCisgICAgICB4ID0gdy0+bWMuZng7CisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKIAkgIHhfZmlsbF9yZWN0YW5nbGUgKGYsIGdjLCB4LAogCQkJICBXSU5E T1dfVE9fRlJBTUVfUElYRUxfWSAodywgdy0+cGh5c19jdXJzb3IueSksCiAJCQkgIHdpZHRoLCBy b3ctPmhlaWdodCk7CkBAIC05NDM1LDMxICs5NDkxLDE2MyBAQCB4X2RyYXdfd2luZG93X2N1cnNv ciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGd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Q0VfRlJPTV9JRCAoZiwgREVGQVVMVF9GQUNFX0lEKTsK KyAgICAgICAgICBMaXNwX09iamVjdCBidWYgPSB3LT5jb250ZW50czsKKyAgICAgICAgICBDSEVD S19CVUZGRVIgKGJ1Zik7CisgICAgICAgICAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKGJ1 Zik7CisgICAgICAgICAgYm9vbCByZWdpb25fYWN0aXZlX3AgPSAoIU5JTFAgKFZ0cmFuc2llbnRf bWFya19tb2RlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChC VkFSIChiLCBtYXJrX2FjdGl2ZSkpKTsKKyAgICAgICAgICBwdHJkaWZmX3QgcmVnaW9uX2JlZ2lu bmluZyA9IChyZWdpb25fYWN0aXZlX3ApID8gWElOVCAoRnJlZ2lvbl9iZWdpbm5pbmcgKCkpIDog LTE7CisgICAgICAgICAgcHRyZGlmZl90IHJlZ2lvbl9lbmQgPSAocmVnaW9uX2FjdGl2ZV9wKSA/ IFhJTlQgKEZyZWdpb25fZW5kICgpKSA6IC0xOworICAgICAgICAgIGJvb2wgcmVnaW9uX2luX2Jv dW5kc19wID0gKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHctPm1jLnBvc2ludCA+PSByZWdpb25fYmVnaW5uaW5nCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWMucG9zaW50IDwgcmVnaW9uX2VuZCk7Cisg ICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3Jf Z2MnIGJ5IGJvcnJvd2luZyB0aGUKKyAgICAgICAgICBmdW5jdGlvbmFsaXR5IG9mIGB4X21ha2Vf Z2MnIGluIHhmbnMuYy4gICovCisgICAgICAgICAgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAg ICAgICAgICAmJiByZWdpb25faW5fYm91bmRzX3AKKyAgICAgICAgICAgICAgJiYgYWN0aXZlX3Ap CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZl X3JlZ2lvbl9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVh bC1mYWtlLWN1cnNvci1yZWdpb24tZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgc3RydWN0 IGZhY2UgKmhvbGxvd19hY3RpdmVfcmVnaW9uX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxv d19hY3RpdmVfcmVnaW9uX2ZhY2VfaWQpOworICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAo RlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBkZWZhdWx0 X2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVf WF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfYWN0aXZl X3JlZ2lvbl9mYWNlLT5iYWNrZ3JvdW5kKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVs c2UgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgJiYgIXJlZ2lvbl9p bl9ib3VuZHNfcAorICAgICAgICAgICAgICAgICAgICAgJiYgYWN0aXZlX3ApCisgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9yZWdpb25f b3V0X2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZh a2UtY3Vyc29yLXJlZ2lvbi1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgIHN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RwdXRfZGF0YS54LT5jdXJzb3JfZ2Mg PSBvcmlnaW5hbF9jdXJzb3JfZ2M7CisgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAg ICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgZHJhd19waHlzX2N1cnNvcl9nbHlwaCAodywg Z2x5cGhfcm93LCBEUkFXX0NVUlNPUik7CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBC QVJfQ1VSU09SOgorICAgIHsKKyAgICAgIGlmICh3LT5tYy5yZWQgPj0gMCAmJiB3LT5tYy5ibHVl ID49IDAgJiYgdy0+bWMuZ3JlZW4gPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBv cmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAg ICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gY29sb3IucGl4ZWw7CisgICAg ICAgICAgdy0+bWMuY3Vyc29yX2djX2ludmlzaWJsZV9va2F5ID0gdHJ1ZTsKKyAgICAgICAgICB4 X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEJBUl9DVVJTT1Ip OworICAgICAgICAgIHctPm1jLmN1cnNvcl9nY19pbnZpc2libGVfb2theSA9IGZhbHNlOworICAg ICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9w aXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeF9kcmF3X2Jhcl9jdXJz b3IgKHcsIGdseXBoX3JvdywgY3Vyc29yX3dpZHRoLCBCQVJfQ1VSU09SKTsKKyAgICAgIGJyZWFr OworICAgIH0KKyAgICBjYXNlIEhCQVJfQ1VSU09SOgorICAgIHsKKyAgICAgIGlmICh3LT5tYy5y ZWQgPj0gMCAmJiB3LT5tYy5ibHVlID49IDAgJiYgdy0+bWMuZ3JlZW4gPj0gMCkKKyAgICAgICAg eworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vy c29yX3BpeGVsJy4gICovCisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVs ID0gY29sb3IucGl4ZWw7CisgICAgICAgICAgdy0+bWMuY3Vyc29yX2djX2ludmlzaWJsZV9va2F5 ID0gdHJ1ZTsKKyAgICAgICAgICB4X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cGhfcm93LCBjdXJz b3Jfd2lkdGgsIEhCQVJfQ1VSU09SKTsKKyAgICAgICAgICB3LT5tYy5jdXJzb3JfZ2NfaW52aXNp YmxlX29rYXkgPSBmYWxzZTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4 ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAg ICAgICAgIHhfZHJhd19iYXJfY3Vyc29yICh3LCBnbHlwaF9yb3csIGN1cnNvcl93aWR0aCwgSEJB Ul9DVVJTT1IpOworICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTk9fQ1VSU09SOgorICAg ICAgdy0+cGh5c19jdXJzb3Jfd2lkdGggPSAwOworICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoK KyAgICAgIGVtYWNzX2Fib3J0ICgpOworICB9CisKKy8qIGVuZCBNVUxUSVBMRSBDVVJTT1JTICov CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KIAotCSAgICBjYXNlIE5PX0NVUlNPUjoKLQkgICAg ICB3LT5waHlzX2N1cnNvcl93aWR0aCA9IDA7Ci0JICAgICAgYnJlYWs7CiAKLQkgICAgZGVmYXVs dDoKLQkgICAgICBlbWFjc19hYm9ydCAoKTsKLQkgICAgfQogCX0KIAogI2lmZGVmIEhBVkVfWF9J MThOCg== --Multipart_Sun_Nov_11_08:51:54_2018-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs / fill-column). References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Wed, 21 Nov 2018 04:55:02 +0000 Resent-Message-ID: <handler.22873.B22873.154277604428780 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN>, Marcin Borkowski <mbork@HIDDEN>, Richard Stallman <rms@HIDDEN>, John Wiegley <johnw@HIDDEN>, Akio Burns <akioburns@HIDDEN>, Alan Third <athird@HIDDEN> Cc: 17684 <at> debbugs.gnu.org, 22873 <at> debbugs.gnu.org Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.154277604428780 (code B ref 22873); Wed, 21 Nov 2018 04:55:02 +0000 Received: (at 22873) by debbugs.gnu.org; 21 Nov 2018 04:54:04 +0000 Received: from localhost ([127.0.0.1]:37702 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1gPKWZ-0007U8-Si for submit <at> debbugs.gnu.org; Tue, 20 Nov 2018 23:54:03 -0500 Received: from gateway31.websitewelcome.com ([192.185.143.43]:36697) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1gPKWX-0007Tj-EQ for 22873 <at> debbugs.gnu.org; Tue, 20 Nov 2018 23:54:01 -0500 Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway31.websitewelcome.com (Postfix) with ESMTP id B91761D1340 for <22873 <at> debbugs.gnu.org>; Tue, 20 Nov 2018 22:54:00 -0600 (CST) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id PKWWgKgz7RPojPKWWgUehj; Tue, 20 Nov 2018 22:54:00 -0600 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=JA7oqSYBqTlXttK75weSyLDbxvwnsm1hxG6bqK3FIio=; b=BJPWFuhOwBbOyVnejA8s+/FU4J P8CggoXzcPMXVmRwFrRs0ts8JCyLqz/4ZdDn5dpb+wPYcDkoPBBQhOFLhLR80mNhjGHc57t7IOJm5 YhtEndiRPS05eCTpD7ODq2xNMC1q9I0KS9lkOk9sQK3PNLu3wO4oPgyKudQnK7ouqwsjk8+PUNKb+ s1dxdmmS/Bz7VvjErGgwup+Xw9/Wd2JfRbu7KSWQOzucFjxcmPQHhd2F8DA0ekO5nlfsyGL9RySUD fi5U+U/rZ7Q54B9Ld9JlNAlxPcCvsGMdMr+wqGDXbspRne8DCS3wmR/W0SXgzewdH11MSMdIgz3hv FT0s1lkg==; Received: from cpe-98-146-201-115.natnow.res.rr.com ([98.146.201.115]:38411 helo=MBP.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from <esq@HIDDEN>) id 1gPKWU-003vvV-Dx; Tue, 20 Nov 2018 22:53:59 -0600 Date: Tue, 20 Nov 2018 20:53:56 -0800 Message-ID: <m2muq3t4ij.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Tue_Nov_20_20:53:56_2018-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 98.146.201.115 X-Source-L: No X-Exim-ID: 1gPKWU-003vvV-Dx X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-98-146-201-115.natnow.res.rr.com (MBP.local) [98.146.201.115]:38411 X-Source-Auth: lawlist X-Email-Count: 3 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> --Multipart_Tue_Nov_20_20:53:56_2018-1 Content-Type: text/plain; charset=US-ASCII Version 016.000 [11/20/2018] CHANGELOG: - The area of code that prevented crosshairs and other fake cursors from working on MacOS Mojave has been fixed. - New Feature: This is the first implementation of a visible fill column using fake cursors, which has similar abilities to crosshairs; e.g., draw forthwith whenever the real cursor gets drawn; draw on an idle timer; fill column indicator in inactive/active windows have different colors; suppress display of fill column indicator in inactive windows (if so desired); color of the fill column indicator in active/inactive windows is a different color when the cursor is lined up with the fill column and crosshairs is active. Crosshairs incorporates the fill column indicator if the variable `+-fill-column' is non-nil; or, there is a separate minor-mode called `mc-fill-column-mode' (if so desired). - Floating horizontal ruler now increments by glyph->pixel_width instead of frame-char-width. [This avoids visible gaps.] - Multiple fake cursors can now be placed at the end of a line when there is no `buffer-display-table' entry for a visible EOL glyph. - Crosshairs now use the line height instead of the glyph height. [This avoids visible gaps in the vertical ruler of crosshairs.] - The border color for images with a fake cursor now match the fake cursor color. - With the gracious assistance of Eli Z., a test now exists for the situation when `draw_glyphs' redraws a tab stretch due to a subsequent character with a left overhang. Additional work needs to be done ... [infra]. - Only call `update_begin' / `update_end' when the frame was not already in the process of being updated. - Miscellaneous bug fixes. SETUP: Step 1: git clone -b master git://git.sv.gnu.org/emacs.git Step 2: In the new emacs folder, go back to an Emacs version from 11/16/2018: git reset --hard 644a308b4e1513e04be9360e1586e14b32ec0159 Step 3: From within the new emacs folder created in Step 1, apply the patch: git apply /path/to/the/11_20_2018__18_16_28_577.diff [There should not be any error messages at this point; i.e, you should be returned to a new command prompt.] Step 4: ./autogen.sh Step 5: ./configure ... [your custom options] Step 6: make Step 7: make install - To try out built-in fake cursors with Magnar Sveen's library (multiple-cursors), install that package first. [If the multiple-cursors package is installed, an eval-after-load "multiple-cursors-core" statement within crosshairs.el will redefine a couple of functions and set up a few keyboard shortcuts.] If the multiple-cursors package by Magnar Sveen is not already installed, then there are two easy ways to install that package: Type: M-x mc-install OR, evaluate the following snippet: (progn (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) (package-refresh-contents) (package-install 'multiple-cursors)) - To try out crosshairs and the visible fill column, type: M-x +-mode - To try out only the visible fill column, type: M-x mc-fill-column-mode - To learn how to use the multiple fake cursors feature, examine the interactive function `mc-test'. TODO: - Crosshairs in the inactive windows is causing cursors in the active windows to be erased (when the active window drew prior thereto). - Face of tab stretch gets extended to window edge on NS, but not on X11 or NT platforms: https://lists.gnu.org/archive/html/emacs-devel/2018-11/msg00316.html - Continue working on the section of code within `draw_glyphs' that is responsible for redrawing a stretch tab (erasing a fake cursor) when the next character has a left overhang. " A". A temporary fix has been instituted that simply bypasses the section of code at issue; however, the optimal solution will be to let `draw_glyphs' do its thing and then redraw the fake cursors along the stretch tab subsequent thereto. - Multiple Cursors: If point is in the middle of a composite character, then select a fully composed character so that the fake cursor is visible. - Fake cursors are being redrawn too often when non-selected visible windows have an ongoing process that require frequent redisplay updates (e.g., an eshell buffer. @lawlist may have already corrected the frequent redisplay issue as to mouse-overs, but will need to check this once again to be sure. --Multipart_Tue_Nov_20_20:53:56_2018-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="11_20_2018__18_16_28_577.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvY3Jvc3NoYWlycy5lbCBiL2xpc3AvY3Jvc3NoYWlycy5lbApuZXcg ZmlsZSBtb2RlIDEwMDc1NQppbmRleCAwMDAwMDAwLi5iZWMwNzkwCi0tLSAvZGV2L251bGwKKysr IGIvbGlzcC9jcm9zc2hhaXJzLmVsCkBAIC0wLDAgKzEsMTMwMyBAQAorOzs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Cis7OzsgQkVHSU4gbW9kaWZpY2F0aW9uIG9mIHRoZSBNdWx0aXBsZSBDdXJzb3Jz IGxpYnJhcnkgd3JpdHRlbiBieSAgTWFnbmFyIFN2ZWVuLgorCisoZGVmdmFyIHBhY2thZ2UtYXJj aGl2ZXMpCisKKyhkZWZ2YXIgbWMtLW1heC1jdXJzb3Jz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jb21tYW5kLWZvci1mYWtlLWN1cnNvcgorICAgICAg KGlmIChlcSAxIChtYy9udW0tY3Vyc29ycykpIDs7IG5vIGZha2UgY3Vyc29ycz8gZGlzYWJsZSBt Yy1tb2RlCisgICAgICAgICAgKG11bHRpcGxlLWN1cnNvcnMtbW9kZSAwKQorICAgICAgICAod2hl biB0aGlzLW9yaWdpbmFsLWNvbW1hbmQKKyAgICAgICAgICAobGV0ICgob3JpZ2luYWwtY29tbWFu ZCAob3IgbWMtLXRoaXMtY29tbWFuZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAoY29tbWFuZC1yZW1hcHBpbmcgdGhpcy1vcmlnaW5hbC1jb21tYW5kKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLW9yaWdpbmFsLWNvbW1hbmQpKSkKKyAg ICAgICAgICAgIDs7IHNraXAga2V5Ym9hcmQgbWFjcm9zLCBzaW5jZSB0aGV5IHdpbGwgZ2VuZXJh dGUgYWN0dWFsIGNvbW1hbmRzIHRoYXQgYXJlCisgICAgICAgICAgICA7OyBhbHNvIHJ1biBpbiB0 aGUgY29tbWFuZCBsb29wIC0gd2UnbGwgaGFuZGxlIHRob3NlIGxhdGVyIGluc3RlYWQuCisgICAg ICAgICAgICAod2hlbiAoZnVuY3Rpb25wIG9yaWdpbmFsLWNvbW1hbmQpCisgICAgICAgICAgICAg IDs7IGlmIGl0J3MgYSBsYW1iZGEsIHdlIGNhbid0IGtub3cgaWYgaXQncyBzdXBwb3J0ZWQgb3Ig bm90CisgICAgICAgICAgICAgIDs7IC0gc28gZ28gYWhlYWQgYW5kIGFzc3VtZSBpdCdzIG9rLCBi ZWNhdXNlIHdlJ3JlIGp1c3Qgb3B0aW1pc3RpYyBsaWtlIHRoYXQKKyAgICAgICAgICAgICAgKGlm IChvciAobm90IChzeW1ib2xwIG9yaWdpbmFsLWNvbW1hbmQpKQorICAgICAgICAgICAgICAgICAg ICAgIDs7IGxhbWJkYSByZWdpc3RlcmVkIGJ5IHNtYXJ0cmVwCisgICAgICAgICAgICAgICAgICAg ICAgKHN0cmluZy1wcmVmaXgtcCAiKCIgKHN5bWJvbC1uYW1lIG9yaWdpbmFsLWNvbW1hbmQpKSkK KyAgICAgICAgICAgICAgICAgIChtYy9leGVjdXRlLWNvbW1hbmQtZm9yLWFsbC1mYWtlLWN1cnNv cnMgb3JpZ2luYWwtY29tbWFuZCkKKyAgICAgICAgICAgICAgICA7OyBzbWFydHJlcCBgaW50ZXJu J3MgY29tbWFuZHMgaW50byBvd24gb2JhcnJheSB0byBoZWxwCisgICAgICAgICAgICAgICAgOzsg YGRlc2NyaWJlLWJpbmRpbmdzJy4gIFNvLCBsZXQncyByZS1gaW50ZXJuJyBoZXJlIHRvCisgICAg ICAgICAgICAgICAgOzsgbWFrZSB0aGUgY29tbWFuZCBjb21wYXJhYmxlIGJ5IGBlcScuCisgICAg ICAgICAgICAgICAgKHNldHEgb3JpZ2luYWwtY29tbWFuZCAoaW50ZXJuIChzeW1ib2wtbmFtZSBv cmlnaW5hbC1jb21tYW5kKSkpCisgICAgICAgICAgICAgICAgOzsgb3RoZXJ3aXNlIGl0J3MgYSBz eW1ib2wsIGFuZCB3ZSBjYW4gYmUgbW9yZSB0aG9yb3VnaAorICAgICAgICAgICAgICAgIChpZiAo Z2V0IG9yaWdpbmFsLWNvbW1hbmQgJ21jLS11bnN1cHBvcnRlZCkKKyAgICAgICAgICAgICAgICAg ICAgKG1lc3NhZ2UgIiVTIGlzIG5vdCBzdXBwb3J0ZWQgd2l0aCBtdWx0aXBsZSBjdXJzb3JzJXMi CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9yaWdpbmFsLWNvbW1hbmQKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgKGdldCBvcmlnaW5hbC1jb21tYW5kICdtYy0tdW5zdXBwb3J0 ZWQpKQorICAgICAgICAgICAgICAgICAgKHdoZW4gKGFuZCBvcmlnaW5hbC1jb21tYW5kCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIChub3QgKG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy0t ZGVmYXVsdC1jbWRzLXRvLXJ1bi1vbmNlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg KG5vdCAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jL2NtZHMtdG8tcnVuLW9uY2UpKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAob3IgbWMvYWx3YXlzLXJ1bi1mb3ItYWxsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jLS1kZWZh dWx0LWNtZHMtdG8tcnVuLWZvci1hbGwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jL2NtZHMtdG8tcnVuLWZvci1hbGwpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAobWMvcHJvbXB0LWZvci1pbmNsdXNpb24taW4td2hp dGVsaXN0IG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAgICAgICAgICAgICAgICAgICAgKG1jL2V4ZWN1 dGUtY29tbWFuZC1mb3ItYWxsLWZha2UtY3Vyc29ycyBvcmlnaW5hbC1jb21tYW5kKSkpKQorICAg ICAgICAgICAgICAod2hlbiBtYy91c2UtYnVpbHQtaW4tY3Vyc29ycworICAgICAgICAgICAgICAg IChzZXRxIG11bHRpcGxlLWN1cnNvcnMtY29uZgorICAgICAgICAgICAgICAgICAgICAgICAgKG1h cGNhcgorICAgICAgICAgICAgICAgICAgICAgICAgICAobGFtYmRhICh4KSAobGlzdCAob3Zlcmxh eS1zdGFydCB4KSAiYmFyIiBuaWwpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAobWMvYWxs LWZha2UtY3Vyc29ycykpKSkpKSkpKSkKKworICAoZGVmdW4gbWMvbWFyay1uZXh0LWxpa2UtdGhp cy1jeWNsZS1mb3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mVy IChnZXQtYnVmZmVyLWNyZWF0ZSAiKk1DLVRFU1QqIikpKQorICAgICh3aXRoLWN1cnJlbnQtYnVm ZmVyIGJ1ZmZlcgorICAgICAgKGVyYXNlLWJ1ZmZlcikKKyAgICAgIChpbnNlcnQgIlRoaXMgaXMg YSB0ZXN0ISIpCisgICAgICAoc2V0cSBtdWx0aXBsZS1jdXJzb3JzLWNvbmYgJygoMSAiaGJhciIg Im1hZ2VudGEiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDIgImJhciIg InB1cnBsZSIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMyAiYm94IiAi IzAwRkYwMCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoNCAiaG9sbG93 IiAiIzAwMDBGRiIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoNSAoImhi YXIiIDMpIFsxLjAgMC4wIDEuMF0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAoNiAoImJhciIgMykgWzAuMCAxLjAgMS4wXSkpKSkKKyAgICAoc2VsZWN0LXdpbmRvdyAoZGlz cGxheS1idWZmZXIgYnVmZmVyKSkKKyAgICA7OzsgVGhlIHRyaWdnZXIgaW4gYGtleWJvYXJkLmNg IGlzIG5vdCBhY3RpdmF0ZWQgaW4gdGhpcyBleGFtcGxlLCBzbyB3ZQorICAgIDs7OyBmb3JjZSB0 aGUgbXVsdGlwbGUgY3Vyc29ycyB0byBiZSBkcmF3bi4KKyAgICAobWMtYWN0aXZhdGUtbXVsdGlw bGUtY3Vyc29ycyAoc2VsZWN0ZWQtd2luZG93KSkpKQorCisoZGVmdW4gKy10aW1lci1mbiAoKQor IlNpbmNlIHRoaXMgZmlyZXMgZ2xvYmFsbHksIHdlIG11c3QgY29udHJvbCB3aGljaCBidWZmZXJz IGNyb3NzaGFpcnMgYXBwZWFyIGluLiIKKyAgKHdoZW4gKy1tb2RlCisgICAgKHVubGVzcyAobWVt cSBsYXN0LWNvbW1hbmQgKy1wYXJlbnMtZXhjbHVzaW9ucykKKyAgICAgICgrLXBhcmVucy1mbikp CisgICAgKHdoZW4gKy10aW1lci12YXIKKyAgICAgIChzZXRxIHRpbWVyLWlkbGUtbGlzdCAoZGVs cSArLXRpbWVyLXZhciB0aW1lci1pZGxlLWxpc3QpKQorICAgICAgKHNldHEgKy10aW1lci12YXIg bmlsKSkKKyAgICAodW5sZXNzIGNyb3NzaGFpcnMtZHJhdy1mb3J0aHdpdGgKKyAgICAgIChtYy1h Y3RpdmF0ZS1jcm9zc2hhaXJzIChzZWxlY3RlZC13aW5kb3cpKSkKKyAgICAod2hlbiAoYW5kICst ZmlsbC1jb2x1bW4gKG51bGwgbWMtZmlsbC1jb2x1bW4tZHJhdy1mb3J0aHdpdGgpKQorICAgICAg KG1jLWFjdGl2YXRlLWZpbGwtY29sdW1uIChzZWxlY3RlZC13aW5kb3cpKSkpKQorCisoZGVmdW4g Ky1kcmF3LWZvcnRod2l0aCAoKQorICAiRm9yY2UgYm90aCBydWxlcnMgdG8gYmUgZHJhd24vcmVk cmF3bi4iCisgICgrLWRyYXctY3Jvc3NoYWlycyAnZm9yY2UpKQorCisoZGVmdW4gKy1kcmF3LWNy b3NzaGFpcnMgKCZvcHRpb25hbCBmb3JjZSkKKyAgKHdoZW4gKy1tb2RlCisgICAgKHdoZW4gKy10 aW1lci12YXIKKyAgICAgIChzZXRxIHRpbWVyLWlkbGUtbGlzdCAoZGVscSArLXRpbWVyLXZhciB0 aW1lci1pZGxlLWxpc3QpKQorICAgICAgKHNldHEgKy10aW1lci12YXIgbmlsKSkKKyAgICAodW5s ZXNzIChtZW1xIHRoaXMtY29tbWFuZCArLXBhcmVucy1leGNsdXNpb25zKQorICAgICAgKCstZGVs ZXRlLXBhcmVucy1vdmVybGF5cykpCisgICAgKGlmIGZvcmNlCisgICAgICAocHJvZ24KKyAgICAg ICAgKCstcGFyZW5zLWZuKQorICAgICAgICAod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ICAgICAgKGdsb2JhbC1lbGRvYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgaml0 LWxvY2stY29udGV4dC10aW1lcgorICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZl bHktcCAnYW55KQorICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICco NCkpKQorICAgICAgICAod2hlbiAodGltZXJwIGppdC1sb2NrLWNvbnRleHQtdGltZXIpCisgICAg ICAgICAgKGNhbmNlbC10aW1lciBqaXQtbG9jay1jb250ZXh0LXRpbWVyKSkKKyAgICAgICAgOzsg KHNldHEgaml0LWxvY2stY29udGV4dC10aW1lciAocnVuLXdpdGgtaWRsZS10aW1lciA1LjAgJ3Jl cGVhdCAnaml0LWxvY2stY29udGV4dC1mb250aWZ5KSkKKyAgICAgICAgKHNldHEgaml0LWxvY2st Y29udGV4dC10aW1lciBuaWwpKQorICAgICAgKHdoZW4gKGFuZCAoY2FsbGVkLWludGVyYWN0aXZl bHktcCAnYW55KQorICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICco NCkpKQorICAgICAgICAod2hlbiAodGltZXJwIHVuZG8tYXV0by1jdXJyZW50LWJvdW5kYXJ5LXRp bWVyKQorICAgICAgICAgIChjYW5jZWwtdGltZXIgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnkt dGltZXIpKQorICAgICAgICAoZnNldCAndW5kby1hdXRvLS11bmRvYWJsZS1jaGFuZ2UKKyAgICAg ICAgICAgICAgKGxhbWJkYSAoKSAoYWRkLXRvLWxpc3QgJ3VuZG8tYXV0by0tdW5kb2FibHktY2hh bmdlZC1idWZmZXJzIChjdXJyZW50LWJ1ZmZlcikpKSkKKyAgICAgICAgKGZzZXQgJ3VuZG8tYXV0 by1hbWFsZ2FtYXRlICdpZ25vcmUpKQorICAgICAgKHdoZW4gYmxpbmstY3Vyc29yLW1vZGUKKyAg ICAgICAgKGJsaW5rLW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ZWF0dXJlIHRl c3QgZmlsZSB1c2VkIGJ5IEBsYXdsaXN0CisgICAgICA7OzsgYm9ncyBFbWFjcyBkb3duIHVubGVz cyBgYmlkaS1kaXNwbGF5LXJlb3JkZXJpbmcnIGlzIHNldCB0byBhIG5pbCB2YWx1ZS4KKyAgICAg IDs7OyBIb3dldmVyLCBtb3N0IHVzZXJzIHdpbGwgcHJvYmFibHkgbm90IHdhbnQgdGhpcyBwYXJ0 aWN1bGFyIHNldHRpbmcuCisgICAgICAodW5sZXNzIChudWxsIGJpZGktZGlzcGxheS1yZW9yZGVy aW5nKQorICAgICAgICAoc2V0cSBiaWRpLWRpc3BsYXktcmVvcmRlcmluZyBuaWwpKQorICAgICAg KHVubGVzcyAoYW5kIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAg ICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAgICAgICAgKHNldCAobWFr ZS1sb2NhbC12YXJpYWJsZSAnKy0tc2F2ZWQtc3RhdGUpIG5pbCkKKyAgICAgICAgKGRvbGlzdCAo dmFyICcoYnVmZmVyLWRpc3BsYXktdGFibGUKKyAgICAgICAgICAgICAgICAgICAgICAgZnJpbmdl LWluZGljYXRvci1hbGlzdAorICAgICAgICAgICAgICAgICAgICAgICB0YWItd2lkdGgKKyAgICAg ICAgICAgICAgICAgICAgICAgbGluZS1tb3ZlLXZpc3VhbAorICAgICAgICAgICAgICAgICAgICAg ICB0cnVuY2F0ZS1saW5lcworICAgICAgICAgICAgICAgICAgICAgICB0cnVuY2F0ZS1wYXJ0aWFs LXdpZHRoLXdpbmRvd3MKKyAgICAgICAgICAgICAgICAgICAgICAgd29yZC13cmFwKSkKKyAgICAg ICAgICAod2hlbiAobG9jYWwtdmFyaWFibGUtcCB2YXIpCisgICAgICAgICAgICAocHVzaCAoY29u cyB2YXIgKHN5bWJvbC12YWx1ZSB2YXIpKSArLS1zYXZlZC1zdGF0ZSkpKQorICAgICAgICAoc2V0 cSBmaWxsLWNvbHVtbiA4MCkKKyAgICAgICAgKHNldHEgZGlzcGxheS1saW5lLW51bWJlcnMgdCkK KyAgICAgICAgKHNldHEtbG9jYWwgYXV0by1oc2Nyb2xsLW1vZGUgJ2N1cnJlbnQtbGluZSkKKyAg ICAgICAgKHNldHEtbG9jYWwgaHNjcm9sbC1zdGVwIDUpCisgICAgICAgIChzZXRxIGJ1ZmZlci1k aXNwbGF5LXRhYmxlICstYnVmZmVyLWRpc3BsYXktdGFibGUpCisgICAgICAgIChzZXRxIHRhYi13 aWR0aCA0KQorICAgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICdsaW5lLW1vdmUtdmlz dWFsKSB0KQorICAgICAgICAoc2V0cSB0cnVuY2F0ZS1saW5lcworICAgICAgICAgIChjb25kCisg ICAgICAgICAgICAoKGxldCAoKGxzdCArLXRydW5jYXRlLWxpbmVzLWRlcml2ZWQtbW9kZXMpCisg ICAgICAgICAgICAgICAgICAgIG1vZGUpCisgICAgICAgICAgICAgIChjYXRjaCAnZm91bmQKKyAg ICAgICAgICAgICAgICAod2hpbGUgKHNldHEgbW9kZSAocG9wIGxzdCkpCisgICAgICAgICAgICAg ICAgICAod2hlbiAoZGVyaXZlZC1tb2RlLXAgbW9kZSkKKyAgICAgICAgICAgICAgICAgICAgKHRo cm93ICdmb3VuZCB0KSkpKSkpCisgICAgICAgICAgICAgKChtZW1xIG1ham9yLW1vZGUgKy10cnVu Y2F0ZS1saW5lcy1tYWpvci1tb2RlcykpCisgICAgICAgICAgICAgKHQKKyAgICAgICAgICAgICAg IG5pbCkpKQorICAgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICd0cnVuY2F0ZS1wYXJ0 aWFsLXdpZHRoLXdpbmRvd3MpIG5pbCkKKyAgICAgICAgKHNldHEgd29yZC13cmFwIHQpCisgICAg ICAgIChzZXRxIGluZGljYXRlLWVtcHR5LWxpbmVzIHQpCisgICAgICAgIChzZXRxIGluZGljYXRl LWJ1ZmZlci1ib3VuZGFyaWVzICdsZWZ0KQorICAgICAgICAoc2V0cSBmcmluZ2UtaW5kaWNhdG9y LWFsaXN0CisgICAgICAgICAgICA7OzsgaHNjbF9hbGxfdGVtcF9wIHwgaHNjbF90ZW1wX3AKKyAg ICAgICAgICAnKCgrLWhzY2wtdGVtcCAuICgrLXNpbmdsZS1hbmdsZS1sZWZ0CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgKy1kb3VibGUtYW5nbGUtbGVmdCkpCisgICAgICAgICAgICA7Ozsg aHNjbF9hbGxfcGVybV8wX3AgfCBoc2NsX2FsbF9wZXJtXzFfcCB8IGhzY2xfYWxsX3Blcm1fMl9w IHwgaHNjbF9wZXJtX3AKKyAgICAgICAgICAgICgrLWhzY2wtcGVybSAuICgrLXNpbmdsZS1hbmds ZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICstZG91YmxlLWFuZ2xlLXVwCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgKy10cmlwbGUtYW5nbGUtdXAKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICArLXF1YWRydXBsZS1hbmdsZS11cCkpCisgICAgICAgICAgICAoKy1vdmVy bGF5LWFycm93IC4gKCstZnJpbmdlLWxlZnQtYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKy1mcmluZ2UtcmlnaHQtYXJyb3cpKQorICAgICAgICAgICAgKHRydW5jYXRpb24g LiAoKy1mcmluZ2UtbGVmdC1hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgKy1mcmlu Z2UtcmlnaHQtYXJyb3cpKQorICAgICAgICAgICAgKGNvbnRpbnVhdGlvbiAuICgrLWZyaW5nZS1s ZWZ0LWN1cmx5LWFycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICstYmFja3NsYXNo KSkKKyAgICAgICAgICAgIChvdmVybGF5LWFycm93IC4gKy1mcmluZ2UtcmlnaHQtdHJpYW5nbGUp CisgICAgICAgICAgICAodXAgLiArLWZyaW5nZS11cC1hcnJvdykKKyAgICAgICAgICAgIChkb3du IC4gKy1mcmluZ2UtZG93bi1hcnJvdykKKyAgICAgICAgICAgICh0b3AgLiArLWZyaW5nZS10b3At bGVmdC1hbmdsZSkKKyAgICAgICAgICAgIChib3R0b20gLiArLWZyaW5nZS1ib3R0b20tcmlnaHQt YW5nbGUpCisgICAgICAgICAgICAodG9wLWJvdHRvbSAuICgrLWZyaW5nZS1sZWZ0LWJyYWNrZXQK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICstZnJpbmdlLXJpZ2h0LWJyYWNrZXQKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICstZnJpbmdlLXRvcC1yaWdodC1hbmdsZQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgKy1mcmluZ2UtdG9wLWxlZnQtYW5nbGUpKQorICAgICAgICAgICAg KGVtcHR5LWxpbmUgLiArLWZyaW5nZS1lbXB0eS1saW5lKQorICAgICAgICAgICAgKHVua25vd24g LiArLWZyaW5nZS1xdWVzdGlvbi1tYXJrKSkpCisgICAgICAgIChzZXRxIGZyaW5nZS1jdXJzb3It YWxpc3QgJygoYm94IC4gKy1mcmluZ2UtbGVmdC10cmlhbmdsZSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIChob2xsb3cgLiArLWhvbGxvdy1yZWN0YW5nbGUpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYmFyIC4gKy12ZXJ0aWNhbC1iYXIpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaGJhciAuICstZnJpbmdlLWhvcml6b250 YWwtYmFyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGhvbGxvdy1zbWFs bCAuICstZnJpbmdlLWhvbGxvdy1zcXVhcmUpKSkKKyAgICAgICAgKGlmIGNyb3NzaGFpcnMtZHJh dy1mb3J0aHdpdGgKKyAgICAg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yAgIkRvYy1zdHJpbmcuIgorICAobGV0KiAoKG9wb2ludCAocG9pbnQpKQorICAg ICAgICAgKGZyb20gKGlmICstcGFyZW5zLWZyb20tZm4KKyAgICAgICAgICAgICAgICAgKGZ1bmNh bGwgKy1wYXJlbnMtZnJvbS1mbikKKyAgICAgICAgICAgICAgICAgKHBvaW50LW1pbikpKQorICAg ICAgICAgKHdpbiAoc2VsZWN0ZWQtd2luZG93KSkKKyAgICAgICAgIChpIDApCisgICAgICAgICAo cHJlY2VkaW5nLWNoYXIgKHByZWNlZGluZy1jaGFyKSkKKyAgICAgICAgIChvY2hhciAoY2hhci1h ZnRlciBvcG9pbnQpKQorICAgICAgICAgKHBvczEKKyAgICAgICAgICAgKGNvbmQKKyAgICAgICAg ICAgICAoKGFuZCBvY2hhcgorICAgICAgICAgICAgICAgICAgIChvciA7OzsgKGNoYXItdG8tc3Ry aW5nIDQwKSA9PiBvcGVuaW5nIHBhcmVudGhlc2lzCisgICAgICAgICAgICAgICAgICAgICAgICg9 IG9jaGFyIDQwKQorICAgICAgICAgICAgICAgICAgICAgICA7OzsgKGNoYXItdG8tc3RyaW5nIDkx KSA9PiBvcGVuaW5nIHNxdWFyZSBicmFja2V0CisgICAgICAgICAgICAgICAgICAgICAgICg9IG9j aGFyIDkxKQorICAgICAgICAgICAgICAgICAgICAgICA7OzsgKGNoYXItdG8tc3RyaW5nIDEyMykg PT4gb3BlbmluZyB3YXZ5IGJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgKD0gb2NoYXIg MTIzKSkpCisgICAgICAgICAgICAgICAgKG1pbiAoMSsgb3BvaW50KSAocG9pbnQtbWF4KSkpCisg ICAgICAgICAgICAgKChvciA7OzsgKGNoYXItdG8tc3RyaW5nIDQxKSA9PiBjbG9zaW5nIHBhcmVu dGhlc2lzCisgICAgICAgICAgICAgICAgICAoPSBwcmVjZWRpbmctY2hhciA0MSkKKyAgICAgICAg ICAgICAgICAgIDs7OyAoY2hhci10by1zdHJpbmcgOTMpID0+IGNsb3Npbmcgc3F1YXJlIGJyYWNr ZXQKKyAgICAgICAgICAgICAgICAgICg9IHByZWNlZGluZy1jaGFyIDkzKQorICAgICAgICAgICAg ICAgICAgOzs7IChjaGFyLXRvLXN0cmluZyAxMjUpID0+IGNsb3Npbmcgd2F2eSBicmFja2V0Cisg ICAgICAgICAgICAgICAgICAoPSBwcmVjZWRpbmctY2hhciAxMjUpKQorICAgICAgICAgICAgICAg IChtYXggKHBvaW50LW1pbikgKDEtIG9wb2ludCkpKQorICAgICAgICAgICAgICh0CisgICAgICAg ICAgICAgICAgb3BvaW50KSkpCisgICAgICAgICBwb3MyCisgICAgICAgICBzZWxlY3RlZC1mYWNl KQorICAgIChzYXZlLWV4Y3Vyc2lvbgorICAgICAgKGNvbmRpdGlvbi1jYXNlIG5pbAorICAgICAg ICAod2hpbGUgKHNldHEgcG9zMSAobnRoIDEgKHBhcnNlLXBhcnRpYWwtc2V4cCBmcm9tIHBvczEp KSkKKyAgICAgICAgICAoc2V0cSBwb3MyIChzY2FuLXNleHBzIHBvczEgMSkpCisgICAgICAgICAg KGlmICg9IGkgMTApCisgICAgICAgICAgICAoc2V0cSBpIDEpCisgICAgICAgICAgICAoc2V0cSBp ICgxKyBpKSkpCisgICAgICAgICAgKHNldHEgc2VsZWN0ZWQtZmFjZSAoY29uZAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSAxKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICcrLXBhcmVucy1vbmUtZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgKCg9IGkgMikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJl bnMtdHdvLWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDMpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLXRocmVlLWZhY2UpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDQpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJystcGFyZW5zLWZvdXItZmFjZSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgKCg9IGkgNSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAnKy1wYXJlbnMtZml2ZS1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo KD0gaSA2KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1zaXgt ZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgNykKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtc2V2ZW4tZmFjZSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgOCkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAnKy1wYXJlbnMtZWlnaHQtZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKCg9IGkgOSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1w YXJlbnMtbmluZS1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSAx MCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtdGVuLWZhY2Up KSkKKyAgICAgICAgICAobGV0ICgob3YgKG1ha2Utb3ZlcmxheSBwb3MxICgxKyBwb3MxKSkpKQor ICAgICAgICAgICAgKHVubGVzcyArLXBhcmVucy1pbmFjdGl2ZS13aW5kb3dzCisgICAgICAgICAg ICAgIChvdmVybGF5LXB1dCBvdiAnd2luZG93IHdpbikpCisgICAgICAgICAgICAob3ZlcmxheS1w dXQgb3YgJ2ZhY2Ugc2VsZWN0ZWQtZmFjZSkpCisgICAgICAgICAgKHdoZW4gcG9zMgorICAgICAg ICAgICAgKGxldCAoKG92IChtYWtlLW92ZXJsYXkgKDEtIHBvczIpIHBvczIpKSkKKyAgICAgICAg ICAgICAgKHVubGVzcyArLXBhcmVucy1pbmFjdGl2ZS13aW5kb3dzCisgICAgICAgICAgICAgICAg KG92ZXJsYXktcHV0IG92ICd3aW5kb3cgd2luKSkKKyAgICAgICAgICAgICAgKG92ZXJsYXktcHV0 IG92ICdmYWNlIHNlbGVjdGVkLWZhY2UpKSkpCisgICAgICAgIChlcnJvciBuaWwpKSkKKyAgICAo c2V0cSArLXBhcmVucy1vdmVybGF5cy1leGlzdC1wIHQpKSkKKworKGRlZnVuICstcmVtb3ZlLW92 ZXJsYXlzIChiZWcgZW5kIG5hbWUgdmFsKQorIlJlbW92ZSB0aGUgb3ZlcmxheXMgdGhhdCBhcmUg YGVxdWFsLWluY2x1ZGluZy1wcm9wZXJ0aWVzYC4KK0luY2x1ZGVzIGEgdW5pcXVlIHNpdHVhdGlv biB3aGVuIGFuIG92ZXJsYXkgd2l0aCBhbiBgJ2FmdGVyLXN0cmluZ2AgcHJvcGVydHkKK2lzIGF0 IHRoZSB2ZXJ5IGVuZCBvZiBhIG5hcnJvd2VkLWJ1ZmZlci4iCisgIChsZXQqICgocG9pbnQtbWF4 IChwb2ludC1tYXgpKQorICAgICAgICAgKHBvaW50LW1pbiAocG9pbnQtbWluKSkKKyAgICAgICAg IChuYXJyb3dlZC1wIChidWZmZXItbmFycm93ZWQtcCkpCisgICAgICAgICAoYmVnIChpZiBiZWcg YmVnIHBvaW50LW1pbikpCisgICAgICAgICAoZW5kCisgICAgICAgICAgIChjb25kCisgICAgICAg ICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgKG5vdCBuYXJyb3dlZC1wKQorICAgICAgICAg ICAgICAgICBlbmQpCisgICAgICAgICAgICAgICBlbmQpCisgICAgICAgICAgICAgKChhbmQKKyAg ICAgICAgICAgICAgICAgKG5vdCBuYXJyb3dlZC1wKQorICAgICAgICAgICAgICAgICAobnVsbCBl bmQpKQorICAgICAgICAgICAgICAgcG9pbnQtbWF4KQorICAgICAgICAgICAgICgoYW5kCisgICAg ICAgICAgICAgICAgIG5hcnJvd2VkLXAKKyAgICAgICAgICAgICAgICAgZW5kCisgICAgICAgICAg ICAgICAgICg8IGVuZCBwb2ludC1tYXgpKQorICAgICAgICAgICAgICAgZW5kKQorICAgICAgICAg ICAgICgoYW5kCisgICAgICAgICAgICAgICAgIG5hcnJvd2VkLXAKKyAgICAgICAgICAgICAgICAg ZW5kCisgICAgICAgICAgICAgICAgICg9IGVuZCBwb2ludC1tYXgpKQorICAgICAgICAgICAgICAg KDErIGVuZCkpCisgICAgICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFycm93ZWQt cAorICAgICAgICAgICAgICAgICAobnVsbCBlbmQpKQorICAgICAgICAgICAgICAgKDErIHBvaW50 LW1heCkpICkpCisgICAgICAgICAob3ZlcmxheXMKKyAgICAgICAgICAgKHByb2duCisgICAgICAg ICAgICAgKG92ZXJsYXktcmVjZW50ZXIgZW5kKQorICAgICAgICAgICAgIChvdmVybGF5cy1pbiBi ZWcgZW5kKSkpKQorICAgICh3aGVuIChhbmQgYmVnIGVuZCBuYW1lIHZhbCkKKyAgICAgIChkb2xp c3QgKG8gb3ZlcmxheXMpCisgICAgICAgIChjb25kCisgICAgICAgICAgKChhbmQgKGVxIG5hbWUg J2ZhY2UpCisgICAgICAgICAgICAgICAgKGVxIChvdmVybGF5LWdldCBvIG5hbWUpIHZhbCkpCisg ICAgICAgICAgICA7OyBFaXRoZXIgcHVzaCB0aGlzIG92ZXJsYXkgb3V0c2lkZSBiZWcuLi5lbmQK KyAgICAgICAgICAgIDs7IG9yIHNwbGl0IGl0IHRvIGV4Y2x1ZGUgYmVnLi4uZW5kCisgICAgICAg ICAgICA7OyBvciBkZWxldGUgaXQgZW50aXJlbHkgKGlmIGl0IGlzIGNvbnRhaW5lZCBpbiBiZWcu Li5lbmQpLgorICAgICAgICAgICAgKGlmICg8IChvdmVybGF5LXN0YXJ0IG8pIGJlZykKKyAgICAg ICAgICAgICAgICAoaWYgKD4gKG92ZXJsYXktZW5kIG8pIGVuZCkKKyAgICAgICAgICAgICAgKHBy b2duCisgICAgICAgICAgICAgICAgKG1vdmUtb3ZlcmxheSAoY29weS1vdmVybGF5IG8pCisgICAg ICAgICAgICAgICAgICAob3ZlcmxheS1zdGFydCBvKSBiZWcpCisgICAgICAgICAgICAgICAgKG1v dmUtb3ZlcmxheSBvIGVuZCAob3ZlcmxheS1lbmQgbykpKQorICAgICAgICAgICAgICAgICAgKG1v dmUtb3ZlcmxheSBvIChvdmVybGF5LXN0YXJ0IG8pIGJlZykpCisgICAgICAgICAgICAgIChpZiAo PiAob3ZlcmxheS1lbmQgbykgZW5kKQorICAgICAgICAgICAgICAgICAgKG1vdmUtb3ZlcmxheSBv IGVuZCAob3ZlcmxheS1lbmQgbykpCisgICAgICAgICAgICAgICAgKGRlbGV0ZS1vdmVybGF5IG8p KSkpCisgICAgICAgICAgKChhbmQgKG5vdCAoZXEgbmFtZSAnZmFjZSkpCisgICAgICAgICAgICAg ICAgKGVxdWFsLWluY2x1ZGluZy1wcm9wZXJ0aWVzIChvdmVybGF5LWdldCBvIG5hbWUpIHZhbCkp CisgICAgICAgICAgICAoZGVsZXRlLW92ZXJsYXkgbykpKSkpKSkKKworKGRlZnVuICstZGVsZXRl LXBhcmVucy1vdmVybGF5cyAoKQorICAod2hlbiArLXBhcmVucy1vdmVybGF5cy1leGlzdC1wCisg ICAgKGRvbGlzdCAoZmFjZSAnKCstcGFyZW5zLW9uZS1mYWNlCisgICAgICAgICAgICAgICAgICAg ICstcGFyZW5zLXR3by1mYWNlCisgICAgICAgICAgICAgICAgICAgICstcGFyZW5zLXRocmVlLWZh Y2UKKyAgICAgICAgICAgICAgICAgICAgKy1wYXJlbnMtZm91ci1mYWNlCisgICAgICAgICAgICAg ICAgICAgICstcGFyZW5zLWZpdmUtZmFjZQorICAgICAgICAgICAgICAgICAgICArLXBhcmV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WludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAgICAg ICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAoZ2xvYmFsLWVs ZG9jLW1vZGUgLTEpKQorICAgICAgKHdoZW4gKGFuZCBqaXQtbG9jay1jb250ZXh0LXRpbWVyCisg ICAgICAgICAgICAgICAgIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAg ICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVuICh0 aW1lcnAgaml0LWxvY2stY29udGV4dC10aW1lcikKKyAgICAgICAgICAoY2FuY2VsLXRpbWVyIGpp dC1sb2NrLWNvbnRleHQtdGltZXIpKQorICAgICAgICA7OyAoc2V0cSBqaXQtbG9jay1jb250ZXh0 LXRpbWVyIChydW4td2l0aC1pZGxlLXRpbWVyIDUuMCAncmVwZWF0ICdqaXQtbG9jay1jb250ZXh0 LWZvbnRpZnkpKQorICAgICAgICAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIG5pbCkpCisg ICAgICAod2hlbiAoYW5kIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAg ICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVuICh0 aW1lcnAgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpCisgICAgICAgICAgKGNhbmNl bC10aW1lciB1bmRvLWF1dG8tY3VycmVudC1ib3VuZGFyeS10aW1lcikpCisgICAgICAgIChmc2V0 ICd1bmRvLWF1dG8tLXVuZG9hYmxlLWNoYW5nZQorICAgICAgICAgICAgICAobGFtYmRhICgpIChh ZGQtdG8tbGlzdCAndW5kby1hdXRvLS11bmRvYWJseS1jaGFuZ2VkLWJ1ZmZlcnMgKGN1cnJlbnQt YnVmZmVyKSkpKQorICAgICAgICAo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YGludGVnZXJwJyBpZiBBVFRSSUJVVEUgZXhw ZWN0cwogYW4gaW50ZWdlciB2YWx1ZS4iCiAgIChsZXQgKCh2YWxpZAogICAgICAgICAgKHBjYXNl IGF0dHJpYnV0ZQotICAgICAgICAgICAoOmZhbWlseQorICAgICAgICAgICAoYDpmYW1pbHkKICAg ICAgICAgICAgIChpZiAod2luZG93LXN5c3RlbSBmcmFtZSkKICAgICAgICAgICAgICAgICAobWFw Y2FyIChsYW1iZGEgKHgpIChjb25zIHggeCkpCiAgICAgICAgICAgICAgICAgICAgICAgICAoZm9u dC1mYW1pbHktbGlzdCkpCiAJICAgICAgOzsgT25seSBvbmUgZm9udCBvbiBUVFlzLgogCSAgICAg IChsaXN0IChjb25zICJkZWZhdWx0IiAiZGVmYXVsdCIpKSkpCi0gICAgICAgICAgICg6Zm91bmRy eQorICAgICAgICAgICAoYDpmb3VuZHJ5CiAJICAgIChsaXN0IG5pbCkpCi0JICAgKDp3aWR0aAor CSAgIChgOndpZHRoCiAJICAgIChtYXBjYXIgIycobGFtYmRhICh4KSAoY29ucyAoc3ltYm9sLW5h bWUgKGFyZWYgeCAxKSkgKGFyZWYgeCAxKSkpCiAJCSAgICBmb250LXdpZHRoLXRhYmxlKSkKLSAg ICAgICAgICAgKDp3ZWlnaHQKKyAgICAgICAgICAgKGA6d2VpZ2h0CiAJICAgIChtYXBjYXIgIyco bGFtYmRhICh4KSAoY29ucyAoc3ltYm9sLW5hbWUgKGFyZWYgeCAxKSkgKGFyZWYgeCAxKSkpCiAJ CSAgICBmb250LXdlaWdodC10YWJsZSkpCi0JICAgKDpzbGFudAorCSAgIChgOnNsYW50CiAJICAg IChtYXBjYXIgIycobGFtYmRhICh4KSAoY29ucyAoc3ltYm9sLW5hbWUgKGFyZWYgeCAxKSkgKGFy ZWYgeCAxKSkpCiAJCSAgICBmb250LXNsYW50LXRhYmxlKSkKLQkgICAoOmludmVyc2UtdmlkZW8K KwkgICAoYDppbnZlcnNlLXZpZGVvCiAJICAgIChtYXBjYXIgIycobGFtYmRhICh4KSAoY29ucyAo c3ltYm9sLW5hbWUgeCkgeCkpCiAJCSAgICAoaW50ZXJuYWwtbGlzcC1mYWNlLWF0dHJpYnV0ZS12 YWx1ZXMgYXR0cmlidXRlKSkpCi0gICAgICAgICAgICgob3IgOnVuZGVybGluZSA6b3ZlcmxpbmUg OnN0cmlrZS10aHJvdWdoIDpib3gpCisgICAgICAgICAgICgob3IgYDp1bmRlcmxpbmUgYDpvdmVy bGluZSBgOnN0cmlrZS10aHJvdWdoIGA6Ym94KQogICAgICAgICAgICAgKGlmICh3aW5kb3ctc3lz dGVtIGZyYW1lKQogICAgICAgICAgICAgICAgIChuY29uYyAobWFwY2FyICMnKGxhbWJkYSAoeCkg KGNvbnMgKHN5bWJvbC1uYW1lIHgpIHgpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IChpbnRlcm5hbC1saXNwLWZhY2UtYXR0cmlidXRlLXZhbHVlcyBhdHRyaWJ1dGUpKQpAQCAtMTEx MiwxMiArMTExMiwxMiBAQCBhbiBpbnRlZ2VyIHZhbHVlLiIKICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAoZGVmaW5lZC1jb2xvcnMgZnJhbWUpKSkKIAkgICAgICAobWFwY2FyICMnKGxh bWJkYSAoeCkgKGNvbnMgKHN5bWJvbC1uYW1lIHgpIHgpKQogCQkgICAgICAoaW50ZXJuYWwtbGlz cC1mYWNlLWF0dHJpYnV0ZS12YWx1ZXMgYXR0cmlidXRlKSkpKQotICAgICAgICAgICAoKG9yIDpm b3JlZ3JvdW5kIDpiYWNrZ3JvdW5kKQorICAgICAgICAgICAoKG9yIGA6Zm9yZWdyb3VuZCBgOmJh Y2tncm91bmQpCiAgICAgICAgICAgICAobWFwY2FyICMnKGxhbWJkYSAoYykgKGNvbnMgYyBjKSkK ICAgICAgICAgICAgICAgICAgICAgKGRlZmluZWQtY29sb3JzIGZyYW1lKSkpCi0gICAgICAgICAg ICg6aGVpZ2h0CisgICAgICAgICAgIChgOmhlaWdodAogICAgICAgICAgICAgJ2ludGVnZXJwKQot ICAgICAgICAgICAoOnN0aXBwbGUKKyAgICAgICAgICAgKGA6c3RpcHBsZQogICAgICAgICAgICAg KGFuZCAobWVtcSAod2luZG93LXN5c3RlbSBmcmFtZSkgJyh4IG5zKSkgOyBObyBzdGlwcGxlIG9u IHczMgogICAgICAgICAgICAgICAgICAobWFwY2FyICMnbGlzdAogICAgICAgICAgICAgICAgICAg ICAgICAgIChhcHBseSAjJ25jb25jCkBAIC0xMTI2LDcgKzExMjYsNyBAQCBhbiBpbnRlZ2VyIHZh bHVlLiIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGZp bGUtZGlyZWN0b3J5LXAgZGlyKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAoZGlyZWN0b3J5LWZpbGVzIGRpcikpKQogICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHgtYml0bWFwLWZpbGUtcGF0aCkpKSkpCi0gICAgICAgICAgICg6 aW5oZXJpdAorICAgICAgICAgICAoYDppbmhlcml0CiAgICAgICAgICAgICAoY29ucyAnKCJub25l IiAuIG5pbCkKICAgICAgICAgICAgICAgICAgIChtYXBjYXIgIycobGFtYmRhIChjKSAoY29ucyAo c3ltYm9sLW5hbWUgYykgYykpCiAgICAgICAgICAgICAgICAgICAgICAgICAgIChmYWNlLWxpc3Qp KSkpCkBAIC0yNTAyLDYgKzI1MDIsMTczIEBAIHVud2FudGVkIGVmZmVjdHMuIgogICA6Z3JvdXAg J2Jhc2ljLWZhY2VzCiAgIDpncm91cCAnZGlzcGxheS1saW5lLW51bWJlcnMpCiAKKworOzs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7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gIFhTRVRGQVNUSU5UIChCVkFSICgmYnVmZmVyX2xvY2Fs X2ZsYWdzLCBtY19maWxsX2NvbHVtbl9kcmF3X2ZvcnRod2l0aCksIGlkeCk7ICsraWR4OworICBY U0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgbWNfZmlsbF9jb2x1bW5faW5h Y3RpdmVfd2luZG93cyksIGlkeCk7ICsraWR4OworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiAgIFhTRVRGQVNUSU5UIChCVkFSICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBtb2RlX2xpbmVf Zm9ybWF0KSwgaWR4KTsgKytpZHg7CiAgIFhTRVRGQVNUSU5UIChCVkFSICgmYnVmZmVyX2xvY2Fs X2ZsYWdzLCBhYmJyZXZfbW9kZSksIGlkeCk7ICsraWR4OwogICBYU0VURkFTVElOVCAoQlZBUiAo JmJ1ZmZlcl9sb2NhbF9mbGFncywgb3ZlcndyaXRlX21vZGUpLCBpZHgpOyArK2lkeDsKQEAgLTUx NzgsNiArNTIwMCwyOCBAQCBpbml0X2J1ZmZlcl9vbmNlICh2b2lkKQogICAvKiBNdXN0IGRvIHRo ZXNlIGJlZm9yZSBtYWtpbmcgdGhlIGZpcnN0IGJ1ZmZlciEgKi8KIAogICAvKiByZWFsIHNldHVw IGlzIGRvbmUgaW4gYmluZGluZ3MuZWwgKi8KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworICBic2V0X2Jsdl9tY19yZWFsX2Zha2VfY3Vyc29y ICgmYnVmZmVyX2RlZmF1bHRzLCBRaG9sbG93KTsKKyAgYnNldF9ibHZfbXVsdGlwbGVfY3Vyc29y c19jb25mICgm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bGVy Iik7CisgIERFRlNZTSAoUWNyb3NzaGFpcnNfZHJhd19mb3J0aHdpdGgsICJjcm9zc2hhaXJzLWRy YXctZm9ydGh3aXRoIik7CisgIERFRlNZTSAoUWNyb3NzaGFpcnNfaW5hY3RpdmVfd2luZG93cywg ImNyb3NzaGFpcnMtaW5hY3RpdmUtd2luZG93cyIpOworICBERUZTWU0gKFFtY19zdGRlcnIsICJt Yy1zdGRlcnIiKTsKKyAgREVGU1lNIChRbWNfZmlsbF9jb2x1bW4sICJtYy1maWxsLWNvbHVtbiIp OworICBERUZTWU0gKFFtY19maWxsX2NvbHVtbl9kcmF3X2ZvcnRod2l0aCwgIm1jLWZpbGwtY29s dW1uLWRyYXctZm9ydGh3aXRoIik7CisgIERFRlNZTSAoUW1jX2ZpbGxfY29sdW1uX2luYWN0aXZl X3dpbmRvdywgIm1jLWZpbGwtY29sdW1uLWluYWN0aXZlLXdpbmRvdyIpOworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAgIERFRlNZTSAoUWNob2ljZSwgImNob2ljZSIpOwogICBERUZT WU0gKFFsZWZ0LCAibGVmdCIpOwogICBERUZTWU0gKFFyaWdodCwgInJpZ2h0Iik7CkBAIC01NDUz LDYgKzU1MTgsNjUgQEAgc3ltc19vZl9idWZmZXIgKHZvaWQpCiAgIEZwdXQgKFFwcm90ZWN0ZWRf ZmllbGQsIFFlcnJvcl9tZXNzYWdlLAogCWJ1aWxkX3B1cmVfY19zdHJpbmcgKCJBdHRlbXB0IHRv IG1vZGlmeSBhIHByb3RlY3RlZCBmaWVsZCIpKTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworICBERUZWQVJfUEVSX0JVRkZFUiAoIm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1tb2RlJyB0byByZXNldCBmdW5jdGlvbnMgYXR0YWNoZWQgdG8gdGhlIGBwb3N0LWNvbW1h bmQtaG9vaycuICovKTsKKworICBERUZWQVJfUEVSX0JVRkZFUiAoIm1jLWZpbGwtY29sdW1uLWlu YWN0aXZlLXdpbmRvd3MiLCAmQlZBUiAoY3VycmVudF9idWZmZXIsIG1jX2ZpbGxfY29sdW1uX2lu YWN0aXZlX3dpbmRvd3MpLCBRbmlsLAorICAgIGRvYzogLyogV2hlbiBub24tbmlsLCBkcmF3IG11 bHRpcGxlIGN1cnNvcnMgZmlsbCBjb2x1bW4gaW4gaW5hY3RpdmUgd2luZG93cy4gKi8pOworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIERFRlZBUl9QRVJfQlVGRkVSICgiaGVhZGVy LWxpbmUtZm9ybWF0IiwKIAkJICAgICAmQlZBUiAoY3VycmVudF9idWZmZXIsIGhlYWRlcl9saW5l X2Zvcm1hdCksCiAJCSAgICAgUW5pbCwKZGlmZiAtLWdpdCBhL3NyYy9idWZmZXIuaCBiL3NyYy9i dWZmZXIuaAppbmRleCA0ZWE3ZmE2Li4yMzA1ZjQ3IDEwMDY0NAotLS0gYS9zcmMvYnVmZmVyLmgK KysrIGIvc3JjL2J1ZmZlci5oCkBAIC02MzYsNiArNjM2LDUyIEBAIHN0cnVjdCBidWZmZXIKICAg ICAgY2FjaGUgYXJlIGVuYWJsZWQuICBTZWUgc2VhcmNoLmMsIGluZGVudC5jIGFuZCBiaWRpLmMg Zm9yIGRldGFpbHMuICAqLwogICBMaXNwX09iamVjdCBjYWNoZV9sb25nX3NjYW5zXzsKIAorCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworICAvK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GZ1bmN0aW9ucyB0byBzZXQgTGlzcCBmaWVsZHMgaW4gc3RydWN0CiAg ICBidWZmZXIuICAoU29tZSBzZXR0ZXJzIHRoYXQgYXJlIHByaXZhdGUgdG8gYSBzaW5nbGUgLmMg ZmlsZSBhcmUKICAgIGRlZmluZWQgYXMgc3RhdGljIGluIHRob3NlIGZpbGVzLikgICovCisKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKK0lOTElO RSB2b2lkCitic2V0X2Jsdl9tY19yZWFsX2Zha2VfY3Vyc29yIChzdHJ1Y3QgYnVmZmVyICpiLCBM aXNwX09iamVjdCB2YWwpCit7CisgIGItPm1jX3JlYWxfZmFrZV9jdXJzb3JfID0gdmFsOworfQor CitJTkxJTkUgdm9pZAorYnNldF9ibHZfbXVsdGlwbGVfY3Vyc29yc19jb25mIChzdHJ1Y3QgYnVm ZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7CisgIGItPm11bHRpcGxlX2N1cnNvcnNfY29uZl8g PSB2YWw7Cit9CisKK0lOTElORSB2b2lkCitic2V0X2Jsdl9tdWx0aXBsZV9jdXJzb3JzX2RyYXdf Zm9ydGh3aXRoIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7CisgIGItPm11 bHRpcGxlX2N1cnNvcnNfZHJhd19mb3J0aHdpdGhfID0gdmFsOworfQorCitJTkxJTkUgdm9pZAor YnNldF9ibHZfbXVsdGlwbGVfY3Vyc29yc19pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3QgYnVmZmVy ICpiLCBMaXNwX09iamVjdCB2YWwpCit7CisgIGItPm11bHRpcGxlX2N1cnNvcnNfaW5hY3RpdmVf d2luZG93c18gPSB2YWw7Cit9CisKK0lOTElORSB2b2lkCitic2V0X2Jsdl9jcm9zc2hhaXJzIChz dHJ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OTElORSB2b2lkCitic2V0X2Jsdl9tY19maWxsX2NvbHVt bl9kcmF3X2ZvcnRod2l0aCAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFsKQorewor ICBiLT5tY19maWxsX2NvbHVtbl9kcmF3X2ZvcnRod2l0aF8gPSB2YWw7Cit9CisKK0lOTElORSB2 b2lkCitic2V0X2Jsdl9tY19maWxsX2NvbHVtbl9pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3QgYnVm ZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7CisgIGItPm1jX2ZpbGxfY29sdW1uX2luYWN0aXZl X3dpbmRvd3NfID0gdmFsOworfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiBJTkxJ TkUgdm9pZAogYnNldF9iaWRpX3BhcmFncmFwaF9kaXJlY3Rpb24gKHN0cnVjdCBidWZmZXIgKmIs IExpc3BfT2JqZWN0IHZhbCkKIHsKZGlmZiAtLWdpdCBhL3NyYy9kaXNwZXh0ZXJuLmggYi9zcmMv ZGlzcGV4dGVybi5oCmluZGV4IDU3OTY2NWMuLmI1ZWUxMzUgMTAwNjQ0Ci0tLSBhL3NyYy9kaXNw ZXh0ZXJuLmgKKysrIGIvc3JjL2Rpc3BleHRlcm4uaApAQCAtOTQsNiArOTQsMjggQEAgdHlwZWRl ZiBpbnQgQ3Vyc29yOwogI2RlZmluZSBOYXRpdmVSZWN0YW5nbGUgaW50CiAjZW5kaWYKIAorCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworZW51bSBt Y190eXBlcworeworICBOT19GTEFWT1IsCisgIE1DX0dMWVBILAorICBNQ19HTFlQSExFU1MsCisg IE1DX0dMWVBIX1RBQiwKKyAgTUNfT1ZFUkxBWV9BUlJPV19CSVRNQVAsCisgIE1DX1BJTENST1cs CisgIE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1csCisgIE1DX0hPTExPV19SRUNUQU5H TEUsCisgIE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVywKKyAgTUNfVkVSVElDQUxfQkFSLAor ICBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICit9OworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKworCiAvKiBUZXh0IGN1cnNvciB0eXBlcy4gICovCiAKIGVudW0gdGV4dF9jdXJzb3Jfa2lu ZHMKQEAgLTM3Niw2ICszOTgsMTggQEAgc3RydWN0IGdseXBoX3NsaWNlCiAKIHN0cnVjdCBnbHlw aAogeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAq LworCisgIGludCB4LCB5LCBocG9zLCB2cG9zOworCisgIGJvb2xfYmYgenZfcCA6IDE7CisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogUG9zaXRpb24gZnJvbSB3aGljaCB0aGlz IGdseXBoIHdhcyBkcmF3bi4gIElmIGBvYmplY3QnIGJlbG93IGlzIGEKICAgICAgTGlzcCBzdHJp bmcsIHRoaXMgaXMgYW4gaW5kZXggaW50byB0aGF0IHN0cmluZy4gIElmIGl0IGlzIGEKICAgICAg YnVmZmVyLCB0aGlzIGlzIGEgcG9zaXRpb24gaW4gdGhhdCBidWZmZXIuICBJbiBhZGRpdGlvbiwg c29tZQpAQCAtMjIxMCw2ICsyMjQ0LDE2IEBAIHN0cnVjdCBjb21wb3NpdGlvbl9pdAogCiBzdHJ1 Y3QgaXQKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNP UlMgKi8KKworICBib29sX2JmIHp2X3AgOiAxOworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiAgIC8qIFRoZSB3aW5kb3cgaW4gd2hpY2ggd2UgaXRlcmF0ZSBvdmVyIGN1cnJlbnRfYnVm ZmVyIChvciBhIHN0cmluZykuICAqLwogICBMaXNwX09iamVjdCB3aW5kb3c7CiAgIHN0cnVjdCB3 aW5kb3cgKnc7CmRpZmYgLS1naXQgYS9zcmMvZnJhbWUuaCBiL3NyYy9mcmFtZS5oCmluZGV4IGFk NzM3NmEuLjMxZDk1MjcgMTAwNjQ0Ci0tLSBhL3NyYy9mcmFtZS5oCisrKyBiL3NyYy9mcmFtZS5o CkBAIC0yMDIsNiArMjAyLDE2IEBAIHN0cnVjdCBmcmFtZQogCiAgIC8qIEJleW9uZCBoZXJlLCB0 aGVyZSBzaG91bGQgYmUgbm8gbW9yZSBMaXNwX09iamVjdCBjb21wb25lbnRzLiAgKi8KIAorCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworICAvKiBO b24tbmlsIHdoZW4gdGhlIGZyYW1lIGlzIGluIHRoZSBwcm9jZXNzIG9mIGJlaW5nIHVwZGF0ZWQu ICovCisgIHN0cnVjdCBmcmFtZSAqbWNfdXBkYXRpbmdfZnJhbWU7CisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKICAgLyogQ2FjaGUgb2YgcmVhbGl6ZWQgZmFjZXMuICAqLwogICBzdHJ1 Y3QgZmFjZV9jYWNoZSAqZmFjZV9jYWNoZTsKIApkaWZmIC0tZ2l0IGEvc3JjL2ZyaW5nZS5jIGIv c3JjL2ZyaW5nZS5jCmluZGV4IGExMDE2YWQuLjJhNTU3M2EgMTAwNjQ0Ci0tLSBhL3NyYy9mcmlu Z2UuYworKysgYi9zcmMvZnJpbmdlLmMKQEAgLTQzMyw2ICs0MzMsNDAyIEBAIHN0YXRpYyB1bnNp Z25lZCBzaG9ydCBlbXB0eV9saW5lX2JpdHNbXSA9IHsKICAgMHgwMCwgMHgzYywgMHgwMCwgMHgw MCwgMHgzYywgMHgwMCwgMHgwMCwgMHgzYywgMHgwMH07CiAKIAorLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBiZWdpbiBNVUxUSVBMRSBDVVJTT1JTICovCisKKy8qIGArLWZyaW5nZS1oZWxw ZXItZGVjaW1hbCcgZGVmaW5lZCBpbiBgY3Jvc3NoYWlycy5lbGAgKi8KKworLyogMjQKKyAgICAo Ky1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4u Li4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4ueHguLi4iCisgICAgICAieC4uLnh4 Li4iCisgICAgICAieC4uLi54eC4iCisgICAgICAieC54eHh4eHgiCisgICAgICAieC54eHh4eHgi CisgICAgICAieC4uLi54eC4iCisgICAgICAieC4uLnh4Li4iCisgICAgICAieC4ueHguLi4iCisg ICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iKQorKi8K K3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY192ZXJ0aWNhbF9iYXJfcmlnaHRf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gIi4uLnh4Li4uIgorICAgICAgIi4uLi54eC4uIgorICAgICAgIi4uLi54 eC4uIgorICAgICAgIi4uLi4ueHguIgorICAgICAgIi4uLi4ueHguIgorICAgICAgIi4uLi4uLnh4 IgorICAgICAgIi4uLi4uLnh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfYmFja3Ns YXNoX2JpdHNbXSA9eworICAweGMwLCAweGMwLCAweGUwLCAweDYwLCAweDMwLCAweDMwLCAweDE4 LCAweDE4LCAweGMsIDB4YywgMHg2LCAweDYsIDB4MywgMHgzfTsKKworLyogMjkKKyAgICAoKy1m cmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHguLi4uLi4iCisgICAgICAieHguLi4u Li4iCisgICAgICAieHh4Li4uLi4iCisgICAgICAieHh4Li4uLi4iCisgICAgICAieC54eC4uLi4i CisgICAgICAieC54eC4uLi4iCisgICAgICAieC4ueHguLi4iCisgICAgICAieC4ueHguLi4iCisg ICAgICAieC4uLnh4Li4iCisgICAgICAieC4uLnh4Li4iCisgICAgICAieC4uLi54eC4iCisgICAg ICAieC4uLi54eC4iCisgICAgICAieC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgiKQorKi8KK3N0 YXRpYyB1bnNpZ25lZCBzaG9ydCBtY192ZXJ0aWNhbF9iYXJfYmFja3NsYXNoX2JpdHNbXSA9ewor ICAweGMwLCAweGMwLCAweGUwLCAweGUwLCAweGIwLCAweGIwLCAweDk4LAorICAweDk4LCAweDhj LCAweDhjLCAweDg2LCAweDg2LCAweDgzLCAweDgzfTsKKworLyogMzAKKyAgICAoKy1mcmluZ2Ut aGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLnh4eHh4eC4iCisgICAgICAieHh4eC54Li4iCisg ICAgICAieHh4eC54Li4iCisgICAgICAieHh4eC54Li4iCisgICAgICAiLnh4eC54Li4iCisgICAg ICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAgICAi Li4ueC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4iKQorKi8KK3N0YXRp YyB1bnNpZ25lZCBzaG9ydCBtY19waWxjcm93X2JpdHNbXSA9eworICAweDdlLCAweGY0LCAweGY0 LCAweGY0LCAweDc0LCAweDE0LCAweDE0LCAweDE0LCAweDE0LCAweDE0LCAweDE0fTsKKworLyog MzEKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi54eHh4Li4iCisg ICAgICAiLnh4eHh4eC4iCisgICAgICAieC4ueHguLngiCisgICAgICAieC4ueHguLngiCisgICAg ICAieHh4eHh4eHgiCisgICAgICAieHguLi4ueHgiCisgICAgICAieHh4Li54eHgiCisgICAgICAi Lnh4eHh4eC4iCisgICAgICAiLi54eHh4Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBt Y19zbWlsZXlfZmFjZV9iaXRzW10gPXsKKyAgMHgzYywgMHg3ZSwgMHg5OSwgMHg5OSwgMHhmZiwg MHhjMywgMHhlNywgMHg3ZSwgMHgzY307CisKKy8qIDMyCisgICAgKCstZnJpbmdlLWhlbHBlci1o ZXhhZGVjaW1hbAorICAgICAgIi4ueC4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4u Li54Li4uIgorICAgICAgIi4uLi4ueC4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4uLngu Li4uIgorICAgICAgIi4ueC4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc2lu Z2xlX2FuZ2xlX3JpZ2h0X2JpdHNbXSA9eworICAweDIwLCAweDEwLCAweDgsIDB4NCwgMHg4LCAw eDEwLCAweDIwfTsKKworLyogMzMKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisg ICAgICAiLi4uLi54Li4iCisgICAgICAiLi4uLnguLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAg ICAiLi54Li4uLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLnguLi4iCisgICAgICAi Li4uLi54Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zaW5nbGVfYW5nbGVfbGVm dF9iaXRzW10gPXsKKyAgMHg0LCAweDgsIDB4MTAsIDB4MjAsIDB4MTAsIDB4OCwgMHg0fTsKKwor LyogMzQKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHgueHguLi4i CisgICAgICAiLnh4Lnh4Li4iCisgICAgICAiLi54eC54eC4iCisgICAgICAiLi4ueHgueHgiCisg ICAgICAiLi54eC54eC4iCisgICAgICAiLnh4Lnh4Li4iCisgICAgICAieHgueHguLi4iKQorKi8K K3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfcmlnaHRfYml0c1tdID17Cisg IDB4ZDgsIDB4NmMsIDB4MzYsIDB4MWIsIDB4MzYsIDB4NmMsIDB4ZDh9OworCisvKiAzNQorICAg ICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi54eC54eCIKKyAgICAgICIu Lnh4Lnh4LiIKKyAgICAgICIueHgueHguLiIKKyAgICAgICJ4eC54eC4uLiIKKyAgICAgICIueHgu eHguLiIKKyAgICAgICIuLnh4Lnh4LiIKKyAgICAgICIuLi54eC54eCIpCisqLworc3RhdGljIHVu c2lnbmVkIHNob3J0IG1jX2RvdWJsZV9hbmdsZV9sZWZ0X2JpdHNbXSA9eworICAweDFiLCAweDM2 LCAweDZjLCAweGQ4LCAweDZjLCAweDM2LCAweDFifTsKKworLyogMzYKKyAgICAoKy1mcmluZ2Ut aGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC54LnguLi4iCisgICAgICAiLngueC54Li4iCisg ICAgICAiLi54LngueC4iCisgICAgICAiLi4ueC54LngiCisgICAgICAiLi54LngueC4iCisgICAg ICAiLngueC54Li4iCisgICAgICAieC54LnguLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9y dCBtY190cmlwbGVfYW5nbGVfcmlnaHRfYml0c1tdID17CisgIDB4YTgsIDB4NTQsIDB4MmEsIDB4 MTUsIDB4MmEsIDB4NTQsIDB4YTh9OworCisvKiAzNworICAgICgrLWZyaW5nZS1oZWxwZXItaGV4 YWRlY2ltYWwKKyAgICAgICIuLi54LngueCIKKyAgICAgICIuLngueC54LiIKKyAgICAgICIueC54 LnguLiIKKyAgICAgICJ4LngueC4uLiIKKyAgICAgICIueC54LnguLiIKKyAgICAgICIuLngueC54 LiIKKyAgICAgICIuLi54LngueCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3RyaXBs ZV9hbmdsZV9sZWZ0X2JpdHNbXSA9eworICAweDE1LCAweDJhLCAweDU0LCAweGE4LCAweDU0LCAw eDJhLCAweDE1fTsKKworLyogMzgKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisg ICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAg ICAiLi4uLi4uLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54LnguLi4iCisgICAgICAi LnguLi54Li4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4u Li4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1 bnNpZ25lZCBzaG9ydCBtY19zaW5nbGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4MDAsIDB4MDAs IDB4MDAsIDB4MDAsIDB4MTAsIDB4MjgsIDB4NDQsIDB4ODIsIDB4MDAsIDB4MDAsIDB4MDAsIDB4 MDB9OworCisvKiAzOQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIu Li4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4u Li4uLiIKKyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4u LiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIK KyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVk IHNob3J0IG1jX3NpbmdsZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAweDAwLCAweDAwLCAweDAw LCAweDAwLCAweDgyLCAweDQ0LCAweDI4LCAweDEwLCAweDAwLCAweDAwLCAweDAwLCAweDAwfTsK KworLyogNDAKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4u Li4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4ueC4uLi4i CisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisg ICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4uLi4ueC4iCisgICAg ICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0 YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4MDAs IDB4MDAsIDB4MDAsIDB4MTAsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4ODIsIDB4 MDAsIDB4MDAsIDB4MDB9OworCisvKiA0MQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2lt YWwKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIK KyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAg ICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAg ICIuLi54Li4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIu Li4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX2RvdWJsZV9hbmdsZV9kb3du X2JpdHNbXSA9eworICAweDAwLCAweDAwLCAweDAwLCAweDgyLCAweDQ0LCAweDI4LCAweDkyLCAw eDQ0LCAweDI4LCAweDEwLCAweDAwLCAweDAwLCAweDAwfTsKKworLyogNDIKKyAgICAoKy1mcmlu Z2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4ueC4uLi4i CisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisg ICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAg ICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAi Li4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190cmlwbGVfYW5nbGVfdXBf Yml0c1tdID17CisgIDB4MDAsIDB4MTAsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4 OTIsIDB4MjgsIDB4NDQsIDB4ODIsIDB4MDB9OworCisvKiA0MworICAgICgrLWZyaW5nZS1oZWxw ZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICJ4Li4uLi54LiIKKyAgICAg ICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIu eC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4u LnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLi4uLi4u LiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3F1YWRydXBsZV9hbmdsZV9kb3duX2Jp dHNbXSA9eworICAweDAwLCAweDgyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDky LCAweDQ0LCAweDI4LCAweDEwLCAweDAwfTsKKworLyogNDQKKyAgICAoKy1mcmluZ2UtaGVscGVy LWhleGFkZWNpbWFsCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54LnguLi4iCisgICAgICAi LnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLngu Li54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54 Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4i CisgICAgICAieC4uLi4ueC4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19xdWFkcnVw bGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4MTAsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4 NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4ODJ9OworCisvKiA0NQor ICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICJ4Li4uLi54LiIKKyAgICAg ICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIu eC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4u LnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLngu LiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIuLi54Li4uLiIpCisqLworc3RhdGljIHVuc2ln bmVkIHNob3J0IG1jX3RyaXBsZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAweDgyLCAweDQ0LCAw eDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4 LCAweDEwfTsKKworLyogVE9ETzogIEFkZCB0aGUgZm9sbG93aW5nIGJpdG1hcHM6CisgIChkZWZp bmUtZnJpbmdlLWJpdG1hcCAnYnJlYWtwb2ludCAiXHgzY1x4N2VceGZmXHhmZlx4ZmZceGZmXHg3 ZVx4M2MiKQorICAoZGVmaW5lLWZyaW5nZS1iaXRtYXAgJ2hvbGxvdy1yaWdodC10cmlhbmdsZSAi XHhlMFx4OTBceDg4XHg4NFx4ODRceDg4XHg5MFx4ZTAiKSAqLworCisvKiBlbmQgTVVMVElQTEUg Q1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogI2RlZmluZSBCWVRFU19Q RVJfQklUTUFQX1JPVyAgKHNpemVvZiAodW5zaWduZWQgc2hvcnQpKQogI2RlZmluZSBTVEFOREFS RF9CSVRNQVBfSEVJR0hUKGJpdHMpIChzaXplb2YgKGJpdHMpL0JZVEVTX1BFUl9CSVRNQVBfUk9X KQogI2RlZmluZSBGUkJJVFMoYml0cykgIGJpdHMsIFNUQU5EQVJEX0JJVE1BUF9IRUlHSFQgKGJp dHMpCkBAIC00NjYsNiArODYyLDU5IEBAIHN0YXRpYyBzdHJ1Y3QgZnJpbmdlX2JpdG1hcCBzdGFu ZGFyZF9iaXRtYXBzW10gPQogICB7IEZSQklUUyAodmVydGljYWxfYmFyX2JpdHMpLCAgICAgICA4 LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCiAgIHsgRlJCSVRTIChob3Jpem9udGFsX2Jh cl9iaXRzKSwgICAgIDgsIDAsIEFMSUdOX0JJVE1BUF9CT1RUT00sIDAgfSwKICAgeyBGUkJJVFMg KGVtcHR5X2xpbmVfYml0cyksICAgICAgICAgOCwgMywgQUxJR05fQklUTUFQX1RPUCwgICAgMCB9 LAorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLwor CisgIC8qIDI0ICovCisgIHsgRlJCSVRTIChtY192ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3dfYml0 cyksICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDI1ICovCisgIHsg RlJCSVRTIChtY19ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93X2JpdHMpLCA4LCAwLCBBTElH Tl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDI2ICovCisgIHsgRlJCSVRTIChtY19ob2xsb3df cmVjdGFuZ2xlX2JpdHMpLCAgICAgICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAw IH0sCisgIC8qIDI3ICovCisgIHsgRlJCSVRTIChtY192ZXJ0aWNhbF9iYXJfYml0cyksICAgICAg ICAgICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDI4ICovCisg IHsgRlJCSVRTIChtY19iYWNrc2xhc2hfYml0cyksICAgICAgICAgICAgICAgICAgICA4LCAwLCBB TElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDI5ICovCisgIHsgRlJCSVRTIChtY192ZXJ0 aWNhbF9iYXJfYmFja3NsYXNoX2JpdHMpLCAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVS LCAwIH0sCisgIC8qIDMwICovCisgIHsgRlJCSVRTIChtY19waWxjcm93X2JpdHMpLCAgICAgICAg ICAgICAgICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDMxICov CisgIHsgRlJCSVRTIChtY19zbWlsZXlfZmFjZV9iaXRzKSwgICAgICAgICAgICAgICAgICA4LCAw LCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDMyICovCisgIHsgRlJCSVRTIChtY19z aW5nbGVfYW5nbGVfcmlnaHRfYml0cyksICAgICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VO VEVSLCAwIH0sCisgIC8qIDMzICovCisgIHsgRlJCSVRTIChtY19zaW5nbGVfYW5nbGVfbGVmdF9i aXRzKSwgICAgICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDM0 ICovCisgIHsgRlJCSVRTIChtY19kb3VibGVfYW5nbGVfcmlnaHRfYml0cyksICAgICAgICAgICA4 LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDM1ICovCisgIHsgRlJCSVRTICht Y19kb3VibGVfYW5nbGVfbGVmdF9iaXRzKSwgICAgICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBf Q0VOVEVSLCAwIH0sCisgIC8qIDM2ICovCisgIHsgRlJCSVRTIChtY190cmlwbGVfYW5nbGVfcmln aHRfYml0cyksICAgICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8q IDM3ICovCisgIHsgRlJCSVRTIChtY190cmlwbGVfYW5nbGVfbGVmdF9iaXRzKSwgICAgICAgICAg ICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDM4ICovCisgIHsgRlJCSVRT IChtY19zaW5nbGVfYW5nbGVfdXBfYml0cyksICAgICAgICAgICAgICA4LCAwLCBBTElHTl9CSVRN QVBfQ0VOVEVSLCAwIH0sCisgIC8qIDM5ICovCisgIHsgRlJCSVRTIChtY19zaW5nbGVfYW5nbGVf ZG93bl9iaXRzKSwgICAgICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisg IC8qIDQwICovCisgIHsgRlJCSVRTIChtY19kb3VibGVfYW5nbGVfdXBfYml0cyksICAgICAgICAg ICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDQxICovCisgIHsgRlJC SVRTIChtY19kb3VibGVfYW5nbGVfZG93bl9iaXRzKSwgICAgICAgICAgICA4LCAwLCBBTElHTl9C SVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDQyICovCisgIHsgRlJCSVRTIChtY190cmlwbGVfYW5n bGVfdXBfYml0cyksICAgICAgICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0s CisgIC8qIDQzICovCisgIHsgRlJCSVRTIChtY190cmlwbGVfYW5nbGVfZG93bl9iaXRzKSwgICAg ICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDQ0ICovCisgIHsg RlJCSVRTIChtY19xdWFkcnVwbGVfYW5nbGVfdXBfYml0cyksICAgICAgICAgICA4LCAwLCBBTElH Tl9CSVRNQVBfQ0VOVEVSLCAwIH0sCisgIC8qIDQ1ICovCisgIHsgRlJCSVRTIChtY19xdWFkcnVw bGVfYW5nbGVfZG93bl9iaXRzKSwgICAgICAgICA4LCAwLCBBTElHTl9CSVRNQVBfQ0VOVEVSLCAw IH0sCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIH07CiAKICNkZWZpbmUgTk9fRlJJ TkdFX0JJVE1BUCAwCkBAIC0xNzIzLDYgKzIxNzIsMTUwIEBAIElmIG5pbCwgYWxzbyBjb250aW51 ZSBsaW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GVfYW5nbGVfZG93biwgIistcXVhZHJ1cGxlLWFu Z2xlLWRvd24iKTsKKyAgVmZyaW5nZV9iaXRtYXBzID0gRmNvbnMgKFFtY19xdWFkcnVwbGVfYW5n bGVfZG93biwgVmZyaW5nZV9iaXRtYXBzKTsKKyAgRnB1dCAoUW1jX3F1YWRydXBsZV9hbmdsZV9k b3duLCBRZnJpbmdlLCBtYWtlX2ZpeG51bSAoNDUpKTsKKyAgLyogKGdldCAnKy1xdWFkcnVwbGUt YW5nbGUtZG93biAnZnJpbmdlKSA9PiA0NSAqLworCisvKiBlbmQgTVVMVElQTEUgQ1VSU09SUyAq LworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAvKiBHYXJiYWdlIGNvbGxlY3Rp b24gaG9vayAqLwpkaWZmIC0tZ2l0IGEvc3JjL2tleWJvYXJkLmMgYi9zcmMva2V5Ym9hcmQuYwpp bmRleCBiZTcyN2E2Li4wMTgwZDFhIDEwMDY0NAotLS0gYS9zcmMva2V5Ym9hcmQuYworKysgYi9z cmMva2V5Ym9hcmQuYwpAQCAtMTIyNCw2ICsxMjI0LDgwIEBAIHN0YXRpYyBpbnQgcmVhZF9rZXlf c2VxdWVuY2UgKExpc3BfT2JqZWN0ICosIExpc3BfT2JqZWN0LAogICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgYm9vbCwgYm9vbCwgYm9vbCwgYm9vbCk7CiBzdGF0aWMgdm9pZCBhZGp1c3Rf cG9pbnRfZm9yX3Byb3BlcnR5IChwdHJkaWZmX3QsIGJvb2wpOwogCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCitzdGF0aWMgdm9pZAorbWNfc3dp dGNoZXNfbXVsdGlwbGVfY3Vy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LCBib29sIHRydWVfb3JfZmFsc2VfcCkKK3sKKyNpZmRlZiBHTFlQ SF9ERUJVRworICBpZiAodHJhY2VfcmVkaXNwbGF5X3AgJiYgQlVGRkVSUCAody0+Y29udGVudHMp CisgICAgICAmJiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbXVsdGlwbGVf Y3Vyc29yc19jb25mKSkKKyAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBtY19maWxsX2NvbHVtbikpKSkKKyAgICB7CisgICAgICBMaXNwX09iamVj dCB3aW5kb3c7CisgICAgICBYU0VUV0lORE9XICh3aW5kb3csIHcpOworICAgICAgTGlzcF9PYmpl Y3Qgd2luZG93X3N0cmluZyA9IEZwcmluMV90b19zdHJpbmcgKHdpbmRvdywgUW5pbCk7CisgICAg ICBjaGFyICp3aW5kb3dfY2hhciA9IFNTREFUQSAod2luZG93X3N0cmluZyk7CisgICAgICBmcHJp bnRmIChzdGRlcnIsICJcbm1jX3N3aXRjaGVzX2ZpbGxfY29sdW1uICglcyk6ICAlc1xuIiwKKyAg ICAgICAgICAgICAgIHdpbmRvd19jaGFyLCB0cnVlX29yX2ZhbHNlX3AgPyAidHJ1ZSIgOiAiZmFs c2UiKTsKKyAgICB9CisjZW5kaWYKKyAgdy0+bWMuZHJhd19maWxsX2NvbHVtbiA9IHRydWVfb3Jf ZmFsc2VfcDsKKyAgdy0+bWMuZXJhc2VfZmlsbF9jb2x1bW4gPSB0cnVlX29yX2ZhbHNlX3A7Cisg IGlmICh0cnVlX29yX2ZhbHNlX3ApCisgICAgdy0+bXVzdF9iZV91cGRhdGVkX3AgPSB0cnVlOwor fQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiBMaXNwX09iamVjdAogY29tbWFuZF9s b29wXzEgKHZvaWQpCiB7CkBAIC0xNDE5LDYgKzE0OTMsMTYgQEAgY29tbWFuZF9sb29wXzEgKHZv aWQpCiAgICAgICBWcmVhbF90aGlzX2NvbW1hbmQgPSBjbWQ7CiAgICAgICBzYWZlX3J1bl9ob29r cyAoUXByZV9jb21tYW5kX2hvb2spOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyog TVVMVElQTEUgQ1VSU09SUyAqLworCisgICAgICBzdHJ1Y3Qgd2luZG93ICp3ID0gWFdJTkRPVyAo c2VsZWN0ZWRfd2luZG93KTsKKyAgICAgIG1jX3N3aXRjaGVzX211bHRpcGxlX2N1cnNvcnMgKHcs IHRydWUpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICBhbHJlYWR5X2Fk anVzdGVkID0gMDsKIAogICAgICAgaWYgKE5JTFAgKFZ0aGlzX2NvbW1hbmQpKQpAQCAtMTU2NSw2 ICsxNjQ5LDE4IEBAIGNvbW1hbmRfbG9vcF8xICh2b2lkKQogICAgICAgaWYgKCFOSUxQIChLVkFS IChjdXJyZW50X2tib2FyZCwgZGVmaW5pbmdfa2JkX21hY3JvKSkKIAkgICYmIE5JTFAgKEtWQVIg KGN1cnJlbnRfa2JvYXJkLCBWcHJlZml4X2FyZykpKQogCWZpbmFsaXplX2tiZF9tYWNyb19jaGFy cyAoKTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMg Ki8KKworICAgICAgbWNfc3dpdGNoZXNfbXVsdGlwbGVfY3Vyc29ycyAodywgZmFsc2UpOworICAg ICAgbWNfc3dpdGNoZXNfY3Jvc3NoYWlycyAodywgZmFsc2UpOworICAgICAgbWNfc3dpdGNoZXNf ZmlsbF9jb2x1bW4gKHcsIGZhbHNlKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog ICAgIH0KIH0KIApAQCAtMjQ0OCw3ICsyNTQ0LDE1IEBAIHJlYWRfY2hhciAoaW50IGNvbW1hbmRm bGFnLCBMaXNwX09iamVjdCBtYXAsCiAJICBpZiAoaGVscF9lY2hvX3Nob3dpbmdfcCAmJiAhRVEg KHNlbGVjdGVkX3dpbmRvdywgbWluaWJ1Zl93aW5kb3cpKQogCSAgICByZWRpc3BsYXlfcHJlc2Vy dmVfZWNob19hcmVhICg1KTsKIAkgIGVsc2UKLQkgICAgcmVkaXNwbGF5ICgpOworCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisJICAgIHJlZGlz cGxheSAoMSk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCiAKIAkgIGlmICghaW5wdXRf cGVuZGluZykKIAkgICAgLyogTm9ybWFsIGNhc2U6IG5vIGlucHV0IGFycml2ZWQgZHVyaW5nIHJl ZGlzcGxheS4gICovCkBAIC0yNjI4LDcgKzI3MzIsMTYgQEAgcmVhZF9jaGFyIChpbnQgY29tbWFu ZGZsYWcsIExpc3BfT2JqZWN0IG1hcCwKICAgICB7CiAgICAgICBGZG9fYXV0b19zYXZlIChhdXRv X3NhdmVfbm9fbWVzc2FnZSA/IFF0IDogUW5pbCwgUW5pbCk7CiAgICAgICAvKiBIb29rcyBjYW4g YWN0dWFsbHkgY2hhbmdlIHNvbWUgYnVmZmVycyBpbiBhdXRvIHNhdmUuICAqLwotICAgICAgcmVk aXNwbGF5ICgpOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VS U09SUyAqLworCisgICAgICByZWRpc3BsYXkgKDIpOworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKworCiAgICAgfQogCiAgIC8qIFRyeSByZWFkaW5nIHVzaW5nIGFuIFggbWVudS4KQEAgLTI2 OTIsNyArMjgwNSwxNiBAQCByZWFkX2NoYXIgKGludCBjb21tYW5kZmxhZywgTGlzcF9PYmplY3Qg bWFwLAogCSAgICAgICYmICEgQ09OU1AgKFZ1bnJlYWRfY29tbWFuZF9ldmVudHMpKQogCSAgICB7 CiAJICAgICAgRmRvX2F1dG9fc2F2ZSAoYXV0b19zYXZlX25vX21lc3NhZ2UgPyBRdCA6IFFuaWws IFFuaWwpOwotCSAgICAgIHJlZGlzcGxheSAoKTsKKworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworCSAgICAgIHJlZGlzcGxheSAoMyk7CisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgICAgfQogCX0KIApAQCAtMjc5NSw3ICsyOTE3 LDE1IEBAIHJlYWRfY2hhciAoaW50IGNvbW1hbmRmbGFnLCBMaXNwX09iamVjdCBtYXAsCiAgICAg ewogICAgICAgaWYgKGNvbW1hbmRmbGFnID49IDAKIAkgICYmICFpbnB1dF9wZW5kaW5nICYmICFk ZXRlY3RfaW5wdXRfcGVuZGluZ19ydW5fdGltZXJzICgwKSkKLQlyZWRpc3BsYXkgKCk7CisKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKwlyZWRp c3BsYXkgKDQpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwogCiAgICAgICBnb3RvIHdy b25nX2tib2FyZDsKICAgICB9CkBAIC0zMDkzLDcgKzMyMjMsMTUgQEAgcmVhZF9jaGFyIChpbnQg Y29tbWFuZGZsYWcsIExpc3BfT2JqZWN0IG1hcCwKICAgICAgIC8qIFJlbW92ZSB0aGUgaGVscCBm cm9tIHRoZSBmcmFtZS4gICovCiAgICAgICB1bmJpbmRfdG8gKGNvdW50LCBRbmlsKTsKIAotICAg ICAgcmVkaXNwbGF5ICgpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExF IENVUlNPUlMgKi8KKworICAgICAgcmVkaXNwbGF5ICg1KTsKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogICAgICAgaWYgKEVRIChjLCBtYWtlX2ZpeG51bSAoMDQwKSkpCiAJewogCSAg Y2FuY2VsX2VjaG9pbmcgKCk7CmRpZmYgLS1naXQgYS9zcmMvbGlzcC5oIGIvc3JjL2xpc3AuaApp bmRleCA3ZTdkYmE2Li40NmQ5MjMxIDEwMDY0NAotLS0gYS9zcmMvbGlzcC5oCisrKyBiL3NyYy9s aXNwLm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cmUgdXBkYXRlX3dpbmRvd19i ZWdpbgogICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KIHsKKworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGluZ19mcmFtZSA9 IGY7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICNpZmRlZiBOU19JTVBMX0NPQ09B CiAgIEVtYWNzVmlldyAqdmlldyA9IEZSQU1FX05TX1ZJRVcgKGYpOwogCkBAIC0xMjEwLDYgKzEy MjAsMTYgQEAgc3RhdGljIE5TUmVjdCBjb25zdHJhaW5fZnJhbWVfcmVjdChOU1JlY3QgZnJhbWVS ZWN0LCBib29sIGlzRnVsbHNjcmVlbikKIAogLyogICBpZiAoZiA9PSBNT1VTRV9ITF9JTkZPIChm KS0+bW91c2VfZmFjZV9tb3VzZV9mcmFtZSkgKi8KICAgTU9VU0VfSExfSU5GTyAoZiktPm1vdXNl X2ZhY2VfZGVmZXIgPSAwOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQ TEUgQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gTlVMTDsKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogfQogCiAKQEAgLTE5NzMsNyArMTk5Myw3IEBAIHNvIHNv bWUga2V5IHByZ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AgICAgICAgaWYgKFtjaGlsZCByZXNwb25kc1RvU2VsZWN0b3I6QHNl bGVjdG9yKHNldEFjY2Vzc2liaWxpdHlTdWJyb2xlOildKQogI2VuZGlmCiAgICAgICAgICAgICAg IFtjaGlsZCBzZXRBY2Nlc3NpYmlsaXR5U3Vicm9sZTpOU0FjY2Vzc2liaWxpdHlGbG9hdGluZ1dp bmRvd1N1YnJvbGVdOwogI2VuZGlmCkBAIC0zMjEwLDIzICszMjMwLDEyMCBAQCBOb3RlIHRoYXQg Q1VSU09SX1dJRFRIIGlzIG1lYW5pbmdmdWwgb25seSBmb3IgKGgpYmFyIGN1cnNvcnMuCiAgICAg ICBoID0gY3Vyc29yX2hlaWdodDsKICAgICB9CiAKLSAgci5vcmlnaW4ueCA9IGZ4LCByLm9yaWdp bi55ID0gZnk7Ci0gIHIuc2l6ZS5oZWlnaHQgPSBoOworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworICByLm9yaWdpbi54ID0gKHctPm1jLmZ4ID4g MCkKKyAgICAgICAgICAgICAgID8gdy0+bWMuZngKKyAgICAgICAgICAgICAgIDogZng7CisgIHIu b3JpZ2luLnkgPSAody0+bWMuZnkgPiAwKQorICAgICAgICAgICAgICAgPyB3LT5tYy5meQorICAg ICAgICAgICAgICAgOiBmeTsKKyAgci5zaXplLmhlaWdodCA9ICh3LT5tYy5oID4gMCkKKyAgICAg ICAgICAgICAgICAgID8gdy0+bWMuaAorICAgICAgICAgICAgICAgICAgOiBoOwogICByLnNpemUu d2lkdGggPSB3LT5waHlzX2N1cnNvcl93aWR0aDsKIAorLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogICAvKiBQcmV2ZW50IHRoZSBjdXJzb3IgZnJ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bnRmIChzdGRlcnIsICJcbmZvcmVncm91bmQgKCVzKSB8IGJhY2tncm91bmQgKCVz KVxuIiwKKyAgICAgICAgICAgICAgICAgICAoIU5JTFAgKGZvcmVncm91bmQpID8gU1NEQVRBIChm b3JlZ3JvdW5kKSA6ICJOSUxQIiksCisgICAgICAgICAgICAgICAgICAgKCFOSUxQIChiYWNrZ3Jv dW5kKSA/IFNTREFUQSAoYmFja2dyb3VuZCkgOiAiTklMUCIpKTsKKworICBFWEFNUExFIE9GIEhP VyBUTyBDUkVBVEUgQSBDT0xPUiBXSVRIIFJHQi9MU0wgZmxvYXQgdmFsdWVzOgorICBOU0NvbG9y ICpteV9jb2xvciA9IFtOU0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6IHMtPnctPm1jLnJl ZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JlZW46 IHMtPnctPm1jLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgYmx1ZTogcy0+dy0+bWMuYmx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgYWxwaGE6IDEuMF07ICovCisKKyAgaWYgKHctPm1jLmdseXBo X2ZsYXZvciA9PSBNQ19HTFlQSAorICAgICAgfHwgdy0+bWMuZ2x5cGhfZmxhdm9yID09IE1DX0dM WVBITEVTUworICAgICAgfHwgdy0+bWMuZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBIX1RBQikKKyAg ICB7CisgICAgICBbW05TQ29sb3IgY29sb3JXaXRoQ2FsaWJyYXRlZFJlZDogdy0+bWMucmVkIGdy ZWVuOiB3LT5tYy5ncmVlbiBibHVlOiB3LT5tYy5ibHVlIGFscGhhOiAxLjBdIHNldF07CisgICAg ICBMaXNwX09iamVjdCBidWYgPSB3LT5jb250ZW50czsKKyAgICAgIENIRUNLX0JVRkZFUiAoYnVm KTsKKyAgICAgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSIChidWYpOworICAgICAgYm9vbCBy ZWdpb25fYWN0aXZlX3AgPSAoIU5JTFAgKFZ0cmFuc2llbnRfbWFya19tb2RlKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIG1hcmtfYWN0aXZlKSkpOwor ICAgICAgcHRyZGlmZl90IHJlZ2lvbl9iZWdpbm5pbmcgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IFhG SVhOVU0gKEZyZWdpb25fYmVnaW5uaW5nICgpKSA6IC0xOworICAgICAgcHRyZGlmZl90IHJlZ2lv bl9lbmQgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IFhGSVhOVU0gKEZyZWdpb25fZW5kICgpKSA6IC0x OworICAgICAgYm9vbCByZWdpb25faW5fYm91bmRzX3AgPSAocmVnaW9uX2FjdGl2ZV9wCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5tYy5wb3NpbnQgPj0gcmVnaW9uX2Jl Z2lubmluZworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWMucG9zaW50 IDwgcmVnaW9uX2VuZCk7CisgICAgICBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgJiYg cmVnaW9uX2luX2JvdW5kc19wCisgICAgICAgICAgJiYgYWN0aXZlX3ApCiAgICAgICAgIHsKLSAg ICAgICAgICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoZmFj ZSksIGYpIHNldF07Ci0gICAgICAgICAgaG9sbG93X2NvbG9yID0gRlJBTUVfQ1VSU09SX0NPTE9S IChmKTsKKyAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9yZWdpb25fZmFjZV9p ZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZ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ZSk7CisgICAgICAgICAg ICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19pbmFjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChm LCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgTlNDb2xvciAqaG9s bG93X2luYWN0aXZlX2NvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfQkFD S0dST1VORCAoaG9sbG93X2luYWN0aXZlX2ZhY2UpLCBmKTsKKyAgICAgICAgICAgICAgICBob2xs b3dfY29sb3IgPSBob2xsb3dfaW5hY3RpdmVfY29sb3I7CisgICAgICAgICAgICAgIH0KKyAgICAg ICAgICAgICAgZWxzZSBpZiAoZmFjZSAmJiBOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpID09IG5z X2luZGV4X2NvbG9yIChGUkFNRV9DVVJTT1JfQ09MT1IgKGYpLCBmKSkKKyAgICAgICAgICAgICAg ICBob2xsb3dfY29sb3IgPSBGUkFNRV9DVVJTT1JfQ09MT1IgKGYpOworICAgICAgICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZh Y2UgKmRlZmF1bHRfYmdfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgREVGQVVMVF9GQUNFX0lEKTsK KyAgICAgICAgICAgICAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0JB Q0tHUk9VTkQgKGRlZmF1bHRfYmdfZmFjZSksIGYpIHNldF07CisgICAgICAgICAgICAgICAgICAg IGhvbGxvd19jb2xvciA9IEZSQU1FX0NVUlNPUl9DT0xPUiAoZik7CisgICAgICAgICAgICAgICAg ICB9CisgICAgfQorICAgIGVsc2UgaWYgKGZhY2UgJiYgTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNl KSA9PSBuc19pbmRleF9jb2xvciAoRlJBTUVfQ1VSU09SX0NPTE9SIChmKSwgZikpCisgICAgICB7 CisgICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChm YWNlKSwgZikgc2V0XTsKKyAgICAgICAgaG9sbG93X2NvbG9yID0gRlJBTUVfQ1VSU09SX0NPTE9S IChmKTsKKyAgICAgIH0KICAgICAgIGVsc2UKICAgICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAo Zikgc2V0XTsKIAorLyogZW5kIE1VTFRJUExFIENVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworCisKICAgICAgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCiAgICAgICAgIHsKICAgICAg ICAgY2FzZSBERUZBVUxUX0NVUlNPUjoKQEAgLTMyNDYsMjAgKzMzNjMsNDggQEAgTm90ZSB0aGF0 IENVUlNPUl9XSURUSCBpcyBtZWFuaW5nZnVsIG9ubHkgZm9yIChoKWJhciBjdXJzb3JzLgogICAg ICAgICAgIGJyZWFrOwogICAgICAgICBjYXNlIEJBUl9DVVJTT1I6CiAgICAgICAgICAgcyA9IHI7 Ci0gICAgICAgICAgLyogSWYgdGhlIGNoYXJhY3RlciB1bmRlciBjdXJzb3IgaXMgUjJMLCBkcmF3 IHRoZSBiYXIgY3Vyc29yCi0gICAgICAgICAgICAgb24gdGhlIHJpZ2h0IG9mIGl0cyBnbHlwaCwg cmF0aGVyIHRoYW4gb24gdGhlIGxlZnQuICAqLwotICAgICAgICAgIGN1cnNvcl9nbHlwaCA9IGdl dF9waHlzX2N1cnNvcl9nbHlwaCAodyk7Ci0gICAgICAgICAgaWYgKChjdXJzb3JfZ2x5cGgtPnJl c29sdmVkX2xldmVsICYgMSkgIT0gMCkKLSAgICAgICAgICAgIHMub3JpZ2luLnggKz0gY3Vyc29y X2dseXBoLT5waXhlbF93aWR0aCAtIHMuc2l6ZS53aWR0aDsKKworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworICAgIC8qIEBsYXdsaXN0IGlzIGZv Y3VzaW5nIHRoZSBpbml0aWFsIGRldmVsb3BtZW50IG9mIGZlYXR1cmUgcmVxdWVzdHMgIzE3Njg0 CisgICAgYW5kICMyMjg3MyBvbiBMMlIgbGFuZ3VhZ2VzLiAqLworICAgIGlmICh3LT5tYy5nbHlw aF9mbGF2b3IgIT0gTUNfR0xZUEgKKyAgICAgICAgJiYgdy0+bWMuZ2x5cGhfZmxhdm9yICE9IE1D X0dMWVBITEVTUworICAgICAgICAmJiB3LT5tYy5nbHlwaF9mbGF2b3IgIT0gTUNfR0xZUEhfVEFC KQorICAgICAgeworICAgICAgLyogSWYgdGhlIGNoYXJhY3RlciB1bmRlciBjdXJzb3IgaXMgUjJM LCBkcmF3IHRoZSBiYXIgY3Vyc29yCisgICAgICAgICBvbiB0aGUgcmlnaHQgb2YgaXRzIGdseXBo LCByYXRoZXIgdGhhbiBvbiB0aGUgbGVmdC4gICovCisgICAgICBjdXJzb3JfZ2x5cGggPSBnZXRf cGh5c19jdXJzb3JfZ2x5cGggKHcpOworICAgICAgaWYgKChjdXJzb3JfZ2x5cGgtPnJlc29sdmVk X2xldmVsICYgMSkgIT0gMCkKKyAgICAgICAgcy5vcmlnaW4ueCArPSBjdXJzb3JfZ2x5cGgtPnBp eGVsX3dpZHRoIC0gcy5zaXplLndpZHRoOworICAgICAgfQorCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKwogCiAgICAgICAgICAgTlNSZWN0RmlsbCAocyk7CiAgICAgICAgICAgYnJlYWs7CiAg ICAgICAgIH0KICAgICAgIG5zX3Jlc2V0X2NsaXBwaW5nIChmKTsKIAotICAgICAgLyogZHJhdyB0 aGUgY2hhcmFjdGVyIHVuZGVyIHRoZSBjdXJzb3IgKi8KLSAgICAgIGlmIChjdXJzb3JfdHlwZSAh PSBOT19DVVJTT1IpCi0gICAgICAgIGRyYXdfcGh5c19jdXJzb3JfZ2x5cGggKHcsIGdseXBoX3Jv dywgRFJBV19DVVJTT1IpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExF IENVUlNPUlMgKi8KKworICAvKiBkcmF3IHRoZSBjaGFyYWN0ZXIgdW5kZXIgdGhlIGN1cnNvciAq LworICBpZiAoY3Vyc29yX3R5cGUgIT0gTk9fQ1VSU09SCisgICAgICAmJiB3LT5tYy5nbHlwaF9m bGF2b3IgIT0gTUNfR0xZUEhMRVNTCisgICAgICAmJiB3LT5tYy5nbHlwaF9mbGF2b3IgIT0gTUNf R0xZUEhfVEFCKQorICAgIGRyYXdfcGh5c19jdXJzb3JfZ2x5cGggKHcsIGdseXBoX3JvdywgRFJB V19DVVJTT1IpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCisjaWZkZWYgTlNfSU1Q TF9DT0NPQQorICAgICAgTlNFbmFibGVTY3JlZW5VcGRhdGVzICgpOworI2VuZGlmCiAgICAgfQog fQogCkBAIC0zOTI2LDcgKzQwNzEsMjcgQEAgRnVuY3Rpb24gbW9kZWxlZCBhZnRlciB4X2RyYXdf Z2x5cGhfc3RyaW5nX2JveCAoKS4KICAgICB7CiAgICAgICBpbnQgdGhpY2tuZXNzID0gYWJzIChz LT5pbWctPnJlbGllZik7CiAgICAgICBpZiAodGhpY2tuZXNzID09IDApIHRoaWNrbmVzcyA9IDE7 Ci0gICAgICBuc19kcmF3X2JveCAoYnIsIHRoaWNrbmVzcywgRlJBTUVfQ1VSU09SX0NPTE9SIChz LT5mKSwgMSwgMSk7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBD VVJTT1JTICovCisKKyAgICBpZiAocy0+dy0+bWMuZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBICisg ICAgICAgIHx8IHMtPnctPm1jLmdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSExFU1MKKyAgICAgICAg fHwgcy0+dy0+bWMuZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBIX1RBQikKKyAgICAgIHsKKyAgICAg ICAgTlNDb2xvciAqYm9yZGVyX2NvbG9yID0gW05TQ29sb3IgY29sb3JXaXRoQ2FsaWJyYXRlZFJl ZDogcy0+dy0+bWMucmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgZ3JlZW46IHMtPnctPm1jLmdyZWVuCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJsdWU6IHMtPnctPm1j LmJsdWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBhbHBoYTogMS4wXTsKKyAgICAgICAgbnNfZHJhd19ib3ggKGJyLCB0aGlja25lc3Ms IGJvcmRlcl9jb2xvciwgMSwgMSk7CisgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIG5zX2Ry YXdfYm94IChiciwgdGhpY2tuZXNzLCBGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpLCAxLCAxKTsK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgIH0KIH0KIApkaWZmIC0tZ2l0IGEv c3JjL3czMnRlcm0uYyBiL3NyYy93MzJ0ZXJtLmMKaW5kZXggOGQxODlhZS4uZTdmYjhhMyAxMDA2 NDQKLS0tIGEvc3JjL3czMnRlcm0uYworKysgYi9zcmMvdzMydGVybS5jCkBAIC01NDUsNiArNTQ1 LDE1IEBAIHhfdXBkYXRlX2JlZ2luIChzdHJ1Y3QgZnJhbWUgKmYpCiAgIGlmICghIEZSQU1FX1cz Ml9QIChmKSkKICAgICByZXR1cm47CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBN VUxUSVBMRSBDVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBmOworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIFJlZ2VuZXJhdGUgZGlzcGxheSBwYWxldHRl IGJlZm9yZSBkcmF3aW5nIGlmIGxpc3Qgb2YgcmVxdWVzdGVkCiAgICAgIGNvbG9ycyBoYXMgY2hh bmdlZC4gKi8KICAgaWYgKGRpc3BsYXlfaW5mby0+cmVnZW5fcGFsZXR0ZSkKQEAgLTc1NCw2ICs3 NjMsMTYgQEAgeF91cGRhdGVfZW5kIChzdHJ1Y3QgZnJhbWUgKmYpCiAKICAgLyogTW91c2UgaGln aGxpZ2h0IG1heSBiZSBkaXNwbGF5ZWQgYWdhaW4uICAqLwogICBNT1VTRV9ITF9JTkZPIChmKS0+ bW91c2VfZmFjZV9kZWZlciA9IGZhbHNlOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gTlVMTDsK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAKQEAgLTk3Myw2ICs5OTIsMjAg QEAgc3RhdGljIHZvaWQgdzMyX2RyYXdfYm94X3JlY3QgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKiwg aW50LCBpbnQsIGludCwgaW50LAogc3RhdGljIHZvaWQKIHhfc2V0X2N1cnNvcl9nYyAoc3RydWN0 IGdseXBoX3N0cmluZyAqcykKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1V TFRJUExFIENVUlNPUlMgKi8KKworICBpZiAocy0+dy0+bWMuY3Vyc29yX2djX2RlZmF1bHQpCisg ICAgeworICAgICAgcy0+Z2MgPSBzLT5mLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYzsKKyAg ICAgIHJldHVybjsKKyAgICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgaWYg KHMtPmZvbnQgPT0gRlJBTUVfRk9OVCAocy0+ZikKICAgICAgICYmIHMtPmZhY2UtPmJhY2tncm91 bmQgPT0gRlJBTUVfQkFDS0dST1VORF9QSVhFTCAocy0+ZikKICAgICAgICYmIHMtPmZhY2UtPmZv cmVncm91bmQgPT0gRlJBTUVfRk9SRUdST1VORF9QSVhFTCAocy0+ZikKQEAgLTU2OTAsNiArNTcy MywyNiBAQCB4X2RyYXdfaG9sbG93X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGds eXBoX3JvdyAqcm93KQogCiAgIC8qIENvbXB1dGUgZnJhbWUtcmVsYXRpdmUgY29vcmRpbmF0ZXMg Zm9yIHBoeXMgY3Vyc29yLiAgKi8KICAgZ2V0X3BoeXNfY3Vyc29yX2dlb21ldHJ5ICh3LCByb3cs IGN1cnNvcl9nbHlwaCwgJmxlZnQsICZ0b3AsICZoKTsKKworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworLyogTEVHRU5EOgorCistICB0b3AgeSA9 PSBXSU5ET1dfVE9fRlJBTUVfUElYRUxfWSAodywgcm93LT55KQorCistICBib3R0b20geSA9PSBX SU5ET1dfVE9fRlJBTUVfUElYRUxfWSAodywgcm93LT55KSAtIHJvdy0+aGVpZ2h0CisKKy0gIGgg b2YgSE9MTE9XX0JPWF9DVVJTT1IgPT0gcm93LT5oZWlnaHQKKyAgIFtUaGlzIGF2b2lkcyBhIHZp c2libGUgZ2FwIGFib3ZlL2JlbG93Ll0gKi8KKworICBpZiAody0+bWMuaCA+IDApCisgICAgaCA9 IHJvdy0+aGVpZ2h0OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIHJlY3QubGVm dCA9IGxlZnQ7CiAgIC8qIFdoZW4gb24gUjJMIGNoYXJhY3Rlciwgc2hvdyBjdXJzb3IgYXQgdGhl IHJpZ2h0IGVkZ2Ugb2YgdGhlCiAgICAgIGdseXBoLCB1bmxlc3MgdGhlIGN1cnNvciBib3ggaXMg YXMgd2lkZSBhcyB0aGUgZ2x5cGggb3Igd2lkZXIKQEAgLTU3NTMsNyArNTgwNiwxNyBAQCB4X2Ry YXdfYmFyX2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqcm93LAog CSBpbnZpc2libGUuICBVc2UgdGhlIGdseXBoJ3MgZm9yZWdyb3VuZCBjb2xvciBpbnN0ZWFkIGlu IHRoaXMKIAkgY2FzZSwgb24gdGhlIGFzc3VtcHRpb24gdGhhdCB0aGUgZ2x5cGgncyBjb2xvcnMg YXJlIGNob3NlbiBzbwogCSB0aGF0IHRoZSBnbHlwaCBpcyBsZWdpYmxlLiAgKi8KLSAgICAgIGlm IChmYWNlLT5iYWNrZ3JvdW5kID09IGN1cnNvcl9jb2xvcikKKworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworICAgICAgaWYgKGZhY2UtPmJhY2tn cm91bmQgPT0gY3Vyc29yX2NvbG9yCisgICAgICAgICAgJiYgIXctPm1jLmN1cnNvcl9nY19pbnZp c2libGVfb2theSkKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCWN1cnNvcl9jb2xv ciA9IGZhY2UtPmZvcmVncm91bmQ7CiAKICAgICAgIHggPSBXSU5ET1dfVEVYVF9UT19GUkFNRV9Q SVhFTF9YICh3LCB3LT5waHlzX2N1cnNvci54KTsKQEAgLTU3NzQsNiArNTgzNywxNyBAQCB4X2Ry YXdfYmFyX2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqcm93LAog CSAgaWYgKChjdXJzb3JfZ2x5cGgtPnJlc29sdmVkX2xldmVsICYgMSkgIT0gMCkKIAkgICAgeCAr PSBjdXJzb3JfZ2x5cGgtPnBpeGVsX3dpZHRoIC0gd2lkdGg7CiAKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgICAvKiBBbGlnbiBhbGwgZmFr ZSBCQVJfQ1VSU09SIG9mIHRoZSBWRVJUSUNBTF9SVUxFUiB3aXRoIGBvcG9pbnRfeCcuICovCisg ICAgaWYgKHctPm1jLmZ4ID4gMCkKKyAgICAgIHggPSB3LT5tYy5meDsKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisKKwogCSAgdzMyX2ZpbGxfYXJlYSAoZiwgaGRjLCBjdXJzb3JfY29sb3Is IHgsCiAJCQkgV0lORE9XX1RPX0ZSQU1FX1BJWEVMX1kgKHcsIHctPnBoeXNfY3Vyc29yLnkpLAog CQkJIHdpZHRoLCByb3ctPmhlaWdodCk7CkBAIC01ODk1LDMxICs1OTY5LDE2OSBAQCB3MzJfZHJh d193aW5kb3dfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpnbHlw aF9yb3csCiAJICByZXR1cm47CiAJfQogCi0gICAgICBzd2l0Y2ggKGN1cnNvcl90eXBlKQotCXsK LQljYXNlIEhPTExPV19CT1hfQ1VSU09SOgotCSAgeF9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIGds eXBoX3Jvdyk7Ci0JICBicmVhazsKIAotCWNhc2UgRklMTEVEX0JPWF9DVVJTT1I6Ci0JICBkcmF3 X3BoeXNfY3Vyc29yX2dseXBoICh3LCBnbHlwaF9yb3csIERSQVdfQ1VSU09SKTsKLQkgIGJyZWFr OworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRSBDVVJTT1JTICov CiAKLQljYXNlIEJBUl9DVVJTT1I6Ci0JICB4X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cGhfcm93 LCBjdXJzb3Jfd2lkdGgsIEJBUl9DVVJTT1IpOwotCSAgYnJlYWs7CisgIHN0cnVjdCBmcmFtZSAq ZiA9IFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3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AgICAgICAgICAgICAgICAgICYmIHctPm1jLnBvc2ludCA+PSBy ZWdpb25fYmVnaW5uaW5nCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg dy0+bWMucG9zaW50IDwgcmVnaW9uX2VuZCk7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlq YWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycgYnkgYm9ycm93aW5nIHRoZQorICAg ICAgICAgIGZ1bmN0aW9uYWxpdHkgb2YgYHhfbWFrZV9nYycgaW4gdzMyZm5zLmMuICAqLworICAg ICAgICAgIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgJiYgcmVnaW9uX2luX2Jv dW5kc19wCisgICAgICAgICAgICAgICYmIGFjdGl2ZV9wKQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9yZWdpb25fZmFjZV9pZCA9IGxvb2t1 cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItcmVnaW9uLWZh Y2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX3Jl Z2lvbl9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9mYWNlX2lk KTsKKyAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBkZWZhdWx0X2ZhY2UtPmZv cmVncm91bmQ7CisgICAgICAgICAgICAgIGdjX3ZhbHVlcy5iYWNrZ3JvdW5kID0gaG9sbG93X2Fj dGl2ZV9yZWdpb25fZmFjZS0+YmFja2dyb3VuZDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAg IGVsc2UgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgJiYgIXJlZ2lv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mYWNlLT5mb3JlZ3JvdW5kOworICAgICAgICAg ICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmJhY2tn cm91bmQ7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIC8qIFRoZSByZWdpb24g aXMgX25vdF8gdmlzaWJsZSBpbiB0aGUgaW5hY3RpdmUgd2luZG93IGJlY2F1c2UgdGhlIG92ZXJs YXkgd2luZG93IHByb3BlcnR5IGlzIHVzZWQuICovCisgICAgICAgICAgICAgICAgZWxzZSBpZiAo IWFjdGl2ZV9wKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBlbnVt IGZhY2VfaWQgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywg ZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLWZhY2UiKSwgdHJ1ZSk7Cisg ICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9IEZB Q0VfRlJPTV9JRCAoZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAg ICAgICBnY192YWx1ZXMuZm9yZWdyb3VuZCA9IGRlZmF1bHRfZmFjZS0+Zm9yZWdyb3VuZDsKKyAg ICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfaW5hY3RpdmVf ZmFjZS0+YmFja2dyb3VuZDsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICBmLT5vdXRw dXRfZGF0YS53MzItPmN1cnNvcl9nYyA9IFhDcmVhdGVHQyAoTlVMTCwgRlJBTUVfVzMyX1dJTkRP VyAoZiksIG1hc2ssICZnY192YWx1ZXMpOworICAgICAgICAgIGJsb2NrX2lucHV0ICgpOworICAg ICAgICAgIC8qIEZvcmNlIG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1cnNv cl9nY19pbnZpc2libGVfb2theSA9IGZhbHNlOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLncz Mi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAg ICAgIGVsc2UKKyAgICAgICAgICB4X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cGhfcm93LCBjdXJz b3Jfd2lkdGgsIEJBUl9DVVJTT1IpOworICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgSEJB Ul9DVVJTT1I6CisgICAgeworICAgICAgaWYgKHctPm1jLnJlZCA+PSAwICYmIHctPm1jLmJsdWUg Pj0gMCAmJiB3LT5tYy5ncmVlbiA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9y YXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcuICAqLworICAg ICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gY29sb3JfcGl4ZWw7Cisg ICAgICAgICAgdy0+bWMuY3Vyc29yX2djX2ludmlzaWJsZV9va2F5ID0gdHJ1ZTsKKyAgICAgICAg ICB4X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEhCQVJfQ1VS U09SKTsKKyAgICAgICAgICB3LT5tYy5jdXJzb3JfZ2NfaW52aXNpYmxlX29rYXkgPSBmYWxzZTsK KyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1 cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeF9kcmF3X2Jh cl9jdXJzb3IgKHcsIGdseXBoX3JvdywgY3Vyc29yX3dpZHRoLCBIQkFSX0NVUlNPUik7CisgICAg ICBicmVhazsKKyAgICB9CisgICAgY2FzZSBOT19DVVJTT1I6CisgICAgICB3LT5waHlzX2N1cnNv cl93aWR0aCA9IDA7CisgICAgICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJv cnQgKCk7CisgIH0KIAotCWNhc2UgSEJBUl9DVVJTT1I6Ci0JICB4X2RyYXdfYmFyX2N1cnNvciAo dywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEhCQVJfQ1VSU09SKTsKLQkgIGJyZWFrOworLyog ZW5kIE1VTFRJUExFIENVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwogCi0JY2Fz ZSBOT19DVVJTT1I6Ci0JICB3LT5waHlzX2N1cnNvcl93aWR0aCA9IDA7Ci0JICBicmVhazsKIAot CWRlZmF1bHQ6Ci0JICBlbWFjc19hYm9ydCAoKTsKLQl9CiAgICAgfQogfQogCmRpZmYgLS1naXQg YS9zcmMvd2luZG93LmggYi9zcmMvd2luZG93LmgKaW5kZXggY2MwYjZiNi4uNDBmOGE4NSAxMDA2 NDQKLS0tIGEvc3JjL3dpbmRvdy5oCisrKyBiL3NyYy93aW5kb3cuaApAQCAtNzYsNiArNzYsNjIg QEAgb25lIGFuZCB0aGUgc2FtZSwgc28gaXRzIHByZXYgYW5kIG5leHQgbWVtYmVycyBhcmUgbmls LgogCiBBIGRlYWQgd2luZG93IGhhcyBpdHMgY29udGVudHMgZmllbGQgc2V0IHRvIG5pbC4gICov CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRSBDVVJTT1JT ICovCisKKy8qIFN1ZmZpeGVzIGZvciB0aGUgYG1jYCB3aW5kb3cgcG9pbnRlciBwcmVmaXguICov CitzdHJ1Y3QgbXVsdGlwbGVfY3Vyc29ycworeworICAvKiBWYWx1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KiBlbmQgTVVMVElQTEUgQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogc3RydWN0IGN1cnNvcl9wb3MKIHsKICAgLyogUGl4ZWwgcG9zaXRpb24uICBU aGVzZSBhcmUgYWx3YXlzIHdpbmRvdyByZWxhdGl2ZS4gICovCkBAIC0xODEsNiArMjM3LDI4IEBA IHN0cnVjdCB3aW5kb3cKICAgICAvKiBUaGUgaGVscCBlY2hvIHRleHQgZm9yIHRoaXMgd2luZG93 LiAgUW5pbCBpZiB0aGVyZSdzIG5vbmUuICAqLwogICAgIExpc3BfT2JqZWN0IG1vZGVfbGluZV9o ZWxwX2VjaG87CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJT T1JTICovCisKKyAgICAvKiBUaGUgY2FjaGUgZm9yIG11bHRpcGxlIGdseXBoIGN1cnNvcnMuICBG b3IgYW4gZXhhbXBsZSBvZiB0aGUgc3RydWN0dXJlIG9mCisgICAgdGhlIGxpc3QsIHNlZSB0aGUg Y29tbWVudHMgYXQgdGhlIGJlZ2lubmluZyBvZiBgbWNfZHJhd19tdWx0aXBsZV9jdXJzb3JzJyBp bgorICAgIHhkaXNwLmMuICAqLworICAgIExpc3BfT2JqZWN0IG11bHRpcGxlX2N1cnNvcnNfY2Fj aGU7CisKKyAgICAvKiBUaGUgY2FjaGUgZm9yIG11bHRpcGxlIGdseXBoL2dseXBobGVzcyBjdXJz b3JzIHRoYXQgZm9ybSBjcm9zc2hhaXJzLiAgRm9yIGFuCisgICAgZXhhbXBsZSBvZiB0aGUgc3Ry dWN0dXJlIG9mIHRoZSBsaXN0LCBzZWUgdGhlIGNvbW1lbnRzIGF0IHRoZSBiZWdpbm5pbmcgb2YK KyAgICBgbWNfZHJhd19tdWx0aXBsZV9jdXJzb3JzJyBpbiB4ZGlzcC5jLiAgKi8KKyAgICBMaXNw X09iamVjdCBjcm9zc2hhaXJzX2NhY2hlOworCisgICAgLyogVGhlIGNhY2hlIGZvciBtdWx0aXBs ZSBnbHlwaC9nbHlwaGxlc3MgY3Vyc29ycyB0aGF0IGZvcm0gdGhlIHZpc2libGUgZmlsbAorICAg IGNvbHVtbi4gIEZvciBhbiBleGFtcGxlIG9mIHRoZSBzdHJ1Y3R1cmUgb2YgdGhlIGxpc3QsIHNl ZSB0aGUgY29tbWVudHMgYXQgdGhlCisgICAgYmVnaW5uaW5nIG9mIGBtY19kcmF3X211bHRpcGxl X2N1cnNvcnMnIGluIHhkaXNwLmMuICAqLworICAgIExpc3BfT2JqZWN0IG1jX2ZpbGxfY29sdW1u X2NhY2hlOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgLyogTm8gTGlzcCBk YXRhIG1heSBmb2xsb3cgYmVsb3cgdGhpcyBwb2ludCB3aXRob3V0IGNoYW5naW5nCiAgICAgICAg bWFya19vYmplY3QgaW4gYWxsb2MuYy4gIFRoZSBtZW1iZXIgY3VycmVudF9tYXRyaXggbXVzdCBi ZSB0aGUKICAgICAgICBmaXJzdCBub24tTGlzcCBtZW1iZXIuICAqLwpAQCAtMjgzLDYgKzM2MSwx NiBAQCBzdHJ1Y3Qgd2luZG93CiAKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KIAorCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworICAgIC8qIFRo ZSBwcmVmaXggZm9yIHdpbmRvdyBwb2ludGVycyByZWxhdGluZyB0byBtdWx0aXBsZSBjdXJzb3Jz LiAgKi8KKyAgICBzdHJ1Y3QgbXVsdGlwbGVfY3Vyc29ycyBtYzsKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogICAgIC8qIEN1cnNvciB0eXBlIG9mIGxhc3QgY3Vyc29yIGRyYXduIG9u IHRoZSB3aW5kb3cuICAqLwogICAgIGVudW0gdGV4dF9jdXJzb3Jfa2luZHMgcGh5c19jdXJzb3Jf dHlwZTsKIApAQCAtNDIxLDYgKzUwOSwzMSBAQCBYV0lORE9XIChMaXNwX09iamVjdCBhKQogICBy ZXR1cm4gWFVOVEFHIChhLCBMaXNwX1ZlY3Rvcmxpa2UsIHN0cnVjdCB3aW5kb3cpOwogfQogCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCitJTkxJ TkUgdm9pZAord3NldF9tdWx0aXBsZV9jdXJzb3JzX2NhY2hlIChzdHJ1Y3Qgd2luZG93ICp3LCBM aXNwX09iamVjdCB2YWwpCit7CisgIHctPm11bHRpcGxlX2N1cnNvcnNfY2FjaGUgPSB2YWw7Cit9 CisKK0lOTElORSB2b2lkCit3c2V0X2Nyb3NzaGFpcnNfY2FjaGUgKHN0cnVjdCB3aW5kb3cgKncs IExpc3BfT2JqZWN0IHZhbCkKK3sKKyAgdy0+Y3Jvc3NoYWlyc19jYWNoZSA9IHZhbDsKK30KKwor SU5MSU5FIHZvaWQKK3dzZXRfbWNfZmlsbF9jb2x1bW5fY2FjaGUgKHN0cnVjdCB3aW5kb3cgKncs IExpc3BfT2JqZWN0IHZhbCkKK3sKKyAgdy0+bWNfZmlsbF9jb2x1bW5fY2FjaGUgPSB2YWw7Cit9 CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC8qIE1vc3QgY29kZSBzaG91bGQgdXNl IHRoZXNlIGZ1bmN0aW9ucyB0byBzZXQgTGlzcCBmaWVsZHMgaW4gc3RydWN0CiAgICB3aW5kb3cu ICAqLwogSU5MSU5FIHZvaWQKZGlmZiAtLWdpdCBhL3NyYy94ZGlzcC5jIGIvc3JjL3hkaXNwLmMK aW5kZXggZmE3NjkxYy4uMGQ1NDFhYSAxMDA2NDQKLS0tIGEvc3JjL3hkaXNwLmMKKysrIGIvc3Jj L3hkaXNwLmMKQEAgLTgzMCw3ICs4MzAsMTYgQEAgc3RhdGljIGludG1heF90IG1lc3NhZ2VfbG9n X2NoZWNrX2R1cGxpY2F0ZSAocHRyZGlmZl90LCBwdHJkaWZmX3QpOwogc3RhdGljIHZvaWQgcHVz aF9pdCAoc3RydWN0IGl0ICosIHN0cnVjdCB0ZXh0X3BvcyAqKTsKIHN0YXRpYyB2b2lkIGl0ZXJh dGVfb3V0X29mX2Rpc3BsYXlfcHJvcGVydHkgKHN0cnVjdCBpdCAqKTsKIHN0YXRpYyB2b2lkIHBv cF9pdCAoc3RydWN0IGl0ICopOwotc3RhdGljIHZvaWQgcmVkaXNwbGF5X2ludGVybmFsICh2b2lk KTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8K Kworc3RhdGljIHZvaWQgcmVkaXNwbGF5X2ludGVybmFsIChpbnQpOworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKworCiBzdGF0aWMgdm9pZCBlY2hvX2FyZWFfZGlzcGxheSAoYm9vbCk7CiBz dGF0aWMgdm9pZCBibG9ja19idWZmZXJfZmxpcHMgKHZvaWQpOwogc3RhdGljIHZvaWQgdW5ibG9j a19idWZmZXJfZmxpcHMgKHZvaWQpOwpAQCAtOTIxLDYgKzkzMCw1MTE3IEBAIHN0YXRpYyB2b2lk IHNob3dfbW91c2VfZmFjZSAoTW91c2VfSExJbmZvICosIGVudW0gZHJhd19nbHlwaHNfZmFjZSk7 CiBzdGF0aWMgYm9vbCBjb29yZHNfaW5fbW91c2VfZmFjZV9wIChzdHJ1Y3Qgd2luZG93ICosIGlu dCwgaW50KTsKIAogCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExF IENVUlNPUlMgKi8KKworLyogTVVMVElQTEUgQ1VSU09SUzogIEVtYWNzIEJ1ZyAjMjI4NzMgKGZl YXR1cmUgcmVxdWVzdCkKKworICAgQ1JPU1NIQUlSUzogIEVtYWNzIEJ1ZyAjMTc2ODQgKGZlYXR1 cmUgcmVxdWVzdCkKKworCitQQVRDSCBWRVJTSU9OOiAgMDE0LjAwMCBbMDgvMjgvMjAxOF0KKyAg ICAgICAgICAgICAgICAwMTQuMDAxIFswOS8wMS8yMDE4XQorICAgICAgICAgICAgICAgIDAxNC4w MDIgWzA5LzAyLzIwMThdCisgICAgICAgICAgICAgICAgMDE0LjAwMyBbMDkvMDUvMjAxOF0KKyAg ICAgICAgICAgICAgICAwMTQuMDA0IFswOS8wOC8yMDE4XQorICAgICAgICAgICAgICAgIDAxNC4w MDUgWzA5LzA5LzIwMThdCisgICAgICAgICAgICAgICAgMDE0LjAwNiBbMDkvMDkvMjAxOF0KKyAg ICAgICAgICAgICAgICAwMTQuMDA3IFswOS8xMC8yMDE4XQorICAgICAgICAgICAgICAgIDAxNC4w MDggWzA5LzEwLzIwMThdCisgICAgICAgICAgICAgICAgMDE0LjAwOSBbMDkvMTEvMjAxOF0KKyAg ICAgICAgICAgICAgICAwMTQuMDEwIFswOS8xMy8yMDE4XQorICAgICAgICAgICAgICAgIDAxNC4w MTEgWzA5LzE0LzIwMThdCisgICAgICAgICAgICAgICAgMDE0LjAxMiBbMDkvMTcvMjAxOF0KKyAg ICAgICAgICAgICAgICAwMTQuMDEzIFswOS8xOC8yMDE4XQorICAgICAgICAgICAgICAgIDAxNC4w MTQgWzA5LzE5LzIwMThdCisgICAgICAgICAgICAgICAgMDE0LjAxNSBbMDkvMjMvMjAxOF0KKyAg ICAgICAgICAgICAgICAwMTQuMDE2IFswOS8yNC8yMDE4XQorICAgICAgICAgICAgICAgIDAxNC4w MTcgWzA5LzI1LzIwMThdCisgICAgICAgICAgICAgICAgMDE0LjAxOCBbMDkvMjYvMjAxOF0KKyAg ICAgICAgICAgICAgICAwMTQuMDE5IFsxMC8wMS8yMDE4XQorICAgICAgICAgICAgICAgIDAxNC4w MjAgWzEwLzAyLzIwMThdCisgICAgICAgICAgICAgICAgMDE0LjAyMSBbMTAvMDkvMjAxOF0KKyAg ICAgICAgICAgICAgICAwMTQuMDIyIFsxMC8xMC8yMDE4XQorICAgICAgICAgICAgICAgIDAxNC4w MjMgWzEwLzEwLzIwMThdCisgICAgICAgICAgICAgICAgMDE0LjAyNCBbMTAvMTMvMjAxOF0KKyAg ICAgICAgICAgICAgICAwMTQuMDI1IFsxMS8xMC8yMDE4XQorICAgICAgICAgICAgICAgIDAxNS4w MDAgWzExLzEwLzIwMThdCisgICAgICAgICAgICAgICAgMDE1LjAwMSBbMTEvMTEvMjAxOF0KKyAg ICAgICAgICAgICAgICAwMTYuMDAwIFsxMS8yMC8yMDE4XQorCitBcHBseSBwYXRjaCB0byBtYXN0 ZXIgYnJhbmNoOiAgU2F0IEp1bCA3IDA5OjU5OjUzIDIwMTggLTA3MDAKK2dpdCByZXNldCAtLWhh cmQgOTg0NjNiZWQwN2VjYzkwNTcwOTQ5MjhmZmRjMjMyMWVhYWYzYWI1MgorCitMYXN0IENvbW1p dCA6IFNhdCBKdWwgNyAwOTo1OTo1MyAyMDE4IC0wNzAwCisgIC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ogIE0teCBtYy1m aWxsLWNvbHVtbi1tb2RlCisKKy0gIFRvIGxlYXJuIGhvdyB0byB1c2UgdGhlIG11bHRpcGxlIGZh a2UgY3Vyc29ycyBmZWF0dXJlLCBleGFtaW5lIHRoZQorICAgaW50ZXJhY3RpdmUgZnVuY3Rpb24g YG1jLXRlc3QnLgorCisKK0VYQU1QTEUgT0YgVVNJTkcgTVVMVElQTEUgRkFLRSBDVVJTT1JTOgor CisgIDs7OyAnKEJVRkZFUi1QT1NJVElPTiBDVVJTT1ItVFlQRSBDVVJTT1ItQ09MT1IpCisgIDs7 OworICAoc2V0cSBtdWx0aXBsZS1jdXJzb3JzLWNvbmYgJygoMSAiaGJhciIgIm1hZ2VudGEiKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMiAiYmFyIiAicHVycGxlIikKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKDMgImJveCIgIiMwMEZGMDAiKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAoNCAiaG9sbG93IiAiIzAwMDBGRiIpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICg1ICgiaGJhciIgMykgWzEuMCAwLjAgMS4wXSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKDYgKCJiYXIiIDMpIFswLjAgMS4wIDEuMF0pKSkK KworICA7OzsgVFVSTiBPRkYuCisgIDs7OworICAoc2V0cSBtdWx0aXBsZS1jdXJzb3JzLWNvbmYg bmlsKQorCisKK0NIQU5HRUxPRzoKKworLSAgVGhlIGFyZWEgb2YgY29kZSB0aGF0IHByZXZlbnRl ZCBjcm9zc2hhaXJzIGFuZCBvdGhlciBmYWtlIGN1cnNvcnMgZnJvbQorICAgd29ya2luZyBvbiBN YWNPUyBNb2phdmUgaGFzIGJlZW4gZml4ZWQuCisKKy0gIE5ldyBGZWF0dXJlOiAgVGhpcyBpcyB0 aGUgZmlyc3QgaW1wbGVtZW50YXRpb24gb2YgYSB2aXNpY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JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgfHwgIU5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfZmlsbF9jb2x1bW4pKSkpCisgICAg eworICAgICAgTGlzcF9PYmplY3Qgd2luZG93OworICAgICAgWFNFVFdJTkRPVyAod2luZG93LCB3 KTsKKyAgICAgIExpc3BfT2JqZWN0IHdpbmRvd19zdHJpbmcgPSBGcHJpbjFfdG9fc3RyaW5nICh3 aW5kb3csIFFuaWwpOworICAgICAgY2hhciAqd2luZG93X2NoYXIgPSBTU0RBVEEgKHdpbmRvd19z dHJpbmcpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiXG53aW5kb3cgKCVzKVxuIiwgd2luZG93 X2NoYXIpOworICAgIH0KKyNlbmRpZgorCisjaWZkZWYgR0xZUEhfREVCVUcKKyAgc3RydWN0IGZy YW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIGludCB0ZW1wX2Z4ID0gV0lORE9XX1RFWFRf VE9fRlJBTUVfUElYRUxfWCAodywgdy0+cGh5c19jdXJzb3IueCk7CisgIGludCB0ZW1wX2Z5ID0g V0lORE9XX1RPX0ZSQU1FX1BJWEVMX1kgKHcsIHctPnBoeXNfY3Vyc29yLnkpOworICBlbnVtIHdp bmRvd19wYXJ0IHBhcnQgPSBPTl9OT1RISU5HOworICBMaXNwX09iamVjdCB3aW5kb3cgPSB3aW5k b3dfZnJvbV9jb29yZGluYXRlcyAoZiwgdGVtcF9meCwgdGVtcF9meSwgJnBhcnQsIGZhbHNlKTsK KyAgTGlzcF9PYmplY3Qgd2luZG93X3N0cmluZyA9IEZwcmluMV90b19zdHJpbmcgKHdpbmRvdywg UW5pbCk7CisgIGRlYnVnX21ldGhvZF9hZGQgKHcsICJ3aW5kb3cgKCVzKSIsIFNTREFUQSAod2lu ZG93X3N0cmluZykpOworI2VuZGlmCisKK2NoYXIgKndfY29udGVudHMgPSAoQlVGRkVSUCAody0+ Y29udGVudHMpICYmIFNUUklOR1AgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbmFtZSkp KQorICAgICAgICAgICAgICAgICAgID8gU1NEQVRBIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIG5hbWUpKQorICAgICAgICAgICAgICAgICAgIDogIm5pbCI7CitmcHJpbnRmIChzdGRlcnIs ICJcbkJ1ZmZlciAoJXMpXG4iLCB3X2NvbnRlbnRzKTsKKworc3RydWN0IGZhY2UgKmZhY2UgPSBt Y19sb29rdXBfZmFjZSAoaXQpOworTGlzcF9PYmplY3QgZm9yZWdyb3VuZCA9IGZhY2UtPmxmYWNl W0xGQUNFX0ZPUkVHUk9VTkRfSU5ERVhdOworTGlzcF9PYmplY3QgYmFja2dyb3VuZCA9IGZhY2Ut PmxmYWNlW0xGQUNFX0JBQ0tHUk9VTkRfSU5ERVhdOworZnByaW50ZiAoc3RkZXJyLCAiXG5mb3Jl Z3JvdW5kICglcykgfCBiYWNrZ3JvdW5kICglcylcbiIsCisgICAgICAgICAgICAgICAgICghTklM UCAoZm9yZWdyb3VuZCkgPyBTU0RBVEEgKGZvcmVncm91bmQpIDogIk5JTFAiKSwKKyAgICAgICAg ICAgICAgICAgKCFOSUxQIChiYWNrZ3JvdW5kKSA/IFNTREFUQSAoYmFja2dyb3VuZCkgOiAiTklM UCIpKTsKKworZnByaW50ZiAoc3RkZXJyLCAiTXkgbGlzcCBvYmplY3Q6ICAlc1xuIiwgU1NEQVRB IChGY2hhcl90b19zdHJpbmcgKG1ha2VfZml4bnVtICgxMDEpKSkpOworCitmcHJpbnRmIChzdGRl cnIsICJzdHJpbmc6ICVzIHwgaW50OiAlZFxuIiwgU1NEQVRBIChidWlsZF9zdHJpbmcgKCJmb28i KSksIDY5KTsKKworaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKSAmJiBTVFJJTkdQIChCVkFSIChY QlVGRkVSICh3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hbiwgY29sLCAmZW5kcCk7CisgIGlmICh3aWR0aCA+ PSAwKQorICAgIHsKKyAgICAgIGNvbCArPSB3aWR0aDsKKyAgICAgIGlmIChlbmRwID4gc2Nhbikg LyogQXZvaWQgaW5maW5pdGUgbG9vcHMgd2l0aCAwLXdpZHRoIG92ZXJsYXlzLiAgKi8KKyAgICAg ICAgeworICAgIHNjYW4gPSBlbmRwOworICAgIHNjYW5fYnl0ZSA9IENIQVJfVE9fQllURSAoc2Nh bik7CisgICAgY29udGludWU7CisgICAgICAgIH0KKyAgICB9CisgICAgICB9CisgICAgICAvKiBD aGVjayBjb21wb3NpdGlvbiBzZXF1ZW5jZS4gICovCisgICAgICBpZiAoY21wX2l0LmlkID49IDAK KyAgICB8fCAoc2NhbiA9PSBjbXBfaXQuc3RvcF9wb3MKKyAgICAgICAgJiYgY29tcG9zaXRpb25f cmVzZWF0X2l0ICgmY21wX2l0LCBzY2FuLCBzY2FuX2J5dGUsIGVuZCwKKyAgICAgICAgICB3LCBO VUxMLCBRbmlsKSkpCisgIGNvbXBvc2l0aW9uX3VwZGF0ZV9pdCAoJmNtcF9pdCwgc2Nhbiwgc2Nh bl9ieXRlLCBRbmlsKTsKKyAgICAgIGlmIChjbXBfaXQuaWQgPj0gMCkKKyAgeworICAgIHNjYW4g Kz0gY21wX2l0Lm5jaGFyczsKKyAgICBzY2FuX2J5dGUgKz0gY21wX2l0Lm5ieXRlczsKKyAgICBp ZiAoc2NhbiA8PSBlbmQpCisgICAgICBjb2wgKz0gY21wX2l0LndpZHRoOworICAgIGlmIChjbXBf aXQudG8gPT0gY21wX2l0Lm5nbHlwaHMpCisgICAgICB7CisgICAgICAgIGNtcF9pdC5pZCA9IC0x OworICAgICAgICBjb21wb3NpdGlvbl9jb21wdXRlX3N0b3BfcG9zICgmY21wX2l0LCBzY2FuLCBz Y2FuX2J5dGUsIGVuZCwKKyAgICAgICAgICAgICAgUW5pbCk7CisgICAgICB9CisgICAgZWxzZQor ICAgICAgY21wX2l0LmZyb20gPSBjbXBfaXQudG87CisgICAgY29udGludWU7CisgIH0KKyAgICAg IGMgPSBGRVRDSF9CWVRFIChzY2FuX2J5dGUpOworICAgICAgLyogU2VlIGlmIHRoZXJlIGlzIGEg ZGlzcGxheSB0YWJsZSBhbmQgaXQgcmVsYXRlcworICAgdG8gdGhpcyBjaGFyYWN0ZXIuICAqLwor ICAgICAgaWYgKGRwICE9IDAKKyAgICAmJiAhIChtdWx0aWJ5dGUgJiYgTEVBRElOR19DT0RFX1Ag KGMpKQorICAgICYmIFZFQ1RPUlAgKERJU1BfQ0hBUl9WRUNUT1IgKGRwLCBjKSkpCisgIHsKKyAg ICBMaXNwX09iamVjdCBjaGFydmVjOworICAgIHB0cmRpZmZfdCBpLCBuOworICAgIC8qIFRoaXMg Y2hhcmFjdGVyIGlzIGRpc3BsYXllZCB1c2luZyBhIHZlY3RvciBvZiBnbHlwaHMuCisgICAgICAg VXBkYXRlIHRoZSBjb2x1bW4vcG9zaXRpb24gYmFzZWQgb24gdGhvc2UgZ2x5cGhzLiAgKi8KKyAg ICBjaGFydmVjID0gRElTUF9DSEFSX1ZFQ1RPUiAoZHAsIGMpOworICAgIG4gPSBBU0laRSAoY2hh cnZlYyk7CisgICAgZm9yIChpID0gMDsgaSA8IG47IGkrKykKKyAgICAgIHsKKyAgICAgICAgLyog VGhpcyBzaG91bGQgYmUgaGFuZGxlZCB0aGUgc2FtZSBhcworICAgICBuZXh0X2VsZW1lbnRfZnJv bV9kaXNwbGF5X3ZlY3RvciBkb2VzIGl0LiAgKi8KKyAgICAgICAgTGlzcF9PYmplY3QgZW50cnkg PSBBUkVGIChjaGFydmVjLCBpKTsKKyAgICAgICAgaWYgKEdMWVBIX0NPREVfUCAoZW50cnkpKQor ICAgIGMgPSBHTFlQSF9DT0RFX0NIQVIgKGVudHJ5KTsKKyAgICAgICAgZWxzZQorICAgIGMgPSAn ICc7CisgICAgICAgIGlmIChjID09ICdcbicpCisgICAgZ290byBlbmRsb29wOworICAgICAgICBp ZiAoYyA9PSAnXHInICYmIEVRIChCVkFSIChjdXJyZW50X2J1ZmZlciwgc2VsZWN0aXZlX2Rpc3Bs YXkpLCBRdCkpCisgICAgZ290byBlbmRsb29wOworICAgICAgICBpZiAoYyA9PSAnXHQnKQorICAg IHsKKyAgICAgIGNvbCArPSB0YWJfd2lkdGg7CisgICAgICBjb2wgPSBjb2wgLyB0YWJfd2lkdGgg KiB0YWJfd2lkdGg7CisgICAgfQorICAgICAgICBlbHNlCisgICAgKytjb2w7CisgICAgICB9Cisg IH0KKyAgICAgIGVsc2UKKyAgeworICAgIC8qIFRoZSBkaXNwbGF5IHRhYmxlIGRvZXNuJ3QgYWZm ZWN0IHRoaXMgY2hhcmFjdGVyOworICAgICAgIGl0IGRpc3BsYXlzIGFzIGl0c2VsZi4gICovCisg ICAgaWYgKGMgPT0gJ1xuJykKKyAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICBpZiAoYyA9PSAnXHIn ICYmIEVRIChCVkFSIChjdXJyZW50X2J1ZmZlciwgc2VsZWN0aXZlX2Rpc3BsYXkpLCBRdCkpCisg ICAgICBnb3RvIGVuZGxvb3A7CisgICAgaWYgKGMgPT0gJ1x0JykKKyAgICAgIHsKKyAgICAgICAg Y29sICs9IHRhYl93aWR0aDsKKyAgICAgICAgY29sID0gY29sIC8gdGFiX3dpZHRoICogdGFiX3dp ZHRoOworICAgICAgfQorICAgIGVsc2UgaWYgKG11bHRpYnl0ZSAmJiBMRUFESU5HX0NPREVfUCAo YykpCisgICAgICB7CisgICAgICAgIC8qIFN0YXJ0IG9mIG11bHRpLWJ5dGUgZm9ybS4gICovCisg ICAgICAgIHVuc2lnbmVkIGNoYXIgKnB0cjsKKyAgICAgICAgaW50IGJ5dGVzLCB3aWR0aDsKKyAg ICAgICAgcHRyID0gQllURV9QT1NfQUREUiAoc2Nhbl9ieXRlKTsKKyAgICAgICAgTUNfTVVMVElC WVRFX0JZVEVTX1dJRFRIIChwdHIsIGRwLCBieXRlcywgd2lkdGgpOworICAgICAgICAvKiBTdWJ0 cmFjdCBvbmUgdG8gY29tcGVuc2F0ZSBmb3IgdGhlIGluY3JlbWVudAorICAgICB0aGF0IGlzIGdv aW5nIHRvIGhhcHBlbiBiZWxvdy4gICovCisgICAgICAgIHNjYW5fYnl0ZSArPSBieXRlcyAtIDE7 CisgICAgICAgIGNvbCArPSB3aWR0aDsKKyAgICAgIH0KKyAgICBlbHNlIGlmIChjdGxfYXJyb3cg JiYgKGMgPCAwNDAgfHwgYyA9PSAwMTc3KSkKKyAgICAgIGNvbCArPSAyOworICAgIGVsc2UgaWYg KGMgPCAwNDAgfHwgYyA+PSAwMTc3KQorICAgICAgY29sICs9IDQ7CisgICAgZWxzZQorICAgICAg Y29sKys7CisgIH0KKyAgICAgIHNjYW4rKzsKKyAgICAgIHNjYW5fYnl0ZSsrOworICAgIH0KKyBl bmRsb29wOgorICBsYXN0X2tub3duX2NvbHVtbiA9IGNvbDsKKyAgbGFzdF9rbm93bl9jb2x1bW5f cG9pbnQgPSBwdDsKKyAgbGFzdF9rbm93bl9jb2x1bW5fbW9kaWZpZWQgPSBNT0RJRkY7CisgIGlm IChnb2FsY29sKQorICAgICpnb2FsY29sID0gY29sOworICBpZiAoZW5kcG9zKQorICAgICplbmRw b3MgPSBzY2FuOworICBpZiAocHJldmNvbCkKKyAgICAqcHJldmNvbCA9IHByZXZfY29sOworfQor CitwdHJkaWZmX3QKK21jX2N1cnJlbnRfY29sdW1uIChzdHJ1Y3Qgd2luZG93ICp3LCBwdHJkaWZm X3QgcHQpCit7CisgIC8qIGBidWZfY2hhcnBvc190b19ieXRlcG9zJzogIGVhc3NlcnQgKEJVRl9C RUcgKGIpIDw9IGNoYXJwb3MgJiYgY2hhcnBvcyA8PSBCVUZfWiAoYikpOyAqLworICBMaXNwX09i amVjdCBidWYgPSB3LT5jb250ZW50czsKKyAgQ0hFQ0tfQlVGRkVSIChidWYpOworICBzdHJ1Y3Qg YnVmZmVyICpiID0gWEJVRkZ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UREUikKKyAgICAgIGJyZWFrOworICAgIC8qIEl0IHdhcyB0 aGUgZ2FwLiAgSnVtcCBiYWNrIG92ZXIgaXQuICAqLworICAgIHN0b3AgPSBCRUdWX0FERFI7Cisg ICAgcHRyID0gR1BUX0FERFI7CisgICAgLyogQ2hlY2sgd2hldGhlciB0aGF0IGJyaW5ncyB1cyB0 byBiZWdpbm5pbmcgb2YgYnVmZmVyLiAgKi8KKyAgICBpZiAoQkVHViA+PSBHUFQpCisgICAgICBi cmVhazsKKyAgfQorICAgICAgYyA9ICotLXB0cjsKKyAgICAgIGlmIChkcCAmJiBWRUNUT1JQIChE SVNQX0NIQVJfVkVDVE9SIChkcCwgYykpKQorICB7CisgICAgY2hhcnZlYyA9IERJU1BfQ0hBUl9W RUNUT1IgKGRwLCBjKTsKKyAgICBuID0gQVNJWkUgKGNoYXJ2ZWMpOworICB9CisgICAgICBlbHNl CisgIHsKKyAgICBjaGFydmVjID0gUW5pbDsKKyAgICBuID0gMTsKKyAgfQorICAgICAgZm9yIChp ID0gbiAtIDE7IGkgPj0gMDsgLS1pKQorICB7CisgICAgaWYgKFZFQ1RPUlAgKGNoYXJ2ZWMpKQor ICAgICAgeworICAgICAgICAvKiBUaGlzIHNob3VsZCBiZSBoYW5kbGVkIHRoZSBzYW1lIGFzCisg ICAgIG5leHRfZWxlbWVudF9mcm9tX2Rpc3BsYXlfdmVjdG9yIGRvZXMgaXQuICAqLworICAgICAg ICBMaXNwX09iamVjdCBlbnRyeSA9IEFSRUYgKGNoYXJ2ZWMsIGkpOworICAgICAgICBpZiAoR0xZ UEhfQ09ERV9QIChlbnRyeSkpCisgICAgYyA9IEdMWVBIX0NPREVfQ0hBUiAoZW50cnkpOworICAg ICAgICBlbHNlCisgICAgYyA9ICcgJzsKKyAgICAgIH0KKyAgICBpZiAoYyA+PSAwNDAgJiYgYyA8 IDAxNzcpCisgICAgICBjb2wrKzsKKyAgICBlbHNlIGlmIChjID09ICdcbicKKyAgICAgICB8fCAo YyA9PSAnXHInCisgICAgICAgICAgICYmIEVRIChCVkFSIChjdXJyZW50X2J1ZmZlciwgc2VsZWN0 aXZlX2Rpc3BsYXkpLCBRdCkpKQorICAgICAgeworICAgICAgICBwdHIrKzsKKyAgICAgICAgZ290 byBzdGFydF9vZl9saW5lX2ZvdW5kOworICAgICAgfQorICAgIGVsc2UgaWYgKGMgPT0gJ1x0JykK KyAgICAgIHsKKyAgICAgICAgaWYgKHRhYl9zZWVuKQorICAgIGNvbCA9ICgoY29sICsgdGFiX3dp ZHRoKSAvIHRhYl93aWR0aCkgKiB0YWJfd2lkdGg7CisgICAgICAgIHBvc3RfdGFiICs9IGNvbDsK KyAgICAgICAgY29sID0gMDsKKyAgICAgICAgdGFiX3NlZW4gPSAxOworICAgICAgfQorICAgIGVs c2UgaWYgKFZFQ1RPUlAgKGNoYXJ2ZWMpKQorICAgICAgLyogV2l0aCBhIGRpc3BsYXkgdGFibGUg ZW50cnksIEMgaXMgZGlzcGxheWVkIGFzIGlzLCBhbmQKKyAgICAgICAgIG5vdCBkaXNwbGF5ZWQg YXMgXE5OTiBvciBhcyBeTi4gIElmIEMgaXMgYSBzaW5nbGUtYnl0ZQorICAgICAgICAgY2hhcmFj dGVyLCBpdCB0YWtlcyBvbmUgY29sdW1uLiAgSWYgQyBpcyBtdWx0aS1ieXRlIGluCisgICAgICAg ICBhIHVuaWJ5dGUgYnVmZmVyLCBpdCdzIHRyYW5zbGF0ZWQgdG8gdW5pYnl0ZSwgc28gaXQKKyAg ICAgICAgIGFsc28gdGFrZXMgb25lIGNvbHVtbi4gICovCisgICAgICArK2NvbDsKKyAgICBlbHNl CisgICAgICBjb2wgKz0gKGN0bF9hcnJvdyAmJiBjIDwgMDIwMCkgPyAyIDogNDsKKyAgfQorICAg IH0KKyBzdGFydF9vZl9saW5lX2ZvdW5kOgorICBpZiAodGFiX3NlZW4pCisgICAgeworICAgICAg Y29sID0gKChjb2wgKyB0YWJfd2lkdGgpIC8gdGFiX3dpZHRoKSAqIHRhYl93aWR0aDsKKyAgICAg IGNvbCArPSBwb3N0X3RhYjsKKyAgICB9CisgIGxhc3Rfa25vd25fY29sdW1uID0gY29sOworICBs YXN0X2tub3duX2NvbHVtbl9wb2ludCA9IHB0OworICBsYXN0X2tub3duX2NvbHVtbl9tb2RpZmll ZCA9IE1PRElGRjsKKyAgcmV0dXJuIGNvbDsKK30KKworc3RhdGljIGludAorbWNfbGlzcF90b19j dXJzb3JfdHlwZSAoTGlzcF9PYmplY3QgYXJnKQoreworICBjaGFyICpzdHI7CisgIGlmIChYVFlQ RSAoYXJnKSA9PSBMaXNwX1N0cmluZykKKyAgICBzdHIgPSBTU0RBVEEgKGFyZyk7CisgIGVsc2Ug aWYgKFhUWVBFIChhcmcpID09IExpc3BfU3ltYm9sKQorICAgIHN0ciA9IFNTREFUQSAoU1lNQk9M X05BTUUgKGFyZykpOworICBlbHNlIHJldHVybiAtMTsKKyAgaWYgKCFzdHJjbXAgKHN0ciwgImJv eCIpKQorICAgIHJldHVybiBGSUxMRURfQk9YX0NVUlNPUjsKKyAgaWYgKCFzdHJjbXAgKHN0ciwg ImhvbGxvdyIpKQorICAgIHJldHVybiBIT0xMT1dfQk9YX0NVUlNPUjsKKyAgaWYgKCFzdHJjbXAg KHN0ciwgImhiYXIiKSkKKyAgICByZXR1cm4gSEJBUl9DVVJTT1I7CisgIGlmICghc3RyY21wIChz dHIsICJiYXIiKSkKKyAgICByZXR1cm4gQkFSX0NVUlNPUjsKKyAgaWYgKCFzdHJjbXAgKHN0ciwg ImxlZnQtZnJpbmdlLWJpdG1hcCIpKQorICAgIHJldHVybiBMRUZUX0ZSSU5HRV9CSVRNQVA7Cisg IGlmICghc3RyY21wIChzdHIsICJyaWdodC1mcmluZ2UtYml0bWFwIikpCisgICAgcmV0dXJuIFJJ R0hUX0ZSSU5HRV9CSVRNQVA7CisgIGlmICghc3RyY21wIChzdHIsICJubyIpKQorICAgIHJldHVy biBOT19DVVJTT1I7CisgIHJldHVybiAtMTsKK30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aXMgcHJlc2VudCwg dXNlIG5vbi1wYXJ0aWFsIGJpdG1hcC4gICovCisKK3N0YXRpYyBpbnQKK21jX2dldF9sb2dpY2Fs X2ZyaW5nZV9iaXRtYXAgKHN0cnVjdCB3aW5kb3cgKncsIExpc3BfT2JqZWN0IGJpdG1hcCwgaW50 IHJpZ2h0X3AsIGludCBwYXJ0aWFsX3ApCit7CisgIExpc3BfT2JqZWN0IGNtYXAsIGJtMSA9IFFu aWwsIGJtMiA9IFFuaWwsIGJtOworICBFTUFDU19JTlQgbG4xID0gMCwgbG4yID0gMDsKKyAgaW50 IGl4MSA9IHJpZ2h0X3A7CisgIGludCBpeDIgPSBpeDEgKyAocGFydGlhbF9wID8gMiA6IDApOwor ICBpZiAoKGNtYXAgPSBCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZyaW5nZV9pbmRpY2F0 b3JfYWxpc3QpKSwgIU5JTFAgKGNtYXApKQorICAgIHsKKyAgICAgIGJtMSA9IEZhc3NxIChiaXRt YXAsIGNtYXApOworICAgICAgaWYgKENPTlNQIChibTEpKQorICB7CisgICAgaWYgKChibTEgPSBY Q0RSIChibTEpKSwgTklMUCAoYm0xKSkKKyAgICAgIHJldHVybiBOT19GUklOR0VfQklUTUFQOwor ICAgIGlmIChDT05TUCAoYm0xKSkKKyAgICAgIHsKKyAgICAgICAgbG4xID0gWEZJWE5VTSAoRmxl bmd0aCAoYm0xKSk7CisgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgeworICAgICAgaWYgKGxu MSA+IGl4MikKKyAgICAgICAgeworICAgICAgICAgIGJtID0gRm50aCAobWFrZV9maXhudW0gKGl4 MiksIGJtMSk7CisgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgIGdvdG8gZm91bmQ7 CisgICAgICAgIH0KKyAgICB9CisgICAgICAgIGVsc2UKKyAgICB7CisgICAgICBpZiAobG4xID4g aXgxKQorICAgICAgICB7CisgICAgICAgICAgYm0gPSBGbnRoIChtYWtlX2ZpeG51bSAoaXgxKSwg Ym0xKTsKKyAgICAgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgZ290byBmb3VuZDsKKyAg ICAgICAgfQorICAgIH0KKyAgICAgIH0KKyAgICBlbHNlIGlmICgoYm0gPSBibTEsICFFUSAoYm0s IFF0KSkpCisgICAgICBnb3RvIGZvdW5kOworICB9CisgICAgfQorICBpZiAoIUVRIChjbWFwLCBC VkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkKKyAgICAgICYm ICFOSUxQIChCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkp CisgICAgeworICAgICAgYm0yID0gRmFzc3EgKGJpdG1hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0 cywgZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpOworICAgICAgaWYgKENPTlNQIChibTIpKQorICB7 CisgICAgaWYgKChibTIgPSBYQ0RSIChibTIpKSwgIU5JTFAgKGJtMikpCisgICAgICB7CisgICAg ICAgIGlmIChDT05TUCAoYm0yKSkKKyAgICB7CisgICAgICBsbjIgPSBYRklYTlVNIChGbGVuZ3Ro IChibTIpKTsKKyAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgICAgIHsKKyAgICAgICAgICBpZiAo bG4yID4gaXgyKQorICAgICAgeworICAgICAgICBibSA9IEZudGggKG1ha2VfZml4bnVtIChpeDIp LCBibTIpOworICAgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgICAgIGdvdG8gZm91bmQ7 CisgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgICB9CisgIH0KKyAgICB9CisgIGlmIChs bjEgPiBpeDEpCisgICAgeworICAgICAgYm0gPSBGbnRoIChtYWtlX2ZpeG51bSAoaXgxKSwgYm0x KTsKKyAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgIGdvdG8gZm91bmQ7CisgICAgfQorICBpZiAo bG4yID4gaXgxKQorICAgIHsKKyAgICAgIGJtID0gRm50aCAobWFrZV9maXhudW0gKGl4MSksIGJt Mik7CisgICAgICBpZiAoIUVRIChibSwgUXQpKQorICBnb3RvIGZvdW5kOworICAgICAgcmV0dXJu IE5PX0ZSSU5HRV9CSVRNQVA7CisgICAgfQorICBlbHNlIGlmICgoYm0gPSBibTIsIE5JTFAgKGJt KSkpCisgICAgcmV0dXJuIE5PX0ZSSU5HRV9CSVRNQVA7CisgZm91bmQ6CisgIHJldHVybiBsb29r dXBfZnJpbmdlX2JpdG1hcCAoYm0pOworfQorCit2b2lkCittY19lcmFzZV9waHlzX2N1cnNvciAo c3RydWN0IHdpbmRvdyAqdywgaW50IGZsYXZvcikKK3sKKyAgc3RydWN0IGZyYW1lICpmID0gWEZS QU1FICh3LT5mcmFtZSk7CisgIE1vdXNlX0hMSW5mbyAqaGxpbmZvID0gTU9VU0VfSExfSU5GTyAo Zik7CisgIGludCBocG9zID0gdy0+cGh5c19jdXJzb3IuaHBvczsKKyAgaW50IHZwb3MgPSB3LT5w aHlzX2N1cnNvci52cG9zOworICBib29sIG1vdXNlX2ZhY2VfaGVyZV9wID0gZmFsc2U7CisgIHN0 cnVjdCBnbHlwaF9tYXRyaXggKmFjdGl2ZV9nbHlwaHMgPSB3LT5jdXJyZW50X21hdHJpeDsKKyAg c3RydWN0IGdseXBoX3JvdyAqY3Vyc29yX3JvdzsKKyAgc3RydWN0IGdseXBoICpjdXJzb3JfZ2x5 cGg7CisgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBobDsKKyAgLyogTm8gY3Vyc29yIGRpc3BsYXll ZCBvciByb3cgaW52YWxpZGF0ZWQgPT4gbm90aGluZyB0byBkbyBvbiB0aGUKKyAgICAgc2NyZWVu LiAgKi8KKyAgaWYgKHctPnBoeXNfY3Vyc29yX3R5cGUgPT0gTk9fQ1VSU09SKQorICAgIGdvdG8g bWFya19jdXJzb3Jfb2ZmOworICAvKiBWUE9T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IG1vdXNlX2ZhY2VfaGVyZV9wID0gdHJ1ZTsKKyAgLyogTWF5YmUgY2xlYXIgdGhlIGRp c3BsYXkgdW5kZXIgdGhlIGN1cnNvci4gICovCisgIGlmICh3LT5waHlzX2N1cnNvcl90eXBlID09 IEhPTExPV19CT1hfQ1VSU09SKQorICAgIHsKKyAgICAgIGludCB4LCB5OworICAgICAgaW50IGhl YWRlcl9saW5lX2hlaWdodCA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICAgICAg aW50IHdpZHRoOworICAgICAgY3Vyc29yX2dseXBoID0gZ2V0X3BoeXNfY3Vyc29yX2dseXBoICh3 KTsKKyAgICAgIGlmIChjdXJzb3JfZ2x5cGggPT0gTlVMTCkKKyAgICAgICAgZ290byBtYXJrX2N1 cnNvcl9vZmY7CisgICAgICB3aWR0aCA9IGN1cnNvcl9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAg ICB4ID0gdy0+cGh5c19jdXJzb3IueDsKKyAgICAgIGlmICh4IDwgMCkKKyAgICAgICAgeworICAg ICAgICAgIHdpZHRoICs9IHg7CisgICAgICAgICAgeCA9IDA7CisgICAgICAgIH0KKyAgICAgIHdp ZHRoID0gbWluICh3aWR0aCwgd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKSAtIHgpOwor ICAgICAgeSA9IFdJTkRPV19UT19GUkFNRV9QSVhFTF9ZICh3LCBtYXggKGhlYWRlcl9saW5lX2hl aWdodCwgY3Vyc29yX3Jvdy0+eSkpOworICAgICAgeCA9IFdJTkRPV19URVhUX1RPX0ZSQU1FX1BJ WEVMX1ggKHcsIHgpOworICAgICAgaWYgKHdpZHRoID4gMCkKKyAgRlJBTUVfUklGIChmKS0+Y2xl YXJfZnJhbWVfYXJlYSAoZiwgeCwgeSwgd2lkdGgsIGN1cnNvcl9yb3ctPnZpc2libGVfaGVpZ2h0 KTsKKyAgICB9CisgIC8qIEVyYXNlIHRoZSBjdXJzb3IgYnkgcmVkcmF3aW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BfcCA9ICh3LT5z dXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9f aHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xs ID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhzY3Jv bGwpOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBzb21ldGhpbmcgZWxzZSBiZXNp ZGVzIGhvcml6b250YWxseSBzY3JvbGxpbmcgdGhlCisgICAgICAgICAgICAgICBjdXJyZW50IGxp bmUgZGlmZmVyZW50bHkuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgaXMgX25vdF8gaG9y aXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfYWxsX3Blcm1f MV9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9o c2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xs ID09IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCAuLi4KKyAgICAg ICAgICAgICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlm ZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8yX3AgPSAoIXctPnN1c3BlbmRfYXV0 b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21v ZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPT0gMAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhzY3JvbGwpOworICAv KiBFWEFNUExFOiAgKHNjcm9sbC1sZWZ0IDUpOyBhbmQsIHRoZW4gcHJlc3MgdGhlIGxlZnQgYXJy b3cga2V5IG9uZSB0aW1lLgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIF9pc18gaG9yaXpv bnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiovCisgIGJvb2wgaHNjbF90ZW1wX3AgPSAoIXct PnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Ny b2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAg ICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gMCk7CisgIC8qIEVYQU1QTEU6 ICBDLXUgQy14IDwgYW5kIGRvIHNvbWV0aGluZyB0aGF0IGNhdXNlcyB0aGUgY3VycmVudCBsaW5l IHRvIGJlCisgICAgICAgICAgICAgICBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHku CisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkgc2Nyb2xsZWQg ZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9wZXJtX3AgPSAoIXctPnN1c3BlbmRfYXV0b19o c2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAg ICAgICAgICAgICAgICAgIC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cnMgbm90IHRvCisg ICAgICByZWx5IHVwb24gYSBMaXNwIHNldHRpbmcgdXNpbmcgYHNldC1mcmluZ2UtYml0bWFwLWZh Y2UnLiAqLworICAgICAgZ2x5cGhfcm93LT5sZWZ0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5 cGUgPT0gTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgIGdseXBoX3Jvdy0+bGVmdF9mcmlu Z2Vfb2Zmc2V0ID0gMDsKKyAgICAgIGRyYXdfZnJpbmdlX2JpdG1hcCAodywgZ2x5cGhfcm93LCB0 cnVlKTsKKyAgICB9CisgICAgZWxzZSBpZiAoIXJlbW92ZV9wCisgICAgICAgICAgICAgJiYgZmxh dm9yID09IE1DX09WRVJMQVlfQVJST1dfQklUTUFQCisgICAgICAgICAgICAgJiYgKGhzY2xfYWxs X3RlbXBfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzBfcAorICAgICAgICAg ICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzFfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX2Fs bF9wZXJtXzJfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX3RlbXBfcAorICAgICAgICAgICAg ICAgICB8fCBoc2NsX3Blcm1fcCkpCisgICAgICB7CisgICAgICAgIGVudW0gZmFjZV9pZCBvdmVy bGF5X2Fycm93X2ZhY2VfaWQgPQorICAgICAgICAgICghYWN0aXZlX2N1cnNvcl9wCisgICAgICAg ICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnNfaW5h Y3RpdmVfd2luZG93cykpKQorICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGlu dGVybiAoIistb3ZlcmxheS1hcnJvdy1oc2NsLWluYWN0aXZlLWZhY2UiKSwgdHJ1ZSkKKyAgICAg ICAgICA6IChhY3RpdmVfY3Vyc29yX3AKKyAgICAgICAgICAgICAmJiBtaW5pbWFsX3ApCisgICAg ICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJy b3ctaHNjbC1taW5pbWFsLWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICA6IChhY3RpdmVfY3Vyc29y X3AKKyAgICAgICAgICAgICAmJiAhbWluaW1hbF9wKQorICAgICAgICAgICAgPyBsb29rdXBfbmFt ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtZmFjZSIpLCB0cnVl KQorICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICBmYWNlX2lkID0gKGN1cnNv cl90eXBlID09IExFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgID8gb3Zlcmxh eV9hcnJvd19mYWNlX2lkCisgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAg ICAgICAgZ2x5cGhfcm93LT5sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gZmFjZV9pZDsKKyAgICAgICAg aWYgKGhzY2xfYWxsX3Blcm1fMF9wKQorICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRf bG9naWNhbF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCBmYWxzZSwg ZmFsc2UpOworICAgICAgICAgIGVsc2UgaWYgKGhzY2xfYWxsX3Blcm1fMV9wKQorICAgICAgICAg ICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9sb2dpY2FsX2ZyaW5nZV9iaXRtYXAgKHcsIGludGVy biAoIistaHNjbC1wZXJtIiksIHRydWUsIGZhbH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ZV9iaXRtYXAgKHcsIGdseXBoX3JvdywgdHJ1ZSk7 CisgICAgICB9CisgICAgICBlbHNlIGlmICghcmVtb3ZlX3AKKyAgICAgICAgICAgICAgICYmIChm bGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAg ICAgIHx8IGZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFCisgICAgICAgICAgICAgICAgICAg fHwgZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAg ICAgIHx8IGZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICB8fCBm bGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSCkpCisgICAgICAgIHsKKyAgICAgICAg ICBMaXNwX09iamVjdCBiaXRtYXBfZmxhdm9yID0gKGZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFO R0xFX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IFFtY19ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogKGZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hvbGxvd19yZWN0YW5nbGUK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZmxhdm9yID09IE1DX1ZF UlRJQ0FMX0JBUl9SSUdIVF9BUlJPVykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiAoZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUikKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXIKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZmxhdm9yID09IE1DX1ZFUlRJ Q0FMX0JBUl9CQUNLU0xBU0gpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBRbWNfdmVydGljYWxfYmFyX2JhY2tzbGFzaAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IFFuaWw7CisgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IChjdXJzb3Jf dHlwZSA9PSBSSUdIVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgICAgICAgICA/ IGxvb2t1cF9mcmluZ2VfYml0bWFwIChiaXRtYXBfZmxhdm9yKQorICAgICAgICAgICAgICAgICAg ICAgICAgICA6IE5PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgICAgZmFjZV9pZCA9IChjdXJzb3Jf dHlwZSA9PSBSSUdIVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgICA/IGxvb2t1 cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXZlcnRpY2FsLWJhci1mYWNlIiksIHRydWUp CisgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAgIGdseXBo X3Jvdy0+Y3Vyc29yX2luX2ZyaW5nZV9wID0gZmFsc2U7CisgICAgICAgICAgZ2x5cGhfcm93LT5m cmluZ2VfYml0bWFwX3BlcmlvZGljX3AgPSAwOworICAgICAgICAgIGdseXBoX3Jvdy0+cmlnaHRf ZnJpbmdlX2JpdG1hcCA9IGZyaW5nZV9iaXRtYXA7CisgICAgICAgICAgZ2x5cGhfcm93LT5yaWdo dF9mcmluZ2VfZmFjZV9pZCA9IGZhY2VfaWQ7CisgICAgICAgICAgZ2x5cGhfcm93LT5yaWdodF9m cmluZ2Vfb2Zmc2V0ID0gMDsKKyAgICAgICAgICBkcmF3X2ZyaW5nZV9iaXRtYXAgKHcsIGdseXBo X3JvdywgZmFsc2UpOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKGZsYXZvciA9PSBNQ19H TFlQSAorICAgICAgICAgICAgICAgICB8fCBmbGF2b3IgPT0gTUNfR0xZUEhMRVNTCisgICAgICAg ICAgICAgICAgIHx8IGZsYXZvciA9PSBNQ19HTFlQSF9UQUIpCisgICAgICAgICAgeworICAgICAg ICAgICAgdy0+bWMuaCA9IGg7CisgICAgICAgICAgICB3LT5tYy5meCA9IGZ4OworICAgICAgICAg ICAgdy0+bWMuZnkgPSBmeTsKKyAgICAgICAgICAgIHctPm1jLmdseXBoX2ZsYXZvciA9IGZsYXZv cjsKKyAgICAgICAgICAgIHctPm1jLnJlZCA9IFhGTE9BVF9EQVRBIChBUkVGIChjb2xvcl92ZWN0 b3IsIDApKTsKKyAgICAgICAgICAgIHctPm1jLmdyZWVuID0gWEZMT0FUX0RBVEEgKEFSRUYgKGNv bG9yX3ZlY3RvciwgMSkpOworICAgICAgICAgICAgdy0+bWMuYmx1ZSA9IFhGTE9BVF9EQVRBIChB UkVGIChjb2xvcl92ZWN0b3IsIDIpKTsKKyAgICAgICAgICAgIHctPm1jLnBvc2ludCA9IHBvc2lu dDsKKyAgICAgICAgICAgIC8qIFNvbWUgb2YgdGhlc2UgdmFsdWVzIGNvbWUgdGhyb3VnaCBhcyAx LjAwMzkwNiwgd2hpY2ggY2F1c2VzIGEgYnJlYWthZ2UKKyAgICAgICAgICAgIG9mIHRoZSBjb2xv cnMgaW4gdGhhdCBtdWx0aXBsaWNhdGlvbiBieSB0aGUgYmFzZSB3aWxsIGV4Y2VlZCB0aGUgYmFz ZS4gKi8KKyAgICAgICAgICAgIGlmICh3LT5tYy5yZWQgPiAxLjApCisgICAgICAgICAgICAgIHct Pm1jLnJlZCA9IDEuMDsKKyAgICAgICAgICAgIGlmICh3LT5tYy5ncmVlbiA+IDEuMCkKKyAgICAg ICAgICAgICAgdy0+bWMuZ3JlZW4gPSAxLjA7CisgICAgICAgICAgICBpZiAody0+bWMuYmx1ZSA+ IDEuMCkKKyAgICAgICAgICAgICAgdy0+bWMuYmx1ZSA9IDEuMDsKKyAgICAgICAgICAgIEZSQU1F X1JJRiAoZiktPmRyYXdfd2luZG93X2N1cnNvciAodywgZ2x5cGhfcm93LCB4LCB5LCBjdXJzb3Jf dHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vy c29yX3dpZHRoLCB0cnVlLCBhY3RpdmVfY3Vyc29yX3ApOworICAgICAgICAgICAgdy0+bWMuaCA9 IC0xOworICAgICAgICAgICAgdy0+bWMuZnggPSAtMTsKKyAgICAgICAgICAgIHctPm1jLmZ5ID0g LTE7CisgICAgICAgICAgICB3LT5tYy5nbHlwaF9mbGF2b3IgPSBOT19GTEFWT1I7CisgICAgICAg ICAgICB3LT5tYy5yZWQgPSAtMS4wOworICAgICAgICAgICAgdy0+bWMuZ3JlZW4gPSAtMS4wOwor ICAgICAgICAgICAgdy0+bWMuYmx1ZSA9IC0xLjA7CisgICAgICAgICAgICB3LT5tYy5wb3NpbnQg PSAtMTsKKyAgICAgICAgICB9CisgIC8qIFJlc3RvcmUgdGhlIHByZXZpb3VzIHZhbHVlcyBmb3Ig dy0+cGh5c19jdXJzb3IgYW5kIGdseXBoX3Jvdy4gKi8KKyAgdy0+cGh5c19jdXJzb3Jfb25fcCA9 IHBoeXNfY3Vyc29yX29uX3A7CisgIHctPnBoeXNfY3Vyc29yLnggPSBwaHlzX2N1cnNvcl94Owor ICB3LT5waHlzX2N1cnNvci55ID0gcGh5c19jdXJzb3JfeTsKKyAgdy0+cGh5c19jdXJzb3IuaHBv cyA9IHBoeXNfY3Vyc29yX2hwb3M7CisgIHctPnBoeXNfY3Vyc29yLnZwb3MgPSBwaHlzX2N1cnNv cl92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5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4x ZCAlNWQgJTRkICAlM2QgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBo c1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ct PnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgKGdseXBoLT50 eXBlID09IENIQVJfR0xZUEgKKyAgICAgICAgID8gJ0MnCisgICAgICAgICA6ICdHJyksCisgICAg ICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAg ICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAg ICAgICAgPyAnUycKKyAgICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICAgICAgICA/ICcwJworICAgICAgICAgICAgICAgOiAnLScpKSksCisgICAgICAgIGdseXBoLT5w aXhlbF93aWR0aCwKKyAgICAgICAgZ2x5cGgtPnUuY2gsCisgICAgICAgIGdseXBoLT5mYWNlX2lk LAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRf Ym94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgZ2x5 cGgtPnZwb3MsIGdseXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICgoIU5JTFAgKGNo YXJhY3RlcikKKyAgICAgICAgICYmIGdseXBoLT51LmNoID09IDkpCisgICAgICAgICAgID8gIlxc dCIKKyAgICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAmJiBnbHlwaC0+ dS5jaCA9PSAxMCkKKyAgICAgICAgICAgPyAiXFxuIgorICAgICAgICAgOiAoIU5JTFAgKGNoYXJh Y3RlcikKKyAgICAgICAgICAgICYmIGdseXBoLT51LmNoID09IDMyKQorICAgICAgICAgICA/ICJc XHMiCisgICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgJiYgZ2x5cGgt PnUuY2ggIT0gOQorICAgICAgICAgICAgJiYgZ2x5cGgtPnUuY2ggIT0gMTAKKyAgICAgICAgICAg ICYmIGdseXBoLT51LmNoICE9IDMyKQorICAgICAgICAgICA/IFNTREFUQSAoY2hhcmFjdGVyKQor ICAgICAgICAgOiAiXFw/IikpOworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gU1RS RVRDSF9HTFlQSCkKKyAgICB7CisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICIgJTUi cEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNnggJTRkICUxLjFkJTEuMWQgJTVk ICU0ZCAgJTNkICAlM2QgJXMgJXNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVY VF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2Vk W2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdTJywKKyAgICAgICAg Z2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAg ICAgICAgPyAnQicKKyAgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAg ICAgICAgPyAnUycKKyAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAg ICAgPyAnMCcKKyAgICAgICAgICA6ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRo LAorICAgICAgICAwdSwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5s ZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAg ICBnbHlwaC0+eCwgZ2x5cGgtPnksIGdseXBoLT5ocG9zLCBnbHlwaC0+dnBvcywgZ2x5cGgtPnp2 X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgIlxcUyIpOworICAgIH0KKyAgZWxzZSBpZiAoZ2x5 cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJyLAor ICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAl MS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNkICVzICVjXG4iLAorICAgICAgICBnbHlwaCAtIHJv dy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8g MCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAn SScsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9i amVjdCkKKyAgICAgICAgICAgID8gJ0InCisgICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9i amVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVj dCkKKyAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgOiAnLScpKSksCisgICAgICAgIGdseXBo LT5waXhlbF93aWR0aCwKKyAgICAgICAgKHVuc2lnbmVkIGludCkgZ2x5cGgtPnUuaW1nX2lkLAor ICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwK KyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT54LCBnbHlw aC0+eSwgZ2x5cGgtPmhwb3MsIGdseXBoLT52cG9zLCBnbHlwaC0+enZfcCA/ICJaViIgOiAiLS0i LAorICAgICAgICAnLicpOworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gQ09NUE9T SVRFX0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIiAlNSJw RCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCIsCisgICAgICAgIGdseXBoIC0g cm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkg PyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAg ICcrJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+ b2JqZWN0KQorICAgICAgICAgICAgPyAnQicKKyAgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+ b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2Jq ZWN0KQorICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICA6ICctJykpKSwKKyAgICAgICAgZ2x5 cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAodW5zaWduZWQgaW50KSBnbHlwaC0+dS5jbXAuaWQp OworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICU0ZCAlMS4xZCUxLjFkIiwKKyAgICAgICAgZ2x5 cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGds eXBoLT5yaWdodF9ib3hfbGluZV9wKTsKKyAgICAgIGlmIChnbHlwaC0+dS5jbXAuYXV0b21hdGlj KQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIgJTVkICU0ZCAgJTNkICAlM2QgJXMgLiBbJWQt JWRdXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoLT54LCBnbHlwaC0+eSwgZ2x5 cGgtPmhwb3MsIGdseXBoLT52cG9zLCBnbHlwaC0+enZfcCA/ICJaViIgOiAiLS0iLAorICAgICAg ICAgICAgICAgICAgICAgICAgIGdseXBoLT5zbGljZS5jbXAuZnJvbSwgZ2x5cGgtPnNsaWNlLmNt cC50byk7CisgICAgICAgIGVsc2UKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiXG4iKTsKKyAg ICB9CisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IFhXSURHRVRfR0xZUEgpCisgICAgeworI2lm bmRlZiBIQVZFX1hXSURHRVRTCisgICAgICBlYXNzdW1lIChmYWxzZSk7CisjZWxzZQorICAgICAg ZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICAlNWQvJS01ZCAlNWQgJTRjICU2ZCAlYyAlM2Qg MHglMDV4ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNkICVzICVjXG4iLAorICAgICAg ICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2VkW2Fy ZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94 LAorICAgICAgICAnWCcsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVS UCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNUUklOR1Ag KGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgOiAnLScpKSwKKyAg ICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAg ICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5l X3AsCisgICAgICAgIGdseXBoLT51Lnh3aWRnZXQsCisgICAgICAgIGdseXBoLT54LCBnbHlwaC0+ eSwgZ2x5cGgtPmhwb3MsIGdseXBoLT52cG9zLCBnbHlwaC0+enZfcCA/ICJaViIgOiAiLS0iLAor ICAgICAgICAnLicpOworI2VuZGlmCisgICAgfQorfQorCisvKiBEdW1wIHRoZSBjb250ZW50cyBv ZiBnbHlwaCByb3cgYXQgVlBPUyBpbiBNQVRSSVggdG8gc3RkZXJyLgorICAgR0xZUEhTIDAgbWVh bnMgZG9uJ3Qgc2hvdyBnbHlwaCBjb250ZW50cy4KKyAgIEdMWVBIUyAxIG1lYW5zIHNob3cgZ2x5 cGhzIGluIHNob3J0IGZvcm0KKyAgIEdMWVBIUyA+IDEgbWVhbnMgc2hvdyBnbHlwaHMgaW4gbG9u ZyBmb3JtLiAgKi8KKwordm9pZAorbWNfZHVtcF9nbHlwaF9yb3cgKHN0cnVjdCBnbHlwaF9yb3cg KnJvdywgaW50IHZwb3MsIGludCBnbHlwaHMpCit7CisgIGludCByZWxhdGl2ZV94ID0gMDsKKyAg aWYgKGdseXBocyAhPSAxKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIlxuRFVNUCBH TFlQSCBST1dcbiIpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiUm93ICAgICBTdGFydCAgICAg ICBFbmQgVXNlZCBvRT48XFxDVFpGZXNtICAgICBYICAgIFkgICAgVyAgICBIICAgIFYgICAgQSAg ICBQXG4iKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIj09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxu Iik7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIlM2QgJTkicEQiZCAlOSJwRCJkICU0ZCAlMS4x ZCUxLjFkJTEuMWQlMS4xZFwKKyUxLjFkJTEuMWQlMS4xZCUxLjFkJTEuMWQlMS4xZCUxLjFkJTEu MWQgICU0ZCAlNGQgJTRkICU0ZCAlNGQgJTRkICU0ZFxuIiwKKyAgICAgICAgIHZwb3MsCisgICAg ICAgICBNQVRSSVhfUk9XX1NUQVJUX0NIQVJQT1MgKHJvdyksCisgICAgICAgICBNQVRSSVhfUk9X X0VORF9DSEFSUE9TIChyb3cpLAorICAgICAgICAgcm93LT51c2VkW1RFWFRfQVJFQV0sCisgICAg ICAgICByb3ctPmNvbnRhaW5zX292ZXJsYXBwaW5nX2dseXBoc19wLAorICAgICAgICAgcm93LT5l bmFibGVkX3AsCisgICAgICAgICByb3ctPnRydW5jYXRlZF9vbl9sZWZ0X3AsCisgICAgICAgICBy b3ctPnRydW5jYXRlZF9vbl9yaWdodF9wLAorICAgICAgICAgcm93LT5jb250aW51ZWRfcCwKKyAg ICAgICAgIE1BVFJJWF9ST1dfQ09OVElOVUFUSU9OX0xJTkVfUCAocm93KSwKKyAgICAgICAgIE1B VFJJWF9ST1dfRElTUExBWVNfVEVYVF9QIChyb3cpLAorICAgICAgICAgcm93LT5lbmRzX2F0X3p2 X3AsCisgICAgICAgICByb3ctPmZpbGxfbGluZV9wLAorICAgICAgICAgcm93LT5lbmRzX2luX21p ZGRsZV9vZl9jaGFyX3AsCisgICAgICAgICByb3ctPnN0YXJ0c19pbl9taWRkbGVfb2ZfY2hhcl9w LAorICAgICAgICAgcm93LT5tb3VzZV9mYWNlX3AsCisgICAgICAgICByb3ctPngsCisgICAgICAg ICByb3ctPnksCisgICAgICAgICByb3ctPnBpeGVsX3dpZHRoLAorICAgICAgICAgcm93LT5oZWln aHQsCisgICAgICAgICByb3ctPnZpc2libGVfaGVpZ2h0LAorICAgICAgICAgcm93LT5hc2NlbnQs CisgICAgICAgICByb3ctPnBoeXNfYXNjZW50KTsKKyAgICAgIC8qIFRoZSBuZXh0IDMgbGluZXMg c2hvdWxkIGFsaWduIHRvICJTdGFydCIgaW4gdGhlIGhlYWRlci4gICovCisgICAgICBmcHJpbnRm IChzdGRlcnIsICIgICAgJTkicEQiZCAlOSJwRCJkXHQlNWRcbiIsIHJvdy0+c3RhcnQub3Zlcmxh eV9zdHJpbmdfaW5kZXgsCisgICAgICAgICByb3ctPmVuZC5vdmVybGF5X3N0cmluZ19pbmRleCwK KyAgICAgICAgIHJvdy0+Y29udGludWF0aW9uX2xpbmVzX3dpZHRoKTsKKyAgICAgIGZwcmludGYg KHN0ZGVyciwgIiAgICAlOSJwRCJkICU5InBEImRcbiIsCisgICAgICAgICBDSEFSUE9TIChyb3ct PnN0YXJ0LnN0cmluZ19wb3MpLAorICAgICAgICAgQ0hBUlBPUyAocm93LT5lbmQuc3RyaW5nX3Bv cykpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICAgICU5ZCAlOWRcbiIsIHJvdy0+c3RhcnQu ZHB2ZWNfaW5kZXgsCisgICAgICAgICByb3ctPmVuZC5kcHZlY19pbmRleCk7CisgICAgfQorICBp ZiAoZ2x5cGhzID4gMSkKKyAgICB7CisgICAgICBpbnQgYXJlYTsKKyAgICAgIGZvciAoYXJlYSA9 IExFRlRfTUFSR0lOX0FSRUE7IGFyZWEgPCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAgeworICAgIHN0 cnVjdCBnbHlwaCAqZ2x5cGggPSByb3ctPmdseXBoc1thcmVhXTsKKyAgICBzdHJ1Y3QgZ2x5cGgg KmdseXBoX2VuZCA9IGdseXBoICsgcm93LT51c2VkW2FyZWFdOworICAgIC8qIEdseXBoIGZvciBh IGxpbmUgZW5kIGluIHRleHQuICAqLworICAgIGlmIChhcmVhID09IFRFWFRfQVJFQSAmJiBnbHlw aCA9PSBnbHlwaF9lbmQgJiYgZ2x5cGgtPmNoYXJwb3MgPiAwKQorICAgICAgKytnbHlwaF9lbmQ7 CisgICAgaWYgKGdseXBoIDwgZ2x5cGhfZW5kKQorICAgICAgZnByaW50ZiAoc3RkZXJyLCAiR2x5 cGgjL1RvdGFsIFJlbC5YIFQgICAgICAgUG9zIE8gICBXICAgICBDb2RlIEZhY2UgTFIgICAgIFgg ICAgWSBIUE9TIFZQT1MgWlYgQ1xuIik7CisgICAgZm9yICg7IGdseXBoIDwgZ2x5cGhfZW5kOyAr K2dseXBoKQorICAgICAgeworICAgICAgICBtY19kdW1wX2dseXBoIChyb3csIGdseXBoLCBhcmVh LCByZWxhdGl2ZV94KTsKKyAgICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7 CisgICAgICB9CisgIH0KKyAgICB9CisgIGVsc2UgaWYgKGdseXBocyA9PSAxKQorICAgIHsKKyAg ICAgIGludCBhcmVhOworICAgICAgY2hhciBzW1NIUlRfTUFYICsgNF07CisgICAgICBmb3IgKGFy ZWEgPSBMRUZUX01BUkdJTl9BUkVBOyBhcmVhIDwgTEFTVF9BUkVBOyArK2FyZWEpCisgIHsKKyAg ICBpbnQgaTsKKyAgICBmb3IgKGkgPSAwOyBpIDwgcm93LT51c2VkW2FyZWFdOyArK2kpCisgICAg ICB7CisgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSByb3ctPmdseXBoc1thcmVhXSArIGk7 CisgICAgICAgIGlmIChpID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICYmIGFyZWEgPT0g VEVYVF9BUkVBCisgICAgICAmJiBOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgJiYgZ2x5cGgt PnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgJiYgZ2x5cGgtPnUuY2ggPT0gJyAnKQorICAgIHsK KyAgICAgIHN0cmNweSAoJnNbaV0sICJbXFxuXSIpOworICAgICAgaSArPSA0OworICAgIH0KKyAg ICAgICAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgICAmJiBn bHlwaC0+dS5jaCA8IDB4ODAKKyAgICAgICAgICAgJiYgZ2x5c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sICZkMiwgJmQzLCAmZDQsICZkNSwgJnlwb3MpOworICAgICAgaW50IGhlYWRlcl9saW5lX2hl aWdodCA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICAgICAgaW50IHZvZmZzZXQg PSAoaGVhZGVyX2xpbmVfaGVpZ2h0ID4gMAorICAgICAgICAgICAgICAgICAgICAgJiYgeXBvcyA+ IDApCisgICAgICAgICAgICAgICAgICAgICAgPyB5cG9zICsgMQorICAgICAgICAgICAgICAgICAg ICAgIDogeXBvczsKKyAgICAgIGlmICh2aXNpYmxlX3ApCisgICAgICAgIHZwb3MgPSB2b2Zmc2V0 OworICAgICAgICBlbHNlCisgICAgICAgICAgdnBvcyA9IDA7CisgICAgfQorICAgIGVsc2UKKyAg ICAgIHsKKyAgICAgICAgQ0hFQ0tfTlVNQkVSIChyb3cpOworICAgICAgICB2cG9zID0gWEZJWE5V TSAocm93KTsKKyAgICAgIH0KKyAgbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgIGlmICh2 cG9zID49IDAgJiYgdnBvcyA8IG1hdHJpeC0+bnJvd3MpCisgICAgbWNfZHVtcF9nbHlwaF9yb3cg KE1BVFJJWF9ST1cgKG1hdHJpeCwgdnBvcyksCisgICAgICAgIHZwb3MsCisgICAgICAgIFRZUEVf UkFOR0VEX0ZJWE5VTVAgKGludCwgZ2x5cGhzKSA/IFhGSVhOVU0gKGdseXBocykgOiAyKTsKKyAg cmV0dXJuIFFuaWw7Cit9CisKK3ZvaWQKK21jX2R1bXBfZ2x5cGhfbWF0cml4IChzdHJ1Y3QgZ2x5 cGhfbWF0cml4ICptYXRyaXgsIGludCBnbHlwaHMpCit7CisgIGludCBpOworICBmb3IgKGkgPSAw OyBpIDwgbWF0cml4LT5ucm93czsgKytpKQorICAgIG1jX2R1bXBfZ2x5cGhfcm93IChNQVRSSVhf Uk9XIChtYXRyaXgsIGkpLCBpLCBnbHlwaHMpOworfQorCitERUZVTiAoIm1jLWR1bXAtZ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29yLmhwb3MsIHctPmN1cnNvci52cG9zKTsKKyAgZnByaW50ZiAoc3Rk ZXJyLCAiPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4iKTsK KyAgbWNfZHVtcF9nbHlwaF9tYXRyaXggKHctPmN1cnJlbnRfbWF0cml4LAorCQkgICAgIFRZUEVf UkFOR0VEX0ZJWE5VTVAgKGludCwgZ2x5cGhzKSA/IFhGSVhOVU0gKGdseXBocykgOiAwKTsKKyAg cmV0dXJuIFFuaWw7Cit9CisKK3N0YXRpYyB2b2lkCittY19oZWxwZXIgKHN0cnVjdCB3aW5kb3cg KncsIGludCB4LCBpbnQgZngsIGludCB5LCBpbnQgZnksIGludCBocG9zLAorICAgICAgICAgICBp bnQgdnBvcywgaW50IGgsIGVudW0gdGV4dF9jdXJzb3Jfa2luZHMgY3Vyc29yX3R5cGUsIGludCBj dXJzb3Jfd2lkdGgsCisgICAgICAgICAgIExpc3BfT2JqZWN0IGZvcmVncm91bmQsIExpc3BfT2Jq ZWN0IGJhY2tncm91bmQsIGJvb2wgYWN0aXZlX2N1cnNvcl9wLAorICAgICAgICAgICBib29sIG1p bmltYWxfcCwgaW50IGZsYXZvciwgaW50IHBvc2ludCwgTGlzcF9PYmplY3QgKnJlc3VsdCkKK3sK KyAgYm9vbCBtY19zdGRlcnJfcCA9ICFOSUxQIChCVkFSIChjdXJyZW50X2J1ZmZlciwgbWNfc3Rk ZXJyKSk7CisgIExpc3BfT2JqZWN0IHdpbmRvdzsKKyAgWFNFVFdJTkRPVyAod2luZG93LCB3KTsK KyAgTGlzcF9PYmplY3Qgd2luZG93X3N0cmluZyA9IEZwcmluMV90b19zdHJpbmcgKHdpbmRvdywg UW5pbCk7CisgIGNoYXIgKndpbmRvd19jaGFyID0gU1NEQVRBICh3aW5kb3dfc3RyaW5nKTsKKyAg ZG91YmxlIHJlZF9mZyA9IFhGTE9BVF9EQVRBIChBUkVGIChmb3JlZ3JvdW5kLCAwKSk7Cisg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3IgPT0gTUNfVkVSVElDQUxfQkFSCisgICAgICA/ ICJNQ19WRVJUSUNBTF9CQVIiCisgICAgOiBmbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tT TEFTSAorICAgICAgPyAiTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSCIKKyAgICA6ICJPT1BTIiks CisgIHBvc2ludCwKKyAgcmVkX2ZnLCBncmVlbl9mZywgYmx1ZV9mZywgcmVkX2JnLCBncmVlbl9i ZywgYmx1ZV9iZyk7CisgIGJvb2wgcmVtb3ZlX3AgPSBmYWxzZTsKKyAgbWNfZHJhd19lcmFzZV9o eWJyaWQgKHcsIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgaCwgY3Vyc29yX3R5cGUsCisgICAg ICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGFjdGl2ZV9jdXJz b3JfcCwgbWluaW1hbF9wLAorICAgICAgICAgICAgICAgICAgICAgICAgZmxhdm9yLCBwb3NpbnQs IHJlbW92ZV9wKTsKKyAgTGlzcF9PYmplY3QgZmlmdGVlbl9lbGVtZW50cyA9IGxpc3RuIChDT05T VFlQRV9IRUFQLCAxNSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg bWFrZV9maXhudW0gKHgpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBtYWtlX2ZpeG51bSAoZngpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBtYWtlX2ZpeG51bSAoeSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIG1ha2VfZml4bnVtIChmeSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIG1ha2VfZml4bnVtIChocG9zKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgbWFrZV9maXhudW0gKHZwb3MpLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBtYWtlX2ZpeG51bSAoaCksCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIG1jX2N1cnNvcl90eXBlX3RvX2xpc3AgKGN1cnNvcl90eXBl KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFrZV9maXhudW0g KGN1cnNvcl93aWR0aCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJh Y2tncm91bmQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ha2Vf Zml4bnVtIChhY3RpdmVfY3Vyc29yX3ApLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBtYWtlX2ZpeG51bSAobWluaW1hbF9wKSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgbWFrZV9maXhudW0gKGZsYXZvciksCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ha2VfZml4bnVtIChwb3NpbnQpKTsKKyAgKnJl c3VsdCA9IEZjb25zIChmaWZ0ZWVuX2VsZW1lbnRzLCAqcmVzdWx0KTsKK30KKworLyogUmV0dXJu IGEgcG9pbnRlciB0byB0aGUgZ2x5cGggVydzIHBoeXNpY2FsIGN1cnNvciBpcyBvbi4gIFZhbHVl IGlzCisgICBudWxsIGlmIFcncyBjdXJyZW50IG1hdHJpeCBpcyBpbnZhbGlkLCBzbyB0aGF0IG5v IG1lYW5pbmdmdWwgZ2x5cGgKKyAgIGNhbiBiZSByZXR1cm5lZC4gICovCisKK3N0cnVjdCBnbHlw aCAqCittY19nZXRfcGh5c19jdXJzb3JfZ2x5cGggKHN0cnVjdCB3aW5kb3cgKncsIGludCB4LCBp bnQgaHBvcywgaW50IHZwb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yc29yLgorICAgICAgQXMgdG8g RlJBTUVfTElORV9IRUlHSFQgdmVyc3VzIGdseXBoX3Jvdy0+dmlzaWJsZV9oZWlnaHQsIHByZWZl ciB0aGUgTUFYLiAqLworICAgICAgaDAgPSBtYXggKEZSQU1FX0xJTkVfSEVJR0hUIChmKSwgZ2x5 cGhfcm93LT52aXNpYmxlX2hlaWdodCk7CisgICAgICBoX3RlbXAgPSBtYXggKGgwLCBhc2NlbnQg KyBzY3JhdGNoX2dseXBocy0+ZGVzY2VudCk7CisgICAgICBoMCA9IG1pbiAoaDAsIGFzY2VudCAr IHNjcmF0Y2hfZ2x5cGhzLT5kZXNjZW50KTsKKyAgICAgIHkwID0gV0lORE9XX0hFQURFUl9MSU5F X0hFSUdIVCAodyk7CisgICAgICBpZiAoeSA8IHkwKQorICAgICAgICB7CisgICAgICAgICAgaF90 ZW1wID0gbWF4IChoX3RlbXAgLSAoeTAgLSB5KSArIDEsIGgwKTsKKyAgICAgICAgICB5ID0geTAg LSAxOworICAgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICB5MCA9IHdp bmRvd190ZXh0X2JvdHRvbV95ICh3KSAtIGgwOworICAgICAgICAgIGlmICh5ID4geTApCisgICAg ICAgICAgICB7CisgICAgICAgICAgICAgIGhfdGVtcCArPSB5IC0geTA7CisgICAgICAgICAgICAg IHkgPSB5MDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgKmZ4ID0gV0lORE9XX1RF WFRfVE9fRlJBTUVfUElYRUxfWCAodywgeCk7CisgICAgICAqZnkgPSBXSU5ET1dfVE9fRlJBTUVf UElYRUxfWSAodywgeSk7CisgICAgICAqaCA9IGhfdGVtcDsKKyAgICAgIGlmIChjdXJzb3JfdHlw ZSA9PSBIQkFSX0NVUlNPUikKKyAgICAgICAgeworICAgICAgICAgIGludCBjdXJzb3JfaGVpZ2h0 ID0gKGN1cnNvcl93aWR0aCA8IDEpID8gbHJpbnQgKDAuMjUgKiA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GludCBvcG9pbnRfaHBv cyA9IHctPm91dHB1dF9jdXJzb3IuaHBvczsKKyAgaW50IG9wb2ludF92cG9zID0gdy0+b3V0cHV0 X2N1cnNvci52cG9zOworICBMaXNwX09iamVjdCBjaGFyYWN0ZXIgPSAoQ0hBUkFDVEVSUCAobWFr ZV9maXhudW0gKGdseXBoLT51LmNoKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgID8gRmNo YXJfdG9fc3RyaW5nIChtYWtlX2ZpeG51bSAoZ2x5cGgtPnUuY2gpKQorICAgICAgICAgICAgICAg ICAgICAgICAgICA6IFFuaWw7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUp OworICBMaXNwX09iamVjdCBidWYgPSB3LT5jb250ZW50czsKKyAgQ0hFQ0tfQlVGRkVSIChidWYp OworICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAoYnVmKTsKKyAgaW50IHRleHRfYXJlYV93 aWR0aCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgIGludCBmcmFtZV9jaGFy X3dpZHRoID0gRlJBTUVfQ09MVU1OX1dJRFRIIChmKTsKKyAgYm9vbCBmaWxsX2NvbHVtbl9wID0g IU5JTFAgKEJWQVIgKGIsIGZpbGxfY29sdW1uKSk7CisgIGludCBmaWxsX2NvbCA9IFhGSVhOVU0g KEJWQVIgKGIsIGZpbGxfY29sdW1uKSk7CisgIGludCBmaWxsX2NvbHVtbl94ID0gKGZpbGxfY29s dW1uX3ApCisgICAgICAgICAgICAgICAgICAgICAgPyBmaWxsX2NvbCAqIGZyYW1lX2NoYXJfd2lk dGgKKyAgICAgICAgICAgICAgICAgICAgICA6IDA7CisgIGludCB0ZW1wX3ggPSByZWxhdGl2ZV94 OworICBpbnQgdGVtcF95ID0gcm93LT55OworICBpbnQgdGVtcF9ocG9zID0gZ2x5cGggLSByb3ct PmdseXBoc1tURVhUX0FSRUFdOworICBpbnQgdGVtcF92cG9zID0gTUFUUklYX1JPV19WUE9TIChy b3csIHctPmN1cnJlbnRfbWF0cml4KTsKKyAgaW50IHRlbXBfZmFjZV9pZCA9IGdseXBoLT5mYWNl X2lkOworICBpbnQgdGVtcF9jaGFycG9zID0gZ2x5cGgtPmNoYXJwb3M7CisKKy8qIC0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgIEJFR0lOOiAgQ0hBUl9HTFlQ SCB8IEdMWVBITEVTU19HTFlQSCAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0gKi8KKyAgaWYgKGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgIHx8IGdseXBo LT50eXBlID09IEdMWVBITEVTU19HTFlQSCkKKyAgeworICAgIGlmIChtY19zdGRlcnJfcCkKKyAg ICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQgJWMgJTki cEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNkICVzICVz XG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgo cm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAg ICByZWxhdGl2ZV94LAorICAgICAgICAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAg ICAgPyAnQycKKyAgICAgICAgIDogJ0cnKSwKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAg ICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAgIDog KFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAg OiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAg ICAgICA6ICctJykpKSwKKyAgICAgICAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAg ICBnbHlwaC0+dS5jaCwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5s ZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAg ICBnbHlwaC0+eCwgZ2x5cGgtPnksIGdseXBoLT5ocG9zLCBnbHlwaC0+dnBvcywgZ2x5cGgtPnp2 X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgKCghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAg JiYgZ2x5cGgtPnUuY2ggPT0gOSkKKyAgICAgICAgICAgPyAiXFx0IgorICAgICAgICAgOiAoIU5J TFAgKGNoYXJhY3RlcikKKyAgICAgICAgICAgICYmIGdseXBoLT51LmNoID09IDEwKQorICAgICAg ICAgICA/ICJcXG4iCisgICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAg JiYgZ2x5cGgtPnUuY2ggPT0gMzIpCisgICAgICAgICAgID8gIlxccyIKKyAgICAgICAgIDogKCFO SUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAmJiBnbHlwaC0+dS5jaCAhPSA5CisgICAgICAg ICAgICAmJiBnbHlwaC0+dS5jaCAhPSAxMAorICAgICAgICAgICAgJiYgZ2x5cGgtPnUuY2ggIT0g MzIpCisgICAgICAgICAgID8gU1NEQVRBIChjaGFyYWN0ZXIpCisgICAgICAgICA6ICJcXD8iKSk7 CisgIHN3aXRjaCAoYWN0aW9uX3R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gICAgY2FzZSBIT1JJWk9O VEFMX1JVTEVSOgorICAgIHsKKyAgICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKG9wb2lu dF94ID09IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9w b2ludF9ocG9zID09IHRlbXBfaHBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgb3BvaW50X3kgPT0gZ2x5cGgtPnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIG9wb2ludF92cG9zID09IHRlbXBfdnBvcyk7CisgICAgICBpbnQgX2Z4LCBmeSwgX2gsIF93 ZDsKKyAgICAgIG1jX2dldF9waHlzX2N1cnNvcl9nZW9tZXRyeSAodywgcm93LCB0ZW1wX3gsICZf ZngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBfeSwgJmZ5LCB0ZW1w X2hwb3MsIHRlbXBfdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJl9o LCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCAmX3dkKTsKKyAgICAgIGlmICh0ZW1wX3ggPD0g dGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAg ICAgbWNfaGVscGVyICh3LCB0ZW1wX3gsIC0xLCB0ZW1wX3ksIGZ5LCB0ZW1wX2hwb3MsIHRlbXBf dnBvcywKKyAgICAgICAgICAgICAgICAgICAtMSwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwg Zm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgICBtY19iZ19sc2wgKHcsIHRlbXBfZmFjZV9p ZCksIGFjdGl2ZV9jdXJzb3JfcCwKKyAgICAgICAgICAgICAgICAgICBtaW5pbWFsX3AsIE1DX0dM WVBILCB0ZW1wX2NoYXJwb3MsIHJlc3VsdCk7CisgICAgICAvKiBJdCBpcyBwb3NzaWJsZSB0byB1 c2UgTUNfR0xZUEggYW5kIGFkanVzdCB0aGUgZnggY29vcmRpbmF0ZTsgaG93ZXZlciwKKyAgICAg IHRoZSBtaWRkbGUtZG90IC8gc3BhY2UgZ2x5cGggb24gYSB3b3JkLXdyYXBwZWQgbGluZSB3aWxs IGJlIG92ZXJ3cml0dGVuCisgICAgICBudW1lcm91cyB0aW1lcyBhbmQgaXMgdW5zaWdodGx5LiAq LworICAgICAgaWYgKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRb YXJlYV0gLSAxKQorICAgICAgICB7CisgICAgICAgICAgaW50IF9meCwgZnksIF9oLCBfd2Q7Cisg ICAgICAgICAgbWNfZ2V0X3BoeXNfY3Vyc29yX2dlb21ldHJ5ICh3LCByb3csIHRlbXBfeCwgJl9m eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBfeSwgJmZ5LCB0 ZW1wX2hwb3MsIHRlbXBfdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICZfaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgJl93ZCk7CisgICAgICAgICAgdGVt cF94ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICB3aGlsZSAodGVtcF94IDw9IHRl eHRfYXJlYV93aWR0aCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbWNfaGVscGVyICh3 LCB0ZW1wX3gsIC0xLCB0ZW1wX3ksIGZ5LCB0ZW1wX2hwb3MsIHRlbXBfdnBvcywKKyAgICAgICAg ICAgICAgICAgICAgICAgICAtMSwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3Vu ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBtY19iZ19sc2wgKHcsIHRlbXBfZmFjZV9pZCks IGFjdGl2ZV9jdXJzb3JfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBtaW5pbWFsX3AsIE1D X0dMWVBITEVTUywgdGVtcF9jaGFycG9zLCByZXN1bHQpOworICAgICAgICAgICAgICAvKiBgdy0+ cGh5c19jdXJzb3Jfd2lkdGhgIGlzIGRldGVybWluZWQgYnkgYGdseXBoLT5waXhlbF93aWR0aGAs CisgICAgICAgICAgICAgIGFuZCB0aGUgc3BhY2UgYXBwZW5kZWQgdG8gYSBsaW5lIGVuZGluZyBp biBFT0wgaXMgbm90IG5lY2Vzc2FyaWx5CisgICAgICAgICAgICAgIHRoZSBzYW1lIGFzIHRoZSBm cmFtZS1jaGFyLXdpZHRoOyBlLmcuLCB2YXJpYWJsZSB3aXRoIGZvbnQuICBUaHVzLAorICAgICAg ICAgICAgICB3ZSBtdXN0IHVzZSB0aGUgYGdseXBoLT5waXhlbF93aWR0aGAgdG8gYXZvaWQgYmxh bmsgc3BhY2VzIGJldHdlZW4KKyAgICAgICAgICAgICAgdGhlIGZsb2F0aW5nIGhiYXIgZmFrZSBj dXJzb3JzLiAqLworICAgICAgICAgICAgICB0ZW1wX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOwor ICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgVkVSVElDQUxfUlVMRVI6ICBDSEFSX0dM WVBIIHwgR0xZUEhMRVNTX0dMWVBIICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tICovCisgICAgY2FzZSBWRVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAgICAvK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5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJU SUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfaW5fZnJp bmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPmNvbnRpbnVlZF9wKQorICAgICAg ICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgICAg ICAgICAgOiAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgIXJv dy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT5j b250aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAg ICAgICAgICAgICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+ dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeCA+IHJlbGF0 aXZlX3gpCisgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAg ICAgICAgIDogKHp2X3ApCisgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAg ICAgICAgICAgICAgICAgIDogTUNfR0xZUEg7CisgICAgICBpbnQgdGVtcF94ID0gKGdseXBoIC0g cm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAg ICAgICAgICAgICYmIG9wb2ludF94ID4gcmVsYXRpdmVfeCkKKyAgICAgICAgICAgICAgICAgICAg PyBvcG9pbnRfeAorICAgICAgICAgICAgICAgICAgICA6IHJlbGF0aXZlX3g7CisgICAgICBpZiAo Zmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGZsYXZv ciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgfHwgZmxhdm9yID09IE1D X1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgY3Vyc29yX3R5cGUgPSBSSUdIVF9GUklOR0VfQklUTUFQ OworICAgICAgaW50IF9meCwgX2Z5LCBoLCBfd2Q7CisgICAgICBtY19nZXRfcGh5c19jdXJzb3Jf Z2VvbWV0cnkgKHcsIHJvdywgdGVtcF94LCAmX2Z4LAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICB0ZW1wX3ksICZfZnksIHRlbXBfaHBvcywgdGVtcF92cG9zLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwg Jl93ZCk7CisgICAgICBpbnQgZnggPSBXSU5ET1dfVEVYVF9UT19GUkFNRV9QSVhFTF9YICh3LCBv cG9pbnRfeCk7CisgICAgICBtY19oZWxwZXIgKHcsIHRlbXBfeCwgZngsIHRlbXBfeSwgLTEsIHRl bXBfaHBvcywgdGVtcF92cG9zLAorICAgICAgICAgICAgICAgICBoLCBjdXJzb3JfdHlwZSwgY3Vy c29yX3dpZHRoLCBmb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICBtY19iZ19sc2wgKHcsIHRl bXBfZmFjZV9pZCksIGFjdGl2ZV9jdXJzb3JfcCwKKyAgICAgICAgICAgICAgICAgbWluaW1hbF9w LCBmbGF2b3IsIHRlbXBfY2hhcnBvcywgcmVzdWx0KTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8q IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICBGSUxMX0NPTFVNTjogIENI QVJfR0xZUEggfCBHTFlQSExFU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l9mcmluZ2VfcCA9 IG9wb2ludF94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoID49IHRleHRfYXJlYV93aWR0aDsKKyAgICAg IGludCBmbGF2b3IgPSAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICYm IHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZF UlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9pbl9m cmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+Y29udGludWVkX3ApCisgICAg ICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICAg ICAgICAgICA6IChjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiAh cm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcAorICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ct PmNvbnRpbnVlZF9wKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVIKKyAg ICAgICAgICAgICAgICAgICA6IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93 LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICYmIGZpbGxfY29sdW1uX3gg PiByZWxhdGl2ZV94KQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAg ICAgICAgICAgICAgICA6ICh6dl9wKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExF U1MKKyAgICAgICAgICAgICAgICAgICA6ICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisg ICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgY3Jvc3NoYWlyc192ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICAgJiYg b3BvaW50X3kgPT0gdGVtcF95CisgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3Zwb3Mg PT0gdGVtcF92cG9zKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAg ICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgaW50IHRlbXBfeCA9IChnbHlwaCAtIHJv dy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAg ICAgICAgICAmJiBmaWxsX2NvbHVtbl94ID4gcmVsYXRpdmVfeCkKKyAgICAgICAgICAgICAgICAg ICAgPyBmaWxsX2NvbHVtbl94CisgICAgICAgICAgICAgICAgICAgIDogcmVsYXRpdmVfeDsKKyAg ICAgIGlmIChmbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAg fHwgZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICB8fCBmbGF2 b3IgPT0gTUNfVkVSVElDQUxfQkFSKQorICAgICAgICBjdXJzb3JfdHlwZSA9IFJJR0hUX0ZSSU5H RV9CSVRNQVA7CisgICAgICBpbnQgX2Z4LCBfZnksIGgsIF93ZDsKKyAgICAgIG1jX2dldF9waHlz X2N1cnNvcl9nZW9tZXRyeSAodywgcm93LCB0ZW1wX3gsICZfZngsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHRlbXBfeSwgJl9meSwgdGVtcF9ocG9zLCB0ZW1wX3Zwb3MsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZoLCBjdXJzb3JfdHlwZSwgY3Vyc29y X3dpZHRoLCAmX3dkKTsKKyAgICAgIGludCBmeCA9IFdJTkRPV19URVhUX1RPX0ZSQU1FX1BJWE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eXBlID09IFNUUkVUQ0hfR0xZUEgpCisgIHsKKyAg ICBpZiAobWNfc3RkZXJyX3ApCisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICJcbiAl NSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4xZCAl NWQgJTRkICAlM2QgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tU RVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVz ZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ1MnLAorICAgICAg ICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAg ICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAg ICAgID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAg ICAgICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4 ZWxfd2lkdGgsCisgICAgICAgIDB1LAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAg Z2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3As CisgICAgICAgIGdseXBoLT54LCBnbHlwaC0+eSwgZ2x5cGgtPmhwb3MsIGdseXBoLT52cG9zLCBn bHlwaC0+enZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAiXFxTIik7CisgIHN3aXRjaCAoYWN0 aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS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G9wb2ludF94ID09IHJlbGF0aXZl X3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF9ocG9zID09IHRl bXBfaHBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3kgPT0g Z2x5cGgtPnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF92cG9z ID09IHRlbXBfdnBvcyk7CisgICAgICBpbnQgX2Z4LCBmeSwgX2gsIF93ZDsKKyAgICAgIG1jX2dl dF9waHlzX2N1cnNvcl9nZW9tZXRyeSAodywgcm93LCB0ZW1wX3gsICZfZngsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBfeSwgJmZ5LCB0ZW1wX2hwb3MsIHRlbXBfdnBv cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJl9oLCBjdXJzb3JfdHlwZSwg Y3Vyc29yX3dpZHRoLCAmX3dkKTsKKyAgICAgIGlmICh0ZW1wX3ggPD0gdGV4dF9hcmVhX3dpZHRo CisgICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgd2hpbGUgKHRlbXBf eCA8IHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgeworICAgICAg ICAgICAgbWNfaGVscGVyICh3LCB0ZW1wX3gsIC0xLCB0ZW1wX3ksIGZ5LCB0ZW1wX2hwb3MsIHRl bXBfdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgLTEsIGN1cnNvcl90eXBlLCBjdXJzb3Jf d2lkdGgsIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAodywg dGVtcF9mYWNlX2lkKSwgYWN0aXZlX2N1cnNvcl9wLAorICAgICAgICAgICAgICAgICAgICAgICBt aW5pbWFsX3AsIE1DX0dMWVBIX1RBQiwgdGVtcF9jaGFycG9zLCByZXN1bHQpOworICAgICAgICAg ICAgdGVtcF94ICs9IGZyYW1lX2NoYXJfd2lkdGg7CisgICAgICAgICAgfQorICAgICAgICBlbHNl IGlmICh0ZW1wX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGggPCB0ZXh0X2FyZWFfd2lkdGgKKyAgICAg ICAgICAgICAgICAgJiYgcmVhbF9mYWtlX2N1cnNvcl9wCisgICAgICAgICAgICAgICAgICYmIGds eXBoLT5waXhlbF93aWR0aCA+IGZyYW1lX2NoYXJfd2lkdGgpCisgICAgICAgICAgeworICAgICAg ICAgICAgdGVtcF94ICs9IGZyYW1lX2NoYXJfd2lkdGg7CisgICAgICAgICAgICB3aGlsZSAodGVt cF94IDwgcmVsYXRpdmVfeCArIGdseXBoLT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgIG1jX2hlbHBlciAodywgdGVtcF94LCAtMSwgdGVtcF95LCBmeSwgdGVt cF9ocG9zLCB0ZW1wX3Zwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAtMSwgY3Vyc29y X3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgIG1jX2JnX2xzbCAodywgdGVtcF9mYWNlX2lkKSwgYWN0aXZlX2N1cnNvcl9wLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgbWluaW1hbF9wLCBNQ19HTFlQSF9UQUIsIHRlbXBfY2hhcnBv cywgcmVzdWx0KTsKKyAgICAgICAgICAgICAgICB0ZW1wX3ggKz0gZnJhbWVfY2hhcl93aWR0aDsK KyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgIC8qIEl0IGlzIHBvc3NpYmxlIHRv IHVzZSBNQ19HTFlQSCBhbmQgYWRqdXN0IHRoZSBmeCBjb29yZGluYXRlOyBob3dldmVyLAorICAg ICAgdGhlIG1pZGRsZS1kb3QgLyBzcGFjZSBnbHlwaCBvbiBhIHdvcmQtd3JhcHBlZCBsaW5lIHdp bGwgYmUgb3ZlcndyaXR0ZW4KKyAgICAgIG51bWVyb3VzIHRpbWVzIGFuZCBpcyB1bnNpZ2h0bHku ICovCisgICAgICBpZiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNl ZFthcmVhXSAtIDEpCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgX2Z4LCBmeSwgX2gsIF93ZDsK KyAgICAgICAgICBtY19nZXRfcGh5c19jdXJzb3JfZ2VvbWV0cnkgKHcsIHJvdywgdGVtcF94LCAm X2Z4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcF95LCAmZnks IHRlbXBfaHBvcywgdGVtcF92cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJl9oLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCAmX3dkKTsKKyAgICAgICAgICAv KiB0ZW1wX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOyAqLworICAgICAgICAgIHdoaWxlICh0ZW1w X3ggPD0gdGV4dF9hcmVhX3dpZHRoKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19o ZWxwZXIgKHcsIHRlbXBfeCwgLTEsIHRlbXBfeSwgZnksIHRlbXBfaHBvcywgdGVtcF92cG9zLAor ICAgICAgICAgICAgICAgICAgICAgICAgIC0xLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBm b3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAodywgdGVtcF9m YWNlX2lkKSwgYWN0aXZlX2N1cnNvcl9wLAorICAgICAgICAgICAgICAgICAgICAgICAgIG1pbmlt YWxfcCwgTUNfR0xZUEhMRVNTLCB0ZW1wX2NoYXJwb3MsIHJlc3VsdCk7CisgICAgICAgICAgICAg IHRlbXBfeCArPSBmcmFtZV9jaGFyX3dpZ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b3IganVzdCBvbmUgc3BhY2Ug aWYgdGhlcmUgYXJlIG5vIGxpbmUgbnVtYmVycy4gKi8KKyAgICAgIGJvb2wgenZfcCA9IChnbHlw aCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAg ICAgICAgICAgICAgICYmIE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgPT0gWlYpOworICAg ICAgYm9vbCBjdXJzb3JfaW5fZnJpbmdlX3AgPSBvcG9pbnRfeCArIGdseXBoLT5waXhlbF93aWR0 aCA+PSB0ZXh0X2FyZWFfd2lkdGg7CisgICAgICBpbnQgZmxhdm9yID0gKGN1cnNvcl9pbl9mcmlu Z2VfcAorICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQor ICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAg ICAgICAgICAgICAgICA6IChjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAg ICAmJiByb3ctPmNvbnRpbnVlZF9wKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNB TF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2luX2ZyaW5nZV9w CisgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3AKKyAg ICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgICAg ICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGggLSBy b3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAg ICAgICAgICAgICAmJiBvcG9pbnRfeCA+IHJlbGF0aXZlX3gpCisgICAgICAgICAgICAgICAgICAg ICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgIDogKHp2X3ApCisgICAgICAgICAg ICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgIDogTUNfR0xZUEhf VEFCOworICAgICAgaW50IHRlbXBfeCA9IG9wb2ludF94OworICAgICAgaWYgKGZsYXZvciA9PSBN Q19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBmbGF2b3IgPT0gTUNfVkVS VElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgIHx8IGZsYXZvciA9PSBNQ19WRVJUSUNBTF9C QVIpCisgICAgICAgIGN1cnNvcl90eXBlID0gUklHSFRfRlJJTkdFX0JJVE1BUDsKKyAgICAgIGlu dCBfZngsIF9meSwgaCwgX3dkOworICAgICAgbWNfZ2V0X3BoeXNfY3Vyc29yX2dlb21ldHJ5ICh3 LCByb3csIHRlbXBfeCwgJl9meCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg dGVtcF95LCAmX2Z5LCB0ZW1wX2hwb3MsIHRlbXBfdnBvcywKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJmgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsICZfd2QpOworICAg ICAgaW50IGZ4ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgb3BvaW50X3gpOwor ICAgICAgbWNfaGVscGVyICh3LCB0ZW1wX3gsIGZ4LCB0ZW1wX3ksIC0xLCB0ZW1wX2hwb3MsIHRl bXBfdnBvcywKKyAgICAgICAgICAgICAgICAgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwg Zm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgbWNfYmdfbHNsICh3LCB0ZW1wX2ZhY2VfaWQp LCBhY3RpdmVfY3Vyc29yX3AsCisgICAgICAgICAgICAgICAg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lkdGgsCisgICAgICAg b3IganVzdCBvbmUgc3BhY2UgaWYgdGhlcmUgYXJlIG5vIGxpbmUgbnVtYmVycy4gKi8KKyAgICAg IGJvb2wgenZfcCA9IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2Vk W2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICYmIE1BVFJJWF9ST1dfRU5EX0NIQVJQT1Mg KHJvdykgPT0gWlYpOworICAgICAgYm9vbCBjdXJzb3JfaW5fZnJpbmdlX3AgPSBvcG9pbnRfeCAr IGdseXBoLT5waXhlbF93aWR0aCA+PSB0ZXh0X2FyZWFfd2lkdGg7CisgICAgICBpbnQgZmxhdm9y ID0gKGN1cnNvcl9pbl9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5j YXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJf UklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfaW5fZnJpbmdlX3AKKyAg ICAgICAgICAgICAgICAgICAgICAmJiByb3ctPmNvbnRpbnVlZF9wKQorICAgICAgICAgICAgICAg ICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgICAgICAgICAgOiAo Y3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNh dGVkX29uX3JpZ2h0X3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT5jb250aW51ZWRf cCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAg ICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVh XSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAmJiBmaWxsX2NvbHVtbl94ID4gcmVsYXRpdmVf eCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAg ICAgOiAoenZfcCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAg ICAgICAgICAgICAgOiAoIU5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAg ICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFp cnNfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF95ID09 IHRlbXBfeQorICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF92cG9zID09IHRlbXBfdnBv cykKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhfVEFCCisgICAgICAgICAgICAgICAg ICAgOiBNQ19HTFlQSF9UQUI7CisgICAgICBpbnQgdGVtcF94ID0gZmlsbF9jb2x1bW5feDsKKyAg ICAgIGlmIChmbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAg fHwgZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICB8fCBmbGF2 b3IgPT0gTUNfVkVSVElDQUxfQkFSKQorICAgICAgICBjdXJzb3JfdHlwZSA9IFJJR0hUX0ZSSU5H RV9CSVRNQVA7CisgICAgICBpbnQgX2Z4LCBfZnksIGgsIF93ZDsKKyAgICAgIG1jX2dldF9waHlz X2N1cnNvcl9nZW9tZXRyeSAodywgcm93LCB0ZW1wX3gsICZfZngsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHRlbXBfeSwgJl9meSwgdGVtcF9ocG9zLCB0ZW1wX3Zwb3MsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZoLCBjdXJzb3JfdHlwZSwgY3Vyc29y X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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tICovCisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IElNQUdFX0dMWVBIKQorICB7CisgICAg aWYgKG1jX3N0ZGVycl9wKQorICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiXG4gJTUi cEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNnggJTRkICUxLjFkJTEuMWQgJTVk ICU0ZCAgJTNkICAlM2QgJXMgJWNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVY VF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2Vk W2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdJJywKKyAgICAgICAg Z2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAg ICAgPyAnQicKKyAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAg ICA/ICdTJworICAgICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAg ICAgID8gJzAnCisgICAgICAgICAgICAgICA6ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVs X3dpZHRoLAorICAgICAgICAodW5zaWduZWQgaW50KSBnbHlwaC0+dS5pbWdfaWQsCisgICAgICAg IGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAg ICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBn bHlwaC0+aHBvcywgZ2x5cGgtPnZwb3MsIGdseXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAg ICAgICcuJyk7CisgIHN3aXRjaCAoYWN0aW9uX3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S0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRU5EOiAgSU1BR0Vf R0xZUEggICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LSAqLworCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAg ICAgICAgIEJFR0lOOiAgQ09NUE9TSVRFX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICAgICAq LworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IENP TVBPU0lURV9HTFlQSCkKKyAgeworICAgIGlmIChtY19zdGRlcnJfcCkKKyAgICAgIHsKKyAgICAg ICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAgICJcbiAlNSJwRCJkLyUtNWQgJTVkICVjICU5 InBEImQgJWMgJTNkIDB4JTA2eCIsCisgICAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhU X0FSRUFdLAorICAgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNl ZFthcmVhXSAtIDEpLAorICAgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICAgJysnLAorICAg ICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0 KQorICAgICAgICAgICA/ICdCJworICAgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0 KQorICAgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2Jq ZWN0KQorICAgICAgICAgICAgICAgICA/ICcwJworICAgICAgICAgICAgICAgICA6ICctJykpKSwK KyAgICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgICAgKHVuc2lnbmVkIGludCkg Z2x5cGgtPnUuY21wLmlkKTsKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICU0ZCAlMS4xZCUx LjFkIiwKKyAgICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgICBnbHlwaC0+bGVmdF9i b3hfbGluZV9wLAorICAgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wKTsKKyAgICAgIGlm IChnbHlwaC0+dS5jbXAuYXV0b21hdGljKQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIgJTVk ICU0ZCAgJTNkICAlM2QgJXMgLiBbJWQtJWRdXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAg IGdseXBoLT54LCBnbHlwaC0+eSwgZ2x5cGgtPmhwb3MsIGdseXBoLT52cG9zLCBnbHlwaC0+enZf cCA/ICJaViIgOiAiLS0iLAorICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoLT5zbGljZS5j bXAuZnJvbSwgZ2x5cGgtPnNsaWNlLmNtcC50byk7CisgICAgICAgIGVsc2UKKyAgICAgICAgICBm cHJpbnRmIChzdGRlcnIsICJcbiIpOworICAgICAgfQorICBzd2l0Y2ggKGFjdGlvbl90eXBlKQor ICB7CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICBN VUxUSVBMRV9DVVJTT1JTOiAgQ09NUE9TSVRFX0dMWVBIICAgICAgICAgICAgICAgICAgICAqLwor LyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBNVUxUSVBMRV9DVVJTT1JTOgorICAg IHsKKyAgICAgIG1jX2hlbHBlciAodywgdGVtcF94LCAtMSwgdGVtcF95LCAtMSwgdGVtcF9ocG9z LCB0ZW1wX3Zwb3MsCisgICAgICAgICAgICAgICAgIC0xLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dp ZHRoLCBmb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICBtY19iZ19sc2wgKHcsIHRlbXBfZmFj ZV9pZCksIGFjdGl2ZV9jdXJzb3JfcCwKKyAgICAgICAgICAgICAgICAgbWluaW1hbF9wLCBNQ19H TFlQSCwgdGVtcF9jaGFycG9zLCByZXN1bHQpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgSE9SSVpPTlRBTF9S VUxFUjogIENPTVBPU0lURV9HTFlQSCAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLSAqLworICAgIGNhc2UgSE9SSVpPTlRBTF9SVUxFUjoKKyAgICB7CisgICAgICBi b29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9IChvcG9pbnRfeCA9PSByZWxhdGl2ZV94CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfaHBvcyA9PSB0ZW1wX2hwb3MKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF95ID09IGdseXBoLT55Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfdnBvcyA9PSB0ZW1wX3Zw b3MpOworICAgICAgaW50IF9meCwgZnksIF9oLCBfd2Q7CisgICAgICBtY19nZXRfcGh5c19jdXJz b3JfZ2VvbWV0cnkgKHcsIHJvdywgdGVtcF94LCAmX2Z4LAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICB0ZW1wX3ksICZmeSwgdGVtcF9ocG9zLCB0ZW1wX3Zwb3MsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICZfaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0 aCwgJl93ZCk7CisgICAgICBpZiAodGVtcF94IDw9IHRleHRfYXJlYV93aWR0aAorICAgICAgICAg ICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgdGVtcF94LCAt MSwgdGVtcF95LCBmeSwgdGVtcF9ocG9zLCB0ZW1wX3Zwb3MsCisgICAgICAgICAgICAgICAgICAg LTEsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsCisgICAgICAgICAgICAg ICAgICAgbWNfYmdfbHNsICh3LCB0ZW1wX2ZhY2VfaWQpLCBhY3RpdmVfY3Vyc29yX3AsCisgICAg ICAgICAgICAgICAgICAgbWluaW1hbF9wLCBNQ19HTFlQSCwgdGVtcF9jaGFycG9zLCByZXN1bHQp OworICAgICAgLyogSXQgaXMgcG9zc2libGUgdG8gdXNlIE1DX0dMWVBIIGFuZCBhZGp1c3QgdGhl IGZ4IGNvb3JkaW5hdGU7IGhvd2V2ZXIsCisgICAgICB0aGUgbWlkZGxlLWRvdCAvIHNwYWNlIGds eXBoIG9uIGEgd29yZC13cmFwcGVkIGxpbmUgd2lsbCBiZSBvdmVyd3JpdHRlbgorICAgICAgbnVt ZXJvdXMgdGltZXMgYW5kIGlzIHVuc2lnaHRseS4gKi8KKyAgICAgIGlmIChnbHlwaCAtIHJvdy0+ Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMSkKKyAgICAgICAgeworICAg ICAgICAgIGludCBfZngsIGZ5LCBfaCwgX3dkOworICAgICAgICAgIG1jX2dldF9waHlzX2N1cnNv cl9nZW9tZXRyeSAodywgcm93LCB0ZW1wX3gsICZfZngsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICB0ZW1wX3ksICZmeSwgdGVtcF9ocG9zLCB0ZW1wX3Zwb3MsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmX2gsIGN1cnNvcl90eXBlLCBjdXJz b3Jfd2lkdGgsICZfd2QpOworICAgICAgICAgIHRlbXBfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7 CisgICAgICAgICAgd2hpbGUgKHRlbXBfeCA8PSB0ZXh0X2FyZWFfd2lkdGgpCisgICAgICAgICAg ICB7CisgICAgICAgICAgICAgIG1jX2hlbHBlciAodywgdGVtcF94LCAtMSwgdGVtcF95LCBmeSwg dGVtcF9ocG9zLCB0ZW1wX3Zwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgLTEsIGN1cnNv cl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgICAgICAg ICAgbWNfYmdfbHNsICh3LCB0ZW1wX2ZhY2VfaWQpLCBhY3RpdmVfY3Vyc29yX3AsCisgICAgICAg ICAgICAgICAgICAgICAgICAgbWluaW1hbF9wLCBNQ19HTFlQSExFU1MsIHRlbXBfY2hhcnBvcywg cmVzdWx0KTsKKyAgICAgICAgICAgICAgdGVtcF94ICs9IGZyYW1lX2NoYXJfd2lkdGg7CisgICAg ICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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Byb3ct PnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgJiYgTUFUUklYX1JPV19FTkRfQ0hB UlBPUyAocm93KSA9PSBaVik7CisgICAgICBib29sIGN1cnNvcl9pbl9mcmluZ2VfcCA9IG9wb2lu dF94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoID49IHRleHRfYXJlYV93aWR0aDsKKyAgICAgIGludCBm bGF2b3IgPSAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+ dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FM X0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9pbl9mcmluZ2Vf cAorICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAg ICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICAgICAgICAg ICA6IChjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50 cnVuY2F0ZWRfb25fcmlnaHRfcAorICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPmNvbnRp bnVlZF9wKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAg ICAgICAgICAgICA6IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2Vk W2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF94ID4gcmVsYXRpdmVf eCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAg ICAgOiAoenZfcCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAg ICAgICAgICAgICA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QVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpID09IFpW KTsKKyAgICAgIGJvb2wgY3Vyc29yX2luX2ZyaW5nZV9wID0gb3BvaW50X3ggKyBnbHlwaC0+cGl4 ZWxfd2lkdGggPj0gdGV4dF9hcmVhX3dpZHRoOworICAgICAgaW50IGZsYXZvciA9IChjdXJzb3Jf aW5fZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmln aHRfcCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9X CisgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAg ICAgICAgICAgJiYgcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNf VkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9pbl9m cmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdo dF9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+Y29udGludWVkX3ApCisgICAgICAg ICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgIDogKGds eXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAg ICAgICAgICAgICAgICAgICAgJiYgZmlsbF9jb2x1bW5feCA+IHJlbGF0aXZlX3gpCisgICAgICAg ICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgIDogKHp2X3Ap CisgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAg IDogKCFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAm JiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzX3ZlcnRpY2Fs X3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeSA9PSB0ZW1wX3kKKyAg ICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfdnBvcyA9PSB0ZW1wX3Zwb3MpCisgICAgICAg ICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgIDogTUNfR0xZ UEg7CisgICAgICBpZiAoZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAg ICAgICAgIHx8IGZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAg fHwgZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgY3Vyc29yX3R5cGUgPSBSSUdI VF9GUklOR0VfQklUTUFQOworICAgICAgaW50IF9meCwgX2Z5LCBoLCBfd2Q7CisgICAgICBtY19n ZXRfcGh5c19jdXJzb3JfZ2VvbWV0cnkgKHcsIHJvdywgdGVtcF94LCAmX2Z4LAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wX3ksICZfZnksIHRlbXBfaHBvcywgdGVtcF92 cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmaCwgY3Vyc29yX3R5cGUs IGN1cnNvcl93aWR0aCwgJl93ZCk7CisgICAgICBpbnQgZnggPSBXSU5ET1dfVEVYVF9UT19GUkFN RV9QSVhFTF9YICh3LCBmaWxsX2NvbHVtbl94KTsKKyAgICAgIG1jX2hlbHBlciAodywgdGVtcF94 LCBmeCwgdGVtcF95LCAtMSwgdGVtcF9ocG9zLCB0ZW1wX3Zwb3MsCisgICAgICAgICAgICAgICAg IGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsCisgICAgICAgICAgICAg ICAgIG1jX2JnX2xzbCAodywgdGVtcF9mYWNlX2lkKSwgYWN0aXZlX2N1cnNvcl9wLAorICAgICAg ICAgICAgICAgICBtaW5pbWFsX3AsIGZsYXZvciwgdGVtcF9jaGFycG9zLCByZXN1bHQpOworICAg ICAgYnJlYWs7CisgICAgfQorICB9CisgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyog ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFTkQ6ICBDT01QT1NJVEVfR0xZUEggICAgICAg ICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKworLyogLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQkVHSU46 ICBYV0lER0VUX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLSAqLworICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBYV0lER0VUX0dMWVBIKQor ICB7CisjaWZuZGVmIEhBVkVfWFdJREdFVFMKKyAgICBlYXNzdW1lIChmYWxzZSk7CisjZWxzZQor ICAgIGlmIChtY19zdGRlcnJfcCkKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIlxu ICAlNWQvJS01ZCAlNWQgJTRjICU2ZCAlYyAlM2QgMHglMDV4ICU0ZCAlMS4xZCUxLjFkICU1ZCAl NGQgICUzZCAgJTNkICVzICVjXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRf QVJFQV0sCisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFth cmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAnWCcsCisgICAgICAgIGds eXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAg ID8gJ0InCisgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAg PyAnUycKKyAgICAgICAgICAgIDogJy0nKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwK KyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3As CisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+dS54d2lk Z2V0LAorICAgICAgICBnbHlwaC0+eCwgZ2x5cGgtPnksIGdseXBoLT5ocG9zLCBnbHlwaC0+dnBv cywgZ2x5cGgtPnp2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgJy4nKTsKKyNlbmRpZgorICBz d2l0Y2ggKGFjdGlvbl90eXBlKQorICB7CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAg ICAgICAgICAgICAgICAgICAgICAgTVVMVElQTEVfQ1VSU09SUzogIFhXSURHRVRfR0xZUEggICAg ICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBN VUxUSVBMRV9DVVJTT1JTOgorICAgIHsKKyAgICAgIG1jX2hlbHBlciAodywgdGVtcF94LCAtMSwg dGVtcF95LCAtMSwgdGVtcF9ocG9zLCB0ZW1wX3Zwb3MsCisgICAgICAgICAgICAgICAgIC0xLCBj dXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICBt Y19iZ19sc2wgKHcsIHRlbXBfZmFjZV9pZCksIGFjdGl2ZV9jdXJzb3JfcCwKKyAgICAgICAgICAg ICAgICAgbWluaW1hbF9wLCBNQ19HTFlQSCwgdGVtcF9jaGFycG9zLCByZXN1bHQpOworICAgICAg YnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAg ICAgICAgICAgIEhPUklaT05UQUxfUlVMRVI6ICBYV0lER0VUX0dMWVBIICAgICAgICAgICAgICAg ICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgSE9SSVpPTlRBTF9S VUxFUjoKKyAgICB7CisgICAgICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9IChvcG9pbnRfeCA9 PSByZWxhdGl2ZV94CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRf aHBvcyA9PSB0ZW1wX2hwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9w b2ludF95ID09IGdseXBoLT55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBv cG9pbnRfd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m93LT51c2VkW2FyZWFd IC0gMSkKKyAgICAgICAgeworICAgICAgICAgIGludCBfZngsIGZ5LCBfaCwgX3dkOworICAgICAg ICAgIG1jX2dldF9waHlzX2N1cnNvcl9nZW9tZXRyeSAodywgcm93LCB0ZW1wX3gsICZfZngsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wX3ksICZmeSwgdGVtcF9o cG9zLCB0ZW1wX3Zwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm X2gsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsICZfd2QpOworICAgICAgICAgIHRlbXBfeCAr PSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgd2hpbGUgKHRlbXBfeCA8PSB0ZXh0X2Fy ZWFfd2lkdGgpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIG1jX2hlbHBlciAodywgdGVt cF94LCAtMSwgdGVtcF95LCBmeSwgdGVtcF9ocG9zLCB0ZW1wX3Zwb3MsCisgICAgICAgICAgICAg ICAgICAgICAgICAgLTEsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsCisg ICAgICAgICAgICAgICAgICAgICAgICAgbWNfYmdfbHNsICh3LCB0ZW1wX2ZhY2VfaWQpLCBhY3Rp dmVfY3Vyc29yX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgbWluaW1hbF9wLCBNQ19HTFlQ SExFU1MsIHRlbXBfY2hhcnBvcywgcmVzdWx0KTsKKyAgICAgICAgICAgICAgdGVtcF94ICs9IGZy YW1lX2NoYXJfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGJyZWFrOwor ICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAg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UFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSA9PSBaVik7CisgICAgICBib29sIGN1cnNv cl9pbl9mcmluZ2VfcCA9IG9wb2ludF94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoID49IHRleHRfYXJl YV93aWR0aDsKKyAgICAgIGludCBmbGF2b3IgPSAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAg ICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAg ICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAg IDogKGN1cnNvcl9pbl9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+Y29u dGludWVkX3ApCisgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xB U0gKKyAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAgICAgICAg ICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcAorICAgICAgICAgICAgICAg ICAgICAgICYmICFyb3ctPmNvbnRpbnVlZF9wKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19W RVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICA6IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RF WFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICYm IG9wb2ludF94ID4gcmVsYXRpdmVfeCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhM RVNTCisgICAgICAgICAgICAgICAgICAgOiAoenZfcCkKKyAgICAgICAgICAgICAgICAgICAgID8g TUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIGlmIChm bGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZmxhdm9y ID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICB8fCBmbGF2b3IgPT0gTUNf VkVSVElDQUxfQkFSKQorICAgICAgICBjdXJzb3JfdHlwZSA9IFJJR0hUX0ZSSU5HRV9CSVRNQVA7 CisgICAgICBpbnQgX2Z4LCBfZnksIGgsIF93ZDsKKyAgICAgIG1jX2dldF9waHlzX2N1cnNvcl9n ZW9tZXRyeSAodywgcm93LCB0ZW1wX3gsICZfZngsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHRlbXBfeSwgJl9meSwgdGVtcF9ocG9zLCB0ZW1wX3Zwb3MsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICZoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCAm X3dkKTsKKyAgICAgIGludCBmeCA9IFdJTkRPV19URVhUX1RPX0ZSQU1FX1BJWEVMX1ggKHcsIG9w b2ludF94KTsKKyAgICAgIG1jX2hlbHBlciAodywgdGVtcF94LCBmeCwgdGVtcF95LCAtMSwgdGVt cF9ocG9zLCB0ZW1wX3Zwb3MsCisgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl90eXBlLCBjdXJz b3Jfd2lkdGgsIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAodywgdGVt cF9mYWNlX2lkKSwgYWN0aXZlX2N1cnNvcl9wLAorICAgICAgICAgICAgICAgICBtaW5pbWFsX3As IGZsYXZvciwgdGVtcF9jaGFycG9zLCByZXN1bHQpOworICAgICAgYnJlYWs7CisgICAgfQorLyog LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgRklMTF9D T0xVTU46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3Vyc29yX2luX2ZyaW5nZV9wID0g b3BvaW50X3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGggPj0gdGV4dF9hcmVhX3dpZHRoOworICAgICAg aW50IGZsYXZvciA9IChjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgJiYg cm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVS VElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2luX2Zy aW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT5jb250aW51ZWRfcCkKKyAgICAg ICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAg ICAgICAgIDogKGN1cnNvcl9pbl9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICYmICFy b3ctPnRydW5jYXRlZF9vbl9yaWdodF9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+ Y29udGludWVkX3ApCisgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUgorICAg ICAgICAgICAgICAgICAgIDogKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ct PnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgJiYgZmlsbF9jb2x1bW5feCA+ IHJlbGF0aXZlX3gpCisgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAg ICAgICAgICAgICAgIDogKHp2X3ApCisgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVT UworICAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAg ICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMp LCBjcm9zc2hhaXJzX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAgICAmJiBv cG9pbnRfeSA9PSB0ZW1wX3kKKyAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfdnBvcyA9 PSB0ZW1wX3Zwb3MpCisgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAg ICAgICAgICAgICAgIDogTUNfR0xZUEg7CisgICAgICBpZiAoZmxhdm9yID09IE1DX1ZFUlRJQ0FM X0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJf QkFDS1NMQVNICisgICAgICAgICAgfHwgZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUikKKyAgICAg ICAgY3Vyc29yX3R5cGUgPSBSSUdIVF9GUklOR0VfQklUTUFQOworICAgICAgaW50IF9meCwgX2Z5 LCBoLCBfd2Q7CisgICAgICBtY19nZXRfcGh5c19jdXJzb3JfZ2VvbWV0cnkgKHcsIHJvdywgdGVt cF94LCAmX2Z4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wX3ksICZf ZnksIHRlbXBfaHBvcywgdGVtcF92cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgJl93ZCk7CisgICAgICBpbnQgZngg PSBXSU5ET1dfVEVYVF9UT19GUkFNRV9QSVhFTF9YICh3LCBmaWxsX2NvbHVtbl94KTsKKyAgICAg IG1jX2hlbHBlciAodywgdGVtcF94LCBmeCwgdGVtcF95LCAtMSwgdGVtcF9ocG9zLCB0ZW1wX3Zw b3MsCisgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVn cm91bmQsCisgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAodywgdGVtcF9mYWNlX2lkKSwgY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yc29yX2xpc3BfdHlwZSA9IEJWQVIgKGIsIG1j X3JlYWxfZmFrZV9jdXJzb3IpOworICBlbnVtIHRleHRfY3Vyc29yX2tpbmRzIHRlbXBfY3Vyc29y X3R5cGUgPSAoQ09OU1AgKGN1cnNvcl9saXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBtY19saXNwX3RvX2N1cnNvcl90eXBlIChYQ0FSIChj dXJzb3JfbGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoY3Vyc29yX2xpc3BfdHlwZSk7CisgIGlu dCB0ZW1wX2N1cnNvcl93aWR0aCA9IChDT05TUCAoY3Vyc29yX2xpc3BfdHlwZSkpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IFhGSVhOVU0gKFhDQVIgKFhDRFIgKGN1cnNvcl9saXNwX3R5 cGUpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIDogMTsKKyAgZW51bSBmYWNlX2lkIGN1 cnNvcl9mYWNlX2lkID0KKyAgICAoIWFjdGl2ZV9jdXJzb3JfcAorICAgICAmJiAhTklMUCAoQlZB UiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzX2luYWN0aXZlX3dpbmRvd3MpKSkK KyAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJz b3ItaW5hY3RpdmUtZmFjZSIpLCB0cnVlKQorICAgIDogbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYs IGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1mYWNlIiksIHRydWUpOworICBzdHJ1Y3QgZmFj ZSAqY3Vyc29yX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGN1cnNvcl9mYWNlX2lkKTsKKyAgTGlz cF9PYmplY3Q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cG9zaW50ID0gWEZJWE5VTSAoRm50aCAobWFrZV9maXhudW0gKDApLCBzcGVj cykpOworICAgICAgbGlzcF90eXBlID0gRm50aCAobWFrZV9maXhudW0gKDEpLCBzcGVjcyk7Cisg ICAgICBpZiAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlz cF90b19jdXJzb3JfdHlwZSAoWENBUiAobGlzcF90eXBlKSk7CisgICAgICAgIGVsc2UKKyAgICAg ICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKGxpc3BfdHlwZSk7Cisg ICAgICBpZiAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgIGN1cnNvcl93aWR0aCA9IFhGSVhO VU0gKFhDQVIgKFhDRFIgKGxpc3BfdHlwZSkpKTsKKyAgICAgICAgZWxzZQorICAgICAgICAgIGN1 cnNvcl93aWR0aCA9IDE7CisgICAgICBmb3JlZ3JvdW5kID0gRm50aCAobWFrZV9maXhudW0gKDIp LCBzcGVjcyk7CisgICAgICBpZiAoU1RSSU5HUCAoZm9yZWdyb3VuZCkpCisgICAgICAgIGZvcmVn cm91bmQgPSBtY19jb2xvcl92ZWN0b3JfY2FsYyAodywgZm9yZWdyb3VuZCk7CisgICAgICBzdHJ1 Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAgICAgIGludCBy b3dfc3RhcnQsIHJvd19lbmQsIHdpbmRvd19yb3dfc3RhcnQsIHdpbmRvd19yb3dfZW5kOworICAg ICAgaW50IGk7CisgICAgICBMaXNwX09iamVjdCB0ZW1wID0gUW5pbDsKKyAgICAgIExpc3BfT2Jq ZWN0IHZzcGVjcyA9IFFuaWw7CisgICAgICBmb3IgKGkgPSAwOyBpIDwgbWF0cml4LT5ucm93czsg KytpKQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93ID0gTUFUUklY X1JPVyAobWF0cml4LCBpKTsKKyAgICAgICAgICByb3dfc3RhcnQgPSBNQVRSSVhfUk9XX1NUQVJU X0NIQVJQT1MgKHJvdyk7CisgICAgICAgICAgaWYgKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYm IGkgPT0gMSkKKyAgICAgICAgICAgICAgIHx8IChoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCAmJiBp ID09IDApKQorICAgICAgICAgICAgd2luZG93X3Jvd19zdGFydCA9IHJvd19zdGFydDsKKyAgICAg ICAgICBpZiAoIXJvdy0+ZW5hYmxlZF9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICB3 aW5kb3dfcm93X2VuZCA9IHJvd19lbmQ7CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAg ICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg cm93X2VuZCA9IE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdyk7CisgICAgICAgICAgICAgICAg dGVtcCA9IGxpc3RuIChDT05TVFlQRV9IRUFQLCAzLCBtYWtlX2ZpeG51bSAoaSksCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYWtlX2ZpeG51bSAocm93 X3N0YXJ0KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IG1ha2VfZml4bnVtIChyb3dfZW5kKSk7CisgICAgICAgICAgICAgICAgdnNwZWNzID0gRmNvbnMg KHRlbXAsIHZzcGVjcyk7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKHBv c2ludCA+PSB3aW5kb3dfcm93X3N0YXJ0CisgICAgICAgICAgJiYgcG9zaW50IDw9IHdpbmRvd19y b3dfZW5kKQorICAgICAgICB7CisgICAgICAgIExpc3BfT2JqZWN0IHZsaXN0OworICAgICAgICBm b3IgKHZsaXN0ID0gRm5yZXZlcnNlICh2c3BlY3MpOworICAgICAgICAgICAgIENPTlNQICh2bGlz dCk7CisgICAgICAgICAgICAgdmxpc3QgPSBYQ0RSICh2bGlzdCkpCisgICAgICAgICAgeworICAg ICAgICAgICAgaW50IGNvdW50ID0gWEZJWE5VTSAoRm50aCAobWFrZV9maXhudW0gKDApLCBYQ0FS ICh2bGlzdCkpKTsKKyAgICAgICAgICAgIGludCBwb3Nfc3RhcnQgPSBYRklYTlVNIChGbnRoICht YWtlX2ZpeG51bSAoMSksIFhDQVIgKHZsaXN0KSkpOworICAgICAgICAgICAgaW50IHBvc19lbmQg PSBYRklYTlVNIChGbnRoIChtYWtlX2ZpeG51bSAoMiksIFhDQVIgKHZsaXN0KSkpOworICAgICAg ICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93ID0gTUFUUklYX1JPVyAody0+Y3VycmVudF9tYXRy aXgsIGNvdW50KTsKKyAgICAgICAgICAgIGludCBhcmVhOworICAgICAgICAgICAgaW50IHJlbGF0 aXZlX3ggPSAwOworICAgICAgICAgICAgZm9yIChhcmVhID0gTEVGVF9NQVJHSU5fQVJFQTsgYXJl YSA8IExBU1RfQVJFQTsgKythcmVhKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg c3RydWN0IGdseXBoICpnbHlwaCA9IHJvdy0+Z2x5cGhzW2FyZWFdOworICAgICAgICAgICAgICAg IHN0cnVjdCBnbHlwaCAqZ2x5cGhfZW5kID0gZ2x5cGggKyByb3ctPnVzZWRbYXJlYV07CisgICAg ICAgICAgICAgICAgaWYgKGFyZWEgPT0gVEVYVF9BUkVBICYmIGdseXBoID09IGdseXBoX2VuZCAm JiBnbHlwaC0+Y2hhcnBvcyA+IDApCisgICAgICAgICAgICAgICAgICArK2dseXBoX2VuZDsKKyAg ICAgICAgICAgICAgICBpZiAobWNfc3RkZXJyX3AKKyAgICAgICAgICAgICAgICAgICAgJiYgZ2x5 cGggPCBnbHlwaF9lbmQpCisgICAgICAgICAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsCisiXG5j b3VudCAoJWQpIHwgd2luZG93X3Jvd19zdGFydC9lbmQgKCVkLyVkKSB8IHJvd19zdGFydC9lbmQg KCVkLyVkKVxuXAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PSBNVUxUSVBMRSBDVVJTT1JT ID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXAorR2x5cGgjL1RvdGFsIFJlbC5Y IFQgICAgICAgUG9zIE8gICBXICAgICBDb2RlIEZhY2UgTFIgICAgIFggICAgWSBIUE9TIFZQT1Mg WlYgQ1xuIiwKK2NvdW50LCB3aW5kb3dfcm93X3N0YXJ0LCB3aW5kb3dfcm93X2VuZCwgcG9zX3N0 YXJ0LCBwb3NfZW5kKTsKKyAgICAgICAgICAgICAgICBmb3IgKDsgZ2x5cGggPCBnbHlwaF9lbmQ7 ICsrZ2x5cGgpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmICgo KGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgY291bnQgPiAwKQorICAgICAgICAgICAgICAgICAg ICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAgICAgICAgICAg ICAgJiYgKGdseXBoLT5jaGFycG9zID09IHBvc2ludAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgIC8qIFRoZSBzcGFjZSBhcHBlbmRlZCB0byBhIHJvdyBlbmRpbmcgd2l0aCBhIG5ldyBsaW5l CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9lcyBub3QgaGF2ZSBhIGBnbHlwaC0+Y2hh cnBvc2AgKC0xLCAwKSB0aGF0IHdlIGNhbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVz ZSBmb3IgdGhpcyBwYXJ0aWN1bGFyIGFwcGxpY2F0aW9uLiAgV2hlbiB0aGVyZSBpcyBhCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgYGJ1ZmZlci1kaXNwbGF5LXRhYmxlJyBlbnRyeSB0aGF0 IGFzc2lnbnMgYSB2aXNpYmxlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGggdG8g YSBuZXcgbGluZSwgdGhlcmUgaXMgbm8gcHJvYmxlbSBiZWNhdXNlIHRoYXQKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICBnbHlwaCBoYXMgYSBgZ2x5cGgtPmNoYXJwb3MnIHRoYXQgd2UgY2Fu IHVzZS4gIFdoZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBubyB2aXNpYmxlIEVPTCBn bHlwaCBleGlzdHMsIHdlIHVzZSB0aGUgZm9sbG93aW5nCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgdGVzdDogIHRoZSBhcHBlbmRlZCBzcGFjZSBoYXMgYSBwb3NpdGlvbiB0aGF0IGlzIG9u ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlc3MgdGhhbiB0aGUgZW5kIG9mIHRoZSBt YXRyaXggcm93LiAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChnbHlwaCAtIHJv dy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBwb3NpbnQgPT0gTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAo cm93KSAtIDEpKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGgtPnkgPD0gd2luZG93 X3RleHRfYm90dG9tX3kgKHcpKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICAgICAgICAgIGN1cnJlbnRfY29sID0gbWNfY3VycmVudF9jb2x1bW4gKHcsIHBvc2ludCk7 CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoTklMUCAoZm9yZWdyb3VuZCkpCisgICAgICAg ICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiByZWQg Ki8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY3VycmVudF9jb2wgJSAyICE9IDAK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIWZpbGxfY29sdW1uX3ApCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kID0gb2RkX2NvbG9yX3ZlY3RvcjsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiB5ZWxsb3cgKi8KKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICBpZiAoY3VycmVudF9jb2wgJSAyID09IDAKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgIWZpbGxfY29sdW1uX3ApCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBmb3JlZ3JvdW5kID0gZXZlbl9jb2xvcl92ZWN0b3I7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgLyogcmVkICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN1 cnJlbnRfY29sICUgMiAhPSAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGZp bGxfY29sdW1uX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3VycmVudF9j b2wgPD0gZmlsbF9jb2wpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5k ID0gb2RkX2NvbG9yX3ZlY3RvcjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiB5ZWxs b3cgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY3VycmVudF9jb2wgJSAyID09 IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZmlsbF9jb2x1bW5fcAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJyZW50X2NvbCA8PSBmaWxsX2NvbCkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQgPSBldmVuX2NvbG9yX3Zl Y3RvcjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBncmVlbiAqLworICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGlmIChmaWxsX2NvbHVtbl9wCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIGN1cnJlbnRfY29sID4gZmlsbF9jb2wpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBmb3JlZ3JvdW5kID0gZmlsbF9jb2xvcl92ZWN0b3I7CisgICAgICAgICAg ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIG1jX2VuZ2luZSAocm93 LCBnbHlwaCwgYXJlYSwgcmVsYXRpdmVfeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgdywgcG9zaW50LCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBh Y3RpdmVfY3Vyc29yX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1pbmlt YWxfcCwgTVVMVElQTEVfQ1VSU09SUywgJnJlc3VsdCk7CisgICAgICAgICAgICAgICAgICAgICAg ICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAg ZWxzZSBpZiAobWNfc3RkZXJyX3ApCisgICAgICAgICAgICAgICAgICAgICAgICBtY19kdW1wX2ds eXBoIChyb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94KTsKKyAgICAgICAgICAgICAgICAgICAg cmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICAgIH0KKyAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIGlmICh1cGRh dGluZ19mcmFtZV9wKQorICAgIHVwZGF0ZV9lbmQgKFhGUkFNRSAody0+ZnJhbWUpKTsKKy8qIGB3 LT5tdWx0aXBsZV9jdX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CBzdGFydCwgZW5kOworICBk b3VibGUgY3B1X3RpbWVfdXNlZDsKKyAgY2hhciBidWZfdGltZVtEQkxfQlVGU0laRV9CT1VORF07 CisgIHN0YXJ0ID0gY2xvY2soKTsKKyNlbmRpZgorKi8KKyNpZmRlZiBHTFlQSF9ERUJVRworICBp ZiAodHJhY2VfcmVkaXNwbGF5X3AgJiYgQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAmJiAo IU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbXVsdGlwbGVfY3Vyc29yc19jb25m KSkKKyAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9z c2hhaXJzKSkKKyAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMp LCBtY19maWxsX2NvbHVtbikpKSkKKyAgICB7CisgICAgICBMaXNwX09iamVjdCB3aW5kb3c7Cisg ICAgICBYU0VUV0lORE9XICh3aW5kb3csIHcpOworICAgICAgTGlzcF9PYmplY3Qgd2luZG93X3N0 cmluZyA9IEZwcmluMV90b19zdHJpbmcgKHdpbmRvdywgUW5pbCk7CisgICAgICBjaGFyICp3aW5k b3dfY2hhciA9IFNTREFUQSAod2luZG93X3N0cmluZyk7CisgICAgICBmcHJpbnRmIChzdGRlcnIs ICJtY19lcmFzZV9tdWx0aXBsZV9jdXJzb3JzICglcyk6ICBkZWxldGVfY2FjaGUgKCVkKVxuIiwg d2luZG93X2NoYXIsIGRlbGV0ZV9jYWNoZSk7CisgICAgfQorI2VuZGlmCisgIExpc3BfT2JqZWN0 IHZsaXN0ID0gUW5pbDsKKyAgTGlzcF9PYmplY3QgZmlmdGVlbl9lbGVtZW50cyA9IFFuaWw7Cisg IGludCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIGg7CisgIGVudW0gdGV4dF9jdXJzb3Jfa2lu ZHMgY3Vyc29yX3R5cGU7CisgIGludCBj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hGSVhOVU0gKEZudGggKG1ha2VfZml4bnVtICgxMyksIGZpZnRlZW5fZWxl bWVudHMpKTsKKyAgICAgIHBvc2ludCA9IFhGSVhOVU0gKEZudGggKG1ha2VfZml4bnVtICgxNCks IGZpZnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIGlmIChmbGF2b3IgPT0gTUNfR0xZUEgpCisgICAg ICAgIG1jX2VyYXNlX2dseXBoX2N1cnNvcnMgKHcsIHgsIHksIGhwb3MsIHZwb3MsIGN1cnNvcl90 eXBlLCBjdXJzb3Jfd2lkdGgsIGZsYXZvcik7CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7Cisg ICAgICAgICAgICBib29sIHJlbW92ZV9wID0gdHJ1ZTsKKyAgICAgICAgICAgIG1jX2RyYXdfZXJh c2VfaHlicmlkICh3LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIGgsIGN1cnNvcl90eXBlLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgYmFja2dyb3Vu ZCwgYWN0aXZlX2N1cnNvcl9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1p bmltYWxfcCwgZmxhdm9yLCBwb3NpbnQsIHJlbW92ZV9wKTsKKyAgICAgICAgICB9CisgICAgfQor ICBpZiAodXBkYXRpbmdfZnJhbWVfcCkKKyAgICB1cGRhdGVfZW5kIChYRlJBTUUgKHctPmZyYW1l KSk7CisgIGlmIChkZWxldGVfY2FjaGUpCisgICAgd3NldF9tdWx0aXBsZV9jdXJzb3JzX2NhY2hl ICh3LCBRbmlsKTsKKyAgdy0+bWMuZXJhc2VfbXVsdGlwbGVfY3Vyc29ycyA9IGZhbHNlOworLyoK KyNpZmRlZiBHTFlQSF9ERUJVRworICBlbmQgPSBjbG9jaygpOworICBjcHVfdGltZV91c2VkID0g KChkb3VibGUpIChlbmQgLSBzdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7CisgIGR0b2FzdH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cpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZHJh d19jcm9zc2hhaXJzICglcyk6ICBhY3RpdmVfY3Vyc29yX3AgKCVkKSB8IG1pbmltYWxfcCAoJWQp XG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93X2NoYXIsIGFjdGl2ZV9jdXJzb3Jf cCwgbWluaW1hbF9wKTsKKyAgICB9CisjZW5kaWYKKyAgYm9vbCBtY19zdGRlcnJfcCA9ICFOSUxQ IChCVkFSIChjdXJyZW50X2J1ZmZlciwgbWNfc3RkZXJyKSk7CisgIHB0cmRpZmZfdCBvcG9pbnRf cHQgPSAodyA9PSBYV0lORE9XIChzZWxlY3RlZF93aW5kb3cpKQorICAgICAgICAgICAgICAgICAg ICAgICAgPyBQVAorICAgICAgICAgICAgICAgICAgICAgICAgOiBYRklYTlVNIChGbWFya2VyX3Bv c2l0aW9uICh3LT5wb2ludG0pKTsKKyAgaW50IG9wb2ludF94ID0gdy0+cGh5c19jdXJzb3IueDsK KyAgaW50IG9wb2ludF95ID0gdy0+cGh5c19jdXJzb3IueTsKKyAgaW50IG9wb2ludF9ocG9zID0g dy0+cGh5c19jdXJzb3IuaHBvczsKKyAgaW50IG9wb2ludF92cG9zID0gdy0+cGh5c19jdXJzb3Iu dnBvczsKKyAgc3RydWN0IGdseXBoICpyZWFsX3BoeXNfY3Vyc29yX2dseXBoID0KKyAgICBtY19n ZXRfcGh5c19jdXJzb3JfZ2x5cGggKHcsIG9wb2ludF94LCBvcG9pbnRfaHBvcywgb3BvaW50X3Zw b3MpOworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgTGlzcF9PYmpl Y3QgYnVmID0gdy0+Y29udGVudHM7CisgIENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgc3RydWN0IGJ1 ZmZlciAqYiA9IFhCVUZGRVIgKGJ1Zik7CisgIHN0cnVjdCBidWZmZXIgKm9sZF9idWZmZXIgPSBO VU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X3RocmVlID0gKHctPmN1cnJl bnRfbWF0cml4ICYmIHctPmN1cnJlbnRfbWF0cml4LT5yb3dzKSA/IGZhbHNlIDogdHJ1ZTsKKyAg aWYgKGJhcmZfY3Jhc2hfdGhyZWUpCisgICAgeworICAgICAgaWYgKG9sZF9idWZmZXIpCisgICAg ICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworICAgICAgcmV0dXJuOworICAg IH0KKyAgYm9vbCBiYXJmX2NyYXNoX2ZvdXIgPSAob3BvaW50X3Zwb3MgPj0gMCAmJiBvcG9pbnRf dnBvcyA8IHctPmN1cnJlbnRfbWF0cml4LT5ucm93cykgPyBmYWxzZSA6IHRydWU7CisgIGlmIChi YXJmX2NyYXNoX2ZvdXIpCisgICAgeworICAgICAgaWYgKG9sZF9idWZmZXIpCisgICAgICAgIHNl dF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworICAgICAgcmV0dXJuOworICAgIH0KKyAg aWYgKCFCVUZGRVJQIChidWYpKQorICAgIHsKKyAgICAgIGlmIChvbGRfYnVmZmVyKQorICAgICAg ICBzZXRfYnVmZmVyX2ludGVybmFsIChvbGRfYnVmZmVyKTsKKyAgICAgIHJldHVybjsKKyAgICB9 CisgIGlmIChOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkpCisgICAgeworICAgICAgaWYgKG9s ZF9idWZmZXIpCisgICAgICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworICAg ICAgcmV0dXJuOworICAgIH0KKyAgaWYgKE5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnNfaG9yaXpv bnRhbF9ydWxlcikpCisgICAgICAmJiBOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzX3ZlcnRpY2Fs X3J1bGVyKSkpCisgICAgeworICAgICAgaWYgKG9sZF9idWZmZXIpCisgICAgICAgIHNldF9idWZm ZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworICAgICAgcmV0dXJuOworICAgIH0KKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQkVHSU4gSk9V Uk5FWSAuLi4KKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICBpbnQgZnJhbWVfY2hhcl93aWR0 aCA9IEZSQU1FX0NPTFVNTl9XSURUSCAoZik7CisgIGludCB0ZXh0X2FyZWFfd2lkdGggPSB3aW5k b3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOworICBib29sIGN1cnNvcl9pbl9mcmluZ2VfcCA9 IHctPm91dHB1dF9jdXJzb3IueCArIGZyYW1lX2NoYXJfd2lkdGggPj0gdGV4dF9hcmVhX3dpZHRo OworICBzdHJ1Y3QgZ2x5cGhfcm93ICpnbHlwaF9yb3c7CisgIGludCBjdXJzb3Jfd2lkdGggPSAx OworICBwdHJkaWZmX3QgcG9zaW50ID0gLTE7CisgIHB0cmRpZmZfdCBjdXJyZW50X2NvbCA9IG1j X2N1cnJlbnRfY29sdW1uICh3LCBvcG9pbnRfcHQpOworICBib29sIGZpbGxfY29sdW1uX3AgPSAh TklMUCAoQlZBUiAoYiwgZmlsbF9jb2x1bW4pKTsKKyAgaW50IGZpbGxfY29sID0gWEZJWE5VTSAo QlZBUiAoYiwgZmlsbF9jb2x1bW4pKTsKKyAgaW50IGZpbGxfY29sdW1uX3ggPSAoZmlsbF9jb2x1 bW5fcCkKKyAgICAgICAgICAgICAgICAgICAgICA/IGZpbGxfY29sICogZnJhbWVfY2hhcl93aWR0 aAorICAgICAgICAgICAgICAgICAgICAgIDogMDsKKyAgTGlzcF9PYmplY3QgcmVzdWx0ID0gUW5p bDsKKyAgaW50IGZsYXZvcjsKKyAgLyogVmFsdWVzIGZvciB0aGUgY3VycmVudCBjb2x1bW4gb2Yg dGhlIHZlcnRpY2FsIGxpbmUuICovCisgIExpc3BfT2JqZWN0IGZvcmVncm91bmQgPSBGbWFrZV92 ZWN0b3IgKG1ha2VfZml4bnVtICgzKSwgUW5pbCk7CisgIGVudW0gZmFjZV9pZCBmYWNlX2lkOwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENP TE9SIE9GIENST1NTSEFJUlMKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICBlbnVtIGZhY2Vf aWQgZXZlbl9mYWNlX2lkID0KKyAgICAoIWFjdGl2ZV9jdXJzb3JfcAorICAgICAmJiAhTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzX2luYWN0aXZlX3dpbmRvd3Mp KSkKKyAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLWV2ZW4tbnVtYmVy ZWQtY29sdW1uLWluYWN0aXZlLWZhY2UiKSwgdHJ1ZSkKKyAgICA6IGxvb2t1cF9uYW1lZF9mYWNl ICh3LCBmLCBpbnRlcm4gKCIrLWV2ZW4tbnVtYmVyZWQtY29sdW1uLWZhY2UiKSwgdHJ1ZSk7Cisg IHN0cnVjdCBmYWNlICpldmVuX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGV2ZW5fZmFjZV9pZCk7 CisgIExpc3BfT2JqZWN0IGV2ZW5fY29sb3IgPSBldmVuX2ZhY2UtPmxmYWNlW0xGQUNFX0ZPUkVH Uk9VTkRfSU5ERVhdOworICBDSEVDS19TVFJJTkcgKGV2ZW5fY29sb3IpOworICBMaXNwX09iamVj dCBldmVuX2NvbG9yX3ZlY3RvciA9IG1jX2N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oZWVsLiAgSW5h c211Y2ggYXMgYGVyYXNlX3BoeXNfY3Vyc29yJyB1cGRhdGVzIG1vcmUgdGhhbgorbWVyZWx5IHRo ZSBhZm9yZW1lbnRpb25lZCBjb29yZGluYXRlcywgcmVzZXR0aW5nIHRob3NlIGNvb3JkaW5hdGVz IGFmdGVyIHRoZSBmYWN0CitpcyBpbnN1ZmZpY2llbnQgdG8gZml4IHRoZSBwcm9ibGVtLiAgV2Ug dXNlIGB3LT5vdXRwdXRfY3Vyc29yLngveS9ocG9zL3Zwb3NgCitiZWNhdXNlIHRob3NlIGNvb3Jk aW5hdGVzIGFyZSBjb3JyZWN0LiAgV2UgZml4IGB3LT5waHlzX2N1cnNvci54L3kvaHBvcy92cG9z YAorQkVGT1JFIGNhbGxpbmcgYGVyYXNlX3BoeXNfY3Vyc29yJyBzbyB0aGF0IG90aGVyIGdvb2Rp ZXMgYXJlIHVwZGF0ZWQuICovCisgIGlmICh3LT5oc2Nyb2xsID4gMCkKKyAgICB7CisgICAgICB3 LT5waHlzX2N1cnNvci54ID0gdy0+b3V0cHV0X2N1cnNvci54OworICAgICAgdy0+cGh5c19jdXJz b3IueSA9IHctPm91dHB1dF9jdXJzb3IueTsKKyAgICAgIHctPnBoeXNfY3Vyc29yLmhwb3MgPSB3 LT5vdXRwdXRfY3Vyc29yLmhwb3M7CisgICAgICB3LT5waHlzX2N1cnNvci52cG9zID0gdy0+b3V0 cHV0X2N1cnNvci52cG9zOworICAgIH0KKyAgaWYgKCFtaW5pbWFsX3ApCisgICAgZXJhc2VfcGh5 c19jdXJzb3IgKHcpOworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAg ICAgICAgICAgIFJFUExBQ0UgVEhFIFJFQUwgQ1VSU09SCisqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKyAgZ2x5cGhfcm93ID0gTUFUUklYX1JPVyAody0+Y3VycmVudF9tYXRyaXgsIG9wb2ludF92 cG9zKTsKKyAgaWYgKCFjdXJzb3JfaW5fZnJpbmdlX3ApCisgICAgZmxhdm9yID0gTUNfR0xZUEg7 CisgICAgLyogVGhpcyBjb25kaXRpb24gcHJvYmFibHkgZG9lcyBub3QgZXhpc3QgZm9yIHRoZSBy ZWFsIGZha2UgY3Vyc29yLiAqLworICAgIGVsc2UgaWYgKGN1cnNvcl9pbl9mcmluZ2VfcAorICAg ICAgICAgICAgICYmIGdseXBoX3Jvdy0+Y29udGludWVkX3ApCisgICAgICBmbGF2b3IgPSBNQ19Q SUxDUk9XOworICAgICAgZWxzZSBpZiAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAg ICAmJiBnbHlwaF9yb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICBmbGF2b3IgPSBN Q19IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XOworICAgICAgICBlbHNlIGlmIChjdXJzb3Jf aW5fZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgJiYgIWdseXBoX3Jvdy0+Y29udGludWVkX3AK KyAgICAgICAgICAgICAgICAgJiYgIWdseXBoX3Jvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisg ICAgICAgICAgZmxhdm9yID0gTUNfSE9MTE9XX1JFQ1RBTkdMRTsKKyAgZmFjZV9pZCA9IChyZWFs X3BoeXNfY3Vyc29yX2dseXBoID09IE5VTEwpCisgICAgICAgICAgICAgID8gREVGQVVMVF9GQUNF X0lECisgICAgICAgICAgICAgIDogcmVhbF9waHlzX2N1cnNvcl9nbHlwaC0+ZmFjZV9pZDsKKyAg aW50IG9wb2ludF9meCA9IC0xOworICBpbnQgb3BvaW50X2Z5ID0gLTE7CisgIGludCBvcG9pbnRf aCA9IC0xOworICAvKiBGSVhNRTogIFB1dCBpbiBzb21lIGNvZGUgdG8gZGVmYXVsdCB0byBIT0xM T1dfQk9YX0NVUlNPUiBpZiB0aGUgdXNlciBoYXMKKyAgdW53aXR0aW5nbHkgY29tZSB1cCB3aXRo IHNvbWUgdW5hY2NlcHRhYmxlIGZvcm0gb2YgdW5yZWNvZ25pemVkIGN1cnNvciB0eXBlLiAqLwor ICBMaXNwX09iamVjdCBjdXJzb3JfbGlzcF90eXBlID0gQlZBUiAoYiwgbWNfcmVhbF9mYWtlX2N1 cnNvcik7CisgIGVudW0gdGV4dF9jdXJzb3Jfa2luZHMgdGVtcF9jdXJzb3JfdHlwZSA9IChDT05T UCAoY3Vyc29yX2xpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKFhDQVIgKGN1cnNvcl9saXNwX3R5 cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBtY19s aXNwX3RvX2N1cnNvcl90eXBlIChjdXJzb3JfbGlzcF90eXBlKTsKKyAgaWYgKGZsYXZvciA9PSBN Q19QSUxDUk9XCisgICAgICB8fCBmbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9B UlJPVworICAgICAgfHwgZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEUpCisgICAgdGVtcF9j dXJzb3JfdHlwZSA9IFJJR0hUX0ZSSU5HRV9CSVRNQVA7CisgIGludCBpbml0aWFsX2N1cnNvcl93 aWR0aCA9IChDT05TUCAoY3Vyc29yX2xpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IFhGSVhOVU0gKFhDQVIgKFhDRFIgKGN1cnNvcl9saXNwX3R5cGUpKSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogMTsKKyAgZW51bSBmYWNlX2lkIGN1cnNvcl9mYWNl X2lkID0KKy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gICAgICAgICBvcG9pbnRfdnBv cywgb3BvaW50X2gsIExFRlRfRlJJTkdFX0JJVE1BUCwgaW5pdGlhbF9jdXJzb3Jfd2lkdGgsCisg ICAgICAgICAgICAgZm9yZWdyb3VuZF9sc2wsIG1jX2JnX2xzbCAodywgZmFjZV9pZCksIGFjdGl2 ZV9jdXJzb3JfcCwgbWluaW1hbF9wLAorICAgICAgICAgICAgIE1DX09WRVJMQVlfQVJST1dfQklU TUFQLCBvcG9pbnRfcHQsICZyZXN1bHQpOworICBib29sIHVwZGF0aW5nX2ZyYW1lX3AgPSBmYWxz ZTsKKyAgaWYgKG1pbmltYWxfcCkKKyAgICBnb3RvIGNyb3NzaGFpcnNfZmluaXNoOworICAgIGVs c2UgaWYgKFhGUkFNRSAody0+ZnJhbWUpICE9IFhGUkFNRSAody0+ZnJhbWUpLT5tY191cGRhdGlu Z19mcmFtZSkKKyAgICB7CisgICAgICB1cGRhdGluZ19mcmFtZV9wID0gdHJ1ZTsKKyAgICAgIHVw ZGF0ZV9iZWdpbiAoWEZSQU1FICh3LT5mcmFtZSkpOworICAgIH0KKyAgaWYgKHRlbXBfY3Vyc29y X3R5cGUgPT0gTk9fQ1VSU09SCisgICAgICAmJiAhbWluaW1hbF9wKQorICAgIHsKKyAgICAgIGlu dCBfd2Q7CisgICAgICBpZiAoZmxhdm9yID09IE1DX0dMWVBIKQorICAgICAgICBtY19nZXRfcGh5 c19jdXJzb3JfZ2VvbWV0cnkgKHcsIGdseXBoX3Jvdywgb3BvaW50X3gsICZvcG9pbnRfZngsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3BvaW50X3ksICZvcG9pbnRfZnks IG9wb2ludF9ocG9zLCBvcG9pbnRfdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmb3BvaW50X2gsIEhCQVJfQ1VSU09SLCBpbml0aWFsX2N1cnNvcl93aWR0aCwgJl93 ZCk7CisgICAgICBtY19oZWxwZXIgKHcsIG9wb2ludF94LCBvcG9pbnRfZngsIG9wb2ludF95LCBv cG9pbnRfZnksIG9wb2ludF9ocG9zLAorICAgICAgICAgICAgICAgICBvcG9pbnRfdnBvcywgb3Bv aW50X2gsIEhCQVJfQ1VSU09SLCBjdXJzb3Jfd2lkdGgsIGN1cnNvcl9mZywKKyAgICAgICAgICAg ICAgICAgbWNfYmdfbHNsICh3LCBmYWNlX2lkKSwgYWN0aXZlX2N1cnNvcl9wLCBtaW5pbWFsX3As IGZsYXZvciwKKyAgICAgICAgICAgICAgICAgb3BvaW50X3B0LCAmcmVzdWx0KTsKKyAgICAgIGlm IChmbGF2b3IgPT0gTUNfR0xZUEgpCisgICAgICAgIG1jX2dldF9waHlzX2N1cnNvcl9nZW9tZXRy eSAodywgZ2x5cGhfcm93LCBvcG9pbnRfeCwgJm9wb2ludF9meCwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBvcG9pbnRfeSwgJm9wb2ludF9meSwgb3BvaW50X2hwb3MsIG9w b2ludF92cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZvcG9pbnRf aCwgQkFSX0NVUlNPUiwgaW5pdGlhbF9jdXJzb3Jfd2lkdGgsICZfd2QpOworICAgICAgbWNfaGVs cGVyICh3LCBvcG9pbnRfeCwgb3BvaW50X2Z4LCBvcG9pbnRfeSwgb3BvaW50X2Z5LCBvcG9pbnRf aHBvcywKKyAgICAgICAgICAgICAgICAgb3BvaW50X3Zwb3MsIG9wb2ludF9oLCBCQVJfQ1VSU09S LCBjdXJzb3Jfd2lkdGgsIGN1cnNvcl9mZywKKyAgICAgICAgICAgICAgICAgbWNfYmdfbHNsICh3 LCBmYWNlX2lkKSwgYWN0aXZlX2N1cnNvcl9wLCBtaW5pbWFsX3AsIGZsYXZvciwKKyAgICAgICAg ICAgICAgICAgb3BvaW50X3B0LCAmcmVzdWx0KTsKKyAgICB9CisgICAgZWxzZSBpZiAoIW1pbmlt YWxfcCkKKyAgICAgIHsKKyAgICAgICAgaW50IF93ZDsKKyAgICAgICAgaWYgKGZsYXZvciA9PSBN Q19HTFlQSCkKKyAgICAgICAgICBtY19nZXRfcGh5c19jdXJzb3JfZ2VvbWV0cnkgKHcsIGdseXBo X3Jvdywgb3BvaW50X3gsICZvcG9pbnRfZngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBvcG9pbnRfeSwgJm9wb2ludF9meSwgb3BvaW50X2hwb3MsIG9wb2ludF92cG9z LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF9oLCB0ZW1w X2N1cnNvcl90eXBlLCBpbml0aWFsX2N1cnNvcl93aWR0aCwgJl93ZCk7CisgICAgICAgIG1jX2hl bHBlciAodywgb3BvaW50X3gsIG9wb2ludF9meCwgb3BvaW50X3ksIG9wb2ludF9meSwgb3BvaW50 X2hwb3MsCisgICAgICAgICAgICAgICAgICAgb3BvaW50X3Zwb3MsIG9wb2ludF9oLCB0ZW1wX2N1 cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsCisgICAgICAgICAgICAgICAgICAgY3Vyc29yX2ZnLCBt Y19iZ19sc2wgKHcsIGZhY2VfaWQpLCBhY3RpdmVfY3Vyc29yX3AsIG1pbmltYWxfcCwKKyAgICAg ICAgICAgICAgICAgICBmbGF2b3IsIG9wb2ludF9wdCwgJnJlc3VsdCk7CisgICAgICB9CisgIGlm IChOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzX2hvcml6b250YWxfcnVsZXIpKSkKKyAgICBnb3Rv IHZlcnRpY2FsX3J1bGVyOworICAgIGVsc2UKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAg ICAgICAgICAgICAgIEhPUklaT05UQUwgUlVMRVI6ICBGSVJTVCBYID0+IEVPTAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBhbmQKKyAgICAgICBIT1JJWk9OVEFMIFJVTEVSOiAgRFJB VyBGTE9BVElORyBHTFlQSExFU1MgTElORSAoRU9MIFRPIEZSSU5HRSkKKyoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworICAgIHsKKyAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdyA9IE1BVFJJWF9S T1cgKHctPmN1cnJlbnRfbWF0cml4LCBvcG9pbnRfdnBvcyk7CisgICAgICBpbnQgYXJlYTsKKyAg ICAgIGludCByZWxhdGl2ZV94ID0gMDsKKyAgICAgIGZvciAoYXJlYSA9IExFRlRfTUFSR0lOX0FS RUE7IGFyZWEgPCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVj dCBnbHlwaCAqZ2x5cGggPSByb3ctPmdseXBoc1thcmVhXTsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5 cGggKmdseXBoX2VuZCA9IGdseXBoICsgcm93LT51c2VkW2FyZWFdOworICAgICAgICAgIC8qIEds eXBoIGZvciBhIGxpbmUgZW5kIGluIHRleHQuICAqLworICAgICAgICAgIGlmIChhcmVhID09IFRF WFRfQVJFQSAmJiBnbHlwaCA9PSBnbHlwaF9lbmQgJiYgZ2x5cGgtPmNoYXJwb3MgPiAwKQorICAg ICAgICAgICAgKytnbHlwaF9lbmQ7CisgICAgICAgICAgaWYgKG1jX3N0ZGVycl9wCisgICAgICAg ICAgICAgICYmIGdseXBoIDwgZ2x5cGhfZW5kKQorICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJy LAorIlxuPT09PT09PT09PT09PT09PT09PT09PT09PT09PSBIT1JJWk9OVEFMIFJVTEVSID09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblwKK0dseXBoIy9Ub3RhbCBSZWwuWCBUICAg ICAgIFBvcyBPICAgVyAgICAgQ29kZSBGYWNlIExSICAgICBYICAgIFkgSFBPUyBWUE9TIFpWIENc biIpOworICAgICAgICAgIGZvciAoOyBnbHlwaCA8IGdseXBoX2VuZDsgKytnbHlwaCkKKyAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgbWNfZW5naW5lIChyb3csIGdseXBoLCBhcmVhLCByZWxh dGl2ZV94LAorICAgICAgICAgICAgICAgICAgICAgICAgIHcsIHBvc2ludCwgSEJBUl9DVVJTT1Is IGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYWN0aXZlX2N1cnNvcl9wLAorICAgICAgICAgICAg ICAgICAgICAgICAgIG1pbmltYWxfcCwgSE9SSVpPTlRBTF9SVUxFUiwgJnJlc3VsdCk7CisgICAg ICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAg fQorICAgICAgICB9CisgICAgfQorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAg IFZFUlRJQ0FMIFJVTEVSOiAgQ09NQklOQVRJT04gT0YgR0xZUEggJiBHTFlQSExFU1MgQ1VSU09S UworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisgIHZlcnRpY2FsX3J1bGVyOgorICBpZiAoTklM UCAoQlZBUiAoYiwgY3Jvc3NoYWlyc192ZXJ0aWNhbF9ydWxlcikpCisgICAgICB8fCBmaWxsX2Nv bHVtbl90cnVtcHNfcCkKKyAgICBnb3RvIGNyb3NzaGFpcnNfZmluaXNoOworICAgIGVsc2UKKyAg ICAgIHsKKyAgICAgICAgaW50IGhlYWRlcl9saW5lX2Zvcm1hdCA9IFdJTkRPV19IRUFERVJfTElO RV9IRUlHSFQgKHcpOworICAgICAgICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXggPSB3LT5j dXJyZW50X21hdHJpeDsKKyAgICAgICAgaW50IHJvd19zdGFydCwgcm93X2VuZCwgd2luZG93X3Jv d19zdGFydCwgd2luZG93X3Jvd19lbmQ7CisgICAgICAgIGludCBpOworICAgICAgICBMaXNwX09i amVjdCB0ZW1wID0gUW5pbDsKKyAgICAgICAgTGlzcF9PYmplY3QgdnNwZWNzID0gUW5pbDsKKyAg ICAgICAgZm9yIChpID0gMDsgaSA8IG1hdHJpeC0+bnJvd3M7ICsraSkKKyAgICAgICAgICB7Cisg ICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cgPSBNQVRSSVhfUk9XIChtYXRyaXgsIGkp OworICAgICAgICAgICAgcm93X3N0YXJ0ID0gTUFUUklYX1JPV19TVEFSVF9DSEFSUE9TIChyb3cp OworICAgICAgICAgICAgaWYgKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIGkgPT0gMSkKKyAg ICAgICAgICAgICAgICAgfHwgKGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwICYmIGkgPT0gMCkpCisg ICAgICAgICAgICAgIHdpbmRvd19yb3dfc3RhcnQgPSByb3dfc3RhcnQ7CisgICAgICAgICAgICBp ZiAoIXJvdy0+ZW5hYmxlZF9wKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgd2lu ZG93X3Jvd19lbmQgPSByb3dfZW5kOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAg ICAgICB9CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgICByb3dfZW5kID0gTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KTsKKyAgICAgICAg ICAgICAgICAgIHRlbXAgPSBsaXN0biAoQ09OU1RZUEVfSEVBUCwgMywgbWFrZV9maXhudW0gKGkp LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYWtl X2ZpeG51bSAocm93X3N0YXJ0KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgbWFrZV9maXhudW0gKHJvd19lbmQpKTsKKyAgICAgICAgICAgICAgICAg IHZzcGVjcyA9IEZjb25zICh0ZW1wLCB2c3BlY3MpOworICAgICAgICAgICAgICAgIH0KKyAgICAg ICAgICB9CisgICAgICAgIExpc3BfT2JqZWN0IHZsaXN0OworICAgICAgICBmb3IgKHZsaXN0ID0g Rm5yZXZlcnNlICh2c3BlY3MpOworICAgICAgICAgICAgIENPTlNQICh2bGlzdCk7CisgICAgICAg ICAgICAgdmxpc3QgPSBYQ0RSICh2bGlzdCkpCisgICAgICAgICAgeworICAgICAgICAgICAgaW50 IGNvdW50ID0gWEZJWE5VTSAoRm50aCAobWFrZV9maXhudW0gKDApLCBYQ0FSICh2bGlzdCkpKTsK KyAgICAgICAgICAgIGludCBwb3Nfc3RhcnQgPSBYRklYTlVNIChGbnRoIChtYWtlX2ZpeG51bSAo MSksIFhDQVIgKHZsaXN0KSkpOworICAgICAgICAgICAgaW50IHBvc19lbmQgPSBYRklYTlVNIChG bnRoIChtYWtlX2ZpeG51bSAoMiksIFhDQVIgKHZsaXN0KSkpOworICAgICAgICAgICAgc3RydWN0 IGdseXBoX3JvdyAqcm93ID0gTUFUUklYX1JPVyAody0+Y3VycmVudF9tYXRyaXgsIGNvdW50KTsK KyAgICAgICAgICAgIGludCB0ZW1wX3Zwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgdy0+Y3Vy cmVudF9tYXRyaXgpOworICAgICAgICAgICAgaW50IGFyZWE7CisgICAgICAgICAgICBpbnQgcmVs YXRpdmVfeCA9IDA7CisgICAgICAgICAgICBmb3IgKGFyZWEgPSBMRUZUX01BUkdJTl9BUkVBOyBh cmVhIDwgTEFTVF9BUkVBOyArK2FyZWEpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg ICBzdHJ1Y3QgZ2x5cGggKmdseXBoID0gcm93LT5nbHlwaHNbYXJlYV07CisgICAgICAgICAgICAg ICAgc3RydWN0IGdseXBoICpnbHlwaF9lbmQgPSBnbHlwaCArIHJvdy0+dXNlZFthcmVhXTsKKyAg ICAgICAgICAgICAgICBpZiAoYXJlYSA9PSBURVhUX0FSRUEgJiYgZ2x5cGggPT0gZ2x5cGhfZW5k ICYmIGdseXBoLT5jaGFycG9zID4gMCkKKyAgICAgICAgICAgICAgICAgICsrZ2x5cGhfZW5kOwor ICAgICAgICAgICAgICAgIGlmIChtY19zdGRlcnJfcAorICAgICAgICAgICAgICAgICAgICAmJiBn bHlwaCA8IGdseXBoX2VuZCkKKyAgICAgICAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwKKyJc bmNvdW50ICglZCkgfCB3aW5kb3dfcm93X3N0YXJ0L2VuZCAoJWQvJWQpIHwgcm93X3N0YXJ0L2Vu ZCAoJWQvJWQpXG5cCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PSBWRVJUSUNBTCBSVUxF UiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG5cCitHbHlwaCMvVG90YWwgUmVs LlggVCAgICAgICBQb3MgTyAgIFcgICAgIENvZGUgRmFjZSBMUiAgICAgWCAgICBZIEhQT1MgVlBP UyBaViBDXG4iLAorY291bnQsIHdpbmRvd19yb3dfc3RhcnQsIHdpbmRvd19yb3dfZW5kLCBwb3Nf c3RhcnQsIHBvc19lbmQpOworICAgICAgICAgICAgICAgIGZvciAoOyBnbHlwaCA8IGdseXBoX2Vu ZDsgKytnbHlwaCkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgYm9v bCByZWFsX2Zha2VfY3Vyc29yX3AgPSAob3BvaW50X3kgPT0gZ2x5cGgtPnkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3Zwb3MgPT0gdGVt cF92cG9zKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCgoaGVhZGVyX2xpbmVfZm9ybWF0ID4g MCAmJiBjb3VudCA+IDApCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVf Zm9ybWF0ID09IDApCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAocmVsYXRpdmVfeCArIGds eXBoLT5waXhlbF93aWR0aCA+IG9wb2ludF94CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg fHwgZ2x5cGggPT0gZ2x5cGhfZW5kIC0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIGds eXBoLT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAgICAgICAgICAgICAgICAg ICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgICAgICAgICBtY19lbmdpbmUgKHJvdywgZ2x5cGgsIGFyZWEsIHJlbGF0aXZl X3gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcsIHBvc2ludCwgQkFSX0NV UlNPUiwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBhY3RpdmVfY3Vyc29yX3AsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1pbmltYWxfcCwgVkVSVElDQUxfUlVMRVIsICZy ZXN1bHQpOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKG1jX3N0ZGVycl9wKQorICAg ICAgICAgICAgICAgICAgICAgICAgbWNfZHVtcF9nbHlwaCAocm93LCBnbHlwaCwgYXJlYSwgcmVs YXRpdmVfeCk7CisgICAgICAgICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVs X3dpZHRoOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICB9CisgICAgICAgICAg fQorICAgICAgfQorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIFNFVCBUSEUgQ0FDSEUKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICBj cm9zc2hhaXJzX2ZpbmlzaDoKKyAgaWYgKCFtaW5pbWFsX3AKKyAgICAgICYmIHVwZGF0aW5nX2Zy YW1lX3ApCisgICAgdXBkYXRlX2VuZCAoWEZSQU1FICh3LT5mcmFtZSkpOworICBpZiAoIU5JTFAg KHJlc3VsdCkpCisgICAgd3NldF9jcm9zc2hhaXJzX2NhY2hlICh3LCBsaXN0biAoQ09OU1RZUEVf SEVBUCwgMywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGcmV2ZXJzZSAo cmVzdWx0KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGY29ucyAod2lu ZG93LCBRbmlsKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGY29ucyAo dy0+Y29udGVudHMsIFFuaWwpKSk7CisgIHctPm1jLmRyYXdfY3Jvc3NoYWlycyA9IGZhbHNlOwor ICBpZiAob2xkX2J1ZmZlcikKKyAgICBzZXRfYnVmZmVyX2ludGVybmFsIChvbGRfYnVmZmVyKTsK KworLyoKKyNpZmRlZiBHTFlQSF9ERUJVRworICBlbmQgPSBjbG9jaygpOworICBjcHVfdGltZV91 c2VkID0gKChkb3VibGUpIChlbmQgLSBzdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7CisgIGR0b2Fz dHIgKGJ1Zl90aW1lLCBzaXplb2YgYnVmX3RpbWUsIDAsIDAsIGNwdV90aW1lX3VzZWQpOworICBk ZWJ1Z19tZXRob2RfYWRkICh3LCAibWNfZHJhd19jcm9zc2hhaXJzOiAgVElNRSAoJXMpIiwgYnVm X3RpbWUpOworI2VuZGlmCisqLworfQorCit2b2lkCittY19yZWRyYXdfY3Jvc3NoYWlycyAoc3Ry dWN0IHdpbmRvdyAqdykKK3sKKy8qCisjaWZkZWYgR0xZUEhfREVCVUcKKyAgY2xvY2tfdCBzdGFy dCwgZW5kOworICBkb3VibGUgY3B1X3RpbWVfdXNlZDsKKyAgY2hhciBidWZfdGltZVtEQkxfQlVG U0laRV9CT1VORF07CisgIHN0YXJ0ID0gY2xvY2soKTsKKyNlbmRpZgorKi8KKyNpZmRlZiBHTFlQ SF9ERUJVRworICBpZiAodHJhY2VfcmVkaXNwbGF5X3AgJiYgQlVGRkVSUCAody0+Y29udGVudHMp CisgICAgICAmJiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbXVsdGlwbGVf Y3Vyc29yc19jb25mKSkKKyAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBtY19maWxsX2NvbHVtbikpKSkKKyAgICB7CisgICAgICBMaXNwX09iamVj dCB3aW5kb3c7CisgICAgICBYU0VUV0lORE9XICh3aW5kb3csIHcpOworICAgICAgTGlzcF9PYmpl Y3Qgd2luZG93X3N0cmluZyA9IEZwcmluMV90b19zdHJpbmcgKHdpbmRvdywgUW5pbCk7CisgICAg ICBjaGFyICp3aW5kb3dfY2hhciA9IFNTREFUQSAod2luZG93X3N0cmluZyk7CisgICAgICBmcHJp bnRmIChzdGRlcnIsICJtY19yZWRyYXdfY3Jvc3NoYWlycyAoJXMpXG4iLCB3aW5kb3dfY2hhcik7 CisgICAgfQorI2VuZGlmCisgIExpc3BfT2JqZWN0IHZsaXN0ID0gUW5pbDsKKyAgTGlzcF9PYmpl Y3QgZmlmdGVlbl9lbGV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lX2ZpeG51bSAoMyksIGZp ZnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIGhwb3MgPSBYRklYTlVNIChGbnRoIChtYWtlX2ZpeG51 bSAoNCksIGZpZnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIHZwb3MgPSBYRklYTlVNIChGbnRoICht YWtlX2ZpeG51bSAoNSksIGZpZnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIGggPSBYRklYTlVNIChG bnRoIChtYWtlX2ZpeG51bSAoNiksIGZpZnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIGN1cnNvcl90 eXBlID0gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoRm50aCAobWFrZV9maXhudW0gKDcpLCBmaWZ0 ZWVuX2VsZW1lbnRzKSk7CisgICAgICBjdXJzb3Jfd2lkdGggPSBYRklYTlVNIChGbnRoIChtYWtl X2ZpeG51bSAoOCksIGZpZnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIGZvcmVncm91bmQgPSBGbnRo IChtYWtlX2ZpeG51bSAoOSksIGZpZnRlZW5fZWxlbWVudHMpOworICAgICAgYmFja2dyb3VuZCA9 IEZudGggKG1ha2VfZml4bnVtICgxMCksIGZpZnRlZW5fZWxlbWVudHMpOworICAgICAgYWN0aXZl X2N1cnNvcl9wID0gWEZJWE5VTSAoRm50aCAobWFrZV9maXhudW0gKDExKSwgZmlmdGVlbl9lbGVt ZW50cykpOworICAgICAgbWluaW1hbF9wID0gWEZJWE5VTSAoRm50aCAobWFrZV9maXhudW0gKDEy KSwgZmlmdGVlbl9lbGVtZW50cykpOworICAgICAgZmxhdm9yID0gWEZJWE5VTSAoRm50aCAobWFr ZV9maXhudW0gKDEzKSwgZmlmdGVlbl9lbGVtZW50cykpOworICAgICAgcG9zaW50ID0gWEZJWE5V TSAoRm50aCAobWFrZV9maXhudW0gKDE0KSwgZmlmdGVlbl9lbGVtZW50cykpOworICAgICAgYm9v bCByZW1vdmVfcCA9IGZhbHNlOworICAgICAgbWNfZ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AmJiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbXVsdGlwbGVfY3Vyc29y c19jb25mKSkKKyAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMp LCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBtY19maWxsX2NvbHVtbikpKSkKKyAgICB7CisgICAgICBMaXNwX09iamVjdCB3aW5k b3c7CisgICAgICBYU0VUV0lORE9XICh3aW5kb3csIHcpOworICAgICAgTGlzcF9PYmplY3Qgd2lu ZG93X3N0cmluZyA9IEZwcmluMV90b19zdHJpbmcgKHdpbmRvdywgUW5pbCk7CisgICAgICBjaGFy ICp3aW5kb3dfY2hhciA9IFNTREFUQSAod2luZG93X3N0cmluZyk7CisgICAgICBmcHJpbnRmIChz dGRlcnIsICJtY19lcmFzZV9jcm9zc2hhaXJzICglcyk6ICBkZWxldGVfY2FjaGUgKCVkKVxuIiwK KyAgICAgICAgICAgICAgICAgICAgICAgd2luZG93X2NoYXIsIGRlbGV0ZV9jYWNoZSk7CisgICAg fQorI2VuZGlmCisgIExpc3BfT2JqZWN0IHZsaXN0ID0gUW5pbDsKKyAgTGlzcF9PYmplY3QgZmlm dGVlbl9lbGVtZW50cyA9IFFuaWw7CisgIGludCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIGg7 CisgIGVudW0gdGV4dF9jdXJzb3Jfa2luZHMgY3Vyc29yX3R5cGU7CisgIGludCBjdXJzb3Jfd2lk dGg7CisgIExpc3BfT2JqZWN0IGZvcmVncm91bmQgPSBRbmlsOworICBMaXNwX09iamVjdCBiYWNr Z3JvdW5kID0gUW5pbDsKKyAgYm9vbCBhY3RpdmVfY3Vyc29yX3AgPSBmYWxzZTsKKyAgaW50IGZs YXZvciA9IE5PX0ZMQVZPUjsKKyAgcHRyZGlmZl90IHBvc2ludDsKKyAgYm9vbCB1cGRhdGluZ19m cmFtZV9wID0gZmFsc2U7CisgIGlmIChYRlJBTUUgKHctPmZyYW1lKSAhPSBYRlJBTUUgKHctPmZy YW1lKS0+bWNfdXBkYXRpbmdfZnJhbWUpCisgICAgeworICAgICAgdXBkYXRpbmdfZnJhbWVfcCA9 IHRydWU7CisgICAgICB1cGRhdGVfYmVnaW4gKFhGUkFNRSAody0+ZnJhbWUpKTsKKyAgICB9Cisg IGlmICghbWluaW1hbF9wKQorICAgIG1jX2VyYXNlX2dseXBoX2N1cnNvcnMgKHcsIHctPnBoeXNf Y3Vyc29yLngsIHctPnBoeXNfY3Vyc29yLnksIHctPnBoeXNfY3Vyc29yLmhwb3MsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgdy0+cGh5c19jdXJzb3IudnBvcywgdy0+cGh5c19jdXJzb3Jf dHlwZSwgdy0+cGh5c19jdXJzb3Jfd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg Zmxhdm9yKTsKKyAgZm9yICh2bGlzdCA9IFhDQVIgKHctPmNyb3NzaGFpcnNfY2FjaGUpOworICAg ICAgIENPTlNQICh2bGlzdCk7CisgICAgICAgdmxpc3QgPSBYQ0RSICh2bGlzdCkpCisgICAgewor ICAgICAgZmlmdGVlbl9lbGVtZW50cyA9IFhDQVIgKHZsaXN0KTsKKyAgICAgIHggPSBYRklYTlVN IChGbnRoIChtYWtlX2ZpeG51bSAoMCksIGZpZnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIGZ4ID0g WEZJWE5VTSAoRm50aCAobWFrZV9maXhudW0gKDEpLCBmaWZ0ZWVuX2VsZW1lbnRzKSk7CisgICAg ICB5ID0gWEZJWE5VTSAoRm50aCAobWFrZV9maXhudW0gKDIpLCBmaWZ0ZWVuX2VsZW1lbnRzKSk7 CisgICAgICBmeSA9IFhGSVhOVU0gKEZudGggKG1ha2VfZml4bnVtICgzKSwgZmlmdGVlbl9lbGVt ZW50cykpOworICAgICAgaHBvcyA9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B5LCBocG9z LCB2cG9zLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmbGF2b3IpOworICAgICAgICBlbHNl CisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCByZW1vdmVfcCA9IHRydWU7CisgICAgICAg ICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCBo LCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jf d2lkdGgsIGJhY2tncm91bmQsIGFjdGl2ZV9jdXJzb3JfcCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBtaW5pbWFsX3AsIGZsYXZvciwgcG9zaW50LCByZW1vdmVfcCk7CisgICAg ICAgICAgfQorICAgIH0KKyAgaWYgKHVwZGF0aW5nX2ZyYW1lX3ApCisgICAgdXBkYXRlX2VuZCAo WEZSQU1FICh3LT5mcmFtZSkpOworICBpZiAoZGVsZXRlX2NhY2hlKQorICAgIHdzZXRfY3Jvc3No YWlyc19jYWNoZSAodywgUW5pbCk7CisgIHctPm1jLmVyYXNlX2Nyb3NzaGFpcnMgPSBmYWxzZTsK Ky8qCisjaWZkZWYgR0xZUEhfREVCVUcKKyAgZW5kID0gY2xvY2soKTsKKyAgY3B1X3RpbWVfdXNl ZCA9ICgoZG91YmxlKSAoZW5kIC0gc3RhcnQpKSAvIENMT0NLU19QRVJfU0VDOworICBkdG9hc3Ry IChidWZfdGltZSwgc2l6ZW9mIGJ1Zl90aW1lLCAwLCAwLCBjcHVfdGltZV91c2VkKTsKKyAgZGVi dWdfbWV0aG9kX2FkZCAodywgIm1jX2VyYXNlX2Nyb3NzaGFpcnM6ICBUSU1FICglcykiLCBidWZf dGltZSk7CisjZW5kaWYKKyovCit9CisKK3ZvaWQKK21jX2RyYXdfZmlsbF9jb2x1bW4gKHN0cnVj dCB3aW5kb3cgKncsIGJvb2wgYWN0aXZlX2N1cnNvcl9wLCBib29sIG1pbmltYWxfcCkKK3sKKy8q CisjaWZkZWYgR0xZUEhfREVCVUcKKyAgY2xvY2tfdCBzdGFydCwgZW5kOworICBkb3VibGUgY3B1 X3RpbWVfdXNlZDsKKyAgY2hhciBidWZfdGltZVtEQkxfQlVGU0laRV9CT1VORF07CisgIHN0YXJ0 ID0gY2xvY2soKTsKKyNlbmRpZgorKi8KKyNpZmRlZiBHTFlQSF9ERUJVRworICBpZiAodHJhY2Vf cmVkaXNwbGF5X3AgJiYgQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAmJiAoIU5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbXVsdGlwbGVfY3Vyc29yc19jb25mKSkKKyAgICAg ICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkK KyAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19maWxs X2NvbHVtbikpKSkKKyAgICB7CisgICAgICBMaXNwX09iamVjdCB3aW5kb3c7CisgICAgICBYU0VU V0lORE9XICh3aW5kb3csIHcpOworICAgICAgTGlzcF9PYmplY3Qgd2luZG93X3N0cmluZyA9IEZw cmluMV90b19zdHJpbmcgKHdpbmRvdywgUW5pbCk7CisgICAgICBjaGFyICp3aW5kb3dfY2hhciA9 IFNTREFUQSAod2luZG93X3N0cmluZyk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19kcmF3 X2ZpbGxfY29sdW1uICglcyk6ICBhY3RpdmVfY3Vyc29yX3AgKCVkKSB8IG1pbmltYWxfcCAoJWQp XG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93X2NoYXIsIGFjdGl2ZV9jdXJzb3Jf cCwgbWluaW1hbF9wKTsKKyAgICB9CisjZW5kaWYKKyAgYm9vbCBtY19zdGRlcnJfcCA9ICFOSUxQ IChCVkFSIChjdXJyZW50X2J1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WZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworICAg ICAgcmV0dXJuOworICAgIH0KKyAgaWYgKE5JTFAgKEJWQVIgKGIsIG1jX2ZpbGxfY29sdW1uKSkp CisgICAgeworICAgICAgaWYgKG9sZF9idWZmZXIpCisgICAgICAgIHNldF9idWZmZXJfaW50ZXJu YWwgKG9sZF9idWZmZXIpOworICAgICAgcmV0dXJuOworICAgIH0KKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQkVHSU4gSk9VUk5FWSAuLi4K KyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworICBpbnQgZnJhbWVfY2hhcl93aWR0aCA9IEZSQU1F X0NPTFVNTl9XSURUSCAoZik7CisgIGludCBjdXJzb3Jfd2lkdGggPSAxOworICBwdHJkaWZmX3Qg cG9zaW50ID0gLTE7CisgIGJvb2wgZmlsbF9jb2x1bW5fcCA9ICFOSUxQIChCVkFSIChiLCBmaWxs X2NvbHVtbikpOworICBpbnQgZmlsbF9jb2wgPSBYRklYTlVNIChCVkFSIChiLCBmaWxsX2NvbHVt bikpOworICBpbnQgZmlsbF9jb2x1bW5feCA9IChmaWxsX2NvbHVtbl9wKQorICAgICAgICAgICAg ICAgICAgICAgID8gZmlsbF9jb2wgKiBmcmFtZV9jaGFyX3dpZHRoCisgICAgICAgICAgICAgICAg ICAgICAgOiAwOworICBMaXNwX09iamVjdCByZXN1bHQgPSBRbmlsOworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENPTE9SIE9GIEZJTEwgQ09M VU1OCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAgZW51bSBmYWNlX2lkIGZpbGxfY29sdW1u X2ZhY2VfaWQgPQorICAgICghYWN0aXZlX2N1cnNvcl9wCisgICAgICYmICFOSUxQIChCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIG1jX2ZpbGxfY29sdW1uX2luYWN0aXZlX3dpbmRvd3MpKQor ICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkK KyAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIm1jLWZpbGwtY29sdW1u LWluYWN0aXZlLWZhY2UiKSwgdHJ1ZSkKKyAgICA6ICghYWN0aXZlX2N1cnNvcl9wCisgICAgICAg JiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfZmlsbF9jb2x1bW5faW5h Y3RpdmVfd2luZG93cykpCisgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRl bnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnNf dmVydGljYWxfcnVsZXIpKQorICAgICAgICYmIG9wb2ludF94ID09IGZpbGxfY29sdW1uX3gpCisg ICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCJtYy1maWxsLWNvbHVtbi1v cG9pbnQtaW5hY3RpdmUtZmFjZSIpLCB0cnVlKQorICAgIDogKGFjdGl2ZV9jdXJzb3JfcAorICAg ICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQor ICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzX3ZlcnRpY2FsX3J1bGVyKSkKKyAg ICAgICAmJ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ZpbGxfY29sdW1uX2ZhY2VfaWQpOworICBMaXNw X09iamVjdCBmaWxsX2NvbHVtbl9jb2xvciA9IGZpbGxfY29sdW1uX2ZhY2UtPmxmYWNlW0xGQUNF X0ZPUkVHUk9VTkRfSU5ERVhdOworICBDSEVDS19TVFJJTkcgKGZpbGxfY29sdW1uX2NvbG9yKTsK KyAgTGlzcF9PYmplY3QgZm9yZWdyb3VuZCA9IG1jX2NvbG9yX3ZlY3Rvcl9jYWxjICh3LCBmaWxs X2NvbHVtbl9jb2xvcik7CisgIGJvb2wgdXBkYXRpbmdfZnJhbWVfcCA9IGZhbHNlOworICBpZiAo bWluaW1hbF9wKQorICAgIGdvdG8gbWNfZmlsbF9jb2x1bW5fZmluaXNoOworICAgIGVsc2UgaWYg KFhGUkFNRSAody0+ZnJhbWUpICE9IFhGUkFNRSAody0+ZnJhbWUpLT5tY191cGRhdGluZ19mcmFt ZSkKKyAgICB7CisgICAgICB1cGRhdGluZ19mcmFtZV9wID0gdHJ1ZTsKKyAgICAgIHVwZGF0ZV9i ZWdpbiAoWEZSQU1FICh3LT5mcmFtZSkpOworICAgIH0KKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KgorICAgICAgICAgICBGSUxMIENPTFVNTjogIENPTUJJTkFUSU9OIE9GIEdMWVBIICYgR0xZUEhM RVNTIENVUlNPUlMKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICBpbnQgaGVhZGVyX2xpbmVf Zm9ybWF0ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgIHN0cnVjdCBnbHlwaF9t YXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworICBpbnQgcm93X3N0YXJ0LCByb3df ZW5kLCB3aW5kb3dfcm93X3N0YXJ0LCB3aW5kb3dfcm93X2VuZDsKKyAgaW50IGk7CisgIExpc3Bf T2JqZWN0IHRlbXAgPSBRbmlsOworICBMaXNwX09iamVjdCB2c3BlY3MgPSBRbmlsOworICBmb3Ig KGkgPSAwOyBpIDwgbWF0cml4LT5ucm93czsgKytpKQorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlw aF9yb3cgKnJvdyA9IE1BVFJJWF9ST1cgKG1hdHJpeCwgaSk7CisgICAgICByb3dfc3RhcnQgPSBN QVRSSVhfUk9XX1NUQVJUX0NIQVJQT1MgKHJvdyk7CisgICAgICBpZiAoKGhlYWRlcl9saW5lX2Zv cm1hdCA+IDAgJiYgaSA9PSAxKQorICAgICAgICAgICB8fCAoaGVhZGVyX2xpbmVfZm9ybWF0ID09 IDAgJiYgaSA9PSAwKSkKKyAgICAgICAgd2luZG93X3Jvd19zdGFydCA9IHJvd19zdGFydDsKKyAg ICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgICAgIHsKKyAgICAgICAgICB3aW5kb3dfcm93 X2VuZCA9IHJvd19lbmQ7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgZWxz ZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIHJvd19lbmQgPSBNQVRSSVhfUk9XX0VORF9DSEFS UE9TIChyb3cpOworICAgICAgICAgICAgdGVtcCA9IGxpc3RuIChDT05TVFlQRV9IRUFQLCAzLCBt YWtlX2ZpeG51bSAoaSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIG1ha2VfZml4bnVtIChyb3dfc3RhcnQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBtYWtlX2ZpeG51bSAocm93X2VuZCkpOworICAgICAgICAgICAgdnNw ZWNzID0gRmNvbnMgKHRlbXAsIHZzcGVjcyk7CisgICAgICAgICAgfQorICAgIH0KKyAgTGlzcF9P YmplY3Qgdmxpc3Q7CisgIGZvciAodmxpc3QgPSBGbnJldmVyc2UgKHZzcGVjcyk7CisgICAgICAg Q09OU1AgKHZsaXN0KTsKKyAgICAgICB2bGlzdCA9IFhDRFIgKHZsaXN0KSkKKyAgICB7CisgICAg ICBpbnQgY291bnQgPSBYRklYTlVNIChGbnRoIChtYWtlX2ZpeG51bSAoMCksIFhDQVIgKHZsaXN0 KSkpOworICAgICAgaW50IHBvc19zdGFydCA9IFhGSVhOVU0gKEZudGggKG1ha2VfZml4bnVtICgx KSwgWENBUiAodmxpc3QpKSk7CisgICAgICBpbnQgcG9zX2VuZCA9IFhGSVhOVU0gKEZudGggKG1h a2VfZml4bnVtICgyKSwgWENBUiAodmxpc3QpKSk7CisgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpy b3cgPSBNQVRSSVhfUk9XICh3LT5jdXJyZW50X21hdHJpeCwgY291bnQpOworICAgICAgaW50IHRl bXBfdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCB3LT5jdXJyZW50X21hdHJpeCk7CisgICAg ICBpbnQgYXJlYTsKKyAgICAgIGludCByZWxhdGl2ZV94ID0gMDsKKyAgICAgIGZvciAoYXJlYSA9 IExFRlRfTUFSR0lOX0FSRUE7IGFyZWEgPCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAgICAgICAgewor ICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSByb3ctPmdseXBoc1thcmVhXTsKKyAgICAg ICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoX2VuZCA9IGdseXBoICsgcm93LT51c2VkW2FyZWFdOwor ICAgICAgICAgIGlmIChhcmVhID09IFRFWFRfQVJFQSAmJiBnbHlwaCA9PSBnbHlwaF9lbmQgJiYg Z2x5cGgtPmNoYXJwb3MgPiAwKQorICAgICAgICAgICAgKytnbHlwaF9lbmQ7CisgICAgICAgICAg aWYgKG1jX3N0ZGVycl9wCisgICAgICAgICAgICAgICYmIGdseXBoIDwgZ2x5cGhfZW5kKQorICAg ICAgICAgICAgZnByaW50ZiAoc3RkZXJyLAorIlxuY291bnQgKCVkKSB8IHdpbmRvd19yb3dfc3Rh cnQvZW5kICglZC8lZCkgfCByb3dfc3RhcnQvZW5kICglZC8lZClcblwKKz09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09IEZJTEwgQ09MVU1OID09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT1cblwKK0dseXBoIy9Ub3RhbCBSZWwuWCBUICAgICAgIFBvcyBPICAgVyAgICAgQ29k ZSBGYWNlIExSICAgICBYICAgIFkgSFBPUyBWUE9TIFpWIENcbiIsCitjb3VudCwgd2luZG93X3Jv d19zdGFydCwgd2luZG93X3Jvd19lbmQsIHBvc19zdGFydCwgcG9zX2VuZCk7CisgICAgICAgICAg Zm9yICg7IGdseXBoIDwgZ2x5cGhfZW5kOyArK2dseXBoKQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9IChvcG9pbnRfeCA9PSBmaWxsX2NvbHVt bl94CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF95 ID09IGdseXBoLT55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IG9wb2ludF9ocG9zID09IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfdnBvcyA9PSB0ZW1wX3Zw b3MpOworICAgICAgICAgICAgICBpZiAoKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIGNvdW50 ID4gMCkKKyAgICAgICAgICAgICAgICAgICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAg ICAgICAgICAgICAgICAgICYmIChyZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoID4gZmls bF9jb2x1bW5feAorICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoID09IGdseXBoX2VuZCAt IDEpCisgICAgICAgICAgICAgICAgICAmJiBnbHlwaC0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21f eSAodykKKyAgICAgICAgICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgICAgbWNfZW5naW5lIChyb3csIGdseXBoLCBhcmVh LCByZWxhdGl2ZV94LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LCBwb3NpbnQsIEJB Ul9DVVJTT1IsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYWN0aXZlX2N1cnNvcl9wLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBtaW5pbWFsX3AsIEZJTExfQ09MVU1OLCAmcmVzdWx0 KTsKKyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgICAgICBlbHNlIGlmICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgY291bnQgPiAwKQor ICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAmJiAocmVsYXRpdmVfeCArIGdseXBoLT5waXhlbF93aWR0 aCA+IGZpbGxfY29sdW1uX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGgg PT0gZ2x5cGhfZW5kIC0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaC0+eSA8 PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiBy ZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICAgIGlmIChtY19zdGRlcnJfcCkKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJcblJFQUwgRkFLRSBDVVJTT1JcbiIpOwor ICAgICAgICAgICAgICAgICAgICAgICAgbWNfZHVtcF9nbHlwaCAocm93LCBnbHlwaCwgYXJlYSwg cmVsYXRpdmVfeCk7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAg ICBicmVhazsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYg KG1jX3N0ZGVycl9wKQorICAgICAgICAgICAgICAgICAgICBtY19kdW1wX2dseXBoIChyb3csIGds eXBoLCBhcmVhLCByZWxhdGl2ZV94KTsKKyAgICAgICAgICAgICAgcmVsYXRpdmVfeCArPSBnbHlw aC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU0VUIFRI RSBDQUNIRQorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisgIG1jX2ZpbGxfY29sdW1uX2Zpbmlz aDoKKyAgaWYgKCFtaW5pbWFsX3AKKyAgICAgICYmIHVwZGF0aW5nX2ZyYW1lX3ApCisgICAgdXBk YXRlX2VuZCAoWEZSQU1FICh3LT5mcmFtZSkpOworICBpZiAoIU5JTFAgKHJlc3VsdCkpCisgICAg d3NldF9tY19maWxsX2NvbHVtbl9jYWNoZSAodywgbGlzdG4gKENPTlNUWVBFX0hFQVAsIDMsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRnJldmVyc2UgKHJlc3VsdCksCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmNvbnMgKHdpbmRvdywgUW5pbCks CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmNvbnMgKHctPmNvbnRlbnRz LCBRbmlsKSkpOworICB3LT5tYy5kcmF3X2ZpbGxfY29sdW1uID0gZmFsc2U7CisgIGlmIChvbGRf YnVmZmVyKQorICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworLyoKKyNpZmRl ZiBHTFlQSF9ERUJVRworICBlbmQgPSBjbG9jaygpOworICBjcHVfdGltZV91c2VkID0gKChkb3Vi bGUpIChlbmQgLSBzdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7CisgIGR0b2FzdHIgKGJ1Zl90aW1l LCBzaXplb2YgYnVmX3RpbWUsIDAsIDAsIGNwdV90aW1lX3VzZWQpOworICBkZWJ1Z19tZXRob2Rf YWRkICh3LCAibWNfZHJhd19maWxsX2NvbHVtbjogIFRJTUUgKCVzKSIsIGJ1Zl90aW1lKTsKKyNl bmRpZgorKi8KK30KKwordm9pZAorbWNfcmVkcmF3X2ZpbGxfY29sdW1uIChzdHJ1Y3Qgd2luZG93 ICp3KQoreworLyoKKyNpZmRlZiBHTFlQSF9ERUJVRworICBjbG9ja190IHN0YXJ0LCBlbmQ7Cisg IGRvdWJsZSBjcHVfdGltZV91c2VkOworICBjaGFyIGJ1Zl90aW1lW0RCTF9CVUZTSVpFX0JPVU5E XTsKKyAgc3RhcnQgPSBjbG9jaygpOworI2VuZGlmCisqLworI2lmZGVmIEdMWVBIX0RFQlVHCisg IGlmICh0cmFjZV9yZWRpc3BsYXlfcCAmJiBCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICYm ICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtdWx0aXBsZV9jdXJzb3JzX2Nv bmYpKQorICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNy b3NzaGFpcnMpKQorICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlV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g ZHRvYXN0ciAoYnVmX3RpbWUsIHNpemVvZiBidWZfdGltZSwgMCwgMCwgY3B1X3RpbWVfdXNlZCk7 CisgIGRlYnVnX21ldGhvZF9hZGQgKHcsICJtY19lcmFzZV9maWxsX2NvbHVtbjogIFRJTUUgKCVz KSIsIGJ1Zl90aW1lKTsKKyNlbmRpZgorKi8KK30KKwordm9pZAorbWNfcmVtb3ZlX211bHRpcGxl X2N1cnNvcnMgKHN0cnVjdCB3aW5kb3cgKncpCit7CisgIGJvb2wgZGVsZXRlX2NhY2hlID0gKHct Pm1jLnJlZGlzcGxheV9wcmVzZXJ2ZV9lY2hvX2FyZWEgPT0gOAorICAgICAgICAgICAgICAgICAg ICAgICB8fCBtY19yZWRpc3BsYXkgPT0gMykKKyAgICAgICAgICAgICAgICAgICAgICA/IGZhbHNl CisgICAgICAgICAgICAgICAgICAgICAgOiB0cnVlOworI2lmZGVmIEdMWVBIX0RFQlVHCisgIGlm ICh0cmFjZV9yZWRpc3BsYXlfcCAmJiBCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICYmICgh TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtdWx0aXBsZV9jdXJzb3JzX2NvbmYp KQorICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3Nz aGFpcnMpKQorICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IG1jX2ZpbGxfY29sdW1uKSkpKQorICAgIHsKKyAgICAgIExpc3BfT2JqZWN0IHdpbmRvdzsKKyAg ICAgIFhTRVRXSU5ET1cgKHdpbmRvdywgdyk7CisgICAgICBMaXNwX09iamVjdCB3aW5kb3dfc3Ry aW5nID0gRnByaW4xX3RvX3N0cmluZyAod2luZG93LCBRbmlsKTsKKyAgICAgIGNoYXIgKndpbmRv d19jaGFyID0gU1NEQVRBICh3aW5kb3dfc3RyaW5nKTsKKyAgICAgIG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G93ICp3KQoreworICBib29sIGRlbGV0ZV9jYWNoZSA9ICgody0+bWMucmVkaXNwbGF5 X3ByZXNlcnZlX2VjaG9fYXJlYSA9PSA4CisgICAgICAgICAgICAgICAgICAgICAgICB8fCBtY19y ZWRpc3BsYXkgPT0gMykKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgIXctPm1jLmRyYXdfY3Jv c3NoYWlycworICAgICAgICAgICAgICAgICAgICAgICAmJiAhdy0+bWMuZXJhc2VfY3Jvc3NoYWly cykKKyAgICAgICAgICAgICAgICAgICAgICA/IGZhbHNlCisgICAgICAgICAgICAgICAgICAgICAg OiB0cnVlOworI2lmZGVmIEdMWVBIX0RFQlVHCisgIGlmICh0cmFjZV9yZWRpc3BsYXlfcCAmJiBC VUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICYmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBtdWx0aXBsZV9jdXJzb3JzX2NvbmYpKQorICAgICAgICAgIHx8ICFOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgIHx8ICFO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2ZpbGxfY29sdW1uKSkpKQorICAg IHsKKyAgICAgIExpc3BfT2JqZWN0IHdpbmRvdzsKKyAgICAgIFhTRVRXSU5ET1cgKHdpbmRvdywg dyk7CisgICAgICBMaXNwX09iamVjdCB3aW5kb3dfc3RyaW5nID0gRnByaW4xX3RvX3N0cmluZyAo d2luZG93LCBRbmlsKTsKKyAgICAgIGNoYXIgKndpbmRvd19jaGFyID0gU1NEQVRBICh3aW5kb3df c3RyaW5nKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX3JlbW92ZV9jcm9zc2hhaXJzICgl cyk6ICBkZWxldGVfY2FjaGUgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRv d19jaGFyLCBkZWxld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ICAgIHx8IG1jX3Jl ZGlzcGxheSA9PSAzKQorICAgICAgICAgICAgICAgICAgICAgICAmJiAhdy0+bWMuZHJhd19maWxs X2NvbHVtbgorICAgICAgICAgICAgICAgICAgICAgICAmJiAhdy0+bWMuZXJhc2VfZmlsbF9jb2x1 bW4pCisgICAgICAgICAgICAgICAgICAgICAgPyBmYWxzZQorICAgICAgICAgICAgICAgICAgICAg IDogdHJ1ZTsKKyNpZmRlZiBHTFlQSF9ERUJVRworICBpZiAodHJhY2VfcmVkaXNwbGF5X3AgJiYg QlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAmJiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgbXVsdGlwbGVfY3Vyc29yc19jb25mKSkKKyAgICAgICAgICB8fCAhTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICB8fCAh TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19maWxsX2NvbHVtbikpKSkKKyAg ICB7CisgICAgICBMaXNwX09iamVjdCB3aW5kb3c7CisgICAgICBYU0VUV0lORE9XICh3aW5kb3cs IHcpOworICAgICAgTGlzcF9PYmplY3Qgd2luZG93X3N0cmluZyA9IEZwcmluMV90b19zdHJpbmcg KHdpbmRvdywgUW5pbCk7CisgICAgICBjaGFyICp3aW5kb3dfY2hhciA9IFNTREFUQSAod2luZG93 X3N0cmluZyk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19yZW1vdmVfZmlsbF9jb2x1bW4g KCVzKTogIGRlbGV0ZV9jYWNoZSAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgd2lu ZG93X2NoYXIsIGRlbGV0ZV9jYWNoZSk7CisgICAgfQorI2VuZGlmCisgIC8qIFJlbW92ZSBmYWtl IGN1cnNvcnMuICBJZiB3ZSByZWx5IHVwb24gYHVwZGF0ZV9mcmFtZScgdG8gc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CVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAg fHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfZmlsbF9jb2x1bW4pKSkp CisgICAgeworICAgICAgTGlzcF9PYmplY3Qgd2luZG93OworICAgICAgWFNFVFdJTkRPVyAod2lu ZG93LCB3KTsKKyAgICAgIExpc3BfT2JqZWN0IHdpbmRvd19zdHJpbmcgPSBGcHJpbjFfdG9fc3Ry aW5nICh3aW5kb3csIFFuaWwpOworICAgICAgY2hhciAqd2luZG93X2NoYXIgPSBTU0RBVEEgKHdp bmRvd19zdHJpbmcpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfbXVsdGlwbGVfY3Vyc29y c19wb3J0YWwgKCVzKTogIG9uICglZCkgfCBhY3RpdmVfY3Vyc29yX3AgKCVkKVxuIiwKKyAgICAg ICAgICAgICAgICAgICAgICAgIHdpbmRvd19jaGFyLCBvbiwgYWN0aXZlX2N1cnNvcl9wKTsKKyAg ICB9CisjZW5kaWYKKyAgYm9vbCBtaW5pbWFsX3AgPSAoIXctPm1jLmRyYXdfbXVsdGlwbGVfY3Vy c29ycworICAgICAgICAgICAgICAgICAgICAmJiBtY19yZWRpc3BsYXlfcHJlc2VydmVfZWNob19h cmVhICE9IDgKKyAgICAgICAgICAgICAgICAgICAgJiYgbWNfcmVkaXNwbGF5ICE9IDMKKyAgICAg ICAgICAgICAgICAgICAgJiYgdyA9PSBYV0lORE9XIChzZWxlY3RlZF93aW5kb3cpCisgICAgICAg ICAgICAgICAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbXVsdGlw bGVfY3Vyc29yc19kcmF3X2ZvcnRod2l0aCkpKTsKKyAgaWYgKHctPm1jLmVyYXNlX211bHRpcGxl X2N1cnNvcnMgJiYgdy0+bWMuZHJhd19tdWx0aXBsZV9jdXJzb3JzCisgICAgICAmJiAhTU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AgICB3c2V0X211bHRpcGxlX2N1cnNvcnNfY2FjaGUgKHcsIFFu aWwpOworICAgICAgdy0+bWMuZXJhc2VfbXVsdGlwbGVfY3Vyc29ycyA9IGZhbHNlOworICAgIH0K KyAgaWYgKG9uCisgICAgICAmJiAhTUlOSV9XSU5ET1dfUCAodykKKyAgICAgICYmICh3ID09IFhX SU5ET1cgKHNlbGVjdGVkX3dpbmRvdykKKyAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBtdWx0aXBsZV9jdXJzb3JzX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAg ICAgICYmIE5JTFAgKHctPm11bHRpcGxlX2N1cnNvcnNfY2FjaGUpCisgICAgICAmJiAhTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtdWx0aXBsZV9jdXJzb3JzX2NvbmYpKSkKKyAg ICBtY19kcmF3X211bHRpcGxlX2N1cnNvcnMgKHcsIGFjdGl2ZV9jdXJzb3JfcCwgbWluaW1hbF9w KTsKKyAgICBlbHNlIGlmIChvbgorICAgICAgICAgICAgICYmICFNSU5JX1dJTkRPV19QICh3KQor ICAgICAgICAgICAgICYmICFOSUxQICh3LT5tdWx0aXBsZV9jdXJzb3JzX2NhY2hlKQorICAgICAg ICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG11bHRpcGxlX2N1 cnNvcnNfY29uZikpCisgICAgICAgICAgICAgJiYgV0lORE9XUCAoWENBUiAoRm50aCAobWFrZV9m aXhudW0gKDEpLCB3LT5tdWx0aXBsZV9jdXJzb3JzX2NhY2hlKSkpCisgICAgICAgICAgICAgJiYg dyA9PSBYV0lORE9XIChYQ0FSIChGbnRoIChtYWtlX2ZpeG51bSAoMSksIHctPm11bHRpcGxlX2N1 cnNvcnNfY2FjaGUpKSkKKyAgICAgICAgICAgICAmJiBFUSAody0+Y29udGVudHMsIFhDQVIgKEZu dGggKG1ha2VfZml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SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG11bHRpcGxlX2N1 cnNvcnNfY29uZikpCisgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRl bnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgbWNfZmlsbF9jb2x1bW4pKSkpCisgICAgeworICAgICAgTGlzcF9PYmplY3Qg d2luZG93OworICAgICAgWFNFVFdJTkRPVyAod2luZG93LCB3KTsKKyAgICAgIExpc3BfT2JqZWN0 IHdpbmRvd19zdHJpbmcgPSBGcHJpbjFfdG9fc3RyaW5nICh3aW5kb3csIFFuaWwpOworICAgICAg Y2hhciAqd2luZG93X2NoYXIgPSBTU0RBVEEgKHdpbmRvd19zdHJpbmcpOworICAgICAgZnByaW50 ZiAoc3RkZXJyLCAibWNfY3Jvc3NoYWlyc19wb3J0YWwgKCVzKTogIG9uICglZCkgfCBhY3RpdmVf Y3Vyc29yX3AgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvd19jaGFyLCBv biwgYWN0aXZlX2N1cnNvcl9wKTsKKyAgICB9CisjZW5kaWYKKyAgYm9vbCBtaW5pbWFsX3AgPSAo IXctPm1jLmRyYXdfY3Jvc3NoYWlycworICAgICAgICAgICAgICAgICAgICAmJiBtY19yZWRpc3Bs YXlfcHJlc2VydmVfZWNob19hcmVhICE9IDgKKyAgICAgICAgICAgICAgICAgICAgJiYgbWNfcmVk aXNwbGF5ICE9IDMKKyAgICAgICAgICAgICAgICAgICAgJiYgdyA9PSBYV0lORE9XIChzZWxlY3Rl ZF93aW5kb3cpCisgICAgICAgICAgICAgICAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgY3Jvc3NoYWlyc19kcmF3X2ZvcnRod2l0aCkpKTsKKyAgaWYgKHctPm1jLmVy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gIHdzZXRfY3Jvc3NoYWlyc19jYWNoZSAodywg UW5pbCk7CisgICAgICB3LT5tYy5lcmFzZV9jcm9zc2hhaXJzID0gZmFsc2U7CisgICAgfQorICBp ZiAob24KKyAgICAgICYmICFNSU5JX1dJTkRPV19QICh3KQorICAgICAgJiYgKHcgPT0gWFdJTkRP VyAoc2VsZWN0ZWRfd2luZG93KQorICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3 LT5jb250ZW50cyksIGNyb3NzaGFpcnNfaW5hY3RpdmVfd2luZG93cykpKQorICAgICAgJiYgTklM UCAody0+Y3Jvc3NoYWlyc19jYWNoZSkKKyAgICAgICYmICghTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpKQorICAgIG1jX2RyYXdfY3Jvc3NoYWlycyAodywg YWN0aXZlX2N1cnNvcl9wLCBtaW5pbWFsX3ApOworICAgIGVsc2UgaWYgKG9uCisgICAgICAgICAg ICAgJiYgIU1JTklfV0lORE9XX1AgKHcpCisgICAgICAgICAgICAgJiYgIU5JTFAgKHctPmNyb3Nz aGFpcnNfY2FjaGUpCisgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgJiYgV0lORE9XUCAoWENBUiAoRm50 aCAobWFrZV9maXhudW0gKDEpLCB3LT5jcm9zc2hhaXJzX2NhY2hlKSkpCisgICAgICAgICAgICAg JiYgdyA9PSBYV0lORE9XIChYQ0FSIChGbnRoIChtYWtlX2ZpeG51bSAoMSksIHctPmNyb3NzaGFp cnNfY2FjaGUpKSkKKyAgICAgICAgICAgICAmJiBFUSAody0+Y29udGVudHMsIFhDQVIgKEZudGgg KG1ha2VfZml4bnVtICgyKSwgdy0+Y3Jvc3NoYWlyc19jYWNoZSkpKSkKKyAgICAgIHsKKyAgICAg ICAgbWNfZXJhc2VfY3Jvc3N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OSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGNyb3NzaGFpcnMpKQorICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIG1jX2ZpbGxfY29sdW1uKSkpKQorICAgIHsKKyAgICAgIExpc3BfT2JqZWN0IHdpbmRv dzsKKyAgICAgIFhTRVRXSU5ET1cgKHdpbmRvdywgdyk7CisgICAgICBMaXNwX09iamVjdCB3aW5k b3dfc3RyaW5nID0gRnByaW4xX3RvX3N0cmluZyAod2luZG93LCBRbmlsKTsKKyAgICAgIGNoYXIg KndpbmRvd19jaGFyID0gU1NEQVRBICh3aW5kb3dfc3RyaW5nKTsKKyAgICAgIGZwcmludGYgKHN0 ZGVyciwgIm1jX2ZpbGxfY29sdW1uX3BvcnRhbCAoJXMpOiAgb24gKCVkKSB8IGFjdGl2ZV9jdXJz b3JfcCAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93X2NoYXIsIG9uLCBh Y3RpdmVfY3Vyc29yX3ApOworICAgIH0KKyNlbmRpZgorICBib29sIG1pbmltYWxfcCA9ICghdy0+ bWMuZHJhd19maWxsX2NvbHVtbgorICAgICAgICAgICAgICAgICAgICAmJiBtY19yZWRpc3BsYXlf cHJlc2VydmVfZWNob19hcmVhICE9IDgKKyAgICAgICAgICAgICAgICAgICAgJiYgbWNfcmVkaXNw bGF5ICE9IDMKKyAgICAgICAgICAgICAgICAgICAgJiYgdyA9PSBYV0lORE9XIChzZWxlY3RlZF93 aW5kb3cpCisgICAgICAgICAgICAgICAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgbWNfZmlsbF9jb2x1bW5fZHJhd19mb3J0aHdpdGgpKSk7CisgIGlmICh3LT5tYy5l cmFzZV9maWxsX2NvbHVtbiAmJiB3LT5tYy5kcmF3X2ZpbGxfY29sdW1uCisgICAgICAmJiAhTUlO SV9XSU5ET1dfUCAodyk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ICB3LT5tYy5lcmFz ZV9maWxsX2NvbHVtbiA9IGZhbHNlOworICAgIH0KKyAgaWYgKG9uCisgICAgICAmJiAhTUlOSV9X SU5ET1dfUCAodykKKyAgICAgICYmICh3ID09IFhXSU5ET1cgKHNlbGVjdGVkX3dpbmRvdykKKyAg ICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19maWxsX2Nv bHVtbl9pbmFjdGl2ZV93aW5kb3dzKSkpCisgICAgICAmJiBOSUxQICh3LT5tY19maWxsX2NvbHVt bl9jYWNoZSkKKyAgICAgICYmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBt Y19maWxsX2NvbHVtbikpKSkKKyAgICBtY19kcmF3X2ZpbGxfY29sdW1uICh3LCBhY3RpdmVfY3Vy c29yX3AsIG1pbmltYWxfcCk7CisgICAgZWxzZSBpZiAob24KKyAgICAgICAgICAgICAmJiAhTUlO SV9XSU5ET1dfUCAodykKKyAgICAgICAgICAgICAmJiAhTklMUCAody0+bWNfZmlsbF9jb2x1bW5f Y2FjaGUpCisgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgbWNfZmlsbF9jb2x1bW4pKQorICAgICAgICAgICAgICYmIFdJTkRPV1AgKFhDQVIgKEZudGgg KG1ha2VfZml4bnVtICgxKSwgdy0+bWNfZmlsbF9jb2x1bW5fY2FjaGUpKSkKKyAgICAgICAgICAg ICAmJiB3ID09IFhXSU5ET1cgKFhDQVIgKEZudGggKG1ha2VfZml4bnVtICgxKSwgdy0+bWNfZmls bF9jb2x1bW5fY2FjaGUpKSkKKyAgICAgICAgICAgICAmJiBFUSAody0+Y29udGVudHMsIFhDQVIg KEZudGggKG1ha2VfZml4bnVtICgyKSwgdy0+bWNfZmlsbF9jb2x1bW5fY2FjaGUpKSkpCisgICAg ICB7CisgICAgICAgIG1jX2VyYXNlX2ZpbGxfY29sdW1uICh3LCBmYWxzZSk7CisgICAgICAgIG1j X3JlZHJhd19maWxsX2NvbHVtbiAodyk7CisgICAgICB9Cit9CisKK0RFRlVOICgibWMtYWN0aXZh dGUtZmlsbC1jb2x1bW4iLCBGbWNfYWN0aXZhdGVfZmlsbF9jb2x1bW4sIFNtY19hY3RpdmF0ZV9m aWxsX2NvbHVtbiwgMSwgMSwgMCwKKyAgICAgICBkb2M6IC8qIERvYy1zdHJpbmcuICovKQorICAo TGlzcF9PYmplY3Qgd2luZG93KQoreworICBzdHJ1Y3Qgd2luZG93ICp3ID0gZGVjb2RlX2xpdmVf d2luZG93ICh3aW5kb3cpOworI2lmZGVmIEdMWVBIX0RFQlVHCisgIGlmICh0cmFjZV9yZWRpc3Bs YXlfcCAmJiBCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICYmICghTklMUCAoQlZBUiAoWEJV RkZFUiAody0+Y29udGVudHMpLCBtdWx0aXBsZV9jdXJzb3JzX2NvbmYpKQorICAgICAgICAgIHx8 ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAg ICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2ZpbGxfY29sdW1u KSkpKQorICAgIHsKKyAgICAgIExpc3BfT2JqZWN0IHdpbmRvd19zdHJpbmcgPSBGcHJpbjFfdG9f c3RyaW5nICh3aW5kb3csIFFuaWwpOworICAgICAgY2hhciAqd2luZG93X2NoYXIgPSBTU0RBVEEg KHdpbmRvd19zdHJpbmcpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiXG5tYy1hY3RpdmF0ZS1t Yy1maWxsLWNvbHVtbiAoJXMpXG4iLCB3aW5kb3dfY2hhcik7CisgICAgfQorI2VuZGlmCisgIHct Pm1jLmRyYXdfZmlsbF9jb2x1bW4gPSB0cnVlOworICB3LT5tYy5lcmFzZV9maWxsX2NvbHVtbiA9 IHRydWU7CisgIHctPm11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1tb2RlKQorICAg IChzZXRxIGRpc3BsYXktbGluZS1udW1iZXJzIHQpCisgICAgKHNldHEgYnVmZmVyLWRpc3BsYXkt dGFibGUgKG1ha2UtZGlzcGxheS10YWJsZSkpCisgICAgKGFzZXQgYnVmZmVyLWRpc3BsYXktdGFi bGUKKyAgICAgICAgICA/XHQKKyAgICAgICAgICAodmVjdG9yIChtYWtlLWdseXBoLWNvZGUgP1x1 MDBCQiAnZm9udC1sb2NrLXdhcm5pbmctZmFjZSkKKyAgICAgICAgICAgICAgICAgIChtYWtlLWds eXBoLWNvZGUgP1x0ICdoaWdobGlnaHQpKSkKKyAgICAoYXNldCBidWZmZXItZGlzcGxheS10YWJs ZQorICAgICAgICAgID9cbgorICAgICAgICAgICh2ZWN0b3IgKG1ha2UtZ2x5cGgtY29kZSA/XHUw MEI2ICdmb250LWxvY2stY29tbWVudC1mYWNlKQorICAgICAgICAgICAgICAgICAgP1xuKSkKKyAg ICAoc2V0cSB0YWItd2lkdGggOCkKKyAgICAoc2V0cS1sb2NhbCBhdXRvLWhzY3JvbGwtbW9kZSAn Y3VycmVudC1saW5lKSAqLworCitERUZVTiAoIm1jLWRlYnVnIiwgRm1jX2RlYnVnLCBTbWNfZGVi dWcsIDAsIDAsICIiLAorICAgICAgIGRvYzogLyogVGhpcyBmdW5jdGlvbiB1c2VkIGZvciBkZWJ1 Z2dpbmcuICovKQorICAodm9pZCkKK3sKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAg ICAgICAgICAgICAgICAgIFBSRUxJTUlOQVJZIFNUVUZGCisqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKyAgc3RydWN0IHdpbmRvdyAqdyA9IGRlY29kZV9saXZlX3dpbmRvdyAoc2VsZWN0ZWRfd2lu ZG93KTsKKyAgc3RydWN0IGl0IGl0OworICB2b2lkICppdGRhdGEgPSBiaWRpX3NoZWx2ZV9jYWNo ZSAoKTsKKyAgc3RydWN0IGl0IGl0MjsKKyAgdm9pZCAqaXQyZGF0YSA9IE5VTEw7CisgIHN0cnVj dCBpdCBpdDM7CisgIHZvaWQgKml0M2RhdGEgPSBOVUxMOworICBlbnVtIG1vdmVfaXRfcmVzdWx0 IHJjID0gTU9WRV9YX1JFQUNIRUQ7CisgIHN0cnVjdCB0ZXh0X3BvcyBzdGFydF90ZXh0X3Bvc2l0 aW9uOworICBpbnQgY291bnQgPSAwOworICBpbnQgbmV3X3ggPSAwOworICBpbnQgcHJldmlvdXNf aXRfYyA9IDA7CisgIGludCBwcmV2aW91c19pdF9mZXRjaGJ5dGUgPSAwOworICBpbnQgcHJldmlv dXNfaXRfY3VycmVudF94ID0gMDsKKyAgaW50IHByZXZpb3VzX2l0X2NoYXJwb3MgPSAwOworICBp bnQgcHJldmlvdXNfaXRfcGl4ZWxfd2lkdGggPSAwOworICBib29sIGZpbmFsX2xvb3BfcCA9IGZh bHNlOworICBpbnQgdGV4dF9hcmVhX3dpZHRoID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9B UkVBKTsKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgIFNU QVJUIERJU1BMQVkgLS0gdy0+c3RhcnQKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICAvKiBC ZWdpbiB0aGUgam91cm5leSBhdCB3LT5zdGFydC4gKi8KKyAgU0VUX1RFWFRfUE9TX0ZST01fTUFS S0VSIChzdGFydF90ZXh0X3Bvc2l0aW9uLCB3LT5zdGFydCk7CisgIHN0YXJ0X2Rpc3BsYXkgKCZp dCwgdywgc3RhcnRfdGV4dF9wb3NpdGlvbik7CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAg ICAgICAgICAgICAgICBHTyBUTyBUSEUgQkVHSU5OSU5HIE9GIFRIRSBDVVJSRU5UIExJTkUuCisq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKyAgLyogUGxhY2UgdGhlIElUIG9uIHRoZSBjdXJyZW50 IGxpbmUgY29udGFpbmluZyBQVC4gKi8KKyAgaW50IHZvZmZzZXQgPSAoV0lORE9XX0hFQURFUl9M SU5FX0hFSUdIVCAodykgPiAwCisgICAgICAgICAgICAgICAgICYmIHctPm91dHB1dF9jdXJzb3Iu dnBvcyA+IDApCisgICAgICAgICAgICAgICAgICA/IHctPm91dHB1dF9jdXJzb3IudnBvcyAtIDEK KyAgICAgICAgICAgICAgICAgIDogdy0+b3V0cHV0X2N1cnNvci52cG9zOworICBpZiAodm9mZnNl dCA+IDApCisgICAgbW92ZV9pdF9ieV9saW5lcyAoJml0LCB2b2Zmc2V0KTsKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICBNT1ZFIElUOiAgSU5DUkVNRU5U ID09IDEgcGl4ZWwKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICBmcHJpbnRmIChzdGRlcnIs ICJcbml0LmZpcnN0X3Zpc2libGVfeCAoJWQpXG4iLCBpdC5maXJzdF92aXNpYmxlX3gpOworICB3 aGlsZSAoIWZpbmFsX2xvb3BfcCkKKyAgICB7CisgICAgICBtY19kZWJ1Z19wID0gdHJ1ZTsKKyAg ICAgIGZpbmFsX2xvb3BfcCA9IChJVF9DSEFSUE9TIChpdCkgPT0gWlYpCisgICAgICAgICAgICAg ICAgICAgICAgID8gdHJ1ZQorICAgICAgICAgICAgICAgICAgICAgOiAoRkVUQ0hfQllURSAoSVRf QllURVBPUyAoaXQpKSA9PSAnXG4nCisgICAgICAgICAgICAgICAgICAgICAgICAmJiBpdC5jICE9 IDApCisgICAgICAgICAgICAgICAgICAgICAgID8gdHJ1ZQorICAgICAgICAgICAgICAgICAgICAg OiAocmMgPT0gTU9WRV9MSU5FX0NPTlRJTlVFRCkKKyAgICAgICAgICAgICAgICAgICAgICAgPyB0 cnVlCisgICAgICAgICAgICAgICAgICAgICA6IChyYyA9PSBNT1ZFX0xJTkVfVFJVTkNBVEVECisg ICAgICAgICAgICAgICAgICAgICAgICAmJiBpdC5jdXJyZW50X3ggLSBpdC5maXJzdF92aXNpYmxl X3ggPiB0ZXh0X2FyZWFfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgID8gdHJ1ZQorICAg ICAgICAgICAgICAgICAgICAgOiBmYWxzZTsKKyAgICAgIGlmIChpdC5jdXJyZW50X3ggPiBwcmV2 aW91c19pdF9jdXJyZW50X3gKKyAgICAgICAgICB8fCBJVF9DSEFSUE9TIChpdCkgPiBwcmV2aW91 c19pdF9jaGFycG9zCisgICAgICAgICAgfHwgaXQuYyAhPSBwcmV2aW91c19pdF9jCisgICAgICAg ICAgfHwgaXQuYyA9PSAwCisgICAgICAgICAgfHwgaXQuYyA9PSAxMCkKKyAgICAgICAgeworICAg ICAgICAgIExpc3BfT2JqZWN0IGNoYXJhY3RlciA9IEZjaGFyX3RvX3N0cmluZyAobWFrZV9maXhu dW0gKGl0LmMpKTsKKyAgICAgICAgICBpbnQgY2hhcnBvcyA9IElUX0NIQVJQT1MgKGl0KTsKKyAg ICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJcbmNoYXJwb3MgKCVkLyVkLyVkKSB8IGZpcnN0X3gg KCVkKSB8IHByZXZpb3VzX3ggKCVkKSB8IHggKCVkKSB8IGMgKCVzKSB8IHB3ICglZCkgfCBocG9z ICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFycG9zLCBwcmV2aW91c19p dF9jaGFycG9zLCBGRVRDSF9CWVRFIChJVF9CWVRFUE9TIChpdCkpLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgaXQuZmlyc3RfdmlzaWJsZV94LAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgcHJldmlvdXNfaXRfY3VycmVudF94LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgaXQu Y3VycmVudF94LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgKCghTklMUCAoY2hhcmFjdGVy KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBpdC5jID09IDkpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyAiXFx0IgorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBpdC5jID09IDEwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gIlxcbiIKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoIU5JTFAgKGNoYXJhY3RlcikKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgaXQuYyAhPSA5CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIGl0LmMgIT0gMTApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBTU0RBVEEgKGNoYXJhY3RlcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAi PyIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgaXQucGl4ZWxfd2lkdGgsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICBpdC5ocG9zKTsKKyAgICAgICAgICBwcmV2aW91c19pdF9jID0g aXQuYzsKKyAgICAgICAgICBwcmV2aW91c19pdF9jdXJyZW50X3ggPSBpdC5jdXJyZW50X3g7Cisg ICAgICAgICAgcHJldmlvdXNfaXRfY2hhcnBvcyA9IElUX0NIQVJQT1MgKGl0KTsKKyAgICAgICAg ICBwcmV2aW91c19pdF9mZXRjaGJ5dGUgPSBGRVRDSF9CWVRFIChJVF9CWVRFUE9TIChpdCkpOwor ICAgICAgICAgIHByZXZpb3VzX2l0X3BpeGVsX3dpZHRoID0gaXQucGl4ZWxfd2lkdGg7CisgICAg ICAgICAgY291bnQgKz0gMTsKKyAgICAgICAgfQorICAgICAgbmV3X3ggKz0gMTsKKyAgICAgIFNB VkVfSVQgKGl0MiwgaXQsIGl0MmRhdGEpOworICAgICAgcmMgPSBtb3ZlX2l0X2luX2Rpc3BsYXlf bGluZV90byAoJml0LCBaViwgbmV3X3gsIE1PVkVfVE9fUE9TIHwgTU9WRV9UT19YKTsKKyAgICAg IFNBVkVfSVQgKGl0MywgaXQsIGl0M2RhdGEpOworICAgIH0KKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVEhFIEVORAorKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisgIG1jX2RlYnVnX3AgPSBmYWxzZTsKKyAgYmlkaV91bnNoZWx2ZV9j YWNoZSAoaXRkYXRhLCBmYWxzZSk7CisgIHJldHVybiBRbmlsOworfQorCisvKiBlbmQgTVVMVElQ TEUgQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogDAogLyoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqCiAJCSAgICAgIFdpbmRvdyBkaXNwbGF5IGRpbWVuc2lvbnMKQEAgLTExMjE0LDcgKzE2 MzM0LDE4IEBAIHJlc2l6ZV9lY2hvX2FyZWFfZXhhY3RseSAodm9pZCkKIAl7CiAJICB3aW5kb3dz X29yX2J1ZmZlcnNfY2hhbmdlZCA9IDQyOwogCSAgdXBkYXRlX21vZGVfbGluZXMgPSAzMDsKLQkg IHJlZGlzcGxheV9pbnRlcm5hbCAoKTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFIENVUlNPUlMgKi8KKworICAgICAgbWNfcmVkaXNwbGF5X2ludGVybmFsID0gMTsK KyAgICAgIHJlZGlzcGxheV9pbnRlcm5hbCAoMSk7CisgICAgICBtY19yZWRpc3BsYXlfaW50ZXJu YWwgPSAwOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJfQogICAgIH0KIH0KQEAg LTExNzAxLDcgKzE2ODMyLDE4IEBAIGVjaG9fYXJlYV9kaXNwbGF5IChib29sIHVwZGF0ZV9mcmFt ZV9wKQogCSAgICAgIHB0cmRpZmZfdCBjb3VudCA9IFNQRUNQRExfSU5ERVggKCk7CiAJICAgICAg c3BlY2JpbmQgKFFyZWRpc3BsYXlfZG9udF9wYXVzZSwgUXQpOwogCSAgICAgIGZzZXRfcmVkaXNw bGF5IChmKTsKLQkgICAgICByZWRpc3BsYXlfaW50ZXJuYWwgKCk7CisKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgICAgICAgICBtY19yZWRp c3BsYXlfaW50ZXJuYWwgPSAyOworICAgICAgICAgIHJlZGlzcGxheV9pbnRlcm5hbCAoMik7Cisg ICAgICAgICAgbWNfcmVkaXNwbGF5X2ludGVybmFsID0gMDsKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogCSAgICAgIHVuYmluZF90byAoY291bnQsIFFuaWwpOwogCSAgICB9CiAJICBl bHNlIGlmIChGUkFNRV9XSU5ET1dfUCAoZikgJiYgbiA9PSAwKQpAQCAtMTMzODAsNiArMTg1MjIs MTkgQEAgaHNjcm9sbF93aW5kb3dfdHJlZSAoTGlzcF9PYmplY3Qgd2luZG93KQogCSAgICAgIGVs c2UKIAkJcHQgPSBjbGlwX3RvX2JvdW5kcyAoQkVHViwgbWFya2VyX3Bvc2l0aW9uICh3LT5wb2lu dG0pLCBaVik7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJT T1JTICovCisKKyAgc3RydWN0IGRpc3BsYXlfcG9zICpwb3MgPSAmY3Vyc29yX3Jvdy0+c3RhcnQ7 CisgIHB0cmRpZmZfdCBjaGFycG9zID0gQ0hBUlBPUyAocG9zLT5wb3MpOworICBib29sIGJhcmZf Y3Jhc2ggPSAoY2hhcnBvcyA8IDAgfHwgKGNoYXJwb3MgPj0gQlVGX0JFRyAoY3VycmVudF9idWZm ZXIpICYmIGNoYXJwb3MgPD0gWlYpKSA/IGZhbHNlIDogdHJ1ZTsKKyAgaWYgKGJhcmZfY3Jhc2gp CisgICAgcmV0dXJuIGhzY3JvbGxlZF9wOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAJICAgICAgLyogTW92ZSBpdGVyYXRvciB0byBwdCBzdGFydGluZyBhdCBjdXJzb3Jfcm93LT5z dGFydCBpbgogCQkgYSBsaW5lIHdpdGggaW5maW5pdGUgd2lkdGguICAqLwogCSAgICAgIGluaXRf dG9fcm93X3N0YXJ0ICgmaXQsIHcsIGN1cnNvcl9yb3cpOwpAQCAtMTM2MjAsMTIgKzE4Nzc1LDI2 IEBAIHRleHRfb3V0c2lkZV9saW5lX3VuY2hhbmdlZF9wIChzdHJ1Y3Qgd2luZG93ICp3LAogICAg aXMgbm8gbG9uZ2VyIHJlcXVlc3RlZCwgd2UgY2xlYXIgdGhlIGVjaG8gYXJlYSBvciBicmluZyBi YWNrIHRoZQogICAgbWluaS1idWZmZXIgaWYgdGhhdCBpcyBpbiB1c2UuICAqLwogCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCiB2b2lkCi1yZWRp c3BsYXkgKHZvaWQpCityZWRpc3BsYXkgKGludCBmcm9tX3doZXJlKQogewotICByZWRpc3BsYXlf aW50ZXJuYWwgKCk7CisjaWZkZWYgR0xZUEhfREVCVUcKKyAgaWYgKHRyYWNlX3JlZGlzcGxheV9w KQorICAgIGZwcmludGYgKHN0ZGVyciwgIlxucmVkaXNwbGF5ICglZClcbiIsIGZyb21fd2hlcmUp OworI2VuZGlmCisgIG1jX3JlZGlzcGxheSA9IGZyb21fd2hlcmU7CisgIG1jX3JlZGlzcGxheV9p bnRlcm5hbCA9IDM7CisgIHJlZGlzcGxheV9pbnRlcm5hbCAoMyk7CisgIG1jX3JlZGlzcGxheV9p bnRlcm5hbCA9IDA7CisgIG1jX3JlZGlzcGxheSA9IDA7CiB9CiAKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworCiAKIHN0YXRpYyBMaXNwX09iamVjdAogb3ZlcmxheV9hcnJvd19zdHJpbmdfb3Jf cHJvcGVydHkgKExpc3BfT2JqZWN0IHZhcikKQEAgLTEzODkxLDkgKzE5MDYwLDIxIEBAIGRvIHsg aWYgKHBvbGxpbmdfc3RvcHBlZF9oZXJlKSBzdGFydF9wb2xsaW5nICgpOwlcCiAvKiBQZXJoYXBz IGluIHRoZSBmdXR1cmUgYXZvaWQgcmVjZW50ZXJpbmcgd2luZG93cyBpZiBpdAogICAgaXMgbm90 IG5lY2Vzc2FyeTsgY3VycmVudGx5IHRoYXQgY2F1c2VzIHNvbWUgcHJvYmxlbXMuICAqLwogCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCiBzdGF0 aWMgdm9pZAotcmVkaXNwbGF5X2ludGVybmFsICh2b2lkKQorcmVkaXNwbGF5X2ludGVybmFsIChp bnQgZnJvbV93aGVyZSkKIHsKKyNpZmRlZiBHTFlQSF9ERUJVRworICBpZiAodHJhY2VfcmVkaXNw bGF5X3ApCisgICAgZnByaW50ZiAoc3RkZXJyLCAiXG5yZWRpc3BsYXlfaW50ZXJuYWwgKCVkKVxu IiwgZnJvbV93aGVyZSk7CisjZW5kaWYKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog ICBzdHJ1Y3Qgd2luZG93ICp3ID0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93KTsKICAgc3RydWN0 IHdpbmRvdyAqc3c7CiAgIHN0cnVjdCBmcmFtZSAqZnI7CkBAIC0xNDI5NSw2ICsxOTQ3NiwyNiBA QCByZWRpc3BsYXlfaW50ZXJuYWwgKHZvaWQpCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCiAJ ICAgICAgdXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCBmYWxzZSk7CiAjZW5kaWYKKworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworLyogTk9URTog IEFuIGlkbGUtdGltZXIgZnVuY3Rpb24gbWF5IG5vdCBuZWNlc3NhcmlseSB0cmlnZ2VyIGByZWRp c3BsYXlfd2luZG93Jy4KKyAgIGB3LT5tdXN0X2JlX3VwZGF0ZWRfcCcgaXMgc2V0IHRvIHRydWUg d2l0aGluIGBtYy1hY3RpdmF0ZS1jcm9zc2hhaXJzJy4KKy0gIGBvcHRpbWl6YXRpb24gMWAgKGUu Zy4sIGxlZnQvcmlnaHQgY3Vyc29yIG1vdmVtZW50IG9uIHRoZSBmaXJzdCBzY3JlZW4gbGluZSku CistICBgb3B0aW1pemF0aW9uIDNgIChlLmcuLCBsZWZ0L3JpZ2h0IGN1cnNvciBtb3ZlbWVudCBv biBzY3JlZW4gbGluZXMgc3Vic2VxdWVudAorICAgIHRvIHRoZSBmaXJzdCBzY3JlZW4gbGluZSks IGJ5cGFzcyBgcmVkaXNwbGF5X3dpbmRvdycuICovCisKKyAgYmxvY2tfaW5wdXQgKCk7CisgIG1j X3JlbW92ZV9tdWx0aXBsZV9jdXJzb3JzICh3KTsKKyAgbWNfcmVtb3ZlX2Nyb3NzaGFpcnMgKHcp OworICBtY19yZW1vdmVfZmlsbF9jb2x1bW4gKHcpOworICB1bmJsb2NrX2lucHV0ICgpOworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAgICAgZ290byB1cGRhdGU7CiAJICAgIH0K IAkgIGVsc2UKQEAgLTE0MzE3LDYgKzE5NTE4LDIyIEBAIHJlZGlzcGxheV9pbnRlcm5hbCAodm9p ZCkKIAkJICAmJiAodyA9IFhXSU5ET1cgKHNlbGVjdGVkX3dpbmRvdykpICE9IHN3KQogCQlnb3Rv IHJldHJ5OwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09S UyAqLworCisvKiBOT1RFOiAgQW4gaWRsZS10aW1lciBmdW5jdGlvbiBtYXkgbm90IG5lY2Vzc2Fy aWx5IHRyaWdnZXIgYHJlZGlzcGxheV93aW5kb3cnLgorICAgYHctPm11c3RfYmVfdXBkYXRlZF9w JyBpcyBzZXQgdG8gdHJ1ZSB3aXRoaW4gYG1jLWFjdGl2YXRlLWNyb3NzaGFpcnMnLgorLSAgYG9w dGltaXphdGlvbiAxYCAoZS5nLiwgbGVmdC9yaWdodCBjdXJzb3IgbW92ZW1lbnQgb24gdGhlIGZp cnN0IHNjcmVlbiBsaW5lKS4KKy0gIGBvcHRpbWl6YXRpb24gM2AgKGUuZy4sIGxlZnQvcmlnaHQg Y3Vyc29yIG1vdmVtZW50IG9uIHNjcmVlbiBsaW5lcyBzdWJzZXF1ZW50CisgICAgdG8gdGhlIGZp cnN0IHNjcmVlbiBsaW5lKSwgYnlwYXNzIGByZWRpc3BsYXlfd2luZG93Jy4gKi8KKworICAgIGlm ICh3LT5tdXN0X2JlX3VwZGF0ZWRfcCkKKyAgICAgIGdvdG8gdXBkYXRlOworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAJICAgICAgLyogV2UgdXNlZCB0byBhbHdheXMgZ290byBlbmRf b2ZfcmVkaXNwbGF5IGhlcmUsIGJ1dCB0aGlzCiAJCSBpc24ndCBlbm91Z2ggaWYgd2UgaGF2ZSBh IGJsaW5raW5nIGN1cnNvci4gICovCiAJICAgICAgaWYgKHctPmN1cnNvcl9vZmZfcCA9PSB3LT5s YXN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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAJCSAgZ290byB1cGRhdGU7CiAJCX0KIAkgICAgICBl bHNlCkBAIC0xNDczOCwxNiArMTk5NzUsNTggQEAgcmVkaXNwbGF5X3ByZXNlcnZlX2VjaG9fYXJl YSAoaW50IGZyb21fd2hlcmUpCiAgIGJsb2NrX2J1ZmZlcl9mbGlwcyAoKTsKICAgdW5ibG9ja19p bnB1dCAoKTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNP UlMgKi8KKworICBzdHJ1Y3Qgd2luZG93ICp3ID0gZGVjb2RlX2xpdmVfd2luZG93IChzZWxlY3Rl ZF93aW5kb3cpOworICB3LT5tYy5yZWRpc3BsYXlfcHJlc2VydmVfZWNob19hcmVhID0gZnJvbV93 aGVyZTsKKyAgbWNfcmVkaXNwbGF5X3ByZXNlcnZlX2VjaG9fYXJlYSA9IGZyb21fd2hlcmU7CisK ICAgaWYgKCFOSUxQIChlY2hvX2FyZWFfYnVmZmVyWzFdKSkKICAgICB7CiAgICAgICAvKiBXZSBo YXZlIGEgcHJldmlvdXNseSBkaXNwbGF5ZWQgbWVzc2FnZSwgYnV0IG5vIGN1cnJlbnQKIAkgbWVz c2FnZS4gIFJlZGlzcGxheSB0aGUgcHJldmlvdXMgbWVzc2FnZS4gICovCiAgICAgICBkaXNwbGF5 X2xhc3RfZGlzcGxheWVkX21lc3NhZ2VfcCA9IHRydWU7Ci0gICAgICByZWRpc3BsYXlfaW50ZXJu YWwgKCk7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JT ICovCisKKyAgICAgIG1jX3JlZGlzcGxheV9pbnRlcm5hbCA9IDQ7CisgICAgICByZWRpc3BsYXlf aW50ZXJuYWwgKDQpOworICAgICAgbWNfcmVkaXNwbGF5X2ludGVybmFsID0gMDsKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogICAgICAgZGlzcGxheV9sYXN0X2Rpc3BsYXllZF9tZXNz YWdlX3AgPSBmYWxzZTsKICAgICB9CiAgIGVsc2UKLSAgICByZWRpc3BsYXlfaW50ZXJuYWwgKCk7 CisgICAgeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09S UyAqLworCisgICAgICBtY19yZWRpc3BsYXlfaW50ZXJuYWwgPSA1OworICAgICAgcmVkaXNwbGF5 X2ludGVybmFsICg1KTsKKyAgICAgIG1jX3JlZGlzcGxheV9pbnRlcm5hbCA9IDA7CisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKKyAgICB9CisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgdy0+bWMucmVkaXNwbGF5X3ByZXNlcnZl X2VjaG9fYXJlYSA9IDA7CisgIG1jX3JlZGlzcGxheV9wcmVzZXJ2ZV9lY2hvX2FyZWEgPSAwOwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKwogCiAgIGZsdXNoX2ZyYW1lIChTRUxFQ1RFRF9G UkFNRSAoKSk7CiAgIHVuYmluZF90byAoY291bnQsIFFuaWwpOwpAQCAtMTczMDIsNiArMjI1ODEs MjUgQEAgcmVkaXNwbGF5X3dpbmRvdyAoTGlzcF9PYmplY3Qgd2luZG93LCBib29sIGp1c3RfdGhp c19vbmVfcCkKICAgZGVidWdfbWV0aG9kX2FkZCAodywgInJlY2VudGVyIik7CiAjZW5kaWYKIAor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworLyog Tk9URTogIEFuIGlkbGUtdGltZXIgZnVuY3Rpb24gbWF5IG5vdCBuZWNlc3NhcmlseSB0cmlnZ2Vy IGByZWRpc3BsYXlfd2luZG93Jy4KKyAgIGB3LT5tdXN0X2JlX3VwZGF0ZWRfcCcgaXMgc2V0IHRv IHRydWUgd2l0aGluIGBtYy1hY3RpdmF0ZS1jcm9zc2hhaXJzJy4KKy0gIGBvcHRpbWl6YXRpb24g MWAgKGUuZy4sIGxlZnQvcmlnaHQgY3Vyc29yIG1vdmVtZW50IG9uIHRoZSBmaXJzdCBzY3JlZW4g bGluZSkuCistICBgb3B0aW1pemF0aW9uIDNgIChlLmcuLCBsZWZ0L3JpZ2h0IGN1cnNvciBtb3Zl bWVudCBvbiBzY3JlZW4gbGluZXMgc3Vic2VxdWVudAorICAgIHRvIHRoZSBmaXJzdCBzY3JlZW4g bGluZSksIGJ5cGFzcyBgcmVkaXNwbGF5X3dpbmRvdycuICovCisKKyAgYmxvY2tfaW5wdXQgKCk7 CisgIG1jX3JlbW92ZV9tdWx0aXBsZV9jdXJzb3JzICh3KTsKKyAgbWNfcmVtb3ZlX2Nyb3NzaGFp cnMgKHcpOworICBtY19yZW1vdmVfZmlsbF9jb2x1bW4gKHcpOworICB1bmJsb2NrX2lucHV0ICgp OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKio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IG1jX3JlbW92ZV9tdWx0 aXBsZV9jdXJzb3JzICh3KTsKKyAgbWNfcmVtb3ZlX2Nyb3NzaGFpcnMgKHcpOworICBtY19yZW1v dmVfZmlsbF9jb2x1bW4gKHcpOworICB1bmJsb2NrX2lucHV0ICgpOworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKworCiAgIHNldF9idWZmZXJfaW50ZXJuYWxfMSAob2xkKTsKICAgLyogQXZv aWQgYW4gYWJvcnQgaW4gVEVNUF9TRVRfUFRfQk9USCBpZiB0aGUgYnVmZmVyIGhhcyBiZWNvbWUK ICAgICAgc2hvcnRlci4gIFRoaXMgY2FuIGJlIGNhdXNlZCBieSBsb2cgdHJ1bmNhdGlvbiBpbiAq TWVzc2FnZXMqLiAgKi8KQEAgLTIwMTIyLDYgKzI1NDM5LDE3IEBAIGFwcGVuZF9zcGFjZV9mb3Jf bmV3bGluZSAoc3RydWN0IGl0ICppdCwgYm9vbCBkZWZhdWx0X2ZhY2VfcCkKIAkgIG1lbXNldCAo Jml0LT5wb3NpdGlvbiwgMCwgc2l6ZW9mIGl0LT5wb3NpdGlvbik7CiAJICBpdC0+b2JqZWN0ID0g UW5pbDsKIAkgIGl0LT5jID0gaXQtPmNoYXJfdG9fZGlzcGxheSA9ICcgJzsKKworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworICAgICAgaWYgKElU X0JZVEVQT1MgKCppdCkgPj0gWlZfQllURSkKKyAgICAgICAgaXQtPnp2X3AgPSB0cnVlOworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICBpdC0+bGVuID0gMTsKIAogCSAgLyogSWYg dGhlIGRlZmF1bHQgZmFjZSB3YXMgcmVtYXBwZWQsIGJlIHN1cmUgdG8gdXNlIHRoZQpAQCAtMjEw ODUsNiArMjY0MTMsMjEgQEAgZGlzcGxheV9jb3VudF9saW5lc192aXN1YWxseSAoc3RydWN0IGl0 ICppdCkKIHN0YXRpYyB2b2lkCiBtYXliZV9wcm9kdWNlX2xpbmVfbnVtYmVyIChzdHJ1Y3QgaXQg Kml0KQogeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09S UyAqLworCisgIGJvb2wgYmFyZl9jcmFzaCA9IChpdC0+Z2x5cGhfcm93ID09IE5VTEwKKyAgICAg ICAgICAgICAgICAgICAgIHx8IGl0LT5nbHlwaF9yb3ctPnVzZWRbVEVYVF9BUkVBXSA9PSAwKQor ICAgICAgICAgICAgICAgICAgICA/IGZhbHNlCisgICAgICAgICAgICAgICAgICAgIDogdHJ1ZTsK KyAgaWYgKGJhcmZfY3Jhc2gpCisgICAgcmV0dXJuOworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKworCiAgIHB0cmRpZmZfdCBsYXN0X2xpbmUgPSBpdC0+bG51bTsKICAgcHRyZGlmZl90IHN0 YXJ0X2Zyb20sIGJ5dGVwb3M7CiAgIHB0cmRpZmZfdCB0aGlzX2xpbmU7CkBAIC0yMTI1NSw5ICsy NjU5OCwyMiBAQCBtYXliZV9wcm9kdWNlX2xpbmVfbnVtYmVyIChzdHJ1Y3QgaXQgKml0KQogICAg ICAgZWxzZQogCXRlbV9pdC5jID0gdGVtX2l0LmNoYXJfdG9fZGlzcGxheSA9ICpwOwogICAgICAg dGVtX2l0LmxlbiA9IDE7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RSBDVVJTT1JTICovCisKKyAgICAgIGlmIChiZXlvbmRfenYpCisgICAgICAgIHRlbV9pdC56dl9w ID0gdHJ1ZTsKKyAgICAgIHRlbV9pdC5jdXJyZW50X3kgPSBpdC0+Y3VycmVudF95OworICAgICAg dGVtX2l0LnZwb3MgPSBpdC0+dnBvczsKICAgICAgIC8qIE1ha2Ugc3VyZSB0aGVzZSBnbHlwaHMg d2lsbCBoYXZlIGEgInBvc2l0aW9uIiBvZiAtMS4gICovCiAgICAgICBTRVRfVEVYVF9QT1MgKHRl bV9pdC5wb3NpdGlvbiwgLTEsIC0xKTsKICAgICAgIFBST0RVQ0VfR0xZUEhTICgmdGVtX2l0KTsK KyAgICAgIHRlbV9pdC5ocG9zICs9IDE7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCiAK ICAgICAgIC8qIFN0b3AgcHJvZHVjaW5nIGdseXBocywgYW5kIHJlZnJhaW4gZnJvbSBwcm9kdWNp bmcgdGhlIGxpbmUKIAkgbnVtYmVyLCBpZiB3ZSBkb24ndCBoYXZlIGVub3VnaCBzcGFjZSBvbiB0 aGlzIGxpbmUuICAqLwpAQCAtMjY4NDEsNyArMzIxOTcsNjggQEAgZHJhd19nbHlwaHMgKHN0cnVj dCB3aW5kb3cgKncsIGludCB4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCiAJIHByZXBlbmRlZCBt dXN0IGJlIGRyYXduIGJlY2F1c2UgdGhlIGZpcnN0IGdseXBoIHN0cmluZwogCSBkcmF3cyBvdmVy IGl0LiAgKi8KICAgICAgIGkgPSBsZWZ0X292ZXJ3cml0dGVuIChoZWFkKTsKLSAgICAgIGlmIChp ID49IDApCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JT ICovCisKKyAgICAgIGJvb2wgc2tpcF9wID0gZmFsc2U7CisgICAgICBpbnQgYmVnID0gaTsKKwor ICAgICAgaWYgKGkgPj0gMAorICAgICAgICAgICYmIGhsID09IERSQVdfQ1VSU09SCisgICAgICAg ICAgJiYgKHctPm1jLmdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSAorICAgICAgICAgICAgICB8fCB3 LT5tYy5nbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgIHx8IHctPm1j LmdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSF9UQUIpKQorICAgICAgICB3aGlsZSAoYmVnIDwgc3Rh cnQpCisgICAgICAgICAgeworICAgICAgICAgICAgc3RydWN0IGdseXBoICpnbHlwaCA9IChyb3cp LT5nbHlwaHNbYXJlYV0gKyBiZWc7CisgICAgICAgICAgICBzd2l0Y2ggKGdseXBoLT50eXBlKQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICBjYXNlIENIQVJfR0xZUEg6CisgICAgICAgICAg ICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgQ09NUE9TSVRFX0dMWVBIOgorICAgICAg ICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIFNUUkVUQ0hfR0xZUEg6CisgICAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3QgY2hhcmFjdGVyID0g KENIQVJBQ1RFUlAgKG1ha2VfZml4bnVtIChnbHlwaC0+dS5jaCkpKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gRmNoYXJfdG9fc3RyaW5nIChtYWtlX2ZpeG51 bSAoZ2x5cGgtPnUuY2gpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogUW5pbDsKKyAgICAgICAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIlxuY2hhcmFj dGVyICglZCB8ICVzKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5 cGgtPnUuY2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoIU5JTFAgKGNo YXJhY3RlcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaC0+ dS5jaCA9PSAxMDQ4NTk2KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyAiXFxUIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChj aGFyYWN0ZXIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5 cGgtPnUuY2ggPT0gMTApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ ICJcXHQiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoIU5JTFAgKGNo YXJhY3RlcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlw aC0+dS5jaCA9PSAxMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g IlxcbiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICghTklMUCAoY2hh cmFjdGVyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBo LT51LmNoID09IDMyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAi XFxzIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChjaGFy YWN0ZXIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGgt PnUuY2ggIT0gOQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGds eXBoLT51LmNoICE9IDEwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgZ2x5cGgtPnUuY2ggIT0gMzIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IFNTREFUQSAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogIlxcPyIpKTsKKyAgICAgICAgICAgICAgICAgIHNraXBfcCA9IHRydWU7CisgICAg ICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGNh c2UgSU1BR0VfR0xZUEg6CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9Cisg ICAgICAgICAgICBiZWcgKz0gMTsKKyAgICAgICAgICB9CisKKyAgICAgIGlmIChpID49IDAKKyAg ICAgICAgICAmJiAhc2tpcF9wKQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJewog CSAgZW51bSBkcmF3X2dseXBoc19mYWNlIG92ZXJsYXBfaGw7CiAKQEAgLTI3MDY5LDYgKzMyNDg2 LDI0IEBAIGFwcGVuZF9nbHlwaCAoc3RydWN0IGl0ICppdCkKIAkgICAgZ1sxXSA9ICpnOwogCSAg Z2x5cGggPSBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJlYV07CiAJfQorCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+eCA9 IGl0LT5jdXJyZW50X3g7CisKKyAgICAgIGdseXBoLT55ID0gaXQtPmN1cnJlbnRfeTsKKworICAg ICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKworICAgICAgZ2x5cGgtPnZwb3MgPSBpdC0+dnBv czsKKworICAgICAgZ2x5cGgtPnp2X3AgPSBpdC0+enZfcDsKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogICAgICAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9zaXRpb24p OwogICAgICAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAgICAgICBpZiAoaXQtPnBpeGVs X3dpZHRoID4gMCkKQEAgLTI3MTUyLDYgKzMyNTg3LDI0IEBAIGFwcGVuZF9jb21wb3NpdGVfZ2x5 cGggKHN0cnVjdCBpdCAqaXQpCiAJICAgIGdbMV0gPSAqZzsKIAkgIGdseXBoID0gaXQtPmdseXBo X3Jvdy0+Z2x5cGhzW2l0LT5hcmVhXTsKIAl9CisKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgICAgIGdseXBoLT54ID0gaXQtPmN1cnJlbnRf eDsKKworICAgICAgZ2x5cGgtPnkgPSBpdC0+Y3VycmVudF95OworCisgICAgICBnbHlwaC0+aHBv cyA9IGl0LT5ocG9zOworCisgICAgICBnbHlwaC0+dnBvcyA9IGl0LT52cG9zOworCisgICAgICBn bHlwaC0+enZfcCA9IGl0LT56dl9wOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAg ICAgICBnbHlwaC0+Y2hhcnBvcyA9IGl0LT5jbXBfaXQuY2hhcnBvczsKICAgICAgIGdseXBoLT5v YmplY3QgPSBpdC0+b2JqZWN0OwogICAgICAgZWFzc2VydCAoaXQtPnBpeGVsX3dpZHRoIDw9IFNI UlRfTUFYKTsKQEAgLTI3MzYwLDYgKzMyODEzLDI0IEBAIHByb2R1Y2VfaW1hZ2VfZ2x5cGggKHN0 cnVjdCBpdCAqaXQpCiAJfQogICAgICAgaWYgKGdseXBoIDwgaXQtPmdseXBoX3Jvdy0+Z2x5cGhz W2FyZWEgKyAxXSkKIAl7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RSBDVVJTT1JTICovCisKKyAgICAgIGdseXBoLT54ID0gaXQtPmN1cnJlbnRfeDsKKworICAgICAg Z2x5cGgtPnkgPSBpdC0+Y3VycmVudF95OworCisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9z OworCisgICAgICBnbHlwaC0+dnBvcyA9IGl0LT52cG9zOworCisgICAgICBnbHlwaC0+enZfcCA9 IGl0LT56dl9wOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICBnbHlwaC0+Y2hh cnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAJICBnbHlwaC0+b2JqZWN0ID0gaXQtPm9i amVjdDsKIAkgIGdseXBoLT5waXhlbF93aWR0aCA9IGNsaXBfdG9fYm91bmRzICgtMSwgaXQtPnBp eGVsX3dpZHRoLCBTSFJUX01BWCk7CkBAIC0yNzQ2Myw2ICszMjkzNCwyNCBAQCBwcm9kdWNlX3h3 aWRnZXRfZ2x5cGggKHN0cnVjdCBpdCAqaXQpCiAJfQogICAgICAgaWYgKGdseXBoIDwgaXQtPmds eXBoX3Jvdy0+Z2x5cGhzW2FyZWEgKyAxXSkKIAl7CisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgICAgIGdseXBoLT54ID0gaXQtPmN1cnJl bnRfeDsKKworICAgICAgZ2x5cGgtPnkgPSBpdC0+Y3VycmVudF95OworCisgICAgICBnbHlwaC0+ aHBvcyA9IGl0LT5ocG9zOworCisgICAgICBnbHlwaC0+dnBvcyA9IGl0LT52cG9zOworCisgICAg ICBnbHlwaC0+enZfcCA9IGl0LT56dl9wOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAJICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAJICBnbHlwaC0+ b2JqZWN0ID0gaXQtPm9iamVjdDsKIAkgIGdseXBoLT5waXhlbF93aWR0aCA9IGNsaXBfdG9fYm91 bmRzICgtMSwgaXQtPnBpeGVsX3dpZHRoLCBTSFJUX01BWCk7CkBAIC0yNzU0OSw2ICszMzAzOCwy NCBAQCBhcHBlbmRfc3RyZXRjaF9nbHlwaCAoc3RydWN0IGl0ICppdCwgTGlzcF9PYmplY3Qgb2Jq ZWN0LAogCSAgICB3aWR0aCAtPSBpdC0+Zmlyc3RfdmlzaWJsZV94IC0gaXQtPmN1cnJlbnRfeDsK IAkgIGVhc3NlcnQgKHdpZHRoID4gMCk7CiAJfQorCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+eCA9IGl0LT5jdXJyZW50 X3g7CisKKyAgICAgIGdseXBoLT55ID0gaXQtPmN1cnJlbnRfeTsKKworICAgICAgZ2x5cGgtPmhw b3MgPSBpdC0+aHBvczsKKworICAgICAgZ2x5cGgtPnZwb3MgPSBpdC0+dnBvczsKKworICAgICAg Z2x5cGgtPnp2X3AgPSBpdC0+enZfcDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog ICAgICAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9zaXRpb24pOwogICAgICAgZ2x5 cGgtPm9iamVjdCA9IG9iamVjdDsKICAgICAgIC8qIEZJWE1FOiBJdCB3b3VsZCBiZSBiZXR0ZXIg dG8gdXNlIFRZUEVfTUFYIGhlcmUsIGJ1dApAQCAtMjgwMDMsNiArMzM1MTAsMjQgQEAgYXBwZW5k X2dseXBobGVzc19nbHlwaCAoc3RydWN0IGl0ICppdCwgaW50IGZhY2VfaWQsIGJvb2wgZm9yX25v X2ZvbnQsIGludCBsZW4sCiAJICAgIGdbMV0gPSAqZzsKIAkgIGdseXBoID0gaXQtPmdseXBoX3Jv dy0+Z2x5cGhzW2FyZWFdOwogCX0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1V TFRJUExFIENVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPnggPSBpdC0+Y3VycmVudF94OworCisg ICAgICBnbHlwaC0+eSA9IGl0LT5jdXJyZW50X3k7CisKKyAgICAgIGdseXBoLT5ocG9zID0gaXQt Pmhwb3M7CisKKyAgICAgIGdseXBoLT52cG9zID0gaXQtPnZwb3M7CisKKyAgICAgIGdseXBoLT56 dl9wID0gaXQtPnp2X3A7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIGds eXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5vYmpl Y3QgPSBpdC0+b2JqZWN0OwogICAgICAgZWFzc2VydCAoaXQtPnBpeGVsX3dpZHRoIDw9IFNIUlRf TUFYKTsKQEAgLTI5NzY5LDkgKzM1Mjk0LDMyIEBAIGRpc3BsYXlfYW5kX3NldF9jdXJzb3IgKHN0 cnVjdCB3aW5kb3cgKncsIGJvb2wgb24sCiAgICAgICB3LT5waHlzX2N1cnNvci52cG9zID0gdnBv czsKICAgICB9CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJT T1JTICovCisKKyAgdy0+bWMuaCA9IC0xOworICB3LT5tYy5meCA9IC0xOworICB3LT5tYy5meSA9 IC0xOworICB3LT5tYy5nbHlwaF9mbGF2b3IgPSBOT19GTEFWT1I7CisgIHctPm1jLnJlZCA9IC0x LjA7CisgIHctPm1jLmdyZWVuID0gLTEuMDsKKyAgdy0+bWMuYmx1ZSA9IC0xLjA7CisgIHctPm1j LnBvc2ludCA9IC0xOworCiAgIEZSQU1FX1JJRiAoZiktPmRyYXdfd2luZG93X2N1cnNvciAodywg Z2x5cGhfcm93LCB4LCB5LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5l d19jdXJzb3JfdHlwZSwgbmV3X2N1cnNvcl93aWR0aCwKICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBvbiwgYWN0aXZlX2N1cnNvcik7CisKKyAgbWNfbXVsdGlwbGVfY3Vyc29y c19wb3J0YWwgKHcsIG9uLCBhY3RpdmVfY3Vyc29yKTsKKworICBtY19jcm9zc2hhaXJzX3BvcnRh bCAodywgb24sIGFjdGl2ZV9jdXJzb3IpOworCisgIG1jX2ZpbGxfY29sdW1uX3BvcnRhbCAodywg b24sIGFjdGl2ZV9jdXJzb3IpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiB9CiAK IApAQCAtMzI1MjgsNiArMzgwNzYsMjggQEAgeF9pbnRlcnNlY3RfcmVjdGFuZ2xlcyAoWFJlY3Rh bmdsZSAqcjEsIFhSZWN0YW5nbGUgKnIyLCBYUmVjdGFuZ2xlICpyZXN1bHQpCiB2b2lkCiBzeW1z X29mX3hkaXNwICh2b2lkKQogeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUgQ1VSU09SUyAqLworCisgIGRlZnN1YnIgKCZTbWNfZHVtcF9nbHlwaF9yb3cpOworCisg IGRlZnN1YnIgKCZTbWNfZHVtcF9nbHlwaF9tYXRyaXgpOworCisgIGRlZnN1YnIgKCZTbWNfYWN0 aXZhdGVfbXVsdGlwbGVfY3Vyc29ycyk7CisKKyAgZGVmc3ViciAoJlNtY19hY3RpdmF0ZV9jcm9z c2hhaXJzKTsKKworICBkZWZzdWJyICgmU21jX3N0ZGVycik7CisKKyAgZGVmc3ViciAoJlNtY19k ZWJ1Zyk7CisKKyAgZGVmc3ViciAoJlNtY19hY3RpdmF0ZV9maWxsX2NvbHVtbik7CisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICAgVndpdGhfZWNob19hcmVhX3NhdmVfdmVjdG9yID0g UW5pbDsKICAgc3RhdGljcHJvICgmVndpdGhfZWNob19hcmVhX3NhdmVfdmVjdG9yKTsKIApkaWZm IC0tZ2l0IGEvc3JjL3h0ZXJtLmMgYi9zcmMveHRlcm0uYwppbmRleCAzYTdlMzFlLi4xZTk0OTJi IDEwMDY0NAotLS0gYS9zcmMveHRlcm0uYworKysgYi9zcmMveHRlcm0uYwpAQCAtOTkyLDYgKzk5 MiwxNSBAQCB4X3VwZGF0ZV9iZWdpbiAoc3RydWN0IGZyYW1lICpmKQogICBpZiAoRlJBTUVfVE9P TFRJUF9QIChmKSAmJiAhRlJBTUVfVklTSUJMRV9QIChmKSkKICAgICByZXR1cm47CiAKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgZi0+bWNf dXBkYXRpbmdfZnJhbWUgPSBmOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIGlm ICghIEZSQU1FX0NSX1NVUkZBQ0UgKGYpKQogICAgIHsKICAgICAgIGludCB3aWR0aCwgaGVpZ2h0 OwpAQCAtMTI1OCw2ICsxMjY3LDE2IEBAIHhfdXBkYXRlX2VuZCAoc3RydWN0IGZyYW1lICpmKQog ICBYRmx1c2ggKEZSQU1FX1hfRElTUExBWSAoZikpOwogICB1bmJsb2NrX2lucHV0ICgpOwogI2Vu ZGlmCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICov CisKKyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBOVUxMOworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKworCiB9CiAKIC8qIFRoaXMgZnVuY3Rpb24gaXMgY2FsbGVkIGZyb20gdmFyaW91cyBw bGFjZXMgaW4geGRpc3AuYwpAQCAtMTUzMCw2ICsxNTQ5LDIwIEBAIHN0YXRpYyB2b2lkIHhfY2hl Y2tfZm9udCAoc3RydWN0IGZyYW1lICosIHN0cnVjdCBmb250ICopOwogc3RhdGljIHZvaWQKIHhf c2V0X2N1cnNvcl9nYyAoc3RydWN0IGdseXBoX3N0cmluZyAqcykKIHsKKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworICBpZiAocy0+dy0+bWMu Y3Vyc29yX2djX2RlZmF1bHQpCisgICAgeworICAgICAgcy0+Z2MgPSBzLT5mLT5vdXRwdXRfZGF0 YS54LT5jdXJzb3JfZ2M7CisgICAgICByZXR1cm47CisgICAgfQorCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKworCiAgIGlmIChzLT5mb250ID09IEZSQU1FX0ZPTlQgKHMtPmYpCiAgICAgICAm JiBzLT5mYWNlLT5iYWNrZ3JvdW5kID09IEZSQU1FX0JBQ0tHUk9VTkRfUElYRUwgKHMtPmYpCiAg ICAgICAmJiBzLT5mYWNlLT5mb3JlZ3JvdW5kID09IEZSQU1FX0ZPUkVHUk9VTkRfUElYRUwgKHMt PmYpCkBAIC05MjUyLDYgKzkyODUsMjYgQEAgeF9kcmF3X2hvbGxvd19jdXJzb3IgKHN0cnVjdCB3 aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdykKIAogICAvKiBDb21wdXRlIGZyYW1lLXJl bGF0aXZlIGNvb3JkaW5hdGVzIGZvciBwaHlzIGN1cnNvci4gICovCiAgIGdldF9waHlzX2N1cnNv cl9nZW9tZXRyeSAodywgcm93LCBjdXJzb3JfZ2x5cGgsICZ4LCAmeSwgJmgpOworCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisvKiBMRUdFTkQ6 CisKKy0gIHRvcCB5ID09IFdJTkRPV19UT19GUkFNRV9QSVhFTF9ZICh3LCByb3ctPnkpCisKKy0g IGJvdHRvbSB5ID09IFdJTkRPV19UT19GUkFNRV9QSVhFTF9ZICh3LCByb3ctPnkpIC0gcm93LT5o ZWlnaHQKKworLSAgaCBvZiBIT0xMT1dfQk9YX0NVUlNPUiA9PSByb3ctPmhlaWdodAorICAgW1Ro aXMgYXZvaWRzIGEgdmlzaWJsZSBnYXAgYWJvdmUvYmVsb3cuXSAqLworCisgIGlmICh3LT5tYy5o ID4gMCkKKyAgICBoID0gcm93LT5oZWlnaHQ7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor CisKICAgd2QgPSB3LT5waHlzX2N1cnNvcl93aWR0aCAtIDE7CiAKICAgLyogVGhlIGZvcmVncm91 bmQgb2YgY3Vyc29yX2djIGlzIHR5cGljYWxseSB0aGUgc2FtZSBhcyB0aGUgbm9ybWFsCkBAIC05 MzI4LDcgKzkzODEsMTcgQEAgeF9kcmF3X2Jhcl9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0 cnVjdCBnbHlwaF9yb3cgKnJvdywgaW50IHdpZHRoLCBlbnVtIHRleHQKIAkgaW52aXNpYmxlLiAg VXNlIHRoZSBnbHlwaCdzIGZvcmVncm91bmQgY29sb3IgaW5zdGVhZCBpbiB0aGlzCiAJIGNhc2Us IG9uIHRoZSBhc3N1bXB0aW9uIHRoYXQgdGhlIGdseXBoJ3MgY29sb3JzIGFyZSBjaG9zZW4gc28K IAkgdGhhdCB0aGUgZ2x5cGggaXMgbGVnaWJsZS4gICovCi0gICAgICBpZiAoZmFjZS0+YmFja2dy b3VuZCA9PSBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwpCisKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgICAgIGlmIChmYWNlLT5i YWNrZ3JvdW5kID09IGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbAorICAgICAgICAgICYm ICF3LT5tYy5jdXJzb3JfZ2NfaW52aXNpYmxlX29rYXkpCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKIAl4Z2N2LmJhY2tncm91bmQgPSB4Z2N2LmZvcmVncm91bmQgPSBmYWNlLT5mb3Jl Z3JvdW5kOwogICAgICAgZWxzZQogCXhnY3YuYmFja2dyb3VuZCA9IHhnY3YuZm9yZWdyb3VuZCA9 IGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbDsKQEAgLTkzNTksNiArOTQyMiwxNyBAQCB4 X2RyYXdfYmFyX2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqcm93 LCBpbnQgd2lkdGgsIGVudW0gdGV4dAogCSAgaWYgKChjdXJzb3JfZ2x5cGgtPnJlc29sdmVkX2xl dmVsICYgMSkgIT0gMCkKIAkgICAgeCArPSBjdXJzb3JfZ2x5cGgtPnBpeGVsX3dpZHRoIC0gd2lk dGg7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICov CisKKyAgICAvKiBBbGlnbiBhbGwgZmFrZSBCQVJfQ1VSU09SIG9mIHRoZSBWRVJUSUNBTF9SVUxF UiB3aXRoIGBvcG9pbnRfeCcuICovCisgICAgaWYgKHctPm1jLmZ4ID4gMCkKKyAgICAgIHggPSB3 LT5tYy5meDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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01fSUQgKGYsIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAg ICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRh LngtPmN1cnNvcl9nYywgZGVmYXVsdF9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAg ICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRh LngtPmN1cnNvcl9nYywgaG9sbG93X2luYWN0aXZlX2ZhY2UtPmJhY2tncm91bmQpOworICAgICAg ICAgICAgICAgICAgfQorICAgICAgICAgIGJsb2NrX2lucHV0ICgpOworICAgICAgICAgIC8qIEZv cmNlIGB4X3NldF9jdXJzb3JfZ2MnIHRvIHVzZSBgcy0+Zi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29y X2djJy4gICovCisgICAgICAgICAgdy0+bWMuY3Vyc29yX2djX2RlZmF1bHQgPSB0cnVlOworICAg ICAgICAgIGRyYXdfcGh5c19jdXJzb3JfZ2x5cGggKHcsIGdseXBoX3JvdywgRFJBV19DVVJTT1Ip OworICAgICAgICAgIHctPm1jLmN1cnNvcl9nY19kZWZhdWx0ID0gZmFsc2U7CisgICAgICAgICAg Zi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djID0gb3JpZ2luYWxfY3Vyc29yX2djOworICAgICAg ICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBm LT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgICBmLT5vdXRwdXRf ZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBjb2xvci5waXhlbDsKKyAgICAgICAgICB4X2RyYXdfaG9s bG93X2N1cnNvciAodywgZ2x5cGhfcm93KTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5j dXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgIH0KKyAgICAgICAg ZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEggJiYgdy0+bWMucmVkID49IDAgJiYg dy0+bWMuYmx1ZSA+PSAwICYmIHctPm1jLmdyZWVuID49IDApCisgICAgICAgICAgeworICAgICAg ICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4 ZWwnLiAgKi8KKyAgICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IGNv bG9yLnBpeGVsOworICAgICAgICAgICAgeF9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIGdseXBoX3Jv dyk7CisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5h bF9jdXJzb3JfcGl4ZWw7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg IHhfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBnbHlwaF9yb3cpOworICAgICAgYnJlYWs7CisgICAg fQorICAgIGNhc2UgRklMTEVEX0JPWF9DVVJTT1I6CisgICAgeworICAgICAgaWYgKHctPm1jLnJl ZCA+PSAwICYmIHctPm1jLmJsdWUgPj0gMCAmJiB3LT5tYy5ncmVlbiA+PSAwKQorICAgICAgICAv KiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYycgYnkgYm9y cm93aW5nIHRoZQorICAgICAgICBmdW5jdGlvbmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHhmbnMu Yy4gICovCisgICAgICAgIHsKKyAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICBY R0NWYWx1ZXMgZ2NfdmFsdWVzOworICAgICAgICAgIHVuc2l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gICAgICAgICBkcmF3X3BoeXNfY3Vyc29yX2dseXBoICh3LCBnbHlwaF9yb3csIERSQVdf Q1VSU09SKTsKKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIEJBUl9DVVJTT1I6CisgICAg eworICAgICAgaWYgKHctPm1jLnJlZCA+PSAwICYmIHctPm1jLmJsdWUgPj0gMCAmJiB3LT5tYy5n cmVlbiA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBm LT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgICBmLT5vdXRwdXRf ZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBjb2xvci5waXhlbDsKKyAgICAgICAgICB3LT5tYy5jdXJz b3JfZ2NfaW52aXNpYmxlX29rYXkgPSB0cnVlOworICAgICAgICAgIHhfZHJhd19iYXJfY3Vyc29y ICh3LCBnbHlwaF9yb3csIGN1cnNvcl93aWR0aCwgQkFSX0NVUlNPUik7CisgICAgICAgICAgdy0+ bWMuY3Vyc29yX2djX2ludmlzaWJsZV9va2F5ID0gZmFsc2U7CisgICAgICAgICAgZi0+b3V0cHV0 X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9 CisgICAgICAgIGVsc2UKKyAgICAgICAgICB4X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cGhfcm93 LCBjdXJzb3Jfd2lkdGgsIEJBUl9DVVJTT1IpOworICAgICAgYnJlYWs7CisgICAgfQorICAgIGNh c2UgSEJBUl9DVVJTT1I6CisgICAgeworICAgICAgaWYgKHctPm1jLnJlZCA+PSAwICYmIHctPm1j LmJsdWUgPj0gMCAmJiB3LT5tYy5ncmVlbiA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyog VGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwnLiAgKi8K KyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBjb2xvci5waXhlbDsK KyAgICAgICAgICB3LT5tYy5jdXJzb3JfZ2NfaW52aXNpYmxlX29rYXkgPSB0cnVlOworICAgICAg ICAgIHhfZHJhd19iYXJfY3Vyc29yICh3LCBnbHlwaF9yb3csIGN1cnNvcl93aWR0aCwgSEJBUl9D VVJTT1IpOworICAgICAgICAgIHctPm1jLmN1cnNvcl9nY19pbnZpc2libGVfb2theSA9IGZhbHNl OworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1 cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeF9kcmF3X2Jh cl9jdXJzb3IgKHcsIGdseXBoX3JvdywgY3Vyc29yX3dpZHRoLCBIQkFSX0NVUlNPUik7CisgICAg ICBicmVhazsKKyAgICB9CisgICAgY2FzZSBOT19DVVJTT1I6CisgICAgICB3LT5waHlzX2N1cnNv cl93aWR0aCA9IDA7CisgICAgICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJv cnQgKCk7CisgIH0KKworLyogZW5kIE1VTFRJUExFIENVUlNPUlMgKi8KKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLwogCi0JICAgIGNhc2UgTk9fQ1VSU09SOgotCSAgICAgIHctPnBoeXNfY3Vyc29y X3dpZHRoID0gMDsKLQkgICAgICBicmVhazsKIAotCSAgICBkZWZhdWx0OgotCSAgICAgIGVtYWNz X2Fib3J0ICgpOwotCSAgICB9CiAJfQogCiAjaWZkZWYgSEFWRV9YX0kxOE4KQEAgLTEwNjQ0LDcg KzEwODYwLDcgQEAgZ2V0X2N1cnJlbnRfd21fc3RhdGUgKHN0cnVjdCBmcmFtZSAqZiwKICAgaW50 IHJjLCBhY3R1YWxfZm9ybWF0OwogICBBdG9tIGFjdHVhbF90eXBlOwogICB1bnNpZ25lZCBjaGFy ICp0bXBfZGF0YSA9IE5VTEw7Ci0gIEF0b20gKnJlcGx5X2RhdGEgVU5JTklUOworICBBdG9tICpy ZXBseV9kYXRhOwogI2VuZGlmCiAKICAgKnN0aWNreSA9IGZhbHNlOwo= --Multipart_Tue_Nov_20_20:53:56_2018-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs / fill-column). References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 14 Dec 2018 07:12:02 +0000 Resent-Message-ID: <handler.22873.B22873.154477147513743 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN>, Marcin Borkowski <mbork@HIDDEN>, Richard Stallman <rms@HIDDEN>, John Wiegley <johnw@HIDDEN>, Akio Burns <akioburns@HIDDEN>, Alan Third <athird@HIDDEN> Cc: 17684 <at> debbugs.gnu.org, 22873 <at> debbugs.gnu.org Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.154477147513743 (code B ref 22873); Fri, 14 Dec 2018 07:12:02 +0000 Received: (at 22873) by debbugs.gnu.org; 14 Dec 2018 07:11:15 +0000 Received: from localhost ([127.0.0.1]:47233 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1gXhcx-0003ZZ-A8 for submit <at> debbugs.gnu.org; Fri, 14 Dec 2018 02:11:15 -0500 Received: from gateway32.websitewelcome.com ([192.185.145.123]:23966) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1gXhcu-0003ZF-RO for 22873 <at> debbugs.gnu.org; Fri, 14 Dec 2018 02:11:13 -0500 Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway32.websitewelcome.com (Postfix) with ESMTP id E2C85166E21 for <22873 <at> debbugs.gnu.org>; Fri, 14 Dec 2018 01:11:11 -0600 (CST) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id XhctggyHi2qH7XhctgQmxb; Fri, 14 Dec 2018 01:11:11 -0600 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=4Bra0SEHd6MfgDQ1TpZxBvZjwHyrVtgN5xzSzKHnY6k=; b=EOPiziVtjFaDKJfZQ9VDQAHeL6 Eql/HfkfFuYvNIZeq5sD5HSzAs0RcuuT9HSf13DBkcFcJIsynXaBZBX4wEh2N2ONGE8hqPMrXo5Wc a3ueedq5aK3as66GLuhftOug0FHVVTIJASu3kKPhgsNzCpDWgcudhkNGZSRo3uiPUHgXOeKawqwZW romUPfb9MvOIJHRD2axa/TYDcu1kzBROwsKSURtYX3w82+jBouo/unvLqx5fVtI2i7Fe1+fVn+vkq gigpe9A78y4TXF5nwQNH4v9Wl0m5+MUNbE2KN77ZyNH37dN0svCKEgD5n4Em8KK9wkoJXqAwFPBUs LoxgRL/g==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:60064 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from <esq@HIDDEN>) id 1gXhcq-002UnL-9U; Fri, 14 Dec 2018 01:11:10 -0600 Date: Thu, 13 Dec 2018 23:11:07 -0800 Message-ID: <m21s6kinw4.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Thu_Dec_13_23:11:07_2018-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1gXhcq-002UnL-9U X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:60064 X-Source-Auth: lawlist X-Email-Count: 3 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> --Multipart_Thu_Dec_13_23:11:07_2018-1 Content-Type: text/plain; charset=US-ASCII Version 017.000 [12/13/2018] CHANGELOG: - nsterm.m: Cursors are now drawn subsequent to the expose_frame/window loop of dirty rectangles within drawRect. `update_window_cursor' within `expose_frame' is now disabled when HAVE_NS. - FRAMED_BOX_CURSOR is a new cursor type that is a variant of the FILLED_BOX_CURSOR, which has support for different colors depending upon whether it is in the active/inactive window and at the beginning/ending of an active region. - Visible fill column now takes into consideration the line number pixel-width and horizontal scrolling (if any) when calculating the X coordinate. - Disabled visible fill column when X coordinate is beyond text area width, and when prior to the line number pixel width (or zero if no line numbers) with horizontal scrolling in effect. - Restricted trace-redisplay messages to just the most relevant functions. - Customized a few of the faces to provide better visibility of crosshairs with a white background in an Emacs -Q situation. - Eliminated the usage of MC_GLYPH_TAB as there are really only two kinds that are used: MC_GLYPH | MC_GLYPHLESS - Eliminated a few abort / immediate return of functions that appear to no longer be necessary to avoid crashing Emacs. - Fixed one cash in the multiple fake cursors section of code when the real cursor is not associated with a glyph; i.e., `get_phys_cursor_glyph' == NULL. - As to the real fake cursor of crosshairs (intersection of vertical/horizontal rulers), when mc-real-fake-cursor is nil/"no"/'no, the BAR_CURSOR now uses MC_GLYPHLESS so as not to create a superimposed glyph on top of the MC_GLYPH that was placed when drawing the horizontal ruler. - Identified a right overhang situation that causes the fake cursor over a STRETCH to be erased. [Additional work is needed projects to be done below.] - `mc_get_phys_cursor_geometry' now uses `row->visible_height' without taking into consideration the FRAME_LINE_HEIGHT. - Added some tracing messages to a couple of functions. - Miscellaneous minor bug fixes. SETUP: Step 1: git clone -b master git://git.sv.gnu.org/emacs.git Step 2: In the new emacs folder, go back to an Emacs version from 12/13/2018: git reset --hard 8ffc0f2dd753879b0795714c29c86082aa9fd155 Step 3: From within the new emacs folder created in Step 1, apply the patch: git apply /path/to/the/attached.diff [There should not be any error messages at this point; i.e, you should be returned to a new command prompt.] Step 4: ./autogen.sh Step 5: ./configure ... [your custom options] Step 6: make Step 7: make install - To try out built-in fake cursors with Magnar Sveen's library (multiple-cursors), install that package first. [If the multiple-cursors package is installed, an eval-after-load "multiple-cursors-core" statement within crosshairs.el will redefine a couple of functions and set up a few keyboard shortcuts.] If the multiple-cursors package by Magnar Sveen is not already installed, then there are two easy ways to install that package: Type: M-x mc-install OR, evaluate the following snippet: (progn (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) (package-refresh-contents) (package-install 'multiple-cursors)) - To try out crosshairs and the visible fill column, type: M-x +-mode - To try out only the visible fill column, type: M-x mc-fill-column-mode - To try out the new cursor-type of a FRAMED_BOX_CURSOR without anything extra, evaluate the following snippet -- see the difference between inactive/active windows, and also the beginning/ending of an active region selection: (setq cursor-type 'framed cursor-in-non-selected-windows 'framed) - To use the new cursor type of a FRAMED_BOX_CURSOR with crosshairs or multiple fake cursors, evaluate the following snippet: (setq mc-real-fake-cursor 'framed) - To learn how to use the multiple fake cursors feature, examine the interactive function `mc-test'. - EXAMPLE OF HOW TO USE MULTIPLE FAKE CURSORS: ;;; (BUFFER-POSITION CURSOR-TYPE CURSOR-COLOR) ;;; (setq multiple-cursors-conf '((1 "hbar" "magenta") (2 "bar" "purple") (3 "box" "#00FF00") (4 "hollow" "#0000FF") (5 ("hbar" 3) [1.0 0.0 1.0]) (6 ("bar" 3) [0.0 1.0 1.0]))) ;;; TURN OFF. ;;; (setq multiple-cursors-conf nil) TODO: - The current test for `auto_hscroll_mode_p' only looks for `current_line` and all five related tests are based upon that assumption, which may not be true. - Continue working on the sections of code within `draw_glyphs' that are responsible for redrawing a stretch tab (erasing a fake cursor) when the previous/next character has a left/right overhang. left_overwritten: " A" right_overwritten (GNU Emacs welcome screen without `buffer-display-table') and the real fake cursor is to the immediate right of the word "Tour": "Emacs Guided Tour Overview". - Multiple Cursors: If point is in the middle of a composite character, then select a fully composed character so that the fake cursor is visible. - Fake cursors are being redrawn too often when non-selected visible windows have an ongoing process that require frequent redisplay updates (e.g., an eshell buffer. @lawlist may have already corrected the frequent redisplay issue as to mouse-overs, but will need to check this once again to be sure. - Set up some tests to see what (if anything) needs to be done so that these features play nicely with certain overlays and text properties. - Implement functionality similar to Lisp multiple-cursors by Magnar Sveen. - Create a comprehensive list of items to test when modifying these features; and, add a test file. - Follow up with the Emacs team re bug#32177; i.e., (Current line number shifts one column to the left.) - Follow up with the Emacs team re bug#32060; i.e., (Horizontal Scrolling (Current Line): Wrong line gets h-scrolled.) - Determine if bug #28936 needs to be fixed and help the Emacs team re same. HOW DOES IT WORK? - Fake cursors are removed in two (2) locations within `redisplay_internal' (if the cursor cache exists). If the frame is not being updated, then call `update_begin' before removing and call `update_end' when removing is complete. - Fake cursors are removed in two (2) locations within `redisplay_window' (if the cursor cache exists). If the frame is not being updated, then call `update_begin' before removing and call `update_end' when removing is complete. - Whenever `display_and_set_cursor' is called and not immediately returned, cursors are calculated and drawn; or, if the cursor cache already exist, then erase and redraw. If the frame is not being updated, then call `update_begin' before drawing/removing and call `update_end' when drawing/removing is complete. - The calculations for drawing fake cursors are based upon modified versions of the functions `dump_glyph_matrix' and `dump_glyph_row', which generate the correct coordinates for placing the fake cursors. - Fake cursors come in two types: (1) cursor with a glyph on top; (2) cursor with nothing on top [e.g., floating anywhere on the visible window]. - There are two basic settings: (1) draw or erase/redraw forthwith (whenever the real cursor would ordinarily be drawn); or, (2) draw on an idle-timer and, if the cursor cache exists, then erase/redraw in certain circumstances when the real cursor would ordinarily be redrawn. New calculations and cursor cache update occur on the initial call of either of the aforementioned two scenarios. - All three features (multiple fake cursors, crosshairs, and visible fill column) operate on the same principal. There are similar functions for each feature, with the only main difference being that multiple fake cursors look for a particular buffer position when dumping the glyph matrix and looping through each row, whereas crosshairs and visible fill column look for a particular window relative X coordinate. - At this time, there is nothing fancy about multiple fake cursors -- i.e., Emacs only looks for a buffer position and creates a fake cursor with the desired cursor type and cursor color. Magnar's Lisp library is still the only mechanism I am aware of that does the magic. Instead of placing a visible overlay where fake cursors would ordinarily be created using Magnar's library, there are a few modifications to his Lisp functions that are contained within crosshairs.el. From the list of fake cursor overlays created by Magnar's library, Emacs gathers the list of buffer positions and then draws built-in fake cursors that are within the confines of the visible windows. --Multipart_Thu_Dec_13_23:11:07_2018-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="2018_12_13__21_40_08_511.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvY3Jvc3NoYWlycy5lbCBiL2xpc3AvY3Jvc3NoYWlycy5lbApuZXcg ZmlsZSBtb2RlIDEwMDc1NQppbmRleCAwMDAwMDAwLi5mNDE1NWE4Ci0tLSAvZGV2L251bGwKKysr IGIvbGlzcC9jcm9zc2hhaXJzLmVsCkBAIC0wLDAgKzEsMTI4NCBAQAorOzs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Cis7OzsgQkVHSU4gbW9kaWZpY2F0aW9uIG9mIHRoZSBNdWx0aXBsZSBDdXJzb3Jz IGxpYnJhcnkgd3JpdHRlbiBieSAgTWFnbmFyIFN2ZWVuLgorCisoZGVmdmFyIHBhY2thZ2UtYXJj aGl2ZXMpCisKKyhkZWZ2YXIgbWMtLW1heC1jdXJzb3JzLW9yaWdpbmFsKQorKGRlZnZhciBtYy9t YXgtY3Vyc29ycykKKyhkZWZ2YXIgbWMtLW1heC1jdXJzb3JzLW9yaWdpbmFsKQorKGRlZnZhciBt Yy9tYXgtY3Vyc29ycykKKyhkZWZ2YXIgbWMvYWx3YXlzLXJ1bi1mb3ItYWxsKQorKGRlZnZhciBt Yy0tdGhpcy1jb21tYW5kKQorKGRlZnZhciBtYy9jbWRzLXRvLXJ1bi1vbmNlKQorKGRlZnZhciBt Yy0tZGVmYXVsdC1jbWRzLXRvLXJ1bi1mb3ItYWxsKQorKGRlZnZhciBtYy9jbWRzLXRvLXJ1bi1m b3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c29ycykpCisgICAgKHdoZW4gbWMvbWF4LWN1cnNvcnMKKyAgICAgICh1bmxlc3Mg KDwgKG1jL251bS1jdXJzb3JzKSBtYy9tYXgtY3Vyc29ycykKKyAgICAgICAgKGlmICh5ZXMtb3It bm8tcCAoZm9ybWF0ICIlZCBhY3RpdmUgY3Vyc29ycy4gQ29udGludWU/ICIgKG1jL251bS1jdXJz b3JzKSkpCisgICAgICAgICAgICAoc2V0cSBtYy9tYXgtY3Vyc29ycyAocmVhZC1udW1iZXIgIkVu dGVyIGEgbmV3LCB0ZW1wb3JhcnkgbWF4aW11bTogIikpCisgICAgICAgICAgKG1jL3JlbW92ZS1m YWtlLWN1cnNvcnMpCisgICAgICAgICAgKGVycm9yICJBYm9ydGVkOiB0b28gbWFueSBjdXJzb3Jz IikpKSkKKyAgICAobGV0ICgob3ZlcmxheQorICAgICAgICAgICAgKGlmIG1jL3VzZS1idWlsdC1p bi1jdXJzb3JzCisgICAgICAgICAgICAgIChtYWtlLW92ZXJsYXkgKHBvaW50KSAocG9pbnQpKQor ICAgICAgICAgICAgICAobWMvbWFrZS1jdXJzb3Itb3ZlcmxheS1hdC1wb2ludCkpKSkKKyAgICAg IChvdmVybGF5LXB1dCBvdmVybGF5ICdtYy1pZCAob3IgaWQgKG1jL2NyZWF0ZS1jdXJzb3ItaWQp KSkKKyAgICAgIChvdmVybGF5LXB1dCBvdmVybGF5ICd0eXBlICdmYWtlLWN1cnNvcikKKyAgICAg IChvdmVybGF5LXB1dCBvdmVybGF5ICdwcmlvcml0eSAxMDApCisgICAgICAobWMvc3RvcmUtY3Vy cmVudC1zdGF0ZS1pbi1vdmVybGF5IG92ZXJsYXkpCisgICAgICAod2hlbiAodXNlLXJlZ2lvbi1w KQorICAgICAgICAob3ZlcmxheS1wdXQgb3ZlcmxheSAncmVnaW9uLW92ZXJsYXkKKyAgICAgICAg ICAgICAgICAgICAgIChtYy9tYWtlLXJlZ2lvbi1vdmVybGF5LWJldHdlZW4tcG9pbnQtYW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YGRlc2NyaWJlLWJpbmRpbmdzJy4gIFNvLCBsZXQncyByZS1gaW50ZXJuJyBoZXJlIHRvCisgICAg ICAgICAgICAgICAgOzsgbWFrZSB0aGUgY29tbWFuZCBjb21wYXJhYmxlIGJ5IGBlcScuCisgICAg ICAgICAgICAgICAgKHNldHEgb3JpZ2luYWwtY29tbWFuZCAoaW50ZXJuIChzeW1ib2wtbmFtZSBv cmlnaW5hbC1jb21tYW5kKSkpCisgICAgICAgICAgICAgICAgOzsgb3RoZXJ3aXNlIGl0J3MgYSBz eW1ib2wsIGFuZCB3ZSBjYW4gYmUgbW9yZSB0aG9yb3VnaAorICAgICAgICAgICAgICAgIChpZiAo Z2V0IG9yaWdpbmFsLWNvbW1hbmQgJ21jLS11bnN1cHBvcnRlZCkKKyAgICAgICAgICAgICAgICAg ICAgKG1lc3NhZ2UgIiVTIGlzIG5vdCBzdXBwb3J0ZWQgd2l0aCBtdWx0aXBsZSBjdXJzb3JzJXMi CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9yaWdpbmFsLWNvbW1hbmQKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgKGdldCBvcmlnaW5hbC1jb21tYW5kICdtYy0tdW5zdXBwb3J0 ZWQpKQorICAgICAgICAgICAgICAgICAgKHdoZW4gKGFuZCBvcmlnaW5hbC1jb21tYW5kCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIChub3QgKG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy0t ZGVmYXVsdC1jbWRzLXRvLXJ1bi1vbmNlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg KG5vdCAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jL2NtZHMtdG8tcnVuLW9uY2UpKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAob3IgbWMvYWx3YXlzLXJ1bi1mb3ItYWxsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jLS1kZWZh dWx0LWNtZHMtdG8tcnVuLWZvci1hbGwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jL2NtZHMtdG8tcnVuLWZvci1hbGwpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAobWMvcHJvbXB0LWZvci1pbmNsdXNpb24taW4td2hp dGVsaXN0IG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAgICAgICAgICAgICAgICAgICAgKG1jL2V4ZWN1 dGUtY29tbWFuZC1mb3ItYWxsLWZha2UtY3Vyc29ycyBvcmlnaW5hbC1jb21tYW5kKSkpKQorICAg ICAgICAgICAgICAod2hlbiBtYy91c2UtYnVpbHQtaW4tY3Vyc29ycworICAgICAgICAgICAgICAg IChzZXRxIG11bHRpcGxlLWN1cnNvcnMtY29uZgorICAgICAgICAgICAgICAgICAgICAgICAgKG1h cGNhcgorICAgICAgICAgICAgICAgICAgICAgICAgICAobGFtYmRhICh4KSAobGlzdCAob3Zlcmxh eS1zdGFydCB4KSAiYmFyIiBuaWwpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAobWMvYWxs LWZha2UtY3Vyc29ycykpKSkpKSkpKSkKKworICAoZGVmdW4gbWMvbWFyay1uZXh0LWxpa2UtdGhp cy1jeWNsZS1mb3J3YXJkICgpCisgICJNYXJrcyBuZXh0IG9jY3VyZW5jZSBvZiB3b3JkIGxpa2Ug dGhpcyBhbmQgYWR2YW5jZXMgY3Vyc29yIHRvIHRoaXMgb2NjdXJyZW5jZSIKKyAgKGludGVyYWN0 aXZlKQorICAgIChtYy9tYXJrLW5leHQtbGlrZS10aGlzIDEpKQorCisgIChkZWZ1biBtYy9tYXJr LXByZXZpb3VzLWxpa2UtdGhpcy1jeWNsZS1mb3J3YXJkICgpCisgICJNYXJrcyBuZXh0IG9jY3Vy cmVuY2Ugb2Ygd29yZCBsaWtlIHRoaXMgYW5kIGFkdmFuY2VzIGN1cnN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gICAgICAgKDIgImJh ciIgInB1cnBsZSIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoMyAiYm94 IiAiIzAwRkYwMCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoNCAiaG9s bG93IiAiIzAwMDBGRiIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoNSAo ImhiYXIiIDMpIFsxLjAgMC4wIDEuMF0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAoNiAoImJhciIgMykgWzAuMCAxLjAgMS4wXSkpKSkKKyAgICAoc2VsZWN0LXdpbmRvdyAo ZGlzcGxheS1idWZmZXIgYnVmZmVyKSkKKyAgICA7OzsgVGhlIHRyaWdnZXIgaW4gYGtleWJvYXJk LmNgIGlzIG5vdCBhY3RpdmF0ZWQgaW4gdGhpcyBleGFtcGxlLCBzbyB3ZQorICAgIDs7OyBmb3Jj ZSB0aGUgbXVsdGlwbGUgY3Vyc29ycyB0byBiZSBkcmF3bi4KKyAgICAobWMtYWN0aXZhdGUtbXVs dGlwbGUtY3Vyc29ycyAoc2VsZWN0ZWQtd2luZG93KSkpKQorCisoZGVmdW4gKy10aW1lci1mbiAo KQorIlNpbmNlIHRoaXMgZmlyZXMgZ2xvYmFsbHksIHdlIG11c3QgY29udHJvbCB3aGljaCBidWZm ZXJzIGNyb3NzaGFpcnMgYXBwZWFyIGluLiIKKyAgKHdoZW4gKy1tb2RlCisgICAgKHVubGVzcyAo bWVtcSBsYXN0LWNvbW1hbmQgKy1wYXJlbnMtZXhjbHVzaW9ucykKKyAgICAgICgrLXBhcmVucy1m bikpCisgICAgKHdoZW4gKy10aW1lci12YXIKKyAgICAgIChzZXRxIHRpbWVyLWlkbGUtbGlzdCAo ZGVscSArLXRpbWVyLXZhciB0aW1lci1pZGxlLWxpc3QpKQorICAgICAgKHNldHEgKy10aW1lci12 YXIgbmlsKSkKKyAgICAodW5sZXNzIGNyb3NzaGFpcnMtZ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5kb3cpKSkpCisgICAgICAoc2V0cSArLXRpbWVyLXZhciAocnVuLXdpdGgtaWRs ZS10aW1lciArLWlkbGUtdGltZXItc2Vjb25kcyBuaWwgIycrLXRpbWVyLWZuKSkpKSkKKworKGRl ZnZhciBtYy1maWxsLWNvbHVtbi1tb2RlKQorCis7OzsjIyNhdXRvbG9hZAorKGRlZmluZS1taW5v ci1tb2RlICstbW9kZQorIk1pbm9yIG1vZGUgZm9yIGRpc3BsYXlpbmcgYSBob3Jpem9udGFsIHJ1 bGVyLiIKKyAgOmluaXQtdmFsdWUgbmlsCisgIDpsaWdodGVyICIgKyIKKyAgOmtleW1hcCBuaWwK KyAgOmdsb2JhbCBuaWwKKyAgOmdyb3VwICcrLW1vZGUKKyAgKGNvbmQKKyAgICAoKy1tb2RlCisg ICAgICA7OzsgYCstbW9kZScgaGFzIHRoZSBhYmlsaXR5IHRvIGFsc28gZGlzcGxheSBhIGZpbGwg Y29sdW1uIGluZGljYXRvci4KKyAgICAgIDs7OyBTZWUgdGhlIHZhcmlhYmxlIGArLWZpbGwtY29s dW1uJy4KKyAgICAgICh3aGVuIG1jLWZpbGwtY29sdW1uLW1vZGUKKyAgICAgICAgKG1jLWZpbGwt Y29sdW1uLW1vZGUgLTEpKQorICAgICAgKHdoZW4gKGFuZCBnbG9iYWwtZWxkb2MtbW9kZQorICAg ICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAgICAg ICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAoZ2xvYmFsLWVs ZG9jLW1vZGUgLTEpKQorICAgICAgKHdoZW4gKGFuZCBqaXQtbG9jay1jb250ZXh0LXRpbWVyCisg ICAgICAgICAgICAgICAgIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAg ICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVuICh0 aW1lcnAgaml0LWxvY2stY29udGV4dC10aW1lcikKKyAgICAgICAgICAoY2FuY2VsLXRpbWVyIGpp dC1sb2NrLWNvbnRleHQtdGltZXIpKQorICAgICAgICA7OyAoc2V0cSBqaXQtbG9jay1jb250ZXh0 LXRpbWVyIChydW4td2l0aC1pZGxlLXRpbWVyIDUuMCAncmVwZWF0ICdqaXQtbG9jay1jb250ZXh0 LWZvbnRpZnkpKQorICAgICAgICAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIG5pbCkpCisg ICAgICAod2hlbiAoYW5kIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAg ICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVuICh0 aW1lcnAgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpCisgICAgICAgICAgKGNhbmNl bC10aW1lciB1bmRvLWF1dG8tY3VycmVudC1ib3VuZGFyeS10aW1lcikpCisgICAgICAgIChmc2V0 ICd1bmRvLWF1dG8tLXVuZG9hYmxlLWNoYW5nZQorICAgICAgICAgICAgICAobGFtYmRhICgpIChh ZGQtdG8tbGlzdCAndW5kby1hdXRvLS11bmRvYWJseS1jaGFuZ2VkLWJ1ZmZlcnMgKGN1cnJlbnQt YnVmZmVyKSkpKQorICAgICAgICAoZnNldCAndW5kby1hdXRvLWFtYWxnYW1hdGUgJ2lnbm9yZSkp CisgICAgICAod2hlbiBibGluay1jdXJzb3ItbW9kZQorICAgICAgICAoYmxpbmstY3Vyc29yLW1v ZGUgLTEpCisgICAgICAgICh3aGVuIChtZW1xICdibGluay1jdXJzb3ItY2hlY2sgcG9zdC1jb21t YW5kLWhvb2spCisgICAgICAgICAgKHJlbW92ZS1ob29rICdwb3N0LWNvbW1hbmQtaG9vayAnYmxp bmstY3Vyc29yLWNoZWNrKSkpCisgICAgICAod2hlbiAoYW5kIChjYWxsZWQtaW50ZXJhY3RpdmVs eS1wICdhbnkpCisgICAgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0 KSkKKyAgICAgICAgICAgICAgICAgKG51bGwgY3Jvc3NoYWlycy1kcmF3LWZvcnRod2l0aCkpCisg ICAgICAgIChzZXRxIGNyb3NzaGFpcnMtZHJhdy1mb3J0aHdpdGggdCkpCisgICAgICAoc2V0cSBj cm9zc2hhaXJzIHQpCisgICAgICAod2hlbiArLWZpbGwtY29sdW1uCisgICAgICAgIChzZXRxIG1j LWZpbGwtY29sdW1uIHQpKQorICAgICAgKHdoZW4gKGFuZCArLWZpbGwtY29sdW1uCisgICAgICAg ICAgICAgICAgIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAg IChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkKKyAgICAgICAgICAgICAgICAgKG51bGwg bWMtZmlsbC1jb2x1bW4tZHJhdy1mb3J0aHdpdGgpKQorICAgICAgICAoc2V0cSBtYy1maWxsLWNv bHVtbi1kcmF3LWZvcnRod2l0aCB0KSkKKyAgICAgIDs7OyBgYXV0by1jb21wb3NpdGlvbi1tb2Rl JyBpcyBuZWVkZWQgZm9yIGNyb3NzaGFpcnMgdG8gcHJvcGVybHkgY2FsY3VsYXRlCisgICAgICA7 OzsgY29vcmRpbmF0ZXMgb2YgY29tcG9zaXRpb24gY2hhcmFjdGVycy4gIEF1dG9tYXRpY2FsbHkg YmVjb21lcyBwZXJtYW5lbnRseQorICAgICAgOzs7IGJ1ZmZlci1sb2NhbCB3aGVuIHNldC4KKyAg ICAgICh1bmxlc3MgYXV0by1jb21wb3NpdGlvbi1tb2RlCisgICAgICAgIChzZXRxIGF1dG8tY29t cG9zaXRpb24tbW9kZSB0KSkKKyAgICAgIDs7OyBAbGF3bGlzdCBpcyBmb2N1c2luZyB0aGUgaW5p dGlhbCBkZXZlbG9wbWVudCBvZiBmZWF0dXJlIHJlcXVlc3RzICMxNzY4NAorICAgICAgOzs7IGFu ZCAjMjI4NzMgb24gTDJSIGxhbmd1YWdlcy4gIFRoZSBmZWF0dXJlIHRlc3QgZmlsZSB1c2VkIGJ5 IEBsYXdsaXN0CisgICAgICA7OzsgYm9ncyBFbWFjcyBkb3duIHVubGVzcyBgYmlkaS1kaXNwbGF5 LXJlb3JkZXJpbmcnIGlzIHNldCB0byBhIG5pbCB2YWx1ZS4KKyAgICAgIDs7OyBIb3dldmVyLCBt b3N0IHVzZXJzIHdpbGwgcHJvYmFibHkgbm90IHdhbnQgdGhpcyBwYXJ0aWN1bGFyIHNldHRpbmcu CisgICAgICAodW5sZXNzIChudWxsIGJpZGktZGlzcGxheS1yZW9yZGVyaW5nKQorICAgICAgICAo c2V0cSBiaWRpLWRpc3BsYXktcmVvcmRlcmluZyBuaWwpKQorICAgICAgKHVubGVzcyAoYW5kIChj YWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgICAgKGVxdWFsIGN1 cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAgICAgICAgKHNldCAobWFrZS1sb2NhbC12YXJpYWJs ZSAnKy0tc2F2ZWQtc3RhdGUpIG5pbCkKKyAgICAgICAgKGRvbGlzdCAodmFyICcoYnVmZmVyLWRp c3BsYXktdGFibGUKKyAgICAgICAgICAgICAgICAgICAgICAgZnJpbmdlLWluZGljYXRvci1hbGlz dAorICAgICAgICAgICAgICAgICAgICAgICB0YWItd2lkdGgKKyAgICAgICAgICAgICAgICAgICAg ICAgbGluZS1tb3ZlLXZpc3VhbAorICAgICAgICAgICAgICAgICAgICAgICB0cnVuY2F0ZS1saW5l cworICAgICAgICAgICAgICAgICAgICAgICB0cnVuY2F0ZS1wYXJ0aWFsLXdpZHRoLXdpbmRvd3MK KyAgICAgICAgICAgICAgICAgICAgICAgd29yZC13cmFwKSkKKyAgICAgICAgICAod2hlbiAobG9j YWwtdmFyaWFibGUtcCB2YXIpCisgICAgICAgICAgICAocHVzaCAoY29ucyB2YXIgKHN5bWJvbC12 YWx1ZSB2YXIpKSArLS1zYXZlZC1zdGF0ZSkpKQorICAgICAgICAoc2V0cSBmaWxsLWNvbHVtbiA4 MCkKKyAgICAgICAgKHNldHEgZGlzcGxheS1saW5lLW51bWJlcnMgdCkKKyAgICAgICAgKHNldHEt bG9jYWwgYXV0by1oc2Nyb2xsLW1vZGUgJ2N1cnJlbnQtbGluZSkKKyAgICAgICAgKHNldHEtbG9j YWwgaHNjcm9sbC1zdGVwIDUpCisgICAgICAgIChzZXRxIGJ1ZmZlci1kaXNwbGF5LXRhYmxlICst YnVmZmVyLWRpc3BsYXktdGFibGUpCisgICAgICAgIChzZXRxIHRhYi13aWR0aCA0KQorICAgICAg ICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICdsaW5lLW1vdmUtdmlzdWFsKSB0KQorICAgICAg ICAoc2V0cSB0cnVuY2F0ZS1saW5lcworICAgICAgICAgIChjb25kCisgICAgICAgICAgICAoKGxl dCAoKGxzdCArLXRydW5jYXRlLWxpbmVzLWRlcml2ZWQtbW9kZXMpCisgICAgICAgICAgICAgICAg ICAgIG1vZGUpCisgICAgICAgICAgICAgIChjYXRjaCAnZm91bmQKKyAgICAgICAgICAgICAgICAo d2hpbGUgKHNldHEgbW9kZSAocG9wIGxzdCkpCisgICAgICAgICAgICAgICAgICAod2hlbiAoZGVy aXZlZC1tb2RlLXAgbW9kZSkKKyAgICAgICAgICAgICAgICAgICAgKHRocm93ICdmb3VuZCB0KSkp KSkpCisgICAgICAgICAgICAgKChtZW1xIG1ham9yLW1vZGUgKy10cnVuY2F0ZS1saW5lcy1tYWpv ci1tb2RlcykpCisgICAgICAgICAgICAgKHQKKyAgICAgICAgICAgICAgIG5pbCkpKQorICAgICAg ICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICd0cnVuY2F0ZS1wYXJ0aWFsLXdpZHRoLXdpbmRv d3MpIG5pbCkKKyAgICAgICAgKHNldHEgd29yZC13cmFwIHQpCisgICAgICAgIChzZXRxIGluZGlj YXRlLWVtcHR5LWxpbmVzIHQpCisgICAgICAgIChzZXRxIGluZGljYXRlLWJ1ZmZlci1ib3VuZGFy aWVzICdsZWZ0KQorICAgICAgICAoc2V0cSBmcmluZ2UtaW5kaWNhdG9yLWFsaXN0CisgICAgICAg ICAgICA7OzsgaHNjbF9hbGxfdGVtcF9wIHwgaHNjbF90ZW1wX3AKKyAgICAgICAgICAnKCgrLWhz Y2wtdGVtcCAuICgrLXNpbmdsZS1hbmdsZS1sZWZ0CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgKy1kb3VibGUtYW5nbGUtbGVmdCkpCisgICAgICAgICAgICA7OzsgaHNjbF9hbGxfcGVybV8w X3AgfCBoc2NsX2FsbF9wZXJtXzFfcCB8IGhzY2xfYWxsX3Blcm1fMl9wIHwgaHNjbF9wZXJtX3AK KyAgICAgICAgICAgICgrLWhzY2wtcGVybSAuICgrLXNpbmdsZS1hbmdsZS11cAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICstZG91YmxlLWFuZ2xlLXVwCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKy10cmlwbGUtYW5nbGUtdXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAr LXF1YWRydXBsZS1hbmdsZS11cCkpCisgICAgICAgICAgICAoKy1vdmVybGF5LWFycm93IC4gKCst ZnJpbmdlLWxlZnQtYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKy1mcmlu Z2UtcmlnaHQtYXJyb3cpKQorICAgICAgICAgICAgKHRydW5jYXRpb24gLiAoKy1mcmluZ2UtbGVm dC1hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgKy1mcmluZ2UtcmlnaHQtYXJyb3cp KQorICAgICAgICAgICAgKGNvbnRpbnVhdGlvbiAuICgrLWZyaW5nZS1sZWZ0LWN1cmx5LWFycm93 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICstYmFja3NsYXNoKSkKKyAgICAgICAgICAg IChvdmVybGF5LWFycm93IC4gKy1mcmluZ2UtcmlnaHQtdHJpYW5nbGUpCisgICAgICAgICAgICAo dXAgLiArLWZyaW5nZS11cC1hcnJvdykKKyAgICAgICAgICAgIChkb3duIC4gKy1mcmluZ2UtZG93 bi1hcnJvdykKKyAgICAgICAgICAgICh0b3AgLiArLWZyaW5nZS10b3AtbGVmdC1hbmdsZSkKKyAg ICAgICAgICAgIChib3R0b20gLiArLWZyaW5nZS1ib3R0b20tcmlnaHQtYW5nbGUpCisgICAgICAg ICAgICAodG9wLWJvdHRvbSAuICgrLWZyaW5nZS1sZWZ0LWJyYWNrZXQKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICstZnJpbmdlLXJpZ2h0LWJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICstZnJpbmdlLXRvcC1yaWdodC1hbmdsZQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgKy1mcmluZ2UtdG9wLWxlZnQtYW5nbGUpKQorICAgICAgICAgICAgKGVtcHR5LWxpbmUgLiAr LWZyaW5nZS1lbXB0eS1saW5lKQorICAgICAgICAgICAgKHVua25vd24gLiArLWZyaW5nZS1xdWVz dGlvbi1tYXJrKSkpCisgICAgICAgIChzZXRxIGZyaW5nZS1jdXJzb3ItYWxpc3QgJygoYm94IC4g Ky1mcmluZ2UtbGVmdC10cmlhbmdsZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIChob2xsb3cgLiArLWhvbGxvdy1yZWN0YW5nbGUpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAoYmFyIC4gKy12ZXJ0aWNhbC1iYXIpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAoaGJhciAuICstZnJpbmdlLWhvcml6b250YWwtYmFyKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGhvbGxvdy1zbWFsbCAuICstZnJpbmdlL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ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OworCisoZGVmdW4gKy1wYXJlbnMtZm4gKCkKKyAgIkRv Yy1zdHJpbmcuIgorICAobGV0KiAoKG9wb2ludCAocG9pbnQpKQorICAgICAgICAgKGZyb20gKGlm ICstcGFyZW5zLWZyb20tZm4KKyAgICAgICAgICAgICAgICAgKGZ1bmNhbGwgKy1wYXJlbnMtZnJv bS1mbikKKyAgICAgICAgICAgICAgICAgKHBvaW50LW1pbikpKQorICAgICAgICAgKHdpbiAoc2Vs ZWN0ZWQtd2luZG93KSkKKyAgICAgICAgIChpIDApCisgICAgICAgICAocHJlY2VkaW5nLWNoYXIg KHByZWNlZGluZy1jaGFyKSkKKyAgICAgICAgIChvY2hhciAoY2hhci1hZnRlciBvcG9pbnQpKQor ICAgICAgICAgKHBvczEKKyAgICAgICAgICAgKGNvbmQKKyAgICAgICAgICAgICAoKGFuZCBvY2hh cgorICAgICAgICAgICAgICAgICAgIChvciA7OzsgKGNoYXItdG8tc3RyaW5nIDQwKSA9PiBvcGVu aW5nIHBhcmVudGhlc2lzCisgICAgICAgICAgICAgICAgICAgICAgICg9IG9jaGFyIDQwKQorICAg ICAgICAgICAgICAgICAgICAgICA7OzsgKGNoYXItdG8tc3RyaW5nIDkxKSA9PiBvcGVuaW5nIHNx dWFyZSBicmFja2V0CisgICAgICAgICAgICAgICAgICAgICAgICg9IG9jaGFyIDkxKQorICAgICAg ICAgICAgICAgICAgICAgICA7OzsgKGNoYXItdG8tc3RyaW5nIDEyMykgPT4gb3BlbmluZyB3YXZ5 IGJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgMTIzKSkpCisgICAgICAg ICAgICAgICAgKG1pbiAoMSsgb3BvaW50KSAocG9pbnQtbWF4KSkpCisgICAgICAgICAgICAgKChv ciA7OzsgKGNoYXItdG8tc3RyaW5nIDQxKSA9PiBjbG9zaW5nIHBhcmVudGhlc2lzCisgICAgICAg ICAgICAgICAgICAoPSBwcmVjZWRpbmctY2hhciA0MSkKKyAgICAgICAgICAgICAgICAgIDs7OyAo Y2hhci10by1zdHJpbmcgOTMpID0+IGNsb3Npbmcgc3F1YXJlIGJyYWNrZXQKKyAgICAgICAgICAg ICAgICAgICg9IHByZWNlZGluZy1jaGFyIDkzKQorICAgICAgICAgICAgICAgICAgOzs7IChjaGFy LXRvLXN0cmluZyAxMjUpID0+IGNsb3Npbmcgd2F2eSBicmFja2V0CisgICAgICAgICAgICAgICAg ICAoPSBwcmVjZWRpbmctY2hhciAxMjUpKQorICAgICAgICAgICAgICAgIChtYXggKHBvaW50LW1p bikgKDEtIG9wb2ludCkpKQorICAgICAgICAgICAgICh0CisgICAgICAgICAgICAgICAgb3BvaW50 KSkpCisgICAgICAgICBwb3MyCisgICAgICAgICBzZWxlY3RlZC1mYWNlKQorICAgIChzYXZlLWV4 Y3Vyc2lvbgorICAgICAgKGNvbmRpdGlvbi1jYXNlIG5pbAorICAgICAgICAod2hpbGUgKHNldHEg cG9zMSAobnRoIDEgKHBhcnNlLXBhcnRpYWwtc2V4cCBmcm9tIHBvczEpKSkKKyAgICAgICAgICAo c2V0cSBwb3MyIChzY2FuLXNleHBzIHBvczEgMSkpCisgICAgICAgICAgKGlmICg9IGkgMTApCisg ICAgICAgICAgICAoc2V0cSBpIDEpCisgICAgICAgICAgICAoc2V0cSBpICgxKyBpKSkpCisgICAg ICAgICAgKHNldHEgc2VsZWN0ZWQtZmFjZSAoY29uZAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAoKD0gaSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBh cmVucy1vbmUtZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgMikK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtdHdvLWZhY2UpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDMpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJystcGFyZW5zLXRocmVlLWZhY2UpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICgoPSBpIDQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJystcGFyZW5zLWZvdXItZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg KCg9IGkgNSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtZml2 ZS1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA2KQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1zaXgtZmFjZSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgNykKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAnKy1wYXJlbnMtc2V2ZW4tZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKCg9IGkgOCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1w YXJlbnMtZWlnaHQtZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkg OSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtbmluZS1mYWNl KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSAxMCkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtdGVuLWZhY2UpKSkKKyAgICAgICAgICAo bGV0ICgob3YgKG1ha2Utb3ZlcmxheSBwb3MxICgxKyBwb3MxKSkpKQorICAgICAgICAgICAgKHVu bGVzcyArLXBhcmVucy1pbmFjdGl2ZS13aW5kb3dzCisgICAgICAgICAgICAgIChvdmVybGF5LXB1 dCBvdiAnd2luZG93IHdpbikpCisgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ2ZhY2Ugc2Vs ZWN0ZWQtZmFjZSkpCisgICAgICAgICAgKHdoZW4gcG9zMgorICAgICAgICAgICAgKGxldCAoKG92 IChtYWtlLW92ZXJsYXkgKDEtIHBvczIpIHBvczIpKSkKKyAgICAgICAgICAgICAgKHVubGVzcyAr LXBhcmVucy1pbmFjdGl2ZS13aW5kb3dzCisgICAgICAgICAgICAgICAgKG92ZXJsYXktcHV0IG92 ICd3aW5kb3cgd2luKSkKKyAgICAgICAgICAgICAgKG92ZXJsYXktcHV0IG92ICdmYWNlIHNlbGVj dGVkLWZhY2UpKSkpCisgICAgICAgIChlcnJvciBuaWwpKSkKKyAgICAoc2V0cSArLXBhcmVucy1v dmVybGF5cy1leGlzdC1wIHQpKSkKKworKGRlZnVuICstcmVtb3ZlLW92ZXJsYXlzIChiZWcgZW5k IG5hbWUgdmFsKQorIlJlbW92ZSB0aGUgb3ZlcmxheXMgdGhhdCBhcmUgYGVxdWFsLWluY2x1ZGlu Zy1wcm9wZXJ0aWVzYC4KK0luY2x1ZGVzIGEgdW5pcXVlIHNpdHVhdGlvbiB3aGVuIGFuIG92ZXJs YXkgd2l0aCBhbiBgJ2FmdGVyLXN0cmluZ2AgcHJvcGVydHkKK2lzIGF0IHRoZSB2ZXJ5IGVuZCBv ZiBhIG5hcnJvd2VkLWJ1ZmZlci4iCisgIChsZXQqICgocG9pbnQtbWF4IChwb2ludC1tYXgpKQor ICAgICAgICAgKHBvaW50LW1pbiAocG9pbnQtbWluKSkKKyAgICAgICAgIChuYXJyb3dlZC1wIChi dWZmZXItbmFycm93ZWQtcCkpCisgICAgICAgICAoYmVnIChpZiBiZWcgYmVnIHBvaW50LW1pbikp CisgICAgICAgICAoZW5kCisgICAgICAgICAgIChjb25kCisgICAgICAgICAgICAgKChhbmQKKyAg ICAgICAgICAgICAgICAgKG5vdCBuYXJyb3dlZC1wKQorICAgICAgICAgICAgICAgICBlbmQpCisg ICAgICAgICAgICAgICBlbmQpCisgICAgICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAg KG5vdCBuYXJyb3dlZC1wKQorICAgICAgICAgICAgICAgICAobnVsbCBlbmQpKQorICAgICAgICAg ICAgICAgcG9pbnQtbWF4KQorICAgICAgICAgICAgICgoYW5kCisgICAgICAgICAgICAgICAgIG5h cnJvd2VkLXAKKyAgICAgICAgICAgICAgICAgZW5kCisgICAgICAgICAgICAgICAgICg8IGVuZCBw b2ludC1tYXgpKQorICAgICAgICAgICAgICAgZW5kKQorICAgICAgICAgICAgICgoYW5kCisgICAg ICAgICAgICAgICAgIG5hcnJvd2VkLXAKKyAgICAgICAgICAgICAgICAgZW5kCisgICAgICAgICAg ICAgICAgICg9IGVuZCBwb2ludC1tYXgpKQorICAgICAgICAgICAgICAgKDErIGVuZCkpCisgICAg ICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFycm93ZWQtcAorICAgICAgICAgICAg ICAgICAobnVsbCBlbmQpKQorICAgICAgICAgICAgICAgKDErIHBvaW50LW1heCkpICkpCisgICAg ICAgICAob3ZlcmxheXMKKyAgICAgICAgICAgKHByb2duCisgICAgICAgICAgICAgKG92ZXJsYXkt cmVjZW50ZXIgZW5kKQorICAgICAgICAgICAgIChvdmVybGF5cy1pbiBiZWcgZW5kKSkpKQorICAg ICh3aGVuIChhbmQgYmVnIGVuZCBuYW1lIHZhbCkKKyAgICAgIChkb2xpc3QgKG8gb3ZlcmxheXMp CisgICAgICAgIChjb25kCisgICAgICAgICAgKChhbmQgKGVxIG5hbWUgJ2ZhY2UpCisgICAgICAg ICAgICAgICAgKGVxIChvdmVybGF5LWdldCBvIG5hbWUpIHZhbCkpCisgICAgICAgICAgICA7OyBF aXRoZXIgcHVzaCB0aGlzIG92ZXJsYXkgb3V0c2lkZSBiZWcuLi5lbmQKKyAgICAgICAgICAgIDs7 IG9yIHNwbGl0IGl0IHRvIGV4Y2x1ZGUgYmVnLi4uZW5kCisgICAgICAgICAgICA7OyBvciBkZWxl dGUgaXQgZW50aXJlbHkgKGlmIGl0IGlzIGNvbnRhaW5lZCBpbiBiZWcuLi5lbmQpLgorICAgICAg ICAgICAgKGlmICg8IChvdmVybGF5LXN0YXJ0IG8pIGJlZykKKyAgICAgICAgICAgICAgICAoaWYg KD4gKG92ZXJsYXktZW5kIG8pIGVuZCkKKyAgICAgICAgICAgICAgKHByb2duCisgICAgICAgICAg ICAgICAgKG1vdmUtb3ZlcmxheSAoY29weS1vdmVybGF5IG8pCisgICAgICAgICAgICAgICAgICAo b3ZlcmxheS1zdGFydCBvKSBiZWcpCisgICAgICAgICAgICAgICAgKG1vdmUtb3ZlcmxheSBvIGVu ZCAob3ZlcmxheS1lbmQgbykpKQorICAgICAgICAgICAgICAgICAgKG1vdmUtb3ZlcmxheSBvIChv dmVybGF5LXN0YXJ0IG8pIGJlZykpCisgICAgICAgICAgICAgIChpZiAoPiAob3ZlcmxheS1lbmQg bykgZW5kKQorICAgICAgICAgICAgICAgICAgKG1vdmUtb3ZlcmxheSBvIGVuZCAob3ZlcmxheS1l bmQgbykpCisgICAgICAgICAgICAgICAgKGRlbGV0ZS1vdmVybGF5IG8pKSkpCisgICAgICAgICAg KChhbmQgKG5vdCAoZXEgbmFtZSAnZmFjZSkpCisgICAgICAgICAgICAgICAgKGVxdWFsLWluY2x1 ZGluZy1wcm9wZXJ0aWVzIChvdmVybGF5LWdldCBvIG5hbWUpIHZhbCkpCisgICAgICAgICAgICAo ZGVsZXRlLW92ZXJsYXkgbykpKSkpKSkKKworKGRlZnVuICstZGVsZXRlLXBhcmVucy1vdmVybGF5 cyAoKQorICAod2hlbiArLXBhcmVucy1vdmVybGF5cy1leGlzdC1wCisgICAgKGRvbGlzdCAoZmFj ZSAnKCstcGFyZW5zLW9uZS1mYWNlCisgICAgICAgICAgICAgICAgICAgICstcGFyZW5zLXR3by1m YWNlCisgICAgICAgICAgICAgICAgICAgICstcGFyZW5zLXRocmVlLWZhY2UKKyAgICAgICAgICAg ICAgICAgICAgKy1wYXJlbnMtZm91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lsbC1jb2x1bW4tbW9k ZQorICAgICAgKHdoZW4gKGFuZCBnbG9iYWwtZWxkb2MtbW9kZQorICAgICAgICAgICAgICAgICAo Y2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAgICAgICAgICAoZXF1YWwgY3Vy cmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAoZ2xvYmFsLWVsZG9jLW1vZGUgLTEpKQor ICAgICAgKHdoZW4gKGFuZCBqaXQtbG9jay1jb250ZXh0LXRpbWVyCisgICAgICAgICAgICAgICAg IChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgIChlcXVhbCBj dXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVuICh0aW1lcnAgaml0LWxvY2st Y29udGV4dC10aW1lcikKKyAgICAgICAgICAoY2FuY2VsLXRpbWVyIGppdC1sb2NrLWNvbnRleHQt dGltZXIpKQorICAgICAgICA7OyAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIChydW4td2l0 aC1pZGxlLXRpbWVyIDUuMCAncmVwZWF0ICdqaXQtbG9jay1jb250ZXh0LWZvbnRpZnkpKQorICAg ICAgICAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIG5pbCkpCisgICAgICAod2hlbiAoYW5k IChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgIChlcXVhbCBj dXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVuICh0aW1lcnAgdW5kby1hdXRv LWN1cnJlbnQtYm91bmRhcnktdGltZXIpCisgICAgICAgICAgKGNhbmNlbC10aW1lciB1bmRvLWF1 dG8tY3VycmVudC1ib3VuZGFyeS10aW1lcikpCisgICAgICAgIChmc2V0ICd1bmRvLWF1dG8tLXVu ZG9hYmxlLWNoYW5nZQorICAgICAgICAgICAgICAobGFtYmRhICgpIChhZGQtdG8tbGlzdCAndW5k by1hdXRvLS11bmRvYWJseS1jaGFuZ2VkLWJ1ZmZlcnMgKGN1cnJlbnQtYnVmZmVyKSkpKQorICAg ICAgICAoZnNldCAndW5kby1hdXRvLWFtYWxnYW1hdGUgJ2lnbm9yZSkpCisgICAgICAod2hlbiBi bGluay1jdXJzb3ItbW9kZQorICAgICAgICAoYmxpbmstY3Vyc29yLW1vZGUgLTEpCisgICAgICAg ICh3aGVuIChtZW1xICdibGluay1jdXJzb3ItY2hlY2sgcG9zdC1jb21tYW5kLWhvb2spCisgICAg ICAgICAgKHJlbW92ZS1ob29rICdwb3N0LWNvbW1hbmQtaG9vayAnYmxpbmstY3Vyc29yLWNoZWNr KSkpCisgICAgICAod2hlbiAoYW5kIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAg ICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkKKyAgICAgICAgICAg ICAgICAgKG51bGwgbWMtZmlsbC1jb2x1bW4tZHJhdy1mb3J0aHdpdGgpKQorICAgICAgICAoc2V0 cSBtYy1maWxsLWNvbHVtbi1kcmF3LWZvcnRod2l0aCB0KSkKKyAgICAgIChzZXRxIG1jLWZpbGwt Y29sdW1uIHQpCisgICAgICA7OzsgYGF1dG8tY29tcG9zaXRpb24tbW9kZScgaXMgbmVlZGVkIGZv ciBjcm9zc2hhaXJzIHRvIHByb3Blcmx5IGNhbGN1bGF0ZQorICAgICAgOzs7IGNvb3JkaW5hdGVz IG9mIGNvbXBvc2l0aW9uIGNoYXJhY3RlcnMuICBBdXRvbWF0aWNhbGx5IGJlY29tZXMgcGVybWFu ZW50bHkKKyAgICAgIDs7OyBidWZmZXItbG9jYWwgd2hlbiBzZXQuCisgICAgICAodW5sZXNzIGF1 dG8tY29tcG9zaXRpb24tbW9kZQorICAgICAgICAoc2V0cSBhdXRvLWNvbXBvc2l0aW9uLW1vZGUg dCkpCisgICAgICA7OzsgQGxhd2xpc3QgaXMgZ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XctZm9ydGh3aXRoIik7CisgIERF RlNZTSAoUW11bHRpcGxlX2N1cnNvcnNfaW5hY3RpdmVfd2luZG93cywgIm11bHRpcGxlLWN1cnNv cnMtaW5hY3RpdmUtd2luZG93cyIpOworICBERUZTWU0gKFFjcm9zc2hhaXJzLCAiY3Jvc3NoYWly cyIpOworICBERUZTWU0gKFFjcm9zc2hhaXJzX2hvcml6b250YWxfcnVsZXIsICJjcm9zc2hhaXJz LWhvcml6b250YWwtcnVsZXIiKTsKKyAgREVGU1lNIChRY3Jvc3NoYWlyc192ZXJ0aWNhbF9ydWxl ciwgImNyb3NzaGFpcnMtdmVydGljYWwtcnVsZXIiKTsKKyAgREVGU1lNIChRY3Jvc3NoYWlyc19k cmF3X2ZvcnRod2l0aCwgImNyb3NzaGFpcnMtZHJhdy1mb3J0aHdpdGgiKTsKKyAgREVGU1lNIChR Y3Jvc3NoYWlyc19pbmFjdGl2ZV93aW5kb3dzLCAiY3Jvc3NoYWlycy1pbmFjdGl2ZS13aW5kb3dz Iik7CisgIERFRlNZTSAoUW1jX3N0ZGVyciwgIm1jLXN0ZGVyciIpOworICBERUZTWU0gKFFtY19m aWxsX2NvbHVtbiwgIm1jLWZpbGwtY29sdW1uIik7CisgIERFRlNZTSAoUW1jX2ZpbGxfY29sdW1u X2RyYXdfZm9ydGh3aXRoLCAibWMtZmlsbC1jb2x1bW4tZHJhdy1mb3J0aHdpdGgiKTsKKyAgREVG U1lNIChRbWNfZmlsbF9jb2x1bW5faW5hY3RpdmVfd2luZG93LCAibWMtZmlsbC1jb2x1bW4taW5h Y3RpdmUtd2luZG93Iik7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgREVGU1lN IChRY2hvaWNlLCAiY2hvaWNlIik7CiAgIERFRlNZTSAoUWxlZnQsICJsZWZ0Iik7CiAgIERFRlNZ TSAoUXJpZ2h0LCAicmlna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plY3QgY2FjaGVfbG9uZ19zY2Fuc187CiAKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgLyogVGhl IGN1cnNvciB0eXBlIG9mIHRoZSByZWFsIGZha2UgY3Vyc29yLiAqLworICBMaXNwX09iamVjdCBt Y19yZWFsX2Zha2VfY3Vyc29yXzsKKworICAvKiBUaGUgbmFtZSBvZiBsaXN0IHVzZWQgYnkgbXVs dGlwbGUgY3Vyc29ycyBmb3IgbmV4dCByZWRpc3BsYXkuICovCisgIExpc3BfT2JqZWN0IG11bHRp cGxlX2N1cnNvcnNfY29uZl87CisKKyAgLyogV2hldGhlciB0byBkcmF3IG11bHRpcGxlIGN1cnNv cnMgaW1tZWRpYXRlbHksIG9yIG9uIGFuIGlkbGUtdGltZXIuICovCisgIExpc3BfT2JqZWN0IG11 bHRpcGxlX2N1cnNvcnNfZHJhd19mb3J0aHdpdGhfOworCisgIC8qIFdoZXRoZXIgdG8gZHJhdyBt dWx0aXBsZSBjdXJzb3JzIGluIGluYWN0aXZlIHdpbmRvd3MuICovCisgIExpc3BfT2JqZWN0IG11 bHRpcGxlX2N1cnNvcnNfaW5hY3RpdmVfd2luZG93c187CisKKyAgLyogVGhlIG5hbWUgb2YgdGhl IGJ1ZmZlci1sb2NhbCB2YXJpYWJsZS4gKi8KKyAgTGlzcF9PYmplY3QgY3Jvc3NoYWlyc187CisK KyAgLyogVGhlIG5hbWUgb2YgdGhlIGNyb3NzaGFpcnMgaG9yaXpvbnRhbCBydWxlci4gKi8KKyAg TGlzcF9PYmplY3QgY3Jvc3NoYWlyc19ob3Jpem9udGFsX3J1bGVyXzsKKworICAvKiBUaGUgbmFt ZSBvZiB0aGUgY3Jvc3NoYWlycyB2ZXJ0aWNhbCBydWxlci4gKi8KKyAgTGlzcF9PYmplY3QgY3Jv c3NoYWlyc192ZXJ0aWNhbF9ydWxlcl87CisKKyAgLyogV2hldGhlciB0byBkcmF3IGNyb3NzaGFp cnMgaW1tZWRpYXRlbHksIG9yIG9uIGFuIGlkbGUtdGltZXIuICovCisgIExpc3BfT2JqZWN0IGNy b3NzaGFpcnNfZHJhd19mb3J0aHdpdGhfOworCisgIC8qIFdoZXRoZXIgdG8gZHJhdyBjcm9zc2hh aXJzIGluIGluYWN0aXZlIHdpbmRvd3MuICovCisgIExpc3BfT2JqZWN0IGNyb3NzaGFpcnNfaW5h Y3RpdmVfd2luZG93c187CisKKyAgLyogVXNlZCBpbiBjb25qdW5jdGlvbiB3aXRoIGdlbmVyYXRp bmcgc3RkZXJyIGRlYnVnZ2luZyBtZXNzYWdlLiAqLworICBMaXNwX09iamVjdCBtY19zdGRlcnJf OworCisgIC8qIFRoZSBuYW1lIG9mIHRoZSBidWZmZXItbG9jYWwgdmFyaWFibGUuICovCisgIExp c3BfT2JqZWN0IG1jX2ZpbGxfY29sdW1uXzsKKworICAvKiBXaGV0aGVyIHRvIGRyYXcgbXVsdGlw bGUgY3Vyc29ycyBmaWxsIGNvbHVtbiBpbW1lZGlhdGVseSwgb3Igb24gYW4gaWRsZS10aW1lci4g Ki8KKyAgTGlzcF9PYmplY3QgbWNfZmlsbF9jb2x1bW5fZHJhd19mb3J0aHdpdGhfOworCisgIC8q IFdoZXRoZXIgdG8gZHJhdyBtdWx0aXBsZSBjdXJzb3JzIGZpbGwgY29sdW1uIGluIGluYWN0aXZl IHdpbmRvd3MuICovCisgIExpc3BfT2JqZWN0IG1jX2ZpbGxfY29sdW1uX2luYWN0aXZlX3dpbmRv d3NfOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIElmIHRoZSB3aWR0aCBy dW4gY2FjaGUgaXMgZW5hYmxlZCwgdGhpcyB0YWJsZSBjb250YWlucyB0aGUKICAgICAgY2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ioqKioq KioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCitlbnVtIG1j X3R5cGVzCit7CisgIE5PX0ZMQVZPUiwKKyAgTUNfR0xZUEgsCisgIE1DX0dMWVBITEVTUywKKyAg TUNfT1ZFUkxBWV9BUlJPV19CSVRNQVAsCisgIE1DX1BJTENST1csCisgIE1DX0hPTExPV19SRUNU QU5HTEVfUklHSFRfQVJST1csCisgIE1DX0hPTExPV19SRUNUQU5HTEUsCisgIE1DX1ZFUlRJQ0FM X0JBUl9SSUdIVF9BUlJPVywKKyAgTUNfVkVSVElDQUxfQkFSLAorICBNQ19WRVJUSUNBTF9CQVJf QkFDS1NMQVNICit9OworCiAvKiBUZXh0IGN1cnNvciB0eXBlcy4gICovCiAKIGVudW0gdGV4dF9j dXJzb3Jfa2luZHMKIHsKICAgREVGQVVMVF9DVVJTT1IgPSAtMiwKICAgTk9fQ1VSU09SID0gLTEs CisgIEZSQU1FRF9CT1hfQ1VSU09SLAogICBGSUxMRURfQk9YX0NVUlNPUiwKICAgSE9MTE9XX0JP WF9DVVJTT1IsCiAgIEJBUl9DVVJTT1IsCiAgIEhCQVJfQ1VSU09SCiB9OwogCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAvKiBWYWx1ZXMgcmV0dXJuZWQgZnJvbSBjb29yZGluYXRlc19p bl93aW5kb3cuICAqLwogCiBlbnVtIHdpbmRvd19wYXJ0CkBAIC0zNzksNiArNDAxLDE4IEBAIHN0 cnVjdCBnbHlwaF9zbGljZQogCiBzdHJ1Y3QgZ2x5cGgKIHsKKworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworICBpbnQgeCwgeSwgaHBvcywgdnBv czsKKworICBib29sX2JmIHp2X3AgOiAxOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAgIC8qIFBvc2l0aW9uIGZyb20gd2hpY2ggdGhpcyBnbHlwaCB3YXMgZHJhd24uICBJZiBgb2Jq ZWN0JyBiZWxvdyBpcyBhCiAgICAgIExpc3Agc3RyaW5nLCB0aGlzIGlzIGFuIGluZGV4IGludG8g dGhhdCBzdHJpbmcuICBJZiBpdCBpcyBhCiAgICAgIGJ1ZmZlciwgdGhpcyBpcyBhIHBvc2l0aW9u IGluIHRoYXQgYnVmZmVyLiAgSW4gYWRkaXRpb24sIHNvbWUKQEAgLTIyMTMsNiArMjI0NywxNiBA QCBzdHJ1Y3QgY29tcG9zaXRpb25faXQKIAogc3RydWN0IGl0CiB7CisKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgYm9vbF9iZiB6dl9wIDog MTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBUaGUgd2luZG93IGluIHdo aWNoIHdlIGl0ZXJhdGUgb3ZlciBjdXJyZW50X2J1ZmZlciAob3IgYSBzdHJpbmcpLiAgKi8KICAg TGlzcF9PYmplY3Qgd2luZG93OwogICBzdHJ1Y3Qgd2luZG93ICp3OwpAQCAtMzI5OCw2ICszMzQy LDE2IEBAIGV4dGVybiB2b2lkIGhhbmRsZV90b29sX2Jhcl9jbGljayAoc3RydWN0IGZyYW1lICos CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCwgaW50LCBib29sLCBpbnQp OwogCiBleHRlcm4gdm9pZCBleHBvc2VfZnJhbWUgKHN0cnVjdCBmcmFtZSAqLCBpbnQsIGludCwg aW50LCBpbnQpOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VS U09SUyAqLworCitleHRlcm4gdm9pZCBtY19leHBvc2VfZnJhbWUgKHN0cnVjdCBmcmFtZSAqLCBp bnQsIGludCwgaW50LCBpbnQpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiBleHRl cm4gYm9vbCB4X2ludGVyc2VjdF9yZWN0YW5nbGVzIChYUmVjdGFuZ2xlICosIFhSZWN0YW5nbGUg KiwgWFJlY3RhbmdsZSAqKTsKICNlbmRpZgkvKiBIQVZFX1dJTkRPV19TWVNURU0gKi8KIApkaWZm IC0tZ2l0IGEvc3JjL2ZyYW1lLmggYi9zcmMvZnJhbWUuaAppbmRleCBhZDczNzZhLi4zMWQ5NTI3 IDEwMDY0NAotLS0gYS9zcmMvZnJhbWUuaAorKysgYi9zcmMvZnJhbWUuaApAQCAtMjAyLDYgKzIw MiwxNiBAQCBzdHJ1Y3QgZnJhbWUKIAogICAvKiBCZXlvbmQgaGVyZSwgdGhlcmUgc2hvdWxkIGJl IG5vIG1vcmUgTGlzcF9PYmplY3QgY29tcG9uZW50cy4gICovCiAKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgLyogTm9uLW5pbCB3aGVuIHRo ZSBmcmFtZSBpcyBpbiB0aGUgcHJvY2VzcyBvZiBiZWluZyB1cGRhdGVkLiAqLworICBzdHJ1Y3Qg ZnJhbWUgKm1jX3VwZGF0aW5nX2ZyYW1lOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAgIC8qIENhY2hlIG9mIHJlYWxpemVkIGZhY2VzLiAgKi8KICAgc3RydWN0IGZhY2VfY2FjaGUg KmZhY2VfY2FjaGU7CiAKZGlmZiAtLWdpdCBhL3NyYy9mcmluZ2UuYyBiL3NyYy9mcmluZ2UuYwpp bmRleCBhMTAxNmFkLi5kYjg1NTA4IDEwMDY0NAotLS0gYS9zcmMvZnJpbmdlLmMKKysrIGIvc3Jj L2ZyaW5nZS5jCkBAIC00MzMsNiArNDMzLDQwMiBAQCBzdGF0aWMgdW5zaWduZWQgc2hvcnQgZW1w dHlfbGluZV9iaXRzW10gPSB7CiAgIDB4MDAsIDB4M2MsIDB4MDAsIDB4MDAsIDB4M2MsIDB4MDAs IDB4MDAsIDB4M2MsIDB4MDB9OwogCiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogYmVn aW4gTVVMVElQTEUgQ1VSU09SUyAqLworCisvKiBgKy1mcmluZ2UtaGVscGVyLWRlY2ltYWwnIGRl ZmluZWQgaW4gYGNyb3NzaGFpcnMuZWxgICovCisKKy8qIDI0CisgICAgKCstZnJpbmdlLWhlbHBl ci1oZXhhZGVjaW1hbAorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAg InguLi4uLi4uIgorICAgICAgInguLnh4Li4uIgorICAgICAgInguLi54eC4uIgorICAgICAgIngu Li4ueHguIgorICAgICAgIngueHh4eHh4IgorICAgICAgIngueHh4eHh4IgorICAgICAgInguLi4u eHguIgorICAgICAgInguLi54eC4uIgorICAgICAgInguLnh4Li4uIgorICAgICAgInguLi4uLi4u IgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIikKKyovCitzdGF0aWMgdW5zaWdu ZWQgc2hvcnQgbWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93X2JpdHNbXSA9eworICAweDgwLCAw eDgwLCAweDgwLCAweDk4LCAweDhjLCAweDg2LCAweGJmLAorICAweGJmLCAweDg2LCAweDhjLCAw eDk4LCAweDgwLCAweDgwLCAweDgwfTsKKworLyogMjUKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhl eGFkZWNpbWFsCisgICAgICAieHh4eHh4eHgiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4u Li4uLngiCisgICAgICAieC4ueHguLngiCisgICAgICAieC4uLnh4LngiCisgICAgICAieC4uLi54 eHgiCisgICAgICAieC54eHh4eHgiCisgICAgICAieC54eHh4eHgiCisgICAgICAieC4uLi54eHgi CisgICAgICAieC4uLnh4LngiCisgICAgICAieC4ueHguLngiCisgICAgICAieC4uLi4uLngiCisg ICAgICAieC4uLi4uLngiCisgICAgICAieHh4eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBz aG9ydCBtY19ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93X2JpdHNbXSA9eworICAweGZmLCAw eDgxLCAweDgxLCAweDk5LCAweDhkLCAweDg3LCAweGJmLAorICAweGJmLCAweDg3LCAweDhkLCAw eDk5LCAweDgxLCAweDgxLCAweGZmfTsKKworLyogMjYKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhl eGFkZWNpbWFsCisgICAgICAieHh4eHh4eHgiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4u Li4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4u LngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngi CisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisg ICAgICAieC4uLi4uLngiCisgICAgICAieHh4eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBz aG9ydCBtY19ob2xsb3dfcmVjdGFuZ2xlX2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAw eDgxLCAweDgxLCAweDgxLCAweDgxLAorICAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAw eDgxLCAweGZmfTsKKworLyogMjcKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisg ICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAg ICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAi eC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4u Li4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4u Li4iCisgICAgICAieC4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY192ZXJ0 aWNhbF9iYXJfYml0c1tdID17CisgIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAs IDB4ODAsCisgIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODB9OworCisv KiAyOAorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICJ4eC4uLi4uLiIK KyAgICAgICJ4eC4uLi4uLiIKKyAgICAgICIgeHguLi4uLiIKKyAgICAgICIueHguLi4uLiIKKyAg ICAgICIuLnh4Li4uLiIKKyAgICAgICIuLnh4Li4uLiIKKyAgICAgICIuLi54eC4uLiIKKyAgICAg ICIuLi54eC4uLiIKKyAgICAgICIuLi4ueHguLiIKKyAgICAgICIuLi4ueHguLiIKKyAgICAgICIu Li4uLnh4LiIKKyAgICAgICIuLi4uLnh4LiIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4u Li54eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX2JhY2tzbGFzaF9iaXRzW10gPXsK KyAgMHhjMCwgMHhjMCwgMHhlMCwgMHg2MCwgMHgzMCwgMHgzMCwgMHgxOCwgMHgxOCwgMHhjLCAw eGMsIDB4NiwgMHg2LCAweDMsIDB4M307CisKKy8qIDI5CisgICAgKCstZnJpbmdlLWhlbHBlci1o ZXhhZGVjaW1hbAorICAgICAgInh4Li4uLi4uIgorICAgICAgInh4Li4uLi4uIgorICAgICAgInh4 eC4uLi4uIgorICAgICAgInh4eC4uLi4uIgorICAgICAgIngueHguLi4uIgorICAgICAgIngueHgu Li4uIgorICAgICAgInguLnh4Li4uIgorICAgICAgInguLnh4Li4uIgorICAgICAgInguLi54eC4u IgorICAgICAgInguLi54eC4uIgorICAgICAgInguLi4ueHguIgorICAgICAgInguLi4ueHguIgor ICAgICAgInguLi4uLnh4IgorICAgICAgInguLi4uLnh4IikKKyovCitzdGF0aWMgdW5zaWduZWQg c2hvcnQgbWNfdmVydGljYWxfYmFyX2JhY2tzbGFzaF9iaXRzW10gPXsKKyAgMHhjMCwgMHhjMCwg MHhlMCwgMHhlMCwgMHhiMCwgMHhiMCwgMHg5OCwKKyAgMHg5OCwgMHg4YywgMHg4YywgMHg4Niwg MHg4NiwgMHg4MywgMHg4M307CisKKy8qIDMwCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVj aW1hbAorICAgICAgIi54eHh4eHguIgorICAgICAgInh4eHgueC4uIgorICAgICAgInh4eHgueC4u IgorICAgICAgInh4eHgueC4uIgorICAgICAgIi54eHgueC4uIgorICAgICAgIi4uLngueC4uIgor ICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAg ICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hv cnQgbWNfcGlsY3Jvd19iaXRzW10gPXsKKyAgMHg3ZSwgMHhmNCwgMHhmNCwgMHhmNCwgMHg3NCwg MHgxNCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNH07CisKKy8qIDMxCisgICAgKCstZnJp bmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4ueHh4eC4uIgorICAgICAgIi54eHh4eHgu IgorICAgICAgInguLnh4Li54IgorICAgICAgInguLnh4Li54IgorICAgICAgInh4eHh4eHh4Igor ICAgICAgInh4Li4uLnh4IgorICAgICAgInh4eC4ueHh4IgorICAgICAgIi54eHh4eHguIgorICAg ICAgIi4ueHh4eC4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc21pbGV5X2ZhY2Vf Yml0c1tdID17CisgIDB4M2MsIDB4N2UsIDB4OTksIDB4OTksIDB4ZmYsIDB4YzMsIDB4ZTcsIDB4 N2UsIDB4M2N9OworCisvKiAzMgorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAg ICAgICIuLnguLi4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLi4ueC4uLiIKKyAgICAg ICIuLi4uLnguLiIKKyAgICAgICIuLi4ueC4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIu LnguLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3NpbmdsZV9hbmdsZV9yaWdo dF9iaXRzW10gPXsKKyAgMHgyMCwgMHgxMCwgMHg4LCAweDQsIDB4OCwgMHgxMCwgMHgyMH07CisK Ky8qIDMzCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4ueC4u IgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC4uLi4uIgor ICAgICAgIi4uLnguLi4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4uLi4ueC4uIikKKyov CitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX2xlZnRfYml0c1tdID17Cisg IDB4NCwgMHg4LCAweDEwLCAweDIwLCAweDEwLCAweDgsIDB4NH07CisKKy8qIDM0CisgICAgKCst ZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Lnh4Li4uIgorICAgICAgIi54eC54 eC4uIgorICAgICAgIi4ueHgueHguIgorICAgICAgIi4uLnh4Lnh4IgorICAgICAgIi4ueHgueHgu IgorICAgICAgIi54eC54eC4uIgorICAgICAgInh4Lnh4Li4uIikKKyovCitzdGF0aWMgdW5zaWdu ZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xlX3JpZ2h0X2JpdHNbXSA9eworICAweGQ4LCAweDZjLCAw eDM2LCAweDFiLCAweDM2LCAweDZjLCAweGQ4fTsKKworLyogMzUKKyAgICAoKy1mcmluZ2UtaGVs cGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4ueHgueHgiCisgICAgICAiLi54eC54eC4iCisgICAg ICAiLnh4Lnh4Li4iCisgICAgICAieHgueHguLi4iCisgICAgICAiLnh4Lnh4Li4iCisgICAgICAi Li54eC54eC4iCisgICAgICAiLi4ueHgueHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBt Y19kb3VibGVfYW5nbGVfbGVmdF9iaXRzW10gPXsKKyAgMHgxYiwgMHgzNiwgMHg2YywgMHhkOCwg MHg2YywgMHgzNiwgMHgxYn07CisKKy8qIDM2CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVj aW1hbAorICAgICAgIngueC54Li4uIgorICAgICAgIi54LngueC4uIgorICAgICAgIi4ueC54Lngu IgorICAgICAgIi4uLngueC54IgorICAgICAgIi4ueC54LnguIgorICAgICAgIi54LngueC4uIgor ICAgICAgIngueC54Li4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdHJpcGxlX2Fu Z2xlX3JpZ2h0X2JpdHNbXSA9eworICAweGE4LCAweDU0LCAweDJhLCAweDE1LCAweDJhLCAweDU0 LCAweGE4fTsKKworLyogMzcKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAg ICAiLi4ueC54LngiCisgICAgICAiLi54LngueC4iCisgICAgICAiLngueC54Li4iCisgICAgICAi eC54LnguLi4iCisgICAgICAiLngueC54Li4iCisgICAgICAiLi54LngueC4iCisgICAgICAiLi4u eC54LngiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190cmlwbGVfYW5nbGVfbGVmdF9i aXRzW10gPXsKKyAgMHgxNSwgMHgyYSwgMHg1NCwgMHhhOCwgMHg1NCwgMHgyYSwgMHgxNX07CisK Ky8qIDM4CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4uLi4u IgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgor ICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAg ICAgInguLi4uLnguIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAg Ii4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQg bWNfc2luZ2xlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAw eDEwLCAweDI4LCAweDQ0LCAweDgyLCAweDAwLCAweDAwLCAweDAwLCAweDAwfTsKKworLyogMzkK KyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAg ICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAi eC4uLi4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLi4u eC4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4u Li4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zaW5n bGVfYW5nbGVfZG93bl9iaXRzW10gPXsKKyAgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHg4Miwg MHg0NCwgMHgyOCwgMHgxMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMH07CisKKy8qIDQwCisgICAg KCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4u Li4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54 Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4u IgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAgICAgIi4uLi4uLi4uIgor ICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQg c2hvcnQgbWNfZG91YmxlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDAwLCAweDAwLCAweDAwLCAw eDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDgyLCAweDAwLCAweDAwLCAweDAw fTsKKworLyogNDEKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4u Li4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAieC4uLi4u eC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4i CisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLi4ueC4uLi4iCisg ICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8K K3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfZG93bl9iaXRzW10gPXsKKyAg MHgwMCwgMHgwMCwgMHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHgx MCwgMHgwMCwgMHgwMCwgMHgwMH07CisKKy8qIDQyCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhh ZGVjaW1hbAorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54 Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4u IgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgor ICAgICAgIi54Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAgICAgIi4uLi4uLi4uIikKKyov CitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdHJpcGxlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAw eDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0 LCAweDgyLCAweDAwfTsKKworLyogNDMKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFs CisgICAgICAiLi4uLi4uLi4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLnguLi54Li4iCisg ICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAg ICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAi Li54LnguLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRp YyB1bnNpZ25lZCBzaG9ydCBtY19xdWFkcnVwbGVfYW5nbGVfZG93bl9iaXRzW10gPXsKKyAgMHgw MCwgMHg4MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwg MHgxMCwgMHgwMH07CisKKy8qIDQ0CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAor ICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAg ICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAg InguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgIngu LnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLi4u LnguIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcXVhZHJ1cGxlX2FuZ2xlX3VwX2Jp dHNbXSA9eworICAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDkyLCAweDI4 LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDgyfTsKKworLyogNDUKKyAgICAoKy1mcmluZ2Ut aGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLnguLi54Li4iCisg ICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAg ICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAi Li54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54 LnguLi4iCisgICAgICAiLi4ueC4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190 cmlwbGVfYW5nbGVfZG93bl9iaXRzW10gPXsKKyAgMHg4MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg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JVE1BUF9UT1AsICAgIDAgfSwKKworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworICAvKiAyNCAqLwor ICB7IEZSQklUUyAobWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93X2JpdHMpLCAgICAgOCwgMCwg QUxJR05fQklUTUFQX0NFTlRFUiwgMCB9LAorICAvKiAyNSAqLworICB7IEZSQklUUyAobWNfaG9s bG93X3JlY3RhbmdsZV9yaWdodF9hcnJvd19iaXRzKSwgOCwgMCwgQUxJR05fQklUTUFQX0NFTlRF UiwgMCB9LAorICAvKiAyNiAqLworICB7IEZSQklUUyAobWNfaG9sbG93X3JlY3RhbmdsZV9iaXRz KSwgICAgICAgICAgICAgOCwgMCwgQUxJR05fQklUTUFQX0NFTlRFUiwgMCB9LAorICAvKiAyNyAq LworICB7IEZSQklUUyAobWNfdmVydGljYWxfYmFyX2JpdHMpLCAgICAgICAgICAgICAgICAgOCwg MCwgQUxJR05fQklUTUFQX0NFTlRFUiwgMCB9LAorICAvKiAyOCAqLworICB7IEZSQklUUyAobWNf YmFja3NsYXNoX2JpdHMpLCAgICAgICAgICAgICAgICAgICAgOCwgMCwgQUxJR05fQklUTUFQX0NF TlRFUiwgMCB9LAorICAvKiAyOSAqLworICB7IEZSQklUUyAobWNfdmVydGljYWxfYmFyX2JhY2tz bGFzaF9iaXRzKSwgICAgICAgOCwgMCwgQUxJR05fQklUTUFQX0NFTlRFUiwgMCB9LAorICAvKiAz MCAqLworICB7IEZSQklUUyAobWNfcGlsY3Jvd19iaXRzKSwgICAgICAgICAgICAgICAgICAgICAg OCwgMCwgQUxJR05fQklUTUFQX0NFTlRFUiwgMCB9LAorICAvKiAzMSAqLworICB7IEZSQklUUyAo bWNfc21pbGV5X2ZhY2VfYml0cyksICAgICAgICAgICAgICAgICAgOCwgMCwgQUxJR05fQklUTUFQ X0NFTlRFUiwgMCB9LAorICAvKiAzMiAqLworICB7IEZSQklUUyAobWNfc2luZ2xlX2FuZ2xlX3Jp Z2h0X2JpdHMpLCAgICAgICAgICAgOCwgMCwgQUxJR05fQklUTUFQX0NFTlRFUiwgMCB9LAorICAv KiAzMyAqLworICB7IEZSQklUUyAobWNfc2luZ2xlX2FuZ2xlX2xlZnRfYml0cyksICAgICAgICAg ICAgOCwgMCwgQUxJR05fQklUTUFQX0NFTlRFUiwgMCB9LAorICAvKiAzNCAqLworICB7IEZSQklU UyAobWNfZG91YmxlX2FuZ2xlX3JpZ2h0X2JpdHMpLCAgICAgICAgICAgOCwgMCwgQUxJR05fQklU TUFQX0NFTlRFUiwgMCB9LAorICAvKiAzNSAqLworICB7IEZSQklUUyAobWNfZG91YmxlX2FuZ2xl X2xlZnRfYml0cyksICAgICAgICAgICAgOCwgMCwgQUxJR05fQklUTUFQX0NFTlRFUiwgMCB9LAor ICAvKiAzNiAqLworICB7IEZSQklUUyAobWNfdHJpcGxlX2FuZ2xlX3JpZ2h0X2JpdHMpLCAgICAg ICAgICAgOCwgMCwgQUxJR05fQklUTUFQX0NFTlRFUiwgMCB9LAorICAvKiAzNyAqLworICB7IEZS QklUUyAobWNfdHJpcGxlX2FuZ2xlX2xlZnRfYml0cyksICAgICAgICAgICAgOCwgMCwgQUxJR05f QklUTUFQX0NFTlRFUiwgMCB9LAorICAvKiAzOCAqLworICB7IEZSQklUUyAobWNfc2luZ2xlX2Fu Z2xlX3VwX2JpdHMpLCAgICAgICAgICAgICAgOCwgMCwgQUxJR05fQklUTUFQX0NFTlRFUiwgMCB9 LAorICAvKiAzOSAqLworICB7IEZSQklUUyAobWNfc2luZ2xlX2FuZ2xlX2Rvd25fYml0cyksICAg ICAgICAgICAgOCwgMCwgQUxJR05fQklUTUFQX0NFTlRFUiwgMCB9LAorICAvKiA0MCAqLworICB7 IEZSQklUUyAobWNfZG91YmxlX2FuZ2xlX3VwX2JpdHMpLCAgICAgICAgICAgICAgOCwgMCwgQUxJ R05fQklUTUFQX0NFTlRFUiwgMCB9LAorICAvKiA0MSAqLworICB7IEZSQklUUyAobWNfZG91Ymxl X2FuZ2xlX2Rvd25fYml0cyksICAgICAgICAgICAgOCwgMCwgQUxJR05fQklUTUFQX0NFTlRFUiwg MCB9LAorICAvKiA0MiAqLworICB7IEZSQklUUyAobWNfdHJpcGxlX2FuZ2xlX3VwX2JpdHMpLCAg ICAgICAgICAgICAgOCwgMCwgQUxJR05fQklUTUFQX0NFTlRFUiwgMCB9LAorICAvKiA0MyAqLwor ICB7IEZSQklUUyAobWNfdHJpcGxlX2FuZ2xlX2Rvd25fYml0cyksICAgICAgICAgICAgOCwgMCwg QUxJR05fQklUTUFQX0NFTlRFUiwgMCB9LAorICAvKiA0NCAqLworICB7IEZSQklUUyAobWNfcXVh ZHJ1cGxlX2FuZ2xlX3VwX2JpdHMpLCAgICAgICAgICAgOCwgMCwgQUxJR05fQklUTUFQX0NFTlRF UiwgMCB9LAorICAvKiA0NSAqLworICB7IEZSQklUUyAobWNfcXVhZHJ1cGxlX2FuZ2xlX2Rvd25f Yml0cyksICAgICAgICAgOCwgMCwgQUxJR05fQklUTUFQX0NFTlRFUiwgMCB9LAorCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKworCiB9OwogCiAjZGVmaW5lIE5PX0ZSSU5HRV9CSVRNQVAgMApA QCAtODI2LDYgKzEyNzUsMjEgQEAgZHJhd19mcmluZ2VfYml0bWFwIChzdHJ1Y3Qgd2luZG93ICp3 LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCBsZWZ0X3ApCiAKICAgICAgIHN3aXRjaCAody0+ cGh5c19jdXJzb3JfdHlwZSkKIAl7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBN VUxUSVBMRSBDVVJTT1JTICovCisKKwljYXNlIEZSQU1FRF9CT1hfQ1VSU09SOgorCSAgaWYgKHJv dy0+dmlzaWJsZV9oZWlnaHQgPj0gU1RBTkRBUkRfQklUTUFQX0hFSUdIVCAoaG9sbG93X3JlY3Rh bmdsZV9iaXRzKSkKKwkgICAgY3Vyc29yID0gUWhvbGxvdzsKKwkgIGVsc2UKKwkgICAgY3Vyc29y ID0gUWhvbGxvd19zbWFsbDsKKwkgIGJyZWFrOworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiAJY2FzZSBIT0xMT1dfQk9YX0NVUlNPUjoKIAkgIGlmIChyb3ctPnZpc2libGVfaGVpZ2h0 ID49IFNUQU5EQVJEX0JJVE1BUF9IRUlHSFQgKGhvbGxvd19yZWN0YW5nbGVfYml0cykpCiAJICAg IGN1cnNvciA9IFFob2xsb3c7CkBAIC0xNzIzLDYgKzIxODcsMTUwIEBAIElmIG5pbCwgYWxzbyBj b250aW51ZSBsaW5lcyB3aGljaCBhcmUgZXhhY3RseSBhcyB3aWRlIGFzIHRoZSB3aW5kb3cuICAq Lyk7CiAgIERFRlZBUl9MSVNQICgiZnJpbmdlLWJpdG1hcHMiLCBWZnJpbmdlX2JpdG1hcHMsCiAg ICAgZG9jOiAvKiBMaXN0IG9mIGZyaW5nZSBiaXRtYXAgc3ltYm9scy4gICovKTsKICAgVmZyaW5n ZV9iaXRtYXBzID0gUW5pbDsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2lu IE1VTFRJUExFIENVUlNPUlMgKi8KKworICAvKiAoZ2V0ICdlbXB0eS1saW5lICdmcmluZ2UpID0+ IDIzID0+IHRoZSBsYXN0IHN0YW5kYXJkLWJpdG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bGxlY3Rpb24gaG9vayAqLwpkaWZmIC0tZ2l0IGEvc3JjL2tleWJvYXJkLmMgYi9zcmMva2V5Ym9h cmQuYwppbmRleCBiYWYyZjUxLi5hNGY1ODc0IDEwMDY0NAotLS0gYS9zcmMva2V5Ym9hcmQuYwor KysgYi9zcmMva2V5Ym9hcmQuYwpAQCAtMTIzMyw2ICsxMjMzLDgwIEBAIHN0YXRpYyBpbnQgcmVh ZF9rZXlfc2VxdWVuY2UgKExpc3BfT2JqZWN0ICosIExpc3BfT2JqZWN0LAogICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgYm9vbCwgYm9vbCwgYm9vbCwgYm9vbCk7CiBzdGF0aWMgdm9pZCBh ZGp1c3RfcG9pbnRfZm9yX3Byb3BlcnR5IChwdHJkaWZmX3QsIGJvb2wpOwogCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCitzdGF0aWMgdm9pZAor bWNfc3dpdGNoZXNfbXVsdGlwbGVfY3Vyc29ycyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCB0cnVl X29yX2ZhbHNlX3ApCit7CisjaWZkZWYgR0xZUEhfREVCVUcKKyAgaWYgKHRyYWNlX3JlZGlzcGxh eV9wICYmIEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgJiYgKCFOSUxQIChCVkFSIChYQlVG RkVSICh3LT5jb250ZW50cyksIG11bHRpcGxlX2N1cnNvcnNfY29uZikpCisgICAgICAgICAgfHwg IU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAg ICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfZmlsbF9jb2x1bW4p KSkpCisgICAgeworICAgICAgTGlzcF9PYmplY3Qgd2luZG93Owor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3csIHcpOworICAgICAgTGlz cF9PYmplY3Qgd2luZG93X3N0cmluZyA9IEZwcmluMV90b19zdHJpbmcgKHdpbmRvdywgUW5pbCk7 CisgICAgICBjaGFyICp3aW5kb3dfY2hhciA9IFNTREFUQSAod2luZG93X3N0cmluZyk7CisgICAg ICBmcHJpbnRmIChzdGRlcnIsICJcbm1jX3N3aXRjaGVzX2ZpbGxfY29sdW1uICglcyk6ICAlc1xu IiwKKyAgICAgICAgICAgICAgIHdpbmRvd19jaGFyLCB0cnVlX29yX2ZhbHNlX3AgPyAidHJ1ZSIg OiAiZmFsc2UiKTsKKyAgICB9CisjZW5kaWYKKyAgdy0+bWMuZHJhd19maWxsX2NvbHVtbiA9IHRy dWVfb3JfZmFsc2VfcDsKKyAgdy0+bWMuZXJhc2VfZmlsbF9jb2x1bW4gPSB0cnVlX29yX2ZhbHNl X3A7CisgIGlmICh0cnVlX29yX2ZhbHNlX3ApCisgICAgdy0+bXVzdF9iZV91cGRhdGVkX3AgPSB0 cnVlOworfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiBMaXNwX09iamVjdAogY29t bWFuZF9sb29wXzEgKHZvaWQpCiB7CkBAIC0xNDI4LDYgKzE1MDIsMTYgQEAgY29tbWFuZF9sb29w XzEgKHZvaWQpCiAgICAgICBWcmVhbF90aGlzX2NvbW1hbmQgPSBjbWQ7CiAgICAgICBzYWZlX3J1 bl9ob29rcyAoUXByZV9jb21tYW5kX2hvb2spOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgICAgICBzdHJ1Y3Qgd2luZG93ICp3ID0gWFdJ TkRPVyAoc2VsZWN0ZWRfd2luZG93KTsKKyAgICAgIG1jX3N3aXRjaGVzX211bHRpcGxlX2N1cnNv cnMgKHcsIHRydWUpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICBhbHJl YWR5X2FkanVzdGVkID0gMDsKIAogICAgICAgaWYgKE5JTFAgKFZ0aGlzX2NvbW1hbmQpKQpAQCAt MTU3NCw2ICsxNjU4LDE4IEBAIGNvbW1hbmRfbG9vcF8xICh2b2lkKQogICAgICAgaWYgKCFOSUxQ IChLVkFSIChjdXJyZW50X2tib2FyZCwgZGVmaW5pbmdfa2JkX21hY3JvKSkKIAkgICYmIE5JTFAg KEtWQVIgKGN1cnJlbnRfa2JvYXJkLCBWcHJlZml4X2FyZykpKQogCWZpbmFsaXplX2tiZF9tYWNy b19jaGFycyAoKTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENV UlNPUlMgKi8KKworICAgICAgbWNfc3dpdGNoZXNfbXVsdGlwbGVfY3Vyc29ycyAodywgZmFsc2Up OworICAgICAgbWNfc3dpdGNoZXNfY3Jvc3NoYWlycyAodywgZmFsc2UpOworICAgICAgbWNfc3dp dGNoZXNfZmlsbF9jb2x1bW4gKHcsIGZhbHNlKTsKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogICAgIH0KIH0KIApAQCAtMjQ1Nyw3ICsyNTUzLDE1IEBAIHJlYWRfY2hhciAoaW50IGNv bW1hbmRmbGFnLCBMaXNwX09iamVjdCBtYXAsCiAJICBpZiAoaGVscF9lY2hvX3Nob3dpbmdfcCAm JiAhRVEgKHNlbGVjdGVkX3dpbmRvdywgbWluaWJ1Zl93aW5kb3cpKQogCSAgICByZWRpc3BsYXlf cHJlc2VydmVfZWNob19hcmVhICg1KTsKIAkgIGVsc2UKLQkgICAgcmVkaXNwbGF5ICgpOworCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgICAg ICByZWRpc3BsYXkgKDEpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwogCiAJICBpZiAo IWlucHV0X3BlbmRpbmcpCiAJICAgIC8qIE5vcm1hbCBjYXNlOiBubyBpbnB1dCBhcnJpdmVkIGR1 cmluZyByZWRpc3BsYXkuICAqLwpAQCAtMjYzNyw3ICsyNzQxLDE2IEBAIHJlYWRfY2hhciAoaW50 IGNvbW1hbmRmbGFnLCBMaXNwX09iamVjdCBtYXAsCiAgICAgewogICAgICAgRmRvX2F1dG9fc2F2 ZSAoYXV0b19zYXZlX25vX21lc3NhZ2UgPyBRdCA6IFFuaWwsIFFuaWwpOwogICAgICAgLyogSG9v a3MgY2FuIGFjdHVhbGx5IGNoYW5nZSBzb21lIGJ1ZmZlcnMgaW4gYXV0byBzYXZlLiAgKi8KLSAg ICAgIHJlZGlzcGxheSAoKTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJ UExFIENVUlNPUlMgKi8KKworICAgICAgcmVkaXNwbGF5ICgyKTsKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogICAgIH0KIAogICAvKiBUcnkgcmVhZGluZyB1c2luZyBhbiBYIG1lbnUu CkBAIC0yNzAxLDcgKzI4MTQsMTYgQEAgcmVhZF9jaGFyIChpbnQgY29tbWFuZGZsYWcsIExpc3Bf T2JqZWN0IG1hcCwKIAkgICAgICAmJiAhIENPTlNQIChWdW5yZWFkX2NvbW1hbmRfZXZlbnRzKSkK IAkgICAgewogCSAgICAgIEZkb19hdXRvX3NhdmUgKGF1dG9fc2F2ZV9ub19tZXNzYWdlID8gUXQg OiBRbmlsLCBRbmlsKTsKLQkgICAgICByZWRpc3BsYXkgKCk7CisKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgICAgICAgcmVkaXNwbGF5ICgz KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgICB9CiAJfQogCkBAIC0yODA0 LDcgKzI5MjYsMTUgQEAgcmVhZF9jaGFyIChpbnQgY29tbWFuZGZsYWcsIExpc3BfT2JqZWN0IG1h cCwKICAgICB7CiAgICAgICBpZiAoY29tbWFuZGZsYWcgPj0gMAogCSAgJiYgIWlucHV0X3BlbmRp bmcgJiYgIWRldGVjdF9pbnB1dF9wZW5kaW5nX3J1bl90aW1lcnMgKDApKQotCXJlZGlzcGxheSAo KTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8K KworICAgICAgcmVkaXNwbGF5ICg0KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKIAog ICAgICAgZ290byB3cm9uZ19rYm9hcmQ7CiAgICAgfQpAQCAtMzEwMiw3ICszMjMyLDE1IEBAIHJl YWRfY2hhciAoaW50IGNvbW1hbmRmbGFnLCBMaXNwX09iamVjdCBtYXAsCiAgICAgICAvKiBSZW1v dmUgdGhlIGhlbHAgZnJvbSB0aGUgZnJhbWUuICAqLwogICAgICAgdW5iaW5kX3RvIChjb3VudCwg UW5pbCk7CiAKLSAgICAgIHJlZGlzcGxheSAoKTsKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgICAgIHJlZGlzcGxheSAoNSk7CisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIGlmIChFUSAoYywgbWFrZV9maXhudW0gKDA0 MCkpKQogCXsKIAkgIGNhbmNlbF9lY2hvaW5nICgpOwpkaWZmIC0tZ2l0IGEvc3JjL2xpc3AuaCBi L3NyYy9saXNwLmgKaW5kZXggYmRhODQ4NC4uZDNjYTFhYSAxMDA2NDQKLS0tIGEvc3JjL2xpc3Au aAorKysgYi9zcmMvbGlzcC5oCkBAIC0zNTYxLDcgKzM1NjEsMTUgQEAgZXh0ZXJuIHZvaWQgbWVz c2FnZV93aXRoX3N0cmluZyAoY29uc3QgY2hhciAqLCBMaXNwX09iamVjdCwgYm9vbCk7CiBleHRl cm4gdm9pZCBtZXNzYWdlX2xvZ19tYXliZV9uZXdsaW5lICh2b2lkKTsKIGV4dGVybiB2b2lkIHVw ZGF0ZV9lY2hvX2FyZWEgKHZvaWQpOwogZXh0ZXJuIHZvaWQgdHJ1bmNhdGVfZWNob19hcmVhIChw dHJkaWZmX3QpOwotZXh0ZXJuIHZvaWQgcmVkaXNwbGF5ICh2b2lkKTsKKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworZXh0ZXJuIHZvaWQgcmVk aXNwbGF5IChpbnQpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwogCiB2b2lkIHNldF9m cmFtZV9jdXJzb3JfdHlwZXMgKHN0cnVjdCBmcmFtZSAqLCBMaXNwX09iamVjdCk7CiBleHRlcm4g dm9pZCBzeW1zX29mX3hkaXNwICh2b2lkKTsKZGlmZiAtLWdpdCBhL3NyYy9uc3Rlcm0ubSBiL3Ny Yy9uc3Rlcm0ubQppbmRleCA2YzI4NWYwLi5jM2QzMTlmIDEwMDY0NAotLS0gYS9zcmMvbnN0ZXJt Lm0KKysrIGIvc3JjL25zdGVybS5tCkBAIC0xMTA4LDYgKzExMDgsMTYgQEAgc3RhdGljIE5TUmVj dCBjb25zdHJhaW5fZnJhbWVfcmVjdChOU1JlY3QgZnJhbWVSZWN0LCBib29sIGlzRnVsbHNjcmVl bikKICAgIGV4dGVybmFsIChSSUYpIGNhbGw7IHdob2xlIGZyYW1lLCBjYWxsZWQgYmVmb3JlIHVw ZGF0ZV93aW5kb3dfYmVnaW4KICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCiB7CisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgZi0+bWNfdXBk YXRpbmdfZnJhbWUgPSBmOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAjaWZkZWYg TlNfSU1QTF9DT0NPQQogICBFbWFjc1ZpZXcgKnZpZXcgPSBGUkFNRV9OU19WSUVXIChmKTsKIApA QCAtMTIwOCw5ICsxMjE4LDE4IEBAIHN0YXRpYyBOU1JlY3QgY29uc3RyYWluX2ZyYW1lX3JlY3Qo TlNSZWN0IGZyYW1lUmVjdCwgYm9vbCBpc0Z1bGxzY3JlZW4pCiAKIC8qICAgaWYgKGYgPT0gTU9V U0VfSExfSU5GTyAoZiktPm1vdXNlX2ZhY2VfbW91c2VfZnJhbWUpICovCiAgIE1PVVNFX0hMX0lO Rk8gKGYpLT5tb3VzZV9mYWNlX2RlZmVyID0gMDsKLX0KIAogCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGluZ19mcmFtZSA9 IE5VTEw7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKK30KKwogc3RhdGljIEJPT0wK IG5zX2NsaXBfdG9fcmVjdCAoc3RydWN0IGZyYW1lICpmLCBOU1JlY3QgKnIsIGludCBuKQogLyog LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0KQEAgLTMyMjEsNjUgKzMyNDAsMTc2IEBAIE5vdGUgdGhhdCBDVVJT T1JfV0lEVEggaXMgbWVhbmluZ2Z1bCBvbmx5IGZvciAoaCliYXIgY3Vyc29ycy4KICAgICAgIGgg PSBjdXJzb3JfaGVpZ2h0OwogICAgIH0KIAotICByLm9yaWdpbi54ID0gZngsIHIub3JpZ2luLnkg PSBmeTsKLSAgci5zaXplLmhlaWdodCA9IGg7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgIHIub3JpZ2luLnggPSAody0+bWMuZnggPiAwKQor ICAgICAgICAgICAgICAgPyB3LT5tYy5meAorICAgICAgICAgICAgICAgOiBmeDsKKyAgci5vcmln aW4ueSA9ICh3LT5tYy5meSA+IDApCisgICAgICAgICAgICAgICA/IHctPm1jLmZ5CisgICAgICAg ICAgICAgICA6IGZ5OworICByLnNpemUuaGVpZ2h0ID0gKHctPm1jLmggPiAwKQorICAgICAgICAg ICAgICAgICAgPyB3LT5tYy5oCisgICAgICAgICAgICAgICAgICA6IGg7CiAgIHIuc2l6ZS53aWR0 aCA9IHctPnBoeXNfY3Vyc29yX3dpZHRoOwogCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAgIC8qIFByZXZlbnQgdGhlIGN1cnNvciBmcm9tIGJlaW5nIGRyYXduIG91dHNpZGUgdGhlIHRl eHQgYXJlYS4gICovCiAgIHIgPSBOU0ludGVyc2VjdGlvblJlY3QgKHIsIG5zX3Jvd19yZWN0ICh3 LCBnbHlwaF9yb3csIFRFWFRfQVJFQSkpOwogCiAgIGlmIChuc19jbGlwX3RvX3JlY3QgKGYsICZy LCAxKSkKICAgICB7CiAgICAgICBmYWNlID0gRkFDRV9GUk9NX0lEX09SX05VTEwgKGYsIHBoeXNf Y3Vyc29yX2dseXBoLT5mYWNlX2lkKTsKLSAgICAgIGlmIChmYWNlICYmIE5TX0ZBQ0VfQkFDS0dS T1VORCAoZmFjZSkKLSAgICAgICAgICA9PSBuc19pbmRleF9jb2xvciAoRlJBTUVfQ1VSU09SX0NP TE9SIChmKSwgZikpCi0gICAgICAgIHsKLSAgICAgICAgICBbbnNfbG9va3VwX2luZGV4ZWRfY29s b3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoZmFjZSksIGYpIHNldF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AgICAgICAgICAgICAgICAgICghTklMUCAoYmFja2dyb3VuZCkgPyBTU0RB VEEgKGJhY2tncm91bmQpIDogIk5JTFAiKSk7CisKKyAgRVhBTVBMRSBPRiBIT1cgVE8gQ1JFQVRF IEEgQ09MT1IgV0lUSCBSR0IvTFNMIGZsb2F0IHZhbHVlczoKKyAgTlNDb2xvciAqbXlfY29sb3Ig PSBbTlNDb2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiBzLT53LT5tYy5yZWQKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdyZWVuOiBzLT53LT5tYy5n cmVlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJs dWU6IHMtPnctPm1jLmJsdWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGFscGhhOiAxLjBdOyAqLworCisgIGlmICh3LT5tYy5nbHlwaF9mbGF2b3IgPT0g TUNfR0xZUEgKKyAgICAgIHx8IHctPm1jLmdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSExFU1MpCisg ICAgW1tOU0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6IHctPm1jLnJlZCBncmVlbjogdy0+ bWMuZ3JlZW4gYmx1ZTogdy0+bWMuYmx1ZSBhbHBoYTogMS4wXSBzZXRdOworICAgIGVsc2UKKyAg ICAgIFtGUkFNRV9DVVJTT1JfQ09MT1IgKGYpIHNldF07CisKKyAgaWYgKGN1cnNvcl90eXBlID09 IEZSQU1FRF9CT1hfQ1VSU09SKQorICAgIHsKKyAgICAgIExpc3BfT2JqZWN0IGJ1ZiA9IHctPmNv bnRlbnRzOworICAgICAgQ0hFQ0tfQlVGRkVSIChidWYpOworICAgICAgc3RydWN0IGJ1ZmZlciAq YiA9IFhCVUZGRVIgKGJ1Zik7CisgICAgICBib29sIHJlZ2lvbl9hY3RpdmVfcCA9ICghTklMUCAo VnRyYW5zaWVudF9tYXJrX21vZGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAh TklMUCAoQlZBUiAoYiwgbWFya19hY3RpdmUpKSk7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2Jl Z2lubmluZyA9IChyZWdpb25fYWN0aXZlX3ApID8gWEZJWE5VTSAoRnJlZ2lvbl9iZWdpbm5pbmcg KCkpIDogLTE7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2VuZCA9IChyZWdpb25fYWN0aXZlX3Ap ID8gWEZJWE5VTSAoRnJlZ2lvbl9lbmQgKCkpIDogLTE7CisgICAgICBwdHJkaWZmX3Qgb3BvaW50 X3B0ID0gKHcgPT0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93KSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IFBUCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBYRklYTlVNIChG bWFya2VyX3Bvc2l0aW9uICh3LT5wb2ludG0pKTsKKyAgICAgIGJvb2wgcmVnaW9uX2luX2JvdW5k c19wID0gKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgb3BvaW50X3B0ID49IHJlZ2lvbl9iZWdpbm5pbmcKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIG9wb2ludF9wdCA8IHJlZ2lvbl9lbmQpOworICAgICAgaWYgKHJlZ2lvbl9h Y3RpdmVfcAorICAgICAgICAgICYmIHJlZ2lvbl9pbl9ib3VuZHNfcAorICAgICAgICAgICYmIGFj dGl2ZV9wKQogICAgICAgICB7Ci0gICAgICAgIGNhc2UgREVGQVVMVF9DVVJTT1I6Ci0gICAgICAg IGNhc2UgTk9fQ1VSU09SOgotICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIEZJTExFRF9C T1hfQ1VSU09SOgotICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOwotICAgICAgICAgIGJyZWFr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2NvbG9yOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmICghcmVnaW9uX2FjdGl2ZV9w ICYmIGFjdGl2ZV9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQg aG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAo IistcmVhbC1mYWtlLWN1cnNvci1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICBzdHJ1Y3Qg ZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZl X2ZhY2VfaWQpOworICAgICAgICAgICAgICBOU0NvbG9yICpob2xsb3dfYWN0aXZlX2NvbG9yID0g bnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoaG9sbG93X2FjdGl2 ZV9mYWNlKSwgZik7CisgICAgICAgICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19hY3RpdmVf Y29sb3I7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvKiBUaGUgcmVnaW9uIGlzIF9ub3Rf IHZpc2libGUgaW4gdGhlIGluYWN0aXZlIHdpbmRvdyBiZWNhdXNlIHRoZSBvdmVybGF5IHdpbmRv dyBwcm9wZXJ0eSBpcyB1c2VkLiAqLworICAgICAgICAgICAgZWxzZSBpZiAoIWFjdGl2ZV9wKQor ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFj dGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1m YWtlLWN1cnNvci1pbmFjdGl2ZS1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgIHN0cnVj dCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2lu YWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgIE5TQ29sb3IgKmhvbGxvd19pbmFjdGl2 ZV9jb2xvciA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGhv bGxvd19pbmFjdGl2ZV9mYWNlKSwgZik7CisgICAgICAgICAgICAgICAgaG9sbG93X2NvbG9yID0g aG9sbG93X2luYWN0aXZlX2NvbG9yOworICAgICAgICAgICAgICB9CisgICAgfQorICAgIGVsc2Ug aWYgKGZhY2UgJiYgTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKSA9PSBuc19pbmRleF9jb2xvciAo RlJBTUVfQ1VSU09SX0NPTE9SIChmKSwgZikpCisgICAgICB7CisgICAgICAgIFtuc19sb29rdXBf aW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChmYWNlKSwgZikgc2V0XTsKKyAgICAg ICAgaG9sbG93X2NvbG9yID0gRlJBTUVfQ1VSU09SX0NPTE9SIChmKTsKKyAgICAgIH0KKyNpZmRl ZiBOU19JTVBMX0NPQ09BCisgIE5TRGlzYWJsZVNjcmVlblVwZGF0ZXMgKCk7CisjZW5kaWYKKyAg c3dpdGNoIChjdXJzb3JfdHlwZSkKKyAgICB7CisgICAgICBjYXNlIERFRkFVTFRfQ1VSU09SOgor ICAgICAgY2FzZSBOT19DVVJTT1I6CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBGSUxMRURf Qk9YX0NVUlNPUjoKKyAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgIGJyZWFrOworICAg ICAgY2FzZSBGUkFNRURfQk9YX0NVUlNPUjoKKyAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAg ICAgIFtob2xsb3dfY29sb3Igc2V0XTsKKyAgICAgICAgTlNSZWN0RmlsbCAoTlNJbnNldFJlY3Qg KHIsIDEsIDEpKTsKKyAgICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAoZikgc2V0XTsKKyAgICAg ICAgYnJlYWs7CisgICAgICBjYXNlIEhPTExPV19CT1hfQ1VSU09SOgorICAgICAgICBOU1JlY3RG aWxsIChyKTsKKyAgICAgICAgW2hvbGxvd19jb2xvciBzZXRdOworICAgICAgICBOU1JlY3RGaWxs IChOU0luc2V0UmVjdCAociwgMSwgMSkpOworICAgICAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChm KSBzZXRdOworICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgSEJBUl9DVVJTT1I6CisgICAgICAg IE5TUmVjdEZpbGwgKHIpOworICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgQkFSX0NVUlNPUjoK KyAgICAgICAgcyA9IHI7CisgICAgICAgIC8qIEBsYXdsaXN0IGlzIGZvY3VzaW5nIHRoZSBpbml0 aWFsIGRldmVsb3BtZW50IG9mIGZlYXR1cmUgcmVxdWVzdHMKKyAgICAgICAgIzE3Njg0IGFuZCAj MjI4NzMgb24gTDJSIGxhbmd1YWdlcy4gKi8KKyAgICAgICAgaWYgKHctPm1jLmdseXBoX2ZsYXZv ciAhPSBNQ19HTFlQSAorICAgICAgICAgICAgJiYgdy0+bWMuZ2x5cGhfZmxhdm9yICE9IE1DX0dM WVBITEVTUykKKyAgICAgICAgICB7CisgICAgICAgICAgICAvKiBJZiB0aGUgY2hhcmFjdGVyIHVu ZGVyIGN1cnNvciBpcyBSMkwsIGRyYXcgdGhlIGJhciBjdXJzb3IKKyAgICAgICAgICAgICAgIG9u IHRoZSByaWdodCBvZiBpdHMgZ2x5cGgsIHJhdGhlciB0aGFuIG9uIHRoZSBsZWZ0LiAgKi8KKyAg ICAgICAgICAgIGN1cnNvcl9nbHlwaCA9IGdldF9waHlzX2N1cnNvcl9nbHlwaCAodyk7CisgICAg ICAgICAgICBpZiAoKGN1cnNvcl9nbHlwaC0+cmVzb2x2ZWRfbGV2ZWwgJiAxKSAhPSAwKQorICAg ICAgICAgICAgICBzLm9yaWdpbi54ICs9IGN1cnNvcl9nbHlwaC0+cGl4ZWxfd2lkdGggLSBzLnNp emUud2lkdGg7CisgICAgICAgICAgfQorICAgICAgICBOU1JlY3RGaWxsIChzKTsKKyAgICAgICAg YnJlYWs7CisgICAgfQogCiAgICAgICAvKiBkcmF3IHRoZSBjaGFyYWN0ZXIgdW5kZXIgdGhlIGN1 cnNvciAqLwotICAgICAgaWYgKGN1cnNvcl90eXBlICE9IE5PX0NVUlNPUikKKyAgICAgIGlmIChj dXJzb3JfdHlwZSAhPSBOT19DVVJTT1IKKyAgICAgICAgICAmJiB3LT5tYy5nbHlwaF9mbGF2b3Ig IT0gTUNfR0xZUEhMRVNTKQogICAgICAgICBkcmF3X3BoeXNfY3Vyc29yX2dseXBoICh3LCBnbHlw aF9yb3csIERSQVdfQ1VSU09SKTsKIAorLyogZW5kIE1VTFRJUExFIENVUlNPUlMgKi8KKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIG5zX3Jlc2V0X2NsaXBwaW5nIChmKTsKICAg ICB9CisKKyAgLyogMTEvMjUvMjAxODogIDA5NGZjZjYyZDI4OWYxOWE0NjMzMjc1ODEyZTllNWU1 MDA0NjNlOTEKKyAgQlVHOiAgVGhpcyBjYXVzZXMgYSBuZXZlci1lbmRpbmcgbG9vcCB3aXRoIGNy b3NzaGFpcnMgd2hlbiBiYWNrIHRvIEVtYWNzIGZyb20KKyAgYW5vdGhlciBwcm9ncmFtLCBlLmcu LCBUZXJtaW5hbC5hcHAgPT4gRW1hY3Mgd2l0aCBjcm9zc2hhaXJzIGRyYXcgZm9ydGh3aXRoLiAq LwogICBlbHNlIGlmICghIHJlZGlzcGxheWluZ19wKQogICAgIHsKICAgICAgIC8qIElmIHRoaXMg ZnVuY3Rpb24gaXMgY2FsbGVkIG91dHNpZGUgcmVkaXNwbGF5LCBpdCBwcm9iYWJseQogICAgICAg ICAgbWVhbnMgd2UgbmVlZCBhbiBpbW1lZGlhdGUgdXBkYXRlLiAgKi8KLSAgICAgIFtGUkFNRV9O U19WSUVXIChmKSBkaXNwbGF5XTsKKyAgICAgIC8qIFtGUkFNRV9OU19WSUVXIChmKSBkaXNwbGF5 XTsgKi8KICAgICB9CiB9CiAKQEAgLTM5NDYsNyArNDA3NiwyNiBAQCBGdW5jdGlvbiBtb2RlbGVk IGFmdGVyIHhfZHJhd19nbHlwaF9zdHJpbmdfYm94ICgpLgogICAgIHsKICAgICAgIGludCB0aGlj a25lc3MgPSBhYnMgKHMtPmltZy0+cmVsaWVmKTsKICAgICAgIGlmICh0aGlja25lc3MgPT0gMCkg dGhpY2tuZXNzID0gMTsKLSAgICAgIG5zX2RyYXdfYm94IChiciwgdGhpY2tuZXNzLCBGUkFNRV9D VVJTT1JfQ09MT1IgKHMtPmYpLCAxLCAxKTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworICAgIGlmIChzLT53LT5tYy5nbHlwaF9mbGF2b3Ig PT0gTUNfR0xZUEgKKyAgICAgICAgfHwgcy0+dy0+bWMuZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBI TEVTUykKKyAgICAgIHsKKyAgICAgICAgTlNDb2xvciAqYm9yZGVyX2NvbG9yID0gW05TQ29sb3Ig Y29sb3JXaXRoQ2FsaWJyYXRlZFJlZDogcy0+dy0+bWMucmVkCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JlZW46IHMtPnctPm1jLmdy ZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGJsdWU6IHMtPnctPm1jLmJsdWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHBoYTogMS4wXTsKKyAgICAgICAgbnNfZHJh d19ib3ggKGJyLCB0aGlja25lc3MsIGJvcmRlcl9jb2xvciwgMSwgMSk7CisgICAgICB9CisgICAg ICBlbHNlCisgICAgICAgIG5zX2RyYXdfYm94IChiciwgdGhpY2tuZXNzLCBGUkFNRV9DVVJTT1Jf Q09MT1IgKHMtPmYpLCAxLCAxKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAg IH0KIH0KIApAQCAtNDI0NywxMiArNDM5NiwzNyBAQCBvdmVyd3JpdGluZyBjdXJzb3IgKHVzdWFs bHkgd2hlbiBjdXJzb3Igb24gYSB0YWIpLiAgKi8KICAgICAgICAgICAgIG5zX21heWJlX2R1bXBn bHlwaHNfYmFja2dyb3VuZAogICAgICAgICAgICAgICAocywgcy0+Zmlyc3RfZ2x5cGgtPnR5cGUg PT0gQ09NUE9TSVRFX0dMWVBIKTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1V TFRJUExFIENVUlNPUlMgKi8KKworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgc2F2ZWRfZmcgPSBO U19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2UpOworCiAgICAgICAgICAgaWYgKHMtPmhsID09IERS QVdfQ1VSU09SICYmIHMtPnctPnBoeXNfY3Vyc29yX3R5cGUgPT0gRklMTEVEX0JPWF9DVVJTT1Ip CiAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgdG1wID0gTlNfRkFD RV9CQUNLR1JPVU5EIChzLT5mYWNlKTsKICAgICAgICAgICAgICAgTlNfRkFDRV9CQUNLR1JPVU5E IChzLT5mYWNlKSA9IE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSk7CiAgICAgICAgICAgICAg IE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSkgPSB0bXA7CiAgICAgICAgICAgICB9CisgICAg ICAgICAgICBlbHNlIGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUgorICAgICAgICAgICAgICAgICAg ICAgJiYgcy0+dy0+cGh5c19jdXJzb3JfdHlwZSA9PSBGUkFNRURfQk9YX0NVUlNPUgorICAgICAg ICAgICAgICAgICAgICAgJiYgcy0+dy0+bWMuYWN0aXZlX3ApCisgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3Vw X25hbWVkX2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1mYWNl IiksIHRydWUpOworICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2Zh Y2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAg ICAgICAgICAgTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKSA9IE5TX0ZBQ0VfRk9SRUdST1VO RCAoaG9sbG93X2FjdGl2ZV9mYWNlKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBl bHNlIGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUgorICAgICAgICAgICAgICAgICAgICAgICAmJiBz LT53LT5waHlzX2N1cnNvcl90eXBlID09IEZSQU1FRF9CT1hfQ1VSU09SCisgICAgICAgICAgICAg ICAgICAgICAgICYmICFzLT53LT5tYy5hY3RpdmVfcCkKKyAgICAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29r dXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWlu YWN0aXZlLWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9s bG93X2luYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIGhvbGxvd19pbmFjdGl2ZV9m YWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgIE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSkg PSBOU19GQUNFX0ZPUkVHUk9VTkQgKGhvbGxvd19pbmFjdGl2ZV9mYWNlKTsKKyAgICAgICAgICAg ICAgICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCiAKICAgICAgICAgICB7CiAgICAg ICAgICAgICBCT09MIGlzQ29tcG9zaXRlID0gcy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ09NUE9T SVRFX0dMWVBIOwpAQCAtNDI3NCwxMiArNDQ0OCwyMiBAQCBvdmVyd3JpdGluZyBjdXJzb3IgKHVz dWFsbHkgd2hlbiBjdXJzb3Igb24gYSB0YWIpLiAgKi8KICAgICAgICAgICAgIG5zX2RyYXdfdGV4 dF9kZWNvcmF0aW9uIChzLCBzLT5mYWNlLCBjb2wsIHMtPndpZHRoLCBzLT54KTsKICAgICAgICAg ICB9CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICov CisKICAgICAgICAgICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IgJiYgcy0+dy0+cGh5c19jdXJz b3JfdHlwZSA9PSBGSUxMRURfQk9YX0NVUlNPUikKICAgICAgICAgICAgIHsKICAgICAgICAgICAg ICAgdW5zaWduZWQgbG9uZyB0bXAgPSBOU19GQUNFX0JBQ0tHUk9VTkQgKHMtPmZhY2UpOwogICAg ICAgICAgICAgICBOU19GQUNFX0JBQ0tHUk9VTkQgKHMtPmZhY2UpID0gTlNfRkFDRV9GT1JFR1JP VU5EIChzLT5mYWNlKTsKICAgICAgICAgICAgICAgTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNl KSA9IHRtcDsKICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKHMtPmhsID09IERS QVdfQ1VSU09SCisgICAgICAgICAgICAgICAgICAgICAmJiBzLT53LT5waHlzX2N1cnNvcl90eXBl ID09IEZSQU1FRF9CT1hfQ1VSU09SKQorICAgICAgICAgICAgICBOU19GQUNFX0ZPUkVHUk9VTkQg KHMtPmZhY2UpID0gc2F2ZWRfZmc7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCiAKICAg ICAgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CiAgICAgICAgIH0KQEAgLTgxOTMsNiAr ODM3NywxOCBAQCAtICh2b2lkKWRyYXdSZWN0OiAoTlNSZWN0KXJlY3QKICAgICAgICAgICAgICAg ICAgICAgTlNXaWR0aCAociksIE5TSGVpZ2h0IChyKSk7CiAgICAgfQogCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworICAvKiBPbiAxMC8xNC8yMDE4 LCBjb21taXQgN2U4ZWVlNjBhOWRiYjBjNTljZjI2ZjIzN2IyMWVmZTdmZDEwNDNjOSBpbnN0aXR1 dGVkIGEKKyAgc3lzdGVtIG9mIGRyYXdpbmcgb25seSAiZGlydHkgcmVjdGFuZ2xlcyIsIHdoaWNo IG1heSBleGNsdWRlIGEgcG9ydGlvbiBvZiB0aGUKKyAgbXVsdGlwbGUgZmFrZSBjdXJzb3JzLiAg VGhlcmVmb3JlLCB3ZSBleHBvc2UgdGhlIGVudGlyZSBmcmFtZSBhbmQgbGltaXQgdGhlCisgIHNj b3BlIHRvIG9ubHkgbXVsdGlwbGUgZmFrZSBjdXJzb3JzLiAqLworICBtY19leHBvc2VfZnJhbWUg KGVtYWNzZnJhbWUsIDAsIDAsIDAsIDApOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAgIHVuYmxvY2tfaW5wdXQgKCk7CiAKICAgLyoKZGlmZiAtLWdpdCBhL3NyYy93MzJ0ZXJtLmMg Yi9zcmMvdzMydGVybS5jCmluZGV4IDhkMTg5YWUuLmNiZjk0NjYgMTAwNjQ0Ci0tLSBhL3NyYy93 MzJ0ZXJtLmMKKysrIGIvc3JjL3czMnRlcm0uYwpAQCAtNTQ1LDYgKzU0NSwxNSBAQCB4X3VwZGF0 ZV9iZWdpbiAoc3RydWN0IGZyYW1lICpmKQogICBpZiAoISBGUkFNRV9XMzJfUCAoZikpCiAgICAg cmV0dXJuOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09S UyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gZjsKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogICAvKiBSZWdlbmVyYXRlIGRpc3BsYXkgcGFsZXR0ZSBiZWZvcmUgZHJhd2lu ZyBpZiBsaXN0IG9mIHJlcXVlc3RlZAogICAgICBjb2xvcnMgaGFzIGNoYW5nZWQuICovCiAgIGlm IChkaXNwbGF5X2luZm8tPnJlZ2VuX3BhbGV0dGUpCkBAIC03NTQsNiArNzYzLDE2IEBAIHhfdXBk YXRlX2VuZCAoc3RydWN0IGZyYW1lICpmKQogCiAgIC8qIE1vdXNlIGhpZ2hsaWdodCBtYXkgYmUg ZGlzcGxheWVkIGFnYWluLiAgKi8KICAgTU9VU0VfSExfSU5GTyAoZiktPm1vdXNlX2ZhY2VfZGVm ZXIgPSBmYWxzZTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENV UlNPUlMgKi8KKworICBmLT5tY191cGRhdGluZ19mcmFtZSA9IE5VTEw7CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKIH0KIAogCkBAIC05NzMsNiArOTkyLDIwIEBAIHN0YXRpYyB2b2lk IHczMl9kcmF3X2JveF9yZWN0IChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICosIGludCwgaW50LCBpbnQs IGludCwKIHN0YXRpYyB2b2lkCiB4X3NldF9jdXJzb3JfZ2MgKHN0cnVjdCBnbHlwaF9zdHJpbmcg KnMpCiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JT ICovCisKKyAgaWYgKHMtPnctPm1jLmN1cnNvcl9nY19kZWZhdWx0KQorICAgIHsKKyAgICAgIHMt PmdjID0gcy0+Zi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2M7CisgICAgICByZXR1cm47Cisg ICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIGlmIChzLT5mb250ID09IEZS QU1FX0ZPTlQgKHMtPmYpCiAgICAgICAmJiBzLT5mYWNlLT5iYWNrZ3JvdW5kID09IEZSQU1FX0JB Q0tHUk9VTkRfUElYRUwgKHMtPmYpCiAgICAgICAmJiBzLT5mYWNlLT5mb3JlZ3JvdW5kID09IEZS QU1FX0ZPUkVHUk9VTkRfUElYRUwgKHMtPmYpCkBAIC01NjkwLDYgKzU3MjMsMjYgQEAgeF9kcmF3 X2hvbGxvd19jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdykK IAogICAvKiBDb21wdXRlIGZyYW1lLXJlbGF0aXZlIGNvb3JkaW5hdGVzIGZvciBwaHlzIGN1cnNv ci4gICovCiAgIGdldF9waHlzX2N1cnNvcl9nZW9tZXRyeSAodywgcm93LCBjdXJzb3JfZ2x5cGgs ICZsZWZ0LCAmdG9wLCAmaCk7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRSBDVVJTT1JTICovCisKKy8qIExFR0VORDoKKworLSAgdG9wIHkgPT0gV0lORE9XX1RPX0ZS QU1FX1BJWEVMX1kgKHcsIHJvdy0+eSkKKworLSAgYm90dG9tIHkgPT0gV0lORE9XX1RPX0ZSQU1F X1BJWEVMX1kgKHcsIHJvdy0+eSkgLSByb3ctPmhlaWdodAorCistICBoIG9mIEhPTExPV19CT1hf Q1VSU09SID09IHJvdy0+aGVpZ2h0CisgICBbVGhpcyBhdm9pZHMgYSB2aXNpYmxlIGdhcCBhYm92 ZS9iZWxvdy5dICovCisKKyAgaWYgKHctPm1jLmggPiAwKQorICAgIGggPSByb3ctPmhlaWdodDsK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICByZWN0LmxlZnQgPSBsZWZ0OwogICAv KiBXaGVuIG9uIFIyTCBjaGFyYWN0ZXIsIHNob3cgY3Vyc29yIGF0IHRoZSByaWdodCBlZGdlIG9m IHRoZQogICAgICBnbHlwaCwgdW5sZXNzIHRoZSBjdXJzb3IgYm94IGlzIGFzIHdpZGUgYXMgdGhl IGdseXBoIG9yIHdpZGVyCkBAIC01NzUzLDcgKzU4MDYsMTcgQEAgeF9kcmF3X2Jhcl9jdXJzb3Ig KHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKIAkgaW52aXNpYmxlLiAg VXNlIHRoZSBnbHlwaCdzIGZvcmVncm91bmQgY29sb3IgaW5zdGVhZCBpbiB0aGlzCiAJIGNhc2Us IG9uIHRoZSBhc3N1bXB0aW9uIHRoYXQgdGhlIGdseXBoJ3MgY29sb3JzIGFyZSBjaG9zZW4gc28K IAkgdGhhdCB0aGUgZ2x5cGggaXMgbGVnaWJsZS4gICovCi0gICAgICBpZiAoZmFjZS0+YmFja2dy b3VuZCA9PSBjdXJzb3JfY29sb3IpCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBN VUxUSVBMRSBDVVJTT1JTICovCisKKyAgICAgIGlmIChmYWNlLT5iYWNrZ3JvdW5kID09IGN1cnNv cl9jb2xvcgorICAgICAgICAgICYmICF3LT5tYy5jdXJzb3JfZ2NfaW52aXNpYmxlX29rYXkpCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAljdXJzb3JfY29sb3IgPSBmYWNlLT5mb3Jl Z3JvdW5kOwogCiAgICAgICB4ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgdy0+ cGh5c19jdXJzb3IueCk7CkBAIC01Nzc0LDYgKzU4MzcsMTcgQEAgeF9kcmF3X2Jhcl9jdXJzb3Ig KHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKIAkgIGlmICgoY3Vyc29y X2dseXBoLT5yZXNvbHZlZF9sZXZlbCAmIDEpICE9IDApCiAJICAgIHggKz0gY3Vyc29yX2dseXBo LT5waXhlbF93aWR0aCAtIHdpZHRoOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyog TVVMVElQTEUgQ1VSU09SUyAqLworCisgICAgLyogQWxpZ24gYWxsIGZha2UgQkFSX0NVUlNPUiBv ZiB0aGUgVkVSVElDQUxfUlVMRVIgd2l0aCBgb3BvaW50X3gnLiAqLworICAgIGlmICh3LT5tYy5m eCA+IDApCisgICAgICB4ID0gdy0+bWMuZng7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor CisKIAkgIHczMl9maWxsX2FyZWEgKGYsIGhkYywgY3Vyc29yX2NvbG9yLCB4LAogCQkJIFdJTkRP V19UT19GUkFNRV9QSVhFTF9ZICh3LCB3LT5waHlzX2N1cnNvci55KSwKIAkJCSB3aWR0aCwgcm93 LT5oZWlnaHQpOwpAQCAtNTg5NSwzMSArNTk2OSwyMzggQEAgdzMyX2RyYXdfd2luZG93X2N1cnNv ciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqZ2x5cGhfcm93LAogCSAgcmV0 dXJuOwogCX0KIAotICAgICAgc3dpdGNoIChjdXJzb3JfdHlwZSkKLQl7Ci0JY2FzZSBIT0xMT1df Qk9YX0NVUlNPUjoKLQkgIHhfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBnbHlwaF9yb3cpOwotCSAg YnJlYWs7CiAKLQljYXNlIEZJTExFRF9CT1hfQ1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W5uaW5nICgpKSA6IC0xOworICAgICAgcHRyZGlmZl90 IHJlZ2lvbl9lbmQgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IFhGSVhOVU0gKEZyZWdpb25fZW5kICgp KSA6IC0xOworICAgICAgcHRyZGlmZl90IG9wb2ludF9wdCA9ICh3ID09IFhXSU5ET1cgKHNlbGVj dGVkX3dpbmRvdykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBQVAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogWEZJWE5VTSAoRm1hcmtlcl9wb3NpdGlvbiAody0+cG9pbnRt KSk7CisgICAgICBib29sIHJlZ2lvbl9pbl9ib3VuZHNfcCA9IChyZWdpb25fYWN0aXZlX3AKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF9wdCA+PSByZWdpb25fYmVn aW5uaW5nCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfcHQgPCBy ZWdpb25fZW5kKTsKKyAgICAgIGlmIChnbHlwaC0+dHlwZSAhPSBJTUFHRV9HTFlQSCAmJiB3LT5t Yy5yZWQgPj0gMCAmJiB3LT5tYy5ibHVlID49IDAgJiYgdy0+bWMuZ3JlZW4gPj0gMCkKKyAgICAg ICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMy LT5jdXJzb3JfZ2MnIGJ5IGJvcnJvd2luZyB0aGUKKyAgICAgICAgICBmdW5jdGlvbmFsaXR5IG9m IGB4X21ha2VfZ2MnIGluIHczMmZucy5jLiAgKi8KKyAgICAgICAgICBpZiAocmVnaW9uX2FjdGl2 ZV9wCisgICAgICAgICAgICAgICYmIHJlZ2lvbl9pbl9ib3VuZHNfcAorICAgICAgICAgICAgICAm JiBhY3RpdmVfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhv bGxvd19hY3RpdmVfcmVnaW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TsKKyAg ICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAvKiBGb3JjZSBgeF9zZXRfY3Vyc29y X2djJyB0byB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djJy4gICovCisgICAg ICAgICAgdy0+bWMuY3Vyc29yX2djX2RlZmF1bHQgPSB0cnVlOworICAgICAgICAgIGRyYXdfcGh5 c19jdXJzb3JfZ2x5cGggKHcsIGdseXBoX3JvdywgRFJBV19DVVJTT1IpOworICAgICAgICAgIHct Pm1jLmN1cnNvcl9nY19kZWZhdWx0ID0gZmFsc2U7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEu dzMyLT5jdXJzb3JfZ2MgPSBvcmlnaW5hbF9jdXJzb3JfZ2M7CisgICAgICAgICAgdW5ibG9ja19p bnB1dCAoKTsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRh LnczMi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5j dXJzb3JfcGl4ZWwgPSBjb2xvcl9waXhlbDsKKyAgICAgICAgICB4X2RyYXdfaG9sbG93X2N1cnNv ciAodywgZ2x5cGhfcm93KTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9w aXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlm IChnbHlwaC0+dHlwZSA9PSBJTUFHRV9HTFlQSCAmJiB3LT5tYy5yZWQgPj0gMCAmJiB3LT5tYy5i bHVlID49IDAgJiYgdy0+bWMuZ3JlZW4gPj0gMCkKKyAgICAgICAgICB7CisgICAgICAgICAgICAv KiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4g ICovCisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9y X3BpeGVsOworICAgICAgICAgICAgeF9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIGdseXBoX3Jvdyk7 CisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFs X2N1cnNvcl9waXhlbDsKKyAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAg eworICAgICAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLncz Mi0+Y3Vyc29yX2djJyBieSBib3Jyb3dpbmcgdGhlCisgICAgICAgICAgICAgIGZ1bmN0aW9uYWxp dHkgb2YgYHhfbWFrZV9nYycgaW4gdzMyZm5zLmMuICAqLworICAgICAgICAgICAgICBpZiAocmVn aW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAmJiByZWdpb25faW5fYm91bmRzX3AKKyAg ICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9wKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9mYWNlX2lkID0gbG9v a3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1yZWdpb24t ZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0 aXZlX3JlZ2lvbl9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9m YWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2Zh Y2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vy c29yLWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93 X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOwor ICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2Zh Y2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgICBnY192YWx1ZXMuYmFja2dyb3VuZCA9 IGhvbGxvd19hY3RpdmVfcmVnaW9uX2ZhY2UtPmJhY2tncm91bmQ7CisgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgICAgIGVsc2UgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAg ICAgICAgICAgICAgICYmICFyZWdpb25faW5fYm91bmRzX3AKKyAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBhY3RpdmVfcCkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAg ICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX291dF9mYWNlX2lkID0gbG9va3Vw X25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1yZWdpb24tZmFj ZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3Rp dmVfcmVnaW9uX291dF9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX3JlZ2lv bl9vdXRfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3df YWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFs LWZha2UtY3Vyc29yLWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBm YWNlICpob2xsb3dfY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SBpcyB1c2Vk LiAqLworICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICghYWN0aXZlX3ApCisgICAgICAgICAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxv d19pbmFjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIist cmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAg ICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19pbmFjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lE IChmLCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBn Y192YWx1ZXMuZm9yZWdyb3VuZCA9IGhvbGxvd19pbmFjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kOwor ICAgICAgICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfaW5h Y3RpdmVfZmFjZS0+YmFja2dyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djID0gWENyZWF0ZUdDIChOVUxMLCBG UkFNRV9XMzJfV0lORE9XIChmKSwgbWFzaywgJmdjX3ZhbHVlcyk7CisgICAgICAgICAgICAgIGJs b2NrX2lucHV0ICgpOworICAgICAgICAgICAgICAvKiBGb3JjZSBgeF9zZXRfY3Vyc29yX2djJyB0 byB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djJy4gICovCisgICAgICAgICAg ICAgIHctPm1jLmN1cnNvcl9nY19kZWZhdWx0ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgZHJhd19w aHlzX2N1cnNvcl9nbHlwaCAodywgZ2x5cGhfcm93LCBEUkFXX0NVUlNPUik7CisgICAgICAgICAg ICAgIHctPm1jLmN1cnNvcl9nY19kZWZhdWx0ID0gZmFsc2U7CisgICAgICAgICAgICAgIGYtPm91 dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djID0gb3JpZ2luYWxfY3Vyc29yX2djOworICAgICAgICAg ICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgICAgICAgICB4X2RyYXdfaG9sbG93X2N1cnNv ciAodywgZ2x5cGhfcm93KTsKKyAgICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAg ICBjYXNlIEhPTExPV19CT1hfQ1VSU09SOgorICAgIHsKKyAgICAgIGlmICh3LT5tYy5yZWQgPj0g MCAmJiB3LT5tYy5ibHVlID49IDAgJiYgdy0+bWMuZ3JlZW4gPj0gMCkKKyAgICAgICAgeworICAg ICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3Jf cGl4ZWwnLiAgKi8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9 IGNvbG9yX3BpeGVsOworICAgICAgICAgIHhfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBnbHlwaF9y b3cpOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2lu YWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB4X2Ry YXdfaG9sbG93X2N1cnNvciAodywgZ2x5cGhfcm93KTsKKyAgICAgIGJyZWFrOworICAgIH0KKyAg ICBjYXNlIEZJTExFRF9CT1hfQ1VSU09SOgorICAgIHsKKyAgICAgIGlmICh3LT5tYy5yZWQgPj0g MCAmJiB3LT5tYy5ibHVlID49IDAgJiYgdy0+bWMuZ3JlZW4gPj0gMCkKKyAgICAgICAgeworICAg ICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cH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ICAgICAgIGVsc2UKKyAgICAgICAgICBkcmF3X3BoeXNfY3Vyc29yX2dseXBoICh3LCBnbHlw aF9yb3csIERSQVdfQ1VSU09SKTsKKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIEJBUl9D VVJTT1I6CisgICAgeworICAgICAgaWYgKHctPm1jLnJlZCA+PSAwICYmIHctPm1jLmJsdWUgPj0g MCAmJiB3LT5tYy5ncmVlbiA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJp bHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcuICAqLworICAgICAg ICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gY29sb3JfcGl4ZWw7CisgICAg ICAgICAgdy0+bWMuY3Vyc29yX2djX2ludmlzaWJsZV9va2F5ID0gdHJ1ZTsKKyAgICAgICAgICB4 X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEJBUl9DVVJTT1Ip OworICAgICAgICAgIHctPm1jLmN1cnNvcl9nY19pbnZpc2libGVfb2theSA9IGZhbHNlOworICAg ICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29y X3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB4X2RyYXdfYmFyX2N1 cnNvciAodywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEJBUl9DVVJTT1IpOworICAgICAgYnJl YWs7CisgICAgfQorICAgIGNhc2UgSEJBUl9DVVJTT1I6CisgICAgeworICAgICAgaWYgKHctPm1j LnJlZCA+PSAwICYmIHctPm1jLmJsdWUgPj0gMCAmJiB3LT5tYy5ncmVlbiA+PSAwKQorICAgICAg ICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzIt PmN1cnNvcl9waXhlbCcuICAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29y X3BpeGVsID0gY29sb3JfcGl4ZWw7CisgICAgICAgICAgdy0+bWMuY3Vyc29yX2djX2ludmlzaWJs ZV9va2F5ID0gdHJ1ZTsKKyAgICAgICAgICB4X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cGhfcm93 LCBjdXJzb3Jfd2lkdGgsIEhCQVJfQ1VSU09SKTsKKyAgICAgICAgICB3LT5tYy5jdXJzb3JfZ2Nf aW52aXNpYmxlX29rYXkgPSBmYWxzZTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1 cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBl bHNlCisgICAgICAgICAgeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIGdseXBoX3JvdywgY3Vyc29yX3dp ZHRoLCBIQkFSX0NVUlNPUik7CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBOT19DVVJT T1I6CisgICAgICB3LT5waHlzX2N1cnNvcl93aWR0aCA9IDA7CisgICAgICBicmVhazsKKyAgICBk ZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7CisgIH0KIAotCWNhc2UgSEJBUl9DVVJTT1I6 Ci0JICB4X2RyYXdfYmFyX2N1cnNvciAodywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEhCQVJf Q1VSU09SKTsKLQkgIGJyZWFrOworLyogZW5kIE1VTFRJUExFIENVUlNPUlMgKi8KKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLwogCi0JY2FzZSBOT19DVVJTT1I6Ci0JICB3LT5waHlzX2N1cnNvcl93 aWR0aCA9IDA7Ci0JICBicmVhazsKIAotCWRlZmF1bHQ6Ci0J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pc3AuYy4gICovCisgICAgTGlzcF9PYmplY3QgY3Jvc3NoYWlyc19jYWNoZTsKKwor ICAgIC8qIFRoZSBjYWNoZSBmb3IgbXVsdGlwbGUgZ2x5cGgvZ2x5cGhsZXNzIGN1cnNvcnMgdGhh dCBmb3JtIHRoZSB2aXNpYmxlIGZpbGwKKyAgICBjb2x1bW4uICBGb3IgYW4gZXhhbXBsZSBvZiB0 aGUgc3RydWN0dXJlIG9mIHRoZSBsaXN0LCBzZWUgdGhlIGNvbW1lbnRzIGF0IHRoZQorICAgIGJl Z2lubmluZyBvZiBgbWNfZHJhd19tdWx0aXBsZV9jdXJzb3JzJyBpbiB4ZGlzcC5jLiAgKi8KKyAg ICBMaXNwX09iamVjdCBtY19maWxsX2NvbHVtbl9jYWNoZTsKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogICAgIC8qIE5vIExpc3AgZGF0YSBtYXkgZm9sbG93IGJlbG93IHRoaXMgcG9p bnQgd2l0aG91dCBjaGFuZ2luZwogICAgICAgIG1hcmtfb2JqZWN0IGluIGFsbG9jLmMuICBUaGUg bWVtYmVyIGN1cnJlbnRfbWF0cml4IG11c3QgYmUgdGhlCiAgICAgICAgZmlyc3Qgbm9uLUxpc3Ag bWVtYmVyLiAgKi8KQEAgLTMwOSw2ICszOTMsMTYgQEAgc3RydWN0IHdpbmRvdwogCiAjaWZkZWYg SEFWRV9XSU5ET1dfU1lTVEVNCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRSBDVVJTT1JTICovCisKKyAgICAvKiBUaGUgcHJlZml4IGZvciB3aW5kb3cgcG9pbnRlcnMg cmVsYXRpbmcgdG8gbXVsdGlwbGUgY3Vyc29ycy4gICovCisgICAgc3RydWN0IG11bHRpcGxlX2N1 cnNvcnMgbWM7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAvKiBDdXJzb3Ig dHlwZSBvZiBsYXN0IGN1cnNvciBkcmF3biBvbiB0aGUgd2luZG93LiAgKi8KICAgICBlbnVtIHRl eHRfY3Vyc29yX2tpbmRzIHBoeXNfY3Vyc29yX3R5cGU7CiAKQEAgLTQ0Nyw2ICs1NDEsMzEgQEAg WFdJTkRPVyAoTGlzcF9PYmplY3QgYSkKICAgcmV0dXJuIFhVTlRBRyAoYSwgTGlzcF9WZWN0b3Js aWtlLCBzdHJ1Y3Qgd2luZG93KTsKIH0KIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFIENVUlNPUlMgKi8KKworSU5MSU5FIHZvaWQKK3dzZXRfbXVsdGlwbGVfY3Vyc29y c19jYWNoZSAoc3RydWN0IHdpbmRvdyAqdywgTGlzcF9PYmplY3QgdmFsKQoreworICB3LT5tdWx0 aXBsZV9jdXJzb3JzX2NhY2hlID0gdmFsOworfQorCitJTkxJTkUgdm9pZAord3NldF9jcm9zc2hh aXJzX2NhY2hlIChzdHJ1Y3Qgd2luZG93ICp3LCBMaXNwX09iamVjdCB2YWwpCit7CisgIHctPmNy b3NzaGFpcnNfY2FjaGUgPSB2YWw7Cit9CisKK0lOTElORSB2b2lkCit3c2V0X21jX2ZpbGxfY29s dW1uX2NhY2hlIChzdHJ1Y3Qgd2luZG93ICp3LCBMaXNwX09iamVjdCB2YWwpCit7CisgIHctPm1j X2ZpbGxfY29sdW1uX2NhY2hlID0gdmFsOworfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiAvK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zICh2b2lkKTsKQEAgLTky MSw2ICs5MzAsNTE3MiBAQCBzdGF0aWMgdm9pZCBzaG93X21vdXNlX2ZhY2UgKE1vdXNlX0hMSW5m byAqLCBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UpOwogc3RhdGljIGJvb2wgY29vcmRzX2luX21vdXNl X2ZhY2VfcCAoc3RydWN0IHdpbmRvdyAqLCBpbnQsIGludCk7CiAKIAorLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRSBDVVJTT1JTICovCisKKy8qIE1VTFRJUExFIENV UlNPUlM6ICBFbWFjcyBCdWcgIzIyODczIChmZWF0dXJlIHJlcXVlc3QpCisKKyAgIENST1NTSEFJ UlM6ICBFbWFjcyBCdWcgIzE3Njg0IChmZWF0dXJlIHJlcXVlc3QpCisKKworUEFUQ0ggVkVSU0lP TjogIDAxNC4wMDAgWzA4LzI4LzIwMThdCisgICAgICAgICAgICAgICAgMDE0LjAwMSBbMDkvMDEv MjAxOF0KKyAgICAgICAgICAgICAgICAwMTQuMDAyIFswOS8wMi8yMDE4XQorICAgICAgICAgICAg ICAgIDAxNC4wMDMgWzA5LzA1LzIwMThdCisgICAgICAgICAgICAgICAgMDE0LjAwNCBbMDkvMDgv MjAxOF0KKyAgICAgICAgICAgICAgICAwMTQuMDA1IFswOS8wOS8yMDE4XQorICAgICAgICAgICAg ICAgIDAxNC4wMDYgWzA5LzA5LzIwMThdCisgICAgICAgICAgICAgICAgMDE0LjAwNyBbMDkvMTAv MjAxOF0KKyAgICAgICAgICAgICAgICAwMTQuMDA4IFswOS8xMC8yMDE4XQorICAgICAgICAgICAg ICAgIDAxNC4wMDkgWzA5LzExLzIwMThdCisgICAgICAgICAgICAgICAgMDE0LjAxMCBbMDkvMTMv MjAxOF0KKyAgICAgICAgICAgICAgICAwMTQuMDExIFswOS8xNC8yMDE4XQorICAgICAgICAgICAg ICAgIDAxNC4wMTIgWzA5LzE3LzIwMThdCisgICAgICAgICAgICAgICAgMDE0LjAxMyBbMDkvMTgv MjAxOF0KKyAgICAgICAgICAgICAgICAwMTQuMDE0IFswOS8xOS8yMDE4XQorICAgICAgICAgICAg ICAgIDAxNC4wMTUgWzA5LzIzLzIwMThdCisgICAgICAgICAgICAgICAgMDE0LjAxNiBbMDkvMjQv MjAxOF0KKyAgICAgICAgICAgICAgICAwMTQuMDE3IFswOS8yNS8yMDE4XQorICAgICAgICAgICAg ICAgIDAxNC4wMTggWzA5LzI2LzIwMThdCisgICAgICAgICAgICAgICAgMDE0LjAxOSBbMTAvMDEv MjAxOF0KKyAgICAgICAgICAgICAgICAwMTQuMDIwIFsxMC8wMi8yMDE4XQorICAgICAgICAgICAg ICAgIDAxNC4wMjEgWzEwLzA5LzIwMThdCisgICAgICAgICAgICAgICAgMDE0LjAyMiBbMTAvMTAv MjAxOF0KKyAgICAgICAgICAgICAgICAwMTQuMDIzIFsxMC8xMC8yMDE4XQorICAgICAgICAgICAg ICAgIDAxNC4wMjQgWzEwLzEzLzIwMThdCisgICAgICAgICAgICAgICAgMDE0LjAyNSBbMTEvMTAv MjAxOF0KKyAgICAgICAgICAgICAgICAwMTUuMDAwIFsxMS8xMC8yMDE4XQorICAgICAgICAgICAg ICAgIDAxNS4wMDEgWzExLzExLzIwMThdCisgICAgICAgICAgICAgICAgMDE2LjAwMCBbMTEvMjAv MjAxOF0KKyAgICAgICAgICAgICAgICAwMTcuMDAwIFsxMi8xMy8yMDE4XQorCisKK1NFVFVQOgor CitTdGVwIDE6ICBnaXQgY2xvbmUgLWIgbWFzdGVyIGdpdDovL2dpdC5zdi5nbnUub3JnL2VtYWNz LmdpdAorCitTdGVwIDI6ICBJbiB0aGUgbmV3IGVtYWNzIGZvbGRlciwgZ28gYmFjayB0byBhbiBF bWFjcyB2ZXJzaW9uIGZyb20gMTIvMTMvMjAxODoKKworZ2l0IHJlc2V0IC0taGFyZC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kKKwor LSAgVG8gdXNlIHRoZSBuZXcgY3Vyc29yIHR5cGUgb2YgYSBGUkFNRURfQk9YX0NVUlNPUiB3aXRo IGNyb3NzaGFpcnMgb3IgbXVsdGlwbGUKKyAgIGZha2UgY3Vyc29ycywgZXZhbHVhdGUgdGhlIGZv bGxvd2luZyBzbmlwcGV0OgorCisgICAoc2V0cSBtYy1yZWFsLWZha2UtY3Vyc29yICdmcmFtZWQp CisKKy0gIFRvIGxlYXJuIGhvdyB0byB1c2UgdGhlIG11bHRpcGxlIGZha2UgY3Vyc29ycyBmZWF0 dXJlLCBleGFtaW5lIHRoZQorICAgaW50ZXJhY3RpdmUgZnVuY3Rpb24gYG1jLXRlc3QnLgorCist ICBFWEFNUExFIE9GIEhPVyBUTyBVU0UgTVVMVElQTEUgRkFLRSBDVVJTT1JTOgorCisgIDs7OyAo QlVGRkVSLVBPU0lUSU9OIENVUlNPUi1UWVBFIENVUlNPUi1DT0xPUikKKyAgOzs7CisgIChzZXRx IG11bHRpcGxlLWN1cnNvcnMtY29uZiAnKCgxICJoYmFyIiAibWFnZW50YSIpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICgyICJiYXIiICJwdXJwbGUiKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAoMyAiYm94IiAiIzAwRkYwMCIpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICg0ICJob2xsb3ciICIjMDAwMEZGIikKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgKDUgKCJoYmFyIiAzKSBbMS4wIDAuMCAxLjBdKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAoNiAoImJhciIgMykgWzAuMCAxLjAgMS4wXSkpKQorCisgIDs7OyBU VVJOIE9GRi4KKyAgOzs7CisgIChzZXRxIG11bHRpcGxlLWN1cnNvcnMtY29uZiBuaWwpCisKKwor Q0hBTkdFTE9HOgorCistICBuc3Rlcm0ubTogIEN1cnNvcnMgYXJlIG5vdyBk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W5kb3csIHcpOworICAgICAgTGlzcF9PYmplY3Qgd2luZG93X3N0 cmluZyA9IEZwcmluMV90b19zdHJpbmcgKHdpbmRvdywgUW5pbCk7CisgICAgICBjaGFyICp3aW5k b3dfY2hhciA9IFNTREFUQSAod2luZG93X3N0cmluZyk7CisgICAgICBmcHJpbnRmIChzdGRlcnIs ICJcbndpbmRvdyAoJXMpXG4iLCB3aW5kb3dfY2hhcik7CisgICAgfQorI2VuZGlmCisKKyNpZmRl ZiBHTFlQSF9ERUJVRworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAg aW50IHRlbXBfZnggPSBXSU5ET1dfVEVYVF9UT19GUkFNRV9QSVhFTF9YICh3LCB3LT5waHlzX2N1 cnNvci54KTsKKyAgaW50IHRlbXBfZnkgPSBXSU5ET1dfVE9fRlJBTUVfUElYRUxfWSAodywgdy0+ cGh5c19jdXJzb3IueSk7CisgIGVudW0gd2luZG93X3BhcnQgcGFydCA9IE9OX05PVEhJTkc7Cisg IExpc3BfT2JqZWN0IHdpbmRvdyA9IHdpbmRvd19mcm9tX2Nvb3JkaW5hdGVzIChmLCB0ZW1wX2Z4 LCB0ZW1wX2Z5LCAmcGFydCwgZmFsc2UpOworICBMaXNwX09iamVjdCB3aW5kb3dfc3RyaW5nID0g RnByaW4xX3RvX3N0cmluZyAod2luZG93LCBRbmlsKTsKKyAgZGVidWdfbWV0aG9kX2FkZCAodywg IndpbmRvdyAoJXMpIiwgU1NEQVRBICh3aW5kb3dfc3RyaW5nKSk7CisjZW5kaWYKKworY2hhciAq d19jb250ZW50cyA9IChCVUZGRVJQICh3LT5jb250ZW50cykgJiYgU1RSSU5HUCAoQlZBUiAoWEJV RkZFUiAody0+Y29udGVudHMpLCBuYW1lKSkpCisgICAgICAgICAgICAgICAgICAgPyBTU0RBVEEg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbmFtZSkpCisgICAgICAgICAgICAgICAgICAg OiA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KKyAgICB7CisgICAgICBpbnQgYzsK KyAgICAgIC8qIE9jY2FzaW9uYWxseSB3ZSBtYXkgbmVlZCB0byBza2lwIGludmlzaWJsZSB0ZXh0 LiAgKi8KKyAgICAgIHdoaWxlIChzY2FuID09IG5leHRfYm91bmRhcnkpCisgIHsKKyAgICBwdHJk aWZmX3Qgb2xkX3NjYW4gPSBzY2FuOworICAgIC8qIFRoaXMgdXBkYXRlcyBORVhUX0JPVU5EQVJZ IHRvIHRoZSBuZXh0IHBsYWNlCisgICAgICAgd2hlcmUgd2UgbWlnaHQgbmVlZCB0byBza2lwIG1v cmUgaW52aXNpYmxlIHRleHQuICAqLworICAgIHNjYW4gPSBza2lwX2ludmlzaWJsZSAoc2Nhbiwg Jm5leHRfYm91bmRhcnksIGVuZCwgUW5pbCk7CisgICAgaWYgKHNjYW4gIT0gb2xkX3NjYW4pCisg ICAgICBzY2FuX2J5dGUgPSBDSEFSX1RPX0JZVEUgKHNjYW4pOworICAgIGlmIChzY2FuID49IGVu ZCkKKyAgICAgIGdvdG8gZW5kbG9vcDsKKyAgfQorICAgICAgLyogVGVzdCByZWFjaGluZyB0aGUg Z29hbCBjb2x1bW4uICBXZSBkbyB0aGlzIGFmdGVyIHNraXBwaW5nCisgICBpbnZpc2libGUgY2hh cmFjdGVycywgc28gdGhhdCB3ZSBwdXQgcG9pbnQgYmVmb3JlIHRoZQorICAgY2hhcmFjdGVyIG9u IHdoaWNoIHRoZSBjdXJzb3Igd2lsbCBhcHBlYXIuICAqLworICAgICAgaWYgKGNvbCA+PSBnb2Fs KQorICBicmVhazsKKyAgICAgIHByZXZfY29sID0gY29sOworICAgICAgeyAvKiBDaGVjayBkaXNw bGF5IHByb3BlcnR5LiAgKi8KKyAgcHRyZGlmZl90IGVuZHA7CisgIGludCB3aWR0aCA9IG1jX2No ZWNrX2Rpc3BsYXlfd2lkdGggKHNjYW4sIGNvbCwgJmVuZHApOworICBpZiAod2lkdGggPj0gMCkK KyAgICB7CisgICAgICBjb2wgKz0gd2lkdGg7CisgICAgICBpZiAoZW5kcCA+IHNjYW4pIC8qIEF2 b2lkIGluZmluaXRlIGxvb3BzIHdpdGggMC13aWR0aCBvdmVybGF5cy4gICovCisgICAgICAgIHsK KyAgICBzY2FuID0gZW5kcDsKKyAgICBzY2FuX2J5dGUgPSBDSEFSX1RPX0JZVEUgKHNjYW4pOwor ICAgIGNvbnRpbnVlOworICAgICAgICB9CisgICAgfQorICAgICAgfQorICAgICAgLyogQ2hlY2sg Y29tcG9zaXRpb24gc2VxdWVuY2UuICAqLworICAgICAgaWYgKGNtcF9pdC5pZCA+PSAwCisgICAg fHwgKHNjYW4gPT0gY21wX2l0LnN0b3BfcG9zCisgICAgICAgICYmIGNvbXBvc2l0aW9uX3Jlc2Vh dF9pdCAoJmNtcF9pdCwgc2Nhbiwgc2Nhbl9ieXRlLCBlbmQsCisgICAgICAgICAgdywgTlVMTCwg UW5pbCkpKQorICBjb21wb3NpdGlvbl91cGRhdGVfaXQgKCZjbXBfaXQsIHNjYW4sIHNjYW5fYnl0 ZSwgUW5pbCk7CisgICAgICBpZiAoY21wX2l0LmlkID49IDApCisgIHsKKyAgICBzY2FuICs9IGNt cF9pdC5uY2hhcnM7CisgICAgc2Nhbl9ieXRlICs9IGNtcF9pdC5uYnl0ZXM7CisgICAgaWYgKHNj YW4gPD0gZW5kKQorICAgICAgY29sICs9IGNtcF9pdC53aWR0aDsKKyAgICBpZiAoY21wX2l0LnRv ID09IGNtcF9pdC5uZ2x5cGhzKQorICAgICAgeworICAgICAgICBjbXBfaXQuaWQgPSAtMTsKKyAg ICAgICAgY29tcG9zaXRpb25fY29tcHV0ZV9zdG9wX3BvcyAoJmNtcF9pdCwgc2Nhbiwgc2Nhbl9i eXRlLCBlbmQsCisgICAgICAgICAgICAgIFFuaWwpOworICAgICAgfQorICAgIGVsc2UKKyAgICAg IGNtcF9pdC5mcm9tID0gY21wX2l0LnRvOworICAgIGNvbnRpbnVlOworICB9CisgICAgICBjID0g RkVU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VycmVudF9idWZmZXIsIHNlbGVjdGl2ZV9kaXNwbGF5KSwg UXQpKQorICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgaWYgKGMgPT0gJ1x0JykKKyAgICB7Cisg ICAgICBjb2wgKz0gdGFiX3dpZHRoOworICAgICAgY29sID0gY29sIC8gdGFiX3dpZHRoICogdGFi X3dpZHRoOworICAgIH0KKyAgICAgICAgZWxzZQorICAgICsrY29sOworICAgICAgfQorICB9Cisg ICAgICBlbHNlCisgIHsKKyAgICAvKiBUaGUgZGlzcGxheSB0YWJsZSBkb2Vzbid0IGFmZmVjdCB0 aGlzIGNoYXJhY3RlcjsKKyAgICAgICBpdCBkaXNwbGF5cyBhcyBpdHNlbGYuICAqLworICAgIGlm IChjID09ICdcbicpCisgICAgICBnb3RvIGVuZGxvb3A7CisgICAgaWYgKGMgPT0gJ1xyJyAmJiBF USAoQlZBUiAoY3VycmVudF9idWZmZXIsIHNlbGVjdGl2ZV9kaXNwbGF5KSwgUXQpKQorICAgICAg Z290byBlbmRsb29wOworICAgIGlmIChjID09ICdcdCcpCisgICAgICB7CisgICAgICAgIGNvbCAr PSB0YWJfd2lkdGg7CisgICAgICAgIGNvbCA9IGNvbCAvIHRhYl93aWR0aCAqIHRhYl93aWR0aDsK KyAgICAgIH0KKyAgICBlbHNlIGlmIChtdWx0aWJ5dGUgJiYgTEVBRElOR19DT0RFX1AgKGMpKQor ICAgICAgeworICAgICAgICAvKiBTdGFydCBvZiBtdWx0aS1ieXRlIGZvcm0uICAqLworICAgICAg ICB1bnNpZ25lZCBjaGFyICpwdHI7CisgICAgICAgIGludCBieXRlcywgd2lkdGg7CisgICAgICAg IHB0ciA9IEJZVEVfUE9TX0FERFIgKHNjYW5fYnl0ZSk7CisgICAgICAgIE1DX01VTFRJQllURV9C WVRFU19XSURUSCAocHRyLCBkcCwgYnl0ZXMsIHdpZHRoKTsKKyAgICAgICAgLyogU3VidHJhY3Qg b25lIHRvIGNvbXBlbnNhdGUgZm9yI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iBJdCB3YXMgdGhlIGdh cC4gIEp1bXAgYmFjayBvdmVyIGl0LiAgKi8KKyAgICBzdG9wID0gQkVHVl9BRERSOworICAgIHB0 ciA9IEdQVF9BRERSOworICAgIC8qIENoZWNrIHdoZXRoZXIgdGhhdCBicmluZ3MgdXMgdG8gYmVn aW5uaW5nIG9mIGJ1ZmZlci4gICovCisgICAgaWYgKEJFR1YgPj0gR1BUKQorICAgICAgYnJlYWs7 CisgIH0KKyAgICAgIGMgPSAqLS1wdHI7CisgICAgICBpZiAoZHAgJiYgVkVDVE9SUCAoRElTUF9D SEFSX1ZFQ1RPUiAoZHAsIGMpKSkKKyAgeworICAgIGNoYXJ2ZWMgPSBESVNQX0NIQVJfVkVDVE9S IChkcCwgYyk7CisgICAgbiA9IEFTSVpFIChjaGFydmVjKTsKKyAgfQorICAgICAgZWxzZQorICB7 CisgICAgY2hhcnZlYyA9IFFuaWw7CisgICAgbiA9IDE7CisgIH0KKyAgICAgIGZvciAoaSA9IG4g LSAxOyBpID49IDA7IC0taSkKKyAgeworICAgIGlmIChWRUNUT1JQIChjaGFydmVjKSkKKyAgICAg IHsKKyAgICAgICAgLyogVGhpcyBzaG91bGQgYmUgaGFuZGxlZCB0aGUgc2FtZSBhcworICAgICBu ZXh0X2VsZW1lbnRfZnJvbV9kaXNwbGF5X3ZlY3RvciBkb2VzIGl0LiAgKi8KKyAgICAgICAgTGlz cF9PYmplY3QgZW50cnkgPSBBUkVGIChjaGFydmVjLCBpKTsKKyAgICAgICAgaWYgKEdMWVBIX0NP REVfUCAoZW50cnkpKQorICAgIGMgPSBHTFlQSF9DT0RFX0NIQVIgKGVudHJ5KTsKKyAgICAgICAg ZWxzZQorICAgIGMgPSAnICc7CisgICAgICB9CisgICAgaWYgKGMgPj0gMDQwICYmIGMgPCAwMTc3 KQorICAgICAgY29sKys7CisgICAgZWxzZSBpZiAoYyA9PSAnXG4nCisgICAgICAgfHwgKGMgPT0g J1xyJworICAgICAgICAgICAmJiBFUSAoQl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0gcG9zdF90YWI7CisgICAgfQorICBsYXN0X2tub3duX2NvbHVtbiA9IGNvbDsKKyAgbGFzdF9r bm93bl9jb2x1bW5fcG9pbnQgPSBwdDsKKyAgbGFzdF9rbm93bl9jb2x1bW5fbW9kaWZpZWQgPSBN T0RJRkY7CisgIHJldHVybiBjb2w7Cit9CisKK3N0YXRpYyBpbnQKK21jX2xpc3BfdG9fY3Vyc29y X3R5cGUgKExpc3BfT2JqZWN0IGFyZykKK3sKKyAgY2hhciAqc3RyOworICBpZiAoWFRZUEUgKGFy ZykgPT0gTGlzcF9TdHJpbmcpCisgICAgc3RyID0gU1NEQVRBIChhcmcpOworICBlbHNlIGlmIChY VFlQRSAoYXJnKSA9PSBMaXNwX1N5bWJvbCkKKyAgICBzdHIgPSBTU0RBVEEgKFNZTUJPTF9OQU1F IChhcmcpKTsKKyAgZWxzZSByZXR1cm4gLTE7CisgIGlmICghc3RyY21wIChzdHIsICJib3giKSkK KyAgICByZXR1cm4gRklMTEVEX0JPWF9DVVJTT1I7CisgIGlmICghc3RyY21wIChzdHIsICJmcmFt ZWQiKSkKKyAgICByZXR1cm4gRlJBTUVEX0JPWF9DVVJTT1I7CisgIGlmICghc3RyY21wIChzdHIs ICJob2xsb3ciKSkKKyAgICByZXR1cm4gSE9MTE9XX0JPWF9DVVJTT1I7CisgIGlmICghc3RyY21w IChzdHIsICJoYmFyIikpCisgICAgcmV0dXJuIEhCQVJfQ1VSU09SOworICBpZiAoIXN0cmNtcCAo c3RyLCAiYmFyIikpCisgICAgcmV0dXJuIEJBUl9DVVJTT1I7CisgIGlmICghc3RyY21wIChzdHIs ICJsZWZ0LWZyaW5nZS1iaXRtYXAiKSkKKyAgICByZXR1cm4gTEVGVF9GUklOR0VfQklUTUFQOwor ICBpZiAoIXN0cmNtcCAoc3RyLCAicmlnaHQtZnJpbmdlLWJpdG1hcCIpKQorICAgIHJldHVybiBS SUdIVF9GUklOR0VfQklUTUFQOworICBpZiAoIXN0cmNtcCAoc3RyL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N0OworICBwdHJkaWZmX3QgeDsKKyAgaW50IGkgPSAwOworICBMaXNw X09iamVjdCB0ZW1wID0gUW5pbDsKKyAgTGlzcF9PYmplY3QgdmVjdG9yID0gKEZtYWtlX3ZlY3Rv ciAobWFrZV9maXhudW0gKDMpLCBRbmlsKSk7CisgIGlmICghTklMUCAoRm1lbXEgKChGZnJhbWVw ICh0YXJnZXRfZnJhbWUpKSwgbGlzdG4gKENPTlNUWVBFX0hFQVAsIDMsIGludGVybiAoIngiKSwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgaW50ZXJuICgidzMyIiksCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludGVybiAoIm5z IikpKSkpCisgICAgeworICAgICAgY29sb3JfdmFsdWVzID0gKEZ4d19jb2xvcl92YWx1ZXMgKGNv bG9yLCB0YXJnZXRfZnJhbWUpKTsKKyAgICAgIGZvciAodmxpc3QgPSBjb2xvcl92YWx1ZXM7Cisg ICAgICAgICAgIENPTlNQICh2bGlzdCk7CisgICAgICAgICAgIHZsaXN0ID0gWENEUiAodmxpc3Qp KQorICAgICAgICB7CisgICAgICAgICAgeCA9IFhGSVhOVU0gKFhDQVIgKHZsaXN0KSk7CisgICAg ICAgICAgdGVtcCA9IG1ha2VfZmxvYXQgKHggLyB2YWxtYXgpOworICAgICAgICAgIEFTRVQgKHZl Y3RvciwgaSwgdGVtcCk7CisgICAgICAgICAgaSA9IGkgKyAxOworICAgICAgICB9CisgICAgfQor ICByZXR1cm4gdmVjdG9yOworfQorCitzdGF0aWMgTGlzcF9PYmplY3QKK21jX2JnX2xzbCAoc3Ry dWN0IHdpbmRvdyAqdywgZW51bSBmYWNlX2lkIGZhY2VfaWQpCit7CisgIHN0cnVjdCBmcmFtZSAq ZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBzdHJ1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Wx1ZSBpbiBsb2NhbCBiaW5kaW5nIGlzIG5vdCBwcmVzZW50IG9yIHQsIHVzZSBnbG9iYWwgdmFs dWUuCisgICAgIElmIHBhcnRpYWwsIGxvb2t1cCBwYXJ0aWFsIGJpdG1hcCBpbiBkZWZhdWx0IHZh bHVlIGlmIG5vdCBmb3VuZCBoZXJlLgorICAgICBJZiBub3QgcGFydGlhbCwgb3Igbm8gcGFydGlh bCBzcGVjIGlzIHByZXNlbnQsIHVzZSBub24tcGFydGlhbCBiaXRtYXAuICAqLworCitzdGF0aWMg aW50CittY19nZXRfbG9naWNhbF9mcmluZ2VfYml0bWFwIChzdHJ1Y3Qgd2luZG93ICp3LCBMaXNw X09iamVjdCBiaXRtYXAsIGludCByaWdodF9wLCBpbnQgcGFydGlhbF9wKQoreworICBMaXNwX09i amVjdCBjbWFwLCBibTEgPSBRbmlsLCBibTIgPSBRbmlsLCBibTsKKyAgRU1BQ1NfSU5UIGxuMSA9 IDAsIGxuMiA9IDA7CisgIGludCBpeDEgPSByaWdodF9wOworICBpbnQgaXgyID0gaXgxICsgKHBh cnRpYWxfcCA/IDIgOiAwKTsKKyAgaWYgKChjbWFwID0gQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSksICFOSUxQIChjbWFwKSkKKyAgICB7CisgICAg ICBibTEgPSBGYXNzcSAoYml0bWFwLCBjbWFwKTsKKyAgICAgIGlmIChDT05TUCAoYm0xKSkKKyAg eworICAgIGlmICgoYm0xID0gWENEUiAoYm0xKSksIE5JTFAgKGJtMSkpCisgICAgICByZXR1cm4g Tk9fRlJJTkdFX0JJVE1BUDsKKyAgICBpZiAoQ09OU1AgKGJtMSkpCisgICAgICB7CisgICAgICAg IGxuMSA9IFhGSVhOVU0gKEZsZW5ndGggKGJtMSkpOworICAgICAgICBpZiAocGFydGlhbF9wKQor ICAgIHsKKyAgICAgIGlmIChsbjEgPiBpeDIpCisgICAgICAgIHsKKyAgICAgICAgICBibSA9IEZu dGggKG1ha2VfZml4bnVtIChpeDIpLCBibTEpOworICAgICAgICAgIGlmICghRVEgKGJtLCBRdCkp CisgICAgICBnb3RvIGZvdW5kOworICAgICAgICB9CisgICAgfQorICAgICAgICBlbHNlCisgICAg eworICAgICAgaWYgKGxuMSA+IGl4MSkKKyAgICAgICAgeworICAgICAgICAgIGJtID0gRm50aCAo bWFrZV9maXhudW0gKGl4MSksIGJtMSk7CisgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAg ICAgIGdvdG8gZm91bmQ7CisgICAgICAgIH0KKyAgICB9CisgICAgICB9CisgICAgZWxzZSBpZiAo KGJtID0gYm0xLCAhRVEgKGJtLCBRdCkpKQorICAgICAgZ290byBmb3VuZDsKKyAgfQorICAgIH0K KyAgaWYgKCFFUSAoY21hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRv cl9hbGlzdCkpCisgICAgICAmJiAhTklMUCAoQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdl X2luZGljYXRvcl9hbGlzdCkpKQorICAgIHsKKyAgICAgIGJtMiA9IEZhc3NxIChiaXRtYXAsIEJW QVIgKCZidWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKTsKKyAgICAgIGlm IChDT05TUCAoYm0yKSkKKyAgeworICAgIGlmICgoYm0yID0gWENEUiAoYm0yKSksICFOSUxQIChi bTIpKQorICAgICAgeworICAgICAgICBpZiAoQ09OU1AgKGJtMikpCisgICAgeworICAgICAgbG4y ID0gWEZJWE5VTSAoRmxlbmd0aCAoYm0yKSk7CisgICAgICBpZiAocGFydGlhbF9wKQorICAgICAg ICB7CisgICAgICAgICAgaWYgKGxuMiA+IGl4MikKKyAgICAgIHsKKyAgICAgICAgYm0gPSBGbnRo IChtYWtlX2ZpeG51bSAoaXgyKSwgYm0yKTsKKyAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAg ICAgICAgICBnb3RvIGZvdW5kOworICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgICAgfQor ICB9CisgICAgfQorICBpZiAobG4xID4gaXgxKQorICAgIHsKKyAgICAgIGJtID0gRm50aCAobWFr ZV9maXhudW0gKGl4MSksIGJtMSk7CisgICAgICBpZiAoIUVRIChibSwgUXQpKQorICBnb3RvIGZv dW5kOworICAgIH0KKyAgaWYgKGxuMiA+IGl4MSkKKyAgICB7CisgICAgICBibSA9IEZudGggKG1h a2VfZml4bnVtIChpeDEpLCBibTIpOworICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgZ290byBm b3VuZDsKKyAgICAgIHJldHVybiBOT19GUklOR0VfQklUTUFQOworICAgIH0KKyAgZWxzZSBpZiAo KGJtID0gYm0yLCBOSUxQIChibSkpKQorICAgIHJldHVybiBOT19GUklOR0VfQklUTUFQOworIGZv dW5kOgorICByZXR1cm4gbG9va3VwX2ZyaW5nZV9iaXRtYXAgKGJtKTsKK30KKwordm9pZAorbWNf ZXJhc2VfcGh5c19jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIGludCBmbGF2b3IpCit7CisgIHN0 cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBNb3VzZV9ITEluZm8gKmhsaW5m byA9IE1PVVNFX0hMX0lORk8gKGYpOworICBpbnQgaHBvcyA9IHctPnBoeXNfY3Vyc29yLmhwb3M7 CisgIGludCB2cG9zID0gdy0+cGh5c19jdXJzb3IudnBvczsKKyAgYm9vbCBtb3VzZV9mYWNlX2hl cmVfcCA9IGZhbHNlOworICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICphY3RpdmVfZ2x5cGhzID0gdy0+ Y3VycmVudF9tYXRyaXg7CisgIHN0cnVjdCBnbHlwaF9yb3cgKmN1cnNvcl9yb3c7CisgIHN0cnVj dCBnbHlwaCAqY3Vyc29yX2dseXBoOworICBlbnVtIGRyYXdfZ2x5cGhzX2Z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WYgaXQgaXMgYXQgdGhlCisgICBlbmQgb2YgYSBsaW5lIChvbiBhIG5l d2xpbmUpLiAgVGhlIGN1cnNvciBhcHBlYXJzIHRoZXJlLCBidXQKKyAgIG1vdXNlIGhpZ2hsaWdo dGluZyBkb2VzIG5vdC4gICovCisgICAgICAmJiBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0g PiBocG9zICYmIGhwb3MgPj0gMCkKKyAgICBtb3VzZV9mYWNlX2hlcmVfcCA9IHRydWU7CisgIC8q IE1heWJlIGNsZWFyIHRoZSBkaXNwbGF5IHVuZGVyIHRoZSBjdXJzb3IuICAqLworICBpZiAody0+ cGh5c19jdXJzb3JfdHlwZSA9PSBIT0xMT1dfQk9YX0NVUlNPUgorICAgICAgfHwgdy0+cGh5c19j dXJzb3JfdHlwZSA9PSBGUkFNRURfQk9YX0NVUlNPUikKKyAgICB7CisgICAgICBpbnQgeCwgeTsK KyAgICAgIGludCBoZWFkZXJfbGluZV9oZWlnaHQgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hU ICh3KTsKKyAgICAgIGludCB3aWR0aDsKKyAgICAgIGN1cnNvcl9nbHlwaCA9IGdldF9waHlzX2N1 cnNvcl9nbHlwaCAodyk7CisgICAgICBpZiAoY3Vyc29yX2dseXBoID09IE5VTEwpCisgICAgICAg IGdvdG8gbWFya19jdXJzb3Jfb2ZmOworICAgICAgd2lkdGggPSBjdXJzb3JfZ2x5cGgtPnBpeGVs X3dpZHRoOworICAgICAgeCA9IHctPnBoeXNfY3Vyc29yLng7CisgICAgICBpZiAoeCA8IDApCisg ICAgICAgIHsKKyAgICAgICAgICB3aWR0aCArPSB4OworICAgICAgICAgIHggPSAwOworICAgICAg ICB9CisgICAgICB3aWR0aCA9IG1pbiAod2lkdGgsIHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRf QVJFQSkgLSB4KTsKKyAgICAgIHkgPSBXSU5ET1dfVE9fRlJBTUVfUElYRUxfWSAodywgbWF4IC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c3VzcGVuZF9hdXRv X2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVf cAorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTog IEMtdSBDLXggPCBhbmQgZG8gbm90aGluZy4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzBfcCA9 ICh3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5o c2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xs ID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHct PmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBzb21ldGhpbmcgZWxz ZSBiZXNpZGVzIGhvcml6b250YWxseSBzY3JvbGxpbmcgdGhlCisgICAgICAgICAgICAgICBjdXJy ZW50IGxpbmUgZGlmZmVyZW50bHkuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgaXMgX25v dF8gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfYWxs X3Blcm1fMV9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHct Pm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9o c2Nyb2xsID09IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCAuLi4K KyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFsbHkgc2Nyb2xs ZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8yX3AgPSAoIXctPnN1c3Bl bmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Ny b2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPT0g MAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhzY3JvbGwp OworICAvKiBFWEFNUExFOiAgKHNjcm9sbC1sZWZ0IDUpOyBhbmQsIHRoZW4gcHJlc3MgdGhlIGxl ZnQgYXJyb3cga2V5IG9uZSB0aW1lLgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIF9pc18g aG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiovCisgIGJvb2wgaHNjbF90ZW1wX3Ag PSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0 b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAw CisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gMCk7CisgIC8qIEVY QU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIHNvbWV0aGluZyB0aGF0IGNhdXNlcyB0aGUgY3VycmVu dCBsaW5lIHRvIGJlCisgICAgICAgICAgICAgICBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVy ZW50bHkuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkgc2Ny b2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9wZXJtX3AgPSAoIXctPnN1c3BlbmRf YXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVf cAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAg ICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYg dy0+bWluX2hzY3JvbGwgIT0gdy0+aHNjcm9sbCk7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFN RSAody0+ZnJhbWUpOworICAvKiBSZWNvcmQgc29tZSBvZiB0aGUgY3VycmVudCB2YWx1ZXMgZm9y IHRoZSBjdXJzb3IgYW5kIGdseXBoX3Jvdy4gKi8KKyAgYm9vbCBwaHlzX2N1cnNvcl9vbl9wID0g dy0+cGh5c19jdXJzb3Jfb25fcDsKKyAgc3RydWN0IGdseXBoX3JvdyAqZ2x5cGhfcm93ID0gTUFU UklYX1JPVyAody0+Y3VycmVudF9tYXRyaXgsIHZwb3MpOworICBib29sIGN1cnNvcl9pbl9mcmlu Z2VfcCA9IGdseXBoX3Jvdy0+Y3Vyc29yX2luX2ZyaW5nZV9wOworICBib29sIHJldmVyc2VkX3Ag PSBnbHlwaF9yb3ctPnJldmVyc2VkX3A7CisgIHB0cmRpZmZfdCBwaHlzX2N1cnNvcl94ID0gdy0+ cGh5c19jdXJzb3IueDsKKyAgcHRyZGlmZl90IHBoeXNfY3Vyc29yX3kgPSB3LT5waHlzX2N1cnNv ci55OworICBwdHJkaWZmX3QgcGh5c19jdXJzb3JfaHBvcyA9IHctPnBoeXNfY3Vyc29yLm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ld2hhdCBjb25mdXNpbmcgYW5kIHJlcXVpcmVkIHN0ZGVyciBtZXNzYWdlcworICAgICAg dG8gc2VlIHRoYXQgYGdseXBoX3Jvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXBgIHNhdGlzZmllcyB0 aGUgZmlyc3QgY29uZGl0aW9uCisgICAgICBvZiAod2hpY2ggIT0gTk9fRlJJTkdFX0JJVE1BUCku ICBBdCB0aGlzIHRpbWUsIEBsYXdsaXN0IHByZWZlcnMgbm90IHRvCisgICAgICByZWx5IHVwb24g YSBMaXNwIHNldHRpbmcgdXNpbmcgYHNldC1mcmluZ2UtYml0bWFwLWZhY2UnLiAqLworICAgICAg Z2x5cGhfcm93LT5sZWZ0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0gTEVGVF9GUklO R0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZnJp bmdlX2JpdG1hcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTk9f RlJJTkdFX0JJVE1BUDsKKyAgICAgIGdseXBoX3Jvdy0+bGVmdF9mcmluZ2Vfb2Zmc2V0ID0gMDsK KyAgICAgIGRyYXdfZnJpbmdlX2JpdG1hcCAodywgZ2x5cGhfcm93LCB0cnVlKTsKKyAgICB9Cisg ICAgZWxzZSBpZiAoIXJlbW92ZV9wCisgICAgICAgICAgICAgJiYgZmxhdm9yID09IE1DX09WRVJM QVlfQVJST1dfQklUTUFQCisgICAgICAgICAgICAgJiYgKGhzY2xfYWxsX3RlbXBfcAorICAgICAg ICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzBfcAorICAgICAgICAgICAgICAgICB8fCBoc2Ns X2FsbF9wZXJtXzFfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzJfcAorICAg ICAgICAgICAgICAgICB8fCBoc2NsX3RlbXBfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX3Bl cm1fcCkpCisgICAgICB7CisgICAgICAgIGVudW0gZmFjZV9pZCBvdmVybGF5X2Fycm93X2ZhY2Vf aWQgPQorICAgICAgICAgICghYWN0aXZlX3AKKyAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhC VUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlyc19pbmFjdGl2ZV93aW5kb3dzKSkpCisgICAg ICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93 LWhzY2wtaW5hY3RpdmUtZmFjZSIpLCB0cnVlKQorICAgICAgICAgIDogKGFjdGl2ZV9wCisgICAg ICAgICAgICAgJiYgbWluaW1hbF9wKQorICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAo dywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtbWluaW1hbC1mYWNlIiksIHRydWUp CisgICAgICAgICAgOiAoYWN0aXZlX3AKKyAgICAgICAgICAgICAmJiAhbWluaW1hbF9wKQorICAg ICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFy cm93LWhzY2wtZmFjZSIpLCB0cnVlKQorICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAg ICAgICBmYWNlX2lkID0gKGN1cnNvcl90eXBlID09IExFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAg ICAgICAgICAgICAgID8gb3ZlcmxheV9hcnJvd19mYWNlX2lkCisgICAgICAgICAgICAgICAgICA6 IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgZ2x5cGhfcm93LT5sZWZ0X2ZyaW5nZV9mYWNlX2lk ID0gZmFjZV9pZDsKKyAgICAgICAgaWYgKGhzY2xfYWxsX3Blcm1fMF9wKQorICAgICAgICAgIGZy aW5nZV9iaXRtYXAgPSBtY19nZXRfbG9naWNhbF9mcmluZ2VfYml0bWFwICh3LC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gICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IGZyaW5nZV9iaXRtYXAKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgZ2x5cGhf cm93LT5sZWZ0X2ZyaW5nZV9vZmZzZXQgPSAwOworICAgICAgICBkcmF3X2ZyaW5nZV9iaXRtYXAg KHcsIGdseXBoX3JvdywgdHJ1ZSk7CisgICAgICB9CisgICAgICBlbHNlIGlmICghcmVtb3ZlX3AK KyAgICAgICAgICAgICAgICYmIChmbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9B UlJPVworICAgICAgICAgICAgICAgICAgIHx8IGZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xF CisgICAgICAgICAgICAgICAgICAgfHwgZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9B UlJPVworICAgICAgICAgICAgICAgICAgIHx8IGZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAg ICAgICAgICAgICAgICAgICB8fCBmbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSCkp CisgICAgICAgIHsKKyAgICAgICAgICBMaXNwX09iamVjdCBiaXRtYXBfZmxhdm9yID0gKGZsYXZv ciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGZsYXZvciA9PSBNQ19IT0xM T1dfUkVDVEFOR0xFKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g UW1jX2hvbGxvd19yZWN0YW5nbGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiAoZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVykKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXJfcmlnaHRfYXJy b3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZmxhdm9yID09IE1D X1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IFFtY192ZXJ0aWNhbF9iYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiAoZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyX2JhY2tzbGFzaAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFFuaWw7CisgICAgICAgICAgZnJp bmdlX2JpdG1hcCA9IChjdXJzb3JfdHlwZSA9PSBSSUdIVF9GUklOR0VfQklUTUFQKQorICAgICAg ICAgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9mcmluZ2VfYml0bWFwIChiaXRtYXBfZmxhdm9y KQorICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAg ICAgZmFjZV9pZCA9IChjdXJzb3JfdHlwZSA9PSBSSUdIVF9GUklOR0VfQklUTUFQKQorICAgICAg ICAgICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXZlcnRp Y2FsLWJhci1mYWNlIiksIHRydWUpCisgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNF X0lEOworICAgICAgICAgIGdseXBoX3Jvdy0+Y3Vyc29yX2luX2ZyaW5nZV9wID0gZmFsc2U7Cisg ICAgICAgIC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BicmVha2FnZQorICAgICAg ICAgICAgb2YgdGhlIGNvbG9ycyBpbiB0aGF0IG11bHRpcGxpY2F0aW9uIGJ5IHRoZSBiYXNlIHdp bGwgZXhjZWVkIHRoZSBiYXNlLiAqLworICAgICAgICAgICAgaWYgKHctPm1jLnJlZCA+IDEuMCkK KyAgICAgICAgICAgICAgdy0+bWMucmVkID0gMS4wOworICAgICAgICAgICAgaWYgKHctPm1jLmdy ZWVuID4gMS4wKQorICAgICAgICAgICAgICB3LT5tYy5ncmVlbiA9IDEuMDsKKyAgICAgICAgICAg IGlmICh3LT5tYy5ibHVlID4gMS4wKQorICAgICAgICAgICAgICB3LT5tYy5ibHVlID0gMS4wOwor ICAgICAgICAgICAgRlJBTUVfUklGIChmKS0+ZHJhd193aW5kb3dfY3Vyc29yICh3LCBnbHlwaF9y b3csIHgsIHksIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIHRydWUsIGFjdGl2ZV9wKTsKKyAgICAgICAgICAg IHctPm1jLmggPSAtMTsKKyAgICAgICAgICAgIHctPm1jLmZ4ID0gLTE7CisgICAgICAgICAgICB3 LT5tYy5meSA9IC0xOworICAgICAgICAgICAgdy0+bWMuZ2x5cGhfZmxhdm9yID0gTk9fRkxBVk9S OworICAgICAgICAgICAgdy0+bWMucmVkID0gLTEuMDsKKyAgICAgICAgICAgIHctPm1jLmdyZWVu ID0gLTEuMDsKKyAgICAgICAgICAgIHctPm1jLmJsdWUgPSAtMS4wOworICAgICAgICAgICAgdy0+ bWMucG9zaW50ID0gLTE7CisgICAgICAgICAgICB3LT5tYy5hY3RpdmVfcCA9IGZhbHNlOworICAg ICAgICAgIH0KKyAgLyogUmVzdG9yZSB0aGUgcHJldmlvdXMgdmFsdWVzIGZvciB3LT5waHlzX2N1 cnNvciBhbmQgZ2x5cGhfcm93LiAqLworICB3LT5waHlzX2N1cnNvcl9vbl9wID0gcGh5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X0ZBQ0VfSURfU0VO VElORUwpCisgICAgcmV0dXJuOworICBpZiAodyA9PSAwIHx8IGggPT0gMCkKKyAgICB7CisgICAg ICByLnggPSByLnkgPSAwOworICAgICAgci53aWR0aCA9IEZSQU1FX1RFWFRfV0lEVEggKGYpOwor ICAgICAgci5oZWlnaHQgPSBGUkFNRV9URVhUX0hFSUdIVCAoZik7CisgICAgfQorICAgIGVsc2UK KyAgICAgIHsKKyAgICAgICAgci54ID0geDsKKyAgICAgICAgci55ID0geTsKKyAgICAgICAgci53 aWR0aCA9IHc7CisgICAgICAgIHIuaGVpZ2h0ID0gaDsKKyAgICAgIH0KKyAgVFJBQ0UgKChzdGRl cnIsICJtY19leHBvc2VfZnJhbWUgKCVkLCAlZCwgJWQsICVkKVxuIiwgci54LCByLnksIHIud2lk dGgsIHIuaGVpZ2h0KSk7CisgIG1jX2V4cG9zZV93aW5kb3dfdHJlZSAoWFdJTkRPVyAoZi0+cm9v dF93aW5kb3cpLCAmcik7Cit9CisKKy8qIER1bXAgY29udGVudHMgb2YgZ2x5cGggR0xZUEggdG8g c3RkZXJyLiAgUk9XIGFuZCBBUkVBIGFyZQorICAgdGhlIGdseXBoIHJvdyBhbmQgYXJlYSB3aGVy ZSB0aGUgZ2x5cGggY29tZXMgZnJvbS4gICovCisKK3ZvaWQKK21jX2R1bXBfZ2x5cGggKHN0cnVj dCBnbHlwaF9yb3cgKnJvdywgc3RydWN0IGdseXBoICpnbHlwaCwgaW50IGFyZWEsIGludCByZWxh dGl2ZV94KQoreworICBMaXNwX09iamVjdCBjaGFyYWN0ZXIgPSAoQ0hBUkFDVEVSUCAobWFrZV9m aXhudW0gKGdseXBoLT51LmNoKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgID8gRmNoYXJf dG9fc3RyaW5nIChtYWtlX2ZpeG51bSAoZ2x5cGgtPnUuY2gpKQorICAgICAgICAgICAgICAgICAg ICAgICAgICA6IFFuaWw7CisgIGlmIChnbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICB8 fCBnbHlwaC0+dHlwZSA9PSBHTFlQSExFU1NfR0xZUEgpCisgICAgeworICAgICAgZnByaW50ZiAo c3RkZXJyLAorICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHgl MDZ4ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNkICVzICVzXG4iLAorICAgICAgICBn bHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2VkW2FyZWFd ID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94LAor ICAgICAgICAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgPyAnQycKKyAgICAg ICAgIDogJ0cnKSwKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChn bHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNUUklOR1AgKGdseXBo LT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgOiAoTklMUCAoZ2x5cGgt Pm9iamVjdCkKKyAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAgICA6ICctJykpKSwK KyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICBnbHlwaC0+dS5jaCwKKyAgICAg ICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAg ICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+eCwgZ2x5cGgtPnks IGdseXBoLT5ocG9zLCBnbHlwaC0+dnBvcywgZ2x5cGgtPnp2X3AgPyAiWlYiIDogIi0tIiwKKyAg ICAgICAgKCghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgJiYgZ2x5cGgtPnUuY2ggPT0gOSkK KyAgICAgICAgICAgPyAiXFx0IgorICAgICAgICAgOiAoIU5JTFAgKGNoYXJhY3RlcikKKyAgICAg ICAgICAgICYmIGdseXBoLT51LmNoID09IDEwKQorICAgICAgICAgICA/ICJcXG4iCisgICAgICAg ICA6ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgJiYgZ2x5cGgtPnUuY2ggPT0gMzIp CisgICAgICAgICAgID8gIlxccyIKKyAgICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIpCisgICAg ICAgICAgICAmJiBnbHlwaC0+dS5jaCAhPSA5CisgICAgICAgICAgICAmJiBnbHlwaC0+dS5jaCAh PSAxMAorICAgICAgICAgICAgJiYgZ2x5cGgtPnUuY2ggIT0gMzIpCisgICAgICAgICAgID8gU1NE QVRBIChjaGFyYWN0ZXIpCisgICAgICAgICA6ICJcXD8iKSk7CisgICAgfQorICBlbHNlIGlmIChn bHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVy ciwKKyAgICAgICAgIiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAl NGQgJTEuMWQlMS4xZCAlNWQgJTRkICAlM2QgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5cGgg LSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAw KSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAg ICAgJ1MnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBo LT5vYmplY3QpCisgICAgICAgICAgICA/ICdCJworICAgICAgICAgIDogKFNUUklOR1AgKGdseXBo LT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5v YmplY3QpCisgICAgICAgICAgICA/ICcwJworICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBn bHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIDB1LAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwK KyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2Jv eF9saW5lX3AsCisgICAgICAgIGdseXBoLT54LCBnbHlwaC0+eSwgZ2x5cGgtPmhwb3MsIGdseXBo LT52cG9zLCBnbHlwaC0+enZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAiXFxTIik7CisgICAg fQorICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkKKyAgICB7CisgICAgICBm cHJpbnRmIChzdGRlcnIsCisgICAgICAgICIgJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVj ICUzZCAweCUwNnggJTRkICUxLjFkJTEuMWQgJTVkICU0ZCAgJTNkICAlM2QgJXMgJWNcbiIsCisg ICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVz ZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0 aXZlX3gsCisgICAgICAgICdJJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChC VUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnQicKKyAgICAgICAgICA6IChT VFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICA6IChO SUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICA6ICctJykp KSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAodW5zaWduZWQgaW50KSBn bHlwaC0+dS5pbWdfaWQsCisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+ bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAg ICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgZ2x5cGgtPnZwb3MsIGdseXBoLT56 dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7CisgICAgfQorICBlbHNlIGlmIChnbHlw aC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpCisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJy LAorICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4IiwK KyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+ dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVs YXRpdmVfeCwKKyAgICAgICAgJysnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAg KEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdCJworICAgICAgICAgIDog KFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgIDog KE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICcwJworICAgICAgICAgIDogJy0n KSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgICh1bnNpZ25lZCBpbnQp IGdseXBoLT51LmNtcC5pZCk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgJTRkICUxLjFkJTEu MWQiLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xp bmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3ApOworICAgICAgaWYgKGdseXBo LT51LmNtcC5hdXRvbWF0aWMpCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAlNWQgJTRkICAl M2QgICUzZCAlcyAuIFslZC0lZF1cbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGgt PngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgZ2x5cGgtPnZwb3MsIGdseXBoLT56dl9wID8gIlpW IiA6ICItLSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGgtPnNsaWNlLmNtcC5mcm9t LCBnbHlwaC0+c2xpY2UuY21wLnRvKTsKKyAgICAgICAgZWxzZQorICAgICAgICBmcHJpbnRmIChz dGRlcnIsICJcbiIpOworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gWFdJREdFVF9H TFlQSCkKKyAgICB7CisjaWZuZGVmIEhBVkVfWFdJREdFVFMKKyAgICAgIGVhc3N1bWUgKGZhbHNl KTsKKyNlbHNlCisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICIgICU1ZC8lLTVkICU1 ZCAlNGMgJTZkICVjICUzZCAweCUwNXggJTRkICUxLjFkJTEuMWQgJTVkICU0ZCAgJTNkICAlM2Qg JXMgJWNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAg ICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisg ICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdYJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3Ms CisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICA/ICdCJworICAg ICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAg ICAgICA6ICctJykpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIGdseXBo LT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlw aC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnUueHdpZGdldCwKKyAgICAgICAg Z2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgZ2x5cGgtPnZwb3MsIGdseXBoLT56dl9w ID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7CisjZW5kaWYKKyAgICB9Cit9CisKKy8qIER1 bXAgdGhlIGNvbnRlbnRzIG9mIGdseXBoIHJvdyBhdCBWUE9TIGluIE1BVFJJWCB0byBzdGRlcnIu CisgICBHTFlQSFMgMCBtZWFucyBkb24ndCBzaG93IGdseXBoIGNvbnRlbnRzLgorICAgR0xZUEhT IDEgbWVhbnMgc2hvdyBnbHlwaHMgaW4gc2hvcnQgZm9ybQorICAgR0xZUEhTID4gMSBtZWFucyBz aG93IGdseXBocyBpbiBsb25nIGZvcm0uICAqLworCit2b2lkCittY19kdW1wX2dseXBoX3JvdyAo c3RydWN0IGdseXBoX3JvdyAqcm93LCBpbnQgdnBvcywgaW50IGdseXBocykKK3sKKyAgaW50IHJl bGF0aXZlX3ggPSAwOworICBpZiAoZ2x5cGhzICE9IDEpCisgICAgeworICAgICAgZnByaW50ZiAo c3RkZXJyLCAiXG5EVU1QIEdMWVBIIFJPV1xuIik7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICJS b3cgICAgIFN0YXJ0ICAgICAgIEVuZCBVc2VkIG9FPjxcXENUWkZlc20gICAgIFggICAgWSAgICBX ICAgIEggICAgViAgICBBICAgIFBcbiIpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiPT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09XG4iKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIiUzZCAlOSJwRCJk ICU5InBEImQgJTRkICUxLjFkJTEuMWQlMS4xZCUxLjFkXAorJTEuMWQlMS4xZCUxLjFkJTEuMWQl MS4xZCUxLjFkJTEuMWQlMS4xZCAgJTRkICU0ZCAlNGQgJTRkICU0ZCAlNGQgJTRkXG4iLAorICAg ICAgICAgdnBvcywKKyAgICAgICAgIE1BVFJJWF9ST1dfU1RBUlRfQ0hBUlBPUyAocm93KSwKKyAg ICAgICAgIE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdyksCisgICAgICAgICByb3ctPnVzZWRb VEVYVF9BUkVBXSwKKyAgICAgICAgIHJvdy0+Y29udGFpbnNfb3ZlcmxhcHBpbmdfZ2x5cGhzX3As CisgICAgICAgICByb3ctPmVuYWJsZWRfcCwKKyAgICAgICAgIHJvdy0+dHJ1bmNhdGVkX29uX2xl ZnRfcCwKKyAgICAgICAgIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3AsCisgICAgICAgICByb3ct PmNvbnRpbnVlZF9wLAorICAgICAgICAgTUFUUklYX1JPV19DT05USU5VQVRJT05fTElORV9QIChy b3cpLAorICAgICAgICAgTUFUUklYX1JPV19ESVNQTEFZU19URVhUX1AgKHJvdyksCisgICAgICAg ICByb3ctPmVuZHNfYXRfenZfcCwKKyAgICAgICAgIHJvdy0+ZmlsbF9saW5lX3AsCisgICAgICAg ICByb3ctPmVuZHNfaW5fbWlkZGxlX29mX2NoYXJfcCwKKyAgICAgICAgIHJvdy0+c3RhcnRzX2lu X21pZGRsZV9vZl9jaGFyX3AsCisgICAgICAgICByb3ctPm1vdXNlX2ZhY2VfcCwKKyAgICAgICAg IHJvdy0+eCwKKyAgICAgICAgIHJvdy0+eSwKKyAgICAgICAgIHJvdy0+cGl4ZWxfd2lkdGgsCisg ICAgICAgICByb3ctPmhlaWdodCwKKyAgICAgICAgIHJvdy0+dmlzaWJsZV9oZWlnaHQsCisgICAg ICAgICByb3ctPmFzY2VudCwKKyAgICAgICAgIHJvdy0+cGh5c19hc2NlbnQpOworICAgICAgLyog VGhlIG5leHQgMyBsaW5lcyBzaG91bGQgYWxpZ24gdG8gIlN0YXJ0IiBpbiB0aGUgaGVhZGVyLiAg Ki8KKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgICAlOSJwRCJkICU5InBEImRcdCU1ZFxuIiwg cm93LT5zdGFydC5vdmVybGF5X3N0cmluZ19pbmRleCwKKyAgICAgICAgIHJvdy0+ZW5kLm92ZXJs YXlfc3RyaW5nX2luZGV4LAorICAgICAgICAgcm93LT5jb250aW51YXRpb25fbGluZXNfd2lkdGgp OworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICAgICU5InBEImQgJTkicEQiZFxuIiwKKyAgICAg ICAgIENIQVJQT1MgKHJvdy0+c3RhcnQuc3RyaW5nX3BvcyksCisgICAgICAgICBDSEFSUE9TIChy b3ctPmVuZC5zdHJpbmdfcG9zKSk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgICAgJTlkICU5 ZFxuIiwgcm93LT5zdGFydC5kcHZlY19pbmRleCwKKyAgICAgICAgIHJvdy0+ZW5kLmRwdmVjX2lu ZGV4KTsKKyAgICB9CisgIGlmIChnbHlwaHMgPiAxKQorICAgIHsKKyAgICAgIGludCBhcmVhOwor ICAgICAgZm9yIChhcmVhID0gTEVGVF9NQVJHSU5fQVJFQTsgYXJlYSA8IExBU1RfQVJFQTsgKyth cmVhKQorICB7CisgICAgc3RydWN0IGdseXBoICpnbHlwaCA9IHJvdy0+Z2x5cGhzW2FyZWFdOwor ICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGhfZW5kID0gZ2x5cGggKyByb3ctPnVzZWRbYXJlYV07Cisg ICAgLyogR2x5cGggZm9yIGEgbGluZSBlbmQgaW4gdGV4dC4gICovCisgICAgaWYgKGFyZWEgPT0g VEVYVF9BUkVBICYmIGdseXBoID09IGdseXBoX2VuZCAmJiBnbHlwaC0+Y2hhcnBvcyA+IDApCisg ICAgICArK2dseXBoX2VuZDsKKyAgICBpZiAoZ2x5cGggPCBnbHlwaF9lbmQpCisgICAgICBmcHJp bnRmIChzdGRlcnIsICJHbHlwaCMvVG90YWwgUmVsLlggVCAgICAgICBQb3MgTyAgIFcgICAgIENv ZGUgRmFjZSBMUiAgICAgWCAgICBZIEhQT1MgVlBPUyBaViBDXG4iKTsKKyAgICBmb3IgKDsgZ2x5 cGggPCBnbHlwaF9lbmQ7ICsrZ2x5cGgpCisgICAgICB7CisgICAgICAgIG1jX2R1bXBfZ2x5cGgg KHJvdywgZ2x5cGgsIGFyZWEsIHJlbGF0aXZlX3gpOworICAgICAgICByZWxhdGl2ZV94ICs9IGds eXBoLT5waXhlbF93aWR0aDsKKyAgICAgIH0KKyAgfQorICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGhz ID09IDEpCisgICAgeworICAgICAgaW50IGFyZWE7CisgICAgICBjaGFyIHNbU0hSVF9NQVggKyA0 XTsKKyAgICAgIGZvciAoYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFyZWEgPCBMQVNUX0FSRUE7 ICsrYXJlYSkKKyAgeworICAgIGludCBpOworICAgIGZvciAoaSA9IDA7IGkgPCByb3ctPnVzZWRb YXJlYV07ICsraSkKKyAgICAgIHsKKyAgICAgICAgc3RydWN0IGdseXBoICpnbHlwaCA9IHJvdy0+ Z2x5cGhzW2FyZWFdICsgaTsKKyAgICAgICAgaWYgKGkgPT0gcm93LT51c2VkW2FyZWFdIC0gMQor ICAgICAgJiYgYXJlYSA9PSBURVhUX0FSRUEKKyAgICAgICYmIE5JTFAgKGdseXBoLT5vYmplY3Qp CisgICAgICAmJiBnbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAmJiBnbHlwaC0+dS5j aCA9PSAnICcpCisgICAgeworICAgICAgc3RyY3B5ICgmc1tpXSwgIltcXG5dIik7CisgICAgICBp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E5JTFAgKHJvdykpCisgICAgeworICAgICAgaW50 IGQxLCBkMiwgZDMsIGQ0LCBkNSwgeXBvczsKKyAgICAgIGJvb2wgdmlzaWJsZV9wID0gcG9zX3Zp c2libGVfcCAodywgUFQsICZkMSwgJmQyLCAmZDMsICZkNCwgJmQ1LCAmeXBvcyk7CisgICAgICBp bnQgaGVhZGVyX2xpbmVfaGVpZ2h0ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7Cisg ICAgICBpbnQgdm9mZnNldCA9IChoZWFkZXJfbGluZV9oZWlnaHQgPiAwCisgICAgICAgICAgICAg ICAgICAgICAmJiB5cG9zID4gMCkKKyAgICAgICAgICAgICAgICAgICAgICA/IHlwb3MgKyAxCisg ICAgICAgICAgICAgICAgICAgICAgOiB5cG9zOworICAgICAgaWYgKHZpc2libGVfcCkKKyAgICAg ICAgdnBvcyA9IHZvZmZzZXQ7CisgICAgICAgIGVsc2UKKyAgICAgICAgICB2cG9zID0gMDsKKyAg ICB9CisgICAgZWxzZQorICAgICAgeworICAgICAgICBDSEVDS19OVU1CRVIgKHJvdyk7CisgICAg ICAgIHZwb3MgPSBYRklYTlVNIChyb3cpOworICAgICAgfQorICBtYXRyaXggPSB3LT5jdXJyZW50 X21hdHJpeDsKKyAgaWYgKHZwb3MgPj0gMCAmJiB2cG9zIDwgbWF0cml4LT5ucm93cykKKyAgICBt Y19kdW1wX2dseXBoX3JvdyAoTUFUUklYX1JPVyAobWF0cml4LCB2cG9zKSwKKyAgICAgICAgdnBv cywKKyAgICAgICAgVFlQRV9SQU5HRURfRklYTlVNUCAoaW50LCBnbHlwaHMpID8gWEZJWE5VTSAo Z2x5cGhzKSA6IDIpOworICByZXR1cm4gUW5pbDsKK30KKwordm9pZAorbWNfZHVtcF9nbHlwaF9t YXRyaXggKHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgaW50IGdseXBocykKK3sKKyAgaW50 IGk7CisgIGZvciAoaSA9IDA7IGkgPCBtY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AgZnByaW50ZiAoc3RkZXJy LCAiQ3Vyc29yIHggPSAlZCwgeSA9ICVkLCBocG9zID0gJWQsIHZwb3MgPSAlZFxuIiwKKyAgICAg dy0+Y3Vyc29yLngsIHctPmN1cnNvci55LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3Mp OworICBmcHJpbnRmIChzdGRlcnIsICI9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT1cbiIpOworICBtY19kdW1wX2dseXBoX21hdHJpeCAody0+Y3VycmVudF9tYXRy aXgsCisgICAgICAgICBUWVBFX1JBTkdFRF9GSVhOVU1QIChpbnQsIGdseXBocykgPyBYRklYTlVN IChnbHlwaHMpIDogMCk7CisgIHJldHVybiBRbmlsOworfQorCitzdGF0aWMgdm9pZAorbWNfaGVs cGVyIChzdHJ1Y3Qgd2luZG93ICp3LCBpbnQgeCwgaW50IGZ4LCBpbnQgeSwgaW50IGZ5LCBpbnQg aHBvcywKKyAgICAgICAgICAgaW50IHZwb3MsIGludCBoLCBlbnVtIHRleHRfY3Vyc29yX2tpbmRz IGN1cnNvcl90eXBlLCBpbnQgY3Vyc29yX3dpZHRoLAorICAgICAgICAgICBMaXNwX09iamVjdCBm b3JlZ3JvdW5kLCBMaXNwX09iamVjdCBiYWNrZ3JvdW5kLCBib29sIGFjdGl2ZV9wLAorICAgICAg ICAgICBib29sIG1pbmltYWxfcCwgaW50IGZsYXZvciwgaW50IHBvc2ludCwgTGlzcF9PYmplY3Qg KnJlc3VsdCkKK3sKKyAgYm9vbCBtY19zdGRlcnJfcCA9ICFOSUxQIChCVkFSIChjdXJyZW50X2J1 ZmZlciwgbWNfc3RkZXJyKSk7CisgIExpc3BfT2JqZWN0IHdpbmRvdzsKKyAgWFNFVFdJTkRPVyAo d2luZG93LCB3KTsKKyAgTGlzcF9PYmplY3Qgd2luZG93X3N0cmluZyA9IEZwcmluMV90b19zdHJp bmcgKHdpbmRvdywgUW5pbCk7CisgIGNoY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JJR0hUX0FSUk9XIgorICAgIDogZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAg PyAiTUNfVkVSVElDQUxfQkFSIgorICAgIDogZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNL U0xBU0gKKyAgICAgID8gIk1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0giCisgICAgOiAiT09QUyIp LAorICBwb3NpbnQsCisgIHJlZF9mZywgZ3JlZW5fZmcsIGJsdWVfZmcsIHJlZF9iZywgZ3JlZW5f YmcsIGJsdWVfYmcpOworICBib29sIHJlbW92ZV9wID0gZmFsc2U7CisgIG1jX2RyYXdfZXJhc2Vf aHlicmlkICh3LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIGgsIGN1cnNvcl90eXBlLAorICAg ICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBhY3RpdmVfcCwg bWluaW1hbF9wLAorICAgICAgICAgICAgICAgICAgICAgICAgZmxhdm9yLCBwb3NpbnQsIHJlbW92 ZV9wKTsKKyAgTGlzcF9PYmplY3QgZmlmdGVlbl9lbGVtZW50cyA9IGxpc3RuIChDT05TVFlQRV9I RUFQLCAxNSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFrZV9m aXhudW0gKHgpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYWtl X2ZpeG51bSAoZngpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBt YWtlX2ZpeG51bSAoeSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IG1ha2VfZml4bnVtIChmeSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIG1ha2VfZml4bnVtIChocG9zKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgbWFrZV9maXhudW0gKHZwb3MpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBtYWtlX2ZpeG51bSAoaCksCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIG1jX2N1cnNvcl90eXBlX3RvX2xpc3AgKGN1cnNvcl90eXBlKSwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFrZV9maXhudW0gKGN1cnNv cl93aWR0aCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVn cm91bmQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91 bmQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ha2VfZml4bnVt IChhY3RpdmVfcCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1h a2VfZml4bnVtIChtaW5pbWFsX3ApLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBtYWtlX2ZpeG51bSAoZmxhdm9yKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgbWFrZV9maXhudW0gKHBvc2ludCkpOworICAqcmVzdWx0ID0gRmNvbnMg KGZpZnRlZW5fZWxlbWVudHMsICpyZXN1bHQpOworfQorCisvKiBSZXR1cm4gYSBwb2ludGVyIHRv IHRoZSBnbHlwaCBXJ3MgcGh5c2ljYWwgY3Vyc29yIGlzIG9uLiAgVmFsdWUgaXMKKyAgIG51bGwg aWYgVydzIGN1cnJlbnQgbWF0cml4IGlzIGludmFsaWQsIHNvIHRoYXQgbm8gbWVhbmluZ2Z1bCBn bHlwaAorICAgY2FuIGJlIHJldHVybmVkLiAgKi8KKworc3RydWN0IGdseXBoICoKK21jX2dldF9w aHlzX2N1cnNvcl9nbHlwaCAoc3RydWN0IHdpbmRvdyAqdywgaW50IGhwb3MsIGludCB2cG9zKQor eworICBzd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faW5fcmVjdF9wIChzdHJ1Y3Qgd2luZG93 ICp3LCBYUmVjdGFuZ2xlICpyLCBpbnQgeCwgaW50IHksIGludCBocG9zLCBpbnQgdnBvcykKK3sK KyAgWFJlY3RhbmdsZSBjciwgcmVzdWx0OworICBzdHJ1Y3QgZ2x5cGggKmN1cnNvcl9nbHlwaDsK KyAgc3RydWN0IGdseXBoX3JvdyAqcm93OworICBpZiAody0+cGh5c19jdXJzb3IudnBvcyA+PSAw CisgICAgICAmJiB3LT5waHlzX2N1cnNvci52cG9zIDwgdy0+Y3VycmVudF9tYXRyaXgtPm5yb3dz CisgICAgICAmJiAocm93ID0gTUFUUklYX1JPVyAody0+Y3VycmVudF9tYXRyaXgsIHctPnBoeXNf Y3Vyc29yLnZwb3MpLCByb3ctPmVuYWJsZWRfcCkKKyAgICAgICYmIHJvdy0+Y3Vyc29yX2luX2Zy aW5nZV9wKQorICAgIHsKKyAgICAgIC8qIEN1cnNvciBpcyBpbiB0aGUgZnJpbmdlLiAgKi8KKyAg ICAgIGNyLnggPSB3aW5kb3dfYm94X3JpZ2h0X29mZnNldCAodywKKyAgICAgICAgICAgICAgKFdJ TkRPV19IQVNfRlJJTkdFU19PVVRTSURFX01BUkdJTlMgKHcpCisgICAgICAgICAgICAgICA/IFJJ R0hUX01BUkdJTl9BUkVBCisgICAgICAgICAgICAgICA6IFRFWFRfQVJFQSkpOworICAgICAgY3Iu eSA9IHJvdy0+eTsKKyAgICAgIGNyLndpZHRoID0gV0lORE9XX1JJR0hUX0ZSSU5HRV9XSURUSCAo dyk7CisgICAgICBjci5oZWlnaHQgPSByb3ctPmhlaWdodDsKKyAgICAgIHJldHVybiB4X2ludGVy c2VjdF9yZWN0YW5nbGVzICgmY3IsIHIsICZyZXN1bHQpOworICAgIH0KKyAgY3Vyc29yX2dseXBo ID0gbWNfZ2V0X3BoeXNfY3Vyc29yX2dseXBoICh3LCBocG9zLCB2cG9zKTsKKyAgaWYgKGN1cnNv cl9nbHlwaCkKKyA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dXJzb3JfZ2VvbWV0 cnkgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgaW50IHgsIGludCAqZngsIGludCB5LCBpbnQgKmZ5LCBpbnQgaHBv cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHZwb3MsIGludCAqaCwgZW51bSB0 ZXh0X2N1cnNvcl9raW5kcyBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgaW50IGN1cnNvcl93aWR0aCwgaW50ICp3ZCkKK3sKKyAgc3RydWN0IGdseXBoICpmYWtlX3Bo eXNfY3Vyc29yX2dseXBoID0gbWNfZ2V0X3BoeXNfY3Vyc29yX2dseXBoICh3LCBocG9zLCB2cG9z KTsKKyAgaWYgKGZha2VfcGh5c19jdXJzb3JfZ2x5cGggIT0gTlVMTCkKKyAgICB7CisgICAgICBz dHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworICAgICAgaW50IGgw ID0gcm93LT52aXNpYmxlX2hlaWdodDsKKyAgICAgIGludCB5MCA9IFdJTkRPV19IRUFERVJfTElO RV9IRUlHSFQgKHcpOworICAgICAgaW50IGFzY2VudCA9IHJvdy0+YXNjZW50OworICAgICAgLyog Q29tcHV0ZSB0aGUgd2lkdGggb2YgdGhlIHJlY3RhbmdsZSB0byBkcmF3LiAgSWYgb24gYSBzdHJl dGNoCisgICAgICAgICBnbHlwaCwgYW5kIGB4LXN0cmV0Y2gtYmxvY2stY3Vyc29yJyBpcyBuaWws IGRvbid0IGRyYXcgYQorICAgICAgICAgcmVjdGFuZ2xlIGFzIHdpZGUgYXMgdGhlIGdseXBoLCBi dXQgdXNlIGEgY2Fub25pY2FsIGNoYXJhY3RlcgorICAgICAgICAgd2lkdGggaW5zdGVhZC4gICov CisgICAgICAqd2QgPSBzY3JhdGNoX2dseXBocy0+cGl4ZWxfd2lkdGg7CisgICAgICBpZiAoeCA8 IDApCisgICAgICAgIHsKKyAgICAgICAgICAqd2QgKz0geDsKKyAgICAgICAgICB4ID0gMDsKKyAg ICAgICAgfQorICAgICAgaWYgKHNjcmF0Y2hfZ2x5cGhzLT50eXBlID09IFNUUkVUQ0hfR0xZUEgK KyAgICAgICAgICAmJiAheF9zdHJldGNoX2N1cnNvcl9wKQorICAgICAgICAqd2QgPSBtaW4gKEZS QU1FX0NPTFVNTl9XSURUSCAoZiksICp3ZCk7CisgICAgICAvKiBEb24ndCBsZXQgdGhlIGhvbGxv dyBjdXJzb3IgZ2x5cGggZGVzY2VuZCBiZWxvdyB0aGUgZ2x5cGggcm93J3MKKyAgICAgICAgIGFz Y2VudCB2YWx1ZSwgbGVzdCB0aGUgaG9sbG93IGN1cnNvciBsb29rcyBmdW5ueS4gICovCisgICAg ICBpZiAocm93LT5hc2NlbnQgPCBzY3JhdGNoX2dseXBocy0+YXNjZW50KQorICAgICAgICB7Cisg ICAgICAgICAgeSAtPSBzY3JhdGNoX2dseXBocy0+YXNjZW50IC0gcm93LT5hc2NlbnQ7CisgICAg ICAgICAgYXNjZW50ID0gc2NyYXRjaF9nbHlwaHMtPmFzY2VudDsKKyAgICAgICAgfQorICAgICAg LyogSWYgeSBpcyBiZWxvdyB3aW5kb3cgYm90dG9tLCBlbnN1cmUgdGhhdCB3ZSBzdGlsbCBzZWUg YSBjdXJzb3IuICovCisgICAgICBpbnQgaF90ZW1wID0gbWF4IChoMCwgYXNjZW50ICsgc2NyYXRj aF9nbHlwaHMtPmRlc2NlbnQpOworICAgICAgaDAgPSBtaW4gKGgwLCBhc2NlbnQgKyBzY3JhdGNo X2dseXBocy0+ZGVzY2VudCk7CisgICAgICBpZiAoeSA8IHkwKQorICAgICAgICB7CisgICAgICAg ICAgaF90ZW1wID0gbWF4IChoX3RlbXAgLSAoeTAgLSB5KSArIDEsIGgwKTsKKyAgICAgICAgICB5 ID0geTAgLSAxOworICAgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICB5 MCA9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KSAtIGgwOworICAgICAgICAgIGlmICh5ID4geTAp CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGhfdGVtcCArPSB5IC0geTA7CisgICAgICAg ICAgICAgIHkgPSB5MDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgKmZ4ID0gV0lO RE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgeCk7CisgICAgICAqZnkgPSBXSU5ET1dfVE9f RlJBTUVfUElYRUxfWSAodywgeSk7CisgICAgICAqaCA9IGhfdGVtcDsKKyAgICAgIGlmIChjdXJz b3JfdHlwZSA9PSBIQkFSX0NVUlNPUikKKyAgICAgICAgeworICAgICAgICAgIGludCBjdXJzb3Jf aGVpZ2h0ID0gKGN1cnNvcl93aWR0aCA8IDEpID8gbHJpbnQgKDAuMjUgKiAqaCkgOiBjdXJzb3Jf d2lkdGg7CisgICAgICAgICAgaWYgKGN1cnNvcl9oZWlnaHQgPiByb3ctPmhlaWdodCkKKyAgICAg ICAgICAgIGN1cnNvcl9oZWlnaHQgPSByb3ctPmhlaWdodDsKKyAgICAgICAgICBpZiAoKmggPiBj dXJzb3JfaGVpZ2h0KQorICAgICAgICAgICAgKmZ5ICs9ICpoIC0gY3Vyc29yX2hlaWdodDsKKyAg ICAgICAgICAqaCA9IGN1cnNvcl9oZWlnaHQ7CisgICAgICAgIH0KKyAgICB9Cit9CisKKy8qIFJl dHVybiB0aGUgc3RhcnQgb3IgZW5kIHBvc2l0aW9uIG9mIHRoZSByZWdpb24uCisgICBCRUdJTk5J TkdQIG1lYW5zIHJldHVybiB0aGUgc3RhcnQuCisgICBJZiB0aGVyZSBpcyBubyByZWdpb24gYWN0 aXZlLCBzaWduYWwgYW4gZXJyb3IuCisgICBFWEFNUExFIChyZWdpb24tYmVnaW5uaW5nKTogIHJl Z2lvbl9saW1pdCAoMSkKKyAgIEVYQU1QTEUgKHJlZ2lvbi1lbmQpOiAgcmVnaW9uX2xpbWl0ICgw KSAqLworCitzdGF0aWMgTGlzcF9PYmplY3QKK21jX3JlZ2lvbl9saW1pdCAoYm9vbCBiZWdpbm5p bmdwKQoreworICBMaXNwX09iamVjdCBtOworICBpZiAoIU5JTFAgKFZ0cmFuc2llbnRfbWFya19t b2RlKQorICAgICAgJiYgTklMUCAoVm1hcmtfZXZlbl9pZl9pbmFjdGl2ZSkKKyAgICAgICYmIE5J TFAgKEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBtYXJrX2FjdGl2ZSkpKQorICAgIHJldHVybiBRbmls OworICBtID0gRm1hcmtlcl9wb3NpdGlvbiAoQlZBUiAoY3VycmVudF9idWZmZXIsIG1hcmspKTsK KyAgaWYgKE5JTFAgKG0pKQorICAgIHJldHVybiBRbmlsOworICAvKiBTZWUgYHJlZ2lvbi1hY3Rp dmUtcCcgYW5kIGByZWRpc3BsYXktLXVwZGF0ZS1yZWdpb24taGlnaGxpZ2h0Jy4gKi8KKyAgaWYg KCFOSUxQIChWdHJhbnNpZW50X21hcmtfbW9kZSkKKyAgICAgICYmICFOSUxQIChCVkFSIChjdXJy ZW50X2J1ZmZlciwgbWFya19hY3RpdmUpKQorICAgICAgJiYgIU5JTFAgKG0pKQorICAgIHJldHVy biBtYWtlX2ZpeG51bSAoKFBUIDwgWEZJWE5BVCAobSkpID09IGJlZ2lubmluZ3AKKyAgICAgICAg ICAgICAgICAgICAgICAgID8gUFQKKyAgICAgICAgICAgICAgICAgICAgICAgIDogY2xpcF90b19i b3VuZHMgKEJFR1YsIFhGSVhOQVQgKG0pLCBaVikpOworICAgICAgZWxzZQorICAgICAgICByZXR1 cm4gUW5pbDsKK30KKwordm9pZAorbWNfZW5naW5lIChzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIHN0 cnVjdCBnbHlwaCAqZ2x5cGgsIGludCBhcmVhLCBpbnQgcmVsYXRpdmVfeCwKKyAgICA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TsKKyAgaW50IGZyYW1lX2NoYXJfd2lkdGggPSBGUkFN RV9DT0xVTU5fV0lEVEggKGYpOworICBib29sIGZpbGxfY29sdW1uX3AgPSAhTklMUCAoQlZBUiAo YiwgZmlsbF9jb2x1bW4pKTsKKyAgaW50IGZpbGxfY29sID0gWEZJWE5VTSAoQlZBUiAoYiwgZmls bF9jb2x1bW4pKTsKKyAgaW50IGhzY2xfeCA9IHctPmhzY3JvbGwgKiBmcmFtZV9jaGFyX3dpZHRo OworICBpbnQgZmlsbF9jb2x1bW5feCA9IChmaWxsX2NvbHVtbl9wCisgICAgICAgICAgICAgICAg ICAgICAgICYmICFOSUxQIChWZGlzcGxheV9saW5lX251bWJlcnMpKQorICAgICAgICAgICAgICAg ICAgICAgICAgPyAoZmlsbF9jb2wgKiBmcmFtZV9jaGFyX3dpZHRoKSArIHctPm1jLmxudW1fcGl4 ZWxfd2lkdGggLSBoc2NsX3gKKyAgICAgICAgICAgICAgICAgICAgICA6IChmaWxsX2NvbHVtbl9w CisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgTklMUCAoVmRpc3BsYXlfbGluZV9udW1iZXJz KSkKKyAgICAgICAgICAgICAgICAgICAgICAgID8gKGZpbGxfY29sICogZnJhbWVfY2hhcl93aWR0 aCkgLSBoc2NsX3gKKyAgICAgICAgICAgICAgICAgICAgICA6IDA7CisgIGludCB0ZW1wX3ggPSBy ZWxhdGl2ZV94OworICBpbnQgdGVtcF95ID0gcm93LT55OworICBpbnQgdGVtcF9ocG9zID0gZ2x5 cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdOworICBpbnQgdGVtcF92cG9zID0gTUFUUklYX1JP V19WUE9TIChyb3csIHctPmN1cnJlbnRfbWF0cml4KTsKKyAgaW50IHRlbXBfZmFjZV9pZCA9IGds eXBoLT5mYWNlX2lkOworICBpbnQgdGVtcF9jaGFycG9zID0gZ2x5cGgtPmNoYXJwb3M7CisKKy8q IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgIEJFR0lOOiAg Q0hBUl9HTFlQSCB8IEdMWVBITEVTU19HTFlQSCAgICAgICAgICAgICAgICAgICovCisvKiAtLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0gKi8KKyAgaWYgKGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAg IHx8IGdseXBoLT50eXBlID09IEdMWVBITEVTU19HTFlQSCkKKyAgeworICAgIGlmIChtY19zdGRl cnJfcCkKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIlxuICU1InBEImQvJS01ZCAl NWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUzZCAg JTNkICVzICVzXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisg ICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEp LAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQ SAorICAgICAgICAgPyAnQycKKyAgICAgICAgIDogJ0cnKSwKKyAgICAgICAgZ2x5cGgtPmNoYXJw b3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAg ICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAg ICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgID8gJzAnCisg ICAgICAgICAgICAgICA6ICctJykpKSwKKyAgICAgICAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRo LAorICAgICAgICBnbHlwaC0+dS5jaCwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAg IGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9w LAorICAgICAgICBnbHlwaC0+eCwgZ2x5cGgtPnksIGdseXBoLT5ocG9zLCBnbHlwaC0+dnBvcywg Z2x5cGgtPnp2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgKCghTklMUCAoY2hhcmFjdGVyKQor ICAgICAgICAgJiYgZ2x5cGgtPnUuY2ggPT0gOSkKKyAgICAgICAgICAgPyAiXFx0IgorICAgICAg ICAgOiAoIU5JTFAgKGNoYXJhY3RlcikKKyAgICAgICAgICAgICYmIGdseXBoLT51LmNoID09IDEw KQorICAgICAgICAgICA/ICJcXG4iCisgICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQorICAg ICAgICAgICAgJiYgZ2x5cGgtPnUuY2ggPT0gMzIpCisgICAgICAgICAgID8gIlxccyIKKyAgICAg ICAgIDogKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAmJiBnbHlwaC0+dS5jaCAhPSA5 CisgICAgICAgICAgICAmJiBnbHlwaC0+dS5jaCAhPSAxMAorICAgICAgICAgICAgJiYgZ2x5cGgt PnUuY2ggIT0gMzIpCisgICAgICAgICAgID8gU1NEQVRBIChjaGFyYWN0ZXIpCisgICAgICAgICA6 ICJcXD8iKSk7CisgIHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLSAqLworLyogICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTOiAgQ0hBUl9HTFlQSCB8 IEdMWVBITE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gICAgICAgICAgICAgICAgICAg ICAmJiBvcG9pbnRfeSA9PSBnbHlwaC0+eQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgb3BvaW50X3Zwb3MgPT0gdGVtcF92cG9zKTsKKyAgICAgIGludCBfZngsIGZ5LCBfaCwg X3dkOworICAgICAgbWNfZ2V0X3BoeXNfY3Vyc29yX2dlb21ldHJ5ICh3LCByb3csIHRlbXBfeCwg Jl9meCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcF95LCAmZnksIHRl bXBfaHBvcywgdGVtcF92cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm X2gsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsICZfd2QpOworICAgICAgaWYgKHRlbXBfeCA8 PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAg ICAgICBtY19oZWxwZXIgKHcsIHRlbXBfeCwgLTEsIHRlbXBfeSwgZnksIHRlbXBfaHBvcywgdGVt cF92cG9zLAorICAgICAgICAgICAgICAgICAgIC0xLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRo LCBmb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAodywgdGVtcF9mYWNl X2lkKSwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgbWluaW1hbF9wLCBNQ19HTFlQSCwg dGVtcF9jaGFycG9zLCByZXN1bHQpOworICAgICAgLyogSXQgaXMgcG9zc2libGUgdG8gdXNlIE1D X0dMWVBIIGFuZCBhZGp1c3QgdGhlIGZ4IGNvb3JkaW5hdGU7IGhvd2V2ZXIsCisgICAgICB0aGUg bWlkZGxlLWRvdCAvIHNwYWNlIGdseXBoIG9uIGEgd29yZC13cmFwcGVkIGxpbmUgd2lsbCBiZSBv dmVyd3JpdHRlbgorICAgICAgbnVtZXJvdXMgdGltZXMgYW5kIGlzIHVuc2lnaHRseS4gKi8KKyAg ICAgIGlmIChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFd IC0gMSkKKyAgICAgICAgeworICAgICAgICAgIGludCBfZngsIGZ5LCBfaCwgX3dkOworICAgICAg ICAgIG1jX2dldF9waHlzX2N1cnNvcl9nZW9tZXRyeSAodywgcm93LCB0ZW1wX3gsICZfZngsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wX3ksICZmeSwgdGVtcF9o cG9zLCB0ZW1wX3Zwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm X2gsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsICZfd2QpOworICAgICAgICAgIHRlbXBfeCAr PSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgd2hpbGUgKHRlbXBfeCA8PSB0ZXh0X2Fy ZWFfd2lkdGgpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIG1jX2hlbHBlciAodywgdGVt cF94LCAtMSwgdGVtcF95LCBmeSwgdGVtcF9ocG9zLCB0ZW1wX3Zwb3MsCisgICAgICAgICAgICAg ICAgICAgICAgICAgLTEsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsCisg ICAgICAgICAgICAgICAgICAgICAgICAgbWNfYmdfbHNsICh3LCB0ZW1wX2ZhY2VfaWQpLCBhY3Rp dmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBtaW5pbWFsX3AsIE1DX0dMWVBITEVTUywg dGVtcF9jaGFycG9zLCByZXN1bHQpOworICAgICAgICAgICAgICAvKiBgdy0+cGh5c19jdXJzb3Jf d2lkdGhgIGlzIGRldGVybWluZWQgYnkgYGdseXBoLT5waXhlbF93aWR0aGAsCisgICAgICAgICAg ICAgIGFuZCB0aGUgc3BhY2UgYXBwZW5kZWQgd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CQVJfQkFDS1NMQVNICisgICAgICAgICAgICAgICAgICAgOiAoY3Vy c29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVk X29uX3JpZ2h0X3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcCkK KyAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAg ICAgOiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAt IDEKKyAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeCA+IHJlbGF0aXZlX3gpCisgICAg ICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgIDogKHp2 X3ApCisgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAg ICAgIDogTUNfR0xZUEg7CisgICAgICBpbnQgdGVtcF94ID0gKGdseXBoIC0gcm93LT5nbHlwaHNb VEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICYm IG9wb2ludF94ID4gcmVsYXRpdmVfeCkKKyAgICAgICAgICAgICAgICAgICAgPyBvcG9pbnRfeAor ICAgICAgICAgICAgICAgICAgICA6IHJlbGF0aXZlX3g7CisgICAgICBpZiAoZmxhdm9yID09IE1D X1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGZsYXZvciA9PSBNQ19WRVJU SUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgfHwgZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JB UikKKyAgICAgICAgY3Vyc29yX3R5cGUgPSBSSUdIVF9GUklOR0VfQklUTUFQOworICAgICAgaW50 IF9meCwgX2Z5LCBoLCBfd2Q7CisgICAgICBtY19nZXRfcGh5c19jdXJzb3JfZ2VvbWV0cnkgKHcs IHJvdywgdGVtcF94LCAmX2Z4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0 ZW1wX3ksICZfZnksIHRlbXBfaHBvcywgdGVtcF92cG9zLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgJl93ZCk7CisgICAg ICBpbnQgZnggPSBXSU5ET1dfVEVYVF9UT19GUkFNRV9QSVhFTF9YICh3LCBvcG9pbnRfeCk7Cisg ICAgICBtY19oZWxwZXIgKHcsIHRlbXBfeCwgZngsIHRlbXBfeSwgLTEsIHRlbXBfaHBvcywgdGVt cF92cG9zLAorICAgICAgICAgICAgICAgICBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBm b3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICBtY19iZ19sc2wgKHcsIHRlbXBfZmFjZV9pZCks IGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICBtaW5pbWFsX3AsIGZsYXZvciwgdGVtcF9jaGFy cG9zLCByZXN1bHQpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t ICovCisvKiAgICAgICAgICAgICAgIEZJTExfQ09MVU1OOiAgQ0hBUl9HTFlQSCB8IEdMWVBITEVT U19HTFlQSCAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAg IGNhc2UgRklMTF9DT0xVTU46CisgICAgeworICAgICAgLyogYGdseXBoLT5jaGFycG9zYCBpcyB1 bnJlbGlhYmxlIHdoZW4gdGVzdGluZyBmb3IgWlYgLS0gd2l0aG91dCBsaW5lCisgICAgICBudW1i ZXJzLCB0aGUgdmFsdWUgaXMgLTE7IHdpdGggbGluZSBudW1iZXJzLCB0aGUgdmFsdWUgaXMgX3Nv bWV0aW1lc18gWlYuCisgICAgICBgZ2x5cGgtPnp2X3BgIGlzIHJlbGlhYmxlLCBidXQgcmVsaWVz IHVwb24gYSBmZXcgY29yZSBtb2RpZmljYXRpb24uCisgICAgICBgenZfcGAgZW5jb21wYXNzZXMg YSBjb3VwbGUgb2Ygc2l0dWF0aW9uczogIGEgbGluZSBlbmRpbmcgaW4gWlYsIGJ1dAorICAgICAg IGNvbnRhaW5pbmcgb25lIG9yIG1vcmUgY2hhcmFjdGVycyBiZWZvcmUgWlY7IGFuZCwgYSBsaW5l IGJleW9uZCBaViB0aGF0CisgICAgICAgbWF5IGNvbnNpc3Qgb2Ygc3BhY2VzIGVxdWFsIHRvIGBp dC0+bG51bV9waXhlbF93aWR0aGAgLyBmcmFtZV9jaGFyX3dpZHRoLAorICAgICAgIG9yIGp1c3Qg b25lIHNwYWNlIGlmIHRoZXJlIGFyZSBubyBsaW5lIG51bWJlcnMuICovCisgICAgICBib29sIHp2 X3AgPSAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAt IDEKKyAgICAgICAgICAgICAgICAgICAmJiBNQVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpID09 IFpWKTsKKyAgICAgIGludCBmbGF2b3IgPSAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFd ID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgJiYgZmlsbF9jb2x1 bW5feCA+IHJlbGF0aXZlX3gpCisgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUwor ICAgICAgICAgICAgICAgICAgIDogKHp2X3ApCisgICAgICAgICAgICAgICAgICAgICA/IE1DX0dM WVBITEVTUworICAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJz KSkKKyAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBjcm9zc2hhaXJzX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAg ICAmJiBvcG9pbnRfeSA9PSB0ZW1wX3kKKyAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRf dnBvcyA9PSB0ZW1wX3Zwb3MpCisgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUwor ICAgICAgICAgICAgICAgICAgIDogTUNfR0xZUEg7CisgICAgICBpbnQgdGVtcF94ID0gKGdseXBo IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAg ICAgICAgICAgICAgICYmIGZpbGxfY29sdW1uX3ggPiByZWxhdGl2ZV94KQorICAgICAgICAgICAg ICAgICAgICA/IGZpbGxfY29sdW1uX3gKKyAgICAgICAgICAgICAgICAgICAgOiByZWxhdGl2ZV94 OworICAgICAgaW50IF9meCwgX2Z5LCBoLCBfd2Q7CisgICAgICBtY19nZXRfcGh5c19jdXJzb3Jf Z2VvbWV0cnkgKHcsIHJvdywgdGVtcF94LCAmX2Z4LAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICB0ZW1wX3ksICZfZnksIHRlbXBfaHBvcywgdGVtcF92cG9zLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwg Jl93ZCk7CisgICAgICBpbnQgZnggPSBXSU5ET1dfVEVYVF9UT19GUkFNRV9QSVhFTF9YICh3LCBm aWxsX2NvbHVtbl94KTsKKyAgICAgIG1jX2hlbHBlciAodywgdGVtcF94LCBmeCwgdGVtcF95LCAt MSwgdGVtcF9ocG9zLC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CAgICAgICAgICAgICAgICAgICAgICovCisvKiAt LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIE1VTFRJUExFX0NVUlNPUlM6CisgICAgewor ICAgICAgbWNfaGVscGVyICh3LCB0ZW1wX3gsIC0xLCB0ZW1wX3ksIC0xLCB0ZW1wX2hwb3MsIHRl bXBfdnBvcywKKyAgICAgICAgICAgICAgICAgLTEsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgs IGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAodywgdGVtcF9mYWNlX2lk KSwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgIG1pbmltYWxfcCwgTUNfR0xZUEgsIHRlbXBf Y2hhcnBvcywgcmVzdWx0KTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICBIT1JJWk9OVEFMX1JVTEVSOiAgU1RS RVRDSF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0g Ki8KKyAgICBjYXNlIEhPUklaT05UQUxfUlVMRVI6CisgICAgeworICAgICAgYm9vbCByZWFsX2Zh a2VfY3Vyc29yX3AgPSAob3BvaW50X3ggPT0gcmVsYXRpdmVfeAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgb3BvaW50X2hwb3MgPT0gdGVtcF9ocG9zCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeSA9PSBnbHlwaC0+eQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3Zwb3MgPT0gdGVtcF92cG9zKTsKKyAgICAg IGludCBfZngsIGZ5LCBfaCwgX3dkOworICAgICAgbWNfZ2V0X3BoeXNfY3Vyc29yX2dlb21ldHJ5 ICh3LCByb3csIHRlbXBfeCwgJl9meCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgdGVtcF95LCAmZnksIHRlbXBfaHBvcywgdGVtcF92cG9zLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmX2gsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsICZfd2QpOwor ICAgICAgaWYgKHRlbXBfeCA8PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAmJiAhcmVhbF9m YWtlX2N1cnNvcl9wKQorICAgICAgICB3aGlsZSAodGVtcF94IDwgcmVsYXRpdmVfeCArIGdseXBo LT5waXhlbF93aWR0aCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBtY19oZWxwZXIgKHcsIHRl bXBfeCwgLTEsIHRlbXBfeSwgZnksIHRlbXBfaHBvcywgdGVtcF92cG9zLAorICAgICAgICAgICAg ICAgICAgICAgICAtMSwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwKKyAg ICAgICAgICAgICAgICAgICAgICAgbWNfYmdfbHNsICh3LCB0ZW1wX2ZhY2VfaWQpLCBhY3RpdmVf cCwKKyAgICAgICAgICAgICAgICAgICAgICAgbWluaW1hbF9wLCBNQ19HTFlQSExFU1MsIHRlbXBf Y2hhcnBvcywgcmVzdWx0KTsKKyAgICAgICAgICAgIHRlbXBfeCArPSBmcmFtZV9jaGFyX3dpZHRo OworICAgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAodGVtcF94ICsgZ2x5cGgtPnBpeGVsX3dp ZHRoIDwgdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICYmIHJlYWxfZmFrZV9jdXJz b3JfcAorICAgICAgICAgICAgICAgICAmJiBnbHlwaC0+cGl4ZWxfd2lkdGggPiBmcmFtZV9jaGFy X3dpZHRoKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIHRlbXBfeCArPSBmcmFtZV9jaGFyX3dp ZHRoOworICAgICAgICAgICAgd2hpbGUgKHRlbXBfeCA8IHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4 ZWxfd2lkdGgpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBtY19oZWxwZXIgKHcs IHRlbXBfeCwgLTEsIHRlbXBfeSwgZnksIHRlbXBfaHBvcywgdGVtcF92cG9zLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgLTEsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91 bmQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBtY19iZ19sc2wgKHcsIHRlbXBfZmFjZV9p ZCksIGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgbWluaW1hbF9wLCBNQ19H TFlQSExFU1MsIHRlbXBfY2hhcnBvcywgcmVzdWx0KTsKKyAgICAgICAgICAgICAgICB0ZW1wX3gg Kz0gZnJhbWVfY2hhcl93aWR0aDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAg IC8qIEl0IGlzIHBvc3NpYmxlIHRvIHVzZSBNQ19HTFlQSCBhbmQgYWRqdXN0IHRoZSBmeCBjb29y ZGluYXRlOyBob3dldmVyLAorICAgICAgdGhlIG1pZGRsZS1kb3QgLyBzcGFjZSBnbHlwaCBvbiBh IHdvcmQtd3JhcHBlZCBsaW5lIHdpbGwgYmUgb3ZlcndyaXR0ZW4KKyAgICAgIG51bWVyb3VzIHRp bWVzIGFuZCBpcyB1bnNpZ2h0bHkuICovCisgICAgICBpZiAoZ2x5cGggLSByb3ctPmdseXBoc1tU RVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEpCisgICAgICAgIHsKKyAgICAgICAgICBp bnQgX2Z4LCBmeSwgX2gsIF93ZDsKKyAgICAgICAgICBtY19nZXRfcGh5c19jdXJzb3JfZ2VvbWV0 cnkgKHcsIHJvdywgdGVtcF94LCAmX2Z4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgdGVtcF95LCAmZnksIHRlbXBfaHBvcywgdGVtcF92cG9zLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJl9oLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRo LCAmX3dkKTsKKyAgICAgICAgICB0ZW1wX2ZhY2VfaWQgPSAocm93LT5maWxsX2xpbmVfcCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICA/IGdseXBoLT5mYWNlX2lkCisgICAgICAgICAgICAgICAg ICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgd2hpbGUgKHRlbXBfeCA8PSB0 ZXh0X2FyZWFfd2lkdGgpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIG1jX2hlbHBlciAo dywgdGVtcF94LCAtMSwgdGVtcF95LCBmeSwgdGVtcF9ocG9zLCB0ZW1wX3Zwb3MsCisgICAgICAg ICAgICAgICAgICAgICAgICAgLTEsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91 bmQsCisgICAgICAgICAgICAgICAgICAgICAgICAgbWNfYmdfbHNsICh3LCB0ZW1wX2ZhY2VfaWQp LCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBtaW5pbWFsX3AsIE1DX0dMWVBI TEVTUywgdGVtcF9jaGFycG9zLCByZXN1bHQpOworICAgICAgICAgICAgICB0ZW1wX3ggKz0gZnJh bWVfY2hhcl93aWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgYn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ZV9wCisgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1 bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JB Ul9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9pbl9mcmluZ2VfcAor ICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAg ICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICAgICAgICAgICA6 IChjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVu Y2F0ZWRfb25fcmlnaHRfcAorICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPmNvbnRpbnVl ZF9wKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAg ICAgICAgICA6IE1DX0dMWVBITEVTUzsKKyAgICAgIGludCB0ZW1wX3ggPSBvcG9pbnRfeDsKKyAg ICAgIGlmIChmbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAg fHwgZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICB8fCBmbGF2 b3IgPT0gTUNfVkVSVElDQUxfQkFSKQorICAgICAgICBjdXJzb3JfdHlwZSA9IFJJR0hUX0ZSSU5H RV9CSVRNQVA7CisgICAgICBpbnQgX2Z4LCBfZnksIGgsIF93ZDsKKyAgICAgIG1jX2dldF9waHlz X2N1cnNvcl9nZW9tZXRyeSAodywgcm93LCB0ZW1wX3gsICZfZngsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHRlbXBfeSwgJl9meSwgdGVtcF9ocG9zLCB0ZW1wX3Zwb3MsCisg ICAgICAgICAgICAgICAgICAgIC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WRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ0knLAor ICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3Qp CisgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAg ICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAg ICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlw aC0+cGl4ZWxfd2lkdGgsCisgICAgICAgICh1bnNpZ25lZCBpbnQpIGdseXBoLT51LmltZ19pZCwK KyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3As CisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+eCwgZ2x5 cGgtPnksIGdseXBoLT5ocG9zLCBnbHlwaC0+dnBvcywgZ2x5cGgtPnp2X3AgPyAiWlYiIDogIi0t IiwKKyAgICAgICAgJy4nKTsKKyAgc3dpdGNoIChhY3Rpb25fdHlwZSkKKyAgeworLyogLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJT T1JTOiAgSU1BR0VfR0xZUEggICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLSAqLworICAgIGNhc2UgTVVMVElQTEVfQ1VSU09SUzoKKyAgICB7CisgICA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taW5pbWFsX3AsIE1DX0dMWVBILCB0ZW1wX2NoYXJw b3MsIHJlc3VsdCk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0g Ki8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgVkVSVElDQUxfUlVMRVI6ICBJTUFHRV9H TFlQSCAgICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisg ICAgY2FzZSBWRVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAgICBjdXJzb3JfdHlwZSA9IEhPTExP V19CT1hfQ1VSU09SOworICAgICAgbWNfaGVscGVyICh3LCB0ZW1wX3gsIC0xLCB0ZW1wX3ksIC0x LCB0ZW1wX2hwb3MsIHRlbXBfdnBvcywKKyAgICAgICAgICAgICAgICAgLTEsIGN1cnNvcl90eXBl LCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAo dywgdGVtcF9mYWNlX2lkKSwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgIG1pbmltYWxfcCwg TUNfR0xZUEgsIHRlbXBfY2hhcnBvcywgcmVzdWx0KTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8q IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICBGSUxM X0NPTFVNTjogIElNQUdFX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEZJTExfQ09MVU1OOgorICAgIHsKKyAgICAgIGN1cnNv cl90eXBlID0gSE9MTE9XX0JPWF9DVVJTT1I7CisgICAgICBtY19oZWxwZXIgKHcsIHRlbXBfeCwg LTEsIHRlbXBfeSwgLTEsIHRlbXBfaHBvcywgdGVtcF92cG9zLAorICAgICAgICAgICAgICAgICAt MSwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAg ICAgbWNfYmdfbHNsICh3LCB0ZW1wX2ZhY2VfaWQpLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAg ICAgbWluaW1hbF9wLCBNQ19HTFlQSCwgdGVtcF9jaGFycG9zLCByZXN1bHQpOworICAgICAgYnJl YWs7CisgICAgfQorICB9CisgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIEVORDogIElNQUdFX0dMWVBIICAgICAgICAgICAgICAg ICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKworLyogLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICBCRUdJTjogIENPTVBP U0lURV9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLSAqLworICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpCisgIHsK KyAgICBpZiAobWNfc3RkZXJyX3ApCisgICAgICB7CisgICAgICAgIGZwcmludGYgKHN0ZGVyciwK KyAgICAgICAgICAiXG4gJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNngi LAorICAgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgICAo KHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAg ICAgICByZWxhdGl2ZV94LAorICAgICAgICAgICcrJywKKyAgICAgICAgICBnbHlwaC0+Y2hhcnBv cywKKyAgICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgPyAnQicK KyAgICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgPyAn UycKKyAgICAgICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAg ICAgPyAnMCcKKyAgICAgICAgICAgICAgICAgOiAnLScpKSksCisgICAgICAgICAgZ2x5cGgtPnBp eGVsX3dpZHRoLAorICAgICAgICAgICh1bnNpZ25lZCBpbnQpIGdseXBoLT51LmNtcC5pZCk7Cisg ICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAlNGQgJTEuMWQlMS4xZCIsCisgICAgICAgICAgZ2x5 cGgtPmZhY2VfaWQsCisgICAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAg ICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCk7CisgICAgICB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ICAgbWluaW1hbF9wLCBNQ19HTFlQSCwgdGVtcF9jaGFycG9zLCByZXN1bHQp OworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAg ICAgICAgICAgICAgICAgICAgSE9SSVpPTlRBTF9SVUxFUjogIENPTVBPU0lURV9HTFlQSCAgICAg ICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgSE9S SVpPTlRBTF9SVUxFUjoKKyAgICB7CisgICAgICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9IChv cG9pbnRfeCA9PSByZWxhdGl2ZV94CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvcG9pbnRfaHBvcyA9PSB0ZW1wX2hwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIG9wb2ludF95ID09IGdseXBoLT55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBvcG9pbnRfdnBvcyA9PSB0ZW1wX3Zwb3MpOworICAgICAgaW50IF9meCwgZnksIF9o LCBfd2Q7CisgICAgICBtY19nZXRfcGh5c19jdXJzb3JfZ2VvbWV0cnkgKHcsIHJvdywgdGVtcF94 LCAmX2Z4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wX3ksICZmeSwg dGVtcF9ocG9zLCB0ZW1wX3Zwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICZfaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgJl93ZCk7CisgICAgICBpZiAodGVtcF94 IDw9IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisg ICAgICAgIG1jX2hlbHBlciAodywgdGVtcF94LCAtMSwgdGVtcF95LCBmeSwgdGVtcF9ocG9zLCB0 ZW1wX3Zwb3MsCisgICAgICAgICAgICAgICAgICAgLTEsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lk dGgsIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgICAgbWNfYmdfbHNsICh3LCB0ZW1wX2Zh Y2VfaWQpLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICBtaW5pbWFsX3AsIE1DX0dMWVBI LCB0ZW1wX2NoYXJwb3MsIHJlc3VsdCk7CisgICAgICAvKiBJdCBpcyBwb3NzaWJsZSB0byB1c2Ug TUNfR0xZUEggYW5kIGFkanVzdCB0aGUgZnggY29vcmRpbmF0ZTsgaG93ZXZlciwKKyAgICAgIHRo ZSBtaWRkbGUtZG90IC8gc3BhY2UgZ2x5cGggb24gYSB3b3JkLXdyYXBwZWQgbGluZSB3aWxsIGJl IG92ZXJ3cml0dGVuCisgICAgICBudW1lcm91cyB0aW1lcyBhbmQgaXMgdW5zaWdodGx5LiAqLwor ICAgICAgaWYgKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJl YV0gLSAxKQorICAgICAgICB7CisgICAgICAgICAgaW50IF9meCwgZnksIF9oLCBfd2Q7CisgICAg ICAgICAgbWNfZ2V0X3BoeXNfY3Vyc29yX2dlb21ldHJ5ICh3LCByb3csIHRlbXBfeCwgJl9meCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBfeSwgJmZ5LCB0ZW1w X2hwb3MsIHRlbXBfdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICZfaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgJl93ZCk7CisgICAgICAgICAgdGVtcF94 ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICB3aGlsZSAodGVtcF94IDw9IHRleHRf YXJlYV93aWR0aCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbWNfaGVscGVyICh3LCB0 ZW1wX3gsIC0xLCB0ZW1wX3ksIGZ5LCB0ZW1wX2hwb3MsIHRlbXBfdnBvcywKKyAgICAgICAgICAg ICAgICAgICAgICAgICAtMSwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwK KyAgICAgICAgICAgICAgICAgICAgICAgICBtY19iZ19sc2wgKHcsIHRlbXBfZmFjZV9pZCksIGFj dGl2ZV9wLAorICAgICAgICAgICAgICAgICAgICAgICAgIG1pbmltYWxfcCwgTUNfR0xZUEhMRVNT LCB0ZW1wX2NoYXJwb3MsIHJlc3VsdCk7CisgICAgICAgICAgICAgIHRlbXBfeCArPSBmcmFtZV9j aGFyX3dpZHRoOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9 CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgIFZF UlRJQ0FMX1JVTEVSOiAgQ09NUE9TSVRFX0dMWVBIICAgICAgICAgICAgICAgICAgICAqLworLyog LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBWRVJUSUNBTF9SVUxFUjoKKyAgICB7Cisg ICAgICAvKiBgZ2x5cGgtPmNoYXJwb3NgIGlzIHVucmVsaWFibGUgd2hlbiB0ZXN0aW5nIGZvciBa ViAtLSB3aXRob3V0IGxpbmUKKyAgICAgIG51bWJlcn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6IChj dXJzb3JfaW5fZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPmNvbnRpbnVl ZF9wKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisg ICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAg ICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3AKKyAgICAgICAgICAgICAgICAgICAg ICAmJiAhcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElD QUxfQkFSCisgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FS RUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9p bnRfeCA+IHJlbGF0aXZlX3gpCisgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUwor ICAgICAgICAgICAgICAgICAgIDogKHp2X3ApCisgICAgICAgICAgICAgICAgICAgICA/IE1DX0dM WVBITEVTUworICAgICAgICAgICAgICAgICAgIDogTUNfR0xZUEg7CisgICAgICBpZiAoZmxhdm9y ID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGZsYXZvciA9PSBN Q19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgfHwgZmxhdm9yID09IE1DX1ZFUlRJ Q0FMX0JBUikKKyAgICAgICAgY3Vyc29yX3R5cGUgPSBSSUdIVF9GUklOR0VfQklUTUFQOworICAg ICAgaW50IF9meCwgX2Z5LCBoLCBfd2Q7CisgICAgICBtY19nZXRfcGh5c19jdXJzb3JfZ2VvbWV0 cnkgKHcsIHJvdywgdGVtcF94LCAmX2Z4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICB0ZW1wX3ksICZfZnksIHRlbXBfaHBvcywgdGVtcF92cG9zLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgJl93ZCk7 CisgICAgICBpbnQgZnggPSBXSU5ET1dfVEVYVF9UT19GUkFNRV9QSVhFTF9YICh3LCBvcG9pbnRf eCk7CisgICAgICBtY19oZWxwZXIgKHcsIHRlbXBfeCwgZngsIHRlbXBfeSwgLTEsIHRlbXBfaHBv cywgdGVtcF92cG9zLAorICAgICAgICAgICAgICAgICBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dp ZHRoLCBmb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICBtY19iZ19sc2wgKHcsIHRlbXBfZmFj ZV9pZCksIGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICBtaW5pbWFsX3AsIGZsYXZvciwgdGVt cF9jaGFycG9zLCByZXN1bHQpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICBGSUxMX0NPTFVNTjogIENPTVBP U0lURV9HTFlQSCAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAq LworICAgIGNhc2UgRklMTF9DT0xVTU46CisgICAgeworICAgICAgLyogYGdseXBoLT5jaGFycG9z YCBpcyB1bnJlbGlhYmxlIHdoZW4gdGVzdGluZyBmb3IgWlYgLS0gd2l0aG91dCBsaW5lCisgICAg ICBudW1iZXJzLCB0aGUgdmFsdWUgaXMgLTE7IHdpdGggbGluZSBudW1iZXJzLCB0aGUgdmFsdWUg aXMgX3NvbWV0aW1lc18gWlYuCisgICAgICBgZ2x5cGgtPnp2X3BgIGlzIHJlbGlhYmxlLCBidXQg cmVsaWVzIHVwb24gYSBmZXcgY29yZSBtb2RpZmljYXRpb24uCisgICAgICBgenZfcGAgZW5jb21w YXNzZXMgYSBjb3VwbGUgb2Ygc2l0dWF0aW9uczogIGEgbGluZSBlbmRpbmcgaW4gWlYsIGJ1dAor ICAgICAgIGNvbnRhaW5pbmcgb25lIG9yIG1vcmUgY2hhcmFjdGVycyBiZWZvcmUgWlY7IGFuZCwg YSBsaW5lIGJleW9uZCBaViB0aGF0CisgICAgICAgbWF5IGNvbnNpc3Qgb2Ygc3BhY2VzIGVxdWFs IHRvIGBpdC0+bG51bV9waXhlbF93aWR0aGAgLyBmcmFtZV9jaGFyX3dpZHRoLAorICAgICAgIG9y IGp1c3Qgb25lIHNwYWNlIGlmIHRoZXJlIGFyZSBubyBsaW5lIG51bWJlcnMuICovCisgICAgICBi b29sIHp2X3AgPSAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFth cmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAmJiBNQVRSSVhfUk9XX0VORF9DSEFSUE9TIChy b3cpID09IFpWKTsKKyAgICAgIGludCBmbGF2b3IgPSAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhU X0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAmJiBm aWxsX2NvbHVtbl94ID4gcmVsYXRpdmVfeCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZ UEhMRVNTCisgICAgICAgICAgICAgICAgICAgOiAoenZfcCkKKyAgICAgICAgICAgICAgICAgICAg ID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgOiAoIU5JTFAgKEJWQVIgKGIsIGNy b3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnNfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAg ICAgICAgICAgICYmIG9wb2ludF95ID09IHRlbXBfeQorICAgICAgICAgICAgICAgICAgICAgICYm IG9wb2ludF92cG9zID09IHRlbXBfdnBvcykKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZ UEhMRVNTCisgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIGludCBfZngsIF9m eSwgaCwgX3dkOworICAgICAgbWNfZ2V0X3BoeXNfY3Vyc29yX2dlb21ldHJ5ICh3LCByb3csIHRl bXBfeCwgJl9meCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcF95LCAm X2Z5LCB0ZW1wX2hwb3MsIHRlbXBfdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJmgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsICZfd2QpOworICAgICAgaW50IGZ4 ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgZmlsbF9jb2x1bW5feCk7CisgICAg ICBtY19oZWxwZXIgKHcsIHRlbXBfeCwgZngsIHRlbXBfeSwgLTEsIHRlbXBfaHBvcywgdGVtcF92 cG9zLAorICAgICAgICAgICAgICAgICBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3Jl Z3JvdW5kLAorICAgICAgICAgICAgICAgICBtY19iZ19sc2wgKHcsIHRlbXBfZmFjZV9pZCksIGFj dGl2ZV9wLAorICAgICAgICAgICAgICAgICBtaW5pbWFsX3AsIGZsYXZvciwgdGVtcF9jaGFycG9z LCByZXN1bHQpOworICAgICAgYnJlYWs7CisgICAgfQorICB9CisgIH0KKy8qIC0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFTkQ6ICBDT01QT1NJ VEVfR0xZUEggICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KKworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgQkVHSU46ICBYV0lER0VUX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICAgICAg Ki8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBY V0lER0VUX0dMWVBIKQorICB7CisjaWZuZGVmIEhBVkVfWFdJREdFVFMKKyAgICBlYXNzdW1lIChm YWxzZSk7CisjZWxzZQorICAgIGlmIChtY19zdGRlcnJfcCkKKyAgICAgIGZwcmludGYgKHN0ZGVy ciwKKyAgICAgICAgIlxuICAlNWQvJS01ZCAlNWQgJTRjICU2ZCAlYyAlM2QgMHglMDV4ICU0ZCAl MS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNkICVzICVjXG4iLAorICAgICAgICBnbHlwaCAtIHJv dy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8g MCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAn WCcsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9i amVjdCkKKyAgICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0 KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICAgIDogJy0nKSksCisgICAgICAgIGdseXBo LT5waXhlbF93aWR0aCwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5s ZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAg ICBnbHlwaC0+dS54d2lkZ2V0LAorICAgICAgICBnbHlwaC0+eCwgZ2x5cGgtPnksIGdseXBoLT5o cG9zLCBnbHlwaC0+dnBvcywgZ2x5cGgtPnp2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgJy4n KTsKKyNlbmRpZgorICBzd2l0Y2ggKGFjdGlvbl90eXBlKQorICB7CisvKiAtLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgTVVMVElQTEVfQ1VSU09SUzogIFhX SURHRVRfR0xZUEggICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t ICovCisgICAgY2FzZSBNVUxUSVBMRV9DVVJTT1JTOgorICAgIHsKKyAgICAgIG1jX2hlbHBlciAo dywgdGVtcF94LCAtMSwgdGVtcF95LCAtMSwgdGVtcF9ocG9zLCB0ZW1wX3Zwb3MsCisgICAgICAg ICAgICAgICAgIC0xLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLAorICAg ICAgICAgICAgICAgICBtY19iZ19sc2wgKHcsIHRlbXBfZmFjZV9pZCksIGFjdGl2ZV9wLAorICAg ICAgICAgICAgICAgICBtaW5pbWFsX3AsIE1DX0dMWVBILCB0ZW1wX2NoYXJwb3MsIHJlc3VsdCk7 CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAg ICAgICAgICAgICAgICAgICAgSE9SSVpPTlRBTF9SVUxFUjogIFhXSURHRVRfR0xZUEggICAgICAg ICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBIT1JJ Wk9OVEFMX1JVTEVSOgorICAgIHsKKyAgICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKG9w b2ludF94ID09IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IG9wb2ludF9ocG9zID09IHRlbXBfaHBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgb3BvaW50X3kgPT0gZ2x5cGgtPnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIG9wb2ludF92cG9zID09IHRlbXBfdnBvcyk7CisgICAgICBpbnQgX2Z4LCBmeSwgX2gs IF93ZDsKKyAgICAgIG1jX2dldF9waHlzX2N1cnNvcl9nZW9tZXRyeSAodywgcm93LCB0ZW1wX3gs ICZfZngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBfeSwgJmZ5LCB0 ZW1wX2hwb3MsIHRlbXBfdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg Jl9oLCBjdXJzb3JfdHlwZSwgY3V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X1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIDogKGN1 cnNvcl9pbl9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+Y29udGludWVk X3ApCisgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAg ICAgICAgICAgICAgICAgICA6IChjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAg ICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcAorICAgICAgICAgICAgICAgICAgICAg ICYmICFyb3ctPmNvbnRpbnVlZF9wKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNB TF9CQVIKKyAgICAgICAgICAgICAgICAgICA6IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJF QV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2lu dF94ID4gcmVsYXRpdmVfeCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisg ICAgICAgICAgICAgICAgICAgOiAoenZfcCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZ UEhMRVNTCisgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIGlmIChmbGF2b3Ig PT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZmxhdm9yID09IE1D X1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICB8fCBmbGF2b3IgPT0gTUNfVkVSVElD QUxfQkFSKQorICAgICAgICBjdXJzb3JfdHlwZSA9IFJJR0hUX0ZSSU5HRV9CSVRNQVA7CisgICAg ICBpbnQgX2Z4LCBfZnksIGgsIF93ZDsKKyAgICAgIG1jX2dldF9waHlzX2N1cnNvcl9nZW9tZXRy eSAodywgcm93LCB0ZW1wX3gsICZfZngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHRlbXBfeSwgJl9meSwgdGVtcF9ocG9zLCB0ZW1wX3Zwb3MsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICZoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCAmX3dkKTsK KyAgICAgIGludCBmeCA9IFdJTkRPV19URVhUX1RPX0ZSQU1FX1BJWEVMX1ggKHcsIG9wb2ludF94 KTsKKyAgICAgIG1jX2hlbHBlciAodywgdGVtcF94LCBmeCwgdGVtcF95LCAtMSwgdGVtcF9ocG9z LCB0ZW1wX3Zwb3MsCisgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lk dGgsIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAodywgdGVtcF9mYWNl X2lkKSwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgIG1pbmltYWxfcCwgZmxhdm9yLCB0ZW1w X2NoYXJwb3MsIHJlc3VsdCk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICBGSUxMX0NPTFVNTjogIFhXSURH RVRfR0xZUEggICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICov CisgICAgY2FzZSBGSUxMX0NPTFVNTjoKKyAgICB7CisgICAgICAvKiBgZ2x5cGgtPmNoYXJwb3Ng IGlzIHVucmVsaWFibGUgd2hlbiB0ZXN0aW5nIGZvciBaViAtLSB3aXRob3V0IGxpbm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AgICAgICAgICAgICAgICAgICA6ICghTklMUCAoQlZBUiAoYiwgY3Jv c3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIg KHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlyc192ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAg ICAgICAgICAgJiYgb3BvaW50X3kgPT0gdGVtcF95CisgICAgICAgICAgICAgICAgICAgICAgJiYg b3BvaW50X3Zwb3MgPT0gdGVtcF92cG9zKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQ SExFU1MKKyAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgaW50IF9meCwgX2Z5 LCBoLCBfd2Q7CisgICAgICBtY19nZXRfcGh5c19jdXJzb3JfZ2VvbWV0cnkgKHcsIHJvdywgdGVt cF94LCAmX2Z4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wX3ksICZf ZnksIHRlbXBfaHBvcywgdGVtcF92cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgJl93ZCk7CisgICAgICBpbnQgZngg PSBXSU5ET1dfVEVYVF9UT19GUkFNRV9QSVhFTF9YICh3LCBmaWxsX2NvbHVtbl94KTsKKyAgICAg IG1jX2hlbHBlciAodywgdGVtcF94LCBmeCwgdGVtcF95LCAtMSwgdGVtcF9ocG9zLCB0ZW1wX3Zw b3MsCisgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVn cm91bmQsCisgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAodywgdGVtcF9mYWNlX2lkKSwgYWN0 aXZlX3AsCisgICAgICAgICAgICAgICAgIG1pbmltYWxfcCwgZmxhdm9yLCB0ZW1wX2NoYXJwb3Ms IHJlc3VsdCk7CisgICAgICBicm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WZkZWYgR0xZUEhfREVCVUcKKyAgY2xvY2tfdCBzdGFydCwg ZW5kOworICBkb3VibGUgY3B1X3RpbWVfdXNlZDsKKyAgY2hhciBidWZfdGltZVtEQkxfQlVGU0la RV9CT1VORF07CisgIHN0YXJ0ID0gY2xvY2soKTsKKyNlbmRpZgorKi8KKyNpZmRlZiBHTFlQSF9E RUJVRworICBpZiAodHJhY2VfcmVkaXNwbGF5X3AKKyAgICAgICYmIEJVRkZFUlAgKHctPmNvbnRl bnRzKQorICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbXVsdGlw bGVfY3Vyc29yc19jb25mKSkpCisgICAgeworICAgICAgTGlzcF9PYmplY3Qgd2luZG93OworICAg ICAgWFNFVFdJTkRPVyAod2luZG93LCB3KTsKKyAgICAgIExpc3BfT2JqZWN0IHdpbmRvd19zdHJp bmcgPSBGcHJpbjFfdG9fc3RyaW5nICh3aW5kb3csIFFuaWwpOworICAgICAgY2hhciAqd2luZG93 X2NoYXIgPSBTU0RBVEEgKHdpbmRvd19zdHJpbmcpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAi bWNfZHJhd19tdWx0aXBsZV9jdXJzb3JzICglcylcbiIsIHdpbmRvd19jaGFyKTsKKyAgICB9Cisj ZW5kaWYKKyAgYm9vbCBtY19zdGRlcnJfcCA9ICFOSUxQIChCVkFSIChjdXJyZW50X2J1ZmZlciwg bWNfc3RkZXJyKSk7CisgIHB0cmRpZmZfdCBvcG9pbnRfcHQgPSBQVDsKKyAgaW50IG9wb2ludF94 ID0gdy0+cGh5c19jdXJzb3IueDsKKyAgaW50IG9wb2ludF95ID0gdy0+cGh5c19jdXJzb3IueTsK KyAgaW50IG9wb2ludF9ocG9zID0gdy0+cGh5c19jdXJzb3IuaHBvczsKKyAgaW50IG9wb2ludF92 cG9zID0gdy0+cGh5c19jdXJzb3IudnBvczsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3 LT5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yAgICAgICAgICAgICAgICAgICAgICAgICAgIDogMTsKKyAg ZW51bSBmYWNlX2lkIGN1cnNvcl9mYWNlX2lkID0KKyAgICAoIWFjdGl2ZV9wCisgICAgICYmICFO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnNfaW5hY3RpdmVfd2lu ZG93cykpKQorICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1m YWtlLWN1cnNvci1pbmFjdGl2ZS1mYWNlIiksIHRydWUpCisgICAgOiBsb29rdXBfbmFtZWRfZmFj ZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWZhY2UiKSwgdHJ1ZSk7CisgIHN0 cnVjdCBmYWNlICpjdXJzb3JfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgY3Vyc29yX2ZhY2VfaWQp OworICBMaXNwX09iamVjdCBjdXJzb3JfY29sb3IgPSBjdXJzb3JfZmFjZS0+bGZhY2VbTEZBQ0Vf Rk9SRUdST1VORF9JTkRFWF07CisgIENIRUNLX1NUUklORyAoY3Vyc29yX2NvbG9yKTsKKyAgY3Vy cmVudF9jb2wgPSBtY19jdXJyZW50X2NvbHVtbiAodywgb3BvaW50X3B0KTsKKyAgLyogcmVkICov CisgIGlmIChjdXJyZW50X2NvbCAlIDIgIT0gMAorICAgICAgJiYgIWZpbGxfY29sdW1uX3ApCisg ICAgZm9yZWdyb3VuZCA9IG9kZF9jb2xvcl92ZWN0b3I7CisgIC8qIHllbGxvdyAqLworICBpZiAo Y3VycmVudF9jb2wgJSAyID09IDAKKyAgICAgICYmICFmaWxsX2NvbHVtbl9wKQorICAgIGZvcmVn cm91bmQgPSBldmVuX2NvbG9yX3ZlY3RvcjsKKyAgLyogcmVkICovCisgIGlmIChjdXJyZW50X2Nv bCAlIDIgIT0gMAorICAgICAgJiYgZmlsbF9jb2x1bW5fcAorICAgICAgJiYgY3VycmVudF9jb2wg PD0gZmlsbF9jb2wpCisgICAgZm9yZWdyb3VuZCA9IG9kZF9jb2xvcl92ZWN0b3I7CisgIC8qIHll bGxvdyAqLworICBpZiAoY3VycmVudF9jb2wgJSAyID09IDAKKyAgICAgICYmIGZpbGxfY29sdW1u X3AKKyAgICAgICYmIGN1cnJlbnRfY29sIDw9IGZpbGxfY29sKQorICAgIGZvcmVncm91bmQgPSBl dmVuX2NvbG9yX3ZlY3RvcjsKKyAgLyogZ3JlZW4gKi8KKyAgaWYgKGZpbGxfY29sdW1uX3AKKyAg ICAgICYmIGN1cnJlbnRfY29sID4gZmlsbF9jb2wpCisgICAgZm9yZWdyb3VuZCA9IGZpbGxfY29s b3JfdmVjdG9yOworICBMaXNwX09iamVjdCBjdXJzb3JfZmcgPSAoYWN0aXZlX3ApCisgICAgICAg ICAgICAgICAgICAgICAgICAgID8gZm9yZWdyb3VuZAorICAgICAgICAgICAgICAgICAgICAgICAg ICA6IG1jX2NvbG9yX3ZlY3Rvcl9jYWxjICh3LCBjdXJzb3JfY29sb3IpOworICBzdHJ1Y3QgZ2x5 cGggKmN1cnNvcl9nbHlwaCA9CisgICAgICAgICAgICBtY19nZXRfcGh5c19jdXJzb3JfZ2x5cGgg KHcsIG9wb2ludF9ocG9zLCBvcG9pbnRfdnBvcyk7CisgIGN1cnNvcl9mYWNlX2lkID0gKGN1cnNv cl9nbHlwaCA9PSBOVUxMKQorICAgICAgICAgICAgICAgICAgICA/IERFRkFVTFRfRkFDRV9JRAor ICAgICAgICAgICAgICAgICAgICA6IGN1cnNvcl9nbHlwaC0+ZmFjZV9pZDsKKyAgbWNfaGVscGVy ICh3LCBvcG9pbnRfeCwgLTEsIG9wb2ludF95LCAtMSwgb3BvaW50X2hwb3MsIG9wb2ludF92cG9z LCAtMSwKKyAgICAgICAgICAgICB0ZW1wX2N1cnNvcl90eXBlLCB0ZW1wX2N1cnNvcl93aWR0aCwg Y3Vyc29yX2ZnLAorICAgICAgICAgICAgIG1jX2JnX2xzbCAodywgY3Vyc29yX2ZhY2VfaWQpLCBh Y3RpdmVfcCwgbWluaW1hbF9wLCBNQ19HTFlQSCwKKyAgICAgICAgICAgICBvcG9pbnRfcHQsICZy ZXN1bHQpOworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAg ICAgIERSQVcgLyBSRUNPUkQgTVVMVElQTEUgQ1VSU09SUyAgICAgICAgICAgICAgICAgICAgICAg Ki8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICBmb3IgKHZsaXN0ID0gQlZBUiAoYiwgbXVs dGlwbGVfY3Vyc29yc19jb25mKTsKKyAgICAgICBDT05TUCAodmxpc3QpOworICAgICAgIHZsaXN0 ID0gWENEUiAodmxpc3QpKQorICAgIHsKKyAgICAgIHNwZWNzID0gWENBUiAodmxpc3QpOworICAg ICAgcG9zaW50ID0gWEZJWE5VTSAoRm50aCAobWFrZV9maXhudW0gKDApLCBzcGVjcykpOworICAg ICAgbGlzcF90eXBlID0gRm50aCAobWFrZV9maXhudW0gKDEpLCBzcGVjcyk7CisgICAgICBpZiAo Q09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19jdXJz b3JfdHlwZSAoWENBUiAobGlzcF90eXBlKSk7CisgICAgICAgIGVsc2UKKyAgICAgICAgICBjdXJz b3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKGxpc3BfdHlwZSk7CisgICAgICBpZiAo Q09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgIGN1cnNvcl93aWR0aCA9IFhGSVhOVU0gKFhDQVIg KFhDRFIgKGxpc3BfdHlwZSkpKTsKKyAgICAgICAgZWxzZQorICAgICAgICAgIGN1cnNvcl93aWR0 aCA9IDE7CisgICAgICBmb3JlZ3JvdW5kID0gRm50aCAobWFrZV9maXhudW0gKDIpLCBzcGVjcyk7 CisgICAgICBpZiAoU1RSSU5HUCAoZm9yZWdyb3VuZCkpCisgICAgICAgIGZvcmVncm91bmQgPSBt Y19jb2xvcl92ZWN0b3JfY2FsYyAodywgZm9yZWdyb3VuZCk7CisgICAgICBzdHJ1Y3QgZ2x5cGhf bWF0cml4ICptYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAgICAgIGludCByb3dfc3RhcnQs IHJvd19lbmQsIHdpbmRvd19yb3dfc3RhcnQsIHdpbmRvd19yb3dfZW5kOworICAgICAgaW50IGk7 CisgICAgICBMaXNwX09iamVjdCB0ZW1wID0gUW5pbDsKKyAgICAgIExpc3BfT2JqZWN0IHZzcGVj cyA9IFFuaWw7CisgICAgICBmb3IgKGkgPSAwOyBpIDwgbWF0cml4LT5ucm93czsgKytpKQorICAg ICAgICB7CisgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93ID0gTUFUUklYX1JPVyAobWF0 cml4LCBpKTsKKyAgICAgICAgICByb3dfc3RhcnQgPSBNQVRSSVhfUk9XX1NUQVJUX0NIQVJQT1Mg KHJvdyk7CisgICAgICAgICAgaWYgKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIGkgPT0gMSkK KyAgICAgICAgICAgICAgIHx8IChoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCAmJiBpID09IDApKQor ICAgICAgICAgICAgd2luZG93X3Jvd19zdGFydCA9IHJvd19zdGFydDsKKyAgICAgICAgICBpZiAo IXJvdy0+ZW5hYmxlZF9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICB3aW5kb3dfcm93 X2VuZCA9IHJvd19lbmQ7CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcm93X2VuZCA9 IE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdyk7CisgICAgICAgICAgICAgICAgdGVtcCA9IGxp c3RuIChDT05TVFlQRV9IRUFQLCAzLCBtYWtlX2ZpeG51bSAoaSksCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYWtlX2ZpeG51bSAocm93X3N0YXJ0KSwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ha2VfZml4 bnVtIChyb3dfZW5kKSk7CisgICAgICAgICAgICAgICAgdnNwZWNzID0gRmNvbnMgKHRlbXAsIHZz cGVjcyk7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKHBvc2ludCA+PSB3 aW5kb3dfcm93X3N0YXJ0CisgICAgICAgICAgJiYgcG9zaW50IDw9IHdpbmRvd19yb3dfZW5kKQor ICAgICAgICB7CisgICAgICAgIExpc3BfT2JqZWN0IHZsaXN0OworICAgICAgICBmb3IgKHZsaXN0 ID0gRm5yZXZlcnNlICh2c3BlY3MpOworICAgICAgICAgICAgIENPTlNQICh2bGlzdCk7CisgICAg ICAgICAgICAgdmxpc3QgPSBYQ0RSICh2bGlzdCkpCisgICAgICAgICAgeworICAgICAgICAgICAg aW50IGNvdW50ID0gWEZJWE5VTSAoRm50aCAobWFrZV9maXhudW0gKDApLCBYQ0FSICh2bGlzdCkp KTsKKyAgICAgICAgICAgIGludCBwb3Nfc3RhcnQgPSBYRklYTlVNIChGbnRoIChtYWtlX2ZpeG51 bSAoMSksIFhDQVIgKHZsaXN0KSkpOworICAgICAgICAgICAgaW50IHBvc19lbmQgPSBYRklYTlVN IChGbnRoIChtYWtlX2ZpeG51bSAoMiksIFhDQVIgKHZsaXN0KSkpOworICAgICAgICAgICAgc3Ry dWN0IGdseXBoX3JvdyAqcm93ID0gTUFUUklYX1JPVyAody0+Y3VycmVudF9tYXRyaXgsIGNvdW50 KTsKKyAgICAgICAgICAgIGludCBhcmVhOworICAgICAgICAgICAgaW50IHJlbGF0aXZlX3ggPSAw OworICAgICAgICAgICAgZm9yIChhcmVhID0gTEVGVF9NQVJHSU5fQVJFQTsgYXJlYSA8IExBU1Rf QVJFQTsgKythcmVhKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RydWN0IGds eXBoICpnbHlwaCA9IHJvdy0+Z2x5cGhzW2FyZWFdOworICAgICAgICAgICAgICAgIHN0cnVjdCBn bHlwaCAqZ2x5cGhfZW5kID0gZ2x5cGggKyByb3ctPnVzZWRbYXJlYV07CisgICAgICAgICAgICAg ICAgaWYgKGFyZWEgPT0gVEVYVF9BUkVBICYmIGdseXBoID09IGdseXBoX2VuZCAmJiBnbHlwaC0+ Y2hhcnBvcyA+IDApCisgICAgICAgICAgICAgICAgICArK2dseXBoX2VuZDsKKyAgICAgICAgICAg ICAgICBpZiAobWNfc3RkZXJyX3AKKyAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGggPCBnbHlw aF9lbmQpCisgICAgICAgICAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsCisiXG5jb3VudCAoJWQp IHwgd2luZG93X3Jvd19zdGFydC9lbmQgKCVkLyVkKSB8IHJvd19zdGFydC9lbmQgKCVkLyVkKVxu XAorPT09PT09PT09PT09PT09PT09PT09PT09PT09PSBNVUxUSVBMRSBDVVJTT1JTID09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PVxuXAorR2x5cGgjL1RvdGFsIFJlbC5YIFQgICAgICAg UG9zIE8gICBXICAgICBDb2RlIEZhY2UgTFIgICAgIFggICAgWSBIUE9TIFZQT1MgWlYgQ1xuIiwK K2NvdW50LCB3aW5kb3dfcm93X3N0YXJ0LCB3aW5kb3dfcm93X2VuZCwgcG9zX3N0YXJ0LCBwb3Nf ZW5kKTsKKyAgICAgICAgICAgICAgICBmb3IgKDsgZ2x5cGggPCBnbHlwaF9lbmQ7ICsrZ2x5cGgp CisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmICgoKGhlYWRlcl9s aW5lX2Zvcm1hdCA+IDAgJiYgY291bnQgPiAwKQorICAgICAgICAgICAgICAgICAgICAgICAgIHx8 IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKGds eXBoLT5jaGFycG9zID09IHBvc2ludAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFRo ZSBzcGFjZSBhcHBlbmRlZCB0byBhIHJvdyBlbmRpbmcgd2l0aCBhIG5ldyBsaW5lCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgZG9lcyBub3QgaGF2ZSBhIGBnbHlwaC0+Y2hhcnBvc2AgKC0x LCAwKSB0aGF0IHdlIGNhbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVzZSBmb3IgdGhp cyBwYXJ0aWN1bGFyIGFwcGxpY2F0aW9uLiAgV2hlbiB0aGVyZSBpcyBhCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgYGJ1ZmZlci1kaXNwbGF5LXRhYmxlJyBlbnRyeSB0aGF0IGFzc2lnbnMg YSB2aXNpYmxlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGggdG8gYSBuZXcgbGlu ZSwgdGhlcmUgaXMgbm8gcHJvYmxlbSBiZWNhdXNlIHRoYXQKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICBnbHlwaCBoYXMgYSBgZ2x5cGgtPmNoYXJwb3MnIHRoYXQgd2UgY2FuIHVzZS4gIFdo ZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBubyB2aXNpYmxlIEVPTCBnbHlwaCBleGlz dHMsIHdlIHVzZSB0aGUgZm9sbG93aW5nCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVz dDogIHRoZSBhcHBlbmRlZCBzcGFjZSBoYXMgYSBwb3NpdGlvbiB0aGF0IGlzIG9uZQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGxlc3MgdGhhbiB0aGUgZW5kIG9mIHRoZSBtYXRyaXggcm93 LiAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChnbHlwaCAtIHJvdy0+Z2x5cGhz W1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBwb3NpbnQgPT0gTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSAtIDEp KQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGgtPnkgPD0gd2luZG93X3RleHRfYm90 dG9tX3kgKHcpKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAg ICAgIGN1cnJlbnRfY29sID0gbWNfY3VycmVudF9jb2x1bW4gKHcsIHBvc2ludCk7CisgICAgICAg ICAgICAgICAgICAgICAgICBpZiAoTklMUCAoZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiByZWQgKi8KKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICBpZiAoY3VycmVudF9jb2wgJSAyICE9IDAKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgIWZpbGxfY29sdW1uX3ApCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kID0gb2RkX2NvbG9yX3ZlY3RvcjsKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAvKiB5ZWxsb3cgKi8KKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICBpZiAoY3VycmVudF9jb2wgJSAyID09IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgIWZpbGxfY29sdW1uX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBm b3JlZ3JvdW5kID0gZXZlbl9jb2xvcl92ZWN0b3I7CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgLyogcmVkICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnJlbnRfY29s ICUgMiAhPSAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGZpbGxfY29sdW1u X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3VycmVudF9jb2wgPD0gZmls bF9jb2wpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kID0gb2RkX2Nv bG9yX3ZlY3RvcjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiB5ZWxsb3cgKi8KKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY3VycmVudF9jb2wgJSAyID09IDAKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBjdXJyZW50X2NvbCA8PSBmaWxsX2NvbCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQgPSBldmVuX2NvbG9yX3ZlY3RvcjsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBncmVlbiAqLworICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGlmIChmaWxsX2NvbHVtbl9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIGN1cnJlbnRfY29sID4gZmlsbF9jb2wpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBmb3JlZ3JvdW5kID0gZmlsbF9jb2xvcl92ZWN0b3I7CisgICAgICAgICAgICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIG1jX2VuZ2luZSAocm93LCBnbHlwaCwg YXJlYSwgcmVsYXRpdmVfeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdywg cG9zaW50LCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBhY3RpdmVfcCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWluaW1hbF9wLCBNVUxUSVBMRV9D VVJTT1JTLCAmcmVzdWx0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAg ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChtY19zdGRl cnJfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgIG1jX2R1bXBfZ2x5cGggKHJvdywgZ2x5cGgs IGFyZWEsIHJlbGF0aXZlX3gpOworICAgICAgICAgICAgICAgICAgICByZWxhdGl2ZV94ICs9IGds eXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgfQor ICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgaWYgKHVwZGF0aW5nX2ZyYW1lX3ApCisg ICAgdXBkYXRlX2VuZCAoWEZSQU1FICh3LT5mcmFtZSkpOworLyogYHctPm11bHRpcGxlX2N1cnNv cnNfY2FjaGUnIGlzIHNldCBmb3IgdGhlIHdpbmRvdywgbm90IGJ1ZmZlcit3aW5kb3cgLS0gaS5l LiwgYWxsIGJ1ZmZlcnMgYXBwZWFyaW5nCitpbiB0aGUgc2FtZSB3aW5kb3cgdmlhIGBzd2l0Y2gt dG8tYnVmZmVyJyB3aWxsIGhhdmUgYHctPm11bHRpcGxlX2N1cnNvcnNfY2FjaGUnLiAgVGhpcyBi ZWhhdmlvcgoraXMgY29uc2lzdGVudCB3aXRoIGZ1bmN0aW9ucyBzdWNoIGFzIGBzZXQtd2luZG93 LWRpc3BsYXktdGFibGUnLiAgV2UgZGVhbCB3aXRoIHRoaXMgaW4KK2Buc3Rlcm0ubScgLyBgdzMy dGVybS5jJyAvIGB4dGVybS5jJyBieSBjb21wYXJpbmcgYHctPmNvbnRlbnRzJyB0byB0aGUgdmFs dWUgb2YgdGhlIGBidWYnCitzdG9yZWQgaW4gYHctPm11bHRpcGxlX2N1cnNvcnNfY2FjaGUnLiAq LworICBpZiAoIU5JTFAgKHJlc3VsdCkpCisgICAgd3NldF9tdWx0aXBsZV9jdXJzb3JzX2NhY2hl ICh3LCBsaXN0biAoQ09OU1RZUEVfSEVBUCwgMywKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIEZyZXZlcnNlIChyZXN1bHQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgRmNvbnMgKHdpbmRvdywgUW5pbCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBGY29ucyAody0+Y29udGVudHMsIFFuaWwpKSk7CisgIHctPm1jLmRyYXdfbXVsdGlwbGVfY3Vy c29ycyA9IGZhbHNlOworICBpZiAob2xkX2J1ZmZlcikKKyAgICBzZXRfYnVmZmVyX2ludGVybmFs IChvbGRfYnVmZmVyKTsKKy8qCisjaWZkZWYgR0xZUEhfREVCVUcKKyAgZW5kID0gY2xvY2soKTsK KyAgY3B1X3RpbWVfdXNlZCA9ICgoZG91YmxlKSAoZW5kIC0gc3RhcnQpKSAvIENMT0NLU19QRVJf U0VDOworICBkdG9hc3RyIChidWZfdGltZSwgc2l6ZW9mIGJ1Zl90aW1lLCAwLCAwLCBjcHVfdGlt ZV91c2VkKTsKKyAgZGVidWdfbWV0aG9kX2FkZCAodywgIm1jX2RyYXdfbXVsdGlwbGVfY3Vyc29y czogIFRJTUUgKCVzKSIsIGJ1Zl90aW1lKTsKKyNlbmRpZgorKi8KK30KKwordm9pZAorbWNfZHJh d19jcm9zc2hhaXJzIChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGFjdGl2ZV9wLCBib29sIG1pbmlt YWxfcCkKK3sKKy8qCisjaWZkZWYgR0xZUEhfREVCVUcKKyAgY2xvY2tfdCBzdGFydCwgZW5kOwor ICBkb3VibGUgY3B1X3RpbWVfdXNlZDsKKyAgY2hhciBidWZfdGltZVtEQkxfQlVGU0laRV9CT1VO RF07CisgIHN0YXJ0ID0gY2xvY2soKTsKKyNlbmRpZgorKi8KKyNpZmRlZiBHTFlQSF9ERUJVRwor ICBpZiAodHJhY2VfcmVkaXNwbGF5X3AKKyAgICAgICYmIEJVRkZFUlAgKHctPmNvbnRlbnRzKQor ICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykp KQorICAgIHsKKyAgICAgIExpc3BfT2JqZWN0IHdpbmRvdzsKKyAgICAgIFhTRVRXSU5ET1cgKHdp bmRvdywgdyk7CisgICAgICBMaXNwX09iamVjdCB3aW5kb3dfc3RyaW5nID0gRnByaW4xX3RvX3N0 cmluZyAod2luZG93LCBRbmlsKTsKKyAgICAgIGNoYXIgKndpbmRvd19jaGFyID0gU1NEQVRBICh3 aW5kb3dfc3RyaW5nKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX2RyYXdfY3Jvc3NoYWly cyAoJXMpOiAgYWN0aXZlX3AgKCVkKSB8IG1pbmltYWxfcCAoJWQpXG4iLAorICAgICAgICAgICAg ICAgICAgICAgICAgd2luZG93X2NoYXIsIGFjdGl2ZV9wLCBtaW5pbWFsX3ApOworICAgIH0KKyNl bmRpZgorICBib29sIG1jX3N0ZGVycl9wID0gIU5JTFAgKEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBt Y19zdGRlcnIpKTsKKyAgcHRyZGlmZl90IG9wb2ludF9wdCA9ICh3ID09IFhXSU5ET1cgKHNlbGVj dGVkX3dpbmRvdykpCisgICAgICAgICAgICAgICAgICAgICAgICA/IFBUCisgICAgICAgICAgICAg ICAgICAgICAgICA6IFhGSVhOVU0gKEZtYXJrZXJfcG9zaXRpb24gKHctPnBvaW50bSkpOworICBp bnQgb3BvaW50X3ggPSB3LT5waHlzX2N1cnNvci54OworICBpbnQgb3BvaW50X3kgPSB3LT5waHlz X2N1cnNvci55OworICBpbnQgb3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RyaXhf cm93JyBpbiBgZGlzcG5ldy5jYCBjb250YWlucyB0aGUgZm9sbG93aW5nIHRlc3RzLAorICBlYXNz ZXJ0IChtYXRyaXggJiYgbWF0cml4LT5yb3dzKTsKKyAgZWFzc2VydCAocm93ID49IDAgJiYgcm93 IDwgbWF0cml4LT5ucm93cyk7ICovCisgIGJvb2wgYmFyZl9jcmFzaF9vbmUgPSAody0+Y3VycmVu dF9tYXRyaXggJiYgdy0+Y3VycmVudF9tYXRyaXgtPnJvd3MpID8gZmFsc2UgOiB0cnVlOworICBp ZiAoYmFyZl9jcmFzaF9vbmUpCisgICAgeworICAgICAgaWYgKG9sZF9idWZmZXIpCisgICAgICAg IHNldF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworICAgICAgcmV0dXJuOworICAgIH0K KyAgYm9vbCBiYXJmX2NyYXNoX3R3byA9IChvcG9pbnRfdnBvcyA+PSAwICYmIG9wb2ludF92cG9z IDwgdy0+Y3VycmVudF9tYXRyaXgtPm5yb3dzKSA/IGZhbHNlIDogdHJ1ZTsKKyAgaWYgKGJhcmZf Y3Jhc2hfdHdvKQorICAgIHsKKyAgICAgIGlmIChvbGRfYnVmZmVyKQorICAgICAgICBzZXRfYnVm ZmVyX2ludGVybmFsIChvbGRfYnVmZmVyKTsKKyAgICAgIHJldHVybjsKKyAgICB9CisgIGlmICgh QlVGRkVSUCAoYnVmKSkKKyAgICB7CisgICAgICBpZiAob2xkX2J1ZmZlcikKKyAgICAgICAgc2V0 X2J1ZmZlcl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7CisgICAgICByZXR1cm47CisgICAgfQorICBp ZiAoTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpKQorICAgIHsKKyAgICAgIGlmIChvbGRfYnVm ZmVyKQorICAgICAgICBzZXRfYnVmZmVyX2ludGVybmFsIChvbGRfYnVmZmVyKTsKKyAgICAgIHJl dHVybjsKKyAgICB9CisgIGlmIChOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzX2hvcml6b250YWxf cnVsZXIpKQorICAgICAgJiYgTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlyc192ZXJ0aWNhbF9ydWxl cikpKQorICAgIHsKKyAgICAgIGlmIChvbGRfYnVmZmVyKQorICAgICAgICBzZXRfYnVmZmVyX2lu dGVybmFsIChvbGRfYnVmZmVyKTsKKyAgICAgIHJldHVybjsKKyAgICB9CisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJFR0lOIEpPVVJORVkg Li4uCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAgaW50IGZyYW1lX2NoYXJfd2lkdGggPSBG UkFNRV9DT0xVTU5fV0lEVEggKGYpOworICBpbnQgdGV4dF9hcmVhX3dpZHRoID0gd2luZG93X2Jv eF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgYm9vbCBjdXJzb3JfaW5fZnJpbmdlX3AgPSB3LT5v dXRwdXRfY3Vyc29yLnggKyBmcmFtZV9jaGFyX3dpZHRoID49IHRleHRfYXJlYV93aWR0aDsKKyAg c3RydWN0IGdseXBoX3JvdyAqZ2x5cGhfcm93OworICBpbnQgY3Vyc29yX3dpZHRoID0gMTsKKyAg cHRyZGlmZl90IHBvc2ludCA9IC0xOworICBwdHJkaWZmX3QgY3VycmVudF9jb2wgPSBtY19jdXJy ZW50X2NvbHVtbiAodywgb3BvaW50X3B0KTsKKyAgYm9vbCBmaWxsX2NvbHVtbl9wID0gIU5JTFAg KEJWQVIgKGIsIGZpbGxfY29sdW1uKSk7CisgIGludCBmaWxsX2NvbCA9IFhGSVhOVU0gKEJWQVIg KGIsIGZpbGxfY29sdW1uKSk7CisgIGludCBoc2NsX3ggPSB3LT5oc2Nyb2xsICogZnJhbWVfY2hh cl93aWR0aDsKKyAgaW50IGZpbGxfY29sdW1uX3ggPSAoZmlsbF9jb2x1bW5fcAorICAgICAgICAg ICAgICAgICAgICAgICAmJiAhTklMUCAoVmRpc3BsYXlfbGluZV9udW1iZXJzKSkKKyAgICAgICAg ICAgICAgICAgICAgICAgID8gKGZpbGxfY29sICogZnJhbWVfY2hhcl93aWR0aCkgKyB3LT5tYy5s bnVtX3BpeGVsX3dpZHRoIC0gaHNjbF94CisgICAgICAgICAgICAgICAgICAgICAgOiAoZmlsbF9j b2x1bW5fcAorICAgICAgICAgICAgICAgICAgICAgICAgICYmIE5JTFAgKFZkaXNwbGF5X2xpbmVf bnVtYmVycykpCisgICAgICAgICAgICAgICAgICAgICAgICA/IChmaWxsX2NvbCAqIGZyYW1lX2No YXJfd2lkdGgpIC0gaHNjbF94CisgICAgICAgICAgICAgICAgICAgICAgOiAwOworICBMaXNwX09i amVjdCByZXN1bHQgPSBRbmlsOworICBpbnQgZmxhdm9yOworICAvKiBWYWx1ZXMgZm9yIHRoZSBj dXJyZW50IGNvbHVtbiBvZiB0aGUgdmVydGljYWwgbGluZS4gKi8KKyAgTGlzcF9PYmplY3QgZm9y ZWdyb3VuZCA9IEZtYWtlX3ZlY3RvciAobWFrZV9maXhudW0gKDMpLCBRbmlsKTsKKyAgZW51bSBm YWNlX2lkIGZhY2VfaWQ7CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgQ09MT1IgT0YgQ1JPU1NIQUlSUworKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisgIGVudW0gZmFjZV9pZCBldmVuX2ZhY2VfaWQgPQorICAgICghYWN0aXZlX3AKKyAgICAg JiYgIU5JTFAgKEJWQVIgKFh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T0gMAorICAgICAg JiYgIWZpbGxfY29sdW1uX3ApCisgICAgZm9yZWdyb3VuZCA9IGV2ZW5fY29sb3JfdmVjdG9yOwor ICAvKiByZWQgKi8KKyAgaWYgKGN1cnJlbnRfY29sICUgMiAhPSAwCisgICAgICAmJiBmaWxsX2Nv bHVtbl9wCisgICAgICAmJiBjdXJyZW50X2NvbCA8PSBmaWxsX2NvbCkKKyAgICBmb3JlZ3JvdW5k ID0gb2RkX2NvbG9yX3ZlY3RvcjsKKyAgLyogeWVsbG93ICovCisgIGlmIChjdXJyZW50X2NvbCAl IDIgPT0gMAorICAgICAgJiYgZmlsbF9jb2x1bW5fcAorICAgICAgJiYgY3VycmVudF9jb2wgPD0g ZmlsbF9jb2wpCisgICAgZm9yZWdyb3VuZCA9IGV2ZW5fY29sb3JfdmVjdG9yOworICAvKiBncmVl biAqLworICBpZiAoZmlsbF9jb2x1bW5fcAorICAgICAgJiYgY3VycmVudF9jb2wgPiBmaWxsX2Nv bCkKKyAgICBmb3JlZ3JvdW5kID0gZmlsbF9jb2xvcl92ZWN0b3I7CisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIEVSQVNFIFRIRSBSRUFMIENVUlNP UgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBgdy0+cGh5c19jdXJzb3IueC95L2hwb3Mv dnBvc2AgYXJlIGluY29ycmVjdCBhZnRlciBldmFsdWF0aW5nIChzY3JvbGwtbGVmdCAxKQorYSBj b3VwbGUgb2YgdGltZXMuICBSZWRpc3BsYXkgZXJhc2VzIHRoZSByZWFsIGN1cnNvciBhbG1vc3Qg aW1tZWRpYXRlbHkgYWZ0ZXIKK2BtY19kcmF3X2Nyb3NzaGFpcnMnIHJ1bnMgaX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orICAgIHsKKyAgICAgIHctPnBo eXNfY3Vyc29yLnggPSB3LT5vdXRwdXRfY3Vyc29yLng7CisgICAgICB3LT5waHlzX2N1cnNvci55 ID0gdy0+b3V0cHV0X2N1cnNvci55OworICAgICAgdy0+cGh5c19jdXJzb3IuaHBvcyA9IHctPm91 dHB1dF9jdXJzb3IuaHBvczsKKyAgICAgIHctPnBoeXNfY3Vyc29yLnZwb3MgPSB3LT5vdXRwdXRf Y3Vyc29yLnZwb3M7CisgICAgfQorICBpZiAoIW1pbmltYWxfcCkKKyAgICBlcmFzZV9waHlzX2N1 cnNvciAodyk7CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgUkVQTEFDRSBUSEUgUkVBTCBDVVJTT1IKKyoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor ICBnbHlwaF9yb3cgPSBNQVRSSVhfUk9XICh3LT5jdXJyZW50X21hdHJpeCwgb3BvaW50X3Zwb3Mp OworICBpZiAoIWN1cnNvcl9pbl9mcmluZ2VfcCkKKyAgICBmbGF2b3IgPSBNQ19HTFlQSDsKKyAg ICAvKiBUaGlzIGNvbmRpdGlvbiBwcm9iYWJseSBkb2VzIG5vdCBleGlzdCBmb3IgdGhlIHJlYWwg ZmFrZSBjdXJzb3IuICovCisgICAgZWxzZSBpZiAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAg ICAgICAgJiYgZ2x5cGhfcm93LT5jb250aW51ZWRfcCkKKyAgICAgIGZsYXZvciA9IE1DX1BJTENS T1c7CisgICAgICBlbHNlIGlmIChjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAgICAgICAgICAgICYm IGdseXBoX3Jvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgIGZsYXZvciA9IE1DX0hP TExPV19SRUNUQU5HTEVfUklHSFRfQVJST1c7CisgICAgICAgIGVsc2UgaWYgKGN1cnNvcl9pbl9m cmluZ2VfcAorICAgICAgICAgICAgICAgICAmJiAhZ2x5cGhfcm93LT5jb250aW51ZWRfcAorICAg ICAgICAgICAgICAgICAmJiAhZ2x5cGhfcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAg ICAgICBmbGF2b3IgPSBNQ19IT0xMT1dfUkVDVEFOR0xFOworICBmYWNlX2lkID0gKHJlYWxfcGh5 c19jdXJzb3JfZ2x5cGggPT0gTlVMTCkKKyAgICAgICAgICAgICAgPyBERUZBVUxUX0ZBQ0VfSUQK KyAgICAgICAgICAgICAgOiByZWFsX3BoeXNfY3Vyc29yX2dseXBoLT5mYWNlX2lkOworICBpbnQg b3BvaW50X2Z4ID0gLTE7CisgIGludCBvcG9pbnRfZnkgPSAtMTsKKyAgaW50IG9wb2ludF9oID0g LTE7CisgIC8qIEZJWE1FOiAgUHV0IGluIHNvbWUgY29kZSB0byBkZWZhdWx0IHRvIEhPTExPV19C T1hfQ1VSU09SIGlmIHRoZSB1c2VyIGhhcworICB1bndpdHRpbmdseSBjb21lIHVwIHdpdGggc29t ZSB1bmFjY2VwdGFibGUgZm9ybSBvZiB1bnJlY29nbml6ZWQgY3Vyc29yIHR5cGUuICovCisgIExp c3BfT2JqZWN0IGN1cnNvcl9saXNwX3R5cGUgPSBCVkFSIChiLCBtY19yZWFsX2Zha2VfY3Vyc29y KTsKKyAgZW51bSB0ZXh0X2N1cnNvcl9raW5kcyB0ZW1wX2N1cnNvcl90eXBlID0gKENPTlNQIChj dXJzb3JfbGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoWENBUiAoY3Vyc29yX2xpc3BfdHlwZSkp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg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cG9pbnRfaCwgUklHSFRfRlJJTkdFX0JJVE1BUCwgY3Vyc29yX3dpZHRoLCBjdXJzb3JfZmcsCisg ICAgICAgICAgICAgICBtY19iZ19sc2wgKHcsIGZhY2VfaWQpLCBhY3RpdmVfcCwgbWluaW1hbF9w LCBmbGF2b3IsCisgICAgICAgICAgICAgICBvcG9pbnRfcHQsICZyZXN1bHQpOworICAgIC8qIEVY QU1QTEUgKGJ1ZmZlci1sb2NhbCk6ICAoc2V0cSBtYy1yZWFsLWZha2UtY3Vyc29yIG5pbC8nbm8v Im5vIikgKi8KKyAgICBlbHNlIGlmICghY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAg JiYgdGVtcF9jdXJzb3JfdHlwZSA9PSBOT19DVVJTT1IKKyAgICAgICAgICAgICAmJiAhbWluaW1h bF9wKQorICAgICAgeworICAgICAgICBpbnQgX3dkID0gMDsKKyAgICAgICAgb3BvaW50X2Z4ID0g LTE7CisgICAgICAgIG9wb2ludF9meSA9IC0xOworICAgICAgICBvcG9pbnRfaCA9IC0xOworICAg ICAgICBpbnQgdGVtcF94ID0gb3BvaW50X3g7CisgICAgICAgIGludCB0ZW1wX3kgPSBvcG9pbnRf eTsKKyAgICAgICAgaW50IHRlbXBfaHBvcyA9IG9wb2ludF9ocG9zOworICAgICAgICBpbnQgdGVt cF92cG9zID0gb3BvaW50X3Zwb3M7CisgICAgICAgIG1jX2dldF9waHlzX2N1cnNvcl9nZW9tZXRy eSAodywgZ2x5cGhfcm93LCB0ZW1wX3gsICZvcG9pbnRfZngsIHRlbXBfeSwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmb3BvaW50X2Z5LCB0ZW1wX2hwb3MsIHRlbXBfdnBv cywgJm9wb2ludF9oLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhCQVJf Q1VSU09SLCBpbml0aWFsX2N1cnNvcl93aWR0aCwgJl93ZCk7CisgICAgICAgIG1jX2hlbHBlciAo dywgdGVtcF94LCBvcG9pbnRfZngsIHRlbXBfeSwgb3BvaW50X2Z5LCB0ZW1wX2hwb3MsCisgICAg ICAgICAgICAgICAgICAgdGVtcF92cG9zLCBvcG9pbnRfaCwgSEJBUl9DVVJTT1IsIGN1cnNvcl93 aWR0aCwgY3Vyc29yX2ZnLAorICAgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAodywgZmFjZV9p ZCksIGFjdGl2ZV9wLCBtaW5pbWFsX3AsIE1DX0dMWVBILAorICAgICAgICAgICAgICAgICAgIG9w b2ludF9wdCwgJnJlc3VsdCk7CisgICAgICAgIC8qIFVzZSBNQ19HTFlQSExFU1Mgc28gYXMgbm90 IHRvIHN1cGVyaW1wb3NlL292ZXJ3cml0ZSBhbm90aGVyIGdseXBoLiAqLworICAgICAgICBfd2Qg PSAwOworICAgICAgICBvcG9pbnRfZnggPSAtMTsKKyAgICAgICAgb3BvaW50X2Z5ID0gLTE7Cisg ICAgICAgIG9wb2ludF9oID0gLTE7CisgICAgICAgIHRlbXBfeCA9IG9wb2ludF94OworICAgICAg ICB0ZW1wX3kgPSBvcG9pbnRfeTsKKyAgICAgICAgdGVtcF9ocG9zID0gb3BvaW50X2hwb3M7Cisg ICAgICAgIHRlbXBfdnBvcyA9IG9wb2ludF92cG9zOworICAgICAgICBtY19nZXRfcGh5c19jdXJz b3JfZ2VvbWV0cnkgKHcsIGdseXBoX3JvdywgdGVtcF94LCAmb3BvaW50X2Z4LCB0ZW1wX3ksCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF9meSwgdGVtcF9ocG9z LCB0ZW1wX3Zwb3MsICZvcG9pbnRfaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBCQVJfQ1VSU09SLCBpbml0aWFsX2N1cnNvcl93aWR0aCwgJl93ZCk7CisgICAgICAgIG1j X2hlbHBlciAodywgdGVtcF94LCBvcG9pbnRfZngsIHRlbXBfeSwgb3BvaW50X2Z5LCB0ZW1wX2hw b3MsCisgICAgICAgICAgICAgICAgICAgdGVtcF92cG9zLCBvcG9pbnRfaCwgQkFSX0NVUlNPUiwg Y3Vyc29yX3dpZHRoLCBjdXJzb3JfZmcsCisgICAgICAgICAgICAgICAgICAgbWNfYmdfbHNsICh3 LCBmYWNlX2lkKSwgYWN0aXZlX3AsIG1pbmltYWxfcCwgTUNfR0xZUEhMRVNTLAorICAgICAgICAg ICAgICAgICAgIG9wb2ludF9wdCwgJnJlc3VsdCk7CisgICAgICB9CisgICAgICBlbHNlIGlmICgh Y3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAmJiAhbWluaW1hbF9wKQorICAgICAg ICB7CisgICAgICAgICAgaW50IF93ZCA9IDA7CisgICAgICAgICAgb3BvaW50X2Z4ID0gLTE7Cisg ICAgICAgICAgb3BvaW50X2Z5ID0gLTE7CisgICAgICAgICAgb3BvaW50X2ggPSAtMTsKKyAgICAg ICAgICBpbnQgdGVtcF94ID0gb3BvaW50X3g7CisgICAgICAgICAgaW50IHRlbXBfeSA9IG9wb2lu dF95OworICAgICAgICAgIGludCB0ZW1wX2hwb3MgPSBvcG9pbnRfaHBvczsKKyAgICAgICAgICBp bnQgdGVtcF92cG9zID0gb3BvaW50X3Zwb3M7CisgICAgICAgICAgbWNfZ2V0X3BoeXNfY3Vyc29y X2dlb21ldHJ5ICh3LCBnbHlwaF9yb3csIHRlbXBfeCwgJm9wb2ludF9meCwgdGVtcF95LAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF9meSwgdGVtcF9ocG9z LCB0ZW1wX3Zwb3MsICZvcG9pbnRfaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHRlbXBfY3Vyc29yX3R5cGUsIGluaXRpYWxfY3Vyc29yX3dpZHRoLCAmX3dkKTsKKyAg ICAgICAgICBtY19oZWxwZXIgKHcsIHRlbXBfeCwgb3BvaW50X2Z4LCB0ZW1wX3ksIG9wb2ludF9m eSwgdGVtcF9ocG9zLAorICAgICAgICAgICAgICAgICAgICAgdGVtcF92cG9zLCBvcG9pbnRfaCwg dGVtcF9jdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgY3Vy c29yX2ZnLCBtY19iZ19sc2wgKHcsIGZhY2VfaWQpLCBhY3RpdmVfcCwgbWluaW1hbF9wLAorICAg ICAgICAgICAgICAgICAgICAgZmxhdm9yLCBvcG9pbnRfcHQsICZyZXN1bHQpOworICAgICAgICB9 CisgIGlmIChOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzX2hvcml6b250YWxfcnVsZXIpKSkKKyAg ICBnb3RvIHZlcnRpY2FsX3J1bGVyOworICAgIGVsc2UKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KgorICAgICAgICAgICAgICAgIEhPUklaT05UQUwgUlVMRVI6ICBGSVJTVCBYID0+IEVPTAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmQKKyAgICAgICBIT1JJWk9OVEFMIFJVTEVS OiAgRFJBVyBGTE9BVElORyBHTFlQSExFU1MgTElORSAoRU9MIFRPIEZSSU5HRSkKKyoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworICAgIHsKKyAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdyA9IE1B VFJJWF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCBvcG9pbnRfdnBvcyk7CisgICAgICBpbnQgYXJl YTsKKyAgICAgIGludCByZWxhdGl2ZV94ID0gMDsKKyAgICAgIGZvciAoYXJlYSA9IExFRlRfTUFS R0lOX0FSRUE7IGFyZWEgPCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAgICAgICAgeworICAgICAgICAg IHN0cnVjdCBnbHlwaCAqZ2x5cGggPSByb3ctPmdseXBoc1thcmVhXTsKKyAgICAgICAgICBzdHJ1 Y3QgZ2x5cGggKmdseXBoX2VuZCA9IGdseXBoICsgcm93LT51c2VkW2FyZWFdOworICAgICAgICAg IC8qIEdseXBoIGZvciBhIGxpbmUgZW5kIGluIHRleHQuICAqLworICAgICAgICAgIGlmIChhcmVh ID09IFRFWFRfQVJFQSAmJiBnbHlwaCA9PSBnbHlwaF9lbmQgJiYgZ2x5cGgtPmNoYXJwb3MgPiAw KQorICAgICAgICAgICAgKytnbHlwaF9lbmQ7CisgICAgICAgICAgaWYgKG1jX3N0ZGVycl9wCisg ICAgICAgICAgICAgICYmIGdseXBoIDwgZ2x5cGhfZW5kKQorICAgICAgICAgICAgZnByaW50ZiAo c3RkZXJyLAorIlxuPT09PT09PT09PT09PT09PT09PT09PT09PT09PSBIT1JJWk9OVEFMIFJVTEVS ID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblwKK0dseXBoIy9Ub3RhbCBSZWwu WCBUICAgICAgIFBvcyBPICAgVyAgICAgQ29kZSBGYWNlIExSICAgICBYICAgIFkgSFBPUyBWUE9T IFpWIENcbiIpOworICAgICAgICAgIGZvciAoOyBnbHlwaCA8IGdseXBoX2VuZDsgKytnbHlwaCkK KyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbWNfZW5naW5lIChyb3csIGdseXBoLCBhcmVh LCByZWxhdGl2ZV94LAorICAgICAgICAgICAgICAgICAgICAgICAgIHcsIHBvc2ludCwgSEJBUl9D VVJTT1IsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYWN0aXZlX3AsCisgICAgICAgICAgICAg ICAgICAgICAgICAgbWluaW1hbF9wLCBIT1JJWk9OVEFMX1JVTEVSLCAmcmVzdWx0KTsKKyAgICAg ICAgICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICB9 CisgICAgICAgIH0KKyAgICB9CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAg VkVSVElDQUwgUlVMRVI6ICBDT01CSU5BVElPTiBPRiBHTFlQSCAmIEdMWVBITEVTUyBDVVJTT1JT CisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAgdmVydGljYWxfcnVsZXI6CisgIGlmIChOSUxQ IChCVkFSIChiLCBjcm9zc2hhaXJzX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgIHx8IGZpbGxfY29s dW1uX3RydW1wc19wKQorICAgIGdvdG8gY3Jvc3NoYWlyc19maW5pc2g7CisgICAgZWxzZQorICAg ICAgeworICAgICAgICBpbnQgaGVhZGVyX2xpbmVfZm9ybWF0ID0gV0lORE9XX0hFQURFUl9MSU5F X0hFSUdIVCAodyk7CisgICAgICAgIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCA9IHctPmN1 cnJlbnRfbWF0cml4OworICAgICAgICBpbnQgcm93X3N0YXJ0LCByb3dfZW5kLCB3aW5kb3dfcm93 X3N0YXJ0LCB3aW5kb3dfcm93X2VuZDsKKyAgICAgICAgaW50IGk7CisgICAgICAgIExpc3BfT2Jq ZWN0IHRlbXAgPSBRbmlsOworICAgICAgICBMaXNwX09iamVjdCB2c3BlY3MgPSBRbmlsOworICAg ICAgICBmb3IgKGkgPSAwOyBpIDwgbWF0cml4LT5ucm93czsgKytpKQorICAgICAgICAgIHsKKyAg ICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdyA9IE1BVFJJWF9ST1cgKG1hdHJpeCwgaSk7 CisgICAgICAgICAgICByb3dfc3RhcnQgPSBNQVRSSVhfUk9XX1NUQVJUX0NIQVJQT1MgKHJvdyk7 CisgICAgICAgICAgICBpZiAoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgaSA9PSAxKQorICAg ICAgICAgICAgICAgICB8fCAoaGVhZGVyX2xpbmVfZm9ybWF0ID09IDAgJiYgaSA9PSAwKSkKKyAg ICAgICAgICAgICAgd2luZG93X3Jvd19zdGFydCA9IHJvd19zdGFydDsKKyAgICAgICAgICAgIGlm ICghcm93LT5lbmFibGVkX3ApCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB3aW5k b3dfcm93X2VuZCA9IHJvd19lbmQ7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICAgIHJvd19lbmQgPSBNQVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpOworICAgICAgICAg ICAgICAgICAgdGVtcCA9IGxpc3RuIChDT05TVFlQRV9IRUFQLCAzLCBtYWtlX2ZpeG51bSAoaSks CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ha2Vf Zml4bnVtIChyb3dfc3RhcnQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBtYWtlX2ZpeG51bSAocm93X2VuZCkpOworICAgICAgICAgICAgICAgICAg dnNwZWNzID0gRmNvbnMgKHRlbXAsIHZzcGVjcyk7CisgICAgICAgICAgICAgICAgfQorICAgICAg ICAgIH0KKyAgICAgICAgTGlzcF9PYmplY3Qgdmxpc3Q7CisgICAgICAgIGZvciAodmxpc3QgPSBG bnJldmVyc2UgKHZzcGVjcyk7CisgICAgICAgICAgICAgQ09OU1AgKHZsaXN0KTsKKyAgICAgICAg ICAgICB2bGlzdCA9IFhDRFIgKHZsaXN0KSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpbnQg Y291bnQgPSBYRklYTlVNIChGbnRoIChtYWtlX2ZpeG51bSAoMCksIFhDQVIgKHZsaXN0KSkpOwor ICAgICAgICAgICAgaW50IHBvc19zdGFydCA9IFhGSVhOVU0gKEZudGggKG1ha2VfZml4bnVtICgx KSwgWENBUiAodmxpc3QpKSk7CisgICAgICAgICAgICBpbnQgcG9zX2VuZCA9IFhGSVhOVU0gKEZu dGggKG1ha2VfZml4bnVtICgyKSwgWENBUiAodmxpc3QpKSk7CisgICAgICAgICAgICBzdHJ1Y3Qg Z2x5cGhfcm93ICpyb3cgPSBNQVRSSVhfUk9XICh3LT5jdXJyZW50X21hdHJpeCwgY291bnQpOwor ICAgICAgICAgICAgaW50IHRlbXBfdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCB3LT5jdXJy ZW50X21hdHJpeCk7CisgICAgICAgICAgICBpbnQgYXJlYTsKKyAgICAgICAgICAgIGludCByZWxh dGl2ZV94ID0gMDsKKyAgICAgICAgICAgIGZvciAoYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFy ZWEgPCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg IHN0cnVjdCBnbHlwaCAqZ2x5cGggPSByb3ctPmdseXBoc1thcmVhXTsKKyAgICAgICAgICAgICAg ICBzdHJ1Y3QgZ2x5cGggKmdseXBoX2VuZCA9IGdseXBoICsgcm93LT51c2VkW2FyZWFdOworICAg ICAgICAgICAgICAgIGlmIChhcmVhID09IFRFWFRfQVJFQSAmJiBnbHlwaCA9PSBnbHlwaF9lbmQg JiYgZ2x5cGgtPmNoYXJwb3MgPiAwKQorICAgICAgICAgICAgICAgICAgKytnbHlwaF9lbmQ7Cisg ICAgICAgICAgICAgICAgaWYgKG1jX3N0ZGVycl9wCisgICAgICAgICAgICAgICAgICAgICYmIGds eXBoIDwgZ2x5cGhfZW5kKQorICAgICAgICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLAorIlxu Y291bnQgKCVkKSB8IHdpbmRvd19yb3dfc3RhcnQvZW5kICglZC8lZCkgfCByb3dfc3RhcnQvZW5k ICglZC8lZClcblwKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09IFZFUlRJQ0FMIFJVTEVS ID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblwKK0dseXBoIy9Ub3RhbCBSZWwu WCBUICAgICAgIFBvcyBPICAgVyAgICAgQ29kZSBGYWNlIExSICAgICBYICAgIFkgSFBPUyBWUE9T IFpWIENcbiIsCitjb3VudCwgd2luZG93X3Jvd19zdGFydCwgd2luZG93X3Jvd19lbmQsIHBvc19z dGFydCwgcG9zX2VuZCk7CisgICAgICAgICAgICAgICAgZm9yICg7IGdseXBoIDwgZ2x5cGhfZW5k OyArK2dseXBoKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBib29s IHJlYWxfZmFrZV9jdXJzb3JfcCA9IChvcG9pbnRfeSA9PSBnbHlwaC0+eQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfdnBvcyA9PSB0ZW1w X3Zwb3MpOworICAgICAgICAgICAgICAgICAgICBpZiAoKChoZWFkZXJfbGluZV9mb3JtYXQgPiAw ICYmIGNvdW50ID4gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICB8fCBoZWFkZXJfbGluZV9m b3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIChyZWxhdGl2ZV94ICsgZ2x5 cGgtPnBpeGVsX3dpZHRoID4gb3BvaW50X3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8 fCBnbHlwaCA9PSBnbHlwaF9lbmQgLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5 cGgtPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICAgICAgICAg ICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgICAgICAgIG1jX2VuZ2luZSAocm93LCBnbHlwaCwgYXJlYSwgcmVsYXRpdmVf eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdywgcG9zaW50LCBCQVJfQ1VS U09SLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGFjdGl2ZV9wLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBtaW5pbWFsX3AsIFZFUlRJQ0FMX1JVTEVSLCAmcmVzdWx0KTsK KyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChtY19zdGRlcnJfcCkKKyAgICAgICAgICAg ICAgICAgICAgICAgIG1jX2R1bXBfZ2x5cGggKHJvdywgZ2x5cGgsIGFyZWEsIHJlbGF0aXZlX3gp OworICAgICAgICAgICAgICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0aDsK KyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAg IH0KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBTRVQgVEhFIENBQ0hFCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAgY3Jvc3NoYWly c19maW5pc2g6CisgIGlmICghbWluaW1hbF9wCisgICAgICAmJiB1cGRhdGluZ19mcmFtZV9wKQor ICAgIHVwZGF0ZV9lbmQgKFhGUkFNRSAody0+ZnJhbWUpKTsKKyAgaWYgKCFOSUxQIChyZXN1bHQp KQorICAgIHdzZXRfY3Jvc3NoYWlyc19jYWNoZSAodywgbGlzdG4gKENPTlNUWVBFX0hFQVAsIDMs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRnJldmVyc2UgKHJlc3VsdCks CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmNvbnMgKHdpbmRvdywgUW5p bCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmNvbnMgKHctPmNvbnRl bnRzLCBRbmlsKSkpOworICB3LT5tYy5kcmF3X2Nyb3NzaGFpcnMgPSBmYWxzZTsKKyAgaWYgKG9s ZF9idWZmZXIpCisgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7CisvKgorI2lm ZGVmIEdMWVBIX0RFQlVHCisgIGVuZCA9IGNsb2NrKCk7CisgIGNwdV90aW1lX3VzZWQgPSAoKGRv dWJsZSkgKGVuZCAtIHN0YXJ0KSkgLyBDTE9DS1NfUEVSX1NFQzsKKyAgZHRvYXN0ciAoYnVmX3Rp bWUsIHNpemVvZiBidWZfdGltZSwgMCwgMCwgY3B1X3RpbWVfdXNlZCk7CisgIGRlYnVnX21ldGhv ZF9hZGQgKHcsICJtY19kcmF3X2Nyb3NzaGFpcnM6ICBUSU1FICglcykiLCBidWZfdGltZSk7Cisj ZW5kaWYKKyovCit9CisKK3ZvaWQKK21jX2RyYXdfZmlsbF9jb2x1bW4gKHN0cnVjdCB3aW5kb3cg KncsIGJvb2wgYWN0aXZlX3AsIGJvb2wgbWluaW1hbF9wKQoreworLyoKKyNpZmRlZiBHTFlQSF9E RUJVRworICBjbG9ja190IHN0YXJ0LCBlbmQ7CisgIGRvdWJsZSBjcHVfdGltZV91c2VkOworICBj aGFyIGJ1Zl90aW1lW0RCTF9CVUZTSVpFX0JPVU5EXTsKKyAgc3RhcnQgPSBjbG9jaygpOworI2Vu ZGlmCisqLworI2lmZGVmIEdMWVBIX0RFQlVHCisgIGlmICh0cmFjZV9yZWRpc3BsYXlfcAorICAg ICAgJiYgQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAmJ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SAob3BvaW50X3Zwb3MgPj0gMCAmJiBvcG9pbnRf dnBvcyA8IHctPmN1cnJlbnRfbWF0cml4LT5ucm93cykgPyBmYWxzZSA6IHRydWU7CisgIGlmIChi YXJmX2NyYXNoX3R3bykKKyAgICB7CisgICAgICBpZiAob2xkX2J1ZmZlcikKKyAgICAgICAgc2V0 X2J1ZmZlcl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7CisgICAgICByZXR1cm47CisgICAgfQorICBp ZiAoIUJVRkZFUlAgKGJ1ZikpCisgICAgeworICAgICAgaWYgKG9sZF9idWZmZXIpCisgICAgICAg IHNldF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworICAgICAgcmV0dXJuOworICAgIH0K KyAgaWYgKE5JTFAgKEJWQVIgKGIsIG1jX2ZpbGxfY29sdW1uKSkpCisgICAgeworICAgICAgaWYg KG9sZF9idWZmZXIpCisgICAgICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOwor ICAgICAgcmV0dXJuOworICAgIH0KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgQkVHSU4gSk9VUk5FWSAuLi4KKyoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworICBpbnQgdGV4dF9hcmVhX3dpZHRoID0gd2luZG93X2JveF93aWR0aCAodywgVEVY VF9BUkVBKTsKKyAgaW50IGZyYW1lX2NoYXJfd2lkdGggPSBGUkFNRV9DT0xVTU5fV0lEVEggKGYp OworICBpbnQgY3Vyc29yX3dpZHRoID0gMTsKKyAgcHRyZGlmZl90IHBvc2ludCA9IC0xOworICBi b29sIGZpbGxfY29sdW1uX3AgPSAhTklMUCAoQlZBUiAoYiwgZmlsbF9jb2x1bW4pKTsKKyAgaW50 IGZpbGxfY29sID0gWEZJWE5VTSAoQlZBUiAoYiwgZmlsbF9jb2x1bW4pKTsKKyAgaW50IGhzY2xf eCA9IHctPmhzY3JvbGwgKiBmcmFtZV9jaGFyX3dpZHRoOworICBpbnQgZmlsbF9jb2x1bW5feCA9 IChmaWxsX2NvbHVtbl9wCisgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChWZGlzcGxh eV9saW5lX251bWJlcnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgPyAoZmlsbF9jb2wgKiBm cmFtZV9jaGFyX3dpZHRoKSArIHctPm1jLmxudW1fcGl4ZWxfd2lkdGggLSBoc2NsX3gKKyAgICAg ICAgICAgICAgICAgICAgICA6IChmaWxsX2NvbHVtbl9wCisgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgTklMUCAoVmRpc3BsYXlfbGluZV9udW1iZXJzKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgID8gKGZpbGxfY29sICogZnJhbWVfY2hhcl93aWR0aCkgLSBoc2NsX3gKKyAgICAgICAgICAg ICAgICAgICAgICA6IDA7CisgIExpc3BfT2JqZWN0IHJlc3VsdCA9IFFuaWw7CisgIGludCBsbnVt X3BpeGVsX3dpZHRoID0gKCFOSUxQIChWZGlzcGxheV9saW5lX251bWJlcnMpKQorICAgICAgICAg ICAgICAgICAgICAgICAgID8gdy0+bWMubG51bV9waXhlbF93aWR0aAorICAgICAgICAgICAgICAg ICAgICAgICAgIDogMDsKKyAgaWYgKGZpbGxfY29sdW1uX3ggPiB0ZXh0X2FyZWFfd2lkdGgKKyAg ICAgIHx8IGZpbGxfY29sdW1uX3ggPCBsbnVtX3BpeGVsX3dpZHRoKQorICAgIGdvdG8gbWNfZmls bF9jb2x1bW5fZmluaXNoOworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIENPTE9SIE9GIEZJTEwgQ09MVU1OCisqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKyAgZW51bSBmYWNlX2lkIGZpbGxfY29sdW1uX2ZhY2VfaWQgPQorICAgICghYWN0aXZl X3AKKyAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfZmlsbF9j b2x1bW5faW5hY3RpdmVfd2luZG93cykpCisgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywg ZiwgaW50ZXJuICgibWMtZmlsbC1jb2x1bW4taW5hY3RpdmUtZmFjZSIpLCB0cnVlKQorICAgIDog KCFhY3RpdmVfcAorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IG1jX2ZpbGxfY29sdW1uX2luYWN0aXZlX3dpbmRvd3MpKQorICAgICAgICYmICFOSUxQIChCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICYmICFOSUxQIChC VkFSIChiLCBjcm9zc2hhaXJzX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAmJiBvcG9pbnRfeCA9 PSBmaWxsX2NvbHVtbl94KQorICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJu ICgibWMtZmlsbC1jb2x1bW4tb3BvaW50LWluYWN0aXZlLWZhY2UiKSwgdHJ1ZSkKKyAgICA6IChh Y3RpdmVfcAorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNy b3NzaGFpcnMpKQorICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzX3ZlcnRpY2Fs X3J1bGVyKSkKKy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9mYWNlX2lkKTsKKyAgTGlzcF9P YmplY3QgZmlsbF9jb2x1bW5fY29sb3IgPSBmaWxsX2NvbHVtbl9mYWNlLT5sZmFjZVtMRkFDRV9G T1JFR1JPVU5EX0lOREVYXTsKKyAgQ0hFQ0tfU1RSSU5HIChmaWxsX2NvbHVtbl9jb2xvcik7Cisg IExpc3BfT2JqZWN0IGZvcmVncm91bmQgPSBtY19jb2xvcl92ZWN0b3JfY2FsYyAodywgZmlsbF9j b2x1bW5fY29sb3IpOworICBib29sIHVwZGF0aW5nX2ZyYW1lX3AgPSBmYWxzZTsKKyAgaWYgKG1p bmltYWxfcCkKKyAgICBnb3RvIG1jX2ZpbGxfY29sdW1uX2ZpbmlzaDsKKyAgICBlbHNlIGlmIChY RlJBTUUgKHctPmZyYW1lKSAhPSBYRlJBTUUgKHctPmZyYW1lKS0+bWNfdXBkYXRpbmdfZnJhbWUp CisgICAgeworICAgICAgdXBkYXRpbmdfZnJhbWVfcCA9IHRydWU7CisgICAgICB1cGRhdGVfYmVn aW4gKFhGUkFNRSAody0+ZnJhbWUpKTsKKyAgICB9CisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioK KyAgICAgICAgICAgRklMTCBDT0xVTU46ICBDT01CSU5BVElPTiBPRiBHTFlQSCAmIEdMWVBITEVT UyBDVVJTT1JTCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAgaW50IGhlYWRlcl9saW5lX2Zv cm1hdCA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICBzdHJ1Y3QgZ2x5cGhfbWF0 cml4ICptYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAgaW50IHJvd19zdGFydCwgcm93X2Vu ZCwgd2luZG93X3Jvd19zdGFydCwgd2luZG93X3Jvd19lbmQ7CisgIGludCBpOworICBMaXNwX09i amVjdCB0ZW1wID0gUW5pbDsKKyAgTGlzcF9PYmplY3QgdnNwZWNzID0gUW5pbDsKKyAgZm9yIChp ID0gMDsgaSA8IG1hdHJpeC0+bnJvd3M7ICsraSkKKyAgICB7CisgICAgICBzdHJ1Y3QgZ2x5cGhf cm93ICpyb3cgPSBNQVRSSVhfUk9XIChtYXRyaXgsIGkpOworICAgICAgcm93X3N0YXJ0ID0gTUFU UklYX1JPV19TVEFSVF9DSEFSUE9TIChyb3cpOworICAgICAgaWYgKChoZWFkZXJfbGluZV9mb3Jt YXQgPiAwICYmIGkgPT0gMSkKKyAgICAgICAgICAgfHwgKGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAw ICYmIGkgPT0gMCkpCisgICAgICAgIHdpbmRvd19yb3dfc3RhcnQgPSByb3dfc3RhcnQ7CisgICAg ICBpZiAoIXJvdy0+ZW5hYmxlZF9wKQorICAgICAgICB7CisgICAgICAgICAgd2luZG93X3Jvd19l bmQgPSByb3dfZW5kOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIGVsc2UK KyAgICAgICAgICB7CisgICAgICAgICAgICByb3dfZW5kID0gTUFUUklYX1JPV19FTkRfQ0hBUlBP UyAocm93KTsKKyAgICAgICAgICAgIHRlbXAgPSBsaXN0biAoQ09OU1RZUEVfSEVBUCwgMywgbWFr ZV9maXhudW0gKGkpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBtYWtlX2ZpeG51bSAocm93X3N0YXJ0KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgbWFrZV9maXhudW0gKHJvd19lbmQpKTsKKyAgICAgICAgICAgIHZzcGVj cyA9IEZjb25zICh0ZW1wLCB2c3BlY3MpOworICAgICAgICAgIH0KKyAgICB9CisgIExpc3BfT2Jq ZWN0IHZsaXN0OworICBmb3IgKHZsaXN0ID0gRm5yZXZlcnNlICh2c3BlY3MpOworICAgICAgIENP TlNQICh2bGlzdCk7CisgICAgICAgdmxpc3QgPSBYQ0RSICh2bGlzdCkpCisgICAgeworICAgICAg aW50IGNvdW50ID0gWEZJWE5VTSAoRm50aCAobWFrZV9maXhudW0gKDApLCBYQ0FSICh2bGlzdCkp KTsKKyAgICAgIGludCBwb3Nfc3RhcnQgPSBYRklYTlVNIChGbnRoIChtYWtlX2ZpeG51bSAoMSks IFhDQVIgKHZsaXN0KSkpOworICAgICAgaW50IHBvc19lbmQgPSBYRklYTlVNIChGbnRoIChtYWtl X2ZpeG51bSAoMiksIFhDQVIgKHZsaXN0KSkpOworICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93 ID0gTUFUUklYX1JPVyAody0+Y3VycmVudF9tYXRyaXgsIGNvdW50KTsKKyAgICAgIGludCB0ZW1w X3Zwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgdy0+Y3VycmVudF9tYXRyaXgpOworICAgICAg aW50IGFyZWE7CisgICAgICBpbnQgcmVsYXRpdmVfeCA9IDA7CisgICAgICBmb3IgKGFyZWEgPSBM RUZUX01BUkdJTl9BUkVBOyBhcmVhIDwgTEFTVF9BUkVBOyArK2FyZWEpCisgICAgICAgIHsKKyAg ICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoID0gcm93LT5nbHlwaHNbYXJlYV07CisgICAgICAg ICAgc3RydWN0IGdseXBoICpnbHlwaF9lbmQgPSBnbHlwaCArIHJvdy0+dXNlZFthcmVhXTsKKyAg ICAgICAgICBpZiAoYXJlYSA9PSBURVhUX0FSRUEgJiYgZ2x5cGggPT0gZ2x5cGhfZW5kICYmIGds eXBoLT5jaGFycG9zID4gMCkKKyAgICAgICAgICAgICsrZ2x5cGhfZW5kOworICAgICAgICAgIGlm IChtY19zdGRlcnJfcAorICAgICAgICAgICAgICAmJiBnbHlwaCA8IGdseXBoX2VuZCkKKyAgICAg ICAgICAgIGZwcmludGYgKHN0ZGVyciwKKyJcbmNvdW50ICglZCkgfCB3aW5kb3dfcm93X3N0YXJ0 L2VuZCAoJWQvJWQpIHwgcm93X3N0YXJ0L2VuZCAoJWQvJWQpXG5cCis9PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PSBGSUxMIENPTFVNTiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09XG5cCitHbHlwaCMvVG90YWwgUmVsLlggVCAgICAgICBQb3MgTyAgIFcgICAgIENvZGUg RmFjZSBMUiAgICAgWCAgICBZIEhQT1MgVlBPUyBaViBDXG4iLAorY291bnQsIHdpbmRvd19yb3df c3RhcnQsIHdpbmRvd19yb3dfZW5kLCBwb3Nfc3RhcnQsIHBvc19lbmQpOworICAgICAgICAgIGZv ciAoOyBnbHlwaCA8IGdseXBoX2VuZDsgKytnbHlwaCkKKyAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3AgPSAob3BvaW50X3ggPT0gZmlsbF9jb2x1bW5f eAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeSA9 PSBnbHlwaC0+eQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBv cG9pbnRfaHBvcyA9PSBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0KKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3Zwb3MgPT0gdGVtcF92cG9z KTsKKyAgICAgICAgICAgICAgaWYgKHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGggPiB0 ZXh0X2FyZWFfd2lkdGgpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgaWYg KG1jX3N0ZGVycl9wKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAg ICAgZnByaW50ZiAoc3RkZXJyLCAiXG5CRVlPTkQgdGV4dF9hcmVhX3dpZHRoXG4iKTsKKyAgICAg ICAgICAgICAgICAgICAgICBtY19kdW1wX2dseXBoIChyb3csIGdseXBoLCBhcmVhLCByZWxhdGl2 ZV94KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgYnJlYWs7Cisg ICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYgKCgoaGVhZGVyX2xpbmVf Zm9ybWF0ID4gMCAmJiBjb3VudCA+IDApCisgICAgICAgICAgICAgICAgICAgICB8fCBoZWFkZXJf bGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAgICAgICAgJiYgKHJlbGF0aXZlX3ggKyBn bHlwaC0+cGl4ZWxfd2lkdGggPiBmaWxsX2NvbHVtbl94CisgICAgICAgICAgICAgICAgICAgICAg ICB8fCBnbHlwaCA9PSBnbHlwaF9lbmQgLSAxKQorICAgICAgICAgICAgICAgICAgICAmJiBnbHlw aC0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAgICAgICAgICAgJiYg IXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg ICAgICAgbWNfZW5naW5lIChyb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHcsIHBvc2ludCwgQkFSX0NVUlNPUiwgY3Vyc29yX3dpZHRo LCBmb3JlZ3JvdW5kLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBt aW5pbWFsX3AsIEZJTExfQ09MVU1OLCAmcmVzdWx0KTsKKyAgICAgICAgICAgICAgICAgICAgYnJl YWs7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmICgoKGhl YWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgY291bnQgPiAwKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgKHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGggPiBmaWxsX2NvbHVtbl94 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGggPT0gZ2x5cGhfZW5kIC0g MSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT55IDw9IHdpbmRvd190ZXh0 X2JvdHRvbV95ICh3KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcmVhbF9mYWtlX2N1 cnNvcl9wKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgaWYg KG1jX3N0ZGVycl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg ICAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJcblJFQUwgRkFLRSBDVVJTT1JcbiIpOworICAg ICAgICAgICAgICAgICAgICAgICAgICBtY19kdW1wX2dseXBoIChyb3csIGdseXBoLCBhcmVhLCBy ZWxhdGl2ZV94KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAg ICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBl bHNlIGlmIChtY19zdGRlcnJfcCkKKyAgICAgICAgICAgICAgICAgICAgICBtY19kdW1wX2dseXBo IChyb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94KTsKKyAgICAgICAgICAgICAgcmVsYXRpdmVf eCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9 CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgU0VUIFRIRSBDQUNIRQorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisgIG1jX2ZpbGxfY29s dW1uX2ZpbmlzaDoKKyAgaWYgKCFtaW5pbWFsX3AKKyAgICAgICYmIHVwZGF0aW5nX2ZyYW1lX3AK KyAgICAgICYmIGZpbGxfY29sdW1uX3ggPD0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAmJiBmaWxs X2NvbHVtbl94ID49IGxudW1fcGl4ZWxfd2lkdGgpCisgICAgdXBkYXRlX2VuZCAoWEZSQU1FICh3 LT5mcmFtZSkpOworICBpZiAoIU5JTFAgKHJlc3VsdCkpCisgICAgd3NldF9tY19maWxsX2NvbHVt bl9jYWNoZSAodywgbGlzdG4gKENPTlNUWVBFX0hFQVAsIDMsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgRnJldmVyc2UgKHJlc3VsdCksCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgRmNvbnMgKHdpbmRvdywgUW5pbCksCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgRmNvbnMgKHctPmNvbnRlbnRzLCBRbmlsKSkpOworICB3LT5t Yy5kcmF3X2ZpbGxfY29sdW1uID0gZmFsc2U7CisgIGlmIChvbGRfYnVmZmVyKQorICAgIHNldF9i dWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworLyoKKyNpZmRlZiBHTFlQSF9ERUJVRworICBl bmQgPSBjbG9jaygpOworICBjcHVfdGltZV91c2VkID0gKChkb3VibGUpIChlbmQgLSBzdGFydCkp IC8gQ0xPQ0tTX1BFUl9TRUM7CisgIGR0b2FzdHIgKGJ1Zl90aW1lLCBzaXplb2YgYnVmX3RpbWUs IDAsIDAsIGNwdV90aW1lX3VzZWQpOworICBkZWJ1Z19tZXRob2RfYWRkICh3LCAibWNfZHJhd19m aWxs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cisg ICAgICB2cG9zID0gWEZJWE5VTSAoRm50aCAobWFrZV9maXhudW0gKDUpLCBmaWZ0ZWVuX2VsZW1l bnRzKSk7CisgICAgICBoID0gWEZJWE5VTSAoRm50aCAobWFrZV9maXhudW0gKDYpLCBmaWZ0ZWVu X2VsZW1lbnRzKSk7CisgICAgICBjdXJzb3JfdHlwZSA9IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUg KEZudGggKG1ha2VfZml4bnVtICg3KSwgZmlmdGVlbl9lbGVtZW50cykpOworICAgICAgY3Vyc29y X3dpZHRoID0gWEZJWE5VTSAoRm50aCAobWFrZV9maXhudW0gKDgpLCBmaWZ0ZWVuX2VsZW1lbnRz KSk7CisgICAgICBmb3JlZ3JvdW5kID0gRm50aCAobWFrZV9maXhudW0gKDkpLCBmaWZ0ZWVuX2Vs ZW1lbnRzKTsKKyAgICAgIGJhY2tncm91bmQgPSBGbnRoIChtYWtlX2ZpeG51bSAoMTApLCBmaWZ0 ZWVuX2VsZW1lbnRzKTsKKyAgICAgIGFjdGl2ZV9wID0gWEZJWE5VTSAoRm50aCAobWFrZV9maXhu dW0gKDExKSwgZmlmdGVlbl9lbGVtZW50cykpOworICAgICAgbWluaW1hbF9wID0gWEZJWE5VTSAo Rm50aCAobWFrZV9maXhudW0gKDEyKSwgZmlmdGVlbl9lbGVtZW50cykpOworICAgICAgZmxhdm9y ID0gWEZJWE5VTSAoRm50aCAobWFrZV9maXhudW0gKDEzKSwgZmlmdGVlbl9lbGVtZW50cykpOwor ICAgICAgcG9zaW50ID0gWEZJWE5VTSAoRm50aCAobWFrZV9maXhudW0gKDE0KSwgZmlmdGVlbl9l bGVtZW50cykpOworICAgICAgYm9vbCByZW1vdmVfcCA9IGZhbHNlOworICAgICAgbWNfZHJhd19l cmFzZV9oeWJyaWQgKHcsIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgaCwgY3Vyc29yX3R5cGUs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc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mlt YWxfcCA9IGZhbHNlOworICBpbnQgZmxhdm9yOworICBwdHJkaWZmX3QgcG9zaW50OworICBib29s IHVwZGF0aW5nX2ZyYW1lX3AgPSBmYWxzZTsKKyAgaWYgKFhGUkFNRSAody0+ZnJhbWUpICE9IFhG UkFNRSAody0+ZnJhbWUpLT5tY191cGRhdGluZ19mcmFtZSkKKyAgICB7CisgICAgICB1cGRhdGlu Z19mcmFtZV9wID0gdHJ1ZTsKKyAgICAgIHVwZGF0ZV9iZWdpbiAoWEZSQU1FICh3LT5mcmFtZSkp OworICAgIH0KKyAgZm9yICh2bGlzdCA9IFhDQVIgKHctPm1jX2ZpbGxfY29sdW1uX2NhY2hlKTsK KyAgICAgICBDT05TUCAodmxpc3QpOworICAgICAgIHZsaXN0ID0gWENEUiAodmxpc3QpKQorICAg IHsKKyAgICAgIGZpZnRlZW5fZWxlbWVudHMgPSBYQ0FSICh2bGlzdCk7CisgICAgICB4ID0gWEZJ WE5VTSAoRm50aCAobWFrZV9maXhudW0gKDApLCBmaWZ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICBm eCA9IFhGSVhOVU0gKEZudGggKG1ha2VfZml4bnVtICgxKSwgZmlmdGVlbl9lbGVtZW50cykpOwor ICAgICAgeSA9IFhGSVhOVU0gKEZudGggKG1ha2VfZml4bnVtICgyKSwgZmlmdGVlbl9lbGVtZW50 cykpOworICAgICAgZnkgPSBYRklYTlVNIChGbnRoIChtYWtlX2ZpeG51bSAoMyksIGZpZnRlZW5f ZWxlbWVudHMpKTsKKyAgICAgIGhwb3MgPSBYRklYTlVNIChGbnRoIChtYWtlX2ZpeG51bSAoNCks IGZpZnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIHZwb3MgPSBYRklYTlVNIChGbnRoIChtYWtlX2Zp eG51bSAoNSksIGZpZnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIGggPSBYRklYTlVNIChGbnRoICht YWtlX2ZpeG51bSAoNiksIGZpZnRlZW5fZWxlbWVudHMpKT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l90eXBl LCB3LT5waHlzX2N1cnNvcl93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZmxhdm9y KTsKKyAgZm9yICh2bGlzdCA9IFhDQVIgKHctPm11bHRpcGxlX2N1cnNvcnNfY2FjaGUpOworICAg ICAgIENPTlNQICh2bGlzdCk7CisgICAgICAgdmxpc3QgPSBYQ0RSICh2bGlzdCkpCisgICAgewor ICAgICAgZmlmdGVlbl9lbGVtZW50cyA9IFhDQVIgKHZsaXN0KTsKKyAgICAgIHggPSBYRklYTlVN IChGbnRoIChtYWtlX2ZpeG51bSAoMCksIGZpZnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIGZ4ID0g WEZJWE5VTSAoRm50aCAobWFrZV9maXhudW0gKDEpLCBmaWZ0ZWVuX2VsZW1lbnRzKSk7CisgICAg ICB5ID0gWEZJWE5VTSAoRm50aCAobWFrZV9maXhudW0gKDIpLCBmaWZ0ZWVuX2VsZW1lbnRzKSk7 CisgICAgICBmeSA9IFhGSVhOVU0gKEZudGggKG1ha2VfZml4bnVtICgzKSwgZmlmdGVlbl9lbGVt ZW50cykpOworICAgICAgaHBvcyA9IFhGSVhOVU0gKEZudGggKG1ha2VfZml4bnVtICg0KSwgZmlm dGVlbl9lbGVtZW50cykpOworICAgICAgdnBvcyA9IFhGSVhOVU0gKEZudGggKG1ha2VfZml4bnVt ICg1KSwgZmlmdGVlbl9lbGVtZW50cykpOworICAgICAgaCA9IFhGSVhOVU0gKEZudGggKG1ha2Vf Zml4bnVtICg2KSwgZmlmdGVlbl9lbGVtZW50cykpOworICAgICAgY3Vyc29yX3R5cGUgPSBtY19s aXNwX3RvX2N1cnNvcl90eXBlIChGbnRoIChtYWtlX2ZpeG51bSAoNyksIGZpZnRlZW5fZWxlbWVu dHMpKTsKKyAgICAgIGN1cnNvcl93aWR0aCA9IFhGSVhOVU0gKEZudGggKG1ha2VfZml4bnVtICg4 KSwgZmlmdGVlbl9lbGVtZW50cykpOworICAgICAgZm9yZWdyb3VuZCA9IEZudGggKG1ha2VfZml4 bnVtICg5KSwgZmlmdGVlbl9lbGVtZW50cyk7CisgICAgICBiYWNrZ3JvdW5kID0gRm50aCAobWFr ZV9maXhudW0gKDEwKSwgZmlmdGVlbl9lbGVtZW50cyk7CisgICAgICBhY3RpdmVfcCA9IFhGSVhO VU0gKEZudGggKG1ha2VfZml4bnVtICgxMSksIGZpZnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIG1p bmltYWxfcCA9IFhGSVhOVU0gKEZudGggKG1ha2VfZml4bnVtICgxMiksIGZpZnRlZW5fZWxlbWVu dHMpKTsKKyAgICAgIGZsYXZvciA9IFhGSVhOVU0gKEZudGggKG1ha2VfZml4bnVtICgxMyksIGZp ZnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIHBvc2ludCA9IFhGSVhOVU0gKEZudGggKG1ha2VfZml4 bnVtICgxNCksIGZpZnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIGJvb2wgcmVtb3ZlX3AgPSB0cnVl OworICAgICAgaWYgKGZsYXZvciA9PSBNQ19HTFlQSCkKKyAgICAgICAgbWNfZXJhc2VfZ2x5cGhf Y3Vyc29ycyAodywgeCwgeSwgaHBvcywgdnBvcywgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwg Zmxhdm9yKTsKKyAgICAgICAgZWxzZQorICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3 LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIGgsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIGJhY2tncm91bmQsIGFjdGl2ZV9wLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtaW5pbWFsX3AsIGZsYXZvciwgcG9zaW50 LCByZW1vdmVfcCk7CisgICAgfQorICBpZiAodXBkYXRpbmdfZnJhbWVfcCkKKyAgICB1cGRhdGVf ZW5kIChYRlJBTUUgKHctPm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mcgPSBGcHJp bjFfdG9fc3RyaW5nICh3aW5kb3csIFFuaWwpOworICAgICAgY2hhciAqd2luZG93X2NoYXIgPSBT U0RBVEEgKHdpbmRvd19zdHJpbmcpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZXJhc2Vf Y3Jvc3NoYWlycyAoJXMpOiAgZGVsZXRlX2NhY2hlICglZClcbiIsCisgICAgICAgICAgICAgICAg ICAgICAgIHdpbmRvd19jaGFyLCBkZWxldGVfY2FjaGUpOworICAgIH0KKyNlbmRpZgorICBMaXNw X09iamVjdCB2bGlzdCA9IFFuaWw7CisgIExpc3BfT2JqZWN0IGZpZnRlZW5fZWxlbWVudHMgPSBR bmlsOworICBpbnQgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCBoOworICBlbnVtIHRleHRfY3Vy c29yX2tpbmRzIGN1cnNvcl90eXBlOworICBpbnQgY3Vyc29yX3dpZHRoOworICBMaXNwX09iamVj dCBmb3JlZ3JvdW5kID0gUW5pbDsKKyAgTGlzcF9PYmplY3QgYmFja2dyb3VuZCA9IFFuaWw7Cisg IGJvb2wgYWN0aXZlX3AgPSBmYWxzZTsKKyAgaW50IGZsYXZvciA9IE5PX0ZMQVZPUjsKKyAgcHRy ZGlmZl90IHBvc2ludDsKKyAgYm9vbCB1cGRhdGluZ19mcmFtZV9wID0gZmFsc2U7CisgIGlmIChY RlJBTUUgKHctPmZyYW1lKSAhPSBYRlJBTUUgKHctPmZyYW1lKS0+bWNfdXBkYXRpbmdfZnJhbWUp CisgICAgeworICAgICAgdXBkYXRpbmdfZnJhbWVfcCA9IHRydWU7CisgICAgICB1cGRhdGVfYmVn aW4gKFhGUkFNRSAody0+ZnJhbWUpKTsKKyAgICB9CisgIGlmICghbWluaW1hbF9wKQorICAgIG1j X2VyYXNlX2dseXBoX2N1cnNvcnMgKHcsIHctPnBoeXNfY3Vyc29yLngsIHctPnBoeXNfY3Vyc29y LnksIHctPnBoeXNfY3Vyc29yLmhwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+ cGh5c19jdXJzb3IudnBvcywgdy0+cGh5c19jdXJzb3JfdHlwZSwgdy0+cGh5c19jdXJzb3Jfd2lk dGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxhdm9yKTsKKyAgZm9yICh2bGlzdCA9 IFhDQVIgKHctPmNyb3NzaGFpcnNfY2FjaGUpOworICAgICAgIENPTlNQICh2bGlzdCk7CisgICAg ICAgdmxpc3QgPSBYQ0RSICh2bGlzdCkpCisgICAgeworICAgICAgZmlmdGVlbl9lbGVtZW50cyA9 IFhDQVIgKHZsaXN0KTsKKyAgICAgIHggPSBYRklYTlVNIChGbnRoIChtYWtlX2ZpeG51bSAoMCks IGZpZnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIGZ4ID0gWEZJWE5VTSAoRm50aCAobWFrZV9maXhu dW0gKDEpLCBmaWZ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICB5ID0gWEZJWE5VTSAoRm50aCAobWFr ZV9maXhudW0gKDIpLCBmaWZ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICBmeSA9IFhGSVhOVU0gKEZu dGggKG1ha2VfZml4bnVtICgzKSwgZmlmdGVlbl9lbGVtZW50cykpOworICAgICAgaHBvcyA9IFhG SVhOVU0gKEZudGggKG1ha2VfZml4bnVtICg0KSwgZmlmdGVlbl9lbGVtZW50cykpOworICAgICAg dnBvcyA9IFhGSVhOVU0gKEZudGggKG1ha2VfZml4bnVtICg1KSwgZmlmdGVlbl9lbGVtZW50cykp OworICAgICAgaCA9IFhGSVhOVU0gKEZudGggKG1ha2VfZml4bnVtICg2KSwgZmlmdGVlbl9lbGVt ZW50cykpOworICAgICAgY3Vyc29yX3R5cGUgPSBtY19saXNwX3RvX2N1cnNvcl90eXBlIChGbnRo IChtYWtlX2ZpeG51bSAoNyksIGZpZnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIGN1cnNvcl93aWR0 aCA9IFhGSVhOVU0gKEZudGggKG1ha2VfZml4bnVtICg4KSwgZmlmdGVlbl9lbGVtZW50cykpOwor ICAgICAgZm9yZWdyb3VuZCA9IEZudGggKG1ha2VfZml4bnVtICg5KSwgZmlmdGVlbl9lbGVtZW50 cyk7CisgICAgICBiYWNrZ3JvdW5kID0gRm50aCAobWFrZV9maXhudW0gKDEwKSwgZmlmdGVlbl9l bGVtZW50cyk7CisgICAgICBhY3RpdmVfcCA9IFhGSVhOVU0gKEZudGggKG1ha2VfZml4bnVtICgx MSksIGZpZnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIG1pbmltYWxfcCA9IFhGSVhOVU0gKEZudGgg KG1ha2VfZml4bnVtICgxMiksIGZpZnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIGZsYXZvciA9IFhG SVhOVU0gKEZudGggKG1ha2VfZml4bnVtICgxMyksIGZpZnRlZW5fZWxlbWVudHMpKTsKKyAgICAg IHBvc2ludCA9IFhGSVhOVU0gKEZudGggKG1ha2VfZml4bnVtICgxNCksIGZpZnRlZW5fZWxlbWVu dHMpKTsKKyAgICAgIGJvb2wgcmVtb3ZlX3AgPSB0cnVlOworICAgICAgaWYgKGZsYXZvciA9PSBN Q19HTFlQSCkKKyAgICAgICAgbWNfZXJhc2VfZ2x5cGhfY3Vyc29ycyAodywgeCwgeSwgaHBvcywg dnBvcywgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZmxhdm9yKTsKKyAgICAgICAgZWxzZQor ICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZw b3MsIGgsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJz b3Jfd2lkdGgsIGJhY2tncm91bmQsIGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBtaW5pbWFsX3AsIGZsYXZvciwgcG9zaW50LCByZW1vdmVfcCk7CisgICAgfQorICBp ZiAod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ICAgICBDT05TUCAodmxpc3QpOworICAgICAgIHZsaXN0ID0gWENEUiAodmxpc3QpKQorICAgIHsK KyAgICAgIGZpZnRlZW5fZWxlbWVudHMgPSBYQ0FSICh2bGlzdCk7CisgICAgICB4ID0gWEZJWE5V TSAoRm50aCAobWFrZV9maXhudW0gKDApLCBmaWZ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICBmeCA9 IFhGSVhOVU0gKEZudGggKG1ha2VfZml4bnVtICgxKSwgZmlmdGVlbl9lbGVtZW50cykpOworICAg ICAgeSA9IFhGSVhOVU0gKEZudGggKG1ha2VfZml4bnVtICgyKSwgZmlmdGVlbl9lbGVtZW50cykp OworICAgICAgZnkgPSBYRklYTlVNIChGbnRoIChtYWtlX2ZpeG51bSAoMyksIGZpZnRlZW5fZWxl bWVudHMpKTsKKyAgICAgIGhwb3MgPSBYRklYTlVNIChGbnRoIChtYWtlX2ZpeG51bSAoNCksIGZp ZnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIHZwb3MgPSBYRklYTlVNIChGbnRoIChtYWtlX2ZpeG51 bSAoNSksIGZpZnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIGggPSBYRklYTlVNIChGbnRoIChtYWtl X2ZpeG51bSAoNiksIGZpZnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIGN1cnNvcl90eXBlID0gbWNf bGlzcF90b19jdXJzb3JfdHlwZSAoRm50aCAobWFrZV9maXhudW0gKDcpLCBmaWZ0ZWVuX2VsZW1l bnRzKSk7CisgICAgICBjdXJzb3Jfd2lkdGggPSBYRklYTlVNIChGbnRoIChtYWtlX2ZpeG51bSAo OCksIGZpZnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIGZvcmVncm91bmQgPSBGbnRoIChtYWtlX2Zp eG51bSAoOSksIGZpZnRlZW5fZWxlbWVudHMpOworICAgICAgYmFja2dyb3VuZCA9IEZudGggKG1h a2VfZml4bnVtICgxMCksIGZpZnRlZW5fZWxlbWVudHMpOworICAgICAgYW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HNlOworLyoKKyNpZmRlZiBHTFlQSF9ERUJVRworICBlbmQgPSBjbG9jaygpOworICBj cHVfdGltZV91c2VkID0gKChkb3VibGUpIChlbmQgLSBzdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7 CisgIGR0b2FzdHIgKGJ1Zl90aW1lLCBzaXplb2YgYnVmX3RpbWUsIDAsIDAsIGNwdV90aW1lX3Vz ZWQpOworICBkZWJ1Z19tZXRob2RfYWRkICh3LCAibWNfZXJhc2VfZmlsbF9jb2x1bW46ICBUSU1F ICglcykiLCBidWZfdGltZSk7CisjZW5kaWYKKyovCit9CisKK3ZvaWQKK21jX3JlbW92ZV9tdWx0 aXBsZV9jdXJzb3JzIChzdHJ1Y3Qgd2luZG93ICp3KQoreworICBib29sIGRlbGV0ZV9jYWNoZSA9 ICh3LT5tYy5yZWRpc3BsYXlfcHJlc2VydmVfZWNob19hcmVhID09IDgKKyAgICAgICAgICAgICAg ICAgICAgICAgfHwgbWNfcmVkaXNwbGF5ID09IDMpCisgICAgICAgICAgICAgICAgICAgICAgPyBm YWxzZQorICAgICAgICAgICAgICAgICAgICAgIDogdHJ1ZTsKKyNpZmRlZiBHTFlQSF9ERUJVRwor ICBpZiAodHJhY2VfcmVkaXNwbGF5X3AKKyAgICAgICYmIEJVRkZFUlAgKHctPmNvbnRlbnRzKQor ICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbXVsdGlwbGVfY3Vy c29yc19jb25mKSkpCisgICAgeworICAgICAgTGlzcF9PYmplY3Qgd2luZG93OworICAgICAgWFNF VFdJTkRPVyAod2luZG93LCB3KTsKKyAgICAgIExpc3BfT2JqZWN0IHdpbmRvd19zdHJpbmcgPSBG cHJpbjFfdG9fc3RyaW5nICh3aW5kb3csIFFuaWwpOworICAgICAgY2hhciAqd2luZG93X2NoYXIg PSBTU0RBVEEgKHdpbmRvd19zdHJpbmcpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAibW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2wgZGVsZXRlX2NhY2hlID0gKCh3LT5tYy5yZWRpc3BsYXlfcHJlc2Vy dmVfZWNob19hcmVhID09IDgKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8IG1jX3JlZGlzcGxh eSA9PSAzKQorICAgICAgICAgICAgICAgICAgICAgICAmJiAhdy0+bWMuZHJhd19jcm9zc2hhaXJz CisgICAgICAgICAgICAgICAgICAgICAgICYmICF3LT5tYy5lcmFzZV9jcm9zc2hhaXJzKQorICAg ICAgICAgICAgICAgICAgICAgID8gZmFsc2UKKyAgICAgICAgICAgICAgICAgICAgICA6IHRydWU7 CisjaWZkZWYgR0xZUEhfREVCVUcKKyAgaWYgKHRyYWNlX3JlZGlzcGxheV9wCisgICAgICAmJiBC VUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICB7CisgICAgICBMaXNwX09iamVjdCB3aW5kb3c7 CisgICAgICBYU0VUV0lORE9XICh3aW5kb3csIHcpOworICAgICAgTGlzcF9PYmplY3Qgd2luZG93 X3N0cmluZyA9IEZwcmluMV90b19zdHJpbmcgKHdpbmRvdywgUW5pbCk7CisgICAgICBjaGFyICp3 aW5kb3dfY2hhciA9IFNTREFUQSAod2luZG93X3N0cmluZyk7CisgICAgICBmcHJpbnRmIChzdGRl cnIsICJtY19yZW1vdmVfY3Jvc3NoYWlycyAoJXMpOiAgZGVsZXRlX2NhY2hlICglZClcbiIsCisg ICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3dfY2hhciwgZGVsZXRlX2NhY2hlKTsKKyAgICB9 CisjZW5kaWYKKyAgLyogUmVtb3ZlIGZha2UgY3Vyc29ycy4gIElmIHdlIHJlbHkgdXBvbiBgdXBk YXRlX2ZyYW1lJyB0byByZW1vdmUgZmFrZSBjdXJzb3JzLAorICB0aGVuIGl0IHdvdWxkIGJlIHRv byBsYXRlIHRvIHJlbW92ZSBmYWtlIGN1cnNvcnMgZnJvbSBhbGwgYXJlYXMgb2YgdGhlIHZpc2li bGUKKyAgd2luZG93IHdoZW4gY3V0dGluZy9wYXN0aW5nIHRleHQgYW5kIHBlcmhhcHMgYSBmZXcg b3RoZXIgc2l0dWF0aW9ucy4gKi8KKyAgaWYgKCF3LT5wc2V1ZG9fd2luZG93X3AKKyAgICAgICYm ICFNSU5JX1dJTkRPV19QICh3KQorICAgICAgJiYgIU5JTFAgKHctPmNyb3NzaGFpcnNfY2FjaGUp CisgICAgICAmJiBXSU5ET1dQIChYQ0FSIChGbnRoIChtYWtlX2ZpeG51bSAoMSksIHctPmNyb3Nz aGFpcnNfY2FjaGUpKSkKKyAgICAgICYmIHcgPT0gWFdJTkRPVyAoWENBUiAoRm50aCAobWFrZV9m aXhudW0gKDEpLCB3LT5jcm9zc2hhaXJzX2NhY2hlKSkpCisgICAgICAmJiBFUSAody0+Y29udGVu dHMsIFhDQVIgKEZudGggKG1ha2VfZml4bnVtICgyKSwgdy0+Y3Jvc3NoYWlyc19jYWNoZSkpKSkK KyAgICB7CisgICAgICBib29sIG1pbmltYWxfcCA9IGZhbHNlOworICAgICAgbWNfZXJhc2VfY3Jv c3NoYWlycyAodywgZGVsZXRlX2NhY2hlLCBtaW5pbWFsX3ApOworICAgIH0KK30KKwordm9pZAor bWNfcmVtb3ZlX2ZpbGxfY29sdW1uIChzdHJ1Y3Qgd2luZG93ICp3KQoreworICBib29sIGRlbGV0 ZV9jYWNoZSA9ICgody0+bWMucmVkaXNwbGF5X3ByZXNlcnZlX2VjaG9fYXJlYSA9PSA4CisgICAg ICAgICAgICAgICAgICAgICAgICB8fCBtY19yZWRpc3BsYXkgPT0gMykKKyAgICAgICAgICAgICAg ICAgICAgICAgJiYgIXctPm1jLmRyYXdfZmlsbF9jb2x1bW4KKyAgICAgICAgICAgICAgICAgICAg ICAgJiYgIXctPm1jLmVyYXNlX2ZpbGxfY29sdW1uKQorICAgICAgICAgICAgICAgICAgICAgID8g ZmFsc2UKKyAgICAgICAgICAgICAgICAgICAgICA6IHRydWU7CisjaWZkZWYgR0xZUEhfREVCVUcK KyAgaWYgKHRyYWNlX3JlZGlzcGxheV9wCisgICAgICAmJiBCVUZGRVJQICh3LT5jb250ZW50cykK KyAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2ZpbGxfY29s dW1uKSkpCisgICAgeworICAgICAgTGlzcF9PYmplY3Qgd2luZG93OworICAgICAgWFNFVFdJTkRP VyAod2luZG93LCB3KTsKKyAgICAgIExpc3BfT2JqZWN0IHdpbmRvd19zdHJpbmcgPSBGcHJpbjFf dG9fc3RyaW5nICh3aW5kb3csIFFuaWwpOworICAgICAgY2hhciAqd2luZG93X2NoYXIgPSBTU0RB VEEgKHdpbmRvd19zdHJpbmcpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfcmVtb3ZlX2Zp bGxfY29sdW1uICglcyk6ICBkZWxldGVfY2FjaGUgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAg ICAgICAgIHdpbmRvd19jaGFyLCBkZWxldGVfY2FjaGUpOworICAgIH0KKyNlbmRpZgorICAvKiBS ZW1vdmUgZmFrZSBjdXJzb3JzLiAgSWYgd2UgcmVseSB1cG9uIGB1cGRhdGVfZnJhbWUnIHRvIHJl bW92ZSBmYWtlIGN1cnNvcnMsCisgIHRoZW4gaXQgd291bGQgYmUgdG9vIGxhdGUgdG8gcmVtb3Zl IGZha2UgY3Vyc29ycyBmcm9tIGFsbCBhcmVhcyBvZiB0aGUgdmlzaWJsZQorICB3aW5kb3cgd2hl biBjdXR0aW5nL3Bhc3RpbmcgdGV4dCBhbmQgcGVyaGFwcyBhIGZldyBvdGhlciBzaXR1YXRpb25z LiAqLworICBpZiAoIXctPnBzZXVkb193aW5kb3dfcAorICAgICAgJiYgIU1JTklfV0lORE9XX1Ag KHcpCisgICAgICAmJiAhTklMUCAody0+bWNfZmlsbF9jb2x1bW5fY2FjaGUpCisgICAgICAmJiBX SU5ET1dQIChYQ0FSIChGbnRoIChtYWtlX2ZpeG51bSAoMSksIHctPm1jX2ZpbGxfY29sdW1uX2Nh Y2hlKSkpCisgICAgICAmJiB3ID09IFhXSU5ET1cgKFhDQVIgKEZudGggKG1ha2VfZml4bnVtICgx KSwgdy0+bWNfZmlsbF9jb2x1bW5fY2FjaGUpKSkKKyAgICAgICYmIEVRICh3LT5jb250ZW50cywg WENBUiAoRm50aCAobWFrZV9maXhudW0gKDIpLCB3LT5tY19maWxsX2NvbHVtbl9jYWNoZSkpKSkK KyAgICBtY19lcmFzZV9maWxsX2NvbHVtbiAodywgZGVsZXRlX2NhY2hlKTsKK30KKwordm9pZAor bWNfbXVsdGlwbGVfY3Vyc29yc19wb3J0YWwgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgb24sIGJv b2wgYWN0aXZlX3ApCit7CisjaWZkZWYgR0xZUEhfREVCVUcKKyAgaWYgKHRyYWNlX3JlZGlzcGxh eV9wCisgICAgICAmJiBCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICYmICFOSUxQIChCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIG11bHRpcGxlX2N1cnNvcnNfY29uZikpKQorICAgIHsK KyAgICAgIExpc3BfT2JqZWN0IHdpbmRvdzsKKyAgICAgIFhTRVRXSU5ET1cgKHdpbmRvdywgdyk7 CisgICAgICBMaXNwX09iamVjdCB3aW5kb3dfc3RyaW5nID0gRnByaW4xX3RvX3N0cmluZyAod2lu ZG93LCBRbmlsKTsKKyAgICAgIGNoYXIgKndpbmRvd19jaGFyID0gU1NEQVRBICh3aW5kb3dfc3Ry aW5nKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX211bHRpcGxlX2N1cnNvcnNfcG9ydGFs ICglcyk6ICBvbiAoJWQpIHwgYWN0aXZlX3AgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAg ICAgIHdpbmRvd19jaGFyLCBvbiwgYWN0aXZlX3ApOworICAgIH0KKyNlbmRpZgorICBib29sIG1p bmltYWxfcCA9ICghdy0+bWMuZHJhd19tdWx0aXBsZV9jdXJzb3JzCisgICAgICAgICAgICAgICAg ICAgICYmIG1jX3JlZGlzcGxheV9wcmVzZXJ2ZV9lY2hvX2FyZWEgIT0gOAorICAgICAgICAgICAg ICAgICAgICAmJiBtY19yZWRpc3BsYXkgIT0gMworICAgICAgICAgICAgICAgICAgICAmJiB3ID09 IFhXSU5ET1cgKHNlbGVjdGVkX3dpbmRvdykKKyAgICAgICAgICAgICAgICAgICAgJiYgTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtdWx0aXBsZV9jdXJzb3JzX2RyYXdfZm9ydGh3 aXRoKSkpOworICBpZiAody0+bWMuZXJhc2VfbXVsdGlwbGVfY3Vyc29ycyAmJiB3LT5tYy5kcmF3 X211bHRpcGxlX2N1cnNvcnMKKyAgICAgICYmICFNSU5JX1dJTkRPV19QICh3KQorICAgICAgJiYg IU5JTFAgKHctPm11bHRpcGxlX2N1cnNvcnNfY2FjaGUpCisgICAgICAmJiBXSU5ET1dQIChYQ0FS IChGbnRoIChtYWtlX2ZpeG51bSAoMSksIHctPm11bHRpcGxlX2N1cnNvcnNfY2FjaGUpKSkKKyAg ICAgICYmIHcgPT0gWFdJTkRPVyAoWENBUiAoRm50aCAobWFrZV9maXhudW0gKDEpLCB3LT5tdWx0 aXBsZV9jdXJzb3JzX2NhY2hlKSkpCisgICAgICAmJiBFUSAody0+Y29udGVudHMsIFhDQVIgKEZu dGggKG1ha2VfZml4bnVtICgyKSwgdy0+bXVsdGlwbGVfY3Vyc29yc19jYWNoZSkpKSkKKyAgICBt Y19lcmFzZV9tdWx0aXBsZV9jdXJzb3JzICh3LCB0cnVlKTsKKyAgLyogYHctPm11bHRpcGxlX2N1 cnNvcnNfY2FjaGVgIGJlbG9uZ3MgdG8gdGhlIHdpbmRvdywgbm90IHRoZSBidWZmZXIuICBTd2l0 Y2hpbmcKKyAgYnVmZmVycyB3aXRoaW4gdGhlIHNhbWUgd2luZG93IHJlbmRlcnMgdGhlIGNhY2hl IHVzZWxlc3MuICovCisgIGlmICghTUlOSV9XSU5ET1dfUCAodykKKyAgICAgICYmICFOSUxQICh3 LT5tdWx0aXBsZV9jdXJzb3JzX2NhY2hlKQorICAgICAgJiYgV0lORE9XUCAoWENBUiAoRm50aCAo bWFrZV9maXhudW0gKDEpLCB3LT5tdWx0aXBsZV9jdXJzb3JzX2NhY2hlKSkpCisgICAgICAmJiB3 ID09IFhXSU5ET1cgKFhDQVIgKEZudGggKG1ha2VfZml4bnVtICgxKSwgdy0+bXVsdGlwbGVfY3Vy c29yc19jYWNoZSkpKQorICAgICAgJiYgIUVRICh3LT5jb250ZW50cywgWENBUiAoRm50aCAobWFr ZV9maXhudW0gKDIpLCB3LT5tdWx0aXBsZV9jdXJzb3JzX2NhY2hlKSkpKQorICAgIHsKKyAgICAg IHdzZXRfbXVsdGlwbGVfY3Vyc29yc19jYWNoZSAodywgUW5pbCk7CisgICAgICB3LT5tYy5lcmFz ZV9tdWx0aXBsZV9jdXJzb3JzID0gZmFsc2U7CisgICAgfQorICBpZiAob24KKyAgICAgICYmICFN SU5JX1dJTkRPV19QICh3KQorICAgICAgJiYgKHcgPT0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93 KQorICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG11bHRp cGxlX2N1cnNvcnNfaW5hY3RpdmVfd2luZG93cykpKQorICAgICAgJiYgTklMUCAody0+bXVsdGlw bGVfY3Vyc29yc19jYWNoZSkKKyAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIG11bHRpcGxlX2N1cnNvcnNfY29uZikpKQorICAgIG1jX2RyYXdfbXVsdGlwbGVfY3Vy c29ycyAodywgYWN0aXZlX3AsIG1pbmltYWxfcCk7CisgICAgZWxzZSBpZiAob24KKyAgICAgICAg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GVfZnJhbWUnIDIgb2YgMy4KKyAgRW1h Y3MgcmVmcmVzaGVzIHRoZSBzZWxlY3RlZCB3aW5kb3cgYWZ0ZXIgYWJvdXQgMSB0byAyIG1pbnV0 ZXMgb2Ygbm8gYWN0aXZpdHkKKyAgZXZlbiB0aG91Z2ggdGhlcmUgaXMgbm90aGluZyBhdHRhY2hl ZCB0byB0aGUgYHRpbWVfbGlzdCcvYGlkbGVfdGltZXJfbGlzdCcuCisgIEluIHRoYXQgcmVmcmVz aCBuby10aW1lciBzaXR1YXRpb24sIHdlIHdhbnQgdG8gZXJhc2UvZHJhdyB1c2luZyB0aGUgY2Fj aGUuICovCisjaWZkZWYgR0xZUEhfREVCVUcKKyAgaWYgKHRyYWNlX3JlZGlzcGxheV9wCisgICAg ICAmJiBCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICB7CisgICAgICBMaXNwX09iamVjdCB3 aW5kb3c7CisgICAgICBYU0VUV0lORE9XICh3aW5kb3csIHcpOworICAgICAgTGlzcF9PYmplY3Qg d2luZG93X3N0cmluZyA9IEZwcmluMV90b19zdHJpbmcgKHdpbmRvdywgUW5pbCk7CisgICAgICBj aGFyICp3aW5kb3dfY2hhciA9IFNTREFUQSAod2luZG93X3N0cmluZyk7CisgICAgICBmcHJpbnRm IChzdGRlcnIsICJtY19jcm9zc2hhaXJzX3BvcnRhbCAoJXMpOiAgb24gKCVkKSB8IGFjdGl2ZV9w ICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3dfY2hhciwgb24sIGFjdGl2 ZV9wKTsKKyAgICB9CisjZW5kaWYKKyAgYm9vbCBtaW5pbWFsX3AgPSAoIXctPm1jLmRyYXdfY3Jv c3NoYWlycworICAgICAgICAgICAgICAgICAgICAmJiBtY19yZWRpc3BsYXlfcHJlc2VydmVfZWNo b19hcmVhICE9IDgKK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KDEpLCB3LT5jcm9z c2hhaXJzX2NhY2hlKSkpCisgICAgICAmJiB3ID09IFhXSU5ET1cgKFhDQVIgKEZudGggKG1ha2Vf Zml4bnVtICgxKSwgdy0+Y3Jvc3NoYWlyc19jYWNoZSkpKQorICAgICAgJiYgIUVRICh3LT5jb250 ZW50cywgWENBUiAoRm50aCAobWFrZV9maXhudW0gKDIpLCB3LT5jcm9zc2hhaXJzX2NhY2hlKSkp KQorICAgIHsKKyAgICAgIHdzZXRfY3Jvc3NoYWlyc19jYWNoZSAodywgUW5pbCk7CisgICAgICB3 LT5tYy5lcmFzZV9jcm9zc2hhaXJzID0gZmFsc2U7CisgICAgfQorICBpZiAob24KKyAgICAgICYm ICFNSU5JX1dJTkRPV19QICh3KQorICAgICAgJiYgKHcgPT0gWFdJTkRPVyAoc2VsZWN0ZWRfd2lu ZG93KQorICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNy b3NzaGFpcnNfaW5hY3RpdmVfd2luZG93cykpKQorICAgICAgJiYgTklMUCAody0+Y3Jvc3NoYWly c19jYWNoZSkKKyAgICAgICYmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBj cm9zc2hhaXJzKSkpKQorICAgIG1jX2RyYXdfY3Jvc3NoYWlycyAodywgYWN0aXZlX3AsIG1pbmlt YWxfcCk7CisgICAgZWxzZSBpZiAob24KKyAgICAgICAgICAgICAmJiAhTUlOSV9XSU5ET1dfUCAo dykKKyAgICAgICAgICAgICAmJiAhTklMUCAody0+Y3Jvc3NoYWlyc19jYWNoZSkKKyAgICAgICAg ICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkK KyAgICAgICAgICAgICAmJiBXSU5ET1dQIChYQ0FSIChGbnRoIChtYWtlX2ZpeG51bSAoMSksIHct PmNyb3NzaGFpcnNfY2FjaGUpKSkKKyAgICAgICAgICAgICA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SBj YWNoZS4gKi8KKyNpZmRlZiBHTFlQSF9ERUJVRworICBpZiAodHJhY2VfcmVkaXNwbGF5X3AKKyAg ICAgICYmIEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZG RVIgKHctPmNvbnRlbnRzKSwgbWNfZmlsbF9jb2x1bW4pKSkKKyAgICB7CisgICAgICBMaXNwX09i amVjdCB3aW5kb3c7CisgICAgICBYU0VUV0lORE9XICh3aW5kb3csIHcpOworICAgICAgTGlzcF9P YmplY3Qgd2luZG93X3N0cmluZyA9IEZwcmluMV90b19zdHJpbmcgKHdpbmRvdywgUW5pbCk7Cisg ICAgICBjaGFyICp3aW5kb3dfY2hhciA9IFNTREFUQSAod2luZG93X3N0cmluZyk7CisgICAgICBm cHJpbnRmIChzdGRlcnIsICJtY19maWxsX2NvbHVtbl9wb3J0YWwgKCVzKTogIG9uICglZCkgfCBh Y3RpdmVfcCAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93X2NoYXIsIG9u LCBhY3RpdmVfcCk7CisgICAgfQorI2VuZGlmCisgIGJvb2wgbWluaW1hbF9wID0gKCF3LT5tYy5k cmF3X2ZpbGxfY29sdW1uCisgICAgICAgICAgICAgICAgICAgICYmIG1jX3JlZGlzcGxheV9wcmVz ZXJ2ZV9lY2hvX2FyZWEgIT0gOAorICAgICAgICAgICAgICAgICAgICAmJiBtY19yZWRpc3BsYXkg IT0gMworICAgICAgICAgICAgICAgICAgICAmJiB3ID09IFhXSU5ET1cgKHNlbGVjdGVkX3dpbmRv dykKKyAgICAgICAgICAgICAgICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBtY19maWxsX2NvbHVtbl9kcmF3X2ZvcnRod2l0aCkpKTsKKyAgaWYgKHctPm1jLmVyYXNl X2ZpbGxfY29sdW1uICYmIHctPm1jLmRyYXdfZmlsbF9jb2x1bW4KKyAgICAgICYmICFN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LCBRbmlsKTsKKyAgICAgIHctPm1jLmVyYXNlX2Zp bGxfY29sdW1uID0gZmFsc2U7CisgICAgfQorICBpZiAob24KKyAgICAgICYmICFNSU5JX1dJTkRP V19QICh3KQorICAgICAgJiYgKHcgPT0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93KQorICAgICAg ICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2ZpbGxfY29sdW1u X2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICYmIE5JTFAgKHctPm1jX2ZpbGxfY29sdW1uX2Nh Y2hlKQorICAgICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2Zp bGxfY29sdW1uKSkpKQorICAgIG1jX2RyYXdfZmlsbF9jb2x1bW4gKHcsIGFjdGl2ZV9wLCBtaW5p bWFsX3ApOworICAgIGVsc2UgaWYgKG9uCisgICAgICAgICAgICAgJiYgIU1JTklfV0lORE9XX1Ag KHcpCisgICAgICAgICAgICAgJiYgIU5JTFAgKHctPm1jX2ZpbGxfY29sdW1uX2NhY2hlKQorICAg ICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2ZpbGxf Y29sdW1uKSkKKyAgICAgICAgICAgICAmJiBXSU5ET1dQIChYQ0FSIChGbnRoIChtYWtlX2ZpeG51 bSAoMSksIHctPm1jX2ZpbGxfY29sdW1uX2NhY2hlKSkpCisgICAgICAgICAgICAgJiYgdyA9PSBY V0lORE9XIChYQ0FSIChGbnRoIChtYWtlX2ZpeG51bSAoMSksIHctPm1jX2ZpbGxfY29sdW1uX2Nh Y2hlKSkpCisgICAgICAgICAgICAgJiYgRVEgKHctPmNvbnRlbnRzLCBYQ0FSIChGbnRoIChtYWtl X2ZpeG51bSAoMiksIHctPm1jX2ZpbGxfY29sdW1uX2NhY2hlKSkpKQorICAgICAgeworICAgICAg ICBtY19lcmFzZV9maW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HVtbiwgU21jX2FjdGl2YXRlX2ZpbGxfY29sdW1uLCAxLCAxLCAwLAorICAgICAgIGRv YzogLyogRG9jLXN0cmluZy4gKi8pCisgIChMaXNwX09iamVjdCB3aW5kb3cpCit7CisgIHN0cnVj dCB3aW5kb3cgKncgPSBkZWNvZGVfbGl2ZV93aW5kb3cgKHdpbmRvdyk7CisjaWZkZWYgR0xZUEhf REVCVUcKKyAgaWYgKHRyYWNlX3JlZGlzcGxheV9wCisgICAgICAmJiBCVUZGRVJQICh3LT5jb250 ZW50cykKKyAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2Zp bGxfY29sdW1uKSkpCisgICAgeworICAgICAgTGlzcF9PYmplY3Qgd2luZG93X3N0cmluZyA9IEZw cmluMV90b19zdHJpbmcgKHdpbmRvdywgUW5pbCk7CisgICAgICBjaGFyICp3aW5kb3dfY2hhciA9 IFNTREFUQSAod2luZG93X3N0cmluZyk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICJtYy1hY3Rp dmF0ZS1tYy1maWxsLWNvbHVtbiAoJXMpXG4iLCB3aW5kb3dfY2hhcik7CisgICAgfQorI2VuZGlm CisgIHctPm1jLmRyYXdfZmlsbF9jb2x1bW4gPSB0cnVlOworICB3LT5tYy5lcmFzZV9maWxsX2Nv bHVtbiA9IHRydWU7CisgIHctPm11c3RfYmVfdXBkYXRlZF9wID0gdHJ1ZTsKKyAgcmV0dXJuIFFu aWw7Cit9CisKK0RFRlVOICgibWMtc3RkZXJyIiwgRm1jX3N0ZGVyciwgU21jX3N0ZGVyciwgMCwg MSwgIlAiLAorICAgICAgIGRvYzogLyogVG9nZ2xlIHRyYWNpbmcgb2YgbXVsdGlwbGUgZmFrZSBj dXJzb3JzLgorV2l0aCBBUkcsIHR1cm4gdHJhY2luZyBvbiBpZiBhbmQgb25seSBpZiBBUkcgaXMg cG9zaXRpdmUuICovKQorICAoTGlzcF9PYmplY3QgYXJnKQoreworICBzdHJ1Y3QgYnVmZmVyICpi ID0gY3VycmVudF9idWZmZXI7CisgIGJvb2wgbWNfc3RkZXJyX3AgPSAoIU5JTFAgKEJWQVIgKGN1 cnJlbnRfYnVmZmVyLCBtY19zdGRlcnIpKSkKKyAgICAgICAgICAgICAgICAgICA/IHRydWUKKyAg ICAgICAgICAgICAgICAgICA6IGZhbHNlOworICBpZiAoTklMUCAoYXJnKSkKKyAgICBtY19zdGRl cnJfcCA9ICFtY19zdGRlcnJfcDsKKyAgZWxzZQorICAgIHsKKyAgICAgIGFyZyA9IEZwcmVmaXhf bnVtZXJpY192YWx1ZSAoYXJnKTsKKyAgICAgIG1jX3N0ZGVycl9wID0gWEZJWE5VTSAoYXJnKSA+ IDA7CisgICAgfQorICBpZiAobWNfc3RkZXJyX3ApCisgICAgYnNldF9ibHZfbWNfc3RkZXJyIChi LCBRdCk7CisgICAgZWxzZQorICAgICAgYnNldF9ibHZfbWNfc3RkZXJyIChiLCBRbmlsKTsKKyAg cmV0dXJuIFFuaWw7Cit9CisKKy8qICAoZnVuZGFtZW50YWwtbW9kZSkKKyAgICAoc2V0cSBkaXNw bGF5LWxpbmUtbnVtYmVycyB0KQorICAgIChzZXRxIGJ1ZmZlci1kaXNwbGF5LXRhYmxlIChtYWtl LWRpc3BsYXktdGFibGUpKQorICAgIChhc2V0IGJ1ZmZlci1kaXNwbGF5LXRhYmxlCisgICAgICAg ICAgP1x0CisgICAgICAgICAgKHZlY3RvciAobWFrZS1nbHlwaC1jb2RlID9cdTAwQkIgJ2ZvbnQt bG9jay13YXJuaW5nLWZhY2UpCisgICAgICAgICAgICAgICAgICAobWFrZS1nbHlwaC1jb2RlID9c dCAnaGlnaGxpZ2h0KSkpCisgICAgKGFzZXQgYnVmZmVyLWRpc3BsYXktdGFibGUKKyAgICAgICAg ICA/XG4KKyAgICAgICAgICAodmVjdG9yIChtYWtlLWdseXBoLWNvZGUgP1x1MDBCNiAnZm9udC1s b2NrLWNvbW1lbnQtZmFjZSkKKyAgICAgICAgICAgICAgICAgID9cbikpCisgICAgKHNldHEgdGFi LXdpZHRoIDgpCisgICAgKHNldHEtbG9jYWwgYXV0by1oc2Nyb2xsLW1vZGUgJ2N1cnJlbnQtbGlu ZSkgKi8KKworREVGVU4gKCJtYy1kZWJ1ZyIsIEZtY19kZWJ1ZywgU21jX2RlYnVnLCAwLCAwLCAi IiwKKyAgICAgICBkb2M6IC8qIFRoaXMgZnVuY3Rpb24gdXNlZCBmb3IgZGVidWdnaW5nLiAqLykK KyAgKHZvaWQpCit7CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAg ICAgICBQUkVMSU1JTkFSWSBTVFVGRgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisgIHN0cnVj dCB3aW5kb3cgKncgPSBkZWNvZGVfbGl2ZV93aW5kb3cgKHNlbGVjdGVkX3dpbmRvdyk7CisgIHN0 cnVjdCBpdCBpdDsKKyAgdm9pZCAqaXRkYXRhID0gYmlkaV9zaGVsdmVfY2FjaGUgKCk7CisgIHN0 cnVjdCBpdCBpdDI7CisgIHZvaWQgKml0MmRhdGEgPSBOVUxMOworICBzdHJ1Y3QgaXQgaXQzOwor ICB2b2lkICppdDNkYXRhID0gTlVMTDsKKyAgZW51bSBtb3ZlX2l0X3Jlc3VsdCByYyA9IE1PVkVf WF9SRUFDSEVEOworICBzdHJ1Y3QgdGV4dF9wb3Mgc3RhcnRfdGV4dF9wb3NpdGlvbjsKKyAgaW50 IGNvdW50ID0gMDsKKyAgaW50IG5ld194ID0gMDsKKyAgaW50IHByZXZpb3VzX2l0X2MgPSAwOwor ICBpbnQgcHJldmlvdXNfaXRfZmV0Y2hieXRlID0gMDsKKyAgaW50IHByZXZpb3VzX2l0X2N1cnJl bnRfeCA9IDA7CisgIGludCBwcmV2aW91c19pdF9jaGFycG9zID0gMDsKKyAgaW50IHByZXZpb3Vz X2l0X3BpeGVsX3dpZHRoID0gMDsKKyAgYm9vbCBmaW5hbF9sb29wX3AgPSBmYWxzZTsKKyAgaW50 IHRleHRfYXJlYV93aWR0aCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICBTVEFSVCBESVNQTEFZ IC0tIHctPnN0YXJ0CisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAgLyogQmVnaW4gdGhlIGpv dXJuZXkgYXQgdy0+c3RhcnQuICovCisgIFNFVF9URVhUX1BPU19GUk9NX01BUktFUiAoc3RhcnRf dGV4dF9wb3NpdGlvbiwgdy0+c3RhcnQpOworICBzdGFydF9kaXNwbGF5ICgmaXQsIHcsIHN0YXJ0 X3RleHRfcG9zaXRpb24pOworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAg ICAgR08gVE8gVEhFIEJFR0lOTklORyBPRiBUSEUgQ1VSUkVOVCBMSU5FLgorKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisgIC8qIFBsYWNlIHRoZSBJVCBvbiB0aGUgY3VycmVudCBsaW5lIGNvbnRh aW5pbmcgUFQuICovCisgIGludCB2b2Zmc2V0ID0gKFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQg KHcpID4gMAorICAgICAgICAgICAgICAgICAmJiB3LT5vdXRwdXRfY3Vyc29yLnZwb3MgPiAwKQor ICAgICAgICAgICAgICAgICAgPyB3LT5vdXRwdXRfY3Vyc29yLnZwb3MgLSAxCisgICAgICAgICAg ICAgICAgICA6IHctPm91dHB1dF9jdXJzb3IudnBvczsKKyAgaWYgKHZvZmZzZXQgPiAwKQorICAg IG1vdmVfaXRfYnlfbGluZXMgKCZpdCwgdm9mZnNldCk7CisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioKKyAgICAgICAgICAgICAgICAgICAgICAgTU9WRSBJVDogIElOQ1JFTUVOVCA9PSAxIHBpeGVs CisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAgZnByaW50ZiAoc3RkZXJyLCAiXG5pdC5maXJz dF92aXNpYmxlX3ggKCVkKVxuIiwgaXQuZmlyc3RfdmlzaWJsZV94KTsKKyAgd2hpbGUgKCFmaW5h bF9sb29wX3ApCisgICAgeworICAgICAgbWNfZGVidWdfcCA9IHRydWU7CisgICAgICBmaW5hbF9s b29wX3AgPSAoSVRfQ0hBUlBPUyAoaXQpID09IFpWKQorICAgICAgICAgICAgICAgICAgICAgICA/ IHRydWUKKyAgICAgICAgICAgICAgICAgICAgIDogKEZFVENIX0JZVEUgKElUX0JZVEVQT1MgKGl0 KSkgPT0gJ1xuJworICAgICAgICAgICAgICAgICAgICAgICAgJiYgaXQuYyAhPSAwKQorICAgICAg ICAgICAgICAgICAgICAgICA/IHRydWUKKyAgICAgICAgICAgICAgICAgICAgIDogKHJjID09IE1P VkVfTElORV9DT05USU5VRUQpCisgICAgICAgICAgICAgICAgICAgICAgID8gdHJ1ZQorICAgICAg ICAgICAgICAgICAgICAgOiAocmMgPT0gTU9WRV9MSU5FX1RSVU5DQVRFRAorICAgICAgICAgICAg ICAgICAgICAgICAgJiYgaXQuY3VycmVudF94IC0gaXQuZmlyc3RfdmlzaWJsZV94ID4gdGV4dF9h cmVhX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAgICA/IHRydWUKKyAgICAgICAgICAgICAg ICAgICAgIDogZmFsc2U7CisgICAgICBpZiAoaXQuY3VycmVudF94ID4gcHJldmlvdXNfaXRfY3Vy cmVudF94CisgICAgICAgICAgfHwgSVRfQ0hBUlBPUyAoaXQpID4gcHJldmlvdXNfaXRfY2hhcnBv cworICAgICAgICAgIHx8IGl0LmMgIT0gcHJldmlvdXNfaXRfYworICAgICAgICAgIHx8IGl0LmMg PT0gMAorICAgICAgICAgIHx8IGl0LmMgPT0gMTApCisgICAgICAgIHsKKyAgICAgICAgICBMaXNw X09iamVjdCBjaGFyYWN0ZXIgPSBGY2hhcl90b19zdHJpbmcgKG1ha2VfZml4bnVtIChpdC5jKSk7 CisgICAgICAgICAgaW50IGNoYXJwb3MgPSBJVF9DSEFSUE9TIChpdCk7CisgICAgICAgICAgZnBy aW50ZiAoc3RkZXJyLCAiXG5jaGFycG9zICglZC8lZC8lZCkgfCBmaXJzdF94ICglZCkgfCBwcmV2 aW91c194ICglZCkgfCB4ICglZCkgfCBjICglcykgfCBwdyAoJWQpIHwgaHBvcyAoJWQpXG4iLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhcnBvcywgcHJldmlvdXNfaXRfY2hhcnBvcywg RkVUQ0hfQllURSAoSVRfQllURVBPUyAoaXQpKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg IGl0LmZpcnN0X3Zpc2libGVfeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZXZpb3Vz X2l0X2N1cnJlbnRfeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0LmN1cnJlbnRfeCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICgoIU5JTFAgKGNoYXJhY3RlcikKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgaXQuYyA9PSA5KQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gIlxcdCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoIU5JTFAg KGNoYXJhY3RlcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgaXQuYyA9PSAx MCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICJcXG4iCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIGl0LmMgIT0gOQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBpdC5jICE9IDEwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gU1NEQVRB IChjaGFyYWN0ZXIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogIj8iKSwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgIGl0LnBpeGVsX3dpZHRoLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgaXQuaHBvcyk7CisgICAgICAgICAgcHJldmlvdXNfaXRfYyA9IGl0LmM7CisgICAg ICAgICAgcHJldmlvdXNfaXRfY3VycmVudF94ID0gaXQuY3VycmVudF94OworICAgICAgICAgIHBy ZXZpb3VzX2l0X2NoYXJwb3MgPSBJVF9DSEFSUE9TIChpdCk7CisgICAgICAgICAgcHJldmlvdXNf aXRfZmV0Y2hieXRlID0gRkVUQ0hfQllURSAoSVRfQllURVBPUyAoaXQpKTsKKyAgICAgICAgICBw cmV2aW91c19pdF9waXhlbF93aWR0aCA9IGl0LnBpeGVsX3dpZHRoOworICAgICAgICAgIGNvdW50 ICs9IDE7CisgICAgICAgIH0KKyAgICAgIG5ld194ICs9IDE7CisgICAgICBTQVZFX0lUIChpdDIs IGl0LCBpdDJkYXRhKTsKKyAgICAgIHJjID0gbW92ZV9pdF9pbl9kaXNwbGF5X2xpbmVfdG8gKCZp dCwgWlYsIG5ld194LCBNT1ZFX1RPX1BPUyB8IE1PVkVfVE9fWCk7CisgICAgICBTQVZFX0lUIChp dDMsIGl0LCBpdDNkYXRhKTsKKyAgICB9CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRIRSBFTkQKKyoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworICBtY19kZWJ1Z19wID0gZmFsc2U7CisgIGJpZGlfdW5zaGVsdmVfY2FjaGUgKGl0ZGF0 YSwgZmFsc2UpOworICByZXR1cm4gUW5pbDsKK30KKworLyogZW5kIE1VTFRJUExFIENVUlNPUlMg Ki8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAwKIC8qKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogCQkg ICAgICBXaW5kb3cgZGlzcGxheSBkaW1lbnNpb25zCkBAIC0xMTIxNCw3ICsxNjM4OSwxOCBAQCBy ZXNpemVfZWNob19hcmVhX2V4YWN0bHkgKHZvaWQpCiAJewogCSAgd2luZG93c19vcl9idWZmZXJz X2NoYW5nZWQgPSA0MjsKIAkgIHVwZGF0ZV9tb2RlX2xpbmVzID0gMzA7Ci0JICByZWRpc3BsYXlf aW50ZXJuYWwgKCk7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBD VVJTT1JTICovCisKKyAgICAgIG1jX3JlZGlzcGxheV9pbnRlcm5hbCA9IDE7CisgICAgICByZWRp c3BsYXlfaW50ZXJuYWwgKDEpOworICAgICAgbWNfcmVkaXNwbGF5X2ludGVybmFsID0gMDsKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogCX0KICAgICB9CiB9CkBAIC0xMTcwMSw3ICsx Njg4NywxOCBAQCBlY2hvX2FyZWFfZGlzcGxheSAoYm9vbCB1cGRhdGVfZnJhbWVfcCkKIAkgICAg ICBwdHJkaWZmX3QgY291bnQgPSBTUEVDUERMX0lOREVYICgpOwogCSAgICAgIHNwZWNiaW5kIChR cmVkaXNwbGF5X2RvbnRfcGF1c2UsIFF0KTsKIAkgICAgICBmc2V0X3JlZGlzcGxheSAoZik7Ci0J ICAgICAgcmVkaXNwbGF5X2ludGVybmFsICgpOworCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgICAgICAgICAgbWNfcmVkaXNwbGF5X2ludGVy bmFsID0gMjsKKyAgICAgICAgICByZWRpc3BsYXlfaW50ZXJuYWwgKDIpOworICAgICAgICAgIG1j X3JlZGlzcGxheV9pbnRlcm5hbCA9IDA7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK IAkgICAgICB1bmJpbmRfdG8gKGNvdW50LCBRbmlsKTsKIAkgICAgfQogCSAgZWxzZSBpZiAoRlJB TUVfV0lORE9XX1AgKGYpICYmIG4gPT0gMCkKQEAgLTEzNjIwLDEyICsxODgxNywyNiBAQCB0ZXh0 X291dHNpZGVfbGluZV91bmNoYW5nZWRfcCAoc3RydWN0IHdpbmRvdyAqdywKICAgIGlzIG5vIGxv bmdlciByZXF1ZXN0ZWQsIHdlIGNsZWFyIHRoZSBlY2hvIGFyZWEgb3IgYnJpbmcgYmFjayB0aGUK ICAgIG1pbmktYnVmZmVyIGlmIHRoYXQgaXMgaW4gdXNlLiAgKi8KIAorCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKwogdm9pZAotcmVkaXNwbGF5ICh2 b2lkKQorcmVkaXNwbGF5IChpbnQgZnJvbV93aGVyZSkKIHsKLSAgcmVkaXNwbGF5X2ludGVybmFs ICgpOworI2lmZGVmIEdMWVBIX0RFQlVHCisgIGlmICh0cmFjZV9yZWRpc3BsYXlfcCkKKyAgICBm cHJpbnRmIChzdGRlcnIsICJcbnJlZGlzcGxheSAoJWQpXG4iLCBmcm9tX3doZXJlKTsKKyNlbmRp ZgorICBtY19yZWRpc3BsYXkgPSBmcm9tX3doZXJlOworICBtY19yZWRpc3BsYXlfaW50ZXJuYWwg PSAzOworICByZWRpc3BsYXlfaW50ZXJuYWwgKDMpOworICBtY19yZWRpc3BsYXlfaW50ZXJuYWwg PSAwOworICBtY19yZWRpc3BsYXkgPSAwOwogfQogCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KwogCiBzdGF0aWMgTGlzcF9PYmplY3QKIG92ZXJsYXlfYXJyb3dfc3RyaW5nX29yX3Byb3BlcnR5 IChMaXNwX09iamVjdCB2YXIpCkBAIC0xMzg5MSw5ICsxOTEwMiwyMSBAQCBkbyB7IGlmIChwb2xs aW5nX3N0b3BwZWRfaGVyZSkgc3RhcnRfcG9sbGluZyAoKTsJXAogLyogUGVyaGFwcyBpbiB0aGUg ZnV0dXJlIGF2b2lkIHJlY2VudGVyaW5nIHdpbmRvd3MgaWYgaXQKICAgIGlzIG5vdCBuZWNlc3Nh cnk7IGN1cnJlbnRseSB0aGF0IGNhdXNlcyBzb21lIHByb2JsZW1zLiAgKi8KIAorCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKwogc3RhdGljIHZvaWQK LXJlZGlzcGxheV9pbnRlcm5hbCAodm9pZCkKK3JlZGlzcGxheV9pbnRlcm5hbCAoaW50IGZyb21f d2hlcmUpCiB7CisjaWZkZWYgR0xZUEhfREVCVUcKKyAgaWYgKHRyYWNlX3JlZGlzcGxheV9wKQor ICAgIGZwcmludGYgKHN0ZGVyciwgIlxucmVkaXNwbGF5X2ludGVybmFsICglZClcbiIsIGZyb21f d2hlcmUpOworI2VuZGlmCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgc3RydWN0 IHdpbmRvdyAqdyA9IFhXSU5ET1cgKHNlbGVjdGVkX3dpbmRvdyk7CiAgIHN0cnVjdCB3aW5kb3cg KnN3OwogICBzdHJ1Y3QgZnJhbWUgKmZyOwpAQCAtMTQyOTUsNiArMTk1MTgsMjYgQEAgcmVkaXNw bGF5X2ludGVybmFsICh2b2lkKQogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQogCSAgICAgIHVw ZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgZmFsc2UpOwogI2VuZGlmCisKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKy8qIE5PVEU6ICBBbiBpZGxl LXRpbWVyIGZ1bmN0aW9uIG1heSBub3QgbmVjZXNzYXJpbHkgdHJpZ2dlciBgcmVkaXNwbGF5X3dp bmRvdycuCisgICBgdy0+bXVzdF9iZV91cGRhdGVkX3AnIGlzIHNldCB0byB0cnVlIHdpdGhpbiBg bWMtYWN0aXZhdGUtY3Jvc3NoYWlycycuCistICBgb3B0aW1pemF0aW9uIDFgIChlLmcuLCBsZWZ0 L3JpZ2h0IGN1cnNvciBtb3ZlbWVudCBvbiB0aGUgZmlyc3Qgc2NyZWVuIGxpbmUpLgorLSAgYG9w dGltaXphdGlvbiAzYCAoZS5nLiwgbGVmdC9yaWdodCBjdXJzb3IgbW92ZW1lbnQgb24gc2NyZWVu IGxpbmVzIHN1YnNlcXVlbnQKKyAgICB0byB0aGUgZmlyc3Qgc2NyZWVuIGxpbmUpLCBieXBhc3Mg YHJlZGlzcGxheV93aW5kb3cnLiAqLworCisgIGJsb2NrX2lucHV0ICgpOworICBtY19yZW1vdmVf bXVsdGlwbGVfY3Vyc29ycyAodyk7CisgIG1jX3JlbW92ZV9jcm9zc2hhaXJzICh3KTsKKyAgbWNf cmVtb3ZlX2ZpbGxfY29sdW1uICh3KTsKKyAgdW5ibG9ja19pbnB1dCAoKTsKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogCSAgICAgIGdvdG8gdXBkYXRlOwogCSAgICB9CiAJICBlbHNl CkBAIC0xNDMxNyw2ICsxOTU2MCwyMiBAQCByZWRpc3BsYXlfaW50ZXJuYWwgKHZvaWQpCiAJCSAg JiYgKHcgPSBYV0lORE9XIChzZWxlY3RlZF93aW5kb3cpKSAhPSBzdykKIAkJZ290byByZXRyeTsK IAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKwor LyogTk9URTogIEFuIGlkbGUtdGltZXIgZnVuY3Rpb24gbWF5IG5vdCBuZWNlc3NhcmlseSB0cmln Z2VyIGByZWRpc3BsYXlfd2luZG93Jy4KKyAgIGB3LT5tdXN0X2JlX3VwZGF0ZWRfcCcgaXMgc2V0 IHRvIHRydWUgd2l0aGluIGBtYy1hY3RpdmF0ZS1jcm9zc2hhaXJzJy4KKy0gIGBvcHRpbWl6YXRp b24gMWAgKGUuZy4sIGxlZnQvcmlnaHQgY3Vyc29yIG1vdmVtZW50IG9uIHRoZSBmaXJzdCBzY3Jl ZW4gbGluZSkuCistICBgb3B0aW1pemF0aW9uIDNgIChlLmcuLCBsZWZ0L3JpZ2h0IGN1cnNvciBt b3ZlbWVudCBvbiBzY3JlZW4gbGluZXMgc3Vic2VxdWVudAorICAgIHRvIHRoZSBmaXJzdCBzY3Jl ZW4gbGluZSksIGJ5cGFzcyBgcmVkaXNwbGF5X3dpbmRvdycuICovCisKKyAgICBpZiAody0+bXVz dF9iZV91cGRhdGVkX3ApCisgICAgICBnb3RvIHVwZGF0ZTsKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogCSAgICAgIC8qIFdlIHVzZWQgdG8gYWx3YXlzIGdvdG8gZW5kX29mX3JlZGlz cGxheSBoZXJlLCBidXQgdGhpcwogCQkgaXNuJ3QgZW5vdWdoIGlmIHdlIGhhdmUgYSBibGlua2lu ZyBjdXJzb3IuICAqLwogCSAgICAgIGlmICh3LT5jdXJzb3Jfb2ZmX3AgPT0gdy0+bGFzdF9jdXJz b3Jfb2ZmX3ApCkBAIC0xNDM1OCw2ICsxOTYxNywyNiBAQCByZWRpc3BsYXlfaW50ZXJuYWwgKHZv aWQpCiAJCSAgKnctPmRlc2lyZWRfbWF0cml4LT5tZXRob2QgPSAwOwogCQkgIGRlYnVnX21ldGhv ZF9hZGQgKHcsICJvcHRpbWl6YXRpb24gMyIpOwogI2VuZGlmCisKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKy8qIE5PVEU6ICBBbiBpZGxlLXRp bWVyIGZ1bmN0aW9uIG1heSBub3QgbmVjZXNzYXJpbHkgdHJpZ2dlciBgcmVkaXNwbGF5X3dpbmRv dycuCisgICBgdy0+bXVzdF9iZV91cGRhdGVkX3AnIGlzIHNldCB0byB0cnVlIHdpdGhpbiBgbWMt YWN0aXZhdGUtY3Jvc3NoYWlycycuCistICBgb3B0aW1pemF0aW9uIDFgIChlLmcuLCBsZWZ0L3Jp Z2h0IGN1cnNvciBtb3ZlbWVudCBvbiB0aGUgZmlyc3Qgc2NyZWVuIGxpbmUpLgorLSAgYG9wdGlt aXphdGlvbiAzYCAoZS5nLiwgbGVmdC9yaWdodCBjdXJzb3IgbW92ZW1lbnQgb24gc2NyZWVuIGxp bmVzIHN1YnNlcXVlbnQKKyAgICB0byB0aGUgZmlyc3Qgc2NyZWVuIGxpbmUpLCBieXBhc3MgYHJl ZGlzcGxheV93aW5kb3cnLiAqLworCisgIGJsb2NrX2lucHV0ICgpOworICBtY19yZW1vdmVfbXVs dGlwbGVfY3Vyc29ycyAodyk7CisgIG1jX3JlbW92ZV9jcm9zc2hhaXJzICh3KTsKKyAgbWNfcmVt b3ZlX2ZpbGxfY29sdW1uICh3KTsKKyAgdW5ibG9ja19pbnB1dCAoKTsKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisKKwogCQkgIGdvdG8gdXBkYXRlOwogCQl9CiAJICAgICAgZWxzZQpAQCAt MTQ3MzgsMTYgKzIwMDE3LDM2IEBAIHJlZGlzcGxheV9wcmVzZXJ2ZV9lY2hvX2FyZWEgKGludCBm cm9tX3doZXJlKQogICBibG9ja19idWZmZXJfZmxpcHMgKCk7CiAgIHVuYmxvY2tfaW5wdXQgKCk7 CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqK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8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCiAKICAgZmx1c2hfZnJhbWUgKFNFTEVDVEVEX0ZSQU1FICgpKTsK ICAgdW5iaW5kX3RvIChjb3VudCwgUW5pbCk7CkBAIC0xNzMwMiw2ICsyMjYwMSwyNSBAQCByZWRp c3BsYXlfd2luZG93IChMaXNwX09iamVjdCB3aW5kb3csIGJvb2wganVzdF90aGlzX29uZV9wKQog ICBkZWJ1Z19tZXRob2RfYWRkICh3LCAicmVjZW50ZXIiKTsKICNlbmRpZgogCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisvKiBOT1RFOiAgQW4g aWRsZS10aW1lciBmdW5jdGlvbiBtYXkgbm90IG5lY2Vzc2FyaWx5IHRyaWdnZXIgYHJlZGlzcGxh eV93aW5kb3cnLgorICAgYHctPm11c3RfYmVfdXBkYXRlZF9wJyBpcyBzZXQgdG8gdHJ1ZSB3aXRo aW4gYG1jLWFjdGl2YXRlLWNyb3NzaGFpcnMnLgorLSAgYG9wdGltaXphdGlvbiAxYCAoZS5nLiwg bGVmdC9yaWdodCBjdXJzb3IgbW92ZW1lbnQgb24gdGhlIGZpcnN0IHNjcmVlbiBsaW5lKS4KKy0g IGBvcHRpbWl6YXRpb24gM2AgKGUuZy4sIGxlZnQvcmlnaHQgY3Vyc29yIG1vdmVtZW50IG9uIHNj cmVlbiBsaW5lcyBzdWJzZXF1ZW50CisgICAgdG8gdGhlIGZpcnN0IHNjcmVlbiBsaW5lKSwgYnlw YXNzIGByZWRpc3BsYXlfd2luZG93Jy4gKi8KKworICBibG9ja19pbnB1dCAoKTsKKyAgbWNfcmVt b3ZlX211bHRpcGxlX2N1cnNvcnMgKHcpOworICBtY19yZW1vdmVfY3Jvc3NoYWlycyAodyk7Cisg IG1jX3JlbW92ZV9maWxsX2NvbHVtbiAodyk7CisgIHVuYmxvY2tfaW5wdXQgKCk7CisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICAgLyogRm9yZ2V0IGFueSBwcmV2aW91c2x5IHJlY29y ZGVkIGJhc2UgbGluZSBmb3IgbGluZSBudW1iZXIgZGlzcGxheS4gICovCiAgIGlmICghYnVmZmVy X3VuY2hhbmdlZF9wKQogICAgIHctPmJhc2VfbGluZV9udW1iZXIgPSAwOwpAQCAtMTc3MzIsNiAr MjMwNTAsMjUgQEAgcmVkaXNwbGF5X3dpbmRvdyAoTGlzcF9PYmplY3Qgd2luZG93LCBib29sIGp1 c3RfdGhpc19vbmVfcCkKICAgZWxzZQogICAgIFRFTVBfU0VUX1BUX0JPVEggKENIQVJQT1MgKG9w b2ludCksIEJZVEVQT1MgKG9wb2ludCkpOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUgQ1VSU09SUyAqLworCisvKiBOT1RFOiAgQW4gaWRsZS10aW1lciBmdW5jdGlv biBtYXkgbm90IG5lY2Vzc2FyaWx5IHRyaWdnZXIgYHJlZGlzcGxheV93aW5kb3cnLgorICAgYHct Pm11c3RfYmVfdXBkYXRlZF9wJyBpcyBzZXQgdG8gdHJ1ZSB3aXRoaW4gYG1jLWFjdGl2YXRlLWNy b3NzaGFpcnMnLgorLSAgYG9wdGltaXphdGlvbiAxYCAoZS5nLiwgbGVmdC9yaWdodCBjdXJzb3Ig bW92ZW1lbnQgb24gdGhlIGZpcnN0IHNjcmVlbiBsaW5lKS4KKy0gIGBvcHRpbWl6YXRpb24gM2Ag KGUuZy4sIGxlZnQvcmlnaHQgY3Vyc29yIG1vdmVtZW50IG9uIHNjcmVlbiBsaW5lcyBzdWJzZXF1 ZW50CisgICAgdG8gdGhlIGZpcnN0IHNjcmVlbiBsaW5lKSwgYnlwYXNzIGByZWRpc3BsYXlfd2lu ZG93Jy4gKi8KKworICBibG9ja19pbnB1dCAoKTsKKyAgbWNfcmVtb3ZlX211bHRpcGxlX2N1cnNv cnMgKHcpOworICBtY19yZW1vdmVfY3Jvc3NoYWlycyAodyk7CisgIG1jX3JlbW92ZV9maWxsX2Nv bHVtbiAodyk7CisgIHVuYmxvY2tfaW5wdXQgKCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKICAgc2V0X2J1ZmZlcl9pbnRlcm5hbF8xIChvbGQpOwogICAvKiBBdm9pZCBhbiBhYm9y dCBpbiBURU1QX1NFVF9QVF9CT1RIIGlmIHRoZSBidWZmZXIgaGFzIGJlY29tZQogICAgICBzaG9y dGVyLiAgVGhpcyBjYW4gYmUgY2F1c2VkIGJ5IGxvZyB0cnVuY2F0aW9uIGluICpNZXNzYWdlcyou ICAqLwpAQCAtMjAxMjIsNiArMjU0NTksMTcgQEAgYXBwZW5kX3NwYWNlX2Zvcl9uZXdsaW5lIChz dHJ1Y3QgaXQgKml0LCBib29sIGRlZmF1bHRfZmFjZV9wKQogCSAgbWVtc2V0ICgmaXQtPnBvc2l0 aW9uLCAwLCBzaXplb2YgaXQtPnBvc2l0aW9uKTsKIAkgIGl0LT5vYmplY3QgPSBRbmlsOwogCSAg aXQtPmMgPSBpdC0+Y2hhcl90b19kaXNwbGF5ID0gJyAnOworCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgICAgICBpZiAoSVRfQllURVBPUyAo Kml0KSA+PSBaVl9CWVRFKQorICAgICAgICBpdC0+enZfcCA9IHRydWU7CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKIAkgIGl0LT5sZW4gPSAxOwogCiAJICAvKiBJZiB0aGUgZGVmYXVs dCBmYWNlIHdhcyByZW1hcHBlZCwgYmUgc3VyZSB0byB1c2UgdGhlCkBAIC0yMTI1NSw5ICsyNjYw MywyMiBAQCBtYXliZV9wcm9kdWNlX2xpbmVfbnVtYmVyIChzdHJ1Y3QgaXQgKml0KQogICAgICAg ZWxzZQogCXRlbV9pdC5jID0gdGVtX2l0LmNoYXJfdG9fZGlzcGxheSA9ICpwOwogICAgICAgdGVt X2l0LmxlbiA9IDE7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBD VVJTT1JTICovCisKKyAgICAgIGlmIChiZXlvbmRfenYpCisgICAgICAgIHRlbV9pdC56dl9wID0g dHJ1ZTsKKyAgICAgIHRlbV9pdC5jdXJyZW50X3kgPSBpdC0+Y3VycmVudF95OworICAgICAgdGVt X2l0LnZwb3MgPSBpdC0+dnBvczsKICAgICAgIC8qIE1ha2Ugc3VyZSB0aGVzZSBnbHlwaHMgd2ls bCBoYXZlIGEgInBvc2l0aW9uIiBvZiAtMS4gICovCiAgICAgICBTRVRfVEVYVF9QT1MgKHRlbV9p dC5wb3NpdGlvbiwgLTEsIC0xKTsKICAgICAgIFBST0RVQ0VfR0xZUEhTICgmdGVtX2l0KTsKKyAg ICAgIHRlbV9pdC5ocG9zICs9IDE7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCiAKICAg ICAgIC8qIFN0b3AgcHJvZHVjaW5nIGdseXBocywgYW5kIHJlZnJhaW4gZnJvbSBwcm9kdWNpbmcg dGhlIGxpbmUKIAkgbnVtYmVyLCBpZiB3ZSBkb24ndCBoYXZlIGVub3VnaCBzcGFjZSBvbiB0aGlz IGxpbmUuICAqLwpAQCAtMjEyNzAsNiArMjY2MzEsMTUgQEAgbWF5YmVfcHJvZHVjZV9saW5lX251 bWJlciAoc3RydWN0IGl0ICppdCkKIAl9CiAgICAgfQogCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgIGl0LT53LT5tYy5sbnVtX3BpeGVsX3dp ZHRoID0gdGVtX2l0LmN1cnJlbnRfeDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog ICAvKiBSZWNvcmQgdGhlIHdpZHRoIGluIHBpeGVscyB3ZSBuZWVkIGZvciB0aGUgbGluZSBudW1i ZXIgZGlzcGxheS4gICovCiAgIGl0LT5sbnVtX3BpeGVsX3dpZHRoID0gdGVtX2l0LmN1cnJlbnRf eDsKICAgLyogQ29weSB0aGUgcHJvZHVjZWQgZ2x5cGhzIGludG8gSVQncyBnbHlwaF9yb3cuICAq LwpAQCAtMjY4NDEsNyArMzIyMTEsNjcgQEAgZHJhd19nbHlwaHMgKHN0cnVjdCB3aW5kb3cgKncs IGludCB4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCiAJIHByZXBlbmRlZCBtdXN0IGJlIGRyYXdu IGJlY2F1c2UgdGhlIGZpcnN0IGdseXBoIHN0cmluZwogCSBkcmF3cyBvdmVyIGl0LiAgKi8KICAg ICAgIGkgPSBsZWZ0X292ZXJ3cml0dGVuIChoZWFkKTsKLSAgICAgIGlmIChpID49IDApCisKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgICAg IGJvb2wgc2tpcF9wID0gZmFsc2U7CisgICAgICBpbnQgYmVnID0gaTsKKworICAgICAgaWYgKGkg Pj0gMAorICAgICAgICAgICYmIGhsID09IERSQVdfQ1VSU09SCisgICAgICAgICAgJiYgKHctPm1j LmdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSAorICAgICAgICAgICAgICB8fCB3LT5tYy5nbHlwaF9m bGF2b3IgPT0gTUNfR0xZUEhMRVNTKSkKKyAgICAgICAgd2hpbGUgKHN0YXJ0ID4gYmVnKQorICAg ICAgICAgIHsKKyAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSAocm93KS0+Z2x5cGhz W2FyZWFdICsgYmVnOworICAgICAgICAgICAgc3dpdGNoIChnbHlwaC0+dHlwZSkKKyAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgY2FzZSBDSEFSX0dMWVBIOgorICAgICAgICAgICAgICAgIGJy ZWFrOworICAgICAgICAgICAgICBjYXNlIENPTVBPU0lURV9HTFlQSDoKKyAgICAgICAgICAgICAg ICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSBTVFJFVENIX0dMWVBIOgorICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgIGlmICh0cmFjZV9yZWRpc3BsYXlfcCkKKyAgICAgICAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIExpc3BfT2JqZWN0IGNoYXJhY3Rl ciA9IChDSEFSQUNURVJQIChtYWtlX2ZpeG51bSAoZ2x5cGgtPnUuY2gpKSkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBGY2hhcl90b19zdHJpbmcgKG1h a2VfZml4bnVtIChnbHlwaC0+dS5jaCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogUW5pbDsKKyAgICAgICAgICAgICAgICAgICAgICBmcHJpbnRmIChz dGRlcnIsICJkcmF3X2dseXBocyAtLSBsZWZ0X292ZXJ3cml0dGVuOiAgJWQgfCAlc1xuIiwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoLT51LmNoLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCghTklMUCAoY2hhcmFjdGVyKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaC0+dS5jaCA9PSAx MCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICJcXHQiCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChjaGFyYWN0 ZXIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBo LT51LmNoID09IDEwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gIlxcbiIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoIU5J TFAgKGNoYXJhY3RlcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgZ2x5cGgtPnUuY2ggPT0gMzIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyAiXFxzIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBnbHlwaC0+dS5jaCAhPSA5CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT51LmNoICE9IDEwCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT51LmNoICE9IDMyKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gU1NEQVRBIChjaGFyYWN0 ZXIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogIlxcPyIpKTsK KyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgc2tpcF9wID0gdHJ1ZTsK KyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAg ICAgY2FzZSBJTUFHRV9HTFlQSDoKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAg IH0KKyAgICAgICAgICAgIGJlZyArPSAxOworICAgICAgICAgIH0KKworICAgICAgaWYgKGkgPj0g MAorICAgICAgICAgICYmICFza2lwX3ApCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK IAl7CiAJICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2Ugb3ZlcmxhcF9obDsKIApAQCAtMjY5MDMsNyAr MzIzMzMsNjcgQEAgZHJhd19nbHlwaHMgKHN0cnVjdCB3aW5kb3cgKncsIGludCB4LCBzdHJ1Y3Qg Z2x5cGhfcm93ICpyb3csCiAJIHRoZXNlIHN0cmluZ3MgaGFzIHRvIGJlIGRyYXduIGJlY2F1c2Ug dGFpbCdzIGZvcmVncm91bmQgZHJhd3MKIAkgb3ZlciBpdC4gICovCiAgICAgICBpID0gcmlnaHRf b3ZlcndyaXR0ZW4gKHRhaWwpOwotICAgICAgaWYgKGkgPj0gMCkKKworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworICAgICAgc2tpcF9wID0gZmFs c2U7CisgICAgICBiZWcgPSBpOworCisgICAgICBpZiAoaSA+PSAwCisgICAgICAgICAgJiYgaGwg PT0gRFJBV19DVVJTT1IKKyAgICAgICAgICAmJiAody0+bWMuZ2x5cGhfZmxhdm9yID09IE1DX0dM WVBICisgICAgICAgICAgICAgIHx8IHctPm1jLmdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSExFU1Mp KQorICAgICAgICB3aGlsZSAoYmVnID49IGVuZCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBz dHJ1Y3QgZ2x5cGggKmdseXBoID0gKHJvdyktPmdseXBoc1thcmVhXSArIGJlZzsKKyAgICAgICAg ICAgIHN3aXRjaCAoZ2x5cGgtPnR5cGUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGNh c2UgQ0hBUl9HTFlQSDoKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2Fz ZSBDT01QT1NJVEVfR0xZUEg6CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAg IGNhc2UgU1RSRVRDSF9HTFlQSDoKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAgICAgICBMaXNwX09iamVjdCBjaGFyYWN0ZXIgPSAoQ0hBUkFDVEVSUCAobWFrZV9m aXhudW0gKGdseXBoLT51LmNoKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gRmNoYXJfdG9fc3RyaW5nIChtYWtlX2ZpeG51bSAoZ2x5cGgtPnUuY2gp KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFFuaWw7 CisgICAgICAgICAgICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiZHJhd19nbHlwaHMgLS0g cmlnaHRfb3ZlcndyaXR0ZW46ICAlZCB8ICVzXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgZ2x5cGgtPnUuY2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAoKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIGdseXBoLT51LmNoID09IDEwKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gIlxcdCIKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiAoIU5JTFAgKGNoYXJhY3RlcikKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGgtPnUuY2ggPT0gMTApCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAiXFxuIgorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaC0+dS5jaCA9PSAz MikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICJcXHMiCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChjaGFyYWN0 ZXIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBo LT51LmNoICE9IDkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgZ2x5cGgtPnUuY2ggIT0gMTAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgZ2x5cGgtPnUuY2ggIT0gMzIpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBTU0RBVEEgKGNoYXJhY3RlcikKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiAiXFw/IikpOworICAgICAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAgICAgICBza2lwX3AgPSB0cnVlOworICAgICAgICAgICAgICAgICAgYnJl YWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBjYXNlIElNQUdFX0dMWVBIOgor ICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYmVnIC09 IDE7CisgICAgICAgICAgfQorCisgICAgICBpZiAoaSA+PSAwCisgICAgICAgICAgJiYgIXNraXBf cCkKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCXsKIAkgIGVudW0gZHJhd19nbHlw aHNfZmFjZSBvdmVybGFwX2hsOwogCkBAIC0yNzA2OSw2ICszMjU1OSwyNCBAQCBhcHBlbmRfZ2x5 cGggKHN0cnVjdCBpdCAqaXQpCiAJICAgIGdbMV0gPSAqZzsKIAkgIGdseXBoID0gaXQtPmdseXBo X3Jvdy0+Z2x5cGhzW2FyZWFdOwogCX0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFIENVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPnggPSBpdC0+Y3VycmVudF94Owor CisgICAgICBnbHlwaC0+eSA9IGl0LT5jdXJyZW50X3k7CisKKyAgICAgIGdseXBoLT5ocG9zID0g aXQtPmhwb3M7CisKKyAgICAgIGdseXBoLT52cG9zID0gaXQtPnZwb3M7CisKKyAgICAgIGdseXBo LT56dl9wID0gaXQtPnp2X3A7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAg IGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5v YmplY3QgPSBpdC0+b2JqZWN0OwogICAgICAgaWYgKGl0LT5waXhlbF93aWR0aCA+IDApCkBAIC0y NzE1Miw2ICszMjY2MCwyNCBAQCBhcHBlbmRfY29tcG9zaXRlX2dseXBoIChzdHJ1Y3QgaXQgKml0 KQogCSAgICBnWzFdID0gKmc7CiAJICBnbHlwaCA9IGl0LT5nbHlwaF9yb3ctPmdseXBoc1tpdC0+ YXJlYV07CiAJfQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VS U09SUyAqLworCisgICAgICBnbHlwaC0+eCA9IGl0LT5jdXJyZW50X3g7CisKKyAgICAgIGdseXBo LT55ID0gaXQtPmN1cnJlbnRfeTsKKworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKwor ICAgICAgZ2x5cGgtPnZwb3MgPSBpdC0+dnBvczsKKworICAgICAgZ2x5cGgtPnp2X3AgPSBpdC0+ enZfcDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgZ2x5cGgtPmNoYXJw b3MgPSBpdC0+Y21wX2l0LmNoYXJwb3M7CiAgICAgICBnbHlwaC0+b2JqZWN0ID0gaXQtPm9iamVj dDsKICAgICAgIGVhc3NlcnQgKGl0LT5waXhlbF93aWR0aCA8PSBTSFJUX01BWCk7CkBAIC0yNzM2 MCw2ICszMjg4NiwyNCBAQCBwcm9kdWNlX2ltYWdlX2dseXBoIChzdHJ1Y3QgaXQgKml0KQogCX0K ICAgICAgIGlmIChnbHlwaCA8IGl0LT5nbHlwaF9yb3ctPmdseXBoc1thcmVhICsgMV0pCiAJewor CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisg ICAgICBnbHlwaC0+eCA9IGl0LT5jdXJyZW50X3g7CisKKyAgICAgIGdseXBoLT55ID0gaXQtPmN1 cnJlbnRfeTsKKworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKworICAgICAgZ2x5cGgt PnZwb3MgPSBpdC0+dnBvczsKKworICAgICAgZ2x5cGgtPnp2X3AgPSBpdC0+enZfcDsKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogCSAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChp dC0+cG9zaXRpb24pOwogCSAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAJICBnbHlwaC0+ cGl4ZWxfd2lkdGggPSBjbGlwX3RvX2JvdW5kcyAoLTEsIGl0LT5waXhlbF93aWR0aCwgU0hSVF9N QVgpOwpAQCAtMjc0NjMsNiArMzMwMDcsMjQgQEAgcHJvZHVjZV94d2lkZ2V0X2dseXBoIChzdHJ1 Y3QgaXQgKml0KQogCX0KICAgICAgIGlmIChnbHlwaCA8IGl0LT5nbHlwaF9yb3ctPmdseXBoc1th cmVhICsgMV0pCiAJeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUg Q1VSU09SUyAqLworCisgICAgICBnbHlwaC0+eCA9IGl0LT5jdXJyZW50X3g7CisKKyAgICAgIGds eXBoLT55ID0gaXQtPmN1cnJlbnRfeTsKKworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsK KworICAgICAgZ2x5cGgtPnZwb3MgPSBpdC0+dnBvczsKKworICAgICAgZ2x5cGgtPnp2X3AgPSBp dC0+enZfcDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgZ2x5cGgtPmNoYXJw b3MgPSBDSEFSUE9TIChpdC0+cG9zaXRpb24pOwogCSAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmpl Y3Q7CiAJICBnbHlwaC0+cGl4ZWxfd2lkdGggPSBjbGlwX3RvX2JvdW5kcyAoLTEsIGl0LT5waXhl bF93aWR0aCwgU0hSVF9NQVgpOwpAQCAtMjc1NDksNiArMzMxMTEsMjQgQEAgYXBwZW5kX3N0cmV0 Y2hfZ2x5cGggKHN0cnVjdCBpdCAqaXQsIExpc3BfT2JqZWN0IG9iamVjdCwKIAkgICAgd2lkdGgg LT0gaXQtPmZpcnN0X3Zpc2libGVfeCAtIGl0LT5jdXJyZW50X3g7CiAJICBlYXNzZXJ0ICh3aWR0 aCA+IDApOwogCX0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENV UlNPUlMgKi8KKworICAgICAgZ2x5cGgtPnggPSBpdC0+Y3VycmVudF94OworCisgICAgICBnbHlw aC0+eSA9IGl0LT5jdXJyZW50X3k7CisKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisK KyAgICAgIGdseXBoLT52cG9zID0gaXQtPnZwb3M7CisKKyAgICAgIGdseXBoLT56dl9wID0gaXQt Pnp2X3A7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIGdseXBoLT5jaGFy cG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5vYmplY3QgPSBvYmpl Y3Q7CiAgICAgICAvKiBGSVhNRTogSXQgd291bGQgYmUgYmV0dGVyIHRvIHVzZSBUWVBFX01BWCBo ZXJlLCBidXQKQEAgLTI4MDAzLDYgKzMzNTgzLDI0IEBAIGFwcGVuZF9nbHlwaGxlc3NfZ2x5cGgg KHN0cnVjdCBpdCAqaXQsIGludCBmYWNlX2lkLCBib29sIGZvcl9ub19mb250LCBpbnQgbGVuLAog CSAgICBnWzFdID0gKmc7CiAJICBnbHlwaCA9IGl0LT5nbHlwaF9yb3ctPmdseXBoc1thcmVhXTsK IAl9CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICov CisKKyAgICAgIGdseXBoLT54ID0gaXQtPmN1cnJlbnRfeDsKKworICAgICAgZ2x5cGgtPnkgPSBp dC0+Y3VycmVudF95OworCisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworCisgICAgICBn bHlwaC0+dnBvcyA9IGl0LT52cG9zOworCisgICAgICBnbHlwaC0+enZfcCA9IGl0LT56dl9wOwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICBnbHlwaC0+Y2hhcnBvcyA9IENI QVJQT1MgKGl0LT5wb3NpdGlvbik7CiAgICAgICBnbHlwaC0+b2JqZWN0ID0gaXQtPm9iamVjdDsK ICAgICAgIGVhc3NlcnQgKGl0LT5waXhlbF93aWR0aCA8PSBTSFJUX01BWCk7CkBAIC0yOTE1NCw2 ICszNDc1MiwxNiBAQCBnZXRfc3BlY2lmaWVkX2N1cnNvcl90eXBlIChMaXNwX09iamVjdCBhcmcs IGludCAqd2lkdGgpCiB7CiAgIGVudW0gdGV4dF9jdXJzb3Jfa2luZHMgdHlwZTsKIAorCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworICBpZiAoRVEg KGFyZywgUWZyYW1lZCkpCisgICAgcmV0dXJuIEZSQU1FRF9CT1hfQ1VSU09SOworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKworCiAgIGlmIChOSUxQIChhcmcpKQogICAgIHJldHVybiBOT19D VVJTT1I7CiAKQEAgLTI5MzAzLDkgKzM0OTExLDE5IEBAIGdldF93aW5kb3dfY3Vyc29yX3R5cGUg KHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaCAqZ2x5cGgsIGludCAqd2lkdGgsCiAgICAg ICBhbHRfY3Vyc29yID0gQlZBUiAoYiwgY3Vyc29yX2luX25vbl9zZWxlY3RlZF93aW5kb3dzKTsK ICAgICAgIGlmICghRVEgKFF0LCBhbHRfY3Vyc29yKSkKIAlyZXR1cm4gZ2V0X3NwZWNpZmllZF9j dXJzb3JfdHlwZSAoYWx0X2N1cnNvciwgd2lkdGgpOworCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCiAgICAgICAvKiB0IG1lYW5zIG1vZGlmeSB0 aGUgbm9ybWFsIGN1cnNvciB0eXBlLiAgKi8KLSAgICAgIGlmIChjdXJzb3JfdHlwZSA9PSBGSUxM RURfQk9YX0NVUlNPUikKLQljdXJzb3JfdHlwZSA9IEhPTExPV19CT1hfQ1VSU09SOworICAgICAg aWYgKGN1cnNvcl90eXBlID09IEZJTExFRF9CT1hfQ1VSU09SCisgICAgICAgICAgfHwgY3Vyc29y X3R5cGUgPT0gRlJBTUVEX0JPWF9DVVJTT1IpCisgICAgICAgIGN1cnNvcl90eXBlID0gSE9MTE9X X0JPWF9DVVJTT1I7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIGVsc2Ug aWYgKGN1cnNvcl90eXBlID09IEJBUl9DVVJTT1IgJiYgKndpZHRoID4gMSkKIAktLSp3aWR0aDsK ICAgICAgIHJldHVybiBjdXJzb3JfdHlwZTsKQEAgLTI5MzE4LDcgKzM0OTM2LDE3IEBAIGdldF93 aW5kb3dfY3Vyc29yX3R5cGUgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaCAqZ2x5cGgs IGludCAqd2lkdGgsCiAgICAgICAgIHJldHVybiBOT19DVVJTT1I7CiAgICAgICBpZiAoZ2x5cGgg IT0gTlVMTCAmJiBnbHlwaC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkKIAl7Ci0JICBpZiAoY3Vyc29y X3R5cGUgPT0gRklMTEVEX0JPWF9DVVJTT1IpCisKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKwkgIGlmIChjdXJzb3JfdHlwZSA9PSBGSUxMRURf Qk9YX0NVUlNPUgorICAgICAgICAgIHx8IGN1cnNvcl90eXBlID09IEZSQU1FRF9CT1hfQ1VSU09S KQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAgIHsKIAkgICAgICAvKiBVc2lu ZyBhIGJsb2NrIGN1cnNvciBvbiBsYXJnZSBpbWFnZXMgY2FuIGJlIHZlcnkgYW5ub3lpbmcuCiAJ CSBTbyB1c2UgYSBob2xsb3cgY3Vyc29yIGZvciAibGFyZ2UiIGltYWdlcy4KQEAgLTI5MzcwLDkg KzM0OTk4LDE3IEBAIGdldF93aW5kb3dfY3Vyc29yX3R5cGUgKHN0cnVjdCB3aW5kb3cgKncsIHN0 cnVjdCBnbHlwaCAqZ2x5cGgsIGludCAqd2lkdGgsCiAgICAgICAgbmFycm93IFtoXWJhciAgIDwt PiAgIG5vIGN1cnNvcgogICAgICAgIG90aGVyIHR5cGUgICAgICA8LT4gICBubyBjdXJzb3IgICov CiAKLSAgaWYgKGN1cnNvcl90eXBlID09IEZJTExFRF9CT1hfQ1VSU09SKQorCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKworICBpZiAoY3Vyc29yX3R5 cGUgPT0gRklMTEVEX0JPWF9DVVJTT1IKKyAgICAgIHx8IGN1cnNvcl90eXBlID09IEZSQU1FRF9C T1hfQ1VSU09SKQogICAgIHJldHVybiBIT0xMT1dfQk9YX0NVUlNPUjsKIAorLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisKKwogICBpZiAoKGN1cnNvcl90eXBlID09IEJBUl9DVVJTT1IgfHwgY3Vy c29yX3R5cGUgPT0gSEJBUl9DVVJTT1IpICYmICp3aWR0aCA+IDEpCiAgICAgewogICAgICAgKndp ZHRoID0gMTsKQEAgLTI5NjI5LDggKzM1MjY1LDE3IEBAIGVyYXNlX3BoeXNfY3Vyc29yIChzdHJ1 Y3Qgd2luZG93ICp3KQogICAgICAgJiYgY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdID4gaHBv cyAmJiBocG9zID49IDApCiAgICAgbW91c2VfZmFjZV9oZXJlX3AgPSB0cnVlOwogCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCiAgIC8qIE1heWJl IGNsZWFyIHRoZSBkaXNwbGF5IHVuZGVyIHRoZSBjdXJzb3IuICAqLwotICBpZiAody0+cGh5c19j dXJzb3JfdHlwZSA9PSBIT0xMT1dfQk9YX0NVUlNPUikKKyAgaWYgKHctPnBoeXNfY3Vyc29yX3R5 cGUgPT0gSE9MTE9XX0JPWF9DVVJTT1IKKyAgICAgIHx8IHctPnBoeXNfY3Vyc29yX3R5cGUgPT0g RlJBTUVEX0JPWF9DVVJTT1IpCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICB7 CiAgICAgICBpbnQgeCwgeTsKICAgICAgIGludCBoZWFkZXJfbGluZV9oZWlnaHQgPSBXSU5ET1df SEVBREVSX0xJTkVfSEVJR0hUICh3KTsKQEAgLTI5NzY5LDkgKzM1NDE0LDM4IEBAIGRpc3BsYXlf YW5kX3NldF9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgb24sCiAgICAgICB3LT5waHlz X2N1cnNvci52cG9zID0gdnBvczsKICAgICB9CiAKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgdy0+bWMuaCA9IC0xOworICB3LT5tYy5meCA9 IC0xOworICB3LT5tYy5meSA9IC0xOworICB3LT5tYy5nbHlwaF9mbGF2b3IgPSBOT19GTEFWT1I7 CisgIHctPm1jLnJlZCA9IC0xLjA7CisgIHctPm1jLmdyZWVuID0gLTEuMDsKKyAgdy0+bWMuYmx1 ZSA9IC0xLjA7CisgIHctPm1jLnBvc2ludCA9IC0xOworCisgIC8qIEZvciB0aGUgYmVuZWZpdCBv ZiB0aGUgTlMgcG9ydCB1c2Vycywgd2Ugc2V0IGB3LT5tYy5hY3RpdmVfcGAsIHdoaWNoIGlzCisg IHVzZWQgYnkgYG5zX2RyYXdfZ2x5cGhfc3RyaW5nJyB3aGVuIHNldHRpbmcgdGhlIGdseXBoIGNo YXJhY3RlciBmb3JlZ3JvdW5kLiAqLworICB3LT5tYy5hY3RpdmVfcCA9IGFjdGl2ZV9jdXJzb3I7 CisKICAgRlJBTUVfUklGIChmKS0+ZHJhd193aW5kb3dfY3Vyc29yICh3LCBnbHlwaF9yb3csIHgs IHksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2N1cnNvcl90eXBl LCBuZXdfY3Vyc29yX3dpZHRoLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IG9uLCBhY3RpdmVfY3Vyc29yKTsKKworICB3LT5tYy5hY3RpdmVfcCA9IGZhbHNlOworCisgIG1j X211bHRpcGxlX2N1cnNvcnNfcG9ydGFsICh3LCBvbiwgYWN0aXZlX2N1cnNvcik7CisKKyAgbWNf Y3Jvc3NoYWlyc19wb3J0YWwgKHcsIG9uLCBhY3RpdmVfY3Vyc29yKTsKKworICBtY19maWxsX2Nv bHVtbl9wb3J0YWwgKHcsIG9uLCBhY3RpdmVfY3Vyc29yKTsKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogfQogCiAKQEAgLTI5ODM2LDYgKzM1NTEwLDE2IEBAIHVwZGF0ZV9jdXJzb3Jf aW5fd2luZG93X3RyZWUgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgb25fcCkKIHZvaWQKIHhfdXBk YXRlX2N1cnNvciAoc3RydWN0IGZyYW1lICpmLCBib29sIG9uX3ApCiB7CisKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKKyAgVFJBQ0UgKChzdGRl cnIsICJ4X3VwZGF0ZV9jdXJzb3I6ICBvbl9wICglZClcbiIsIG9uX3ApKTsKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogICB1cGRhdGVfY3Vyc29yX2luX3dpbmRvd190cmVlIChYV0lO RE9XIChmLT5yb290X3dpbmRvdyksIG9uX3ApOwogfQogCkBAIC0yOTg0OCw4ICszNTUzMiwyMCBA QCB4X3VwZGF0ZV9jdXJzb3IgKHN0cnVjdCBmcmFtZSAqZiwgYm9vbCBvbl9wKQogdm9pZAogeF9j bGVhcl9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncpCiB7CisKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRSBDVVJTT1JTICovCisKICAgaWYgKEZSQU1FX1ZJU0lCTEVfUCAo WEZSQU1FICh3LT5mcmFtZSkpICYmIHctPnBoeXNfY3Vyc29yX29uX3ApCi0gICAgdXBkYXRlX3dp bmRvd19jdXJzb3IgKHcsIGZhbHNlKTsKKyAgICB7CisgICAgICBUUkFDRSAoKHN0ZGVyciwgInhf Y2xlYXJfY3Vyc29yXG4iKSk7CisgICAgICB1cGRhdGVfd2luZG93X2N1cnNvciAodywgZmFsc2Up OworICAgIH0KKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAjZW5kaWYgLyog SEFWRV9XSU5ET1dfU1lTVEVNICovCkBAIC0zMjMzOCwxMCArMzgwMzQsMjAgQEAgZXhwb3NlX3dp bmRvdyAoc3RydWN0IHdpbmRvdyAqdywgWFJlY3RhbmdsZSAqZnIpCiAJICBpZiAoV0lORE9XX0JP VFRPTV9ESVZJREVSX1dJRFRIICh3KSkKIAkgICAgeF9kcmF3X2JvdHRvbV9kaXZpZGVyICh3KTsK IAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFIENVUlNPUlMgKi8KKwor I2lmICFkZWZpbmVkIChIQVZFX05TKQogCSAgLyogVHVybiB0aGUgY3Vyc29yIG9uIGFnYWluLiAg Ki8KIAkgIGlmIChjdXJzb3JfY2xlYXJlZF9wCiAJICAgICAgfHwgKHBoeXNfY3Vyc29yX29uX3Ag JiYgIXctPnBoeXNfY3Vyc29yX29uX3ApKQogCSAgICB1cGRhdGVfd2luZG93X2N1cnNvciAodywg dHJ1ZSk7CisjZW5kaWYKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCX0KICAgICB9 CiAKQEAgLTMyNTM5LDYgKzM4MjQ1LDMwIEBAIHhfaW50ZXJzZWN0X3JlY3RhbmdsZXMgKFhSZWN0 YW5nbGUgKnIxLCBYUmVjdGFuZ2xlICpyMiwgWFJlY3RhbmdsZSAqcmVzdWx0KQogdm9pZAogc3lt c19vZl94ZGlzcCAodm9pZCkKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1V TFRJUExFIENVUlNPUlMgKi8KKworICBkZWZzdWJyICgmU21jX2R1bXBfZ2x5cGhfcm93KTsKKwor ICBkZWZzdWJyICgmU21jX2R1bXBfZ2x5cGhfbWF0cml4KTsKKworICBkZWZzdWJyICgmU21jX2Fj dGl2YXRlX211bHRpcGxlX2N1cnNvcnMpOworCisgIGRlZnN1YnIgKCZTbWNfYWN0aXZhdGVfY3Jv c3NoYWlycyk7CisKKyAgZGVmc3ViciAoJlNtY19zdGRlcnIpOworCisgIGRlZnN1YnIgKCZTbWNf ZGVidWcpOworCisgIGRlZnN1YnIgKCZTbWNfYWN0aXZhdGVfZmlsbF9jb2x1bW4pOworCisgIERF RlNZTSAoUWZyYW1lZCwgImZyYW1lZCIpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAgIFZ3aXRoX2VjaG9fYXJlYV9zYXZlX3ZlY3RvciA9IFFuaWw7CiAgIHN0YXRpY3BybyAoJlZ3 aXRoX2VjaG9fYXJlYV9zYXZlX3ZlY3Rvcik7CiAKZGlmZiAtLWdpdCBhL3NyYy94dGVybS5jIGIv c3JjL3h0ZXJtLmMKaW5kZXggOTQzZjRjMy4uNTgxMjE0YyAxMDA2NDQKLS0tIGEvc3JjL3h0ZXJt LmMKKysrIGIvc3JjL3h0ZXJtLmMKQEAgLTk5Nyw2ICs5OTcsMTUgQEAgeF91cGRhdGVfYmVnaW4g KHN0cnVjdCBmcmFtZSAqZikKICAgaWYgKEZSQU1FX1RPT0xUSVBfUCAoZikgJiYgIUZSQU1FX1ZJ U0lCTEVfUCAoZikpCiAgICAgcmV0dXJuOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gZjsKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBpZiAoISBGUkFNRV9DUl9TVVJGQUNFIChm KSkKICAgICB7CiAgICAgICBpbnQgd2lkdGgsIGhlaWdodDsKQEAgLTEyNjQsNiArMTI3MywxNiBA QCB4X3VwZGF0ZV9lbmQgKHN0cnVjdCBmcmFtZSAqZikKICAgWEZsdXNoIChGUkFNRV9YX0RJU1BM QVkgKGYpKTsKICAgdW5ibG9ja19pbnB1dCAoKTsKICNlbmRpZgorCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2Zy YW1lID0gTlVMTDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAvKiBUaGlz IGZ1bmN0aW9uIGlzIGNhbGxlZCBmcm9tIHZhcmlvdXMgcGxhY2VzIGluIHhkaXNwLmMKQEAgLTE1 MzYsNiArMTU1NSwyMCBAQCBzdGF0aWMgdm9pZCB4X2NoZWNrX2ZvbnQgKHN0cnVjdCBmcmFtZSAq LCBzdHJ1Y3QgZm9udCAqKTsKIHN0YXRpYyB2b2lkCiB4X3NldF9jdXJzb3JfZ2MgKHN0cnVjdCBn bHlwaF9zdHJpbmcgKnMpCiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRSBDVVJTT1JTICovCisKKyAgaWYgKHMtPnctPm1jLmN1cnNvcl9nY19kZWZhdWx0KQorICAg IHsKKyAgICAgIHMtPmdjID0gcy0+Zi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djOworICAgICAg cmV0dXJuOworICAgIH0KKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBpZiAocy0+ Zm9udCA9PSBGUkFNRV9GT05UIChzLT5mKQogICAgICAgJiYgcy0+ZmFjZS0+YmFja2dyb3VuZCA9 PSBGUkFNRV9CQUNLR1JPVU5EX1BJWEVMIChzLT5mKQogICAgICAgJiYgcy0+ZmFjZS0+Zm9yZWdy b3VuZCA9PSBGUkFNRV9GT1JFR1JPVU5EX1BJWEVMIChzLT5mKQpAQCAtOTI1OCw2ICs5MjkxLDI2 IEBAIHhfZHJhd19ob2xsb3dfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhf cm93ICpyb3cpCiAKICAgLyogQ29tcHV0ZSBmcmFtZS1yZWxhdGl2ZSBjb29yZGluYXRlcyBmb3Ig cGh5cyBjdXJzb3IuICAqLwogICBnZXRfcGh5c19jdXJzb3JfZ2VvbWV0cnkgKHcsIHJvdywgY3Vy c29yX2dseXBoLCAmeCwgJnksICZoKTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFIENVUlNPUlMgKi8KKworLyogTEVHRU5EOgorCistICB0b3AgeSA9PSBXSU5ET1df VE9fRlJBTUVfUElYRUxfWSAodywgcm93LT55KQorCistICBib3R0b20geSA9PSBXSU5ET1dfVE9f RlJBTUVfUElYRUxfWSAodywgcm93LT55KSAtIHJvdy0+aGVpZ2h0CisKKy0gIGggb2YgSE9MTE9X X0JPWF9DVVJTT1IgPT0gcm93LT5oZWlnaHQKKyAgIFtUaGlzIGF2b2lkcyBhIHZpc2libGUgZ2Fw IGFib3ZlL2JlbG93Ll0gKi8KKworICBpZiAody0+bWMuaCA+IDApCisgICAgaCA9IHJvdy0+aGVp Z2h0OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIHdkID0gdy0+cGh5c19jd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Vncm91bmQgPSBmLT5vdXRwdXRfZGF0YS54LT5jdXJz b3JfcGl4ZWw7CkBAIC05MzY1LDYgKzk0MjgsMTcgQEAgeF9kcmF3X2Jhcl9jdXJzb3IgKHN0cnVj dCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgaW50IHdpZHRoLCBlbnVtIHRleHQK IAkgIGlmICgoY3Vyc29yX2dseXBoLT5yZXNvbHZlZF9sZXZlbCAmIDEpICE9IDApCiAJICAgIHgg Kz0gY3Vyc29yX2dseXBoLT5waXhlbF93aWR0aCAtIHdpZHRoOwogCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUgQ1VSU09SUyAqLworCisgICAgLyogQWxpZ24gYWxsIGZh a2UgQkFSX0NVUlNPUiBvZiB0aGUgVkVSVElDQUxfUlVMRVIgd2l0aCBgb3BvaW50X3gnLiAqLwor ICAgIGlmICh3LT5tYy5meCA+IDApCisgICAgICB4ID0gdy0+bWMuZng7CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKIAkgIHhfZmlsbF9yZWN0YW5nbGUgKGYsIGdjLCB4LAogCQkJICBX SU5ET1dfVE9fRlJBTUVfUElYRUxfWSAodywgdy0+cGh5c19jdXJzb3IueSksCiAJCQkgIHdpZHRo LCByb3ctPmhlaWdodCk7CkBAIC05NDQxLDMxICs5NTE1LDI0MCBAQCB4X2RyYXdfd2luZG93X2N1 cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqZ2x5cGhfcm93LCBpbnQg eCwKIAl9CiAgICAgICBlbHNlCiAJewotCSAgc3dpdGNoIChjdXJzb3JfdHlwZSkKLQkgICAgewot CSAgICBjYXNlIEhPTExPV19CT1hfQ1VSU09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M7CisgICAgICBDSEVDS19CVUZGRVIgKGJ1Zik7CisgICAgICBz dHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAoYnVmKTsKKyAgICAgIGJvb2wgcmVnaW9uX2FjdGl2 ZV9wID0gKCFOSUxQIChWdHJhbnNpZW50X21hcmtfbW9kZSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBtYXJrX2FjdGl2ZSkpKTsKKyAgICAgIHB0cmRp ZmZfdCByZWdpb25fYmVnaW5uaW5nID0gKHJlZ2lvbl9hY3RpdmVfcCkgPyBYRklYTlVNIChGcmVn aW9uX2JlZ2lubmluZyAoKSkgOiAtMTsKKyAgICAgIHB0cmRpZmZfdCByZWdpb25fZW5kID0gKHJl Z2lvbl9hY3RpdmVfcCkgPyBYRklYTlVNIChGcmVnaW9uX2VuZCAoKSkgOiAtMTsKKyAgICAgIHB0 cmRpZmZfdCBvcG9pbnRfcHQgPSAodyA9PSBYV0lORE9XIChzZWxlY3RlZF93aW5kb3cpKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gUFQKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IFhGSVhOVU0gKEZtYXJrZXJfcG9zaXRpb24gKHctPnBvaW50bSkpOworICAgICAgYm9vbCBy ZWdpb25faW5fYm91bmRzX3AgPSAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBvcG9pbnRfcHQgPj0gcmVnaW9uX2JlZ2lubmluZworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3B0IDwgcmVnaW9uX2VuZCk7CisgICAg ICBpZiAoZ2x5cGgtPnR5cGUgIT0gSU1BR0VfR0xZUEggJiYgdy0+bWMucmVkID49IDAgJiYgdy0+ bWMuYmx1ZSA+PSAwICYmIHctPm1jLmdyZWVuID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAv KiBUZW1wb3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dyb3VuZCk7Cisg ICAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91 dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9yZWdpb25fb3V0X2ZhY2UtPmZv cmVncm91bmQpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UgaWYgKCFyZWdp b25fYWN0aXZlX3AgJiYgYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9m YWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItZmFjZSIpLCB0cnVlKTsKKyAg ICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZS T01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICBYU2V0 Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29y X2djLCBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgICAg WFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1 cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9mYWNlLT5iYWNrZ3JvdW5kKTsKKyAgICAgICAgICAgICAg ICB9CisgICAgICAgICAgICAgICAgLyogVGhlIHJlZ2lvbiBpcyBfbm90XyB2aXNpYmxlIGluIHRo ZSBpbmFjdGl2ZSB3aW5kb3cgYmVjYXVzZSB0aGUgb3ZlcmxheSB3aW5kb3cgcHJvcGVydHkgaXMg dXNlZC4gKi8KKyAgICAgICAgICAgICAgICBlbHNlIGlmICghYWN0aXZlX3ApCisgICAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfaW5hY3Rp dmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFr ZS1jdXJzb3ItaW5hY3RpdmUtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgc3Ry dWN0IGZhY2UgKmhvbGxvd19pbmFjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3df aW5hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChG UkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19p bmFjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgICAgWFNldEJhY2tn cm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywg aG9sbG93X2luYWN0aXZlX2ZhY2UtPmJhY2tncm91bmQpOworICAgICAgICAgICAgICAgICAgfQor ICAgICAgICAgIGJsb2NrX2lucHV0ICgpOworICAgICAgICAgIC8qIEZvcmNlIGB4X3NldF9jdXJz b3JfZ2MnIHRvIHVzZSBgcy0+Zi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djJy4gICovCisgICAg ICAgICAgdy0+bWMuY3Vyc29yX2djX2RlZmF1bHQgPSB0cnVlOworICAgICAgICAgIGRyYXdfcGh5 c19jdXJzb3JfZ2x5cGggKHcsIGdseXBoX3JvdywgRFJBV19DVVJTT1IpOworICAgICAgICAgIHct Pm1jLmN1cnNvcl9nY19kZWZhdWx0ID0gZmFsc2U7CisgICAgICAgICAgWFNldEZvcmVncm91bmQg KEZSQU1FX1h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AgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAvKiBUaGUg cmVnaW9uIGlzIF9ub3RfIHZpc2libGUgaW4gdGhlIGluYWN0aXZlIHdpbmRvdyBiZWNhdXNlIHRo ZSBvdmVybGF5IHdpbmRvdyBwcm9wZXJ0eSBpcyB1c2VkLiAqLworICAgICAgICAgICAgICAgICAg ICBlbHNlIGlmICghYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkID0gbG9v a3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2 ZS1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhv bGxvd19pbmFjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfaW5hY3RpdmVfZmFj ZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9E SVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfaW5hY3RpdmVf ZmFjZS0+Zm9yZWdyb3VuZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBYU2V0QmFja2dyb3Vu ZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xs b3dfaW5hY3RpdmVfZmFjZS0+YmFja2dyb3VuZCk7CisgICAgICAgICAgICAgICAgICAgICAgfQor ICAgICAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgLyogRm9yY2UgYHhf c2V0X2N1cnNvcl9nYycgdG8gdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MnLiAg Ki8KKyAgICAgICAgICAgICAgdy0+bWMuY3Vyc29yX2djX2RlZmF1bHQgPSB0cnVlOworICAgICAg ICAgICAgICBkcmF3X3BoeXNfY3Vyc29yX2dseXBoICh3LCBnbHlwaF9yb3csIERSQVdfQ1VSU09S KTsKKyAgICAgICAgICAgICAgdy0+bWMuY3Vyc29yX2djX2RlZmF1bHQgPSBmYWxzZTsKKyAgICAg ICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9k YXRhLngtPmN1cnNvcl9nYywgeGdjdi5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgWFNldEJh Y2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9n YywgeGdjdi5iYWNrZ3JvdW5kKTsKKyAgICAgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAg ICAgICAgICAgICAgLyogRHJhdyB0aGUgZnJhbWUgYXJvdW5kIHRoZSBib3guICovCisgICAgICAg ICAgICAgIHhfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBnbHlwaF9yb3cpOworICAgICAgICAgICAg fQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgSE9MTE9XX0JPWF9DVVJTT1I6CisgICAg eworICAgICAgaWYgKHctPm1jLnJlZCA+PSAwICYmIHctPm1jLmJsdWUgPj0gMCAmJiB3LT5tYy5n cmVlbiA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBm LT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgICBmLT5vdXRwdXRf ZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBjb2xvci5waXhlbDsKKyAgICAgICAgICB4X2RyYXdfaG9s bG93X2N1cnNvciAodywgZ2x5cGhfcm93KTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5j dXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgIH0KKyAgICAgICAg ZWxzZQorICAgICAgICAgIHhfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBnbHlwaF9yb3cpOworICAg ICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgRklMTEVEX0JPWF9DVVJTT1I6CisgICAgeworICAg ICAgaWYgKHctPm1jLnJlZCA+PSAwICYmIHctPm1jLmJsdWUgPj0gMCAmJiB3LT5tYy5ncmVlbiA+ PSAwKQorICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1 cnNvcl9nYycgYnkgYm9ycm93aW5nIHRoZQorICAgICAgICBmdW5jdGlvbmFsaXR5IG9mIGB4X21h a2VfZ2MnIGluIHhmbnMuYy4gICovCisgICAgICAgIHsKKyAgICAgICAgICBibG9ja19pbnB1dCAo KTsKKyAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0 cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBGUkFNRV9CQUNLR1JPVU5EX1BJWEVMIChmKSk7CisgICAg ICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRh LngtPmN1cnNvcl9nYywgY29sb3IucGl4ZWwpOworICAgICAgICAgIC8qIEZvcmNlIGB4X3NldF9j dXJzb3JfZ2MnIHRvIHVzZSBgcy0+Zi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djJy4gICovCisg ICAgICAgICAgdy0+bWMuY3Vyc29yX2djX2RlZmF1bHQgPSB0cnVlOworICAgICAgICAgIGRyYXdf cGh5c19jdXJzb3JfZ2x5cGggKHcsIGdseXBoX3JvdywgRFJBV19DVVJTT1IpOworICAgICAgICAg IHctPm1jLmN1cnNvcl9nY19kZWZhdWx0ID0gZmFsc2U7CisgICAgICAgICAgWFNldEZvcmVncm91 bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgeGdj di5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZ IChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCB4Z2N2LmJhY2tncm91bmQpOworICAg ICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAg ICAgIGRyYXdfcGh5c19jdXJzb3JfZ2x5cGggKHcsIGdseXBoX3JvdywgRFJBV19DVVJTT1IpOwor ICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgQkFSX0NVUlNPUjoKKyAgICB7CisgICAgICBp ZiAody0+bWMucmVkID49IDAgJiYgdy0+bWMuYmx1ZSA+PSAwICYmIHctPm1jLmdyZWVuID49IDAp CisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9k YXRhLngtPmN1cnNvcl9waXhlbCcuICAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1 cnNvcl9waXhlbCA9IGNvbG9yLnBpeGVsOworICAgICAgICAgIHctPm1jLmN1cnNvcl9nY19pbnZp c2libGVfb2theSA9IHRydWU7CisgICAgICAgICAgeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIGdseXBo X3JvdywgY3Vyc29yX3dpZHRoLCBCQVJfQ1VSU09SKTsKKyAgICAgICAgICB3LT5tYy5jdXJzb3Jf Z2NfaW52aXNpYmxlX29rYXkgPSBmYWxzZTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5j dXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgIH0KKyAgICAgICAg ZWxzZQorICAgICAgICAgIHhfZHJhd19iYXJfY3Vyc29yICh3LCBnbHlwaF9yb3csIGN1cnNvcl93 aWR0aCwgQkFSX0NVUlNPUik7CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBIQkFSX0NV UlNPUjoKKyAgICB7CisgICAgICBpZiAody0+bWMucmVkID49IDAgJiYgdy0+bWMuYmx1ZSA+PSAw ICYmIHctPm1jLmdyZWVuID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3Jhcmls eSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCcuICAqLworICAgICAgICAg IGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IGNvbG9yLnBpeGVsOworICAgICAgICAg IHctPm1jLmN1cnNvcl9nY19pbnZpc2libGVfb2theSA9IHRydWU7CisgICAgICAgICAgeF9kcmF3 X2Jhcl9jdXJzb3IgKHcsIGdseXBoX3JvdywgY3Vyc29yX3dpZHRoLCBIQkFSX0NVUlNPUik7Cisg ICAgICAgICAgdy0+bWMuY3Vyc29yX2djX2ludmlzaWJsZV9va2F5ID0gZmFsc2U7CisgICAgICAg ICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVs OworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB4X2RyYXdfYmFyX2N1cnNvciAo dywgZ2x5cGhfcm93LCBjdXJzb3Jfd2lkdGgsIEhCQVJfQ1VSU09SKTsKKyAgICAgIGJyZWFrOwor ICAgIH0KKyAgICBjYXNlIE5PX0NVUlNPUjoKKyAgICAgIHctPnBoeXNfY3Vyc29yX3dpZHRoID0g MDsKKyAgICAgIGJyZWFrOworICAgIGRlZmF1bHQ6CisgICAgICBlbWFjc19hYm9ydCAoKTsKKyAg fQorCisvKiBlbmQgTVVMVElQTEUgQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CiAKLQkgICAgY2FzZSBOT19DVVJTT1I6Ci0JICAgICAgdy0+cGh5c19jdXJzb3Jfd2lkdGggPSAw OwotCSAgICAgIGJyZWFrOwogCi0JICAgIGRlZmF1bHQ6Ci0JICAgICAgZW1hY3NfYWJvcnQgKCk7 Ci0JICAgIH0KIAl9CiAKICNpZmRlZiBIQVZFX1hfSTE4Tgo= --Multipart_Thu_Dec_13_23:11:07_2018-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs). References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Tue, 09 Apr 2019 04:05:01 +0000 Resent-Message-ID: <handler.22873.B22873.155478268730731 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: eliz@HIDDEN, mbork@HIDDEN, rms@HIDDEN, johnw@HIDDEN, akioburns@HIDDEN, athird@HIDDEN Cc: 17684 <at> debbugs.gnu.org, 22873 <at> debbugs.gnu.org Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.155478268730731 (code B ref 22873); Tue, 09 Apr 2019 04:05:01 +0000 Received: (at 22873) by debbugs.gnu.org; 9 Apr 2019 04:04:47 +0000 Received: from localhost ([127.0.0.1]:50428 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1hDi07-0007zb-OS for submit <at> debbugs.gnu.org; Tue, 09 Apr 2019 00:04:47 -0400 Received: from gateway32.websitewelcome.com ([192.185.145.101]:19323) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1hDi06-0007zS-BQ for 22873 <at> debbugs.gnu.org; Tue, 09 Apr 2019 00:04:46 -0400 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway32.websitewelcome.com (Postfix) with ESMTP id 17B1C87018 for <22873 <at> debbugs.gnu.org>; Mon, 8 Apr 2019 23:03:25 -0500 (CDT) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id DhymhlLAS4FKpDhymhG5dd; Mon, 08 Apr 2019 23:03:25 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Jnwwt/2GxyGacvQnqChiVGvAKViHZanh4qyJPZInpf8=; b=hG0qD0dbUVrRf/kyLAvTL0CBcw jSkd8NylHMGRnfxoTtaZqNjvLVThWLZxGfRQloU8ZkSSopULdSoeWvEeXU08Tjq2kObzka96UrJJF em7flypvyspvzabudY4PUESgv5b55lGxnXW3R3iCcc0idx658p1sQT91BYJan9xf0RJE97h4nKyyA y6e7YpX/WNNoJq7sXMy96b4Z7CokuFtInLQgSOhXsOum+MjUL28zBlcsi9qP8ugOB2Ez881uaTuPr R+2Hahgwp4Y1ebX087JpI7A3vXo7f7MU3yzQwY/98T4ybt0fwbB+UXURdhPZUnc+6o0Ag5OPD/U4f AOo2KS0w==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:54693 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from <esq@HIDDEN>) id 1hDhyj-0003Iy-7s; Mon, 08 Apr 2019 23:03:23 -0500 Date: Mon, 08 Apr 2019 21:03:20 -0700 Message-ID: <m21s2bddvb.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Mon_Apr__8_21:03:20_2019-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1hDhyj-0003Iy-7s X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:54693 X-Source-Auth: lawlist X-Email-Count: 2 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> --Multipart_Mon_Apr__8_21:03:20_2019-1 Content-Type: text/plain; charset=US-ASCII This is version 018.000 of a proof concept for multiple fake cursors and crosshairs. Special thanks to Eli Z. and Alan T. for helping me out on numerous issues over the past few months -- greatly appreciated!!! VERSION: - 018.000 [04/08/2019] CHANGELOG: - Creation of fake cursors now immediately follows calls to `draw_glyphs'. - Removal of fake cursors occurs prior to Emacs scrolling the text on the glass directly and at the outset of `update_window'. - The NS port now automatically redraws fake cursors that got erased because they were left/right overwritten glyphs, but work still needs to be done on the w32 and X ports. The future plan of attack for the w32 and X ports is probably similar to the NS port; i.e., left/right overwritten glyphs have their strings tagged during `mc_draw_glyphs' and are dealt with on a per port basis when FRAME_RIF (f)->mc_scribe_string is called. - Semi-duplicate functions have been created so as to reduce the number of entry points into the core code base of Emacs. [This approach enables semi- worry free tinkering without the risk of breaking something important.] - Removal of scroll bars no longer erase fake cursors when windows are resized or deleted on the NS and w32 ports. [I didn't see any issues on an X11 build.] - Numerous bug fixes, some minor and some major. SETUP: Step 1: git clone -b master git://git.sv.gnu.org/emacs.git Step 2: In the new emacs folder, go back to an Emacs version from 04/08/2019: git reset --hard a038df77de7b1aa2d73a6478493b8838b59e4982 Step 3: From within the new emacs folder created in Step 1, apply the patch: git apply /path/to/the/patch.diff Step 4: ./autogen.sh Step 5: ./configure ... [your custom options] Step 6: make Step 7: make install USAGE: - For a minimal working example of built-in fake cursors, type: M-x mc-test ;;; TURN ON FAKE CURSORS (buffer position, cursor-type, cursor color): (setq mc-conf '((1 "hbar" "magenta") (2 "bar" "purple") (3 "box" "#00FF00") (4 "hollow" "#0000FF") (5 ("hbar" 3) [1.0 0.0 1.0]) (6 ("bar" 3) [0.0 1.0 1.0]) (7 "framed" "OrangeRed")))) ;;; TURN OFF FAKE CURSORS: (setq mc-conf nil) - To try out the crosshairs feature, type: M-x +-mode - To try out built-in fake cursors with Magnar Sveen's multiple-cursors package, install that package first. [If the multiple-cursors package is installed, an eval-after-load "multiple-cursors-core" statement within `crosshairs.el` will redefine a couple of functions and set up a few keyboard shortcuts.] If the multiple-cursors package by Magnar Sveen is not already installed, then here are two easy ways to install that package: Type: M-x mc-install OR, evaluate the following snippet: (progn (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) (package-refresh-contents) (package-install 'multiple-cursors)) TODO: - When using the multiple fake cursors feature, a fake cursor does not show up at zv_p. - Deal with left/right overwritten glyphs in the w32 and X ports of Emacs. - Reduce the removal of fake cursors to the bare minimum when scrolling the text on the glass directly, and whenever `update_window' is called. - When an idle-timer fires and point is at the end of a horizontally scrolled line in a narrow window, the temporary horizontal scroll is canceled. Create an minimal working example and file a bug report. - There is a bug affecting the recorded `w->mc.lnum_pixel_width` that is observable when not running under gdb, but disappears when running under gdb. While viewing a folded org-mode buffer, the non-gdb instance had a visible line number pixel-width of 44, but Emacs treated it as fluctuating between 44 and 55 as the cursor was moved to the end of line. In the gdb instance, the visible line number pixel width was 55 with no fluctuation under the same conditions as the non-gdb instance. This appears to be a different bug than bug#32177 (current line number shifts one column to the left) because the line number of the current line does not shift left, and changing the bidi settings did not correct the issue. - The current test for `auto_hscroll_mode_p' only looks for `current_line` and all five related tests are based upon that assumption, which may not be true. - Multiple Cursors: If point is in the middle of a composite character, then select a fully composed character so that the fake cursor is visible. - Implement functionality similar to the Lisp multiple-cursors by Magnar Sveen. - Follow up with the Emacs team re bug#32177; i.e., (Current line number shifts one column to the left.) - Follow up with the Emacs team re bug#32060; i.e., Horizontal Scrolling (Current Line): Wrong line gets h-scrolled. - Determine if bug #28936 needs to be fixed and help the Emacs team re same. --Multipart_Mon_Apr__8_21:03:20_2019-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="2019_04_08__18_56_23_226.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvY3Jvc3NoYWlycy5lbCBiL2xpc3AvY3Jvc3NoYWlycy5lbApuZXcg ZmlsZSBtb2RlIDEwMDc1NQppbmRleCAwMDAwMDAwLi5mYzVlY2VmOQotLS0gL2Rldi9udWxsCisr KyBiL2xpc3AvY3Jvc3NoYWlycy5lbApAQCAtMC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Z2luYWwt Y29tbWFuZCAnbWMtLXVuc3VwcG9ydGVkKQorICAgICAgICAgICAgICAgICAgICAobWVzc2FnZSAi JVMgaXMgbm90IHN1cHBvcnRlZCB3aXRoIG11bHRpcGxlIGN1cnNvcnMlcyIKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgb3JpZ2luYWwtY29tbWFuZAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAoZ2V0IG9yaWdpbmFsLWNvbW1hbmQgJ21jLS11bnN1cHBvcnRlZCkpCisgICAgICAg ICAgICAgICAgICAod2hlbiAoYW5kIG9yaWdpbmFsLWNvbW1hbmQKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgKG5vdCAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jLS1kZWZhdWx0LWNtZHMt dG8tcnVuLW9uY2UpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobm90IChtZW1xIG9y aWdpbmFsLWNvbW1hbmQgbWMvY21kcy10by1ydW4tb25jZSkpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIChvciBtYy9hbHdheXMtcnVuLWZvci1hbGwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIChtZW1xIG9yaWdpbmFsLWNvbW1hbmQgbWMtLWRlZmF1bHQtY21kcy10by1y dW4tZm9yLWFsbCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtZW1xIG9yaWdp bmFsLWNvbW1hbmQgbWMvY21kcy10by1ydW4tZm9yLWFsbCkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIChtYy9wcm9tcHQtZm9yLWluY2x1c2lvbi1pbi13aGl0ZWxpc3Qgb3JpZ2lu YWwtY29tbWFuZCkpKQorICAgICAgICAgICAgICAgICAgICAobWMvZXhlY3V0ZS1jb21tYW5kLWZv ci1hbGwtZmFrZS1jdXJzb3JzIG9yaWdpbmFsLWNvbW1hbmQpKSkpCisgICAgICAgICAgICAgICh3 aGVuI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Z2VudGEiKQorICAgICAgICAgICAgICAgICAgICAgICgy ICJiYXIiICJwdXJwbGUiKQorICAgICAgICAgICAgICAgICAgICAgICgzICJib3giICIjMDBGRjAw IikKKyAgICAgICAgICAgICAgICAgICAgICAoNCAiaG9sbG93IiAiIzAwMDBGRiIpCisgICAgICAg ICAgICAgICAgICAgICAgKDUgKCJoYmFyIiAzKSBbMS4wIDAuMCAxLjBdKQorICAgICAgICAgICAg ICAgICAgICAgICg2ICgiYmFyIiAzKSBbMC4wIDEuMCAxLjBdKQorICAgICAgICAgICAgICAgICAg ICAgICg3ICJmcmFtZWQiICJPcmFuZ2VSZWQiKSkpKQorICAgIChzZWxlY3Qtd2luZG93IChkaXNw bGF5LWJ1ZmZlciBidWZmZXIpKSkpCisKKyhkZWZ1biArLXRpbWVyLWZuICgpCisiU2luY2UgdGhp cyBmaXJlcyBnbG9iYWxseSwgd2UgbXVzdCBjb250cm9sIHdoaWNoIGJ1ZmZlcnMgY3Jvc3NoYWly cyBhcHBlYXIgaW4uIgorICAod2hlbiArLW1vZGUKKyAgICAodW5sZXNzIChvciAobWVtcSBsYXN0 LWNvbW1hbmQgKy1wYXJlbnMtZXhjbHVzaW9ucykKKyAgICAgICAgICAgICAgICAobnVsbCArLXBh cmVucy1wKSkKKyAgICAgICgrLXBhcmVucy1mbikpCisgICAgKHdoZW4gKy10aW1lci12YXIKKyAg ICAgIChzZXRxIHRpbWVyLWlkbGUtbGlzdCAoZGVscSArLXRpbWVyLXZhciB0aW1lci1pZGxlLWxp c3QpKQorICAgICAgKHNldHEgKy10aW1lci12YXIgbmlsKSkpKQorCisoZGVmdW4gKy1kcmF3LWZv cnRod2l0aCAoKQorICAiRm9yY2UgYm90aCBydWxlcnMgdG8gYmUgZHJhd24vcmVkcmF3bi4iCisg ICgrLWRyYXctY3Jvc3NoYWlycyAnZm9yY2UpKQorCisoZGVmdW4gKy1kcmF3LWNyb3NzaGFpcnMg KCZvcHRpb25hbCBmb3JjZSkKKyAgKHdoZW4gKy1tb2RlCisgICAgKHdoZW4gKy10aW1lci12YXIK KyAgICAgIChzZXRxIHRpbWVyLWlkbGUtbGlzdCAoZGVscSArLXRpbWVyLXZhciB0aW1lci1pZGxl LWxpc3QpKQorICAgICAgKHNldHEgKy10aW1lci12YXIgbmlsKSkKKyAgICAodW5sZXNzIChvciAo bWVtcSB0aGlzLWNvbW1hbmQgKy1wYXJlbnMtZXhjbHVzaW9ucykKKyAgICAgICAgICAgICAgICAo YW5kIChudWxsICstcGFyZW5zLXApCisgICAgICAgICAgICAgICAgICAgICAobnVsbCArLXBhcmVu cy1vdmVybGF5cy1leGlzdC1wKSkpCisgICAgICAoKy1kZWxldGUtcGFyZW5zLW92ZXJsYXlzKSkK KyAgICAoaWYgZm9yY2UKKyAgICAgIChwcm9nbgorICAgICAgICAod2hlbiArLXBhcmVucy1wCisg ICAgICAgICAgKCstcGFyZW5zLWZuKSkpCisgICAgICAoc2V0cSArLXRpbWVyLXZhciAocnVuLXdp dGgtaWRsZS10aW1lciArLWlkbGUtdGltZXItc2Vjb25kcyBuaWwgIycrLXRpbWVyLWZuKSkpKSkK KworKGRlZnZhciBmYy1tb2RlKQorCis7OzsjIyNhdXRvbG9hZAorKGRlZmluZS1taW5vci1tb2Rl ICstbW9kZQorIk1pbm9yIG1vZGUgZm9yIGRpc3BsYXlpbmcgYSBob3Jpem9udGFsIHJ1bGVyLiIK KyAgOmluaXQtdmFsdWUgbmlsCisgIDpsaWdodGVyICIgKyIKKyAgOmtleW1hcCBuaWwKKyAgOmds b2JhbCBuaWwKKyAgOmdyb3VwICcrLW1vZGUKKyAgKGNvbmQKKyAgICAoKy1tb2RlCisgICAgICA7 OzsgYCstbW9kZScgaGFzIHRoZSBhYmlsaXR5IHRvIGFsc28gZGlzcGxheSBhIGZpbGwgY29sdW1u IGluZGljYXRvci4KKyAgICAgIDs7OyBTZWUgdGhlIHZhcmlhYmxlIGArLWZpbGwtY29sdW1uJy4K KyAgICAgICh3aGVuIGZjLW1vZGUKKyAgICAgICAgKGZjLW1vZGUgLTEpKQorICAgICAgKHdoZW4g KGFuZCBnbG9iYWwtZWxkb2MtbW9kZQorICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0 aXZlbHktcCAnYW55KQorICAgICAgICAgICAgICAgICAob3IgKGVxdWFsIGN1cnJlbnQtcHJlZml4 LWFyZyAnKDQpKQorICAgICAgICAgICAgICAgICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFy ZyAnKDE2KSkpKQorICAgICAgICAoZ2xvYmFsLWVsZG9jLW1vZGUgLTEpKQorICAgICAgKHdoZW4g KGFuZCBqaXQtbG9jay1jb250ZXh0LXRpbWVyCisgICAgICAgICAgICAgICAgIChjYWxsZWQtaW50 ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgIChvciAoZXF1YWwgY3VycmVudC1w cmVmaXgtYXJnICcoNCkpCisgICAgICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVm aXgtYXJnICcoMTYpKSkpCisgICAgICAgICh3aGVuICh0aW1lcnAgaml0LWxvY2stY29udGV4dC10 aW1lcikKKyAgICAgICAgICAoY2FuY2VsLXRpbWVyIGppdC1sb2NrLWNvbnRleHQtdGltZXIpKQor ICAgICAgICA7OyAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIChydW4td2l0aC1pZGxlLXRp bWVyIDUuMCAncmVwZWF0ICdqaXQtbG9jay1jb250ZXh0LWZvbnRpZnkpKQorICAgICAgICAoc2V0 cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIG5pbCkpCisgICAgICAod2hlbiAoYW5kIChjYWxsZWQt aW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgIChvciAoZXF1YWwgY3VycmVu dC1wcmVmaXgtYXJnICcoNCkpCisgICAgICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1w cmVmaXgtYXJnICcoMTYpKSkpCisgICAgICAgICh3aGVuICh0aW1lcnAgdW5kby1hdXRvLWN1cnJl bnQtYm91bmRhcnktdGltZXIpCisgICAgICAgICAgKGNhbmNlbC10aW1lciB1bmRvLWF1dG8tY3Vy cmVudC1ib3VuZGFyeS10aW1lcikpCisgICAgICAgIChmc2V0ICd1bmRvLWF1dG8tLXVuZG9hYmxl LWNoYW5nZQorICAgICAgICAgICAgICAobGFtYmRhICgpIChhZGQtdG8tbGlzdCAndW5kby1hdXRv LS11bmRvYWJseS1jaGFuZ2VkLWJ1ZmZlcnMgKGN1cnJlbnQtYnVmZmVyKSkpKQorICAgICAgICAo ZnNldCAndW5kby1hdXRvLWFtYWxnYW1hdGUgJ2lnbm9yZSkpCisgICAgICAod2hlbiBibGluay1j dXJzb3ItbW9kZQorICAgICAgICAoYmxpbmstY3Vyc29yLW1vZGUgLTEpCisgICAgICAgICh3aGVu IChtZW1xICdibGluay1jdXJzb3ItY2hlY2sgcG9zdC1jb21tYW5kLWhvb2spCisgICAgICAgICAg KHJlbW92ZS1ob29rICdwb3N0LWNvbW1hbmQtaG9vayAnYmxpbmstY3Vyc29yLWNoZWNrKSkpCisg ICAgICAoc2V0cSBjcm9zc2hhaXJzIHQpCisgICAgICAod2hlbiArLWZpbGwtY29sdW1uCisgICAg ICAgIChzZXRxIGZjLXZpc2libGUgdCkpCisgICAgICA7OzsgYGF1dG8tY29tcG9zaXRpb24tbW9k ZScgaXMgbmVlZGVkIGZvciBjcm9zc2hhaXJzIHRvIHByb3Blcmx5IGNhbGN1bGF0ZQorICAgICAg Ozs7IGNvb3JkaW5hdGVzIG9mIGNvbXBvc2l0aW9uIGNoYXJhY3RlcnMuICBBdXRvbWF0aWNhbGx5 IGJlY29tZXMgcGVybWFuZW50bHkKKyAgICAgIDs7OyBidWZmZXItbG9jYWwgd2hlbiBzZXQuCisg ICAgICAodW5sZXNzIGF1dG8tY29tcG9zaXRpb24tbW9kZQorICAgICAgICAoc2V0cSBhdXRvLWNv bXBvc2l0aW9uLW1vZGUgdCkpCisgICAgICA7OzsgQGxhd2xpc3QgaXMgZm9jdXNpbmcgdGhlIGlu aXRpYWwgZGV2ZWxvcG1lbnQgb2YgZmVhdHVyZSByZXF1ZXN0cyAjMTc2ODQKKyAgICAgIDs7OyBh bmQgIzIyODczIG9uIEwyUiBsYW5ndWFnZXMuICBUaGUgZmVhdHVyZSB0ZXN0IGZpbGUgdXNlZCBi eSBAbGF3bGlzdAorICAgICAgOzs7IGJvZ3MgRW1hY3MgZG93biB1bmxlc3MgYGJpZGktZGlzcGxh eS1yZW9yZGVyaW5nJyBpcyBzZXQgdG8gYSBuaWwgdmFsdWUuCisgICAgICA7OzsgSG93ZXZlciwg bW9zdCB1c2VycyB3aWxsIHByb2JhYmx5IG5vdCB3YW50IHRoaXMgcGFydGljdWxhciBzZXR0aW5n LgorICAgICAgKHVubGVzcyAobnVsbCBiaWRpLWRpc3BsYXktcmVvcmRlcmluZykKKyAgICAgICAg KHNldHEgYmlkaS1kaXNwbGF5LXJlb3JkZXJpbmcgbmlsKSkKKyAgICAgIChzZXQgKG1ha2UtbG9j YWwtdmFyaWFibGUgJystLXNhdmVkLXN0YXRlKSBuaWwpCisgICAgICAoZG9saXN0ICh2YXIgJyhi dWZmZXItZGlzcGxheS10YWJsZQorICAgICAgICAgICAgICAgICAgICAgZnJpbmdlLWluZGljYXRv ci1hbGlzdAorICAgICAgICAgICAgICAgICAgICAgdGFiLXdpZHRoCisgICAgICAgICAgICAgICAg ICAgICBsaW5lLW1vdmUtdmlzdWFsCisgICAgICAgICAgICAgICAgICAgICB0cnVuY2F0ZS1saW5l cworICAgICAgICAgICAgICAgICAgICAgdHJ1bmNhdGUtcGFydGlhbC13aWR0aC13aW5kb3dzCisg ICAgICAgICAgICAgICAgICAgICB3b3JkLXdyYXApKQorICAgICAgICAod2hlbiAobG9jYWwtdmFy aWFibGUtcCB2YXIpCisgICAgICAgICAgKHB1c2ggKGNvbnMgdmFyIChzeW1ib2wtdmFsdWUgdmFy KSkgKy0tc2F2ZWQtc3RhdGUpKSkKKyAgICAgIChzZXRxIGZpbGwtY29sdW1uIDgwKQorICAgICAg KHNldHEgZGlzcGxheS1saW5lLW51bWJlcnMgdCkKKyAgICAgIChzZXRxLWxvY2FsIGF1dG8taHNj cm9sbC1tb2RlICdjdXJyZW50LWxpbmUpCisgICAgICAoc2V0cS1sb2NhbCBoc2Nyb2xsLXN0ZXAg NSkKKyAgICAgIChzZXRxIGJ1ZmZlci1kaXNwbGF5LXRhYmxlICstYnVmZmVyLWRpc3BsYXktdGFi bGUpCisgICAgICAoc2V0cSB0YWItd2lkdGggNCkKKyAgICAgIChzZXQgKG1ha2UtbG9jYWwtdmFy aWFibGUgJ2xpbmUtbW92ZS12aXN1YWwpIHQpCisgICAgICAoc2V0cSB0cnVuY2F0ZS1saW5lcwor ICAgICAgICAoY29uZAorICAgICAgICAgICgobGV0ICgobHN0ICstdHJ1bmNhdGUtbGluZXMtZGVy aXZlZC1tb2RlcykKKyAgICAgICAgICAgICAgICAgIG1vZGUpCisgICAgICAgICAgICAoY2F0Y2gg J2ZvdW5kCisgICAgICAgICAgICAgICh3aGlsZSAoc2V0cSBtb2RlIChwb3AgbHN0KSkKKyAgICAg ICAgICAgICAgICAod2hlbiAoZGVyaXZlZC1tb2RlLXAgbW9kZSkKKyAgICAgICAgICAgICAgICAg ICh0aHJvdyAnZm91bmQgdCkpKSkpKQorICAgICAgICAgICAoKG1lbXEgbWFqb3ItbW9kZSArLXRy dW5jYXRlLWxpbmVzLW1ham9yLW1vZGVzKSkKKyAgICAgICAgICAgKHQKKyAgICAgICAgICAgICBu aWwpKSkKKyAgICAgIChzZXQgKG1ha2UtbG9jYWwtdmFyaWFibGUgJ3RydW5jYXRlLXBhcnRpYWwt d2lkdGgtd2luZG93cykgbmlsKQorICAgICAgKHNldHEgd29yZC13cmFwIHQpCisgICAgICAoc2V0 cSBpbmRpY2F0ZS1lbXB0eS1saW5lcyB0KQorICAgICAgKHNldHEgaW5kaWNhdGUtYnVmZmVyLWJv dW5kYXJpZXMgJ2xlZnQpCisgICAgICAoc2V0cSBmcmluZ2UtaW5kaWNhdG9yLWFsaXN0CisgICAg ICAgICAgOzs7IGhzY2xfYWxsX3RlbXBfcCB8IGhzY2xfdGVtcF9wCisgICAgICAgICcoKCstaHNj bC10ZW1wIC4gKCstc2luZ2xlLWFuZ2xlLWxlZnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAg Ky1kb3VibGUtYW5nbGUtbGVmdCkpCisgICAgICAgICAgOzs7IGhzY2xfYWxsX3Blcm1fMF9wIHwg aHNjbF9hbGxfcGVybV8xX3AgfCBoc2NsX2FsbF9wZXJtXzJfcCB8IGhzY2xfcGVybV9wCisgICAg ICAgICAgKCstaHNjbC1wZXJtIC4gKCstc2luZ2xlLWFuZ2xlLXVwCisgICAgICAgICAgICAgICAg ICAgICAgICAgICstZG91YmxlLWFuZ2xlLXVwCisgICAgICAgICAgICAgICAgICAgICAgICAgICst dHJpcGxlLWFuZ2xlLXVwCisgICAgICAgICAgICAgICAgICAgICAgICAgICstcXVhZHJ1cGxlLWFu Z2xlLXVwKSkKKyAgICAgICAgICAoKy1vdmVybGF5LWFycm93IC4gKCstZnJpbmdlLWxlZnQtYXJy b3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICstZnJpbmdlLXJpZ2h0LWFycm93KSkK KyAgICAgICAgICAodHJ1bmNhdGlvbiAuICgrLWZyaW5nZS1sZWZ0LWFycm93CisgICAgICAgICAg ICAgICAgICAgICAgICAgKy1mcmluZ2UtcmlnaHQtYXJyb3cpKQorICAgICAgICAgIChjb250aW51 YXRpb24gLiAoKy1mcmluZ2UtbGVmdC1jdXJseS1hcnJvdworICAgICAgICAgICAgICAgICAgICAg ICAgICAgKy1iYWNrc2xhc2gpKQorICAgICAgICAgIChvdmVybGF5LWFycm93IC4gKy1mcmluZ2Ut cmlnaHQtdHJpYW5nbGUpCisgICAgICAgICAgKHVwIC4gKy1mcmluZ2UtdXAtYXJyb3cpCisgICAg ICAgICAgKGRvd24gLiArLWZyaW5nZS1kb3duLWFycm93KQorICAgICAgICAgICh0b3AgLiArLWZy aW5nZS10b3AtbGVmdC1hbmdsZSkKKyAgICAgICAgICAoYm90dG9tIC4gKy1mcmluZ2UtYm90dG9t LXJpZ2h0LWFuZ2xlKQorICAgICAgICAgICh0b3AtYm90dG9tIC4gKCstZnJpbmdlLWxlZnQtYnJh Y2tldAorICAgICAgICAgICAgICAgICAgICAgICAgICstZnJpbmdlLXJpZ2h0LWJyYWNrZXQKKyAg ICAgICAgICAgICAgICAgICAgICAgICArLWZyaW5nZS10b3AtcmlnaHQtYW5nbGUKKyAgICAgICAg ICAgICAgICAgICAgICAgICArLWZyaW5nZS10b3AtbGVmdC1hbmdsZSkpCisgICAgICAgICAgKGVt cHR5LWxpbmUgLiArLWZyaW5nZS1lbXB0eS1saW5lKQorICAgICAgICAgICh1bmtub3duIC4gKy1m cmluZ2UtcXVlc3Rpb24tbWFyaykpKQorICAgICAgKHNldHEgZnJpbmdlLWN1cnNvci1hbGlzdCAn KChib3ggLiArLWZyaW5nZS1sZWZ0LXRyaWFuZ2xlKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIChob2xsb3cgLiArLWhvbGxvdy1yZWN0YW5nbGUpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgKGJhciAuICstdmVydGljYWwtYmFyKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIChoYmFyIC4gKy1mcmluZ2UtaG9yaXpvbnRhbC1iYXIpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGhvbGxvdy1zbWFsbCAuICstZnJpbmdlLWhv bGxvdy1zcXVhcmUpKSkKKyAgICAgIChpZiArLWZvcnRod2l0aAorICAgICAgICAoYWRkLWhvb2sg J3Bvc3QtY29tbWFuZC1ob29rICcrLWRyYXctZm9ydGh3aXRoICdhcHBlbmQgJ2xvY2FsKQorICAg ICAgICAoYWRkLWhvb2sgJ3Bvc3QtY29tbWFuZC1ob29rICcrLWRyYXctY3Jvc3NoYWlycyAnYXBw ZW5kICdsb2NhbCkpCisgICAgICAod2hlbiArLWZvcnRod2l0aAorICAgICAgICAoYWRkLWhvb2sg J3dpbmRvdy1jb25maWd1cmF0aW9uLWNoYW5nZS1ob29rICcrLWRyYXctZm9ydGh3aXRoIG5pbCAn bG9jYWwpKQorICAgICAgKGFkZC1ob29rICdjaGFuZ2UtbWFqb3ItbW9kZS1ob29rICd0dXJuLW9m Zi0rLW1vZGUgbmlsICdsb2NhbCkKKyAgICAgICh3aGVuIChjYWxsZWQtaW50ZXJhY3RpdmVseS1w ICdhbnkpCisgICAgICAgIChjb25kCisgICAgICAgICAgKChlcXVhbCBjdXJyZW50LXByZWZpeC1h cmcgJyg0KSkKKyAgICAgICAgICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScgLS0gZGVi dWdnaW5nIG1vZGUgV0lUSCBpZGxlLXRpbWVyLiIpKQorICAgICAgICAgICgoZXF1YWwgY3VycmVu dC1wcmVmaXgtYXJnICcoMTYpKQorICAgICAgICAgICAgKG1lc3NhZ2UgIlR1cm5lZCBPTiBgKy1t b2RlJyAtLSBkZWJ1Z2dpbmcgbW9kZSBEUkFXIEZPUlRIV0lUSC4iKSkKKyAgICAgICAgICAodAor ICAgICAgKGlmIChhbmQgKDw9IGdjLWNvbnMtdGhyZXNob2xkIDgwMDAwMCkKKyAgICAgICAgICAg ICAgIChlcSBzeXN0ZW0tdHlwZSAnZGFyd2luKSkKKyAgICAgICAgKG1lc3NhZ2UgIistbW9kZSAo T04pOiAgQ29uc2lkZXIgaW5jcmVhc2luZyBnYy1jb25zLXRocmVzaG9sZCBiZXlvbmQgJWQuIgor ICAgICAgICAgICAgICAgICBnYy1jb25zLXRocmVzaG9sZCkKKyAgICAgICAgKG1lc3NhZ2UgIlR1 cm5lZCBPTiBgKy1tb2RlJy4iKSkpKSkpCisgICAgKHQKKyAgICAgIChraWxsLWxvY2FsLXZhcmlh Ymx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ICh3aGVuIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgIChtZXNzYWdl ICJUdXJuZWQgT0ZGIGArLW1vZGUnLiIpKSkpKQorCisoZGVmdW4gdHVybi1vZmYtKy1tb2RlICgp CisgICgrLW1vZGUgLTEpKQorCis7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzsKKworKGRlZnVuICst cGFyZW5zLWZuICgpCisgICJEb2Mtc3RyaW5nLiIKKyAgKGxldCogKChvcG9pbnQgKHBvaW50KSkK KyAgICAgICAgIChmcm9tIChpZiArLXBhcmVucy1mcm9tLWZuCisgICAgICAgICAgICAgICAgIChm dW5jYWxsICstcGFyZW5zLWZyb20tZm4pCisgICAgICAgICAgICAgICAgIChwb2ludC1taW4pKSkK KyAgICAgICAgICh3aW4gKHNlbGVjdGVkLXdpbmRvdykpCisgICAgICAgICAoaSAwKQorICAgICAg ICAgKHByZWNlZGluZy1jaGFyIChwcmVjZWRpbmctY2hhcikpCisgICAgICAgICAob2NoYXIgKGNo YXItYWZ0ZXIgb3BvaW50KSkKKyAgICAgICAgIChwb3MxCisgICAgICAgICAgIChjb25kCisgICAg ICAgICAgICAgKChhbmQgb2NoYXIKKyAgICAgICAgICAgICAgICAgICAob3IgOzs7IChjaGFyLXRv LXN0cmluZyA0MCkgPT4gb3BlbmluZyBwYXJlbnRoZXNpcworICAgICAgICAgICAgICAgICAgICAg ICAoPSBvY2hhciA0MCkKKyAgICAgICAgICAgICAgICAgICAgICAgOzs7IChjaGFyLXRvLXN0cmlu ZyA5MSkgPT4gb3BlbmluZyBzcXVhcmUgYnJhY2tldAorICAgICAgICAgICAgICAgICAgICAgICAo PSBvY2hhciA5MSkKKyAgICAgICAgICAgICAgICAgICAgICAgOzs7IChjaGFyLXRvLXN0cmluZyAx MjMpID0+IG9wZW5pbmcgd2F2eSBicmFja2V0CisgICAgICAgICAgICAgICAgICAgICAgICg9IG9j aGFyIDEyMykpKQorICAgICAgICAgICAgICAgIChtaW4gKDErIG9wb2ludCkgKHBvaW50LW1heCkp KQorICAgICAgICAgICAgICgob3IgOzs7IChjaGFyLXRvLXN0cmluZyA0MSkgPT4gY2xvc2luZyBw YXJlbnRoZXNpcworICAgICAgICAgICAgICAgICAgKD0gcHJlY2VkaW5nLWNoYXIgNDEpCisgICAg ICAgICAgICAgICAgICA7OzsgKGNoYXItdG8tc3RyaW5nIDkzKSA9PiBjbG9zaW5nIHNxdWFyZSBi cmFja2V0CisgICAgICAgICAgICAgICAgICAoPSBwcmVjZWRpbmctY2hhciA5MykKKyAgICAgICAg ICAgICAgICAgIDs7OyAoY2hhci10by1zdHJpbmcgMTI1KSA9PiBjbG9zaW5nIHdhdnkgYnJhY2tl dAorICAgICAgICAgICAgICAgICAgKD0gcHJlY2VkaW5nLWNoYXIgMTI1KSkKKyAgICAgICAgICAg ICAgICAobWF4IChwb2ludC1taW4pICgxLSBvcG9pbnQpKSkKKyAgICAgICAgICAgICAodAorICAg ICAgICAgICAgICAgIG9wb2ludCkpKQorICAgICAgICAgcG9zMgorICAgICAgICAgc2VsZWN0ZWQt ZmFjZSkKKyAgICAoc2F2ZS1leGN1cnNpb24KKyAgICAgIChjb25kaXRpb24tY2FzZSBuaWwKKyAg ICAgICAgKHdoaWxlIChzZXRxIHBvczEgKG50aCAxIChwYXJzZS1wYXJ0aWFsLXNleHAgZnJvbSBw b3MxKSkpCisgICAgICAgICAgKHNldHEgcG9zMiAoc2Nhbi1zZXhwcyBwb3MxIDEpKQorICAgICAg ICAgIChpZiAoPSBpIDEwKQorICAgICAgICAgICAgKHNldHEgaSAxKQorICAgICAgICAgICAgKHNl dHEgaSAoMSsgaSkpKQorICAgICAgICAgIChzZXRxIHNlbGVjdGVkLWZhY2UgKGNvbmQKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgMSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAnKy1wYXJlbnMtb25lLWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICgoPSBpIDIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJyst cGFyZW5zLXR3by1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSAz KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy10aHJlZS1mYWNl KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA0KQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1mb3VyLWZhY2UpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICgoPSBpIDUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJystcGFyZW5zLWZpdmUtZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgKCg9IGkgNikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMt c2l4LWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDcpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLXNldmVuLWZhY2UpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDgpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJystcGFyZW5zLWVpZ2h0LWZhY2UpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICgoPSBpIDkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JystcGFyZW5zLW5pbmUtZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9 IGkgMTApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLXRlbi1m YWNlKSkpCisgICAgICAgICAgKGxldCAoKG92IChtYWtlLW92ZXJsYXkgcG9zMSAoMSsgcG9zMSkp KSkKKyAgICAgICAgICAgICh1bmxlc3MgKy1wYXJlbnMtaW5hY3RpdmUtd2luZG93cworICAgICAg ICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ3dpbmRvdyB3aW4pKQorICAgICAgICAgICAgKG92ZXJs YXktcHV0IG92ICdmYWNlIHNlbGVjdGVkLWZhY2UpKQorICAgICAgICAgICh3aGVuIHBvczIKKyAg ICAgICAgICAgIChsZXQgKChvdiAobWFrZS1vdmVybGF5ICgxLSBwb3MyKSBwb3MyKSkpCisgICAg ICAgICAgICAgICh1bmxlc3MgKy1wYXJlbnMtaW5hY3RpdmUtd2luZG93cworICAgICAgICAgICAg ICAgIChvdmVybGF5LXB1dCBvdiAnd2luZG93IHdpbikpCisgICAgICAgICAgICAgIChvdmVybGF5 LXB1dCBvdiAnZmFjZSBzZWxlY3RlZC1mYWNlKSkpKQorICAgICAgICAoZXJyb3IgbmlsKSkpCisg ICAgKHNldHEgKy1wYXJlbnMtb3ZlcmxheXMtZXhpc3QtcCB0KSkpCisKKyhkZWZ1biArLXJlbW92 ZS1vdmVybGF5cyAoYmVnIGVuZCBuYW1lIHZhbCkKKyJSZW1vdmUgdGhlIG92ZXJsYXlzIHRoYXQg YXJlIGBlcXVhbC1pbmNsdWRpbmctcHJvcGVydGllc2AuCitJbmNsdWRlcyBhIHVuaXF1ZSBzaXR1 YXRpb24gd2hlbiBhbiBvdmVybGF5IHdpdGggYW4gYCdhZnRlci1zdHJpbmdgIHByb3BlcnR5Citp cyBhdCB0aGUgdmVyeSBlbmQgb2YgYSBuYXJyb3dlZC1idWZmZXIuIgorICAobGV0KiAoKHBvaW50 LW1heCAocG9pbnQtbWF4KSkKKyAgICAgICAgIChwb2ludC1taW4gKHBvaW50LW1pbikpCisgICAg ICAgICAobmFycm93ZWQtcCAoYnVmZmVyLW5hcnJvd2VkLXApKQorICAgICAgICAgKGJlZyAoaWYg YmVnIGJlZyBwb2ludC1taW4pKQorICAgICAgICAgKGVuZAorICAgICAgICAgICAoY29uZAorICAg ICAgICAgICAgICgoYW5kCisgICAgICAgICAgICAgICAgIChub3QgbmFycm93ZWQtcCkKKyAgICAg ICAgICAgICAgICAgZW5kKQorICAgICAgICAgICAgICAgZW5kKQorICAgICAgICAgICAgICgoYW5k CisgICAgICAgICAgICAgICAgIChub3QgbmFycm93ZWQtcCkKKyAgICAgICAgICAgICAgICAgKG51 bGwgZW5kKSkKKyAgICAgICAgICAgICAgIHBvaW50LW1heCkKKyAgICAgICAgICAgICAoKGFuZAor ICAgICAgICAgICAgICAgICBuYXJyb3dlZC1wCisgICAgICAgICAgICAgICAgIGVuZAorICAgICAg ICAgICAgICAgICAoPCBlbmQgcG9pbnQtbWF4KSkKKyAgICAgICAgICAgICAgIGVuZCkKKyAgICAg ICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICBuYXJyb3dlZC1wCisgICAgICAgICAgICAg ICAgIGVuZAorICAgICAgICAgICAgICAgICAoPSBlbmQgcG9pbnQtbWF4KSkKKyAgICAgICAgICAg ICAgICgxKyBlbmQpKQorICAgICAgICAgICAgICgoYW5kCisgICAgICAgICAgICAgICAgIG5hcnJv d2VkLXAKKyAgICAgICAgICAgICAgICAgKG51bGwgZW5kKSkKKyAgICAgICAgICAgICAgICgxKyBw b2ludC1tYXgpKSApKQorICAgICAgICAgKG92ZXJsYXlzCisgICAgICAgICAgIChwcm9nbgorICAg ICAgICAgICAgIChvdmVybGF5LXJlY2VudGVyIGVuZCkKKyAgICAgICAgICAgICAob3ZlcmxheXMt aW4gYmVnIGVuZCkpKSkKKyAgICAod2hlbiAoYW5kIGJlZyBlbmQgbmFtZSB2YWwpCisgICAgICAo ZG9saXN0IChvIG92ZXJsYXlzKQorICAgICAgICAoY29uZAorICAgICAgICAgICgoYW5kIChlcSBu YW1lICdmYWNlKQorICAgICAgICAgICAgICAgIChlcSAob3ZlcmxheS1nZXQgbyBuYW1lKSB2YWwp KQorICAgICAgICAgICAgOzsgRWl0aGVyIHB1c2ggdGhpcyBvdmVybGF5IG91dHNpZGUgYmVnLi4u ZW5kCisgICAgICAgICAgICA7OyBvciBzcGxpdCBpdCB0byBleGNsdWRlIGJlZy4uLmVuZAorICAg ICAgICAgICAgOzsgb3IgZGVsZXRlIGl0IGVudGlyZWx5IChpZiBpdCBpcyBjb250YWluZWQgaW4g YmVnLi4uZW5kKS4KKyAgICAgICAgICAgIChpZiAoPCAob3ZlcmxheS1zdGFydCBvKSBiZWcpCisg ICAgICAgICAgICAgICAgKGlmICg+IChvdmVybGF5LWVuZCBvKSBlbmQpCisgICAgICAgICAgICAg IChwcm9nbgorICAgICAgICAgICAgICAgIChtb3ZlLW92ZXJsYXkgKGNvcHktb3ZlcmxheSBvKQor ICAgICAgICAgICAgICAgICAgKG92ZXJsYXktc3RhcnQgbykgYmVnKQorICAgICAgICAgICAgICAg IChtb3ZlLW92ZXJsYXkgbyBlbmQgKG92ZXJsYXktZW5kIG8pKSkKKyAgICAgICAgICAgICAgICAg IChtb3ZlLW92ZXJsYXkgbyAob3ZlcmxheS1zdGFydCBvKSBiZWcpKQorICAgICAgICAgICAgICAo aWYgKD4gKG92ZXJsYXktZW5kIG8pIGVuZCkKKyAgICAgICAgICAgICAgICAgIChtb3ZlLW92ZXJs YXkgbyBlbmQgKG92ZXJsYXktZW5kIG8pKQorICAgICAgICAgICAgICAgIChkZWxldGUtb3Zlcmxh eSBvKSkpKQorICAgICAgICAgICgoYW5kIChub3QgKGVxIG5hbWUgJ2ZhY2UpKQorICAgICAgICAg ICAgICAgIChlcXVhbC1pbmNsdWRpbmctcHJvcGVydGllcyAob3ZlcmxheS1nZXQgbyBuYW1lKSB2 YWwpKQorICAgICAgICAgICAgKGRlbGV0ZS1vdmVybGF5IG8pKSkpKSkpCisKKyhkZWZ1biArLWRl bGV0ZS1wYXJlbnMtb3ZlcmxheXMgKCkKKyAgK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3Jpem9udGFsX3J1bGVyXyA9IHZhbDsKK30KKworc3RhdGljIHZvaWQKK2JzZXRfY2hf dmVydGljYWxfcnVsZXIgKHN0cnVjdCBidWZmZXIgKmIsIExpc3BfT2JqZWN0IHZhbCkKK3sKKyAg Yi0+Y2hfdmVydGljYWxfcnVsZXJfID0gdmFsOworfQorCitzdGF0aWMgdm9pZAorYnNldF9jaF9p bmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7Cisg IGItPmNoX2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQorCitzdGF0aWMgdm9pZAorYnNldF9m Y192aXNpYmxlIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7CisgIGItPmZj X3Zpc2libGVfID0gdmFsOworfQorCitzdGF0aWMgdm9pZAorYnNldF9mY19pbmFjdGl2ZV93aW5k b3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7CisgIGItPmZjX2luYWN0 aXZlX3dpbmRvd3NfID0gdmFsOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogc3RhdGljIHZvaWQKIGJzZXRfYWJicmV2X21vZGUg KHN0cnVjdCBidWZmZXIgKmIsIExpc3BfT2JqZWN0IHZhbCkKIHsKQEAgLTUxNDIsNiArNTIwNSwy NCBAQCBpbml0X2J1ZmZlcl9vbmNlICh2b2lkKQogICBic2V0X2xhc3Rfc2VsZWN0ZWRfd2luZG93 ICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBtYWtlX2ZpeG51bSAoMCkpOwogCiAgIGlkeCA9IDE7CisK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioq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sKKyAgYnNldF9mY192 aXNpYmxlICgmYnVmZmVyX2RlZmF1bHRzLCBRbmlsKTsKKyAgYnNldF9mY19pbmFjdGl2ZV93aW5k b3dzICgmYnVmZmVyX2RlZmF1bHRzLCBRdCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor CisKICAgYnNldF9tb2RlX2xpbmVfZm9ybWF0ICgmYnVmZmVyX2RlZmF1bHRzLCBidWlsZF9wdXJl X2Nfc3RyaW5nICgiJS0iKSk7CiAgIGJzZXRfaGVhZGVyX2xpbmVfZm9ybWF0ICgmYnVmZmVyX2Rl ZmF1bHRzLCBRbmlsKTsKICAgYnNldF9hYmJyZXZfbW9kZSAoJmJ1ZmZlcl9kZWZhdWx0cywgUW5p bCk7CkBAIC01NDY0LDYgKzU1NjMsMjMgQEAgc3ltc19vZl9idWZmZXIgKHZvaWQpCiAgIHN0YXRp Y3BybyAoJlFTRnVuZGFtZW50YWwpOwogICBzdGF0aWNwcm8gKCZWYnVmZmVyX2FsaXN0KTsKIAor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBE RUZTWU0gKFFtY19yZWFsX2Zha2VfY3Vyc29yLCAibWMtcmVhbC1mYWtlLWN1cnNvciIpOworICBE RUZTWU0gKFFtY19jb25mLCAibWMtY29uZiIpOworICBERUZTWU0gKFFtY19pbmFjdGl2ZV93aW5k b3dzLCAibWMtaW5hY3RpdmUtd2luZG93cyIpOworICBERUZTWU0gKFFjcm9zc2hhaXJzLCAiY3Jv c3NoYWlycyIpOworICBERUZTWU0gKFFjaF9ob3Jpem9udGFsX3J1bGVyLCAiY2gtaG9yaXpvbnRh bC1ydWxlciIpOworICBERUZTWU0gKFFjaF92ZXJ0aWNhbF9ydWxlciwgImNoLXZlcnRpY2FsLXJ1 bGVyIik7CisgIERFRlNZTSAoUWNoX2luYWN0aXZlX3dpbmRvd3MsICJjaC1pbmFjdGl2ZS13aW5k b3dzIik7CisgIERFRlNZTSAoUWZjX3Zpc2libGUsICJmYy12aXNpYmxlIik7CisgIERFRlNZTSAo UWZjX3Zpc2libGVfaW5hY3RpdmVfd2luZG93LCAiZmMtaW5hY3RpdmUtd2luZG93Iik7CisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKICAgREVGU1lNIChRY2hvaWNlLCAiY2hvaWNlIik7 CiAgIERFRlNZTSAoUWxlZnQsICJsZWZ0Iik7CiAgIERFRlNZTSAoUXJpZ2h0LCAicmlnaHQiKTsK QEAgLTU1MDEsNiArNTYxNyw0MSBAQCBzeW1zX29mX2J1ZmZlciAodm9pZCkKICAgRnB1dCAoUXBy b3RlY3RlZF9maWVsZCwgUWVycm9yX21lc3NhZ2UsCiAJYnVpbGRfcHVyZV9jX3N0cmluZyAoIkF0 dGVtcHQgdG8gbW9kaWZ5IGEgcHJvdGVjdGVkIGZpZWxkIikpOwogCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIERFRlZBUl9QRVJfQlVGRkVS ICgibWMtcmVhbC1mYWtlLWN1cnNvciIsICZCVkFSIChjdXJyZW50X2J1ZmZlciwgbWNfcmVhbF9m YWtlX2N1cnNvciksIFFuaWwsCisgICAgZG9jOiAvKiBBIGJ1ZmVyLWxvY2FsIHZhcmlhYmxlIHRv IHNldCB0aGUgY3Vyc29yIHR5cGUgb2YgdGhlIHJlYWwgZmFrZSBjdXJzb3IuICovKTsKKworICBE RUZWQVJfUEVSX0JVRkZFUiAoIm1jLWNvbmYi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CisgIExpc3BfT2Jq ZWN0IGZjX2luYWN0aXZlX3dpbmRvd3NfOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAgIC8qIElmIHRoZSB3aWR0aCBydW4gY2FjaGUgaXMgZW5hYmxlZCwgdGhpcyB0YWJsZSBjb250 YWlucyB0aGUKICAgICAgY2hhcmFjdGVyIHdpZHRocyB3aWR0aF9ydW5fY2FjaGUgKHNlZSBhYm92 ZSkgYXNzdW1lcy4gIFdoZW4gd2UKICAgICAgZG8gYSB0aG9yb3VnaCByZWRpc3BsYXksIHdlIGNv bXBhcmUgdGhpcyBhZ2FpbnN0IHRoZSBidWZmZXIncwpAQCAtNzg3LDE0ICs4MjEsMjEgQEAgc3Ry dWN0IGJ1ZmZlcgogICAgICBhbiBpbmRpcmVjdCBidWZmZXIgc2luY2UgaXQgY291bnRzIGFzIGl0 cyBiYXNlIGJ1ZmZlci4gICovCiAgIGludCB3aW5kb3dfY291bnQ7CiAKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgLyogQSBub24temVybyB2 YWx1ZSBpbiBzbG90IElEWCBtZWFucyB0aGF0IHBlci1idWZmZXIgdmFyaWFibGUKICAgICAgd2l0 aCBpbmRleCBJRFggaGFzIGEgbG9jYWwgdmFsdWUgaW4gdGhpcyBidWZmZXIuICBUaGUgaW5kZXgg SURYCiAgICAgIGZvciBhIGJ1ZmZlci1sb2NhbCB2YXJpYWJsZSBpcyBzdG9yZWQgaW4gdGhhdCB2 YXJpYWJsZSdzIHNsb3QKICAgICAgaW4gYnVmZmVyX2xvY2FsX2ZsYWdzIGFzIGEgTGlzcCBpbnRl Z2VyLiAgSWYgdGhlIGluZGV4IGlzIC0xLAogICAgICB0aGlzIG1lYW5zIHRoZSB2YXJpYWJsZSBp cyBhbHdheXMgbG9jYWwgaW4gYWxsIGJ1ZmZlcnMuICAqLwotI2RlZmluZSBNQVhfUEVSX0JVRkZF Ul9WQVJTIDUwCisjZGVmaW5lIE1BWF9QRVJfQlVGRkVSX1ZBUlMgNjAKICAgY2hhciBsb2NhbF9m bGFnc1tNQVhfUEVSX0JVRkZFUl9WQVJTXTsKIAorLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisK KwogICAvKiBTZXQgdG8gdGhlIG1vZHRpbWUgb2YgdGhlIHZpc2l0ZWQgZmlsZSB3aGVuIHJlYWQg b3Igd3JpdHRlbi4KICAgICAgbW9kdGltZS50dl9uc2VjID09IE5PTkVYSVNURU5UX01PRFRJTUVf TlNFQ1MgbWVhbnMKICAgICAgdmlzaXRlZCBmaWxlIHdhcyBub25leGlzdGVudC4gIG1vZHRpbWUu dHZfbnNlYyA9PQpAQCAtOTAzLDYgKzk0NCw2OSBAQCBYQlVGRkVSIChMaXNwX09iamVjdCBhKQog LyogTW9zdCBjb2RlIHNob3VsZCB1c2UgdGhlc2UgZnVuY3Rpb25zIHRvIHNldCBMaXNwIGZpZWxk cyBpbiBzdHJ1Y3QKICAgIGJ1ZmZlci4gIChTb21lIHNldHRlcnMgdGhhdCBhcmUgcHJpdmF0ZSB0 byBhIHNpbmdsZSAuYyBmaWxlIGFyZQogICAgZGVmaW5lZCBhcyBzdGF0aWMgaW4gdGhvc2UgZmls ZXMuKSAgKi8KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExF LUNVUlNPUlMgKi8KKworSU5MSU5FIHZvaWQKK2JzZXRfYmx2X21jX3JlYWxfZmFrZV9jdXJzb3Ig KHN0cnVjdCBidWZmZXI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KyAgYi0+ZmNfdmlzaWJsZV8gPSB2YWw7 Cit9CisKK0lOTElORSB2b2lkCitic2V0X2Jsdl9mY19pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3Qg YnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7CisgIGItPmZjX2luYWN0aXZlX3dpbmRvd3Nf ID0gdmFsOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogSU5MSU5FIHZvaWQKIGJzZXRfYmlkaV9wYXJhZ3JhcGhfZGlyZWN0aW9u IChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCiB7CmRpZmYgLS1naXQgYS9zcmMv ZGlzcGV4dGVybi5oIGIvc3JjL2Rpc3BleHRlcm4uaAppbmRleCAxYTUzNjU2Li5iZDQ4OGU3IDEw MDY0NAotLS0gYS9zcmMvZGlzcGV4dGVybi5oCisrKyBiL3NyYy9kaXNwZXh0ZXJuLmgKQEAgLTEw MCwxOCArMTAwLDY1IEBAIHR5cGVkZWYgaW50IEN1cnNvcjsKICNkZWZpbmUgTmF0aXZlUmVjdGFu Z2xlIGludAogI2VuZGlmCiAKLS8qIFRleHQgY3Vyc29yIHR5cGVzLiAgKi8KIAorLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKK2VudW0gZHJh d19nbHlwaAoreworICBNQ19EUkFXX0dMWVBILAorICBNQ19FUkFTRV9HTFlQSAorfTsKKworZW51 bSB0eXBlX29mX2NhY2hlCit7CisgIE1DX1RFTVBfQ0FDSEUsCisgIE1DX0NBQ0hFLAorICBDSF9D QUNIRSwKKyAgRkNfQ0FDSEUKK307CisKK2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iArNDI5LDIwIEBAIHN0cnVjdCBnbHlwaF9zbGljZQogCiBzdHJ1Y3QgZ2x5cGgKIHsKKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBp bnQgeCwgeSwgaHBvcywgdnBvczsKKworICBpbnQgcmVsYXRpdmVfeDsKKworICBib29sX2JmIHp2 X3AgOiAxOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIFBvc2l0aW9uIGZy b20gd2hpY2ggdGhpcyBnbHlwaCB3YXMgZHJhd24uICBJZiBgb2JqZWN0JyBiZWxvdyBpcyBhCiAg ICAgIExpc3Agc3RyaW5nLCB0aGlzIGlzIGFuIGluZGV4IGludG8gdGhhdCBzdHJpbmcuICBJZiBp dCBpcyBhCiAgICAgIGJ1ZmZlciwgdGhpcyBpcyBhIHBvc2l0aW9uIGluIHRoYXQgYnVmZmVyLiAg SW4gYWRkaXRpb24sIHNvbWUKQEAgLTEyNDgsNiArMTMwOSwyNCBAQCBlbnVtIGRyYXdfZ2x5cGhz X2ZhY2UKIAogc3RydWN0IGdseXBoX3N0cmluZwogeworCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgYm9vbF9iZiBsZWZ0X292ZXJ3cml0 dGVuX3AgOiAxOworCisgICAgYm9vbF9iZiByaWdodF9vdmVyd3JpdHRlbl9wIDogMTsKKworICAg IGJvb2xfYmYgcmVjdGFuZ2xlX251a2VkX3AgOiAxOworCisgICAgYm9vbF9iZiBiYWNrZ3JvdW5k X251a2VkX3AgOiAxOworCisgICAgZW51bSB0eXBlX29mX2FjdGlvbiBhY3Rpb247CisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICAgLyogWC1vcmlnaW4gb2YgdGhlIHN0cmluZy4gICov CiAgIGludCB4OwogCkBAIC0yMjE2LDYgKzIyOTUsMTYgQEAgc3RydWN0IGNvbXBvc2l0aW9uX2l0 CiAKIHN0cnVjdCBpdAogeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQ TEUtQ1VSU09SUyAqLworCisgIGJvb2xfYmYgenZfcCA6IDE7CisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworCisKICAgLyogVGhlIHdpbmRvdyBpbiB3aGljaCB3ZSBpdGVyYXRlIG92ZXIgY3Vy cmVudF9idWZmZXIgKG9yIGEgc3RyaW5nKS4gICovCiAgIExpc3BfT2JqZWN0IHdpbmRvdzsKICAg c3RydWN0IHdpbmRvdyAqdzsKQEAgLTI4MTIsNiArMjkwMSwzNCBAQCB0eXBlZGVmIHZvaWQgKCpm cmFtZV9wYXJtX2hhbmRsZXIpIChzdHJ1Y3QgZnJhbWUgKiwgTGlzcF9PYmplY3QsIExpc3BfT2Jq ZWN0KTsKIAogc3RydWN0IHJlZGlzcGxheV9pbnRlcmZhY2UKIHsKKworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyogYHJlZGlzcGxheV9pbnRl cmZhY2UnIGluIGBuc3Rlcm0ubWAgXCBgdzMydGVybS5jYCBcIGB4dGVybS5jYCBt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b2lkICgqbWNfc2NyaWJlX3N0cmluZykgKHN0cnVjdCBnbHlwaF9zdHJp bmcgKnMsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93 LAorICAgICAgICBkb3VibGUgcmVkLCBkb3VibGUgZ3JlZW4sIGRvdWJsZSBibHVlLCBlbnVtIG1j X2ZsYXZvciBnbHlwaF9mbGF2b3IsCisgICAgICAgIGVudW0gdGV4dF9jdXJzb3Jfa2luZHMgY3Vy c29yX3R5cGUsIGludCB3ZCwgYm9vbCBhY3RpdmVfcCwgYm9vbCBjdXJzb3JfZ2NfcCk7CisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogSGFuZGxlcnMgZm9yIHNldHRpbmcgZnJh bWUgcGFyYW1ldGVycy4gICovCiAgIGZyYW1lX3Bhcm1faGFuZGxlciAqZnJhbWVfcGFybV9oYW5k bGVyczsKIApAQCAtMzI3MCw2ICszMzg3LDYwIEBAIGV4dGVybiB2b2lkIGdldF9mb250X2FzY2Vu dF9kZXNjZW50IChzdHJ1Y3QgZm9udCAqLCBpbnQgKiwgaW50ICopOwogCiAjaWZkZWYgSEFWRV9X SU5ET1dfU1lTVEVNCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxU SVBMRS1DVVJTT1JTICovCisKK2V4dGVybiBMaXNwX09iamVjdCBtY19udGggKGludCBudW0sIExp c3BfT2JqZWN0IGxpc3QpOworCitleHRlcm4gTGlzcF9PYmplY3QgbWNfYXNzcSAoTGlzcF9PYmpl Y3Qga2V5LCBMaXNwX09iamVjdCBsaXN0KTsKKworZXh0ZXJuIExpc3BfT2JqZWN0IG1jX2hpdF9w IChzdHJ1Y3Qgd2luZ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jdCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKiwgZW51bSBnbHlwaF9yb3dfYXJlYSwgaW50LAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCwgaW50LCBkb3VibGUsIGRvdWJsZSwgZG91 YmxlLCBlbnVtIG1jX2ZsYXZvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVt IHRleHRfY3Vyc29yX2tpbmRzLCBpbnQsIGJvb2wsIGJvb2wpOworCisvKiBlbmQgTVVMVElQTEUt Q1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogI2lmZGVmIEdMWVBIX0RF QlVHCiBleHRlcm4gdm9pZCBkdW1wX2dseXBoX3N0cmluZyAoc3RydWN0IGdseXBoX3N0cmluZyAq KSBFWFRFUk5BTExZX1ZJU0lCTEU7CiAjZW5kaWYKZGlmZiAtLWdpdCBhL3NyYy9kaXNwbmV3LmMg Yi9zcmMvZGlzcG5ldy5jCmluZGV4IGNjYjA4ZWMuLjE4N2RjN2YgMTAwNjQ0Ci0tLSBhL3NyYy9k aXNwbmV3LmMKKysrIGIvc3JjL2Rpc3BuZXcuYwpAQCAtNTYsNiArNTYsNDU3IEBAIGFsb25nIHdp dGggR05VIEVtYWNzLiAgSWYgbm90LCBzZWUgPGh0dHBzOi8vd3d3LmdudS5vcmcvbGljZW5zZXMv Pi4gICovCiAjaW5jbHVkZSAidzMyLmgiCiAjZW5kaWYKIAwKKworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyogVXBkYXRlIHRoZSBk aXNwbGF5IG9mIHRoZSB0ZXh0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B3aGVuIHRoZSBsYmVhcmluZyBpcyBsYXJnZXIgdGhhbgorICAg ICAgICAgdGhlIHBpeGVsIHdpZHRoLiAgKi8KKyAgICAgIGFib3J0X3NraXBwaW5nID0gKGkgPCBz dGFydF9ocG9zKTsKKyAgICB9CisgICAgICB9CisKKyAgICAvKiBUcnkgdG8gYXZvaWQgd3JpdGlu ZyB0aGUgZW50aXJlIHJlc3Qgb2YgdGhlIGRlc2lyZWQgcm93CisgICAgICAgYnkgbG9va2luZyBm b3IgYSByZXN5bmMgcG9pbnQuICBUaGlzIG1haW5seSBwcmV2ZW50cworICAgICAgIG1vZGUgbGlu ZSBmbGlja2VyaW5nIGluIHRoZSBjYXNlIHRoZSBtb2RlIGxpbmUgaXMgaW4KKyAgICAgICBmaXhl ZC1waXRjaCBmb250LCB3aGljaCBpdCB1c3VhbGx5IHdpbGwgYmUuICAqLworICAgIGlmIChpIDwg ZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgIHsKKyAgICAgICAgaW50IHN0YXJ0 X3ggPSB4LCBzdGFydF9ocG9zID0gaTsKKyAgICAgICAgc3RydWN0IGdseXBoICpzdGFydCA9IGRl c2lyZWRfZ2x5cGg7CisgICAgICAgIGludCBjdXJyZW50X3ggPSB4OworICAgICAgICBib29sIHNr aXBfZmlyc3RfcCA9ICFjYW5fc2tpcF9wOworCisgICAgICAgIC8qIEZpbmQgdGhlIG5leHQgZ2x5 cGggdGhhdCdzIGVxdWFsIGFnYWluLiAgKi8KKyAgICAgICAgd2hpbGUgKGkgPCBzdG9wCisgICAg ICAgICAmJiAoc2tpcF9maXJzdF9wCisgICAgICAgfHwgIUdMWVBIX0VRVUFMX1AgKGRlc2lyZWRf Z2x5cGgsIGN1cnJlbnRfZ2x5cGgpKQorICAgICAgICAgJiYgeCA9PSBjdXJyZW50X3gpCisgICAg eworICAgICAgeCArPSBkZXNpcmVkX2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgIGN1cnJlbnRf eCArPSBjdXJyZW50X2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICsrZGVzaXJlZF9nbHlwaCwg KytjdXJyZW50X2dseXBoLCArK2k7CisgICAgICBza2lwX2ZpcnN0X3AgPSAwOworICAgIH0KKwor ICBpZiAoZGVidWdfcAorICAgICAgJiYgdnBvcyAhPSBib3R0b21fdnBvcworICAgICAgJiYgIU5J TFAgKGlfc3RvcmUpKQorICAgIHsKKyAgICAgIExpc3BfT2JqZWN0IHN0cmluZyA9IEZwcmluMV90 b19zdHJpbmcgKGlfc3RvcmUsIFFuaWwpOworICAgICAgY2hhciAqY2hhcl9zdHJpbmcgPSBTU0RB VEEgKHN0cmluZyk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICJpX3N0b3JlOiAgdnBvcyAoJWQp IHwgJXNcbiIsIHZwb3MsIGNoYXJfc3RyaW5nKTsKKyAgICB9CisKKyAgZm9yICg7CisgICAgICAg Q09OU1AgKGlfc3RvcmUpCisgICAgICAgJiYgdnBvcyAhPSBib3R0b21fdnBvczsKKyAgICAgICBp X3N0b3JlID0gWENEUiAoaV9zdG9yZSkpCisgICAgeworICAgICAgaW50IHggPSBYRklYTlVNIChY Q0FSIChYQ0FSIChpX3N0b3JlKSkpOworICAgICAgaW50IGhwb3MgPSBYRklYTlVNIChYQ0RSIChY Q0FSIChpX3N0b3JlKSkpOworICAgICAgc3RydWN0IGdseXBoICp0YXJnZXRfZ2x5cGggPSBtY19n ZXRfY3Vyc29yX2dseXBoICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIGhwb3MsIHZw b3MpOworICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgIHsKKyAgICAgICAgICBmcHJpbnRmIChz dGRlcnIsICJpX3N0b3JlOiAgY2hhciAoJWQvJXMpIHwgeDogKCVkKSB8IGhwb3MgKCVkKSB8IHZw b3MgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldF9nbHlwaC0+dS5j aCwgbWNfY2hhcl90b19zdHJpbmcgKHRhcmdldF9nbHlwaC0+dS5jaCksCisgICAgICAgICAgICAg ICAgICAgICAgICAgICB4LCBocG9zLCB2cG9zKTsKKyAgICAgICAgfQorICAgICAgbWNfZHJhd19y b3cgKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBoLCB4LCAxLCB2 cG9zLAorICAgICAgICAgICAgICAgICAgIGJvdHRvbV92cG9zLCBhY3RpdmVfcCwgdHJ1ZSk7Cisg ICAgfQorCisgICAgICAgIGlmIChpID09IHN0YXJ0X2hwb3MgfHwgeCAhPSBjdXJyZW50X3gpCisg ICAgeworICAgICAgaSA9IHN0YXJ0X2hwb3M7CisgICAgICB4ID0gc3RhcnRfeDsKKyAgICAgIGRl c2lyZWRfZ2x5cGggPSBzdGFydDsKKyAgICAgIGJyZWFrOworICAgIH0KKworICAgICAgICBvdXRw dXRfY3Vyc29yX3RvICh3LCB2cG9zLCBzdGFydF9ocG9zLCBkZXNpcmVkX3Jvdy0+eSwgc3RhcnRf eCk7CisKKyAgLyogUmUtZHJhdyBhIHBvcnRpb24gb2YgdGhlIHJvdy4gKi8KKworICBpZiAoZGVi dWdfcAorICAgICAgJiYgdnBvcyAhPSBib3R0b21fdnBvcykKKyAgICB7CisKKyAgICAgIGZwcmlu dGYgKHN0ZGVyciwgIlJFRFJBVyBTRUdNRU5UOlxuXAorICAgICAgY2hhciAoJWQvJXMpIHwgc3Rh cnRfeDogKCVkKSB8IHN0YXJ0X2hwb3MgKCVkKSB8IGxlbmd0aCAoJWQpIHwgdnBvcyAoJWQpXG4i LAorICAgICAgc3RhcnQtPnUuY2gsIG1jX2NoYXJfdG9fc3RyaW5nIChzdGFydC0+dS5jaCksCisg ICAgICBzdGFydF94LCBzdGFydF9ocG9zLCBpIC0gc3RhcnRfaHBvcywgdnBvcyk7CisgICAgfQor CisgIHJpZi0+bWNfc2NyaWJlX2dseXBocyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93 LCBzdGFydCwgVEVYVF9BUkVBLCBpIC0gc3RhcnRfaHBvcywKKyAgICAgICAgICAgICAgICAgICAg ICAgICB2cG9zLCBib3R0b21fdnBvcywgcmVkLCBncmVlbiwgYmx1ZSwKKyAgICAgICAgICAgICAg ICAgICAgICAgICBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsIGN1cnNv cl9nY19wKTsKKworICBtY19kcmF3X3JvdyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93 LCBzdGFydCwgc3RhcnRfeCwgaSAtIHN0YXJ0X2hwb3MsCisgICAgICAgICAgICAgICB2cG9zLCBi b3R0b21fdnBvcywgYWN0aXZlX3AsIHRydWUpOworCisgICAgICAgIGNoYW5nZWRfcCA9IDE7Cisg ICAgICB9CisgIH0KKworICAgICAgLyogV3JpdGUgdGhlIHJlc3QuICAqLworICAgICAgaWYgKGkg PCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdKQorICB7CisgICAgb3V0cHV0X2N1cnNvcl90 byAodywgdnBvcywgaSwgZGVzaXJlZF9yb3ctPnksIHgpOworCisgIGlmIChkZWJ1Z19wCisgICAg ICAmJiB2cG9zICE9IGJvdHRvbV92cG9zKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwg IkRSQVcgUkVNQUlOREVSIE9GIFRIRSBST1c6XG5cCisgICAgICBjaGFyICglZC8lcykgfCB4OiAo JWQpIHwgaSAoJWQpIHwgbGVuZ3RoICglZCkgfCB2cG9zICglZClcbiIsCisgICAgICBkZXNpcmVk X2dseXBoLT51LmNoLCBtY19jaGFyX3RvX3N0cmluZyAoZGVzaXJlZF9nbHlwaC0+dS5jaCksCisg ICAgICB4LCBpLCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gaSwgdnBvcyk7CisgICAg fQorCisgIHJpZi0+bWNfc2NyaWJl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AgICAgICA6IHctPm91dHB1 dF9jdXJzb3IuaHBvczsKKyAgICAgICAgc3RydWN0IGdseXBoICpzdGFydCA9IG1jX2dldF9jdXJz b3JfZ2x5cGggKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgaHBvcywgdnBvcyk7Cisg ICAgICAgIGlmICh3LT5vdXRwdXRfY3Vyc29yLnggPT0gdXBkYXRlZF9yb3ctPnBpeGVsX3dpZHRo KQorICAgICAgICAgIHggLT0gc3RhcnQtPnBpeGVsX3dpZHRoOworICAgICAgICBpZiAoZGVidWdf cCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJDSEFOR0VEIC0g RlJPTTogIGNoYXIgKCVkLyVzKSB8IHggKCVkKSB8IGhwb3MgKCVkKSAtLSBUTyBFTkQuXG4iLAor ICAgICAgICAgICAgICAgICAgICAgc3RhcnQtPnUuY2gsIG1jX2NoYXJfdG9fc3RyaW5nIChzdGFy dC0+dS5jaCksCisgICAgICAgICAgICAgICAgICAgICB4LCBocG9zKTsKKyAgICAgICAgICB9Cisg ICAgICAgIG1jX2RyYXdfcm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHN0YXJ0 LCB4LCB1cGRhdGVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gaHBvcywKKyAgICAgICAgICAgICAg ICAgICAgIHZwb3MsIGJvdHRvbV92cG9zLCBhY3RpdmVfcCwgdHJ1ZSk7CisgICAgICB9CisgICAg ICAvKiBUaGVyZSB3ZXJlIG5vIGNoYW5nZXMgYW5kIGkgPT0gZGVzaXJlZF9yb3ctPnVzZWRbVEVY VF9BUkVBXSAqLworICAgICAgZWxzZSBpZiAoIWNoYW5nZWRfcCkKKyAgICAgICAgeworICAgICAg ICAgIGlmIChkZWJ1Z19wKQorICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiVU5DSEFOR0VE IC0tIFdSSVRFIEVOVElSRSBMSU5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ZiAoc3RkZXJyLCAibWNfdXBkYXRlX3RleHRfYXJlYSAoZmxvYXRpbmcp OiAgdnBvcyAoJWQpIHwgeF9saW1pdCAoJWQpXG4iLCB2cG9zLCB4X2xpbWl0KTsKKworICAgICAg aWYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAg ICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2hvcml6b250 YWxfcnVsZXIpKQorICAgICAgICAgICYmIHggPCB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAm JiB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgJiYgdGFyZ2V0X2dseXBoICE9IE5V TEwpCisgICAgICAgIG1jX2VuZ2luZSAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0 YXJnZXRfZ2x5cGgsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwKKyAgICAgICAgICAgICAgICAgICB1 cGRhdGVkX3Jvdy0+eSwgaHBvcywgdnBvcywgSEJBUl9DVVJTT1IsIDEsCisgICAgICAgICAgICAg ICAgICAgZGVidWdfcCA/IGRlYnVnX2ZnIDogdy0+Y2hfZm9yZWdyb3VuZCwgYWN0aXZlX3AsIEhP UklaT05UQUxfUlVMRVIsIHRydWUsICZyZXN1bHQpOworCisgICAgICBpZiAoIU5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgJiYgIU5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAg ICAgICYmIHggPCB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAmJiB2cG9zICE9IHctPmN1cnNv ci52cG9zCisgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0geAorICAgICAgICAgICYmIHRhcmdl dF9nbHlwaCAhPSBOVUxMKQorICAgICAgICBtY19lbmdpbmUgKHcsIGRlc2lyZWRfbWF0cml4LCB1 cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBoLCBURVhUX0FSRUEsIHgsIHhfbGltaXQsCisgICAgICAg ICAgICAgICAgICAgdXBkYXRlZF9yb3ctPnksIGhwb3MsIHZwb3MsIEJBUl9DVVJTT1IsIDEsCisg ICAgICAgICAgICAgICAgICAgZGVidWdfcCA/IGRlYnVnX2ZnIDogdy0+Y2hfZm9yZWdyb3VuZCwg YWN0aXZlX3AsIFZFUlRJQ0FMX1JVTEVSLCB0cnVlLCAmcmVzdWx0KTsKKworICAgICAgaWYgKCFO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQorICAgICAgICAg ICYmIHggPCB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAmJiB3LT5tYy5mY194ID49IHgKKyAg ICAgICAgICAmJiB0YXJnZXRfZ2x5cGggIT0gTlVMTCkKKyAgICAgICAgbWNfZW5naW5lICh3LCBk ZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHRhcmdldF9nbHlwaCwgVEVYVF9BUkVBLCB4LCB4 X2xpbWl0LAorICAgICAgICAgICAgICAgICAgIHVwZGF0ZWRfcm93LT55LCBocG9zLCB2cG9zLCBC QVJfQ1VSU09SLCAxLAorICAgICAgICAgICAgICAgICAgIGRlYnVnX3AgPyBkZWJ1Z19mZyA6IHct PmZjX2ZvcmVncm91bmQsIGFjdGl2ZV9wLCBGSUxMX0NPTFVNTiwgdHJ1ZSwgJnJlc3VsdCk7CisK KyAgICB9CisgICAgfQorCisgIHJldHVybiBjaGFuZ2VkX3A7Cit9CisKKy8qIGVuZCBNVUxUSVBM RS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBTdHJ1Y3R1cmUg dG8gcGFzcyBkaW1lbnNpb25zIGFyb3VuZC4gIFVzZWQgZm9yIGNoYXJhY3RlciBib3VuZGluZwog ICAgYm94ZXMsIGdseXBoIG1hdHJpeCBkaW1lbnNpb25zIGFuZCBhbGlrZS4gICovCiAKQEAgLTMy ODIsMTAgKzM3MzMsMzYgQEAgcmVkcmF3X292ZXJsYXBwZWRfcm93cyAoc3RydWN0IHdpbmRvdyAq dywgaW50IHliKQogCSAgICB7CiAJICAgICAgb3V0cHV0X2N1cnNvcl90byAodywgaSwgMCwgcm93 LT55LAogCQkJCWFyZWEgPT0gVEVYVF9BUkVBID8gcm93LT54IDogMCk7Ci0JICAgICAgaWYgKHJv dy0+dXNlZFthcmVhXSkKKworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQ TEUtQ1VSU09SUyAqLworCisgIGlmICgoIU5JTFAgKHctPm1jX2NhY2hlKSB8fCAhTklMUCAody0+ Y2hfY2FjaGUpIHx8ICFOSUxQICh3LT5mY19jYWNoZSkpCisgICAgICAmJiBhcmVhID09IFRFWFRf QVJFQQorICAgICAgJiYgcm93LT51c2VkW2FyZWFdKQorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlw aF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworICAgICAgaW50IHN0YXJ0X3gg PSByb3ctPng7CisgICAgICBpbnQgc3RhcnRfaHBvcyA9IDA7CisgICAgICBpbnQgZW5kX2hwb3Mg PSByb3ctPnVzZWRbYXJlYV07CisgICAgICBib29sIGNsZWFyX2VvbF9wID0gdHJ1ZTsKKyAgICAg IGVudW0gZHJhd19nbHlwaHNfZmFjZSBobCA9IERSQVdfTk9STUFMX1RFWFQ7CisgICAgICBUUkFD RSAoKHN0ZGVyciwgInJlZHJhd19vdmVybGFwcGVkX3Jvd3MgKCVkKTogIHN0YXJ0X3ggKCVkKSB8 IHN0YXJ0X2hwb3MgKCVkKSB8IGVuZF9ocG9zICglZClcbiIsCisgICAgICAgICAgICAgICAgICAg ICAgaSwgc3RhcnRfeCwgc3RhcnRfaHBvcywgZW5kX2hwb3MpKTsKKyAgICAgIG1jX3JlZHJhd19y b3cgKHcsIG1hdHJpeCwgcm93LCBzdGFydF94LCBzdGFydF9ocG9zLCBlbmRfaHBvcywgY2xlYXJf ZW9sX3AsIGhsKTsKKyAgICB9CisgICAgZWxzZSBpZiAocm93LT51c2VkW2FyZWFdKQorICAgICAg ewogCQlGUkFNRV9SSUYgKGYpLT53cml0ZV9nbHlwaHMgKHcsIHJvdywgcm93LT5nbHlwaHNbYXJl YV0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmVhLCBy b3ctPnVzZWRbYXJlYV0pOwogCSAgICAgIEZSQU1FX1JJRiAoZiktPmNsZWFyX2VuZF9vZl9saW5l ICh3LCByb3csIGFyZWEsIC0xKTsKKyAgICAgIH0KKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogCSAgICB9CiAKIAkgIHJvdy0+b3ZlcmxhcHBlZF9wID0gMDsKQEAgLTMzODgsNiArMzg2 NSw1MiBAQCBzdGF0aWMgYm9vbAogdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9v bCBmb3JjZV9wKQogewogICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICpkZXNpcmVkX21hdHJpeCA9IHct PmRlc2lyZWRfbWF0cml4OworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4g TVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlmICh0cmFjZV9yZWRpc3BsYXlfcCkKKyAgICBmcHJp bnRmIChzdGRlcnIsICJ1cGRhdGVfd2luZG93ICglcylcbiIsIG1jX3dpbmRvdyAodykpOworCisg IHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBib29sIGFjdGl2ZV9wID0g KHcgPT0gWFdJTkRPVyAoZi0+c2VsZWN0ZWRfd2luZG93KQorICAgICAgICAgICAgICAgICAgICYm IGYgPT0gRlJBTUVfRElTUExBWV9JTkZPIChmKS0+eF9oaWdobGlnaHRfZnJhbWUpOworICBtY19z ZXRfZXNzZW50aWFscyAodywgYWN0aXZlX3ApOworCisgIHN0cnVjdCBnbHlwaF9tYXRyaXggKmN1 cnJlbnRfbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisKKyAgYm9vbCB1cGRhdGluZ19mcmFt ZV9wID0gZmFsc2U7CisKKyAgYm9vbCBnb19wID0gKCFOSUxQICh3LT5tY19jYWNoZSkgfHwgIU5J TFAgKHctPmNoX2NhY2hlKSB8fCAhTklMUCAody0+ZmNfY2FjaGUpCisgICAgICAgICAgICAgICB8 fCAoQlVGRkVSUCAody0+Y29udGVudHMpICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIG1jX2NvbmYpKSkKKyAgICAgICAgICAgICAgIHx8IChCVUZGRVJQICh3LT5jb250ZW50 cykgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQor ICAgICAgICAgICAgICAgfHwgKEJVRkZFUlAgKHctPmNvbnRlbnRzKSAmJiAhTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpKTsKKworICBpZiAoZ29fcAorICAg ICAgJiYgWEZSQU1FICh3LT5mcmFtZSkgIT0gWEZSQU1FICh3LT5mcmFtZSktPm1jX3VwZGF0aW5n X2ZyYW1lKQorICAgIHsKKyAgICAgIHVwZGF0aW5nX2ZyYW1lX3AgPSB0cnVlOworICAgICAgdXBk YXRlX2JlZ2luIChYRlJBTUUgKHctPmZyYW1lKSk7CisgICAgfQorCisgIGZvciAoaW50IHZwb3Mg PSAwOworICAgICAgIHZwb3MgPCBjdXJyZW50X21hdHJpeC0+bnJvd3MKKyAgICAgICAmJiBNQVRS SVhfUk9XIChjdXJyZW50X21hdHJpeCwgdnBvcyktPmVuYWJsZWRfcAorICAgICAgICYmICghTklM UCAody0+bWNfY2FjaGUpIHx8ICFOSUxQICh3LT5jaF9jYWNoZSkgfHwgIU5JTFAgKHctPmZjX2Nh Y2hlKSk7CisgICAgICAgKyt2cG9zKQorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJv dyA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCB2cG9zKTsKKyAgICAgIG1jX2VyYXNlX3Jv dyAodywgY3VycmVudF9tYXRyaXgsIHJvdyk7CisgICAgfQorICB3c2V0X21jX2NhY2hlICh3LCBR bmlsKTsKKyAgd3NldF9jaF9jYWNoZSAodywgUW5pbCk7CisgIHdzZXRfZmNfY2FjaGUgKHcsIFFu aWwpOworCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogICBib29sIHBhdXNlZF9wOwogICBpbnQgcHJlZW1wdF9jb3VudCA9IGNsaXBfdG9f Ym91bmRzICgxLCBiYXVkX3JhdGUgLyAyNDAwICsgMSwgSU5UX01BWCk7CiAgIHN0cnVjdCByZWRp c3BsYXlfaW50ZXJmYWNlICpyaWYgPSBGUkFNRV9SSUYgKFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3 KSkpOwpAQCAtMzQ5Nyw2ICs0MDIwLDM5IEBAIHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5kb3cg KncsIGJvb2wgZm9yY2VfcCkKIAogICAgIHNldF9jdXJzb3I6CiAKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogUmVzZXQgYHJvd2AgdG8g MCBzbyB0aGF0IGZha2UgY3Vyc29ycyBjYW4gYmUgZHJhd24gb24gcm93cyBwcmVjZWRpbmcgdGhl CisgIGZpcnN0IGByb3ctPmVuYWJsZWRfcGAuICBKdXN0IHByaW9yIHRvIHRoZSBjYWxsIHRvIGBz Y3JvbGxpbmdfd2luZG93JyBhYm92ZSwKKyAgYHJvd2Agd2FzIGFkdmFuY2VkIHRvIHRoZSBmaXJz dCBgcm93LT5lbmFibGVkX3BgLiAqLworICAgZm9yIChzdHJ1Y3QgZ2x5cGhfcm93ICpkZXNpcmVk X3JvdyA9IE1BVFJJWF9ST1cgKGRlc2lyZWRfbWF0cml4LCAwKTsKKyAgICAgICAgLy8gY2hhbmdl ZF9wCisgICAgICAgIGRlc2lyZWRfcm93IDwgZW5kCisgICAgICAgICYmIChmb3JjZV9wIHx8ICFp bnB1dF9wZW5kaW5nKQorICAgICAgICAvKiBOVCBFbWFjcyBjcmFzaGVzIG9uIHN0YXJ0dXAgd2l0 aG91dCBhIEJVRkZFUlAgY2hlY2suICovCisgICAgICAgICYmIEJVRkZFUlAgKHctPmNvbnRlbnRz KQorICAgICAgICAmJiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29u ZikpCisgICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBj cm9zc2hhaXJzKSkKKyAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIGZjX3Zpc2libGUpKSk7CisgICAgICAgICsrZGVzaXJlZF9yb3cpCisgICAgeworICAg ICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKGRlc2lyZWRfcm93LCBkZXNpcmVkX21hdHJp eCk7CisgICAgICBpZiAoZGVzaXJlZF9yb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgY29udGludWU7 CisgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpib3R0b21fcm93ID0gTUFUUklYX0JPVFRPTV9URVhU X1JPVyAoY3VycmVudF9tYXRyaXgsIHcpOworICAgICAgaW50IGJvdHRvbV92cG9zID0gTUFUUklY X1JPV19WUE9TIChib3R0b21fcm93LCBjdXJyZW50X21hdHJpeCk7CisgICAgICBzdHJ1Y3QgZ2x5 cGhfcm93ICpjdXJyZW50X3JvdyA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCB2cG9zKTsK KyAgICAgIGlmIChjdXJyZW50X3Jvdy0+ZW5hYmxlZF9wKQorICAgICAgICBtY19kcmF3X3JvdyAo dywgY3VycmVudF9tYXRyaXgsIGN1cnJlbnRfcm93LCBjdXJyZW50X3Jvdy0+Z2x5cGhzW1RFWFRf QVJFQV0sCisgICAgICAgICAgICAgICAgICAgICBjdXJyZW50X3Jvdy0+eCwgY3VycmVudF9yb3ct PnVzZWRbVEVYVF9BUkVBXSwgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgIGJvdHRvbV92cG9z LCBhY3RpdmVfcCwgdHJ1ZSk7CisgICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAgICAgICAvKiBVcGRhdGUgdGhlIGhlYWRlciBsaW5lIGFmdGVyIHNjcm9sbGluZyBiZWNhdXNl IGEgbmV3IGhlYWRlcgogCSBsaW5lIHdvdWxkIG90aGVyd2lzZSBvdmVyd3JpdGUgbGluZXMgYXQg dGhlIHRvcCBvZiB0aGUgd2luZG93CiAJIHRoYXQgY2FuIGJlIHNjcm9sbGVkLiAgKi8KQEAgLTM1 MzEsMTAgKzQwODcsMjEgQEAgdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBm b3JjZV9wKQogICAgICAgc3RyY3B5ICh3LT5jdXJyZW50X21hdHJpeC0+bWV0aG9kLCB3LT5kZXNp cmVkX21hdHJpeC0+bWV0aG9kKTsKICNlbmRpZgogCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCisg IGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICBtY191cGRhdGVfd2luZG93X2ZyaW5n ZXMgKHcsIDApOworICAgIGVsc2UKICAgICAgIHVwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgMCk7 CiAjZW5kaWYKIAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgLyogRW5kIHRo ZSB1cGRhdGUgb2Ygd2luZG93IFcuICBEb24ndCBzZXQgdGhlIGN1cnNvciBpZiB3ZQogICAgICAg ICAgcGF1c2VkIHVwZGF0aW5nIHRoZSBkaXNwbGF5IGJlY2F1c2UgaW4gdGhpcyBjYXNlLAogICAg ICAgICAgc2V0X3dpbmRvd19jdXJzb3JfYWZ0ZXJfdXBkYXRlIGhhc24ndCBiZWVuIGNhbGxlZCwg YW5kCkBAIC0zNTUyLDYgKzQxMTksMTYgQEAgdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAq dywgYm9vbCBmb3JjZV9wKQogICB4d2lkZ2V0X2VuZF9yZWRpc3BsYXkgKHcsIHctPmN1cnJlbnRf bWF0cml4KTsKICAgY2xlYXJfZ2x5cGhfbWF0cml4IChkZXNpcmVkX21hdHJpeCk7CiAKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgaWYgKHVw ZGF0aW5nX2ZyYW1lX3ApCisgICAgdXBkYXRlX2VuZCAoWEZSQU1FICh3LT5mcmFtZSkpOworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIHJldHVybiBwYXVzZWRfcDsKIH0KIApAQCAt Mzg1MiwxNCArNDQyOSwzMCBAQCB1cGRhdGVfd2luZG93X2xpbmUgKHN0cnVjdCB3aW5kb3cgKncs IGludCB2cG9zLCBib29sICptb3VzZV9mYWNlX292ZXJ3cml0dGVuX3ApCiAJICBjdXJyZW50X3Jv dy0+cmVkcmF3X2ZyaW5nZV9iaXRtYXBzX3AgPSAxOwogCX0KIAorCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBib29sIHVwZGF0ZWRfcCA9ICgh QlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgPyB1cGRhdGVfdGV4dF9h cmVhICh3LCBkZXNpcmVkX3JvdywgdnBvcykKKyAgICAgICAgICAgICAgICAgICA6IChCVUZGRVJQ ICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICAgICAmJiBOSUxQIChCVkFSIChYQlVG RkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAgICAgICAgICAgICAgICAgICYmIE5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAg ICAgICAgICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNp YmxlKSkpCisgICAgICAgICAgICAgICAgICAgICA/IHVwZGF0ZV90ZXh0X2FyZWEgKHcsIGRlc2ly ZWRfcm93LCB2cG9zKQorICAgICAgICAgICAgICAgICAgIDogbWNfdXBkYXRlX3RleHRfYXJlYSAo dywgZGVzaXJlZF9yb3csIHZwb3MpKTsKKwogICAgICAgLyogVXBkYXRlIHRoZSBkaXNwbGF5IG9m IHRoZSB0ZXh0IGFyZWEuICAqLwotICAgICAgaWYgKHVwZGF0ZV90ZXh0X2FyZWEgKHcsIGRlc2ly ZWRfcm93LCB2cG9zKSkKKyAgICAgIGlmICh1cGRhdGVkX3ApCiAJewogCSAgY2hhbmdlZF9wID0g MTsKIAkgIGlmIChjdXJyZW50X3Jvdy0+bW91c2VfZmFjZV9wKQogCSAgICAqbW91c2VfZmFjZV9v dmVyd3JpdHRlbl9wID0gMTsKIAl9CiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAg ICAgIC8qIFVwZGF0ZSBkaXNwbGF5IG9mIHRoZSByaWdodCBtYXJnaW4gYXJlYSwgaWYgdGhlcmUg aXMgb25lLiAgKi8KICAgICAgIGlmICghZGVzaXJlZF9yb3ctPmZ1bGxfd2lkdGhfcCAmJiB3LT5y aWdodF9tYXJnaW5fY29scyA+IDApCiAJewpkaWZmIC0tZ2l0IGEvc3JjL2ZyYW1lLmggYi9zcmMv ZnJhbWUuaAppbmRleCBlYzhmNjE0Li5lZWFmNzFlIDEwMDY0NAotLS0gYS9zcmMvZnJhbWUuaAor KysgYi9zcmMvZnJhbWUuaApAQCAtMjA1LDYgKzIwNSwxNiBAQCBzdHJ1Y3QgZnJhbWUKICAgTGlz cF9PYmplY3QgdG9vbF9iYXJfaXRlbXM7CiAgIC8qIHRvb2xfYmFyX2l0ZW1zIHNob3VsZCBiZSB0 aGUgbGFzdCBMaXNwX09iamVjdCBtZW1iZXIuICAqLwogCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8qIE5vbi1uaWwgd2hlbiB0aGUgZnJh bWUgaXMgaW4gdGhlIHByb2Nlc3Mgb2YgYmVpbmcgdXBkYXRlZC4gKi8KKyAgc3RydWN0IGZyYW1l ICptY191cGRhdGluZ19mcmFtZTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAv KiBDYWNoZSBvZiByZWFsaXplZCBmYWNlcy4gICovCiAgIHN0cnVjdCBmYWNlX2NhY2hlICpmYWNl X2NhY2hlOwogCmRpZmYgLS1naXQgYS9zcmMvZnJpbmdlLmMgYi9zcmMvZnJpbmdlLmMKaW5kZXgg MzM1YTZlYi4uNjE0ODhkZSAxMDA2NDQKLS0tIGEvc3JjL2ZyaW5nZS5jCisrKyBiL3NyYy9mcmlu Z2UuYwpAQCAtNDM4LDYgKzQzOCwzOTkgQEAgc3RhdGljIHVuc2lnbmVkIHNob3J0IGVtcHR5X2xp bmVfYml0c1tdID0gewogI2RlZmluZSBTVEFOREFSRF9CSVRNQVBfSEVJR0hUKGJpdHMpIChzaXpl b2YgKGJpdHMpL0JZVEVTX1BFUl9CSVRNQVBfUk9XKQogI2RlZmluZSBGUkJJVFMoYml0cykgIGJp dHMsIFNUQU5EQVJEX0JJVE1BUF9IRUlHSFQgKGJpdHMpCiAKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIGArLWZyaW5nZS1oZWxw ZXItZGVjaW1hbCcgZGVmaW5lZCBpbiBgY3Jvc3NoYWlycy5lbGAgKi8KKworLyogMjQKKyAgICAo Ky1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4u Li4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4ueHguLi4iCisgICAgICAieC4uLnh4 Li4iCisgICAgICAieC4uLi54eC4iCisgICAgICAieC54eHh4eHgiCisgICAgICAieC54eHh4eHgi CisgICAgICAieC4uLi54eC4iCisgICAgICAieC4uLnh4Li4iCisgICAgICAieC4ueHguLi4iCisg ICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iKQorKi8K K3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY192ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3dfYml0c1td ID17CisgIDB4ODAsIDB4ODAsIDB4ODAsIDB4OTgsIDB4OGMsIDB4ODYsIDB4YmYsCisgIDB4YmYs IDB4ODYsIDB4OGMsIDB4OTgsIDB4ODAsIDB4ODAsIDB4ODB9OworCisvKiAyNQorICAgICgrLWZy aW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICJ4eHh4eHh4eCIKKyAgICAgICJ4Li4uLi4u eCIKKyAgICAgICJ4Li4uLi4ueCIKKyAgICAgICJ4Li54eC4ueCIKKyAgICAgICJ4Li4ueHgueCIK KyAgICAgICJ4Li4uLnh4eCIKKyAgICAgICJ4Lnh4eHh4eCIKKyAgICAgICJ4Lnh4eHh4eCIKKyAg ICAgICJ4Li4uLnh4eCIKKyAgICAgICJ4Li4ueHgueCIKKyAgICAgICJ4Li54eC4ueCIKKyAgICAg ICJ4Li4uLi4ueCIKKyAgICAgICJ4Li4uLi4ueCIKKyAgICAgICJ4eHh4eHh4eCIpCisqLworc3Rh dGljIHVuc2lnbmVkIH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IKKyAgICAgICJ4Li4uLi4uLiIKKyAgICAgICJ4Li4uLi4uLiIK KyAgICAgICJ4Li4uLi4uLiIKKyAgICAgICJ4Li4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVk IHNob3J0IG1jX3ZlcnRpY2FsX2Jhcl9iaXRzW10gPXsKKyAgMHg4MCwgMHg4MCwgMHg4MCwgMHg4 MCwgMHg4MCwgMHg4MCwgMHg4MCwKKyAgMHg4MCwgMHg4MCwgMHg4MCwgMHg4MCwgMHg4MCwgMHg4 MCwgMHg4MH07CisKKy8qIDI4CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAg ICAgInh4Li4uLi4uIgorICAgICAgInh4Li4uLi4uIgorICAgICAgIiB4eC4uLi4uIgorICAgICAg Ii54eC4uLi4uIgorICAgICAgIi4ueHguLi4uIgorICAgICAgIi4ueHguLi4uIgorICAgICAgIi4u Lnh4Li4uIgorICAgICAgIi4uLnh4Li4uIgorICAgICAgIi4uLi54eC4uIgorICAgICAgIi4uLi54 eC4uIgorICAgICAgIi4uLi4ueHguIgorICAgICAgIi4uLi4ueHguIgorICAgICAgIi4uLi4uLnh4 IgorICAgICAgIi4uLi4uLnh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfYmFja3Ns YXNoX2JpdHNbXSA9eworICAweGMwLCAweGMwLCAweGUwLCAweDYwLCAweDMwLCAweDMwLCAweDE4 LCAweDE4LCAweGMsIDB4YywgMHg2LCAweDYsIDB4MywgMHgzfTsKKworLyogMjkKKyAgICAoKy1m cmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHguLi4uLi4iCisgICAgICAieHguLi4u Li4iCisgICAgICAieHh4Li4uLi4iCisgICAgICAieHh4Li4uLi4iCisgICAgICAieC54eC4uLi4i CisgICAgICAieC54eC4uLi4iCisgICAgICAieC4ueHguLi4iCisgICAgICAieC4ueHguLi4iCisg ICAgICAieC4uLnh4Li4iCisgICAgICAieC4uLnh4Li4iCisgICAgICAieC4uLi54eC4iCisgICAg ICAieC4uLi54eC4iCisgICAgICAieC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgiKQorKi8KK3N0 YXRpYyB1bnNpZ25lZCBzaG9ydCBtY192ZXJ0aWNhbF9iYXJfYmFja3NsYXNoX2JpdHNbXSA9ewor ICAweGMwLCAweGMwLCAweGUwLCAweGUwLCAweGIwLCAweGIwLCAweDk4LAorICAweDk4LCAweDhj LCAweDhjLCAweDg2LCAweDg2LCAweDgzLCAweDgzfTsKKworLyogMzAKKyAgICAoKy1mcmluZ2Ut aGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLnh4eHh4eC4iCisgICAgICAieHh4eC54Li4iCisg ICAgICAieHh4eC54Li4iCisgICAgICAieHh4eC54Li4iCisgICAgICAiLnh4eC54Li4iCisgICAg ICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAgICAi Li4ueC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4iKQorKi8KK3N0YXRp YyB1bnNpZ25lZCBzaG9ydCBtY19waWxjcm93X2JpdHNbXSA9eworICAweDdlLCAweGY0LCAweGY0 LCAweGY0LCAweDc0LCAweDE0LCAweDE0LCAweDE0LCAweDE0LCAweDE0LCAweDE0fTsKKworLyog MzEKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi54eHh4Li4iCisg ICAgICAiLnh4eHh4eC4iCisgICAgICAieC4ueHguLngiCisgICAgICAieC4ueHguLngiCisgICAg ICAieHh4eHh4eHgiCisgICAgICAieHguLi4ueHgiCisgICAgICAieHh4Li54eHgiCisgICAgICAi Lnh4eHh4eC4iCisgICAgICAiLi54eHh4Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBt Y19zbWlsZXlfZmFjZV9iaXRzW10gPXsKKyAgMHgzYywgMHg3ZSwgMHg5OSwgMHg5OSwgMHhmZiwg MHhjMywgMHhlNywgMHg3ZSwgMHgzY307CisKKy8qIDMyCisgICAgKCstZnJpbmdlLWhlbHBlci1o ZXhhZGVjaW1hbAorICAgICAgIi4ueC4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4u Li54Li4uIgorICAgICAgIi4uLi4ueC4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4uLngu Li4uIgorICAgICAgIi4ueC4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc2lu Z2xlX2FuZ2xlX3JpZ2h0X2JpdHNbXSA9eworICAweDIwLCAweDEwLCAweDgsIDB4NCwgMHg4LCAw eDEwLCAweDIwfTsKKworLyogMzMKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisg ICAgICAiLi4uLi54Li4iCisgICAgICAiLi4uLnguLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAg ICAiLi54Li4uLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLnguLi4iCisgICAgICAi Li4uLi54Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zaW5nbGVfYW5nbGVfbGVm dF9iaXRzW10gPXsKKyAgMHg0LCAweDgsIDB4MTAsIDB4MjAsIDB4MTAsIDB4OCwgMHg0fTsKKwor LyogMzQKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHgueHguLi4i CisgICAgICAiLnh4Lnh4Li4iCisgICAgICAiLi54eC54eC4iCisgICAgICAiLi4ueHgueHgiCisg ICAgICAiLi54eC54eC4iCisgICAgICAiLnh4Lnh4Li4iCisgICAgICAieHgueHguLi4iKQorKi8K K3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfcmlnaHRfYml0c1tdID17Cisg IDB4ZDgsIDB4NmMsIDB4MzYsIDB4MWIsIDB4MzYsIDB4NmMsIDB4ZDh9OworCisvKiAzNQorICAg ICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi54eC54eCIKKyAgICAgICIu Lnh4Lnh4LiIKKyAgICAgICIueHgueHguLiIKKyAgICAgICJ4eC54eC4uLiIKKyAgICAgICIueHgu eHguLiIKKyAgICAgICIuLnh4Lnh4LiIKKyAgICAgICIuLi54eC54eCIpCisqLworc3RhdGljIHVu c2lnbmVkIHNob3J0IG1jX2RvdWJsZV9hbmdsZV9sZWZ0X2JpdHNbXSA9eworICAweDFiLCAweDM2 LCAweDZjLCAweGQ4LCAweDZjLCAweDM2LCAweDFifTsKKworLyogMzYKKyAgICAoKy1mcmluZ2Ut aGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC54LnguLi4iCisgICAgICAiLngueC54Li4iCisg ICAgICAiLi54LngueC4iCisgICAgICAiLi4ueC54LngiCisgICAgICAiLi54LngueC4iCisgICAg ICAiLngueC54Li4iCisgICAgICAieC54LnguLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9y dCBtY190cmlwbGVfYW5nbGVfcmlnaHRfYml0c1tdID17CisgIDB4YTgsIDB4NTQsIDB4MmEsIDB4 MTUsIDB4MmEsIDB4NTQsIDB4YTh9OworCisvKiAzNworICAgICgrLWZyaW5nZS1oZWxwZXItaGV4 YWRlY2ltYWwKKyAgICAgICIuLi54LngueCIKKyAgICAgICIuLngueC54LiIKKyAgICAgICIueC54 LnguLiIKKyAgICAgICJ4LngueC4uLiIKKyAgICAgICIueC54LnguLiIKKyAgICAgICIuLngueC54 LiIKKyAgICAgICIuLi54LngueCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3RyaXBs ZV9hbmdsZV9sZWZ0X2JpdHNbXSA9eworICAweDE1LCAweDJhLCAweDU0LCAweGE4LCAweDU0LCAw eDJhLCAweDE1fTsKKworLyogMzgKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisg ICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAg ICAiLi4uLi4uLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54LnguLi4iCisgICAgICAi LnguLi54Li4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4u Li4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1 bnNpZ25lZCBzaG9ydCBtY19zaW5nbGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4MDAsIDB4MDAs IDB4MDAsIDB4MDAsIDB4MTAsIDB4MjgsIDB4NDQsIDB4ODIsIDB4MDAsIDB4MDAsIDB4MDAsIDB4 MDB9OworCisvKiAzOQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIu Li4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4u Li4uLiIKKyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4u LiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIK KyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVk IHNob3J0IG1jX3NpbmdsZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAweDAwLCAweDAwLCAweDAw LCAweDAwLCAweDgyLCAweDQ0LCAweDI4LCAweDEwLCAweDAwLCAweDAwLCAweDAwLCAweDAwfTsK KworLyogNDAKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4u Li4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4ueC4uLi4i CisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisg ICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4uLi4ueC4iCisgICAg ICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0 YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4MDAs IDB4MDAsIDB4MDAsIDB4MTAsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4ODIsIDB4 MDAsIDB4MDAsIDB4MDB9OworCisvKiA0MQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2lt YWwKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIK KyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAg ICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAg ICIuLi54Li4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIu Li4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX2RvdWJsZV9hbmdsZV9kb3du X2JpdHNbXSA9eworICAweDAwLCAweDAwLCAweDAwLCAweDgyLCAweDQ0LCAweDI4LCAweDkyLCAw eDQ0LCAweDI4LCAweDEwLCAweDAwLCAweDAwLCAweDAwfTsKKworLyogNDIKKyAgICAoKy1mcmlu Z2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4ueC4uLi4i CisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisg ICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAg ICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAi Li4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190cmlwbGVfYW5nbGVfdXBf Yml0c1tdID17CisgIDB4MDAsIDB4MTAsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4 OTIsIDB4MjgsIDB4NDQsIDB4ODIsIDB4MDB9OworCisvKiA0MworICAgICgrLWZyaW5nZS1oZWxw ZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICJ4Li4uLi54LiIKKyAgICAg ICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIu eC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4u LnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLi4uLi4u LiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3F1YWRydXBsZV9hbmdsZV9kb3duX2Jp dHNbXSA9eworICAweDAwLCAweDgyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDky LCAweDQ0LCAweDI4LCAweDEwLCAweDAwfTsKKworLyogNDQKKyAgICAoKy1mcmluZ2UtaGVscGVy LWhleGFkZWNpbWFsCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54LnguLi4iCisgICAgICAi LnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLngu Li54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54 Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4i CisgICAgICAieC4uLi4ueC4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19xdWFkcnVw bGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4MTAsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4 NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4ODJ9OworCisvKiA0NQor ICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICJ4Li4uLi54LiIKKyAgICAg ICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIu eC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4u LnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLngu LiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIuLi54Li4uLiIpCisqLworc3RhdGljIHVuc2ln bmVkIHNob3J0IG1jX3RyaXBsZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAweDgyLCAweDQ0LCAw eDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4 LCAweDEwfTsKKworLyogVE9ETzogIEFkZCB0aGUgZm9sbG93aW5nIGJpdG1hcHM6CisgIChkZWZp bmUtZnJpbmdlLWJpdG1hcCAnYnJlYWtwb2ludCAiXHgzY1x4N2VceGZmXHhmZlx4ZmZceGZmXHg3 ZVx4M2MiKQorICAoZGVmaW5lLWZyaW5nZS1iaXRtYXAgJ2hvbGxvdy1yaWdodC10cmlhbmdsZSAi XHhlMFx4OTBceDg4XHg4NFx4ODRceDg4XHg5MFx4ZTAiKSAqLworCiAvKiBOT1RFOiAgVGhlIG9y ZGVyIG9mIHRoZXNlIGJpdG1hcHMgbXVzdCBtY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Jhd19wID0gMDsKKyAgTGlzcF9PYmplY3QgYm91bmRhcnlfdG9wID0gUW5pbCwgYm91 bmRhcnlfYm90ID0gUW5pbDsKKyAgTGlzcF9PYmplY3QgYXJyb3dfdG9wID0gUW5pbCwgYXJyb3df Ym90ID0gUW5pbDsKKyAgTGlzcF9PYmplY3QgZW1wdHlfcG9zOworICBMaXNwX09iamVjdCBpbmQg PSBRbmlsOworI2RlZmluZSBNQVhfQklUTUFQX0NBQ0hFICg4KjQpCisgIGludCBiaXRtYXBfY2Fj aGVbTUFYX0JJVE1BUF9DQUNIRV07CisgIGludCB0b3BfaW5kX3JuLCBib3RfaW5kX3JuOworICBp bnQgdG9wX2luZF9taW5feSwgYm90X2luZF9tYXhfeTsKKyAgLyogdG9wX2luZF9ybiBpcyBzZXQg dG8gYSBub25uZWdhdGl2ZSB2YWx1ZSB3aGVuZXZlcgorICAgICByb3ctPmluZGljYXRlX2JvYl9w IGlzIHNldCwgc28gaXQncyBPSyB0aGF0IHRvcF9yb3dfZW5kc19hdF96dl9wCisgICAgIGlzIG5v dCBpbml0aWFsaXplZCBoZXJlLiAgU2ltaWxhcmx5IGZvciBib3RfaW5kX3JuLAorICAgICByb3ct PmluZGljYXRlX2VvYl9wIGFuZCBib3Rfcm93X2VuZHNfYXRfenZfcC4gICovCisgIGludCB0b3Bf cm93X2VuZHNfYXRfenZfcCBNQ19JRl9MSU5UICg9IDApLCBib3Rfcm93X2VuZHNfYXRfenZfcCBN Q19JRl9MSU5UICg9IDApOworICBpZiAody0+cHNldWRvX3dpbmRvd19wKQorICAgIHJldHVybiAw OworICBpZiAoIU1JTklfV0lORE9XX1AgKHcpCisgICAgICAmJiAoaW5kID0gQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBpbmRpY2F0ZV9idWZmZXJfYm91bmRhcmllcyksICFOSUxQIChpbmQp KSkKKyAgICB7CisgICAgICBpZiAoRVEgKGluZCwgUWxlZnQpIHx8IEVRIChpbmQsIFFyaWdodCkp CisgICAgICAgIGJvdW5kYXJ5X3RvcCA9IGJvdW5kYXJ5X2JvdCA9IGFycm93X3RvcCA9IGFycm93 X2JvdCA9IGluZDsKKyAgICAgIGVsc2UgaWYgKENPTlNQIChpbmQpCisgICAgICAgICAgICAgICAm JiBDT05TUCAoWENBUiAoaW5kKSkpCisgIHsKKyAgICBMaXNwX09iamVjdCBwb3M7CisgICAgaWYg KHBvcyA9IG1jX2Fzc3EgKFF0LCBpbmQpLCAhTklMUCAocG9zKSkKKyAgICAgIGJvdW5kYXJ5X3Rv cCA9IGJvdW5kYXJ5X2JvdCA9IGFycm93X3RvcCA9IGFycm93X2JvdCA9IFhDRFIgKHBvcyk7Cisg ICAgaWYgKHBvcyA9IG1jX2Fzc3EgKFF0b3AsIGluZCksICFOSUxQIChwb3MpKQorICAgICAgYm91 bmRhcnlfdG9wID0gWENEUiAocG9zKTsKKyAgICBpZiAocG9zID0gbWNfYXNzcSAoUWJvdHRvbSwg aW5kKSwgIU5JTFAgKHBvcykpCisgICAgICBib3VuZGFyeV9ib3QgPSBYQ0RSIChwb3MpOworICAg IGlmIChwb3MgPSBtY19hc3NxIChRdXAsIGluZCksICFOSUxQIChwb3MpKQorICAgICAgYXJyb3df dG9wID0gWENEUiAocG9zKTsKKyAgICBpZiAocG9zID0gbWNfYXNzcSAoUWRvd24sIGluZCksICFO SUxQIChwb3MpKQorICAgICAgYXJyb3dfYm90ID0gWENEUiAocG9zKTsKKyAgfQorICAgICAgZWxz ZQorICAgICAgICAvKiBBbnl0aGluZyBlbHNlIG1lYW5zIGJvdW5kYXJ5IG9uIGxlZnQgYW5kIG5v IGFycm93cy4gICovCisgICAgICAgIGJvdW5kYXJ5X3RvcCA9IGJvdW5kYXJ5X2JvdCA9IFFsZWZ0 OworICAgIH0KKyAgdG9wX2luZF9ybiA9IGJvdF9pbmRfcm4gPSAtMTsKKyAgaWYgKCFOSUxQIChp bmQpKQorICAgIHsKKyAgICAgIGZvciAoeSA9IHctPnZzY3JvbGwsIHJuID0gMDsKKyAgICAgeSA8 IHliICYmIHJuIDwgbnJvd3M7CisgICAgIHkgKz0gcm93LT5oZWlnaHQsICsrcm4pCisgIHsKKyAg ICByb3cgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHJuOworICAgIGlmICghcm93LT5lbmFi bGVkX3ApCisgICAgICByb3cgPSB3LT5jdXJyZW50X21hdHJpeC0+cm93cyArIHJuOworICAgIHJv dy0+aW5kaWNhdGVfYm9iX3AgPSByb3ctPmluZGljYXRlX3RvcF9saW5lX3AgPSAwOworICAgIHJv dy0+aW5kaWNhdGVfZW9iX3AgPSByb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3AgPSAwOworICAg IGlmICghcm93LT5tb2RlX2xpbmVfcCkKKyAgICAgIHsKKyAgICAgICAgaWYgKHRvcF9pbmRfcm4g PCAwICYmIHJvdy0+dmlzaWJsZV9oZWlnaHQgPiAwKQorICAgIHsKKyAgICAgIGlmIChNQVRSSVhf Uk9XX1NUQVJUX0NIQVJQT1MgKHJvdykgPD0gQlVGX0JFR1YgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSkKKyAgICAgICAgICAmJiAhTUFUUklYX1JPV19QQVJUSUFMTFlfVklTSUJMRV9BVF9UT1BfUCAo dywgcm93KSkKKyAgICAgICAgcm93LT5pbmRpY2F0ZV9ib2JfcCA9ICFOSUxQIChib3VuZGFyeV90 b3ApOworICAgICAgZWxzZQorICAgICAgICByb3ctPmluZGljYXRlX3RvcF9saW5lX3AgPSAhTklM UCAoYXJyb3dfdG9wKTsKKyAgICAgIHRvcF9pbmRfcm4gPSBybjsKKyAgICB9CisgICAgICAgIGlm IChib3RfaW5kX3JuIDwgMCkKKyAgICB7CisgICAgICBpZiAoTUFUUklYX1JPV19FTkRfQ0hBUlBP UyAocm93KSA+PSBCVUZfWlYgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSkKKyAgICAgICAgICAmJiAh TUFUUklYX1JPV19QQVJUSUFMTFlfVklTSUJMRV9BV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4 X3kgJiYgcm4gPCBucm93czsKKyAgICAgICB5ICs9IHJvdzEtPmhlaWdodCwgcm4rKykKKyAgICB7 CisgICAgICBpZiAoYm90X2luZF9ybiA+PSAwICYmIHJuID49IGJvdF9pbmRfcm4pCisgICAgICAg IGJyZWFrOworICAgICAgcm93MSA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgcm47CisgICAg ICBpZiAoIXJvdzEtPmVuYWJsZWRfcCkKKyAgICAgICAgcm93MSA9IHctPmN1cnJlbnRfbWF0cml4 LT5yb3dzICsgcm47CisgICAgICByb3cxLT5pbmRpY2F0ZV9ib2JfcCA9IHJvdy0+aW5kaWNhdGVf Ym9iX3A7CisgICAgICByb3cxLT5pbmRpY2F0ZV90b3BfbGluZV9wID0gcm93LT5pbmRpY2F0ZV90 b3BfbGluZV9wOworICAgIH0KKyAgICAgIH0KKyAgfQorICAgIH0KKyAgaWYgKGJvdF9pbmRfcm4g Pj0gMCkKKyAgICB7CisgICAgICBpbnQgYm4gPSBOT19GUklOR0VfQklUTUFQOworICAgICAgcm93 ID0gdy0+ZGVzaXJlZF9tYXRyaXgtPnJvd3MgKyBib3RfaW5kX3JuOworICAgICAgaWYgKCFyb3ct PmVuYWJsZWRfcCkKKyAgcm93ID0gdy0+Y3VycmVudF9tYXRyaXgtPnJvd3MgKyBib3RfaW5kX3Ju OworICAgICAgYm90X3Jvd19lbmRzX2F0X3p2X3AgPSByb3ctPmVuZHNfYXRfenZfcDsKKyAgICAg IGlmIChyb3ctPmluZGljYXRlX2VvYl9wKQorICB7CisgICAgaWYgKEVRIChib3VuZGFyeV9ib3Qs IFFsZWZ0KSkKKyAgICAgIGJuID0gTEVGVF9GUklOR0UgKDMsIFFib3R0b20sIHJvdy0+ZW5kc19h dF96dl9wKTsKKyAgICBlbHNlCisgICAgICBibiA9IFJJR0hUX0ZSSU5HRSAoMywgUWJvdHRvbSwg cm93LT5lbmRzX2F0X3p2X3ApOworICB9CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2Jv dHRvbV9saW5lX3ApCisgIHsKKyAgICBpZiAoRVEgKGFycm93X2JvdCwgUWxlZnQpKQorICAgICAg Ym4gPSBMRUZUX0ZSSU5HRSAoNywgUWRvd24sIDApOworICAgIGVsc2UKKyAgICAgIGJuID0gUklH SFRfRlJJTkdFICg3LCBRZG93biwgMCk7CisgIH0KKyAgICAgIGlmIChibiAhPSBOT19GUklOR0Vf QklUTUFQKQorICB7CisgICAgc3RydWN0IGZyaW5nZV9iaXRtYXAgKmZiID0gZ2V0X2ZyaW5nZV9i aXRtYXBfZGF0YSAoYm4pOworICAgIGlmIChmYi0+YWxpZ24gPT0gQUxJR05fQklUTUFQX0JPVFRP TSAmJiBmYi0+cGVyaW9kID09IDApCisgICAgICB7CisgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cg KnJvdzE7CisgICAgICAgIGludCBib3RfaW5kX21pbl95OworICAgICAgICBib3RfaW5kX21heF95 ID0gcm93LT55ICsgcm93LT52aXNpYmxlX2hlaWdodDsKKyAgICAgICAgYm90X2luZF9taW5feSA9 IGJvdF9pbmRfbWF4X3kgLSBmYi0+aGVpZ2h0OworICAgICAgICBpZiAoYm90X2luZF9taW5feSA8 IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpKQorICAgIGJvdF9pbmRfbWluX3kgPSBXSU5E T1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgICAgICAgZm9yICh5ID0gcm93LT55LCBybiA9 IGJvdF9pbmRfcm4gLSAxOworICAgICAgIHkgPj0gYm90X2luZF9taW5feSAmJiBybiA+PSAwOwor ICAgICAgIHkgLT0gcm93MS0+aGVpZ2h0LCBybi0tKQorICAgIHsKKyAgICAgIGlmICh0b3BfaW5k X3JuID49IDAgJiYgcm4gPD0gdG9wX2luZF9ybikKKyAgICAgICAgYnJlYWs7CisgICAgICByb3cx ID0gdy0+ZGVzaXJlZF9tYXRyaXgtPnJvd3MgKyBybjsKKyAgICAgIGlmICghcm93MS0+ZW5hYmxl ZF9wKQorICAgICAgICByb3cxID0gdy0+Y3VycmVudF9tYXRyaXgtPnJvd3MgKyBybjsKKyAgICAg IHJvdzEtPmluZGljYXRlX2VvYl9wID0gcm93LT5pbmRpY2F0ZV9lb2JfcDsKKyAgICAgIHJvdzEt PmluZGljYXRlX2JvdHRvbV9saW5lX3AgPSByb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3A7Cisg ICAgfQorICAgICAgfQorICB9CisgICAgfQorICBMaXNwX09iamVjdCBidWYgPSB3LT5jb250ZW50 czsKKyAgQ0hFQ0tfQlVGRkVSIChidWYpOworICBib29sIGF1dG9faHNjcm9sbF9tb2RlX3AgPSBF USAoRmJ1ZmZlcl9sb2NhbF92YWx1ZSAoUWF1dG9faHNjcm9sbF9tb2RlLCBidWYpLCBRY3VycmVu dF9saW5lKTsKKyAgLyogRVhBTVBMRTogIChzY3JvbGwtbGVmdCA1KSAqLworICBib29sIGhzY2xf YWxsX3RlbXBfcCA9ICh3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9o c2Nyb2xsID09IDApOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBub3RoaW5nLiAq LworICBib29sIGhzY2xfYWxsX3Blcm1fMF9wID0gKHctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gdy0+aHNjcm9sbCk7CisgIC8qIEVYQU1QTEU6ICBD LXUgQy14IDwgYW5kIGRvIHNvbWV0aGluZyBlbHNlIGJlc2lkZXMgaG9yaXpvbnRhbGx5IHNjcm9s bGluZyB0aGUKKyAgICAgICAgICAgICAgIGN1cnJlbnQgbGluZSBkaWZmZXJlbnRseS4KKyAgICAg ICAgICAgICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlm ZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8xX3AgPSAoIXctPnN1c3BlbmRfYXV0 b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21v ZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gdy0+aHNjcm9sbCk7CisgIC8q IEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIC4uLgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5l IGlzIF9ub3RfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4gKi8KKyAgYm9vbCBo c2NsX2FsbF9wZXJtXzJfcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA9PSAwCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg dy0+bWluX2hzY3JvbGwgIT0gdy0+aHNjcm9sbCk7CisgIC8qIEVYQU1QTEU6ICAoc2Nyb2xsLWxl ZnQgNSk7IGFuZCwgdGhlbiBwcmVzcyB0aGUgbGVmdCBhcnJvdyBrZXkgb25lIHRpbWUuCisgICAg ICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVy ZW50bHkuKi8KKyAgYm9vbCBoc2NsX3RlbXBfcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3JvbGwK KyAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBhbmQgZG8gc29t ZXRoaW5nIHRoYXQgY2F1c2VzIHRoZSBjdXJyZW50IGxpbmUgdG8gYmUKKyAgICAgICAgICAgICAg IGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4KKyAgICAgICAgICAgICAgIEN1cnJl bnQgbGluZSBfaXNfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4gKi8KKyAgYm9v bCBoc2NsX3Blcm1fcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAg ICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYg dy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA+ IDAKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCAhPSB3LT5oc2Nyb2xs KTsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk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lzdCkpCisgICAgICB7CisgICAgICAgIExpc3BfT2JqZWN0IGZvdXJ0ZWVuX2VsZW1lbnRz ID0gUW5pbDsKKyAgICAgICAgaW50IHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGg7Cisg ICAgICAgIGVudW0gdGV4dF9jdXJzb3Jfa2luZHMgY3Vyc29yX3R5cGU7CisgICAgICAgIGludCBj dXJzb3Jfd2lkdGg7CisgICAgICAgIExpc3BfT2JqZWN0IGZvcmVncm91bmQgPSBRbmlsOworICAg ICAgICBMaXNwX09iamVjdCBiYWNrZ3JvdW5kID0gUW5pbDsKKyAgICAgICAgYm9vbCBhY3RpdmVf cCA9IGZhbHNlOworICAgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSBOT19GTEFW T1I7CisgICAgICAgIGludCBmcmluZ2VfYml0bWFwID0gTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAg ICAgZm91cnRlZW5fZWxlbWVudHMgPSBYQ0FSICh2bGlzdCk7CisgICAgICAgIHggPSBYRklYTlVN IChtY19udGggKDAsIGZvdXJ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICAgIGZ4ID0gWEZJWE5VTSAo bWNfbnRoICgxLCBmb3VydGVlbl9lbGVtZW50cykpOworICAgICAgICB5ID0gWEZJWE5VTSAobWNf bnRoICgyLCBmb3VydGVlbl9lbGVtZW50cykpOworICAgICAgICBmeSA9IFhGSVhOVU0gKG1jX250 aCAoMywgZm91cnRlZW5fZWxlbWVudHMpKTsKKyAgICAgICAgaHBvcyA9IFhGSVhOVU0gKG1jX250 aCAoNCwgZm91cnRlZW5fZWxlbWVudHMpKTsKKyAgICAgICAgdnBvcyA9IFhGSVhOVU0gKG1jX250 aCAoNSwgZm91cnRlZW5fZWxlbWVudHMpKTsKKyAgICAgICAgd2QgPSBYRklYTlVNIChtY19udGgg KDYsIGZvdXJ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICAgIGggPSBYRklYTlVNIChtY19udGggKDcs IGZvdXJ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICAgIGN1cnNvcl90eXBlID0gbWNfbGlzcF90b19j dXJzb3JfdHlwZSAobWNfbnRoICg4LCBmb3VydGVlbl9lbGVtZW50cykpOworICAgICAgICBjdXJz b3Jfd2lkdGggPSBYRklYTlVNIChtY19udGggKDksIGZvdXJ0ZWVuX2VsZW1lbnRzKSk7CisgICAg ICAgIGZvcmVncm91bmQgPSBtY19udGggKDEwLCBmb3VydGVlbl9lbGVtZW50cyk7CisgICAgICAg IGJhY2tncm91bmQgPSBtY19udGggKDExLCBmb3VydGVlbl9lbGVtZW50cyk7CisgICAgICAgIGFj dGl2ZV9wID0gWEZJWE5VTSAobWNfbnRoICgxMiwgZm91cnRlZW5fZWxlbWVudHMpKTsKKyAgICAg ICAgZ2x5cGhfZmxhdm9yID0gWEZJWE5VTSAobWNfbnRoICgxMywgZm91cnRlZW5fZWxlbWVudHMp KTsKKyAgICAgICAgaWYgKCh2cG9zID09IHZwb3NfZGVzaXJlZCB8fCB2cG9zID09IHZwb3NfY3Vy cmVudCkKKyAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciA9PSBNQ19PVkVSTEFZX0FSUk9XX0JJ VE1BUAorICAgICAgICAgICAgJiYgIWhzY2xfYWxsX3RlbXBfcAorICAgICAgICAgICAgJiYgIWhz Y2xfdGVtcF9wCisgICAgICAgICAgICAmJiAhaHNjbF9wZXJtX3AKKyAgICAgICAgICAgICYmICFo c2NsX2FsbF9wZXJtXzBfcAorICAgICAgICAgICAgJiYgIWhzY2xfYWxsX3Blcm1fMV9wCisgICAg ICAgICAgICAmJiAhaHNjbF9hbGxfcGVybV8yX3ApCisgICAgICAgICAgeworICAgICAgICAgICAg ZW51bSBmYWNlX2lkIG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICAgICAgICghYWN0 aXZlX3AKKyAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRf ZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWluYWN0aXZlLWZhY2UiKSwgdHJ1 ZSkKKyAgICAgICAgICAgICAgOiAoYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgPyBsb29rdXBf bmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWZhY2UiKSwgdHJ1ZSkK KyAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgICBtY19sZWZ0X2Zy aW5nZV9mYWNlX2lkID0gKGN1cnNvcl90eXBlID09IExFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBvdmVybGF5X2Fycm93X2ZhY2VfaWQK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7 CisgICAgICAgICAgICBpZiAody0+aHNjcm9sbCAhPSAwKQorICAgICAgICAgICAgICBmcmluZ2Vf Yml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistb3ZlcmxheS1hcnJv dyIpLCBmYWxzZSwgdHJ1ZSk7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBm cmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistb3Zlcmxh eS1hcnJvdyIpLCB0cnVlLCB0cnVlKTsKKyAgICAgICAgICAgIG1jX2xlZnRfZnJpbmdlX2JpdG1h cCA9IChjdXJzb3JfdHlwZSA9PSBMRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBmcmluZ2VfYml0bWFwCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiBOT19GUklOR0VfQklUTUFQOworICAgICAgICAgIH0KKyAgICAg ICAgICBlbHNlIGlmICgodnBvcyA9PSB2cG9zX2Rlc2lyZWQgfHwgdnBvcyA9PSB2cG9zX2N1cnJl bnQpCisgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yID09IE1DX09WRVJMQVlfQVJS T1dfQklUTUFQCisgICAgICAgICAgICAgICAgICAgJiYgKGhzY2xfYWxsX3RlbXBfcAorICAgICAg ICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzBfcAorICAgICAgICAgICAgICAgICAg ICAgICB8fCBoc2NsX2FsbF9wZXJtXzFfcAorICAgICAgICAgICAgICAgICAgICAgICB8fCBoc2Ns X2FsbF9wZXJtXzJfcAorICAgICAgICAgICAgICAgICAgICAgICB8fCBoc2NsX3RlbXBfcAorICAg ICAgICAgICAgICAgICAgICAgICB8fCBoc2NsX3Blcm1fcCkpCisgICAgICAgICAgICB7CisgICAg ICAgICAgICAgIGVudW0gZmFjZV9pZCBvdmVybGF5X2Fycm93X2ZhY2VfaWQgPQorICAgICAgICAg ICAgICAgICghYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZG RVIgKHctPmNvbnRlbnRzKSwgY2hfaW5hY3RpdmVfd2luZG93cykpKQorICAgICAgICAgICAgICAg ID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1oc2Ns LWluYWN0aXZlLWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChhY3RpdmVfcCkKKyAg ICAgICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb3Zl cmxheS1hcnJvdy1oc2NsLWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IERFRkFVTFRf RkFDRV9JRDsKKyAgICAgICAgICAgICAgbWNfbGVmdF9mcmluZ2VfZmFjZV9pZCA9IChjdXJzb3Jf dHlwZSA9PSBMRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBvdmVybGF5X2Fycm93X2ZhY2VfaWQKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICAgICAgaWYg KGhzY2xfYWxsX3Blcm1fMF9wKQorICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19n ZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgZmFsc2UsIGZhbHNl KTsKKyAgICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX2FsbF9wZXJtXzFfcCkKKyAgICAgICAg ICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJu ICgiKy1oc2NsLXBlcm0iKSwgdHJ1ZSwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgZWxzZSBp ZiAoaHNjbF9hbGxfcGVybV8yX3ApCisgICAgICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAg PSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgZmFsc2Us IHRydWUpOworICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX3Blcm1fcCkKKyAgICAg ICAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcs IGludGVybiAoIistaHNjbC1wZXJtIiksIHRydWUsIHRydWUpOworICAgICAgICAgICAgICAgICAg ICAgIGVsc2UgaWYgKGhzY2xfYWxsX3RlbXBfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgIGZy aW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXRl bXAiKSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGhz Y2xfdGVtcF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNf Z2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC10ZW1wIiksIHRydWUsIGZhbHNl KTsKKyAgICAgICAgICAgICAgbWNfbGVmdF9mcmluZ2VfYml0bWFwID0gKGN1cnNvcl90eXBlID09 IExFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBOT19GUklOR0VfQklUTUFQOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBp ZiAoKHZwb3MgPT0gdnBvc19kZXNpcmVkIHx8IHZwb3MgPT0gdnBvc19jdXJyZW50KQorICAgICAg ICAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRV9S SUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICB8fGdseXBoX2ZsYXZvciA9PSBN Q19IT0xMT1dfUkVDVEFOR0xFCisgICAgICAgICAgICAgICAgICAgICAgICAgIHx8Z2x5cGhfZmxh dm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAg ICAgICB8fGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgfHxnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSCkpCisg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBMaXNwX09iamVjdCBiaXRtYXBfZmxhdm9y ID0gKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVj dGFuZ2xlX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hvbGxvd19yZWN0YW5n bGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhf Zmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVykKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXJfcmlnaHRfYXJy b3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhf Zmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXIKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JB Ul9CQUNLU0xBU0gpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBRbWNfdmVydGljYWxfYmFyX2JhY2tzbGFzaAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IFFuaWw7CisgICAgICAgICAgICAgICAgbWNfcmlnaHRfZnJp bmdlX2JpdG1hcCA9IChjdXJzb3JfdHlwZSA9PSBSSUdIVF9GUklOR0VfQklUTUFQKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBsb29rdXBfZnJpbmdlX2JpdG1h cCAoYml0bWFwX2ZsYXZvcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICAgICAgICBtY19yaWdodF9mcmluZ2Vf ZmFjZV9pZCA9IChjdXJzb3JfdHlwZSA9PSBSSUdIVF9GUklOR0VfQklUTUFQKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcs IGYsIGludGVybiAoIistdmVydGljYWwtYmFyLWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAg ICAgICAgfQorICAgICAgICAgIH0KKyAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgIHJvdyA9 IGN1cjsKKyAgICAgIGxlZnRfZmFjZV9pZCA9IHJpZ2h0X2ZhY2VfaWQgPSBERUZBVUxUX0ZBQ0Vf SUQ7CisgICAgICBsZWZ0X29mZnNldCA9IHJpZ2h0X29mZnNldCA9IDA7CisgICAgICBwZXJpb2Rp Y19wID0gMDsKKyAgICAgIC8qIERlY2lkZSB3aGljaCBiaXRtYXAgdG8gZHJhdyBpbiB0aGUgbGVm dCBmcmluZ2UuICAqLworICAgICAgaWYgKFdJTkRPV19MRUZUX0ZSSU5HRV9XSURUSCAodykgPT0g MCkKKyAgbGVmdCA9IE5PX0ZSSU5HRV9CSVRNQVA7CisgICAgICBlbHNlIGlmIChyb3ctPmxlZnRf dXNlcl9mcmluZ2VfYml0bWFwICE9IE5PX0ZSSU5HRV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2h0KTsKKyAgfQorICAg ICAgZWxzZSBpZiAoKCFyb3ctPnJldmVyc2VkX3AgJiYgTUFUUklYX1JPV19DT05USU5VQVRJT05f TElORV9QIChyb3cpKQorICAgICAgICAgfHwgKHJvdy0+cmV2ZXJzZWRfcCAmJiByb3ctPmNvbnRp bnVlZF9wKSkKKyAgbGVmdCA9IExFRlRfRlJJTkdFICg0LCBRY29udGludWF0aW9uLCAwKTsKKyAg ICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfZW1wdHlfbGluZV9wICYmIEVRIChlbXB0eV9wb3Ms IFFsZWZ0KSkKKyAgbGVmdCA9IExFRlRfRlJJTkdFICg1LCBRZW1wdHlfbGluZSwgMCk7CisgICAg ICBlbHNlIGlmIChyb3ctPmluZGljYXRlX3RvcF9saW5lX3AgJiYgRVEgKGFycm93X3RvcCwgUWxl ZnQpKQorICB7CisgICAgbGVmdCA9IExFRlRfRlJJTkdFICg2LCBRdXAsIDApOworICAgIGlmICh0 b3BfaW5kX21pbl95ID49IDApCisgICAgICBsZWZ0X29mZnNldCA9IHRvcF9pbmRfbWluX3kgLSBy b3ctPnk7CisgIH0KKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCAm JiBFUSAoYXJyb3dfYm90LCBRbGVmdCkpCisgIHsKKyAgICBsZWZ0ID0gTEVGVF9GUklOR0UgKDcs IFFkb3duLCAwKTsKKyAgICBpZiAoYm90X2luZF9tYXhfeSA+PSAwKQorICAgICAgbGVmdF9vZmZz ZXQgPSBib3RfaW5kX21heF95IC0gKHJvdy0+eSArIHJvdy0+dmlzaWJsZV9oZWlnaHQpOworICB9 CisgICAgICBlbHNlCisgIGxlZnQgPSBOT19GUklOR0VfQklUTUFQOworICAgICAgLyogRGVjaWRl IHdoaWNoIGJpdG1hcCB0byBkcmF3IGluIHRoZSByaWdodCBmcmluZ2UuICAqLworICAgICAgaWYg KFdJTkRPV19SSUdIVF9GUklOR0VfV0lEVE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fZW5kc19hdF96dl9w KTsKKyAgICBpZiAoYm90X2luZF9tYXhfeSA+PSAwKQorICAgICAgcmlnaHRfb2Zmc2V0ID0gYm90 X2luZF9tYXhfeSAtIChyb3ctPnkgKyByb3ctPnZpc2libGVfaGVpZ2h0KTsKKyAgfQorICAgICAg ZWxzZSBpZiAoKCFyb3ctPnJldmVyc2VkX3AgJiYgcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAg IHx8IChyb3ctPnJldmVyc2VkX3AgJiYgTUFUUklYX1JPV19DT05USU5VQVRJT05fTElORV9QIChy b3cpKSkKKyAgcmlnaHQgPSBSSUdIVF9GUklOR0UgKDQsIFFjb250aW51YXRpb24sIDApOworICAg ICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV90b3BfbGluZV9wICYmIEVRIChhcnJvd190b3AsIFFy aWdodCkpCisgIHsKKyAgICByaWdodCA9IFJJR0hUX0ZSSU5HRSAoNiwgUXVwLCAwKTsKKyAgICBp ZiAodG9wX2luZF9taW5feSA+PSAwKQorICAgICAgcmlnaHRfb2Zmc2V0ID0gdG9wX2luZF9taW5f eSAtIHJvdy0+eTsKKyAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9ib3R0b21fbGlu ZV9wICYmIEVRIChhcnJvd19ib3QsIFFyaWdodCkpCisgIHsKKyAgICByaWdodCA9IFJJR0hUX0ZS SU5HRSAoNywgUWRvd24sIDApOworICAgIGlmIChib3RfaW5kX21heF95ID49IDApCisgICAgICBy aWdodF9vZmZzZXQgPSBib3RfaW5kX21heF95IC0gKHJvdy0+eSArIHJvdy0+dmlzaWJsZV9oZWln aHQpOworICB9CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2VtcHR5X2xpbmVfcCAmJiBF USAoZW1wdHlfcG9zLCBRcmlnaHQpKQorICByaWdodCA9IFJJR0hUX0ZSSU5HRSAoNSwgUWVtcHR5 X2xpbmUsIDApOworICAgICAgZWxzZQorICByaWdodCA9IE5PX0ZSSU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tYXA7CisgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2VfYml0bWFwID0gcmlnaHQ7CisgICAgICAgIGlmICht Y19yaWdodF9mcmluZ2VfYml0bWFwICE9IE5PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgY3Vy LT5yaWdodF9mcmluZ2VfZmFjZV9pZCA9IG1jX3JpZ2h0X2ZyaW5nZV9mYWNlX2lkOworICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX2ZhY2VfaWQgPSByaWdodF9m YWNlX2lkOworICAgICAgICBpZiAobWNfcmlnaHRfZnJpbmdlX2JpdG1hcCAhPSBOT19GUklOR0Vf QklUTUFQKQorICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX29mZnNldCA9IDA7CisgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2Vfb2Zmc2V0ID0gcmlnaHRfb2Zm c2V0OworICAgICAgfQorICB9CisgICAgICBpZiAocm93LT5vdmVybGF5X2Fycm93X2JpdG1hcCA8 IDApCisgIHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAgPSBnZXRfbG9naWNhbF9mcmluZ2VfYml0 bWFwICh3LCBRb3ZlcmxheV9hcnJvdywgMCwgMCk7CisgICAgICBpZiAocm93LT5vdmVybGF5X2Fy cm93X2JpdG1hcCAhPSBjdXItPm92ZXJsYXlfYXJyb3dfYml0bWFwKQorICB7CisgICAgcmVkcmF3 X3AgPSAxLCByb3ctPnJlZHJhd19mcmluZ2VfYml0bWFwc19wID0gMTsKKyAgICBpZiAoIWtlZXBf Y3VycmVudF9wKQorICAgICAgeworICAgICAgICBjdXItPnJlZHJhd19mcmluZ2VfYml0bWFwc19w ID0gMTsKKyAgICAgICAgY3VyLT5vdmVybGF5X2Fycm93X2JpdG1hcCA9IHJvdy0+b3ZlcmxheV9h cnJvd19iaXRtYXA7CisgICAgICB9Cisg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PnJpZ2h0X2ZyaW5nZV9iaXRtYXAgPSBtY19y aWdodF9mcmluZ2VfYml0bWFwOworICAgICAgICBlbHNlCisgICAgICAgICAgcm93LT5yaWdodF9m cmluZ2VfYml0bWFwID0gcmlnaHQ7CisgICAgICBpZiAobWNfcmlnaHRfZnJpbmdlX2JpdG1hcCAh PSBOT19GUklOR0VfQklUTUFQKQorICAgICAgICByb3ctPnJpZ2h0X2ZyaW5nZV9mYWNlX2lkID0g bWNfcmlnaHRfZnJpbmdlX2ZhY2VfaWQ7CisgICAgICAgIGVsc2UKKyAgICAgICAgICByb3ctPnJp Z2h0X2ZyaW5nZV9mYWNlX2lkID0gcmlnaHRfZmFjZV9pZDsKKyAgICAgIGlmIChtY19yaWdodF9m cmluZ2VfYml0bWFwICE9IE5PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgIHJvdy0+cmlnaHRfZnJp bmdlX29mZnNldCA9IDA7CisgICAgICAgIGVsc2UKKyAgICAgICAgICByb3ctPnJpZ2h0X2ZyaW5n ZV9vZmZzZXQgPSByaWdodF9vZmZzZXQ7CisgICAgfQorICByZXR1cm4gcmVkcmF3X3AgJiYgIWtl ZXBfY3VycmVudF9wOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogI2RlZmluZSBOT19GUklOR0VfQklUTUFQIDAKICNkZWZpbmUg VU5ERUZfRlJJTkdFX0JJVE1BUCAxCiAjZGVmaW5lIE1BWF9TVEFOREFSRF9GUklOR0VfQklUTUFQ UyBBUlJBWUVMVFMgKHN0YW5kYXJkX2JpdG1hcHMpCkBAIC04MjcsNiArMTg0MiwyMSBAQCBkcmF3 X2ZyaW5nZV9iaXRtYXAgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywg aW50IGxlZnRfcCkKIAogICAgICAgc3dpdGNoICh3LT5waHlzX2N1cnNvcl90eXBlKQogCXsKKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworCWNh c2UgRlJBTUVEX0JPWF9DVVJTT1I6CisJICBpZiAocm93LT52aXNpYmxlX2hlaWdodCA+PSBTVEFO REFSRF9CSVRNQVBfSEVJR0hUIChob2xsb3dfcmVjdGFuZ2xlX2JpdHMpKQorCSAgICBjdXJzb3Ig PSBRaG9sbG93OworCSAgZWxzZQorCSAgICBjdXJzb3IgPSBRaG9sbG93X3NtYWxsOworCSAgYnJl YWs7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAljYXNlIEhPTExPV19CT1hfQ1VS U09SOgogCSAgaWYgKHJvdy0+dmlzaWJsZV9oZWlnaHQgPj0gU1RBTkRBUkRfQklUTUFQX0hFSUdI VCAoaG9sbG93X3JlY3RhbmdsZV9iaXRzKSkKIAkgICAgY3Vyc29yID0gUWhvbGxvdzsKQEAgLTE3 MjQsNiArMjc1NCwxNTAgQEAgSWYgbmlsLCBhbHNvIGNvbnRpbnVlIGxpbmVzIHdoaWNoIGFyZSBl eGFjdGx5IGFzIHdpZGUgYXMgdGhlIHdpbmRvdy4gICovKTsKICAgREVGVkFSX0xJU1AgKCJmcmlu Z2UtYml0bWFwcyIsIFZmcmluZ2VfYml0bWFwcywKICAgICBkb2M6IC8qIExpc3Qgb2YgZnJpbmdl IGJpdG1hcCBzeW1ib2xzLiAgKi8pOwogICBWZnJpbmdlX2JpdG1hcHMgPSBRbmlsOworCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworLyog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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKworCiB9CiAKIC8qIEdhcmJhZ2UgY29sbGVjdGlvbiBob29rICovCmRpZmYgLS1n aXQgYS9zcmMvbnN0ZXJtLmggYi9zcmMvbnN0ZXJtLmgKaW5kZXggNzhjZTYwOC4uOGVmMGRmZSAx MDA2NDQKLS0tIGEvc3JjL25zdGVybS5oCisrKyBiL3NyYy9uc3Rlcm0uaApAQCAtNjYwLDYgKzY2 MCwxNiBAQCB0eXBlZGVmIGlkIGluc3RhbmNldHlwZTsKIAogQGludGVyZmFjZSBFbWFjc1Njcm9s bGVyIDogTlNTY3JvbGxlcgogICB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBN VUxUSVBMRS1DVVJTT1JTICovCisKKyAgICBOU1JlY3QgbWNfcmVjdGFuZ2xlOworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKworCiAgICBzdHJ1Y3Qgd2luZG93ICp3aW5kb3c7CiAgICBzdHJ1 Y3QgZnJhbWUgKmZyYW1lOwogICAgTlNSZXNwb25kZXIgKnByZXZSZXNwb25kZXI7CkBAIC02ODAs NiArNjkwLDE4IEBAIHR5cGVkZWYgaWQgaW5zdGFuY2V0eXBlOwogICAgaW50IGVtX3dob2xlOwog ICAgfQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAq LworCistICh2b2lkKW1jX3NldF9yZWN0YW5nbGU6IChOU1JlY3QpcmVjdDsKKy0gKE5TUmVjdClt Y19nZXRfcmVjdGFuZ2xlOworLSAoc3RydWN0IHdpbmRvdyAqKW1jX2dldF93aW5kb3c7CistIChi b29sKW1jX2p1ZGdlOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAtIChpbnN0YW5j ZXR5cGUpIGluaXRGcmFtZTogKE5TUmVjdCApciB3aW5kb3c6IChMaXNwX09iamVjdCl3aW47CiAt ICh2b2lkKXNldEZyYW1lOiAoTlNSZWN0KXI7CiAKZGlmZiAtLWdpdCBhL3NyYy9uc3Rlcm0ubSBi L3NyYy9uc3Rlcm0ubQppbmRleCA4MWQzNmJlLi41YmJiZjllIDEwMDY0NAotLS0gYS9zcmMvbnN0 ZXJtLm0KKysrIGIvc3JjL25zdGVybS5tCkBAIC03Niw2ICs3NiwxMDQ4IEBAIFVwZGF0ZWQgYnkg Q2hyaXN0aWFuIExpbXBhY2ggKGNocmlzQG5pY2UuY2gpCiBzdGF0aWMgRW1hY3NNZW51ICptYWlu TWVudTsKICNlbmRpZgogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4gTVVM VElQTEUtQ1VSU09SUyAqLworCitzdGF0aWMgdm9pZCBuc19yZXNldF9jbGlwcGluZyAoc3RydWN0 IGZyYW1lICopOworCitzdGF0aWMgdm9pZCBuc19kdW1wZ2x5cGhzX2JveF9vcl9yZWxpZWYgKHN0 cnVjdCBnbHlwaF9zdHJpbmcgKik7CisKK3N0YXRpYyB2b2lkIG5zX2RyYXdfY29tcG9zaXRlX2ds eXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICopOworCitzdGF0aWMg aW50IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICos IE5hdGl2ZVJlY3RhbmdsZSAqKTsK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U0dyYXBoaWNzQ29udGV4dCBjdXJyZW50Q29udGV4dF0g c2F2ZUdyYXBoaWNzU3RhdGVdOworICAgICAgICAgIGlmIChuID09IDIpCisgICAgICAgICAgICBO U1JlY3RDbGlwTGlzdCAociwgMik7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICBpZiAocm93LT5jbGlwICE9IE5VTEwpCisgICAgICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgICAgIE5TUmVjdCByX2NsaXA7CisgICAgICAgICAgICAgICAg ICAgIHJfY2xpcC5vcmlnaW4ueCA9IHJvdy0+Y2xpcC0+eDsKKyAgICAgICAgICAgICAgICAgICAg cl9jbGlwLm9yaWdpbi55ID0gcm93LT5jbGlwLT55OworICAgICAgICAgICAgICAgICAgICByX2Ns aXAuc2l6ZS53aWR0aCA9IHJvdy0+Y2xpcC0+d2lkdGg7CisgICAgICAgICAgICAgICAgICAgIHJf Y2xpcC5zaXplLmhlaWdodCA9IHJvdy0+Y2xpcC0+aGVpZ2h0OworICAgICAgICAgICAgICAgICAg ICBOU1JlY3Qgcl9zYXZlOworICAgICAgICAgICAgICAgICAgICByX3NhdmUub3JpZ2luLnggPSBy WzBdLm9yaWdpbi54OworICAgICAgICAgICAgICAgICAgICByX3NhdmUub3JpZ2luLnkgPSByWzBd Lm9yaWdpbi55OworICAgICAgICAgICAgICAgICAgICByX3NhdmUuc2l6ZS53aWR0aCA9IHJbMF0u c2l6ZS53aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgcl9zYXZlLnNpemUuaGVpZ2h0ID0gclsw XS5zaXplLmhlaWdodDsKKyAgICAgICAgICAgICAgICAgICAgbWNfbnNfaW50ZXJzZWN0X3JlY3Rh bmdsZXMgKCZyX3NhdmUsICZyX2NsaXAsICZyWzBdKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgICBOU1JlY3RDbGlwICgqcik7CisgICAgICAgICAgICAgIH0KKyAgICAgICAg ICByZXR1cm4gWUVTOworICAgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAg ICBOU1ZpZXcgKnZpZXcgPSBGUkFNRV9OU19WSUVXIChmKTsKKyAgICAgICAgICBpbnQgaTsKKyAg ICAgICAgICBmb3IgKGkgPSAwIDsgaSA8IG4gOyBpKyspCisgICAgICAgICAgICBbdmlldyBzZXRO ZWVkc0Rpc3BsYXlJblJlY3Q6cltpXV07CisgICAgICAgIH0KKyAgICB9CisgIHJldHVybiBOTzsK K30KKworc3RhdGljIHZvaWQKK21jX25zX2RyYXdfd2luZG93X2N1cnNvciAoc3RydWN0IHdpbmRv dyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cs CisgICAgICAgICAgICAgICAgICBpbnQgeCwgaW50IGZ4LCBpbnQgeSwgaW50IGZ5LCBpbnQgaHBv cywgaW50IHZwb3MsIGludCB3ZCwgaW50IGgsCisgICAgICAgICAgICAgICAgICBkb3VibGUgcmVk LCBkb3VibGUgZ3JlZW4sIGRvdWJsZSBibHVlLCBlbnVtIHRleHRfY3Vyc29yX2tpbmRzIGN1cnNv cl90eXBlLAorICAgICAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aCwgZW51bSBtY19mbGF2 b3IgZ2x5cGhfZmxhdm9yLCBib29sIG9uX3AsIGJvb2wgYWN0aXZlX3ApCit7CisgIC8qIFRoZSBw cmlvciBidWcgb2YgYSBkb3VibGUgaW1wcmludCBvbiB0aGUgZ2x5cGggd2hlcmUgYW4gSEJBUl9D VVJTT1IgYW5kCisgIEJBUl9DVVJTT1IgaXMgcGxhY2VkIGlzIHF1aXRlIGhlbHBmdWwgdG8gdmlz dWFsaXplIGVycm9ycyB3aGVuIGRlYnVnZ2luZy4gKi8KKyAgYm9vbCBkZWJ1Z19wID0gZmFsc2U7 CisvKgorICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAgZ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ICAgICBncmVlbjogMS4wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgYmx1ZTogMS4wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBhbHBoYTogMS4wXTsKKyAgLSAgQUxURVJOQVRJVkUgRVhB TVBMRToKKyAgICAgZW51bSBmYWNlX2lkIGRlYnVnZ2luZ19mYWNlX2lkID0gbG9va3VwX25hbWVk X2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAoIistZGVidWdnaW5nLWZhY2UiKSwgdHJ1ZSk7Cisg ICAgIHN0cnVjdCBmYWNlICpkZWJ1Z2dpbmdfZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgZGVi dWdnaW5nX2ZhY2VfaWQpOworICAgICBOU0NvbG9yICpjb2xvciA9IG5zX2xvb2t1cF9pbmRleGVk X2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQgKGRlYnVnZ2luZ19mYWNlKSwgcy0+Zik7CisgICAg IFtjb2xvciBzZXRdOyAqLworICBpZiAoZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBICisgICAgICB8 fCBnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEhMRVNTKQorICAgIFtbTlNDb2xvciBjb2xvcldpdGhD YWxpYnJhdGVkUmVkOiByZWQgZ3JlZW46IGdyZWVuIGJsdWU6IGJsdWUgYWxwaGE6IDEuMF0gc2V0 XTsKKyAgICBlbHNlCisgICAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChmKSBzZXRdOworICBpZiAo Y3Vyc29yX3R5cGUgPT0gRlJBTUVEX0JPWF9DVVJTT1IpCisgICAgeworICAgICAgTGlzcF9PYmpl Y3QgYnVmID0gdy0+Y29udGVudHM7CisgICAgICBDSEVDS19CVUZGRVIgKGJ1Zik7CisgICAgICBz dHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAoYnVmKTsKKyAgICAgIGJvb2wgcmVnaW9uX2FjdGl2 ZV9wID0gKCFOSUxQIChWdHJhbnNpZW50X21hcmtfbW9kZSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBtYXJrX2FjdGl2ZSkpKTsKKyAgICAgIHB0cmRp ZmZfdCByZWdpb25fYmVnaW5uaW5nID0gKHJlZ2lvbl9hY3RpdmVfcCkgPyBYRklYTlVNIChGcmVn aW9uX2JlZ2lubmluZyAoKSkgOiAtMTsKKyAgICAgIHB0cmRpZmZfdCByZWdpb25fZW5kID0gKHJl Z2lvbl9hY3RpdmVfcCkgPyBYRklYTlVNIChGcmVnaW9uX2VuZCAoKSkgOiAtMTsKKyAgICAgIHB0 cmRpZmZfdCBvcG9pbnRfcHQgPSAodyA9PSBYV0lORE9XIChzZWxlY3RlZF93aW5kb3cpKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gUFQKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IFhGSVhOVU0gKEZtYXJrZXJfcG9zaXRpb24gKHctPnBvaW50bSkpOworICAgICAgYm9vbCBy ZWdpb25faW5fYm91bmRzX3AgPSAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBvcG9pbnRfcHQgPj0gcmVnaW9uX2JlZ2lubmluZworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3B0IDwgcmVnaW9uX2VuZCk7CisgICAg ICBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgJiYgcmVnaW9uX2luX2JvdW5kc19wCisg ICAgICAgICAgJiYgYWN0aXZlX3ApCisgICAgICAgIHsKKyAgICAgICAgICBlbnVtIGZhY2VfaWQg aG9sbG93X2FjdGl2ZV9yZWdpb25fZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBp bnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItcmVna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gICBo b2xsb3dfY29sb3IgPSBob2xsb3dfYWN0aXZlX3JlZ2lvbl9vdXRfY29sb3I7CisgICAgICAgICAg fQorICAgICAgICAgIGVsc2UgaWYgKCFyZWdpb25fYWN0aXZlX3AgJiYgYWN0aXZlX3ApCisgICAg ICAgICAgICB7CisgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2Vf aWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29y LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZl X2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAg ICAgICAgIE5TQ29sb3IgKmhvbGxvd19hY3RpdmVfY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9j b2xvciAoTlNfRkFDRV9CQUNLR1JPVU5EIChob2xsb3dfYWN0aXZlX2ZhY2UpLCBmKTsKKyAgICAg ICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2FjdGl2ZV9jb2xvcjsKKyAgICAgICAgICAg IH0KKyAgICAgICAgICAgIC8qIFRoZSByZWdpb24gaXMgX25vdF8gdmlzaWJsZSBpbiB0aGUgaW5h Y3RpdmUgd2luZG93IGJlY2F1c2UgdGhlIG92ZXJsYXkgd2luZG93IHByb3BlcnR5IGlzIHVzZWQu ICovCisgICAgICAgICAgICBlbHNlIGlmICghYWN0aXZlX3ApCisgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29r dXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZl LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICA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X0JPWF9DVVJTT1I6CisgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICBi cmVhazsKKyAgICAgIGNhc2UgRlJBTUVEX0JPWF9DVVJTT1I6CisgICAgICAgIE5TUmVjdEZpbGwg KHIpOworICAgICAgICBbaG9sbG93X2NvbG9yIHNldF07CisgICAgICAgIE5TUmVjdEZpbGwgKE5T SW5zZXRSZWN0IChyLCAxLCAxKSk7CisgICAgICAgIFtGUkFNRV9DVVJTT1JfQ09MT1IgKGYpIHNl dF07CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBIT0xMT1dfQk9YX0NVUlNPUjoKKyAgICAg ICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgIFtob2xsb3dfY29sb3Igc2V0XTsKKyAgICAgICAg TlNSZWN0RmlsbCAoTlNJbnNldFJlY3QgKHIsIDEsIDEpKTsKKyAgICAgICAgW0ZSQU1FX0NVUlNP Ul9DT0xPUiAoZikgc2V0XTsKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIEhCQVJfQ1VSU09S OgorICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIEJB Ul9DVVJTT1I6CisgICAgICAgIHMgPSByOworICAgICAgICAvKiBAbGF3bGlzdCBpcyBmb2N1c2lu ZyB0aGUgaW5pdGlhbCBkZXZlbG9wbWVudCBvZiBmZWF0dXJlIHJlcXVlc3RzCisgICAgICAgICMx NzY4NCBhbmQgIzIyODczIG9uIEwyUiBsYW5ndWFnZXMuICovCisgICAgICAgIGlmIChnbHlwaF9m bGF2b3IgIT0gTUNfR0xZUEgKKyAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19HTFlQ SExFU1MpCisgICAgICAgICAgeworICAgICAgICAgICAgLyogSWYgdGhlIGNoYXJhY3RlciB1bmRl ciBjdXJzb3IgaXMgUjJMLCBkcmF3IHRoZSBiYXIgY3Vyc29yCisgICAgICAgICAgICAgICBvbiB0 aGUgcmlnaHQgb2YgaXRzIGdseXBoLCByYXRoZXIgdGhhbiBvbiB0aGUgbGVmdC4gICovCisgICAg ICAgICAgICBpZiAoKGN1cnNvcl9nbHlwaC0+cmVzb2x2ZWRfbGV2ZWwgJiAxKSAhPSAwKQorICAg ICAgICAgICAgICBzLm9yaWdpbi54ICs9IGN1cnNvcl9nbHlwaC0+cGl4ZWxfd2lkdGggLSBzLnNp emUud2lkdGg7CisgICAgICAgICAgfQorICAgICAgICBOU1JlY3RGaWxsIChzKTsKKyAgICAgICAg YnJlYWs7CisgICAgfQorICBuc19yZXNldF9jbGlwcGluZyAoZik7CisgIC8qIGRyYXcgdGhlIGNo YXJhY3RlciB1bmRlciB0aGUgY3Vyc29yICovCisgIGlmIChnbHlwaF9mbGF2b3IgIT0gTUNfR0xZ UEhMRVNTCisgICAgICAmJiAoY3Vyc29yX3R5cGUgPT0gRlJBTUVEX0JPWF9DVVJTT1IKKyAgICAg ICAgICB8fCBjdXJzb3JfdHlwZSA9PSBGSUxMRURfQk9YX0NVUlNPUgorICAgICAgICAgIHx8IGN1 cnNvcl90eXBlID09IEhPTExPV19CT1hfQ1VSU09SCisgICAgICAgICAgfHwgKGRlYnVnX3AKKyAg ICAgICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gSEJBUl9DVVJTT1IpCisgICAgICAgICAgfHwg KGRlYnVnX3AKKyAgICAgICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gQkFSX0NVUlNPUikpKQor ICAgIHsKKyAgICAgIC8qIGBjdXJzb3JfZ2NfcGAgaXMgdXNlZCBvbmx5IGJ5IGB3MzJ0ZXJtLmNg IGFuZCBgeHRlcm0uYycuICovCisgICAgICBib29sIGN1cnNvcl9nY19wID0gZmFsc2U7CisgICAg ICBtY19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4LCBo cG9zLCB2cG9zLCByZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgIC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bbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKGZhY2UtPnVuZGVybGluZV9jb2xv ciwgcy0+Zikgc2V0XTsKKyAgICAgICAgICBuc19kcmF3X3VuZGVyd2F2ZSAocywgd2lkdGgsIHgp OworICAgICAgICB9CisgICAgICBlbHNlIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBG QUNFX1VOREVSX0xJTkUpCisgICAgICAgIHsKKyAgICAgICAgICBOU1JlY3QgcjsKKyAgICAgICAg ICB1bnNpZ25lZCBsb25nIHRoaWNrbmVzcywgcG9zaXRpb247CisgICAgICAgICAgLyogSWYgdGhl IHByZXYgd2FzIHVuZGVybGluZWQsIG1hdGNoIGl0cyBhcHBlYXJhbmNlLiAqLworICAgICAgICAg IGlmIChzLT5wcmV2ICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV9wCisgICAgICAgICAgICAg ICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORQorICAg ICAgICAgICAgICAmJiBzLT5wcmV2LT51bmRlcmxpbmVfdGhpY2tuZXNzID4gMCkKKyAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+cHJldi0+dW5kZXJsaW5lX3RoaWNr bmVzczsKKyAgICAgICAgICAgICAgcG9zaXRpb24gPSBzLT5wcmV2LT51bmRlcmxpbmVfcG9zaXRp b247CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBzdHJ1Y3QgZm9udCAqZm9udDsKKyAgICAgICAgICAgICAgdW5zaWduZWQgbG9uZyBk ZXNjZW50OworICAgICAgICAgICAgICBmb250PXMtPmZvbnQ7CisgICAgICAgICAgICAgIGRlc2Nl bnQgPSBzLT55ICsgcy0+aGVpZ2h0IC0gcy0+eWJhc2U7CisgICAgICAgICAgICAgIC8qIFVzZSB1 bmRlcmxpbmUgdGhpY2tuZXNzIG9mIGZvbnQsIGRlZmF1bHRpbmcgdG8gMS4gKi8KKyAgICAgICAg ICAgICAgdGhpY2tuZXNzID0gKGZvbnQgJiYgZm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzcyA+IDAp CisgICAgICAgICAgICAgICAgPyBmb250LT51bmRlcmxpbmVfdGhpY2tuZXNzIDogMTsKKyAgICAg ICAgICAgICAgLyogRGV0ZXJtaW5lIHRoZSBvZmZzZXQgb2YgdW5kZXJsaW5pbmcgZnJvbSB0aGUg YmFzZWxpbmUuICovCisgICAgICAgICAgICAgIGlmICh4X3VuZGVybGluZV9hdF9kZXNjZW50X2xp bmUpCisgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBkZXNjZW50IC0gdGhpY2tuZXNzOworICAg ICAgICAgICAgICBlbHNlIGlmICh4X3VzZV91bmRlcmxpbmVfcG9zaXRpb25fcHJvcGVydGllcwor ICAgICAgICAgICAgICAgICAgICAgICAmJiBmb250ICYmIGZvbnQtPnVuZGVybGluZV9wb3NpdGlv biA+PSAwKQorICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gZm9udC0+dW5kZXJsaW5lX3Bvc2l0 aW9uOworICAgICAgICAgICAgICBlbHNlIGlmIChmb250KQorICAgICAgICAgICAgICAgIHBvc2l0 aW9uID0gbHJvdW5kIChmb250LT5kZXNjZW50IC8gMik7CisgICAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgICBwb3NpdGlvbiA9IHVuZGVybGluZV9taW5pbXVtX29mZnNldDsKKyAgICAg ICAgICAgICAgcG9zaXRpb24gPSBtYXggKHBvc2l0aW9uLCB1bmRlcmxpbmVfbWluaW11bV9vZmZz ZXQpOworICAgICAgICAgICAgICAvKiBFbnN1cmUgdW5kZXJsaW5pbmcgaXMgbm90IGNyb3BwZWQu ICovCisgICAgICAgICAgICAgIGlmIChkZXNjZW50IDw9IHBvc2l0aW9uKQorICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gZGVzY2VudCAtIDE7CisgICAgICAg ICAgICAgICAgICB0aGlja25lc3MgPSAxOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAg ICAgZWxzZSBpZiAoZGVzY2VudCA8IHBvc2l0aW9uICsgdGhpY2tuZXNzKQorICAgICAgICAgICAg ICAgIHRoaWNrbmVzcyA9IDE7CisgICAgICAgICAgICB9CisgICAgICAgICAgcy0+dW5kZXJsaW5l X3RoaWNrbmVzcyA9IHRoaWNrbmVzczsKKyAgICAgICAgICBzLT51bmRlcmxpbmVfcG9zaXRpb24g PSBwb3NpdGlvbjsKKyAgICAgICAgICByID0gTlNNYWtlUmVjdCAoeCwgcy0+eWJhc2UgKyBwb3Np dGlvbiwgd2lkdGgsIHRoaWNrbmVzcyk7CisgICAgICAgICAgaWYgKGZhY2UtPnVuZGVybGluZV9k ZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgIFtkZWZhdWx0Q29sIHNldF07CisgICAgICAgICAgZWxz ZQorICAgICAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChmYWNlLT51bmRlcmxpbmVf Y29sb3IsIHMtPmYpIHNldF07CisgICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgIH0K KyAgICB9CisgIC8qIERvIG92ZXJsaW5lLiBXZSBmb2xsb3cgb3RoZXIgdGVybXMgaW4gdXNpbmcg YSB0aGlja25lc3Mgb2YgMQorICAgICBhbmQgaWdub3Jpbmcgb3ZlcmxpbmVfbWFyZ2luLiAqLwor ICBpZiAoZmFjZS0+b3ZlcmxpbmVfcCkKKyAgICB7CisgICAgICBOU1JlY3QgcjsKKyAgICAgIHIg PSBOU01ha2VSZWN0ICh4LCBzLT55LCB3aWR0aCwgMSk7CisgICAgICBpZiAoZmFjZS0+b3Zlcmxp bmVfY29sb3JfZGVmYXVsdGVkX3ApCisgICAgICAgIFtkZWZhdWx0Q29sIHNldF07CisgICAgICBl bHNlCisgICAgICAgIFtuc19sb29rdXBfaW5k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HMt PngsIHMtPnksIHMtPmJhY2tncm91bmRfd2lkdGgsIHMtPmhlaWdodCk7CisgICAgICBpZiAoIW1j X25zX2NsaXBfdG9fcmVjdCAocy0+Ziwgciwgbiwgcm93KSkKKyAgICAgICAgcmV0dXJuOworICAg ICAgaWYgKHMtPmhsID09IERSQVdfTU9VU0VfRkFDRSkKKyAgICAgICB7CisgICAgICAgICBmYWNl ID0gRkFDRV9GUk9NX0lEIChzLT5mLCBNT1VTRV9ITF9JTkZPIChzLT5mKS0+bW91c2VfZmFjZV9m YWNlX2lkKTsKKyAgICAgICAgIGlmICghZmFjZSkKKyAgICAgICAgICAgZmFjZSA9IEZBQ0VfRlJP TV9JRCAocy0+ZiwgTU9VU0VfRkFDRV9JRCk7CisgICAgICAgfQorICAgICAgZWxzZQorICAgICAg IGZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIHMtPmZpcnN0X2dseXBoLT5mYWNlX2lkKTsKKyAg ICAgIGJnQ29sID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAo ZmFjZSksIHMtPmYpOworICAgICAgZmdDb2wgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNf RkFDRV9GT1JFR1JPVU5EIChmYWNlKSwgcy0+Zik7CisgICAgICBmb3IgKGkgPSAwOyBpIDwgbjsg KytpKQorICAgICAgICB7CisgICAgICAgICAgaWYgKCFzLT5yb3ctPmZ1bGxfd2lkdGhfcCkKKyAg ICAgICAgICAgIHsKKyAgICAgICAgaW50IG92ZXJydW4sIGxlZnRvdmVycnVuOworICAgICAgICAg ICAgICAvKiB0cnVuY2F0ZSB0byBhdm9pZCBvdmVyd3JpdGluZyBmcmluZ2UgYW5kL29yIHNjcm9s bGJhciAqLworICAgICAgICBvdmVycnVuID0gbWF4ICgwLCAocy0+eCArIHMtPmJhY2tncm91bmRf d2lkdGgpCisgICAgICAgICAgIC0gKFdJTkRPV19CT1hfUklHSFRfRURHRV9YIChzLT53KQorICAg ICAgICAtIFdJTkRPV19SSUdIVF9GUklOR0VfV0lEVEggKHMtPncpKSk7CisgICAgICAgICAgICAg IHJbaV0uc2l6ZS53aWR0aCAtPSBvdmVycnVuOworICAgICAgICAvKiB0cnVuY2F0ZSB0byBhdm9p ZCBvdmVyd3JpdGluZyB0byBsZWZ0IG9mIHRoZSB3aW5kb3cgYm94ICovCisgICAgICAgIGxlZnRv dmVycnVuID0gKFdJTkRPV19CT1hfTEVGVF9FREdFX1ggKHMtPncpCisgICAgICAgICAgICsgV0lO RE9XX0xFRlRfRlJJTkdFX1dJRFRIIChzLT53KSkgLSBzLT54OworICAgICAgICBpZiAobGVmdG92 ZXJydW4gPiAwKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIHJbaV0ub3JpZ2luLnggKz0gbGVm dG92ZXJydW47CisgICAgICAgICAgICByW2ldLnNpemUud2lkdGggLT0gbGVmdG92ZXJydW47Cisg ICAgICAgICAgfQorICAgICAgICAgICAgICAvKiBYWFg6IFRyeSB0byB3b3JrIGJldHdlZW4gcHJv YmxlbSB3aGVyZSBhIHN0cmV0Y2ggZ2x5cGggb24KKyAgICAgICAgICAgICAgICAgYSBwYXJ0aWFs bHktdmlzaWJsZSBib3R0b20gcm93IHdpbGwgY2xlYXIgcGFydCBvZiB0aGUKKyAgICAgICAgICAg ICAgICAgbW9kZWxpbmUsIGFuZCBhbm90aGVyIHdoZXJlIGxpc3QtYnVmZmVycyBoZWFkZXJzIGFu ZCBzaW1pbGFyCisgICAgICAgICAgICAgICAgIHJvd3MgZXJyb25lb3VzbHkgaGF2ZSB2aXNpYmxl X2hlaWdodCBzZXQgdG8gMC4gIE5vdCBzdXJlCisgICAgICAgICAgICAgICAgIHdoZXJlIHRoaXMg aXMgY29taW5nIGZyb20gYXMgb3RoZXIgdGVybXMgc2VlbSBub3QgdG8gc2hvdy4gKi8KKyAgICAg ICAgICAgICAgcltpXS5zaXplLmhlaWdodCA9IG1pbiAocy0+aGVpZ2h0LCBzLT5yb3ctPnZpc2li bGVfaGVpZ2h0KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBbYmdDb2wgc2V0XTsKKyAgICAg ICAgICAvKiBOT1RFOiB1bmRlciBOUyB0aGlzIGlzIE5PVCB1c2VkIHRvIGRyYXcgY3Vyc29ycywg YnV0IHdlIG11c3QgYXZvaWQKKyAgICAgICAgICAgICBvdmVyd3JpdGluZyBjdXJzb3IgKHVzdWFs bHkgd2hlbiBjdXJzb3Igb24gYSB0YWIpICovCisgICAgICAgICAgaWYgKHMtPmhsID09IERSQVdf Q1VSU09SKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBGSVhNRTogIERvIHdlIHN0 aWxsIG5lZWQgdG8gcHJldmVudCB0aGlzIHNlY3Rpb24gb2YgY29kZSBmcm9tCisgICAgICAgICAg ICAgIGVyYXNpbmcgdGhlIGZha2UgSEJBUl9DVVJTT1IgdGhhdCBleHRlbmRzIHRoZSBlbnRpcmUg bGVuZ3RoIG9mIHRoZQorICAgICAgICAgICAgICBTVFJFVENIX0dMWVBIPyAgVGhpcyBtYXkgaGF2 ZSBiZWVuIGRvbmUgcHJpb3IgdG8gdGhlIGZpeCByZWxhdGluZworICAgICAgICAgICAgICB0byBs ZWZ0L3JpZ2h0IG92ZXJ3cml0dGVuIGdseXBocy4gKi8KKyAgICAgICAgICAgICAgcltpXS5zaXpl LmhlaWdodCAtPSAxOworICAgICAgICAgICAgICAvLyAgZW51bSBmYWNlX2lkIGRlYnVnZ2luZ19m YWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAoIistZGVidWdn aW5nLWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgIC8vICBzdHJ1Y3QgZmFjZSAqZGVidWdn aW5nX2ZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIGRlYnVnZ2luZ19mYWNlX2lkKTsKKyAgICAg ICAgICAgICAgLy8gIE5TQ29sb3IgKmNvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5T X0ZBQ0VfRk9SRUdST1VORCAoZGVidWdnaW5nX2ZhY2UpLCBzLT5mKTsKKyAgICAgICAgICAgICAg Ly8gIFtjb2xvciBzZXRdOworICAgICAgICAgICAgICBDR0Zsb2F0IHggPSByW2ldLm9yaWdpbi54 OworICAgICAgICAgICAgICBDR0Zsb2F0IHdpZHRoID0gd2Q7CisgICAgICAgICAgICAgIHJbaV0u c2l6ZS53aWR0aCAtPSB3aWR0aDsKKyAgICAgICAgICAgICAgcltpXS5vcmlnaW4ueCArPSB3aWR0 aDsKKyAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocltpXSk7CisgICAgICAgICAgICAgIC8qIERy YXcgb3ZlcmxpbmluZywgZXRjLiBvbiB0aGUgY3Vyc29yLiAqLworICAgICAgICAgICAgICBpZiAo cy0+dy0+cGh5c19jdXJzb3JfdHlwZSA9PSBGSUxMRURfQk9YX0NVUlNPUikKKyAgICAgICAgICAg ICAgICBtY19uc19kcmF3X3RleHRfZGVjb3JhdGlvbiAocywgZmFjZSwgYmdDb2wsIHdpZHRoLCB4 KTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBtY19uc19kcmF3X3Rl eHRfZGVjb3JhdGlvbiAocywgZmFjZSwgZmdDb2wsIHdpZHRoLCB4KTsKKyAgICAgICAgICAgIH0K KyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgIC8vICBpbnQgcnggPSByW2ldLm9yaWdp bi54OworICAvLyAgaW50IHJ5ID0gcltpXS5vcmlnaW4ueTsKKyAgLy8gIGludCBydyA9IHJbaV0u c2l6ZS53aWR0aDsKKyAgLy8gIGludCByaCA9IHJbaV0uc2l6ZS5oZWlnaHQ7CisgIC8vICBmcHJp bnRmIChzdGRlcnIsICJtY19uc19kdW1wZ2x5cGhzX3N0cmV0Y2g6ICB2cG9zICglZCkgfCByeCAo JWQpIHwgcnkgKCVkKSB8I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vdW5kX2ZpbGxlZF9wID0gMTsKKyAgICB9CisgIGVsc2UK KyAgICB7CisgICAgICBiciA9IE5TTWFrZVJlY3QgKHgsIHksIHMtPnNsaWNlLndpZHRoLCBzLT5z bGljZS5oZWlnaHQpOworICAgIH0KKyAgTlNSZWN0RmlsbCAoYnIpOworICAvKiBEcmF3IHRoZSBp bWFnZS4uIGRvIHdlIG5lZWQgdG8gZHJhdyBwbGFjZWhvbGRlciBpZiBpbWcgPT1uaWw/ICovCisg IGlmIChpbWcgIT0gbmlsKQorICAgIHsKKyNpZmRlZiBOU19JTVBMX0NPQ09BCisgICAgICBOU1Jl Y3QgZHIgPSBOU01ha2VSZWN0ICh4LCB5LCBzLT5zbGljZS53aWR0aCwgcy0+c2xpY2UuaGVpZ2h0 KTsKKyAgICAgIE5TUmVjdCBpciA9IE5TTWFrZVJlY3QgKHMtPnNsaWNlLngsIHMtPnNsaWNlLnks CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzLT5zbGljZS53aWR0aCwgcy0+c2xpY2Uu aGVpZ2h0KTsKKyAgICAgIFtpbWcgZHJhd0luUmVjdDogZHIKKyAgICAgICAgICAgICBmcm9tUmVj dDogaXIKKyAgICAgICAgICAgICBvcGVyYXRpb246IE5TQ29tcG9zaXRlU291cmNlT3ZlcgorICAg ICAgICAgICAgICBmcmFjdGlvbjogMS4wCisgICAgICAgICAgIHJlc3BlY3RGbGlwcGVkOiBZRVMK KyAgICAgICAgICAgICAgICBoaW50czogbmlsXTsKKyNlbHNlCisgICAgICBbaW1nIGNvbXBvc2l0 ZVRvUG9pbnQ6IE5TTWFrZVBvaW50ICh4LCB5ICsgcy0+c2xpY2UuaGVpZ2h0KQorICAgICAgICAg ICAgICAgICAgb3BlcmF0aW9uOiBOU0NvbXBvc2l0ZVNvdXJjZU92ZXJdOworI2VuZGlmCisgICAg fQorICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IpCisgICAgeworICAgIFtGUkFNRV9DVVJTT1Jf Q09MT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SVNFRCB8fCBzLT5obCA9PURSQVdfSU1BR0VfU1VOS0VO KQorICAgIHsKKyAgICAgIGlmIChzLT5obCA9PSBEUkFXX0lNQUdFX1NVTktFTiB8fCBzLT5obCA9 PSBEUkFXX0lNQUdFX1JBSVNFRCkKKyAgICAgICAgeworICAgICAgICAgIHRoID0gdG9vbF9iYXJf YnV0dG9uX3JlbGllZiA+PSAwID8KKyAgICAgICAgICAgIHRvb2xfYmFyX2J1dHRvbl9yZWxpZWYg OiBERUZBVUxUX1RPT0xfQkFSX0JVVFRPTl9SRUxJRUY7CisgICAgICAgICAgcmFpc2VkX3AgPSAo cy0+aGwgPT0gRFJBV19JTUFHRV9SQUlTRUQpOworICAgICAgICB9CisgICAgICBlbHNlCisgICAg ICAgIHsKKyAgICAgICAgICB0aCA9IGFicyAocy0+aW1nLT5yZWxpZWYpOworICAgICAgICAgIHJh aXNlZF9wID0gKHMtPmltZy0+cmVsaWVmID4gMCk7CisgICAgICAgIH0KKyAgICAgIHIub3JpZ2lu LnggPSB4IC0gdGg7CisgICAgICByLm9yaWdpbi55ID0geSAtIHRoOworICAgICAgci5zaXplLndp ZHRoID0gcy0+c2xpY2Uud2lkdGggKyAyKnRoLTE7CisgICAgICByLnNpemUuaGVpZ2h0ID0gcy0+ c2xpY2UuaGVpZ2h0ICsgMip0aC0xOworICAgICAgbnNfZHJhd19yZWxpZWYgKHIsIHRoLCByYWlz ZWRfcCwKKyAgICAgICAgICAgICAgICAgICAgICBzLT5zbGljZS55ID09IDAsCisgICAgICAgICAg ICAgICAgICAgICAgcy0+c2xpY2UueSArIHMtPnNsaWNlLmhlaWdodCA9PSBzLT5pbWctPmhlaWdo dCwKKyAgICAgICAgICAgICAgICAgICAgICBzLT5zbGljZS54ID09IDAsCisgICAgICAgICAgICAg ICAgICAgICAgcy0+c2xpY2UueCArIHMtPnNsaWNlLndpZHRoID09IHMtPmltZy0+d2lkdGgsIHMp OworICAgIH0KKyAgLyogSWYgdGhlcmUgaXMgbm8gbWFzaywgdGhlIGJhY2tncm91bmQgd29uJ3Qg YmUgc2VlbiwKKyAgICAgc28gZHJhdyBhIHJlY3RhbmdsZSBvbiB0aGUgaW1hZ2UgZm9yIHRoZSBj dXJzb3IuCisgICAgIERvIHRoaXMgZm9yIGFsbCBpbWFnZXMsIGdldHRpbmcgdHJhbnNwYXJlbmN5 IHJpZ2h0IGlzIG5vdCByZWxpYWJsZS4gICovCisgIGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUikK KyAgICB7CisgICAgICBpbnQgdGhpY2tuZXNzID0gYWJzIChzLT5pbWctPnJlbGllZik7CisgICAg ICBpZiAodGhpY2tuZXNzID09IDApIHRoaWNrbmVzcyA9IDE7CisgICAgaWYgKGdseXBoX2ZsYXZv ciA9PSBNQ19HTFlQSAorICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEhMRVNTKQor ICAgICAgeworICAgICAgICBOU0NvbG9yICpib3JkZXJfY29sb3IgPSBbTlNDb2xvciBjb2xvcldp dGhDYWxpYnJhdGVkUmVkOiByZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBncmVlbjogZ3JlZW4KKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmx1ZTogYmx1ZQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscGhh OiAxLjBdOworICAgICAgICBuc19kcmF3X2JveCAoYnIsIHRoaWNrbmVzcywgYm9yZGVyX2NvbG9y LCAxLCAxKTsKKyAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgICAgbnNfZHJhd19ib3ggKGJyLCB0 aGlja25lc3MsIEZSQU1FX0NVUlNPUl9DT0xPUiAocy0+ZiksIDEsIDEpOworICAgIH0KK30KKwor c3RhdGljIHZvaWQKK21jX25zX292ZXJ3cml0dGVuX2hlbHBlciAo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gICAgIGRvdWJs ZSB0ZW1wX3JlZCA9ICghTklMUCAoZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAgICAgICAg ICA/IFhGTE9BVF9EQVRBIChBUkVGIChmb3JlZ3JvdW5kLCAwKSkKKyAgICAgICAgICAgICAgICAg ICAgICAgIDogLTEuMDsKKyAgICAgIGRvdWJsZSB0ZW1wX2dyZWVuID0gKCFOSUxQIChmb3JlZ3Jv dW5kKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgPyBYRkxPQVRfREFUQSAoQVJFRiAoZm9y ZWdyb3VuZCwgMSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgIDogLTEuMDsKKyAgICAgIGRv dWJsZSB0ZW1wX2JsdWUgPSAoIU5JTFAgKGZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgICAg ICAgICAgID8gWEZMT0FUX0RBVEEgKEFSRUYgKGZvcmVncm91bmQsIDIpKQorICAgICAgICAgICAg ICAgICAgICAgICAgIDogLTEuMDsKKyAgICAgIC8qIFNvbWUgb2YgdGhlc2UgdmFsdWVzIGNvbWUg dGhyb3VnaCBhcyAxLjAwMzkwNiwgd2hpY2ggY2F1c2VzIGEgYnJlYWthZ2UKKyAgICAgIG9mIHRo ZSBjb2xvcnMgaW4gdGhhdCBtdWx0aXBsaWNhdGlvbiBieSB0aGUgYmFzZSB3aWxsIGV4Y2VlZCB0 aGUgYmFzZS4gKi8KKyAgICAgIGRvdWJsZSByZWQgPSAodGVtcF9yZWQgPiAxLjApCisgICAgICAg ICAgICAgICAgICAgPyAxLjAKKyAgICAgICAgICAgICAgICAgICA6IHRlbXBfcmVkOworICAgICAg ZG91YmxlIGdyZWVuID0gKHRlbXBfZ3JlZW4gPiAxLjApCisgICAgICAgICAgICAgICAgICAgICA/ IDEuMAorICAgICAgICAgICAgICAgICAgICAgOiB0ZW1wX2dyZWVuOworICAgICAgZG91YmxlIGJs dWUgPSAodGVtcF9ibHVlID4gMS4wKQorICAgICAgICAgICAgICAgICAgICA/IDEuMAorICAgICAg ICAgICAgICAgICAgICA6IHRlbXBfYmx1ZTsKKyAgICAgIFtbTlNDb2xvciBjb2xvcldpdGhDYWxp YnJhdGVkUmVkOiByZWQgZ3JlZW46IGdyZWVuIGJsdWU6IGJsdWUgYWxwaGE6IDEuMF0gc2V0XTsK KyAgaWYgKGN1cnNvcl90eXBlID09IEZSQU1FRF9CT1hfQ1VSU09SKQorICAgIHsKKyAgICAgIExp c3BfT2JqZWN0IGJ1ZiA9IHMtPnctPmNvbnRlbnRzOworICAgICAgQ0hFQ0tfQlVGRkVSIChidWYp OworICAgICAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKGJ1Zik7CisgICAgICBib29sIHJl Z2lvbl9hY3RpdmVfcCA9ICghTklMUCAoVnRyYW5zaWVudF9tYXJrX21vZGUpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgbWFya19hY3RpdmUpKSk7Cisg ICAgICBwdHJkaWZmX3QgcmVnaW9uX2JlZ2lubmluZyA9IChyZWdpb25fYWN0aXZlX3ApID8gWEZJ WE5VTSAoRnJlZ2lvbl9iZWdpbm5pbmcgKCkpIDogLTE7CisgICAgICBwdHJkaWZmX3QgcmVnaW9u X2VuZCA9IChyZWdpb25fYWN0aXZlX3ApID8gWEZJWE5VTSAoRnJlZ2lvbl9lbmQgKCkpIDogLTE7 CisgICAgICBwdHJkaWZmX3Qgb3BvaW50X3B0ID0gKHMtPncgPT0gWFdJTkRPVyAoc2VsZWN0ZWRf d2luZG93KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFBUCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiBYRklYTlVNIChGbWFya2VyX3Bvc2l0aW9uIChzLT53LT5wb2ludG0p KTsKKyAgICAgIGJvb2wgcmVnaW9uX2luX2JvdW5kc19wID0gKHJlZ2lvbl9hY3RpdmVfcAorICAg ICAgICAgICAgICAgICAgICAgICAgICA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 dywgcy0+ZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXJlZ2lvbi1mYWNlIiksIHRydWUp OworICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfcmVnaW9uX291dF9mYWNl ID0gRkFDRV9GUk9NX0lEIChzLT5mLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9vdXRfZmFjZV9pZCk7 CisgICAgICAgICAgICBOU0NvbG9yICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9vdXRfY29sb3IgPSBu c19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChob2xsb3dfYWN0aXZl X3JlZ2lvbl9vdXRfZmFjZSksIHMtPmYpOworICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9s bG93X2FjdGl2ZV9yZWdpb25fb3V0X2NvbG9yOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNl IGlmICghcmVnaW9uX2FjdGl2ZV9wICYmIGFjdGl2ZV9wKQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVk X2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1mYWNlIiksIHRy dWUpOworICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFD RV9GUk9NX0lEIChzLT5mLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICBO U0NvbG9yICpob2xsb3dfYWN0aXZlX2NvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5T X0ZBQ0VfQkFDS0dST1VORCAoaG9sbG93X2FjdGl2ZV9mYWNlKSwgcy0+Zik7CisgICAgICAgICAg ICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19hY3RpdmVfY29sb3I7CisgICAgICAgICAgICB9Cisg ICAgICAgICAgICAvKiBUaGUgcmVnaW9uIGlzIF9ub3RfIHZpc2libGUgaW4gdGhlIGluYWN0aXZl IHdpbmRvdyBiZWNhdXNlIHRoZSBvdmVybGF5IHdpbmRvdyBwcm9wZXJ0eSBpcyB1c2VkLiAqLwor ICAgICAgICAgICAgZWxzZSBpZiAoIWFjdGl2ZV9wKQorICAgICAgICAgICAgICB7CisgICAgICAg ICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25h bWVkX2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2 ZS1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5h Y3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQp OworICAgICAgICAgICAgICAgIE5TQ29sb3IgKmhvbGxvd19pbmFjdGl2ZV9jb2xvciA9IG5zX2xv b2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGhvbGxvd19pbmFjdGl2ZV9m YWNlKSwgcy0+Zik7CisgICAgICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2luYWN0 aXZlX2NvbG9yOworICAgICAgICAgICAgICB9CisgICAgfQorICAgIGVsc2UgaWYgKGZhY2UgJiYg TlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKSA9PSBuc19pbmRleF9jb2xvciAoRlJBTUVfQ1VSU09S X0NPTE9SIChzLT5mKSwgcy0+ZikpCisgICAgICB7CisgICAgICAgIFtuc19sb29rdXBfaW5kZXhl ZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChmYWNlKSwgcy0+Zikgc2V0XTsKKyAgICAgICAg aG9sbG93X2NvbG9yID0gRlJBTUVfQ1VSU09SX0NPTE9SIChzLT5mKTsKKyAgICAgIH0KKyAgICAg IHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgICAgIHsKKyAgICAgICAgICBjYXNlIFJJR0hUX0ZS SU5HRV9CSVRNQVA6CisgICAgICAgICAgY2FzZSBMRUZUX0ZSSU5HRV9CSVRNQVA6CisgICAgICAg ICAgY2FzZSBOT19GUklOR0VfQklUTUFQOgorICAgICAgICAgIGNhc2UgREVGQVVMVF9DVVJTT1I6 CisgICAgICAgICAgY2FzZSBOT19DVVJTT1I6CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAg ICBjYXNlIEZJTExFRF9CT1hfQ1VSU09SOgorICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7Cisg ICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBjYXNlIEZSQU1FRF9CT1hfQ1VSU09SOgorICAg ICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAgICBbaG9sbG93X2NvbG9yIHNldF07 CisgICAgICAgICAgICBOU1JlY3RGaWxsIChOU0luc2V0UmVjdCAociwgMSwgMSkpOworICAgICAg ICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAocy0+Zikgc2V0XTsKKyAgICAgICAgICAgIGJyZWFr OworICAgICAgICAgIGNhc2UgSE9MTE9XX0JPWF9DVVJTT1I6CisgICAgICAgICAgICBOU1JlY3RG aWxsIChyKTsKKyAgICAgICAgICAgIFtob2xsb3dfY29sb3Igc2V0XTsKKyAgICAgICAgICAgIE5T UmVjdEZpbGwgKE5TSW5zZXRSZWN0IChyLCAxLCAxKSk7CisgICAgICAgICAgICBbRlJBTUVfQ1VS U09SX0NPTE9SIChzLT5mKSBzZXRdOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgY2Fz ZSBIQkFSX0NVUlNPUjoKKyAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAg YnJlYWs7CisgICAgICAgICAgY2FzZSBCQVJfQ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gICAgIG5zX2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsK KyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0cnVj dCBmb250ICpmb250ID0gcy0+ZmFjZS0+Zm9udDsKKyAgICAgICAgICAgICAgICBpZiAoIWZvbnQp CisgICAgICAgICAgICAgICAgICBmb250ID0gRlJBTUVfRk9OVCAocy0+Zik7CisgICAgICAgICAg ICAgICAgYm9vbCB3aXRoX2JnX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBmb250LT5kcml2 ZXItPmRyYXcgKHMsIHMtPmNtcF9mcm9tLCBzLT5uY2hhcnMsIHMtPngsIHMtPnliYXNlLCB3aXRo X2JnX3ApOworICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9Cit9CisKK3N0YXRpYyB2 b2lkCittY19uc19kcmF3X292ZXJ3cml0dGVuIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzLCBzdHJ1 Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qg Z2x5cGhfcm93ICpyb3csIHN0cnVjdCBnbHlwaCAqZ2x5cGgpCit7CisgIC8vICBpbnQgdnBvcyA9 IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAvLyAgY2xvY2tfdCBjbG9ja19zdGFy dCA9IGNsb2NrKCk7CisgIG1jX25zX292ZXJ3cml0dGVuX2hlbHBlciAocywgbWF0cml4LCByb3cs IE1DX1RFTVBfQ0FDSEUsIGdseXBoKTsKKyAgbWNfbnNfb3ZlcndyaXR0ZW5faGVscGVyIChzLCBt YXRyaXgsIHJvdywgTUNfQ0FDSEUsIGdseXBoKTsKKyAgbWNfbnNfb3ZlcndyaXR0ZW5faGVscGVy IChzLCBtYXRyaXgsIHJvdywgQ0hfQ0FDSEUsIGdseXBoKTsKKyAgbWNfb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gICAgICAgICAgICB3aXRoIGJhY2tncm91bmQgY29sb3IuICAqLworICAgICAgICAgIHx8IEZP TlRfVE9PX0hJR0ggKHMtPmZvbnQpCisgICAgICAgICAgfHwgcy0+Zm9udF9ub3RfZm91bmRfcCB8 fCBzLT5leHRlbmRzX3RvX2VuZF9vZl9saW5lX3AgfHwgZm9yY2VfcCkKKyAgICAgIHsKKyAgICAg ICAgICBzdHJ1Y3QgZmFjZSAqZmFjZTsKKyAgICAgICAgICBpZiAocy0+aGwgPT0gRFJBV19NT1VT RV9GQUNFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBmYWNlID0gRkFDRV9GUk9NX0lE IChzLT5mLAorICAgICAgICAgICBNT1VTRV9ITF9JTkZPIChzLT5mKS0+bW91c2VfZmFjZV9mYWNl X2lkKTsKKyAgICAgICAgICAgICAgaWYgKCFmYWNlKQorICAgICAgICAgICAgICAgIGZhY2UgPSBG QUNFX0ZST01fSUQgKHMtPmYsIE1PVVNFX0ZBQ0VfSUQpOworICAgICAgICAgICAgfQorICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIHMtPmZpcnN0 X2dseXBoLT5mYWNlX2lkKTsKKyAgICAgICAgICBpZiAoIWZhY2UtPnN0aXBwbGUpCisgICAgICAg ICAgICBbKE5TX0ZBQ0VfQkFDS0dST1VORCAoZmFjZSkgIT0gMAorICAgICAgICAgICAgICA/IG5z X2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpLCBzLT5mKQor ICAgICAgICAgICAgICA6IEZSQU1FX0JBQ0tHUk9VTkRfQ09MT1IgKHMtPmYpKSBzZXRdOworICAg ICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgc3RydWN0IG5zX2Rpc3Bs YXlfaW5mbyAqZHB5aW5mbyA9IEZSQU1FX0RJU1BMQVlfSU5GTyAocy0+Zik7CisgICAgICAgICAg ICAgIFtbZHB5aW5mby0+Yml0bWFwc1tmYWNlLT5zdGlwcGxlLTFdLmltZyBzdGlwcGxlTWFza10g c2V0XTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBpZiAocy0+aGwgIT0gRFJBV19DVVJTT1Ip CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHMtPnJlY3RhbmdsZV9udWtlZF9wID0gdHJ1 ZTsKKyAgICAgICAgICAgICAgTlNSZWN0IHIgPSBOU01ha2VSZWN0IChzLT54LCBzLT55ICsgYm94 X2xpbmVfd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzLT5iYWNr Z3JvdW5kX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+aGVp Z2h0LTIqYm94X2xpbmVfd2lkdGgpOworICAgICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAg ICAgICAgICAgIH0KKyAgICBzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wID0gMTsKKyAgICAgIH0KKyAg ICB9Cit9CisKKworc3RhdGljIHZvaWQKK21jX25zX2RyYXdfZ2x5cGhfc3RyaW5nIChzdHJ1Y3Qg Z2x5cGhfc3RyaW5nICpzLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsIHN0cnVjdCBnbHlw aF9yb3cgKnJvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICBkb3VibGUgcmVkLCBkb3VibGUg Z3JlZW4sIGRvdWJsZSBibHVlLAorICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfZmxh dm9yIGdseXBoX2ZsYXZvciwgZW51bSB0ZXh0X2N1cnNvcl9raW5kcyBjdXJzb3JfdHlwZSwKKyAg ICAgICAgICAgICAgICAgICAgICAgICBpbnQgd2QsIGJvb2wgYWN0aXZlX3AsIGJvb2wgY3Vyc29y X2djX3ApCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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CkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIG4gPSBuc19nZXRfZ2x5cGhf c3RyaW5nX2NsaXBfcmVjdCAocy0+bmV4dCwgcik7CisgICAgICAgICAgICAgICAgaWYgKCFtY19u c19jbGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4sIHJvdykpCisgICAgICAgICAgICAgICAgICByZXR1 cm47CisgICAgICAgICAgICAgICAgbWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChz LT5uZXh0LCAxKTsKKyAgICAgICAgICAgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7Cisg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgIG1jX25zX2R1bXBnbHlwaHNfc3RyZXRjaCAocy0+bmV4dCwgd2QsIHJvdyk7Cisg ICAgICAgICAgICAgICAgaWYgKChzLT5uZXh0LT5sZWZ0X292ZXJ3cml0dGVuX3AgfHwgcy0+bmV4 dC0+cmlnaHRfb3ZlcndyaXR0ZW5fcCkKKyAgICAgICAgICAgICAgICAgICAgJiYgcy0+bmV4dC0+ YWN0aW9uID09IE1DX0RSQVdfR0xZUEgpCisgICAgICAgICAgICAgICAgICBtY19uc19kcmF3X292 ZXJ3cml0dGVuIChzLT5uZXh0LCBtYXRyaXgsIHJvdywgcy0+bmV4dC0+Zmlyc3RfZ2x5cGgpOwor ICAgICAgICAgICAgICB9CisgICAgICAgICAgICBuZXh0LT5udW1fY2xpcHMgPSAwOworICAgICAg ICAgIH0KKyAgICB9CisgIGlmICghcy0+Zm9yX292ZXJsYXBzICYmIHMtPmZhY2UtPmJveCAhPSBG QUNFX05PX0JPWAorICAgICAgJiYgKHMtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgK KyAgICAgICAgICB8fCBzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpKQor ICAgIHsKKyAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgcik7Cisg ICAgICBpZiAoIW1jX25zX2NsaXBfdG9fcmVjdCAocy0+Ziwgciwgbiwgcm93KSkKKyAgICAgICAg cmV0dXJuOworICAgICAgbWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzLCAxKTsK KyAgICAgIG5zX2R1bXBnbHlwaHNfYm94X29yX3JlbGllZiAocyk7CisgICAgICBuc19yZXNldF9j bGlwcGluZyAocy0+Zik7CisgICAgICBib3hfZHJhd25fcCA9IDE7CisgICAgfQorICBzd2l0Y2gg KHMtPmZpcnN0X2dseXBoLT50eXBlKQorICAgIHsKKyAgICBjYXNlIElNQUdFX0dMWVBIOgorICAg ICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAgICAgIGlmICgh bWNfbnNfY2xpcF90b19yZWN0IChzLT5mLCByLCBuLCByb3cpKQorICAgICAgICByZXR1cm47Cisg ICAgICBtY19uc19kdW1wZ2x5cGhzX2ltYWdlIChzLCByWzBdLCByZWQsIGdyZWVuLCBibHVlLCBn bHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCBhY3RpdmVfcCk7CisgICAgICBuc19yZXNldF9jbGlw cGluZyAocy0+Zik7CisgICAgICBicmVhazsKKyAgICBjYXNlIFNUUkVUQ0hfR0xZUEg6CisgICAg ICBtY19uc19kdW1wZ2x5cGhzX3N0cmV0Y2ggKHMsIHdkLCByb3cpOworICAgICAgaWYgKChzLT5s ZWZ0X292ZXJ3cml0dGVuX3AgfHwgcy0+cmlnaHRfb3ZlcndyaXR0ZW5fcCkKKyAgICAgICAgICAm JiBzLT5hY3Rpb24gPT0gTUNfRFJBV19HTFlQSCkKKyAgICAgICAgbWNfbnNfZHJhd19vdmVyd3Jp dHRlbiAocywgbWF0cml4LCByb3csIHMtPmZpcnN0X2dseXBoKTsKKyAgICAgIGJyZWF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+ZmFjZSkgIT0gMAorICAgICAg ICAgICAgICAgICAgICAgICAgPyBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JF R1JPVU5EIChzLT5mYWNlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHMtPmYpCisgICAgICAgICAgICAgICAgICAgICAgICA6IEZSQU1FX0ZPUkVH Uk9VTkRfQ09MT1IgKHMtPmYpKTsKKyAgICAgICAgW2NvbCBzZXRdOworICAgICAgICAvKiBEcmF3 IHVuZGVybGluZSwgb3ZlcmxpbmUsIHN0cmlrZS10aHJvdWdoLiAqLworICAgICAgICBtY19uc19k cmF3X3RleHRfZGVjb3JhdGlvbiAocywgcy0+ZmFjZSwgY29sLCBzLT53aWR0aCwgcy0+eCk7Cisg ICAgICB9CisgICAgICB7CisgICAgICAgIGlmIChzLT5maXJzdF9nbHlwaC0+dHlwZSAhPSBDT01Q T1NJVEVfR0xZUEgKKyAgICAgICAgICAgICYmIChzLT5sZWZ0X292ZXJ3cml0dGVuX3AgfHwgcy0+ cmlnaHRfb3ZlcndyaXR0ZW5fcCkKKyAgICAgICAgICAgICYmIChzLT5iYWNrZ3JvdW5kX251a2Vk X3AgfHwgcy0+cmVjdGFuZ2xlX251a2VkX3ApCisgICAgICAgICAgICAmJiBzLT5hY3Rpb24gPT0g TUNfRFJBV19HTFlQSCkKKyAgICAgICAgICBtY19uc19kcmF3X292ZXJ3cml0dGVuIChzLCBtYXRy aXgsIHJvdywgcy0+Zmlyc3RfZ2x5cGgpOworICAgICAgfQorICAgICAgaWYgKHMtPmhsID09IERS QVdfQ1VSU09SCisgICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gRklMTEVEX0JPWF9DVVJTT1Ip CisgICAgICAgIHsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIHRtcCA9IE5TX0ZBQ0VfQkFDS0dS T1VORCAocy0+ZmFjZSk7CisgICAgICAgICAgTlNfRkFDRV9CQUNLR1JPVU5EIChzLT5mYWNlKSA9 IE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSk7CisgICAgICAgICAgTlNfRkFDRV9GT1JFR1JP VU5EIChzLT5mYWNlKSA9IHRtcDsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChzLT5obCA9 PSBEUkFXX0NVUlNPUgorICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBGUkFNRURf Qk9YX0NVUlNPUikKKyAgICAgICAgICBOU19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2UpID0gc2F2 ZWRfZmc7CisgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICBicmVhazsKKyAg ICBjYXNlIEdMWVBITEVTU19HTFlQSDoKKyAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5nX2Ns aXBfcmVjdCAocywgcik7CisgICAgICBpZiAoIW1jX25zX2NsaXBfdG9fcmVjdCAocy0+Ziwgciwg biwgcm93KSkKKyAgICAgICAgcmV0dXJuOworICAgICAgaWYgKHMtPmZvcl9vdmVybGFwcyB8fCAo cy0+Y21wX2Zyb20gPiAwCisgICAgICAgICAgICAmJiAhIHMtPmZpcnN0X2dseXBoLT51LmNtcC5h dXRvbWF0aWMpKQorICAgICAgICBzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wID0gMTsKKyAgICAgIGVs c2UKKyAgICAgICAgbWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzLCBzLT5maXJz dF9nbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpOworICAgICAgLyogLi4uICovCisgICAg ICAvKiBOb3QgeWV0IGltcGxlbWVudGVkLiAgKi8KKyAgICAgIC8qIC4uLiAqLworICAgICAgbnNf cmVzZXRfY2xpcHBpbmcgKHMtPmYpOworICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoKKyAgICAg IGVtYWNzX2Fib3J0ICgpOworICAgIH0KKyAgLyogRHJhdyBib3ggaWYgbm90IGRvbmUgYWxyZWFk eS4gKi8KKyAgaWYgKCFzLT5mb3Jfb3ZlcmxhcHMgJiYgIWJveF9kcmF3bl9wICYmIHMtPmZhY2Ut PmJveCAhPSBGQUNFX05PX0JPWCkKKyAgICB7CisgICAgICBuID0gbnNfZ2V0X2dseXBoX3N0cmlu Z19jbGlwX3JlY3QgKHMsIHIpOworICAgICAgaWYgKCFtY19uc19jbGlwX3RvX3JlY3QgKHMtPmYs IHIsIG4sIHJvdykpCisgICAgICAgIHJldHVybjsKKyAgICAgIG5zX2R1bXBnbHlwaHNfYm94X29y X3JlbGllZiAocyk7CisgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgfQorICBz LT5udW1fY2xpcHMgPSAwOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KIAogICAgTlNUUkFD RSwgVHJhY2Ugc3VwcG9ydC4KQEAgLTExMDksNiArMjE1MSwxNiBAQCBzdGF0aWMgTlNSZWN0IGNv bnN0cmFpbl9mcmFtZV9yZWN0KE5TUmVjdCBmcmFtZVJlY3QsIGJvb2wgaXNGdWxsc2NyZWVuKQog ICAgZXh0ZXJuYWwgKFJJRikgY2FsbDsgd2hvbGUgZnJhbWUsIGNhbGxlZCBiZWZvcmUgdXBkYXRl X3dpbmRvd19iZWdpbgogICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KIHsKKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGlu Z19mcmFtZSA9IGY7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICNpZmRlZiBOU19J TVBMX0NPQ09BCiAgIEVtYWNzVmlldyAqdmlldyA9IEZSQU1FX05TX1ZJRVcgKGYpOwogCkBAIC0x MjA5LDYgKzIyNjEsMTYgQEAgc3RhdGljIE5TUmVjdCBjb25zdHJhaW5fZnJhbWVfcmVjdChOU1Jl Y3QgZnJhbWVSZWN0LCBib29sIGlzRnVsbHNjcmVlbikKIAogLyogICBpZiAoZiA9PSBNT1VTRV9I TF9JTkZPIChmKS0+bW91c2VfZmFjZV9tb3VzZV9mcmFtZSkgKi8KICAgTU9VU0VfSExfSU5GTyAo ZiktPm1vdXNlX2ZhY2VfZGVmZXIgPSAwOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gTlVMTDsK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAKQEAgLTMyMzUsNiArNDI5Nywy OCBAQCBOb3RlIHRoYXQgQ1VSU09SX1dJRFRIIGlzIG1lYW5pbmdmdWwgb25seSBmb3IgKGgpYmFy IGN1cnNvcnMuCiAKICAgICAgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCiAgICAgICAgIHsKKworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIGNh c2UgUklHSFRfRlJJTkdFX0JJVE1BUDoKKyAgICAgIGJyZWFrOworICAgIGNhc2UgTEVGVF9GUklO R0VfQklUTUFQOgorICAgICAgYnJlYWs7CisgICAgY2FzZSBOT19GUklOR0VfQklUTUFQOgorICAg ICAgYnJlYWs7CisgICAgY2FzZSBGUkFNRURfQk9YX0NVUlNPUjoKKyAgICAgIC8qIFRoaXMgZmVh dHVyZSBoYXMgYmVlbiBkZWxpYmVyYXRlbHkgZGlzYWJsZWQgZm9yIHRoZSB0aW1lIGJlaW5nLiAq LworICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICBbaG9sbG93X2NvbG9yIHNldF07CisgICAg ICBOU1JlY3RGaWxsIChOU0luc2V0UmVjdCAociwgMSwgMSkpOworICAgICAgW0ZSQU1FX0NVUlNP Ul9DT0xPUiAoZikgc2V0XTsKKyAgICAgIGJyZWFrOworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKworCiAgICAgICAgIGNhc2UgREVGQVVMVF9DVVJTT1I6CiAgICAgICAgIGNhc2UgTk9fQ1VS U09SOgogICAgICAgICAgIGJyZWFrOwpAQCAtMzI2MiwxMCArNDM0NiwxOSBAQCBOb3RlIHRoYXQg Q1VSU09SX1dJRFRIIGlzIG1lYW5pbmdmdWwgb25seSBmb3IgKGgpYmFyIGN1cnNvcnMuCiAgICAg ICAgICAgYnJlYWs7CiAgICAgICAgIH0KIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFLUNVUlNPUlMgKi8KKwogICAgICAgLyogRHJhdyB0aGUgY2hhcmFjdGVyIHVuZGVy IHRoZSBjdXJzb3IuICBPdGhlciB0ZXJtcyBvbmx5IGRyYXcKICAgICAgICAgIHRoZSBjaGFyYWN0 ZXIgb24gdG9wIG9mIGJveCBjdXJzb3JzLCBzbyBkbyB0aGUgc2FtZSBoZXJlLiAgKi8KLSAgICAg IGlmIChjdXJzb3JfdHlwZSA9PSBGSUxMRURfQk9YX0NVUlNPUiB8fCBjdXJzb3JfdHlwZSA9PSBI T0xMT1dfQk9YX0NVUlNPUikKLSAgICAgICAgZHJhd19waHlzX2N1cnNvcl9nbHlwaCAodywgZ2x5 cGhfcm93LCBEUkFXX0NVUlNPUik7CisgIGlmIChjdXJzb3JfdHlwZSA9PSBGUkFNRURfQk9YX0NV UlNPUgorICAgICAgfHwgY3Vyc29yX3R5cGUgPT0gRklMTEVEX0JPWF9DVVJTT1IKKyAgICAgIHx8 IGN1cnNvcl90eXBlID09IEhPTExPV19CT1hfQ1VSU09SKQorICAgIGRyYXdfcGh5c19jdXJzb3Jf Z2x5cGggKHcsIGdseXBoX3JvdywgRFJBV19DVVJTT1IpOworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKwogCiAgICAgICBuc19yZXNldF9jbGlwcGluZyAoZik7CiAgICAgfQpAQCAtNDgwMyw2 ICs1ODk2LDE3IEBAIGluIGNlcnRhaW4gc2l0dWF0aW9ucyAocmFwaWQgaW5jb21pbmcgZXZlbnRz KS4KICAgICAgIGJhciA9IFtbRW1hY3NTY3JvbGxlciBhbGxvY10gaW5pdEZyYW1lOiByIHdpbmRv dzogd2luXTsKICAgICAgIHdzZXRfdmVydGljYWxfc2Nyb2xsX2JhciAod2luZG93LCBtYWtlX21p bnRfcHRyIChiYXIpKTsKICAgICAgIHVwZGF0ZV9wID0gWUVTOworCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICAvKiBUaGlzIGlzIG9u bHkgZm9yIGRlYnVnZ2luZyBwdXJwb3Nlcy4gKi8KKyAgICAgIFtiYXIgbWNfc2V0X3JlY3Rhbmds ZTogcl07CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICB9CiAgIGVsc2UKICAg ICB7CkBAIC00ODEwLDEyICs1OTE0LDMwIEBAIGluIGNlcnRhaW4gc2l0dWF0aW9ucyAocmFwaWQg aW5jb21pbmcgZXZlbnRzKS4KICAgICAgIGJhciA9IFhOU19TQ1JPTExfQkFSICh3aW5kb3ctPnZl cnRpY2FsX3Njcm9sbF9iYXIpOwogICAgICAgb2xkUmVjdCA9IFtiYXIgZnJhbWVdOwogICAgICAg ci5zaXplLndpZHRoID0gb2xkUmVjdC5zaXplLndpZHRoOworCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCiAgICAgICBpZiAoRlJBTUVfTElWRV9Q IChmKSAmJiAhTlNFcXVhbFJlY3RzIChvbGRSZWN0LCByKSkKICAgICAgICAgeworICAgICAgICAg IC8qIFRoZSBtYWluIHdpbmRvdyBoYXMgcHJvYmFibHkgYmVlbiByZXNpemVkLiAgR3JhY2lvdXNs eSBkZWxldGUgdGhlCisgICAgICAgICAgb2xkIHNjcm9sbCBiYXIgd2l0aG91dCByZXBhaW50aW5n IGl0cyByZWN0YW5nbGU7IGFuZCwgY3JlYXRlIGEgbmV3CisgICAgICAgICAgc2Nyb2xsIGJhciBl bHNld2hlcmUuKi8KICAgICAgICAgICBpZiAob2xkUmVjdC5vcmlnaW4ueCAhPSByLm9yaWdpbi54 KQorICAgICAgICAgICAgewogICAgICAgICAgICAgICBuc19jbGVhcl9mcmFtZV9hcmVhIChmLCBs ZWZ0LCB0b3AsIHdpZHRoLCBoZWlnaHQpOworICAgICAgICAgICAgICBbYmFyIG1jX2p1ZGdlXTsK KyAgICAgICAgICAgICAgYmFyID0gW1tFbWFjc1Njcm9sbGVyIGFsbG9jXSBpbml0RnJhbWU6IHIg d2luZG93OiB3aW5dOworICAgICAgICAgICAgICB3c2V0X3ZlcnRpY2FsX3Njcm9sbF9iYXIgKHdp bmRvdywgbWFrZV9taW50X3B0ciAoYmFyKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBl bHNlCiAgICAgICAgICAgW2JhciBzZXRGcmFtZTogcl07CiAgICAgICAgIH0KKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogICAgIH0KIAogICBpZiAodXBkYXRlX3ApCkBAIC00OTc1LDkg KzYwOTcsNTIgQEAgaW4gY2VydGFpbiBzaXR1YXRpb25zIChyYXBpZCBpbmNvbWluZyBldmVudHMp LgogICAgIHsKICAgICAgIHZpZXcgPSBbc3Vidmlld3Mgb2JqZWN0QXRJbmRleDogaV07CiAgICAg ICBpZiAoIVt2aWV3IGlzS2luZE9mQ2xhc3M6IFtFbWFjc1Njcm9sbGVyIGNsYXNzXV0pIGNvbnRp bnVlOwotICAgICAgaWYgKFt2aWV3IGp1ZGdlXSkKKworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAvKiBgWFNFVFdJTkRPVycgd2lsbCBzb21l dGltZXMgY2F1c2UgRW1hY3MgdG8gY3Jhc2ggd2hlbiBydW5uaW5nIHVuZGVyIGdkYiBldmVuCisg IHRob3VnaCAodyAhPSBOVUxMKS4gIFRoZXJlZm9yZSwgd2UgY2Fubm90IHJlbGlhYmx5IHVzZSBg V0lORE9XX0xJVkVfUCcuICovCisgIHN0cnVjdCB3aW5kb3cgKncgPSBbdmlldyBtY19nZXRfd2lu ZG93XTsKKyAgaWYgKHcgIT0gTlVMTAorICAgICAgJiYgTklMUCAody0+Y29udGVudHMpKQorICAg IHsKKyAgICAgIEJPT0wgZGVidWdfcCA9IGZhbHNlOworICAgICAgTlNSZWN0IHIwID0gW3ZpZXcg bWNfZ2V0X3JlY3RhbmdsZV07CisgICAgICBpbnQgeDAgPSBOU01pblggKHIwKTsKKyAgICAgIGlu dCB5MCA9IE5TTWluWSAocjApOworICAgICAgaW50IHdkMCA9IE5TV2lkdGggKHIwKTsKKyAgICAg IGludCBoMCA9IE5TSGVpZ2h0IChyMCk7CisgICAgICBpbnQgd2luZG93X3ksIHdpbmRvd19oZWln aHQ7CisgICAgICB3aW5kb3dfYm94ICh3LCBBTllfQVJFQSwgMCwgJndpbmRvd195LCAwLCAmd2lu ZG93X2hlaWdodCk7CisgICAgICBpbnQgdG9wID0gd2luZG93X3k7CisgICAgICBpbnQgaGVpZ2h0 ID0gd2luZG93X2hlaWdodDsKKyAgICAgIGludCB3aWR0aCA9IFdJTkRPV19DT05GSUdfU0NST0xM X0JBUl9DT0xTICh3KSAqIEZSQU1FX0NPTFVNTl9XSURUSCAoZik7CisgICAgICBpbnQgbGVmdCA9 IFdJTkRPV19TQ1JPTExfQkFSX0FSRUFfWCAodyk7CisgICAgICBOU1JlY3QgcjEgPSBOU01ha2VS ZWN0IChsZWZ0LCB0b3AsIHdpZHRoLCBoZWlnaHQpOworICAgICAgLyogVGhlIHBhcmVudCB2aWV3 IGlzIGZsaXBwZWQsIHNvIHdlIG5lZWQgdG8gZmxpcCB5IHZhbHVlLiAqLworICAgICAgRW1hY3NW aWV3ICpmcmFtZV92aWV3ID0gRlJBTUVfTlNfVklFVyAoZik7CisgICAgICBOU1JlY3QgdiA9IFtm cmFtZV92aWV3IGZyYW1lXTsKKyAgICAgIHIxLm9yaWdpbi55ID0gKHYuc2l6ZS5oZWlnaHQgLSBy MS5zaXplLmhlaWdodCAtIHIxLm9yaWdpbi55KTsKKyAgICAgIGludCB4MSA9IE5TTWluWCAocjEp OworICAgICAgaW50IHkxID0gTlNNaW5ZIChyMSk7CisgICAgICBpbnQgd2QxID0gTlNXaWR0aCAo cjEpOworICAgICAgaW50IGgxID0gTlNIZWlnaHQgKHIxKTsKKyAgICAgIGlmIChkZWJ1Z19wKQor ICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIlcyAtLSBERUFEOlxuXAorICAgICAgICB4MC94MSAo JWQvJWQpIHwgeTAveTEgKCVkLyVkKSB8IHdkMC93ZDEgKCVkLyVkKSB8IGgwL2gxICglZC8lZClc biIsCisgICAgICAgIG1jX3dpbmRvdyAodyksIHgwLCB4MSwgeTAsIHkxLCB3ZDAsIHdkMSwgaDAs IGgxKTsKKyAgICAgIGlmIChbdmlldyBtY19qdWRnZV0pCiAgICAgICAgIHJlbW92ZWQgPSBZRVM7 CiAgICAgfQorICAgIGVsc2UgaWYgKFt2aWV3IGp1ZGdlXSkKKyAgICAgIHJlbW92ZWQgPSBZRVM7 CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKKyAgICB9CiAKICAgaWYgKHJlbW92ZWQp CiAgICAgW2V2aWV3IHVwZGF0ZUZyYW1lU2l6ZTogTk9dOwpAQCAtNTEwNiw2ICs2MjcxLDIxIEBA IHN0YXRpYyBMaXNwX09iamVjdCBuc19zdHJpbmdfdG9fbGlzcG1vZCAoY29uc3QgY2hhciAqcykK IGV4dGVybiBmcmFtZV9wYXJtX2hhbmRsZXIgbnNfZnJhbWVfcGFybV9oYW5kbGVyc1tdOwogc3Rh dGljIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlIG5zX3JlZGlzcGxheV9pbnRlcmZhY2UgPQog eworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLwor CisvKiBgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYG5zdGVybS5tYCBtdXN0IGJlIGluIHRoZSBl eGFjdCBzYW1lIG9yZGVyIGFzIHRoZQorYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGBkaXNwZXh0 ZXJuLmhgISAqLworCisgIG1jX3hfd3JpdGVfZ2x5cGhzLAorICBtY19uc19kcmF3X3dpbmRvd19j dXJzb3IsCisgIG1jX25zX2RyYXdfZ2x5cGhfc3RyaW5nLAorCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKworCiAgIG5zX2ZyYW1lX3Bhcm1faGFuZGxlcnMsCiAgIHhfcHJvZHVjZV9nbHlwaHMs CiAgIHhfd3JpdGVfZ2x5cGhzLApAQCAtODcyMSw2ICs5OTAxLDQ5IEBAIC0gKEJPT0wpY2FuQmVj b21lTWFpbldpbmRvdwogCiBAaW1wbGVtZW50YXRpb24gRW1hY3NTY3JvbGxlcgogCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCistICh2b2lkKW1j X3NldF9yZWN0YW5nbGU6IChOU1JlY3QpcmVjdAoreworICBtY19yZWN0YW5nbGUgPSByZWN0Owor fQorCistIChOU1JlY3QpbWNfZ2V0X3JlY3RhbmdsZQoreworICByZXR1cm4gbWNfcmVjdGFuZ2xl OworfQorCistIChzdHJ1Y3Qgd2luZG93ICopbWNfZ2V0X3dpbmRvdworeworICByZXR1cm4gd2lu ZG93OworfQorCistIChib29sKW1jX2p1ZGdlCit7CisgIE5TVFJBQ0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dGgsIGggPSBzLT5oZWlnaHQ7CisgICAgUkVD VCByOworICAgICAgICAgIEhEQyBoZGMgPSBzLT5oZGM7CisgICAgaWYgKCFzLT5yb3ctPnJldmVy c2VkX3ApCisgICAgICB4ICs9IHdpZHRoOworICAgIGVsc2UKKyAgICAgIHggPSBzLT54OworICAg IGlmIChzLT5yb3ctPm1vdXNlX2ZhY2VfcAorICAgICAgICAmJiBjdXJzb3JfaW5fbW91c2VfZmFj ZV9wIChzLT53KSkKKyAgICAgIHsKKyAgICAgICAgeF9zZXRfbW91c2VfZmFjZV9nYyAocyk7Cisg ICAgICAgIGdjID0gcy0+Z2M7CisgICAgICB9CisgICAgZWxzZQorICAgICAgZ2MgPSBzLT5mYWNl LT5nYzsKKyAgICBnZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgJnIpOworICAgIHczMl9z ZXRfY2xpcF9yZWN0YW5nbGUgKGhkYywgJnIpOworI2lmIDAgLyogVE9ETzogc3RpcHBsZSAqLwor ICAgIGlmIChzLT5mYWNlLT5zdGlwcGxlKQorICAgICAgeworICAgICAgICAvKiBGaWxsIGJhY2tn cm91bmQgd2l0aCBhIHN0aXBwbGUgcGF0dGVybi4gICovCisgICAgICAgIFhTZXRGaWxsU3R5bGUg KHMtPmRpc3BsYXksIGdjLCBGaWxsT3BhcXVlU3RpcHBsZWQpOworICAgICAgICBYRmlsbFJlY3Rh bmdsZSAocy0+ZGlzcGxheSwgcy0+d2luZG93LCBnYywgeCwgeSwgdywgaCk7CisgICAgICAgIFhT ZXRGaWxsU3R5bGUgKHMtPmRpc3BsYXksIGdjLCBGaWxsU29saWQpOworICAgICAgfQorICAgIGVs c2UKKyNlbmRpZgorICAgICAgICAgICAgeworICAgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChz LT5mLCBzLT5oZGMsIGdjLT5iYWNrZ3JvdW5kLCB4LCB5LCB3LCBoKTsKKyAgICAgICAgICAgIH0K KyAgICAgICAgfQorICAgIH0KKyAgZWxzZ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0aXZlX3ApID8gWEZJWE5VTSAoRnJlZ2lvbl9iZWdpbm5p bmcgKCkpIDogLTE7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2VuZCA9IChyZWdpb25fYWN0aXZl X3ApID8gWEZJWE5VTSAoRnJlZ2lvbl9lbmQgKCkpIDogLTE7CisgICAgICBwdHJkaWZmX3Qgb3Bv aW50X3B0ID0gKHcgPT0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93KSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IFBUCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBYRklYTlVN IChGbWFya2VyX3Bvc2l0aW9uICh3LT5wb2ludG0pKTsKKyAgICAgIGJvb2wgcmVnaW9uX2luX2Jv dW5kc19wID0gKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgb3BvaW50X3B0ID49IHJlZ2lvbl9iZWdpbm5pbmcKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIG9wb2ludF9wdCA8IHJlZ2lvbl9lbmQpOworICAgICAgaWYgKGN1cnNv cl9nbHlwaC0+dHlwZSAhPSBJTUFHRV9HTFlQSCAmJiByZWQgPj0gMCAmJiBibHVlID49IDAgJiYg Z3JlZW4gPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBg Zi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MnIGJ5IGJvcnJvd2luZyB0aGUKKyAgICAgICAg ICBmdW5jdGlvbmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHczMmZucy5jLiAgKi8KKyAgICAgICAg ICBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICYmIHJlZ2lvbl9pbl9ib3VuZHNf cAorICAgICAgICAgICAgICAmJiBhY3RpdmVfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgZW51bSB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SA+PSAwICYmIGdyZWVuID49IDApCisgICAgICAgICAgeworICAgICAg ICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9w aXhlbCcuICAqLworICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwg PSBjb2xvcl9waXhlbDsKKyAgICAgICAgICAgIG1jX3czMl9kcmF3X2hvbGxvd19jdXJzb3IgKHcs IG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAgICAgICAg ICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3Bp eGVsOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAg ICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3Jf Z2MnIGJ5IGJvcnJvd2luZyB0aGUKKyAgICAgICAgICAgICAgZnVuY3Rpb25hbGl0eSBvZiBgeF9t YWtlX2djJyBpbiB3MzJmbnMuYy4gICovCisgICAgICAgICAgICAgIGlmIChyZWdpb25fYWN0aXZl X3AKKyAgICAgICAgICAgICAgICAgICYmIHJlZ2lvbl9pbl9ib3VuZHNfcAorICAgICAgICAgICAg ICAgICAgJiYgYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg ZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRf ZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXJlZ2lvbi1mYWNlIiksIHRy dWUpOworICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfcmVnaW9u X2ZhY2UgP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xvY2tfaW5wdXQg KCk7CisgICAgICAgICAgICAgIC8qIEZvcmNlIGBtY193MzJfc2V0X2N1cnNvcl9nYycgdG8gdXNl IGBzLT5mLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycuICAqLworICAgICAgICAgICAgICBi b29sIGN1cnNvcl9nY19wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5 cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZCwgZ3JlZW4sIGJsdWUsIGdseXBoX2ZsYXZv ciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOworICAgICAgICAgICAg ICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYyA9IG9yaWdpbmFsX2N1cnNvcl9nYzsKKyAg ICAgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgbWNfdzMyX2RyYXdf aG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywg d2QsIGgpOworICAgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgSE9M TE9XX0JPWF9DVVJTT1I6CisgICAgeworICAgICAgaWYgKHJlZCA+PSAwICYmIGJsdWUgPj0gMCAm JiBncmVlbiA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNr IGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcuICAqLworICAgICAgICAgIGYtPm91 dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gY29sb3JfcGl4ZWw7CisgICAgICAgICAgbWNf dzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIG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pLCBtYXNrLCAmZ2NfdmFsdWVzKTsKKyAgICAgICAgICAvKiBGb3Jj ZSBgbWNfdzMyX3NldF9jdXJzb3JfZ2MnIHRvIHVzZSBgcy0+Zi0+b3V0cHV0X2RhdGEudzMyLT5j dXJzb3JfZ2MnLiAgKi8KKyAgICAgICAgICBib29sIGN1cnNvcl9nY19wID0gdHJ1ZTsKKyAgICAg ICAgICBtY19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4 LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWQsIGdyZWVu LCBibHVlLCBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsIGN1cnNvcl9n Y19wKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYyA9IG9yaWdpbmFs X2N1cnNvcl9nYzsKKyAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgICB9CisgICAg ICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBib29sIGN1cnNvcl9nY19wID0gZmFs c2U7CisgICAgICAgICAgICBtY19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERS QVdfQ1VSU09SLCB4LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHJlZCwgZ3JlZW4sIGJsdWUsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3Rp dmVfcCwgY3Vyc29yX2djX3ApOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAg ICBjYXNlIEJBUl9DVVJTT1I6CisgICAgeworICAgICAgaWYgKHJlZCA+PSAwICYmIGJsdWUgPj0g MCAmJiBncmVlbiA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlq YWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcuICAqLworICAgICAgICAgIGYt Pm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gY29sb3JfcGl4ZWw7CisgICAgICAgICAg Ym9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IHRydWU7CisgICAgICAgICAgbWNfdzMy X2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBv cywgd2QsIGgsIGN1cnNvcl93aWR0aCwgQkFSX0NVUlNPUiwgY3Vyc29yX2djX2ludmlzaWJsZV9v a2F5X3ApOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3Jp Z2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7 CisgICAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7Cisg ICAgICAgICAgICBtY193MzJfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngs IHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwgY3Vyc29yX3dpZHRoLCBCQVJfQ1VSU09SLCBjdXJz b3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAg fQorICAgIGNhc2UgSEJBUl9DVVJTT1I6CisgICAgeworICAgICAgaWYgKHJlZCA+PSAwICYmIGJs dWUgPj0gMCAmJiBncmVlbiA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJp bHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcuICAqLworICAgICAg ICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gY29sb3JfcGl4ZWw7CisgICAg ICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IHRydWU7CisgICAgICAgICAg bWNfdzMyX2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBv cywgdnBvcywgd2QsIGgsIGN1cnNvcl93aWR0aCwgSEJBUl9DVVJTT1IsIGN1cnNvcl9nY19pbnZp c2libGVfb2theV9wKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhl bCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAg ICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IGZh bHNlOworICAgICAgICAgICAgbWNfdzMyX2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3cs IHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsIGN1cnNvcl93aWR0aCwgSEJBUl9DVVJT T1IsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICB9CisgICAgICBicmVh azsKKyAgICB9CisgICAgY2FzZSBOT19DVVJTT1I6CisgICAgICBicmVhazsKKyAgICBkZWZhdWx0 OgorICAgICAgZW1hY3NfYWJvcnQgKCk7CisgIH0KKyAgICB9Cit9CisKKy8qIERyYXcgZ2x5cGgg c3RyaW5nIFMuICAqLworc3RhdGljIHZvaWQKK21jX3czMl9kcmF3X2dseXBoX3N0cmluZyAoc3Ry dWN0IGdseXBoX3N0cmluZyAqcywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3Qg Z2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgIGRvdWJsZSByZWQsIGRv dWJsZSBncmVlbiwgZG91YmxlIGJsdWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0g bWNfZm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AgICAgICAgICB7CisgICAgICAgICAgICAgIENPTE9SUkVGIGNvbG9yOworICAgICAgICAgICAg ICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgICAgIGNv bG9yID0gcy0+Z2MtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICBjb2xvciA9IHMtPmZhY2UtPnVuZGVybGluZV9jb2xvcjsKKyAgICAgICAgICAgICAgdzMy X2RyYXdfdW5kZXJ3YXZlIChzLCBjb2xvcik7CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxz ZSBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIHRoaWNrbmVzcywgcG9zaXRpb247 CisgICAgICAgICAgICAgIGludCB5OworICAgICAgICAgICAgICBpZiAocy0+cHJldiAmJiBzLT5w cmV2LT5mYWNlLT51bmRlcmxpbmVfcAorICAgICAgICAgICAgICAgICAgJiYgcy0+cHJldi0+ZmFj ZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgIC8qIFdlIHVzZSB0aGUgc2FtZSB1bmRlcmxpbmUgc3R5bGUgYXMg dGhlIHByZXZpb3VzIG9uZS4gICovCisgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSBzLT5w cmV2LT51bmRlcmxpbmVfdGhpY2tuZXNzOworICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBz LT5wcmV2LT51bmRlcmxpbmVfcG9zaXRpb247CisgICAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgLyogR2V0IHRo ZSB1bmRlcmxpbmUgdGhpY2tuZXNzLiAgRGVmYXVsdCBpcyAxIHBpeGVsLiAgKi8KKyAgICAgICAg ICAgICAgICAgIGlmIChzLT5mb250ICYmIHMtPmZvbnQtPnVuZGVybGluZV90aGlja25lc3MgPiAw KQorICAgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSBzLT5mb250LT51bmRlcmxpbmVfdGhp Y2tuZXNzOworICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB0aGlj a25lc3MgPSAxOworICAgICAgICAgICAgICAgICAgaWYgKHhfdW5kZXJsaW5lX2F0X2Rlc2NlbnRf bGluZSkKKyAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+aGVpZ2h0IC0gdGhpY2tu ZXNzKSAtIChzLT55YmFzZSAtIHMtPnkpOworICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgLyogR2V0IHRoZSB1bmRlcmxp bmUgcG9zaXRpb24uICBUaGlzIGlzIHRoZSByZWNvbW1lbmRlZAorICAgICAgICAgICAgICAgICAg ICAgICAgIHZlcnRpY2FsIG9mZnNldCBpbiBwaXhlbHMgZnJvbSB0aGUgYmFzZWxpbmUgdG8gdGhl IHRvcCBvZgorICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSB1bmRlcmxpbmUuICBUaGlzIGlz IGEgc2lnbmVkIHZhbHVlIGFjY29yZGluZyB0byB0aGUKKyAgICAgICAgICAgICAgICAgICAgICAg ICBzcGVjcywgYW5kIGl0cyBkZWZhdWx0IGlzCisgICAgICAgICAgICAgICAgICAgICAgICAgUk9V TkQgKChtYXhpbXVtX2Rlc2NlbnQpIC8gMiksIHdpdGgKKyAgICAgICAgICAgICAgICAgICAgICAg ICBST1VORCAoeCkgPSBmbG9vciAoeCArIDAuNSkgICovCisgICAgICAgICAgICAgICAgICAgICAg aWYgKHhfdXNlX3VuZGVybGluZV9wb3NpdGlvbl9wcm9wZXJ0aWVzCisgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIHMtPmZvbnQgJiYgcy0+Zm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uID49IDAp CisgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPmZvbnQtPnVuZGVybGluZV9w b3NpdGlvbjsKKyAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChzLT5mb250KQorICAgICAg ICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+Zm9udC0+ZGVzY2VudCArIDEpIC8gMjsK KyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBtYXgg KHBvc2l0aW9uLCB1bmRlcmxpbmVfbWluaW11bV9vZmZzZXQpOworICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgICAgLyogQ2hlY2sgdGhlIHNhbml0eSBvZiB0aGlja25lc3MgYW5kIHBvc2l0 aW9uLiAgV2Ugc2hvdWxkCisgICAgICAgICAgICAgICAgIGF2b2lkIGRyYXdpbmcgdW5kZXJsaW5l IG91dCBvZiB0aGUgY3VycmVudCBsaW5lIGFyZWEuICAqLworICAgICAgICAgICAgICBpZiAocy0+ eSArIHMtPmhlaWdodCA8PSBzLT55YmFzZSArIHBvc2l0aW9uKQorICAgICAgICAgICAgICAgIHBv c2l0aW9uID0gKHMtPmhlaWdodCAtIDEpIC0gKHMtPnliYXNlIC0gcy0+eSk7CisgICAgICAgICAg ICAgIGlmIChzLT55ICsgcy0+aGVpZ2h0IDwgcy0+eWJhc2UgKyBwb3NpdGlvbiArIHRoaWNrbmVz cykKKyAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAocy0+eSArIHMtPmhlaWdodCkgLSAocy0+ eWJhc2UgKyBwb3NpdGlvbik7CisgICAgICAgICAgICAgIHMtPnVuZGVybGluZV90aGlja25lc3Mg PSB0aGlja25lc3M7CisgICAgICAgICAgICAgIHMtPnVuZGVybGluZV9wb3NpdGlvbiA9cG9zaXRp b247CisgICAgICAgICAgICAgIHkgPSBzLT55YmFzZSArIHBvc2l0aW9uOworICAgICAgICAgICAg ICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgICAgIHcz Ml9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+Z2MtPmZvcmVncm91bmQsIHMtPngsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgeSwgcy0+d2lkdGgsIDEpOworICAgICAgICAgICAg ICBlbHNlCisgICAgICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5m YWNlLT51bmRlcmxpbmVfY29sb3IsIHMtPngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgeSwgcy0+d2lkdGgsIDEpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAvKiBE cmF3IG92ZXJsaW5lLiAgKi8KKyAgICAgIGlmIChzLT5mYWNlLT5vdmVybGluZV9wKQorICAgICAg ICB7CisgICAgICAgICAgdW5zaWduZWQgbG9uZyBkeSA9IDAsIGggPSAxOworICAgICAgICAgIGlm IChzLT5mYWNlLT5vdmVybGluZV9jb2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgIHczMl9m aWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+Z2MtPmZvcmVncm91bmQsIHMtPngsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICBzLT55ICsgZHksIHMtPndpZHRoLCBoKTsKKyAgICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5mYWNl LT5vdmVybGluZV9jb2xvciwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+ eSArIGR5LCBzLT53aWR0aCwgaCk7CisgICAgICAgIH0KKyAgICAgIC8qIERyYXcgc3RyaWtlLXRo cm91Z2guICAqLworICAgICAgaWYgKHMtPmZhY2UtPnN0cmlrZV90aHJvdWdoX3AKKyAgICAgICAg ICAmJiAhRk9OVF9URVhUTUVUUklDIChzLT5mb250KS50bVN0cnVja091dCkKKyAgICAgICAgewor ICAgICAgICAgIHVuc2lnbmVkIGxvbmcgaCA9IDE7CisgICAgICAgICAgdW5zaWduZWQgbG9uZyBk eSA9IChzLT5oZWlnaHQgLSBoKSAvIDI7CisgICAgICAgICAgaWYgKHMtPmZhY2UtPnN0cmlrZV90 aHJvdWdoX2NvbG9yX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+ Ziwgcy0+aGRjLCBzLT5nYy0+Zm9yZWdyb3VuZCwgcy0+eCwgcy0+eSArIGR5LAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgcy0+d2lkdGgsIGgpOworICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgIHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+ZmFjZS0+c3RyaWtlX3Rocm91Z2hf Y29sb3IsIHMtPngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBzLT55ICsgZHksIHMtPndp ZHRoLCBoKTsKKyAgICAgICAgfQorICAgICAgLyogRHJhdyByZWxpZWYgaWYgbm90IHlldCBkcmF3 bi4gICovCisgICAgICBpZiAoIXJlbGllZl9kcmF3bl9wICYmIHMtPmZhY2UtPmJveCAhPSBGQUNF X05PX0JPWCkKKyAgICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19ib3ggKHMpOworICAgICAgaWYg KHMtPnByZXYpCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpwcmV2 OworICAgICAgICAgIGZvciAocHJldiA9IHMtPnByZXY7IHByZXY7IHByZXYgPSBwcmV2LT5wcmV2 KQorICAgICAgICAgICAgaWYgKHByZXYtPmhsICE9IHMtPmhsCisgICAgICAgICAgICAgICAgJiYg cHJldi0+eCArIHByZXYtPndpZHRoICsgcHJldi0+cmlnaHRfb3ZlcmhhbmcgPiBzLT54KQorICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogQXMgcHJldiB3YXMgZHJhd24gd2hpbGUg Y2xpcHBlZCB0byBpdHMgb3duIGFyZWEsIHdlCisgICAgICAgICAgICAgICAgICAgbXVzdCBkcmF3 IHRoZSByaWdodF9vdmVyaGFuZyBwYXJ0IHVzaW5nIHMtPmhsIG5vdy4gICovCisgICAgICAgICAg ICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIHNhdmUgPSBwcmV2LT5obDsKKyAgICAgICAgICAg ICAgICBwcmV2LT5obCA9IHMtPmhsOworICAgICAgICAgICAgICAgIG1jX3czMl9zZXRfZ2x5cGhf c3RyaW5nX2djIChwcmV2LCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgICAgICAgeF9zZXRfZ2x5 cGhfc3RyaW5nX2NsaXBwaW5nX2V4YWN0bHkgKHMsIHByZXYpOworICAgICAgICAgICAgICAgIGlm IChwcmV2LT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBIKQorICAgICAgICAgICAgICAg ICAgeF9kcmF3X2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChwcmV2KTsKKyAgICAgICAgICAgICAg ICBlbHNlCisgICAgICAgICAgICAgICAgICB4X2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19m b3JlZ3JvdW5kIChwcmV2KTsKKyAgICAgICAgICAgICAgICB3MzJfc2V0X2NsaXBfcmVjdGFuZ2xl IChwcmV2LT5oZGMsIE5VTEwpOworICAgICAgICAgICAgICAgIHByZXYtPmhsID0gc2F2ZTsKKyAg ICAgICAgICAgICAgICBwcmV2LT5udW1fY2xpcHMgPSAwOworICAgICAgICAgICAgICB9CisgICAg ICAgIH0KKyAgICAgIGlmIChzLT5uZXh0KQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGds eXBoX3N0cmluZyAqbmV4dDsKKyAgICAgICAgICBmb3IgKG5leHQgPSBzLT5uZXh0OyBuZXh0OyBu ZXh0ID0gbmV4dC0+bmV4dCkKKyAgICAgICAgICAgIGlmIChuZXh0LT5obCAhPSBzLT5obAorICAg ICAgICAgICAgICAgICYmIG5leHQtPnggLSBuZXh0LT5sZWZ0X292ZXJoYW5nIDwgcy0+eCArIHMt PndpZHRoKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogQXMgbmV4dCB3aWxs IGJlIGRyYXduIHdoaWxlIGNsaXBwZWQgdG8gaXRzIG93biBhcmVhLAorICAgICAgICAgICAgICAg ICAgIHdlIG11c3QgZHJhdyB0aGUgbGVmdF9vdmVyaGFuZyBwYXJ0IHVzaW5nIHMtPmhsIG5vdy4g ICovCisgICAgICAgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIHNhdmUgPSBuZXh0LT5o bDsKKyAgICAgICAgICAgICAgICBuZXh0LT5obCA9IHMtPmhsOworICAgICAgICAgICAgICAgIG1j X3czMl9zZXRfZ2x5cGhfc3RyaW5nX2djIChuZXh0LCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAg ICAgICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nX2V4YWN0bHkgKHMsIG5leHQpOworICAg ICAgICAgICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBIKQor ICAgICAgICAgICAgICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChuZXh0KTsK KyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICB4X2RyYXdfY29tcG9zaXRl X2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChuZXh0KTsKKyAgICAgICAgICAgICAgICB3MzJfc2V0 X2NsaXBfcmVjdGFuZ2xlIChuZXh0LT5oZGMsIE5VTEwpOworICAgICAgICAgICAgICAgIG5leHQt PmhsID0gc2F2ZTsKKyAgICAgICAgICAgICAgICBuZXh0LT5udW1fY2xpcHMgPSAwOworICAgICAg ICAgICAgICAgIG5leHQtPmNsaXBfaGVhZCA9IHMtPm5leHQ7CisgICAgICAgICAgICAgIH0KKyAg ICAgICAgfQorICAgIH0KKyAgLyogUmVzZXQgY2xpcHBpbmcuICAqLworICB3MzJfc2V0X2NsaXBf cmVjdGFuZ2xlIChzLT5oZGMsIE5VTEwpOworICBzLT5udW1fY2xpcHMgPSAwOworfQorCisvKiBl bmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogLyog RnJpbmdlIGJpdG1hcHMuICAqLwogCiBzdGF0aWMgaW50IG1heF9mcmluZ2VfYm1wID0gMDsKQEAg LTU0NSw2ICsxMzc4LDE1IEBAIHhfdXBkYXRlX2JlZ2luIChzdHJ1Y3QgZnJhbWUgKmYpCiAgIGlm ICghIEZSQU1FX1czMl9QIChmKSkKICAgICByZXR1cm47CiAKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUg PSBmOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIFJlZ2VuZXJhdGUgZGlz cGxheSBwYWxldHRlIGJlZm9yZSBkcmF3aW5nIGlmIGxpc3Qgb2YgcmVxdWVzdGVkCiAgICAgIGNv bG9ycyBoYXMgY2hhbmdlZC4gKi8KICAgaWYgKGRpc3BsYXlfaW5mby0+cmVnZW5fcGFsZXR0ZSkK QEAgLTc1NCw2ICsxNTk2LDE2IEBAIHhfdXBkYXRlX2VuZCAoc3RydWN0IGZyYW1lICpmKQogCiAg IC8qIE1vdXNlIGhpZ2hsaWdodCBtYXkgYmUgZGlzcGxheWVkIGFnYWluLiAgKi8KICAgTU9VU0Vf SExfSU5GTyAoZiktPm1vdXNlX2ZhY2VfZGVmZXIgPSBmYWxzZTsKKworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGluZ19m cmFtZSA9IE5VTEw7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIH0KIAogCkBAIC00 MDQxLDEzICs0ODkzLDc0IEBAIHczMl9zZXRfdmVydGljYWxfc2Nyb2xsX2JhciAoc3RydWN0IHdp bmRvdyAqdywKIAkgICAgICByZWxlYXNlX2ZyYW1lX2RjIChmLCBoZGMpOwogCSAgICAgIHhfY2xl YXJfdW5kZXJfaW50ZXJuYWxfYm9yZGVyIChmKTsKIAkgICAgfQorCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCisvKiBSRVBBSU5USU5H IFdIRU4gUkVNT1ZJTkcgU0NST0xMIEJBUjoKKworLSBTZXF1ZW5jZSBvZiBFdmVudHM6CisKKyAg LiBgcmVkaXNwbGF5X2ludGVybmFsJyBjYWxscyB0aGUgYGNvbmRlbW5fc2Nyb2xsX2JhcnNfaG9v aycsIHdoaWNoIG1hcmtzIGFsbAorICAgIHNjcm9sbCBiYXJzIGFzIGNhbmRpZGF0ZXMgZm9yIGRl bGV0aW9uLgorCisgIC4gVGhlbiBgcmVkaXNwbGF5X2ludGVybmFsJyBjYWxscyBgcmVkaXNwbGF5 X3d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nQgdG8gcmVwYWlu dCBzbyB0aGF0IHRoZSBuZXcgc2Nyb2xsIGJhcgord2luZG93IGlzIHVwZGF0ZWQuICovCisKICAg ICAgICAgICAvKiBNYWtlIHN1cmUgc2Nyb2xsIGJhciBpcyAidmlzaWJsZSIgYmVmb3JlIG1vdmlu ZywgdG8gZW5zdXJlIHRoZQogICAgICAgICAgICAgIGFyZWEgb2YgdGhlIHBhcmVudCB3aW5kb3cg bm93IGV4cG9zZWQgd2lsbCBiZSByZWZyZXNoZWQuICAqLwotICAgICAgICAgIG15X3Nob3dfd2lu ZG93IChmLCBod25kLCBTV19ISURFKTsKLS8qKiAgICAgICAgICAgTW92ZVdpbmRvdyAoaHduZCwg bGVmdCwgdG9wLCB3aWR0aCwgbWF4IChoZWlnaHQsIDEpLCBUUlVFKTsgKiovCi0JICAvKiBUcnkg dG8gbm90IGRyYXcgb3ZlciBjaGlsZCBmcmFtZXMuICAqLwotCSAgU2V0V2luZG93UG9zIChod25k LCBIV05EX0JPVFRPTSwgbGVmdCwgdG9wLCB3aWR0aCwgbWF4IChoZWlnaHQsIDEpLAotICAgICAg ICAgICAgICAgICAgICAgICAgU1dQX0ZSQU1FQ0hBTkdFRCk7CisgICAgICAgICAgaWYgKGxlZnQg PD0gYmFyLT5sZWZ0KQorICAgICAgICAgICAgbXlfc2hvd193aW5kb3cgKGYsIGh3bmQsIFNXX0hJ REUpOworICAgICAgICAgIE1vdmVXaW5kb3cgKGh3bmQsIGxlZnQsIHRvcCwgd2lkdGgsIG1heCAo aGVpZ2h0LCAxKSwgbGVmdCA8PSBiYXItPmxlZnQpOworCisvKiBlbmQgTVVMVElQTEUtQ1VSU09S UyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKIAogCSAgc2kuY2JTaXplID0gc2l6ZW9m IChzaSk7CiAJICBzaS5mTWFzayA9IFNJRl9SQU5HRTsKQEAgLTQzMTYsNiArNTIyOSwyMSBAQCB3 MzJfanVkZ2Vfc2Nyb2xsX2JhcnMgKHN0cnVjdCBmcmFtZSAqZikKICAgICB7CiAgICAgICBzdHJ1 Y3Qgc2Nyb2xsX2JhciAqYiA9IFhTQ1JPTExfQkFSIChiYXIpOwogCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICAvKiBgRGVzdHJveVdp bmRvdycgd2l0aGluIGB4X3Njcm9sbF9iYXJfcmVtb3ZlJyByZXBhaW50cyB0aGUgcmVjdGFuZ2xl LgorICAgICAgVGhlcmVmb3JlLCB3ZSBmaXJzdCBzZW5kIGEgbWVzc2FnZSB0byBpbmhpYml0IHJl cGFpbnRpbmcuICovCisgICAgICBpZiAoIVdJTkRPV19MSVZFX1AgKGItPndpbmRvdykpCisgICAg ICAgIHsKKyAgICAgICAgICBIV05EIGh3bmQgPSBTQ1JPTExfQkFSX1czMl9XSU5ET1cgKGIpOwor ICAgICAgICAgIFNlbmRNZXNzYWdlIChod25kLCBXTV9TRVRSRURSQVcsIGZhbHNlLCAwKTsKKyAg ICAgICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICB4X3Njcm9sbF9i YXJfcmVtb3ZlIChiKTsKIAogICAgICAgbmV4dCA9IGItPm5leHQ7CkBAIC01OTcyLDYgKzY5MDAs MjUgQEAgdzMyX2RyYXdfd2luZG93X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGds eXBoX3JvdyAqZ2x5cGhfcm93LAogCiAgICAgICBzd2l0Y2ggKGN1cnNvcl90eXBlKQogCXsKKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAg IGNhc2UgUklHSFRfRlJJTkdFX0JJVE1BUDoKKyAgICAgIGJyZWFrOworICAgIGNhc2UgTEVGVF9G UklOR0VfQklUTUFQOgorICAgICAgYnJlYWs7CisgICAgY2FzZSBOT19GUklOR0VfQklUTUFQOgor ICAgICAgYnJlYWs7CisgICAgY2FzZSBGUkFNRURfQk9YX0NVUlNPUjoKKyAgICAgIC8qIFRoaXMg ZmVhdHVyZSBoYXMgYmVlbiBkZWxpYmVyYXRlbHkgZGlzYWJsZWQgZm9yIHRoZSB0aW1lIGJlaW5n LiAqLworICAgICAgeF9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIGdseXBoX3Jvdyk7CisgICAgICBi cmVhazsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCWNhc2UgSE9MTE9XX0JPWF9D VVJTT1I6CiAJICB4X2RyYXdfaG9sbG93X2N1cnNvciAodywgZ2x5cGhfcm93KTsKIAkgIGJyZWFr OwpAQCAtNzA5MSw2ICs4MDM4LDIxIEBAIGV4dGVybiBmcmFtZV9wYXJtX2hhbmRsZXIgdzMyX2Zy YW1lX3Bhcm1faGFuZGxlcnNbXTsKIAogc3RhdGljIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNl IHczMl9yZWRpc3BsYXlfaW50ZXJmYWNlID0KIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyogYHJlZGlzcGxheV9pbnRlcmZhY2UnIGlu IGB3MzJ0ZXJtLmNgIG11c3QgYmUgaW4gdGhlIGV4YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitgcmVk aXNwbGF5X2ludGVyZmFjZScgaW4gYGRpc3BleHRlcm4uaGAhICovCisKKyAgbWNfeF93cml0ZV9n bHlwaHMsCisgIG1jX3czMl9kcmF3X3dpbmRvd19jdXJzb3IsCisgIG1jX3czMl9kcmF3X2dseXBo X3N0cmluZywKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICB3MzJfZnJhbWVfcGFy bV9oYW5kbGVycywKICAgeF9wcm9kdWNlX2dseXBocywKICAgeF93cml0ZV9nbHlwaHMsCmRpZmYg LS1naXQgYS9zcmMvd2luZG93LmggYi9zcmMvd2luZG93LmgKaW5kZXggZmRlZjQwNy4uMzY3MGIy MyAxMDA2NDQKLS0tIGEvc3JjL3dpbmRvdy5oCisrKyBiL3NyYy93aW5kb3cuaApAQCAtODgsNiAr ODgsMjMgQEAgZGlzcGxheSB0aGUgbWVudSBiYXIgb3IgdGhlIHRvb2wgYmFyICh3aGVuIEVtYWNz IHVzZXMgdG9vbGtpdHMgdGhhdAogZG9uJ3QgZGlzcGxheSB0aGVpciBvd24gbWVudSBiYXIgYW5k IHRvb2wgYmFyKSBvciBhIHRvb2x0aXAgaW4gYQogdG9vbHRpcCBmcmFtZSAod2hlbiB0b29sdGlw cyBhcmUgbm90IGRpc3BsYXkgYnkgdGhlIHRvb2xraXQpLiAgKi8KIAorCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyogU3VmZml4ZXMgZm9yIHRo ZSBgbWNgIHdpbmRvdyBwb2ludGVyIHByZWZpeC4gKi8KK3N0cnVjdCBtdWx0aXBsZV9jdXJzb3Jz Cit7CisgIC8qIFBpeGVsIHBvc2l0aW9uICh3aW5kb3cgcmVsYXRpdmUpIG9mIGhvcml6b250YWwv dmVydGljYWwgcnVsZXJzLiAqLworICBpbnQgZmNfeDsKKworICAvKiBUaGUgcmVjb3JkZWQgcGl4 ZWwgd2lkdGggb2YgdGhlIGxhc3QgbGluZSBudW1iZXIgZHJhd24gZHVyaW5nIHJlZGlzcGxheSAq LworICBpbnQgbG51bV9waXhlbF93aWR0aDsKK307CisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKIHN0cnVjdCBjdXJzb3JfcG9zCiB7CiAgIC8qIFBpeGVsIHBvc2l0aW9uLiAgVGhlc2Ug YXJlIGFsd2F5cyB3aW5kb3cgcmVsYXRpdmUuICAqLwpAQCAtMjA5LDYgKzIyNiwzMyBAQCBzdHJ1 Y3Qgd2luZG93CiAgICAgLyogQW4gYWxpc3Qgd2l0aCBwYXJhbWV0ZXJzLiAgKi8KICAgICBMaXNw X09iamVjdCB3aW5kb3dfcGFyYW1ldGVyczsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIExpc3BfT2JqZWN0IG1jX3RlbXBfY2FjaGU7 CisKKyAgICAvKiBUaGUgY2FjaGUgZm9yIG11bHRpcGxlIGZha2UgY3Vyc29ycy4gKi8KKyAgICBM aXNwX09iamVjdCBtY19jYWNoZTsKKworICAgIC8qIFRoZSBjYWNoZSBmb3IgY3Jvc3NoYWlycy4g Ki8KKyAgICBMaXNwX09iamVjdCBjaF9jYWNoZTsKKworICAgIC8qIFRoZSBjYWNoZSBmb3Igdmlz aWJsZSBmaWxsIGNvbHVtbi4gKi8KKyAgICBMaXNwX09iamVjdCBmY19jYWNoZTsKKworICAgIC8q IEwuUy5MLiBjb2xvciB2ZWN0b3IgdXNlZCBieSBjcm9zc2hhaXJzLiAqLworICAgIExpc3BfT2Jq ZWN0IGNoX2ZvcmVncm91bmQ7CisKKyAgICAvKiBMLlMuTC4gY29sb3IgdmVjdG9yIHVzZWQgYnkg dmlzaWJsZSBmaWxsIGNvbHVtbi4gKi8KKyAgICBMaXNwX09iamVjdCBmY19mb3JlZ3JvdW5kOwor CisvKiBOT1RFOiAgQXMgb2YgMDQvMDgvMjAxOSAoYTAzOGRmNzdkZTdiMWFhMmQ3M2E2NDc4NDkz Yjg4MzhiNTllNDk4MiksIHRoZSBMQVNUCisgICBMaXNwX09iamVjdCBtdXN0IGJlIGBtb2RlX2xp bmVfaGVscF9lY2hvJy4gKi8KKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgIC8q IFRoZSBoZWxwIGVjaG8gdGV4dCBmb3IgdGhpcyB3aW5kb3cuICBRbmlsIGlmIHRoZXJlJ3Mgbm9u ZS4gICovCiAgICAgTGlzcF9PYmplY3QgbW9kZV9saW5lX2hlbHBfZWNobzsKIApAQCAtMzI0LDYg KzM2OCwxNiBAQCBzdHJ1Y3Qgd2luZG93CiAKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KIAor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAg IC8qIFRoZSBwcmVmaXggZm9yIHdpbmRvdyBwb2ludGVycyByZWxhdGluZyB0byBtdWx0aXBsZSBj dXJzb3JzLiAgKi8KKyAgICBzdHJ1Y3QgbXVsdGlwbGVfY3Vyc29ycyBtYzsKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogICAgIC8qIEN1cnNvciB0eXBlIG9mIGxhc3QgY3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9PYmplY3QgdmFsKQoreworICB3LT5mY19mb3JlZ3Jv dW5kID0gdmFsOworfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiBJTkxJTkUgYm9v bAogV0lORE9XUCAoTGlzcF9PYmplY3QgYSkKIHsKQEAgLTExMjAsNiArMTIxNywxNSBAQCBleHRl cm4gdm9pZCByZWRpc3BsYXlfb3RoZXJfd2luZG93cyAodm9pZCk7CiAKIHN0cnVjdCBnbHlwaCAq Z2V0X3BoeXNfY3Vyc29yX2dseXBoIChzdHJ1Y3Qgd2luZG93ICp3KTsKIAorCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworc3RydWN0IGdseXBoICpt Y19nZXRfY3Vyc29yX2dseXBoIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4 ICptYXRyaXgsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgaW50IGhwb3MsIGludCB2cG9zKTsKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogLyogVHJ1ZSBpZiBXSU5ET1cgaXMgYSB2YWxp ZCB3aW5kb3cuICAqLwogI2RlZmluZSBXSU5ET1dfVkFMSURfUChXSU5ET1cpCQkJCQlcCiAgIChX SU5ET1dQIChXSU5ET1cpICYmICFOSUxQIChYV0lORE9XIChXSU5ET1cpLT5jb250ZW50cykpCVwK ZGlmZiAtLWdpdCBhL3NyYy94ZGlzcC5jIGIvc3JjL3hkaXNwLmMKaW5kZXggYTg4ZmM2OS4uODk2 NTE4YyAxMDA2NDQKLS0tIGEvc3JjL3hkaXNwLmMKKysrIGIvc3JjL3hkaXNwLmMKQEAgLTkyMSw2 ICs5MjEsNDA4MSBAQCBzdGF0aWMgdm9pZCBzaG93X21vdXNlX2ZhY2UgKE1vdXNlX0hMSW5mbyAq LCBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UpOwogc3RhdGljIGJvb2wgY29vcmRzX2luX21vdXNlX2Zh Y2VfcCAoc3RydWN0IHdpbmRvdyAqLCBpbnQsIGludCk7CiAKIAorLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIE1VTFRJUExFLUNVUlNP UlM6ICBFbWFjcyBCdWcgIzIyODczIChmZWF0dXJlIHJlcXVlc3QpCisKKyAgQ1JPU1NIQUlSUzog IEVtYWNzIEJ1ZyAjMTc2ODQgKGZlYXR1cmUgcmVxdWVzdCkKKworCitWRVJTSU9OOgorCistIDAx OC4wMDAgWzA0LzA4LzIwMTldCistIDAxNy4wMDAgWzEyLzEzLzIwMThdCistIDAxNi4wMDAgWzEx LzIwLzIwMThdCistIDAxNS4wMDAgWzExLzEwLzIwMThdCistIDAxNC4wMDAgWzA4LzI4LzIwMThd CisKKworQ0hBTkdFTE9HOgorCistIENyZWF0aW9uIG9mIGZha2UgY3Vyc29ycyBub3cgaW1tZWRp YXRlbHkgZm9sbG93cyBjYWxscyB0byBgZHJhd19nbHlwaHMnLgorCistIFJlbW92YWwgb2YgZmFr ZSBjdXJzb3JzIG9jY3VycyBwcmlvciB0byBFbWFjcyBzY3JvbGxpbmcgdGhlIHRleHQgb24gdGhl IGdsYXNzCisgIGRpcmVjdGx5IGFuZCBhdCB0aGUgb3V0c2V0IG9mIGB1cGRhdGVfd2luZG93Jy4K KworLSBUaGUgTlMgcG9ydCBub3cgYXV0b21hdGljYWxseSByZWRyYXdzIGZha2UgY3Vyc29ycyB0 aGF0IGdvdCBlcmFzZW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KworUkFOR0VEX0lOVEVHRVJQID0+IFJBTkdFRF9GSVhOVU1QCisKK1RZUEVf UkFOR0VEX0lOVEVHRVJQID0+IFRZUEVfUkFOR0VEX0ZJWE5VTVAKKworbWFrZV9udW1iZXIgPT4g bWFrZV9maXhudW0KKworWElOVCA9PiBYRklYTlVNCisKK1hGQVNUSU5UID0+IFhGSVhOQVQKKwor TGlzcF9PYmplY3Qgc3RyaW5nID0gRnByaW4xX3RvX3N0cmluZyAoaV9zdG9yZSwgUW5pbCk7Citj aGFyICpjaGFyX3N0cmluZyA9IFNTREFUQSAoc3RyaW5nKTsKK2ZwcmludGYgKHN0ZGVyciwgImlf c3RvcmU6ICAlc1xuIiwgY2hhcl9zdHJpbmcpOworCitjaGFyICp3X2NvbnRlbnRzID0gKEJVRkZF UlAgKHctPmNvbnRlbnRzKSAmJiBTVFJJTkdQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IG5hbWUpKSkKKyAgICAgICAgICAgICAgICAgICA/IFNTREFUQSAoQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBuYW1lKSkKKyAgICAgICAgICAgICAgICAgICA6ICJuaWwiOworZnByaW50ZiAo c3RkZXJyLCAiXG5CdWZmZXIgKCVzKVxuIiwgd19jb250ZW50cyk7CisKK3N0cnVjdCBmYWNlICpm YWNlID0gLi4uCitMaXNwX09iamVjdCBmb3JlZ3JvdW5kID0gZmFjZS0+bGZhY2VbTEZBQ0VfRk9S RUdST1VORF9JTkRFWF07CitMaXNwX09iamVjdCBiYWNrZ3JvdW5kID0gZmFjZS0+bGZhY2VbTEZB Q0VfQkFDS0dST1VORF9JTkRFWF07CitmcHJpbnRmIChzdGRlcnIsICJcbmZvcmVncm91bmQgKCVz KSB8IGJhY2tncm91bmQgKCVzKVxuIiwKKyAgICAgICAgICAgICAgICAgKCFOSUxQIChmb3JlZ3Jv dW5kKSA/IFNTREFUQSAoZm9yZWdyb3VuZCkgOiAiTklMUCIpLAorICAgICAgICAgIC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sIFgsIExBU1RfWCk7CQlcCisJICAgICAgZWxzZQkJCQkJCQlcCisJCU1DX0JVSUxEX0NPTVBP U0lURV9HTFlQSF9TVFJJTkcgKFNUQVJULCBFTkQsIEhFQUQsIFRBSUwsCVwKKwkJCQkJICAgICAg SEwsIFgsIExBU1RfWCk7CQlcCisJICAgICAgYnJlYWs7CQkJCQkJCVwKKwkJCQkJCQkJCVwKKwkg ICAgY2FzZSBTVFJFVENIX0dMWVBIOgkJCQkJCVwKKwkgICAgICBNQ19CVUlMRF9TVFJFVENIX0dM WVBIX1NUUklORyAoU1RBUlQsIEVORCwgSEVBRCwgVEFJTCwJXAorCQkJCQkgIEhMLCBYLCBMQVNU X1gpOwkJXAorCSAgICAgIGJyZWFrOwkJCQkJCQlcCisJCQkJCQkJCQlcCisJICAgIGNhc2UgSU1B R0VfR0xZUEg6CQkJCQkJXAorCSAgICAgIE1DX0JVSUxEX0lNQUdFX0dMWVBIX1NUUklORyAoU1RB UlQsIEVORCwgSEVBRCwgVEFJTCwJCVwKKwkJCQkJSEwsIFgsIExBU1RfWCk7CQkJXAorCSAgICAg IGJyZWFrOworCisjZGVmaW5lIE1DX0JVSUxEX0dMWVBIX1NUUklOR1NfWFcoU1RBUlQsIEVORCwg SEVBRCwgVEFJTCwgSEwsIFgsIExBU1RfWCkJXAorICAgICAgICAgICAgY2FzZSBYV0lER0VUX0dM WVBIOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAg ICAgICBNQ19CVUlMRF9YV0lER0VUX0dMWVBIX1NUUklORyAoU1RBUlQsIEVORCwgSEVBRCwgVEFJ TCwgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSEws IFgsIExBU1RfWCk7ICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICBicmVhazsKKworI2Rl ZmluZSBNQ19CVUlMRF9HTFlQSF9TVFJJTkdTXzIoU1RBUlQsIEVORCwgSEVBRCw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mb3IgKGludCBpID0gMDsgaSA8IG51bSAmJiAhTklMUCAobGlz dCk7IGkrKykKKyAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgIGlmIChDT05TUCAobGlzdCkpCisg ICAgcmV0dXJuIFhDQVIgKGxpc3QpOworICAgIGVsc2UKKyAgICAgIHJldHVybiBRbmlsOworfQor CitMaXNwX09iamVjdAorbWNfYXNzcSAoTGlzcF9PYmplY3Qga2V5LCBMaXNwX09iamVjdCBsaXN0 KQoreworICB3aGlsZSAoMSkKKyAgICB7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KQorICAgICAg ICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAgICYmIEVRIChYQ0FSIChY Q0FSIChsaXN0KSksIGtleSkpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChs aXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAgfHwgKENPTlNQIChYQ0FS IChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgRVEgKFhDQVIgKFhDQVIgKGxpc3QpKSwga2V5KSkp CisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFD T05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAg ICAgICAmJiBFUSAoWENBUiAoWENBUiAobGlzdCkpLCBrZXkpKSkKKyAgICAgICAgYnJlYWs7Cisg ICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgfQorICBpZiAoQ09OU1AgKGxpc3QpKQorICAg IHJldHVybiBYQ0FSIChsaXN0KTsKKyAgICBlbHNlCisgICAgICByZXR1cm4gUW5pbDsKK30KKwor TGlzcF9PYmplY3QKK21jX2Fzc29jIChMaXNwX09iamVjdCBrZXksIExpc3BfT2JqZWN0IGxpc3Qp Cit7CisgIExpc3BfT2JqZWN0IGNhcjsKKyAgd2hpbGUgKDEpCisgICAgeworICAgICAgaWYgKCFD T05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAg ICAgICAmJiAoY2FyID0gWENBUiAoWENBUiAobGlzdCkpLAorICAgICAgICAgICAgICAgICAgRVEg KGNhciwga2V5KSB8fCAhTklMUCAoRmVxdWFsIChjYXIsIGtleSkpKSkpCisgICAgICAgIGJyZWFr OworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAg ICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAgICAgICAmJiAoY2FyID0g WENBUiAoWENBUiAobGlzdCkpLAorICAgICAgICAgICAgICAgICAgRVEgKGNhciwga2V5KSB8fCAh TklMUCAoRmVxdWFsIChjYXIsIGtleSkpKSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9 IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09O U1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAgICAgICAmJiAoY2FyID0gWENBUiAoWENBUiAobGlz dCkpLAorICAgICAgICAgICAgICAgICAgRVEgKGNhciwga2V5KSB8fCAhTklMUCAoRmVxdWFsIChj YXIsIGtleSkpKSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOwor ICAgIH0KKyAgaWYgKENPTlNQIChsaXN0KSkKKyAgICByZXR1cm4gWENBUiAobGlzdCk7CisgICAg ZWxzZQorICAgICAgcmV0dXJuIFFuaWw7Cit9CisKK0xpc3BfT2JqZWN0CittY19wbGlzdF9nZXQg KExpc3BfT2JqZWN0IHBsaXN0LCBMaXNwX09iamVjdCBwcm9wKQoreworICBMaXNwX09iamVjdCB0 YWlsLCBoYWxmdGFpbDsKKyAgLyogaGFsZnRhaWwgaXMgdXNlZCB0byBkZXRlY3QgY2lyY3VsYXIg bGlzdHMuICAqLworICB0YWlsID0gaGFsZnRhaWwgPSBwbGlzdDsKKyAgd2hpbGUgKENPTlNQICh0 YWlsKSAmJiBDT05TUCAoWENEUiAodGFpbCkpKQorICAgIHsKKyAgICAgIGlmIChFUSAocHJvcCwg WENBUiAodGFpbCkpKQorICAgICAgICByZXR1cm4gWENBUiAoWENEUiAodGFpbCkpOworICAgICAg dGFpbCA9IFhDRFIgKFhDRFIgKHRhaWwpKTsKKyAgICAgIGhhbGZ0YWlsID0gWENEUiAoaGFsZnRh aWwpOworICAgICAgaWYgKEVRICh0YWlsLCBoYWxmdGFpbCkpCisgICAgICAgIGJyZWFrOworICAg IH0KKyAgcmV0dXJuIFFuaWw7Cit9CisKK0xpc3BfT2JqZWN0CittY19tZW1xIChMaXNwX09iamVj dCBlbHQsIExpc3BfT2JqZWN0IGxpc3QpCit7CisgIHdoaWxlICgxKQorICAgIHsKKyAgICAgIGlm ICghQ09OU1AgKGxpc3QpIHx8IEVRIChYQ0FSIChsaXN0KSwgZWx0KSkKKyAgICAgICAgYnJlYWs7 CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KSB8fCBF USAoWENBUiAobGlzdCksIGVsdCkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIg KGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkgfHwgRVEgKFhDQVIgKGxpc3QpLCBlbHQp KQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICB9CisgIHJl dHVybiBsaXN0OworfQorCitMaXNwX09iamVjdAorbWNfbGlzdG4gKHB0cmRpZmZfdCBjb3VudCwg TGlzcF9PYmplY3QgYXJnLCAuLi4pCit7CisgIGVhc3N1bWUgKDAgPCBjb3VudCk7CisgIExpc3Bf T2JqZWN0IHZhbCA9IEZjb25zIChhcmcsIFFuaWwpOworICBMaXNwX09iamV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FUX0RBVEEg KHByb3ApICsgMC41KSAtIGNvbDsKKyAgICAgIGlmICh3aWR0aCA+PSAwKQorICB7CisgICAgcHRy ZGlmZl90IHN0YXJ0OworICAgIGlmIChPVkVSTEFZUCAob3ZlcmxheSkpCisgICAgICAqZW5kcG9z ID0gT1ZFUkxBWV9QT1NJVElPTiAoT1ZFUkxBWV9FTkQgKG92ZXJsYXkpKTsKKyAgICBlbHNlCisg ICAgICBnZXRfcHJvcGVydHlfYW5kX3JhbmdlIChwb3MsIFFkaXNwbGF5LCAmdmFsLCAmc3RhcnQs IGVuZHBvcywgUW5pbCk7CisgICAgLyogRm9yIDpyZWxhdGl2ZS13aWR0aCwgd2UgbmVlZCB0byBt dWx0aXBseSBieSB0aGUgY29sdW1uCisgICAgICAgd2lkdGggb2YgdGhlIGNoYXJhY3RlciBhdCBQ T1MsIGlmIGl0IGlzIGdyZWF0ZXIgdGhhbiAxLiAqLworICAgIGlmICghTklMUCAobWNfcGxpc3Rf Z2V0IChwbGlzdCwgUUNyZWxhdGl2ZV93aWR0aCkpCisgICAgICAgICYmICFOSUxQIChCVkFSIChj dXJyZW50X2J1ZmZlciwgZW5hYmxlX211bHRpYnl0ZV9jaGFyYWN0ZXJzKSkpCisgICAgICB7Cisg ICAgICAgIGludCBiLCB3ZDsKKyAgICAgICAgdW5zaWduZWQgY2hhciAqcCA9IEJZVEVfUE9TX0FE RFIgKENIQVJfVE9fQllURSAocG9zKSk7CisgICAgICAgIE1DX01VTFRJQllURV9CWVRFU19XSURU SCAocCwgYnVmZmVyX2Rpc3BsYXlfdGFibGUgKCksIGIsIHdkKTsKKyAgICAgICAgd2lkdGggKj0g d2Q7CisgICAgICB9CisgICAgcmV0dXJuIHdpZHRoOworICB9CisgICAgfQorICByZXR1cm4gLTE7 Cit9CisKKy8qIFNjYW5uaW5nIGZyb20gdGhlIGJlZ2lubmluZyBvZiB0aGUgY3VycmVudCBsaW5l LCBzdG9wIGF0IHRoZSBidWZmZXIKKyAgIHBvc2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X3dpZHRoOworICAg IH0KKyAgICAgICAgZWxzZQorICAgICsrY29sOworICAgICAgfQorICB9CisgICAgICBlbHNlCisg IHsKKyAgICAvKiBUaGUgZGlzcGxheSB0YWJsZSBkb2Vzbid0IGFmZmVjdCB0aGlzIGNoYXJhY3Rl cjsKKyAgICAgICBpdCBkaXNwbGF5cyBhcyBpdHNlbGYuICovCisgICAgaWYgKGMgPT0gJ1xuJykK KyAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICBpZiAoYyA9PSAnXHInICYmIEVRIChCVkFSIChjdXJy ZW50X2J1ZmZlciwgc2VsZWN0aXZlX2Rpc3BsYXkpLCBRdCkpCisgICAgICBnb3RvIGVuZGxvb3A7 CisgICAgaWYgKGMgPT0gJ1x0JykKKyAgICAgIHsKKyAgICAgICAgY29sICs9IHRhYl93aWR0aDsK KyAgICAgICAgY29sID0gY29sIC8gdGFiX3dpZHRoICogdGFiX3dpZHRoOworICAgICAgfQorICAg IGVsc2UgaWYgKG11bHRpYnl0ZSAmJiBMRUFESU5HX0NPREVfUCAoYykpCisgICAgICB7CisgICAg ICAgIC8qIFN0YXJ0IG9mIG11bHRpLWJ5dGUgZm9ybS4gKi8KKyAgICAgICAgdW5zaWduZWQgY2hh ciAqcHRyOworICAgICAgICBpbnQgYnl0ZXMsIHdpZHRoOworICAgICAgICBwdHIgPSBCWVRFX1BP U19BRERSIChzY2FuX2J5dGUpOworICAgICAgICBNQ19NVUxUSUJZVEVfQllURVNfV0lEVEggKHB0 ciwgZHAsIGJ5dGVzLCB3aWR0aCk7CisgICAgICAgIC8qIFN1YnRyYWN0IG9uZSB0byBjb21wZW5z YXRlIGZvciB0aGUgaW5jcmVtZW50CisgICAgIHRoYXQgaXMgZ29pbmcgdG8gaGFwcGVuIGJlbG93 LiAqLworICAgICAgICBzY2FuX2J5dGUgKz0gYnl0ZXMgLSAxOworICAgICAgICBjb2wgKz0gd2lk dGg7CisgICAgICB9CisgICAgZWxzZSBpZiAoY3RsX2Fycm93IC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wOworICB3aGlsZSAoMSkKKyAgICB7CisgICAgICBwdHJkaWZmX3Qg aSwgbjsKKyAgICAgIExpc3BfT2JqZWN0IGNoYXJ2ZWM7CisgICAgICBpZiAocHRyID09IHN0b3Ap CisgIHsKKyAgICAvKiBXZSBzdG9wcGVkIGVpdGhlciBmb3IgdGhlIGJlZ2lubmluZyBvZiB0aGUg YnVmZmVyCisgICAgICAgb3IgZm9yIHRoZSBnYXAuICovCisgICAgaWYgKHB0ciA9PSBCRUdWX0FE RFIpCisgICAgICBicmVhazsKKyAgICAvKiBJdCB3YXMgdGhlIGdhcC4gIEp1bXAgYmFjayBvdmVy IGl0LiAqLworICAgIHN0b3AgPSBCRUdWX0FERFI7CisgICAgcHRyID0gR1BUX0FERFI7CisgICAg LyogQ2hlY2sgd2hldGhlciB0aGF0IGJyaW5ncyB1cyB0byBiZWdpbm5pbmcgb2YgYnVmZmVyLiAq LworICAgIGlmIChCRUdWID49IEdQVCkKKyAgICAgIGJyZWFrOworICB9CisgICAgICBjID0gKi0t cHRyOworICAgICAgaWYgKGRwICYmIFZFQ1RPUlAgKERJU1BfQ0hBUl9WRUNUT1IgKGRwLCBjKSkp CisgIHsKKyAgICBjaGFydmVjID0gRElTUF9DSEFSX1ZFQ1RPUiAoZHAsIGMpOworICAgIG4gPSBB U0laRSAoY2hhcnZlYyk7CisgIH0KKyAgICAgIGVsc2UKKyAgeworICAgIGNoYXJ2ZWMgPSBRbmls OworICAgIG4gPSAxOworICB9CisgICAgICBmb3IgKGkgPSBuIC0gMTsgaSA+PSAwOyAtLWkpCisg IHsKKyAgICBpZiAoVkVDVE9SUCAoY2hhcnZlYykpCisgICAgICB7CisgICAgICAgIC8qIFRoaXMg c2hvdWxkIGJlIGhhbmRsZWQgdGhlIHNhbWUgYXMKKyAgICAgbmV4dF9lbGVtZW50X2Zyb21fZGlz cGxheV92ZWN0b3IgZG9lcyBpdC4gKi8KKyAgICAgICAgTGlzcF9PYmplY3QgZW50cnkgPSBBUkVG IChjaGFydmVjLCBpKTsKKyAgICAgICAgaWYgKEdMWVBIX0NPREVfUCAoZW50cnkpKQorICAgIGMg PSBHTFlQSF9DT0RFX0NIQVIgKGVudHJ5KTsKKyAgICAgICAgZWxzZQorICAgIGMgPSAnICc7Cisg ICAgICB9CisgICAgaWYgKGMgPj0gMDQwICYmIGMgPCAwMTc3KQorICAgICAgY29sKys7CisgICAg ZWxzZSBpZiAoYyA9PSAnXG4nCisgICAgICAgfHwgKGMgPT0gJ1xyJworICAgICAgICAgICAmJiBF USAoQlZBUiAoY3VycmVudF9idWZmZXIsIHNlbGVjdGl2ZV9kaXNwbGF5KSwgUXQpKSkKKyAgICAg IHsKKyAgICAgICAgcHRyKys7CisgICAgICAgIGdvdG8gc3RhcnRfb2ZfbGluZV9mb3VuZDsKKyAg ICAgIH0KKyAgICBlbHNlIGlmIChjID09ICdcdCcpCisgICAgICB7CisgICAgICAgIGlmICh0YWJf c2VlbikKKyAgICBjb2wgPSAoKGNvbCArIHRhYl93aWR0aCkgLyB0YWJfd2lkdGgpICogdGFiX3dp ZHRoOworICAgICAgICBwb3N0X3RhYiArPSBjb2w7CisgICAgICAgIGNvbCA9IDA7CisgICAgICAg IHRhYl9zZWVuID0gMTsKKyAgICAgIH0KKyAgICBlbHNlIGlmIChWRUNUT1JQIChjaGFydmVjKSkK KyAgICAgIC8qIFdpdGggYSBkaXNwbGF5IHRhYmxlIGVudHJ5LCBDIGlzIGRpc3BsYXllZCBhcyBp cywgYW5kCisgICAgICAgICBub3QgZGlzcGxheWVkIGFzIFxOTk4gb3IgYXMgXk4uICBJZiBDIGlz IGEgc2luZ2xlLWJ5dGUKKyAgICAgICAgIGNoYXJhY3RlciwgaXQgdGFrZXMgb25lIGNvbHVtbi4g IElmIEMgaXMgbXVsdGktYnl0ZSBpbgorICAgICAgICAgYSB1bmlieXRlIGJ1ZmZlciwgaXQncyB0 cmFuc2xhdGVkIHRvIHVuaWJ5dGUsIHNvIGl0CisgICAgICAgICBhbHNvIHRha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KiBVU0FHRTogIGZwcmludGYgKHN0ZGVyciwg IldJTkRPVyAoJXMpIiwgbWNfd2luZG93ICh3KSk7ICovCitjaGFyICoKK21jX3dpbmRvdyAoc3Ry dWN0IHdpbmRvdyAqdykKK3sKKyAgTGlzcF9PYmplY3Qgd2luZG93OworICBYU0VUV0lORE9XICh3 aW5kb3csIHcpOworICByZXR1cm4gU1NEQVRBIChGcHJpbjFfdG9fc3RyaW5nICh3aW5kb3csIFFu aWwpKTsKK30KKworLyogVVNBR0U6ICBmcHJpbnRmIChzdGRlcnIsICJDSEFSQUNURVIgKCVzKSIs IG1jX2NoYXJfdG9fc3RyaW5nIChnbHlwaC0+dS5jaCkpOyAqLworY2hhciAqCittY19jaGFyX3Rv X3N0cmluZyAoaW50IGFyZykKK3sKKyAgTGlzcF9PYmplY3QgY2hhcmFjdGVyID0gKENIQVJBQ1RF UlAgKG1ha2VfZml4bnVtIChhcmcpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgID8gRmNo YXJfdG9fc3RyaW5nIChtYWtlX2ZpeG51bSAoYXJnKSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogUW5pbDsKKyAgY2hhciAqIHJlc3VsdCA9ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAg ICAgICAgICAgICAgICYmIGFyZyA9PSA5KQorICAgICAgICAgICAgICAgICAgICA/IFNTREFUQSAo YnVpbGRfc3RyaW5nICgiXFx0IikpCisgICAgICAgICAgICAgICAgICA6ICghTklMUCAoY2hhcmFj dGVyKQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnID09IDEwKQorICAgICAgICAgICAgICAg ICAgICA/IFNTREFUQSAoYnVpbGRfc3RyaW5nICgiXFxuIikpCisgICAgICAgICAgICAgICAgICA6 ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnID09IDMyKQor ICAgICAgICAgICAgICAgICAgICA/IFNTREFUQSAoYnVpbGRfc3RyaW5nICgiXFxzIikpCisgICAg ICAgICAgICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICAg JiYgYXJnICE9IDkKKyAgICAgICAgICAgICAgICAgICAgICYmIGFyZyAhPSAxMAorICAgICAgICAg ICAgICAgICAgICAgJiYgYXJnICE9IDMyKQorICAgICAgICAgICAgICAgICAgICA/IFNTREFUQSAo Y2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgOiBTU0RBVEEgKGJ1aWxkX3N0cmluZyAoIlxc PyIpKTsKKyAgcmV0dXJuIHJlc3VsdDsKK30KKworaW50CittY19saXNwX3RvX2N1cnNvcl90eXBl IChMaXNwX09iamVjdCBhcmcpCit7CisgIGNoYXIgKnN0cjsKKyAgaWYgKFhUWVBFIChhcmcpID09 IExpc3BfU3RyaW5nKQorICAgIHN0ciA9IFNTREFUQSAoYXJnKTsKKyAgZWxzZSBpZiAoWFRZUEUg KGFyZykgPT0gTGlzcF9TeW1ib2wpCisgICAgc3RyID0gU1NEQVRBIChTWU1CT0xfTkFNRSAoYXJn KSk7CisgIGVsc2UgcmV0dXJuIC0xOworICBpZiAoIXN0cmNtcCAoc3RyLCAiYm94IikpCisgICAg cmV0dXJuIEZJTExFRF9CT1hfQ1VSU09SOworICBpZiAoIXN0cmNtcCAoc3RyLCAiZnJhbWVkIikp CisgICAgcmV0dXJuIEZSQU1FRF9CT1hfQ1VSU09SOworICBpZiAoIXN0cmNtcCAoc3RyLCAiaG9s bG93IikpCisgICAgcmV0dXJuIEhPTExPV19CT1hfQ1VSU09SOworICBpZiAoIXN0cmNtcCAoc3Ry LCAiaGJhciIpKQorICAgIHJldHVybiBIQkFSX0NVUlNPUjsKKyAgaWYgKCFzdHJjbXAgKHN0ciwg ImJhciIpKQorICAgIHJldHVybiBCQVJfQ1VSU09SOworICBpZiAoIXN0cmNtcCAoc3RyLCAibGVm dC1mcmluZ2UtYml0bWFwIikpCisgICAgcmV0dXJuIExFRlRfRlJJTkdFX0JJVE1BU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CisgICAgICByZXR1cm4gU1NEQVRBIChidWlsZF9zdHJpbmcgKCJVTktOT1dOIikp OworICAgIH0KK30KKworTGlzcF9PYmplY3QKK21jX2NvbG9yX3ZlY3Rvcl9jYWxjIChzdHJ1Y3Qg d2luZG93ICp3LCBMaXNwX09iamVjdCBjb2xvcikKK3sKKyAgQ0hFQ0tfU1RSSU5HIChjb2xvcik7 CisgIGludCBpID0gMDsKKyAgZG91YmxlIHZhbG1heCA9IFhGSVhOVU0gKFhDQVIgKEZ4d19jb2xv cl92YWx1ZXMgKGJ1aWxkX3N0cmluZyAoIiNmZmZmZmYiKSwgdy0+ZnJhbWUpKSk7CisgIExpc3Bf T2JqZWN0IHZlY3RvciA9IG1jX3ZlY3RvciAoMyk7CisgIGlmICghTklMUCAobWNfbWVtcSAoKEZm cmFtZXAgKHctPmZyYW1lKSksIG1jX2xpc3RuICgzLCBpbnRlcm4gKCJ4IiksCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnRlcm4gKCJ3 MzIiKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGludGVybiAoIm5zIikpKSkpCisgICAgeworICAgICAgZm9yIChMaXNwX09iamVjdCB2 bGlzdCA9IEZ4d19jb2xvcl92YWx1ZXMgKGNvbG9yLCB3LT5mcmFtZSk7CisgICAgICAgICAgIENP TlNQICh2bGlzdCk7CisgICAgICAgICAgIHZsaXN0ID0gWENEUiAodmxpc3QpKQorICAgICAgICB7 CisgICAgICAgICAgQVNFVCAodmVjdG9yLCBpLCBtYWtlX2Zsb2F0IChYRklYTlVNIChYQ0FSICh2 bGlzdCkpIC8gdmFsbWF4KSk7CisgICAgICAgICAgKytpOworICAgICAgICB9CisgICAgfQorICBy ZXR1cm4gdmVjdG9yOworfQorCitzdGF0aWMgTGlzcF9PYmplY3QKK21jX2JnX2xzbCAoc3RydWN0 IHdpbmRvdyAqd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ibTEpKQorICB7CisgICAgaWYgKChibTEgPSBY Q0RSIChibTEpKSwgTklMUCAoYm0xKSkKKyAgICAgIHJldHVybiBOT19GUklOR0VfQklUTUFQOwor ICAgIGlmIChDT05TUCAoYm0xKSkKKyAgICAgIHsKKyAgICAgICAgbG4xID0gWEZJWE5VTSAoRmxl bmd0aCAoYm0xKSk7CisgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgeworICAgICAgaWYgKGxu MSA+IGl4MikKKyAgICAgICAgeworICAgICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMSk7Cisg ICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgIH0K KyAgICB9CisgICAgICAgIGVsc2UKKyAgICB7CisgICAgICBpZiAobG4xID4gaXgxKQorICAgICAg ICB7CisgICAgICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0xKTsKKyAgICAgICAgICBpZiAoIUVR IChibSwgUXQpKQorICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgfQorICAgIH0KKyAgICAgIH0K KyAgICBlbHNlIGlmICgoYm0gPSBibTEsICFFUSAoYm0sIFF0KSkpCisgICAgICBnb3RvIGZvdW5k OworICB9CisgICAgfQorICBpZiAoIUVRIChjbWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBm cmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkKKyAgICAgICYmICFOSUxQIChCVkFSICgmYnVmZmVyX2Rl ZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkpCisgICAgeworICAgICAgYm0yID0gbWNf YXNzcSAoYml0bWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2Fs aXN0KSk7CisgICAgICBpZiAoQ09OU1AgKGJtMikpCisgIHsKKyAgICBpZiAoKGJtMiA9IFhDRFIg KGJtMikpLCAhTklMUCAoYm0yKSkKKyAgICAgIHsKKyAgICAgICAgaWYgKENPTlNQIChibTIpKQor ICAgIHsKKyAgICAgIGxuMiA9IFhGSVhOVU0gKEZsZW5ndGggKGJtMikpOworICAgICAgaWYgKHBh cnRpYWxfcCkKKyAgICAgICAgeworICAgICAgICAgIGlmIChsbjIgPiBpeDIpCisgICAgICB7Cisg ICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMik7CisgICAgICAgIGlmICghRVEgKGJtLCBRdCkp CisgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICAg IH0KKyAgfQorICAgIH0KKyAgaWYgKGxuMSA+IGl4MSkKKyAgICB7CisgICAgICBibSA9IG1jX250 aCAoaXgxLCBibTEpOworICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgZ290byBmb3VuZDsKKyAg ICB9CisgIGlmIChsbjIgPiBpeDEpCisgICAgeworICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0y KTsKKyAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgIGdvdG8gZm91bmQ7CisgICAgICByZXR1cm4g Tk9fRlJJTkdFX0JJVE1BUDsKKyAgICB9CisgIGVsc2UgaWYgKChibSA9IGJtMiwgTklMUCAoYm0p KSkKKyAgICByZXR1cm4gTk9fRlJJTkdFX0JJVE1BUDsKKyBmb3VuZDoKKyAgcmV0dXJuIGxvb2t1 cF9mcmluZ2VfYml0bWFwIChibSk7Cit9CisKKy8qIERyYXcgZ2x5cGhzIGJldHdlZW4gU1RBUlQg YW5kIEVORCBpbiBBUkVBIG9mIFJPVyBvbiB3aW5kb3cgVywKKyAgIHN0YXJ0aW5nIGF0IHgtcG9z aXRpb24gWC4gIFggaXMgcmVsYXRpdmUgdG8gQVJFQSBpbiBXLiAgSEwgaXMgYQorICAgZmFjZS1v dmVycmlkZSB3aXRoIHRoZSBmb2xsb3dpbmcgbWVhbmluZzoKKyAgIC0gIERSQVdfTk9STUFMX1RF WFQgIGRyYXcgbm9ybWFsbHk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b3ZlcndyaXRpbmcgKHRhaWwpOworICAgICAgaWYg KGkgPj0gMCkKKyAgeworICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBvdmVybGFwX2hsOworICAg IGlmIChjaGVja19tb3VzZV9mYWNlCisgICAgICAgICYmIG1vdXNlX2JlZ19jb2wgPCBpICYmIG1v dXNlX2VuZF9jb2wgPiBlbmQpCisgICAgICBvdmVybGFwX2hsID0gRFJBV19NT1VTRV9GQUNFOwor ICAgIGVsc2UKKyAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX05PUk1BTF9URVhUOworICAgIGlmICho bCA9PSBvdmVybGFwX2hsIHx8IGNsaXBfdGFpbCA9PSBOVUxMKQorICAgICAgY2xpcF90YWlsID0g dGFpbDsKKyAgICBpKys7ICAgICAgLyogV2UgbXVzdCBpbmNsdWRlIHRoZSBJdGggZ2x5cGguICov CisgICAgTUNfQlVJTERfR0xZUEhfU1RSSU5HUyAoZW5kLCBpLCBoLCB0LAorICAgICAgICAgICAg IG92ZXJsYXBfaGwsIHgsIGxhc3RfeCk7CisgICAgZm9yIChzID0gaDsgczsgcyA9IHMtPm5leHQp CisgICAgICBzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wID0gdHJ1ZTsKKyAgICBjb21wdXRlX292ZXJo YW5nc19hbmRfeCAoaCwgdGFpbC0+eCArIHRhaWwtPndpZHRoLCBmYWxzZSk7CisgICAgYXBwZW5k X2dseXBoX3N0cmluZ19saXN0cyAoJmhlYWQsICZ0YWlsLCBoLCB0KTsKKyAgfQorICAgICAgdGFp bCA9IGdseXBoX3N0cmluZ19jb250YWluaW5nX2JhY2tncm91bmRfd2lkdGggKHRhaWwpOworICAg ICAgaWYgKGNsaXBfdGFpbCkKKyAgY2xpcF90YWlsID0gZ2x5cGhfc3RyaW5nX2NvbnRhaW5pbmdf YmFja2dyb3VuZF93aWR0aCAoY2xpcF90YWlsKTsKKyAgICAgIGlmIChjbGlwX2hlYWQgfHwgY2xp cF90YWlsKQorICBmb3IgKHMgPSBoZWFkOyBzOyBzID0gcy0+bmV4dCkKKyAgICB7CisgICAgICBz LT5jbGlwX2hlYWQgPSBjbGlwX2hlYWQ7CisgICAgICBzLT5jbGlwX3RhaWwgPSBjbGlwX3RhaWw7 CisgICAgfQorICAgIH0KKyAgLyogRHJhdyBhbGwgc3RyaW5ncy4gKi8KKyAgZm9yIChzID0gaGVh ZDsgczsgcyA9IHMtPm5leHQpCisgICAgRlJBTUVfUklGIChmKS0+bWNfc2NyaWJlX3N0cmluZyAo cywgbWF0cml4LCByb3csIHJlZCwgZ3JlZW4sIGJsdWUsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9wLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9nY19wKTsKKyNpZm5k ZWYgSEFWRV9OUworICAvKiBXaGVuIGZvY3VzIGEgc29sZSBmcmFtZSBhbmQgbW92ZSBob3Jpem9u dGFsbHksIHRoaXMgY2xlYXJzIG9uX3AKKyAgICAgY2F1c2luZyBhIGZhaWx1cmUgdG8gZXJhc2Ug cHJldiBjdXJzb3IgcG9zaXRpb24uICovCisgIGlmIChhcmVhID09IFRFWFRfQVJFQQorICAgICAg JiYgIXJvdy0+ZnVsbF93aWR0aF9wCisgICAgICAvKiBXaGVuIGRyYXdpbmcgb3ZlcmxhcHBpbmcg cm93cywgb25seSB0aGUgZ2x5cGggc3RyaW5ncycKKyAgICAgIGZvcmVncm91bmQgaXMgZHJhd24s IHdoaWNoIGRvZXNuJ3QgZXJhc2UgYSBjdXJzb3IgY29tcGxldGVseS4gKi8KKyAgICAgICYmICFv dmVybGFwcykKKyAgICB7CisgICAgICBpbnQgeDAgPSBjbGlwX2hlYWQgPyBjbGlwX2hlYWQtPngg OiAoaGVhZCA/IGhlYWQtPnggOiB4KTsKKyAgICAgIGludCB4MSA9IChjbGlwX3RhaWw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BmcHJpbnRmIChzdGRlcnIsICJtY19kcmF3X2N1 cnNvcl9nbHlwaDogIGNoICglZCkgfCB4ICglZCksIGhwb3MgKCVkKSwgdnBvcyglZCksIGhsICgl ZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9nbHlwaC0+dS5jaCwgeCwgaHBv cywgdnBvcywgaGwpOworKi8KKyAgYmxvY2tfaW5wdXQgKCk7CisgIG1jX2RyYXdfZ2x5cGhzICh3 LCBtYXRyaXgsIHJvdywgeCwgVEVYVF9BUkVBLCBocG9zLCBocG9zICsgMSwgaGwsIDAsCisgICAg ICAgICAgICAgICAgICB2cG9zLCBib3R0b21fdnBvcywgcmVkLCBncmVlbiwgYmx1ZSwgZ2x5cGhf Zmxhdm9yLAorICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vy c29yX2djX3AsIE1DX0RSQVdfR0xZUEgpOworICB1bmJsb2NrX2lucHV0ICgpOworICAvKiBXaGVu IHdlIGVyYXNlIHRoZSBjdXJzb3IsIGFuZCBST1cgaXMgb3ZlcmxhcHBlZCBieSBvdGhlciByb3dz LCBtYWtlCisgIHN1cmUgdGhhdCB0aGVzZSBvdmVybGFwcGluZyBwYXJ0cyBvZiBvdGhlciByb3dz IGFyZSByZWRyYXduLiAqLworICBpZiAoaGwgPT0gRFJBV19OT1JNQUxfVEVYVCAmJiByb3ctPm92 ZXJsYXBwZWRfcCkKKyAgICB7CisgICAgICBpZiAocm93ID4gbWF0cml4LT5yb3dzCisgICAgICAg ICAgJiYgTUFUUklYX1JPV19PVkVSTEFQU19TVUNDX1AgKHJvdyAtIDEpKQorICAgICAgICB4X2Zp eF9vdmVybGFwcGluZ19hcmVhICh3LCByb3cgLSAxLCBURVhUX0FSRUEsIE9WRVJMQVBTX0VSQVNF RF9DVVJTT1IpOworICAgICAgaWYgKE1BVFJJWF9ST1dfQk9UVE9NX1kgKHJvdykgPCB3aW5kb3df dGV4dF9ib3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Gg7CisgIGVudW0gZHJh d19nbHlwaHNfZmFjZSBobDsKKyAgLyogTm8gY3Vyc29yIGRpc3BsYXllZCBvciByb3cgaW52YWxp ZGF0ZWQgPT4gbm90aGluZyB0byBkbyBvbiB0aGUKKyAgICAgc2NyZWVuLiAqLworICBpZiAoY3Vy c29yX3R5cGUgPT0gTk9fQ1VSU09SKQorICAgIHsKKyAgICAgIGlmIChkZWJ1Z19wKQorICAgICAg ICBmcHJpbnRmIChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6ICByZXR1cm4gKCVkKVxuIiwgMSk7 CisgICAgICByZXR1cm47CisgICAgfQorICAvKiBWUE9TID49IG1hdHJpeC0+bnJvd3MgbWVhbnMg dGhhdCB3aW5kb3cgaGFzIGJlZW4gcmVzaXplZC4KKyAgICAgRG9uJ3QgYm90aGVyIHRvIGVyYXNl IHRoZSBjdXJzb3IuICovCisgIGlmICh2cG9zID49IG1hdHJpeC0+bnJvd3MpCisgICAgeworICAg ICAgaWYgKGRlYnVnX3ApCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX2VyYXNlX2N1cnNv cjogIHJldHVybiAoJWQpXG4iLCAyKTsKKyAgICAgIHJldHVybjsKKyAgICB9CisgIC8qIElmIHJv dyBjb250YWluaW5nIGN1cnNvciBpcyBtYXJrZWQgaW52YWxpZCwgdGhlcmUgaXMgbm90aGluZyB3 ZQorICAgICBjYW4gZG8uICovCisgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgeworICAgICAg aWYgKGRlYnVnX3ApCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX2VyYXNlX2N1cnNvcjog IHJldHVybiAoJWQpXG4iLCAzKTsKKyAgICAgIHJldHVybjsKKyAgICB9CisgIC8qIElmIGxpbmUg c3BhY2luZyBpcyA+IDAsIG9sZCBjdXJzb3IgbWF5IG9ubHkgYmUgcGFydGlhbGx5IHZpc2libGUg aW4KKyAgICAgd2luZG93IGFmdGVyIHNwbGl0LXdpbmRv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QTEU6ICAoc2Nyb2xsLWxlZnQgNSkgKi8KKyAgYm9v bCBoc2NsX2FsbF90ZW1wX3AgPSAody0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBhbmQgZG8gbm90 aGluZy4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzBfcCA9ICh3LT5zdXNwZW5kX2F1dG9faHNj cm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhzY3JvbGwpOworICAvKiBFWEFN UExFOiAgQy11IEMteCA8IGFuZCBkbyBzb21ldGhpbmcgZWxzZSBiZXNpZGVzIGhvcml6b250YWxs eSBzY3JvbGxpbmcgdGhlCisgICAgICAgICAgICAgICBjdXJyZW50IGxpbmUgZGlmZmVyZW50bHku CisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgaXMgX25vdF8gaG9yaXpvbnRhbGx5IHNjcm9s bGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMV9wID0gKCF3LT5zdXNw ZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNj cm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4g MAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhzY3JvbGwp OworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCAuLi4KKyAgICAgICAgICAgICAgIEN1cnJl bnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisg IGJvb2wgaHNjbF9hbGxfcGVybV8yX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPT0gMAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgKHNj cm9sbC1sZWZ0IDUpOyBhbmQsIHRoZW4gcHJlc3MgdGhlIGxlZnQgYXJyb3cga2V5IG9uZSB0aW1l LgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIF9pc18gaG9yaXpvbnRhbGx5IHNjcm9sbGVk IGRpZmZlcmVudGx5LiovCisgIGJvb2wgaHNjbF90ZW1wX3AgPSAoIXctPnN1c3BlbmRfYXV0b19o c2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAg ICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAg ICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gMCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5k IGRvIHNvbWV0aGluZyB0aGF0IGNhdXNlcyB0aGUgY3VycmVudCBsaW5lIHRvIGJlCisgICAgICAg ICAgICAgICBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuCisgICAgICAgICAgICAg ICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICov CisgIGJvb2wgaHNjbF9wZXJtX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAg ICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAg ICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hz Y3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgIT0gdy0+ aHNjcm9sbCk7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBpbnQg ZnJpbmdlX2JpdG1hcCA9IE5PX0ZSSU5HRV9CSVRNQVA7CisgIGludCBmYWNlX2lkID0gREVGQVVM VF9GQUNFX0lEOworICBpZiAoIXJlbW92ZV9wCisgICAgICAmJiBnbHlwaF9mbGF2b3IgPT0gTUNf T1ZFUkxBWV9BUlJPV19CSVRNQVAKKyAgICAgICYmICFoc2NsX2FsbF90ZW1wX3AKKyAgICAgICYm ICFoc2NsX3RlbXBfcAorICAgICAgJiYgIWhzY2xfcGVybV9wCisgICAgICAmJiAhaHNjbF9hbGxf cGVybV8wX3AKKyAgICAgICYmICFoc2NsX2FsbF9wZXJtXzFfcAorICAgICAgJiYgIWhzY2xfYWxs X3Blcm1fMl9wKQorICAgIHsKKyAgICAgIGVudW0gZmFjZV9pZCBvdmVybGF5X2Fycm93X2ZhY2Vf aWQgPQorICAgICAgICAoIWFjdGl2ZV9wCisgICAgICAgICAmJiAh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ZSSU5HRV9CSVRNQVA7CisgICAgICByb3ctPmxl ZnRfZnJpbmdlX2ZhY2VfaWQgPSBmYWNlX2lkOworICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9vZmZz ZXQgPSAwOworICAgICAgcm93LT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3AgPSBmYWxzZTsKKyAg ICAgIGRyYXdfZnJpbmdlX2JpdG1hcCAodywgcm93LCB0cnVlKTsKKyAgICB9CisgICAgZWxzZSBp ZiAoIXJlbW92ZV9wCisgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yID09IE1DX09WRVJMQVlf QVJST1dfQklUTUFQCisgICAgICAgICAgICAgJiYgKGhzY2xfYWxsX3RlbXBfcAorICAgICAgICAg ICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzBfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX2Fs bF9wZXJtXzFfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzJfcAorICAgICAg ICAgICAgICAgICB8fCBoc2NsX3RlbXBfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX3Blcm1f cCkpCisgICAgICB7CisgICAgICAgIGVudW0gZmFjZV9pZCBvdmVybGF5X2Fycm93X2ZhY2VfaWQg PQorICAgICAgICAgICghYWN0aXZlX3AKKyAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZG RVIgKHctPmNvbnRlbnRzKSwgY2hfaW5hY3RpdmVfd2luZG93cykpKQorICAgICAgICAgID8gbG9v a3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1oc2NsLWluYWN0 aXZlLWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAgICAgID8g bG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1oc2NsLWZh Y2UiKSwgdHJ1ZSkKKyAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgZmFjZV9p ZCA9IChjdXJzb3JfdHlwZSA9PSBMRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAg ICA/IG92ZXJsYXlfYXJyb3dfZmFjZV9pZAorICAgICAgICAgICAgICAgICAgOiBERUZBVUxUX0ZB Q0VfSUQ7CisgICAgICAgIGlmIChoc2NsX2FsbF9wZXJtXzBfcCkKKyAgICAgICAgICBmcmluZ2Vf Yml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC1wZXJtIiks IGZhbHNlLCBmYWxzZSk7CisgICAgICAgICAgZWxzZSBpZiAoaHNjbF9hbGxfcGVybV8xX3ApCisg ICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVy biAoIistaHNjbC1wZXJtIiksIHRydWUsIGZhbHNlKTsKKyAgICAgICAgICAgIGVsc2UgaWYgKGhz Y2xfYWxsX3Blcm1fMl9wKQorICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2Zy aW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIGZhbHNlLCB0cnVlKTsKKyAg ICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF9wZXJtX3ApCisgICAgICAgICAgICAgICAgZnJpbmdl X2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIp LCB0cnVlLCB0cnVlKTsKKyAgICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX2FsbF90ZW1wX3Ap CisgICAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAg KHcsIGludGVybiAoIistaHNjbC10ZW1wIiksIGZhbHNlLCBmYWxzZSk7CisgICAgICAgICAgICAg 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ZSwgQGxhd2xpc3QgcHJlZmVycyBub3QgdG8KKyAgICAgICAgcmVseSB1cG9u IGEgTGlzcCBzZXR0aW5nIHVzaW5nIGBzZXQtZnJpbmdlLWJpdG1hcC1mYWNlJy4gKi8KKyAgICAg ICAgcm93LT5sZWZ0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0gTEVGVF9GUklOR0Vf QklUTUFQKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBmcmlu Z2VfYml0bWFwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5P X0ZSSU5HRV9CSVRNQVA7CisgICAgICAgIHJvdy0+bGVmdF9mcmluZ2VfZmFjZV9pZCA9IGZhY2Vf aWQ7CisgICAgICAgIHJvdy0+bGVmdF9mcmluZ2Vfb2Zmc2V0ID0gMDsKKyAgICAgICAgcm93LT5m cmluZ2VfYml0bWFwX3BlcmlvZGljX3AgPSBmYWxzZTsKKyAgICAgICAgZHJhd19mcmluZ2VfYml0 bWFwICh3LCByb3csIHRydWUpOworICAgICAgfQorICAgICAgZWxzZSBpZiAoIXJlbW92ZV9wCisg ICAgICAgICAgICAgICAmJiAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklH SFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9X X1JFQ1RBTkdMRQorICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJU SUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3Ig PT0gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09 IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gpKQorICAgICAgICB7CisgICAgICAgICAgTGlzcF9P YmplY3QgYml0bWFwX2ZsYXZvciA9IChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdM RV9SSUdIVF9BUlJPVykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBR bWNfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFu Z2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZv ciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJU SUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNf dmVydGljYWxfYmFyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGds eXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jhcl9iYWNrc2xhc2gKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBRbmlsOworICAgICAgICAgIGZy aW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0gUklHSFRfRlJJTkdFX0JJVE1BUCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBsb29rdXBfZnJpbmdlX2JpdG1hcCAoYml0bWFwX2ZsYXZv cikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOT19GUklOR0VfQklUTUFQOworICAgICAg ICAgIGZhY2VfaWQgPSAoY3Vyc29yX3R5cGUgPT0gUklHSFRfRlJJTkdFX0JJVE1BUCkKKyAgICAg ICAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy12ZXJ0 aWNhbC1iYXItZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFD RV9JRDsKKyAgICAgICAgICByb3ctPmN1cnNvcl9pbl9mcmluZ2VfcCA9IGZhbHNlOworICAgICAg ICAgIHJvdy0+cmlnaHRfZnJpbmdlX2JpdG1hcCA9IGZyaW5nZV9iaXRtYXA7CisgICAgICAgICAg cm93LT5yaWdodF9mcmluZ2VfZmFjZV9pZCA9IGZhY2VfaWQ7CisgICAgICAgICAgcm93LT5yaWdo dF9mcmluZ2Vfb2Zmc2V0ID0gMDsKKyAgICAgICAgICByb3ctPmZyaW5nZV9iaXRtYXBfcGVyaW9k aWNfcCA9IGZhbHNlOworICAgICAgICAgIGRyYXdfZnJpbmdlX2JpdG1hcCAodywgcm93LCBmYWxz ZSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBI CisgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSExFU1MpCisgICAg ICAgICAgeworICAgICAgICAgICAgZG91YmxlIHRlbXBfcmVkID0gWEZMT0FUX0RBVEEgKEFSRUYg KGNvbG9yX3ZlY3RvciwgMCkpOworICAgICAgICAgICAgZG91YmxlIHRlbXBfZ3JlZW4gPSBYRkxP QVRfREFUQSAoQVJFRiAoY29sb3JfdmVjdG9yLCAxKSk7CisgICAgICAgICAgICBkb3VibGUgdGVt cF9ibHVlID0gWEZMT0FUX0RBVEEgKEFSRUYgKGNvbG9yX3ZlY3RvciwgMikpOworICAgICAgICAg ICAgLyogU29tZSBvZiB0aGVzZSB2YWx1ZXMgY29tZSB0aHJvdWdoIGFzIDEuMDAzOTA2LCB3aGlj aCBjYXVzZXMgYSBicmVha2FnZQorICAgICAgICAgICAgb2YgdGhlIGNvbG9ycyBpbiB0aGF0IG11 bHRpcGxpY2F0aW9uIGJ5IHRoZSBiYXNlIHdpbGwgZXhjZWVkIHRoZSBiYXNlLiAqLworICAgICAg ICAgICAgZG91YmxlIHJlZCA9ICh0ZW1wX3JlZCA+IDEuMCkKKyAgICAgICAgICAgICAgICAgICAg ICAgICA/IDEuMAorICAgICAgICAgICAgICAgICAgICAgICAgIDogdGVtcF9yZWQ7CisgICAgICAg ICAgICBkb3VibGUgZ3JlZW4gPSAodGVtcF9ncmVlbiA+IDEuMCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gMS4wCisgICAgICAgICAgICAgICAgICAgICAgICAgICA6IHRlbXBfZ3JlZW47 CisgICAgICAgICAgICBkb3VibGUgYmx1ZSA9ICh0ZW1wX2JsdWUgPiAxLjApCisgICAgICAgICAg ICAgICAgICAgICAgICAgID8gMS4wCisgICAgICAgICAgICAgICAgICAgICAgICAgIDogdGVtcF9i bHVlOworICAgICAgICAgICAgYm9vbCBvbl9wID0gdHJ1ZTsKKyAgICAgICAgICAgIEZSQU1FX1JJ RiAoZiktPm1jX3NjcmliZV9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhw b3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdnBvcywgd2Qs IGgsIHJlZCwgZ3JlZW4sIGJsdWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZ2x5cGhfZmxhdm9yLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uX3AsIGFjdGl2ZV9wKTsKKyAg ICAgICAgICB9Cit9CisKKy8qIER1bXAgY29udGVudHMgb2YgZ2x5cGggR0xZUEggdG8gc3RkZXJy LiAgUk9XIGFuZCBBUkVBIGFyZQorICAgdGhlIGdseXBoIHJvdyBhbmQgYXJlYSB3aGVyZSB0aGUg Z2x5cGggY29tZXMgZnJvbS4gKi8KK3ZvaWQKK21jX2R1bXBfZ2x5cGggKHN0cnVjdCBnbHlwaF9y b3cgKnJvdywgc3RydWN0IGdseXBoICpnbHlwaCwgaW50IGFyZWEsIGludCByZWxhdGl2ZV94KQor eworICBpZiAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgfHwgZ2x5cGgtPnR5cGUg PT0gR0xZUEhMRVNTX0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAg ICAgIiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQl MS4xZCAlNWQgJTRkICAlM2QgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmds eXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiBy b3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgKGdseXBo LT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgICAgID8gJ0MnCisgICAgICAgICA6ICdHJyksCisg ICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkK KyAgICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAg ICAgICAgICAgPyAnUycKKyAgICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAg ICAgICAgICAgICA/ICcwJworICAgICAgICAgICAgICAgOiAnLScpKSksCisgICAgICAgIGdseXBo LT5waXhlbF93aWR0aCwKKyAgICAgICAgZ2x5cGgtPnUuY2gsCisgICAgICAgIGdseXBoLT5mYWNl X2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+cmln aHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywg Z2x5cGgtPnZwb3MsIGdseXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgIG1jX2NoYXJf dG9fc3RyaW5nIChnbHlwaC0+dS5jaCkpOworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUg PT0gU1RSRVRDSF9HTFlQSCkKKyAgICB7CisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAg ICIgJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNnggJTRkICUxLjFkJTEu MWQgJTVkICU0ZCAgJTNkICAlM2QgJXMgJXNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlw aHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93 LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdTJywKKyAg ICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQor ICAgICAgICAgICAgPyAnQicKKyAgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQor ICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAg ICAgICAgICAgPyAnMCcKKyAgICAgICAgICA6ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVs X3dpZHRoLAorICAgICAgICAwdSwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGds eXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAor ICAgICAgICBnbHlwaC0+eCwgZ2x5cGgtPnksIGdseXBoLT5ocG9zLCBnbHlwaC0+dnBvcywgZ2x5 cGgtPnp2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgIlxcUyIpOworICAgIH0KKyAgZWxzZSBp ZiAoZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgICAgeworICAgICAgZnByaW50ZiAoc3Rk ZXJyLAorICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4 ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNkICVzICVjXG4iLAorICAgICAgICBnbHlw aCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09 IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAg ICAgICAnSScsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5 cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ0InCisgICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5 cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgOiAoTklMUCAoZ2x5cGgt Pm9iamVjdCkKKyAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgOiAnLScpKSksCisgICAgICAg IGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgKHVuc2lnbmVkIGludCkgZ2x5cGgtPnUuaW1n X2lkLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xp bmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT54 LCBnbHlwaC0+eSwgZ2x5cGgtPmhwb3MsIGdseXBoLT52cG9zLCBnbHlwaC0+enZfcCA/ICJaViIg OiAiLS0iLAorICAgICAgICAnLicpOworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0g Q09NUE9TSVRFX0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAg IiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCIsCisgICAgICAgIGds eXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0g PT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisg ICAgICAgICcrJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChn bHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnQicKKyAgICAgICAgICA6IChTVFJJTkdQIChn bHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICA6IChOSUxQIChnbHlw aC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICA6ICctJykpKSwKKyAgICAg ICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAodW5zaWduZWQgaW50KSBnbHlwaC0+dS5j bXAuaWQpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICU0ZCAlMS4xZCUxLjFkIiwKKyAgICAg ICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAg ICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wKTsKKyAgICAgIGlmIChnbHlwaC0+dS5jbXAuYXV0 b21hdGljKQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIgJTVkICU0ZCAgJTNkICAlM2QgJXMg LiBbJWQtJWRdXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoLT54LCBnbHlwaC0+ eSwgZ2x5cGgtPmhwb3MsIGdseXBoLT52cG9zLCBnbHlwaC0+enZfcCA/ICJaViIgOiAiLS0iLAor ICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoLT5zbGljZS5jbXAuZnJvbSwgZ2x5cGgtPnNs aWNlLmNtcC50byk7CisgICAgICAgIGVsc2UKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiXG4i KTsKKyAgICB9CisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IFhXSURHRVRfR0xZUEgpCisgICAg eworI2lmbmRlZiBIQVZFX1hXSURHRVRTCisgICAgICBlYXNzdW1lIChmYWxzZSk7CisjZWxzZQor ICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICAlNWQvJS01ZCAlNWQgJTRjICU2ZCAl YyAlM2QgMHglMDV4ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNkICVzICVjXG4iLAor ICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51 c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxh dGl2ZV94LAorICAgICAgICAnWCcsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAo QlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNU UklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgOiAnLScp KSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwK KyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2Jv eF9saW5lX3AsCisgICAgICAgIGdseXBoLT51Lnh3aWRnZXQsCisgICAgICAgIGdseXBoLT54LCBn bHlwaC0+eSwgZ2x5cGgtPmhwb3MsIGdseXBoLT52cG9zLCBnbHlwaC0+enZfcCA/ICJaViIgOiAi LS0iLAorICAgICAgICAnLicpOworI2VuZGlmCisgICAgfQorfQorCisvKiBEdW1wIHRoZSBjb250 ZW50cyBvZiBnbHlwaCByb3cgYXQgVlBPUyBpbiBNQVRSSVggdG8gc3RkZXJyLgorICAgR0xZUEhT IDAgbWVhbnMgZG9uJ3Qgc2hvdyBnbHlwaCBjb250ZW50cy4KKyAgIEdMWVBIUyAxIG1lYW5zIHNo b3cgZ2x5cGhzIGluIHNob3J0IGZvcm0KKyAgIEdMWVBIUyA+IDEgbWVhbnMgc2hvdyBnbHlwaHMg aW4gbG9uZyBmb3JtLiAqLwordm9pZAorbWNfZHVtcF9nbHlwaF9yb3cgKHN0cnVjdCBnbHlwaF9y b3cgKnJvdywgaW50IHZwb3MsIGludCBnbHlwaHMpCit7CisgIGludCByZWxhdGl2ZV94ID0gMDsK KyAgaWYgKGdseXBocyAhPSAxKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIlxuRFVN UCBHTFlQSCBST1dcbiIpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiUm93ICAgICBTdGFydCAg ICAgICBFbmQgVXNlZCBvRT48XFxDVFpGZXNtICAgICBYICAgIFkgICAgVyAgICBIICAgIFYgICAg QSAgICBQXG4iKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIj09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PVxuIik7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIlM2QgJTkicEQiZCAlOSJwRCJkICU0ZCAl MS4xZCUxLjFkJTEuMWQlMS4xZFwKKyUxLjFkJTEuMWQlMS4xZCUxLjFkJTEuMWQlMS4xZCUxLjFk JTEuMWQgICU0ZCAlNGQgJTRkICU0ZCAlNGQgJTRkICU0ZFxuIiwKKyAgICAgICAgIHZwb3MsCisg ICAgICAgICBNQVRSSVhfUk9XX1NUQVJUX0NIQVJQT1MgKHJvdyksCisgICAgICAgICBNQVRSSVhf Uk9XX0VORF9DSEFSUE9TIChyb3cpLAorICAgICAgICAgcm93LT51c2VkW1RFWFRfQVJFQV0sCisg ICAgICAgICByb3ctPmNvbnRhaW5zX292ZXJsYXBwaW5nX2dseXBoc19wLAorICAgICAgICAgcm93 LT5lbmFibGVkX3AsCisgICAgICAgICByb3ctPnRydW5jYXRlZF9vbl9sZWZ0X3AsCisgICAgICAg ICByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wLAorICAgICAgICAgcm93LT5jb250aW51ZWRfcCwK KyAgICAgICAgIE1BVFJJWF9ST1dfQ09OVElOVUFUSU9OX0xJTkVfUCAocm93KSwKKyAgICAgICAg IE1BVFJJWF9ST1dfRElTUExBWVNfVEVYVF9QIChyb3cpLAorICAgICAgICAgcm93LT5lbmRzX2F0 X3p2X3AsCisgICAgICAgICByb3ctPmZpbGxfbGluZV9wLAorICAgICAgICAgcm93LT5lbmRzX2lu X21pZGRsZV9vZl9jaGFyX3AsCisgICAgICAgICByb3ctPnN0YXJ0c19pbl9taWRkbGVfb2ZfY2hh cl9wLAorICAgICAgICAgcm93LT5tb3VzZV9mYWNlX3AsCisgICAgICAgICByb3ctPngsCisgICAg ICAgICByb3ctPnksCisgICAgICAgICByb3ctPnBpeGVsX3dpZHRoLAorICAgICAgICAgcm93LT5o ZWlnaHQsCisgICAgICAgICByb3ctPnZpc2libGVfaGVpZ2h0LAorICAgICAgICAgcm93LT5hc2Nl bnQsCisgICAgICAgICByb3ctPnBoeXNfYXNjZW50KTsKKyAgICAgIC8qIFRoZSBuZXh0IDMgbGl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Aoc3RkZXJyLCAiR2x5cGgjL1RvdGFsIFJl bC5YIFQgICAgICAgUG9zIE8gICBXICAgICBDb2RlIEZhY2UgTFIgICAgIFggICAgWSBIUE9TIFZQ T1MgWlYgQ1xuIik7CisgICAgZm9yICg7IGdseXBoIDwgZ2x5cGhfZW5kOyArK2dseXBoKQorICAg ICAgeworICAgICAgICBtY19kdW1wX2dseXBoIChyb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94 KTsKKyAgICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICB9Cisg IH0KKyAgICB9CisgIGVsc2UgaWYgKGdseXBocyA9PSAxKQorICAgIHsKKyAgICAgIGNoYXIgc1tT SFJUX01BWCArIDRdOworICAgICAgZm9yIChpbnQgYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFy ZWEgPCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAgeworICAgIGludCBpOworICAgIGZvciAoaSA9IDA7 IGkgPCByb3ctPnVzZWRbYXJlYV07ICsraSkKKyAgICAgIHsKKyAgICAgICAgc3RydWN0IGdseXBo ICpnbHlwaCA9IHJvdy0+Z2x5cGhzW2FyZWFdICsgaTsKKyAgICAgICAgaWYgKGkgPT0gcm93LT51 c2VkW2FyZWFdIC0gMQorICAgICAgJiYgYXJlYSA9PSBURVhUX0FSRUEKKyAgICAgICYmIE5JTFAg KGdseXBoLT5vYmplY3QpCisgICAgICAmJiBnbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAg ICAmJiBnbHlwaC0+dS5jaCA9PSAnICcpCisgICAgeworICAgICAgc3RyY3B5ICgmc1tpXSwgIltc XG5dIik7CisgICAgICBpICs9IDQ7CisgICAgfQorICAgICAgICBlbHNlIGlmIChnbHlwaC0+dHlw ZSA9PSBDSEFSX0dMWVBICisgICAgICAgICAgICYmIGdseXBoLT51LmNoIDwgMHg4MAorICAgICAg ICAgICAmJiBnbHlwaC0+dS5jaCA+PSAn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JmQ1LCAm eXBvcyk7CisgICAgICBpbnQgaGVhZGVyX2xpbmVfaGVpZ2h0ID0gV0lORE9XX0hFQURFUl9MSU5F X0hFSUdIVCAodyk7CisgICAgICBpbnQgdm9mZnNldCA9IChoZWFkZXJfbGluZV9oZWlnaHQgPiAw CisgICAgICAgICAgICAgICAgICAgICAmJiB5cG9zID4gMCkKKyAgICAgICAgICAgICAgICAgICAg ICA/IHlwb3MgKyAxCisgICAgICAgICAgICAgICAgICAgICAgOiB5cG9zOworICAgICAgaWYgKHZp c2libGVfcCkKKyAgICAgICAgdnBvcyA9IHZvZmZzZXQ7CisgICAgICAgIGVsc2UKKyAgICAgICAg ICB2cG9zID0gMDsKKyAgICB9CisgICAgZWxzZQorICAgICAgeworICAgICAgICBDSEVDS19OVU1C RVIgKHJvdyk7CisgICAgICAgIHZwb3MgPSBYRklYTlVNIChyb3cpOworICAgICAgfQorICBtYXRy aXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAgaWYgKHZwb3MgPj0gMCAmJiB2cG9zIDwgbWF0cml4 LT5ucm93cykKKyAgICBtY19kdW1wX2dseXBoX3JvdyAoTUFUUklYX1JPVyAobWF0cml4LCB2cG9z KSwKKyAgICAgICAgdnBvcywKKyAgICAgICAgVFlQRV9SQU5HRURfRklYTlVNUCAoaW50LCBnbHlw aHMpID8gWEZJWE5VTSAoZ2x5cGhzKSA6IDIpOworICByZXR1cm4gUW5pbDsKK30KKwordm9pZAor bWNfZHVtcF9nbHlwaF9tYXRyaXggKHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgaW50IGds eXBocykKK3sKKyAgaW50IGk7CisgIGZvciAoaSA9IDA7IGkgPCBtYXRyaXgtPm5yb3dzOyArK2kp CisgICAgbWNfZHVtcF9nbHlwaF9yb3cgKE1BVFJJWF9ST1cgKG1hdHJpeCwgaSksIGksIGdseXBo cyk7Cit9CisKK0RFRlVOICgibWMtZHVtcC1nbHlwaC1tYXRyaXgiLCBGbWNfZHVtcF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yc29yLnZwb3MpOworICBmcHJpbnRmIChzdGRlcnIsICI9PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiIpOworICBtY19kdW1wX2dseXBoX21hdHJpeCAo dy0+Y3VycmVudF9tYXRyaXgsCisgICAgICAgICBUWVBFX1JBTkdFRF9GSVhOVU1QIChpbnQsIGds eXBocykgPyBYRklYTlVNIChnbHlwaHMpIDogMCk7CisgIHJldHVybiBRbmlsOworfQorCitzdGF0 aWMgdm9pZAorbWNfaGVscGVyIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4 ICptYXRyaXgsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKKyAgICAgICAgICAgc3RydWN0IGdseXBo ICpnbHlwaCwgaW50IHgsIGludCBmeCwgaW50IHksIGludCBmeSwgaW50IGhwb3MsIGludCB2cG9z LAorICAgICAgICAgICBpbnQgd2QsIGludCBoLCBlbnVtIHRleHRfY3Vyc29yX2tpbmRzIGN1cnNv cl90eXBlLCBpbnQgY3Vyc29yX3dpZHRoLAorICAgICAgICAgICBMaXNwX09iamVjdCBmb3JlZ3Jv dW5kLCBMaXNwX09iamVjdCBiYWNrZ3JvdW5kLCBib29sIGFjdGl2ZV9wLAorICAgICAgICAgICBl bnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IsIGJvb2wgZHJhd19wLCBMaXNwX09iamVjdCAqcmVz dWx0KQoreworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgZW51bSBm YWNlX2lkIHNwZWNpYWxfY2hhcl9mYWNlX2lkID0KKyAgICBsb29rdXBfbmFtZWRfZmFjZSAodywg ZiwgaW50ZXJuICgiKy1zcGVjaWFsLWNoYXJhY3Rlci1mYWNlIiksIHRydWUpOworICBzdHJ1Y3Qg ZmFjZSAqc3BlY2lhbF9jaGFyX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIHNw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cmVtb3ZlX3ApOworICBMaXNwX09iamVjdCBmb3VydGVlbl9l bGVtZW50cyA9IG1jX2xpc3RuICgxNCwgbWFrZV9maXhudW0gKHgpLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFrZV9maXhudW0gKGZ4KSwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ha2VfZml4bnVtICh5 KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ha2Vf Zml4bnVtIChmeSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBtYWtlX2ZpeG51bSAoaHBvcyksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBtYWtlX2ZpeG51bSAodnBvcyksCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYWtlX2ZpeG51bSAod2QpLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFrZV9maXhudW0gKGgpLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWNfY3Vyc29y X3R5cGVfdG9fbGlzcCAoY3Vyc29yX3R5cGUpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgbWFrZV9maXhudW0gKGN1cnNvcl93aWR0aCksCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ha2VfZml4 bnVtIChhY3RpdmVfcCksCisgICAgICAgICAgICAgICAgICAgICAgICAgIC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eSAoc3RydWN0IHdpbmRvdyAqdywg c3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgc3Ry dWN0IGdseXBoX3JvdyAqcm93LCBpbnQgeCwgaW50ICpmeCwgaW50IHksCisgICAgICAgICAgICAg ICAgICAgICAgICBpbnQgKmZ5LCBpbnQgaHBvcywgaW50IHZwb3MsIGludCAqaCwKKyAgICAgICAg ICAgICAgICAgICAgICAgIGVudW0gdGV4dF9jdXJzb3Jfa2luZHMgY3Vyc29yX3R5cGUsIGludCBj dXJzb3Jfd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgKndkKQoreworICBzdHJ1 Y3QgZ2x5cGggKmdseXBoID0gbWNfZ2V0X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIGhw b3MsIHZwb3MpOworICBpZiAoZ2x5cGggPT0gTlVMTCkKKyAgICByZXR1cm47CisgIHN0cnVjdCBm cmFtZSAqZiA9IFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7CisgICpmeCA9IFdJTkRPV19URVhU X1RPX0ZSQU1FX1BJWEVMX1ggKHcsIHgpOworICAqaCA9IHJvdy0+dmlzaWJsZV9oZWlnaHQ7Cisg IC8qIERvbid0IGxldCB0aGUgY3Vyc29yIGV4Y2VlZCB0aGUgZGltZW5zaW9ucyBvZiB0aGUgcm93 LCBzbyB0aGF0CisgIHRoZSB1cHBlci9sb3dlciBzaWRlIG9mIHRoZSBib3ggYXJlbid0IGNsaXBw ZWQuICAqLworICBpbnQgd19oZWFkZXJfbGluZV9oZWlnaHQgPSBXSU5ET1dfSEVBREVSX0xJTkVf SEVJR0hUICh3KTsKKyAgaW50IHdfdGV4dF9ib3R0b21feSA9IHdpbmRvd190ZXh0X2JvdHRvbV95 ICh3KSAtICpoOworICBpZiAoeSA8IHdfaGVhZGVyX2xpbmVfaGVpZ2h0KQorICAgIHsKKyAgICAg ICpoID0gbWF4ICgqaCAtICh3X2hlYWRlcl9saW5lX2hlaWdodCAtIHkpICsgMSwgKmgpOworICAg ICAgeSA9IHdfaGVhZGVyX2xpbmVfaGVpZ2h0IC0gMTsKKyAgICAgIC8vIGZwcmludGYgKHN0ZGVy ciwgIkNPTkRJVElPTiAjIDFcbiIpOworICAgIH0KKyAgIGVsc2UgaWYgKHkgPiB3X3RleHRfYm90 dG9tX3kpCisgICAgIHsKKyAgICAgICAqaCArPSB5IC0gd190ZXh0X2JvdHRvbV95OworICAgICAg IHkgPSB3X3RleHRfYm90dG9tX3k7CisgICAgICAgLy8gZnByaW50ZiAoc3RkZXJyLCAiQ09ORElU SU9OICMgMlxuIik7CisgICAgIH0KKyAgKmZ5ID0gV0lORE9XX1RPX0ZSQU1FX1BJWEVMX1kgKHcs IHkpOworICBzd2l0Y2ggKGN1cnNvcl90eXBlKQorICAgIHsKKyAgICAgIGNhc2UgQkFSX0NVUlNP UjoKKyAgICAgICAgeworICAgICAgICAgIGlmIChjdXJzb3Jfd2lkdGggPCAxKQorICAgICAgICAg ICAgY3Vyc29yX3dpZHRoID0gbWF4IChGUkFNRV9DVVJTT1JfV0lEVEggKGYpLCAxKTsKKyAgICAg ICAgICBpZiAoY3Vyc29yX3dpZHRoIDwgZ2x5cGgtPnBpeGVsX3dpZHRoKQorICAgICAgICAgICp3 ZCA9IGN1cnNvcl93aWR0aDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgY2Fz ZSBIQkFSX0NVUlNPUjoKKyAgICAgICAgeworICAgICAgICAgIGludCBjdXJzb3JfaGVpZ2h0ID0g KGN1cnNvcl93aWR0aCA8IDEpID8gbHJpbnQgKDAuMjUgKiAqaCkgOiBjdXJzb3Jfd2lkdGg7Cisg ICAgICAgICAgaWYgKGN1cnNvcl9oZWlnaHQgPiByb3ctPmhlaWdodCkKKyAgICAgICAgICAgIGN1 cnNvcl9oZWlnaHQgPSByb3ctPmhlaWdodDsKKyAgICAgICAgICAvKiBDdXJzb3Igc21hbGxlciB0 aGFuIGxpbmUgaGVpZ2h0LCBzbyBtb3ZlIGRvd24uICovCisgICAgICAgICAgaWYgKCpoID4gY3Vy c29yX2hlaWdodCkKKyAgICAgICAgICAgICpmeSArPSAqaCAtIGN1cnNvcl9oZWlnaHQ7CisgICAg ICAgICAgKmggPSBjdXJzb3JfaGVpZ2h0OworICAgICAgICAgICp3ZCA9IGdseXBoLT5waXhlbF93 aWR0aDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgY2FzZSBSSUdIVF9GUklO R0VfQklUTUFQOgorICAgICAgY2FzZSBMRUZUX0ZSSU5HRV9CSVRNQVA6CisgICAgICBjYXNlIERF RkFVTFRfQ1VSU09SOgorICAgICAgY2FzZSBOT19DVVJTT1I6CisgICAgICBjYXNlIE5PX0ZSSU5H RV9CSVRNQVA6CisgICAgICBjYXNlIEZSQU1FRF9CT1hfQ1VSU09SOgorICAgICAgY2FzZSBGSUxM RURfQk9YX0NVUlNPUjoKKyAgICAgIGNhc2UgSE9MTE9XX0JPWF9DVVJTT1I6CisgICAgICBkZWZh dWx0OgorICAgICAgLyogQ29tcHV0ZSB0aGUgd2lkdGggb2YgdGhlIHJlY3RhbmdsZSB0byBkcmF3 LiAgSWYgb24gYSBzdHJldGNoIGdseXBoLCBhbmQKKyAgICAgIGB4LXN0cmV0Y2gtY3Vyc29yJyBp cyBuaWwsIGRvbid0IGRyYXcgYSByZWN0YW5nbGUgYXMgd2lkZSBhcyB0aGUgZ2x5cGgsIGJ1dAor ICAgICAgdXNlIGEgY2Fub25pY2FsIGNoYXJhY3RlciB3aWR0aCBpbnN0ZWFkLiAqLworICAgICAg KndkID0gKGdseXBoLT50eXBlID09IFNUUkVUQ0hfR0xZUEgKKyAgICAgICAgICAgICAmJiAheF9z dHJldGNoX2N1cnNvcl9wKQorICAgICAgICAgICAgPyBtaW4gKEZSQU1FX0NPTFVNTl9XSURUSCAo ZiksIGdseXBoLT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgIDogZ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aAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogZmFsc2U7CisgIGludCBmcmFtZV9jaGFyX3dpZHRoID0gRlJB TUVfQ09MVU1OX1dJRFRIIChmKTsKKyAgaW50IHRlbXBfZmFjZV9pZCA9IGdseXBoLT5mYWNlX2lk OworICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9IChvcG9pbnRfeCA9PSByZWxhdGl2ZV94Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF9ocG9zID09IGhwb3MKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3kgPT0gZ2x5cGgtPnkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3Zwb3MgPT0gdnBvcyk7CisKKy8qIC0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgIEJFR0lOOiAgQ0hBUl9H TFlQSCB8IEdMWVBITEVTU19HTFlQSCAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0gKi8KKyAgaWYgKGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgIHx8IGds eXBoLT50eXBlID09IEdMWVBITEVTU19HTFlQSCkKKyAgeworICAgIGlmIChtY19zdGRlcnJfcCkK KyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQgJWMg JTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNkICVz ICVzXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAg ICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAg ICAgICByZWxhdGl2ZV94LAorICAgICAgICAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAg ICAgICAgPyAnQycKKyAgICAgICAgIDogJ0cnKSwKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisg ICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAg IDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAg ICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgID8gJzAnCisgICAgICAg ICAgICAgICA6ICctJykpKSwKKyAgICAgICAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAg ICAgICBnbHlwaC0+dS5jaCwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBo LT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAg ICAgICBnbHlwaC0+eCwgZ2x5cGgtPnksIGdseXBoLT5ocG9zLCBnbHlwaC0+dnBvcywgZ2x5cGgt Pnp2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgbWNfY2hhcl90b19zdHJpbmcgKGdseXBoLT51 LmNoKSk7CisgIHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LSAqLworLyogICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTOiAgQ0hBUl9HTFlQSCB8IEdM WVBITEVTU19HTFlQSCAgICAgICAgICAgIC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ICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91 bmQsCisgICAgICAgICAgICAgICAgICAgbWNfYmdfbHNsICh3LCB0ZW1wX2ZhY2VfaWQpLCBhY3Rp dmVfcCwKKyAgICAgICAgICAgICAgICAgICBNQ19HTFlQSCwgZHJhd19wLCByZXN1bHQpOworICAg ICAgaWYgKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0g LSAxCisgICAgICAgICAgJiYgcmVsYXRpdmVfeCA8PSB4X2xpbWl0KQorICAgICAgICB7CisgICAg ICAgICAgaWYgKHJlbGF0aXZlX3ggPCByb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAg ICAgICAgZnggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgfQorICAgICAgICAg IG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnks IGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICB4X2xpbWl0IC0gcmVsYXRpdmVfeCwg aCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgIGZvcmVn cm91bmQsIG1jX2JnX2xzbCAodywgdGVtcF9mYWNlX2lkKSwgYWN0aXZlX3AsCisgICAgICAgICAg ICAgICAgICAgICBNQ19HTFlQSExFU1MsIGRyYXdfcCwgcmVzdWx0KTsKKyAgICAgICAgfQorICAg ICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAg ICAgIFZFUlRJQ0FMX1JVTEVSOiAgQ0hBUl9HTFlQSCB8IEdMWVBITEVTU19HTFlQSCAgICAgICAg ICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgVkVSVElDQUxf UlVMRVI6CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1cnNv cl9pbl9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9y aWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJS T1cKKyAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAgICAgICAg ICAgICAgICAgICAmJiByb3ctPmNvbnRpbnVlZF9wKQorICAgICAgICAgICAgICAgICAgICAgPyBN Q19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2lu X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3Jp Z2h0X3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcCkKKyAgICAg ICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgOiAo Z2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAg ICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeCA+PSByb3ctPnBpeGVsX3dpZHRoKQorICAg ICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICA6ICh6 dl9wKQ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B7CisgICAgICBlbnVtIG1j X2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09 IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWMuZmNfeCA+ PSByb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MK KyAgICAgICAgICAgICAgICAgICA6ICh6dl9wKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19H TFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICA6ICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWly cykpCisgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAgICYmIG9w b2ludF95ID09IHkKKyAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfdnBvcyA9PSB2cG9z KQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAg ICA6IE1DX0dMWVBIOworICAgICAgd2QgPSAxOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgs IHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZjX2Z4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAg ICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQs CisgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAodywgdGVtcF9mYWNlX2lkKSwgYWN0aXZlX3As CisgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgZHJhd19wLCByZXN1bHQpOworICAgICAg YnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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zZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVs YXRpdmVfeCwKKyAgICAgICAgJ1MnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAg KEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RS SU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6IChO SUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICAgICAg IDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIDB1LAorICAg ICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAg ICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT54LCBnbHlwaC0+ eSwgZ2x5cGgtPmhwb3MsIGdseXBoLT52cG9zLCBnbHlwaC0+enZfcCA/ICJaViIgOiAiLS0iLAor ICAgICAgICAiXFxTIik7CisgIHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JT OiAgU1RSRVRDSF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0gKi8KKyAgICBjYXNlIE1VTFRJUExFX0NVUlNPUlM6CisgICAgeworICAgICAgbWNfaGVs cGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywg dnBvcywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgs IGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAodywgdGVtcF9mYWNlX2lk KSwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgIE1DX0dMWVBILCBkcmF3X3AsIHJlc3VsdCk7 CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAg ICAgICAgICAgICAgICAgICAgSE9SSVpPTlRBTF9SVUxFUjogIFNUUkVUQ0hfR0xZUEggICAgICAg ICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBIT1JJ Wk9OVEFMX1JVTEVSOgorICAgIHsKKyAgICAgIGlmIChyZWxhdGl2ZV94IDwgcm93LT5waXhlbF93 aWR0aAorICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBl ciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZw b3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgs IGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgICAgbWNfYmdfbHNsICh3LCB0ZW1wX2ZhY2Vf aWQpLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICBNQ19HTFlQSCwgZHJhd19wLCByZXN1 bHQpOworICAgICAgaWYgKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVz ZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYgcmVsYXRpdmVfeCA8PSB4X2xpbWl0KQorICAgICAg ICB7CisgICAgICAgICAgaWYgKHJlbGF0aXZlX3ggPCByb3ctPnBpeGVsX3dpZHRoKQorICAgICAg ICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgdGVtcF9m YWNlX2lkID0gKHJvdy0+ZmlsbF9saW5lX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgPyBn bHlwaC0+ZmFjZV9pZAorICAgICAgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lE OworICAgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94 LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICB4X2xpbWl0IC0g cmVsYXRpdmVfeCwgaCwgY3Vyc29yX3R5cGUsIHhfbGltaXQgLSByZWxhdGl2ZV94LAorICAgICAg ICAgICAgICAgICAgICAgZm9yZWdyb3VuZCwgbWNfYmdfbHNsICh3LCB0ZW1wX2ZhY2VfaWQpLCBh Y3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgIE1DX0dMWVBITEVTUywgZHJhd19wLCByZXN1 bHQpOworICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIFNUUkVU Q0hfR0xZUEggICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICov CisgICAgY2FzZSBWRVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAgICBpZiAocm93LT5maWxsX2xp bmVfcAorICAgICAgICAgICYmIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ct PnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYgb3BvaW50X3ggPiByZWxhdGl2ZV94ICsgZ2x5 cGgtPnBpeGVsX3dpZHRoKQorICAgICAgICB0ZW1wX2ZhY2VfaWQgPSBnbHlwaC0+ZmFjZV9pZDsK KyAgICAgICAgZWxzZSBpZiAoIXJvdy0+ZmlsbF9saW5lX3AKKyAgICAgICAgICAgICAgICAgJiYg Z2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAg ICAgICAgICAgICAgICAgJiYgb3BvaW50X3ggPiByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dp ZHRoKQorICAgICAgICAgIHRlbXBfZmFjZV9pZCA9IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgIGVu dW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAgICAg ICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAg ICAgICAgID8gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAg OiAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT5jb250 aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFT SAorICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9pbl9mcmluZ2VfcAorICAgICAgICAgICAg ICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wCisgICAgICAgICAgICAgICAg ICAgICAgJiYgIXJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZF UlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgIDogTUNfR0xZUEhMRVNTOworICAgICAgaWYg KGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8 fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgIHx8 IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIpCisgICAgICAgIGN1cnNvcl90eXBlID0g UklHSFRfRlJJTkdFX0JJVE1BUDsKKyAgICAgIHdkID0gMTsKKyAgICAgIG1jX2hlbHBlciAodywg bWF0cml4LCByb3csIGdseXBoLCBvcG9pbnRfeCwgb3BvaW50X2Z4LCB5LCBmeSwgaHBvcywgdnBv cywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZv cmVncm91bmQsCisgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAodywgdGVtcF9mYWNlX2lkKSwg YWN0aXZlX3AsCisgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgZHJhd19wLCByZXN1bHQp OworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAg ICAgICAgICAgICAgICAgICAgICAgIEZJTExfQ09MVU1OOiAgU1RSRVRDSF9HTFlQSCAgICAgICAg ICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS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EVYVF9BUkVBXSwKKyAg ICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSks CisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdJJywKKyAgICAgICAgZ2x5cGgtPmNoYXJw b3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAg ICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAg ICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgID8gJzAnCisg ICAgICAgICAgICAgICA6ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAg ICAgICAodW5zaWduZWQgaW50KSBnbHlwaC0+dS5pbWdfaWQsCisgICAgICAgIGdseXBoLT5mYWNl X2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+cmln aHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywg Z2x5cGgtPnZwb3MsIGdseXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7Cisg IHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyog ICAgICAgICAgICAgICAgICAgICAgICAgTVVMVElQTEVfQ1VSU09SUzogIElNQUdFX0dMWVBIICAg ICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNl IE1VTFRJUExFX0NVUlNPUlM6CisgICAgeworICAgICAgY3Vyc29yX3R5cGUgPSBIT0xMT1dfQk9Y X0NVUlNPUjsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2 ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJz b3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICBtY19i Z19sc2wgKHcsIHRlbXBfZmFjZV9pZCksIGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICBNQ19H TFlQSCwgZHJhd19wLCByZXN1bHQpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICBIT1JJWk9OVEFMX1JVTEVS OiAgSU1BR0VfR0xZUEggICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLSAqLworICAgIGNhc2UgSE9SSVpPTlRBTF9SVUxFUjoKKyAgICB7CisgICAgICBjdXJzb3Jf dHlwZSA9IEhPTExPV19CT1hfQ1VSU09SOworICAgICAgaWYgKCFyZWFsX2Zha2VfY3Vyc29yX3Ap CisgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBm eCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90 eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgICAgbWNfYmdf bHNsICh3LCB0ZW1wX2ZhY2VfaWQpLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICBNQ19H TFlQSCwgZHJhd19wLCByZXN1bHQpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgIFZFUlRJQ0FMX1JVTEVS OiAgSU1BR0VfR0xZUEggICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLSAqLworICAgIGNhc2UgVkVSVElDQUxfUlVMRVI6CisgICAgeworICAgICAgY3Vyc29yX3R5 cGUgPSBIT0xMT1dfQk9YX0NVUlNPUjsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3cs IGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAg ICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLAorICAgICAg ICAgICAgICAgICBtY19iZ19sc2wgKHcsIHRlbXBfZmFjZV9pZCksIGFjdGl2ZV9wLAorICAgICAg ICAgICAgICAgICBNQ19HTFlQSCwgZHJhd19wLCByZXN1bHQpOworICAgICAgYnJlYWs7CisgICAg fQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAg ICBGSUxMX0N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tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAg ICAgICAgICAgICAgICAgIEJFR0lOOiAgQ09NUE9TSVRFX0dMWVBIICAgICAgICAgICAgICAgICAg ICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgIGVsc2UgaWYgKGdseXBoLT50 eXBlID09IENPTVBPU0lURV9HTFlQSCkKKyAgeworICAgIGlmIChtY19zdGRlcnJfcCkKKyAgICAg IHsKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAgICJcbiAlNSJwRCJkLyUtNWQg JTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCIsCisgICAgICAgICAgZ2x5cGggLSByb3ctPmds eXBoc1tURVhUX0FSRUFdLAorICAgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6 IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICAg JysnLAorICAgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAgIChCVUZGRVJQIChnbHlw aC0+b2JqZWN0KQorICAgICAgICAgICA/ICdCJworICAgICAgICAgICA6IChTVFJJTkdQIChnbHlw aC0+b2JqZWN0KQorICAgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgICA6IChOSUxQIChn bHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgICAgICA/ICcwJworICAgICAgICAgICAgICAgICA6 ICctJykpKSwKKyAgICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgICAgKHVuc2ln bmVkIGludCkgZ2x5cGgtPnUuY21wLmlkKTsKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICU0 ZCAlMS4xZCUxLjFkIiwKKyAgICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgICBnbHlw aC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wKTsK KyAgICAgIGlmIChnbHlwaC0+dS5jbXAuYXV0b21hdGljKQorICAgICAgICBmcHJpbnRmIChzdGRl cnIsICIgJTVkICU0ZCAgJTNkICAlM2QgJXMgLiBbJWQtJWRdXG4iLAorICAgICAgICAgICAgICAg ICAgICAgICAgIGdseXBoLT54LCBnbHlwaC0+eSwgZ2x5cGgtPmhwb3MsIGdseXBoLT52cG9zLCBn bHlwaC0+enZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBo LT5zbGljZS5jbXAuZnJvbSwgZ2x5cGgtPnNsaWNlLmNtcC50byk7CisgICAgICAgIGVsc2UKKyAg ICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJcbiIpOworICAgICAgfQorICBzd2l0Y2ggKGFjdGlv bl90eXBlKQorICB7CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAg ICAgICAgICBNVUxUSVBMRV9DVVJTT1JTOiAgQ09NUE9TSVRFX0dMWVBIICAgICAgICAgICAgICAg ICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBNVUxUSVBMRV9DVVJT T1JTOgorICAgIHsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxh dGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkL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KKyAgICAgICAgICAmJiByZWxhdGl2ZV94IDw9 IHhfbGltaXQpCisgICAgICAgIHsKKyAgICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhl bF93aWR0aDsKKyAgICAgICAgICB3aGlsZSAocmVsYXRpdmVfeCA8PSB4X2xpbWl0KQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwg cmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAg ICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLAorICAgICAg ICAgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAodywgdGVtcF9mYWNlX2lkKSwgYWN0aXZlX3As CisgICAgICAgICAgICAgICAgICAgICAgICAgTUNfR0xZUEhMRVNTLCBkcmF3X3AsIHJlc3VsdCk7 CisgICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZnJhbWVfY2hhcl93aWR0aDsKKyAgICAgICAg ICAgIH0KKyAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIENPTVBP U0lURV9HTFlQSCAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAq LworICAgIGNhc2UgVkVSVElDQUxfUlVMRVI6CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3Ig Z2x5cGhfZmxhdm9yID0gKGN1cnNvcl9pbl9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAm JiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19W RVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfaW5f ZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPmNvbnRpbnVlZF9wKQorICAg ICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAg ICAgICAgICAgOiAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYg IXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93 LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisg ICAgICAgICAgICAgICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJv dy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeCA+IHJl bGF0aXZlX3gpCisgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAg ICAgICAgICAgIDogKHp2X3ApCisgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUwor ICAgICAgICAgICAgICAgICAgIDogTUNfR0xZUEg7CisgICAgICBpZiAoZ2x5cGhfZmxhdm9yID09 IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9 PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09 IE1DX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgY3Vyc29yX3R5cGUgPSBSSUdIVF9GUklOR0VfQklU TUFQOworICAgICAgd2QgPSAxOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5 cGgsIHJlbGF0aXZlX3gsIG9wb2ludF9meCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAg ICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLAorICAg ICAgICAgICAgICAgICBtY19iZ19sc2wgKHcsIHRlbXBfZmFjZV9pZCksIGFjdGl2ZV9wLAorICAg ICAgICAgICAgICAgICBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgcmVzdWx0KTsKKyAgICAgIGJyZWFr OworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAg ICAgICAgIEZJTExfQ09MVU1OOiAgQ09NUE9TSVRFX0dMWVBIICAgICAgICAgICAgICAgICAgICAg ICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEZJTExfQ09MVU1OOgorICAg IHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChnbHlwaCAtIHJvdy0+Z2x5 cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAg ICAgICYmIHctPm1jLmZjX3ggPiByZWxhdGl2ZV94KQorICAgICAgICAgICAgICAgICAgICAgPyBN Q19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICA6ICh6dl9wKQorICAgICAgICAgICAgICAg ICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICA6ICghTklMUCAoQlZBUiAo YiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhC VUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAg ICAgICAgICYmIG9wb2ludF95ID09IHkKKyAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRf dnBvcyA9PSB2cG9zKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAg ICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgd2QgPSAxOworICAgICAgbWNfaGVscGVy ICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZjX2Z4LCB5LCBmeSwgaHBvcywg dnBvcywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgs IGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAodywgdGVtcF9mYWNlX2lk KSwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgZHJhd19wLCByZXN1 bHQpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgIH0K KyAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIEVORDogIENPTVBPU0lURV9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgICAgKi8K Ky8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8q ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCRUdJTjogIFhXSURHRVRfR0xZUEggICAgICAg ICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgIGVsc2Ug aWYgKGdseXBoLT50eXBlID09IFhXSURHRVRfR0xZUEgpCisgIHsKKyNpZm5kZWYgSEFWRV9YV0lE R0VUUworICAgIGVhc3N1bWUgKGZhbHNlKTsKKyNlbHNlCisgICAgaWYgKG1jX3N0ZGVycl9wKQor ICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiXG4gICU1ZC8lLTVkICU1ZCAlNGMgJTZk ICVjICUzZCAweCUwNXggJTRkICUxLjFkJTEuMWQgJTVkICU0ZCAgJTNkICAlM2QgJXMgJWNcbiIs CisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ct PnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJl bGF0aXZlX3gsCisgICAgICAgICdYJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAg IChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNU UklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgOiAn LScpKSwKKyAgICAgICAgZ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LS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgSE9SSVpPTlRBTF9SVUxFUjogIFhXSURH RVRfR0xZUEggICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICov CisgICAgY2FzZSBIT1JJWk9OVEFMX1JVTEVSOgorICAgIHsKKyAgICAgIGlmIChyZWxhdGl2ZV94 IDw9IHhfbGltaXQKKyAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICBt Y19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBo cG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29y X3dpZHRoLCBmb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAodywgdGVt cF9mYWNlX2lkKSwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgTUNfR0xZUEgsIGRyYXdf cCwgcmVzdWx0KTsKKyAgICAgIGlmIChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0g cm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICYmIHJlbGF0aXZlX3ggPD0geF9saW1pdCkK KyAgICAgICAgeworICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOwor ICAgICAgICAgIHdoaWxlIChyZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94 LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgd2QsIGgs IGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAg ICAgICAgICAgbWNfYmdfbHNsICh3LCB0ZW1wX2ZhY2VfaWQpLCBhY3RpdmVfcCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICBNQ19HTFlQSExFU1MsIGRyYXdfcCwgcmVzdWx0KTsKKyAgICAgICAg ICAgICAgcmVsYXRpdmVfeCArPSBmcmFtZV9jaGFyX3dpZHRoOworICAgICAgICAgICAgfQorICAg ICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8q ICAgICAgICAgICAgICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIFhXSURHRVRfR0xZUEgg ICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2Fz ZSBWRVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2 b3IgPSAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1 bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JB Ul9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9pbl9mcmluZ2VfcAor ICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAg ICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICAgICAgICAgICA6 IChjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVu Y2F0ZWRfb25fcmlnaHRfcAorICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPmNvbnRpbnVl ZF9wKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAg ICAgICAgICA6IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2Fy ZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF94ID4gcmVsYXRpdmVfeCkK KyAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAg OiAoenZfcCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAg ICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElD QUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJ Q0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElD QUxfQkFSKQorICAgICAgICBjdXJzb3JfdHlwZSA9IFJJR0hUX0ZSSU5HRV9CSVRNQVA7CisgICAg ICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgb3BvaW50X2Z4 LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBl LCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIG1jX2JnX2xzbCAo dywgdGVtcF9mYWNlX2lkKSwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZv ciwgZHJhd19wLCByZXN1bHQpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgIEZJTExfQ09MVU1OOiAgWFdJ REdFVF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LSAqLworICAgIGNhc2UgRklMTF9DT0xVTU46CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3Ig Z2x5cGhfZmxhdm9yID0gKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVz ZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWMuZmNfeCA+IHJlbGF0 aXZlX3gpCisgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAg ICAgICAgIDogKHp2X3ApCisgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAg ICAgICAgICAgICAgICAgIDogKCFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAg ICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF92 ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3kgPT0geQor ICAgICAgICAgICAgICAgICAgICAg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nN0YXJ0 LCBpbnQgeCwgaW50IGhwb3NfbGVuZ3RoLCBpbnQgdnBvcywKKyAgICAgICAgICAgICBpbnQgYm90 dG9tX3Zwb3MsIGJvb2wgYWN0aXZlX3AsIGJvb2wgZHJhd19wKQoreworLyoKKyAgY2xvY2tfdCBj bG9ja19zdGFydCA9IGNsb2NrKCk7CisqLworICAvKiBOVCBFbWFjcyBjcmFzaGVzIG9uIHN0YXJ0 dXAgd2l0aG91dCBhIGBCVUZGRVJQJyBjaGVjayBpbiBgdXBkYXRlX3dpbmRvdycuICovCisgIGlm ICghQlVGRkVSUCAody0+Y29udGVudHMpKQorICAgIHJldHVybjsKKyAgaWYgKE5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAmJiBOSUxQIChCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgJiYgTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpCisgICAgcmV0dXJuOworICBpZiAo dnBvcyA9PSBib3R0b21fdnBvcykKKyAgICByZXR1cm47CisgIGlmICghcm93LT51c2VkW1RFWFRf QVJFQV0pCisgICAgcmV0dXJuOworICBpbnQgaHBvc19zdGFydCA9IHN0YXJ0IC0gcm93LT5nbHlw aHNbVEVYVF9BUkVBXTsKKyAgaWYgKHRyYWNlX3JlZGlzcGxheV9wKQorICAgIGZwcmludGYgKHN0 ZGVyciwgIm1jX2RyYXdfcm93ICglcyk6ICB2cG9zICglZCkgfCBocG9zICglZCkgfCBsZW4gKCVk KVxuIiwKKyAgICAgICAgICAgICAgICAgICAgIG1jX3dpbmRvdyAodyksIHZwb3MsIGhwb3Nfc3Rh cnQsIGhwb3NfbGVuZ3RoKTsKKyAgTGlzcF9PYmplY3Qgd2luZG93OworICBYU0VUV0lORE9XICh3 aW5kb3csIHcpOworICBzdHJ1Y3QgZ2x5cGggKmN1cnNvcl9nbHlwaCA9CisgICAgbWNfZ2V0X2N1 cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBv cyk7CisgIGludCBvcG9pbnRfZngsIG9wb2ludF9meSwgb3BvaW50X3dkLCBvcG9pbnRfaDsKKyAg c3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIExpc3BfT2JqZWN0IGJ1ZiA9 IHctPmNvbnRlbnRzOworICBDSEVDS19CVUZGRVIgKGJ1Zik7CisgIHN0cnVjdCBidWZmZXIgKmIg PSBYQlVGRkVSIChidWYpOworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBCRUdJTiBKT1VSTkVZIC4uLgorKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisgIGludCBmcmFtZV9jaGFyX3dpZHRoID0gRlJBTUVfQ09MVU1OX1dJRFRIIChmKTsKKyAg aW50IHRleHRfYXJlYV93aWR0aCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7Cisg IGludCBoZWFkZXJfbGluZV9mb3JtYXQgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsK KyAgYm9vbCBjdXJzb3JfaW5fZnJpbmdlX3AgPSB3LT5jdXJzb3IueCArIGZyYW1lX2NoYXJfd2lk dGggPj0gdGV4dF9hcmVhX3dpZHRoOworICBMaXNwX09iamVjdCBtY19yZXN1bHQgPSBRbmlsOwor ICBMaXNwX09iamVjdCBjaF9yZXN1bHQgPSBRbmlsOworICBMaXNwX09iamVjdCBmY19yZXN1bHQg PSBRbmlsOworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAg ICAgICBFUkFTRSBUSEUgUkVBTCBDVVJTT1IKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICBp ZiAoZHJhd19wCisgICAgICAmJiB3LT5waHlzX2N1cnNvcl9vbl9wCisgICAgICAmJiB2cG9zID09 IHctPmN1cnNvci52cG9zKQorICAgIHsKKyAgICAgIG1jX2VyYXNlX2N1cnNvciAodywgbWF0cml4 LCByb3csIHctPmN1cnNvci54LCB3LT5jdXJzb3IueSwgdy0+Y3Vyc29yLmhwb3MsCisgICAgICAg ICAgICAgICAgICAgICAgIHctPmN1cnNvci52cG9zLCBNQ19HTFlQSCwgdy0+cGh5c19jdXJzb3Jf dHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX2dseXBoLT5waXhlbF93aWR0aCk7 CisgICAgICB3LT5waHlzX2N1cnNvcl9vbl9wID0gZmFsc2U7CisgICAgICB3LT5waHlzX2N1cnNv cl90eXBlID0gTk9fQ1VSU09SOworICAgIH0KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAg ICAgICAgICAgICAgICAgICAgICAgICBSRVBMQUNFIFRIRSBSRUFMIENVUlNPUgorKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisgIGVudW0gZmFjZV9pZCBiZ19mYWNlX2lkID0gKGN1cnNvcl9nbHlw aCA9PSBOVUxMKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gREVGQVVMVF9GQUNFX0lE CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBjdXJzb3JfZ2x5cGgtPmZhY2VfaWQ7Cisg IC8qIEZJWE1FOiAgUHV0IGluIHNvbWUgY29kZSB0byBkZWZhdWx0IHRvIEhPTExPV19CT1hfQ1VS U09SIGlmIHRoZSB1c2VyIGhhcworICB1bndpdHRpbmdseSBjb21lIHVwIHdpdGggc29tZSB1bmFj Y2VwdGFibGUgZm9ybSBvZiB1bnJlY29nbml6ZWQgY3Vyc29yIHR5cGUuICovCisgIExpc3BfT2Jq ZWN0IGxpc3BfdHlwZSA9IEJWQVIgKGIsIG1jX3JlYWxfZmFrZV9jdXJzb3IpOworICBlbnVtIHRl eHRfY3Vyc29yX2tpbmRzIGN1cnNvcl90eXBlID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfbGlzcF90b19jdXJzb3JfdHlw ZSAoWENBUiAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKGxpc3BfdHlwZSk7CisgIGludCBjdXJzb3Jf d2lkdGggPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICA/IFhGSVhO VU0gKFhDQVIgKFhDRFIgKGxpc3BfdHlwZSkpKQorICAgICAgICAgICAgICAgICAgICAgOiAtMTsK KyAgZW51bSBmYWNlX2lkIGN1cnNvcl9mYWNlX2lkID0KKyAgICAoIWFjdGl2ZV9wCisgICAgICYm ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3Mp KSkKKyAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1j dXJzb3ItaW5hY3RpdmUtZmFjZSIpLCB0cnVlKQorICAgIDogbG9va3VwX25hbWVkX2ZhY2UgKHcs IGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1mYWNlIiksIH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0xLCBMRUZUX0ZSSU5HRV9CSVRNQVAsIC0xLAorICAgICAgICAgICAgICAg ICBmZ19sc2wsIG1jX2JnX2xzbCAodywgYmdfZmFjZV9pZCksIGFjdGl2ZV9wLAorICAgICAgICAg ICAgICAgICBNQ19PVkVSTEFZX0FSUk9XX0JJVE1BUCwgZHJhd19wLCAmY2hfcmVzdWx0KTsKKyAg ICB9CisgIGlmIChjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29y LnZwb3MKKyAgICAgICYmIHctPmN1cnNvci5ocG9zID49IGhwb3Nfc3RhcnQKKyAgICAgICYmIHct PmN1cnNvci5ocG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoCisgICAgICAmJiAhTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICYmICFOSUxQ IChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2hvcml6b250YWxfcnVsZXIpKSkKKyAg ICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoY3Vyc29yX2luX2ZyaW5n ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT5jb250aW51 ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19QSUxDUk9X CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfaW5fZnJpbmdl X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNh dGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g TUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfSE9MTE9XX1JFQ1RBTkdMRQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOT19GTEFWT1I7CisgICAgICBt Y19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1cnNvci54LCAtMSwg dy0+Y3Vyc29yLnksIC0xLCB3LT5jdXJzb3IuaHBvcywKKyAgICAgICAgICAgICAgICAgdy0+Y3Vy c29yLnZwb3MsIC0xLCAtMSwgUklHSFRfRlJJTkdFX0JJVE1BUCwgLTEsIGN1cnNvcl9mZywKKyAg ICAgICAgICAgICAgICAgbWNfYmdfbHNsICh3LCBiZ19mYWNlX2lkKSwgYWN0aXZlX3AsIGdseXBo X2ZsYXZvciwKKyAgICAgICAgICAgICAgICAgZHJhd19wLCAmY2hfcmVzdWx0KTsKKyAgICB9Cisg ICAgLyogRVhBTVBMRSAoYnVmZmVyLWxvY2FsKTogIChzZXRxIG1jLXJlYWwtZmFrZS1jdXJzb3Ig bmlsLyduby8ibm8iKSAqLworICAgIGVsc2UgaWYgKCFjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAg ICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBOT19DVVJTT1IKKyAgICAgICAgICAgICAmJiB2cG9z ID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPj0gaHBv c19zdGFydAorICAgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zIDwgaHBvc19zdGFydCArIGhw b3NfbGVuZ3RoKQorICAgIHsKKyAgICAgIC8qIFdoZW4gYSB1c2VyIGhhcyBub3Qgc3BlY2lmaWVk IGEgdmFsdWUgZm9yIGBtYy1yZWFsLWZha2UtY3Vyc29yJywgb3IgdGhlCisgICAgICB2YWx1ZSBp cyBgbm9gIGluIHRoZSBmb3JtIG9mIGEgc3ltYm9sIG9yIHN0cmluZywgdGhlbiB0aGUgZGVmYXVs dCB3ZSB1c2UKKyAgICAgIGFuIEJBUl9DVVJTT1IgYW5kIGFuIEhCQVJfQ1VSU09SIC0tIGJvdGgg aGF2aW5nIGEgY3Vyc29yX3dpZHRoIG9mIDEuICovCisgICAgICBtY19nZXRfY3Vyc29yX2dlb21l dHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRfZngsIHctPmN1cnNvci55 LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF9meSwgdy0+Y3Vyc29yLmhw b3MsIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBCQVJfQ1VSU09SLCAxLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0 cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vyc29y LnksIG9wb2ludF9meSwKKyAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNv ci52cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9oLCBCQVJfQ1VSU09SLAorICAgICAgICAgICAgICAg ICAxLCBjdXJzb3JfZmcsIG1jX2JnX2xzbCAodywgYmdfZmFjZV9pZCksIGFjdGl2ZV9wLCBNQ19H TFlQSExFU1MsCisgICAgICAgICAgICAgICAgIGRyYXdfcCwgTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID8gJmNoX3Jlc3VsdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAm bWNfcmVzdWx0KTsKKyAgICAgIG1jX2dldF9jdXJzb3JfZ2VvbWV0cnkgKHcsIG1hdHJpeCwgcm93 LCB3LT5jdXJzb3IueCwgJm9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3Ms ICZvcG9pbnRfaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhCQVJfQ1VSU09SLCAx LCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGN1cnNvcl9n bHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vyc29yLnksIG9wb2ludF9meSwKKyAg ICAgICAgICAgICAgICAgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCBvcG9pbnRfd2Qs IG9wb2ludF9oLCBIQkFSX0NVUlNPUiwKKyAgICAgICAgICAgICAgICAgMSwgY3Vyc29yX2ZnLCBt Y19iZ19sc2wgKHcsIGJnX2ZhY2VfaWQpLCBhY3RpdmVfcCwgTUNfR0xZUEgsCisgICAgICAgICAg ICAgICAgIGRyYXdfcCwgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25m KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gJmNoX3Jlc3VsdAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAmbWNfcmVzdWx0KTsKKyAgICB9Cisg ICAgZWxzZSBpZiAoIWN1cnNvcl9pbl9mcmluZ2VfcAorICAgICAgICAgICAgICYmIHZwb3MgPT0g dy0+Y3Vyc29yLnZwb3MKKyAgICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA+PSBocG9zX3N0 YXJ0CisgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPCBocG9zX3N0YXJ0ICsgaHBvc19s ZW5ndGgKKyAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPnR5cGUgIT0gU1RSRVRDSF9HTFlQ SCkKKyAgICB7CisgICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywg dy0+Y3Vyc29yLngsICZvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJm9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCAm b3BvaW50X2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vy c29yX3dpZHRoLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3cs IGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vyc29yLnksIG9wb2lu dF9meSwKKyAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCBv cG9pbnRfd2QsIG9wb2ludF9oLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgY3Vyc29y X3dpZHRoLCBjdXJzb3JfZmcsIG1jX2JnX2xzbCAodywgYmdfZmFjZV9pZCksIGFjdGl2ZV9wLAor ICAgICAgICAgICAgICAgICBNQ19HTFlQSCwgZHJhd19wLCBOSUxQIChCVkFSIChYQlVGRkVSICh3 LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/ICZjaF9yZXN1bHQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAmbWNf cmVzdWx0KTsKKyAgICB9CisgIGVsc2UgaWYgKCFjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAgICAg ICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBv cyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zIDwgaHBvc19zdGFy dCArIGhwb3NfbGVuZ3RoCisgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+dHlwZSA9PSBTVFJF VENIX0dMWVBIKQorICAgIHsKKyAgICAgIC8qIElmIGEgdXNlciBoYXMgc2V0IGB4LXN0cmV0Y2gt Y3Vyc29yJyB0byBhIG5vbi1uaWwgdmFsdWUsIGhlL3NoZSBjaG9zZSB0bworICAgICAgaGF2ZSBh IGN1cnNvciB0aGF0IHNwYW5zIHRoZSBlbnRpcmUgbGVuZ3RoIG9mIHRoZSBTVFJFVENIX0dMWVBI LiAqLworICAgICAgaWYgKCF4X3N0cmV0Y2hfY3Vyc29yX3ApCisgICAgICAgIHsKKyAgICAgICAg ICAvKiBUaGUgSEJBUl9DVVJTT1Igc2hhbGwgaGF2ZSBhIGBjdXJzb3Jfd2lkdGhgIG9mIDEuICov CisgICAgICAgICAgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeSAodywgbWF0cml4LCByb3csIHctPmN1 cnNvci54LCAmb3BvaW50X2Z4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHct PmN1cnNvci55LCAmb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLCBIQkFSX0NVUlNPUiwg MSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmb3BvaW50X3dkKTsKKyAgICAg ICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1cnNvci54 LCBvcG9pbnRfZngsIHctPmN1cnNvci55LCBvcG9pbnRfZnksCisgICAgICAgICAgICAgICAgICAg ICB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MsIG9wb2ludF93ZCwgb3BvaW50X2gsCisg ICAgICAgICAgICAgICAgICAgICBIQkFSX0NVUlNPUiwgMSwgY3Vyc29yX2ZnLCBtY19iZ19sc2wg KHcsIGJnX2ZhY2VfaWQpLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgIE1DX0dMWVBI LCBkcmF3X3AsIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAmY2hfcmVz dWx0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAm bWNfcmVzdWx0KTsKKyAgICAgICAgfQorICAgICAgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeSAodywg bWF0cml4LCByb3csIHctPmN1cnNvci54LCAmb3BvaW50X2Z4LAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgdy0+Y3Vyc29yLnksICZvcG9pbnRfZnksIHctPmN1cnNvci5ocG9zLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLnZwb3MsICZvcG9pbnRfaCwgY3Vy c29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsICZv cG9pbnRfd2QpOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgY3Vyc29yX2dseXBo LCB3LT5jdXJzb3IueCwgb3BvaW50X2Z4LCB3LT5jdXJzb3IueSwgb3BvaW50X2Z5LAorICAgICAg ICAgICAgICAgICB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MsIG9wb2ludF93ZCwgb3Bv aW50X2gsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIGN1cnNv cl9mZywgbWNfYmdfbHNsICh3LCBiZ19mYWNlX2lkKSwgYWN0aXZlX3AsCisgICAgICAgICAgICAg ICAgIE1DX0dMWVBILCBkcmF3X3AsIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg bWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICZjaF9y ZXN1bHQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogJm1jX3Jlc3Vs dCk7CisgICAgfQorICBpZiAoaHBvc19sZW5ndGggPT0gMSkKKyAgICB7CisgICAgICBpZiAoIU5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQorICAgICAgICB7Cisg ICAgICAgICAgLyogVGhlIHNwYWNlIGFwcGVuZGVkIHRvIGEgcm93IGVuZGluZyB3aXRoIGEgbmV3 IGxpbmUKKyAgICAgICAgICBkb2VzIG5vdCBoYXZlIGEgYGdseXBoLT5jaGFycG9zYCAoLTEsIDAp IHRoYXQgd2UgY2FuCisgICAgICAgICAgdXNlIGZvciB0aGlzIHBhcnRpY3VsYXIgYXBwbGljYXRp b24uICBXaGVuIHRoZXJlIGlzIGEKKyAgICAgICAgICBgYnVmZmVyLWRpc3BsYXktdGFibGUnIGVu dHJ5IHRoYXQgYXNzaWducyBhIHZpc2libGUKKyAgICAgICAgICBnbHlwaCB0byBhIG5ldyBsaW5l LCB0aGVyZSBpcyBubyBwcm9ibGVtIGJlY2F1c2UgdGhhdAorICAgICAgICAgIGdseXBoIGhhcyBh IGBnbHlwaC0+Y2hhcnBvcycgdGhhdCB3ZSBjYW4gdXNlLiAgV2hlbgorICAgICAgICAgIG5vIHZp c2libGUgRU9MIGdseXBoIGV4aXN0cywgd2UgdXNlIHRoZSBmb2xsb3dpbmcKKyAgICAgICAgICB0 ZXN0OiAgdGhlIGFwcGVuZGVkIHNwYWNlIGhhcyBhIHBvc2l0aW9uIHRoYXQgaXMgb25lCisgICAg ICAgICAgbGVzcyB0aGFuIHRoZSBlbmQgb2YgdGhlIG1hdHJpeCByb3cuICovCisgICAgICAgICAg aW50IGhwb3MgPSBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICAgICAgc3Ry dWN0IGdseXBoICpwcmV2aW91c19nbHlwaCA9ICgwIDw9IGhwb3MgLSAxICYmIGhwb3MgLSAxIDwg cm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIGhwb3MgLSAxCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTlVMTDsKKyAgICAgICAgICBib29sIHNraXBf cCA9IChwcmV2aW91c19nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgJiYg cHJldmlvdXNfZ2x5cGgtPmNoYXJwb3MgPT0gTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSAt IDEpOworICAgICAgICAgIGludCBwb3NpbnQgPSAoc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FS RUFdID09IHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAg PyBNQVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpIC0gMQorICAgICAgICAgICAgICAgICAgICAg ICA6IHN0YXJ0LT5jaGFycG9zOworICAgICAgICAgIExpc3BfT2JqZWN0IHNwZWNzID0gbWNfYXNz b2MgKG1ha2VfZml4bnVtIChwb3NpbnQpLCBCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1j X2NvbmYpKTsKKyAgICAgICAgICBpZiAoKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3Mg PiAwKQorICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAg ICAgICAgICYmICFOSUxQIChzcGVjcykKKyAgICAgICAgICAgICAgJiYgc3RhcnQtPnkgPD0gd2lu ZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICYmICFza2lwX3AKKyAgICAgICAg ICAgICAgJiYgIXN0YXJ0LT56dl9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBMaXNw X09iamVjdCBsaXNwX3R5cGUgPSBtY19udGggKDEsIHNwZWNzKTsKKyAgICAgICAgICAgICAgZW51 bSB0ZXh0X2N1cnNvcl9raW5kcyBjdXJzb3JfdHlwZSA9IChDT05TUCAobGlzcF90eXBlKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfbGlz cF90b19jdXJzb3JfdHlwZSAoWENBUiAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogbWNfbGlzcF90b19jdXJzb3JfdHlwZSAo bGlzcF90eXBlKTsKKyAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aCA9IChDT05TUCAobGlz cF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gWEZJWE5VTSAoWENB UiAoWENEUiAobGlzcF90eXBlKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IC0xOworICAgICAgICAgICAgICBMaXNwX09iamVjdCBtY19mb3JlZ3JvdW5kID0gbWNfbnRoICgy LCBzcGVjcyk7CisgICAgICAgICAgICAgIGlmIChTVFJJTkdQIChtY19mb3JlZ3JvdW5kKSkKKyAg ICAgICAgICAgICAgICBtY19mb3JlZ3JvdW5kID0gbWNfY29sb3JfdmVjdG9yX2NhbGMgKHcsIG1j X2ZvcmVncm91bmQpOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKE5JTFAgKG1jX2ZvcmVncm91 bmQpKQorICAgICAgICAgICAgICAgICAgbWNfZm9yZWdyb3VuZCA9IHctPmNoX2ZvcmVncm91bmQ7 CisgICAgICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7 CisgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9B UkVBKTsKKyAgICAgICAgICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgc3RhcnQsIFRF WFRfQVJFQSwgeCwgeF9saW1pdCwgcm93LT55LCBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJF QV0sIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUsIGN1cnNvcl93 aWR0aCwgbWNfZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVfcCwg TVVMVElQTEVfQ1VSU09SUywgZHJhd19wLCAmbWNfcmVzdWx0KTsKKyAgICAgICAgICAgIH0KKyAg ICAgICAgfQorICAgICAgaWYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZj X3Zpc2libGUpKQorICAgICAgICAgICYmIHctPm1jLmZjX3ggPD0gdGV4dF9hcmVhX3dpZHRoCisg ICAgICAgICAgJiYgdy0+bWMuZmNfeCA+PSB3LT5tYy5sbnVtX3BpeGVsX3dpZHRoKQorICAgICAg ICB7CisgICAgICAgICAgaW50IHhfbGltaXQgPSB4ICsgc3RhcnQtPnBpeGVsX3dpZHRoOworICAg ICAgICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKHctPmN1cnNvci54ID09IHctPm1jLmZj X3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueSA9 PSBzdGFydC0+eQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1 cnNvci5ocG9zID09IHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci52cG9zID09IHZwb3MpOworICAg ICAgICAgIGlmICh4ICsgc3RhcnQtPnBpeGVsX3dpZHRoIDw9IHRleHRfYXJlYV93aWR0aAorICAg ICAgICAgICAgICAmJiAoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAg ICAgICAgICAgICAgICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAg JiYgKCh3LT5tYy5mY194ID49IHgKKyAgICAgICAgICAgICAgICAgICAmJiB3LT5tYy5mY194IDwg eCArIHN0YXJ0LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgIHx8IHN0YXJ0ID09IHJv dy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpCisgICAgICAg ICAgICAgICYmIHN0YXJ0LT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAgICAg ICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAgICAgbWNfZW5naW5lICh3LCBt YXRyaXgsIHJvdywgc3RhcnQsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwgcm93LT55LCBzdGFydCAt IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgIEJB Ul9DVVJTT1IsIDEsIHctPmZjX2ZvcmVncm91bmQsIGFjdGl2ZV9wLAorICAgICAgICAgICAgICAg ICAgICAgICBGSUxMX0NPTFVNTiwgZHJhd19wLCAmZmNfcmVzdWx0KTsKKyAgICAgICAgfQorICAg ICAgaWYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQor ICAgICAgICAgICYmICFOSUxQIChCV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cnVsZXIpKQorICAgICAgICAgICYmICFmaWxsX2NvbHVtbl90cnVtcHNfcCkKKyAgICAgICAgewor ICAgICAgICAgIGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsK KyAgICAgICAgICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9ICh3LT5jdXJzb3IueSA9PSBzdGFy dC0+eQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci52 cG9zID09IHZwb3MpOworICAgICAgICAgIGlmICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYg dnBvcyA+IDApCisgICAgICAgICAgICAgICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAg ICAgICAgICAgICAgJiYgKCh3LT5jdXJzb3IueCA+PSB4CisgICAgICAgICAgICAgICAgICAgJiYg dy0+Y3Vyc29yLnggPCB4ICsgc3RhcnQtPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAg fHwgc3RhcnQgPT0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFd IC0gMSkKKyAgICAgICAgICAgICAgJiYgc3RhcnQtPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kg KHcpCisgICAgICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgICAgICBt Y19lbmdpbmUgKHcsIG1hdHJpeCwgcm93LCBzdGFydCwgVEVYVF9BUkVBLCB4LCB4X2xpbWl0LCBy b3ctPnksIHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwgdnBvcywKKyAgICAgICAgICAg ICAgICAgICAgICAgQkFSX0NVUlNPUiwgMSwgdy0+Y2hfZm9yZWdyb3VuZCwgYWN0aXZlX3AsCisg ICAgICAgICAgICAgICAgICAgICAgIFZFUlRJQ0FMX1JVTEVSLCBkcmF3X3AsICZjaF9yZXN1bHQp OworICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgaW50IHJlbGF0 aXZlX3ggPSAwOworICAgICAgICBmb3IgKGludCBhcmVhID0gTEVGVF9NQVJHSU5fQVJFQTsgYXJl YSA8IExBU1RfQVJFQTsgKythcmVhKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIHN0cnVjdCBn bHlwaCAqZ2x5cGggPSByb3ctPmdseXBoc1thcmVhXTsKKyAgICAgICAgICAgIHN0cnVjdCBnbHlw aCAqZ2x5cGhfZW5kID0gZ2x5cGggKyByb3ctPnVzZWRbYXJlYV07CisgICAgICAgICAgICAvKiBH bHlwaCBmb3IgYSBsaW5lIGVuZCBpbiB0ZXh0LiAqLworICAgICAgICAgICAgaWYgKGFyZWEgPT0g VEVYVF9BUkVBICYmIGdseXBoID09IGdseXBoX2VuZCAmJiBnbHlwaC0+Y2hhcnBvcyA+IDApCisg ICAgICAgICAgICAgICsrZ2x5cGhfZW5kOworICAgICAgICAgICAgZm9yICg7IGdseXBoIDwgZ2x5 cGhfZW5kOyArK2dseXBoKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKHZw b3MgIT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGggIT0gZ2x5 cGhfZW5kIC0gMQorICAgICAgICAgICAgICAgICAgICAmJiB3LT5tYy5mY194IDwgcmVsYXRpdmVf eAorICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA8IHJlbGF0aXZlX3gKKyAgICAg ICAgICAgICAgICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19j b25mKSkpCisgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBpZiAoIU5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQorICAgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgICAvKiBUaGUgc3BhY2UgYXBwZW5kZWQgdG8gYSBy b3cgZW5kaW5nIHdpdGggYSBuZXcgbGluZSBkb2VzCisgICAgICAgICAgICAgICAgICAgIG5vdCBo YXZlIGEgYGdseXBoLT5jaGFycG9zYCAoLTEsIDApIHRoYXQgd2UgY2FuIHVzZSBmb3IgdGhpcwor ICAgICAgICAgICAgICAgICAgICBwYXJ0aWN1bGFyIGFwcGxpY2F0aW9uLiAgV2hlbiBhIGBidWZm ZXItZGlzcGxheS10YWJsZScgZW50cnkKKyAgICAgICAgICAgICAgICAgICAgYXNzaWducyBhIHZp c2libGUgZ2x5cGggdG8gYSBuZXcgbGluZSwgdGhlcmUgaXMgbm8gcHJvYmxlbQorICAgICAgICAg ICAgICAgICAgICBiZWNhdXNlIHRoYXQgZ2x5cGggaGFzIGEgYGdseXBoLT5jaGFycG9zJyB0aGF0 IHdlIGNhbiB1c2UuCisgICAgICAgICAgICAgICAgICAgIFdoZW4gbm8gdmlzaWJsZSBFT0wgZ2x5 cGggZXhpc3RzLCB3ZSB1c2UgdGhlIGZvbGxvd2luZyB0ZXN0OgorICAgICAgICAgICAgICAgICAg ICB0aGUgYXBwZW5kZWQgc3BhY2UgaGFzIGEgcG9zaXRpb24gdGhhdCBpcyBvbmUgbGVzcyB0aGFu IHRoZQorICAgICAgICAgICAgICAgICAgICBlbmQgb2YgdGhlIG1hdHJpeCByb3cuICovCisgICAg ICAgICAgICAgICAgICAgIGludCBocG9zID0gZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFd OworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnByZXZpb3VzX2dseXBoID0gKDAg PD0gaHBvcyAtIDEgJiYgaHBvcyAtIDEgPCByb3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gcm93LT5nbHlwaHNb VEVYVF9BUkVBXSArIGhwb3MgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IE5VTEw7CisgICAgICAgICAgICAgICAgICAgIGJvb2wgc2tpcF9w ID0gKHByZXZpb3VzX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgcHJldmlvdXNfZ2x5cGgtPmNoYXJwb3MgPT0gTUFUUklYX1JPV19FTkRfQ0hBUlBP UyAocm93KSAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IHRydWUK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBXaGVuIGEgYGJ1ZmZlci1kaXNw bGF5LXRhYmxlJyBlbnRyeSBjb250YWlucworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGEgdmlzaWJsZSB0YWIgY2hhcmFjdGVyICgiwrsiKSwgdGhlIHN1YnNlcXVlbnQKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTVFJFVENIX0dMWVBIIHdpbGwgaGF2ZSB0aGUg c2FtZSBnbHlwaC0+Y2hhcnBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFz IHRoZSBhZm9yZW1lbnRpb25lZCB2aXNpYmxlIHRhYiBjaGFyYWN0ZXIuICovCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiAocHJldmlvdXNfZ2x5cGggIT0gTlVMTAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHByZXZpb3VzX2dseXBoLT5jaGFycG9z ID09IGdseXBoLT5jaGFycG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyB0cnVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBmYWxzZTsKKyAgICAg ICAgICAgICAgICAgICAgaW50IHBvc2ludCA9IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJF QV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID8gTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSAtIDEKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogZ2x5cGgtPmNoYXJwb3M7CisgICAgICAgICAgICAgICAgICAgIExp c3BfT2JqZWN0IHNwZWNzID0gbWNfYXNzb2MgKG1ha2VfZml4bnVtIChwb3NpbnQpLCBCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKTsKKyAgICAgICAgICAgICAgICAgICAgaWYg KCgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID4gMCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAgICAgICAg ICAgICYmICFOSUxQIChzcGVjcykKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT55 IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAgICAgICAgICAgICAgICAgICAgJiYg IXNraXBfcAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIWdseXBoLT56dl9wKQorICAgICAg ICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExpc3BfT2JqZWN0IGxp c3BfdHlwZSA9IG1jX250aCAoMSwgc3BlY3MpOworICAgICAgICAgICAgICAgICAgICAgICAgZW51 bSB0ZXh0X2N1cnNvcl9raW5kcyBjdXJzb3JfdHlwZSA9IChDT05TUCAobGlzcF90eXBlKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKFhDQVIgKGxpc3BfdHlwZSkpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBtY19s aXNwX3RvX2N1cnNvcl90eXBlIChsaXNwX3R5cGUpOworICAgICAgICAgICAgICAgICAgICAgICAg aW50IGN1cnNvcl93aWR0aCA9IChDT05TUCAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IFhGSVhOVU0gKFhDQVIgKFhDRFIgKGxpc3BfdHlw ZSkpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogLTE7Cisg ICAgICAgICAgICAgICAgICAgICAgICBMaXNwX09iamVjdCBtY19mb3JlZ3JvdW5kID0gbWNfbnRo ICgyLCBzcGVjcyk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoU1RSSU5HUCAobWNfZm9y ZWdyb3VuZCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2ZvcmVncm91bmQgPSBtY19j b2xvcl92ZWN0b3JfY2FsYyAodywgbWNfZm9yZWdyb3VuZCk7CisgICAgICAgICAgICAgICAgICAg ICAgICAgIGVsc2UgaWYgKE5JTFAgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgIG1jX2ZvcmVncm91bmQgPSB3LT5jaF9mb3JlZ3JvdW5kOworICAgICAgICAgICAg ICAgICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAg ICAgICAgICAgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0aCAodywg VEVYVF9BUkVBKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4 LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4X2xpbWl0LCByb3ctPnksIGdseXBoIC0g cm93LT5nbHlwaHNbVEVYVF9BUkVBXSwgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgbWNfZm9yZWdyb3VuZCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0aXZlX3AsIE1VTFRJUExFX0NVUlNPUlMs IGRyYXdfcCwgJm1jX3Jlc3VsdCk7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWMuZmNf eCA8PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWMuZmNfeCA+ PSB3LT5tYy5sbnVtX3BpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgICBpbnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7 CisgICAgICAgICAgICAgICAgICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKHctPmN1cnNv ci54ID09IHctPm1jLmZjX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgdy0+Y3Vyc29yLnkgPT0gZ2x5cGgtPnkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gZ2x5cGggLSBy b3ctPmdseXBoc1tURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPmN1cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAgICAgICAg ICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAg ICAgICAgICAgICAgaWYgKGhwb3MgPj0gaHBvc19zdGFydAorICAgICAgICAgICAgICAgICAgICAg ICAgJiYgaHBvcyA8IGhwb3Nfc3RhcnQgKyBocG9zX2xlbmd0aAorICAgICAgICAgICAgICAgICAg ICAgICAgJiYgcmVsYXRpdmVfeCArIGdseXBoLT5waXhlbF93aWR0aCA8PSB0ZXh0X2FyZWFfd2lk dGgKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAm JiB2cG9zID4gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBoZWFkZXJfbGluZV9m b3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICgoZ2x5cGggIT0gZ2x5cGhf ZW5kIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5tYy5mY194ID49IHJl bGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWMuZmNfeCA8IHJl bGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgfHwgKGdseXBoID09IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgdy0+bWMuZmNfeCA+PSByZWxhdGl2ZV94KSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICYmIGdseXBoLT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAgICAgICAg ICAgICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgICAgICAgICAg ICBtY19lbmdpbmUgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgYXJlYSwgcmVsYXRpdmVfeCwgeF9s aW1pdCwgcm93LT55LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgQkFSX0NVUlNPUiwgMSwgdy0+ZmNfZm9yZWdyb3VuZCwgYWN0aXZlX3AsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBGSUxMX0NPTFVNTiwgZHJhd19wLCAmZmNfcmVzdWx0KTsK KyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhC VUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICYm ICFOSUxQIChCVkFSIChiLCBjaF9ob3Jpem9udGFsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAg ICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgICAgaW50IHhfbGltaXQgPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FS RUEpOworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5nbHlwaHNb VEVYVF9BUkVBXTsKKyAgICAgICAgICAgICAgICAgICAgLyogUHJlc2VydmUgc3VwcG9ydCBmb3Ig ZGVmYXVsdCBiZWhhdmlvciBzdWNoIHRoYXQgYSB1c2VyIG1heQorICAgICAgICAgICAgICAgICAg ICBzcGVjaWZ5IHRoZSBoZWlnaHQgb2YgYW4gSEJBUl9DVVJTT1IsIHdoaWNoIGJlZ2lucyBpdHMg am91cm5leQorICAgICAgICAgICAgICAgICAgICBhcyB0aGUgYGN1cnNvcl93aWR0aCcuICBgbWNf Z2V0X2N1cnNvcl9nZW9tZXRyeScgcmVhZGp1c3RzLiAqLworICAgICAgICAgICAgICAgICAgICBp ZiAoaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICAgICAgICAgICAgICAmJiBocG9zIDwg aHBvc19zdGFydCArIGhwb3NfbGVuZ3RoKQorICAgICAgICAgICAgICAgICAgICAgIG1jX2VuZ2lu ZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4X2xpbWl0LCByb3ct PnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIQkFSX0NV UlNPUiwgMSwgdy0+Y2hfZm9yZWdyb3VuZCwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBIT1JJWk9OVEFMX1JVTEVSLCBkcmF3X3AsICZjaF9yZXN1bHQpOworICAg ICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICghTklMUCAoQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgICAgICAgJiYgIU5J TFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAgJiYg IWZpbGxfY29sdW1uX3RydW1wc19wKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgICBpbnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7Cisg ICAgICAgICAgICAgICAgICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKHctPmN1cnNvci55 ID09IGdseXBoLT55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHctPmN1cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAgICAgICAgICAgICBpbnQg aHBvcyA9IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICAgICAgICAg ICAgaWYgKGhwb3MgPj0gaHBvc19zdGFydAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgaHBv cyA8IGhwb3Nfc3RhcnQgKyBocG9zX2xlbmd0aAorICAgICAgICAgICAgICAgICAgICAgICAgJiYg KChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAgICAgICAg ICAgICAgJiYgKChnbHlwaCAhPSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHctPmN1cnNvci54ID49IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPCByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRo KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChnbHlwaCA9PSBnbHlwaF9lbmQgLSAx CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHJlbGF0 aXZlX3gpKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGgtPnkgPD0gd2luZG93X3Rl eHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1 cnNvcl9wKQorICAgICAgICAgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3cs IGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4X2xpbWl0LAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgcm93LT55LCBocG9zLCB2cG9zLCBCQVJfQ1VSU09SLCAxLCB3LT5jaF9mb3Jl Z3JvdW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0aXZlX3AsIFZFUlRJ Q0FMX1JVTEVSLCBkcmF3X3AsICZjaF9yZXN1bHQpOworICAgICAgICAgICAgICAgICAgfQorICAg ICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAg ICAgICB9CisgICAgICAgICAgfQorICAgICAgfQorICB3c2V0X21jX3RlbXBfY2FjaGUgKHcsIFFu aWwpOworICBpZiAoTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29ud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LT5mY19jYWNoZSwgZmNfcmVzdWx0KSk7CisgICAgICBlbHNlIGlmICgh TklMUCAoZmNfcmVzdWx0KQorICAgICAgICAgICAgICAgJiYgTklMUCAody0+ZmNfY2FjaGUpKQor ICAgICAgICB3c2V0X2ZjX2NhY2hlICh3LCBmY19yZXN1bHQpOworLyoKKyAgY2xvY2tfdCBjbG9j a19lbmQgPSBjbG9jaygpOworICBkb3VibGUgY3B1X3RpbWVfdXNlZCA9ICgoZG91YmxlKSAoY2xv Y2tfZW5kIC0gY2xvY2tfc3RhcnQpKSAvIENMT0NLU19QRVJfU0VDOworICBmcHJpbnRmIChzdGRl cnIsICJtY19kcmF3X3JvdyAoJXMpOiAgVElNRSAoJWYpXG4iLCBtY193aW5kb3cgKHcpLCBjcHVf dGltZV91c2VkKTsKKyovCit9CisKK0xpc3BfT2JqZWN0CittY19oaXRfcCAoc3RydWN0IHdpbmRv dyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cs CisgICAgICAgICAgZW51bSB0eXBlX29mX2NhY2hlIGNhY2hlX3R5cGUsIHN0cnVjdCBnbHlwaCAq Z2x5cGgpCit7CisgIExpc3BfT2JqZWN0IGNhY2hlID0gUW5pbDsKKyAgY2hhciAqIGNhY2hlX3N0 cmluZzsKKyAgc3dpdGNoIChjYWNoZV90eXBlKQorICAgIHsKKyAgICAgIGNhc2UgTUNfVEVNUF9D QUNIRToKKyAgICAgICAgeworICAgICAgICAgIGNhY2hlID0gdy0+bWNfdGVtcF9jYWNoZTsKKyAg ICAgICAgICBjYWNoZV9zdHJpbmcgPSBTU0RBVEEgKGJ1aWxkX3N0cmluZyAoIk1DX1RFTVBfQ0FD SEUiKSk7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGNhc2UgTUNfQ0FDSEU6 CisgICAgICAgIHsKKyAgICAgICAgICBjYWNoZSA9IHctPm1jX2NhY2hlOworICAgICAgICAg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tY19udGggKDEzLCBmb3VydGVlbl9lbGVtZW50cykpOworICAgICAgaWYgKHZwb3MgPT0gcm93 X3Zwb3MKKyAgICAgICAgICAmJiBocG9zID09IGdseXBoLT5ocG9zKQorICAgICAgICByZXN1bHQg PSBGY29ucyAoZm91cnRlZW5fZWxlbWVudHMsIHJlc3VsdCk7CisgICAgfQorICByZXR1cm4gcmVz dWx0OworfQorCit2b2lkCittY19yZWRyYXdfaGVscGVyIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1 Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKKyAgICAgICAg ICAgICAgICAgIGVudW0gdHlwZV9vZl9jYWNoZSBjYWNoZV90eXBlLCBpbnQgc3RhcnRfaHBvcywg aW50IGVuZF9ocG9zKQoreworICBMaXNwX09iamVjdCBjYWNoZSA9IFFuaWw7CisgIGNoYXIgKiBj YWNoZV9zdHJpbmc7CisgIHN3aXRjaCAoY2FjaGVfdHlwZSkKKyAgICB7CisgICAgICBjYXNlIE1D X1RFTVBfQ0FDSEU6CisgICAgICAgIHsKKyAgICAgICAgICBjYWNoZSA9IHctPm1jX3RlbXBfY2Fj aGU7CisgICAgICAgICAgY2FjaGVfc3RyaW5nID0gU1NEQVRBIChidWlsZF9zdHJpbmcgKCJNQ19U RU1QX0NBQ0hFIikpOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBjYXNlIE1D X0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAgY2FjaGUgPSB3LT5tY19jYWNoZTsKKyAgICAg ICAgICBjYWNoZV9zdHJpbmcgPSBTU0RBVEEgKGJ1aWxkX3N0cmluZyAoIk1DX0NBQ0hFIikpOwor ICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBjYXNlIENIX0NBQ0hFOgorICAgICAg ICB7CisgICAgICAgICAgY2FjaGUgPSB3LT5jaF9jYWNoZTsKKyAgICAgICAgICBjYWNoZV9zdHJ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N0IHZsaXN0ID0gY2FjaGU7CisgICAgICAgQ09O U1AgKHZsaXN0KTsKKyAgICAgICB2bGlzdCA9IFhDRFIgKHZsaXN0KSkKKyAgICB7CisgICAgICBm b3VydGVlbl9lbGVtZW50cyA9IFhDQVIgKHZsaXN0KTsKKyAgICAgIHggPSBYRklYTlVNIChtY19u dGggKDAsIGZvdXJ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICBmeCA9IFhGSVhOVU0gKG1jX250aCAo MSwgZm91cnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIHkgPSBYRklYTlVNIChtY19udGggKDIsIGZv dXJ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICBmeSA9IFhGSVhOVU0gKG1jX250aCAoMywgZm91cnRl ZW5fZWxlbWVudHMpKTsKKyAgICAgIGhwb3MgPSBYRklYTlVNIChtY19udGggKDQsIGZvdXJ0ZWVu X2VsZW1lbnRzKSk7CisgICAgICB2cG9zID0gWEZJWE5VTSAobWNfbnRoICg1LCBmb3VydGVlbl9l bGVtZW50cykpOworICAgICAgd2QgPSBYRklYTlVNIChtY19udGggKDYsIGZvdXJ0ZWVuX2VsZW1l bnRzKSk7CisgICAgICBoID0gWEZJWE5VTSAobWNfbnRoICg3LCBmb3VydGVlbl9lbGVtZW50cykp OworICAgICAgY3Vyc29yX3R5cGUgPSBtY19saXNwX3RvX2N1cnNvcl90eXBlIChtY19udGggKDgs IGZvdXJ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICBjdXJzb3Jfd2lkdGggPSBYRklYTlVNIChtY19u dGggKDksIGZvdXJ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICBmb3JlZ3JvdW5kID0gbWNfbnRoICgx MCwgZm91cnRlZW5fZWxlbWVudHMpOworICAgICAgYmFja2dyb3VuZCA9IG1jX250aCAoMTEsIGZv dXJ0ZWVuX2VsZW1lbnRzKTsKKyAgICAgIGFjdGl2ZV9wID0gWEZJWE5VTSAobWNfbnRoICgxMiwg Zm91cnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIGdseXBoX2ZsYXZvciA9IFhGSVhOVU0gKG1jX250 aCAoMTMsIGZvdXJ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICBib29sIHJlbW92ZV9wID0gZmFsc2U7 CisgICAgICBpZiAodnBvcyA9PSByb3dfdnBvcworICAgICAgICAgICYmICgoaHBvcyA+PSBzdGFy dF9ocG9zCisgICAgICAgICAgICAgICAmJiBocG9zIDwgZW5kX2hwb3MpCisgICAgICAgICAgICAg IC8qIEEgZmxvYXRpbmcgY3Vyc29yIGJleW9uZCB0aGUgZW5kIG9mIHRoZSBnbHlwaCByb3cuICov CisgICAgICAgICAgICAgIHx8IChocG9zICsgMSA9PSBzdGFydF9ocG9zCisgICAgICAgICAgICAg ICAgICAmJiBocG9zICsgMSA9PSBlbmRfaHBvcykpKQorICAgICAgICBtY19kcmF3X2VyYXNlX2h5 YnJpZCAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBm b3JlZ3JvdW5kLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBo X2ZsYXZvciwgcmVtb3ZlX3ApOworICAgIH0KK30KKwordm9pZAorbWNfcmVkcmF3X3JvdyAoc3Ry dWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhf cm93ICpyb3csCisgICAgICAgICAgICAgICBpbnQgc3RhcnRfeCwgaW50IHN0YXJ0X2hwb3MsIGlu dCBlbmRfaHBvcywgYm9vbCBjbGVhcl9lb2xfcCwKKyAgICAgICAgICAgICAgIGVudW0gZHJhd19n bHlwaHNfZmFjZSBobCkKK3sKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJB TUUgKH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ZSA9IHctPm1jX3RlbXBfY2FjaGU7CisgICAg ICAgICAgY2FjaGVfc3RyaW5nID0gU1NEQVRBIChidWlsZF9zdHJpbmcgKCJNQ19URU1QX0NBQ0hF IikpOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBjYXNlIE1DX0NBQ0hFOgor ICAgICAgICB7CisgICAgICAgICAgY2FjaGUgPSB3LT5tY19jYWNoZTsKKyAgICAgICAgICBjYWNo ZV9zdHJpbmcgPSBTU0RBVEEgKGJ1aWxkX3N0cmluZyAoIk1DX0NBQ0hFIikpOworICAgICAgICAg IGJyZWFrOworICAgICAgICB9CisgICAgICBjYXNlIENIX0NBQ0hFOgorICAgICAgICB7CisgICAg ICAgICAgY2FjaGUgPSB3LT5jaF9jYWNoZTsKKyAgICAgICAgICBjYWNoZV9zdHJpbmcgPSBTU0RB VEEgKGJ1aWxkX3N0cmluZyAoIkNIX0NBQ0hFIikpOworICAgICAgICAgIGJyZWFrOworICAgICAg ICB9CisgICAgICBjYXNlIEZDX0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAgY2FjaGUgPSB3 LT5mY19jYWNoZTsKKyAgICAgICAgICBjYWNoZV9zdHJpbmcgPSBTU0RBVEEgKGJ1aWxkX3N0cmlu ZyAoIkZDX0NBQ0hFIikpOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorICBp bnQgcm93X3Zwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgLy8gIGlmICh0 cmFjZV9yZWRpc3BsYXlfcCkKKyAgLy8gICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZXJhc2VfaGVs cGVyICglcyk6ICBjYWNoZSAoJXMvJXMpIHwgdnBvcyAoJWQpXG4iLAorICAvLyAgICAgIG1jX3dp bmRvdyAodyksIGNhY2hlX3N0cmluZywgIU5JTFAgKGNhY2hlKSA/ICJub24tbmlsIiA6ICJuaWwi LCByb3dfdnBvcyk7CisgIGlmIChOS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ZW1lbnRzKSk7CisgICAgICBoID0gWEZJWE5VTSAobWNfbnRoICg3LCBmb3VydGVlbl9lbGVtZW50 cykpOworICAgICAgY3Vyc29yX3R5cGUgPSBtY19saXNwX3RvX2N1cnNvcl90eXBlIChtY19udGgg KDgsIGZvdXJ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICBjdXJzb3Jfd2lkdGggPSBYRklYTlVNICht Y19udGggKDksIGZvdXJ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICBmb3JlZ3JvdW5kID0gbWNfbnRo ICgxMCwgZm91cnRlZW5fZWxlbWVudHMpOworICAgICAgYmFja2dyb3VuZCA9IG1jX250aCAoMTEs IGZvdXJ0ZWVuX2VsZW1lbnRzKTsKKyAgICAgIGFjdGl2ZV9wID0gWEZJWE5VTSAobWNfbnRoICgx MiwgZm91cnRlZW5fZWxlbWVudHMpKTsKKyAgICAgIGdseXBoX2ZsYXZvciA9IFhGSVhOVU0gKG1j X250aCAoMTMsIGZvdXJ0ZWVuX2VsZW1lbnRzKSk7CisgICAgICAvKiBgbWF0cml4X3JvdycgaW4g YGRpc3BuZXcuY2AgY29udGFpbnMgdGhlIGZvbGxvd2luZyB0ZXN0cywKKyAgICAgIGVhc3NlcnQg KG1hdHJpeCAmJiBtYXRyaXgtPnJvd3MpOworICAgICAgZWFzc2VydCAocm93ID49IDAgJiYgcm93 IDwgbWF0cml4LT5ucm93cyk7ICovCisgICAgICBib29sIGJhcmZfY3Jhc2hfb25lID0gKG1hdHJp eCAmJiBtYXRyaXgtPnJvd3MpID8gZmFsc2UgOiB0cnVlOworICAgICAgaWYgKGJhcmZfY3Jhc2hf b25lKQorICAgICAgICBjb250aW51ZTsKKyAgICAgIGJvb2wgYmFyZl9jcmFzaF90d28gPSAodnBv cyA+PSAwICYmIHZwb3MgPCBtYXRyaXgtPm5yb3dzKSA/IGZhbHNlIDogdHJ1ZTsKKyAgICAgIGlm IChiYXJmX2NyYXNoX3R3bykKKyAgICAgICAgY29udGludWU7CisgICAgICBib29sIHJlbW92ZV9w ID0gdHJ1ZTsKKyAgICAgIGlmICh2cG9zID09IHJvd192cG9zCisgICAgICAgICAgJiYgZ2x5cGhf Zmxhdm9yID09IE1DX0dMWVBIKQorICAgICAgICBtY19lcmFzZV9jdXJzb3IgKHcsIG1hdHJpeCwg cm93LCB4LCB5LCBocG9zLCB2cG9zLCBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCk7Cisg ICAgICAgIGVsc2UgaWYgKHZwb3MgPT0gcm93X3Zwb3MpCisgICAgICAgICAgbWNfZHJhd19lcmFz ZV9oeWJyaWQgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBo LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dp ZHRoLCBiYWNrZ3JvdW5kLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgZ2x5cGhfZmxhdm9yLCByZW1vdmVfcCk7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAg cmVzdWx0ID0gRmNvbnMgKGZvdXJ0ZWVuX2VsZW1lbnRzLCByZXN1bHQpOworICAgIH0KKyAgc3dp dGNoIChjYWNoZV90eXBlKQorICAgIHsKKyAgICAgIGNhc2UgTUNfVEVNUF9DQUNIRToKKyAgICAg ICAgeworICAgICAgICAgIGlmICghTklMUCAocmVzdWx0KSkKKyAgICAgICAgICAgIHdzZXRfbWNf dGVtcF9jYWNoZSAodywgRnJldmVyc2UgKHJlc3VsdCkpOworICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICB3c2V0X21jX3RlbXBfY2FjaGUgKHcsIFFuaWwpOworICAgICAgICAgIGJyZWFr OworICAgICAgICB9CisgICAgICBjYXNlIE1DX0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAg aWYgKCFOSUxQIChyZXN1bHQpKQorICAgICAgICAgICAgd3NldF9tY19jYWNoZSAodywgRnJldmVy c2UgKHJlc3VsdCkpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICB3c2V0X21jX2Nh Y2hlICh3LCBRbmlsKTsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgY2FzZSBD SF9DQUNIRToKKyAgICAgICAgeworICAgICAgICAgIGlmICghTklMUCAocmVzdWx0KSkKKyAgICAg ICAgICAgIHdzZXRfY2hfY2FjaGUgKHcsIEZyZXZlcnNlIChyZXN1bHQpKTsKKyAgICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgICAgd3NldF9jaF9jYWNoZSAodywgUW5pbCk7CisgICAgICAgICAg YnJlYWs7CisgICAgICAgIH0KKyAgICAgIGNhc2UgRkNfQ0FDSEU6CisgICAgICAgIHsKKyAgICAg ICAgICBpZiAoIU5JTFAgKHJlc3VsdCkpCisgICAgICAgICAgICB3c2V0X2ZjX2NhY2hlICh3LCBG cmV2ZXJzZSAocmVzdWx0KSk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHdzZXRf ZmNfY2FjaGUgKHcsIFFuaWwpOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQor fQorCit2b2lkCittY19lcmFzZV9yb3cgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9t YXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93KQoreworICBpbnQgdnBvcyA9IE1B VFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisg ICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZXJhc2Vfcm93ICglcyk6ICB2cG9zICglZClcbiIsIG1j X3dpbmRvdyAodyksIHZwb3MpOworICBtY19lcmFzZV9oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBN Q19DQUNIRSk7CisgIG1jX2VyYXNlX2hlbHBlciAodywgbWF0cml4LCByb3csIENIX0NB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9idWZmZXJfaW50ZXJuYWwgKGIpOworICAgIH0KKyAgdy0+ bWMuZmNfeCA9IChmaWxsX2NvbHVtbl9wCisgICAgICAgICAgICAgICAgJiYgIU5JTFAgKFZkaXNw bGF5X2xpbmVfbnVtYmVycykpCisgICAgICAgICAgICAgICAgID8gKGZpbGxfY29sICogZnJhbWVf Y2hhcl93aWR0aCkgKyB3LT5tYy5sbnVtX3BpeGVsX3dpZHRoIC0gaHNjbF94CisgICAgICAgICAg ICAgICA6IChmaWxsX2NvbHVtbl9wCisgICAgICAgICAgICAgICAgICAmJiBOSUxQIChWZGlzcGxh eV9saW5lX251bWJlcnMpKQorICAgICAgICAgICAgICAgICA/IChmaWxsX2NvbCAqIGZyYW1lX2No YXJfd2lkdGgpIC0gaHNjbF94CisgICAgICAgICAgICAgICA6IDA7CisgIGlmIChvbGRfYnVmZmVy KQorICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworICBlbnVtIGZhY2VfaWQg ZmlsbF9jb2x1bW5fZmFjZV9pZCA9CisgICAgKCFhY3RpdmVfcAorICAgICAmJiAhTklMUCAoQlZB UiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY19pbmFjdGl2ZV93aW5kb3dzKSkKKyAgICAgJiYg TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisgICAgICA/ IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCJmYy1pbmFjdGl2ZS1mYWNlIiksIHRy dWUpCisgICAgOiAoIWFjdGl2ZV9wCisgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgZmNfaW5hY3RpdmVfd2luZG93cykpCisgICAgICAgJiYgIU5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgJiYgIU5JTFAgKEJW QVIgKGIsIGNoX3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Vu dF9tYXRyaXgsIHZwb3MpOworICAgICAgbWNfZXJhc2Vfcm93ICh3LCBjdXJyZW50X21hdHJpeCwg cm93KTsKKyAgICB9CisgIHdzZXRfbWNfY2FjaGUgKHcsIFFuaWwpOworICB3c2V0X2NoX2NhY2hl ICh3LCBRbmlsKTsKKyAgd3NldF9mY19jYWNoZSAodywgUW5pbCk7CisgIGlmICh1cGRhdGluZ19m cmFtZV9wKQorICAgIHVwZGF0ZV9lbmQgKFhGUkFNRSAody0+ZnJhbWUpKTsKK30KKworREVGVU4g KCJtYy1zdGRlcnIiLCBGbWNfc3RkZXJyLCBTbWNfc3RkZXJyLCAwLCAxLCAiUCIsCisgICAgICAg ZG9jOiAvKiBUb2dnbGUgdHJhY2luZyBvZiBtdWx0aXBsZSBmYWtlIGN1cnNvcnMuCitXaXRoIEFS RywgdHVybiB0cmFjaW5nIG9uIGlmIGFuZCBvbmx5IGlmIEFSRyBpcyBwb3NpdGl2ZS4gKi8pCisg IChMaXNwX09iamVjdCBhcmcpCit7CisgIGlmIChOSUxQIChhcmcpKQorICAgIG1jX3N0ZGVycl9w ID0gIW1jX3N0ZGVycl9wOworICBlbHNlCisgICAgeworICAgICAgYXJnID0gRnByZWZpeF9udW1l cmljX3ZhbHVlIChhcmcpOworICAgICAgbWNfc3RkZXJyX3AgPSBYRklYTlVNIChhcmcpID4gMDsK KyAgICB9CisgIHJldHVybiBRbmlsOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogDAogLyoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAJCSAgICAg IFdpbmRvdyBkaXNwbGF5IGRpbWVuc2lvbnMKQEAgLTEzMzk1LDYgKzE3NDcwLDY5IEBAIGhzY3Jv bGxfd2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U7CisgIGlm IChiYXJmX2NyYXNoX29uZSkKKyAgICByZXR1cm4gaHNjcm9sbGVkX3A7CisKKyAgLyogYHJlc2Vh dF8xJzogIENIQVJQT1MgKHBvcykgPj0gQkVHViAmJiBDSEFSUE9TIChwb3MpIDw9IFpWICovCisg IGJvb2wgYmFyZl9jcmFzaF90d28gPSAoY2hhcnBvcyA+PSBCRUdWICYmIGNoYXJwb3MgPD0gWlYp CisgICAgICAgICAgICAgICAgICAgICAgICAgPyBmYWxzZQorICAgICAgICAgICAgICAgICAgICAg ICAgIDogdHJ1ZTsKKyAgaWYgKGJhcmZfY3Jhc2hfdHdvKQorICAgIHJldHVybiBoc2Nyb2xsZWRf cDsKKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKIAkgICAgICAvKiBNb3ZlIGl0ZXJhdG9yIHRvIHB0IHN0YXJ0aW5nIGF0IGN1cnNvcl9y b3ctPnN0YXJ0IGluCiAJCSBhIGxpbmUgd2l0aCBpbmZpbml0ZSB3aWR0aC4gICovCiAJICAgICAg aW5pdF90b19yb3dfc3RhcnQgKCZpdCwgdywgY3Vyc29yX3Jvdyk7CkBAIC0xNDI4Nyw5ICsxODQy NSwyMiBAQCByZWRpc3BsYXlfaW50ZXJuYWwgKHZvaWQpCiAJICAgICAgKnctPmRlc2lyZWRfbWF0 cml4LT5tZXRob2QgPSAwOwogCSAgICAgIGRlYnVnX21ldGhvZF9hZGQgKHcsICJvcHRpbWl6YXRp b24gMSIpOwogI2VuZGlmCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KKyAgaWYgKEJVRkZFUlAg KHctPmNvbnRlbnRzKQorICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgY3Jvc3NoYWlycykpKQorICAgIG1jX3VwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgZmFsc2Up OworICAgIGVsc2UKIAkgICAgICB1cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIGZhbHNlKTsKICNl bmRpZgorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAgICAgZ290byB1cGRhdGU7 CiAJICAgIH0KIAkgIGVsc2UKQEAgLTE3Njg3LDEwICsyMTgzOCwyMSBAQCByZWRpc3BsYXlfd2lu ZG93IChMaXNwX09iamVjdCB3aW5kb3csIGJvb2wganVzdF90aGlzX29uZV9wKQogICAgIH0KIAog I2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGJvb2wga2VlcF9jdXJyZW50X3AgPSAoanVzdF90 aGlzX29uZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKCF1c2VkX2N1cnJlbnRfbWF0 cml4X3AgJiYgIW92ZXJsYXlfYXJyb3dfc2VlbikKKyAgICAgICAgICAgICAgICAgICAgICAgICB8 fCB3LT5wc2V1ZG9fd2luZG93X3ApOworCisgIGJvb2wgZnJpbmdlc191cGRhdGVkX3AgPSAoIU5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBtY191cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIGtlZXBfY3Vy cmVudF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgOiB1cGRhdGVfd2luZG93X2ZyaW5n ZXMgKHcsIGtlZXBfY3VycmVudF9wKTsKKwogICBpZiAoRlJBTUVfV0lORE9XX1AgKGYpCi0gICAg ICAmJiB1cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIChqdXN0X3RoaXNfb25lX3AKLQkJCQkgICAg fHwgKCF1c2VkX2N1cnJlbnRfbWF0cml4X3AgJiYgIW92ZXJsYXlfYXJyb3dfc2VlbikKLQkJCQkg ICAgfHwgdy0+cHNldWRvX3dpbmRvd19wKSkpCisgICAgICAmJiBmcmluZ2VzX3VwZGF0ZWRfcCkK ICAgICB7CiAgICAgICB1cGRhdGVfYmVnaW4gKGYpOwogICAgICAgYmxvY2tfaW5wdXQgKCk7CkBA IC0xNzcwNSw2ICsyMTg2Nyw5IEBAIHJlZGlzcGxheV93aW5kb3cgKExpc3BfT2JqZWN0IHdpbmRv dywgYm9vbCBqdXN0X3RoaXNfb25lX3ApCiAgICAgICB1cGRhdGVfZW5kIChmKTsKICAgICB9CiAK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgaWYgKFdJTkRPV19CT1RUT01fRElWSURF Ul9XSURUSCAodykpCiAgICAgeF9kcmF3X2JvdHRvbV9kaXZpZGVyICh3KTsKICNlbmRpZiAvKiBI QVZFX1dJTkRPV19TWVNURU0gKi8KQEAgLTE4MDEwLDYgKzIyMTc1LDE5IEBAIHRyeV93aW5kb3df cmV1c2luZ19jdXJyZW50X21hdHJpeCAoc3RydWN0IHdpbmRvdyAqdykKIAkgICAgIHNjcm9sbF9y dW5faG9vayB3aWxsIGNsZWFyIHRoZSBjdXJzb3IsIGFuZCB1c2UgdGhlCiAJICAgICBjdXJyZW50 IG1hdHJpeCB0byBnZXQgdGhlIGhlaWdodCBvZiB0aGUgcm93IHRoZSBjdXJzb3IgaXMKIAkgICAg IGluLiAgKi8KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNP UlMgKi8KKworICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAgZnByaW50ZiAoc3RkZXJyLCAi dHJ5X3dpbmRvd19yZXVzaW5nX2N1cnJlbnRfbWF0cml4IFsxIG9mIDJdICglcylcbiIsIG1jX3dp bmRvdyAodykpOworCisgIG1jX2VyYXNlX3ByZV9zY3JvbGxfZGlzcGxheSAodyk7CisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKIAkgIHJ1bi5jdXJyZW50X3kgPSBzdGFydF9yb3ctPnk7 CiAJICBydW4uZGVzaXJlZF95ID0gaXQuY3VycmVudF95OwogCSAgcnVuLmhlaWdodCA9IGl0Lmxh c3RfdmlzaWJsZV95IC0gaXQuY3VycmVudF95OwpAQCAtMTgxNzMsNiArMjIzNTEsMTkgQEAgdHJ5 X3dpbmRvd19yZXVzaW5nX2N1cnJlbnRfbWF0cml4IChzdHJ1Y3Qgd2luZG93ICp3KQogCX0KIAog ICAgICAgLyogU2Nyb2xsIHRoZSBkaXNwbGF5LiAgKi8KKworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBpZiAodHJhY2VfcmVkaXNwbGF5X3Ap CisgICAgZnByaW50ZiAoc3RkZXJyLCAidHJ5X3dpbmRvd19yZXVzaW5nX2N1cnJlbnRfbWF0cml4 IFsyIG9mIDJdICglcylcbiIsIG1jX3dpbmRvdyAodykpOworCisgIG1jX2VyYXNlX3ByZV9zY3Jv bGxfZGlzcGxheSAodyk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIHJ1 bi5jdXJyZW50X3kgPSBmaXJzdF9yZXVzYWJsZV9yb3ctPnk7CiAgICAgICBydW4uZGVzaXJlZF95 ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CiAgICAgICBydW4uaGVpZ2h0ID0gaXQu bGFzdF92aXNpYmxlX3kgLSBydW4uY3VycmVudF95OwpAQCAtMTkxMjcsNiArMjMzMTgsMTkgQEAg dHJ5X3dpbmRvd19pZCAoc3RydWN0IHdpbmRvdyAqdykKICAgLyogU2Nyb2xsIHRoZSBkaXNwbGF5 LiAgRG8gaXQgYmVmb3JlIGNoYW5naW5nIHRoZSBjdXJyZW50IG1hdHJpeCBzbwogICAgICB0aGF0 IHh0ZXJtLmMgZG9lc24ndCBnZXQgY29uZnVzZWQgYWJvdXQgd2hlcmUgdGhlIGN1cnNvciBnbHlw aCBpcwogICAgICBmb3VuZC4gICovCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBN VUxUSVBMRS1DVVJTT1JTICovCisKKyAgaWYgKHRyYWNlX3JlZGlzcGxheV9wKQorICAgIGZwcmlu dGYgKHN0ZGVyciwgInRyeV93aW5kb3dfaWQgKCVzKVxuIiwgbWNfd2luZG93ICh3KSk7CisKKyAg bWNfZXJhc2VfcHJlX3Njcm9sbF9kaXNwbGF5ICh3KTsKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogICBpZiAoZHkgJiYgcnVuLmhlaWdodCkKICAgICB7CiAgICAgICB1cGRhdGVfYmVn aW4gKGYpOwpAQCAtMjAxMzMsNiArMjQzMzcsMTcgQEAgYXBwZW5kX3NwYWNlX2Zvcl9uZXdsaW5l IChzdHJ1Y3QgaXQgKml0LCBib29sIGRlZmF1bHRfZmFjZV9wKQogCSAgbWVtc2V0ICgmaXQtPnBv c2l0aW9uLCAwLCBzaXplb2YgaXQtPnBvc2l0aW9uKTsKIAkgIGl0LT5vYmplY3QgPSBRbmlsOwog CSAgaXQtPmMgPSBpdC0+Y2hhcl90b19kaXNwbGF5ID0gJyAnOworCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBpZiAoSVRfQllURVBP UyAoKml0KSA+PSBaVl9CWVRFKQorICAgICAgICBpdC0+enZfcCA9IHRydWU7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKIAkgIGl0LT5sZW4gPSAxOwogCiAJICAvKiBJZiB0aGUgZGVm YXVsdCBmYWNlIHdhcyByZW1hcHBlZCwgYmUgc3VyZSB0byB1c2UgdGhlCkBAIC0yMTI2OSw5ICsy NTQ4NCwyMiBAQCBtYXliZV9wcm9kdWNlX2xpbmVfbnVtYmVyIChzdHJ1Y3QgaXQgKml0KQogICAg ICAgZWxzZQogCXRlbV9pdC5jID0gdGVtX2l0LmNoYXJfdG9fZGlzcGxheSA9ICpwOwogICAgICAg dGVtX2l0LmxlbiA9IDE7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKKyAgICAgIGlmIChiZXlvbmRfenYpCisgICAgICAgIHRlbV9pdC56dl9w ID0gdHJ1ZTsKKyAgICAgIHRlbV9pdC5jdXJyZW50X3kgPSBpdC0+Y3VycmVudF95OworICAgICAg dGVtX2l0LnZwb3MgPSBpdC0+dnBvczsKICAgICAgIC8qIE1ha2Ugc3VyZSB0aGVzZSBnbHlwaHMg d2lsbCBoYXZlIGEgInBvc2l0aW9uIiBvZiAtMS4gICovCiAgICAgICBTRVRfVEVYVF9QT1MgKHRl bV9pdC5wb3NpdGlvbiwgLTEsIC0xKTsKICAgICAgIFBST0RVQ0VfR0xZUEhTICgmdGVtX2l0KTsK KyAgICAgIHRlbV9pdC5ocG9zICs9IDE7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCiAK ICAgICAgIC8qIFN0b3AgcHJvZHVjaW5nIGdseXBocywgYW5kIHJlZnJhaW4gZnJvbSBwcm9kdWNp bmcgdGhlIGxpbmUKIAkgbnVtYmVyLCBpZiB3ZSBkb24ndCBoYXZlIGVub3VnaCBzcGFjZSBvbiB0 aGlzIGxpbmUuICAqLwpAQCAtMjEyODQsNiArMjU1MTIsMzAgQEAgbWF5YmVfcHJvZHVjZV9saW5l X251bWJlciAoc3RydWN0IGl0ICppdCkKIAl9CiAgICAgfQogCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIExpc3BfT2JqZWN0IGJ1ZiA9IGl0 LT53LT5jb250ZW50czsKKyAgQ0hFQ0tfQlVGRkVSIChidWYpOworICBzdHJ1Y3QgYnVmZmVyICpi ID0gWEJVRkZFUiAoYnVmKTsKKyAgc3RydWN0IGJ1ZmZlciAqb2xkX2J1ZmZlciA9IE5VTEw7Cisg IC8qIE5lZWRlZCBzbyB0aGF0IGJ1ZmZlci1sb2NhbCB2YWx1ZXMgY2FuIGJlIGRldGVybWluZWQ7 IGUuZy4sIHdoZW4gc3dpdGNoaW5nCisgIHRvIHRoZSBtaW5pYnVmZmVyLiAqLworICBpZiAoYiAh PSBjdXJyZW50X2J1ZmZlcikKKyAgICB7CisgICAgICBvbGRfYnVmZmVyID0gY3VycmVudF9idWZm ZXI7CisgICAgICBzZXRfYnVmZmVyX2ludGVybmFsIChiKTsKKyAgICB9CisgIGl0LT53LT5tYy5s bnVtX3BpeGVsX3dpZHRoID0gKCFOSUxQIChWZGlzcGxheV9saW5lX251bWJlcnMpKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gdGVtX2l0LmN1cnJlbnRfeAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogMDsKKyAgaWYgKG9sZF9idWZmZXIpCisgICAgc2V0X2J1ZmZl cl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK ICAgLyogUmVjb3JkIHRoZSB3aWR0aCBpbiBwaXhlbHMgd2UgbmVlZCBmb3IgdGhlIGxpbmUgbnVt YmVyIGRpc3BsYXkuICAqLwogICBpdC0+bG51bV9waXhlbF93aWR0aCA9IHRlbV9pdC5jdXJyZW50 X3g7CiAgIC8qIENvcHkgdGhlIHByb2R1Y2VkIGdseXBocyBpbnRvIElUJ3MgZ2x5cGhfcm93LiAg Ki8KQEAgLTI3MDkyLDYgKzMxMzQ0LDIwIEBAIGFwcGVuZF9nbHlwaCAoc3RydWN0IGl0ICppdCkK IAkgICAgZ1sxXSA9ICpnOwogCSAgZ2x5cGggPSBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJlYV07 CiAJfQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAq LworCisgICAgICBnbHlwaC0+eCA9IGl0LT5jdXJyZW50X3g7CisgICAgICBnbHlwaC0+eSA9IGl0 LT5jdXJyZW50X3k7CisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5cGgt PnZwb3MgPSBpdC0+dnBvczsKKyAgICAgIGdseXBoLT56dl9wID0gaXQtPnp2X3A7CisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAo aXQtPnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5vYmplY3QgPSBpdC0+b2JqZWN0OwogICAgICAg aWYgKGl0LT5waXhlbF93aWR0aCA+IDApCkBAIC0yNzE3NSw2ICszMTQ0MSwyMCBAQCBhcHBlbmRf Y29tcG9zaXRlX2dseXBoIChzdHJ1Y3QgaXQgKml0KQogCSAgICBnWzFdID0gKmc7CiAJICBnbHlw aCA9IGl0LT5nbHlwaF9yb3ctPmdseXBoc1tpdC0+YXJlYV07CiAJfQorCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+eCA9 IGl0LT5jdXJyZW50X3g7CisgICAgICBnbHlwaC0+eSA9IGl0LT5jdXJyZW50X3k7CisgICAgICBn bHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPnZwb3MgPSBpdC0+dnBvczsKKyAg ICAgIGdseXBoLT56dl9wID0gaXQtPnp2X3A7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor CisKICAgICAgIGdseXBoLT5jaGFycG9zID0gaXQtPmNtcF9pdC5jaGFycG9zOwogICAgICAgZ2x5 cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAgICAgICBlYXNzZXJ0IChpdC0+cGl4ZWxfd2lkdGgg PD0gU0hSVF9NQVgpOwpAQCAtMjczODMsNiArMzE2NjMsMjAgQEAgcHJvZHVjZV9pbWFnZV9nbHlw aCAoc3RydWN0IGl0ICppdCkKIAl9CiAgICAgICBpZiAoZ2x5cGggPCBpdC0+Z2x5cGhfcm93LT5n bHlwaHNbYXJlYSArIDFdKQogCXsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1V TFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPnggPSBpdC0+Y3VycmVudF94OworICAg ICAgZ2x5cGgtPnkgPSBpdC0+Y3VycmVudF95OworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBv czsKKyAgICAgIGdseXBoLT52cG9zID0gaXQtPnZwb3M7CisgICAgICBnbHlwaC0+enZfcCA9IGl0 LT56dl9wOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICBnbHlwaC0+Y2hhcnBv cyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAJICBnbHlwaC0+b2JqZWN0ID0gaXQtPm9iamVj dDsKIAkgIGdseXBoLT5waXhlbF93aWR0aCA9IGNsaXBfdG9fYm91bmRzICgtMSwgaXQtPnBpeGVs X3dpZHRoLCBTSFJUX01BWCk7CkBAIC0yNzQ4Niw2ICszMTc4MCwyMCBAQCBwcm9kdWNlX3h3aWRn ZXRfZ2x5cGggKHN0cnVjdCBpdCAqaXQpCiAJfQogICAgICAgaWYgKGdseXBoIDwgaXQtPmdseXBo X3Jvdy0+Z2x5cGhzW2FyZWEgKyAxXSkKIAl7CisKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGdseXBoLT54ID0gaXQtPmN1cnJlbnRf eDsKKyAgICAgIGdseXBoLT55ID0gaXQtPmN1cnJlbnRfeTsKKyAgICAgIGdseXBoLT5ocG9zID0g aXQtPmhwb3M7CisgICAgICBnbHlwaC0+dnBvcyA9IGl0LT52cG9zOworICAgICAgZ2x5cGgtPnp2 X3AgPSBpdC0+enZfcDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgZ2x5cGgt PmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9zaXRpb24pOwogCSAgZ2x5cGgtPm9iamVjdCA9IGl0 LT5vYmplY3Q7CiAJICBnbHlwaC0+cGl4ZWxfd2lkdGggPSBjbGlwX3RvX2JvdW5kcyAoLTEsIGl0 LT5waXhlbF93aWR0aCwgU0hSVF9NQVgpOwpAQCAtMjc1NzIsNiArMzE4ODAsMjAgQEAgYXBwZW5k X3N0cmV0Y2hfZ2x5cGggKHN0cnVjdCBpdCAqaXQsIExpc3BfT2JqZWN0IG9iamVjdCwKIAkgICAg d2lkdGggLT0gaXQtPmZpcnN0X3Zpc2libGVfeCAtIGl0LT5jdXJyZW50X3g7CiAJICBlYXNzZXJ0 ICh3aWR0aCA+IDApOwogCX0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJ UExFLUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPnggPSBpdC0+Y3VycmVudF94OworICAgICAg Z2x5cGgtPnkgPSBpdC0+Y3VycmVudF95OworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsK KyAgICAgIGdseXBoLT52cG9zID0gaXQtPnZwb3M7CisgICAgICBnbHlwaC0+enZfcCA9IGl0LT56 dl9wOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICBnbHlwaC0+Y2hhcnBv cyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAgICAgICBnbHlwaC0+b2JqZWN0ID0gb2JqZWN0 OwogICAgICAgLyogRklYTUU6IEl0IHdvdWxkIGJlIGJldHRlciB0byB1c2UgVFlQRV9NQVggaGVy ZSwgYnV0CkBAIC0yODAyNiw2ICszMjM0OCwyMCBAQCBhcHBlbmRfZ2x5cGhsZXNzX2dseXBoIChz dHJ1Y3QgaXQgKml0LCBpbnQgZmFjZV9pZCwgYm9vbCBmb3Jfbm9fZm9udCwgaW50IGxlbiwKIAkg ICAgZ1sxXSA9ICpnOwogCSAgZ2x5cGggPSBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJlYV07CiAJ fQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLwor CisgICAgICBnbHlwaC0+eCA9IGl0LT5jdXJyZW50X3g7CisgICAgICBnbHlwaC0+eSA9IGl0LT5j dXJyZW50X3k7CisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPnZw b3MgPSBpdC0+dnBvczsKKyAgICAgIGdseXBoLT56dl9wID0gaXQtPnp2X3A7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgICAgIGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQt PnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5vYmplY3QgPSBpdC0+b2JqZWN0OwogICAgICAgZWFz c2VydCAoaXQtPnBpeGVsX3dpZHRoIDw9IFNIUlRfTUFYKTsKQEAgLTI5MDc2LDEwICszMzQxMiwz MyBAQCB4X2luc2VydF9nbHlwaHMgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cg KnVwZGF0ZWRfcm93LAogCiAgIC8qIFdyaXRlIHRoZSBnbHlwaHMuICAqLwogICBocG9zID0gc3Rh cnQgLSByb3ctPmdseXBoc1t1cGRhdGVkX2FyZWFdOworCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlmICgoIU5JTFAgKHctPm1jX2NhY2hl KSB8fCAhTklMUCAody0+Y2hfY2FjaGUpIHx8ICFOSUxQICh3LT5mY19jYWNoZSkpCisgICAgICAm JiB1cGRhdGVkX2FyZWEgPT0gVEVYVF9BUkVBKQorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlwaF9t YXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworICAgICAgaW50IHZwb3MgPSBNQVRS SVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgICAgIGludCBzdGFydF94ID0gdy0+b3V0cHV0 X2N1cnNvci54OworICAgICAgaW50IHN0YXJ0X2hwb3MgPSBocG9zOworICAgICAgaW50IGVuZF9o cG9zID0gaHBvcyArIGxlbjsKKyAgICAgIGJvb2wgY2xlYXJfZW9sX3AgPSBmYWxzZTsKKyAgICAg IGVudW0gZHJhd19nbHlwaHNfZmFjZSBobCA9IERSQVdfTk9STUFMX1RFWFQ7CisgICAgICBUUkFD RSAoKHN0ZGVyciwgInhfaW5zZXJ0X2dseXBocyAoJWQpOiAgc3RhcnRfeCAoJWQpIHwgc3RhcnRf aHBvcyAoJWQpIHwgZW5kX2hwb3MgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICB2cG9z LCBzdGFydF94LCBzdGFydF9ocG9zLCBlbmRfaHBvcykpOworICAgICAgbWNfcmVkcmF3X3JvdyAo dywgbWF0cml4LCByb3csIHN0YXJ0X3gsIHN0YXJ0X2hwb3MsIGVuZF9ocG9zLCBjbGVhcl9lb2xf cCwgaGwpOworICAgIH0KKyAgICBlbHNlCiAgIGRyYXdfZ2x5cGhzICh3LCB3LT5vdXRwdXRfY3Vy c29yLngsIHJvdywgdXBkYXRlZF9hcmVhLAogCSAgICAgICBocG9zLCBocG9zICsgbGVuLAogCSAg ICAgICBEUkFXX05PUk1BTF9URVhULCAwKTsKIAorLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisK KwogICAvKiBBZHZhbmNlIHRoZSBvdXRwdXQgY3Vyc29yLiAgKi8KICAgdy0+b3V0cHV0X2N1cnNv ci5ocG9zICs9IGxlbjsKICAgdy0+b3V0cHV0X2N1cnNvci54ICs9IHNoaWZ0X2J5X3dpZHRoOwpA QCAtMjkxNzcsNiArMzM1MzYsMTYgQEAgZ2V0X3NwZWNpZmllZF9jdXJzb3JfdHlwZSAoTGlzcF9P YmplY3QgYXJnLCBpbnQgKndpZHRoKQogewogICBlbnVtIHRleHRfY3Vyc29yX2tpbmRzIHR5cGU7 CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK KyAgaWYgKEVRIChhcmcsIFFmcmFtZWQpKQorICAgIHJldHVybiBGUkFNRURfQk9YX0NVUlNPUjsK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBpZiAoTklMUCAoYXJnKSkKICAgICBy ZXR1cm4gTk9fQ1VSU09SOwogCkBAIC0yOTMyNiw5ICszMzY5NSwxOSBAQCBnZXRfd2luZG93X2N1 cnNvcl90eXBlIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGggKmdseXBoLCBpbnQgKndp ZHRoLAogICAgICAgYWx0X2N1cnNvciA9IEJWQVIgKGIsIGN1cnNvcl9pbl9ub25fc2VsZWN0ZWRf d2luZG93cyk7CiAgICAgICBpZiAoIUVRIChRdCwgYWx0X2N1cnNvcikpCiAJcmV0dXJuIGdldF9z cGVjaWZpZWRfY3Vyc29yX3R5cGUgKGFsdF9jdXJzb3IsIHdpZHRoKTsKKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogICAgICAgLyogdCBtZWFu cyBtb2RpZnkgdGhlIG5vcm1hbCBjdXJzb3IgdHlwZS4gICovCi0gICAgICBpZiAoY3Vyc29yX3R5 cGUgPT0gRklMTEVEX0JPWF9DVVJTT1IpCi0JY3Vyc29yX3R5cGUgPSBIT0xMT1dfQk9YX0NVUlNP UjsKKyAgICAgIGlmIChjdXJzb3JfdHlwZSA9PSBGSUxMRURfQk9YX0NVUlNPUgorICAgICAgICAg IHx8IGN1cnNvcl90eXBlID09IEZSQU1FRF9CT1hfQ1VSU09SKQorICAgICAgICBjdXJzb3JfdHlw ZSA9IEhPTExPV19CT1hfQ1VSU09SOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAg ICAgICBlbHNlIGlmIChjdXJzb3JfdHlwZSA9PSBCQVJfQ1VSU09SICYmICp3aWR0aCA+IDEpCiAJ LS0qd2lkdGg7CiAgICAgICByZXR1cm4gY3Vyc29yX3R5cGU7CkBAIC0yOTM0MSw3ICszMzcyMCwx NyBAQCBnZXRfd2luZG93X2N1cnNvcl90eXBlIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5 cGggKmdseXBoLCBpbnQgKndpZHRoLAogICAgICAgICByZXR1cm4gTk9fQ1VSU09SOwogICAgICAg aWYgKGdseXBoICE9IE5VTEwgJiYgZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCiAJewotCSAg aWYgKGN1cnNvcl90eXBlID09IEZJTExFRF9CT1hfQ1VSU09SKQorCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisJICBpZiAoY3Vyc29yX3R5cGUg PT0gRklMTEVEX0JPWF9DVVJTT1IKKyAgICAgICAgICB8fCBjdXJzb3JfdHlwZSA9PSBGUkFNRURf Qk9YX0NVUlNPUikKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgICB7CiAJICAg ICAgLyogVXNpbmcgYSBibG9jayBjdXJzb3Igb24gbGFyZ2UgaW1hZ2VzIGNhbiBiZSB2ZXJ5IGFu bm95aW5nLgogCQkgU28gdXNlIGEgaG9sbG93IGN1cnNvciBmb3IgImxhcmdlIiBpbWFnZXMuCkBA IC0yOTM5Myw5ICszMzc4MiwxNyBAQCBnZXRfd2luZG93X2N1cnNvcl90eXBlIChzdHJ1Y3Qgd2lu ZG93ICp3LCBzdHJ1Y3QgZ2x5cGggKmdseXBoLCBpbnQgKndpZHRoLAogICAgICAgIG5hcnJvdyBb aF1iYXIgICA8LT4gICBubyBjdXJzb3IKICAgICAgICBvdGhlciB0eXBlICAgICAgPC0+ICAgbm8g Y3Vyc29yICAqLwogCi0gIGlmIChjdXJzb3JfdHlwZSA9PSBGSUxMRURfQk9YX0NVUlNPUikKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgaWYg KGN1cnNvcl90eXBlID09IEZJTExFRF9CT1hfQ1VSU09SCisgICAgICB8fCBjdXJzb3JfdHlwZSA9 PSBGUkFNRURfQk9YX0NVUlNPUikKICAgICByZXR1cm4gSE9MTE9XX0JPWF9DVVJTT1I7CiAKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKICAgaWYgKChjdXJzb3JfdHlwZSA9PSBCQVJfQ1VS U09SIHx8IGN1cnNvcl90eXBlID09IEhCQVJfQ1VSU09SKSAmJiAqd2lkdGggPiAxKQogICAgIHsK ICAgICAgICp3aWR0aCA9IDE7CkBAIC0yOTUwNSw5ICszMzkwMiwzMSBAQCB4X2ZpeF9vdmVybGFw cGluZ19hcmVhIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCiAJICB3 aGlsZSAoaSA8IHJvdy0+dXNlZFthcmVhXQogCQkgJiYgcm93LT5nbHlwaHNbYXJlYV1baV0ub3Zl cmxhcHNfdmVydGljYWxseV9wKTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1V TFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgICBpZiAoKCFOSUxQICh3LT5tY19jYWNoZSkgfHwg IU5JTFAgKHctPmNoX2NhY2hlKSB8fCAhTklMUCAody0+ZmNfY2FjaGUpKQorICAgICAgICAgICAg JiYgYXJlYSA9PSBURVhUX0FSRUEpCisgICAgICAgICAgeworICAgICAgICAgICAgc3RydWN0IGds eXBoX21hdHJpeCAqbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgICAgICAgICAgICBpbnQg dnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAgICAgICAgICAgaW50IHN0 YXJ0X2hwb3MgPSBzdGFydDsKKyAgICAgICAgICAgIGludCBlbmRfaHBvcyA9IGk7CisgICAgICAg ICAgICBib29sIGNsZWFyX2VvbF9wID0gZmFsc2U7CisgICAgICAgICAgICBlbnVtIGRyYXdfZ2x5 cGhzX2ZhY2UgaGwgPSBEUkFXX05PUk1BTF9URVhUOworICAgICAgICAgICAgVFJBQ0UgKChzdGRl cnIsICJ4X2ZpeF9vdmVybGFwcGluZ19hcmVhICglZCk6ICBzdGFydF94ICglZCkgfCBzdGFydF9o cG9zICglZCkgfCBlbmRfaHBvcyAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg IHZwb3MsIHN0YXJ0X3gsIHN0YXJ0X2hwb3MsIGVuZF9ocG9zKSk7CisgICAgICAgICAgICBtY19y ZWRyYXdfcm93ICh3LCBtYXRyaXgsIHJvdywgc3RhcnRfeCwgc3RhcnRfaHBvcywgZW5kX2hwb3Ms IGNsZWFyX2VvbF9wLCBobCk7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKIAkgIGRyYXdf Z2x5cGhzICh3LCBzdGFydF94LCByb3csIGFyZWEsCiAJCSAgICAgICBzdGFydCwgaSwKIAkJICAg ICAgIERSQVdfTk9STUFMX1RFWFQsIG92ZXJsYXBzKTsKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogCX0KICAgICAgIGVsc2UKIAl7CkBAIC0yOTY1Miw4ICszNDA3MSwxNyBAQCBlcmFz ZV9waHlzX2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdykKICAgICAgICYmIGN1cnNvcl9yb3ctPnVz ZWRbVEVYVF9BUkVBXSA+IGhwb3MgJiYgaHBvcyA+PSAwKQogICAgIG1vdXNlX2ZhY2VfaGVyZV9w ID0gdHJ1ZTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNP UlMgKi8KKwogICAvKiBNYXliZSBjbGVhciB0aGUgZGlzcGxheSB1bmRlciB0aGUgY3Vyc29yLiAg Ki8KLSAgaWYgKHctPnBoeXNfY3Vyc29yX3R5cGUgPT0gSE9MTE9XX0JPWF9DVVJTT1IpCisgIGlm ICh3LT5waHlzX2N1cnNvcl90eXBlID09IEhPTExPV19CT1hfQ1VSU09SCisgICAgICB8fCB3LT5w aHlzX2N1cnNvcl90eXBlID09IEZSQU1FRF9CT1hfQ1VSU09SKQorCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKworCiAgICAgewogICAgICAgaW50IHgsIHk7CiAgICAgICBpbnQgaGVhZGVyX2xp bmVfaGVpZ2h0ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CkBAIC0yOTc1OCwxMCAr MzQxODYsMTcgQEAgZGlzcGxheV9hbmRfc2V0X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgYm9v bCBvbiwKICAgbmV3X2N1cnNvcl90eXBlID0gZ2V0X3dpbmRvd19jdXJzb3JfdHlwZSAodywgZ2x5 cGgsCiAJCQkJCSAgICAmbmV3X2N1cnNvcl93aWR0aCwgJmFjdGl2ZV9jdXJzb3IpOwogCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCiAgIC8qIElm IGN1cnNvciBpcyBjdX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UgZXh0cmEg d29yayBvZiBlcmFzaW5nIHRoZSBjdXJzb3IKQEAgLTI5NzkyLDkgKzM0MjMwLDE5IEBAIGRpc3Bs YXlfYW5kX3NldF9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgb24sCiAgICAgICB3LT5w aHlzX2N1cnNvci52cG9zID0gdnBvczsKICAgICB9CiAKLSAgRlJBTUVfUklGIChmKS0+ZHJhd193 aW5kb3dfY3Vyc29yICh3LCBnbHlwaF9yb3csIHgsIHksCi0gICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgbmV3X2N1cnNvcl90eXBlLCBuZXdfY3Vyc29yX3dpZHRoLAotICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uLCBhY3RpdmVfY3Vyc29yKTsKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgaWYgKE5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAmJiBO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQorICAgICAgJiYg TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkpCisgICAgRlJBTUVf UklGIChmKS0+ZHJhd193aW5kb3dfY3Vyc29yICh3LCBnbHlwaF9yb3csIHgsIHksIG5ld19jdXJz b3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19jdXJz b3Jfd2lkdGgsIG9uLCBhY3RpdmVfY3Vyc29yKTsKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogfQogCiAKQEAgLTI5ODg3LDcgKzM0MzM1LDI3IEBAIGRyYXdfcm93X3dpdGhfbW91c2Vf ZmFjZSAoc3RydWN0IHdpbmRvdyAqdywgaW50IHN0YXJ0X3gsIHN0cnVjdCBnbHlwaF9yb3cgKnJv dywKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KICAgaWYgKEZSQU1FX1dJTkRPV19QIChYRlJB TUUgKHctPmZyYW1lKSkpCiAgICAgeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyog TVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBpZiAoIU5JTFAgKHctPm1jX2NhY2hlKSB8fCAh TklMUCAody0+Y2hfY2FjaGUpIHx8ICFOSUxQICh3LT5mY19jYWNoZSkpCisgICAgICAgIHsKKyAg ICAgICAgICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsK KyAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAg ICAgICAgIGJvb2wgY2xlYXJfZW9sX3AgPSBmYWxzZTsKKyAgICAgICAgICBlbnVtIGRyYXdfZ2x5 cGhzX2ZhY2UgaGwgPSBkcmF3OworICAgICAgICAgIFRSQUNFICgoc3RkZXJyLCAiZHJhd19yb3df d2l0aF9tb3VzZV9mYWNlICglZCk6ICBzdGFydF94ICglZCkgfCBzdGFydF9ocG9zICglZCkgfCBl bmRfaHBvcyAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCBzdGFydF94 LCBzdGFydF9ocG9zLCBlbmRfaHBvcykpOworICAgICAgICAgIG1jX3JlZHJhd19yb3cgKHcsIG1h dHJpeCwgcm93LCBzdGFydF94LCBzdGFydF9ocG9zLCBlbmRfaHBvcywgY2xlYXJfZW9sX3AsIGhs KTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCiAgICAgICBkcmF3X2dseXBocyAodywgc3RhcnRf eCwgcm93LCBURVhUX0FSRUEsIHN0YXJ0X2hwb3MsIGVuZF9ocG9zLCBkcmF3LCAwKTsKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgcmV0dXJuOwogICAgIH0KICNlbmRpZgpA QCAtMzE5NDUsMTEgKzM2NDEzLDM0IEBAIGV4cG9zZV9hcmVhIChzdHJ1Y3Qgd2luZG93ICp3LCBz dHJ1Y3QgZ2x5cGhfcm93ICpyb3csIFhSZWN0YW5nbGUgKnIsCiAgIHN0cnVjdCBnbHlwaCAqbGFz dDsKICAgaW50IGZpcnN0X3gsIHN0YXJ0X3gsIHg7CiAKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgaWYgKGFyZWEgPT0gVEVYVF9BUkVBICYm IHJvdy0+ZmlsbF9saW5lX3ApCisgICAgeworICAgICAgaWYgKCFOSUxQICh3LT5tY19jYWNoZSkg fHwgIU5JTFAgKHctPmNoX2NhY2hlKSB8fCAhTklMUCAody0+ZmNfY2FjaGUpKQorICAgICAgICB7 CisgICAgICAgICAgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4ID0gdy0+Y3VycmVudF9tYXRy aXg7CisgICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsK KyAgICAgICAgICBpbnQgc3RhcnRfeCA9IDA7CisgICAgICAgICAgaW50IHN0YXJ0X2hwb3MgPSAw OworICAgICAgICAgIGludCBlbmRfaHBvcyA9IHJvdy0+dXNlZFtURVhUX0FSRUFdOworICAgICAg ICAgIGJvb2wgY2xlYXJfZW9sX3AgPSBmYWxzZTsKKyAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhz X2ZhY2UgaGwgPSBEUkFXX05PUk1BTF9URVhUOworICAgICAgICAgIFRSQUNFICgoc3RkZXJyLCAi ZXhwb3NlX2FyZWEgKCVkKTogIFdyaXRlIHRoZSB3aG9sZSBsaW5lLlxuIiwgdnBvcykpOworICAg ICAgICAgIG1jX3JlZHJhd19yb3cgKHcsIG1hdHJpeCwgcm93LCBzdGFydF94LCBzdGFydF9ocG9z LCBlbmRfaHBvcywgY2xlYXJfZW9sX3AsIGhsKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCiAg ICAgLyogSWYgcm93IGV4dGVuZHMgZmFjZSB0byBlbmQgb2YgbGluZSB3cml0ZSB0aGUgd2hvbGUg bGluZS4gICovCiAgICAgZHJhd19nbHlwaHMgKHcsIDAsIHJvdywgYXJlYSwKIAkJIDAsIHJvdy0+ dXNlZFthcmVhXSwKIAkJIERSQVdfTk9STUFMX1RFWFQsIDApOworICAgIH0KKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogICBlbHNlCiAgICAgewogICAgICAgLyogU2V0IFNUQVJUX1gg dG8gdGhlIHdpbmRvdy1yZWxhdGl2ZSBzdGFydCBwb3NpdGlvbiBmb3IgZHJhd2luZyBnbHlwaHMg b2YKQEAgLTMxOTgxLDExICszNjQ3MiwzNCBAQCBleHBvc2VfYXJlYSAoc3RydWN0IHdpbmRvdyAq dywgc3RydWN0IGdseXBoX3JvdyAqcm93LCBYUmVjdGFuZ2xlICpyLAogCSAgKytsYXN0OwogCX0K IAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwog ICAgICAgLyogUmVwYWludC4gICovCi0gICAgICBpZiAobGFzdC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yAgICAgICAgZWxzZSBpZiAobGFzdCA+IGZpcnN0KQogCWRyYXdfZ2x5cGhz ICh3LCBmaXJzdF94IC0gc3RhcnRfeCwgcm93LCBhcmVhLAogCQkgICAgIGZpcnN0IC0gcm93LT5n bHlwaHNbYXJlYV0sIGxhc3QgLSByb3ctPmdseXBoc1thcmVhXSwKIAkJICAgICBEUkFXX05PUk1B TF9URVhULCAwKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgIH0KIH0KIApA QCAtMzE5OTksMTAgKzM2NTEzLDMzIEBAIGV4cG9zZV9saW5lIChzdHJ1Y3Qgd2luZG93ICp3LCBz dHJ1Y3QgZ2x5cGhfcm93ICpyb3csIFhSZWN0YW5nbGUgKnIpCiB7CiAgIGVhc3NlcnQgKHJvdy0+ ZW5hYmxlZF9wKTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKwogICBpZiAocm93LT5tb2RlX2xpbmVfcCB8fCB3LT5wc2V1ZG9fd2luZG93X3Ap CisgICAgeworICAgICAgaWYgKCFOSUxQICh3LT5tY19jYWNoZSkgfHwgIU5JTFAgKHctPmNoX2Nh Y2hlKSB8fCAhTklMUCAody0+ZmNfY2FjaGUpKQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0 IGdseXBoX21hdHJpeCAqbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgICAgICAgICAgaW50 IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgICAgICAgICBpbnQgc3Rh cnRfeCA9IDA7CisgICAgICAgICAgaW50IHN0YXJ0X2hwb3MgPSAwOworICAgICAgICAgIGludCBl bmRfaHBvcyA9IHJvdy0+dXNlZFtURVhUX0FSRUFdOworICAgICAgICAgIGJvb2wgY2xlYXJfZW9s X3AgPSBmYWxzZTsKKyAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UgaGwgPSBEUkFXX05P Uk1BTF9URVhUOworICAgICAgICAgIFRSQUNFICgoc3RkZXJyLCAiZXhwb3NlX2xpbmUgKCVkKTog IFdyaXRlIHRoZSB3aG9sZSBsaW5lLlxuIiwgdnBvcykpOworICAgICAgICAgIG1jX3JlZHJhd19y b3cgKHcsIG1hdHJpeCwgcm93LCBzdGFydF94LCBzdGFydF9ocG9zLCBlbmRfaHBvcywgY2xlYXJf ZW9sX3AsIGhsKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCiAgICAgZHJhd19nbHlwaHMgKHcs IDAsIHJvdywgVEVYVF9BUkVBLAogCQkgMCwgcm93LT51c2VkW1RFWFRfQVJFQV0sCiAJCSBEUkFX X05PUk1BTF9URVhULCAwKTsKKyAgICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK ICAgZWxzZQogICAgIHsKICAgICAgIGlmIChyb3ctPnVzZWRbTEVGVF9NQVJHSU5fQVJFQV0pCkBA IC0zMjU1MCw2ICszNzA4NywyNCBAQCB4X2ludGVyc2VjdF9yZWN0YW5nbGVzIChYUmVjdGFuZ2xl ICpyMSwgWFJlY3RhbmdsZSAqcjIsIFhSZWN0YW5nbGUgKnJlc3VsdCkKIHZvaWQKIHN5bXNfb2Zf eGRpc3AgKHZvaWQpCiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKKyAgZGVmc3ViciAoJlNtY19kdW1wX2dseXBoX3Jvdyk7CisKKyAgZGVm c3ViciAoJlNtY19kdW1wX2dseXBoX21hdHJpeCk7CisKKyAgZGVmc3ViciAoJlNtY19jdXJyZW50 X2NvbHVtbik7CisKKyAgZGVmc3ViciAoJlNtY19zdGRlcnIpOworCisgIERFRlNZTSAoUWZyYW1l ZCwgImZyYW1lZCIpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIFZ3aXRoX2Vj aG9fYXJlYV9zYXZlX3ZlY3RvciA9IFFuaWw7CiAgIHN0YXRpY3BybyAoJlZ3aXRoX2VjaG9fYXJl YV9zYXZlX3ZlY3Rvcik7CiAKZGlmZiAtLWdpdCBhL3NyYy94dGVybS5jIGIvc3JjL3h0ZXJtLmMK aW5kZXggNWFhM2UzZi4uOTEyZThmYiAxMDA2NDQKLS0tIGEvc3JjL3h0ZXJtLmMKKysrIGIvc3Jj L3h0ZXJtLmMKQEAgLTEzMiw2ICsxMzIsODU1IEBAIGFsb25nIHdpdGggR05VIEVtYWNzLiAgSWYg bm90LCBzZWUgPGh0dHBzOi8vd3d3LmdudS5vcmcvbGljZW5zZXMvPi4gICovCiAjaW5jbHVkZSA8 WDExL1hLQmxpYi5oPgogI2VuZGlmCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBi ZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyNpZmRlZiBHTFlQSF9ERUJVRworc3RhdGljIHZv aWQgeF9jaGVja19mb250IChzdHJ1Y3QgZnJhbWUgKiwgc3RydWN0IGZvbnQgKik7CisjZW5kaWYK Kworc3RhdGljIHZvaWQgeF9zZXRfbW9kZV9saW5lX2ZhY2VfZ2MgKHN0cnVjdCBnbHlwaF9zdHJp bmcgKik7CisKK3N0YXRpYyB2b2lkIHhfc2V0X21vdXNlX2ZhY2VfZ2MgKHN0cnVjdCBnbHlwaF9z dH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l2ZSkpKTsKKyAgICAgIHB0cmRpZmZfdCBy ZWdpb25fYmVnaW5uaW5nID0gKHJlZ2lvbl9hY3RpdmVfcCkgPyBYRklYTlVNIChGcmVnaW9uX2Jl Z2lubmluZyAoKSkgOiAtMTsKKyAgICAgIHB0cmRpZmZfdCByZWdpb25fZW5kID0gKHJlZ2lvbl9h Y3RpdmVfcCkgPyBYRklYTlVNIChGcmVnaW9uX2VuZCAoKSkgOiAtMTsKKyAgICAgIHB0cmRpZmZf dCBvcG9pbnRfcHQgPSAodyA9PSBYV0lORE9XIChzZWxlY3RlZF93aW5kb3cpKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gUFQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFhG SVhOVU0gKEZtYXJrZXJfcG9zaXRpb24gKHctPnBvaW50bSkpOworICAgICAgYm9vbCByZWdpb25f aW5fYm91bmRzX3AgPSAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBvcG9pbnRfcHQgPj0gcmVnaW9uX2JlZ2lubmluZworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3B0IDwgcmVnaW9uX2VuZCk7CisgICAgICBpZiAo Y3Vyc29yX2dseXBoLT50eXBlICE9IElNQUdFX0dMWVBIICYmIHJlZCA+PSAwICYmIGJsdWUgPj0g MCAmJiBncmVlbiA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlq YWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MnIGJ5IGJvcnJvd2luZyB0aGUKKyAgICAg ICAgICBmdW5jdGlvbmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHhmbnMuYy4gICovCisgICAgICAg ICAgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAmJiByZWdpb25faW5fYm91bmRz X3AKKyAgICAgICAgICAgICAgJiYgYW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AgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9p ZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJu ICgiKy1yZWFsLWZha2UtY3Vyc29yLWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICBz dHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3df YWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1F X1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2 ZV9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgIFhTZXRCYWNrZ3JvdW5kIChG UkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19h Y3RpdmVfZmFjZS0+YmFja2dyb3VuZCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICAgIC8qIFRoZSByZWdpb24gaXMgX25vdF8gdmlzaWJsZSBpbiB0aGUgaW5hY3RpdmUgd2luZG93 IGJlY2F1c2UgdGhlIG92ZXJsYXkgd2luZG93IHByb3BlcnR5IGlzIHVzZWQuICovCisgICAgICAg ICAgICAgICAgZWxzZSBpZiAoIWFjdGl2ZV9wKQorICAgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29r dXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZl LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2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dXRwdXRf ZGF0YS54LT5jdXJzb3JfZ2MnIGJ5IGJvcnJvd2luZyB0aGUKKyAgICAgICAgICAgICAgZnVuY3Rp b25hbGl0eSBvZiBgeF9tYWtlX2djJyBpbiB4Zm5zLmMuICAqLworICAgICAgICAgICAgICBpZiAo cmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAmJiByZWdpb25faW5fYm91bmRzX3AK KyAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9wKQorICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9mYWNlX2lkID0g bG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1yZWdp b24tZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3df YWN0aXZlX3JlZ2lvbl9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX3JlZ2lv bl9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZl X2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2Ut Y3Vyc29yLWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9s bG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQp OworICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiks IGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9mYWNlLT5mb3JlZ3Jv dW5kKTsKKyAgICAgICAgICAgICAgICAgIFhTZXRCY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0aXZlIHdpbmRvdyBiZWNh dXNlIHRoZSBvdmVybGF5IHdpbmRvdyBwcm9wZXJ0eSBpcyB1c2VkLiAqLworICAgICAgICAgICAg ICAgICAgICBlbHNlIGlmICghYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lk ID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1p bmFjdGl2ZS1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZh Y2UgKmhvbGxvd19pbmFjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfaW5hY3Rp dmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJB TUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfaW5h Y3RpdmVfZmFjZS0+Zm9yZWdyb3VuZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBYU2V0QmFj a2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2dj LCBob2xsb3dfaW5hY3RpdmVfZmFjZS0+YmFja2dyb3VuZCk7CisgICAgICAgICAgICAgICAgICAg ICAgfQorICAgICAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgLyogRm9y Y2UgYG1jX3hfc2V0X2N1cnNvcl9nYycgdG8gdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS54LT5jdXJz b3JfZ2MnLiAgKi8KKyAgICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IHRydWU7CisgICAg ICAgICAgICAgIG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywgRFJBV19DVVJT T1IsIHgsIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBy ZWQsIGdyZWVuLCBibHVlLCBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3As IGN1cnNvcl9nY19wKTsKKyAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElT UExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgeGdjdi5mb3JlZ3JvdW5kKTsK KyAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91 dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgeGdjdi5iYWNrZ3JvdW5kKTsKKyAgICAgICAgICAgICAg dW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgLyogRHJhdyB0aGUgZnJhbWUgYXJvdW5k IHRoZSBib3guICovCisgICAgICAgICAgICAgIG1jX3hfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBt YXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICAgICAg ICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBIT0xMT1dfQk9YX0NVUlNPUjoKKyAg ICB7CisgICAgICBpZiAocmVkID49IDAgJiYgYmx1ZSA+PSAwICYmIGdyZWVuID49IDApCisgICAg ICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngt PmN1cnNvcl9waXhlbCcuICAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9w aXhlbCA9IGNvbG9yLnBpeGVsOworICAgICAgICAgIG1jX3hfZHJhd19ob2xsb3dfY3Vyc29yICh3 LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICAg ICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVs OworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICBtY194X2RyYXdfaG9sbG93X2N1 cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOwor ICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgRklMTEVEX0JPWF9DVVJTT1I6CisgICAgewor ICAgICAgaWYgKHJlZCA+PSAwICYmIGJsdWUgPj0gMCAmJiBncmVlbiA+PSAwKQorICAgICAgICAv KiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYycgYnkgYm9y cm93aW5nIHRoZQorICAgICAgICBmdW5jdGlvbmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHhmbnMu Yy4gICovCisgICAgICAgIHsKKyAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICBY U2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vy c29yX2djLCBGUkFNRV9CQUNLR1JPVU5EX1BJWEVMIChmKSk7CisgICAgICAgICAgWFNldEJhY2tn cm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywg Y29sb3IucGl4ZWwpOworICAgICAgICAgIC8qIEZvcmNlIGBtY194X3NldF9jdXJzb3JfZ2MnIHRv IHVzZSBgcy0+Zi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djJy4gICovCisgICAgICAgICAgYm9v bCBjdXJzb3JfZ2NfcCA9IHRydWU7CisgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcs IG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgcmVkLCBncmVlbiwgYmx1ZSwgZ2x5cGhfZmxhdm9yLCBjdXJzb3Jf dHlwZSwgd2QsIGFjdGl2ZV9wLCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgWFNldEZvcmVncm91 bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgeGdj di5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZ IChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCB4Z2N2LmJhY2tncm91bmQpOworICAg ICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAg ICAgIHsKKyAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX3AgPSBmYWxzZTsKKyAgICAgICAgICAg IG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywgRFJBV19DVVJTT1IsIHgsIGhw b3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVkLCBncmVlbiwg Ymx1ZSwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9wLCBjdXJzb3JfZ2Nf cCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgQkFSX0NVUlNP UjoKKyAgICB7CisgICAgICBpZiAocmVkID49IDAgJiYgYmx1ZSA+PSAwICYmIGdyZWVuID49IDAp CisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9k YXRhLngtPmN1cnNvcl9waXhlbCcuICAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1 cnNvcl9waXhlbCA9IGNvbG9yLnBpeGVsOworICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlz aWJsZV9va2F5X3AgPSB0cnVlOworICAgICAgICAgIG1jX3hfZHJhd19iYXJfY3Vyc29yICh3LCBt YXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwgY3Vyc29yX3dpZHRo LCBCQVJfQ1VSU09SLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgZi0+ b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAg ICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBib29sIGN1cnNv cl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7CisgICAgICAgICAgICBtY194X2RyYXdfYmFy X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgs IGN1cnNvcl93aWR0aCwgQkFSX0NVUlNPUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOwor ICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIEhCQVJfQ1VSU09SOgor ICAgIHsKKyAgICAgIGlmIChyZWQgPj0gMCAmJiBibHVlID49IDAgJiYgZ3JlZW4gPj0gMCkKKyAg ICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEu eC0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29y X3BpeGVsID0gY29sb3IucGl4ZWw7CisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxl X29rYXlfcCA9IHRydWU7CisgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJp eCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLCBjdXJzb3Jfd2lkdGgsIEhC QVJfQ1VSU09SLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgZi0+b3V0 cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAg ICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBib29sIGN1cnNvcl9n Y19pbnZpc2libGVfb2theV9wID0gZmFsc2U7CisgICAgICAgICAgICBtY194X2RyYXdfYmFyX2N1 cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsIGN1 cnNvcl93aWR0aCwgSEJBUl9DVVJTT1IsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAg ICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBOT19DVVJTT1I6CisgICAg ICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7CisgIH0KKyAgICAg ICAgfQorI2lmZGVmIEhBVkVfWF9JMThOCisgIGlmICh3ID09IFhXSU5ET1cgKGYtPnNlbGVjdGVk X3dpbmRvdykpCisgICAgaWYgKEZSQU1FX1hJQyAoZikgJiYgKEZSQU1FX1hJQ19TVFlMRSAoZikg JiBYSU1QcmVlZGl0UG9zaXRpb24pKQorICAgICAgeGljX3NldF9wcmVlZGl0YXJlYSAodywgeCwg eSk7CisjZW5kaWYKKyAgICB9CisgIFhGbHVzaCAoRlJBTUVfWF9ESVNQTEFZIChmKSk7Cit9CisK Ky8qIERyYXcgc3RyZXRjaCBnbHlwaCBzdHJpbmcgUy4gICovCitzdGF0aWMgdm9pZAorbWNfeF9k cmF3X3N0cmV0Y2hfZ2x5cGhfc3Ry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VzIFMtPm5leHQgdXNlIFhEcmF3U3RyaW5nIGluc3RlYWQgb2YgWERyYXdJbWFn ZVN0cmluZy4gICovCisgIGlmIChzLT5uZXh0ICYmIHMtPnJpZ2h0X292ZXJoYW5nICYmICFzLT5m b3Jfb3ZlcmxhcHMpCisgICAgeworICAgICAgaW50IHdpZHRoOworICAgICAgc3RydWN0IGdseXBo X3N0cmluZyAqbmV4dDsKKyAgICAgIGZvciAod2lkdGggPSAwLCBuZXh0ID0gcy0+bmV4dDsKKyAg ICAgICAgICAgbmV4dCAmJiB3aWR0aCA8IHMtPnJpZ2h0X292ZXJoYW5nOworICAgICAgICAgICB3 aWR0aCArPSBuZXh0LT53aWR0aCwgbmV4dCA9IG5leHQtPm5leHQpCisgICAgICAgIGlmIChuZXh0 LT5maXJzdF9nbHlwaC0+dHlwZSAhPSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICB7CisgICAgICAg ICAgICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKG5leHQsIGN1cnNvcl9nY19wKTsKKyAgICAg ICAgICAgIHhfc2V0X2dseXBoX3N0cmluZ19jbGlwcGluZyAobmV4dCk7CisgICAgICAgICAgICBp ZiAobmV4dC0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gU1RSRVRDSF9HTFlQSCkKKyAgICAgICAgICAg ICAgbWNfeF9kcmF3X3N0cmV0Y2hfZ2x5cGhfc3RyaW5nIChuZXh0KTsKKyAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19iYWNrZ3JvdW5kIChuZXh0LCB0 cnVlKTsKKyAgICAgICAgICAgIG5leHQtPm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgfQorICAg IH0KKyAgLyogU2V0IHVwIFMtPmdjLCBzZXQgY2xpcHBpbmcgYW5kIGRyYXcgUy4gICovCisgIG1j X3hfc2V0X2dseXBoX3N0cmluZ19nYyAocywgY3Vyc29yX2djX3ApOworICAvKiBEcmF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zdHJpbmdfYmFja2dy b3VuZCAocywgdHJ1ZSk7CisgICAgICB4X2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3Jl Z3JvdW5kIChzKTsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgR0xZUEhMRVNTX0dMWVBIOgorICAg ICAgaWYgKHMtPmZvcl9vdmVybGFwcykKKyAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7 CisgICAgICBlbHNlCisgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgdHJ1ZSk7 CisgICAgICB4X2RyYXdfZ2x5cGhsZXNzX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAg ICAgIGJyZWFrOworICAgIGRlZmF1bHQ6CisgICAgICBlbWFjc19hYm9ydCAoKTsKKyAgICB9Cisg IGlmICghcy0+Zm9yX292ZXJsYXBzKQorICAgIHsKKyAgICAgIC8qIERyYXcgdW5kZXJsaW5lLiAg Ki8KKyAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfcCkKKyAgICAgICAgeworICAgICAgICAg IGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX1dBVkUpCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3Ap CisgICAgICAgICAgICAgICAgeF9kcmF3X3VuZGVyd2F2ZSAocyk7CisgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBYR0NWYWx1ZXMgeGdjdjsK KyAgICAgICAgICAgICAgICAgIFhHZXRHQ1ZhbHVlcyAocy0+ZGlzcGxheSwgcy0+Z2MsIEdDRm9y ZWdyb3VuZCwgJnhnY3YpOworICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKHMtPmRp c3BsYXksIHMtPmdjLCBzLT5mYWNlLT51bmRlcmxpbmVfY29sb3IpOworICAgICAgICAgICAgICAg ICAgeF9kcmF3X3VuZGVyd2F2ZSAocyk7CisgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3Vu ZCAocy0+ZGlzcGxheSwgcy0+Z2MsIHhnY3YuZm9yZWdyb3VuZCk7CisgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90 eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgdW5z aWduZWQgbG9uZyB0aGlja25lc3MsIHBvc2l0aW9uOworICAgICAgICAgICAgICBpbnQgeTsKKyAg ICAgICAgICAgICAgaWYgKHMtPnByZXYgJiYgcy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3AKKyAg ICAgICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkK KyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBXZSB1c2UgdGhlIHNhbWUg dW5kZXJsaW5lIHN0eWxlIGFzIHRoZSBwcmV2aW91cyBvbmUuICAqLworICAgICAgICAgICAgICAg ICAgdGhpY2tuZXNzID0gcy0+cHJldi0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAgICAgICAg ICAgICAgIHBvc2l0aW9uID0gcy0+cHJldi0+dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJsaW5lIHRoaWNrbmVzcy4gIERlZmF1bHQgaXMgMSBw aXhlbC4gICovCisgICAgICAgICAgICAgICAgICBpZiAocy0+Zm9udCAmJiBzLT5mb250LT51bmRl cmxpbmVfdGhpY2tuZXNzID4gMCkKKyAgICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+ Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gMTsKKyAgICAgICAgICAgICAgICAgIGlmICh4X3Vu ZGVybGluZV9hdF9kZXNjZW50X2xpbmUpCisgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0g KHMtPmhlaWdodCAtIHRoaWNrbmVzcykgLSAocy0+eWJhc2UgLSBzLT55KTsKKyAgICAgICAgICAg ICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAg IC8qIEdldCB0aGUgdW5kZXJsaW5lIHBvc2l0aW9uLiAgVGhpcyBpcyB0aGUgcmVjb21tZW5kZWQK KyAgICAgICAgICAgICAgICAgICAgICAgICB2ZXJ0aWNhbCBvZmZzZXQgaW4gcGl4ZWxzIGZyb20g dGhlIGJhc2VsaW5lIHRvIHRoZSB0b3Agb2YKKyAgICAgICAgICAgICAgICAgICAgICAgICB0aGUg dW5kZXJsaW5lLiAgVGhpcyBpcyBhIHNpZ25lZCB2YWx1ZSBhY2NvcmRpbmcgdG8gdGhlCisgICAg ICAgICAgICAgICAgICAgICAgICAgc3BlY3MsIGFuZCBpdHMgZGVmYXVsdCBpcworICAgICAgICAg ICAgICAgICAgICAgICAgIFJPVU5EICgobWF4aW11bSBkZXNjZW50KSAvIDIpLCB3aXRoCisgICAg ICAgICAgICAgICAgICAgICAgICAgUk9VTkQoeCkgPSBmbG9vciAoeCArIDAuNSkgICovCisgICAg ICAgICAgICAgICAgICAgICAgaWYgKHhfdXNlX3VuZGVybGluZV9wb3NpdGlvbl9wcm9wZXJ0aWVz CisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHMtPmZvbnQgJiYgcy0+Zm9udC0+dW5kZXJs aW5lX3Bvc2l0aW9uID49IDApCisgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMt PmZvbnQtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlm IChzLT5mb250KQorICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+Zm9udC0+ ZGVzY2VudCArIDEpIC8gMjsKKyAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAg ICAgICAgICAgICAgICBwb3NpdGlvbiA9IHVuZGVybGluZV9taW5pbXVtX29mZnNldDsKKyAgICAg ICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBtYXggKHBvc2l0 aW9uLCB1bmRlcmxpbmVfbWluaW11bV9vZmZzZXQpOworICAgICAgICAgICAgICAgIH0KKyAgICAg ICAgICAgICAgLyogQ2hlY2sgdGhlIHNhbml0eSBvZiB0aGlja25lc3MgYW5kIHBvc2l0aW9uLiAg V2Ugc2hvdWxkCisgICAgICAgICAgICAgICAgIGF2b2lkIGRyYXdpbmcgdW5kZXJsaW5lIG91dCBv ZiB0aGUgY3VycmVudCBsaW5lIGFyZWEuICAqLworICAgICAgICAgICAgICBpZiAocy0+eSArIHMt PmhlaWdodCA8PSBzLT55YmFzZSArIHBvc2l0aW9uKQorICAgICAgICAgICAgICAgIHBvc2l0aW9u ID0gKHMtPmhlaWdodCAtIDEpIC0gKHMtPnliYXNlIC0gcy0+eSk7CisgICAgICAgICAgICAgIGlm IChzLT55ICsgcy0+aGVpZ2h0IDwgcy0+eWJhc2UgKyBwb3NpdGlvbiArIHRoaWNrbmVzcykKKyAg ICAgICAgICAgICAgICB0aGlja25lc3MgPSAocy0+eSArIHMtPmhlaWdodCkgLSAocy0+eWJhc2Ug KyBwb3NpdGlvbik7CisgICAgICAgICAgICAgIHMtPnVuZGVybGluZV90aGlja25lc3MgPSB0aGlj a25lc3M7CisgICAgICAgICAgICAgIHMtPnVuZGVybGluZV9wb3NpdGlvbiA9IHBvc2l0aW9uOwor ICAgICAgICAgICAgICB5ID0gcy0+eWJhc2UgKyBwb3NpdGlvbjsKKyAgICAgICAgICAgICAgaWYg KHMtPmZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICB4X2ZpbGxf cmVjdGFuZ2xlIChzLT5mLCBzLT5nYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg cy0+eCwgeSwgcy0+d2lkdGgsIHRoaWNrbmVzcyk7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBYR0NWYWx1ZXMgeGdjdjsKKyAgICAgICAg ICAgICAgICAgIFhHZXRHQ1ZhbHVlcyAocy0+ZGlzcGxheSwgcy0+Z2MsIEdDRm9yZWdyb3VuZCwg JnhnY3YpOworICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKHMtPmRpc3BsYXksIHMt PmdjLCBzLT5mYWNlLT51bmRlcmxpbmVfY29sb3IpOworICAgICAgICAgICAgICAgICAgeF9maWxs X3JlY3RhbmdsZSAocy0+Ziwgcy0+Z2MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgcy0+eCwgeSwgcy0+d2lkdGgsIHRoaWNrbmVzcyk7CisgICAgICAgICAgICAgICAgICBYU2V0 Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwgcy0+Z2MsIHhnY3YuZm9yZWdyb3VuZCk7CisgICAgICAg ICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAvKiBEcmF3IG92ZXJs aW5lLiAgKi8KKyAgICAgIGlmIChzLT5mYWNlLT5vdmVybGluZV9wKQorICB7CisgICAgdW5zaWdu ZWQgbG9uZyBkeSA9IDAsIGggPSAxOworICAgIGlmIChzLT5mYWNlLT5vdmVybGluZV9jb2xvcl9k ZWZhdWx0ZWRfcCkKKyAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCBz LT55IC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3VnaF9jb2xvcik7CisgICAgICAgIHhfZmlsbF9y ZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCBzLT55ICsgZHksCisgICAgICAgICAgICBzLT53 aWR0aCwgaCk7CisgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChzLT5kaXNwbGF5LCBzLT5nYywgeGdj di5mb3JlZ3JvdW5kKTsKKyAgICAgIH0KKyAgfQorICAgICAgLyogRHJhdyByZWxpZWYgaWYgbm90 IHlldCBkcmF3bi4gICovCisgICAgICBpZiAoIXJlbGllZl9kcmF3bl9wICYmIHMtPmZhY2UtPmJv eCAhPSBGQUNFX05PX0JPWCkKKyAgeF9kcmF3X2dseXBoX3N0cmluZ19ib3ggKHMpOworICAgICAg aWYgKHMtPnByZXYpCisgIHsKKyAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpwcmV2OworICAgIGZv ciAocHJldiA9IHMtPnByZXY7IHByZXY7IHByZXYgPSBwcmV2LT5wcmV2KQorICAgICAgaWYgKHBy ZXYtPmhsICE9IHMtPmhsCisgICAgJiYgcHJldi0+eCArIHByZXYtPndpZHRoICsgcHJldi0+cmln aHRfb3ZlcmhhbmcgPiBzLT54KQorICAgICAgICB7CisgICAgLyogQXMgcHJldiB3YXMgZHJhd24g d2hpbGUgY2xpcHBlZCB0byBpdHMgb3duIGFyZWEsIHdlCisgICAgICAgbXVzdCBkcmF3IHRoZSBy aWdodF9vdmVyaGFuZyBwYXJ0IHVzaW5nIHMtPmhsIG5vdy4gICovCisgICAgZW51bSBkcmF3X2ds eXBoc19mYWNlIHNhdmUgPSBwcmV2LT5obDsKKyAgICBwcmV2LT5obCA9IHMtPmhsOworICAgIG1j X3hfc2V0X2dseXBoX3N0cmluZ19nYyAocHJldiwgY3Vyc29yX2djX3ApOworICAgIHhfc2V0X2ds eXBoX3N0cmluZ19jbGlwcGluZ19leGFjdGx5IChzLCBwcmV2KTsKKyAgICBpZiAocHJldi0+Zmly c3RfZ2x5cGgtPnR5cG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gKG5leHQpOworICAg IGVsc2UKKyAgICAgIHhfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5l eHQpOworICAgIHhfcmVzZXRfY2xpcF9yZWN0YW5nbGVzIChuZXh0LT5mLCBuZXh0LT5nYyk7Cisg ICAgbmV4dC0+aGwgPSBzYXZlOworICAgIG5leHQtPm51bV9jbGlwcyA9IDA7CisgICAgbmV4dC0+ Y2xpcF9oZWFkID0gcy0+bmV4dDsKKyAgICAgICAgfQorICB9CisgICAgfQorICAvKiBSZXNldCBj bGlwcGluZy4gICovCisgIHhfcmVzZXRfY2xpcF9yZWN0YW5nbGVzIChzLT5mLCBzLT5nYyk7Cisg IHMtPm51bV9jbGlwcyA9IDA7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBEZWZhdWx0IHRvIHVzaW5nIFhJTSBpZiBhdmFp bGFibGUuICAqLwogI2lmZGVmIFVTRV9YSU0KIGJvb2wgdXNlX3hpbSA9IHRydWU7CkBAIC05OTks NiArMTg0OCwxNSBAQCB4X3VwZGF0ZV9iZWdpbiAoc3RydWN0IGZyYW1lICpmKQogICBpZiAoRlJB TUVfVE9PTFRJUF9QIChmKSAmJiAhRlJBTUVfVklTSUJMRV9QIChmKSkKICAgICByZXR1cm47CiAK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAg Zi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBmOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAgIGlmICghIEZSQU1FX0NSX1NVUkZBQ0UgKGYpKQogICAgIHsKICAgICAgIGludCB3aWR0aCwg aGVpZ2h0OwpAQCAtMTI2Niw2ICsyMTI0LDE2IEBAIHhfdXBkYXRlX2VuZCAoc3RydWN0IGZyYW1l ICpmKQogICBYRmx1c2ggKEZSQU1FX1hfRElTUExBWSAoZikpOwogICB1bmJsb2NrX2lucHV0ICgp OwogI2VuZGlmCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJT T1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBOVUxMOworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKworCiB9CiAKIC8qIFRoaXMgZnVuY3Rpb24gaXMgY2FsbGVkIGZyb20gdmFy aW91cyBwbGFjZXMgaW4geGRpc3AuYwpAQCAtOTUxMCw2ICsxMDM3OCwyNSBAQCB4X2RyYXdfd2lu ZG93X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqZ2x5cGhfcm93 LCBpbnQgeCwKIAl7CiAJICBzd2l0Y2ggKGN1cnNvcl90eXBlKQogCSAgICB7CisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICBjYXNlIFJJ R0hUX0ZSSU5HRV9CSVRNQVA6CisgICAgICBicmVhazsKKyAgICBjYXNlIExFRlRfRlJJTkdFX0JJ VE1BUDoKKyAgICAgIGJyZWFrOworICAgIGNhc2UgTk9fRlJJTkdFX0JJVE1BUDoKKyAgICAgIGJy ZWFrOworICAgIGNhc2UgRlJBTUVEX0JPWF9DVVJTT1I6CisgICAgICAvKiBUaGlzIGZlYXR1cmUg aGFzIGJlZW4gZGVsaWJlcmF0ZWx5IGRpc2FibGVkIGZvciB0aGUgdGltZSBiZWluZy4gKi8KKyAg ICAgIHhfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBnbHlwaF9yb3cpOworICAgICAgYnJlYWs7CisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgICAgY2FzZSBIT0xMT1dfQk9YX0NVUlNP UjoKIAkgICAgICB4X2RyYXdfaG9sbG93X2N1cnNvciAodywgZ2x5cGhfcm93KTsKIAkgICAgICBi cmVhazsKQEAgLTEzMTAwLDYgKzEzOTg3LDIxIEBAIHhfYWN0aXZhdGVfdGltZW91dF9hdGltZXIg KHZvaWQpCiAKIHN0YXRpYyBzdHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFjZSB4X3JlZGlzcGxheV9p bnRlcmZhY2UgPQogICB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKKy8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgeHRlcm0uY2AgbXVz dCBiZSBpbiB0aGUgZXhhY3Qgc2FtZSBvcmRlciBhcyB0aGUKK2ByZWRpc3BsYXlfaW50ZXJmYWNl JyBpbiBgZGlzcGV4dGVybi5oYCEgKi8KKworICBtY194X3dyaXRlX2dseXBocywKKyAgbWNfeF9k cmF3X3dpbmRvd19jdXJzb3IsCisgIG1jX3hfZHJhd19nbHlwaF9zdHJpbmcsCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgICB4X2ZyYW1lX3Bhcm1faGFuZGxlcnMsCiAgICAgeF9w cm9kdWNlX2dseXBocywKICAgICB4X3dyaXRlX2dseXBocywK --Multipart_Mon_Apr__8_21:03:20_2019-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs). References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sun, 21 Apr 2019 05:16:02 +0000 Resent-Message-ID: <handler.22873.B22873.1555823754654 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22873 <at> debbugs.gnu.org,17684 <at> debbugs.gnu.org Cc: athird@HIDDEN, mbork@HIDDEN, rms@HIDDEN, johnw@HIDDEN, akioburns@HIDDEN, eliz@HIDDEN, agrambot@HIDDEN Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.1555823754654 (code B ref 22873); Sun, 21 Apr 2019 05:16:02 +0000 Received: (at 22873) by debbugs.gnu.org; 21 Apr 2019 05:15:54 +0000 Received: from localhost ([127.0.0.1]:47277 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1hI4pW-0000AT-IJ for submit <at> debbugs.gnu.org; Sun, 21 Apr 2019 01:15:54 -0400 Received: from gateway31.websitewelcome.com ([192.185.143.4]:25236) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1hI4pU-0000AF-HY for 22873 <at> debbugs.gnu.org; Sun, 21 Apr 2019 01:15:53 -0400 Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway31.websitewelcome.com (Postfix) with ESMTP id 23D2010FD3 for <22873 <at> debbugs.gnu.org>; Sun, 21 Apr 2019 00:15:52 -0500 (CDT) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id I4pThbPTX2qH7I4pThwUQj; Sun, 21 Apr 2019 00:15:52 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=8eYG25lyK4SCqfEEkjMgeeUbf8LF8z0kD36RMsYO8G0=; b=RFSj5f1c7OCgVfF1u+pl6o+Fpg adgPPvSgS6/bf5rwgjYe/FJ94FeexGCTmO6c0L9NJOvUF/+4Jj/lDsTYcsXpzftQ34Q8gqzVOwnAX fWXNYllsNoozjPi9yREQDBKm1qmLFiYud8emqrHvefF0I7vuZ/qRydmvxkhpPRy9JRVmPOVhUWdOn ir7gYa5gbYSqVCUqBWBkWLDt8gd7v2wZRNii2cbFJwKOChxk39CNNXcQruLd+X2xvEU3cJPvP2Vib N1LMx6JUXzfmxKDloBaxA7tQBtSSjhDRHIBDqMcCpo7mlJans2GmuK7Cpliea8AAi+pUFHs3Ow/c9 j3zaUkag==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:55242 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from <esq@HIDDEN>) id 1hI4pQ-004D4p-7b; Sun, 21 Apr 2019 00:15:50 -0500 Date: Sat, 20 Apr 2019 22:15:47 -0700 Message-ID: <m2o9500who.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Sat_Apr_20_22:15:46_2019-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1hI4pQ-004D4p-7b X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:55242 X-Source-Auth: lawlist X-Email-Count: 9 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> --Multipart_Sat_Apr_20_22:15:46_2019-1 Content-Type: text/plain; charset=US-ASCII VERSION: 019.000 [04/20/2019] CHANGELOG: - Fake cursors no longer use Lisp_Object for cache management and to temporarily store RGB color data. Caches and RGB color data are now managed by structs. Special thanks to Alex Gramiak and Eli Zaretskii for their generous assistance on the Emacs Devel mailing list with those related issues: http://lists.gnu.org/archive/html/emacs-devel/2019-04/msg00421.html http://lists.gnu.org/archive/html/emacs-devel/2019-04/msg00762.html - A temporary cache of fake cursors is no longer needed to manage left/right overwritten characters. - As of the last patch (018.000), there has no longer been a need to force a frame update when drawing/erasing fake cursors. As such, the code for forcing a frame update has been removed in this new patch (019.000). - Eliminated a few window pointers previously used to store RGB color data and also the screen relative x coordinate of the fill column. Lisp_Object related widow pointers have also been removed in light of new cache management (above). - The BOX_CURSOR variant known as a framed box cursor is now only available when using the multiple fake cursor related features. SETUP: Step 1: git clone -b master git://git.sv.gnu.org/emacs.git Step 2: In the new emacs folder, go back to an Emacs version from 04/08/2019: git reset --hard a038df77de7b1aa2d73a6478493b8838b59e4982 Step 3: From within the new emacs folder created in Step 1, apply the patch: git apply /path/to/the/patch.diff Step 4: ./autogen.sh Step 5: ./configure ... [your custom options] Step 6: make Step 7: make install USAGE: - For a minimal working example of built-in fake cursors, type: M-x mc-test ;;; TURN ON FAKE CURSORS (buffer position, cursor-type, cursor color): (setq mc-conf '((1 "hbar" "magenta") (2 "bar" "purple") (3 "box" "#00FF00") (4 "hollow" "#0000FF") (5 ("hbar" 3) [1.0 0.0 1.0]) (6 ("bar" 3) [0.0 1.0 1.0]) (7 "framed" "OrangeRed")))) ;;; TURN OFF FAKE CURSORS: (setq mc-conf nil) - To try out the crosshairs feature, type: M-x +-mode - To try out built-in fake cursors with Magnar Sveen's multiple-cursors package, install that package first. [If the multiple-cursors package is installed, an eval-after-load "multiple-cursors-core" statement within `crosshairs.el` will redefine a couple of functions and set up a few keyboard shortcuts.] If the multiple-cursors package by Magnar Sveen is not already installed, then here are two easy ways to install that package: Type: M-x mc-install OR, evaluate the following snippet: (progn (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) (package-refresh-contents) (package-install 'multiple-cursors)) TODO: - Do further testing to make sure that garbage collection is now under control. Search for any remaining Lisp_Object that can be eliminated and handled purely in C. - *GNU Emacs* welcome screen: A portion of the hollow box cursor surrounding the Emacs logo image is not always being redrawn when moving the cursor over lines underneath the image. This is happening on at least 2 of the 3 relevant ports. - When using the multiple fake cursors feature, a fake cursor does not show up at zv_p. - Deal with left/right overwritten glyphs in the w32 and X ports of Emacs. - Reduce the removal of fake cursors to the bare minimum when scrolling the text on the glass directly, and whenever `update_window' is called. - When an idle-timer fires and point is at the end of a horizontally scrolled line in a narrow window, the temporary horizontal scroll is canceled. Create an minimal working example and file a bug report. - There is a bug affecting the recorded `w->mc.lnum_pixel_width` that is observable when not running under gdb, but disappears when running under gdb. While viewing a folded org-mode buffer, the non-gdb instance had a visible line number pixel-width of 44, but Emacs treated it as fluctuating between 44 and 55 as the cursor was moved to the end of line. In the gdb instance, the visible line number pixel width was 55 with no fluctuation under the same conditions as the non-gdb instance. This appears to be a different bug than bug#32177 (current line number shifts one column to the left) because the line number of the current line does not shift left, and changing the bidi settings did not correct the issue. - The current test for `auto_hscroll_mode_p' only looks for `current_line` and all five related tests are based upon that assumption, which may not be true. - Multiple Cursors: If point is in the middle of a composite character, then select a fully composed character so that the fake cursor is visible. - Implement functionality similar to the Lisp multiple-cursors by Magnar Sveen. - Follow up with the Emacs team re bug#32177; i.e., (Current line number shifts one column to the left.) - Follow up with the Emacs team re bug#32060; i.e., Horizontal Scrolling (Current Line): Wrong line gets h-scrolled. - Determine if bug #28936 needs to be fixed and help the Emacs team re same. --Multipart_Sat_Apr_20_22:15:46_2019-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="2019_04_20__22_08_31_450.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvY3Jvc3NoYWlycy5lbCBiL2xpc3AvY3Jvc3NoYWlycy5lbApuZXcg ZmlsZSBtb2RlIDEwMDc1NQppbmRleCAwMDAwMDAwLi4wMWVhMjM5Ci0tLSAvZGV2L251bGwKKysr IGIvbGlzcC9jcm9zc2hhaXJzLmVsCkBAIC0wLDAgKzEsMTI0NiBAQAorOzs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7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YmRhLCB3ZSBjYW4ndCBrbm93IGlmIGl0J3Mgc3VwcG9ydGVkIG9yIG5vdAorICAgICAgICAg ICAgICA7OyAtIHNvIGdvIGFoZWFkIGFuZCBhc3N1bWUgaXQncyBvaywgYmVjYXVzZSB3ZSdyZSBq dXN0IG9wdGltaXN0aWMgbGlrZSB0aGF0CisgICAgICAgICAgICAgIChpZiAob3IgKG5vdCAoc3lt Ym9scCBvcmlnaW5hbC1jb21tYW5kKSkKKyAgICAgICAgICAgICAgICAgICAgICA7OyBsYW1iZGEg cmVnaXN0ZXJlZCBieSBzbWFydHJlcAorICAgICAgICAgICAgICAgICAgICAgIChzdHJpbmctcHJl Zml4LXAgIigiIChzeW1ib2wtbmFtZSBvcmlnaW5hbC1jb21tYW5kKSkpCisgICAgICAgICAgICAg ICAgICAobWMvZXhlY3V0ZS1jb21tYW5kLWZvci1hbGwtZmFrZS1jdXJzb3JzIG9yaWdpbmFsLWNv bW1hbmQpCisgICAgICAgICAgICAgICAgOzsgc21hcnRyZXAgYGludGVybidzIGNvbW1hbmRzIGlu dG8gb3duIG9iYXJyYXkgdG8gaGVscAorICAgICAgICAgICAgICAgIDs7IGBkZXNjcmliZS1iaW5k aW5ncycuICBTbywgbGV0J3MgcmUtYGludGVybicgaGVyZSB0bworICAgICAgICAgICAgICAgIDs7 IG1ha2UgdGhlIGNvbW1hbmQgY29tcGFyYWJsZSBieSBgZXEnLgorICAgICAgICAgICAgICAgIChz ZXRxIG9yaWdpbmFsLWNvbW1hbmQgKGludGVybiAoc3ltYm9sLW5hbWUgb3JpZ2luYWwtY29tbWFu ZCkpKQorICAgICAgICAgICAgICAgIDs7IG90aGVyd2lzZSBpdCdzIGEgc3ltYm9sLCBhbmQgd2Ug Y2FuIGJlIG1vcmUgdGhvcm91Z2gKKyAgICAgICAgICAgICAgICAoaWYgKGdldCBvcmlnaW5hbC1j b21tYW5kICdtYy0tdW5zdXBwb3J0ZWQpCisgICAgICAgICAgICAgICAgICAgIChtZXNzYWdlICIl UyBpcyBub3Qgc3VwcG9ydGVkIHdpdGggbXVsdGlwbGUgY3Vyc29ycyVzIgorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBvcmlnaW5hbC1jb21tYW5kCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIChnZXQgb3JpZ2luYWwtY29tbWFuZCAnbWMtLXVuc3VwcG9ydGVkKSkKKyAgICAgICAg ICAgICAgICAgICh3aGVuIChhbmQgb3JpZ2luYWwtY29tbWFuZAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAobm90IChtZW1xIG9yaWdpbmFsLWNvbW1hbmQgbWMtLWRlZmF1bHQtY21kcy10 by1ydW4tb25jZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChub3QgKG1lbXEgb3Jp Z2luYWwtY29tbWFuZCBtYy9jbWRzLXRvLXJ1bi1vbmNlKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKG9yIG1jL2Fsd2F5cy1ydW4tZm9yLWFsbAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgKG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy0tZGVmYXVsdC1jbWRzLXRvLXJ1 bi1mb3ItYWxsKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG1lbXEgb3JpZ2lu YWwtY29tbWFuZCBtYy9jbWRzLXRvLXJ1bi1mb3ItYWxsKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgKG1jL3Byb21wdC1mb3ItaW5jbHVzaW9uLWluLXdoaXRlbGlzdCBvcmlnaW5h bC1jb21tYW5kKSkpCisgICAgICAgICAgICAgICAgICAgIChtYy9leGVjdXRlLWNvbW1hbmQtZm9y LWFsbC1mYWtlLWN1cnNvcnMgb3JpZ2luYWwtY29tbWFuZCkpKSkKKyAgICAgICAgICAgICAgKHdo ZW4gbWMvdXNlLWJ1aWx0LWluLWN1cnNvcnMKKyAgICAgICAgICAgICAgICAoc2V0cSBtYy1jb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AgICAgICAgICAgKDMgImJveCIgIiMwMEZGMDAi KQorICAgICAgICAgICAgICAgICAgICAgICg0ICJob2xsb3ciICIjMDAwMEZGIikKKyAgICAgICAg ICAgICAgICAgICAgICAoNSAoImhiYXIiIDMpIFsxLjAgMC4wIDEuMF0pCisgICAgICAgICAgICAg ICAgICAgICAgKDYgKCJiYXIiIDMpIFswLjAgMS4wIDEuMF0pCisgICAgICAgICAgICAgICAgICAg ICAgKDcgImZyYW1lZCIgIk9yYW5nZVJlZCIpKSkpCisgICAgKHNlbGVjdC13aW5kb3cgKGRpc3Bs YXktYnVmZmVyIGJ1ZmZlcikpKSkKKworKGRlZnVuICstdGltZXItZm4gKCkKKyJTaW5jZSB0aGlz IGZpcmVzIGdsb2JhbGx5LCB3ZSBtdXN0IGNvbnRyb2wgd2hpY2ggYnVmZmVycyBjcm9zc2hhaXJz IGFwcGVhciBpbi4iCisgICh3aGVuICstbW9kZQorICAgICh1bmxlc3MgKG9yIChtZW1xIGxhc3Qt Y29tbWFuZCArLXBhcmVucy1leGNsdXNpb25zKQorICAgICAgICAgICAgICAgIChudWxsICstcGFy ZW5zLXApKQorICAgICAgKCstcGFyZW5zLWZuKSkKKyAgICAod2hlbiArLXRpbWVyLXZhcgorICAg ICAgKHNldHEgdGltZXItaWRsZS1saXN0IChkZWxxICstdGltZXItdmFyIHRpbWVyLWlkbGUtbGlz dCkpCisgICAgICAoc2V0cSArLXRpbWVyLXZhciBuaWwpKSkpCisKKyhkZWZ1biArLWRyYXctZm9y dGh3aXRoICgpCisiSW1tZWRpYXRlbHkgZGVsZXRlL2RyYXcgbWF0Y2hpbmcgcGFyZW50aGVzZXMu IgorICAoKy1kcmF3LWNyb3NzaGFpcnMgJ2ZvcmNlKSkKKworKGRlZnVuICstZHJhdy1jcm9zc2hh aXJzICgmb3B0aW9uYWwgZm9yY2UpCisiSW1tZWRpYXRlbHkgZGVsZXRlIG1hdGNoaW5nIHBhcmVu dGhlc2VzLiAgSWYgRk9SQ0UgaXMgbm9uLW5pbCwgdGhlbiBpbW1lZGlhdGVseQorZHJhdyBtYXRj aGluZyBwYXJlbnRoZXNpczsgb3RoZXJ3aXNlLCBkcmF3IHRoZW0gb24gYW4gaWRsZS10aWVyLiIK KyAgKHdoZW4gKy1tb2RlCisgICAgKHdoZW4gKy10aW1lci12YXIKKyAgICAgIChzZXRxIHRpbWVy LWlkbGUtbGlzdCAoZGVscSArLXRpbWVyLXZhciB0aW1lci1pZGxlLWxpc3QpKQorICAgICAgKHNl dHEgKy10aW1lci12YXIgbmlsKSkKKyAgICAodW5sZXNzIChvciAobWVtcSB0aGlzLWNvbW1hbmQg Ky1wYXJlbnMtZXhjbHVzaW9ucykKKyAgICAgICAgICAgICAgICAoYW5kIChudWxsICstcGFyZW5z LXApCisgICAgICAgICAgICAgICAgICAgICAobnVsbCArLXBhcmVucy1vdmVybGF5cy1leGlzdC1w KSkpCisgICAgICAoKy1kZWxldGUtcGFyZW5zLW92ZXJsYXlzKSkKKyAgICAoaWYgZm9yY2UKKyAg ICAgIChwcm9nbgorICAgICAgICAod2hlbiArLXBhcmVucy1wCisgICAgICAgICAgKCstcGFyZW5z LWZuKSkpCisgICAgICAoc2V0cSArLXRpbWVyLXZhciAocnVuLXdpdGgtaWRsZS10aW1lciArLWlk bGUtdGltZXItc2Vjb25kcyBuaWwgIycrLXRpbWVyLWZuKSkpKSkKKworKGRlZnZhciBmYy1tb2Rl KQorCis7OzsjIyNhdXRvbG9hZAorKGRlZmluZS1taW5vci1tb2RlICstbW9kZQorIk1pbm9yIG1v ZGUgZm9yIGRpc3BsYXlpbmcgYSBob3Jpem9udGFsIHJ1bGVyLiIKKyAgOmluaXQtdmFsdWUgbmls CisgIDpsaWdodGVyICIgKyIKKyAgOmtleW1hcCBuaWwKKyAgOmdsb2JhbCBuaWwKKyAgOmdyb3Vw ICcrLW1vZGUKKyAgKGNvbmQKKyAgICAoKy1tb2RlCisgICAgICA7OzsgYCstbW9kZScgaGFzIHRo ZSBhYmlsaXR5IHRvIGFsc28gZGlzcGxheSBhIGZpbGwgY29sdW1uIGluZGljYXRvci4KKyAgICAg IDs7OyBTZWUgdGhlIHZhcmlhYmxlIGArLWZpbGwtY29sdW1uJy4KKyAgICAgICh3aGVuIGZjLW1v ZGUKKyAgICAgICAgKGZjLW1vZGUgLTEpKQorICAgICAgKHdoZW4gKGFuZCBnbG9iYWwtZWxkb2Mt bW9kZQorICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAg ICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAo Z2xvYmFsLWVsZG9jLW1vZGUgLTEpKQorICAgICAgKHdoZW4gKGFuZCBqaXQtbG9jay1jb250ZXh0 LXRpbWVyCisgICAgICAgICAgICAgICAgIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisg ICAgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAg ICh3aGVuICh0aW1lcnAgaml0LWxvY2stY29udGV4dC10aW1lcikKKyAgICAgICAgICAoY2FuY2Vs LXRpbWVyIGppdC1sb2NrLWNvbnRleHQtdGltZXIpKQorICAgICAgICA7OyAoc2V0cSBqaXQtbG9j ay1jb250ZXh0LXRpbWVyIChydW4td2l0aC1pZGxlLXRpbWVyIDUuMCAncmVwZWF0ICdqaXQtbG9j ay1jb250ZXh0LWZvbnRpZnkpKQorICAgICAgICAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVy IG5pbCkpCisgICAgICAod2hlbiAoYW5kIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisg ICAgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAg ICh3aGVuICh0aW1lcnAgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpCisgICAgICAg ICAgKGNhbmNlbC10aW1lciB1bmRvLWF1dG8tY3VycmVudC1ib3VuZGFyeS10aW1lcikpCisgICAg ICAgIChmc2V0ICd1bmRvLWF1dG8tLXVuZG9hYmxlLWNoYW5nZQorICAgICAgICAgICAgICAobGFt YmRhICgpIChhZGQtdG8tbGlzdCAndW5kby1hdXRvLS11bmRvYWJseS1jaGFuZ2VkLWJ1ZmZlcnMg KGN1cnJlbnQtYnVmZmVyKSkpKQorICAgICAgICAoZnNldCAndW5kby1hdXRvLWFtYWxnYW1hdGUg J2lnbm9yZSkpCisgICAgICAod2hlbiBibGluay1jdXJzb3ItbW9kZQorICAgICAgICAoYmxpbmst Y3Vyc29yLW1vZGUgLTEpCisgICAgICAgICh3aGVuIChtZW1xICdibGluay1jdXJzb3ItY2hlY2sg cG9zdC1jb21tYW5kLWhvb2spCisgICAgICAgICAgKHJlbW92ZS1ob29rICdwb3N0LWNvbW1hbmQt aG9vayAnYmxpbmstY3Vyc29yLWNoZWNrKSkpCisgICAgICAoc2V0cSBjcm9zc2hhaXJzIHQpCisg ICAgICAod2hlbiArLWZpbGwtY29sdW1uCisgICAgICAgIChzZXRxIGZjLXZpc2libGUgdCkpCisg ICAgICA7OzsgYGF1dG8tY29tcG9zaXRpb24tbW9kZScgaXMgbmVlZGVkIGZvciBjcm9zc2hhaXJz IHRvIHByb3Blcmx5IGNhbGN1bGF0ZQorICAgICAgOzs7IGNvb3JkaW5hdGVzIG9mIGNvbXBvc2l0 aW9uIGNoYXJhY3RlcnMuICBBdXRvbWF0aWNhbGx5IGJlY29tZXMgcGVybWFuZW50bHkKKyAgICAg IDs7OyBidWZmZXItbG9jYWwgd2hlbiBzZXQuCisgICAgICAodW5sZXNzIGF1dG8tY29tcG9zaXRp b24tbW9kZQorICAgICAgICAoc2V0cSBhdXRvLWNvbXBvc2l0aW9uLW1vZGUgdCkpCisgICAgICA7 OzsgQGxhd2xpc3QgaXMgZm9jdXNpbmcgdGhlIGluaXRpYWwgZGV2ZWxvcG1lbnQgb2YgZmVhdHVy ZSByZXF1ZXN0cyAjMTc2ODQKKyAgICAgIDs7OyBhbmQgIzIyODczIG9uIEwyUiBsYW5ndWFnZXMu ICBUaGUgZmVhdHVyZSB0ZXN0IGZpbGUgdXNlZCBieSBAbGF3bGlzdAorICAgICAgOzs7IGJvZ3Mg RW1hY3MgZG93biB1bmxlc3MgYGJpZGktZGlzcGxheS1yZW9yZGVyaW5nJyBpcyBzZXQgdG8gYSBu aWwgdmFsdWUuCisgICAgICA7OzsgSG93ZXZlciwgbW9zdCB1c2VycyB3aWxsIHByb2JhYmx5IG5v dCB3YW50IHRoaXMgcGFydGljdWxhciBzZXR0aW5nLgorICAgICAgKHVubGVzcyAobnVsbCBiaWRp LWRpc3BsYXktcmVvcmRlcmluZykKKyAgICAgICAgKHNldHEgYmlkaS1kaXNwbGF5LXJlb3JkZXJp bmcgbmlsKSkKKyAgICAgIChzZXQgKG1ha2UtbG9jYWwtdmFyaWFibGUgJystLXNhdmVkLXN0YXRl KSBuaWwpCisgICAgICAoZG9saXN0ICh2YXIgJyhidWZmZXItZGlzcGxheS10YWJsZQorICAgICAg ICAgICAgICAgICAgICAgZnJpbmdlLWluZGljYXRvci1hbGlzdAorICAgICAgICAgICAgICAgICAg ICAgdGFiLXdpZHRoCisgICAgICAgICAgICAgICAgICAgICBsaW5lLW1vdmUtdmlzdWFsCisgICAg ICAgICAgICAgICAgICAgICB0cnVuY2F0ZS1saW5lcworICAgICAgICAgICAgICAgICAgICAgdHJ1 bmNhdGUtcGFydGlhbC13aWR0aC13aW5kb3dzCisgICAgICAgICAgICAgICAgICAgICB3b3JkLXdy YXApKQorICAgICAgICAod2hlbiAobG9jYWwtdmFyaWFibGUtcCB2YXIpCisgICAgICAgICAgKHB1 c2ggKGNvbnMgdmFyIChzeW1ib2wtdmFsdWUgdmFyKSkgKy0tc2F2ZWQtc3RhdGUpKSkKKyAgICAg IChzZXRxIGZpbGwtY29sdW1uIDgwKQorICAgICAgKHNldHEgZGlzcGxheS1saW5lLW51bWJlcnMg dCkKKyAgICAgIChzZXRxLWxvY2FsIGF1dG8taHNjcm9sbC1tb2RlICdjdXJyZW50LWxpbmUpCisg ICAgICAoc2V0cS1sb2NhbCBoc2Nyb2xsLXN0ZXAgNSkKKyAgICAgIChzZXRxIGJ1ZmZlci1kaXNw bGF5LXRhYmxlICstYnVmZmVyLWRpc3BsYXktdGFibGUpCisgICAgICAoc2V0cSB0YWItd2lkdGgg NCkKKyAgICAgIChzZXQgKG1ha2UtbG9jYWwtdmFyaWFibGUgJ2xpbmUtbW92ZS12aXN1YWwpIHQp CisgICAgICAoc2V0cSB0cnVuY2F0ZS1saW5lcworICAgICAgICAoY29uZAorICAgICAgICAgICgo bGV0ICgobHN0ICstdHJ1bmNhdGUtbGluZXMtZGVyaXZlZC1tb2RlcykKKyAgICAgICAgICAgICAg ICAgIG1vZGUpCisgICAgICAgICAgICAoY2F0Y2ggJ2ZvdW5kCisgICAgICAgICAgICAgICh3aGls ZSAoc2V0cSBtb2RlIChwb3AgbHN0KSkKKyAgICAgICAgICAgICAgICAod2hlbiAoZGVyaXZlZC1t b2RlLXAgbW9kZSkKKyAgICAgICAgICAgICAgICAgICh0aHJvdyAnZm91bmQgdCkpKSkpKQorICAg ICAgICAgICAoKG1lbXEgbWFqb3ItbW9kZSArLXRydW5jYXRlLWxpbmVzLW1ham9yLW1vZGVzKSkK KyAgICAgICAgICAgKHQKKyAgICAgICAgICAgICBuaWwpKSkKKyAgICAgIChzZXQgKG1ha2UtbG9j YWwtdmFyaWFibGUgJ3RydW5jYXRlLXBhcnRpYWwtd2lkdGgtd2luZG93cykgbmlsKQorICAgICAg KHNldHEgd29yZC13cmFwIHQpCisgICAgICAoc2V0cSBpbmRpY2F0ZS1lbXB0eS1saW5lcyB0KQor ICAgICAgKHNldHEgaW5kaWNhdGUtYnVmZmVyLWJvdW5kYXJpZXMgJ2xlZnQpCisgICAgICAoc2V0 cSBmcmluZ2UtaW5kaWNhdG9yLWFsaXN0CisgICAgICAgICAgOzs7IGhzY2xfYWxsX3RlbXBfcCB8 IGhzY2xfdGVtcF9wCisgICAgICAgICcoKCstaHNjbC10ZW1wIC4gKCstc2luZ2xlLWFuZ2xlLWxl ZnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKy1kb3VibGUtYW5nbGUtbGVmdCkpCisgICAg ICAgICAgOzs7IGhzY2xfYWxsX3Blcm1fMF9wIHwgaHNjbF9hbGxfcGVybV8xX3AgfCBoc2NsX2Fs bF9wZXJtXzJfcCB8IGhzY2xfcGVybV9wCisgICAgICAgICAgKCstaHNjbC1wZXJtIC4gKCstc2lu Z2xlLWFuZ2xlLXVwCisgICAgICAgICAgICAgICAgICAgICAgICAgICstZG91YmxlLWFuZ2xlLXVw CisgICAgICAgICAgICAgICAgICAgICAgICAgICstdHJpcGxlLWFuZ2xlLXVwCisgICAgICAgICAg ICAgICAgICAgICAgICAgICstcXVhZHJ1cGxlLWFuZ2xlLXVwKSkKKyAgICAgICAgICAoKy1vdmVy bGF5LWFycm93IC4gKCstZnJpbmdlLWxlZnQtYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICstZnJpbmdlLXJpZ2h0LWFycm93KSkKKyAgICAgICAgICAodHJ1bmNhdGlvbiAuICgr LWZyaW5nZS1sZWZ0LWFycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgKy1mcmluZ2Utcmln aHQtYXJyb3cpKQorICAgICAgICAgIChjb250aW51YXRpb24gLiAoKy1mcmluZ2UtbGVmdC1jdXJs eS1hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgKy1iYWNrc2xhc2gpKQorICAgICAg ICAgIChvdmVybGF5LWFycm93IC4gKy1mcmluZ2UtcmlnaHQtdHJpYW5nbGUpCisgICAgICAgICAg KHVwIC4gKy1mcmluZ2UtdXAtYXJyb3cpCisgICAgICAgICAgKGRvd24gLiArLWZyaW5nZS1kb3du LWFycm93KQorICAgICAgICAgICh0b3AgLiArLWZyaW5nZS10b3AtbGVmdC1hbmdsZSkKKyAgICAg ICAgICAoYm90dG9tIC4gKy1mcmluZ2UtYm90dG9tLXJpZ2h0LWFuZ2xlKQorICAgICAgICAgICh0 b3AtYm90dG9tIC4gKCstZnJpbmdlLWxlZnQtYnJhY2tldAorICAgICAgICAgICAgICAgICAgICAg ICAgICstZnJpbmdlLXJpZ2h0LWJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICArLWZy aW5nZS10b3AtcmlnaHQtYW5nbGUKKyAgICAgICAgICAgICAgICAgICAgICAgICArLWZyaW5nZS10 b3AtbGVmdC1hbmdsZSkpCisgICAgICAgICAgKGVtcHR5LWxpbmUgLiArLWZyaW5nZS1lbXB0eS1s aW5lKQorICAgICAgICAgICh1bmtub3duIC4gKy1mcmluZ2UtcXVlc3Rpb24tbWFyaykpKQorICAg ICAgKHNldHEgZnJpbmdlLWN1cnNvci1hbGlzdCAnKChib3ggLiArLWZyaW5nZS1sZWZ0LXRyaWFu Z2xlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChob2xsb3cgLiArLWhvbGxv dy1yZWN0YW5nbGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGJhciAuICst dmVydGljYWwtYmFyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChoYmFyIC4g Ky1mcmluZ2UtaG9yaXpvbnRhbC1iYXIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgKGhvbGxvdy1zbWFsbCAuICstZnJpbmdlLWhvbGxvdy1zcXVhcmUpKSkKKyAgICAgIChpZiAo b3IgKy1mb3J0aHdpdGgKKyAgICAgICAgICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAn KDQpKSkKKyAgICAgICAgKGFkZC1ob29rICdwb3N0LWNvbW1hbmQtaG9vayAnKy1kcmF3LWZvcnRo d2l0aCAnYXBwZW5kICdsb2NhbCkKKyAgICAgICAgKGFkZC1ob29rICdwb3N0LWNvbW1hbmQtaG9v ayAnKy1kcmF3LWNyb3NzaGFpcnMgJ2FwcGVuZCAnbG9jYWwpKQorICAgICAgKHdoZW4gKy1mb3J0 aHdpdGgKKyAgICAgICAgKGFkZC1ob29rICd3aW5kb3ctY29uZmlndXJhdGlvbi1jaGFuZ2UtaG9v ayAnKy1kcmF3LWZvcnRod2l0aCBuaWwgJ2xvY2FsKSkKKyAgICAgIChhZGQtaG9vayAnY2hhbmdl LW1ham9yLW1vZGUtaG9vayAndHVybi1vZmYtKy1tb2RlIG5pbCAnbG9jYWwpCisgICAgICAod2hl biAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAoY29uZAorICAgICAgICAg ICgrLWZvcnRod2l0aAorICAgICAgICAgICAgKG1lc3NhZ2UgIlR1cm5lZCBPTiBgKy1tb2RlJyAt LSBEcmF3IG1hdGNoaW5nIHBhcmVudGhlc2VzIGltbWVkaWF0ZWx5LiIpKQorICAgICAgICAgICgo ZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpCisgICAgICAgICAgICA7OzsgTWF0Y2hpbmcg cGFyZW50aGVzZXMgd2lsbCBiZSBkcmF3biBpbW1lZGlhdGVseS4KKyAgICAgICAgICAgIChtZXNz YWdlICJUdXJuZWQgT04gYCstbW9kZScgLS0gT3B0aW1pemVkIGZvciBkZWJ1Z2dpbmcgcHVycG9z ZXMuIikpCisgICAgICAgICAgKHQKKyAgICAgICAgICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCst bW9kZScuIikpKSkpCisgICAgKHQKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdmaWxsLWNv bHVtbikKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdhdXRvLWhzY3JvbGwtbW9kZSkKKyAg ICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdoc2Nyb2xsLXN0ZXApCisgICAgICAoa2lsbC1sb2Nh bC12YXJpYWJsZSAnY3Jvc3NoYWlycykKKyAgICAgIChra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7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzsKKworKGRlZnVuICstcGFyZW5zLWZuICgp CisgICJEb2Mtc3RyaW5nLiIKKyAgKGxldCogKChvcG9pbnQgKHBvaW50KSkKKyAgICAgICAgIChm cm9tIChpZiArLXBhcmVucy1mcm9tLWZuCisgICAgICAgICAgICAgICAgIChmdW5jYWxsICstcGFy ZW5zLWZyb20tZm4pCisgICAgICAgICAgICAgICAgIChwb2ludC1taW4pKSkKKyAgICAgICAgICh3 aW4gKHNlbGVjdGVkLXdpbmRvdykpCisgICAgICAgICAoaSAwKQorICAgICAgICAgKHByZWNlZGlu Zy1jaGFyIChwcmVjZWRpbmctY2hhcikpCisgICAgICAgICAob2NoYXIgKGNoYXItYWZ0ZXIgb3Bv aW50KSkKKyAgICAgICAgIChwb3MxCisgICAgICAgICAgIChjb25kCisgICAgICAgICAgICAgKChh bmQgb2NoYXIKKyAgICAgICAgICAgICAgICAgICAob3IgOzs7IChjaGFyLXRvLXN0cmluZyA0MCkg PT4gb3BlbmluZyBwYXJlbnRoZXNpcworICAgICAgICAgICAgICAgICAgICAgICAoPSBvY2hhciA0 MCkKKyAgICAgICAgICAgICAgICAgICAgICAgOzs7IChjaGFyLXRvLXN0cmluZyA5MSkgPT4gb3Bl bmluZyBzcXVhcmUgYnJhY2tldAorICAgICAgICAgICAgICAgICAgICAgICAoPSBvY2hhciA5MSkK KyAgICAgICAgICAgICAgICAgICAgICAgOzs7IChjaGFyLXRvLXN0cmluZyAxMjMpID0+IG9wZW5p bmcgd2F2eSBicmFja2V0CisgICAgICAgICAgICAgICAgICAgICAgICg9IG9jaGFyIDEyMykpKQor ICAgICAgICAgICAgICAgIChtaW4gKDErIG9wb2ludCkgKHBvaW50LW1heCkpKQorICAgICAgICAg ICAgICgob3IgOzs7IChjaGFyLXRvLXN0cmluZyA0MSkgPT4gY2xvc2luZyBwYXJlbnRoZXNpcwor ICAgICAgICAgICAgICAgICAgKD0gcHJlY2VkaW5nLWNoYXIgNDEpCisgICAgICAgICAgICAgICAg ICA7OzsgKGNoYXItdG8tc3RyaW5nIDkzKSA9PiBjbG9zaW5nIHNxdWFyZSBicmFja2V0CisgICAg ICAgICAgICAgICAgICAoPSBwcmVjZWRpbmctY2hhciA5MykKKyAgICAgICAgICAgICAgICAgIDs7 OyAoY2hhci10by1zdHJpbmcgMTI1KSA9PiBjbG9zaW5nIHdhdnkgYnJhY2tldAorICAgICAgICAg ICAgICAgICAgKD0gcHJlY2VkaW5nLWNoYXIgMTI1KSkKKyAgICAgICAgICAgICAgICAobWF4IChw b2ludC1taW4pICgxLSBvcG9pbnQpKSkKKyAgICAgICAgICAgICAodAorICAgICAgICAgICAgICAg IG9wb2ludCkpKQorICAgICAgICAgcG9zMgorICAgICAgICAgc2VsZWN0ZWQtZmFjZSkKKyAgICAo c2F2ZS1leGN1cnNpb24KKyAgICAgIChjb25kaXRpb24tY2FzZSBuaWwKKyAgICAgICAgKHdoaWxl IChzZXRxIHBvczEgKG50aCAxIChwYXJzZS1wYXJ0aWFsLXNleHAgZnJvbSBwb3MxKSkpCisgICAg ICAgICAgKHNldHEgcG9zMiAoc2Nhbi1zZXhwcyBwb3MxIDEpKQorICAgICAgICAgIChpZiAoPSBp IDEwKQorICAgICAgICAgICAgKHNldHEgaSAxKQorICAgICAgICAgICAgKHNldHEgaSAoMSsgaSkp KQorICAgICAgICAgIChzZXRxIHNlbGVjdGVkLWZhY2UgKGNvbmQKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgKCg9IGkgMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAnKy1wYXJlbnMtb25lLWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgo PSBpIDIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLXR3by1m YWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSAzKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy10aHJlZS1mYWNlKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA0KQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICcrLXBhcmVucy1mb3VyLWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICgoPSBpIDUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFy ZW5zLWZpdmUtZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgNikK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtc2l4LWZhY2UpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDcpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJystcGFyZW5zLXNldmVuLWZhY2UpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICgoPSBpIDgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJystcGFyZW5zLWVpZ2h0LWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICgoPSBpIDkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLW5p bmUtZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgMTApCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLXRlbi1mYWNlKSkpCisgICAg ICAgICAgKGxldCAoKG92IChtYWtlLW92ZXJsYXkgcG9zMSAoMSsgcG9zMSkpKSkKKyAgICAgICAg ICAgICh1bmxlc3MgKy1wYXJlbnMtaW5hY3RpdmUtd2luZG93cworICAgICAgICAgICAgICAob3Zl cmxheS1wdXQgb3YgJ3dpbmRvdyB3aW4pKQorICAgICAgICAgICAgKG92ZXJsYXktcHV0IG92ICdm YWNlIHNlbGVjdGVkLWZhY2UpKQorICAgICAgICAgICh3aGVuIHBvczIKKyAgICAgICAgICAgIChs ZXQgKChvdiAobWFrZS1vdmVybGF5ICgxLSBwb3MyKSBwb3MyKSkpCisgICAgICAgICAgICAgICh1 bmxlc3MgKy1wYXJlbnMtaW5hY3RpdmUtd2luZG93cworICAgICAgICAgICAgICAgIChvdmVybGF5 LXB1dCBvdiAnd2luZG93IHdpbikpCisgICAgICAgICAgICAgIChvdmVybGF5LXB1dCBvdiAnZmFj ZSBzZWxlY3RlZC1mYWNlKSkpKQorICAgICAgICAoZXJyb3IgbmlsKSkpCisgICAgKHNldHEgKy1w YXJlbnMtb3ZlcmxheXMtZXhpc3QtcCB0KSkpCisKKyhkZWZ1biArLXJlbW92ZS1vdmVybGF5cyAo YmVnIGVuZCBuYW1lIHZhbCkKKyJSZW1vdmUgdGhlIG92ZXJsYXlzIHRoYXQgYXJlIGBlcXVhbC1p bmNsdWRpbmctcHJvcGVydGllc2AuCitJbmNsdWRlcyBhIHVuaXF1ZSBzaXR1YXRpb24gd2hlbiBh biBvdmVybGF5IHdpdGggYW4gYCdhZnRlci1zdHJpbmdgIHByb3BlcnR5CitpcyBhdCB0aGUgdmVy eSBlbmQgb2YgYSBuYXJyb3dlZC1idWZmZXIuIgorICAobGV0KiAoKHBvaW50LW1heCAocG9pbnQt bWF4KSkKKyAgICAgICAgIChwb2ludC1taW4gKHBvaW50LW1pbikpCisgICAgICAgICAobmFycm93 ZWQtcCAoYnVmZmVyLW5hcnJvd2VkLXApKQorICAgICAgICAgKGJlZyAoaWYgYmVnIGJlZyBwb2lu dC1taW4pKQorICAgICAgICAgKGVuZAorICAgICAgICAgICAoY29uZAorICAgICAgICAgICAgICgo YW5kCisgICAgICAgICAgICAgICAgIChub3QgbmFycm93ZWQtcCkKKyAgICAgICAgICAgICAgICAg ZW5kKQorICAgICAgICAgICAgICAgZW5kKQorICAgICAgICAgICAgICgoYW5kCisgICAgICAgICAg ICAgICAgIChub3QgbmFycm93ZWQtcCkKKyAgICAgICAgICAgICAgICAgKG51bGwgZW5kKSkKKyAg ICAgICAgICAgICAgIHBvaW50LW1heCkKKyAgICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAg ICAgICBuYXJyb3dlZC1wCisgICAgICAgICAgICAgICAgIGVuZAorICAgICAgICAgICAgICAgICAo PCBlbmQgcG9pbnQtbWF4KSkKKyAgICAgICAgICAgICAgIGVuZCkKKyAgICAgICAgICAgICAoKGFu ZAorICAgICAgICAgICAgICAgICBuYXJyb3dlZC1wCisgICAgICAgICAgICAgICAgIGVuZAorICAg ICAgICAgICAgICAgICAoPSBlbmQgcG9pbnQtbWF4KSkKKyAgICAgICAgICAgICAgICgxKyBlbmQp KQorICAgICAgICAgICAgICgoYW5kCisgICAgICAgICAgICAgICAgIG5hcnJvd2VkLXAKKyAgICAg ICAgICAgICAgICAgKG51bGwgZW5kKSkKKyAgICAgICAgICAgICAgICgxKyBwb2ludC1tYXgpKSAp KQorICAgICAgICAgKG92ZXJsYXlzCisgICAgICAgICAgIChwcm9nbgorICAgICAgICAgICAgIChv dmVybGF5LXJlY2VudGVyIGVuZCkKKyAgICAgICAgICAgICAob3ZlcmxheXMtaW4gYmVnIGVuZCkp KSkKKyAgICAod2hlbiAoYW5kIGJlZyBlbmQgbmFtZSB2YWwpCisgICAgICAoZG9saXN0IChvIG92 ZXJsYXlzKQorICAgICAgICAoY29uZAorICAgICAgICAgICgoYW5kIChlcSBuYW1lICdmYWNlKQor ICAgICAgICAgICAgICAgIChlcSAob3ZlcmxheS1nZXQgbyBuYW1lKSB2YWwpKQorICAgICAgICAg ICAgOzsgRWl0aGVyIHB1c2ggdGhpcyBvdmVybGF5IG91dHNpZGUgYmVnLi4uZW5kCisgICAgICAg ICAgICA7OyBvciBzcGxpdCBpdCB0byBleGNsdWRlIGJlZy4uLmVuZAorICAgICAgICAgICAgOzsg b3IgZGVsZXRlIGl0IGVudGlyZWx5IChpZiBpdCBpcyBjb250YWluZWQgaW4gYmVnLi4uZW5kKS4K KyAgICAgICAgICAgIChpZiAoPCAob3ZlcmxheS1zdGFydCBvKSBiZWcpCisgICAgICAgICAgICAg ICAgKGlmICg+IChvdmVybGF5LWVuZCBvKSBlbmQpCisgICAgICAgICAgICAgIChwcm9nbgorICAg ICAgICAgICAgICAgIChtb3ZlLW92ZXJsYXkgKGNvcHktb3ZlcmxheSBvKQorICAgICAgICAgICAg ICAgICAgKG92ZXJsYXktc3RhcnQgbykgYmVnKQorICAgICAgICAgICAgICAgIChtb3ZlLW92ZXJs YXkgbyBlbmQgKG92ZXJsYXktZW5kIG8pKSkKKyAgICAgICAgICAgICAgICAgIChtb3ZlLW92ZXJs YXkgbyAob3ZlcmxheS1zdGFydCBvKSBiZWcpKQorICAgICAgICAgICAgICAoaWYgKD4gKG92ZXJs YXktZW5kIG8pIGVuZCkKKyAgICAgICAgICAgICAgICAgIChtb3ZlLW92ZXJsYXkgbyBlbmQgKG92 ZXJsYXktZW5kIG8pKQorICAgICAgICAgICAgICAgIChkZWxldGUtb3ZlcmxheSBvKSkpKQorICAg ICAgICAgICgoYW5kIChub3QgKGVxIG5hbWUgJ2ZhY2UpKQorICAgICAgICAgICAgICAgIChlcXVh bC1pbmNsdWRpbmctcHJvcGVydGllcyAob3ZlcmxheS1nZXQgbyBuYW1lKSB2YWwpKQorICAgICAg ICAgICAgKGRlbGV0ZS1vdmVybGF5IG8pKSkpKSkpCisKKyhkZWZ1biArLWRlbGV0ZS1wYXJlbnMt b3ZlcmxheXMgKCkKKyAgKHdoZW4gKy1wYXJlbnMtb3ZlcmxheXMtZXhpc3QtcAorICAgIChkb2xp c3QgKGZhY2UgJygrLXBhcmVucy1vbmUtZmFjZQorICAgICAgICAgICAgICAgICAgICArLXBhcmVu cy10d28tZmFjZQorICAgICAgICAgICAgICAgICAgICArLXBhcmVucy10aHJlZS1mYWNlCisgICAg ICAgICAgICAgICAgICAgIC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bCBuaWwKKyAgOmdyb3VwICdmYy1tb2RlCisgIChjb25kCisgICAgOzs7 IGArLW1vZGUnIGhhcyB0aGUgYWJpbGl0eSB0byBhbHNvIGRpc3BsYXkgYSBmaWxsIGNvbHVtbiBp bmRpY2F0b3IuCisgICAgOzs7IFNlZSB0aGUgdmFyaWFibGUgYCstZmlsbC1jb2x1bW4nLgorICAg ICgoYW5kIGZjLW1vZGUgKy1tb2RlKQorICAgICAgKHNldHEgZmMtbW9kZSBuaWwpCisgICAgICAo bWVzc2FnZSAiVHVybmVkIE9GRiBgZmMtbW9kZScgKCVzKSAtLSBzZWUgdGhlIHZhcmlhYmxlIGAr LWZpbGwtY29sdW1uJy4iIChjdXJyZW50LWJ1ZmZlcikpKQorICAgIChmYy1tb2RlCisgICAgICAo d2hlbiAoYW5kIGdsb2JhbC1lbGRvYy1tb2RlCisgICAgICAgICAgICAgICAgIChjYWxsZWQtaW50 ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZp eC1hcmcgJyg0KSkpCisgICAgICAgIChnbG9iYWwtZWxkb2MtbW9kZSAtMSkpCisgICAgICAod2hl biAoYW5kIGppdC1sb2NrLWNvbnRleHQtdGltZXIKKyAgICAgICAgICAgICAgICAgKGNhbGxlZC1p bnRlcmFjdGl2ZWx5LXAgJ2FueSkKKyAgICAgICAgICAgICAgICAgKGVxdWFsIGN1cnJlbnQtcHJl Zml4LWFyZyAnKDQpKSkKKyAgICAgICAgKHdoZW4gKHRpbWVycCBqaXQtbG9jay1jb250ZXh0LXRp bWVyKQorICAgICAgICAgIChjYW5jZWwtdGltZXIgaml0LWxvY2stY29udGV4dC10aW1lcikpCisg ICAgICAgIDs7IChzZXRxIGppdC1sb2NrLWNvbnRleHQtdGltZXIgKHJ1bi13aXRoLWlkbGUtdGlt ZXIgNS4wICdyZXBlYXQgJ2ppdC1sb2NrLWNvbnRleHQtZm9udGlmeSkpCisgICAgICAgIChzZXRx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dGVycyBh cmUgaW5saW5lIGZ1bmN0aW9ucyBkZWZpbmVkIGluIGJ1ZmZlci5oLiAgKi8KKworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExFLUNVUlNPUlMgKi8KKworc3RhdGlj IHZvaWQKK2JzZXRfbWNfcmVhbF9mYWtlX2N1cnNvciAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9P YmplY3QgdmFsKQoreworICBiLT5tY19yZWFsX2Zha2VfY3Vyc29yXyA9IHZhbDsKK30KKworc3Rh dGljIHZvaWQKK2JzZXRfbWNfY29uZiAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFs KQoreworICBiLT5tY19jb25mXyA9IHZhbDsKK30KKworc3RhdGljIHZvaWQKK2JzZXRfbWNfaW5h Y3RpdmVfd2luZG93cyAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFsKQoreworICBi LT5tY19pbmFjdGl2ZV93aW5kb3dzXyA9IHZhbDsKK30KKworc3RhdGljIHZvaWQKK2JzZXRfY3Jv c3NoYWlycyAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFsKQoreworICBiLT5jcm9z c2hhaXJzXyA9IHZhbDsKK30KKworc3RhdGljIHZvaWQKK2JzZXRfY2hfaG9yaXpvbnRhbF9ydWxl ciAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFsKQoreworICBiLT5jaF9ob3Jpem9u dGFsX3J1bGVyXyA9IHZhbDsKK30KKworc3RhdGljIHZvaWQKK2JzZXRfY2hfdmVydGljYWxfcnVs ZXIgKHN0cnVjdCBidWZmZXIgKmIsIExpc3BfT2JqZWN0IHZhbCkKK3sKKyAgYi0+Y2hfdmVydGlj YWxfcnVsZXJfID0gdmFsOworfQorCitzdGF0aWMgdm9pZAorYnNldF9jaF9pbmFjdGl2ZV93aW5k b3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7CisgIGItPmNoX2luYWN0 aXZlX3dpbmRvd3NfID0gdmFsOworfQorCitzdGF0aWMgdm9pZAorYnNldF9mY192aXNpYmxlIChz dHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7CisgIGItPmZjX3Zpc2libGVfID0g dmFsOworfQorCitzdGF0aWMgdm9pZAorYnNldF9mY19pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3Qg YnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7CisgIGItPmZjX2luYWN0aXZlX3dpbmRvd3Nf ID0gdmFsOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogc3RhdGljIHZvaWQKIGJzZXRfYWJicmV2X21vZGUgKHN0cnVjdCBidWZm ZXIgKmIsIExpc3BfT2JqZWN0IHZhbCkKIHsKQEAgLTUxNDIsNiArNTIwNSwyNCBAQCBpbml0X2J1 ZmZlcl9vbmNlICh2b2lkKQogICBic2V0X2xhc3Rfc2VsZWN0ZWRfd2luZG93ICgmYnVmZmVyX2xv Y2FsX2ZsYWdzLCBtYWtlX2ZpeG51bSAoMCkpOwogCiAgIGlkeCA9IDE7CisKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgWFNFVEZBU1RJTlQg KEJWQVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIG1jX3JlYWxfZmFrZV9jdXJzb3IpLCBpZHgpOyAr K2lkeDsKKyAgWFNFVEZBU1RJTlQgKEJWQVIgKCZid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ioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgYnNldF9t b2RlX2xpbmVfZm9ybWF0ICgmYnVmZmVyX2RlZmF1bHRzLCBidWlsZF9wdXJlX2Nfc3RyaW5nICgi JS0iKSk7CiAgIGJzZXRfaGVhZGVyX2xpbmVfZm9ybWF0ICgmYnVmZmVyX2RlZmF1bHRzLCBRbmls KTsKICAgYnNldF9hYmJyZXZfbW9kZSAoJmJ1ZmZlcl9kZWZhdWx0cywgUW5pbCk7CkBAIC01NDY0 LDYgKzU1NjMsMjMgQEAgc3ltc19vZl9idWZmZXIgKHZvaWQpCiAgIHN0YXRpY3BybyAoJlFTRnVu ZGFtZW50YWwpOwogICBzdGF0aWNwcm8gKCZWYnVmZmVyX2FsaXN0KTsKIAorCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBERUZTWU0gKFFtY19y ZWFsX2Zha2VfY3Vyc29yLCAibWMtcmVhbC1mYWtlLWN1cnNvciIpOworICBERUZTWU0gKFFtY19j b25mLCAibWMtY29uZiIpOworICBERUZTWU0gKFFtY19pbmFjdGl2ZV93aW5kb3dzLCAibWMtaW5h Y3RpdmUtd2luZG93cyIpOworICBERUZTWU0gKFFjcm9zc2hhaXJzLCAiY3Jvc3NoYWlycyIpOwor ICBERUZTWU0gKFFjaF9ob3Jpem9udGFsX3J1bGVyLCAiY2gtaG9yaXpvbnRhbC1ydWxlciIpOwor ICBERUZTWU0gKFFjaF92ZXJ0aWNhbF9ydWxlciwgImNoLXZlcnRpY2FsLXJ1bGVyIik7CisgIERF RlNZTSAoUWNoX2luYWN0aXZlX3dpbmRvd3MsICJjaC1pbmFjdGl2ZS13aW5kb3dzIik7CisgIERF RlNZTSAoUWZjX3Zpc2libGUsICJmYy12aXNpYmxlIik7CisgIERFRlNZTSAoUWZjX3Zpc2libGVf aW5hY3RpdmVfd2luZG93LCAiZmMtaW5hY3RpdmUtd2luZG93Iik7CisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKICAgREVGU1lNIChRY2hvaWNlLCAiY2hvaWNlIik7CiAgIERFRlNZTSAo UWxlZnQsICJsZWZ0Iik7CiAgIERFRlNZTSAoUXJpZ2h0LCAicmlnaHQiKTsKQEAgLTU1MDEsNiAr NTYxNyw0MSBAQCBzeW1zX29mX2J1ZmZlciAodm9pZCkKICAgRnB1dCAoUXByb3RlY3RlZF9maWVs ZCwgUWVycm9yX21lc3NhZ2UsCiAJYnVpbGRfcHVyZV9jX3N0cmluZyAoIkF0dGVtcHQgdG8gbW9k aWZ5IGEgcHJvdGVjdGVkIGZpZWxkIikpOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIERFRlZBUl9QRVJfQlVGRkVSICgibWMtcmVhbC1m YWtlLWN1cnNvciIsICZCVkFSIChjdXJyZW50X2J1ZmZlciwgbWNfcmVhbF9mYWtlX2N1cnNvciks IFFuaWwsCisgICAgZG9jOiAvKiBBIGJ1ZmVyLWxvY2FsIHZhcmlhYmxlIHRvIHNldCB0aGUgY3Vy c29yIHR5cGUgb2YgdGhlIHJlYWwgZmFrZSBjdXJzb3IuICovKTsKKworICBERUZWQVJfUEVSX0JV RkZFUiAoIm1jLWNvbmYiLCAmQlZBUiAoY3VycmVudF9idWZmZXIsIG1jX2NvbmYpLCBRbmlsLAor ICAgIGRvYzogLyogQSBidWZlci1sb2NhbCB2YXJpYWJsZSB0byBzdG9yZSB0aGUgdmFsdWUgb2Yg dGhlIG11bHRpcGxlIGN1cnNvcnMgdG8gYmUgZGlzcGxheWVkCitkdXJpbmcgdG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XJjaC5jLCBpbmRlbnQuYyBhbmQgYmlkaS5jIGZv ciBkZXRhaWxzLiAgKi8KICAgTGlzcF9PYmplY3QgY2FjaGVfbG9uZ19zY2Fuc187CiAKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogVGhl IGN1cnNvciB0eXBlIG9mIHRoZSByZWFsIGZha2UgY3Vyc29yLiAqLworICBMaXNwX09iamVjdCBt Y19yZWFsX2Zha2VfY3Vyc29yXzsKKworICAvKiBUaGUgbmFtZSBvZiBsaXN0IHVzZWQgYnkgbXVs dGlwbGUgY3Vyc29ycyBmb3IgbmV4dCByZWRpc3BsYXkuICovCisgIExpc3BfT2JqZWN0IG1jX2Nv bmZfOworCisgIC8qIFdoZXRoZXIgdG8gZHJhdyBtdWx0aXBsZSBjdXJzb3JzIGluIGluYWN0aXZl IHdpbmRvd3MuICovCisgIExpc3BfT2JqZWN0IG1jX2luYWN0aXZlX3dpbmRvd3NfOworCisgIC8q IFRoZSBuYW1lIG9mIHRoZSBidWZmZXItbG9jYWwgdmFyaWFibGUuICovCisgIExpc3BfT2JqZWN0 IGNyb3NzaGFpcnNfOworCisgIC8qIFRoZSBuYW1lIG9mIHRoZSBjcm9zc2hhaXJzIGhvcml6b250 YWwgcnVsZXIuICovCisgIExpc3BfT2JqZWN0IGNoX2hvcml6b250YWxfcnVsZXJfOworCisgIC8q IFRoZSBuYW1lIG9mIHRoZSBjcm9zc2hhaXJzIHZlcnRpY2FsIHJ1bGVyLiAqLworICBMaXNwX09i amVjdCBjaF92ZXJ0aWNhbF9ydWxlcl87CisKKyAgLyogV2hldGhlciB0byBkcmF3IGNyb3NzaGFp cnMgaW4gaW5hY3RpdmUgd2luZG93cy4gKi8KKyAgTGlzcF9PYmplY3QgY2hfaW5hY3RpdmVfd2lu ZG93c187CisKKyAgLyogVGhl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l2ZV93aW5kb3dzIChz dHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7CisgIGItPmNoX2luYWN0aXZlX3dp bmRvd3NfID0gdmFsOworfQorCitJTkxJTkUgdm9pZAorYnNldF9ibHZfZmNfdmlzaWJsZSAoc3Ry dWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFsKQoreworICBiLT5mY192aXNpYmxlXyA9IHZh bDsKK30KKworSU5MSU5FIHZvaWQKK2JzZXRfYmx2X2ZjX2luYWN0aXZlX3dpbmRvd3MgKHN0cnVj dCBidWZmZXIgKmIsIExpc3BfT2JqZWN0IHZhbCkKK3sKKyAgYi0+ZmNfaW5hY3RpdmVfd2luZG93 c18gPSB2YWw7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKworCiBJTkxJTkUgdm9pZAogYnNldF9iaWRpX3BhcmFncmFwaF9kaXJlY3Rp b24gKHN0cnVjdCBidWZmZXIgKmIsIExpc3BfT2JqZWN0IHZhbCkKIHsKZGlmZiAtLWdpdCBhL3Ny Yy9kaXNwZXh0ZXJuLmggYi9zcmMvZGlzcGV4dGVybi5oCmluZGV4IDFhNTM2NTYuLjUxNjFmOGEg MTAwNjQ0Ci0tLSBhL3NyYy9kaXNwZXh0ZXJuLmgKKysrIGIvc3JjL2Rpc3BleHRlcm4uaApAQCAt MTAwLDYgKzEwMCwyOSBAQCB0eXBlZGVmIGludCBDdXJzb3I7CiAjZGVmaW5lIE5hdGl2ZVJlY3Rh bmdsZSBpbnQKICNlbmRpZgogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4g TVVMVElQTEUtQ1VSU09SUyAqLworCisvKiBGb3J3YXJkIHByb3RvdHlwZSBkZWZpbml0aW9ucy4g Ki8KK2VudW0gdHlwZV9vZl9jYWNoZTsKKworZW51bSB0eXBlX29mX2N1cnNvcjsKKworZW51bSBt Y19mbGF2b3I7CisKK2VudW0gdHlwZV9vZl9hY3Rpb24KK3sKKyAgTVVMVElQTEVfQ1VSU09SUywK KyAgSE9SSVpPTlRBTF9SVUxFUiwKKyAgVkVSVElDQUxfUlVMRVIsCisgIEZJTExfQ09MVU1OCit9 OworCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogLyogVGV4dCBjdXJzb3IgdHlwZXMuICAqLwogCiBlbnVtIHRleHRfY3Vyc29yX2tpbmRz CkBAIC0zODIsNiArNDA1LDIwIEBAIHN0cnVjdCBnbHlwaF9zbGljZQogCiBzdHJ1Y3QgZ2x5cGgK IHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8K KworICBpbnQgeCwgeSwgaHBvcywgdnBvczsKKworICBpbnQgcmVsYXRpdmVfeDsKKworICBib29s X2JmIHp2X3AgOiAxOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIFBvc2l0 aW9uIGZyb20gd2hpY2ggdGhpcyBnbHlwaCB3YXMgZHJhd24uICBJZiBgb2JqZWN0JyBiZWxvdyBp cyBhCiAgICAgIExpc3Agc3RyaW5nLCB0aGlzIGlzIGFuIGluZGV4IGludG8gdGhhdCBzdHJpbmcu ICBJZiBpdCBpcyBhCiAgICAgIGJ1ZmZlciwgdGhpcyBpcyBhIHBvc2l0aW9uIGluIHRoYXQgYnVm ZmVyLiAgSW4gYWRkaXRpb24sIHNvbWUKQEAgLTEyNDgsNiArMTI4NSwyOCBAQCBlbnVtIGRyYXdf Z2x5cGhzX2ZhY2UKIAogc3RydWN0IGdseXBoX3N0cmluZwogeworCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgYm9vbF9iZiBsZWZ0X292 ZXJ3cml0dGVuX3AgOiAxOworCisgICAgYm9vbF9iZiByaWdodF9vdmVyd3JpdHRlbl9wIDogMTsK KworICAgIGJvb2xfYmYgcmVjdGFuZ2xlX251a2VkX3AgOiAxOworCisgICAgYm9vbF9iZiBiYWNr Z3JvdW5kX251a2VkX3AgOiAxOworCisgICAgZW51bSBkcmF3X2dseXBoX2FjdGlvbgorICAgIHsK KyAgICAgIE1DX0RSQVdfR0xZUEgsCisgICAgICBNQ19FUkFTRV9HTFlQSAorICAgIH0gYWN0aW9u X3R5cGU7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogWC1vcmlnaW4gb2Yg dGhlIHN0cmluZy4gICovCiAgIGludCB4OwogCkBAIC0yMjE2LDYgKzIyNzUsMTYgQEAgc3RydWN0 IGNvbXBvc2l0aW9uX2l0CiAKIHN0cnVjdCBpdAogeworCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGJvb2xfYmYgenZfcCA6IDE7CisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCis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j dXJzb3JfdHlwZSwgaW50IHdkLCBib29sIGFjdGl2ZV9wLAorICAgICAgICBib29sIGN1cnNvcl9n Y19wKTsKKworICB2b2lkICgqbWNfc2NyaWJlX2N1cnNvcikgKHN0cnVjdCB3aW5kb3cgKncsIHN0 cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwKKyAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqZ2x5 cGhfcm93LCBpbnQgeCwgaW50IGZ4LCBpbnQgeSwgaW50IGZ5LCBpbnQgaHBvcywKKyAgICAgICAg aW50IHZwb3MsIGludCB3ZCwgaW50IGgsIGRvdWJsZSByZWQsIGRvdWJsZSBncmVlbiwgZG91Ymxl IGJsdWUsCisgICAgICAgIGVudW0gdHlwZV9vZl9jdXJzb3IgY3Vyc29yX3R5cGUsIGludCBjdXJz b3Jfd2lkdGgsCisgICAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciwgYm9vbCBvbl9w LCBib29sIGFjdGl2ZV9wKTsKKworICB2b2lkICgqbWNfc2NyaWJlX3N0cmluZykgKHN0cnVjdCBn bHlwaF9zdHJpbmcgKnMsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBo X3JvdyAqcm93LAorICAgICAgICBkb3VibGUgcmVkLCBkb3VibGUgZ3JlZW4sIGRvdWJsZSBibHVl LCBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IsCisgICAgICAgIGVudW0gdHlwZV9vZl9jdXJz b3IgY3Vyc29yX3R5cGUsIGludCB3ZCwgYm9vbCBhY3RpdmVfcCwgYm9vbCBjdXJzb3JfZ2NfcCk7 CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogSGFuZGxlcnMgZm9yIHNldHRp bmcgZnJhbWUgcGFyYW1ldGVycy4gICovCiAgIGZyYW1lX3Bhcm1faGFuZGxlciAqZnJhbWVfcGFy bV9oYW5kbGVyczsKIApAQCAtMzI3MCw2ICszMzY3LDcxIEBAIGV4dGVybiB2b2lkIGdldF9mb250 X2FzY2VudF9kZXNjZW50IChzdHJ1Y3QgZm9udCAqLCBpbnQgKiwgaW50ICopOwogCiAjaWZkZWYg SEFWRV9XSU5ET1dfU1lTVEVNCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdp biBNVUxUSVBMRS1DVVJTT1JTICovCisKK3N0cnVjdCBtY19SR0IKK3sKKyAgZG91YmxlIHJlZDsK KyAgZG91YmxlIGdyZWVuOworICBkb3VibGUgYmx1ZTsKK307CisKK2V4dGVybiBMaXNwX09iamVj dCBtY19udGggKGludCwgTGlzcF9PYmplY3QpOworCitleHRlcm4gTGlzcF9PYmplY3QgbWNfYXNz cSAoTGlzcF9PYmplY3QsIExpc3BfT2JqZWN0KTsKKworZXh0ZXJuIHZvaWQgbWNfeHdfY29sb3Jf dmFsdWVzIChzdHJ1Y3Qgd2luZG93ICosIExpc3BfT2JqZWN0LCBzdHJ1Y3QgbWNfUkdCICopOwor CitleHRlcm4gYm9vbCBtY191cGRhdGVfd2luZG93X2ZyaW5nZXMgKHN0cnVjdCB3aW5kb3cgKiwg Ym9vbCk7CisKK2V4dGVybiBjaGFyICogbWNfd2luZG93IChzdHJ1Y3Qgd2luZG93ICopOworCitl eHRlcm4gY2hhciAqIG1jX2NoYXJfdG9fc3RyaW5nIChpbnQpOworCitleHRlcm4gY2hhciAqIG1j X2N1cnNvcl90eXBlX3RvX3N0cmluZyAoZW51bSB0eXBlX29mX2N1cnNvcik7CisKK2V4dGVybiBj aGFyICogbWNfZmxhdm9yX3RvX3N0cmluZyAoZW51bSBtY19mbGF2b3IpOworCitleHRlcm4gdm9p ZCBtY19kcmF3X2ZyaW5nZV9iaXRtYXAgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX3Jv dyAqLCBpbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gdHlwZV9v Zl9jdXJzb3IpOworCitleHRlcm4gaW50IG1jX2dldF9mcmluZ2VfYml0bWFwIChzdHJ1Y3Qgd2lu ZG93ICosIExpc3BfT2JqZWN0LCBpbnQsIGludCk7CisKK2V4dGVybiB2b2lkIG1jX2VuZ2luZSAo c3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlwaF9yb3cg KiwKKyAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoICosIGludCwgaW50LCBpbnQs IGludCwgaW50LCBpbnQsCisgICAgICAgICAgICAgICAgICAgICAgIGVudW0gdHlwZV9vZl9jdXJz b3IsIGludCwgaW50LCBzdHJ1Y3QgbWNfUkdCLCBib29sLAorICAgICAgICAgICAgICAgICAgICAg ICBlbnVtIHR5cGVfb2ZfYWN0aW9uLCBib29sLCBlbnVtIHR5cGVfb2ZfY2FjaGUpOworCitleHRl cm4gdm9pZCBtY19zZXRfZXNzZW50aWFscyAoc3RydWN0IHdpbmRvdyAqLCBib29sLCBzdHJ1Y3Qg bWNfUkdCICosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiAq LCBpbnQgKik7CisKK2V4dGVybiB2b2lkIG1jX2RyYXdfcm93IChzdHJ1Y3Qgd2luZG93ICosIHN0 cnVjdCBnbHlwaF9tYXRyaXggKiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAg ICAgICAgICAgIHN0cnVjdCBnbHlwaCAqLCBpbnQsIGludCwgaW50LCBpbnQsIGJvb2wsIGludCwK KyAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCLCBzdHJ1Y3QgbWNfUkdCLCBi b29sKTsKKworZXh0ZXJuIHZvaWQgbWNfcmVkcmF3X3JvdyAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1 Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgIGludCwgaW50LCBpbnQsIGJvb2wsIGVudW0gZHJhd19nbHlwaHNfZmFjZSk7CisK K2V4dGVybiB2b2lkIG1jX3Jlc2V0X2NhY2hlIChzdHJ1Y3Qgd2luZG93ICosIGVudW0gdHlwZV9v Zl9jYWNoZSk7CisKK2V4dGVybiB2b2lkIG1jX2VyYXNlX3JvdyAoc3RydWN0IHdpbmRvdyAqLCBz dHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlwaF9yb3cgKik7CisKK2V4dGVybiB2b2lk IG1jX2RyYXdfY3Vyc29yX2dseXBoIChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRy aXggKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93 ICosIGVudW0gZHJhd19nbHlwaHNfZmFjZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBpbnQsIGludCwgaW50LCBkb3VibGUsIGRvdWJsZSwgZG91YmxlLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfZmxhdm9yLCBlbnVtIHR5cGVfb2ZfY3Vyc29y LCBpbnQsIGJvb2wsIGJvb2wpOworCitleHRlcm4gdm9pZCBtY194X3dyaXRlX2dseXBocyAoc3Ry dWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKiwgZW51bSBnbHlw aF9yb3dfYXJlYSwgaW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCwgaW50 LCBkb3Vib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SBsYmVhcmlu ZyBpcyBsYXJnZXIgdGhhbgorICAgICAgICAgdGhlIHBpeGVsIHdpZHRoLiAgKi8KKyAgICAgIGFi b3J0X3NraXBwaW5nID0gKGkgPCBzdGFydF9ocG9zKTsKKyAgICB9CisgICAgICB9CisKKyAgICAv KiBUcnkgdG8gYXZvaWQgd3JpdGluZyB0aGUgZW50aXJlIHJlc3Qgb2YgdGhlIGRlc2lyZWQgcm93 CisgICAgICAgYnkgbG9va2luZyBmb3IgYSByZXN5bmMgcG9pbnQuICBUaGlzIG1haW5seSBwcmV2 ZW50cworICAgICAgIG1vZGUgbGluZSBmbGlja2VyaW5nIGluIHRoZSBjYXNlIHRoZSBtb2RlIGxp bmUgaXMgaW4KKyAgICAgICBmaXhlZC1waXRjaCBmb250LCB3aGljaCBpdCB1c3VhbGx5IHdpbGwg YmUuICAqLworICAgIGlmIChpIDwgZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICAg IHsKKyAgICAgICAgaW50IHN0YXJ0X3ggPSB4LCBzdGFydF9ocG9zID0gaTsKKyAgICAgICAgc3Ry dWN0IGdseXBoICpzdGFydCA9IGRlc2lyZWRfZ2x5cGg7CisgICAgICAgIGludCBjdXJyZW50X3gg PSB4OworICAgICAgICBib29sIHNraXBfZmlyc3RfcCA9ICFjYW5fc2tpcF9wOworCisgICAgICAg IC8qIEZpbmQgdGhlIG5leHQgZ2x5cGggdGhhdCdzIGVxdWFsIGFnYWluLiAgKi8KKyAgICAgICAg d2hpbGUgKGkgPCBzdG9wCisgICAgICAgICAmJiAoc2tpcF9maXJzdF9wCisgICAgICAgfHwgIUdM WVBIX0VRVUFMX1AgKGRlc2lyZWRfZ2x5cGgsIGN1cnJlbnRfZ2x5cGgpKQorICAgICAgICAgJiYg eCA9PSBjdXJyZW50X3gpCisgICAgeworICAgICAgeCArPSBkZXNpcmVkX2dseXBoLT5waXhlbF93 aWR0aDsKKyAgICAgIGN1cnJlbnRfeCArPSBjdXJyZW50X2dseXBoLT5waXhlbF93aWR0aDsKKyAg ICAgICsrZGVzaXJlZF9nbHlwaCwgKytjdXJyZW50X2dseXBoLCArK2k7CisgICAgICBza2lwX2Zp cnN0X3AgPSAwOworICAgIH0KKworICBpZiAoZGVidWdfcAorICAgICAgJiYgdnBvcyAhPSBib3R0 b21fdnBvcworICAgICAgJiYgIU5JTFAgKGlfc3RvcmUpKQorICAgIHsKKyAgICAgIExpc3BfT2Jq ZWN0IHN0cmluZyA9IEZwcmluMV90b19zdHJpbmcgKGlfc3RvcmUsIFFuaWwpOworICAgICAgY2hh ciAqY2hhcl9zdHJpbmcgPSBTU0RBVEEgKHN0cmluZyk7CisgICAgICBmcHJpbnRmIChzdGRlcnIs ICJpX3N0b3JlOiAgdnBvcyAoJWQpIHwgJXNcbiIsIHZwb3MsIGNoYXJfc3RyaW5nKTsKKyAgICB9 CisKKyAgZm9yICg7CisgICAgICAgQ09OU1AgKGlfc3RvcmUpCisgICAgICAgJiYgdnBvcyAhPSBi b3R0b21fdnBvczsKKyAgICAgICBpX3N0b3JlID0gWENEUiAoaV9zdG9yZSkpCisgICAgeworICAg ICAgaW50IHggPSBYRklYTlVNIChYQ0FSIChYQ0FSIChpX3N0b3JlKSkpOworICAgICAgaW50IGhw b3MgPSBYRklYTlVNIChYQ0RSIChYQ0FSIChpX3N0b3JlKSkpOworICAgICAgc3RydWN0IGdseXBo ICp0YXJnZXRfZ2x5cGggPSBtY19nZXRfY3Vyc29yX2dseXBoICh3LCBkZXNpcmVkX21hdHJpeCwg dXBkYXRlZF9yb3csIGhwb3MsIHZwb3MpOworICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgIHsK KyAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJpX3N0b3JlOiAgY2hhciAoJWQvJXMpIHwgeDog KCVkKSB8IGhwb3MgKCVkKSB8IHZwb3MgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgIHRhcmdldF9nbHlwaC0+dS5jaCw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CisgIHJpZi0+bWNfc2NyaWJlX2dseXBocyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93 LCBzdGFydCwgVEVYVF9BUkVBLCBpIC0gc3RhcnRfaHBvcywKKyAgICAgICAgICAgICAgICAgICAg ICAgICB2cG9zLCBib3R0b21fdnBvcywgcmVkLCBncmVlbiwgYmx1ZSwKKyAgICAgICAgICAgICAg ICAgICAgICAgICBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsIGN1cnNv cl9nY19wKTsKKworICBtY19kcmF3X3JvdyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93 LCBzdGFydCwgc3RhcnRfeCwgaSAtIHN0YXJ0X2hwb3MsCisgICAgICAgICAgICAgICB2cG9zLCBi b3R0b21fdnBvcywgYWN0aXZlX3AsIGZjX3gsIGNoX2ZvcmVncm91bmQsIGZjX2ZvcmVncm91bmQs IHRydWUpOworCisgICAgICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICB9CisgIH0KKworICAgICAg LyogV3JpdGUgdGhlIHJlc3QuICAqLworICAgICAgaWYgKGkgPCBkZXNpcmVkX3Jvdy0+dXNlZFtU RVhUX0FSRUFdKQorICB7CisgICAgb3V0cHV0X2N1cnNvcl90byAodywgdnBvcywgaSwgZGVzaXJl ZF9yb3ctPnksIHgpOworCisgIGlmIChkZWJ1Z19wCisgICAgICAmJiB2cG9zICE9IGJvdHRvbV92 cG9zKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIkRSQVcgUkVNQUlOREVSIE9GIFRI RSBST1c6XG5cCisgICAgICBjaGFyICglZC8lcykgfCB4OiAoJWQpIHwgaSAoJWQpIHwgbGVuZ3Ro ICglZCkgfCB2cG9zICglZClcbiIsCisgICAgICBkZXNpcmVkX2dseXBoLT51LmNoLCBtY19jaGFy X3RvX3N0cmluZyAoZGVzaXJlZF9nbHlwaC0+dS5jaCksCisgICAgICB4LCBp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ICA9PSBjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdKQor ICAgICAgICAgICAmJiBNQVRSSVhfUk9XX0VYVEVORFNfRkFDRV9QIChjdXJyZW50X3JvdykpKTsK KyAgfQorICAgICAgZWxzZSBpZiAoTUFUUklYX1JPV19FWFRFTkRTX0ZBQ0VfUCAoY3VycmVudF9y b3cpKQorICB7CisgICAgLyogSWYgb2xkIHJvdyBleHRlbmRzIHRvIHRoZSBlbmQgb2YgdGhlIHRl eHQgYXJlYSwgY2xlYXIuICAqLworICAgIGlmIChpID49IGRlc2lyZWRfcm93LT51c2VkW1RFWFRf QVJFQV0pCisgICAgICBvdXRwdXRfY3Vyc29yX3RvICh3LCB2cG9zLCBpLCBkZXNpcmVkX3Jvdy0+ eSwKKyAgICAgICAgICAgIGRlc2lyZWRfcm93LT5waXhlbF93aWR0aCk7CisgICAgcmlmLT5jbGVh cl9lbmRfb2ZfbGluZSAodywgdXBkYXRlZF9yb3csIFRFWFRfQVJFQSwgLTEpOworCisgIGNsZWFy X3RvX3ggPSAtMTsKKworICAgIGNoYW5nZWRfcCA9IDE7CisgIH0KKyAgICAgIGVsc2UgaWYgKGRl c2lyZWRfcm93LT5waXhlbF93aWR0aCA8IGN1cnJlbnRfcm93LT5waXhlbF93aWR0aCkKKyAgewor ICAgIC8qIE90aGVyd2lzZSBjbGVhciB0byB0aGUgZW5kIG9mIHRoZSBvbGQgcm93LiAgRXZlcnl0 aGluZworICAgICAgIGFmdGVyIHRoYXQgcG9zaXRpb24gc2hvdWxkIGJlIGNsZWFyIGFscmVhZHku ICAqLworICAgIGludCB4bGltOworCisgICAgaWYgKGkgPj0gZGVzaXJlZF9yb3ctPnVzZWRbVEVY VF9BUkVBXSkKKyAgICAgIG91dHB1dF9jdXJzb3JfdG8gKHcsIHZwb3MsIGksIGRlc2lyZWRfcm93 LT55LAorICAgICAgICAgICAgZGVzaXJlZF9yb3ctPnBpeGVsX3dpZHRoKTsKKworICAgIC8qIElm IGN1c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mICh0cmFjZV9y ZWRpc3BsYXlfcCkKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfdXBkYXRlX3RleHRfYXJl YSAoZmxvYXRpbmcpOiAgdnBvcyAoJWQpIHwgeF9saW1pdCAoJWQpXG4iLCB2cG9zLCB4X2xpbWl0 KTsKKworICAgICAgaWYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3Nz aGFpcnMpKQorICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGNoX2hvcml6b250YWxfcnVsZXIpKQorICAgICAgICAgICYmIHggPCB0ZXh0X2FyZWFfd2lkdGgK KyAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgJiYgdGFyZ2V0 X2dseXBoICE9IE5VTEwpCisgICAgICAgIG1jX2VuZ2luZSAodywgZGVzaXJlZF9tYXRyaXgsIHVw ZGF0ZWRfcm93LCB0YXJnZXRfZ2x5cGgsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwKKyAgICAgICAg ICAgICAgICAgICB1cGRhdGVkX3Jvdy0+eSwgaHBvcywgdnBvcywgTUNfSEJBUiwgMSwgZmNfeCwK KyAgICAgICAgICAgICAgICAgICBkZWJ1Z19wID8gZGVidWdfZmcgOiBjaF9mb3JlZ3JvdW5kLCBh Y3RpdmVfcCwgSE9SSVpPTlRBTF9SVUxFUiwKKyAgICAgICAgICAgICAgICAgICB0cnVlLCBOT19D QUNIRSk7CisKKyAgICAgIGlmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBj cm9zc2hhaXJzKSkKKyAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgJiYgeCA8IHRleHRfYXJlYV93aWR0 aAorICAgICAgICAgICYmIHZwb3MgIT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAgICAmJiB3LT5j dXJzb3IueCA+PSB4CisgICAgICAgICAgJiYgdGFyZ2V0X2dseXBoICE9IE5VTEwpCisgICAgICAg IG1jX2VuZ2luZSAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRfZ2x5cGgs IFRFWFRfQVJFQSwgeCwgeF9saW1pdCwKKyAgICAgICAgICAgICAgICAgICB1cGRhdGVkX3Jvdy0+ eSwgaHBvcywgdnBvcywgTUNfQkFSLCAxLCBmY194LAorICAgICAgICAgICAgICAgICAgIGRlYnVn X3AgPyBkZWJ1Z19mZyA6IGNoX2ZvcmVncm91bmQsIGFjdGl2ZV9wLCBWRVJUSUNBTF9SVUxFUiwK KyAgICAgICAgICAgICAgICAgICB0cnVlLCBOT19DQUNIRSk7CisKKyAgICAgIGlmICghTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAmJiB4 IDwgdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgJiYgZmNfeCA+PSB4CisgICAgICAgICAgJiYg dGFyZ2V0X2dseXBoICE9IE5VTEwpCisgICAgICAgIG1jX2VuZ2luZSAodywgZGVzaXJlZF9tYXRy aXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRfZ2x5cGgsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwKKyAg ICAgICAgICAgICAgICAgICB1cGRhdGVkX3Jvdy0+eSwgaHBvcywgdnBvcywgTUNfQkFSLCAxLCBm Y194LAorICAgICAgICAgICAgICAgICAgIGRlYnVnX3AgPyBkZWJ1Z19mZyA6IGZjX2ZvcmVncm91 bmQsIGFjdGl2ZV9wLCBGSUxMX0NPTFVNTiwKKyAgICAgICAgICAgICAgICAgICB0cnVlLCBOT19D QUNIRSk7CisKKyAgICB9CisgICAgfQorCisgIHJldHVybiBjaGFuZ2VkX3A7Cit9CisKKy8qIGVu ZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBT dHJ1Y3R1cmUgdG8gcGFzcyBkaW1lbnNpb25zIGFyb3VuZC4gIFVzZWQgZm9yIGNoYXJhY3RlciBi b3VuZGluZwogICAgYm94ZXMsIGdseXBoIG1hdHJpeCBkaW1lbnNpb25zIGFuZCBhbGlrZS4gICov CiAKQEAgLTMyODIsMTAgKzM3MzgsMzYgQEAgcmVkcmF3X292ZXJsYXBwZWRfcm93cyAoc3RydWN0 IHdpbmRvdyAqdywgaW50IHliKQogCSAgICB7CiAJICAgICAgb3V0cHV0X2N1cnNvcl90byAodywg aSwgMCwgcm93LT55LAogCQkJCWFyZWEgPT0gVEVYVF9BUkVBID8gcm93LT54IDogMCk7Ci0JICAg ICAgaWYgKHJvdy0+dXNlZFthcmVhXSkKKworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlmICgody0+bWNfZWx0cy51c2VkID4gMCB8fCB3 LT5jaF9lbHRzLnVzZWQgPiAwIHx8IHctPmZjX2VsdHMudXNlZCA+IDApCisgICAgICAmJiBhcmVh ID09IFRFWFRfQVJFQQorICAgICAgJiYgcm93LT51c2VkW2FyZWFdKQorICAgIHsKKyAgICAgIHN0 cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworICAgICAgaW50 IHN0YXJ0X3ggPSByb3ctPng7CisgICAgICBpbnQgc3RhcnRfaHBvcyA9IDA7CisgICAgICBpbnQg ZW5kX2hwb3MgPSByb3ctPnVzZWRbYXJlYV07CisgICAgICBib29sIGNsZWFyX2VvbF9wID0gdHJ1 ZTsKKyAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBobCA9IERSQVdfTk9STUFMX1RFWFQ7Cisg ICAgICBUUkFDRSAoKHN0ZGVyciwgInJlZHJhd19vdmVybGFwcGVkX3Jvd3MgKCVkKTogIHN0YXJ0 X3ggKCVkKSB8IHN0YXJ0X2hwb3MgKCVkKSB8IGVuZF9ocG9zICglZClcbiIsCisgICAgICAgICAg ICAgICAgICAgICAgaSwgc3RhcnRfeCwgc3RhcnRfaHBvcywgZW5kX2hwb3MpKTsKKyAgICAgIG1j X3JlZHJhd19yb3cgKHcsIG1hdHJpeCwgcm93LCBzdGFydF94LCBzdGFydF9ocG9zLCBlbmRfaHBv cywgY2xlYXJfZW9sX3AsIGhsKTsKKyAgICB9CisgICAgZWxzZSBpZiAocm93LT51c2VkW2FyZWFd KQorICAgICAgewogCQlGUkFNRV9SSUYgKGYpLT53cml0ZV9nbHlwaHMgKHcsIHJvdywgcm93LT5n bHlwaHNbYXJlYV0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBhcmVhLCByb3ctPnVzZWRbYXJlYV0pOwogCSAgICAgIEZSQU1FX1JJRiAoZiktPmNsZWFyX2Vu ZF9vZl9saW5lICh3LCByb3csIGFyZWEsIC0xKTsKKyAgICAgIH0KKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogCSAgICB9CiAKIAkgIHJvdy0+b3ZlcmxhcHBlZF9wID0gMDsKQEAgLTMz ODgsNiArMzg3MCw0MCBAQCBzdGF0aWMgYm9vbAogdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRv dyAqdywgYm9vbCBmb3JjZV9wKQogewogICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICpkZXNpcmVkX21h dHJpeCA9IHctPmRlc2lyZWRfbWF0cml4OworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlmICh0cmFjZV9yZWRpc3BsYXlfcCkK KyAgICBmcHJpbnRmIChzdGRlcnIsICJ1cGRhdGVfd2luZG93ICglcylcbiIsIG1jX3dpbmRvdyAo dykpOworCisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBib29sIGFj dGl2ZV9wID0gKHcgPT0gWFdJTkRPVyAoZi0+c2VsZWN0ZWRfd2luZG93KQorICAgICAgICAgICAg ICAgICAgICYmIGYgPT0gRlJBTUVfRElTUExBWV9JTkZPIChmKS0+eF9oaWdobGlnaHRfZnJhbWUp OworCisgIG1jX3NldF9lc3NlbnRpYWxzICh3LCBhY3RpdmVfcCwgJmNoX2ZvcmVncm91bmQsICZm Y19mb3JlZ3JvdW5kLCAmZmNfeCk7CisKKyAgc3RydWN0IGdseXBoX21hdHJpeCAqY3VycmVudF9t YXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKworICBmb3IgKGludCB2cG9zID0gMDsKKyAgICAg ICB2cG9zIDwgY3VycmVudF9tYXRyaXgtPm5yb3dzCisgICAgICAgJiYgTUFUUklYX1JPVyAoY3Vy cmVudF9tYXRyaXgsIHZwb3MpLT5lbmFibGVkX3AKKyAgICAgICAmJiAody0+bWNfZWx0cy51c2Vk ID4gMCB8fCB3LT5jaF9lbHRzLnVzZWQgPiAwIHx8IHctPmZjX2VsdHMudXNlZCA+IDApOworICAg ICAgICsrdnBvcykKKyAgICB7CisgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cgPSBNQVRSSVhf Uk9XIChjdXJyZW50X21hdHJpeCwgdnBvcyk7CisgICAgICBtY19lcmFzZV9yb3cgKHcsIGN1cnJl bnRfbWF0cml4LCByb3cpOworICAgIH0KKworICBtY19yZXNldF9jYWNoZSAodywgTUNfQ0FDSEUp OworICBtY19yZXNldF9jYWNoZSAodywgQ0hfQ0FDSEUpOworICBtY19yZXNldF9jYWNoZSAodywg RkNfQ0FDSEUpOworCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogICBib29sIHBhdXNlZF9wOwogICBpbnQgcHJlZW1wdF9jb3VudCA9IGNs aXBfdG9fYm91bmRzICgxLCBiYXVkX3JhdGUgLyAyNDAwICsgMSwgSU5UX01BWCk7CiAgIHN0cnVj dCByZWRpc3BsYXlfaW50ZXJmYWNlICpyaWYgPSBGUkFNRV9SSUYgKFhGUkFNRSAoV0lORE9XX0ZS QU1FICh3KSkpOwpAQCAtMzQ5Nyw2ICs0MDEzLDM5IEBAIHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3 aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkKIAogICAgIHNldF9jdXJzb3I6CiAKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogUmVzZXQgYHJv d2AgdG8gMCBzbyB0aGF0IGZha2UgY3Vyc29ycyBjYW4gYmUgZHJhd24gb24gcm93cyBwcmVjZWRp bmcgdGhlCisgIGZpcnN0IGByb3ctPmVuYWJsZWRfcGAuICBKdXN0IHByaW9yIHRvIHRoZSBjYWxs IHRvIGBzY3JvbGxpbmdfd2luZG93JyBhYm92ZSwKKyAgYHJvd2Agd2FzIGFkdmFuY2VkIHRvIHRo ZSBmaXJzdCBgcm93LT5lbmFibGVkX3BgLiAqLworICBmb3IgKHN0cnVjdCBnbHlwaF9yb3cgKmRl c2lyZWRfcm93ID0gTUFUUklYX1JPVyAoZGVzaXJlZF9tYXRyaXgsIDApOworICAgICAgIC8vIGNo YW5nZWRfcAorICAgICAgI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VBXSwKKyAgICAg ICAgICAgICAgICAgICAgY3VycmVudF9yb3ctPngsIGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJF QV0sIHZwb3MsCisgICAgICAgICAgICAgICAgICAgIGJvdHRvbV92cG9zLCBhY3RpdmVfcCwgZmNf eCwgY2hfZm9yZWdyb3VuZCwgZmNfZm9yZWdyb3VuZCwgdHJ1ZSk7CisgICB9CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgICAgIC8qIFVwZGF0ZSB0aGUgaGVhZGVyIGxpbmUgYWZ0 ZXIgc2Nyb2xsaW5nIGJlY2F1c2UgYSBuZXcgaGVhZGVyCiAJIGxpbmUgd291bGQgb3RoZXJ3aXNl IG92ZXJ3cml0ZSBsaW5lcyBhdCB0aGUgdG9wIG9mIHRoZSB3aW5kb3cKIAkgdGhhdCBjYW4gYmUg c2Nyb2xsZWQuICAqLwpAQCAtMzUzMSwxMCArNDA4MCwyMSBAQCB1cGRhdGVfd2luZG93IChzdHJ1 Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3ApCiAgICAgICBzdHJjcHkgKHctPmN1cnJlbnRfbWF0 cml4LT5tZXRob2QsIHctPmRlc2lyZWRfbWF0cml4LT5tZXRob2QpOwogI2VuZGlmCiAKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICNpZmRlZiBI QVZFX1dJTkRPV19TWVNURU0KKyAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgJiYg IU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgIG1j X3VwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgMCk7CisgICAgZWxzZQogICAgICAgdXBkYXRlX3dp bmRvd19mcmluZ2VzICh3LCAwKTsKICNlbmRpZgogCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiAgICAgICAvKiBFbmQgdGhlIHVwZGF0ZSBvZiB3aW5kb3cgVy4gIERvbid0IHNldCB0aGUg Y3Vyc29yIGlmIHdlCiAgICAgICAgICBwYXVzZWQgdXBkYXRpbmcgdGhlIGRpc3BsYXkgYmVjYXVz ZSBpbiB0aGlzIGNhc2UsCiAgICAgICAgICBzZXRfd2luZG93X2N1cnNvcl9hZnRlcl91cGRhdGUg aGFzbid0IGJlZW4gY2FsbGVkLCBhbmQKQEAgLTM4NTIsMTQgKzQ0MTIsMzAgQEAgdXBkYXRlX3dp bmRvd19saW5lIChzdHJ1Y3Qgd2luZG93ICp3LCBpbnQgdnBvcywgYm9vbCAqbW91c2VfZmFjZV9v dmVyd3JpdHRlbl9wKQogCSAgY3VycmVudF9yb3ctPnJlZHJhd19mcmluZ2VfYml0bWFwc19wID0g MTsKIAl9CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JT ICovCisKKyAgYm9vbCB1cGRhdGVkX3AgPSAoIUJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAg ICAgICAgICAgICAgID8gdXBkYXRlX3RleHRfYXJlYSAodywgZGVzaXJlZF9yb3csIHZwb3MpCisg ICAgICAgICAgICAgICAgICAgOiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAg ICAgICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkK KyAgICAgICAgICAgICAgICAgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250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ci1o ZXhhZGVjaW1hbAorICAgICAgInh4eHh4eHh4IgorICAgICAgInguLi4uLi54IgorICAgICAgIngu Li4uLi54IgorICAgICAgInguLnh4Li54IgorICAgICAgInguLi54eC54IgorICAgICAgInguLi4u eHh4IgorICAgICAgIngueHh4eHh4IgorICAgICAgIngueHh4eHh4IgorICAgICAgInguLi4ueHh4 IgorICAgICAgInguLi54eC54IgorICAgICAgInguLnh4Li54IgorICAgICAgInguLi4uLi54Igor ICAgICAgInguLi4uLi54IgorICAgICAgInh4eHh4eHh4IikKKyovCitzdGF0aWMgdW5zaWduZWQg c2hvcnQgbWNfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvd19iaXRzW10gPXsKKyAgMHhmZiwg MHg4MSwgMHg4MSwgMHg5OSwgMHg4ZCwgMHg4NywgMHhiZiwKKyAgMHhiZiwgMHg4NywgMHg4ZCwg MHg5OSwgMHg4MSwgMHg4MSwgMHhmZn07CisKKy8qIDI2CisgICAgKCstZnJpbmdlLWhlbHBlci1o ZXhhZGVjaW1hbAorICAgICAgInh4eHh4eHh4IgorICAgICAgInguLi4uLi54IgorICAgICAgIngu Li4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4u Li54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54 IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54Igor ICAgICAgInguLi4uLi54IgorICAgICAgInh4eHh4eHh4IikKKyovCitzdGF0aWMgdW5zaWduZWQg c2hvcnQgbWNfaG9sbG93X3JlY3RhbmdsZV9iaXRzW10gPXsKKyAgMHhmZiwgMHg4MSwgMHg4MSwg MHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwKKyAgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwg MHg4MSwgMHhmZn07CisKKy8qIDI3CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAor ICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAg ICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAg InguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgIngu Li4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4u Li4uIgorICAgICAgInguLi4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdmVy dGljYWxfYmFyX2JpdHNbXSA9eworICAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgw LCAweDgwLAorICAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwfTsKKwor LyogMjgKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHguLi4uLi4i CisgICAgICAieHguLi4uLi4iCisgICAgICAiIHh4Li4uLi4iCisgICAgICAiLnh4Li4uLi4iCisg ICAgICAiLi54eC4uLi4iCisgICAgICAiLi54eC4uLi4iCisgICAgICAiLi4ueHguLi4iCisgICAg ICAiLi4ueHguLi4iCisgICAgICAiLi4uLnh4Li4iCisgICAgICAiLi4uLnh4Li4iCisgICAgICAi Li4uLi54eC4iCisgICAgICAiLi4uLi54eC4iCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4u Li4ueHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19iYWNrc2xhc2hfYml0c1tdID17 CisgIDB4YzAsIDB4YzAsIDB4ZTAsIDB4NjAsIDB4MzAsIDB4MzAsIDB4MTgsIDB4MTgsIDB4Yywg MHhjLCAweDYsIDB4NiwgMHgzLCAweDN9OworCisvKiAyOQorICAgICgrLWZyaW5nZS1oZWxwZXIt aGV4YWRlY2ltYWwKKyAgICAg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gICIueHh4eHh4 LiIKKyAgICAgICJ4Li54eC4ueCIKKyAgICAgICJ4Li54eC4ueCIKKyAgICAgICJ4eHh4eHh4eCIK KyAgICAgICJ4eC4uLi54eCIKKyAgICAgICJ4eHguLnh4eCIKKyAgICAgICIueHh4eHh4LiIKKyAg ICAgICIuLnh4eHguLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3NtaWxleV9mYWNl X2JpdHNbXSA9eworICAweDNjLCAweDdlLCAweDk5LCAweDk5LCAweGZmLCAweGMzLCAweGU3LCAw eDdlLCAweDNjfTsKKworLyogMzIKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisg ICAgICAiLi54Li4uLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLnguLi4iCisgICAg ICAiLi4uLi54Li4iCisgICAgICAiLi4uLnguLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAi Li54Li4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zaW5nbGVfYW5nbGVfcmln aHRfYml0c1tdID17CisgIDB4MjAsIDB4MTAsIDB4OCwgMHg0LCAweDgsIDB4MTAsIDB4MjB9Owor CisvKiAzMworICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLngu LiIKKyAgICAgICIuLi4ueC4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLnguLi4uLiIK KyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLi4ueC4uLiIKKyAgICAgICIuLi4uLnguLiIpCisq Lworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3NpbmdsZV9hbmdsZV9sZWZ0X2JpdHNbXSA9ewor ICAweDQsIDB4OCwgMHgxMCwgMHgyMCwgMHgxMCwgMHg4LCAweDR9OworCisvKiAzNAorICAgICgr LWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICJ4eC54eC4uLiIKKyAgICAgICIueHgu eHguLiIKKyAgICAgICIuLnh4Lnh4LiIKKyAgICAgICIuLi54eC54eCIKKyAgICAgICIuLnh4Lnh4 LiIKKyAgICAgICIueHgueHguLiIKKyAgICAgICJ4eC54eC4uLiIpCisqLworc3RhdGljIHVuc2ln bmVkIHNob3J0IG1jX2RvdWJsZV9hbmdsZV9yaWdodF9iaXRzW10gPXsKKyAgMHhkOCwgMHg2Yywg MHgzNiwgMHgxYiwgMHgzNiwgMHg2YywgMHhkOH07CisKKy8qIDM1CisgICAgKCstZnJpbmdlLWhl bHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLnh4Lnh4IgorICAgICAgIi4ueHgueHguIgorICAg ICAgIi54eC54eC4uIgorICAgICAgInh4Lnh4Li4uIgorICAgICAgIi54eC54eC4uIgorICAgICAg Ii4ueHgueHguIgorICAgICAgIi4uLnh4Lnh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQg bWNfZG91YmxlX2FuZ2xlX2xlZnRfYml0c1tdID17CisgIDB4MWIsIDB4MzYsIDB4NmMsIDB4ZDgs IDB4NmMsIDB4MzYsIDB4MWJ9OworCisvKiAzNgorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRl Y2ltYWwKKyAgICAgICJ4LngueC4uLiIKKyAgICAgICIueC54LnguLiIKKyAgICAgICIuLngueC54 LiIKKyAgICAgICIuLi54LngueCIKKyAgICAgICIuLngueC54LiIKKyAgICAgICIueC54LnguLiIK KyAgICAgICJ4LngueC4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3RyaXBsZV9h bmdsZV9yaWdodF9iaXRzW10gPXsKKyAgMHhhOCwgMHg1NCwgMHgyYSwgMHgxNSwgMHgyYSwgMHg1 NCwgMHhhOH07CisKKy8qIDM3CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAg ICAgIi4uLngueC54IgorICAgICAgIi4ueC54LnguIgorICAgICAgIi54LngueC4uIgorICAgICAg IngueC54Li4uIgorICAgICAgIi54LngueC4uIgorICAgICAgIi4ueC54LnguIgorICAgICAgIi4u LngueC54IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdHJpcGxlX2FuZ2xlX2xlZnRf Yml0c1tdID17CisgIDB4MTUsIDB4MmEsIDB4NTQsIDB4YTgsIDB4NTQsIDB4MmEsIDB4MTV9Owor CisvKiAzOAorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4u LiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIK KyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAg ICAgICJ4Li4uLi54LiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAg ICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0 IG1jX3NpbmdsZV9hbmdsZV91cF9iaXRzW10gPXsKKyAgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwg MHgxMCwgMHgyOCwgMHg0NCwgMHg4MiwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMH07CisKKy8qIDM5 CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4uLi4uIgorICAg ICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAg InguLi4uLnguIgorICAgICAgIi54Li4ueC4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi4u LnguLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4u Li4uIgorICAgICAgIi4uLi4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc2lu Z2xlX2FuZ2xlX2Rvd25fYml0c1tdID17CisgIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4ODIs IDB4NDQsIDB4MjgsIDB4MTAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9OworCisvKiA0MAorICAg ICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIu Li4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLngu eC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIuLngueC4u LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIuLi4uLi4uLiIK KyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVk IHNob3J0IG1jX2RvdWJsZV9hbmdsZV91cF9iaXRzW10gPXsKKyAgMHgwMCwgMHgwMCwgMHgwMCwg MHgxMCwgMHgyOCwgMHg0NCwgMHg5MiwgMHgyOCwgMHg0NCwgMHg4MiwgMHgwMCwgMHgwMCwgMHgw MH07CisKKy8qIDQxCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4u Li4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgInguLi4u LnguIgorICAgICAgIi54Li4ueC4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgInguLnguLngu IgorICAgICAgIi54Li4ueC4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi4uLnguLi4uIgor ICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIikKKyov CitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xlX2Rvd25fYml0c1tdID17Cisg IDB4MDAsIDB4MDAsIDB4MDAsIDB4ODIsIDB4NDQsIDB4MjgsIDB4OTIsIDB4NDQsIDB4MjgsIDB4 MTAsIDB4MDAsIDB4MDAsIDB4MDB9OworCisvKiA0MgorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4 YWRlY2ltYWwKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLngu eC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIuLngueC4u LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIuLngueC4uLiIK KyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIuLi4uLi4uLiIpCisq Lworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3RyaXBsZV9hbmdsZV91cF9iaXRzW10gPXsKKyAg MHgwMCwgMHgxMCwgMHgyOCwgMHg0NCwgMHg5MiwgMHgyOCwgMHg0NCwgMHg5MiwgMHgyOCwgMHg0 NCwgMHg4MiwgMHgwMH07CisKKy8qIDQzCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1h bAorICAgICAgIi4uLi4uLi4uIgorICAgICAgInguLi4uLnguIgorICAgICAgIi54Li4ueC4uIgor ICAgICAgIi4ueC54Li4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi54Li4ueC4uIgorICAg ICAgIi4ueC54Li4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi54Li4ueC4uIgorICAgICAg Ii4ueC54Li4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4uLi4uLi4uIikKKyovCitzdGF0 aWMgdW5zaWduZWQgc2hvcnQgbWNfcXVhZHJ1cGxlX2FuZ2xlX2Rvd25fYml0c1tdID17CisgIDB4 MDAsIDB4ODIsIDB4NDQsIDB4MjgsIDB4OTIsIDB4NDQsIDB4MjgsIDB4OTIsIDB4NDQsIDB4Mjgs IDB4MTAsIDB4MDB9OworCisvKiA0NAorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwK KyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAg ICAgICJ4Li54Li54LiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAgICAg ICJ4Li54Li54LiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4 Li54Li54LiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4Li4u Li54LiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3F1YWRydXBsZV9hbmdsZV91cF9i aXRzW10gPXsKKyAgMHgxMCwgMHgyOCwgMHg0NCwgMHg5MiwgMHgyOCwgMHg0NCwgMHg5MiwgMHgy OCwgMHg0NCwgMHg5MiwgMHgyOCwgMHg0NCwgMHg4Mn07CisKKy8qIDQ1CisgICAgKCstZnJpbmdl LWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInguLi4uLnguIgorICAgICAgIi54Li4ueC4uIgor ICAgICAgIi4ueC54Li4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi54Li4ueC4uIgorICAg ICAgIi4ueC54Li4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi54Li4ueC4uIgorICAgICAg Ii4ueC54Li4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi54Li4ueC4uIgorICAgICAgIi4u eC54Li4uIgorICAgICAgIi4uLnguLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNf dHJpcGxlX2FuZ2xlX2Rvd25fYml0c1tdID17CisgIDB4ODIsIDB4NDQsIDB4MjgsIDB4OTIsIDB4 NDQsIDB4MjgsIDB4OTIsIDB4NDQsIDB4MjgsIDB4OTIsIDB4NDQsIDB4MjgsIDB4MTB9Owor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KyAgICAgIHsK KyAgICAgICAgbG4xID0gWEZJWE5VTSAoRmxlbmd0aCAoYm0xKSk7CisgICAgICAgIGlmIChwYXJ0 aWFsX3ApCisgICAgeworICAgICAgaWYgKGxuMSA+IGl4MikKKyAgICAgICAgeworICAgICAgICAg IGJtID0gbWNfbnRoIChpeDIsIGJtMSk7CisgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAg ICAgIGdvdG8gZm91bmQ7CisgICAgICAgIH0KKyAgICB9CisgICAgICAgIGVsc2UKKyAgICB7Cisg ICAgICBpZiAobG4xID4gaXgxKQorICAgICAgICB7CisgICAgICAgICAgYm0gPSBtY19udGggKGl4 MSwgYm0xKTsKKyAgICAgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgZ290byBmb3VuZDsK KyAgICAgICAgfQorICAgIH0KKyAgICAgIH0KKyAgICBlbHNlIGlmICgoYm0gPSBibTEsICFFUSAo Ym0sIFF0KSkpCisgICAgICBnb3RvIGZvdW5kOworICB9CisgICAgfQorICBpZiAoIUVRIChjbWFw LCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkKKyAgICAg ICYmICFOSUxQIChCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0 KSkpCisgICAgeworICAgICAgYm0yID0gbWNfYXNzcSAoYml0bWFwLCBCVkFSICgmYnVmZmVyX2Rl ZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSk7CisgICAgICBpZiAoQ09OU1AgKGJtMikp CisgIHsKKyAgICBpZiAoKGJtMiA9IFhDRFIgKGJtMikpLCAhTklMUCAoYm0yKSkKKyAgICAgIHsK KyAgICAgICAgaWYgKENPTlNQIChibTIpKQorICAgIHsKKyAgICAgIGxuMiA9IFhGSVhOVU0gKEZs ZW5ndGggKGJtMikpOworICAgICAgaWYgKHBhcnRpYWxfcCkKKyAgICAgICAgeworICAgICAgICAg IGlmIChsbjIgPiBpeDIpCisgICAgICB7CisgICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMik7 CisgICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAg IH0KKyAgICAgICAgfQorICAgIH0KKyAgICAgIH0KKyAgfQorICAgIH0KKyAgaWYgKGxuMSA+IGl4 MSkKKyAgICB7CisgICAgICBibSA9IG1jX250aCAoaXgxLCBibTEpOworICAgICAgaWYgKCFFUSAo Ym0sIFF0KSkKKyAgZ290byBmb3VuZDsKKyAgICB9CisgIGlmIChsbjIgPiBpeDEpCisgICAgewor ICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0yKTsKKyAgICAgIGlmICghRVEgKGJtLCBRdCkpCisg IGdvdG8gZm91bmQ7CisgICAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICB9Cisg IGVsc2UgaWYgKChibSA9IGJtMiwgTklMUCAoYm0pKSkKKyAgICByZXR1cm4gTUNfTk9fRlJJTkdF X0JJVE1BUDsKKyBmb3VuZDoKKyAgcmV0dXJuIGxvb2t1cF9mcmluZ2VfYml0bWFwIChibSk7Cit9 CisKK3N0YXRpYyBpbnQKK21jX2dldF9sb2dpY2FsX2N1cnNvcl9iaXRtYXAgKHN0cnVjdCB3aW5k b3cgKncsIExpc3BfT2JqZWN0IGN1cnNvcikKK3sKKyAgTGlzcF9PYmplY3QgY21hcCwgYm0gPSBR bmlsOworICBpZiAoKGNtYXAgPSBCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZyaW5nZV9j dXJzb3JfYWxpc3QpKSwgIU5JTFAgKGNtYXApKQorICAgIHsKKyAgICAgIGJtID0gbWNfYXNzcSAo Y3Vyc29yLCBjbWFwKTsKKyAgICAgIGlmIChDT05TUCAoYm0pKQorICAgICAgICB7CisgICAgICAg ICAgaWYgKChibSA9IFhDRFIgKGJtKSksIE5JTFAgKGJtKSkK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vciBub3QpCisgIChMIFIgUEwgUFIpICAtLSB1c2UgZm9yIGxlZnQgcmlnaHQgcGFy dGlhbC1sZWZ0IHBhcnRpYWwtcmlnaHQKKyAgSWYgYW55IHZhbHVlIGluIGxvY2FsIGJpbmRpbmcg aXMgbm90IHByZXNlbnQgb3IgdCwgdXNlIGdsb2JhbCB2YWx1ZS4KKyAgICAgSWYgcGFydGlhbCwg bG9va3VwIHBhcnRpYWwgYml0bWFwIGluIGRlZmF1bHQgdmFsdWUgaWYgbm90IGZvdW5kIGhlcmUu CisgICAgIElmIG5vdCBwYXJ0aWFsLCBvciBubyBwYXJ0aWFsIHNwZWMgaXMgcHJlc2VudCwgdXNl IG5vbi1wYXJ0aWFsIGJpdG1hcC4gICovCisgIGlmICgoY21hcCA9IEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpLCAhTklMUCAoY21hcCkpCisgICAg eworICAgICAgYm0xID0gbWNfYXNzcSAoYml0bWFwLCBjbWFwKTsKKyAgICAgIGlmIChDT05TUCAo Ym0xKSkKKyAgICAgICAgeworICAgICAgICAgIGlmICgoYm0xID0gWENEUiAoYm0xKSksIE5JTFAg KGJtMSkpCisgICAgICAgICAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAg ICBpZiAoQ09OU1AgKGJtMSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGxuMSA9IFhG SVhOVU0gKEZsZW5ndGggKGJtMSkpOworICAgICAgICAgICAgICBpZiAocGFydGlhbF9wKQorICAg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGlmIChsbjEgPiBpeDIpCisgICAgICAg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBibSA9IG1jX250aCAoaXgyLCBi bTEpOworICAgICAgICAgICAgICAgICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAg ICAgICAgICBnb3RvIGZvdW5kOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAg ICAgfQorICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgaWYgKGxuMSA+IGl4MSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMSk7CisgICAgICAgICAgICAgICAgICAgICAg aWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAg ICAgZWxzZSBpZiAoKGJtID0gYm0xLCAhRVEgKGJtLCBRdCkpKQorICAgICAgICAgICAgZ290byBm b3VuZDsKKyAgICAgICAgfQorICAgIH0KKyAgaWYgKCFFUSAoY21hcCwgQlZBUiAoJmJ1ZmZlcl9k ZWZhdWx0cywgZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpCisgICAgICAmJiAhTklMUCAoQlZBUiAo JmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpKQorICAgIHsKKyAgICAg IGJtMiA9IG1jX2Fzc3EgKGJpdG1hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2lu ZGljYXRvcl9hbGlzdCkpOworICAgICAgaWYgKENPTlNQIChibTIpKQorICAgICAgICB7CisgICAg ICAgICAgaWYgKChibTIgPSBYQ0RSIChibTIpKSwgIU5JTFAgKGJtMikpCisgICAgICAgICAgICB7 CisgICAgICAgICAgICAgIGlmIChDT05TUCAoYm0yKSkKKyAgICAgICAgICB7CisgICAgICAgICAg ICBsbjIgPSBYRklYTlVNIChGbGVuZ3RoIChibTIpKTsKKyAgICAgICAgICAgIGlmIChwYXJ0aWFs X3ApCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAobG4yID4gaXgyKQorICAg ICAgICAgICAgeworICAgICAgICAgICAgICBibSA9IG1jX250aCAoaXgyLCBibTIpOworICAgICAg ICAgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7Cisg ICAgICAgICAgICB9CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICB9CisgICAgICAgICAgICB9 CisgICAgICAgIH0KKyAgICB9CisgIGlmIChsbjEgPiBpeDEpCisgICAgeworICAgICAgYm0gPSBt Y19udGggKGl4MSwgYm0xKTsKKyAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgIGdvdG8gZm91bmQ7 CisgICAgfQorICBpZiAobG4yID4gaXgxKQorICAgIHsKKyAgICAgIGJtID0gbWNfbnRoIChpeDEs IGJtMik7CisgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgICBnb3RvIGZvdW5kOworICAg ICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgfQorICAgIGVsc2UgaWYgKChibSA9 IGJtMiwgTklMUCAoYm0pKSkKKyAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyBmb3Vu ZDoKKyAgcmV0dXJuIGxvb2t1cF9mcmluZ2VfYml0bWFwIChibSk7Cit9CisKKy8qIFJlY2FsY3Vs YXRlIHRoZSBiaXRtYXBzIHRvIHNob3cgaW4gdGhlIGZyaW5nZXMgb2Ygd2luZG93IFcuCisgICBP bmx5IG1hcmsgcm93cyB3aXRoIG1vZGlmaWVkIGJpdG1hcHMgZm9yIHVwZGF0ZSBpbiByZWRyYXdf ZnJpbmdlX2JpdG1hcHNfcC4KKyAgIElmIEtFRVBfQ1VSUkVOVF9QIGlzIDAsIHVwZGF0ZSBjdXJy ZW50X21hdHJpeCB0b28uICovCitib29sCittY191cGRhdGVfd2luZG93X2ZyaW5nZXMgKHN0cnVj dCB3aW5kb3cgKncsIGJvb2wga2VlcF9jdXJyZW50X3ApCit7C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isgIGlmICghTUlOSV9XSU5ET1dfUCAodykKKyAgICAgICYmIChpbmQgPSBCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGluZGljYXRlX2J1ZmZlcl9ib3VuZGFyaWVzKSwgIU5JTFAgKGluZCkp KQorICAgIHsKKyAgICAgIGlmIChFUSAoaW5kLCBRbGVmdCkgfHwgRVEgKGluZCwgUXJpZ2h0KSkK KyAgICAgICAgYm91bmRhcnlfdG9wID0gYm91bmRhcnlfYm90ID0gYXJyb3dfdG9wID0gYXJyb3df Ym90ID0gaW5kOworICAgICAgZWxzZSBpZiAoQ09OU1AgKGluZCkKKyAgICAgICAgICAgICAgICYm IENPTlNQIChYQ0FSIChpbmQpKSkKKyAgICAgICAgeworICAgICAgICAgIExpc3BfT2JqZWN0IHBv czsKKyAgICAgICAgICBpZiAocG9zID0gbWNfYXNzcSAoUXQsIGluZCksICFOSUxQIChwb3MpKQor ICAgICAgICAgICAgYm91bmRhcnlfdG9wID0gYm91bmRhcnlfYm90ID0gYXJyb3dfdG9wID0gYXJy b3dfYm90ID0gWENEUiAocG9zKTsKKyAgICAgICAgICBpZiAocG9zID0gbWNfYXNzcSAoUXRvcCwg aW5kKSwgIU5JTFAgKHBvcykpCisgICAgICAgICAgICBib3VuZGFyeV90b3AgPSBYQ0RSIChwb3Mp OworICAgICAgICAgIGlmIChwb3MgPSBtY19hc3NxIChRYm90dG9tLCBpbmQpLCAhTklMUCAocG9z KSkKKyAgICAgICAgICAgIGJvdW5kYXJ5X2JvdCA9IFhDRFIgKHBvcyk7CisgICAgICAgICAgaWYg KHBvcyA9IG1jX2Fzc3EgKFF1cCwgaW5kKSwgIU5JTFAgKHBvcykpCisgICAgICAgICAgICBhcnJv d190b3AgPSBYQ0RSIChwb3MpOworICAgICAgICAgIGlmIChwb3MgPSBtY19hc3NxIChRZG93biwg aW5kKSwgIU5JTFAgKHBvcykpCisgICAgICAgICAgICBhcnJvd19ib3QgPSBYQ0RSIChwb3MpOwor ICAgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIC8qIEFueXRoaW5nIGVsc2UgbWVhbnMgYm91 bmRhcnkgb24gbGVmdCBhbmQgbm8gYXJyb3dzLiAgKi8KKyAgICAgICAgYm91bmRhcnlfdG9wID0g Ym91bmRhcnlfYm90ID0gUWxlZnQ7CisgICAgfQorICB0b3BfaW5kX3JuID0gYm90X2luZF9ybiA9 IC0xOworICBpZiAoIU5JTFAgKGluZCkpCisgICAgeworICAgICAgZm9yICh5ID0gdy0+dnNjcm9s bCwgcm4gPSAwOworICAgICAgICAgICB5IDwgeWIgJiYgcm4gPCBucm93czsKKyAgICAgICAgICAg eSArPSByb3ctPmhlaWdodCwgKytybikKKyAgICAgICAgeworICAgICAgICAgIHJvdyA9IHctPmRl c2lyZWRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgaWYgKCFyb3ctPmVuYWJsZWRfcCkK KyAgICAgICAgICAgIHJvdyA9IHctPmN1cnJlbnRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAg ICAgcm93LT5pbmRpY2F0ZV9ib2JfcCA9IHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcCA9IDA7Cisg ICAgICAgICAgcm93LT5pbmRpY2F0ZV9lb2JfcCA9IHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVf cCA9IDA7CisgICAgICAgICAgaWYgKCFyb3ctPm1vZGVfbGluZV9wKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICBpZiAodG9wX2luZF9ybiA8IDAgJiYgcm93LT52aXNpYmxlX2hlaWdodCA+ IDApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgaWYgKE1BVFJJWF9ST1df U1RBUlRfQ0hBUlBPUyAocm93KSA8PSBCVUZfQkVHViAoWEJVRkZFUiAody0+Y29udGVudHMpKQor ICAgICAgICAgICAgICAgICAgICAgICYmICFNQVRSSVhfUk9XX1BBUlRJQUxMWV9WSVNJQkxFX0FU X1RPUF9QICh3LCByb3cpKQorICAgICAgICAgICAgICAgICAgICByb3ctPmluZGljYXRlX2JvYl9w ID0gIU5JTFAgKGJvdW5kYXJ5X3RvcCk7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAg ICAgICAgICAgICAgIHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcCA9ICFOSUxQIChhcnJvd190b3Ap OworICAgICAgICAgICAgICAgICAgdG9wX2luZF9ybiA9IHJuOworICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgICAgaWYgKGJvdF9pbmRfcm4gPCAwKQorICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAgIGlmIChNQVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpID49IEJVRl9a ViAoWEJVRkZFUiAody0+Y29udGVudHMpKQorICAgICAgICAgICAgICAgICAgICAgICYmICFNQVRS SVhfUk9XX1BBUlRJQUxMWV9WSVNJQkxFX0FUX0JPVFRPTV9QICh3LCByb3cpKQorICAgICAgICAg ICAgICAgICAgICByb3ctPmluZGljYXRlX2VvYl9wID0gIU5JTFAgKGJvdW5kYXJ5X2JvdCksIGJv dF9pbmRfcm4gPSBybjsKKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHkgKyByb3ctPmhlaWdo dCA+PSB5YikKKyAgICAgICAgICAgICAgICAgICAgcm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9w ID0gIU5JTFAgKGFycm93X2JvdCksIGJvdF9pbmRfcm4gPSBybjsKKyAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIGVtcHR5X3BvcyA9IEJWQVIgKFhC VUZGRVIgKHctPmNvbnRlbnRzKSwgaW5kaWNhdGVfZW1wdHlfbGluZXMpOworICBpZiAoIU5JTFAg KGVtcHR5X3BvcykgJiYgIUVRIChlbXB0eV9wb3MsIFFyaWdodCkpCisgICAgZW1wdHlfcG9zID0g V0lORE9XX0xFRlRfRlJJTkdFX1dJRFRIICh3KSA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GludCBibiA9IE1DX05PX0ZS SU5HRV9CSVRNQVA7CisgICAgICByb3cgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHRvcF9p bmRfcm47CisgICAgICBpZiAoIXJvdy0+ZW5hYmxlZF9wKQorICAgICAgICByb3cgPSB3LT5jdXJy ZW50X21hdHJpeC0+cm93cyArIHRvcF9pbmRfcm47CisgICAgICB0b3Bfcm93X2VuZHNfYXRfenZf cCA9IHJvdy0+ZW5kc19hdF96dl9wOworICAgICAgaWYgKHJvdy0+aW5kaWNhdGVfYm9iX3ApCisg ICAgICAgIHsKKyAgICAgICAgICBpZiAoRVEgKGJvdW5kYXJ5X3RvcCwgUWxlZnQpKQorICAgICAg ICAgICAgYm4gPSAoKHJvdy0+aW5kaWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5kYXJ5X2JvdCwgUWxl ZnQpKQorICAgICAgICAgICAgPyBNQ19MRUZUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20sIHJvdy0+ ZW5kc19hdF96dl9wKQorICAgICAgICAgICAgOiBNQ19MRUZUX0ZSSU5HRSAoMiwgUXRvcCwgMCkp OworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGJuID0gKChyb3ctPmluZGljYXRlX2VvYl9w ICYmIEVRIChib3VuZGFyeV9ib3QsIFFyaWdodCkpCisgICAgICAgICAgICA/IE1DX1JJR0hUX0ZS SU5HRSAoMSwgUXRvcF9ib3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKQorICAgICAgICAgICAgOiBN Q19SSUdIVF9GUklOR0UgKDIsIFF0b3AsIDApKTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAo cm93LT5pbmRpY2F0ZV90b3BfbGluZV9wKQorICAgICAgICB7CisgICAgICAgICAgaWYgKEVRIChh cnJvd190b3AsIFFsZWZ0KSkKKyAgICAgICAgICAgIGJuID0gTUNfTEVGVF9GUklOR0UgKDYsIFF1 cCwgMCk7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgYm4gPSBNQ19SSUdIVF9GUklOR0Ug KDYsIFF1cCwgMCk7CisgICAgICAgIH0KKyAgICAgIGlmIChibiAhPSBNQ19OT19GUklOR0VfQklU TUFQKQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGZyaW5nZV9iaXRtYXAgKmZiID0gZ2V0 X2ZyaW5nZV9iaXRtYXBfZGF0YSAoYm4pOworICAgICAgICAgIGlmIChmYi0+YWxpZ24gPT0gQUxJ R05fQklUTUFQX1RPUCAmJiBmYi0+cGVyaW9kID09IDApCisgICAgICAgICAgICB7CisgICAgICAg ICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdzE7CisgICAgICAgICAgICAgIGludCB0b3BfaW5k X21heF95OworICAgICAgICAgICAgICB0b3BfaW5kX21pbl95ID0gV0lORE9XX0hFQURFUl9MSU5F X0hFSUdIVCAodyk7CisgICAgICAgICAgICAgIHRvcF9pbmRfbWF4X3kgPSB0b3BfaW5kX21pbl95 ICsgZmItPmhlaWdodDsKKyAgICAgICAgICAgICAgaWYgKHRvcF9pbmRfbWF4X3kgPiB5YikKKyAg ICAgICAgICAgICAgICB0b3BfaW5kX21heF95ID0geWI7CisgICAgICAgICAgICAgIGZvciAoeSA9 IHJvdy0+eSArIHJvdy0+aGVpZ2h0LCBybiA9IHRvcF9pbmRfcm4gKyAxOworICAgICAgICAgICAg ICAgICAgIHkgPCB0b3BfaW5kX21heF95ICYmIHJuIDwgbnJvd3M7CisgICAgICAgICAgICAgICAg ICAgeSArPSByb3cxLT5oZWlnaHQsIHJuKyspCisgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgaWYgKGJvdF9pbmRfcm4gPj0gMCAmJiBybiA+PSBib3RfaW5kX3JuKQorICAgICAg ICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgIHJvdzEgPSB3LT5kZXNpcmVk X21hdHJpeC0+cm93cyArIHJuOworICAgICAgICAgICAgICAgICAgaWYgKCFyb3cxLT5lbmFibGVk X3ApCisgICAgICAgICAgICAgICAgICAgIHJvdzEgPSB3LT5jdXJyZW50X21hdHJpeC0+cm93cyAr IHJuOworICAgICAgICAgICAgICAgICAgcm93MS0+aW5kaWNhdGVfYm9iX3AgPSByb3ctPmluZGlj YXRlX2JvYl9wOworICAgICAgICAgICAgICAgICAgcm93MS0+aW5kaWNhdGVfdG9wX2xpbmVfcCA9 IHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAg ICB9CisgICAgICAgIH0KKyAgICB9CisgIGlmIChib3RfaW5kX3JuID49IDApCisgICAgeworICAg ICAgaW50IGJuID0gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgIHJvdyA9IHctPmRlc2lyZWRf bWF0cml4LT5yb3dzICsgYm90X2luZF9ybjsKKyAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisg ICAgICAgIHJvdyA9IHctPmN1cnJlbnRfbWF0cml4LT5yb3dzICsgYm90X2luZF9ybjsKKyAgICAg IGJvdF9yb3dfZW5kc19hdF96dl9wID0gcm93LT5lbmRzX2F0X3p2X3A7CisgICAgICBpZiAocm93 LT5pbmRpY2F0ZV9lb2JfcCkKKyAgICAgICAgeworICAgICAgICAgIGlmIChFUSAoYm91bmRhcnlf Ym90LCBRbGVmdCkpCisgICAgICAgICAgICBibiA9IE1DX0xFRlRfRlJJTkdFICgzLCBRYm90dG9t LCByb3ctPmVuZHNfYXRfenZfcCk7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgYm4gPSBN Q19SSUdIVF9GUklOR0UgKDMsIFFib3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKTsKKyAgICAgICAg fQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wKQorICAgICAgICB7 CisgICAgICAgICAgaWYgKEVRIChhcnJvd19ib3QsIFFsZWZ0KSkKKyAgICAgICAgICAgIGJuID0g TUNfTEVGVF9GUklOR0UgKDcsIFFkb3duLCAwKTsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAg ICBibiA9IE1DX1JJR0hUX0ZSSU5HRSAoNywgUWRvd24sIDApOworICAgICAgICB9CisgICAgICBp ZiAoYm4gIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVj dCBmcmluZ2VfYml0bWFwICpmYiA9IGdldF9mcmluZ2VfYml0bWFwX2RhdGEgKGJuKTsKKyAgICAg ICAgICBpZiAoZmItPmFsaWduID09IEFMSUdOX0JJVE1BUF9CT1RUT00gJiYgZmItPnBlcmlvZCA9 PSAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cx OworICAgICAgICAgICAgICBpbnQgYm90X2luZF9taW5feTsKKyAgICAgICAgICAgICAgYm90X2lu ZF9tYXhfeSA9IHJvdy0+eSArIHJvdy0+dmlzaWJsZV9oZWlnaHQ7CisgICAgICAgICAgICAgIGJv dF9pbmRfbWluX3kgPSBib3RfaW5kX21heF95IC0gZmItPmhlaWdodDsKKyAgICAgICAgICAgICAg aWYgKGJvdF9pbmRfbWluX3kgPCBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KSkKKyAgICAg ICAgICBib3RfaW5kX21pbl95ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgICAg ICAgICAgICAgIGZvciAoeSA9IHJvdy0+eSwgcm4gPSBib3RfaW5kX3JuIC0gMTsKKyAgICAgICAg ICAgICB5ID49IGJvdF9pbmRfbWluX3kgJiYgcm4gPj0gMDsKKyAgICAgICAgICAgICB5IC09IHJv dzEtPmhlaWdodCwgcm4tLSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpZiAodG9wX2luZF9y biA+PSAwICYmIHJuIDw9IHRvcF9pbmRfcm4pCisgICAgICAgICAgICAgIGJyZWFrOworICAgICAg ICAgICAgcm93MSA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgICBp ZiAoIXJvdzEtPmVuYWJsZWRfcCkKKyAgICAgICAgICAgICAgcm93MSA9IHctPmN1cnJlbnRfbWF0 cml4LT5yb3dzICsgcm47CisgICAgICAgICAgICByb3cxLT5pbmRpY2F0ZV9lb2JfcCA9IHJvdy0+ aW5kaWNhdGVfZW9iX3A7CisgICAgICAgICAgICByb3cxLT5pbmRpY2F0ZV9ib3R0b21fbGluZV9w ID0gcm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wOworICAgICAgICAgIH0KKyAgICAgICAgICAg IH0KKyAgICAgICAgfQorICAgIH0KKyAgTGlzcF9PYmplY3QgYnVmID0gdy0+Y29udGVudHM7Cisg IENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgYm9vbCBhdXRvX2hzY3JvbGxfbW9kZV9wID0gRVEgKEZi dWZmZXJfbG9jYWxfdmFsdWUgKFFhdXRvX2hzY3JvbGxfbW9kZSwgYnVmKSwgUWN1cnJlbnRfbGlu ZSk7CisgIC8qIEVYQU1QTEU6ICAoc2Nyb2xsLWxlZnQgNSkgKi8KKyAgYm9vbCBoc2NsX2FsbF90 ZW1wX3AgPSAody0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9s bCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBhbmQgZG8gbm90aGluZy4gKi8KKyAg Ym9vbCBoc2NsX2FsbF9wZXJtXzBfcCA9ICh3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgQy11IEMt eCA8IGFuZCBkbyBzb21ldGhpbmcgZWxzZSBiZXNpZGVzIGhvcml6b250YWxseSBzY3JvbGxpbmcg dGhlCisgICAgICAgICAgICAgICBjdXJyZW50IGxpbmUgZGlmZmVyZW50bHkuCisgICAgICAgICAg ICAgICBDdXJyZW50IGxpbmUgaXMgX25vdF8gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVu dGx5LiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMV9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNj cm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhzY3JvbGwpOworICAvKiBFWEFN UExFOiAgQy11IEMteCA8IGFuZCAuLi4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBpcyBf bm90XyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9h bGxfcGVybV8yX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHctPmhzY3JvbGwgPT0gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1p bl9oc2Nyb2xsICE9IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgKHNjcm9sbC1sZWZ0IDUp OyBhbmQsIHRoZW4gcHJlc3MgdGhlIGxlZnQgYXJyb3cga2V5IG9uZSB0aW1lLgorICAgICAgICAg ICAgICAgQ3VycmVudCBsaW5lIF9pc18gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5 LiovCisgIGJvb2wgaHNjbF90ZW1wX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAg ICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAg ICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWlu X2hzY3JvbGwgPT0gMCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIHNvbWV0aGlu ZyB0aGF0IGNhdXNlcyB0aGUgY3VycmVudCBsaW5lIHRvIGJlCisgICAgICAgICAgICAgICBob3Jp em9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuCisgICAgICAgICAgICAgICBDdXJyZW50IGxp bmUgX2lzXyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNj bF9wZXJtX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAg ICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhz Y3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+b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3LT5jaF9lbHRzLmNhY2hlc1tlbHRdLmJhY2tncm91bmQuZ3JlZW4s CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IHctPmNoX2VsdHMuY2FjaGVz W2VsdF0uYmFja2dyb3VuZC5ibHVlfTsKKyAgICAgIGJvb2wgYWN0aXZlX3AgPSB3LT5jaF9lbHRz LmNhY2hlc1tlbHRdLmFjdGl2ZV9wOworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9y ID0gdy0+Y2hfZWx0cy5jYWNoZXNbZWx0XS5nbHlwaF9mbGF2b3I7CisgICAgICBib29sIGVuYWJs ZWRfcCA9IHctPmNoX2VsdHMuY2FjaGVzW2VsdF0uZW5hYmxlZF9wOworICAgICAgaWYgKCh2cG9z ID09IHZwb3NfZGVzaXJlZCB8fCB2cG9zID09IHZwb3NfY3VycmVudCkKKyAgICAgICAgICAmJiBn bHlwaF9mbGF2b3IgPT0gTUNfT1ZFUkxBWV9BUlJPV19CSVRNQVAKKyAgICAgICAgICAmJiAhaHNj bF9hbGxfdGVtcF9wCisgICAgICAgICAgJiYgIWhzY2xfdGVtcF9wCisgICAgICAgICAgJiYgIWhz Y2xfcGVybV9wCisgICAgICAgICAgJiYgIWhzY2xfYWxsX3Blcm1fMF9wCisgICAgICAgICAgJiYg IWhzY2xfYWxsX3Blcm1fMV9wCisgICAgICAgICAgJiYgIWhzY2xfYWxsX3Blcm1fMl9wCisgICAg ICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICB7CisgICAgICAgICAgaW50IGZyaW5nZV9iaXRt YXAgPSBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgIGVudW0gZmFjZV9pZCBvdmVybGF5 X2Fycm93X2ZhY2VfaWQgPQorICAgICAgICAgICAgKCFhY3RpdmVfcAorICAgICAgICAgICAgICYm ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3Mp KSkKKyAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb3Zl cmxheS1hcnJvdy1pbmFjdGl2ZS1mYWNlIiksIHRydWUpCisgICAgICAgICAgICA6IChhY3RpdmVf cCkKKyAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1v dmVybGF5LWFycm93LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lE OworICAgICAgICAgIG1jX2xlZnRfZnJpbmdlX2ZhY2VfaWQgPSAoY3Vyc29yX3R5cGUgPT0gTUNf TEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBvdmVybGF5X2Fycm93X2ZhY2VfaWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAgIGlmICh3LT5oc2Nyb2xsICE9IDApCisg ICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVy biAoIistb3ZlcmxheS1hcnJvdyIpLCBmYWxzZSwgdHJ1ZSk7CisgICAgICAgICAgICBlbHNlCisg ICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50 ZXJuICgiKy1vdmVybGF5LWFycm93IiksIHRydWUsIHRydWUpOworICAgICAgICAgIG1jX2xlZnRf ZnJpbmdlX2JpdG1hcCA9IChjdXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAg ICAgIH0KKyAgICAgICAgZWxzZSBpZiAoKHZwb3MgPT0gdnBvc19kZXNpcmVkIHx8IHZwb3MgPT0g dnBvc19jdXJyZW50KQorICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgPT0gTUNfT1ZF UkxBWV9BUlJPV19CSVRNQVAKKyAgICAgICAgICAgICAgICAgJiYgKGhzY2xfYWxsX3RlbXBfcAor ICAgICAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8wX3AKKyAgICAgICAgICAgICAg ICAgICAgIHx8IGhzY2xfYWxsX3Blcm1fMV9wCisgICAgICAgICAgICAgICAgICAgICB8fCBoc2Ns X2FsbF9wZXJtXzJfcAorICAgICAgICAgICAgICAgICAgICAgfHwgaHNjbF90ZW1wX3AKKyAgICAg ICAgICAgICAgICAgICAgIHx8IGhzY2xfcGVybV9wKQorICAgICAgICAgICAgICAgICAmJiBlbmFi bGVkX3ApCisgICAgICAgICAgeworICAgICAgICAgICAgaW50IGZyaW5nZV9iaXRtYXAgPSBNQ19O T19GUklOR0VfQklUTUFQOworICAgICAgICAgICAgZW51bSBmYWNlX2lkIG92ZXJsYXlfYXJyb3df ZmFjZV9pZCA9CisgICAgICAgICAgICAgICghYWN0aXZlX3AKKyAgICAgICAgICAgICAgICYmICFO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkK KyAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVy bGF5LWFycm93LWhzY2wtaW5hY3RpdmUtZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICA6IChh Y3RpdmVfcCkKKyAgICAgICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRl cm4gKCIrLW92ZXJsYXktYXJyb3ctaHNjbC1mYWNlIiksIHRydWUpCisgICAgICAgICAgICAgIDog REVGQVVMVF9GQUNFX0lEOworICAgICAgICAgICAgbWNfbGVmdF9mcmluZ2VfZmFjZV9pZCA9IChj dXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gb3ZlcmxheV9hcnJvd19mYWNlX2lkCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAgICAg aWYgKGhzY2xfYWxsX3Blcm1fMF9wKQorICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNf Z2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIGZhbHNlLCBmYWxz ZSk7CisgICAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xfYWxsX3Blcm1fMV9wKQorICAgICAgICAg ICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgi Ky1oc2NsLXBlcm0iKSwgdHJ1ZSwgZmFsc2UpOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKGhz Y2xfYWxsX3Blcm1fMl9wKQorICAgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dl dF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCBmYWxzZSwgdHJ1ZSk7 CisgICAgICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX3Blcm1fcCkKKyAgICAgICAgICAgICAg ICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIr LWhzY2wtcGVybSIpLCB0cnVlLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAo aHNjbF9hbGxfdGVtcF9wKQorICAgICAgICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBt Y19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXRlbXAiKSwgZmFsc2UsIGZh bHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX3RlbXBfcCkKKyAgICAg ICAgICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAo dywgaW50ZXJuICgiKy1oc2NsLXRlbXAiKSwgdHJ1ZSwgZmFsc2UpOworICAgICAgICAgICAgbWNf bGVmdF9mcmluZ2VfYml0bWFwID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1B UCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGZyaW5nZV9iaXRtYXAK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRN QVA7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKCh2cG9zID09IHZwb3NfZGVzaXJl ZCB8fCB2cG9zID09IHZwb3NfY3VycmVudCkKKyAgICAgICAgICAgICAgICAgICAgJiYgKGdseXBo X2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAg ICAgICAgICAgICB8fGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFCisgICAgICAg ICAgICAgICAgICAgICAgICB8fGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRf QVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8Z2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJ Q0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAgICAgfHxnbHlwaF9mbGF2b3IgPT0gTUNfVkVS VElDQUxfQkFSX0JBQ0tTTEFTSCkKKyAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICBMaXNwX09iamVjdCBiaXRtYXBfZmxhdm9yID0g KGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfaG9sbG93X3JlY3Rhbmds ZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEUpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hvbGxvd19yZWN0YW5nbGUKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBN Q19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jhcl9yaWdodF9hcnJvdworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZF UlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBRbWNfdmVydGljYWxfYmFyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFy X2JhY2tzbGFzaAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBR bmlsOworICAgICAgICAgICAgICBtY19yaWdodF9mcmluZ2VfYml0bWFwID0gKGN1cnNvcl90eXBl ID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBsb29rdXBfZnJpbmdlX2JpdG1hcCAoYml0bWFwX2ZsYXZvcikKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7 CisgICAgICAgICAgICAgIG1jX3JpZ2h0X2ZyaW5nZV9mYWNlX2lkID0gKGN1cnNvcl90eXBlID09 IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistdmVydGljYWwt YmFyLWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGlm ICghcm93LT5lbmFibGVkX3ApCisgICAgICAgIHJvdyA9IGN1cjsKKyAgICAgIGxlZnRfZmFjZV9p ZCA9IHJpZ2h0X2ZhY2VfaWQgPSBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICBsZWZ0X29mZnNldCA9 IHJpZ2h0X29mZnNldCA9IDA7CisgICAgICBwZXJpb2RpY19wID0gMDsKKyAgICAgIC8qIERlY2lk ZSB3aGljaCBiaXRtYXAgdG8gZHJhdyBpbiB0aGUgbGVmdCBmcmluZ2UuICAqLworICAgICAgaWYg KFdJTkRPV19MRUZUX0ZSSU5HRV9XSURUSCAodykgPT0gMCkKKyAgICAgICAgbGVmdCA9IE1DX05P X0ZSSU5HRV9CSVRNQVA7CisgICAgICBlbHNlIGlmIChyb3ctPmxlZnRfdXNlcl9mcmluZ2VfYml0 bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgIHsKKyAgICAgICAgICBsZWZ0ID0g cm93LT5sZWZ0X3VzZXJfZnJpbmdlX2JpdG1hcDsKKyAgICAgICAgICBsZWZ0X2ZhY2VfaWQgPSBy b3ctPmxlZnRfdXNlcl9mcmluZ2VfZmFjZV9pZDsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAo KCFyb3ctPnJldmVyc2VkX3AgJiYgcm93LT50cnVuY2F0ZWRfb25fbGVmdF9wKQorICAgICAgICAg ICAgICAgfHwgKHJvdy0+cmV2ZXJzZWRfcCAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKSkK KyAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdFICgwLCBRdHJ1bmNhdGlvbiwgMCk7CisgICAg ICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2JvYl9wICYmIEVRIChib3VuZGFyeV90b3AsIFFsZWZ0 KSkKKyAgICAgICAgeworICAgICAgICAgIGxlZnQgPSAoKHJvdy0+aW5kaWNhdGVfZW9iX3AgJiYg RVEgKGJvdW5kYXJ5X2JvdCwgUWxlZnQpKQorICAgICAgICAgICAgICAgICA/IE1DX0xFRlRfRlJJ TkdFICgxLCBRdG9wX2JvdHRvbSwgdG9wX3Jvd19lbmRzX2F0X3p2X3ApCisgICAgICAgICAgICAg ICAgIDogTUNfTEVGVF9GUklOR0UgKDIsIFF0b3AsIDApKTsKKyAgICAgICAgICBpZiAodG9wX2lu ZF9taW5feSA+PSAwKQorICAgICAgICAgICAgbGVmdF9vZmZzZXQgPSB0b3BfaW5kX21pbl95IC0g cm93LT55OworICAgICAgICB9CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2VvYl9wICYm IEVRIChib3VuZGFyeV9ib3QsIFFsZWZ0KSkKKyAgICAgICAgeworICAgICAgICAgIGxlZnQgPSBN Q19MRUZUX0ZSSU5HRSAoMywgUWJvdHRvbSwgYm90X3Jvd19lbmRzX2F0X3p2X3ApOworICAgICAg ICAgIGlmIChib3RfaW5kX21heF95ID49IDApCisgICAgICAgICAgICBsZWZ0X29mZnNldCA9IGJv dF9pbmRfbWF4X3kgLSAocm93LT55ICsgcm93LT52aXNpYmxlX2hlaWdodCk7CisgICAgICAgIH0K KyAgICAgIGVsc2UgaWYgKCghcm93LT5yZXZlcnNlZF9wICYmIE1BVFJJWF9ST1dfQ09OVElOVUFU SU9OX0xJTkVfUCAocm93KSkKKyAgICAgICAgICAgICAgIHx8IChyb3ctPnJldmVyc2VkX3AgJiYg cm93LT5jb250aW51ZWRfcCkpCisgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAoNCwgUWNv bnRpbnVhdGlvbiwgMCk7CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2VtcHR5X2xpbmVf cCAmJiBFUSAoZW1wdHlfcG9zLCBRbGVmdCkpCisgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5H RSAoNSwgUWVtcHR5X2xpbmUsIDApOworICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV90b3Bf bGluZV9wICYmIEVRIChhcnJvd190b3AsIFFsZWZ0KSkKKyAgICAgICAgeworICAgICAgICAgIGxl ZnQgPSBNQ19MRUZUX0ZSSU5HRSAoNiwgUXVwLCAwKTsKKyAgICAgICAgICBpZiAodG9wX2luZF9t aW5feSA+PSAwKQorICAgICAgICAgICAgbGVmdF9vZmZzZXQgPSB0b3BfaW5kX21pbl95IC0gcm93 LT55OworICAgICAgICB9CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2JvdHRvbV9saW5l X3AgJiYgRVEgKGFycm93X2JvdCwgUWxlZnQpKQorICAgICAgICB7CisgICAgICAgICAgbGVmdCA9 IE1DX0xFRlRfRlJJTkdFICg3LCBRZG93biwgMCk7CisgICAgICAgICAgaWYgKGJvdF9pbmRfbWF4 X3kgPj0gMCkKKyAgICAgICAgICAgIGxlZnRfb2Zmc2V0ID0gYm90X2luZF9tYXhfeSAtIChyb3ct PnkgKyByb3ctPnZpc2libGVfaGVpZ2h0KTsKKyAgICAgICAgfQorICAgICAgZWxzZQorICAgICAg ICBsZWZ0ID0gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgIC8qIERlY2lkZSB3aGljaCBiaXRt YXAgdG8gZHJhdyBpbiB0aGUgcmlnaHQgZnJpbmdlLiAgKi8KKyAgICAgIGlmIChXSU5ET1dfUklH SFRfRlJJTkdFX1dJRFRIICh3KSA9PSAwKQorICAgICAgICByaWdodCA9IE1DX05PX0ZSSU5HRV9C SVRNQVA7CisgICAgICBlbHNlIGlmIChyb3ctPnJpZ2h0X3VzZXJfZnJpbmdlX2JpdG1hcCAhPSBN Q19OT19GUklOR0VfQklUTUFQKQorICAgICAgICB7CisgICAgICAgICAgcmlnaHQgPSByb3ctPnJp Z2h0X3VzZXJfZnJpbmdlX2JpdG1hcDsKKyAgICAgICAgICByaWdodF9mYWNlX2lkID0gcm93LT5y aWdodF91c2VyX2ZyaW5nZV9mYWNlX2lkOworICAgICAgICB9CisgICAgICBlbHNlIGlmICgoIXJv dy0+cmV2ZXJzZWRfcCAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAg ICAgfHwgKHJvdy0+cmV2ZXJzZWRfcCAmJiByb3ctPnRydW5jYXRlZF9vbl9sZWZ0X3ApKQorICAg ICAgICByaWdodCA9IE1DX1JJR0hUX0ZSSU5HRSAoMCwgUXRydW5jYXRpb24sIDApOworICAgICAg ZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9ib2JfcCAmJiBFUSAoYm91bmRhcnlfdG9wLCBRcmlnaHQp KQorICAgICAgICB7CisgICAgICAgICAgcmlnaHQgPSAoKHJvdy0+aW5kaWNhdGVfZW9iX3AgJiYg RVEgKGJvdW5kYXJ5X2JvdCwgUXJpZ2h0KSkKKyAgICAgICAgICAgICA/IE1DX1JJR0hUX0ZSSU5H RSAoMSwgUXRvcF9ib3R0b20sIHRvcF9yb3dfZW5kc19hdF96dl9wKQorICAgICAgICAgICAgIDog TUNfUklHS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AgICAg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgY3VyLT5sZWZ0X2ZyaW5nZV9iaXRtYXAg PSBsZWZ0OworICAgICAgICAgICAgICBpZiAobWNfbGVmdF9mcmluZ2VfYml0bWFwICE9IE1DX05P X0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgY3VyLT5sZWZ0X2ZyaW5nZV9mYWNlX2lk ID0gbWNfbGVmdF9mcmluZ2VfZmFjZV9pZDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAg ICAgICAgICAgICBjdXItPmxlZnRfZnJpbmdlX2ZhY2VfaWQgPSBsZWZ0X2ZhY2VfaWQ7CisgICAg ICAgICAgICAgIGlmIChtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1B UCkKKyAgICAgICAgICAgICAgICBjdXItPmxlZnRfZnJpbmdlX29mZnNldCA9IDA7CisgICAgICAg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgY3VyLT5sZWZ0X2ZyaW5nZV9vZmZzZXQg PSBsZWZ0X29mZnNldDsKKyAgICAgICAgICAgICAgaWYgKG1jX3JpZ2h0X2ZyaW5nZV9iaXRtYXAg IT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICBjdXItPnJpZ2h0X2ZyaW5n ZV9iaXRtYXAgPSBtY19yaWdodF9mcmluZ2VfYml0bWFwOworICAgICAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX2JpdG1hcCA9IHJpZ2h0OworICAg ICAgICAgICAgICBpZiAobWNfcmlnaHRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklU TUFQKQorICAgICAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX2ZhY2VfaWQgPSBtY19yaWdo dF9mcmluZ2VfZmFjZV9pZDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAg ICBjdXItPnJpZ2h0X2ZyaW5nZV9mYWNlX2lkID0gcmlnaHRfZmFjZV9pZDsKKyAgICAgICAgICAg ICAgaWYgKG1jX3JpZ2h0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAg ICAgICAgICAgICAgICBjdXItPnJpZ2h0X2ZyaW5nZV9vZmZzZXQgPSAwOworICAgICAgICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX29mZnNldCA9IHJp Z2h0X29mZnNldDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKHJvdy0+b3Zl cmxheV9hcnJvd19iaXRtYXAgPCAwKQorICAgICAgICByb3ctPm92ZXJsYXlfYXJyb3dfYml0bWFw ID0gbWNfZ2V0X2xvZ2ljYWxfZnJpbmdlX2JpdG1hcCAodywgUW92ZXJsYXlfYXJyb3csIDAsIDAp OworICAgICAgaWYgKHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAgIT0gY3VyLT5vdmVybGF5X2Fy cm93X2JpdG1hcCkKKyAgICAgICAgeworICAgICAgICAgIHJlZHJhd19wID0gMSwgcm93LT5yZWRy YXdfZnJpbmdlX2JpdG1hcHNfcCA9IDE7CisgICAgICAgICAgaWYgKCFrZWVwX2N1cnJlbnRfcCkK KyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY3VyLT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNf cCA9IDE7CisgICAgICAgICAgICAgIGN1ci0+b3ZlcmxheV9hcnJvd19iaXRtYXAgPSByb3ctPm92 ZXJsYXlfYXJyb3dfYml0bWFwOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBpZiAo bWNfbGVmdF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICB8 fCBtY19yaWdodF9mcmluZ2Vf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09IDApCisgICAgICAgICAgID8gMSA6IDApOworICAgICAgICAgIHAuYnggPSB4IC0g d2Q7CisgICAgICAgICAgcC5ueCA9IHdkOworICAgICAgICB9CisgICAgfQorICBlbHNlCisgICAg eworICAgICAgaW50IHggPSB3aW5kb3dfYm94X3JpZ2h0ICh3LAorICAgICAgICAoV0lORE9XX0hB U19GUklOR0VTX09VVFNJREVfTUFSR0lOUyAodykKKyAgICAgICAgID8gUklHSFRfTUFSR0lOX0FS RUEKKyAgICAgICAgIDogVEVYVF9BUkVBKSk7CisgICAgICBpbnQgd2QgPSBXSU5ET1dfUklHSFRf RlJJTkdFX1dJRFRIICh3KTsKKyAgICAgIGlmIChwLndkID4gd2QpCisgICAgICAgIHAud2QgPSB3 ZDsKKyAgICAgIHAueCA9IHggKyAod2QgLSBwLndkKSAvIDI7CisgICAgICAvKiBDbGVhciByaWdo dCBmcmluZ2UgaWYgbm8gYml0bWFwIHRvIGRyYXcgb2YgaWYgYml0bWFwIGRvZXNuJ3QgZmlsbAor ICAgdGhlIGZyaW5nZS4gICovCisgICAgICBpZiAocC53ZCA8IHdkIHx8IHAueSA+IHAuYnkgfHwg cC55ICsgcC5oIDwgcC5ieSArIHAubnkpCisgICAgICAgIHsKKyAgICAgICAgICBwLmJ4ID0geDsK KyAgICAgICAgICBwLm54ID0gd2Q7CisgICAgICAgIH0KKyAgICB9CisgIGlmIChwLnggPj0gV0lO RE9XX0JPWF9MRUZUX0VER0VfWCAodykKKyAgICAgICYmIChwLnggKyBwLndkKSA8PSBXSU5ET1df Qk9YX0xFRlRfRURHRV9YICh3KSArIFdJTkRPV19QSVhFTF9XSURUSCAodykpCisgICAgRlJBTUVf UklGIChmKS0+ZHJhd19mcmluZ2VfYml0bWFwICh3LCByb3csICZwKTsKK30KKwordm9pZAorbWNf ZHJhd19mcmluZ2VfYml0bWFwIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpy b3csIGludCBsZWZ0X3AsIGVudW0gdHlwZV9vZl9jdXJzb3IgY3Vyc29yX3R5cGUpCit7CisgIGlu dCBvdmVybGF5ID0gMDsKKyAgaWYgKGxlZnRfcCA9PSByb3ctPnJldmVyc2VkX3AgJiYgcm93LT5j dXJzb3JfaW5fZnJpbmdlX3ApCisgICAgeworICAgICAgTGlzcF9PYmplY3QgY3Vyc29yID0gUW5p bDsKKyAgICAgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgICAgIHsKKyAgICAgICAgY2FzZSBN Q19GUkFNRURfQk9YOgorICAgICAgICAgIGlmIChyb3ctPnZpc2libGVfaGVpZ2h0ID49IFNUQU5E QVJEX0JJVE1BUF9IRUlHSFQgKGhvbGxvd19yZWN0YW5nbGVfYml0cykpCisgICAgICAgICAgICBj dXJzb3IgPSBRaG9sbG93OworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGN1cnNvciA9IFFo b2xsb3dfc21hbGw7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTUNfSE9MTE9XX0JP WDoKKyAgICAgICAgICBpZiAocm93LT52aXNpYmxlX2hlaWdodCA+PSBTVEFOREFSRF9CSVRNQVBf SEVJR0hUIChob2xsb3dfcmVjdGFuZ2xlX2JpdHMpKQorICAgICAgICAgICAgY3Vyc29yID0gUWhv bGxvdzsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICBjdXJzb3IgPSBRaG9sbG93X3NtYWxs OworICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAgICAg ICAgY3Vyc29yID0gUWJveDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19CQVI6 CisgICAgICAgICAgY3Vyc29yID0gUWJhcjsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2Fz ZSBNQ19IQkFSOgorICAgICAgICAgIGN1cnNvciA9IFFoYmFyOworICAgICAgICAgIGJyZWFrOwor ICAgICAgICBjYXNlIE1DX05PX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGNhc2UgTUNfTk9fQ1VS U09SOgorICAgICAgICBjYXNlIE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGNhc2Ug TUNfTEVGVF9GUklOR0VfQklUTUFQOgorICAgICAgICBkZWZhdWx0OgorICAgICAgICAgIHctPnBo eXNfY3Vyc29yX29uX3AgPSAwOworICAgICAgICAgIHJvdy0+Y3Vyc29yX2luX2ZyaW5nZV9wID0g MDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgaWYgKCFOSUxQIChjdXJzb3Ip KQorICAgICAgICB7CisgICAgICAgICAgaW50IGJtID0gbWNfZ2V0X2xvZ2ljYWxfY3Vyc29yX2Jp dG1hcCAodywgY3Vyc29yKTsKKyAgICAgICAgICBpZiAoYm0gIT0gTUNfTk9fRlJJTkdFX0JJVE1B UCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbWNfZHJhd19mcmluZ2VfYml0bWFwXzEg KHcsIHJvdywgbGVmdF9wLCAyLCBibSk7CisgICAgICAgICAgICAgIG92ZXJsYXkgPSBFUSAoY3Vy c29yLCBRYm94KSA/IDMgOiAxOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICBt Y19kcmF3X2ZyaW5nZV9iaXRtYXBfMSAodywgcm93LCBsZWZ0X3AsIG92ZXJsYXksIE1DX05PX0ZS SU5HRV9CSVRNQVApOworICBpZiAobGVmdF9wICYmIHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAg IT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXBfMSAodywg cm93LCAxLCAxLCByb3ctPm92ZXJsYXlfYXJyb3dfYml0bWFwKTsKK30KKworLyogZW5kIE1VTFRJ UExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqK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dCBtY19yZWN0YW5nbGU7CisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKICAgIHN0cnVjdCB3aW5kb3cgKndpbmRvdzsKICAg IHN0cnVjdCBmcmFtZSAqZnJhbWU7CiAgICBOU1Jlc3BvbmRlciAqcHJldlJlc3BvbmRlcjsKQEAg LTY4MCw2ICs2OTAsMTggQEAgdHlwZWRlZiBpZCBpbnN0YW5jZXR5cGU7CiAgICBpbnQgZW1fd2hv bGU7CiAgICB9CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJT T1JTICovCisKKy0gKHZvaWQpbWNfc2V0X3JlY3RhbmdsZTogKE5TUmVjdClyZWN0OworLSAoTlNS ZWN0KW1jX2dldF9yZWN0YW5nbGU7CistIChzdHJ1Y3Qgd2luZG93ICopbWNfZ2V0X3dpbmRvdzsK Ky0gKGJvb2wpbWNfanVkZ2U7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC0gKGlu c3RhbmNldHlwZSkgaW5pdEZyYW1lOiAoTlNSZWN0IClyIHdpbmRvdzogKExpc3BfT2JqZWN0KXdp bjsKIC0gKHZvaWQpc2V0RnJhbWU6IChOU1JlY3QpcjsKIApkaWZmIC0tZ2l0IGEvc3JjL25zdGVy bS5tIGIvc3JjL25zdGVybS5tCmluZGV4IDgxZDM2YmUuLjRkYjllYzQgMTAwNjQ0Ci0tLSBhL3Ny Yy9uc3Rlcm0ubQorKysgYi9zcmMvbnN0ZXJtLm0KQEAgLTc2LDYgKzc2LDEwOTggQEAgVXBkYXRl ZCBieSBDaHJpc3RpYW4gTGltcGFjaCAoY2hyaXNAbmljZS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0tLSAqLworeworICBOU1RSQUNFX1dIRU4gKE5TVFJBQ0Vf R1JPVVBfRk9DVVMsICJtY19uc19jbGlwX3RvX3JlY3QiKTsKKyAgaWYgKHIpCisgICAgeworICAg ICAgTlNUUkFDRV9SRUNUICgiciIsICpyKTsKKyAgICAgIGlmIChbTlNWaWV3IGZvY3VzVmlld10g PT0gRlJBTUVfTlNfVklFVyAoZikpCisgICAgICAgIHsKKyAgICAgICAgICBbW05TR3JhcGhpY3ND b250ZXh0IGN1cnJlbnRDb250ZXh0XSBzYXZlR3JhcGhpY3NTdGF0ZV07CisgICAgICAgICAgaWYg KG4gPT0gMikKKyAgICAgICAgICAgIE5TUmVjdENsaXBMaXN0IChyLCAyKTsKKyAgICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChyb3ctPmNsaXAgIT0g TlVMTCkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgTlNSZWN0IHJf Y2xpcDsKKyAgICAgICAgICAgICAgICAgICAgcl9jbGlwLm9yaWdpbi54ID0gcm93LT5jbGlwLT54 OworICAgICAgICAgICAgICAgICAgICByX2NsaXAub3JpZ2luLnkgPSByb3ctPmNsaXAtPnk7Cisg ICAgICAgICAgICAgICAgICAgIHJfY2xpcC5zaXplLndpZHRoID0gcm93LT5jbGlwLT53aWR0aDsK KyAgICAgICAgICAgICAgICAgICAgcl9jbGlwLnNpemUuaGVpZ2h0ID0gcm93LT5jbGlwLT5oZWln aHQ7CisgICAgICAgICAgICAgICAgICAgIE5TUmVjdCByX3NhdmU7CisgICAgICAgICAgICAgICAg ICAgIHJfc2F2ZS5vcmlnaW4ueCA9IHJbMF0ub3JpZ2luLng7CisgICAgICAgICAgICAgICAgICAg IHJfc2F2ZS5vcmlnaW4ueSA9IHJbMF0ub3JpZ2luLnk7CisgICAgICAgICAgICAgICAgICAgIHJf c2F2ZS5zaXplLndpZHRoID0gclswXS5zaXplLndpZHRoOworICAgICAgICAgICAgICAgICAgICBy X3NhdmUuc2l6ZS5oZWlnaHQgPSByWzBdLnNpemUuaGVpZ2h0OworICAgICAgICAgICAgICAgICAg ICBtY19uc19pbnRlcnNlY3RfcmVjdGFuZ2xlcyAoJnJfc2F2ZSwgJnJfY2xpcCwgJnJbMF0pOwor ICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIE5TUmVjdENsaXAgKCpyKTsKKyAg ICAgICAgICAgICAgfQorICAgICAgICAgIHJldHVybiBZRVM7CisgICAgICAgIH0KKyAgICAgIGVs c2UKKyAgICAgICAgeworICAgICAgICAgIE5TVmlldyAqdmlldyA9IEZSQU1FX05TX1ZJRVcgKGYp OworICAgICAgICAgIGludCBpOworICAgICAgICAgIGZvciAoaSA9IDAgOyBpIDwgbiA7IGkrKykK KyAgICAgICAgICAgIFt2aWV3IHNldE5lZWRzRGlzcGxheUluUmVjdDpyW2ldXTsKKyAgICAgICAg fQorICAgIH0KKyAgcmV0dXJuIE5POworfQorCitzdGF0aWMgdm9pZAorbWNfbnNfZHJhd193aW5k b3dfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgs IHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKKyAgICAgICAgICAgICAgICAgIGludCB4LCBpbnQgZngs IGludCB5LCBpbnQgZnksIGludCBocG9zLCBpbnQgdnBvcywgaW50IHdkLCBpbnQgaCwKKyAgICAg ICAgICAgICAgICAgIGRvdWJsZSByZWQsIGRvdWJsZSBncmVlbiwgZG91YmxlIGJsdWUsIGVudW0g dHlwZV9vZl9jdXJzb3IgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICBpbnQgY3Vyc29y X3dpZHRoLCBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IsIGJvb2wgb25fcCwgYm9vbCBhY3Rp dmVfcCkKK3sKKyAgLyogVGhlIHByaW9yIGJ1ZyBvZiBhIGR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N10gPEVycm9yPjoKKyAgICAgICBDR0NvbnRleHRTZXRGaWxs Q29sb3JXaXRoQ29sb3I6IGludmFsaWQgY29udGV4dCAweDAuICovCisgIGlmICghbWNfbnNfY2xp cF90b19yZWN0IChmLCAmciwgMSwgcm93KSkKKyAgICByZXR1cm47CisgIGZhY2UgPSBGQUNFX0ZS T01fSUQgKGYsIGN1cnNvcl9nbHlwaC0+ZmFjZV9pZCk7CisvKiBFWEFNUExFIE9GIEhPVyBUTyBM T09LLVVQIEEgQ09MT1I6CisgICAgIGVudW0gZmFjZV9pZCBmYWNlX2lkID0gbG9va3VwX25hbWVk X2ZhY2UgKHcsIGYsIGludGVybiAoIistdmVydGljYWwtYmFyLWZhY2UiKSwgdHJ1ZSk7CisgICAg IHN0cnVjdCBmYWNlICpmYWNlID0gRkFDRV9GUk9NX0lEIChmLCBmYWNlX2lkKTsKKyAgICAgTlND b2xvciAqY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5E IChmYWNlKSwgZik7CisgIC0gIEVYQU1QTEUgT0YgSE9XIFRPIFBSSU5UIEEgQ09MT1IgVE8gU1RE RVJSOgorICAgICBMaXNwX09iamVjdCBmb3JlZ3JvdW5kID0gZmFjZS0+bGZhY2VbTEZBQ0VfRk9S RUdST1VORF9JTkRFWF07CisgICAgIExpc3BfT2JqZWN0IGJhY2tncm91bmQgPSBmYWNlLT5sZmFj ZVtMRkFDRV9CQUNLR1JPVU5EX0lOREVYXTsKKyAgICAgZnByaW50ZiAoc3RkZXJyLCAiXG5mb3Jl Z3JvdW5kICglcykgfCBiYWNrZ3JvdW5kICglcylcbiIsCisgICAgICAgICAgICAgICAgICAgICAg KCFOSUxQIChmb3JlZ3JvdW5kKSA/IFNTREFUQSAoZm9yZWdyb3VuZCkgOiAiTklMUCIpLAorICAg ICAgICAgICAgICAgICAgICAgICghTklMUCAoYmFja2dyb3VuZCkgPyBTU0RBVEEgKGJhY2tncm91 bmQpIDogIk5JTFAiKSk7CisgIC0gIEVYQU1QTEUgT0YgSE9XIFRPIENSRUFURSBBIENPTE9SIFdJ VEggUkdCL0xTTCBmbG9hdCB2YWx1ZXM6CisgICAgIE5TQ29sb3IgKm15X2NvbG9yID0gW05TQ29s b3IgY29sb3JXaXRoQ2FsaWJyYXRlZFJlZDogMS4wCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBncmVlbjogMS4wCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmx1ZTogMS4wCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHBoYTogMS4wXTsKKyAgLSAg QUxURVJOQVRJVkUgRVhBTVBMRToKKyAgICAgZW51bSBmYWNlX2lkIGRlYnVnZ2luZ19mYWNlX2lk ID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAoIistZGVidWdnaW5nLWZh Y2UiKSwgdHJ1ZSk7CisgICAgIHN0cnVjdCBmYWNlICpkZWJ1Z2dpbmdfZmFjZSA9IEZBQ0VfRlJP TV9JRCAocy0+ZiwgZGVidWdnaW5nX2ZhY2VfaWQpOworICAgICBOU0NvbG9yICpjb2xvciA9IG5z X2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQgKGRlYnVnZ2luZ19mYWNl KSwgcy0+Zik7CisgICAgIFtjb2xvciBzZXRdOyAqLworICBpZiAoZ2x5cGhfZmxhdm9yID09IE1D X0dMWVBICisgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEhMRVNTKQorICAgIFtbTlND b2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiByZWQgZ3JlZW46IGdyZWVuIGJsdWU6IGJsdWUg YWxwaGE6IDEuMF0gc2V0XTsKKyAgICBlbHNlCisgICAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChm KSBzZXRdOworICBpZiAoY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWCkKKyAgICB7CisgICAg ICBMaXNwX09iamVjdCBidWYgPSB3LT5jb250ZW50czsKKyAgICAgIENIRUNLX0JVRkZFUiAoYnVm KTsKKyAgICAgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSIChidWYpOworICAgICAgYm9vbCBy ZWdpb25fYWN0aXZlX3AgPSAoIU5JTFAgKFZ0cmFuc2llbnRfbWFya19tb2RlKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIG1hcmtfYWN0aXZlKSkpOwor ICAgICAgcHRyZGlmZl90IHJlZ2lvbl9iZWdpbm5pbmcgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IFhG SVhOVU0gKEZyZWdpb25fYmVnaW5uaW5nICgpKSA6IC0xOworICAgICAgcHRyZGlmZl90IHJlZ2lv bl9lbmQgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IFhGSVhOVU0gKEZyZWdpb25fZW5kICgpKSA6IC0x OworICAgICAgcHRyZGlmZl90IG9wb2ludF9wdCA9ICh3ID09IFhXSU5ET1cgKHNlbGVjdGVkX3dp bmRvdykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBQVAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogWEZJWE5VTSAoRm1hcmtlcl9wb3NpdGlvbiAody0+cG9pbnRtKSk7Cisg ICAgICBib29sIHJlZ2lvbl9pbl9ib3VuZHNfcCA9IChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF9wdCA+PSByZWdpb25fYmVnaW5uaW5n CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfcHQgPCByZWdpb25f ZW5kKTsKKyAgICAgIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICA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dmVfcCkKKyAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfaW5hY3RpdmVfZmFj ZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJz b3ItaW5hY3RpdmUtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAq aG9sbG93X2luYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19pbmFjdGl2ZV9m YWNlX2lkKTsKKyAgICAgICAgICAgICAgICBOU0NvbG9yICpob2xsb3dfaW5hY3RpdmVfY29sb3Ig PSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5EIChob2xsb3dfaW5h Y3RpdmVfZmFjZSksIGYpOworICAgICAgICAgICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19p bmFjdGl2ZV9jb2xvcjsKKyAgICAgICAgICAgICAgfQorICAgIH0KKyAgICBlbHNlIGlmIChmYWNl ICYmIE5TX0ZBQ0VfQkFDS0dST1VORCAoZmFjZSkgPT0gbnNfaW5kZXhfY29sb3IgKEZSQU1FX0NV UlNPUl9DT0xPUiAoZiksIGYpKQorICAgICAgeworICAgICAgICBbbnNfbG9va3VwX2luZGV4ZWRf Y29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoZmFjZSksIGYpIHNldF07CisgICAgICAgIGhvbGxv d19jb2xvciA9IEZSQU1FX0NVUlNPUl9DT0xPUiAoZik7CisgICAgICB9CisjaWZkZWYgTlNfSU1Q TF9DT0NPQQorICBOU0Rpc2FibGVTY3JlZW5VcGRhdGVzICgpOworI2VuZGlmCisgIHN3aXRjaCAo Y3Vyc29yX3R5cGUpCisgICAgeworICAgICAgY2FzZSBNQ19OT19GUklOR0VfQklUTUFQOgorICAg ICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfTk9fQ1VSU09SOgorICAgICAgICBicmVhazsKKyAg ICAgIGNhc2UgTUNfUklHSFRfRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgYnJlYWs7CisgICAgICBj YXNlIE1DX0xFRlRfRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1D X0ZJTExFRF9CT1g6CisgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICBicmVhazsKKyAg ICAgIGNhc2UgTUNfRlJBTUVEX0JPWDoKKyAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAg IFtob2xsb3dfY29sb3Igc2V0XTsKKyAgICAgICAgTlNSZWN0RmlsbCAoTlNJbnNldFJlY3QgKHIs IDEsIDEpKTsKKyAgICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAoZikgc2V0XTsKKyAgICAgICAg YnJlYWs7CisgICAgICBjYXNlIE1DX0hPTExPV19CT1g6CisgICAgICAgIE5TUmVjdEZpbGwgKHIp OworICAgICAgICBbaG9sbG93X2NvbG9yIHNldF07CisgICAgICAgIE5TUmVjdEZpbGwgKE5TSW5z ZXRSZWN0IChyLCAxLCAxKSk7CisgICAgICAgIFtGUkFNRV9DVVJTT1JfQ09MT1IgKGYpIHNldF07 CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19IQkFSOgorICAgICAgICBOU1JlY3RGaWxs IChyKTsKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1DX0JBUjoKKyAgICAgICAgcyA9IHI7 CisgICAgICAgIC8qIEBsYXdsaXN0IGlzIGZvY3VzaW5nIHRoZSBpbml0aWFsIGRldmVsb3BtZW50 IG9mIGZlYXR1cmUgcmVxdWVzdHMKKyAgICAgICAgIzE3Njg0IGFuZCAjMjI4NzMgb24gTDJSIGxh bmd1YWdlcy4gKi8KKyAgICAgICAgaWYgKGdseXBoX2ZsYXZvciAhPSBNQ19HTFlQSAorICAgICAg ICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX0dMWVBITEVTUykKKyAgICAgICAgICB7CisgICAg ICAgICAgICAvKiBJZiB0aGUgY2hhcmFjdGVyIHVuZGVyIGN1cnNvciBpcyBSMkwsIGRyYXcgdGhl IGJhciBjdXJzb3IKKyAgICAgICAgICAgICAgIG9uIHRoZSByaWdodCBvZiBpdHMgZ2x5cGgsIHJh dGhlciB0aGFuIG9uIHRoZSBsZWZ0LiAgKi8KKyAgICAgICAgICAgIGlmICgoY3Vyc29yX2dseXBo LT5yZXNvbHZlZF9sZXZlbCAmIDEpICE9IDApCisgICAgICAgICAgICAgIHMub3JpZ2luLnggKz0g Y3Vyc29yX2dseXBoLT5waXhlbF93aWR0aCAtIHMuc2l6ZS53aWR0aDsKKyAgICAgICAgICB9Cisg ICAgICAgIE5TUmVjdEZpbGwgKHMpOworICAgICAgICBicmVhazsKKyAgICB9CisgIG5zX3Jlc2V0 X2NsaXBwaW5nIChmKTsKKyAgLyogZHJhdyB0aGUgY2hhcmFjdGVyIHVuZGVyIHRoZSBjdXJzb3Ig Ki8KKyAgaWYgKGdseXBoX2ZsYXZvciAhPSBNQ19HTFlQSExFU1MKKyAgICAgICYmIChjdXJzb3Jf dHlwZSA9PSBNQ19GUkFNRURfQk9YCisgICAgICAgICAgfHwgY3Vyc29yX3R5cGUgPT0gTUNfRklM TEVEX0JPWAorICAgICAgICAgIHx8IGN1cnNvcl90eXBlID09IE1DX0hPTExPV19CT1gKKyAgICAg ICAgICB8fCAoZGVidWdfcAorICAgICAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19IQkFS KQorICAgICAgICAgIHx8IChkZWJ1Z19wCisgICAgICAgICAgICAgICYmIGN1cnNvcl90eXBlID09 IE1DX0JBUikpKQorICAgIHsKKyAgICAgIC8qIGBjdXJzb3JfZ2NfcGAgaXMgdXNlZCBvbmx5IGJ5 IGB3MzJ0ZXJtLmNgIGFuZCBgeHRlcm0uYycuICovCisgICAgICBib29sIGN1cn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UpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoZmFjZS0+dW5k ZXJsaW5lX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsKKyAgICAg ICAgICBlbHNlCisgICAgICAgICAgICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKGZhY2UtPnVu ZGVybGluZV9jb2xvciwgcy0+Zikgc2V0XTsKKyAgICAgICAgICBuc19kcmF3X3VuZGVyd2F2ZSAo cywgd2lkdGgsIHgpOworICAgICAgICB9CisgICAgICBlbHNlIGlmIChzLT5mYWNlLT51bmRlcmxp bmVfdHlwZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgIHsKKyAgICAgICAgICBOU1JlY3Qg cjsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIHRoaWNrbmVzcywgcG9zaXRpb247CisgICAgICAg ICAgLyogSWYgdGhlIHByZXYgd2FzIHVuZGVybGluZWQsIG1hdGNoIGl0cyBhcHBlYXJhbmNlLiAq LworICAgICAgICAgIGlmIChzLT5wcmV2ICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV9wCisg ICAgICAgICAgICAgICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5E RVJfTElORQorICAgICAgICAgICAgICAmJiBzLT5wcmV2LT51bmRlcmxpbmVfdGhpY2tuZXNzID4g MCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+cHJldi0+dW5k ZXJsaW5lX3RoaWNrbmVzczsKKyAgICAgICAgICAgICAgcG9zaXRpb24gPSBzLT5wcmV2LT51bmRl cmxpbmVfcG9zaXRpb247CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAg ICAgeworICAgICAgICAgICAgICBzdHJ1Y3QgZm9udCAqZm9udDsKKyAgICAgICAgICAgICAgdW5z aWduZWQgbG9uZyBkZXNjZW50OworICAgICAgICAgICAgICBmb250PXMtPmZvbnQ7CisgICAgICAg ICAgICAgIGRlc2NlbnQgPSBzLT55ICsgcy0+aGVpZ2h0IC0gcy0+eWJhc2U7CisgICAgICAgICAg ICAgIC8qIFVzZSB1bmRlcmxpbmUgdGhpY2tuZXNzIG9mIGZvbnQsIGRlZmF1bHRpbmcgdG8gMS4g Ki8KKyAgICAgICAgICAgICAgdGhpY2tuZXNzID0gKGZvbnQgJiYgZm9udC0+dW5kZXJsaW5lX3Ro aWNrbmVzcyA+IDApCisgICAgICAgICAgICAgICAgPyBmb250LT51bmRlcmxpbmVfdGhpY2tuZXNz IDogMTsKKyAgICAgICAgICAgICAgLyogRGV0ZXJtaW5lIHRoZSBvZmZzZXQgb2YgdW5kZXJsaW5p bmcgZnJvbSB0aGUgYmFzZWxpbmUuICovCisgICAgICAgICAgICAgIGlmICh4X3VuZGVybGluZV9h dF9kZXNjZW50X2xpbmUpCisgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBkZXNjZW50IC0gdGhp Y2tuZXNzOworICAgICAgICAgICAgICBlbHNlIGlmICh4X3VzZV91bmRlcmxpbmVfcG9zaXRpb25f cHJvcGVydGllcworICAgICAgICAgICAgICAgICAgICAgICAmJiBmb250ICYmIGZvbnQtPnVuZGVy bGluZV9wb3NpdGlvbiA+PSAwKQorICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gZm9udC0+dW5k ZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICBlbHNlIGlmIChmb250KQorICAgICAgICAg ICAgICAgIHBvc2l0aW9uID0gbHJvdW5kIChmb250LT5kZXNjZW50IC8gMik7CisgICAgICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHVuZGVybGluZV9taW5pbXVtX29m ZnNldDsKKyAgICAgICAgICAgICAgcG9zaXRpb24gPSBtYXggKHBvc2l0aW9uLCB1bmRlcmxpbmVf bWluaW11bV9vZmZzZXQpOworICAgICAgICAgICAgICAvKiBFbnN1cmUgdW5kZXJsaW5pbmcgaXMg bm90IGNyb3BwZWQuICovCisgICAgICAgICAgICAgIGlmIChkZXNjZW50IDw9IHBvc2l0aW9uKQor ICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gZGVzY2VudCAt IDE7CisgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAxOworICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgICAgZWxzZSBpZiAoZGVzY2VudCA8IHBvc2l0aW9uICsgdGhpY2tuZXNzKQor ICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IDE7CisgICAgICAgICAgICB9CisgICAgICAgICAg cy0+dW5kZXJsaW5lX3RoaWNrbmVzcyA9IHRoaWNrbmVzczsKKyAgICAgICAgICBzLT51bmRlcmxp bmVfcG9zaXRpb24gPSBwb3NpdGlvbjsKKyAgICAgICAgICByID0gTlNNYWtlUmVjdCAoeCwgcy0+ eWJhc2UgKyBwb3NpdGlvbiwgd2lkdGgsIHRoaWNrbmVzcyk7CisgICAgICAgICAgaWYgKGZhY2Ut PnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgIFtkZWZhdWx0Q29sIHNldF07Cisg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChmYWNl LT51bmRlcmxpbmVfY29sb3IsIHMtPmYpIHNldF07CisgICAgICAgICAgTlNSZWN0RmlsbCAocik7 CisgICAgICAgIH0KKyAgICB9CisgIC8qIERvIG92ZXJsaW5lLiBXZSBmb2xsb3cgb3RoZXIgdGVy bXMgaW4gdXNpbmcgYSB0aGlja25lc3Mgb2YgMQorICAgICBhbmQgaWdub3Jpbmcgb3ZlcmxpbmVf bWFyZ2luLiAqLworICBpZiAoZmFjZS0+b3ZlcmxpbmVfcCkKKyAgICB7CisgICAgICBOU1JlY3Qg cjsKKyAgICAgIHIgPSBOU01ha2VSZWN0ICh4LCBzLT55LCB3aWR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ZyBmcmluZ2Ug YW5kL29yIHNjcm9sbGJhciAqLworICAgICAgICBvdmVycnVuID0gbWF4ICgwLCAocy0+eCArIHMt PmJhY2tncm91bmRfd2lkdGgpCisgICAgICAgICAgIC0gKFdJTkRPV19CT1hfUklHSFRfRURHRV9Y IChzLT53KQorICAgICAgICAtIFdJTkRPV19SSUdIVF9GUklOR0VfV0lEVEggKHMtPncpKSk7Cisg ICAgICAgICAgICAgIHJbaV0uc2l6ZS53aWR0aCAtPSBvdmVycnVuOworICAgICAgICAvKiB0cnVu Y2F0ZSB0byBhdm9pZCBvdmVyd3JpdGluZyB0byBsZWZ0IG9mIHRoZSB3aW5kb3cgYm94ICovCisg ICAgICAgIGxlZnRvdmVycnVuID0gKFdJTkRPV19CT1hfTEVGVF9FREdFX1ggKHMtPncpCisgICAg ICAgICAgICsgV0lORE9XX0xFRlRfRlJJTkdFX1dJRFRIIChzLT53KSkgLSBzLT54OworICAgICAg ICBpZiAobGVmdG92ZXJydW4gPiAwKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIHJbaV0ub3Jp Z2luLnggKz0gbGVmdG92ZXJydW47CisgICAgICAgICAgICByW2ldLnNpemUud2lkdGggLT0gbGVm dG92ZXJydW47CisgICAgICAgICAgfQorICAgICAgICAgICAgICAvKiBYWFg6IFRyeSB0byB3b3Jr IGJldHdlZW4gcHJvYmxlbSB3aGVyZSBhIHN0cmV0Y2ggZ2x5cGggb24KKyAgICAgICAgICAgICAg ICAgYSBwYXJ0aWFsbHktdmlzaWJsZSBib3R0b20gcm93IHdpbGwgY2xlYXIgcGFydCBvZiB0aGUK KyAgICAgICAgICAgICAgICAgbW9kZWxpbmUsIGFuZCBhbm90aGVyIHdoZXJlIGxpc3QtYnVmZmVy cyBoZWFkZXJzIGFuZCBzaW1pbGFyCisgICAgICAgICAgICAgICAgIHJvd3MgZXJyb25lb3VzbHkg aGF2ZSB2aXNpYmxlX2hlaWdodCBzZXQgdG8gMC4gIE5vdCBzdXJlCisgICAgICAgICAgICAgICAg IHdoZXJlIHRoaXMgaXMgY29taW5nIGZyb20gYXMgb3RoZXIgdGVybXMgc2VlbSBub3QgdG8gc2hv dy4gKi8KKyAgICAgICAgICAgICAgcltpXS5zaXplLmhlaWdodCA9IG1pbiAocy0+aGVpZ2h0LCBz LT5yb3ctPnZpc2libGVfaGVpZ2h0KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBbYmdDb2wg c2V0XTsKKyAgICAgICAgICAvKiBOT1RFOiB1bmRlciBOUyB0aGlzIGlzIE5PVCB1c2VkIHRvIGRy YXcgY3Vyc29ycywgYnV0IHdlIG11c3QgYXZvaWQKKyAgICAgICAgICAgICBvdmVyd3JpdGluZyBj dXJzb3IgKHVzdWFsbHkgd2hlbiBjdXJzb3Igb24gYSB0YWIpICovCisgICAgICAgICAgaWYgKHMt PmhsID09IERSQVdfQ1VSU09SKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBGSVhN RTogIERvIHdlIHN0aWxsIG5lZWQgdG8gcHJldmVudCB0aGlzIHNlY3Rpb24gb2YgY29kZSBmcm9t CisgICAgICAgICAgICAgIGVyYXNpbmcgdGhlIGZha2UgTUNfSEJBUiB0aGF0IGV4dGVuZHMgdGhl IGVudGlyZSBsZW5ndGggb2YgdGhlCisgICAgICAgICAgICAgIFNUUkVUQ0hfR0xZUEg/ICBUaGlz IG1heSBoYXZlIGJlZW4gZG9uZSBwcmlvciB0byB0aGUgZml4IHJlbGF0aW5nCisgICAgICAgICAg ICAgIHRvIGxlZnQvcmlnaHQgb3ZlcndyaXR0ZW4gZ2x5cGhzLiAqLworICAgICAgICAgICAgICBy W2ldLnNpemUuaGVpZ2h0IC09IDE7CisgICAgICAgICAgICAgIC8vICBlbnVtIGZhY2VfaWQgZGVi dWdnaW5nX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ZiwgaW50ZXJuICgi Ky1kZWJ1Z2dpbmctZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgLy8gIHN0cnVjdCBmYWNl ICpkZWJ1Z2dpbmdfZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgZGVidWdnaW5nX2ZhY2VfaWQp OworICAgICAgICAgICAgICAvLyAgTlNDb2xvciAqY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9j b2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChkZWJ1Z2dpbmdfZmFjZSksIHMtPmYpOworICAgICAg ICAgICAgICAvLyAgW2NvbG9yIHNldF07CisgICAgICAgICAgICAgIENHRmxvYXQgeCA9IHJbaV0u b3JpZ2luLng7CisgICAgICAgICAgICAgIENHRmxvYXQgd2lkdGggPSB3ZDsKKyAgICAgICAgICAg ICAgcltpXS5zaXplLndpZHRoIC09IHdpZHRoOworICAgICAgICAgICAgICByW2ldLm9yaWdpbi54 ICs9IHdpZHRoOworICAgICAgICAgICAgICBOU1JlY3RGaWxsIChyW2ldKTsKKyAgICAgICAgICAg ICAgLyogRHJhdyBvdmVybGluaW5nLCBldGMuIG9uIHRoZSBjdXJzb3IuICovCisgICAgICAgICAg ICAgIGlmIChzLT53LT5waHlzX2N1cnNvcl90eXBlID09IE1DX0ZJTExFRF9CT1gpCisgICAgICAg ICAgICAgICAgbWNfbnNfZHJhd190ZXh0X2RlY29yYXRpb24gKHMsIGZhY2UsIGJnQ29sLCB3aWR0 aCwgeCk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgbWNfbnNfZHJh d190ZXh0X2RlY29yYXRpb24gKHMsIGZhY2UsIGZnQ29sLCB3aWR0aCwgeCk7CisgICAgICAgICAg ICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAvLyAgaW50IHJ4ID0gcltpXS5v cmlnaW4ueDsKKyAgLy8gIGludCByeSA9IHJbaV0ub3JpZ2luLnk7CisgIC8vICBpbnQgcncgPSBy W2ldLnNpemUud2lkdGg7CisgIC8vICBpbnQgcmggPSByW2ldLnNpemUuaGVpZ2h0OworICAvLyAg ZnByaW50ZiAoc3RkZXJyLCAibWNfbnNfZHVtcGdseXBoc19zdHJldGNoOiAgdnBvcyAoJWQpIHwg cnggKCVkKSB8IHJ5ICglZCkgfCBydyAoJWQpIHwgcmggKCVkKVxuIiwKKyAgLy8gICAgICAgICAg ICAgICAgICAgcy0+Zmlyc3RfZ2x5cGgtPnZwb3MsIHJ4LCByeSwgcncsIHJoKTsKKyAgICAgICAg ICAgICAgTlNSZWN0RmlsbCAocltpXSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgLyogRHJh dyBvdmVybGluaW5nLCBldGMuIG9uIHRoZSBzdHJldGNoIGdseXBoIChvciB0aGUgcGFydAorICAg ICAgICAgICAgIG9mIHRoZSBzdHJldGNoIGdseXBoIGFmdGVyIHRoZSBjdXJzb3IpLiAqLworICAg ICAgICAgIG1jX25zX2RyYXdfdGV4dF9kZWNvcmF0aW9uIChzLCBmYWNlLCBmZ0NvbCwgcltpXS5z aXplLndpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByW2ldLm9y aWdpbi54KTsKKyAgICAgICAgfQorICAgICAgbnNfcmVzZXRfY2xpcHBpbmcgKHMtPmYpOworICAg ICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IDE7CisgICAgfQorfQorCitzdGF0aWMgdm9pZAor bWNfbnNfZHVtcGdseXBoc19pbWFnZSAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgTlNSZWN0IHIs IGRvdWJsZSByZWQsIGRvdWJsZSBncmVlbiwgZG91YmxlIGJsdWUsCisgICAgICAgICAgICAgICAg ICAgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IsIGVudW0gdHlwZV9vZl9jdXJzb3Ig Y3Vyc29yX3R5cGUsIGJvb2wgYWN0aXZlX3ApCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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YnIgPSBOU01ha2VSZWN0IChiZ194LCBiZ195LCBzLT5iYWNrZ3JvdW5kX3dpZHRoLCBiZ19o ZWlnaHQpOworICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IDE7CisgICAgfQorICBlbHNl CisgICAgeworICAgICAgYnIgPSBOU01ha2VSZWN0ICh4LCB5LCBzLT5zbGljZS53aWR0aCwgcy0+ c2xpY2UuaGVpZ2h0KTsKKyAgICB9CisgIE5TUmVjdEZpbGwgKGJyKTsKKyAgLyogRHJhdyB0aGUg aW1hZ2UuLiBkbyB3ZSBuZWVkIHRvIGRyYXcgcGxhY2Vob2xkZXIgaWYgaW1nID09bmlsPyAqLwor ICBpZiAoaW1nICE9IG5pbCkKKyAgICB7CisjaWZkZWYgTlNfSU1QTF9DT0NPQQorICAgICAgTlNS ZWN0IGRyID0gTlNNYWtlUmVjdCAoeCwgeSwgcy0+c2xpY2Uud2lkdGgsIHMtPnNsaWNlLmhlaWdo dCk7CisgICAgICBOU1JlY3QgaXIgPSBOU01ha2VSZWN0IChzLT5zbGljZS54LCBzLT5zbGljZS55 LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+c2xpY2Uud2lkdGgsIHMtPnNsaWNl LmhlaWdodCk7CisgICAgICBbaW1nIGRyYXdJblJlY3Q6IGRyCisgICAgICAgICAgICAgZnJvbVJl Y3Q6IGlyCisgICAgICAgICAgICAgb3BlcmF0aW9uOiBOU0NvbXBvc2l0ZVNvdXJjZU92ZXIKKyAg ICAgICAgICAgICAgZnJhY3Rpb246IDEuMAorICAgICAgICAgICByZXNwZWN0RmxpcHBlZDogWUVT CisgICAgICAgICAgICAgICAgaGludHM6IG5pbF07CisjZWxzZQorICAgICAgW2ltZyBjb21wb3Np dGVUb1BvaW50OiBOU01ha2VQb2ludCAoeCwgeSArIHMtPnNsaWNlLmhlaWdodCkKKyAgICAgICAg ICAgICAgICAgIG9wZXJhdGlvbjogTlNDb21wb3NpdGVTb3VyY2VPdmVyXTs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lmIHJlcXVlc3RlZCAqLworICBpZiAocy0+aW1nLT5yZWxpZWYgfHwg cy0+aGwgPT1EUkFXX0lNQUdFX1JBSVNFRCB8fCBzLT5obCA9PURSQVdfSU1BR0VfU1VOS0VOKQor ICAgIHsKKyAgICAgIGlmIChzLT5obCA9PSBEUkFXX0lNQUdFX1NVTktFTiB8fCBzLT5obCA9PSBE UkFXX0lNQUdFX1JBSVNFRCkKKyAgICAgICAgeworICAgICAgICAgIHRoID0gdG9vbF9iYXJfYnV0 dG9uX3JlbGllZiA+PSAwID8KKyAgICAgICAgICAgIHRvb2xfYmFyX2J1dHRvbl9yZWxpZWYgOiBE RUZBVUxUX1RPT0xfQkFSX0JVVFRPTl9SRUxJRUY7CisgICAgICAgICAgcmFpc2VkX3AgPSAocy0+ aGwgPT0gRFJBV19JTUFHRV9SQUlTRUQpOworICAgICAgICB9CisgICAgICBlbHNlCisgICAgICAg IHsKKyAgICAgICAgICB0aCA9IGFicyAocy0+aW1nLT5yZWxpZWYpOworICAgICAgICAgIHJhaXNl ZF9wID0gKHMtPmltZy0+cmVsaWVmID4gMCk7CisgICAgICAgIH0KKyAgICAgIHIub3JpZ2luLngg PSB4IC0gdGg7CisgICAgICByLm9yaWdpbi55ID0geSAtIHRoOworICAgICAgci5zaXplLndpZHRo ID0gcy0+c2xpY2Uud2lkdGggKyAyKnRoLTE7CisgICAgICByLnNpemUuaGVpZ2h0ID0gcy0+c2xp Y2UuaGVpZ2h0ICsgMip0aC0xOworICAgICAgbnNfZHJhd19yZWxpZWYgKHIsIHRoLCByYWlzZWRf cCwKKyAgICAgICAgICAgICAgICAgICAgICBzLT5zbGljZS55ID09IDAsCisgICAgICAgICAgICAg ICAgICAgICAgcy0+c2xpY2UueSArIHMtPnNsaWNlLmhlaWdodCA9PSBzLT5pbWctPmhlaWdodCwK KyAgICAgICAgICAgICAgICAgICAgICBzLT5zbGljZS54ID09IDAsCisgICAgICAgICAgICAgICAg ICAgICAgcy0+c2xpY2UueCArIHMtPnNsaWNlLndpZHRoID09IHMtPmltZy0+d2lkdGgsIHMpOwor ICAgIH0KKyAgLyogSWYgdGhlcmUgaXMgbm8gbWFzaywgdGhlIGJhY2tncm91bmQgd29uJ3QgYmUg c2VlbiwKKyAgICAgc28gZHJhdyBhIHJlY3RhbmdsZSBvbiB0aGUgaW1hZ2UgZm9yIHRoZSBjdXJz b3IuCisgICAgIERvIHRoaXMgZm9yIGFsbCBpbWFnZXMsIGdldHRpbmcgdHJhbnNwYXJlbmN5IHJp Z2h0IGlzIG5vdCByZWxpYWJsZS4gICovCisgIGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUikKKyAg ICB7CisgICAgICBpbnQgdGhpY2tuZXNzID0gYWJzIChzLT5pbWctPnJlbGllZik7CisgICAgICBp ZiAodGhpY2tuZXNzID09IDApIHRoaWNrbmVzcyA9IDE7CisgICAgaWYgKGdseXBoX2ZsYXZvciA9 PSBNQ19HTFlQSAorICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEhMRVNTKQorICAg ICAgeworICAgICAgICBOU0NvbG9yICpib3JkZXJfY29sb3IgPSBbTlNDb2xvciBjb2xvcldpdGhD YWxpYnJhdGVkUmVkOiByZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBncmVlbjogZ3JlZW4KKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmx1ZTogYmx1ZQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscGhhOiAx LjBdOworICAgICAgICBuc19kcmF3X2JveCAoYnIsIHRoaWNrbmVzcywgYm9yZGVyX2NvbG9yLCAx LCAxKTsKKyAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgICAgbnNfZHJhd19ib3ggKGJyLCB0aGlj a25lc3MsIEZSQU1FX0NVUlNPUl9DT0xPUiAocy0+ZiksIDEsIDEpOworICAgIH0KK30KKworc3Rh dGljIHZvaWQKK21jX25zX292ZXJ3cml0dGVuX2hlbHBlciAoc3RydWN0IGdseXBoX3N0cmluZyAq cywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAg ICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGVudW0gdHlwZV9vZl9jYWNoZSBjYWNoZV90eXBlLAor ICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoKQoreworICAvLyBu c19kcmF3X3VuZGVyd2F2ZSAocywgcy0+d2lkdGgsIHMtPngpOworICBOU0NvbG9yICpob2xsb3df Y29sb3IgPSBGUkFNRV9CQUNLR1JPVU5EX0NPTE9SIChzLT5mKTsKKyAgc3RydWN0IGZhY2UgKmZh Y2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIERFRkFVTFRfRkFDRV9JRCk7CisgIGludCByb3dfdnBv cyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICBzdHJ1Y3QgbXVsdGlwbGVfY3Vy c29yc19jYWNoZSBmb29fZWx0czsKKyAgc3dpdGNoIChjYWNoZV90eXBlKQorICAgIHsKKyAgICAg IGNhc2UgTk9fQ0FDSEU6CisgICAgICAgIHsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQor ICAgICAgY2FzZSBNQ19DQUNIRToKKyAgICAgICAgeworICAgICAgICAgIGZvb19lbHRzLmNhY2hl cyA9IHMtPnctPm1jX2VsdHMuY2FjaGVzOworICAgICAgICAgIGZvb19lbHRzLmFsbG9jYXRlZCA9 IHMtPnctPm1jX2VsdHMuYWxsb2NhdGVkOworICAgICAgICAgIGZvb19lbHRzLnVzZWQgPSBzLT53 LT5tY19lbHRzLnVzZWQ7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGNhc2Ug Q0hfQ0FDSEU6CisgICAgICAgIHsK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xlZF9wOworICAgICAgYm9vbCBnb19wID0gKHZwb3MgPT0gcm93X3Zw b3MKKyAgICAgICAgICAgICAgICAgICAmJiBocG9zID09IGdseXBoLT5ocG9zCisgICAgICAgICAg ICAgICAgICAgJiYgZW5hYmxlZF9wKTsKKyAgICAgIGlmICghZ29fcCkKKyAgICAgICAgY29udGlu dWU7CisgICAgICBOU1JlY3QgcjsKKyAgICAgIHIub3JpZ2luLnggPSBmeDsKKyAgICAgIHIub3Jp Z2luLnkgPSBmeTsKKyAgICAgIHIuc2l6ZS5oZWlnaHQgPSBoOworICAgICAgci5zaXplLndpZHRo ID0gd2Q7CisgICAgICBkb3VibGUgdGVtcF9yZWQgPSBmZ19sc2wucmVkOworICAgICAgZG91Ymxl IHRlbXBfZ3JlZW4gPSBmZ19sc2wuZ3JlZW47CisgICAgICBkb3VibGUgdGVtcF9ibHVlID0gZmdf bHNsLmJsdWU7CisgICAgICAvKiBTb21lIG9mIHRoZXNlIHZhbHVlcyBjb21lIHRocm91Z2ggYXMg MS4wMDM5MDYsIHdoaWNoIGNhdXNlcyBhIGJyZWFrYWdlCisgICAgICBvZiB0aGUgY29sb3JzIGlu IHRoYXQgbXVsdGlwbGljYXRpb24gYnkgdGhlIGJhc2Ugd2lsbCBleGNlZWQgdGhlIGJhc2UuICov CisgICAgICBkb3VibGUgcmVkID0gKHRlbXBfcmVkID4gMS4wKQorICAgICAgICAgICAgICAgICAg ID8gMS4wCisgICAgICAgICAgICAgICAgICAgOiB0ZW1wX3JlZDsKKyAgICAgIGRvdWJsZSBncmVl biA9ICh0ZW1wX2dyZWVuID4gMS4wKQorICAgICAgICAgICAgICAgICAgICAgPyAxLjAKKyAgICAg ICAgICAgICAgICAgICAgIDogdGVtcF9ncmVlbjsKKyAgICAgIGRvdWJsZSBibHVlID0gKHRlbXBf Ymx1ZSA+IDEuMCkKKyAgICAgICAgICAgICAgICAgICAgPyAxLjAKKyAgICAgICAgICAgICAgICAg ICAgOiB0ZW1wX2JsdWU7CisgICAgICBbW05TQ29sb3IgY29sb3JXaXRoQ2FsaWJyYXRlZFJlZDog cmVkIGdyZWVuOiBncmVlbiBibHVlOiBibHVlIGFscGhhOiAxLjBdIHNldF07CisgIGlmIChjdXJz b3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YKQorICAgIHsKKyAgICAgIExpc3BfT2JqZWN0IGJ1ZiA9 IHMtPnctPmNvbnRlbnRzOworICAgICAgQ0hFQ0tfQlVGRkVSIChidWYpOworICAgICAgc3RydWN0 IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKGJ1Zik7CisgICAgICBib29sIHJlZ2lvbl9hY3RpdmVfcCA9 ICghTklMUCAoVnRyYW5zaWVudF9tYXJrX21vZGUpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiAhTklMUCAoQlZBUiAoYiwgbWFya19hY3RpdmUpKSk7CisgICAgICBwdHJkaWZmX3Qg cmVnaW9uX2JlZ2lubmluZyA9IChyZWdpb25fYWN0aXZlX3ApID8gWEZJWE5VTSAoRnJlZ2lvbl9i ZWdpbm5pbmcgKCkpIDogLTE7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2VuZCA9IChyZWdpb25f YWN0aXZlX3ApID8gWEZJWE5VTSAoRnJlZ2lvbl9lbmQgKCkpIDogLTE7CisgICAgICBwdHJkaWZm X3Qgb3BvaW50X3B0ID0gKHMtPncgPT0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93KSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IFBUCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiBYRklYTlVNIChGbWFya2VyX3Bvc2l0aW9uIChzLT53LT5wb2ludG0pKTsKKyAgICAgIGJvb2wg cmVnaW9uX2luX2JvdW5kc19wID0gKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgb3BvaW50X3B0ID49IHJlZ2lvbl9iZWdpbm5pbmcKKyAgICAgICAg ICAg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1mYWNlIiksIHRydWUpOworICAgICAgICAgICAg c3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfcmVnaW9uX291dF9mYWNlID0gRkFDRV9GUk9NX0lE IChzLT5mLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9vdXRfZmFjZV9pZCk7CisgICAgICAgICAgICBO U0NvbG9yICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9vdXRfY29sb3IgPSBuc19sb29rdXBfaW5kZXhl ZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChob2xsb3dfYWN0aXZlX3JlZ2lvbl9vdXRfZmFj ZSksIHMtPmYpOworICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2FjdGl2ZV9yZWdp b25fb3V0X2NvbG9yOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmICghcmVnaW9uX2Fj dGl2ZV9wICYmIGFjdGl2ZV9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBlbnVtIGZh Y2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMt PmYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1mYWNlIiksIHRydWUpOworICAgICAgICAg ICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChzLT5m LCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICBOU0NvbG9yICpob2xsb3df YWN0aXZlX2NvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfQkFDS0dST1VO RCAoaG9sbG93X2FjdGl2ZV9mYWNlKSwgcy0+Zik7CisgICAgICAgICAgICAgIGhvbGxvd19jb2xv ciA9IGhvbGxvd19hY3RpdmVfY29sb3I7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvKiBU aGUgcmVnaW9uIGlzIF9ub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Y3Vyc29y X3R5cGUpCisgICAgICAgIHsKKyAgICAgICAgICBjYXNlIE1DX05PX0ZSSU5HRV9CSVRNQVA6Cisg ICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBjYXNlIE1DX05PX0NVUlNPUjoKKyAgICAgICAg ICAgIGJyZWFrOworICAgICAgICAgIGNhc2UgTUNfUklHSFRfRlJJTkdFX0JJVE1BUDoKKyAgICAg ICAgICBjYXNlIE1DX0xFRlRfRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgICBjYXNlIE1DX0ZJTExF RF9CT1g6CisgICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAgIGJyZWFrOwor ICAgICAgICAgIGNhc2UgTUNfRlJBTUVEX0JPWDoKKyAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIp OworICAgICAgICAgICAgW2hvbGxvd19jb2xvciBzZXRdOworICAgICAgICAgICAgTlNSZWN0Rmls bCAoTlNJbnNldFJlY3QgKHIsIDEsIDEpKTsKKyAgICAgICAgICAgIFtGUkFNRV9DVVJTT1JfQ09M T1IgKHMtPmYpIHNldF07CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBjYXNlIE1DX0hP TExPV19CT1g6CisgICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAgIFtob2xs b3dfY29sb3Igc2V0XTsKKyAgICAgICAgICAgIE5TUmVjdEZpbGwgKE5TSW5zZXRSZWN0IChyLCAx LCAxKSk7CisgICAgICAgICAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChzLT5mKSBzZXRdOworICAg ICAgICAgICAgYnJlYWs7CisgICAgICAgICAgY2FzZSBNQ19IQkFSOgorICAgICAgICAgICAgTlNS ZWN0RmlsbCAocik7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBjYXNlIE1DX0JBUjoK KyAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAg IH0KKyAgIC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ICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICBzdHJ1Y3QgZm9udCAqZm9udCA9IHMtPmZhY2UtPmZvbnQ7CisgICAgICAgICAgICAgICAg aWYgKCFmb250KQorICAgICAgICAgICAgICAgICAgZm9udCA9IEZSQU1FX0ZPTlQgKHMtPmYpOwor ICAgICAgICAgICAgICAgIGJvb2wgd2l0aF9iZ19wID0gZmFsc2U7CisgICAgICAgICAgICAgICAg Zm9udC0+ZHJpdmVyLT5kcmF3IChzLCBzLT5jbXBfZnJvbSwgcy0+bmNoYXJzLCBzLT54LCBzLT55 YmFzZSwgd2l0aF9iZ19wKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorfQor CitzdGF0aWMgdm9pZAorbWNfbnNfZHJhd19vdmVyd3JpdHRlbiAoc3RydWN0IGdseXBoX3N0cmlu ZyAqcywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAg ICAgc3RydWN0IGdseXBoX3JvdyAqcm93LCBzdHJ1Y3QgZ2x5cGggKmdseXBoKQoreworICAvLyAg aW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgLy8gIGNsb2NrX3Qg Y2xvY2tfc3RhcnQgPSBjbG9jaygpOworICBtY19uc19vdmVyd3JpdHRlbl9oZWxwZXIgKHMsIG1h dHJpeCwgcm93LCBNQ19DQUNIRSwgZ2x5cGgpOworICBtY19uc19vdmVyd3JpdHRlbl9oZWxwZXIg KHMsIG1hdHJpeCwgcm93LCBDSF9DQUNIRSwgZ2x5cGgpOworICBtY19uc19vdmVyd3JpdHRlbl9o ZWxwZXIgKHMsIG1hdHJpeCwgcm93LCBGQ19DQUNIRSwgZ2x5cGgpOworICAvLyAgY2xvY2tfdCBj bG9ja19lbmQgPSBjbG9jaygpOworICAvLyAgZG91YmxlIGNwdV90aW1lX3VzZWQgPSAoKGRvdWJs ZSkgKGNsb2NrX2VuZCAtI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ICAgeworICAgICAg ICAgIHN0cnVjdCBmYWNlICpmYWNlOworICAgICAgICAgIGlmIChzLT5obCA9PSBEUkFXX01PVVNF X0ZBQ0UpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQg KHMtPmYsCisgICAgICAgICAgIE1PVVNFX0hMX0lORk8gKHMtPmYpLT5tb3VzZV9mYWNlX2ZhY2Vf aWQpOworICAgICAgICAgICAgICBpZiAoIWZhY2UpCisgICAgICAgICAgICAgICAgZmFjZSA9IEZB Q0VfRlJPTV9JRCAocy0+ZiwgTU9VU0VfRkFDRV9JRCk7CisgICAgICAgICAgICB9CisgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+Ziwgcy0+Zmlyc3Rf Z2x5cGgtPmZhY2VfaWQpOworICAgICAgICAgIGlmICghZmFjZS0+c3RpcHBsZSkKKyAgICAgICAg ICAgIFsoTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKSAhPSAwCisgICAgICAgICAgICAgID8gbnNf bG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoZmFjZSksIHMtPmYpCisg ICAgICAgICAgICAgIDogRlJBTUVfQkFDS0dST1VORF9DT0xPUiAocy0+ZikpIHNldF07CisgICAg ICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzdHJ1Y3QgbnNfZGlzcGxh eV9pbmZvICpkcHlpbmZvID0gRlJBTUVfRElTUExBWV9JTkZPIChzLT5mKTsKKyAgICAgICAgICAg ICAgW1tkcHlpbmZvLT5iaXRtYXBzW2ZhY2UtPnN0aXBwbGUtMV0uaW1nIHN0aXBwbGVNYXNrXSBz ZXRdOworICAgICAgICAgICAgfQorICAgICAgICAgIGlmIChzLT5obCAhPSBEUkFXX0NVUlNPUikK KyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgcy0+cmVjdGFuZ2xlX251a2VkX3AgPSB0cnVl OworICAgICAgICAgICAgICBOU1JlY3QgciA9IE5TTWFrZVJlY3QgKHMtPngsIHMtPnkgKyBib3hf bGluZV93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPmJhY2tn cm91bmRfd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzLT5oZWln aHQtMipib3hfbGluZV93aWR0aCk7CisgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAg ICAgICAgICAgfQorICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSAxOworICAgICAgfQorICAg IH0KK30KKworc3RhdGljIHZvaWQKK21jX25zX2RyYXdfZ2x5cGhfc3RyaW5nIChzdHJ1Y3QgZ2x5 cGhfc3RyaW5nICpzLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsIHN0cnVjdCBnbHlwaF9y b3cgKnJvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICBkb3VibGUgcmVkLCBkb3VibGUgZ3Jl ZW4sIGRvdWJsZSBibHVlLAorICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfZmxhdm9y IGdseXBoX2ZsYXZvciwgZW51bSB0eXBlX29mX2N1cnNvciBjdXJzb3JfdHlwZSwKKyAgICAgICAg ICAgICAgICAgICAgICAgICBpbnQgd2QsIGJvb2wgYWN0aXZlX3AsIGJvb2wgY3Vyc29yX2djX3Ap CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgRXh0ZXJuYWwgKFJJRik6IE1haW4gZHJhdy10 ZXh0IGNhbGwuCisgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworeworICAvKiBUT0RPIChvcHRpbWl6 ZSk6IGZvY3VzIGZvciBib3ggYW5kIGNvbnRlbnRzIGRyYXcgKi8KKyAgTlNSZWN0IHJbMl07Cisg IGludCBuLCBmbGFnczsKKyAgY2hhciBib3hfZHJhd25fcCA9IDA7CisgIHN0cnVjdCBmb250ICpm b250ID0gcy0+ZmFjZS0+Zm9udDsKKyAgaWYgKCFmb250KQorICAgIGZvbnQgPSBGUkFNRV9GT05U IChzLT5mKTsKKyAgTlNUUkFDRV9XSEVOIChOU1RSQUNFX0dST1VQX0dMWVBIUywgIm1jX25zX2Ry YXdfZ2x5cGhfc3RyaW5nIik7CisgIGlmIChzLT5uZXh0ICYmIHMtPnJpZ2h0X292ZXJoYW5nICYm ICFzLT5mb3Jfb3ZlcmxhcHMpCisgICAgeworICAgICAgaW50IHdpZHRoOworICAgICAgc3RydWN0 IGdseXBoX3N0cmluZyAqbmV4dDsKKyAgICAgIGZvciAod2lkdGggPSAwLCBuZXh0ID0gcy0+bmV4 dDsKKyAgICAgICAgICAgbmV4dCAmJiB3aWR0aCA8IHMtPnJpZ2h0X292ZXJoYW5nOworICAgICAg ICAgICB3aWR0aCArPSBuZXh0LT53aWR0aCwgbmV4dCA9IG5leHQtPm5leHQpCisgICAgICAgIGlm IChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSAhPSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICB7Cisg ICAgICAgICAgICBpZiAobmV4dC0+Zmlyc3RfZ2x5cGgtPnR5cGUgIT0gU1RSRVRDSF9HTFlQSCkK KyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5n X2NsaXBfcmVjdCAocy0+bmV4dCwgcik7CisgICAgICAgICAgICAgICAgaWYgKCFtY19uc19jbGlw X3RvX3JlY3QgKHMtPmYsIHIsIG4sIHJvdykpCisgICAgICAgICAgICAgICAgICByZXR1cm47Cisg ICAgICAgICAgICAgICAgbWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzLT5uZXh0 LCAxKTsKKyAgICAgICAgICAgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgIG1jX25zX2R1bXBnbHlwaHNfc3RyZXRjaCAocy0+bmV4dCwgd2QsIHJvdyk7CisgICAgICAg ICAgICAgICAgaWYgKChzLT5uZXh0LT5sZWZ0X292ZXJ3cml0dGVuX3AgfHwgcy0+bmV4dC0+cmln aHRfb3ZlcndyaXR0ZW5fcCkKKyAgICAgICAgICAgICAgICAgICAgJiYgcy0+bmV4dC0+YWN0aW9u X3R5cGUgPT0gTUNfRFJBV19HTFlQSCkKKyAgICAgICAgICAgICAgICAgIG1jX25zX2RyYXdfb3Zl cndyaXR0ZW4gKHMtPm5leHQsIG1hdHJpeCwgcm93LCBzLT5uZXh0LT5maXJzdF9nbHlwaCk7Cisg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG5leHQtPm51bV9jbGlwcyA9IDA7CisgICAgICAg ICAgfQorICAgIH0KKyAgaWYgKCFzLT5mb3Jfb3ZlcmxhcHMgJiYgcy0+ZmFjZS0+Ym94ICE9IEZB Q0VfTk9fQk9YCisgICAgICAmJiAocy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAor ICAgICAgICAgIHx8IHMtPmZpcnN0X2dseXBoLT50eXBlID09IENPTVBPU0lURV9HTFlQSCkpCisg ICAgeworICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAg ICAgIGlmICghbWNfbnNfY2xpcF90b19yZWN0IChzLT5mLCByLCBuLCByb3cpKQorICAgICAgICBy ZXR1cm47CisgICAgICBtY19uc19tYXliZV9kdW1wZ2x5cGhzX2JhY2tncm91bmQgKHMsIDEpOwor ICAgICAgb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JvdykpCisgICAgICAgIHJldHVybjsKKyAgICAg IGlmIChzLT5mb3Jfb3ZlcmxhcHMKKyAgICAgICAgICB8fCAocy0+Y21wX2Zyb20gPiAwCisgICAg ICAgICAgICAgICYmICEgcy0+Zmlyc3RfZ2x5cGgtPnUuY21wLmF1dG9tYXRpYykpCisgICAgICAg IHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSAxOworICAgICAgZWxzZQorICAgICAgICBtY19uc19t YXliZV9kdW1wZ2x5cGhzX2JhY2tncm91bmQgKHMsIHMtPmZpcnN0X2dseXBoLT50eXBlID09IENP TVBPU0lURV9HTFlQSCk7CisgICAgICBmbGFncyA9IHMtPmhsID09IERSQVdfQ1VSU09SID8gTlNf RFVNUEdMWVBIX0NVUlNPUiA6CisgICAgICAgIChzLT5obCA9PSBEUkFXX01PVVNFX0ZBQ0UgPyBO U19EVU1QR0xZUEhfTU9VU0VGQUNFIDoKKyAgICAgICAgIChzLT5mb3Jfb3ZlcmxhcHMgPyBOU19E VU1QR0xZUEhfRk9SRUdST1VORCA6CisgICAgICAgICAgTlNfRFVNUEdMWVBIX05PUk1BTCkpOwor ICAgICAgdW5zaWduZWQgbG9uZyBzYXZlZF9mZyA9IE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFj ZSk7CisgICAgICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IgJiYgY3Vyc29yX3R5cGUgPT0gTUNf RklMTEVEX0JPWCkKKyAgICAgICAgeworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgdG1wID0gTlNf RkFDRV9CQUNLR1JPVU5EIChzLT5mYWNlKTsKKyAgICAgICAgICBOU19GQUNFX0JBQ0tHUk9VTkQg KHMtPmZhY2UpID0gTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKTsKKyAgICAgICAgICBOU19G QUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2UpID0gdG1wOworICAgICAgICB9CisgICAgICAgIGVsc2Ug aWYgKHMtPmhsID09IERSQVdfQ1VSU09SCisgICAgICAgICAgICAgICAgICYmIGN1cnNvcl90eXBl ID09IE1DX0ZSQU1FRF9CT1gKKyAgICAgICAgICAgICAgICAgJiYgYWN0aXZlX3ApCisgICAgICAg ICAgeworICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfZmFjZV9pZCA9IGxv b2t1cF9uYW1lZF9mYWNlIChzLT53LCBzLT5mLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3It ZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2Zh Y2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAg ICAgICBOU19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2UpID0gTlNfRkFDRV9GT1JFR1JPVU5EICho b2xsb3dfYWN0aXZlX2ZhY2UpOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmIChzLT5o bCA9PSBEUkFXX0NVUlNPUgorICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl90eXBlID09IE1D X0ZSQU1FRF9CT1gKKyAgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcCkKKyAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkID0g bG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNv ci1pbmFjdGl2ZS1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9s bG93X2luYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIGhvbGxvd19pbmFjdGl2ZV9m YWNlX2lkKTsKKyAgICAgICAgICAgICAgTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKSA9IE5T X0ZBQ0VfRk9SRUdST1VORCAoaG9sbG93X2luYWN0aXZlX2ZhY2UpOworICAgICAgICAgICAgfQor ICAgICAgeworICAgICAgICBCT09MIGlzQ29tcG9zaXRlID0gcy0+Zmlyc3RfZ2x5cGgtPnR5cGUg PT0gQ09NUE9TSVRFX0dMWVBIOworICAgICAgICBpZiAoaXNDb21wb3NpdGUpCisgICAgICAgICAg bnNfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHMpOworICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgYm9vbCB3aXRoX2JnX3AgPSAoKGZs YWdzID09IE5TX0RVTVBHTFlQSF9OT1JNQUwgJiYgIXMtPmJhY2tncm91bmRfZmlsbGVkX3ApCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGZsYWdzID09IE5TX0RVTVBHTFlQSF9N T1VTRUZBQ0UpOworICAgICAgICAgICAgICBpZiAod2l0aF9iZ19wKQorICAgICAgICAgICAgICAg IHMtPmJhY2tncm91bmRfbnVrZWRfcCA9IHRydWU7CisgICAgICAgICAgICAgIGZvbnQtPmRyaXZl ci0+ZHJhdyAocywgcy0+Y21wX2Zyb20sIHMtPm5jaGFycywgcy0+eCwgcy0+eWJhc2UsIHdpdGhf YmdfcCk7CisgICAgICAgICAgICB9CisgICAgICB9CisgICAgICB7CisgICAgICAgIE5TQ29sb3Ig KmNvbCA9IChOU19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2UpICE9IDAKKyAgICAgICAgICAgICAg ICAgICAgICAgID8gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAo cy0+ZmFjZSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBzLT5mKQorICAgICAgICAgICAgICAgICAgICAgICAgOiBGUkFNRV9GT1JFR1JPVU5EX0NP TE9SIChzLT5mKSk7CisgICAgICAgIFtjb2wgc2V0XTsKKyAgICAgICAgLyogRHJhdyB1bmRlcmxp bmUsIG92ZXJsaW5lLCBzdHJpa2UtdGhyb3VnaC4gKi8KKyAgICAgICAgbWNfbnNfZHJhd190ZXh0 X2RlY29yYXRpb24gKHMsIHMtPmZhY2UsIGNvbCwgcy0+d2lkdGgsIHMtPngpOworICAgICAgfQor ICAgICAgeworICAgICAgICBpZiAocy0+Zmlyc3RfZ2x5cGgtPnR5cGUgIT0gQ09NUE9TSVRFX0dM WVBICisgICAgICAgICAgICAmJiAocy0+bGVmdF9vdmVyd3JpdHRlbl9wIHx8IHMtPnJpZ2h0X292 ZXJ3cml0dGVuX3ApCisgICAgICAgICAgICAmJiAocy0+YmFja2dyb3VuZF9udWtlZF9wIHx8IHMt PnJlY3RhbmdsZV9udWtlZF9wKQorICAgICAgICAgICAgJiYgcy0+YWN0aW9uX3R5cGUgPT0gTUNf RFJBV19HTFlQSCkKKyAgICAgICAgICBtY19uc19kcmF3X292ZXJ3cml0dGVuIChzLCBtYXRyaXgs IHJvdywgcy0+Zmlyc3RfZ2x5cGgpOworICAgICAgfQorICAgICAgaWYgKHMtPmhsID09IERSQVdf Q1VSU09SCisgICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gTUNfRklMTEVEX0JPWCkKKyAgICAg ICAgeworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgdG1wID0gTlNfRkFDRV9CQUNLR1JPVU5EIChz LT5mYWNlKTsKKyAgICAgICAgICBOU19GQUNFX0JBQ0tHUk9VTkQgKHMtPmZhY2UpID0gTlNfRkFD RV9GT1JFR1JPVU5EIChzLT5mYWNlKTsKKyAgICAgICAgICBOU19GQUNFX0ZPUkVHUk9VTkQgKHMt PmZhY2UpID0gdG1wOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKHMtPmhsID09IERSQVdf Q1VSU09SCisgICAgICAgICAgICAgICAgICYmIGN1cnNvcl90eXBlID09IE1DX0ZSQU1FRF9CT1gp CisgICAgICAgICAgTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKSA9IHNhdmVkX2ZnOworICAg ICAgbnNfcmVzZXRfY2xpcHBpbmcgKHMtPmYpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBHTFlQ SExFU1NfR0xZUEg6CisgICAgICBuID0gbnNfZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMs IHIpOworICAgICAgaWYgKCFtY19uc19jbGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4sIHJvdykpCisg ICAgICAgIHJldHVybjsKKyAgICAgIGlmIChzLT5mb3Jfb3ZlcmxhcHMgfHwgKHMtPmNtcF9mcm9t ID4gMAorICAgICAgICAgICAgJiYgISBzLT5maXJzdF9nbHlwaC0+dS5jbXAuYXV0b21hdGljKSkK KyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IDE7CisgICAgICBlbHNlCisgICAgICAg IG1jX25zX21heWJlX2R1bXBnbHlwaHNfYmFja2dyb3VuZCAocywgcy0+Zmlyc3RfZ2x5cGgtPnR5 cGUgPT0gQ09NUE9TSVRFX0dMWVBIKTsKKyAgICAgIC8qIC4uLiAqLworICAgICAgLyogTm90IHll dCBpbXBsZW1lbnRlZC4gICovCisgICAgICAvKiAuLi4gKi8KKyAgICAgIG5zX3Jlc2V0X2NsaXBw aW5nIChzLT5mKTsKKyAgICAgIGJyZWFrOworICAgIGRlZmF1bHQ6CisgICAgICBlbWFjc19hYm9y dCAoKTsKKyAgICB9CisgIC8qIERyYXcgYm94IGlmIG5vdCBkb25lIGFscmVhZHkuICovCisgIGlm ICghcy0+Zm9yX292ZXJsYXBzICYmICFib3hfZHJhd25fcCAmJiBzLT5mYWNlLT5ib3ggIT0gRkFD RV9OT19CT1gpCisgICAgeworICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0 IChzLCByKTsKKyAgICAgIGlmICghbWNfbnNfY2xpcF90b19yZWN0IChzLT5mLCByLCBuLCByb3cp KQorICAgICAgICByZXR1cm47CisgICAgICBuc19kdW1wZ2x5cGhzX2JveF9vcl9yZWxpZWYgKHMp OworICAgICAgbnNfcmVzZXRfY2xpcHBpbmcgKHMtPmYpOworICAgIH0KKyAgcy0+bnVtX2NsaXBz ID0gMDsKK30KKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworCisKIC8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAKICAgIE5TVFJBQ0UsIFRyYWNlIHN1 cHBvcnQuCkBAIC00ODAzLDYgKzU4OTUsMTcgQEAgaW4gY2VydGFpbiBzaXR1YXRpb25zIChyYXBp ZCBpbmNvbWluZyBldmVudHMpLgogICAgICAgYmFyID0gW1tFbWFjc1Njcm9sbGVyIGFsbG9jXSBp bml0RnJhbWU6IHIgd2luZG93OiB3aW5dOwogICAgICAgd3NldF92ZXJ0aWNhbF9zY3JvbGxfYmFy ICh3aW5kb3csIG1ha2VfbWludF9wdHIgKGJhcikpOwogICAgICAgdXBkYXRlX3AgPSBZRVM7CisK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAg ICAgIC8qIFRoaXMgaXMgb25seSBmb3IgZGVidWdnaW5nIHB1cnBvc2VzLiAqLworICAgICAgW2Jh ciBtY19zZXRfcmVjdGFuZ2xlOiByXTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog ICAgIH0KICAgZWxzZQogICAgIHsKQEAgLTQ4MTAsMTIgKzU5MTMsMzAgQEAgaW4gY2VydGFpbiBz aXR1YXRpb25zIChyYXBpZCBpbmNvbWluZyBldmVudHMpLgogICAgICAgYmFyID0gWE5TX1NDUk9M TF9CQVIgKHdpbmRvdy0+dmVydGljYWxfc2Nyb2xsX2Jhcik7CiAgICAgICBvbGRSZWN0ID0gW2Jh ciBmcmFtZV07CiAgICAgICByLnNpemUud2lkdGggPSBvbGRSZWN0LnNpemUud2lkdGg7CisKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgICAg IGlmIChGUkFNRV9MSVZFX1AgKGYpICYmICFOU0VxdWFsUmVjdHMgKG9sZFJlY3QsIHIpKQogICAg ICAgICB7CisgICAgICAgICAgLyogVGhlIG1haW4gd2luZG93IGhhcyBwcm9iYWJseSBiZWVuIHJl c2l6ZWQuICBHcmFjaW91c2x5IGRlbGV0ZSB0aGUKKyAgICAgICAgICBvbGQgc2Nyb2xsIGJhciB3 aXRob3V0IHJlcGFpbnRpbmcgaXRzIHJlY3RhbmdsZTsgYW5kLCBjcmVhdGUgYSBuZXcKKyAgICAg ICAgICBzY3JvbGwgYmFyIGVsc2V3aGVyZS4qLwogICAgICAgICAgIGlmIChvbGRSZWN0Lm9yaWdp bi54ICE9IHIub3JpZ2luLngpCisgICAgICAgICAgICB7CiAgICAgICAgICAgICAgIG5zX2NsZWFy X2ZyYW1lX2FyZWEgKGYsIGxlZnQsIHRvcCwgd2lkdGgsIGhlaWdodCk7CisgICAgICAgICAgICAg IFtiYXIgbWNfanVkZ2VdOworICAgICAgICAgICAgICBiYXIgPSBbW0VtYWNzU2Nyb2xsZXIgYWxs b2NdIGluaXRGcmFtZTogciB3aW5kb3c6IHdpbl07CisgICAgICAgICAgICAgIHdzZXRfdmVydGlj YWxfc2Nyb2xsX2JhciAod2luZG93LCBtYWtlX21pbnRfcHRyIChiYXIpKTsKKyAgICAgICAgICAg IH0KKyAgICAgICAgICAgIGVsc2UKICAgICAgICAgICBbYmFyIHNldEZyYW1lOiByXTsKICAgICAg ICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgfQogCiAgIGlmICh1cGRh dGVfcCkKQEAgLTQ5NzUsOSArNjA5Niw1MiBAQCBpbiBjZXJ0YWluIHNpdHVhdGlvbnMgKHJhcGlk IGluY29taW5nIGV2ZW50cykuCiAgICAgewogICAgICAgdmlldyA9IFtzdWJ2aWV3cyBvYmplY3RB dEluZGV4OiBpXTsKICAgICAgIGlmICghW3ZpZXcgaXNLaW5kT2ZDbGFzczogW0VtYWNzU2Nyb2xs ZXIgY2xhc3NdXSkgY29udGludWU7Ci0gICAgICBpZiAoW3ZpZXcganVkZ2VdKQorCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8qIGBYU0VU V0lORE9XJyB3aWxsIHNvbWV0aW1lcyBjYXVzZSBFbWFjcyB0byBjcmFzaCB3aGVuIHJ1bm5pbmcg dW5kZXIgZ2RiIGV2ZW4KKyAgdGhvdWdoICh3ICE9IE5VTEwpLiAgVGhlcmVmb3JlLCB3ZSBjYW5u b3QgcmVsaWFibHkgdXNlIGBXSU5ET1dfTElWRV9QJy4gKi8KKyAgc3RydWN0IHdpbmRvdyAqdyA9 IFt2aWV3IG1jX2dldF93aW5kb3ddOworICBpZiAodyAhPSBOVUxMCisgICAgICAmJiBOSUxQICh3 LT5jb250ZW50cykpCisgICAgeworICAgICAgQk9PTCBkZWJ1Z19wID0gZmFsc2U7CisgICAgICBO U1JlY3QgcjAgPSBbdmlldyBtY19nZXRfcmVjdGFuZ2xlXTsKKyAgICAgIGludCB4MCA9IE5TTWlu WCAocjApOworICAgICAgaW50IHkwID0gTlNNaW5ZIChyMCk7CisgICAgICBpbnQgd2QwID0gTlNX aWR0aCAocjApOworICAgICAgaW50IGgwID0gTlNIZWlnaHQgKHIwKTsKKyAgICAgIGludCB3aW5k b3dfeSwgd2luZG93X2hlaWdodDsKKyAgICAgIHdpbmRvd19ib3ggKHcsIEFOWV9BUkVBLCAwLCAm d2luZG93X3ksIDAsICZ3aW5kb3dfaGVpZ2h0KTsKKyAgICAgIGludCB0b3AgPSB3aW5kb3dfeTsK KyAgICAgIGludCBoZWlnaHQgPSB3aW5kb3dfaGVpZ2h0OworICAgICAgaW50IHdpZHRoID0gV0lO RE9XX0NPTkZJR19TQ1JPTExfQkFSX0NPTFMgKHcpICogRlJBTUVfQ09MVU1OX1dJRFRIIChmKTsK KyAgICAgIGludCBsZWZ0ID0gV0lORE9XX1NDUk9MTF9CQVJfQVJFQV9YICh3KTsKKyAgICAgIE5T UmVjdCByMSA9IE5TTWFrZVJlY3QgKGxlZnQsIHRvcCwgd2lkdGgsIGhlaWdodCk7CisgICAgICAv KiBUaGUgcGFyZW50IHZpZXcgaXMgZmxpcHBlZCwgc28gd2UgbmVlZCB0byBmbGlwIHkgdmFsdWUu ICovCisgICAgICBFbWFjc1ZpZXcgKmZyYW1lX3ZpZXcgPSBGUkFNRV9OU19WSUVXIChmKTsKKyAg ICAgIE5TUmVjdCB2ID0gW2ZyYW1lX3ZpZXcgZnJhbWVdOworICAgICAgcjEub3JpZ2luLnkgPSAo di5zaXplLmhlaWdodCAtIHIxLnNpemUuaGVpZ2h0IC0gcjEub3JpZ2luLnkpOworICAgICAgaW50 IHgxID0gTlNNaW5YIChyMSk7CisgICAgICBpbnQgeTEgPSBOU01pblkgKHIxKTsKKyAgICAgIGlu dCB3ZDEgPSBOU1dpZHRoIChyMSk7CisgICAgICBpbnQgaDEgPSBOU0hlaWdodCAocjEpOworICAg ICAgaWYgKGRlYnVnX3ApCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiVzIC0tIERFQUQ6XG5c CisgICAgICAgIHgwL3gxICglZC8lZCkgfCB5MC95MSAoJWQvJWQpIHwgd2QwL3dkMSAoJWQvJWQp IHwgaDAvaDEgKCVkLyVkKVxuIiwKKyAgICAgICAgbWNfd2luZG93ICh3KSwgeDAsIHgxLCB5MCwg eTEsIHdkMCwgd2QxLCBoMCwgaDEpOworICAgICAgaWYgKFt2aWV3IG1jX2p1ZGdlXSkKICAgICAg ICAgcmVtb3ZlZCA9IFlFUzsKICAgICB9CisgICAgZWxzZSBpZiAoW3ZpZXcganVkZ2VdKQorICAg ICAgcmVtb3ZlZCA9IFlFUzsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKworICAgIH0K IAogICBpZiAocmVtb3ZlZCkKICAgICBbZXZpZXcgdXBkYXRlRnJhbWVTaXplOiBOT107CkBAIC01 MTA2LDYgKzYyNzAsMjEgQEAgc3RhdGljIExpc3BfT2JqZWN0IG5zX3N0cmluZ190b19saXNwbW9k IChjb25zdCBjaGFyICpzKQogZXh0ZXJuIGZyYW1lX3Bhcm1faGFuZGxlciBuc19mcmFtZV9wYXJt X2hhbmRsZXJzW107CiBzdGF0aWMgc3RydWN0IHJlZGlzcGxheV9pbnRlcmZhY2UgbnNfcmVkaXNw bGF5X2ludGVyZmFjZSA9CiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgbnN0ZXJtLm1g IG11c3QgYmUgaW4gdGhlIGV4YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitgcmVkaXNwbGF5X2ludGVy ZmFjZScgaW4gYGRpc3BleHRlcm4uaGAhICovCisKKyAgbWNfeF93cml0ZV9nbHlwaHMsCisgIG1j X25zX2RyYXdfd2luZG93X2N1cnNvciwKKyAgbWNfbnNfZHJhd19nbHlwaF9zdHJpbmcsCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKICAgbnNfZnJhbWVfcGFybV9oYW5kbGVycywKICAg eF9wcm9kdWNlX2dseXBocywKICAgeF93cml0ZV9nbHlwaHMsCkBAIC04NzIxLDYgKzk5MDAsNDkg QEAgLSAoQk9PTCljYW5CZWNvbWVNYWluV2luZG93CiAKIEBpbXBsZW1lbnRhdGlvbiBFbWFjc1Nj cm9sbGVyCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JT ICovCisKKy0gKHZvaWQpbWNfc2V0X3JlY3RhbmdsZTogKE5TUmVjdClyZWN0Cit7CisgIG1jX3Jl Y3RhbmdsZSA9IHJlY3Q7Cit9CisKKy0gKE5TUmVjdCltY19nZXRfcmVjdGFuZ2xlCit7CisgIHJl dHVybiBtY19yZWN0YW5nbGU7Cit9CisKKy0gKHN0cnVjdCB3aW5kb3cgKiltY19nZXRfd2luZG93 Cit7CisgIHJldHVybiB3aW5kb3c7Cit9CisKKy0gKGJvb2wpbWNfanVkZ2UKK3sKKyAgTlNUUkFD RSAoIltFbWFjc1Njcm9sbGVyIG1jX2p1ZGdlXSIpOworICBib29sIHJldCA9IGNvbmRlbW5lZDsK KyAgYmxvY2tfaW5wdXQgKCk7CisgIGlmIChjb25kZW1uZWQpCisgICAgeworICAgICAgLyogZW5z dXJlIG90aGVyIHNjcm9sbGJhciB1cGRhdGVzIGFmdGVyIGRlbGV0aW9uICovCisgICAgICBFbWFj c1ZpZXcgKnZpZXcgPSAoRW1hY3N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cgKnMpCit7CisgIGVhc3NlcnQg KHMtPmZpcnN0X2dseXBoLT50eXBlID09IFNUUkVUQ0hfR0xZUEgpOworICBpZiAocy0+aGwgPT0g RFJBV19DVVJTT1IKKyAgICAgICYmICF4X3N0cmV0Y2hfY3Vyc29yX3ApCisgICAgeworICAgICAg LyogSWYgYHgtc3RyZXRjaC1jdXJzb3InIGlzIG5pbCwgZG9uJ3QgZHJhdyBhIGJsb2NrIGN1cnNv ciBhcworICAgd2lkZSBhcyB0aGUgc3RyZXRjaCBnbHlwaC4gICovCisgICAgICBpbnQgd2lkdGgs IGJhY2tncm91bmRfd2lkdGggPSBzLT5iYWNrZ3JvdW5kX3dpZHRoOworICAgICAgaW50IHggPSBz LT54OworICAgICAgaWYgKCFzLT5yb3ctPnJldmVyc2VkX3ApCisgIHsKKyAgICBpbnQgbGVmdF94 ID0gd2luZG93X2JveF9sZWZ0X29mZnNldCAocy0+dywgVEVYVF9BUkVBKTsKKyAgICBpZiAoeCA8 IGxlZnRfeCkKKyAgICAgIHsKKyAgICAgICAgYmFja2dyb3VuZF93aWR0aCAtPSBsZWZ0X3ggLSB4 OworICAgICAgICB4ID0gbGVmdF94OworICAgICAgfQorICB9CisgICAgICBlbHNlCisgIHsKKyAg ICAvKiBJbiBSMkwgcm93cywgZHJhdyB0aGUgY3Vyc29yIG9uIHRoZSByaWdodCBlZGdlIG9mIHRo ZQorICAgICAgIHN0cmV0Y2ggZ2x5cGguICAqLworICAgIGludCByaWdodF94ID0gd2luZG93X2Jv eF9yaWdodCAocy0+dywgVEVYVF9BUkVBKTsKKyAgICBpZiAoeCArIGJhY2tncm91bmRfd2lkdGgg PiByaWdodF94KQorICAgICAgYmFja2dyb3VuZF93aWR0aCAtPSB4IC0gcmlnaHRfeDsKKyAgICB4 ICs9IGJhY2tncm91bmRfd2lkdGg7CisgIH0KKyAgICAgIHdpZHRoID0gbWluIChGUkFNRV9DT0xV TU5fV0lEVEggKHMtPmYpLCBiYWNrZ3JvdW5kX3dpZHRoKTsKKyAgICAgIGlmIChzLT5yb3ctPnJl dmVyc2VkX3ApCisgIHggLT0gd2lkdGg7CisgICAgICAvKiBEcmF3IGN1cnNvci4gICovCisgICAg ICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JnX3JlY3QgKHMsIHgsIHMtPnksIHdpZHRoLCBzLT5oZWln aHQpOworICAgICAgLyogQ2xlYXIgcmVzdCB1c2luZyB0aGUgR0Mgb2YgdGhlIG9yaWdpbmFsIG5v bi1jdXJzb3IgZmFjZS4gICovCisgICAgICBpZiAod2lkdGggPCBiYWNrZ3JvdW5kX3dpZHRoKQor ICB7CisgICAgWEdDVmFsdWVzICpnYyA9IHMtPmZhY2UtPmdjOworICAgIGludCB5ID0gcy0+eTsK KyAgICBpbnQgdyA9IGJhY2tncm91bmRfd2lkdGggLSB3aWR0aCwgaCA9IHMtPmhlaWdodDsKKyAg ICBSRUNUIHI7CisgICAgICAgICAgSERDIGhkYyA9IHMtPmhkYzsKKyAgICBpZiAoIXMtPnJvdy0+ cmV2ZXJzZWRfcCkKKyAgICAgIHggKz0gd2lkdGg7CisgICAgZWxzZQorICAgICAgeCA9IHMtPng7 CisgICAgaWYgKHMtPnJvdy0+bW91c2VfZmFjZV9wCisgICAgICAgICYmIGN1cnNvcl9pbl9tb3Vz ZV9mYWNlX3AgKHMtPncpKQorICAgICAgeworICAgICAgICB4X3NldF9tb3VzZV9mYWNlX2djIChz KTsKKyAgICAgICAgZ2MgPSBzLT5nYzsKKyAgICAgIH0KKyAgICBlbHNlCisgICAgICBnYyA9IHMt PmZhY2UtPmdjOworICAgIGdldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCAmcik7CisgICAg dzMyX3NldF9jbGlwX3JlY3RhbmdsZSAoaGRjLCAmcik7CisjaWYgMCAvKiBUT0RPOiBzdGlwcGxl ICovCisgICAgaWYgKHMtPmZhY2UtPnN0aXBwbGUpCisgICAgICB7CisgICAgICAgIC8qIEZpbGwg YmFja2dyb3VuZCB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zLT5mYWNlKTsKKyAgaWYgKHMtPmhsID09 IERSQVdfTk9STUFMX1RFWFQpCisgICAgeworICAgICAgcy0+Z2MgPSBzLT5mYWNlLT5nYzsKKyAg ICAgIHMtPnN0aXBwbGVkX3AgPSBzLT5mYWNlLT5zdGlwcGxlICE9IDA7CisgICAgfQorICBlbHNl IGlmIChzLT5obCA9PSBEUkFXX0lOVkVSU0VfVklERU8pCisgICAgeworICAgICAgeF9zZXRfbW9k ZV9saW5lX2ZhY2VfZ2MgKHMpOworICAgICAgcy0+c3RpcHBsZWRfcCA9IHMtPmZhY2UtPnN0aXBw bGUgIT0gMDsKKyAgICB9CisgIGVsc2UgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SKQorICAgIHsK KyAgICAgIG1jX3czMl9zZXRfY3Vyc29yX2djIChzLCBjdXJzb3JfZ2NfcCk7CisgICAgICBzLT5z dGlwcGxlZF9wID0gZmFsc2U7CisgICAgfQorICBlbHNlIGlmIChzLT5obCA9PSBEUkFXX01PVVNF X0ZBQ0UpCisgICAgeworICAgICAgeF9zZXRfbW91c2VfZmFjZV9nYyAocyk7CisgICAgICBzLT5z dGlwcGxlZF9wID0gcy0+ZmFjZS0+c3RpcHBsZSAhPSAwOworICAgIH0KKyAgZWxzZSBpZiAocy0+ aGwgPT0gRFJBV19JTUFHRV9SQUlTRUQKKyAgICAgfHwgcy0+aGwgPT0gRFJBV19JTUFHRV9TVU5L RU4pCisgICAgeworICAgICAgcy0+Z2MgPSBzLT5mYWNlLT5nYzsKKyAgICAgIHMtPnN0aXBwbGVk X3AgPSBzLT5mYWNlLT5zdGlwcGxlICE9IDA7CisgICAgfQorICBlbHNlCisgICAgZW1hY3NfYWJv cnQgKCk7CisgIC8qIEdDIG11c3QgaGF2ZSBiZWVuIHNldC4gICovCisgIGVhc3NlcnQgKHMtPmdj ICE9IDApOworfQorCisvKiBEcmF3IGEgaG9sbG93IGJveCBjdXJzb3Igb24gd2luZG93IFcgaW4g Z2x5cGggcm93IFJPVy4gICovCitzdGF0aWMgdm9pZAorbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNv ciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3Qg Z2x5cGhfcm93ICpyb3csIGludCB4LCBpbnQgZngsIGludCB5LCBpbnQgZnksIGludCBocG9zLCBp bnQgdnBvcywgaW50IHdkLCBpbnQgaCkKK3sKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChX SU5ET1dfRlJBTUUgKHcpKTsKKyAgSERDIGhkYzsKKyAgUkVDVCByZWN0OworICBIQlJVU0ggaGIg PSBDcmVhdGVTb2xpZEJydXNoIChmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCk7Cisg IC8qIEdldCB0aGUgZ2x5cGggdGhlIGN1cnNvciBpcyBvbi4gIElmIHdlIGNhbid0IHRlbGwgYmVj YXVzZQorICAgICB0aGUgY3VycmVudCBtYXRyaXggaXMgaW52YWxpZCBvciBzdWNoLCBnaXZlIHVw LiAgKi8KKyAgc3RydWN0IGdseXBoICpjdXJzb3JfZ2x5cGggPSBtY19nZXRfY3Vyc29yX2dseXBo ICh3LCBtYXRyaXgsIHJvdywgaHBvcywgdnBvcyk7CisgIGlmIChjdXJzb3JfZ2x5cGggPT0gTlVM TCkKKyAgICB7CisgICAgICBEZWxldGVPYmplY3QgKGhiKTsKKyAgICAgIHJldHVybjsKKyAgICB9 CisgIGludCBybCA9IGZ4OworICBpbnQgcnQgPSBmeTsKKyAgaW50IHJyID0gcmwgKyB3ZDsKKyAg aW50IHJiID0gcnQgKyBoOworLyoKKyAgZnByaW50ZiAoc3RkZXJyLCAiTUNfSE9MTE9XX0JPWDog IHJsICglZCkgfCBydCAoJWQpIHwgcnIgKCVkKSB8IHJiICglZClcbiIsIHJsLCBydCwgcnIsIHJi KTsKKyovCisgIHJlY3QubGVmdCA9IHJsOworICByZWN0LnRvcCA9IHJ0OworICByZWN0LnJ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ywgZiwgaW50 ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgIHN0 cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19h Y3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgIGdjX3ZhbHVlcy5mb3JlZ3JvdW5kID0gaG9s bG93X2FjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICBnY192YWx1ZXMuYmFj a2dyb3VuZCA9IGhvbGxvd19hY3RpdmVfcmVnaW9uX2ZhY2UtPmJhY2tncm91bmQ7CisgICAgICAg ICAgICB9CisgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAg ICAgICAgICAgICYmICFyZWdpb25faW5fYm91bmRzX3AKKyAgICAgICAgICAgICAgICAgICAgICYm IGFjdGl2ZV9wKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lk IGhvbGxvd19hY3RpdmVfcmVnaW9uX291dF9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcs IGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1yZWdpb24tZmFjZSIpLCB0cnVlKTsKKyAg ICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9yZWdpb25fb3V0X2ZhY2Ug PSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfcmVnaW9uX291dF9mYWNlX2lkKTsKKyAg ICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3Vw X25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1mYWNlIiksIHRy dWUpOworICAgICAgICAgICAgICAgIHN0cnVjdCBmYWN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c29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICAgIH0KKyAg ICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIC8qIFRlbXBvcmFyaWx5 IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MnIGJ5IGJvcnJvd2luZyB0aGUK KyAgICAgICAgICAgICAgZnVuY3Rpb25hbGl0eSBvZiBgeF9tYWtlX2djJyBpbiB3MzJmbnMuYy4g ICovCisgICAgICAgICAgICAgIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAg ICYmIHJlZ2lvbl9pbl9ib3VuZHNfcAorICAgICAgICAgICAgICAgICAgJiYgYWN0aXZlX3ApCisg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19h Y3RpdmVfcmVnaW9uX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgi Ky1yZWFsLWZha2UtY3Vyc29yLXJlZ2lvbi1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAg ICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfcmVnaW9uX2ZhY2UgPSBGQUNFX0ZST01fSUQg KGYsIGhvbGxvd19hY3RpdmVfcmVnaW9uX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgZW51 bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBm LCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAg ICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYs IGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICBnY192Y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QgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7Cisg ICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5iYWNrZ3JvdW5kID0gaG9sbG93X2FjdGl2ZV9y ZWdpb25fb3V0X2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgICAgICBlbHNlIGlmICghcmVnaW9uX2FjdGl2ZV9wICYmIGFjdGl2ZV9wKQorICAgICAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxv d19hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJl YWwtZmFrZS1jdXJzb3ItZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICBzdHJ1 Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0 aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5mb3JlZ3JvdW5k ID0gaG9sbG93X2FjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICAgICAgICAg IGdjX3ZhbHVlcy5iYWNrZ3JvdW5kID0gaG9sbG93X2FjdGl2ZV9mYWNlLT5iYWNrZ3JvdW5kOwor ICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIC8qIFRoZSByZWdpb24g aXMgX25vdF8gdmlzaWJsZSBpbiB0aGUgaW5hY3RpdmUgd2luZG93IGJlY2F1c2UgdGhlIG92ZXJs YXkgd2luZG93IHByb3BlcnR5IGlzIHVzZWQuICovCisgICAgICAgICAgICAgICAgICAgIGVsc2Ug aWYgKCFhY3RpdmVfcCkKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICAgICAgIC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vciwgY3Vyc29yX3R5cGUsIHdkLCBh Y3RpdmVfcCwgY3Vyc29yX2djX3ApOworICAgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzIt PmN1cnNvcl9nYyA9IG9yaWdpbmFsX2N1cnNvcl9nYzsKKyAgICAgICAgICAgICAgdW5ibG9ja19p bnB1dCAoKTsKKyAgICAgICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0 cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgICAg fQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfSE9MTE9XX0JPWDoKKyAgICB7Cisg ICAgICBpZiAocmVkID49IDAgJiYgYmx1ZSA+PSAwICYmIGdyZWVuID49IDApCisgICAgICAgIHsK KyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vy c29yX3BpeGVsJy4gICovCisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4 ZWwgPSBjb2xvcl9waXhlbDsKKyAgICAgICAgICBtY193MzJfZHJhd19ob2xsb3dfY3Vyc29yICh3 LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICAg ICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4 ZWw7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIG1jX3czMl9kcmF3X2hvbGxv d19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBo KTsKKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAgewor ICAgICAgaWYgKHJlZCA+PSAwICYmIGJsdWUgPj0gMCAmJiBncmVlbiA+PSAwKQorICAgICAgICB7 CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1 cnNvcl9nYycgYnkgYm9ycm93aW5nIHRoZQorICAgICAgICAgIGZ1bmN0aW9uYWxpdHkgb2YgYHhf bWFrZV9nYycgaW4gdzMyZm5zLmMuICAqLworICAgICAgICAgIGJsb2NrX2lucHV0ICgpOworICAg ICAgICAgIFhHQ1ZhbHVlcyBnY192YWx1ZXM7CisgICAgICAgICAgdW5zaWduZWQgbG9uZyBtYXNr ID0gR0NGb250IHwgR0NGb3JlZ3JvdW5kIHwgR0NCYWNrZ3JvdW5kOworICAgICAgICAgIGdjX3Zh bHVlcy5mb250ID0gRlJBTUVfRk9OVCAoZik7CisgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91 bmQgPSBGUkFNRV9CQUNLR1JPVU5EX1BJWEVMIChmKTsKKyAgICAgICAgICBnY192YWx1ZXMuYmFj a2dyb3VuZCA9IGNvbG9yX3BpeGVsOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vy c29yX2djID0gWENyZWF0ZUdDIChOVUxMLCBGUkFNRV9XMzJfV0lORE9XIChmKSwgbWFzaywgJmdj X3ZhbHVlcyk7CisgICAgICAgICAgLyogRm9yY2UgYG1jX3czMl9zZXRfY3Vyc29yX2djJyB0byB1 c2UgYHMtPmYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djJy4gICovCisgICAgICAgICAgYm9v bCBjdXJzb3JfZ2NfcCA9IHRydWU7CisgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcs IG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgcmVkLCBncmVlbiwgYmx1ZSwgZ2x5cGhfZmxhdm9yLCBjdXJzb3Jf dHlwZSwgd2QsIGFjdGl2ZV9wLCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgZi0+b3V0cHV0X2Rh dGEudzMyLT5jdXJzb3JfZ2MgPSBvcmlnaW5hbF9jdXJzb3JfZ2M7CisgICAgICAgICAgdW5ibG9j a19pbnB1dCAoKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAg ICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNfZHJhd19jdXJz b3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWQsIGdyZWVuLCBibHVlLCBnbHlwaF9m bGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsIGN1cnNvcl9nY19wKTsKKyAgICAgICAg ICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBNQ19CQVI6CisgICAgeworICAgICAg aWYgKHJlZCA+PSAwICYmIGJsdWUgPj0gMCAmJiBncmVlbiA+PSAwKQorICAgICAgICB7CisgICAg ICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9w aXhlbCcuICAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0g Y29sb3JfcGl4ZWw7CisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9 IHRydWU7CisgICAgICAgICAgbWNfdzMyX2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3cs IHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsIGN1cnNvcl93aWR0aCwgTUNfQkFSLCBj dXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMy LT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgIH0KKyAgICAg ICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlzaWJs ZV9va2F5X3AgPSBmYWxzZTsKKyAgICAgICAgICAgIG1jX3czMl9kcmF3X2Jhcl9jdXJzb3IgKHcs IG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLCBjdXJzb3Jfd2lk dGgsIE1DX0JBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIH0KKyAg ICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0hCQVI6CisgICAgeworICAgICAgaWYgKHJl ZCA+PSAwICYmIGJsdWUgPj0gMCAmJiBncmVlbiA+PSAwKQorICAgICAgICB7CisgICAgICAgICAg LyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcu ICAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gY29sb3Jf cGl4ZWw7CisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IHRydWU7 CisgICAgICAgICAgbWNfdzMyX2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4 LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsIGN1cnNvcl93aWR0aCwgTUNfSEJBUiwgY3Vyc29y X2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vy c29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVs c2UKKyAgICAgICAgICB7CisgICAgICAg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MsIHRydWUpOworICAgICAgeF9kcmF3X2NvbXBvc2l0ZV9n bHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAgICBicmVhazsKKyAgICBjYXNlIEdMWVBI TEVTU19HTFlQSDoKKyAgICAgIGlmIChzLT5mb3Jfb3ZlcmxhcHMpCisgICAgICAgIHMtPmJhY2tn cm91bmRfZmlsbGVkX3AgPSB0cnVlOworICAgICAgZWxzZQorICAgICAgICB4X2RyYXdfZ2x5cGhf c3RyaW5nX2JhY2tncm91bmQgKHMsIGZhbHNlKTsKKyAgICAgIHhfZHJhd19nbHlwaGxlc3NfZ2x5 cGhfc3RyaW5nX2ZvcmVncm91bmQgKHMpOworICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoKKyAg ICAgIGVtYWNzX2Fib3J0ICgpOworICAgIH0KKyAgaWYgKCFzLT5mb3Jfb3ZlcmxhcHMpCisgICAg eworICAgICAgLyogRHJhdyB1bmRlcmxpbmUuICAqLworICAgICAgaWYgKHMtPmZhY2UtPnVuZGVy bGluZV9wKQorICAgICAgICB7CisgICAgICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBl ID09IEZBQ0VfVU5ERVJfV0FWRSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgQ09MT1JS RUYgY29sb3I7CisgICAgICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVk X3ApCisgICAgICAgICAgICAgICAgY29sb3IgPSBzLT5nYy0+Zm9yZWdyb3VuZDsKKyAgICAgICAg ICAgICAgZWxzZQorICAgICAgICAgICAgICAgIGNvbG9yID0gcy0+ZmFjZS0+dW5kZXJsaW5lX2Nv bG9yOworICAgICAgICAgICAgICB3MzJfZHJhd191bmRlcndhdmUgKHMsIGNvbG9yKTsKKyAgICAg ICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBG QUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHVuc2lnbmVkIGxv bmcgdGhpY2tuZXNzLCBwb3NpdGlvbjsKKyAgICAgICAgICAgICAgaW50IHk7CisgICAgICAgICAg ICAgIGlmIChzLT5wcmV2ICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV9wCisgICAgICAgICAg ICAgICAgICAmJiBzLT5wcmV2LT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX0xJ TkUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgLyogV2UgdXNlIHRoZSBz YW1lIHVuZGVybGluZSBzdHlsZSBhcyB0aGUgcHJldmlvdXMgb25lLiAgKi8KKyAgICAgICAgICAg ICAgICAgIHRoaWNrbmVzcyA9IHMtPnByZXYtPnVuZGVybGluZV90aGlja25lc3M7CisgICAgICAg ICAgICAgICAgICBwb3NpdGlvbiA9IHMtPnByZXYtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVybGluZSB0aGlja25lc3MuICBEZWZhdWx0IGlz IDEgcGl4ZWwuICAqLworICAgICAgICAgICAgICAgICAgaWYgKHMtPmZvbnQgJiYgcy0+Zm9udC0+ dW5kZXJsaW5lX3RoaWNrbmVzcyA+IDApCisgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9 IHMtPmZvbnQtPnVuZGVybGluZV90aGlja25lc3M7CisgICAgICAgICAgICAgICAgICBlbHNlCisg ICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IDE7CisgICAgICAgICAgICAgICAgICBpZiAo eF91bmRlcmxpbmVfYXRfZGVzY2VudF9saW5lKQorICAgICAgICAgICAgICAgICAgICBwb3NpdGlv biA9IChzLT5oZWlnaHQgLSB0aGlja25lc3MpIC0gKHMtPnliYXNlIC0gcy0+eSk7CisgICAgICAg ICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAg ICAgICAvKiBHZXQgdGhlIHVuZGVybGluZSBwb3NpdGlvbi4gIFRoaXMgaXMgdGhlIHJlY29tbWVu ZGVkCisgICAgICAgICAgICAgICAgICAgICAgICAgdmVydGljYWwgb2Zmc2V0IGluIHBpeGVscyBm cm9tIHRoZSBiYXNlbGluZSB0byB0aGUgdG9wIG9mCisgICAgICAgICAgICAgICAgICAgICAgICAg dGhlIHVuZGVybGluZS4gIFRoaXMgaXMgYSBzaWduZWQgdmFsdWUgYWNjb3JkaW5nIHRvIHRoZQor ICAgICAgICAgICAgICAgICAgICAgICAgIHNwZWNzLCBhbmQgaXRzIGRlZmF1bHQgaXMKKyAgICAg ICAgICAgICAgICAgICAgICAgICBST1VORCAoKG1heGltdW1fZGVzY2VudCkgLyAyKSwgd2l0aAor ICAgICAgICAgICAgICAgICAgICAgICAgIFJPVU5EICh4KSA9IGZsb29yICh4ICsgMC41KSAgKi8K KyAgICAgICAgICAgICAgICAgICAgICBpZiAoeF91c2VfdW5kZXJsaW5lX3Bvc2l0aW9uX3Byb3Bl cnRpZXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcy0+Zm9udCAmJiBzLT5mb250LT51 bmRlcmxpbmVfcG9zaXRpb24gPj0gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9u ID0gcy0+Zm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICAgICAgICAgIGVs c2UgaWYgKHMtPmZvbnQpCisgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5m b250LT5kZXNjZW50ICsgMSkgLyAyOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAg ICAgICAgICBwb3NpdGlvbiA9IG1heCAocG9zaXRpb24sIHVuZGVybGluZV9taW5pbXVtX29mZnNl dCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAvKiBDaGVjayB0aGUgc2FuaXR5 IG9mIHRoaWNrbmVzcyBhbmQgcG9zaXRpb24uICBXZSBzaG91bGQKKyAgICAgICAgICAgICAgICAg YXZvaWQgZHJhd2luZyB1bmRlcmxpbmUgb3V0IG9mIHRoZSBjdXJyZW50IGxpbmUgYXJlYS4gICov CisgICAgICAgICAgICAgIGlmIChzLT55ICsgcy0+aGVpZ2h0IDw9IHMtPnliYXNlICsgcG9zaXRp b24pCisgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+aGVpZ2h0IC0gMSkgLSAocy0+eWJh c2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQgPCBzLT55YmFz ZSArIHBvc2l0aW9uICsgdGhpY2tuZXNzKQorICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IChz LT55ICsgcy0+aGVpZ2h0KSAtIChzLT55YmFzZSArIHBvc2l0aW9uKTsKKyAgICAgICAgICAgICAg cy0+dW5kZXJsaW5lX3RoaWNrbmVzcyA9IHRoaWNrbmVzczsKKyAgICAgICAgICAgICAgcy0+dW5k ZXJsaW5lX3Bvc2l0aW9uID1wb3NpdGlvbjsKKyAgICAgICAgICAgICAgeSA9IHMtPnliYXNlICsg cG9zaXRpb247CisgICAgICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVk X3ApCisgICAgICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5nYy0+ Zm9yZWdyb3VuZCwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5LCBzLT53 aWR0aCwgMSk7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB3MzJfZmlsbF9h cmVhIChzLT5mLCBzLT5oZGMsIHMtPmZhY2UtPnVuZGVybGluZV9jb2xvciwgcy0+eCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICB5LCBzLT53aWR0aCwgMSk7CisgICAgICAgICAgICB9 CisgICAgICAgIH0KKyAgICAgIC8qIERyYXcgb3ZlcmxpbmUuICAqLworICAgICAgaWYgKHMtPmZh Y2UtPm92ZXJsaW5lX3ApCisgICAgICAgIHsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIGR5ID0g MCwgaCA9IDE7CisgICAgICAgICAgaWYgKHMtPmZhY2UtPm92ZXJsaW5lX2NvbG9yX2RlZmF1bHRl ZF9wKQorICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5nYy0+Zm9y ZWdyb3VuZCwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPnkgKyBkeSwgcy0+ d2lkdGgsIGgpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICB3MzJfZmlsbF9hcmVh IChzLT5mLCBzLT5oZGMsIHMtPmZhY2UtPm92ZXJsaW5lX2NvbG9yLCBzLT54LAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBzLT55ICsgZHksIHMtPndpZHRoLCBoKTsKKyAgICAgICAgfQor ICAgICAgLyogRHJhdyBzdHJpa2UtdGhyb3VnaC4gICovCisgICAgICBpZiAocy0+ZmFjZS0+c3Ry aWtlX3Rocm91Z2hfcAorICAgICAgICAgICYmICFGT05UX1RFWFRNRVRSSUMgKHMtPmZvbnQpLnRt U3RydWNrT3V0KQorICAgICAgICB7CisgICAgICAgICAgdW5zaWduZWQgbG9uZyBoID0gMTsKKyAg ICAgICAgICB1bnNpZ25lZCBsb25nIGR5ID0gKHMtPmhlaWdodCAtIGgpIC8gMjsKKyAgICAgICAg ICBpZiAocy0+ZmFjZS0+c3RyaWtlX3Rocm91Z2hfY29sb3JfZGVmYXVsdGVkX3ApCisgICAgICAg ICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmdjLT5mb3JlZ3JvdW5kLCBzLT54 LCBzLT55ICsgZHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICBzLT53aWR0aCwgaCk7Cisg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBz LT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9jb2xvciwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgIHMtPnkgKyBkeSwgcy0+d2lkdGgsIGgpOworICAgICAgICB9CisgICAgICAvKiBEcmF3 IHJlbGllZiBpZiBub3QgeWV0IGRyYXduLiAgKi8KKyAgICAgIGlmICghcmVsaWVmX2RyYXduX3Ag JiYgcy0+ZmFjZS0+Ym94ICE9IEZBQ0VfTk9fQk9YKQorICAgICAgICB4X2RyYXdfZ2x5cGhfc3Ry aW5nX2JveCAocyk7CisgICAgICBpZiAocy0+cHJldikKKyAgICAgICAgeworICAgICAgICAgIHN0 cnVjdCBnbHlwaF9zdHJpbmcgKnByZXY7CisgICAgICAgICAgZm9yIChwcmV2ID0gcy0+cHJldjsg cHJldjsgcHJldiA9IHByZXYtPnByZXYpCisgICAgICAgICAgICBpZiAocHJldi0+aGwgIT0gcy0+ aGwKKyAgICAgICAgICAgICAgICAmJiBwcmV2LT54ICsgcHJldi0+d2lkdGggKyBwcmV2LT5yaWdo dF9vdmVyaGFuZyA+IHMtPngpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBB cyBwcmV2IHdhcyBkcmF3biB3aGlsZSBjbGlwcGVkIHRvIGl0cyBvd24gYXJlYSwgd2UKKyAgICAg ICAgICAgICAgICAgICBtdXN0IGRyYXcgdGhlIHJpZ2h0X292ZXJoYW5nIHBhcnQgdXNpbmcgcy0+ aGwgbm93LiAgKi8KKyAgICAgICAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2Ugc2F2ZSA9 IHByZXYtPmhsOworICAgICAgICAgICAgICAgIHByZXYtPmhsID0gcy0+aGw7CisgICAgICAgICAg ICAgICAgbWNfdzMyX3NldF9nbHlwaF9zdHJpbmdfZ2MgKHByZXYsIGN1cnNvcl9nY19wKTsKKyAg ICAgICAgICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywgcHJl dik7CisgICAgICAgICAgICAgICAgaWYgKHByZXYtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJf R0xZUEgpCisgICAgICAgICAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQg KHByZXYpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIHhfZHJhd19j b21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHByZXYpOworICAgICAgICAgICAgICAg IHczMl9zZXRfY2xpcF9yZWN0YW5nbGUgKHByZXYtPmhkYywgTlVMTCk7CisgICAgICAgICAgICAg ICAgcHJldi0+aGwgPSBzYXZlOworICAgICAgICAgICAgICAgIHByZXYtPm51bV9jbGlwcyA9IDA7 CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKHMtPm5leHQpCisgICAgICAg IHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpuZXh0OworICAgICAgICAgIGZvciAo bmV4dCA9IHMtPm5leHQ7IG5leHQ7IG5leHQgPSBuZXh0LT5uZXh0KQorICAgICAgICAgICAgaWYg KG5leHQtPmhsICE9IHMtPmhsCisgICAgICAgICAgICAgICAgJiYgbmV4dC0+eCAtIG5leHQtPmxl ZnRfb3ZlcmhhbmcgPCBzLT54ICsgcy0+d2lkdGgpCisgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAvKiBBcyBuZXh0IHdpbGwgYmUgZHJhd24gd2hpbGUgY2xpcHBlZCB0byBpdHMgb3du IGFyZWEsCisgICAgICAgICAgICAgICAgICAgd2UgbXVzdCBkcmF3IHRoZSBsZWZ0X292ZXJoYW5n IHBhcnQgdXNpbmcgcy0+aGwgbm93LiAgKi8KKyAgICAgICAgICAgICAgICBlbnVtIGRyYXdfZ2x5 cGhzX2ZhY2Ugc2F2ZSA9IG5leHQtPmhsOworICAgICAgICAgICAgICAgIG5leHQtPmhsID0gcy0+ aGw7CisgICAgICAgICAgICAgICAgbWNfdzMyX3NldF9nbHlwaF9zdHJpbmdfZ2MgKG5leHQsIGN1 cnNvcl9nY19wKTsKKyAgICAgICAgICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdf ZXhhY3RseSAocywgbmV4dCk7CisgICAgICAgICAgICAgICAgaWYgKG5leHQtPmZpcnN0X2dseXBo LT50eXBlID09IENIQVJfR0xZUEgpCisgICAgICAgICAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3Ry aW5nX2ZvcmVncm91bmQgKG5leHQpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICAgIHhfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5leHQpOwor ICAgICAgICAgICAgICAgIHczMl9zZXRfY2xpcF9yZWN0YW5nbGUgKG5leHQtPmhkYywgTlVMTCk7 CisgICAgICAgICAgICAgICAgbmV4dC0+aGwgPSBzYXZlOworICAgICAgICAgICAgICAgIG5leHQt Pm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgICAgICAgbmV4dC0+Y2xpcF9oZWFkID0gcy0+bmV4 dDsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAvKiBSZXNldCBjbGlwcGlu Zy4gICovCisgIHczMl9zZXRfY2xpcF9yZWN0YW5nbGUgKHMtPmhkYywgTlVMTCk7CisgIHMtPm51 bV9jbGlwcyA9IDA7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq K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ogICAg ICAgICAgIE1vdmVXaW5kb3cgKGh3bmQsIGxlZnQsIHRvcCwgd2lkdGgsIG1heCAoaGVpZ2h0LCAx KSwgVFJVRSk7ICoqLwotCSAgLyogVHJ5IHRvIG5vdCBkcmF3IG92ZXIgY2hpbGQgZnJhbWVzLiAg Ki8KLQkgIFNldFdpbmRvd1BvcyAoaHduZCwgSFdORF9CT1RUT00sIGxlZnQsIHRvcCwgd2lkdGgs IG1heCAoaGVpZ2h0LCAxKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIFNXUF9GUkFNRUNIQU5H RUQpOworICAgICAgICAgIGlmIChsZWZ0IDw9IGJhci0+bGVmdCkKKyAgICAgICAgICAgIG15X3No b3dfd2luZG93IChmLCBod25kLCBTV19ISURFKTsKKyAgICAgICAgICBNb3ZlV2luZG93IChod25k LCBsZWZ0LCB0b3AsIHdpZHRoLCBtYXggKGhlaWdodCwgMSksIGxlZnQgPD0gYmFyLT5sZWZ0KTsK KworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor CiAKIAkgIHNpLmNiU2l6ZSA9IHNpemVvZiAoc2kpOwogCSAgc2kuZk1hc2sgPSBTSUZfUkFOR0U7 CkBAIC00MzE2LDYgKzUyMzUsMjEgQEAgdzMyX2p1ZGdlX3Njcm9sbF9iYXJzIChzdHJ1Y3QgZnJh bWUgKmYpCiAgICAgewogICAgICAgc3RydWN0IHNjcm9sbF9iYXIgKmIgPSBYU0NST0xMX0JBUiAo YmFyKTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMg Ki8KKworICAgICAgLyogYERlc3Ryb3lXaW5kb3cnIHdpdGhpbiBgeF9zY3JvbGxfYmFyX3JlbW92 ZScgcmVwYWludHMgdGhlIHJlY3RhbmdsZS4KKyAgICAgIFRoZXJlZm9yZSwgd2UgZmlyc3Qgc2Vu ZCBhIG1lc3NhZ2UgdG8gaW5oaWJpdCByZXBhaW50aW5nLiAqLworICAgICAgaWYgKCFXSU5ET1df TElWRV9QIChiLT53aW5kb3cpKQorICAgICAgICB7CisgICAgICAgICAgSFdORCBod25kID0gU0NS T0xMX0JBUl9XMzJfV0lORE9XIChiKTsKKyAgICAgICAgICBTZW5kTWVzc2FnZSAoaHduZCwgV01f U0VUUkVEUkFXLCBmYWxzZSwgMCk7CisgICAgICAgIH0KKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogICAgICAgeF9zY3JvbGxfYmFyX3JlbW92ZSAoYik7CiAKICAgICAgIG5leHQgPSBi LT5uZXh0OwpAQCAtNzA5MSw2ICs4MDI1LDIxIEBAIGV4dGVybiBmcmFtZV9wYXJtX2hhbmRsZXIg dzMyX2ZyYW1lX3Bhcm1faGFuZGxlcnNbXTsKIAogc3RhdGljIHN0cnVjdCByZWRpc3BsYXlfaW50 ZXJmYWNlIHczMl9yZWRpc3BsYXlfaW50ZXJmYWNlID0KIHsKKworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyogYHJlZGlzcGxheV9pbnRlcmZh Y2UnIGluIGB3MzJ0ZXJtLmNgIG11c3QgYmUgaW4gdGhlIGV4YWN0IHNhbWUgb3JkZXIgYXMgdGhl CitgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYGRpc3BleHRlcm4uaGAhICovCisKKyAgbWNfeF93 cml0ZV9nbHlwaHMsCisgIG1jX3czMl9kcmF3X3dpbmRvd19jdXJzb3IsCisgIG1jX3czMl9kcmF3 X2dseXBoX3N0cmluZywKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICB3MzJfZnJh bWVfcGFybV9oYW5kbGVycywKICAgeF9wcm9kdWNlX2dseXBocywKICAgeF93cml0ZV9nbHlwaHMs CmRpZmYgLS1naXQgYS9zcmMvd2luZG93LmggYi9zcmMvd2luZG93LmgKaW5kZXggZmRlZjQwNy4u NTRkMzY0OCAxMDA2NDQKLS0tIGEvc3JjL3dpbmRvdy5oCisrKyBiL3NyYy93aW5kb3cuaApAQCAt ODgsNiArODgsODAgQEAgZGlzcGxheSB0aGUgbWVudSBiYXIgb3IgdGhlIHRvb2wgYmFyICh3aGVu IEVtYWNzIHVzZXMgdG9vbGtpdHMgdGhhdAogZG9uJ3QgZGlzcGxheSB0aGVpciBvd24gbWVudSBi YXIgYW5kIHRvb2wgYmFyKSBvciBhIHRvb2x0aXAgaW4gYQogdG9vbHRpcCBmcmFtZSAod2hlbiB0 b29sdGlwcyBhcmUgbm90IGRpc3BsYXkgYnkgdGhlIHRvb2xraXQpLiAgKi8KIAorCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyogU3VmZml4ZXMg Zm9yIHRoZSBgbWNgIHdpbmRvdyBwb2ludGVyIHByZWZpeC4gKi8KK3N0cnVjdCBtdWx0aXBsZV9j dXJzb3JzCit7CisgIC8qIFRoZSByZWNvcmRlZCBwaXhlbCB3aWR0aCBvZiB0aGUgbGFzdCBsaW5l IG51bWJlciBkcmF3biBkdXJpbmcgcmVkaXNwbGF5ICovCisgIGludCBsbnVtX3BpeGVsX3dpZHRo OworfTsKKworc3RydWN0IG11bHRpcGxlX2N1cnNvcnNfY2FjaGUKK3sKKyAgcHRyZGlmZl90IGFs bG9jYXRlZDsKKyAgcHRyZGlmZl90IHVzZWQ7CisgIGVudW0gdHlwZV9vZl9jYWNoZQorICAgIHsK KyAgICAgIE5PX0NBQ0hFLAorICAgICAgTUNfQ0FDSEUsCisgICAgICBDSF9DQUNIRSwKKyAgICAg IEZDX0NBQ0hFCisgICAgfSBjYWNoZV90eXBlOworICBzdHJ1Y3QgaXRlbXMKKyAgICB7CisgICAg ICBpbnQgeDsKKyAgICAgIGludCBmeDsKKyAgICAgIGludCB5OworICAgICAgaW50IGZ5OworICAg ICAgaW50IGhwb3M7CisgICAgICBpbnQgdnBvczsKKyAgICAgIGludCB3ZDsKKyAgICAgIGludCBo OworICAgICAgZW51bSB0eXBlX29mX2N1cnNvcgorICAgICAgICB7CisgICAgICAgICAgLyogTk9U RTogIFRoZSBmcmluZ2UgYml0bWFwIGZyYW1ld29yayByZWxpZXMgdXBvbiBNQ19OT19GUklOR0Vf QklUTUFQCisgICAgICAgICAgSEFWSU5HIEEgVkFMVUUgT0YgWkVSTyAoMCkuICovCisgICAgICAg ICAgTUNfTk9fRlJJTkdFX0JJVE1BUCwKKyAgICAgICAgICBNQ19OT19DVVJTT1IsCisgICAgICAg ICAgTUNfUklHSFRfRlJJTkdFX0JJVE1BUCwKKyAgICAgICAgICBNQ19MRUZUX0ZSSU5HRV9CSVRN QVAsCisgICAgICAgICAgTUNfRlJBTUVEX0JPWCwKKyAgICAgICAgICBNQ19GSUxMRURfQk9YLAor ICAgICAgICAgIE1DX0hPTExPV19CT1gsCisgICAgICAgICAgTUNfQkFSLAorICAgICAgICAgIE1D X0hCQVIKKyAgICAgICAgfSBjdXJzb3JfdHlwZTsKKyAgICAgIGludCBjdXJzb3Jfd2lkdGg7Cisg ICAgICBzdHJ1Y3QgUkdCCisgICAgICAgIHsKKyAgICAgICAgICBkb3VibGUgcmVkOworICAgICAg ICAgIGRvdWJsZSBncmVlbjsKKyAgICAgICAgICBkb3VibGUgYmx1ZTsKKyAgICAgICAgfSBmb3Jl Z3JvdW5kLCBiYWNrZ3JvdW5kOworICAgICAgYm9vbCBhY3RpdmVfcDsKKyAgICAgIGVudW0gbWNf Zmxhdm9yCisgICAgICAgIHsKKyAgICAgICAgICBOT19GTEFWT1IsCisgICAgICAgICAgTUNfR0xZ UEgsCisgICAgICAgICAgTUNfR0xZUEhMRVNTLAorICAgICAgICAgIE1DX09WRVJMQVlfQVJST1df QklUTUFQLAorICAgICAgICAgIE1DX1BJTENST1csCisgICAgICAgICAgTUNfSE9MTE9XX1JFQ1RB TkdMRV9SSUdIVF9BUlJPVywKKyAgICAgICAgICBNQ19IT0xMT1dfUkVDVEFOR0xFLAorICAgICAg ICAgIE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVywKKyAgICAgICAgICBNQ19WRVJUSUNBTF9C QVIsCisgICAgICAgICAgTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICB9IGdseXBo X2ZsYXZvcjsKKyAgICAgIGJvb2wgZW5hYmxlZF9wOworICAgIH0gKmNhY2hlczsKK307CisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKIHN0cnVjdCBjdXJzb3JfcG9zCiB7CiAgIC8qIFBp eGVsIHBvc2l0aW9uLiAgVGhlc2UgYXJlIGFsd2F5cyB3aW5kb3cgcmVsYXRpdmUuICAqLwpAQCAt MzI0LDYgKzM5OCwyMSBAQCBzdHJ1Y3Qgd2luZG93CiAKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNU RU0KIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8K KworICAgIHN0cnVjdCBtdWx0aXBsZV9jdXJzb3JzIG1jOworCisgICAgc3RydWN0IG11bHRpcGxl X2N1cnNvcnNfY2FjaGUgbWNfZWx0czsKKworICAgIHN0cnVjdCBtdWx0aXBsZV9jdXJzb3JzX2Nh Y2hlIGNoX2VsdHM7CisKKyAgICBzdHJ1Y3QgbXVsdGlwbGVfY3Vyc29yc19jYWNoZSBmY19lbHRz OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgLyogQ3Vyc29yIHR5cGUgb2Yg bGFzdCBjdXJzb3IgZHJhd24gb24gdGhlIHdpbmRvdy4gICovCiAgICAgZW51bSB0ZXh0X2N1cnNv cl9raW5kcyBwaHlzX2N1cnNvcl90eXBlOwogCkBAIC0xMTIwLDYgKzEyMDksMTUgQEAgZXh0ZXJu IHZvaWQgcmVkaXNwbGF5X290aGVyX3dpbmRvd3MgKHZvaWQpOwogCiBzdHJ1Y3QgZ2x5cGggKmdl dF9waHlzX2N1cnNvcl9nbHlwaCAoc3RydWN0IHdpbmRvdyAqdyk7CiAKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKK3N0cnVjdCBnbHlwaCAqbWNf Z2V0X2N1cnNvcl9nbHlwaCAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAq bWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCBocG9zLCBpbnQgdnBvcyk7CisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKIC8qIFRydWUgaWYgV0lORE9XIGlzIGEgdmFsaWQg d2luZG93LiAgKi8KICNkZWZpbmUgV0lORE9XX1ZBTElEX1AoV0lORE9XKQkJCQkJXAogICAoV0lO RE9XUCAoV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fWCk7CQlcCisJICAgICAgYnJlYWs7CQkJCQkJCVwKKwkJCQkJCQkJCVwKKwkgICAgY2FzZSBJ TUFHRV9HTFlQSDoJCQkJCQlcCisJICAgICAgTUNfQlVJTERfSU1BR0VfR0xZUEhfU1RSSU5HIChT VEFSVCwgRU5ELCBIRUFELCBUQUlMLAkJXAorCQkJCQlITCwgWCwgTEFTVF9YKTsJCQlcCisJICAg ICAgYnJlYWs7CisKKyNkZWZpbmUgTUNfQlVJTERfR0xZUEhfU1RSSU5HU19YVyhTVEFSVCwgRU5E LCBIRUFELCBUQUlMLCBITCwgWCwgTEFTVF9YKQlcCisgICAgICAgICAgICBjYXNlIFhXSURHRVRf R0xZUEg6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAg ICAgICAgIE1DX0JVSUxEX1hXSURHRVRfR0xZUEhfU1RSSU5HIChTVEFSVCwgRU5ELCBIRUFELCBU QUlMLCAgICAgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBI TCwgWCwgTEFTVF9YKTsgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgIGJyZWFrOworCisj ZGVmaW5lIE1DX0JVSUxEX0dMWVBIX1NUUklOR1NfMihTVEFSVCwgRU5ELCBIRUFELCBUQUlMLCBI TCwgWCwgTEFTVF9YKQlcCisJICAgIGNhc2UgR0xZUEhMRVNTX0dMWVBIOgkJCQkJXAorCSAgICAg IE1DX0JVSUxEX0dMWVBITEVTU19HTFlQSF9TVFJJTkcgKFNUQVJULCBFTkQsIEhFQUQsIFRBSUws CVwKKwkJCQkJICAgIEhMLCBYLCBMQVNUX1gpOwkJXAorCSAgICAgIGJyZWFrOwkJCQkJCQlcCisJ CQkJCQkJCQlcCisJICAgIGRlZmF1bHQ6CQkJCQkJCVwKKwkgICAgICBlbWFjc19hYm9ydCAoKTsJ CQkJCQlcCisJICAgIH0JCQkJCQkJCVwKKwkJCQkJCQkJCVwKKwkgIGl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cyAqIDQ7 CQkJCQkJXAorICAgIGVsc2UJCQkJCQkJCVwKKyAgICAgIHsJCQkJCQkJCQlcCisJaWYgKGRwICE9 IDAgJiYgVkVDVE9SUCAoRElTUF9DSEFSX1ZFQ1RPUiAoZHAsIGNoKSkpCQlcCisJICB3aWR0aCA9 IHNhbml0aXplX2NoYXJfd2lkdGggKEFTSVpFIChESVNQX0NIQVJfVkVDVE9SIChkcCwgY2gpKSk7 IFwKKwllbHNlCQkJCQkJCQlcCisJICB3aWR0aCA9IENIQVJBQ1RFUl9XSURUSCAoY2gpOwkJCQkJ XAorICAgICAgfQkJCQkJCQkJCVwKKyAgfSB3aGlsZSAoMCkKKworTGlzcF9PYmplY3QKK21jX250 aCAoaW50IG51bSwgTGlzcF9PYmplY3QgbGlzdCkKK3sKKyAgZm9yIChpbnQgaSA9IDA7IGkgPCBu dW0gJiYgIU5JTFAgKGxpc3QpOyBpKyspCisgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICBpZiAo Q09OU1AgKGxpc3QpKQorICAgIHJldHVybiBYQ0FSIChsaXN0KTsKKyAgICBlbHNlCisgICAgICBy ZXR1cm4gUW5pbDsKK30KKworTGlzcF9PYmplY3QKK21jX2Fzc3EgKExpc3BfT2JqZWN0IGtleSwg TGlzcF9PYmplY3QgbGlzdCkKK3sKKyAgd2hpbGUgKDEpCisgICAgeworICAgICAgaWYgKCFDT05T UCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAgICAg ICAmJiBFUSAoWENBUiAoWENBUiAobGlzdCkpLCBrZXkpKSkKKyAgICAgICAgYnJlYWs7CisgICAg ICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KQorICAgICAgICAg IHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAgICYmIEVRIChYQ0FSIChYQ0FS IChsaXN0KSksIGtleSkpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0 KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAgfHwgKENPTlNQIChYQ0FSIChs aXN0KSkKKyAgICAgICAgICAgICAgJiYgRVEgKFhDQVIgKFhDQVIgKGxpc3QpKSwga2V5KSkpCisg ICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgIH0KKyAgaWYgKENP TlNQIChsaXN0KSkKKyAgICByZXR1cm4gWENBUiAobGlzdCk7CisgICAgZWxzZQorICAgICAgcmV0 dXJuIFFuaWw7Cit9CisKK0xpc3BfT2JqZWN0CittY19hc3NvYyAoTGlzcF9PYmplY3Qga2V5LCBM aXNwX09iamVjdCBsaXN0KQoreworICBMaXNwX09iamVjdCBjYXI7CisgIHdoaWxlICgxKQorICAg IHsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAgfHwgKENPTlNQIChYQ0FSIChs aXN0KSkKKyAgICAgICAgICAgICAgJiYgKGNhciA9IFhDQVIgKFhDQVIgKGxpc3QpKSwKKyAgICAg ICAgICAgICAgICAgIEVRIChjYXIsIGtleSkgfHwgIU5JTFAgKEZlcXVhbCAoY2FyLCBrZXkpKSkp KQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlmICgh Q09OU1AgKGxpc3QpCisgICAgICAgICAgfHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAg ICAgICAgJiYgKGNhciA9IFhDQVIgKFhDQVIgKGxpc3QpKSwKKyAgICAgICAgICAgICAgICAgIEVR IChjYXIsIGtleSkgfHwgIU5JTFAgKEZlcXVhbCAoY2FyLCBrZXkpKSkpKQorICAgICAgICBicmVh azsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisg ICAgICAgICAgfHwgKENPTlNQIChYQ0FSIChsaXN0K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47IGkrKykKKyAgICAgIHsKKyAgICAg ICAgLyogVGhpcyBzaG91bGQgYmUgaGFuZGxlZCB0aGUgc2FtZSBhcworICAgICBuZXh0X2VsZW1l bnRfZnJvbV9kaXNwbGF5X3ZlY3RvciBkb2VzIGl0LiAqLworICAgICAgICBMaXNwX09iamVjdCBl bnRyeSA9IEFSRUYgKGNoYXJ2ZWMsIGkpOworICAgICAgICBpZiAoR0xZUEhfQ09ERV9QIChlbnRy eSkpCisgICAgYyA9IEdMWVBIX0NPREVfQ0hBUiAoZW50cnkpOworICAgICAgICBlbHNlCisgICAg YyA9ICcgJzsKKyAgICAgICAgaWYgKGMgPT0gJ1xuJykKKyAgICBnb3RvIGVuZGxvb3A7CisgICAg ICAgIGlmIChjID09ICdccicgJiYgRVEgKEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBzZWxlY3RpdmVf ZGlzcGxheSksIFF0KSkKKyAgICBnb3RvIGVuZGxvb3A7CisgICAgICAgIGlmIChjID09ICdcdCcp CisgICAgeworICAgICAgY29sICs9IHRhYl93aWR0aDsKKyAgICAgIGNvbCA9IGNvbCAvIHRhYl93 aWR0aCAqIHRhYl93aWR0aDsKKyAgICB9CisgICAgICAgIGVsc2UKKyAgICArK2NvbDsKKyAgICAg IH0KKyAgfQorICAgICAgZWxzZQorICB7CisgICAgLyogVGhlIGRpc3BsYXkgdGFibGUgZG9lc24n dCBhZmZlY3QgdGhpcyBjaGFyYWN0ZXI7CisgICAgICAgaXQgZGlzcGxheXMgYXMgaXRzZWxmLiAq LworICAgIGlmIChjID09ICdcbicpCisgICAgICBnb3RvIGVuZGxvb3A7CisgICAgaWYgKGMgPT0g J1xyJyAmJiBFUSAoQlZBUiAoY3VycmVudF9idWZmZXIsIHNlbGVjdGl2ZV9kaXNwbGF5KSwgUXQp KQorICAgICAgZ290byBlbmRsb29wOworICAgIGlmIChjID09ICdcdCcpCisgICAgICB7CisgICAg ICAgIGNvbCArPSB0YWJfd2lkdGg7CisgICAgICAgIGNvbCA9IGNvbCAvIHRhYl93aWR0aCAqIHRh Yl93aWR0aDsKKyAgICAgIH0KKyAgICBlbHNlIGlmIChtdWx0aWJ5dGUgJiYgTEVBRElOR19DT0RF X1AgKGMpKQorICAgICAgeworICAgICAgICAvKiBTdGFydCBvZiBtdWx0aS1ieXRlIGZvcm0uICov CisgICAgICAgIHVuc2lnbmVkIGNoYXIgKnB0cjsKKyAgICAgICAgaW50IGJ5dGVzLCB3aWR0aDsK KyAgICAgICAgcHRyID0gQllURV9QT1NfQUREUiAoc2Nhbl9ieXRlKTsKKyAgICAgICAgTUNfTVVM VElCWVRFX0JZVEVTX1dJRFRIIChwdHIsIGRwLCBieXRlcywgd2lkdGgpOworICAgICAgICAvKiBT dWJ0cmFjdCBvbmUgdG8gY29tcGVuc2F0ZSBmb3IgdGhlIGluY3JlbWVudAorICAgICB0aGF0IGlz IGdvaW5nIHRvIGhhcHBlbiBiZWxvdy4gKi8KKyAgICAgICAgc2Nhbl9ieXRlICs9IGJ5dGVzIC0g MTsKKyAgICAgICAgY29sICs9IHdpZHRoOworICAgICAgfQorICAgIGVsc2UgaWYgKGN0bF9hcnJv dyAmJiAoYyA8IDA0MCB8fCBjID09IDAxNzcpKQorICAgICAgY29sICs9IDI7CisgICAgZWxzZSBp ZiAoYyA8IDA0MCB8fCBjID49IDAxNzcpCisgICAgICBjb2wgKz0gNDsKKyAgICBlbHNlCisgICAg ICBjb2wrKzsKKyAgfQorICAgICAgc2NhbisrOworICAgICAgc2Nhbl9ieXRlKys7CisgICAgfQor IGVuZGxvb3A6CisgIGxhc3Rfa25vd25fY29sdW1uID0gY29sOworICBsYXN0X2tub3duX2NvbHVt bl9wb2ludCA9IHB0OworICBsYXN0X2tub3duX2NvbHVtbl9tb2RpZmllZCA9IE1PRElGRjsKKyAg aWYgKGdvYWxjb2wpCisgICAgKmdvYWxjb2wgPSBjb2w7CisgIGlmIChlbmRwb3MpCisgICAgKmVu ZHBvcyA9IHNjYW47CisgIGlmIChwcmV2Y29sKQorICAgICpwcmV2Y29sID0gcHJldl9jb2w7Cit9 CisKK3B0cmRpZmZfdAorbWNfY3VycmVudF9jb2x1bW4gKHN0cnVjdCB3aW5kb3cgKncsIHB0cmRp ZmZfdCBwdCkKK3sKKyAgLyogYGJ1Zl9jaGFycG9zX3RvX2J5dGVwb3MnOiAgZWFzc2VydCAoQlVG X0JFRyAoYikgPD0gY2hhcnBvcyAmJiBjaGFycG9zIDw9IEJVRl9aIChiKSk7ICovCisgIExpc3Bf T2JqZWN0IGJ1ZiA9IHctPmNvbnRlbnRzOworICBDSEVDS19CVUZGRVIgKGJ1Zik7CisgIHN0cnVj dCBidWZmZXIgKmIgPSBYQlVGRkVSIChidWYpOworICBzdHJ1Y3QgYnVmZmVyICpvbGRfYnVmZmVy ID0gTlVMTDsKKyAgaWYgKGIgIT0gY3VycmVudF9idWZmZXIpCisgICAgeworICAgICAgb2xkX2J1 ZmZlciA9IGN1cnJlbnRfYnVmZmVyOworICAgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAoYik7Cisg ICAgfQorICBib29sIGJhcmZfY3Jhc2ggPSAoQlVGX0JFRyAoYikgPD0gcHQgJiYgcHQgPD0gQlVG X1ogKGIpKSA/IGZhbHNlIDogdHJ1ZTsKKyAgaWYgKGJhcmZfY3Jhc2gpCisgICAgeworICAgICAg aWYgKG9sZF9idWZmZXIpCisgICAgICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIp OworICAgICAgcmV0dXJuIDA7CisgICAgfQorICBFTUFDU19JTlQgbGFzdF9rbm93bl9jb2x1bW5f bW9kaWZpZWQgPSAwOworICBwdHJkaWZmX3QgbGFzdF9rbm93bl9jb2x1bW4gPSAwOworICBwdHJk aWZmX3QgY29sOworICB1bnNpZ25lZCBjaGFyICpwdHIsICpzdG9wOworICBib29sIHRhYl9zZWVu OworICBwdHJkaWZmX3QgcG9zdF90YWI7CisgIGludCBjOworICBpbnQgdGFiX3dpZHRoID0gU0FO RV9UQU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uaW5nIG9mIGJ1ZmZlci4gKi8KKyAgICBpZiAoQkVHViA+PSBHUFQpCisgICAgICBicmVh azsKKyAgfQorICAgICAgYyA9ICotLXB0cjsKKyAgICAgIGlmIChkcCAmJiBWRUNUT1JQIChESVNQ X0NIQVJfVkVDVE9SIChkcCwgYykpKQorICB7CisgICAgY2hhcnZlYyA9IERJU1BfQ0hBUl9WRUNU T1IgKGRwLCBjKTsKKyAgICBuID0gQVNJWkUgKGNoYXJ2ZWMpOworICB9CisgICAgICBlbHNlCisg IHsKKyAgICBjaGFydmVjID0gUW5pbDsKKyAgICBuID0gMTsKKyAgfQorICAgICAgZm9yIChpID0g biAtIDE7IGkgPj0gMDsgLS1pKQorICB7CisgICAgaWYgKFZFQ1RPUlAgKGNoYXJ2ZWMpKQorICAg ICAgeworICAgICAgICAvKiBUaGlzIHNob3VsZCBiZSBoYW5kbGVkIHRoZSBzYW1lIGFzCisgICAg IG5leHRfZWxlbWVudF9mcm9tX2Rpc3BsYXlfdmVjdG9yIGRvZXMgaXQuICovCisgICAgICAgIExp c3BfT2JqZWN0IGVudHJ5ID0gQVJFRiAoY2hhcnZlYywgaSk7CisgICAgICAgIGlmIChHTFlQSF9D T0RFX1AgKGVudHJ5KSkKKyAgICBjID0gR0xZUEhfQ09ERV9DSEFSIChlbnRyeSk7CisgICAgICAg IGVsc2UKKyAgICBjID0gJyAnOworICAgICAgfQorICAgIGlmIChjID49IDA0MCAmJiBjIDwgMDE3 NykKKyAgICAgIGNvbCsrOworICAgIGVsc2UgaWYgKGMgPT0gJ1xuJworICAgICAgIHx8IChjID09 ICdccicKKyAgICAgICAgICAgJiYgRVEgKEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBzZWxlY3RpdmVf ZGlzcGxheSksIFF0KSkpCisgICAgICB7CisgICAgICAgIHB0cisrOworICAgICAgICBnb3RvIHN0 YXJ0X29mX2xpbmVfZm91bmQ7CisgICAgICB9CisgICAgZWxzZSBpZiAoYyA9PSAnXHQnKQorICAg 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qZWN0 IGNoYXJhY3RlciA9ICgwIDw9IGFyZyAmJiBhcmcgPD0gTUFYX0NIQVIpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IEZjaGFyX3RvX3N0cmluZyAobWFrZV9maXhudW0gKGFyZykpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IFFuaWw7CisgIGNoYXIgKiByZXN1bHQgPSAoIU5JTFAg KGNoYXJhY3RlcikKKyAgICAgICAgICAgICAgICAgICAmJiBhcmcgPT0gOSkKKyAgICAgICAgICAg ICAgICAgICAgPyAiXFx0IgorICAgICAgICAgICAgICAgICAgOiAoIU5JTFAgKGNoYXJhY3RlcikK KyAgICAgICAgICAgICAgICAgICAgICYmIGFyZyA9PSAxMCkKKyAgICAgICAgICAgICAgICAgICAg PyAiXFxuIgorICAgICAgICAgICAgICAgICAgOiAoIU5JTFAgKGNoYXJhY3RlcikKKyAgICAgICAg ICAgICAgICAgICAgICYmIGFyZyA9PSAzMikKKyAgICAgICAgICAgICAgICAgICAgPyAiXFxzIgor ICAgICAgICAgICAgICAgICAgOiAoIU5JTFAgKGNoYXJhY3RlcikKKyAgICAgICAgICAgICAgICAg ICAgICYmIGFyZyAhPSA5CisgICAgICAgICAgICAgICAgICAgICAmJiBhcmcgIT0gMTAKKyAgICAg ICAgICAgICAgICAgICAgICYmIGFyZyAhPSAzMikKKyAgICAgICAgICAgICAgICAgICAgPyBTU0RB VEEgKGNoYXJhY3RlcikKKyAgICAgICAgICAgICAgICAgIDogIlxcPyI7CisgIHJldHVybiByZXN1 bHQ7Cit9CisKK2ludAorbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoTGlzcF9PYmplY3QgYXJnKQor eworICBjaGFyICpzdHI7CisgIGlmIChYVFlQRSAoYXJnKSA9PSBMaXNwX1N0cmluZykKKyAgICBz dHIgPSBTU0RBVEEgKGFyZyk7CisgICAgZWxzZSBpZiAoWFRZUEUgKGFyZykgPT0gTGlzcF9TeW1i b2wpCisgICAgICBzdHIgPSB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ug YSBzZXBhcmF0ZSB2YXJpYWJsZSBgaScuICovCisgIGkgPSBzdGFydDsKKyAgVVNFX1NBRkVfQUxM T0NBOworICBNQ19CVUlMRF9HTFlQSF9TVFJJTkdTIChpLCBlbmQsIGhlYWQsIHRhaWwsIGhsLCB4 LCBsYXN0X3gpOworICBpZiAodGFpbCkKKyAgICB7CisgICAgICBzID0gZ2x5cGhfc3RyaW5nX2Nv bnRhaW5pbmdfYmFja2dyb3VuZF93aWR0aCAodGFpbCk7CisgICAgICB4X3JlYWNoZWQgPSBzLT54 ICsgcy0+YmFja2dyb3VuZF93aWR0aDsKKyAgICB9CisgIGVsc2UKKyAgICB4X3JlYWNoZWQgPSB4 OworICAvKiBJZiB0aGVyZSBhcmUgYW55IGdseXBocyB3aXRoIGxiZWFyaW5nIDwgMCBvciByYmVh cmluZyA+IHdpZHRoIGluCisgICAgIHRoZSByb3csIHJlZHJhdyBzb21lIGdseXBocyBpbiBmcm9u dCBvciBmb2xsb3dpbmcgdGhlIGdseXBoCisgICAgIHN0cmluZ3MgYnVpbHQgYWJvdmUuICovCisg IGlmIChoZWFkICYmICFvdmVybGFwcyAmJiByb3ctPmNvbnRhaW5zX292ZXJsYXBwaW5nX2dseXBo c19wKQorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlwaF9zdHJpbmcgKmgsICp0OworICAgICAgTW91 c2VfSExJbmZvICpobGluZm8gPSBNT1VTRV9ITF9JTkZPIChmKTsKKyAgICAgIGludCBtb3VzZV9i ZWdfY29sIFVOSU5JVCwgbW91c2VfZW5kX2NvbCBVTklOSVQ7CisgICAgICBib29sIGNoZWNrX21v dXNlX2ZhY2UgPSBmYWxzZTsKKyAgICAgIGludCBkdW1teV94ID0gMDsKKyAgICAgIC8qIElmIG1v dXNlIGhpZ2hsaWdodGluZyBpcyBvbiwgd2UgbWF5IG5lZWQgdG8gZHJhdyBhZGphY2VudAorICAg Z2x5cGhzIHVzaW5nIG1vdXNlLWZhY2UgaGlnaGxpZ2h0aW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XRyaXgsIHJvdywgcmVkLCBn cmVlbiwgYmx1ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaF9m bGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgY3Vyc29yX2djX3ApOworI2lmbmRlZiBIQVZFX05TCisgIC8qIFdoZW4g Zm9jdXMgYSBzb2xlIGZyYW1lIGFuZCBtb3ZlIGhvcml6b250YWxseSwgdGhpcyBjbGVhcnMgb25f cAorICAgICBjYXVzaW5nIGEgZmFpbHVyZSB0byBlcmFzZSBwcmV2IGN1cnNvciBwb3NpdGlvbi4g Ki8KKyAgaWYgKGFyZWEgPT0gVEVYVF9BUkVBCisgICAgICAmJiAhcm93LT5mdWxsX3dpZHRoX3AK KyAgICAgIC8qIFdoZW4gZHJhd2luZyBvdmVybGFwcGluZyByb3dzLCBvbmx5IHRoZSBnbHlwaCBz dHJpbmdzJworICAgICAgZm9yZWdyb3VuZCBpcyBkcmF3biwgd2hpY2ggZG9lc24ndCBlcmFzZSBh IGN1cnNvciBjb21wbGV0ZWx5LiAqLworICAgICAgJiYgIW92ZXJsYXBzKQorICAgIHsKKyAgICAg IGludCB4MCA9IGNsaXBfaGVhZCA/IGNsaXBfaGVhZC0+eCA6IChoZWFkID8gaGVhZC0+eCA6IHgp OworICAgICAgaW50IHgxID0gKGNsaXBfdGFpbCA/IGNsaXBfdGFpbC0+eCArIGNsaXBfdGFpbC0+ YmFja2dyb3VuZF93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICA6ICh0YWlsID8gdGFp bC0+eCArIHRhaWwtPmJhY2tncm91bmRfd2lkdGggOiB4KSk7CisgICAgICB4MCAtPSBhcmVhX2xl ZnQ7CisgICAgICB4MSAtPSBhcmVhX2xlZnQ7CisgICAgICBub3RpY2Vfb3ZlcndyaXR0ZW5fY3Vy c29yICh3LCBURVhUX0FSRUEsIHgwLC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X3ApCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX2VyYXNl X2N1cnNvcjogIHJldHVybiAoJWQpXG4iLCAxKTsKKyAgICAgIHJldHVybjsKKyAgICB9CisgIC8q IFZQT1MgPj0gbWF0cml4LT5ucm93cyBtZWFucyB0aGF0IHdpbmRvdyBoYXMgYmVlbiByZXNpemVk LgorICAgICBEb24ndCBib3RoZXIgdG8gZXJhc2UgdGhlIGN1cnNvci4gKi8KKyAgaWYgKHZwb3Mg Pj0gbWF0cml4LT5ucm93cykKKyAgICB7CisgICAgICBpZiAoZGVidWdfcCkKKyAgICAgICAgZnBy aW50ZiAoc3RkZXJyLCAibWNfZXJhc2VfY3Vyc29yOiAgcmV0dXJuICglZClcbiIsIDIpOworICAg ICAgcmV0dXJuOworICAgIH0KKyAgLyogSWYgcm93IGNvbnRhaW5pbmcgY3Vyc29yIGlzIG1hcmtl ZCBpbnZhbGlkLCB0aGVyZSBpcyBub3RoaW5nIHdlCisgICAgIGNhbiBkby4gKi8KKyAgaWYgKCFy b3ctPmVuYWJsZWRfcCkKKyAgICB7CisgICAgICBpZiAoZGVidWdfcCkKKyAgICAgICAgZnByaW50 ZiAoc3RkZXJyLCAibWNfZXJhc2VfY3Vyc29yOiAgcmV0dXJuICglZClcbiIsIDMpOworICAgICAg cmV0dXJuOworICAgIH0KKyAgLyogSWYgbGluZSBzcGFjaW5nIGlzID4gMCwgb2xkIGN1cnNvciBt YXkgb25seSBiZSBwYXJ0aWFsbHkgdmlzaWJsZSBpbgorICAgICB3aW5kb3cgYWZ0ZXIgc3BsaXQt d2luZG93LiAgU28gYWRqdXN0IHZpc2libGUgaGVpZ2h0LiAqLworICByb3ctPnZpc2libGVfaGVp Z2h0ID0gbWluIChyb3ctPnZpc2libGVfaGVpZ2h0LAorICAgICAgICAgICAgd2luZG93X3RleHRf Ym90dG9tX3kgKHcpIC0gcm93LT55KTsKKyAgLyogSWYgcm93IGlzIGNvbXBsZXRlbHkgaW52aXNp Ymxl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sID4gMAorICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhB TVBMRTogIEMtdSBDLXggPCBhbmQgZG8gbm90aGluZy4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJt XzBfcCA9ICh3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9o c2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xs ID09IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBzb21ldGhp bmcgZWxzZSBiZXNpZGVzIGhvcml6b250YWxseSBzY3JvbGxpbmcgdGhlCisgICAgICAgICAgICAg ICBjdXJyZW50IGxpbmUgZGlmZmVyZW50bHkuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUg aXMgX25vdF8gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhz Y2xfYWxsX3Blcm1fMV9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHct Pm1pbl9oc2Nyb2xsID09IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFu ZCAuLi4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFsbHkg c2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8yX3AgPSAoIXct PnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0 b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3Jv bGwgPT0gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4g MAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhz Y3JvbGwpOworICAvKiBFWEFNUExFOiAgKHNjcm9sbC1sZWZ0IDUpOyBhbmQsIHRoZW4gcHJlc3Mg dGhlIGxlZnQgYXJyb3cga2V5IG9uZSB0aW1lLgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5l IF9pc18gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiovCisgIGJvb2wgaHNjbF90 ZW1wX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAg JiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3Jv bGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gMCk7Cisg IC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIHNvbWV0aGluZyB0aGF0IGNhdXNlcyB0aGUg Y3VycmVudCBsaW5lIHRvIGJlCisgICAgICAgICAgICAgICBob3Jpem9udGFsbHkgc2Nyb2xsZWQg ZGlmZmVyZW50bHkuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFs bHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9wZXJtX3AgPSAoIXctPnN1 c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xs X21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAg ICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAg ICAgJiYgdy0+bWluX2hzY3JvbGwgIT0gdy0+aHNjcm9sbCk7CisgIHN0cnVjdCBmcmFtZSAqZiA9 IFhGUkFNRSAody0+ZnJhbWUpOworICBpbnQgZnJpbmdlX2JpdG1hcCA9IE1DX05PX0ZSSU5HRV9C SVRNQVA7CisgIGludCBmYWNlX2lkID0gREVGQVVMVF9GQUNFX0lEOworICBpZiAoIXJlbW92ZV9w CisgICAgICAmJiBnbHlwaF9mbGF2b3IgPT0gTUNfT1ZFUkxBWV9BUlJPV19CSVRNQVAKKyAgICAg ICYmICFoc2NsX2FsbF90ZW1wX3AKKyAgICAgICYmICFoc2NsX3RlbXBfcAorICAgICAgJiYgIWhz Y2xfcGVybV9wCisgICAgICAmJiAhaHNjbF9hbGxfcGVybV8wX3AKKyAgICAgICYmICFoc2NsX2Fs bF9wZXJtXzFfcAorICAgICAgJiYgIWhzY2xfYWxsX3Blcm1fMl9wKQorICAgIHsKKyAgICAgIGVu dW0gZmFjZV9pZCBvdmVybGF5X2Fycm93X2ZhY2VfaWQgPQorICAgICAgICAoIWFjdGl2ZV9wCisg ICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF9pbmFjdGl2 ZV93aW5kb3dzKSkpCisgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAo Iistb3ZlcmxheS1hcnJvdy1pbmFjdGl2ZS1mYWNlIiksIHRydWUpCisgICAgICAgIDogKGFjdGl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Z2VfYml0bWFwICh3LCBy b3csIHRydWUsIGN1cnNvcl90eXBlKTsKKyAgICB9CisgICAgZWxzZSBpZiAoIXJlbW92ZV9wCisg ICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yID09IE1DX09WRVJMQVlfQVJST1dfQklUTUFQCisg ICAgICAgICAgICAgJiYgKGhzY2xfYWxsX3RlbXBfcAorICAgICAgICAgICAgICAgICB8fCBoc2Ns X2FsbF9wZXJtXzBfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzFfcAorICAg ICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzJfcAorICAgICAgICAgICAgICAgICB8fCBo c2NsX3RlbXBfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX3Blcm1fcCkpCisgICAgICB7Cisg ICAgICAgIGVudW0gZmFjZV9pZCBvdmVybGF5X2Fycm93X2ZhY2VfaWQgPQorICAgICAgICAgICgh YWN0aXZlX3AKKyAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgY2hfaW5hY3RpdmVfd2luZG93cykpKQorICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2Ug KHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1oc2NsLWluYWN0aXZlLWZhY2UiKSwgdHJ1 ZSkKKyAgICAgICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2Zh Y2UgKHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1oc2NsLWZhY2UiKSwgdHJ1ZSkKKyAg ICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgZmFjZV9pZCA9IChjdXJzb3JfdHlw ZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICA/IG92ZXJsYXlf YXJyb3dfZmFjZV9pZAorICAgICAgICAgICAgICAgICAgOiBER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3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQ KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBmcmluZ2VfYml0 bWFwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX05PX0ZS SU5HRV9CSVRNQVA7CisgICAgICAgIHJvdy0+bGVmdF9mcmluZ2VfZmFjZV9pZCA9IGZhY2VfaWQ7 CisgICAgICAgIHJvdy0+bGVmdF9mcmluZ2Vfb2Zmc2V0ID0gMDsKKyAgICAgICAgcm93LT5mcmlu Z2VfYml0bWFwX3BlcmlvZGljX3AgPSBmYWxzZTsKKyAgICAgICAgbWNfZHJhd19mcmluZ2VfYml0 bWFwICh3LCByb3csIHRydWUsIGN1cnNvcl90eXBlKTsKKyAgICAgIH0KKyAgICAgIGVsc2UgaWYg KCFyZW1vdmVfcAorICAgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1df UkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9y ID09IE1DX0hPTExPV19SRUNUQU5HTEUKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2 b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgfHwg Z2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgIHx8IGds eXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIKSkKKyAgICAgICAgeworICAg ICAgICAgIExpc3BfT2JqZWN0IGJpdG1hcF9mbGF2b3IgPSAoZ2x5cGhfZmxhdm9yID09IE1DX0hP TExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gUW1jX2hvbGxvd19yZWN0YW5nbGVfcmlnaHRfYXJyb3cKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19S RUNUQU5HTEUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNf aG9sbG93X3JlY3RhbmdsZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jhcl9yaWdodF9h cnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2 b3IgPT0gTUNfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gUW1jX3ZlcnRpY2FsX2JhcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXJf YmFja3NsYXNoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogUW5pbDsK KyAgICAgICAgICBmcmluZ2VfYml0bWFwID0gKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5H RV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAgID8gbG9va3VwX2ZyaW5nZV9iaXRt YXAgKGJpdG1hcF9mbGF2b3IpCisgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJ TkdFX0JJVE1BUDsKKyAgICAgICAgICBmYWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1DX1JJR0hU X0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2Ug KHcsIGYsIGludGVybiAoIistdmVydGljYWwtYmFyLWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAg ICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgcm93LT5jdXJzb3JfaW5fZnJp bmdlX3AgPSBmYWxzZTsKKyAgICAgICAgICByb3ctPnJpZ2h0X2ZyaW5nZV9iaXRtYXAgPSBmcmlu Z2VfYml0bWFwOworICAgICAgICAgIHJvdy0+cmlnaHRfZnJpbmdlX2ZhY2VfaWQgPSBmYWNlX2lk OworICAgICAgICAgIHJvdy0+cmlnaHRfZnJpbmdlX29mZnNldCA9IDA7CisgICAgICAgICAgcm93 LT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3AgPSBmYWxzZTsKKyAgICAgICAgICBtY19kcmF3X2Zy aW5nZV9iaXRtYXAgKHcsIHJvdywgZmFsc2UsIGN1cnNvcl90eXBlKTsKKyAgICAgICAgfQorICAg ICAgICBlbHNlIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEgKKyAgICAgICAgICAgICAgICAg fHwgZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBITEVTUykKKyAgICAgICAgICB7CisgICAgICAgICAg ICBkb3VibGUgdGVtcF9yZWQgPSByZ2IucmVkOworICAgICAgICAgICAgZG91YmxlIHRlbXBfZ3Jl ZW4gPSByZ2IuZ3JlZW47CisgICAgICAgICAgICBkb3VibGUgdGVtcF9ibHVlID0gcmdiLmJsdWU7 CisgICAgICAgICAgICAvKiBTb21lIG9mIHRoZXNlIHZhbHVlcyBjb21lIHRocm91Z2ggYXMgMS4w MDM5MDYsIHdoaWNoIGNhdXNlcyBhIGJyZWFrYWdlCisgICAgICAgICAgICBvZiB0aGUgY29sb3Jz IGluIHRoYXQgbXVsdGlwbGljYXRpb24gYnkgdGhlIGJhc2Ugd2lsbCBleGNlZWQgdGhlIGJhc2Uu ICovCisgICAgICAgICAgICBkb3VibGUgcmVkID0gKHRlbXBfcmVkID4gMS4wKQorICAgICAgICAg ICAgICAgICAgICAgICAgID8gMS4wCisgICAgICAgICAgICAgICAgICAgICAgICAgOiB0ZW1wX3Jl ZDsKKyAgICAgICAgICAgIGRvdWJsZSBncmVlbiA9ICh0ZW1wX2dyZWVuID4gMS4wKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyAxLjAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIDog dGVtcF9ncmVlbjsKKyAgICAgICAgICAgIGRvdWJsZSBibHVlID0gKHRlbXBfYmx1ZSA+IDEuMCkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgPyAxLjAKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgOiB0ZW1wX2JsdWU7CisgICAgICAgICAgICBib29sIG9uX3AgPSB0cnVlOworICAgICAgICAg ICAgRlJBTUVfUklGIChmKS0+bWNfc2NyaWJlX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4 LCB5LCBmeSwgaHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICB2cG9zLCB3ZCwgaCwgcmVkLCBncmVlbiwgYmx1ZSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBnbHlwaF9mbGF2 b3IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb25fcCwgYWN0 aXZlX3ApOworICAgICAgICAgIH0KK30KKworLyogRHVtcCBjb250ZW50cyBvZiBnbHlwaCBHTFlQ SCB0byBzdGRlcnIuICBST1cgYW5kIEFSRUEgYXJlCisgICB0aGUgZ2x5cGggcm93IGFuZCBhcmVh IHdoZXJlIHRoZSBnbHlwaCBjb21lcyBmcm9tLiAqLwordm9pZAorbWNfZHVtcF9nbHlwaCAoc3Ry dWN0IGdseXBoX3JvdyAqcm93LCBzdHJ1Y3QgZ2x5cGggKmdseXBoLCBpbnQgYXJlYSwgaW50IHJl bGF0aXZlX3gpCit7CisgIGlmIChnbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICB8fCBn bHlwaC0+dHlwZSA9PSBHTFlQSExFU1NfR0xZUEgpCisgICAgeworICAgICAgZnByaW50ZiAoc3Rk ZXJyLAorICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4 ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNkICVzICVzXG4iLAorICAgICAgICBnbHlw aCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09 IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAg ICAgICAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgPyAnQycKKyAgICAgICAg IDogJ0cnKSwKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlw aC0+b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5v YmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9i amVjdCkKKyAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAgICA6ICctJykpKSwKKyAg ICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICBnbHlwaC0+dS5jaCwKKyAgICAgICAg Z2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAg IGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+eCwgZ2x5cGgtPnksIGds eXBoLT5ocG9zLCBnbHlwaC0+dnBvcywgZ2x5cGgtPnp2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAg ICAgbWNfY2hhcl90b19zdHJpbmcgKGdseXBoLT51LmNoKSk7CisgICAgfQorICBlbHNlIGlmIChn bHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVy ciwKKyAgICAgICAgIiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAl NGQgJTEuMWQlMS4xZCAlNWQgJTRkICAlM2QgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5cGgg LSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAw KSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAg ICAgJ1MnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBo LT5vYmplY3QpCisgICAgICAgICAgICA/ICdCJworICAgICAgICAgIDogKFNUUklOR1AgKGdseXBo LT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5v YmplY3QpCisgICAgICAgICAgICA/ICcwJworICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBn bHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIDB1LAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwK KyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2Jv eF9saW5lX3AsCisgICAgICAgIGdseXBoLT54LCBnbHlwaC0+eSwgZ2x5cGgtPmhwb3MsIGdseXBo LT52cG9zLCBnbHlwaC0+enZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAiXFxTIik7CisgICAg fQorICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkKKyAgICB7CisgICAgICBm cHJpbnRmIChzdGRlcnIsCisgICAgICAgICIgJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVj ICUzZCAweCUwNnggJTRkICUxLjFkJTEuMWQgJTVkICU0ZCAgJTNkICAlM2QgJXMgJWNcbiIsCisg ICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVz ZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0 aXZlX3gsCisgICAgICAgICdJJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChC VUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnQicKKyAgICAgICAgICA6IChT VFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICA6IChO SUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICA6ICctJykp KSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAodW5zaWduZWQgaW50KSBn bHlwaC0+dS5pbWdfaWQsCisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+ bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAg ICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgZ2x5cGgtPnZwb3MsIGdseXBoLT56 dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7CisgICAgfQorICBlbHNlIGlmIChnbHlw aC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpCisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJy LAorICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4IiwK KyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+ dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVs YXRpdmVfeCwKKyAgICAgICAgJysnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAg KEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdCJworICAgICAgICAgIDog KFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgIDog KE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICcwJworICAgICAgICAgIDogJy0n KSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgICh1bnNpZ25lZCBpbnQp IGdseXBoLT51LmNtcC5pZCk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgJTRkICUxLjFkJTEu MWQiLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xp bmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3ApOworICAgICAgaWYgKGdseXBo LT51LmNtcC5hdXRvbWF0aWMpCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAlNWQgJTRkICAl M2QgICUzZCAlcyAuIFslZC0lZF1cbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGgt PngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgZ2x5cGgtPnZwb3MsIGdseXBoLT56dl9wID8gIlpW IiA6ICItLSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGgtPnNsaWNlLmNtcC5mcm9t LCBnbHlwaC0+c2xpY2UuY21wLnRvKTsKKyAgICAgICAgZWxzZQorICAgICAgICBmcHJpbnRmIChz dGRlcnIsICJcbiIpOworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gWFdJREdFVF9H TFlQSCkKKyAgICB7CisjaWZuZGVmIEhBVkVfWFdJREdFVFMKKyAgICAgIGVhc3N1bWUgKGZhbHNl KTsKKyNlbHNlCisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICIgICU1ZC8lLTVkICU1 ZCAlNGMgJTZkICVjICUzZCAweCUwNXggJTRkICUxLjFkJTEuMWQgJTVkICU0ZCAgJTNkICAlM2Qg JXMgJWNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAg ICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisg ICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdYJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3Ms CisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICA/ICdCJworICAg ICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAg ICAgICA6ICctJykpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIGdseXBo LT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlw aC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnUueHdpZGdldCwKKyAgICAgICAg Z2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgZ2x5cGgtPnZwb3MsIGdseXBoLT56dl9w ID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7CisjZW5kaWYKKyAgICB9Cit9CisKKy8qIER1 bXAgdGhlIGNvbnRlbnRzIG9mIGdseXBoIHJvdyBhdCBWUE9TIGluIE1BVFJJWCB0byBzdGRlcnIu CisgICBHTFlQSFMgMCBtZWFucyBkb24ndCBzaG93IGdseXBoIGNvbnRlbnRzLgorICAgR0xZUEhT IDEgbWVhbnMgc2hvdyBnbHlwaHMgaW4gc2hvcnQgZm9ybQorICAgR0xZUEhTID4gMSBtZWFucyBz aG93IGdseXBocyBpbiBsb25nIGZvcm0uICovCit2b2lkCittY19kdW1wX2dseXBoX3JvdyAoc3Ry dWN0IGdseXBoX3JvdyAqcm93LCBpbnQgdnBvcywgaW50IGdseXBocykKK3sKKyAgaW50IHJlbGF0 aXZlX3ggPSAwOworICBpZiAoZ2x5cGhzICE9IDEpCisgICAgeworICAgICAgZnByaW50ZiAoc3Rk ZXJyLCAiXG5EVU1QIEdMWVBIIFJPV1xuIik7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICJSb3cg ICAgIFN0YXJ0ICAgICAgIEVuZCBVc2VkIG9FPjxcXENUWkZlc20gICAgIFggICAgWSAgICBXICAg IEggICAgViAgICBBICAgIFBcbiIpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiPT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09XG4iKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIiUzZCAlOSJwRCJkICU5 InBEImQgJTRkICUxLjFkJTEuMWQlMS4xZCUxLjFkXAorJTEuMWQlMS4xZCUxLjFkJTEuMWQlMS4x ZCUxLjFkJTEuMWQlMS4xZCAgJTRkICU0ZCAlNGQgJTRkICU0ZCAlNGQgJTRkXG4iLAorICAgICAg ICAgdnBvcywKKyAgICAgICAgIE1BVFJJWF9ST1dfU1RBUlRfQ0hBUlBPUyAocm93KSwKKyAgICAg ICAgIE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdyksCisgICAgICAgICByb3ctPnVzZWRbVEVY VF9BUkVBXSwKKyAgICAgICAgIHJvdy0+Y29udGFpbnNfb3ZlcmxhcHBpbmdfZ2x5cGhzX3AsCisg ICAgICAgICByb3ctPmVuYWJsZWRfcCwKKyAgICAgICAgIHJvdy0+dHJ1bmNhdGVkX29uX2xlZnRf cCwKKyAgICAgICAgIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3AsCisgICAgICAgICByb3ctPmNv bnRpbnVlZF9wLAorICAgICAgICAgTUFUUklYX1JPV19DT05USU5VQVRJT05fTElORV9QIChyb3cp LAorICAgICAgICAgTUFUUklYX1JPV19ESVNQTEFZU19URVhUX1AgKHJvdyksCisgICAgICAgICBy b3ctPmVuZHNfYXRfenZfcCwKKyAgICAgICAgIHJvdy0+ZmlsbF9saW5lX3AsCisgICAgICAgICBy b3ctPmVuZHNfaW5fbWlkZGxlX29mX2NoYXJfcCwKKyAgICAgICAgIHJvdy0+c3RhcnRzX2luX21p ZGRsZV9vZl9jaGFyX3AsCisgICAgICAgICByb3ctPm1vdXNlX2ZhY2VfcCwKKyAgICAgICAgIHJv dy0+eCwKKyAgICAgICAgIHJvdy0+eSwKKyAgICAgICAgIHJvdy0+cGl4ZWxfd2lkdGgsCisgICAg ICAgICByb3ctPmhlaWdodCwKKyAgICAgICAgIHJvdy0+dmlzaWJsZV9oZWlnaHQsCisgICAgICAg ICByb3ctPmFzY2VudCwKKyAgICAgICAgIHJvdy0+cGh5c19hc2NlbnQpOworICAgICAgLyogVGhl IG5leHQgMyBsaW5lcyBzaG91bGQgYWxpZ24gdG8gIlN0YXJ0IiBpbiB0aGUgaGVhZGVyLiAqLwor ICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICAgICU5InBEImQgJTkicEQiZFx0JTVkXG4iLCByb3ct PnN0YXJ0Lm92ZXJsYXlfc3RyaW5nX2luZGV4LAorICAgICAgICAgcm93LT5lbmQub3ZlcmxheV9z dHJpbmdfaW5kZXgsCisgICAgICAgICBy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IHJlbGF0aXZlX3gpOworICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0aDsK KyAgICAgIH0KKyAgfQorICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGhzID09IDEpCisgICAgeworICAg ICAgY2hhciBzW1NIUlRfTUFYICsgNF07CisgICAgICBmb3IgKGludCBhcmVhID0gTEVGVF9NQVJH SU5fQVJFQTsgYXJlYSA8IExBU1RfQVJFQTsgKythcmVhKQorICB7CisgICAgaW50IGk7CisgICAg Zm9yIChpID0gMDsgaSA8IHJvdy0+dXNlZFthcmVhXTsgKytpKQorICAgICAgeworICAgICAgICBz dHJ1Y3QgZ2x5cGggKmdseXBoID0gcm93LT5nbHlwaHNbYXJlYV0gKyBpOworICAgICAgICBpZiAo aSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAmJiBhcmVhID09IFRFWFRfQVJFQQorICAg ICAgJiYgTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICYmIGdseXBoLT50eXBlID09IENIQVJf R0xZUEgKKyAgICAgICYmIGdseXBoLT51LmNoID09ICcgJykKKyAgICB7CisgICAgICBzdHJjcHkg KCZzW2ldLCAiW1xcbl0iKTsKKyAgICAgIGkgKz0gNDsKKyAgICB9CisgICAgICAgIGVsc2UgaWYg KGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgICAgICAgJiYgZ2x5cGgtPnUuY2ggPCAw eDgwCisgICAgICAgICAgICYmIGdseXBoLT51LmNoID49ICcgJykKKyAgICBzW2ldID0gZ2x5cGgt PnUuY2g7CisgICAgICAgIGVsc2UKKyAgICBzW2ldID0gJy4nOworICAgICAgfQorICAgIHNbaV0g PSAnXDAnOworICAgIGZwcmludGYgKHN0ZGVyciwgIiUzZDogKCVkKSAnJXMnXG4iLCB2cG9zLCBy b3ctPmVuYWJsZWRfcCwgcyk7CisgIH0KKyAgICB9Cit9CisKK0RFRlVOICgibWMtZHVtcC1nbHlw aC1yb3ciLC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AgICA6IHlwb3M7Cisg ICAgICBpZiAodmlzaWJsZV9wKQorICAgICAgICB2cG9zID0gdm9mZnNldDsKKyAgICAgICAgZWxz ZQorICAgICAgICAgIHZwb3MgPSAwOworICAgIH0KKyAgICBlbHNlCisgICAgICB7CisgICAgICAg IENIRUNLX05VTUJFUiAocm93KTsKKyAgICAgICAgdnBvcyA9IFhGSVhOVU0gKHJvdyk7CisgICAg ICB9CisgIG1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworICBpZiAodnBvcyA+PSAwICYmIHZw b3MgPCBtYXRyaXgtPm5yb3dzKQorICAgIG1jX2R1bXBfZ2x5cGhfcm93IChNQVRSSVhfUk9XICht YXRyaXgsIHZwb3MpLAorICAgICAgICB2cG9zLAorICAgICAgICBUWVBFX1JBTkdFRF9GSVhOVU1Q IChpbnQsIGdseXBocykgPyBYRklYTlVNIChnbHlwaHMpIDogMik7CisgIHJldHVybiBRbmlsOwor fQorCit2b2lkCittY19kdW1wX2dseXBoX21hdHJpeCAoc3RydWN0IGdseXBoX21hdHJpeCAqbWF0 cml4LCBpbnQgZ2x5cGhzKQoreworICBpbnQgaTsKKyAgZm9yIChpID0gMDsgaSA8IG1hdHJpeC0+ bnJvd3M7ICsraSkKKyAgICBtY19kdW1wX2dseXBoX3JvdyAoTUFUUklYX1JPVyAobWF0cml4LCBp KSwgaSwgZ2x5cGhzKTsKK30KKworREVGVU4gKCJtYy1kdW1wLWdseXBoLW1hdHJpeCIsIEZtY19k dW1wX2dseXBoX21hdHJpeCwKKyAgICAgICBTbWNfZHVtcF9nbHlwaF9tYXRyaXgsIDAsIDEsICJw IiwKKyAgICAgICBkb2M6IC8qIER1bXAgdGhlIGN1cnJlbnQgbWF0cml4IG9mIHRoZSBzZWxlY3Rl ZCB3aW5kb3cgdG8gc3RkZXJyLgorU2hvd3MgY29udGVudHMgb2YgZ2x5cGggcm93IHN0cnVjdHVy ZXMuICBXaXRoIG5vbi1uaWwKK3BhcmFtZXRlciBHTFlQS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cmV0dXJuIFFuaWw7 Cit9CisKK3ZvaWQKK21jX3Jlc2V0X2NhY2hlIChzdHJ1Y3Qgd2luZG93ICp3LCBlbnVtIHR5cGVf b2ZfY2FjaGUgY2FjaGVfdHlwZSkKK3sKKyAgc3dpdGNoIChjYWNoZV90eXBlKQorICAgIHsKKyAg ICAgIGNhc2UgTk9fQ0FDSEU6CisgICAgICAgIHsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAg fQorICAgICAgY2FzZSBNQ19DQUNIRToKKyAgICAgICAgeworICAgICAgICAgIGlmIChCVUZGRVJQ ICh3LT5jb250ZW50cykgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19j b25mKSkKKyAgICAgICAgICAgICAgJiYgdy0+bWNfZWx0cy51c2VkID4gMSkKKyAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgLyogRGVjcmVhc2UgdGhlIHNpemUgb2YgdGhlIGFycmF5IHRvIGEg YmFyZSBtaW5pbXVtLiAqLworICAgICAgICAgICAgICB4bnJlYWxsb2MgKHctPm1jX2VsdHMuY2Fj aGVzLCAxLCBzaXplb2YgKnctPm1jX2VsdHMuY2FjaGVzKTsKKyAgICAgICAgICAgICAgdy0+bWNf ZWx0cy51c2VkID0gMDsKKyAgICAgICAgICAgICAgdy0+bWNfZWx0cy5hbGxvY2F0ZWQgPSAxOwor ICAgICAgICAgICAgfQorICAgICAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykgJiYgIU5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQorICAgICAgICAgICAg eworICAgICAgICAgICAgICAvLyAgLyogU2V0IGFsbCBfdXNlZF8gZWxlbWVudHMgb2YgdGhlIGFy cmF5IHRvIHplcm8uICBfZWx0cy5hbGxvY2F0ZWQgcmVtYWluCisgICAgICAgICAgICAgIC8vICB0 aGUgc2FtZS4gKi8KKyAgICAgICAgICAgICAgLy8gIG1lbXNldCAody0+bWNfZWx0cy5jYWNoZXMs IDAsIHctPm1jX2VsdHMudXNlZCAqIChzaXplb2YgKnctPm1jX2VsdHMuY2FjaGVzKSk7CisgICAg ICAgICAgICAgIHctPm1jX2VsdHMudXNlZCA9IDA7CisgICAgICAgICAgICB9CisgICAgICAgICAg YnJlYWs7CisgICAgICAgIH0KKyAgICAgIGNhc2UgQ0hfQ0FDSEU6CisgICAgICAgIHsKKyAgICAg ICAgICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICYmIHctPmNoX2VsdHMudXNl ZCA+IDEpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIC8qIERlY3JlYXNlIHRoZSBzaXpl IG9mIHRoZSBhcnJheSB0byBhIGJhcmUgbWluaW11bS4gKi8KKyAgICAgICAgICAgICAgeG5yZWFs bG9jICh3LT5jaF9lbHRzLmNhY2hlcywgMSwgc2l6ZW9mICp3LT5jaF9lbHRzLmNhY2hlcyk7Cisg ICAgICAgICAgICAgIHctPmNoX2VsdHMudXNlZCA9IDA7CisgICAgICAgICAgICAgIHctPmNoX2Vs dHMuYWxsb2NhdGVkID0gMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBpZiAoQlVGRkVSUCAo dy0+Y29udGVudHMpICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3Nz aGFpcnMpKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLy8gIC8qIFNldCBhbGwgX3Vz ZWRfIGVsZW1lbnRzIG9mIHRoZSBhcnJheSB0byB6ZXJvLiAgX2VsdHMuYWxsb2NhdGVkIHJlbWFp bgorICAgICAgICAgICAgICAvLyAgdGhlIHNhbWUuICovCisgICAgICAgICAgICAgIC8vICBtZW1z ZXQgKHctPmNoX2VsdHMuY2FjaGVzLCAwLCB3LT5jaF9lbHRzLnVzZWQgKiAoc2l6ZW9mICp3LT5j aF9lbHRzLmNhY2hlcykpOworICAgICAgICAgICAgICB3LT5jaF9lbHRzLnVzZWQgPSAwOworICAg ICAgICAgICAgfQorICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBjYXNlIEZDX0NB Q0hFOgorICAgICAgICB7CisgICAgICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKSAmJiBO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQorICAgICAgICAg ICAgICAmJiB3LT5mY19lbHRzLnVzZWQgPiAxKQorICAgICAgICAgICAgeworICAgICAgICAgICAg ICAvKiBEZWNyZWFzZSB0aGUgc2l6ZSBvZiB0aGUgYXJyYXkgdG8gYSBiYXJlIG1pbmltdW0uICov CisgICAgICAgICAgICAgIHhucmVhbGxvYyAody0+ZmNfZWx0cy5jYWNoZXMsIDEsIHNpemVvZiAq dy0+ZmNfZWx0cy5jYWNoZXMpOworICAgICAgICAgICAgICB3LT5mY19lbHRzLnVzZWQgPSAwOwor ICAgICAgICAgICAgICB3LT5mY19lbHRzLmFsbG9jYXRlZCA9IDE7CisgICAgICAgICAgICB9Cisg ICAgICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKSAmJiAhTklMUCAoQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIC8vICAvKiBTZXQgYWxsIF91c2VkXyBlbGVtZW50cyBvZiB0aGUgYXJyYXkgdG8gemVyby4g IF9lbHRzLmFsbG9jYXRlZCByZW1haW4KKyAgICAgICAgICAgICAgLy8gIHRoZSBzYW1lLiAqLwor ICAgICAgICAgICAgICAvLyAgbWVtc2V0ICh3LT5mY19lbHRzLmNhY2hlcywgMCwgdy0+ZmNfZWx0 cy51c2VkICogKHNpemVvZiAqdy0+ZmNfZWx0cy5jYWNoZXMpKTsKKyAgICAgICAgICAgICAgdy0+ ZmNfZWx0cy51c2VkID0gMDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBicmVhazsKKyAgICAg ICAgfQorICAgIH0KK30KKworc3RhdGljIHZvaWQKK21jX2hlbHBlciAoc3RydWN0IHdpbmRvdyAq dywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisg ICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGgsIGludCB4LCBpbnQgZngsIGludCB5LCBpbnQg ZnksIGludCBocG9zLCBpbnQgdnBvcywKKyAgICAgICAgICAgaW50IHdkLCBpbnQgaCwgZW51bSB0 eXBlX29mX2N1cnNvciBjdXJzb3JfdHlwZSwgaW50IGN1cnNvcl93aWR0aCwKKyAgICAgICAgICAg c3RydWN0IG1jX1JHQiBmb3JlZ3JvdW5kLCBzdHJ1Y3QgbWNfUkdCIGJhY2tncm91bmQsIGJvb2wg YWN0aXZlX3AsCisgICAgICAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciwgYm9vbCBk cmF3X3AsIGVudW0gdHlwZV9vZl9jYWNoZSBjYWNoZV90eXBlKQoreworICBpZiAoZ2x5cGggIT0g TlVMTAorICAgICAgJiYgZ2x5cGgtPnUuY2ggPT0gOTUKKyAgICAgICYmIGN1cnNvcl90eXBlID09 IE1DX0hCQVIpCisgICAgeworICAgICAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFt ZSk7CisgICAgICBlbnVtIGZhY2VfaWQgc3BlY2lhbF9jaGFyX2ZhY2VfaWQgPQorICAgICAgICBs b29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1zcGVjaWFsLWNoYXJhY3Rlci1mYWNl IiksIHRydWUpOworICAgICAgc3RydWN0IGZhY2UgKnNwZWNpYWxfY2hhcl9mYWNlID0gRkFDRV9G Uk9NX0lEIChmLCBzcGVjaWFsX2NoYX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gY2FjaGUgd2l0aAorICAgICAgICAgIGN1cnNvciBkYXRhLCBh cyB0aGF0IHdpbGwgY2F1c2UgYSBTSUdTRUdWIChzZWdtZW50YXRpb24gZmF1bHQpLiAqLworICAg ICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgY2FzZSBNQ19DQUNIRToKKyAgICAgICAg eworICAgICAgICAgICsrdy0+bWNfZWx0cy51c2VkOworICAgICAgICAgIGlmICh3LT5tY19lbHRz LmFsbG9jYXRlZCA8IHctPm1jX2VsdHMudXNlZCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgaW50IG9sZF9hbGxvYyA9IHctPm1jX2VsdHMuYWxsb2NhdGVkOworICAgICAgICAgICAgICBp bnQgbmV3X2VsdHMgPSB3LT5tY19lbHRzLnVzZWQgLSB3LT5tY19lbHRzLmFsbG9jYXRlZDsKKyAg ICAgICAgICAgICAgdy0+bWNfZWx0cy5jYWNoZXMgPSB4cGFsbG9jICh3LT5tY19lbHRzLmNhY2hl cywgJnctPm1jX2VsdHMuYWxsb2NhdGVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIG5ld19lbHRzLCBJTlRfTUFYLCBzaXplb2YgKnctPm1jX2VsdHMuY2FjaGVz KTsKKyAgICAgICAgICAgICAgbWVtc2V0ICh3LT5tY19lbHRzLmNhY2hlcyArIG9sZF9hbGxvYywg MCwKKyAgICAgICAgICAgICAgICAgICAgICAgKHctPm1jX2VsdHMuYWxsb2NhdGVkIC0gb2xkX2Fs bG9jKSAqIHNpemVvZiAqdy0+bWNfZWx0cy5jYWNoZXMpOworICAgICAgICAgICAgfQorICAgICAg ICAgIGZvb19lbHRzLmNhY2hlcyA9IHctPm1jX2VsdHMuY2FjaGVzOworICAgICAgICAgIGZvb19l bHRzLmFsbG9jYXRlZCA9IHctPm1jX2VsdHMuYWxsb2NhdGVkOworICAgICAgICAgIGZvb19lbHRz LnVzZWQgPSB3LT5tY19lbHRzLnVzZWQ7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAg ICAgIGNhc2UgQ0hfQ0FDSEU6CisgICAgICAgIHsKKyAgICAgICAgICArK3ctPmNoX2VsdHMudXNl ZDsKKyAgICAgICAgICBpZiAody0+Y2hfZWx0cy5hbGxvY2F0ZWQgPCB3LT5jaF9lbHRzLnVzZWQp CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGludCBvbGRfYWxsb2MgPSB3LT5jaF9lbHRz LmFsbG9jYXRlZDsKKyAgICAgICAgICAgICAgaW50IG5ld19lbHRzID0gdy0+Y2hfZWx0cy51c2Vk IC0gdy0+Y2hfZWx0cy5hbGxvY2F0ZWQ7CisgICAgICAgICAgICAgIHctPmNoX2VsdHMuY2FjaGVz ID0geHBhbGxvYyAody0+Y2hfZWx0cy5jYWNoZXMsICZ3LT5jaF9lbHRzLmFsbG9jYXRlZCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfZWx0cywgSU5UX01B WCwgc2l6ZW9mICp3LT5jaF9lbHRzLmNhY2hlcyk7CisgICAgICAgICAgICAgIG1lbXNldCAody0+ Y2hfZWx0cy5jYWNoZXMgKyBvbGRfYWxsb2MsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICh3 LT5jaF9lbHRzLmFsbG9jYXRlZCAtIG9sZF9hbGxvYykgKiBzaXplb2YgKnctPmNoX2VsdHMuY2Fj aGVzKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBmb29fZWx0cy5jYWNoZXMgPSB3LT5jaF9l bHRzLmNhY2hlczsKKyAgICAgICAgICBmb29fZWx0cy5hbGxvY2F0ZWQgPSB3LT5jaF9lbHRzLmFs bG9jYXRlZDsKKyAgICAgICAgICBmb29fZWx0cy51c2VkID0gdy0+Y2hfZWx0cy51c2VkOworICAg ICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBjYXNlIEZDX0NBQ0hFOgorICAgICAgICB7 CisgICAgICAgICAgKyt3LT5mY19lbHRzLnVzZWQ7CisgICAgICAgICAgaWYgKHctPmZjX2VsdHMu YWxsb2NhdGVkIDwgdy0+ZmNfZWx0cy51c2VkKQorICAgICAgICAgICAgeworICAgICAgICAgICAg ICBpbnQgb2xkX2FsbG9jID0gdy0+ZmNfZWx0cy5hbGxvY2F0ZWQ7CisgICAgICAgICAgICAgIGlu dCBuZXdfZWx0cyA9IHctPmZjX2VsdHMudXNlZCAtIHctPmZjX2VsdHMuYWxsb2NhdGVkOworICAg ICAgICAgICAgICB3LT5mY19lbHRzLmNhY2hlcyA9IHhwYWxsb2MgKHctPmZjX2VsdHMuY2FjaGVz LCAmdy0+ZmNfZWx0cy5hbGxvY2F0ZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgbmV3X2VsdHMsIElOVF9NQVgsIHNpemVvZiAqdy0+ZmNfZWx0cy5jYWNoZXMp OworICAgICAgICAgICAgICBtZW1zZXQgKHctPmZjX2VsdHMuY2FjaGVzICsgb2xkX2FsbG9jLCAw LAorICAgICAgICAgICAgICAgICAgICAgICAody0+ZmNfZWx0cy5hbGxvY2F0ZWQgLSBvbGRfYWxs b2MpICogc2l6ZW9mICp3LT5mY19lbHRzLmNhY2hlcyk7CisgICAgICAgICAgICB9CisgICAgICAg ICAgZm9vX2VsdHMuY2FjaGVzID0gdy0+ZmNfZWx0cy5jYWNoZXM7CisgICAgICAgICAgZm9vX2Vs dHMuYWxsb2NhdGVkID0gdy0+ZmNfZWx0cy5hbGxvY2F0ZWQ7CisgICAgICAgICAgZm9vX2VsdHMu dXNlZCA9IHctPmZjX2VsdHMudXNlZDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAg IH0KKyAgaW50IG50aCA9IGZvb19lbHRzLnVzZWQgLSAxOworICBmb29fZWx0cy5jYWNoZXNbbnRo XS54ID0geDsKKyAgZm9vX2VsdHMuY2FjaGVzW250aF0uZnggPSBmeDsKKyAgZm9vX2VsdHMuY2Fj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gICAgICAgICAgICAgICAgZW51bSB0eXBlX29mX2N1cnNvciBj dXJzb3JfdHlwZSwgaW50IGN1cnNvcl93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGlu dCAqd2QpCit7CisgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSBtY19nZXRfY3Vyc29yX2dseXBoICh3 LCBtYXRyaXgsIHJvdywgaHBvcywgdnBvcyk7CisgIGlmIChnbHlwaCA9PSBOVUxMKQorICAgIHJl dHVybjsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAg KmZ4ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgeCk7CisgICpoID0gcm93LT52 aXNpYmxlX2hlaWdodDsKKyAgLyogRG9uJ3QgbGV0IHRoZSBjdXJzb3IgZXhjZWVkIHRoZSBkaW1l bnNpb25zIG9mIHRoZSByb3csIHNvIHRoYXQKKyAgdGhlIHVwcGVyL2xvd2VyIHNpZGUgb2YgdGhl IGJveCBhcmVuJ3QgY2xpcHBlZC4gICovCisgIGludCB3X2hlYWRlcl9saW5lX2hlaWdodCA9IFdJ TkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICBpbnQgd190ZXh0X2JvdHRvbV95ID0gd2lu ZG93X3RleHRfYm90dG9tX3kgKHcpIC0gKmg7CisgIGlmICh5IDwgd19oZWFkZXJfbGluZV9oZWln aHQpCisgICAgeworICAgICAgKmggPSBtYXggKCpoIC0gKHdfaGVhZGVyX2xpbmVfaGVpZ2h0IC0g eSkgKyAxLCAqaCk7CisgICAgICB5ID0gd19oZWFkZXJfbGluZV9oZWlnaHQgLSAxOworICAgICAg Ly8gZnByaW50ZiAoc3RkZXJyLCAiQ09ORElUSU9OICMgMVxuIik7CisgICAgfQorICAgZWxzZSBp ZiAoeSA+IHdfdGV4dF9ib3R0b21feSkKKyAgICAgeworICAgICAgICpoICs9IHkgLSB3X3RleHRf Ym90dG9tX3k7CisgICAgICAgeSA9IHdfdGV4dF9ib3R0b21feTsKKyAgICAgICAvLyBmcHJpbnRm IChzdGRlcnIsICJDT05ESVRJT04gIyAyXG4iKTsKKyAgICAgfQorICAqZnkgPSBXSU5ET1dfVE9f RlJBTUVfUElYRUxfWSAodywgeSk7CisgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgeworICAg ICAgY2FzZSBNQ19CQVI6CisgICAgICAgIHsKKyAgICAgICAgICBpZiAoY3Vyc29yX3dpZHRoIDwg MSkKKyAgICAgICAgICAgIGN1cnNvcl93aWR0aCA9IG1heCAoRlJBTUVfQ1VSU09SX1dJRFRIIChm KSwgMSk7CisgICAgICAgICAgaWYgKGN1cnNvcl93aWR0aCA8IGdseXBoLT5waXhlbF93aWR0aCkK KyAgICAgICAgICAqd2QgPSBjdXJzb3Jfd2lkdGg7CisgICAgICAgICAgYnJlYWs7CisgICAgICAg IH0KKyAgICAgIGNhc2UgTUNfSEJBUjoKKyAgICAgICAgeworICAgICAgICAgIGludCBjdXJzb3Jf aGVpZ2h0ID0gKGN1cnNvcl93aWR0aCA8IDEpID8gbHJpbnQgKDAuMjUgKiAqaCkgOiBjdXJzb3Jf d2lkdGg7CisgICAgICAgICAgaWYgKGN1cnNvcl9oZWlnaHQgPiByb3ctPmhlaWdodCkKKyAgICAg ICAgICAgIGN1cnNvcl9oZWlnaHQgPSByb3ctPmhlaWdodDsKKyAgICAgICAgICAvKiBDdXJzb3Ig c21hbGxlciB0aGFuIGxpbmUgaGVpZ2h0LCBzbyBtb3ZlIGRvd24uICovCisgICAgICAgICAgaWYg KCpoID4gY3Vyc29yX2hlaWdodCkKKyAgICAgICAgICAgICpmeSArPSAqaCAtIGN1cnNvcl9oZWln aHQ7CisgICAgICAgICAgKmggPSBjdXJzb3JfaGVpZ2h0OworICAgICAgICAgICp3ZCA9IGdseXBo LT5waXhlbF93aWR0aDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgY2FzZSBN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ZmFrZV9jdXJzb3JfcCA9IChvcG9pbnRfeCA9 PSByZWxhdGl2ZV94CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF9ocG9z ID09IGhwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3kgPT0gZ2x5 cGgtPnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3Zwb3MgPT0gdnBv cyk7CisKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAg IEJFR0lOOiAgQ0hBUl9HTFlQSCB8IEdMWVBITEVTU19HTFlQSCAgICAgICAgICAgICAgICAgICov CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgaWYgKGdseXBoLT50eXBlID09IENIQVJfR0xZ UEgKKyAgICAgIHx8IGdseXBoLT50eXBlID09IEdMWVBITEVTU19HTFlQSCkKKyAgeworICAgIGlm IChtY19zdGRlcnJfcCkKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIlxuICU1InBE ImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICU1ZCAl NGQgICUzZCAgJTNkICVzICVzXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRf QVJFQV0sCisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFth cmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAoZ2x5cGgtPnR5cGUgPT0g Q0hBUl9HTFlQSAorICAgICAgICAgPyAnQycKKyAgICAgICAgIDogJ0cnKSwKKyAgICAgICAgZ2x5 cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAg PyAnQicKKyAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ ICdTJworICAgICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAg ID8gJzAnCisgICAgICAgICAgICAgICA6ICctJykpKSwKKyAgICAgICAgICAgICAgZ2x5cGgtPnBp eGVsX3dpZHRoLAorICAgICAgICBnbHlwaC0+dS5jaCwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQs CisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdodF9i b3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+eCwgZ2x5cGgtPnksIGdseXBoLT5ocG9zLCBnbHlw aC0+dnBvcywgZ2x5cGgtPnp2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgbWNfY2hhcl90b19z dHJpbmcgKGdseXBoLT51LmNoKSk7CisgIHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsKKy8qIC0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTOiAg Q0hBUl9HTFlQSCB8IEdMWVBITEVTU19HTFlQSCAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIE1VTFRJUExFX0NVUlNPUlM6CisgICAgeworICAgICAg bWNfaGVscGV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Boc1tURVhUX0FSRUFdID09IHJvdy0+dXNl ZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiByZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAg IHsKKyAgICAgICAgICBpZiAocmVsYXRpdmVfeCA8IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOwor ICAgICAgICAgICAgICBmeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICB9Cisg ICAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4 LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgIHhfbGltaXQgLSByZWxh dGl2ZV94LCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLAorICAgICAgICAgICAgICAgICAg ICAgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwgYWN0aXZlX3AsIE1DX0dMWVBITEVTUywgZHJhd19w LAorICAgICAgICAgICAgICAgICAgICAgY2FjaGVfdHlwZSk7CisgICAgICAgIH0KKyAgICAgIGJy ZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICBW RVJUSUNBTF9SVUxFUjogIENIQVJfR0xZUEggfCBHTFlQSExFU1NfR0xZUEggICAgICAgICAgICAg ICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIFZFUlRJQ0FMX1JVTEVS OgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChjdXJzb3JfaW5f ZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRf cCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisg ICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAg ICAgICAgJiYgcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVS VElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9pbl9mcmlu Z2VfcAorICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9w CisgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAg ICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgIDogKGdseXBo IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAg ICAgICAgICAgICAgICAgJiYgb3BvaW50X3ggPj0gcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAg ICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgOiAoenZfcCkK KyAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAg OiBNQ19HTFlQSDsKKyAgICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJ R0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9C QUNLU0xBU0gKKyAgICAgICAgICB8fCBnbHlw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g ICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICA6ICghTklMUCAo QlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAg ICAgICAgICAgICAgICYmIG9wb2ludF95ID09IHkKKyAgICAgICAgICAgICAgICAgICAgICAmJiBv cG9pbnRfdnBvcyA9PSB2cG9zKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MK KyAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgd2QgPSAxOworICAgICAgbWNf aGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZjX2Z4LCB5LCBmeSwg aHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jf d2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgIGFjdGl2ZV9w LCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgY2FjaGVfdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9 CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgfQorICB9CisvKiAtLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgRU5EOiAgQ0hBUl9HTFlQSCB8IEdMWVBI TEVTU19HTFlQSCAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICov CisKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAg ICAgIEJFR0lOOiAgU1RSRVRDSF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisv KiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gU1RSRVRD SF9HTFlQSCkKKyAgeworICAgIGlmIChtY19zdGRlcnJfcCkKKyAgICAgIGZwcmludGYgKHN0ZGVy ciwKKyAgICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4 ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNkICVzICVzXG4iLAorICAgICAgICBnbHlw aCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09 IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAg ICAgICAnUycsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5 cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+ b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5v YmplY3QpCisgICAgICAgICAgICAgICA/ICcwJworICAgICAgICAgICAgICAgOiAnLScpKSksCisg ICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgMHUsCisgICAgICAgIGdseXBoLT5m YWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+ cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBv cywgZ2x5cGgtPnZwb3MsIGdseXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICJcXFMi KTsKKyAgc3dpdGNoIChhY3Rpb25fdHlwZSkKKyAgeworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICov CisvKiAgICAgICAgICAgICAgICAgICAgICAgIE1VTFRJUExFX0NVUlNPUlM6ICBTVFJFVENIX0dM WVBIICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAg IGNhc2UgTVVMVElQTEVfQ1VSU09SUzoKKyAgICB7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJp eCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAg ICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwg YmFja2dyb3VuZCwKKyAgICAgICAgICAgICAgICAgYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3As IGNhY2hlX3R5cGUpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0t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AgICAg ICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICBzdHJ1Y3Qg bWNfUkdCIGJhY2tncm91bmQ7CisgICAgICAgICAgbWNfc2V0X2JnX2xzbCAodywgdGVtcF9mYWNl X2lkLCAmYmFja2dyb3VuZCk7CisgICAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywg Z2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAg ICAgICAgIHhfbGltaXQgLSByZWxhdGl2ZV94LCBoLCBjdXJzb3JfdHlwZSwgeF9saW1pdCAtIHJl bGF0aXZlX3gsCisgICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLCBh Y3RpdmVfcCwgTUNfR0xZUEhMRVNTLCBkcmF3X3AsCisgICAgICAgICAgICAgICAgICAgICBjYWNo ZV90eXBlKTsKKyAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgVkVSVElDQUxfUlVMRVI6ICBT VFJFVENIX0dMWVBIICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LSAqLworICAgIGNhc2UgVkVSVElDQUxfUlVMRVI6CisgICAgeworICAgICAgaWYgKHJvdy0+Zmls bF9saW5lX3AKKyAgICAgICAgICAmJiBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0g cm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICYmIG9wb2ludF94ID4gcmVsYXRpdmVfeCAr IGdseXBoLT5waXhlbF93aWR0aCkKKyAgICAgICAgdGVtcF9mYWNlX2lkID0gZ2x5cGgtPmZhY2Vf aWQ7CisgICAgICAgIGVsc2UgaWYgKCFyb3ctPmZpbGxfbGluZV9wCisgICAgICAgICAgICAgICAg ICYmIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAx CisgICAgICAgICAgICAgICAgICYmIG9wb2ludF94ID4gcmVsYXRpdmVfeCArIGdseXBoLT5waXhl bF93aWR0aCkKKyAgICAgICAgICB0ZW1wX2ZhY2VfaWQgPSBERUZBVUxUX0ZBQ0VfSUQ7CisgICAg ICBzdHJ1Y3QgbWNfUkdCIGJhY2tncm91bmQ7CisgICAgICBtY19zZXRfYmdfbHNsICh3LCB0ZW1w X2ZhY2VfaWQsICZiYWNrZ3JvdW5kKTsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZv ciA9IChjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVu Y2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFS X1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2luX2ZyaW5nZV9wCisg ICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgICAg ICAgICAgID8gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgIDog KGN1cnNvcl9pbl9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5j YXRlZF9vbl9yaWdodF9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+Y29udGludWVk X3ApCisgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAg ICAgICAgIDogTUNfR0xZUEhMRVNTOworICAgICAgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJU SUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVS VElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJU SUNBTF9CQVIpCisgICAgICAgIGN1cnNvcl90eXBlID0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUDsK KyAgICAgIHdkID0gMTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCBv cG9pbnRfeCwgb3BvaW50X2Z4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAg d2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQs CisgICAgICAgICAgICAgICAgIGFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgY2FjaGVf dHlwZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8q ICAgICAgICAgICAgICAgICAgICAgICAgICAgRklMTF9DT0xVTU46ICBTVFJFVENIX0dMWVBIICAg ICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2Fz ZSBGSUxMX0NPTFVNTjoKKyAgICB7CisgICAgICBpZiAocm93LT5maWxsX2xpbmVfcAorICAgICAg ICAgICYmIGdseXBoIC0gcm93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KyAgfQorLyogLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFTkQ6 ICBTVFJFVENIX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLSAqLworCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgQkVHSU46ICBJTUFHRV9HTFlQSCAgICAgICAgICAgICAgICAgICAg ICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgIGVsc2UgaWYgKGdseXBoLT50 eXBlID09IElNQUdFX0dMWVBIKQorICB7CisgICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAgZnBy aW50ZiAoc3RkZXJyLAorICAgICAgICAiXG4gJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVj ICUzZCAweCUwNnggJTRkICUxLjFkJTEuMWQgJTVkICU0ZCAgJTNkICAlM2QgJXMgJWNcbiIsCisg ICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVz ZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0 aXZlX3gsCisgICAgICAgICdJJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChC VUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNUUklO R1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgOiAoTklM UCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAgICA6 ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAodW5zaWduZWQg aW50KSBnbHlwaC0+dS5pbWdfaWQsCisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBn bHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwK KyAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgZ2x5cGgtPnZwb3MsIGds eXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7CisgIHN3aXRjaCAoYWN0aW9u X3R5cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAg ICAgICAgICAgTVVMVElQTEVfQ1VSU09SUzogIElNQUdFX0dMWVBIICAgICAgICAgICAgICAgICAg ICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIE1VTFRJUExFX0NVUlNP UlM6CisgICAgeworICAgICAgY3Vyc29yX3R5cGUgPSBNQ19IT0xMT1dfQk9YOworICAgICAgbWNf aGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBv cywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lk dGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgIGFjdGl2ZV9wLCBN Q19HTFlQSCwgZHJhd19wLCBjYWNoZV90eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgSE9SSVpPTlRB TF9SVUxFUjogIElNQUdFX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEhPUklaT05UQUxfUlVMRVI6CisgICAgeworICAgICAg Y3Vyc29yX3R5cGUgPSBNQ19IT0xMT1dfQk9YOworICAgICAgaWYgKCFyZWFsX2Zha2VfY3Vyc29y X3ApCisgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94 LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNv cl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAg ICAgICAgICAgYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGNhY2hlX3R5cGUpOworICAgICAg YnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS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2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKQorICB7CisgICAgaWYgKG1jX3N0 ZGVycl9wKQorICAgICAgeworICAgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICAgIlxu ICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4IiwKKyAgICAgICAgICBn bHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgKChyb3ctPnVzZWRbYXJl YV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgICAgcmVsYXRpdmVf eCwKKyAgICAgICAgICAnKycsCisgICAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgICAg KEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgID8gJ0InCisgICAgICAgICAgIDog KFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAg ICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICAgID8gJzAnCisgICAg ICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAg ICAgICAgICAodW5zaWduZWQgaW50KSBnbHlwaC0+dS5jbXAuaWQpOworICAgICAgICBmcHJpbnRm IChzdGRlcnIsICIgJTRkICUxLjFkJTEuMWQiLAorICAgICAgICAgIGdseXBoLT5mYWNlX2lkLAor ICAgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgICAgZ2x5cGgtPnJpZ2h0 X2JveF9saW5lX3ApOworICAgICAgaWYgKGdseXBoLT51LmNtcC5hdXRvbWF0aWMpCisgICAgICAg IGZwcmludGYgKHN0ZGVyciwgIiAlNWQgJTRkICAlM2QgICUzZCAlcyAuIFslZC0lZF1cbiIsCisg ICAgICAgICAgICAgICAgICAgICAgICAg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S0tLSAqLwor LyogICAgICAgICAgICAgICAgICAgICAgIEhPUklaT05UQUxfUlVMRVI6ICBDT01QT1NJVEVfR0xZ UEggICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBj YXNlIEhPUklaT05UQUxfUlVMRVI6CisgICAgeworICAgICAgaWYgKHJlbGF0aXZlX3ggPD0geF9s aW1pdAorICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBl ciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZw b3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgs IGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgICAgYWN0aXZlX3AsIE1D X0dMWVBILCBkcmF3X3AsIGNhY2hlX3R5cGUpOworICAgICAgaWYgKGdseXBoIC0gcm93LT5nbHlw aHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYgcmVsYXRp dmVfeCA8PSB4X2xpbWl0KQorICAgICAgICB7CisgICAgICAgICAgcmVsYXRpdmVfeCArPSBnbHlw aC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgd2hpbGUgKHJlbGF0aXZlX3ggPD0geF9saW1pdCkK KyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywg Z2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAg ICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwg YmFja2dyb3VuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVfcCwgTUNfR0xZUEhM RVNTLCBkcmF3X3AsIGNhY2hlX3R5cGUpOworICAgICAgICAgICAgICByZWxhdGl2ZV94ICs9IGZy YW1lX2NoYXJfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGJyZWFrOwor ICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAg ICAgVkVSVElDQUxfUlVMRVI6ICBDT01QT1NJVEVfR0xZUEggICAgICAgICAgICAgICAgICAgICov CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIFZFUlRJQ0FMX1JVTEVSOgorICAg IHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChjdXJzb3JfaW5fZnJpbmdl X3AKKyAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAg ICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAg ICAgICAgICAgICAgOiAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAg JiYgcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxf QkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9pbl9mcmluZ2VfcAor ICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wCisgICAg ICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAgICAg ICAgICA/IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgIDogKGdseXBoIC0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAg ICAgICAgICAgJiYgb3BvaW50X3ggPiByZWxhdGl2ZV94KQorICAgICAgICAgICAgICAgICAgICAg PyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICA6ICh6dl9wKQorICAgICAgICAgICAg ICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBIOwor ICAgICAgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAg ICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAg ICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIpCisgICAgICAgIGN1cnNv cl90eXBlID0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUDsKKyAgICAgIHdkID0gMTsKKyAgICAgIG1j X2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBvcG9pbnRfZngsIHks IGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1 cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwKKyAgICAgICAgICAgICAgICAgYWN0 aXZlX3AsIGdseXBoX2ZsYXZvciwgZHJhd19wLCBjYWNoZV90eXBlKTsKKyAgICAgIGJyZWFrOwor ICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAg ICAgIEZJTExfQ09MVU1OOiAgQ09NUE9TSVRFX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICov CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEZJTExfQ09MVU1OOgorICAgIHsK KyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChnbHlwaCAtIHJvdy0+Z2x5cGhz W1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAg ICYmIGZjX3ggPiByZWxhdGl2ZV94KQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExF U1MKKyAgICAgICAgICAgICAgICAgICA6ICh6dl9wKQorICAgICAgICAgICAgICAgICAgICAgPyBN Q19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICA6ICghTklMUCAoQlZBUiAoYiwgY3Jvc3No YWlycykpCisgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAgICYm IG9wb2ludF95ID09IHkKKyAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfdnBvcyA9PSB2 cG9zKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAg ICAgICA6IE1DX0dMWVBIOworICAgICAgd2QgPSAxOworICAgICAgbWNfaGVscGVyICh3LCBtYXRy aXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZjX2Z4LCB5LCBmeSwga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VZFX1hXSURHRVRTCisgICAgZWFzc3VtZSAoZmFsc2UpOworI2Vsc2UKKyAgICBp ZiAobWNfc3RkZXJyX3ApCisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICJcbiAgJTVk LyUtNWQgJTVkICU0YyAlNmQgJWMgJTNkIDB4JTA1eCAlNGQgJTEuMWQlMS4xZCAlNWQgJTRkICAl M2QgICUzZCAlcyAlY1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFd LAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0g LSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ1gnLAorICAgICAgICBnbHlwaC0+ Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICA/ICdC JworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1Mn CisgICAgICAgICAgICA6ICctJykpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAg ICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAg ICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnUueHdpZGdldCwK KyAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgZ2x5cGgtPnZwb3MsIGds eXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7CisjZW5kaWYKKyAgc3dpdGNo IChhY3Rpb25fdHlwZSkKKyAgeworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKi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bGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAg ICAgICAgICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdy b3VuZCwgYmFja2dyb3VuZCwKKyAgICAgICAgICAgICAgICAgICBhY3RpdmVfcCwgTUNfR0xZUEgs IGRyYXdfcCwgY2FjaGVfdHlwZSk7CisgICAgICBpZiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhU X0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiByZWxhdGl2ZV94IDw9 IHhfbGltaXQpCisgICAgICAgIHsKKyAgICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhl bF93aWR0aDsKKyAgICAgICAgICB3aGlsZSAocmVsYXRpdmVfeCA8PSB4X2xpbWl0KQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwg cmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAg ICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBiYWNrZ3Jv dW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2ZV9wLCBNQ19HTFlQSExFU1MsIGRy YXdfcCwgY2FjaGVfdHlwZSk7CisgICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZnJhbWVfY2hh cl93aWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQor LyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgVkVS VElDQUxfUlVMRVI6ICBYV0lER0VUX0dMWVBIICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgVkVSVElDQUxfUlVMRVI6CisgICAgeworICAg ICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1cnNvcl9pbl9mcmluZ2VfcAorICAg ICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAg ICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAg ICAgICA6IChjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiByb3ct PmNvbnRpbnVlZF9wKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfQkFD S1NMQVNICisgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAg ICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3AKKyAgICAgICAgICAg ICAgICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgID8g TUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBo c1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAg ICAmJiBvcG9pbnRfeCA+IHJlbGF0aXZlX3gpCisgICAgICAgICAgICAgICAgICAgICA/IE1DX0dM WVBITEVTUworICAgICAgICAgICAgICAgICAgIDogKHp2X3ApCisgICAgICAgICAgICAgICAgICAg ICA/IE1DX0dMWVBITEVTUworICAgICAgICAg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ZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgJiYgZmNfeCA+IHJlbGF0aXZlX3gp CisgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAg IDogKHp2X3ApCisgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAg ICAgICAgICAgIDogKCFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAg ICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF92ZXJ0aWNh bF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3kgPT0geQorICAgICAg ICAgICAgICAgICAgICAgICYmIG9wb2ludF92cG9zID09IHZwb3MpCisgICAgICAgICAgICAgICAg ICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgIDogTUNfR0xZUEg7CisgICAg ICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZmNfZngsIHks IGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1 cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwKKyAgICAgICAgICAgICAgICAgYWN0 aXZlX3AsIGdseXBoX2ZsYXZvciwgZHJhd19wLCBjYWNoZV90eXBlKTsKKyAgICAgIGJyZWFrOwor ICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICB9CisgIH0KKy8qIC0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRU5EOiAgWFdJREdF VF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KK30KKwordm9pZAorbWNfZHJhd19yb3cgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBn bHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAg IHN0cnVjdCBnbHlwaCAqc3RhcnQsIGludCB4LCBpbnQgaHBvc19sZW5ndGgsIGludCB2cG9zLAor ICAgICAgICAgICAgIGludCBib3R0b21fdnBvcywgYm9vbCBhY3RpdmVfcCwgaW50IGZjX3gsIHN0 cnVjdCBtY19SR0IgY2hfZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGZj X2ZvcmVncm91bmQsIGJvb2wgZHJhd19wKQoreworLyoKKyAgY2xvY2tfdCBjbG9ja19zdGFydCA9 IGNsb2NrKCk7CisqLworICAvKiBOVCBFbWFjcyBjcmFzaGVzIG9uIHN0YXJ0dXAgd2l0aG91dCBh IGBCVUZGRVJQJyBjaGVjayBpbiBgdXBkYXRlX3dpbmRvdycuICovCisgIGlmICghQlVGRkVSUCAo dy0+Y29udGVudHMpKQorICAgIHJldHVybjsKKyAgaWYgKE5JTFAgKEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBmY192aXNpYmxlKSkpCisgICAgcmV0dXJuOworICBpZiAodnBvcyA9PSBib3R0 b21fdnBvcykKKyAgICByZXR1cm47CisgIGlmICghcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAg cmV0dXJuOworICBpbnQgaHBvc19zdGFydCA9IHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVB XTsKKyAgaWYgKHRyYWNlX3JlZGlzcGxheV9wKQorICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX2Ry YXdfcm93ICglcyk6ICB2cG9zICglZCkgfCBocG9zICglZCkgfCBsZW4gKCVkKVxuIiwKKyAgICAg ICAgICAgICAgICAgICAgIG1jX3dpbmRvdyAodyksIHZwb3MsIGhwb3Nfc3RhcnQsIGhwb3NfbGVu Z3RoKTsKKyAgTGlzcF9PYmplY3Qgd2luZG93OworICBYU0VUV0lORE9XICh3aW5kb3csIHcpOwor ICBzdHJ1Y3QgZ2x5cGggKmN1cnNvcl9nbHlwaCA9CisgICAgbWNfZ2V0X2N1cnNvcl9nbHlwaCAo dywgbWF0cml4LCByb3csIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcyk7CisgIGludCBv cG9pbnRfZngsIG9wb2ludF9meSwgb3BvaW50X3dkLCBvcG9pbnRfaDsKKyAgc3RydWN0IGZyYW1l ICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIExpc3BfT2JqZWN0IGJ1ZiA9IHctPmNvbnRlbnRz OworICBDSEVDS19CVUZGRVIgKGJ1Zik7CisgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSIChi dWYpOworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBCRUdJTiBKT1VSTkVZIC4uLgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisgIGludCBm cmFtZV9jaGFyX3dpZHRoID0gRlJBTUVfQ09MVU1OX1dJRFRIIChmKTsKKyAgaW50IHRleHRfYXJl YV93aWR0aCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgIGludCBoZWFkZXJf bGluZV9mb3JtYXQgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgYm9vbCBjdXJz b3JfaW5fZnJpbmdlX3AgPSB3LT5jdXJzb3IueCArIGZyYW1lX2NoYXJfd2lkdGggPj0gdGV4dF9h cmVhX3dpZHRoOworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAg ICAgICAgICBFUkFTRSBUSEUgUkVBTCBDVVJTT1IKKyoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor ICBpZiAoZHJhd19wCisgICAgICAmJiB3LT5waHlzX2N1cnNvcl9vbl9wCisgICAgICAmJiB2cG9z ID09IHctPmN1cnNvci52cG9zKQorICAgIHsKKyAgICAgIG1jX2VyYXNlX2N1cnNvciAodywgbWF0 cml4LCByb3csIHctPmN1cnNvci54LCB3LT5jdXJzb3IueSwgdy0+Y3Vyc29yLmhwb3MsCisgICAg ICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci52cG9zLCBNQ19HTFlQSCwgdy0+cGh5c19jdXJz b3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX2dseXBoLT5waXhlbF93aWR0 aCk7CisgICAgICB3LT5waHlzX2N1cnNvcl9vbl9wID0gZmFsc2U7CisgICAgICB3LT5waHlzX2N1 cnNvcl90eXBlID0gTk9fQ1VSU09SOworICAgIH0KKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgor ICAgICAgICAgICAgICAgICAgICAgICAgICBSRVBMQUNFIFRIRSBSRUFMIENVUlNPUgorKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisgIGVudW0gZmFjZV9pZCBiZ19mYWNlX2lkID0gKGN1cnNvcl9n bHlwaCA9PSBOVUxMKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gREVGQVVMVF9GQUNF X0lECisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBjdXJzb3JfZ2x5cGgtPmZhY2VfaWQ7 CisgIHN0cnVjdCBtY19SR0IgY3Vyc29yX2JnOworICBtY19zZXRfYmdfbHNsICh3LCBiZ19mYWNl X2lkLCAmY3Vyc29yX2JnKTsKKyAgLyogRklYTUU6ICBQdXQgaW4gc29tZSBjb2RlIHRvIGRlZmF1 bHQgdG8gTUNfSE9MTE9XX0JPWCBpZiB0aGUgdXNlciBoYXMKKyAgdW53aXR0aW5nbHkgY29tZSB1 cCB3aXRoIHNvbWUgdW5hY2NlcHRhYmxlIGZvcm0gb2YgdW5yZWNvZ25pemVkIGN1cnNvciB0eXBl LiAqLworICBMaXNwX09iamVjdCBsaXNwX3R5cGUgPSBCVkFSIChiLCBtY19yZWFsX2Zha2VfY3Vy c29yKTsKKyAgZW51bSB0eXBlX29mX2N1cnNvciBjdXJzb3JfdHlwZSA9IChDT05TUCAobGlzcF90 eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IG1jX2xpc3Bf dG9fY3Vyc29yX3R5cGUgKFhDQVIgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiBtY19saXNwX3RvX2N1cnNvcl90eXBlIChsaXNwX3R5cGUpOwor ICBpbnQgY3Vyc29yX3dpZHRoID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICA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1 c3QgYSBsaXR0bGUgdGhpY2tlciB0aGFuIGFzIHdvdWxkIG5vcm1hbGx5IGJlIHRoZSBjYXNlLiAq LworICBib29sIGZpbGxfY29sdW1uX3RydW1wc19wID0gKCFOSUxQIChCVkFSIChiLCBjaF92ZXJ0 aWNhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gZmNfeCk7CisgIC8qIEZJWE1FOiAgRGV2 aXNlIGEgc3lzdGVtIHNvIHRoYXQgdGhpcyBvbmx5IGhhcHBlbnMgb25jZSBwZXIgcm93IHdoZW4K KyAgYGhwb3NfbGVuZ3RoYCBpcyBsZXNzIHRoYW4gdGhlIGVudGlyZSByb3cuICovCisgIGlmICh2 cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3 LT5jb250ZW50cyksIGNoX2hvcml6b250YWxfcnVsZXIpKSkKKyAgICB7CisgICAgICAvKiBmcmlu Z2UgYml0bWFwcyB1c2UgZmFjZV9pZCB0byBzZXQgdGhlIGZvcmVncm91bmQgY29sb3IuICBUaGUg b3ZlcmxheS1hcnJvdworICAgICAgaXMgcHJlc2VudGx5IHRoZSBvbmx5IHNpdHVhdGlvbiB3aGVy ZSB0aGUgYGFjdGl2ZV9wYCBhbmQgYG1pbmltYWxfcGAgYXJlCisgICAgICB1c2VkIHRvIGRldGVy bWluZSB0aGUgYXBwbGljYWJsZSBmYWNlX2lkLiAqLworICAgICAgc3RydWN0IG1jX1JHQiBmZ19s c2wgPSB7LnJlZCA9IC0xLjAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4g PSAtMS4wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSAtMS4wfTsKKyAg ICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngs IC0xLCB3LT5jdXJzb3IueSwgLTEsCisgICAgICAgICAgICAgICAgIHctPmN1cnNvci5ocG9zLCB3 LT5jdXJzb3IudnBvcywgLTEsIC0xLCBNQ19MRUZUX0ZSSU5HRV9CSVRNQVAsIC0xLAorICAgICAg ICAgICAgICAgICBmZ19sc2wsIGN1cnNvcl9iZywgYWN0aXZlX3AsIE1DX09WRVJMQVlfQVJST1df QklUTUFQLCBkcmF3X3AsCisgICAgICAgICAgICAgICAgIENIX0NBQ0hFKTsKKyAgICB9CisgIGlm IChjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MKKyAg ICAgICYmIHctPmN1cnNvci5ocG9zID49IGhwb3Nfc3RhcnQKKyAgICAgICYmIHctPmN1cnNvci5o cG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoCisgICAgICAmJiAhTklMUCAoQlZBUiAoWEJV RkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICYmICFOSUxQIChCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIGNoX2hvcml6b250YWxfcnVsZXIpKSkKKyAgICB7CisgICAg ICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT5jb250aW51ZWRfcCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19QSUxDUk9XCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3Jp Z2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfSE9MTE9X X1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiAoY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfSE9MTE9XX1JFQ1RBTkdMRQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOT19GTEFWT1I7CisgICAgICBtY19oZWxwZXIg KHcsIG1hdHJpeCwgcm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1cnNvci54LCAtMSwgdy0+Y3Vyc29y LnksIC0xLAorICAgICAgICAgICAgICAgICB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3Ms IC0xLCAtMSwgTUNfUklHSFRfRlJJTkdFX0JJVE1BUCwgLTEsCisgICAgICAgICAgICAgICAgIGN1 cnNvcl9mZywgY3Vyc29yX2JnLCBhY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCBkcmF3X3AsIENIX0NB Q0hFKTsKKyAgICB9CisgICAgLyogRVhBTVBMRSAoYnVmZmVyLWxvY2FsKTogIChzZXRxIG1jLXJl YWwtZmFrZS1jdXJzb3IgbmlsLyduby8ibm8iKSAqLworICAgIGVsc2UgaWYgKCFjdXJzb3JfaW5f ZnJpbmdlX3AKKyAgICAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19OT19DVVJTT1IKKyAg ICAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICAgJiYgdy0+ Y3Vyc29yLmhwb3MgPj0gaHBvc19zdGFydAorICAgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9z IDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoKQorICAgIHsKKyAgICAgIC8qIFdoZW4gYSB1c2Vy IGhhcyBub3Qgc3BlY2lmaWVkIGEgdmFsdWUgZm9yIGBtYy1yZWFsLWZha2UtY3Vyc29yJywgb3Ig dGhlCisgICAgICB2YWx1ZSBpcyBgbm9gIGluIHRoZSBmb3JtIG9mIGEgc3ltYm9sIG9yIHN0cmlu ZywgdGhlbiB0aGUgZGVmYXVsdCB3ZSB1c2UKKyAgICAgIGFuIE1DX0JBUiBhbmQgYW4gTUNfSEJB UiAtLSBib3RoIGhhdmluZyBhIGN1cnNvcl93aWR0aCBvZiAxLiAqLworICAgICAgbWNfZ2V0X2N1 cnNvcl9nZW9tZXRyeSAodywgbWF0cml4LCByb3csIHctPmN1cnNvci54LCAmb3BvaW50X2Z4LCB3 LT5jdXJzb3IueSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZvcG9pbnRfZnksIHct PmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgTUNfQkFSLCAxLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAo dywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+ Y3Vyc29yLnksCisgICAgICAgICAgICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHct PmN1cnNvci52cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9oLAorICAgICAgICAgICAgICAgICBNQ19C QVIsIDEsIGN1cnNvcl9mZywgY3Vyc29yX2JnLCBhY3RpdmVfcCwgTUNfR0xZUEhMRVNTLAorICAg ICAgICAgICAgICAgICBkcmF3X3AsIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg bWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgPyBDSF9DQUNIRQorICAgICAgICAg ICAgICAgICAgICAgICAgIDogTUNfQ0FDSEUpOworICAgICAgbWNfZ2V0X2N1cnNvcl9nZW9tZXRy eSAodywgbWF0cml4LCByb3csIHctPmN1cnNvci54LCAmb3BvaW50X2Z4LCB3LT5jdXJzb3IueSwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZvcG9pbnRfZnksIHctPmN1cnNvci5ocG9z LCB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgTUNfSEJBUiwgMSwgJm9wb2ludF93ZCk7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwg cm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1cnNvci54LCBvcG9pbnRfZngsIHctPmN1cnNvci55LAor ICAgICAgICAgICAgICAgICBvcG9pbnRfZnksIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBv cywgb3BvaW50X3dkLCBvcG9pbnRfaCwKKyAgICAgICAgICAgICAgICAgTUNfSEJBUiwgMSwgY3Vy c29yX2ZnLCBjdXJzb3JfYmcsIGFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLAorICAgICAgICAg ICAgICAgICBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAg ICAgICAgICAgICAgICA/IENIX0NBQ0hFCisgICAgICAgICAgICAgICAgIDogTUNfQ0FDSEUpOwor ICAgIH0KKyAgICBlbHNlIGlmICghY3Vyc29yX2luX2ZyaW5nZV9wCisgICAgICAgICAgICAgJiYg dnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID49 IGhwb3Nfc3RhcnQKKyAgICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA8IGhwb3Nfc3RhcnQg KyBocG9zX2xlbmd0aAorICAgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+dHlwZSAhPSBTVFJF VENIX0dMWVBIKQorICAgIHsKKyAgICAgIG1jX2dldF9jdXJzb3JfZ2VvbWV0cnkgKHcsIG1hdHJp eCwgcm93LCB3LT5jdXJzb3IueCwgJm9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29y LnZwb3MsICZvcG9pbnRfaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90 eXBlLCBjdXJzb3Jfd2lkdGgsICZvcG9pbnRfd2QpOworICAgICAgbWNfaGVscGVyICh3LCBtYXRy aXgsIHJvdywgY3Vyc29yX2dseXBoLCB3LT5jdXJzb3IueCwgb3BvaW50X2Z4LCB3LT5jdXJzb3Iu eSwKKyAgICAgICAgICAgICAgICAgb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29y LnZwb3MsIG9wb2ludF93ZCwgb3BvaW50X2gsCisgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBl LCBjdXJzb3Jfd2lkdGgsIGN1cnNvcl9mZywgY3Vyc29yX2JnLCBhY3RpdmVfcCwKKyAgICAgICAg ICAgICAgICAgTUNfR0xZUEgsIGRyYXdfcCwgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBDSF9D QUNIRQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0NBQ0hFKTsKKyAg ICB9CisgIGVsc2UgaWYgKCFjdXJzb3JfaW5fZnJpbmdlX3AKKyAgICAgICAgICAgJiYgdnBvcyA9 PSB3LT5jdXJzb3IudnBvcworICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA+PSBocG9zX3N0 YXJ0CisgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVu Z3RoCisgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKQor ICAgIHsKKyAgICAgIC8qIElmIGEgdXNlciBoYXMgc2V0IGB4LXN0cmV0Y2gtY3Vyc29yJyB0byBh IG5vbi1uaWwgdmFsdWUsIGhlL3NoZSBjaG9zZSB0bworICAgICAgaGF2ZSBhIGN1cnNvciB0aGF0 IHNwYW5zIHRoZSBlbnRpcmUgbGVuZ3RoIG9mIHRoZSBTVFJFVENIX0dMWVBILiAqLworICAgICAg aWYgKCF4X3N0cmV0Y2hfY3Vyc29yX3ApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUaGUgTUNf SEJBUiBzaGFsbCBoYXZlIGEgYGN1cnNvcl93aWR0aGAgb2YgMS4gKi8KKyAgICAgICAgICBtY19n ZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRf ZngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLnksICZvcG9p bnRfZnksIHctPmN1cnNvci5ocG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsIE1DX0hCQVIsIDEsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJm9wb2ludF93ZCk7CisgICAgICAgICAgbWNfaGVscGVyICh3LCBt YXRyaXgsIHJvdywgY3Vyc29yX2dseXBoLCB3LT5jdXJzb3IueCwgb3BvaW50X2Z4LAorICAgICAg ICAgICAgICAgICAgICAgdy0+Y3Vyc29yLnksIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHct PmN1cnNvci52cG9zLAorICAgICAgICAgICAgICAgICAgICAgb3BvaW50X3dkLCBvcG9pbnRfaCwg TUNfSEJBUiwgMSwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsCisgICAgICAgICAgICAgICAgICAgICBh Y3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwKKyAgICAgICAgICAgICAgICAgICAgIE5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgICAg ICA/IENIX0NBQ0hFCisgICAgICAgICAgICAgICAgICAgICA6IE1DX0NBQ0hFKTsKKyAgICAgICAg fQorICAgICAgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeSAodywgbWF0cml4LCByb3csIHctPmN1cnNv ci54LCAmb3BvaW50X2Z4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29y LnksICZvcG9pbnRfZnksIHctPmN1cnNvci5ocG9zLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgdy0+Y3Vyc29yLnZwb3MsICZvcG9pbnRfaCwgY3Vyc29yX3R5cGUsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsICZvcG9pbnRfd2QpOworICAgICAgbWNf aGVscGVyICh3LCBtYXRyaXgsIHJvdywgY3Vyc29yX2dseXBoLCB3LT5jdXJzb3IueCwgb3BvaW50 X2Z4LCB3LT5jdXJzb3IueSwKKyAgICAgICAgICAgICAgICAgb3BvaW50X2Z5LCB3LT5jdXJzb3Iu aHBvcywgdy0+Y3Vyc29yLnZwb3MsIG9wb2ludF93ZCwgb3BvaW50X2gsCisgICAgICAgICAgICAg ICAgIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGN1cnNvcl9mZywgY3Vyc29yX2JnLCBhY3Rp dmVfcCwKKyAgICAgICAgICAgICAgICAgTUNfR0xZUEgsIGRyYXdfcCwgTklMUCAoQlZBUiAoWEJV RkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBDSF9DQUNIRQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IE1DX0NBQ0hFKTsKKyAgICB9CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgRFJBVyBBTkQgUkVDT1JEIEZBS0UgQ1VSU09SUworKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisgIGlmIChocG9zX2xlbmd0aCA9PSAxKQorICAgIHsKKyAgICAgIGlmICgh TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkpCisgICAgICAgIHsK KyAgICAgICAgICAvKiBUaGUgc3BhY2UgYXBwZW5kZWQgdG8gYSByb3cgZW5kaW5nIHdpdGggYSBu ZXcgbGluZQorICAgICAgICAgIGRvZXMgbm90IGhhdmUgYSBgZ2x5cGgtPmNoYXJwb3NgICgtMSwg MCkgdGhhdCB3ZSBjYW4KKyAgICAgICAgICB1c2UgZm9yIHRoaXMgcGFydGljdWxhciBhcHBsaWNh dGlvbi4gIFdoZW4gdGhlcmUgaXMgYQorICAgICAgICAgIGBidWZmZXItZGlzcGxheS10YWJsZScg ZW50cnkgdGhhdCBhc3NpZ25zIGEgdmlzaWJsZQorICAgICAgICAgIGdseXBoIHRvIGEgbmV3IGxp bmUsIHRoZXJlIGlzIG5vIHByb2JsZW0gYmVjYXVzZSB0aGF0CisgICAgICAgICAgZ2x5cGggaGFz IGEgYGdseXBoLT5jaGFycG9zJyB0aGF0IHdlIGNhbiB1c2UuICBXaGVuCisgICAgICAgICAgbm8g dmlzaWJsZSBFT0wgZ2x5cGggZXhpc3RzLCB3ZSB1c2UgdGhlIGZvbGxvd2luZworICAgICAgICAg IHRlc3Q6ICB0aGUgYXBwZW5kZWQgc3BhY2UgaGFzIGEgcG9zaXRpb24gdGhhdCBpcyBvbmUKKyAg ICAgICAgICBsZXNzIHRoYW4gdGhlIGVuZCBvZiB0aGUgbWF0cml4IHJvdy4gKi8KKyAgICAgICAg ICBpbnQgaHBvcyA9IHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICBz dHJ1Y3QgZ2x5cGggKnByZXZpb3VzX2dseXBoID0gKDAgPD0gaHBvcyAtIDEgJiYgaHBvcyAtIDEg PCByb3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgaHBvcyAtIDEKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOVUxMOworICAgICAgICAgIGJvb2wgc2tp cF9wID0gKHByZXZpb3VzX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAm JiBwcmV2aW91c19nbHlwaC0+Y2hhcnBvcyA9PSBNQVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cp IC0gMSk7CisgICAgICAgICAgaW50IHBvc2ludCA9IChzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRf QVJFQV0gPT0gcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKQorICAgICAgICAgICAgICAgICAgICAg ICA/IE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgLSAxCisgICAgICAgICAgICAgICAgICAg ICAgIDogc3RhcnQtPmNoYXJwb3M7CisgICAgICAgICAgTGlzcF9PYmplY3Qgc3BlY3MgPSBtY19h c3NvYyAobWFrZV9maXhudW0gKHBvc2ludCksIEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg bWNfY29uZikpOworICAgICAgICAgIGlmICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBv cyA+IDApCisgICAgICAgICAgICAgICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAg ICAgICAgICAgJiYgIU5JTFAgKHNwZWNzKQorICAgICAgICAgICAgICAmJiBzdGFydC0+eSA8PSB3 aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAgICAgJiYgIXNraXBfcAorICAgICAg ICAgICAgICAmJiAhc3RhcnQtPnp2X3ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIExp c3BfT2JqZWN0IGxpc3BfdHlwZSA9IG1jX250aCAoMSwgc3BlY3MpOworICAgICAgICAgICAgICBl bnVtIHR5cGVfb2ZfY3Vyc29yIGN1cnNvcl90eXBlID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY19saXNw X3RvX2N1cnNvcl90eXBlIChYQ0FSIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBtY19saXNwX3RvX2N1cnNvcl90eXBlIChs aXNwX3R5cGUpOworICAgICAgICAgICAgICBpbnQgY3Vyc29yX3dpZHRoID0gKENPTlNQIChsaXNw X3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBYRklYTlVNIChYQ0FS IChYQ0RSIChsaXNwX3R5cGUpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog LTE7CisgICAgICAgICAgICAgIExpc3BfT2JqZWN0IG1jX2ZvcmVncm91bmQgPSBtY19udGggKDIs IHNwZWNzKTsKKyAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBmb3JlZ3JvdW5kOworICAgICAg ICAgICAgICBpZiAoU1RSSU5HUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAgbWNf c2V0X3JnYiAodywgbWNfZm9yZWdyb3VuZCwgJmZvcmVncm91bmQpOworICAgICAgICAgICAgICAg IGVsc2UgaWYgKFZFQ1RPUlAgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgICAgICBkb3VibGUgcmVkX2ZnID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1j X2ZvcmVncm91bmQsIDApKTsKKyAgICAgICAgICAgICAgICAgICAgZG91YmxlIGdyZWVuX2ZnID0g WEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDEpKTsKKyAgICAgICAgICAgICAgICAg ICAgZG91YmxlIGJsdWVfZmcgPSBYRkxPQVRfREFUQSAoQVJFRiAobWNfZm9yZWdyb3VuZCwgMikp OworICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kLnJlZCA9IHJlZF9mZzsKKyAgICAgICAg ICAgICAgICAgICAgZm9yZWdyb3VuZC5ncmVlbiA9IGdyZWVuX2ZnOworICAgICAgICAgICAgICAg ICAgICBmb3JlZ3JvdW5kLmJsdWUgPSBibHVlX2ZnOworICAgICAgICAgICAgICAgICAgfQorICAg ICAgICAgICAgICAgICAgZWxzZSBpZiAoTklMUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kLnJlZCA9IGNoX2Zv cmVncm91bmQucmVkOworICAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQuZ3JlZW4gPSBj aF9mb3JlZ3JvdW5kLmdyZWVuOworICAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQuYmx1 ZSA9IGNoX2ZvcmVncm91bmQuYmx1ZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAgICAgICAg ICAgICBpbnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAg ICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIHN0YXJ0LCBURVhUX0FSRUEsIHgs IHhfbGltaXQsIHJvdy0+eSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydCAtIHJvdy0+ Z2x5cGhzW1RFWFRfQVJFQV0sIHZwb3MsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAg ICAgICAgIGN1cnNvcl93aWR0aCwgZmNfeCwgZm9yZWdyb3VuZCwgYWN0aXZlX3AsIE1VTFRJUExF X0NVUlNPUlMsCisgICAgICAgICAgICAgICAgICAgICAgICAgZHJhd19wLCBNQ19DQUNIRSk7Cisg ICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGlmICghTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAmJiBmY194IDw9IHRleHRfYXJl YV93aWR0aAorICAgICAgICAgICYmIGZjX3ggPj0gdy0+bWMubG51bV9waXhlbF93aWR0aCkKKyAg ICAgICAgeworICAgICAgICAgIGludCB4X2xpbWl0ID0geCArIHN0YXJ0LT5waXhlbF93aWR0aDsK KyAgICAgICAgICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9ICh3LT5jdXJzb3IueCA9PSBmY194 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnkgPT0g c3RhcnQtPnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJz b3IuaHBvcyA9PSBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IudnBvcyA9PSB2cG9zKTsKKyAgICAg ICAgICBpZiAoeCArIHN0YXJ0LT5waXhlbF93aWR0aCA8PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAg ICAgICAgICAgJiYgKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAg ICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAgICYm ICgoZmNfeCA+PSB4CisgICAgICAgICAgICAgICAgICAgJiYgZmNfeCA8IHggKyBzdGFydC0+cGl4 ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICB8fCBzdGFydCA9PSByb3ctPmdseXBoc1tURVhU X0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKQorICAgICAgICAgICAgICAmJiBzdGFy dC0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAgICAgJiYgIXJlYWxf ZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIHN0 YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGltaXQsIHJvdy0+eSwgc3RhcnQgLSByb3ctPmdseXBoc1tU RVhUX0FSRUFdLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICBNQ19CQVIsIDEsIGZjX3gs IGZjX2ZvcmVncm91bmQsIGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAgICAgICBGSUxMX0NP TFVNTiwgZHJhd19wLCBGQ19DQUNIRSk7CisgICAgICAgIH0KKyAgICAgIGlmICghTklMUCAoQlZB UiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAmJiAhTklM UCAoQlZBUiAoYiwgY2hfaG9yaXpvbnRhbF9ydWxlcikpCisgICAgICAgICAgJiYgdnBvcyA9PSB3 LT5jdXJzb3IudnBvcykKKyAgICAgICAgeworICAgICAgICAgIGludCB4X2xpbWl0ID0gKHN0YXJ0 ID09IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpCisg ICAgICAgICAgICAgICAgICAgICAgICA/IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAg ICAgICAgICAgOiB4ICsgc3RhcnQtPnBpeGVsX3dpZHRoOworICAgICAgICAgIC8qIFByZXNlcnZl IHN1cHBvcnQgZm9yIGRlZmF1bHQgYmVoYXZpb3Igc3VjaCB0aGF0IGEgdXNlciBtYXkKKyAgICAg ICAgICBzcGVjaWZ5IHRoZSBoZWlnaHQgb2YgYW4gTUNfSEJBUiwgd2hpY2ggYmVnaW5zIGl0cyBq b3VybmV5CisgICAgICAgICAgYXMgdGhlIGBjdXJzb3Jfd2lkdGgnLiAgYG1jX2dldF9jdXJzb3Jf Z2VvbWV0cnknIHJlYWRqdXN0cy4gKi8KKyAgICAgICAgICBtY19lbmdpbmUgKHcsIG1hdHJpeCwg cm93LCBzdGFydCwgVEVYVF9BUkVBLCB4LCB4X2xpbWl0LCByb3ctPnksIHN0YXJ0IC0gcm93LT5n bHlwaHNbVEVYVF9BUkVBXSwgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgIE1DX0hCQVIsIDEs IGZjX3gsIGNoX2ZvcmVncm91bmQsIGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAgICAgSE9S SVpPTlRBTF9SVUxFUiwgZHJhd19wLCBDSF9DQUNIRSk7CisgICAgICAgIH0KKyAgICAgIGlmICgh TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAg ICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICYmICFm aWxsX2NvbHVtbl90cnVtcHNfcCkKKyAgICAgICAgeworICAgICAgICAgIGludCB4X2xpbWl0ID0g d2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAgICBib29sIHJlYWxfZmFr ZV9jdXJzb3JfcCA9ICh3LT5jdXJzb3IueSA9PSBzdGFydC0+eQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAg IGlmICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAgICAg ICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAgJiYgKCh3LT5jdXJz b3IueCA+PSB4CisgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPCB4ICsgc3RhcnQt PnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgfHwgc3RhcnQgPT0gcm93LT5nbHlwaHNb VEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSkKKyAgICAgICAgICAgICAgJiYg c3RhcnQtPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICYmICFy ZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgICAgICBtY19lbmdpbmUgKHcsIG1hdHJpeCwgcm93 LCBzdGFydCwgVEVYVF9BUkVBLCB4LCB4X2xpbWl0LCByb3ctPnksIHN0YXJ0IC0gcm93LT5nbHlw aHNbVEVYVF9BUkVBXSwgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgTUNfQkFSLCAxLCBm Y194LCBjaF9mb3JlZ3JvdW5kLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgVkVS VElDQUxfUlVMRVIsIGRyYXdfcCwgQ0hfQ0FDSEUpOworICAgICAgICB9CisgICAgfQorICAgIGVs c2UKKyAgICAgIHsKKyAgICAgICAgaW50IHJlbGF0aXZlX3ggPSAwOworICAgICAgICBmb3IgKGlu dCBhcmVhID0gTEVGVF9NQVJHSU5fQVJFQTsgYXJlYSA8IExBU1RfQVJFQTsgKythcmVhKQorICAg ICAgICAgIHsKKyAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSByb3ctPmdseXBoc1th cmVhXTsKKyAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGhfZW5kID0gZ2x5cGggKyByb3ct PnVzZWRbYXJlYV07CisgICAgICAgICAgICAvKiBHbHlwaCBmb3IgYSBsaW5lIGVuZCBpbiB0ZXh0 LiAqLworICAgICAgICAgICAgaWYgKGFyZWEgPT0gVEVYVF9BUkVBICYmIGdseXBoID09IGdseXBo X2VuZCAmJiBnbHlwaC0+Y2hhcnBvcyA+IDApCisgICAgICAgICAgICAgICsrZ2x5cGhfZW5kOwor ICAgICAgICAgICAgZm9yICg7IGdseXBoIDwgZ2x5cGhfZW5kOyArK2dseXBoKQorICAgICAgICAg ICAgICB7CisgICAgICAgICAgICAgICAgaWYgKHZwb3MgIT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAg ICAgICAgICAgICAgICAgJiYgZ2x5cGggIT0gZ2x5cGhfZW5kIC0gMQorICAgICAgICAgICAgICAg ICAgICAmJiBmY194IDwgcmVsYXRpdmVfeAorICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJz b3IueCA8IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgJiYgTklMUCAoQlZBUiAoWEJV RkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkpCisgICAgICAgICAgICAgICAgICBicmVhazsK KyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg bWNfY29uZikpKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvKiBU aGUgc3BhY2UgYXBwZW5kZWQgdG8gYSByb3cgZW5kaW5nIHdpdGggYSBuZXcgbGluZSBkb2VzCisg ICAgICAgICAgICAgICAgICAgIG5vdCBoYXZlIGEgYGdseXBoLT5jaGFycG9zYCAoLTEsIDApIHRo YXQgd2UgY2FuIHVzZSBmb3IgdGhpcworICAgICAgICAgICAgICAgICAgICBwYXJ0aWN1bGFyIGFw cGxpY2F0aW9uLiAgV2hlbiBhIGBidWZmZXItZGlzcGxheS10YWJsZScgZW50cnkKKyAgICAgICAg ICAgICAgICAgICAgYXNzaWducyBhIHZpc2libGUgZ2x5cGggdG8gYSBuZXcgbGluZSwgdGhlcmUg aXMgbm8gcHJvYmxlbQorICAgICAgICAgICAgICAgICAgICBiZWNhdXNlIHRoYXQgZ2x5cGggaGFz IGEgYGdseXBoLT5jaGFycG9zJyB0aGF0IHdlIGNhbiB1c2UuCisgICAgICAgICAgICAgICAgICAg IFdoZW4gbm8gdmlzaWJsZSBFT0wgZ2x5cGggZXhpc3RzLCB3ZSB1c2UgdGhlIGZvbGxvd2luZyB0 ZXN0OgorICAgICAgICAgICAgICAgICAgICB0aGUgYXBwZW5kZWQgc3BhY2UgaGFzIGEgcG9zaXRp b24gdGhhdCBpcyBvbmUgbGVzcyB0aGFuIHRoZQorICAgICAgICAgICAgICAgICAgICBlbmQgb2Yg dGhlIG1hdHJpeCByb3cuICovCisgICAgICAgICAgICAgICAgICAgIGludCBocG9zID0gZ2x5cGgg LSByb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5 cGggKnByZXZpb3VzX2dseXBoID0gKDAgPD0gaHBvcyAtIDEgJiYgaHBvcyAtIDEgPCByb3ctPnVz ZWRbVEVYVF9BUkVBXSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIGhwb3MgLSAxCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgICAgICAg ICAgICAgICAgICAgIGJvb2wgc2tpcF9wID0gKHByZXZpb3VzX2dseXBoICE9IE5VTEwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcHJldmlvdXNfZ2x5cGgtPmNoYXJwb3Mg PT0gTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSAtIDEpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IHRydWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAvKiBXaGVuIGEgYGJ1ZmZlci1kaXNwbGF5LXRhYmxlJyBlbnRyeSBjb250YWlucworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGEgdmlzaWJsZSB0YWIgY2hhcmFjdGVyICgiwrsi KSwgdGhlIHN1YnNlcXVlbnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTVFJF VENIX0dMWVBIIHdpbGwgaGF2ZSB0aGUgc2FtZSBnbHlwaC0+Y2hhcnBvcworICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGFzIHRoZSBhZm9yZW1lbnRpb25lZCB2aXNpYmxlIHRhYiBj aGFyYWN0ZXIuICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAocHJldmlv dXNfZ2x5cGggIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IHByZXZpb3VzX2dseXBoLT5jaGFycG9zID09IGdseXBoLT5jaGFycG9zKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyB0cnVlCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgaW50IHBvc2ludCA9IChnbHlw aCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93 KSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogZ2x5cGgtPmNoYXJwb3M7 CisgICAgICAgICAgICAgICAgICAgIExpc3BfT2JqZWN0IHNwZWNzID0gbWNfYXNzb2MgKG1ha2Vf Zml4bnVtIChwb3NpbnQpLCBCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKTsK KyAgICAgICAgICAgICAgICAgICAgaWYgKCgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9z ID4gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0g MCkKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChzcGVjcykKKyAgICAgICAgICAg ICAgICAgICAgICAgICYmIGdseXBoLT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAg ICAgICAgICAgICAgICAgICAgICAgJiYgIXNraXBfcAorICAgICAgICAgICAgICAgICAgICAgICAg JiYgIWdseXBoLT56dl9wKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg ICAgICAgICAgIExpc3BfT2JqZWN0IGxpc3BfdHlwZSA9IG1jX250aCAoMSwgc3BlY3MpOworICAg ICAgICAgICAgICAgICAgICAgICAgZW51bSB0eXBlX29mX2N1cnNvciBjdXJzb3JfdHlwZSA9IChD T05TUCAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKFhDQVIgKGxp c3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiBtY19saXNwX3RvX2N1cnNvcl90eXBlIChsaXNwX3R5cGUpOworICAg ICAgICAgICAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aCA9IChDT05TUCAobGlzcF90eXBl KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFhGSVhOVU0g KFhDQVIgKFhDRFIgKGxpc3BfdHlwZSkpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogLTE7CisgICAgICAgICAgICAgICAgICAgICAgICBMaXNwX09iamVjdCBt Y19mb3JlZ3JvdW5kID0gbWNfbnRoICgyLCBzcGVjcyk7CisgICAgICAgICAgICAgICAgICAgICAg ICBzdHJ1Y3QgbWNfUkdCIGZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAo U1RSSU5HUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX3Nl dF9yZ2IgKHcsIG1jX2ZvcmVncm91bmQsICZmb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgZWxzZSBpZiAoVkVDVE9SUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG91YmxlIHJl ZF9mZyA9IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3JvdW5kLCAwKSk7CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBkb3VibGUgZ3JlZW5fZmcgPSBYRkxPQVRfREFUQSAoQVJFRiAo bWNfZm9yZWdyb3VuZCwgMSkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG91Ymxl IGJsdWVfZmcgPSBYRkxPQVRfREFUQSAoQVJFRiAobWNfZm9yZWdyb3VuZCwgMikpOworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZC5yZWQgPSByZWRfZmc7CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kLmdyZWVuID0gZ3JlZW5fZmc7CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kLmJsdWUgPSBibHVlX2ZnOworICAg ICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBl bHNlIGlmIChOSUxQIChtY19mb3JlZ3JvdW5kKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kLnJlZCA9IGNoX2Zv cmVncm91bmQucmVkOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZC5n cmVlbiA9IGNoX2ZvcmVncm91bmQuZ3JlZW47CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBmb3JlZ3JvdW5kLmJsdWUgPSBjaF9mb3JlZ3JvdW5kLmJsdWU7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhf Uk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCB4X2xp bWl0ID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgICAgICAg ICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94 LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4X2xpbWl0LCByb3ctPnksIGds eXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgdnBvcywgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZmNfeCwgZm9yZWdyb3Vu ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0aXZlX3AsIE1VTFRJUExF X0NVUlNPUlMsIGRyYXdfcCwgTUNfQ0FDSEUpOworICAgICAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZG RVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgICAgICAgICAgICYmIGZj X3ggPD0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICYmIGZjX3ggPj0gdy0+ bWMubG51bV9waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg ICAgICAgaW50IHhfbGltaXQgPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOworICAg ICAgICAgICAgICAgICAgICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9ICh3LT5jdXJzb3IueCA9 PSBmY194CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IHctPmN1cnNvci55ID09IGdseXBoLT55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID09IGdseXBoIC0gcm93LT5nbHlwaHNb VEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiB3LT5jdXJzb3IudnBvcyA9PSB2cG9zKTsKKyAgICAgICAgICAgICAgICAgICAgaW50IGhw b3MgPSBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICAgICAgICAgICAgICAg IGlmIChocG9zID49IGhwb3Nfc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIGhwb3Mg PCBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGgKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIHJl bGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGggPD0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAg ICAgICAgICAgICAgICAgICAmJiAoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDAp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDAp CisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoKGdseXBoICE9IGdseXBoX2VuZCAtIDEKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZmNfeCA+PSByZWxhdGl2ZV94CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIGZjX3ggPCByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVs X3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChnbHlwaCA9PSBnbHlwaF9l bmQgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGZjX3ggPj0gcmVsYXRp dmVfeCkpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaC0+eSA8PSB3aW5kb3dfdGV4 dF9ib3R0b21feSAodykKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vy c29yX3ApCisgICAgICAgICAgICAgICAgICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywg Z2x5cGgsIGFyZWEsIHJlbGF0aXZlX3gsIHhfbGltaXQsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICByb3ctPnksIGhwb3MsIHZwb3MsIE1DX0JBUiwgMSwgZmNfeCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGZjX2ZvcmVncm91bmQsIGFjdGl2ZV9wLCBGSUxMX0NP TFVNTiwgZHJhd19wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRkNfQ0FDSEUp OworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICghTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgICAgICAg JiYgIU5JTFAgKEJWQVIgKGIsIGNoX2hvcml6b250YWxfcnVsZXIpKQorICAgICAgICAgICAgICAg ICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zKQorICAgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgICBpbnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRf QVJFQSk7CisgICAgICAgICAgICAgICAgICAgIGludCBocG9zID0gZ2x5cGggLSByb3ctPmdseXBo c1tURVhUX0FSRUFdOworICAgICAgICAgICAgICAgICAgICAvKiBQcmVzZXJ2ZSBzdXBwb3J0IGZv ciBkZWZhdWx0IGJlaGF2aW9yIHN1Y2ggdGhhdCBhIHVzZXIgbWF5CisgICAgICAgICAgICAgICAg ICAgIHNwZWNpZnkgdGhlIGhlaWdodCBvZiBhbiBNQ19IQkFSLCB3aGljaCBiZWdpbnMgaXRzIGpv dXJuZXkKKyAgICAgICAgICAgICAgICAgICAgYXMgdGhlIGBjdXJzb3Jfd2lkdGgnLiAgYG1jX2dl dF9jdXJzb3JfZ2VvbWV0cnknIHJlYWRqdXN0cy4gKi8KKyAgICAgICAgICAgICAgICAgICAgaWYg KGhwb3MgPj0gaHBvc19zdGFydAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA8IGhw b3Nfc3RhcnQgKyBocG9zX2xlbmd0aCkKKyAgICAgICAgICAgICAgICAgICAgICBtY19lbmdpbmUg KHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgYXJlYSwgcmVsYXRpdmVfeCwgeF9saW1pdCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvdy0+eSwgaHBvcywgdnBvcywgTUNfSEJBUiwg MSwgZmNfeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoX2ZvcmVncm91bmQs IGFjdGl2ZV9wLCBIT1JJWk9OVEFMX1JVTEVSLCBkcmF3X3AsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBDSF9DQUNIRSk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAg ICAgICAgaWYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMp KQorICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVs ZXIpKQorICAgICAgICAgICAgICAgICAgICAmJiAhZmlsbF9jb2x1bW5fdHJ1bXBzX3ApCisgICAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gd2luZG93 X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgICAgICAgICAgYm9vbCByZWFs X2Zha2VfY3Vyc29yX3AgPSAody0+Y3Vyc29yLnkgPT0gZ2x5cGgtPnkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnZwb3MgPT0gdnBv cyk7CisgICAgICAgICAgICAgICAgICAgIGludCBocG9zID0gZ2x5cGggLSByb3ctPmdseXBoc1tU RVhUX0FSRUFdOworICAgICAgICAgICAgICAgICAgICBpZiAoaHBvcyA+PSBocG9zX3N0YXJ0Cisg ICAgICAgICAgICAgICAgICAgICAgICAmJiBocG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3Ro CisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYg dnBvcyA+IDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9y bWF0ID09IDApCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoKGdseXBoICE9IGdseXBoX2Vu ZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0gcmVs YXRpdmVfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA8IHJl bGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgfHwgKGdseXBoID09IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgdy0+Y3Vyc29yLnggPj0gcmVsYXRpdmVfeCkpCisgICAgICAgICAgICAgICAgICAg ICAgICAmJiBnbHlwaC0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAg ICAgICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgICAgICAgICAgICAg ICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIGFyZWEsIHJlbGF0aXZlX3gsIHhf bGltaXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb3ctPnksIGhwb3MsIHZw b3MsIE1DX0JBUiwgMSwgZmNfeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNo X2ZvcmVncm91bmQsIGFjdGl2ZV9wLCBWRVJUSUNBTF9SVUxFUiwgZHJhd19wLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgQ0hfQ0FDSEUpOworICAgICAgICAgICAgICAgICAgfQor ICAgICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAg ICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgfQorLyoKKyAgY2xvY2tfdCBjbG9ja19lbmQg PSBjbG9jaygpOworICBkb3VibGUgY3B1X3RpbWVfdXNlZCA9ICgoZG91YmxlKSAoY2xvY2tfZW5k IC0gY2xvY2tfc3RhcnQpKSAvIENMT0NLU19QRVJfU0VDOworICBmcHJpbnRmIChzdGRlcnIsICJt Y19kcmF3X3JvdyAoJXMpOiAgVElNRSAoJWYpXG4iLCBtY193aW5kb3cgKHcpLCBjcHVfdGltZV91 c2VkKTsKKyovCit9CisKK3ZvaWQKK21jX3JlZHJhd19oZWxwZXIgKHN0cnVjdCB3aW5kb3cgKncs IHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAg ICAgICAgICAgICAgICAgZW51bSB0eXBlX29mX2NhY2hlIGNhY2hlX3R5cGUsIGludCBzdGFydF9o cG9zLCBpbnQgZW5kX2hwb3MpCit7CisgIGludCByb3dfdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAo cm93LCBtYXRyaXgpOworICBzdHJ1Y3QgbXVsdGlwbGVfY3Vyc29yc19jYWNoZSBmb29fZWx0czsK KyAgc3dpdGNoIChjYWNoZV90eXBlKQorICAgIHsKKyAgICAgIGNhc2UgTk9fQ0FDSEU6CisgICAg ICAgIHsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgY2FzZSBNQ19DQUNIRToK KyAgICAgICAgeworICAgICAgICAgIGZvb19lbHRzLmNhY2hlcyA9IHctPm1jX2VsdHMuY2FjaGVz OworICAgICAgICAgIGZvb19lbHRzLmFsbG9jYXRlZCA9IHctPm1jX2VsdHMuYWxsb2NhdGVkOwor ICAgICAgICAgIGZvb19lbHRzLnVzZWQgPSB3LT5tY19lbHRzLnVzZWQ7CisgICAgICAgICAgYnJl YWs7CisgICAgICAgIH0KKyAgICAgIGNhc2UgQ0hfQ0FDSEU6CisgICAgICAgIHsKKyAgICAgICAg ICBmb29fZWx0cy5jYWNoZXMgPSB3LT5jaF9lbHRzLmNhY2hlczsKKyAgICAgICAgICBmb29fZWx0 cy5hbGxvY2F0ZWQgPSB3LT5jaF9lbHRzLmFsbG9jYXRlZDsKKyAgICAgICAgICBmb29fZWx0cy51 c2VkID0gdy0+Y2hfZWx0cy51c2VkOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAg ICBjYXNlIEZDX0NBQ0hFOgorICAgICAgICB7CisgICAgICAg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X2Vs dHMuY2FjaGVzW2VsdF0uZm9yZWdyb3VuZC5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAuZ3JlZW4gPSBmb29fZWx0cy5jYWNoZXNbZWx0XS5mb3JlZ3JvdW5kLmdyZWVuLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBmb29fZWx0cy5jYWNoZXNbZWx0XS5m b3JlZ3JvdW5kLmJsdWV9OworICAgICAgc3RydWN0IG1jX1JHQiBiZ19sc2wgPSB7LnJlZCA9IGZv b19lbHRzLmNhY2hlc1tlbHRdLmJhY2tncm91bmQucmVkLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgLmdyZWVuID0gZm9vX2VsdHMuY2FjaGVzW2VsdF0uYmFja2dyb3VuZC5ncmVlbiwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0gZm9vX2VsdHMuY2FjaGVzW2Vs dF0uYmFja2dyb3VuZC5ibHVlfTsKKyAgICAgIGJvb2wgYWN0aXZlX3AgPSBmb29fZWx0cy5jYWNo ZXNbZWx0XS5hY3RpdmVfcDsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IGZv b19lbHRzLmNhY2hlc1tlbHRdLmdseXBoX2ZsYXZvcjsKKyAgICAgIGJvb2wgZW5hYmxlZF9wID0g Zm9vX2VsdHMuY2FjaGVzW2VsdF0uZW5hYmxlZF9wOworICAgICAgaWYgKHZwb3MgPT0gcm93X3Zw b3MKKyAgICAgICAgICAmJiAoKGhwb3MgPj0gc3RhcnRfaHBvcworICAgICAgICAgICAgICAgJiYg aHBvcyA8IGVuZF9ocG9zKQorICAgICAgICAgICAgICAvKiBBIGZsb2F0aW5nIGN1cnNvciBiZXlv bmQgdGhlIGVuZCBvZiB0aGUgZ2x5cGggcm93LiAqLworICAgICAgICAgICAgICB8fCAoaHBvcyAr IDEgPT0gc3RhcnRfaHBvcworICAgICAgICAgICAgICAgICAgJiYgaHBvcyArIDEgPT0gZW5kX2hw b3MpKQorICAgICAgICAgICYmIGVuYWJsZWRfcCkKKyAgICAgICAgeworICAgICAgICAgIGJvb2wg cmVtb3ZlX3AgPSBmYWxzZTsKKyAgICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgbWF0 cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZnX2xzbCwgYWN0 aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgcmVt b3ZlX3ApOworICAgICAgICB9CisgICAgfQorfQorCit2b2lkCittY19yZWRyYXdfcm93IChzdHJ1 Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsIHN0cnVjdCBnbHlwaF9y b3cgKnJvdywKKyAgICAgICAgICAgICAgIGludCBzdGFydF94LCBpbnQgc3RhcnRfaHBvcywgaW50 IGVuZF9ocG9zLCBib29sIGNsZWFyX2VvbF9wLAorICAgICAgICAgICAgICAgZW51bSBkcmF3X2ds eXBoc19mYWNlIGhsKQoreworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFN RSAodykpOworICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAv LyAgVFJBQ0UgKChzdGRlcnIsICJtY19yZWRyYXdfcm93ICglZCk6ICBzdGFydF94ICglZCkgfCBz dGFydF9ocG9zICglZCkgfCBlbmRfaHBvcyAoJWQpXG4iLAorICAvLyAgICAgICAgICAgICAgICAg IHZwb3MsIHN0YXJ0X3gsIHN0YXJ0X2hwb3MsIGVuZF9ocG9zKSk7CisgIHN0cnVjdCBnbHlwaF9y b3cgKmJvdHRvbV9yb3cgPSBNQVRSSVhfQk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ocG9zLCBlbmRfaHBvcyk7CisgIC8vICBjbG9ja19lbmQgPSBjbG9jaygpOwor ICAvLyAgZG91YmxlIHRpbWVfY3Vyc29ycyA9ICgoZG91YmxlKSAoY2xvY2tfZW5kIC0gY2xvY2tf c3RhcnQpKSAvIENMT0NLU19QRVJfU0VDOworICAvLyAgZnByaW50ZiAoc3RkZXJyLCAibWNfcmVk cmF3X3JvdyAoJWQpOiAgaHBvcyAoJWQvJWQpIHwgZ2x5cGhzICglZikgfCBjdXJzb3JzICglZilc biIsCisgIC8vICAgICAgICAgICAgICAgICAgIHZwb3MsIHN0YXJ0X2hwb3MsIGVuZF9ocG9zLCB0 aW1lX2dseXBocywgdGltZV9jdXJzb3JzKTsKK30KKwordm9pZAorbWNfZXJhc2VfaGVscGVyIChz dHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsIHN0cnVjdCBnbHlw aF9yb3cgKnJvdywKKyAgICAgICAgICAgICAgICAgZW51bSB0eXBlX29mX2NhY2hlIGNhY2hlX3R5 cGUpCit7CisgIGludCByb3dfdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOwor ICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZXJhc2Vf aGVscGVyICglcyk6ICBjYWNoZSAoJXMpIHwgdnBvcyAoJWQpXG4iLAorICAgICAgbWNfd2luZG93 ICh3KSwgbWNfY2FjaGVfdHlwZV90b19zdHJpbmcgKGNhY2hlX3R5cGUpLCByb3dfdnBvcyk7Cisg IHN0cnVjdCBtdWx0aXBsZV9jdXJzb3JzX2NhY2hlIGZvb19lbHRzOworICBzd2l0Y2ggKGNhY2hl X3R5cGUpCisgICAgeworICAgICAgY2FzZSBOT19DQUNIRToKKyAgICAgICAgeworICAgICAgICAg IGJyZWFrOworICAgICAgICB9CisgICAgICBjYXNlIE1DX0NBQ0hFOgorICAgICAgICB7CisgICAg ICAgICAgZm9vX2VsdHMuY2FjaGVzID0gdy0+bWNfZWx0cy5jYWNoZXM7CisgICAgICAgICAgZm9v X2VsdHMuYWxsb2NhdGVkID0gdy0+bWNfZWx0cy5hbGxvY2F0ZWQ7CisgICAgICAgICAgZm9vX2Vs dHMudXNlZCA9IHctPm1jX2VsdHMudXNlZDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQor ICAgICAgY2FzZSBDSF9DQUNIRToKKyAgICAgICAgeworICAgICAgICAgIGZvb19lbHRzLmNhY2hl cyA9IHctPmNoX2VsdHMuY2FjaGVzOworICAgICAgICAgIGZvb19lbHRzLmFsbG9jYXRlZCA9IHct PmNoX2VsdHMuYWxsb2NhdGVkOworICAgICAgICAgIGZvb19lbHRzLnVzZWQgPSB3LT5jaF9lbHRz LnVzZWQ7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGNhc2UgRkNfQ0FDSEU6 CisgICAgICAgIHsKKyAgICAgICAgICBmb29fZWx0cy5jYWNoZXMgPSB3LT5mY19lbHRzLmNhY2hl czsKKyAgICAgICAgICBmb29fZWx0cy5hbGxvY2F0ZWQgPSB3LT5mY19lbHRzLmFsbG9jYXRlZDsK KyAgICAgICAgICBmb29fZWx0cy51c2VkID0gdy0+ZmNfZWx0cy51c2VkOworICAgICAgICAgIGJy ZWFrOworICAgICAgICB9CisgICAgfQorICBmb3IgKGludCBlbHQgPSAwOyBlbHQgPCBmb29fZWx0 cy51c2VkOyArK2VsdCkKKyAgICB7CisgICAgICBpbnQgeCA9IGZvb19lbHRzLmNhY2hlc1tlbHRd Lng7CisgICAgICBpbnQgZnggPSBmb29fZWx0cy5jYWNoZXNbZWx0XS5meDsKKyAgICAgIGludCB5 ID0gZm9vX2VsdHMuY2FjaGVzW2VsdF0ueTsKKyAgICAgIGludCBmeSA9IGZvb19lbHRzLmNhY2hl c1tlbHRdLmZ5OworICAgICAgaW50IGhwb3MgPSBmb29fZWx0cy5jYWNoZX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Bmb29fZWx0cy5jYWNoZXNbZWx0XS5nbHlwaF9mbGF2b3I7CisgICAg ICBib29sIGVuYWJsZWRfcCA9IGZvb19lbHRzLmNhY2hlc1tlbHRdLmVuYWJsZWRfcDsKKyAgICAg IC8qIGBtYXRyaXhfcm93JyBpbiBgZGlzcG5ldy5jYCBjb250YWlucyB0aGUgZm9sbG93aW5nIHRl c3RzLAorICAgICAgZWFzc2VydCAobWF0cml4ICYmIG1hdHJpeC0+cm93cyk7CisgICAgICBlYXNz ZXJ0IChyb3cgPj0gMCAmJiByb3cgPCBtYXRyaXgtPm5yb3dzKTsgKi8KKyAgICAgIGJvb2wgYmFy Zl9jcmFzaF9vbmUgPSAobWF0cml4ICYmIG1hdHJpeC0+cm93cykgPyBmYWxzZSA6IHRydWU7Cisg ICAgICBpZiAoYmFyZl9jcmFzaF9vbmUpCisgICAgICAgIGNvbnRpbnVlOworICAgICAgYm9vbCBi YXJmX2NyYXNoX3R3byA9ICh2cG9zID49IDAgJiYgdnBvcyA8IG1hdHJpeC0+bnJvd3MpID8gZmFs c2UgOiB0cnVlOworICAgICAgaWYgKGJhcmZfY3Jhc2hfdHdvKQorICAgICAgICBjb250aW51ZTsK KyAgICAgIGlmICh2cG9zID09IHJvd192cG9zCisgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yID09 IE1DX0dMWVBICisgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICB7CisgICAgICAgICAg bWNfZXJhc2VfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgeSwgaHBvcywgdnBvcywgZ2x5cGhf Zmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QpOworICAgICAgICAgIGZvb19lbHRzLmNhY2hlc1tlbHRd LmVuYWJsZWRfcCA9IGZhbHNlOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKHZwb3MgPT0g cm93X3Zwb3MKKyAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAgIHsKKyAg ICAgICAgICAgIGJvb2wgcmVtb3ZlX3AgPSB0cnVlOworICAgICAgICAgICAgbWNfZHJhd19lcmFz ZV9oeWJyaWQgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBo LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCBjdXJzb3Jf d2lkdGgsIGJnX2xzbCwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgZ2x5cGhfZmxhdm9yLCByZW1vdmVfcCk7CisgICAgICAgICAgICBmb29fZWx0cy5jYWNoZXNb ZWx0XS5lbmFibGVkX3AgPSBmYWxzZTsKKyAgICAgICAgICB9CisgICAgfQorfQorCit2b2lkCitt Y19lcmFzZV9yb3cgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJp eCwgc3RydWN0IGdseXBoX3JvdyAqcm93KQoreworICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBP UyAocm93LCBtYXRyaXgpOworICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAgZnByaW50ZiAo c3RkZXJyLCAibWNfZXJhc2Vfcm93ICglcyk6ICB2cG9zICglZClcbiIsIG1jX3dpbmRvdyAodyks IHZwb3MpOworICBtY19lcmFzZV9oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBNQ19DQUNIRSk7Cisg IG1jX2VyYXNlX2hlbHBlciAodywgbWF0cml4LCByb3csIENIX0NBQ0hFKTsKKyAgbWNfZXJhc2Vf aGVscGVyICh3LCBtYXRyaXgsIHJvdywgRkNfQ0FDSEUpOworfQorCit2b2lkCittY19zZXRfZXNz ZW50aWFscyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBhY3RpdmVfcCwgc3RydWN0IG1jX1JHQiAq Y2hfZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNf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fd2lkdGg7CisgIGlmIChiICE9IGN1cnJlbnRfYnVmZmVy KQorICAgIHsKKyAgICAgIG9sZF9idWZmZXIgPSBjdXJyZW50X2J1ZmZlcjsKKyAgICAgIHNldF9i dWZmZXJfaW50ZXJuYWwgKGIpOworICAgIH0KKyAgKmZjX3ggPSAoZmlsbF9jb2x1bW5fcAorICAg ICAgICAgICAmJiAhTklMUCAoVmRpc3BsYXlfbGluZV9udW1iZXJzKSkKKyAgICAgICAgICAgID8g KGZpbGxfY29sICogZnJhbWVfY2hhcl93aWR0aCkgKyB3LT5tYy5sbnVtX3BpeGVsX3dpZHRoIC0g aHNjbF94CisgICAgICAgICAgOiAoZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAgICYmIE5JTFAg KFZkaXNwbGF5X2xpbmVfbnVtYmVycykpCisgICAgICAgICAgICA/IChmaWxsX2NvbCAqIGZyYW1l X2NoYXJfd2lkdGgpIC0gaHNjbF94CisgICAgICAgICAgOiAwOworICBpZiAob2xkX2J1ZmZlcikK KyAgICBzZXRfYnVmZmVyX2ludGVybmFsIChvbGRfYnVmZmVyKTsKKyAgZW51bSBmYWNlX2lkIGZp bGxfY29sdW1uX2ZhY2VfaWQgPQorICAgICghYWN0aXZlX3AKKyAgICAgJiYgIU5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfaW5hY3RpdmVfd2luZG93cykpCisgICAgICYmIE5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgICAgPyBs b29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiZmMtaW5hY3RpdmUtZmFjZSIpLCB0cnVl KQorICAgIDogKCFhY3RpdmVfcAorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIGZjX2luYWN0aXZlX3dpbmRvd3MpKQorICAgICAgICYmICFOSUxQIChCVkFSIChY QlVGRkVSICh3LT5jb250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nIG9mIG11bHRpcGxlIGZha2UgY3Vyc29ycy4KK1dpdGggQVJHLCB0 dXJuIHRyYWNpbmcgb24gaWYgYW5kIG9ubHkgaWYgQVJHIGlzIHBvc2l0aXZlLiAqLykKKyAgKExp c3BfT2JqZWN0IGFyZykKK3sKKyAgaWYgKE5JTFAgKGFyZykpCisgICAgbWNfc3RkZXJyX3AgPSAh bWNfc3RkZXJyX3A7CisgIGVsc2UKKyAgICB7CisgICAgICBhcmcgPSBGcHJlZml4X251bWVyaWNf dmFsdWUgKGFyZyk7CisgICAgICBtY19zdGRlcnJfcCA9IFhGSVhOVU0gKGFyZykgPiAwOworICAg IH0KKyAgcmV0dXJuIFFuaWw7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAMCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKIAkJICAgICAgV2lu ZG93IGRpc3BsYXkgZGltZW5zaW9ucwpAQCAtMTMzOTUsNiArMTczNzAsNjkgQEAgaHNjcm9sbF93 aW5kb3dfdHJlZSAoTGlzcF9PYmplY3Qgd2luZG93KQogCSAgICAgIGVsc2UKIAkJcHQgPSBjbGlw X3RvX2JvdW5kcyAoQkVHViwgbWFya2VyX3Bvc2l0aW9uICh3LT5wb2ludG0pLCBaVik7CiAKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisK Ky8qIChnZGIpIGJ0CisjMCAgdGVybWluYXRlX2R1ZV90b19zaWduYWwgKHNpZz02LCBiYWNrdHJh Y2VfbGltaXQ9MjE0NzQ4MzY0NykgYXQgZW1hY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aHNjcm9sbF93aW5kb3dfdHJlZSAod2luZG93PS4uLikgYXQgeGRpc3AuYzox ODU0NgorKi8KKworICAvKiBgaW5pdF9pdGVyYXRvcic6ICBlYXNzZXJ0IChjaGFycG9zIDwgMAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAoY2hhcnBvcyA+PSBCVUZfQkVHIChj dXJyZW50X2J1ZmZlcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGNo YXJwb3MgPD0gWlYpKTsgKi8KKworICBzdHJ1Y3QgZGlzcGxheV9wb3MgKnBvcyA9ICZjdXJzb3Jf cm93LT5zdGFydDsKKyAgcHRyZGlmZl90IGNoYXJwb3MgPSBDSEFSUE9TIChwb3MtPnBvcyk7CisK KyAgYm9vbCBiYXJmX2NyYXNoX29uZSA9IChjaGFycG9zIDwgMAorICAgICAgICAgICAgICAgICAg ICAgICAgIHx8IChjaGFycG9zID49IEJVRl9CRUcgKGN1cnJlbnRfYnVmZmVyKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBjaGFycG9zIDw9IFpWKSkKKyAgICAgICAgICAgICAgICAg ICAgICAgID8gZmFsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgIDogdHJ1ZTsKKyAgaWYgKGJh cmZfY3Jhc2hfb25lKQorICAgIHJldHVybiBoc2Nyb2xsZWRfcDsKKworICAvKiBgcmVzZWF0XzEn OiAgQ0hBUlBPUyAocG9zKSA+PSBCRUdWICYmIENIQVJQT1MgKHBvcykgPD0gWlYgKi8KKyAgYm9v bCBiYXJmX2NyYXNoX3R3byA9IChjaGFycG9zID49IEJFR1YgJiYgY2hhcnBvcyA8PSBaVikKKyAg ICAgICAgICAgICAgICAgICAgICAgICA/IGZhbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAg OiB0cnVlOworICBpZiAoYmFyZl9jcmFzaF90d28pCisgICAgcmV0dXJuIGhzY3JvbGxlZF9wOwor CisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisK KwogCSAgICAgIC8qIE1vdmUgaXRlcmF0b3IgdG8gcHQgc3RhcnRpbmcgYXQgY3Vyc29yX3Jvdy0+ c3RhcnQgaW4KIAkJIGEgbGluZSB3aXRoIGluZmluaXRlIHdpZHRoLiAgKi8KIAkgICAgICBpbml0 X3RvX3Jvd19zdGFydCAoJml0LCB3LCBjdXJzb3Jfcm93KTsKQEAgLTE0Mjg3LDkgKzE4MzI1LDIy IEBAIHJlZGlzcGxheV9pbnRlcm5hbCAodm9pZCkKIAkgICAgICAqdy0+ZGVzaXJlZF9tYXRyaXgt Pm1ldGhvZCA9IDA7CiAJICAgICAgZGVidWdfbWV0aG9kX2FkZCAodywgIm9wdGltaXphdGlvbiAx Iik7CiAjZW5kaWYKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKwogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQorICBpZiAoQlVGRkVSUCAody0+ Y29udGVudHMpCisgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBj cm9zc2hhaXJzKSkpCisgICAgbWNfdXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCBmYWxzZSk7Cisg ICAgZWxzZQogCSAgICAgIHVwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgZmFsc2UpOwogI2VuZGlm CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgICAgICBnb3RvIHVwZGF0ZTsKIAkg ICAgfQogCSAgZWxzZQpAQCAtMTc2ODcsMTAgKzIxNzM4LDIxIEBAIHJlZGlzcGxheV93aW5kb3cg KExpc3BfT2JqZWN0IHdpbmRvdywgYm9vbCBqdXN0X3RoaXNfb25lX3ApCiAgICAgfQogCiAjaWZk ZWYgSEFWRV9XSU5ET1dfU1lTVEVNCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBN VUxUSVBMRS1DVVJTT1JTICovCisKKyAgYm9vbCBrZWVwX2N1cnJlbnRfcCA9IChqdXN0X3RoaXNf b25lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICB8fCAoIXVzZWRfY3VycmVudF9tYXRyaXhf cCAmJiAhb3ZlcmxheV9hcnJvd19zZWVuKQorICAgICAgICAgICAgICAgICAgICAgICAgIHx8IHct PnBzZXVkb193aW5kb3dfcCk7CisKKyAgYm9vbCBmcmluZ2VzX3VwZGF0ZWRfcCA9ICghTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IG1jX3VwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywga2VlcF9jdXJyZW50 X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICA6IHVwZGF0ZV93aW5kb3dfZnJpbmdlcyAo dywga2VlcF9jdXJyZW50X3ApOworCiAgIGlmIChGUkFNRV9XSU5ET1dfUCAoZikKLSAgICAgICYm IHVwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgKGp1c3RfdGhpc19vbmVfcAotCQkJCSAgICB8fCAo IXVzZWRfY3VycmVudF9tYXRyaXhfcCAmJiAhb3ZlcmxheV9hcnJvd19zZWVuKQotCQkJCSAgICB8 fCB3LT5wc2V1ZG9fd2luZG93X3ApKSkKKyAgICAgICYmIGZyaW5nZXNfdXBkYXRlZF9wKQogICAg IHsKICAgICAgIHVwZGF0ZV9iZWdpbiAoZik7CiAgICAgICBibG9ja19pbnB1dCAoKTsKQEAgLTE3 NzA1LDYgKzIxNzY3LDkgQEAgcmVkaXNwbGF5X3dpbmRvdyAoTGlzcF9PYmplY3Qgd2luZG93LCBi b29sIGp1c3RfdGhpc19vbmVfcCkKICAgICAgIHVwZGF0ZV9lbmQgKGYpOwogICAgIH0KIAorLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogICBpZiAoV0lORE9XX0JPVFRPTV9ESVZJREVSX1dJ RFRIICh3KSkKICAgICB4X2RyYXdfYm90dG9tX2RpdmlkZXIgKHcpOwogI2VuZGlmIC8qIEhBVkVf V0lORE9XX1NZU1RFTSAqLwpAQCAtMTgwMTAsNiArMjIwNzUsMTkgQEAgdHJ5X3dpbmRvd19yZXVz aW5nX2N1cnJlbnRfbWF0cml4IChzdHJ1Y3Qgd2luZG93ICp3KQogCSAgICAgc2Nyb2xsX3J1bl9o b29rIHdpbGwgY2xlYXIgdGhlIGN1cnNvciwgYW5kIHVzZSB0aGUKIAkgICAgIGN1cnJlbnQgbWF0 cml4IHRvIGdldCB0aGUgaGVpZ2h0IG9mIHRoZSByb3cgdGhlIGN1cnNvciBpcwogCSAgICAgaW4u ICAqLworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAq LworCisgIGlmICh0cmFjZV9yZWRpc3BsYXlfcCkKKyAgICBmcHJpbnRmIChzdGRlcnIsICJ0cnlf d2luZG93X3JldXNpbmdfY3VycmVudF9tYXRyaXggWzEgb2YgMl0gKCVzKVxuIiwgbWNfd2luZG93 ICh3KSk7CisKKyAgbWNfZXJhc2VfcHJlX3Njcm9sbF9kaXNwbGF5ICh3KTsKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogCSAgcnVuLmN1cnJlbnRfeSA9IHN0YXJ0X3Jvdy0+eTsKIAkg IHJ1bi5kZXNpcmVkX3kgPSBpdC5jdXJyZW50X3k7CiAJICBydW4uaGVpZ2h0ID0gaXQubGFzdF92 aXNpYmxlX3kgLSBpdC5jdXJyZW50X3k7CkBAIC0xODE3Myw2ICsyMjI1MSwxOSBAQCB0cnlfd2lu ZG93X3JldXNpbmdfY3VycmVudF9tYXRyaXggKHN0cnVjdCB3aW5kb3cgKncpCiAJfQogCiAgICAg ICAvKiBTY3JvbGwgdGhlIGRpc3BsYXkuICAqLworCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlmICh0cmFjZV9yZWRpc3BsYXlfcCkKKyAg ICBmcHJpbnRmIChzdGRlcnIsICJ0cnlfd2luZG93X3JldXNpbmdfY3VycmVudF9tYXRyaXggWzIg b2YgMl0gKCVzKVxuIiwgbWNfd2luZG93ICh3KSk7CisKKyAgbWNfZXJhc2VfcHJlX3Njcm9sbF9k aXNwbGF5ICh3KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgcnVuLmN1 cnJlbnRfeSA9IGZpcnN0X3JldXNhYmxlX3Jvdy0+eTsKICAgICAgIHJ1bi5kZXNpcmVkX3kgPSBX SU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKICAgICAgIHJ1bi5oZWlnaHQgPSBpdC5sYXN0 X3Zpc2libGVfeSAtIHJ1bi5jdXJyZW50X3k7CkBAIC0xOTEyNyw2ICsyMzIxOCwxOSBAQCB0cnlf d2luZG93X2lkIChzdHJ1Y3Qgd2luZG93ICp3KQogICAvKiBTY3JvbGwgdGhlIGRpc3BsYXkuICBE byBpdCBiZWZvcmUgY2hhbmdpbmcgdGhlIGN1cnJlbnQgbWF0cml4IHNvCiAgICAgIHRoYXQgeHRl cm0uYyBkb2Vzbid0IGdldCBjb25mdXNlZCBhYm91dCB3aGVyZSB0aGUgY3Vyc29yIGdseXBoIGlz CiAgICAgIGZvdW5kLiAgKi8KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJ UExFLUNVUlNPUlMgKi8KKworICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAgZnByaW50ZiAo c3RkZXJyLCAidHJ5X3dpbmRvd19pZCAoJXMpXG4iLCBtY193aW5kb3cgKHcpKTsKKworICBtY19l cmFzZV9wcmVfc2Nyb2xsX2Rpc3BsYXkgKHcpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiAgIGlmIChkeSAmJiBydW4uaGVpZ2h0KQogICAgIHsKICAgICAgIHVwZGF0ZV9iZWdpbiAo Zik7CkBAIC0yMDEzMyw2ICsyNDIzNywxNyBAQCBhcHBlbmRfc3BhY2VfZm9yX25ld2xpbmUgKHN0 cnVjdCBpdCAqaXQsIGJvb2wgZGVmYXVsdF9mYWNlX3ApCiAJICBtZW1zZXQgKCZpdC0+cG9zaXRp b24sIDAsIHNpemVvZiBpdC0+cG9zaXRpb24pOwogCSAgaXQtPm9iamVjdCA9IFFuaWw7CiAJICBp dC0+YyA9IGl0LT5jaGFyX3RvX2Rpc3BsYXkgPSAnICc7CisKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGlmIChJVF9CWVRFUE9TICgq aXQpID49IFpWX0JZVEUpCisgICAgICAgIGl0LT56dl9wID0gdHJ1ZTsKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisKKwogCSAgaXQtPmxlbiA9IDE7CiAKIAkgIC8qIElmIHRoZSBkZWZhdWx0 IGZhY2Ugd2FzIHJlbWFwcGVkLCBiZSBzdXJlIHRvIHVzZSB0aGUKQEAgLTIxMjY5LDkgKzI1Mzg0 LDIyIEBAIG1heWJlX3Byb2R1Y2VfbGluZV9udW1iZXIgKHN0cnVjdCBpdCAqaXQpCiAgICAgICBl bHNlCiAJdGVtX2l0LmMgPSB0ZW1faXQuY2hhcl90b19kaXNwbGF5ID0gKnA7CiAgICAgICB0ZW1f aXQubGVuID0gMTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKworICAgICAgaWYgKGJleW9uZF96dikKKyAgICAgICAgdGVtX2l0Lnp2X3AgPSB0 cnVlOworICAgICAgdGVtX2l0LmN1cnJlbnRfeSA9IGl0LT5jdXJyZW50X3k7CisgICAgICB0ZW1f aXQudnBvcyA9IGl0LT52cG9zOwogICAgICAgLyogTWFrZSBzdXJlIHRoZXNlIGdseXBocyB3aWxs IGhhdmUgYSAicG9zaXRpb24iIG9mIC0xLiAgKi8KICAgICAgIFNFVF9URVhUX1BPUyAodGVtX2l0 LnBvc2l0aW9uLCAtMSwgLTEpOwogICAgICAgUFJPRFVDRV9HTFlQSFMgKCZ0ZW1faXQpOworICAg ICAgdGVtX2l0Lmhwb3MgKz0gMTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKIAogICAg ICAgLyogU3RvcCBwcm9kdWNpbmcgZ2x5cGhzLCBhbmQgcmVmcmFpbiBmcm9tIHByb2R1Y2luZyB0 aGUgbGluZQogCSBudW1iZXIsIGlmIHdlIGRvbid0IGhhdmUgZW5vdWdoIHNwYWNlIG9uIHRoaXMg bGluZS4gICovCkBAIC0yMTI4NCw2ICsyNTQxMiwzMCBAQCBtYXliZV9wcm9kdWNlX2xpbmVfbnVt YmVyIChzdHJ1Y3QgaXQgKml0KQogCX0KICAgICB9CiAKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgTGlzcF9PYmplY3QgYnVmID0gaXQtPnct PmNvbnRlbnRzOworICBDSEVDS19CVUZGRVIgKGJ1Zik7CisgIHN0cnVjdCBidWZmZXIgKmIgPSBY QlVGRkVSIChidWYpOworICBzdHJ1Y3QgYnVmZmVyICpvbGRfYnVmZmVyID0gTlVMTDsKKyAgLyog TmVlZGVkIHNvIHRoYXQgYnVmZmVyLWxvY2FsIHZhbHVlcyBjYW4gYmUgZGV0ZXJtaW5lZDsgZS5n Liwgd2hlbiBzd2l0Y2hpbmcKKyAgdG8gdGhlIG1pbmlidWZmZXIuICovCisgIGlmIChiICE9IGN1 cnJlbnRfYnVmZmVyKQorICAgIHsKKyAgICAgIG9sZF9idWZmZXIgPSBjdXJyZW50X2J1ZmZlcjsK KyAgICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKGIpOworICAgIH0KKyAgaXQtPnctPm1jLmxudW1f cGl4ZWxfd2lkdGggPSAoIU5JTFAgKFZkaXNwbGF5X2xpbmVfbnVtYmVycykpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyB0ZW1faXQuY3VycmVudF94CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAwOworICBpZiAob2xkX2J1ZmZlcikKKyAgICBzZXRfYnVmZmVyX2lu dGVybmFsIChvbGRfYnVmZmVyKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAv KiBSZWNvcmQgdGhlIHdpZHRoIGluIHBpeGVscyB3ZSBuZWVkIGZvciB0aGUgbGluZSBudW1iZXIg ZGlzcGxheS4gICovCiAgIGl0LT5sbnVtX3BpeGVsX3dpZHRoID0gdGVtX2l0LmN1cnJlbnRfeDsK ICAgLyogQ29weSB0aGUgcHJvZHVjZWQgZ2x5cGhzIGludG8gSVQncyBnbHlwaF9yb3cuICAqLwpA QCAtMjcwOTIsNiArMzEyNDQsMjAgQEAgYXBwZW5kX2dseXBoIChzdHJ1Y3QgaXQgKml0KQogCSAg ICBnWzFdID0gKmc7CiAJICBnbHlwaCA9IGl0LT5nbHlwaF9yb3ctPmdseXBoc1thcmVhXTsKIAl9 CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK KyAgICAgIGdseXBoLT54ID0gaXQtPmN1cnJlbnRfeDsKKyAgICAgIGdseXBoLT55ID0gaXQtPmN1 cnJlbnRfeTsKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBnbHlwaC0+dnBv cyA9IGl0LT52cG9zOworICAgICAgZ2x5cGgtPnp2X3AgPSBpdC0+enZfcDsKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogICAgICAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+ cG9zaXRpb24pOwogICAgICAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAgICAgICBpZiAo aXQtPnBpeGVsX3dpZHRoID4gMCkKQEAgLTI3MTc1LDYgKzMxMzQxLDIwIEBAIGFwcGVuZF9jb21w b3NpdGVfZ2x5cGggKHN0cnVjdCBpdCAqaXQpCiAJICAgIGdbMV0gPSAqZzsKIAkgIGdseXBoID0g aXQtPmdseXBoX3Jvdy0+Z2x5cGhzW2l0LT5hcmVhXTsKIAl9CisKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGdseXBoLT54ID0gaXQt PmN1cnJlbnRfeDsKKyAgICAgIGdseXBoLT55ID0gaXQtPmN1cnJlbnRfeTsKKyAgICAgIGdseXBo LT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBnbHlwaC0+dnBvcyA9IGl0LT52cG9zOworICAgICAg Z2x5cGgtPnp2X3AgPSBpdC0+enZfcDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog ICAgICAgZ2x5cGgtPmNoYXJwb3MgPSBpdC0+Y21wX2l0LmNoYXJwb3M7CiAgICAgICBnbHlwaC0+ b2JqZWN0ID0gaXQtPm9iamVjdDsKICAgICAgIGVhc3NlcnQgKGl0LT5waXhlbF93aWR0aCA8PSBT SFJUX01BWCk7CkBAIC0yNzM4Myw2ICszMTU2MywyMCBAQCBwcm9kdWNlX2ltYWdlX2dseXBoIChz dHJ1Y3QgaXQgKml0KQogCX0KICAgICAgIGlmIChnbHlwaCA8IGl0LT5nbHlwaF9yb3ctPmdseXBo c1thcmVhICsgMV0pCiAJeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQ TEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+eCA9IGl0LT5jdXJyZW50X3g7CisgICAgICBn bHlwaC0+eSA9IGl0LT5jdXJyZW50X3k7CisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOwor ICAgICAgZ2x5cGgtPnZwb3MgPSBpdC0+dnBvczsKKyAgICAgIGdseXBoLT56dl9wID0gaXQtPnp2 X3A7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgIGdseXBoLT5jaGFycG9zID0g Q0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKIAkgIGdseXBoLT5vYmplY3QgPSBpdC0+b2JqZWN0Owog CSAgZ2x5cGgtPnBpeGVsX3dpZHRoID0gY2xpcF90b19ib3VuZHMgKC0xLCBpdC0+cGl4ZWxfd2lk dGgsIFNIUlRfTUFYKTsKQEAgLTI3NDg2LDYgKzMxNjgwLDIwIEBAIHByb2R1Y2VfeHdpZGdldF9n bHlwaCAoc3RydWN0IGl0ICppdCkKIAl9CiAgICAgICBpZiAoZ2x5cGggPCBpdC0+Z2x5cGhfcm93 LT5nbHlwaHNbYXJlYSArIDFdKQogCXsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPnggPSBpdC0+Y3VycmVudF94Owor ICAgICAgZ2x5cGgtPnkgPSBpdC0+Y3VycmVudF95OworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+ aHBvczsKKyAgICAgIGdseXBoLT52cG9zID0gaXQtPnZwb3M7CisgICAgICBnbHlwaC0+enZfcCA9 IGl0LT56dl9wOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICBnbHlwaC0+Y2hh cnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAJICBnbHlwaC0+b2JqZWN0ID0gaXQtPm9i amVjdDsKIAkgIGdseXBoLT5waXhlbF93aWR0aCA9IGNsaXBfdG9fYm91bmRzICgtMSwgaXQtPnBp eGVsX3dpZHRoLCBTSFJUX01BWCk7CkBAIC0yNzU3Miw2ICszMTc4MCwyMCBAQCBhcHBlbmRfc3Ry ZXRjaF9nbHlwaCAoc3RydWN0IGl0ICppdCwgTGlzcF9PYmplY3Qgb2JqZWN0LAogCSAgICB3aWR0 aCAtPSBpdC0+Zmlyc3RfdmlzaWJsZV94IC0gaXQtPmN1cnJlbnRfeDsKIAkgIGVhc3NlcnQgKHdp ZHRoID4gMCk7CiAJfQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUt Q1VSU09SUyAqLworCisgICAgICBnbHlwaC0+eCA9IGl0LT5jdXJyZW50X3g7CisgICAgICBnbHlw aC0+eSA9IGl0LT5jdXJyZW50X3k7CisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAg ICAgZ2x5cGgtPnZwb3MgPSBpdC0+dnBvczsKKyAgICAgIGdseXBoLT56dl9wID0gaXQtPnp2X3A7 CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIGdseXBoLT5jaGFycG9zID0g Q0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5vYmplY3QgPSBvYmplY3Q7CiAg ICAgICAvKiBGSVhNRTogSXQgd291bGQgYmUgYmV0dGVyIHRvIHVzZSBUWVBFX01BWCBoZXJlLCBi dXQKQEAgLTI4MDI2LDYgKzMyMjQ4LDIwIEBAIGFwcGVuZF9nbHlwaGxlc3NfZ2x5cGggKHN0cnVj dCBpdCAqaXQsIGludCBmYWNlX2lkLCBib29sIGZvcl9ub19mb250LCBpbnQgbGVuLAogCSAgICBn WzFdID0gKmc7CiAJICBnbHlwaCA9IGl0LT5nbHlwaF9yb3ctPmdseXBoc1thcmVhXTsKIAl9CisK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAg ICAgIGdseXBoLT54ID0gaXQtPmN1cnJlbnRfeDsKKyAgICAgIGdseXBoLT55ID0gaXQtPmN1cnJl bnRfeTsKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBnbHlwaC0+dnBvcyA9 IGl0LT52cG9zOworICAgICAgZ2x5cGgtPnp2X3AgPSBpdC0+enZfcDsKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisKKwogICAgICAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9z aXRpb24pOwogICAgICAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAgICAgICBlYXNzZXJ0 IChpdC0+cGl4ZWxfd2lkdGggPD0gU0hSVF9NQVgpOwpAQCAtMjkwNzYsMTAgKzMzMzEyLDMzIEBA IHhfaW5zZXJ0X2dseXBocyAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqdXBk YXRlZF9yb3csCiAKICAgLyogV3JpdGUgdGhlIGdseXBocy4gICovCiAgIGhwb3MgPSBzdGFydCAt IHJvdy0+Z2x5cGhzW3VwZGF0ZWRfYXJlYV07CisKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgaWYgKCh3LT5tY19lbHRzLnVzZWQgPiAwIHx8 IHctPmNoX2VsdHMudXNlZCA+IDAgfHwgdy0+ZmNfZWx0cy51c2VkID4gMCkKKyAgICAgICYmIHVw ZGF0ZWRfYXJlYSA9PSBURVhUX0FSRUEpCisgICAgeworICAgICAgc3RydWN0IGdseXBoX21hdHJp eCAqbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9S T1dfVlBPUyAocm93LCBtYXRyaXgpOworICAgICAgaW50IHN0YXJ0X3ggPSB3LT5vdXRwdXRfY3Vy c29yLng7CisgICAgICBpbnQgc3RhcnRfaHBvcyA9IGhwb3M7CisgICAgICBpbnQgZW5kX2hwb3Mg PSBocG9zICsgbGVuOworICAgICAgYm9vbCBjbGVhcl9lb2xfcCA9IGZhbHNlOworICAgICAgZW51 bSBkcmF3X2dseXBoc19mYWNlIGhsID0gRFJBV19OT1JNQUxfVEVYVDsKKyAgICAgIFRSQUNFICgo c3RkZXJyLCAieF9pbnNlcnRfZ2x5cGhzICglZCk6ICBzdGFydF94ICglZCkgfCBzdGFydF9ocG9z ICglZCkgfCBlbmRfaHBvcyAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgIHZwb3MsIHN0 YXJ0X3gsIHN0YXJ0X2hwb3MsIGVuZF9ocG9zKSk7CisgICAgICBtY19yZWRyYXdfcm93ICh3LCBt YXRyaXgsIHJvdywgc3RhcnRfeCwgc3RhcnRfaHBvcywgZW5kX2hwb3MsIGNsZWFyX2VvbF9wLCBo bCk7CisgICAgfQorICAgIGVsc2UKICAgZHJhd19nbHlwaHMgKHcsIHctPm91dHB1dF9jdXJzb3Iu eCwgcm93LCB1cGRhdGVkX2FyZWEsCiAJICAgICAgIGhwb3MsIGhwb3MgKyBsZW4sCiAJICAgICAg IERSQVdfTk9STUFMX1RFWFQsIDApOwogCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAg IC8qIEFkdmFuY2UgdGhlIG91dHB1dCBjdXJzb3IuICAqLwogICB3LT5vdXRwdXRfY3Vyc29yLmhw b3MgKz0gbGVuOwogICB3LT5vdXRwdXRfY3Vyc29yLnggKz0gc2hpZnRfYnlfd2lkdGg7CkBAIC0y OTUwNSw5ICszMzc2NCwzMSBAQCB4X2ZpeF9vdmVybGFwcGluZ19hcmVhIChzdHJ1Y3Qgd2luZG93 ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCiAJICB3aGlsZSAoaSA8IHJvdy0+dXNlZFthcmVh XQogCQkgJiYgcm93LT5nbHlwaHNbYXJlYV1baV0ub3ZlcmxhcHNfdmVydGljYWxseV9wKTsKIAor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAg ICAgICBpZiAoKHctPm1jX2VsdHMudXNlZCA+IDAgfHwgdy0+Y2hfZWx0cy51c2VkID4gMCB8fCB3 LT5mY19lbHRzLnVzZWQgPiAwKQorICAgICAgICAgICAgJiYgYXJlYSA9PSBURVhUX0FSRUEpCisg ICAgICAgICAgeworICAgICAgICAgICAgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4ID0gdy0+ Y3VycmVudF9tYXRyaXg7CisgICAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAo cm93LCBtYXRyaXgpOworICAgICAgICAgICAgaW50IHN0YXJ0X2hwb3MgPSBzdGFydDsKKyAgICAg ICAgICAgIGludCBlbmRfaHBvcyA9IGk7CisgICAgICAgICAgICBib29sIGNsZWFyX2VvbF9wID0g ZmFsc2U7CisgICAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UgaGwgPSBEUkFXX05PUk1B TF9URVhUOworICAgICAgICAgICAgVFJBQ0UgKChzdGRlcnIsICJ4X2ZpeF9vdmVybGFwcGluZ19h cmVhICglZCk6ICBzdGFydF94ICglZCkgfCBzdGFydF9ocG9zICglZCkgfCBlbmRfaHBvcyAoJWQp XG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZwb3MsIHN0YXJ0X3gsIHN0YXJ0X2hw b3MsIGVuZF9ocG9zKSk7CisgICAgICAgICAgICBtY19yZWRyYXdfcm93ICh3LCBtYXRyaXgsIHJv dywgc3RhcnRfeCwgc3RhcnRfaHBvcywgZW5kX2hwb3MsIGNsZWFyX2VvbF9wLCBobCk7CisgICAg ICAgICAgfQorICAgICAgICAgIGVsc2UKIAkgIGRyYXdfZ2x5cGhzICh3LCBzdGFydF94LCByb3cs IGFyZWEsCiAJCSAgICAgICBzdGFydCwgaSwKIAkJICAgICAgIERSQVdfTk9STUFMX1RFWFQsIG92 ZXJsYXBzKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCX0KICAgICAgIGVsc2UK IAl7CkBAIC0yOTc1OCwxMCArMzQwMzksMTcgQEAgZGlzcGxheV9hbmRfc2V0X2N1cnNvciAoc3Ry dWN0IHdpbmRvdyAqdywgYm9vbCBvbiwKICAgbmV3X2N1cnNvcl90eXBlID0gZ2V0X3dpbmRvd19j dXJzb3JfdHlwZSAodywgZ2x5cGgsCiAJCQkJCSAgICAmbmV3X2N1cnNvcl93aWR0aCwgJmFjdGl2 ZV9jdXJzb3IpOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VS U09SUyAqLworCiAgIC8qIElmIGN1cnNvciBpcyBjdXJyZW50bHkgYmVpbmcgc2hvd24gYW5kIHdl IGRvbid0IHdhbnQgaXQgdG8gYmUgb3IKICAgICAgaXQgaXMgaW4gdGhlIHdyb25nIHBsYWNlLCBv ciB0aGUgY3Vyc29yIHR5cGUgaXMgbm90IHdoYXQgd2Ugd2FudCwKICAgICAgZXJhc2UgaXQuICAq LwogICBpZiAody0+cGh5c19jdXJzb3Jfb25fcAorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZG RVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVG RkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQogICAgICAgJiYgKCFvbgogCSAgfHwgdy0+cGh5 c19jdXJzb3IueCAhPSB4CiAJICB8fCB3LT5waHlzX2N1cnNvci55ICE9IHkKQEAgLTI5Nzc0LDYg KzM0MDYyLDkgQEAgZGlzcGxheV9hbmRfc2V0X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgYm9v bCBvbiwKIAkgICAgICAmJiBuZXdfY3Vyc29yX3dpZHRoICE9IHctPnBoeXNfY3Vyc29yX3dpZHRo KSkpCiAgICAgZXJhc2VfcGh5c19jdXJzb3IgKHcpOwogCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKworCiAgIC8qIERvbid0IGNoZWNrIHBoeXNfY3Vyc29yX29uX3AgaGVyZSBiZWNhdXNlIHRo YXQgZmxhZyBpcyBvbmx5IHNldAogICAgICB0byBmYWxzZSBpbiBzb21lIGNhc2VzIHdoZXJlIHdl IGtub3cgdGhhdCB0aGUgY3Vyc29yIGhhcyBiZWVuCiAgICAgIGNvbXBsZXRlbHkgZXJhc2VkLCB0 byBhdm9pZCB0aGUgZXh0cmEgd29yayBvZiBlcmFzaW5nIHRoZSBjdXJzb3IKQEAgLTI5NzkyLDkg KzM0MDgzLDE5IEBAIGRpc3BsYXlfYW5kX3NldF9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIGJv b2wgb24sCiAgICAgICB3LT5waHlzX2N1cnNvci52cG9zID0gdnBvczsKICAgICB9CiAKLSAgRlJB TUVfUklGIChmKS0+ZHJhd193aW5kb3dfY3Vyc29yICh3LCBnbHlwaF9yb3csIHgsIHksCi0gICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2N1cnNvcl90eXBlLCBuZXdfY3Vy c29yX3dpZHRoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uLCBhY3Rp dmVfY3Vyc29yKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJT T1JTICovCisKKyAgaWYgKE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3No YWlycykpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zp c2libGUpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19j b25mKSkpCisgICAgRlJBTUVfUklGIChmKS0+ZHJhd193aW5kb3dfY3Vyc29yICh3LCBnbHlwaF9y b3csIHgsIHksIG5ld19jdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIG5ld19jdXJzb3Jfd2lkdGgsIG9uLCBhY3RpdmVfY3Vyc29yKTsKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogfQogCiAKQEAgLTI5ODg3LDcgKzM0MTg4LDI3IEBAIGRy YXdfcm93X3dpdGhfbW91c2VfZmFjZSAoc3RydWN0IHdpbmRvdyAqdywgaW50IHN0YXJ0X3gsIHN0 cnVjdCBnbHlwaF9yb3cgKnJvdywKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KICAgaWYgKEZS QU1FX1dJTkRPV19QIChYRlJBTUUgKHctPmZyYW1lKSkpCiAgICAgeworCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBpZiAody0+bWNf ZWx0cy51c2VkID4gMCB8fCB3LT5jaF9lbHRzLnVzZWQgPiAwIHx8IHctPmZjX2VsdHMudXNlZCA+ IDApCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXggPSB3 LT5jdXJyZW50X21hdHJpeDsKKyAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAo cm93LCBtYXRyaXgpOworICAgICAgICAgIGJvb2wgY2xlYXJfZW9sX3AgPSBmYWxzZTsKKyAgICAg ICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UgaGwgPSBkcmF3OworICAgICAgICAgIFRSQUNFICgo c3RkZXJyLCAiZHJhd19yb3dfd2l0aF9tb3VzZV9mYWNlICglZCk6ICBzdGFydF94ICglZCkgfCBz dGFydF9ocG9zICglZCkgfCBlbmRfaHBvcyAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAg ICAgICB2cG9zLCBzdGFydF94LCBzdGFydF9ocG9zLCBlbmRfaHBvcykpOworICAgICAgICAgIG1j X3JlZHJhd19yb3cgKHcsIG1hdHJpeCwgcm93LCBzdGFydF94LCBzdGFydF9ocG9zLCBlbmRfaHBv cywgY2xlYXJfZW9sX3AsIGhsKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCiAgICAgICBkcmF3 X2dseXBocyAodywgc3RhcnRfeCwgcm93LCBURVhUX0FSRUEsIHN0YXJ0X2hwb3MsIGVuZF9ocG9z LCBkcmF3LCAwKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgcmV0dXJu OwogICAgIH0KICNlbmRpZgpAQCAtMzE5NDUsMTEgKzM2MjY2LDM0IEBAIGV4cG9zZV9hcmVhIChz dHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIFhSZWN0YW5nbGUgKnIsCiAg IHN0cnVjdCBnbHlwaCAqbGFzdDsKICAgaW50IGZpcnN0X3gsIHN0YXJ0X3gsIHg7CiAKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgaWYgKGFy ZWEgPT0gVEVYVF9BUkVBICYmIHJvdy0+ZmlsbF9saW5lX3ApCisgICAgeworICAgICAgaWYgKHct Pm1jX2VsdHMudXNlZCA+IDAgfHwgdy0+Y2hfZWx0cy51c2VkID4gMCB8fCB3LT5mY19lbHRzLnVz ZWQgPiAwKQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4 ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQ T1MgKHJvdywgbWF0cml4KTsKKyAgICAgICAgICBpbnQgc3RhcnRfeCA9IDA7CisgICAgICAgICAg aW50IHN0YXJ0X2hwb3MgPSAwOworICAgICAgICAgIGludCBlbmRfaHBvcyA9IHJvdy0+dXNlZFtU RVhUX0FSRUFdOworICAgICAgICAgIGJvb2wgY2xlYXJfZW9sX3AgPSBmYWxzZTsKKyAgICAgICAg ICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UgaGwgPSBEUkFXX05PUk1BTF9URVhUOworICAgICAgICAg IFRSQUNFICgoc3RkZXJyLCAiZXhwb3NlX2FyZWEgKCVkKTogIFdyaXRlIHRoZSB3aG9sZSBsaW5l LlxuIiwgdnBvcykpOworICAgICAgICAgIG1jX3JlZHJhd19yb3cgKHcsIG1hdHJpeCwgcm93LCBz dGFydF94LCBzdGFydF9ocG9zLCBlbmRfaHBvcywgY2xlYXJfZW9sX3AsIGhsKTsKKyAgICAgICAg fQorICAgICAgICBlbHNlCiAgICAgLyogSWYgcm93IGV4dGVuZHMgZmFjZSB0byBlbmQgb2YgbGlu ZSB3cml0ZSB0aGUgd2hvbGUgbGluZS4gICovCiAgICAgZHJhd19nbHlwaHMgKHcsIDAsIHJvdywg YXJlYSwKIAkJIDAsIHJvdy0+dXNlZFthcmVhXSwKIAkJIERSQVdfTk9STUFMX1RFWFQsIDApOwor ICAgIH0KKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBlbHNlCiAgICAgewogICAg ICAgLyogU2V0IFNUQVJUX1ggdG8gdGhlIHdpbmRvdy1yZWxhdGl2ZSBzdGFydCBwb3NpdGlvbiBm b3IgZHJhd2luZyBnbHlwaHMgb2YKQEAgLTMxOTgxLDExICszNjMyNSwzNCBAQCBleHBvc2VfYXJl YSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqcm93LCBYUmVjdGFuZ2xlICpy LAogCSAgKytsYXN0OwogCX0KIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJ UExFLUNVUlNPUlMgKi8KKwogICAgICAgLyogUmVwYWludC4gICovCi0gICAgICBpZiAobGFzdCA+ IGZpcnN0KQorICAgIC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pZiAobGFzdCA+IGZp cnN0KQogCWRyYXdfZ2x5cGhzICh3LCBmaXJzdF94IC0gc3RhcnRfeCwgcm93LCBhcmVhLAogCQkg ICAgIGZpcnN0IC0gcm93LT5nbHlwaHNbYXJlYV0sIGxhc3QgLSByb3ctPmdseXBoc1thcmVhXSwK IAkJICAgICBEUkFXX05PUk1BTF9URVhULCAwKTsKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogICAgIH0KIH0KIApAQCAtMzE5OTksMTAgKzM2MzY2LDMzIEBAIGV4cG9zZV9saW5lIChz dHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIFhSZWN0YW5nbGUgKnIpCiB7 CiAgIGVhc3NlcnQgKHJvdy0+ZW5hYmxlZF9wKTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogICBpZiAocm93LT5tb2RlX2xpbmVfcCB8fCB3 LT5wc2V1ZG9fd2luZG93X3ApCisgICAgeworICAgICAgaWYgKHctPm1jX2VsdHMudXNlZCA+IDAg fHwgdy0+Y2hfZWx0cy51c2VkID4gMCB8fCB3LT5mY19lbHRzLnVzZWQgPiAwKQorICAgICAgICB7 CisgICAgICAgICAgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4ID0gdy0+Y3VycmVudF9tYXRy aXg7CisgICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsK KyAgICAgICAgICBpbnQgc3RhcnRfeCA9IDA7CisgICAgICAgICAgaW50IHN0YXJ0X2hwb3MgPSAw OworICAgICAgICAgIGludCBlbmRfaHBvcyA9IHJvdy0+dXNlZFtURVhUX0FSRUFdOworICAgICAg ICAgIGJvb2wgY2xlYXJfZW9sX3AgPSBmYWxzZTsKKyAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhz X2ZhY2UgaGwgPSBEUkFXX05PUk1BTF9URVhUOworICAgICAgICAgIFRSQUNFICgoc3RkZXJyLCAi ZXhwb3NlX2xpbmUgKCVkKTogIFdyaXRlIHRoZSB3aG9sZSBsaW5lLlxuIiwgdnBvcykpOworICAg ICAgICAgIG1jX3JlZHJhd19yb3cgKHcsIG1hdHJpeCwgcm93LCBzdGFydF94LCBzdGFydF9ocG9z LCBlbmRfaHBvcywgY2xlYXJfZW9sX3AsIGhsKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCiAg ICAgZHJhd19nbHlwaHMgKHcsIDAsIHJvdywgVEVYVF9BUkVBLAogCQkgMCwgcm93LT51c2VkW1RF WFRfQVJFQV0sCiAJCSBEUkFXX05PUk1BTF9URVhULCAwKTsKKyAgICB9CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKICAgZWxzZQogICAgIHsKICAgICAgIGlmIChyb3ctPnVzZWRbTEVG VF9NQVJHSU5fQVJFQV0pCkBAIC0zMjU1MCw2ICszNjk0MCwyMiBAQCB4X2ludGVyc2VjdF9yZWN0 YW5nbGVzIChYUmVjdGFuZ2xlICpyMSwgWFJlY3RhbmdsZSAqcjIsIFhSZWN0YW5nbGUgKnJlc3Vs dCkKIHZvaWQKIHN5bXNfb2ZfeGRpc3AgKHZvaWQpCiB7CisKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZGVmc3ViciAoJlNtY19kdW1wX2ds eXBoX3Jvdyk7CisKKyAgZGVmc3ViciAoJlNtY19kdW1wX2dseXBoX21hdHJpeCk7CisKKyAgZGVm c3ViciAoJlNtY19jdXJyZW50X2NvbHVtbik7CisKKyAgZGVmc3ViciAoJlNtY19zdGRlcnIpOwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIFZ3aXRoX2VjaG9fYXJlYV9zYXZlX3Zl Y3RvciA9IFFuaWw7CiAgIHN0YXRpY3BybyAoJlZ3aXRoX2VjaG9fYXJlYV9zYXZlX3ZlY3Rvcik7 CiAKZGlmZiAtLWdpdCBhL3NyYy94dGVybS5jIGIvc3JjL3h0ZXJtLmMKaW5kZXggNWFhM2UzZi4u NTc4OWY1NCAxMDA2NDQKLS0tIGEvc3JjL3h0ZXJtLmMKKysrIGIvc3JjL3h0ZXJtLmMKQEAgLTEz Miw2ICsxMzIsODc4IEBAIGFsb25nIHdpdGggR05VIEVtYWNzLiAgSWYgbm90LCBzZWUgPGh0dHBz Oi8vd3d3LmdudS5vcmcvbGljZW5zZXMvPi4gICovCiAjaW5jbHVkZSA8WDExL1hLQmxpYi5oPgog I2VuZGlmCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1D VVJTT1JTICovCisKKyNpZmRlZiBHTFlQSF9ERUJVRworc3RhdGljIHZvaWQgeF9jaGVja19mb250 IChzdHJ1Y3QgZnJhbWUgKiwgc3RydWN0IGZvbnQgKik7CisjZW5kaWYKKworc3RhdGljIHZvaWQg eF9zZXRfbW9kZV9saW5lX2ZhY2VfZ2MgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKik7CisKK3N0YXRp YyB2b2lkIHhfc2V0X21vdXNlX2ZhY2VfZ2MgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKik7CisKK3N0 YXRpYyB2b2lkIHhfY2xpcF90b19yb3cgKHN0cnV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BmeCwgaW50IHksIGludCBmeSwgaW50IGhwb3MsIGludCB2cG9zLCBpbnQgd2Qs IGludCBoLAorICAgICAgICAgICAgICAgICAgZG91YmxlIHJlZCwgZG91YmxlIGdyZWVuLCBkb3Vi bGUgYmx1ZSwgZW51bSB0eXBlX29mX2N1cnNvciBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAg ICAgIGludCBjdXJzb3Jfd2lkdGgsIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciwgYm9vbCBv bl9wLCBib29sIGFjdGl2ZV9wKQoreworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRP V19GUkFNRSAodykpOworICBpZiAob25fcCkKKyAgICB7CisgICAgICBpZiAocm93LT5leGFjdF93 aW5kb3dfd2lkdGhfbGluZV9wCisgICAgICAgICAgJiYgKHJvdy0+cmV2ZXJzZWRfcAorICAgICAg ICAgICAgICA/IChocG9zIDwgMCkKKyAgICAgICAgICAgICAgOiAoaHBvcyA+PSByb3ctPnVzZWRb VEVYVF9BUkVBXSkpKQorICAgICAgICB7CisgICAgICAgICAgcm93LT5jdXJzb3JfaW5fZnJpbmdl X3AgPSB0cnVlOworICAgICAgICAgIGRyYXdfZnJpbmdlX2JpdG1hcCAodywgcm93LCByb3ctPnJl dmVyc2VkX3ApOworICAgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIHsKKyAgQ29sb3JtYXAg Y21hcCA9IEZSQU1FX1hfQ09MT1JNQVAgKGYpOworICB1bnNpZ25lZCBsb25nIG9yaWdpbmFsX2N1 cnNvcl9waXhlbCA9IGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbDsKKyAgLyogeHRlcm0u Yy94dGVybS5oIHVzZSBHQzsgd2hlcmVhcywgdzMydGVybS5jL3czMnRlcm0uaCB1c2UgWEdDVmFs dWVzICogKi8KKyAgWEdDVmFsdWVzIHhnY3Y7CisgIFhHZXRHQ1ZhbHVlcyAoRlJBTUVfWF9ESVN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Y29sb3IucGl4ZWxgLiAqLworICB4X2FsbG9jX25lYXJlc3RfY29sb3IgKGYsIGNt YXAsICZjb2xvcik7CisgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgIHsKKyAgICBjYXNlIE1DX05P X0ZSSU5HRV9CSVRNQVA6CisgICAgICBicmVhazsKKyAgICBjYXNlIE1DX05PX0NVUlNPUjoKKyAg ICAgIGJyZWFrOworICAgIGNhc2UgTUNfUklHSFRfRlJJTkdFX0JJVE1BUDoKKyAgICAgIGJyZWFr OworICAgIGNhc2UgTUNfTEVGVF9GUklOR0VfQklUTUFQOgorICAgICAgYnJlYWs7CisgICAgY2Fz ZSBNQ19GUkFNRURfQk9YOgorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlwaCAqY3Vyc29yX2dseXBo ID0gbWNfZ2V0X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIGhwb3MsIHZwb3MpOworICAg ICAgaWYgKGN1cnNvcl9nbHlwaCA9PSBOVUxMKQorICAgICAgICByZXR1cm47CisgICAgICBMaXNw X09iamVjdCBidWYgPSB3LT5jb250ZW50czsKKyAgICAgIENIRUNLX0JVRkZFUiAoYnVmKTsKKyAg ICAgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSIChidWYpOworICAgICAgYm9vbCByZWdpb25f YWN0aXZlX3AgPSAoIU5JTFAgKFZ0cmFuc2llbnRfbWFya19tb2RlKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIG1hcmtfYWN0aXZlKSkpOworICAgICAg cHRyZGlmZl90IHJlZ2lvbl9iZWdpbm5pbmcgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IFhGSVhOVU0g KEZyZWdpb25fYmVnaW5uaW5nICgpKSA6IC0xOworICAgICAgcHRyZGlmZl90IHJlZ2lvbl9lbmQg PSAocmVnaW9uX2FjdGl2ZV9wKSA/IFhGSVhOVU0gKEZyZWdpb25fZW5kICgpKSA6IC0xOworICAg ICAgcHRyZGlmZl90IG9wb2ludF9wdCA9ICh3ID09IFhXSU5ET1cgKHNlbGVjdGVkX3dpbmRvdykp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBQVAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogWEZJWE5VTSAoRm1hcmtlcl9wb3NpdGlvbiAody0+cG9pbnRtKSk7CisgICAgICBi b29sIHJlZ2lvbl9pbl9ib3VuZHNfcCA9IChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF9wdCA+PSByZWdpb25fYmVnaW5uaW5nCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfcHQgPCByZWdpb25fZW5kKTsK KyAgICAgIGlmIChjdXJzb3JfZ2x5cGgtPnR5cGUgIT0gSU1BR0VfR0xZUEggJiYgcmVkID49IDAg JiYgYmx1ZSA+PSAwICYmIGdyZWVuID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1w b3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYycgYnkgYm9ycm93aW5n IHRoZQorICAgICAgICAgIGZ1bmN0aW9uYWxpdHkgb2YgYHhfbWFrZV9nYycgaW4geGZucy5jLiAg Ki8KKyAgICAgICAgICBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICYmIHJlZ2lv bl9pbl9ib3VuZHNfcAorICAgICAgICAgICAgICAmJiBhY3RpdmVfcCkKKyAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2ZhY2VfaWQg PSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXJl Z2lvbi1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG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PSBjb2xvci5waXhlbDsKKyAgICAgICAgICBt Y194X2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBv cywgdnBvcywgd2QsIGgpOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhl bCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChj dXJzb3JfZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEggJiYgcmVkID49IDAgJiYgYmx1ZSA+PSAw ICYmIGdyZWVuID49IDApCisgICAgICAgICAgeworICAgICAgICAgICAgLyogVGVtcG9yYXJpbHkg aGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgICAg IGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IGNvbG9yLnBpeGVsOworICAgICAgICAg ICAgbWNfeF9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnks IGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAgICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNv cl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgICB9CisgICAgICAgICAg ZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sg YGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYycgYnkgYm9ycm93aW5nIHRoZQorICAgICAgICAg ICAgICBmdW5jdGlvbmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHhmbnMuYy4gICovCisgICAgICAg ICAgICAgIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICYmIHJlZ2lvbl9p bl9ib3VuZHNfcAorICAgICAgICAgICAgICAgICAgJiYgYWN0aXZlX3ApCisgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9u X2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2Ut Y3Vyc29yLXJlZ2lvbi1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgc3RydWN0IGZh Y2UgKmhvbGxvd19hY3RpdmVfcmVnaW9uX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19h Y3RpdmVfcmVnaW9uX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhv bGxvd19hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIr LXJlYWwtZmFrZS1jdXJzb3ItZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgIHN0cnVj dCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3Rp dmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9E SVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfYWN0aXZlX2Zh Y2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1F X1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2 ZV9yZWdpb25fZmFjZS0+YmFja2dyb3VuZCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgICAgIGVsc2UgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAg ICYmICFyZWdpb25fa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KKyAgICAgICAgICAgICAg ICAgIGVsc2UgaWYgKCFyZWdpb25fYWN0aXZlX3AgJiYgYWN0aXZlX3ApCisgICAgICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2 ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtl LWN1cnNvci1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNl ICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFj ZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElT UExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9mYWNl LT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJB TUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfYWN0 aXZlX2ZhY2UtPmJhY2tncm91bmQpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAg ICAgICAgICAgIC8qIFRoZSByZWdpb24gaXMgX25vdF8gdmlzaWJsZSBpbiB0aGUgaW5hY3RpdmUg d2luZG93IGJlY2F1c2UgdGhlIG92ZXJsYXkgd2luZG93IHByb3BlcnR5IGlzIHVzZWQuICovCisg ICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKCFhY3RpdmVfcCkKKyAgICAgICAgICAgICAgICAg ICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0 aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwg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F9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCB4Z2N2LmZv cmVncm91bmQpOworICAgICAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZ IChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCB4Z2N2LmJhY2tncm91bmQpOworICAg ICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgICAgICAgICAvKiBEcmF3IHRoZSBm cmFtZSBhcm91bmQgdGhlIGJveC4gKi8KKyAgICAgICAgICAgICAgbWNfeF9kcmF3X2hvbGxvd19j dXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsK KyAgICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0hPTExPV19C T1g6CisgICAgeworICAgICAgaWYgKHJlZCA+PSAwICYmIGJsdWUgPj0gMCAmJiBncmVlbiA+PSAw KQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRf ZGF0YS54LT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5j dXJzb3JfcGl4ZWwgPSBjb2xvci5waXhlbDsKKyAgICAgICAgICBtY194X2RyYXdfaG9sbG93X2N1 cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOwor ICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNv cl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgbWNfeF9kcmF3X2hv bGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZw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1DX0JBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIGYtPm91dHB1 dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAg fQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2Nf aW52aXNpYmxlX29rYXlfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJz b3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLCBjdXJz b3Jfd2lkdGgsIE1DX0JBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAg IH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0hCQVI6CisgICAgeworICAgICAg aWYgKHJlZCA+PSAwICYmIGJsdWUgPj0gMCAmJiBncmVlbiA+PSAwKQorICAgICAgICB7CisgICAg ICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4 ZWwnLiAgKi8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBjb2xv ci5waXhlbDsKKyAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gdHJ1 ZTsKKyAgICAgICAgICBtY194X2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4 LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsIGN1cnNvcl93aWR0aCwgTUNfSEJBUiwgY3Vyc29y X2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNv cl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNl CisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlf cCA9IGZhbHNlOworICAgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwg cm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLCBjdXJzb3Jfd2lkdGgsIE1DX0hC QVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICB9CisgICAgICBicmVh azsKKyAgICB9CisgICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOworICB9CisgICAg ICAgIH0KKyNpZmRlZiBIQVZFX1hfSTE4TgorICBpZiAodyA9PSBYV0lORE9XIChmLT5zZWxlY3Rl ZF93aW5kb3cpKQorICAgIGlmIChGUkFNRV9YSUMgKGYpICYmIChGUkFNRV9YSUNfU1RZTEUgKGYp ICYgWElNUHJlZWRpdFBvc2l0aW9uKSkKKyAgICAgIHhpY19zZXRfcHJlZWRpdGFyZWEgKHcsIHgs IHkpOworI2VuZGlmCisgICAgfQorICBYRmx1c2ggKEZSQU1FX1hfRElTUExBWSAoZikpOworfQor CisvKiBEcmF3IHN0cmV0Y2ggZ2x5cGggc3RyaW5nIFMuICAqLworc3RhdGljIHZvaWQKK21jX3hf ZHJhd19zdHJldGNoX2dseXBoX3N0cmluZyAoc3RydWN0IGdseXBoX3N0cmluZyAqcykKK3sKKyAg ZWFzc2VydCAocy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gU1RSRVRDSF9HTFlQSCk7CisgIGlmIChz LT5obCA9PSBEUkFXX0NVUlNPUgorICAgICAgJiYgIXhfc3RyZXRjaF9jdXJzb3JfcCkKKyAgICB7 CisgICAgICAvKiBJZiBgeC1zdHJldGNoLWN1cnNvcicgaXMgbmlsLCBkb24ndCBkcmF3IGEgYmxv Y2sgY3Vyc29yIGFzCisgICB3aWRlIGFzIHRo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wgbm9uLWN1cnNvciBmYWNlLiAgKi8KKyAgICAgIGlmICh3aWR0aCA8IGJhY2tncm91bmRf d2lkdGgpCisgIHsKKyAgICBpbnQgeSA9IHMtPnk7CisgICAgaW50IHcgPSBiYWNrZ3JvdW5kX3dp ZHRoIC0gd2lkdGgsIGggPSBzLT5oZWlnaHQ7CisgICAgWFJlY3RhbmdsZSByOworICAgIEdDIGdj OworICAgIGlmICghcy0+cm93LT5yZXZlcnNlZF9wKQorICAgICAgeCArPSB3aWR0aDsKKyAgICBl bHNlCisgICAgICB4ID0gcy0+eDsKKyAgICBpZiAocy0+cm93LT5tb3VzZV9mYWNlX3AKKyAgICAg ICAgJiYgY3Vyc29yX2luX21vdXNlX2ZhY2VfcCAocy0+dykpCisgICAgICB7CisgICAgICAgIHhf c2V0X21vdXNlX2ZhY2VfZ2MgKHMpOworICAgICAgICBnYyA9IHMtPmdjOworICAgICAgfQorICAg IGVsc2UKKyAgICAgIGdjID0gcy0+ZmFjZS0+Z2M7CisgICAgZ2V0X2dseXBoX3N0cmluZ19jbGlw X3JlY3QgKHMsICZyKTsKKyAgICB4X3NldF9jbGlwX3JlY3RhbmdsZXMgKHMtPmYsIGdjLCAmciwg MSk7CisgICAgaWYgKHMtPmZhY2UtPnN0aXBwbGUpCisgICAgICB7CisgICAgICAgIC8qIEZpbGwg YmFja2dyb3VuZCB3aXRoIGEgc3RpcHBsZSBwYXR0ZXJuLiAgKi8KKyAgICAgICAgWFNldEZpbGxT dHlsZSAocy0+ZGlzcGxheSwgZ2MsIEZpbGxPcGFxdWVTdGlwcGxlZCk7CisgICAgICAgIHhfZmls bF9yZWN0YW5nbGUgKHMtPmYsIGdjLCB4LCB5LCB3LCBoKTsKKyAgICAgICAgWFNldEZpbGxTdHls ZSAocy0+ZGlzcGxheSwgZ2MsIEZpbGxTb2xpZCk7CisgICAgICB9CisgICAgZWxzZQorICAgICAg eworICAgICAgICBYR0NWYWx1ZXMgeGdjdjsKKyAgICAgICAgWEdldEdDV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GFuZzsKKyAgICAgICAgICAgd2lk dGggKz0gbmV4dC0+d2lkdGgsIG5leHQgPSBuZXh0LT5uZXh0KQorICAgICAgICBpZiAobmV4dC0+ Zmlyc3RfZ2x5cGgtPnR5cGUgIT0gSU1BR0VfR0xZUEgpCisgICAgICAgICAgeworICAgICAgICAg ICAgbWNfeF9zZXRfZ2x5cGhfc3RyaW5nX2djIChuZXh0LCBjdXJzb3JfZ2NfcCk7CisgICAgICAg ICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmcgKG5leHQpOworICAgICAgICAgICAgaWYg KG5leHQtPmZpcnN0X2dseXBoLT50eXBlID09IFNUUkVUQ0hfR0xZUEgpCisgICAgICAgICAgICAg IG1jX3hfZHJhd19zdHJldGNoX2dseXBoX3N0cmluZyAobmV4dCk7CisgICAgICAgICAgICBlbHNl CisgICAgICAgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAobmV4dCwgdHJ1 ZSk7CisgICAgICAgICAgICBuZXh0LT5udW1fY2xpcHMgPSAwOworICAgICAgICAgIH0KKyAgICB9 CisgIC8qIFNldCB1cCBTLT5nYywgc2V0IGNsaXBwaW5nIGFuZCBkcmF3IFMuICAqLworICBtY194 X3NldF9nbHlwaF9zdHJpbmdfZ2MgKHMsIGN1cnNvcl9nY19wKTsKKyAgLyogRHJhdyByZWxpZWYg KGlmIGFueSkgaW4gYWR2YW5jZSBmb3IgY2hhci9jb21wb3NpdGlvbiBzbyB0aGF0IHRoZQorICAg ICBnbHlwaCBzdHJpbmcgY2FuIGJlIGRyYXduIG92ZXIgaXQuICAqLworICBpZiAoIXMtPmZvcl9v dmVybGFwcworICAgICAgJiYgcy0+ZmFjZS0+Ym94ICE9IEZBQ0VfTk9fQk9YCisgICAgICAmJiAo cy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgIHx8IHMtPmZpcnN0X2dseXBo LT50eXBlID09IENPTVBPU0lURV9H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F3X2dseXBobGVzc19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAg ICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7CisgICAgfQorICBp ZiAoIXMtPmZvcl9vdmVybGFwcykKKyAgICB7CisgICAgICAvKiBEcmF3IHVuZGVybGluZS4gICov CisgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3ApCisgICAgICAgIHsKKyAgICAgICAgICBp ZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9XQVZFKQorICAgICAgICAg ICAgeworICAgICAgICAgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX2RlZmF1bHRlZF9wKQor ICAgICAgICAgICAgICAgIHhfZHJhd191bmRlcndhdmUgKHMpOworICAgICAgICAgICAgICBlbHNl CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgWEdDVmFsdWVzIHhnY3Y7Cisg ICAgICAgICAgICAgICAgICBYR2V0R0NWYWx1ZXMgKHMtPmRpc3BsYXksIHMtPmdjLCBHQ0ZvcmVn cm91bmQsICZ4Z2N2KTsKKyAgICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChzLT5kaXNw bGF5LCBzLT5nYywgcy0+ZmFjZS0+dW5kZXJsaW5lX2NvbG9yKTsKKyAgICAgICAgICAgICAgICAg IHhfZHJhd191bmRlcndhdmUgKHMpOworICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQg KHMtPmRpc3BsYXksIHMtPmdjLCB4Z2N2LmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlw ZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHVuc2ln bmVkIGxvbmcgdGhpY2tuZXNzLCBwb3NpdGlvbjsKKyAgICAgICAgICAgICAgaW50IHk7CisgICAg ICAgICAgICAgIGlmIChzLT5wcmV2ICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV9wCisgICAg ICAmJiBzLT5wcmV2LT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX0xJTkUpCisg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgLyogV2UgdXNlIHRoZSBzYW1lIHVu ZGVybGluZSBzdHlsZSBhcyB0aGUgcHJldmlvdXMgb25lLiAgKi8KKyAgICAgICAgICAgICAgICAg IHRoaWNrbmVzcyA9IHMtPnByZXYtPnVuZGVybGluZV90aGlja25lc3M7CisgICAgICAgICAgICAg ICAgICBwb3NpdGlvbiA9IHMtPnByZXYtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAg ICAgICB9CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgICAvKiBHZXQgdGhlIHVuZGVybGluZSB0aGlja25lc3MuICBEZWZhdWx0IGlzIDEgcGl4 ZWwuICAqLworICAgICAgICAgICAgICAgICAgaWYgKHMtPmZvbnQgJiYgcy0+Zm9udC0+dW5kZXJs aW5lX3RoaWNrbmVzcyA+IDApCisgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPmZv bnQtPnVuZGVybGluZV90aGlja25lc3M7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAg ICAgICAgICAgICAgIHRoaWNrbmVzcyA9IDE7CisgICAgICAgICAgICAgICAgICBpZiAoeF91bmRl cmxpbmVfYXRfZGVzY2VudF9saW5lKQorICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IChz LT5oZWlnaHQgLSB0aGlja25lc3MpIC0gKHMtPnliYXNlIC0gcy0+eSk7CisgICAgICAgICAgICAg ICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAv KiBHZXQgdGhlIHVuZGVybGluZSBwb3NpdGlvbi4gIFRoaXMgaXMgdGhlIHJlY29tbWVuZGVkCisg ICAgICAgICAgICAgICAgICAgICAgICAgdmVydGljYWwgb2Zmc2V0IGluIHBpeGVscyBmcm9tIHRo ZSBiYXNlbGluZSB0byB0aGUgdG9wIG9mCisgICAgICAgICAgICAgICAgICAgICAgICAgdGhlIHVu ZGVybGluZS4gIFRoaXMgaXMgYSBzaWduZWQgdmFsdWUgYWNjb3JkaW5nIHRvIHRoZQorICAgICAg ICAgICAgICAgICAgICAgICAgIHNwZWNzLCBhbmQgaXRzIGRlZmF1bHQgaXMKKyAgICAgICAgICAg ICAgICAgICAgICAgICBST1VORCAoKG1heGltdW0gZGVzY2VudCkgLyAyKSwgd2l0aAorICAgICAg ICAgICAgICAgICAgICAgICAgIFJPVU5EKHgpID0gZmxvb3IgKHggKyAwLjUpICAqLworICAgICAg ICAgICAgICAgICAgICAgIGlmICh4X3VzZV91bmRlcmxpbmVfcG9zaXRpb25fcHJvcGVydGllcwor ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBzLT5mb250ICYmIHMtPmZvbnQtPnVuZGVybGlu ZV9wb3NpdGlvbiA+PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBzLT5m b250LT51bmRlcmxpbmVfcG9zaXRpb247CisgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAo cy0+Zm9udCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmZvbnQtPmRl c2NlbnQgKyAxKSAvIDI7CisgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICAgICAgICAgICAgcG9zaXRpb24gPSB1bmRlcmxpbmVfbWluaW11bV9vZmZzZXQ7CisgICAgICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gbWF4IChwb3NpdGlv biwgdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgIC8qIENoZWNrIHRoZSBzYW5pdHkgb2YgdGhpY2tuZXNzIGFuZCBwb3NpdGlvbi4gIFdl IHNob3VsZAorICAgICAgICAgICAgICAgICBhdm9pZCBkcmF3aW5nIHVuZGVybGluZSBvdXQgb2Yg dGhlIGN1cnJlbnQgbGluZSBhcmVhLiAgKi8KKyAgICAgICAgICAgICAgaWYgKHMtPnkgKyBzLT5o ZWlnaHQgPD0gcy0+eWJhc2UgKyBwb3NpdGlvbikKKyAgICAgICAgICAgICAgICBwb3NpdGlvbiA9 IChzLT5oZWlnaHQgLSAxKSAtIChzLT55YmFzZSAtIHMtPnkpOworICAgICAgICAgICAgICBpZiAo cy0+eSArIHMtPmhlaWdodCA8IHMtPnliYXNlICsgcG9zaXRpb24gKyB0aGlja25lc3MpCisgICAg ICAgICAgICAgICAgdGhpY2tuZXNzID0gKHMtPnkgKyBzLT5oZWlnaHQpIC0gKHMtPnliYXNlICsg cG9zaXRpb24pOworICAgICAgICAgICAgICBzLT51bmRlcmxpbmVfdGhpY2tuZXNzID0gdGhpY2tu ZXNzOworICAgICAgICAgICAgICBzLT51bmRlcmxpbmVfcG9zaXRpb24gPSBwb3NpdGlvbjsKKyAg ICAgICAgICAgICAgeSA9IHMtPnliYXNlICsgcG9zaXRpb247CisgICAgICAgICAgICAgIGlmIChz LT5mYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICAgICAgeF9maWxsX3Jl Y3RhbmdsZSAocy0+Ziwgcy0+Z2MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMt PngsIHksIHMtPndpZHRoLCB0aGlja25lc3MpOworICAgICAgICAgICAgICBlbHNlCisgICAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgICAgWEdDVmFsdWVzIHhnY3Y7CisgICAgICAgICAg ICAgICAgICBYR2V0R0NWYWx1ZXMgKHMtPmRpc3BsYXksIHMtPmdjLCBHQ0ZvcmVncm91bmQsICZ4 Z2N2KTsKKyAgICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChzLT5kaXNwbGF5LCBzLT5n Yywgcy0+ZmFjZS0+dW5kZXJsaW5lX2NvbG9yKTsKKyAgICAgICAgICAgICAgICAgIHhfZmlsbF9y ZWN0YW5nbGUgKHMtPmYsIHMtPmdjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHMtPngsIHksIHMtPndpZHRoLCB0aGlja25lc3MpOworICAgICAgICAgICAgICAgICAgWFNldEZv cmVncm91bmQgKHMtPmRpc3BsYXksIHMtPmdjLCB4Z2N2LmZvcmVncm91bmQpOworICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgLyogRHJhdyBvdmVybGlu ZS4gICovCisgICAgICBpZiAocy0+ZmFjZS0+b3ZlcmxpbmVfcCkKKyAgeworICAgIHVuc2lnbmVk IGxvbmcgZHkgPSAwLCBoID0gMTsKKyAgICBpZiAocy0+ZmFjZS0+b3ZlcmxpbmVfY29sb3JfZGVm YXVsdGVkX3ApCisgICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChzLT5mLCBzLT5nYywgcy0+eCwgcy0+ eSArIGR5LAorICAgICAgICAgIHMtPndpZHRoLCBoKTsKKyAgICBlbHNlCisgICAgICB7CisgICAg ICAgIFhHQ1ZhbHVlcyB4Z2N2OworICAgICAgICBYR2V0R0NWYWx1ZXMgKHMtPmRpc3BsYXksIHMt PmdjLCBHQ0ZvcmVncm91bmQsICZ4Z2N2KTsKKyAgICAgICAgWFNldEZvcmVncm91bmQgKHMtPmRp c3BsYXksIHMtPmdjLCBzLT5mYWNlLT5vdmVybGluZV9jb2xvcik7CisgICAgICAgIHhfZmlsbF9y ZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCBzLT55ICsgZHksCisgICAgICAgICAgICBzLT53 aWR0aCw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zdHJpbmdfYm94IChzKTsKKyAgICAgIGlm IChzLT5wcmV2KQorICB7CisgICAgc3RydWN0IGdseXBoX3N0cmluZyAqcHJldjsKKyAgICBmb3Ig KHByZXYgPSBzLT5wcmV2OyBwcmV2OyBwcmV2ID0gcHJldi0+cHJldikKKyAgICAgIGlmIChwcmV2 LT5obCAhPSBzLT5obAorICAgICYmIHByZXYtPnggKyBwcmV2LT53aWR0aCArIHByZXYtPnJpZ2h0 X292ZXJoYW5nID4gcy0+eCkKKyAgICAgICAgeworICAgIC8qIEFzIHByZXYgd2FzIGRyYXduIHdo aWxlIGNsaXBwZWQgdG8gaXRzIG93biBhcmVhLCB3ZQorICAgICAgIG11c3QgZHJhdyB0aGUgcmln aHRfb3ZlcmhhbmcgcGFydCB1c2luZyBzLT5obCBub3cuICAqLworICAgIGVudW0gZHJhd19nbHlw aHNfZmFjZSBzYXZlID0gcHJldi0+aGw7CisgICAgcHJldi0+aGwgPSBzLT5obDsKKyAgICBtY194 X3NldF9nbHlwaF9zdHJpbmdfZ2MgKHByZXYsIGN1cnNvcl9nY19wKTsKKyAgICB4X3NldF9nbHlw aF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywgcHJldik7CisgICAgaWYgKHByZXYtPmZpcnN0 X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgpCisgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2Zv cmVncm91bmQgKHByZXYpOworICAgIGVsc2UKKyAgICAgIHhfZHJhd19jb21wb3NpdGVfZ2x5cGhf c3RyaW5nX2ZvcmVncm91bmQgKHByZXYpOworICAgIHhfcmVzZXRfY2xpcF9yZWN0YW5nbGVzIChw cmV2LT5mLCBwcmV2LT5nYyk7CisgICAgcHJldi0+aGwgPSBzYXZlOworICAgIHByZXYtPm51bV9j bGlwcyA9IDA7CisgICAgICAgIH0KKyAgfQorICAgICAgaWYgKHMtPm5leHQpCisgIHsKKyAgICBz dHJ1Y3QgZ2x5cGhfc3RyaW5nICpuZX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ocy0+Ziwgcy0+Z2MpOworICBz LT5udW1fY2xpcHMgPSAwOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogLyogRGVmYXVsdCB0byB1c2luZyBYSU0gaWYgYXZhaWxh YmxlLiAgKi8KICNpZmRlZiBVU0VfWElNCiBib29sIHVzZV94aW0gPSB0cnVlOwpAQCAtMTMxMDAs NiArMTM5NzIsMjEgQEAgeF9hY3RpdmF0ZV90aW1lb3V0X2F0aW1lciAodm9pZCkKIAogc3RhdGlj IHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlIHhfcmVkaXNwbGF5X2ludGVyZmFjZSA9CiAgIHsK KworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwor LyogYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGB4dGVybS5jYCBtdXN0IGJlIGluIHRoZSBleGFj dCBzYW1lIG9yZGVyIGFzIHRoZQorYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGBkaXNwZXh0ZXJu LmhgISAqLworCisgIG1jX3hfd3JpdGVfZ2x5cGhzLAorICBtY194X2RyYXdfd2luZG93X2N1cnNv ciwKKyAgbWNfeF9kcmF3X2dseXBoX3N0cmluZywKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogICAgIHhfZnJhbWVfcGFybV9oYW5kbGVycywKICAgICB4X3Byb2R1Y2VfZ2x5cGhzLAog ICAgIHhfd3JpdGVfZ2x5cGhzLAo= --Multipart_Sat_Apr_20_22:15:46_2019-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs). References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Mon, 29 Apr 2019 01:22:02 +0000 Resent-Message-ID: <handler.22873.B22873.155650087430785 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22873 <at> debbugs.gnu.org,17684 <at> debbugs.gnu.org Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.155650087430785 (code B ref 22873); Mon, 29 Apr 2019 01:22:02 +0000 Received: (at 22873) by debbugs.gnu.org; 29 Apr 2019 01:21:14 +0000 Received: from localhost ([127.0.0.1]:38101 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1hKuyo-00080O-1o for submit <at> debbugs.gnu.org; Sun, 28 Apr 2019 21:21:14 -0400 Received: from gateway30.websitewelcome.com ([192.185.144.21]:39589) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1hKuyk-000808-Ua for 22873 <at> debbugs.gnu.org; Sun, 28 Apr 2019 21:21:11 -0400 Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway30.websitewelcome.com (Postfix) with ESMTP id 8176B5913 for <22873 <at> debbugs.gnu.org>; Sun, 28 Apr 2019 20:21:10 -0500 (CDT) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id KuyjhTD9q90onKuyjhc3bY; Sun, 28 Apr 2019 20:21:10 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:To:From:Message-ID:Date: Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Aq/DoOMYYkuq0pe3US8+Fcm4V7zAMiysN5qnRr8F0Zg=; b=TvpLG1YAu83tf/ghl2nnmoTBuj BW4pBd9+27i5rEboopb01XodTUGhif3Ou50z6kRFL4jazDyJFNb6zjlqGqsF+6bbF49VW0iEqVwLJ gibOZCU08e+lo1Kwvu2ew0oboeFAcQkQXx0Rlzg3EeeUbrB6B61KNo13pV13m5sgE04m/VobVETey 2PiKaGblww3Kx/xPRI2V3K/P/9FmLYQKqP64ZpRwnSW2mm81HWawjfhxKvM6WB5CBPJUkWIrygsNi PWkrkdpoewTxyj4JkJjLskm/QRT7lMPFrGVBXJEULvrifaUrpeSKJ9a0rb984hr1RryW9j4FzNmw2 wFnFLG6w==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:54786 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from <esq@HIDDEN>) id 1hKuyg-000vjN-7o; Sun, 28 Apr 2019 20:21:08 -0500 Date: Sun, 28 Apr 2019 18:21:05 -0700 Message-ID: <m2imuxip32.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Sun_Apr_28_18:21:05_2019-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1hKuyg-000vjN-7o X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:54786 X-Source-Auth: lawlist X-Email-Count: 9 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> --Multipart_Sun_Apr_28_18:21:05_2019-1 Content-Type: text/plain; charset=US-ASCII VERSION: 019.001 [04/28/2019] CHANGELOG: - With the gracious assistance of Paul Eggert on the Emacs Devel mailing list, the caches of fake cursors are now properly being reset. [The error was due to a failure to assign the returned value of xnrealloc back to the cache.] - Bug fix relating to floating fake cursors that were not being erased. [This was caused because the glyph_flavor had erroneously been set by `mc_engine' as MC_GLYPH instead of MC_GLYPHLESS, and `mc_erase_cursor' was called instead of `mc_draw_erase_hybrid' (which handles MC_GLYPHLESS, among other things). - Restored the triggering of update_begin/end when fake cursors are being erased. `mc_erase_pre_scroll_display' handles erasing and resetting of the caches. - Added a mechanism to track the matrix containing the row with the real cursor. update_window now updates that row before other rows within the desired_matrix so that data relating to that row is available when processing all other rows. This is useful when determining which right fringe bitmaps to use when the crosshairs feature is active; e.g., cursor is either at or beyond the fringe. - Added new fringe bitmaps and corresponding face that are used when cursor is beyond the fringe; e.g., when horizontal scrolling to the right. One set of bitmaps are used when cursor is exactly at the fringe (a rare, but reproducible occurrence); and, another set when cursor is beyond the fringe. Tests for each occurrence have been improved. The new tests permit Emacs to also handle a situation where the fake cursors are partially visible when not quite at the fringe, which is noticeable when the real fake cursor is greater than 1 pixel wide; e.g., a hollow box cursor. - Fixed a crash when debugging ns_judges_scroll_bars and wrapped the debugging code in a condition to limit its usage. - All remaining function parameters dealing with RGB have been consolidated into struct mc_RGB instead of individual parameters for each color. - Color determination for all three platforms is now streamlined a bit more with `mc_xw_color_values'. . NS platform needs no conversion after obtaining RGBA values from colorUsingDefaultColorSpace, which are stored in a mc_RGB sttruct until needed. . W32 platform: RGB values are obtained from `w32_defined_color' and divided by 65535, which are then stored in a mc_RGB struct until needed. When needed, those values are multiplied by 255 (result not to exceed 255). . X11 platform: RGB values are obtained from `x_defined_color' and divided by 65535, which are then stored in a mc_RGB struct until needed. When needed, those values are multiplied by 65535 (result not to exceed 65535). - Verified that garbage collection is under control. - Fixed a bug that prevented the vertical ruler of crosshairs from drawing when the fill column was at the fringe (exactly). - Fixed a bug affecting the drawing of a hollow cursor around images, which was due to the wrong cursor type being set before calling `mc_get_cursor_geometry'. - Fixed a bug that prevented the real cursor from sometimes being erased. SETUP: Step 1: git clone -b master git://git.sv.gnu.org/emacs.git Step 2: In the new emacs folder, go back to an Emacs version from 04/08/2019: git reset --hard a038df77de7b1aa2d73a6478493b8838b59e4982 Step 3: From within the new emacs folder created in Step 1, apply the patch: git apply /path/to/the/patch.diff Step 4: ./autogen.sh Step 5: ./configure ... [your custom options] Step 6: make Step 7: make install USAGE: - For a minimal working example of built-in fake cursors, type: M-x mc-test ;;; TURN ON FAKE CURSORS (buffer position, cursor-type, cursor color): (setq mc-conf '((1 "hbar" "magenta") (2 "bar" "purple") (3 "box" "#00FF00") (4 "hollow" "#0000FF") (5 ("hbar" 3) [1.0 0.0 1.0]) (6 ("bar" 3) [0.0 1.0 1.0]) (7 "framed" "OrangeRed")))) ;;; TURN OFF FAKE CURSORS: (setq mc-conf nil) - To try out the crosshairs feature, type: M-x +-mode - To try out built-in fake cursors with Magnar Sveen's multiple-cursors package, install that package first. [If the multiple-cursors package is installed, an eval-after-load "multiple-cursors-core" statement within `crosshairs.el` will redefine a couple of functions and set up a few keyboard shortcuts.] If the multiple-cursors package by Magnar Sveen is not already installed, then here are two easy ways to install that package: Type: M-x mc-install OR, evaluate the following snippet: (progn (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) (package-refresh-contents) (package-install 'multiple-cursors)) TODO: - When using the multiple fake cursors feature, a fake cursor does not show up at zv_p. - Deal with left/right overwritten glyphs in the w32 and X ports of Emacs. - Reduce the removal of fake cursors to the bare minimum when scrolling the text on the glass directly, and whenever `update_window' is called. - When an idle-timer fires and point is at the end of a horizontally scrolled line in a narrow window, the temporary horizontal scroll is canceled. Create an minimal working example and file a bug report. - There is a bug affecting the recorded `w->mc.lnum_pixel_width` that is observable when not running under gdb, but disappears when running under gdb. While viewing a folded org-mode buffer, the non-gdb instance had a visible line number pixel-width of 44, but Emacs treated it as fluctuating between 44 and 55 as the cursor was moved to the end of line. In the gdb instance, the visible line number pixel width was 55 with no fluctuation under the same conditions as the non-gdb instance. This appears to be a different bug than bug#32177 (current line number shifts one column to the left) because the line number of the current line does not shift left, and changing the bidi settings did not correct the issue. - The current test for `auto_hscroll_mode_p' only looks for `current_line` and all five related tests are based upon that assumption, which may not be true. - Multiple Cursors: If point is in the middle of a composite character, then select a fully composed character so that the fake cursor is visible. - Implement functionality similar to the Lisp multiple-cursors by Magnar Sveen. - Follow up with the Emacs team re bug#32177; i.e., (Current line number shifts one column to the left.) - Follow up with the Emacs team re bug#32060; i.e., Horizontal Scrolling (Current Line): Wrong line gets h-scrolled. - Determine if bug #28936 needs to be fixed and help the Emacs team re same. --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MpCisgICAgICAgIChpZiAoeWVzLW9yLW5vLXAgKGZvcm1hdCAi JWQgYWN0aXZlIGN1cnNvcnMuIENvbnRpbnVlPyAiIChtYy9udW0tY3Vyc29ycykpKQorICAgICAg ICAgICAgKHNldHEgbWMvbWF4LWN1cnNvcnMgKHJlYWQtbnVtYmVyICJFbnRlciBhIG5ldywgdGVt cG9yYXJ5IG1heGltdW06ICIpKQorICAgICAgICAgIChtYy9yZW1vdmUtZmFrZS1jdXJzb3JzKQor ICAgICAgICAgIChlcnJvciAiQWJvcnRlZDogdG9vIG1hbnkgY3Vyc29ycyIpKSkpCisgICAgKGxl dCAoKG92ZXJsYXkKKyAgICAgICAgICAgIChpZiBtYy91c2UtYnVpbHQtaW4tY3Vyc29ycworICAg ICAgICAgICAgICAobWFrZS1vdmVybGF5IChwb2ludCkgKHBvaW50KSkKKyAgICAgICAgICAgICAg KG1jL21ha2UtY3Vyc29yLW92ZXJsYXktYXQtcG9pbnQpKSkpCisgICAgICAob3ZlcmxheS1wdXQg b3ZlcmxheSAnbWMtaWQgKG9yIGlkIChtYy9jcmVhdGUtY3Vyc29yLWlkKSkpCisgICAgICAob3Zl cmxheS1wdXQgb3ZlcmxheSAndHlwZSAnZmFrZS1jdXJzb3IpCisgICAgICAob3ZlcmxheS1wdXQg b3ZlcmxheSAncHJpb3JpdHkgMTAwKQorICAgICAgKG1jL3N0b3JlLWN1cnJlbnQtc3RhdGUtaW4t b3ZlcmxheSBvdmVybGF5KQorICAgICAgKHdoZW4gKHVzZS1yZWdpb24tcCkKKyAgICAgICAgKG92 ZXJsYXktcHV0IG92ZXJsYXkgJ3JlZ2lvbi1vdmVybGF5CisgICAgICAgICAgICAgICAgICAgICAo bWMvbWFrZS1yZWdpb24tb3ZlcmxheS1iZXR3ZWVuLXBvaW50LWFuZC1tYXJrKSkpCisgICAgICBv dmVybGF5KSkKKworICAoZGVmdW4gbWMvZXhlY3V0ZS10aGlzLWNvbW1hbmQtZm9yLWFsbC1jdXJz b3J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cmlnaW5hbC1jb21tYW5kKSkpCisgICAgICAgICAgICA7OyBz a2lwIGtleWJvYXJkIG1hY3Jvcywgc2luY2UgdGhleSB3aWxsIGdlbmVyYXRlIGFjdHVhbCBjb21t YW5kcyB0aGF0IGFyZQorICAgICAgICAgICAgOzsgYWxzbyBydW4gaW4gdGhlIGNvbW1hbmQgbG9v cCAtIHdlJ2xsIGhhbmRsZSB0aG9zZSBsYXRlciBpbnN0ZWFkLgorICAgICAgICAgICAgKHdoZW4g KGZ1bmN0aW9ucCBvcmlnaW5hbC1jb21tYW5kKQorICAgICAgICAgICAgICA7OyBpZiBpdCdzIGEg bGFtYmRhLCB3ZSBjYW4ndCBrbm93IGlmIGl0J3Mgc3VwcG9ydGVkIG9yIG5vdAorICAgICAgICAg ICAgICA7OyAtIHNvIGdvIGFoZWFkIGFuZCBhc3N1bWUgaXQncyBvaywgYmVjYXVzZSB3ZSdyZSBq dXN0IG9wdGltaXN0aWMgbGlrZSB0aGF0CisgICAgICAgICAgICAgIChpZiAob3IgKG5vdCAoc3lt Ym9scCBvcmlnaW5hbC1jb21tYW5kKSkKKyAgICAgICAgICAgICAgICAgICAgICA7OyBsYW1iZGEg cmVnaXN0ZXJlZCBieSBzbWFydHJlcAorICAgICAgICAgICAgICAgICAgICAgIChzdHJpbmctcHJl Zml4LXAgIigiIChzeW1ib2wtbmFtZSBvcmlnaW5hbC1jb21tYW5kKSkpCisgICAgICAgICAgICAg ICAgICAobWMvZXhlY3V0ZS1jb21tYW5kLWZvci1hbGwtZmFrZS1jdXJzb3JzIG9yaWdpbmFsLWNv bW1hbmQpCisgICAgICAgICAgICAgICAgOzsgc21hcnRyZXAgYGludGVybidzIGNvbW1hbmRzIGlu dG8gb3duIG9iYXJyYXkgdG8gaGVscAorICAgICAgICAgICAgICAgIDs7IGBkZXNjcmliZS1iaW5k aW5ncycuICBTbywgbGV0J3MgcmUtYGludGVybicgaGVyZSB0bworICAgICAgICAgICAgICAgIDs7 IG1ha2UgdGhlIGNvbW1hbmQgY29tcGFyYWJsZSBieSBgZXEnLgorICAgICAgICAgICAgICAgIChz ZXRxIG9yaWdpbmFsLWNvbW1hbmQgKGludGVybiAoc3ltYm9sLW5hbWUgb3JpZ2luYWwtY29tbWFu ZCkpKQorICAgICAgICAgICAgICAgIDs7IG90aGVyd2lzZSBpdCdzIGEgc3ltYm9sLCBhbmQgd2Ug Y2FuIGJlIG1vcmUgdGhvcm91Z2gKKyAgICAgICAgICAgICAgICAoaWYgKGdldCBvcmlnaW5hbC1j b21tYW5kICdtYy0tdW5zdXBwb3J0ZWQpCisgICAgICAgICAgICAgICAgICAgIChtZXNzYWdlICIl UyBpcyBub3Qgc3VwcG9ydGVkIHdpdGggbXVsdGlwbGUgY3Vyc29ycyVzIgorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBvcmlnaW5hbC1jb21tYW5kCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIChnZXQgb3JpZ2luYWwtY29tbWFuZCAnbWMtLXVuc3VwcG9ydGVkKSkKKyAgICAgICAg ICAgICAgICAgICh3aGVuIChhbmQgb3JpZ2luYWwtY29tbWFuZAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAobm90IChtZW1xIG9yaWdpbmFsLWNvbW1hbmQgbWMtLWRlZmF1bHQtY21kcy10 by1ydW4tb25jZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChub3QgKG1lbXEgb3Jp Z2luYWwtY29tbWFuZCBtYy9jbWRzLXRvLXJ1bi1vbmNlKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKG9yIG1jL2Fsd2F5cy1ydW4tZm9yLWFsbAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgKG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy0tZGVmYXVsdC1jbWRzLXRvLXJ1 bi1mb3ItYWxsKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG1lbXEgb3JpZ2lu YWwtY29tbWFuZCBtYy9jbWRzLXRvLXJ1bi1mb3ItYWxsKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgKG1jL3Byb21wdC1mb3ItaW5jbHVzaW9uLWluLXdoaXRlbGlzdCBvcmlnaW5h bC1jb21tYW5kKSkpCisgICAgICAgICAgICAgICAgICAgIChtYy9leGVjdXRlLWNvbW1hbmQtZm9y LWFsbC1mYWtlLWN1cnNvcnMgb3JpZ2luYWwtY29tbWFuZCkpKSkKKyAgICAgICAgICAgICAgKHdo ZW4gbWMvdXNlLWJ1aWx0LWluLWN1cnNvcnMKKyAgICAgICAgICAgICAgICAoc2V0cSBtYy1jb25m CisgICAgICAgICAgICAgICAgICAgICAgICAobWFwY2FyCisgICAgICAgICAgICAgICAgICAgICAg ICAgIChsYW1iZGEgKHgpIChsaXN0IChvdmVybGF5LXN0YXJ0IHgpICJiYXIiIG5pbCkpCisgICAg ICAgICAgICAgICAgICAgICAgICAgIChtYy9hbGwtZmFrZS1jdXJzb3JzKSkpKSkpKSkpKQorCisg IChkZWZ1biBtYy9tYXJrLW5leHQtbGlrZS10aGlzLWN5Y2xlLWZvcndhcmQgKCkKKyAgIk1hcmtz IG5leHQgb2NjdXJlbmNlIG9mIHdvcmQgbGlrZSB0aGlzIGFuZCBhZHZhbmNlcyBjdXJzb3IgdG8g dGhpcyBvY2N1cnJlbmNlIgorICAoaW50ZXJhY3RpdmUpCisgICAgKG1jL21hcmstbmV4dC1saWtl LXRoaXMgMSkpCisKKyAgKGRlZnVuIG1jL21hcmstcHJldmlvdXMtbGlrZS10aGlzLWN5Y2xlLWZv cndhcmQgKCkKKyAgIk1hcmtzIG5leHQgb2NjdXJyZW5jZSBvZiB3b3JkIGxpa2UgdGhpcyBhbmQg YWR2YW5jZXMgY3Vyc29yIHRvIHRoaXMgb2NjdXJyZW5jZSIKKyAgKGludGVyYWN0aXZlKQorICAg IChtYy9tYXJrLXByZXZpb3VzLWxpa2UtdGhpcyAxKSkKKworICAoYWRkLXRvLWxpc3Q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AgICAgICAgICAg ICAgICAgICAgKDggImJveCIgImdyZXkyNSIpCisgICAgICAgICAgICAgICAgICAgICAgKDkgImJv eCIgImdyZXk3NSIpKSkpCisgICAgKHNlbGVjdC13aW5kb3cgKGRpc3BsYXktYnVmZmVyIGJ1ZmZl cikpKSkKKworKGRlZnVuICstdGltZXItZm4gKCkKKyJTaW5jZSB0aGlzIGZpcmVzIGdsb2JhbGx5 LCB3ZSBtdXN0IGNvbnRyb2wgd2hpY2ggYnVmZmVycyBjcm9zc2hhaXJzIGFwcGVhciBpbi4iCisg ICh3aGVuICstbW9kZQorICAgICh1bmxlc3MgKG9yIChtZW1xIGxhc3QtY29tbWFuZCArLXBhcmVu cy1leGNsdXNpb25zKQorICAgICAgICAgICAgICAgIChudWxsICstcGFyZW5zLXApKQorICAgICAg KCstcGFyZW5zLWZuKSkKKyAgICAod2hlbiArLXRpbWVyLXZhcgorICAgICAgKHNldHEgdGltZXIt aWRsZS1saXN0IChkZWxxICstdGltZXItdmFyIHRpbWVyLWlkbGUtbGlzdCkpCisgICAgICAoc2V0 cSArLXRpbWVyLXZhciBuaWwpKSkpCisKKyhkZWZ1biArLWRyYXctZm9ydGh3aXRoICgpCisiSW1t ZWRpYXRlbHkgZGVsZXRlL2RyYXcgbWF0Y2hpbmcgcGFyZW50aGVzZXMuIgorICAoKy1kcmF3LWNy b3NzaGFpcnMgJ2ZvcmNlKSkKKworKGRlZnVuICstZHJhdy1jcm9zc2hhaXJzICgmb3B0aW9uYWwg Zm9yY2UpCisiSW1tZWRpYXRlbHkgZGVsZXRlIG1hdGNoaW5nIHBhcmVudGhlc2VzLiAgSWYgRk9S Q0UgaXMgbm9uLW5pbCwgdGhlbiBpbW1lZGlhdGVseQorZHJhdyBtYXRjaGluZyBwYXJlbnRoZXNp czsgb3RoZXJ3aXNlLCBkcmF3IHRoZW0gb24gYW4gaWRsZS10aWVyLiIKKyAgKHdoZW4gKy1tb2Rl CisgICAgKHdoZW4gKy10aW1lci12YXIKKyAgICAgIChzZXRxIHRpbWVyLWlkbGUtbGlzdCAoZGVs cSArLXRpbWVyLXZhciB0aW1lci1pZGxlLWxpc3QpKQorICAgICAgKHNldHEgKy10aW1lci12YXIg bmlsKSkKKyAgICAodW5sZXNzIChvciAobWVtcSB0aGlzLWNvbW1hbmQgKy1wYXJlbnMtZXhjbHVz aW9ucykKKyAgICAgICAgICAgICAgICAoYW5kIChudWxsICstcGFyZW5zLXApCisgICAgICAgICAg ICAgICAgICAgICAobnVsbCArLXBhcmVucy1vdmVybGF5cy1leGlzdC1wKSkpCisgICAgICAoKy1k ZWxldGUtcGFyZW5zLW92ZXJsYXlzKSkKKyAgICAoaWYgZm9yY2UKKyAgICAgIChwcm9nbgorICAg ICAgICAod2hlbiArLXBhcmVucy1wCisgICAgICAgICAgKCstcGFyZW5zLWZuKSkpCisgICAgICAo c2V0cSArLXRpbWVyLXZhciAocnVuLXdpdGgtaWRsZS10aW1lciArLWlkbGUtdGltZXItc2Vjb25k cyBuaWwgIycrLXRpbWVyLWZuKSkpKSkKKworKGRlZnZhciBmYy1tb2RlKQorCis7OzsjIyNhdXRv bG9hZAorKGRlZmluZS1taW5vci1tb2RlICstbW9kZQorIk1pbm9yIG1vZGUgZm9yIGRpc3BsYXlp bmcgYSBob3Jpem9udGFsIHJ1bGVyLiIKKyAgOmluaXQtdmFsdWUgbmlsCisgIDpsaWdodGVyICIg KyIKKyAgOmtleW1hcCBuaWwKKyAgOmdsb2JhbCBuaWwKKyAgOmdyb3VwICcrLW1vZGUKKyAgKGNv bmQKKyAgICAoKy1tb2RlCisgICAgICA7OzsgYCstbW9kZScgaGFzIHRoZSBhYmlsaXR5IHRvIGFs c28gZGlzcGxheSBhIGZpbGwgY29sdW1uIGluZGljYXRvci4KKyAgICAgIDs7OyBTZWUgdGhlIHZh cmlhYmxlIGArLWZpbGwtY29sdW1uJy4KKyAgICAgICh3aGVuIGZjLW1vZGUKKyAgICAgICAgKGZj LW1vZGUgLTEpKQorICAgICAgKHdoZW4gKGFuZCBnbG9iYWwtZWxkb2MtbW9kZQorICAgICAgICAg ICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAgICAgICAgICAo ZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAoZ2xvYmFsLWVsZG9jLW1v ZGUgLTEpKQorICAgICAgKHdoZW4gKGFuZCBqaXQtbG9jay1jb250ZXh0LXRpbWVyCisgICAgICAg ICAgICAgICAgIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAg IChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVuICh0aW1lcnAg aml0LWxvY2stY29udGV4dC10aW1lcikKKyAgICAgICAgICAoY2FuY2VsLXRpbWVyIGppdC1sb2Nr LWNvbnRleHQtdGltZXIpKQorICAgICAgICA7OyAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVy IChydW4td2l0aC1pZGxlLXRpbWVyIDUuMCAncmVwZWF0ICdqaXQtbG9jay1jb250ZXh0LWZvbnRp ZnkpKQorICAgICAgICAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIG5pbCkpCisgICAgICAo d2hlbiAoYW5kIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAg IChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVuICh0aW1lcnAg dW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpCisgICAgICAgICAgKGNhbmNlbC10aW1l ciB1bmRvLWF1dG8tY3VycmVudC1ib3VuZGFyeS10aW1lcikpCisgICAgICAgIChmc2V0ICd1bmRv LWF1dG8tLXVuZG9hYmxlLWNoYW5nZQorICAgICAgICAgICAgICAobGFtYmRhICgpIChhZGQtdG8t bGlzdCAndW5kby1hdXRvLS11bmRvYWJseS1jaGFu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YGJpZGktZGlzcGxheS1yZW9yZGVyaW5nJyBpcyBzZXQgdG8gYSBuaWwgdmFsdWUuCisgICAg ICA7OzsgSG93ZXZlciwgbW9zdCB1c2VycyB3aWxsIHByb2JhYmx5IG5vdCB3YW50IHRoaXMgcGFy dGljdWxhciBzZXR0aW5nLgorICAgICAgKHVubGVzcyAobnVsbCBiaWRpLWRpc3BsYXktcmVvcmRl cmluZykKKyAgICAgICAgKHNldHEgYmlkaS1kaXNwbGF5LXJlb3JkZXJpbmcgbmlsKSkKKyAgICAg IChzZXQgKG1ha2UtbG9jYWwtdmFyaWFibGUgJystLXNhdmVkLXN0YXRlKSBuaWwpCisgICAgICAo ZG9saXN0ICh2YXIgJyhidWZmZXItZGlzcGxheS10YWJsZQorICAgICAgICAgICAgICAgICAgICAg ZnJpbmdlLWluZGljYXRvci1hbGlzdAorICAgICAgICAgICAgICAgICAgICAgdGFiLXdpZHRoCisg ICAgICAgICAgICAgICAgICAgICBsaW5lLW1vdmUtdmlzdWFsCisgICAgICAgICAgICAgICAgICAg ICB0cnVuY2F0ZS1saW5lcworICAgICAgICAgICAgICAgICAgICAgdHJ1bmNhdGUtcGFydGlhbC13 aWR0aC13aW5kb3dzCisgICAgICAgICAgICAgICAgICAgICB3b3JkLXdyYXApKQorICAgICAgICAo d2hlbiAobG9jYWwtdmFyaWFibGUtcCB2YXIpCisgICAgICAgICAgKHB1c2ggKGNvbnMgdmFyIChz eW1ib2wtdmFsdWUgdmFyKSkgKy0tc2F2ZWQtc3RhdGUpKSkKKyAgICAgIChzZXRxIGZpbGwtY29s dW1uIDgwKQorICAgICAgKHNldHEgZGlzcGxheS1saW5lLW51bWJlcnMgdCkKKyAgICAgIChzZXRx LWxvY2FsIGF1dG8taHNjcm9sbC1tb2RlICdjdXJyZW50LWxpbmUpCisgICAgICAoc2V0cS1sb2Nh bCBoc2Nyb2xsLXN0ZXAgNSkKKyAgICAgIChzZXRxIGJ1ZmZlci1kaXNwbGF5LXRhYmxlICstYnVm ZmVyLWRpc3BsYXktdGFibGUpCisgICAgICAoc2V0cSB0YWItd2lkdGggNCkKKyAgICAgIChzZXQg KG1ha2UtbG9jYWwtdmFyaWFibGUgJ2xpbmUtbW92ZS12aXN1YWwpIHQpCisgICAgICAoc2V0cSB0 cnVuY2F0ZS1saW5lcworICAgICAgICAoY29uZAorICAgICAgICAgICgobGV0ICgobHN0ICstdHJ1 bmNhdGUtbGluZXMtZGVyaXZlZC1tb2RlcykKKyAgICAgICAgICAgICAgICAgIG1vZGUpCisgICAg ICAgICAgICAoY2F0Y2ggJ2ZvdW5kCisgICAgICAgICAgICAgICh3aGlsZSAoc2V0cSBtb2RlIChw b3AgbHN0KSkKKyAgICAgICAgICAgICAgICAod2hlbiAoZGVyaXZlZC1tb2RlLXAgbW9kZSkKKyAg ICAgICAgICAgICAgICAgICh0aHJvdyAnZm91bmQgdCkpKSkpKQorICAgICAgICAgICAoKG1lbXEg bWFqb3ItbW9kZSArLXRydW5jYXRlLWxpbmVzLW1ham9yLW1vZGVzKSkKKyAgICAgICAgICAgKHQK KyAgICAgICAgICAgICBuaWwpKSkKKyAgICAgIChzZXQgKG1ha2UtbG9jYWwtdmFyaWFibGUgJ3Ry dW5jYXRlLXBhcnRpYWwtd2lkdGgtd2luZG93cykgbmlsKQorICAgICAgKHNldHEgd29yZC13cmFw IHQpCisgICAgICAoc2V0cSBpbmRpY2F0ZS1lbXB0eS1saW5lcyB0KQorICAgICAgKHNldHEgaW5k aWNhdGUtYnVmZmVyLWJvdW5kYXJpZXMgJ2xlZnQpCisgICAgICAoc2V0cSBmcmluZ2UtaW5kaWNh dG9yLWFsaXN0CisgICAgICAgICAgOzs7IGhzY2xfYWxsX3RlbXBfcCB8IGhzY2xfdGVtcF9wCisg ICAgICAgICcoKCstaHNjbC10ZW1wIC4gKCstc2luZ2xlLWFuZ2xlLWxlZnQKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgKy1kb3VibGUtYW5nbGUtbGVmdCkpCisgICAgICAgICAgOzs7IGhzY2xf YWxsX3Blcm1fMF9wIHwgaHNjbF9hbGxfcGVybV8xX3AgfCBoc2NsX2FsbF9wZXJtXzJfcCB8IGhz Y2xfcGVybV9wCisgICAgICAgICAgKCstaHNjbC1wZXJtIC4gKCstc2luZ2xlLWFuZ2xlLXVwCisg ICAgICAgICAgICAgICAgICAgICAgICAgICstZG91YmxlLWFuZ2xlLXVwCisgICAgICAgICAgICAg ICAgICAgICAgICAgICstdHJpcGxlLWFuZ2xlLXVwCisgICAgICAgICAgICAgICAgICAgICAgICAg ICstcXVhZHJ1cGxlLWFuZ2xlLXVwKSkKKyAgICAgICAgICAoKy1vdmVybGF5LWFycm93IC4gKCst ZnJpbmdlLWxlZnQtYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICstZnJpbmdl LXJpZ2h0LWFycm93KSkKKyAgICAgICAgICAodHJ1bmNhdGlvbiAuICgrLWZyaW5nZS1sZWZ0LWFy cm93CisgICAgICAgICAgICAgICAgICAgICAgICAgKy1mcmluZ2UtcmlnaHQtYXJyb3cpKQorICAg ICAgICAgIChjb250aW51YXRpb24gLiAoKy1mcmluZ2UtbGVmdC1jdXJseS1hcnJvdworICAgICAg ICAgICAgICAgICAgICAgICAgICAgKy1iYWNrc2xhc2gpKQorICAgICAgICAgIChvdmVybGF5LWFy cm93IC4gKy1mcmluZ2UtcmlnaHQtdHJpYW5nbGUpCisgICAgICAgICAgKHVwIC4gKy1mcmluZ2Ut dXAtYXJyb3cpCisgICAgICAgICAgKGRvd24gLiArLWZyaW5nZS1kb3duLWFycm93KQorICAgICAg ICAgICh0b3AgLiArLWZyaW5nZS10b3AtbGVmdC1hbmdsZSkKKyAgICAgICAgICAoYm90dG9tIC4g Ky1mcmluZ2UtYm90dG9tLXJpZ2h0LWFuZ2xlKQorICAgICAgICAgICh0b3AtYm90dG9tIC4gKCst ZnJpbmdlLWxlZnQtYnJhY2tldAorICAgICAgICAgICAgICAgICAgICAgICAgICstZnJpbmdlLXJp Z2h0LWJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICArLWZyaW5nZS10b3AtcmlnaHQt YW5nbGUKKyAgICAgICAgICAgICAgICAgICAgICAgICArLWZyaW5nZS10b3AtbGVmdC1hbmdsZSkp CisgICAgICAgICAgKGVtcHR5LWxpbmUgLiArLWZyaW5nZS1lbXB0eS1saW5lKQorICAgICAgICAg ICh1bmtub3duIC4gKy1mcmluZ2UtcXVlc3Rpb24tbWFyaykpKQorICAgICAgKHNldHEgZnJpbmdl LWN1cnNvci1hbGlzdCAnKChib3ggLiArLWZyaW5nZS1sZWZ0LXRyaWFuZ2xlKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIChob2xsb3cgLiArLWhvbGxvdy1yZWN0YW5nbGUpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGJhciAuICstdmVydGljYWwtYmFyKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChoYmFyIC4gKy1mcmluZ2UtaG9yaXpv bnRhbC1iYXIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGhvbGxvdy1zbWFs bCAuICstZnJpbmdlLWhvbGxvdy1zcXVhcmUpKSkKKyAgICAgIChpZiAob3IgKy1mb3J0aHdpdGgK KyAgICAgICAgICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAgICAgICAg KGFkZC1ob29rICdwb3N0LWNvbW1hbmQtaG9vayAnKy1kcmF3LWZvcnRod2l0aCAnYXBwZW5kICds b2NhbCkKKyAgICAgICAgKGFkZC1ob29rICdwb3N0LWNvbW1hbmQtaG9vayAnKy1kcmF3LWNyb3Nz aGFpcnMgJ2FwcGVuZCAnbG9jYWwpKQorICAgICAgKHdoZW4gKy1mb3J0aHdpdGgKKyAgICAgICAg KGFkZC1ob29rICd3aW5kb3ctY29uZmlndXJhdGlvbi1jaGFuZ2UtaG9vayAnKy1kcmF3LWZvcnRo d2l0aCBuaWwgJ2xvY2FsKSkKKyAgICAgIChhZGQtaG9vayAnY2hhbmdlLW1ham9yLW1vZGUtaG9v ayAndHVybi1vZmYtKy1tb2RlIG5pbCAnbG9jYWwpCisgICAgICAod2hlbiAoY2FsbGVkLWludGVy YWN0aXZlbHktcCAnYW55KQorICAgICAgICAoY29uZAorICAgICAgICAgICgrLWZvcnRod2l0aAor ICAgICAgICAgICAgKG1lc3NhZ2UgIlR1cm5lZCBPTiBgKy1tb2RlJyAtLSBEcmF3IG1hdGNoaW5n IHBhcmVudGhlc2VzIGltbWVkaWF0ZWx5LiIpKQorICAgICAgICAgICgoZXF1YWwgY3VycmVudC1w cmVmaXgtYXJnICcoNCkpCisgICAgICAgICAgICA7OzsgTWF0Y2hpbmcgcGFyZW50aGVzZXMgd2ls bCBiZSBkcmF3biBpbW1lZGlhdGVseS4KKyAgICAgICAgICAgIChtZXNzYWdlICJUdXJuZWQgT04g YCstbW9kZScgLS0gT3B0aW1pemVkIGZvciBkZWJ1Z2dpbmcgcHVycG9zZXMuIikpCisgICAgICAg ICAgKHQKKyAgICAgICAgICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScuIikpKSkpCisg ICAgKHQKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdmaWxsLWNvbHVtbikKKyAgICAgIChr aWxsLWxvY2FsLXZhcmlhYmxlICdhdXRvLWhzY3JvbGwtbW9kZSkKKyAgICAgIChraWxsLWxvY2Fs LXZhcmlhYmxlICdoc2Nyb2xsLXN0ZXApCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnY3Jv c3NoYWlycykKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdmYy12aXNpYmxlKQorICAgICAg KGtpbGwtbG9jYWwtdmFyaWFibGUgJ2Rpc3BsYXktbGluZS1udW1iZXJzKQorICAgICAgKGtpbGwt bG9jYWwtdmFyaWFibGUgJ2Rpc3BsYXktbGluZS1udW1iZXJzLXdpZHRoKQorICAg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kKKyAgICAgICAgIChmcm9tIChpZiArLXBhcmVu cy1mcm9tLWZuCisgICAgICAgICAgICAgICAgIChmdW5jYWxsICstcGFyZW5zLWZyb20tZm4pCisg ICAgICAgICAgICAgICAgIChwb2ludC1taW4pKSkKKyAgICAgICAgICh3aW4gKHNlbGVjdGVkLXdp bmRvdykpCisgICAgICAgICAoaSAwKQorICAgICAgICAgKHByZWNlZGluZy1jaGFyIChwcmVjZWRp bmctY2hhcikpCisgICAgICAgICAob2NoYXIgKGNoYXItYWZ0ZXIgb3BvaW50KSkKKyAgICAgICAg IChwb3MxCisgICAgICAgICAgIChjb25kCisgICAgICAgICAgICAgKChhbmQgb2NoYXIKKyAgICAg ICAgICAgICAgICAgICAob3IgOzs7IChjaGFyLXRvLXN0cmluZyA0MCkgPT4gb3BlbmluZyBwYXJl bnRoZXNpcworICAgICAgICAgICAgICAgICAgICAgICAoPSBvY2hhciA0MCkKKyAgICAgICAgICAg ICAgICAgICAgICAgOzs7IChjaGFyLXRvLXN0cmluZyA5MSkgPT4gb3BlbmluZyBzcXVhcmUgYnJh Y2tldAorICAgICAgICAgICAgICAgICAgICAgICAoPSBvY2hhciA5MSkKKyAgICAgICAgICAgICAg ICAgICAgICAgOzs7IChjaGFyLXRvLXN0cmluZyAxMjMpID0+IG9wZW5pbmcgd2F2eSBicmFja2V0 CisgICAgICAgICAgICAgICAgICAgICAgICg9IG9jaGFyIDEyMykpKQorICAgICAgICAgICAgICAg IChtaW4gKDErIG9wb2ludCkgKHBvaW50LW1heCkpKQorICAgICAgICAgICAgICgob3IgOzs7IChj aGFyLXRvLXN0cmluZyA0MSkgPT4gY2xvc2luZyBwYXJlbnRoZXNpcworICAgICAgICAgICAgICAg ICAgKD0gcHJlY2VkaW5nLWNoYXIgNDEpCisgICAgICAgICAgICAgICAgICA7OzsgKGNoYXItdG8t c3RyaW5nIDkzKSA9PiBjbG9zaW5nIHNxdWFyZSBicmFja2V0CisgICAgICAgICAgICAgICAgICAo PSBwcmVjZWRpbmctY2hhciA5MykKKyAgICAgICAgICAgICAgICAgIDs7OyAoY2hhci10by1zdHJp bmcgMTI1KSA9PiBjbG9zaW5nIHdhdnkgYnJhY2tldAorICAgICAgICAgICAgICAgICAgKD0gcHJl Y2VkaW5nLWNoYXIgMTI1KSkKKyAgICAgICAgICAgICAgICAobWF4IChwb2ludC1taW4pICgxLSBv cG9pbnQpKSkKKyAgICAgICAgICAgICAodAorICAgICAgICAgICAgICAgIG9wb2ludCkpKQorICAg ICAgICAgcG9zMgorICAgICAgICAgc2VsZWN0ZWQtZmFjZSkKKyAgICAoc2F2ZS1leGN1cnNpb24K KyAgICAgIChjb25kaXRpb24tY2FzZSBuaWwKKyAgICAgICAgKHdoaWxlIChzZXRxIHBvczEgKG50 aCAxIChwYXJzZS1wYXJ0aWFsLXNleHAgZnJvbSBwb3MxKSkpCisgICAgICAgICAgKHNldHEgcG9z MiAoc2Nhbi1zZXhwcyBwb3MxIDEpKQorICAgICAgICAgIChpZiAoPSBpIDEwKQorICAgICAgICAg ICAgKHNldHEgaSAxKQorICAgICAgICAgICAgKHNldHEgaSAoMSsgaSkpKQorICAgICAgICAgIChz ZXRxIHNlbGVjdGVkLWZhY2UgKGNvbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg KCg9IGkgMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtb25l LWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDIpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLXR3by1mYWNlKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSAzKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICcrLXBhcmVucy10aHJlZS1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAoKD0gaSA0KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBh cmVucy1mb3VyLWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDUp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLWZpdmUtZmFjZSkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgNikKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtc2l4LWZhY2UpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICgoPSBpIDcpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJystcGFyZW5zLXNldmVuLWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICgoPSBpIDgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLWVp Z2h0LWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDkpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLW5pbmUtZmFjZSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgMTApCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJystcGFyZW5zLXRlbi1mYWNlKSkpCisgICAgICAgICAgKGxldCAoKG92 IChtYWtlLW92ZXJsYXkgcG9zMSAoMSsgcG9zMSkpKSkKKyAgICAgICAgICAgICh1bmxlc3MgKy1w YXJlbnMtaW5hY3RpdmUtd2luZG93cworICAgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ3dp bmRvdyB3aW4pKQorICAgICAgICAgICAgKG92ZXJsYXktcHV0IG92ICdmYWNlIHNlbGVjdGVkLWZh Y2UpKQorICAgICAgICAgICh3aGVuIHBvczIKKyAgICAgICAgICAgIChsZXQgKChvdiAobWFrZS1v dmVybGF5ICgxLSBwb3MyKSBwb3MyKSkpCisgICAgICAgICAgICAgICh1bmxlc3MgKy1wYXJlbnMt aW5hY3RpdmUtd2luZG93cworICAgICAgICAgICAgICAgIChvdmVybGF5LXB1dCBvdiAnd2luZG93 IHdpbikpCisgICAgICAgICAgICAgIChvdmVybGF5LXB1dCBvdiAnZmFjZSBzZWxlY3RlZC1mYWNl KSkpKQorICAgICAgICAoZXJyb3IgbmlsKSkpCisgICAgKHNldHEgKy1wYXJlbnMtb3ZlcmxheXMt ZXhpc3QtcCB0KSkpCisKKyhkZWZ1biArLXJlbW92ZS1vdmVybGF5cyAoYmVnIGVuZCBuYW1lIHZh bCkKKyJSZW1vdmUgdGhlIG92ZXJsYXlzIHRoYXQgYXJlIGBlcXVhbC1pbmNsdWRpbmctcHJvcGVy dGllc2AuCitJbmNsdWRlcyBhIHVuaXF1ZSBzaXR1YXRpb24gd2hlbiBhbiBvdmVybGF5IHdpdGgg YW4gYCdhZnRlci1zdHJpbmdgIHByb3BlcnR5CitpcyBhdCB0aGUgdmVyeSBlbmQgb2YgYSBuYXJy b3dlZC1idWZmZXIuIgorICAobGV0KiAoKHBvaW50LW1heCAocG9pbnQtbWF4KSkKKyAgICAgICAg IChwb2ludC1taW4gKHBvaW50LW1pbikpCisgICAgICAgICAobmFycm93ZWQtcCAoYnVmZmVyLW5h cnJvd2VkLXApKQorICAgICAgICAgKGJlZyAoaWYgYmVnIGJlZyBwb2ludC1taW4pKQorICAgICAg ICAgKGVuZAorICAgICAgICAgICAoY29uZAorICAgICAgICAgICAgICgoYW5kCisgICAgICAgICAg ICAgICAgIChub3QgbmFycm93ZWQtcCkKKyAgICAgICAgICAgICAgICAgZW5kKQorICAgICAgICAg ICAgICAgZW5kKQorICAgICAgICAgICAgICgoYW5kCisgICAgICAgICAgICAgICAgIChub3QgbmFy cm93ZWQtcCkKKyAgICAgICAgICAgICAgICAgKG51bGwgZW5kKSkKKyAgICAgICAgICAgICAgIHBv aW50LW1heCkKKyAgICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICBuYXJyb3dlZC1w CisgICAgICAgICAgICAgICAgIGVuZAorICAgICAgICAgICAgICAgICAoPCBlbmQgcG9pbnQtbWF4 KSkKKyAgICAgICAgICAgICAgIGVuZCkKKyAgICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAg ICAgICBuYXJyb3dlZC1wCisgICAgICAgICAgICAgICAgIGVuZAorICAgICAgICAgICAgICAgICAo PSBlbmQgcG9pbnQtbWF4KSkKKyAgICAgICAgICAgICAgICgxKyBlbmQpKQorICAgICAgICAgICAg ICgoYW5kCisgICAgICAgICAgICAgICAgIG5hcnJvd2VkLXAKKyAgICAgICAgICAgICAgICAgKG51 bGwgZW5kKSkKKyAgICAgICAgICAgICAgICgxKyBwb2ludC1tYXgpKSApKQorICAgICAgICAgKG92 ZXJsYXlzCisgICAgICAgICAgIChwcm9nbgorICAgICAgICAgICAgIChvdmVybGF5LXJlY2VudGVy IGVuZCkKKyAgICAgICAgICAgICAob3ZlcmxheXMtaW4gYmVnIGVuZCkpKSkKKyAgICAod2hlbiAo YW5kIGJlZyBlbmQgbmFtZSB2YWwpCisgICAgICAoZG9saXN0IChvIG92ZXJsYXlzKQorICAgICAg ICAoY29uZAorICAgICAgICAgICgoYW5kIChlcSBuYW1lICdmYWNlKQorICAgICAgICAgICAgICAg IChlcSAob3ZlcmxheS1nZXQgbyBuYW1lKSB2YWwpKQorICAgICAgICAgICAgOzsgRWl0aGVyIHB1 c2ggdGhpcyBvdmVybGF5IG91dHNpZGUgYmVnLi4uZW5kCisgICAgICAgICAgICA7OyBvciBzcGxp dCBpdCB0byBleGNsdWRlIGJlZy4uLmVuZAorICAgICAgICAgICAgOzsgb3IgZGVsZXRlIGl0IGVu dGlyZWx5IChpZiBpdCBpcyBjb250YWluZWQgaW4gYmVnLi4uZW5kKS4KKyAgICAgICAgICAgIChp ZiAoPCAob3ZlcmxheS1zdGFydCBvKSBiZWcpCisgICAgICAgICAgICAgICAgKGlmICg+IChvdmVy bGF5LWVuZCBvKSBlbmQpCisgICAgICAgICAgICAgIChwcm9nbgorICAgICAgICAgICAgICAgICht b3ZlLW92ZXJsYXkgKGNvcHktb3ZlcmxheSBvKQorICAgICAgICAgICAgICAgICAgKG92ZXJsYXkt c3RhcnQgbykgYmVnKQorICAgICAgICAgICAgICAgIChtb3ZlLW92ZXJsYXkgbyBlbmQgKG92ZXJs YXktZW5kIG8pKSkKKyAgICAgICAgICAgICAgICAgIChtb3ZlLW92ZXJsYXkgbyAob3ZlcmxheS1z dGFydCBvKSBiZWcpKQorICAgICAgICAgICAgICAoaWYgKD4gKG92ZXJsYXktZW5kIG8pIGVuZCkK KyAgICAgICAgICAgICAgICAgIChtb3ZlLW92ZXJsYXkgbyBlbmQgKG92ZXJsYXktZW5kIG8pKQor ICAgICAgICAgICAgICAgIChkZWxldGUtb3ZlcmxheSBvKSkpKQorICAgICAgICAgICgoYW5kIChu b3QgKGVxIG5hbWUgJ2ZhY2UpKQorICAgICAgICAgICAgICAgIChlcXVhbC1pbmNsdWRpbmctcHJv cGVydGllcyAob3ZlcmxheS1nZXQgbyBuYW1lKSB2YWwpKQorICAgICAgICAgICAgKGRlbGV0ZS1v dmVybGF5IG8pKSkpKSkpCisKKyhkZWZ1biArLWRlbGV0ZS1wYXJlbnMtb3ZlcmxheXMgKCkKKyAg KHdoZW4gKy1wYXJlbnMtb3ZlcmxheXMtZXhpc3QtcAorICAgIChkb2xpc3QgKGZhY2UgJygrLXBh cmVucy1vbmUtZmFjZQorICAgICAgICAgICAgICAgICAgICArLXBhcmVucy10d28tZmFjZQorICAg ICAgICAgICAgICAgICAgICArLXBhcmVucy10aHJlZS1mYWNlCisgICAgICAgICAgICAgICAgICAg ICstcGFyZW5zLWZvdXItZmFjZQorICAgICAgICAgICAgICAgICAgICArLXBhcmVucy1maXZlLWZh Y2UKKyAgICAgICAgICAgICAgICAgICAgKy1wYXJlbnMtc2l4LWZhY2UKKyAgICAgICAgICAgICAg ICAgICAgKy1wYXJlbnMtc2V2ZW4tZmFjZQorICAgICAgICAgICAgICAgICAgICArLXBhcm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aWdodC1hbmdsZSAoKy1mcmluZ2UtaGVs cGVyLWRlY2ltYWwKKyIuLi4uLi54eCIKKyIuLi4uLi54eCIKKyIuLi4uLi54eCIKKyIuLi4uLi54 eCIKKyIuLi4uLi54eCIKKyIuLnh4eHh4eCIKKyIuLnh4eHh4eCIpIG5pbCBuaWwgJ2JvdHRvbSkK KworKGRlZmluZS1mcmluZ2UtYml0bWFwICcrLWZyaW5nZS1sZWZ0LWJyYWNrZXQgKCstZnJpbmdl LWhlbHBlci1kZWNpbWFsCisieHh4eHh4Li4iCisieHh4eHh4Li4iCisieHguLi4uLi4iCisieHgu Li4uLi4iCisieHguLi4uLi4iCisieHguLi4uLi4iCisieHguLi4uLi4iCisieHguLi4uLi4iCisi eHh4eHh4Li4iCisieHh4eHh4Li4iKSBuaWwgbmlsICdjZW50ZXIpCisKKyhkZWZpbmUtZnJpbmdl LWJpdG1hcCAnKy1mcmluZ2UtcmlnaHQtYnJhY2tldCAoKy1mcmluZ2UtaGVscGVyLWRlY2ltYWwK KyIuLnh4eHh4eCIKKyIuLnh4eHh4eCIKKyIuLi4uLi54eCIKKyIuLi4uLi54eCIKKyIuLi4uLi54 eCIKKyIuLi4uLi54eCIKKyIuLi4uLi54eCIKKyIuLi4uLi54eCIKKyIuLnh4eHh4eCIKKyIuLnh4 eHh4eCIpIG5pbCBuaWwgJ2NlbnRlcikKKworKGRlZmluZS1mcmluZ2UtYml0bWFwICcrLWZyaW5n ZS1maWxsZWQtcmVjdGFuZ2xlICgrLWZyaW5nZS1oZWxwZXItZGVjaW1hbAorInh4eHh4eHguIgor Inh4eHh4eHguIgorInh4eHh4eHguIgorInh4eHh4eHguIgorInh4eHh4eHguIgorInh4eHh4eHgu IgorInh4eHh4eHguIgorInh4eHh4eHguIgorInh4eHh4eHguIgorInh4eHh4eHguIgorInh4eHh4 eHguIgorInh4eHh4eHguIgorInh4eHh4eHguIikgbmlsIG5pbCAnY2VudGVyKQorCisoZGVmaW5l LWZyaW5nZS1iaXRt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x1bW4nLgorICAgICgoYW5kIGZjLW1vZGUg Ky1tb2RlKQorICAgICAgKHNldHEgZmMtbW9kZSBuaWwpCisgICAgICAobWVzc2FnZSAiVHVybmVk IE9GRiBgZmMtbW9kZScgKCVzKSAtLSBzZWUgdGhlIHZhcmlhYmxlIGArLWZpbGwtY29sdW1uJy4i IChjdXJyZW50LWJ1ZmZlcikpKQorICAgIChmYy1tb2RlCisgICAgICAod2hlbiAoYW5kIGdsb2Jh bC1lbGRvYy1tb2RlCisgICAgICAgICAgICAgICAgIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdh bnkpCisgICAgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisg ICAgICAgIChnbG9iYWwtZWxkb2MtbW9kZSAtMSkpCisgICAgICAod2hlbiAoYW5kIGppdC1sb2Nr LWNvbnRleHQtdGltZXIKKyAgICAgICAgICAgICAgICAgKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAg J2FueSkKKyAgICAgICAgICAgICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkK KyAgICAgICAgKHdoZW4gKHRpbWVycCBqaXQtbG9jay1jb250ZXh0LXRpbWVyKQorICAgICAgICAg IChjYW5jZWwtdGltZXIgaml0LWxvY2stY29udGV4dC10aW1lcikpCisgICAgICAgIDs7IChzZXRx IGppdC1sb2NrLWNvbnRleHQtdGltZXIgKHJ1bi13aXRoLWlkbGUtdGltZXIgNS4wICdyZXBlYXQg J2ppdC1sb2NrLWNvbnRleHQtZm9udGlmeSkpCisgICAgICAgIChzZXRxIGppdC1sb2NrLWNvbnRl eHQtdGltZXIgbmlsKSkKKyAgICAgICh3aGVuIChhbmQgKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAg J2FueSkKKyAgICAgICAgICAgICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkK KyAgICAgICAgKHdoZW4gKHRpbWVycCB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RfY2hfaW5hY3RpdmVfd2luZG93cyAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9P YmplY3QgdmFsKQoreworICBiLT5jaF9pbmFjdGl2ZV93aW5kb3dzXyA9IHZhbDsKK30KKworc3Rh dGljIHZvaWQKK2JzZXRfZmNfdmlzaWJsZSAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3Qg dmFsKQoreworICBiLT5mY192aXNpYmxlXyA9IHZhbDsKK30KKworc3RhdGljIHZvaWQKK2JzZXRf ZmNfaW5hY3RpdmVfd2luZG93cyAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFsKQor eworICBiLT5mY19pbmFjdGl2ZV93aW5kb3dzXyA9IHZhbDsKK30KKworLyogZW5kIE1VTFRJUExF LUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIHN0YXRpYyB2b2lkCiBi c2V0X2FiYnJldl9tb2RlIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCiB7CkBA IC01MTQyLDYgKzUyMDUsMjQgQEAgaW5pdF9idWZmZXJfb25jZSAodm9pZCkKICAgYnNldF9sYXN0 X3NlbGVjdGVkX3dpbmRvdyAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgbWFrZV9maXhudW0gKDApKTsK IAogICBpZHggPSAxOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUt Q1VSU09SUyAqLworCisgIFhTRVRGQVNUSU5UIChCVkFSICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBt Y19yZWFsX2Zha2VfY3Vyc29yKSwgaWR4KTsgKytpZHg7CisgIFhTRVRGQVNUSU5UIChCVkFSICgm YnVmZmVyX2xv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9sb2NhbF9mbGFncywgb3ZlcndyaXRl X21vZGUpLCBpZHgpOyArK2lkeDsKQEAgLTUyMjgsNiArNTMwOSwyNCBAQCBpbml0X2J1ZmZlcl9v bmNlICh2b2lkKQogICAvKiBNdXN0IGRvIHRoZXNlIGJlZm9yZSBtYWtpbmcgdGhlIGZpcnN0IGJ1 ZmZlciEgKi8KIAogICAvKiByZWFsIHNldHVwIGlzIGRvbmUgaW4gYmluZGluZ3MuZWwgKi8KKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBi c2V0X21jX3JlYWxfZmFrZV9jdXJzb3IgKCZidWZmZXJfZGVmYXVsdHMsIFFob2xsb3cpOworICBi c2V0X21jX2NvbmYgKCZidWZmZXJfZGVmYXVsdHMsIFFuaWwpOworICBic2V0X21jX2luYWN0aXZl X3dpbmRvd3MgKCZidWZmZXJfZGVmYXVsdHMsIFF0KTsKKyAgYnNldF9jcm9zc2hhaXJzICgmYnVm ZmVyX2RlZmF1bHRzLCBRbmlsKTsKKyAgYnNldF9jaF9ob3Jpem9udGFsX3J1bGVyICgmYnVmZmVy X2RlZmF1bHRzLCBRdCk7CisgIGJzZXRfY2hfdmVydGljYWxfcnVsZXIgKCZidWZmZXJfZGVmYXVs dHMsIFF0KTsKKyAgYnNldF9jaF9pbmFjdGl2ZV93aW5kb3dzICgmYnVmZmVyX2RlZmF1bHRzLCBR dCk7CisgIGJzZXRfZmNfdmlzaWJsZSAoJmJ1ZmZlcl9kZWZhdWx0cywgUW5pbCk7CisgIGJzZXRf ZmNfaW5hY3RpdmVfd2luZG93cyAoJmJ1ZmZlcl9kZWZhdWx0cywgUXQpOworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAg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5p bCwgZHJhdyBtdWx0aXBsZSBjdXJzb3JzIGZpbGwgY29sdW1uIGluIGluYWN0aXZlIHdpbmRvd3Mu ICovKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBzdGF0aWNwcm8gKCZsYXN0 X292ZXJsYXlfbW9kaWZpY2F0aW9uX2hvb2tzKTsKICAgbGFzdF9vdmVybGF5X21vZGlmaWNhdGlv bl9ob29rcyA9IG1ha2VfbmlsX3ZlY3RvciAoMTApOwogCmRpZmYgLS1naXQgYS9zcmMvYnVmZmVy LmggYi9zcmMvYnVmZmVyLmgKaW5kZXggZjQyYzNlOS4uMTg5ZmFjNSAxMDA2NDQKLS0tIGEvc3Jj L2J1ZmZlci5oCisrKyBiL3NyYy9idWZmZXIuaApAQCAtNzM2LDYgKzczNiw0MCBAQCBzdHJ1Y3Qg YnVmZmVyCiAgICAgIGluIHRoZSBkaXNwbGF5IG9mIHRoaXMgYnVmZmVyLiAgKi8KICAgTGlzcF9P YmplY3QgZXh0cmFfbGluZV9zcGFjaW5nXzsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAvKiBUaGUgY3Vyc29yIHR5cGUgb2YgdGhlIHJl YWwgZmFrZSBjdXJzb3IuICovCisgIExpc3BfT2JqZWN0IG1jX3JlYWxfZmFrZV9jdXJzb3JfOwor CisgIC8qIFRoZSBuYW1lIG9mIGxpc3QgdXNlZCBieSBtdWx0aXBsZSBjdXJzb3JzIGZvciBuZXh0 IHJlZGlzcGxheS4gKi8KKyAgTGlzcF9PYmplY3QgbWNfY29uZl87CisKKyAgLyogV2hldGhlciB0 byBkcmF3IG11bHRpcGxlIGN1cnNvcnMgaW4gaW5hY3RpdmUgd2luZG93cy4gKi8KKyAgTGlzcF9P YmplY3QgbWNfaW5hY3RpdmVfd2luZG93c187CisKKyAgLyogVGhlIG5hbWUgb2YgdGhlIGJ1ZmZl ci1sb2NhbCB2YXJpYWJsZS4gKi8KKyAgTGlzcF9PYmplY3QgY3Jvc3NoYWlyc187CisKKyAgLyog VGhlIG5hbWUgb2YgdGhlIGNyb3NzaGFpcnMgaG9yaXpvbnRhbCBydWxlci4gKi8KKyAgTGlzcF9P YmplY3QgY2hfaG9yaXpvbnRhbF9ydWxlcl87CisKKyAgLyogVGhlIG5hbWUgb2YgdGhlIGNyb3Nz aGFpcnMgdmVydGljYWwgcnVsZXIuICovCisgIExpc3BfT2JqZWN0IGNoX3ZlcnRpY2FsX3J1bGVy XzsKKworICAvKiBXaGV0aGVyIHRvIGRyYXcgY3Jvc3NoYWlycyBpbiBpbmFjdGl2ZSB3aW5kb3dz LiAqLworICBMaXNwX09iamVjdCBjaF9pbmFjdGl2ZV93aW5kb3dzXzsKKworICAvKiBUaGUgbmFt ZSBvZiB0aGUgYnVmZmVyLWxvY2FsIHZhcmlhYmxlLiAqLworICBMaXNwX09iamVjdCBmY192aXNp YmxlXzsKKworICAvKiBXaGV0aGVyIHRvIGRyYXcgbXVsdGlwbGUgY3Vyc29ycyBmaWxsIGNvbHVt biBpbiBpbmFjdGl2ZSB3aW5kb3dzLiAqLworICBMaXNwX09iamVjdCBmY19pbmFjdGl2ZV93aW5k b3dzXzsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBDdXJzb3IgdHlwZSB0 byBkaXNwbGF5IGluIG5vbi1zZWxlY3RlZCB3aW5kb3dzLgogICAgICB0IG1lYW5zIHRvIHVzZSBo b2xsb3cgYm94IGN1cnNvci4KICAgICAgU2VlIGBjdXJzb3ItdHlwZScgZm9yIG90aGVyIHZhbHVl cy4gICovCkBAIC03ODcsMTQgKzgyM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qZWN0IHZhbCkKIHsKZGlmZiAtLWdpdCBhL3NyYy9kaXNwZXh0ZXJuLmggYi9zcmMvZGlzcGV4 dGVybi5oCmluZGV4IDFhNTM2NTYuLmRkZTMxMzggMTAwNjQ0Ci0tLSBhL3NyYy9kaXNwZXh0ZXJu LmgKKysrIGIvc3JjL2Rpc3BleHRlcm4uaApAQCAtMTAwLDYgKzEwMCwzNiBAQCB0eXBlZGVmIGlu dCBDdXJzb3I7CiAjZGVmaW5lIE5hdGl2ZVJlY3RhbmdsZSBpbnQKICNlbmRpZgogCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCisvKiBG b3J3YXJkIHByb3RvdHlwZSBkZWZpbml0aW9ucy4gKi8KK2VudW0gdHlwZV9vZl9jYWNoZTsKKwor ZW51bSB0eXBlX29mX2N1cnNvcjsKKworZW51bSBtY19mbGF2b3I7CisKK2VudW0gdHlwZV9vZl9h Y3Rpb24KK3sKKyAgTVVMVElQTEVfQ1VSU09SUywKKyAgSE9SSVpPTlRBTF9SVUxFUiwKKyAgVkVS VElDQUxfUlVMRVIsCisgIEZJTExfQ09MVU1OCit9OworCitzdHJ1Y3QgbWNfUkdCCit7CisgIGRv dWJsZSByZWQ7CisgIGRvdWJsZSBncmVlbjsKKyAgZG91YmxlIGJsdWU7Cit9OworCisvKiBlbmQg TVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogLyogVGV4 dCBjdXJzb3IgdHlwZXMuICAqLwogCiBlbnVtIHRleHRfY3Vyc29yX2tpbmRzCkBAIC0zODIsNiAr NDEyLDIwIEBAIHN0cnVjdCBnbHlwaF9zbGljZQogCiBzdHJ1Y3QgZ2x5cGgKIHsKKworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBpbnQgeCwg eSwgaHBvcywgdnBvczsKKworICBpbnQgcmVsYXRpdmVfeDsKKworICBib29sX2JmIHp2X3AgOiAx OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIFBvc2l0aW9uIGZyb20gd2hp Y2ggdGhpcyBnbHlwaCB3YXMgZHJhd24uICBJZiBgb2JqZWN0JyBiZWxvdyBpcyBhCiAgICAgIExp c3Agc3RyaW5nLCB0aGlzIGlzIGFuIGluZGV4IGludG8gdGhhdCBzdHJpbmcuICBJZiBpdCBpcyBh CiAgICAgIGJ1ZmZlciwgdGhpcyBpcyBhIHBvc2l0aW9uIGluIHRoYXQgYnVmZmVyLiAgSW4gYWRk aXRpb24sIHNvbWUKQEAgLTEyNDgsNiArMTI5MiwyOCBAQCBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UK IAogc3RydWN0IGdseXBoX3N0cmluZwogeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgYm9vbF9iZiBsZWZ0X292ZXJ3cml0dGVuX3Ag OiAxOworCisgICAgYm9vbF9iZiByaWdodF9vdmVyd3JpdHRlbl9wIDogMTsKKworICAgIGJvb2xf YmYgcmVjdGFuZ2xlX251a2VkX3AgOiAxOworCisgICAgYm9vbF9iZiBiYWNrZ3JvdW5kX251a2Vk X3AgOiAxOworCisgICAgZW51bSBkcmF3X2dseXBoX2FjdGlvbgorICAgIHsKKyAgICAgIE1DX0RS QVdfR0xZUEgsCisgICAgICBNQ19FUkFTRV9HTFlQSAorICAgIH0gYWN0aW9uX3R5cGU7CisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogWC1vcmlnaW4gb2YgdGhlIHN0cmluZy4g ICovCiAgIGludCB4OwogCkBAIC0yMjE2LDYgKzIyODIsMTYgQEAgc3RydWN0IGNvbXBvc2l0aW9u X2l0CiAKIHN0cnVjdCBpdAogeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCisgIGJvb2xfYmYgenZfcCA6IDE7CisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKICAgLyogVGhlIHdpbmRvdyBpbiB3aGljaCB3ZSBpdGVyYXRlIG92ZXIg Y3VycmVudF9idWZmZXIgKG9yIGEgc3RyaW5nKS4gICovCiAgIExpc3BfT2JqZWN0IHdpbmRvdzsK ICAgc3RydWN0IHdpbmRvdyAqdzsKQEAgLTI4MTIsNiArMjg4OCwzMSBAQCB0eXBlZGVmIHZvaWQg KCpmcmFtZV9wYXJtX2hhbmRsZXIpIChzdHJ1Y3QgZnJhbWUgKiwgTGlzcF9PYmplY3QsIExpc3Bf T2JqZWN0KTsKIAogc3RydWN0IHJlZGlzcGxheV9pbnRlcmZhY2UKIHsKKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyogYHJlZGlzcGxheV9p bnRlcmZhY2UnIGluIGBuc3Rlcm0ubWAgXCBgdzMydGVybS5jYC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WN0 IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgIHN0 cnVjdCBtY19SR0IgbHNsLCBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IsCisgICAgICAgIGVu dW0gdHlwZV9vZl9jdXJzb3IgY3Vyc29yX3R5cGUsIGludCB3ZCwgYm9vbCBhY3RpdmVfcCwgYm9v bCBjdXJzb3JfZ2NfcCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogSGFu ZGxlcnMgZm9yIHNldHRpbmcgZnJhbWUgcGFyYW1ldGVycy4gICovCiAgIGZyYW1lX3Bhcm1faGFu ZGxlciAqZnJhbWVfcGFybV9oYW5kbGVyczsKIApAQCAtMzI3MCw2ICszMzcxLDY3IEBAIGV4dGVy biB2b2lkIGdldF9mb250X2FzY2VudF9kZXNjZW50IChzdHJ1Y3QgZm9udCAqLCBpbnQgKiwgaW50 ICopOwogCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCiAKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKK2V4dGVybiBMaXNwX09iamVj dCBtY19saXN0biAocHRyZGlmZl90LCBMaXNwX09iamVjdCwgLi4uKTsKKworZXh0ZXJuIExpc3Bf T2JqZWN0IG1jX250aCAoaW50LCBMaXNwX09iamVjdCk7CisKK2V4dGVybiBMaXNwX09iamVjdCBt Y19hc3NxIChMaXNwX09iamVjdCwgTGlzcF9PYmplY3QpOworCitleHRlcm4gdm9pZCBtY194d19j b2xvcl92YWx1ZXMgKHN0cnVjdCB3aW5kb3cgKiwgTGlzcF9PYmplY3QsIHN0cnVjdCBtY19SR0Ig Kik7CisKK2V4dGVybiBib29sIG1jX3VwZGF0ZV93aW5kb3dfZnJpbmdlcyAoc3RydWN0IHdpbmRv dyAqLCBib29sKTsKKworZXh0ZXJuIGNoYXIgKiBtY193aW5kb3cgKHN0cnVjdCB3aW5kb3cgKik7 CisKK2V4dGVybiBjaGFyICogbWNfY2hhcl90b19zdHJpbmcgKGludCk7CisKK2V4dGVybiBjaGFy ICogbWNfY3Vyc29yX3R5cGVfdG9fc3RyaW5nIChlbnVtIHR5cGVfb2ZfY3Vyc29yKTsKKworZXh0 ZXJuIGNoYXIgKiBtY19mbGF2b3JfdG9fc3RyaW5nIChlbnVtIG1jX2ZsYXZvcik7CisKK2V4dGVy biB2b2lkIG1jX2RyYXdfZnJpbmdlX2JpdG1hcCAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5 cGhfcm93ICosIGludCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSB0 eXBlX29mX2N1cnNvcik7CisKK2V4dGVybiBpbnQgbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHN0cnVj dCB3aW5kb3cgKiwgTGlzcF9PYmplY3QsIGludCwgaW50KTsKKworZXh0ZXJuIHZvaWQgbWNfZW5n aW5lIChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwgc3RydWN0IGdseXBo X3JvdyAqLAorICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKiwgaW50LCBpbnQs IGludCwgaW50LCBpbnQsIGludCwKKyAgICAgICAgICAgICAgICAgICAgICAgZW51bSB0eXBlX29m X2N1cnNvciwgaW50LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIGludCwKKyAgICAgICAgICAgICAg ICAgICAgICAgc3RydWN0IG1jX1JHQiwgYm9vbCwgZW51bSB0eXBlX29mX2FjdGlvbiwgYm9vbCwK KyAgICAgICAgICAgICAgICAgICAgICAgZW51bSB0eXBlX29mX2N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X2dseXBoc19mYWNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCwg aW50LCBpbnQsIHN0cnVjdCBtY19SR0IsIGVudW0gbWNfZmxhdm9yLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGVudW0gdHlwZV9vZl9jdXJzb3IsIGludCwgYm9vbCwgYm9vbCk7 CisKK2V4dGVybiB2b2lkIG1jX3hfd3JpdGVfZ2x5cGhzIChzdHJ1Y3Qgd2luZG93ICosIHN0cnVj dCBnbHlwaF9tYXRyaXggKiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqLCBlbnVtIGdseXBoX3Jvd19hcmVhLCBpbnQsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBpbnQsIHN0cnVjdCBtY19SR0IsIGVu dW0gbWNfZmxhdm9yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gdHlwZV9v Zl9jdXJzb3IsIGludCwgYm9vbCwgYm9vbCk7CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICov CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAjaWZkZWYgR0xZUEhfREVCVUcKIGV4dGVy biB2b2lkIGR1bXBfZ2x5cGhfc3RyaW5nIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICopIEVYVEVSTkFM TFlfVklTSUJMRTsKICNlbmRpZgpkaWZmIC0tZ2l0IGEvc3JjL2Rpc3BuZXcuYyBiL3NyYy9kaXNw bmV3LmMKaW5kZXggY2NiMDhlYy4uMmJmMTZkNCAxMDA2NDQKLS0tIGEvc3JjL2Rpc3BuZXcuYwor KysgYi9zcmMvZGlzcG5ldy5jCkBAIC01Niw2ICs1Niw0NjYgQEAgYWxvbmcgd2l0aCBHTlUg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nBvcywKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBib3R0b21fdnBvcywgbHNsLCBnbHlwaF9mbGF2b3IsIGN1 cnNvcl90eXBlLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVfcCwg Y3Vyc29yX2djX3ApOworCisgICAgICAvKiBDbGVhciB0byBlbmQgb2Ygd2luZG93LiAgKi8KKyAg ICAgIHJpZi0+Y2xlYXJfZW5kX29mX2xpbmUgKHcsIHVwZGF0ZWRfcm93LCBURVhUX0FSRUEsIC0x KTsKKyAgICAgIGNoYW5nZWRfcCA9IDE7CisKKyAgICAgIC8qIFRoaXMgZXJhc2VzIHRoZSBjdXJz b3IuICBXZSBkbyB0aGlzIGhlcmUgYmVjYXVzZQorICAgICAgICAgbm90aWNlb3ZlcndyaXR0ZW5f dGV4dF9jdXJzb3IgY2Fubm90IGVhc2lseSBjaGVjayB0aGlzLCB3aGljaAorICAgICAgICAgbWln aHQgaW5kaWNhdGUgdGhhdCB0aGUgd2hvbGUgZnVuY3Rpb25hbGl0eSBvZgorICAgICAgICAgbm90 aWNlb3ZlcndyaXR0ZW5fdGV4dF9jdXJzb3Igd291bGQgYmV0dGVyIGJlIGltcGxlbWVudGVkIGhl cmUuCisgICAgICAgICBPbiB0aGUgb3RoZXIgaGFuZCwgd2UgbmVlZCBub3RpY2VvdmVyd3JpdHRl bl90ZXh0X2N1cnNvciBhcyBsb25nCisgICAgICAgICBhcyBtb3VzZSBoaWdobGlnaHRpbmcgaXMg ZG9uZSBhc3luY2hyb25vdXNseSBvdXRzaWRlIG9mCisgICAgICAgICByZWRpc3BsYXkuICAqLwor ICAgICAgaWYgKHZwb3MgPT0gdy0+cGh5c19jdXJzb3IudnBvcykKKyAgICAgICAgdy0+cGh5c19j dXJzb3Jfb25fcCA9IDA7CisKKyAgLyogVGhlIGVudGlyZSByb3cgd2FzIHJlZHJhd24gYWJvdmUs IHNvIGFsbCBmYWtlIGN1cnNvcnMgb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lciBhIGN1cnJlbnQgcm93IG9mIGBpZiAnIHdpdGggdGhlIGBmJyBpbgorICAgICAgIENv dXJpZXIgYm9sZCBzbyB0aGF0IGl0IG92ZXJsYXBzIHRoZSBgICcgdG8gaXRzIHJpZ2h0LgorICAg ICAgIElmIHRoZSBkZXNpcmVkIHJvdyBpcyBgICcsIHdlIHdvdWxkIHNraXAgb3ZlciB0aGUgc3Bh Y2UKKyAgICAgICBhZnRlciB0aGUgYGlmJyBhbmQgdGhlcmUgd291bGQgcmVtYWluIGEgcGl4ZWwg ZnJvbSB0aGUKKyAgICAgICBgZicgb24gdGhlIHNjcmVlbi4gICovCisgICAgaWYgKG92ZXJsYXBw aW5nX2dseXBoc19wICYmIGkgPiAwKQorICAgICAgeworICAgICAgICBzdHJ1Y3QgZ2x5cGggKmds eXBoID0gJmN1cnJlbnRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXVtpIC0gMV07CisgICAgICAgIGlu dCBsZWZ0LCByaWdodDsKKworICAgICAgICByaWYtPmdldF9nbHlwaF9vdmVyaGFuZ3MgKGdseXBo LCBYRlJBTUUgKHctPmZyYW1lKSwKKyAgICAgICAgICAmbGVmdCwgJnJpZ2h0KTsKKyAgICAgICAg Y2FuX3NraXBfcCA9IChyaWdodCA9PSAwICYmICFhYm9ydF9za2lwcGluZyk7CisgICAgICB9CisK KyAgICBpZiAoY2FuX3NraXBfcCkKKyAgICAgIHsKKyAgICAgICAgaW50IHN0YXJ0X2hwb3MgPSBp OworCisgICAgICAgIHdoaWxlIChpIDwgc3RvcAorICAgICAgICAgJiYgR0xZUEhfRVFVQUxfUCAo ZGVzaXJlZF9nbHlwaCwgY3VycmVudF9nbHlwaCkpCisgICAgeworICAgICAgaV9zdG9yZSA9IEZj b25zIChGY29ucyAobWFrZV9maXhudW0gKHgpLCBtYWtlX2ZpeG51bSAoaSkpLCBpX3N0b3JlKTsK KyAgICAgIHggKz0gZGVzaXJlZF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICA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lKSwKKyAgICAgICAgICAgICAgJmxlZnQsICZyaWdodCk7CisgICAg ICB3aGlsZSAobGVmdCA+IDAgJiYgaSA+IDApCisgICAgICAgIHsKKyAgICAgICAgICAtLWksIC0t ZGVzaXJlZF9nbHlwaCwgLS1jdXJyZW50X2dseXBoOworICAgICAgICAgIHggLT0gZGVzaXJlZF9n bHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgbGVmdCAtPSBkZXNpcmVkX2dseXBoLT5waXhl bF93aWR0aDsKKyAgICAgICAgfQorCisgICAgICAvKiBBYm9ydCB0aGUgc2tpcHBpbmcgYWxnb3Jp dGhtIGlmIHdlIGVuZCB1cCBiZWZvcmUKKyAgICAgICAgIG91ciBzdGFydGluZyBwb2ludCwgdG8g YXZvaWQgbG9vcGluZyAoYnVnIzEwNzApLgorICAgICAgICAgVGhpcyBjYW4gaGFwcGVuIHdoZW4g dGhlIGxiZWFyaW5nIGlzIGxhcmdlciB0aGFuCisgICAgICAgICB0aGUgcGl4ZWwgd2lkdGguICAq LworICAgICAgYWJvcnRfc2tpcHBpbmcgPSAoaSA8IHN0YXJ0X2hwb3MpOworICAgIH0KKyAgICAg IH0KKworICAgIC8qIFRyeSB0byBhdm9pZCB3cml0aW5nIHRoZSBlbnRpcmUgcmVzdCBvZiB0aGUg ZGVzaXJlZCByb3cKKyAgICAgICBieSBsb29raW5nIGZvciBhIHJlc3luYyBwb2ludC4gIFRoaXMg bWFpbmx5IHByZXZlbnRzCisgICAgICAgbW9kZSBsaW5lIGZsaWNrZXJpbmcgaW4gdGhlIGNhc2Ug dGhlIG1vZGUgbGluZSBpcyBpbgorICAgICAgIGZpeGVkLXBpdGNoIGZvbnQsIHdoaWNoIGl0IHVz dWFsbHkgd2lsbCBiZS4gICovCisgICAgaWYgKGkgPCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FS RUFdKQorICAgICAgeworICAgICAgICBpbnQgc3RhcnRfeCA9IHgsIHN0YXJ0X2hwb3MgPSBpOwor ICAgICAgICBzdHJ1Y3QgZ2x5cGggKnN0YXJ0ID0gZGVzaXJlZF9nbHlwaDsKKyAgICAgICAgaW50 IGN1cnJlbnRfeCA9IHg7CisgICAgICAgIGJvb2wgc2tpcF9maXJzdF9wID0gIWNhbl9za2lwX3A7 CisKKyAgICAgICAgLyogRmluZCB0aGUgbmV4dCBnbHlwaCB0aGF0J3MgZXF1YWwgYWdhaW4uICAq LworICAgICAgICB3aGlsZSAoaSA8IHN0b3AKKyAgICAgICAgICYmIChza2lwX2ZpcnN0X3AKKyAg ICAgICB8fCAhR0xZUEhfRVFVQUxfUCAoZGVzaXJlZF9nbHlwaCwgY3VycmVudF9nbHlwaCkpCisg ICAgICAgICAmJiB4ID09IGN1cnJlbnRfeCkKKyAgICB7CisgICAgICB4ICs9IGRlc2lyZWRfZ2x5 cGgtPnBpeGVsX3dpZHRoOworICAgICAgY3VycmVudF94ICs9IGN1cnJlbnRfZ2x5cGgtPnBpeGVs X3dpZHRoOworICAgICAgKytkZXNpcmVkX2dseXBoLCArK2N1cnJlbnRfZ2x5cGgsICsraTsKKyAg ICAgIHNraXBfZmlyc3RfcCA9IDA7CisgICAgfQorCisgIGlmIChkZWJ1Z19wCisgICAgICAmJiB2 cG9zICE9IGJvdHRvbV92cG9zCisgICAgICAmJiAhTklMUCAoaV9zdG9yZSkpCisgICAgeworICAg ICAgTGlzcF9PYmplY3Qgc3RyaW5nID0gRnByaW4xX3RvX3N0cmluZyAoaV9zdG9yZSwgUW5pbCk7 CisgICAgICBjaGFyICpjaGFyX3N0cmluZyA9IFNTREFUQSAoc3RyaW5nKTsKKyAgICAgIGZwcmlu dGYgKHN0ZGVyciwgImlfc3RvcmU6ICB2cG9zICglZCkgfCAlc1xuIiwgdnBvcywgY2hhcl9zdHJp bmcpOworICAgIH0KKworICBmb3IgKDsKKyAgICAgICBDT05TUCAoaV9zdG9yZSkKKyAgICAgICAm JiB2cG9zICE9IGJvdHRvbV92cG9zOworICAgICAgIGlfc3RvcmUgPSBYQ0RSIChpX3N0b3JlKSkK KyAgICB7CisgICAgICBpbnQgeCA9IFhGSVhOVU0gKFhDQVIgKFhDQVIgKGlfc3RvcmUpKSk7Cisg ICAgICBpbnQgaHBvcyA9IFhGSVhOVU0gKFhDRFIgKFhDQVIgKGlfc3RvcmUpKSk7CisgICAgICBz dHJ1Y3QgZ2x5cGggKnRhcmdldF9nbHlwaCA9IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIGRlc2ly ZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgaHBvcywgdnBvcyk7CisgICAgICBpZiAoZGVidWdfcCkK KyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiaV9zdG9yZTogIGNoYXIgKCVkLyVzKSB8IHg6ICgl ZCkgfCBocG9zICglZCkgfCB2cG9zICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAg dGFyZ2V0X2dseXBoLT51LmNoLCBtY19jaGFyX3RvX3N0cmluZyAodGFyZ2V0X2dseXBoLT51LmNo KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICB4LCBocG9zLCB2cG9zKTsKKyAgICAgIG1jX2Ry YXdfcm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHRhcmdldF9nbHlwaCwgeCwg MSwgdnBvcywKKyAgICAgICAgICAgICAgICAgICBib3R0b21fdnBvcywgYWN0aXZlX3AsIGN1cnNv cl9tYXRyaXgsIGZjX3gsIGNoX2ZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgICAgZmNfZm9y ZWdyb3VuZCwgdHJ1ZSk7CisgICAgfQorCisgICAgICAgIGlmIChpID09IHN0YXJ0X2hwb3MgfHwg eCAhPSBjdXJyZW50X3gpCisgICAgeworICAgICAgaSA9IHN0YXJ0X2hwb3M7CisgICAgICB4ID0g c3RhcnRfeDsKKyAgICAgIGRlc2lyZWRfZ2x5cGggPSBzdGFydDsKKyAgICAgIGJyZWFrOworICAg IH0KKworICAgICAgICBvdXRwdXRf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o YW5nZWRfcCA9IDE7CisgICAgICB9CisgIH0KKworICAgICAgLyogV3JpdGUgdGhlIHJlc3QuICAq LworICAgICAgaWYgKGkgPCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdKQorICB7CisgICAg b3V0cHV0X2N1cnNvcl90byAodywgdnBvcywgaSwgZGVzaXJlZF9yb3ctPnksIHgpOworCisgIGlm IChkZWJ1Z19wCisgICAgICAmJiB2cG9zICE9IGJvdHRvbV92cG9zKQorICAgIHsKKyAgICAgIGZw cmludGYgKHN0ZGVyciwgIkRSQVcgUkVNQUlOREVSIE9GIFRIRSBST1c6XG5cCisgICAgICBjaGFy ICglZC8lcykgfCB4OiAoJWQpIHwgaSAoJWQpIHwgbGVuZ3RoICglZCkgfCB2cG9zICglZClcbiIs CisgICAgICBkZXNpcmVkX2dseXBoLT51LmNoLCBtY19jaGFyX3RvX3N0cmluZyAoZGVzaXJlZF9n bHlwaC0+dS5jaCksCisgICAgICB4LCBpLCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0g aSwgdnBvcyk7CisgICAgfQorCisgIHJpZi0+bWNfc2NyaWJlX2dseXBocyAodywgZGVzaXJlZF9t YXRyaXgsIHVwZGF0ZWRfcm93LCBkZXNpcmVkX2dseXBoLCBURVhUX0FSRUEsIGRlc2lyZWRfcm93 LT51c2VkW1RFWFRfQVJFQV0gLSBpLAorICAgICAgICAgICAgICAgICAgICAgICAgIHZwb3MsIGJv dHRvbV92cG9zLCBsc2wsCisgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGhfZmxhdm9yLCBj dXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9wLCBjdXJzb3JfZ2NfcCk7CisKKyAgLyogRklYTUU6ICBB bHRob3VnaCB3ZSBuZWVkIHRvIHVwZGF0ZSB0aGUgY2FjaGUgYmV0d2VlbiB0aGUgZW5kIG9mIHVw ZGF0ZWRfcm93CisgIGFuZCB0aGUgcmlnaHQgd2luZG93IGVkZ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IGNoYXIgKCVkLyVzKSB8IHggKCVkKSB8IGhwb3MgKCVkKSAtLSBUTyBFTkQuXG4iLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQtPnUuY2gsIG1jX2NoYXJfdG9fc3RyaW5nIChz dGFydC0+dS5jaCksIHgsIGhwb3MpOworICAgICAgICBtY19kcmF3X3JvdyAodywgZGVzaXJlZF9t YXRyaXgsIHVwZGF0ZWRfcm93LCBzdGFydCwgeCwKKyAgICAgICAgICAgICAgICAgICAgIHVwZGF0 ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSBocG9zLCB2cG9zLCBib3R0b21fdnBvcywKKyAgICAg ICAgICAgICAgICAgICAgIGFjdGl2ZV9wLCBjdXJzb3JfbWF0cml4LCBmY194LCBjaF9mb3JlZ3Jv dW5kLCBmY19mb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgICAgdHJ1ZSk7CisgICAgICB9 CisgICAgICAvKiBUaGVyZSB3ZXJlIG5vIGNoYW5nZXMgYW5kIGkgPT0gZGVzaXJlZF9yb3ctPnVz ZWRbVEVYVF9BUkVBXSAqLworICAgICAgZWxzZSBpZiAoIWNoYW5nZWRfcCkKKyAgICAgICAgewor ICAgICAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiVU5D SEFOR0VEIC0tIFdSSVRFIEVOVElSRSBMSU5FLlxuIik7CisgICAgICAgICAgbWNfZHJhd19yb3cg KHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgZGVzaXJlZF9yb3ctPmdseXBoc1tURVhU X0FSRUFdLAorICAgICAgICAgICAgICAgICAgICAgICBkZXNpcmVkX3Jvdy0+eCwgZGVzaXJlZF9y b3ctPnVzZWRbVEVYVF9BUkVBXSwgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgYm90dG9t X3Zwb3MsIGFjdGl2ZV9wLCBjdXJzb3JfbWF0cml4LCBmY194LCBjaF9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ICAmJiB2cG9zID09IHctPmN1 cnNvci52cG9zCisgICAgICAgICAgJiYgdGFyZ2V0X2dseXBoICE9IE5VTEwpCisgICAgICAgIG1j X2VuZ2luZSAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRfZ2x5cGgsIFRF WFRfQVJFQSwgeCwgeF9saW1pdCwKKyAgICAgICAgICAgICAgICAgICB1cGRhdGVkX3Jvdy0+eSwg aHBvcywgdnBvcywgTUNfSEJBUiwgMSwgY3Vyc29yX21hdHJpeCwgZmNfeCwKKyAgICAgICAgICAg ICAgICAgICBkZWJ1Z19wID8gZGVidWdfZmcgOiBjaF9mb3JlZ3JvdW5kLCBhY3RpdmVfcCwgSE9S SVpPTlRBTF9SVUxFUiwKKyAgICAgICAgICAgICAgICAgICB0cnVlLCBOT19DQUNIRSk7CisKKyAg ICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAmJiAhTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAmJiAhTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAg ICAgJiYgeCA8IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICYmIHZwb3MgIT0gdy0+Y3Vyc29y LnZwb3MKKyAgICAgICAgICAmJiB3LT5jdXJzb3IueCA+PSB4CisgICAgICAgICAgJiYgdGFyZ2V0 X2dseXBoICE9IE5VTEwpCisgICAgICAgIG1jX2VuZ2luZSAodywgZGVzaXJlZF9tYXRyaXgsIHVw ZGF0ZWRfcm93LCB0YXJnZXRfZ2x5cGgsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwKKyAgICAgICAg ICAgICAgICAgICB1cGRhdGVkX3Jvdy0+eSwgaHBvcywgdnBvcywgTUNfQkFSLCAxLCBjdXJzb3Jf bWF0cml4LCBmY194LAorICAgICAgICAgICAgICAgICAgIGRlYnVnX3AgPyBkZWJ1Z19mZyA6IGNo X2ZvcmVncm91bmQsIGFjdGl2ZV9wLCBWRVJUSUNBTF9SVUxFUiwKKyAgICAgICAgICAgICAgICAg ICB0cnVlLCBOT19DQUNIRSk7CisKKyAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAg ICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxl KSkKKyAgICAgICAgICAmJiB4IDwgdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgJiYgZmNfeCA+ PSB4CisgICAgICAgICAgJiYgdGFyZ2V0X2dseXBoICE9IE5VTEwpCisgICAgICAgIG1jX2VuZ2lu ZSAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRfZ2x5cGgsIFRFWFRfQVJF QSwgeCwgeF9saW1pdCwKKyAgICAgICAgICAgICAgICAgICB1cGRhdGVkX3Jvdy0+eSwgaHBvcywg dnBvcywgTUNfQkFSLCAxLCBjdXJzb3JfbWF0cml4LCBmY194LAorICAgICAgICAgICAgICAgICAg IGRlYnVnX3AgPyBkZWJ1Z19mZyA6IGZjX2ZvcmVncm91bmQsIGFjdGl2ZV9wLCBGSUxMX0NPTFVN TiwKKyAgICAgICAgICAgICAgICAgICB0cnVlLCBOT19DQUNIRSk7CisKKyAgICB9CisgICAgfQor CisgIHJldHVybiBjaGFuZ2VkX3A7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBTdHJ1Y3R1cmUgdG8gcGFzcyBkaW1lbnNp b25zIGFyb3VuZC4gIFVzZWQgZm9yIGNoYXJhY3RlciBib3VuZGluZwogICAgYm94ZXMsIGdseXBo IG1hdHJpeCBkaW1lbnNpb25zIGFuZCBhbGlrZS4gICovCiAKQEAgLTMyODIsMTAgKzM3NDIsMzYg QEAgcmVkcmF3X292ZXJsYXBwZWRfcm93cyAoc3RydWN0IHdpbmRvdyAqdywgaW50IHliKQogCSAg ICB7CiAJICAgICAgb3V0cHV0X2N1cnNvcl90byAodywgaSwgMCwgcm93LT55LAogCQkJCWFyZWEg PT0gVEVYVF9BUkVBID8gcm93LT54IDogMCk7Ci0JICAgICAgaWYgKHJvdy0+dXNlZFthcmVhXSkK KworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLwor CisgIGlmICgody0+bWNfZWx0cy51c2VkID4gMCB8fCB3LT5jaF9lbHRzLnVzZWQgPiAwIHx8IHct PmZjX2VsdHMudXNlZCA+IDApCisgICAgICAmJiBhcmVhID09IFRFWFRfQVJFQQorICAgICAgJiYg cm93LT51c2VkW2FyZWFdKQorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJp eCA9IHctPmN1cnJlbnRfbWF0cml4OworICAgICAgaW50IHN0YXJ0X3ggPSByb3ctPng7CisgICAg ICBpbnQgc3RhcnRfaHBvcyA9IDA7CisgICAgICBpbnQgZW5kX2hwb3MgPSByb3ctPnVzZWRbYXJl YV07CisgICAgICBib29sIGNsZWFyX2VvbF9wID0gdHJ1ZTsKKyAgICAgIGVudW0gZHJhd19nbHlw aHNfZmFjZSBobCA9IERSQVdfTk9STUFMX1RFWFQ7CisgICAgICBUUkFDRSAoKHN0ZGVyciwgInJl ZHJhd19vdmVybGFwcGVkX3Jvd3MgKCVkKTogIHN0YXJ0X3ggKCVkKSB8IHN0YXJ0X2hwb3MgKCVk KSB8IGVuZF9ocG9zICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgaSwgc3RhcnRfeCwg c3RhcnRfaHBvcywgZW5kX2hwb3MpKTsKKyAgICAgIG1jX3JlZHJhd19yb3cgKHcsIG1hdHJpeCwg cm93LCBzdGFydF94LCBzdGFydF9ocG9zLCBlbmRfaHBvcywgY2xlYXJfZW9sX3AsIGhsKTsKKyAg ICB9CisgICAgZWxzZSBpZiAocm93LT51c2VkW2FyZWFdKQorICAgICAgewogCQlGUkFNRV9SSUYg KGYpLT53cml0ZV9nbHlwaHMgKHcsIHJvdywgcm93LT5nbHlwaHNbYXJlYV0sCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmVhLCByb3ctPnVzZWRbYXJlYV0p OwogCSAgICAgIEZSQU1FX1JJRiAoZiktPmNsZWFyX2VuZF9vZl9saW5lICh3LCByb3csIGFyZWEs IC0xKTsKKyAgICAgIH0KKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgICB9CiAK IAkgIHJvdy0+b3ZlcmxhcHBlZF9wID0gMDsKQEAgLTMzODgsNiArMzg3NCwyOCBAQCBzdGF0aWMg Ym9vbAogdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wKQogewog ICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICpkZXNpcmVkX21hdHJpeCA9IHctPmRlc2lyZWRfbWF0cml4 OworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09S UyAqLworCisgIGlmICh0cmFjZV9yZWRpc3BsYXlfcCkKKyAgICBmcHJpbnRmIChzdGRlcnIsICJ1 cGRhdGVfd2luZG93ICglcylcbiIsIG1jX3dpbmRvdyAodykpOworCisgIGN1cnNvcl9tYXRyaXgg PSBOVUxMOworCisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBib29s IGFjdGl2ZV9wID0gKHcgPT0gWFdJTkRPVyAoZi0+c2VsZWN0ZWRfd2luZG93KQorICAgICAgICAg ICAgICAgICAgICYmIGYgPT0gRlJBTUVfRElTUExBWV9JTkZPIChmKS0+eF9oaWdobGlnaHRfZnJh bWUpOworCisgIG1jX3NldF9lc3NlbnRpYWxzICh3LCBhY3RpdmVfcCwgJmNoX2ZvcmVncm91bmQs ICZmY19mb3JlZ3JvdW5kLCAmZmNfeCk7CisKKyAgbWNfZXJhc2VfcHJlX3Njcm9sbF9kaXNwbGF5 ICh3KTsKKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKICAgYm9vbCBwYXVzZWRfcDsKICAgaW50IHByZWVtcHRfY291bnQgPSBjbGlwX3Rv X2JvdW5kcyAoMSwgYmF1ZF9yYXRlIC8gMjQwMCArIDEsIElOVF9NQVgpOwogICBzdHJ1Y3QgcmVk aXNwbGF5X2ludGVyZmFjZSAqcmlmID0gRlJBTUVfUklGIChYRlJBTUUgKFdJTkRPV19GUkFNRSAo dykpKTsKQEAgLTM0NjAsNiArMzk2OCw0MSBAQCB1cGRhdGVfd2luZG93IChzdHJ1Y3Qgd2luZG93 ICp3LCBib29sIGZvcmNlX3ApCiAJICAgIH0KIAl9CiAKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogUHJvY2VzcyB0aGUgY3Vyc29yIHJv dyBhdCB0aGUgb3V0c2V0IGlmIGl0IGlzIHdpdGhpbiBgZGVzaXJlZF9tYXRyaXhgLgorICBXaGVu IHByb2Nlc3NpbmcgYWxsIG90aGVyI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0ZWN0X2lu cHV0X3BlbmRpbmdfaWdub3JlX3NxdWVlemFibGVzICgpOworICAgICAgICAgIGNoYW5nZWRfcCB8 PSB1cGRhdGVfd2luZG93X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3cml0dGVuX3Ap OworICAgICAgICAgIGlmIChNQVRSSVhfUk9XX0JPVFRPTV9ZIChyb3cpID49IHliKQorICAgICAg ICAgICAgZm9yIChpbnQgaSA9IHZwb3MgKyAxOyBpIDwgdy0+Y3VycmVudF9tYXRyaXgtPm5yb3dz IC0gMTsgKytpKQorICAgICAgICAgICAgICBTRVRfTUFUUklYX1JPV19FTkFCTEVEX1AgKHctPmN1 cnJlbnRfbWF0cml4LCBpLCBmYWxzZSk7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAg ICB9CisKKyAgY3Vyc29yX21hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAgICAgICAvKiBVcGRhdGUgdGhlIHJlc3Qgb2YgdGhlIGxpbmVz LiAgKi8KICAgICAgIGZvciAoOyByb3cgPCBlbmQgJiYgKGZvcmNlX3AgfHwgIWlucHV0X3BlbmRp bmcpOyArK3JvdykKIAkvKiBzY3JvbGxpbmdfd2luZG93IHJlc2V0cyB0aGUgZW5hYmxlZF9wIGZs YWcgb2YgdGhlIHJvd3MgaXQKQEAgLTM0NjcsNiArNDAxMCwxOSBAQCB1cGRhdGVfd2luZG93IChz dHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3ApCiAJaWYgKHJvdy0+ZW5hYmxlZF9wKQogCSAg ewogCSAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBkZXNpcmVkX21hdHJpeCk7 CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK KyAgLyogSWYgdGhlIGBjdXJzb3Jfcm93YCBpcyB3aXRoaW4gdGhlIGBkZXNpcmVkX21hdHJpeGAs IHRoZW4gaXQgd2FzIHByb2NlZWQKKyAgaGVyZWluYWJvdmUgYW5kIHNob3VsZCBiZSBza2lwcGVk IGF0IHRoaXMgdGltZS4gKi8KKyAgaWYgKHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgY29u dGludWU7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgICAgaW50IGk7CiAKIAkg ICAgLyogV2UnbGwgaGF2ZSB0byBwbGF5IGEgbGl0dGxlIGJpdCB3aXRoIHdoZW4gdG8KQEAgLTM0 OTcsNiArNDA1Myw0MyBAQCB1cGRhdGVfd2luZG93IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGZv cmNlX3ApCiAKICAgICBzZXRfY3Vyc29yOgogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8qIElmIHdlIGp1bXBlZCBoZXJlIGZyb20gYHNl dF9jdXJzb3JgLCB0aGVuIHNldCB0aGUgYGN1cnNvcl9tYXRyaXhgLiAqLworICBpZiAoY3Vyc29y X21hdHJpeCA9PSBOVUxMKQorICAgIGN1cnNvcl9tYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsK KworICAvKiBSZXNldCBgcm93YCB0byAwIHNvIHRoYXQgZmFrZSBjdXJzb3JzIGNhbiBiZSBkcmF3 biBvbiByb3dzIHByZWNlZGluZyB0aGUKKyAgZmlyc3QgYHJvdy0+ZW5hYmxlZF9wYC4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tYXRyaXgpOworICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpj dXJyZW50X3JvdyA9IE1BVFJJWF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB2cG9zKTsKKyAgICAg aWYgKGN1cnJlbnRfcm93LT5lbmFibGVkX3ApCisgICAgICAgbWNfZHJhd19yb3cgKHcsIHctPmN1 cnJlbnRfbWF0cml4LCBjdXJyZW50X3JvdywgY3VycmVudF9yb3ctPmdseXBoc1tURVhUX0FSRUFd LAorICAgICAgICAgICAgICAgICAgICBjdXJyZW50X3Jvdy0+eCwgY3VycmVudF9yb3ctPnVzZWRb VEVYVF9BUkVBXSwgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgYm90dG9tX3Zwb3MsIGFjdGl2 ZV9wLCBjdXJzb3JfbWF0cml4LCBmY194LCBjaF9mb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAg ICAgICBmY19mb3JlZ3JvdW5kLCB0cnVlKTsKKyAgIH0KKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogICAgICAgLyogVXBkYXRlIHRoZSBoZWFkZXIgbGluZSBhZnRlciBzY3JvbGxpbmcg YmVjYXVzZSBhIG5ldyBoZWFkZXIKIAkgbGluZSB3b3VsZCBvdGhlcndpc2Ugb3ZlcndyaXRlIGxp bmVzIGF0IHRoZSB0b3Agb2YgdGhlIHdpbmRvdwogCSB0aGF0IGNhbiBiZSBzY3JvbGxlZC4gICov CkBAIC0zNTMxLDEwICs0MTI0LDIxIEBAIHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5kb3cgKncs IGJvb2wgZm9yY2VfcCkKICAgICAgIHN0cmNweSAody0+Y3VycmVudF9tYXRyaXgtPm1ldGhvZCwg dy0+ZGVzaXJlZF9tYXRyaXgtPm1ldGhvZCk7CiAjZW5kaWYKIAorCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogI2lmZGVmIEhBVkVfV0lORE9XX1NZ U1RFTQorICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAmJiAhTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisgICAgbWNfdXBkYXRlX3dpbmRv d19mcmluZ2VzICh3LCAwKTsKKyAgICBlbHNlCiAgICAgICB1cGRhdGVfd2luZG93X2ZyaW5nZXMg KHcsIDApOwogI2VuZGlmCiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIC8q IEVuZCB0aGUgdXBkYXRlIG9mIHdpbmRvdyBXLiAgRG9uJ3Qgc2V0IHRoZSBjdXJzb3IgaWYgd2UK ICAgICAgICAgIHBhdXNlZCB1cGRhdGluZyB0aGUgZGlzcGxheSBiZWNhdXNlIGluIHRoaXMgY2Fz ZSwKICAgICAgICAgIHNldF93aW5kb3dfY3Vyc29yX2FmdGVyX3VwZGF0ZSBoYXNuJ3QgYmVlbiBj YWxsZWQsIGFuZApAQCAtMzg1MiwxNCArNDQ1NiwyOCBAQCB1cGRhdGVfd2luZG93X2xpbmUgKHN0 cnVjdCB3aW5kb3cgKncsIGludCB2cG9zLCBib29sICptb3VzZV9mYWNlX292ZXJ3cml0dGVuX3Ap CiAJICBjdXJyZW50X3Jvdy0+cmVkcmF3X2ZyaW5nZV9iaXRtYXBzX3AgPSAxOwogCX0KIAorCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBib29s IHVwZGF0ZWRfcCA9IChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICAg JiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAg ICAgICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg Y3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgICB8fCAhIE5JTFAgKEJWQVIgKFhC VUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpKSkKKyAgICAgICAgICAgICAgICAgICA/ IG1jX3VwZGF0ZV90ZXh0X2FyZWEgKHcsIGRlc2lyZWRfcm93LCB2cG9zKQorICAgICAgICAgICAg ICAgICAgIDogdXBkYXRlX3RleHRfYXJlYSAodywgZGVzaXJlZF9yb3csIHZwb3MpOworCiAgICAg ICAvKiBVcGRhdGUgdGhlIGRpc3BsYXkgb2YgdGhlIHRleHQgYXJlYS4gICovCi0gICAgICBpZiAo dXBkYXRlX3RleHRfYXJlYSAodywgZGVzaXJlZF9yb3csIHZwb3MpKQorICAgICAgaWYgKHVwZGF0 ZWRfcCkKIAl7CiAJICBjaGFuZ2VkX3AgPSAxOwogCSAgaWYgKGN1cnJlbnRfcm93LT5tb3VzZV9m YWNlX3ApCiAJICAgICptb3VzZV9mYWNlX292ZXJ3cml0dGVuX3AgPSAxOwogCX0KIAorLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogICAgICAgLyogVXBkYXRlIGRpc3BsYXkgb2YgdGhlIHJp Z2h0IG1hcmdpbiBhcmVhLCBpZiB0aGVyZSBpcyBvbmUuICAqLwogICAgICAgaWYgKCFkZXNpcmVk X3Jvdy0+ZnVsbF93aWR0aF9wICYmIHctPnJpZ2h0X21hcmdpbl9jb2xzID4gMCkKIAl7CmRpZmYg LS1naXQgYS9zcmMvZnJhbWUuaCBiL3NyYy9mcmFtZS5oCmluZGV4IGVjOGY2MTQuLmVlYWY3MWUg MTAwNjQ0Ci0tLSBhL3NyYy9mcmFtZS5oCisrKyBiL3NyYy9mcmFtZS5oCkBAIC0yMDUsNiArMjA1 LDE2IEBAIHN0cnVjdCBmcmFtZQogICBMaXNwX09iamVjdCB0b29sX2Jhcl9pdGVtczsKICAgLyog dG9vbF9iYXJfaXRlbXMgc2hvdWxkIGJlIHRoZSBsYXN0IExpc3BfT2JqZWN0IG1lbWJlci4gICov CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK KyAgLyogTm9uLW5pbCB3aGVuIHRoZSBmcmFtZSBpcyBpbiB0aGUgcHJvY2VzcyBvZiBiZWluZyB1 cGRhdGVkLiAqLworICBzdHJ1Y3QgZnJhbWUgKm1jX3VwZGF0aW5nX2ZyYW1lOworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKworCiAgIC8qIENhY2hlIG9mIHJlYWxpemVkIGZhY2VzLiAgKi8K ICAgc3RydWN0IGZhY2VfY2FjaGUgKmZhY2VfY2FjaGU7CiAKZGlmZiAtLWdpdCBhL3NyYy9mcmlu Z2UuYyBiL3NyYy9mcmluZ2UuYwppbmRleCAzMzVhNmViLi4wZGJlYTVmIDEwMDY0NAotLS0gYS9z cmMvZnJpbmdlLmMKKysrIGIvc3JjL2ZyaW5nZS5jCkBAIC00MzgsNiArNDM4LDQ2MCBAQCBzdGF0 aWMgdW5zaWduZWQgc2hvcnQgZW1wdHlfbGluZV9iaXRzW10gPSB7CiAjZGVmaW5lIFNUQU5EQVJE X0JJVE1BUF9IRUlHSFQoYml0cykgKHNpemVvZiAoYml0cykvQllURVNfUEVSX0JJVE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XsKKyAgMHg4MCwgMHg4MCwgMHg4MCwgMHg5OCwgMHg4YywgMHg4 NiwgMHhiZiwKKyAgMHhiZiwgMHg4NiwgMHg4YywgMHg5OCwgMHg4MCwgMHg4MCwgMHg4MH07CisK Ky8qIDI1CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4uLnh4 IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi54eC4uLnh4Igor ICAgICAgIi4ueHguLnh4IgorICAgICAgIi4uLnh4Lnh4IgorICAgICAgInh4eHh4eHh4IgorICAg ICAgInh4eHh4eHh4IgorICAgICAgIi4uLnh4Lnh4IgorICAgICAgIi4ueHguLnh4IgorICAgICAg Ii54eC4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4u Li4uLnh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcmV2ZXJzZWRfdmVydGljYWxf YmFyX3JpZ2h0X2Fycm93X2JpdHNbXSA9eworICAweDMsIDB4MywgMHgzLCAweDYzLCAweDMzLCAw eDFiLCAweGZmLCAweGZmLCAweDFiLCAweDMzLCAweDYzLCAweDMsIDB4MywgMHgzfTsKKworLyog MjYKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHh4eHh4eHgiCisg ICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4ueHguLngiCisgICAg ICAieC4uLnh4LngiCisgICAgICAieC4uLi54eHgiCisgICAgICAieC54eHh4eHgiCisgICAgICAi eC54eHh4eHgiCisgICAgICAieC4uLi54eHgiCisgICAgICAieC4uLnh4LngiCisgICAgICAieC4u eHguLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieHh4eHh4 eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0 X2Fycm93X2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweDk5LCAweDhkLCAweDg3LCAw eGJmLAorICAweGJmLCAweDg3LCAweDhkLCAweDk5LCAweDgxLCAweDgxLCAweGZmfTsKKworLyog MjcKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHh4eHh4eHgiCisg ICAgICAieC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieC54eC4ueHgiCisgICAg ICAieC4ueHgueHgiCisgICAgICAieC4uLnh4eHgiCisgICAgICAieHh4eHh4eHgiCisgICAgICAi eHh4eHh4eHgiCisgICAgICAieC4uLnh4eHgiCisgICAgICAieC4ueHgueHgiCisgICAgICAieC54 eC4ueHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieHh4eHh4 eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19yZXZlcnNlZF9ob2xsb3dfcmVjdGFu Z2xlX3JpZ2h0X2Fycm93X2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweGIxLCAweDk5 LCAweDhkLCAweGZmLAorICAweGZmLCAweDhkLCAweDk5LCAweGIxLCAweDgxLCAweDgxLCAweGZm fTsKKworLyogMjgKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHh4 eHh4eHgiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4u LngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngi CisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisg ICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAg ICAieHh4eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19ob2xsb3dfcmVjdGFu Z2xlX2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgx LAorICAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweGZmfTsKKworLyogMjkK KyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC4uLi4uLi4iCisgICAg ICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAi eC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4u Li4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4u Li4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4i KQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY192ZXJ0aWNhbF9iYXJfYml0c1tdID17Cisg IDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsCisgIDB4ODAsIDB4ODAs IDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODB9OworCisvKiAzMAorICAgICgrLWZyaW5nZS1o ZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAg ICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAg ICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIu Li4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4u Li54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIpCisqLworc3RhdGljIHVu c2lnbmVkIHNob3J0IG1jX3JldmVyc2VkX3ZlcnRpY2FsX2Jhcl9iaXRzW10gPXsKKyAgMHgzLCAw eDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgz LCAweDN9OworCisvKiAzMQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAg ICJ4eC4uLi4uLiIKKyAgICAgICJ4eC4uLi4uLiIKKyAgICAgICIgeHguLi4uLiIKKyAgICAgICIu eHguLi4uLiIKKyAgICAgICIuLnh4Li4uLiIKKyAgICAgICIuLnh4Li4uLiIKKyAgICAgICIuLi54 eC4uLiIKKyAgICAgICIuLi54eC4uLiIKKyAgICAgICIuLi4ueHguLiIKKyAgICAgICIuLi4ueHgu LiIKKyAgICAgICIuLi4uLnh4LiIKKyAgICAgICIuLi4uLnh4LiIKKyAgICAgICIuLi4uLi54eCIK KyAgICAgICIuLi4uLi54eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX2JhY2tzbGFz aF9iaXRzW10gPXsKKyAgMHhjMCwgMHhjMCwgMHhlMCwgMHg2MCwgMHgzMCwgMHgzMCwgMHgxOCwg MHgxOCwgMHhjLCAweGMsIDB4NiwgMHg2LCAweDMsIDB4M307CisKKy8qIDMyCisgICAgKCstZnJp bmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Li4uLi4uIgorICAgICAgInh4Li4uLi4u IgorICAgICAgInh4eC4uLi4uIgorICAgICAgInh4eC4uLi4uIgorICAgICAgIngueHguLi4uIgor ICAgICAgIngueHguLi4uIgorICAgICAgInguLnh4Li4uIgorICAgICAgInguLnh4Li4uIgorICAg ICAgInguLi54eC4uIgorICAgICAgInguLi54eC4uIgorICAgICAgInguLi4ueHguIgorICAgICAg InguLi4ueHguIgorICAgICAgInguLi4uLnh4IgorICAgICAgInguLi4uLnh4IikKKyovCitzdGF0 aWMgdW5zaWduZWQgc2hvcnQgbWNfdmVydGljYWxfYmFyX2JhY2tzbGFzaF9iaXRzW10gPXsKKyAg MHhjMCwgMHhjMCwgMHhlMCwgMHhlMCwgMHhiMCwgMHhiMCwgMHg5OCwKKyAgMHg5OCwgMHg4Yywg MHg4YywgMHg4NiwgMHg4NiwgMHg4MywgMHg4M307CisKKy8qIDMzCisgICAgKCstZnJpbmdlLWhl bHBlci1oZXhhZGVjaW1hbAorICAgICAgIi54eHh4eHguIgorICAgICAgInh4eHgueC4uIgorICAg ICAgInh4eHgueC4uIgorICAgICAgInh4eHgueC4uIgorICAgICAgIi54eHgueC4uIgorICAgICAg Ii4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4u LngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIikKKyovCitzdGF0aWMg dW5zaWduZWQgc2hvcnQgbWNfcGlsY3Jvd19iaXRzW10gPXsKKyAgMHg3ZSwgMHhmNCwgMHhmNCwg MHhmNCwgMHg3NCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNH07CisKKy8qIDM0 CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4ueHh4eC4uIgorICAg ICAgIi54eHh4eHguIgorICAgICAgInguLnh4Li54IgorICAgICAgInguLnh4Li54IgorICAgICAg Inh4eHh4eHh4IgorICAgICAgInh4Li4uLnh4IgorICAgICAgInh4eC4ueHh4IgorICAgICAgIi54 eHh4eHguIgorICAgICAgIi4ueHh4eC4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNf c21pbGV5X2ZhY2VfYml0c1tdID17CisgIDB4M2MsIDB4N2UsIDB4OTksIDB4OTksIDB4ZmYsIDB4 YzMsIDB4ZTcsIDB4N2UsIDB4M2N9OworCisvKiAzNQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4 YWRlY2ltYWwKKyAgICAgICIuLnguLi4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLi4u eC4uLiIKKyAgICAgICIuLi4uLnguLiIKKyAgICAgICIuLi4ueC4uLiIKKyAgICAgICIuLi54Li4u LiIKKyAgICAgICIuLnguLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3Npbmds ZV9hbmdsZV9yaWdodF9iaXRzW10gPXsKKyAgMHgyMCwgMHgxMCwgMHg4LCAweDQsIDB4OCwgMHgx MCwgMHgyMH07CisKKy8qIDM2CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAg ICAgIi4uLi4ueC4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAg Ii4ueC4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4u Li4ueC4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX2xlZnRf Yml0c1tdID17CisgIDB4NCwgMHg4LCAweDEwLCAweDIwLCAweDEwLCAweDgsIDB4NH07CisKKy8q IDM3CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Lnh4Li4uIgor ICAgICAgIi54eC54eC4uIgorICAgICAgIi4ueHgueHguIgorICAgICAgIi4uLnh4Lnh4IgorICAg ICAgIi4ueHgueHguIgorICAgICAgIi54eC54eC4uIgorICAgICAgInh4Lnh4Li4uIikKKyovCitz dGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xlX3JpZ2h0X2JpdHNbXSA9eworICAw eGQ4LCAweDZjLCAweDM2LCAweDFiLCAweDM2LCAweDZjLCAweGQ4fTsKKworLyogMzgKKyAgICAo Ky1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4ueHgueHgiCisgICAgICAiLi54 eC54eC4iCisgICAgICAiLnh4Lnh4Li4iCisgICAgICAieHgueHguLi4iCisgICAgICAiLnh4Lnh4 Li4iCisgICAgICAiLi54eC54eC4iCisgICAgICAiLi4ueHgueHgiKQorKi8KK3N0YXRpYyB1bnNp Z25lZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfbGVmdF9iaXRzW10gPXsKKyAgMHgxYiwgMHgzNiwg MHg2YywgMHhkOCwgMHg2YywgMHgzNiwgMHgxYn07CisKKy8qIDM5CisgICAgKCstZnJpbmdlLWhl bHBlci1oZXhhZGVjaW1hbAorICAgICAgIngueC54Li4uIgorICAgICAgIi54LngueC4uIgorICAg ICAgIi4ueC54LnguIgorICAgICAgIi4uLngueC54IgorICAgICAgIi4ueC54LnguIgorICAgICAg Ii54LngueC4uIgorICAgICAgIngueC54Li4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQg bWNfdHJpcGxlX2FuZ2xlX3JpZ2h0X2JpdHNbXSA9eworICAweGE4LCAweDU0LCAweDJhLCAweDE1 LCAweDJhLCAweDU0LCAweGE4fTsKKworLyogNDAKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFk ZWNpbWFsCisgICAgICAiLi4ueC54LngiCisgICAgICAiLi54LngueC4iCisgICAgICAiLngueC54 Li4iCisgICAgICAieC54LnguLi4iCisgICAgICAiLngueC54Li4iCisgICAgICAiLi54LngueC4i CisgICAgICAiLi4ueC54LngiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190cmlwbGVf YW5nbGVfbGVmdF9iaXRzW10gPXsKKyAgMHgxNSwgMHgyYSwgMHg1NCwgMHhhOCwgMHg1NCwgMHgy YSwgMHgxNX07CisKKy8qIDQxCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAg ICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAg Ii4uLi4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54 Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4u Li4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIikKKyovCitzdGF0aWMgdW5z aWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDAwLCAweDAwLCAw eDAwLCAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDgyLCAweDAwLCAweDAwLCAweDAwLCAweDAw fTsKKworLyogNDIKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4u Li4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4u Li4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4i CisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisg ICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBz aG9ydCBtY19zaW5nbGVfYW5nbGVfZG93bl9iaXRzW10gPXsKKyAgMHgwMCwgMHgwMCwgMHgwMCwg MHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHgxMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMH07CisK Ky8qIDQzCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4uLi4u IgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLnguLi4uIgor ICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAg ICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAgICAg Ii4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIikKKyovCitzdGF0 aWMgdW5zaWduZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDAwLCAw eDAwLCAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDgyLCAweDAw LCAweDAwLCAweDAwfTsKKworLyogNDQKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFs CisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisg ICAgICAieC4uLi4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAg ICAieC4ueC4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAi Li4ueC4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4u Li4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfZG93bl9i aXRzW10gPXsKKyAgMHgwMCwgMHgwMCwgMHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0 NCwgMHgyOCwgMHgxMCwgMHgwMCwgMHgwMCwgMHgwMH07CisKKy8qIDQ1CisgICAgKCstZnJpbmdl LWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLnguLi4uIgor ICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAg ICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAg Ii4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAgICAgIi4u Li4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdHJpcGxlX2FuZ2xlX3VwX2Jp dHNbXSA9eworICAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDky LCAweDI4LCAweDQ0LCAweDgyLCAweDAwfTsKKworLyogNDYKKyAgICAoKy1mcmluZ2UtaGVscGVy LWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAi LnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLngu Li54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54 Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLi4uLi4i KQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19xdWFkcnVwbGVfYW5nbGVfZG93bl9iaXRz W10gPXsKKyAgMHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHg5Miwg MHg0NCwgMHgyOCwgMHgxMCwgMHgwMH07CisKKy8qIDQ3CisgICAgKCstZnJpbmdlLWhlbHBlci1o ZXhhZGVjaW1hbAorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54 Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4u eC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4u IgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgor ICAgICAgInguLi4uLnguIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcXVhZHJ1cGxl X2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0 LCAweDkyLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDgyfTsKKworLyogNDgKKyAg ICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC4uLi4ueC4iCisgICAgICAi LnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLngu Li54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54 Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54Li4i CisgICAgICAiLi54LnguLi4iCisgICAgICAiLi4ueC4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25l ZCBzaG9ydCBtY190cmlwbGVfYW5nbGVfZG93bl9iaXRzW10gPXsKKyAgMHg4MiwgMHg0NCwgMHgy OCwgMHg5MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwg MHgxMH07CisKIC8qIE5PVEU6ICBUaGUgb3JkZXIgb2YgdGhlc2UgYml0bWFwcyBtdXN0IG1hdGNo IHRoZSBzZXF1ZW5jZQogICAgdXNlZCBpbiBmcmluZ2UuZWwgdG8gZGVmaW5lIHRoZSBjb3JyZXNw b25kaW5nIHN5bWJvbHMuICAqLwogCkBAIC00NjcsOCArOTIxLDEwNDQgQEAgc3RhdGljIHN0cnVj dCBmcmluZ2VfYml0bWFwIHN0YW5kYXJkX2JpdG1hcHNbXSA9CiAgIHsgRlJCSVRTICh2ZXJ0aWNh bF9iYXJfYml0cyksICAgICAgIDgsIDAsIEFMSUdOX0JJVE1BUF9DRU5URVIsIDAgfSwKICAgeyBG UkJJVFMgKGhvcml6b250YWxfYmFyX2JpdHMpLCAgICAgOCwgMCwgQUxJR05fQklUTUFQX0JPVFRP TSwgMC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CA/IDIgOiAwKTsK KyAgaWYgKChjbWFwID0gQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmcmluZ2VfaW5kaWNh dG9yX2FsaXN0KSksICFOSUxQIChjbWFwKSkKKyAgICB7CisgICAgICBibTEgPSBtY19hc3NxIChi aXRtYXAsIGNtYXApOworICAgICAgaWYgKENPTlNQIChibTEpKQorICB7CisgICAgaWYgKChibTEg PSBYQ0RSIChibTEpKSwgTklMUCAoYm0xKSkKKyAgICAgIHJldHVybiBNQ19OT19GUklOR0VfQklU TUFQOworICAgIGlmIChDT05TUCAoYm0xKSkKKyAgICAgIHsKKyAgICAgICAgbG4xID0gWEZJWE5V TSAoRmxlbmd0aCAoYm0xKSk7CisgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgeworICAgICAg aWYgKGxuMSA+IGl4MikKKyAgICAgICAgeworICAgICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJt MSk7CisgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgIGdvdG8gZm91bmQ7CisgICAg ICAgIH0KKyAgICB9CisgICAgICAgIGVsc2UKKyAgICB7CisgICAgICBpZiAobG4xID4gaXgxKQor ICAgICAgICB7CisgICAgICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0xKTsKKyAgICAgICAgICBp ZiAoIUVRIChibSwgUXQpKQorICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgfQorICAgIH0KKyAg ICAgIH0KKyAgICBlbHNlIGlmICgoYm0gPSBibTEsICFFUSAoYm0sIFF0KSkpCisgICAgICBnb3Rv IGZvdW5kOworICB9CisgICAgfQorICBpZiAoIUVRIChjbWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1 bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkKKyAgICAgICYmICFOSUxQIChCVkFSICgmYnVm ZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkpCisgICAgeworICAgICAgYm0y ID0gbWNfYXNzcSAoYml0bWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNh dG9yX2FsaXN0KSk7CisgICAgICBpZiAoQ09OU1AgKGJtMikpCisgIHsKKyAgICBpZiAoKGJtMiA9 IFhDRFIgKGJtMikpLCAhTklMUCAoYm0yKSkKKyAgICAgIHsKKyAgICAgICAgaWYgKENPTlNQIChi bTIpKQorICAgIHsKKyAgICAgIGxuMiA9IFhGSVhOVU0gKEZsZW5ndGggKGJtMikpOworICAgICAg aWYgKHBhcnRpYWxfcCkKKyAgICAgICAgeworICAgICAgICAgIGlmIChsbjIgPiBpeDIpCisgICAg ICB7CisgICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMik7CisgICAgICAgIGlmICghRVEgKGJt LCBRdCkpCisgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgIH0KKyAgICAgICAgfQorICAgIH0K KyAgICAgIH0KKyAgfQorICAgIH0KKyAgaWYgKGxuMSA+IGl4MSkKKyAgICB7CisgICAgICBibSA9 IG1jX250aCAoaXgxLCBibTEpOworICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgZ290byBmb3Vu ZDsKKyAgICB9CisgIGlmIChsbjIgPiBpeDEpCisgICAgeworICAgICAgYm0gPSBtY19udGggKGl4 MSwgYm0yKTsKKyAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgIGdvdG8gZm91bmQ7CisgICAgICBy ZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICB9CisgIGVsc2UgaWYgKChibSA9IGJtMiwg TklMUCAoYm0pKSkKKyAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyBmb3VuZDoKKyAg cmV0dXJuIGxvb2t1cF9mcmluZ2VfYml0bWFwIChibSk7Cit9CisKK3N0YXRpYyBpbnQKK21jX2dl dF9sb2dpY2FsX2N1cnNvcl9iaXRtYXAgKHN0cnVjdCB3aW5kb3cgKncsIEx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gKGJtMSkpCisg ICAgICAgICAgICB7CisgICAgICAgICAgICAgIGxuMSA9IFhGSVhOVU0gKEZsZW5ndGggKGJtMSkp OworICAgICAgICAgICAgICBpZiAocGFydGlhbF9wKQorICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgIGlmIChsbjEgPiBpeDIpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgICAgICBibSA9IG1jX250aCAoaXgyLCBibTEpOworICAgICAgICAgICAgICAg ICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5kOwor ICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBl bHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgaWYgKGxuMSA+IGl4MSkK KyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGJtID0gbWNfbnRo IChpeDEsIGJtMSk7CisgICAgICAgICAgICAgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAg ICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxzZSBpZiAoKGJtID0gYm0x LCAhRVEgKGJtLCBRdCkpKQorICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgfQorICAg IH0KKyAgaWYgKCFFUSAoY21hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGlj YXRvcl9hbGlzdCkpCisgICAgICAmJiAhTklMUCAoQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJp bmdlX2luZGljYXRvcl9hbGlzdCkpKQorICAgIHsKKyAgICAgIGJtMiA9IG1jX2Fzc3EgKGJpdG1h cCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpOworICAg ICAgaWYgKENPTlNQIChibTIpKQorICAgICAgICB7CisgICAgICAgICAgaWYgKChibTIgPSBYQ0RS IChibTIpKSwgIU5JTFAgKGJtMikpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmIChD T05TUCAoYm0yKSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBsbjIgPSBYRklYTlVNIChGbGVu Z3RoIChibTIpKTsKKyAgICAgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICBpZiAobG4yID4gaXgyKQorICAgICAgICAgICAgeworICAgICAgICAg ICAgICBibSA9IG1jX250aCAoaXgyLCBibTIpOworICAgICAgICAgICAgICBpZiAoIUVRIChibSwg UXQpKQorICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICB9CisgICAgICAg ICAgICAgIH0KKyAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9Cisg IGlmIChsbjEgPiBpeDEpCisgICAgeworICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0xKTsKKyAg ICAgIGlmICghRVEgKGJtLCBRdCkpCisgIGdvdG8gZm91bmQ7CisgICAgfQorICBpZiAobG4yID4g aXgxKQorICAgIHsKKyAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMik7CisgICAgICBpZiAoIUVR IChibSwgUXQpKQorICAgICAgICBnb3RvIGZvdW5kOworICAgICAgcmV0dXJuIE1DX05PX0ZSSU5H RV9CSVRNQVA7CisgICAgfQorICAgIGVsc2UgaWYgKChibSA9IGJtMiwgTklMUCAoYm0pKSkKKyAg ICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyBmb3VuZDoKKyAgcmV0dXJuIGxvb2t1cF9m cmluZ2VfYml0bWFwIChibSk7Cit9CisKKy8qIFJlY2FsY3VsYXRlIHRoZSBiaXRtYXBzIHRvIHNo b3c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AgICAgaXMgbm90IGluaXRpYWxpemVkIGhlcmUuICBT aW1pbGFybHkgZm9yIGJvdF9pbmRfcm4sCisgICAgIHJvdy0+aW5kaWNhdGVfZW9iX3AgYW5kIGJv dF9yb3dfZW5kc19hdF96dl9wLiAgKi8KKyAgaW50IHRvcF9yb3dfZW5kc19hdF96dl9wIE1DX0lG X0xJTlQgKD0gMCksIGJvdF9yb3dfZW5kc19hdF96dl9wIE1DX0lGX0xJTlQgKD0gMCk7CisgIGlm ICh3LT5wc2V1ZG9fd2luZG93X3ApCisgICAgcmV0dXJuIDA7CisgIGlmICghTUlOSV9XSU5ET1df UCAodykKKyAgICAgICYmIChpbmQgPSBCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGluZGlj YXRlX2J1ZmZlcl9ib3VuZGFyaWVzKSwgIU5JTFAgKGluZCkpKQorICAgIHsKKyAgICAgIGlmIChF USAoaW5kLCBRbGVmdCkgfHwgRVEgKGluZCwgUXJpZ2h0KSkKKyAgICAgICAgYm91bmRhcnlfdG9w ID0gYm91bmRhcnlfYm90ID0gYXJyb3dfdG9wID0gYXJyb3dfYm90ID0gaW5kOworICAgICAgZWxz ZSBpZiAoQ09OU1AgKGluZCkKKyAgICAgICAgICAgICAgICYmIENPTlNQIChYQ0FSIChpbmQpKSkK KyAgICAgICAgeworICAgICAgICAgIExpc3BfT2JqZWN0IHBvczsKKyAgICAgICAgICBpZiAocG9z ID0gbWNfYXNzcSAoUXQsIGluZCksICFOSUxQIChwb3MpKQorICAgICAgICAgICAgYm91bmRhcnlf dG9wID0gYm91bmRhcnlfYm90ID0gYXJyb3dfdG9wID0gYXJyb3dfYm90ID0gWENEUiAocG9zKTsK KyAgICAgICAgICBpZiAocG9zID0gbWNfYXNzcSAoUXRvcCwgaW5kKSwgIU5JTFAgKHBvcykpCisg ICAgICAgICAgICBib3VuZGFyeV90b3AgPSBYQ0RSIChwb3MpOworICAgICAgICAgIGlmIChwb3Mg PSBtY19hc3NxIChRYm90dG9tLCBpbmQpLCAhTklMUCAocG9zKSkKKyAgICAgICAgICAgIGJvdW5k YXJ5X2JvdCA9IFhDRFIgKHBvcyk7CisgICAgICAgICAgaWYgKHBvcyA9IG1jX2Fzc3EgKFF1cCwg aW5kKSwgIU5JTFAgKHBvcykpCisgICAgICAgICAgICBhcnJvd190b3AgPSBYQ0RSIChwb3MpOwor ICAgICAgICAgIGlmIChwb3MgPSBtY19hc3NxIChRZG93biwgaW5kKSwgIU5JTFAgKHBvcykpCisg ICAgICAgICAgICBhcnJvd19ib3QgPSBYQ0RSIChwb3MpOworICAgICAgICB9CisgICAgICBlbHNl CisgICAgICAgIC8qIEFueXRoaW5nIGVsc2UgbWVhbnMgYm91bmRhcnkgb24gbGVmdCBhbmQgbm8g YXJyb3dzLiAgKi8KKyAgICAgICAgYm91bmRhcnlfdG9wID0gYm91bmRhcnlfYm90ID0gUWxlZnQ7 CisgICAgfQorICB0b3BfaW5kX3JuID0gYm90X2luZF9ybiA9IC0xOworICBpZiAoIU5JTFAgKGlu ZCkpCisgICAgeworICAgICAgZm9yICh5ID0gdy0+dnNjcm9sbCwgcm4gPSAwOworICAgICAgICAg ICB5IDwgeWIgJiYgcm4gPCBucm93czsKKyAgICAgICAgICAgeSArPSByb3ctPmhlaWdodCwgKyty bikKKyAgICAgICAgeworICAgICAgICAgIHJvdyA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsg cm47CisgICAgICAgICAgaWYgKCFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgICAgIHJvdyA9IHct PmN1cnJlbnRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgcm93LT5pbmRpY2F0ZV9ib2Jf cCA9IHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcCA9IDA7CisgICAgICAgICAgcm93LT5pbmRpY2F0 ZV9lb2JfcCA9IHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCA9IDA7CisgICAgICAgICAgaWYg KCFyb3ctPm1vZGVfbGluZV9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAodG9w X2luZF9ybiA8IDAgJiYgcm93LT52aXNpYmxlX2hlaWdodCA+IDApCisgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgaWYgKE1BVFJJWF9ST1dfU1RBUlRfQ0hBUlBPUyAocm93KSA8 PSBCVUZfQkVHViAoWEJVRkZFUiAody0+Y29udGVudHMpKQorICAgICAgICAgICAgICAgICAgICAg ICYmICFNQVRSSVhfUk9XX1BBUlRJQUxMWV9WSVNJQkxFX0FUX1RPUF9QICh3LCByb3cpKQorICAg ICAgICAgICAgICAgICAgICByb3ctPmluZGljYXRlX2JvYl9wID0gIU5JTFAgKGJvdW5kYXJ5X3Rv cCk7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHJvdy0+aW5k aWNhdGVfdG9wX2xpbmVfcCA9ICFOSUxQIChhcnJvd190b3ApOworICAgICAgICAgICAgICAgICAg dG9wX2luZF9ybiA9IHJuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgaWYgKGJv dF9pbmRfcm4gPCAwKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGlmIChN QVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpID49IEJVRl9aViAoWEJVRkZFUiAody0+Y29udGVu dHMpKQorICAgICAgICAgICAgICAgICAgICAgICYmICFNQVRSSVhfUk9XX1BBUlRJQUxMWV9WSVNJ QkxFX0FUX0JPVFRPTV9QICh3LCByb3cpKQorICAgICAgICAgICAgICAgICAgICByb3ctPmluZGlj YXRlX2VvYl9wID0gIU5JTFAgKGJvdW5kYXJ5X2JvdCksIGJvdF9pbmRfcm4gPSBybjsKKyAgICAg ICAgICAgICAgICAgIGVsc2UgaWYgKHkgKyByb3ctPmhlaWdodCA+PSB5YikKKyAgICAgICAgICAg ICAgICAgICAgcm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wID0gIU5JTFA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u Z2VfYml0bWFwICh3LCB3aGljaCwgMSwgcGFydGlhbF9wKSkpCisgIC8qIEV4dGVuZCB0b3AtYWxp Z25lZCB0b3AgaW5kaWNhdG9yIChvciBib3R0b20tYWxpZ25lZCBib3R0b20KKyAgICAgaW5kaWNh dG9yKSB0byBhZGphY2VudCByb3dzIGlmIGl0IGRvZXNuJ3QgZml0IGluIG9uZSByb3cuICAqLwor ICB0b3BfaW5kX21pbl95ID0gYm90X2luZF9tYXhfeSA9IC0xOworICBpZiAodG9wX2luZF9ybiA+ PSAwKQorICAgIHsKKyAgICAgIGludCBibiA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICBy b3cgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHRvcF9pbmRfcm47CisgICAgICBpZiAoIXJv dy0+ZW5hYmxlZF9wKQorICAgICAgICByb3cgPSB3LT5jdXJyZW50X21hdHJpeC0+cm93cyArIHRv cF9pbmRfcm47CisgICAgICB0b3Bfcm93X2VuZHNfYXRfenZfcCA9IHJvdy0+ZW5kc19hdF96dl9w OworICAgICAgaWYgKHJvdy0+aW5kaWNhdGVfYm9iX3ApCisgICAgICAgIHsKKyAgICAgICAgICBp ZiAoRVEgKGJvdW5kYXJ5X3RvcCwgUWxlZnQpKQorICAgICAgICAgICAgYm4gPSAoKHJvdy0+aW5k aWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5kYXJ5X2JvdCwgUWxlZnQpKQorICAgICAgICAgICAgPyBN Q19MRUZUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKQorICAgICAg ICAgICAgOiBNQ19MRUZUX0ZSSU5HRSAoMiwgUXRvcCwgMCkpOworICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgIGJuID0gKChyb3ctPmluZGljYXRlX2VvYl9wICYmIEVRIChib3VuZGFyeV9ib3Qs IFFyaWdodCkpCisgICAgICAgICAgICA/IE1DX1JJR0hUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20s IHJvdy0+ZW5kc19hdF96dl9wKQorICAgICAgICAgICAgOiBNQ19SSUdIVF9GUklOR0UgKDIsIFF0 b3AsIDApKTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV90b3BfbGlu ZV9wKQorICAgICAgICB7CisgICAgICAgICAgaWYgKEVRIChhcnJvd190b3AsIFFsZWZ0KSkKKyAg ICAgICAgICAgIGJuID0gTUNfTEVGVF9GUklOR0UgKDYsIFF1cCwgMCk7CisgICAgICAgICAgZWxz ZQorICAgICAgICAgICAgYm4gPSBNQ19SSUdIVF9GUklOR0UgKDYsIFF1cCwgMCk7CisgICAgICAg IH0KKyAgICAgIGlmIChibiAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICB7CisgICAg ICAgICAgc3RydWN0IGZyaW5nZV9iaXRtYXAgKmZiID0gZ2V0X2ZyaW5nZV9iaXRtYXBfZGF0YSAo Ym4pOworICAgICAgICAgIGlmIChmYi0+YWxpZ24gPT0gQUxJR05fQklUTUFQX1RPUCAmJiBmYi0+ cGVyaW9kID09IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9y b3cgKnJvdzE7CisgICAgICAgICAgICAgIGludCB0b3BfaW5kX21heF95OworICAgICAgICAgICAg ICB0b3BfaW5kX21pbl95ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgICAgICAg ICAgICAgIHRvcF9pbmRfbWF4X3kgPSB0b3BfaW5kX21pbl95ICsgZmItPmhlaWdodDsKKyAgICAg ICAgICAgICAgaWYgKHRvcF9pbmRfbWF4X3kgPiB5YikKKyAgICAgICAgICAgICAgICB0b3BfaW5k X21heF95ID0geWI7CisgICAgICAgICAgICAgIGZvciAoeSA9IHJvdy0+eSArIHJvdy0+aGVpZ2h0 LCBybiA9IHRvcF9pbmRfcm4gKyAxOworICAgICAgICAgICAgICAgICAgIHkgPCB0b3BfaW5kX21h eF95ICYmIHJuIDwgbnJvd3M7CisgICAgICAgICAgICAgICAgICAgeSArPSByb3cxLT5oZWlnaHQs IHJuKyspCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgaWYgKGJvdF9pbmRf cm4gPj0gMCAmJiBybiA+PSBib3RfaW5kX3JuKQorICAgICAgICAgICAgICAgICAgICBicmVhazsK KyAgICAgICAgICAgICAgICAgIHJvdzEgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHJuOwor ICAgICAgICAgICAgICAgICAgaWYgKCFyb3cxLT5lbmFibGVkX3ApCisgICAgICAgICAgICAgICAg ICAgIHJvdzEgPSB3LT5jdXJyZW50X21hdHJpeC0+cm93cyArIHJuOworICAgICAgICAgICAgICAg ICAgcm93MS0+aW5kaWNhdGVfYm9iX3AgPSByb3ctPmluZGljYXRlX2JvYl9wOworICAgICAgICAg ICAgICAgICAgcm93MS0+aW5kaWNhdGVfdG9wX2xpbmVfcCA9IHJvdy0+aW5kaWNhdGVfdG9wX2xp bmVfcDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9 CisgIGlmIChib3RfaW5kX3JuID49IDApCisgICAgeworICAgICAgaW50IGJuID0gTUNfTk9fRlJJ TkdFX0JJVE1BUDsKKyAgICAgIHJvdyA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgYm90X2lu ZF9ybjsKKyAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgICAgIHJvdyA9IHctPmN1cnJl bnRfbWF0cml4LT5yb3dzICsgYm90X2luZF9ybjsKKyAgICAgIGJvdF9yb3dfZW5kc19hdF96dl9w ID0gcm93LT5lbmRzX2F0X3p2X3A7CisgICAgICBpZiAocm93LT5pbmRpY2F0ZV9lb2JfcCkKKyAg ICAgICAgeworICAgICAgICAgIGlmIChFUSAoYm91bmRhcnlfYm90LCBRbGVmdCkpCisgICAgICAg ICAgICBibiA9IE1DX0xFRlRfRlJJTkdFICgzLCBRYm90dG9tLCByb3ctPmVuZHNfYXRfenZfcCk7 CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgYm4gPSBNQ19SSUdIVF9GUklOR0UgKDMsIFFi b3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAocm93 LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wKQorICAgICAgICB7CisgICAgICAgICAgaWYgKEVRIChh cnJvd19ib3QsIFFsZWZ0KSkKKyAgICAgICAgICAgIGJuID0gTUNfTEVGVF9GUklOR0UgKDcsIFFk b3duLCAwKTsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICBibiA9IE1DX1JJR0hUX0ZSSU5H RSAoNywgUWRvd24sIDApOworICAgICAgICB9CisgICAgICBpZiAoYm4gIT0gTUNfTk9fRlJJTkdF X0JJVE1BUCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBmcmluZ2VfYml0bWFwICpmYiA9 IGdldF9mcmluZ2VfYml0bWFwX2RhdGEgKGJuKTsKKyAgICAgICAgICBpZiAoZmItPmFsaWduID09 IEFMSUdOX0JJVE1BUF9CT1RUT00gJiYgZmItPnBlcmlvZCA9PSAwKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cxOworICAgICAgICAgICAgICBpbnQg Ym90X2luZF9taW5feTsKKyAgICAgICAgICAgICAgYm90X2luZF9tYXhfeSA9IHJvdy0+eSArIHJv dy0+dmlzaWJsZV9oZWlnaHQ7CisgICAgICAgICAgICAgIGJvdF9pbmRfbWluX3kgPSBib3RfaW5k X21heF95IC0gZmItPmhlaWdodDsKKyAgICAgICAgICAgICAgaWYgKGJvdF9pbmRfbWluX3kgPCBX SU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KSkKKyAgICAgICAgICBib3RfaW5kX21pbl95ID0g V0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgICAgICAgICAgICAgIGZvciAoeSA9IHJv dy0+eSwgcm4gPSBib3RfaW5kX3JuIC0gMTsKKyAgICAgICAgICAgICB5ID49IGJvdF9pbmRfbWlu X3kgJiYgcm4gPj0gMDsKKyAgICAgICAgICAgICB5IC09IHJvdzEtPmhlaWdodCwgcm4tLSkKKyAg ICAgICAgICB7CisgICAgICAgICAgICBpZiAodG9wX2luZF9ybiA+PSAwICYmIHJuIDw9IHRvcF9p bmRfcm4pCisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgcm93MSA9IHctPmRlc2ly ZWRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgICBpZiAoIXJvdzEtPmVuYWJsZWRfcCkK KyAgICAgICAgICAgICAgcm93MSA9IHctPmN1cnJlbnRfbWF0cml4LT5yb3dzICsgcm47CisgICAg ICAgICAgICByb3cxLT5pbmRpY2F0ZV9lb2JfcCA9IHJvdy0+aW5kaWNhdGVfZW9iX3A7CisgICAg ICAgICAgICByb3cxLT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wID0gcm93LT5pbmRpY2F0ZV9ib3R0 b21fbGluZV9wOworICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0K KyAgTGlzcF9PYmplY3QgYnVmID0gdy0+Y29udGVudHM7CisgIENIRUNLX0JVRkZFUiAoYnVmKTsK KyAgYm9vbCBhdXRvX2hzY3JvbGxfbW9kZV9wID0gRVEgKEZidWZmZXJfbG9jYWxfdmFsdWUgKFFh dXRvX2hzY3JvbGxfbW9kZSwgYnVmKSwgUWN1cnJlbnRfbGluZSk7CisgIC8qIEVYQU1QTEU6ICAo c2Nyb2xsLWxlZnQgNSkgKi8KKyAgYm9vbCBoc2NsX2FsbF90ZW1wX3AgPSAody0+c3VzcGVuZF9h dXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21v ZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBM RTogIEMtdSBDLXggPCBhbmQgZG8gbm90aGluZy4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzBf cCA9ICh3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Ny b2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09 IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBzb21ldGhpbmcg ZWxzZSBiZXNpZGVzIGhvcml6b250YWxseSBzY3JvbGxpbmcgdGhlCisgICAgICAgICAgICAgICBj dXJyZW50IGxpbmUgZGlmZmVyZW50bHkuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgaXMg X25vdF8gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xf YWxsX3Blcm1fMV9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1p bl9oc2Nyb2xsID09IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCAu Li4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFsbHkgc2Ny b2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8yX3AgPSAoIXctPnN1 c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19o c2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwg PT0gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhzY3Jv bGwpOworICAvKiBFWEFNUExFOiAgKHNjcm9sbC1sZWZ0IDUpOyBhbmQsIHRoZW4gcHJlc3MgdGhl IGxlZnQgYXJyb3cga2V5IG9uZSB0aW1lLgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIF9p c18gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiovCisgIGJvb2wgaHNjbF90ZW1w X3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYg YXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwg PiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gMCk7CisgIC8q IEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIHNvbWV0aGluZyB0aGF0IGNhdXNlcyB0aGUgY3Vy cmVudCBsaW5lIHRvIGJlCisgICAgICAgICAgICAgICBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlm ZmVyZW50bHkuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkg c2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9wZXJtX3AgPSAoIXctPnN1c3Bl bmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21v ZGVfcAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAg JiYgdy0+bWluX2hzY3JvbGwgIT0gdy0+aHNjcm9sbCk7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhG UkFNRSAody0+ZnJhbWUpOworICBmb3IgKHkgPSB3LT52c2Nyb2xsLCBybiA9IDA7CisgICAgICAg eSA8IHliICYmIHJuIDwgbnJvd3M7CisgICAgICAgeSArPSByb3ctPmhlaWdodCwgcm4rKykKKyAg ICB7CisgIGludCBsZWZ0LCByaWdodDsKKyAgdW5zaWduZWQgbGVmdF9mYWNlX2lkLCByaWdodF9m YWNlX2lkOworICBpbnQgbGVmdF9vZmZzZXQsIHJpZ2h0X29mZnNldDsKKyAgYm9vbCBwZXJpb2Rp Y19wOworICByb3cgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHJuOworICBjdXIgPSB3LT5j dXJyZW50X21hdHJpeC0+cm93cyArIHJuOworICBpbnQgdnBvc19kZXNpcmVkID0gTUFUUklYX1JP V19WUE9TICh3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHJuLCB3LT5kZXNpcmVkX21hdHJpeCk7 CisgIGludCB2cG9zX2N1cnJlbnQgPSBNQVRSSVhfUk9XX1ZQT1MgKHctPmN1cnJlbnRfbWF0cml4 LT5yb3dzICsgcm4sIHctPmN1cnJlbnRfbWF0cml4KTsKKyAgaW50IG1jX2xlZnRfZnJpbmdlX2Jp dG1hcCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgIGludC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3Blcm1fMl9wCisgICAgICAgICAgJiYgZW5hYmxlZF9wKQor ICAgICAgICB7CisgICAgICAgICAgaW50IGZyaW5nZV9iaXRtYXAgPSBNQ19OT19GUklOR0VfQklU TUFQOworICAgICAgICAgIGVudW0gZmFjZV9pZCBvdmVybGF5X2Fycm93X2ZhY2VfaWQgPQorICAg ICAgICAgICAgKCFhY3RpdmVfcAorICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgICAgID8gbG9v a3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1pbmFjdGl2ZS1m YWNlIiksIHRydWUpCisgICAgICAgICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAgICAgICAgPyBs b29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWZhY2UiKSwg dHJ1ZSkKKyAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAgIG1jX2xlZnRf ZnJpbmdlX2ZhY2VfaWQgPSAoY3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBvdmVybGF5X2Fycm93X2ZhY2Vf aWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lE OworICAgICAgICAgIGlmICh3LT5oc2Nyb2xsICE9IDApCisgICAgICAgICAgICBmcmluZ2VfYml0 bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistb3ZlcmxheS1hcnJvdyIp LCBmYWxzZSwgdHJ1ZSk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGZyaW5nZV9i aXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1vdmVybGF5LWFycm93 IiksIHRydWUsIHRydWUpOworICAgICAgICAgIG1jX2xlZnRfZnJpbmdlX2JpdG1hcCA9IChjdXJz b3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBp ZiAoKHZwb3MgPT0gdnBvc19kZXNpcmVkIHx8IHZwb3MgPT0gdnBvc19jdXJyZW50KQorICAgICAg ICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgPT0gTUNfT1ZFUkxBWV9BUlJPV19CSVRNQVAKKyAg ICAgICAgICAgICAgICAgJiYgKGhzY2xfYWxsX3RlbXBfcAorICAgICAgICAgICAgICAgICAgICAg fHwgaHNjbF9hbGxfcGVybV8wX3AKKyAgICAgICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxsX3Bl cm1fMV9wCisgICAgICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzJfcAorICAgICAg ICAgICAgICAgICAgICAgfHwgaHNjbF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgICAgIHx8IGhz Y2xfcGVybV9wKQorICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgewor ICAgICAgICAgICAgaW50IGZyaW5nZV9iaXRtYXAgPSBNQ19OT19GUklOR0VfQklUTUFQOworICAg ICAgICAgICAgZW51bSBmYWNlX2lkIG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICAg ICAgICghYWN0aXZlX3AKKyAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3 LT5jb250ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgICAgICAgPyBsb29r dXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtaW5hY3Rp dmUtZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAgICAg ICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ct aHNjbC1mYWNlIiksIHRydWUpCisgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAg ICAgICAgICAgbWNfbGVmdF9mcmluZ2VfZmFjZV9pZCA9IChjdXJzb3JfdHlwZSA9PSBNQ19MRUZU X0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g b3ZlcmxheV9hcnJvd19mYWNlX2lkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAgICAgaWYgKGhzY2xfYWxsX3Blcm1fMF9w KQorICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcs IGludGVybiAoIistaHNjbC1wZXJtIiksIGZhbHNlLCBmYWxzZSk7CisgICAgICAgICAgICAgIGVs c2UgaWYgKGhzY2xfYWxsX3Blcm1fMV9wKQorICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAg PSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgdHJ1ZSwg ZmFsc2UpOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xfYWxsX3Blcm1fMl9wKQorICAg ICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBp bnRlcm4gKCIrLWhzY2wtcGVybSIpLCBmYWxzZSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICBl bHNlIGlmIChoc2NsX3Blcm1fcCkKKyAgICAgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9 IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCB0cnVlLCB0 cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF9hbGxfdGVtcF9wKQorICAg ICAgICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAo dywgaW50ZXJuICgiKy1oc2NsLXRlbXAiKSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAgICAgICAg ICAgICAgICBlbHNlIGlmIChoc2NsX3RlbXBfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgIGZy aW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXRl bXAiKSwgdHJ1ZSwgZmFsc2UpOworICAgICAgICAgICAgbWNfbGVmdF9mcmluZ2VfYml0bWFwID0g KGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IGZyaW5nZV9iaXRtYXAKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgICAgfQorICAg ICAgICAgIGVsc2UgaWYgKCh2cG9zID09IHZwb3NfZGVzaXJlZCB8fCB2cG9zID09IHZwb3NfY3Vy cmVudCkKKyAgICAgICAgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1df UkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9m bGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAg ICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEUK KyAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9C QVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9 PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAg ICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAg ICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIKKyAg ICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJf QkFDS1NMQVNIKQorICAgICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAg ICB7CisgICAgICAgICAgICAgIExpc3BfT2JqZWN0IGJpdG1hcF9mbGF2b3IgPSAoZ2x5cGhfZmxh dm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fy cm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9m bGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVykKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfaG9s bG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEUpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hvbGxvd19yZWN0 YW5nbGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBo X2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jhcl9yaWdodF9hcnJv dworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxh dm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVykKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxf YmFyX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXIKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZF UlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gUW1jX3JldmVyc2VkX3ZlcnRpY2FsX2JhcgorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9C QUNLU0xBU0gpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g UW1jX3ZlcnRpY2FsX2Jhcl9iYWNrc2xhc2gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogUW5pbDsKKyAgICAgICAgICAgICAgbWNfcmlnaHRfZnJpbmdlX2JpdG1h cCA9IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbG9va3VwX2ZyaW5nZV9iaXRtYXAgKGJpdG1h cF9mbGF2b3IpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19O T19GUklOR0VfQklUTUFQOworICAgICAgICAgICAgICBtY19yaWdodF9mcmluZ2VfZmFjZV9pZCA9 CisgICAgICAgICAgICAgICAgKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAK KyAgICAgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1df UkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2 b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAg ICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKSkKKyAg ICAgICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmV2 ZXJzZWQtdmVydGljYWwtYmFyLWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChjdXJz b3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgJiYg Z2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX0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mVyc2VkX3AgJiYgTUFUUklYX1JP V19DT05USU5VQVRJT05fTElORV9QIChyb3cpKQorICAgICAgICAgICAgICAgfHwgKHJvdy0+cmV2 ZXJzZWRfcCAmJiByb3ctPmNvbnRpbnVlZF9wKSkKKyAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJ TkdFICg0LCBRY29udGludWF0aW9uLCAwKTsKKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVf ZW1wdHlfbGluZV9wICYmIEVRIChlbXB0eV9wb3MsIFFsZWZ0KSkKKyAgICAgICAgbGVmdCA9IE1D X0xFRlRfRlJJTkdFICg1LCBRZW1wdHlfbGluZSwgMCk7CisgICAgICBlbHNlIGlmIChyb3ctPmlu ZGljYXRlX3RvcF9saW5lX3AgJiYgRVEgKGFycm93X3RvcCwgUWxlZnQpKQorICAgICAgICB7Cisg ICAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdFICg2LCBRdXAsIDApOworICAgICAgICAgIGlm ICh0b3BfaW5kX21pbl95ID49IDApCisgICAgICAgICAgICBsZWZ0X29mZnNldCA9IHRvcF9pbmRf bWluX3kgLSByb3ctPnk7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVf Ym90dG9tX2xpbmVfcCAmJiBFUSAoYXJyb3dfYm90LCBRbGVmdCkpCisgICAgICAgIHsKKyAgICAg ICAgICBsZWZ0ID0gTUNfTEVGVF9GUklOR0UgKDcsIFFkb3duLCAwKTsKKyAgICAgICAgICBpZiAo Ym90X2luZF9tYXhfeSA+PSAwKQorICAgICAgICAgICAgbGVmdF9vZmZzZXQgPSBib3RfaW5kX21h eF95IC0gKHJvdy0+eSArIHJvdy0+dmlzaWJsZV9oZWlnaHQpOworICAgICAgICB9CisgICAgICBl bHNlCisgICAgICAgIGxlZnQgPSBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgLyogRGVjaWRl IHdoaWNoIGJpdG1hcCB0byBkcmF3IGluIHR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SAtIHJvdy0+eTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9l b2JfcCAmJiBFUSAoYm91bmRhcnlfYm90LCBRcmlnaHQpKQorICAgICAgICB7CisgICAgICAgICAg cmlnaHQgPSBNQ19SSUdIVF9GUklOR0UgKDMsIFFib3R0b20sIGJvdF9yb3dfZW5kc19hdF96dl9w KTsKKyAgICAgICAgICBpZiAoYm90X2luZF9tYXhfeSA+PSAwKQorICAgICAgICAgICAgcmlnaHRf b2Zmc2V0ID0gYm90X2luZF9tYXhfeSAtIChyb3ctPnkgKyByb3ctPnZpc2libGVfaGVpZ2h0KTsK KyAgICAgICAgfQorICAgICAgZWxzZSBpZiAoKCFyb3ctPnJldmVyc2VkX3AgJiYgcm93LT5jb250 aW51ZWRfcCkKKyAgICAgICAgICAgICAgIHx8IChyb3ctPnJldmVyc2VkX3AgJiYgTUFUUklYX1JP V19DT05USU5VQVRJT05fTElORV9QIChyb3cpKSkKKyAgICAgICAgcmlnaHQgPSBNQ19SSUdIVF9G UklOR0UgKDQsIFFjb250aW51YXRpb24sIDApOworICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0 ZV90b3BfbGluZV9wICYmIEVRIChhcnJvd190b3AsIFFyaWdodCkpCisgICAgICAgIHsKKyAgICAg ICAgICByaWdodCA9IE1DX1JJR0hUX0ZSSU5HRSAoNiwgUXVwLCAwKTsKKyAgICAgICAgICBpZiAo dG9wX2luZF9taW5feSA+PSAwKQorICAgICAgICAgICAgcmlnaHRfb2Zmc2V0ID0gdG9wX2luZF9t aW5feSAtIHJvdy0+eTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9i b3R0b21fbGluZV9wICYmIEVRIChhcnJvd19ib3QsIFFyaWdodCkpCisgICAgICAgIHsKKyAgICAg ICAgICByaWdodCA9IE1DX1JJR0hUX0ZSSU5HRSAoNywgUWRvd24sIDApOworICAgICAgICAgIGlm IChib3RfaW5kX21heF95ID49IDApCisgICAgICAgICAgICByaWdodF9vZmZzZXQgPSBib3RfaW5k X21heF95IC0gKHJvdy0+eSArIHJvdy0+dmlzaWJsZV9oZWlnaHQpOworICAgICAgICB9CisgICAg ICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2VtcHR5X2xpbmVfcCAmJiBFUSAoZW1wdHlfcG9zLCBR cmlnaHQpKQorICAgICAgICByaWdodCA9IE1DX1JJR0hUX0ZSSU5HRSAoNSwgUWVtcHR5X2xpbmUs IDApOworICAgICAgZWxzZQorICAgICAgICByaWdodCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7Cisg ICAgICBwZXJpb2RpY19wID0gKGdldF9mcmluZ2VfYml0bWFwX2RhdGEgKGxlZnQpLT5wZXJpb2Qg IT0gMAorICAgICAgICAgICAgICAgICAgICB8fCBnZXRfZnJpbmdlX2JpdG1hcF9kYXRhIChyaWdo dCktPnBlcmlvZCAhPSAwKTsKKyAgICAgIGlmIChyb3ctPnkgIT0gY3VyLT55CisgICAgICAgICAg fHwgcm93LT52aXNpYmxlX2hlaWdodCAhPSBjdXItPnZpc2libGVfaGVpZ2h0CisgICAgICAgICAg fHwgcm93LT5lbmRzX2F0X3p2X3AgIT0gY3VyLT5lbmRzX2F0X3p2X3AKKyAgICAgICAgICB8fCBs ZWZ0ICE9IGN1ci0+bGVmdF9mcmluZ2VfYml0bWFwCisgICAgICAgICAgfHwgcmlnaHQgIT0gY3Vy LT5yaWdodF9mcmluZ2VfYml0bWFwCisgICAgICAgICAgfHwgbGVmdF9mYWNlX2lkICE9IGN1ci0+ bGVmdF9mcmluZ2VfZmFjZV9pZAorICAgICAgICAgIHx8IHJpZ2h0X2ZhY2VfaWQgIT0gY3VyLT5y aWdodF9mcmluZ2VfZmFjZV9pZAorICAgICAgICAgIHx8IGxlZnRfb2Zmc2V0ICE9IGN1ci0+bGVm dF9mcmluZ2Vfb2Zmc2V0CisgICAgICAgICAgfHwgcmlnaHRfb2Zmc2V0ICE9IGN1ci0+cmlnaHRf ZnJpbmdlX29mZnNldAorICAgICAgICAgIHx8IHBlcmlvZGljX3AgIT0gY3VyLT5mcmluZ2VfYml0 bWFwX3BlcmlvZGljX3AKKyAgICAgICAgICB8fCBjdXItPnJlZHJhd19mcmluZ2VfYml0bWFwc19w KQorICAgICAgICB7CisgICAgICAgICAgcmVkcmF3X3AgPSAxLCByb3ctPnJlZHJhd19mcmluZ2Vf Yml0bWFwc19wID0gMTsKKyAgICAgICAgICBpZiAoIWtlZXBfY3VycmVudF9wKQorICAgICAgICAg ICAgeworICAgICAgICAgICAgICBjdXItPnJlZHJhd19mcmluZ2VfYml0bWFwc19wID0gMTsKKyAg ICAgICAgICAgICAgaWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklU TUFQCisgICAgICAgICAgICAgICAgICB8fCBtY19yaWdodF9mcmluZ2VfYml0bWFwICE9IE1DX05P X0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgY3VyLT5mcmluZ2VfYml0bWFwX3Blcmlv ZGljX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBj dXItPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcCA9IHBlcmlvZGljX3A7CisgICAgICAgICAgICAg IGlmIChtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAg ICAgICAgICAgICBjdXItPmxlZnRfZnJpbmdlX2JpdG1hcCA9IG1jX2xlZnRfZnJpbmdlX2JpdG1h cDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPmxlZnRfZnJp bmdlX2JpdG1hcCA9IGxlZnQ7CisgICAgICAgICAgICAgIGlmIChtY19sZWZ0X2ZyaW5nZV9iaXRt YXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICBjdXItPmxlZnRfZnJp bmdlX2ZhY2VfaWQgPSBtY19sZWZ0X2ZyaW5nZV9mYWNlX2lkOworICAgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICAgIGN1ci0+bGVmdF9mcmluZ2VfZmFjZV9pZCA9IGxlZnRfZmFj ZV9pZDsKKyAgICAgICAgICAgICAgaWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19G UklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgIGN1ci0+bGVmdF9mcmluZ2Vfb2Zmc2V0ID0g MDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPmxlZnRfZnJp bmdlX29mZnNldCA9IGxlZnRfb2Zmc2V0OworICAgICAgICAgICAgICBpZiAobWNfcmlnaHRfZnJp bmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgIGN1ci0+ cmlnaHRfZnJpbmdlX2JpdG1hcCA9IG1jX3JpZ2h0X2ZyaW5nZV9iaXRtYXA7CisgICAgICAgICAg ICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2VfYml0bWFwID0g cmlnaHQ7CisgICAgICAgICAgICAgIGlmIChtY19yaWdodF9mcmluZ2VfYml0bWFwICE9IE1DX05P X0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2VfZmFjZV9p ZCA9IG1jX3JpZ2h0X2ZyaW5nZV9mYWNlX2lkOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX2ZhY2VfaWQgPSByaWdodF9mYWNlX2lkOwor ICAgICAgICAgICAgICBpZiAobWNfcmlnaHRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0Vf QklUTUFQKQorICAgICAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX29mZnNldCA9IDA7Cisg ICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2Vf b2Zmc2V0ID0gcmlnaHRfb2Zmc2V0OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBp ZiAocm93LT5vdmVybGF5X2Fycm93X2JpdG1hcCA8IDApCisgICAgICAgIHJvdy0+b3ZlcmxheV9h cnJvd19iaXRtYXAgPSBtY19nZXRfbG9naWNhbF9mcmluZ2VfYml0bWFwICh3LCBRb3ZlcmxheV9h cnJvdywgMCwgMCk7CisgICAgICBpZiAocm93LT5vdmVybGF5X2Fycm93X2JpdG1hcCAhPSBjdXIt Pm92ZXJsYXlfYXJyb3dfYml0bWFwKQorICAgICAgICB7CisgICAgICAgICAgcmVkcmF3X3AgPSAx LCByb3ctPnJlZHJhd19mcmluZ2VfYml0bWFwc19wID0gMTsKKyAgICAgICAgICBpZiAoIWtlZXBf Y3VycmVudF9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBjdXItPnJlZHJhd19mcmlu Z2VfYml0bWFwc19wID0gMTsKKyAgICAgICAgICAgICAgY3VyLT5vdmVybGF5X2Fycm93X2JpdG1h cCA9IHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXA7CisgICAgICAgICAgICB9CisgICAgICAgIH0K KyAgICAgIGlmIChtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUAor ICAgICAgICAgIHx8IG1jX3JpZ2h0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1B UCkKKyAgICAgICAgcm93LT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3AgPSBmYWxzZTsKKyAgICAg ICAgZWxzZQorICAgICAgICAgIHJvdy0+ZnJpbmdlX2JpdG1hcF9wZXJpb2RpY19wID0gcGVyaW9k aWNfcDsKKyAgICAgIGlmIChtY19sZWZ0X2ZyaW5nZV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ZV9pZCA9IERFRkFVTFRfRkFDRV9JRDsKKyAgaW50IG9mZnNldCwgaGVh ZGVyX2xpbmVfaGVpZ2h0OworICBwLm92ZXJsYXlfcCA9IChvdmVybGF5ICYgMSkgPT0gMTsKKyAg cC5jdXJzb3JfcCA9IChvdmVybGF5ICYgMikgPT0gMjsKKyAgaWYgKHdoaWNoICE9IE1DX05PX0ZS SU5HRV9CSVRNQVApCisgICAgeworICAgICAgb2Zmc2V0ID0gMDsKKyAgICB9CisgICAgZWxzZSBp ZiAobGVmdF9wKQorICAgICAgeworICAgICAgICB3aGljaCA9IHJvdy0+bGVmdF9mcmluZ2VfYml0 bWFwOworICAgICAgICBmYWNlX2lkID0gcm93LT5sZWZ0X2ZyaW5nZV9mYWNlX2lkOworICAgICAg ICBvZmZzZXQgPSByb3ctPmxlZnRfZnJpbmdlX29mZnNldDsKKyAgICAgIH0KKyAgICAgIGVsc2UK KyAgICAgICAgeworICAgICAgICAgIHdoaWNoID0gcm93LT5yaWdodF9mcmluZ2VfYml0bWFwOwor ICAgICAgICAgIGZhY2VfaWQgPSByb3ctPnJpZ2h0X2ZyaW5nZV9mYWNlX2lkOworICAgICAgICAg IG9mZnNldCA9IHJvdy0+cmlnaHRfZnJpbmdlX29mZnNldDsKKyAgICAgICAgfQorICBpZiAoZmFj ZV9pZCA9PSBERUZBVUxUX0ZBQ0VfSUQpCisgICAgeworICAgICAgTGlzcF9PYmplY3QgZmFjZSA9 IGZyaW5nZV9mYWNlc1t3aGljaF07CisgICAgICBmYWNlX2lkID0gTklMUCAoZmFjZSkgPyBsb29r dXBfbmFtZWRfZmFjZSAodywgZiwgUWZyaW5nZSwgZmFsc2UpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOiBsb29rdXBfZGVyaXZlZF9mYWNlICh3LCBmLCBmYWNlLCBGUklOR0VfRkFDRV9J RCwgMCk7CisgICAgICBpZiAoZmFjZV9pZCA8IDApCisgICAgICAgIGZhY2VfaWQgPSBGUklOR0Vf RkFDRV9JRDsKKyAgICB9CisgIGZiID0gZ2V0X2ZyaW5nZV9iaXRtYXBfZGF0YSAod2hpY2gpOwor ICBwZXJpb2QgPSBmYi0+cGVyaW9kOworICAvKiBDb252ZXJ0IHJvdyB0byBmcmFtZSBjb29yZGlu YXRlcy4gICovCisgIHAueSA9IFdJTkRPV19UT19GUkFNRV9QSVhFTF9ZICh3LCByb3ctPnkpICsg b2Zmc2V0OworICBwLndoaWNoID0gd2hpY2g7CisgIHAuYml0cyA9IGZiLT5iaXRzOworICBwLndk ID0gZmItPndpZHRoOworICBwLmggPSBmYi0+aGVpZ2h0OworICBwLmRoID0gKHBlcmlvZCA+IDAg PyAocC55ICUgcGVyaW9kKSA6IDApOworICBwLmggLT0gcC5kaDsKKyAgLyogQWRqdXN0IHkgdG8g dGhlIG9mZnNldCBpbiB0aGUgcm93IHRvIHN0YXJ0IGRyYXdpbmcgdGhlIGJpdG1hcC4gICovCisg IHN3aXRjaCAoZmItPmFsaWduKQorICAgIHsKKyAgICBjYXNlIEFMSUdOX0JJVE1BUF9DRU5URVI6 CisgICAgICBwLnkgKz0gKHJvdy0+aGVpZ2h0IC0gcC5oKSAvIDI7CisgICAgICBicmVhazsKKyAg ICBjYXNlIEFMSUdOX0JJVE1BUF9CT1RUT006CisgICAgICBwLnkgKz0gKHJvdy0+dmlzaWJsZV9o ZWlnaHQgLSBwLmgpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBBTElHTl9CSVRNQVBfVE9QOgor ICAgICAgYnJlYWs7CisgICAgfQorICBwLmZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGZhY2VfaWQp OworICBpZiAocC5mYWNlID09IE5VTEwpCisgICAgeworICAgICAgLyogVGhpcyBjb3VsZCBoYXBw ZW4gYWZ0ZXIgY2xlYXJpbmcgZmFjZSBjYWNoZS4KKyAgIEJ1dCBpdCBzaG91bGRuJ3QgaGFwcGVu IGFueW1vcmUuICArK2tmcyAqLworICAgICAgcmV0dXJuOworICAgIH0KKyAgcHJlcGFyZV9mYWNl X2Zvcl9kaXNwbGF5IChmLCBwLmZhY2UpOworICAvKiBDbGVhciBsZWZ0IGZyaW5nZSBpZiBubyBi aXRtYXAgdG8gZHJhdyBvciBpZiBiaXRtYXAgZG9lc24ndCBmaWxsCisgICAgIHRoZSBmcmluZ2Uu ICAqLworICBwLmJ4ID0gLTE7CisgIGhlYWRlcl9saW5lX2hlaWdodCA9IFdJTkRPV19IRUFERVJf TElORV9IRUlHSFQgKHcpOworICBwLmJ5ID0gV0lORE9XX1RPX0ZSQU1FX1BJWEVMX1kgKHcsIG1h eCAoaGVhZGVyX2xpbmVfaGVpZ2h0LCByb3ctPnkpKTsKKyAgcC5ueSA9IHJvdy0+dmlzaWJsZV9o ZWlnaHQ7CisgIGlmIChsZWZ0X3ApCisgICAgeworICAgICAgaW50IHdkID0gV0lORE9XX0xFRlRf RlJJTkdFX1dJRFRIICh3KTsKKyAgICAgIGludCB4ID0gd2luZG93X2JveF9sZWZ0ICh3LCAoV0lO RE9XX0hBU19GUklOR0VTX09VVFNJREVfTUFSR0lOUyAodykKKyAgICAgICAgICAgPyBMRUZUX01B UkdJTl9BUkVBCisgICAgICAgICAgIDogVEVYVF9BUkVBKSk7CisgICAgICBpZiAocC53ZCA+IHdk KQorICAgICAgICBwLndkID0gd2Q7CisgICAgICBwLnggPSB4IC0gcC53ZCAtICh3ZCAtIHAud2Qp IC8gMjsKKyAgICAgIGlmIChwLndkIDwgd2QgfHwgcC55ID4gcC5ieSB8fCBwLnkgKyBwLmggPCBw LmJ5ICsgcC5ueSkKKyAgICAgICAgeworICAgICAgICAgIC8qIElmIFcgaGFzIGEgdmVydGljYWwg Ym9yZGVyIHRvIGl0cyBsZWZ0LCBkb24ndCBkcmF3IG92ZXIgaXQuICAqLworICAgICAgICAgIHdk IC09ICgoIVdJTkRPV19MRUZUTU9TVF9QICh3KQorICAgICAgICAgICAgLyogVGhpcyBjb3VsZCBi ZSB3cm9uZyB3aGVuIHdlIGFsbG93IHdpbmRvdyBsb2NhbAorICAgICAgICAgICAgICAgcmlnaHQg ZGl2aWRlcnMgLSBidXQgdGhlIHdpbmRvdyBvbiB0aGUgbGVmdCBpcyBoYXJkCisgICAgICAgICAg ICAgICB0byBnZXQuICAqLworICAgICAgICAgICAgJiYgIUZSQU1FX1JJR0hUX0RJVklERVJfV0lE VEggKGYpCisgICAgICAgICAgICAmJiAhV0lORE9XX0hBU19WRVJUSUNBTF9TQ1JPTExfQkFSICh3 KQorICAgICAgICAgICAgLyogQnV0IGRvbid0IHJlZHVjZSB0aGUgZnJpbmdlIHdpZHRoIGlmIHRo ZSB3aW5kb3cKKyAgICAgICAgICAgICAgIGhhcyBhIGxlZnQgbWFyZ2luLCBiZWNhdXNlIHRoYXQg bWVhbnMgd2UgYXJlIG5vdAorICAgICAgICAgICAgICAgaW4gZGFuZ2VyIG9mIGRyYXdpbmcgb3Zl ciB0aGUgdmVydGljYWwgYm9yZGVyLAorICAgICAgICAgICAgICAgYW5kIE9UT0ggbGVhdmluZyBv dXQgdGhhdCBvbmUgcGl4ZWwgbGVhdmVzIGJlaGluZAorICAgICAgICAgICAgICAgdHJhY2VzIG9m IHRoZSBjdXJzb3IsIGlmIGl0IHdhcyBpbiBjb2x1bW4gemVybworICAgICAgICAgICAgICAgYmVm b3JlIGRyYXdpbmcgbm9uLWVtcHR5IG1hcmdpbiBhcmVhLiAgKi8KKyAgICAgICAgICAgICYmIHct PmxlZnRfbWFyZ2luX2NvbHMgPT0gMCkKKyAgICAgICAgICAgPyAxIDogMCk7CisgICAgICAgICAg cC5ieCA9IHggLSB3ZDsKKyAgICAgICAgICBwLm54ID0gd2Q7CisgICAgICAgIH0KKyAgICB9Cisg IGVsc2UKKyAgICB7CisgICAgICBpbnQgeCA9IHdpbmRvd19ib3hfcmlnaHQgKHcsCisgICAgICAg IChXSU5ET1dfSEFTX0ZSSU5HRVNfT1VUU0lERV9NQVJHSU5TICh3KQorICAgICAgICAgPyBSSUdI VF9NQVJHSU5fQVJFQQorICAgICAgICAgOiBURVhUX0FSRUEpKTsKKyAgICAgIGludCB3ZCA9IFdJ TkRPV19SSUdIVF9GUklOR0VfV0lEVEggKHcpOworICAgICAgaWYgKHAud2QgPiB3ZCkKKyAgICAg ICAgcC53ZCA9IHdkOworICAgICAgcC54ID0geCArICh3ZCAtIHAud2QpIC8gMjsKKyAgICAgIC8q IENsZWFyIHJpZ2h0IGZyaW5nZSBpZiBubyBiaXRtYXAgdG8gZHJhdyBvZiBpZiBiaXRtYXAgZG9l c24ndCBmaWxsCisgICB0aGUgZnJpbmdlLiAgKi8KKyAgICAgIGlmIChwLndkIDwgd2QgfHwgcC55 ID4gcC5ieSB8fCBwLnkgKyBwLmggPCBwLmJ5ICsgcC5ueSkKKyAgICAgICAgeworICAgICAgICAg IHAuYnggPSB4OworICAgICAgICAgIHAubnggPSB3ZDsKKyAgICAgICAgfQorICAgIH0KKyAgaWYg KHAueCA+PSBXSU5ET1dfQk9YX0xFRlRfRURHRV9YICh3KQorICAgICAgJiYgKHAueCArIHAud2Qp IDw9IFdJTkRPV19CT1hfTEVGVF9FREdFX1ggKHcpICsgV0lORE9XX1BJWEVMX1dJRFRIICh3KSkK KyAgICBGUkFNRV9SSUYgKGYpLT5kcmF3X2ZyaW5nZV9iaXRtYXAgKHcsIHJvdywgJnApOworfQor Cit2b2lkCittY19kcmF3X2ZyaW5nZV9iaXRtYXAgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBn bHlwaF9yb3cgKnJvdywgaW50IGxlZnRfcCwgZW51bSB0eXBlX29mX2N1cnNvciBjdXJzb3JfdHlw ZSkKK3sKKyAgaW50IG92ZXJsYXkgPSAwOworICBpZiAobGVmdF9wID09IHJvdy0+cmV2ZXJzZWRf cCAmJiByb3ctPmN1cnNvcl9pbl9mcmluZ2VfcCkKKyAgICB7CisgICAgICBMaXNwX09iamVjdCBj dXJzb3IgPSBRbmlsOworICAgICAgc3dpdGNoIChjdXJzb3JfdHlwZSkKKyAgICAgICAgeworICAg ICAgICBjYXNlIE1DX0ZSQU1FRF9CT1g6CisgICAgICAgICAgaWYgKHJvdy0+dmlzaWJsZV9oZWln aHQgPj0gU1RBTkRBUkRfQklUTUFQX0hFSUdIVCAoaG9sbG93X3JlY3RhbmdsZV9iaXRzKSkKKyAg ICAgICAgICAgIGN1cnNvciA9IFFob2xsb3c7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAg Y3Vyc29yID0gUWhvbGxvd19zbWFsbDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBN Q19IT0xMT1dfQk9YOgorICAgICAgICAgIGlmIChyb3ctPnZpc2libGVfaGVpZ2h0ID49IFNUQU5E QVJEX0JJVE1BUF9IRUlHSFQgKGhvbGxvd19yZWN0YW5nbGVfYml0cykpCisgICAgICAgICAgICBj dXJzb3IgPSBRaG9sbG93OworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGN1cnNvciA9IFFo b2xsb3dfc21hbGw7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTUNfRklMTEVEX0JP WDoKKyAgICAgICAgICBjdXJzb3IgPSBRYm94OworICAgICAgICAgIGJyZWFrOworICAgICAgICBj YXNlIE1DX0JBUjoKKyAgICAgICAgICBjdXJzb3IgPSBRYmFyOworICAgICAgICAgIGJyZWFrOwor ICAgICAgICBjYXNlIE1DX0hCQVI6CisgICAgICAgICAgY3Vyc29yID0gUWhiYXI7CisgICAgICAg ICAgYnJlYWs7CisgICAgICAgIGNhc2UgTUNfTk9fRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgY2Fz ZSBNQ19OT19DVVJTT1I6CisgICAgICAgIGNhc2UgTUNfUklHSFRfRlJJTkdFX0JJVE1BUDoKKyAg ICAgICAgY2FzZSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGRlZmF1bHQ6CisgICAg ICAgICAgdy0+cGh5c19jdXJzb3Jfb25fcCA9IDA7CisgICAgICAgICAgcm93LT5jdXJzb3JfaW5f ZnJpbmdlX3AgPSAwOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBpZiAoIU5J TFAgKGN1cnNvcikpCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgYm0gPSBtY19nZXRfbG9naWNh bF9jdXJzb3JfYml0bWFwICh3LCBjdXJzb3IpOworICAgICAgICAgIGlmIChibSAhPSBNQ19OT19G UklOR0VfQklUTUFQKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19kcmF3X2ZyaW5n ZV9iaXRtYXBfMSAodywgcm93LCBsZWZ0X3AsIDIsIGJtKTsKKyAgICAgICAgICAgICAgb3Zlcmxh eSA9IEVRIChjdXJzb3IsIFFib3gpID8gMyA6IDE7CisgICAgICAgICAgICB9CisgICAgICAgIH0K KyAgICB9CisgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcF8xICh3LCByb3csIGxlZnRfcCwgb3Zlcmxh eSwgTUNfTk9fRlJJTkdFX0JJVE1BUCk7CisgIGlmIChsZWZ0X3AgJiYgcm93LT5vdmVybGF5X2Fy cm93X2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgIG1jX2RyYXdfZnJpbmdlX2Jp dG1hcF8xICh3LCByb3csIDEsIDEsIHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXApOworfQorCisv KiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog I2RlZmluZSBOT19GUklOR0VfQklUTUFQIDAKICNkZWZpbmUgVU5ERUZfRlJJTkdFX0JJVE1BUCAx CiAjZGVmaW5lIE1BWF9TVEFOREFSRF9GUklOR0VfQklUTUFQUyBBUlJBWUVMVFMgKHN0YW5kYXJk X2JpdG1hcHMpCkBAIC0xNzAwLDYgKzMxOTAsMTY4IEBAIFJldHVybiBuaWwgaWYgUE9TIGlzIG5v dC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vKiA0OCAqLworICBERUZTWU0gKFFtY19xdWFkcnVw bGVfYW5nbGVfZG93biwgIistcXVhZHJ1cGxlLWFuZ2xlLWRvd24iKTsKKyAgVmZyaW5nZV9iaXRt YXBzID0gRmNvbnMgKFFtY19xdWFkcnVwbGVfYW5nbGVfZG93biwgVmZyaW5nZV9iaXRtYXBzKTsK KyAgRnB1dCAoUW1jX3F1YWRydXBsZV9hbmdsZV9kb3duLCBRZnJpbmdlLCBtYWtlX2ZpeG51bSAo NDgpKTsKKyAgLyogKGdldCAnKy1xdWFkcnVwbGUtYW5nbGUtZG93biAnZnJpbmdlKSA9PiA0OCAq LworCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogICBERUZTWU0gKFF0cnVuY2F0aW9uLCAidHJ1bmNhdGlvbiIpOwogICBERUZTWU0gKFFj b250aW51YXRpb24sICJjb250aW51YXRpb24iKTsKICAgREVGU1lNIChRb3ZlcmxheV9hcnJvdywg Im92ZXJsYXktYXJyb3ciKTsKZGlmZiAtLWdpdCBhL3NyYy9uc3Rlcm0uaCBiL3NyYy9uc3Rlcm0u aAppbmRleCA3OGNlNjA4Li44ZWYwZGZlIDEwMDY0NAotLS0gYS9zcmMvbnN0ZXJtLmgKKysrIGIv c3JjL25zdGVybS5oCkBAIC02NjAsNiArNjYwLDE2IEBAIHR5cGVkZWYgaWQgaW5zdGFuY2V0eXBl OwogCiBAaW50ZXJmYWNlIEVtYWNzU2Nyb2xsZXIgOiBOU1Njcm9sbGVyCiAgIHsKKworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIE5TUmVj dCBtY19yZWN0YW5nbGU7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgIHN0cnVj dCB3aW5kb3cgKndpbmRvdzsKICAgIHN0cnVjdCBmcmFtZSAqZnJhbWU7CiAgICBOU1Jlc3BvbmRl ciAqcHJldlJlc3BvbmRlcjsKQEAgLTY4MCw2ICs2OTAsMTggQEAgdHlwZWRlZiBpZCBpbnN0YW5j ZXR5cGU7CiAgICBpbnQgZW1fd2hvbGU7CiAgICB9CiAKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy0gKHZvaWQpbWNfc2V0X3JlY3RhbmdsZTog KE5TUmVjdClyZWN0OworLSAoTlNSZWN0KW1jX2dldF9yZWN0YW5nbGU7CistIChzdHJ1Y3Qgd2lu ZG93ICopbWNfZ2V0X3dpbmRvdzsKKy0gKGJvb2wpbWNfanVkZ2U7CisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKIC0gKGluc3RhbmNldHlwZSkgaW5pdEZyYW1lOiAoTlNSZWN0IClyIHdp bmRvdzogKExpc3BfT2JqZWN0KXdpbjsKIC0gKHZvaWQpc2V0RnJhbWU6IChOU1JlY3QpcjsKIApk aWZmIC0tZ2l0IGEvc3JjL25zdGVybS5tIGIvc3JjL25zdGVybS5tCmluZGV4IDgxZDM2YmUuLmEw MWZiOTMgMTAwNjQ0Ci0tLSBhL3NyYy9uc3Rlcm0ubQorKysgYi9zcmMvbnN0ZXJtLm0KQEAgLTc2 LDYgKzc2LDEwOTEgQEAgVXBkYXRlZCBieSBDaHJpc3RpYW4gTGltcGFjaCAoY2hyaXNAbmljZS5j aCkKIHN0YXRpYyBFbWFjc01lbnUg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ha2UgaW50byBjb25z aWRlcmF0aW9uIGByb3ctPmNsaXBgIGlmIGl0IHdhcyBzZXQgYnkgYGV4cG9zZV93aW5kb3cnLgor ICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KK3sKKyAgTlNUUkFDRV9XSEVOIChOU1RSQUNFX0dST1VQ X0ZPQ1VTLCAibWNfbnNfY2xpcF90b19yZWN0Iik7CisgIGlmIChyKQorICAgIHsKKyAgICAgIE5T VFJBQ0VfUkVDVCAoInIiLCAqcik7CisgICAgICBpZiAoW05TVmlldyBmb2N1c1ZpZXddID09IEZS QU1FX05TX1ZJRVcgKGYpKQorICAgICAgICB7CisgICAgICAgICAgW1tOU0dyYXBoaWNzQ29udGV4 dCBjdXJyZW50Q29udGV4dF0gc2F2ZUdyYXBoaWNzU3RhdGVdOworICAgICAgICAgIGlmIChuID09 IDIpCisgICAgICAgICAgICBOU1JlY3RDbGlwTGlzdCAociwgMik7CisgICAgICAgICAgICBlbHNl CisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAocm93LT5jbGlwICE9IE5VTEwp CisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIE5TUmVjdCByX2NsaXA7 CisgICAgICAgICAgICAgICAgICAgIHJfY2xpcC5vcmlnaW4ueCA9IHJvdy0+Y2xpcC0+eDsKKyAg ICAgICAgICAgICAgICAgICAgcl9jbGlwLm9yaWdpbi55ID0gcm93LT5jbGlwLT55OworICAgICAg ICAgICAgICAgICAgICByX2NsaXAuc2l6ZS53aWR0aCA9IHJvdy0+Y2xpcC0+d2lkdGg7CisgICAg ICAgICAgICAgICAgICAgIHJfY2xpcC5zaXplLmhlaWdodCA9IHJvdy0+Y2xpcC0+aGVpZ2h0Owor ICAgICAgICAgICAgICAgICAgICBOU1JlY3Qgcl9zYXZlOworICAgICAgICAgICAgICAgICAgICBy X3NhdmUub3JpZ2luLnggPSByWzBdLm9yaWdpbi54OworICAgICAgICAgICAgICAgICAgICByX3Nh dmUub3JpZ2luLnkgPSByWzBdLm9yaWdpbi55OworICAgICAgICAgICAgICAgICAgICByX3NhdmUu c2l6ZS53aWR0aCA9IHJbMF0uc2l6ZS53aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgcl9zYXZl LnNpemUuaGVpZ2h0ID0gclswXS5zaXplLmhlaWdodDsKKyAgICAgICAgICAgICAgICAgICAgbWNf bnNfaW50ZXJzZWN0X3JlY3RhbmdsZXMgKCZyX3NhdmUsICZyX2NsaXAsICZyWzBdKTsKKyAgICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBOU1JlY3RDbGlwICgqcik7CisgICAgICAg ICAgICAgIH0KKyAgICAgICAgICByZXR1cm4gWUVTOworICAgICAgICB9CisgICAgICBlbHNlCisg ICAgICAgIHsKKyAgICAgICAgICBOU1ZpZXcgKnZpZXcgPSBGUkFNRV9OU19WSUVXIChmKTsKKyAg ICAgICAgICBpbnQgaTsKKyAgICAgICAgICBmb3IgKGkgPSAwIDsgaSA8IG4gOyBpKyspCisgICAg ICAgICAgICBbdmlldyBzZXROZWVkc0Rpc3BsYXlJblJlY3Q6cltpXV07CisgICAgICAgIH0KKyAg ICB9CisgIHJldHVybiBOTzsKK30KKworc3RhdGljIHZvaWQKK21jX25zX2RyYXdfd2luZG93X2N1 cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1 Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICBpbnQgeCwgaW50IGZ4LCBpbnQg eSwgaW50IGZ5LCBpbnQgaHBvcywgaW50IHZwb3MsIGludCB3ZCwgaW50IGgsCisgICAgICAgICAg ICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbCwgZW51bSB0eXBlX29mX2N1cnNvciBjdXJzb3JfdH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ChiYWNrZ3JvdW5kKSA6ICJOSUxQIikpOworICAtICBFWEFN UExFIE9GIEhPVyBUTyBDUkVBVEUgQSBDT0xPUiBXSVRIIFJHQi9MU0wgZmxvYXQgdmFsdWVzOgor ICAgICBOU0NvbG9yICpteV9jb2xvciA9IFtOU0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6 IDEuMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg Z3JlZW46IDEuMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGJsdWU6IDEuMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgYWxwaGE6IDEuMF07CisgIC0gIEFMVEVSTkFUSVZFIEVYQU1QTEU6CisgICAg IGVudW0gZmFjZV9pZCBkZWJ1Z2dpbmdfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlIChzLT53 LCBzLT5mLCBpbnRlcm4gKCIrLWRlYnVnZ2luZy1mYWNlIiksIHRydWUpOworICAgICBzdHJ1Y3Qg ZmFjZSAqZGVidWdnaW5nX2ZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIGRlYnVnZ2luZ19mYWNl X2lkKTsKKyAgICAgTlNDb2xvciAqY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNf RkFDRV9GT1JFR1JPVU5EIChkZWJ1Z2dpbmdfZmFjZSksIHMtPmYpOworICAgICBbY29sb3Igc2V0 XTsgKi8KKyAgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSAorICAgICAgfHwgZ2x5cGhfZmxh dm9yID09IE1DX0dMWVBITEVTUykKKyAgICBbW05TQ29sb3IgY29sb3JXaXRoQ2FsaWJyYXRlZFJl ZDogbHNsLnJlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdyZWVuOiBsc2wuZ3Jl ZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmx1ZTogbHNsLmJsdWUKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBhbHBoYTogMS4wXSBzZXRdOworICAgIGVsc2UKKyAg ICAgIFtGUkFNRV9DVVJTT1JfQ09MT1IgKGYpIHNldF07CisgIGlmIChjdXJzb3JfdHlwZSA9PSBN Q19GUkFNRURfQk9YKQorICAgIHsKKyAgICAgIExpc3BfT2JqZWN0IGJ1ZiA9IHctPmNvbnRlbnRz OworICAgICAgQ0hFQ0tfQlVGRkVSIChidWYpOworICAgICAgc3RydWN0IGJ1ZmZlciAqYiA9IFhC VUZGRVIgKGJ1Zik7CisgICAgICBib29sIHJlZ2lvbl9hY3RpdmVfcCA9ICghTklMUCAoVnRyYW5z aWVudF9tYXJrX21vZGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAo QlZBUiAoYiwgbWFya19hY3RpdmUpKSk7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2JlZ2lubmlu ZyA9IChyZWdpb25fYWN0aXZlX3ApID8gWEZJWE5VTSAoRnJlZ2lvbl9iZWdpbm5pbmcgKCkpIDog LTE7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2VuZCA9IChyZWdpb25fYWN0aXZlX3ApID8gWEZJ WE5VTSAoRnJlZ2lvbl9lbmQgKCkpIDogLTE7CisgICAgICBwdHJkaWZmX3Qgb3BvaW50X3B0ID0g KHcgPT0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93KSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IFBUCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBYRklYTlVNIChGbWFya2Vy X3Bvc2l0aW9uICh3LT5wb2ludG0pKTsKKyAgICAgIGJvb2wgcmVnaW9uX2luX2JvdW5kc19wID0g KHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3Bv aW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Vyc29yLXJlZ2lvbi1mYWNlIiksIHRy dWUpOworICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfcmVnaW9uX291dF9m YWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9vdXRfZmFjZV9pZCk7 CisgICAgICAgICAgICBOU0NvbG9yICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9vdXRfY29sb3IgPSBu c19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChob2xsb3dfYWN0aXZl X3JlZ2lvbl9vdXRfZmFjZSksIGYpOworICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9sbG93 X2FjdGl2ZV9yZWdpb25fb3V0X2NvbG9yOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlm ICghcmVnaW9uX2FjdGl2ZV9wICYmIGFjdGl2ZV9wKQorICAgICAgICAgICAgeworICAgICAgICAg ICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2Zh Y2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1mYWNlIiksIHRydWUpOworICAg ICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lE IChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICBOU0NvbG9yICpob2xs b3dfYWN0aXZlX2NvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfQkFDS0dS T1VORCAoaG9sbG93X2FjdGl2ZV9mYWNlKSwgZik7CisgICAgICAgICAgICAgIGhvbGxvd19jb2xv ciA9IGhvbGxvd19hY3RpdmVfY29sb3I7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvKiBU aGUgcmVnaW9uIGlzIF9ub3RfIHZpc2libGUgaW4gdGhlIGluYWN0aXZlIHdpbmRvdyBiZWNhdXNl IHRoZSBvdmVybGF5IHdpbmRvdyBwcm9wZXJ0eSBpcyB1c2VkLiAqLworICAgICAgICAgICAgZWxz ZSBpZiAoIWFjdGl2ZV9wKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZW51bSBm YWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYs IGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1mYWNlIiksIHRydWUpOworICAg ICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9IEZBQ0VfRlJP TV9JRCAoZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgIE5TQ29s b3IgKmhvbGxvd19pbmFjdGl2ZV9jb2xvciA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19G QUNFX0JBQ0tHUk9VTkQgKGhvbGxvd19pbmFjdGl2ZV9mYWNlKSwgZik7CisgICAgICAgICAgICAg ICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2luYWN0aXZlX2NvbG9yOworICAgICAgICAgICAgICB9 CisgICAgfQorICAgIGVsc2UgaWYgKGZhY2UgJiYgTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKSA9 PSBuc19pbmRleF9jb2xvciAoRlJBTUVfQ1VSU09SX0NPTE9SIChmKSwgZikpCisgICAgICB7Cisg ICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChmYWNl KSwgZikgc2V0XTsKKyAgICAgICAgaG9sbG93X2NvbG9yID0gRlJBTUVfQ1VSU09SX0NPTE9SIChm KTsKKyAgICAgIH0KKyNpZmRlZiBOU19JTVBMX0NPQ09BCisgIE5TRGlzYWJsZVNjcmVlblVwZGF0 ZXMgKCk7CisjZW5kaWYKKyAgc3dpdGNoIChjdXJzb3JfdHlwZSkKKyAgICB7CisgICAgICBjYXNl IE1DX05PX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19OT19D VVJTT1I6CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19SSUdIVF9GUklOR0VfQklUTUFQ OgorICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfTEVGVF9GUklOR0VfQklUTUFQOgorICAg ICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAgICAgICAgTlNSZWN0Rmls bCAocik7CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19GUkFNRURfQk9YOgorICAgICAg ICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgW2hvbGxvd19jb2xvciBzZXRdOworICAgICAgICBO U1JlY3RGaWxsIChOU0luc2V0UmVjdCAociwgMSwgMSkpOworICAgICAgICBbRlJBTUVfQ1VSU09S X0NPTE9SIChmKSBzZXRdOworICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfSE9MTE9XX0JP WDoKKyAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgIFtob2xsb3dfY29sb3Igc2V0XTsK KyAgICAgICAgTlNSZWN0RmlsbCAoTlNJbnNldFJlY3QgKHIsIDEsIDEpKTsKKyAgICAgICAgW0ZS QU1FX0NVUlNPUl9DT0xPUiAoZikgc2V0XTsKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1D X0hCQVI6CisgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICBicmVhazsKKyAgICAgIGNh c2UgTUNfQkFSOgorICAgICAgICBzID0gcjsKKyAgICAgICAgLyogQGxhd2xpc3QgaXMgZm9jdXNp bmcgdGhlIGluaXRpYWwgZGV2ZWxvcG1lbnQgb2YgZmVhdHVyZSByZXF1ZXN0cworICAgICAgICAj MTc2ODQgYW5kICMyMjg3MyBvbiBMMlIgbGFuZ3VhZ2VzLiAqLworICAgICAgICBpZiAoZ2x5cGhf Zmxhdm9yICE9IE1DX0dMWVBICisgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfR0xZ UEhMRVNTKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIC8qIElmIHRoZSBjaGFyYWN0ZXIgdW5k ZXIgY3Vyc29yIGlzIFIyTCwgZHJhdyB0aGUgYmFyIGN1cnNvcgorICAgICAgICAgICAgICAgb24g dGhlIHJpZ2h0IG9mIGl0cyBnbHlwaCwgcmF0aGVyIHRoYW4gb24gdGhlIGxlZnQuICAqLworICAg ICAgICAgICAgaWYgKChjdXJzb3JfZ2x5cGgtPnJlc29sdmVkX2xldmVsICYgMSkgIT0gMCkKKyAg ICAgICAgICAgICAgcy5vcmlnaW4ueCArPSBjdXJzb3JfZ2x5cGgtPnBpeGVsX3dpZHRoIC0gcy5z aXplLndpZHRoOworICAgICAgICAgIH0KKyAgICAgICAgTlNSZWN0RmlsbCAocyk7CisgICAgICAg IGJyZWFrOworICAgIH0KKyAgbnNfcmVzZXRfY2xpcHBpbmcgKGYpOworICAvKiBkcmF3IHRoZSBj aGFyYWN0ZXIgdW5kZXIgdGhlIGN1cnNvciAqLworICBpZiAoZ2x5cGhfZmxhdm9yICE9IE1DX0dM WVBITEVTUworICAgICAgJiYgKGN1cnNvcl90eXBlID09IE1DX0ZSQU1FRF9CT1gKKyAgICAgICAg ICB8fCBjdXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9YCisgICAgICAgICAgfHwgY3Vyc29yX3R5 cGUgPT0gTUNfSE9MTE9XX0JPWAorICAgICAgICAgIHx8IChkZWJ1Z19wCisgICAgICAgICAgICAg ICYmIGN1cnNvcl90eXBlID09IE1DX0hCQVIpCisgICAgICAgICAgfHwgKGRlYnVnX3AKKyAgICAg ICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gTUNfQkFSKSkpCisgIC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5lX3Ap CisgICAgeworICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJf V0FWRSkKKyAgICAgICAgeworICAgICAgICAgIGlmIChmYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVk X3ApCisgICAgICAgICAgICBbZGVmYXVsdENvbCBzZXRdOworICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoZmFjZS0+dW5kZXJsaW5lX2NvbG9yLCBz LT5mKSBzZXRdOworICAgICAgICAgIG5zX2RyYXdfdW5kZXJ3YXZlIChzLCB3aWR0aCwgeCk7Cisg ICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0Vf VU5ERVJfTElORSkKKyAgICAgICAgeworICAgICAgICAgIE5TUmVjdCByOworICAgICAgICAgIHVu c2lnbmVkIGxvbmcgdGhpY2tuZXNzLCBwb3NpdGlvbjsKKyAgICAgICAgICAvKiBJZiB0aGUgcHJl diB3YXMgdW5kZXJsaW5lZCwgbWF0Y2ggaXRzIGFwcGVhcmFuY2UuICovCisgICAgICAgICAgaWYg KHMtPnByZXYgJiYgcy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3AKKyAgICAgICAgICAgICAgJiYg cy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FCisgICAgICAg ICAgICAgICYmIHMtPnByZXYtPnVuZGVybGluZV90aGlja25lc3MgPiAwKQorICAgICAgICAgICAg eworICAgICAgICAgICAgICB0aGlja25lc3MgPSBzLT5wcmV2LT51bmRlcmxpbmVfdGhpY2tuZXNz OworICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPnByZXYtPnVuZGVybGluZV9wb3NpdGlvbjsK KyAgICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIHN0cnVjdCBmb250ICpmb250OworICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIGRlc2Nl bnQ7CisgICAgICAgICAgICAgIGZvbnQ9cy0+Zm9udDsKKyAgICAgICAgICAgICAgZGVzY2VudCA9 IHMtPnkgKyBzLT5oZWlnaHQgLSBzLT55YmFzZTsKKyAgICAgICAgICAgICAgLyogVXNlIHVuZGVy bGluZSB0aGlja25lc3Mgb2YgZm9udCwgZGVmYXVsdGluZyB0byAxLiAqLworICAgICAgICAgICAg ICB0aGlja25lc3MgPSAoZm9udCAmJiBmb250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4gMCkKKyAg ICAgICAgICAgICAgICA/IGZvbnQtPnVuZGVybGluZV90aGlja25lc3MgOiAxOworICAgICAgICAg ICAgICAvKiBEZXRlcm1pbmUgdGhlIG9mZnNldCBvZiB1bmRlcmxpbmluZyBmcm9tIHRoZSBiYXNl bGluZS4gKi8KKyAgICAgICAgICAgICAgaWYgKHhfdW5kZXJsaW5lX2F0X2Rlc2NlbnRfbGluZSkK KyAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IGRlc2NlbnQgLSB0aGlja25lc3M7CisgICAgICAg ICAgICAgIGVsc2UgaWYgKHhfdXNlX3VuZGVybGluZV9wb3NpdGlvbl9wcm9wZXJ0aWVzCisgICAg ICAgICAgICAgICAgICAgICAgICYmIGZvbnQgJiYgZm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uID49 IDApCisgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBmb250LT51bmRlcmxpbmVfcG9zaXRpb247 CisgICAgICAgICAgICAgIGVsc2UgaWYgKGZvbnQpCisgICAgICAgICAgICAgICAgcG9zaXRpb24g PSBscm91bmQgKGZvbnQtPmRlc2NlbnQgLyAyKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICAgIHBvc2l0aW9uID0gdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0OworICAgICAgICAg ICAgICBwb3NpdGlvbiA9IG1heCAocG9zaXRpb24sIHVuZGVybGluZV9taW5pbXVtX29mZnNldCk7 CisgICAgICAgICAgICAgIC8qIEVuc3VyZSB1bmRlcmxpbmluZyBpcyBub3QgY3JvcHBlZC4gKi8K KyAgICAgICAgICAgICAgaWYgKGRlc2NlbnQgPD0gcG9zaXRpb24pCisgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBkZXNjZW50IC0gMTsKKyAgICAgICAgICAg ICAgICAgIHRoaWNrbmVzcyA9IDE7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBl bHNlIGlmIChkZXNjZW50IDwgcG9zaXRpb24gKyB0aGlja25lc3MpCisgICAgICAgICAgICAgICAg dGhpY2tuZXNzID0gMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBzLT51bmRlcmxpbmVfdGhp Y2tuZXNzID0gdGhpY2tuZXNzOworICAgICAgICAgIHMtPnVuZGVybGluZV9wb3NpdGlvbiA9IHBv c2l0aW9uOworICAgICAgICAgIHIgPSBOU01ha2VSZWN0ICh4LCBzLT55YmFzZSArIHBvc2l0aW9u LCB3aWR0aCwgdGhpY2tuZXNzKTsKKyAgICAgICAgICBpZiAoZmFjZS0+dW5kZXJsaW5lX2RlZmF1 bHRlZF9wKQorICAgICAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsKKyAgICAgICAgICBlbHNlCisg ICAgICAgICAgICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKGZhY2UtPnVuZGVybGluZV9jb2xv ciwgcy0+Zikgc2V0XTsKKyAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgfQorICAg IH0KKyAgLyogRG8gb3ZlcmxpbmUuIFdlIGZvbGxvdyBvdGhlciB0ZXJtcyBpbiB1c2luZyBhIHRo aWNrbmVzcyBvZiAxCisgICAgIGFuZCBpZ25vcmluZyBvdmVybGluZV9tYXJnaW4uICovCisgIGlm IChmYWNlLT5vdmVybGluZV9wKQorICAgIHsKKyAgICAgIE5TUmVjdCByOworICAgICAgciA9IE5T TWFrZVJlY3QgKHgsIHMtPnksIHdpZHRoLCAxKTsKKyAgICAgIGlmIChmYWNlLT5vdmVybGluZV9j b2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsKKyAgICAgIGVsc2UK KyAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChmYWNlLT5vdmVybGluZV9jb2xvciwg cy0+Zikgc2V0XTsKKyAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgIH0KKyAgLyogRG8gc3RyaWtl LXRocm91Z2guICBXZSBmb2xsb3cgb3RoZXIgdGVybXMgZm9yIHRoaWNrbmVzcyBhbmQKKyAgICAg dmVydGljYWwgcG9zaXRpb24uKi8KKyAgaWYgKGZhY2UtPnN0cmlrZV90aHJvdWdoX3ApCisgICAg eworICAgICAgTlNSZWN0IHI7CisgICAgICB1bnNpZ25lZCBsb25nIGR5OworICAgICAgZHkgPSBs cmludCAoKHMtPmhlaWdodCAtIDEpIC8gMik7CisgICAgICByID0gTlNNYWtlUmVjdCAoeCwgcy0+ eSArIGR5LCB3aWR0aCwgMSk7CisgICAgICBpZiAoZmFjZS0+c3RyaWtlX3Rocm91Z2hfY29sb3Jf ZGVmYXVsdGVkX3ApCisgICAgICAgIFtkZWZhdWx0Q29sIHNldF07CisgICAgICBlbHNlCisgICAg ICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoZmFjZS0+c3RyaWtlX3Rocm91Z2hfY29sb3Is IHMtPmYpIHNldF07CisgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICB9Cit9CisKK3N0YXRpYyB2 b2lkCittY19uc19kdW1wZ2x5cGhzX3N0cmV0Y2ggKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMsIGlu dCB3ZCwgc3RydWN0IGdseXBoX3JvdyAqcm93KQoreworICBOU1JlY3QgclsyXTsKKyAgaW50IG4s IGk7CisgIHN0cnVjdCBmYWNlICpmYWNlOworICBOU0NvbG9yICpmZ0NvbCwgKmJnQ29sOworICBp ZiAoIXMtPmJhY2tncm91bmRfZmlsbGVkX3ApCisgICAgeworICAgICAgbiA9IG5zX2dldF9nbHlw aF9zdHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAgICAgICpyID0gTlNNYWtlUmVjdCAocy0+eCwg cy0+eSwgcy0+YmFja2dyb3VuZF93aWR0aCwgcy0+aGVpZ2h0KTsKKyAgICAgIGlmICghbWNfbnNf Y2xpcF90b19yZWN0IChzLT5mLCByLCBuLCByb3cpKQorICAgICAgICByZXR1cm47CisgICAgICBp ZiAocy0+aGwgPT0gRFJBV19NT1VTRV9GQUNFKQorICAgICAgIHsKKyAgICAgICAgIGZhY2UgPSBG QUNFX0ZST01fSUQgKHMtPmYsIE1PVVNFX0hMX0lORk8gKHMtPmYpLT5tb3VzZV9mYWNlX2ZhY2Vf aWQpOworICAgICAgICAgaWYgKCFmYWNlKQorICAgICAgICAgICBmYWNlID0gRkFDRV9GUk9NX0lE IChzLT5mLCBNT1VTRV9GQUNFX0lEKTsKKyAgICAgICB9CisgICAgICBlbHNlCisgICAgICAgZmFj ZSA9IEZBQ0VfRlJPTV9JRCAocy0+Ziwgcy0+Zmlyc3RfZ2x5cGgtPmZhY2VfaWQpOworICAgICAg YmdDb2wgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNl KSwgcy0+Zik7CisgICAgICBmZ0NvbCA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNF X0ZPUkVHUk9VTkQgKGZhY2UpLCBzLT5mKTsKKyAgICAgIGZvciAoaSA9IDA7IGkgPCBuOyArK2kp CisgICAgICAgIHsKKyAgICAgICAgICBpZiAoIXMtPnJvdy0+ZnVsbF93aWR0aF9wKQorICAgICAg ICAgICAgeworICAgICAgICBpbnQgb3ZlcnJ1biwgbGVmdG92ZXJydW47CisgICAgICAgICAgICAg IC8qIHRydW5jYXRlIHRvIGF2b2lkIG92ZXJ3cml0aW5nIGZyaW5nZSBhbmQvb3Igc2Nyb2xsYmFy ICovCisgICAgICAgIG92ZXJydW4gPSBtYXggKDAsIChzLT54ICsgcy0+YmFja2dyb3VuZF93aWR0 aCkKKyAgICAgICAgICAgLSAoV0lORE9XX0JPWF9SSUdIVF9FREdFX1ggKHMtPncpCisgICAgICAg IC0gV0lORE9XX1JJR0hUX0ZSSU5HRV9XSURUSCAocy0+dykpKTsKKyAgICAgICAgICAgICAgcltp XS5zaXplLndpZHRoIC09IG92ZXJydW47CisgICAgICAgIC8qIHRydW5jYXRlIHRvIGF2b2lkIG92 ZXJ3cml0aW5nIHRvIGxlZnQgb2YgdGhlIHdpbmRvdyBib3ggKi8KKyAgICAgICAgbGVmdG92ZXJy dW4gPSAoV0lORE9XX0JPWF9MRUZUX0VER0VfWCAocy0+dykKKyAgICAgICAgICAgKyBXSU5ET1df TEVGVF9GUklOR0VfV0lEVEggKHMtPncpKSAtIHMtPng7CisgICAgICAgIGlmIChsZWZ0b3ZlcnJ1 biA+IDApCisgICAgICAgICAgeworICAgICAgICAgICAgcltpXS5vcmlnaW4ueCArPSBsZWZ0b3Zl cnJ1bjsKKyAgICAgICAgICAgIHJbaV0uc2l6ZS53aWR0aCAtPSBsZWZ0b3ZlcnJ1bjsKKyAgICAg ICAgICB9CisgICAgICAgICAgICAgIC8qIFhYWDogVHJ5IHRvIHdvcmsgYmV0d2VlbiBwcm9ibGVt IHdoZXJlIGEgc3RyZXRjaCBnbHlwaCBvbgorICAgICAgICAgICAgICAgICBhIHBhcnRpYWxseS12 aXNpYmxlIGJvdHRvbSByb3cgd2lsbCBjbGVhciBwYXJ0IG9mIHRoZQorICAgICAgICAgICAgICAg ICBtb2RlbGluZSwgYW5kIGFub3RoZXIgd2hlcmUgbGlzdC1idWZmZXJzIGhlYWRlcnMgYW5kIHNp bWlsYXIKKyAgICAgICAgICAgICAgIC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9 IGxvb2t1cF9uYW1lZF9mYWNlIChzLT53LCBzLT5mLCBpbnRlcm4gKCIrLWRlYnVnZ2luZy1mYWNl IiksIHRydWUpOworICAgICAgICAgICAgICAvLyAgc3RydWN0IGZhY2UgKmRlYnVnZ2luZ19mYWNl ID0gRkFDRV9GUk9NX0lEIChzLT5mLCBkZWJ1Z2dpbmdfZmFjZV9pZCk7CisgICAgICAgICAgICAg IC8vICBOU0NvbG9yICpjb2xvciA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZP UkVHUk9VTkQgKGRlYnVnZ2luZ19mYWNlKSwgcy0+Zik7CisgICAgICAgICAgICAgIC8vICBbY29s b3Igc2V0XTsKKyAgICAgICAgICAgICAgQ0dGbG9hdCB4ID0gcltpXS5vcmlnaW4ueDsKKyAgICAg ICAgICAgICAgQ0dGbG9hdCB3aWR0aCA9IHdkOworICAgICAgICAgICAgICByW2ldLnNpemUud2lk dGggLT0gd2lkdGg7CisgICAgICAgICAgICAgIHJbaV0ub3JpZ2luLnggKz0gd2lkdGg7CisgICAg ICAgICAgICAgIE5TUmVjdEZpbGwgKHJbaV0pOworICAgICAgICAgICAgICAvKiBEcmF3IG92ZXJs aW5pbmcsIGV0Yy4gb24gdGhlIGN1cnNvci4gKi8KKyAgICAgICAgICAgICAgaWYgKHMtPnctPnBo eXNfY3Vyc29yX3R5cGUgPT0gTUNfRklMTEVEX0JPWCkKKyAgICAgICAgICAgICAgICBtY19uc19k cmF3X3RleHRfZGVjb3JhdGlvbiAocywgZmFjZSwgYmdDb2wsIHdpZHRoLCB4KTsKKyAgICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBtY19uc19kcmF3X3RleHRfZGVjb3JhdGlv biAocywgZmFjZSwgZmdDb2wsIHdpZHRoLCB4KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBl bHNlCisgICAgICAgICAgICB7CisgIC8vICBpbnQgcnggPSByW2ldLm9yaWdpbi54OworICAvLyAg aW50IHJ5ID0gcltpXS5vcmlnaW4ueTsKKyAgLy8gIGludCBydyA9IHJbaV0uc2l6ZS53aWR0aDsK KyAgLy8gIGludCByaCA9IHJbaV0uc2l6ZS5oZWlnaHQ7CisgIC8vICBmcHJpbnRmIChzdGRlcnIs ICJtY19uc19kdW1wZ2x5cGhzX3N0cmV0Y2g6ICB2cG9zICglZCkgfCByeCAoJWQpIHwgcnkgKCVk KSB8IHJ3ICglZCkgfCByaCAoJWQpXG4iLAorICAvLyAgICAgICAgICAgICAgICAgICBzLT5maXJz dF9nbHlwaC0+dnBvcywgcngsIHJ5LCBydywgcmgpOworICAgICAgICAgICAgICBOU1JlY3RGaWxs IChyW2ldKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAvKiBEcmF3IG92ZXJsaW5pbmcsIGV0 Yy4gb24gdGhlIHN0cmV0Y2ggZ2x5cGggKG9yIHRoZSBwYXJ0CisgICAgICAgICAgICAgb2YgdGhl IHN0cmV0Y2ggZ2x5cGggYWZ0ZXIgdGhlIGN1cnNvcikuICovCisgICAgICAgICAgbWNfbnNfZHJh d190ZXh0X2RlY29yYXRpb24gKHMsIGZhY2UsIGZnQ29sLCByW2ldLnNpemUud2lkdGgsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJbaV0ub3JpZ2luLngpOworICAgICAg ICB9CisgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICBzLT5iYWNrZ3JvdW5k X2ZpbGxlZF9wID0gMTsKKyAgICB9Cit9CisKK3N0YXRpYyB2b2lkCittY19uc19kdW1wZ2x5cGhz X2ltYWdlIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzLCBOU1JlY3Qgciwgc3RydWN0IG1jX1JHQiBs c2wsCisgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3Is IGVudW0gdHlwZV9vZl9jdXJzb3IgY3Vyc29yX3R5cGUsCisgIC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hyb3VnaC4gKi8KKyAgbWNfbnNfZHJhd190ZXh0X2RlY29yYXRpb24gKHMs IGZhY2UsIHRkQ29sLCBici5zaXplLndpZHRoLCBici5vcmlnaW4ueCk7CisgIC8qIERyYXcgcmVs aWVmLCBpZiByZXF1ZXN0ZWQgKi8KKyAgaWYgKHMtPmltZy0+cmVsaWVmIHx8IHMtPmhsID09RFJB V19JTUFHRV9SQUlTRUQgfHwgcy0+aGwgPT1EUkFXX0lNQUdFX1NVTktFTikKKyAgICB7CisgICAg ICBpZiAocy0+aGwgPT0gRFJBV19JTUFHRV9TVU5LRU4gfHwgcy0+aGwgPT0gRFJBV19JTUFHRV9S QUlTRUQpCisgICAgICAgIHsKKyAgICAgICAgICB0aCA9IHRvb2xfYmFyX2J1dHRvbl9yZWxpZWYg Pj0gMCA/CisgICAgICAgICAgICB0b29sX2Jhcl9idXR0b25fcmVsaWVmIDogREVGQVVMVF9UT09M X0JBUl9CVVRUT05fUkVMSUVGOworICAgICAgICAgIHJhaXNlZF9wID0gKHMtPmhsID09IERSQVdf SU1BR0VfUkFJU0VEKTsKKyAgICAgICAgfQorICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAg ICAgdGggPSBhYnMgKHMtPmltZy0+cmVsaWVmKTsKKyAgICAgICAgICByYWlzZWRfcCA9IChzLT5p bWctPnJlbGllZiA+IDApOworICAgICAgICB9CisgICAgICByLm9yaWdpbi54ID0geCAtIHRoOwor ICAgICAgci5vcmlnaW4ueSA9IHkgLSB0aDsKKyAgICAgIHIuc2l6ZS53aWR0aCA9IHMtPnNsaWNl LndpZHRoICsgMip0aC0xOworICAgICAgci5zaXplLmhlaWdodCA9IHMtPnNsaWNlLmhlaWdodCAr IDIqdGgtMTsKKyAgICAgIG5zX2RyYXdfcmVsaWVmIChyLCB0aCwgcmFpc2VkX3AsCisgICAgICAg ICAgICAgICAgICAgICAgcy0+c2xpY2UueSA9PSAwLAorICAgICAgICAgICAgICAgICAgICAgIHMt PnNsaWNlLnkgKyBzLT5zbGljZS5oZWlnaHQgPT0gcy0+aW1nLT5oZWlnaHQsCisgICAgICAgICAg ICAgICAgICAgICAgcy0+c2xpY2UueCA9PSAwLAorICAgICAgICAgICAgICAgICAgICAgIHMtPnNs aWNlLnggKyBzLT5zbGljZS53aWR0aCA9PSBzLT5pbWctPndpZHRoLCBzKTsKKyAgICB9CisgIC8q IElmIHRoZXJlIGlzIG5vIG1hc2ssIHRoZSBiYWNrZ3JvdW5kIHdvbid0IGJlIHNlZW4sCisgICAg IHNvIGRyYXcgYSByZWN0YW5nbGUgb24gdGhlIGltYWdlIGZvciB0aGUgY3Vyc29yLgorICAgICBE byB0aGlzIGZvciBhbGwgaW1hZ2VzLCBnZXR0aW5nIHRyYW5zcGFyZW5jeSByaWdodCBpcyBub3Qg cmVsaWFibGUuICAqLworICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IpCisgICAgeworICAgICAg aW50IHRoaWNrbmVzcyA9IGFicyAocy0+aW1nLT5yZWxpZWYpOworICAgICAgaWYgKHRoaWNrbmVz cyA9PSAwKSB0aGlja25lc3MgPSAxOworICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEgK KyAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBITEVTUykKKyAgICAgIHsKKyAgICAg ICAgTlNDb2xvciAqYm9yZGVyX2NvbG9yID0gW05TQ29sb3IgY29sb3JXaXRoQ2FsaWJyYXRlZFJl ZDogbHNsLnJlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGdyZWVuOiBsc2wuZ3JlZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmx1ZTogbHNsLmJsdWUKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHBoYTog MS4wXTsKKyAgICAgICAgbnNfZHJhd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Qg PSBzLT53LT5tY19lbHRzLmFsbG9jYXRlZDsKKyAgICAgICAgICBmb29fZWx0cy51c2VkID0gcy0+ dy0+bWNfZWx0cy51c2VkOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBjYXNl IENIX0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAgZm9vX2VsdHMuY2FjaGVzID0gcy0+dy0+ Y2hfZWx0cy5jYWNoZXM7CisgICAgICAgICAgZm9vX2VsdHMuYWxsb2NhdGVkID0gcy0+dy0+Y2hf ZWx0cy5hbGxvY2F0ZWQ7CisgICAgICAgICAgZm9vX2VsdHMudXNlZCA9IHMtPnctPmNoX2VsdHMu dXNlZDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgY2FzZSBGQ19DQUNIRToK KyAgICAgICAgeworICAgICAgICAgIGZvb19lbHRzLmNhY2hlcyA9IHMtPnctPmZjX2VsdHMuY2Fj aGVzOworICAgICAgICAgIGZvb19lbHRzLmFsbG9jYXRlZCA9IHMtPnctPmZjX2VsdHMuYWxsb2Nh dGVkOworICAgICAgICAgIGZvb19lbHRzLnVzZWQgPSBzLT53LT5mY19lbHRzLnVzZWQ7CisgICAg ICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisgIC8qIFNUUkVUQ0hfR0xZUEggbWF5IGNv bnRhaW4gbW9yZSB0aGFuIG9uZSBmYWtlIGN1cnNvciBhdCB0aGUgc2FtZSBIUE9TLiAqLworICBm b3IgKGludCBlbHQgPSAwOyBlbHQgPCBmb29fZWx0cy51c2VkOyArK2VsdCkKKyAgICB7CisgICAg ICBpbnQgeCA9IGZvb19lbHRzLmNhY2hlc1tlbHRdLng7CisgICAgICBpbnQgZnggPSBmb29fZWx0 cy5jYWNoZXNbZWx0XS5meDsKKyAgICAgIGludCB5ID0gZm9vX2VsdHMuY2FjaGVzW2VsdF0ueTsK KyAgICAgIGludCBmeSA9IGZvb19lbHRzLmNhY2hlc1tlbHRdLmZ5OworICAgIC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G1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSBmb29fZWx0cy5j YWNoZXNbZWx0XS5nbHlwaF9mbGF2b3I7CisgICAgICBib29sIGVuYWJsZWRfcCA9IGZvb19lbHRz LmNhY2hlc1tlbHRdLmVuYWJsZWRfcDsKKyAgICAgIGJvb2wgZ29fcCA9ICh2cG9zID09IHJvd192 cG9zCisgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA9PSBnbHlwaC0+aHBvcworICAgICAgICAg ICAgICAgICAgICYmIGVuYWJsZWRfcCk7CisgICAgICBpZiAoIWdvX3ApCisgICAgICAgIGNvbnRp bnVlOworICAgICAgTlNSZWN0IHI7CisgICAgICByLm9yaWdpbi54ID0gZng7CisgICAgICByLm9y aWdpbi55ID0gZnk7CisgICAgICByLnNpemUuaGVpZ2h0ID0gaDsKKyAgICAgIHIuc2l6ZS53aWR0 aCA9IHdkOworICAgICAgW1tOU0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6IGxzbF9mZy5y ZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdyZWVuOiBsc2xfZmcuZ3JlZW4K KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBibHVlOiBsc2xfZmcuYmx1ZQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwaGE6IDEuMF0gc2V0XTsKKyAgaWYgKGN1 cnNvcl90eXBlID09IE1DX0ZSQU1FRF9CT1gpCisgICAgeworICAgICAgTGlzcF9PYmplY3QgYnVm ID0gcy0+dy0+Y29udGVudHM7CisgICAgICBDSEVDS19CVUZGRVIgKGJ1Zik7CisgICAgICBzdHJ1 Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAoYnVmKTsKKyAgICAgIGJvb2wgcmVnaW9uX2FjdGl2ZV9w ID0gKCFOSUxQIChWdHJhbnNpZW50X21hcmtfbW9kZSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmICFOSUxQIChCVkFSIChiLCBtYXJrX2FjdGl2ZSkpKTsKKyAgICAgIHB0cmRpZmZf dCByZWdpb25fYmVnaW5uaW5nID0gKHJlZ2lvbl9hY3RpdmVfcCkgPyBYRklYTlVNIChGcmVnaW9u X2JlZ2lubmluZyAoKSkgOiAtMTsKKyAgICAgIHB0cmRpZmZfdCByZWdpb25fZW5kID0gKHJlZ2lv bl9hY3RpdmVfcCkgPyBYRklYTlVNIChGcmVnaW9uX2VuZCAoKSkgOiAtMTsKKyAgICAgIHB0cmRp ZmZfdCBvcG9pbnRfcHQgPSAocy0+dyA9PSBYV0lORE9XIChzZWxlY3RlZF93aW5kb3cpKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gUFQKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IFhGSVhOVU0gKEZtYXJrZXJfcG9zaXRpb24gKHMtPnctPnBvaW50bSkpOworICAgICAgYm9v bCByZWdpb25faW5fYm91bmRzX3AgPSAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfcHQgPj0gcmVnaW9uX2JlZ2lubmluZworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3B0IDwgcmVnaW9uX2VuZCk7Cisg ICAgICBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgJiYgcmVnaW9uX2luX2JvdW5kc19w CisgICAgICAgICAgJiYgYWN0aXZlX3ApCisgICAgICAgIHsKKyAgICAgICAgICBlbnVtIGZhY2Vf aWQgaG9sbG93X2FjdGl2ZV9yZWdpb25fZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlIChzLT53 LCBzLT5mLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItcmVnaW9uLWZhY2UiKSwgdHJ1ZSk7 CisgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfcmVnaW9uX2ZhY2UgPSBGQUNF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kFDRV9GUk9NX0lEIChzLT5mLCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAg ICAgICAgTlNDb2xvciAqaG9sbG93X2luYWN0aXZlX2NvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRf Y29sb3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoaG9sbG93X2luYWN0aXZlX2ZhY2UpLCBzLT5mKTsK KyAgICAgICAgICAgICAgICBob2xsb3dfY29sb3IgPSBob2xsb3dfaW5hY3RpdmVfY29sb3I7Cisg ICAgICAgICAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZiAoZmFjZSAmJiBOU19GQUNFX0JBQ0tH Uk9VTkQgKGZhY2UpID09IG5zX2luZGV4X2NvbG9yIChGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYp LCBzLT5mKSkKKyAgICAgIHsKKyAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19G QUNFX0ZPUkVHUk9VTkQgKGZhY2UpLCBzLT5mKSBzZXRdOworICAgICAgICBob2xsb3dfY29sb3Ig PSBGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpOworICAgICAgfQorICAgICAgc3dpdGNoIChjdXJz b3JfdHlwZSkKKyAgICAgICAgeworICAgICAgICAgIGNhc2UgTUNfTk9fRlJJTkdFX0JJVE1BUDoK KyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIGNhc2UgTUNfTk9fQ1VSU09SOgorICAgICAg ICAgICAgYnJlYWs7CisgICAgICAgICAgY2FzZSBNQ19SSUdIVF9GUklOR0VfQklUTUFQOgorICAg ICAgICAgIGNhc2UgTUNfTEVGVF9GUklOR0VfQklUTUFQOgorICAgICAgICAgIGNhc2UgTUNfRklM TEVEX0JPWDoKKyAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAgYnJlYWs7 CisgICAgICAgICAgY2FzZSBNQ19GUkFNRURfQk9YOgorICAgICAgICAgICAgTlNSZWN0RmlsbCAo cik7CisgICAgICAgICAgICBbaG9sbG93X2NvbG9yIHNldF07CisgICAgICAgICAgICBOU1JlY3RG aWxsIChOU0luc2V0UmVjdCAociwgMSwgMSkpOworICAgICAgICAgICAgW0ZSQU1FX0NVUlNPUl9D T0xPUiAocy0+Zikgc2V0XTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIGNhc2UgTUNf SE9MTE9XX0JPWDoKKyAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAgW2hv bGxvd19jb2xvciBzZXRdOworICAgICAgICAgICAgTlNSZWN0RmlsbCAoTlNJbnNldFJlY3QgKHIs IDEsIDEpKTsKKyAgICAgICAgICAgIFtGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpIHNldF07Cisg ICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBjYXNlIE1DX0hCQVI6CisgICAgICAgICAgICBO U1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIGNhc2UgTUNfQkFS OgorICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAgICBicmVhazsKKyAgICAg ICAgfQorICAgICAgLyogSWYgYSBnbHlwaCBleGlzdHMgKHMtPmNoYXIyYiAhPSBOVUxMKSwgdGhl biBkcmF3IHRoZSBnbHlwaCBvbiB0b3Agb2YgdGhlCisgICAgICBuZXdseSBkcmF3biByZWN0YW5n bGUgdGhhdCB3YXMgY3JlYXRlZCBoZXJlaW5hYm92ZS4gIFRvIHRoZSBleHRlbnQgdGhhdCB3ZQor ICAgICAgd2FudCB0byBkb3VibGUtaW1wcmludCBnbHlwaHMgdG8gbWFrZSB0aGVtIGFwcGVhciB0 byBiZSBzZW1pLWJvbGQsIGl0IGNhbgorICAgICAgYmUgZG9uZSBoZXJlIGZvciBhbGwgY3Vyc29y IHR5cGVzLiAgVGhlIGJveC1zdHlsZSBjdXJzb3JzIGFyZSBpbXByaW50ZWQKKyAgICAgIHdpdGgg Z2x5cGhzIG9ubHkgb25lICgxKSB0aW1lLiAgVGhlIHNlbWktYm9sZCBhcHBlYXJhbmNlIGlzIGhl bHBmdWwgd2hlbgorICAgICAgZGVidWdnaW5nIHRvIHNlZSB0aGF0IHRoZSBjb29yZGluYXRlcyBh cmUgY29ycmVjdC4gKi8KKyAgICAgIGlmIChzLT5jaGFyMmIgIT0gTlVMTAorICAgICAgICAgICYm IChjdXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9YCisgICAgICAgICAgICAgIHx8IGN1cnNvcl90 eXBlID09IE1DX0ZSQU1FRF9CT1gKKyAgICAgICAgICAgICAgfHwgY3Vyc29yX3R5cGUgPT0gTUNf SE9MTE9XX0JPWCkpCisgICAgICAgIHsKKyAgICAgICAgICBCT09MIGlzQ29tcG9zaXRlID0gcy0+ Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIOworICAgICAgICAgIGlmIChpc0Nv bXBvc2l0ZSkKKyAgICAgICAgICAgIG5zX2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3Jl Z3JvdW5kIChzKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgIHN0cnVjdCBmb250ICpmb250ID0gcy0+ZmFjZS0+Zm9udDsKKyAgICAgICAgICAgICAg ICBpZiAoIWZvbnQpCisgICAgICAgICAgICAgICAgICBmb250ID0gRlJBTUVfRk9OVCAocy0+Zik7 CisgICAgICAgICAgICAgICAgYm9vbCB3aXRoX2JnX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAg ICBmb250LT5kcml2ZXItPmRyYXcgKHMsIHMtPmNtcF9mcm9tLCBzLT5uY2hhcnMsIHMtPngsIHMt PnliYXNlLCB3aXRoX2JnX3ApOworICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9Cit9 CisKK3N0YXRpYyB2b2lkCittY19uc19kcmF3X292ZXJ3cml0dGVuICh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AgIGludCBib3hfbGluZV93aWR0aCA9IG1heCAocy0+ZmFjZS0+Ym94 X2xpbmVfd2lkdGgsIDApOworICAgICAgaWYgKEZPTlRfSEVJR0hUIChzLT5mb250KSA8IHMtPmhl aWdodCAtIDIgKiBib3hfbGluZV93aWR0aAorICAgICAgICAgIC8qIFdoZW4geGRpc3AuYyBpZ25v cmVzIEZPTlRfSEVJR0hULCB3ZSBjYW5ub3QgdHJ1c3QgZm9udAorICAgICAgICAgICAgIGRpbWVu c2lvbnMsIHNpbmNlIHRoZSBhY3R1YWwgZ2x5cGhzIG1pZ2h0IGJlIG11Y2gKKyAgICAgICAgICAg ICBzbWFsbGVyLiAgU28gaW4gdGhhdCBjYXNlIHdlIGFsd2F5cyBjbGVhciB0aGUgcmVjdGFuZ2xl CisgICAgICAgICAgICAgd2l0aCBiYWNrZ3JvdW5kIGNvbG9yLiAgKi8KKyAgICAgICAgICB8fCBG T05UX1RPT19ISUdIIChzLT5mb250KQorICAgICAgICAgIHx8IHMtPmZvbnRfbm90X2ZvdW5kX3Ag fHwgcy0+ZXh0ZW5kc190b19lbmRfb2ZfbGluZV9wIHx8IGZvcmNlX3ApCisgICAgICB7CisgICAg ICAgICAgc3RydWN0IGZhY2UgKmZhY2U7CisgICAgICAgICAgaWYgKHMtPmhsID09IERSQVdfTU9V U0VfRkFDRSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgZmFjZSA9IEZBQ0VfRlJPTV9J RCAocy0+ZiwKKyAgICAgICAgICAgTU9VU0VfSExfSU5GTyAocy0+ZiktPm1vdXNlX2ZhY2VfZmFj ZV9pZCk7CisgICAgICAgICAgICAgIGlmICghZmFjZSkKKyAgICAgICAgICAgICAgICBmYWNlID0g RkFDRV9GUk9NX0lEIChzLT5mLCBNT1VTRV9GQUNFX0lEKTsKKyAgICAgICAgICAgIH0KKyAgICAg ICAgICBlbHNlCisgICAgICAgICAgICBmYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBzLT5maXJz dF9nbHlwaC0+ZmFjZV9pZCk7CisgICAgICAgICAgaWYgKCFmYWNlLT5zdGlwcGxlKQorICAgICAg ICAgICAgWyhOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpICE9IDAKKyAgICAgICAgICAgICAgPyBu c19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKSwgcy0+ZikK KyAgICAgICAgICAgICAgOiBGUkFNRV9CQUNLR1JPVU5EX0NPTE9SIChzLT5mKSkgc2V0XTsKKyAg ICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHN0cnVjdCBuc19kaXNw bGF5X2luZm8gKmRweWluZm8gPSBGUkFNRV9ESVNQTEFZX0lORk8gKHMtPmYpOworICAgICAgICAg ICAgICBbW2RweWluZm8tPmJpdG1hcHNbZmFjZS0+c3RpcHBsZS0xXS5pbWcgc3RpcHBsZU1hc2td IHNldF07CisgICAgICAgICAgICB9CisgICAgICAgICAgaWYgKHMtPmhsICE9IERSQVdfQ1VSU09S KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzLT5yZWN0YW5nbGVfbnVrZWRfcCA9IHRy dWU7CisgICAgICAgICAgICAgIE5TUmVjdCByID0gTlNNYWtlUmVjdCAocy0+eCwgcy0+eSArIGJv eF9saW5lX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+YmFj a2dyb3VuZF93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPmhl aWdodC0yKmJveF9saW5lX3dpZHRoKTsKKyAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7Cisg ICAgICAgICAgICB9CisgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IDE7CisgICAgICB9Cisg ICAgfQorfQorCitzdGF0aWMgdm9pZAorbWNfbnNfZHJhd19nbHlwaF9zdHJpbmcgKHN0cnVjdCBn bHlwaF9zdHJpbmcg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BoX3N0cmluZyAqbmV4 dDsKKyAgICAgIGZvciAod2lkdGggPSAwLCBuZXh0ID0gcy0+bmV4dDsKKyAgICAgICAgICAgbmV4 dCAmJiB3aWR0aCA8IHMtPnJpZ2h0X292ZXJoYW5nOworICAgICAgICAgICB3aWR0aCArPSBuZXh0 LT53aWR0aCwgbmV4dCA9IG5leHQtPm5leHQpCisgICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlw aC0+dHlwZSAhPSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpZiAobmV4 dC0+Zmlyc3RfZ2x5cGgtPnR5cGUgIT0gU1RSRVRDSF9HTFlQSCkKKyAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocy0+bmV4 dCwgcik7CisgICAgICAgICAgICAgICAgaWYgKCFtY19uc19jbGlwX3RvX3JlY3QgKHMtPmYsIHIs IG4sIHJvdykpCisgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgbWNf bnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzLT5uZXh0LCAxKTsKKyAgICAgICAgICAg ICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIG1jX25zX2R1bXBnbHlw aHNfc3RyZXRjaCAocy0+bmV4dCwgd2QsIHJvdyk7CisgICAgICAgICAgICAgICAgaWYgKChzLT5u ZXh0LT5sZWZ0X292ZXJ3cml0dGVuX3AgfHwgcy0+bmV4dC0+cmlnaHRfb3ZlcndyaXR0ZW5fcCkK KyAgICAgICAgICAgICAgICAgICAgJiYgcy0+bmV4dC0+YWN0aW9uX3R5cGUgPT0gTUNfRFJBV19H TFlQSCkKKyAgICAgICAgICAgICAgICAgIG1jX25zX2RyYXdfb3ZlcndyaXR0ZW4gKHMtPm5leHQs IG1hdHJpeCwgcm93LCBzLT5uZXh0LT5maXJzdF9nbHlwaCk7CisgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgIG5leHQtPm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgfQorICAgIH0KKyAgaWYg KCFzLT5mb3Jfb3ZlcmxhcHMgJiYgcy0+ZmFjZS0+Ym94ICE9IEZBQ0VfTk9fQk9YCisgICAgICAm JiAocy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgIHx8IHMtPmZp cnN0X2dseXBoLT50eXBlID09IENPTVBPU0lURV9HTFlQSCkpCisgICAgeworICAgICAgbiA9IG5z X2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAgICAgIGlmICghbWNfbnNfY2xp cF90b19yZWN0IChzLT5mLCByLCBuLCByb3cpKQorICAgICAgICByZXR1cm47CisgICAgICBtY19u c19tYXliZV9kdW1wZ2x5cGhzX2JhY2tncm91bmQgKHMsIDEpOworICAgICAgbnNfZHVtcGdseXBo c19ib3hfb3JfcmVsaWVmIChzKTsKKyAgICAgIG5zX3Jlc2V0X2NsaXBwaW5nIChzLT5mKTsKKyAg ICAgIGJveF9kcmF3bl9wID0gMTsKKyAgICB9CisgIHN3aXRjaCAocy0+Zmlyc3RfZ2x5cGgtPnR5 cGUpCisgICAgeworICAgIGNhc2UgSU1BR0VfR0xZUEg6CisgICAgICBuID0gbnNfZ2V0X2dseXBo X3N0cmluZ19jbGlwX3JlY3QgKHMsIHIpOworICAgICAgaWYgKCFtY19uc19jbGlwX3RvX3JlY3Qg KHMtPmYsIHIsIG4sIHJvdykpCisgICAgICAgIHJldHVybjsKKyAgICAgIG1jX25zX2R1bXBnbHlw aHNfaW1hZ2UgKHMsIHJbMF0sIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgYWN0aXZl X3ApOworICAgICAgbnNfcmVz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HUk9VTkQgKGhvbGxvd19hY3RpdmVfZmFjZSk7CisgICAgICAgICAg fQorICAgICAgICAgIGVsc2UgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SCisgICAgICAgICAgICAg ICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWAorICAgICAgICAgICAgICAgICAg ICYmIGFjdGl2ZV9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQg aG9sbG93X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+Ziwg aW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLWZhY2UiKSwgdHJ1ZSk7CisgICAg ICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9J RCAocy0+ZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICBOU19GQUNF X0ZPUkVHUk9VTkQgKHMtPmZhY2UpID0gTlNfRkFDRV9GT1JFR1JPVU5EIChob2xsb3dfaW5hY3Rp dmVfZmFjZSk7CisgICAgICAgICAgICB9CisgICAgICB7CisgICAgICAgIEJPT0wgaXNDb21wb3Np dGUgPSBzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEg7CisgICAgICAgIGlm IChpc0NvbXBvc2l0ZSkKKyAgICAgICAgICBuc19kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdf Zm9yZWdyb3VuZCAocyk7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAg ICAgICBib29sIHdpdGhfYmdfcCA9ICgoZmxhZ3MgPT0gTlNfRFVNUEdMWVBIX05PUk1BTCAmJiAh cy0+YmFja2dyb3VuZF9maWxsZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg fHwgZmxhZ3MgPT0gTlNfRFVNUEdMWVBIX01PVVNFRkFDRSk7CisgICAgICAgICAgICAgIGlmICh3 aXRoX2JnX3ApCisgICAgICAgICAgICAgICAgcy0+YmFja2dyb3VuZF9udWtlZF9wID0gdHJ1ZTsK KyAgICAgICAgICAgICAgZm9udC0+ZHJpdmVyLT5kcmF3IChzLCBzLT5jbXBfZnJvbSwgcy0+bmNo YXJzLCBzLT54LCBzLT55YmFzZSwgd2l0aF9iZ19wKTsKKyAgICAgICAgICAgIH0KKyAgICAgIH0K KyAgICAgIHsKKyAgICAgICAgTlNDb2xvciAqY29sID0gKE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ ZmFjZSkgIT0gMAorICAgICAgICAgICAgICAgICAgICAgICAgPyBuc19sb29rdXBfaW5kZXhlZF9j b2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPmYpCisgICAgICAgICAgICAgICAgICAg ICAgICA6IEZSQU1FX0ZPUkVHUk9VTkRfQ09MT1IgKHMtPmYpKTsKKyAgICAgICAgW2NvbCBzZXRd OworICAgICAgICAvKiBEcmF3IHVuZGVybGluZSwgb3ZlcmxpbmUsIHN0cmlrZS10aHJvdWdoLiAq LworICAgICAgICBtY19uc19kcmF3X3RleHRfZGVjb3JhdGlvbiAocywgcy0+ZmFjZSwgY29sLCBz LT53aWR0aCwgcy0+eCk7CisgICAgICB9CisgICAgICB7CisgICAgICAgIGlmIChzLT5maXJzdF9n bHlwaC0+dHlwZSAhPSBDT01QT1NJVEVfR0xZUEgKKyAgICAgICAgICAgICYmIChzLT5sZWZ0X292 ZXJ3cml0dGVuX3AgfHwgcy0+cmlnaHRfb3ZlcndyaXR0ZW5fcCkKKyAgICAgICAgICAgICYmIChz LT5iYWNrZ3JvdW5kX251a2VkX3AgfHwgcy0+cmVjdGFuZ2xlX251a2VkX3ApCisgICAgICAgICAg ICAm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iYWNrZ3JvdW5kX2ZpbGxlZF9w ID0gMTsKKyAgICAgIGVsc2UKKyAgICAgICAgbWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3Jv dW5kIChzLCBzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpOworICAgICAg LyogLi4uICovCisgICAgICAvKiBOb3QgeWV0IGltcGxlbWVudGVkLiAgKi8KKyAgICAgIC8qIC4u LiAqLworICAgICAgbnNfcmVzZXRfY2xpcHBpbmcgKHMtPmYpOworICAgICAgYnJlYWs7CisgICAg ZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOworICAgIH0KKyAgLyogRHJhdyBib3ggaWYg bm90IGRvbmUgYWxyZWFkeS4gKi8KKyAgaWYgKCFzLT5mb3Jfb3ZlcmxhcHMgJiYgIWJveF9kcmF3 bl9wICYmIHMtPmZhY2UtPmJveCAhPSBGQUNFX05PX0JPWCkKKyAgICB7CisgICAgICBuID0gbnNf Z2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsIHIpOworICAgICAgaWYgKCFtY19uc19jbGlw X3RvX3JlY3QgKHMtPmYsIHIsIG4sIHJvdykpCisgICAgICAgIHJldHVybjsKKyAgICAgIG5zX2R1 bXBnbHlwaHNfYm94X29yX3JlbGllZiAocyk7CisgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+ Zik7CisgICAgfQorICBzLT5udW1fY2xpcHMgPSAwOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VS U09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogLyogPT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT0KIAogICAgTlNUUkFDRSwgVHJhY2Ugc3VwcG9ydC4KQEAgLTExMDksNiArMjE5NCwxNiBAQCBz dGF0aWMgTlNSZWN0IGNvbnN0cmFpbl9mcmFtZV9yZWN0KE5TUmVjdCBmcmFtZVJlY3QsIGJvb2wg aXNGdWxsc2NyZWVuKQogICAgZXh0ZXJuYWwgKFJJRikgY2FsbDsgd2hvbGUgZnJhbWUsIGNhbGxl ZCBiZWZvcmUgdXBkYXRlX3dpbmRvd19iZWdpbgogICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KIHsK KworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwor ICBmLT5tY191cGRhdGluZ19mcmFtZSA9IGY7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor CisKICNpZmRlZiBOU19JTVBMX0NPQ09BCiAgIEVtYWNzVmlldyAqdmlldyA9IEZSQU1FX05TX1ZJ RVcgKGYpOwogCkBAIC0xMjA5LDYgKzIzMDQsMTYgQEAgc3RhdGljIE5TUmVjdCBjb25zdHJhaW5f ZnJhbWVfcmVjdChOU1JlY3QgZnJhbWVSZWN0LCBib29sIGlzRnVsbHNjcmVlbikKIAogLyogICBp ZiAoZiA9PSBNT1VTRV9ITF9JTkZPIChmKS0+bW91c2VfZmFjZV9tb3VzZV9mcmFtZSkgKi8KICAg TU9VU0VfSExfSU5GTyAoZiktPm1vdXNlX2ZhY2VfZGVmZXIgPSAwOworCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5n X2ZyYW1lID0gTlVMTDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAKQEAg LTQ4MDMsNiArNTkwOCwxNyBAQCBpbiBjZXJ0YWluIHNpdHVhdGlvbnMgKHJhcGlkIGluY29taW5n IGV2ZW50cykuCiAgICAgICBiYXIgPSBbW0VtYWNzU2Nyb2xsZXIgYWxsb2NdIGluaXRGcmFtZTog ciB3aW5kb3c6IHdpbl07CiAgICAgICB3c2V0X3ZlcnRpY2FsX3Njcm9sbF9iYXIgKHdpbmRvdywg bWFrZV9taW50X3B0ciAoYmFyKSk7CiAgICAgICB1cGRhdGVfcCA9IFlFUzsKKworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgLyogVGhp cyBpcyBvbmx5IGZvciBkZWJ1Z2dpbmcgcHVycG9zZXMuICovCisgICAgICBbYmFyIG1jX3NldF9y ZWN0YW5nbGU6IHJdOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgfQogICBl bHNlCiAgICAgewpAQCAtNDgxMCwxMiArNTkyNiwzMCBAQCBpbiBjZXJ0YWluIHNpdHVhdGlvbnMg KHJhcGlkIGluY29taW5nIGV2ZW50cykuCiAgICAgICBiYXIgPSBYTlNfU0NST0xMX0JBUiAod2lu ZG93LT52ZXJ0aWNhbF9zY3JvbGxfYmFyKTsKICAgICAgIG9sZFJlY3QgPSBbYmFyIGZyYW1lXTsK ICAgICAgIHIuc2l6ZS53aWR0aCA9IG9sZFJlY3Quc2l6ZS53aWR0aDsKKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogICAgICAgaWYgKEZSQU1F X0xJVkVfUCAoZikgJiYgIU5TRXF1YWxSZWN0cyAob2xkUmVjdCwgcikpCiAgICAgICAgIHsKKyAg ICAgICAgICAvKiBUaGUgbWFpbiB3aW5kb3cgaGFzIHByb2JhYmx5IGJlZW4gcmVzaXplZC4gIEdy YWNpb3VzbHkgZGVsZXRlIHRoZQorICAgICAgICAgIG9sZCBzY3JvbGwgYmFyIHdpdGhvdXQgcmVw YWludGluZyBpdHMgcmVjdGFuZ2xlOyBhbmQsIGNyZWF0ZSBhIG5ldworICAgICAgICAgIHNjcm9s bCBiYXIgZWxzZXdoZXJlLiovCiAgICAgICAgICAgaWYgKG9sZFJlY3Qub3JpZ2luLnggIT0gci5v cmlnaW4ueCkKKyAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgbnNfY2xlYXJfZnJhbWVfYXJl YSAoZiwgbGVmdCwgdG9wLCB3aWR0aCwgaGVpZ2h0KTsKKyAgICAgICAgICAgICAgW2JhciBtY19q dWRnZV07CisgICAgICAgICAgICAgIGJhciA9IFtbRW1hY3NTY3JvbGxlciBhbGxvY10gaW5pdEZy YW1lOiByIHdpbmRvdzogd2luXTsKKyAgICAgICAgICAgICAgd3NldF92ZXJ0aWNhbF9zY3JvbGxf YmFyICh3aW5kb3csIG1ha2VfbWludF9wdHIgKGJhcikpOworICAgICAgICAgICAgfQorICAgICAg ICAgICAgZWxzZQogICAgICAgICAgIFtiYXIgc2V0RnJhbWU6IHJdOwogICAgICAgICB9CisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICB9CiAKICAgaWYgKHVwZGF0ZV9wKQpAQCAt NDk3NSw5ICs2MTA5LDU3IEBAIGluIGNlcnRhaW4gc2l0dWF0aW9ucyAocmFwaWQgaW5jb21pbmcg ZXZlbnRzKS4KICAgICB7CiAgICAgICB2aWV3ID0gW3N1YnZpZXdzIG9iamVjdEF0SW5kZXg6IGld OwogICAgICAgaWYgKCFbdmlldyBpc0tpbmRPZkNsYXNzOiBbRW1hY3NTY3JvbGxlciBjbGFzc11d KSBjb250aW51ZTsKLSAgICAgIGlmIChbdmlldyBqdWRnZV0pCisKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogYFhTRVRXSU5ET1cnIHdp bGwgc29tZXRpbWVzIGNhdXNlIEVtYWNzIHRvIGNyYXNoIHdoZW4gcnVubmluZyB1bmRlciBnZGIg ZXZlbgorICB0aG91Z2ggKHcgIT0gTlVMTCkuICBUaGVyZWZvcmUsIHdlIGNhbm5vdCByZWxpYWJs eSB1c2UgYFdJTkRPV19MSVZFX1AnLiAqLworICBzdHJ1Y3Qgd2luZG93ICp3ID0gW3ZpZXcgbWNf Z2V0X3dpbmRvd107CisgIGlmICh3ICE9IE5VTEwKKyAgICAgICYmIE5JTFAgKHctPmNvbnRlbnRz KSkKKyAgICB7CisgICAgICBCT09MIGRlYnVnX3AgPSBmYWxzZTsKKyAgICAgIGlmIChkZWJ1Z19w CisgICAgICAgICAgLyogYHdpbmRvd19ib3gnIGNhbGxzIGB3aW5kb3dfYm94X2hlaWdodCcsIHdo aWNoIHdpbGwgY2F1c2UgRW1hY3MgdG8KKyAgICAgICAgICBjcmFzaCBpZiBGUkFNRVAgKHctPmZy YW1lKSBpcyBub3Qgc2F0aXNmaWVkLiAqLworICAgICAgICAgICYmIEZSQU1FUCAody0+ZnJhbWUp KQorICAgICAgICB7CisgICAgICAgICAgTlNSZWN0IHIwID0gW3ZpZXcgbWNfZ2V0X3JlY3Rhbmds ZV07CisgICAgICAgICAgaW50IHgwID0gTlNNaW5YIChyMCk7CisgICAgICAgICAgaW50IHkwID0g TlNNaW5ZIChyMCk7CisgICAgICAgICAgaW50IHdkMCA9IE5TV2lkdGggKHIwKTsKKyAgICAgICAg ICBpbnQgaDAgPSBOU0hlaWdodCAocjApOworICAgICAgICAgIGludCB3aW5kb3dfeSwgd2luZG93 X2hlaWdodDsKKyAgICAgICAgICB3aW5kb3dfYm94ICh3LCBBTllfQVJFQSwgMCwgJndpbmRvd195 LCAwLCAmd2luZG93X2hlaWdodCk7CisgICAgICAgICAgaW50IHRvcCA9IHdpbmRvd195OworICAg ICAgICAgIGludCBoZWlnaHQgPSB3aW5kb3dfaGVpZ2h0OworICAgICAgICAgIGludCB3aWR0aCA9 IFdJTkRPV19DT05GSUdfU0NST0xMX0JBUl9DT0xTICh3KSAqIEZSQU1FX0NPTFVNTl9XSURUSCAo Zik7CisgICAgICAgICAgaW50IGxlZnQgPSBXSU5ET1dfU0NST0xMX0JBUl9BUkVBX1ggKHcpOwor ICAgICAgICAgIE5TUmVjdCByMSA9IE5TTWFrZVJlY3QgKGxlZnQsIHRvcCwgd2lkdGgsIGhlaWdo dCk7CisgICAgICAgICAgLyogVGhlIHBhcmVudCB2aWV3IGlzIGZsaXBwZWQsIHNvIHdlIG5lZWQg dG8gZmxpcCB5IHZhbHVlLiAqLworICAgICAgICAgIEVtYWNzVmlldyAqZnJhbWVfdmlldyA9IEZS QU1FX05TX1ZJRVcgKGYpOworICAgICAgICAgIE5TUmVjdCB2ID0gW2ZyYW1lX3ZpZXcgZnJhbWVd OworICAgICAgICAgIHIxLm9yaWdpbi55ID0gKHYuc2l6ZS5oZWlnaHQgLSByMS5zaXplLmhlaWdo dCAtIHIxLm9yaWdpbi55KTsKKyAgICAgICAgICBpbnQgeDEgPSBOU01pblggKHIxKTsKKyAgICAg ICAgICBpbnQgeTEgPSBOU01pblkgKHIxKTsKKyAgICAgICAgICBpbnQgd2QxID0gTlNXaWR0aCAo cjEpOworICAgICAgICAgIGludCBoMSA9IE5TSGVpZ2h0IChyMSk7CisgICAgICAgICAgZnByaW50 ZiAoc3RkZXJyLCAiJXMgLS0gREVBRDpcblwKKyAgICAgICAgICB4MC94MSAoJWQvJWQpIHwgeTAv eTEgKCVkLyVkKSB8IHdkMC93ZDEgKCVkLyVkKSB8IGgwL2gxICglZC8lZClcbiIsCisgICAgICAg ICAgbWNfd2luZG93ICh3KSwgeDAsIHgxLCB5MCwgeTEsIHdkMCwgd2QxLCBoMCwgaDEpOworICAg ICAgICB9CisgICAgICBpZiAoW3ZpZXcgbWNfanVkZ2VdKQogICAgICAgICByZW1vdmVkID0gWUVT OwogICAgIH0KKyAgICBlbHNlIGlmIChbdmlldyBqdWRnZV0pCisgICAgICByZW1vdmVkID0gWUVT OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCisgICAgfQogCiAgIGlmIChyZW1vdmVk KQogICAgIFtldmlldyB1cGRhdGVGcmFtZVNpemU6IE5PXTsKQEAgLTUxMDYsNiArNjI4OCwyMSBA QCBzdGF0aWMgTGlzcF9PYmplY3QgbnNfc3RyaW5nX3RvX2xpc3Btb2QgKGNvbnN0IGNoYXIgKnMp CiBleHRlcm4gZnJhbWVfcGFybV9oYW5kbGVyIG5zX2ZyYW1lX3Bhcm1faGFuZGxlcnNbXTsKIHN0 YXRpYyBzdHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFjZSBuc19yZWRpc3BsYXlfaW50ZXJmYWNlID0K IHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8K KworLyogYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGBuc3Rlcm0ubWAgbXVzdCBiZSBpbiB0aGUg ZXhhY3Qgc2FtZSBvcmRlciBhcyB0aGUKK2ByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgZGlzcGV4 dGVybi5oYCEgKi8KKworICBtY194X3dyaXRlX2dseXBocywKKyAgbWNfbnNfZHJhd193aW5kb3df Y3Vyc29yLAorICBtY19uc19kcmF3X2dseXBoX3N0cmluZywKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogICBuc19mcmFtZV9wYXJtX2hhbmRsZXJzLAogICB4X3Byb2R1Y2VfZ2x5cGhz LAogICB4X3dyaXRlX2dseXBocywKQEAgLTg3MjEsNiArOTkxOCw0OSBAQCAtIChCT09MKWNhbkJl Y29tZU1haW5XaW5kb3cKIAogQGltcGxlbWVudGF0aW9uIEVtYWNzU2Nyb2xsZXIKIAorCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLSAodm9pZClt Y19zZXRfcmVjdGFuZ2xlOiAoTlNSZWN0KXJlY3QKK3sKKyAgbWNfcmVjdGFuZ2xlID0gcmVjdDsK K30KKworLSAoTlNSZWN0KW1jX2dldF9yZWN0YW5nbGUKK3sKKyAgcmV0dXJuIG1jX3JlY3Rhbmds ZTsKK30KKworLSAoc3RydWN0IHdpbmRvdyAqKW1jX2dldF93aW5kb3cKK3sKKyAgcmV0dXJuIHdp bmRvdzsKK30KKworLSAoYm9vbCltY19qdWRnZQoreworICBOU1RSQUNFICgiW0VtYWNzU2Nyb2xs ZXIgbWNfanVkZ2VdIik7CisgIGJvb2wgcmV0ID0gY29uZGVtbmVkOworICBibG9ja19pbnB1dCAo KTsKKyAgaWYgKGNvbmRlbW5lZCkKKyAgICB7CisgICAgICAvKiBlbnN1cmUgb3RoZXIgc2Nyb2xs YmFyIHVwZGF0ZXMgYWZ0ZXIgZGVsZXRpb24gKi8KKyAgICAgIEVtYWNzVmlldyAqdmlldyA9IChF bWFjc1ZpZXcgKilGUkFNRV9OU19WSUVXIChmcmFtZSk7CisgICAgICBpZiAodmlldyAhPSBuaWwp CisgICAgICAgIHZpZXctPnNjcm9sbGJhcnNOZWVkaW5nVXBkYXRlKys7CisgICAgfQorICBpZiAo d2luZG93KQorICAgIHdzZXRfdmVydGljYWxfc2Nyb2xsX2JhciAod2luZG93LCBRbmlsKTsKKyAg d2luZG93ID0gMDsKKyAgW3NlbGYgcmVtb3ZlRnJvbVN1cGVydmlld1dpdGhvdXROZWVkaW5nRGlz cGxheV07CisgIFtzZWxmIHJlbGVhc2VdOworICB1bmJsb2NrX2lucHV0ICgpOworICByZXR1cm4g cmV0OworfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBmb3IgcmVwZWF0IGJ1 dHRvbiBwdXNoICovCiAjZGVmaW5lIFNDUk9MTF9CQVJfRklSU1RfREVMQVkgMC41CiAjZGVmaW5l IFNDUk9MTF9CQVJfQ09OVElOVU9VU19ERUxBWSAoMS4wIC8gMTUpCmRpZmYgLS1naXQgYS9zcmMv cGR1bXBlci5jIGIvc3JjL3BkdW1wZXIuYwppbmRleCBjYjI5MTVjLi4zNmQ4YmZlIDEwMDY0NAot LS0gYS9zcmMvcGR1bXBlci5jCisrKyBiL3NyYy9wZHVtcGVyLmMKQEAgLTI3NzAsNyArMjc3MCw3 IEBAIGR1bXBfaGFzaF90YWJsZSAoc3RydWN0IGR1bXBfY29udGV4dCAqY3R4LAogc3RhdGljIGR1 bXBfb2ZmCiBkdW1wX2J1ZmZlciAoc3RydWN0IGR1bXBfY29udGV4dCAqY3R4LCBjb25zdCBzdHJ1 Y3QgYnVmZmVyICppbl9idWZmZXIpCiB7Ci0jaWYgQ0hFQ0tfU1RSVUNUUyAmJiAhZGVmaW5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X3gpCisgICAgICBiYWNrZ3JvdW5kX3dpZHRoIC09IHggLSByaWdodF94OworICAgIHggKz0g YmFja2dyb3VuZF93aWR0aDsKKyAgfQorICAgICAgd2lkdGggPSBtaW4gKEZSQU1FX0NPTFVNTl9X SURUSCAocy0+ZiksIGJhY2tncm91bmRfd2lkdGgpOworICAgICAgaWYgKHMtPnJvdy0+cmV2ZXJz ZWRfcCkKKyAgeCAtPSB3aWR0aDsKKyAgICAgIC8qIERyYXcgY3Vyc29yLiAgKi8KKyAgICAgIHhf ZHJhd19nbHlwaF9zdHJpbmdfYmdfcmVjdCAocywgeCwgcy0+eSwgd2lkdGgsIHMtPmhlaWdodCk7 CisgICAgICAvKiBDbGVhciByZXN0IHVzaW5nIHRoZSBHQyBvZiB0aGUgb3JpZ2luYWwgbm9uLWN1 cnNvciBmYWNlLiAgKi8KKyAgICAgIGlmICh3aWR0aCA8IGJhY2tncm91bmRfd2lkdGgpCisgIHsK KyAgICBYR0NWYWx1ZXMgKmdjID0gcy0+ZmFjZS0+Z2M7CisgICAgaW50IHkgPSBzLT55OworICAg IGludCB3ID0gYmFja2dyb3VuZF93aWR0aCAtIHdpZHRoLCBoID0gcy0+aGVpZ2h0OworICAgIFJF Q1QgcjsKKyAgICAgICAgICBIREMgaGRjID0gcy0+aGRjOworICAgIGlmICghcy0+cm93LT5yZXZl cnNlZF9wKQorICAgICAgeCArPSB3aWR0aDsKKyAgICBlbHNlCisgICAgICB4ID0gcy0+eDsKKyAg ICBpZiAocy0+cm93LT5tb3VzZV9mYWNlX3AKKyAgICAgICAgJiYgY3Vyc29yX2luX21vdXNlX2Zh Y2VfcCAocy0+dykpCisgICAgICB7CisgICAgICAgIHhfc2V0X21vdXNlX2ZhY2VfZ2MgKHMpOwor ICAgICAgICBnYyA9IHMtPmdjOworICAgICAgfQorICAgIGVsc2UKKyAgICAgIGdjID0gcy0+ZmFj ZS0+Z2M7CisgICAgZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHM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ICAgIC8qIElmIHRoZSBzaXplIG9mIHRoZSBhY3RpdmUgY3Vyc29yIGNo YW5nZWQsIGRlc3Ryb3kgdGhlIG9sZAorICAgICAgICAgICAgIHN5c3RlbSBjYXJldC4gICovCisg ICAgICAgICAgaWYgKHczMl9zeXN0ZW1fY2FyZXRfaHduZAorICAgICAgICAgICAgICAmJiAodzMy X3N5c3RlbV9jYXJldF9oZWlnaHQgIT0gaCkpCisgICAgICAgICAgICBQb3N0TWVzc2FnZSAoaHdu ZCwgV01fRU1BQ1NfREVTVFJPWV9DQVJFVCwgMCwgMCk7CisgICAgICAgICAgdzMyX3N5c3RlbV9j YXJldF9oZWlnaHQgPSBoOworICAgICAgICAgIC8qIE1vdmUgdGhlIHN5c3RlbSBjYXJldC4gICov CisgICAgICAgICAgUG9zdE1lc3NhZ2UgKGh3bmQsIFdNX0VNQUNTX1RSQUNLX0NBUkVULCAwLCAw KTsKKyAgICAgICAgfQorICAgICAgLyogVGhlIGZyaW5nZSBiaXRtYXBzIGFyZSBwcmVzZW50bHkg aGFuZGxlZCBlbHNld2hlcmUsIGJ1dCBjb3VsZCBzb21lZGF5CisgICAgICBiZSBtYW5hZ2VkIChp biBwYXJ0KSBhdCB0aGlzIHNlY3Rpb24gb2YgY29kZS4gKi8KKyAgICAgIGlmIChyb3ctPmV4YWN0 X3dpbmRvd193aWR0aF9saW5lX3AKKyAgICAgICAgICAmJiAocm93LT5yZXZlcnNlZF9wCisgICAg ICAgICAgICAgPyAoaHBvcyA8IDApCisgICAgICAgICAgICAgOiAoaHBvcyA+PSByb3ctPnVzZWRb VEVYVF9BUkVBXSkpKQorICAgICAgICB7CisgICAgICAgICAgcm93LT5jdXJzb3JfaW5fZnJpbmdl X3AgPSB0cnVlOworICAgICAgICAgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcCAodywgcm93LCByb3ct PnJldmVyc2VkX3AsIGN1cnNvcl90eXBlKTsKKyAgICAgICAgICByZXR1cm47CisgICAgICAgIH0K KyAgc3Ryd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PSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJu ICgiKy1yZWFsLWZha2UtY3Vyc29yLWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgIHN0cnVj dCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3Rp dmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgIGdjX3ZhbHVlcy5mb3JlZ3JvdW5kID0gaG9sbG93 X2FjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICBnY192YWx1ZXMuYmFja2dy b3VuZCA9IGhvbGxvd19hY3RpdmVfcmVnaW9uX2ZhY2UtPmJhY2tncm91bmQ7CisgICAgICAgICAg ICB9CisgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAg ICAgICAgICYmICFyZWdpb25faW5fYm91bmRzX3AKKyAgICAgICAgICAgICAgICAgICAgICYmIGFj dGl2ZV9wKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhv bGxvd19hY3RpdmVfcmVnaW9uX291dF9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYs IGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1yZWdpb24tZmFjZSIpLCB0cnVlKTsKKyAgICAg ICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9yZWdpb25fb3V0X2ZhY2UgPSBG QUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfcmVnaW9uX291dF9mYWNlX2lkKTsKKyAgICAg ICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25h bWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1mYWNlIiksIHRydWUp OworICAgICAgIC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ICAgICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUs IHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLncz Mi0+Y3Vyc29yX2djID0gb3JpZ2luYWxfY3Vyc29yX2djOworICAgICAgICAgIHVuYmxvY2tfaW5w dXQgKCk7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53 MzItPmN1cnNvcl9waXhlbCcuICAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vy c29yX3BpeGVsID0gY29sb3JfcGl4ZWw7CisgICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1 cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOwor ICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vy c29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKGN1cnNvcl9nbHlwaC0+dHlw ZSA9PSBJTUFHRV9HTFlQSCAmJiBsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNs LmJsdWUgPj0gMCkKKyAgICAgICAgICB7CisgICAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWph Y2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgICAgICBm LT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAg ICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBm eSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5j d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gICAgIGdjX3ZhbHVlcy5mb3JlZ3Jv dW5kID0gaG9sbG93X2FjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICAgICAg Z2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX3JlZ2lvbl9mYWNlLT5iYWNrZ3Jv dW5kOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25f YWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcmVnaW9uX2luX2JvdW5kc19w CisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYWN0aXZlX3ApCisgICAgICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lv bl9vdXRfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwt ZmFrZS1jdXJzb3ItcmVnaW9uLWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIHN0 cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9vdXRfZmFjZSA9IEZBQ0VfRlJPTV9JRCAo ZiwgaG9sbG93X2FjdGl2ZV9yZWdpb25fb3V0X2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAg ICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2Ug KHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1mYWNlIiksIHRydWUpOworICAgICAg ICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9N X0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICBnY192 YWx1ZXMuZm9yZWdyb3VuZCA9IGhvbGxvd19hY3RpdmVfZmFjZS0+Zm9yZWdyb3VuZDsKKyAgICAg ICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX3JlZ2lv bl9vdXRfZmFjZS0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAg ICAgICAgIGVsc2UgaWYgKCFyZWdpb25fYWN0aXZlX3AgJiYgYWN0aXZlX3ApCisgICAgICAgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2Fj dGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1m YWtlLWN1cnNvci1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBm YWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVf ZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBo b2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgICAgICAgZ2Nf dmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmJhY2tncm91bmQ7CisgICAg ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgLyogVGhlIHJlZ2lvbiBpcyBf bm90XyB2aXNpYmxlIGluIHRoZSBpbmFjdGl2ZSB3aW5kb3cgYmVjYXVzZSB0aGUgb3ZlcmxheSB3 aW5kb3cgcHJvcGVydHkgaXMgdXNlZC4gKi8KKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAo IWFjdGl2ZV9wKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAg ICAgIGVudW0gZmFjZV9pZCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9m YWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItaW5hY3RpdmUtZmFjZSIpLCB0 cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3Rp dmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAg ICAgICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfaW5hY3Rp dmVfZmFjZS0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5i YWNrZ3JvdW5kID0gaG9sbG93X2luYWN0aXZlX2ZhY2UtPmJhY2tncm91bmQ7CisgICAgICAgICAg ICAgICAgICAgICAgfQorICAgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9n YyA9IFhDcmVhdGVHQyAoTlVMTCwgRlJBTUVfVzMyX1dJTkRPVyAoZiksIG1hc2ssICZnY192YWx1 ZXMpOworICAgICAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgLyogRm9y Y2UgYG1jX3czMl9zZXRfY3Vyc29yX2djJyB0byB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLnczMi0+ Y3Vyc29yX2djJy4gICovCisgICAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX3AgPSB0cnVlOwor ICAgICAgICAgICAgICBtY19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdf Q1VSU09SLCB4LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgbHNsLCBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsIGN1cnNvcl9n Y19wKTsKKyAgICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MgPSBvcmln aW5hbF9jdXJzb3JfZ2M7CisgICAgICAgICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAg ICAgICAgIG1jX3czMl9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwg eSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAgICAgICAgICAgIH0KKyAgICAgIGJyZWFrOwor ICAgIH0KKyAgICBjYXNlIE1DX0hPTExPV19CT1g6CisgICAgeworICAgICAgaWYgKGxzbC5yZWQg Pj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAgICB7CisgICAg ICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9w aXhlbCcuICAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0g Y29sb3JfcGl4ZWw7CisgICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0 cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgIGYt Pm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOwor ICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICBtY193MzJfZHJhd19ob2xsb3dfY3Vy c29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7Cisg ICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBNQ19GSUxMRURfQk9YOgorICAgIHsKKyAgICAg IGlmIChsc2wucmVkID49IDAgJiYgbHN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g d2QsIGFjdGl2ZV9wLCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMy LT5jdXJzb3JfZ2MgPSBvcmlnaW5hbF9jdXJzb3JfZ2M7CisgICAgICAgICAgdW5ibG9ja19pbnB1 dCAoKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAg Ym9vbCBjdXJzb3JfZ2NfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5 cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBsc2wsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUs IHdkLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jf Z2NfcCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfQkFS OgorICAgIHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNs LmJsdWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBg Zi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgICBmLT5vdXRw dXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAgIGJvb2wg Y3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSB0cnVlOworICAgICAgICAgIG1jX3czMl9kcmF3 X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdk LCBoLCBjdXJzb3Jfd2lkdGgsIE1DX0JBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOwor ICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vy c29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAg ICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7CisgICAgICAgICAg ICBtY193MzJfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBo cG9zLCB2cG9zLCB3ZCwgaCwgY3Vyc29yX3dpZHRoLCBNQ19CQVIsIGN1cnNvcl9nY19pbnZpc2li bGVfb2theV9wKTsKKyAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBN Q19IQkFSOgorICAgIHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAg JiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhp amFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgICBm LT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAg IGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSB0cnVlOworICAgICAgICAgIG1jX3cz Ml9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZw b3MsIHdkLCBoLCBjdXJzb3Jfd2lkdGgsIE1DX0hCQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2th eV9wKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9yaWdp bmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgewor ICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IGZhbHNlOworICAg ICAgICAgICAgbWNfdzMyX2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5 LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsIGN1cnNvcl93aWR0aCwgTUNfSEJBUiwgY3Vyc29yX2dj X2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAg ICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7CisgIH0KKyAgICB9Cit9CisKKy8qIERy YXcgZ2x5cGggc3RyaW5nIFMuICAqLworc3RhdGljIHZvaWQKK21jX3czMl9kcmF3X2dseXBoX3N0 cmluZyAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4 LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVj dCBtY19SR0IgbHNsLCBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IsCisgICAgICAgICAgICAg ICAgICAgICAgICAgIGVudW0gdHlwZV9vZl9jdXJzb3IgY3Vyc29yX3R5cGUsIGludCBjdXJzb3Jf d2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgYWN0aXZlX3AsIGJvb2wgY3Vy c29yX2djX3ApCit7CisgIGJvb2wgcmVsaWVmX2RyYXduX3AgPSAwOworICAvKiBJZiBTIGRyYXdz IGludG8gdGhlIGJhY2tncm91bmQgb2YgaXRzIHN1Y2Nlc3NvciwgZHJhdyB0aGUKKyAgICAgYmFj a2dyb3VuZCBvZiB0aGUgc3VjY2Vzc29yIGZpcnN0IHNvIHRoYXQgUyBjYW4gZHJhdyBpbnRvIGl0 LgorICAgICBUaGlzIG1ha2VzIFMtPm5leHQgdXNlIFhEcmF3U3RyaW5nIGluc3RlYWQgb2YgWERy YXdJbWFnZVN0cmluZy4gICovCisgIGlmIChzLT5uZXh0ICYmIHMtPnJpZ2h0X292ZXJoYW5nICYm ICFzLT5mb3Jfb3ZlcmxhcHMpCisgICAgeworICAgICAgaW50IHdpZHRoOworICAgICAgc3RydWN0 IGdseXBoX3N0cmluZyAqbmV4dDsKKyAgICAgIGZvciAod2lkdGggPSAwLCBuZXh0ID0gcy0+bmV4 dDsKKyAgICAgICAgICAgbmV4dCAmJiB3aWR0aCA8IHMtPnJpZ2h0X292ZXJoYW5nOworICAgICAg ICAgICB3aWR0aCArPSBuZXh0LT53aWR0aCwgbmV4dCA9IG5leHQtPm5leHQpCisgICAgICAgIGlm IChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSAhPSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICB7Cisg ICAgICAgICAgICBtY193MzJfc2V0X2dseXBoX3N0cmluZ19nYyAobmV4dCwgY3Vyc29yX2djX3Ap OworICAgICAgICAgICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nIChuZXh0KTsKKyAgICAg ICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKQorICAg ICAgICAgICAgICBtY193MzJfZHJhd19zdHJldGNoX2dseXBoX3N0cmluZyAobmV4dCk7CisgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3Vu ZCAobmV4dCwgdHJ1ZSk7CisgICAgICAgICAgICBuZXh0LT5udW1fY2xpcHMgPSAwOworICAgICAg ICAgIH0KKyAgICB9CisgIC8qIFNldCB1cCBTLT5nYywgc2V0IGNsaXBwaW5nIGFuZCBkcmF3IFMu ICAqLworICBtY193MzJfc2V0X2dseXBoX3N0cmluZ19nYyAocywgY3Vyc29yX2djX3ApOworICAv KiBEcmF3IHJlbGllZi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24sIGFuZCByaWdodF9vdmVyaGFu ZyBwYXJ0IHdpbGwgYmUKKyAgICAgICBkcmF3biBsYXRlciB3aGVuIHMtPm5leHQgaXMgZHJhd24u ICovCisgICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nX2V4YWN0bHkgKHMsIHMpOworICBl bHNlCisgICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nIChzKTsKKyAgc3dpdGNoIChzLT5m aXJzdF9nbHlwaC0+dHlwZSkKKyAgICB7CisgICAgY2FzZSBJTUFHRV9HTFlQSDoKKyAgICAgIHhf ZHJhd19pbWFnZV9nbHlwaF9zdHJpbmcgKHMpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBTVFJF VENIX0dMWVBIOgorICAgICAgbWNfdzMyX2RyYXdfc3RyZXRjaF9nbHlwaF9zdHJpbmcgKHMpOwor ICAgICAgYnJlYWs7CisgICAgY2FzZSBDSEFSX0dMWVBIOgorICAgICAgaWYgKHMtPmZvcl9vdmVy bGFwcykKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICBlbHNl CisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgZmFsc2UpOworICAg ICAgeF9kcmF3X2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAgICAgIGJyZWFrOworICAg IGNhc2UgQ09NUE9TSVRFX0dMWVBIOgorICAgICAgaWYgKHMtPmZvcl9vdmVybGFwcyB8fCAocy0+ Y21wX2Zyb20gPiAwCisgICAgICAgICAgJiYgISBzLT5maXJzdF9nbHlwaC0+dS5jbXAuYXV0b21h dGljKSkKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICBlbHNl CisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgdHJ1ZSk7CisgICAg ICB4X2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAgICAgIGJy ZWFrOworICAgIGNhc2UgR0xZUEhMRVNTX0dMWVBIOgorICAgICAgaWYgKHMtPmZvcl9vdmVybGFw cykKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICBlbHNlCisg ICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgZmFsc2UpOworICAgICAg eF9kcmF3X2dseXBobGVzc19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAgICBicmVh azsKKyAgICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7CisgICAgfQorICBpZiAoIXMt PmZvcl9vdmVybGFwcykKKyAgICB7CisgICAgICAvKiBEcmF3IHVuZGVybGluZS4gICovCisgICAg ICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3ApCisgICAgICAgIHsKKyAgICAgICAgICBpZiAocy0+ ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9XQVZFKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICBDT0xPUlJFRiBjb2xvcjsKKyAgICAgICAgICAgICAgaWYgKHMtPmZhY2Ut PnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICBjb2xvciA9IHMtPmdjLT5m b3JlZ3JvdW5kOworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgY29sb3IgPSBz LT5mYWNlLT51bmRlcmxpbmVfY29sb3I7CisgICAgICAgICAgICAgIHczMl9kcmF3X3VuZGVyd2F2 ZSAocywgY29sb3IpOworICAgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKHMtPmZhY2Ut PnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgdW5zaWduZWQgbG9uZyB0aGlja25lc3MsIHBvc2l0aW9uOworICAgICAgICAgICAg ICBpbnQgeTsKKyAgICAgICAgICAgICAgaWYgKHMtPnByZXYgJiYgcy0+cHJldi0+ZmFjZS0+dW5k ZXJsaW5lX3AKKyAgICAgICAgICAgICAgICAgICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV90 eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAg ICAgICAvKiBXZSB1c2UgdGhlIHNhbWUgdW5kZXJsaW5lIHN0eWxlIGFzIHRoZSBwcmV2aW91cyBv bmUuICAqLworICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+cHJldi0+dW5kZXJsaW5l X3RoaWNrbmVzczsKKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gcy0+cHJldi0+dW5kZXJs aW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJsaW5lIHRo aWNrbmVzcy4gIERlZmF1bHQgaXMgMSBwaXhlbC4gICovCisgICAgICAgICAgICAgICAgICBpZiAo cy0+Zm9udCAmJiBzLT5mb250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4gMCkKKyAgICAgICAgICAg ICAgICAgICAgdGhpY2tuZXNzID0gcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAg ICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gMTsKKyAg ICAgICAgICAgICAgICAgIGlmICh4X3VuZGVybGluZV9hdF9kZXNjZW50X2xpbmUpCisgICAgICAg ICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmhlaWdodCAtIHRoaWNrbmVzcykgLSAocy0+eWJh c2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJsaW5lIHBvc2l0aW9uLiAg VGhpcyBpcyB0aGUgcmVjb21tZW5kZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICB2ZXJ0aWNh bCBvZmZzZXQgaW4gcGl4ZWxzIGZyb20gdGhlIGJhc2VsaW5lIHRvIHRoZSB0b3Agb2YKKyAgICAg ICAgICAgICAgICAgICAgICAgICB0aGUgdW5kZXJsaW5lLiAgVGhpcyBpcyBhIHNpZ25lZCB2YWx1 ZSBhY2NvcmRpbmcgdG8gdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgc3BlY3MsIGFuZCBp dHMgZGVmYXVsdCBpcworICAgICAgICAgICAgICAgICAgICAgICAgIFJPVU5EICgobWF4aW11bV9k ZXNjZW50KSAvIDIpLCB3aXRoCisgICAgICAgICAgICAgICAgICAgICAgICAgUk9VTkQgKHgpID0g Zmxvb3IgKHggKyAwLjUpICAqLworICAgICAgICAgICAgICAgICAgICAgIGlmICh4X3VzZV91bmRl cmxpbmVfcG9zaXRpb25fcHJvcGVydGllcworICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBz LT5mb250ICYmIHMtPmZvbnQtPnVuZGVybGluZV9wb3NpdGlvbiA+PSAwKQorICAgICAgICAgICAg ICAgICAgICAgICAgcG9zaXRpb24gPSBzLT5mb250LT51bmRlcmxpbmVfcG9zaXRpb247CisgICAg ICAgICAgICAgICAgICAgICAgZWxzZSBpZiAocy0+Zm9udCkKKyAgICAgICAgICAgICAgICAgICAg ICAgIHBvc2l0aW9uID0gKHMtPmZvbnQtPmRlc2NlbnQgKyAxKSAvIDI7CisgICAgICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gbWF4IChwb3NpdGlvbiwgdW5k ZXJsaW5lX21pbmltdW1fb2Zmc2V0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAg IC8qIENoZWNrIHRoZSBzYW5pdHkgb2YgdGhpY2tuZXNzIGFuZCBwb3NpdGlvbi4gIFdlIHNob3Vs ZAorICAgICAgICAgICAgICAgICBhdm9pZCBkcmF3aW5nIHVuZGVybGluZSBvdXQgb2YgdGhlIGN1 cnJlbnQgbGluZSBhcmVhLiAgKi8KKyAgICAgICAgICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQg PD0gcy0+eWJhc2UgKyBwb3NpdGlvbikKKyAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5o ZWlnaHQgLSAxKSAtIChzLT55YmFzZSAtIHMtPnkpOworICAgICAgICAgICAgICBpZiAocy0+eSAr IHMtPmhlaWdodCA8IHMtPnliYXNlICsgcG9zaXRpb24gKyB0aGlja25lc3MpCisgICAgICAgICAg ICAgICAgdGhpY2tuZXNzID0gKHMtPnkgKyBzLT5oZWlnaHQpIC0gKHMtPnliYXNlICsgcG9zaXRp b24pOworICAgICAgICAgICAgICBzLT51bmRlcmxpbmVfdGhpY2tuZXNzID0gdGhpY2tuZXNzOwor ICAgICAgICAgICAgICBzLT51bmRlcmxpbmVfcG9zaXRpb24gPXBvc2l0aW9uOworICAgICAgICAg ICAgICB5ID0gcy0+eWJhc2UgKyBwb3NpdGlvbjsKKyAgICAgICAgICAgICAgaWYgKHMtPmZhY2Ut PnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChz LT5mLCBzLT5oZGMsIHMtPmdjLT5mb3JlZ3JvdW5kLCBzLT54LAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHksIHMtPndpZHRoLCAxKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+ZmFjZS0+dW5kZXJsaW5l X2NvbG9yLCBzLT54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHksIHMtPndpZHRo LCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgLyogRHJhdyBvdmVybGluZS4g ICovCisgICAgICBpZiAocy0+ZmFjZS0+b3ZlcmxpbmVfcCkKKyAgICAgICAgeworICAgICAgICAg IHVuc2lnbmVkIGxvbmcgZHkgPSAwLCBoID0gMTsKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+b3Zl cmxpbmVfY29sb3JfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5m LCBzLT5oZGMsIHMtPmdjLT5mb3JlZ3JvdW5kLCBzLT54LAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgcy0+eSArIGR5LCBzLT53aWR0aCwgaCk7CisgICAgICAgICAgICBlbHNlCisgICAgICAg ICAgICAgIHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+ZmFjZS0+b3ZlcmxpbmVfY29s b3IsIHMtPngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPnkgKyBkeSwgcy0+d2lk dGgsIGgpOworICAgICAgICB9CisgICAgICAvKiBEcmF3IHN0cmlrZS10aHJvdWdoLiAgKi8KKyAg ICAgIGlmIChzLT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9wCisgICAgICAgICAgJiYgIUZPTlRfVEVY VE1FVFJJQyAocy0+Zm9udCkudG1TdHJ1Y2tPdXQpCisgICAgICAgIHsKKyAgICAgICAgICB1bnNp Z25lZCBsb25nIGggPSAxOworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZHkgPSAocy0+aGVpZ2h0 IC0gaCkgLyAyOworICAgICAgICAgIGlmIChzLT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9jb2xvcl9k ZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+ Z2MtPmZvcmVncm91bmQsIHMtPngsIHMtPnkgKyBkeSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgIHMtPndpZHRoLCBoKTsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB3MzJfZmlsbF9h cmVhIChzLT5mLCBzLT5oZGMsIHMtPmZhY2UtPnN0cmlrZV90aHJvdWdoX2NvbG9yLCBzLT54LAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+eSArIGR5LCBzLT53aWR0aCwgaCk7CisgICAg ICAgIH0KKyAgICAgIC8qIERyYXcgcmVsaWVmIGlmIG5vdCB5ZXQgZHJhd24uICAqLworICAgICAg aWYgKCFyZWxpZWZfZHJhd25fcCAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gpCisgICAg ICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYm94IChzKTsKKyAgICAgIGlmIChzLT5wcmV2KQorICAg ICAgICB7CisgICAgICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAqcHJldjsKKyAgICAgICAgICBm b3IgKHByZXYgPSBzLT5wcmV2OyBwcmV2OyBwcmV2ID0gcHJldi0+cHJldikKKyAgICAgICAgICAg IGlmIChwcmV2LT5obCAhPSBzLT5obAorICAgICAgICAgICAgICAgICYmIHByZXYtPnggKyBwcmV2 LT53aWR0aCArIHByZXYtPnJpZ2h0X292ZXJoYW5nID4gcy0+eCkKKyAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgIC8qIEFzIHByZXYgd2FzIGRyYXduIHdoaWxlIGNsaXBwZWQgdG8gaXRz IG93biBhcmVhLCB3ZQorICAgICAgICAgICAgICAgICAgIG11c3QgZHJhdyB0aGUgcmlnaHRfb3Zl cmhhbmcgcGFydCB1c2luZyBzLT5obCBub3cuICAqLworICAgICAgICAgICAgICAgIGVudW0gZHJh d19nbHlwaHNfZmFjZSBzYXZlID0gcHJldi0+aGw7CisgICAgICAgICAgICAgICAgcHJldi0+aGwg PSBzLT5obDsKKyAgICAgICAgICAgICAgICBtY193MzJfc2V0X2dseXBoX3N0cmluZ19nYyAocHJl diwgY3Vyc29yX2djX3ApOworICAgICAgICAgICAgICAgIHhfc2V0X2dseXBoX3N0cmluZ19jbGlw cGluZ19leGFjdGx5IChzLCBwcmV2KTsKKyAgICAgICAgICAgICAgICBpZiAocHJldi0+Zmlyc3Rf Z2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSCkKKyAgICAgICAgICAgICAgICAgIHhfZHJhd19nbHlw aF9zdHJpbmdfZm9yZWdyb3VuZCAocHJldik7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICAgICAgeF9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocHJl dik7CisgICAgICAgICAgICAgICAgdzMyX3NldF9jbGlwX3JlY3RhbmdsZSAocHJldi0+aGRjLCBO VUxMKTsKKyAgICAgICAgICAgICAgICBwcmV2LT5obCA9IHNhdmU7CisgICAgICAgICAgICAgICAg cHJldi0+bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBp ZiAocy0+bmV4dCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBnbHlwaF9zdHJpbmcgKm5l eHQ7CisgICAgICAgICAgZm9yIChuZXh0ID0gcy0+bmV4dDsgbmV4dDsgbmV4dCA9IG5leHQtPm5l eHQpCisgICAgICAgICAgICBpZiAobmV4dC0+aGwgIT0gcy0+aGwKKyAgICAgICAgICAgICAgICAm JiBuZXh0LT54IC0gbmV4dC0+bGVmdF9vdmVyaGFuZyA8IHMtPnggKyBzLT53aWR0aCkKKyAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIEFzIG5leHQgd2lsbCBiZSBkcmF3biB3aGls ZSBjbGlwcGVkIHRvIGl0cyBvd24gYXJlYSwKKyAgICAgICAgICAgICAgICAgICB3ZSBtdXN0IGRy YXcgdGhlIGxlZnRfb3ZlcmhhbmcgcGFydCB1c2luZyBzLT5obCBub3cuICAqLworICAgICAgICAg ICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBzYXZlID0gbmV4dC0+aGw7CisgICAgICAgICAg ICAgICAgbmV4dC0+aGwgPSBzLT5obDsKKyAgICAgICAgICAgICAgICBtY193MzJfc2V0X2dseXBo X3N0cmluZ19nYyAobmV4dCwgY3Vyc29yX2djX3ApOworICAgICAgICAgICAgICAgIHhfc2V0X2ds eXBoX3N0cmluZ19jbGlwcGluZ19leGFjdGx5IChzLCBuZXh0KTsKKyAgICAgICAgICAgICAgICBp ZiAobmV4dC0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSCkKKyAgICAgICAgICAgICAg ICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAobmV4dCk7CisgICAgICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICAgICAgeF9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdf Zm9yZWdyb3VuZCAobmV4dCk7CisgICAgICAgICAgICAgICAgdzMyX3NldF9jbGlwX3JlY3Rhbmds ZSAobmV4dC0+aGRjLCBOVUxMKTsKKyAgICAgICAgICAgICAgICBuZXh0LT5obCA9IHNhdmU7Cisg ICAgICAgICAgICAgICAgbmV4dC0+bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICAgICAgICBuZXh0 LT5jbGlwX2hlYWQgPSBzLT5uZXh0OworICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9 CisgIC8qIFJlc2V0IGNsaXBwaW5nLiAgKi8KKyAgdzMyX3NldF9jbGlwX3JlY3RhbmdsZSAocy0+ aGRjLCBOVUxMKTsKKyAgcy0+bnVtX2NsaXBzID0gMDsKK30KKworLyogZW5kIE1VTFRJUExFLUNV UlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC8qIEZyaW5nZSBiaXRtYXBz LiAgKi8KIAogc3RhdGljIGludCBtYXhfZnJpbmdlX2JtcCA9IDA7CkBAIC01NDUsNiArMTM5OCwx NSBAQCB4X3VwZGF0ZV9iZWdpbiAoc3RydWN0IGZyYW1lICpmKQogICBpZiAoISBGUkFNRV9XMzJf UCAoZikpCiAgICAgcmV0dXJuOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gZjsKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogICAvKiBSZWdlbmVyYXRlIGRpc3BsYXkgcGFsZXR0ZSBi ZWZvcmUgZHJhd2luZyBpZiBsaXN0IG9mIHJlcXVlc3RlZAogICAgICBjb2xvcnMgaGFzIGNoYW5n ZWQuICovCiAgIGlmIChkaXNwbGF5X2luZm8tPnJlZ2VuX3BhbGV0dGUpCkBAIC03NTQsNiArMTYx NiwxNiBAQCB4X3VwZGF0ZV9lbmQgKHN0cnVjdCBmcmFtZSAqZikKIAogICAvKiBNb3VzZSBoaWdo bGlnaHQgbWF5IGJlIGRpc3BsYXllZCBhZ2Fpbi4gICovCiAgIE1PVVNFX0hMX0lORk8gKGYpLT5t b3VzZV9mYWNlX2RlZmVyID0gZmFsc2U7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisv KiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBOVUxMOwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiB9CiAKIApAQCA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7ICoqLwotCSAgLyogVHJ5IHRvIG5vdCBkcmF3IG92 ZXIgY2hpbGQgZnJhbWVzLiAgKi8KLQkgIFNldFdpbmRvd1BvcyAoaHduZCwgSFdORF9CT1RUT00s IGxlZnQsIHRvcCwgd2lkdGgsIG1heCAoaGVpZ2h0LCAxKSwKLSAgICAgICAgICAgICAgICAgICAg ICAgIFNXUF9GUkFNRUNIQU5HRUQpOworICAgICAgICAgIGlmIChsZWZ0IDw9IGJhci0+bGVmdCkK KyAgICAgICAgICAgIG15X3Nob3dfd2luZG93IChmLCBod25kLCBTV19ISURFKTsKKyAgICAgICAg ICBNb3ZlV2luZG93IChod25kLCBsZWZ0LCB0b3AsIHdpZHRoLCBtYXggKGhlaWdodCwgMSksIGxl ZnQgPD0gYmFyLT5sZWZ0KTsKKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCiAKIAkgIHNpLmNiU2l6ZSA9IHNpemVvZiAoc2kpOwogCSAgc2ku Zk1hc2sgPSBTSUZfUkFOR0U7CkBAIC00MzE2LDYgKzUyNDksMjEgQEAgdzMyX2p1ZGdlX3Njcm9s bF9iYXJzIChzdHJ1Y3QgZnJhbWUgKmYpCiAgICAgewogICAgICAgc3RydWN0IHNjcm9sbF9iYXIg KmIgPSBYU0NST0xMX0JBUiAoYmFyKTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgLyogYERlc3Ryb3lXaW5kb3cnIHdpdGhpbiBg eF9zY3JvbGxfYmFyX3JlbW92ZScgcmVwYWludHMgdGhlIHJlY3RhbmdsZS4KKyAgICAgIFRoZXJl Zm9yZSwgd2UgZmlyc3Qgc2VuZCBhIG1lc3NhZ2UgdG8gaW5oaWJpdCByZXBhaW50aW5nLiAqLwor ICAgICAgaWYgKCFXSU5ET1dfTElWRV9QIChiLT53aW5kb3cpKQorICAgICAgICB7CisgICAgICAg ICAgSFdORCBod25kID0gU0NST0xMX0JBUl9XMzJfV0lORE9XIChiKTsKKyAgICAgICAgICBTZW5k TWVzc2FnZSAoaHduZCwgV01fU0VUUkVEUkFXLCBmYWxzZSwgMCk7CisgICAgICAgIH0KKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgeF9zY3JvbGxfYmFyX3JlbW92ZSAoYik7 CiAKICAgICAgIG5leHQgPSBiLT5uZXh0OwpAQCAtNzA5MSw2ICs4MDM5LDIxIEBAIGV4dGVybiBm cmFtZV9wYXJtX2hhbmRsZXIgdzMyX2ZyYW1lX3Bhcm1faGFuZGxlcnNbXTsKIAogc3RhdGljIHN0 cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlIHczMl9yZWRpc3BsYXlfaW50ZXJmYWNlID0KIHsKKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyog YHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGB3MzJ0ZXJtLmNgIG11c3QgYmUgaW4gdGhlIGV4YWN0 IHNhbWUgb3JkZXIgYXMgdGhlCitgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYGRpc3BleHRlcm4u aGAhICovCisKKyAgbWNfeF93cml0ZV9nbHlwaHMsCisgIG1jX3czMl9kcmF3X3dpbmRvd19jdXJz b3IsCisgIG1jX3czMl9kcmF3X2dseXBoX3N0cmluZywKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogICB3MzJfZnJhbWVfcGFybV9oYW5kbGVycywKICAgeF9wcm9kdWNlX2dseXBocywK ICAgeF93cml0ZV9nbHlwaHMsCmRpZmYgLS1naXQgYS9zcmMvd2luZG93LmggYi9zcmMvd2luZG93 LmgKaW5kZXggZmRlZjQwNy4uNzIyMDU4MiAxMDA2NDQKLS0tIGEvc3JjL3dpbmRvdy5oCisrKyBi L3NyYy93aW5kb3cuaApAQCAtODgsNiArODgsODQgQEAgZGlzcGxheSB0aGUgbWVudSBiYXIgb3Ig dGhlIHRvb2wgYmFyICh3aGVuIEVtYWNzIHVzZXMgdG9vbGtpdHMgdGhhdAogZG9uJ3QgZGlzcGxh eSB0aGVpciBvd24gbWVudSBiYXIgYW5kIHRvb2wgYmFyKSBvciBhIHRvb2x0aXAgaW4gYQogdG9v bHRpcCBmcmFtZSAod2hlbiB0b29sdGlwcyBhcmUgbm90IGRpc3BsYXkgYnkgdGhlIHRvb2xraXQp LiAgKi8KIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExFLUNV UlNPUlMgKi8KKworLyogU3VmZml4ZXMgZm9yIHRoZSBgbWNgIHdpbmRvdyBwb2ludGVyIHByZWZp eC4gKi8KK3N0cnVjdCBtdWx0aXBsZV9jdXJzb3JzCit7CisgIC8qIFRoZSByZWNvcmRlZCBwaXhl bCB3aWR0aCBvZiB0aGUgbGFzdCBsaW5lIG51bWJlciBkcmF3biBkdXJpbmcgcmVkaXNwbGF5ICov CisgIGludCBsbnVtX3BpeGVsX3dpZHRoOworfTsKKworc3RydWN0IG11bHRpcGxlX2N1cnNvcnNf Y2FjaGUKK3sKKyAgcHRyZGlmZl90IGFsbG9jYXRlZDsKKyAgcHRyZGlmZl90IHVzZWQ7CisgIGVu dW0gdHlwZV9vZl9jYWNoZQorICAgIHsKKyAgICAgIE5PX0NBQ0hFLAorICAgICAgTUNfQ0FDSEUs CisgICAgICBDSF9DQUNIRSwKKyAgICAgIEZDX0NBQ0hFCisgICAgfSBjYWNoZV90eXBlOworICBz dHJ1Y3QgaXRlbXMKKyAgICB7CisgICAgICBpbnQgeDsKKyAgICAgIGludCBmeDsKKyAgICAgIGlu dCB5OworICAgICAgaW50IGZ5OworICAgICAgaW50IGhwb3M7CisgICAgICBpbnQgdnBvczsKKyAg ICAgIGludCB3ZDsKKyAgICAgIGludCBoOworICAgICAgZW51bSB0eXBlX29mX2N1cnNvcgorICAg ICAgICB7CisgICAgICAgICAgLyogTk9URTogIFRoZSBmcmluZ2UgYml0bWFwIGZyYW1ld29yayBy ZWxpZXMgdXBvbiBNQ19OT19GUklOR0VfQklUTUFQCisgICAgICAgICAgSEFWSU5HIEEgVkFMVUUg T0YgWkVSTyAoMCkuICovCisgICAgICAgICAgTUNfTk9fRlJJTkdFX0JJVE1BUCwKKyAgICAgICAg ICBNQ19OT19DVVJTT1IsCisgICAgICAgICAgTUNfUklHSFRfRlJJTkdFX0JJVE1BUCwKKyAgICAg ICAgICBNQ19MRUZUX0ZSSU5HRV9CSVRNQVAsCisgICAgICAgICAgTUNfRlJBTUVEX0JPWCwKKyAg ICAgICAgICBNQ19GSUxMRURfQk9YLAorICAgICAgICAgIE1DX0hPTExPV19CT1gsCisgICAgICAg ICAgTUNfQkFSLAorICAgICAgICAgIE1DX0hCQVIKKyAgICAgICAgfSBjdXJzb3JfdHlwZTsKKyAg ICAgIGludCBjdXJzb3Jfd2lkdGg7CisgICAgICBzdHJ1Y3QgUkdCCisgICAgICAgIHsKKyAgICAg ICAgICBkb3VibGUgcmVkOworICAgICAgICAgIGRvdWJsZSBncmVlbjsKKyAgICAgICAgICBkb3Vi bGUgYmx1ZTsKKyAgICAgICAgfSBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kOworICAgICAgYm9vbCBh Y3RpdmVfcDsKKyAgICAgIGVudW0gbWNfZmxhdm9yCisgICAgICAgIHsKKyAgICAgICAgICBOT19G TEFWT1IsCisgICAgICAgICAgTUNfR0xZUEgsCisgICAgICAgICAgTUNfR0xZUEhMRVNTLAorICAg ICAgICAgIE1DX09WRVJMQVlfQVJST1dfQklUTUFQLAorICAgICAgICAgIE1DX1BJTENST1csCisg ICAgICAgICAgTUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVywKKyAgICAgICAgICBNQ19S RVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XLAorICAgICAgICAgIE1DX0hPTExP V19SRUNUQU5HTEUsCisgICAgICAgICAgTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XLAorICAg ICAgICAgIE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVywKKyAgICAgICAgICBN Q19WRVJUSUNBTF9CQVIsCisgICAgICAgICAgTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSLAorICAg ICAgICAgIE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgfSBnbHlwaF9mbGF2b3I7 CisgICAgICBib29sIGVuYWJsZWRfcDsKKyAgICB9ICpjYWNoZXM7Cit9OworCisvKiBlbmQgTVVM VElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogc3RydWN0IGN1 cnNvcl9wb3MKIHsKICAgLyogUGl4ZWwgcG9zaXRpb24uICBUaGVzZSBhcmUgYWx3YXlzIHdpbmRv dyByZWxhdGl2ZS4gICovCkBAIC0zMjQsNiArNDAyLDIxIEBAIHN0cnVjdCB3aW5kb3cKIAogI2lm ZGVmIEhBVkVfV0lORE9XX1NZU1RFTQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyog TVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgc3RydWN0IG11bHRpcGxlX2N1cnNvcnMgbWM7CisK KyAgICBzdHJ1Y3QgbXVsdGlwbGVfY3Vyc29yc19jYWNoZSBtY19lbHRzOworCisgICAgc3RydWN0 IG11bHRpcGxlX2N1cnNvcnNfY2FjaGUgY2hfZWx0czsKKworICAgIHN0cnVjdCBtdWx0aXBsZV9j dXJzb3JzX2NhY2hlIGZjX2VsdHM7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAg ICAvKiBDdXJzb3IgdHlwZSBvZiBsYXN0IGN1cnNvciBkcmF3biBvbiB0aGUgd2luZG93LiAgKi8K ICAgICBlbnVtIHRleHRfY3Vyc29yX2tpbmRzIHBoeXNfY3Vyc29yX3R5cGU7CiAKQEAgLTExMjAs NiArMTIxMywxNSBAQCBleHRlcm4gdm9pZCByZWRpc3BsYXlfb3RoZXJfd2luZG93cyAodm9pZCk7 CiAKIHN0cnVjdCBnbHlwaCAqZ2V0X3BoeXNfY3Vyc29yX2dseXBoIChzdHJ1Y3Qgd2luZG93ICp3 KTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8K Kworc3RydWN0IGdseXBoICptY19nZXRfY3Vyc29yX2dseXBoIChzdHJ1Y3Qgd2luZG93ICp3LCBz dHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgaW50IGhw b3MsIGludCB2cG9zKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCis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kg ICAgICBNQ19CVUlMRF9TVFJFVENIX0dMWVBIX1NUUklORyAoU1RBUlQsIEVORCwgSEVBRCwgVEFJ TCwJXAorCQkJCQkgIEhMLCBYLCBMQVNUX1gpOwkJXAorCSAgICAgIGJyZWFrOwkJCQkJCQlcCisJ CQkJCQkJCQlcCisJICAgIGNhc2UgSU1BR0VfR0xZUEg6CQkJCQkJXAorCSAgICAgIE1DX0JVSUxE X0lNQUdFX0dMWVBIX1NUUklORyAoU1RBUlQsIEVORCwgSEVBRCwgVEFJTCwJCVwKKwkJCQkJSEws IFgsIExBU1RfWCk7CQkJXAorCSAgICAgIGJyZWFrOworCisjZGVmaW5lIE1DX0JVSUxEX0dMWVBI X1NUUklOR1NfWFcoU1RBUlQsIEVORCwgSEVBRCwgVEFJTCwgSEwsIFgsIExBU1RfWCkJXAorICAg ICAgICAgICAgY2FzZSBYV0lER0VUX0dMWVBIOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgXAorICAgICAgICAgICAgICBNQ19CVUlMRF9YV0lER0VUX0dMWVBIX1NUUklO RyAoU1RBUlQsIEVORCwgSEVBRCwgVEFJTCwgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgSEwsIFgsIExBU1RfWCk7ICAgICAgICAgICAgICAgXAorICAg ICAgICAgICAgICBicmVhazsKKworI2RlZmluZSBNQ19CVUlMRF9HTFlQSF9TVFJJTkdTXzIoU1RB UlQsIEVORCwgSEVBRCwgVEFJTCwgSEwsIFgsIExBU1RfWCkJXAorCSAgICBjYXNlIEdMWVBITEVT U19HTFlQSDoJCQkJCVwKKwkgICAgICBNQ19CVUlMRF9HTFlQSExFU1NfR0xZUEhfU1RSSU5HIChT VEFSVCwgRU5ELCBIRUFELCBUQUlMLAlcCisJCQkJCSAgICBITCwgWCwgTEFTVF9YKTsJCVwKKwkg ICAgICBicmVhazsJCQkJCQkJXAorCQkJCQkJCQkJXAorCSAgICBkZWZhdWx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amVjdCBlbGVtID0gRmNvbnMgKHZhX2FyZyAoYXAsIExpc3BfT2Jq ZWN0KSwgUW5pbCk7CisgICAgICBYU0VUQ0RSICh0YWlsLCBlbGVtKTsKKyAgICAgIHRhaWwgPSBl bGVtOworICAgIH0KKyAgdmFfZW5kIChhcCk7CisgIHJldHVybiB2YWw7Cit9CisKK0xpc3BfT2Jq ZWN0CittY19tZW1xIChMaXNwX09iamVjdCBlbHQsIExpc3BfT2JqZWN0IGxpc3QpCit7CisgIHdo aWxlICgxKQorICAgIHsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpIHx8IEVRIChYQ0FSIChsaXN0 KSwgZWx0KSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAg ICBpZiAoIUNPTlNQIChsaXN0KSB8fCBFUSAoWENBUiAobGlzdCksIGVsdCkpCisgICAgICAgIGJy ZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkg fHwgRVEgKFhDQVIgKGxpc3QpLCBlbHQpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBY Q0RSIChsaXN0KTsKKyAgICB9CisgIHJldHVybiBsaXN0OworfQorCitMaXNwX09iamVjdAorbWNf bnRoIChpbnQgbnVtLCBMaXNwX09iamVjdCBsaXN0KQoreworICBmb3IgKGludCBpID0gMDsgaSA8 IG51bSAmJiAhTklMUCAobGlzdCk7IGkrKykKKyAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgIGlm IChDT05TUCAobGlzdCkpCisgICAgcmV0dXJuIFhDQVIgKGxpc3QpOworICAgIGVsc2UKKyAgICAg IHJldHVybiBRbmlsOworfQorCitMaXNwX09iamVjdAorbWNfYXNzcSAoTGlzcF9PYmplY3Qga2V5 LCBMaXNwX09iamVjdCBsaXN0KQoreworICB3aGlsZSAoMSkKKyAgICB7CisgICAgICBpZiAoIUNP TlNQIChsaXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAg ICAgICYmIEVRIChYQ0FSIChYQ0FSIChsaXN0KSksIGtleSkpKQorICAgICAgICBicmVhazsKKyAg ICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAg ICAgfHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgRVEgKFhDQVIgKFhD QVIgKGxpc3QpKSwga2V5KSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxp c3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIg KGxpc3QpKQorICAgICAgICAgICAgICAmJiBFUSAoWENBUiAoWENBUiAobGlzdCkpLCBrZXkpKSkK KyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgfQorICBpZiAo Q09OU1AgKGxpc3QpKQorICAgIHJldHVybiBYQ0FSIChsaXN0KTsKKyAgICBlbHNlCisgICAgICBy ZXR1cm4gUW5pbDsKK30KKworTGlzcF9PYmplY3QKK21jX2Fzc29jIChMaXNwX09iamVjdCBrZXks IExpc3BfT2JqZWN0IGxpc3QpCit7CisgIExpc3BfT2JqZWN0IGNhcjsKKyAgd2hpbGUgKDEpCisg ICAgeworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIg KGxpc3QpKQorICAgICAgICAgICAgICAmJiAoY2FyID0gWENBUiAoWENBUiAobGlzdCkpLAorICAg ICAgICAgICAgICAgICAgRVEgKGNhciwga2V5KSB8fCAhTklMUCAoRmVxdWFsIChjYXIsIGtleSkp KSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYg KCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQorICAgICAg ICAgICAgICAmJiAoY2FyID0gWENBUiAoWENBUiAobGlzdCkpLAorICAgICAgICAgICAgICAgICAg RVEgKGNhciwga2V5KSB8fCAhTklMUCAoRmVxdWFsIChjYXIsIGtleSkpKSkpCisgICAgICAgIGJy ZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkK KyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAgICAgICAmJiAoY2Fy ID0gWENBUiAoWENBUiAobGlzdCkpLAorICAgICAgICAgICAgICAgICAgRVEgKGNhciwga2V5KSB8 fCAhTklMUCAoRmVxdWFsIChjYXIsIGtleSkpKSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlz dCA9IFhDRFIgKGxpc3QpOworICAgIH0KKyAgaWYgKENPTlNQIChsaXN0KSkKKyAgICByZXR1cm4g WENBUiAobGlzdCk7CisgICAgZWxzZQorICAgICAgcmV0dXJuIFFuaWw7Cit9CisKK0xpc3BfT2Jq ZWN0CittY19wbGlzdF9nZXQgKExpc3BfT2JqZWN0IHBsaXN0LCBMaXNwX09iamVjdCBwcm9wKQor eworICBMaXNwX09iamVjdCB0YWlsLCBoYWxmdGFpbDsKKyAgLyogaGFsZnRhaWwgaXMgdXNlZCB0 byBkZXRlY3QgY2lyY3VsYXIgbGlzdHMuICAqLworICB0YWlsID0gaGFsZnRhaWwgPSBwbGlzdDsK KyAgd2hpbGUgKENPTlNQICh0YWlsKSAmJiBDT05TUCAoWENEUiAodGFpbCkpKQorICAgIHsKKyAg ICAgIGlmIChFUSAocHJvcCwgWENBUiAodGFpbCkpKQorICAgICAgICByZXR1cm4gWENBUiAoWENE UiAodGFpbCkpOworICAgICAgdGFpbCA9IFhDRFIgKFhDRFIgKHRhaWwpKTsKKyAgICAgIGhhbGZ0 YWlsID0gWENEUiAoaGFsZnRhaWwpOworICAgICAgaWYgKEVRICh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uaWwpOworICAgIGlmIChz Y2FuICE9IG9sZF9zY2FuKQorICAgICAgc2Nhbl9ieXRlID0gQ0hBUl9UT19CWVRFIChzY2FuKTsK KyAgICBpZiAoc2NhbiA+PSBlbmQpCisgICAgICBnb3RvIGVuZGxvb3A7CisgIH0KKyAgICAgIC8q IFRlc3QgcmVhY2hpbmcgdGhlIGdvYWwgY29sdW1uLiAgV2UgZG8gdGhpcyBhZnRlciBza2lwcGlu ZworICAgaW52aXNpYmxlIGNoYXJhY3RlcnMsIHNvIHRoYXQgd2UgcHV0IHBvaW50IGJlZm9yZSB0 aGUKKyAgIGNoYXJhY3RlciBvbiB3aGljaCB0aGUgY3Vyc29yIHdpbGwgYXBwZWFyLiAqLworICAg ICAgaWYgKGNvbCA+PSBnb2FsKQorICBicmVhazsKKyAgICAgIHByZXZfY29sID0gY29sOworICAg ICAgeyAvKiBDaGVjayBkaXNwbGF5IHByb3BlcnR5LiAqLworICBwdHJkaWZmX3QgZW5kcDsKKyAg aW50IHdpZHRoID0gbWNfY2hlY2tfZGlzcGxheV93aWR0aCAoc2NhbiwgY29sLCAmZW5kcCk7Cisg IGlmICh3aWR0aCA+PSAwKQorICAgIHsKKyAgICAgIGNvbCArPSB3aWR0aDsKKyAgICAgIGlmIChl bmRwID4gc2NhbikgLyogQXZvaWQgaW5maW5pdGUgbG9vcHMgd2l0aCAwLXdpZHRoIG92ZXJsYXlz LiAqLworICAgICAgICB7CisgICAgc2NhbiA9IGVuZHA7CisgICAgc2Nhbl9ieXRlID0gQ0hBUl9U T19CWVRFIChzY2FuKTsKKyAgICBjb250aW51ZTsKKyAgICAgICAgfQorICAgIH0KKyAgICAgIH0K KyAgICAgIC8qIENoZWNrIGNvbXBvc2l0aW9uIHNlcXVlbmNlLiAqLworICAgICAgaWYgKGNtcF9p dC5pZCA+PSAwCisgICAgfHwgKHNjYW4gPT0gY21wX2l0LnN0b3BfcG9zCisgICAgICAgICYmIGNv bXBvc2l0aW9uX3Jlc2VhdF9pdCA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nbHlwaHMu CisgICAgICAgVXBkYXRlIHRoZSBjb2x1bW4vcG9zaXRpb24gYmFzZWQgb24gdGhvc2UgZ2x5cGhz LiAqLworICAgIGNoYXJ2ZWMgPSBESVNQX0NIQVJfVkVDVE9SIChkcCwgYyk7CisgICAgbiA9IEFT SVpFIChjaGFydmVjKTsKKyAgICBmb3IgKGkgPSAwOyBpIDwgbjsgaSsrKQorICAgICAgeworICAg ICAgICAvKiBUaGlzIHNob3VsZCBiZSBoYW5kbGVkIHRoZSBzYW1lIGFzCisgICAgIG5leHRfZWxl bWVudF9mcm9tX2Rpc3BsYXlfdmVjdG9yIGRvZXMgaXQuICovCisgICAgICAgIExpc3BfT2JqZWN0 IGVudHJ5ID0gQVJFRiAoY2hhcnZlYywgaSk7CisgICAgICAgIGlmIChHTFlQSF9DT0RFX1AgKGVu dHJ5KSkKKyAgICBjID0gR0xZUEhfQ09ERV9DSEFSIChlbnRyeSk7CisgICAgICAgIGVsc2UKKyAg ICBjID0gJyAnOworICAgICAgICBpZiAoYyA9PSAnXG4nKQorICAgIGdvdG8gZW5kbG9vcDsKKyAg ICAgICAgaWYgKGMgPT0gJ1xyJyAmJiBFUSAoQlZBUiAoY3VycmVudF9idWZmZXIsIHNlbGVjdGl2 ZV9kaXNwbGF5KSwgUXQpKQorICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgaWYgKGMgPT0gJ1x0 JykKKyAgICB7CisgICAgICBjb2wgKz0gdGFiX3dpZHRoOworICAgICAgY29sID0gY29sIC8gdGFi X3dpZHRoICogdGFiX3dpZHRoOworICAgIH0KKyAgICAgICAgZWxzZQorICAgICsrY29sOworICAg ICAgfQorICB9CisgICAgICBlbHNlCisgIHsKKyAgICAvKiBUaGUgZGlzcGxheSB0YWJsZSBkb2Vz bid0IGFmZmVjdCB0aGlzIGNoYXJhY3RlcjsKKyAgICAgICBpdCBkaXNwbGF5cyBhcyBpdHNlbGYu ICovCisgICAgaWYgKGMgPT0gJ1xuJykKKyAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICBpZiAoYyA9 PSAnXHInICYmIEVRIChCVkFSIChjdXJyZW50X2J1ZmZlciwgc2VsZWN0aXZlX2Rpc3BsYXkpLCBR dCkpCisgICAgICBnb3RvIGVuZGxvb3A7CisgICAgaWYgKGMgPT0gJ1x0JykKKyAgICAgIHsKKyAg ICAgICAgY29sICs9IHRhYl93aWR0aDsKKyAgICAgICAgY29sID0gY29sIC8gdGFiX3dpZHRoICog dGFiX3dpZHRoOworICAgICAgfQorICAgIGVsc2UgaWYgKG11bHRpYnl0ZSAmJiBMRUFESU5HX0NP REVfUCAoYykpCisgICAgICB7CisgICAgICAgIC8qIFN0YXJ0IG9mIG11bHRpLWJ5dGUgZm9ybS4g Ki8KKyAgICAgICAgdW5zaWduZWQgY2hhciAqcHRyOworICAgICAgICBpbnQgYnl0ZXMsIHdpZHRo OworICAgICAgICBwdHIgPSBCWVRFX1BPU19BRERSIChzY2FuX2J5dGUpOworICAgICAgICBNQ19N VUxUSUJZVEVfQllURVNfV0lEVEggKHB0ciwgZHAsIGJ5dGVzLCB3aWR0aCk7CisgICAgICAgIC8q IFN1YnRyYWN0IG9uZSB0byBjb21wZW5zYXRlIGZvciB0aGUgaW5jcmVtZW50CisgICAgIHRoYXQg aXMgZ29pbmcgdG8gaGFwcGVuIGJlbG93LiAqLworICAgICAgICBzY2FuX2J5dGUgKz0gYnl0ZXMg LSAxOworICAgICAgICBjb2wgKz0gd2lkdGg7CisgICAgICB9CisgICAgZWxzZSBpZiAoY3RsX2Fy cm93ICYmIChjIDwgMDQwIHx8IGMgPT0gMDE3NykpCisgICAgICBjb2wgKz0gMjsKKyAgICBlbHNl IGlmIChjIDwgMDQwIHx8IGMgPj0gMDE3NykKKyAgICAgIGNvbCArPSA0OworICAgIGVsc2UKKyAg ICAgIGNvbCsrOworICB9CisgICAgICBzY2FuKys7CisgICAgICBzY2FuX2J5dGUrKzsKKyAgICB9 CisgZW5kbG9vcDoKKyAgbGFzdF9rb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AuICov CisgICAgaWYgKHB0ciA9PSBCRUdWX0FERFIpCisgICAgICBicmVhazsKKyAgICAvKiBJdCB3YXMg dGhlIGdhcC4gIEp1bXAgYmFjayBvdmVyIGl0LiAqLworICAgIHN0b3AgPSBCRUdWX0FERFI7Cisg ICAgcHRyID0gR1BUX0FERFI7CisgICAgLyogQ2hlY2sgd2hldGhlciB0aGF0IGJyaW5ncyB1cyB0 byBiZWdpbm5pbmcgb2YgYnVmZmVyLiAqLworICAgIGlmIChCRUdWID49IEdQVCkKKyAgICAgIGJy ZWFrOworICB9CisgICAgICBjID0gKi0tcHRyOworICAgICAgaWYgKGRwICYmIFZFQ1RPUlAgKERJ U1BfQ0hBUl9WRUNUT1IgKGRwLCBjKSkpCisgIHsKKyAgICBjaGFydmVjID0gRElTUF9DSEFSX1ZF Q1RPUiAoZHAsIGMpOworICAgIG4gPSBBU0laRSAoY2hhcnZlYyk7CisgIH0KKyAgICAgIGVsc2UK KyAgeworICAgIGNoYXJ2ZWMgPSBRbmlsOworICAgIG4gPSAxOworICB9CisgICAgICBmb3IgKGkg PSBuIC0gMTsgaSA+PSAwOyAtLWkpCisgIHsKKyAgICBpZiAoVkVDVE9SUCAoY2hhcnZlYykpCisg ICAgICB7CisgICAgICAgIC8qIFRoaXMgc2hvdWxkIGJlIGhhbmRsZWQgdGhlIHNhbWUgYXMKKyAg ICAgbmV4dF9lbGVtZW50X2Zyb21fZGlzcGxheV92ZWN0b3IgZG9lcyBpdC4gKi8KKyAgICAgICAg TGlzcF9PYmplY3QgZW50cnkgPSBBUkVGIChjaGFydmVjLCBpKTsKKyAgICAgICAgaWYgKEdMWVBI X0NPREVfUCAoZW50cnkpKQorICAgIGMgPSBHTFlQSF9DT0RFX0NIQVIgKGVudHJ5KTsKKyAgICAg ICAgZWxzZQorICAgIGMgPSAnICc7CisgICAgICB9CisgICAgaWYgKGMgPj0gMDQwICYmIGMgPCAw MTc3KQorICAgICAgY29sKys7CisgICAgZWxzZSBpZiAoYyA9PSAnXG4nCisgICAgICAgfHwgKGMg PT0gJ1xyJworICAgICAgICAgICAmJiBFUSAoQlZBUiAoY3VycmVudF9idWZmZXIsIHNlbGVjdGl2 ZV9kaXNwbGF5KSwgUXQpKSkKKyAgICAgIHsKKyAgICAgICAgcHRyKys7CisgICAgICAgIGdvdG8g c3RhcnRfb2ZfbGluZV9mb3VuZDsKKyAgICAgIH0KKyAgICBlbHNlIGlmIChjID09ICdcdCcpCisg ICAgICB7CisgICAgICAgIGlmICh0YWJfc2VlbikKKyAgICBjb2wgPSAoKGNvbCArIHRhYl93aWR0 aCkgLyB0YWJfd2lkdGgpICogdGFiX3dpZHRoOworICAgICAgICBwb3N0X3RhYiArPSBjb2w7Cisg ICAgICAgIGNvbCA9IDA7CisgICAgICAgIHRhYl9zZWVuID0gMTsKKyAgICAgIH0KKyAgICBlbHNl IGlmIChWRUNUT1JQIChjaGFydmVjKSkKKyAgICAgIC8qIFdpdGggYSBkaXNwbGF5IHRhYmxlIGVu dHJ5LCBDIGlzIGRpc3BsYXllZCBhcyBpcywgYW5kCisgICAgICAgICBub3QgZGlzcGxheWVkIGFz IFxOTk4gb3IgYXMgXk4uICBJZiBDIGlzIGEgc2luZ2xlLWJ5dGUKKyAgICAgICAgIGNoYXJhY3Rl ciwgaXQgdGFrZXMgb25lIGNvbHVtbi4gIElmIEMgaXMgbXVsdGktYnl0ZSBpbgorICAgICAgICAg YSB1bmlieXRlIGJ1ZmZlciwgaXQncyB0cmFuc2xhdGVkIHRvIHVuaWJ5dGUsIHNvIGl0CisgICAg ICAgICBhbHNvIHRha2VzIG9uZSBjb2x1bW4uICovCisgICAgICArK2NvbDsKKyAgICBlbHNlCisg ICAgICBjb2wgKz0gKGN0bF9hcnJvdyAmJiBjIDwgMDIwMCkgPyAyIDogNDsKKyAgfQorICAgIH0K KyBzdGFydF9vZl9saW5lX2ZvdW5kOgorICBpZiAodGFiX3NlZW4pCisgICAgeworICAgICAgY29s ID0gKChjb2wgKyB0YWJfd2lkdG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dG9fc3RyaW5nICh3aW5kb3csIFFuaWwpKTsKK30KKworLyogVVNBR0U6ICBmcHJpbnRmIChz dGRlcnIsICJDSEFSQUNURVIgKCVzKSIsIG1jX2NoYXJfdG9fc3RyaW5nIChnbHlwaC0+dS5jaCkp OyAqLworY2hhciAqCittY19jaGFyX3RvX3N0cmluZyAoaW50IGFyZykKK3sKKyAgTGlzcF9PYmpl Y3QgY2hhcmFjdGVyID0gKDAgPD0gYXJnICYmIGFyZyA8PSBNQVhfQ0hBUikKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gRmNoYXJfdG9fc3RyaW5nIChtYWtlX2ZpeG51bSAoYXJnKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogUW5pbDsKKyAgY2hhciAqIHJlc3VsdCA9ICghTklM UCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICYmIGFyZyA9PSA5KQorICAgICAgICAg ICAgICAgICAgICA/ICJcXHQiCisgICAgICAgICAgICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVy KQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnID09IDEwKQorICAgICAgICAgICAgICAgICAg ICA/ICJcXG4iCisgICAgICAgICAgICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAg ICAgICAgICAgICAgICAgJiYgYXJnID09IDMyKQorICAgICAgICAgICAgICAgICAgICA/ICJcXHMi CisgICAgICAgICAgICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAg ICAgICAgJiYgYXJnICE9IDkKKyAgICAgICAgICAgICAgICAgICAgICYmIGFyZyAhPSAxMAorICAg ICAgICAgICAgICAgICAgICAgJiYgYXJnICE9IDMyKQorICAgICAgICAgICAgICAgICAgICA/IFNT REFUQSAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgOiAiXFw/IjsKKyAgcmV0dXJuIHJl c3VsdDsKK30KKworaW50CittY19saXNwX3RvX2N1cnNvcl90eXBlIChMaXNwX09iamVjdCBhcmcp Cit7CisgIGNoYXIgKnN0cjsKKyAgaWYgKFhUWVBFIChhcmcpID09IExpc3BfU3RyaW5nKQorICAg IHN0ciA9IFNTREFUQSAoYXJnKTsKKyAgICBlbHNlIGlmIChYVFlQRSAoYXJnKSA9PSBMaXNwX1N5 bWJvbCkKKyAgICAgIHN0ciA9IFNTREFUQSAoU1lNQk9MX05BTUUgKGFyZykpOworICAgICAgZWxz ZSByZXR1cm4gLTE7CisgIGlmICghc3RyY21wIChzdHIsICJubyIpKQorICAgIHJldHVybiBNQ19O T19DVVJTT1I7CisgIGlmICghc3RyY21wIChzdHIsICJtYy1sZWZ0LWZyaW5nZS1iaXRtYXAiKSkK KyAgICByZXR1cm4gTUNfTEVGVF9GUklOR0VfQklUTUFQOworICBpZiAoIXN0cmNtcCAoc3RyLCAi bWMtcmlnaHQtZnJpbmdlLWJpdG1hcCIpKQorICAgIHJldHVybiBNQ19SSUdIVF9GUklOR0VfQklU TUFQOworICBpZiAoIXN0cmNtcCAoc3RyLCAiYm94IikpCisgICAgcmV0dXJuIE1DX0ZJTExFRF9C T1g7CisgIGlmICghc3RyY21wIChzdHIsICJmcmFtZWQiKSkKKyAgICByZXR1cm4gTUNfRlJBTUVE X0JPWDsKKyAgaWYgKCFzdHJjbXAgKHN0ciwgImhvbGxvdyIpKQorICAgIHJldHVybiBNQ19IT0xM T1dfQk9YOworICBpZiAoIXN0cmNtcCAoc3RyLCAiYmFyIikpCisgICAgcmV0dXJuIE1DX0JBUjsK KyAgaWYgKCFzdHJjbXAgKHN0ciwgImhiYXIiKSkKKyAgICByZXR1cm4gTUNfSEJBUjsKKyAgcmV0 dXJuIC0xOworfQorCisvKiBVU0FHRTogIGZwcmludGYgKHN0ZGVyciwgIkNVUlNPUiBUWVBFICgl cykiLCBtY19jdXJzb3JfdHlwZV90b19zdHJpbmcgKGFyZykpOyAqLworY2hhciAqCittY19jdXJz b3JfdHlwZV90b19zdHJpbmcgKGVudW0gdHlw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BgaScuICovCisgIGkgPSBzdGFydDsKKyAgVVNFX1NBRkVfQUxM T0NBOworICBNQ19CVUlMRF9HTFlQSF9TVFJJTkdTIChpLCBlbmQsIGhlYWQsIHRhaWwsIGhsLCB4 LCBsYXN0X3gpOworICBpZiAodGFpbCkKKyAgICB7CisgICAgICBzID0gZ2x5cGhfc3RyaW5nX2Nv bnRhaW5pbmdfYmFja2dyb3VuZF93aWR0aCAodGFpbCk7CisgICAgICB4X3JlYWNoZWQgPSBzLT54 ICsgcy0+YmFja2dyb3VuZF93aWR0aDsKKyAgICB9CisgIGVsc2UKKyAgICB4X3JlYWNoZWQgPSB4 OworICAvKiBJZiB0aGVyZSBhcmUgYW55IGdseXBocyB3aXRoIGxiZWFyaW5nIDwgMCBvciByYmVh cmluZyA+IHdpZHRoIGluCisgICAgIHRoZSByb3csIHJlZHJhdyBzb21lIGdseXBocyBpbiBmcm9u dCBvciBmb2xsb3dpbmcgdGhlIGdseXBoCisgICAgIHN0cmluZ3MgYnVpbHQgYWJvdmUuICovCisg IGlmIChoZWFkICYmICFvdmVybGFwcyAmJiByb3ctPmNvbnRhaW5zX292ZXJsYXBwaW5nX2dseXBo c19wKQorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlwaF9zdHJpbmcgKmgsICp0OworICAgICAgTW91 c2VfSExJbmZvICpobGluZm8gPSBNT1VTRV9ITF9JTkZPIChmKTsKKyAgICAgIGludCBtb3VzZV9i ZWdfY29sIFVOSU5JVCwgbW91c2VfZW5kX2NvbCBVTklOSVQ7CisgICAgICBib29sIGNoZWNrX21v dXNlX2ZhY2UgPSBmYWxzZTsKKyAgICAgIGludCBkdW1teV94ID0gMDsKKyAgICAgIC8qIElmIG1v dXNlIGhpZ2hsaWdodGluZyBpcyBvbiwgd2UgbWF5IG5lZWQgdG8gZHJhdyBhZGphY2VudAorICAg Z2x5cGhzIHVzaW5nIG1vdXNlLWZhY2UgaGlnaGxpZ2h0aW5nLiAqLworICAgICAgaWYgKGFyZWEg PT0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mbGF2b3IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29y X3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOworI2lmbmRlZiBIQVZFX05TCisgIC8q IFdoZW4gZm9jdXMgYSBzb2xlIGZyYW1lIGFuZCBtb3ZlIGhvcml6b250YWxseSwgdGhpcyBjbGVh cnMgb25fcAorICAgICBjYXVzaW5nIGEgZmFpbHVyZSB0byBlcmFzZSBwcmV2IGN1cnNvciBwb3Np dGlvbi4gKi8KKyAgaWYgKGFyZWEgPT0gVEVYVF9BUkVBCisgICAgICAmJiAhcm93LT5mdWxsX3dp ZHRoX3AKKyAgICAgIC8qIFdoZW4gZHJhd2luZyBvdmVybGFwcGluZyByb3dzLCBvbmx5IHRoZSBn bHlwaCBzdHJpbmdzJworICAgICAgZm9yZWdyb3VuZCBpcyBkcmF3biwgd2hpY2ggZG9lc24ndCBl cmFzZSBhIGN1cnNvciBjb21wbGV0ZWx5LiAqLworICAgICAgJiYgIW92ZXJsYXBzKQorICAgIHsK KyAgICAgIGludCB4MCA9IGNsaXBfaGVhZCA/IGNsaXBfaGVhZC0+eCA6IChoZWFkID8gaGVhZC0+ eCA6IHgpOworICAgICAgaW50IHgxID0gKGNsaXBfdGFpbCA/IGNsaXBfdGFpbC0+eCArIGNsaXBf dGFpbC0+YmFja2dyb3VuZF93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICA6ICh0YWls ID8gdGFpbC0+eCArIHRhaWwtPmJhY2tncm91bmRfd2lkdGggOiB4KSk7CisgICAgICB4MCAtPSBh cmVhX2xlZnQ7CisgICAgICB4MSAtPSBhcmVhX2xlZnQ7CisgICAgICBub3RpY2Vfb3ZlcndyaXR0 ZW5fY3Vyc29yICh3LCBURVhUX0FSRUEsIHgwLCB4MSwKKyAgICAgICAgIHJvdy0+eSwgTUFUUklY X1JPV19CT1RUT01fWSAocm93KSk7CisgICAgfQorI2VuZGlmCisgIC8qIFZhb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2l6ZWQuCisgICAgIERvbid0IGJvdGhl ciB0byBlcmFzZSB0aGUgY3Vyc29yLiAqLworICBpZiAodnBvcyA+PSBtYXRyaXgtPm5yb3dzKQor ICAgIHsKKyAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19l cmFzZV9jdXJzb3I6ICByZXR1cm4gKCVkKVxuIiwgMik7CisgICAgICByZXR1cm47CisgICAgfQor ICAvKiBJZiByb3cgY29udGFpbmluZyBjdXJzb3IgaXMgbWFya2VkIGludmFsaWQsIHRoZXJlIGlz IG5vdGhpbmcgd2UKKyAgICAgY2FuIGRvLiAqLworICBpZiAoIXJvdy0+ZW5hYmxlZF9wKQorICAg IHsKKyAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19lcmFz ZV9jdXJzb3I6ICByZXR1cm4gKCVkKVxuIiwgMyk7CisgICAgICByZXR1cm47CisgICAgfQorICAv KiBJZiBsaW5lIHNwYWNpbmcgaXMgPiAwLCBvbGQgY3Vyc29yIG1heSBvbmx5IGJlIHBhcnRpYWxs eSB2aXNpYmxlIGluCisgICAgIHdpbmRvdyBhZnRlciBzcGxpdC13aW5kb3cuICBTbyBhZGp1c3Qg dmlzaWJsZSBoZWlnaHQuICovCisgIHJvdy0+dmlzaWJsZV9oZWlnaHQgPSBtaW4gKHJvdy0+dmlz aWJsZV9oZWlnaHQsCisgICAgICAgICAgICB3aW5kb3dfdGV4dF9ib3R0b21feSAodykgLSByb3ct PnkpOworICAvKiBJZiByb3cgaXMgY29tcGxldGVseSBpbnZpc2libGUsIGRvbid0IGF0dGVtcHQg dG8gZGVsZXRlIGEgY3Vyc29yIHdoaWNoCisgICAgIGlzbid0IHRoZXJlLiAgVGhpcyBjYW4gaGFw cGVuIGlmIGN1cnNvciBpcyBhdCB0b3Agb2YgYSB3aW5kb3csIGFuZAorICAgICB3ZSBzd2l0Y2gg dG8gYSBidWZmZXIgd2l0a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nNvciBhcHBlYXJzIHRoZXJlLCBidXQKKyAgICAgIG1vdXNlIGhpZ2hs aWdodGluZyBkb2VzIG5vdC4gKi8KKyAgICAgICYmIHJvdy0+dXNlZFtURVhUX0FSRUFdID4gaHBv cyAmJiBocG9zID49IDApCisgICAgbW91c2VfZmFjZV9oZXJlX3AgPSB0cnVlOworICAvKiBNYXli ZSBjbGVhciB0aGUgZGlzcGxheSB1bmRlciB0aGUgY3Vyc29yLiAqLworICBpZiAoY3Vyc29yX3R5 cGUgPT0gTUNfSE9MTE9XX0JPWAorICAgICAgfHwgY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JP WCkKKyAgICB7CisgICAgICBpbnQgdGVtcF94ID0geDsKKyAgICAgIGludCBoZWFkZXJfbGluZV9o ZWlnaHQgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgICAgIGN1cnNvcl9nbHlw aCA9IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBocG9zLCB2cG9zKTsKKyAg ICAgIGlmIChjdXJzb3JfZ2x5cGggPT0gTlVMTCkKKyAgICAgICAgeworICAgICAgICAgIGlmIChk ZWJ1Z19wKQorICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZXJhc2VfY3Vyc29yOiAg cmV0dXJuICglZClcbiIsIDcpOworICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAg aW50IHRlbXBfd2QgPSBjdXJzb3JfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgaWYgKHRlbXBf eCA8IDApCisgICAgICAgIHsKKyAgICAgICAgICB0ZW1wX3dkICs9IHRlbXBfeDsKKyAgICAgICAg ICB0ZW1wX3ggPSAwOworICAgICAgICB9CisgICAgICB0ZW1wX3dkID0gbWluICh3ZCwgd2luZG93 X2JveF93aWR0aCAodywgVEVYVF9BUkVBKSAtIHRlbXBfeCk7CisgICAgICBpbnQgZnkgPSBXSU5E T1df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C0+bnJvd3MpOyAqLworICBib29sIGJhcmZfY3Jhc2hf b25lID0gKG1hdHJpeCAmJiBtYXRyaXgtPnJvd3MpID8gZmFsc2UgOiB0cnVlOworICBpZiAoYmFy Zl9jcmFzaF9vbmUpCisgICAgcmV0dXJuOworICBib29sIGJhcmZfY3Jhc2hfdHdvID0gKHZwb3Mg Pj0gMCAmJiB2cG9zIDwgbWF0cml4LT5ucm93cykgPyBmYWxzZSA6IHRydWU7CisgIGlmIChiYXJm X2NyYXNoX3R3bykKKyAgICByZXR1cm47CisgIGlmICh4IDwgMAorICAgICAgfHwgeSA8IDAKKyAg ICAgIHx8IGhwb3MgPCAwCisgICAgICB8fCB2cG9zIDwgMCkKKyAgICByZXR1cm47CisgIExpc3Bf T2JqZWN0IGJ1ZiA9IHctPmNvbnRlbnRzOworICBDSEVDS19CVUZGRVIgKGJ1Zik7CisgIGJvb2wg YXV0b19oc2Nyb2xsX21vZGVfcCA9IEVRIChGYnVmZmVyX2xvY2FsX3ZhbHVlIChRYXV0b19oc2Ny b2xsX21vZGUsIGJ1ZiksIFFjdXJyZW50X2xpbmUpOworICAvKiBFWEFNUExFOiAgKHNjcm9sbC1s ZWZ0IDUpICovCisgIGJvb2wgaHNjbF9hbGxfdGVtcF9wID0gKHctPnN1c3BlbmRfYXV0b19oc2Ny b2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gMCk7CisgIC8qIEVYQU1QTEU6ICBDLXUg Qy14IDwgYW5kIGRvIG5vdGhpbmcuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8wX3AgPSAody0+ c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRv X2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9s bCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA+IDAK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSB3LT5oc2Ny b2xsKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBhbmQgZG8gc29tZXRoaW5nIGVsc2UgYmVz aWRlcyBob3Jpem9udGFsbHkgc2Nyb2xsaW5nIHRoZQorICAgICAgICAgICAgICAgY3VycmVudCBs aW5lIGRpZmZlcmVudGx5LgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIGlzIF9ub3RfIGhv cml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJt XzFfcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5f aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9s bCA9PSB3LT5oc2Nyb2xsKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBhbmQgLi4uCisgICAg ICAgICAgICAgICBDdXJyZW50IGxpbmUgaXMgX25vdF8gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRp ZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMl9wID0gKCF3LT5zdXNwZW5kX2F1 dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9t b2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID09IDAKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCAhPSB3LT5oc2Nyb2xsKTsKKyAg LyogRVhBTVBMRTogIChzY3JvbGwtbGVmdCA1KTsgYW5kLCB0aGVuIHByZXNzIHRoZSBsZWZ0IGFy cm93IGtleSBvbmUgdGltZS4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBfaXNfIGhvcml6 b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4qLworICBib29sIGhzY2xfdGVtcF9wID0gKCF3 LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNj cm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAg ICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IDApOworICAvKiBFWEFNUExF OiAgQy11IEMteCA8IGFuZCBkbyBzb21ldGhpbmcgdGhhdCBjYXVzZXMgdGhlIGN1cnJlbnQgbGlu ZSB0byBiZQorICAgICAgICAgICAgICAgaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5 LgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIF9pc18gaG9yaXpvbnRhbGx5IHNjcm9sbGVk IGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfcGVybV9wID0gKCF3LT5zdXNwZW5kX2F1dG9f aHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAg ICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAg ICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1p bl9oc2Nyb2xsICE9IHctPmhzY3JvbGwpOworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHct PmZyYW1lKTsKKyAgaW50IGZyaW5nZV9iaXRtYXAgPSBNQ19OT19GUklOR0VfQklUTUFQOworICBp bnQgZmFjZV9pZCA9IERFRkFVTFRfRkFDRV9JRDsKKyAgaWYgKCFyZW1vdmVfcAorICAgICAgJiYg Z2x5cGhfZmxhdm9yID09IE1DX09WRVJMQVlfQVJST1dfQklUTUFQCisgICAgICAmJiAhaHNjbF9h bGxfdGVtcF9wCisgICAgICAmJiAhaHNjbF90ZW1wX3AKKyAgICAgICYmICFoc2NsX3Blcm1fcAor ICAgICAgJiYgIWhzY2xfYWxsX3Blcm1fMF9wCisgICAgICAmJiAhaHNjbF9hbGxfcGVybV8xX3AK KyAgICAgICYmICFoc2NsX2FsbF9wZXJtXzJfcCkKKyAgICB7CisgICAgICBlbnVtIGZhY2VfaWQg b3ZlcmxheV9hcnJvd19mYWNlX2lkID0KKyAgICAgICAgKCFhY3RpdmVfcAorICAgICAgICAgJiYg IU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaW5hY3RpdmVfd2luZG93cykp KQorICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXkt YXJyb3ctaW5hY3RpdmUtZmFjZSIpLCB0cnVlKQorICAgICAgICA6IChhY3RpdmVfcCkKKyAgICAg ICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ct ZmFjZSIpLCB0cnVlKQorICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgIGZhY2VfaWQg PSAoY3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAg ID8g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zIG5vdCBuZWVkZWQuCisgICAgICBgbWNfZHJhd19mcmluZ2VfYml0 bWFwXzEnIGlzIHNvbWV3aGF0IGNvbmZ1c2luZyBhbmQgcmVxdWlyZWQgc3RkZXJyIG1lc3NhZ2Vz CisgICAgICB0byBzZWUgdGhhdCBgcm93LT5vdmVybGF5X2Fycm93X2JpdG1hcGAgc2F0aXNmaWVz IHRoZSBmaXJzdCBjb25kaXRpb24KKyAgICAgIG9mICh3aGljaCAhPSBOT19GUklOR0VfQklUTUFQ KS4gIEF0IHRoaXMgdGltZSwgQGxhd2xpc3QgcHJlZmVycyBub3QgdG8KKyAgICAgIHJlbHkgdXBv biBhIExpc3Agc2V0dGluZyB1c2luZyBgc2V0LWZyaW5nZS1iaXRtYXAtZmFjZScuICovCisgICAg ICByb3ctPmxlZnRfZnJpbmdlX2JpdG1hcCA9IChjdXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5H RV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZnJpbmdlX2JpdG1h cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7 CisgICAgICByb3ctPmxlZnRfZnJpbmdlX2ZhY2VfaWQgPSBmYWNlX2lkOworICAgICAgcm93LT5s ZWZ0X2ZyaW5nZV9vZmZzZXQgPSAwOworICAgICAgcm93LT5mcmluZ2VfYml0bWFwX3BlcmlvZGlj X3AgPSBmYWxzZTsKKyAgICAgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcCAodywgcm93LCB0cnVlLCBj dXJzb3JfdHlwZSk7CisgICAgfQorICAgIGVsc2UgaWYgKCFyZW1vdmVfcAorICAgICAgICAgICAg ICYmIGdseXBoX2ZsYXZvciA9PSBNQ19PVkVSTEFZX0FSUk9XX0JJVE1BUAorICAgICAgICAgICAg ICYmIChoc2NsX2FsbF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8w X3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8xX3AKKyAgICAgICAgICAgICAg ICAgfHwgaHNjbF9hbGxfcGVybV8yX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF90ZW1wX3AK KyAgICAgICAgICAgICAgICAgfHwgaHNjbF9wZXJtX3ApKQorICAgICAgeworICAgICAgICBlbnVt IGZhY2VfaWQgb3ZlcmxheV9hcnJvd19mYWNlX2lkID0KKyAgICAgICAgICAoIWFjdGl2ZV9wCisg ICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2luYWN0 aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRl cm4gKCIrLW92ZXJsYXktYXJyb3ctaHNjbC1pbmFjdGl2ZS1mYWNlIiksIHRydWUpCisgICAgICAg ICAgOiAoYWN0aXZlX3ApCisgICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBp bnRlcm4gKCIrLW92ZXJsYXktYXJyb3ctaHNjbC1mYWNlIiksIHRydWUpCisgICAgICAgICAgOiBE RUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgIGZhY2VfaWQgPSAoY3Vyc29yX3R5cGUgPT0gTUNfTEVG VF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgPyBvdmVybGF5X2Fycm93X2ZhY2Vf aWQKKyAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICBpZiAoaHNj bF9hbGxfcGVybV8wX3ApCisgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2Vf Yml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCBmYWxzZSwgZmFsc2UpOworICAgICAg ICAgIGVsc2UgaWYgKGhzY2xfYWxsX3Blcm1fMV9wKQorICAgICAgICAgICAgZ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WNlX2lkOworICAgICAgICBy b3ctPmxlZnRfZnJpbmdlX29mZnNldCA9IDA7CisgICAgICAgIHJvdy0+ZnJpbmdlX2JpdG1hcF9w ZXJpb2RpY19wID0gZmFsc2U7CisgICAgICAgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcCAodywgcm93 LCB0cnVlLCBjdXJzb3JfdHlwZSk7CisgICAgICB9CisgICAgICBlbHNlIGlmICghcmVtb3ZlX3AK KyAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRV9S SUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZF UlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgfHwg Z2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEUKKyAgICAgICAgICAgICAgICAgICB8 fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAg ICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdI VF9BUlJPVworICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNB TF9CQVIKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURf VkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZF UlRJQ0FMX0JBUl9CQUNLU0xBU0gpKQorICAgICAgICB7CisgICAgICAgICAgTGlzcF9PYmplY3Qg Yml0bWFwX2ZsYXZvciA9IChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdI VF9BUlJPVykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfaG9s bG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9S SUdIVF9BUlJPVykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFt Y19yZXZlcnNlZF9ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFO R0xFKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hvbGxv d19yZWN0YW5nbGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5 cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVykKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3cK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09 IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVykKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19yZXZlcnNlZF92ZXJ0aWNhbF9iYXJfcmlnaHRf YXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxh dm9yID09IE1DX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19yZXZlcnNlZF92ZXJ0 aWNhbF9iYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhf Zmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyX2JhY2tzbGFzaAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFFuaWw7CisgICAgICAgICAgZnJpbmdl X2JpdG1hcCA9IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQKQorICAgICAg ICAgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9mcmluZ2VfYml0bWFwIChiaXRtYXBfZmxhdm9y KQorICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAg ICAgICAgZmFjZV9pZCA9IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisg ICAgICAgICAgICAgICAgICAgICAmJiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX0hPTExP V19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlw aF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAg ICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FM X0JBUikpCisgICAgICAgICAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwg aW50ZXJuICgiKy1yZXZlcnNlZC12ZXJ0aWNhbC1iYXItZmFjZSIpLCB0cnVlKQorICAgICAgICAg ICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisgICAg ICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9IT0xMT1df UkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2Zs YXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAg ICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikK KyAgICAgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4g KCIrLXZlcnRpY2FsLWJhci1mYWNlIiksIHRydWUpCisgICAgICAgICAgICAgICAgICAgIDogREVG QVVMVF9GQUNFX0lEOworICAgICAgICAgIHJvdy0+Y3Vyc29yX2luX2ZyaW5nZV9wID0gZmFsc2U7 CisgICAgICAgICAgcm93LT5yaWdodF9mcmluZ2VfYml0bWFwID0gZnJpbmdlX2JpdG1hcDsKKyAg ICAgICAgICByb3ctPnJpZ2h0X2ZyaW5nZV9mYWNlX2lkID0gZmFjZV9pZDsKKyAgICAgICAgICBy b3ctPnJpZ2h0X2ZyaW5nZV9vZmZzZXQgPSAwOworICAgICAgICAgIHJvdy0+ZnJpbmdlX2JpdG1h cF9wZXJpb2RpY19wID0gZmFsc2U7CisgICAgICAgICAgbWNfZHJhd19mcmluZ2VfYml0bWFwICh3 LCByb3csIGZhbHNlLCBjdXJzb3JfdHlwZSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAo Z2x5cGhfZmxhdm9yID09IE1DX0dMWVBICisgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZv ciA9PSBNQ19HTFlQSExFU1MpCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBvbl9wID0g dHJ1ZTsKKyAgICAgICAgICAgIEZSQU1FX1JJRiAoZiktPm1jX3NjcmliZV9jdXJzb3IgKHcsIG1h dHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICB2cG9zLCB3ZCwgaCwgbHNsLCBjdXJzb3JfdHlwZSwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgZ2x5 cGhfZmxhdm9yLCBvbl9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgYWN0aXZlX3ApOworICAgICAgICAgIH0KK30KKworLyogRHVtcCBjb250ZW50cyBvZiBn bHlwaCBHTFlQSCB0byBzdGRlcnIuICBST1cgYW5kIEFSRUEgYXJlCisgICB0aGUgZ2x5cGggcm93 IGFuZCBhcmVhIHdoZXJlIHRoZSBnbHlwaCBjb21lcyBmcm9tLiAqLwordm9pZAorbWNfZHVtcF9n bHlwaCAoc3RydWN0IGdseXBoX3JvdyAqcm93LCBzdHJ1Y3QgZ2x5cGggKmdseXBoLCBpbnQgYXJl YSwgaW50IHJlbGF0aXZlX3gpCit7CisgIGlmIChnbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisg ICAgICB8fCBnbHlwaC0+dHlwZSA9PSBHTFlQSExFU1NfR0xZUEgpCisgICAgeworICAgICAgZnBy aW50ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAl M2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNkICVzICVzXG4iLAorICAg ICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2Vk W2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2 ZV94LAorICAgICAgICAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgPyAnQycK KyAgICAgICAgIDogJ0cnKSwKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZG RVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNUUklOR1Ag KGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgOiAoTklMUCAo Z2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAgICA6ICct JykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICBnbHlwaC0+dS5jaCwK KyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3As CisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+eCwgZ2x5 cGgtPnksIGdseXBoLT5ocG9zLCBnbHlwaC0+dnBvcywgZ2x5cGgtPnp2X3AgPyAiWlYiIDogIi0t IiwKKyAgICAgICAgbWNfY2hhcl90b19zdHJpbmcgKGdseXBoLT51LmNoKSk7CisgICAgfQorICBl bHNlIGlmIChnbHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmlu dGYgKHN0ZGVyciwKKyAgICAgICAgIiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNk IDB4JTA2eCAlNGQgJTEuMWQlMS4xZCAlNWQgJTRkICAlM2QgICUzZCAlcyAlc1xuIiwKKyAgICAg ICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFth cmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVf eCwKKyAgICAgICAgJ1MnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZF UlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdCJworICAgICAgICAgIDogKFNUUklO R1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgIDogKE5JTFAg KGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICcwJworICAgICAgICAgIDogJy0nKSkpLAor ICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIDB1LAorICAgICAgICBnbHlwaC0+ ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgt PnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT54LCBnbHlwaC0+eSwgZ2x5cGgtPmhw b3MsIGdseXBoLT52cG9zLCBnbHlwaC0+enZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAiXFxT Iik7CisgICAgfQorICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkKKyAgICB7 CisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICIgJTUicEQiZC8lLTVkICU1ZCAlYyAl OSJwRCJkICVjICUzZCAweCUwNnggJTRkICUxLjFkJTEuMWQgJTVkICU0ZCAgJTNkICAlM2QgJXMg JWNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAg KChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAg ICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdJJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisg ICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnQicKKyAgICAg ICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAg ICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnMCcKKyAgICAgICAg ICA6ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAodW5zaWdu ZWQgaW50KSBnbHlwaC0+dS5pbWdfaWQsCisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAg ICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVf cCwKKyAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgZ2x5cGgtPnZwb3Ms IGdseXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7CisgICAgfQorICBlbHNl IGlmIChnbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpCisgICAgeworICAgICAgZnByaW50 ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2Qg MHglMDZ4IiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAg ICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAg ICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJysnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywK KyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdCJworICAg ICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAg ICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICcwJworICAgICAg ICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgICh1bnNp Z25lZCBpbnQpIGdseXBoLT51LmNtcC5pZCk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgJTRk ICUxLjFkJTEuMWQiLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxl ZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3ApOworICAgICAg aWYgKGdseXBoLT51LmNtcC5hdXRvbWF0aWMpCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAl NWQgJTRkICAlM2QgICUzZCAlcyAuIFslZC0lZF1cbiIsCisgICAgICAgICAgICAgICAgICAgICAg ICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgZ2x5cGgtPnZwb3MsIGdseXBoLT56 dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGgtPnNsaWNl LmNtcC5mcm9tLCBnbHlwaC0+c2xpY2UuY21wLnRvKTsKKyAgICAgICAgZWxzZQorICAgICAgICBm cHJpbnRmIChzdGRlcnIsICJcbiIpOworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0g WFdJREdFVF9HTFlQSCkKKyAgICB7CisjaWZuZGVmIEhBVkVfWFdJREdFVFMKKyAgICAgIGVhc3N1 bWUgKGZhbHNlKTsKKyNlbHNlCisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICIgICU1 ZC8lLTVkICU1ZCAlNGMgJTZkICVjICUzZCAweCUwNXggJTRkICUxLjFkJTEuMWQgJTVkICU0ZCAg JTNkICAlM2QgJXMgJWNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVB XSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFd IC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdYJywKKyAgICAgICAgZ2x5cGgt PmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICA/ ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8g J1MnCisgICAgICAgICA6ICctJykpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAg ICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAg ICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnUueHdpZGdldCwK KyAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgZ2x5cGgtPnZwb3MsIGds eXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7CisjZW5kaWYKKyAgICB9Cit9 CisKKy8qIER1bXAgdGhlIGNvbnRlbnRzIG9mIGdseXBoIHJvdyBhdCBWUE9TIGluIE1BVFJJWCB0 byBzdGRlcnIuCisgICBHTFlQSFMgMCBtZWFucyBkb24ndCBzaG93IGdseXBoIGNvbnRlbnRzLgor ICAgR0xZUEhTIDEgbWVhbnMgc2hvdyBnbHlwaHMgaW4gc2hvcnQgZm9ybQorICAgR0xZUEhTID4g MSBtZWFucyBzaG93IGdseXBocyBpbiBsb25nIGZvcm0uICovCit2b2lkCittY19kdW1wX2dseXBo X3JvdyAoc3RydWN0IGdseXBoX3JvdyAqcm93LCBpbnQgdnBvcywgaW50IGdseXBocykKK3sKKyAg aW50IHJlbGF0aXZlX3ggPSAwOworICBpZiAoZ2x5cGhzICE9IDEpCisgICAgeworICAgICAgZnBy aW50ZiAoc3RkZXJyLCAiXG5EVU1QIEdMWVBIIFJPV1xuIik7CisgICAgICBmcHJpbnRmIChzdGRl cnIsICJSb3cgICAgIFN0YXJ0ICAgICAgIEVuZCBVc2VkIG9FPjxcXENUWkZlc20gICAgIFggICAg WSAgICBXICAgIEggICAgViAgICBBICAgIFBcbiIpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAi PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09XG4iKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIiUzZCAl OSJwRCJkICU5InBEImQgJTRkICUxLjFkJTEuMWQlMS4xZCUxLjFkXAorJTEuMWQlMS4xZCUxLjFk JTEuMWQlMS4xZCUxLjFkJTEuMWQlMS4xZCAgJTRkICU0ZCAlNGQgJTRkICU0ZCAlNGQgJTRkXG4i LAorICAgICAgICAgdnBvcywKKyAgICAgICAgIE1BVFJJWF9ST1dfU1RBUlRfQ0hBUlBPUyAocm93 KSwKKyAgICAgICAgIE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdyksCisgICAgICAgICByb3ct PnVzZWRbVEVYVF9BUkVBXSwKKyAgICAgICAgIHJvdy0+Y29udGFpbnNfb3ZlcmxhcHBpbmdfZ2x5 cGhzX3AsCisgICAgICAgICByb3ctPmVuYWJsZWRfcCwKKyAgICAgICAgIHJvdy0+dHJ1bmNhdGVk X29uX2xlZnRfcCwKKyAgICAgICAgIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3AsCisgICAgICAg ICByb3ctPmNvbnRpbnVlZF9wLAorICAgICAgICAgTUFUUklYX1JPV19DT05USU5VQVRJT05fTElO RV9QIChyb3cpLAorICAgICAgICAgTUFUUklYX1JPV19ESVNQTEFZU19URVhUX1AgKHJvdyksCisg ICAgICAgICByb3ctPmVuZHNfYXRfenZfcCwKKyAgICAgICAgIHJvdy0+ZmlsbF9saW5lX3AsCisg ICAgICAgICByb3ctPmVuZHNfaW5fbWlkZGxlX29mX2NoYXJfcCwKKyAgICAgICAgIHJvdy0+c3Rh cnRzX2luX21pZGRsZV9vZl9jaGFyX3AsCisgICAgICAgICByb3ctPm1vdXNlX2ZhY2VfcCwKKyAg ICAgICAgIHJvdy0+eCwKKyAgICAgICAgIHJvdy0+eSwKKyAgICAgICAgIHJvdy0+cGl4ZWxfd2lk dGgsCisgICAgICAgICByb3ctPmhlaWdodCwKKyAgICAgICAgIHJvdy0+dmlzaWJsZV9oZWlnaHQs CisgICAgICAgICByb3ctPmFzY2VudCwKKyAgICAgICAgIHJvdy0+cGh5c19hc2NlbnQpOworICAg ICAgLyogVGhlIG5leHQgMyBsaW5lcyBzaG91bGQgYWxpZ24gdG8gIlN0YXJ0IiBpbiB0aGUgaGVh ZGVyLiAqLworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICAgICU5InBEImQgJTkicEQiZFx0JTVk XG4iLCByb3ctPnN0YXJ0Lm92ZXJsYXlfc3RyaW5nX2luZGV4LAorICAgICAgICAgcm93LT5lbmQu b3ZlcmxheV9zdHJpbmdfaW5kZXgsCisgICAgICAgICByb3ctPmNvbnRpbnVhdGlvbl9saW5lc193 aWR0aCk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgICAgJTkicEQiZCAlOSJwRCJkXG4iLAor ICAgICAgICAgQ0hBUlBPUyAocm93LT5zdGFydC5zdHJpbmdfcG9zKSwKKyAgICAgICAgIENIQVJQ T1MgKHJvdy0+ZW5kLnN0cmluZ19wb3MpKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgICAl OWQgJTlkXG4iLCByb3ctPnN0YXJ0LmRwdmVjX2luZGV4LAorICAgICAgICAgcm93LT5lbmQuZHB2 ZWNfaW5kZXgpOworICAgIH0KKyAgaWYgKGdseXBocyA+IDEpCisgICAgeworICAgICAgZm9yIChp bnQgYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFyZWEgPCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAg eworICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSByb3ctPmdseXBoc1thcmVhXTsKKyAgICBzdHJ1 Y3QgZ2x5cGggKmdseXBoX2VuZCA9IGdseXBoICsgcm93LT51c2VkW2FyZWFdOworICAgIC8qIEds eXBoIGZvciBhIGxpbmUgZW5kIGluIHRleHQuICovCisgICAgaWYgKGFyZWEgPT0gVEVYVF9BUkVB ICYmIGdseXBoID09IGdseXBoX2VuZCAmJiBnbHlwaC0+Y2hhcnBvcyA+IDApCisgICAgICArK2ds eXBoX2VuZDsKKyAgICBpZiAoZ2x5cGggPCBnbHlwaF9lbmQpCisgICAgICBmcHJpbnRmIChzdGRl cnIsICJHbHlwaCMvVG90YWwgUmVsLlggVCAgICAgICBQb3MgTyAgIFcgICAgIENvZGUgRmFjZSBM UiAgICAgWCAgICBZIEhQT1MgVlBPUyBaViBDXG4iKTsKKyAgICBmb3IgKDsgZ2x5cGggPCBnbHlw aF9lbmQ7ICsrZ2x5cGgpCisgICAgICB7CisgICAgICAgIG1jX2R1bXBfZ2x5cGggKHJvdywgZ2x5 cGgsIGFyZWEsIHJlbGF0aXZlX3gpOworICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhl bF93aWR0aDsKKyAgICAgIH0KKyAgfQorICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGhzID09IDEpCisg ICAgeworICAgICAgY2hhciBzW1NIUlRfTUFYICsgNF07CisgICAgICBmb3IgKGludCBhcmVhID0g TEVGVF9NQVJHSU5fQVJFQTsgYXJlYSA8IExBU1RfQVJFQTsgKythcmVhKQorICB7CisgICAgaW50 IGk7CisgICAgZm9yIChpID0gMDsgaSA8IHJvdy0+dXNlZFthcmVhXTsgKytpKQorICAgICAgewor ICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoID0gcm93LT5nbHlwaHNbYXJlYV0gKyBpOworICAg ICAgICBpZiAoaSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAmJiBhcmVhID09IFRFWFRf QVJFQQorICAgICAgJiYgTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICYmIGdseXBoLT50eXBl ID09IENIQVJfR0xZUEgKKyAgICAgICYmIGdseXBoLT51LmNoID09ICcgJykKKyAgICB7CisgICAg ICBzdHJjcHkgKCZzW2ldLCAiW1xcbl0iKTsKKyAgICAgIGkgKz0gNDsKKyAgICB9CisgICAgICAg IGVsc2UgaWYgKGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgICAgICAgJiYgZ2x5cGgt PnUuY2ggPCAweDgwCisgICAgICAgICAgICYmIGdseXBoLT51LmNoID49ICcgJykKKyAgICBzW2ld ID0gZ2x5cGgtPnUuY2g7CisgICAgICAgIGVsc2UKKyAgICBzW2ldID0gJy4nOworICAgICAgfQor ICAgIHNbaV0gPSAnXDAnOworICAgIGZwcmludGYgKHN0ZGVyciwgIiUzZDogKCVkKSAnJXMnXG4i LCB2cG9zLCByb3ctPmVuYWJsZWRfcCwgcyk7CisgIH0KKyAgICB9Cit9CisKK0RFRlVOICgibWMt ZHVtcC1nbHlwaC1yb3ciLCBGbWNfZHVtcF9nbHlwaF9yb3csIFNtY19kdW1wX2dseXBoX3Jvdywg MSwgMiwgIlAiLAorICAgICAgIGRvYzogLyogRHVtcCBnbHlwaCByb3cgUk9XIHRvIHN0ZGVyci4K K0ludGVyYWN0aXZlbHksIFJPVyBpcyB0aGUgcHJlZml4IG51bWVyaWMgYXJndW1lbnQgYW5kIGRl ZmF1bHRzIHRvCit0aGUgcm93IHdoaWNoIGRpc3BsYXlzIHBvaW50LgorT3B0aW9uYWwgYXJndW1l bnQgR0xZUEhTIDAgbWVhbnMgZG9uJ3QgZHVtcCBnbHlwaHMuCitHTFlQSFMgMSBtZWFucyBkdW1w IGdseXBocyBpbiBzaG9ydCBmb3JtLgorR0xZUEhTID4gMSBvciBvbWl0dGVkIG1lYW5zIGR1bXAg Z2x5cGhzIGluIGxvbmcgZm9ybS4gICovKQorICAoTGlzcF9PYmplY3Qgcm93LCBMaXNwX09iamVj dCBnbHlwaHMpCit7CisgIHN0cnVjdCB3aW5kb3cgKncgPSBYV0lORE9XIChzZWxlY3RlZF93aW5k b3cpOworICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXg7CisgIEVNQUNTX0lOVCB2cG9zOwor ICBpZiAoTklMUCAocm93KSkKKyAgICB7CisgICAgICBpbnQgZDEsIGQyLCBkMywgZDQsIGQ1LCB5 cG9zOworICAgICAgYm9vbCB2aXNpYmxlX3AgPSBwb3NfdmlzaWJsZV9wICh3LCBQVCwgJmQxLCAm ZDIsICZkMywgJmQ0LCAmZDUsICZ5cG9zKTsKKyAgICAgIGludCBoZWFkZXJfbGluZV9oZWlnaHQg PSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgICAgIGludCB2b2Zmc2V0ID0gKGhl YWRlcl9saW5lX2hlaWdodCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICYmIHlwb3MgPiAwKQor ICAgICAgICAgICAgICAgICAgICAgID8geXBvcyArIDEKKyAgICAgICAgICAgICAgICAgICAgICA6 IHlwb3M7CisgICAgICBpZiAodmlzaWJsZV9wKQorICAgICAgICB2cG9zID0gdm9mZnNldDsKKyAg ICAgICAgZWxzZQorICAgICAgICAgIHZwb3MgPSAwOworICAgIH0KKyAgICBlbHNlCisgICAgICB7 CisgICAgICAgIENIRUNLX05VTUJFUiAocm93KTsKKyAgICAgICAgdnBvcyA9IFhGSVhOVU0gKHJv dyk7CisgICAgICB9CisgIG1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworICBpZiAodnBvcyA+ PSAwICYmIHZwb3MgPCBtYXRyaXgtPm5yb3dzKQorICAgIG1jX2R1bXBfZ2x5cGhfcm93IChNQVRS SVhfUk9XIChtYXRyaXgsIHZwb3MpLAorICAgICAgICB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KyAgICAgICAgICAgICAgJiYgdy0+bWNfZWx0 cy51c2VkID4gMSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogRGVjcmVhc2UgdGhl IHNpemUgb2YgdGhlIGFycmF5IHRvIGEgYmFyZSBtaW5pbXVtLiAqLworICAgICAgICAgICAgICB3 LT5tY19lbHRzLmNhY2hlcyA9IHhucmVhbGxvYyAody0+bWNfZWx0cy5jYWNoZXMsIDEsIHNpemVv ZiAqdy0+bWNfZWx0cy5jYWNoZXMpOworICAgICAgICAgICAgICB3LT5tY19lbHRzLnVzZWQgPSAw OworICAgICAgICAgICAgICB3LT5tY19lbHRzLmFsbG9jYXRlZCA9IDE7CisgICAgICAgICAgICB9 CisgICAgICAgICAgICAvLyAgQWx0aG91Z2ggaXQgd291bGQgbm90IGJlIHZlcnkgZWZmaWNpZW50 LCBpdCBpcyBwb3NzaWJsZSB0byBzZXQKKyAgICAgICAgICAgIC8vICB0aGUgX3VzZWRfIGVsZW1l bnRzIG9mIHRoZSBhcnJheSB0byB6ZXJvLiAgSW4gc3VjaCBhIGNhc2UsIHRoZQorICAgICAgICAg ICAgLy8gIC4uLl9lbHRzLmFsbG9jYXRlZCB3b3VsZCByZW1haW4gdGhlIHNhbWUuCisgICAgICAg ICAgICAvLyAgbWVtc2V0ICh3LT5tY19lbHRzLmNhY2hlcywgMCwgdy0+bWNfZWx0cy51c2VkICog KHNpemVvZiAqdy0+bWNfZWx0cy5jYWNoZXMpKTsKKyAgICAgICAgICAgIC8vICBBdCB0aGlzIHRp bWUsIHdlIGFyZSBpbnN0ZWFkIGxlYXZpbmcgdGhlIGFycmF5IGFzLWlzIHdpdGggdGhlCisgICAg ICAgICAgICAvLyAgdW5kZXJzdGFuZGluZyB0aGF0IGl0IHdpbGwgY29udGFpbiBvdXRkYXRlZCBk YXRhIChha2EgZ2FyYmFnZSkuCisgICAgICAgICAgICAvLyAgVXNpbmcgdGhlIGNvdW50ZXIgYHct Pm1jX2VsdHMudXNlZGAsIHdlIHRyYWNrIGN1cnJlbnQgZGF0YS4KKyAgICAgICAgICAgIGVsc2Ug aWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQorICAgICAgICAgICAgICB3 LT5tY19lbHRzLnVzZWQgPSAwOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBj YXNlIENIX0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRl bnRzKQorICAgICAgICAgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAmJiB3LT5jaF9lbHRzLnVzZWQgPiAxKQorICAg ICAgICAgICAgeworICAgICAgICAgICAgICAvKiBEZWNyZWFzZSB0aGUgc2l6ZSBvZiB0aGUgYXJy YXkgdG8gYSBiYXJlIG1pbmltdW0uICovCisgICAgICAgICAgICAgIHctPmNoX2VsdHMuY2FjaGVz ID0geG5yZWFsbG9jICh3LT5jaF9lbHRzLmNhY2hlcywgMSwgc2l6ZW9mICp3LT5jaF9lbHRzLmNh Y2hlcyk7CisgICAgICAgICAgICAgIHctPmNoX2VsdHMudXNlZCA9IDA7CisgICAgICAgICAgICAg IHctPmNoX2VsdHMuYWxsb2NhdGVkID0gMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8v ICBBbHRob3VnaCBpdCB3b3VsZCBub3QgYmUgdmVyeSBlZmZpY2llbnQsIGl0IGlzIHBvc3NpYmxl IHRvIHNldAorICAgICAgICAgICAgLy8gIHRoZSBfdXNlZF8gZWxlbWVudHMgb2YgdGhlIGFycmF5 IHRvIHplcm8uICBJbiBzdWNoIGEgY2FzZSwgdGhlCisgICAgICAgICAgICAvLyAgLi4uX2VsdHMu YWxsb2NhdGVkIHdvdWxkIHJlbWFpbiB0aGUgc2FtZS4KKyAgICAgICAgICAgIC8vICBtZW1zZXQg KHctPmNoX2VsdHMuY2FjaGVzLCAwLCB3LT5jaF9lbHRzLnVzZWQgKiAoc2l6ZW9mICp3LT5jaF9l bHRzLmNhY2hlcykpOworICAgICAgICAgICAgLy8gIEF0IHRoaXMgdGltZSwgd2UgYXJlIGluc3Rl YWQgbGVhdmluZyB0aGUgYXJyYXkgYXMtaXMgd2l0aCB0aGUKKyAgICAgICAgICAgIC8vICB1bmRl cnN0YW5kaW5nIHRoYXQgaXQgd2lsbCBjb250YWluIG91dGRhdGVkIGRhdGEgKGFrYSBnYXJiYWdl KS4KKyAgICAgICAgICAgIC8vICBVc2luZyB0aGUgY291bnRlciBgdy0+Y2hfZWx0cy51c2VkYCwg d2UgdHJhY2sgY3VycmVudCBkYXRhLgorICAgICAgICAgICAgZWxzZSBpZiAoQlVGRkVSUCAody0+ Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisgICAgICAgICAgICAgIHctPmNoX2VsdHMudXNl ZCA9IDA7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGNhc2UgRkNfQ0FDSEU6 CisgICAgICAgIHsKKyAgICAgICAgICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAg ICAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkp CisgICAgICAgICAgICAgICYmIHctPmZjX2VsdHMudXNlZCA+IDEpCisgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgIC8qIERlY3JlYXNlIHRoZSBzaXplIG9mIHRoZSBhcnJheSB0byBhIGJhcmUg bWluaW11bS4gKi8KKyAgICAgICAgICAgICAgdy0+ZmNfZWx0cy5jYWNoZXMgPSB4bnJlYWxsb2Mg KHctPmZj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cy51c2VkID0gMDsKKyAgICAg ICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KK30KKworc3RhdGljIHZvaWQKK21jX2hlbHBl ciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3Qg Z2x5cGhfcm93ICpyb3csCisgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGgsIGludCB4LCBp bnQgZngsIGludCB5LCBpbnQgZnksIGludCBocG9zLCBpbnQgdnBvcywKKyAgICAgICAgICAgaW50 IHdkLCBpbnQgaCwgZW51bSB0eXBlX29mX2N1cnNvciBjdXJzb3JfdHlwZSwgaW50IGN1cnNvcl93 aWR0aCwKKyAgICAgICAgICAgc3RydWN0IG1jX1JHQiBmb3JlZ3JvdW5kLCBzdHJ1Y3QgbWNfUkdC IGJhY2tncm91bmQsIGJvb2wgYWN0aXZlX3AsCisgICAgICAgICAgIGVudW0gbWNfZmxhdm9yIGds eXBoX2ZsYXZvciwgYm9vbCBkcmF3X3AsIGVudW0gdHlwZV9vZl9jYWNoZSBjYWNoZV90eXBlKQor eworICBpZiAoZ2x5cGggIT0gTlVMTAorICAgICAgJiYgZ2x5cGgtPnUuY2ggPT0gOTUKKyAgICAg ICYmIGN1cnNvcl90eXBlID09IE1DX0hCQVIpCisgICAgeworICAgICAgc3RydWN0IGZyYW1lICpm ID0gWEZSQU1FICh3LT5mcmFtZSk7CisgICAgICBlbnVtIGZhY2VfaWQgc3BlY2lhbF9jaGFyX2Zh Y2VfaWQgPQorICAgICAgICBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1zcGVj aWFsLWNoYXJhY3Rlci1mYWNlIiksIHRydWUpOworICAgICAgc3RydWN0IGZhY2UgKnNwZWNpYWxf Y2hhcl9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBzcGVjaWFsX2NoYXJfZmFjZV9pZCk7CisgICAg ICBMaXNwX09iamVjdCBzcGVjaW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nksIGhwb3Ms IHZwb3MsIHdkLCBoLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vy c29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBhY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCByZW1vdmVfcCk7 CisgIHN0cnVjdCBtdWx0aXBsZV9jdXJzb3JzX2NhY2hlIGZvb19lbHRzOworICBzd2l0Y2ggKGNh Y2hlX3R5cGUpCisgICAgeworICAgICAgY2FzZSBOT19DQUNIRToKKyAgICAgICAgeworICAgICAg ICAgIC8qIERvIG5vdCBjb250aW51ZSB0byB0aGUgbGFzdCBzZWN0aW9uIHRoYXQgcG9wdWxhdGVz IHRoZSBjYWNoZSB3aXRoCisgICAgICAgICAgY3Vyc29yIGRhdGEsIGFzIHRoYXQgd2lsbCBjYXVz ZSBhIFNJR1NFR1YgKHNlZ21lbnRhdGlvbiBmYXVsdCkuICovCisgICAgICAgICAgcmV0dXJuOwor ICAgICAgICB9CisgICAgICBjYXNlIE1DX0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAgKyt3 LT5tY19lbHRzLnVzZWQ7CisgICAgICAgICAgaWYgKHctPm1jX2VsdHMuYWxsb2NhdGVkIDwgdy0+ bWNfZWx0cy51c2VkKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpbnQgb2xkX2FsbG9j ID0gdy0+bWNfZWx0cy5hbGxvY2F0ZWQ7CisgICAgICAgICAgICAgIGludCBuZXdfZWx0cyA9IHct Pm1jX2VsdHMudXNlZCAtIHctPm1jX2VsdHMuYWxsb2NhdGVkOworICAgICAgICAgICAgICB3LT5t Y19lbHRzLmNhY2hlcyA9IHhwYWxsb2MgKHctPm1jX2VsdHMuY2FjaGVzLCAmdy0+bWNfZWx0cy5h bGxvY2F0ZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3 X2VsdHMsIElOVF9NQVgsIHNpemVvZiAqdy0+bWNfZWx0cy5jYWNoZXMpOworICAgICAgICAgICAg ICBtZW1zZXQgKHctPm1jX2VsdHMuY2FjaGVzICsgb2xkX2FsbG9jLCAwLAorICAgICAgICAgICAg ICAgICAgICAgICAody0+bWNfZWx0cy5hbGxvY2F0ZWQgLSBvbGRfYWxsb2MpICogc2l6ZW9mICp3 LT5tY19lbHRzLmNhY2hlcyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgZm9vX2VsdHMuY2Fj aGVzID0gdy0+bWNfZWx0cy5jYWNoZXM7CisgICAgICAgICAgZm9vX2VsdHMuYWxsb2NhdGVkID0g dy0+bWNfZWx0cy5hbGxvY2F0ZWQ7CisgICAgICAgICAgZm9vX2VsdHMudXNlZCA9IHctPm1jX2Vs dHMudXNlZDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgY2FzZSBDSF9DQUNI RToKKyAgICAgICAgeworICAgICAgICAgICsrdy0+Y2hfZWx0cy51c2VkOworICAgICAgICAgIGlm ICh3LT5jaF9lbHRzLmFsbG9jYXRlZCA8IHctPmNoX2VsdHMudXNlZCkKKyAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgaW50IG9sZF9hbGxvYyA9IHctPmNoX2VsdHMuYWxsb2NhdGVkOworICAg ICAgICAgICAgICBpbnQgbmV3X2VsdHMgPSB3LT5jaF9lbHRzLnVzZWQgLSB3LT5jaF9lbHRzLmFs bG9jYXRlZDsKKyAgICAgICAgICAgICAgdy0+Y2hfZWx0cy5jYWNoZXMgPSB4cGFsbG9jICh3LT5j aF9lbHRzLmNhY2hlcywgJnctPmNoX2VsdHMuYWxsb2NhdGVkLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19lbHRzLCBJTlRfTUFYLCBzaXplb2YgKnctPmNo X2VsdHMuY2FjaGVzKTsKKyAgICAgICAgICAgICAgbWVtc2V0ICh3LT5jaF9lbHRzLmNhY2hlcyAr IG9sZF9hbGxvYywgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgKHctPmNoX2VsdHMuYWxsb2Nh dGVkIC0gb2xkX2FsbG9jKSAqIHNpemVvZiAqdy0+Y2hfZWx0cy5jYWNoZXMpOworICAgICAgICAg ICAgfQorICAgICAgICAgIGZvb19lbHRzLmNhY2hlcyA9IHctPmNoX2VsdHMuY2FjaGVzOworICAg ICAgICAgIGZvb19lbHRzLmFsbG9jYXRlZCA9IHctPmNoX2VsdHMuYWxsb2NhdGVkOworICAgICAg ICAgIGZvb19lbHRzLnVzZWQgPSB3LT5jaF9lbHRzLnVzZWQ7CisgICAgICAgICAgYnJlYWs7Cisg ICAgICAgIH0KKyAgICAgIGNhc2UgRkNfQ0FDSEU6CisgICAgICAgIHsKKyAgICAgICAgICArK3ct PmZjX2VsdHMudXNlZDsKKyAgICAgICAgICBpZiAody0+ZmNfZWx0cy5hbGxvY2F0ZWQgPCB3LT5m Y19lbHRzLnVzZWQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGludCBvbGRfYWxsb2Mg PSB3LT5mY19lbHRzLmFsbG9jYXRlZDsKKyAgICAgICAgICAgICAgaW50IG5ld19lbHRzID0gdy0+ ZmNfZWx0cy51c2VkIC0gdy0+ZmNfZWx0cy5hbGxvY2F0ZWQ7CisgICAgICAgICAgICAgIHctPmZj X2VsdHMuY2FjaGVzID0geHBhbGxvYyAody0+ZmNfZWx0cy5jYWNoZXMsICZ3LT5mY19lbHRzLmFs bG9jYXRlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdf ZWx0cywgSU5UX01BWCwgc2l6ZW9mICp3LT5mY19lbHRzLmNhY2hlcyk7CisgICAgICAgICAgICAg IG1lbXNldCAody0+ZmNfZWx0cy5jYWNoZXMgKyBvbGRfYWxsb2MsIDAsCisgICAgICAgICAgICAg ICAgICAgICAgICh3LT5mY19lbHRzLmFsbG9jYXRlZCAtIG9sZF9hbGxvYykgKiBzaXplb2YgKnct PmZjX2VsdHMuY2FjaGVzKT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lzIHNldAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZXdoZXJlOiAgYHctPmN1cnNvci54YCAvIGBt Yy5mY194YC4gKi8KK3ZvaWQKK21jX2dldF9jdXJzb3JfZ2VvbWV0cnkgKHN0cnVjdCB3aW5kb3cg KncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAgICAg IHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgaW50IHgsIGludCAqZngsIGludCB5LAorICAgICAgICAg ICAgICAgICAgICAgICAgaW50ICpmeSwgaW50IGhwb3MsIGludCB2cG9zLCBpbnQgKmgsCisgICAg ICAgICAgICAgICAgICAgICAgICBlbnVtIHR5cGVfb2ZfY3Vyc29yIGN1cnNvcl90eXBlLCBpbnQg Y3Vyc29yX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgaW50ICp3ZCkKK3sKKyAgc3Ry dWN0IGdseXBoICpnbHlwaCA9IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBo cG9zLCB2cG9zKTsKKyAgaWYgKGdseXBoID09IE5VTEwpCisgICAgcmV0dXJuOworICBzdHJ1Y3Qg ZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworICAqZnggPSBXSU5ET1dfVEVY VF9UT19GUkFNRV9QSVhFTF9YICh3LCB4KTsKKyAgKmggPSByb3ctPnZpc2libGVfaGVpZ2h0Owor ICAvKiBEb24ndCBsZXQgdGhlIGN1cnNvciBleGNlZWQgdGhlIGRpbWVuc2lvbnMgb2YgdGhlIHJv dywgc28gdGhhdAorICB0aGUgdXBwZXIvbG93ZXIgc2lkZSBvZiB0aGUgYm94IGFyZW4ndCBjbGlw cGVkLiAgKi8KKyAgaW50IHdfaGVhZGVyX2xpbmVfaGVpZ2h0ID0gV0lORE9XX0hFQURFUl9MSU5F X0hFSUdIVCAodyk7CisgIGludCB3X3RleHRfYm90dG9tX3kgPSB3aW5kb3dfdGV4dF9ib3R0b21f eSAodykgLSAqaDsKKyAgaWYgKHkgPCB3X2hlYWRlcl9saW5lX2hlaWdodCkKKyAgICB7CisgICAg ICAqaCA9IG1heCAoKmggLSAod19oZWFkZXJfbGluZV9oZWlnaHQgLSB5KSArIDEsICpoKTsKKyAg ICAgIHkgPSB3X2hlYWRlcl9saW5lX2hlaWdodCAtIDE7CisgICAgICAvLyBmcHJpbnRmIChzdGRl cnIsICJDT05ESVRJT04gIyAxXG4iKTsKKyAgICB9CisgICBlbHNlIGlmICh5ID4gd190ZXh0X2Jv dHRvbV95KQorICAgICB7CisgICAgICAgKmggKz0geSAtIHdfdGV4dF9ib3R0b21feTsKKyAgICAg ICB5ID0gd190ZXh0X2JvdHRvbV95OworICAgICAgIC8vIGZwcmludGYgKHN0ZGVyciwgIkNPTkRJ VElPTiAjIDJcbiIpOworICAgICB9CisgICpmeSA9IFdJTkRPV19UT19GUkFNRV9QSVhFTF9ZICh3 LCB5KTsKKyAgc3dpdGNoIChjdXJzb3JfdHlwZSkKKyAgICB7CisgICAgICBjYXNlIE1DX0JBUjoK KyAgICAgICAgeworICAgICAgICAgIGlmIChjdXJzb3Jfd2lkdGggPCAxKQorICAgICAgICAgICAg Y3Vyc29yX3dpZHRoID0gbWF4IChGUkFNRV9DVVJTT1JfV0lEVEggKGYpLCAxKTsKKyAgICAgICAg ICBpZiAoY3Vyc29yX3dpZHRoIDwgZ2x5cGgtPnBpeGVsX3dpZHRoKQorICAgICAgICAgICp3ZCA9 IGN1cnNvcl93aWR0aDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgY2FzZSBN Q19IQkFSOgorICAgICAgICB7CisgICAgICAgICAgaW50IGN1cnNvcl9oZWlnaHQgPSAoY3Vyc29y X3dpZHRoIDwgMSkgPyBscmludCAoMC4yNSAqICpoKSA6IGN1cnNvcl93aWR0aDsKKyAgICAgICAg ICBpZiAoY3Vyc29yX2hlaWdodC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b3IuaHBvczsKKyAgaW50IG9wb2ludF92cG9zID0gdy0+Y3Vyc29y LnZwb3M7CisgIGludCBmeCwgZnksIGgsIHdkOworICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3 LCBtYXRyaXgsIHJvdywgcmVsYXRpdmVfeCwgJmZ4LCB5LCAmZnksIGhwb3MsIHZwb3MsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICZoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCAmd2Qp OworICBpbnQgb3BvaW50X2Z4ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgb3Bv aW50X3gpOworICBpbnQgZmNfZnggPSBXSU5ET1dfVEVYVF9UT19GUkFNRV9QSVhFTF9YICh3LCBm Y194KTsKKyAgYm9vbCB6dl9wID0gKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSBy b3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAmJiBNQVRSSVhfUk9XX0VORF9DSEFS UE9TIChyb3cpID09IFpWKTsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7 CisgIExpc3BfT2JqZWN0IGJ1ZiA9IHctPmNvbnRlbnRzOworICBDSEVDS19CVUZGRVIgKGJ1Zik7 CisgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSIChidWYpOworICBpbnQgdGV4dF9hcmVhX3dp ZHRoID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgc3RydWN0IGdseXBoX3Jv dyAqY3Vyc29yX3JvdyA9ICh3LT5jdXJzb3IudnBvcyAhPSAtMSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gTUFUUklYX1JPVyAoY3Vyc29yX21hdHJpeCwgdy0+Y3Vyc29yLnZw b3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgIHN0cnVjdCBn bHlwaCAqY3Vyc29yX2dseXBoID0gKHctPmN1cnNvci52cG9zICE9IC0xKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gbWNfZ2V0X2N1cnNvcl9nbHlwaCAodywgY3Vyc29yX21hdHJp eCwgY3Vyc29yX3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgIGJvb2wgY3Vyc29yX2F0X2ZyaW5nZV9wID0g KGN1cnNvcl9nbHlwaCA9PSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1 cnNvcl9yb3cgIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJz b3IuaHBvcyA9PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVfcAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA9PSB0ZXh0X2FyZWFfd2lk dGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gY3Vyc29y X3Jvdy0+cGl4ZWxfd2lkdGgpOworICBib29sIGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AgPSAoY3Vy c29yX2dseXBoID09IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1 cnNvcl9yb3cgIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+ Y3Vyc29yLmhwb3MgPT0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiAhY3Vyc29yX3Jvdy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xp bmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0g dGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5j dXJzb3IueCA+PSBjdXJzb3Jfcm93LT5waXhlbF93aWR0aCk7CisgIGludCBmcmFtZV9jaGFyX3dp ZHRoID0gRlJBTUVfQ09MVU1OX1dJRFRIIChmKTsKKyAgaW50IHRlbXBfZmFjZV9pZCA9IGdseXBo LT5mYWNlX2lkOworICBzdHJ1Y3QgbWNfUkdCIGJhY2tncm91bmQ7CisgIG1jX3NldF9sc2xfYmcg KHcsIHRlbXBfZmFjZV9pZCwgJmJhY2tncm91bmQpOworICBib29sIHJlYWxfZmFrZV9jdXJzb3Jf cCA9IChvcG9pbnRfeCA9PSByZWxhdGl2ZV94CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIG9wb2ludF9ocG9zID09IGhwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg b3BvaW50X3kgPT0gZ2x5cGgtPnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3Bv aW50X3Zwb3MgPT0gdnBvcyk7CisKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAg ICAgICAgICAgICAgICAgIEJFR0lOOiAgQ0hBUl9HTFlQSCB8IEdMWVBITEVTU19HTFlQSCAgICAg ICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgaWYgKGdseXBoLT50 eXBlID09IENIQVJfR0xZUEgKKyAgICAgIHx8IGdseXBoLT50eXBlID09IEdMWVBITEVTU19HTFlQ SCkKKyAgeworICAgIGlmIChtY19zdGRlcnJfcCkKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAg ICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAl MS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNkICVzICVzXG4iLAorICAgICAgICBnbHlwaCAtIHJv dy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8g MCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAo Z2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgPyAnQycKKyAgICAgICAgIDogJ0cn KSwKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2Jq ZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3Qp CisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkK KyAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAgICA6ICctJykpKSwKKyAgICAgICAg ICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICBnbHlwaC0+dS5jaCwKKyAgICAgICAg Z2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAg IGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+eCwgZ2x5cGgtPnksIGds eXBoLT5ocG9zLCBnbHlwaC0+dnBvcywgZ2x5cGgtPnp2X3AgPyAiWlYiIDogIi0tIiwKKyAg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LS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEhPUklaT05UQUxfUlVM RVI6CisgICAgeworICAgICAgaWYgKHJlbGF0aXZlX3ggPCByb3ctPnBpeGVsX3dpZHRoCisgICAg ICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgbWNfaGVscGVyICh3LCBtYXRy aXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAg ICAgICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3Vu ZCwgYmFja2dyb3VuZCwKKyAgICAgICAgICAgICAgICAgICBhY3RpdmVfcCwgTUNfR0xZUEgsIGRy YXdfcCwgY2FjaGVfdHlwZSk7CisgICAgICBpZiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FS RUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiByZWxhdGl2ZV94IDw9IHhf bGltaXQpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAocmVsYXRpdmVfeCA8IHJvdy0+cGl4ZWxf d2lkdGgpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgt PnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICBmeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7Cisg ICAgICAgICAgICB9CisgICAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgs IHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAg IHhfbGltaXQgLSByZWxhdGl2ZV94LCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLAorICAg ICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwgYWN0aXZlX3AsIE1DX0dM WVBITEVTUywgZHJhd19wLAorICAgICAgICAgICAgICAgICAgICAgY2FjaGVfdHlwZSk7CisgICAg ICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyog ICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIENIQVJfR0xZUEggfCBHTFlQSExFU1NfR0xZ UEggICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNl IFZFUlRJQ0FMX1JVTEVSOgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZv ciA9IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiByb3ctPmNvbnRpbnVlZF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+Y29udGludWVkX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUgor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9w CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRl ZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1D X1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklH SFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9i ZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXSAhPSAxCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoIC0gcm93LT5nbHlw aHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeCA+PSByb3ctPnBpeGVsX3dpZHRoKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoenZfcCkKKyAgICAgICAgICAgICA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ICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t ICovCisgICAgY2FzZSBGSUxMX0NPTFVNTjoKKyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBn bHlwaF9mbGF2b3IgPSAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNl ZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgJiYgZmNfeCA+PSByb3ctPnBpeGVsX3dp ZHRoKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAg ICAgICA6ICh6dl9wKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAg ICAgICAgICAgICAgICA6ICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAg ICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfdmVy dGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF95ID09IHkKKyAg ICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfdnBvcyA9PSB2cG9zKQorICAgICAgICAgICAg ICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBIOwor ICAgICAgd2QgPSAxOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJl bGF0aXZlX3gsIGZjX2Z4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2Qs IGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisg ICAgICAgICAgICAgICAgIGFjdGl2ZV9wLCBnbHl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lNGQgICUzZCAgJTNk ICVzICVzXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAg ICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAor ICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAnUycsCisgICAgICAgIGdseXBoLT5jaGFycG9z LAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0InCisgICAg ICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAg ICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICA/ICcwJworICAg ICAgICAgICAgICAgOiAnLScpKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAg ICAgMHUsCisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hf bGluZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgt PngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgZ2x5cGgtPnZwb3MsIGdseXBoLT56dl9wID8gIlpW IiA6ICItLSIsCisgICAgICAgICJcXFMiKTsKKyAgc3dpdGNoIChhY3Rpb25fdHlwZSkKKyAgewor LyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgIE1VTFRJ UExFX0NVUlNPUlM6ICBTVFJFVENIX0dMWVBIICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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ICAgICAgIGFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLCBjYWNo ZV90eXBlKTsKKyAgICAgIGlmIChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93 LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICYmIHJlbGF0aXZlX3ggPD0geF9saW1pdCkKKyAg ICAgICAgeworICAgICAgICAgIGlmIChyZWxhdGl2ZV94IDwgcm93LT5waXhlbF93aWR0aCkKKyAg ICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgIHRl bXBfZmFjZV9pZCA9IChyb3ctPmZpbGxfbGluZV9wKQorICAgICAgICAgICAgICAgICAgICAgICAg ID8gZ2x5cGgtPmZhY2VfaWQKKyAgICAgICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFD RV9JRDsKKyAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGJhY2tncm91bmQ7CisgICAgICAgICAgbWNf c2V0X2xzbF9iZyAodywgdGVtcF9mYWNlX2lkLCAmYmFja2dyb3VuZCk7CisgICAgICAgICAgbWNf aGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBv cywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgIHhfbGltaXQgLSByZWxhdGl2ZV94LCBoLCBj dXJzb3JfdHlwZSwgeF9saW1pdCAtIHJlbGF0aXZlX3gsCisgICAgICAgICAgICAgICAgICAgICBm b3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLCBhY3RpdmVfcCwgTUNfR0xZUEhMRVNTLCBkcmF3X3AsCisg ICAgICAgICAgICAgICAgICAgICBjYWNoZV90eXBlKTsKKyAgICAgICAgfQorICAgICAgYnJlYWs7 CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t L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PmNvbnRpbnVlZF9wKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xB U0gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmlu Z2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+Y29u dGludWVkX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ct PnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRf b25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19S RVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXSAhPSAx CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0 ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBN Q19SRVZFUlNFRF9WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogTUNfR0xZUEhMRVNTOworICAgICAgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNB TF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJT RURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09 IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0g TUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VE X1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgY3Vyc29yX3R5cGUgPSBNQ19SSUdIVF9GUklOR0VfQklU TUFQOworICAgICAgd2QgPSAxOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5 cGgsIG9wb2ludF94LCBvcG9pbnRfZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAg ICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYmFja2dy b3VuZCwKKyAgICAgICAgICAgICAgICAgYWN0aXZlX3AsIGdseXBoX2ZsYXZvciwgZHJhd19wLCBj YWNoZV90eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAq LworLyogICAgICAgICAgICAgICAgICAgICAgICAgICBGSUxMX0NPTFVNTjogIFNUUkVUQ0hfR0xZ UEggICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAg ICBjYXNlIEZJTExfQ09MVU1OOgorICAgIHsKKyAgICAgIGlmIChyb3ctPmZpbGxfbGluZV9wCisg ICAgICAgICAgJiYgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFth cmVhXSAtIDEKKyAgICAgICAgICAmJiBmY194ID4gcmVsYXRpdmVfeCArIGdseXBoLT5waXhlbF93 aWR0aCkKKyAgICAgICAgdGVtcF9mYWNlX2lkID0gZ2x5cGgtPmZhY2VfaWQ7CisgICAgICAgIGVs c2UgaWYgKCFyb3ctPmZpbGxfbGluZV9wCisgICAgICAgICAgICAgICAgICYmIGdseXBoIC0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAg ICAgICYmIGZjX3ggPiByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoKQorICAgICAgICAg IHRlbXBfZmFjZV9pZCA9IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgIHN0cnVjdCBtY19SR0IgYmFj a2dyb3VuZDsKKyAgICAgIG1jX3NldF9sc2xfYmcgKHcsIHRlbXBfZmFjZV9pZCwgJmJhY2tncm91 bmQpOworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gTUNfR0xZUEhMRVNTOwor ICAgICAgd2QgPSAxOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIGZj X3gsIGZjX2Z4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICA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ChzdGRlcnIsCisgICAgICAgICJcbiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBE ImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4xZCAlNWQgJTRkICAlM2QgICUzZCAlcyAlY1xu IiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJv dy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAg cmVsYXRpdmVfeCwKKyAgICAgICAgJ0knLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAg ICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICA/ICdCJworICAgICAgICAgOiAo U1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6 IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICAg ICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgICh1bnNp Z25lZCBpbnQpIGdseXBoLT51LmltZ19pZCwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAg ICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGlu ZV9wLAorICAgICAgICBnbHlwaC0+eCwgZ2x5cGgtPnksIGdseXBoLT5ocG9zLCBnbHlwaC0+dnBv cywgZ2x5cGgtPnp2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgJy4nKTsKKyAgc3dpdGNoIChh Y3Rpb25fdHlwZSkKKyAgeworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICA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0tLS0gKi8KKworLyogLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t ICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICBCRUdJTjogIENPTVBPU0lURV9HTFlQ SCAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLwor ICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpCisgIHsKKyAgICBpZiAo bWNfc3RkZXJyX3ApCisgICAgICB7CisgICAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAg ICAiXG4gJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNngiLAorICAgICAg ICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgICAoKHJvdy0+dXNl ZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgICByZWxh dGl2ZV94LAorICAgICAgICAgICcrJywKKyAgICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAg ICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgPyAnQicKKyAgICAgICAg ICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgPyAnUycKKyAgICAg ICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgICAgPyAnMCcK KyAgICAgICAgICAgICAgICAgOiAnLScpKSksCisgICAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRo LAorICAgICAgICAgICh1bnNpZ25lZCBpbnQpIGdseXBoLT51LmNtcC5pZCk7CisgICAgICAgIGZw cmludGYgKHN0ZGVyciwgIiAlNGQgJTEuMWQlMS4xZCIsCisgICAgICAgICAgZ2x5cGgtPmZhY2Vf aWQsCisgICAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgICBnbHlwaC0+ cmlnaHRfYm94X2xpbmVfcCk7CisgICAgICBpZiAoZ2x5cGgtPnUuY21wLmF1dG9tYXRpYykKKyAg ICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICU1ZCAlNGQgICUzZCAgJTNkICVzIC4gWyVkLSVkXVxu IiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaC0+eCwgZ2x5cGgtPnksIGdseXBoLT5o cG9zLCBnbHlwaC0+dnBvcywgZ2x5cGgtPnp2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgICAg ICAgICAgICAgICAgICBnbHlwaC0+c2xpY2UuY21wLmZyb20sIGdseXBoLT5zbGljZS5jbXAudG8p OworICAgICAgICBlbHNlCisgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiXG4iKTsKKyAgICAg IH0KKyAgc3dpdGNoIChhY3Rpb25fdHlwZSkKKyAgeworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICov CisvKiAgICAgICAgICAgICAgICAgICAgICAgTVVMVElQTEVfQ1VSU09SUzogIENPTVBPU0lURV9H TFlQSCAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAg IGNhc2UgTVVMVElQTEVfQ1VSU09SUzoKKyAgICB7CisgICAgICBtY19oZWxwZXIgKHcsIG1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vdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiBy ZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAgIHsKKyAgICAgICAgICByZWxhdGl2ZV94ICs9 IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICB3aGlsZSAocmVsYXRpdmVfeCA8PSB4X2xp bWl0KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwg cm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAg ICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3Jv dW5kLCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2ZV9wLCBNQ19H TFlQSExFU1MsIGRyYXdfcCwgY2FjaGVfdHlwZSk7CisgICAgICAgICAgICAgIHJlbGF0aXZlX3gg Kz0gZnJhbWVfY2hhcl93aWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgYnJl YWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAg ICAgICAgICBWRVJUSUNBTF9SVUxFUjogIENPTVBPU0lURV9HTFlQSCAgICAgICAgICAgICAgICAg ICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgVkVSVElDQUxfUlVMRVI6 CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1cnNvcl9hdF9m cmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+Y29u dGludWVkX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVS VElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX1JJ R0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3Jf YmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+dXNl ZFtURVhUX0FSRUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09 IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIG9wb2ludF94ID49IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6ICh6dl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiBNQ19HTFlQSDsKKyAgICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJ R0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJ Q0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJU SUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJ Q0FMX0JBUgorICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNB TF9CQVIpCisgICAgICAgIGN1cnNvcl90eXBlID0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUDsKKyAg ICAgIHdkID0gMTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxh dGl2ZV94LCBvcG9pbnRfZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICB3 ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwK KyAgICAgICAgICAgICAgICAgYWN0aXZlX3AsIGdseXBoX2ZsYXZvciwgZHJhd19wLCBjYWNoZV90 eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyog ICAgICAgICAgICAgICAgICAgICAgICAgIEZJTExfQ09MVU1OOiAgQ09NUE9TSVRFX0dMWVBIICAg ICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNl IEZJTExfQ09MVU1OOgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9 IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQor ICAgICAgICAgICAgICAgICAgICAgICYmIGZjX3ggPiByZWxhdGl2ZV94KQorICAgICAgICAgICAg ICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICA6ICh6dl9wKQorICAg ICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICA6ICgh TklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgJiYgIU5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfdmVydGljYWxfcnVsZXIpKQorICAg ICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF95ID09IHkKKyAgICAgICAgICAgICAgICAgICAg ICAmJiBvcG9pbnRfdnBvcyA9PSB2cG9zKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQ SExFU1MKKyAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgd2QgPSAxOworICAg ICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZjX2Z4LCB5 LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBj dXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgIGFj dGl2ZV9wLCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgY2FjaGVfdHlwZSk7CisgICAgICBicmVhazsK KyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgfQorICB9CisvKiAtLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRU5EOiAgQ09NUE9T SVRFX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tICovCisKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAg ICAgICAgICAgIEJFR0lOOiAgWFdJREdFVF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgICAg ICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0g WFdJREdFVF9HTFlQSCkKKyAgeworI2lmbmRlZiBIQVZFX1hXSURHRVRTCisgICAgZWFzc3VtZSAo ZmFsc2UpOworI2Vsc2UKKyAgICBpZiAobWNfc3RkZXJyX3ApCisgICAgICBmcHJpbnRmIChzdGRl cnIsCisgICAgICAgICJcbiAgJTVkLyUtNWQgJTVkICU0YyAlNmQgJWMgJTNkIDB4JTA1eCAlNGQg JTEuMWQlMS4xZCAlNWQgJTRkICAlM2QgICUzZCAlcyAlY1xuIiwKKyAgICAgICAgZ2x5cGggLSBy b3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/ IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAg J1gnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5v YmplY3QpCisgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVj dCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6ICctJykpLAorICAgICAgICBnbHlw aC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+ bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0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ER0VUX0dMWVBIICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLSAqLworICAgIGNhc2UgSE9SSVpPTlRBTF9SVUxFUjoKKyAgICB7CisgICAgICBpZiAocmVs YXRpdmVfeCA8PSB4X2xpbWl0CisgICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAg ICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5 LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUs IGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwKKyAgICAgICAgICAgICAgICAg ICBhY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwgY2FjaGVfdHlwZSk7CisgICAgICBpZiAoZ2x5 cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAg ICAgICAmJiByZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAgIHsKKyAgICAgICAgICByZWxh dGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICB3aGlsZSAocmVsYXRpdmVf eCA8PSB4X2xpbWl0KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19oZWxwZXIgKHcs IG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAor ICAgICAgICAgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRo LCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2 ZV9wLCBNQ19HTFlQSExFU1MsIGRyYXdfcCwgY2FjaGVfdHlwZSk7CisgICAgICAgICAgICAgIHJl bGF0aXZlX3ggKz0gZnJhbWVfY2hhcl93aWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQor ICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAg ICAgICAgICAgICAgICAgICAgVkVSVElDQUxfUlVMRVI6ICBYV0lER0VUX0dMWVBIICAgICAgICAg ICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgVkVSVElD QUxfUlVMRVI6CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1 cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IHJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3Jp Z2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElD QUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IChjdXJzb3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJP VworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9m cmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29y X3Jvdy0+dXNlZFtURVhUX0FSRUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhU X0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIG9wb2ludF94ID49IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6ICh6dl9wKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElD QUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVS U0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9 PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09 IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNF RF9WRVJUSUNBTF9CQVIpCisgICAgICAgIGN1cnNvcl90eXBlID0gTUNfUklHSFRfRlJJTkdFX0JJ VE1BUDsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94 LCBvcG9pbnRfZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICB3ZCwgaCwg Y3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwKKyAgICAg ICAgICAgICAgICAgYWN0aXZlX3AsIGdseXBoX2ZsYXZvciwgZHJhd19wLCBjYWNoZV90eXBlKTsK KyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAg ICAgICAgICAgICAgICAgICAgICBGSUxMX0NPTFVNTjogIFhXSURHRVRfR0xZUEggICAgICAgICAg ICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEZJTExf Q09MVU1OOgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChnbHlw aCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAg ICAgICAgICAgICAgICAgICYmIGZjX3ggPiByZWxhdGl2ZV94KQorICAgICAgICAgICAgICAgICAg ICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICA6ICh6dl9wKQorICAgICAgICAg ICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICA6ICghTklMUCAo QlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAg ICAgICAgICAgICAgICYmIG9wb2ludF95ID09IHkKKyAgICAgICAgICAgICAgICAgICAgICAmJiBv cG9pbnRfdnBvcyA9PSB2cG9zKQorICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MK KyAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgbWNfaGVscGVyICh3LCBtYXRy aXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZjX2Z4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAg ICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91 bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgIGFjdGl2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XNoZXMgb24gc3RhcnR1cCB3aXRob3V0IGEgYEJVRkZFUlAnIGNoZWNrIGluIGB1cGRhdGVfd2lu ZG93Jy4gKi8KKyAgaWYgKCFCVUZGRVJQICh3LT5jb250ZW50cykpCisgICAgcmV0dXJuOworICBp ZiAoTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAgICYm IE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAm JiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKSkKKyAgICBy ZXR1cm47CisgIGlmICh2cG9zID09IGJvdHRvbV92cG9zKQorICAgIHJldHVybjsKKyAgaWYgKCFy b3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICByZXR1cm47CisgIGludCBocG9zX3N0YXJ0ID0gc3Rh cnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdOworICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisg ICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZHJhd19yb3cgKCVzKTogIHZwb3MgKCVkKSB8IGhwb3Mg KCVkKSB8IGxlbiAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgbWNfd2luZG93ICh3KSwg dnBvcywgaHBvc19zdGFydCwgaHBvc19sZW5ndGgpOworICBMaXNwX09iamVjdCB3aW5kb3c7Cisg IFhTRVRXSU5ET1cgKHdpbmRvdywgdyk7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ ZnJhbWUpOworICBMaXNwX09iamVjdCBidWYgPSB3LT5jb250ZW50czsKKyAgQ0hFQ0tfQlVGRkVS IChidWYpOworICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAoYnVmKTsKKyAgaW50IG9wb2lu dF9meCwgb3BvaW50X2Z5LCBvcG9pbnRfd2QsIG9wb2ludF9oOworICBpbnQgdGV4dF9hcmVhX3dp ZHRoID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgaW50IGhlYWRlcl9saW5l X2Zvcm1hdCA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICBzdHJ1Y3QgZ2x5cGhf cm93ICpjdXJzb3Jfcm93ID0gKHctPmN1cnNvci52cG9zICE9IC0xKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XIChjdXJzb3JfbWF0cml4LCB3LT5jdXJzb3Iu dnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTlVMTDsKKyAgc3RydWN0 IGdseXBoICpjdXJzb3JfZ2x5cGggPSAody0+Y3Vyc29yLnZwb3MgIT0gLTEpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBtY19nZXRfY3Vyc29yX2dseXBoICh3LCBjdXJzb3JfbWF0 cml4LCBjdXJzb3Jfcm93LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogTlVMTDsKKyAgYm9vbCBjdXJzb3JfYXRfZnJpbmdlX3Ag PSAoY3Vyc29yX2dseXBoID09IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg Y3Vyc29yX3JvdyAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1 cnNvci5ocG9zID09IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93LT5leGFjdF93aW5kb3dfd2lkdGhfbGluZV9wCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID09IHRleHRfYXJlYV93 aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA9PSBjdXJz b3Jfcm93LT5waXhlbF93aWR0aCk7CisgIGJvb2wgY3Vyc29yX2JleW9uZF9mcmluZ2VfcCA9IChj dXJzb3JfZ2x5cGggPT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg Y3Vyc29yX3JvdyAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5jdXJzb3IuaHBvcyA9PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmICFjdXJzb3Jfcm93LT5leGFjdF93aW5kb3dfd2lkdGhf bGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA+ PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHct PmN1cnNvci54ID49IGN1cnNvcl9yb3ctPnBpeGVsX3dpZHRoKTsKKyAgLy8gIGJvb2wgY2dfcCA9 IGN1cnNvcl9nbHlwaCA9PSBOVUxMOworICAvLyAgYm9vbCBjcl9wID0gY3Vyc29yX3JvdyAhPSBO VUxMOworICAvLyAgYm9vbCBjaF9jcnUgPSB3LT5jdXJzb3IuaHBvcyA9PSBjdXJzb3Jfcm93LT51 c2VkW1RFWFRfQVJFQV07CisgIC8vICBib29sIGNyZXd3bF9wID0gIWN1cnNvcl9yb3ctPmV4YWN0 X3dpbmRvd193aWR0aF9saW5lX3A7CisgIC8vICBib29sIGN4X3Rhd19wID0gdy0+Y3Vyc29yLngg Pj0gdGV4dF9hcmVhX3dpZHRoOworICAvLyAgYm9vbCBjeF9jcnB3X3AgPSB3LT5jdXJzb3IueCA+ PSBjdXJzb3Jfcm93LT5waXhlbF93aWR0aDsKKyAgLy8gIGZwcmludGYgKHN0ZGVyciwgInZwb3Mg KCVkKSB8IGhwb3MgKCVkLyVkKSB8IGN1cnNvci54ICglZCkgfCB0YXcgKCVkKSB8IHVzZWQgKCVk KSB8IHJ0X3AgKCVkKVxuXAorICAvLyAgICBjZ19wICglZCksIGNyX3AgKCVkKSwgY2hfY3J1ICgl ZCksIGNyZXd3bF9wICglZCksIGN4X3Rhd19wICglZCksIGN4X2NycHdfcCAoJWQpXG4iLAorICAv LyAgICB2cG9zLCBocG9zX3N0YXJ0LCBocG9zX2xlbmd0aCwgdy0+Y3Vyc29yLngsIHRleHRfYXJl YV93aWR0aCwgcm93LT51c2VkW1RFWFRfQVJFQV0sIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3As CisgIC8vICAgIGNnX3AsIGNyX3AsIGNoX2NydSwgY3Jld3dsX3AsIGN4X3Rhd19wLCBjeF9jcnB3 X3ApOworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAg IFJFUExBQ0UgVEhFIFJFQUwgQ1VSU09SCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAgZW51 bSBmYWNlX2lkIGJnX2ZhY2VfaWQgPSAoY3Vyc29yX2dseXBoICE9IE5VTEwpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBjdXJzb3JfZ2x5cGgtPmZhY2VfaWQKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgc3RydWN0IG1jX1JHQiBjdXJzb3Jf Ymc7CisgIG1jX3NldF9sc2xfYmcgKHcsIGJnX2ZhY2VfaWQsICZjdXJzb3JfYmcpOworICAvKiBG SVhNRTogIFB1dCBpbiBzb21lIGNvZGUgdG8gZGVmYXVsdCB0byBNQ19IT0xMT1dfQk9YIGlmIHRo ZSB1c2VyIGhhcworICB1bndpdHRpbmdseSBjb21lIHVwIHdpdGggc29tZSB1bmFjY2VwdGFibGUg Zm9ybSBvZiB1bnJlY29nbml6ZWQgY3Vyc29yIHR5cGUuICovCisgIExpc3BfT2JqZWN0IGxpc3Bf dHlwZSA9IEJWQVIgKGIsIG1jX3JlYWxfZmFrZV9jdXJzb3IpOworICBlbnVtIHR5cGVfb2ZfY3Vy c29yIGN1cnNvcl90eXBlID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoWENBUiAobGlz cF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IG1jX2xp c3BfdG9fY3Vyc29yX3R5cGUgKGxpc3BfdHlwZSk7CisgIGludCBjdXJzb3Jfd2lkdGggPSAoQ09O U1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICA/IFhGSVhOVU0gKFhDQVIgKFhD RFIgKGxpc3BfdHlwZSkpKQorICAgICAgICAgICAgICAgICAgICAgOiAtMTsKKyAgZW51bSBmYWNl X2lkIGN1cnNvcl9mYWNlX2lkID0KKyAgICAoIWFjdGl2ZV9wCisgICAgICYmICFOSUxQIChCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICA/IGxv b2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItaW5hY3Rp dmUtZmFjZSIpLCB0cnVlKQorICAgIDogbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAo IistcmVhbC1mYWtlLWN1cnNvci1mYWNlIiksIHRydWUpOworICBzdHJ1Y3QgZmFjZSAqY3Vyc29y X2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGN1cnNvcl9mYWN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b250ZW50cyksIG1jX2NvbmYpKQorICAgICAgICAgICAgICAgICAg ICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0NBQ0hFKTsK KyAgICAgIG1jX2dldF9jdXJzb3JfZ2VvbWV0cnkgKHcsIG1hdHJpeCwgcm93LCB3LT5jdXJzb3Iu eCwgJm9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MsICZvcG9pbnRfaCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1DX0hCQVIsIDEsICZvcG9pbnRfd2QpOwor ICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgY3Vyc29yX2dseXBoLCB3LT5jdXJzb3Iu eCwgb3BvaW50X2Z4LCB3LT5jdXJzb3IueSwKKyAgICAgICAgICAgICAgICAgb3BvaW50X2Z5LCB3 LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MsIG9wb2ludF93ZCwgb3BvaW50X2gsCisgICAg ICAgICAgICAgICAgIE1DX0hCQVIsIDEsIGN1cnNvcl9mZywgY3Vyc29yX2JnLCBhY3RpdmVfcCwg TUNfR0xZUEgsIGRyYXdfcCwKKyAgICAgICAgICAgICAgICAgTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgPyBDSF9DQUNIRQorICAg ICAgICAgICAgICAgICA6IE1DX0NBQ0hFKTsKKyAgICB9CisgIGVsc2UgaWYgKCFjdXJzb3JfYXRf ZnJpbmdlX3AKKyAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAg JiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA+ PSBocG9zX3N0YXJ0CisgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zIDwgaHBvc19zdGFydCAr IGhwb3NfbGVuZ3RoCisgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+dHlwZSAhPSBTVFJFVENI X0dMWVBIKQorICAgIHsKKyAgICAgIG1jX2dldF9jdXJzb3JfZ2VvbWV0cnkgKHcsIG1hdHJpeCwg cm93LCB3LT5jdXJzb3IueCwgJm9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZw b3MsICZvcG9pbnRfaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBl LCBjdXJzb3Jfd2lkdGgsICZvcG9pbnRfd2QpOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgs IHJvdywgY3Vyc29yX2dseXBoLCB3LT5jdXJzb3IueCwgb3BvaW50X2Z4LCB3LT5jdXJzb3IueSwK KyAgICAgICAgICAgICAgICAgb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZw b3MsIG9wb2ludF93ZCwgb3BvaW50X2gsCisgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCBj dXJzb3Jfd2lkdGgsIGN1cnNvcl9mZywgY3Vyc29yX2JnLCBhY3RpdmVfcCwKKyAgICAgICAgICAg ICAgICAgTUNfR0xZUEgsIGRyYXdfcCwgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMp LCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBDSF9DQUNI RQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0NBQ0hFKTsKKyAgICB9 CisgIGVsc2UgaWYgKCFjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgJiYgY3Vyc29yX2ds eXBoICE9IE5VTEwKKyAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAg ICAgICAmJiB3LT5jdXJzb3IuaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICYmIHctPmN1 cnNvci5ocG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoCisgICAgICAgICAgICYmIGN1cnNv cl9nbHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKQorICAgIHsKKyAgICAgIC8qIElmIGEgdXNl ciBoYXMgc2V0IGB4LXN0cmV0Y2gtY3Vyc29yJyB0byBhIG5vbi1uaWwgdmFsdWUsIGhlL3NoZSBj aG9zZSB0bworICAgICAgaGF2ZSBhIGN1cnNvciB0aGF0IHNwYW5zIHRoZSBlbnRpcmUgbGVuZ3Ro IG9mIHRoZSBTVFJFVENIX0dMWVBILiAqLworICAgICAgaWYgKCF4X3N0cmV0Y2hfY3Vyc29yX3Ap CisgICAgICAgIHsKKyAgICAgICAgICAvKiBUaGUgTUNfSEJBUiBzaGFsbCBoYXZlIGEgYGN1cnNv cl93aWR0aGAgb2YgMS4gKi8KKyAgICAgICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBt YXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRfZngsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgdy0+Y3Vyc29yLnksICZvcG9pbnRfZnksIHctPmN1cnNvci5ocG9zLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci52cG9zLCAmb3BvaW50 X2gsIE1DX0hCQVIsIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2lu dF93ZCk7CisgICAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgY3Vyc29yX2dseXBo LCB3LT5jdXJzb3IueCwgb3BvaW50X2Z4LAorICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29y LnksIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLAorICAgICAgICAg ICAgICAgICAgICAgb3BvaW50X3dkLCBvcG9pbnRfaCwgTUNfSEJBUiwgMSwgY3Vyc29yX2ZnLCBj dXJzb3JfYmcsCisgICAgICAgICAgICAgICAgICAgICBhY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdf cCwKKyAgICAgICAgICAgICAgICAgICAgIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICA/IENIX0NBQ0hFCisgICAgICAgICAg ICAgICAgICAgICA6IE1DX0NBQ0hFKTsKKyAgICAgICAgfQorICAgICAgbWNfZ2V0X2N1cnNvcl9n ZW9tZXRyeSAodywgbWF0cml4LCByb3csIHctPmN1cnNvci54LCAmb3BvaW50X2Z4LAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLnksICZvcG9pbnRfZnksIHctPmN1cnNv ci5ocG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLnZwb3MsICZv cG9pbnRfaCwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJz b3Jfd2lkdGgsICZvcG9pbnRfd2QpOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywg Y3Vyc29yX2dseXBoLCB3LT5jdXJzb3IueCwgb3BvaW50X2Z4LCB3LT5jdXJzb3IueSwKKyAgICAg ICAgICAgICAgICAgb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MsIG9w b2ludF93ZCwgb3BvaW50X2gsCisgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCBjdXJzb3Jf d2lkdGgsIGN1cnNvcl9mZywgY3Vyc29yX2JnLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAg TUNfR0xZUEgsIGRyYXdfcCwgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19j b25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBDSF9DQUNIRQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0NBQ0hFKTsKKyAgICB9CisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgRFJBVyBBTkQg UkVDT1JEIEZBS0UgQ1VSU09SUworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisgIGlmIChocG9z X2xlbmd0aCA9PSAxKQorICAgIHsKKyAgICAgIGlmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBtY19jb25mKSkpCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUaGUgc3BhY2Ug YXBwZW5kZWQgdG8gYSByb3cgZW5kaW5nIHdpdGggYSBuZXcgbGluZQorICAgICAgICAgIGRvZXMg bm90IGhhdmUgYSBgZ2x5cGgtPmNoYXJwb3NgICgtMSwgMCkgdGhhdCB3ZSBjYW4KKyAgICAgICAg ICB1c2UgZm9yIHRoaXMgcGFydGljdWxhciBhcHBsaWNhdGlvbi4gIFdoZW4gdGhlcmUgaXMgYQor ICAgICAgICAgIGBidWZmZXItZGlzcGxheS10YWJsZScgZW50cnkgdGhhdCBhc3NpZ25zIGEgdmlz aWJsZQorICAgICAgICAgIGdseXBoIHRvIGEgbmV3IGxpbmUsIHRoZXJlIGlzIG5vIHByb2JsZW0g YmVjYXVzZSB0aGF0CisgICAgICAgICAgZ2x5cGggaGFzIGEgYGdseXBoLT5jaGFycG9zJyB0aGF0 IHdlIGNhbiB1c2UuICBXaGVuCisgICAgICAgICAgbm8gdmlzaWJsZSBFT0wgZ2x5cGggZXhpc3Rz LCB3ZSB1c2UgdGhlIGZvbGxvd2luZworICAgICAgICAgIHRlc3Q6ICB0aGUgYXBwZW5kZWQgc3Bh Y2UgaGFzIGEgcG9zaXRpb24gdGhhdCBpcyBvbmUKKyAgICAgICAgICBsZXNzIHRoYW4gdGhlIGVu ZCBvZiB0aGUgbWF0cml4IHJvdy4gKi8KKyAgICAgICAgICBpbnQgaHBvcyA9IHN0YXJ0IC0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnByZXZpb3VzX2ds eXBoID0gKDAgPD0gaHBvcyAtIDEgJiYgaHBvcyAtIDEgPCByb3ctPnVzZWRbVEVYVF9BUkVBXSkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyByb3ctPmdseXBoc1tU RVhUX0FSRUFdICsgaHBvcyAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiBOVUxMOworICAgICAgICAgIGJvb2wgc2tpcF9wID0gKHByZXZpb3VzX2dseXBoICE9 IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiBwcmV2aW91c19nbHlwaC0+Y2hhcnBv cyA9PSBNQVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpIC0gMSk7CisgICAgICAgICAgaW50IHBv c2ludCA9IChzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW1RFWFRf QVJFQV0gLSAxKQorICAgICAgICAgICAgICAgICAgICAgICA/IE1BVFJJWF9ST1dfRU5EX0NIQVJQ T1MgKHJvdykgLSAxCisgICAgICAgICAgICAgICAgICAgICAgIDogc3RhcnQtPmNoYXJwb3M7Cisg ICAgICAgICAgTGlzcF9PYmplY3Qgc3BlY3MgPSBtY19hc3NvYyAobWFrZV9maXhudW0gKHBvc2lu dCksIEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpOworICAgICAgICAgIGlm ICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICB8 fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAgJiYgIU5JTFAgKHNwZWNz KQorICAgICAgICAgICAgICAmJiBzdGFydC0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykK KyAgICAgICAgICAgICAgJiYgIXNraXBfcAorICAgICAgICAgICAgICAmJiAhc3RhcnQtPnp2X3Ap CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIExpc3BfT2JqZWN0IGxpc3BfdHlwZSA9IG1j X250aCAoMSwgc3BlY3MpOworICAgICAgICAgICAgICBlbnVtIHR5cGVfb2ZfY3Vyc29yIGN1cnNv cl90eXBlID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBtY19saXNwX3RvX2N1cnNvcl90eXBlIChYQ0FSIChsaXNw X3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiBtY19saXNwX3RvX2N1cnNvcl90eXBlIChsaXNwX3R5cGUpOworICAgICAgICAgICAgICBjdXJz b3JfdHlwZSA9IChzdGFydC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IE1DX0hPTExPV19CT1gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IGN1cnNvcl90eXBlOworICAgICAgICAgICAgICBpbnQgY3Vyc29yX3dpZHRoID0gKENPTlNQIChs aXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBYRklYTlVNIChY Q0FSIChYQ0RSIChsaXNwX3R5cGUpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogLTE7CisgICAgICAgICAgICAgIExpc3BfT2JqZWN0IG1jX2ZvcmVncm91bmQgPSBtY19udGgg KDIsIHNwZWNzKTsKKyAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBmb3JlZ3JvdW5kOworICAg ICAgICAgICAgICBpZiAoU1RSSU5HUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAg bWNfeHdfY29sb3JfdmFsdWVzICh3LCBtY19mb3JlZ3JvdW5kLCAmZm9yZWdyb3VuZCk7CisgICAg ICAgICAgICAgICAgZWxzZSBpZiAoVkVDVE9SUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGRvdWJsZSByZWRfZmcgPSBYRkxPQVRfREFU QSAoQVJFRiAobWNfZm9yZWdyb3VuZCwgMCkpOworICAgICAgICAgICAgICAgICAgICBkb3VibGUg Z3JlZW5fZmcgPSBYRkxPQVRfREFUQSAoQVJFRiAobWNfZm9yZWdyb3VuZCwgMSkpOworICAgICAg ICAgICAgICAgICAgICBkb3VibGUgYmx1ZV9mZyA9IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3Jl Z3JvdW5kLCAyKSk7CisgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQucmVkID0gcmVkX2Zn OworICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kLmdyZWVuID0gZ3JlZW5fZmc7CisgICAg ICAgICAgICAgICAgICAgIGZvcmVncm91bmQuYmx1ZSA9IGJsdWVfZmc7CisgICAgICAgICAgICAg ICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmIChOSUxQIChtY19mb3JlZ3JvdW5kKSkK KyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQu cmVkID0gY2hfZm9yZWdyb3VuZC5yZWQ7CisgICAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3Vu ZC5ncmVlbiA9IGNoX2ZvcmVncm91bmQuZ3JlZW47CisgICAgICAgICAgICAgICAgICAgICAgZm9y ZWdyb3VuZC5ibHVlID0gY2hfZm9yZWdyb3VuZC5ibHVlOworICAgICAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7 CisgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9B UkVBKTsKKyAgICAgICAgICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgc3RhcnQsIFRF WFRfQVJFQSwgeCwgeF9saW1pdCwgcm93LT55LAorICAgICAgICAgICAgICAgICAgICAgICAgIHN0 YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwgdnBvcywgY3Vyc29yX3R5cGUsCisgICAgICAg ICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoLCBjdXJzb3JfbWF0cml4LCBmY194LCBmb3Jl Z3JvdW5kLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJT T1JTLCBkcmF3X3AsIE1DX0NBQ0hFKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAg aWYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQorICAg ICAgICAgICYmIGZjX3ggPD0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgJiYgZmNfeCA+PSB3 LT5tYy5sbnVtX3BpeGVsX3dpZHRoKQorICAgICAgICB7CisgICAgICAgICAgaW50IHhfbGltaXQg PSB4ICsgc3RhcnQtPnBpeGVsX3dpZHRoOworICAgICAgICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNv cl9wID0gKHctPmN1cnNvci54ID09IGZjX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiB3LT5jdXJzb3IueSA9PSBzdGFydC0+eQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID09IHN0YXJ0IC0gcm93LT5nbHlwaHNb VEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1 cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAgIGlmICh4ICsgc3RhcnQtPnBpeGVsX3dpZHRo IDw9IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAmJiAoKGhlYWRlcl9saW5lX2Zvcm1h dCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICAgICB8fCBoZWFkZXJfbGluZV9mb3Jt YXQgPT0gMCkKKyAgICAgICAgICAgICAgJiYgKChmY194ID49IHgKKyAgICAgICAgICAgICAgICAg ICAmJiBmY194IDwgeCArIHN0YXJ0LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgIHx8 IHN0YXJ0ID09IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVzZWRbVEVYVF9BUkVBXSAt IDEpCisgICAgICAgICAgICAgICYmIHN0YXJ0LT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3 KQorICAgICAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAgICAgbWNf ZW5naW5lICh3LCBtYXRyaXgsIHJvdywgc3RhcnQsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwgcm93 LT55LAorICAgICAgICAgICAgICAgICAgICAgICBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJF QV0sIHZwb3MsIE1DX0JBUiwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJp eCwgZmNfeCwgZmNfZm9yZWdyb3VuZCwgYWN0aXZlX3AsIEZJTExfQ09MVU1OLAorICAgICAgICAg ICAgICAgICAgICAgICBkcmF3X3AsIEZDX0NBQ0hFKTsKKyAgICAgICAgfQorICAgICAgaWYgKCFO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAg ICYmICFOSUxQIChCVkFSIChiLCBjaF9ob3Jpem9udGFsX3J1bGVyKSkKKyAgICAgICAgICAmJiB2 cG9zID09IHctPmN1cnNvci52cG9zKQorICAgICAgICB7CisgICAgICAgICAgaW50IHhfbGltaXQg PSAoc3RhcnQgPT0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFd IC0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgID8gdGV4dF9hcmVhX3dpZHRoCisgICAgICAg ICAgICAgICAgICAgICAgICA6IHggKyBzdGFydC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgLyog UHJlc2VydmUgc3VwcG9ydCBmb3IgZGVmYXVsdCBiZWhhdmlvciBzdWNoIHRoYXQgYSB1c2VyIG1h eQorICAgICAgICAgIHNwZWNpZnkgdGhlIGhlaWdodCBvZiBhbiBNQ19IQkFSLCB3aGljaCBiZWdp bnMgaXRzIGpvdXJuZXkKKyAgICAgICAgICBhcyB0aGUgYGN1cnNvcl93aWR0aCcuICBgbWNfZ2V0 X2N1cnNvcl9nZW9tZXRyeScgcmVhZGp1c3RzLiAqLworICAgICAgICAgIG1jX2VuZ2luZSAodywg bWF0cml4LCByb3csIHN0YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGltaXQsIHJvdy0+eSwKKyAgICAg ICAgICAgICAgICAgICAgIHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwgdnBvcywgTUNf SEJBUiwgMSwKKyAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGZjX3gsIGNoX2Zv cmVncm91bmQsIGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAgICAgSE9SSVpPTlRBTF9SVUxF UiwgZHJhd19wLCBDSF9DQUNIRSk7CisgICAgICAgIH0KKyAgICAgIGlmICghTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAmJiAhTklMUCAo QlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICYmICFmaWxsX2NvbHVtbl90 cnVtcHNfcCkKKyAgICAgICAgeworICAgICAgICAgIGN1cnNvcl90eXBlID0gKHN0YXJ0LT50eXBl ID09IElNQUdFX0dMWVBIKQorICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19IT0xMT1dfQk9Y CisgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0JBUjsKKyAgICAgICAgICBpbnQgeF9saW1p dCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAgICAgICAgYm9vbCByZWFs X2Zha2VfY3Vyc29yX3AgPSAody0+Y3Vyc29yLnkgPT0gc3RhcnQtPnkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IudnBvcyA9PSB2cG9zKTsKKyAgICAg ICAgICBpZiAoKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAg ICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAgICYmICgody0+ Y3Vyc29yLnggPj0geAorICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54IDwgeCArIHN0 YXJ0LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgIHx8IHN0YXJ0ID09IHJvdy0+Z2x5 cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpCisgICAgICAgICAgICAg ICYmIHN0YXJ0LT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAgICAgICAgICAm JiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgs IHJvdywgc3RhcnQsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwgcm93LT55LAorICAgICAgICAgICAg ICAgICAgICAgICBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sIHZwb3MsIGN1cnNvcl90 eXBlLCAxLAorICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBmY194LCBjaF9m b3JlZ3JvdW5kLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgVkVSVElDQUxfUlVM RVIsIGRyYXdfcCwgQ0hfQ0FDSEUpOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICAg IHsKKyAgICAgICAgaW50IHJlbGF0aXZlX3ggPSAwOworICAgICAgICBmb3IgKGludCBhcmVhID0g TEVGVF9NQVJHSU5fQVJFQTsgYXJlYSA8IExBU1RfQVJFQTsgKythcmVhKQorICAgICAgICAgIHsK KyAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSByb3ctPmdseXBoc1thcmVhXTsKKyAg ICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGhfZW5kID0gZ2x5cGggKyByb3ctPnVzZWRbYXJl YV07CisgICAgICAgICAgICAvKiBHbHlwaCBmb3IgYSBsaW5lIGVuZCBpbiB0ZXh0LiAqLworICAg ICAgICAgICAgaWYgKGFyZWEgPT0gVEVYVF9BUkVBICYmIGdseXBoID09IGdseXBoX2VuZCAmJiBn bHlwaC0+Y2hhcnBvcyA+IDApCisgICAgICAgICAgICAgICsrZ2x5cGhfZW5kOworICAgICAgICAg ICAgZm9yICg7IGdseXBoIDwgZ2x5cGhfZW5kOyArK2dseXBoKQorICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgaWYgKHZwb3MgIT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAgICAgICAg ICAgICAgJiYgZ2x5cGggIT0gZ2x5cGhfZW5kIC0gMQorICAgICAgICAgICAgICAgICAgICAmJiBm Y194IDwgcmVsYXRpdmVfeAorICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA8IHJl bGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBtY19jb25mKSkpCisgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAg ICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikp KQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvKiBUaGUgc3BhY2Ug YXBwZW5kZWQgdG8gYSByb3cgZW5kaW5nIHdpdGggYSBuZXcgbGluZSBkb2VzCisgICAgICAgICAg ICAgICAgICAgIG5vdCBoYXZlIGEgYGdseXBoLT5jaGFycG9zYCAoLTEsIDApIHRoYXQgd2UgY2Fu IHVzZSBmb3IgdGhpcworICAgICAgICAgICAgICAgICAgICBwYXJ0aWN1bGFyIGFwcGxpY2F0aW9u LiAgV2hlbiBhIGBidWZmZXItZGlzcGxheS10YWJsZScgZW50cnkKKyAgICAgICAgICAgICAgICAg ICAgYXNzaWducyBhIHZpc2libGUgZ2x5cGggdG8gYSBuZXcgbGluZSwgdGhlcmUgaXMgbm8gcHJv YmxlbQorICAgICAgICAgICAgICAgICAgICBiZWNhdXNlIHRoYXQgZ2x5cGggaGFzIGEgYGdseXBo LT5jaGFycG9zJyB0aGF0IHdlIGNhbiB1c2UuCisgICAgICAgICAgICAgICAgICAgIFdoZW4gbm8g dmlzaWJsZSBFT0wgZ2x5cGggZXhpc3RzLCB3ZSB1c2UgdGhlIGZvbGxvd2luZyB0ZXN0OgorICAg ICAgICAgICAgICAgICAgICB0aGUgYXBwZW5kZWQgc3BhY2UgaGFzIGEgcG9zaXRpb24gdGhhdCBp cyBvbmUgbGVzcyB0aGFuIHRoZQorICAgICAgICAgICAgICAgICAgICBlbmQgb2YgdGhlIG1hdHJp eCByb3cuICovCisgICAgICAgICAgICAgICAgICAgIGludCBocG9zID0gZ2x5cGggLSByb3ctPmds eXBoc1tURVhUX0FSRUFdOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnByZXZp b3VzX2dseXBoID0gKDAgPD0gaHBvcyAtIDEgJiYgaHBvcyAtIDEgPCByb3ctPnVzZWRbVEVYVF9B UkVBXSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIGhwb3MgLSAxCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgICAgICAgICAgICAgICAg ICAgIGJvb2wgc2tpcF9wID0gKHByZXZpb3VzX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgcHJldmlvdXNfZ2x5cGgtPmNoYXJwb3MgPT0gTUFUUklY X1JPV19FTkRfQ0hBUlBPUyAocm93KSAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IHRydWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBXaGVu IGEgYGJ1ZmZlci1kaXNwbGF5LXRhYmxlJyBlbnRyeSBjb250YWlucworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGEgdmlzaWJsZSB0YWIgY2hhcmFjdGVyICgiwrsiKSwgdGhlIHN1 YnNlcXVlbnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTVFJFVENIX0dMWVBI IHdpbGwgaGF2ZSB0aGUgc2FtZSBnbHlwaC0+Y2hhcnBvcworICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGFzIHRoZSBhZm9yZW1lbnRpb25lZCB2aXNpYmxlIHRhYiBjaGFyYWN0ZXIu ICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAocHJldmlvdXNfZ2x5cGgg IT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHByZXZpb3Vz X2dseXBoLT5jaGFycG9zID09IGdseXBoLT5jaGFycG9zKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyB0cnVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgaW50IHBvc2ludCA9IChnbHlwaCAtIHJvdy0+ Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSAtIDEKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogZ2x5cGgtPmNoYXJwb3M7CisgICAgICAg ICAgICAgICAgICAgIExpc3BfT2JqZWN0IHNwZWNzID0gbWNfYXNzb2MgKG1ha2VfZml4bnVtIChw b3NpbnQpLCBCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKTsKKyAgICAgICAg ICAgICAgICAgICAgaWYgKCgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID4gMCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChzcGVjcykKKyAgICAgICAgICAgICAgICAgICAg ICAgICYmIGdseXBoLT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAgICAgICAg ICAgICAgICAgICAgJiYgIXNraXBfcAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIWdseXBo LT56dl9wKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAg IExpc3BfT2JqZWN0IGxpc3BfdHlwZSA9IG1jX250aCAoMSwgc3BlY3MpOworICAgICAgICAgICAg ICAgICAgICAgICAgZW51bSB0eXBlX29mX2N1cnNvciBjdXJzb3JfdHlwZSA9IChDT05TUCAobGlz cF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKFhDQVIgKGxpc3BfdHlwZSkpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiBtY19saXNwX3RvX2N1cnNvcl90eXBlIChsaXNwX3R5cGUpOworICAgICAgICAgICAgICAgICAg ICAgICAgY3Vyc29yX3R5cGUgPSAoZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfSE9MTE9XX0JPWAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGN1cnNvcl90eXBlOworICAgICAgICAgICAg ICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aCA9IChDT05TUCAobGlzcF90eXBlKSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFhGSVhOVU0gKFhDQVIgKFhD RFIgKGxpc3BfdHlwZSkpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogLTE7CisgICAgICAgICAgICAgICAgICAgICAgICBMaXNwX09iamVjdCBtY19mb3JlZ3Jv dW5kID0gbWNfbnRoICgyLCBzcGVjcyk7CisgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qg bWNfUkdCIGZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoU1RSSU5HUCAo bWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX3h3X2NvbG9yX3Zh bHVlcyAodywgbWNfZm9yZWdyb3VuZCwgJmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgICAg ICAgICAgICBlbHNlIGlmIChWRUNUT1JQIChtY19mb3JlZ3JvdW5kKSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3VibGUgcmVk X2ZnID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDApKTsKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGRvdWJsZSBncmVlbl9mZyA9IFhGTE9BVF9EQVRBIChBUkVGICht Y19mb3JlZ3JvdW5kLCAxKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3VibGUg Ymx1ZV9mZyA9IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3JvdW5kLCAyKSk7CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kLnJlZCA9IHJlZF9mZzsKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQuZ3JlZW4gPSBncmVlbl9mZzsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQuYmx1ZSA9IGJsdWVfZmc7CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVs c2UgaWYgKE5JTFAgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQucmVkID0gY2hfZm9y ZWdyb3VuZC5yZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kLmdy ZWVuID0gY2hfZm9yZWdyb3VuZC5ncmVlbjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGZvcmVncm91bmQuYmx1ZSA9IGNoX2ZvcmVncm91bmQuYmx1ZTsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9S T1dfVlBPUyAocm93LCBtYXRyaXgpOworICAgICAgICAgICAgICAgICAgICAgICAgaW50IHhfbGlt aXQgPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOworICAgICAgICAgICAgICAgICAg ICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIGFyZWEsIHJlbGF0aXZlX3gs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHhfbGltaXQsIHJvdy0+eSwgZ2x5 cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICB2cG9zLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBjdXJzb3JfbWF0cml4LAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmY194LCBmb3JlZ3JvdW5kLCBhY3Rp dmVfcCwgTVVMVElQTEVfQ1VSU09SUywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgZHJhd19wLCBNQ19DQUNIRSk7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAgICAgICAgICAgJiYgZmNfeCA8PSB0 ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgJiYgZmNfeCA+PSB3LT5tYy5sbnVt X3BpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBp bnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAgICAgICAg ICAgICAgICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKHctPmN1cnNvci54ID09IGZjX3gK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vy c29yLnkgPT0gZ2x5cGgtPnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FS RUFdCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHct PmN1cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGds eXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGhw b3MgPj0gaHBvc19zdGFydAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA8IGhwb3Nf c3RhcnQgKyBocG9zX2xlbmd0aAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgcmVsYXRpdmVf eCArIGdseXBoLT5waXhlbF93aWR0aCA8PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAg ICAgICAgICAgICYmICgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID4gMCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICYmICgoZ2x5cGggIT0gZ2x5cGhfZW5kIC0gMQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBmY194ID49IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgZmNfeCA8IHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGgp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKGdseXBoID09IGdseXBoX2VuZCAtIDEK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZmNfeCA+PSByZWxhdGl2ZV94KSkK KyAgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT55IDw9IHdpbmRvd190ZXh0X2JvdHRv bV95ICh3KQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkK KyAgICAgICAgICAgICAgICAgICAgICBtY19lbmdpbmUgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwg YXJlYSwgcmVsYXRpdmVfeCwgeF9saW1pdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHJvdy0+eSwgaHBvcywgdnBvcywgTUNfQkFSLCAxLCBjdXJzb3JfbWF0cml4LAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgZmNfeCwgZmNfZm9yZWdyb3VuZCwgYWN0aXZlX3As IEZJTExfQ09MVU1OLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhd19wLCBG Q19DQUNIRSk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKCFOSUxQ IChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAg ICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfaG9yaXpvbnRhbF9ydWxlcikpCisgICAgICAg ICAgICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0aCAo dywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgICAgICAgICAgaW50IGhwb3MgPSBnbHlwaCAtIHJv dy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICAgICAgICAgICAgICAgIC8qIFByZXNlcnZlIHN1 cHBvcnQgZm9yIGRlZmF1bHQgYmVoYXZpb3Igc3VjaCB0aGF0IGEgdXNlciBtYXkKKyAgICAgICAg ICAgICAgICAgICAgc3BlY2lmeSB0aGUgaGVpZ2h0IG9mIGFuIE1DX0hCQVIsIHdoaWNoIGJlZ2lu cyBpdHMgam91cm5leQorICAgICAgICAgICAgICAgICAgICBhcyB0aGUgYGN1cnNvcl93aWR0aCcu ICBgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeScgcmVhZGp1c3RzLiAqLworICAgICAgICAgICAgICAg ICAgICBpZiAoaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICAgICAgICAgICAgICAmJiBo cG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoKQorICAgICAgICAgICAgICAgICAgICAgIG1j X2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4X2xpbWl0 LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT55LCBocG9zLCB2cG9zLCBN Q19IQkFSLCAxLCBjdXJzb3JfbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgZmNfeCwgY2hfZm9yZWdyb3VuZCwgYWN0aXZlX3AsIEhPUklaT05UQUxfUlVMRVIsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3X3AsIENIX0NBQ0hFKTsKKyAgICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChC VkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICYmICFmaWxs X2NvbHVtbl90cnVtcHNfcCkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAg ICAgY3Vyc29yX3R5cGUgPSAoZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19IT0xMT1dfQk9YCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiBNQ19CQVI7CisgICAgICAgICAgICAgICAgICAgIGludCB4X2xp bWl0ID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgICAgICAg ICAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3AgPSAody0+Y3Vyc29yLnkgPT0gZ2x5cGgtPnkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29y LnZwb3MgPT0gdnBvcyk7CisgICAgICAgICAgICAgICAgICAgIGludCBocG9zID0gZ2x5cGggLSBy b3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgICAgICAgICAgICBpZiAoaHBvcyA+PSBo cG9zX3N0YXJ0CisgICAgICAgICAgICAgICAgICAgICAgICAmJiBocG9zIDwgaHBvc19zdGFydCAr IGhwb3NfbGVuZ3RoCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoKGhlYWRlcl9saW5lX2Zv cm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgaGVh ZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoKGdseXBo ICE9IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vy c29yLnggPj0gcmVsYXRpdmVfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5j dXJzb3IueCA8IHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgfHwgKGdseXBoID09IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0gcmVsYXRpdmVfeCkpCisgICAgICAg ICAgICAgICAgICAgICAgICAmJiBnbHlwaC0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykK KyAgICAgICAgICAgICAgICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAg ICAgICAgICAgICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIGFyZWEsIHJl bGF0aXZlX3gsIHhfbGltaXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb3ct PnksIGhwb3MsIHZwb3MsIGN1cnNvcl90eXBlLCAxLCBjdXJzb3JfbWF0cml4LAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgZmNfeCwgY2hfZm9yZWdyb3VuZCwgYWN0aXZlX3AsIFZF UlRJQ0FMX1JVTEVSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhd19wLCBD SF9DQUNIRSk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmVsYXRpdmVf eCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICB9Cisg ICAgICB9CisgIC8vICBjbG9ja190IGNsb2NrX2VuZCA9IGNsb2NrKCk7CisgIC8vICBkb3VibGUg Y3B1X3RpbWVfdXNlZCA9ICgoZG91YmxlKSAoY2xvY2tfZW5kIC0gY2xvY2tfc3RhcnQpKSAvIENM T0NLU19QRVJfU0VDOworICAvLyAgZnByaW50ZiAoc3RkZXJyLCAibWNfZHJhd19yb3cgKCVzKTog IFRJTUUgKCVmKVxuIiwgbWNfd2luZG93ICh3KSwgY3B1X3RpbWVfdXNlZCk7Cit9CisKK3ZvaWQK K21jX3JlZHJhd19oZWxwZXIgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXgg Km1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAgICAgICAgZW51bSB0 eXBlX29mX2NhY2hlIGNhY2hlX3R5cGUsIGludCBzdGFydF9ocG9zLCBpbnQgZW5kX2hwb3MpCit7 CisgIGludCByb3dfdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICBzdHJ1 Y3QgbXVsdGlwbGVfY3Vyc29yc19jYWNoZSBmb29fZWx0czsKKyAgc3dpdGNoIChjYWNoZV90eXBl KQorICAgIHsKKyAgICAgIGNhc2UgTk9fQ0FDSEU6CisgICAgICAgIHsKKyAgICAgICAgICBicmVh azsKKyAgICAgICAgfQorICAgICAgY2FzZSBNQ19DQUNIRToKKyAgICAgICAgeworICAgICAgICAg IGZvb19lbHRzLmNhY2hlcyA9IHctPm1jX2VsdHMuY2FjaGVzOworICAgICAgICAgIGZvb19lbHRz LmFsbG9jYXRlZCA9IHctPm1jX2VsdHMuYWxsb2NhdGVkOworICAgICAgICAgIGZvb19lbHRzLnVz ZWQgPSB3LT5tY19lbHRzLnVzZWQ7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAg IGNhc2UgQ0hfQ0FDSEU6CisgICAgICAgIHsKKyAgICAgICAgICBmb29fZWx0cy5jYWNoZXMgPSB3 LT5jaF9lbHRzLmNhY2hlczsKKyAgICAgICAgICBmb29fZWx0cy5hbGxvY2F0ZWQgPSB3LT5jaF9l bHRzLmFsbG9jYXRlZDsKKyAgICAgICAgICBmb29fZWx0cy51c2VkID0gdy0+Y2hfZWx0cy51c2Vk OworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBjYXNlIEZDX0NBQ0hFOgorICAg ICAgICB7CisgICAgICAgICAgZm9vX2VsdHMuY2FjaGVzID0g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ZWdy b3VuZC5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSBmb29fZWx0 cy5jYWNoZXNbZWx0XS5mb3JlZ3JvdW5kLmdyZWVuLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgLmJsdWUgPSBmb29fZWx0cy5jYWNoZXNbZWx0XS5mb3JlZ3JvdW5kLmJsdWV9OworICAg ICAgc3RydWN0IG1jX1JHQiBsc2xfYmcgPSB7LnJlZCA9IGZvb19lbHRzLmNhY2hlc1tlbHRdLmJh Y2tncm91bmQucmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gZm9v X2VsdHMuY2FjaGVzW2VsdF0uYmFja2dyb3VuZC5ncmVlbiwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIC5ibHVlID0gZm9vX2VsdHMuY2FjaGVzW2VsdF0uYmFja2dyb3VuZC5ibHVlfTsK KyAgICAgIGJvb2wgYWN0aXZlX3AgPSBmb29fZWx0cy5jYWNoZXNbZWx0XS5hY3RpdmVfcDsKKyAg ICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IGZvb19lbHRzLmNhY2hlc1tlbHRdLmds eXBoX2ZsYXZvcjsKKyAgICAgIGJvb2wgZW5hYmxlZF9wID0gZm9vX2VsdHMuY2FjaGVzW2VsdF0u ZW5hYmxlZF9wOworICAgICAgaWYgKHZwb3MgPT0gcm93X3Zwb3MKKyAgICAgICAgICAmJiAoKGhw b3MgPj0gc3RhcnRfaHBvcworICAgICAgICAgICAgICAgJiYgaHBvcyA8IGVuZF9ocG9zKQorICAg ICAgICAgICAgICAvKiBBIGZsb2F0aW5nIGN1cnNvciBiZXlvbmQgdGhlIGVuZCBvZiB0aGUgZ2x5 cGggcm93LiAqLworICAgICAgICAgICAgICB8fCAoaHBvcyArIDEgPT0gc3RhcnRfaHBvcworICAg ICAgICAgICAgICAgICAgJiYgaHBvcyArIDEgPT0gZW5kX2hwb3MpKQorICAgICAgICAgICYmIGVu YWJsZWRfcCkKKyAgICAgICAgeworICAgICAgICAgIGJvb2wgcmVtb3ZlX3AgPSBmYWxzZTsKKyAg ICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBm eSwgaHBvcywgdnBvcywgd2QsIGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1 cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGxzbF9mZywgYWN0aXZlX3AsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgcmVtb3ZlX3ApOworICAgICAgICB9Cisg ICAgfQorfQorCit2b2lkCittY19yZWRyYXdfcm93IChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3Qg Z2x5cGhfbWF0cml4ICptYXRyaXgsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKKyAgICAgICAgICAg ICAgIGludCBzdGFydF94LCBpbnQgc3RhcnRfaHBvcywgaW50IGVuZF9ocG9zLCBib29sIGNsZWFy X2VvbF9wLAorICAgICAgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIGhsKQoreworICBz dHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworICBpbnQgdnBvcyA9 IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAvLyAgVFJBQ0UgKChzdGRlcnIsICJt Y19yZWRyYXdfcm93ICglZCk6ICBzdGFydF94ICglZCkgfCBzdGFydF9ocG9zICglZCkgfCBlbmRf aHBvcyAoJWQpXG4iLAorICAvLyAgICAgICAgICAgICAgICAgIHZwb3MsIHN0YXJ0X3gsIHN0YXJ0 X2hwb3MsIGVuZF9ocG9zKSk7CisgIHN0cnVjdCBnbHlwaF9yb3cgKmJvdHRvbV9yb3cgPSBNQVRS SVhfQk9UVE9NX1RFWFRfUk9XIChtYX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VibGUgdGltZV9jdXJzb3JzID0gKChkb3VibGUpIChjbG9ja19lbmQgLSBjbG9ja19zdGFy dCkpIC8gQ0xPQ0tTX1BFUl9TRUM7CisgIC8vICBmcHJpbnRmIChzdGRlcnIsICJtY19yZWRyYXdf cm93ICglZCk6ICBocG9zICglZC8lZCkgfCBnbHlwaHMgKCVmKSB8IGN1cnNvcnMgKCVmKVxuIiwK KyAgLy8gICAgICAgICAgICAgICAgICAgdnBvcywgc3RhcnRfaHBvcywgZW5kX2hwb3MsIHRpbWVf Z2x5cGhzLCB0aW1lX2N1cnNvcnMpOworfQorCit2b2lkCittY19lcmFzZV9oZWxwZXIgKHN0cnVj dCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3Jv dyAqcm93LAorICAgICAgICAgICAgICAgICBlbnVtIHR5cGVfb2ZfY2FjaGUgY2FjaGVfdHlwZSkK K3sKKyAgaW50IHJvd192cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgIGlm ICh0cmFjZV9yZWRpc3BsYXlfcCkKKyAgICBmcHJpbnRmIChzdGRlcnIsICJtY19lcmFzZV9oZWxw ZXIgKCVzKTogIGNhY2hlICglcykgfCB2cG9zICglZClcbiIsCisgICAgICBtY193aW5kb3cgKHcp LCBtY19jYWNoZV90eXBlX3RvX3N0cmluZyAoY2FjaGVfdHlwZSksIHJvd192cG9zKTsKKyAgc3Ry dWN0IG11bHRpcGxlX2N1cnNvcnNfY2FjaGUgZm9vX2VsdHM7CisgIHN3aXRjaCAoY2FjaGVfdHlw ZSkKKyAgICB7CisgICAgICBjYXNlIE5PX0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAgYnJl YWs7CisgICAgICAgIH0KKyAgICAgIGNhc2UgTUNfQ0FDSEU6CisgICAgICAgIHsKKyAgICAgICAg ICBmb29fZWx0cy5jYWNoZXMgPSB3LT5tY19lbHRzLmNhY2hlczsKKyAgICAgICAgICBmb29fZWx0 cy5hbGxvY2F0ZWQgPSB3LT5tY19lbHRzLmFsbG9jYXRlZDsKKyAgICAgICAgICBmb29fZWx0cy51 c2VkID0gdy0+bWNfZWx0cy51c2VkOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAg ICBjYXNlIENIX0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAgZm9vX2VsdHMuY2FjaGVzID0g dy0+Y2hfZWx0cy5jYWNoZXM7CisgICAgICAgICAgZm9vX2VsdHMuYWxsb2NhdGVkID0gdy0+Y2hf ZWx0cy5hbGxvY2F0ZWQ7CisgICAgICAgICAgZm9vX2VsdHMudXNlZCA9IHctPmNoX2VsdHMudXNl ZDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgY2FzZSBGQ19DQUNIRToKKyAg ICAgICAgeworICAgICAgICAgIGZvb19lbHRzLmNhY2hlcyA9IHctPmZjX2VsdHMuY2FjaGVzOwor ICAgICAgICAgIGZvb19lbHRzLmFsbG9jYXRlZCA9IHctPmZjX2VsdHMuYWxsb2NhdGVkOworICAg ICAgICAgIGZvb19lbHRzLnVzZWQgPSB3LT5mY19lbHRzLnVzZWQ7CisgICAgICAgICAgYnJlYWs7 CisgICAgICAgIH0KKyAgICB9CisgIGZvciAoaW50IGVsdCA9IDA7IGVsdCA8IGZvb19lbHRzLnVz ZWQ7ICsrZWx0KQorICAgIHsKKyAgICAgIGludCB4ID0gZm9vX2VsdHMuY2FjaGVzW2VsdF0ueDsK KyAgICAgIGludCBmeCA9IGZvb19lbHRzLmNhY2hlc1tlbHRdLmZ4OworICAgICAgaW50IHkgPSBm b29fZWx0cy5jYWNoZXNbZWx0XS55OworICAgICAgaW50IGZ5ID0gZm9vX2VsdHMuY2FjaGVzW2Vs dF0uZnk7CisgICAgICBpbnQgaHBvcyA9IGZvb19lbHRzLmNhY2hlc1tlbHRdLmhwb3M7CisgICAg ICBpbnQgdnBvcyA9IGZvb19lbHRzLmNhY2hlc1tlb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AgIGJv b2wgZW5hYmxlZF9wID0gZm9vX2VsdHMuY2FjaGVzW2VsdF0uZW5hYmxlZF9wOworICAgICAgLyog YG1hdHJpeF9yb3cnIGluIGBkaXNwbmV3LmNgIGNvbnRhaW5zIHRoZSBmb2xsb3dpbmcgdGVzdHMs CisgICAgICBlYXNzZXJ0IChtYXRyaXggJiYgbWF0cml4LT5yb3dzKTsKKyAgICAgIGVhc3NlcnQg KHJvdyA+PSAwICYmIHJvdyA8IG1hdHJpeC0+bnJvd3MpOyAqLworICAgICAgYm9vbCBiYXJmX2Ny YXNoX29uZSA9IChtYXRyaXggJiYgbWF0cml4LT5yb3dzKSA/IGZhbHNlIDogdHJ1ZTsKKyAgICAg IGlmIChiYXJmX2NyYXNoX29uZSkKKyAgICAgICAgY29udGludWU7CisgICAgICBib29sIGJhcmZf Y3Jhc2hfdHdvID0gKHZwb3MgPj0gMCAmJiB2cG9zIDwgbWF0cml4LT5ucm93cykgPyBmYWxzZSA6 IHRydWU7CisgICAgICBpZiAoYmFyZl9jcmFzaF90d28pCisgICAgICAgIGNvbnRpbnVlOworICAg ICAgaWYgKHZwb3MgPT0gcm93X3Zwb3MKKyAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgPT0gTUNf R0xZUEgKKyAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgIHsKKyAgICAgICAgICBtY19l cmFzZV9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCB5LCBocG9zLCB2cG9zLCBnbHlwaF9mbGF2 b3IsIGN1cnNvcl90eXBlLCB3ZCk7CisgICAgICAgICAgZm9vX2VsdHMuY2FjaGVzW2VsdF0uZW5h YmxlZF9wID0gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAodnBvcyA9PSByb3df dnBvcworICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgeworICAgICAg ICAgICAgYm9vbCByZW1vdmVfcCA9IHRydWU7CisgICAgICAgICAgIC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WZmZXIpCisg ICAgeworICAgICAgb2xkX2J1ZmZlciA9IGN1cnJlbnRfYnVmZmVyOworICAgICAgc2V0X2J1ZmZl cl9pbnRlcm5hbCAoYik7CisgICAgfQorICAqZmNfeCA9IChmaWxsX2NvbHVtbl9wCisgICAgICAg ICAgICYmICFOSUxQIChWZGlzcGxheV9saW5lX251bWJlcnMpKQorICAgICAgICAgICAgPyAoZmls bF9jb2wgKiBmcmFtZV9jaGFyX3dpZHRoKSArIHctPm1jLmxudW1fcGl4ZWxfd2lkdGggLSBoc2Ns X3gKKyAgICAgICAgICA6IChmaWxsX2NvbHVtbl9wCisgICAgICAgICAgICAgJiYgTklMUCAoVmRp c3BsYXlfbGluZV9udW1iZXJzKSkKKyAgICAgICAgICAgID8gKGZpbGxfY29sICogZnJhbWVfY2hh cl93aWR0aCkgLSBoc2NsX3gKKyAgICAgICAgICA6IDA7CisgIGlmIChvbGRfYnVmZmVyKQorICAg IHNldF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworICBlbnVtIGZhY2VfaWQgZmlsbF9j b2x1bW5fZmFjZV9pZCA9CisgICAgKCFhY3RpdmVfcAorICAgICAmJiAhTklMUCAoQlZBUiAoWEJV RkZFUiAody0+Y29udGVudHMpLCBmY19pbmFjdGl2ZV93aW5kb3dzKSkKKyAgICAgJiYgTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisgICAgICA/IGxvb2t1 cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCJmYy1pbmFjdGl2ZS1mYWNlIiksIHRydWUpCisg ICAgOiAoIWFjdGl2ZV9wCisgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRl bnRzKSwgZmNfaW5hY3RpdmVfd2luZG93cykpCisgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZG RVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIs IGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAmJiB3LT5jdXJzb3IueCA9PSAqZmNfeCkKKyAg ICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoImZjLW9wb2ludC1pbmFjdGl2 ZS1mYWNlIiksIHRydWUpCisgICAgOiAoYWN0aXZlX3AKKyAgICAgICAmJiAhTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAmJiAhTklMUCAoQlZB UiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICYmIHctPmN1cnNvci54ID09ICpmY194 KQorICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiZmMtb3BvaW50LWZh Y2UiKSwgdHJ1ZSkKKyAgICA6ICghYWN0aXZlX3AKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJV RkZFUiAody0+Y29udGVudHMpLCBmY19pbmFjdGl2ZV93aW5kb3dzKSkKKyAgICAgICAmJiAhTklM UCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAmJiAh TklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICYmIHctPmN1cnNvci54 ICE9ICpmY194KQorICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiZmMt aW5hY3RpdmUtZmFjZSIpLCB0cnVlKQorICAgIDogKGFjdGl2ZV9wCisgICAgICAgJiYgIU5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgJiYgIU5J TFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAmJiB3LT5jdXJzb3IueCAh PSAqZmNfeCkKKyAgICAgID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5kb3cgKncpCit7CisgIGJvb2wgZ29f b25lX3AgPSAody0+bWNfZWx0cy51c2VkID4gMCB8fCB3LT5jaF9lbHRzLnVzZWQgPiAwIHx8IHct PmZjX2VsdHMudXNlZCA+IDApOworICBib29sIGdvX3R3b19wID0gKEJVRkZFUlAgKHctPmNvbnRl bnRzKQorICAgICAgICAgICAgICAgICAgICYmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgICAgICAg ICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkp OworICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZXJh c2VfcHJlX3Njcm9sbF9kaXNwbGF5ICglcyk6ICBnb19vbmVfcCAoJXMpIHwgZ29fdHdvX3AgKCVz KVxuIiwKKyAgICAgICAgICAgICAgICAgICAgIG1jX3dpbmRvdyAodyksIGdvX29uZV9wID8gInll cyIgOiAibm8iLCBnb190d29fcCA/ICJ5ZXMiIDogIm5vIik7CisgIGlmICghZ29fb25lX3AgJiYg IWdvX3R3b19wKQorICAgIHJldHVybjsKKyAgYm9vbCB1cGRhdGluZ19mcmFtZV9wID0gZmFsc2U7 CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBpZiAoWEZSQU1FICh3 LT5mcmFtZSkgIT0gZi0+bWNfdXBkYXRpbmdfZnJhbWUKKyAgICAgICYmIChnb19vbmVfcCB8fCBn b190d29fcCkpCisgICAgeworICAgICAgdXBkYXRpbmdfZnJhbWVfcCA9IHRydWU7CisgICAgICB1 cGRhdGVfYmVnaW4gKGYpOworICAgIH0KKyAgaWYgKHctP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or ICAgICAgYXJnID0gRnByZWZpeF9udW1lcmljX3ZhbHVlIChhcmcpOworICAgICAgbWNfc3RkZXJy X3AgPSBYRklYTlVNIChhcmcpID4gMDsKKyAgICB9CisgIHJldHVybiBRbmlsOworfQorCisvKiBl bmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogDAog LyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqCiAJCSAgICAgIFdpbmRvdyBkaXNwbGF5IGRpbWVuc2lvbnMKQEAgLTEz Mzk1LDYgKzE3NTE4LDY5IEBAIGhzY3JvbGxfd2luZG93X3RyZWUgKExpc3BfT2JqZWN0IHdpbmRv dykKIAkgICAgICBlbHNlCiAJCXB0ID0gY2xpcF90b19ib3VuZHMgKEJFR1YsIG1hcmtlcl9wb3Np dGlvbiAody0+cG9pbnRtKSwgWlYpOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyog YmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCisvKiAoZ2RiKSBidAorIzAgIHRlcm1pbmF0ZV9k dWVfdG9fc2lnbmFsIChzaWc9NiwgYmFja3RyYWNlX2xpbWl0PTIxNDc0ODM2NDcpIGF0IGVtYWNz LmM6MzU5CisjMSAgMHgwMDAwMDAwMTAwMWVlOTk2IGluIGRpZSAoCisgICAgbXNnPTB4MTAwMzJm Yzg4ICJjaGFycG9zIDwgMCB8fCAoY2hhcnBvcyA+PSBCVUZfQkVHIChjdXJyZW50X2J1ZmZlcikg JiYgY2hhcnBvcyA8PSBaVikiLCBmaWxlPTB4MTAwMzJlMzJkICJ4ZGlzcC5jIiwgbGluZT03OTUx KSBhdCBhbGxvYy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ICAgICAgICAgICAgICAgICAgICAmJiBjaGFycG9zIDw9IFpWKSk7ICovCisKKyAgc3RydWN0 IGRpc3BsYXlfcG9zICpwb3MgPSAmY3Vyc29yX3Jvdy0+c3RhcnQ7CisgIHB0cmRpZmZfdCBjaGFy cG9zID0gQ0hBUlBPUyAocG9zLT5wb3MpOworCisgIGJvb2wgYmFyZl9jcmFzaF9vbmUgPSAoY2hh cnBvcyA8IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICB8fCAoY2hhcnBvcyA+PSBCVUZfQkVH IChjdXJyZW50X2J1ZmZlcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY2hhcnBv cyA8PSBaVikpCisgICAgICAgICAgICAgICAgICAgICAgICA/IGZhbHNlCisgICAgICAgICAgICAg ICAgICAgICAgICA6IHRydWU7CisgIGlmIChiYXJmX2NyYXNoX29uZSkKKyAgICByZXR1cm4gaHNj cm9sbGVkX3A7CisKKyAgLyogYHJlc2VhdF8xJzogIENIQVJQT1MgKHBvcykgPj0gQkVHViAmJiBD SEFSUE9TIChwb3MpIDw9IFpWICovCisgIGJvb2wgYmFyZl9jcmFzaF90d28gPSAoY2hhcnBvcyA+ PSBCRUdWICYmIGNoYXJwb3MgPD0gWlYpCisgICAgICAgICAgICAgICAgICAgICAgICAgPyBmYWxz ZQorICAgICAgICAgICAgICAgICAgICAgICAgIDogdHJ1ZTsKKyAgaWYgKGJhcmZfY3Jhc2hfdHdv KQorICAgIHJldHVybiBoc2Nyb2xsZWRfcDsKKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8K Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgICAgICAvKiBNb3ZlIGl0ZXJhdG9yIHRv IHB0IHN0YXJ0aW5nIGF0IGN1cnNvcl9yb3ctPnN0YXJ0IGluCiAJCSBhIGxpbmUgd2l0aCBpbmZp bml0ZSB3aWR0aC4gICovCiAJICAgICAgaW5pdF90b19yb3dfc3RhcnQgKCZpdCwgdywgY3Vyc29y X3Jvdyk7CkBAIC0xNDI4Nyw5ICsxODQ3MywyMiBAQCByZWRpc3BsYXlfaW50ZXJuYWwgKHZvaWQp CiAJICAgICAgKnctPmRlc2lyZWRfbWF0cml4LT5tZXRob2QgPSAwOwogCSAgICAgIGRlYnVnX21l dGhvZF9hZGQgKHcsICJvcHRpbWl6YXRpb24gMSIpOwogI2VuZGlmCisKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICNpZmRlZiBIQVZFX1dJTkRP V19TWVNURU0KKyAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgJiYgIU5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgIG1jX3VwZGF0ZV93 aW5kb3dfZnJpbmdlcyAodywgZmFsc2UpOworICAgIGVsc2UKIAkgICAgICB1cGRhdGVfd2luZG93 X2ZyaW5nZXMgKHcsIGZhbHNlKTsKICNlbmRpZgorCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiAJICAgICAgZ290byB1cGRhdGU7CiAJICAgIH0KIAkgIGVsc2UKQEAgLTE3Njg3LDEwICsy MTg4NiwyMiBAQCByZWRpc3BsYXlfd2luZG93IChMaXNwX09iamVjdCB3aW5kb3csIGJvb2wganVz dF90aGlzX29uZV9wKQogICAgIH0KIAogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQorCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGJvb2wg a2VlcF9jdXJyZW50X3AgPSAoanVzdF90aGlzX29uZV9wCisgICAgICAgICAgICAgICAgICAgICAg ICAgfHwgKCF1c2VkX2N1cnJlbnRfbWF0cml4X3AgJiYgIW92ZXJsYXlfYXJyb3dfc2VlbikKKyAg ICAgICAgICAgICAgICAgICAgICAgICB8fCB3LT5wc2V1ZG9fd2luZG93X3ApOworCisgIGJvb2wg ZnJpbmdlc191cGRhdGVkX3AgPSAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jv c3NoYWlycykpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY191cGRhdGVfd2luZG93 X2ZyaW5nZXMgKHcsIGtlZXBfY3VycmVudF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg OiB1cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIGtlZXBfY3VycmVudF9wKTsKKwogICBpZiAoRlJB TUVfV0lORE9XX1AgKGYpCi0gICAgICAmJiB1cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIChqdXN0 X3RoaXNfb25lX3AKLQkJCQkgICAgfHwgKCF1c2VkX2N1cnJlbnRfbWF0cml4X3AgJiYgIW92ZXJs YXlfYXJyb3dfc2VlbikKLQkJCQkgICAgfHwgdy0+cHNldWRvX3dpbmRvd19wKSkpCisgICAgICAm JiBmcmluZ2VzX3VwZGF0ZWRfcCkKICAgICB7CiAgICAgICB1cGRhdGVfYmVnaW4gKGYpOwogICAg ICAgYmxvY2tfaW5wdXQgKCk7CkBAIC0xNzcwNSw2ICsyMTkxNiw5IEBAIHJlZGlzcGxheV93aW5k b3cgKExpc3BfT2JqZWN0IHdpbmRvdywgYm9vbCBqdXN0X3RoaXNfb25lX3ApCiAgICAgICB1cGRh dGVfZW5kIChmKTsKICAgICB9CiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgaWYg KFdJTkRPV19CT1RUT01fRElWSURFUl9XSURUSCAodykpCiAgICAgeF9kcmF3X2JvdHRvbV9kaXZp ZGVyICh3KTsKICNlbmRpZiAvKiBIQVZFX1dJTkRPV19TWVNURU0gKi8KQEAgLTE4MDEwLDYgKzIy MjI0LDE5IEBAIHRyeV93aW5kb3dfcmV1c2luZ19jdXJyZW50X21hdHJpeCAoc3RydWN0IHdpbmRv dyAqdykKIAkgICAgIHNjcm9sbF9ydW5faG9vayB3aWxsIGNsZWFyIHRoZSBjdXJzb3IsIGFuZCB1 c2UgdGhlCiAJICAgICBjdXJyZW50IG1hdHJpeCB0byBnZXQgdGhlIGhlaWdodCBvZiB0aGUgcm93 IHRoZSBjdXJzb3IgaXMKIAkgICAgIGluLiAgKi8KKworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisg ICAgZnByaW50ZiAoc3RkZXJyLCAidHJ5X3dpbmRvd19yZXVzaW5nX2N1cnJlbnRfbWF0cml4IFsx IG9mIDJdICglcylcbiIsIG1jX3dpbmRvdyAodykpOworCisgIG1jX2VyYXNlX3ByZV9zY3JvbGxf ZGlzcGxheSAodyk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgIHJ1bi5jdXJy ZW50X3kgPSBzdGFydF9yb3ctPnk7CiAJICBydW4uZGVzaXJlZF95ID0gaXQuY3VycmVudF95Owog CSAgcnVuLmhlaWdodCA9IGl0Lmxhc3RfdmlzaWJsZV95IC0gaXQuY3VycmVudF95OwpAQCAtMTgx NzMsNiArMjI0MDAsMTkgQEAgdHJ5X3dpbmRvd19yZXVzaW5nX2N1cnJlbnRfbWF0cml4IChzdHJ1 Y3Qgd2luZG93ICp3KQogCX0KIAogICAgICAgLyogU2Nyb2xsIHRoZSBkaXNwbGF5LiAgKi8KKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBp ZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAgZnByaW50ZiAoc3RkZXJyLCAidHJ5X3dpbmRvd19y ZXVzaW5nX2N1cnJlbnRfbWF0cml4IFsyIG9mIDJdICglcylcbiIsIG1jX3dpbmRvdyAodykpOwor CisgIG1jX2VyYXNlX3ByZV9zY3JvbGxfZGlzcGxheSAodyk7CisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworCisKICAgICAgIHJ1bi5jdXJyZW50X3kgPSBmaXJzdF9yZXVzYWJsZV9yb3ctPnk7 CiAgICAgICBydW4uZGVzaXJlZF95ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CiAg ICAgICBydW4uaGVpZ2h0ID0gaXQubGFzdF92aXNpYmxlX3kgLSBydW4uY3VycmVudF95OwpAQCAt MTkxMjcsNiArMjMzNjcsMTkgQEAgdHJ5X3dpbmRvd19pZCAoc3RydWN0IHdpbmRvdyAqdykKICAg LyogU2Nyb2xsIHRoZSBkaXNwbGF5LiAgRG8gaXQgYmVmb3JlIGNoYW5naW5nIHRoZSBjdXJyZW50 IG1hdHJpeCBzbwogICAgICB0aGF0IHh0ZXJtLmMgZG9lc24ndCBnZXQgY29uZnVzZWQgYWJvdXQg d2hlcmUgdGhlIGN1cnNvciBnbHlwaCBpcwogICAgICBmb3VuZC4gICovCisKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgaWYgKHRyYWNlX3Jl ZGlzcGxheV9wKQorICAgIGZwcmludGYgKHN0ZGVyciwgInRyeV93aW5kb3dfaWQgKCVzKVxuIiwg bWNfd2luZG93ICh3KSk7CisKKyAgbWNfZXJhc2VfcHJlX3Njcm9sbF9kaXNwbGF5ICh3KTsKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBpZiAoZHkgJiYgcnVuLmhlaWdodCkKICAg ICB7CiAgICAgICB1cGRhdGVfYmVnaW4gKGYpOwpAQCAtMjAxMzMsNiArMjQzODYsMTcgQEAgYXBw ZW5kX3NwYWNlX2Zvcl9uZXdsaW5lIChzdHJ1Y3QgaXQgKml0LCBib29sIGRlZmF1bHRfZmFjZV9w KQogCSAgbWVtc2V0ICgmaXQtPnBvc2l0aW9uLCAwLCBzaXplb2YgaXQtPnBvc2l0aW9uKTsKIAkg IGl0LT5vYmplY3QgPSBRbmlsOwogCSAgaXQtPmMgPSBpdC0+Y2hhcl90b19kaXNwbGF5ID0gJyAn OworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLwor CisgICAgICBpZiAoSVRfQllURVBPUyAoKml0KSA+PSBaVl9CWVRFKQorICAgICAgICBpdC0+enZf cCA9IHRydWU7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgIGl0LT5sZW4gPSAx OwogCiAJICAvKiBJZiB0aGUgZGVmYXVsdCBmYWNlIHdhcyByZW1hcHBlZCwgYmUgc3VyZSB0byB1 c2UgdGhlCkBAIC0yMTI2OSw5ICsyNTUzMywyMiBAQCBtYXliZV9wcm9kdWNlX2xpbmVfbnVtYmVy IChzdHJ1Y3QgaXQgKml0KQogICAgICAgZWxzZQogCXRlbV9pdC5jID0gdGVtX2l0LmNoYXJfdG9f ZGlzcGxheSA9ICpwOwogICAgICAgdGVtX2l0LmxlbiA9IDE7CisKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGlmIChiZXlvbmRfenYp CisgICAgICAgIHRlbV9pdC56dl9wID0gdHJ1ZTsKKyAgICAgIHRlbV9pdC5jdXJyZW50X3kgPSBp dC0+Y3VycmVudF95OworICAgICAgdGVtX2l0LnZwb3MgPSBpdC0+dnBvczsKICAgICAgIC8qIE1h a2Ugc3VyZSB0aGVzZSBnbHlwaHMgd2lsbCBoYXZlIGEgInBvc2l0aW9uIiBvZiAtMS4gICovCiAg ICAgICBTRVRfVEVYVF9QT1MgKHRlbV9pdC5wb3NpdGlvbiwgLTEsIC0xKTsKICAgICAgIFBST0RV Q0VfR0xZUEhTICgmdGVtX2l0KTsKKyAgICAgIHRlbV9pdC5ocG9zICs9IDE7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCiAKICAgICAgIC8qIFN0b3AgcHJvZHVjaW5nIGdseXBocywgYW5k IHJlZnJhaW4gZnJvbSBwcm9kdWNpbmcgdGhlIGxpbmUKIAkgbnVtYmVyLCBpZiB3ZSBkb24ndCBo YXZlIGVub3VnaCBzcGFjZSBvbiB0aGlzIGxpbmUuICAqLwpAQCAtMjEyODQsNiArMjU1NjEsMzAg QEAgbWF5YmVfcHJvZHVjZV9saW5lX251bWJlciAoc3RydWN0IGl0ICppdCkKIAl9CiAgICAgfQog CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisg IExpc3BfT2JqZWN0IGJ1ZiA9IGl0LT53LT5jb250ZW50czsKKyAgQ0hFQ0tfQlVGRkVSIChidWYp OworICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAoYnVmKTsKKyAgc3RydWN0IGJ1ZmZlciAq b2xkX2J1ZmZlciA9IE5VTEw7CisgIC8qIE5lZWRlZCBzbyB0aGF0IGJ1ZmZlci1sb2NhbCB2YWx1 ZXMgY2FuIGJlIGRldGVybWluZWQ7IGUuZy4sIHdoZW4gc3dpdGNoaW5nCisgIHRvIHRoZSBtaW5p YnVmZmVyLiAqLworICBpZiAoYiAhPSBjdXJyZW50X2J1ZmZlcikKKyAgICB7CisgICAgICBvbGRf YnVmZmVyID0gY3VycmVudF9idWZmZXI7CisgICAgICBzZXRfYnVmZmVyX2ludGVybmFsIChiKTsK KyAgICB9CisgIGl0LT53LT5tYy5sbnVtX3BpeGVsX3dpZHRoID0gKCFOSUxQIChWZGlzcGxheV9s aW5lX251bWJlcnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gdGVtX2l0LmN1 cnJlbnRfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogMDsKKyAgaWYgKG9sZF9i dWZmZXIpCisgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgLyogUmVjb3JkIHRoZSB3aWR0aCBpbiBwaXhlbHMgd2Ug bmVlZCBmb3IgdGhlIGxpbmUgbnVtYmVyIGRpc3BsYXkuICAqLwogICBpdC0+bG51bV9waXhlbF93 aWR0aCA9IHRlbV9pdC5jdXJyZW50X3g7CiAgIC8qIENvcHkgdGhlIHByb2R1Y2VkIGdseXBocyBp bnRvIElUJ3MgZ2x5cGhfcm93LiAgKi8KQEAgLTI3MDkyLDYgKzMxMzkzLDIwIEBAIGFwcGVuZF9n bHlwaCAoc3RydWN0IGl0ICppdCkKIAkgICAgZ1sxXSA9ICpnOwogCSAgZ2x5cGggPSBpdC0+Z2x5 cGhfcm93LT5nbHlwaHNbYXJlYV07CiAJfQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+eCA9IGl0LT5jdXJyZW50X3g7 CisgICAgICBnbHlwaC0+eSA9IGl0LT5jdXJyZW50X3k7CisgICAgICBnbHlwaC0+aHBvcyA9IGl0 LT5ocG9zOworICAgICAgZ2x5cGgtPnZwb3MgPSBpdC0+dnBvczsKKyAgICAgIGdseXBoLT56dl9w ID0gaXQtPnp2X3A7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIGdseXBo LT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5vYmplY3Qg PSBpdC0+b2JqZWN0OwogICAgICAgaWYgKGl0LT5waXhlbF93aWR0aCA+IDApCkBAIC0yNzE3NSw2 ICszMTQ5MCwyMCBAQCBhcHBlbmRfY29tcG9zaXRlX2dseXBoIChzdHJ1Y3QgaXQgKml0KQogCSAg ICBnWzFdID0gKmc7CiAJICBnbHlwaCA9IGl0LT5nbHlwaF9yb3ctPmdseXBoc1tpdC0+YXJlYV07 CiAJfQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAq LworCisgICAgICBnbHlwaC0+eCA9IGl0LT5jdXJyZW50X3g7CisgICAgICBnbHlwaC0+eSA9IGl0 LT5jdXJyZW50X3k7CisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5cGgt PnZwb3MgPSBpdC0+dnBvczsKKyAgICAgIGdseXBoLT56dl9wID0gaXQtPnp2X3A7CisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIGdseXBoLT5jaGFycG9zID0gaXQtPmNtcF9p dC5jaGFycG9zOwogICAgICAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAgICAgICBlYXNz ZXJ0IChpdC0+cGl4ZWxfd2lkdGggPD0gU0hSVF9NQVgpOwpAQCAtMjczODMsNiArMzE3MTIsMjAg QEAgcHJvZHVjZV9pbWFnZV9nbHlwaCAoc3RydWN0IGl0ICppdCkKIAl9CiAgICAgICBpZiAoZ2x5 cGggPCBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJlYSArIDFdKQogCXsKKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPngg PSBpdC0+Y3VycmVudF94OworICAgICAgZ2x5cGgtPnkgPSBpdC0+Y3VycmVudF95OworICAgICAg Z2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBoLT52cG9zID0gaXQtPnZwb3M7Cisg ICAgICBnbHlwaC0+enZfcCA9IGl0LT56dl9wOworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiAJICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAJICBnbHlw aC0+b2JqZWN0ID0gaXQtPm9iamVjdDsKIAkgIGdseXBoLT5waXhlbF93aWR0aCA9IGNsaXBfdG9f Ym91bmRzICgtMSwgaXQtPnBpeGVsX3dpZHRoLCBTSFJUX01BWCk7CkBAIC0yNzQ4Niw2ICszMTgy OSwyMCBAQCBwcm9kdWNlX3h3aWRnZXRfZ2x5cGggKHN0cnVjdCBpdCAqaXQpCiAJfQogICAgICAg aWYgKGdseXBoIDwgaXQtPmdseXBoX3Jvdy0+Z2x5cGhzW2FyZWEgKyAxXSkKIAl7CisKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGds eXBoLT54ID0gaXQtPmN1cnJlbnRfeDsKKyAgICAgIGdseXBoLT55ID0gaXQtPmN1cnJlbnRfeTsK KyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBnbHlwaC0+dnBvcyA9IGl0LT52 cG9zOworICAgICAgZ2x5cGgtPnp2X3AgPSBpdC0+enZfcDsKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogCSAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9zaXRpb24pOwog CSAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAJICBnbHlwaC0+cGl4ZWxfd2lkdGggPSBj bGlwX3RvX2JvdW5kcyAoLTEsIGl0LT5waXhlbF93aWR0aCwgU0hSVF9NQVgpOwpAQCAtMjc1NzIs NiArMzE5MjksMjAgQEAgYXBwZW5kX3N0cmV0Y2hfZ2x5cGggKHN0cnVjdCBpdCAqaXQsIExpc3Bf T2JqZWN0IG9iamVjdCwKIAkgICAgd2lkdGggLT0gaXQtPmZpcnN0X3Zpc2libGVfeCAtIGl0LT5j dXJyZW50X3g7CiAJICBlYXNzZXJ0ICh3aWR0aCA+IDApOwogCX0KKworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPnggPSBp dC0+Y3VycmVudF94OworICAgICAgZ2x5cGgtPnkgPSBpdC0+Y3VycmVudF95OworICAgICAgZ2x5 cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBoLT52cG9zID0gaXQtPnZwb3M7CisgICAg ICBnbHlwaC0+enZfcCA9IGl0LT56dl9wOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAgICAgICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAgICAgICBn bHlwaC0+b2JqZWN0ID0gb2JqZWN0OwogICAgICAgLyogRklYTUU6IEl0IHdvdWxkIGJlIGJldHRl ciB0byB1c2UgVFlQRV9NQVggaGVyZSwgYnV0CkBAIC0yODAyNiw2ICszMjM5NywyMCBAQCBhcHBl bmRfZ2x5cGhsZXNzX2dseXBoIChzdHJ1Y3QgaXQgKml0LCBpbnQgZmFjZV9pZCwgYm9vbCBmb3Jf bm9fZm9udCwgaW50IGxlbiwKIAkgICAgZ1sxXSA9ICpnOwogCSAgZ2x5cGggPSBpdC0+Z2x5cGhf cm93LT5nbHlwaHNbYXJlYV07CiAJfQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyog TVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+eCA9IGl0LT5jdXJyZW50X3g7Cisg ICAgICBnbHlwaC0+eSA9IGl0LT5jdXJyZW50X3k7CisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5o cG9zOworICAgICAgZ2x5cGgtPnZwb3MgPSBpdC0+dnBvczsKKyAgICAgIGdseXBoLT56dl9wID0g aXQtPnp2X3A7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIGdseXBoLT5j aGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5vYmplY3QgPSBp dC0+b2JqZWN0OwogICAgICAgZWFzc2VydCAoaXQtPnBpeGVsX3dpZHRoIDw9IFNIUlRfTUFYKTsK QEAgLTI5MDc2LDEwICszMzQ2MSwzMyBAQCB4X2luc2VydF9nbHlwaHMgKHN0cnVjdCB3aW5kb3cg KncsIHN0cnVjdCBnbHlwaF9yb3cgKnVwZGF0ZWRfcm93LAogCiAgIC8qIFdyaXRlIHRoZSBnbHlw aHMuICAqLwogICBocG9zID0gc3RhcnQgLSByb3ctPmdseXBoc1t1cGRhdGVkX2FyZWFdOworCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlm ICgody0+bWNfZWx0cy51c2VkID4gMCB8fCB3LT5jaF9lbHRzLnVzZWQgPiAwIHx8IHctPmZjX2Vs dHMudXNlZCA+IDApCisgICAgICAmJiB1cGRhdGVkX2FyZWEgPT0gVEVYVF9BUkVBKQorICAgIHsK KyAgICAgIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4Owor ICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgICAgIGlu dCBzdGFydF94ID0gdy0+b3V0cHV0X2N1cnNvci54OworICAgICAgaW50IHN0YXJ0X2hwb3MgPSBo cG9zOworICAgICAgaW50IGVuZF9ocG9zID0gaHBvcyArIGxlbjsKKyAgICAgIGJvb2wgY2xlYXJf ZW9sX3AgPSBmYWxzZTsKKyAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBobCA9IERSQVdfTk9S TUFMX1RFWFQ7CisgICAgICBUUkFDRSAoKHN0ZGVyciwgInhfaW5zZXJ0X2dseXBocyAoJWQpOiAg c3RhcnRfeCAoJWQpIHwgc3RhcnRfaHBvcyAoJWQpIHwgZW5kX2hwb3MgKCVkKVxuIiwKKyAgICAg ICAgICAgICAgICAgICAgICB2cG9zLCBzdGFydF94LCBzdGFydF9ocG9zLCBlbmRfaHBvcykpOwor ICAgICAgbWNfcmVkcmF3X3JvdyAodywgbWF0cml4LCByb3csIHN0YXJ0X3gsIHN0YXJ0X2hwb3Ms IGVuZF9ocG9zLCBjbGVhcl9lb2xfcCwgaGwpOworICAgIH0KKyAgICBlbHNlCiAgIGRyYXdfZ2x5 cGhzICh3LCB3LT5vdXRwdXRfY3Vyc29yLngsIHJvdywgdXBkYXRlZF9hcmVhLAogCSAgICAgICBo cG9zLCBocG9zICsgbGVuLAogCSAgICAgICBEUkFXX05PUk1BTF9URVhULCAwKTsKIAorLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogICAvKiBBZHZhbmNlIHRoZSBvdXRwdXQgY3Vyc29yLiAg Ki8KICAgdy0+b3V0cHV0X2N1cnNvci5ocG9zICs9IGxlbjsKICAgdy0+b3V0cHV0X2N1cnNvci54 ICs9IHNoaWZ0X2J5X3dpZHRoOwpAQCAtMjk1MDUsOSArMzM5MTMsMzEgQEAgeF9maXhfb3Zlcmxh cHBpbmdfYXJlYSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqcm93LAogCSAg d2hpbGUgKGkgPCByb3ctPnVzZWRbYXJlYV0KIAkJICYmIHJvdy0+Z2x5cGhzW2FyZWFdW2ldLm92 ZXJsYXBzX3ZlcnRpY2FsbHlfcCk7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBN VUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgICAgaWYgKCh3LT5tY19lbHRzLnVzZWQgPiAwIHx8 IHctPmNoX2VsdHMudXNlZCA+IDAgfHwgdy0+ZmNfZWx0cy51c2VkID4gMCkKKyAgICAgICAgICAg ICYmIGFyZWEgPT0gVEVYVF9BUkVBKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIHN0cnVjdCBn bHlwaF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworICAgICAgICAgICAgaW50 IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgICAgICAgICAgIGludCBz dGFydF9ocG9zID0gc3RhcnQ7CisgICAgICAgICAgICBpbnQgZW5kX2hwb3MgPSBpOworICAgICAg ICAgICAgYm9vbCBjbGVhcl9lb2xfcCA9IGZhbHNlOworICAgICAgICAgICAgZW51bSBkcmF3X2ds eXBoc19mYWNlIGhsID0gRFJBV19OT1JNQUxfVEVYVDsKKyAgICAgICAgICAgIFRSQUNFICgoc3Rk ZXJyLCAieF9maXhfb3ZlcmxhcHBpbmdfYXJlYSAoJWQpOiAgc3RhcnRfeCAoJWQpIHwgc3RhcnRf aHBvcyAoJWQpIHwgZW5kX2hwb3MgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICB2cG9zLCBzdGFydF94LCBzdGFydF9ocG9zLCBlbmRfaHBvcykpOworICAgICAgICAgICAgbWNf cmVkcmF3X3JvdyAodywgbWF0cml4LCByb3csIHN0YXJ0X3gsIHN0YXJ0X2hwb3MsIGVuZF9ocG9z LCBjbGVhcl9lb2xfcCwgaGwpOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCiAJICBkcmF3 X2dseXBocyAodywgc3RhcnRfeCwgcm93LCBhcmVhLAogCQkgICAgICAgc3RhcnQsIGksCiAJCSAg ICAgICBEUkFXX05PUk1BTF9URVhULCBvdmVybGFwcyk7CisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKIAl9CiAgICAgICBlbHNlCiAJewpAQCAtMjk3NTgsMTAgKzM0MTg4LDE3IEBAIGRp c3BsYXlfYW5kX3NldF9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgb24sCiAgIG5ld19j dXJzb3JfdHlwZSA9IGdldF93aW5kb3dfY3Vyc29yX3R5cGUgKHcsIGdseXBoLAogCQkJCQkgICAg Jm5ld19jdXJzb3Jfd2lkdGgsICZhY3RpdmVfY3Vyc29yKTsKIAorCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogICAvKiBJZiBjdXJzb3IgaXMgY3Vy cmVudGx5IGJlaW5nIHNob3duIGFuZCB3ZSBkb24ndCB3YW50IGl0IHRvIGJlIG9yCiAgICAgIGl0 IGlzIGluIHRoZSB3cm9uZyBwbGFjZSwgb3IgdGhlIGN1cnNvciB0eXBlIGlzIG5vdCB3aGF0IHdl IHdhbnQsCiAgICAgIGVyYXNlIGl0LiAgKi8KICAgaWYgKHctPnBoeXNfY3Vyc29yX29uX3AKKyAg ICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisg ICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQor ICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkKICAg ICAgICYmICghb24KIAkgIHx8IHctPnBoeXNfY3Vyc29yLnggIT0geAogCSAgfHwgdy0+cGh5c19j dXJzb3IueSAhPSB5CkBAIC0yOTc3NCw2ICszNDIxMSw5IEBAIGRpc3BsYXlfYW5kX3NldF9jdXJz b3IgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgb24sCiAJICAgICAgJiYgbmV3X2N1cnNvcl93aWR0 aCAhPSB3LT5waHlzX2N1cnNvcl93aWR0aCkpKQogICAgIGVyYXNlX3BoeXNfY3Vyc29yICh3KTsK IAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBEb24ndCBjaGVjayBwaHlzX2N1 cnNvcl9vbl9wIGhlcmUgYmVjYXVzZSB0aGF0IGZsYWcgaXMgb25seSBzZXQKICAgICAgdG8gZmFs c2UgaW4gc29tZSBjYXNlcyB3aGVyZSB3ZSBrbm93IHRoYXQgdGhlIGN1cnNvciBoYXMgYmVlbgog ICAgICBjb21wbGV0ZWx5IGVyYXNlZCwgdG8gYXZvaWQgdGhlIGV4dHJhIHdvcmsgb2YgZXJhc2lu ZyB0aGUgY3Vyc29yCkBAIC0yOTc5Miw5ICszNDIzMiwxOSBAQCBkaXNwbGF5X2FuZF9zZXRfY3Vy c29yIChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIG9uLAogICAgICAgdy0+cGh5c19jdXJzb3IudnBv cyA9IHZwb3M7CiAgICAgfQogCi0gIEZSQU1FX1JJRiAoZiktPmRyYXdfd2luZG93X2N1cnNvciAo dywgZ2x5cGhfcm93LCB4LCB5LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IG5ld19jdXJzb3JfdHlwZSwgbmV3X2N1cnNvcl93aWR0aCwKLSAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBvbiwgYWN0aXZlX2N1cnNvcik7CisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlmIChOSUxQIChCVkFSIChYQlVG RkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJV RkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhC VUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQorICAgIEZSQU1FX1JJRiAoZiktPmRyYXdf d2luZG93X2N1cnNvciAodywgZ2x5cGhfcm93LCB4LCB5LCBuZXdfY3Vyc29yX3R5cGUsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfY3Vyc29yX3dpZHRoLCBvbiwg YWN0aXZlX2N1cnNvcik7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIH0KIAogCkBA IC0yOTg4Nyw3ICszNDMzNywyNyBAQCBkcmF3X3Jvd193aXRoX21vdXNlX2ZhY2UgKHN0cnVjdCB3 aW5kb3cgKncsIGludCBzdGFydF94LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCiAjaWZkZWYgSEFW RV9XSU5ET1dfU1lTVEVNCiAgIGlmIChGUkFNRV9XSU5ET1dfUCAoWEZSQU1FICh3LT5mcmFtZSkp KQogICAgIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNP UlMgKi8KKworICAgICAgaWYgKHctPm1jX2VsdHMudXNlZCA+IDAgfHwgdy0+Y2hfZWx0cy51c2Vk ID4gMCB8fCB3LT5mY19lbHRzLnVzZWQgPiAwKQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0 IGdseXBoX21hdHJpeCAqbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgICAgICAgICAgaW50 IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgICAgICAgICBib29sIGNs ZWFyX2VvbF9wID0gZmFsc2U7CisgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIGhsID0g ZHJhdzsKKyAgICAgICAgICBUUkFDRSAoKHN0ZGVyciwgImRyYXdfcm93X3dpdGhfbW91c2VfZmFj ZSAoJWQpOiAgc3RhcnRfeCAoJWQpIHwgc3RhcnRfaHBvcyAoJWQpIHwgZW5kX2hwb3MgKCVkKVxu IiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdnBvcywgc3RhcnRfeCwgc3RhcnRfaHBvcywg ZW5kX2hwb3MpKTsKKyAgICAgICAgICBtY19yZWRyYXdfcm93ICh3LCBtYXRyaXgsIHJvdywgc3Rh cnRfeCwgc3RhcnRfaHBvcywgZW5kX2hwb3MsIGNsZWFyX2VvbF9wLCBobCk7CisgICAgICAgIH0K KyAgICAgICAgZWxzZQogICAgICAgZHJhd19nbHlwaHMgKHcsIHN0YXJ0X3gsIHJvdywgVEVYVF9B UkVBLCBzdGFydF9ocG9zLCBlbmRfaHBvcywgZHJhdywgMCk7CisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworCisKICAgICAgIHJldHVybjsKICAgICB9CiAjZW5kaWYKQEAgLTMxOTQ1LDExICsz NjQxNSwzNCBAQCBleHBvc2VfYXJlYSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3Jv dyAqcm93LCBYUmVjdGFuZ2xlICpyLAogICBzdHJ1Y3QgZ2x5cGggKmxhc3Q7CiAgIGludCBmaXJz dF94LCBzdGFydF94LCB4OwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQ TEUtQ1VSU09SUyAqLworCiAgIGlmIChhcmVhID09IFRFWFRfQVJFQSAmJiByb3ctPmZpbGxfbGlu ZV9wKQorICAgIHsKKyAgICAgIGlmICh3LT5tY19lbHRzLnVzZWQgPiAwIHx8IHctPmNoX2VsdHMu dXNlZCA+IDAgfHwgdy0+ZmNfZWx0cy51c2VkID4gMCkKKyAgICAgICAgeworICAgICAgICAgIHN0 cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworICAgICAgICAg IGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgICAgICAgICAgaW50 IHN0YXJ0X3ggPSAwOworICAgICAgICAgIGludCBzdGFydF9ocG9zID0gMDsKKyAgICAgICAgICBp bnQgZW5kX2hwb3MgPSByb3ctPnVzZWRbVEVYVF9BUkVBXTsKKyAgICAgICAgICBib29sIGNsZWFy X2VvbF9wID0gZmFsc2U7CisgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIGhsID0gRFJB V19OT1JNQUxfVEVYVDsKKyAgICAgICAgICBUUkFDRSAoKHN0ZGVyciwgImV4cG9zZV9hcmVhICgl ZCk6ICBXcml0ZSB0aGUgd2hvbGUgbGluZS5cbiIsIHZwb3MpKTsKKyAgICAgICAgICBtY19yZWRy YXdfcm93ICh3LCBtYXRyaXgsIHJvdywgc3RhcnRfeCwgc3RhcnRfaHBvcywgZW5kX2hwb3MsIGNs ZWFyX2VvbF9wLCBobCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQogICAgIC8qIElmIHJvdyBl eHRlbmRzIGZhY2UgdG8gZW5kIG9mIGxpbmUgd3JpdGUgdGhlIHdob2xlIGxpbmUuICAqLwogICAg IGRyYXdfZ2x5cGhzICh3LCAwLCByb3csIGFyZWEsCiAJCSAwLCByb3ctPnVzZWRbYXJlYV0sCiAJ CSBEUkFXX05PUk1BTF9URVhULCAwKTsKKyAgICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKICAgZWxzZQogICAgIHsKICAgICAgIC8qIFNldCBTVEFSVF9YIHRvIHRoZSB3aW5kb3ct cmVsYXRpdmUgc3RhcnQgcG9zaXRpb24gZm9yIGRyYXdpbmcgZ2x5cGhzIG9mCkBAIC0zMTk4MSwx MSArMzY0NzQsMzQgQEAgZXhwb3NlX2FyZWEgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlw aF9yb3cgKnJvdywgWFJlY3RhbmdsZSAqciwKIAkgICsrbGFzdDsKIAl9CiAKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgICAgIC8qIFJlcGFp bnQuICAqLwotICAgICAgaWYgKGxhc3QgPiBmaXJzdCkKKyAgICAgIC8qIEZsb2F0aW5nIGZha2Ug Y3Vyc29ycyB3aWxsIGV4aXN0IHdoZW4gKGxhc3QgPT0gZmlyc3QpLiAqLworICAgICAgaWYgKCh3 LT5tY19lbHRzLnVzZWQgPiAwIHx8IHctPmNoX2VsdHMudXNlZCA+IDAgfHwgdy0+ZmNfZWx0cy51 c2VkID4gMCkKKyAgICAgICAgICAmJiBhcmVhID09IFRFWFRfQVJFQSkKKyAgICAgICAgeworICAg ICAgICAgIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4Owor ICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgICAg ICAgICAgc3RhcnRfeCA9IGZpcnN0X3ggLSBzdGFydF94OworICAgICAgICAgIGludCBzdGFydF9o cG9zID0gZmlyc3QgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgIGludCBlbmRf aHBvcyA9IGxhc3QgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgIGJvb2wgY2xl YXJfZW9sX3AgPSBmYWxzZTsKKyAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UgaGwgPSBE UkFXX05PUk1BTF9URVhUOworICAgICAgICAgIFRSQUNFICgoc3RkZXJyLCAiZXhwb3NlX2FyZWEg KCVkKTogIHN0YXJ0X3ggKCVkKSB8IHN0YXJ0X2hwb3MgKCVkKSB8IGVuZF9ocG9zICglZClcbiIs CisgICAgICAgICAgICAgICAgICAgICAgICAgIHZwb3MsIHN0YXJ0X3gsIHN0YXJ0X2hwb3MsIGVu ZF9ocG9zKSk7CisgICAgICAgICAgbWNfcmVkcmF3X3JvdyAodywgbWF0cml4LCByb3csIHN0YXJ0 X3gsIHN0YXJ0X2hwb3MsIGVuZF9ocG9zLCBjbGVhcl9lb2xfcCwgaGwpOworICAgICAgICB9Cisg ICAgICAgIGVsc2UgaWYgKGxhc3QgPiBmaXJzdCkKIAlkcmF3X2dseXBocyAodywgZmlyc3RfeCAt IHN0YXJ0X3gsIHJvdywgYXJlYSwKIAkJICAgICBmaXJzdCAtIHJvdy0+Z2x5cGhzW2FyZWFdLCBs YXN0IC0gcm93LT5nbHlwaHNbYXJlYV0sCiAJCSAgICAgRFJBV19OT1JNQUxfVEVYVCwgMCk7CisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICB9CiB9CiAKQEAgLTMxOTk5LDEwICsz NjUxNSwzMyBAQCBleHBvc2VfbGluZSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3Jv dyAqcm93LCBYUmVjdGFuZ2xlICpyKQogewogICBlYXNzZXJ0IChyb3ctPmVuYWJsZWRfcCk7CiAK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAg aWYgKHJvdy0+bW9kZV9saW5lX3AgfHwgdy0+cHNldWRvX3dpbmRvd19wKQorICAgIHsKKyAgICAg IGlmICh3LT5tY19lbHRzLnVzZWQgPiAwIHx8IHctPmNoX2VsdHMudXNlZCA+IDAgfHwgdy0+ZmNf ZWx0cy51c2VkID4gMCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBnbHlwaF9tYXRyaXgg Km1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworICAgICAgICAgIGludCB2cG9zID0gTUFUUklY X1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgICAgICAgICAgaW50IHN0YXJ0X3ggPSAwOworICAg ICAgICAgIGludCBzdGFydF9ocG9zID0gMDsKKyAgICAgICAgICBpbnQgZW5kX2hwb3MgPSByb3ct PnVzZWRbVEVYVF9BUkVBXTsKKyAgICAgICAgICBib29sIGNsZWFyX2VvbF9wID0gZmFsc2U7Cisg ICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIGhsID0gRFJBV19OT1JNQUxfVEVYVDsKKyAg ICAgICAgICBUUkFDRSAoKHN0ZGVyciwgImV4cG9zZV9saW5lICglZCk6ICBXcml0ZSB0aGUgd2hv bGUgbGluZS5cbiIsIHZwb3MpKTsKKyAgICAgICAgICBtY19yZWRyYXdfcm93ICh3LCBtYXRyaXgs IHJvdywgc3RhcnRfeCwgc3RhcnRfaHBvcywgZW5kX2hwb3MsIGNsZWFyX2VvbF9wLCBobCk7Cisg ICAgICAgIH0KKyAgICAgICAgZWxzZQogICAgIGRyYXdfZ2x5cGhzICh3LCAwLCByb3csIFRFWFRf QVJFQSwKIAkJIDAsIHJvdy0+dXNlZFtURVhUX0FSRUFdLAogCQkgRFJBV19OT1JNQUxfVEVYVCwg MCk7CisgICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIGVsc2UKICAgICB7 CiAgICAgICBpZiAocm93LT51c2VkW0xFRlRfTUFSR0lOX0FSRUFdKQpAQCAtMzI1NTAsNiArMzcw ODksMjIgQEAgeF9pbnRlcnNlY3RfcmVjdGFuZ2xlcyAoWFJlY3RhbmdsZSAqcjEsIFhSZWN0YW5n bGUgKnIyLCBYUmVjdGFuZ2xlICpyZXN1bHQpCiB2b2lkCiBzeW1zX29mX3hkaXNwICh2b2lkKQog eworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLwor CisgIGRlZnN1YnIgKCZTbWNfZHVtcF9nbHlwaF9yb3cpOworCisgIGRlZnN1YnIgKCZTbWNfZHVt cF9nbHlwaF9tYXRyaXgpOworCisgIGRlZnN1YnIgKCZTbWNfY3VycmVudF9jb2x1bW4pOworCisg IGRlZnN1YnIgKCZTbWNfc3RkZXJyKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog ICBWd2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GZ4OworICBpbnQg cnkgPSBmeTsKKyAgaW50IHJ3ID0gd2QgLSAxOworICBpbnQgcmggPSBoIC0gMTsKKyAgeF9kcmF3 X3JlY3RhbmdsZSAoZiwgZ2MsIHJ4LCByeSwgcncsIHJoKTsKKy8qCisgIGZwcmludGYgKHN0ZGVy ciwgIm1jX3hfZHJhd19ob2xsb3dfY3Vyc29yOiAgcnggKCVkKSB8IHJ5ICglZCkgfCBydyAoJWQp IHwgcmggKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgcngsIHJ5LCBydywgcmgpOworKi8K KyAgeF9yZXNldF9jbGlwX3JlY3RhbmdsZXMgKGYsIGdjKTsKK30KKworLyogRHJhdyBhIGJhciBj dXJzb3Igb24gd2luZG93IFcgaW4gZ2x5cGggcm93IFJPVy4gKi8KK3N0YXRpYyB2b2lkCittY194 X2RyYXdfYmFyX2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAq bWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICAgICAgaW50 IHgsIGludCBmeCwgaW50IHksIGludCBmeSwgaW50IGhwb3MsIGludCB2cG9zLCBpbnQgd2QsIGlu dCBoLAorICAgICAgICAgICAgICAgICAgICAgIGludCB3aWR0aCwgZW51bSB0eXBlX29mX2N1cnNv ciBraW5kLCBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKQoreworICBzdHJ1Y3QgZnJh bWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgLyogSWYgY3Vyc29yIGlzIG91dCBvZiBib3Vu ZHMsIGRvbid0IGRyYXcgZ2FyYmFnZS4gIFRoaXMgY2FuIGhhcHBlbgorICAgICBpbiBtaW5pLWJ1 ZmZlciB3aW5kb3dzIHdoZW4gc3dpdGNoaW5nIGJldHdlZW4gZWNobyBhcmVhIGdseXBocworICAg ICBhbmQgbWluaS1idWZmZXIuICAqLworICBzdHJ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LAorICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciwg Ym9vbCBvbl9wLCBib29sIGFjdGl2ZV9wKQoreworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUg KFdJTkRPV19GUkFNRSAodykpOworICAvKiBUaGUgZnJpbmdlIGJpdG1hcHMgYXJlIHByZXNlbnRs eSBoYW5kbGVkIGVsc2V3aGVyZSwgYnV0IGNvdWxkIHNvbWVkYXkKKyAgYmUgbWFuYWdlZCAoaW4g cGFydCkgYXQgdGhpcyBzZWN0aW9uIG9mIGNvZGUuICovCisgIGlmIChvbl9wKQorICAgIHsKKyAg ICAgIGlmIChyb3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5lX3AKKyAgICAgICAgICAmJiAocm93 LT5yZXZlcnNlZF9wCisgICAgICAgICAgICAgID8gKGhwb3MgPCAwKQorICAgICAgICAgICAgICA6 IChocG9zID49IHJvdy0+dXNlZFtURVhUX0FSRUFdKSkpCisgICAgICAgIHsKKyAgICAgICAgICBy b3ctPmN1cnNvcl9pbl9mcmluZ2VfcCA9IHRydWU7CisgICAgICAgICAgbWNfZHJhd19mcmluZ2Vf Yml0bWFwICh3LCByb3csIHJvdy0+cmV2ZXJzZWRfcCwgY3Vyc29yX3R5cGUpOworICAgICAgICB9 CisgICAgICBlbHNlCisgICAgICAgIHsKKyAgQ29sb3JtYXAgY21hcCA9IEZSQU1FX1hfQ09MT1JN QVAgKGYpOworICB1bnNpZ25lZCBsb25nIG9yaWdpbmFsX2N1cnNvcl9waXhlbCA9IGYtPm91dHB1 dF9kYXRhLngtPmN1cnNvcl9waXhlbDsKKyAgLyogeHRlcm0uYy94dGVybS5oIHVzZSBHQzsgd2hl cmVhcywgdzMydGVybS5jL3czMnRlcm0uaCB1c2UgWEdDVmFsdWVzICogKi8KKyAgWEdDVmFsdWVz IHhnY3Y7CisgIFhHZXRHQ1ZhbHVlcyAoRlJBTUVfWF9ESVNQT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0hFQ0tfQlVGRkVSIChidWYpOworICAgICAgc3RydWN0IGJ1ZmZlciAqYiA9IFhC VUZGRVIgKGJ1Zik7CisgICAgICBib29sIHJlZ2lvbl9hY3RpdmVfcCA9ICghTklMUCAoVnRyYW5z aWVudF9tYXJrX21vZGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAo QlZBUiAoYiwgbWFya19hY3RpdmUpKSk7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2JlZ2lubmlu ZyA9IChyZWdpb25fYWN0aXZlX3ApID8gWEZJWE5VTSAoRnJlZ2lvbl9iZWdpbm5pbmcgKCkpIDog LTE7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2VuZCA9IChyZWdpb25fYWN0aXZlX3ApID8gWEZJ WE5VTSAoRnJlZ2lvbl9lbmQgKCkpIDogLTE7CisgICAgICBwdHJkaWZmX3Qgb3BvaW50X3B0ID0g KHcgPT0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93KSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IFBUCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBYRklYTlVNIChGbWFya2Vy X3Bvc2l0aW9uICh3LT5wb2ludG0pKTsKKyAgICAgIGJvb2wgcmVnaW9uX2luX2JvdW5kc19wID0g KHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3Bv aW50X3B0ID49IHJlZ2lvbl9iZWdpbm5pbmcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIG9wb2ludF9wdCA8IHJlZ2lvbl9lbmQpOworICAgICAgaWYgKGN1cnNvcl9nbHlwaC0+ dHlwZSAhPSBJTUFHRV9HTFlQSCAmJiBsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYg bHNsLmJsdWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpam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ExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9n YywgaG9sbG93X2FjdGl2ZV9yZWdpb25fZmFjZS0+YmFja2dyb3VuZCk7CisgICAgICAgICAgICB9 CisgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAg ICAgICYmICFyZWdpb25faW5fYm91bmRzX3AKKyAgICAgICAgICAgICAgICAgICAgICYmIGFjdGl2 ZV9wKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxv d19hY3RpdmVfcmVnaW9uX291dF9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGlu dGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1yZWdpb24tZmFjZSIpLCB0cnVlKTsKKyAgICAgICAg ICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9yZWdpb25fb3V0X2ZhY2UgPSBGQUNF X0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfcmVnaW9uX291dF9mYWNlX2lkKTsKKyAgICAgICAg ICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVk X2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1mYWNlIiksIHRydWUpOwor ICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZS T01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgWFNldEZv cmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9n YywgaG9sbG93X2FjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICBYU2V0 QmFja2dyb3VuZCA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ICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkID0gbG9va3Vw X25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1m YWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2lu YWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkKTsK KyAgICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiks IGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2luYWN0aXZlX2ZhY2UtPmZvcmVn cm91bmQpOworICAgICAgICAgICAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQ TEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfaW5hY3RpdmVfZmFj ZS0+YmFja2dyb3VuZCk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgYmxvY2tfaW5w dXQgKCk7CisgICAgICAgICAgLyogRm9yY2UgYG1jX3hfc2V0X2N1cnNvcl9nYycgdG8gdXNlIGBz LT5mLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MnLiAgKi8KKyAgICAgICAgICBib29sIGN1cnNv cl9nY19wID0gdHJ1ZTsKKyAgICAgICAgICBtY19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4 LCByb3csIERSQVdfQ1VSU09SLCB4LCBocG9zLCB2cG9zLCBsc2wsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwg Y3Vyc29yX2djX3ApOworICAgICAgICA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EJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAo ZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9mYWNlLT5iYWNr Z3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAvKiBU aGUgcmVnaW9uIGlzIF9ub3RfIHZpc2libGUgaW4gdGhlIGluYWN0aXZlIHdpbmRvdyBiZWNhdXNl IHRoZSBvdmVybGF5IHdpbmRvdyBwcm9wZXJ0eSBpcyB1c2VkLiAqLworICAgICAgICAgICAgICAg ICAgICBlbHNlIGlmICghYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkID0g bG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFj dGl2ZS1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2Ug KmhvbGxvd19pbmFjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfaW5hY3RpdmVf ZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVf WF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfaW5hY3Rp dmVfZmFjZS0+Zm9yZWdyb3VuZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBYU2V0QmFja2dy b3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBo b2xsb3dfaW5hY3RpdmVfZmFjZS0+YmFja2dyb3VuZCk7CisgICAgICAgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgLyogRm9yY2Ug YG1jX3hfc2V0X2N1cnNvcl9nYycgdG8gdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS54LT5jdXJzb3Jf Z2MnLiAgKi8KKyAgICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IHRydWU7CisgICAgICAg ICAgICAgIG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywgRFJBV19DVVJTT1Is IHgsIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsc2ws IGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICAgICAgWFNldEZv cmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9n YywgeGdjdi5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1F X1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgeGdjdi5iYWNrZ3Jv dW5kKTsKKyAgICAgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgLyog RHJhdyB0aGUgZnJhbWUgYXJvdW5kIHRoZSBib3guICovCisgICAgICAgICAgICAgIG1jX3hfZHJh d19ob2xsb3dfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9z LCB3ZCwgaCk7CisgICAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBN Q19IT0xMT1dfQk9YOgorICAgIHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVu ID49IDAgJiYgbHNsLmJsdWU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gICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2Fz ZSBNQ19CQVI6CisgICAgeworICAgICAgaWYgKGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3JlZW4gPj0g MCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkg aGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgICBm LT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBjb2xvci5waXhlbDsKKyAgICAgICAgICBi b29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gdHJ1ZTsKKyAgICAgICAgICBtY194X2Ry YXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywg d2QsIGgsIGN1cnNvcl93aWR0aCwgTUNfQkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7 CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vy c29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAg ICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7CisgICAgICAgICAg ICBtY194X2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBv cywgdnBvcywgd2QsIGgsIGN1cnNvcl93aWR0aCwgTUNfQkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxl X29rYXlfcCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNf SEJBUjoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYm IGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWph Y2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCcuICAqLworICAgICAgICAgIGYtPm91 dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IGNvbG9yLnBpeGVsOworICAgICAgICAgIGJvb2wg Y3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSB0cnVlOworICAgICAgICAgIG1jX3hfZHJhd19i YXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwg aCwgY3Vyc29yX3dpZHRoLCBNQ19IQkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7Cisg ICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29y X3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAg ICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7CisgICAgICAgICAgICBt Y194X2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywg dnBvcywgd2QsIGgsIGN1cnNvcl93aWR0aCwgTUNfSEJBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9v a2F5X3ApOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBkZWZhdWx0Ogor ICAgICAgZW1hY3NfYWJvcnQgKCk7CisgIH0KKyAgICAgICAgfQorI2lmZGVmIEhBVkVfWF9JMThO CisgIGlmICh3ID09IFhXSU5ET1cgKGYtPnNlbGVjdGVkX3dpbmRvdykpCisgICAgaWYgKEZSQU1F X1hJQyAoZikgJiYgKEZSQU1FX1hJQ19TVFlMRSAoZikgJiBYSU1QcmVlZGl0UG9zaXRpb24pKQor ICAgICAgeGljX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Rvd19ib3hfcmlnaHQgKHMtPncsIFRF WFRfQVJFQSk7CisgICAgaWYgKHggKyBiYWNrZ3JvdW5kX3dpZHRoID4gcmlnaHRfeCkKKyAgICAg IGJhY2tncm91bmRfd2lkdGggLT0geCAtIHJpZ2h0X3g7CisgICAgeCArPSBiYWNrZ3JvdW5kX3dp ZHRoOworICB9CisgICAgICB3aWR0aCA9IG1pbiAoRlJBTUVfQ09MVU1OX1dJRFRIIChzLT5mKSwg YmFja2dyb3VuZF93aWR0aCk7CisgICAgICBpZiAocy0+cm93LT5yZXZlcnNlZF9wKQorICB4IC09 IHdpZHRoOworICAgICAgLyogRHJhdyBjdXJzb3IuICAqLworICAgICAgeF9kcmF3X2dseXBoX3N0 cmluZ19iZ19yZWN0IChzLCB4LCBzLT55LCB3aWR0aCwgcy0+aGVpZ2h0KTsKKyAgICAgIC8qIENs ZWFyIHJlc3QgdXNpbmcgdGhlIEdDIG9mIHRoZSBvcmlnaW5hbCBub24tY3Vyc29yIGZhY2UuICAq LworICAgICAgaWYgKHdpZHRoIDwgYmFja2dyb3VuZF93aWR0aCkKKyAgeworICAgIGludCB5ID0g cy0+eTsKKyAgICBpbnQgdyA9IGJhY2tncm91bmRfd2lkdGggLSB3aWR0aCwgaCA9IHMtPmhlaWdo dDsKKyAgICBYUmVjdGFuZ2xlIHI7CisgICAgR0MgZ2M7CisgICAgaWYgKCFzLT5yb3ctPnJldmVy c2VkX3ApCisgICAgICB4ICs9IHdpZHRoOworICAgIGVsc2UKKyAgICAgIHggPSBzLT54OworICAg IGlmIChzLT5yb3ctPm1vdXNlX2ZhY2VfcAorICAgICAgICAmJiBjdXJzb3JfaW5fbW91c2VfZmFj ZV9wIChzLT53KSkKKyAgICAgIHsKKyAgICAgICAgeF9zZXRfbW91c2VfZmFjZV9nYyAocyk7Cisg ICAgICAgIGdjID0gcy0+Z2M7CisgICAgICB9CisgICAgZWxzZQorICAgICAgZ2MgPSBzLT5mYWNl LT5nYzsKKyAgICBnZXRfZ2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19ib3hfbGVmdF9vZmZzZXQg KHMtPncsIFRFWFRfQVJFQSk7CisgICAgICAvKiBEb24ndCBkcmF3IGludG8gbGVmdCBtYXJnaW4s IGZyaW5nZSBvciBzY3JvbGxiYXIgYXJlYQorICAgICAgICAgZXhjZXB0IGZvciBoZWFkZXIgbGlu ZSBhbmQgbW9kZSBsaW5lLiAgKi8KKyAgICAgIGlmICh4IDwgbGVmdF94ICYmICFzLT5yb3ctPm1v ZGVfbGluZV9wKQorICB7CisgICAgYmFja2dyb3VuZF93aWR0aCAtPSBsZWZ0X3ggLSB4OworICAg IHggPSBsZWZ0X3g7CisgIH0KKyAgICAgIGlmIChiYWNrZ3JvdW5kX3dpZHRoID4gMCkKKyAgeF9k cmF3X2dseXBoX3N0cmluZ19iZ19yZWN0IChzLCB4LCBzLT55LCBiYWNrZ3JvdW5kX3dpZHRoLCBz LT5oZWlnaHQpOworICAgIH0KKyAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7Cit9CisK Ky8qIERyYXcgZ2x5cGggc3RyaW5nIFMuICAqLworc3RhdGljIHZvaWQKK21jX3hfZHJhd19nbHlw aF9zdHJpbmcgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1h dHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAgICAgICAgICAgICAgc3Ry dWN0IG1jX1JHQiBsc2wsIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciwKKyAgICAgICAgICAg ICAgICAgICAgICAgIGVudW0gdHlwZV9vZl9jdXJzb3IgY3Vyc29yX3R5cGUsIGludCBjdXJzb3Jf d2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICBib29sIGFjdGl2ZV9wLCBib29sIGN1cnNv cl9nY19wKQoreworICBib29sIHJlbGllZl9kcmF3bl9wID0gZmFsc2U7CisgIC8qIElmIFMgZHJh d3MgaW50byB0aGUgYmFja2dyb3VuZ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5jbXBfZnJvbSA+IDAKKyAg ICAgICAgICAgICYmICEgcy0+Zmlyc3RfZ2x5cGgtPnUuY21wLmF1dG9tYXRpYykpCisgIHMtPmJh Y2tncm91bmRfZmlsbGVkX3AgPSB0cnVlOworICAgICAgZWxzZQorICB4X2RyYXdfZ2x5cGhfc3Ry aW5nX2JhY2tncm91bmQgKHMsIHRydWUpOworICAgICAgeF9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9z dHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAgICBicmVhazsKKyAgICBjYXNlIEdMWVBITEVTU19H TFlQSDoKKyAgICAgIGlmIChzLT5mb3Jfb3ZlcmxhcHMpCisgIHMtPmJhY2tncm91bmRfZmlsbGVk X3AgPSB0cnVlOworICAgICAgZWxzZQorICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQg KHMsIHRydWUpOworICAgICAgeF9kcmF3X2dseXBobGVzc19nbHlwaF9zdHJpbmdfZm9yZWdyb3Vu ZCAocyk7CisgICAgICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7 CisgICAgfQorICBpZiAoIXMtPmZvcl9vdmVybGFwcykKKyAgICB7CisgICAgICAvKiBEcmF3IHVu ZGVybGluZS4gICovCisgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3ApCisgICAgICAgIHsK KyAgICAgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9XQVZF KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX2Rl ZmF1bHRlZF9wKQorICAgICAgICAgICAgICAgIHhfZHJhd191bmRlcndhdmUgKHMpOworICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgWEdDVmFs dWVzIHhnY3Y7CisgICAgICAgICAgICAgICAgICBYR2V0R0NWYWx1ZXMgKHMtPmRpc3BsYXksIHMt PmdjLCBHQ0ZvcmVncm91bmQsICZ4Z2N2KTsKKyAgICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3Jv dW5kIChzLT5kaXNwbGF5LCBzLT5nYywgcy0+ZmFjZS0+dW5kZXJsaW5lX2NvbG9yKTsKKyAgICAg ICAgICAgICAgICAgIHhfZHJhd191bmRlcndhdmUgKHMpOworICAgICAgICAgICAgICAgICAgWFNl dEZvcmVncm91bmQgKHMtPmRpc3BsYXksIHMtPmdjLCB4Z2N2LmZvcmVncm91bmQpOworICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmIChzLT5mYWNlLT51 bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgICB7CisgICAgICAg ICAgICAgIHVuc2lnbmVkIGxvbmcgdGhpY2tuZXNzLCBwb3NpdGlvbjsKKyAgICAgICAgICAgICAg aW50IHk7CisgICAgICAgICAgICAgIGlmIChzLT5wcmV2ICYmIHMtPnByZXYtPmZhY2UtPnVuZGVy bGluZV9wCisgICAgICAmJiBzLT5wcmV2LT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VO REVSX0xJTkUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgLyogV2UgdXNl IHRoZSBzYW1lIHVuZGVybGluZSBzdHlsZSBhcyB0aGUgcHJldmlvdXMgb25lLiAgKi8KKyAgICAg ICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPnByZXYtPnVuZGVybGluZV90aGlja25lc3M7Cisg ICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPnByZXYtPnVuZGVybGluZV9wb3NpdGlvbjsK KyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7 CisgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVybGluZSB0aGlja25lc3MuICBEZWZh dWx0IGlzIDEgcGl4ZWwuICAqLworICAgICAgICAgICAgICAgICAgaWYgKHMtPmZvbnQgJiYgcy0+ Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzcyA+IDApCisgICAgICAgICAgICAgICAgICAgIHRoaWNr bmVzcyA9IHMtPmZvbnQtPnVuZGVybGluZV90aGlja25lc3M7CisgICAgICAgICAgICAgICAgICBl bHNlCisgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IDE7CisgICAgICAgICAgICAgICAg ICBpZiAoeF91bmRlcmxpbmVfYXRfZGVzY2VudF9saW5lKQorICAgICAgICAgICAgICAgICAgICBw b3NpdGlvbiA9IChzLT5oZWlnaHQgLSB0aGlja25lc3MpIC0gKHMtPnliYXNlIC0gcy0+eSk7Cisg ICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVybGluZSBwb3NpdGlvbi4gIFRoaXMgaXMgdGhlIHJl Y29tbWVuZGVkCisgICAgICAgICAgICAgICAgICAgICAgICAgdmVydGljYWwgb2Zmc2V0IGluIHBp eGVscyBmcm9tIHRoZSBiYXNlbGluZSB0byB0aGUgdG9wIG9mCisgICAgICAgICAgICAgICAgICAg ICAgICAgdGhlIHVuZGVybGluZS4gIFRoaXMgaXMgYSBzaWduZWQgdmFsdWUgYWNjb3JkaW5nIHRv IHRoZQorICAgICAgICAgICAgICAgICAgICAgICAgIHNwZWNzLCBhbmQgaXRzIGRlZmF1bHQgaXMK KyAgICAgICAgICAgICAgICAgICAgICAgICBST1VORCAoKG1heGltdW0gZGVzY2VudCkgLyAyKSwg d2l0aAorICAgICAgICAgICAgICAgICAgICAgICAgIFJPVU5EKHgpID0gZmxvb3IgKHggKyAwLjUp ICAqLworICAgICAgICAgICAgICAgICAgICAgIGlmICh4X3VzZV91bmRlcmxpbmVfcG9zaXRpb25f cHJvcGVydGllcworICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBzLT5mb250ICYmIHMtPmZv bnQtPnVuZGVybGluZV9wb3NpdGlvbiA+PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgcG9z aXRpb24gPSBzLT5mb250LT51bmRlcmxpbmVfcG9zaXRpb247CisgICAgICAgICAgICAgICAgICAg ICAgZWxzZSBpZiAocy0+Zm9udCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0g KHMtPmZvbnQtPmRlc2NlbnQgKyAxKSAvIDI7CisgICAgICAgICAgICAgICAgICAgICAgZWxzZQor ICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSB1bmRlcmxpbmVfbWluaW11bV9vZmZz ZXQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0g bWF4IChwb3NpdGlvbiwgdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0KTsKKyAgICAgICAgICAgICAg ICB9CisgICAgICAgICAgICAgIC8qIENoZWNrIHRoZSBzYW5pdHkgb2YgdGhpY2tuZXNzIGFuZCBw b3NpdGlvbi4gIFdlIHNob3VsZAorICAgICAgICAgICAgICAgICBhdm9pZCBkcmF3aW5nIHVuZGVy bGluZSBvdXQgb2YgdGhlIGN1cnJlbnQgbGluZSBhcmVhLiAgKi8KKyAgICAgICAgICAgICAgaWYg KHMtPnkgKyBzLT5oZWlnaHQgPD0gcy0+eWJhc2UgKyBwb3NpdGlvbikKKyAgICAgICAgICAgICAg ICBwb3NpdGlvbiA9IChzLT5oZWlnaHQgLSAxKSAtIChzLT55YmFzZSAtIHMtPnkpOworICAgICAg ICAgICAgICBpZiAocy0+eSArIHMtPmhlaWdodCA8IHMtPnliYXNlICsgcG9zaXRpb24gKyB0aGlj a25lc3MpCisgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gKHMtPnkgKyBzLT5oZWlnaHQpIC0g KHMtPnliYXNlICsgcG9zaXRpb24pOworICAgICAgICAgICAgICBzLT51bmRlcmxpbmVfdGhpY2tu ZXNzID0gdGhpY2tuZXNzOworICAgICAgICAgICAgICBzLT51bmRlcmxpbmVfcG9zaXRpb24gPSBw b3NpdGlvbjsKKyAgICAgICAgICAgICAgeSA9IHMtPnliYXNlICsgcG9zaXRpb247CisgICAgICAg ICAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICAg ICAgeF9maWxsX3JlY3RhbmdsZSAocy0+Ziwgcy0+Z2MsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHMtPngsIHksIHMtPndpZHRoLCB0aGlja25lc3MpOworICAgICAgICAgICAgICBl bHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgWEdDVmFsdWVzIHhnY3Y7 CisgICAgICAgICAgICAgICAgICBYR2V0R0NWYWx1ZXMgKHMtPmRpc3BsYXksIHMtPmdjLCBHQ0Zv cmVncm91bmQsICZ4Z2N2KTsKKyAgICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChzLT5k aXNwbGF5LCBzLT5nYywgcy0+ZmFjZS0+dW5kZXJsaW5lX2NvbG9yKTsKKyAgICAgICAgICAgICAg ICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHMtPngsIHksIHMtPndpZHRoLCB0aGlja25lc3MpOworICAgICAgICAgICAg ICAgICAgWFNldEZvcmVncm91bmQgKHMtPmRpc3BsYXksIHMtPmdjLCB4Z2N2LmZvcmVncm91bmQp OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgLyog RHJhdyBvdmVybGluZS4gICovCisgICAgICBpZiAocy0+ZmFjZS0+b3ZlcmxpbmVfcCkKKyAgewor ICAgIHVuc2lnbmVkIGxvbmcgZHkgPSAwLCBoID0gMTsKKyAgICBpZiAocy0+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KHMsIG5leHQpOworICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlw ZSA9PSBDSEFSX0dMWVBIKQorICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChu ZXh0KTsKKyAgICBlbHNlCisgICAgICB4X2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3Jl Z3JvdW5kIChuZXh0KTsKKyAgICB4X3Jlc2V0X2NsaXBfcmVjdGFuZ2xlcyAobmV4dC0+ZiwgbmV4 dC0+Z2MpOworICAgIG5leHQtPmhsID0gc2F2ZTsKKyAgICBuZXh0LT5udW1fY2xpcHMgPSAwOwor ICAgIG5leHQtPmNsaXBfaGVhZCA9IHMtPm5leHQ7CisgICAgICAgIH0KKyAgfQorICAgIH0KKyAg LyogUmVzZXQgY2xpcHBpbmcuICAqLworICB4X3Jlc2V0X2NsaXBfcmVjdGFuZ2xlcyAocy0+Ziwg cy0+Z2MpOworICBzLT5udW1fY2xpcHMgPSAwOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09S UyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogLyogRGVmYXVsdCB0byB1c2luZyBY SU0gaWYgYXZhaWxhYmxlLiAgKi8KICNpZmRlZiBVU0VfWElNCiBib29sIHVzZV94aW0gPSB0cnVl OwpAQCAtOTk5LDYgKzE4NjIsMTUgQEAgeF91cGRhdGVfYmVnaW4gKHN0cnVjdCBmcmFtZSAqZikK ICAgaWYgKEZSQU1FX1RPT0xUSVBfUCAoZikgJiYgIUZSQU1FX1ZJU0lCTEVfUCAoZikpCiAgICAg cmV0dXJuOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09S UyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gZjsKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogICBpZiAoISBGUkFNRV9DUl9TVVJGQUNFIChmKSkKICAgICB7CiAgICAgICBp bnQgd2lkdGgsIGhlaWdodDsKQEAgLTEyNjYsNiArMjEzOCwxNiBAQCB4X3VwZGF0ZV9lbmQgKHN0 cnVjdCBmcmFtZSAqZikKICAgWEZsdXNoIChGUkFNRV9YX0RJU1BMQVkgKGYpKTsKICAgdW5ibG9j a19pbnB1dCAoKTsKICNlbmRpZgorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gTlVMTDsKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAvKiBUaGlzIGZ1bmN0aW9uIGlzIGNhbGxl ZCBmcm9tIHZhcmlvdXMgcGxhY2VzIGluIHhkaXNwLmMKQEAgLTEzMTAwLDYgKzEzOTgyLDIxIEBA IHhfYWN0aXZhdGVfdGltZW91dF9hdGltZXIgKHZvaWQpCiAKIHN0YXRpYyBzdHJ1Y3QgcmVkaXNw bGF5X2ludGVyZmFjZSB4X3JlZGlzcGxheV9pbnRlcmZhY2UgPQogICB7CisKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRpc3BsYXlf aW50ZXJmYWNlJyBpbiBgeHRlcm0uY2AgbXVzdCBiZSBpbiB0aGUgZXhhY3Qgc2FtZSBvcmRlciBh cyB0aGUKK2ByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgZGlzcGV4dGVybi5oYCEgKi8KKworICBt Y194X3dyaXRlX2dseXBocywKKyAgbWNfeF9kcmF3X3dpbmRvd19jdXJzb3IsCisgIG1jX3hfZHJh d19nbHlwaF9zdHJpbmcsCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICB4X2Zy YW1lX3Bhcm1faGFuZGxlcnMsCiAgICAgeF9wcm9kdWNlX2dseXBocywKICAgICB4X3dyaXRlX2ds eXBocywK --Multipart_Sun_Apr_28_18:21:05_2019-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs). References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 03 May 2019 00:49:02 +0000 Resent-Message-ID: <handler.22873.B22873.155684450520516 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22873 <at> debbugs.gnu.org,17684 <at> debbugs.gnu.org Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.155684450520516 (code B ref 22873); Fri, 03 May 2019 00:49:02 +0000 Received: (at 22873) by debbugs.gnu.org; 3 May 2019 00:48:25 +0000 Received: from localhost ([127.0.0.1]:47405 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1hMMNF-0005Kq-M3 for submit <at> debbugs.gnu.org; Thu, 02 May 2019 20:48:25 -0400 Received: from gateway20.websitewelcome.com ([192.185.68.24]:47768) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1hMMND-0005Kc-KJ for 22873 <at> debbugs.gnu.org; Thu, 02 May 2019 20:48:24 -0400 Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 10E9B400C8785 for <22873 <at> debbugs.gnu.org>; Thu, 2 May 2019 19:48:23 -0500 (CDT) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id MMNCh0oyu2qH7MMNChJcec; Thu, 02 May 2019 19:48:23 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:To:From:Message-ID:Date: Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=WOHT6MWSwnwOhJYpNhxA++qA6w/E2jxrv+CXJGgHNqc=; b=YhGyoJ+SHoIajC0QOOguV0lzBj Ht//9n7hoxFMcquGe8zEmk0meU0CaRiAgwtDUfmJCANfgB4iUbMwCCBRkwpScUn6XvTpZOhupNZmh coWU0fg429mcFrD1IRFBMykUgPVcH3SF+Ln/OYWwq6ijGOJwOfimgrEM2j9lSre6j1i+UBeW7vgR/ HfpIDHnLdAY7Nvx7kcLd/NeCCeSEowphEcjT0uESGgwwOPsO3m4UCucMtaw9wAxNu8ML678rmSIXD zPd+k7o6fBDno/l7OfipOmfjwgrpkCp6Lzk1M0iP5BvClNiLVYs9c2AzpzXQOjNMZEHZJxinhy3oh IUxc2LFQ==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:51411 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from <esq@HIDDEN>) id 1hMMN9-000khW-ER; Thu, 02 May 2019 19:48:22 -0500 Date: Thu, 02 May 2019 17:48:18 -0700 Message-ID: <m2sgtwe52l.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Thu_May__2_17:48:18_2019-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1hMMN9-000khW-ER X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:51411 X-Source-Auth: lawlist X-Email-Count: 2 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> --Multipart_Thu_May__2_17:48:18_2019-1 Content-Type: text/plain; charset=US-ASCII VERSION: 019.002 [05/02/2019] CHANGELOG: - Eliminated the usage of a Lisp_Object within `mc_update_text_area' in favor of an array of structs. [Every Lisp_Object that is eliminated will reduce the need for garbage collection.] - Eliminated `mc/save-window-scroll' when using the multiple-crosshairs library written by Magnar Sveen. [Said function caused non-selected windows to be updated during redisplay, resulting in undue slowdown.] - Miscellaneous changes regarding when/what stderr messages are to appear when running M-x trace-redisplay; and, changed the name of the function responsible for erasing fake cursors and resetting the cache: `mc_pre_scroll_clean'. Eliminated the message to run "M-x mc-install" when `crosshairs.el` loads. SETUP: Step 1: git clone -b master git://git.sv.gnu.org/emacs.git Step 2: In the new emacs folder, go back to an Emacs version from 04/08/2019: git reset --hard a038df77de7b1aa2d73a6478493b8838b59e4982 Step 3: From within the new emacs folder created in Step 1, apply the patch: git apply /path/to/the/patch.diff Step 4: ./autogen.sh Step 5: ./configure ... [your custom options] Step 6: make Step 7: make install USAGE: - For a minimal working example of built-in fake cursors, type: M-x mc-test ;;; TURN ON FAKE CURSORS (buffer position, cursor-type, cursor color): (setq mc-conf '((1 "hbar" "magenta") (2 "bar" "purple") (3 "box" "#00FF00") (4 "hollow" "#0000FF") (5 ("hbar" 3) [1.0 0.0 1.0]) (6 ("bar" 3) [0.0 1.0 1.0]) (7 "framed" "OrangeRed")))) ;;; TURN OFF FAKE CURSORS: (setq mc-conf nil) - To try out the crosshairs feature, type: M-x +-mode - To try out built-in fake cursors with Magnar Sveen's multiple-cursors package, install that package first. [If the multiple-cursors package is installed, an eval-after-load "multiple-cursors-core" statement within `crosshairs.el` will redefine a couple of functions and set up a few keyboard shortcuts.] If the multiple-cursors package by Magnar Sveen is not already installed, then here are two easy ways to install that package: Type: M-x mc-install OR, evaluate the following snippet: (progn (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) (package-refresh-contents) (package-install 'multiple-cursors)) TODO: - Add support for `ch_inactive_windows' and `fc_inactive_windows'. - When using the multiple fake cursors feature, a fake cursor does not show up at zv_p. - Deal with left/right overwritten glyphs in the w32 and X ports of Emacs. - Reduce the removal of fake cursors to the bare minimum when scrolling the text on the glass directly, and whenever `update_window' is called. - When an idle-timer fires and point is at the end of a horizontally scrolled line in a narrow window, the temporary horizontal scroll is canceled. Create an minimal working example and file a bug report. - There is a bug affecting an older version of Emacs for the NS port that causes partial line flickering when the same characters are grouped together (;;;;;;) and MC_GLYPHLESS cursors are above or below -- having the same background color as the frame; e.g., black on black (used to erase a glyphless cursor). The partial flickering is only noticeable with rapid fire; e.g., holding down the right/left arrow key. When changing the color of the glyphless cursor, the issue is not present. [@lawlist has verified that the X and HPOS coordinates are accurate.] - There is a bug affecting the recorded `w->mc.lnum_pixel_width` that is observable when not running under gdb, but disappears when running under gdb. While viewing a folded org-mode buffer, the non-gdb instance had a visible line number pixel-width of 44, but Emacs treated it as fluctuating between 44 and 55 as the cursor was moved to the end of line. In the gdb instance, the visible line number pixel width was 55 with no fluctuation under the same conditions as the non-gdb instance. This appears to be a different bug than bug#32177 (current line number shifts one column to the left) because the line number of the current line does not shift left, and changing the bidi settings did not correct the issue. - The current test for `auto_hscroll_mode_p' only looks for `current_line` and all five related tests are based upon that assumption, which may not be true. - Multiple Cursors: If point is in the middle of a composite character, then select a fully composed character so that the fake cursor is visible. - Implement functionality similar to the Lisp multiple-cursors by Magnar Sveen. - Follow up with the Emacs team re bug#32177; i.e., (Current line number shifts one column to the left.) - Follow up with the Emacs team re bug#32060; i.e., Horizontal Scrolling (Current Line): Wrong line gets h-scrolled. - Determine if bug #28936 needs to be fixed and help the Emacs team re same. --Multipart_Thu_May__2_17:48:18_2019-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="2019_05_02__17_44_54_096.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvY3Jvc3NoYWlycy5lbCBiL2xpc3AvY3Jvc3NoYWlycy5lbApuZXcg ZmlsZSBtb2RlIDE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ci1mYWtlLWN1cnNvcgorICAgICAgKGlmIChlcSAxIChtYy9udW0tY3Vyc29ycykpIDs7 IG5vIGZha2UgY3Vyc29ycz8gZGlzYWJsZSBtYy1tb2RlCisgICAgICAgICAgKG11bHRpcGxlLWN1 cnNvcnMtbW9kZSAwKQorICAgICAgICAod2hlbiB0aGlzLW9yaWdpbmFsLWNvbW1hbmQKKyAgICAg ICAgICAobGV0ICgob3JpZ2luYWwtY29tbWFuZCAob3IgbWMtLXRoaXMtY29tbWFuZAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29tbWFuZC1yZW1hcHBpbmcgdGhpcy1v cmlnaW5hbC1jb21tYW5kKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0 aGlzLW9yaWdpbmFsLWNvbW1hbmQpKSkKKyAgICAgICAgICAgIDs7IHNraXAga2V5Ym9hcmQgbWFj cm9zLCBzaW5jZSB0aGV5IHdpbGwgZ2VuZXJhdGUgYWN0dWFsIGNvbW1hbmRzIHRoYXQgYXJlCisg ICAgICAgICAgICA7OyBhbHNvIHJ1biBpbiB0aGUgY29tbWFuZCBsb29wIC0gd2UnbGwgaGFuZGxl IHRob3NlIGxhdGVyIGluc3RlYWQuCisgICAgICAgICAgICAod2hlbiAoZnVuY3Rpb25wIG9yaWdp bmFsLWNvbW1hbmQpCisgICAgICAgICAgICAgIDs7IGlmIGl0J3MgYSBsYW1iZGEsIHdlIGNhbid0 IGtub3cgaWYgaXQncyBzdXBwb3J0ZWQgb3Igbm90CisgICAgICAgICAgICAgIDs7IC0gc28gZ28g YWhlYWQgYW5kIGFzc3VtZSBpdCdzIG9rLCBiZWNhdXNlIHdlJ3JlIGp1c3Qgb3B0aW1pc3RpYyBs aWtlIHRoYXQKKyAgICAgICAgICAgICAgKGlmIChvciAobm90IChzeW1ib2xwIG9yaWdpbmFsLWNv bW1hbmQpKQorICAgICAgICAgICAgICAgICAgICAgIDs7IGxhbWJkYSByZWdpc3RlcmVkIGJ5IHNt YXJ0cmVwCisgICAgICAgICAgICAgICAgICAgICAgKHN0cmluZy1wcmVmaXgtcCAiKCIgKHN5bWJv bC1uYW1lIG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAgICAgICAgICAgICAgICAgIChtYy9leGVjdXRl LWNvbW1hbmQtZm9yLWFsbC1mYWtlLWN1cnNvcnMgb3JpZ2luYWwtY29tbWFuZCkKKyAgICAgICAg ICAgICAgICA7OyBzbWFydHJlcCBgaW50ZXJuJ3MgY29tbWFuZHMgaW50byBvd24gb2JhcnJheSB0 byBoZWxwCisgICAgICAgICAgICAgICAgOzsgYGRlc2NyaWJlLWJpbmRpbmdzJy4gIFNvLCBsZXQn cyByZS1gaW50ZXJuJyBoZXJlIHRvCisgICAgICAgICAgICAgICAgOzsgbWFrZSB0aGUgY29tbWFu ZCBjb21wYXJhYmxlIGJ5IGBlcScuCisgICAgICAgICAgICAgICAgKHNldHEgb3JpZ2luYWwtY29t bWFuZCAoaW50ZXJuIChzeW1ib2wtbmFtZSBvcmlnaW5hbC1jb21tYW5kKSkpCisgICAgICAgICAg ICAgICAgOzsgb3RoZXJ3aXNlIGl0J3MgYSBzeW1ib2wsIGFuZCB3ZSBjYW4gYmUgbW9yZSB0aG9y b3VnaAorICAgICAgICAgICAgICAgIChpZiAoZ2V0IG9yaWdpbmFsLWNvbW1hbmQgJ21jLS11bnN1 cHBvcnRlZCkKKyAgICAgICAgICAgICAgICAgICAgKG1lc3NhZ2UgIiVTIGlzIG5vdCBzdXBwb3J0 ZWQgd2l0aCBtdWx0aXBsZSBjdXJzb3JzJXMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg IG9yaWdpbmFsLWNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdldCBvcmln aW5hbC1jb21tYW5kICdtYy0tdW5zdXBwb3J0ZWQpKQorICAgICAgICAgICAgICAgICAgKHdoZW4g KGFuZCBvcmlnaW5hbC1jb21tYW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChub3Qg KG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy0tZGVmYXVsdC1jbWRzLXRvLXJ1bi1vbmNlKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKG5vdCAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1j L2NtZHMtdG8tcnVuLW9uY2UpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAob3IgbWMv YWx3YXlzLXJ1bi1mb3ItYWxsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVt cSBvcmlnaW5hbC1jb21tYW5kIG1jLS1kZWZhdWx0LWNtZHMtdG8tcnVuLWZvci1hbGwpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jL2Nt ZHMtdG8tcnVuLWZvci1hbGwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWMv cHJvbXB0LWZvci1pbmNsdXNpb24taW4td2hpdGVsaXN0IG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAg ICAgICAgICAgICAgICAgICAgKG1jL2V4ZWN1dGUtY29tbWFuZC1mb3ItYWxsLWZha2UtY3Vyc29y cyBvcmlnaW5hbC1jb21tYW5kKSkpKQorICAgICAgICAgICAgICAod2hlbiBtYy91c2UtYnVpbHQt aW4tY3Vyc29ycworICAgICAgICAgICAgICAgIChzZXRxIG1jLWNvbmYKKyAgICAgICAgICAgICAg ICAgICAgICAgIChtYXBjYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKGxhbWJkYSAoeCkg KGxpc3QgKG92ZXJsYXktc3RhcnQgeCkgImJhciIgbmlsKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgKG1jL2FsbC1mYWtlLWN1cnNvcnMpKSkpKSkpKSkpCisKKyAgKGRlZnVuIG1jL21hcmst bmV4dC1saWtlLXRoaXMtY3ljbGUtZm9yd2FyZCAoKQorICAiTWFya3M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udGEiKQorICAg ICAgICAgICAgICAgICAgICAgICgyICJiYXIiICJwdXJwbGUiKQorICAgICAgICAgICAgICAgICAg ICAgICgzICJib3giICIjMDBGRjAwIikKKyAgICAgICAgICAgICAgICAgICAgICAoNCAiaG9sbG93 IiAiIzAwMDBGRiIpCisgICAgICAgICAgICAgICAgICAgICAgKDUgKCJoYmFyIiAzKSBbMS4wIDAu MCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg2ICgiYmFyIiAzKSBbMC4wIDEuMCAxLjBd KQorICAgICAgICAgICAgICAgICAgICAgICg3ICJmcmFtZWQiICJPcmFuZ2VSZWQiKQorICAgICAg ICAgICAgICAgICAgICAgICg4ICJib3giICJncmV5MjUiKQorICAgICAgICAgICAgICAgICAgICAg ICg5ICJib3giICJncmV5NzUiKSkpKQorICAgIChzZWxlY3Qtd2luZG93IChkaXNwbGF5LWJ1ZmZl ciBidWZmZXIpKSkpCisKKyhkZWZ1biArLXRpbWVyLWZuICgpCisiU2luY2UgdGhpcyBmaXJlcyBn bG9iYWxseSwgd2UgbXVzdCBjb250cm9sIHdoaWNoIGJ1ZmZlcnMgY3Jvc3NoYWlycyBhcHBlYXIg aW4uIgorICAod2hlbiArLW1vZGUKKyAgICAodW5sZXNzIChvciAobWVtcSBsYXN0LWNvbW1hbmQg Ky1wYXJlbnMtZXhjbHVzaW9ucykKKyAgICAgICAgICAgICAgICAobnVsbCArLXBhcmVucy1wKSkK KyAgICAgICgrLXBhcmVucy1mbikpCisgICAgKHdoZW4gKy10aW1lci12YXIKKyAgICAgIChzZXRx IHRpbWVyLWlkbGUtbGlzdCAoZGVscSArLXRpbWVyLXZhciB0aW1lci1pZGxlLWxpc3QpKQorICAg ICAgKHNldHEgKy10aW1lci12YXIgbmlsKSkpKQorCisoZGVmdW4gKy1kcmF3LWZvcnRod2l0aCAo KQorIkltbWVkaWF0ZWx5IGRlbGV0ZS9kcmF3IG1hdGNoaW5nIHBhcmVudGhlc2VzLiIKKyAgKCst ZHJhdy1jcm9zc2hhaXJzICdmb3JjZSkpCisKKyhkZWZ1biArLWRyYXctY3Jvc3NoYWlycyAoJm9w dGlvbmFsIGZvcmNlKQorIkltbWVkaWF0ZWx5IGRlbGV0ZSBtYXRjaGluZyBwYXJlbnRoZXNlcy4g IElmIEZPUkNFIGlzIG5vbi1uaWwsIHRoZW4gaW1tZWRpYXRlbHkKK2RyYXcgbWF0Y2hpbmcgcGFy ZW50aGVzaXM7IG90aGVyd2lzZSwgZHJhdyB0aGVtIG9uIGFuIGlkbGUtdGllci4iCisgICh3aGVu ICstbW9kZQorICAgICh3aGVuICstdGltZXItdmFyCisgICAgICAoc2V0cSB0aW1lci1pZGxlLWxp c3QgKGRlbHEgKy10aW1lci12YXIgdGltZXItaWRsZS1saXN0KSkKKyAgICAgIChzZXRxICstdGlt ZXItdmFyIG5pbCkpCisgICAgKHVubGVzcyAob3IgKG1lbXEgdGhpcy1jb21tYW5kICstcGFyZW5z LWV4Y2x1c2lvbnMpCisgICAgICAgICAgICAgICAgKGFuZCAobnVsbCArLXBhcmVucy1wKQorICAg ICAgICAgICAgICAgICAgICAgKG51bGwgKy1wYXJlbnMtb3ZlcmxheXMtZXhpc3QtcCkpKQorICAg ICAgKCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykpCisgICAgKGlmIGZvcmNlCisgICAgICAocHJv Z24KKyAgICAgICAgKHdoZW4gKy1wYXJlbnMtcAorICAgICAgICAgICgrLXBhcmVucy1mbikpKQor ICAgICAgKHNldHEgKy10aW1lci12YXIgKHJ1bi13aXRoLWlkbGUtdGltZXIgKy1pZGxlLXRpbWVy LXNlY29uZHMgbmlsICMnKy10aW1lci1mbikpKSkpCisKKyhkZWZ2YXIgZmMtbW9kZSkKKworOzs7 IyMjYXV0b2xvYWQKKyhkZWZpbmUtbWlub3ItbW9kZSArLW1vZGUKKyJNaW5vciBtb2RlIGZvciBk aXNwbGF5aW5nIGEgaG9yaXpvbnRhbCBydWxlci4iCisgIDppbml0LXZhbHVlIG5pbAorICA6bGln aHRlciAiICsiCisgIDprZXltYXAgbmlsCisgIDpnbG9iYWwgbmlsCisgIDpncm91cCAnKy1tb2Rl CisgIChjb25kCisgICAgKCstbW9kZQorICAgICAgOzs7IGArLW1vZGUnIGhhcyB0aGUgYWJpbGl0 eSB0byBhbHNvIGRpc3BsYXkgYSBmaWxsIGNvbHVtbiBpbmRpY2F0b3IuCisgICAgICA7OzsgU2Vl IHRoZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicuCisgICAgICAod2hlbiBmYy1tb2RlCisgICAg ICAgIChmYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgZ2xvYmFsLWVsZG9jLW1vZGUKKyAg ICAgICAgICAgICAgICAgKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAgJ2FueSkKKyAgICAgICAgICAg ICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAgICAgICAgKGdsb2JhbC1l bGRvYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgaml0LWxvY2stY29udGV4dC10aW1lcgor ICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAg ICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAod2hlbiAo dGltZXJwIGppdC1sb2NrLWNvbnRleHQtdGltZXIpCisgICAgICAgICAgKGNhbmNlbC10aW1lciBq aXQtbG9jay1jb250ZXh0LXRpbWVyKSkKKyAgICAgICAgOzsgKHNldHEgaml0LWxvY2stY29udGV4 dC10aW1lciAocnVuLXdpdGgtaWRsZS10aW1lciA1LjAgJ3JlcGVhdCAnaml0LWxvY2stY29udGV4 dC1mb250aWZ5KSkKKyAgICAgICAgKHNldHEgaml0LWxvY2stY29udGV4dC10aW1lciBuaWwpKQor ICAgICAgKHdoZW4gKGFuZCAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAg ICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAod2hlbiAo dGltZXJwIHVuZG8tYXV0by1jdXJyZW50LWJvdW5kYXJ5LXRpbWVyKQorICAgICAgICAgIChjYW5j ZWwtdGltZXIgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpKQorICAgICAgICAoZnNl dCAndW5kby1hdXRvLS11bmRvYWJsZS1jaGFuZ2UKKyAgICAgICAgICAgICAgKGxhbWJkYSAoKSAo YWRkLXRvLWxpc3QgJ3VuZG8tYXV0by0tdW5kb2FibHktY2hhbmdlZC1idWZmZXJzIChjdXJyZW50 LWJ1ZmZlcikpKSkKKyAgICAgICAgKGZzZXQgJ3VuZG8tYXV0by1hbWFsZ2FtYXRlICdpZ25vcmUp KQorICAgICAgKHdoZW4gYmxpbmstY3Vyc29yLW1vZGUKKyAgICAgICAgKGJsaW5rLWN1cnNvci1t b2RlIC0xKQorICAgICAgICAod2hlbiAobWVtcSAnYmxpbmstY3Vyc29yLWNoZWNrIHBvc3QtY29t bWFuZC1ob29rKQorICAgICAgICAgIChyZW1vdmUtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJ2Js aW5rLWN1cnNvci1jaGVjaykpKQorICAgICAgKHNldHEgY3Jvc3NoYWlycyB0KQorICAgICAgKHdo ZW4gKy1maWxsLWNvbHVtbgorICAgICAgICAoc2V0cSBmYy12aXNpYmxlIHQpKQorICAgICAgOzs7 IGBhdXRvLWNvbXBvc2l0aW9uLW1vZGUnIGlzIG5lZWRlZCBmb3IgY3Jvc3NoYWlycyB0byBwcm9w ZXJseSBjYWxjdWxhdGUKKyAgICAgIDs7OyBjb29yZGluYXRlcyBvZiBjb21wb3NpdGlvbiBjaGFy YWN0ZXJzLiAgQXV0b21hdGljYWxseSBiZWNvbWVzIHBlcm1hbmVudGx5CisgICAgICA7OzsgYnVm ZmVyLWxvY2FsIHdoZW4gc2V0LgorICAgICAgKHVubGVzcyBhdXRvLWNvbXBvc2l0aW9uLW1vZGUK KyAgICAgICAgKHNldHEgYXV0by1jb21wb3NpdGlvbi1tb2RlIHQpKQorICAgICAgOzs7IEBsYXds aXN0IGlzIGZvY3VzaW5nIHRoZSBpbml0aWFsIGRldmVsb3BtZW50IG9mIGZlYXR1cmUgcmVxdWVz dHMgIzE3Njg0CisgICAgICA7OzsgYW5kICMyMjg3MyBvbiBMMlIgbGFuZ3VhZ2VzLiAgVGhlIGZl YXR1cmUgdGVzdCBmaWxlIHVzZWQgYnkgQGxhd2xpc3QKKyAgICAgIDs7OyBib2dzIEVtYWNzIGRv d24gdW5sZXNzIGBiaWRpLWRpc3BsYXktcmVvcmRlcmluZycgaXMgc2V0IHRvIGEgbmlsIHZhbHVl LgorICAgICAgOzs7IEhvd2V2ZXIsIG1vc3QgdXNlcnMgd2lsbCBwcm9iYWJseSBub3Qgd2FudCB0 aGlzIHBhcnRpY3VsYXIgc2V0dGluZy4KKyAgICAgICh1bmxlc3MgKG51bGwgYmlkaS1kaXNwbGF5 LXJlb3JkZXJpbmcpCisgICAgICAgIChzZXRxIGJpZGktZGlzcGxheS1yZW9yZGVyaW5nIG5pbCkp CisgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICcrLS1zYXZlZC1zdGF0ZSkgbmlsKQor ICAgICAgKGRvbGlzdCAodmFyICcoYnVmZmVyLWRpc3BsYXktdGFibGUKKyAgICAgICAgICAgICAg ICAgICAgIGZyaW5nZS1pbmRpY2F0b3ItYWxpc3QKKyAgICAgICAgICAgICAgICAgICAgIHRhYi13 aWR0aAorICAgICAgICAgICAgICAgICAgICAgbGluZS1tb3ZlLXZpc3VhbAorICAgICAgICAgICAg ICAgICAgICAgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgICAgICAgICAgICAgIHRydW5jYXRlLXBh cnRpYWwtd2lkdGgtd2luZG93cworICAgICAgICAgICAgICAgICAgICAgd29yZC13cmFwKSkKKyAg ICAgICAgKHdoZW4gKGxvY2FsLXZhcmlhYmxlLXAgdmFyKQorICAgICAgICAgIChwdXNoIChjb25z IHZhciAoc3ltYm9sLXZhbHVlIHZhcikpICstLXNhdmVkLXN0YXRlKSkpCisgICAgICAoc2V0cSBm aWxsLWNvbHVtbiA4MCkKKyAgICAgIChzZXRxIGRpc3BsYXktbGluZS1udW1iZXJzIHQpCisgICAg ICAoc2V0cS1sb2NhbCBhdXRvLWhzY3JvbGwtbW9kZSAnY3VycmVudC1saW5lKQorICAgICAgKHNl dHEtbG9jYWwgaHNjcm9sbC1zdGVwIDUpCisgICAgICAoc2V0cSBidWZmZXItZGlzcGxheS10YWJs ZSArLWJ1ZmZlci1kaXNwbGF5LXRhYmxlKQorICAgICAgKHNldHEgdGFiLXdpZHRoIDQpCisgICAg ICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICdsaW5lLW1vdmUtdmlzdWFsKSB0KQorICAgICAg KHNldHEgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgKGNvbmQKKyAgICAgICAgICAoKGxldCAoKGxz dCArLXRydW5jYXRlLWxpbmVzLWRlcml2ZWQtbW9kZXMpCisgICAgICAgICAgICAgICAgICBtb2Rl KQorICAgICAgICAgICAgKGNhdGNoICdmb3VuZAorICAgICAgICAgICAgICAod2hpbGUgKHNldHEg bW9kZSAocG9wIGxzdCkpCisgICAgICAgICAgICAgICAgKHdoZW4gKGRlcml2ZWQtbW9kZS1wIG1v ZGUpCisgICAgICAgICAgICAgICAgICAodGhyb3cgJ2ZvdW5kIHQpKSkpKSkKKyAgICAgICAgICAg KChtZW1xIG1ham9yLW1vZGUgKy10cnVuY2F0ZS1saW5lcy1tYWpvci1tb2RlcykpCisgICAgICAg ICAgICh0CisgICAgICAgICAgICAgbmlsKSkpCisgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlh YmxlICd0cnVuY2F0ZS1wYXJ0aWFsLXdpZHRoLXdpbmRvd3MpIG5pbCkKKyAgICAgIChzZXRxIHdv cmQtd3JhcCB0KQorICAgICAgKHNldHEgaW5kaWNhdGUtZW1wdHktbGluZXMgdCkKKyAgICAgIChz ZXRxIGluZGljYXRlLWJ1ZmZlci1ib3VuZGFyaWVzICdsZWZ0KQorICAgICAgKHNldHEgZnJpbmdl LWluZGljYXRvci1hbGlzdAorICAgICAgICAgIDs7OyBoc2NsX2FsbF90ZW1wX3AgfCBoc2NsX3Rl bXBfcAorICAgICAgICAnKCgrLWhzY2wtdGVtcCAuICgrLXNpbmdsZS1hbmdsZS1sZWZ0CisgICAg ICAgICAgICAgICAgICAgICAgICAgICstZG91YmxlLWFuZ2xlLWxlZnQpKQorICAgICAgICAgIDs7 OyBoc2NsX2FsbF9wZXJtXzBfcCB8IGhzY2xfYWxsX3Blcm1fMV9wIHwgaHNjbF9hbGxfcGVybV8y X3AgfCBoc2NsX3Blcm1fcAorICAgICAgICAgICgrLWhzY2wtcGVybSAuICgrLXNpbmdsZS1hbmds ZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLWRvdWJsZS1hbmdsZS11cAorICAgICAg ICAgICAgICAgICAgICAgICAgICArLXRyaXBsZS1hbmdsZS11cAorICAgICAgICAgICAgICAgICAg ICAgICAgICArLXF1YWRydXBsZS1hbmdsZS11cCkpCisgICAgICAgICAgKCstb3ZlcmxheS1hcnJv dyAuICgrLWZyaW5nZS1sZWZ0LWFycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAr LWZyaW5nZS1yaWdodC1hcnJvdykpCisgICAgICAgICAgKHRydW5jYXRpb24gLiAoKy1mcmluZ2Ut bGVmdC1hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICstZnJpbmdlLXJpZ2h0LWFycm93 KSkKKyAgICAgICAgICAoY29udGludWF0aW9uIC4gKCstZnJpbmdlLWxlZnQtY3VybHktYXJyb3cK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICstYmFja3NsYXNoKSkKKyAgICAgICAgICAob3Zl cmxheS1hcnJvdyAuICstZnJpbmdlLXJpZ2h0LXRyaWFuZ2xlKQorICAgICAgICAgICh1cCAuICst ZnJpbmdlLXVwLWFycm93KQorICAgICAgICAgIChkb3duIC4gKy1mcmluZ2UtZG93bi1hcnJvdykK KyAgICAgICAgICAodG9wIC4gKy1mcmluZ2UtdG9wLWxlZnQtYW5nbGUpCisgICAgICAgICAgKGJv dHRvbSAuICstZnJpbmdlLWJvdHRvbS1yaWdodC1hbmdsZSkKKyAgICAgICAgICAodG9wLWJvdHRv bSAuICgrLWZyaW5nZS1sZWZ0LWJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICArLWZy aW5nZS1yaWdodC1icmFja2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgKy1mcmluZ2UtdG9w LXJpZ2h0LWFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgKy1mcmluZ2UtdG9wLWxlZnQt YW5nbGUpKQorICAgICAgICAgIChlbXB0eS1saW5lIC4gKy1mcmluZ2UtZW1wdHktbGluZSkKKyAg ICAgICAgICAodW5rbm93biAuICstZnJpbmdlLXF1ZXN0aW9uLW1hcmspKSkKKyAgICAgIChzZXRx IGZyaW5nZS1jdXJzb3ItYWxpc3QgJygoYm94IC4gKy1mcmluZ2UtbGVmdC10cmlhbmdsZSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaG9sbG93IC4gKy1ob2xsb3ctcmVjdGFu Z2xlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChiYXIgLiArLXZlcnRpY2Fs LWJhcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaGJhciAuICstZnJpbmdl LWhvcml6b250YWwtYmFyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChob2xs b3ctc21hbGwgLiArLWZyaW5nZS1ob2xsb3ctc3F1YXJlKSkpCisgICAgICAoaWYgKG9yICstZm9y dGh3aXRoCisgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisg ICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJhdy1mb3J0aHdpdGggJ2Fw cGVuZCAnbG9jYWwpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJh dy1jcm9zc2hhaXJzICdhcHBlbmQgJ2xvY2FsKSkKKyAgICAgICh3aGVuICstZm9ydGh3aXRoCisg ICAgICAgIChhZGQtaG9vayAnd2luZG93LWNvbmZpZ3VyYXRpb24tY2hhbmdlLWhvb2sgJystZHJh dy1mb3J0aHdpdGggbmlsICdsb2NhbCkpCisgICAgICAoYWRkLWhvb2sgJ2NoYW5nZS1tYWpvci1t b2RlLWhvb2sgJ3R1cm4tb2ZmLSstbW9kZSBuaWwgJ2xvY2FsKQorICAgICAgKHdoZW4gKGNhbGxl ZC1pbnRlcmFjdGl2ZWx5LXAgJ2FueSkKKyAgICAgICAgKGNvbmQKKyAgICAgICAgICAoKy1mb3J0 aHdpdGgKKyAgICAgICAgICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScgLS0gRHJhdyBt YXRjaGluZyBwYXJlbnRoZXNlcyBpbW1lZGlhdGVseS4iKSkKKyAgICAgICAgICAoKGVxdWFsIGN1 cnJlbnQtcHJlZml4LWFyZyAnKDQpKQorICAgICAgICAgICAgOzs7IE1hdGNoaW5nIHBhcmVudGhl c2VzIHdpbGwgYmUgZHJhd24gaW1tZWRpYXRlbHkuCisgICAgICAgICAgICAobWVzc2FnZSAiVHVy bmVkIE9OIGArLW1vZGUnIC0tIE9wdGltaXplZCBmb3IgZGVidWdnaW5nIHB1cnBvc2VzLiIpKQor ICAgICAgICAgICh0CisgICAgICAgICAgICAobWVzc2FnZSAiVHVybmVkIE9OIGArLW1vZGUnLiIp KSkpKQorICAgICh0CisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnZmlsbC1jb2x1bW4pCisg ICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZS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HdpdGgpCisg ICAgICAoZG9saXN0IChzYXZlZCArLS1zYXZlZC1zdGF0ZSkKKyAgICAgICAgKHNldCAobWFrZS1s b2NhbC12YXJpYWJsZSAoY2FyIHNhdmVkKSkgKGNkciBzYXZlZCkpKQorICAgICAgKGtpbGwtbG9j YWwtdmFyaWFibGUgJystLXNhdmVkLXN0YXRlKQorICAgICAgKCstZGVsZXRlLXBhcmVucy1vdmVy bGF5cykKKyAgICAgICh3aGVuIChtZW1xICcrLWRyYXctZm9ydGh3aXRoIHBvc3QtY29tbWFuZC1o b29rKQorICAgICAgICAocmVtb3ZlLWhvb2sgJ3Bvc3QtY29tbWFuZC1ob29rICcrLWRyYXctZm9y dGh3aXRoICdsb2NhbCkpCisgICAgICAod2hlbiAobWVtcSAnKy1kcmF3LWNyb3NzaGFpcnMgcG9z dC1jb21tYW5kLWhvb2spCisgICAgICAgIChyZW1vdmUtaG9vayAncG9zdC1jb21tYW5kLWhvb2sg JystZHJhdy1jcm9zc2hhaXJzICdsb2NhbCkpCisgICAgICAod2hlbiAobWVtcSAnKy1kcmF3LWZv cnRod2l0aCB3aW5kb3ctY29uZmlndXJhdGlvbi1jaGFuZ2UtaG9vaykKKyAgICAgICAgKHJlbW92 ZS1ob29rICd3aW5kb3ctY29uZmlndXJhdGlvbi1jaGFuZ2UtaG9vayAnKy1kcmF3LWZvcnRod2l0 aCAnbG9jYWwpKQorICAgICAgKHJlbW92ZS1ob29rICdjaGFuZ2UtbWFqb3ItbW9kZS1ob29rICd0 dXJuLW9mZi0rLW1vZGUgJ2xvY2FsKQorICAgICAgKHdoZW4gKy10aW1lci12YXIKKyAgICAgICAg KHNldHEgdGltZXItaWRsZS1saXN0IChkZWxxICstdGltZXItdmFyIHRpbWVyLWlkbGUtbGlzdCkp CisgICAgICAgIChzZXRxICstdGltZXItdmFyIG5pbCkpCisgICAgICAod2hlbiAoY2FsbGVkLWlu dGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAobWVzc2FnZSAiVHVybmVkIE9GRiBgKy1tb2Rl Jy4iKSkpKSkKKworKGRlZnVuIHR1cm4tb2ZmLSstbW9kZSAoKQorICAoKy1tb2RlIC0xKSkKKwor Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7CisKKyhkZWZ1biArLXBhcmVucy1mbiAoKQorICAiRG9j LXN0cmluZy4iCisgIChsZXQqICgob3BvaW50IChwb2ludCkpCisgICAgICAgICAoZnJvbSAoaWYg Ky1wYXJlbnMtZnJvbS1mbgorICAgICAgICAgICAgICAgICAoZnVuY2FsbCArLXBhcmVucy1mcm9t LWZuKQorICAgICAgICAgICAgICAgICAocG9pbnQtbWluKSkpCisgICAgICAgICAod2luIChzZWxl Y3RlZC13aW5kb3cpKQorICAgICAgICAgKGkgMCkKKyAgICAgICAgIChwcmVjZWRpbmctY2hhciAo cHJlY2VkaW5nLWNoYXIpKQorICAgICAgICAgKG9jaGFyIChjaGFyLWFmdGVyIG9wb2ludCkpCisg ICAgICAgICAocG9zMQorICAgICAgICAgICAoY29uZAorICAgICAgICAgICAgICgoYW5kIG9jaGFy CisgICAgICAgICAgICAgICAgICAgKG9yIDs7OyAoY2hhci10by1zdHJpbmcgNDApID0+IG9wZW5p bmcgcGFyZW50aGVzaXMKKyAgICAgICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgNDApCisgICAg ICAgICAgICAgICAgICAgICAgIDs7OyAoY2hhci10by1zdHJpbmcgOTEpID0+IG9wZW5pbmcgc3F1 YXJlIGJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgOTEpCisgICAgICAg ICAgICAgICAgICAgICAgIDs7OyAoY2hhci10by1zdHJpbmcgMTIzKSA9PiBvcGVuaW5nIHdhdnkg YnJhY2tldAorICAgICAgICAgICAgICAgICAgICAgICAoPSBvY2hhciAxMjMpKSkKKyAgICAgICAg ICAgICAgICAobWluICgxKyBvcG9pbnQpIChwb2ludC1tYXgpKSkKKyAgICAgICAgICAgICAoKG9y IDs7OyAoY2hhci10by1zdHJpbmcgNDEpID0+IGNsb3NpbmcgcGFyZW50aGVzaXMKKyAgICAgICAg ICAgICAgICAgICg9IHByZWNlZGluZy1jaGFyIDQxKQorICAgICAgICAgICAgICAgICAgOzs7IChj aGFyLXRvLXN0cmluZyA5MykgPT4gY2xvc2luZyBzcXVhcmUgYnJhY2tldAorICAgICAgICAgICAg ICAgICAgKD0gcHJlY2VkaW5nLWNoYXIgOTMpCisgICAgICAgICAgICAgICAgICA7OzsgKGNoYXIt dG8tc3RyaW5nIDEyNSkgPT4gY2xvc2luZyB3YXZ5IGJyYWNrZXQKKyAgICAgICAgICAgICAgICAg ICg9IHByZWNlZGluZy1jaGFyIDEyNSkpCisgICAgICAgICAgICAgICAgKG1heCAocG9pbnQtbWlu KSAoMS0gb3BvaW50KSkpCisgICAgICAgICAgICAgKHQKKyAgICAgICAgICAgICAgICBvcG9pbnQp KSkKKyAgICAgICAgIHBvczIKKyAgICAgICAgIHNlbGVjdGVkLWZhY2UpCisgICAgKHNhdmUtZXhj dXJzaW9uCisgICAgICAoY29uZGl0aW9uLWNhc2UgbmlsCisgICAgICAgICh3aGlsZSAoc2V0cSBw b3MxIChudGggMSAocGFyc2UtcGFydGlhbC1zZXhwIGZyb20gcG9zMSkpKQorICAgICAgICAgIChz ZXRxIHBvczIgKHNjYW4tc2V4cHMgcG9zMSAxKSkKKyAgICAgICAgICAoaWYgKD0gaSAxMCkKKyAg ICAgICAgICAgIChzZXRxIGkgMSkKKyAgICAgICAgICAgIChzZXRxIGkgKDErIGkpKSkKKyAgICAg ICAgICAoc2V0cSBzZWxlY3RlZC1mYWNlIChjb25kCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICgoPSBpIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFy ZW5zLW9uZS1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSAyKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy10d28tZmFjZSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgMykKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtdGhyZWUtZmFjZSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgKCg9IGkgNCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAnKy1wYXJlbnMtZm91ci1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo KD0gaSA1KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1maXZl LWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDYpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLXNpeC1mYWNlKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA3KQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICcrLXBhcmVucy1zZXZlbi1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAoKD0gaSA4KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBh cmVucy1laWdodC1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA5 KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1uaW5lLWZhY2Up CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDEwKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy10ZW4tZmFjZSkpKQorICAgICAgICAgIChs ZXQgKChvdiAobWFrZS1vdmVybGF5IH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KSkK KyAgICAgICAgIChlbmQKKyAgICAgICAgICAgKGNvbmQKKyAgICAgICAgICAgICAoKGFuZAorICAg ICAgICAgICAgICAgICAobm90IG5hcnJvd2VkLXApCisgICAgICAgICAgICAgICAgIGVuZCkKKyAg ICAgICAgICAgICAgIGVuZCkKKyAgICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAo bm90IG5hcnJvd2VkLXApCisgICAgICAgICAgICAgICAgIChudWxsIGVuZCkpCisgICAgICAgICAg ICAgICBwb2ludC1tYXgpCisgICAgICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFy cm93ZWQtcAorICAgICAgICAgICAgICAgICBlbmQKKyAgICAgICAgICAgICAgICAgKDwgZW5kIHBv aW50LW1heCkpCisgICAgICAgICAgICAgICBlbmQpCisgICAgICAgICAgICAgKChhbmQKKyAgICAg ICAgICAgICAgICAgbmFycm93ZWQtcAorICAgICAgICAgICAgICAgICBlbmQKKyAgICAgICAgICAg ICAgICAgKD0gZW5kIHBvaW50LW1heCkpCisgICAgICAgICAgICAgICAoMSsgZW5kKSkKKyAgICAg ICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICBuYXJyb3dlZC1wCisgICAgICAgICAgICAg ICAgIChudWxsIGVuZCkpCisgICAgICAgICAgICAgICAoMSsgcG9pbnQtbWF4KSkgKSkKKyAgICAg ICAgIChvdmVybGF5cworICAgICAgICAgICAocHJvZ24KKyAgICAgICAgICAgICAob3ZlcmxheS1y ZWNlbnRlciBlbmQpCisgICAgICAgICAgICAgKG92ZXJsYXlzLWluIGJlZyBlbmQpKSkpCisgICAg KHdoZW4gKGFuZCBiZWcgZW5kIG5hbWUgdmFsKQorICAgICAgKGRvbGlzdCAobyBvdmVybGF5cykK KyAgICAgICAgKGNvbmQKKyAgICAgICAgICAoKGFuZCAoZXEgbmFtZSAnZmFjZSkKKyAgICAgICAg ICAgICAgICAoZXEgKG92ZXJsYXktZ2V0IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIDs7IEVp dGhlciBwdXNoIHRoaXMgb3ZlcmxheSBvdXRzaWRlIGJlZy4uLmVuZAorICAgICAgICAgICAgOzsg b3Igc3BsaXQgaXQgdG8gZXhjbHVkZSBiZWcuLi5lbmQKKyAgICAgICAgICAgIDs7IG9yIGRlbGV0 ZSBpdCBlbnRpcmVseSAoaWYgaXQgaXMgY29udGFpbmVkIGluIGJlZy4uLmVuZCkuCisgICAgICAg ICAgICAoaWYgKDwgKG92ZXJsYXktc3RhcnQgbykgYmVnKQorICAgICAgICAgICAgICAgIChpZiAo PiAob3ZlcmxheS1lbmQgbykgZW5kKQorICAgICAgICAgICAgICAocHJvZ24KKyAgICAgICAgICAg ICAgICAobW92ZS1vdmVybGF5IChjb3B5LW92ZXJsYXkgbykKKyAgICAgICAgICAgICAgICAgIChv dmVybGF5LXN0YXJ0IG8pIGJlZykKKyAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gZW5k IChvdmVybGF5LWVuZCBvKSkpCisgICAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gKG92 ZXJsYXktc3RhcnQgbykgYmVnKSkKKyAgICAgICAgICAgICAgKGlmICg+IChvdmVybGF5LWVuZCBv KSBlbmQpCisgICAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVu ZCBvKSkKKyAgICAgICAgICAgICAgICAoZGVsZXRlLW92ZXJsYXkgbykpKSkKKyAgICAgICAgICAo KGFuZCAobm90IChlcSBuYW1lICdmYWNlKSkKKyAgICAgICAgICAgICAgICAoZXF1YWwtaW5jbHVk aW5nLXByb3BlcnRpZXMgKG92ZXJsYXktZ2V0IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIChk ZWxldGUtb3ZlcmxheSBvKSkpKSkpKQorCisoZGVmdW4gKy1kZWxldGUtcGFyZW5zLW92ZXJsYXlz ICgpCisgICh3aGVuICstcGFyZW5zLW92ZXJsYXlzLWV4aXN0LXAKKyAgICA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ZS4iKQorCis7OzsjIyNhdXRvbG9hZAorKGRlZmluZS1taW5vci1tb2Rl IGZjLW1vZGUKKyJNaW5vciBtb2RlIGZvciBkaXNwbGF5aW5nIGEgdmlzdWFsIGZpbGwgY29sdW1u LiIKKyAgOmluaXQtdmFsdWUgbmlsCisgIDpsaWdodGVyICIgRkMiCisgIDprZXltYXAgbmlsCisg IDpnbG9iYWwgbmlsCisgIDpncm91cCAnZmMtbW9kZQorICAoY29uZAorICAgIDs7OyBgKy1tb2Rl JyBoYXMgdGhlIGFiaWxpdHkgdG8gYWxzbyBkaXNwbGF5IGEgZmlsbCBjb2x1bW4gaW5kaWNhdG9y LgorICAgIDs7OyBTZWUgdGhlIHZhcmlhYmxlIGArLWZpbGwtY29sdW1uJy4KKyAgICAoKGFuZCBm Yy1tb2RlICstbW9kZSkKKyAgICAgIChzZXRxIGZjLW1vZGUgbmlsKQorICAgICAgKG1lc3NhZ2Ug IlR1cm5lZCBPRkYgYGZjLW1vZGUnICglcykgLS0gc2VlIHRoZSB2YXJpYWJsZSBgKy1maWxsLWNv bHVtbicuIiAoY3VycmVudC1idWZmZXIpKSkKKyAgICAoZmMtbW9kZQorICAgICAgKHdoZW4gKGFu ZCBnbG9iYWwtZWxkb2MtbW9kZQorICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZl bHktcCAnYW55KQorICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICco NCkpKQorICAgICAgICAoZ2xvYmFsLWVsZG9jLW1vZGUgLTEpKQorICAgICAgKHdoZW4gKGFuZCBq aXQtbG9jay1jb250ZXh0LXRpbWVyCisgICAgICAgICAgICAgICAgIChjYWxsZWQtaW50ZXJhY3Rp dmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcg Jyg0KSkpCisgICAgICAgICh3aGVuICh0aW1lcnAgaml0LWxvY2stY29udGV4dC10aW1lcikKKyAg ICAgICAgICAoY2FuY2VsLXRpbWVyIGppdC1sb2NrLWNvbnRleHQtdGltZXIpKQorICAgICAgICA7 OyAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIChydW4td2l0aC1pZGxlLXRpbWVyIDUuMCAn cmVwZWF0ICdqaXQtbG9jay1jb250ZXh0LWZvbnRpZnkpKQorICAgICAgICAoc2V0cSBqaXQtbG9j ay1jb250ZXh0LXRpbWVyIG5pbCkpCisgICAgICAod2hlbiAoYW5kIChjYWxsZWQtaW50ZXJhY3Rp dmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcg Jyg0KSkpCisgICAgICAgICh3aGVuICh0aW1lcnAgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnkt dGltZXIpCisgICAgICAgICAgKGNhbmNlbC10aW1lciB1bmRvLWF1dG8tY3VycmVudC1ib3VuZGFy eS10aW1lcikpCisgICAgICAgIChmc2V0ICd1bmRvLWF1dG8tLXVuZG9hYmxlLWNoYW5nZQorICAg ICAgICAgICAgICAobGFtYmRhICgpIChhZGQtdG8tbGlzdCAndW5kby1hdXRvLS11bmRvYWJseS1j aGFuZ2VkLWJ1ZmZlcnMgKGN1cnJlbnQtYnVmZmVyKSkpKQorICAgICAgICAoZnNldCAndW5kby1h dXRvLWFtYWxnYW1hdGUgJ2lnbm9yZSkpCisgICAgICAod2hlbiBibGluay1jdXJzb3ItbW9kZQor ICAgICAgICAoYmxpbmstY3Vyc29yLW1vZGUgLTEpCisgICAgICAgICh3aGVuIChtZW1xICdibGlu ay1jdXJzb3ItY2hlY2sgcG9zdC1jb21tYW5kLWhvb2spCisgICAgICAgICAgKHJlbW92ZS1ob29r ICdwb3N0LWNvbW1hbmQtaG9vayAnYmxpbmstY3Vyc29yLWNoZWNrKSkpCisgICAgICAoc2V0cSBm Yy12aXNpYmxlIHQpCisgICAgICA7OzsgYGF1dG8tY29tcG9zaXRpb24tbW9kZScgaXMgbmV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HNjbC1pbmFjdGl2ZS1mYWNlCisgICco KHQgKDpmb3JlZ3JvdW5kICJEYXJrU2xhdGVHcmV5IikpKQorICAiRmFjZSBmb3IgYCstb3Zlcmxh eS1hcnJvdy1oc2NsLWluYWN0aXZlLWZhY2UnLiIKKyAgOmdyb3VwICcrLW1vZGUpCisKKyhkZWZm YWNlIGZjLWZhY2UKKyAgJygoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgODgpIChiYWNrZ3Jv dW5kIGRhcmspICh0eXBlIG5zKSkKKyAgICAgOmZvcmVncm91bmQgImdyZXkxNSIpCisgICAgKCgo Y2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBkYXJrKSAodHlwZSBndGsp KQorICAgICAgICAgOmZvcmVncm91bmQgImdyZXkxNSIpCisgICAgKCgoY2xhc3MgY29sb3IpICht aW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBkYXJrKSAodHlwZSB3MzIpKQorICAgICAgICAgOmZv cmVncm91bmQgImdyZXkyNSIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAo YmFja2dyb3VuZCBsaWdodCkgKHR5cGUgZ3RrKSkKKyAgICAgOmZvcmVncm91bmQgInB1cnBsZSIp CisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBsaWdodCkg KHR5cGUgbnMpKQorICAgICA6Zm9yZWdyb3VuZCAicHVycGxlIikKKyAgICAoKChjbGFzcyBjb2xv cikgKG1pbi1jb2xvcnMgODgpIChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQg InB1cnBsZSIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDE2KSAoYmFja2dyb3Vu ZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgInllbGxvdyIpCisgICAgKCgoY2xhc3MgY29sb3Ip IChtaW4tY29sb3JzI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G9jYWxfZmxhZ3MsIGZjX2luYWN0aXZlX3dpbmRvd3MpLCBpZHgpOyAr K2lkeDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBYU0VURkFTVElOVCAoQlZB UiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgbW9kZV9saW5lX2Zvcm1hdCksIGlkeCk7ICsraWR4Owog ICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgYWJicmV2X21vZGUpLCBp ZHgpOyArK2lkeDsKICAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIG92 ZXJ3cml0ZV9tb2RlKSwgaWR4KTsgKytpZHg7CkBAIC01MjI4LDYgKzUzMDksMjQgQEAgaW5pdF9i dWZmZXJfb25jZSAodm9pZCkKICAgLyogTXVzdCBkbyB0aGVzZSBiZWZvcmUgbWFraW5nIHRoZSBm aXJzdCBidWZmZXIhICovCiAKICAgLyogcmVhbCBzZXR1cCBpcyBkb25lIGluIGJpbmRpbmdzLmVs ICovCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKyAgYnNldF9tY19yZWFsX2Zha2VfY3Vyc29yICgmYnVmZmVyX2RlZmF1bHRzLCBRaG9sbG93 KTsKKyAgYnNldF9tY19jb25mICgmYnVmZmVyX2RlZmF1bHRzLCBRbmlsKTsKKyAgYnNldF9tY19p bmFjdGl2ZV93aW5kb3dzICgmYnVmZmVyX2RlZmF1bHRzLCBRdCk7CisgIGJzZXRfY3Jvc3NoYWly cyAoJmJ1ZmZlcl9kZWZhdWx0cywgUW5pbCk7CisgIGJzZXRfY2hfaG9yaXpvbnRhbF9ydWxlciAo JmJ1ZmZlcl9kZWZhdWx0cywgUXQpOworICBic2V0X2NoX3ZlcnRpY2FsX3J1bGVyICgmYnVmZmVy X2RlZmF1bHRzLCBRdCk7CisgIGJzZXRfY2hfaW5hY3RpdmVfd2luZG93cyAoJmJ1ZmZlcl9kZWZh dWx0cywgUXQpOworICBic2V0X2ZjX3Zpc2libGUgKCZidWZmZXJfZGVmYXVsdHMsIFFuaWwpOwor ICBic2V0X2ZjX2luYWN0aXZlX3dpbmRvd3MgKCZidWZmZXJfZGVmYXVsdHMsIFF0KTsKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogICBic2V0X21vZGVfbGluZV9mb3JtYXQgKCZidWZm ZXJfZGVmYXVsdHMsIGJ1aWxkX3B1cmVfY19zdHJpbmcgKCIlLSIpKTsKICAgYnNldF9oZWFkZXJf bGluZV9mb3JtYXQgKCZidWZmZXJfZGVmYXVsdHMsIFFuaWwpOwogICBic2V0X2FiYnJldl9tb2Rl ICgmYnVmZmVyX2RlZmF1bHRzLCBRbmlsKTsKQEAgLTU0NTgsNiArNTU1Nyw1MSBAQCBkZWZ2YXJf cGVyX2J1ZmZlciAoc3RydWN0IExpc3BfQnVmZmVyX09iamZ3ZCAqYm9fZndkLCBjb25zdCBjaGFy ICpuYW1lc3RyaW5nLAogdm9pZAogc3ltc19vZl9idWZmZXIgKHZvaWQpCiB7CisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgREVGU1lNIChR bWNfcmVhbF9mYWtlX2N1cnNvciwgIm1jLXJlYWwtZmFrZS1jdXJzb3IiKTsKKyAgREVGVkFSX1BF Ul9CVUZGRVIgKCJtYy1yZWFsLWZha2UtY3Vyc29yIiwgJkJWQVIgKGN1cnJlbnRfYnVmZmV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yogQSBidWZlci1sb2NhbCB2YXJpYWJsZSB0byB0 dXJuIG9uL29mZiB0aGUgbXVsdGlwbGUgY3Vyc29ycyBmaWxsIGNvbHVtbi4gKi8pOworCisgIERF RlNZTSAoUWZjX3Zpc2libGVfaW5hY3RpdmVfd2luZG93LCAiZmMtaW5hY3RpdmUtd2luZG93Iik7 CisgIERFRlZBUl9QRVJfQlVGRkVSICgiZmMtaW5hY3RpdmUtd2luZG93cyIsICZCVkFSIChjdXJy ZW50X2J1ZmZlciwgZmNfaW5hY3RpdmVfd2luZG93cyksIFFuaWwsCisgICAgZG9jOiAvKiBXaGVu IG5vbi1uaWwsIGRyYXcgbXVsdGlwbGUgY3Vyc29ycyBmaWxsIGNvbHVtbiBpbiBpbmFjdGl2ZSB3 aW5kb3dzLiAqLyk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgc3RhdGljcHJv ICgmbGFzdF9vdmVybGF5X21vZGlmaWNhdGlvbl9ob29rcyk7CiAgIGxhc3Rfb3ZlcmxheV9tb2Rp ZmljYXRpb25faG9va3MgPSBtYWtlX25pbF92ZWN0b3IgKDEwKTsKIApkaWZmIC0tZ2l0IGEvc3Jj L2J1ZmZlci5oIGIvc3JjL2J1ZmZlci5oCmluZGV4IGY0MmMzZTkuLjE4OWZhYzUgMTAwNjQ0Ci0t LSBhL3NyYy9idWZmZXIuaAorKysgYi9zcmMvYnVmZmVyLmgKQEAgLTczNiw2ICs3MzYsNDAgQEAg c3RydWN0IGJ1ZmZlcgogICAgICBpbiB0aGUgZGlzcGxheSBvZiB0aGlzIGJ1ZmZlci4gICovCiAg IExpc3BfT2JqZWN0IGV4dHJhX2xpbmVfc3BhY2luZ187CiAKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUx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plY3QgZmNfaW5hY3Rp dmVfd2luZG93c187CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogQ3Vyc29y IHR5cGUgdG8gZGlzcGxheSBpbiBub24tc2VsZWN0ZWQgd2luZG93cy4KICAgICAgdCBtZWFucyB0 byB1c2UgaG9sbG93IGJveCBjdXJzb3IuCiAgICAgIFNlZSBgY3Vyc29yLXR5cGUnIGZvciBvdGhl ciB2YWx1ZXMuICAqLwpAQCAtNzg3LDE0ICs4MjEsMjEgQEAgc3RydWN0IGJ1ZmZlcgogICAgICBh biBpbmRpcmVjdCBidWZmZXIgc2luY2UgaXQgY291bnRzIGFzIGl0cyBiYXNlIGJ1ZmZlci4gICov CiAgIGludCB3aW5kb3dfY291bnQ7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBN VUxUSVBMRS1DVVJTT1JTICovCisKICAgLyogQSBub24temVybyB2YWx1ZSBpbiBzbG90IElEWCBt ZWFucyB0aGF0IHBlci1idWZmZXIgdmFyaWFibGUKICAgICAgd2l0aCBpbmRleCBJRFggaGFzIGEg bG9jYWwgdmFsdWUgaW4gdGhpcyBidWZmZXIuICBUaGUgaW5kZXggSURYCiAgICAgIGZvciBhIGJ1 ZmZlci1sb2NhbCB2YXJpYWJsZSBpcyBzdG9yZWQgaW4gdGhhdCB2YXJpYWJsZSdzIHNsb3QKICAg ICAgaW4gYnVmZmVyX2xvY2FsX2ZsYWdzIGFzIGEgTGlzcCBpbnRlZ2VyLiAgSWYgdGhlIGluZGV4 IGlzIC0xLAogICAgICB0aGlzIG1lYW5zIHRoZSB2YXJpYWJsZSBpcyBhbHdheXMgbG9jYWwgaW4g YWxsIGJ1ZmZlcnMuICAqLwotI2RlZmluZSBNQVhfUEVSX0JVRkZFUl9WQVJTIDUwCisjZGVmaW5l IE1BWF9QRVJfQlVGRkVSX1ZBUlMgNjAKICAgY2hhciBsb2NhbF9mbGFnc1tNQVhfUEVSX0JVRkZF Ul9WQVJTXTsKIAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBTZXQgdG8gdGhl IG1vZHRpbWUgb2YgdGhlIHZpc2l0ZWQgZmlsZSB3aGVuIHJlYWQgb3Igd3JpdHRlbi4KICAgICAg bW9kdGltZS50dl9uc2VjID09IE5PTkVYSVNURU5UX01PRFRJTUVfTlNFQ1MgbWVhbnMKICAgICAg dmlzaXRlZCBmaWxlIHdhcyBub25leGlzdGVudC4gIG1vZHRpbWUudHZfbnNlYyA9PQpAQCAtOTAz LDYgKzk0NCw2OSBAQCBYQlVGRkVSIChMaXNwX09iamVjdCBhKQogLyogTW9zdCBjb2RlIHNob3Vs ZCB1c2UgdGhlc2UgZnVuY3Rpb25zIHRvIHNldCBMaXNwIGZpZWxkcyBpbiBzdHJ1Y3QKICAgIGJ1 ZmZlci4gIChTb21lIHNldHRlcnMgdGhhdCBhcmUgcHJpdmF0ZSB0byBhIHNpbmdsZSAuYyBmaWxl IGFyZQogICAgZGVmaW5lZCBhcyBzdGF0aWMgaW4gdGhvc2UgZmlsZXMuKSAgKi8KKworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExFLUNVUlNPUlMgKi8KKworSU5M SU5FIHZvaWQKK2JzZXRfYmx2X21jX3JlYWxfZmFrZV9jdXJzb3IgKHN0cnVjdCBidWZmZXIgKmIs IExpc3BfT2JqZWN0IHZhbCkKK3sKKyAgYi0+bWNfcmVhbF9mYWtlX2N1cnNvcl8gPSB2YWw7Cit9 CisKK0lOTElORSB2b2lkCitic2V0X2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gYnVmZmVyICpiLCBMaXNwX09i amVjdCB2YWwpCit7CisgIGItPmZjX2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQorCisvKiBl bmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogSU5M SU5FIHZvaWQKIGJzZXRfYmlkaV9wYXJhZ3JhcGhfZGlyZWN0aW9uIChzdHJ1Y3QgYnVmZmVyICpi LCBMaXNwX09iamVjdCB2YWwpCiB7CmRpZmYgLS1naXQgYS9zcmMvZGlzcGV4dGVybi5oIGIvc3Jj L2Rpc3BleHRlcm4uaAppbmRleCAxYTUzNjU2Li5kNjg5YTJkIDEwMDY0NAotLS0gYS9zcmMvZGlz cGV4dGVybi5oCisrKyBiL3NyYy9kaXNwZXh0ZXJuLmgKQEAgLTEwMCw2ICsxMDAsMzYgQEAgdHlw ZWRlZiBpbnQgQ3Vyc29yOwogI2RlZmluZSBOYXRpdmVSZWN0YW5nbGUgaW50CiAjZW5kaWYKIAor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExFLUNVUlNPUlMgKi8K KworLyogRm9yd2FyZCBwcm90b3R5cGUgZGVmaW5pdGlvbnMuICovCitlbnVtIHR5cGVfb2ZfY2Fj aGU7CisKK2VudW0gdHlwZV9vZl9jdXJzb3I7CisKK2VudW0gbWNfZmxhdm9yOworCitlbnVtIHR5 cGVfb2ZfYWN0aW9uCit7CisgIE1VTFRJUExFX0NVUlNPUlMsCisgIEhPUklaT05UQUxfUlVMRVIs CisgIFZFUlRJQ0FMX1JVTEVSLAorICBGSUxMX0NPTFVNTgorfTsKKworc3RydWN0IG1jX1JHQgor eworICBkb3VibGUgcmVkOworICBkb3VibGUgZ3JlZW47CisgIGRvdWJsZSBibHVlOworfTsKKwor LyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK IC8qIFRleHQgY3Vyc29yIHR5cGVzLiAgKi8KIAogZW51bSB0ZXh0X2N1cnNvcl9raW5kcwpAQCAt MzgyLDYgKzQxMiwyMCBAQCBzdHJ1Y3QgZ2x5cGhfc2xpY2UKIAogc3RydWN0IGdseXBoCiB7CisK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAg aW50IHgsIHksIGhwb3MsIHZwb3M7CisKKyAgaW50IHJlbGF0aXZlX3g7CisKKyAgYm9vbF9iZiB6 dl9wIDogMTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBQb3NpdGlvbiBm cm9tIHdoaWNoIHRoaXMgZ2x5cGggd2FzIGRyYXduLiAgSWYgYG9iamVjdCcgYmVsb3cgaXMgYQog ICAgICBMaXNwIHN0cmluZywgdGhpcyBpcyBhbiBpbmRleCBpbnRvIHRoYXQgc3RyaW5nLiAgSWYg aXQgaXMgYQogICAgICBidWZmZXIsIHRoaXMgaXMgYSBwb3NpdGlvbiBpbiB0aGF0IGJ1ZmZlci4g IEluIGFkZGl0aW9uLCBzb21lCkBAIC0xMjQ4LDYgKzEyOTIsMjggQEAgZW51bSBkcmF3X2dseXBo c19mYWNlCiAKIHN0cnVjdCBnbHlwaF9zdHJpbmcKIHsKKworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIGJvb2xfYmYgbGVmdF9vdmVyd3Jp dHRlbl9wIDogMTsKKworICAgIGJvb2xfYmYgcmlnaHRfb3ZlcndyaXR0ZW5fcCA6IDE7CisKKyAg ICBib29sX2JmIHJlY3RhbmdsZV9udWtlZF9wIDogMTsKKworICAgIGJvb2xfYmYgYmFja2dyb3Vu ZF9udWtlZF9wIDogMTsKKworICAgIGVudW0gZHJhd19nbHlwaF9hY3Rpb24KKyAgICB7CisgICAg ICBNQ19EUkFXX0dMWVBILAorICAgICAgTUNfRVJBU0VfR0xZUEgKKyAgICB9IGFjdGlvbl90eXBl OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIFgtb3JpZ2luIG9mIHRoZSBz dHJpbmcuICAqLwogICBpbnQgeDsKIApAQCAtMjIxNiw2ICsyMjgyLDE2IEBAIHN0cnVjdCBjb21w b3NpdGlvbl9pdAogCiBzdHJ1Y3QgaXQKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBib29sX2JmIHp2X3AgOiAxOworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKworCiAgIC8qIFRoZSB3aW5kb3cgaW4gd2hpY2ggd2UgaXRlcmF0 ZSBvdmVyIGN1cnJlbnRfYnVmZmVyIChvciBhIHN0cmluZykuICAqLwogICBMaXNwX09iamVjdCB3 aW5kb3c7CiAgIHN0cnVjdCB3aW5kb3cgKnc7CkBAIC0yODEyLDYgKzI4ODgsMzEgQEAgdHlwZWRl ZiB2b2lkICgqZnJhbWVfcGFybV9oYW5kbGVyKSAoc3RydWN0IGZyYW1lICosIExpc3BfT2JqZWN0 LCBMaXNwX09iamVjdCk7CiAKIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlCiB7CisKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRp c3BsYXlfaW50ZXJmYWNlJyBpbiBgbnN0ZXJtLm1gIFwgYHczMnRlcm0uY2AgXCBgeHRlcm0uY2Ag bXVzdCBiZSBpbiB0aGUKK2V4YWN0IHNhbWUgb3JkZXIgYXMgdGhlIGByZWRpc3BsYXlfaW50ZXJm YWNlJyBpbiBgZGlzcGV4dGVybi5oYCEgKi8KKworICB2b2lkICgqbWNfc2NyaWJlX2dseXBocykg KHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGds eXBoX3JvdyAqcm93LAorICAgICAgICBzdHJ1Y3QgZ2x5cGggKnN0cmluZywgZW51bSBnbHlwaF9y b3dfYXJlYSBhcmVhLCBpbnQgbGVuLCBpbnQgdnBvcywKKyAgICAgICAgaW50IGJvdHRvbV92cG9z LCBzdHJ1Y3QgbWNfUkdCIGxzbCwgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yLAorICAgICAg ICBlbnVtIHR5cGVfb2ZfY3Vyc29yIGN1cnNvcl90eXBlLCBpbnQgd2QsIGJvb2wgYWN0aXZlX3As IGJvb2wgY3Vyc29yX2djX3ApOworCisgIHZvaWQgKCptY19zY3JpYmVfY3Vyc29yKSAoc3RydWN0 IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LAorICAgICAgICBzdHJ1Y3Qg Z2x5cGhfcm93ICpnbHlwaF9yb3csIGludCB4LCBpbnQgZngsIGludCB5LCBpbnQgZnksIGludCBo cG9zLAorICAgICAgICBpbnQgdnBvcywgaW50IHdkLCBpbnQgaCwgc3RydWN0IG1jX1JHQiBsc2ws IGVudW0gdHlwZV9vZl9jdXJzb3IgY3Vyc29yX3R5cGUsCisgICAgICAgIGludCBjdXJzb3Jfd2lk dGgsIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciwgYm9vbCBvbl9wLCBib29sIGFjdGl2ZV9w KTsKKworICB2b2lkICgqbWNfc2NyaWJlX3N0cmluZykgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMs IHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAg ICAgICBzdHJ1Y3QgbWNfUkdCIGxzbCwgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yLAorICAg ICAgICBlbnVtIHR5cGVfb2ZfY3Vyc29yIGN1cnNvcl90eXBlLCBpbnQgd2QsIGJvb2wgYWN0aXZl X3AsIGJvb2wgY3Vyc29yX2djX3ApOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAg IC8qIEhhbmRsZXJzIGZvciBzZXR0aW5nIGZyYW1lIHBhcmFtZXRlcnMuICAqLwogICBmcmFtZV9w YXJtX2hhbmRsZXIgKmZyYW1lX3Bhcm1faGFuZGxlcnM7CiAKQEAgLTMyNzAsNiArMzM3MSw2NyBA QCBleHRlcm4gdm9pZCBnZXRfZm9udF9hc2NlbnRfZGVzY2VudCAoc3RydWN0IGZvbnQgKiwgaW50 ICosIGludCAqKTsKIAogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQogCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCitleHRlcm4gTGlz cF9PYmplY3QgbWNfbGlzdG4gKHB0cmRpZmZfdCwgTGlzcF9PYmplY3QsIC4uLik7CisKK2V4dGVy biBMaXNwX09iamVjdCBtY19udGggKGludCwgTGlzcF9PYmplY3QpOworCitleHRlcm4gTGlzcF9P YmplY3QgbWNfYXNzcSAoTGlzcF9PYmplY3QsIExpc3BfT2JqZWN0KTsKKworZXh0ZXJuIHZvaWQg bWNfeHdfY29sb3JfdmFsdWVzIChzdHJ1Y3Qgd2luZG93ICosIExpc3BfT2JqZWN0LCBzdHJ1Y3Qg bWNfUkdCICopOworCitleHRlcm4gYm9vbCBtY191cGRhdGVfd2luZG93X2ZyaW5nZXMgKHN0cnVj dCB3aW5kb3cgKiwgYm9vbCk7CisKK2V4dGVybiBjaGFyICogbWNfd2luZG93IChzdHJ1Y3Qgd2lu ZG93ICopOworCitleHRlcm4gY2hhciAqIG1jX2NoYXJfdG9fc3RyaW5nIChpbnQpOworCitleHRl cm4gY2hhciAqIG1jX2N1cnNvcl90eXBlX3RvX3N0cmluZyAoZW51bSB0eXBlX29mX2N1cnNvcik7 CisKK2V4dGVybiBjaGFyICogbWNfZmxhdm9yX3RvX3N0cmluZyAoZW51bSBtY19mbGF2b3IpOwor CitleHRlcm4gdm9pZCBtY19kcmF3X2ZyaW5nZV9iaXRtYXAgKHN0cnVjdCB3aW5kb3cgKiwgc3Ry dWN0IGdseXBoX3JvdyAqLCBpbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGVudW0gdHlwZV9vZl9jdXJzb3IpOworCitleHRlcm4gaW50IG1jX2dldF9mcmluZ2VfYml0bWFw IChzdHJ1Y3Qgd2luZG93ICosIExpc3BfT2JqZWN0LCBpbnQsIGludCk7CisKK2V4dGVybiB2b2lk IG1jX2VuZ2luZSAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVj dCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoICosIGlu dCwgaW50LCBpbnQsIGludCwgaW50LCBpbnQsCisgICAgICAgICAgICAgICAgICAgICAgIGVudW0g dHlwZV9vZl9jdXJzb3IsIGludCwgc3RydWN0IGdseXBoX21hdHJpeCAqLCBpbnQsCisgICAgICAg ICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IsIGJvb2wsIGVudW0gdHlwZV9vZl9hY3Rpb24s IGJvb2wsCisgICAgICAgICAgICAgICAgICAgICAgIGVudW0gdHlwZV9vZl9jYWNoZSk7CisKK2V4 dGVybiB2b2lkIG1jX3NldF9lc3NlbnRpYWxzIChzdHJ1Y3Qgd2luZG93ICosIGJvb2wsIHN0cnVj dCBtY19SR0IgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdC ICosIGludCAqKTsKKworZXh0ZXJuIHZvaWQgbWNfZHJhd19yb3cgKHN0cnVjdCB3aW5kb3cgKiwg c3RydWN0IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAgICAgICAgICAg ICAgICAgICAgICAgc3RydWN0IGdseXBoICosIGludCwgaW50LCBpbnQsIGludCwgYm9vbCwgc3Ry dWN0IGdseXBoX21hdHJpeCAqLAorICAgICAgICAgICAgICAgICAgICAgICAgIGludCwgc3RydWN0 IG1jX1JHQiwgc3RydWN0IG1jX1JHQiwgYm9vbCk7CisKK2V4dGVybiB2b2lkIG1jX3JlZHJhd19y b3cgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhf cm93ICosCisgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQsIGludCwgaW50LCBib29sLCBl bnVtIGRyYXdfZ2x5cGhzX2ZhY2UpOworCitleHRlcm4gdm9pZCBtY19yZXNldF9jYWNoZSAoc3Ry dWN0IHdpbmRvdyAqLCBlbnVtIHR5cGVfb2ZfY2FjaGUpOworCitleHRlcm4gdm9pZCBtY19wcmVf c2Nyb2xsX2NsZWFuIChzdHJ1Y3Qgd2luZG93ICopOworCitleHRlcm4gdm9pZCBtY19kcmF3X2N1 cnNvcl9nbHlwaCAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqLCBlbnVtIGRy YXdfZ2x5cGhzX2ZhY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBp bnQsIGludCwgc3RydWN0IG1jX1JHQiwgZW51bSBtY19mbGF2b3IsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgZW51bSB0eXBlX29mX2N1cnNvciwgaW50LCBib29sLCBib29sKTsK KworZXh0ZXJuIHZvaWQgbWNfeF93cml0ZV9nbHlwaHMgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0 IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgc3RydWN0IGdseXBoICosIGVudW0gZ2x5cGhfcm93X2FyZWEsIGludCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQsIGludCwgc3RydWN0IG1jX1JHQiwgZW51 bSBtY19mbGF2b3IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSB0eXBlX29m X2N1cnNvciwgaW50LCBib29sLCBib29sKTsKKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8K Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICNpZmRlZiBHTFlQSF9ERUJVRwogZXh0ZXJu IHZvaWQgZHVtcF9nbHlwaF9zdHJpbmcgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKikgRVh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sIHJpZ2h0OworICAgICAgICByaWYtPmdldF9nbHlw aF9vdmVyaGFuZ3MgKGdseXBoLCBYRlJBTUUgKHctPmZyYW1lKSwgJmxlZnQsICZyaWdodCk7Cisg ICAgICAgIGNhbl9za2lwX3AgPSAocmlnaHQgPT0gMCAmJiAhYWJvcnRfc2tpcHBpbmcpOworICAg ICAgfQorCisgICAgaWYgKGNhbl9za2lwX3ApCisgICAgICB7CisgICAgICAgIGludCBzdGFydF9o cG9zID0gaTsKKworICAgICAgICB3aGlsZSAoaSA8IHN0b3AKKyAgICAgICAgICAgICAgICYmIEdM WVBIX0VRVUFMX1AgKGRlc2lyZWRfZ2x5cGgsIGN1cnJlbnRfZ2x5cGgpKQorICAgICAgICAgIHsK KyAgICAgICAgICAgICsrYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZDsKKyAgICAgICAgICAgIGlm IChhcnJheV9nbHlwaHNfc2tpcHBlZC5hbGxvY2F0ZWQgPCBhcnJheV9nbHlwaHNfc2tpcHBlZC51 c2VkKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaW50IG9sZF9hbGxvYyA9IGFy cmF5X2dseXBoc19za2lwcGVkLmFsbG9jYXRlZDsKKyAgICAgICAgICAgICAgICBpbnQgbmV3X2Vs dHMgPSBhcnJheV9nbHlwaHNfc2tpcHBlZC51c2VkIC0gYXJyYXlfZ2x5cGhzX3NraXBwZWQuYWxs b2NhdGVkOworICAgICAgICAgICAgICAgIGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWQgPQor ICAgICAgICAgICAgICAgICAgeHBhbGxvYyAoYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICZhcnJheV9nbHlwaHNfc2tpcHBlZC5hbGxvY2F0 ZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfZWx0cywKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgIElOVF9NQVgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2Yg KmFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWQpOworICAgICAgICAgICAgICAgIG1lbXNldCAo YXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZCArIG9sZF9hbGxvYywgMCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAoYXJyYXlfZ2x5cGhzX3NraXBwZWQuYWxsb2NhdGVkIC0gb2xkX2FsbG9j KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBzaXplb2YgKmFycmF5X2dseXBoc19za2lw cGVkLnNraXBwZWQpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICBpbnQgbnRoID0gYXJy YXlfZ2x5cGhzX3NraXBwZWQudXNlZCAtIDE7CisgICAgICAgICAgICBhcnJheV9nbHlwaHNfc2tp cHBlZC5za2lwcGVkW250aF0ueCA9IHg7CisgICAgICAgICAgICBhcnJheV9nbHlwaHNfc2tpcHBl ZC5za2lwcGVkW250aF0uaHBvcyA9IGk7CisgICAgICAgICAgICBhcnJheV9nbHlwaHNfc2tpcHBl ZC5za2lwcGVkW250aF0uZW5hYmxlZF9wID0gdHJ1ZTsKKyAgICAgICAgICAgIHggKz0gZGVzaXJl ZF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICArK2Rlc2lyZWRfZ2x5cGgsICsrY3Vy cmVudF9nbHlwaCwgKytpOworICAgICAgICAgIH0KKworICAgICAgICAvKiBDb25zaWRlciB0aGUg Y2FzZSB0aGF0IHRoZSBjdXJyZW50IHJvdyBjb250YWlucyAieHh4CisgICAgIHBwcCBnZ2ciIGlu IGl0YWxpYyBDb3VyaWVyIGZvbnQsIGFuZCB0aGUgZGVzaXJlZCByb3cKKyAgICAgaXMgInh4eCBn Z2ciLiAgVGhlIGNoYXJhY3RlciBgcCcgaGFzIGxiZWFyaW5nLCBgZycKKyAgICAgaGFzIG5vdC4g IFRoZSBsb29wIGFib3ZlIHdpbGwgc3RvcCBpbiBmcm9udCBvZiB0aGUKKyAgICAgZmlyc3QgYHAn IGluIHRoZSBjdXJyZW50IHJvdy4gIElmIHdlIHdvdWxkIHN0YXJ0CisgICAgIHdyaXRpbmcgZ2x5 cGhzIHRoZXJlLCB3ZSB3b3VsZG4ndCBlcmFzZSB0aGUgbGJlYXJpbmcKKyAgICAgb2YgdGhlIGBw Jy4gIFRoZSByZXN0IG9mIHRoZSBsYmVhcmluZyBwcm9ibGVtIGlzIHRoZW4KKyAgICAgdGFrZW4g Y2FyZSBvZiBieSBkcmF3X2dseXBocy4gKi8KKyAgICAgICAgaWYgKG92ZXJsYXBwaW5nX2dseXBo c19wCisgICAgICAgICAgICAmJiBpID4gMAorICAgICAgICAgICAgJiYgaSA8IGN1cnJlbnRfcm93 LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICYmIChjdXJyZW50X3Jvdy0+dXNlZFtURVhU X0FSRUFdICE9IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pKQorICAgICAgICAgIHsKKyAg ICAgICAgICAgIGludCBsZWZ0LCByaWdodDsKKyAgICAgICAgICAgIHJpZi0+Z2V0X2dseXBoX292 ZXJoYW5ncyAoY3VycmVudF9nbHlwaCwKKyAgICAgICAgICAgICAgICAgICAgWEZSQU1FICh3LT5m cmFtZSksCisgICAgICAgICAgICAgICAgICAgICZsZWZ0LCAmcmlnaHQpOworICAgICAgICAgICAg d2hpbGUgKGxlZnQgPiAwICYmIGkgPiAwKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAg ICAgLS1pLCAtLWRlc2lyZWRfZ2x5cGgsIC0tY3VycmVudF9nbHlwaDsKKyAgICAgICAgICAgICAg ICB4IC09IGRlc2lyZWRfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICAgIGxlZnQg LT0gZGVzaXJlZF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgIC8qIEFib3J0IHRoZSBza2lwcGluZyBhbGdvcml0aG0gaWYgd2UgZW5kIHVwIGJlZm9yZQor ICAgICAgICAgICAgICAgb3VyIHN0YXJ0aW5nIHBvaW50LCB0byBhdm9pZCBsb29waW5nIChidWcj MTA3MCkuCisgICAgICAgICAgICAgICBUaGlzIGNhbiBoYXBwZW4gd2hlbiB0aGUgbGJlYXJpbmcg aXMgbGFyZ2VyIHRoYW4KKyAgICAgICAgICAgICAgIHRoZSBwaXhlbCB3aWR0aC4gKi8KKyAgICAg ICAgICAgIGFib3J0X3NraXBwaW5nID0gKGkgPCBzdGFydF9ocG9zKTsKKyAgICAgICAgICB9Cisg ICAgICB9CisKKyAgICAvKiBUcnkgdG8gYXZvaWQgd3JpdGluZyB0aGUgZW50aXJlIHJlc3Qgb2Yg dGhlIGRlc2lyZWQgcm93CisgICAgICAgYnkgbG9va2luZyBmb3IgYSByZXN5bmMgcG9pbnQuICBU aGlzIG1haW5seSBwcmV2ZW50cworICAgICAgIG1vZGUgbGluZSBmbGlja2VyaW5nIGluIHRoZSBj YXNlIHRoZSBtb2RlIGxpbmUgaXMgaW4KKyAgICAgICBmaXhlZC1waXRjaCBmb250LCB3aGljaCBp dCB1c3VhbGx5IHdpbGwgYmUuICovCisgICAgaWYgKGkgPCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhU X0FSRUFdKQorICAgICAgeworICAgICAgICBpbnQgc3RhcnRfeCA9IHgsIHN0YXJ0X2hwb3MgPSBp OworICAgICAgICBzdHJ1Y3QgZ2x5cGggKnN0YXJ0ID0gZGVzaXJlZF9nbHlwaDsKKyAgICAgICAg aW50IGN1cnJlbnRfeCA9IHg7CisgICAgICAgIGJvb2wgc2tpcF9maXJzdF9wID0gIWNhbl9za2lw X3A7CisgICAgICAgIC8qIEZpbmQgdGhlIG5leHQgZ2x5cGggdGhhdCdzIGVxdWFsIGFnYWluLiAq LworICAgICAgICB3aGlsZSAoaSA8IHN0b3AKKyAgICAgICAgICAgICAgICYmIChza2lwX2ZpcnN0 X3AKKyAgICAgICAgICAgICAgICAgICB8fCAhR0xZUEhfRVFVQUxfUCAoZGVzaXJlZF9nbHlwaCwg Y3VycmVudF9nbHlwaCkpCisgICAgICAgICAgICAgICAmJiB4ID09IGN1cnJlbnRfeCkKKyAgICAg ICAgICB7CisgICAgICAgICAgICB4ICs9IGRlc2lyZWRfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAg ICAgICAgICAgY3VycmVudF94ICs9IGN1cnJlbnRfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAg ICAgICAgKytkZXNpcmVkX2dseXBoLCArK2N1cnJlbnRfZ2x5cGgsICsraTsKKyAgICAgICAgICAg IHNraXBfZmlyc3RfcCA9IDA7CisgICAgICAgICAgfQorCisgIGZvciAoaW50IGVsdCA9IDA7Cisg ICAgICAgZWx0IDwgYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZAorICAgICAgICYmIHZwb3MgIT0g Ym90dG9tX3Zwb3M7CisgICAgICAgKytlbHQpCisgICAgeworICAgICAgaW50IHggPSBhcnJheV9n bHlwaHNfc2tpcHBlZC5za2lwcGVkW2VsdF0ueDsKKyAgICAgIGludCBocG9zID0gYXJyYXlfZ2x5 cGhzX3NraXBwZWQuc2tpcHBlZFtlbHRdLmhwb3M7CisgICAgICBzdHJ1Y3QgZ2x5cGggKnRhcmdl dF9nbHlwaCA9CisgICAgICAgIG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIGRlc2lyZWRfbWF0cml4 LCB1cGRhdGVkX3JvdywgaHBvcywgdnBvcyk7CisgICAgICBpZiAoZGVidWdfcCkKKyAgICAgICAg ZnByaW50ZiAoc3RkZXJyLCAiU0tJUFBFRDogIGNoYXIgKCVkLyVzKSB8IHg6ICglZCkgfCBocG9z ICglZCkgfCB2cG9zICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgdGFyZ2V0X2ds eXBoLT51LmNoLCBtY19jaGFyX3RvX3N0cmluZyAodGFyZ2V0X2dseXBoLT51LmNoKSwKKyAgICAg ICAgICAgICAgICAgICAgICAgICB4LCBocG9zLCB2cG9zKTsKKyAgICAgIG1jX2RyYXdfcm93ICh3 LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHRhcmdldF9nbHlwaCwgeCwgMSwgdnBvcywK KyAgICAgICAgICAgICAgICAgICBib3R0b21fdnBvcywgYWN0aXZlX3AsIGN1cnNvcl9tYXRyaXgs IGZjX3gsIGNoX2ZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgICAgZmNfZm9yZWdyb3VuZCwg dHJ1ZSk7CisgICAgfQorCisgICAgICAgIGlmIChpID09IHN0YXJ0X2hwb3MgfHwgeCAhPSBjdXJy ZW50X3gpCisgICAgICAgICAgeworICAgICAgICAgICAgaSA9IHN0YXJ0X2hwb3M7CisgICAgICAg ICAgICB4ID0gc3RhcnRfeDsKKyAgICAgICAgICAgIGRlc2lyZWRfZ2x5cGggPSBzdGFydDsKKyAg ICAgICAgICAgIGJyZWFrOworICAgICAgICAgIH0KKworICAgICAgICBvdXRwdXRfY3Vyc29yX3Rv ICh3LCB2cG9zLCBzdGFydF9ocG9zLCBkZXNpcmVkX3Jvdy0+eSwgc3RhcnRfeCk7CisKKyAgLyog UmUtZHJhdyBhIHBvcnRpb24gb2YgdGhlIHJvdy4gKi8KKworICBpZiAoZGVidWdfcAorICAgICAg JiYgdnBvcyAhPSBib3R0b21fdnBvcykKKyAgICB7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICJS RURSQVcgU0VHTUVOVDpcblwKKyAgICAgIGNoYXIgKCVkLyVzKSB8IHN0YXJ0X3g6ICglZCkgfCBz dGFydF9ocG9zICglZCkgfCBsZW5ndGggKCVkKSB8IHZwb3MgKCVkKVxuIiwKKyAgICAgIHN0YXJ0 LT51LmNoLCBtY19jaGFyX3RvX3N0cmluZyAoc3RhcnQtPnUuY2gpLAorICAgICAgc3RhcnRfeCwg c3RhcnRfaHBvcywgaSAtIHN0YXJ0X2hwb3MsIHZwb3MpOworICAgIH0KKworICByaWYtPm1jX3Nj cmliZV9nbHlwaHMgKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3Jvdywgc3RhcnQsIFRFWFRf QVJFQSwgaSAtIHN0YXJ0X2hwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgdnBvcywgYm90 dG9tX3Zwb3MsIGxzbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaF9mbGF2b3IsIGN1 cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsIGN1cnNvcl9nY19wKTsKKworICBtY19kcmF3X3JvdyAo dywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCBzdGFydCwgc3RhcnRfeCwgaSAtIHN0YXJ0 X2hwb3MsCisgICAgICAgICAgICAgICB2cG9zLCBib3R0b21fdnBvcywgYWN0aXZlX3AsIGN1cnNv cl9tYXRyaXgsIGZjX3gsIGNoX2ZvcmVncm91bmQsCisgICAgICAgICAgICAgICBmY19mb3JlZ3Jv dW5kLCB0cnVlKTsKKworICAgICAgICBjaGFuZ2VkX3AgPSAxOworICAgICAgfQorICB9CisKKyAg ICAgIC8qIFdyaXRlIHRoZSByZXN0LiAqLworICAgICAgaWYgKGkgPCBkZXNpcmVkX3Jvdy0+dXNl ZFtURVhUX0FSRUFdKQorICB7CisgICAgb3V0cHV0X2N1cnNvcl90byAodywgdnBvcywgaSwgZGVz aXJlZF9yb3ctPnksIHgpOworCisgIGlmIChkZWJ1Z19wCisgICAgICAmJiB2cG9zICE9IGJvdHRv bV92cG9zKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIkRSQVcgUkVNQUlOREVSIE9G IFRIRSBST1c6XG5cCisgICAgICBjaGFyICglZC8lcykgfCB4OiAoJWQpIHwgaSAoJWQpIHwgbGVu Z3RoICglZCkgfCB2cG9zICglZClcbiIsCisgICAgICBkZXNpcmVkX2dseXBoLT51LmNoLCBtY19j aGFyX3RvX3N0cmluZyAoZGVzaX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5vdXRwdXRfY3Vyc29yLng7CisgICAgICAgIGlu dCBocG9zID0gKHctPm91dHB1dF9jdXJzb3IuaHBvcyA9PSB1cGRhdGVkX3Jvdy0+dXNlZFtURVhU X0FSRUFdKQorICAgICAgICAgICAgICAgICAgID8gdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVB XSAtIDEKKyAgICAgICAgICAgICAgICAgICA6IHctPm91dHB1dF9jdXJzb3IuaHBvczsKKyAgICAg ICAgc3RydWN0IGdseXBoICpzdGFydCA9IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIGRlc2lyZWRf bWF0cml4LCB1cGRhdGVkX3JvdywgaHBvcywgdnBvcyk7CisgICAgICAgIGlmICh3LT5vdXRwdXRf Y3Vyc29yLnggPT0gdXBkYXRlZF9yb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAgIHggLT0gc3Rh cnQtPnBpeGVsX3dpZHRoOworICAgICAgICBpZiAoZGVidWdfcCkKKyAgICAgICAgICBmcHJpbnRm IChzdGRlcnIsICJDSEFOR0VEIC0gRlJPTTogIGNoYXIgKCVkLyVzKSB8IHggKCVkKSB8IGhwb3Mg KCVkKSAtLSBUTyBFTkQuXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQtPnUu Y2gsIG1jX2NoYXJfdG9fc3RyaW5nIChzdGFydC0+dS5jaCksIHgsIGhwb3MpOworICAgICAgICBt Y19kcmF3X3JvdyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCBzdGFydCwgeCwKKyAg ICAgICAgICAgICAgICAgICAgIHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSBocG9zLCB2 cG9zLCBib3R0b21fdnBvcywKKyAgICAgICAgICAgICAgICAgICAgIGFjdGl2ZV9wLCBjdXJzb3Jf bWF0cml4LCBmY194LCBjaF9mb3JlZ3JvdW5kLCBmY19mb3JlZ3JvdW5kLAorICAgICAgICAgICAg ICAgICAgICAgdHJ1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YWZ0ZXIgdGhhdCBwb3NpdGlvbiBzaG91bGQgYmUgY2xl YXIgYWxyZWFkeS4gKi8KKyAgICAgICAgICBpbnQgeGxpbTsKKyAgICAgICAgICBpZiAoaSA+PSBk ZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdKQorICAgICAgICAgICAgb3V0cHV0X2N1cnNvcl90 byAodywgdnBvcywgaSwgZGVzaXJlZF9yb3ctPnksIGRlc2lyZWRfcm93LT5waXhlbF93aWR0aCk7 CisgICAgICAgICAgLyogSWYgY3Vyc29yIGlzIGRpc3BsYXllZCBhdCB0aGUgZW5kIG9mIHRoZSBs aW5lLCBtYWtlIHN1cmUKKyAgICAgICAgICAgICBpdCdzIGNsZWFyZWQuICBOb3dhZGF5cyB3ZSBk b24ndCBoYXZlIGEgcGh5c19jdXJzb3JfZ2x5cGgKKyAgICAgICAgICAgICB3aXRoIHdoaWNoIHRv IGVyYXNlIHRoZSBjdXJzb3IgKGJlY2F1c2UgdGhpcyBtZXRob2QKKyAgICAgICAgICAgICBkb2Vz bid0IHdvcmsgd2l0aCBsYmVhcmluZy9yYmVhcmluZyksIHNvIHdlIG11c3QgZG8gaXQgdGhpcyB3 YXkuICovCisgICAgICAgICAgaWYgKHZwb3MgPT0gdy0+cGh5c19jdXJzb3IudnBvcworICAgICAg ICAgICAgICAmJiAoZGVzaXJlZF9yb3ctPnJldmVyc2VkX3AKKyAgICAgICAgICAgICAgICAgID8g KHctPnBoeXNfY3Vyc29yLmhwb3MgPCAwKQorICAgICAgICAgICAgICAgICAgOiAody0+cGh5c19j dXJzb3IuaHBvcyA+PSBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdKSkpCisgICAgICAgICAg ICB7CisgICAgICAgICAgICAgIHctPnBoeXNfY3Vyc29yX29uX3AgPSAwOworICAgICAgICAgICAg ICB4bGltID0gLTE7CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAg eGxpbSA9IGN1cnJlbnRf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hcHBlZCBsaW5lIGRvZXMgbm90 IHJlY2VpdmUgYW4gZXh0cmEKKyAgICAgIHNwYWNlIGxpa2Ugbm9uLXdvcmQtd3JhcHBlZCBsaW5l cyBkby4gKi8KKyAgICAgIGludCB4ID0gdXBkYXRlZF9yb3ctPnBpeGVsX3dpZHRoOworICAgICAg aW50IGhwb3MgPSB1cGRhdGVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gMTsKKyAgICAgIGludCB4 X2xpbWl0ID0gKGNsZWFyX3RvX3ggPT0gLTEpCisgICAgICAgICAgICAgICAgICAgID8gdGV4dF9h cmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgIDogY2xlYXJfdG9feDsKKyAgICAgIGlmICh0 cmFjZV9yZWRpc3BsYXlfcCkKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfdXBkYXRlX3Rl eHRfYXJlYSAoZmxvYXRpbmcpOiAgdnBvcyAoJWQpIHwgeF9saW1pdCAoJWQpXG4iLCB2cG9zLCB4 X2xpbWl0KTsKKworICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICYm ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAg ICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2hvcml6b250YWxf cnVsZXIpKQorICAgICAgICAgICYmIHggPCB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAmJiB2 cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgJiYgdGFyZ2V0X2dseXBoICE9IE5VTEwp CisgICAgICAgIG1jX2VuZ2luZSAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0YXJn ZXRfZ2x5cGgsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwKKyAgICAgICAgICAgICAgICAgICB1cGRh dGVkX3Jvdy0+eSwgaHBvcywgdnBvcywgTUNfSEJBUiwgMSwgY3Vyc29yX21hdHJpeCwgZmNfeCwK KyAgICAgICAgICAgICAgICAgICBkZWJ1Z19wID8gZGVidWdfZmcgOiBjaF9mb3JlZ3JvdW5kLCBh Y3RpdmVfcCwgSE9SSVpPTlRBTF9SVUxFUiwKKyAgICAgICAgICAgICAgICAgICB0cnVlLCBOT19D QUNIRSk7CisKKyAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAmJiAh TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAg ICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF92ZXJ0aWNhbF9ydWxl cikpCisgICAgICAgICAgJiYgeCA8IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICYmIHZwb3Mg IT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAgICAmJiB3LT5jdXJzb3IueCA+PSB4CisgICAgICAg ICAgJiYgdGFyZ2V0X2dseXBoICE9IE5VTEwpCisgICAgICAgIG1jX2VuZ2luZSAodywgZGVzaXJl ZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRfZ2x5cGgsIFRFWFRfQVJFQSwgeCwgeF9saW1p dCwKKyAgICAgICAgICAgICAgICAgICB1cGRhdGVkX3Jvdy0+eSwgaHBvcywgdnBvcywgTUNfQkFS LCAxLCBjdXJzb3JfbWF0cml4LCBmY194LAorICAgICAgICAgICAgICAgICAgIGRlYnVnX3AgPyBk ZWJ1Z19mZyA6IGNoX2ZvcmVncm91bmQsIGFjdGl2ZV9wLCBWRVJUSUNBTF9SVUxFUiwKKyAgICAg ICAgICAgICAgICAgICB0cnVlLCBOT19DQUNIRSk7CisKKyAgICAgIGlmIChCVUZGRVJQICh3LT5j b250ZW50cykKKyAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMp LCBmY192aXNpYmxlKSkKKyAgICAgICAgICAmJiB4IDwgdGV4dF9hcmVhX3dpZHRoCisgICAgICAg ICAgJiYgZmNfeCA+PSB4CisgICAgICAgICAgJiYgdGFyZ2V0X2dseXBoICE9IE5VTEwpCisgICAg ICAgIG1jX2VuZ2luZSAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRfZ2x5 cGgsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwKKyAgICAgICAgICAgICAgICAgICB1cGRhdGVkX3Jv dy0+eSwgaHBvcywgdnBvcywgTUNfQkFSLCAxLCBjdXJzb3JfbWF0cml4LCBmY194LAorICAgICAg ICAgICAgICAgICAgIGRlYnVnX3AgPyBkZWJ1Z19mZyA6IGZjX2ZvcmVncm91bmQsIGFjdGl2ZV9w LCBGSUxMX0NPTFVNTiwKKyAgICAgICAgICAgICAgICAgICB0cnVlLCBOT19DQUNIRSk7CisKKyAg ICB9CisgICAgfQorICByZXR1cm4gY2hhbmdlZF9wOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VS U09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogLyogU3RydWN0dXJlIHRvIHBh c3MgZGltZW5zaW9ucyBhcm91bmQuICBVc2VkIGZvciBjaGFyYWN0ZXIgYm91bmRpbmcKICAgIGJv eGVzLCBnbHlwaCBtYXRyaXggZGltZW5zaW9ucyBhbmQgYWxpa2UuICAqLwogCkBAIC0zMjgyLDEw ICszNzQ0LDM2IEBAIHJlZHJhd19vdmVybGFwcGVkX3Jvd3MgKHN0cnVjdCB3aW5kb3cgKncsIGlu dCB5YikKIAkgICAgewogCSAgICAgIG91dHB1dF9jdXJzb3JfdG8gKHcsIGksIDAsIHJvdy0+eSwK IAkJCQlhcmVhID09IFRFWFRfQVJFQSA/IHJvdy0+eCA6IDApOwotCSAgICAgIGlmIChyb3ctPnVz ZWRbYXJlYV0pCisKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKworICBpZiAoKHctPm1jX2VsdHMudXNlZCA+IDAgfHwgdy0+Y2hfZWx0cy51c2Vk ID4gMCB8fCB3LT5mY19lbHRzLnVzZWQgPiAwKQorICAgICAgJiYgYXJlYSA9PSBURVhUX0FSRUEK KyAgICAgICYmIHJvdy0+dXNlZFthcmVhXSkKKyAgICB7CisgICAgICBzdHJ1Y3QgZ2x5cGhfbWF0 cml4ICptYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAgICAgIGludCBzdGFydF94ID0gcm93 LT54OworICAgICAgaW50IHN0YXJ0X2hwb3MgPSAwOworICAgICAgaW50IGVuZF9ocG9zID0gcm93 LT51c2VkW2FyZWFdOworICAgICAgYm9vbCBjbGVhcl9lb2xfcCA9IHRydWU7CisgICAgICBlbnVt IGRyYXdfZ2x5cGhzX2ZhY2UgaGwgPSBEUkFXX05PUk1BTF9URVhUOworICAgICAgVFJBQ0UgKChz dGRlcnIsICJyZWRyYXdfb3ZlcmxhcHBlZF9yb3dzICglZCk6ICBzdGFydF94ICglZCkgfCBzdGFy dF9ocG9zICglZCkgfCBlbmRfaHBvcyAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgIGks IHN0YXJ0X3gsIHN0YXJ0X2hwb3MsIGVuZF9ocG9zKSk7CisgICAgICBtY19yZWRyYXdfcm93ICh3 LCBtYXRyaXgsIHJvdywgc3RhcnRfeCwgc3RhcnRfaHBvcywgZW5kX2hwb3MsIGNsZWFyX2VvbF9w LCBobCk7CisgICAgfQorICAgIGVsc2UgaWYgKHJvdy0+dXNlZFthcmVhXSkKKyAgICAgIHsKIAkJ RlJBTUVfUklGIChmKS0+d3JpdGVfZ2x5cGhzICh3LCByb3csIHJvdy0+Z2x5cGhzW2FyZWFdLAog ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJlYSwgcm93LT51 c2VkW2FyZWFdKTsKIAkgICAgICBGUkFNRV9SSUYgKGYpLT5jbGVhcl9lbmRfb2ZfbGluZSAodywg cm93LCBhcmVhLCAtMSk7CisgICAgICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK IAkgICAgfQogCiAJICByb3ctPm92ZXJsYXBwZWRfcCA9IDA7CkBAIC0zMzg4LDYgKzM4NzYsMjgg QEAgc3RhdGljIGJvb2wKIHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgZm9y Y2VfcCkKIHsKICAgc3RydWN0IGdseXBoX21hdHJpeCAqZGVzaXJlZF9tYXRyaXggPSB3LT5kZXNp cmVkX21hdHJpeDsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJ UExFLUNVUlNPUlMgKi8KKworICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAgZnByaW50ZiAo c3RkZXJyLCAidXBkYXRlX3dpbmRvdyAoJXMpXG4iLCBtY193aW5kb3cgKHcpKTsKKworICBjdXJz b3JfbWF0cml4ID0gTlVMTDsKKworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1l KTsKKyAgYm9vbCBhY3RpdmVfcCA9ICh3ID09IFhXSU5ET1cgKGYtPnNlbGVjdGVkX3dpbmRvdykK KyAgICAgICAgICAgICAgICAgICAmJiBmID09IEZSQU1FX0RJU1BMQVlfSU5GTyAoZiktPnhfaGln aGxpZ2h0X2ZyYW1lKTsKKworICBtY19zZXRfZXNzZW50aWFscyAodywgYWN0aXZlX3AsICZjaF9m b3JlZ3JvdW5kLCAmZmNfZm9yZWdyb3VuZCwgJmZjX3gpOworCisgIG1jX3ByZV9zY3JvbGxfY2xl YW4gKHcpOworCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogICBib29sIHBhdXNlZF9wOwogICBpbnQgcHJlZW1wdF9jb3VudCA9IGNsaXBf dG9fYm91bmRzICgxLCBiYXVkX3JhdGUgLyAyNDAwICsgMSwgSU5UX01BWCk7CiAgIHN0cnVjdCBy ZWRpc3BsYXlfaW50ZXJmYWNlICpyaWYgPSBGUkFNRV9SSUYgKFhGUkFNRSAoV0lORE9XX0ZSQU1F ICh3KSkpOwpAQCAtMzQ2MCw2ICszOTcwLDQxIEBAIHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5k b3cgKncsIGJvb2wgZm9yY2VfcCkKIAkgICAgfQogCX0KIAorCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAvKiBQcm9jZXNzIHRoZSBjdXJzb3Ig cm93IGF0IHRoZSBvdXRzZXQgaWYgaXQgaXMgd2l0aGluIGBkZXNpcmVkX21hdHJpeGAuCisgIFdo ZW4gcHJvY2Vzc2luZyBhbGwgb3RoZXIgcm93cywgd2Ugd2lsbCBxdWVyeSB0aGUgYHctPmN1cnJl bnRfbWF0cml4YCBmb3IgZGF0YQorICByZWxhdGluZyB0byB0aGUgY3Vyc29yIHJvdy4gIGBtYWtl X2N1cnJlbnRgICh3aXRoaW4gYHVwZGF0ZV93aW5kb3dfbGluZScpCisgIHVwZGF0ZXMgdGhlIGB3 LT5jdXJyZW50X21hdHJpeGAgZm9yIHRoZSBhcHBsaWNhYmx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AgICAgICBmb3IgKGludCBpID0gdnBvcyArIDE7IGkgPCB3LT5jdXJyZW50X21hdHJpeC0+bnJv d3MgLSAxOyArK2kpCisgICAgICAgICAgICAgIFNFVF9NQVRSSVhfUk9XX0VOQUJMRURfUCAody0+ Y3VycmVudF9tYXRyaXgsIGksIGZhbHNlKTsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQor ICAgIH0KKworICBjdXJzb3JfbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgICAgIC8qIFVwZGF0ZSB0aGUgcmVzdCBvZiB0aGUgbGlu ZXMuICAqLwogICAgICAgZm9yICg7IHJvdyA8IGVuZCAmJiAoZm9yY2VfcCB8fCAhaW5wdXRfcGVu ZGluZyk7ICsrcm93KQogCS8qIHNjcm9sbGluZ193aW5kb3cgcmVzZXRzIHRoZSBlbmFibGVkX3Ag ZmxhZyBvZiB0aGUgcm93cyBpdApAQCAtMzQ2Nyw2ICs0MDEyLDE5IEBAIHVwZGF0ZV93aW5kb3cg KHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkKIAlpZiAocm93LT5lbmFibGVkX3ApCiAJ ICB7CiAJICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIGRlc2lyZWRfbWF0cml4 KTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8K KworICAvKiBJZiB0aGUgYGN1cnNvcl9yb3dgIGlzIHdpdGhpbiB0aGUgYGRlc2lyZWRfbWF0cml4 YCwgdGhlbiBpdCB3YXMgcHJvY2VlZAorICBoZXJlaW5hYm92ZSBhbmQgc2hvdWxkIGJlIHNraXBw ZWQgYXQgdGhpcyB0aW1lLiAqLworICBpZiAodnBvcyA9PSB3LT5jdXJzb3IudnBvcykKKyAgICBj b250aW51ZTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgICBpbnQgaTsKIAog CSAgICAvKiBXZSdsbCBoYXZlIHRvIHBsYXkgYSBsaXR0bGUgYml0IHdpdGggd2hlbiB0bwpAQCAt MzQ5Nyw2ICs0MDU1LDQzIEBAIHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wg Zm9yY2VfcCkKIAogICAgIHNldF9jdXJzb3I6CiAKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogSWYgd2UganVtcGVkIGhlcmUgZnJvbSBg c2V0X2N1cnNvcmAsIHRoZW4gc2V0IHRoZSBgY3Vyc29yX21hdHJpeGAuICovCisgIGlmIChjdXJz b3JfbWF0cml4ID09IE5VTEwpCisgICAgY3Vyc29yX21hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4 OworCisgIC8qIFJlc2V0IGByb3dgIHRvIDAgc28gdGhhdCBmYWtlIGN1cnNvcnMgY2FuIGJlIGRy YXduIG9uIHJvd3MgcHJlY2VkaW5nIHRoZQorICBmaXJzdCBgcm93LT5lbmFibGVkX3BgLiAgSnVz dCBwcmlvciB0byB0aGUgY2FsbCB0byBgc2Nyb2xsaW5nX3dpbmRvdycgYWJvdmUsCisgIGByb3dg IHdhcyBhZHZhbmNlZCB0byB0aGUgZmlyc3QgYHJvdy0+ZW5hYmxlZF9wYC4gKi8KKyAgZm9yIChz dHJ1Y3QgZ2x5cGhfcm93ICpkZXNpcmVkX3JvdyA9IE1BVFJJWF9ST1cgKGRlc2lyZWRfbWF0cml4 LCAwKTsKKyAgICAgICBkZXNpcmVkX3JvdyA8IGVuZAorICAgICAgICYmIChmb3JjZV9wIHx8ICFp bnB1dF9wZW5kaW5nKQorICAgICAgIC8qIFczMiBFbWFjcyBjcmFzaGVzIG9uIHN0YXJ0dXAgd2l0 aG91dCBhIEJVRkZFUlAgY2hlY2suICovCisgICAgICAgJiYgQlVGRkVSUCAody0+Y29udGVudHMp CisgICAgICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYp KQorICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9z c2hhaXJzKSkKKyAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgZmNfdmlzaWJsZSkpKTsKKyAgICAgICArK2Rlc2lyZWRfcm93KQorICAgeworICAgICBpbnQg dnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAoZGVzaXJlZF9yb3csIGRlc2lyZWRfbWF0cml4KTsKKyAg ICAgaWYgKGRlc2lyZWRfcm93LT5lbmFibGVkX3ApCisgICAgICAgY29udGludWU7CisgICAgIHN0 cnVjdCBnbHlwaF9yb3cgKmJvdHRvbV9yb3cgPSBNQVRSSVhfQk9UVE9NX1RFWFRfUk9XICh3LT5j dXJyZW50X21hdHJpeCwgdyk7CisgICAgIGludCBib3R0b21fdnBvcyA9IE1BVFJJWF9ST1dfVlBP UyAoYm90dG9tX3Jvdywgdy0+Y3VycmVudF9tYXRyaXgpOworICAgICBzdHJ1Y3QgZ2x5cGhfcm93 ICpjdXJyZW50X3JvdyA9IE1BVFJJWF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB2cG9zKTsKKyAg ICAgaWYgKGN1cnJlbnRfcm93LT5lbmFibGVkX3ApCisgICAgICAgbWNfZHJhd19yb3cgKHcsIHct PmN1cnJlbnRfbWF0cml4LCBjdXJyZW50X3JvdywgY3VycmVudF9yb3ctPmdseXBoc1tURVhUX0FS RUFdLAorICAgICAgICAgICAgICAgICAgICBjdXJyZW50X3Jvdy0+eCwgY3VycmVudF9yb3ctPnVz ZWRbVEVYVF9BUkVBXSwgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgYm90dG9tX3Zwb3MsIGFj dGl2ZV9wLCBjdXJzb3JfbWF0cml4LCBmY194LCBjaF9mb3JlZ3JvdW5kLAorICAgICAgICAgICAg ICAgICAgICBmY19mb3JlZ3JvdW5kLCB0cnVlKTsKKyAgIH0KKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogICAgICAgLyogVXBkYXRlIHRoZSBoZWFkZXIgbGluZSBhZnRlciBzY3JvbGxp bmcgYmVjYXVzZSBhIG5ldyBoZWFkZXIKIAkgbGluZSB3b3VsZCBvdGhlcndpc2Ugb3ZlcndyaXRl IGxpbmVzIGF0IHRoZSB0b3Agb2YgdGhlIHdpbmRvdwogCSB0aGF0IGNhbiBiZSBzY3JvbGxlZC4g ICovCkBAIC0zNTMxLDEwICs0MTI2LDIxIEBAIHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5kb3cg KncsIGJvb2wgZm9yY2VfcCkKICAgICAgIHN0cmNweSAody0+Y3VycmVudF9tYXRyaXgtPm1ldGhv ZCwgdy0+ZGVzaXJlZF9tYXRyaXgtPm1ldGhvZCk7CiAjZW5kaWYKIAorCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogI2lmZGVmIEhBVkVfV0lORE9X X1NZU1RFTQorICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAmJiAhTklMUCAoQlZB UiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisgICAgbWNfdXBkYXRlX3dp bmRvd19mcmluZ2VzICh3LCAwKTsKKyAgICBlbHNlCiAgICAgICB1cGRhdGVfd2luZG93X2ZyaW5n ZXMgKHcsIDApOwogI2VuZGlmCiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAg IC8qIEVuZCB0aGUgdXBkYXRlIG9mIHdpbmRvdyBXLiAgRG9uJ3Qgc2V0IHRoZSBjdXJzb3IgaWYg d2UKICAgICAgICAgIHBhdXNlZCB1cGRhdGluZyB0aGUgZGlzcGxheSBiZWNhdXNlIGluIHRoaXMg Y2FzZSwKICAgICAgICAgIHNldF93aW5kb3dfY3Vyc29yX2FmdGVyX3VwZGF0ZSBoYXNuJ3QgYmVl biBjYWxsZWQsIGFuZApAQCAtMzg1MiwxNCArNDQ1OCwyOCBAQCB1cGRhdGVfd2luZG93X2xpbmUg KHN0cnVjdCB3aW5kb3cgKncsIGludCB2cG9zLCBib29sICptb3VzZV9mYWNlX292ZXJ3cml0dGVu X3ApCiAJICBjdXJyZW50X3Jvdy0+cmVkcmF3X2ZyaW5nZV9iaXRtYXBzX3AgPSAxOwogCX0KIAor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBi b29sIHVwZGF0ZWRfcCA9IChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAg ICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAg ICAgICAgICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgIC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faXRlbXMgc2hvdWxkIGJlIHRoZSBsYXN0IExpc3BfT2JqZWN0IG1lbWJlci4g ICovCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKyAgLyogTm9uLW5pbCB3aGVuIHRoZSBmcmFtZSBpcyBpbiB0aGUgcHJvY2VzcyBvZiBiZWlu ZyB1cGRhdGVkLiAqLworICBzdHJ1Y3QgZnJhbWUgKm1jX3VwZGF0aW5nX2ZyYW1lOworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIENhY2hlIG9mIHJlYWxpemVkIGZhY2VzLiAg Ki8KICAgc3RydWN0IGZhY2VfY2FjaGUgKmZhY2VfY2FjaGU7CiAKZGlmZiAtLWdpdCBhL3NyYy9m cmluZ2UuYyBiL3NyYy9mcmluZ2UuYwppbmRleCAzMzVhNmViLi4wZGJlYTVmIDEwMDY0NAotLS0g YS9zcmMvZnJpbmdlLmMKKysrIGIvc3JjL2ZyaW5nZS5jCkBAIC00MzgsNiArNDM4LDQ2MCBAQCBz dGF0aWMgdW5zaWduZWQgc2hvcnQgZW1wdHlfbGluZV9iaXRzW10gPSB7CiAjZGVmaW5lIFNUQU5E QVJEX0JJVE1BUF9IRUlHSFQoYml0cykgKHNpemVvZiAoYml0cykvQllURVNfUEVSX0JJVE1BUF9S T1cpCiAjZGVmaW5lIEZSQklUUyhiaXRzKSAgYml0cywgU1RBTkRBUkRfQklUTUFQX0hFSUdIVCAo Yml0cykKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExFLUNV UlNPUlMgKi8KKworLyog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IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi54eC4uLnh4 IgorICAgICAgIi4ueHguLnh4IgorICAgICAgIi4uLnh4Lnh4IgorICAgICAgInh4eHh4eHh4Igor ICAgICAgInh4eHh4eHh4IgorICAgICAgIi4uLnh4Lnh4IgorICAgICAgIi4ueHguLnh4IgorICAg ICAgIi54eC4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAg Ii4uLi4uLnh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcmV2ZXJzZWRfdmVydGlj YWxfYmFyX3JpZ2h0X2Fycm93X2JpdHNbXSA9eworICAweDMsIDB4MywgMHgzLCAweDYzLCAweDMz LCAweDFiLCAweGZmLCAweGZmLCAweDFiLCAweDMzLCAweDYzLCAweDMsIDB4MywgMHgzfTsKKwor LyogMjYKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHh4eHh4eHgi CisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4ueHguLngiCisg ICAgICAieC4uLnh4LngiCisgICAgICAieC4uLi54eHgiCisgICAgICAieC54eHh4eHgiCisgICAg ICAieC54eHh4eHgiCisgICAgICAieC4uLi54eHgiCisgICAgICAieC4uLnh4LngiCisgICAgICAi eC4ueHguLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieHh4 eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19ob2xsb3dfcmVjdGFuZ2xlX3Jp Z2h0X2Fycm93X2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweDk5LCAweDhkLCAweDg3 LCAweGJmLAorICAweGJmLCAweDg3LCAweDhkLCAweDk5LCAweDgxLCAweDgxLCAweGZmfTsKKwor LyogMjcKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHh4eHh4eHgi CisgICAgICAieC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieC54eC4ueHgiCisg ICAgICAieC4ueHgueHgiCisgICAgICAieC4uLnh4eHgiCisgICAgICAieHh4eHh4eHgiCisgICAg ICAieHh4eHh4eHgiCisgICAgICAieC4uLnh4eHgiCisgICAgICAieC4ueHgueHgiCisgICAgICAi eC54eC4ueHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieHh4 eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19yZXZlcnNlZF9ob2xsb3dfcmVj dGFuZ2xlX3JpZ2h0X2Fycm93X2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweGIxLCAw eDk5LCAweDhkLCAweGZmLAorICAweGZmLCAweDhkLCAweDk5LCAweGIxLCAweDgxLCAweDgxLCAw eGZmfTsKKworLyogMjgKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAi eHh4eHh4eHgiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4u Li4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4u LngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngi CisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisg ICAgICAieHh4eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19ob2xsb3dfcmVj dGFuZ2xlX2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAw eDgxLAorICAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweGZmfTsKKworLyog MjkKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC4uLi4uLi4iCisg ICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAg ICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAi eC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4u Li4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4u Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY192ZXJ0aWNhbF9iYXJfYml0c1tdID17 CisgIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsCisgIDB4ODAsIDB4 ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODB9OworCisvKiAzMAorICAgICgrLWZyaW5n ZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIK KyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAg ICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAg ICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIu Li4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIpCisqLworc3RhdGlj IHVuc2lnbmVkIHNob3J0IG1jX3JldmVyc2VkX3ZlcnRpY2FsX2Jhcl9iaXRzW10gPXsKKyAgMHgz LCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4Mywg MHgzLCAweDN9OworCisvKiAzMQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAg ICAgICJ4eC4uLi4uLiIKKyAgICAgICJ4eC4uLi4uLiIKKyAgICAgICIgeHguLi4uLiIKKyAgICAg ICIueHguLi4uLiIKKyAgICAgICIuLnh4Li4uLiIKKyAgICAgICIuLnh4Li4uLiIKKyAgICAgICIu Li54eC4uLiIKKyAgICAgICIuLi54eC4uLiIKKyAgICAgICIuLi4ueHguLiIKKyAgICAgICIuLi4u eHguLiIKKyAgICAgICIuLi4uLnh4LiIKKyAgICAgICIuLi4uLnh4LiIKKyAgICAgICIuLi4uLi54 eCIKKyAgICAgICIuLi4uLi54eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX2JhY2tz bGFzaF9iaXRzW10gPXsKKyAgMHhjMCwgMHhjMCwgMHhlMCwgMHg2MCwgMHgzMCwgMHgzMCwgMHgx OCwgMHgxOCwgMHhjLCAweGMsIDB4NiwgMHg2LCAweDMsIDB4M307CisKKy8qIDMyCisgICAgKCst ZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Li4uLi4uIgorICAgICAgInh4Li4u Li4uIgorICAgICAgInh4eC4uLi4uIgorICAgICAgInh4eC4uLi4uIgorICAgICAgIngueHguLi4u IgorICAgICAgIngueHguLi4uIgorICAgICAgInguLnh4Li4uIgorICAgICAgInguLnh4Li4uIgor ICAgICAgInguLi54eC4uIgorICAgICAgInguLi54eC4uIgorICAgICAgInguLi4ueHguIgorICAg ICAgInguLi4ueHguIgorICAgICAgInguLi4uLnh4IgorICAgICAgInguLi4uLnh4IikKKyovCitz dGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdmVydGljYWxfYmFyX2JhY2tzbGFzaF9iaXRzW10gPXsK KyAgMHhjMCwgMHhjMCwgMHhlMCwgMHhlMCwgMHhiMCwgMHhiMCwgMHg5OCwKKyAgMHg5OCwgMHg4 YywgMHg4YywgMHg4NiwgMHg4NiwgMHg4MywgMHg4M307CisKKy8qIDMzCisgICAgKCstZnJpbmdl LWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi54eHh4eHguIgorICAgICAgInh4eHgueC4uIgor ICAgICAgInh4eHgueC4uIgorICAgICAgInh4eHgueC4uIgorICAgICAgIi54eHgueC4uIgorICAg ICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAg Ii4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIikKKyovCitzdGF0 aWMgdW5zaWduZWQgc2hvcnQgbWNfcGlsY3Jvd19iaXRzW10gPXsKKyAgMHg3ZSwgMHhmNCwgMHhm NCwgMHhmNCwgMHg3NCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNH07CisKKy8q IDM0CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4ueHh4eC4uIgor ICAgICAgIi54eHh4eHguIgorICAgICAgInguLnh4Li54IgorICAgICAgInguLnh4Li54IgorICAg ICAgInh4eHh4eHh4IgorICAgICAgInh4Li4uLnh4IgorICAgICAgInh4eC4ueHh4IgorICAgICAg Ii54eHh4eHguIgorICAgICAgIi4ueHh4eC4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQg bWNfc21pbGV5X2ZhY2VfYml0c1tdID17CisgIDB4M2MsIDB4N2UsIDB4OTksIDB4OTksIDB4ZmYs IDB4YzMsIDB4ZTcsIDB4N2UsIDB4M2N9OworCisvKiAzNQorICAgICgrLWZyaW5nZS1oZWxwZXIt aGV4YWRlY2ltYWwKKyAgICAgICIuLnguLi4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIu Li4ueC4uLiIKKyAgICAgICIuLi4uLnguLiIKKyAgICAgICIuLi4ueC4uLiIKKyAgICAgICIuLi54 Li4uLiIKKyAgICAgICIuLnguLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3Np bmdsZV9hbmdsZV9yaWdodF9iaXRzW10gPXsKKyAgMHgyMCwgMHgxMCwgMHg4LCAweDQsIDB4OCwg MHgxMCwgMHgyMH07CisKKy8qIDM2CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAor ICAgICAgIi4uLi4ueC4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4uLnguLi4uIgorICAg ICAgIi4ueC4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAg Ii4uLi4ueC4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX2xl ZnRfYml0c1tdID17CisgIDB4NCwgMHg4LCAweDEwLCAweDIwLCAweDEwLCAweDgsIDB4NH07CisK Ky8qIDM3CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Lnh4Li4u IgorICAgICAgIi54eC54eC4uIgorICAgICAgIi4ueHgueHguIgorICAgICAgIi4uLnh4Lnh4Igor ICAgICAgIi4ueHgueHguIgorICAgICAgIi54eC54eC4uIgorICAgICAgInh4Lnh4Li4uIikKKyov CitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xlX3JpZ2h0X2JpdHNbXSA9ewor ICAweGQ4LCAweDZjLCAweDM2LCAweDFiLCAweDM2LCAweDZjLCAweGQ4fTsKKworLyogMzgKKyAg ICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4ueHgueHgiCisgICAgICAi Li54eC54eC4iCisgICAgICAiLnh4Lnh4Li4iCisgICAgICAieHgueHguLi4iCisgICAgICAiLnh4 Lnh4Li4iCisgICAgICAiLi54eC54eC4iCisgICAgICAiLi4ueHgueHgiKQorKi8KK3N0YXRpYyB1 bnNpZ25lZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfbGVmdF9iaXRzW10gPXsKKyAgMHgxYiwgMHgz NiwgMHg2YywgMHhkOCwgMHg2YywgMHgzNiwgMHgxYn07CisKKy8qIDM5CisgICAgKCstZnJpbmdl LWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIngueC54Li4uIgorICAgICAgIi54LngueC4uIgor ICAgICAgIi4ueC54LnguIgorICAgICAgIi4uLngueC54IgorICAgICAgIi4ueC54LnguIgorICAg ICAgIi54LngueC4uIgorICAgICAgIngueC54Li4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hv cnQgbWNfdHJpcGxlX2FuZ2xlX3JpZ2h0X2JpdHNbXSA9eworICAweGE4LCAweDU0LCAweDJhLCAw eDE1LCAweDJhLCAweDU0LCAweGE4fTsKKworLyogNDAKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhl eGFkZWNpbWFsCisgICAgICAiLi4ueC54LngiCisgICAgICAiLi54LngueC4iCisgICAgICAiLngu eC54Li4iCisgICAgICAieC54LnguLi4iCisgICAgICAiLngueC54Li4iCisgICAgICAiLi54Lngu eC4iCisgICAgICAiLi4ueC54LngiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190cmlw bGVfYW5nbGVfbGVmdF9iaXRzW10gPXsKKyAgMHgxNSwgMHgyYSwgMHg1NCwgMHhhOCwgMHg1NCwg MHgyYSwgMHgxNX07CisKKy8qIDQxCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAor ICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAg ICAgIi4uLi4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAg Ii54Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4u Li4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIikKKyovCitzdGF0aWMg dW5zaWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDAwLCAweDAw LCAweDAwLCAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDgyLCAweDAwLCAweDAwLCAweDAwLCAw eDAwfTsKKworLyogNDIKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAi Li4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4u Li4uLi4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54Lngu Li4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4i CisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25l ZCBzaG9ydCBtY19zaW5nbGVfYW5nbGVfZG93bl9iaXRzW10gPXsKKyAgMHgwMCwgMHgwMCwgMHgw MCwgMHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHgxMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMH07 CisKKy8qIDQzCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4u Li4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLnguLi4u IgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgor ICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAg ICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIikKKyovCitz dGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDAw LCAweDAwLCAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDgyLCAw eDAwLCAweDAwLCAweDAwfTsKKworLyogNDQKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNp bWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4i CisgICAgICAieC4uLi4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisg ICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAg ICAiLi4ueC4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAi Li4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfZG93 bl9iaXRzW10gPXsKKyAgMHgwMCwgMHgwMCwgMHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHg5Miwg MHg0NCwgMHgyOCwgMHgxMCwgMHgwMCwgMHgwMCwgMHgwMH07CisKKy8qIDQ1CisgICAgKCstZnJp bmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLnguLi4u IgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgor ICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAg ICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAgICAg Ii4uLi4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdHJpcGxlX2FuZ2xlX3Vw X2JpdHNbXSA9eworICAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAw eDkyLCAweDI4LCAweDQ0LCAweDgyLCAweDAwfTsKKworLyogNDYKKyAgICAoKy1mcmluZ2UtaGVs cGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAieC4uLi4ueC4iCisgICAg ICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAi LnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLngu Li54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLi4u Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19xdWFkcnVwbGVfYW5nbGVfZG93bl9i aXRzW10gPXsKKyAgMHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHg5 MiwgMHg0NCwgMHgyOCwgMHgxMCwgMHgwMH07CisKKy8qIDQ3CisgICAgKCstZnJpbmdlLWhlbHBl ci1oZXhhZGVjaW1hbAorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAg Ii54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54 Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4u eC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4u IgorICAgICAgInguLi4uLnguIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcXVhZHJ1 cGxlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAw eDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDgyfTsKKworLyogNDgK KyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC4uLi4ueC4iCisgICAg ICAiLnguLi54Li4iCisgICAgICAi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gKChi bTEgPSBYQ0RSIChibTEpKSwgTklMUCAoYm0xKSkKKyAgICAgIHJldHVybiBNQ19OT19GUklOR0Vf QklUTUFQOworICAgIGlmIChDT05TUCAoYm0xKSkKKyAgICAgIHsKKyAgICAgICAgbG4xID0gWEZJ WE5VTSAoRmxlbmd0aCAoYm0xKSk7CisgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgeworICAg ICAgaWYgKGxuMSA+IGl4MikKKyAgICAgICAgeworICAgICAgICAgIGJtID0gbWNfbnRoIChpeDIs IGJtMSk7CisgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgIGdvdG8gZm91bmQ7Cisg ICAgICAgIH0KKyAgICB9CisgICAgICAgIGVsc2UKKyAgICB7CisgICAgICBpZiAobG4xID4gaXgx KQorICAgICAgICB7CisgICAgICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0xKTsKKyAgICAgICAg ICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgfQorICAgIH0K KyAgICAgIH0KKyAgICBlbHNlIGlmICgoYm0gPSBibTEsICFFUSAoYm0sIFF0KSkpCisgICAgICBn b3RvIGZvdW5kOworICB9CisgICAgfQorICBpZiAoIUVRIChjbWFwLCBCVkFSICgmYnVmZmVyX2Rl ZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkKKyAgICAgICYmICFOSUxQIChCVkFSICgm YnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkpCisgICAgeworICAgICAg Ym0yID0gbWNfYXNzcSAoYml0bWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5k aWNhdG9yX2FsaXN0KSk7CisgICAgICBpZiAoQ09OU1AgKGJtMikpCisgIHsKKyAgICBpZiAoKGJt MiA9IFhDRFIgKGJtMikpLCAhTklMUCAoYm0yKSkKKyAgICAgIHsKKyAgICAgICAgaWYgKENPTlNQ IChibTIpKQorICAgIHsKKyAgICAgIGxuMiA9IFhGSVhOVU0gKEZsZW5ndGggKGJtMikpOworICAg ICAgaWYgKHBhcnRpYWxfcCkKKyAgICAgICAgeworICAgICAgICAgIGlmIChsbjIgPiBpeDIpCisg ICAgICB7CisgICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMik7CisgICAgICAgIGlmICghRVEg KGJtLCBRdCkpCisgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgIH0KKyAgICAgICAgfQorICAg IH0KKyAgICAgIH0KKyAgfQorICAgIH0KKyAgaWYgKGxuMSA+IGl4MSkKKyAgICB7CisgICAgICBi bSA9IG1jX250aCAoaXgxLCBibTEpOworICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgZ290byBm b3VuZDsKKyAgICB9CisgIGlmIChsbjIgPiBpeDEpCisgICAgeworICAgICAgYm0gPSBtY19udGgg KGl4MSwgYm0yKTsKKyAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgIGdvdG8gZm91bmQ7CisgICAg ICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICB9CisgIGVsc2UgaWYgKChibSA9IGJt MiwgTklMUCAoYm0pKSkKKyAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyBmb3VuZDoK KyAgcmV0dXJuIGxvb2t1cF9mcmluZ2VfYml0bWFwIChibSk7Cit9CisKK3N0YXRpYyBpbnQKK21j X2dldF9sb2dpY2FsX2N1cnNvcl9iaXRtYXAgKHN0cnVjdCB3aW5kb3cgKncsIExpc3BfT2JqZWN0 IGN1cnNvcikKK3sKKyAgTGlzcF9PYmplY3QgY21hcCwgYm0gPSBRbmlsOworICBpZiAoKGNtYXAg PSBCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZyaW5nZV9jdXJzb3JfYWxpc3QpKSwgIU5J TFAgKGNtYXApKQorICAgIHsKKyAgICAgIGJtID0gbWNfYXNzcSAoY3Vyc29yLCBjbWFwKTsKKyAg ICAgIGlmIChDT05TUCAoYm0pKQorICAgICAgICB7CisgICAgICAgICAgaWYgKChibSA9IFhDRFIg KGJtKSksIE5JTFAgKGJtKSkKKyAgICAgICAgICAgIHJldHVybiBNQ19OT19GUklOR0VfQklUTUFQ OworICAgICAgICAgIHJldHVybiBsb29rdXBfZnJpbmdlX2JpdG1hcCAoYm0pOworICAgICAgICB9 CisgICAgfQorICBpZiAoRVEgKGNtYXAsIEJWQVIgKCZidWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9j dXJzb3JfYWxpc3QpKSkKKyAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgYm0gPSBt Y19hc3NxIChjdXJzb3IsIEJWQVIgKCZidWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9jdXJzb3JfYWxp c3QpKTsKKyAgaWYgKCFDT05TUCAoYm0pIHx8ICgoYm0gPSBYQ0RSIChibSkpLCBOSUxQIChibSkp KQorICAgIHJldHVybiBNQ19OT19GUklOR0VfQklUTUFQOworICByZXR1cm4gbG9va3VwX2ZyaW5n ZV9iaXRtYXAgKGJtKTsKK30KKworc3RhdGljIGludAorbWNfZ2V0X2xvZ2ljYWxfZnJpbmdlX2Jp dG1hcCAoc3RydWN0IHdpbmRvdyAqdywgTGlzcF9PYmplY3QgYml0bWFwLCBpbnQgcmlnaHRfcCwg aW50IHBhcnRpYWxfcCkKK3sKKyAgTGlzcF9PYmplY3QgY21hcCwgYm0xID0gUW5pbCwgYm0yID0g UW5pbCwgYm07CisgIEVNQUNTX0lOVCBsbjEgPSAwLCBsbjIgPSAwOworICBpbnQgaXgxID0gcmln aHRfcDsKKyAgaW50IGl4MiA9IGl4MSArIChwYXJ0aWFsX3AgPyAyIDogMCk7CisgIC8qIExvb2t1 cCBpbiBidWZmZXItbG9jYWwgZnJpbmdlLWluZGljYXRvci1hbGlzdCBiZWZvcmUgZ2xvYmFsIGFs aXN0LgorICAgICBFbGVtZW50cyBhcmU6CisgIEJJVE1BUCAgICAtLSB1c2UgZm9yIGFsbAorICAo TCBSKSAgICAtLSB1c2UgZm9yIGxlZnQgcmlnaHQgKHdoZXRoZXIgcGFydGlhbCBvciBub3QpCisg IChMIFIgUEwgUFIpICAtLSB1c2UgZm9yIGxlZnQgcmlnaHQgcGFydGlhbC1sZWZ0IHBhcnRpYWwt cmlnaHQKKyAgSWYgYW55IHZhbHVlIGluIGxvY2FsIGJpbmRpbmcgaXMgbm90IHByZXNlbnQgb3Ig dCwgdXNlIGdsb2JhbCB2YWx1ZS4KKyAgICAgSWYgcGFydGlhbCwgbG9va3VwIHBhcnRpYWwgYml0 bWFwIGluIGRlZmF1bHQgdmFsdWUgaWYgbm90IGZvdW5kIGhlcmUuCisgICAgIElmIG5vdCBwYXJ0 aWFsLCBvciBubyBwYXJ0aWFsIHNwZWMgaXMgcHJlc2VudCwgdXNlIG5vbi1wYXJ0aWFsIGJpdG1h cC4gICovCisgIGlmICgoY21hcCA9IEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZnJpbmdl X2luZGljYXRvcl9hbGlzdCkpLCAhTklMUCAoY21hcCkpCisgICAgeworICAgICAgYm0xID0gbWNf YXNzcSAoYml0bWFwLCBjbWFwKTsKKyAgICAgIGlmIChDT05TUCAoYm0xKSkKKyAgICAgICAgewor ICAgICAgICAgIGlmICgoYm0xID0gWENEUiAoYm0xKSksIE5JTFAgKGJtMSkpCisgICAgICAgICAg ICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICBpZiAoQ09OU1AgKGJtMSkp CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGxuMSA9IFhGSVhOVU0gKEZsZW5ndGggKGJt MSkpOworICAgICAgICAgICAgICBpZiAocGFydGlhbF9wKQorICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAgIGlmIChsbjEgPiBpeDIpCisgICAgICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAgICAgICBibSA9IG1jX250aCAoaXgyLCBibTEpOworICAgICAgICAgICAg ICAgICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5k OworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgaWYgKGxuMSA+IGl4 MSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGJtID0gbWNf bnRoIChpeDEsIGJtMSk7CisgICAgICAgICAgICAgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkK KyAgICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxzZSBpZiAoKGJtID0g Ym0xLCAhRVEgKGJtLCBRdCkpKQorICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgfQor ICAgIH0KKyAgaWYgKCFFUSAoY21hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2lu ZGljYXRvcl9hbGlzdCkpCisgICAgICAmJiAhTklMUCAoQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywg ZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpKQorICAgIHsKKyAgICAgIGJtMiA9IG1jX2Fzc3EgKGJp dG1hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpOwor ICAgICAgaWYgKENPTlNQIChibTIpKQorICAgICAgICB7CisgICAgICAgICAgaWYgKChibTIgPSBY Q0RSIChibTIpKSwgIU5JTFAgKGJtMikpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlm IChDT05TUCAoYm0yKSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBsbjIgPSBYRklYTlVNIChG bGVuZ3RoIChibTIpKTsKKyAgICAgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICBpZiAobG4yID4gaXgyKQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBibSA9IG1jX250aCAoaXgyLCBibTIpOworICAgICAgICAgICAgICBpZiAoIUVRIChi bSwgUXQpKQorICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICB9CisgICAg ICAgICAgICAgIH0KKyAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9 CisgIGlmIChsbjEgPiBpeDEpCisgICAgeworICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0xKTsK KyAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgIGdvdG8gZm91bmQ7CisgICAgfQorICBpZiAobG4y ID4gaXgxKQorICAgIHsKKyAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMik7CisgICAgICBpZiAo IUVRIChibSwgUXQpKQorICAgICAgICBnb3RvIGZvdW5kOworICAgICAgcmV0dXJuIE1DX05PX0ZS SU5HRV9CSVRNQVA7CisgICAgfQorICAgIGVsc2UgaWYgKChibSA9IGJtMiwgTklMUCAoYm0pKSkK KyAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyBmb3VuZDoKKyAgcmV0dXJuIGxvb2t1 cF9mcmluZ2VfYml0bWFwIChibSk7Cit9CisKKy8qIFJlY2FsY3VsYXRlIHRoZSBiaXRtYXBzIHRv IHNob3cgaW4gdGhlIGZyaW5nZXMgb2Ygd2luZG93IFcuCisgICBPbmx5IG1hcmsgcm93cyB3aXRo IG1vZGlmaWVkIGJpdG1hcHMgZm9yIHVwZGF0ZSBpbiByZWRyYXdfZnJpbmdlX2JpdG1hcHNfcC4K KyAgIElmIEtFRVBfQ1VSUkVOVF9QIGlzIDAsIHVwZGF0ZSBjdXJyZW50X21hdHJpeC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3dfZW5kc19hdF96dl9wIE1DX0lGX0xJTlQgKD0gMCk7Cisg IGlmICh3LT5wc2V1ZG9fd2luZG93X3ApCisgICAgcmV0dXJuIDA7CisgIGlmICghTUlOSV9XSU5E T1dfUCAodykKKyAgICAgICYmIChpbmQgPSBCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGlu ZGljYXRlX2J1ZmZlcl9ib3VuZGFyaWVzKSwgIU5JTFAgKGluZCkpKQorICAgIHsKKyAgICAgIGlm IChFUSAoaW5kLCBRbGVmdCkgfHwgRVEgKGluZCwgUXJpZ2h0KSkKKyAgICAgICAgYm91bmRhcnlf dG9wID0gYm91bmRhcnlfYm90ID0gYXJyb3dfdG9wID0gYXJyb3dfYm90ID0gaW5kOworICAgICAg ZWxzZSBpZiAoQ09OU1AgKGluZCkKKyAgICAgICAgICAgICAgICYmIENPTlNQIChYQ0FSIChpbmQp KSkKKyAgICAgICAgeworICAgICAgICAgIExpc3BfT2JqZWN0IHBvczsKKyAgICAgICAgICBpZiAo cG9zID0gbWNfYXNzcSAoUXQsIGluZCksICFOSUxQIChwb3MpKQorICAgICAgICAgICAgYm91bmRh cnlfdG9wID0gYm91bmRhcnlfYm90ID0gYXJyb3dfdG9wID0gYXJyb3dfYm90ID0gWENEUiAocG9z KTsKKyAgICAgICAgICBpZiAocG9zID0gbWNfYXNzcSAoUXRvcCwgaW5kKSwgIU5JTFAgKHBvcykp CisgICAgICAgICAgICBib3VuZGFyeV90b3AgPSBYQ0RSIChwb3MpOworICAgICAgICAgIGlmIChw b3MgPSBtY19hc3NxIChRYm90dG9tLCBpbmQpLCAhTklMUCAocG9zKSkKKyAgICAgICAgICAgIGJv dW5kYXJ5X2JvdCA9IFhDRFIgKHBvcyk7CisgICAgICAgICAgaWYgKHBvcyA9IG1jX2Fzc3EgKFF1 cCwgaW5kKSwgIU5JTFAgKHBvcykpCisgICAgICAgICAgICBhcnJvd190b3AgPSBYQ0RSIChwb3Mp OworICAgICAgICAgIGlmIChwb3MgPSBtY19hc3NxIChRZG93biwgaW5kKSwgIU5JTFAgKHBvcykp CisgICAgICAgICAgICBhcnJvd19ib3QgPSBYQ0RSIChwb3MpOworICAgICAgICB9CisgICAgICBl bHNlCisgICAgICAgIC8qIEFueXRoaW5nIGVsc2UgbWVhbnMgYm91bmRhcnkgb24gbGVmdCBhbmQg bm8gYXJyb3dzLiAgKi8KKyAgICAgICAgYm91bmRhcnlfdG9wID0gYm91bmRhcnlfYm90ID0gUWxl ZnQ7CisgICAgfQorICB0b3BfaW5kX3JuID0gYm90X2luZF9ybiA9IC0xOworICBpZiAoIU5JTFAg KGluZCkpCisgICAgeworICAgICAgZm9yICh5ID0gdy0+dnNjcm9sbCwgcm4gPSAwOworICAgICAg ICAgICB5IDwgeWIgJiYgcm4gPCBucm93czsKKyAgICAgICAgICAgeSArPSByb3ctPmhlaWdodCwg KytybikKKyAgICAgICAgeworICAgICAgICAgIHJvdyA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dz ICsgcm47CisgICAgICAgICAgaWYgKCFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgICAgIHJvdyA9 IHctPmN1cnJlbnRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgcm93LT5pbmRpY2F0ZV9i b2JfcCA9IHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcCA9IDA7CisgICAgICAgICAgcm93LT5pbmRp Y2F0ZV9lb2JfcCA9IHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCA9IDA7CisgICAgICAgICAg aWYgKCFyb3ctPm1vZGVfbGluZV9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAo dG9wX2luZF9ybiA8IDAgJiYgcm93LT52aXNpYmxlX2hlaWdodCA+IDApCisgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgaWYgKE1BVFJJWF9ST1dfU1RBUlRfQ0hBUlBPUyAocm93 KSA8PSBCVUZfQkVHViAoWEJVRkZFUiAody0+Y29udGVudHMpKQorICAgICAgICAgICAgICAgICAg ICAgICYmICFNQVRSSVhfUk9XX1BBUlRJQUxMWV9WSVNJQkxFX0FUX1RPUF9QICh3LCByb3cpKQor ICAgICAgICAgICAgICAgICAgICByb3ctPmluZGljYXRlX2JvYl9wID0gIU5JTFAgKGJvdW5kYXJ5 X3RvcCk7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHJvdy0+ aW5kaWNhdGVfdG9wX2xpbmVfcCA9ICFOSUxQIChhcnJvd190b3ApOworICAgICAgICAgICAgICAg ICAgdG9wX2luZF9ybiA9IHJuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgaWYg KGJvdF9pbmRfcm4gPCAwKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGlm IChNQVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpID49IEJVRl9aViAoWEJVRkZFUiAody0+Y29u dGVudHMpKQorICAgICAgICAgICAgICAgICAgICAgICYmICFNQVRSSVhfUk9XX1BBUlRJQUxMWV9W SVNJQkxFX0FUX0JPVFRPTV9QICh3LCByb3cpKQorICAgICAgICAgICAgICAgICAgICByb3ctPmlu ZGljYXRlX2VvYl9wID0gIU5JTFAgKGJvdW5kYXJ5X2JvdCksIGJvdF9pbmRfcm4gPSBybjsKKyAg ICAgICAgICAgICAgICAgIGVsc2UgaWYgKHkgKyByb3ctPmhlaWdodCA+PSB5YikKKyAgICAgICAg ICAgICAgICAgICAgcm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wID0gIU5JTFAgKGFycm93X2Jv dCksIGJvdF9pbmRfcm4gPSBybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9Cisg ICAgICAgIH0KKyAgICB9CisgIGVtcHR5X3BvcyA9IEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgaW5kaWNhdGVfZW1wdHlfbGluZXMpOworICBpZiAoIU5JTFAgKGVtcHR5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q LworICB0b3BfaW5kX21pbl95ID0gYm90X2luZF9tYXhfeSA9IC0xOworICBpZiAodG9wX2luZF9y biA+PSAwKQorICAgIHsKKyAgICAgIGludCBibiA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAg ICByb3cgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHRvcF9pbmRfcm47CisgICAgICBpZiAo IXJvdy0+ZW5hYmxlZF9wKQorICAgICAgICByb3cgPSB3LT5jdXJyZW50X21hdHJpeC0+cm93cyAr IHRvcF9pbmRfcm47CisgICAgICB0b3Bfcm93X2VuZHNfYXRfenZfcCA9IHJvdy0+ZW5kc19hdF96 dl9wOworICAgICAgaWYgKHJvdy0+aW5kaWNhdGVfYm9iX3ApCisgICAgICAgIHsKKyAgICAgICAg ICBpZiAoRVEgKGJvdW5kYXJ5X3RvcCwgUWxlZnQpKQorICAgICAgICAgICAgYm4gPSAoKHJvdy0+ aW5kaWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5kYXJ5X2JvdCwgUWxlZnQpKQorICAgICAgICAgICAg PyBNQ19MRUZUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKQorICAg ICAgICAgICAgOiBNQ19MRUZUX0ZSSU5HRSAoMiwgUXRvcCwgMCkpOworICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgIGJuID0gKChyb3ctPmluZGljYXRlX2VvYl9wICYmIEVRIChib3VuZGFyeV9i b3QsIFFyaWdodCkpCisgICAgICAgICAgICA/IE1DX1JJR0hUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0 b20sIHJvdy0+ZW5kc19hdF96dl9wKQorICAgICAgICAgICAgOiBNQ19SSUdIVF9GUklOR0UgKDIs IFF0b3AsIDApKTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV90b3Bf bGluZV9wKQorICAgICAgICB7CisgICAgICAgICAgaWYgKEVRIChhcnJvd190b3AsIFFsZWZ0KSkK KyAgICAgICAgICAgIGJuID0gTUNfTEVGVF9GUklOR0UgKDYsIFF1cCwgMCk7CisgICAgICAgICAg ZWxzZQorICAgICAgICAgICAgYm4gPSBNQ19SSUdIVF9GUklOR0UgKDYsIFF1cCwgMCk7CisgICAg ICAgIH0KKyAgICAgIGlmIChibiAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICB7Cisg ICAgICAgICAgc3RydWN0IGZyaW5nZV9iaXRtYXAgKmZiID0gZ2V0X2ZyaW5nZV9iaXRtYXBfZGF0 YSAoYm4pOworICAgICAgICAgIGlmIChmYi0+YWxpZ24gPT0gQUxJR05fQklUTUFQX1RPUCAmJiBm Yi0+cGVyaW9kID09IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHN0cnVjdCBnbHlw aF9yb3cgKnJvdzE7CisgICAgICAgICAgICAgIGludCB0b3BfaW5kX21heF95OworICAgICAgICAg ICAgICB0b3BfaW5kX21pbl95ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgICAg ICAgICAgICAgIHRvcF9pbmRfbWF4X3kgPSB0b3BfaW5kX21pbl95ICsgZmItPmhlaWdodDsKKyAg ICAgICAgICAgICAgaWYgKHRvcF9pbmRfbWF4X3kgPiB5YikKKyAgICAgICAgICAgICAgICB0b3Bf aW5kX21heF95ID0geWI7CisgICAgICAgICAgICAgIGZvciAoeSA9IHJvdy0+eSArIHJvdy0+aGVp Z2h0LCBybiA9IHRvcF9pbmRfcm4gKyAxOworICAgICAgICAgICAgICAgICAgIHkgPCB0b3BfaW5k X21heF95ICYmIHJuIDwgbnJvd3M7CisgICAgICAgICAgICAgICAgICAgeSArPSByb3cxLT5oZWln aHQsIHJuKyspCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgaWYgKGJvdF9p bmRfcm4gPj0gMCAmJiBybiA+PSBib3RfaW5kX3JuKQorICAgICAgICAgICAgICAgICAgICBicmVh azsKKyAgICAgICAgICAgICAgICAgIHJvdzEgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHJu OworICAgICAgICAgICAgICAgICAgaWYgKCFyb3cxLT5lbmFibGVkX3ApCisgICAgICAgICAgICAg ICAgICAgIHJvdzEgPSB3LT5jdXJyZW50X21hdHJpeC0+cm93cyArIHJuOworICAgICAgICAgICAg ICAgICAgcm93MS0+aW5kaWNhdGVfYm9iX3AgPSByb3ctPmluZGljYXRlX2JvYl9wOworICAgICAg ICAgICAgICAgICAgcm93MS0+aW5kaWNhdGVfdG9wX2xpbmVfcCA9IHJvdy0+aW5kaWNhdGVfdG9w X2xpbmVfcDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAg ICB9CisgIGlmIChib3RfaW5kX3JuID49IDApCisgICAgeworICAgICAgaW50IGJuID0gTUNfTk9f RlJJTkdFX0JJVE1BUDsKKyAgICAgIHJvdyA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgYm90 X2luZF9ybjsKKyAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgICAgIHJvdyA9IHctPmN1 cnJlbnRfbWF0cml4LT5yb3dzICsgYm90X2luZF9ybjsKKyAgICAgIGJvdF9yb3dfZW5kc19hdF96 dl9wID0gcm93LT5lbmRzX2F0X3p2X3A7CisgICAgICBpZiAocm93LT5pbmRpY2F0ZV9lb2JfcCkK KyAgICAgICAgeworICAgICAgICAgIGlmIChFUSAoYm91bmRhcnlfYm90LCBRbGVmdCkpCisgICAg ICAgICAgICBibiA9IE1DX0xFRlRfRlJJTkdFICgzLCBRYm90dG9tLCByb3ctPmVuZHNfYXRfenZf cCk7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgYm4gPSBNQ19SSUdIVF9GUklOR0UgKDMs IFFib3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAo cm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wKQorICAgICAgICB7CisgICAgICAgICAgaWYgKEVR IChhcnJvd19ib3QsIFFsZWZ0KSkKKyAgICAgICAgICAgIGJuID0gTUNfTEVGVF9GUklOR0UgKDcs IFFkb3duLCAwKTsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICBibiA9IE1DX1JJR0hUX0ZS SU5HRSAoNywgUWRvd24sIDApOworICAgICAgICB9CisgICAgICBpZiAoYm4gIT0gTUNfTk9fRlJJ TkdFX0JJVE1BUCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBmcmluZ2VfYml0bWFwICpm YiA9IGdldF9mcmluZ2VfYml0bWFwX2RhdGEgKGJuKTsKKyAgICAgICAgICBpZiAoZmItPmFsaWdu ID09IEFMSUdOX0JJVE1BUF9CT1RUT00gJiYgZmItPnBlcmlvZCA9PSAwKQorICAgICAgICAgICAg eworICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cxOworICAgICAgICAgICAgICBp bnQgYm90X2luZF9taW5feTsKKyAgICAgICAgICAgICAgYm90X2luZF9tYXhfeSA9IHJvdy0+eSAr IHJvdy0+dmlzaWJsZV9oZWlnaHQ7CisgICAgICAgICAgICAgIGJvdF9pbmRfbWluX3kgPSBib3Rf aW5kX21heF95IC0gZmItPmhlaWdodDsKKyAgICAgICAgICAgICAgaWYgKGJvdF9pbmRfbWluX3kg PCBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KSkKKyAgICAgICAgICBib3RfaW5kX21pbl95 ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgICAgICAgICAgICAgIGZvciAoeSA9 IHJvdy0+eSwgcm4gPSBib3RfaW5kX3JuIC0gMTsKKyAgICAgICAgICAgICB5ID49IGJvdF9pbmRf bWluX3kgJiYgcm4gPj0gMDsKKyAgICAgICAgICAgICB5IC09IHJvdzEtPmhlaWdodCwgcm4tLSkK KyAgICAgICAgICB7CisgICAgICAgICAgICBpZiAodG9wX2luZF9ybiA+PSAwICYmIHJuIDw9IHRv cF9pbmRfcm4pCisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgcm93MSA9IHctPmRl c2lyZWRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgICBpZiAoIXJvdzEtPmVuYWJsZWRf cCkKKyAgICAgICAgICAgICAgcm93MSA9IHctPmN1cnJlbnRfbWF0cml4LT5yb3dzICsgcm47Cisg ICAgICAgICAgICByb3cxLT5pbmRpY2F0ZV9lb2JfcCA9IHJvdy0+aW5kaWNhdGVfZW9iX3A7Cisg ICAgICAgICAgICByb3cxLT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wID0gcm93LT5pbmRpY2F0ZV9i b3R0b21fbGluZV9wOworICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAg IH0KKyAgTGlzcF9PYmplY3QgYnVmID0gdy0+Y29udGVudHM7CisgIENIRUNLX0JVRkZFUiAoYnVm KTsKKyAgYm9vbCBhdXRvX2hzY3JvbGxfbW9kZV9wID0gRVEgKEZidWZmZXJfbG9jYWxfdmFsdWUg KFFhdXRvX2hzY3JvbGxfbW9kZSwgYnVmKSwgUWN1cnJlbnRfbGluZSk7CisgIC8qIEVYQU1QTEU6 ICAoc2Nyb2xsLWxlZnQgNSkgKi8KKyAgYm9vbCBoc2NsX2FsbF90ZW1wX3AgPSAody0+c3VzcGVu ZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xs X21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhB TVBMRTogIEMtdSBDLXggPCBhbmQgZG8gbm90aGluZy4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJt XzBfcCA9ICh3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9o c2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xs ID09IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBzb21ldGhp bmcgZWxzZSBiZXNpZGVzIGhvcml6b250YWxseSBzY3JvbGxpbmcgdGhlCisgICAgICAgICAgICAg ICBjdXJyZW50IGxpbmUgZGlmZmVyZW50bHkuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUg aXMgX25vdF8gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhz Y2xfYWxsX3Blcm1fMV9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHct Pm1pbl9oc2Nyb2xsID09IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFu ZCAuLi4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFsbHkg c2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8yX3AgPSAoIXct PnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0 b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3Jv bGwgPT0gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4g MAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhz Y3JvbGwpOworICAvKiBFWEFNUExFOiAgKHNjcm9sbC1sZWZ0IDUpOyBhbmQsIHRoZW4gcHJlc3Mg dGhlIGxlZnQgYXJyb3cga2V5IG9uZSB0aW1lLgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5l IF9pc18gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiovCisgIGJvb2wgaHNjbF90 ZW1wX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAg JiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3Jv bGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gMCk7Cisg IC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIHNvbWV0aGluZyB0aGF0IGNhdXNlcyB0aGUg Y3VycmVudCBsaW5lIHRvIGJlCisgICAgICAgICAgICAgICBob3Jpem9udGFsbHkgc2Nyb2xsZWQg ZGlmZmVyZW50bHkuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFs bHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9wZXJtX3AgPSAoIXctPnN1 c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xs X21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAg ICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAg ICAgJiYgdy0+bWluX2hzY3JvbGwgIT0gdy0+aHNjcm9sbCk7CisgIHN0cnVjdCBmcmFtZSAqZiA9 IFhGUkFNRSAody0+ZnJhbWUpOworICBmb3IgKHkgPSB3LT52c2Nyb2xsLCBybiA9IDA7CisgICAg ICAgeSA8IHliICYmIHJuIDwgbnJvd3M7CisgICAgICAgeSArPSByb3ctPmhlaWdodCwgcm4rKykK KyAgICB7CisgIGludCBsZWZ0LCByaWdodDsKKyAgdW5zaWduZWQgbGVmdF9mYWNlX2lkLCByaWdo dF9mYWNlX2lkOworICBpbnQgbGVmdF9vZmZzZXQsIHJpZ2h0X29mZnNldDsKKyAgYm9vbCBwZXJp b2RpY19wOworICByb3cgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHJuOworICBjdXIgPSB3 LT5jdXJyZW50X21hdHJpeC0+cm93cyArIHJuOworICBpbnQgdnBvc19kZXNpcmVkID0gTUFUUklY X1JPV19WUE9TICh3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHJuLCB3LT5kZXNpcmVkX21hdHJp eCk7CisgIGludCB2cG9zX2N1cnJlbnQgPSBNQVRSSVhfUk9XX1ZQT1MgKHctPmN1cnJlbnRfbWF0 cml4LT5yb3dzICsgcm4sIHctPmN1cnJlbnRfbWF0cml4KTsKKyAgaW50IG1jX2xlZnRfZnJpbmdl X2JpdG1hcCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgIGludCBtY19sZWZ0X2ZyaW5nZV9mYWNl X2lkID0gREVGQVVMVF9GQUNFX0lEOworICBpbnQgbWNfcmlnaHRfZnJpbmdlX2JpdG1hcCA9IE1D X05PX0ZSSU5HRV9CSVRNQVA7CisgIGludCBtY19yaWdodF9mcmluZ2VfZmFjZV9pZCA9IERFRkFV TFRfRkFDRV9JRDsKKyAgZm9yIChpbnQgZWx0ID0gMDs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aGVzW2VsdF0u YmFja2dyb3VuZC5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSB3 LT5jaF9lbHRzLmNhY2hlc1tlbHRdLmJhY2tncm91bmQuZ3JlZW4sCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAuYmx1ZSA9IHctPmNoX2VsdHMuY2FjaGVzW2VsdF0uYmFja2dyb3VuZC5i bHVlfTsKKyAgICAgIGJvb2wgYWN0aXZlX3AgPSB3LT5jaF9lbHRzLmNhY2hlc1tlbHRdLmFjdGl2 ZV9wOworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gdy0+Y2hfZWx0cy5jYWNo ZXNbZWx0XS5nbHlwaF9mbGF2b3I7CisgICAgICBib29sIGVuYWJsZWRfcCA9IHctPmNoX2VsdHMu Y2FjaGVzW2VsdF0uZW5hYmxlZF9wOworICAgICAgaWYgKCh2cG9zID09IHZwb3NfZGVzaXJlZCB8 fCB2cG9zID09IHZwb3NfY3VycmVudCkKKyAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgPT0gTUNf T1ZFUkxBWV9BUlJPV19CSVRNQVAKKyAgICAgICAgICAmJiAhaHNjbF9hbGxfdGVtcF9wCisgICAg ICAgICAgJiYgIWhzY2xfdGVtcF9wCisgICAgICAgICAgJiYgIWhzY2xfcGVybV9wCisgICAgICAg ICAgJiYgIWhzY2xfYWxsX3Blcm1fMF9wCisgICAgICAgICAgJiYgIWhzY2xfYWxsX3Blcm1fMV9w CisgICAgICAgICAgJiYgIWhzY2xfYWxsX3Blcm1fMl9wCisgICAgICAgICAgJiYgZW5hYmxlZF9w KQorICAgICAgICB7CisgICAgICAgICAgaW50IGZyaW5nZV9iaXRtYXAgPSBNQ19OT19GUklOR0Vf QklUTUFQOworICAgICAgICAgIGVudW0gZmFjZV9pZCBvdmVybGF5X2Fycm93X2ZhY2VfaWQgPQor ICAgICAgICAgICAgKCFhY3RpdmVfcAorICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVG RkVSICh3LT5jb250ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgICAgID8g bG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1pbmFjdGl2 ZS1mYWNlIiksIHRydWUpCisgICAgICAgICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAgICAgICAg PyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWZhY2Ui KSwgdHJ1ZSkKKyAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAgIG1jX2xl ZnRfZnJpbmdlX2ZhY2VfaWQgPSAoY3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQ KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBvdmVybGF5X2Fycm93X2Zh Y2VfaWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNF X0lEOworICAgICAgICAgIGlmICh3LT5oc2Nyb2xsICE9IDApCisgICAgICAgICAgICBmcmluZ2Vf Yml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistb3ZlcmxheS1hcnJv dyIpLCBmYWxzZSwgdHJ1ZSk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGZyaW5n ZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1vdmVybGF5LWFy cm93IiksIHRydWUsIHRydWUpOworICAgICAgICAgIG1jX2xlZnRfZnJpbmdlX2JpdG1hcCA9IChj dXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgIH0KKyAgICAgICAgZWxz ZSBpZiAoKHZwb3MgPT0gdnBvc19kZXNpcmVkIHx8IHZwb3MgPT0gdnBvc19jdXJyZW50KQorICAg ICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgPT0gTUNfT1ZFUkxBWV9BUlJPV19CSVRNQVAK KyAgICAgICAgICAgICAgICAgJiYgKGhzY2xfYWxsX3RlbXBfcAorICAgICAgICAgICAgICAgICAg ICAgfHwgaHNjbF9hbGxfcGVybV8wX3AKKyAgICAgICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxs X3Blcm1fMV9wCisgICAgICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzJfcAorICAg ICAgICAgICAgICAgICAgICAgfHwgaHNjbF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgICAgIHx8 IGhzY2xfcGVybV9wKQorICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAg eworICAgICAgICAgICAgaW50IGZyaW5nZV9iaXRtYXAgPSBNQ19OT19GUklOR0VfQklUTUFQOwor ICAgICAgICAgICAgZW51bSBmYWNlX2lkIG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAg ICAgICAgICghYWN0aXZlX3AKKyAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgICAgICAgPyBs b29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtaW5h Y3RpdmUtZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAg ICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJy b3ctaHNjbC1mYWNlIiksIHRydWUpCisgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOwor ICAgICAgICAgICAgbWNfbGVmdF9mcmluZ2VfZmFjZV9pZCA9IChjdXJzb3JfdHlwZSA9PSBNQ19M RUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gb3ZlcmxheV9hcnJvd19mYWNlX2lkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAgICAgaWYgKGhzY2xfYWxsX3Blcm1f MF9wKQorICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAg KHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIGZhbHNlLCBmYWxzZSk7CisgICAgICAgICAgICAg IGVsc2UgaWYgKGhzY2xfYWxsX3Blcm1fMV9wKQorICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRt YXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgdHJ1 ZSwgZmFsc2UpOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xfYWxsX3Blcm1fMl9wKQor ICAgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3 LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCBmYWxzZSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAg ICBlbHNlIGlmIChoc2NsX3Blcm1fcCkKKyAgICAgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1h cCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCB0cnVl LCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF9hbGxfdGVtcF9wKQor ICAgICAgICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1h cCAodywgaW50ZXJuICgiKy1oc2NsLXRlbXAiKSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAgICAg ICAgICAgICAgICBlbHNlIGlmIChoc2NsX3RlbXBfcCkKKyAgICAgICAgICAgICAgICAgICAgICAg IGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2Ns LXRlbXAiKSwgdHJ1ZSwgZmFsc2UpOworICAgICAgICAgICAgbWNfbGVmdF9mcmluZ2VfYml0bWFw ID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IGZyaW5nZV9iaXRtYXAKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgICAgfQor ICAgICAgICAgIGVsc2UgaWYgKCh2cG9zID09IHZwb3NfZGVzaXJlZCB8fCB2cG9zID09IHZwb3Nf Y3VycmVudCkKKyAgICAgICAgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xM T1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlw aF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAg ICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5H TEUKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNB TF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZv ciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAg ICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAg ICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIK KyAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9C QVJfQkFDS1NMQVNIKQorICAgICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIExpc3BfT2JqZWN0IGJpdG1hcF9mbGF2b3IgPSAoZ2x5cGhf Zmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0 X2Fycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlw aF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVykKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRf aG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEUpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hvbGxvd19y ZWN0YW5nbGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGds eXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jhcl9yaWdodF9h cnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhf Zmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVykKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGlj YWxfYmFyX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXIKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19S RVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gUW1jX3JldmVyc2VkX3ZlcnRpY2FsX2JhcgorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JB Ul9CQUNLU0xBU0gpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gUW1jX3ZlcnRpY2FsX2Jhcl9iYWNrc2xhc2gKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogUW5pbDsKKyAgICAgICAgICAgICAgbWNfcmlnaHRfZnJpbmdlX2Jp dG1hcCA9IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbG9va3VwX2ZyaW5nZV9iaXRtYXAgKGJp dG1hcF9mbGF2b3IpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBN Q19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgICAgICBtY19yaWdodF9mcmluZ2VfZmFjZV9p ZCA9CisgICAgICAgICAgICAgICAgKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRN QVAKKyAgICAgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xM T1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9m bGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAg ICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKSkK KyAgICAgICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIist cmV2ZXJzZWQtdmVydGljYWwtYmFyLWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChj dXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAg JiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJS T1cKKyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVS VElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9y ICE9IE1DX1JFVkVSU0VEX1ZFUlRJQ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IFF0cnVuY2F0 aW9uLCAwKTsKKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfYm9iX3AgJiYgRVEgKGJvdW5k YXJ5X3RvcCwgUWxlZnQpKQorICAgICAgICB7CisgICAgICAgICAgbGVmdCA9ICgocm93LT5pbmRp Y2F0ZV9lb2JfcCAmJiBFUSAoYm91bmRhcnlfYm90LCBRbGVmdCkpCisgICAgICAgICAgICAgICAg ID8gTUNfTEVGVF9GUklOR0UgKDEsIFF0b3BfYm90dG9tLCB0b3Bfcm93X2VuZHNfYXRfenZfcCkK KyAgICAgICAgICAgICAgICAgOiBNQ19MRUZUX0ZSSU5HRSAoMiwgUXRvcCwgMCkpOworICAgICAg ICAgIGlmICh0b3BfaW5kX21pbl95ID49IDApCisgICAgICAgICAgICBsZWZ0X29mZnNldCA9IHRv cF9pbmRfbWluX3kgLSByb3ctPnk7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5k aWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5kYXJ5X2JvdCwgUWxlZnQpKQorICAgICAgICB7CisgICAg ICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdFICgzLCBRYm90dG9tLCBib3Rfcm93X2VuZHNfYXRf enZfcCk7CisgICAgICAgICAgaWYgKGJvdF9pbmRfbWF4X3kgPj0gMCkKKyAgICAgICAgICAgIGxl ZnRfb2Zmc2V0ID0gYm90X2luZF9tYXhfeSAtIChyb3ctPnkgKyByb3ctPnZpc2libGVfaGVpZ2h0 KTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAoKCFyb3ctPnJldmVyc2VkX3AgJiYgTUFUUklY X1JPV19DT05USU5VQVRJT05fTElORV9QIChyb3cpKQorICAgICAgICAgICAgICAgfHwgKHJvdy0+ cmV2ZXJzZWRfcCAmJiByb3ctPmNvbnRpbnVlZF9wKSkKKyAgICAgICAgbGVmdCA9IE1DX0xFRlRf RlJJTkdFICg0LCBRY29udGludWF0aW9uLCAwKTsKKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNh dGVfZW1wdHlfbGluZV9wICYmIEVRIChlbXB0eV9wb3MsIFFsZWZ0KSkKKyAgICAgICAgbGVmdCA9 IE1DX0xFRlRfRlJJTkdFICg1LCBRZW1wdHlfbGluZSwgMCk7CisgICAgICBlbHNlIGlmIChyb3ct PmluZGljYXRlX3RvcF9saW5lX3AgJiYgRVEgKGFycm93X3RvcCwgUWxlZnQpKQorICAgICAgICB7 CisgICAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdFICg2LCBRdXAsIDApOworICAgICAgICAg IGlmICh0b3BfaW5kX21pbl95ID49IDApCisgICAgICAgICAgICBsZWZ0X29mZnNldCA9IHRvcF9p bmRfbWluX3kgLSByb3ctPnk7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNh dGVfYm90dG9tX2xpbmVfcCAmJiBFUSAoYXJyb3dfYm90LCBRbGVmdCkpCisgICAgICAgIHsKKyAg ICAgICAgICBsZWZ0ID0gTUNfTEVGVF9GUklOR0UgKDcsIFFkb3duLCAwKTsKKyAgICAgICAgICBp ZiAoYm90X2luZF9tYXhfeSA+PSAwKQorICAgICAgICAgICAgbGVmdF9vZmZzZXQgPSBib3RfaW5k X21heF95IC0gKHJvdy0+eSArIHJvdy0+dmlzaWJsZV9oZWlnaHQpOworICAgICAgICB9CisgICAg ICBlbHNlCisgICAgICAgIGxlZnQgPSBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgLyogRGVj aWRlIHdoaWNoIGJpdG1hcCB0byBkcmF3IGluIHRoZSByaWdodCBmcmluZ2UuICAqLworICAgICAg aWYgKFdJTkRPV19SSUdIVF9GUklOR0VfV0lEVEggKHcpID09IDApCisgICAgICAgIHJpZ2h0ID0g TUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgIGVsc2UgaWYgKHJvdy0+cmlnaHRfdXNlcl9mcmlu Z2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgIHsKKyAgICAgICAgICBy aWdodCA9IHJvdy0+cmlnaHRfdXNlcl9mcmluZ2VfYml0bWFwOworICAgICAgICAgIHJpZ2h0X2Zh Y2VfaWQgPSByb3ctPnJpZ2h0X3VzZXJfZnJpbmdlX2ZhY2VfaWQ7CisgICAgICAgIH0KKyAgICAg IGVsc2UgaWYgKCghcm93LT5yZXZlcnNlZF9wICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3Ap CisgICAgICAgICAgICAgICB8fCAocm93LT5yZXZlcnNlZF9wICYmIHJvdy0+dHJ1bmNhdGVkX29u X2xlZnRfcCkpCisgICAgICAgIHJpZ2h0ID0gTUNfUklHSFRfRlJJTkdFICgwLCBRdHJ1bmNhdGlv biwgMCk7CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2JvYl9wICYmIEVRIChib3VuZGFy eV90b3AsIFFyaWdodCkpCisgICAgICAgIHsKKyAgICAgICAgICByaWdodCA9ICgocm93LT5pbmRp Y2F0ZV9lb2JfcCAmJiBFUSAoYm91bmRhcnlfYm90LCBRcmlnaHQpKQorICAgICAgICAgICAgID8g TUNfUklHSFRfRlJJTkdFICgxLCBRdG9wX2JvdHRvbSwgdG9wX3Jvd19lbmRzX2F0X3p2X3ApCisg ICAgICAgICAgICAgOiBNQ19SSUdIVF9GUklOR0UgKDIsIFF0b3AsIDApKTsKKyAgICAgICAgICBp ZiAodG9wX2luZF9taW5feSA+PSAwKQorICAgICAgICAgICAgcmlnaHRfb2Zmc2V0ID0gdG9wX2lu ZF9taW5feSAtIHJvdy0+eTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0 ZV9lb2JfcCAmJiBFUSAoYm91bmRhcnlfYm90LCBRcmlnaHQpKQorICAgICAgICB7CisgICAgICAg ICAgcmlnaHQgPSBNQ19SSUdIVF9GUklOR0UgKDMsIFFib3R0b20sIGJvdF9yb3dfZW5kc19hdF96 dl9wKTsKKyAgICAgICAgICBpZiAoYm90X2luZF9tYXhfeSA+PSAwKQorICAgICAgICAgICAgcmln aHRfb2Zmc2V0ID0gYm90X2luZF9tYXhfeSAtIChyb3ctPnkgKyByb3ctPnZpc2libGVfaGVpZ2h0 KTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAoKCFyb3ctPnJldmVyc2VkX3AgJiYgcm93LT5j b250aW51ZWRfcCkKKyAgICAgICAgICAgICAgIHx8IChyb3ctPnJldmVyc2VkX3AgJiYgTUFUUklY X1JPV19DT05USU5VQVRJT05fTElORV9QIChyb3cpKSkKKyAgICAgICAgcmlnaHQgPSBNQ19SSUdI VF9GUklOR0UgKDQsIFFjb250aW51YXRpb24sIDApOworICAgICAgZWxzZSBpZiAocm93LT5pbmRp Y2F0ZV90b3BfbGluZV9wICYmIEVRIChhcnJvd190b3AsIFFyaWdodCkpCisgICAgICAgIHsKKyAg ICAgICAgICByaWdodCA9IE1DX1JJR0hUX0ZSSU5HRSAoNiwgUXVwLCAwKTsKKyAgICAgICAgICBp ZiAodG9wX2luZF9taW5feSA+PSAwKQorICAgICAgICAgICAgcmlnaHRfb2Zmc2V0ID0gdG9wX2lu ZF9taW5feSAtIHJvdy0+eTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0 ZV9ib3R0b21fbGluZV9wICYmIEVRIChhcnJvd19ib3QsIFFyaWdodCkpCisgICAgICAgIHsKKyAg ICAgICAgICByaWdodCA9IE1DX1JJR0hUX0ZSSU5HRSAoNywgUWRvd24sIDApOworICAgICAgICAg IGlmIChib3RfaW5kX21heF95ID49IDApCisgICAgICAgICAgICByaWdodF9vZmZzZXQgPSBib3Rf aW5kX21heF95IC0gKHJvdy0+eSArIHJvdy0+dmlzaWJsZV9oZWlnaHQpOworICAgICAgICB9Cisg ICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2VtcHR5X2xpbmVfcCAmJiBFUSAoZW1wdHlfcG9z LCBRcmlna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3ctPnJlZHJhd19mcmlu Z2VfYml0bWFwc19wID0gMTsKKyAgICAgICAgICBpZiAoIWtlZXBfY3VycmVudF9wKQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICBjdXItPnJlZHJhd19mcmluZ2VfYml0bWFwc19wID0gMTsK KyAgICAgICAgICAgICAgaWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0Vf QklUTUFQCisgICAgICAgICAgICAgICAgICB8fCBtY19yaWdodF9mcmluZ2VfYml0bWFwICE9IE1D X05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgY3VyLT5mcmluZ2VfYml0bWFwX3Bl cmlvZGljX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAg ICBjdXItPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcCA9IHBlcmlvZGljX3A7CisgICAgICAgICAg ICAgIGlmIChtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAg ICAgICAgICAgICAgICBjdXItPmxlZnRfZnJpbmdlX2JpdG1hcCA9IG1jX2xlZnRfZnJpbmdlX2Jp dG1hcDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPmxlZnRf ZnJpbmdlX2JpdG1hcCA9IGxlZnQ7CisgICAgICAgICAgICAgIGlmIChtY19sZWZ0X2ZyaW5nZV9i aXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICBjdXItPmxlZnRf ZnJpbmdlX2ZhY2VfaWQgPSBtY19sZWZ0X2ZyaW5nZV9mYWNlX2lkOworICAgICAgICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgICAgICAgIGN1ci0+bGVmdF9mcmluZ2VfZmFjZV9pZCA9IGxlZnRf ZmFjZV9pZDsKKyAgICAgICAgICAgICAgaWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19O T19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgIGN1ci0+bGVmdF9mcmluZ2Vfb2Zmc2V0 ID0gMDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPmxlZnRf ZnJpbmdlX29mZnNldCA9IGxlZnRfb2Zmc2V0OworICAgICAgICAgICAgICBpZiAobWNfcmlnaHRf ZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgIGN1 ci0+cmlnaHRfZnJpbmdlX2JpdG1hcCA9IG1jX3JpZ2h0X2ZyaW5nZV9iaXRtYXA7CisgICAgICAg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2VfYml0bWFw ID0gcmlnaHQ7CisgICAgICAgICAgICAgIGlmIChtY19yaWdodF9mcmluZ2VfYml0bWFwICE9IE1D X05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2VfZmFj ZV9pZCA9IG1jX3JpZ2h0X2ZyaW5nZV9mYWNlX2lkOworICAgICAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX2ZhY2VfaWQgPSByaWdodF9mYWNlX2lk OworICAgICAgICAgICAgICBpZiAobWNfcmlnaHRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklO R0VfQklUTUFQKQorICAgICAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX29mZnNldCA9IDA7 CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmlu Z2Vfb2Zmc2V0ID0gcmlnaHRfb2Zmc2V0OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAg ICBpZiAocm93LT5vdmVybGF5X2Fycm93X2JpdG1hcCA8I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05P X0ZSSU5HRV9CSVRNQVApCisgICAgeworICAgICAgb2Zmc2V0ID0gMDsKKyAgICB9CisgICAgZWxz ZSBpZiAobGVmdF9wKQorICAgICAgeworICAgICAgICB3aGljaCA9IHJvdy0+bGVmdF9mcmluZ2Vf Yml0bWFwOworICAgICAgICBmYWNlX2lkID0gcm93LT5sZWZ0X2ZyaW5nZV9mYWNlX2lkOworICAg ICAgICBvZmZzZXQgPSByb3ctPmxlZnRfZnJpbmdlX29mZnNldDsKKyAgICAgIH0KKyAgICAgIGVs c2UKKyAgICAgICAgeworICAgICAgICAgIHdoaWNoID0gcm93LT5yaWdodF9mcmluZ2VfYml0bWFw OworICAgICAgICAgIGZhY2VfaWQgPSByb3ctPnJpZ2h0X2ZyaW5nZV9mYWNlX2lkOworICAgICAg ICAgIG9mZnNldCA9IHJvdy0+cmlnaHRfZnJpbmdlX29mZnNldDsKKyAgICAgICAgfQorICBpZiAo ZmFjZV9pZCA9PSBERUZBVUxUX0ZBQ0VfSUQpCisgICAgeworICAgICAgTGlzcF9PYmplY3QgZmFj ZSA9IGZyaW5nZV9mYWNlc1t3aGljaF07CisgICAgICBmYWNlX2lkID0gTklMUCAoZmFjZSkgPyBs b29rdXBfbmFtZWRfZmFjZSAodywgZiwgUWZyaW5nZSwgZmFsc2UpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiBsb29rdXBfZGVyaXZlZF9mYWNlICh3LCBmLCBmYWNlLCBGUklOR0VfRkFD RV9JRCwgMCk7CisgICAgICBpZiAoZmFjZV9pZCA8IDApCisgICAgICAgIGZhY2VfaWQgPSBGUklO R0VfRkFDRV9JRDsKKyAgICB9CisgIGZiID0gZ2V0X2ZyaW5nZV9iaXRtYXBfZGF0YSAod2hpY2gp OworICBwZXJpb2QgPSBmYi0+cGVyaW9kOworICAvKiBDb252ZXJ0IHJvdyB0byBmcmFtZSBjb29y ZGluYXRlcy4gICovCisgIHAueSA9IFdJTkRPV19UT19GUkFNRV9QSVhFTF9ZICh3LCByb3ctPnkp ICsgb2Zmc2V0OworICBwLndoaWNoID0gd2hpY2g7CisgIHAuYml0cyA9IGZiLT5iaXRzOworICBw LndkID0gZmItPndpZHRoOworICBwLmggPSBmYi0+aGVpZ2h0OworICBwLmRoID0gKHBlcmlvZCA+ IDAgPyAocC55ICUgcGVyaW9kKSA6IDApOworICBwLmggLT0gcC5kaDsKKyAgLyogQWRqdXN0IHkg dG8gdGhlIG9mZnNldCBpbiB0aGUgcm93IHRvIHN0YXJ0IGRyYXdpbmcgdGhlIGJpdG1hcC4gICov CisgIHN3aXRjaCAoZmItPmFsaWduKQorICAgIHsKKyAgICBjYXNlIEFMSUdOX0JJVE1BUF9DRU5U RVI6CisgICAgICBwLnkgKz0gKHJvdy0+aGVpZ2h0IC0gcC5oKSAvIDI7CisgICAgICBicmVhazsK KyAgICBjYXNlIEFMSUdOX0JJVE1BUF9CT1RUT006CisgICAgICBwLnkgKz0gKHJvdy0+dmlzaWJs ZV9oZWlnaHQgLSBwLmgpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBBTElHTl9CSVRNQVBfVE9Q OgorICAgICAgYnJlYWs7CisgICAgfQorICBwLmZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGZhY2Vf aWQpOworICBpZiAocC5mYWNlID09IE5VTEwpCisgICAgeworICAgICAgLyogVGhpcyBjb3VsZCBo YXBwZW4gYWZ0ZXIgY2xlYXJpbmcgZmFjZSBjYWNoZS4KKyAgIEJ1dCBpdCBzaG91bGRuJ3QgaGFw cGVuIGFueW1vcmUuICArK2tmcyAqLworICAgICAgcmV0dXJuOworICAgIH0KKyAgcHJlcGFyZV9m YWNlX2Zvcl9kaXNwbGF5IChmLCBwLmZhY2UpOworICAvKiBDbGVhciBsZWZ0IGZyaW5nZSBpZiBu byBiaXRtYXAgdG8gZHJhdyBvciBpZiBiaXRtYXAgZG9lc24ndCBmaWxsCisgICAgIHRoZSBmcmlu Z2UuICAqLworICBwLmJ4ID0gLTE7CisgIGhlYWRlcl9saW5lX2hlaWdodCA9IFdJTkRPV19IRUFE RVJfTElORV9IRUlHSFQgKHcpOworICBwLmJ5ID0gV0lORE9XX1RPX0ZSQU1FX1BJWEVMX1kgKHcs IG1heCAoaGVhZGVyX2xpbmVfaGVpZ2h0LCByb3ctPnkpKTsKKyAgcC5ueSA9IHJvdy0+dmlzaWJs ZV9oZWlnaHQ7CisgIGlmIChsZWZ0X3ApCisgICAgeworICAgICAgaW50IHdkID0gV0lORE9XX0xF RlRfRlJJTkdFX1dJRFRIICh3KTsKKyAgICAgIGludCB4ID0gd2luZG93X2JveF9sZWZ0ICh3LCAo V0lORE9XX0hBU19GUklOR0VTX09VVFNJREVfTUFSR0lOUyAodykKKyAgICAgICAgICAgPyBMRUZU X01BUkdJTl9BUkVBCisgICAgICAgICAgIDogVEVYVF9BUkVBKSk7CisgICAgICBpZiAocC53ZCA+ IHdkKQorICAgICAgICBwLndkID0gd2Q7CisgICAgICBwLnggPSB4IC0gcC53ZCAtICh3ZCAtIHAu d2QpIC8gMjsKKyAgICAgIGlmIChwLndkIDwgd2QgfHwgcC55ID4gcC5ieSB8fCBwLnkgKyBwLmgg PCBwLmJ5ICsgcC5ueSkKKyAgICAgICAgeworICAgICAgICAgIC8qIElmIFcgaGFzIGEgdmVydGlj YWwgYm9yZGVyIHRvIGl0cyBsZWZ0LCBkb24ndCBkcmF3IG92ZXIgaXQuICAqLworICAgICAgICAg IHdkIC09ICgoIVdJTkRPV19MRUZUTU9TVF9QICh3KQorICAgICAgICAgICAgLyogVGhpcyBjb3Vs ZCBiZSB3cm9uZyB3aGVuIHdlIGFsbG93IHdpbmRvdyBsb2NhbAorICAgICAgICAgICAgICAgcmln aHQgZGl2aWRlcnMgLSBidXQgdGhlIHdpbmRvdyBvbiB0aGUgbGVmdCBpcyBoYXJkCisgICAgICAg ICAgICAgICB0byBnZXQuICAqLworICAgICAgICAgICAgJiYgIUZSQU1FX1JJR0hUX0RJVklERVJf V0lEVEggKGYpCisgICAgICAgICAgICAmJiAhV0lORE9XX0hBU19WRVJUSUNBTF9TQ1JPTExfQkFS ICh3KQorICAgICAgICAgICAgLyogQnV0IGRvbid0IHJlZHVjZSB0aGUgZnJpbmdlIHdpZHRoIGlm IHRoZSB3aW5kb3cKKyAgICAgICAgICAgICAgIGhhcyBhIGxlZnQgbWFyZ2luLCBiZWNhdXNlIHRo YXQgbWVhbnMgd2UgYXJlIG5vdAorICAgICAgICAgICAgICAgaW4gZGFuZ2VyIG9mIGRyYXdpbmcg b3ZlciB0aGUgdmVydGljYWwgYm9yZGVyLAorICAgICAgICAgICAgICAgYW5kIE9UT0ggbGVhdmlu ZyBvdXQgdGhhdCBvbmUgcGl4ZWwgbGVhdmVzIGJlaGluZAorICAgICAgICAgICAgICAgdHJhY2Vz IG9mIHRoZSBjdXJzb3IsIGlmIGl0IHdhcyBpbiBjb2x1bW4gemVybworICAgICAgICAgICAgICAg YmVmb3JlIGRyYXdpbmcgbm9uLWVtcHR5IG1hcmdpbiBhcmVhLiAgKi8KKyAgICAgICAgICAgICYm IHctPmxlZnRfbWFyZ2luX2NvbHMgPT0gMCkKKyAgICAgICAgICAgPyAxIDogMCk7CisgICAgICAg ICAgcC5ieCA9IHggLSB3ZDsKKyAgICAgICAgICBwLm54ID0gd2Q7CisgICAgICAgIH0KKyAgICB9 CisgIGVsc2UKKyAgICB7CisgICAgICBpbnQgeCA9IHdpbmRvd19ib3hfcmlnaHQgKHcsCisgICAg ICAgIChXSU5ET1dfSEFTX0ZSSU5HRVNfT1VUU0lERV9NQVJHSU5TICh3KQorICAgICAgICAgPyBS SUdIVF9NQVJHSU5fQVJFQQorICAgICAgICAgOiBURVhUX0FSRUEpKTsKKyAgICAgIGludCB3ZCA9 IFdJTkRPV19SSUdIVF9GUklOR0VfV0lEVEggKHcpOworICAgICAgaWYgKHAud2QgPiB3ZCkKKyAg ICAgICAgcC53ZCA9IHdkOworICAgICAgcC54ID0geCArICh3ZCAtIHAud2QpIC8gMjsKKyAgICAg IC8qIENsZ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gICAgZWxzZQorICAgICAgICAg ICAgY3Vyc29yID0gUWhvbGxvd19zbWFsbDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2Fz ZSBNQ19IT0xMT1dfQk9YOgorICAgICAgICAgIGlmIChyb3ctPnZpc2libGVfaGVpZ2h0ID49IFNU QU5EQVJEX0JJVE1BUF9IRUlHSFQgKGhvbGxvd19yZWN0YW5nbGVfYml0cykpCisgICAgICAgICAg ICBjdXJzb3IgPSBRaG9sbG93OworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGN1cnNvciA9 IFFob2xsb3dfc21hbGw7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTUNfRklMTEVE X0JPWDoKKyAgICAgICAgICBjdXJzb3IgPSBRYm94OworICAgICAgICAgIGJyZWFrOworICAgICAg ICBjYXNlIE1DX0JBUjoKKyAgICAgICAgICBjdXJzb3IgPSBRYmFyOworICAgICAgICAgIGJyZWFr OworICAgICAgICBjYXNlIE1DX0hCQVI6CisgICAgICAgICAgY3Vyc29yID0gUWhiYXI7CisgICAg ICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTUNfTk9fRlJJTkdFX0JJVE1BUDoKKyAgICAgICAg Y2FzZSBNQ19OT19DVVJTT1I6CisgICAgICAgIGNhc2UgTUNfUklHSFRfRlJJTkdFX0JJVE1BUDoK KyAgICAgICAgY2FzZSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGRlZmF1bHQ6Cisg ICAgICAgICAgdy0+cGh5c19jdXJzb3Jfb25fcCA9IDA7CisgICAgICAgICAgcm93LT5jdXJzb3Jf aW5fZnJpbmdlX3AgPSAwOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBpZiAo IU5JTFAgKGN1cnNvcikpCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgYm0gPSBtY19nZXRfbG9n aWNhbF9jdXJzb3JfYml0bWFwICh3LCBjdXJzb3IpOworICAgICAgICAgIGlmIChibSAhPSBNQ19O T19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19kcmF3X2Zy aW5nZV9iaXRtYXBfMSAodywgcm93LCBsZWZ0X3AsIDIsIGJtKTsKKyAgICAgICAgICAgICAgb3Zl cmxheSA9IEVRIChjdXJzb3IsIFFib3gpID8gMyA6IDE7CisgICAgICAgICAgICB9CisgICAgICAg IH0KKyAgICB9CisgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcF8xICh3LCByb3csIGxlZnRfcCwgb3Zl cmxheSwgTUNfTk9fRlJJTkdFX0JJVE1BUCk7CisgIGlmIChsZWZ0X3AgJiYgcm93LT5vdmVybGF5 X2Fycm93X2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgIG1jX2RyYXdfZnJpbmdl X2JpdG1hcF8xICh3LCByb3csIDEsIDEsIHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXApOworfQor CisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisK KwogI2RlZmluZSBOT19GUklOR0VfQklUTUFQIDAKICNkZWZpbmUgVU5ERUZfRlJJTkdFX0JJVE1B UCAxCiAjZGVmaW5lIE1BWF9TVEFOREFSRF9GUklOR0VfQklUTUFQUyBBUlJBWUVMVFMgKHN0YW5k YXJkX2JpdG1hcHMpCkBAIC0xNzAwLDYgKzMxOTAsMTY4IEBAIFJldHVybiBuaWwgaWYgUE9TIGlz IG5vdCB2aXNpYmxlIGluIFdJTkRPVy4gICovKQogdm9pZAogc3ltc19vZl9mcmluZ2UgKHZvaWQp CiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJT T1JTICov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AoUW1jX3F1YWRydXBsZV9hbmdsZV9kb3duLCBRZnJpbmdlLCBtYWtlX2ZpeG51 bSAoNDgpKTsKKyAgLyogKGdldCAnKy1xdWFkcnVwbGUtYW5nbGUtZG93biAnZnJpbmdlKSA9PiA0 OCAqLworCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogICBERUZTWU0gKFF0cnVuY2F0aW9uLCAidHJ1bmNhdGlvbiIpOwogICBERUZTWU0g KFFjb250aW51YXRpb24sICJjb250aW51YXRpb24iKTsKICAgREVGU1lNIChRb3ZlcmxheV9hcnJv dywgIm92ZXJsYXktYXJyb3ciKTsKZGlmZiAtLWdpdCBhL3NyYy9uc3Rlcm0uaCBiL3NyYy9uc3Rl cm0uaAppbmRleCA3OGNlNjA4Li44ZWYwZGZlIDEwMDY0NAotLS0gYS9zcmMvbnN0ZXJtLmgKKysr IGIvc3JjL25zdGVybS5oCkBAIC02NjAsNiArNjYwLDE2IEBAIHR5cGVkZWYgaWQgaW5zdGFuY2V0 eXBlOwogCiBAaW50ZXJmYWNlIEVtYWNzU2Nyb2xsZXIgOiBOU1Njcm9sbGVyCiAgIHsKKworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIE5T UmVjdCBtY19yZWN0YW5nbGU7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgIHN0 cnVjdCB3aW5kb3cgKndpbmRvdzsKICAgIHN0cnVjdCBmcmFtZSAqZnJhbWU7CiAgICBOU1Jlc3Bv bmRlciAqcHJldlJlc3BvbmRlcjsKQEAgLTY4MCw2ICs2OTAsMTggQEAgdHlwZWRlZiBpZCBpbnN0 YW5jZXR5cGU7CiAgICBpbnQgZW1fd2hvbGU7CiAgICB9CiAKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy0gKHZvaWQpbWNfc2V0X3JlY3Rhbmds ZTogKE5TUmVjdClyZWN0OworLSAoTlNSZWN0KW1jX2dldF9yZWN0YW5nbGU7CistIChzdHJ1Y3Qg d2luZG93ICopbWNfZ2V0X3dpbmRvdzsKKy0gKGJvb2wpbWNfanVkZ2U7CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKIC0gKGluc3RhbmNldHlwZSkgaW5pdEZyYW1lOiAoTlNSZWN0ICly IHdpbmRvdzogKExpc3BfT2JqZWN0KXdpbjsKIC0gKHZvaWQpc2V0RnJhbWU6IChOU1JlY3QpcjsK IApkaWZmIC0tZ2l0IGEvc3JjL25zdGVybS5tIGIvc3JjL25zdGVybS5tCmluZGV4IDgxZDM2YmUu LmEwMWZiOTMgMTAwNjQ0Ci0tLSBhL3NyYy9uc3Rlcm0ubQorKysgYi9zcmMvbnN0ZXJtLm0KQEAg LTc2LDYgKzc2LDEwOTEgQEAgVXBkYXRlZCBieSBDaHJpc3RpYW4gTGltcGFjaCAoY2hyaXNAbmlj ZS5jaCkKIHN0YXRpYyBFbWFjc01lbnUgKm1haW5NZW51OwogI2VuZGlmCiAKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKK3N0YXRpYyB2 b2lkIG5zX3Jlc2V0X2NsaXBwaW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tLS0gKi8KK3sKKyAgTlNUUkFDRV9XSEVOIChOU1RSQUNFX0dS T1VQX0ZPQ1VTLCAibWNfbnNfY2xpcF90b19yZWN0Iik7CisgIGlmIChyKQorICAgIHsKKyAgICAg IE5TVFJBQ0VfUkVDVCAoInIiLCAqcik7CisgICAgICBpZiAoW05TVmlldyBmb2N1c1ZpZXddID09 IEZSQU1FX05TX1ZJRVcgKGYpKQorICAgICAgICB7CisgICAgICAgICAgW1tOU0dyYXBoaWNzQ29u dGV4dCBjdXJyZW50Q29udGV4dF0gc2F2ZUdyYXBoaWNzU3RhdGVdOworICAgICAgICAgIGlmIChu ID09IDIpCisgICAgICAgICAgICBOU1JlY3RDbGlwTGlzdCAociwgMik7CisgICAgICAgICAgICBl bHNlCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAocm93LT5jbGlwICE9IE5V TEwpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIE5TUmVjdCByX2Ns aXA7CisgICAgICAgICAgICAgICAgICAgIHJfY2xpcC5vcmlnaW4ueCA9IHJvdy0+Y2xpcC0+eDsK KyAgICAgICAgICAgICAgICAgICAgcl9jbGlwLm9yaWdpbi55ID0gcm93LT5jbGlwLT55OworICAg ICAgICAgICAgICAgICAgICByX2NsaXAuc2l6ZS53aWR0aCA9IHJvdy0+Y2xpcC0+d2lkdGg7Cisg ICAgICAgICAgICAgICAgICAgIHJfY2xpcC5zaXplLmhlaWdodCA9IHJvdy0+Y2xpcC0+aGVpZ2h0 OworICAgICAgICAgICAgICAgICAgICBOU1JlY3Qgcl9zYXZlOworICAgICAgICAgICAgICAgICAg ICByX3NhdmUub3JpZ2luLnggPSByWzBdLm9yaWdpbi54OworICAgICAgICAgICAgICAgICAgICBy X3NhdmUub3JpZ2luLnkgPSByWzBdLm9yaWdpbi55OworICAgICAgICAgICAgICAgICAgICByX3Nh dmUuc2l6ZS53aWR0aCA9IHJbMF0uc2l6ZS53aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgcl9z YXZlLnNpemUuaGVpZ2h0ID0gclswXS5zaXplLmhlaWdodDsKKyAgICAgICAgICAgICAgICAgICAg bWNfbnNfaW50ZXJzZWN0X3JlY3RhbmdsZXMgKCZyX3NhdmUsICZyX2NsaXAsICZyWzBdKTsKKyAg ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBOU1JlY3RDbGlwICgqcik7CisgICAg ICAgICAgICAgIH0KKyAgICAgICAgICByZXR1cm4gWUVTOworICAgICAgICB9CisgICAgICBlbHNl CisgICAgICAgIHsKKyAgICAgICAgICBOU1ZpZXcgKnZpZXcgPSBGUkFNRV9OU19WSUVXIChmKTsK KyAgICAgICAgICBpbnQgaTsKKyAgICAgICAgICBmb3IgKGkgPSAwIDsgaSA8IG4gOyBpKyspCisg ICAgICAgICAgICBbdmlldyBzZXROZWVkc0Rpc3BsYXlJblJlY3Q6cltpXV07CisgICAgICAgIH0K KyAgICB9CisgIHJldHVybiBOTzsKK30KKworc3RhdGljIHZvaWQKK21jX25zX2RyYXdfd2luZG93 X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBz dHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICBpbnQgeCwgaW50IGZ4LCBp bnQgeSwgaW50IGZ5LCBpbnQgaHBvcywgaW50IHZwb3MsIGludCB3ZCwgaW50IGgsCisgICAgICAg ICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbCwgZW51bSB0eXBlX29mX2N1cnNvciBjdXJzb3Jf dHlwZSwKKyAgICAgICAgICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGgsIGVudW0gbWNfZmxhdm9y IGdseXBoX2ZsYXZvciwgYm9vbCBvbl9wLCBib29sIGFjdGl2ZV9wKQoreworICAvKiBUaGUgcHJp b3IgYnVnIG9mIGEgZG91YmxlIGltcHJpbnQgb24gdGhlIGdseXBoIH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DEuMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgZ3JlZW46IDEuMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGJsdWU6IDEuMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgYWxwaGE6IDEuMF07CisgIC0gIEFMVEVSTkFUSVZFIEVYQU1QTEU6Cisg ICAgIGVudW0gZmFjZV9pZCBkZWJ1Z2dpbmdfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlIChz LT53LCBzLT5mLCBpbnRlcm4gKCIrLWRlYnVnZ2luZy1mYWNlIiksIHRydWUpOworICAgICBzdHJ1 Y3QgZmFjZSAqZGVidWdnaW5nX2ZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIGRlYnVnZ2luZ19m YWNlX2lkKTsKKyAgICAgTlNDb2xvciAqY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAo TlNfRkFDRV9GT1JFR1JPVU5EIChkZWJ1Z2dpbmdfZmFjZSksIHMtPmYpOworICAgICBbY29sb3Ig c2V0XTsgKi8KKyAgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSAorICAgICAgfHwgZ2x5cGhf Zmxhdm9yID09IE1DX0dMWVBITEVTUykKKyAgICBbW05TQ29sb3IgY29sb3JXaXRoQ2FsaWJyYXRl ZFJlZDogbHNsLnJlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdyZWVuOiBsc2wu Z3JlZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmx1ZTogbHNsLmJsdWUKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHBoYTogMS4wXSBzZXRdOworICAgIGVsc2UK KyAgICAgIFtGUkFNRV9DVVJTT1JfQ09MT1IgKGYpIHNldF07CisgIGlmIChjdXJzb3JfdHlwZSA9 PSBNQ19GUkFNRURfQk9YKQorICAgIHsKKyAgICAgIExpc3BfT2JqZWN0IGJ1ZiA9IHctPmNvbnRl bnRzOworICAgICAgQ0hFQ0tfQlVGRkVSIChidWYpOworICAgICAgc3RydWN0IGJ1ZmZlciAqYiA9 IFhCVUZGRVIgKGJ1Zik7CisgICAgICBib29sIHJlZ2lvbl9hY3RpdmVfcCA9ICghTklMUCAoVnRy YW5zaWVudF9tYXJrX21vZGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklM UCAoQlZBUiAoYiwgbWFya19hY3RpdmUpKSk7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2JlZ2lu bmluZyA9IChyZWdpb25fYWN0aXZlX3ApID8gWEZJWE5VTSAoRnJlZ2lvbl9iZWdpbm5pbmcgKCkp IDogLTE7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2VuZCA9IChyZWdpb25fYWN0aXZlX3ApID8g WEZJWE5VTSAoRnJlZ2lvbl9lbmQgKCkpIDogLTE7CisgICAgICBwdHJkaWZmX3Qgb3BvaW50X3B0 ID0gKHcgPT0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93KSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IFBUCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBYRklYTlVNIChGbWFy a2VyX3Bvc2l0aW9uICh3LT5wb2ludG0pKTsKKyAgICAgIGJvb2wgcmVnaW9uX2luX2JvdW5kc19w ID0gKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg b3BvaW50X3B0ID49IHJlZ2lvbl9iZWdpbm5pbmcKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIG9wb2ludF9wdCA8IHJlZ2lvbl9lbmQpOworICAgICAgaWYgKHJlZ2lvbl9hY3Rp dmVfcAorICAgICAgICAgICYmIHJlZ2lvbl9pbl9ib3VuZHNfcAorICAgICAgICAgIC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0NvbG9yICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9vdXRfY29sb3Ig PSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChob2xsb3dfYWN0 aXZlX3JlZ2lvbl9vdXRfZmFjZSksIGYpOworICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9s bG93X2FjdGl2ZV9yZWdpb25fb3V0X2NvbG9yOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNl IGlmICghcmVnaW9uX2FjdGl2ZV9wICYmIGFjdGl2ZV9wKQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVk X2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1mYWNlIiksIHRydWUpOwor ICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9N X0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICBOU0NvbG9yICpo b2xsb3dfYWN0aXZlX2NvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfQkFD S0dST1VORCAoaG9sbG93X2FjdGl2ZV9mYWNlKSwgZik7CisgICAgICAgICAgICAgIGhvbGxvd19j b2xvciA9IGhvbGxvd19hY3RpdmVfY29sb3I7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAv KiBUaGUgcmVnaW9uIGlzIF9ub3RfIHZpc2libGUgaW4gdGhlIGluYWN0aXZlIHdpbmRvdyBiZWNh dXNlIHRoZSBvdmVybGF5IHdpbmRvdyBwcm9wZXJ0eSBpcyB1c2VkLiAqLworICAgICAgICAgICAg ZWxzZSBpZiAoIWFjdGl2ZV9wKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZW51 bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcs IGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1mYWNlIiksIHRydWUpOwor ICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9IEZBQ0Vf RlJPTV9JRCAoZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgIE5T Q29sb3IgKmhvbGxvd19pbmFjdGl2ZV9jb2xvciA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChO U19GQUNFX0JBQ0tHUk9VTkQgKGhvbGxvd19pbmFjdGl2ZV9mYWNlKSwgZik7CisgICAgICAgICAg ICAgICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2luYWN0aXZlX2NvbG9yOworICAgICAgICAgICAg ICB9CisgICAgfQorICAgIGVsc2UgaWYgKGZhY2UgJiYgTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNl KSA9PSBuc19pbmRleF9jb2xvciAoRlJBTUVfQ1VSU09SX0NPTE9SIChmKSwgZikpCisgICAgICB7 CisgICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChm YWNlKSwgZikgc2V0XTsKKyAgICAgICAgaG9sbG93X2NvbG9yID0gRlJBTUVfQ1VSU09SX0NPTE9S IChmKTsKKyAgICAgIH0KKyNpZmRlZiBOU19JTVBMX0NPQ09BCisgIE5TRGlzYWJsZVNjcmVlblVw ZGF0ZXMgKCk7CisjZW5kaWYKKyAgc3dpdGNoIChjdXJzb3JfdHlwZSkKKyAgICB7CisgICAgICBj YXNlIE1DX05PX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19O T19DVVJTT1I6CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19SSUdIVF9GUklOR0VfQklU TUFQOgorICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfTEVGVF9GUklOR0VfQklUTUFQOgor ICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAgICAgICAgTlNSZWN0 RmlsbCAocik7CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19GUkFNRURfQk9YOgorICAg ICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgW2hvbGxvd19jb2xvciBzZXRdOworICAgICAg ICBOU1JlY3RGaWxsIChOU0luc2V0UmVjdCAociwgMSwgMSkpOworICAgICAgICBbRlJBTUVfQ1VS U09SX0NPTE9SIChmKSBzZXRdOworICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfSE9MTE9X X0JPWDoKKyAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgIFtob2xsb3dfY29sb3Igc2V0 XTsKKyAgICAgICAgTlNSZWN0RmlsbCAoTlNJbnNldFJlY3QgKHIsIDEsIDEpKTsKKyAgICAgICAg W0ZSQU1FX0NVUlNPUl9DT0xPUiAoZikgc2V0XTsKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNl IE1DX0hCQVI6CisgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICBicmVhazsKKyAgICAg IGNhc2UgTUNfQkFSOgorICAgICAgICBzID0gcjsKKyAgICAgICAgLyogQGxhd2xpc3QgaXMgZm9j dXNpbmcgdGhlIGluaXRpYWwgZGV2ZWxvcG1lbnQgb2YgZmVhdHVyZSByZXF1ZXN0cworICAgICAg ICAjMTc2ODQgYW5kICMyMjg3MyBvbiBMMlIgbGFuZ3VhZ2VzLiAqLworICAgICAgICBpZiAoZ2x5 cGhfZmxhdm9yICE9IE1DX0dMWVBICisgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNf R0xZUEhMRVNTKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIC8qIElmIH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gICAgIGVsc2UKKyAg ICAgICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoZmFjZS0+dW5kZXJsaW5lX2NvbG9y LCBzLT5mKSBzZXRdOworICAgICAgICAgIG5zX2RyYXdfdW5kZXJ3YXZlIChzLCB3aWR0aCwgeCk7 CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZB Q0VfVU5ERVJfTElORSkKKyAgICAgICAgeworICAgICAgICAgIE5TUmVjdCByOworICAgICAgICAg IHVuc2lnbmVkIGxvbmcgdGhpY2tuZXNzLCBwb3NpdGlvbjsKKyAgICAgICAgICAvKiBJZiB0aGUg cHJldiB3YXMgdW5kZXJsaW5lZCwgbWF0Y2ggaXRzIGFwcGVhcmFuY2UuICovCisgICAgICAgICAg aWYgKHMtPnByZXYgJiYgcy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3AKKyAgICAgICAgICAgICAg JiYgcy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FCisgICAg ICAgICAgICAgICYmIHMtPnByZXYtPnVuZGVybGluZV90aGlja25lc3MgPiAwKQorICAgICAgICAg ICAgeworICAgICAgICAgICAgICB0aGlja25lc3MgPSBzLT5wcmV2LT51bmRlcmxpbmVfdGhpY2tu ZXNzOworICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPnByZXYtPnVuZGVybGluZV9wb3NpdGlv bjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAg ICAgICAgIHN0cnVjdCBmb250ICpmb250OworICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIGRl c2NlbnQ7CisgICAgICAgICAgICAgIGZvbnQ9cy0+Zm9udDsKKyAgICAgICAgICAgICAgZGVzY2Vu dCA9IHMtPnkgKyBzLT5oZWlnaHQgLSBzLT55YmFzZTsKKyAgICAgICAgICAgICAgLyogVXNlIHVu ZGVybGluZSB0aGlja25lc3Mgb2YgZm9udCwgZGVmYXVsdGluZyB0byAxLiAqLworICAgICAgICAg ICAgICB0aGlja25lc3MgPSAoZm9udCAmJiBmb250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4gMCkK KyAgICAgICAgICAgICAgICA/IGZvbnQtPnVuZGVybGluZV90aGlja25lc3MgOiAxOworICAgICAg ICAgICAgICAvKiBEZXRlcm1pbmUgdGhlIG9mZnNldCBvZiB1bmRlcmxpbmluZyBmcm9tIHRoZSBi YXNlbGluZS4gKi8KKyAgICAgICAgICAgICAgaWYgKHhfdW5kZXJsaW5lX2F0X2Rlc2NlbnRfbGlu ZSkKKyAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IGRlc2NlbnQgLSB0aGlja25lc3M7CisgICAg ICAgICAgICAgIGVsc2UgaWYgKHhfdXNlX3VuZGVybGluZV9wb3NpdGlvbl9wcm9wZXJ0aWVzCisg ICAgICAgICAgICAgICAgICAgICAgICYmIGZvbnQgJiYgZm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9u ID49IDApCisgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBmb250LT51bmRlcmxpbmVfcG9zaXRp b247CisgICAgICAgICAgICAgIGVsc2UgaWYgKGZvbnQpCisgICAgICAgICAgICAgICAgcG9zaXRp b24gPSBscm91bmQgKGZvbnQtPmRlc2NlbnQgLyAyKTsKKyAgICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICAgIHBvc2l0aW9uID0gdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0OworICAgICAg ICAgICAgICBwb3NpdGlvbiA9IG1heCAocG9zaXRpb24sIHVuZGVybGluZV9taW5pbXVtX29mZnNl dCk7CisgICAgICAgICAgICAgIC8qIEVuc3VyZSB1bmRlcmxpbmluZyBpcyBub3QgY3JvcHBlZC4g Ki8KKyAgICAgICAgICAgICAgaWYgKGRlc2NlbnQgPD0gcG9zaXRpb24pCisgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBkZXNjZW50IC0gMTsKKyAgICAgICAg ICAgICAgICAgIHRoaWNrbmVzcyA9IDE7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICBlbHNlIGlmIChkZXNjZW50IDwgcG9zaXRpb24gKyB0aGlja25lc3MpCisgICAgICAgICAgICAg ICAgdGhpY2tuZXNzID0gMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBzLT51bmRlcmxpbmVf dGhpY2tuZXNzID0gdGhpY2tuZXNzOworICAgICAgICAgIHMtPnVuZGVybGluZV9wb3NpdGlvbiA9 IHBvc2l0aW9uOworICAgICAgICAgIHIgPSBOU01ha2VSZWN0ICh4LCBzLT55YmFzZSArIHBvc2l0 aW9uLCB3aWR0aCwgdGhpY2tuZXNzKTsKKyAgICAgICAgICBpZiAoZmFjZS0+dW5kZXJsaW5lX2Rl ZmF1bHRlZF9wKQorICAgICAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsKKyAgICAgICAgICBlbHNl CisgICAgICAgICAgICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKGZhY2UtPnVuZGVybGluZV9j b2xvciwgcy0+Zikgc2V0XTsKKyAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgfQor ICAgIH0KKyAgLyogRG8gb3ZlcmxpbmUuIFdlIGZvbGxvdyBvdGhlciB0ZXJtcyBpbiB1c2luZyBh IHRoaWNrbmVzcyBvZiAxCisgICAgIGFuZCBpZ25vcmluZyBvdmVybGluZV9tYXJnaW4uICovCisg IGlmIChmYWNlLT5vdmVybGluZV9wKQorICAgIHsKKyAgICAgIE5TUmVjdCByOworICAgICAgciA9 IE5TTWFrZVJlY3QgKHgsIHMtPnksIHdpZHRoLCAxKTsKKyAgICAgIGlmIChmYWNlLT5vdmVybGlu ZV9jb2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsKKyAgICAgIGVs c2UKKyAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChmYWNlLT5vdmVybGluZV9jb2xv ciwgcy0+Zikgc2V0XTsKKyAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgIH0KKyAgLyogRG8gc3Ry aWtlLXRocm91Z2guICBXZSBmb2xsb3cgb3RoZXIgdGVybXMgZm9yIHRoaWNrbmVzcyBhbmQKKyAg ICAgdmVydGljYWwgcG9zaXRpb24uKi8KKyAgaWYgKGZhY2UtPnN0cmlrZV90aHJvdWdoX3ApCisg ICAgeworICAgICAgTlNSZWN0IHI7CisgICAgICB1bnNpZ25lZCBsb25nIGR5OworICAgICAgZHkg PSBscmludCAoKHMtPmhlaWdodCAtIDEpIC8gMik7CisgICAgICByID0gTlNNYWtlUmVjdCAoeCwg cy0+eSArIGR5LCB3aWR0aCwgMSk7CisgICAgICBpZiAoZmFjZS0+c3RyaWtlX3Rocm91Z2hfY29s b3JfZGVmYXVsdGVkX3ApCisgICAgICAgIFtkZWZhdWx0Q29sIHNldF07CisgICAgICBlbHNlCisg ICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoZmFjZS0+c3RyaWtlX3Rocm91Z2hfY29s b3IsIHMtPmYpIHNldF07CisgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICB9Cit9CisKK3N0YXRp YyB2b2lkCittY19uc19kdW1wZ2x5cGhzX3N0cmV0Y2ggKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMs IGludCB3ZCwgc3RydWN0IGdseXBoX3JvdyAqcm93KQoreworICBOU1JlY3QgclsyXTsKKyAgaW50 IG4sIGk7CisgIHN0cnVjdCBmYWNlICpmYWNlOworICBOU0NvbG9yICpmZ0NvbCwgKmJnQ29sOwor ICBpZiAoIXMtPmJhY2tncm91bmRfZmlsbGVkX3ApCisgICAgeworICAgICAgbiA9IG5zX2dldF9n bHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAgICAg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AgICAgLSAoV0lORE9XX0JPWF9SSUdIVF9FREdFX1ggKHMtPncpCisgICAg ICAgIC0gV0lORE9XX1JJR0hUX0ZSSU5HRV9XSURUSCAocy0+dykpKTsKKyAgICAgICAgICAgICAg cltpXS5zaXplLndpZHRoIC09IG92ZXJydW47CisgICAgICAgIC8qIHRydW5jYXRlIHRvIGF2b2lk IG92ZXJ3cml0aW5nIHRvIGxlZnQgb2YgdGhlIHdpbmRvdyBib3ggKi8KKyAgICAgICAgbGVmdG92 ZXJydW4gPSAoV0lORE9XX0JPWF9MRUZUX0VER0VfWCAocy0+dykKKyAgICAgICAgICAgKyBXSU5E T1dfTEVGVF9GUklOR0VfV0lEVEggKHMtPncpKSAtIHMtPng7CisgICAgICAgIGlmIChsZWZ0b3Zl cnJ1biA+IDApCisgICAgICAgICAgeworICAgICAgICAgICAgcltpXS5vcmlnaW4ueCArPSBsZWZ0 b3ZlcnJ1bjsKKyAgICAgICAgICAgIHJbaV0uc2l6ZS53aWR0aCAtPSBsZWZ0b3ZlcnJ1bjsKKyAg ICAgICAgICB9CisgICAgICAgICAgICAgIC8qIFhYWDogVHJ5IHRvIHdvcmsgYmV0d2VlbiBwcm9i bGVtIHdoZXJlIGEgc3RyZXRjaCBnbHlwaCBvbgorICAgICAgICAgICAgICAgICBhIHBhcnRpYWxs eS12aXNpYmxlIGJvdHRvbSByb3cgd2lsbCBjbGVhciBwYXJ0IG9mIHRoZQorICAgICAgICAgICAg ICAgICBtb2RlbGluZSwgYW5kIGFub3RoZXIgd2hlcmUgbGlzdC1idWZmZXJzIGhlYWRlcnMgYW5k IHNpbWlsYXIKKyAgICAgICAgICAgICAgICAgcm93cyBlcnJvbmVvdXNseSBoYXZlIHZpc2libGVf aGVpZ2h0IHNldCB0byAwLiAgTm90IHN1cmUKKyAgICAgICAgICAgICAgICAgd2hlcmUgdGhpcyBp cyBjb21pbmcgZnJvbSBhcyBvdGhlciB0ZXJtcyBzZWVtIG5vdCB0byBzaG93LiAqLworICAgIC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J1Z2dpbmdfZmFjZV9pZCk7CisgICAgICAgICAg ICAgIC8vICBOU0NvbG9yICpjb2xvciA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNF X0ZPUkVHUk9VTkQgKGRlYnVnZ2luZ19mYWNlKSwgcy0+Zik7CisgICAgICAgICAgICAgIC8vICBb Y29sb3Igc2V0XTsKKyAgICAgICAgICAgICAgQ0dGbG9hdCB4ID0gcltpXS5vcmlnaW4ueDsKKyAg ICAgICAgICAgICAgQ0dGbG9hdCB3aWR0aCA9IHdkOworICAgICAgICAgICAgICByW2ldLnNpemUu d2lkdGggLT0gd2lkdGg7CisgICAgICAgICAgICAgIHJbaV0ub3JpZ2luLnggKz0gd2lkdGg7Cisg ICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHJbaV0pOworICAgICAgICAgICAgICAvKiBEcmF3IG92 ZXJsaW5pbmcsIGV0Yy4gb24gdGhlIGN1cnNvci4gKi8KKyAgICAgICAgICAgICAgaWYgKHMtPnct PnBoeXNfY3Vyc29yX3R5cGUgPT0gTUNfRklMTEVEX0JPWCkKKyAgICAgICAgICAgICAgICBtY19u c19kcmF3X3RleHRfZGVjb3JhdGlvbiAocywgZmFjZSwgYmdDb2wsIHdpZHRoLCB4KTsKKyAgICAg ICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBtY19uc19kcmF3X3RleHRfZGVjb3Jh dGlvbiAocywgZmFjZSwgZmdDb2wsIHdpZHRoLCB4KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAg ICBlbHNlCisgICAgICAgICAgICB7CisgIC8vICBpbnQgcnggPSByW2ldLm9yaWdpbi54OworICAv LyAgaW50IHJ5ID0gcltpXS5vcmlnaW4ueTsKKyAgLy8gIGludCBydyA9IHJbaV0uc2l6ZS53aWR0 aDsKKyAgLy8gIGludCByaCA9IHJbaV0uc2l6ZS5oZWlnaHQ7CisgIC8vICBmcHJpbnRmIChzdGRl cnIsICJtY19uc19kdW1wZ2x5cGhzX3N0cmV0Y2g6ICB2cG9zICglZCkgfCByeCAoJWQpIHwgcnkg KCVkKSB8IHJ3ICglZCkgfCByaCAoJWQpXG4iLAorICAvLyAgICAgICAgICAgICAgICAgICBzLT5m aXJzdF9nbHlwaC0+dnBvcywgcngsIHJ5LCBydywgcmgpOworICAgICAgICAgICAgICBOU1JlY3RG aWxsIChyW2ldKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAvKiBEcmF3IG92ZXJsaW5pbmcs IGV0Yy4gb24gdGhlIHN0cmV0Y2ggZ2x5cGggKG9yIHRoZSBwYXJ0CisgICAgICAgICAgICAgb2Yg dGhlIHN0cmV0Y2ggZ2x5cGggYWZ0ZXIgdGhlIGN1cnNvcikuICovCisgICAgICAgICAgbWNfbnNf ZHJhd190ZXh0X2RlY29yYXRpb24gKHMsIGZhY2UsIGZnQ29sLCByW2ldLnNpemUud2lkdGgsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJbaV0ub3JpZ2luLngpOworICAg ICAgICB9CisgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICBzLT5iYWNrZ3Jv dW5kX2ZpbGxlZF9wID0gMTsKKyAgICB9Cit9CisKK3N0YXRpYyB2b2lkCittY19uc19kdW1wZ2x5 cGhzX2ltYWdlIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzLCBOU1JlY3Qgciwgc3RydWN0IG1jX1JH QiBsc2wsCisgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2 b3IsIGVudW0gdHlwZV9vZl9jdXJzb3IgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAg ICAgICBib29sIGFjdGl2ZV9wKQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICAgIFJlbmRlcn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dfeSwgcy0+YmFja2dyb3VuZF93aWR0aCwgYmdfaGVpZ2h0KTsK KyAgICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSAxOworICAgIH0KKyAgZWxzZQorICAgIHsK KyAgICAgIGJyID0gTlNNYWtlUmVjdCAoeCwgeSwgcy0+c2xpY2Uud2lkdGgsIHMtPnNsaWNlLmhl aWdodCk7CisgICAgfQorICBOU1JlY3RGaWxsIChicik7CisgIC8qIERyYXcgdGhlIGltYWdlLi4g ZG8gd2UgbmVlZCB0byBkcmF3IHBsYWNlaG9sZGVyIGlmIGltZyA9PW5pbD8gKi8KKyAgaWYgKGlt ZyAhPSBuaWwpCisgICAgeworI2lmZGVmIE5TX0lNUExfQ09DT0EKKyAgICAgIE5TUmVjdCBkciA9 IE5TTWFrZVJlY3QgKHgsIHksIHMtPnNsaWNlLndpZHRoLCBzLT5zbGljZS5oZWlnaHQpOworICAg ICAgTlNSZWN0IGlyID0gTlNNYWtlUmVjdCAocy0+c2xpY2UueCwgcy0+c2xpY2UueSwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLndpZHRoLCBzLT5zbGljZS5oZWlnaHQp OworICAgICAgW2ltZyBkcmF3SW5SZWN0OiBkcgorICAgICAgICAgICAgIGZyb21SZWN0OiBpcgor ICAgICAgICAgICAgIG9wZXJhdGlvbjogTlNDb21wb3NpdGVTb3VyY2VPdmVyCisgICAgICAgICAg ICAgIGZyYWN0aW9uOiAxLjAKKyAgICAgICAgICAgcmVzcGVjdEZsaXBwZWQ6IFlFUworICAgICAg ICAgICAgICAgIGhpbnRzOiBuaWxdOworI2Vsc2UKKyAgICAgIFtpbWcgY29tcG9zaXRlVG9Qb2lu dDogTlNNYWtlUG9pbnQgKHgsIHkgKyBzLT5zbGljZS5oZWlnaHQpCisgICAgICAgICAgICAgICAg ICBvcGVyYXRpb246IE5TQ29tcG9zaXRlU291cmNlT3Zlcl07CisjZW5kaWYKKyAgICB9CisgIGlm IChz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gaWYgKHMtPmltZy0+cmVsaWVmIHx8IHMtPmhsID09 RFJBV19JTUFHRV9SQUlTRUQgfHwgcy0+aGwgPT1EUkFXX0lNQUdFX1NVTktFTikKKyAgICB7Cisg ICAgICBpZiAocy0+aGwgPT0gRFJBV19JTUFHRV9TVU5LRU4gfHwgcy0+aGwgPT0gRFJBV19JTUFH RV9SQUlTRUQpCisgICAgICAgIHsKKyAgICAgICAgICB0aCA9IHRvb2xfYmFyX2J1dHRvbl9yZWxp ZWYgPj0gMCA/CisgICAgICAgICAgICB0b29sX2Jhcl9idXR0b25fcmVsaWVmIDogREVGQVVMVF9U T09MX0JBUl9CVVRUT05fUkVMSUVGOworICAgICAgICAgIHJhaXNlZF9wID0gKHMtPmhsID09IERS QVdfSU1BR0VfUkFJU0VEKTsKKyAgICAgICAgfQorICAgICAgZWxzZQorICAgICAgICB7CisgICAg ICAgICAgdGggPSBhYnMgKHMtPmltZy0+cmVsaWVmKTsKKyAgICAgICAgICByYWlzZWRfcCA9IChz LT5pbWctPnJlbGllZiA+IDApOworICAgICAgICB9CisgICAgICByLm9yaWdpbi54ID0geCAtIHRo OworICAgICAgci5vcmlnaW4ueSA9IHkgLSB0aDsKKyAgICAgIHIuc2l6ZS53aWR0aCA9IHMtPnNs aWNlLndpZHRoICsgMip0aC0xOworICAgICAgci5zaXplLmhlaWdodCA9IHMtPnNsaWNlLmhlaWdo dCArIDIqdGgtMTsKKyAgICAgIG5zX2RyYXdfcmVsaWVmIChyLCB0aCwgcmFpc2VkX3AsCisgICAg ICAgICAgICAgICAgICAgICAgcy0+c2xpY2UueSA9PSAwLAorICAgICAgICAgICAgICAgICAgICAg IHMtPnNsaWNlLnkgKyBzLT5zbGljZS5oZWlnaHQgPT0gcy0+aW1nLT5oZWlnaHQsCisgICAgICAg ICAgICAgICAgICAgICAgcy0+c2xpY2UueCA9PSAwLAorICAgICAgICAgICAgICAgICAgICAgIHMt PnNsaWNlLnggKyBzLT5zbGljZS53aWR0aCA9PSBzLT5pbWctPndpZHRoLCBzKTsKKyAgICB9Cisg IC8qIElmIHRoZXJlIGlzIG5vIG1hc2ssIHRoZSBiYWNrZ3JvdW5kIHdvbid0IGJlIHNlZW4sCisg ICAgIHNvIGRyYXcgYSByZWN0YW5nbGUgb24gdGhlIGltYWdlIGZvciB0aGUgY3Vyc29yLgorICAg ICBEbyB0aGlzIGZvciBhbGwgaW1hZ2VzLCBnZXR0aW5nIHRyYW5zcGFyZW5jeSByaWdodCBpcyBu b3QgcmVsaWFibGUuICAqLworICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IpCisgICAgeworICAg ICAgaW50IHRoaWNrbmVzcyA9IGFicyAocy0+aW1nLT5yZWxpZWYpOworICAgICAgaWYgKHRoaWNr bmVzcyA9PSAwKSB0aGlja25lc3MgPSAxOworICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfR0xZ UEgKKyAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBITEVTUykKKyAgICAgIHsKKyAg ICAgICAgTlNDb2xvciAqYm9yZGVyX2NvbG9yID0gW05TQ29sb3IgY29sb3JXaXRoQ2FsaWJyYXRl ZFJlZDogbHNsLnJlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGdyZWVuOiBsc2wuZ3JlZW4KKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmx1ZTogbHNsLmJsdWUKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHBo YTogMS4wXTsKKyAgICAgICAgbnNfZHJhd19ib3ggKGJyLCB0aGlja25lc3MsIGJvcmRlcl9jb2xv ciwgMSwgMSk7CisgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIG5zX2RyYXdfYm94IChiciwg dGhpY2tuZXNzLCBGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpLCAxLCAxKTsKKyAgICB9Cit9CisK K3N0YXRpYyB2b2lkCittY19uc19vdmVyd3JpdHRlbl9oZWxwZXIgKHN0cnVjdCBnbHlwaF9zdHJp bmcgKnMsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93LCBlbnVtIHR5cGVfb2ZfY2FjaGUgY2FjaGVfdHlw ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoICpnbHlwaCkKK3sKKyAg Ly8gbnNfZHJhd191bmRlcndhdmUgKHMsIHMtPndpZHRoLCBzLT54KTsKKyAgTlNDb2xvciAqaG9s bG93X2NvbG9yID0gRlJBTUVfQkFDS0dST1VORF9DT0xPUiAocy0+Zik7CisgIHN0cnVjdCBmYWNl ICpmYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBERUZBVUxUX0ZBQ0VfSUQpOworICBpbnQgcm93 X3Zwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgc3RydWN0IG11bHRpcGxl X2N1cnNvcnNfY2FjaGUgZm9vX2VsdHM7CisgIHN3aXRjaCAoY2FjaGVfdHlwZSkKKyAgICB7Cisg ICAgICBjYXNlIE5PX0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAgYnJlYWs7CisgICAgICAg IH0KKyAgICAgIGNhc2UgTUNfQ0FDSEU6CisgICAgICAgIHsKKyAgICAgICAgICBmb29fZWx0cy5j YWNoZXMgPSBzLT53LT5tY19lbHRzLmNhY2hlczsKKyAgICAgICAgICBmb29fZWx0cy5hbGxvY2F0 ZWQgPSBzLT53LT5tY19lbHRzLmFsbG9jYXRlZDsKKyAgICAgICAgICBmb29fZWx0cy51c2VkID0g cy0+dy0+bWNfZWx0cy51c2VkOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBj YXNlIENIX0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAgZm9vX2VsdHMuY2FjaGVzID0gcy0+ dy0+Y2hfZWx0cy5jYWNoZXM7CisgICAgICAgICAgZm9vX2VsdHMuYWxsb2NhdGVkID0gcy0+dy0+ Y2hfZWx0cy5hbGxvY2F0ZWQ7CisgICAgICAgICAgZm9vX2VsdHMudXNlZCA9IHMtPnctPmNoX2Vs dHMudXNlZDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgY2FzZSBGQ19DQUNI RToKKyAgICAgICAgeworICAgICAgICAgIGZvb19lbHRzLmNhY2hlcyA9IHMtPnctPmZjX2VsdHMu Y2FjaGVzOworICAgICAgICAgIGZvb19lbHRzLmFsbG9jYXRlZCA9IHMtPnctPmZjX2VsdHMuYWxs b2NhdGVkOworICAgICAgICAgIGZvb19lbHRzLnVzZWQgPSBzLT53LT5mY19lbHRzLnVzZWQ7Cisg ICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisgIC8qIFNUUkVUQ0hfR0xZUEggbWF5 IGNvbnRhaW4gbW9yZSB0aGFuIG9uZSBmYWtlIGN1cnNvciBhdCB0aGUgc2FtZSBIUE9TLiAqLwor ICBmb3IgKGludCBlbHQgPSAwOyBlbHQgPCBmb29fZWx0cy51c2VkOyArK2VsdCkKKyAgICB7Cisg ICAgICBpbnQgeCA9IGZvb19lbHRzLmNhY2hlc1tlbHRdLng7CisgICAgICBpbnQgZnggPSBmb29f ZWx0cy5jYWNoZXNbZWx0XS5meDsKKyAgICAgIGludCB5ID0gZm9vX2VsdHMuY2FjaGVzW2VsdF0u eTsKKyAgICAgIGludCBmeSA9IGZvb19lbHRzLmNhY2hlc1tlbHRdLmZ5OworICAgICAgaW50IGhw b3MgPSBmb29fZWx0cy5jYWNoZXNbZWx0XS5ocG9zOworICAgICAgaW50IHZwb3MgPSBmb29fZWx0 cy5jYWNoZXNbZWx0XS52cG9zOworICAgICAgaW50IHdkID0gZm9vX2VsdHMuY2FjaGVzW2Vs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fcDsKKyAgICAgIGJvb2wgZ29fcCA9ICh2cG9zID09IHJv d192cG9zCisgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA9PSBnbHlwaC0+aHBvcworICAgICAg ICAgICAgICAgICAgICYmIGVuYWJsZWRfcCk7CisgICAgICBpZiAoIWdvX3ApCisgICAgICAgIGNv bnRpbnVlOworICAgICAgTlNSZWN0IHI7CisgICAgICByLm9yaWdpbi54ID0gZng7CisgICAgICBy Lm9yaWdpbi55ID0gZnk7CisgICAgICByLnNpemUuaGVpZ2h0ID0gaDsKKyAgICAgIHIuc2l6ZS53 aWR0aCA9IHdkOworICAgICAgW1tOU0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6IGxzbF9m Zy5yZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdyZWVuOiBsc2xfZmcuZ3Jl ZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBibHVlOiBsc2xfZmcuYmx1ZQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwaGE6IDEuMF0gc2V0XTsKKyAgaWYg KGN1cnNvcl90eXBlID09IE1DX0ZSQU1FRF9CT1gpCisgICAgeworICAgICAgTGlzcF9PYmplY3Qg YnVmID0gcy0+dy0+Y29udGVudHM7CisgICAgICBDSEVDS19CVUZGRVIgKGJ1Zik7CisgICAgICBz dHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAoYnVmKTsKKyAgICAgIGJvb2wgcmVnaW9uX2FjdGl2 ZV9wID0gKCFOSUxQIChWdHJhbnNpZW50X21hcmtfbW9kZSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBtYXJrX2FjdGl2ZSkpKTsKKyAgICAgIHB0cmRp ZmZfdCByZWdpb25fYmVnaW5uaW5nID0gKHJlZ2lvbl9hY3RpdmVfcCkgPyBYRklYTlVNIChGcmVn aW9uX2JlZ2lubmluZyAoKSkgOiAtMTsKKyAgICAgIHB0cmRpZmZfdCByZWdpb25fZW5kID0gKHJl Z2lvbl9hY3RpdmVfcCkgPyBYRklYTlVNIChGcmVnaW9uX2VuZCAoKSkgOiAtMTsKKyAgICAgIHB0 cmRpZmZfdCBvcG9pbnRfcHQgPSAocy0+dyA9PSBYV0lORE9XIChzZWxlY3RlZF93aW5kb3cpKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUFQKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IFhGSVhOVU0gKEZtYXJrZXJfcG9zaXRpb24gKHMtPnctPnBvaW50bSkpOworICAgICAg Ym9vbCByZWdpb25faW5fYm91bmRzX3AgPSAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfcHQgPj0gcmVnaW9uX2JlZ2lubmluZworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3B0IDwgcmVnaW9uX2VuZCk7 CisgICAgICBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgJiYgcmVnaW9uX2luX2JvdW5k c19wCisgICAgICAgICAgJiYgYWN0aXZlX3ApCisgICAgICAgIHsKKyAgICAgICAgICBlbnVtIGZh Y2VfaWQgaG9sbG93X2FjdGl2ZV9yZWdpb25fZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlIChz LT53LCBzLT5mLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItcmVnaW9uLWZhY2UiKSwgdHJ1 ZSk7CisgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfcmVnaW9uX2ZhY2UgPSBG QUNFX0ZST01fSUQgKHMtPmYsIGhvbGxvd19hY3RpdmVfcmVnaW9uX2ZhY2VfaWQpOworICAgICAg ICAgIE5TQ29sb3IgKmhvbGxvd19hY3RpdmVfcmVnaW9uX2NvbG9yID0gbnNfbG9va3VwX2luZGV4 Z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WRfY29sb3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoaG9sbG93X2luYWN0aXZlX2ZhY2UpLCBzLT5m KTsKKyAgICAgICAgICAgICAgICBob2xsb3dfY29sb3IgPSBob2xsb3dfaW5hY3RpdmVfY29sb3I7 CisgICAgICAgICAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZiAoZmFjZSAmJiBOU19GQUNFX0JB Q0tHUk9VTkQgKGZhY2UpID09IG5zX2luZGV4X2NvbG9yIChGUkFNRV9DVVJTT1JfQ09MT1IgKHMt PmYpLCBzLT5mKSkKKyAgICAgIHsKKyAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChO U19GQUNFX0ZPUkVHUk9VTkQgKGZhY2UpLCBzLT5mKSBzZXRdOworICAgICAgICBob2xsb3dfY29s b3IgPSBGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpOworICAgICAgfQorICAgICAgc3dpdGNoIChj dXJzb3JfdHlwZSkKKyAgICAgICAgeworICAgICAgICAgIGNhc2UgTUNfTk9fRlJJTkdFX0JJVE1B UDoKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIGNhc2UgTUNfTk9fQ1VSU09SOgorICAg ICAgICAgICAgYnJlYWs7CisgICAgICAgICAgY2FzZSBNQ19SSUdIVF9GUklOR0VfQklUTUFQOgor ICAgICAgICAgIGNhc2UgTUNfTEVGVF9GUklOR0VfQklUTUFQOgorICAgICAgICAgIGNhc2UgTUNf RklMTEVEX0JPWDoKKyAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAgYnJl YWs7CisgICAgICAgICAgY2FzZSBNQ19GUkFNRURfQk9YOgorICAgICAgICAgICAgTlNSZWN0Rmls bCAocik7CisgICAgICAgICAgICBbaG9sbG93X2NvbG9yIHNldF07CisgICAgICAgICAgICBOU1Jl Y3RGaWxsIChOU0luc2V0UmVjdCAociwgMSwgMSkpOworICAgICAgICAgICAgW0ZSQU1FX0NVUlNP Ul9DT0xPUiAocy0+Zikgc2V0XTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIGNhc2Ug TUNfSE9MTE9XX0JPWDoKKyAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAg W2hvbGxvd19jb2xvciBzZXRdOworICAgICAgICAgICAgTlNSZWN0RmlsbCAoTlNJbnNldFJlY3Qg KHIsIDEsIDEpKTsKKyAgICAgICAgICAgIFtGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpIHNldF07 CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBjYXNlIE1DX0hCQVI6CisgICAgICAgICAg ICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIGNhc2UgTUNf QkFSOgorICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAgICBicmVhazsKKyAg ICAgICAgfQorICAgICAgLyogSWYgYSBnbHlwaCBleGlzdHMgKHMtPmNoYXIyYiAhPSBOVUxMKSwg dGhlbiBkcmF3IHRoZSBnbHlwaCBvbiB0b3Agb2YgdGhlCisgICAgICBuZXdseSBkcmF3biByZWN0 YW5nbGUgdGhhdCB3YXMgY3JlYXRlZCBoZXJlaW5hYm92ZS4gIFRvIHRoZSBleHRlbnQgdGhhdCB3 ZQorICAgICAgd2FudCB0byBkb3VibGUtaW1wcmludCBnbHlwaHMgdG8gbWFrZSB0aGVtIGFwcGVh ciB0byBiZSBzZW1pLWJvbGQsIGl0IGNhbgorICAgICAgYmUgZG9uZSBoZXJlIGZvciBhbGwgY3Vy c29yIHR5cGVzLiAgVGhlIGJveC1zdHlsZSBjdXJzb3JzIGFyZSBpbXByaW50ZWQKKyAgICAgIHdp dGggZ2x5cGhzIG9ubHkgb25lICgxKSB0aW1lLiAgVGhlIHNlbWktYm9sZCBhcHBlYXJhbmNlIGlz IGhlbHBmdWwgd2hlbgorICAgICAgZGVidWdnaW5nIHRvIHNlZSB0aGF0IHRoZSBjb29yZGluYXRl cyBhcmUgY29ycmVjdC4gKi8KKyAgICAgIGlmIChzLT5jaGFyMmIgIT0gTlVMTAorICAgICAgICAg ICYmIChjdXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9YCisgICAgICAgICAgICAgIHx8IGN1cnNv cl90eXBlID09IE1DX0ZSQU1FRF9CT1gKKyAgICAgICAgICAgICAgfHwgY3Vyc29yX3R5cGUgPT0g TUNfSE9MTE9XX0JPWCkpCisgICAgICAgIHsKKyAgICAgICAgICBCT09MIGlzQ29tcG9zaXRlID0g cy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIOworICAgICAgICAgIGlmIChp c0NvbXBvc2l0ZSkKKyAgICAgICAgICAgIG5zX2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19m b3JlZ3JvdW5kIChzKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgIHN0cnVjdCBmb250ICpmb250ID0gcy0+ZmFjZS0+Zm9udDsKKyAgICAgICAgICAg ICAgICBpZiAoIWZvbnQpCisgICAgICAgICAgICAgICAgICBmb250ID0gRlJBTUVfRk9OVCAocy0+ Zik7CisgICAgICAgICAgICAgICAgYm9vbCB3aXRoX2JnX3AgPSBmYWxzZTsKKyAgICAgICAgICAg ICAgICBmb250LT5kcml2ZXItPmRyYXcgKHMsIHMtPmNtcF9mcm9tLCBzLT5uY2hhcnMsIHMtPngs IHMtPnliYXNlLCB3aXRoX2JnX3ApOworICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9 Cit9CisKK3N0YXRpYyB2b2lkCittY19uc19kcmF3X292ZXJ3cml0dGVuIChzdHJ1Y3QgZ2x5cGhf c3RyaW5nICpzLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsCisgICAgICAgICAgICAgICAg ICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIHN0cnVjdCBnbHlwaCAqZ2x5cGgpCit7Cisg IC8vICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAvLyAgY2xv Y2tfdCBjbG9ja19zdGFydCA9IGNsb2NrKCk7CisgIG1jX25zX292ZXJ3cml0dGVuX2hlbHBlciAo cywgbWF0cml4LCByb3csIE1DX0NBQ0hFLCBnbHlwaCk7CisgIG1jX25zX292ZXJ3cml0dGVuX2hl bHBlciAocywgbWF0cml4LCByb3csIENIX0NBQ0hFLCBnbHlwaCk7CisgIG1jX25zX292ZXJ3cml0 dGVuX2hlbHBlciAocywgbWF0cml4LCByb3csIEZDX0NBQ0hFLCBnbHlwaCk7CisgIC8vICBjbG9j a190IGNsb2NrX2VuZCA9IGNsb2NrKCk7CisgIC8vICBkb3VibGUgY3B1X3RpbWVfdXNlZCA9ICgo ZG91YmxlKSAoY2xvY2tfZW5kIC0gY2xvY2tfc3RhcnQpKSAvIENMT0NLU19QRVJfU0VDOworICAv LyAgZnByaW50ZiAoc3RkZXJyLCAibnNfZHJhd19vdmVyd3JpdHRlbiAoJWQpOiAgVElNRSAoJWYp XG4iLCB2cG9zLCBjcHVfdGltZV91c2VkKTsKK30KKworc3RhdGljIHZvaWQKK21jX25zX21heWJl X2R1bXBnbHlwaHNfYmFja2dyb3VuZCAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgY2hhciBmb3Jj ZV9wKQoreworICBOU1RSQUNFICgibWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIik7 CisgIGlmICghcy0+YmFja2dyb3VuZF9maWxsZWRfcC8qIHx8IHMtPmhsID09IERSQVdfTU9VU0Vf RkFDRSovKQorICAgIHsKKyAgICAgIGludCBib3hfbGluZV93aWR0aCA9IG1heCAocy0+ZmFjZS0+ Ym94X2xpbmVfd2lkdGgsIDApOworICAgICAgaWYgKEZPTlRfSEVJR0hUIChzLT5mb250KSA8IHMt PmhlaWdodCAtIDIgKiBib3hfbGlu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g PyBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKSwgcy0+ ZikKKyAgICAgICAgICAgICAgOiBGUkFNRV9CQUNLR1JPVU5EX0NPTE9SIChzLT5mKSkgc2V0XTsK KyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHN0cnVjdCBuc19k aXNwbGF5X2luZm8gKmRweWluZm8gPSBGUkFNRV9ESVNQTEFZX0lORk8gKHMtPmYpOworICAgICAg ICAgICAgICBbW2RweWluZm8tPmJpdG1hcHNbZmFjZS0+c3RpcHBsZS0xXS5pbWcgc3RpcHBsZU1h c2tdIHNldF07CisgICAgICAgICAgICB9CisgICAgICAgICAgaWYgKHMtPmhsICE9IERSQVdfQ1VS U09SKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzLT5yZWN0YW5nbGVfbnVrZWRfcCA9 IHRydWU7CisgICAgICAgICAgICAgIE5TUmVjdCByID0gTlNNYWtlUmVjdCAocy0+eCwgcy0+eSAr IGJveF9saW5lX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+ YmFja2dyb3VuZF93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMt PmhlaWdodC0yKmJveF9saW5lX3dpZHRoKTsKKyAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7 CisgICAgICAgICAgICB9CisgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IDE7CisgICAgICB9 CisgICAgfQorfQorCitzdGF0aWMgdm9pZAorbWNfbnNfZHJhd19nbHlwaF9zdHJpbmcgKHN0cnVj dCBnbHlwaF9zdHJpbmcgKnMsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGds eXBoX3JvdyAqcm93LAorICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNs LCBlbnVtIG1jX2Zs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ICAgICB3aWR0aCArPSBu ZXh0LT53aWR0aCwgbmV4dCA9IG5leHQtPm5leHQpCisgICAgICAgIGlmIChuZXh0LT5maXJzdF9n bHlwaC0+dHlwZSAhPSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpZiAo bmV4dC0+Zmlyc3RfZ2x5cGgtPnR5cGUgIT0gU1RSRVRDSF9HTFlQSCkKKyAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocy0+ bmV4dCwgcik7CisgICAgICAgICAgICAgICAgaWYgKCFtY19uc19jbGlwX3RvX3JlY3QgKHMtPmYs IHIsIG4sIHJvdykpCisgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAg bWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzLT5uZXh0LCAxKTsKKyAgICAgICAg ICAgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICAgICAgICAgIH0KKyAgICAg ICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIG1jX25zX2R1bXBn bHlwaHNfc3RyZXRjaCAocy0+bmV4dCwgd2QsIHJvdyk7CisgICAgICAgICAgICAgICAgaWYgKChz LT5uZXh0LT5sZWZ0X292ZXJ3cml0dGVuX3AgfHwgcy0+bmV4dC0+cmlnaHRfb3ZlcndyaXR0ZW5f cCkKKyAgICAgICAgICAgICAgICAgICAgJiYgcy0+bmV4dC0+YWN0aW9uX3R5cGUgPT0gTUNfRFJB V19HTFlQSCkKKyAgICAgICAgICAgICAgICAgIG1jX25zX2RyYXdfb3ZlcndyaXR0ZW4gKHMtPm5l eHQsIG1hdHJpeCwgcm93LCBzLT5uZXh0LT5maXJzdF9nbHlwaCk7CisgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgIG5leHQtPm51bV9jbGlwcyA9IDA7CisgICAgICA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cGUgPT0gTUNfRlJBTUVEX0JPWAorICAgICAgICAgICAgICAg ICAgICYmIGFjdGl2ZV9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBlbnVtIGZhY2Vf aWQgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ ZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLWZhY2UiKSwgdHJ1ZSk7Cisg ICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9IEZBQ0VfRlJP TV9JRCAocy0+ZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICBOU19G QUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2UpID0gTlNfRkFDRV9GT1JFR1JPVU5EIChob2xsb3dfaW5h Y3RpdmVfZmFjZSk7CisgICAgICAgICAgICB9CisgICAgICB7CisgICAgICAgIEJPT0wgaXNDb21w b3NpdGUgPSBzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEg7CisgICAgICAg IGlmIChpc0NvbXBvc2l0ZSkKKyAgICAgICAgICBuc19kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJp bmdfZm9yZWdyb3VuZCAocyk7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBib29sIHdpdGhfYmdfcCA9ICgoZmxhZ3MgPT0gTlNfRFVNUEdMWVBIX05PUk1BTCAm JiAhcy0+YmFja2dyb3VuZF9maWxsZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgfHwgZmxhZ3MgPT0gTlNfRFVNUEdMWVBIX01PVVNFRkFDRSk7CisgICAgICAgICAgICAgIGlm ICh3aXRoX2JnX3ApCisgICAgICAgICAgICAgICAgcy0+YmFja2dyb3VuZF9udWtlZF9wID0gdHJ1 ZTsKKyAgICAgICAgICAgICAgZm9udC0+ZHJpdmVyLT5kcmF3IChzLCBzLT5jbXBfZnJvbSwgcy0+ bmNoYXJzLCBzLT54LCBzLT55YmFzZSwgd2l0aF9iZ19wKTsKKyAgICAgICAgICAgIH0KKyAgICAg IH0KKyAgICAgIHsKKyAgICAgICAgTlNDb2xvciAqY29sID0gKE5TX0ZBQ0VfRk9SRUdST1VORCAo cy0+ZmFjZSkgIT0gMAorICAgICAgICAgICAgICAgICAgICAgICAgPyBuc19sb29rdXBfaW5kZXhl ZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKSwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPmYpCisgICAgICAgICAgICAgICAg ICAgICAgICA6IEZSQU1FX0ZPUkVHUk9VTkRfQ09MT1IgKHMtPmYpKTsKKyAgICAgICAgW2NvbCBz ZXRdOworICAgICAgICAvKiBEcmF3IHVuZGVybGluZSwgb3ZlcmxpbmUsIHN0cmlrZS10aHJvdWdo LiAqLworICAgICAgICBtY19uc19kcmF3X3RleHRfZGVjb3JhdGlvbiAocywgcy0+ZmFjZSwgY29s LCBzLT53aWR0aCwgcy0+eCk7CisgICAgICB9CisgICAgICB7CisgICAgICAgIGlmIChzLT5maXJz dF9nbHlwaC0+dHlwZSAhPSBDT01QT1NJVEVfR0xZUEgKKyAgICAgICAgICAgICYmIChzLT5sZWZ0 X292ZXJ3cml0dGVuX3AgfHwgcy0+cmlnaHRfb3ZlcndyaXR0ZW5fcCkKKyAgICAgICAgICAgICYm IChzLT5iYWNrZ3JvdW5kX251a2VkX3AgfHwgcy0+cmVjdGFuZ2xlX251a2VkX3ApCisgICAgICAg ICAgICAmJiBzLT5hY3Rpb25fdHlwZSA9PSBNQ19EUkFXX0dMWVBIKQorICAgICAgICAgIG1jX25z X2RyYXdfb3ZlcndyaXR0ZW4gKHMsIG1hdHJpeCwgcm93LCBzLT5maXJzdF9nbHlwaC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+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpOworICAg ICAgLyogLi4uICovCisgICAgICAvKiBOb3QgeWV0IGltcGxlbWVudGVkLiAgKi8KKyAgICAgIC8q IC4uLiAqLworICAgICAgbnNfcmVzZXRfY2xpcHBpbmcgKHMtPmYpOworICAgICAgYnJlYWs7Cisg ICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOworICAgIH0KKyAgLyogRHJhdyBib3gg aWYgbm90IGRvbmUgYWxyZWFkeS4gKi8KKyAgaWYgKCFzLT5mb3Jfb3ZlcmxhcHMgJiYgIWJveF9k cmF3bl9wICYmIHMtPmZhY2UtPmJveCAhPSBGQUNFX05PX0JPWCkKKyAgICB7CisgICAgICBuID0g bnNfZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsIHIpOworICAgICAgaWYgKCFtY19uc19j bGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4sIHJvdykpCisgICAgICAgIHJldHVybjsKKyAgICAgIG5z X2R1bXBnbHlwaHNfYm94X29yX3JlbGllZiAocyk7CisgICAgICBuc19yZXNldF9jbGlwcGluZyAo cy0+Zik7CisgICAgfQorICBzLT5udW1fY2xpcHMgPSAwOworfQorCisvKiBlbmQgTVVMVElQTEUt Q1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogLyogPT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT0KIAogICAgTlNUUkFDRSwgVHJhY2Ugc3VwcG9ydC4KQEAgLTExMDksNiArMjE5NCwxNiBA QCBzdGF0aWMgTlNSZWN0IGNvbnN0cmFpbl9mcmFtZV9yZWN0KE5TUmVjdCBmcmFtZVJlY3QsIGJv b2wgaXNGdWxsc2NyZWVuKQogICAgZXh0ZXJuYWwgKFJJRikgY2FsbDsgd2hvbGUgZnJhbWUsIGNh bGxlZCBiZWZvcmUgdXBkYXRlX3dpbmRvd19iZWdpbgogICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8K IHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8K KworICBmLT5tY191cGRhdGluZ19mcmFtZSA9IGY7CisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKICNpZmRlZiBOU19JTVBMX0NPQ09BCiAgIEVtYWNzVmlldyAqdmlldyA9IEZSQU1FX05T X1ZJRVcgKGYpOwogCkBAIC0xMjA5LDYgKzIzMDQsMTYgQEAgc3RhdGljIE5TUmVjdCBjb25zdHJh aW5fZnJhbWVfcmVjdChOU1JlY3QgZnJhbWVSZWN0LCBib29sIGlzRnVsbHNjcmVlbikKIAogLyog ICBpZiAoZiA9PSBNT1VTRV9ITF9JTkZPIChmKS0+bW91c2VfZmFjZV9tb3VzZV9mcmFtZSkgKi8K ICAgTU9VU0VfSExfSU5GTyAoZiktPm1vdXNlX2ZhY2VfZGVmZXIgPSAwOworCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0 aW5nX2ZyYW1lID0gTlVMTDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAK QEAgLTQ4MDMsNiArNTkwOCwxNyBAQCBpbiBjZXJ0YWluIHNpdHVhdGlvbnMgKHJhcGlkIGluY29t aW5nIGV2ZW50cykuCiAgICAgICBiYXIgPSBbW0VtYWNzU2Nyb2xsZXIgYWxsb2NdIGluaXRGcmFt ZTogciB3aW5kb3c6IHdpbl07CiAgICAgICB3c2V0X3ZlcnRpY2FsX3Njcm9sbF9iYXIgKHdpbmRv dywgbWFrZV9taW50X3B0ciAoYmFyKSk7CiAgICAgICB1cGRhdGVfcCA9IFlFUzsKKworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgLyog VGhpcyBpcyBvbmx5IGZvciBkZWJ1Z2dpbmcgcHVycG9zZXMuICovCisgICAgICBbYmFyIG1jX3Nl dF9yZWN0YW5nbGU6IHJdOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgfQog ICBlbHNlCiAgICAgewpAQCAtNDgxMCwxMiArNTkyNiwzMCBAQCBpbiBjZXJ0YWluIHNpdHVhdGlv bnMgKHJhcGlkIGluY29taW5nIGV2ZW50cykuCiAgICAgICBiYXIgPSBYTlNfU0NST0xMX0JBUiAo d2luZG93LT52ZXJ0aWNhbF9zY3JvbGxfYmFyKTsKICAgICAgIG9sZFJlY3QgPSBbYmFyIGZyYW1l XTsKICAgICAgIHIuc2l6ZS53aWR0aCA9IG9sZFJlY3Quc2l6ZS53aWR0aDsKKworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogICAgICAgaWYgKEZS QU1FX0xJVkVfUCAoZikgJiYgIU5TRXF1YWxSZWN0cyAob2xkUmVjdCwgcikpCiAgICAgICAgIHsK KyAgICAgICAgICAvKiBUaGUgbWFpbiB3aW5kb3cgaGFzIHByb2JhYmx5IGJlZW4gcmVzaXplZC4g IEdyYWNpb3VzbHkgZGVsZXRlIHRoZQorICAgICAgICAgIG9sZCBzY3JvbGwgYmFyIHdpdGhvdXQg cmVwYWludGluZyBpdHMgcmVjdGFuZ2xlOyBhbmQsIGNyZWF0ZSBhIG5ldworICAgICAgICAgIHNj cm9sbCBiYXIgZWxzZXdoZXJlLiovCiAgICAgICAgICAgaWYgKG9sZFJlY3Qub3JpZ2luLnggIT0g ci5vcmlnaW4ueCkKKyAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgbnNfY2xlYXJfZnJhbWVf YXJlYSAoZiwgbGVmdCwgdG9wLCB3aWR0aCwgaGVpZ2h0KTsKKyAgICAgICAgICAgICAgW2JhciBt Y19qdWRnZV07CisgICAgICAgICAgICAgIGJhciA9IFtbRW1hY3NTY3JvbGxlciBhbGxvY10gaW5p dEZyYW1lOiByIHdpbmRvdzogd2luXTsKKyAgICAgICAgICAgICAgd3NldF92ZXJ0aWNhbF9zY3Jv bGxfYmFyICh3aW5kb3csIG1ha2VfbWludF9wdHIgKGJhcikpOworICAgICAgICAgICAgfQorICAg ICAgICAgICAgZWxzZQogICAgICAgICAgIFtiYXIgc2V0RnJhbWU6IHJdOwogICAgICAgICB9CisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICB9CiAKICAgaWYgKHVwZGF0ZV9wKQpA QCAtNDk3NSw5ICs2MTA5LDU3IEBAIGluIGNlcnRhaW4gc2l0dWF0aW9ucyAocmFwaWQgaW5jb21p bmcgZXZlbnRzKS4KICAgICB7CiAgICAgICB2aWV3ID0gW3N1YnZpZXdzIG9iamVjdEF0SW5kZXg6 IGldOwogICAgICAgaWYgKCFbdmlldyBpc0tpbmRPZkNsYXNzOiBbRW1hY3NTY3JvbGxlciBjbGFz c11dKSBjb250aW51ZTsKLSAgICAgIGlmIChbdmlldyBqdWRnZV0pCisKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogYFhTRVRXSU5ET1cn IHdpbGwgc29tZXRpbWVzIGNhdXNlIEVtYWNzIHRvIGNyYXNoIHdoZW4gcnVubmluZyB1bmRlciBn ZGIgZXZlbgorICB0aG91Z2ggKHcgIT0gTlVMTCkuICBUaGVyZWZvcmUsIHdlIGNhbm5vdCByZWxp YWJseSB1c2UgYFdJTkRPV19MSVZFX1AnLiAqLworICBzdHJ1Y3Qgd2luZG93ICp3ID0gW3ZpZXcg bWNfZ2V0X3dpbmRvd107CisgIGlmICh3ICE9IE5VTEwKKyAgICAgICYmIE5JTFAgKHctPmNvbnRl bnRzKSkKKyAgICB7CisgICAgICBCT09MIGRlYnVnX3AgPSBmYWxzZTsKKyAgICAgIGlmIChkZWJ1 Z19wCisgICAgICAgICAgLyogYHdpbmRvd19ib3gnIGNhbGxzIGB3aW5kb3dfYm94X2hlaWdodCcs IHdoaWNoIHdpbGwgY2F1c2UgRW1hY3MgdG8KKyAgICAgICAgICBjcmFzaCBpZiBGUkFNRVAgKHct PmZyYW1lKSBpcyBub3Qgc2F0aXNmaWVkLiAqLworICAgICAgICAgICYmIEZSQU1FUCAody0+ZnJh bWUpKQorICAgICAgICB7CisgICAgICAgICAgTlNSZWN0IHIwID0gW3ZpZXcgbWNfZ2V0X3JlY3Rh bmdsZV07CisgICAgICAgICAgaW50IHgwID0gTlNNaW5YIChyMCk7CisgICAgICAgICAgaW50IHkw ID0gTlNNaW5ZIChyMCk7CisgICAgICAgICAgaW50IHdkMCA9IE5TV2lkdGggKHIwKTsKKyAgICAg ICAgICBpbnQgaDAgPSBOU0hlaWdodCAocjApOworICAgICAgICAgIGludCB3aW5kb3dfeSwgd2lu ZG93X2hlaWdodDsKKyAgICAgICAgICB3aW5kb3dfYm94ICh3LCBBTllfQVJFQSwgMCwgJndpbmRv d195LCAwLCAmd2luZG93X2hlaWdodCk7CisgICAgICAgICAgaW50IHRvcCA9IHdpbmRvd195Owor ICAgICAgICAgIGludCBoZWlnaHQgPSB3aW5kb3dfaGVpZ2h0OworICAgICAgICAgIGludCB3aWR0 aCA9IFdJTkRPV19DT05GSUdfU0NST0xMX0JBUl9DT0xTICh3KSAqIEZSQU1FX0NPTFVNTl9XSURU SCAoZik7CisgICAgICAgICAgaW50IGxlZnQgPSBXSU5ET1dfU0NST0xMX0JBUl9BUkVBX1ggKHcp OworICAgICAgICAgIE5TUmVjdCByMSA9IE5TTWFrZVJlY3QgKGxlZnQsIHRvcCwgd2lkdGgsIGhl aWdodCk7CisgICAgICAgICAgLyogVGhlIHBhcmVudCB2aWV3IGlzIGZsaXBwZWQsIHNvIHdlIG5l ZWQgdG8gZmxpcCB5IHZhbHVlLiAqLworICAgICAgICAgIEVtYWNzVmlldyAqZnJhbWVfdmlldyA9 IEZSQU1FX05TX1ZJRVcgKGYpOworICAgICAgICAgIE5TUmVjdCB2ID0gW2ZyYW1lX3ZpZXcgZnJh bWVdOworICAgICAgICAgIHIxLm9yaWdpbi55ID0gKHYuc2l6ZS5oZWlnaHQgLSByMS5zaXplLmhl aWdodCAtIHIxLm9yaWdpbi55KTsKKyAgICAgICAgICBpbnQgeDEgPSBOU01pblggKHIxKTsKKyAg ICAgICAgICBpbnQgeTEgPSBOU01pblkgKHIxKTsKKyAgICAgICAgICBpbnQgd2QxID0gTlNXaWR0 aCAocjEpOworICAgICAgICAgIGludCBoMSA9IE5TSGVpZ2h0IChyMSk7CisgICAgICAgICAgZnBy aW50ZiAoc3RkZXJyLCAiJXMgLS0gREVBRDpcblwKKyAgICAgICAgICB4MC94MSAoJWQvJWQpIHwg eTAveTEgKCVkLyVkKSB8IHdkMC93ZDEgKCVkLyVkKSB8IGgwL2gxICglZC8lZClcbiIsCisgICAg ICAgICAgbWNfd2luZG93ICh3KSwgeDAsIHgxLCB5MCwgeTEsIHdkMCwgd2QxLCBoMCwgaDEpOwor ICAgICAgICB9CisgICAgICBpZiAoW3ZpZXcgbWNfanVkZ2VdKQogICAgICAgICByZW1vdmVkID0g WUVTOwogICAgIH0KKyAgICBlbHNlIGlmIChbdmlldyBqdWRnZV0pCisgICAgICByZW1vdmVkID0g WUVTOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCisgICAgfQogCiAgIGlmIChyZW1v dmVkKQogICAgIFtldmlldyB1cGRhdGVGcmFtZVNpemU6IE5PXTsKQEAgLTUxMDYsNiArNjI4OCwy MSBAQCBzdGF0aWMgTGlzcF9PYmplY3QgbnNfc3RyaW5nX3RvX2xpc3Btb2QgKGNvbnN0IGNoYXIg KnMpCiBleHRlcm4gZnJhbWVfcGFybV9oYW5kbGVyIG5zX2ZyYW1lX3Bhcm1faGFuZGxlcnNbXTsK IHN0YXRpYyBzdHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFjZSBuc19yZWRpc3BsYXlfaW50ZXJmYWNl ID0KIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMg Ki8KKworLyogYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGBuc3Rlcm0ubWAgbXVzdCBiZSBpbiB0 aGUgZXhhY3Qgc2FtZSBvcmRlciBhcyB0aGUKK2ByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgZGlz cGV4dGVybi5oYCEgKi8KKworICBtY194X3dyaXRlX2dseXBocywKKyAgbWNfbnNfZHJhd193aW5k b3dfY3Vyc29yLAorICBtY19uc19kcmF3X2dseXBoX3N0cmluZywKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogICBuc19mcmFtZV9wYXJtX2hhbmRsZXJzLAogICB4X3Byb2R1Y2VfZ2x5 cGhzLAogICB4X3dyaXRlX2dseXBocywKQEAgLTg3MjEsNiArOTkxOCw0OSBAQCAtIChCT09MKWNh bkJlY29tZU1haW5XaW5kb3cKIAogQGltcGxlbWVudGF0aW9uIEVtYWNzU2Nyb2xsZXIKIAorCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLSAodm9p ZCltY19zZXRfcmVjdGFuZ2xlOiAoTlNSZWN0KXJlY3QKK3sKKyAgbWNfcmVjdGFuZ2xlID0gcmVj dDsKK30KKworLSAoTlNSZWN0KW1jX2dldF9yZWN0YW5nbGUKK3sKKyAgcmV0dXJuIG1jX3JlY3Rh bmdsZTsKK30KKworLSAoc3RydWN0IHdpbmRvdyAqKW1jX2dldF93aW5kb3cKK3sKKyAgcmV0dXJu IHdpbmRvdzsKK30KKworLSAoYm9vbCltY19qdWRnZQoreworICBOU1RSQUNFICgiW0VtYWNzU2Ny b2xsZXIgbWNfanVkZ2VdIik7CisgIGJvb2wgcmV0ID0gY29uZGVtbmVkOworICBibG9ja19pbnB1 dCAoKTsKKyAgaWYgKGNvbmRlbW5lZCkKKyAgICB7CisgICAgICAvKiBlbnN1cmUgb3RoZXIgc2Ny b2xsYmFyIHVwZGF0ZXMgYWZ0ZXIgZGVsZXRpb24gKi8KKyAgICAgIEVtYWNzVmlldyAqdmlldyA9 IChFbWFjc1ZpZXcgKilGUkFNRV9OU19WSUVXIChmcmFtZSk7CisgICAgICBpZiAodmlldyAhPSBu aWwpCisgICAgICAg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oX3N0cmluZyAqcykKK3sKKyAgZWFzc2VydCAo cy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gU1RSRVRDSF9HTFlQSCk7CisgIGlmIChzLT5obCA9PSBE UkFXX0NVUlNPUgorICAgICAgJiYgIXhfc3RyZXRjaF9jdXJzb3JfcCkKKyAgICB7CisgICAgICAv KiBJZiBgeC1zdHJldGNoLWN1cnNvcicgaXMgbmlsLCBkb24ndCBkcmF3IGEgYmxvY2sgY3Vyc29y IGFzCisgICB3aWRlIGFzIHRoZSBzdHJldGNoIGdseXBoLiAgKi8KKyAgICAgIGludCB3aWR0aCwg YmFja2dyb3VuZF93aWR0aCA9IHMtPmJhY2tncm91bmRfd2lkdGg7CisgICAgICBpbnQgeCA9IHMt Png7CisgICAgICBpZiAoIXMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAgeworICAgIGludCBsZWZ0X3gg PSB3aW5kb3dfYm94X2xlZnRfb2Zmc2V0IChzLT53LCBURVhUX0FSRUEpOworICAgIGlmICh4IDwg bGVmdF94KQorICAgICAgeworICAgICAgICBiYWNrZ3JvdW5kX3dpZHRoIC09IGxlZnRfeCAtIHg7 CisgICAgICAgIHggPSBsZWZ0X3g7CisgICAgICB9CisgIH0KKyAgICAgIGVsc2UKKyAgeworICAg IC8qIEluIFIyTCByb3dzLCBkcmF3IHRoZSBjdXJzb3Igb24gdGhlIHJpZ2h0IGVkZ2Ugb2YgdGhl CisgICAgICAgc3RyZXRjaCBnbHlwaC4gICovCisgICAgaW50IHJpZ2h0X3ggPSB3aW5kb3dfYm94 X3JpZ2h0IChzLT53LCBURVhUX0FSRUEpOworICAgIGlmICh4ICsgYmFja2dyb3VuZF93aWR0aCA+ IHJpZ2h0X3gpCisgICAgICBiYWNrZ3JvdW5kX3dpZHRoIC09IHggLSByaWdodF94OworICAgIHgg Kz0gYmFja2dyb3VuZF93aWR0aDsKKyAgfQorICAgICAgd2lkdGggPSBtaW4gKEZSQU1FX0NPTFVN Tl9XSURUSCAoc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BzcGVlY2ggc3ludGhlc2l6ZXJzIGNhbiBm b2xsb3cgdGhlIGN1cnNvci4gICovCisgICAgICBpZiAoYWN0aXZlX3ApCisgICAgICAgIHsKKyAg ICAgICAgICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworICAg ICAgICAgIEhXTkQgaHduZCA9IEZSQU1FX1czMl9XSU5ET1cgKGYpOworICAgICAgICAgIHczMl9z eXN0ZW1fY2FyZXRfeAorICAgICAgICAgICAgPSBXSU5ET1dfVEVYVF9UT19GUkFNRV9QSVhFTF9Y ICh3LCB4KTsKKyAgICAgICAgICAvKiBGSVhNRTogIFdoYXQgc2hvdWxkIHdlIHVzZSBpbnN0ZWFk IG9mIGB3LT5waHlzX2N1cnNvcl9hc2NlbnQnPyAqLworICAgICAgICAgIHczMl9zeXN0ZW1fY2Fy ZXRfeQorICAgICAgICAgICAgPSAoV0lORE9XX1RPX0ZSQU1FX1BJWEVMX1kgKHcsIHkpCisgICAg ICAgICAgICAgICArIHJvdy0+YXNjZW50IC0gdy0+cGh5c19jdXJzb3JfYXNjZW50KTsKKyAgICAg ICAgICB3MzJfc3lzdGVtX2NhcmV0X3dpbmRvdyA9IHc7CisgICAgICAgICAgdzMyX3N5c3RlbV9j YXJldF9oZHJfaGVpZ2h0ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgICAgICAg ICAgdzMyX3N5c3RlbV9jYXJldF9tb2RlX2hlaWdodCA9IFdJTkRPV19NT0RFX0xJTkVfSEVJR0hU ICh3KTsKKyAgICAgICAgICBQb3N0TWVzc2FnZSAoaHduZCwgV01fSU1FX1NUQVJUQ09NUE9TSVRJ T04sIDAsIDApOworICAgICAgICAgIC8qIElmIHRoZSBzaXplIG9mIHRoZSBhY3RpdmUgY3Vyc29y IGNoYW5nZWQsIGRlc3Ryb3kgdGhlIG9sZAorICAgICAgICAgICAgIHN5c3RlbSBjYXJldC4gICov CisgICAgICAgICAgaWYgKHczMl9zeXN0ZW1fY2FyZXRfaHduZAorICAgICAgICAgICAgICAmJiAo dzMyX3N5c3RlbV9jYXJldF9oZWlnaHQgIT0gaCkpCisgICAgICAgICAgICBQb3N0TWVzc2FnZSAo aHduZCwgV01fRU1BQ1NfREVTVFJPWV9DQVJFVCwgMCwgMCk7CisgICAgICAgICAgdzMyX3N5c3Rl bV9jYXJldF9oZWlnaHQgPSBoOworICAgICAgICAgIC8qIE1vdmUgdGhlIHN5c3RlbSBjYXJldC4g ICovCisgICAgICAgICAgUG9zdE1lc3NhZ2UgKGh3bmQsIFdNX0VNQUNTX1RSQUNLX0NBUkVULCAw LCAwKTsKKyAgICAgICAgfQorICAgICAgLyogVGhlIGZyaW5nZSBiaXRtYXBzIGFyZSBwcmVzZW50 bHkgaGFuZGxlZCBlbHNld2hlcmUsIGJ1dCBjb3VsZCBzb21lZGF5CisgICAgICBiZSBtYW5hZ2Vk IChpbiBwYXJ0KSBhdCB0aGlzIHNlY3Rpb24gb2YgY29kZS4gKi8KKyAgICAgIGlmIChyb3ctPmV4 YWN0X3dpbmRvd193aWR0aF9saW5lX3AKKyAgICAgICAgICAmJiAocm93LT5yZXZlcnNlZF9wCisg ICAgICAgICAgICAgPyAoaHBvcyA8IDApCisgICAgICAgICAgICAgOiAoaHBvcyA+PSByb3ctPnVz ZWRbVEVYVF9BUkVBXSkpKQorICAgICAgICB7CisgICAgICAgICAgcm93LT5jdXJzb3JfaW5fZnJp bmdlX3AgPSB0cnVlOworICAgICAgICAgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcCAodywgcm93LCBy b3ctPnJldmVyc2VkX3AsIGN1cnNvcl90eXBlKTsKKyAgICAgICAgICByZXR1cm47CisgICAgICAg IH0KKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAgQ09M T1JSRUYgb3JpZ2luYWxfY3Vyc29yX3BpeGVsID0gZi0+b3V0cHV0X2RhdGEudzMyL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b3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19h Y3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgIGdjX3ZhbHVlcy5mb3JlZ3JvdW5kID0gaG9s bG93X2FjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICBnY192YWx1ZXMuYmFj a2dyb3VuZCA9IGhvbGxvd19hY3RpdmVfcmVnaW9uX2ZhY2UtPmJhY2tncm91bmQ7CisgICAgICAg ICAgICB9CisgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAg ICAgICAgICAgICYmICFyZWdpb25faW5fYm91bmRzX3AKKyAgICAgICAgICAgICAgICAgICAgICYm IGFjdGl2ZV9wKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lk IGhvbGxvd19hY3RpdmVfcmVnaW9uX291dF9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcs IGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1yZWdpb24tZmFjZSIpLCB0cnVlKTsKKyAg ICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9yZWdpb25fb3V0X2ZhY2Ug PSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfcmVnaW9uX291dF9mYWNlX2lkKTsKKyAg ICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3Vw X25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1mYWNlIiksIHRy dWUpOworICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBG QUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAg Z2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7Cisg ICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX3JlZ2lv bl9vdXRfZmFjZS0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBl bHNlIGlmICghcmVnaW9uX2FjdGl2ZV9wICYmIGFjdGl2ZV9wKQorICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBs b29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWZhY2Ui KSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9m YWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAg ICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVn cm91bmQ7CisgICAgICAgICAgICAgICAgICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IGhvbGxvd19h Y3RpdmVfZmFjZS0+YmFja2dyb3VuZDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAg ICAgLyogVGhlIHJlZ2lvbiBpcyBfbm90XyB2aXNpYmxlIGluIHRoZSBpbmFjdGl2ZSB3aW5kb3cg YmVjYXVzZSB0aGUgb3ZlcmxheSB3aW5kb3cgcHJvcGVydHkgaXMgdXNlZC4gKi8KKyAgICAgICAg ICAgICAgICBlbHNlIGlmICghYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICB7CisgICAgICAg ICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfaW5hY3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0+Y3Vyc29yX2djID0gb3JpZ2luYWxfY3Vyc29yX2djOworICAgICAgICAgIHVuYmxvY2tf aW5wdXQgKCk7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0 YS53MzItPmN1cnNvcl9waXhlbCcuICAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+ Y3Vyc29yX3BpeGVsID0gY29sb3JfcGl4ZWw7CisgICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93 X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgp OworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxf Y3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKGN1cnNvcl9nbHlwaC0+ dHlwZSA9PSBJTUFHRV9HTFlQSCAmJiBsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYg bHNsLmJsdWUgPj0gMCkKKyAgICAgICAgICB7CisgICAgICAgICAgICAvKiBUZW1wb3JhcmlseSBo aWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgICAg ICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAg ICAgICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5 LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMy LT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgICAgfQorICAg ICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogVGVtcG9y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gPSBob2xsb3dfYWN0aXZlX3JlZ2lvbl9mYWNlLT5iYWNr Z3JvdW5kOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlmIChyZWdp b25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcmVnaW9uX2luX2JvdW5k c19wCisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYWN0aXZlX3ApCisgICAgICAgICAgICAg ICAgICB7CisgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3Jl Z2lvbl9vdXRfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJl YWwtZmFrZS1jdXJzb3ItcmVnaW9uLWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAg IHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9vdXRfZmFjZSA9IEZBQ0VfRlJPTV9J RCAoZiwgaG9sbG93X2FjdGl2ZV9yZWdpb25fb3V0X2ZhY2VfaWQpOworICAgICAgICAgICAgICAg ICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2Zh Y2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1mYWNlIiksIHRydWUpOworICAg ICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9G Uk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICBn Y192YWx1ZXMuZm9yZWdyb3VuZCA9IGhvbGxvd19hY3RpdmVfZmFjZS0+Zm9yZWdyb3VuZDsKKyAg ICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX3Jl Z2lvbl9vdXRfZmFjZS0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgICAgICAgIGVsc2UgaWYgKCFyZWdpb25fYWN0aXZlX3AgJiYgYWN0aXZlX3ApCisgICAgICAg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93 X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVh bC1mYWtlLWN1cnNvci1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgIHN0cnVj dCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3Rp dmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQg PSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgICAgICAg Z2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmJhY2tncm91bmQ7Cisg ICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgLyogVGhlIHJlZ2lvbiBp cyBfbm90XyB2aXNpYmxlIGluIHRoZSBpbmFjdGl2ZSB3aW5kb3cgYmVjYXVzZSB0aGUgb3Zlcmxh eSB3aW5kb3cgcHJvcGVydHkgaXMgdXNlZC4gKi8KKyAgICAgICAgICAgICAgICAgICAgZWxzZSBp ZiAoIWFjdGl2ZV9wKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAg ICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1l ZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItaW5hY3RpdmUtZmFjZSIp LCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5h Y3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOwor ICAgICAgICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfaW5h Y3RpdmVfZmFjZS0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVl cy5iYWNrZ3JvdW5kID0gaG9sbG93X2luYWN0aXZlX2ZhY2UtPmJhY2tncm91bmQ7CisgICAgICAg ICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNv cl9nYyA9IFhDcmVhdGVHQyAoTlVMTCwgRlJBTUVfVzMyX1dJTkRPVyAoZiksIG1hc2ssICZnY192 YWx1ZXMpOworICAgICAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgLyog Rm9yY2UgYG1jX3czMl9zZXRfY3Vyc29yX2djJyB0byB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLncz Mi0+Y3Vyc29yX2djJy4gICovCisgICAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX3AgPSB0cnVl OworICAgICAgICAgICAgICBtY19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERS QVdfQ1VSU09SLCB4LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgbHNsLCBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsIGN1cnNv cl9nY19wKTsKKyAgICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MgPSBv cmlnaW5hbF9jdXJzb3JfZ2M7CisgICAgICAgICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAg ICAgICAgICAgIG1jX3czMl9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBm eCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAgICAgICAgICAgIH0KKyAgICAgIGJyZWFr OworICAgIH0KKyAgICBjYXNlIE1DX0hPTExPV19CT1g6CisgICAgeworICAgICAgaWYgKGxzbC5y ZWQgPj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAgICB7Cisg ICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNv cl9waXhlbCcuICAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVs ID0gY29sb3JfcGl4ZWw7CisgICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywg bWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAg IGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVs OworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICBtY193MzJfZHJhd19ob2xsb3df Y3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7 CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBNQ19GSUxMRURfQk9YOgorICAgIHsKKyAg ICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkK KyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2Rh dGEudzMyLT5jdXJzb3JfZ2MnIG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W5ibG9ja19p bnB1dCAoKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAg ICAgYm9vbCBjdXJzb3JfZ2NfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNfZHJhd19jdXJzb3Jf Z2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsc2wsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5 cGUsIHdkLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJz b3JfZ2NfcCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNf QkFSOgorICAgIHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYg bHNsLmJsdWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFj ayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgICBmLT5v dXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAgIGJv b2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSB0cnVlOworICAgICAgICAgIG1jX3czMl9k cmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3Ms IHdkLCBoLCBjdXJzb3Jfd2lkdGgsIE1DX0JBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3Ap OworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxf Y3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAg ICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7CisgICAgICAg ICAgICBtY193MzJfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5 LCBocG9zLCB2cG9zLCB3ZCwgaCwgY3Vyc29yX3dpZHRoLCBNQ19CQVIsIGN1cnNvcl9nY19pbnZp c2libGVfb2theV9wKTsKKyAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2Fz ZSBNQ19IQkFSOgorICAgIHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49 IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5 IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAg ICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAg ICAgIGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSB0cnVlOworICAgICAgICAgIG1j X3czMl9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3Ms IHZwb3MsIHdkLCBoLCBjdXJzb3Jfd2lkdGgsIE1DX0hCQVIsIGN1cnNvcl9nY19pbnZpc2libGVf b2theV9wKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9y aWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAg eworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IGZhbHNlOwor ICAgICAgICAgICAgbWNfdzMyX2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4 LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsIGN1cnNvcl93aWR0aCwgTUNfSEJBUiwgY3Vyc29y X2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0K KyAgICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7CisgIH0KKyAgICB9Cit9CisKKy8q IERyYXcgZ2x5cGggc3RyaW5nIFMuICAqLworc3RhdGljIHZvaWQKK21jX3czMl9kcmF3X2dseXBo X3N0cmluZyAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0 cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgIHN0 cnVjdCBtY19SR0IgbHNsLCBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IsCisgICAgICAgICAg ICAgICAgICAgICAgICAgIGVudW0gdHlwZV9vZl9jdXJzb3IgY3Vyc29yX3R5cGUsIGludCBjdXJz b3Jfd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgYWN0aXZlX3AsIGJvb2wg Y3Vyc29yX2djX3ApCit7CisgIGJvb2wgcmVsaWVmX2RyYXduX3AgPSAwOworICAvKiBJZiBTIGRy YXdzIGludG8gdGhlIGJhY2tncm91bmQgb2YgaXRzIHN1Y2Nlc3NvciwgZHJhdyB0aGUKKyAgICAg YmFja2dyb3VuZCBvZiB0aGUgc3VjY2Vzc29yIGZpcnN0IHNvIHRoYXQgUyBjYW4gZHJhdyBpbnRv IGl0LgorICAgICBUaGlzIG1ha2VzIFMtPm5leHQgdXNlIFhEcmF3U3RyaW5nIGluc3RlYWQgb2Yg WERyYXdJbWFnZVN0cmluZy4gICovCisgIGlmIChzLT5uZXh0ICYmIHMtPnJpZ2h0X292ZXJoYW5n ICYmICFzLT5mb3Jfb3ZlcmxhcHMpCisgICAgeworICAgICAgaW50IHdpZHRoOworICAgICAgc3Ry dWN0IGdseXBoX3N0cmluZyAqbmV4dDsKKyAgICAgIGZvciAod2lkdGggPSAwLCBuZXh0ID0gcy0+ bmV4dDsKKyAgICAgICAgICAgbmV4dCAmJiB3aWR0aCA8IHMtPnJpZ2h0X292ZXJoYW5nOworICAg ICAgICAgICB3aWR0aCArPSBuZXh0LT53aWR0aCwgbmV4dCA9IG5leHQtPm5leHQpCisgICAgICAg IGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSAhPSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICB7 CisgICAgICAgICAgICBtY193MzJfc2V0X2dseXBoX3N0cmluZ19nYyAobmV4dCwgY3Vyc29yX2dj X3ApOworICAgICAgICAgICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nIChuZXh0KTsKKyAg ICAgICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKQor ICAgICAgICAgICAgICBtY193MzJfZHJhd19zdHJldGNoX2dseXBoX3N0cmluZyAobmV4dCk7Cisg ICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dy b3VuZCAobmV4dCwgdHJ1ZSk7CisgICAgICAgICAgICBuZXh0LT5udW1fY2xpcHMgPSAwOworICAg ICAgICAgIH0KKyAgICB9CisgIC8qIFNldCB1cCBTLT5nYywgc2V0IGNsaXBwaW5nIGFuZCBkcmF3 IFMuICAqLworICBtY193MzJfc2V0X2dseXBoX3N0cmluZ19nYyAocywgY3Vyc29yX2djX3ApOwor ICAvKiBEcmF3IHJlbGllZiAoaWYgYW55KSBpbiBhZHZhbmNlIGZvciBjaGFyL2NvbXBvc2l0aW9u IHNvIHRoYXQgdGhlCisgICAgIGdseXBoIHN0cmluZyBjYW4gYmUgZHJhd24gb3ZlciBpdC4gICov CisgIGlmICghcy0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BwaW5nX2V4YWN0bHkgKHMsIHMpOwor ICBlbHNlCisgICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nIChzKTsKKyAgc3dpdGNoIChz LT5maXJzdF9nbHlwaC0+dHlwZSkKKyAgICB7CisgICAgY2FzZSBJTUFHRV9HTFlQSDoKKyAgICAg IHhfZHJhd19pbWFnZV9nbHlwaF9zdHJpbmcgKHMpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBT VFJFVENIX0dMWVBIOgorICAgICAgbWNfdzMyX2RyYXdfc3RyZXRjaF9nbHlwaF9zdHJpbmcgKHMp OworICAgICAgYnJlYWs7CisgICAgY2FzZSBDSEFSX0dMWVBIOgorICAgICAgaWYgKHMtPmZvcl9v dmVybGFwcykKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICBl bHNlCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgZmFsc2UpOwor ICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAgICAgIGJyZWFrOwor ICAgIGNhc2UgQ09NUE9TSVRFX0dMWVBIOgorICAgICAgaWYgKHMtPmZvcl9vdmVybGFwcyB8fCAo cy0+Y21wX2Zyb20gPiAwCisgICAgICAgICAgJiYgISBzLT5maXJzdF9nbHlwaC0+dS5jbXAuYXV0 b21hdGljKSkKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICBl bHNlCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgdHJ1ZSk7Cisg ICAgICB4X2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAgICAg IGJyZWFrOworICAgIGNhc2UgR0xZUEhMRVNTX0dMWVBIOgorICAgICAgaWYgKHMtPmZvcl9vdmVy bGFwcykKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICBlbHNl CisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgZmFsc2UpOworICAg ICAgeF9kcmF3X2dseXBobGVzc19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAgICBi cmVhazsKKyAgICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7CisgICAgfQorICBpZiAo IXMtPmZvcl9vdmVybGFwcykKKyAgICB7CisgICAgICAvKiBEcmF3IHVuZGVybGluZS4gICovCisg ICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3ApCisgICAgICAgIHsKKyAgICAgICAgICBpZiAo cy0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9XQVZFKQorICAgICAgICAgICAg eworICAgICAgICAgICAgICBDT0xPUlJFRiBjb2xvcjsKKyAgICAgICAgICAgICAgaWYgKHMtPmZh Y2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICBjb2xvciA9IHMtPmdj LT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgY29sb3Ig PSBzLT5mYWNlLT51bmRlcmxpbmVfY29sb3I7CisgICAgICAgICAgICAgIHczMl9kcmF3X3VuZGVy d2F2ZSAocywgY29sb3IpOworICAgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKHMtPmZh Y2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgdW5zaWduZWQgbG9uZyB0aGlja25lc3MsIHBvc2l0aW9uOworICAgICAgICAg ICAgICBpbnQgeTsKKyAgICAgICAgICAgICAgaWYgKHMtPnByZXYgJiYgcy0+cHJldi0+ZmFjZS0+ dW5kZXJsaW5lX3AKKyAgICAgICAgICAgICAgICAgICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGlu ZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgICAvKiBXZSB1c2UgdGhlIHNhbWUgdW5kZXJsaW5lIHN0eWxlIGFzIHRoZSBwcmV2aW91 cyBvbmUuICAqLworICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+cHJldi0+dW5kZXJs aW5lX3RoaWNrbmVzczsKKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gcy0+cHJldi0+dW5k ZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZQor ICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJsaW5l IHRoaWNrbmVzcy4gIERlZmF1bHQgaXMgMSBwaXhlbC4gICovCisgICAgICAgICAgICAgICAgICBp ZiAocy0+Zm9udCAmJiBzLT5mb250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4gMCkKKyAgICAgICAg ICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAg ICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gMTsK KyAgICAgICAgICAgICAgICAgIGlmICh4X3VuZGVybGluZV9hdF9kZXNjZW50X2xpbmUpCisgICAg ICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmhlaWdodCAtIHRoaWNrbmVzcykgLSAocy0+ eWJhc2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJsaW5lIHBvc2l0aW9u LiAgVGhpcyBpcyB0aGUgcmVjb21tZW5kZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICB2ZXJ0 aWNhbCBvZmZzZXQgaW4gcGl4ZWxzIGZyb20gdGhlIGJhc2VsaW5lIHRvIHRoZSB0b3Agb2YKKyAg ICAgICAgICAgICAgICAgICAgICAgICB0aGUgdW5kZXJsaW5lLiAgVGhpcyBpcyBhIHNpZ25lZCB2 YWx1ZSBhY2NvcmRpbmcgdG8gdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgc3BlY3MsIGFu ZCBpdHMgZGVmYXVsdCBpcworICAgICAgICAgICAgICAgICAgICAgICAgIFJPVU5EICgobWF4aW11 bV9kZXNjZW50KSAvIDIpLCB3aXRoCisgICAgICAgICAgICAgICAgICAgICAgICAgUk9VTkQgKHgp ID0gZmxvb3IgKHggKyAwLjUpICAqLworICAgICAgICAgICAgICAgICAgICAgIGlmICh4X3VzZV91 bmRlcmxpbmVfcG9zaXRpb25fcHJvcGVydGllcworICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBzLT5mb250ICYmIHMtPmZvbnQtPnVuZGVybGluZV9wb3NpdGlvbiA+PSAwKQorICAgICAgICAg ICAgICAgICAgICAgICAgcG9zaXRpb24gPSBzLT5mb250LT51bmRlcmxpbmVfcG9zaXRpb247Cisg ICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAocy0+Zm9udCkKKyAgICAgICAgICAgICAgICAg ICAgICAgIHBvc2l0aW9uID0gKHMtPmZvbnQtPmRlc2NlbnQgKyAxKSAvIDI7CisgICAgICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gbWF4IChwb3NpdGlvbiwg dW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAg ICAgIC8qIENoZWNrIHRoZSBzYW5pdHkgb2YgdGhpY2tuZXNzIGFuZCBwb3NpdGlvbi4gIFdlIHNo b3VsZAorICAgICAgICAgICAgICAgICBhdm9pZCBkcmF3aW5nIHVuZGVybGluZSBvdXQgb2YgdGhl IGN1cnJlbnQgbGluZSBhcmVhLiAgKi8KKyAgICAgICAgICAgICAgaWYgKHMtPnkgKyBzLT5oZWln aHQgPD0gcy0+eWJhc2UgKyBwb3NpdGlvbikKKyAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IChz LT5oZWlnaHQgLSAxKSAtIChzLT55YmFzZSAtIHMtPnkpOworICAgICAgICAgICAgICBpZiAocy0+ eSArIHMtPmhlaWdodCA8IHMtPnliYXNlICsgcG9zaXRpb24gKyB0aGlja25lc3MpCisgICAgICAg ICAgICAgICAgdGhpY2tuZXNzID0gKHMtPnkgKyBzLT5oZWlnaHQpIC0gKHMtPnliYXNlICsgcG9z aXRpb24pOworICAgICAgICAgICAgICBzLT51bmRlcmxpbmVfdGhpY2tuZXNzID0gdGhpY2tuZXNz OworICAgICAgICAgICAgICBzLT51bmRlcmxpbmVfcG9zaXRpb24gPXBvc2l0aW9uOworICAgICAg ICAgICAgICB5ID0gcy0+eWJhc2UgKyBwb3NpdGlvbjsKKyAgICAgICAgICAgICAgaWYgKHMtPmZh Y2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICB3MzJfZmlsbF9hcmVh IChzLT5mLCBzLT5oZGMsIHMtPmdjLT5mb3JlZ3JvdW5kLCBzLT54LAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHksIHMtPndpZHRoLCAxKTsKKyAgICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+ZmFjZS0+dW5kZXJs aW5lX2NvbG9yLCBzLT54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHksIHMtPndp ZHRoLCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgLyogRHJhdyBvdmVybGlu ZS4gICovCisgICAgICBpZiAocy0+ZmFjZS0+b3ZlcmxpbmVfcCkKKyAgICAgICAgeworICAgICAg ICAgIHVuc2lnbmVkIGxvbmcgZHkgPSAwLCBoID0gMTsKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+ b3ZlcmxpbmVfY29sb3JfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChz LT5mLCBzLT5oZGMsIHMtPmdjLT5mb3JlZ3JvdW5kLCBzLT54LAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgcy0+eSArIGR5LCBzLT53aWR0aCwgaCk7CisgICAgICAgICAgICBlbHNlCisgICAg ICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+ZmFjZS0+b3ZlcmxpbmVf Y29sb3IsIHMtPngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPnkgKyBkeSwgcy0+ d2lkdGgsIGgpOworICAgICAgICB9CisgICAgICAvKiBEcmF3IHN0cmlrZS10aHJvdWdoLiAgKi8K KyAgICAgIGlmIChzLT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9wCisgICAgICAgICAgJiYgIUZPTlRf VEVYVE1FVFJJQyAocy0+Zm9udCkudG1TdHJ1Y2tPdXQpCisgICAgICAgIHsKKyAgICAgICAgICB1 bnNpZ25lZCBsb25nIGggPSAxOworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZHkgPSAocy0+aGVp Z2h0IC0gaCkgLyAyOworICAgICAgICAgIGlmIChzLT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9jb2xv cl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywg cy0+Z2MtPmZvcmVncm91bmQsIHMtPngsIHMtPnkgKyBkeSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgIHMtPndpZHRoLCBoKTsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB3MzJfZmls bF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmZhY2UtPnN0cmlrZV90aHJvdWdoX2NvbG9yLCBzLT54 LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+eSArIGR5LCBzLT53aWR0aCwgaCk7Cisg ICAgICAgIH0KKyAgICAgIC8qIERyYXcgcmVsaWVmIGlmIG5vdCB5ZXQgZHJhd24uICAqLworICAg ICAgaWYgKCFyZWxpZWZfZHJhd25fcCAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gpCisg ICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYm94IChzKTsKKyAgICAgIGlmIChzLT5wcmV2KQor ICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAqcHJldjsKKyAgICAgICAg ICBmb3IgKHByZXYgPSBzLT5wcmV2OyBwcmV2OyBwcmV2ID0gcHJldi0+cHJldikKKyAgICAgICAg ICAgIGlmIChwcmV2LT5obCAhPSBzLT5obAorICAgICAgICAgICAgICAgICYmIHByZXYtPnggKyBw cmV2LT53aWR0aCArIHByZXYtPnJpZ2h0X292ZXJoYW5nID4gcy0+eCkKKyAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgIC8qIEFzIHByZXYgd2FzIGRyYXduIHdoaWxlIGNsaXBwZWQgdG8g aXRzIG93biBhcmVhLCB3ZQorICAgICAgICAgICAgICAgICAgIG11c3QgZHJhdyB0aGUgcmlnaHRf b3ZlcmhhbmcgcGFydCB1c2luZyBzLT5obCBub3cuICAqLworICAgICAgICAgICAgICAgIGVudW0g ZHJhd19nbHlwaHNfZmFjZSBzYXZlID0gcHJldi0+aGw7CisgICAgICAgICAgICAgICAgcHJldi0+ aGwgPSBzLT5obDsKKyAgICAgICAgICAgICAgICBtY193MzJfc2V0X2dseXBoX3N0cmluZ19nYyAo cHJldiwgY3Vyc29yX2djX3ApOworICAgICAgICAgICAgICAgIHhfc2V0X2dseXBoX3N0cmluZ19j bGlwcGluZ19leGFjdGx5IChzLCBwcmV2KTsKKyAgICAgICAgICAgICAgICBpZiAocHJldi0+Zmly c3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSCkKKyAgICAgICAgICAgICAgICAgIHhfZHJhd19n bHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocHJldik7CisgICAgICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICAgICAgeF9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAo cHJldik7CisgICAgICAgICAgICAgICAgdzMyX3NldF9jbGlwX3JlY3RhbmdsZSAocHJldi0+aGRj LCBOVUxMKTsKKyAgICAgICAgICAgICAgICBwcmV2LT5obCA9IHNhdmU7CisgICAgICAgICAgICAg ICAgcHJldi0+bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAg ICBpZiAocy0+bmV4dCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBnbHlwaF9zdHJpbmcg Km5leHQ7CisgICAgICAgICAgZm9yIChuZXh0ID0gcy0+bmV4dDsgbmV4dDsgbmV4dCA9IG5leHQt Pm5leHQpCisgICAgICAgICAgICBpZiAobmV4dC0+aGwgIT0gcy0+aGwKKyAgICAgICAgICAgICAg ICAmJiBuZXh0LT54IC0gbmV4dC0+bGVmdF9vdmVyaGFuZyA8IHMtPnggKyBzLT53aWR0aCkKKyAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIEFzIG5leHQgd2lsbCBiZSBkcmF3biB3 aGlsZSBjbGlwcGVkIHRvIGl0cyBvd24gYXJlYSwKKyAgICAgICAgICAgICAgICAgICB3ZSBtdXN0 IGRyYXcgdGhlIGxlZnRfb3ZlcmhhbmcgcGFydCB1c2luZyBzLT5obCBub3cuICAqLworICAgICAg ICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBzYXZlID0gbmV4dC0+aGw7CisgICAgICAg ICAgICAgICAgbmV4dC0+aGwgPSBzLT5obDsKKyAgICAgICAgICAgICAgICBtY193MzJfc2V0X2ds eXBoX3N0cmluZ19nYyAobmV4dCwgY3Vyc29yX2djX3ApOworICAgICAgICAgICAgICAgIHhfc2V0 X2dseXBoX3N0cmluZ19jbGlwcGluZ19leGFjdGx5IChzLCBuZXh0KTsKKyAgICAgICAgICAgICAg ICBpZiAobmV4dC0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSCkKKyAgICAgICAgICAg ICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAobmV4dCk7CisgICAgICAgICAg ICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgeF9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJp bmdfZm9yZWdyb3VuZCAobmV4dCk7CisgICAgICAgICAgICAgICAgdzMyX3NldF9jbGlwX3JlY3Rh bmdsZSAobmV4dC0+aGRjLCBOVUxMKTsKKyAgICAgICAgICAgICAgICBuZXh0LT5obCA9IHNhdmU7 CisgICAgICAgICAgICAgICAgbmV4dC0+bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICAgICAgICBu ZXh0LT5jbGlwX2hlYWQgPSBzLT5uZXh0OworICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAg ICB9CisgIC8qIFJlc2V0IGNsaXBwaW5nLiAgKi8KKyAgdzMyX3NldF9jbGlwX3JlY3RhbmdsZSAo cy0+aGRjLCBOVUxMKTsKKyAgcy0+bnVtX2NsaXBzID0gMDsKK30KKworLyogZW5kIE1VTFRJUExF LUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC8qIEZyaW5nZSBiaXRt YXBzLiAgKi8KIAogc3RhdGljIGludCBtYXhfZnJpbmdlX2JtcCA9IDA7CkBAIC01NDUsNiArMTM5 OCwxNSBAQCB4X3VwZGF0ZV9iZWdpbiAoc3RydWN0IGZyYW1lICpmKQogICBpZiAoISBGUkFNRV9X MzJfUCAoZikpCiAgICAgcmV0dXJuOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyog TVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gZjsKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBSZWdlbmVyYXRlIGRpc3BsYXkgcGFsZXR0 ZSBiZWZvcmUgZHJhd2luZyBpZiBsaXN0IG9mIHJlcXVlc3RlZAogICAgICBjb2xvcnMgaGFzIGNo YW5nZWQuICovCiAgIGlmIChkaXNwbGF5X2luZm8tPnJlZ2VuX3BhbGV0dGUpCkBAIC03NTQsNiAr MTYxNiwxNiBAQCB4X3VwZGF0ZV9lbmQgKHN0cnVjdCBmcmFtZSAqZikKIAogICAvKiBNb3VzZSBo aWdobGlnaHQgbWF5IGJlIGRpc3BsYXllZCBhZ2Fpbi4gICovCiAgIE1PVVNFX0hMX0lORk8gKGYp LT5tb3VzZV9mYWNlX2RlZmVyID0gZmFsc2U7CisKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBOVUxM OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiB9CiAKIApAQCAtNDA0MSwxMyArNDkx Myw3NCBAQCB3MzJfc2V0X3ZlcnRpY2FsX3Njcm9sbF9iYXIgKHN0cnVjdCB3aW5kb3cgKncsCiAJ ICAgICAgcmVsZWFzZV9mcmFtZV9kYyAoZi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HRvcCwgd2lkdGgsIG1heCAoaGVpZ2h0LCAxKSwKLSAgICAgICAgICAgICAgICAg ICAgICAgIFNXUF9GUkFNRUNIQU5HRUQpOworICAgICAgICAgIGlmIChsZWZ0IDw9IGJhci0+bGVm dCkKKyAgICAgICAgICAgIG15X3Nob3dfd2luZG93IChmLCBod25kLCBTV19ISURFKTsKKyAgICAg ICAgICBNb3ZlV2luZG93IChod25kLCBsZWZ0LCB0b3AsIHdpZHRoLCBtYXggKGhlaWdodCwgMSks IGxlZnQgPD0gYmFyLT5sZWZ0KTsKKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCiAKIAkgIHNpLmNiU2l6ZSA9IHNpemVvZiAoc2kpOwogCSAg c2kuZk1hc2sgPSBTSUZfUkFOR0U7CkBAIC00MzE2LDYgKzUyNDksMjEgQEAgdzMyX2p1ZGdlX3Nj cm9sbF9iYXJzIChzdHJ1Y3QgZnJhbWUgKmYpCiAgICAgewogICAgICAgc3RydWN0IHNjcm9sbF9i YXIgKmIgPSBYU0NST0xMX0JBUiAoYmFyKTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgLyogYERlc3Ryb3lXaW5kb3cnIHdpdGhp biBgeF9zY3JvbGxfYmFyX3JlbW92ZScgcmVwYWludHMgdGhlIHJlY3RhbmdsZS4KKyAgICAgIFRo ZXJlZm9yZSwgd2UgZmlyc3Qgc2VuZCBhIG1lc3NhZ2UgdG8gaW5oaWJpdCByZXBhaW50aW5nLiAq LworICAgICAgaWYgKCFXSU5ET1dfTElWRV9QIChiLT53aW5kb3cpKQorICAgICAgICB7CisgICAg ICAgICAgSFdORCBod25kID0gU0NST0xMX0JBUl9XMzJfV0lORE9XIChiKTsKKyAgICAgICAgICBT ZW5kTWVzc2FnZSAoaHduZCwgV01fU0VUUkVEUkFXLCBmYWxzZSwgMCk7CisgICAgICAgIH0KKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgeF9zY3JvbGxfYmFyX3JlbW92ZSAo Yik7CiAKICAgICAgIG5leHQgPSBiLT5uZXh0OwpAQCAtNzA5MSw2ICs4MDM5LDIxIEBAIGV4dGVy biBmcmFtZV9wYXJtX2hhbmRsZXIgdzMyX2ZyYW1lX3Bhcm1faGFuZGxlcnNbXTsKIAogc3RhdGlj IHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlIHczMl9yZWRpc3BsYXlfaW50ZXJmYWNlID0KIHsK KworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwor LyogYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGB3MzJ0ZXJtLmNgIG11c3QgYmUgaW4gdGhlIGV4 YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYGRpc3BleHRl cm4uaGAhICovCisKKyAgbWNfeF93cml0ZV9nbHlwaHMsCisgIG1jX3czMl9kcmF3X3dpbmRvd19j dXJzb3IsCisgIG1jX3czMl9kcmF3X2dseXBoX3N0cmluZywKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogICB3MzJfZnJhbWVfcGFybV9oYW5kbGVycywKICAgeF9wcm9kdWNlX2dseXBo cywKICAgeF93cml0ZV9nbHlwaHMsCmRpZmYgLS1naX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Y3QgaXRlbXNfaW5fY2FjaGUKKyAgICB7CisgICAgICBpbnQgeDsKKyAgICAgIGludCBm eDsKKyAgICAgIGludCB5OworICAgICAgaW50IGZ5OworICAgICAgaW50IGhwb3M7CisgICAgICBp bnQgdnBvczsKKyAgICAgIGludCB3ZDsKKyAgICAgIGludCBoOworICAgICAgZW51bSB0eXBlX29m X2N1cnNvcgorICAgICAgICB7CisgICAgICAgICAgLyogTk9URTogIFRoZSBmcmluZ2UgYml0bWFw IGZyYW1ld29yayByZWxpZXMgdXBvbiBNQ19OT19GUklOR0VfQklUTUFQCisgICAgICAgICAgSEFW SU5HIEEgVkFMVUUgT0YgWkVSTyAoMCkuICovCisgICAgICAgICAgTUNfTk9fRlJJTkdFX0JJVE1B UCwKKyAgICAgICAgICBNQ19OT19DVVJTT1IsCisgICAgICAgICAgTUNfUklHSFRfRlJJTkdFX0JJ VE1BUCwKKyAgICAgICAgICBNQ19MRUZUX0ZSSU5HRV9CSVRNQVAsCisgICAgICAgICAgTUNfRlJB TUVEX0JPWCwKKyAgICAgICAgICBNQ19GSUxMRURfQk9YLAorICAgICAgICAgIE1DX0hPTExPV19C T1gsCisgICAgICAgICAgTUNfQkFSLAorICAgICAgICAgIE1DX0hCQVIKKyAgICAgICAgfSBjdXJz b3JfdHlwZTsKKyAgICAgIGludCBjdXJzb3Jfd2lkdGg7CisgICAgICBzdHJ1Y3QgUkdCCisgICAg ICAgIHsKKyAgICAgICAgICBkb3VibGUgcmVkOworICAgICAgICAgIGRvdWJsZSBncmVlbjsKKyAg ICAgICAgICBkb3VibGUgYmx1ZTsKKyAgICAgICAgfSBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kOwor ICAgICAgYm9vbCBhY3RpdmVfcDsKKyAgICAgIGVudW0gbWNfZmxhdm9yCisgICAgICAgIHsKKyAg ICAgICAgICBOT19GTEFWT1IsCisgICAgICAgICAgTUNfR0xZUEgsCisgICAgICAgICAgTUNfR0xZ UEhMRVNTLAorICAgICAgICAgIE1DX09WRVJMQVlfQVJST1dfQklUTUFQLAorICAgICAgICAgIE1D X1BJTENST1csCisgICAgICAgICAgTUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVywKKyAg ICAgICAgICBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XLAorICAgICAg ICAgIE1DX0hPTExPV19SRUNUQU5HTEUsCisgICAgICAgICAgTUNfVkVSVElDQUxfQkFSX1JJR0hU X0FSUk9XLAorICAgICAgICAgIE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVywK KyAgICAgICAgICBNQ19WRVJUSUNBTF9CQVIsCisgICAgICAgICAgTUNfUkVWRVJTRURfVkVSVElD QUxfQkFSLAorICAgICAgICAgIE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgfSBn bHlwaF9mbGF2b3I7CisgICAgICBib29sIGVuYWJsZWRfcDsKKyAgICB9ICpjYWNoZXM7Cit9Owor CisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisK Kwogc3RydWN0IGN1cnNvcl9wb3MKIHsKICAgLyogUGl4ZWwgcG9zaXRpb24uICBUaGVzZSBhcmUg YWx3YXlzIHdpbmRvdyByZWxhdGl2ZS4gICovCkBAIC0zMjQsNiArNDAyLDIxIEBAIHN0cnVjdCB3 aW5kb3cKIAogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQogCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgc3RydWN0IG11bHRpcGxlX2N1 cnNvcnMgbWM7CisKKyAgICBzdHJ1Y3QgbXVsdGlwbGVfY3Vyc29yc19jYWNoZSBtY19lbHRzOwor CisgICAgc3RydWN0IG11bHRpcGxlX2N1cnNvcnNfY2FjaGUgY2hfZWx0czsKKworICAgIHN0cnVj dCBtdWx0aXBsZV9jdXJzb3JzX2NhY2hlIGZjX2VsdHM7CisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKICAgICAvKiBDdXJzb3IgdHlwZSBvZiBsYXN0IGN1cnNvciBkcmF3biBvbiB0aGUg d2luZG93LiAgKi8KICAgICBlbnVtIHRleHRfY3Vyc29yX2tpbmRzIHBoeXNfY3Vyc29yX3R5cGU7 CiAKQEAgLTExMjAsNiArMTIxMywxNSBAQCBleHRlcm4gdm9pZCByZWRpc3BsYXlfb3RoZXJfd2lu ZG93cyAodm9pZCk7CiAKIHN0cnVjdCBnbHlwaCAqZ2V0X3BoeXNfY3Vyc29yX2dseXBoIChzdHJ1 Y3Qgd2luZG93ICp3KTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExF LUNVUlNPUlMgKi8KKworc3RydWN0IGdseXBoICptY19nZXRfY3Vyc29yX2dseXBoIChzdHJ1Y3Qg d2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsIHN0cnVjdCBnbHlwaF9yb3cg KnJvdywgaW50IGhwb3MsIGludCB2cG9zKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisK KwogLyogVHJ1ZSBpZiBXSU5ET1cgaXMgYSB2YWxpZCB3aW5kb3cuICAqLwogI2RlZmluZSBXSU5E T1dfVkFMSURfUChXSU5ET1cpCQkJCQlcCiAgIChXSU5ET1dQ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FbWFjcyB2ZXJzaW9uIGZyb20gMDQvMDgvMjAxOToKKworZ2l0IHJlc2V0IC0t aGFyZCBhMDM4ZGY3N2RlN2IxYWEyZDczYTY0Nzg0OTNiODgzOGI1OWU0OTgyCisKK1N0ZXAgMzog IEZyb20gd2l0aGluIHRoZSBuZXcgZW1hY3MgZm9sZGVyIGNyZWF0ZWQgaW4gU3RlcCAxLCBhcHBs eSB0aGUgcGF0Y2g6CisKK2dpdCBhcHBseSAvcGF0aC90by90aGUvcGF0Y2guZGlmZgorCitTdGVw IDQ6ICAuL2F1dG9nZW4uc2gKKworU3RlcCA1OiAgLi9jb25maWd1cmUgLi4uIFt5b3VyIGN1c3Rv bSBvcHRpb25zXQorCitTdGVwIDY6ICBtYWtlCisKK1N0ZXAgNzogIG1ha2UgaW5zdGFsbAorCisK K1VTQUdFOgorCistIEZvciBhIG1pbmltYWwgd29ya2luZyBleGFtcGxlIG9mIGJ1aWx0LWluIGZh a2UgY3Vyc29ycywgdHlwZTogIE0teCBtYy10ZXN0CisKKyAgOzs7IFRVUk4gT04gRkFLRSBDVVJT T1JTIChidWZmZXIgcG9zaXRpb24sIGN1cnNvci10eXBlLCBjdXJzb3IgY29sb3IpOgorCisgIChz ZXRxIG1jLWNvbmYgJygoMSAiaGJhciIgIm1hZ2VudGEiKQorICAgICAgICAgICAgICAgICAgKDIg ImJhciIgInB1cnBsZSIpCisgICAgICAgICAgICAgICAgICAoMyAiYm94IiAiIzAwRkYwMCIpCisg ICAgICAgICAgICAgICAgICAoNCAiaG9sbG93IiAiIzAwMDBGRiIpCisgICAgICAgICAgICAgICAg ICAoNSAoImhiYXIiIDMpIFsxLjAgMC4wIDEuMF0pCisgICAgICAgICAgICAgICAgICAoNiAoImJh ciIgMykgWzAuMCAxLjAgMS4wXSkKKyAgICAgICAgICAgICAgICAgICg3ICJmcmFtZWQiICJPcmFu Z2VSZWQiKSkpKQorCisgIDs7OyBUVVJOIE9GRiBGQUtFIENVUlNPUlM6CisKKyAgKH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OworCitjaGFyICp3X2NvbnRlbnRzID0gKEJVRkZFUlAgKHctPmNvbnRlbnRzKSAm JiBTVFJJTkdQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG5hbWUpKSkKKyAgICAgICAg ICAgICAgICAgICA/IFNTREFUQSAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBuYW1lKSkK KyAgICAgICAgICAgICAgICAgICA6ICJuaWwiOworZnByaW50ZiAoc3RkZXJyLCAiXG5CdWZmZXIg KCVzKVxuIiwgd19jb250ZW50cyk7CisKK3N0cnVjdCBmYWNlICpmYWNlID0gLi4uCitMaXNwX09i amVjdCBmb3JlZ3JvdW5kID0gZmFjZS0+bGZhY2VbTEZBQ0VfRk9SRUdST1VORF9JTkRFWF07CitM aXNwX09iamVjdCBiYWNrZ3JvdW5kID0gZmFjZS0+bGZhY2VbTEZBQ0VfQkFDS0dST1VORF9JTkRF WF07CitmcHJpbnRmIChzdGRlcnIsICJcbmZvcmVncm91bmQgKCVzKSB8IGJhY2tncm91bmQgKCVz KVxuIiwKKyAgICAgICAgICAgICAgICAgKCFOSUxQIChmb3JlZ3JvdW5kKSA/IFNTREFUQSAoZm9y ZWdyb3VuZCkgOiAiTklMUCIpLAorICAgICAgICAgICAgICAgICAoIU5JTFAgKGJhY2tncm91bmQp ID8gU1NEQVRBIChiYWNrZ3JvdW5kKSA6ICJOSUxQIikpOworCitmcHJpbnRmIChzdGRlcnIsICJN eSBsaXNwIG9iamVjdDogICVzXG4iLCBTU0RBVEEgKEZjaGFyX3RvX3N0cmluZyAobWFrZV9maXhu dW0gKDEwMSkpKSk7CisKK2ZwcmludGYgKHN0ZGVyciwgInN0cmluZzogJXMgfCBpbnQ6ICVkXG4i LCAiZm9vIiwgNjkpOworCitpZiAoQlVGRkVSUCAody0+Y29udGVudHMpICYmIFNUUklOR1AgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbmFtZSkpKQorICBmcHJpbnRmIChzdGRlcn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isjZGVmaW5lIE1DX0JVSUxEX0dMWVBIX1NUUklOR1NfWFcoU1RBUlQsIEVORCwgSEVBRCwg VEFJTCwgSEwsIFgsIExBU1RfWCkJXAorICAgICAgICAgICAgY2FzZSBYV0lER0VUX0dMWVBIOiAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICBN Q19CVUlMRF9YV0lER0VUX0dMWVBIX1NUUklORyAoU1RBUlQsIEVORCwgSEVBRCwgVEFJTCwgICAg ICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSEwsIFgsIExB U1RfWCk7ICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICBicmVhazsKKworI2RlZmluZSBN Q19CVUlMRF9HTFlQSF9TVFJJTkdTXzIoU1RBUlQsIEVORCwgSEVBRCwgVEFJTCwgSEwsIFgsIExB U1RfWCkJXAorCSAgICBjYXNlIEdMWVBITEVTU19HTFlQSDoJCQkJCVwKKwkgICAgICBNQ19CVUlM RF9HTFlQSExFU1NfR0xZUEhfU1RSSU5HIChTVEFSVCwgRU5ELCBIRUFELCBUQUlMLAlcCisJCQkJ CSAgICBITCwgWCwgTEFTVF9YKTsJCVwKKwkgICAgICBicmVhazsJCQkJCQkJXAorCQkJCQkJCQkJ XAorCSAgICBkZWZhdWx0OgkJCQkJCQlcCisJICAgICAgZW1hY3NfYWJvcnQgKCk7CQkJCQkJXAor CSAgICB9CQkJCQkJCQlcCisJCQkJCQkJCQlcCisJICBpZiAocykJCQkJCQkJXAorCSAgICB7CQkJ CQkJCQlcCisJICAgICAgc2V0X2dseXBoX3N0cmluZ19iYWNrZ3JvdW5kX3dpZHRoIChzLCBTVEFS VCwgTEFTVF9YKTsJXAorCSAgICAgIChYKSArPSBzLT53aWR0aDsJCQkJCQlcCisJICAgIH0JCQkJ CQkJCVwKKwl9CQkJCQkJCQlcCisgICAgfSB3aGlsZSAoZmFsc2UpCisKKyNkZWZpbmUgTUNfQ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SkKKyAgICAgICAgYnJlYWs7CisgICAg ICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KSB8fCBFUSAoWENB UiAobGlzdCksIGVsdCkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3Qp OworICAgICAgaWYgKCFDT05TUCAobGlzdCkgfHwgRVEgKFhDQVIgKGxpc3QpLCBlbHQpKQorICAg ICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICB9CisgIHJldHVybiBs aXN0OworfQorCitMaXNwX09iamVjdAorbWNfbnRoIChpbnQgbnVtLCBMaXNwX09iamVjdCBsaXN0 KQoreworICBmb3IgKGludCBpID0gMDsgaSA8IG51bSAmJiAhTklMUCAobGlzdCk7IGkrKykKKyAg ICBsaXN0ID0gWENEUiAobGlzdCk7CisgIGlmIChDT05TUCAobGlzdCkpCisgICAgcmV0dXJuIFhD QVIgKGxpc3QpOworICAgIGVsc2UKKyAgICAgIHJldHVybiBRbmlsOworfQorCitMaXNwX09iamVj dAorbWNfYXNzcSAoTGlzcF9PYmplY3Qga2V5LCBMaXNwX09iamVjdCBsaXN0KQoreworICB3aGls ZSAoMSkKKyAgICB7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KQorICAgICAgICAgIHx8IChDT05T UCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAgICYmIEVRIChYQ0FSIChYQ0FSIChsaXN0KSks IGtleSkpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAg IGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAgfHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAg ICAgICAgICAgICAgJiYgRVEgKFhDQVIgKFhDQVIgKGxpc3QpKSwga2V5KSkpCisgICAgICAgIGJy ZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkK KyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAgICAgICAmJiBFUSAo WENBUiAoWENBUiAobGlzdCkpLCBrZXkpKSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0g WENEUiAobGlzdCk7CisgICAgfQorICBpZiAoQ09OU1AgKGxpc3QpKQorICAgIHJldHVybiBYQ0FS IChsaXN0KTsKKyAgICBlbHNlCisgICAgICByZXR1cm4gUW5pbDsKK30KKworTGlzcF9PYmplY3QK K21jX2Fzc29jIChMaXNwX09iamVjdCBrZXksIExpc3BfT2JqZWN0IGxpc3QpCit7CisgIExpc3Bf T2JqZWN0IGNhcjsKKyAgd2hpbGUgKDEpCisgICAgeworICAgICAgaWYgKCFDT05TUCAobGlzdCkK KyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAgICAgICAmJiAoY2Fy ID0gWENBUiAoWENBUiAobGlzdCkpLAorICAgICAgICAgICAgICAgICAgRVEgKGNhciwga2V5KSB8 fCAhTklMUCAoRmVxdWFsIChjYXIsIGtleSkpKSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlz dCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAo Q09OU1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAgICAgICAmJiAoY2FyID0gWENBUiAoWENBUiAo bGlzdCkpLAorICAgICAgICAgICAgICAgICAgRVEgKGNhciwga2V5KSB8fCAhTklMUCAoRmVxdWFs IChjYXIsIGtleSkpKSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3Qp OworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxp c3QpKQorICAgICAgICAgICAgICAmJiAoY2FyID0gWENBUiAoWENBUiAobGlzdCkpLAorICAgICAg ICAgICAgICAgICAgRVEgKGNhciwga2V5KSB8fCAhTklMUCAoRmVxdWFsIChjYXIsIGtleSkpKSkp CisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgIH0KKyAgaWYg KENPTlNQIChsaXN0KSkKKyAgICByZXR1cm4gWENBUiAobGlzdCk7CisgICAgZWxzZQorICAgICAg cmV0dXJuIFFuaWw7Cit9CisKK0xpc3BfT2JqZWN0CittY19wbGlzdF9nZXQgKExpc3BfT2JqZWN0 IHBsaXN0LCBMaXNwX09iamVjdCBwcm9wKQoreworICBMaXNwX09iamVjdCB0YWlsLCBoYWxmdGFp bDsKKyAgLyogaGFsZnRhaWwgaXMgdXNlZCB0byBkZXRlY3QgY2lyY3VsYXIgbGlzdHMuICAqLwor ICB0YWlsID0gaGFsZnRhaWwgPSBwbGlzdDsKKyAgd2hpbGUgKENPTlNQICh0YWlsKSAmJiBDT05T UCAoWENEUiAodGFpbCkpKQorICAgIHsKKyAgICAgIGlmIChFUSAocHJvcCwgWENBUiAodGFpbCkp KQorICAgICAgICByZXR1cm4gWENBUiAoWENEUiAodGFpbCkpOworICAgICAgdGFpbCA9IFhDRFIg KFhDRFIgKHRhaWwpKTsKKyAgICAgIGhhbGZ0YWlsID0gWENEUiAoaGFsZnRhaWwpOworICAgICAg aWYgKEVRICh0YWlsLCBoYWxmdGFpbCkpCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgcmV0dXJu IFFuaWw7Cit9CisKKy8qIENoZWNrIHRoZSBwcmVzZW5jZSBvZiBhIGRpc3BsYXkgcHJvcGVydHkg YW5kIGNvbXB1dGUgaXRzIHdpZHRoLgorICAgSWYgYSBwcm9wZXJ0eSB3YXMgZm91bmQgYW5kIGl0 cyB3aWR0aCB3YXMgZm91bmQgYXMgd2VsbCwgcmV0dXJuCisgICBpdHMgd2lkdGggKD49IDApIGFu ZCBzZXQgdGhlIHBvc2l0aW9uIG9mIHRoZSBlbmQgb2YgdGhlIHByb3BlcnR5CisgICBp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IHdpbGwgYXBwZWFyLiAqLworICAgICAgaWYgKGNvbCA+PSBnb2FsKQorICBicmVhazsK KyAgICAgIHByZXZfY29sID0gY29sOworICAgICAgeyAvKiBDaGVjayBkaXNwbGF5IHByb3BlcnR5 LiAqLworICBwdHJkaWZmX3QgZW5kcDsKKyAgaW50IHdpZHRoID0gbWNfY2hlY2tfZGlzcGxheV93 aWR0aCAoc2NhbiwgY29sLCAmZW5kcCk7CisgIGlmICh3aWR0aCA+PSAwKQorICAgIHsKKyAgICAg IGNvbCArPSB3aWR0aDsKKyAgICAgIGlmIChlbmRwID4gc2NhbikgLyogQXZvaWQgaW5maW5pdGUg bG9vcHMgd2l0aCAwLXdpZHRoIG92ZXJsYXlzLiAqLworICAgICAgICB7CisgICAgc2NhbiA9IGVu ZHA7CisgICAgc2Nhbl9ieXRlID0gQ0hBUl9UT19CWVRFIChzY2FuKTsKKyAgICBjb250aW51ZTsK KyAgICAgICAgfQorICAgIH0KKyAgICAgIH0KKyAgICAgIC8qIENoZWNrIGNvbXBvc2l0aW9uIHNl cXVlbmNlLiAqLworICAgICAgaWYgKGNtcF9pdC5pZCA+PSAwCisgICAgfHwgKHNjYW4gPT0gY21w X2l0LnN0b3BfcG9zCisgICAgICAgICYmIGNvbXBvc2l0aW9uX3Jlc2VhdF9pdCAoJmNtcF9pdCwg c2Nhbiwgc2Nhbl9ieXRlLCBlbmQsCisgICAgICAgICAgdywgTlVMTCwgUW5pbCkpKQorICBjb21w b3NpdGlvbl91cGRhdGVfaXQgKCZjbXBfaXQsIHNjYW4sIHNjYW5fYnl0ZSwgUW5pbCk7CisgICAg ICBpZiAoY21wX2l0LmlkID49IDApCisgIHsKKyAgICBzY2FuICs9IGNtcF9pdC5uY2hhcnM7Cisg ICAgc2Nhbl9ieXRlICs9IGNtcF9pdC5uYnl0ZXM7CisgICAgaWYgKHNjYW4gPD0gZW5kKQorICAg ICAgY29sICs9IGNtcF9pdC53aWR0aDsKKyAgICBpZiAoY21wX2l0LnRvID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3BfT2JqZWN0IGVudHJ5ID0gQVJFRiAoY2hhcnZlYywgaSk7Cisg ICAgICAgIGlmIChHTFlQSF9DT0RFX1AgKGVudHJ5KSkKKyAgICBjID0gR0xZUEhfQ09ERV9DSEFS IChlbnRyeSk7CisgICAgICAgIGVsc2UKKyAgICBjID0gJyAnOworICAgICAgICBpZiAoYyA9PSAn XG4nKQorICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgaWYgKGMgPT0gJ1xyJyAmJiBFUSAoQlZB UiAoY3VycmVudF9idWZmZXIsIHNlbGVjdGl2ZV9kaXNwbGF5KSwgUXQpKQorICAgIGdvdG8gZW5k bG9vcDsKKyAgICAgICAgaWYgKGMgPT0gJ1x0JykKKyAgICB7CisgICAgICBjb2wgKz0gdGFiX3dp ZHRoOworICAgICAgY29sID0gY29sIC8gdGFiX3dpZHRoICogdGFiX3dpZHRoOworICAgIH0KKyAg ICAgICAgZWxzZQorICAgICsrY29sOworICAgICAgfQorICB9CisgICAgICBlbHNlCisgIHsKKyAg ICAvKiBUaGUgZGlzcGxheSB0YWJsZSBkb2Vzbid0IGFmZmVjdCB0aGlzIGNoYXJhY3RlcjsKKyAg ICAgICBpdCBkaXNwbGF5cyBhcyBpdHNlbGYuICovCisgICAgaWYgKGMgPT0gJ1xuJykKKyAgICAg IGdvdG8gZW5kbG9vcDsKKyAgICBpZiAoYyA9PSAnXHInICYmIEVRIChCVkFSIChjdXJyZW50X2J1 ZmZlciwgc2VsZWN0aXZlX2Rpc3BsYXkpLCBRdCkpCisgICAgICBnb3RvIGVuZGxvb3A7CisgICAg aWYgKGMgPT0gJ1x0JykKKyAgICAgIHsKKyAgICAgICAgY29sICs9IHRhYl93aWR0aDsKKyAgICAg ICAgY29sID0gY29sIC8gdGFiX3dpZHRoICogdGFiX3dpZHRoOworICAgICAgfQorICAgIGVsc2Ug aWYgKG11bHRpYnl0ZSAmJiBMRUFESU5HX0NPREVfUCAoYykpCisgICAgICB7CisgICAgICAgIC8q IFN0YXJ0IG9mIG11bHRpLWJ5dGUgZm9ybS4gKi8KKyAgICAgICAgdW5zaWduZWQgY2hhciAqcHRy OworICAgICAgICBpbnQgYnl0ZXMsIHdpZHRoOworICAgICAgICBwdHIgPSBCWVRFX1BPU19BRERS IChzY2FuX2J5dGUpOworICAgICAgICBNQ19NVUxUSUJZVEVfQllURVNfV0lEVEggKHB0ciwgZHAs IGJ5dGVzLCB3aWR0aCk7CisgICAgICAgIC8qIFN1YnRyYWN0IG9uZSB0byBjb21wZW5zYXRlIGZv ciB0aGUgaW5jcmVtZW50CisgICAgIHRoYXQgaXMgZ29pbmcgdG8gaGFwcGVuIGJlbG93LiAqLwor ICAgICAgICBzY2FuX2J5dGUgKz0gYnl0ZXMgLSAxOworICAgICAgICBjb2wgKz0gd2lkdGg7Cisg ICAgICB9CisgICAgZWxzZSBpZiAoY3RsX2Fycm93ICYmIChjIDwgMDQwIHx8IGMgPT0gMDE3Nykp CisgICAgICBjb2wgKz0gMjsKKyAgICBlbHNlIGlmIChjIDwgMDQwIHx8IGMgPj0gMDE3NykKKyAg ICAgIGNvbCArPSA0OworICAgIGVsc2UKKyAgICAgIGNvbCsrOworICB9CisgICAgICBzY2FuKys7 CisgICAgICBzY2FuX2J5dGUrKzsKKyAgICB9CisgZW5kbG9vcDoKKyAgbGFzdF9rbm93bl9jb2x1 bW4gPSBjb2w7CisgIGxhc3Rfa25vd25fY29sdW1uX3BvaW50ID0gcHQ7CisgIGxhc3Rfa25vd25f Y29sdW1uX21vZGlmaWVkID0gTU9ESUZGOworICBpZiAoZ29hbGNvbCkKKyAgICAqZ29hbGNvbCA9 IGNvbDsKKyAgaWYgKGVuZHBvcykKKyAgICAqZW5kcG9zID0gc2NhbjsKKyAgaWYgKHByZXZjb2wp CisgICAgKnByZXZjb2wgPSBwcmV2X2NvbDsKK30KKworcHRyZGlmZl90CittY19jdXJyZW50X2Nv bHVtbiAoc3RydWN0IHdpbmRvdyAqdywgcHRyZGlmZl90IHB0KQoreworICAvKi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VjdCBMaXNwX0NoYXJfVGFibGUgKmRwID0gYnVmZmVyX2Rpc3BsYXlfdGFi bGUgKCk7CisgIGlmIChwdCA9PSBsYXN0X2tub3duX2NvbHVtbl9wb2ludAorICAgICAgJiYgTU9E SUZGID09IGxhc3Rfa25vd25fY29sdW1uX21vZGlmaWVkKQorICAgIHsKKyAgICAgIGlmIChvbGRf YnVmZmVyKQorICAgICAgICBzZXRfYnVmZmVyX2ludGVybmFsIChvbGRfYnVmZmVyKTsKKyAgICAg IHJldHVybiBsYXN0X2tub3duX2NvbHVtbjsKKyAgICB9CisgIC8qIElmIHRoZSBidWZmZXIgaGFz IG92ZXJsYXlzLCB0ZXh0IHByb3BlcnRpZXMsCisgICAgIG9yIG11bHRpYnl0ZSBjaGFyYWN0ZXJz LCB1c2UgYSBtb3JlIGdlbmVyYWwgYWxnb3JpdGhtLiAqLworICBpZiAoYnVmZmVyX2ludGVydmFs cyAoY3VycmVudF9idWZmZXIpCisgICAgICB8fCBidWZmZXJfaGFzX292ZXJsYXlzICgpCisgICAg ICB8fCBaICE9IFpfQllURSkKKyAgICB7CisgICAgICBFTUFDU19JTlQgY29sID0gTU9TVF9QT1NJ VElWRV9GSVhOVU07CisgICAgICBtY19zY2FuX2Zvcl9jb2x1bW4gKCZwdCwgJmNvbCwgTlVMTCwg cHQpOworICAgICAgeworICAgICAgICBpZiAob2xkX2J1ZmZlcikKKyAgICAgICAgICBzZXRfYnVm ZmVyX2ludGVybmFsIChvbGRfYnVmZmVyKTsKKyAgICAgICAgcmV0dXJuIGNvbDsKKyAgICAgIH0K KyAgICB9CisgIC8qIFNjYW4gYmFja3dhcmRzIGZyb20gcG9pbnQgdG8gdGhlIHByZXZpb3VzIG5l d2xpbmUsCisgICAgIGNvdW50aW5nIHdpZHRoLiAgVGFiIGNoYXJhY3RlcnMgYXJlIHRoZSBvbmx5 IGNvbXBsaWNhdGVkIGNhc2UuICovCisgIC8qIE1ha2UgYSBwb2ludGVyIGZvciBkZWNyZW1lb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Q0hBUl9WRUNUT1IgKGRwLCBjKSkpCisgIHsK KyAgICBjaGFydmVjID0gRElTUF9DSEFSX1ZFQ1RPUiAoZHAsIGMpOworICAgIG4gPSBBU0laRSAo Y2hhcnZlYyk7CisgIH0KKyAgICAgIGVsc2UKKyAgeworICAgIGNoYXJ2ZWMgPSBRbmlsOworICAg IG4gPSAxOworICB9CisgICAgICBmb3IgKGkgPSBuIC0gMTsgaSA+PSAwOyAtLWkpCisgIHsKKyAg ICBpZiAoVkVDVE9SUCAoY2hhcnZlYykpCisgICAgICB7CisgICAgICAgIC8qIFRoaXMgc2hvdWxk IGJlIGhhbmRsZWQgdGhlIHNhbWUgYXMKKyAgICAgbmV4dF9lbGVtZW50X2Zyb21fZGlzcGxheV92 ZWN0b3IgZG9lcyBpdC4gKi8KKyAgICAgICAgTGlzcF9PYmplY3QgZW50cnkgPSBBUkVGIChjaGFy dmVjLCBpKTsKKyAgICAgICAgaWYgKEdMWVBIX0NPREVfUCAoZW50cnkpKQorICAgIGMgPSBHTFlQ SF9DT0RFX0NIQVIgKGVudHJ5KTsKKyAgICAgICAgZWxzZQorICAgIGMgPSAnICc7CisgICAgICB9 CisgICAgaWYgKGMgPj0gMDQwICYmIGMgPCAwMTc3KQorICAgICAgY29sKys7CisgICAgZWxzZSBp ZiAoYyA9PSAnXG4nCisgICAgICAgfHwgKGMgPT0gJ1xyJworICAgICAgICAgICAmJiBFUSAoQlZB UiAoY3VycmVudF9idWZmZXIsIHNlbGVjdGl2ZV9kaXNwbGF5KSwgUXQpKSkKKyAgICAgIHsKKyAg ICAgICAgcHRyKys7CisgICAgICAgIGdvdG8gc3RhcnRfb2ZfbGluZV9mb3VuZDsKKyAgICAgIH0K KyAgICBlbHNlIGlmIChjID09ICdcdCcpCisgICAgICB7CisgICAgICAgIGlmICh0YWJfc2VlbikK KyAgICBjb2wgPSAoKGNvbCArIHRhYl93aWR0aCkgLyB0YWJfd2lkdGgpICogdGFiX3dpZHRoOwor ICAgICAgICBwb3N0X3RhYiArPSBjb2w7CisgICAgICAgIGNvbCA9IDA7CisgICAgICAgIHRhYl9z ZWVuID0gMTsKKyAgICAgIH0KKyAgICBlbHNlIGlmIChWRUNUT1JQIChjaGFydmVjKSkKKyAgICAg IC8qIFdpdGggYSBkaXNwbGF5IHRhYmxlIGVudHJ5LCBDIGlzIGRpc3BsYXllZCBhcyBpcywgYW5k CisgICAgICAgICBub3QgZGlzcGxheWVkIGFzIFxOTk4gb3IgYXMgXk4uICBJZiBDIGlzIGEgc2lu Z2xlLWJ5dGUKKyAgICAgICAgIGNoYXJhY3RlciwgaXQgdGFrZXMgb25lIGNvbHVtbi4gIElmIEMg aXMgbXVsdGktYnl0ZSBpbgorICAgICAgICAgYSB1bmlieXRlIGJ1ZmZlciwgaXQncyB0cmFuc2xh dGVkIHRvIHVuaWJ5dGUsIHNvIGl0CisgICAgICAgICBhbHNvIHRha2VzIG9uZSBjb2x1bW4uICov CisgICAgICArK2NvbDsKKyAgICBlbHNlCisgICAgICBjb2wgKz0gKGN0bF9hcnJvdyAmJiBjIDwg MDIwMCkgPyAyIDogNDsKKyAgfQorICAgIH0KKyBzdGFydF9vZl9saW5lX2ZvdW5kOgorICBpZiAo dGFiX3NlZW4pCisgICAgeworICAgICAgY29sID0gKChjb2wgKyB0YWJfd2lkdGgpIC8gdGFiX3dp ZHRoKSAqIHRhYl93aWR0aDsKKyAgICAgIGNvbCArPSBwb3N0X3RhYjsKKyAgICB9CisgIGxhc3Rf a25vd25fY29sdW1uID0gY29sOworICBsYXN0X2tub3duX2NvbHVtbl9wb2ludCA9IHB0OworICBs YXN0X2tub3duX2NvbHVtbl9tb2RpZmllZCA9IE1PRElGRjsKKyAgaWYgKG9sZF9idWZmZXIpCisg IHNldF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworICByZXR1cm4gY29sOworfQorCitE RUZVTiAoIm1jLWN1cnJlbnQtY29sdW1uIiwgRm1jX2N1cnJlbnRfY29sdW1uLCBTbWNfY3V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fT2JqZWN0 IHB0KQoreworICBzdHJ1Y3Qgd2luZG93ICp3ID0gZGVjb2RlX2xpdmVfd2luZG93ICh3aW5kb3cp OworICBMaXNwX09iamVjdCB0ZW1wOworICBYU0VURkFTVElOVCAodGVtcCwgbWNfY3VycmVudF9j b2x1bW4gKHcsIFhGSVhOVU0gKHB0KSkpOworICByZXR1cm4gdGVtcDsKK30KKworLyogVVNBR0U6 ICBmcHJpbnRmIChzdGRlcnIsICJGUkFNRSAoJXMpIiwgbWNfZnJhbWUgKGYpKTsgKi8KK2NoYXIg KgorbWNfZnJhbWUgKHN0cnVjdCBmcmFtZSAqZikKK3sKKyAgTGlzcF9PYmplY3QgZnJhbWU7Cisg IFhTRVRGUkFNRSAoZnJhbWUsIGYpOworICByZXR1cm4gU1NEQVRBIChGcHJpbjFfdG9fc3RyaW5n IChmcmFtZSwgUW5pbCkpOworfQorCisvKiBVU0FHRTogIGZwcmludGYgKHN0ZGVyciwgIldJTkRP VyAoJXMpIiwgbWNfd2luZG93ICh3KSk7ICovCitjaGFyICoKK21jX3dpbmRvdyAoc3RydWN0IHdp bmRvdyAqdykKK3sKKyAgTGlzcF9PYmplY3Qgd2luZG93OworICBYU0VUV0lORE9XICh3aW5kb3cs IHcpOworICByZXR1cm4gU1NEQVRBIChGcHJpbjFfdG9fc3RyaW5nICh3aW5kb3csIFFuaWwpKTsK K30KKworLyogVVNBR0U6ICBmcHJpbnRmIChzdGRlcnIsICJDSEFSQUNURVIgKCVzKSIsIG1jX2No YXJfdG9fc3RyaW5nIChnbHlwaC0+dS5jaCkpOyAqLworY2hhciAqCittY19jaGFyX3RvX3N0cmlu ZyAoaW50IGFyZykKK3sKKyAgTGlzcF9PYmplY3QgY2hhcmFjdGVyID0gKDAgPD0gYXJnICYmIGFy ZyA8PSBNQVhfQ0hBUikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgID8gRmNoYXJfdG9fc3Ry aW5nIChtYWtlX2ZpeG51bSAoYXJnKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIDogUW5p bDsKKyAgY2hhciAqIHJlc3VsdCA9ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAg ICAgICYmIGFyZyA9PSA5KQorICAgICAgICAgICAgICAgICAgICA/ICJcXHQiCisgICAgICAgICAg ICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJn ID09IDEwKQorICAgICAgICAgICAgICAgICAgICA/ICJcXG4iCisgICAgICAgICAgICAgICAgICA6 ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnID09IDMyKQor ICAgICAgICAgICAgICAgICAgICA/ICJcXHMiCisgICAgICAgICAgICAgICAgICA6ICghTklMUCAo Y2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnICE9IDkKKyAgICAgICAgICAg ICAgICAgICAgICYmIGFyZyAhPSAxMAorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnICE9IDMy KQorICAgICAgICAgICAgICAgICAgICA/IFNTREFUQSAoY2hhcmFjdGVyKQorICAgICAgICAgICAg ICAgICAgOiAiXFw/IjsKKyAgcmV0dXJuIHJlc3VsdDsKK30KKworaW50CittY19saXNwX3RvX2N1 cnNvcl90eXBlIChMaXNwX09iamVjdCBhcmcpCit7CisgIGNoYXIgKnN0cjsKKyAgaWYgKFhUWVBF IChhcmcpID09IExpc3BfU3RyaW5nKQorICAgIHN0ciA9IFNTREFUQSAoYXJnKTsKKyAgICBlbHNl IGlmIChYVFlQRSAoYXJnKSA9PSBMaXNwX1N5bWJvbCkKKyAgICAgIHN0ciA9IFNTREFUQSAoU1lN Qk9MX05BTUUgKGFyZykpOworICAgICAgZWxzZSByZXR1cm4gLTE7CisgIGlmICghc3RyY21wIChz dHIsICJubyIpKQorICAgIHJldHVybiBNQ19OT19DVVJTT1I7CisgIGlmICghc3RyY21wIChzdHIs ICJtYy1sZWZ0LWZyaW5nZS1iaXRtYXAiKSkKKyAgICByZXR1cm4gTUNfTEVGVF9GUklOR0VfQklU TUFQOworICBpZiAoIXN0cmNtcCAoc3RyLCAibWMtcmlnaHQtZnJpbmdlLWJpdG1hcCIpKQorICAg IHJldHVybiBNQ19SSUdIVF9GUklOR0VfQklUTUFQOworICBpZiAoIXN0cmNtcCAoc3RyLCAiYm94 IikpCisgICAgcmV0dXJuIE1DX0ZJTExFRF9CT1g7CisgIGlmICghc3RyY21wIChzdHIsICJmcmFt ZWQiKSkKKyAgICByZXR1cm4gTUNfRlJBTUVEX0JPWDsKKyAgaWYgKCFzdHJjbXAgKHN0ciwgImhv bGxvdyIpKQorICAgIHJldHVybiBNQ19IT0xMT1dfQk9YOworICBpZiAoIXN0cmNtcCAoc3RyLCAi YmFyIikpCisgICAgcmV0dXJuIE1DX0JBUjsKKyAgaWYgKCFzdHJjbXAgKHN0ciwgImhiYXIiKSkK KyAgICByZXR1cm4gTUNfSEJBUjsKKyAgcmV0dXJuIC0xOworfQorCisvKiBVU0FHRTogIGZwcmlu dGYgKHN0ZGVyciwgIkNVUlNPUiBUWVBFICglcykiLCBtY19jdXJzb3JfdHlwZV90b19zdHJpbmcg KGFyZykpOyAqLworY2hhciAqCittY19jdXJzb3JfdHlwZV90b19zdHJpbmcgKGVudW0gdHlwZV9v Zl9jdXJzb3IgY3Vyc29yX3R5cGUpCit7CisgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgewor ICAgICAgY2FzZSBNQ19GSUxMRURfQk9YOiByZXR1cm4gIk1DX0ZJTExFRF9CT1giOworICAgICAg Y2FzZSBNQ19GUkFNRURfQk9YOiByZXR1cm4gIk1DX0ZSQU1FRF9CT1giOworICAgICAgY2FzZSBN Q19IT0xMT1dfQk9YOiByZXR1cm4gIk1DX0hPTExPV19CT1giOworICAgICAgY2FzZSBNQ19CQVI6 IHJldHVybiAiTUNfQkFSIjsKKyAgICAgIGNhc2UgTUNfSEJBUjogcmV0dXJuICJNQ19IQkFS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VyZSBhcmUgYW55IGdseXBo cyB3aXRoIGxiZWFyaW5nIDwgMCBvciByYmVhcmluZyA+IHdpZHRoIGluCisgICAgIHRoZSByb3cs IHJlZHJhdyBzb21lIGdseXBocyBpbiBmcm9udCBvciBmb2xsb3dpbmcgdGhlIGdseXBoCisgICAg IHN0cmluZ3MgYnVpbHQgYWJvdmUuICovCisgIGlmIChoZWFkICYmICFvdmVybGFwcyAmJiByb3ct PmNvbnRhaW5zX292ZXJsYXBwaW5nX2dseXBoc19wKQorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlw aF9zdHJpbmcgKmgsICp0OworICAgICAgTW91c2VfSExJbmZvICpobGluZm8gPSBNT1VTRV9ITF9J TkZPIChmKTsKKyAgICAgIGludCBtb3VzZV9iZWdfY29sIFVOSU5JVCwgbW91c2VfZW5kX2NvbCBV TklOSVQ7CisgICAgICBib29sIGNoZWNrX21vdXNlX2ZhY2UgPSBmYWxzZTsKKyAgICAgIGludCBk dW1teV94ID0gMDsKKyAgICAgIC8qIElmIG1vdXNlIGhpZ2hsaWdodGluZyBpcyBvbiwgd2UgbWF5 IG5lZWQgdG8gZHJhdyBhZGphY2VudAorICAgZ2x5cGhzIHVzaW5nIG1vdXNlLWZhY2UgaGlnaGxp Z2h0aW5nLiAqLworICAgICAgaWYgKGFyZWEgPT0gVEVYVF9BUkVBICYmIHJvdy0+bW91c2VfZmFj ZV9wCisgICAgJiYgaGxpbmZvLT5tb3VzZV9mYWNlX2JlZ19yb3cgPj0gMAorICAgICYmIGhsaW5m by0+bW91c2VfZmFjZV9lbmRfcm93ID49IDApCisgIHsKKyAgICBwdHJkaWZmX3Qgcm93X3Zwb3Mg PSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgdy0+Y3VycmVudF9tYXRyaXgpOworICAgIGlmIChyb3df dnBvcyA+PSBobGluZm8tPm1vdXNlX2ZhY2VfYmVnX3JvdworICAgICAgICAmJiByb3dfdnBvcyA8 PSBobGluZm8tPm1vdXNlX2ZhY2V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n CisgICBkcmF3cyBvdmVyIGl0LiAqLworICAgICAgaSA9IGxlZnRfb3ZlcndyaXR0ZW4gKGhlYWQp OworICAgICAgaWYgKGkgPj0gMCkKKyAgeworICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBvdmVy bGFwX2hsOworICAgIC8qIElmIHRoaXMgcm93IGNvbnRhaW5zIG1vdXNlIGhpZ2hsaWdodGluZywg YXR0ZW1wdCB0byBkcmF3CisgICAgICAgdGhlIG92ZXJsYXBwZWQgZ2x5cGhzIHdpdGggdGhlIGNv cnJlY3QgaGlnaGxpZ2h0LiAgVGhpcworICAgICAgIGNvZGUgZmFpbHMgaWYgdGhlIG92ZXJsYXAg ZW5jb21wYXNzZXMgbW9yZSB0aGFuIG9uZSBnbHlwaAorICAgICAgIGFuZCBtb3VzZS1oaWdobGln aHQgc3BhbnMgb25seSBzb21lIG9mIHRoZXNlIGdseXBocy4KKyAgICAgICBIb3dldmVyLCBtYWtp bmcgaXQgd29yayBwZXJmZWN0bHkgaW52b2x2ZXMgYSBsb3QgbW9yZQorICAgICAgIGNvZGUsIGFu ZCBJIGRvbid0IGtub3cgaWYgdGhlIHBhdGhvbG9naWNhbCBjYXNlIG9jY3VycyBpbgorICAgICAg IHByYWN0aWNlLCBzbyB3ZSdsbCBzdGljayB0byB0aGlzIGZvciBub3cuICAtLS0gY3lkICAqLwor ICAgIGlmIChjaGVja19tb3VzZV9mYWNlCisgICAgICAgICYmIG1vdXNlX2JlZ19jb2wgPCBzdGFy dCAmJiBtb3VzZV9lbmRfY29sID4gaSkKKyAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX01PVVNFX0ZB Q0U7CisgICAgZWxzZQorICAgICAgb3ZlcmxhcF9obCA9IERSQVdfTk9STUFMX1RFWFQ7CisgICAg aWYgKGhsICE9IG92ZXJsYXBfaGwpCisgICAgICBjbGlwX2hlYWQgPSBoZWFkOworICAgIGogPSBp OworICAgIE1DX0JVSUxEX0dMWVBIX1NUUklOR1MgKGosIHN0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AgICAgICAgICAgICAgICAgaHBvcywgaHBv cyArIGxlbiwgRFJBV19OT1JNQUxfVEVYVCwgMCwgdnBvcywgYm90dG9tX3Zwb3MsCisgICAgICAg ICAgICAgICAgICAgICAgICAgIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsIGFj dGl2ZV9wLCBjdXJzb3JfZ2NfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgTUNfRFJBV19H TFlQSCk7CisgIHVuYmxvY2tfaW5wdXQgKCk7CisgIC8qIEFkdmFuY2UgdGhlIG91dHB1dCBjdXJz b3IuICovCisgIHctPm91dHB1dF9jdXJzb3IuaHBvcyArPSBsZW47CisgIHctPm91dHB1dF9jdXJz b3IueCA9IHg7Cit9CisKKy8qIEVYUE9SVDoKKyAgIERyYXcgdGhlIGN1cnNvciBnbHlwaCBvZiB3 aW5kb3cgVyBpbiBnbHlwaCByb3cgUk9XLiAgU2VlIHRoZQorICAgY29tbWVudCBvZiBkcmF3X2ds eXBocyBmb3IgdGhlIG1lYW5pbmcgb2YgSEwuICovCit2b2lkCittY19kcmF3X2N1cnNvcl9nbHlw aCAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3Qg Z2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19m YWNlIGhsLCBpbnQgeCwgaW50IGhwb3MsIGludCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAg IHN0cnVjdCBtY19SR0IgbHNsLCBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IsCisgICAgICAg ICAgICAgICAgICAgICAgZW51bSB0eXBlX29mX2N1cnNvciBjdXJzb3JfdHlwZSwgaW50IHdkLCBi b29sIGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX3ApCit7 CisgIHN0cnVjdCBnbHlwaF9yb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9CT1gp CisgICAgeworICAgICAgaW50IHRlbXBfeCA9IHg7CisgICAgICBpbnQgaGVhZGVyX2xpbmVfaGVp Z2h0ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgICAgICBjdXJzb3JfZ2x5cGgg PSBtY19nZXRfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywgaHBvcywgdnBvcyk7CisgICAg ICBpZiAoY3Vyc29yX2dseXBoID09IE5VTEwpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoZGVi dWdfcCkKKyAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX2VyYXNlX2N1cnNvcjogIHJl dHVybiAoJWQpXG4iLCA3KTsKKyAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgIGlu dCB0ZW1wX3dkID0gY3Vyc29yX2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgIGlmICh0ZW1wX3gg PCAwKQorICAgICAgICB7CisgICAgICAgICAgdGVtcF93ZCArPSB0ZW1wX3g7CisgICAgICAgICAg dGVtcF94ID0gMDsKKyAgICAgICAgfQorICAgICAgdGVtcF93ZCA9IG1pbiAod2QsIHdpbmRvd19i b3hfd2lkdGggKHcsIFRFWFRfQVJFQSkgLSB0ZW1wX3gpOworICAgICAgaW50IGZ5ID0gV0lORE9X X1RPX0ZSQU1FX1BJWEVMX1kgKHcsIG1heCAoaGVhZGVyX2xpbmVfaGVpZ2h0LCByb3ctPnkpKTsK KyAgICAgIGludCBmeCA9IFdJTkRPV19URVhUX1RPX0ZSQU1FX1BJWEVMX1ggKHcsIHRlbXBfeCk7 CisgICAgICBpZiAodGVtcF93ZCA+IDApCisgICAgICAgIEZSQU1FX1JJRiAoZiktPmNsZWFyX2Zy YW1lX2FyZWEgKGYsIGZ4LCBmeSwgdGVtcF93ZCwgcm93LT52aXNpYmxlX2hlaWdodCk7CisgICAg fQorICAvKiBFcmFzZSB0aGUgY3Vyc29yIGJ5IHJlZHJhd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kgPCAwCisgICAg ICB8fCBocG9zIDwgMAorICAgICAgfHwgdnBvcyA8IDApCisgICAgcmV0dXJuOworICBMaXNwX09i amVjdCBidWYgPSB3LT5jb250ZW50czsKKyAgQ0hFQ0tfQlVGRkVSIChidWYpOworICBib29sIGF1 dG9faHNjcm9sbF9tb2RlX3AgPSBFUSAoRmJ1ZmZlcl9sb2NhbF92YWx1ZSAoUWF1dG9faHNjcm9s bF9tb2RlLCBidWYpLCBRY3VycmVudF9saW5lKTsKKyAgLyogRVhBTVBMRTogIChzY3JvbGwtbGVm dCA1KSAqLworICBib29sIGhzY2xfYWxsX3RlbXBfcCA9ICh3LT5zdXNwZW5kX2F1dG9faHNjcm9s bAorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IDApOworICAvKiBFWEFNUExFOiAgQy11IEMt eCA8IGFuZCBkbyBub3RoaW5nLiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMF9wID0gKHctPnN1 c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19o c2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwg PiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gdy0+aHNjcm9s bCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIHNvbWV0aGluZyBlbHNlIGJlc2lk ZXMgaG9yaXpvbnRhbGx5IHNjcm9sbGluZyB0aGUKKyAgICAgICAgICAgICAgIGN1cnJlbnQgbGlu ZSBkaWZmZXJlbnRseS4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jp em9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8x X3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hz Y3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwg PT0gdy0+aHNjcm9sbCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIC4uLgorICAgICAg ICAgICAgICAgQ3VycmVudCBsaW5lIGlzIF9ub3RfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZm ZXJlbnRseS4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzJfcCA9ICghdy0+c3VzcGVuZF9hdXRv X2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9k ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA9PSAwCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgIT0gdy0+aHNjcm9sbCk7CisgIC8q IEVYQU1QTEU6ICAoc2Nyb2xsLWxlZnQgNSk7IGFuZCwgdGhlbiBwcmVzcyB0aGUgbGVmdCBhcnJv dyBrZXkgb25lIHRpbWUuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9u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BUAorICAgICAgJiYgIWhzY2xfYWxs X3RlbXBfcAorICAgICAgJiYgIWhzY2xfdGVtcF9wCisgICAgICAmJiAhaHNjbF9wZXJtX3AKKyAg ICAgICYmICFoc2NsX2FsbF9wZXJtXzBfcAorICAgICAgJiYgIWhzY2xfYWxsX3Blcm1fMV9wCisg ICAgICAmJiAhaHNjbF9hbGxfcGVybV8yX3ApCisgICAgeworICAgICAgZW51bSBmYWNlX2lkIG92 ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICghYWN0aXZlX3AKKyAgICAgICAgICYmICFO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkK KyAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFy cm93LWluYWN0aXZlLWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgOiAoYWN0aXZlX3ApCisgICAgICAg ICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWZh Y2UiKSwgdHJ1ZSkKKyAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICBmYWNlX2lkID0g KGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICA/ IG92ZXJsYXlfYXJyb3dfZmFjZV9pZAorICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lE OworICAgICAgLyogZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBRb3Zl cmxheV9hcnJvdywgZmFsc2UsIGZhbHNlKTsgKi8KKyAgICAgIGlmICh3LT5oc2Nyb2xsICE9IDAp CisgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJu ICgiKy1vdmVybGF5LWFycm93I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HRvCisgICAgICByZWx5IHVwb24g YSBMaXNwIHNldHRpbmcgdXNpbmcgYHNldC1mcmluZ2UtYml0bWFwLWZhY2UnLiAqLworICAgICAg cm93LT5sZWZ0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0Vf QklUTUFQKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGZyaW5nZV9iaXRtYXAK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19OT19GUklOR0VfQklUTUFQOwor ICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gZmFjZV9pZDsKKyAgICAgIHJvdy0+bGVm dF9mcmluZ2Vfb2Zmc2V0ID0gMDsKKyAgICAgIHJvdy0+ZnJpbmdlX2JpdG1hcF9wZXJpb2RpY19w ID0gZmFsc2U7CisgICAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXAgKHcsIHJvdywgdHJ1ZSwgY3Vy c29yX3R5cGUpOworICAgIH0KKyAgICBlbHNlIGlmICghcmVtb3ZlX3AKKyAgICAgICAgICAgICAm JiBnbHlwaF9mbGF2b3IgPT0gTUNfT1ZFUkxBWV9BUlJPV19CSVRNQVAKKyAgICAgICAgICAgICAm JiAoaHNjbF9hbGxfdGVtcF9wCisgICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxsX3Blcm1fMF9w CisgICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxsX3Blcm1fMV9wCisgICAgICAgICAgICAgICAg IHx8IGhzY2xfYWxsX3Blcm1fMl9wCisgICAgICAgICAgICAgICAgIHx8IGhzY2xfdGVtcF9wCisg ICAgICAgICAgICAgICAgIHx8IGhzY2xfcGVybV9wKSkKKyAgICAgIHsKKyAgICAgICAgZW51bSBm YWNlX2lkIG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICAgKCFhY3RpdmVfcAorICAg ICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF9pbmFjdGl2 ZV93aW5kb3dzKSkpCisgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJu ICgiKy1vdmVybGF5LWFycm93LWhzY2wtaW5hY3RpdmUtZmFjZSIpLCB0cnVlKQorICAgICAgICAg IDogKGFjdGl2ZV9wKQorICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50 ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtZmFjZSIpLCB0cnVlKQorICAgICAgICAgIDogREVG QVVMVF9GQUNFX0lEOworICAgICAgICBmYWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRf RlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgID8gb3ZlcmxheV9hcnJvd19mYWNlX2lk CisgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgaWYgKGhzY2xf YWxsX3Blcm1fMF9wKQorICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2Jp dG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAg ICBlbHNlIGlmIChoc2NsX2FsbF9wZXJtXzFfcCkKKyAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAg PSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgdHJ1ZSwg ZmFsc2UpOworICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF9hbGxfcGVybV8yX3ApCisgICAgICAg ICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgi Ky1oc2NsLXBlcm0iKSwgZmFsc2UsIHRydWUpOworICAgICAgICAgICAgICBlbHNlIGlmIChoc2Ns X3Blcm1fcC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ZScgaXMgbm90IG5lZWRlZC4K KyAgICAgICAgYG1jX2RyYXdfZnJpbmdlX2JpdG1hcF8xJyBpcyBzb21ld2hhdCBjb25mdXNpbmcg YW5kIHJlcXVpcmVkIHN0ZGVyciBtZXNzYWdlcworICAgICAgICB0byBzZWUgdGhhdCBgcm93LT5v dmVybGF5X2Fycm93X2JpdG1hcGAgc2F0aXNmaWVzIHRoZSBmaXJzdCBjb25kaXRpb24KKyAgICAg ICAgb2YgKHdoaWNoICE9IE5PX0ZSSU5HRV9CSVRNQVApLiAgQXQgdGhpcyB0aW1lLCBAbGF3bGlz dCBwcmVmZXJzIG5vdCB0bworICAgICAgICByZWx5IHVwb24gYSBMaXNwIHNldHRpbmcgdXNpbmcg YHNldC1mcmluZ2UtYml0bWFwLWZhY2UnLiAqLworICAgICAgICByb3ctPmxlZnRfZnJpbmdlX2Jp dG1hcCA9IChjdXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGZyaW5nZV9iaXRtYXAKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsK KyAgICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gZmFjZV9pZDsKKyAgICAgICAgcm93 LT5sZWZ0X2ZyaW5nZV9vZmZzZXQgPSAwOworICAgICAgICByb3ctPmZyaW5nZV9iaXRtYXBfcGVy aW9kaWNfcCA9IGZhbHNlOworICAgICAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXAgKHcsIHJvdywg dHJ1ZSwgY3Vyc29yX3R5cGUpOworICAgICAgfQorICAgICAgZWxzZSBpZiAoIXJlbW92ZV9wCisg ICAgICAgICAgICAgICAmJiAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklH SFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJT RURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIHx8IGds eXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFCisgICAgICAgICAgICAgICAgICAgfHwg Z2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAg ICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRf QVJST1cKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxf QkFSCisgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZF UlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJU SUNBTF9CQVJfQkFDS1NMQVNIKSkKKyAgICAgICAgeworICAgICAgICAgIExpc3BfT2JqZWN0IGJp dG1hcF9mbGF2b3IgPSAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRf QVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hvbGxv d19yZWN0YW5nbGVfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklH SFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNf cmV2ZXJzZWRfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdM RSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3df cmVjdGFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBo X2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBN Q19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxfYmFyX3JpZ2h0X2Fy cm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZv ciA9PSBNQ19WRVJUSUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBRbWNfdmVydGljYWxfYmFyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGlj YWxfYmFyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2Zs YXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jhcl9iYWNrc2xhc2gKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBRbmlsOworICAgICAgICAgIGZyaW5nZV9i aXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBsb29rdXBfZnJpbmdlX2JpdG1hcCAoYml0bWFwX2ZsYXZvcikK KyAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAg ICAgIGZhY2VfaWQgPSAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAorICAg ICAgICAgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1df UkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhf Zmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAg ICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9C QVIpKQorICAgICAgICAgICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGlu dGVybiAoIistcmV2ZXJzZWQtdmVydGljYWwtYmFyLWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAg ICAgICAgICAgOiAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAorICAgICAg ICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfSE9MTE9XX1JF Q1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2 b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAg ICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisg ICAgICAgICAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgi Ky12ZXJ0aWNhbC1iYXItZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICAgICAgICA6IERFRkFV TFRfRkFDRV9JRDsKKyAgICAgICAgICByb3ctPmN1cnNvcl9pbl9mcmluZ2VfcCA9IGZhbHNlOwor ICAgICAgICAgIHJvdy0+cmlnaHRfZnJpbmdlX2JpdG1hcCA9IGZyaW5nZV9iaXRtYXA7CisgICAg ICAgICAgcm93LT5yaWdodF9mcmluZ2VfZmFjZV9pZCA9IGZhY2VfaWQ7CisgICAgICAgICAgcm93 LT5yaWdodF9mcmluZ2Vfb2Zmc2V0ID0gMDsKKyAgICAgICAgICByb3ctPmZyaW5nZV9iaXRtYXBf cGVyaW9kaWNfcCA9IGZhbHNlOworICAgICAgICAgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcCAodywg cm93LCBmYWxzZSwgY3Vyc29yX3R5cGUpOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKGds eXBoX2ZsYXZvciA9PSBNQ19HTFlQSAorICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3Ig PT0gTUNfR0xZUEhMRVNTKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgb25fcCA9IHRy dWU7CisgICAgICAgICAgICBGUkFNRV9SSUYgKGYpLT5tY19zY3JpYmVfY3Vyc29yICh3LCBtYXRy aXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgdnBvcywgd2QsIGgsIGxzbCwgY3Vyc29yX3R5cGUsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIGdseXBo X2ZsYXZvciwgb25fcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGFjdGl2ZV9wKTsKKyAgICAgICAgICB9Cit9CisKKy8qIER1bXAgY29udGVudHMgb2YgZ2x5 cGggR0xZUEggdG8gc3RkZXJyLiAgUk9XIGFuZCBBUkVBIGFyZQorICAgdGhlIGdseXBoIHJvdyBh bmQgYXJlYSB3aGVyZSB0aGUgZ2x5cGggY29tZXMgZnJvbS4gKi8KK3ZvaWQKK21jX2R1bXBfZ2x5 cGggKHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgc3RydWN0IGdseXBoICpnbHlwaCwgaW50IGFyZWEs IGludCByZWxhdGl2ZV94KQoreworICBpZiAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAg ICAgfHwgZ2x5cGgtPnR5cGUgPT0gR0xZUEhMRVNTX0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmlu dGYgKHN0ZGVyciwKKyAgICAgICAgIiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNk IDB4JTA2eCAlNGQgJTEuMWQlMS4xZCAlNWQgJTRkICAlM2QgICUzZCAlcyAlc1xuIiwKKyAgICAg ICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFth cmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVf eCwKKyAgICAgICAgKGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgICAgID8gJ0MnCisg ICAgICAgICA6ICdHJyksCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVS UCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJTkdQIChn bHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICAgIDogKE5JTFAgKGds eXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICA/ICcwJworICAgICAgICAgICAgICAgOiAnLScp KSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgZ2x5cGgtPnUuY2gsCisg ICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAor ICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPngsIGdseXBo LT55LCBnbHlwaC0+aHBvcywgZ2x5cGgtPnZwb3MsIGdseXBoLT56dl9wID8gIlpWIiA6ICItLSIs CisgICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nIChnbHlwaC0+dS5jaCkpOworICAgIH0KKyAgZWxz ZSBpZiAoZ2x5cGgtPnR5cGUgPT0gU1RSRVRDSF9HTFlQSCkKKyAgICB7CisgICAgICBmcHJpbnRm IChzdGRlcnIsCisgICAgICAgICIgJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAw eCUwNnggJTRkICUxLjFkJTEuMWQgJTVkICU0ZCAgJTNkICAlM2QgJXMgJXNcbiIsCisgICAgICAg IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJl YV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gs CisgICAgICAgICdTJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQ IChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnQicKKyAgICAgICAgICA6IChTVFJJTkdQ IChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICA6IChOSUxQIChn bHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICA6ICctJykpKSwKKyAg ICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAwdSwKKyAgICAgICAgZ2x5cGgtPmZh Y2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5y aWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+eCwgZ2x5cGgtPnksIGdseXBoLT5ocG9z LCBnbHlwaC0+dnBvcywgZ2x5cGgtPnp2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgIlxcUyIp OworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgICAgewor ICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMgJTki cEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNkICVzICVj XG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgo cm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAg ICByZWxhdGl2ZV94LAorICAgICAgICAnSScsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAg ICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ0InCisgICAgICAg ICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAg ICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJzAnCisgICAgICAgICAg OiAnLScpKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgKHVuc2lnbmVk IGludCkgZ2x5cGgtPnUuaW1nX2lkLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAg Z2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3As CisgICAgICAgIGdseXBoLT54LCBnbHlwaC0+eSwgZ2x5cGgtPmhwb3MsIGdseXBoLT52cG9zLCBn bHlwaC0+enZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAnLicpOworICAgIH0KKyAgZWxzZSBp ZiAoZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmludGYg KHN0ZGVyciwKKyAgICAgICAgIiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4 JTA2eCIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAg KChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAg ICAgIHJlbGF0aXZlX3gsCisgICAgICAgICcrJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisg ICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnQicKKyAgICAg ICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAg ICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnMCcKKyAgICAgICAg ICA6ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAodW5zaWdu ZWQgaW50KSBnbHlwaC0+dS5jbXAuaWQpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICU0ZCAl MS4xZCUxLjFkIiwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0 X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wKTsKKyAgICAgIGlm IChnbHlwaC0+dS5jbXAuYXV0b21hdGljKQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIgJTVk ICU0ZCAgJTNkICAlM2QgJXMgLiBbJWQtJWRdXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAg IGdseXBoLT54LCBnbHlwaC0+eSwgZ2x5cGgtPmhwb3MsIGdseXBoLT52cG9zLCBnbHlwaC0+enZf cCA/ICJaViIgOiAiLS0iLAorICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoLT5zbGljZS5j bXAuZnJvbSwgZ2x5cGgtPnNsaWNlLmNtcC50byk7CisgICAgICAgIGVsc2UKKyAgICAgICAgZnBy aW50ZiAoc3RkZXJyLCAiXG4iKTsKKyAgICB9CisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IFhX SURHRVRfR0xZUEgpCisgICAgeworI2lmbmRlZiBIQVZFX1hXSURHRVRTCisgICAgICBlYXNzdW1l IChmYWxzZSk7CisjZWxzZQorICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICAlNWQv JS01ZCAlNWQgJTRjICU2ZCAlYyAlM2QgMHglMDV4ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUz ZCAgJTNkICVzICVjXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0s CisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAt IDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAnWCcsCisgICAgICAgIGdseXBoLT5j aGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgPyAn QicKKyAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdT JworICAgICAgICAgOiAnLScpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAg ICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAg ICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT51Lnh3aWRnZXQsCisg ICAgICAgIGdseXBoLT54LCBnbHlwaC0+eSwgZ2x5cGgtPmhwb3MsIGdseXBoLT52cG9zLCBnbHlw aC0+enZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAnLicpOworI2VuZGlmCisgICAgfQorfQor CisvKiBEdW1wIHRoZSBjb250ZW50cyBvZiBnbHlwaCByb3cgYXQgVlBPUyBpbiBNQVRSSVggdG8g c3RkZXJyLgorICAgR0xZUEhTIDAgbWVhbnMgZG9uJ3Qgc2hvdyBnbHlwaCBjb250ZW50cy4KKyAg IEdMWVBIUyAxIG1lYW5zIHNob3cgZ2x5cGhzIGluIHNob3J0IGZvcm0KKyAgIEdMWVBIUyA+IDEg bWVhbnMgc2hvdyBnbHlwaHMgaW4gbG9uZyBmb3JtLiAqLwordm9pZAorbWNfZHVtcF9nbHlwaF9y b3cgKHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgaW50IHZwb3MsIGludCBnbHlwaHMpCit7CisgIGlu dCByZWxhdGl2ZV94ID0gMDsKKyAgaWYgKGdseXBocyAhPSAxKQorICAgIHsKKyAgICAgIGZwcmlu dGYgKHN0ZGVyciwgIlxuRFVNUCBHTFlQSCBST1dcbiIpOworICAgICAgZnByaW50ZiAoc3RkZXJy LCAiUm93ICAgICBTdGFydCAgICAgICBFbmQgVXNlZCBvRT48XFxDVFpGZXNtICAgICBYICAgIFkg ICAgVyAgICBIICAgIFYgICAgQSAgICBQXG4iKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIj09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PVxuIik7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIlM2QgJTki cEQiZCAlOSJwRCJkICU0ZCAlMS4xZCUxLjFkJTEuMWQlMS4xZFwKKyUxLjFkJTEuMWQlMS4xZCUx LjFkJTEuMWQlMS4xZCUxLjFkJTEuMWQgICU0ZCAlNGQgJTRkICU0ZCAlNGQgJTRkICU0ZFxuIiwK KyAgICAgICAgIHZwb3MsCisgICAgICAgICBNQVRSSVhfUk9XX1NUQVJUX0NIQVJQT1MgKHJvdyks CisgICAgICAgICBNQVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpLAorICAgICAgICAgcm93LT51 c2VkW1RFWFRfQVJFQV0sCisgICAgICAgICByb3ctPmNvbnRhaW5zX292ZXJsYXBwaW5nX2dseXBo c19wLAorICAgICAgICAgcm93LT5lbmFibGVkX3AsCisgICAgICAgICByb3ctPnRydW5jYXRlZF9v bl9sZWZ0X3AsCisgICAgICAgICByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wLAorICAgICAgICAg cm93LT5jb250aW51ZWRfcCwKKyAgICAgICAgIE1BVFJJWF9ST1dfQ09OVElOVUFUSU9OX0xJTkVf UCAocm93KSwKKyAgICAgICAgIE1BVFJJWF9ST1dfRElTUExBWVNfVEVYVF9QIChyb3cpLAorICAg ICAgICAgcm93LT5lbmRzX2F0X3p2X3AsCisgICAgICAgICByb3ctPmZpbGxfbGluZV9wLAorICAg ICAgICAgcm93LT5lbmRzX2luX21pZGRsZV9vZl9jaGFyX3AsCisgICAgICAgICByb3ctPnN0YXJ0 c19pbl9taWRkbGVfb2ZfY2hhcl9wLAorICAgICAgICAgcm93LT5tb3VzZV9mYWNlX3AsCisgICAg ICAgICByb3ctPngsCisgICAgICAgICByb3ctPnksCisgICAgICAgICByb3ctPnBpeGVsX3dpZHRo LAorICAgICAgICAgcm93LT5oZWlnaHQsCisgICAgICAgICByb3ctPnZpc2libGVfaGVpZ2h0LAor ICAgICAgICAgcm93LT5hc2NlbnQsCisgIC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mQ7CisgICAgaWYgKGdseXBoIDwgZ2x5cGhfZW5kKQorICAgICAgZnByaW50ZiAoc3RkZXJy LCAiR2x5cGgjL1RvdGFsIFJlbC5YIFQgICAgICAgUG9zIE8gICBXICAgICBDb2RlIEZhY2UgTFIg ICAgIFggICAgWSBIUE9TIFZQT1MgWlYgQ1xuIik7CisgICAgZm9yICg7IGdseXBoIDwgZ2x5cGhf ZW5kOyArK2dseXBoKQorICAgICAgeworICAgICAgICBtY19kdW1wX2dseXBoIChyb3csIGdseXBo LCBhcmVhLCByZWxhdGl2ZV94KTsKKyAgICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxf d2lkdGg7CisgICAgICB9CisgIH0KKyAgICB9CisgIGVsc2UgaWYgKGdseXBocyA9PSAxKQorICAg IHsKKyAgICAgIGNoYXIgc1tTSFJUX01BWCArIDRdOworICAgICAgZm9yIChpbnQgYXJlYSA9IExF RlRfTUFSR0lOX0FSRUE7IGFyZWEgPCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAgeworICAgIGludCBp OworICAgIGZvciAoaSA9IDA7IGkgPCByb3ctPnVzZWRbYXJlYV07ICsraSkKKyAgICAgIHsKKyAg ICAgICAgc3RydWN0IGdseXBoICpnbHlwaCA9IHJvdy0+Z2x5cGhzW2FyZWFdICsgaTsKKyAgICAg ICAgaWYgKGkgPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgJiYgYXJlYSA9PSBURVhUX0FS RUEKKyAgICAgICYmIE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAmJiBnbHlwaC0+dHlwZSA9 PSBDSEFSX0dMWVBICisgICAgICAmJiBnbHlwaC0+dS5jaCA9PSAnICcpCisgICAgeworICAgICAg c3RyY3B5ICgmc1tpXSwgIltcXG5dIik7CisgICAgICBpICs9IDQ7CisgICAgfQorICAgICAgICBl bHNlIGlmIChnbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAgICAgICYmIGdseXBoLT51 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gcG9zX3Zpc2libGVfcCAodywgUFQsICZkMSwgJmQy LCAmZDMsICZkNCwgJmQ1LCAmeXBvcyk7CisgICAgICBpbnQgaGVhZGVyX2xpbmVfaGVpZ2h0ID0g V0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgICAgICBpbnQgdm9mZnNldCA9IChoZWFk ZXJfbGluZV9oZWlnaHQgPiAwCisgICAgICAgICAgICAgICAgICAgICAmJiB5cG9zID4gMCkKKyAg ICAgICAgICAgICAgICAgICAgICA/IHlwb3MgKyAxCisgICAgICAgICAgICAgICAgICAgICAgOiB5 cG9zOworICAgICAgaWYgKHZpc2libGVfcCkKKyAgICAgICAgdnBvcyA9IHZvZmZzZXQ7CisgICAg ICAgIGVsc2UKKyAgICAgICAgICB2cG9zID0gMDsKKyAgICB9CisgICAgZWxzZQorICAgICAgewor ICAgICAgICBDSEVDS19OVU1CRVIgKHJvdyk7CisgICAgICAgIHZwb3MgPSBYRklYTlVNIChyb3cp OworICAgICAgfQorICBtYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAgaWYgKHZwb3MgPj0g MCAmJiB2cG9zIDwgbWF0cml4LT5ucm93cykKKyAgICBtY19kdW1wX2dseXBoX3JvdyAoTUFUUklY X1JPVyAobWF0cml4LCB2cG9zKSwKKyAgICAgICAgdnBvcywKKyAgICAgICAgVFlQRV9SQU5HRURf RklYTlVNUCAoaW50LCBnbHlwaHMpID8gWEZJWE5VTSAoZ2x5cGhzKSA6IDIpOworICByZXR1cm4g UW5pbDsKK30KKwordm9pZAorbWNfZHVtcF9nbHlwaF9tYXRyaXggKHN0cnVjdCBnbHlwaF9tYXRy aXggKm1hdHJpeCwgaW50IGdseXBocykKK3sKKyAgaW50IGk7CisgIGZvciAoaSA9IDA7IGkgPCBt YXRyaXgtPm5yb3dzOyArK2kpCisgICAgbWNfZHVtcF9nbHlwaF9yb3cgKE1BVFJJWF9ST1cgKG1h dHJpeCwgaSksIGksIGdseXBocyk7Cit9Cis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yc29yLngsIHctPmN1cnNvci55 LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MpOworICBmcHJpbnRmIChzdGRlcnIsICI9 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiIpOworICBtY19k dW1wX2dseXBoX21hdHJpeCAody0+Y3VycmVudF9tYXRyaXgsCisgICAgICAgICBUWVBFX1JBTkdF RF9GSVhOVU1QIChpbnQsIGdseXBocykgPyBYRklYTlVNIChnbHlwaHMpIDogMCk7CisgIHJldHVy biBRbmlsOworfQorCit2b2lkCittY19yZXNldF9jYWNoZSAoc3RydWN0IHdpbmRvdyAqdywgZW51 bSB0eXBlX29mX2NhY2hlIGNhY2hlX3R5cGUpCit7CisgIHN3aXRjaCAoY2FjaGVfdHlwZSkKKyAg ICB7CisgICAgICBjYXNlIE5PX0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAgYnJlYWs7Cisg ICAgICAgIH0KKyAgICAgIGNhc2UgTUNfQ0FDSEU6CisgICAgICAgIHsKKyAgICAgICAgICBpZiAo QlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZG RVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAgICAgICYmIHctPm1jX2VsdHMu dXNlZCA+IDEpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIC8qIERlY3JlYXNlIHRoZSBz aXplIG9mIHRoZSBhcnJheSB0byBhIGJhcmUgbWluaW11bS4gKi8KKyAgICAgICAgICAgICAgdy0+ bWNfZWx0cy5jYWNoZXMgPSB4bnJlYWxsb2MgKHctPm1jX2VsdHMuY2FjaGVzLCAxLCBzaXplb2Yg KnctPm1jX2VsdHMuY2FjaGVzKTsKKyAgICAgICAgICAgICAgdy0+bWNfZWx0cy51c2VkID0gMDsK KyAgICAgICAgICAgICAgdy0+bWNfZWx0cy5hbGxvY2F0ZWQgPSAxOworICAgICAgICAgICAgfQor ICAgICAgICAgICAgLy8gIEFsdGhvdWdoIGl0IHdvdWxkIG5vdCBiZSB2ZXJ5IGVmZmljaWVudCwg aXQgaXMgcG9zc2libGUgdG8gc2V0CisgICAgICAgICAgICAvLyAgdGhlIF91c2VkXyBlbGVtZW50 cyBvZiB0aGUgYXJyYXkgdG8gemVyby4gIEluIHN1Y2ggYSBjYXNlLCB0aGUKKyAgICAgICAgICAg IC8vICAuLi5fZWx0cy5hbGxvY2F0ZWQgd291bGQgcmVtYWluIHRoZSBzYW1lLgorICAgICAgICAg ICAgLy8gIG1lbXNldCAody0+bWNfZWx0cy5jYWNoZXMsIDAsIHctPm1jX2VsdHMudXNlZCAqIChz aXplb2YgKnctPm1jX2VsdHMuY2FjaGVzKSk7CisgICAgICAgICAgICAvLyAgQXQgdGhpcyB0aW1l LCB3ZSBhcmUgaW5zdGVhZCBsZWF2aW5nIHRoZSBhcnJheSBhcy1pcyB3aXRoIHRoZQorICAgICAg ICAgICAgLy8gIHVuZGVyc3RhbmRpbmcgdGhhdCBpdCB3aWxsIGNvbnRhaW4gb3V0ZGF0ZWQgZGF0 YSAoYWthIGdhcmJhZ2UpLgorICAgICAgICAgICAgLy8gIFVzaW5nIHRoZSBjb3VudGVyIGB3LT5t Y19lbHRzLnVzZWRgLCB3ZSB0cmFjayBjdXJyZW50IGRhdGEuCisgICAgICAgICAgICBlbHNlIGlm IChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkKKyAgICAgICAgICAgICAgdy0+ bWNfZWx0cy51c2VkID0gMDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgY2Fz ZSBDSF9DQUNIRToKKyAgICAgICAgeworICAgICAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50 cykKKyAgICAgICAgICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBj cm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgJiYgdy0+Y2hfZWx0cy51c2VkID4gMSkKKyAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgLyogRGVjcmVhc2UgdGhlIHNpemUgb2YgdGhlIGFycmF5 IHRvIGEgYmFyZSBtaW5pbXVtLiAqLworICAgICAgICAgICAgICB3LT5jaF9lbHRzLmNhY2hlcyA9 IHhucmVhbGxvYyAody0+Y2hfZWx0cy5jYWNoZXMsIDEsIHNpemVvZiAqdy0+Y2hfZWx0cy5jYWNo ZXMpOworICAgICAgICAgICAgICB3LT5jaF9lbHRzLnVzZWQgPSAwOworICAgICAgICAgICAgICB3 LT5jaF9lbHRzLmFsbG9jYXRlZCA9IDE7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvLyAg QWx0aG91Z2ggaXQgd291bGQgbm90IGJlIHZlcnkgZWZmaWNpZW50LCBpdCBpcyBwb3NzaWJsZSB0 byBzZXQKKyAgICAgICAgICAgIC8vICB0aGUgX3VzZWRfIGVsZW1lbnRzIG9mIHRoZSBhcnJheSB0 byB6ZXJvLiAgSW4gc3VjaCBhIGNhc2UsIHRoZQorICAgICAgICAgICAgLy8gIC4uLl9lbHRzLmFs bG9jYXRlZCB3b3VsZCByZW1haW4gdGhlIHNhbWUuCisgICAgICAgICAgICAvLyAgbWVtc2V0ICh3 LT5jaF9lbHRzLmNhY2hlcywgMCwgdy0+Y2hfZWx0cy51c2VkICogKHNpemVvZiAqdy0+Y2hfZWx0 cy5jYWNoZXMpKTsKKyAgICAgICAgICAgIC8vICBBdCB0aGlzIHRpbWUsIHdlIGFyZSBpbnN0ZWFk IGxlYXZpbmcgdGhlIGFycmF5IGFzLWlzIHdpdGggdGhlCisgICAgICAgICAgICAvLyAgdW5kZXJz dGFuZGluZyB0aGF0IGl0IHdpbGwgY29udGFpbiBvdXRkYXRlZCBkYXRhIChha2EgZ2FyYmFnZSku CisgICAgICAgICAgICAvLyAgVXNpbmcgdGhlIGNvdW50ZXIgYHctPmNoX2VsdHMudXNlZGAsIHdl IHRyYWNrIGN1cnJlbnQgZGF0YS4KKyAgICAgICAgICAgIGVsc2UgaWYgKEJVRkZFUlAgKHctPmNv bnRlbnRzKQorICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgICAgICAgICAgICB3LT5jaF9lbHRzLnVzZWQg PSAwOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBjYXNlIEZDX0NBQ0hFOgor ICAgICAgICB7CisgICAgICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAg ICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQor ICAgICAgICAgICAgICAmJiB3LT5mY19lbHRzLnVzZWQgPiAxKQorICAgICAgICAgICAgeworICAg ICAgICAgICAgICAvKiBEZWNyZWFzZSB0aGUgc2l6ZSBvZiB0aGUgYXJyYXkgdG8gYSBiYXJlIG1p bmltdW0uICovCisgICAgICAgICAgICAgIHctPmZjX2VsdHMuY2FjaGVzID0geG5yZWFsbG9jICh3 LT5mY19lbHRzLmNhY2hlcywgMSwgc2l6ZW9mICp3LT5mY19lbHRzLmNhY2hlcyk7CisgICAgICAg ICAgICAgIHctPmZjX2VsdHMudXNlZCA9IDA7CisgICAgICAgICAgICAgIHctPmZjX2VsdHMuYWxs b2NhdGVkID0gMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vICBBbHRob3VnaCBpdCB3 b3VsZCBub3QgYmUgdmVyeSBlZmZpY2llbnQsIGl0IGlzIHBvc3NpYmxlIHRvIHNldAorICAgICAg ICAgICAgLy8gIHRoZSBfdXNlZF8gZWxlbWVudHMgb2YgdGhlIGFycmF5IHRvIHplcm8uICBJbiBz dWNoIGEgY2FzZSwgdGhlCisgICAgICAgICAgICAvLyAgLi4uX2VsdHMuYWxsb2NhdGVkIHdvdWxk IHJlbWFpbiB0aGUgc2FtZS4KKyAgICAgICAgICAgIC8vICBtZW1zZXQgKHctPmZjX2VsdHMuY2Fj aGVzLCAwLCB3LT5mY19lbHRzLnVzZWQgKiAoc2l6ZW9mICp3LT5mY19lbHRzLmNhY2hlcykpOwor ICAgICAgICAgICAgLy8gIEF0IHRoaXMgdGltZSwgd2UgYXJlIGluc3RlYWQgbGVhdmluZyB0aGUg YXJyYXkgYXMtaXMgd2l0aCB0aGUKKyAgICAgICAgICAgIC8vICB1bmRlcnN0YW5kaW5nIHRoYXQg aXQgd2lsbCBjb250YWluIG91dGRhdGVkIGRhdGEgKGFrYSBnYXJiYWdlKS4KKyAgICAgICAgICAg IC8vICBVc2luZyB0aGUgY291bnRlciBgdy0+ZmNfZWx0cy51c2VkYCwgd2UgdHJhY2sgY3VycmVu dCBkYXRhLgorICAgICAgICAgICAgZWxzZSBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAg ICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBm Y192aXNpYmxlKSkpCisgICAgICAgICAgICAgIHctPmZjX2VsdHMudXNlZCA9IDA7CisgICAgICAg ICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9Cit9CisKK3N0YXRpYyB2b2lkCittY19oZWxwZXIg KHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGds eXBoX3JvdyAqcm93LAorICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoLCBpbnQgeCwgaW50 IGZ4LCBpbnQgeSwgaW50IGZ5LCBpbnQgaHBvcywgaW50IHZwb3MsCisgICAgICAgICAgIGludCB3 ZCwgaW50IGgsIGVudW0gdHlwZV9vZl9jdXJzb3IgY3Vyc29yX3R5cGUsIGludCBjdXJzb3Jfd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2VjdGlvbiB0aGF0IHBvcHVsYXRlcyB0 aGUgY2FjaGUgd2l0aAorICAgICAgICAgIGN1cnNvciBkYXRhLCBhcyB0aGF0IHdpbGwgY2F1c2Ug YSBTSUdTRUdWIChzZWdtZW50YXRpb24gZmF1bHQpLiAqLworICAgICAgICAgIHJldHVybjsKKyAg ICAgICAgfQorICAgICAgY2FzZSBNQ19DQUNIRToKKyAgICAgICAgeworICAgICAgICAgICsrdy0+ bWNfZWx0cy51c2VkOworICAgICAgICAgIGlmICh3LT5tY19lbHRzLmFsbG9jYXRlZCA8IHctPm1j X2VsdHMudXNlZCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaW50IG9sZF9hbGxvYyA9 IHctPm1jX2VsdHMuYWxsb2NhdGVkOworICAgICAgICAgICAgICBpbnQgbmV3X2VsdHMgPSB3LT5t Y19lbHRzLnVzZWQgLSB3LT5tY19lbHRzLmFsbG9jYXRlZDsKKyAgICAgICAgICAgICAgdy0+bWNf ZWx0cy5jYWNoZXMgPSB4cGFsbG9jICh3LT5tY19lbHRzLmNhY2hlcywgJnctPm1jX2VsdHMuYWxs b2NhdGVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19l bHRzLCBJTlRfTUFYLCBzaXplb2YgKnctPm1jX2VsdHMuY2FjaGVzKTsKKyAgICAgICAgICAgICAg bWVtc2V0ICh3LT5tY19lbHRzLmNhY2hlcyArIG9sZF9hbGxvYywgMCwKKyAgICAgICAgICAgICAg ICAgICAgICAgKHctPm1jX2VsdHMuYWxsb2NhdGVkIC0gb2xkX2FsbG9jKSAqIHNpemVvZiAqdy0+ bWNfZWx0cy5jYWNoZXMpOworICAgICAgICAgICAgfQorICAgICAgICAgIGZvb19lbHRzLmNhY2hl cyA9IHctPm1jX2VsdHMuY2FjaGVzOworICAgICAgICAgIGZvb19lbHRzLmFsbG9jYXRlZCA9IHct Pm1jX2VsdHMuYWxsb2NhdGVkOworICAgICAgICAgIGZvb19lbHRzLnVzZWQgPSB3LT5tY19lbHRz LnVzZWQ7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGNhc2UgQ0hfQ0FDSEU6 CisgICAgICAgIHsKKyAgICAgICAgICArK3ctPmNoX2VsdHMudXNlZDsKKyAgICAgICAgICBpZiAo dy0+Y2hfZWx0cy5hbGxvY2F0ZWQgPCB3LT5jaF9lbHRzLnVzZWQpCisgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgIGludCBvbGRfYWxsb2MgPSB3LT5jaF9lbHRzLmFsbG9jYXRlZDsKKyAgICAg ICAgICAgICAgaW50IG5ld19lbHRzID0gdy0+Y2hfZWx0cy51c2VkIC0gdy0+Y2hfZWx0cy5hbGxv Y2F0ZWQ7CisgICAgICAgICAgICAgIHctPmNoX2VsdHMuY2FjaGVzID0geHBhbGxvYyAody0+Y2hf ZWx0cy5jYWNoZXMsICZ3LT5jaF9lbHRzLmFsbG9jYXRlZCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBuZXdfZWx0cywgSU5UX01BWCwgc2l6ZW9mICp3LT5jaF9l bHRzLmNhY2hlcyk7CisgICAgICAgICAgICAgIG1lbXNldCAody0+Y2hfZWx0cy5jYWNoZXMgKyBv bGRfYWxsb2MsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICh3LT5jaF9lbHRzLmFsbG9jYXRl ZCAtIG9sZF9hbGxvYykgKiBzaXplb2YgKnctPmNoX2VsdHMuY2FjaGVzKTsKKyAgICAgICAgICAg IH0KKyAgICAgICAgICBmb29fZWx0cy5jYWNoZXMgPSB3LT5jaF9lbHRzLmNhY2hlczsKKyAgICAg ICAgICBmb29fZWx0cy5hbGxvY2F0ZWQgPSB3LT5jaF9lbHRzLmFsbG9jYXRlZDsKKyAgICAgICAg ICBmb29fZWx0cy51c2VkID0gdy0+Y2hfZWx0cy51c2VkOworICAgICAgICAgIGJyZWFrOworICAg ICAgICB9CisgICAgICBjYXNlIEZDX0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAgKyt3LT5m Y19lbHRzLnVzZWQ7CisgICAgICAgICAgaWYgKHctPmZjX2VsdHMuYWxsb2NhdGVkIDwgdy0+ZmNf ZWx0cy51c2VkKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpbnQgb2xkX2FsbG9jID0g dy0+ZmNfZWx0cy5hbGxvY2F0ZWQ7CisgICAgICAgICAgICAgIGludCBuZXdfZWx0cyA9IHctPmZj X2VsdHMudXNlZCAtIHctPmZjX2VsdHMuYWxsb2NhdGVkOworICAgICAgICAgICAgICB3LT5mY19l bHRzLmNhY2hlcyA9IHhwYWxsb2MgKHctPmZjX2VsdHMuY2FjaGVzLCAmdy0+ZmNfZWx0cy5hbGxv Y2F0ZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2Vs dHMsIElOVF9NQVgsIHNpemVvZiAqdy0+ZmNfZWx0cy5jYWNoZXMpOworICAgICAgICAgICAgICBt ZW1zZXQgKHctPmZjX2VsdHMuY2FjaGVzICsgb2xkX2FsbG9jLCAwLAorICAgICAgICAgICAgICAg ICAgICAgICAody0+ZmNfZWx0cy5hbGxvY2F0ZWQgLSBvbGRfYWxsb2MpICogc2l6ZW9mICp3LT5m Y19lbHRzLmNhY2hlcyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgZm9vX2VsdHMuY2FjaGVz ID0gdy0+ZmNfZWx0cy5jYWNoZXM7CisgICAgICAgICAgZm9vX2VsdHMuYWxsb2NhdGVkID0gdy0+ ZmNfZWx0cy5hbGxvY2F0ZWQ7CisgICAgICAgICAgZm9vX2VsdHMudXNlZCA9IHctPmZjX2VsdHMu dXNlZDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKyAgaW50IG50aCA9IGZv b19lbHRzLnVzZWQgLSAxOworICBmb29fZWx0cy5jYWNoZXNbbnRoXS54ID0geDsKKyAgZm9vX2Vs dHMuY2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nksIGludCBocG9zLCBpbnQgdnBvcywgaW50ICpoLAorICAgICAg ICAgICAgICAgICAgICAgICAgZW51bSB0eXBlX29mX2N1cnNvciBjdXJzb3JfdHlwZSwgaW50IGN1 cnNvcl93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCAqd2QpCit7CisgIHN0cnVj dCBnbHlwaCAqZ2x5cGggPSBtY19nZXRfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywgaHBv cywgdnBvcyk7CisgIGlmIChnbHlwaCA9PSBOVUxMKQorICAgIHJldHVybjsKKyAgc3RydWN0IGZy YW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAgKmZ4ID0gV0lORE9XX1RFWFRf VE9fRlJBTUVfUElYRUxfWCAodywgeCk7CisgICpoID0gcm93LT52aXNpYmxlX2hlaWdodDsKKyAg LyogRG9uJ3QgbGV0IHRoZSBjdXJzb3IgZXhjZWVkIHRoZSBkaW1lbnNpb25zIG9mIHRoZSByb3cs IHNvIHRoYXQKKyAgdGhlIHVwcGVyL2xvd2VyIHNpZGUgb2YgdGhlIGJveCBhcmVuJ3QgY2xpcHBl ZC4gICovCisgIGludCB3X2hlYWRlcl9saW5lX2hlaWdodCA9IFdJTkRPV19IRUFERVJfTElORV9I RUlHSFQgKHcpOworICBpbnQgd190ZXh0X2JvdHRvbV95ID0gd2luZG93X3RleHRfYm90dG9tX3kg KHcpIC0gKmg7CisgIGlmICh5IDwgd19oZWFkZXJfbGluZV9oZWlnaHQpCisgICAgeworICAgICAg KmggPSBtYXggKCpoIC0gKHdfaGVhZGVyX2xpbmVfaGVpZ2h0IC0geSkgKyAxLCAqaCk7CisgICAg ICB5ID0gd19oZWFkZXJfbGluZV9oZWlnaHQgLSAxOworICAgICAgLy8gZnByaW50ZiAoc3RkZXJy LCAiQ09ORElUSU9OICMgMVxuIik7CisgICAgfQorICAgZWxzZSBpZiAoeSA+IHdfdGV4dF9ib3R0 b21feSkKKyAgICAgeworICAgICAgICpoICs9IHkgLSB3X3RleHRfYm90dG9tX3k7CisgICAgICAg eSA9IHdfdGV4dF9ib3R0b21feTsKKyAgICAgICAvLyBmcHJpbnRmIChzdGRlcnIsICJDT05ESVRJ T04gIyAyXG4iKTsKKyAgICAgfQorICAqZnkgPSBXSU5ET1dfVE9fRlJBTUVfUElYRUxfWSAodywg eSk7CisgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgeworICAgICAgY2FzZSBNQ19CQVI6Cisg ICAgICAgIHsKKyAgICAgICAgICBpZiAoY3Vyc29yX3dpZHRoIDwgMSkKKyAgICAgICAgICAgIGN1 cnNvcl93aWR0aCA9IG1heCAoRlJBTUVfQ1VSU09SX1dJRFRIIChmKSwgMSk7CisgICAgICAgICAg aWYgKGN1cnNvcl93aWR0aCA8IGdseXBoLT5waXhlbF93aWR0aCkKKyAgICAgICAgICAqd2QgPSBj dXJzb3Jfd2lkdGg7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGNhc2UgTUNf SEJBUjoKKyAgICAgICAgeworICAgICAgICAgIGludCBjdXJzb3JfaGVpZ2h0ID0gKGN1cnNvcl93 aWR0aCA8IDEpID8gbHJpbnQgKDAuMjUgKiAqaCkgOiBjdXJzb3Jfd2lkdGg7CisgICAgICAgICAg aWYgKGN1cnNvcl9oZWlnaHQgPiByb3ctPmhlaWdodCkKKyAgICAgICAgICAgIGN1cnNvcl9oZWln aHQgPSByb3ctPmhlaWdodDsKKyAgICAgICAgICAvKiBDdXJzb3Igc21hbGxlciB0aGFuIGxpbmUg aGVpZ2h0LCBzbyBtb3ZlIGRvd24uICovCisgICAgICAgICAgaWYgKCpoID4gY3Vyc29yX2hlaWdo dCkKKyAgICAgICAgICAgICpmeSArPSAqaCAtIGN1cnNvcl9oZWlnaHQ7CisgICAgICAgICAgKmgg PSBjdXJzb3JfaGVpZ2h0OworICAgICAgICAgICp3ZCA9IGdseXBoLT5waXhlbF93aWR0aDsKKyAg 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wb2lu dF94KTsKKyAgaW50IGZjX2Z4ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgZmNf eCk7CisgIGJvb2wgenZfcCA9IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93 LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgJiYgTUFUUklYX1JPV19FTkRfQ0hBUlBP UyAocm93KSA9PSBaVik7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOwor ICBMaXNwX09iamVjdCBidWYgPSB3LT5jb250ZW50czsKKyAgQ0hFQ0tfQlVGRkVSIChidWYpOwor ICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAoYnVmKTsKKyAgaW50IHRleHRfYXJlYV93aWR0 aCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgIHN0cnVjdCBnbHlwaF9yb3cg KmN1cnNvcl9yb3cgPSAody0+Y3Vyc29yLnZwb3MgIT0gLTEpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IE1BVFJJWF9ST1cgKGN1cnNvcl9tYXRyaXgsIHctPmN1cnNvci52cG9z KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOVUxMOworICBzdHJ1Y3QgZ2x5 cGggKmN1cnNvcl9nbHlwaCA9ICh3LT5jdXJzb3IudnBvcyAhPSAtMSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIGN1cnNvcl9tYXRyaXgs IGN1cnNvcl9yb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiBOVUxMOworICBib29sIGN1cnNvcl9hdF9mcmluZ2VfcCA9IChj dXJzb3JfZ2x5cGggPT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJz b3Jfcm93ICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29y Lmhwb3MgPT0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIGN1cnNvcl9yb3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5lX3AKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gdGV4dF9hcmVhX3dpZHRo CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID09IGN1cnNvcl9y b3ctPnBpeGVsX3dpZHRoKTsKKyAgYm9vbCBjdXJzb3JfYmV5b25kX2ZyaW5nZV9wID0gKGN1cnNv cl9nbHlwaCA9PSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJz b3Jfcm93ICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1 cnNvci5ocG9zID09IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgIWN1cnNvcl9yb3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5l X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHRl eHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vy c29yLnggPj0gY3Vyc29yX3Jvdy0+cGl4ZWxfd2lkdGgpOworICBpbnQgZnJhbWVfY2hhcl93aWR0 aCA9IEZSQU1FX0NPTFVNTl9XSURUSCAoZik7CisgIGludCB0ZW1wX2ZhY2VfaWQgPSBnbHlwaC0+ ZmFjZV9pZDsKKyAgc3RydWN0IG1jX1JHQiBiYWNrZ3JvdW5kOworICBtY19zZXRfbHNsX2JnICh3 LCB0ZW1wX2ZhY2VfaWQsICZiYWNrZ3JvdW5kKTsKKyAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3Ag PSAob3BvaW50X3ggPT0gcmVsYXRpdmVfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvcG9pbnRfaHBvcyA9PSBocG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9w b2ludF95ID09IGdseXBoLT55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2lu dF92cG9zID09IHZwb3MpOworCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAg ICAgICAgICAgICAgICBCRUdJTjogIENIQVJfR0xZUEggfCBHTFlQSExFU1NfR0xZUEggICAgICAg ICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgIGlmIChnbHlwaC0+dHlw ZSA9PSBDSEFSX0dMWVBICisgICAgICB8fCBnbHlwaC0+dHlwZSA9PSBHTFlQSExFU1NfR0xZUEgp CisgIHsKKyAgICBpZiAobWNfc3RkZXJyX3ApCisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAg ICAgICJcbiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEu MWQlMS4xZCAlNWQgJTRkICAlM2QgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ct PmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAg OiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgKGds eXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgICAgID8gJ0MnCisgICAgICAgICA6ICdHJyks CisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVj dCkKKyAgICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQor ICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisg ICAgICAgICAgICAgICA/ICcwJworICAgICAgICAgICAgICAgOiAnLScpKSksCisgICAgICAgICAg ICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgZ2x5cGgtPnUuY2gsCisgICAgICAgIGds eXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBn bHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlw aC0+aHBvcywgZ2x5cGgtPnZwb3MsIGdseXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAg IG1jX2NoYXJfdG9fc3RyaW5nIChnbHlwaC0+dS5jaCkpOworICBzd2l0Y2ggKGFjdGlvbl90eXBl KQorICB7CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgTVVMVElQ TEVfQ1VSU09SUzogIENIQVJfR0xZUEggfCBHTFlQSExFU1NfR0xZUEggICAgICAgICAgICAgICAq LworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBNVUxUSVBMRV9DVVJTT1JTOgor ICAgIHsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94 LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3Jf dHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAg ICAgICBhY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwgY2FjaGVfdHlwZSk7CisgICAgICBicmVh azsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgSE9S SVpPTlRBTF9SVUxFUjogIENIQVJfR0xZUEggfCBHTFlQSExFU1NfR0xZUEggICAgICAgICAgICAg ICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBIT1JJWk9OVEFMX1JVTEVS OgorICAgIHsKKyAgICAgIGlmIChyZWxhdGl2ZV94IDwgcm93LT5waXhlbF93aWR0aAorICAgICAg ICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4 LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAg ICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQs IGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgICAgYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3 X3AsIGNhY2hlX3R5cGUpOworICAgICAgaWYgKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVB XSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYgcmVsYXRpdmVfeCA8PSB4X2xp bWl0KQorICAgICAgICB7CisgICAgICAgICAgaWYgKHJlbGF0aXZlX3ggPCByb3ctPnBpeGVsX3dp ZHRoKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5w aXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgZnggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAg ICAgICAgICAgfQorICAgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCBy ZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICB4 X2xpbWl0IC0gcmVsYXRpdmVfeCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwKKyAgICAg ICAgICAgICAgICAgICAgIGZvcmVncm91bmQsIGJhY2tncm91bmQsIGFjdGl2ZV9wLCBNQ19HTFlQ SExFU1MsIGRyYXdfcCwKKyAgICAgICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUpOworICAgICAg ICB9CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAg ICAgICAgICAgICAgVkVSVElDQUxfUlVMRVI6ICBDSEFSX0dMWVBIIHwgR0xZUEhMRVNTX0dMWVBI ICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBW RVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3Ig PSAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmICFyb3ctPmNvbnRpbnVlZF9wCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVIKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRf b25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19W RVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hU X0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5 b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBj dXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0gIT0gMQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaCAtIHJvdy0+Z2x5cGhz W1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3ggPj0gcm93LT5waXhlbF93aWR0aCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKHp2X3ApCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19W RVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNf UkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxh dm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2 b3IgPT0gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JF VkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgY3Vyc29yX3R5cGUgPSBNQ19SSUdIVF9GUklO R0VfQklUTUFQOworICAgICAgd2QgPSAxOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJv dywgZ2x5cGgsIHJlbGF0aXZlX3gsIG9wb2ludF9meCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAg ICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5k LCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICBhY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCBk cmF3X3AsIGNhY2hlX3R5cGUpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tICovCisvKiAgICAgICAgICAgICAgIEZJTExfQ09MVU1OOiAgQ0hBUl9HTFlQSCB8IEdM WVBITEVTU19HTFlQSCAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAq LworICAgIGNhc2UgRklMTF9DT0xVTU46CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5 cGhfZmxhdm9yID0gKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRb YXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICYmIGZjX3ggPj0gcm93LT5waXhlbF93aWR0 aCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAg ICAgOiAoenZfcCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAg ICAgICAgICAgICAgOiAoIU5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAg ICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX3ZlcnRp Y2FsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeSA9PSB5CisgICAg ICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3Zwb3MgPT0gdnBvcykKKyAgICAgICAgICAgICAg ICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSDsKKyAg ICAgIHdkID0gMTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxh dGl2ZV94LCBmY19meCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBo LCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAg ICAgICAgICAgICAgICBhY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCBkcmF3X3AsIGNhY2hlX3R5cGUp OworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgIH0KKyAg fQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgIEVO RDogIENIQVJfR0xZUEggfCBHTFlQSExFU1NfR0xZUEggICAgICAgICAgICAgICAgICAgK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KKyAgICAgICAgICAgICAgICAgICAgICAgICA/ IGdseXBoLT5mYWNlX2lkCisgICAgICAgICAgICAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0Vf SUQ7CisgICAgICAgICAgc3RydWN0IG1jX1JHQiBiYWNrZ3JvdW5kOworICAgICAgICAgIG1jX3Nl dF9sc2xfYmcgKHcsIHRlbXBfZmFjZV9pZCwgJmJhY2tncm91bmQpOworICAgICAgICAgIG1jX2hl bHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3Ms IHZwb3MsCisgICAgICAgICAgICAgICAgICAgICB4X2xpbWl0IC0gcmVsYXRpdmVfeCwgaCwgY3Vy c29yX3R5cGUsIHhfbGltaXQgLSByZWxhdGl2ZV94LAorICAgICAgICAgICAgICAgICAgICAgZm9y ZWdyb3VuZCwgYmFja2dyb3VuZCwgYWN0aXZlX3AsIE1DX0dMWVBITEVTUywgZHJhd19wLAorICAg ICAgICAgICAgICAgICAgICAgY2FjaGVfdHlwZSk7CisgICAgICAgIH0KKyAgICAgIGJyZWFrOwor ICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAg ICAgIFZFUlRJQ0FMX1JVTEVSOiAgU1RSRVRDSF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICov CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIFZFUlRJQ0FMX1JVTEVSOgorICAg IHsKKyAgICAgIGlmIChyb3ctPmZpbGxfbGluZV9wCisgICAgICAgICAgJiYgZ2x5cGggLSByb3ct PmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiBv cG9pbnRfeCA+IHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAgICAgIHRlbXBf ZmFjZV9pZCA9IGdseXBoLT5mYWNlX2lkOworICAgICAgICBlbHNlIGlmICghcm93LT5maWxsX2xp bmVfcAorICAgICAgICAgICAgICAgICAmJiBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0g PT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeCA+IHJl bGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgdGVtcF9mYWNlX2lkID0g REVGQVVMVF9GQUNFX0lEOworICAgICAgc3RydWN0IG1jX1JHQiBiYWNrZ3JvdW5kOworICAgICAg bWNfc2V0X2xzbF9iZyAodywgdGVtcF9mYWNlX2lkLCAmYmFja2dyb3VuZCk7CisgICAgICBlbnVt IG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNI CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdl X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPmNvbnRp bnVlZF9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50 cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29u X3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVW RVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IChjdXJzb3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0gIT0gMQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVk X29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNf UkVWRVJTRURfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IE1DX0dMWVBITEVTUzsKKyAgICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxf QkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VE X1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBN Q19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S0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBF TkQ6ICBTVFJFVENIX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLSAqLworCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgQkVHSU46ICBJTUFHRV9HTFlQSCAgICAgICAgICAgICAgICAg ICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgIGVsc2UgaWYgKGdseXBo LT50eXBlID09IElNQUdFX0dMWVBIKQorICB7CisgICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAg ZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiXG4gJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJk ICVjICUzZCAweCUwNnggJTRkICUxLjFkJTEuMWQgJTVkICU0ZCAgJTNkICAlM2QgJXMgJWNcbiIs CisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ct PnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJl bGF0aXZlX3gsCisgICAgICAgICdJJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAg IChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNU UklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgOiAo TklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAg ICA6ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAodW5zaWdu ZWQgaW50KSBnbHlwaC0+dS5pbWdfaWQsCisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAg ICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVf cCwKKyAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgZ2x5cGgtPnZwb3Ms IGdseXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7CisgIHN3aXRjaCAoYWN0 aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAg ICAgICAgICAgICAgTVVMVElQTEVfQ1VSU09SUzogIElNQUdFX0dMWVBIICAgICAgICAgICAgICAg ICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIE1VTFRJUExFX0NV UlNPUlM6CisgICAgeworICAgICAgY3Vyc29yX3R5cGUgPSBNQ19IT0xMT1dfQk9YOworICAgICAg bWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwg aHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jf d2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgIGFjdGl2ZV9w LCBNQ19HTFlQSCwgZHJhd19wLCBjYWNoZV90eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8q IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgSE9SSVpP TlRBTF9SVUxFUjogIElNQUdFX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEhPUklaT05UQUxfUlVMRVI6CisgICAgeworICAg ICAgY3Vyc29yX3R5cGUgPSBNQ19IT0xMT1dfQk9YOworICAgICAgaWYgKCFyZWFsX2Zha2VfY3Vy c29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2 ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1 cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAg ICAgICAgICAgICAgYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGNhY2hlX3R5cGUpOworICAg ICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAg ICAgICAgICAgICAgICAgIFZFUlRJQ0FM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AgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICAg IlxuICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4IiwKKyAgICAgICAg ICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgKChyb3ctPnVzZWRb YXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgICAgcmVsYXRp dmVfeCwKKyAgICAgICAgICAnKycsCisgICAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAg ICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgID8gJ0InCisgICAgICAgICAg IDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgID8gJ1MnCisgICAgICAg ICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICAgID8gJzAnCisg ICAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwK KyAgICAgICAgICAodW5zaWduZWQgaW50KSBnbHlwaC0+dS5jbXAuaWQpOworICAgICAgICBmcHJp bnRmIChzdGRlcnIsICIgJTRkICUxLjFkJTEuMWQiLAorICAgICAgICAgIGdseXBoLT5mYWNlX2lk LAorICAgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgICAgZ2x5cGgtPnJp Z2h0X2JveF9saW5lX3ApOworICAgICAgaWYgKGdseXBoLT51LmNtcC5hdXRvbWF0aWMpCisgICAg ICAgIGZwcmludGYgKHN0ZGVyciwgIiAlNWQgJTRkICAlM2QgICUzZCAlcyAuIFslZC0lZF1cbiIs CisgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBv cywgZ2x5cGgtPnZwb3MsIGdseXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICAgICAg ICAgICAgICAgICAgZ2x5cGgtPnNsaWNlLmNtcC5mcm9tLCBnbHlwaC0+c2xpY2UuY21wLnRvKTsK KyAgICAgICAgZWxzZQorICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIlxuIik7CisgICAgICB9 CisgIHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLwor LyogICAgICAgICAgICAgICAgICAgICAgIE1VTFRJUExFX0NVUlNPUlM6ICBDT01QT1NJVEVfR0xZ UEggICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBj YXNlIE1VTFRJUExFX0NVUlNPUlM6CisgICAgeworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgs IHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAg ICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJh Y2tncm91bmQsCisgICAgICAgICAgICAgICAgIGFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLCBj YWNoZV90eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAq LworLyogICAgICAgICAgICAgICAgICAgICAgIEhPUklaT05UQUxfUlVMRVI6ICBDT01QT1NJVEVf R0xZUEggICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAg ICBjYXNlIEhPUklaT05UQUxfUlVMRVI6CisgICAgeworICAgICAgaWYgKHJlbGF0aXZlX3ggPD0g eF9saW1pdAorICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hl bHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3Ms IHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lk dGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgICAgYWN0aXZlX3As IE1DX0dMWVBILCBkcmF3X3AsIGNhY2hlX3R5cGUpOworICAgICAgaWYgKGdseXBoIC0gcm93LT5n bHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYgcmVs YXRpdmVfeCA8PSB4X2xpbWl0KQorICAgICAgICB7CisgICAgICAgICAgcmVsYXRpdmVfeCArPSBn bHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgd2hpbGUgKHJlbGF0aXZlX3ggPD0geF9saW1p dCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJv dywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAg ICAgICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3Vu ZCwgYmFja2dyb3VuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVfcCwgTUNfR0xZ UEhMRVNTLCBkcmF3X3AsIGNhY2hlX3R5cGUpOworICAgICAgICAgICAgICByZWxhdGl2ZV94ICs9 IGZyYW1lX2NoYXJfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGJyZWFr OworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAg ICAgICAgVkVSVElDQUxfUlVMRVI6ICBDT01QT1NJVEVfR0xZUEggICAgICAgICAgICAgICAgICAg ICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIFZFUlRJQ0FMX1JVTEVSOgor ICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChjdXJzb3JfYXRfZnJp bmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPmNvbnRp bnVlZF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJ Q0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog KGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgIXJvdy0+Y29udGludWVkX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9SSUdI VF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2Jl eW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg cm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3ctPnVzZWRb VEVYVF9BUkVBXSAhPSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSBy b3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBvcG9pbnRfeCA+PSByb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiAoenZfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog TUNfR0xZUEg7CisgICAgICBpZiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdI VF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNB TF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElD QUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNB TF9CQVIKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxf QkFSKQorICAgICAgICBjdXJzb3JfdHlwZSA9IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA7CisgICAg ICB3ZCA9IDE7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRp dmVfeCwgb3BvaW50X2Z4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2Qs IGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisg ICAgICAgICAgICAgICAgIGFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgY2FjaGVfdHlw ZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAg ICAgICAgICAgICAgICAgICAgICAgICBGSUxMX0NPTFVNTjogIENPTVBPU0lURV9HTFlQSCAgICAg ICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBG SUxMX0NPTFVNTjoKKyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAo Z2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAg ICAgICAgICAgICAgICAgICAgICAmJiBmY194ID4gcmVsYXRpdmVfeCkKKyAgICAgICAgICAgICAg ICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgOiAoenZfcCkKKyAgICAg ICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgOiAoIU5J TFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQ IChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAg ICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeSA9PSB5CisgICAgICAgICAgICAgICAgICAgICAg JiYgb3BvaW50X3Zwb3MgPT0gdnBvcykKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhM RVNTCisgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIHdkID0gMTsKKyAgICAg IG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmY19meCwgeSwg ZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vy c29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgIC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U1ZCAlNGMgJTZkICVjICUzZCAweCUwNXggJTRkICUx LjFkJTEuMWQgJTVkICU0ZCAgJTNkICAlM2QgJXMgJWNcbiIsCisgICAgICAgIGdseXBoIC0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAw IDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdY JywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2Jq ZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3Qp CisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgOiAnLScpKSwKKyAgICAgICAgZ2x5cGgt PnBpeGVsX3dpZHRoLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxl ZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAg IGdseXBoLT51Lnh3aWRnZXQsCisgICAgICAgIGdseXBoLT54LCBnbHlwaC0+eSwgZ2x5cGgtPmhw b3MsIGdseXBoLT52cG9zLCBnbHlwaC0+enZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAnLicp OworI2VuZGlmCisgIHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTOiAgWFdJ REdFVF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0g Ki8KKyAgICBjYXNlIE1VTFRJUExFX0NVUlNPUlM6CisgICAgeworICAgICAgbWNfaGVscGVyICh3 LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywK KyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVn cm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgIGFjdGl2ZV9wLCBNQ19HTFlQSCwg ZHJhd19wLCBjYWNoZV90eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICBIT1JJWk9OVEFMX1JVTEVSOiAg WFdJREdFVF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KKyAgICBjYXNlIEhPUklaT05UQUxfUlVMRVI6CisgICAgeworICAgICAgaWYgKHJlbGF0 aXZlX3ggPD0geF9saW1pdAorICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAg ICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwg ZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBj dXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgICAg YWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGNhY2hlX3R5cGUpOworICAgICAgaWYgKGdseXBo IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAg ICAgJiYgcmVsYXRpdmVfeCA8PSB4X2xpbWl0KQorICAgICAgICB7CisgICAgICAgICAgcmVsYXRp dmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgd2hpbGUgKHJlbGF0aXZlX3gg PD0geF9saW1pdCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbWNfaGVscGVyICh3LCBt YXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAg ICAgICAgICAgICAgICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwg Zm9yZWdyb3VuZCwgYmFja2dyb3VuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVf cCwgTUNfR0xZUEhMRVNTLCBkcmF3X3AsIGNhY2hlX3R5cGUpOworICAgICAgICAgICAgICByZWxh dGl2ZV94ICs9IGZyYW1lX2NoYXJfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAg ICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAg ICAgICAgICAgICAgICAgIFZFUlRJQ0FMX1JVTEVSOiAgWFdJREdFVF9HTFlQSCAgICAgICAgICAg ICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIFZFUlRJQ0FM X1JVTEVSOgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChjdXJz b3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBy b3ctPmNvbnRpbnVlZF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgIXJvdy0+Y29udGludWVkX3AKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdo dF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FM X0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAo Y3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJp bmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9y b3ctPnVzZWRbVEVYVF9BUkVBXSAhPSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9B UkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBvcG9pbnRfeCA+PSByb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiAoenZfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogTUNfR0xZUEg7CisgICAgICBpZiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FM X0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNF RF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0g TUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBN Q19WRVJUSUNBTF9CQVIKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURf VkVSVElDQUxfQkFSKQorICAgICAgICBjdXJzb3JfdHlwZSA9IE1DX1JJR0hUX0ZSSU5HRV9CSVRN QVA7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwg b3BvaW50X2Z4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1 cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAg ICAgICAgICAgIGFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgY2FjaGVfdHlwZSk7Cisg ICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAg ICAgICAgICAgICAgICAgICAgRklMTF9DT0xVTU46ICBYV0lER0VUX0dMWVBIICAgICAgICAgICAg ICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBGSUxMX0NP TFVNTjoKKyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoZ2x5cGgg LSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAg ICAgICAgICAgICAgICAmJiBmY194ID4gcmVsYXRpdmVfeCkKKyAgICAgICAgICAgICAgICAgICAg ID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgOiAoenZfcCkKKyAgICAgICAgICAg ICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgOiAoIU5JTFAgKEJW QVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAg ICAgICAgICAgICAmJiBvcG9pbnRfeSA9PSB5CisgICAgICAgICAgICAgICAgICAgICAgJiYgb3Bv aW50X3Zwb3MgPT0gdnBvcykKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisg ICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4 LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmY19meCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAg ICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5k LCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICBhY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCBk cmF3X3AsIGNhY2hlX3R5cGUpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tICovCisgIH0KKyAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBFTkQ6ICBYV0lER0VUX0dMWVBIICAgICAgICAgICAgICAg ICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworfQorCit2b2lkCittY19k cmF3X3JvdyAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBz dHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgc3RydWN0IGdseXBoICpzdGFydCwg aW50IHgsIGludCBocG9zX2xlbmd0aCwgaW50IHZwb3MsCisgICAgICAgICAgICAgaW50IGJvdHRv bV92cG9zLCBib29sIGFjdGl2ZV9wLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICpjdXJzb3JfbWF0cml4 LAorICAgICAgICAgICAgIGludCBmY194LCBzdHJ1Y3QgbWNfUkdCIGNoX2ZvcmVncm91bmQsIHN0 cnVjdCBtY19SR0IgZmNfZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICBib29sIGRyYXdfcCkKK3sK KyAgLy8gIGNsb2NrX3QgY2xvY2tfc3RhcnQgPSBjbG9jaygpOworICAvKiBOVCBFbWFjcyBjcmFz aGVzIG9uIHN0YXJ0dXAgd2l0aG91dCBhIGBCVUZGRVJQJyBjaGVjayBpbiBgdXBkYXRlX3dpbmRv dycuICovCisgIGlmICghQlVGRkVSUCAody0+Y29udGVudHMpKQorICAgIHJldHVybjsKKyAgaWYg KE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAmJiBO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgJiYg TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpCisgICAgcmV0 dXJuOworICBpZiAodnBvcyA9PSBib3R0b21fdnBvcykKKyAgICByZXR1cm47CisgIGlmICghcm93 LT51c2VkW1RFWFRfQVJFQV0pCisgICAgcmV0dXJuOworICBpbnQgaHBvc19zdGFydCA9IHN0YXJ0 IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgaWYgKHRyYWNlX3JlZGlzcGxheV9wKQorICAg IGZwcmludGYgKHN0ZGVyciwgIm1jX2RyYXdfcm93ICglcyk6ICB2cG9zICglZCkgfCBocG9zICgl ZCkgfCBsZW4gKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgIG1jX3dpbmRvdyAodyksIHZw b3MsIGhwb3Nfc3RhcnQsIGhwb3NfbGVuZ3RoKTsKKyAgTGlzcF9PYmplY3Qgd2luZG93OworICBY U0VUV0lORE9XICh3aW5kb3csIHcpOworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZy YW1lKTsKKyAgTGlzcF9PYmplY3QgYnVmID0gdy0+Y29udGVudHM7CisgIENIRUNLX0JVRkZFUiAo YnVmKTsKKyAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKGJ1Zik7CisgIGludCBvcG9pbnRf ZngsIG9wb2ludF9meSwgb3BvaW50X3dkLCBvcG9pbnRfaDsKKyAgaW50IHRleHRfYXJlYV93aWR0 aCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgIGludCBoZWFkZXJfbGluZV9m b3JtYXQgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgc3RydWN0IGdseXBoX3Jv dyAqY3Vyc29yX3JvdyA9ICh3LT5jdXJzb3IudnBvcyAhPSAtMSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gTUFUUklYX1JPVyAoY3Vyc29yX21hdHJpeCwgdy0+Y3Vyc29yLnZw b3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgIHN0cnVjdCBn bHlwaCAqY3Vyc29yX2dseXBoID0gKHctPmN1cnNvci52cG9zICE9IC0xKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gbWNfZ2V0X2N1cnNvcl9nbHlwaCAodywgY3Vyc29yX21hdHJp eCwgY3Vyc29yX3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgIGJvb2wgY3Vyc29yX2F0X2ZyaW5nZV9wID0g KGN1cnNvcl9nbHlwaCA9PSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1 cnNvcl9yb3cgIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJz b3IuaHBvcyA9PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVfcAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA9PSB0ZXh0X2FyZWFfd2lk dGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gY3Vyc29y X3Jvdy0+cGl4ZWxfd2lkdGgpOworICBib29sIGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AgPSAoY3Vy c29yX2dseXBoID09IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1 cnNvcl9yb3cgIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+ Y3Vyc29yLmhwb3MgPT0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiAhY3Vyc29yX3Jvdy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xp bmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+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qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICBS RVBMQUNFIFRIRSBSRUFMIENVUlNPUgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisgIGVudW0g ZmFjZV9pZCBiZ19mYWNlX2lkID0gKGN1cnNvcl9nbHlwaCAhPSBOVUxMKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gY3Vyc29yX2dseXBoLT5mYWNlX2lkCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgIHN0cnVjdCBtY19SR0IgY3Vyc29yX2Jn OworICBtY19zZXRfbHNsX2JnICh3LCBiZ19mYWNlX2lkLCAmY3Vyc29yX2JnKTsKKyAgLyogRklY TUU6ICBQdXQgaW4gc29tZSBjb2RlIHRvIGRlZmF1bHQgdG8gTUNfSE9MTE9XX0JPWCBpZiB0aGUg dXNlciBoYXMKKyAgdW53aXR0aW5nbHkgY29tZSB1cCB3aXRoIHNvbWUgdW5hY2NlcHRhYmxlIGZv cm0gb2YgdW5yZWNvZ25pemVkIGN1cnNvciB0eXBlLiAqLworICBMaXNwX09iamVjdCBsaXNwX3R5 cGUgPSBCVkFSIChiLCBtY19yZWFsX2Zha2VfY3Vyc29yKTsKKyAgZW51bSB0eXBlX29mX2N1cnNv ciBjdXJzb3JfdHlwZSA9IChDT05TUCAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKFhDQVIgKGxpc3Bf dHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBtY19saXNw X3RvX2N1cnNvcl90eXBlIChsaXNwX3R5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hlIGxldHRlciBhdCBwb2lu dCBnZXRzIHdyaXR0ZW4gdHdpY2UgYW5kIHdpbGwgYmUKKyAganVzdCBhIGxpdHRsZSB0aGlja2Vy IHRoYW4gYXMgd291bGQgbm9ybWFsbHkgYmUgdGhlIGNhc2UuICovCisgIGJvb2wgZmlsbF9jb2x1 bW5fdHJ1bXBzX3AgPSAoIU5JTFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5jdXJzb3IueCA9PSBmY194CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIWN1 cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFjdXJz b3JfYmV5b25kX2ZyaW5nZV9wKTsKKyAgLyogRklYTUU6ICBEZXZpc2UgYSBzeXN0ZW0gc28gdGhh dCB0aGlzIG9ubHkgaGFwcGVucyBvbmNlIHBlciByb3cgd2hlbgorICBgaHBvc19sZW5ndGhgIGlz IGxlc3MgdGhhbiB0aGUgZW50aXJlIHJvdy4gKi8KKyAgaWYgKHZwb3MgPT0gdy0+Y3Vyc29yLnZw b3MKKyAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFp cnMpKQorICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaG9y aXpvbnRhbF9ydWxlcikpKQorICAgIHsKKyAgICAgIC8qIGZyaW5nZSBiaXRtYXBzIHVzZSBmYWNl X2lkIHRvIHNldCB0aGUgZm9yZWdyb3VuZCBjb2xvci4gIFRoZSBvdmVybGF5LWFycm93CisgICAg ICBpcyBwcmVzZW50bHkgdGhlIG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ciBn bHlwaF9mbGF2b3IgPSBNQ19IT0xMT1dfUkVDVEFOR0xFOworICAgICAgbWNfaGVscGVyICh3LCBt YXRyaXgsIHJvdywgY3Vyc29yX2dseXBoLCB3LT5jdXJzb3IueCwgLTEsIHctPmN1cnNvci55LCAt MSwKKyAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCAtMSwg LTEsIE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAsIC0xLAorICAgICAgICAgICAgICAgICBjdXJzb3Jf ZmcsIGN1cnNvcl9iZywgYWN0aXZlX3AsIGdseXBoX2ZsYXZvciwgZHJhd19wLCBDSF9DQUNIRSk7 CisgICAgfQorICAvKiBDdXJzb3IgaXMgYmV5b25kIHRoZSByaWdodCBmcmluZ2U7IGUuZy4sIHdo ZW4gcmlnaHQgaG9yaXpvbnRhbCBzY3JvbGxpbmcuICovCisgIGVsc2UgaWYgKGN1cnNvcl9iZXlv bmRfZnJpbmdlX3AKKyAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAg ICAgICAmJiB3LT5jdXJzb3IuaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICYmIChocG9z X3N0YXJ0ICsgaHBvc19sZW5ndGgpID09IHJvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAg ICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAg ICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF9ob3Jpem9u dGFsX3J1bGVyKSkpCisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0g TUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVzsKKyAgICAgIG1jX2hlbHBl ciAodywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwg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Y3Vyc29yLngsICZvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJm9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCAm b3BvaW50X2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQ19CQVIsIDEsICZvcG9p bnRfd2QpOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgY3Vyc29yX2dseXBoLCB3 LT5jdXJzb3IueCwgb3BvaW50X2Z4LCB3LT5jdXJzb3IueSwKKyAgICAgICAgICAgICAgICAgb3Bv aW50X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MsIG9wb2ludF93ZCwgb3BvaW50 X2gsCisgICAgICAgICAgICAgICAgIE1DX0JBUiwgMSwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsIGFj dGl2ZV9wLCBNQ19HTFlQSExFU1MsCisgICAgICAgICAgICAgICAgIGRyYXdfcCwgTklMUCAoQlZB UiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICA/IENIX0NBQ0hFCisgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19DQUNIRSk7Cisg ICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngs ICZvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg Jm9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQ19IQkFSLCAxLCAmb3BvaW50X3dkKTsKKyAg ICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngs IG9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAgICAgICAgIG9wb2ludF9meSwgdy0+ Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9oLAorICAgICAg ICAgICAgICAgICBNQ19IQkFSLCAxLCBjdXJzb3JfZmcsIGN1cnNvcl9iZywgYWN0aXZlX3AsIE1D X0dMWVBILCBkcmF3X3AsCisgICAgICAgICAgICAgICAgIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAg ICAgICAgICAgICAgOiBNQ19DQUNIRSk7CisgICAgfQorICBlbHNlIGlmICghY3Vyc29yX2F0X2Zy aW5nZV9wCisgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICYm IHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPj0g aHBvc19zdGFydAorICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA8IGhwb3Nfc3RhcnQgKyBo cG9zX2xlbmd0aAorICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPnR5cGUgIT0gU1RSRVRDSF9H TFlQSCkKKyAgICB7CisgICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJv dywgdy0+Y3Vyc29yLngsICZvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJm9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9z LCAmb3BvaW50X2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwg Y3Vyc29yX3dpZHRoLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCBy b3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisg ICAgICAgICAgICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9z LCBvcG9pbnRfd2QsIG9wb2ludF9oLAorICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vy c29yX3dpZHRoLCBjdXJzb3JfZmcsIGN1cnNvcl9iZywgYWN0aXZlX3AsCisgICAgICAgICAgICAg ICAgIE1DX0dMWVBILCBkcmF3X3AsIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg bWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19DQUNIRSk7CisgICAgfQor ICBlbHNlIGlmICghY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICYmIGN1cnNvcl9nbHlw aCAhPSBOVUxMCisgICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAg ICAgJiYgdy0+Y3Vyc29yLmhwb3MgPj0gaHBvc19zdGFydAorICAgICAgICAgICAmJiB3LT5jdXJz b3IuaHBvcyA8IGhwb3Nfc3RhcnQgKyBocG9zX2xlbmd0aAorICAgICAgICAgICAmJiBjdXJzb3Jf Z2x5cGgtPnR5cGUgPT0gU1RSRVRDSF9HTFlQSCkKKyAgICB7CisgICAgICAvKiBJZiBhIHVzZXIg aGFzIHNldCBgeC1zdHJldGNoLWN1cnNvcicgdG8gYSBub24tbmlsIHZhbHVlLCBoZS9zaGUgY2hv c2UgdG8KKyAgICAgIGhhdmUgYSBjdXJzb3IgdGhhdCBzcGFucyB0aGUgZW50aXJlIGxlbmd0aCBv ZiB0aGUgU1RSRVRDSF9HTFlQSC4gKi8KKyAgICAgIGlmICgheF9zdHJldGNoX2N1cnNvcl9wKQor ICAgICAgICB7CisgICAgICAgICAgLyogVGhlIE1DX0hCQVIgc2hhbGwgaGF2ZSBhIGBjdXJzb3Jf d2lkdGhgIG9mIDEuICovCisgICAgICAgICAgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeSAodywgbWF0 cml4LCByb3csIHctPmN1cnNvci54LCAmb3BvaW50X2Z4LAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHctPmN1cnNvci55LCAmb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9o LCBNQ19IQkFSLCAxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZvcG9pbnRf d2QpOworICAgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwg dy0+Y3Vyc29yLngsIG9wb2ludF9meCwKKyAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci55 LCBvcG9pbnRfZnksIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywKKyAgICAgICAgICAg ICAgICAgICAgIG9wb2ludF93ZCwgb3BvaW50X2gsIE1DX0hCQVIsIDEsIGN1cnNvcl9mZywgY3Vy c29yX2JnLAorICAgICAgICAgICAgICAgICAgICAgYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3As CisgICAgICAgICAgICAgICAgICAgICBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IG1jX2NvbmYpKQorICAgICAgICAgICAgICAgICAgICAgPyBDSF9DQUNIRQorICAgICAgICAgICAg ICAgICAgICAgOiBNQ19DQUNIRSk7CisgICAgICAgIH0KKyAgICAgIG1jX2dldF9jdXJzb3JfZ2Vv bWV0cnkgKHcsIG1hdHJpeCwgcm93LCB3LT5jdXJzb3IueCwgJm9wb2ludF9meCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci55LCAmb3BvaW50X2Z5LCB3LT5jdXJzb3Iu aHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci52cG9zLCAmb3Bv aW50X2gsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29y X3dpZHRoLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGN1 cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAg ICAgICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCBvcG9p bnRfd2QsIG9wb2ludF9oLAorICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dp ZHRoLCBjdXJzb3JfZmcsIGN1cnNvcl9iZywgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgIE1D X0dMWVBILCBkcmF3X3AsIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29u ZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19DQUNIRSk7CisgICAgfQorLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgIERSQVcgQU5EIFJF Q09SRCBGQUtFIENVUlNPUlMKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICBpZiAoaHBvc19s ZW5ndGggPT0gMSkKKyAgICB7CisgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgbWNfY29uZikpKQorICAgICAgICB7CisgICAgICAgICAgLyogVGhlIHNwYWNlIGFw cGVuZGVkIHRvIGEgcm93IGVuZGluZyB3aXRoIGEgbmV3IGxpbmUKKyAgICAgICAgICBkb2VzIG5v dCBoYXZlIGEgYGdseXBoLT5jaGFycG9zYCAoLTEsIDApIHRoYXQgd2UgY2FuCisgICAgICAgICAg dXNlIGZvciB0aGlzIHBhcnRpY3VsYXIgYXBwbGljYXRpb24uICBXaGVuIHRoZXJlIGlzIGEKKyAg ICAgICAgICBgYnVmZmVyLWRpc3BsYXktdGFibGUnIGVudHJ5IHRoYXQgYXNzaWducyBhIHZpc2li bGUKKyAgICAgICAgICBnbHlwaCB0byBhIG5ldyBsaW5lLCB0aGVyZSBpcyBubyBwcm9ibGVtIGJl Y2F1c2UgdGhhdAorICAgICAgICAgIGdseXBoIGhhcyBhIGBnbHlwaC0+Y2hhcnBvcycgdGhhdCB3 ZSBjYW4gdXNlLiAgV2hlbgorICAgICAgICAgIG5vIHZpc2libGUgRU9MIGdseXBoIGV4aXN0cywg d2UgdXNlIHRoZSBmb2xsb3dpbmcKKyAgICAgICAgICB0ZXN0OiAgdGhlIGFwcGVuZGVkIHNwYWNl IGhhcyBhIHBvc2l0aW9uIHRoYXQgaXMgb25lCisgICAgICAgICAgbGVzcyB0aGFuIHRoZSBlbmQg b2YgdGhlIG1hdHJpeCByb3cuICovCisgICAgICAgICAgaW50IGhwb3MgPSBzdGFydCAtIHJvdy0+ Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICAgICAgc3RydWN0IGdseXBoICpwcmV2aW91c19nbHlw aCA9ICgwIDw9IGhwb3MgLSAxICYmIGhwb3MgLSAxIDwgcm93LT51c2VkW1RFWFRfQVJFQV0pCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gcm93LT5nbHlwaHNbVEVY VF9BUkVBXSArIGhwb3MgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogTlVMTDsKKyAgICAgICAgICBib29sIHNraXBfcCA9IChwcmV2aW91c19nbHlwaCAhPSBO VUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcHJldmlvdXNfZ2x5cGgtPmNoYXJwb3Mg PT0gTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSAtIDEpOworICAgICAgICAgIGludCBwb3Np bnQgPSAoc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFtURVhUX0FS RUFdIC0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XX0VORF9DSEFSUE9T IChyb3cpIC0gMQorICAgICAgICAgICAgICAgICAgICAgICA6IHN0YXJ0LT5jaGFycG9zOworICAg ICAgICAgIExpc3BfT2JqZWN0IHNwZWNzID0gbWNfYXNzb2MgKG1ha2VfZml4bnVtIChwb3NpbnQp LCBCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKTsKKyAgICAgICAgICBpZiAo KChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgfHwg aGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAgICYmICFOSUxQIChzcGVjcykK KyAgICAgICAgICAgICAgJiYgc3RhcnQtPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisg ICAgICAgICAgICAgICYmICFza2lwX3AKKyAgICAgICAgICAgICAgJiYgIXN0YXJ0LT56dl9wKQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICBMaXNwX09iamVjdCBsaXNwX3R5cGUgPSBtY19u dGggKDEsIHNwZWNzKTsKKyAgICAgICAgICAgICAgZW51bSB0eXBlX29mX2N1cnNvciBjdXJzb3Jf dHlwZSA9IChDT05TUCAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoWENBUiAobGlzcF90 eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog bWNfbGlzcF90b19jdXJzb3JfdHlwZSAobGlzcF90eXBlKTsKKyAgICAgICAgICAgICAgY3Vyc29y X3R5cGUgPSAoc3RhcnQtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBNQ19IT0xMT1dfQk9YCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBj dXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aCA9IChDT05TUCAobGlz cF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gWEZJWE5VTSAoWENB UiAoWENEUiAobGlzcF90eXBlKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IC0xOworICAgICAgICAgICAgICBMaXNwX09iamVjdCBtY19mb3JlZ3JvdW5kID0gbWNfbnRoICgy LCBzcGVjcyk7CisgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgZm9yZWdyb3VuZDsKKyAgICAg ICAgICAgICAgaWYgKFNUUklOR1AgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgIG1j X3h3X2NvbG9yX3ZhbHVlcyAodywgbWNfZm9yZWdyb3VuZCwgJmZvcmVncm91bmQpOworICAgICAg ICAgICAgICAgIGVsc2UgaWYgKFZFQ1RPUlAgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgICBkb3VibGUgcmVkX2ZnID0gWEZMT0FUX0RBVEEg KEFSRUYgKG1jX2ZvcmVncm91bmQsIDApKTsKKyAgICAgICAgICAgICAgICAgICAgZG91YmxlIGdy ZWVuX2ZnID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDEpKTsKKyAgICAgICAg ICAgICAgICAgICAgZG91YmxlIGJsdWVfZmcgPSBYRkxPQVRfREFUQSAoQVJFRiAobWNfZm9yZWdy b3VuZCwgMikpOworICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kLnJlZCA9IHJlZF9mZzsK KyAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZC5ncmVlbiA9IGdyZWVuX2ZnOworICAgICAg ICAgICAgICAgICAgICBmb3JlZ3JvdW5kLmJsdWUgPSBibHVlX2ZnOworICAgICAgICAgICAgICAg ICAgfQorICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoTklMUCAobWNfZm9yZWdyb3VuZCkpCisg ICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kLnJl ZCA9IGNoX2ZvcmVncm91bmQucmVkOworICAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQu Z3JlZW4gPSBjaF9mb3JlZ3JvdW5kLmdyZWVuOworICAgICAgICAgICAgICAgICAgICAgIGZvcmVn cm91bmQuYmx1ZSA9IGNoX2ZvcmVncm91bmQuYmx1ZTsKKyAgICAgICAgICAgICAgICAgICAgfQor ICAgICAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOwor ICAgICAgICAgICAgICBpbnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJF QSk7CisgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIHN0YXJ0LCBURVhU X0FSRUEsIHgsIHhfbGltaXQsIHJvdy0+eSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzdGFy dCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sIHZwb3MsIGN1cnNvcl90eXBlLAorICAgICAgICAg ICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgY3Vyc29yX21hdHJpeCwgZmNfeCwgZm9yZWdy b3VuZCwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgTVVMVElQTEVfQ1VSU09S UywgZHJhd19wLCBNQ19DQUNIRSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGlm ICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAg ICAgICAmJiBmY194IDw9IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICYmIGZjX3ggPj0gdy0+ bWMubG51bV9waXhlbF93aWR0aCkKKyAgICAgICAgeworICAgICAgICAgIGludCB4X2xpbWl0ID0g eCArIHN0YXJ0LT5waXhlbF93aWR0aDsKKyAgICAgICAgICBib29sIHJlYWxfZmFrZV9jdXJzb3Jf cCA9ICh3LT5jdXJzb3IueCA9PSBmY194CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgdy0+Y3Vyc29yLnkgPT0gc3RhcnQtPnkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBzdGFydCAtIHJvdy0+Z2x5cGhzW1RF WFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJz b3IudnBvcyA9PSB2cG9zKTsKKyAgICAgICAgICBpZiAoeCArIHN0YXJ0LT5waXhlbF93aWR0aCA8 PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgJiYgKChoZWFkZXJfbGluZV9mb3JtYXQg PiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0 ID09IDApCisgICAgICAgICAgICAgICYmICgoZmNfeCA+PSB4CisgICAgICAgICAgICAgICAgICAg JiYgZmNfeCA8IHggKyBzdGFydC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICB8fCBz dGFydCA9PSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAx KQorICAgICAgICAgICAgICAmJiBzdGFydC0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykK KyAgICAgICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgIG1jX2Vu Z2luZSAodywgbWF0cml4LCByb3csIHN0YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGltaXQsIHJvdy0+ eSwKKyAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFd LCB2cG9zLCBNQ19CQVIsIDEsCisgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgs IGZjX3gsIGZjX2ZvcmVncm91bmQsIGFjdGl2ZV9wLCBGSUxMX0NPTFVNTiwKKyAgICAgICAgICAg ICAgICAgICAgICAgZHJhd19wLCBGQ19DQUNIRSk7CisgICAgICAgIH0KKyAgICAgIGlmICghTklM UCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAm JiAhTklMUCAoQlZBUiAoYiwgY2hfaG9yaXpvbnRhbF9ydWxlcikpCisgICAgICAgICAgJiYgdnBv cyA9PSB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgeworICAgICAgICAgIGludCB4X2xpbWl0ID0g KHN0YXJ0ID09IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVzZWRbVEVYVF9BUkVBXSAt IDEpCisgICAgICAgICAgICAgICAgICAgICAgICA/IHRleHRfYXJlYV93aWR0aAorICAgICAgICAg ICAgICAgICAgICAgICAgOiB4ICsgc3RhcnQtPnBpeGVsX3dpZHRoOworICAgICAgICAgIC8qIFBy ZXNlcnZlIHN1cHBvcnQgZm9yIGRlZmF1bHQgYmVoYXZpb3Igc3VjaCB0aGF0IGEgdXNlciBtYXkK KyAgICAgICAgICBzcGVjaWZ5IHRoZSBoZWlnaHQgb2YgYW4gTUNfSEJBUiwgd2hpY2ggYmVnaW5z IGl0cyBqb3VybmV5CisgICAgICAgICAgYXMgdGhlIGBjdXJzb3Jfd2lkdGgnLiAgYG1jX2dldF9j dXJzb3JfZ2VvbWV0cnknIHJlYWRqdXN0cy4gKi8KKyAgICAgICAgICBtY19lbmdpbmUgKHcsIG1h dHJpeCwgcm93LCBzdGFydCwgVEVYVF9BUkVBLCB4LCB4X2xpbWl0LCByb3ctPnksCisgICAgICAg ICAgICAgICAgICAgICBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sIHZwb3MsIE1DX0hC QVIsIDEsCisgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBmY194LCBjaF9mb3Jl Z3JvdW5kLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgIEhPUklaT05UQUxfUlVMRVIs IGRyYXdfcCwgQ0hfQ0FDSEUpOworICAgICAgICB9CisgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhC VUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgJiYgIU5JTFAgKEJW QVIgKGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAmJiAhZmlsbF9jb2x1bW5fdHJ1 bXBzX3ApCisgICAgICAgIHsKKyAgICAgICAgICBjdXJzb3JfdHlwZSA9IChzdGFydC0+dHlwZSA9 PSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfSE9MTE9XX0JPWAor ICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19CQVI7CisgICAgICAgICAgaW50IHhfbGltaXQg PSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOworICAgICAgICAgIGJvb2wgcmVhbF9m YWtlX2N1cnNvcl9wID0gKHctPmN1cnNvci55ID09IHN0YXJ0LT55CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnZwb3MgPT0gdnBvcyk7CisgICAgICAg ICAgaWYgKCgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID4gMCkKKyAgICAgICAgICAg ICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAgICAmJiAoKHctPmN1 cnNvci54ID49IHgKKyAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA8IHggKyBzdGFy dC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICB8fCBzdGFydCA9PSByb3ctPmdseXBo c1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKQorICAgICAgICAgICAgICAm JiBzdGFydC0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAgICAgJiYg IXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCBy b3csIHN0YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGltaXQsIHJvdy0+eSwKKyAgICAgICAgICAgICAg ICAgICAgICAgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLCB2cG9zLCBjdXJzb3JfdHlw ZSwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZmNfeCwgY2hfZm9y ZWdyb3VuZCwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICAgIFZFUlRJQ0FMX1JVTEVS LCBkcmF3X3AsIENIX0NBQ0hFKTsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgICB7 CisgICAgICAgIGludCByZWxhdGl2ZV94ID0gMDsKKyAgICAgICAgZm9yIChpbnQgYXJlYSA9IExF RlRfTUFSR0lOX0FSRUE7IGFyZWEgPCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAgICAgICAgICB7Cisg ICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoID0gcm93LT5nbHlwaHNbYXJlYV07CisgICAg ICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoX2VuZCA9IGdseXBoICsgcm93LT51c2VkW2FyZWFd OworICAgICAgICAgICAgLyogR2x5cGggZm9yIGEgbGluZSBlbmQgaW4gdGV4dC4gKi8KKyAgICAg ICAgICAgIGlmIChhcmVhID09IFRFWFRfQVJFQSAmJiBnbHlwaCA9PSBnbHlwaF9lbmQgJiYgZ2x5 cGgtPmNoYXJwb3MgPiAwKQorICAgICAgICAgICAgICArK2dseXBoX2VuZDsKKyAgICAgICAgICAg IGZvciAoOyBnbHlwaCA8IGdseXBoX2VuZDsgKytnbHlwaCkKKyAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgIGlmICh2cG9zICE9IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICAgICAg ICAgICYmIGdseXBoICE9IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgJiYgZmNf eCA8IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPCByZWxh dGl2ZV94CisgICAgICAgICAgICAgICAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgbWNfY29uZikpKQorICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAg ICAgICAgaWYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkK KyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLyogVGhlIHNwYWNlIGFw cGVuZGVkIHRvIGEgcm93IGVuZGluZyB3aXRoIGEgbmV3IGxpbmUgZG9lcworICAgICAgICAgICAg ICAgICAgICBub3QgaGF2ZSBhIGBnbHlwaC0+Y2hhcnBvc2AgKC0xLCAwKSB0aGF0IHdlIGNhbiB1 c2UgZm9yIHRoaXMKKyAgICAgICAgICAgICAgICAgICAgcGFydGljdWxhciBhcHBsaWNhdGlvbi4g IFdoZW4gYSBgYnVmZmVyLWRpc3BsYXktdGFibGUnIGVudHJ5CisgICAgICAgICAgICAgICAgICAg IGFzc2lnbnMgYSB2aXNpYmxlIGdseXBoIHRvIGEgbmV3IGxpbmUsIHRoZXJlIGlzIG5vIHByb2Js ZW0KKyAgICAgICAgICAgICAgICAgICAgYmVjYXVzZSB0aGF0IGdseXBoIGhhcyBhIGBnbHlwaC0+ Y2hhcnBvcycgdGhhdCB3ZSBjYW4gdXNlLgorICAgICAgICAgICAgICAgICAgICBXaGVuIG5vIHZp c2libGUgRU9MIGdseXBoIGV4aXN0cywgd2UgdXNlIHRoZSBmb2xsb3dpbmcgdGVzdDoKKyAgICAg ICAgICAgICAgICAgICAgdGhlIGFwcGVuZGVkIHNwYWNlIGhhcyBhIHBvc2l0aW9uIHRoYXQgaXMg b25lIGxlc3MgdGhhbiB0aGUKKyAgICAgICAgICAgICAgICAgICAgZW5kIG9mIHRoZSBtYXRyaXgg cm93LiAqLworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5nbHlw aHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoICpwcmV2aW91 c19nbHlwaCA9ICgwIDw9IGhwb3MgLSAxICYmIGhwb3MgLSAxIDwgcm93LT51c2VkW1RFWFRfQVJF QV0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyBocG9zIC0gMQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOVUxMOworICAgICAgICAgICAgICAgICAg ICBib29sIHNraXBfcCA9IChwcmV2aW91c19nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHByZXZpb3VzX2dseXBoLT5jaGFycG9zID09IE1BVFJJWF9S T1dfRU5EX0NIQVJQT1MgKHJvdykgLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyB0cnVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogV2hlbiBh IGBidWZmZXItZGlzcGxheS10YWJsZScgZW50cnkgY29udGFpbnMKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBhIHZpc2libGUgdGFiIGNoYXJhY3RlciAoIsK7IiksIHRoZSBzdWJz ZXF1ZW50CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU1RSRVRDSF9HTFlQSCB3 aWxsIGhhdmUgdGhlIHNhbWUgZ2x5cGgtPmNoYXJwb3MKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBhcyB0aGUgYWZvcmVtZW50aW9uZWQgdmlzaWJsZSB0YWIgY2hhcmFjdGVyLiAq LworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKHByZXZpb3VzX2dseXBoICE9 IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBwcmV2aW91c19n bHlwaC0+Y2hhcnBvcyA9PSBnbHlwaC0+Y2hhcnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gdHJ1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog ZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIGludCBwb3NpbnQgPSAoZ2x5cGggLSByb3ctPmds eXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgLSAxCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGdseXBoLT5jaGFycG9zOworICAgICAgICAg ICAgICAgICAgICBMaXNwX09iamVjdCBzcGVjcyA9IG1jX2Fzc29jIChtYWtlX2ZpeG51bSAocG9z aW50KSwgQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSk7CisgICAgICAgICAg ICAgICAgICAgIGlmICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAg ICAgICAgICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAg ICAgICAgICAgICAgICAgICAmJiAhTklMUCAoc3BlY3MpCisgICAgICAgICAgICAgICAgICAgICAg ICAmJiBnbHlwaC0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAgICAg ICAgICAgICAgICYmICFza2lwX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICFnbHlwaC0+ enZfcCkKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBM aXNwX09iamVjdCBsaXNwX3R5cGUgPSBtY19udGggKDEsIHNwZWNzKTsKKyAgICAgICAgICAgICAg ICAgICAgICAgIGVudW0gdHlwZV9vZl9jdXJzb3IgY3Vyc29yX3R5cGUgPSAoQ09OU1AgKGxpc3Bf dHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBtY19saXNwX3RvX2N1cnNvcl90eXBlIChYQ0FSIChsaXNwX3R5cGUpKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog bWNfbGlzcF90b19jdXJzb3JfdHlwZSAobGlzcF90eXBlKTsKKyAgICAgICAgICAgICAgICAgICAg ICAgIGN1cnNvcl90eXBlID0gKGdseXBoLT50eXBlID09IElNQUdFX0dMWVBIKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0hPTExPV19CT1gKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBjdXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAg ICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGggPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBYRklYTlVNIChYQ0FSIChYQ0RS IChsaXNwX3R5cGUpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IC0xOworICAgICAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3QgbWNfZm9yZWdyb3Vu ZCA9IG1jX250aCAoMiwgc3BlY3MpOworICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1j X1JHQiBmb3JlZ3JvdW5kOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFNUUklOR1AgKG1j X2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICBtY194d19jb2xvcl92YWx1 ZXMgKHcsIG1jX2ZvcmVncm91bmQsICZmb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgZWxzZSBpZiAoVkVDVE9SUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG91YmxlIHJlZF9m ZyA9IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3JvdW5kLCAwKSk7CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBkb3VibGUgZ3JlZW5fZmcgPSBYRkxPQVRfREFUQSAoQVJFRiAobWNf Zm9yZWdyb3VuZCwgMSkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG91YmxlIGJs dWVfZmcgPSBYRkxPQVRfREFUQSAoQVJFRiAobWNfZm9yZWdyb3VuZCwgMikpOworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZC5yZWQgPSByZWRfZmc7CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kLmdyZWVuID0gZ3JlZW5fZmc7CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kLmJsdWUgPSBibHVlX2ZnOworICAgICAg ICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNl IGlmIChOSUxQIChtY19mb3JlZ3JvdW5kKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kLnJlZCA9IGNoX2ZvcmVn cm91bmQucmVkOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZC5ncmVl biA9IGNoX2ZvcmVncm91bmQuZ3JlZW47CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBm b3JlZ3JvdW5kLmJsdWUgPSBjaF9mb3JlZ3JvdW5kLmJsdWU7CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9X X1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCB4X2xpbWl0 ID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgICAgICAgICAg ICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4X2xpbWl0LCByb3ctPnksIGdseXBo IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgdnBvcywgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgY3Vyc29yX21hdHJpeCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmNfeCwgZm9yZWdyb3VuZCwgYWN0aXZl X3AsIE1VTFRJUExFX0NVUlNPUlMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGRyYXdfcCwgTUNfQ0FDSEUpOworICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgICAgICAgICAgICYmIGZjX3ggPD0gdGV4 dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICYmIGZjX3ggPj0gdy0+bWMubG51bV9w aXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaW50 IHhfbGltaXQgPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOworICAgICAgICAgICAg ICAgICAgICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9ICh3LT5jdXJzb3IueCA9PSBmY194Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNv ci55ID09IGdseXBoLT55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHctPmN1cnNvci5ocG9zID09IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVB XQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5j dXJzb3IudnBvcyA9PSB2cG9zKTsKKyAgICAgICAgICAgICAgICAgICAgaW50IGhwb3MgPSBnbHlw aCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICAgICAgICAgICAgICAgIGlmIChocG9z ID49IGhwb3Nfc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIGhwb3MgPCBocG9zX3N0 YXJ0ICsgaHBvc19sZW5ndGgKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIHJlbGF0aXZlX3gg KyBnbHlwaC0+cGl4ZWxfd2lkdGggPD0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAg ICAgICAgICAmJiAoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAg ICAgICAgICAgICAgICAgICAmJiAoKGdseXBoICE9IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgZmNfeCA+PSByZWxhdGl2ZV94CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIGZjX3ggPCByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChnbHlwaCA9PSBnbHlwaF9lbmQgLSAxCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGZjX3ggPj0gcmVsYXRpdmVfeCkpCisg ICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaC0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21f eSAodykKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisg ICAgICAgICAgICAgICAgICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIGFy ZWEsIHJlbGF0aXZlX3gsIHhfbGltaXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICByb3ctPnksIGhwb3MsIHZwb3MsIE1DX0JBUiwgMSwgY3Vyc29yX21hdHJpeCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGZjX3gsIGZjX2ZvcmVncm91bmQsIGFjdGl2ZV9wLCBG SUxMX0NPTFVNTiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdfcCwgRkNf Q0FDSEUpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICghTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAg ICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2hvcml6b250YWxfcnVsZXIpKQorICAgICAgICAg ICAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zKQorICAgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgICBpbnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGggKHcs IFRFWFRfQVJFQSk7CisgICAgICAgICAgICAgICAgICAgIGludCBocG9zID0gZ2x5cGggLSByb3ct PmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgICAgICAgICAgICAvKiBQcmVzZXJ2ZSBzdXBw b3J0IGZvciBkZWZhdWx0IGJlaGF2aW9yIHN1Y2ggdGhhdCBhIHVzZXIgbWF5CisgICAgICAgICAg ICAgICAgICAgIHNwZWNpZnkgdGhlIGhlaWdodCBvZiBhbiBNQ19IQkFSLCB3aGljaCBiZWdpbnMg aXRzIGpvdXJuZXkKKyAgICAgICAgICAgICAgICAgICAgYXMgdGhlIGBjdXJzb3Jfd2lkdGgnLiAg YG1jX2dldF9jdXJzb3JfZ2VvbWV0cnknIHJlYWRqdXN0cy4gKi8KKyAgICAgICAgICAgICAgICAg ICAgaWYgKGhwb3MgPj0gaHBvc19zdGFydAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgaHBv cyA8IGhwb3Nfc3RhcnQgKyBocG9zX2xlbmd0aCkKKyAgICAgICAgICAgICAgICAgICAgICBtY19l bmdpbmUgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgYXJlYSwgcmVsYXRpdmVfeCwgeF9saW1pdCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvdy0+eSwgaHBvcywgdnBvcywgTUNf SEJBUiwgMSwgY3Vyc29yX21hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGZjX3gsIGNoX2ZvcmVncm91bmQsIGFjdGl2ZV9wLCBIT1JJWk9OVEFMX1JVTEVSLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhd19wLCBDSF9DQUNIRSk7CisgICAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZB UiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAmJiAhZmlsbF9j b2x1bW5fdHJ1bXBzX3ApCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAg IGN1cnNvcl90eXBlID0gKGdseXBoLT50eXBlID09IElNQUdFX0dMWVBIKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUNfSE9MTE9XX0JPWAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogTUNfQkFSOworICAgICAgICAgICAgICAgICAgICBpbnQgeF9saW1p dCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAgICAgICAgICAgICAgICAg IGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKHctPmN1cnNvci55ID09IGdseXBoLT55CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci52 cG9zID09IHZwb3MpOworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGhwb3MgPj0gaHBv c19zdGFydAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA8IGhwb3Nfc3RhcnQgKyBo cG9zX2xlbmd0aAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKChoZWFkZXJfbGluZV9mb3Jt YXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGhlYWRl cl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKChnbHlwaCAh PSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNv ci54ID49IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vy c29yLnggPCByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHx8IChnbHlwaCA9PSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHJlbGF0aXZlX3gpKQorICAgICAgICAg ICAgICAgICAgICAgICAgJiYgZ2x5cGgtPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisg ICAgICAgICAgICAgICAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAg ICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxh dGl2ZV94LCB4X2xpbWl0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT55 LCBocG9zLCB2cG9zLCBjdXJzb3JfdHlwZSwgMSwgY3Vyc29yX21hdHJpeCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGZjX3gsIGNoX2ZvcmVncm91bmQsIGFjdGl2ZV9wLCBWRVJU SUNBTF9SVUxFUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdfcCwgQ0hf Q0FDSEUpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJlbGF0aXZlX3gg Kz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAg ICAgfQorICAvLyAgY2xvY2tfdCBjbG9ja19lbmQgPSBjbG9jaygpOworICAvLyAgZG91YmxlIGNw dV90aW1lX3VzZWQgPSAoKGRvdWJsZSkgKGNsb2NrX2VuZCAtIGNsb2NrX3N0YXJ0KSkgLyBDTE9D S1NfUEVSX1NFQzsKKyAgLy8gIGZwcmludGYgKHN0ZGVyciwgIm1jX2RyYXdfcm93ICglcyk6ICBU SU1FICglZilcbiIsIG1jX3dpbmRvdyAodyksIGNwdV90aW1lX3VzZWQpOworfQorCit2b2lkCitt Y19yZWRyYXdfaGVscGVyIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICpt YXRyaXgsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKKyAgICAgICAgICAgICAgICAgIGVudW0gdHlw ZV9vZl9jYWNoZSBjYWNoZV90eXBlLCBpbnQgc3RhcnRfaHBvcywgaW50IGVuZF9ocG9zKQorewor ICBpbnQgcm93X3Zwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgc3RydWN0 IG11bHRpcGxlX2N1cnNvcnNfY2FjaGUgZm9vX2VsdHM7CisgIHN3aXRjaCAoY2FjaGVfdHlwZSkK KyAgICB7CisgICAgICBjYXNlIE5PX0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAgYnJlYWs7 CisgICAgICAgIH0KKyAgICAgIGNhc2UgTUNfQ0FDSEU6CisgICAgICAgIHsKKyAgICAgICAgICBm b29fZWx0cy5jYWNoZXMgPSB3LT5tY19lbHRzLmNhY2hlczsKKyAgICAgICAgICBmb29fZWx0cy5h bGxvY2F0ZWQgPSB3LT5tY19lbHRzLmFsbG9jYXRlZDsKKyAgICAgICAgICBmb29fZWx0cy51c2Vk ID0gdy0+bWNfZWx0cy51c2VkOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBj YXNlIENIX0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAgZm9vX2VsdHMuY2FjaGVzID0gdy0+ Y2hfZWx0cy5jYWNoZXM7CisgICAgICAgICAgZm9vX2VsdHMuYWxsb2NhdGVkID0gdy0+Y2hfZWx0 cy5hbGxvY2F0ZWQ7CisgICAgICAgICAgZm9vX2VsdHMudXNlZCA9IHctPmNoX2VsdHMudXNlZDsK KyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgY2FzZSBGQ19DQUNIRToKKyAgICAg ICAgeworICAgICAgICAgIGZvb19lbHRzLmNhY2hlcyA9IHctPmZjX2VsdHMuY2FjaGVzOworICAg ICAgICAgIGZvb19lbHRzLmFsbG9jYXRlZCA9IHctPmZjX2VsdHMuYWxsb2NhdGVkOworICAgICAg ICAgIGZvb19lbHRzLnVzZWQgPSB3LT5mY19lbHRzLnVzZWQ7CisgICAgICAgICAgYnJlYWs7Cisg ICAgICAgIH0KKyAgICB9CisgIC8qIFNUUkVUQ0hfR0xZUEggbWF5IGNvbnRhaW4gbW9yZSB0aGFu IG9uZSBmYWtlIGN1cnNvciBhdCB0aGUgc2FtZSBIUE9TLiAqLworICBmb3IgKGludCBlbHQgPSAw OyBlbHQgPCBmb29fZWx0cy51c2VkOyArK2VsdCkKKyAgICB7CisgICAgICBpbnQgeCA9IGZvb19l bHRzLmNhY2hlc1tlbHRdLng7CisgICAgICBpbnQgZnggPSBmb29fZWx0cy5jYWNoZXNbZWx0XS5m eDsKKyAgICAgIGludCB5ID0gZm9vX2VsdHMuY2FjaGVzW2VsdF0ueTsKKyAgICAgIGludCB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MuY2FjaGVzW2VsdF0uYWN0aXZlX3A7CisgICAg ICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSBmb29fZWx0cy5jYWNoZXNbZWx0XS5nbHlw aF9mbGF2b3I7CisgICAgICBib29sIGVuYWJsZWRfcCA9IGZvb19lbHRzLmNhY2hlc1tlbHRdLmVu YWJsZWRfcDsKKyAgICAgIGlmICh2cG9zID09IHJvd192cG9zCisgICAgICAgICAgJiYgKChocG9z ID49IHN0YXJ0X2hwb3MKKyAgICAgICAgICAgICAgICYmIGhwb3MgPCBlbmRfaHBvcykKKyAgICAg ICAgICAgICAgLyogQSBmbG9hdGluZyBjdXJzb3IgYmV5b25kIHRoZSBlbmQgb2YgdGhlIGdseXBo IHJvdy4gKi8KKyAgICAgICAgICAgICAgfHwgKGhwb3MgKyAxID09IHN0YXJ0X2hwb3MKKyAgICAg ICAgICAgICAgICAgICYmIGhwb3MgKyAxID09IGVuZF9ocG9zKSkKKyAgICAgICAgICAmJiBlbmFi bGVkX3ApCisgICAgICAgIHsKKyAgICAgICAgICBib29sIHJlbW92ZV9wID0gZmFsc2U7CisgICAg ICAgICAgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnks IGhwb3MsIHZwb3MsIHdkLCBoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJz b3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBsc2xfZmcsIGFjdGl2ZV9wLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBnbHlwaF9mbGF2b3IsIHJlbW92ZV9wKTsKKyAgICAgICAgfQorICAg IH0KK30KKwordm9pZAorbWNfcmVkcmF3X3JvdyAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGds eXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAg ICBpbnQgc3RhcnRfeCwgaW50IHN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JWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAvLyAg aWYgKHRyYWNlX3JlZGlzcGxheV9wKQorICAvLyAgICBmcHJpbnRmIChzdGRlcnIsICJtY19lcmFz ZV9oZWxwZXIgKCVzKTogIGNhY2hlICglcykgfCB2cG9zICglZClcbiIsCisgIC8vICAgICAgbWNf d2luZG93ICh3KSwgbWNfY2FjaGVfdHlwZV90b19zdHJpbmcgKGNhY2hlX3R5cGUpLCByb3dfdnBv cyk7CisgIHN0cnVjdCBtdWx0aXBsZV9jdXJzb3JzX2NhY2hlIGZvb19lbHRzOworICBzd2l0Y2gg KGNhY2hlX3R5cGUpCisgICAgeworICAgICAgY2FzZSBOT19DQUNIRToKKyAgICAgICAgeworICAg ICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBjYXNlIE1DX0NBQ0hFOgorICAgICAgICB7 CisgICAgICAgICAgZm9vX2VsdHMuY2FjaGVzID0gdy0+bWNfZWx0cy5jYWNoZXM7CisgICAgICAg ICAgZm9vX2VsdHMuYWxsb2NhdGVkID0gdy0+bWNfZWx0cy5hbGxvY2F0ZWQ7CisgICAgICAgICAg Zm9vX2VsdHMudXNlZCA9IHctPm1jX2VsdHMudXNlZDsKKyAgICAgICAgICBicmVhazsKKyAgICAg ICAgfQorICAgICAgY2FzZSBDSF9DQUNIRToKKyAgICAgICAgeworICAgICAgICAgIGZvb19lbHRz LmNhY2hlcyA9IHctPmNoX2VsdHMuY2FjaGVzOworICAgICAgICAgIGZvb19lbHRzLmFsbG9jYXRl ZCA9IHctPmNoX2VsdHMuYWxsb2NhdGVkOworICAgICAgICAgIGZvb19lbHRzLnVzZWQgPSB3LT5j aF9lbHRzLnVzZWQ7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGNhc2UgRkNf Q0FDSEU6CisgICAgICAgIHsKKyAgICAgICAgICBmb29fZWx0cy5jYWNoZXMgPSB3LT5mY19lbHRz LmNhY2hlczsKKyAgICAgICAgICBmb29fZWx0cy5hbGxvY2F0ZWQgPSB3LT5mY19lbHRzLmFsbG9j YXRlZDsKKyAgICAgICAgICBmb29fZWx0cy51c2VkID0gdy0+ZmNfZWx0cy51c2VkOworICAgICAg ICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorICBmb3IgKGludCBlbHQgPSAwOyBlbHQgPCBm b29fZWx0cy51c2VkOyArK2VsdCkKKyAgICB7CisgICAgICBpbnQgeCA9IGZvb19lbHRzLmNhY2hl c1tlbHRdLng7CisgICAgICBpbnQgZnggPSBmb29fZWx0cy5jYWNoZXNbZWx0XS5meDsKKyAgICAg IGludCB5ID0gZm9vX2VsdHMuY2FjaGVzW2VsdF0ueTsKKyAgICAgIGludCBmeSA9IGZvb19lbHRz LmNhY2hlc1tlbHRdLmZ5OworICAgICAgaW50IGhwb3MgPSBmb29fZWx0cy5jYWNoZXNbZWx0XS5o cG9zOworICAgICAgaW50IHZwb3MgPSBmb29fZWx0cy5jYWNoZXNbZWx0XS52cG9zOworICAgICAg aW50IHdkID0gZm9vX2VsdHMuY2FjaGVzW2VsdF0ud2Q7CisgICAgICBpbnQgaCA9IGZvb19lbHRz LmNhY2hlc1tlbHRdLmg7CisgICAgICBlbnVtIHR5cGVfb2ZfY3Vyc29yIGN1cnNvcl90eXBlID0g Zm9vX2VsdHMuY2FjaGVzW2VsdF0uY3Vyc29yX3R5cGU7CisgICAgICBpbnQgY3Vyc29yX3dpZHRo ID0gZm9vX2VsdHMuY2FjaGVzW2VsdF0uY3Vyc29yX3dpZHRoOworICAgICAgc3RydWN0IG1jX1JH QiBsc2xfZmcgPSB7LnJlZCA9IGZvb19lbHRzLmNhY2hlc1tlbHRdLmZvcmVncm91bmQucmVkLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gZm9vX2VsdHMuY2FjaGVzW2Vs dF0uZm9yZWdyb3VuZC5ncmVlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVl ID0gZm9vX2VsdH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hc2hfdHdvKQorICAgICAgICBjb250 aW51ZTsKKyAgICAgIGlmICh2cG9zID09IHJvd192cG9zCisgICAgICAgICAgJiYgZ2x5cGhfZmxh dm9yID09IE1DX0dMWVBICisgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICB7CisgICAg ICAgICAgbWNfZXJhc2VfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgeSwgaHBvcywgdnBvcywg Z2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QpOworICAgICAgICAgIGZvb19lbHRzLmNhY2hl c1tlbHRdLmVuYWJsZWRfcCA9IGZhbHNlOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKHZw b3MgPT0gcm93X3Zwb3MKKyAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAg IHsKKyAgICAgICAgICAgIGJvb2wgcmVtb3ZlX3AgPSB0cnVlOworICAgICAgICAgICAgbWNfZHJh d19lcmFzZV9oeWJyaWQgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3Ms IHdkLCBoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCBj dXJzb3Jfd2lkdGgsIGxzbF9iZywgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgZ2x5cGhfZmxhdm9yLCByZW1vdmVfcCk7CisgICAgICAgICAgICBmb29fZWx0cy5j YWNoZXNbZWx0XS5lbmFibGVkX3AgPSBmYWxzZTsKKyAgICAgICAgICB9CisgICAgfQorfQorCit2 b2lkCittY19lcmFzZV9yb3cgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXgg Km1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93KQoreworICBpbnQgdnBvcyA9IE1BVFJJWF9S T1dfVlBPUyAocm93LCBtYXRyaXgpOworICBpZiAodHJhY2Vfcm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ZWRfd2luZG93KSkKKyAgICAgICAgICAgICAgICAgICAgID8gUFQKKyAgICAg ICAgICAgICAgICAgICAgIDogWEZJWE5VTSAoRm1hcmtlcl9wb3NpdGlvbiAody0+cG9pbnRtKSk7 CisgIHB0cmRpZmZfdCBmY19jdXJyZW50X2NvbCA9IG1jX2N1cnJlbnRfY29sdW1uICh3LCBvcG9p bnQpOworICBpbnQgZnJhbWVfY2hhcl93aWR0aCA9IEZSQU1FX0NPTFVNTl9XSURUSCAoZik7Cisg IGJvb2wgZmlsbF9jb2x1bW5fcCA9ICFOSUxQIChCVkFSIChiLCBmaWxsX2NvbHVtbikpOworICBp bnQgZmlsbF9jb2wgPSBYRklYTlVNIChCVkFSIChiLCBmaWxsX2NvbHVtbikpOworICBpbnQgaHNj bF94ID0gdy0+aHNjcm9sbCAqIGZyYW1lX2NoYXJfd2lkdGg7CisgIGlmIChiICE9IGN1cnJlbnRf YnVmZmVyKQorICAgIHsKKyAgICAgIG9sZF9idWZmZXIgPSBjdXJyZW50X2J1ZmZlcjsKKyAgICAg IHNldF9idWZmZXJfaW50ZXJuYWwgKGIpOworICAgIH0KKyAgKmZjX3ggPSAoZmlsbF9jb2x1bW5f cAorICAgICAgICAgICAmJiAhTklMUCAoVmRpc3BsYXlfbGluZV9udW1iZXJzKSkKKyAgICAgICAg ICAgID8gKGZpbGxfY29sICogZnJhbWVfY2hhcl93aWR0aCkgKyB3LT5tYy5sbnVtX3BpeGVsX3dp ZHRoIC0gaHNjbF94CisgICAgICAgICAgOiAoZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAgICYm IE5JTFAgKFZkaXNwbGF5X2xpbmVfbnVtYmVycykpCisgICAgICAgICAgICA/IChmaWxsX2NvbCAq IGZyYW1lX2NoYXJfd2lkdGgpIC0gaHNjbF94CisgICAgICAgICAgOiAwOworICBpZiAob2xkX2J1 ZmZlcikKKyAgICBzZXRfYnVmZmVyX2ludGVybmFsIChvbGRfYnVmZmVyKTsKKyAgZW51bSBmYWNl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gZ29fdHdvX3AgKCVzKVxuIiwKKyAgICAgICAgICAgICAgICAg ICAgIG1jX3dpbmRvdyAodyksIGdvX29uZV9wID8gInllcyIgOiAibm8iLCBnb190d29fcCA/ICJ5 ZXMiIDogIm5vIik7CisgIGlmICghZ29fb25lX3AgJiYgIWdvX3R3b19wKQorICAgIHJldHVybjsK KyAgYm9vbCB1cGRhdGluZ19mcmFtZV9wID0gZmFsc2U7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhG UkFNRSAody0+ZnJhbWUpOworICBpZiAoWEZSQU1FICh3LT5mcmFtZSkgIT0gZi0+bWNfdXBkYXRp bmdfZnJhbWUKKyAgICAgICYmIChnb19vbmVfcCB8fCBnb190d29fcCkpCisgICAgeworICAgICAg dXBkYXRpbmdfZnJhbWVfcCA9IHRydWU7CisgICAgICB1cGRhdGVfYmVnaW4gKGYpOworICAgIH0K KyAgaWYgKHctPnBoeXNfY3Vyc29yX29uX3AKKyAgICAgICYmIGdvX3R3b19wKQorICAgIGVyYXNl X3BoeXNfY3Vyc29yICh3KTsKKyAgc3RydWN0IGdseXBoX21hdHJpeCAqY3VycmVudF9tYXRyaXgg PSB3LT5jdXJyZW50X21hdHJpeDsKKyAgZm9yIChpbnQgdnBvcyA9IDA7CisgICAgICAgdnBvcyA8 IGN1cnJlbnRfbWF0cml4LT5ucm93cworICAgICAgICYmIE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0 cml4LCB2cG9zKS0+ZW5hYmxlZF9wCisgICAgICAgJiYgZ29fb25lX3A7CisgICAgICAgKyt2cG9z KQorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdyA9IE1BVFJJWF9ST1cgKGN1cnJl bnRfbWF0cml4LCB2cG9zKTsKKyAgICAgIG1jX2VyYXNlX3JvdyAodywgY3VycmVudF9tYXRyaXgs IHJvdyk7CisgICAgfQorICBpZiAodXBkYXRpbmdfZnJhbWVfcCkKKyAgICB1cGRhdGVfZW5kIChm KTsKKyAgbWNfcmVzZXRfY2FjaGUgKHcsIE1DX0NBQ0hFKTsKKyAgbWNfcmVzZXRfY2FjaGUgKHcs IENIX0NBQ0hFKTsKKyAgbWNfcmVzZXRfY2FjaGUgKHcsIEZDX0NBQ0hFKTsKK30KKworREVGVU4g KCJtYy1zdGRlcnIiLCBGbWNfc3RkZXJyLCBTbWNfc3RkZXJyLCAwLCAxLCAiUCIsCisgICAgICAg ZG9jOiAvKiBUb2dnbGUgdHJhY2luZyBvZiBtdWx0aXBsZSBmYWtlIGN1cnNvcnMuCitXaXRoIEFS RywgdHVybiB0cmFjaW5nIG9uIGlmIGFuZCBvbmx5IGlmIEFSRyBpcyBwb3NpdGl2ZS4gKi8pCisg IChMaXNwX09iamVjdCBhcmcpCit7CisgIGlmIChOSUxQIChhcmcpKQorICAgIG1jX3N0ZGVycl9w ID0gIW1jX3N0ZGVycl9wOworICBlbHNlCisgICAgeworICAgICAgYXJnID0gRnByZWZpeF9udW1l cmljX3ZhbHVlIChhcmcpOworICAgICAgbWNfc3RkZXJyX3AgPSBYRklYTlVNIChhcmcpID4gMDsK KyAgICB9CisgIHJldHVybiBRbmlsOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogDAogLyoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAJCSAgICAg IFdpbmRvdyBkaXNwbGF5IGRpbWVuc2lvbnMKQEAgLTEzMzk1LDYgKzE3NDg5LDY5IEBAIGhzY3Jv bGxfd2luZG93X3RyZWUgKExpc3BfT2JqZWN0IHdpbmRvdykKIAkgICAgICBlbHNlCiAJCXB0ID0g Y2xpcF90b19ib3VuZHMgKEJFR1YsIG1hcmtlcl9wb3NpdGlvbiAody0+cG9pbnRtKSwgWlYpOwog CisKK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9zPTB4MTIxMjQzZDUwKSBhdCB4ZGlzcC5jOjgyOTkKKyM2ICAweDAwMDAwMDAx MDAwNGQzN2UgaW4gaW5pdF90b19yb3dfc3RhcnQgKGl0PTB4N2ZmZjVmYmY5ZTMwLCB3PTB4MTFi ZjcyYzk4LAorICAgIHJvdz0weDEyMTI0M2QwMCkgYXQgeGRpc3AuYzo4NDIzCisjNyAgMHgwMDAw MDAwMTAwMDZjM2Y3IGluIGhzY3JvbGxfd2luZG93X3RyZWUgKHdpbmRvdz0uLi4pIGF0IHhkaXNw LmM6MTg1NDYKKyovCisKKyAgLyogYGluaXRfaXRlcmF0b3InOiAgZWFzc2VydCAoY2hhcnBvcyA8 IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKGNoYXJwb3MgPj0gQlVGX0JF RyAoY3VycmVudF9idWZmZXIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBjaGFycG9zIDw9IFpWKSk7ICovCisKKyAgc3RydWN0IGRpc3BsYXlfcG9zICpwb3MgPSAmY3Vy c29yX3Jvdy0+c3RhcnQ7CisgIHB0cmRpZmZfdCBjaGFycG9zID0gQ0hBUlBPUyAocG9zLT5wb3Mp OworCisgIGJvb2wgYmFyZl9jcmFzaF9vbmUgPSAoY2hhcnBvcyA8IDAKKyAgICAgICAgICAgICAg ICAgICAgICAgICB8fCAoY2hhcnBvcyA+PSBCVUZfQkVHIChjdXJyZW50X2J1ZmZlcikKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgY2hhcnBvcyA8PSBaVikpCisgICAgICAgICAgICAg ICAgICAgICAgICA/IGZhbHNlCisgICAgICAgICAgICAgICAgICAgICAgICA6IHRydWU7CisgIGlm IChiYXJmX2NyYXNoX29uZSkKKyAgICByZXR1cm4gaHNjcm9sbGVkX3A7CisKKyAgLyogYHJlc2Vh dF8xJzogIENIQVJQT1MgKHBvcykgPj0gQkVHViAmJiBDSEFSUE9TIChwb3MpIDw9IFpWICovCisg IGJvb2wgYmFyZl9jcmFzaF90d28gPSAoY2hhcnBvcyA+PSBCRUdWICYmIGNoYXJwb3MgPD0gWlYp CisgICAgICAgICAgICAgICAgICAgICAgICAgPyBmYWxzZQorICAgICAgICAgICAgICAgICAgICAg ICAgIDogdHJ1ZTsKKyAgaWYgKGJhcmZfY3Jhc2hfdHdvKQorICAgIHJldHVybiBoc2Nyb2xsZWRf cDsKKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKIAkgICAgICAvKiBNb3ZlIGl0ZXJhdG9yIHRvIHB0IHN0YXJ0aW5nIGF0IGN1cnNvcl9y b3ctPnN0YXJ0IGluCiAJCSBhIGxpbmUgd2l0aCBpbmZpbml0ZSB3aWR0aC4gICovCiAJICAgICAg aW5pdF90b19yb3dfc3RhcnQgKCZpdCwgdywgY3Vyc29yX3Jvdyk7CkBAIC0xNDI4Nyw5ICsxODQ0 NCwyMiBAQCByZWRpc3BsYXlfaW50ZXJuYWwgKHZvaWQpCiAJICAgICAgKnctPmRlc2lyZWRfbWF0 cml4LT5tZXRob2QgPSAwOwogCSAgICAgIGRlYnVnX21ldGhvZF9hZGQgKHcsICJvcHRpbWl6YXRp b24gMSIpOwogI2VuZGlmCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KKyAgaWYgKEJVRkZFUlAg KHctPmNvbnRlbnRzKQorICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgY3Jvc3NoYWlycykpKQorICAgIG1jX3VwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgZmFsc2Up OworICAgIGVsc2UKIAkgICAgICB1cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIGZhbHNlKTsKICNl bmRpZgorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAgICAgZ290byB1cGRhdGU7 CiAJICAgIH0KIAkgIGVsc2UKQEAgLTE3Njg3LDEwICsyMTg1NywyMiBAQCByZWRpc3BsYXlfd2lu ZG93IChMaXNwX09iamVjdCB3aW5kb3csIGJvb2wganVzdF90aGlzX29uZV9wKQogICAgIH0KIAog I2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGJvb2wga2VlcF9jdXJyZW50X3AgPSAoanVzdF90 aGlzX29uZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKCF1c2VkX2N1cnJlbnRfbWF0 cml4X3AgJiYgIW92ZXJsYXlfYXJyb3dfc2VlbikKKyAgICAgICAgICAgICAgICAgICAgICAgICB8 fCB3LT5wc2V1ZG9fd2luZG93X3ApOworCisgIGJvb2wgZnJpbmdlc191cGRhdGVkX3AgPSAoQlVG RkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBtY191cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIGtlZXBfY3VycmVu dF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgOiB1cGRhdGVfd2luZG93X2ZyaW5nZXMg KHcsIGtlZXBfY3VycmVudF9wKTsKKwogICBpZiAoRlJBTUVfV0lORE9XX1AgKGYpCi0gICAgICAm JiB1cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIChqdXN0X3RoaXNfb25lX3AKLQkJCQkgICAgfHwg KCF1c2VkX2N1cnJlbnRfbWF0cml4X3AgJiYgIW92ZXJsYXlfYXJyb3dfc2VlbikKLQkJCQkgICAg fHwgdy0+cHNldWRvX3dpbmRvd19wKSkpCisgICAgICAmJiBmcmluZ2VzX3VwZGF0ZWRfcCkKICAg ICB7CiAgICAgICB1cGRhdGVfYmVnaW4gKGYpOwogICAgICAgYmxvY2tfaW5wdXQgKCk7CkBAIC0x NzcwNSw2ICsyMTg4Nyw5IEBAIHJlZGlzcGxheV93aW5kb3cgKExpc3BfT2JqZWN0IHdpbmRvdywg Ym9vbCBqdXN0X3RoaXNfb25lX3ApCiAgICAgICB1cGRhdGVfZW5kIChmKTsKICAgICB9CiAKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKICAgaWYgKFdJTkRPV19CT1RUT01fRElWSURFUl9X SURUSCAodykpCiAgICAgeF9kcmF3X2JvdHRvbV9kaXZpZGVyICh3KTsKICNlbmRpZiAvKiBIQVZF X1dJTkRPV19TWVNURU0gKi8KQEAgLTE4MDEwLDYgKzIyMTk1LDE5IEBAIHRyeV93aW5kb3dfcmV1 c2luZ19jdXJyZW50X21hdHJpeCAoc3RydWN0IHdpbmRvdyAqdykKIAkgICAgIHNjcm9sbF9ydW5f aG9vayB3aWxsIGNsZWFyIHRoZSBjdXJzb3IsIGFuZCB1c2UgdGhlCiAJICAgICBjdXJyZW50IG1h dHJpeCB0byBnZXQgdGhlIGhlaWdodCBvZiB0aGUgcm93IHRoZSBjdXJzb3IgaXMKIAkgICAgIGlu LiAgKi8KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMg Ki8KKworICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAgZnByaW50ZiAoc3RkZXJyLCAidHJ5 X3dpbmRvd19yZXVzaW5nX2N1cnJlbnRfbWF0cml4IFsxIG9mIDJdICglcylcbiIsIG1jX3dpbmRv dyAodykpOworCisgIG1jX3ByZV9zY3JvbGxfY2xlYW4gKHcpOworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKworCiAJICBydW4uY3VycmVudF95ID0gc3RhcnRfcm93LT55OwogCSAgcnVuLmRl c2lyZWRfeSA9IGl0LmN1cnJlbnRfeTsKIAkgIHJ1bi5oZWlnaHQgPSBpdC5sYXN0X3Zpc2libGVf eSAtIGl0LmN1cnJlbnRfeTsKQEAgLTE4MTczLDYgKzIyMzcxLDE5IEBAIHRyeV93aW5kb3dfcmV1 c2luZ19jdXJyZW50X21hdHJpeCAoc3RydWN0IHdpbmRvdyAqdykKIAl9CiAKICAgICAgIC8qIFNj cm9sbCB0aGUgZGlzcGxheS4gICovCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBN VUxUSVBMRS1DVVJTT1JTICovCisKKyAgaWYgKHRyYWNlX3JlZGlzcGxheV9wKQorICAgIGZwcmlu dGYgKHN0ZGVyciwgInRyeV93aW5kb3dfcmV1c2luZ19jdXJyZW50X21hdHJpeCBbMiBvZiAyXSAo JXMpXG4iLCBtY193aW5kb3cgKHcpKTsKKworICBtY19wcmVfc2Nyb2xsX2NsZWFuICh3KTsKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgcnVuLmN1cnJlbnRfeSA9IGZpcnN0 X3JldXNhYmxlX3Jvdy0+eTsKICAgICAgIHJ1bi5kZXNpcmVkX3kgPSBXSU5ET1dfSEVBREVSX0xJ TkVfSEVJR0hUICh3KTsKICAgICAgIHJ1bi5oZWlnaHQgPSBpdC5sYXN0X3Zpc2libGVfeSAtIHJ1 bi5jdXJyZW50X3k7CkBAIC0xOTEyNyw2ICsyMzMzOCwxOSBAQCB0cnlfd2luZG93X2lkIChzdHJ1 Y3Qgd2luZG93ICp3KQogICAvKiBTY3JvbGwgdGhlIGRpc3BsYXkuICBEbyBpdCBiZWZvcmUgY2hh bmdpbmcgdGhlIGN1cnJlbnQgbWF0cml4IHNvCiAgICAgIHRoYXQgeHRlcm0uYyBkb2Vzbid0IGdl dCBjb25mdXNlZCBhYm91dCB3aGVyZSB0aGUgY3Vyc29yIGdseXBoIGlzCiAgICAgIGZvdW5kLiAg Ki8KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8K KworICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAgZnByaW50ZiAoc3RkZXJyLCAidHJ5X3dp bmRvd19pZCAoJXMpXG4iLCBtY193aW5kb3cgKHcpKTsKKworICBtY19wcmVfc2Nyb2xsX2NsZWFu ICh3KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBpZiAoZHkgJiYgcnVuLmhl aWdodCkKICAgICB7CiAgICAgICB1cGRhdGVfYmVnaW4gKGYpOwpAQCAtMjAxMzMsNiArMjQzNTcs MTcgQEAgYXBwZW5kX3NwYWNlX2Zvcl9uZXdsaW5lIChzdHJ1Y3QgaXQgKml0LCBib29sIGRlZmF1 bHRfZmFjZV9wKQogCSAgbWVtc2V0ICgmaXQtPnBvc2l0aW9uLCAwLCBzaXplb2YgaXQtPnBvc2l0 aW9uKTsKIAkgIGl0LT5vYmplY3QgPSBRbmlsOwogCSAgaXQtPmMgPSBpdC0+Y2hhcl90b19kaXNw bGF5ID0gJyAnOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VS U09SUyAqLworCisgICAgICBpZiAoSVRfQllURVBPUyAoKml0KSA+PSBaVl9CWVRFKQorICAgICAg ICBpdC0+enZfcCA9IHRydWU7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgIGl0 LT5sZW4gPSAxOwogCiAJICAvKiBJZiB0aGUgZGVmYXVsdCBmYWNlIHdhcyByZW1hcHBlZCwgYmUg c3VyZSB0byB1c2UgdGhlCkBAIC0yMTI2OSw5ICsyNTUwNCwyMiBAQCBtYXliZV9wcm9kdWNlX2xp bmVfbnVtYmVyIChzdHJ1Y3QgaXQgKml0KQogICAgICAgZWxzZQogCXRlbV9pdC5jID0gdGVtX2l0 LmNoYXJfdG9fZGlzcGxheSA9ICpwOwogICAgICAgdGVtX2l0LmxlbiA9IDE7CisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGlmIChi ZXlvbmRfenYpCisgICAgICAgIHRlbV9pdC56dl9wID0gdHJ1ZTsKKyAgICAgIHRlbV9pdC5jdXJy ZW50X3kgPSBpdC0+Y3VycmVudF95OworICAgICAgdGVtX2l0LnZwb3MgPSBpdC0+dnBvczsKICAg ICAgIC8qIE1ha2Ugc3VyZSB0aGVzZSBnbHlwaHMgd2lsbCBoYXZlIGEgInBvc2l0aW9uIiBvZiAt MS4gICovCiAgICAgICBTRVRfVEVYVF9QT1MgKHRlbV9pdC5wb3NpdGlvbiwgLTEsIC0xKTsKICAg ICAgIFBST0RVQ0VfR0xZUEhTICgmdGVtX2l0KTsKKyAgICAgIHRlbV9pdC5ocG9zICs9IDE7CisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCiAKICAgICAgIC8qIFN0b3AgcHJvZHVjaW5nIGds eXBocywgYW5kIHJlZnJhaW4gZnJvbSBwcm9kdWNpbmcgdGhlIGxpbmUKIAkgbnVtYmVyLCBpZiB3 ZSBkb24ndCBoYXZlIGVub3VnaCBzcGFjZSBvbiB0aGlzIGxpbmUuICAqLwpAQCAtMjEyODQsNiAr MjU1MzIsMzAgQEAgbWF5YmVfcHJvZHVjZV9saW5lX251bWJlciAoc3RydWN0IGl0ICppdCkKIAl9 CiAgICAgfQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09S UyAqLworCisgIExpc3BfT2JqZWN0IGJ1ZiA9IGl0LT53LT5jb250ZW50czsKKyAgQ0hFQ0tfQlVG RkVSIChidWYpOworICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAoYnVmKTsKKyAgc3RydWN0 IGJ1ZmZlciAqb2xkX2J1ZmZlciA9IE5VTEw7CisgIC8qIE5lZWRlZCBzbyB0aGF0IGJ1ZmZlci1s b2NhbCB2YWx1ZXMgY2FuIGJlIGRldGVybWluZWQ7IGUuZy4sIHdoZW4gc3dpdGNoaW5nCisgIHRv IHRoZSBtaW5pYnVmZmVyLiAqLworICBpZiAoYiAhPSBjdXJyZW50X2J1ZmZlcikKKyAgICB7Cisg ICAgICBvbGRfYnVmZmVyID0gY3VycmVudF9idWZmZXI7CisgICAgICBzZXRfYnVmZmVyX2ludGVy bmFsIChiKTsKKyAgICB9CisgIGl0LT53LT5tYy5sbnVtX3BpeGVsX3dpZHRoID0gKCFOSUxQIChW ZGlzcGxheV9saW5lX251bWJlcnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g dGVtX2l0LmN1cnJlbnRfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogMDsKKyAg aWYgKG9sZF9idWZmZXIpCisgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7CisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogUmVjb3JkIHRoZSB3aWR0aCBpbiBw aXhlbHMgd2UgbmVlZCBmb3IgdGhlIGxpbmUgbnVtYmVyIGRpc3BsYXkuICAqLwogICBpdC0+bG51 bV9waXhlbF93aWR0aCA9IHRlbV9pdC5jdXJyZW50X3g7CiAgIC8qIENvcHkgdGhlIHByb2R1Y2Vk IGdseXBocyBpbnRvIElUJ3MgZ2x5cGhfcm93LiAgKi8KQEAgLTI3MDkyLDYgKzMxMzY0LDIwIEBA IGFwcGVuZF9nbHlwaCAoc3RydWN0IGl0ICppdCkKIAkgICAgZ1sxXSA9ICpnOwogCSAgZ2x5cGgg PSBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJlYV07CiAJfQorCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+eCA9IGl0LT5j dXJyZW50X3g7CisgICAgICBnbHlwaC0+eSA9IGl0LT5jdXJyZW50X3k7CisgICAgICBnbHlwaC0+ aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPnZwb3MgPSBpdC0+dnBvczsKKyAgICAgIGds eXBoLT56dl9wID0gaXQtPnp2X3A7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAg ICAgIGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKICAgICAgIGdseXBo LT5vYmplY3QgPSBpdC0+b2JqZWN0OwogICAgICAgaWYgKGl0LT5waXhlbF93aWR0aCA+IDApCkBA IC0yNzE3NSw2ICszMTQ2MSwyMCBAQCBhcHBlbmRfY29tcG9zaXRlX2dseXBoIChzdHJ1Y3QgaXQg Kml0KQogCSAgICBnWzFdID0gKmc7CiAJICBnbHlwaCA9IGl0LT5nbHlwaF9yb3ctPmdseXBoc1tp dC0+YXJlYV07CiAJfQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUt Q1VSU09SUyAqLworCisgICAgICBnbHlwaC0+eCA9IGl0LT5jdXJyZW50X3g7CisgICAgICBnbHlw aC0+eSA9IGl0LT5jdXJyZW50X3k7CisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAg ICAgZ2x5cGgtPnZwb3MgPSBpdC0+dnBvczsKKyAgICAgIGdseXBoLT56dl9wID0gaXQtPnp2X3A7 CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIGdseXBoLT5jaGFycG9zID0g aXQtPmNtcF9pdC5jaGFycG9zOwogICAgICAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAg ICAgICBlYXNzZXJ0IChpdC0+cGl4ZWxfd2lkdGggPD0gU0hSVF9NQVgpOwpAQCAtMjczODMsNiAr MzE2ODMsMjAgQEAgcHJvZHVjZV9pbWFnZV9nbHlwaCAoc3RydWN0IGl0ICppdCkKIAl9CiAgICAg ICBpZiAoZ2x5cGggPCBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJlYSArIDFdKQogCXsKKworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAg Z2x5cGgtPnggPSBpdC0+Y3VycmVudF94OworICAgICAgZ2x5cGgtPnkgPSBpdC0+Y3VycmVudF95 OworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBoLT52cG9zID0gaXQt PnZwb3M7CisgICAgICBnbHlwaC0+enZfcCA9IGl0LT56dl9wOworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKworCiAJICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7 CiAJICBnbHlwaC0+b2JqZWN0ID0gaXQtPm9iamVjdDsKIAkgIGdseXBoLT5waXhlbF93aWR0aCA9 IGNsaXBfdG9fYm91bmRzICgtMSwgaXQtPnBpeGVsX3dpZHRoLCBTSFJUX01BWCk7CkBAIC0yNzQ4 Niw2ICszMTgwMCwyMCBAQCBwcm9kdWNlX3h3aWRnZXRfZ2x5cGggKHN0cnVjdCBpdCAqaXQpCiAJ fQogICAgICAgaWYgKGdseXBoIDwgaXQtPmdseXBoX3Jvdy0+Z2x5cGhzW2FyZWEgKyAxXSkKIAl7 CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK KyAgICAgIGdseXBoLT54ID0gaXQtPmN1cnJlbnRfeDsKKyAgICAgIGdseXBoLT55ID0gaXQtPmN1 cnJlbnRfeTsKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBnbHlwaC0+dnBv cyA9IGl0LT52cG9zOworICAgICAgZ2x5cGgtPnp2X3AgPSBpdC0+enZfcDsKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogCSAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9z aXRpb24pOwogCSAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAJICBnbHlwaC0+cGl4ZWxf d2lkdGggPSBjbGlwX3RvX2JvdW5kcyAoLTEsIGl0LT5waXhlbF93aWR0aCwgU0hSVF9NQVgpOwpA QCAtMjc1NzIsNiArMzE5MDAsMjAgQEAgYXBwZW5kX3N0cmV0Y2hfZ2x5cGggKHN0cnVjdCBpdCAq aXQsIExpc3BfT2JqZWN0IG9iamVjdCwKIAkgICAgd2lkdGggLT0gaXQtPmZpcnN0X3Zpc2libGVf eCAtIGl0LT5jdXJyZW50X3g7CiAJICBlYXNzZXJ0ICh3aWR0aCA+IDApOwogCX0KKworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgZ2x5 cGgtPnggPSBpdC0+Y3VycmVudF94OworICAgICAgZ2x5cGgtPnkgPSBpdC0+Y3VycmVudF95Owor ICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBoLT52cG9zID0gaXQtPnZw b3M7CisgICAgICBnbHlwaC0+enZfcCA9IGl0LT56dl9wOworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKworCiAgICAgICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7 CiAgICAgICBnbHlwaC0+b2JqZWN0ID0gb2JqZWN0OwogICAgICAgLyogRklYTUU6IEl0IHdvdWxk IGJlIGJldHRlciB0byB1c2UgVFlQRV9NQVggaGVyZSwgYnV0CkBAIC0yODAyNiw2ICszMjM2OCwy MCBAQCBhcHBlbmRfZ2x5cGhsZXNzX2dseXBoIChzdHJ1Y3QgaXQgKml0LCBpbnQgZmFjZV9pZCwg Ym9vbCBmb3Jfbm9fZm9udCwgaW50IGxlbiwKIAkgICAgZ1sxXSA9ICpnOwogCSAgZ2x5cGggPSBp dC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJlYV07CiAJfQorCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+eCA9IGl0LT5jdXJy ZW50X3g7CisgICAgICBnbHlwaC0+eSA9IGl0LT5jdXJyZW50X3k7CisgICAgICBnbHlwaC0+aHBv cyA9IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPnZwb3MgPSBpdC0+dnBvczsKKyAgICAgIGdseXBo LT56dl9wID0gaXQtPnp2X3A7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAg IGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5v YmplY3QgPSBpdC0+b2JqZWN0OwogICAgICAgZWFzc2VydCAoaXQtPnBpeGVsX3dpZHRoIDw9IFNI UlRfTUFYKTsKQEAgLTI5MDc2LDEwICszMzQzMiwzMyBAQCB4X2luc2VydF9nbHlwaHMgKHN0cnVj dCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnVwZGF0ZWRfcm93LAogCiAgIC8qIFdyaXRl IHRoZSBnbHlwaHMuICAqLwogICBocG9zID0gc3RhcnQgLSByb3ctPmdseXBoc1t1cGRhdGVkX2Fy ZWFdOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAq LworCisgIGlmICgody0+bWNfZWx0cy51c2VkID4gMCB8fCB3LT5jaF9lbHRzLnVzZWQgPiAwIHx8 IHctPmZjX2VsdHMudXNlZCA+IDApCisgICAgICAmJiB1cGRhdGVkX2FyZWEgPT0gVEVYVF9BUkVB KQorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRf bWF0cml4OworICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsK KyAgICAgIGludCBzdGFydF94ID0gdy0+b3V0cHV0X2N1cnNvci54OworICAgICAgaW50IHN0YXJ0 X2hwb3MgPSBocG9zOworICAgICAgaW50IGVuZF9ocG9zID0gaHBvcyArIGxlbjsKKyAgICAgIGJv b2wgY2xlYXJfZW9sX3AgPSBmYWxzZTsKKyAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBobCA9 IERSQVdfTk9STUFMX1RFWFQ7CisgICAgICBUUkFDRSAoKHN0ZGVyciwgInhfaW5zZXJ0X2dseXBo cyAoJWQpOiAgc3RhcnRfeCAoJWQpIHwgc3RhcnRfaHBvcyAoJWQpIHwgZW5kX2hwb3MgKCVkKVxu IiwKKyAgICAgICAgICAgICAgICAgICAgICB2cG9zLCBzdGFydF94LCBzdGFydF9ocG9zLCBlbmRf aHBvcykpOworICAgICAgbWNfcmVkcmF3X3JvdyAodywgbWF0cml4LCByb3csIHN0YXJ0X3gsIHN0 YXJ0X2hwb3MsIGVuZF9ocG9zLCBjbGVhcl9lb2xfcCwgaGwpOworICAgIH0KKyAgICBlbHNlCiAg IGRyYXdfZ2x5cGhzICh3LCB3LT5vdXRwdXRfY3Vyc29yLngsIHJvdywgdXBkYXRlZF9hcmVhLAog CSAgICAgICBocG9zLCBocG9zICsgbGVuLAogCSAgICAgICBEUkFXX05PUk1BTF9URVhULCAwKTsK IAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBBZHZhbmNlIHRoZSBvdXRwdXQg Y3Vyc29yLiAgKi8KICAgdy0+b3V0cHV0X2N1cnNvci5ocG9zICs9IGxlbjsKICAgdy0+b3V0cHV0 X2N1cnNvci54ICs9IHNoaWZ0X2J5X3dpZHRoOwpAQCAtMjk1MDUsOSArMzM4ODQsMzEgQEAgeF9m aXhfb3ZlcmxhcHBpbmdfYXJlYSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAq cm93LAogCSAgd2hpbGUgKGkgPCByb3ctPnVzZWRbYXJlYV0KIAkJICYmIHJvdy0+Z2x5cGhzW2Fy ZWFdW2ldLm92ZXJsYXBzX3ZlcnRpY2FsbHlfcCk7CiAKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgICAgaWYgKCh3LT5tY19lbHRzLnVz ZWQgPiAwIHx8IHctPmNoX2VsdHMudXNlZCA+IDAgfHwgdy0+ZmNfZWx0cy51c2VkID4gMCkKKyAg ICAgICAgICAgICYmIGFyZWEgPT0gVEVYVF9BUkVBKQorICAgICAgICAgIHsKKyAgICAgICAgICAg IHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworICAgICAg ICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgICAgICAg ICAgIGludCBzdGFydF9ocG9zID0gc3RhcnQ7CisgICAgICAgICAgICBpbnQgZW5kX2hwb3MgPSBp OworICAgICAgICAgICAgYm9vbCBjbGVhcl9lb2xfcCA9IGZhbHNlOworICAgICAgICAgICAgZW51 bSBkcmF3X2dseXBoc19mYWNlIGhsID0gRFJBV19OT1JNQUxfVEVYVDsKKyAgICAgICAgICAgIFRS QUNFICgoc3RkZXJyLCAieF9maXhfb3ZlcmxhcHBpbmdfYXJlYSAoJWQpOiAgc3RhcnRfeCAoJWQp IHwgc3RhcnRfaHBvcyAoJWQpIHwgZW5kX2hwb3MgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICB2cG9zLCBzdGFydF94LCBzdGFydF9ocG9zLCBlbmRfaHBvcykpOworICAgICAg ICAgICAgbWNfcmVkcmF3X3JvdyAodywgbWF0cml4LCByb3csIHN0YXJ0X3gsIHN0YXJ0X2hwb3Ms IGVuZF9ocG9zLCBjbGVhcl9lb2xfcCwgaGwpOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNl CiAJICBkcmF3X2dseXBocyAodywgc3RhcnRfeCwgcm93LCBhcmVhLAogCQkgICAgICAgc3RhcnQs IGksCiAJCSAgICAgICBEUkFXX05PUk1BTF9URVhULCBvdmVybGFwcyk7CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKIAl9CiAgICAgICBlbHNlCiAJewpAQCAtMjk3NTgsMTAgKzM0MTU5 LDE3IEBAIGRpc3BsYXlfYW5kX3NldF9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgb24s CiAgIG5ld19jdXJzb3JfdHlwZSA9IGdldF93aW5kb3dfY3Vyc29yX3R5cGUgKHcsIGdseXBoLAog CQkJCQkgICAgJm5ld19jdXJzb3Jfd2lkdGgsICZhY3RpdmVfY3Vyc29yKTsKIAorCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogICAvKiBJZiBjdXJz b3IgaXMgY3VycmVudGx5IGJlaW5nIHNob3duIGFuZCB3ZSBkb24ndCB3YW50IGl0IHRvIGJlIG9y CiAgICAgIGl0IGlzIGluIHRoZSB3cm9uZyBwbGFjZSwgb3IgdGhlIGN1cnNvciB0eXBlIGlzIG5v dCB3aGF0IHdlIHdhbnQsCiAgICAgIGVyYXNlIGl0LiAgKi8KICAgaWYgKHctPnBoeXNfY3Vyc29y X29uX3AKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3No YWlycykpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zp c2libGUpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19j b25mKSkKICAgICAgICYmICghb24KIAkgIHx8IHctPnBoeXNfY3Vyc29yLnggIT0geAogCSAgfHwg dy0+cGh5c19jdXJzb3IueSAhPSB5CkBAIC0yOTc3NCw2ICszNDE4Miw5IEBAIGRpc3BsYXlfYW5k X3NldF9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgb24sCiAJICAgICAgJiYgbmV3X2N1 cnNvcl93aWR0aCAhPSB3LT5waHlzX2N1cnNvcl93aWR0aCkpKQogICAgIGVyYXNlX3BoeXNfY3Vy c29yICh3KTsKIAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBEb24ndCBjaGVj ayBwaHlzX2N1cnNvcl9vbl9wIGhlcmUgYmVjYXVzZSB0aGF0IGZsYWcgaXMgb25seSBzZXQKICAg ICAgdG8gZmFsc2UgaW4gc29tZSBjYXNlcyB3aGVyZSB3ZSBrbm93IHRoYXQgdGhlIGN1cnNvciBo YXMgYmVlbgogICAgICBjb21wbGV0ZWx5IGVyYXNlZCwgdG8gYXZvaWQgdGhlIGV4dHJhIHdvcmsg b2YgZXJhc2luZyB0aGUgY3Vyc29yCkBAIC0yOTc5Miw5ICszNDIwMywxOSBAQCBkaXNwbGF5X2Fu ZF9zZXRfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIG9uLAogICAgICAgdy0+cGh5c19j dXJzb3IudnBvcyA9IHZwb3M7CiAgICAgfQogCi0gIEZSQU1FX1JJRiAoZiktPmRyYXdfd2luZG93 X2N1cnNvciAodywgZ2x5cGhfcm93LCB4LCB5LAotICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIG5ld19jdXJzb3JfdHlwZSwgbmV3X2N1cnNvcl93aWR0aCwKLSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBvbiwgYWN0aXZlX2N1cnNvcik7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlmIChOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgJiYgTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICYmIE5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQorICAgIEZSQU1FX1JJRiAo ZiktPmRyYXdfd2luZG93X2N1cnNvciAodywgZ2x5cGhfcm93LCB4LCB5LCBuZXdfY3Vyc29yX3R5 cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfY3Vyc29yX3dp ZHRoLCBvbiwgYWN0aXZlX2N1cnNvcik7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK IH0KIAogCkBAIC0yOTg4Nyw3ICszNDMwOCwyNyBAQCBkcmF3X3Jvd193aXRoX21vdXNlX2ZhY2Ug KHN0cnVjdCB3aW5kb3cgKncsIGludCBzdGFydF94LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCiAj aWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCiAgIGlmIChGUkFNRV9XSU5ET1dfUCAoWEZSQU1FICh3 LT5mcmFtZSkpKQogICAgIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJ UExFLUNVUlNPUlMgKi8KKworICAgICAgaWYgKHctPm1jX2VsdHMudXNlZCA+IDAgfHwgdy0+Y2hf ZWx0cy51c2VkID4gMCB8fCB3LT5mY19lbHRzLnVzZWQgPiAwKQorICAgICAgICB7CisgICAgICAg ICAgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgICAg ICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgICAgICAg ICBib29sIGNsZWFyX2VvbF9wID0gZmFsc2U7CisgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19m YWNlIGhsID0gZHJhdzsKKyAgICAgICAgICBUUkFDRSAoKHN0ZGVyciwgImRyYXdfcm93X3dpdGhf bW91c2VfZmFjZSAoJWQpOiAgc3RhcnRfeCAoJWQpIHwgc3RhcnRfaHBvcyAoJWQpIHwgZW5kX2hw b3MgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdnBvcywgc3RhcnRfeCwgc3Rh cnRfaHBvcywgZW5kX2hwb3MpKTsKKyAgICAgICAgICBtY19yZWRyYXdfcm93ICh3LCBtYXRyaXgs IHJvdywgc3RhcnRfeCwgc3RhcnRfaHBvcywgZW5kX2hwb3MsIGNsZWFyX2VvbF9wLCBobCk7Cisg ICAgICAgIH0KKyAgICAgICAgZWxzZQogICAgICAgZHJhd19nbHlwaHMgKHcsIHN0YXJ0X3gsIHJv dywgVEVYVF9BUkVBLCBzdGFydF9ocG9zLCBlbmRfaHBvcywgZHJhdywgMCk7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgICAgIHJldHVybjsKICAgICB9CiAjZW5kaWYKQEAgLTMx OTQ1LDExICszNjM4NiwzNCBAQCBleHBvc2VfYXJlYSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0 IGdseXBoX3JvdyAqcm93LCBYUmVjdGFuZ2xlICpyLAogICBzdHJ1Y3QgZ2x5cGggKmxhc3Q7CiAg IGludCBmaXJzdF94LCBzdGFydF94LCB4OwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUtQ1VSU09SUyAqLworCiAgIGlmIChhcmVhID09IFRFWFRfQVJFQSAmJiByb3ct PmZpbGxfbGluZV9wKQorICAgIHsKKyAgICAgIGlmICh3LT5tY19lbHRzLnVzZWQgPiAwIHx8IHct PmNoX2VsdHMudXNlZCA+IDAgfHwgdy0+ZmNfZWx0cy51c2VkID4gMCkKKyAgICAgICAgeworICAg ICAgICAgIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4Owor ICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgICAg ICAgICAgaW50IHN0YXJ0X3ggPSAwOworICAgICAgICAgIGludCBzdGFydF9ocG9zID0gMDsKKyAg ICAgICAgICBpbnQgZW5kX2hwb3MgPSByb3ctPnVzZWRbVEVYVF9BUkVBXTsKKyAgICAgICAgICBi b29sIGNsZWFyX2VvbF9wID0gZmFsc2U7CisgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNl IGhsID0gRFJBV19OT1JNQUxfVEVYVDsKKyAgICAgICAgICBUUkFDRSAoKHN0ZGVyciwgImV4cG9z ZV9hcmVhICglZCk6ICBXcml0ZSB0aGUgd2hvbGUgbGluZS5cbiIsIHZwb3MpKTsKKyAgICAgICAg ICBtY19yZWRyYXdfcm93ICh3LCBtYXRyaXgsIHJvdywgc3RhcnRfeCwgc3RhcnRfaHBvcywgZW5k X2hwb3MsIGNsZWFyX2VvbF9wLCBobCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQogICAgIC8q IElmIHJvdyBleHRlbmRzIGZhY2UgdG8gZW5kIG9mIGxpbmUgd3JpdGUgdGhlIHdob2xlIGxpbmUu ICAqLwogICAgIGRyYXdfZ2x5cGhzICh3LCAwLCByb3csIGFyZWEsCiAJCSAwLCByb3ctPnVzZWRb YXJlYV0sCiAJCSBEUkFXX05PUk1BTF9URVhULCAwKTsKKyAgICB9CisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKICAgZWxzZQogICAgIHsKICAgICAgIC8qIFNldCBTVEFSVF9YIHRvIHRo ZSB3aW5kb3ctcmVsYXRpdmUgc3RhcnQgcG9zaXRpb24gZm9yIGRyYXdpbmcgZ2x5cGhzIG9mCkBA IC0zMTk4MSwxMSArMzY0NDUsMzQgQEAgZXhwb3NlX2FyZWEgKHN0cnVjdCB3aW5kb3cgKncsIHN0 cnVjdCBnbHlwaF9yb3cgKnJvdywgWFJlY3RhbmdsZSAqciwKIAkgICsrbGFzdDsKIAl9CiAKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgICAg IC8qIFJlcGFpbnQuICAqLwotICAgICAgaWYgKGxhc3QgPiBmaXJzdCkKKyAgICAgIC8qIEZsb2F0 aW5nIGZha2UgY3Vyc29ycyB3aWxsIGV4aXN0IHdoZW4gKGxhc3QgPT0gZmlyc3QpLiAqLworICAg ICAgaWYgKCh3LT5tY19lbHRzLnVzZWQgPiAwIHx8IHctPmNoX2VsdHMudXNlZCA+IDAgfHwgdy0+ ZmNfZWx0cy51c2VkID4gMCkKKyAgICAgICAgICAmJiBhcmVhID09IFRFWFRfQVJFQSkKKyAgICAg ICAgeworICAgICAgICAgIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRf bWF0cml4OworICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJp eCk7CisgICAgICAgICAgc3RhcnRfeCA9IGZpcnN0X3ggLSBzdGFydF94OworICAgICAgICAgIGlu dCBzdGFydF9ocG9zID0gZmlyc3QgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAg IGludCBlbmRfaHBvcyA9IGxhc3QgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAg IGJvb2wgY2xlYXJfZW9sX3AgPSBmYWxzZTsKKyAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2Zh Y2UgaGwgPSBEUkFXX05PUk1BTF9URVhUOworICAgICAgICAgIFRSQUNFICgoc3RkZXJyLCAiZXhw b3NlX2FyZWEgKCVkKTogIHN0YXJ0X3ggKCVkKSB8IHN0YXJ0X2hwb3MgKCVkKSB8IGVuZF9ocG9z ICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHZwb3MsIHN0YXJ0X3gsIHN0YXJ0 X2hwb3MsIGVuZF9ocG9zKSk7CisgICAgICAgICAgbWNfcmVkcmF3X3JvdyAodywgbWF0cml4LCBy b3csIHN0YXJ0X3gsIHN0YXJ0X2hwb3MsIGVuZF9ocG9zLCBjbGVhcl9lb2xfcCwgaGwpOworICAg ICAgICB9CisgICAgICAgIGVsc2UgaWYgKGxhc3QgPiBmaXJzdCkKIAlkcmF3X2dseXBocyAodywg Zmlyc3RfeCAtIHN0YXJ0X3gsIHJvdywgYXJlYSwKIAkJICAgICBmaXJzdCAtIHJvdy0+Z2x5cGhz W2FyZWFdLCBsYXN0IC0gcm93LT5nbHlwaHNbYXJlYV0sCiAJCSAgICAgRFJBV19OT1JNQUxfVEVY VCwgMCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICB9CiB9CiAKQEAgLTMx OTk5LDEwICszNjQ4NiwzMyBAQCBleHBvc2VfbGluZSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0 IGdseXBoX3JvdyAqcm93LCBYUmVjdGFuZ2xlICpyKQogewogICBlYXNzZXJ0IChyb3ctPmVuYWJs ZWRfcCk7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JT ICovCisKICAgaWYgKHJvdy0+bW9kZV9saW5lX3AgfHwgdy0+cHNldWRvX3dpbmRvd19wKQorICAg IHsKKyAgICAgIGlmICh3LT5tY19lbHRzLnVzZWQgPiAwIHx8IHctPmNoX2VsdHMudXNlZCA+IDAg fHwgdy0+ZmNfZWx0cy51c2VkID4gMCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBnbHlw aF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworICAgICAgICAgIGludCB2cG9z ID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgICAgICAgICAgaW50IHN0YXJ0X3gg PSAwOworICAgICAgICAgIGludCBzdGFydF9ocG9zID0gMDsKKyAgICAgICAgICBpbnQgZW5kX2hw b3MgPSByb3ctPnVzZWRbVEVYVF9BUkVBXTsKKyAgICAgICAgICBib29sIGNsZWFyX2VvbF9wID0g ZmFsc2U7CisgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIGhsID0gRFJBV19OT1JNQUxf VEVYVDsKKyAgICAgICAgICBUUkFDRSAoKHN0ZGVyciwgImV4cG9zZV9saW5lICglZCk6ICBXcml0 ZSB0aGUgd2hvbGUgbGluZS5cbiIsIHZwb3MpKTsKKyAgICAgICAgICBtY19yZWRyYXdfcm93ICh3 LCBtYXRyaXgsIHJvdywgc3RhcnRfeCwgc3RhcnRfaHBvcywgZW5kX2hwb3MsIGNsZWFyX2VvbF9w LCBobCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQogICAgIGRyYXdfZ2x5cGhzICh3LCAwLCBy b3csIFRFWFRfQVJFQSwKIAkJIDAsIHJvdy0+dXNlZFtURVhUX0FSRUFdLAogCQkgRFJBV19OT1JN QUxfVEVYVCwgMCk7CisgICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIGVs c2UKICAgICB7CiAgICAgICBpZiAocm93LT51c2VkW0xFRlRfTUFSR0lOX0FSRUFdKQpAQCAtMzI1 NTAsNiArMzcwNjAsMjIgQEAgeF9pbnRlcnNlY3RfcmVjdGFuZ2xlcyAoWFJlY3RhbmdsZSAqcjEs IFhSZWN0YW5nbGUgKnIyLCBYUmVjdGFuZ2xlICpyZXN1bHQpCiB2b2lkCiBzeW1zX29mX3hkaXNw ICh2b2lkKQogeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VS U09SUyAqLworCisgIGRlZnN1YnIgKCZTbWNfZHVtcF9nbHlwaF9yb3cpOworCisgIGRlZnN1YnIg KCZTbWNfZHVtcF9nbHlwaF9tYXRyaXgpOworCisgIGRlZnN1YnIgKCZTbWNfY3VycmVudF9jb2x1 bW4pOworCisgIGRlZnN1YnIgKCZTbWNfc3RkZXJyKTsKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogICBWd2l0aF9lY2hvX2FyZWFfc2F2ZV92ZWN0b3IgPSBRbmlsOwogICBzdGF0aWNw cm8gKCZWd2l0aF9lY2hvX2FyZWFfc2F2ZV92ZWN0b3IpOwogCmRpZmYgLS1naXQgYS9zcmMveHRl cm0uYyBiL3NyYy94dGVybS5jCmluZGV4IDVhYTNlM2YuLjk1M2ExMDQgMTAwNjQ0Ci0tLSBhL3Ny Yy94dGVybS5jCisrKyBiL3NyYy94dGVybS5jCkBAIC0xMzIsNiArMTMyLDg2OSBAQCBhbG9uZyB3 aXRoIEdOVSBFbWFjcy4gIElmIG5vdCwgc2VlIDxodHRwczovL3d3dy5nbnUub3JnL2xpY2Vuc2Vz Lz4uICAqLwogI2luY2x1ZGUgPFgxMS9YS0JsaWIuaD4KICNlbmRpZgogCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCisjaWZkZWYgR0xZ UEhfREVCVUcKK3N0YXRpYyB2b2lkIHhfY2hlY2tfZ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jlc2V0X2NsaXBfcmVjdGFuZ2xlcyAo ZiwgZ2MpOworICAgIH0KK30KKworLyogUklGOiBEcmF3IGN1cnNvciBvbiB3aW5kb3cgVy4gKi8K K3N0YXRpYyB2b2lkCittY194X2RyYXdfd2luZG93X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywg c3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAg ICAgICAgICAgICAgICAgICAgICAgaW50IHgsIGludCBmeCwgaW50IHksIGludCBmeSwgaW50IGhw b3MsIGludCB2cG9zLCBpbnQgd2QsIGludCBoLAorICAgICAgICAgICAgICAgICAgICAgICAgIHN0 cnVjdCBtY19SR0IgbHNsLCBlbnVtIHR5cGVfb2ZfY3Vyc29yIGN1cnNvcl90eXBlLCBpbnQgY3Vy c29yX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBo X2ZsYXZvciwgYm9vbCBvbl9wLCBib29sIGFjdGl2ZV9wKQoreworICBzdHJ1Y3QgZnJhbWUgKmYg PSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworICAvKiBUaGUgZnJpbmdlIGJpdG1hcHMgYXJl IHByZXNlbnRseSBoYW5kbGVkIGVsc2V3aGVyZSwgYnV0IGNvdWxkIHNvbWVkYXkKKyAgYmUgbWFu YWdlZCAoaW4gcGFydCkgYXQgdGhpcyBzZWN0aW9uIG9mIGNvZGUuICovCisgIGlmIChvbl9wKQor ICAgIHsKKyAgICAgIGlmIChyb3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5lX3AKKyAgICAgICAg ICAmJiAocm93LT5yZXZlcnNlZF9wCisgICAgICAgICAgICAgID8gKGhwb3MgPCAwKQorICAgICAg ICAgICAgICA6IChocG9zID49IHJvdy0+dXNlZFtURVhUX0FSRUFdKSkpCisgICAgICAgIHsKKyAg ICAgICAgICByb3ctPmN1cnNvcl9pbl9mcmluZ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kdFX0JJVE1BUDoK KyAgICAgIGJyZWFrOworICAgIGNhc2UgTUNfTk9fQ1VSU09SOgorICAgICAgYnJlYWs7CisgICAg Y2FzZSBNQ19SSUdIVF9GUklOR0VfQklUTUFQOgorICAgICAgYnJlYWs7CisgICAgY2FzZSBNQ19M RUZUX0ZSSU5HRV9CSVRNQVA6CisgICAgICBicmVhazsKKyAgICBjYXNlIE1DX0ZSQU1FRF9CT1g6 CisgICAgeworICAgICAgc3RydWN0IGdseXBoICpjdXJzb3JfZ2x5cGggPSBtY19nZXRfY3Vyc29y X2dseXBoICh3LCBtYXRyaXgsIHJvdywgaHBvcywgdnBvcyk7CisgICAgICBpZiAoY3Vyc29yX2ds eXBoID09IE5VTEwpCisgICAgICAgIHJldHVybjsKKyAgICAgIExpc3BfT2JqZWN0IGJ1ZiA9IHct PmNvbnRlbnRzOworICAgICAgQ0hFQ0tfQlVGRkVSIChidWYpOworICAgICAgc3RydWN0IGJ1ZmZl ciAqYiA9IFhCVUZGRVIgKGJ1Zik7CisgICAgICBib29sIHJlZ2lvbl9hY3RpdmVfcCA9ICghTklM UCAoVnRyYW5zaWVudF9tYXJrX21vZGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiAhTklMUCAoQlZBUiAoYiwgbWFya19hY3RpdmUpKSk7CisgICAgICBwdHJkaWZmX3QgcmVnaW9u X2JlZ2lubmluZyA9IChyZWdpb25fYWN0aXZlX3ApID8gWEZJWE5VTSAoRnJlZ2lvbl9iZWdpbm5p bmcgKCkpIDogLTE7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2VuZCA9IChyZWdpb25fYWN0aXZl X3ApID8gWEZJWE5VTSAoRnJlZ2lvbl9lbmQgKCkpIDogLTE7CisgICAgICBwdHJkaWZmX3Qgb3Bv aW50X3B0ID0gKHcgPT0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93KSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IFBUCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBYRklYTlVN IChGbWFya2VyX3Bvc2l0aW9uICh3LT5wb2ludG0pKTsKKyAgICAgIGJvb2wgcmVnaW9uX2luX2Jv dW5kc19wID0gKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgb3BvaW50X3B0ID49IHJlZ2lvbl9iZWdpbm5pbmcKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIG9wb2ludF9wdCA8IHJlZ2lvbl9lbmQpOworICAgICAgaWYgKGN1cnNv cl9nbHlwaC0+dHlwZSAhPSBJTUFHRV9HTFlQSCAmJiBsc2wucmVkID49IDAgJiYgbHNsLmdyZWVu ID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFy aWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djJyBieSBib3Jyb3dpbmcgdGhl CisgICAgICAgICAgZnVuY3Rpb25hbGl0eSBvZiBgeF9tYWtlX2djJyBpbiB4Zm5zLmMuICAqLwor ICAgICAgICAgIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgJiYgcmVnaW9uX2lu X2JvdW5kc19wCisgICAgICAgICAgICAgICYmIGFjdGl2ZV9wKQorICAgICAgICAgICAgeworICAg ICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9yZWdpb25fZmFjZV9pZCA9IGxv b2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItcmVnaW9u LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZl X3JlZ2lvbl9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9mYWNl X2lkKTsKKyAgICAgICAgICA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XRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxv d19hY3RpdmVfZmFjZS0+Zm9yZWdyb3VuZCk7CisgICAgICAgICAgICAgICAgICBYU2V0QmFja2dy b3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBo b2xsb3dfYWN0aXZlX2ZhY2UtPmJhY2tncm91bmQpOworICAgICAgICAgICAgICAgIH0KKyAgICAg ICAgICAgICAgICAvKiBUaGUgcmVnaW9uIGlzIF9ub3RfIHZpc2libGUgaW4gdGhlIGluYWN0aXZl IHdpbmRvdyBiZWNhdXNlIHRoZSBvdmVybGF5IHdpbmRvdyBwcm9wZXJ0eSBpcyB1c2VkLiAqLwor ICAgICAgICAgICAgICAgIGVsc2UgaWYgKCFhY3RpdmVfcCkKKyAgICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lk ID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1p bmFjdGl2ZS1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAq aG9sbG93X2luYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19pbmFjdGl2ZV9m YWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElT UExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2luYWN0aXZlX2Zh Y2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJB TUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfaW5h Y3RpdmVfZ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ZWwgPSBvcmlnaW5hbF9jdXJz b3JfcGl4ZWw7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoY3Vyc29yX2dseXBoLT50eXBl ID09IElNQUdFX0dMWVBIICYmIGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wu Ymx1ZSA+PSAwKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFj ayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgICAgICBmLT5v dXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBjb2xvci5waXhlbDsKKyAgICAgICAgICAgIG1j X3hfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9z LCB2cG9zLCB3ZCwgaCk7CisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4 ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5v dXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MnIGJ5IGJvcnJvd2luZyB0aGUKKyAgICAgICAgICAgICAg ZnVuY3Rpb25hbGl0eSBvZiBgeF9tYWtlX2djJyBpbiB4Zm5zLmMuICAqLworICAgICAgICAgICAg ICBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAmJiByZWdpb25faW5fYm91 bmRzX3AKKyAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9wKQorICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9mYWNl X2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNv ci1yZWdpb24tZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpo b2xsb3dfYWN0aXZlX3JlZ2lvbl9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZl X3JlZ2lvbl9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3df YWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFs LWZha2UtY3Vyc29yLWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFj ZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2Zh Y2VfaWQpOworICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExB WSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9mYWNlLT5m b3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgIFhTZXRCYWNrZ3JvdW5kIChGUkFNRV9YX0RJ U1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19hY3RpdmVfcmVn aW9uX2ZhY2UtPmJhY2tncm91bmQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAg ICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiAh cmVnaW9uX2luX2JvdW5kc19wCisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYWN0aXZlX3Ap CisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBo b2xs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bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfZmFj ZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJz b3ItZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9s bG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQp OworICAgICAgICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkg KGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19hY3RpdmVfZmFjZS0+Zm9y ZWdyb3VuZCk7CisgICAgICAgICAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hf RElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9m YWNlLT5iYWNrZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAg ICAgICAvKiBUaGUgcmVnaW9uIGlzIF9ub3RfIHZpc2libGUgaW4gdGhlIGluYWN0aXZlIHdpbmRv dyBiZWNhdXNlIHRoZSBvdmVybGF5IHdpbmRvdyBwcm9wZXJ0eSBpcyB1c2VkLiAqLworICAgICAg ICAgICAgICAgICAgICBlbHNlIGlmICghYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9m YWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1 cnNvci1pbmFjdGl2ZS1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgc3Ry dWN0IGZhY2UgKmhvbGxvd19pbmFjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3df aW5hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3Vu ZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xs b3dfaW5hY3RpdmVfZmFjZS0+Zm9yZWdyb3VuZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBY U2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vy c29yX2djLCBob2xsb3dfaW5hY3RpdmVfZmFjZS0+YmFja2dyb3VuZCk7CisgICAgICAgICAgICAg ICAgICAgICAgfQorICAgICAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAg LyogRm9yY2UgYG1jX3hfc2V0X2N1cnNvcl9nYycgdG8gdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS54 LT5jdXJzb3JfZ2MnLiAgKi8KKyAgICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IHRydWU7 CisgICAgICAgICAgICAgIG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywgRFJB V19DVVJTT1IsIHgsIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBsc2wsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICAg ICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngt PmN1cnNvcl9nYywgeGdjdi5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgWFNldEJhY2tncm91 bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgeGdj di5iYWNrZ3JvdW5kKTsKKyAgICAgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAg ICAgICAgLyogRHJhdyB0aGUgZnJhbWUgYXJvdW5kIHRoZSBib3guICovCisgICAgICAgICAgICAg IG1jX3hfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBo cG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9Cisg ICAgY2FzZSBNQ19IT0xMT1dfQk9YOgorICAgIHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYg bHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8q IFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsJy4gICov CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gY29sb3IucGl4ZWw7 CisgICAgICAgICAgbWNfeF9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBm eCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54 LT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgIH0KKyAgICAg ICAgZWxzZQorICAgICAgICAgIG1jX3hfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBtYXRyaXgsIHJv dywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICBicmVhazsKKyAgICB9 CisgICAgY2FzZSBNQ19GSUxMRURfQk9YOgorICAgIHsKKyAgICAgIGl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0gb3Jp Z2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7 CisgICAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7Cisg ICAgICAgICAgICBtY194X2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5 LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsIGN1cnNvcl93aWR0aCwgTUNfQkFSLCBjdXJzb3JfZ2Nf aW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAg IGNhc2UgTUNfSEJBUjoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVl biA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3Jh cmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCcuICAqLworICAgICAg ICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IGNvbG9yLnBpeGVsOworICAgICAg ICAgIGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSB0cnVlOworICAgICAgICAgIG1j X3hfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2 cG9zLCB3ZCwgaCwgY3Vyc29yX3dpZHRoLCBNQ19IQkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29r YXlfcCk7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2lu YWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7Cisg ICAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7Cis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ZF93aWR0aDsKKyAgICAgIGludCB4ID0gcy0+eDsKKyAg ICAgIGlmICghcy0+cm93LT5yZXZlcnNlZF9wKQorICB7CisgICAgaW50IGxlZnRfeCA9IHdpbmRv d19ib3hfbGVmdF9vZmZzZXQgKHMtPncsIFRFWFRfQVJFQSk7CisgICAgaWYgKHggPCBsZWZ0X3gp CisgICAgICB7CisgICAgICAgIGJhY2tncm91bmRfd2lkdGggLT0gbGVmdF94IC0geDsKKyAgICAg ICAgeCA9IGxlZnRfeDsKKyAgICAgIH0KKyAgfQorICAgICAgZWxzZQorICB7CisgICAgLyogSW4g UjJMIHJvd3MsIGRyYXcgdGhlIGN1cnNvciBvbiB0aGUgcmlnaHQgZWRnZSBvZiB0aGUKKyAgICAg ICBzdHJldGNoIGdseXBoLiAgKi8KKyAgICBpbnQgcmlnaHRfeCA9IHdpbmRvd19ib3hfcmlnaHQg KHMtPncsIFRFWFRfQVJFQSk7CisgICAgaWYgKHggKyBiYWNrZ3JvdW5kX3dpZHRoID4gcmlnaHRf eCkKKyAgICAgIGJhY2tncm91bmRfd2lkdGggLT0geCAtIHJpZ2h0X3g7CisgICAgeCArPSBiYWNr Z3JvdW5kX3dpZHRoOworICB9CisgICAgICB3aWR0aCA9IG1pbiAoRlJBTUVfQ09MVU1OX1dJRFRI IChzLT5mKSwgYmFja2dyb3VuZF93aWR0aCk7CisgICAgICBpZiAocy0+cm93LT5yZXZlcnNlZF9w KQorICB4IC09IHdpZHRoOworICAgICAgLyogRHJhdyBjdXJzb3IuICAqLworICAgICAgeF9kcmF3 X2dseXBoX3N0cmluZ19iZ19yZWN0IChzLCB4LCBzLT55LCB3aWR0aCwgcy0+aGVpZ2h0KTsKKyAg ICAgIC8qIENsZWFyIHJlc3QgdXNpbmcgdGhlIEdDIG9mIHRoZSBvcmlnaW5hbCBub24tY3Vyc29y IGZhY2UuICAqLworICAgICAgaWYgKHdpZHRoIDwgYmFja2dyb3VuZF93aWR0aCkKKyAgeworICAg IGludCB5ID0gc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nR5cGUgIT0gSU1BR0VfR0xZUEgpCisg ICAgICAgICAgeworICAgICAgICAgICAgbWNfeF9zZXRfZ2x5cGhfc3RyaW5nX2djIChuZXh0LCBj dXJzb3JfZ2NfcCk7CisgICAgICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmcgKG5l eHQpOworICAgICAgICAgICAgaWYgKG5leHQtPmZpcnN0X2dseXBoLT50eXBlID09IFNUUkVUQ0hf R0xZUEgpCisgICAgICAgICAgICAgIG1jX3hfZHJhd19zdHJldGNoX2dseXBoX3N0cmluZyAobmV4 dCk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdf YmFja2dyb3VuZCAobmV4dCwgdHJ1ZSk7CisgICAgICAgICAgICBuZXh0LT5udW1fY2xpcHMgPSAw OworICAgICAgICAgIH0KKyAgICB9CisgIC8qIFNldCB1cCBTLT5nYywgc2V0IGNsaXBwaW5nIGFu ZCBkcmF3IFMuICAqLworICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKHMsIGN1cnNvcl9nY19w KTsKKyAgLyogRHJhdyByZWxpZWYgKGlmIGFueSkgaW4gYWR2YW5jZSBmb3IgY2hhci9jb21wb3Np dGlvbiBzbyB0aGF0IHRoZQorICAgICBnbHlwaCBzdHJpbmcgY2FuIGJlIGRyYXduIG92ZXIgaXQu ICAqLworICBpZiAoIXMtPmZvcl9vdmVybGFwcworICAgICAgJiYgcy0+ZmFjZS0+Ym94ICE9IEZB Q0VfTk9fQk9YCisgICAgICAmJiAocy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAor ICAgIHx8IHMtPmZpcnN0X2dseXBoLT50eXBlID09IENPTVBPU0lURV9HTFlQSCkpCisgICAgewor ICAgICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nIChzKTsKKyAgICAgIHhfZHJhd19nbHlw aF9zdHJpbmdfYmFja2dyb3VuZC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ICAgIGJyZWFrOworICAgIGNh c2UgU1RSRVRDSF9HTFlQSDoKKyAgICAgIG1jX3hfZHJhd19zdHJldGNoX2dseXBoX3N0cmluZyAo cyk7CisgICAgICBicmVhazsKKyAgICBjYXNlIENIQVJfR0xZUEg6CisgICAgICBpZiAocy0+Zm9y X292ZXJsYXBzKQorICBzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wID0gdHJ1ZTsKKyAgICAgIGVsc2UK KyAgeF9kcmF3X2dseXBoX3N0cmluZ19iYWNrZ3JvdW5kIChzLCBmYWxzZSk7CisgICAgICB4X2Ry YXdfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHMpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBD T01QT1NJVEVfR0xZUEg6CisgICAgICBpZiAocy0+Zm9yX292ZXJsYXBzIHx8IChzLT5jbXBfZnJv bSA+IDAKKyAgICAgICAgICAgICYmICEgcy0+Zmlyc3RfZ2x5cGgtPnUuY21wLmF1dG9tYXRpYykp CisgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVlOworICAgICAgZWxzZQorICB4X2RyYXdf Z2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKHMsIHRydWUpOworICAgICAgeF9kcmF3X2NvbXBvc2l0 ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAgICBicmVhazsKKyAgICBjYXNlIEdM WVBITEVTU19HTFlQSDoKKyAgICAgIGlmIChzLT5mb3Jfb3ZlcmxhcHMpCisgIHMtPmJhY2tncm91 bmRfZmlsbGVkX3AgPSB0cnVlOworICAgICAgZWxzZQorICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2Jh Y2tncm91bmQgKHMsIHRydWUpOworICAgICAgeF9kcmF3X2dseXBobGVzc19nbHlwaF9zdHJpbmdf Zm9yZWdyb3VuZCAocyk7CisgICAgICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAgZW1hY3Nf YWJvcnQgKCk7CisgICAgfQorICBpZiAoIXMtPmZvcl9vdmVybGFwcykKKyAgICB7CisgICAgICAv KiBEcmF3IHVuZGVybGluZS4gICovCisgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3ApCisg ICAgICAgIHsKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9V TkRFUl9XQVZFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAocy0+ZmFjZS0+dW5k ZXJsaW5lX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgICAgIHhfZHJhd191bmRlcndhdmUgKHMp OworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg ICAgWEdDVmFsdWVzIHhnY3Y7CisgICAgICAgICAgICAgICAgICBYR2V0R0NWYWx1ZXMgKHMtPmRp c3BsYXksIHMtPmdjLCBHQ0ZvcmVncm91bmQsICZ4Z2N2KTsKKyAgICAgICAgICAgICAgICAgIFhT ZXRGb3JlZ3JvdW5kIChzLT5kaXNwbGF5LCBzLT5nYywgcy0+ZmFjZS0+dW5kZXJsaW5lX2NvbG9y KTsKKyAgICAgICAgICAgICAgICAgIHhfZHJhd191bmRlcndhdmUgKHMpOworICAgICAgICAgICAg ICAgICAgWFNldEZvcmVncm91bmQgKHMtPmRpc3BsYXksIHMtPmdjLCB4Z2N2LmZvcmVncm91bmQp OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmIChz LT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgICB7 CisgICAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgdGhpY2tuZXNzLCBwb3NpdGlvbjsKKyAgICAg ICAgICAgICAgaW50IHk7CisgICAgICAgICAgICAgIGlmIChzLT5wcmV2ICYmIHMtPnByZXYtPmZh Y2UtPnVuZGVybGluZV9wCisgICAgICAmJiBzLT5wcmV2LT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9 PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg LyogV2UgdXNlIHRoZSBzYW1lIHVuZGVybGluZSBzdHlsZSBhcyB0aGUgcHJldmlvdXMgb25lLiAg Ki8KKyAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPnByZXYtPnVuZGVybGluZV90aGlj a25lc3M7CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPnByZXYtPnVuZGVybGluZV9w b3NpdGlvbjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVybGluZSB0aGlja25l c3MuICBEZWZhdWx0IGlzIDEgcGl4ZWwuICAqLworICAgICAgICAgICAgICAgICAgaWYgKHMtPmZv bnQgJiYgcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzcyA+IDApCisgICAgICAgICAgICAgICAg ICAgIHRoaWNrbmVzcyA9IHMtPmZvbnQtPnVuZGVybGluZV90aGlja25lc3M7CisgICAgICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IDE7CisgICAgICAg ICAgICAgICAgICBpZiAoeF91bmRlcmxpbmVfYXRfZGVzY2VudF9saW5lKQorICAgICAgICAgICAg ICAgICAgICBwb3NpdGlvbiA9IChzLT5oZWlnaHQgLSB0aGlja25lc3MpIC0gKHMtPnliYXNlIC0g cy0+eSk7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVybGluZSBwb3NpdGlvbi4gIFRoaXMg aXMgdGhlIHJlY29tbWVuZGVkCisgICAgICAgICAgICAgICAgICAgICAgICAgdmVydGljYWwgb2Zm c2V0IGluIHBpeGVscyBmcm9tIHRoZSBiYXNlbGluZSB0byB0aGUgdG9wIG9mCisgICAgICAgICAg ICAgICAgICAgICAgICAgdGhlIHVuZGVybGluZS4gIFRoaXMgaXMgYSBzaWduZWQgdmFsdWUgYWNj b3JkaW5nIHRvIHRoZQorICAgICAgICAgICAgICAgICAgICAgICAgIHNwZWNzLCBhbmQgaXRzIGRl ZmF1bHQgaXMKKyAgICAgICAgICAgICAgICAgICAgICAgICBST1VORCAoKG1heGltdW0gZGVzY2Vu dCkgLyAyKSwgd2l0aAorICAgICAgICAgICAgICAgICAgICAgICAgIFJPVU5EKHgpID0gZmxvb3Ig KHggKyAwLjUpICAqLworICAgICAgICAgICAgICAgICAgICAgIGlmICh4X3VzZV91bmRlcmxpbmVf cG9zaXRpb25fcHJvcGVydGllcworICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBzLT5mb250 ICYmIHMtPmZvbnQtPnVuZGVybGluZV9wb3NpdGlvbiA+PSAwKQorICAgICAgICAgICAgICAgICAg ICAgICAgcG9zaXRpb24gPSBzLT5mb250LT51bmRlcmxpbmVfcG9zaXRpb247CisgICAgICAgICAg ICAgICAgICAgICAgZWxzZSBpZiAocy0+Zm9udCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHBv c2l0aW9uID0gKHMtPmZvbnQtPmRlc2NlbnQgKyAxKSAvIDI7CisgICAgICAgICAgICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSB1bmRlcmxpbmVfbWlu aW11bV9vZmZzZXQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIHBv c2l0aW9uID0gbWF4IChwb3NpdGlvbiwgdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0KTsKKyAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICAgIC8qIENoZWNrIHRoZSBzYW5pdHkgb2YgdGhpY2tu ZXNzIGFuZCBwb3NpdGlvbi4gIFdlIHNob3VsZAorICAgICAgICAgICAgICAgICBhdm9pZCBkcmF3 aW5nIHVuZGVybGluZSBvdXQgb2YgdGhlIGN1cnJlbnQgbGluZSBhcmVhLiAgKi8KKyAgICAgICAg ICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQgPD0gcy0+eWJhc2UgKyBwb3NpdGlvbikKKyAgICAg ICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5oZWlnaHQgLSAxKSAtIChzLT55YmFzZSAtIHMtPnkp OworICAgICAgICAgICAgICBpZiAocy0+eSArIHMtPmhlaWdodCA8IHMtPnliYXNlICsgcG9zaXRp b24gKyB0aGlja25lc3MpCisgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gKHMtPnkgKyBzLT5o ZWlnaHQpIC0gKHMtPnliYXNlICsgcG9zaXRpb24pOworICAgICAgICAgICAgICBzLT51bmRlcmxp bmVfdGhpY2tuZXNzID0gdGhpY2tuZXNzOworICAgICAgICAgICAgICBzLT51bmRlcmxpbmVfcG9z aXRpb24gPSBwb3NpdGlvbjsKKyAgICAgICAgICAgICAgeSA9IHMtPnliYXNlICsgcG9zaXRpb247 CisgICAgICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3ApCisgICAg ICAgICAgICAgICAgeF9maWxsX3JlY3RhbmdsZSAocy0+Ziwgcy0+Z2MsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHMtPngsIHksIHMtPndpZHRoLCB0aGlja25lc3MpOworICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgWEdDVmFs dWVzIHhnY3Y7CisgICAgICAgICAgICAgICAgICBYR2V0R0NWYWx1ZXMgKHMtPmRpc3BsYXksIHMt PmdjLCBHQ0ZvcmVncm91bmQsICZ4Z2N2KTsKKyAgICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3Jv dW5kIChzLT5kaXNwbGF5LCBzLT5nYywgcy0+ZmFjZS0+dW5kZXJsaW5lX2NvbG9yKTsKKyAgICAg ICAgICAgICAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHMtPngsIHksIHMtPndpZHRoLCB0aGlja25lc3MpOworICAg ICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKHMtPmRpc3BsYXksIHMtPmdjLCB4Z2N2LmZv cmVncm91bmQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQor ICAgICAgLyogRHJhdyBvdmVybGluZS4gICovCisgICAgICBpZiAocy0+ZmFjZS0+b3ZlcmxpbmVf cCkKKyAgeworICAgIHVuc2lnbmVkIGxvbmcgZHkgPSAwLCBoID0gMTsKKyAgICBpZiAocy0+ZmFj ZS0+b3ZlcmxpbmVfY29sb3JfZGVmYXVsdGVkX3ApCisgICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChz LT5mLCBzLT5nYywgcy0+eCwgcy0+eSArIGR5LAorICAgICAgICAgIHMtPndpZHRoLCBoKTsKKyAg ICBlbHNlCisgICAgICB7CisgICAgICAgIFhHQ1ZhbHVlcyB4Z2N2OworICAgICAgICBYR2V0R0NW YWx1ZXMgKHMtPmRpc3BsYXksIHMtPmdjLCBHQ0ZvcmVncm91bmQsICZ4Z2N2KTsKKyAgICAgICAg WFNldEZvcmVncm91bmQgKHMtPmRpc3BsYXksIHMtPmdjLCBzLT5mYWNlLT5vdmVybGluZV9jb2xv cik7CisgICAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCBzLT55ICsg ZHksCisgICAgICAgICAgICBzLT53aWR0aCwgaCk7CisgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChz LT5kaXNwbGF5LCBzLT5nYywgeGdjdi5mb3JlZ3JvdW5kKTsKKyAgICAgIH0KKyAgfQorICAgICAg LyogRHJhdyBzdHJpa2U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2OyBwcmV2ID0gcHJldi0+ cHJldikKKyAgICAgIGlmIChwcmV2LT5obCAhPSBzLT5obAorICAgICYmIHByZXYtPnggKyBwcmV2 LT53aWR0aCArIHByZXYtPnJpZ2h0X292ZXJoYW5nID4gcy0+eCkKKyAgICAgICAgeworICAgIC8q IEFzIHByZXYgd2FzIGRyYXduIHdoaWxlIGNsaXBwZWQgdG8gaXRzIG93biBhcmVhLCB3ZQorICAg ICAgIG11c3QgZHJhdyB0aGUgcmlnaHRfb3ZlcmhhbmcgcGFydCB1c2luZyBzLT5obCBub3cuICAq LworICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBzYXZlID0gcHJldi0+aGw7CisgICAgcHJldi0+ aGwgPSBzLT5obDsKKyAgICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKHByZXYsIGN1cnNvcl9n Y19wKTsKKyAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywgcHJldik7 CisgICAgaWYgKHByZXYtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgpCisgICAgICB4 X2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHByZXYpOworICAgIGVsc2UKKyAgICAgIHhf ZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHByZXYpOworICAgIHhfcmVz ZXRfY2xpcF9yZWN0YW5nbGVzIChwcmV2LT5mLCBwcmV2LT5nYyk7CisgICAgcHJldi0+aGwgPSBz YXZlOworICAgIHByZXYtPm51bV9jbGlwcyA9IDA7CisgICAgICAgIH0KKyAgfQorICAgICAgaWYg KHMtPm5leHQpCisgIHsKKyAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpuZXh0OworICAgIGZvciAo bmV4dCA9IHMtPm5leHQ7IG5leHQ7IG5leHQgPSBuZXh0LT5uZXh0KQorICAgICAgaWYgKG5leHQt PmhsICE9IHMtPmhsCisgICAgJiYgbmV4dC0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qKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogLyogRGVmYXVsdCB0 byB1c2luZyBYSU0gaWYgYXZhaWxhYmxlLiAgKi8KICNpZmRlZiBVU0VfWElNCiBib29sIHVzZV94 aW0gPSB0cnVlOwpAQCAtOTk5LDYgKzE4NjIsMTUgQEAgeF91cGRhdGVfYmVnaW4gKHN0cnVjdCBm cmFtZSAqZikKICAgaWYgKEZSQU1FX1RPT0xUSVBfUCAoZikgJiYgIUZSQU1FX1ZJU0lCTEVfUCAo ZikpCiAgICAgcmV0dXJuOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQ TEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gZjsKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogICBpZiAoISBGUkFNRV9DUl9TVVJGQUNFIChmKSkKICAgICB7 CiAgICAgICBpbnQgd2lkdGgsIGhlaWdodDsKQEAgLTEyNjYsNiArMjEzOCwxNiBAQCB4X3VwZGF0 ZV9lbmQgKHN0cnVjdCBmcmFtZSAqZikKICAgWEZsdXNoIChGUkFNRV9YX0RJU1BMQVkgKGYpKTsK ICAgdW5ibG9ja19pbnB1dCAoKTsKICNlbmRpZgorCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gTlVM TDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAvKiBUaGlzIGZ1bmN0aW9u IGlzIGNhbGxlZCBmcm9tIHZhcmlvdXMgcGxhY2VzIGluIHhkaXNwLmMKQEAgLTEzMTAwLDYgKzEz OTgyLDIxIEBAIHhfYWN0aXZhdGVfdGltZW91dF9hdGltZXIgKHZvaWQpCiAKIHN0YXRpYyBzdHJ1 Y3QgcmVkaXNwbGF5X2ludGVyZmFjZSB4X3JlZGlzcGxheV9pbnRlcmZhY2UgPQogICB7CisKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIGBy ZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgeHRlcm0uY2AgbXVzdCBiZSBpbiB0aGUgZXhhY3Qgc2Ft ZSBvcmRlciBhcyB0aGUKK2ByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgZGlzcGV4dGVybi5oYCEg Ki8KKworICBtY194X3dyaXRlX2dseXBocywKKyAgbWNfeF9kcmF3X3dpbmRvd19jdXJzb3IsCisg IG1jX3hfZHJhd19nbHlwaF9zdHJpbmcsCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK ICAgICB4X2ZyYW1lX3Bhcm1faGFuZGxlcnMsCiAgICAgeF9wcm9kdWNlX2dseXBocywKICAgICB4 X3dyaXRlX2dseXBocywK --Multipart_Thu_May__2_17:48:18_2019-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs). References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Mon, 06 May 2019 18:40:02 +0000 Resent-Message-ID: <handler.22873.B22873.155716795725417 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22873 <at> debbugs.gnu.org,17684 <at> debbugs.gnu.org Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.155716795725417 (code B ref 22873); Mon, 06 May 2019 18:40:02 +0000 Received: (at 22873) by debbugs.gnu.org; 6 May 2019 18:39:17 +0000 Received: from localhost ([127.0.0.1]:57382 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1hNiWD-0006bt-0Y for submit <at> debbugs.gnu.org; Mon, 06 May 2019 14:39:17 -0400 Received: from gateway32.websitewelcome.com ([192.185.145.123]:28791) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1hNiWA-0006be-N0 for 22873 <at> debbugs.gnu.org; Mon, 06 May 2019 14:39:15 -0400 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway32.websitewelcome.com (Postfix) with ESMTP id 1AA7028A49 for <22873 <at> debbugs.gnu.org>; Mon, 6 May 2019 13:39:14 -0500 (CDT) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id NiW9hl3T74FKpNiW9hAZXF; Mon, 06 May 2019 13:39:14 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:To:From:Message-ID:Date: Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Q9PtWQjAkPIPlvwJsQXKYD1jZ0RXA1F7bUwwNH5nx10=; b=iBPv2KEUn/Pj5GgfMzndh9xJon 9pdOQ1GRHD0nZD4p+zjFn9QWqSxI+wjNgCwD12Q4/nkKTaF2h5vUY4f24WQ7gT6MG6z3YXUTvQFPh xquxK9YGiK0ySPzpy6lRWJlXvZs0q0CGGsJQgCGiYdqj2J0k6wnDmy4yczsts9piImnXKj/YvkO7m R2GoLuVx7vfF+/8yZ0aFjgFbi1/QWq3slWN1NDk/AFvYXW0pyf3BLZ6cNZ4DK2J9e0P58gtcNXa/o fJZ/jXk0mqMU+DB9BH0wKY5HvB6eCXZGd3fLNM0j9LQYQog1y1MRd33kXwkm2p/xxgp+HyUkA7e7w a5tjipvw==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:50229 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from <esq@HIDDEN>) id 1hNiW6-0025wG-Gd; Mon, 06 May 2019 13:39:13 -0500 Date: Mon, 06 May 2019 11:39:10 -0700 Message-ID: <m2v9yn1l81.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Mon_May__6_11:39:09_2019-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1hNiW6-0025wG-Gd X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:50229 X-Source-Auth: lawlist X-Email-Count: 2 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> --Multipart_Mon_May__6_11:39:09_2019-1 Content-Type: text/plain; charset=US-ASCII VERSION: 019.003 [05/06/2019] CHANGELOG: - Reduced the number of entry points in dispnew.c to just `update_window'. SETUP: Step 1: git clone -b master git://git.sv.gnu.org/emacs.git Step 2: In the new emacs folder, go back to an Emacs version from 04/08/2019: git reset --hard a038df77de7b1aa2d73a6478493b8838b59e4982 Step 3: From within the new emacs folder created in Step 1, apply the patch: git apply /path/to/the/patch.diff Step 4: ./autogen.sh Step 5: ./configure ... [your custom options] Step 6: make Step 7: make install USAGE: - For a minimal working example of built-in fake cursors, type: M-x mc-test ;;; TURN ON FAKE CURSORS (buffer position, cursor-type, cursor color): (setq mc-conf '((1 "hbar" "magenta") (2 "bar" "purple") (3 "box" "#00FF00") (4 "hollow" "#0000FF") (5 ("hbar" 3) [1.0 0.0 1.0]) (6 ("bar" 3) [0.0 1.0 1.0]) (7 "framed" "OrangeRed")))) ;;; TURN OFF FAKE CURSORS: (setq mc-conf nil) - To try out the crosshairs feature, type: M-x +-mode - To try out built-in fake cursors with Magnar Sveen's multiple-cursors package, install that package first. [If the multiple-cursors package is installed, an eval-after-load "multiple-cursors-core" statement within `crosshairs.el` will redefine a couple of functions and set up a few keyboard shortcuts.] If the multiple-cursors package by Magnar Sveen is not already installed, then here are two easy ways to install that package: Type: M-x mc-install OR, evaluate the following snippet: (progn (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) (package-refresh-contents) (package-install 'multiple-cursors)) TODO: - Add support for `ch_inactive_windows' and `fc_inactive_windows'. - When using the multiple fake cursors feature, a fake cursor does not show up at zv_p. - Deal with left/right overwritten glyphs in the w32 and X ports of Emacs. - Reduce the removal of fake cursors to the bare minimum when scrolling the text on the glass directly, and whenever `update_window' is called. - When an idle-timer fires and point is at the end of a horizontally scrolled line in a narrow window, the temporary horizontal scroll is canceled. Create an minimal working example and file a bug report. - There is a bug affecting an older version of Emacs for the NS port that causes partial line flickering when the same characters are grouped together (;;;;;;) and MC_GLYPHLESS cursors are above or below -- having the same background color as the frame; e.g., black on black (used to erase a glyphless cursor). The partial flickering is only noticeable with rapid fire; e.g., holding down the right/left arrow key. When changing the color of the glyphless cursor, the issue is not present. [@lawlist has verified that the X and HPOS coordinates are accurate.] - There is a bug affecting the recorded `w->mc.lnum_pixel_width` that is observable when not running under gdb, but disappears when running under gdb. While viewing a folded org-mode buffer, the non-gdb instance had a visible line number pixel-width of 44, but Emacs treated it as fluctuating between 44 and 55 as the cursor was moved to the end of line. In the gdb instance, the visible line number pixel width was 55 with no fluctuation under the same conditions as the non-gdb instance. This appears to be a different bug than bug#32177 (current line number shifts one column to the left) because the line number of the current line does not shift left, and changing the bidi settings did not correct the issue. - The current test for `auto_hscroll_mode_p' only looks for `current_line` and all five related tests are based upon that assumption, which may not be true. - Multiple Cursors: If point is in the middle of a composite character, then select a fully composed character so that the fake cursor is visible. - Implement functionality similar to the Lisp multiple-cursors by Magnar Sveen. - Follow up with the Emacs team re bug#32177; i.e., (Current line number shifts one column to the left.) - Follow up with the Emacs team re bug#32060; i.e., Horizontal Scrolling (Current Line): Wrong line gets h-scrolled. - Determine if bug #28936 needs to be fixed and help the Emacs team re same. --Multipart_Mon_May__6_11:39:09_2019-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="2019_05_06__11_31_31_427.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvY3Jvc3NoYWlycy5lbCBiL2xpc3AvY3Jvc3NoYWlycy5lbApuZXcg ZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4zYmJkNjk3Ci0tLSAvZGV2L251bGwKKysr IGIvbGlzcC9jcm9zc2hhaXJzLmVsCkBAIC0wLDAgKzEsMTI4MiBAQAorOzs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Cis7OzsgQkVHSU4gbW9kaWZpY2F0aW9uIG9mIHRoZSBNdWx0aXBsZSBDdXJzb3Jz IGxpYnJhcnkgd3JpdHRlbiBieSAgTWFnbmFyIFN2ZWVuLgorCisoZGVmdmFyIHBhY2thZ2UtYXJj aGl2ZXMpCisKKyhkZWZ2YXIgbWMtLW1heC1jdXJzb3JzLW9yaWdpbmFsKQorKGRlZnZhciBtYy9t YXgtY3Vyc29ycykKKyhkZWZ2YXIgbWMtLW1heC1jdXJzb3JzLW9yaWdpbmFsKQorKGRlZnZhciBt Yy9tYXgtY3Vyc29ycykKKyhkZWZ2YXIgbWMvYWx3YXlzLXJ1bi1mb3ItYWxsKQorKGRlZnZhciBt Yy0tdGhpcy1jb21tYW5kKQorKGRlZnZhciBtYy9jbWRzLXRvLXJ1bi1vbmNlKQorKGRlZnZhciBt Yy0tZGVmYXVsdC1jbWRzLXRvLXJ1bi1mb3ItYWxsKQorKGRlZnZhciBtYy9jbWRzLXRvLXJ1bi1m b3ItYWxsKQorKGRlZnZhciBtYy0tZGVmYXVs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5IG1heGlt dW06ICIpKQorICAgICAgICAgIChtYy9yZW1vdmUtZmFrZS1jdXJzb3JzKQorICAgICAgICAgIChl cnJvciAiQWJvcnRlZDogdG9vIG1hbnkgY3Vyc29ycyIpKSkpCisgICAgKGxldCAoKG92ZXJsYXkK KyAgICAgICAgICAgIChpZiBtYy91c2UtYnVpbHQtaW4tY3Vyc29ycworICAgICAgICAgICAgICAo bWFrZS1vdmVybGF5IChwb2ludCkgKHBvaW50KSkKKyAgICAgICAgICAgICAgKG1jL21ha2UtY3Vy c29yLW92ZXJsYXktYXQtcG9pbnQpKSkpCisgICAgICAob3ZlcmxheS1wdXQgb3ZlcmxheSAnbWMt aWQgKG9yIGlkIChtYy9jcmVhdGUtY3Vyc29yLWlkKSkpCisgICAgICAob3ZlcmxheS1wdXQgb3Zl cmxheSAndHlwZSAnZmFrZS1jdXJzb3IpCisgICAgICAob3ZlcmxheS1wdXQgb3ZlcmxheSAncHJp b3JpdHkgMTAwKQorICAgICAgKG1jL3N0b3JlLWN1cnJlbnQtc3RhdGUtaW4tb3ZlcmxheSBvdmVy bGF5KQorICAgICAgKHdoZW4gKHVzZS1yZWdpb24tcCkKKyAgICAgICAgKG92ZXJsYXktcHV0IG92 ZXJsYXkgJ3JlZ2lvbi1vdmVybGF5CisgICAgICAgICAgICAgICAgICAgICAobWMvbWFrZS1yZWdp b24tb3ZlcmxheS1iZXR3ZWVuLXBvaW50LWFuZC1tYXJrKSkpCisgICAgICBvdmVybGF5KSkKKwor ICAoZGVmdW4gbWMvZXhlY3V0ZS1jb21tYW5kLWZvci1hbGwtZmFrZS1jdXJzb3JzIChjbWQpCisg ICAgIkNhbGxzIENNRCBpbnRlcmFjdGl2ZWx5IGZvciBlYWNoIGN1cnNvci4KKyAgSXQgd29ya3Mg YnkgbW92aW5nIHBvaW50IHRvIHRoZSBmYWtlIGN1cnNvciwgc2V0dGluZworICB1cCB0aGUgcHJv cGVyIGVudmlyb25tZW50LCBhbmQgdGhlbiByZW1vdmlu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aCBtdWx0aXBsZSBjdXJzb3JzJXMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg IG9yaWdpbmFsLWNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdldCBvcmln aW5hbC1jb21tYW5kICdtYy0tdW5zdXBwb3J0ZWQpKQorICAgICAgICAgICAgICAgICAgKHdoZW4g KGFuZCBvcmlnaW5hbC1jb21tYW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChub3Qg KG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy0tZGVmYXVsdC1jbWRzLXRvLXJ1bi1vbmNlKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKG5vdCAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1j L2NtZHMtdG8tcnVuLW9uY2UpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAob3IgbWMv YWx3YXlzLXJ1bi1mb3ItYWxsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVt cSBvcmlnaW5hbC1jb21tYW5kIG1jLS1kZWZhdWx0LWNtZHMtdG8tcnVuLWZvci1hbGwpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jL2Nt ZHMtdG8tcnVuLWZvci1hbGwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWMv cHJvbXB0LWZvci1pbmNsdXNpb24taW4td2hpdGVsaXN0IG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAg ICAgICAgICAgICAgICAgICAgKG1jL2V4ZWN1dGUtY29tbWFuZC1mb3ItYWxsLWZha2UtY3Vyc29y cyBvcmlnaW5hbC1jb21tYW5kKSkpKQorICAgICAgICAgICAgICAod2hlbiBtYy91c2UtYnVpbHQt aW4tY3Vyc29ycworICAgICAgICAgICAgICAgIChzZXRxIG1jLWNvbmYKKyAgICAgICAgICAgICAg ICAgICAgICAgIChtYXBjYXIKKyAg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W50ZXJhY3RpdmUpCisgIChsZXQgKChidWZmZXIg KGdldC1idWZmZXItY3JlYXRlICIqTUMtVEVTVCoiKSkpCisgICAgKHdpdGgtY3VycmVudC1idWZm ZXIgYnVmZmVyCisgICAgICAoZXJhc2UtYnVmZmVyKQorICAgICAgKGluc2VydCAiVGhpcyBpcyBh IHRlc3QhIikKKyAgICAgIChzZXRxIG1jLWNvbmYgJygoMSAiaGJhciIgIm1hZ2VudGEiKQorICAg ICAgICAgICAgICAgICAgICAgICgyICJiYXIiICJwdXJwbGUiKQorICAgICAgICAgICAgICAgICAg ICAgICgzICJib3giICIjMDBGRjAwIikKKyAgICAgICAgICAgICAgICAgICAgICAoNCAiaG9sbG93 IiAiIzAwMDBGRiIpCisgICAgICAgICAgICAgICAgICAgICAgKDUgKCJoYmFyIiAzKSBbMS4wIDAu MCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg2ICgiYmFyIiAzKSBbMC4wIDEuMCAxLjBd KQorICAgICAgICAgICAgICAgICAgICAgICg3ICJmcmFtZWQiICJPcmFuZ2VSZWQiKQorICAgICAg ICAgICAgICAgICAgICAgICg4ICJib3giICJncmV5MjUiKQorICAgICAgICAgICAgICAgICAgICAg ICg5ICJib3giICJncmV5NzUiKSkpKQorICAgIChzZWxlY3Qtd2luZG93IChkaXNwbGF5LWJ1ZmZl ciBidWZmZXIpKSkpCisKKyhkZWZ1biArLXRpbWVyLWZuICgpCisiU2luY2UgdGhpcyBmaXJlcyBn bG9iYWxseSwgd2UgbXVzdCBjb250cm9sIHdoaWNoIGJ1ZmZlcnMgY3Jvc3NoYWlycyBhcHBlYXIg aW4uIgorICAod2hlbiArLW1vZGUKKyAgICAodW5sZXNzIChvciAobWVtcSBsYXN0LWNvbW1hbmQg Ky1wYXJlbnMtZXhjbHVzaW9ucykKKyAgICAgICAgICAgICAgICAobnVsbCArLXBhcmVucy1wKSkK KyAgICAgICgrLXBhcmVucy1mbikpCisgICAgKHdoZW4gKy10aW1lci12YXIKKyAgICAgIChzZXRx IHRpbWVyLWlkbGUtbGlzdCAoZGVscSArLXRpbWVyLXZhciB0aW1lci1pZGxlLWxpc3QpKQorICAg ICAgKHNldHEgKy10aW1lci12YXIgbmlsKSkpKQorCisoZGVmdW4gKy1kcmF3LWZvcnRod2l0aCAo KQorIkltbWVkaWF0ZWx5IGRlbGV0ZS9kcmF3IG1hdGNoaW5nIHBhcmVudGhlc2VzLiIKKyAgKCst ZHJhdy1jcm9zc2hhaXJzICdmb3JjZSkpCisKKyhkZWZ1biArLWRyYXctY3Jvc3NoYWlycyAoJm9w dGlvbmFsIGZvcmNlKQorIkltbWVkaWF0ZWx5IGRlbGV0ZSBtYXRjaGluZyBwYXJlbnRoZXNlcy4g IElmIEZPUkNFIGlzIG5vbi1uaWwsIHRoZW4gaW1tZWRpYXRlbHkKK2RyYXcgbWF0Y2hpbmcgcGFy ZW50aGVzaXM7IG90aGVyd2lzZSwgZHJhdyB0aGVtIG9uIGFuIGlkbGUtdGllci4iCisgICh3aGVu ICstbW9kZQorICAgICh3aGVuICstdGltZXItdmFyCisgICAgICAoc2V0cSB0aW1lci1pZGxlLWxp c3QgKGRlbHEgKy10aW1lci12YXIgdGltZXItaWRsZS1saXN0KSkKKyAgICAgIChzZXRxICstdGlt ZXItdmFyIG5pbCkpCisgICAgKHVubGVzcyAob3IgKG1lbXEgdGhpcy1jb21tYW5kICstcGFyZW5z LWV4Y2x1c2lvbnMpCisgICAgICAgICAgICAgICAgKGFuZCAobnVsbCArLXBhcmVucy1wKQorICAg ICAgICAgICAgICAgICAgICAgKG51bGwgKy1wYXJlbnMtb3ZlcmxheXMtZXhpc3QtcCkpKQorICAg ICAgKCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykpCisgICAgKGlmIGZvcmNlCisgICAgICAocHJv Z24KKyAgICAgICAgKHdoZW4gKy1wYXJlbnMtcAorICAgICAgICAgICgrLXBhcmVucy1mbikpKQor ICAgICAgKHNldHEgKy10aW1lci12YXIgKHJ1bi13aXRoLWlkbGUtdGltZXIgKy1pZGxlLXRpbWVy LXNlY29uZHMgbmlsICMnKy10aW1lci1mbikpKSkpCisKKyhkZWZ2YXIgZmMtbW9kZSkKKworOzs7 IyMjYXV0b2xvYWQKKyhkZWZpbmUtbWlub3ItbW9kZSArLW1vZGUKKyJNaW5vciBtb2RlIGZvciBk aXNwbGF5aW5nIGEgaG9yaXpvbnRhbCBydWxlci4iCisgIDppbml0LXZhbHVlIG5pbAorICA6bGln aHRlciAiICsiCisgIDprZXltYXAgbmlsCisgIDpnbG9iYWwgbmlsCisgIDpncm91cCAnKy1tb2Rl CisgIChjb25kCisgICAgKCstbW9kZQorICAgICAgOzs7IGArLW1vZGUnIGhhcyB0aGUgYWJpbGl0 eSB0byBhbHNvIGRpc3BsYXkgYSBmaWxsIGNvbHVtbiBpbmRpY2F0b3IuCisgICAgICA7OzsgU2Vl IHRoZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicuCisgICAgICAod2hlbiBmYy1tb2RlCisgICAg ICAgIChmYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgZ2xvYmFsLWVsZG9jLW1vZGUKKyAg ICAgICAgICAgICAgICAgKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAgJ2FueSkKKyAgICAgICAgICAg ICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAgICAgICAgKGdsb2JhbC1l bGRvYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgaml0LWxvY2stY29udGV4dC10aW1lcgor ICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAg ICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAod2hlbiAo dGltZXJwIGppdC1sb2NrLWNvbnRleHQtdGltZXIpCisgICAgICAgICAgKGNhbmNlbC10aW1lciBq aXQtbG9jay1jb250ZXh0LXRpbWVyKSkKKyAgICAgICAgOzsgKHNldHEgaml0LWxvY2stY29udGV4 dC10aW1lciAocnVuLXdpdGgtaWRsZS10aW1lciA1LjAgJ3JlcGVhdCAnaml0LWxvY2stY29udGV4 dC1mb250aWZ5KSkKKyAgICAgICAgKHNldHEgaml0LWxvY2stY29udGV4dC10aW1lciBuaWwpKQor ICAgICAgKHdoZW4gKGFuZCAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAg ICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAod2hlbiAo dGltZXJwIHVuZG8tYXV0by1jdXJyZW50LWJvdW5kYXJ5LXRpbWVyKQorICAgICAgICAgIChjYW5j ZWwtdGltZXIgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpKQorICAgICAgICAoZnNl dCAndW5kby1hdXRvLS11bmRvYWJsZS1jaGFuZ2UKKyAgICAgICAgICAgICAgKGxhbWJkYSAoKSAo YWRkLXRvLWxpc3QgJ3VuZG8tYXV0by0tdW5kb2FibHktY2hhbmdlZC1idWZmZXJzIChjdXJyZW50 LWJ1ZmZlcikpKSkKKyAgICAgICAgKGZzZXQgJ3VuZG8tYXV0by1hbWFsZ2FtYXRlICdpZ25vcmUp KQorICAgICAgKHdoZW4gYmxpbmstY3Vyc29yLW1vZGUKKyAgICAgICAgKGJsaW5rLWN1cnNvci1t b2RlIC0xKQorICAgICAgICAod2hlbiAobWVtcSAnYmxpbmstY3Vyc29yLWNoZWNrIHBvc3QtY29t bWFuZC1ob29rKQorICAgICAgICAgIChyZW1vdmUtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJ2Js aW5rLWN1cnNvci1jaGVjaykpKQorICAgICAgKHNldHEgY3Jvc3NoYWlycyB0KQorICAgICAgKHdo ZW4gKy1maWxsLWNvbHVtbgorICAgICAgICAoc2V0cSBmYy12aXNpYmxlIHQpKQorICAgICAgOzs7 IGBhdXRvLWNvbXBvc2l0aW9u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AgICAgICAgICAgICAgICAgIHRhYi13 aWR0aAorICAgICAgICAgICAgICAgICAgICAgbGluZS1tb3ZlLXZpc3VhbAorICAgICAgICAgICAg ICAgICAgICAgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgICAgICAgICAgICAgIHRydW5jYXRlLXBh cnRpYWwtd2lkdGgtd2luZG93cworICAgICAgICAgICAgICAgICAgICAgd29yZC13cmFwKSkKKyAg ICAgICAgKHdoZW4gKGxvY2FsLXZhcmlhYmxlLXAgdmFyKQorICAgICAgICAgIChwdXNoIChjb25z IHZhciAoc3ltYm9sLXZhbHVlIHZhcikpICstLXNhdmVkLXN0YXRlKSkpCisgICAgICAoc2V0cSBm aWxsLWNvbHVtbiA4MCkKKyAgICAgIChzZXRxIGRpc3BsYXktbGluZS1udW1iZXJzIHQpCisgICAg ICAoc2V0cS1sb2NhbCBhdXRvLWhzY3JvbGwtbW9kZSAnY3VycmVudC1saW5lKQorICAgICAgKHNl dHEtbG9jYWwgaHNjcm9sbC1zdGVwIDUpCisgICAgICAoc2V0cSBidWZmZXItZGlzcGxheS10YWJs ZSArLWJ1ZmZlci1kaXNwbGF5LXRhYmxlKQorICAgICAgKHNldHEgdGFiLXdpZHRoIDQpCisgICAg ICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICdsaW5lLW1vdmUtdmlzdWFsKSB0KQorICAgICAg KHNldHEgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgKGNvbmQKKyAgICAgICAgICAoKGxldCAoKGxz dCArLXRydW5jYXRlLWxpbmVzLWRlcml2ZWQtbW9kZXMpCisgICAgICAgICAgICAgICAgICBtb2Rl KQorICAgICAgICAgICAgKGNhdGNoICdmb3VuZAorICAgICAgICAgICAgICAod2hpbGUgKHNldHEg bW9kZSAocG9wIGxzdCkpCisgICAgICAgICAgICAgICAgKHdoZW4gKGRlcml2ZWQtbW9kZS1wIG1v ZGUpCisgICAgICAgICAgICAgICAgICAodGhyb3cgJ2ZvdW5kIHQpKSkpKSkKKyAgICAgICAgICAg KChtZW1xIG1ham9yLW1vZGUgKy10cnVuY2F0ZS1saW5lcy1tYWpvci1tb2RlcykpCisgICAgICAg ICAgICh0CisgICAgICAgICAgICAgbmlsKSkpCisgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlh YmxlICd0cnVuY2F0ZS1wYXJ0aWFsLXdpZHRoLXdpbmRvd3MpIG5pbCkKKyAgICAgIChzZXRxIHdv cmQtd3JhcCB0KQorICAgICAgKHNldHEgaW5kaWNhdGUtZW1wdHktbGluZXMgdCkKKyAgICAgIChz ZXRxIGluZGljYXRlLWJ1ZmZlci1ib3VuZGFyaWVzICdsZWZ0KQorICAgICAgKHNldHEgZnJpbmdl LWluZGljYXRvci1hbGlzdAorICAgICAgICAgIDs7OyBoc2NsX2FsbF90ZW1wX3AgfCBoc2NsX3Rl bXBfcAorICAgICAgICAnKCgrLWhzY2wtdGVtcCAuICgrLXNpbmdsZS1hbmdsZS1sZWZ0CisgICAg ICAgICAgICAgICAgICAgICAgICAgICstZG91YmxlLWFuZ2xlLWxlZnQpKQorICAgICAgICAgIDs7 OyBoc2NsX2FsbF9wZXJtXzBfcCB8IGhzY2xfYWxsX3Blcm1fMV9wIHwgaHNjbF9hbGxfcGVybV8y X3AgfCBoc2NsX3Blcm1fcAorICAgICAgICAgICgrLWhzY2wtcGVybSAuICgrLXNpbmdsZS1hbmds ZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLWRvdWJsZS1hbmdsZS11cAorICAgICAg ICAgICAgICAgICAgICAgICAgICArLXRyaXBsZS1hbmdsZS11cAorICAgICAgICAgICAgICAgICAg ICAgICAgICArLXF1YWRydXBsZS1hbmdsZS11cCkpCisgICAgICAgICAgKCstb3ZlcmxheS1hcnJv dyAuICgrLWZyaW5nZS1sZWZ0LWFycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAr LWZyaW5nZS1yaWdodC1hcnJvdykpCisgICAgICAgICAgKHRydW5jYXRpb24gLiAoKy1mcmluZ2Ut bGVmdC1hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICstZnJpbmdlLXJpZ2h0LWFycm93 KSkKKyAgICAgICAgICAoY29udGludWF0aW9uIC4gKCstZnJpbmdlLWxlZnQtY3VybHktYXJyb3cK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICstYmFja3NsYXNoKSkKKyAgICAgICAgICAob3Zl cmxheS1hcnJvdyAuICstZnJpbmdlLXJpZ2h0LXRyaWFuZ2xlKQorICAgICAgICAgICh1cCAuICst ZnJpbmdlLXVwLWFycm93KQorICAgICAgICAgIChkb3duIC4gKy1mcmluZ2UtZG93bi1hcnJvdykK KyAgICAgICAgICAodG9wIC4gKy1mcmluZ2UtdG9wLWxlZnQtYW5nbGUpCisgICAgICAgICAgKGJv dHRvbSAuICstZnJpbmdlLWJvdHRvbS1yaWdodC1hbmdsZSkKKyAgICAgICAgICAodG9wLWJvdHRv bSAuICgrLWZyaW5nZS1sZWZ0LWJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICArLWZy aW5nZS1yaWdodC1icmFja2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgKy1mcmluZ2UtdG9w LXJpZ2h0LWFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgKy1mcmluZ2UtdG9wLWxlZnQt YW5nbGUpKQorICAgICAgICAgIChlbXB0eS1saW5lIC4gKy1mcmluZ2UtZW1wdHktbGluZSkKKyAg ICAgICAgICAodW5rbm93biAuICstZnJpbmdlLXF1ZXN0aW9uLW1hcmspKSkKKyAgICAgIChzZXRx IGZyaW5nZS1jdXJzb3ItYWxpc3QgJygoYm94IC4gKy1mcmluZ2UtbGVmdC10cmlhbmdsZSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaG9sbG93IC4gKy1ob2xsb3ctcmVjdGFu Z2xlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChiYXIgLiArLXZlcnRpY2Fs LWJhcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaGJhciAuICstZnJpbmdl LWhvcml6b250YWwtYmFyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChob2xs b3ctc21hbGwgLiArLWZyaW5nZS1ob2xsb3ctc3F1YXJlKSkpCisgICAgICAoaWYgKG9yICstZm9y dGh3aXRoCisgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisg ICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJhdy1mb3J0aHdpdGggJ2Fw cGVuZCAnbG9jYWwpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJh dy1jcm9zc2hhaXJzICdhcHBlbmQgJ2xvY2FsKSkKKyAgICAgICh3aGVuICstZm9ydGh3aXRoCisg ICAgICAgIChhZGQtaG9vayAnd2luZG93LWNvbmZpZ3VyYXRpb24tY2hhbmdlLWhvb2sgJystZHJh dy1mb3J0aHdpdGggbmlsICdsb2NhbCkpCisgICAgICAoYWRkLWhvb2sgJ2NoYW5nZS1tYWpvci1t b2RlLWhvb2sgJ3R1cm4tb2ZmLSstbW9kZSBuaWwgJ2xvY2FsKQorICAgICAgKHdoZW4gKGNhbGxl ZC1pbnRlcmFjdGl2ZWx5LXAgJ2FueSkKKyAgICAgICAgKGNvbmQKKyAgICAgICAgICAoKy1mb3J0 aHdpdGgKKyAgICAgICAgICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScgLS0gRHJhdyBt YXRjaGluZyBwYXJlbnRoZXNlcyBpbW1lZGlhdGVseS4iKSkKKyAgICAgICAgICAoKGVxdWFsIGN1 cnJlbnQtcHJlZml4LWFyZyAnKDQpKQorICAgICAgICAgICAgOzs7IE1hdGNoaW5nIHBhcmVudGhl c2VzIHdpbGwgYmUgZHJhd24gaW1tZWRpYXRlbHkuCisgICAgICAgICAgICAobWVzc2FnZSAiVHVy bmVkIE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UgJ2xvY2FsKQorICAgICAgKHdoZW4gKy10aW1lci12YXIKKyAgICAgICAg KHNldHEgdGltZXItaWRsZS1saXN0IChkZWxxICstdGltZXItdmFyIHRpbWVyLWlkbGUtbGlzdCkp CisgICAgICAgIChzZXRxICstdGltZXItdmFyIG5pbCkpCisgICAgICAod2hlbiAoY2FsbGVkLWlu dGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAobWVzc2FnZSAiVHVybmVkIE9GRiBgKy1tb2Rl Jy4iKSkpKSkKKworKGRlZnVuIHR1cm4tb2ZmLSstbW9kZSAoKQorICAoKy1tb2RlIC0xKSkKKwor Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7CisKKyhkZWZ1biArLXBhcmVucy1mbiAoKQorICAiRG9j LXN0cmluZy4iCisgIChsZXQqICgob3BvaW50IChwb2ludCkpCisgICAgICAgICAoZnJvbSAoaWYg Ky1wYXJlbnMtZnJvbS1mbgorICAgICAgICAgICAgICAgICAoZnVuY2FsbCArLXBhcmVucy1mcm9t LWZuKQorICAgICAgICAgICAgICAgICAocG9pbnQtbWluKSkpCisgICAgICAgICAod2luIChzZWxl Y3RlZC13aW5kb3cpKQorICAgICAgICAgKGkgMCkKKyAgICAgICAgIChwcmVjZWRpbmctY2hhciAo cHJlY2VkaW5nLWNoYXIpKQorICAgICAgICAgKG9jaGFyIChjaGFyLWFmdGVyIG9wb2ludCkpCisg ICAgICAgICAocG9zMQorICAgICAgICAgICAoY29uZAorICAgICAgICAgICAgICgoYW5kIG9jaGFy CisgICAgICAgICAgICAgICAgICAgKG9yIDs7OyAoY2hhci10by1zdHJpbmcgNDApID0+IG9wZW5p bmcgcGFyZW50aGVzaXMKKyAgICAgICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgNDApCisgICAg ICAgICAgICAgICAgICAgICAgIDs7OyAoY2hhci10by1zdHJpbmcgOTEpID0+IG9wZW5pbmcgc3F1 YXJlIGJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgOTEpCisgICAgICAg ICAgICAgICAgICAgICAgIDs7OyAoY2hhci10by1zdHJpbmcgMTIzKSA9PiBvcGVuaW5nIHdhdnkg YnJhY2tldAorICAgICAgICAgICAgICAgICAgICAgICAoPSBvY2hhciAxMjMpKSkKKyAgICAgICAg ICAgICAgICAobWluICgxKyBvcG9pbnQpIChwb2ludC1tYXgpKSkKKyAgICAgICAgICAgICAoKG9y IDs7OyAoY2hhci10by1zdHJpbmcgNDEpID0+IGNsb3NpbmcgcGFyZW50aGVzaXMKKyAgICAgICAg ICAgICAgICAgICg9IHByZWNlZGluZy1jaGFyIDQxKQorICAgICAgICAgICAgICAgICAgOzs7IChj aGFyLXRvLXN0cmluZyA5MykgPT4gY2xvc2luZyBzcXVhcmUgYnJhY2tldAorICAgICAgICAgICAg ICAgICAgKD0gcHJlY2VkaW5nLWNoYXIgOTMpCisgICAgICAgICAgICAgICAgICA7OzsgKGNoYXIt dG8tc3RyaW5nIDEyNSkgPT4gY2xvc2luZyB3YXZ5IGJyYWNrZXQKKyAgICAgICAgICAgICAgICAg ICg9IHByZWNlZGluZy1jaGFyIDEyNSkpCisgICAgICAgICAgICAgICAgKG1heCAocG9pbnQtbWlu KSAoMS0gb3BvaW50KSkpCisgICAgICAgICAgICAgKHQKKyAgICAgICAgICAgICAgICBvcG9pbnQp KSkKKyAgICAgICAgIHBvczIKKyAgICAgICAgIHNlbGVjdGVkLWZhY2UpCisgICAgKHNhdmUtZXhj dXJzaW9uCisgICAgICAoY29uZGl0aW9uLWNhc2UgbmlsCisgICAgICAgICh3aGlsZSAoc2V0cSBw b3MxIChudGggMSAocGFyc2UtcGFydGlhbC1zZXhwIGZyb20gcG9zMSkpKQorICAgICAgICAgIChz ZXRxIHBvczIgKHNjYW4tc2V4cHMgcG9zMSAxKSkKKyAgICAgICAgICAoaWYgKD0gaSAxMCkKKyAg ICAgICAgICAgIChzZXRxIGkgMSkKKyAgICAgICAgICAgIChzZXRxIGkgKDErIGkpKSkKKyAgICAg ICAgICAoc2V0cSBzZWxlY3RlZC1mYWNlIChjb25kCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICgoPSBpIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFy ZW5zLW9uZS1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSAyKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy10d28tZmFjZSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgMykKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtdGhyZWUtZmFjZSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgKCg9IGkgNCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAnKy1wYXJlbnMtZm91ci1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo KD0gaSA1KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1maXZl LWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDYpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLXNpeC1mYWNlKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA3KQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICcrLXBhcmVucy1zZXZlbi1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAoKD0gaSA4KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBh cmVucy1laWdodC1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA5 KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1uaW5lLWZhY2Up CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDEwKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy10ZW4tZmFjZSkpKQorICAgICAgICAgIChs ZXQgKChvdiAobWFrZS1vdmVybGF5IHBvczEgKDErIHBvczEpKSkpCisgICAgICAgICAgICAodW5s ZXNzICstcGFyZW5zLWluYWN0aXZlLXdpbmRvd3MKKyAgICAgICAgICAgICAgKG92ZXJsYXktcHV0 IG92ICd3aW5kb3cgd2luKSkKKyAgICAgICAgICAgIChvdmVybGF5LXB1dCBvdiAnZmFjZSBzZWxl Y3RlZC1mYWNlKSkKKyAgICAgICAgICAod2hlbiBwb3MyCisgICAgICAgICAgICAobGV0ICgob3Yg KG1ha2Utb3ZlcmxheSAoMS0gcG9zMikgcG9zMikpKQorICAgICAgICAgICAgICAodW5sZXNzICst cGFyZW5zLWluYWN0aXZlLXdpbmRvd3MKKyAgICAgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3Yg J3dpbmRvdyB3aW4pKQorICAgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ2ZhY2Ugc2VsZWN0 ZWQtZmFjZSkpKSkKKyAgICAgICAgKGVycm9yIG5pbCkpKQorICAgIChzZXRxICstcGFyZW5zLW92 ZXJsYXlzLWV4aXN0LXAgdCkpKQorCisoZGVmdW4gKy1yZW1vdmUtb3ZlcmxheXMgKGJlZyBlbmQg bmFtZSB2YWwpCisiUmVtb3ZlIHRoZSBvdmVybGF5cyB0aGF0IGFyZSBgZXF1YWwtaW5jbHVkaW5n LXByb3BlcnRpZXNgLgorSW5jbHVkZXMgYSB1bmlxdWUgc2l0dWF0aW9uIHdoZW4gYW4gb3Zlcmxh eSB3aXRoIGFuIGAnYWZ0ZXItc3RyaW5nYCBwcm9wZXJ0eQoraXMgYXQgdGhlIHZlcnkgZW5kIG9m IGEgbmFycm93ZWQtYnVmZmVyLiIKKyAgKGxldCogKChwb2ludC1tYXggKHBvaW50LW1heCkpCisg ICAgICAgICAocG9pbnQtbWluIChwb2ludC1taW4pKQorICAgICAgICAgKG5hcnJvd2VkLXAgKGJ1 ZmZlci1uYXJyb3dlZC1wKSkKKyAgICAgICAgIChiZWcgKGlmIGJlZyBiZWcgcG9pbnQtbWluKSkK KyAgICAgICAgIChlbmQKKyAgICAgICAgICAgKGNvbmQKKyAgICAgICAgICAgICAoKGFuZAorICAg ICAgICAgICAgICAgICAobm90IG5hcnJvd2VkLXApCisgICAgICAgICAgICAgICAgIGVuZCkKKyAg ICAgICAgICAgICAgIGVuZCkKKyAgICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAo bm90IG5hcnJvd2VkLXApCisgICAgICAgICAgICAgICAgIChudWxsIGVuZCkpCisgICAgICAgICAg ICAgICBwb2ludC1tYXgpCisgICAgICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFy cm93ZWQtcAorICAgICAgICAgICAgICAgICBlbmQKKyAgICAgICAgICAgICAgICAgKDwgZW5kIHBv aW50LW1heCkpCisgICAgICAgICAgICAgICBlbmQpCisgICAgICAgICAgICAgKChhbmQKKyAgICAg ICAgICAgICAgICAgbmFycm93ZWQtcAorICAgICAgICAgICAgICAgICBlbmQKKyAgICAgICAgICAg ICAgICAgKD0gZW5kIHBvaW50LW1heCkpCisgICAgICAgICAgICAgICAoMSsgZW5kKSkKKyAgICAg ICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICBuYXJyb3dlZC1wCisgICAgICAgICAgICAg ICAgIChudWxsIGVuZCkpCisgICAgICAgICAgICAgICAoMSsgcG9pbnQtbWF4KSkgKSkKKyAgICAg ICAgIChvdmVybGF5cworICAgICAgICAgICAocHJvZ24KKyAgICAgICAgICAgICAob3ZlcmxheS1y ZWNlbnRlciBlbmQpCisgICAgICAgICAgICAgKG92ZXJsYXlzLWluIGJlZyBlbmQpKSkpCisgICAg KHdoZW4gKGFuZCBiZWcgZW5kIG5hbWUgdmFsKQorICAgICAgKGRvbGlzdCAobyBvdmVybGF5cykK KyAgICAgICAgKGNvbmQKKyAgICAgICAgICAoKGFuZCAoZXEgbmFtZSAnZmFjZSkKKyAgICAgICAg ICAgICAgICAoZXEgKG92ZXJsYXktZ2V0IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIDs7IEVp dGhlciBwdXNoIHRoaXMgb3ZlcmxheSBvdXRzaWRlIGJlZy4uLmVuZAorICAgICAgICAgICAgOzsg b3Igc3BsaXQgaXQgdG8gZXhjbHVkZSBiZWcuLi5lbmQKKyAgICAgICAgICAgIDs7IG9yIGRlbGV0 ZSBpdCBlbnRpcmVseSAoaWYgaXQgaXMgY29udGFpbmVkIGluIGJlZy4uLmVuZCkuCisgICAgICAg ICAgICAoaWYgKDwgKG92ZXJsYXktc3RhcnQgbykgYmVnKQorICAgICAgICAgICAgICAgIChpZiAo PiAob3ZlcmxheS1lbmQgbykgZW5kKQorICAgICAgICAgICAgICAocHJvZ24KKyAgICAgICAgICAg ICAgICAobW92ZS1vdmVybGF5IChjb3B5LW92ZXJsYXkgbykKKyAgICAgICAgICAgICAgICAgIChv dmVybGF5LXN0YXJ0IG8pIGJlZykKKyAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gZW5k IChvdmVybGF5LWVuZCBvKSkpCisgICAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gKG92 ZXJsYXktc3RhcnQgbykgYmVnKSkKKyAgICAgICAgICAgICAgKGlmICg+IChvdmVybGF5LWVuZCBv KSBlbmQpCisgICAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVu ZCBvKSkKKyAgICAgICAgICAgICAgICAoZGVsZXRlLW92ZXJsYXkgbykpKSkKKyAgICAgICAgICAo KGFuZCAobm90IChlcSBuYW1lICdmYWNlKSkKKyA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EpKQorICAgICAgKHdoZW4gKGFuZCBq aXQtbG9jay1jb250ZXh0LXRpbWVyCisgICAgICAgICAgICAgICAgIChjYWxsZWQtaW50ZXJhY3Rp dmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcg Jyg0KSkpCisgICAgICAgICh3aGVuICh0aW1lcnAgaml0LWxvY2stY29udGV4dC10aW1lcikKKyAg ICAgICAgICAoY2FuY2VsLXRpbWVyIGppdC1sb2NrLWNvbnRleHQtdGltZXIpKQorICAgICAgICA7 OyAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIChydW4td2l0aC1pZGxlLXRpbWVyIDUuMCAn cmVwZWF0ICdqaXQtbG9jay1jb250ZXh0LWZvbnRpZnkpKQorICAgICAgICAoc2V0cSBqaXQtbG9j ay1jb250ZXh0LXRpbWVyIG5pbCkpCisgICAgICAod2hlbiAoYW5kIChjYWxsZWQtaW50ZXJhY3Rp dmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcg Jyg0KSkpCisgICAgICAgICh3aGVuICh0aW1lcnAgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnkt dGltZXIpCisgICAgICAgICAgKGNhbmNlbC10aW1lciB1bmRvLWF1dG8tY3VycmVudC1ib3VuZGFy eS10aW1lcikpCisgICAgICAgIChmc2V0ICd1bmRvLWF1dG8tLXVuZG9hYmxlLWNoYW5nZQorICAg ICAgICAgICAgICAobGFtYmRhICgpIChhZGQtdG8tbGlzdCAndW5kby1hdXRvLS11bmRvYWJseS1j aGFuZ2VkLWJ1ZmZlcnMgKGN1cnJlbnQtYnVmZmVyKSkpKQorICAgICAgICAoZnNldCAndW5kby1h dXRvLWFtYWxnYW1hdGUgJ2lnbm9yZSkpCisgICAgICAod2hlbiBibGluay1jdXJzb3ItbW9kZQor ICAgICAgICAoYmxpbmstY3Vyc29yLW1vZGUgLTEpCisgIC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JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiBzdGF0aWMg dm9pZAogYnNldF9hYmJyZXZfbW9kZSAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFs KQogewpAQCAtNTE0Miw2ICs1MjA1LDI0IEBAIGluaXRfYnVmZmVyX29uY2UgKHZvaWQpCiAgIGJz ZXRfbGFzdF9zZWxlY3RlZF93aW5kb3cgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIG1ha2VfZml4bnVt ICgwKSk7CiAKICAgaWR4ID0gMTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1V TFRJUExFLUNVUlNPUlMgKi8KKworICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9m bGFncywgbWNfcmVhbF9mYWtlX2N1cnNvciksIGlkeCk7ICsraWR4OworICBYU0VURkFTVElOVCAo QlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgbWNfY29uZiksIGlkeCk7ICsraWR4OworICBYU0VU RkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgbWNfaW5hY3RpdmVfd2luZG93cyks IGlkeCk7ICsraWR4OworICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywg Y3Jvc3NoYWlycyksIGlkeCk7ICsraWR4OworICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9s b2NhbF9mbGFncywgY2hfaG9yaXpvbnRhbF9ydWxlciksIGlkeCk7ICsraWR4OworICBYU0VURkFT VElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgY2hfdmVydGljYWxfcnVsZXIpLCBpZHgp OyArK2lkeDsKKyAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIGNoX2lu YWN0aXZlX3dpbmRvd3MpLCBpZHgpOyArK2lkeDsKKyAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZm ZXJfbG9jYWxfZmxhZ3MsIGZjX3Zpc2libGUpLCBpZHgpOyArK2lkeDsKKyAgWFNFVEZBU1RJTlQg KEJWQVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIGZjX2luYWN0aXZlX3dpbmRvd3MpLCBpZHgpOyAr K2lkeDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBYU0VURkFTVElOVCAoQlZB UiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgbW9kZV9saW5lX2Zvcm1hdCksIGlkeCk7ICsraWR4Owog ICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgYWJicmV2X21vZGUpLCBp ZHgpOyArK2lkeDsKICAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIG92 ZXJ3cml0ZV9tb2RlKSwgaWR4KTsgKytpZHg7CkBAIC01MjI4LDYgKzUzMDksMjQgQEAgaW5pdF9i dWZmZXJfb25jZSAodm9pZCkKICAgLyogTXVzdCBkbyB0aGVzZSBiZWZvcmUgbWFraW5nIHRoZSBm aXJzdCBidWZmZXIhICovCiAKICAgLyogcmVhbCBzZXR1cCBpcyBkb25lIGluIGJpbmRpbmdzLmVs ICovCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKyAgYnNldF9tY19yZWFsX2Zha2VfY3Vyc29yICgmYnVmZmVyX2RlZmF1bHRzLCBRaG9sbG93 KTsKKyAgYnNldF9tY19jb25mICgmYnVmZmVyX2RlZmF1bHRzLCBRbmlsKTsKKyAgYnNldF9tY19p bmFjdGl2ZV93aW5kb3dzICgmYnVmZmVyX2RlZmF1bHRzLCBRdCk7CisgIGJzZXRfY3Jvc3NoYWly cyAoJmJ1ZmZlcl9kZWZhdWx0cywgUW5pbCk7CisgIGJzZXRfY2hfaG9yaXpvbnRhbF9ydWxlciAo JmJ1ZmZlcl9kZWZhdWx0cywgUXQpOworICBic2V0X2NoX3ZlcnRpY2FsX3J1bGVyICgmYnVmZmVy X2RlZmF1bHRzLCBRdCk7CisgIGJzZXRfY2hfaW5hY3RpdmVfd2luZG93cyAoJmJ1ZmZlcl9kZWZh dWx0cywgUXQpOworICBic2V0X2ZjX3Zpc2libGUgKCZidWZmZXJfZGVmYXVsdHMsIFFuaWwpOwor ICBic2V0X2ZjX2luYWN0aXZlX3dpbmRvd3MgKCZidWZmZXJfZGVmYXVsdHMsIFF0KTsKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogICBic2V0X21vZGVfbGluZV9mb3JtYXQgKCZidWZm ZXJfZGVmYXVsdHMsIGJ1aWxkX3B1cmVfY19zdHJpbmcgKCIlLSIpKTsKICAgYnNldF9oZWFkZXJf bGluZV9mb3JtYXQgKCZidWZmZXJfZGVmYXVsdHMsIFFuaWwpOwogICBic2V0X2FiYnJldl9tb2Rl ICgmYnVmZmVyX2RlZmF1bHRzLCBRbmlsKTsKQEAgLTU0NTgsNiArNTU1Nyw1MSBAQCBkZWZ2YXJf cGVyX2J1ZmZlciAoc3RydWN0IExpc3BfQnVmZmVyX09iamZ3ZCAqYm9fZndkLCBjb25zdCBjaGFy ICpuYW1lc3RyaW5nLAogdm9pZAogc3ltc19vZl9idWZmZXIgKHZvaWQpCiB7CisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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czNiw2ICs3MzYsNDAgQEAg c3RydWN0IGJ1ZmZlcgogICAgICBpbiB0aGUgZGlzcGxheSBvZiB0aGlzIGJ1ZmZlci4gICovCiAg IExpc3BfT2JqZWN0IGV4dHJhX2xpbmVfc3BhY2luZ187CiAKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogVGhlIGN1cnNvciB0eXBlIG9m IHRoZSByZWFsIGZha2UgY3Vyc29yLiAqLworICBMaXNwX09iamVjdCBtY19yZWFsX2Zha2VfY3Vy c29yXzsKKworICAvKiBUaGUgbmFtZSBvZiBsaXN0IHVzZWQgYnkgbXVsdGlwbGUgY3Vyc29ycyBm b3IgbmV4dCByZWRpc3BsYXkuICovCisgIExpc3BfT2JqZWN0IG1jX2NvbmZfOworCisgIC8qIFdo ZXRoZXIgdG8gZHJhdyBtdWx0aXBsZSBjdXJzb3JzIGluIGluYWN0aXZlIHdpbmRvd3MuICovCisg IExpc3BfT2JqZWN0IG1jX2luYWN0aXZlX3dpbmRvd3NfOworCisgIC8qIFRoZSBuYW1lIG9mIHRo ZSBidWZmZXItbG9jYWwgdmFyaWFibGUuICovCisgIExpc3BfT2JqZWN0IGNyb3NzaGFpcnNfOwor CisgIC8qIFRoZSBuYW1lIG9mIHRoZSBjcm9zc2hhaXJzIGhvcml6b250YWwgcnVsZXIuICovCisg IExpc3BfT2JqZWN0IGNoX2hvcml6b250YWxfcnVsZXJfOworCisgIC8qIFRoZSBuYW1lIG9mIHRo ZSBjcm9zc2hhaXJzIHZlcnRpY2FsIHJ1bGVyLiAqLworICBMaXNwX09iamVjdCBjaF92ZXJ0aWNh bF9ydWxlcl87CisKKyAgLyogV2hldGhlciB0byBkcmF3IGNyb3NzaGFpcnMgaW4gaW5hY3RpdmUg d2luZG93cy4gKi8KKyAgTGlzcF9PYmplY3QgY2hfaW5hY3RpdmVfd2luZG93c187CisKKyAgLyog VGhlIG5hbWUgb2YgdGhlIGJ1ZmZlci1sb2NhbCB2YXJpYWJsZS4gKi8KKyAgTGlzcF9PYmplY3Qg ZmNfdmlzaWJsZV87CisKKyAgLyogV2hldGhlciB0byBkcmF3IG11bHRpcGxlIGN1cnNvcnMgZmls bCBjb2x1bW4gaW4gaW5hY3RpdmUgd2luZG93cy4gKi8KKyAgTGlzcF9PYmplY3QgZmNfaW5hY3Rp dmVfd2luZG93c187CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogQ3Vyc29y IHR5cGUgdG8gZGlzcGxheSBpbiBub24tc2VsZWN0ZWQgd2luZG93cy4KICAgICAgdCBtZWFucyB0 byB1c2UgaG9sbG93IGJveCBjdXJzb3IuCiAgICAgIFNlZSBgY3Vyc29yLXR5cGUnIGZvciBvdGhl ciB2YWx1ZXMuICAqLwpAQCAtNzg3LDE0ICs4MjEsMjEgQEAgc3RydWN0IGJ1ZmZlcgogICAgICBh biBpbmRpcmVjdCBidWZmZXIgc2luY2UgaXQgY291bnRzIGFzIGl0cyBiYXNlIGJ1ZmZlci4gICov CiAgIGludCB3aW5kb3dfY291bnQ7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBN VUxUSVBMRS1DVVJTT1JTICovCisKICAgLyogQSBub24temVybyB2YWx1ZSBpbiBzbG90IElEWCBt ZWFucyB0aGF0IHBlci1idWZmZXIgdmFyaWFibGUKICAgICAgd2l0aCBpbmRleCBJRFggaGFzIGEg bG9jYWwgdmFsdWUgaW4gdGhpcyBidWZmZXIuICBUaGUgaW5kZXggSURYCiAgICAgIGZvciBhIGJ1 ZmZlci1sb2NhbCB2YXJpYWJsZSBpcyBzdG9yZWQgaW4gdGhhd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2ZV93aW5kb3dzXyA9IHZhbDsKK30KKwor SU5MSU5FIHZvaWQKK2JzZXRfYmx2X2ZjX3Zpc2libGUgKHN0cnVjdCBidWZmZXIgKmIsIExpc3Bf T2JqZWN0IHZhbCkKK3sKKyAgYi0+ZmNfdmlzaWJsZV8gPSB2YWw7Cit9CisKK0lOTElORSB2b2lk Citic2V0X2Jsdl9mY19pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09i amVjdCB2YWwpCit7CisgIGItPmZjX2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQorCisvKiBl bmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogSU5M SU5FIHZvaWQKIGJzZXRfYmlkaV9wYXJhZ3JhcGhfZGlyZWN0aW9uIChzdHJ1Y3QgYnVmZmVyICpi LCBMaXNwX09iamVjdCB2YWwpCiB7CmRpZmYgLS1naXQgYS9zcmMvZGlzcGV4dGVybi5oIGIvc3Jj L2Rpc3BleHRlcm4uaAppbmRleCAxYTUzNjU2Li5kNjg5YTJkIDEwMDY0NAotLS0gYS9zcmMvZGlz cGV4dGVybi5oCisrKyBiL3NyYy9kaXNwZXh0ZXJuLmgKQEAgLTEwMCw2ICsxMDAsMzYgQEAgdHlw ZWRlZiBpbnQgQ3Vyc29yOwogI2RlZmluZSBOYXRpdmVSZWN0YW5nbGUgaW50CiAjZW5kaWYKIAor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExFLUNVUlNPUlMgKi8K KworLyogRm9yd2FyZCBwcm90b3R5cGUgZGVmaW5pdGlvbnMuICovCitlbnVtIHR5cGVfb2ZfY2Fj aGU7CisKK2VudW0gdHlwZV9vZl9jdXJzb3I7CisKK2VudW0gbWNfZmxhdm9yOworCitlbnVtIHR5 cGVfb2ZfYWN0aW9uCit7CisgIE1VTFRJUExFX0NVUlNPUlMsCisgIEhPUklaT05UQUxfUlVMRVIs CisgIFZFUlRJQ0FMX1JVTEVSLAorICBGSUxMX0NPTFVNTgorfTsKKworc3RydWN0IG1jX1JHQgor eworICBkb3VibGUgcmVkOworICBkb3VibGUgZ3JlZW47CisgIGRvdWJsZSBibHVlOworfTsKKwor LyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK IC8qIFRleHQgY3Vyc29yIHR5cGVzLiAgKi8KIAogZW51bSB0ZXh0X2N1cnNvcl9raW5kcwpAQCAt MzgyLDYgKzQxMiwyMCBAQCBzdHJ1Y3QgZ2x5cGhfc2xpY2UKIAogc3RydWN0IGdseXBoCiB7CisK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAg aW50IHgsIHksIGhwb3MsIHZwb3M7CisKKyAgaW50IHJlbGF0aXZlX3g7CisKKyAgYm9vbF9iZiB6 dl9wIDogMTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBQb3NpdGlvbiBm cm9tIHdoaWNoIHRoaXMgZ2x5cGggd2FzIGRyYXduLiAgSWYgYG9iamVjdCcgYmVsb3cgaXMgYQog ICAgICBMaXNwIHN0cmluZywgdGhpcyBpcyBhbiBpbmRleCBpbnRvIHRoYXQgc3RyaW5nLiAgSWYg aXQgaXMgYQogICAgICBidWZmZXIsIHRoaXMgaXMgYSBwb3NpdGlvbiBpbiB0aGF0IGJ1ZmZlci4g IEluIGFkZGl0aW9uLCBzb21lCkBAIC0xMjQ4LDYgKzEyOTIsMjggQEAgZW51bSBkcmF3X2dseXBo c19mYWNlCiAKIHN0cnVjdCBnbHlwaF9zdHJpbmcKIHsKKworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIGJvb2xfYmYgbGVmdF9vdmVyd3Jp dHRlbl9wIDogMTsKKworICAgIGJvb2xfYmYgcmlnaHRfb3ZlcndyaXR0ZW5fcCA6IDE7CisKKyAg ICBib29sX2JmIHJlY3RhbmdsZV9udWtlZF9wIDogMTsKKworICAgIGJvb2xfYmYgYmFja2dyb3Vu ZF9udWtlZF9wIDogMTsKKworICAgIGVudW0gZHJhd19nbHlwaF9hY3Rpb24KKyAgICB7CisgICAg ICBNQ19EUkFXX0dMWVBILAorICAgICAgTUNfRVJBU0VfR0xZUEgKKyAgICB9IGFjdGlvbl90eXBl OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIFgtb3JpZ2luIG9mIHRoZSBz dHJpbmcuICAqLwogICBpbnQgeDsKIApAQCAtMjIxNiw2ICsyMjgyLDE2IEBAIHN0cnVjdCBjb21w b3NpdGlvbl9pdAogCiBzdHJ1Y3QgaXQKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBib29sX2JmIHp2X3AgOiAxOworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioq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gd2QsIGJvb2wgYWN0aXZlX3As IGJvb2wgY3Vyc29yX2djX3ApOworCisgIHZvaWQgKCptY19zY3JpYmVfY3Vyc29yKSAoc3RydWN0 IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LAorICAgICAgICBzdHJ1Y3Qg Z2x5cGhfcm93ICpnbHlwaF9yb3csIGludCB4LCBpbnQgZngsIGludCB5LCBpbnQgZnksIGludCBo cG9zLAorICAgICAgICBpbnQgdnBvcywgaW50IHdkLCBpbnQgaCwgc3RydWN0IG1jX1JHQiBsc2ws IGVudW0gdHlwZV9vZl9jdXJzb3IgY3Vyc29yX3R5cGUsCisgICAgICAgIGludCBjdXJzb3Jfd2lk dGgsIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciwgYm9vbCBvbl9wLCBib29sIGFjdGl2ZV9w KTsKKworICB2b2lkICgqbWNfc2NyaWJlX3N0cmluZykgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMs IHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAg ICAgICBzdHJ1Y3QgbWNfUkdCIGxzbCwgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yLAorICAg ICAgICBlbnVtIHR5cGVfb2ZfY3Vyc29yIGN1cnNvcl90eXBlLCBpbnQgd2QsIGJvb2wgYWN0aXZl X3AsIGJvb2wgY3Vyc29yX2djX3ApOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAg IC8qIEhhbmRsZXJzIGZvciBzZXR0aW5nIGZyYW1lIHBhcmFtZXRlcnMuICAqLwogICBmcmFtZV9w YXJtX2hhbmRsZXIgKmZyYW1lX3Bhcm1faGFuZGxlcnM7CiAKQEAgLTMyNzAsNiArMzM3MSw2NyBA QCBleHRlcm4gdm9pZCBnZXRfZm9udF9hc2NlbnRfZGVzY2VudCAoc3RydWN0IGZvbnQgKiwgaW50 ICosIGludCAqKTsKIAogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQogCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCitleHRlcm4gTGlz cF9PYmplY3QgbWNfbGlzdG4gKHB0cmRpZmZfdCwgTGlzcF9PYmplY3QsIC4uLik7CisKK2V4dGVy biBMaXNwX09iamVjdCBtY19udGggKGludCwgTGlzcF9PYmplY3QpOworCitleHRlcm4gTGlzcF9P YmplY3QgbWNfYXNzcSAoTGlzcF9PYmplY3QsIExpc3BfT2JqZWN0KTsKKworZXh0ZXJuIHZvaWQg bWNfeHdfY29sb3JfdmFsdWVzIChzdHJ1Y3Qgd2luZG93ICosIExpc3BfT2JqZWN0LCBzdHJ1Y3Qg bWNfUkdCICopOworCitleHRlcm4gYm9vbCBtY191cGRhdGVfd2luZG93X2ZyaW5nZXMgKHN0cnVj dCB3aW5kb3cgKiwgYm9vbCk7CisKK2V4dGVybiBjaGFyICogbWNfd2luZG93IChzdHJ1Y3Qgd2lu ZG93ICopOworCitleHRlcm4gY2hhciAqIG1jX2NoYXJfdG9fc3RyaW5nIChpbnQpOworCitleHRl cm4gY2hhciAqIG1jX2N1cnNvcl90eXBlX3RvX3N0cmluZyAoZW51bSB0eXBlX29mX2N1cnNvcik7 CisKK2V4dGVybiBjaGFyICogbWNfZmxhdm9yX3RvX3N0cmluZyAoZW51bSBtY19mbGF2b3IpOwor CitleHRlcm4gdm9pZCBtY19kcmF3X2ZyaW5nZV9iaXRtYXAgKHN0cnVjdCB3aW5kb3cgKiwgc3Ry dWN0IGdseXBoX3JvdyAqLCBpbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGVudW0gdHlwZV9vZl9jdXJzb3IpOworCitleHRlcm4gaW50IG1jX2dldF9mcmluZ2VfYml0bWFw IChzdHJ1Y3Qgd2luZG93ICosIExpc3BfT2JqZWN0LCBpbnQsIGludCk7CisKK2V4dGVybiB2b2lk IG1jX2VuZ2luZSAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVj dCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoICosIGlu dCwgaW50LCBpbnQsIGludCwgaW50LCBpbnQsCisgICAgICAgICAgICAgICAgICAgICAgIGVudW0g dHlwZV9vZl9jdXJzb3IsIGludCwgc3RydWN0IGdseXBoX21hdHJpeCAqLCBpbnQsCisgICAgICAg ICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IsIGJvb2wsIGVudW0gdHlwZV9vZl9hY3Rpb24s IGJvb2wsCisgICAgICAgICAgICAgICAgICAgICAgIGVudW0gdHlwZV9vZl9jYWNoZSk7CisKK2V4 dGVybiB2b2lkIG1jX3NldF9lc3NlbnRpYWxzIChzdHJ1Y3Qgd2luZG93ICosIGJvb2wsIHN0cnVj dCBtY19SR0IgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdC ICosIGludCAqKTsKKworZXh0ZXJuIHZvaWQgbWNfZHJhd19yb3cgKHN0cnVjdCB3aW5kb3cgKiwg c3RydWN0IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAgICAgICAgICAg ICAgICAgICAgICAgc3RydWN0IGdseXBoICosIGludCwgaW50LCBpbnQsIGludCwgYm9vbCwgc3Ry dWN0IGdseXBoX21hdHJpeCAqLAorICAgICAgICAgICAgICAgICAgICAgICAgIGludCwgc3RydWN0 IG1jX1JHQiwgc3RydWN0IG1jX1JHQiwgYm9vbCk7CisKK2V4dGVybiB2b2lkIG1jX3JlZHJhd19y b3cgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhf cm93ICosCisgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQsIGludCwgaW50LCBib29sLCBl bnVtIGRyYXdfZ2x5cGhzX2ZhY2UpOworCitleHRlcm4gdm9pZCBtY19yZXNldF9jYWNoZSAoc3Ry dWN0IHdpbmRvdyAqLCBlbnVtIHR5cGVfb2ZfY2FjaGUpOworCitleHRlcm4gdm9pZCBtY19wcmVf c2Nyb2xsX2NsZWFuIChzdHJ1Y3Qgd2luZG93ICopOworCitleHRlcm4gdm9pZCBtY19kcmF3X2N1 cnNvcl9nbHlwaCAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqLCBlbnVtIGRy YXdfZ2x5cGhzX2ZhY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBp bnQsIGludCwgc3RydWN0IG1jX1JHQiwgZW51bSBtY19mbGF2b3IsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgZW51bSB0eXBlX29mX2N1cnNvciwgaW50LCBib29sLCBib29sKTsK KworZXh0ZXJuIHZvaWQgbWNfeF93cml0ZV9nbHlwaHMgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0 IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgc3RydWN0IGdseXBoICosIGVudW0gZ2x5cGhfcm93X2FyZWEsIGludCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQsIGludCwgc3RydWN0IG1jX1JHQiwgZW51 bSBtY19mbGF2b3IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSB0eXBlX29m X2N1cnNvciwgaW50LCBib29sLCBib29sKTsKKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8K Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICNpZmRlZiBHTFlQSF9ERUJVRwogZXh0ZXJu IHZvaWQgZHVtcF9nbHlwaF9zdHJpbmcgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKikgRVhURVJOQUxM WV9WSVNJQkxFOwogI2VuZGlmCmRpZmYgLS1naXQgYS9zcmMvZGlzcG5ldy5jIGIvc3JjL2Rpc3Bu ZXcuYwppbmRleCBjY2IwOGVjLi40NDI3MDIyIDEwMDY0NAotLS0gYS9zcmMvZGlzcG5ldy5jCisr KyBiL3NyYy9kaXNwbmV3LmMKQEAgLTU2LDYgKzU2LDUzMiBAQCBhbG9uZyB3aXRoIEdOVSBFbWFj cy4gIElmIG5vdCwgc2VlIDxodHRwczovL3d3dy5nbnUub3JnL2xpY2Vuc2VzLz4uICAqLwogI2lu Y2x1ZGUgInczMi5oIgogI2VuZGlmCiAMCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisv KiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKK3N0cnVjdCBnbHlwaHNfc2tpcHBlZAorewor ICBwdHJkaWZmX3QgYWxsb2NhdGVkOworICBwdHJkaWZmX3QgdXNlZDsKKyAgc3RydWN0IHNraXBw ZWRfaXRlbXMKKyAgICB7CisgICAgICBpbnQgeDsKKyAgICAgIGludCBocG9zOworICAgICAgYm9v bCBlbmFibGVkX3A7CisgICAgfSAqc2tpcHBlZDsKK307CisKK3N0cnVjdCBnbHlwaHNfc2tpcHBl ZCBhcnJheV9nbHlwaHNfc2tpcHBlZDsKKworc3RhdGljIHZvaWQgdXBkYXRlX21hcmdpbmFsX2Fy ZWEgKHN0cnVjdCB3aW5kb3c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iBgaWYgJyB3aXRoIHRoZSBgZicgaW4KKyAgICAgICBDb3VyaWVyIGJvbGQgc28gdGhh dCBpdCBvdmVybGFwcyB0aGUgYCAnIHRvIGl0cyByaWdodC4KKyAgICAgICBJZiB0aGUgZGVzaXJl ZCByb3cgaXMgYCAnLCB3ZSB3b3VsZCBza2lwIG92ZXIgdGhlIHNwYWNlCisgICAgICAgYWZ0ZXIg dGhlIGBpZicgYW5kIHRoZXJlIHdvdWxkIHJlbWFpbiBhIHBpeGVsIGZyb20gdGhlCisgICAgICAg YGYnIG9uIHRoZSBzY3JlZW4uICovCisgICAgaWYgKG92ZXJsYXBwaW5nX2dseXBoc19wICYmIGkg PiAwKQorICAgICAgeworICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoID0gJmN1cnJlbnRfcm93 LT5nbHlwaHNbVEVYVF9BUkVBXVtpIC0gMV07CisgICAgICAgIGludCBsZWZ0LCByaWdodDsKKyAg ICAgICAgcmlmLT5nZXRfZ2x5cGhfb3ZlcmhhbmdzIChnbHlwaCwgWEZSQU1FICh3LT5mcmFtZSks ICZsZWZ0LCAmcmlnaHQpOworICAgICAgICBjYW5fc2tpcF9wID0gKHJpZ2h0ID09IDAgJiYgIWFi b3J0X3NraXBwaW5nKTsKKyAgICAgIH0KKworICAgIGlmIChjYW5fc2tpcF9wKQorICAgICAgewor ICAgICAgICBpbnQgc3RhcnRfaHBvcyA9IGk7CisKKyAgICAgICAgd2hpbGUgKGkgPCBzdG9wCisg ICAgICAgICAgICAgICAmJiBHTFlQSF9FUVVBTF9QIChkZXNpcmVkX2dseXBoLCBjdXJyZW50X2ds eXBoKSkKKyAgICAgICAgICB7CisgICAgICAgICAgICArK2FycmF5X2dseXBoc19za2lwcGVkLnVz ZWQ7CisgICAgICAgICAgICBpZiAoYXJyYXlfZ2x5cGhzX3NraXBwZWQuYWxsb2NhdGVkIDwgYXJy YXlfZ2x5cGhzX3NraXBwZWQudXNlZCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg IGludCBvbGRfYWxsb2MgPSBhcnJheV9nbHlwaHNfc2tpcHBlZC5hbGxvY2F0ZWQ7CisgICAgICAg ICAgICAgICAgaW50IG5ld19lbHRzID0gYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZCAtIGFycmF5 X2dseXBoc19za2lwcGVkLmFsbG9jYXRlZDsKKyAgICAgICAgICAgICAgICBhcnJheV9nbHlwaHNf c2tpcHBlZC5za2lwcGVkID0KKyAgICAgICAgICAgICAgICAgIHhwYWxsb2MgKGFycmF5X2dseXBo c19za2lwcGVkLnNraXBwZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmYXJyYXlfZ2x5 cGhzX3NraXBwZWQuYWxsb2NhdGVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2Vs dHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBJTlRfTUFYLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgc2l6ZW9mICphcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVkKTsKKyAgICAg ICAgICAgICAgICBtZW1zZXQgKGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWQgKyBvbGRfYWxs b2MsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgKGFycmF5X2dseXBoc19za2lwcGVkLmFs bG9jYXRlZCAtIG9sZF9hbGxvYykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICogc2l6ZW9m ICphcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVkKTsKKyAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgaW50IG50aCA9IGFycmF5X2dseXBoc19za2lwcGVkLnVzZWQgLSAxOworICAgICAgICAg ICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZFtudGhdLnggPSB4OworICAgICAgICAgICAg YXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZFtudGhdLmhwb3MgPSBpOworICAgICAgICAgICAg YXJyYXlfZ2x5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7CisgICAgICAgICAg ICByaWYtPmdldF9nbHlwaF9vdmVyaGFuZ3MgKGN1cnJlbnRfZ2x5cGgsCisgICAgICAgICAgICAg ICAgICAgIFhGUkFNRSAody0+ZnJhbWUpLAorICAgICAgICAgICAgICAgICAgICAmbGVmdCwgJnJp Z2h0KTsKKyAgICAgICAgICAgIHdoaWxlIChsZWZ0ID4gMCAmJiBpID4gMCkKKyAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgIC0taSwgLS1kZXNpcmVkX2dseXBoLCAtLWN1cnJlbnRfZ2x5 cGg7CisgICAgICAgICAgICAgICAgeCAtPSBkZXNpcmVkX2dseXBoLT5waXhlbF93aWR0aDsKKyAg ICAgICAgICAgICAgICBsZWZ0IC09IGRlc2lyZWRfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAvKiBBYm9ydCB0aGUgc2tpcHBpbmcgYWxnb3JpdGhtIGlm IHdlIGVuZCB1cCBiZWZvcmUKKyAgICAgICAgICAgICAgIG91ciBzdGFydGluZyBwb2ludCwgdG8g YXZvaWQgbG9vcGluZyAoYnVnIzEwNzApLgorICAgICAgICAgICAgICAgVGhpcyBjYW4gaGFwcGVu IHdoZW4gdGhlIGxiZWFyaW5nIGlzIGxhcmdlciB0aGFuCisgICAgICAgICAgICAgICB0aGUgcGl4 ZWwgd2lkdGguICovCisgICAgICAgICAgICBhYm9ydF9za2lwcGluZyA9IChpIDwgc3RhcnRfaHBv cyk7CisgICAgICAgICAgfQorICAgICAgfQorCisgICAgLyogVHJ5IHRvIGF2b2lkIHdyaXRpbmcg dGhlIGVudGlyZSByZXN0IG9mIHRoZSBkZXNpcmVkIHJvdworICAgICAgIGJ5IGxvb2tpbmcgZm9y IGEgcmVzeW5jIHBvaW50LiAgVGhpcyBtYWlubHkgcHJldmVudHMKKyAgICAgICBtb2RlIGxpbmUg ZmxpY2tlcmluZyBpbiB0aGUgY2FzZSB0aGUgbW9kZSBsaW5lIGlzIGluCisgICAgICAgZml4ZWQt cGl0Y2ggZm9udCwgd2hpY2ggaXQgdXN1YWxseSB3aWxsIGJlLiAqLworICAgIGlmIChpIDwgZGVz aXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgIHsKKyAgICAgICAgaW50IHN0YXJ0X3gg PSB4LCBzdGFydF9ocG9zID0gaTsKKyAgICAgICAgc3RydWN0IGdseXBoICpzdGFydCA9IGRlc2ly ZWRfZ2x5cGg7CisgICAgICAgIGludCBjdXJyZW50X3ggPSB4OworICAgICAgICBib29sIHNraXBf Zmlyc3RfcCA9ICFjYW5fc2tpcF9wOworICAgICAgICAvKiBGaW5kIHRoZSBuZXh0IGdseXBoIHRo YXQncyBlcXVhbCBhZ2Fpbi4gKi8KKyAgICAgICAgd2hpbGUgKGkgPCBzdG9wCisgICAgICAgICAg ICAgICAmJiAoc2tpcF9maXJzdF9wCisgICAgICAgICAgICAgICAgICAgfHwgIUdMWVBIX0VRVUFM X1AgKGRlc2lyZWRfZ2x5cGgsIGN1cnJlbnRfZ2x5cGgpKQorICAgICAgICAgICAgICAgJiYgeCA9 PSBjdXJyZW50X3gpCisgICAgICAgICAgeworICAgICAgICAgICAgeCArPSBkZXNpcmVkX2dseXBo LT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgIGN1cnJlbnRfeCArPSBjdXJyZW50X2dseXBoLT5w aXhlbF93aWR0aDsKKyAgICAgICAgICAgICsrZGVzaXJlZF9nbHlwaCwgKytjdXJyZW50X2dseXBo LCArK2k7CisgICAgICAgICAgICBza2lwX2ZpcnN0X3AgPSAwOworICAgICAgICAgIH0KKworICBm b3IgKGludCBlbHQgPSAwOworICAgICAgIGVsdCA8IGFycmF5X2dseXBoc19za2lwcGVkLnVzZWQK KyAgICAgICAmJiB2cG9zICE9IGJvdHRvbV92cG9zOworICAgICAgICsrZWx0KQorICAgIHsKKyAg ICAgIGludCB4ID0gYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZFtlbHRdLng7CisgICAgICBp bnQgaHBvcyA9IGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbZWx0XS5ocG9zOworICAgICAg c3RydWN0IGdseXBoICp0YXJnZXRfZ2x5cGggPQorICAgICAgICBtY19nZXRfY3Vyc29yX2dseXBo ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIGhwb3MsIHZwb3MpOworICAgICAgaWYg KGRlYnVnX3ApCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIlNLSVBQRUQ6ICBjaGFyICglZC8l cykgfCB4OiAoJWQpIHwgaHBvcyAoJWQpIHwgdnBvcyAoJWQpXG4iLAorICAgICAgICAgICAgICAg ICAgICAgICAgIHRhcmdldF9nbHlwaC0+dS5jaCwgbWNfY2hhcl90b19zdHJpbmcgKHRhcmdldF9n bHlwaC0+dS5jaCksCisgICAgICAgICAgICAgICAgICAgICAgICAgeCwgaHBvcywgdnBvcyk7Cisg ICAgICBtY19kcmF3X3JvdyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRf Z2x5cGgsIHgsIDEsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgYm90dG9tX3Zwb3MsIGFjdGl2 ZV9wLCBjdXJzb3JfbWF0cml4LCBmY194LCBjaF9mb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAg ICAgIGZjX2ZvcmVncm91bmQsIHRydWUpOworICAgIH0KKworICAgICAgICBpZiAoaSA9PSBzdGFy dF9ocG9zIHx8IHggIT0gY3VycmVudF94KQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGkgPSBz dGFydF9ocG9zOworICAgICAgICAgICAgeCA9IHN0YXJ0X3g7CisgICAgICAgICAgICBkZXNpcmVk X2dseXBoID0gc3RhcnQ7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICB9CisKKyAgICAg ICAgb3V0cHV0X2N1cnNvcl90byAodywgdnBvcywgc3RhcnRfaHBvcywgZGVzaXJl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CB4ICglZCkgfCBocG9zICglZCkgLS0gVE8gRU5ELlxuIiwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgIHN0YXJ0LT51LmNoLCBtY19jaGFyX3RvX3N0cmluZyAoc3RhcnQtPnUuY2gpLCB4 LCBocG9zKTsKKyAgICAgICAgbWNfZHJhd19yb3cgKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVk X3Jvdywgc3RhcnQsIHgsCisgICAgICAgICAgICAgICAgICAgICB1cGRhdGVkX3Jvdy0+dXNlZFtU RVhUX0FSRUFdIC0gaHBvcywgdnBvcywgYm90dG9tX3Zwb3MsCisgICAgICAgICAgICAgICAgICAg ICBhY3RpdmVfcCwgY3Vyc29yX21hdHJpeCwgZmNfeCwgY2hfZm9yZWdyb3VuZCwgZmNfZm9yZWdy b3VuZCwKKyAgICAgICAgICAgICAgICAgICAgIHRydWUpOworICAgICAgfQorICAgICAgLyogVGhl cmUgd2VyZSBubyBjaGFuZ2VzIGFuZCBpID09IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0g Ki8KKyAgICAgIGVsc2UgaWYgKCFjaGFuZ2VkX3ApCisgICAgICAgIHsKKyAgICAgICAgICBpZiAo ZGVidWdfcCkKKyAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIlVOQ0hBTkdFRCAtLSBXUklU RSBFTlRJUkUgTElORS5cbiIpOworICAgICAgICAgIG1jX2RyYXdfcm93ICh3LCBkZXNpcmVkX21h dHJpeCwgdXBkYXRlZF9yb3csIGRlc2lyZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAg ICAgICAgICAgICAgICAgICAgZGVzaXJlZF9yb3ctPngsIGRlc2lyZWRfcm93LT51c2VkW1RFWFRf QVJFQV0sIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgIGJvdHRvbV92cG9zLCBhY3RpdmVf cCwgY3Vyc29yX21hdHJpeCwgZmNfeCwgY2hfZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAg ICAgICAgZmNfZm9yZWdyb3VuZCwgdHJ1ZSk7CisgICAgICAgIH0KKworICAgICAgLyogTWF5YmUg Y2xlYXIgdG8gZW5kIG9mIGxpbmUuICovCisgICAgICBpZiAoTUFUUklYX1JPV19FWFRFTkRTX0ZB Q0VfUCAoZGVzaXJlZF9yb3cpKQorICAgICAgICB7CisgICAgICAgICAgLyogSWYgbmV3IHJvdyBl eHRlbmRzIHRvIHRoZSBlbmQgb2YgdGhlIHRleHQgYXJlYSwgbm90aGluZworICAgICAgICAgICAg IGhhcyB0byBiZSBjbGVhcmVkLCBpZiBhbmQgb25seSBpZiB3ZSBkaWQgYSB3cml0ZV9nbHlwaHMK KyAgICAgICAgICAgICBhYm92ZS4gIFRoaXMgaXMgbWFkZSBzdXJlIGJ5IHNldHRpbmcgZGVzaXJl ZF9zdG9wX3BvcworICAgICAgICAgICAgIGFwcHJvcHJpYXRlbHkgYWJvdmUuICovCisgICAgICAg ICAgZWFzc2VydCAoaSA8IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAg ICAgICAgICB8fCAoKGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gPT0gY3VycmVudF9yb3ct PnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgTUFUUklYX1JPV19F WFRFTkRTX0ZBQ0VfUCAoY3VycmVudF9yb3cpKSk7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYg KE1BVFJJWF9ST1dfRVhURU5EU19GQUNFX1AgKGN1cnJlbnRfcm93KSkKKyAgICAgICAgeworICAg ICAgICAgIC8qIElmIG9sZCByb3cgZXh0ZW5kcyB0byB0aGUgZW5kIG9mIHRoZSB0ZXh0IGFyZWEs IGNsZWFyLiAqLworICAgICAgICAgIGlmIChpID49IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJF QV0pCisgICAgICAgICAgICBvdXRwdXRfY3Vyc29yX3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RvIGl0IHRoaXMgd2F5LiAqLworICAgICAgICAgIGlmICh2cG9zID09IHctPnBoeXNf Y3Vyc29yLnZwb3MKKyAgICAgICAgICAgICAgJiYgKGRlc2lyZWRfcm93LT5yZXZlcnNlZF9wCisg ICAgICAgICAgICAgICAgICA/ICh3LT5waHlzX2N1cnNvci5ocG9zIDwgMCkKKyAgICAgICAgICAg ICAgICAgIDogKHctPnBoeXNfY3Vyc29yLmhwb3MgPj0gZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9B UkVBXSkpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICB3LT5waHlzX2N1cnNvcl9vbl9w ID0gMDsKKyAgICAgICAgICAgICAgeGxpbSA9IC0xOworICAgICAgICAgICAgfQorICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgIHhsaW0gPSBjdXJyZW50X3Jvdy0+cGl4ZWxfd2lkdGg7CisgICAg ICAgICAgcmlmLT5jbGVhcl9lbmRfb2ZfbGluZSAodywgdXBkYXRlZF9yb3csIFRFWFRfQVJFQSwg eGxpbSk7CisgICAgICAgICAgY2xlYXJfdG9feCA9IHhsaW07CisgICAgICAgICAgY2hhbmdlZF9w ID0gMTsKKyAgICAgICAgfQorCisgIGlmIChjaGFuZ2VkX3AKKyAgICAgICYmIGNsZWFyX3RvX3gg IT0gMCkKKyAgICB7CisgICAgICBpbnQgdGV4dF9hcmVhX3dpZHRoID0gd2luZG93X2JveF93aWR0 aCAodywgVEVYVF9BUkVBKTsKKyAgICAgIHN0cnVjdCBtY19SR0IgZGVidWdfZmcgPSB7LnJlZCA9 IDAuODY3LCAuZ3JlZW4gPSAwLjg2NywgLmJsdWUgPSAwLjg2N307CisgICAgICBzdHJ1Y3QgZ2x5 cGggKnRhcmdldF9nbHlwaCA9IHVwZGF0ZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHVwZGF0 ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxOworICAgICAgLyogYG1jX2VuZ2luZScgb25se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UiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBj cm9zc2hhaXJzKSkKKyAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBjaF9ob3Jpem9udGFsX3J1bGVyKSkKKyAgICAgICAgICAmJiB4IDwgdGV4dF9hcmVhX3dp ZHRoCisgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAgICAgICYmIHRh cmdldF9nbHlwaCAhPSBOVUxMKQorICAgICAgICBtY19lbmdpbmUgKHcsIGRlc2lyZWRfbWF0cml4 LCB1cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBoLCBURVhUX0FSRUEsIHgsIHhfbGltaXQsCisgICAg ICAgICAgICAgICAgICAgdXBkYXRlZF9yb3ctPnksIGhwb3MsIHZwb3MsIE1DX0hCQVIsIDEsIGN1 cnNvcl9tYXRyaXgsIGZjX3gsCisgICAgICAgICAgICAgICAgICAgZGVidWdfcCA/IGRlYnVnX2Zn IDogY2hfZm9yZWdyb3VuZCwgYWN0aXZlX3AsIEhPUklaT05UQUxfUlVMRVIsCisgICAgICAgICAg ICAgICAgICAgdHJ1ZSwgTk9fQ0FDSEUpOworCisgICAgICBpZiAoQlVGRkVSUCAody0+Y29udGVu dHMpCisgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jv c3NoYWlycykpCisgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICYmIHggPCB0ZXh0X2FyZWFfd2lkdGgK KyAgICAgICAgICAmJiB2cG9zICE9IHctPmN1cnNvci52cG9zCisgICAgICAgICAgJiYgdy0+Y3Vy c29yLnggPj0geAorICAgICAgICAgICYmIHRhcmdldF9nbHlwaCAhPSBOVUxMKQorICAgICAgICBt Y19lbmdpbmUgKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBoLCBU RVhUX0FSRUEsIHgsIHhfbGltaXQsCisgICAgICAgICAgICAgICAgICAgdXBkYXRlZF9yb3ctPnks IGhwb3MsIHZwb3MsIE1DX0JBUiwgMSwgY3Vyc29yX21hdHJpeCwgZmNfeCwKKyAgICAgICAgICAg ICAgICAgICBkZWJ1Z19wID8gZGVidWdfZmcgOiBjaF9mb3JlZ3JvdW5kLCBhY3RpdmVfcCwgVkVS VElDQUxfUlVMRVIsCisgICAgICAgICAgICAgICAgICAgdHJ1ZSwgTk9fQ0FDSEUpOworCisgICAg ICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhC VUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgJiYgeCA8IHRleHRf YXJlYV93aWR0aAorICAgICAgICAgICYmIGZjX3ggPj0geAorICAgICAgICAgICYmIHRhcmdldF9n bHlwaCAhPSBOVUxMKQorICAgICAgICBtY19lbmdpbmUgKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRh dGVkX3JvdywgdGFyZ2V0X2dseXBoLCBURVhUX0FSRUEsIHgsIHhfbGltaXQsCisgICAgICAgICAg ICAgICAgICAgdXBkYXRlZF9yb3ctPnksIGhwb3MsIHZwb3MsIE1DX0JBUiwgMSwgY3Vyc29yX21h dHJpeCwgZmNfeCwKKyAgICAgICAgICAgICAgICAgICBkZWJ1Z19wID8gZGVidWdfZmcgOiBmY19m b3JlZ3JvdW5kLCBhY3RpdmVfcCwgRklMTF9DT0xVTU4sCisgICAgICAgICAgICAgICAgICAgdHJ1 ZSwgTk9fQ0FDSEUpOworCisgICAgfQorICAgIH0KKyAgcmV0dXJuIGNoYW5nZWRfcDsKK30KKwor LyogVXBkYXRlIHJvdyBWUE9TIGluIHdpbmRvdyBXLiAgVmFsdWUgaXMgdHJ1ZSBpZiBkaXNwbG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HJpeCwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgZmNfeCwgY2hfZm9yZWdyb3VuZCwgZmNfZm9yZWdy b3VuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhd19w KTsKKyAgICAgIC8qIFVwZGF0ZSB0aGUgZGlzcGxheSBvZiB0aGUgdGV4dCBhcmVhLiAqLworICAg ICAgaWYgKHVwZGF0ZWRfcCkKKyAgICAgICAgeworICAgICAgICAgIGNoYW5nZWRfcCA9IDE7Cisg ICAgICAgICAgaWYgKGN1cnJlbnRfcm93LT5tb3VzZV9mYWNlX3ApCisgICAgICAgICAgICAqbW91 c2VfZmFjZV9vdmVyd3JpdHRlbl9wID0gMTsKKyAgICAgICAgfQorICAgICAgLyogVXBkYXRlIGRp c3BsYXkgb2YgdGhlIHJpZ2h0IG1hcmdpbiBhcmVhLCBpZiB0aGVyZSBpcyBvbmUuICovCisgICAg ICBpZiAoIWRlc2lyZWRfcm93LT5mdWxsX3dpZHRoX3AgJiYgdy0+cmlnaHRfbWFyZ2luX2NvbHMg PiAwKQorICAgICAgICB7CisgICAgICAgICAgY2hhbmdlZF9wID0gMTsKKyAgICAgICAgICB1cGRh dGVfbWFyZ2luYWxfYXJlYSAodywgZGVzaXJlZF9yb3csIFJJR0hUX01BUkdJTl9BUkVBLCB2cG9z KTsKKyAgICAgICAgfQorICAgICAgLyogRHJhdyB0cnVuY2F0aW9uIG1hcmtzIGV0Yy4gKi8KKyAg ICAgIGlmICghY3VycmVudF9yb3ctPmVuYWJsZWRfcAorICAgICAgICAgIHx8IGRlc2lyZWRfcm93 LT55ICE9IGN1cnJlbnRfcm93LT55CisgICAgICAgICAgfHwgZGVzaXJlZF9yb3ctPnZpc2libGVf aGVpZ2h0ICE9IGN1cnJlbnRfcm93LT52aXNpYmxlX2hlaWdodAorICAgICAgICAgIHx8IGRlc2ly ZWRfcm93LT5jdXJzb3JfaW5fZnJpbmdlX3AgIT0gY3VycmVudF9yb3ctPmN1cnNvcl9pbl9mcmlu Z2VfcAorICAgICAgICAgIHx8IGRlc2lyZWRfcm93LT5vdmVybGF5X2Fycm93X2JpdG1hcCAhPSBj dXJyZW50X3Jvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAKKyAgICAgICAgICB8fCBjdXJyZW50X3Jv dy0+cmVkcmF3X2ZyaW5nZV9iaXRtYXBzX3AKKyAgICAgICAgICB8fCBkZXNpcmVkX3Jvdy0+bW9k ZV9saW5lX3AgIT0gY3VycmVudF9yb3ctPm1vZGVfbGluZV9wCisgICAgICAgICAgfHwgZGVzaXJl ZF9yb3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5lX3AgIT0gY3VycmVudF9yb3ctPmV4YWN0X3dp bmRvd193aWR0aF9saW5lX3AKKyAgICAgICAgICB8fCAoTUFUUklYX1JPV19DT05USU5VQVRJT05f TElORV9QIChkZXNpcmVkX3JvdykKKyAgICAgICAgICAgICAgIT0gTUFUUklYX1JPV19DT05USU5V QVRJT05fTElORV9QIChjdXJyZW50X3JvdykpKQorICAgICAgICByaWYtPmFmdGVyX3VwZGF0ZV93 aW5kb3dfbGluZV9ob29rICh3LCBkZXNpcmVkX3Jvdyk7CisgICAgfQorICAvKiBVcGRhdGUgY3Vy cmVudF9yb3cgZnJvbSBkZXNpcmVkX3Jvdy4gKi8KKyAgbWFrZV9jdXJyZW50ICh3LT5kZXNpcmVk X21hdHJpeCwgdy0+Y3VycmVudF9tYXRyaXgsIHZwb3MpOworICByZXR1cm4gY2hhbmdlZF9wOwor fQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogLyogU3RydWN0dXJlIHRvIHBhc3MgZGltZW5zaW9ucyBhcm91bmQuICBVc2VkIGZvciBj aGFyYWN0ZXIgYm91bmRpbmcKIC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iktPnhf aGlnaGxpZ2h0X2ZyYW1lKTsKKworICBtY19zZXRfZXNzZW50aWFscyAodywgYWN0aXZlX3AsICZj aF9mb3JlZ3JvdW5kLCAmZmNfZm9yZWdyb3VuZCwgJmZjX3gpOworCisgIG1jX3ByZV9zY3JvbGxf Y2xlYW4gKHcpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIHN0cnVjdCBnbHlw aF9tYXRyaXggKmRlc2lyZWRfbWF0cml4ID0gdy0+ZGVzaXJlZF9tYXRyaXg7CiAgIGJvb2wgcGF1 c2VkX3A7CiAgIGludCBwcmVlbXB0X2NvdW50ID0gY2xpcF90b19ib3VuZHMgKDEsIGJhdWRfcmF0 ZSAvIDI0MDAgKyAxLCBJTlRfTUFYKTsKQEAgLTM0NjAsNiArNDAxNiw0OCBAQCB1cGRhdGVfd2lu ZG93IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3ApCiAJICAgIH0KIAl9CiAKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogUHJv Y2VzcyB0aGUgY3Vyc29yIHJvdyBhdCB0aGUgb3V0c2V0IGlmIGl0IGlzIHdpdGhpbiBgZGVzaXJl ZF9tYXRyaXhgLgorICBXaGVuIHByb2Nlc3NpbmcgYWxsIG90aGVyIHJvd3MsIHdlIHdpbGwgcXVl cnkgdGhlIGB3LT5jdXJyZW50X21hdHJpeGAgZm9yIGRhdGEKKyAgcmVsYXRpbmcgdG8gdGhlIGN1 cnNvciByb3cuICBgbWFrZV9jdXJyZW50YCAod2l0aGluIGB1cGRhdGVfd2luZG93X2xpbmUnKQor ICB1cGRhdGVzIHRoZSBgdy0+Y3VycmVudF9tYXRyaXhgIGZvciB0aGUgYXBwbGljYWJsZSByb3cu ICBJbiBkb2luZyBzbywgaG93ZXZlciwKKyAgdGhlIGFwcGxpY2FibGUgcm93IGluIHRoZSBkZXNp cmVkIG1hdHJpeCBpcyBhbHRlcmVkIHN1Y2ggdGhhdCB3ZSBjYW4gbm8gbG9uZ2VyCisgIHJlbHkg dXBvbiB0aGUgYWNjdXJhY3kgb2YgYFJPVy0+dXNlZFtURVhUX0FSRUFdYC4gIFRoZXJlZm9yZSwg d2UgbXVzdCBub3cgcmVseQorICBleGNsdXNpdmVseSB1cG9uIGB3LT5jdXJyZW50X21hdHJpeCcg Zm9yIGN1cnNvciByb3cgYmFzZWQgZGVjaXNpb25zLiAqLworICBmb3IgKHN0cnVjdCBnbHlwaF9y b3cgKm1jX3JvdyA9IHJvdzsKKyAgICAgICBtY19yb3cgPCBlbmQgJiYgKGZvcmNlX3AgfHwgIWlu cHV0X3BlbmRpbmcpOworICAgICAgICsrbWNfcm93KQorICAgIHsKKyAgICAgIGludCB2cG9zID0g TUFUUklYX1JPV19WUE9TIChtY19yb3csIGRlc2lyZWRfbWF0cml4KTsKKyAgICAgIGlmIChtY19y b3ctPmVuYWJsZWRfcAorICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAg ICAgIHsKKyAgICAgICAgICBjdXJzb3JfbWF0cml4ID0gZGVzaXJlZF9tYXRyaXg7CisgICAgICAg ICAgaWYgKCFmb3JjZV9wICYmICsrbl91cGRhdGVkICUgcHJlZW1wdF9jb3VudCA9PSAwKQorICAg ICAgICAgICAgZGV0ZWN0X2lucHV0X3BlbmRpbmdfaWdub3JlX3NxdWVlemFibGVzICgpOworICAg ICAgICAgIGNoYW5nZWRfcCB8PSAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAg ICAgICAgICAgICAmJiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29u ZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIg KHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg fHwgISBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKSkpCisg ICAgICAgICAgICAgICAgICAgICAgID8gbWNfdXBkYXRlX3dpbmRvd19saW5lICh3LCB2cG9zLCAm bW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZmNfeCwgY2hfZm9yZWdyb3VuZCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZjX2ZvcmVncm91 bmQsIGRyYXdfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgOiB1cGRhdGVfd2luZG93X2xpbmUg KHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3cml0dGVuX3ApOworICAgICAgICAgIGlmIChNQVRS SVhfUk9XX0JPVFRPTV9ZIChyb3cpID49IHliKQorICAgICAgICAgICAgZm9yIChpbnQgaSA9IHZw b3MgKyAxOyBpIDwgdy0+Y3VycmVudF9tYXRyaXgtPm5yb3dzIC0gMTsgKytpKQorICAgICAgICAg ICAgICBTRVRfTUFUUklYX1JPV19FTkFCTEVEX1AgKHctPmN1cnJlbnRfbWF0cml4LCBpLCBmYWxz ZSk7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisKKyAgY3Vyc29yX21hdHJp eCA9IHctPmN1cnJlbnRfbWF0cml4OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAg ICAgICAvKiBVcGRhdGUgdGhlIHJlc3Qgb2YgdGhlIGxpbmVzLiAgKi8KICAgICAgIGZvciAoOyBy b3cgPCBlbmQgJiYgKGZvcmNlX3AgfHwgIWlucHV0X3BlbmRpbmcpOyArK3JvdykKIAkvKiBzY3Jv bGxpbmdfd2luZG93IHJlc2V0cyB0aGUgZW5hYmxlZF9wIGZsYWcgb2YgdGhlIHJvd3MgaXQKQEAg LTM0NjcsNiArNDA2NSwxOSBAQCB1cGRhdGVfd2luZG93IChzdHJ1Y3Qgd2luZG93ICp3LCBib29s IGZvcmNlX3ApCiAJaWYgKHJvdy0+ZW5hYmxlZF9wKQogCSAgewogCSAgICBpbnQgdnBvcyA9IE1B VFJJWF9ST1dfVlBPUyAocm93LCBkZXNpcmVkX21hdHJpeCk7CisKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgICAgICAvKiBJZiB0aGUg YGN1cnNvcl9yb3dgIGlzIHdpdGhpbiB0aGUgYGRlc2lyZWRfbWF0cml4YCwgdGhlbiBpdCB3YXMK KyAgICAgICAgICBwcm9jZXNzZWQgaGVyZWluYWJvdmUgYW5kIHNob3VsZCBiZSBza2lwcGVkIGF0 IHRoaXMgdGltZS4gKi8KKyAgICAgICAgICBpZiAodnBvcyA9PSB3LT5jdXJzb3IudnBvcykKKyAg ICAgICAgICBjb250aW51ZTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgICBp bnQgaTsKIAogCSAgICAvKiBXZSdsbCBoYXZlIHRvIHBsYXkgYSBsaXR0bGUgYml0IHdpdGggd2hl biB0bwpAQCAtMzQ3NSw4ICs0MDg2LDIyIEBAIHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5kb3cg KncsIGJvb2wgZm9yY2VfcCkKIAkgICAgICAgY29tbWFuZHMgd2lsbCB0b28gcXVpY2tseSBwYXVz ZSByZWRpc3BsYXkuICAqLwogCSAgICBpZiAoIWZvcmNlX3AgJiYgKytuX3VwZGF0ZWQgJSBwcmVl bXB0X2NvdW50ID09IDApCiAJICAgICAgZGV0ZWN0X2lucHV0X3BlbmRpbmdfaWdub3JlX3NxdWVl emFibGVzICgpOwotCSAgICBjaGFuZ2VkX3AgfD0gdXBkYXRlX3dpbmRvd19saW5lICh3LCB2cG9z LAotCQkJCQkgICAgICZtb3VzZV9mYWNlX292ZXJ3cml0dGVuX3ApOworCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICAgICAgY2hhbmdl ZF9wIHw9IChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICAgICAgICYm ICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMp LCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAhIE5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpKSkKKyAgICAgICAgICAgICAg ICAgICAgICAgPyBtY191cGRhdGVfd2luZG93X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292 ZXJ3cml0dGVuX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBjdXJzb3JfbWF0cml4LCBmY194LCBjaF9mb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmNfZm9yZWdyb3VuZCwgZHJhd19wKQor ICAgICAgICAgICAgICAgICAgICAgICA6IHVwZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywgJm1v dXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCiAK IAkgICAgLyogTWFyayBhbGwgcm93cyBiZWxvdyB0aGUgbGFzdCB2aXNpYmxlIG9uZSBpbiB0aGUg Y3VycmVudAogCSAgICAgICBtYXRyaXggYXMgaW52YWxpZC4gIFRoaXMgaXMgbmVjZXNzYXJ5IGJl Y2F1c2Ugb2YKQEAgLTM0OTcsNiArNDEyMiw0MyBAQCB1cGRhdGVfd2luZG93IChzdHJ1Y3Qgd2lu ZG93ICp3LCBib29sIGZvcmNlX3ApCiAKICAgICBzZXRfY3Vyc29yOgogCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8qIElmIHdlIGp1bXBl ZCBoZXJlIGZyb20gYHNldF9jdXJzb3JgLCB0aGVuIHNldCB0aGUgYGN1cnNvcl9tYXRyaXhgLiAq LworICBpZiAoY3Vyc29yX21hdHJpeCA9PSBOVUxMKQorICAgIGN1cnNvcl9tYXRyaXggPSB3LT5j dXJyZW50X21hdHJpeDsKKworICAvKiBSZXNldCBgcm93YCB0byAwIHNvIHRoYXQgZmFrZSBjdXJz b3JzIGNhbiBiZSBkcmF3biBvbiByb3dzIHByZWNlZGluZyB0aGUKKyAgZmlyc3QgYHJvdy0+ZW5h YmxlZF9wYC4gIEp1c3QgcHJpb3IgdG8gdGhlIGNhbGwgdG8gYHNjcm9sbGluZ193aW5kb3cnIGFi b3ZlLAorICBgcm93YCB3YXMgYWR2YW5jZWQgdG8gdGhlIGZpcnN0IGByb3ctPmVuYWJsZWRfcGAu IC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W5hYmxlZF9wKQorICAgICAgIG1jX2Ry YXdfcm93ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgY3VycmVudF9yb3csIGN1cnJlbnRfcm93LT5n bHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgICAgICAgICAgICAgY3VycmVudF9yb3ctPngsIGN1 cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0sIHZwb3MsCisgICAgICAgICAgICAgICAgICAgIGJv dHRvbV92cG9zLCBhY3RpdmVfcCwgY3Vyc29yX21hdHJpeCwgZmNfeCwgY2hfZm9yZWdyb3VuZCwK KyAgICAgICAgICAgICAgICAgICAgZmNfZm9yZWdyb3VuZCwgZHJhd19wKTsKKyAgIH0KKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgLyogVXBkYXRlIHRoZSBoZWFkZXIgbGlu ZSBhZnRlciBzY3JvbGxpbmcgYmVjYXVzZSBhIG5ldyBoZWFkZXIKIAkgbGluZSB3b3VsZCBvdGhl cndpc2Ugb3ZlcndyaXRlIGxpbmVzIGF0IHRoZSB0b3Agb2YgdGhlIHdpbmRvdwogCSB0aGF0IGNh biBiZSBzY3JvbGxlZC4gICovCkBAIC0zNTEyLDcgKzQxNzQsNTggQEAgdXBkYXRlX3dpbmRvdyAo c3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wKQogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RF TQogCSAgaWYgKGNoYW5nZWRfcCAmJiByaWYtPmZpeF9vdmVybGFwcGluZ19hcmVhKQogCSAgICB7 Ci0JICAgICAgcmVkcmF3X292ZXJsYXBwZWRfcm93cyAodywgeWIpOworCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworC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JfdG8gKHcsIGksIDAsIHJvdy0+eSwgYXJlYSA9PSBURVhUX0FSRUEgPyByb3ctPnggOiAwKTsK KyAgICAgICAgICAgICAgaWYgKCh3LT5tY19lbHRzLnVzZWQgPiAwIHx8IHctPmNoX2VsdHMudXNl ZCA+IDAgfHwgdy0+ZmNfZWx0cy51c2VkID4gMCkKKyAgICAgICAgICAgICAgICAgICYmIGFyZWEg PT0gVEVYVF9BUkVBCisgICAgICAgICAgICAgICAgICAmJiByb3ctPnVzZWRbYXJlYV0pCisgICAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0 cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgICAgICAgICAgICAgICAgICBpbnQgc3RhcnRfeCA9 IHJvdy0+eDsKKyAgICAgICAgICAgICAgICAgIGludCBzdGFydF9ocG9zID0gMDsKKyAgICAgICAg ICAgICAgICAgIGludCBlbmRfaHBvcyA9IHJvdy0+dXNlZFthcmVhXTsKKyAgICAgICAgICAgICAg ICAgIGJvb2wgY2xlYXJfZW9sX3AgPSB0cnVlOworICAgICAgICAgICAgICAgICAgZW51bSBkcmF3 X2dseXBoc19mYWNlIGhsID0gRFJBV19OT1JNQUxfVEVYVDsKKyAgICAgICAgICAgICAgICAgIG1j X3JlZHJhd19yb3cgKHcsIG1hdHJpeCwgcm93LCBzdGFydF94LCBzdGFydF9ocG9zLCBlbmRfaHBv cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyX2VvbF9wLCBobCk7Cisg ICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYgKHJvdy0+dXNlZFthcmVh XSkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVfUklGIChm KS0+d3JpdGVfZ2x5cGhzICh3LCByb3csIHJvdy0+Z2x5cGhzW2FyZWFdLCBhcmVhLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvdy0+dXNlZFthcmVh XSk7CisgICAgICAgICAgICAgICAgICAgIEZSQU1FX1JJRiAoZiktPmNsZWFyX2VuZF9vZl9saW5l ICh3LCByb3csIGFyZWEsIC0xKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0K KyAgICAgICAgICByb3ctPm92ZXJsYXBwZWRfcCA9IDA7CisgICAgICAgIH0KKyAgICAgIGlmIChN QVRSSVhfUk9XX0JPVFRPTV9ZIChyb3cpID49IHliKQorICAgICAgICBicmVhazsKKyAgICB9CisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgICAgICByZWRyYXdfb3ZlcmxhcHBpbmdf cm93cyAodywgeWIpOwogCSAgICB9CiAjZW5kaWYKQEAgLTM1MzEsMTAgKzQyNDQsMjEgQEAgdXBk YXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wKQogICAgICAgc3RyY3B5 ICh3LT5jdXJyZW50X21hdHJpeC0+bWV0aG9kLCB3LT5kZXNpcmVkX21hdHJpeC0+bWV0aG9kKTsK ICNlbmRpZgogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09S UyAqLworCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCisgIGlmIChCVUZGRVJQICh3LT5jb250 ZW50cykKKyAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3Nz aGFpcnMpKSkKKyAgICBtY191cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIDApOworICAgIGVsc2UK ICAgICAgIHVwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgMCk7CiAjZW5kaWYKIAorLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogICAgICAgLyogRW5kIHRoZSB1cGRhdGUgb2Ygd2luZG93IFcu ICBEb24ndCBzZXQgdGhlIGN1cnNvciBpZiB3ZQogICAgICAgICAgcGF1c2VkIHVwZGF0aW5nIHRo ZSBkaXNwbGF5IGJlY2F1c2UgaW4gdGhpcyBjYXNlLAogICAgICAgICAgc2V0X3dpbmRvd19jdXJz b3JfYWZ0ZXJfdXBkYXRlIGhhc24ndCBiZWVuIGNhbGxlZCwgYW5kCmRpZmYgLS1naXQgYS9zcmMv ZnJhbWUuaCBiL3NyYy9mcmFtZS5oCmluZGV4IGVjOGY2MTQuLmVlYWY3MWUgMTAwNjQ0Ci0tLSBh L3NyYy9mcmFtZS5oCisrKyBiL3NyYy9mcmFtZS5oCkBAIC0yMDUsNiArMjA1LDE2IEBAIHN0cnVj dCBmcmFtZQogICBMaXNwX09iamVjdCB0b29sX2Jhcl9pdGVtczsKICAgLyogdG9vbF9iYXJfaXRl bXMgc2hvdWxkIGJlIHRoZSBsYXN0IExpc3BfT2JqZWN0IG1lbWJlci4gICovCiAKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogTm9uLW5p bCB3aGVuIHRoZSBmcmFtZSBpcyBpbiB0aGUgcHJvY2VzcyBvZiBiZWluZyB1cGRhdGVkLiAqLwor ICBzdHJ1Y3QgZnJhbWUgKm1jX3VwZGF0aW5nX2ZyYW1lOworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKworCiAgIC8qIENhY2hlIG9mIHJlYWxpemVkIGZhY2VzLiAg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yogMjYKKyAgICAoKy1m cmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHh4eHh4eHgiCisgICAgICAieC4uLi4u LngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4ueHguLngiCisgICAgICAieC4uLnh4Lngi CisgICAgICAieC4uLi54eHgiCisgICAgICAieC54eHh4eHgiCisgICAgICAieC54eHh4eHgiCisg ICAgICAieC4uLi54eHgiCisgICAgICAieC4uLnh4LngiCisgICAgICAieC4ueHguLngiCisgICAg ICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieHh4eHh4eHgiKQorKi8KK3N0 YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93X2JpdHNb XSA9eworICAweGZmLCAweDgxLCAweDgxLCAweDk5LCAweDhkLCAweDg3LCAweGJmLAorICAweGJm LCAweDg3LCAweDhkLCAweDk5LCAweDgxLCAweDgxLCAweGZmfTsKKworLyogMjcKKyAgICAoKy1m cmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHh4eHh4eHgiCisgICAgICAieC4uLi4u eHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieC54eC4ueHgiCisgICAgICAieC4ueHgueHgi CisgICAgICAieC4uLnh4eHgiCisgICAgICAieHh4eHh4eHgiCisgICAgICAieHh4eHh4eHgiCisg ICAgICAieC4uLnh4eHgiCisgICAgICAieC4ueHgueHgiCisgICAgICAieC54eC4ueHgiCisgICAg ICAieC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieHh4eHh4eHgiKQorKi8KK3N0 YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19yZXZlcnNlZF9ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fy cm93X2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweGIxLCAweDk5LCAweDhkLCAweGZm LAorICAweGZmLCAweDhkLCAweDk5LCAweGIxLCAweDgxLCAweDgxLCAweGZmfTsKKworLyogMjgK KyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHh4eHh4eHgiCisgICAg ICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAi eC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4u Li4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4u LngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieHh4eHh4eHgi KQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19ob2xsb3dfcmVjdGFuZ2xlX2JpdHNbXSA9 eworICAweGZmLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLAorICAweDgxLCAw eDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweGZmfTsKKworLyogMjkKKyAgICAoKy1mcmlu Z2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4i CisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisg ICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAg ICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAi eC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iKQorKi8KK3N0YXRp YyB1bnNpZ25lZCBzaG9ydCBtY192ZXJ0aWNhbF9iYXJfYml0c1tdID17CisgIDB4ODAsIDB4ODAs IDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsCisgIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAs IDB4ODAsIDB4ODAsIDB4ODB9OworCisvKiAzMAorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRl Y2ltYWwKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54 eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIK KyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAg ICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAg ICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0 IG1jX3JldmVyc2VkX3ZlcnRpY2FsX2Jhcl9iaXRzW10gPXsKKyAgMHgzLCAweDMsIDB4MywgMHgz LCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDN9OworCisv KiAzMQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICJ4eC4uLi4uLiIK KyAgICAgICJ4eC4uLi4uLiIKKyAgICAgICIgeHguLi4uLiIKKyAgICAgICIueHguLi4uLiIKKyAg ICAgICIuLnh4Li4uLiIKKyAgICAgICIuLnh4Li4uLiIKKyAgICAgICIuLi54eC4uLiIKKyAgICAg ICIuLi54eC4uLiIKKyAgICAgICIuLi4ueHguLiIKKyAgICAgICIuLi4ueHguLiIKKyAgICAgICIu Li4uLnh4LiIKKyAgICAgICIuLi4uLnh4LiIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4u Li54eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX2JhY2tzbGFzaF9iaXRzW10gPXsK KyAgMHhjMCwgMHhjMCwgMHhlMCwgMHg2MCwgMHgzMCwgMHgzMCwgMHgxOCwgMHgxOCwgMHhjLCAw eGMsIDB4NiwgMHg2LCAweDMsIDB4M307CisKKy8qIDMyCisgICAgKCstZnJpbmdlLWhlbHBlci1o ZXhhZGVjaW1hbAorICAgICAgInh4Li4uLi4uIgorICAgICAgInh4Li4uLi4uIgorICAgICAgInh4 eC4uLi4uIgorICAgICAgInh4eC4uLi4uIgorICAgICAgIngueHguLi4uIgorICAgICAgIngueHgu Li4uIgorICAgICAgInguLnh4Li4uIgorICAgICAgInguLnh4Li4uIgorICAgICAgInguLi54eC4u IgorICAgICAgInguLi54eC4uIgorICAgICAgInguLi4ueHguIgorICAgICAgInguLi4ueHguIgor ICAgICAgInguLi4uLnh4IgorICAgICAgInguLi4uLnh4IikKKyovCitzdGF0aWMgdW5zaWduZWQg c2hvcnQgbWNfdmVydGljYWxfYmFyX2JhY2tzbGFzaF9iaXRzW10gPXsKKyAgMHhjMCwgMHhjMCwg MHhlMCwgMHhlMCwgMHhiMCwgMHhiMCwgMHg5OCwKKyAgMHg5OCwgMHg4YywgMHg4YywgMHg4Niwg MHg4NiwgMHg4MywgMHg4M307CisKKy8qIDMzCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVj aW1hbAorICAgICAgIi54eHh4eHguIgorICAgICAgInh4eHgueC4uIgorICAgICAgInh4eHgueC4u IgorICAgICAgInh4eHgueC4uIgorICAgICAgIi54eHgueC4uIgorICAgICAgIi4uLngueC4uIgor ICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAg ICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hv cnQgbWNfcGlsY3Jvd19iaXRzW10gPXsKKyAgMHg3ZSwgMHhmNCwgMHhmNCwgMHhmNCwgMHg3NCwg MHgxNCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNH07CisKKy8qIDM0CisgICAgKCstZnJp bmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4ueHh4eC4uIgorICAgICAgIi54eHh4eHgu IgorICAgICAgInguLnh4Li54IgorICAgICAgInguLnh4Li54IgorICAgICAgInh4eHh4eHh4Igor ICAgICAgInh4Li4uLnh4IgorICAgICAgInh4eC4ueHh4IgorICAgICAgIi54eHh4eHguIgorICAg ICAgIi4ueHh4eC4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc21pbGV5X2ZhY2Vf Yml0c1tdID17CisgIDB4M2MsIDB4N2UsIDB4OTksIDB4OTksIDB4ZmYsIDB4YzMsIDB4ZTcsIDB4 N2UsIDB4M2N9OworCisvKiAzNQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAg ICAgICIuLnguLi4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLi4ueC4uLiIKKyAgICAg ICIuLi4uLnguLiIKKyAgICAgICIuLi4ueC4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIu LnguLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3NpbmdsZV9hbmdsZV9yaWdo dF9iaXRzW10gPXsKKyAgMHgyMCwgMHgxMCwgMHg4LCAweDQsIDB4OCwgMHgxMCwgMHgyMH07CisK Ky8qIDM2CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4ueC4u IgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC4uLi4uIgor ICAgICAgIi4uLnguLi4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4uLi4ueC4uIikKKyov CitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX2xlZnRfYml0c1tdID17Cisg IDB4NCwgMHg4LCAweDEwLCAweDIwLCAweDEwLCAweDgsIDB4NH07CisKKy8qIDM3CisgICAgKCst ZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Lnh4Li4uIgorICAgICAgIi54eC54 eC4uIgorICAgICAgIi4ueHgueHguIgorICAgICAgIi4uLnh4Lnh4IgorICAgICAgIi4ueHgueHgu IgorICAgICAgIi54eC54eC4uIgorICAgICAgInh4Lnh4Li4uIikKKyovCitzdGF0aWMgdW5zaWdu ZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xlX3JpZ2h0X2JpdHNbXSA9eworICAweGQ4LCAweDZjLCAw eDM2LCAweDFiLCAweDM2LCAweDZjLCAweGQ4fTsKKworLyogMzgKKyAgICAoKy1mcmluZ2UtaGVs cGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4ueHgueHgiCisgICAgICAiLi54eC54eC4iCisgICAg ICAiLnh4Lnh4Li4iCisgICAgICAieHgueHguLi4iCisgICAgICAiLnh4Lnh4Li4iCisgICAgICAi Li54eC54eC4iCisgICAgICAiLi4ueHgueHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBt Y19kb3VibGVfYW5nbGVfbGVmdF9iaXRzW10gPXsKKyAgMHgxYiwgMHgzNiwgMHg2YywgMHhkOCwg MHg2YywgMHgzNiwgMHgxYn07CisKKy8qIDM5CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVj aW1hbAorICAgICAgIngueC54Li4uIgorICAgICAgIi54LngueC4uIgorICAgICAgIi4ueC54Lngu IgorICAgICAgIi4uLngueC54IgorICAgICAgIi4ueC54LnguIgorICAgICAgIi54LngueC4uIgor ICAgICAgIngueC54Li4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdHJpcGxlX2Fu Z2xlX3JpZ2h0X2JpdHNbXSA9eworICAweGE4LCAweDU0LCAweDJhLCAweDE1LCAweDJhLCAweDU0 LCAweGE4fTsKKworLyogNDAKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAg ICAiLi4ueC54LngiCisgICAgICAiLi54LngueC4iCisgICAgICAiLngueC54Li4iCisgICAgICAi eC54LnguLi4iCisgICAgICAiLngueC54Li4iCisgICAgICAiLi54LngueC4iCisgICAgICAiLi4u eC54LngiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190cmlwbGVfYW5nbGVfbGVmdF9i aXRzW10gPXsKKyAgMHgxNSwgMHgyYSwgMHg1NCwgMHhhOCwgMHg1NCwgMHgyYSwgMHgxNX07CisK Ky8qIDQxCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4uLi4u IgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgor ICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAg ICAgInguLi4uLnguIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAg Ii4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQg bWNfc2luZ2xlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAw eDEwLCAweDI4LCAweDQ0LCAweDgyLCAweDAwLCAweDAwLCAweDAwLCAweDAwfTsKKworLyogNDIK KyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAg ICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAi eC4uLi4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLi4u eC4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4u Li4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zaW5n bGVfYW5nbGVfZG93bl9iaXRzW10gPXsKKyAgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHg4Miwg MHg0NCwgMHgyOCwgMHgxMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMH07CisKKy8qIDQzCisgICAg KCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4u Li4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54 Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4u IgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAgICAgIi4uLi4uLi4uIgor ICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQg c2hvcnQgbWNfZG91YmxlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDAwLCAweDAwLCAweDAwLCAw eDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDgyLCAweDAwLCAweDAwLCAweDAw fTsKKworLyogNDQKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4u Li4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAieC4uLi4u eC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4i CisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLi4ueC4uLi4iCisg ICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8K K3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfZG93bl9iaXRzW10gPXsKKyAg MHgwMCwgMHgwMCwgMHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHgx MCwgMHgwMCwgMHgwMCwgMHgwMH07CisKKy8qIDQ1CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhh ZGVjaW1hbAorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54 Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4u IgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgor ICAgICAgIi54Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAgICAgIi4uLi4uLi4uIikKKyov CitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdHJpcGxlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAw eDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0 LCAweDgyLCAweDAwfTsKKworLyogNDYKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFs CisgICAgICAiLi4uLi4uLi4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLnguLi54Li4iCisg ICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAg ICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAi Li54LnguLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRp YyB1bnNpZ25lZCBzaG9ydCBtY19xdWFkcnVwbGVfYW5nbGVfZG93bl9iaXRzW10gPXsKKyAgMHgw MCwgMHg4MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwg MHgxMCwgMHgwMH07CisKKy8qIDQ3CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAor ICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAg ICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAg InguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgIngu LnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLi4u LnguIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcXVhZHJ1cGxlX2FuZ2xlX3VwX2Jp dHNbXSA9eworICAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDkyLCAweDI4 LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDgyfTsKKworLyogNDgKKyAgICAoKy1mcmluZ2Ut aGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLnguLi54Li4iCisg ICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAg ICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAi Li54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54 LnguLi4iCisgICAgICAiLi4ueC4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190 cmlwbGVfYW5nbGVfZG93bl9iaXRzW10gPXsKKyAgMHg4MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0 NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHgxMH07CisKIC8q IE5PVEU6ICBUaGUgb3JkZXIgb2YgdGhlc2UgYml0bWFwcyBtdXN0IG1hd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orICAgICBJZiBub3QgcGFydGlhbCwgb3Igbm8gcGFydGlhbCBzcGVjIGlzIHBy ZXNlbnQsIHVzZSBub24tcGFydGlhbCBiaXRtYXAuICovCitpbnQKK21jX2dldF9mcmluZ2VfYml0 bWFwIChzdHJ1Y3Qgd2luZG93ICp3LCBMaXNwX09iamVjdCBiaXRtYXAsIGludCByaWdodF9wLCBp bnQgcGFydGlhbF9wKQoreworICBMaXNwX09iamVjdCBjbWFwLCBibTEgPSBRbmlsLCBibTIgPSBR bmlsLCBibTsKKyAgRU1BQ1NfSU5UIGxuMSA9IDAsIGxuMiA9IDA7CisgIGludCBpeDEgPSByaWdo dF9wOworICBpbnQgaXgyID0gaXgxICsgKHBhcnRpYWxfcCA/IDIgOiAwKTsKKyAgaWYgKChjbWFw ID0gQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSks ICFOSUxQIChjbWFwKSkKKyAgICB7CisgICAgICBibTEgPSBtY19hc3NxIChiaXRtYXAsIGNtYXAp OworICAgICAgaWYgKENPTlNQIChibTEpKQorICB7CisgICAgaWYgKChibTEgPSBYQ0RSIChibTEp KSwgTklMUCAoYm0xKSkKKyAgICAgIHJldHVybiBNQ19OT19GUklOR0VfQklUTUFQOworICAgIGlm IChDT05TUCAoYm0xKSkKKyAgICAgIHsKKyAgICAgICAgbG4xID0gWEZJWE5VTSAoRmxlbmd0aCAo Ym0xKSk7CisgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgeworICAgICAgaWYgKGxuMSA+IGl4 MikKKyAgICAgICAgeworICAgICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMSk7CisgICAgICAg ICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgIH0KKyAgICB9 CisgICAgICAgIGVsc2UKKyAgICB7CisgICAgICBpZiAobG4xID4gaXgxKQorICAgICAgICB7Cisg ICAgICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0xKTsKKyAgICAgICAgICBpZiAoIUVRIChibSwg UXQpKQorICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgfQorICAgIH0KKyAgICAgIH0KKyAgICBl bHNlIGlmICgoYm0gPSBibTEsICFFUSAoYm0sIFF0KSkpCisgICAgICBnb3RvIGZvdW5kOworICB9 CisgICAgfQorICBpZiAoIUVRIChjbWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2Vf aW5kaWNhdG9yX2FsaXN0KSkKKyAgICAgICYmICFOSUxQIChCVkFSICgmYnVmZmVyX2RlZmF1bHRz LCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkpCisgICAgeworICAgICAgYm0yID0gbWNfYXNzcSAo Yml0bWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSk7 CisgICAgICBpZiAoQ09OU1AgKGJtMikpCisgIHsKKyAgICBpZiAoKGJtMiA9IFhDRFIgKGJtMikp LCAhTklMUCAoYm0yKSkKKyAgICAgIHsKKyAgICAgICAgaWYgKENPTlNQIChibTIpKQorICAgIHsK KyAgICAgIGxuMiA9IFhGSVhOVU0gKEZsZW5ndGggKGJtMikpOworICAgICAgaWYgKHBhcnRpYWxf cCkKKyAgICAgICAgeworICAgICAgICAgIGlmIChsbjIgPiBpeDIpCisgICAgICB7CisgICAgICAg IGJtID0gbWNfbnRoIChpeDIsIGJtMik7CisgICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAg ICAgICAgZ290byBmb3VuZDsKKyAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICAgIH0KKyAg fQorICAgIH0KKyAgaWYgKGxuMSA+IGl4MSkKKyAgICB7CisgICAgICBibSA9IG1jX250aCAoaXgx LCBibTEpOworICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgZ290byBmb3VuZDsKKyAgICB9Cisg IGlmIChsbjIgPiBpeDEp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gcHJlc2VudCwgdXNlIG5vbi1wYXJ0aWFsIGJpdG1hcC4gICovCisgIGlmICgo Y21hcCA9IEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZnJpbmdlX2luZGljYXRvcl9hbGlz dCkpLCAhTklMUCAoY21hcCkpCisgICAgeworICAgICAgYm0xID0gbWNfYXNzcSAoYml0bWFwLCBj bWFwKTsKKyAgICAgIGlmIChDT05TUCAoYm0xKSkKKyAgICAgICAgeworICAgICAgICAgIGlmICgo Ym0xID0gWENEUiAoYm0xKSksIE5JTFAgKGJtMSkpCisgICAgICAgICAgICByZXR1cm4gTUNfTk9f RlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICBpZiAoQ09OU1AgKGJtMSkpCisgICAgICAgICAgICB7 CisgICAgICAgICAgICAgIGxuMSA9IFhGSVhOVU0gKEZsZW5ndGggKGJtMSkpOworICAgICAgICAg ICAgICBpZiAocGFydGlhbF9wKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAg IGlmIChsbjEgPiBpeDIpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAg ICAgICBibSA9IG1jX250aCAoaXgyLCBibTEpOworICAgICAgICAgICAgICAgICAgICAgIGlmICgh RVEgKGJtLCBRdCkpCisgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5kOworICAgICAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlCisgICAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgICAgaWYgKGxuMSA+IGl4MSkKKyAgICAgICAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMSk7 CisgICAgICAgICAgICAgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAgICAgICAg ICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxzZSBpZiAoKGJtID0gYm0xLCAhRVEgKGJtLCBR dCkpKQorICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgfQorICAgIH0KKyAgaWYgKCFF USAoY21hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRvcl9hbGlzdCkp CisgICAgICAmJiAhTklMUCAoQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRv cl9hbGlzdCkpKQorICAgIHsKKyAgICAgIGJtMiA9IG1jX2Fzc3EgKGJpdG1hcCwgQlZBUiAoJmJ1 ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpOworICAgICAgaWYgKENPTlNQ IChibTIpKQorICAgICAgICB7CisgICAgICAgICAgaWYgKChibTIgPSBYQ0RSIChibTIpKSwgIU5J TFAgKGJtMikpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmIChDT05TUCAoYm0yKSkK KyAgICAgICAgICB7CisgICAgICAgICAgICBsbjIgPSBYRklYTlVNIChGbGVuZ3RoIChibTIpKTsK KyAgICAgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICBpZiAobG4yID4gaXgyKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBibSA9IG1j X250aCAoaXgyLCBibTIpOworICAgICAgICAgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAg ICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAgIH0KKyAg ICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIGlmIChsbjEgPiBp eDEpCisgICAgeworICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0xKTsKKyAgICAgIGlmICghRVEg KGJtLCBRdCkpCisgIGdvdG8gZm91bmQ7CisgICAgfQorICBpZiAobG4yID4gaXgxKQorICAgIHsK KyAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMik7CisgICAgICBpZiAoIUVRIChibSwgUXQpKQor ICAgICAgICBnb3RvIGZvdW5kOworICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7Cisg ICAgfQorICAgIGVsc2UgaWYgKChibSA9IGJtMiwgTklMUCAoYm0pKSkKKyAgICByZXR1cm4gTUNf Tk9fRlJJTkdFX0JJVE1BUDsKKyBmb3VuZDoKKyAgcmV0dXJuIGxvb2t1cF9mcmluZ2VfYml0bWFw IChibSk7Cit9CisKKy8qIFJlY2FsY3VsYXRlIHRoZSBiaXRtYXBzIHRvIHNob3cgaW4gdGhlIGZy aW5nZXMgb2Ygd2luZG93IFcuCisgICBPbmx5IG1hcmsgcm93cyB3aXRoIG1vZGlmaWVkIGJpdG1h cHMgZm9yIHVwZGF0ZSBpbiByZWRyYXdfZnJpbmdlX2JpdG1hcHNfcC4KKyAgIElmIEtFRVBfQ1VS UkVOVF9QIGlzIDAsIHVwZGF0ZSBjdXJyZW50X21hdHJpeCB0b28uICovCitib29sCittY191cGRh dGVfd2luZG93X2ZyaW5nZXMgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wga2VlcF9jdXJyZW50X3Ap Cit7CisgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgKmN1ciA9IDA7CisgIGludCB5YiA9IHdpbmRv d190ZXh0X2JvdHRvbV95ICh3KTsKKyAgaW50IHJuLCBucm93cyA9IHctPmN1cnJlbnRfbWF0cml4 LT5ucm93czsKKyAgaW50IHk7CisgIGJvb2wgcmVkcmF3X3AgPSAwOworICBMaXNwX09iamVjdCBi b3VuZGFyeV90b3AgPSBRbmlsLCBib3VuZGFyeV9ib3QgPSBRbmlsOworICBMaXNwX09iamVjdCBh cnJvd190b3AgPSBRbmlsLCBhcnJvd19ib3QgPSBRbmlsOworICBMaXNwX09iamVjdCBlbXB0eV9w b3M7C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QIChYQ0FSIChpbmQpKSkKKyAgICAgICAgewor ICAgICAgICAgIExpc3BfT2JqZWN0IHBvczsKKyAgICAgICAgICBpZiAocG9zID0gbWNfYXNzcSAo UXQsIGluZCksICFOSUxQIChwb3MpKQorICAgICAgICAgICAgYm91bmRhcnlfdG9wID0gYm91bmRh cnlfYm90ID0gYXJyb3dfdG9wID0gYXJyb3dfYm90ID0gWENEUiAocG9zKTsKKyAgICAgICAgICBp ZiAocG9zID0gbWNfYXNzcSAoUXRvcCwgaW5kKSwgIU5JTFAgKHBvcykpCisgICAgICAgICAgICBi b3VuZGFyeV90b3AgPSBYQ0RSIChwb3MpOworICAgICAgICAgIGlmIChwb3MgPSBtY19hc3NxIChR Ym90dG9tLCBpbmQpLCAhTklMUCAocG9zKSkKKyAgICAgICAgICAgIGJvdW5kYXJ5X2JvdCA9IFhD RFIgKHBvcyk7CisgICAgICAgICAgaWYgKHBvcyA9IG1jX2Fzc3EgKFF1cCwgaW5kKSwgIU5JTFAg KHBvcykpCisgICAgICAgICAgICBhcnJvd190b3AgPSBYQ0RSIChwb3MpOworICAgICAgICAgIGlm IChwb3MgPSBtY19hc3NxIChRZG93biwgaW5kKSwgIU5JTFAgKHBvcykpCisgICAgICAgICAgICBh cnJvd19ib3QgPSBYQ0RSIChwb3MpOworICAgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIC8q IEFueXRoaW5nIGVsc2UgbWVhbnMgYm91bmRhcnkgb24gbGVmdCBhbmQgbm8gYXJyb3dzLiAgKi8K KyAgICAgICAgYm91bmRhcnlfdG9wID0gYm91bmRhcnlfYm90ID0gUWxlZnQ7CisgICAgfQorICB0 b3BfaW5kX3JuID0gYm90X2luZF9ybiA9IC0xOworICBpZiAoIU5JTFAgKGluZCkpCisgICAgewor ICAgICAgZm9yICh5ID0gdy0+dnNjcm9sbCwgcm4gPSAwOworICAgICAgICAgICB5IDwgeWIgJiYg cm4gPCBucm93czsKKyAgICAgICAgICAgeSArPSByb3ctPmhlaWdodCwgKytybikKKyAgICAgICAg eworICAgICAgICAgIHJvdyA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAg ICAgaWYgKCFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgICAgIHJvdyA9IHctPmN1cnJlbnRfbWF0 cml4LT5yb3dzICsgcm47CisgICAgICAgICAgcm93LT5pbmRpY2F0ZV9ib2JfcCA9IHJvdy0+aW5k aWNhdGVfdG9wX2xpbmVfcCA9IDA7CisgICAgICAgICAgcm93LT5pbmRpY2F0ZV9lb2JfcCA9IHJv dy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCA9IDA7CisgICAgICAgICAgaWYgKCFyb3ctPm1vZGVf bGluZV9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAodG9wX2luZF9ybiA8IDAg JiYgcm93LT52aXNpYmxlX2hlaWdodCA+IDApCisgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgaWYgKE1BVFJJWF9ST1dfU1RBUlRfQ0hBUlBPUyAocm93KSA8PSBCVUZfQkVHViAo WEJVRkZFUiAody0+Y29udGVudHMpKQorICAgICAgICAgICAgICAgICAgICAgICYmICFNQVRSSVhf Uk9XX1BBUlRJQUxMWV9WSVNJQkxFX0FUX1RPUF9QICh3LCByb3cpKQorICAgICAgICAgICAgICAg ICAgICByb3ctPmluZGljYXRlX2JvYl9wID0gIU5JTFAgKGJvdW5kYXJ5X3RvcCk7CisgICAgICAg ICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHJvdy0+aW5kaWNhdGVfdG9wX2xp bmVfcCA9ICFOSUxQIChhcnJvd190b3ApOworICAgICAgICAgICAgICAgICAgdG9wX2luZF9ybiA9 IHJuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgaWYgKGJvdF9pbmRfcm4gPCAw KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGlmIChNQVRSSVhfUk9XX0VO RF9DSEFSUE9TIChyb3cpID49IEJVRl9aViAoWEJVRkZFUiAody0+Y29udGVudHMpKQorICAgICAg ICAgICAgICAgICAgICAgICYmICFNQVRSSVhfUk9XX1BBUlRJQUxMWV9WSVNJQkxFX0FUX0JPVFRP TV9QICh3LCByb3cpKQorICAgICAgICAgICAgICAgICAgICByb3ctPmluZGljYXRlX2VvYl9wID0g IU5JTFAgKGJvdW5kYXJ5X2JvdCksIGJvdF9pbmRfcm4gPSBybjsKKyAgICAgICAgICAgICAgICAg IGVsc2UgaWYgKHkgKyByb3ctPmhlaWdodCA+PSB5YikKKyAgICAgICAgICAgICAgICAgICAgcm93 LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wID0gIU5JTFAgKGFycm93X2JvdCksIGJvdF9pbmRfcm4g PSBybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9 CisgIGVtcHR5X3BvcyA9IEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgaW5kaWNhdGVfZW1w dHlfbGluZXMpOworICBpZiAoIU5JTFAgKGVtcHR5X3BvcykgJiYgIUVRIChlbXB0eV9wb3MsIFFy aWdodCkpCisgICAgZW1wdHlfcG9zID0gV0lORE9XX0xFRlRfRlJJTkdFX1dJRFRIICh3KSA9PSAw ID8gUXJpZ2h0IDogUWxlZnQ7CisgIGZvciAoeSA9IDA7IHkgPCBNQVhfQklUTUFQX0NBQ0hFOyB5 KyspCisgICAgYml0bWFwX2NhY2hlW3ldID0gLTE7CisjZGVmaW5lIE1DX0xFRlRfRlJJTkdFKGNh Y2hlLCB3aGljaCwgcGFydGlhbF9wKQkJCVwKKyAgKGJpdG1hcF9jYWNoZVtjYWNoZSo0K3BhcnRp YWxfcF0gPj0gMAkJCQlcCisgICA/IGJpdG1hcF9jYWNoZVtjYWNoZSo0K3BhcnRpYWxfcF0JCQkJ XAorICAgOiAoYml0bWFwX2NhY2hlW2NhY2hlKjQrcGFydGlhbF9wXSA9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KQorICAgICAgICAgICAgYm4gPSAoKHJvdy0+aW5kaWNhdGVfZW9iX3Ag JiYgRVEgKGJvdW5kYXJ5X2JvdCwgUWxlZnQpKQorICAgICAgICAgICAgPyBNQ19MRUZUX0ZSSU5H RSAoMSwgUXRvcF9ib3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKQorICAgICAgICAgICAgOiBNQ19M RUZUX0ZSSU5HRSAoMiwgUXRvcCwgMCkpOworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGJu ID0gKChyb3ctPmluZGljYXRlX2VvYl9wICYmIEVRIChib3VuZGFyeV9ib3QsIFFyaWdodCkpCisg ICAgICAgICAgICA/IE1DX1JJR0hUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20sIHJvdy0+ZW5kc19h dF96dl9wKQorICAgICAgICAgICAgOiBNQ19SSUdIVF9GUklOR0UgKDIsIFF0b3AsIDApKTsKKyAg ICAgICAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV90b3BfbGluZV9wKQorICAgICAg ICB7CisgICAgICAgICAgaWYgKEVRIChhcnJvd190b3AsIFFsZWZ0KSkKKyAgICAgICAgICAgIGJu ID0gTUNfTEVGVF9GUklOR0UgKDYsIFF1cCwgMCk7CisgICAgICAgICAgZWxzZQorICAgICAgICAg ICAgYm4gPSBNQ19SSUdIVF9GUklOR0UgKDYsIFF1cCwgMCk7CisgICAgICAgIH0KKyAgICAgIGlm IChibiAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0 IGZyaW5nZV9iaXRtYXAgKmZiID0gZ2V0X2ZyaW5nZV9iaXRtYXBfZGF0YSAoYm4pOworICAgICAg ICAgIGlmIChmYi0+YWxpZ24gPT0gQUxJR05fQklUTUFQX1RPUCAmJiBmYi0+cGVyaW9kID09IDAp CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdzE7Cisg ICAgICAgICAgICAgIGludCB0b3BfaW5kX21heF95OworICAgICAgICAgICAgICB0b3BfaW5kX21p bl95ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgICAgICAgICAgICAgIHRvcF9p bmRfbWF4X3kgPSB0b3BfaW5kX21pbl95ICsgZmItPmhlaWdodDsKKyAgICAgICAgICAgICAgaWYg KHRvcF9pbmRfbWF4X3kgPiB5YikKKyAgICAgICAgICAgICAgICB0b3BfaW5kX21heF95ID0geWI7 CisgICAgICAgICAgICAgIGZvciAoeSA9IHJvdy0+eSArIHJvdy0+aGVpZ2h0LCBybiA9IHRvcF9p bmRfcm4gKyAxOworICAgICAgICAgICAgICAgICAgIHkgPCB0b3BfaW5kX21heF95ICYmIHJuIDwg bnJvd3M7CisgICAgICAgICAgICAgICAgICAgeSArPSByb3cxLT5oZWlnaHQsIHJuKyspCisgICAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgaWYgKGJvdF9pbmRfcm4gPj0gMCAmJiBy biA+PSBib3RfaW5kX3JuKQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAg ICAgICAgIHJvdzEgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHJuOworICAgICAgICAgICAg ICAgICAgaWYgKCFyb3cxLT5lbmFibGVkX3ApCisgICAgICAgICAgICAgICAgICAgIHJvdzEgPSB3 LT5jdXJyZW50X21hdHJpeC0+cm93cyArIHJuOworICAgICAgICAgICAgICAgICAgcm93MS0+aW5k aWNhdGVfYm9iX3AgPSByb3ctPmluZGljYXRlX2JvYl9wOworICAgICAgICAgICAgICAgICAgcm93 MS0+aW5kaWNhdGVfdG9wX2xpbmVfcCA9IHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcDsKKyAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIGlmIChib3Rf aW5kX3JuID49IDApCisgICAgeworICAgICAgaW50IGJuID0gTUNfTk9fRlJJTkdFX0JJVE1BUDsK KyAgICAgIHJvdyA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgYm90X2luZF9ybjsKKyAgICAg IGlmICghcm93LT5lbmFibGVkX3ApCisgICAgICAgIHJvdyA9IHctPmN1cnJlbnRfbWF0cml4LT5y b3dzICsgYm90X2luZF9ybjsKKyAgICAgIGJvdF9yb3dfZW5kc19hdF96dl9wID0gcm93LT5lbmRz X2F0X3p2X3A7CisgICAgICBpZiAocm93LT5pbmRpY2F0ZV9lb2JfcCkKKyAgICAgICAgeworICAg ICAgICAgIGlmIChFUSAoYm91bmRhcnlfYm90LCBRbGVmdCkpCisgICAgICAgICAgICBibiA9IE1D X0xFRlRfRlJJTkdFICgzLCBRYm90dG9tLCByb3ctPmVuZHNfYXRfenZfcCk7CisgICAgICAgICAg ZWxzZQorICAgICAgICAgICAgYm4gPSBNQ19SSUdIVF9GUklOR0UgKDMsIFFib3R0b20sIHJvdy0+ ZW5kc19hdF96dl9wKTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9i b3R0b21fbGluZV9wKQorICAgICAgICB7CisgICAgICAgICAgaWYgKEVRIChhcnJvd19ib3QsIFFs ZWZ0KSkKKyAgICAgICAgICAgIGJuID0gTUNfTEVGVF9GUklOR0UgKDcsIFFkb3duLCAwKTsKKyAg ICAgICAgICBlbHNlCisgICAgICAgICAgICBibiA9IE1DX1JJR0hUX0ZSSU5HRSAoNywgUWRvd24s IDApOworICAgICAgICB9CisgICAgICBpZiAoYm4gIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAg ICAgICAgeworICAgICAgICAgIHN0cnVjdCBmcmluZ2VfYml0bWFwICpmYiA9IGdldF9mcmluZ2Vf Yml0bWFwX2RhdGEgKGJuKTsKKyAgICAgICAgICBpZiAoZmItPmFsaWduID09IEFMSUdOX0JJVE1B UF9CT1RUT00gJiYgZmItPnBlcmlvZCA9PSAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAg ICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cxOworICAgICAgICAgICAgICBpbnQgYm90X2luZF9taW5f eTsKKyAgICAgICAgICAgICAgYm90X2luZF9tYXhfeSA9IHJvdy0+eSArIHJvdy0+dmlzaWJsZV9o ZWlnaHQ7CisgICAgICAgICAgICAgIGJvdF9pbmRfbWluX3kgPSBib3RfaW5kX21heF95IC0gZmIt PmhlaWdodDsKKyAgICAgICAgICAgICAgaWYgKGJvdF9pbmRfbWluX3kgPCBXSU5ET1dfSEVBREVS X0xJTkVfSEVJR0hUICh3KSkKKyAgICAgICAgICBib3RfaW5kX21pbl95ID0gV0lORE9XX0hFQURF Ul9MSU5FX0hFSUdIVCAodyk7CisgICAgICAgICAgICAgIGZvciAoeSA9IHJvdy0+eSwgcm4gPSBi b3RfaW5kX3JuIC0gMTsKKyAgICAgICAgICAgICB5ID49IGJvdF9pbmRfbWluX3kgJiYgcm4gPj0g MDsKKyAgICAgICAgICAgICB5IC09IHJvdzEtPmhlaWdodCwgcm4tLSkKKyAgICAgICAgICB7Cisg ICAgICAgICAgICBpZiAodG9wX2luZF9ybiA+PSAwICYmIHJuIDw9IHRvcF9pbmRfcm4pCisgICAg ICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgcm93MSA9IHctPmRlc2lyZWRfbWF0cml4LT5y b3dzICsgcm47CisgICAgICAgICAgICBpZiAoIXJvdzEtPmVuYWJsZWRfcCkKKyAgICAgICAgICAg ICAgcm93MSA9IHctPmN1cnJlbnRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgICByb3cx LT5pbmRpY2F0ZV9lb2JfcCA9IHJvdy0+aW5kaWNhdGVfZW9iX3A7CisgICAgICAgICAgICByb3cx LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wID0gcm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wOwor ICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgTGlzcF9PYmpl Y3QgYnVmID0gdy0+Y29udGVudHM7CisgIENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgYm9vbCBhdXRv X2hzY3JvbGxfbW9kZV9wID0gRVEgKEZidWZmZXJfbG9jYWxfdmFsdWUgKFFhdXRvX2hzY3JvbGxf bW9kZSwgYnVmKSwgUWN1cnJlbnRfbGluZSk7CisgIC8qIEVYQU1QTEU6ICAoc2Nyb2xsLWxlZnQg NSkgKi8KKyAgYm9vbCBoc2NsX2FsbF90ZW1wX3AgPSAody0+c3VzcGVuZF9hdXRvX2hzY3JvbGwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXgg PCBhbmQgZG8gbm90aGluZy4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzBfcCA9ICh3LT5zdXNw ZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNj cm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4g MAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhzY3JvbGwp OworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBzb21ldGhpbmcgZWxzZSBiZXNpZGVz IGhvcml6b250YWxseSBzY3JvbGxpbmcgdGhlCisgICAgICAgICAgICAgICBjdXJyZW50IGxpbmUg ZGlmZmVyZW50bHkuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgaXMgX25vdF8gaG9yaXpv bnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMV9w ID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Ny b2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09 IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCAuLi4KKyAgICAgICAg ICAgICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVy ZW50bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8yX3AgPSAoIXctPnN1c3BlbmRfYXV0b19o c2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVf cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPT0gMAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhzY3JvbGwpOworICAvKiBF WEFNUExFOiAgKHNjcm9sbC1sZWZ0IDUpOyBhbmQsIHRoZW4gcHJlc3MgdGhlIGxlZnQgYXJyb3cg a2V5IG9uZSB0aW1lLgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIF9pc18gaG9yaXpvbnRh bGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiovCisgIGJvb2wgaHNjbF90ZW1wX3AgPSAoIXctPnN1 c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xs X21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAg ICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gMCk7CisgIC8qIEVYQU1QTEU6ICBD LXUgQy14IDwgYW5kIGRvIHNvbWV0aGluZyB0aGF0IGNhdXNlcyB0aGUgY3VycmVudCBsaW5lIHRv IGJlCisgICAgICAgICAgICAgICBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuCisg ICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlm ZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9wZXJtX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Ny b2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAg ICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAg JiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hz Y3JvbGwgIT0gdy0+aHNjcm9sbCk7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJh bWUpOworICBmb3IgKHkgPSB3LT52c2Nyb2xsLCBybiA9IDA7CisgICAgICAgeSA8IHliICYmIHJu IDwgbnJvd3M7CisgICAgICAgeSArPSByb3ctPmhlaWdodCwgcm4rKykKKyAgICB7CisgIGludCBs ZWZ0LCByaWdodDsKKyAgdW5zaWduZWQgbGVmdF9mYWNlX2lkLCByaWdodF9mYWNlX2lkOworICBp bnQgbGVmdF9vZmZzZXQsIHJpZ2h0X29mZnNldDsKKyAgYm9vbCBwZXJpb2RpY19wOworICByb3cg PSB3LT5kZ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W2VsdF0uZW5h YmxlZF9wOworICAgICAgaWYgKCh2cG9zID09IHZwb3NfZGVzaXJlZCB8fCB2cG9zID09IHZwb3Nf Y3VycmVudCkKKyAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgPT0gTUNfT1ZFUkxBWV9BUlJPV19C SVRNQVAKKyAgICAgICAgICAmJiAhaHNjbF9hbGxfdGVtcF9wCisgICAgICAgICAgJiYgIWhzY2xf dGVtcF9wCisgICAgICAgICAgJiYgIWhzY2xfcGVybV9wCisgICAgICAgICAgJiYgIWhzY2xfYWxs X3Blcm1fMF9wCisgICAgICAgICAgJiYgIWhzY2xfYWxsX3Blcm1fMV9wCisgICAgICAgICAgJiYg IWhzY2xfYWxsX3Blcm1fMl9wCisgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICB7Cisg ICAgICAgICAgaW50IGZyaW5nZV9iaXRtYXAgPSBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAg ICAgIGVudW0gZmFjZV9pZCBvdmVybGF5X2Fycm93X2ZhY2VfaWQgPQorICAgICAgICAgICAgKCFh Y3RpdmVfcAorICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2Zh Y2UgKHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1pbmFjdGl2ZS1mYWNlIiksIHRydWUp CisgICAgICAgICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRf ZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWZhY2UiKSwgdHJ1ZSkKKyAgICAg ICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAgIG1jX2xlZnRfZnJpbmdlX2ZhY2Vf aWQgPSAoY3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBvdmVybGF5X2Fycm93X2ZhY2VfaWQKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAg IGlmICh3LT5oc2Nyb2xsICE9IDApCisgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0 X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistb3ZlcmxheS1hcnJvdyIpLCBmYWxzZSwgdHJ1 ZSk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19n ZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1vdmVybGF5LWFycm93IiksIHRydWUsIHRy dWUpOworICAgICAgICAgIG1jX2xlZnRfZnJpbmdlX2JpdG1hcCA9IChjdXJzb3JfdHlwZSA9PSBN Q19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gZnJpbmdlX2JpdG1hcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1D X05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoKHZwb3MgPT0g dnBvc19kZXNpcmVkIHx8IHZwb3MgPT0gdnBvc19jdXJyZW50KQorICAgICAgICAgICAgICAgICAm JiBnbHlwaF9mbGF2b3IgPT0gTUNfT1ZFUkxBWV9BUlJPV19CSVRNQVAKKyAgICAgICAgICAgICAg ICAgJiYgKGhzY2xfYWxsX3RlbXBfcAorICAgICAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxf cGVybV8wX3AKKyAgICAgICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxsX3Blcm1fMV9wCisgICAg ICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzJfcAorICAgICAgICAgICAgICAgICAg ICAgfHwgaHNjbF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgICAgIHx8IGhzY2xfcGVybV9wKQor ICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgeworICAgICAgICAgICAg aW50IGZyaW5nZV9iaXRtYXAgPSBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgICAgZW51 bSBmYWNlX2lkIG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICAgICAgICghYWN0aXZl X3AKKyAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFj ZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtaW5hY3RpdmUtZmFjZSIpLCB0 cnVlKQorICAgICAgICAgICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAgICAgICAgICA/IGxvb2t1 cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ctaHNjbC1mYWNlIiks IHRydWUpCisgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAgICAgbWNf bGVmdF9mcmluZ2VfZmFjZV9pZCA9IChjdXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRN QVApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gb3ZlcmxheV9hcnJv d19mYWNlX2lkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogREVGQVVM VF9GQUNFX0lEOworICAgICAgICAgICAgaWYgKGhzY2xfYWxsX3Blcm1fMF9wKQorICAgICAgICAg ICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIist aHNjbC1wZXJtIiksIGZhbHNlLCBmYWxzZSk7CisgICAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xf YWxsX3Blcm1fMV9wKQorICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJp bmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgdHJ1ZSwgZmFsc2UpOworICAg ICAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xfYWxsX3Blcm1fMl9wKQorICAgICAgICAgICAgICAg ICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhz Y2wtcGVybSIpLCBmYWxzZSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICBlbHNlIGlmIChoc2Ns X3Blcm1fcCkKKyAgICAgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmlu Z2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCB0cnVlLCB0cnVlKTsKKyAgICAg ICAgICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF9hbGxfdGVtcF9wKQorICAgICAgICAgICAgICAg ICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgi Ky1oc2NsLXRlbXAiKSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICBlbHNl IGlmIChoc2NsX3RlbXBfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAg PSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXRlbXAiKSwgdHJ1ZSwg ZmFsc2UpOworICAgICAgICAgICAgbWNfbGVmdF9mcmluZ2VfYml0bWFwID0gKGN1cnNvcl90eXBl ID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IGZyaW5nZV9iaXRtYXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2Ug aWYgKCh2cG9zID09IHZwb3NfZGVzaXJlZCB8fCB2cG9zID09IHZwb3NfY3VycmVudCkKKyAgICAg ICAgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFX1JJ R0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNf UkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAg ICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEUKKyAgICAgICAgICAg ICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJS T1cKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNF RF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8IGds eXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8 IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAg ICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIKQor ICAgICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgICB7CisgICAgICAg ICAgICAgIExpc3BfT2JqZWN0IGJpdG1hcF9mbGF2b3IgPSAoZ2x5cGhfZmxhdm9yID09IE1DX0hP TExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNf UkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVykKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfaG9sbG93X3JlY3Rhbmds ZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEUpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hvbGxvd19yZWN0YW5nbGUKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBN Q19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jhcl9yaWdodF9hcnJvdworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1JF VkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVykKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxfYmFyX3JpZ2h0X2Fy cm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9m bGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXIKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNB TF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1j X3JldmVyc2VkX3ZlcnRpY2FsX2JhcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2Fs X2Jhcl9iYWNrc2xhc2gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogUW5pbDsKKyAgICAgICAgICAgICAgbWNfcmlnaHRfZnJpbmdlX2JpdG1hcCA9IChjdXJzb3Jf dHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gbG9va3VwX2ZyaW5nZV9iaXRtYXAgKGJpdG1hcF9mbGF2b3IpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19OT19GUklOR0VfQklU TUFQOworICAgICAgICAgICAgICBtY19yaWdodF9mcmluZ2VfZmFjZV9pZCA9CisgICAgICAgICAg ICAgICAgKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAg ICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJ R0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVW RVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICB8fCBn bHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKSkKKyAgICAgICAgICAgICAg ICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmV2ZXJzZWQtdmVydGlj YWwtYmFyLWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBN Q19SSUdIVF9GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9y ICE9IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAg ICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hU X0FSUk9XCisgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VE X1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcs IGYsIGludGVybiAoIistdmVydGljYWwtYmFyLWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAg ICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYg KCFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgcm93ID0gY3VyOworICAgICAgbGVmdF9mYWNlX2lk ID0gcmlnaHRfZmFjZV9pZCA9IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgIGxlZnRfb2Zmc2V0ID0g cmlnaHRfb2Zmc2V0ID0gMDsKKyAgICAgIHBlcmlvZGljX3AgPSAwOworICAgICAgLyogRGVjaWRl IHdoaWNoIGJpdG1hcCB0byBkcmF3IGluIHRoZSBs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CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfZW9iX3AgJiYg RVEgKGJvdW5kYXJ5X2JvdCwgUWxlZnQpKQorICAgICAgICB7CisgICAgICAgICAgbGVmdCA9IE1D X0xFRlRfRlJJTkdFICgzLCBRYm90dG9tLCBib3Rfcm93X2VuZHNfYXRfenZfcCk7CisgICAgICAg ICAgaWYgKGJvdF9pbmRfbWF4X3kgPj0gMCkKKyAgICAgICAgICAgIGxlZnRfb2Zmc2V0ID0gYm90 X2luZF9tYXhfeSAtIChyb3ctPnkgKyByb3ctPnZpc2libGVfaGVpZ2h0KTsKKyAgICAgICAgfQor ICAgICAgZWxzZSBpZiAoKCFyb3ctPnJldmVyc2VkX3AgJiYgTUFUUklYX1JPV19DT05USU5VQVRJ T05fTElORV9QIChyb3cpKQorICAgICAgICAgICAgICAgfHwgKHJvdy0+cmV2ZXJzZWRfcCAmJiBy b3ctPmNvbnRpbnVlZF9wKSkKKyAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdFICg0LCBRY29u dGludWF0aW9uLCAwKTsKKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfZW1wdHlfbGluZV9w ICYmIEVRIChlbXB0eV9wb3MsIFFsZWZ0KSkKKyAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdF ICg1LCBRZW1wdHlfbGluZSwgMCk7CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX3RvcF9s aW5lX3AgJiYgRVEgKGFycm93X3RvcCwgUWxlZnQpKQorICAgICAgICB7CisgICAgICAgICAgbGVm dCA9IE1DX0xFRlRfRlJJTkdFICg2LCBRdXAsIDApOworICAgICAgICAgIGlmICh0b3BfaW5kX21p bl95ID49IDApCisgICAgICAgICAgICBsZWZ0X29mZnNldCA9IHRvcF9pbmRfbWluX3kgLSByb3ct Pnk7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVf cCAmJiBFUSAoYXJyb3dfYm90LCBRbGVmdCkpCisgICAgICAgIHsKKyAgICAgICAgICBsZWZ0ID0g TUNfTEVGVF9GUklOR0UgKDcsIFFkb3duLCAwKTsKKyAgICAgICAgICBpZiAoYm90X2luZF9tYXhf eSA+PSAwKQorICAgICAgICAgICAgbGVmdF9vZmZzZXQgPSBib3RfaW5kX21heF95IC0gKHJvdy0+ eSArIHJvdy0+dmlzaWJsZV9oZWlnaHQpOworICAgICAgICB9CisgICAgICBlbHNlCisgICAgICAg IGxlZnQgPSBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgLyogRGVjaWRlIHdoaWNoIGJpdG1h cCB0byBkcmF3IGluIHRoZSByaWdodCBmcmluZ2UuICAqLworICAgICAgaWYgKFdJTkRPV19SSUdI VF9GUklOR0VfV0lEVEggKHcpID09IDApCisgICAgICAgIHJpZ2h0ID0gTUNfTk9fRlJJTkdFX0JJ VE1BUDsKKyAgICAgIGVsc2UgaWYgKHJvdy0+cmlnaHRfdXNlcl9mcmluZ2VfYml0bWFwICE9IE1D X05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgIHsKKyAgICAgICAgICByaWdodCA9IHJvdy0+cmln aHRfdXNlcl9mcmluZ2VfYml0bWFwOworICAgICAgICAgIHJpZ2h0X2ZhY2VfaWQgPSByb3ctPnJp Z2h0X3VzZXJfZnJpbmdlX2ZhY2VfaWQ7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKCghcm93 LT5yZXZlcnNlZF9wICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAg ICB8fCAocm93LT5yZXZlcnNlZF9wICYmIHJvdy0+dHJ1bmNhdGVkX29uX2xlZnRfcCkpCisgICAg ICAgIHJpZ2h0ID0gTUNfUklHSFRfRlJJTkdFICgwLCBRdHJ1bmNhdGlvbiwgMCk7CisgICAgICBl bHNlIGlmIChyb3ctPmluZGljYXRlX2JvYl9wICYmIEVRIChib3VuZGFyeV90b3AsIFFyaWdodCkp CisgICAgICAgIHsKKyAgICAgICAgICByaWdodCA9ICgocm93LT5pbmRpY2F0ZV9lb2JfcCAmJiBF USAoYm91bmRhcnlfYm90LCBRcmlnaHQpKQorICAgICAgICAgICAgID8gTUNfUklHSFRfRlJJTkdF ICgxLCBRdG9wX2JvdHRvbSwgdG9wX3Jvd19lbmRzX2F0X3p2X3ApCisgICAgICAgICAgICAgOiBN Q19SSUdIVF9GUklOR0UgKDIsIFF0b3AsIDApKTsKKyAgICAgICAgICBpZiAodG9wX2luZF9taW5f eSA+PSAwKQorICAgICAgICAgICAgcmlnaHRfb2Zmc2V0ID0gdG9wX2luZF9taW5feSAtIHJvdy0+ eTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9lb2JfcCAmJiBFUSAo Ym91bmRhcnlfYm90LCBRcmlnaHQpKQorICAgICAgICB7CisgICAgICAgICAgcmlnaHQgPSBNQ19S SUdIVF9GUklOR0UgKDMsIFFib3R0b20sIGJvdF9yb3dfZW5kc19hdF96dl9wKTsKKyAgICAgICAg ICBpZiAoYm90X2luZF9tYXhfeSA+PSAwKQorICAgICAgICAgICAgcmlnaHRfb2Zmc2V0ID0gYm90 X2luZF9tYXhfeSAtIChyb3ctPnkgKyByb3ctPnZpc2libGVfaGVpZ2h0KTsKKyAgICAgICAgfQor ICAgICAgZWxzZSBpZiAoKCFyb3ctPnJldmVyc2VkX3AgJiYgcm93LT5jb250aW51ZWRfcCkKKyAg ICAgICAgICAgICAgIHx8IChyb3ctPnJldmVyc2VkX3AgJiYgTUFUUklYX1JPV19DT05USU5VQVRJ T05fTElORV9QIChyb3cpKSkKKyAgICAgICAgcmlnaHQgPSBNQ19SSUdIVF9GUklOR0UgKDQsIFFj b250aW51YXRpb24sIDApOworICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV90b3BfbGluZV9w ICYmIEVRIChhcnJvd190b3AsIFFyaWdodCkpCisgICAgICAgIHsKKyAgICAgICAgICByaWdodCA9 IE1DX1JJR0hUX0ZSSU5HRSAoNiwgUXVwLCAwKTsKKyAgICAgICAgICBpZiAodG9wX2luZF9taW5f eSA+PSAwKQorICAgICAgICAgICAgcmlnaHRfb2Zmc2V0ID0gdG9wX2luZF9taW5feSAtIHJvdy0+ eTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9w ICYmIEVRIChhcnJvd19ib3QsIFFyaWdodCkpCisgICAgICAgIHsKKyAgICAgICAgICByaWdodCA9 IE1DX1JJR0hUX0ZSSU5HRSAoNywgUWRvd24sIDApOworICAgICAgICAgIGlmIChib3RfaW5kX21h eF95ID49IDApCisgICAgICAgICAgICByaWdodF9vZmZzZXQgPSBib3RfaW5kX21heF95IC0gKHJv dy0+eSArIHJvdy0+dmlzaWJsZV9oZWlnaHQpOworICAgICAgICB9CisgICAgICBlbHNlIGlmIChy b3ctPmluZGljYXRlX2VtcHR5X2xpbmVfcCAmJiBFUSAoZW1wdHlfcG9zLCBRcmlnaHQpKQorICAg ICAgICByaWdodCA9IE1DX1JJR0hUX0ZSSU5HRSAoNSwgUWVtcHR5X2xpbmUsIDApOworICAgICAg ZWxzZQorICAgICAgICByaWdodCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICBwZXJpb2Rp Y19wID0gKGdldF9mcmluZ2VfYml0bWFwX2RhdGEgKGxlZnQpLT5wZXJpb2QgIT0gMAorICAgICAg ICAgICAgICAgICAgICB8fCBnZXRfZnJpbmdlX2JpdG1hcF9kYXRhIChyaWdodCktPnBlcmlvZCAh PSAwKTsKKyAgICAgIGlmIChyb3ctPnkgIT0gY3VyLT55CisgICAgICAgICAgfHwgcm93LT52aXNp YmxlX2hlaWdodCAhPSBjdXItPnZpc2libGVfaGVpZ2h0CisgICAgICAgICAgfHwgcm93LT5lbmRz X2F0X3p2X3AgIT0gY3VyLT5lbmRzX2F0X3p2X3AKKyAgICAgICAgICB8fCBsZWZ0ICE9IGN1ci0+ bGVmdF9mcmluZ2VfYml0bWFwCisgICAgICAgICAgfHwgcmlnaHQgIT0gY3VyLT5yaWdodF9mcmlu Z2VfYml0bWFwCisgICAgICAgICAgfHwgbGVmdF9mYWNlX2lkICE9IGN1ci0+bGVmdF9mcmluZ2Vf ZmFjZV9pZAorICAgICAgICAgIHx8IHJpZ2h0X2ZhY2VfaWQgIT0gY3VyLT5yaWdodF9mcmluZ2Vf ZmFjZV9pZAorICAgICAgICAgIHx8IGxlZnRfb2Zmc2V0ICE9IGN1ci0+bGVmdF9mcmluZ2Vfb2Zm c2V0CisgICAgICAgICAgfHwgcmlnaHRfb2Zmc2V0ICE9IGN1ci0+cmlnaHRfZnJpbmdlX29mZnNl dAorICAgICAgICAgIHx8IHBlcmlvZGljX3AgIT0gY3VyLT5mcmluZ2VfYml0bWFwX3BlcmlvZGlj X3AKKyAgICAgICAgICB8fCBjdXItPnJlZHJhd19mcmluZ2VfYml0bWFwc19wKQorICAgICAgICB7 CisgICAgICAgICAgcmVkcmF3X3AgPSAxLCByb3ctPnJlZHJhd19mcmluZ2VfYml0bWFwc19wID0g MTsKKyAgICAgICAgICBpZiAoIWtlZXBfY3VycmVudF9wKQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBjdXItPnJlZHJhd19mcmluZ2VfYml0bWFwc19wID0gMTsKKyAgICAgICAgICAgICAg aWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQCisgICAgICAg ICAgICAgICAgICB8fCBtY19yaWdodF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRN QVApCisgICAgICAgICAgICAgICAgY3VyLT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3AgPSBmYWxz ZTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPmZyaW5nZV9i aXRtYXBfcGVyaW9kaWNfcCA9IHBlcmlvZGljX3A7CisgICAgICAgICAgICAgIGlmIChtY19sZWZ0 X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICBj dXItPmxlZnRfZnJpbmdlX2JpdG1hcCA9IG1jX2xlZnRfZnJpbmdlX2JpdG1hcDsKKyAgICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPmxlZnRfZnJpbmdlX2JpdG1hcCA9 IGxlZnQ7CisgICAgICAgICAgICAgIGlmIChtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9f RlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICBjdXItPmxlZnRfZnJpbmdlX2ZhY2VfaWQg PSBtY19sZWZ0X2ZyaW5nZV9mYWNlX2lkOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgICAgICAgIGN1ci0+bGVmdF9mcmluZ2VfZmFjZV9pZCA9IGxlZnRfZmFjZV9pZDsKKyAgICAg ICAgICAgICAgaWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQ KQorICAgICAgICAgICAgICAgIGN1ci0+bGVmdF9mcmluZ2Vfb2Zmc2V0ID0gMDsKKyAgICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPmxlZnRfZnJpbmdlX29mZnNldCA9 IGxlZnRfb2Zmc2V0OworICAgICAgICAgICAgICBpZiAobWNfcmlnaHRfZnJpbmdlX2JpdG1hcCAh PSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdl X2JpdG1hcCA9IG1jX3JpZ2h0X2ZyaW5nZV9iaXRtYXA7CisgICAgICAgICAgICAgICAgZWxzZQor ICAgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2VfYml0bWFwID0gcmlnaHQ7CisgICAg ICAgICAgICAgIGlmIChtY19yaWdodF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRN QVApCisgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2VfZmFjZV9pZCA9IG1jX3JpZ2h0 X2ZyaW5nZV9mYWNlX2lkOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAg IGN1ci0+cmlnaHRfZnJpbmdlX2ZhY2VfaWQgPSByaWdodF9mYWNlX2lkOworICAgICAgICAgICAg ICBpZiAobWNfcmlnaHRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAg ICAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX29mZnNldCA9IDA7CisgICAgICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2Vfb2Zmc2V0ID0gcmln aHRfb2Zmc2V0OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBpZiAocm93LT5vdmVy bGF5X2Fycm93X2JpdG1hcCA8IDApCisgICAgICAgIHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAg PSBtY19nZXRfbG9naWNhbF9mcmluZ2VfYml0bWFwICh3LCBRb3ZlcmxheV9hcnJvdywgMCwgMCk7 CisgICAgICBpZiAocm93LT5vdmVybGF5X2Fycm93X2JpdG1hcCAhPSBjdXItPm92ZXJsYXlfYXJy b3dfYml0bWFwKQorICAgICAgICB7CisgICAgICAgICAgcmVkcmF3X3AgPSAxLCByb3ctPnJlZHJh d19mcmluZ2VfYml0bWFwc19wID0gMTsKKyAgICAgICAgICBpZiAoIWtlZXBfY3VycmVudF9wKQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICBjdXItPnJlZHJhd19mcmluZ2VfYml0bWFwc19w ID0gMTsKKyAgICAgICAgICAgICAgY3VyLT5vdmVybGF5X2Fycm93X2JpdG1hcCA9IHJvdy0+b3Zl cmxheV9h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pbmdlX29mZnNldDsKKyAgICAgICAgfQorICBpZiAoZmFjZV9pZCA9PSBERUZB VUxUX0ZBQ0VfSUQpCisgICAgeworICAgICAgTGlzcF9PYmplY3QgZmFjZSA9IGZyaW5nZV9mYWNl c1t3aGljaF07CisgICAgICBmYWNlX2lkID0gTklMUCAoZmFjZSkgPyBsb29rdXBfbmFtZWRfZmFj ZSAodywgZiwgUWZyaW5nZSwgZmFsc2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBs b29rdXBfZGVyaXZlZF9mYWNlICh3LCBmLCBmYWNlLCBGUklOR0VfRkFDRV9JRCwgMCk7CisgICAg ICBpZiAoZmFjZV9pZCA8IDApCisgICAgICAgIGZhY2VfaWQgPSBGUklOR0VfRkFDRV9JRDsKKyAg ICB9CisgIGZiID0gZ2V0X2ZyaW5nZV9iaXRtYXBfZGF0YSAod2hpY2gpOworICBwZXJpb2QgPSBm Yi0+cGVyaW9kOworICAvKiBDb252ZXJ0IHJvdyB0byBmcmFtZSBjb29yZGluYXRlcy4gICovCisg IHAueSA9IFdJTkRPV19UT19GUkFNRV9QSVhFTF9ZICh3LCByb3ctPnkpICsgb2Zmc2V0OworICBw LndoaWNoID0gd2hpY2g7CisgIHAuYml0cyA9IGZiLT5iaXRzOworICBwLndkID0gZmItPndpZHRo OworICBwLmggPSBmYi0+aGVpZ2h0OworICBwLmRoID0gKHBlcmlvZCA+IDAgPyAocC55ICUgcGVy aW9kKSA6IDApOworICBwLmggLT0gcC5kaDsKKyAgLyogQWRqdXN0IHkgdG8gdGhlIG9mZnNldCBp biB0aGUgcm93IHRvIHN0YXJ0IGRyYXdpbmcgdGhlIGJpdG1hcC4gICovCisgIHN3aXRjaCAoZmIt PmFsaWduKQorICAgIHsKKyAgICBjYXNlIEFMSUdOX0JJVE1BUF9DRU5URVI6CisgICAgICBwLnkg Kz0gKHJvdy0+aGVpZ2h0IC0gcC5oKSAvIDI7CisgICAgICBicmVhazsKKyAgICBjYXNlIEFMSUdO X0JJVE1BUF9CT1RUT006CisgICAgICBwLnkgKz0gKHJvdy0+dmlzaWJsZV9oZWlnaHQgLSBwLmgp OworICAgICAgYnJlYWs7CisgICAgY2FzZSBBTElHTl9CSVRNQVBfVE9QOgorICAgICAgYnJlYWs7 CisgICAgfQorICBwLmZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGZhY2VfaWQpOworICBpZiAocC5m YWNlID09IE5VTEwpCisgICAgeworICAgICAgLyogVGhpcyBjb3VsZCBoYXBwZW4gYWZ0ZXIgY2xl YXJpbmcgZmFjZSBjYWNoZS4KKyAgIEJ1dCBpdCBzaG91bGRuJ3QgaGFwcGVuIGFueW1vcmUuICAr K2tmcyAqLworICAgICAgcmV0dXJuOworICAgIH0KKyAgcHJlcGFyZV9mYWNlX2Zvcl9kaXNwbGF5 IChmLCBwLmZhY2UpOworICAvKiBDbGVhciBsZWZ0IGZyaW5nZSBpZiBubyBiaXRtYXAgdG8gZHJh dyBvciBpZiBiaXRtYXAgZG9lc24ndCBmaWxsCisgICAgIHRoZSBmcmluZ2UuICAqLworICBwLmJ4 ID0gLTE7CisgIGhlYWRlcl9saW5lX2hlaWdodCA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQg KHcpOworICBwLmJ5ID0gV0lORE9XX1RPX0ZSQU1FX1BJWEVMX1kgKHcsIG1heCAoaGVhZGVyX2xp bmVfaGVpZ2h0LCByb3ctPnkpKTsKKyAgcC5ueSA9IHJvdy0+dmlzaWJsZV9oZWlnaHQ7CisgIGlm IChsZWZ0X3ApCisgICAgeworICAgICAgaW50IHdkID0gV0lORE9XX0xFRlRfRlJJTkdFX1dJRFRI ICh3KTsKKyAgICAgIGludCB4ID0gd2luZG93X2JveF9sZWZ0ICh3LCAoV0lORE9XX0hBU19GUklO R0VTX09VVFNJREVfTUFSR0lOUyAodykKKyAgICAgICAgICAgPyBMRUZUX01BUkdJTl9BUkVBCisg ICAgICAgICAgIDogVEVYVF9BUkVBKSk7CisgICAgICBpZiAocC53ZCA+IHdkKQorICAgICAgICBw LndkID0gd2Q7CisgICAgICBwLnggPSB4IC0gcC53ZCAtICh3ZCAtIHAud2QpIC8gMjsKKyAgICAg IGlmIChwLndkIDwgd2QgfHwgcC55ID4gcC5ieSB8fCBwLnkgKyBwLmggPCBwLmJ5ICsgcC5ueSkK KyAgICAgICAgeworICAgICAgICAgIC8qIElmIFcgaGFzIGEgdmVydGljYWwgYm9yZGVyIHRvIGl0 cyBsZWZ0LCBkb24ndCBkcmF3IG92ZXIgaXQuICAqLworICAgICAgICAgIHdkIC09ICgoIVdJTkRP V19MRUZUTU9TVF9QICh3KQorICAgICAgICAgICAgLyogVGhpcyBjb3VsZCBiZSB3cm9uZyB3aGVu IHdlIGFsbG93IHdpbmRvdyBsb2NhbAorICAgICAgICAgICAgICAgcmlnaHQgZGl2aWRlcnMgLSBi dXQgdGhlIHdpbmRvdyBvbiB0aGUgbGVmdCBpcyBoYXJkCisgICAgICAgICAgICAgICB0byBnZXQu ICAqLworICAgICAgICAgICAgJiYgIUZSQU1FX1JJR0hUX0RJVklERVJfV0lEVEggKGYpCisgICAg ICAgICAgICAmJiAhV0lORE9XX0hBU19WRVJUSUNBTF9TQ1JPTExfQkFSICh3KQorICAgICAgICAg ICAgLyogQnV0IGRvbid0IHJlZHVjZSB0aGUgZnJpbmdlIHdpZHRoIGlmIHRoZSB3aW5kb3cKKyAg ICAgICAgICAgICAgIGhhcyBhIGxlZnQgbWFyZ2luLCBiZWNhdXNlIHRoYXQgbWVhbnMgd2UgYXJl IG5vdAorICAgICAgICAgICAgICAgaW4gZGFuZ2VyIG9mIGRyYXdpbmcgb3ZlciB0aGUgdmVydGlj YWwgYm9yZGVyLAorICAgICAgICAgICAgICAgYW5kIE9UT0ggbGVhdmluZyBvdXQgdGhhdCBvbmUg cGl4ZWwgbGVhdmVzIGJlaGluZAorICAgICAgICAgICAgICAgdHJhY2VzIG9mIHRoZSBjdXJzb3Is IGlmIGl0IHdhcyBpbiBjb2x1bW4gemVybworICAgICAgICAgICAgICAgYmVmb3JlIGRyYXdpbmcg bm9uLWVtcHR5IG1hcmdpbiBhcmVhLiAgKi8KKyAgICAgICAgICAgICYmIHctPmxlZnRfbWFyZ2lu X2NvbHMgPT0gMCkKKyAgICAgICAgICAgPyAxIDogMCk7CisgICAgICAgICAgcC5ieCA9IHggLSB3 ZDsKKyAgICAgICAgICBwLm54ID0gd2Q7CisgICAgICAgIH0KKyAgICB9CisgIGVsc2UKKyAgICB7 CisgICAgICBpbnQgeCA9IHdpbmRvd19ib3hfcmlnaHQgKHcsCisgICAgICAgIChXSU5ET1dfSEFT X0ZSSU5HRVNfT1VUU0lERV9NQVJHSU5TICh3KQorICAgICAgICAgPyBSSUdIVF9NQVJHSU5fQVJF QQorICAgICAgICAgOiBURVhUX0FSRUEpKTsKKyAgICAgIGludCB3ZCA9IFdJTkRPV19SSUdIVF9G UklOR0VfV0lEVEggKHcpOworICAgICAgaWYgKHAud2QgPiB3ZCkKKyAgICAgICAgcC53ZCA9IHdk OworICAgICAgcC54ID0geCArICh3ZCAtIHAud2QpIC8gMjsKKyAgICAgIC8qIENsZWFyIHJpZ2h0 IGZyaW5nZSBpZiBubyBiaXRtYXAgdG8gZHJhdyBvZiBpZiBiaXRtYXAgZG9lc24ndCBmaWxsCisg ICB0aGUgZnJpbmdlLiAgKi8KKyAgICAgIGlmIChwLndkIDwgd2QgfHwgcC55ID4gcC5ieSB8fCBw LnkgKyBwLmggPCBwLmJ5ICsgcC5ueSkKKyAgICAgICAgeworICAgICAgICAgIHAuYnggPSB4Owor ICAgICAgICAgIHAubnggPSB3ZDsKKyAgICAgICAgfQorICAgIH0KKyAgaWYgKHAueCA+PSBXSU5E T1dfQk9YX0xFRlRfRURHRV9YICh3KQorICAgICAgJiYgKHAueCArIHAud2QpIDw9IFdJTkRPV19C T1hfTEVGVF9FREdFX1ggKHcpICsgV0lORE9XX1BJWEVMX1dJRFRIICh3KSkKKyAgICBGUkFNRV9S SUYgKGYpLT5kcmF3X2ZyaW5nZV9iaXRtYXAgKHcsIHJvdywgJnApOworfQorCit2b2lkCittY19k cmF3X2ZyaW5nZV9iaXRtYXAgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJv dywgaW50IGxlZnRfcCwgZW51bSB0eXBlX29mX2N1cnNvciBjdXJzb3JfdHlwZSkKK3sKKyAgaW50 IG92ZXJsYXkgPSAwOworICBpZiAobGVmdF9wID09IHJvdy0+cmV2ZXJzZWRfcCAmJiByb3ctPmN1 cnNvcl9pbl9mcmluZ2VfcCkKKyAgICB7CisgICAgICBMaXNwX09iamVjdCBjdXJzb3IgPSBRbmls OworICAgICAgc3dpdGNoIChjdXJzb3JfdHlwZSkKKyAgICAgICAgeworICAgICAgICBjYXNlIE1D X0ZSQU1FRF9CT1g6CisgICAgICAgICAgaWYgKHJvdy0+dmlzaWJsZV9oZWlnaHQgPj0gU1RBTkRB UkRfQklUTUFQX0hFSUdIVCAoaG9sbG93X3JlY3RhbmdsZV9iaXRzKSkKKyAgICAgICAgICAgIGN1 cnNvciA9IFFob2xsb3c7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgY3Vyc29yID0gUWhv bGxvd19zbWFsbDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19IT0xMT1dfQk9Y OgorICAgICAgICAgIGlmIChyb3ctPnZpc2libGVfaGVpZ2h0ID49IFNUQU5EQVJEX0JJVE1BUF9I RUlHSFQgKGhvbGxvd19yZWN0YW5nbGVfYml0cykpCisgICAgICAgICAgICBjdXJzb3IgPSBRaG9s bG93OworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGN1cnNvciA9IFFob2xsb3dfc21hbGw7 CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAgICAgICAg ICBjdXJzb3IgPSBRYm94OworICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1DX0JBUjoK KyAgICAgICAgICBjdXJzb3IgPSBRYmFyOworICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNl IE1DX0hCQVI6CisgICAgICAgICAgY3Vyc29yID0gUWhiYXI7CisgICAgICAgICAgYnJlYWs7Cisg ICAgICAgIGNhc2UgTUNfTk9fRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgY2FzZSBNQ19OT19DVVJT T1I6CisgICAgICAgIGNhc2UgTUNfUklHSFRfRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgY2FzZSBN Q19MRUZUX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgdy0+cGh5 c19jdXJzb3Jfb25fcCA9IDA7CisgICAgICAgICAgcm93LT5jdXJzb3JfaW5fZnJpbmdlX3AgPSAw OworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBpZiAoIU5JTFAgKGN1cnNvcikp CisgICAgICAgIHsKKyAgICAgICAgICBpbnQgYm0gPSBtY19nZXRfbG9naWNhbF9jdXJzb3JfYml0 bWFwICh3LCBjdXJzb3IpOworICAgICAgICAgIGlmIChibSAhPSBNQ19OT19GUklOR0VfQklUTUFQ KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXBfMSAo dywgcm93LCBsZWZ0X3AsIDIsIGJtKTsKKyAgICAgICAgICAgICAgb3ZlcmxheSA9IEVRIChjdXJz b3IsIFFib3gpID8gMyA6IDE7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIG1j X2RyYXdfZnJpbmdlX2JpdG1hcF8xICh3LCByb3csIGxlZnRfcCwgb3ZlcmxheSwgTUNfTk9fRlJJ TkdFX0JJVE1BUCk7CisgIGlmIChsZWZ0X3AgJiYgcm93LT5vdmVybGF5X2Fycm93X2JpdG1hcCAh PSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcF8xICh3LCBy b3csIDEsIDEsIHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXApOworfQorCisvKiBlbmQgTVVMVElQ TEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogI2RlZmluZSBOT19G UklOR0VfQklUTUFQIDAKICNkZWZpbmUgVU5ERUZfRlJJTkdFX0JJVE1BUCAxCiAjZGVmaW5lIE1B WF9TVEFOREFSRF9GUklOR0VfQklUTUFQUyBBUlJBWUVMVFMgKHN0YW5kYXJkX2JpdG1hcHMpCkBA IC0xNzAwLDYgKzMxOTAsMTY4IEBAIFJldHVybiBuaWwgaWYgUE9TIGlzIG5vdCB2aXNpYmxlIGlu IFdJTkRPVy4gICovKQogdm9pZAogc3ltc19vZl9mcmluZ2UgKHZvaWQpCiB7CisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyog KGdldCAnZW1wdHktbGluZSAnZnJpbmdlKSA9PiAyMyA9PiB0aGUgbGFzdCBzdGFuZGFyZC1iaXRt YXAgYmVmb3JlIHRoaXMgb25lLgorICBTZWUgYGZyaW5nZS5lbGAuICovCisKKyAgLyogMjQgKi8K KyAgREVGU1lNIChRbWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93LCAiKy12ZXJ0aWNhbC1iYXIt cmlnaHQtYXJyb3ciKTsKKyAgVmZyaW5nZV9iaXRtYXBzID0gRmNvbnMgKFFtY192ZXJ0aWNhbF9i YXJfcmlnaHRfYXJyb3csIFZmcmluZ2VfYml0bWFwcyk7CisgIEZwdXQgKFFtY192ZXJ0aWNhbF9i YXJfcmlnaHRfYXJyb3csIFFmcmluZ2UsIG1ha2VfZml4bnVtICgyNCkpOworICAvKiAoZ2V0ICcr LXZlcnRpY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y9uc3Rlcm0uaAppbmRleCA3OGNl NjA4Li44ZWYwZGZlIDEwMDY0NAotLS0gYS9zcmMvbnN0ZXJtLmgKKysrIGIvc3JjL25zdGVybS5o CkBAIC02NjAsNiArNjYwLDE2IEBAIHR5cGVkZWYgaWQgaW5zdGFuY2V0eXBlOwogCiBAaW50ZXJm YWNlIEVtYWNzU2Nyb2xsZXIgOiBOU1Njcm9sbGVyCiAgIHsKKworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIE5TUmVjdCBtY19yZWN0YW5n bGU7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgIHN0cnVjdCB3aW5kb3cgKndp bmRvdzsKICAgIHN0cnVjdCBmcmFtZSAqZnJhbWU7CiAgICBOU1Jlc3BvbmRlciAqcHJldlJlc3Bv bmRlcjsKQEAgLTY4MCw2ICs2OTAsMTggQEAgdHlwZWRlZiBpZCBpbnN0YW5jZXR5cGU7CiAgICBp bnQgZW1fd2hvbGU7CiAgICB9CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKy0gKHZvaWQpbWNfc2V0X3JlY3RhbmdsZTogKE5TUmVjdClyZWN0 OworLSAoTlNSZWN0KW1jX2dldF9yZWN0YW5nbGU7CistIChzdHJ1Y3Qgd2luZG93ICopbWNfZ2V0 X3dpbmRvdzsKKy0gKGJvb2wpbWNfanVkZ2U7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqL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5VTEwpCisgICAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIE5TUmVjdCByX2NsaXA7CisgICAgICAgICAg ICAgICAgICAgIHJfY2xpcC5vcmlnaW4ueCA9IHJvdy0+Y2xpcC0+eDsKKyAgICAgICAgICAgICAg ICAgICAgcl9jbGlwLm9yaWdpbi55ID0gcm93LT5jbGlwLT55OworICAgICAgICAgICAgICAgICAg ICByX2NsaXAuc2l6ZS53aWR0aCA9IHJvdy0+Y2xpcC0+d2lkdGg7CisgICAgICAgICAgICAgICAg ICAgIHJfY2xpcC5zaXplLmhlaWdodCA9IHJvdy0+Y2xpcC0+aGVpZ2h0OworICAgICAgICAgICAg ICAgICAgICBOU1JlY3Qgcl9zYXZlOworICAgICAgICAgICAgICAgICAgICByX3NhdmUub3JpZ2lu LnggPSByWzBdLm9yaWdpbi54OworICAgICAgICAgICAgICAgICAgICByX3NhdmUub3JpZ2luLnkg PSByWzBdLm9yaWdpbi55OworICAgICAgICAgICAgICAgICAgICByX3NhdmUuc2l6ZS53aWR0aCA9 IHJbMF0uc2l6ZS53aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgcl9zYXZlLnNpemUuaGVpZ2h0 ID0gclswXS5zaXplLmhlaWdodDsKKyAgICAgICAgICAgICAgICAgICAgbWNfbnNfaW50ZXJzZWN0 X3JlY3RhbmdsZXMgKCZyX3NhdmUsICZyX2NsaXAsICZyWzBdKTsKKyAgICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgICAgICBOU1JlY3RDbGlwICgqcik7CisgICAgICAgICAgICAgIH0KKyAg ICAgICAgICByZXR1cm4gWUVTOworICAgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIHsKKyAg ICAgICAgICBOU1ZpZXcgKnZpZXcgPSBGUkFNRV9OU19WSUVXIChmKTsKKyAgICAgICAgICBpbnQg aTsKKyAgICAgICAgICBmb3IgKGkgPSAwIDsgaSA8IG4gOyBpKyspCisgICAgICAgICAgICBbdmll dyBzZXROZ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gTGlzcF9PYmplY3QgZm9yZWdyb3VuZCA9IGZh Y2UtPmxmYWNlW0xGQUNFX0ZPUkVHUk9VTkRfSU5ERVhdOworICAgICBMaXNwX09iamVjdCBiYWNr Z3JvdW5kID0gZmFjZS0+bGZhY2VbTEZBQ0VfQkFDS0dST1VORF9JTkRFWF07CisgICAgIGZwcmlu dGYgKHN0ZGVyciwgIlxuZm9yZWdyb3VuZCAoJXMpIHwgYmFja2dyb3VuZCAoJXMpXG4iLAorICAg ICAgICAgICAgICAgICAgICAgICghTklMUCAoZm9yZWdyb3VuZCkgPyBTU0RBVEEgKGZvcmVncm91 bmQpIDogIk5JTFAiKSwKKyAgICAgICAgICAgICAgICAgICAgICAoIU5JTFAgKGJhY2tncm91bmQp ID8gU1NEQVRBIChiYWNrZ3JvdW5kKSA6ICJOSUxQIikpOworICAtICBFWEFNUExFIE9GIEhPVyBU TyBDUkVBVEUgQSBDT0xPUiBXSVRIIFJHQi9MU0wgZmxvYXQgdmFsdWVzOgorICAgICBOU0NvbG9y ICpteV9jb2xvciA9IFtOU0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6IDEuMAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JlZW46IDEuMAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJsdWU6 IDEuMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg YWxwaGE6IDEuMF07CisgIC0gIEFMVEVSTkFUSVZFIEVYQU1QTEU6CisgICAgIGVudW0gZmFjZV9p ZCBkZWJ1Z2dpbmdfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlIChzLT53LCBzLT5mLCBpbnRl cm4gKCIrLWRlYnVnZ2luZy1mYWNlIiksIHRydWUpOworICAgICBzdHJ1Y3QgZmFjZSAqZGVidWdn aW5nX2ZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIGRlYnVnZ2luZ19mYWNlX2lkKTsKKyAgICAg TlNDb2xvciAqY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JP VU5EIChkZWJ1Z2dpbmdfZmFjZSksIHMtPmYpOworICAgICBbY29sb3Igc2V0XTsgKi8KKyAgaWYg KGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSAorICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX0dM WVBITEVTUykKKyAgICBbW05TQ29sb3IgY29sb3JXaXRoQ2FsaWJyYXRlZFJlZDogbHNsLnJlZAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdyZWVuOiBsc2wuZ3JlZW4KKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgYmx1ZTogbHNsLmJsdWUKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBhbHBoYTogMS4wXSBzZXRdOworICAgIGVsc2UKKyAgICAgIFtGUkFNRV9D VVJTT1JfQ09MT1IgKGYpIHNldF07CisgIGlmIChjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9Y KQorICAgIHsKKyAgICAgIExpc3BfT2JqZWN0IGJ1ZiA9IHctPmNvbnRlbnRzOworICAgICAgQ0hF Q0tfQlVGRkVSIChidWYpOworICAgICAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKGJ1Zik7 CisgICAgICBib29sIHJlZ2lvbl9hY3RpdmVfcCA9ICghTklMUCAoVnRyYW5zaWVudF9tYXJrX21v ZGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgbWFy a19hY3RpdmUpKSk7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2JlZ2lubmluZyA9IChyZWdpb25f YWN0aXZlX3ApID8gWEZJWE5VTSAoRnJlZ2lvbl9iZWdpbm5pbmcgKCkpIDogLTE7CisgICAgICBw dHJkaWZmX3QgcmVnaW9uX2VuZCA9IChyZWdpb25fYWN0aXZlX3ApID8gWEZJWE5VTSAoRnJlZ2lv bl9lbmQgKCkpIDogLTE7CisgICAgICBwdHJkaWZmX3Qgb3BvaW50X3B0ID0gKHcgPT0gWFdJTkRP VyAoc2VsZWN0ZWRfd2luZG93KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFBUCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBYRklYTlVNIChGbWFya2VyX3Bvc2l0aW9uICh3 LT5wb2ludG0pKTsKKyAgICAgIGJvb2wgcmVnaW9uX2luX2JvdW5kc19wID0gKHJlZ2lvbl9hY3Rp dmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3B0ID49IHJl Z2lvbl9iZWdpbm5pbmcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2lu dF9wdCA8IHJlZ2lvbl9lbmQpOworICAgICAgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAg ICYmIHJlZ2lvbl9pbl9ib3VuZHNfcAorICAgICAgICAgICYmIGFjdGl2ZV9wKQorICAgICAgICB7 CisgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2ZhY2VfaWQgPSBs b29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXJlZ2lv bi1mYWNlIiksIHRydWUpOworICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX3Jl Z2lvbl9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9mYWNlX2lk KTsKKyAgICAgICAgICBOU0NvbG9yICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9jb2xvciA9IG5zX2xv b2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGhvbGxvd19hY3RpdmVfcmVn aW9uX2ZhY2UpLCBmKTsKKyAgICAgICAgICBob2xsb3dfY29sb3IgPSBob2xsb3dfYWN0aXZlX3Jl Z2lvbl9jb2xvcjsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AK KyAgICAgICAgICAgICAgICAgJiYgIXJlZ2lvbl9pbl9ib3VuZHNfcAorICAgICAgICAgICAgICAg ICAmJiBhY3RpdmVfcCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9s bG93X2FjdGl2ZV9yZWdpb25fb3V0X2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwg aW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXJlZ2lvbi1mYWNlIiksIHRydWUpOworICAgICAg ICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfcmVnaW9uX291dF9mYWNlID0gRkFDRV9G Uk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9vdXRfZmFjZV9pZCk7CisgICAgICAgICAg ICBOU0NvbG9yICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9vdXRfY29sb3IgPSBuc19sb29rdXBfaW5k ZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChob2xsb3dfYWN0aXZlX3JlZ2lvbl9vdXRf ZmFjZSksIGYpOworICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2FjdGl2ZV9yZWdp b25fb3V0X2NvbG9yOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmICghcmVnaW9uX2Fj dGl2ZV9wICYmIGFjdGl2ZV9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBlbnVtIGZh Y2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGlu dGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICBz dHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3df YWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICBOU0NvbG9yICpob2xsb3dfYWN0aXZlX2Nv bG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoaG9sbG93 X2FjdGl2ZV9mYWNlKSwgZik7CisgICAgICAgICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19h Y3RpdmVfY29sb3I7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvKiBUaGUgcmVnaW9uIGlz IF9ub3RfIHZpc2libGUgaW4gdGhlIGluYWN0aXZlIHdpbmRvdyBiZWNhdXNlIHRoZSBvdmVybGF5 IHdpbmRvdyBwcm9wZXJ0eSBpcyB1c2VkLiAqLworICAgICAgICAgICAgZWxzZSBpZiAoIWFjdGl2 ZV9wKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxv d19pbmFjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIist cmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAg IHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9s bG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgIE5TQ29sb3IgKmhvbGxvd19p bmFjdGl2ZV9jb2xvciA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9V TkQgKGhvbGxvd19pbmFjdGl2ZV9mYWNlKSwgZik7CisgICAgICAgICAgICAgICAgaG9sbG93X2Nv bG9yID0gaG9sbG93X2luYWN0aXZlX2NvbG9yOworICAgICAgICAgICAgICB9CisgICAgfQorICAg IGVsc2UgaWYgKGZhY2UgJiYgTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKSA9PSBuc19pbmRleF9j b2xvciAoRlJBTUVfQ1VSU09SX0NPTE9SIChmKSwgZikpCisgICAgICB7CisgICAgICAgIFtuc19s b29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChmYWNlKSwgZikgc2V0XTsK KyAgICAgICAgaG9sbG93X2NvbG9yID0gRlJBTUVfQ1VSU09SX0NPTE9SIChmKTsKKyAgICAgIH0K KyNpZmRlZiBOU19JTVBMX0NPQ09BCisgIE5TRGlzYWJsZVNjcmVlblVwZGF0ZXMgKCk7CisjZW5k aWYKKyAgc3dpdGNoIChjdXJzb3JfdHlwZSkKKyAgICB7CisgICAgICBjYXNlIE1DX05PX0ZSSU5H RV9CSVRNQVA6CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19OT19DVVJTT1I6CisgICAg ICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19SSUdIVF9GUklOR0VfQklUTUFQOgorICAgICAgICBi cmVhazsKKyAgICAgIGNhc2UgTUNfTEVGVF9GUklOR0VfQklUTUFQOgorICAgICAgICBicmVhazsK KyAgICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAg ICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19GUkFNRURfQk9YOgorICAgICAgICBOU1JlY3RGaWxs IChyKTsKKyAgICAgICAgW2hvbGxvd19jb2xvciBzZXRdOworICAgICAgICBOU1JlY3RGaWxsIChO U0luc2V0UmVjdCAociwgMSwgMSkpOworICAgICAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChmKSBz ZXRdOworICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfSE9MTE9XX0JPWDoKKyAgICAgICAg TlNSZWN0RmlsbCAocik7CisgICAgICAgIFtob2xsb3dfY29sb3Igc2V0XTsKKyAgICAgICAgTlNS ZWN0RmlsbCAoTlNJbnNldFJlY3QgKHIsIDEsIDEpKTsKKyAgICAgICAgW0ZSQU1FX0NVUlNPUl9D T0xPUiAoZikgc2V0XTsKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1DX0hCQVI6CisgICAg ICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfQkFSOgor ICAgICAgICBzID0gcjsKKyAgICAgICAgLyogQGxhd2xpc3QgaXMgZm9jdXNpbmcgdGhlIGluaXRp YWwgZGV2ZWxvcG1lbnQgb2YgZmVhdHVyZSByZXF1ZXN0cworICAgICAgICAjMTc2ODQgYW5kICMy Mjg3MyBvbiBMMlIgbGFuZ3VhZ2VzLiAqLworICAgICAgICBpZiAoZ2x5cGhfZmxhdm9yICE9IE1D X0dMWVBICisgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfR0xZUEhMRVNTKQorICAg ICAgICAgIHsKKyAgICAgICAgICAgIC8qIElmIHRoZSBjaGFyYWN0ZXIgdW5kZXIgY3Vyc29yIGlz IFIyTCwgZHJhdyB0aGUgYmFyIGN1cnNvcgorICAgICAgICAgICAgICAgb24gdGhlIHJpZ2h0IG9m IGl0cyBnbHlwaCwgcmF0aGVyIHRoYW4gb24gdGhlIGxlZnQuICAqLworICAgICAgICAgICAgaWYg KChjdXJzb3JfZ2x5cGgtPnJlc29sdmVkX2xldmVsICYgMSkgIT0gMCkKKyAgICAgICAgICAgICAg cy5vcmlnaW4ueCArPSBjdXJzb3JfZ2x5cGgtPnBpeGVsX3dpZHRoIC0gcy5zaXplLndpZHRoOwor ICAgICAgICAgIH0KKyAgICAgICAgTlNSZWN0RmlsbCAocyk7CisgICAgICAgIGJyZWFrOworICAg IH0KKyAgbnNfcmVzZXRfY2xpcHBpbmcgKGYpOworICAvKiBkcmF3IHRoZSBjaG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PnByZXYgJiYg cy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3AKKyAgICAgICAgICAgICAgJiYgcy0+cHJldi0+ZmFj ZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FCisgICAgICAgICAgICAgICYmIHMt PnByZXYtPnVuZGVybGluZV90aGlja25lc3MgPiAwKQorICAgICAgICAgICAgeworICAgICAgICAg ICAgICB0aGlja25lc3MgPSBzLT5wcmV2LT51bmRlcmxpbmVfdGhpY2tuZXNzOworICAgICAgICAg ICAgICBwb3NpdGlvbiA9IHMtPnByZXYtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAg IH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHN0cnVjdCBm b250ICpmb250OworICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIGRlc2NlbnQ7CisgICAgICAg ICAgICAgIGZvbnQ9cy0+Zm9udDsKKyAgICAgICAgICAgICAgZGVzY2VudCA9IHMtPnkgKyBzLT5o ZWlnaHQgLSBzLT55YmFzZTsKKyAgICAgICAgICAgICAgLyogVXNlIHVuZGVybGluZSB0aGlja25l c3Mgb2YgZm9udCwgZGVmYXVsdGluZyB0byAxLiAqLworICAgICAgICAgICAgICB0aGlja25lc3Mg PSAoZm9udCAmJiBmb250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4gMCkKKyAgICAgICAgICAgICAg ICA/IGZvbnQtPnVuZGVybGluZV90aGlja25lc3MgOiAxOworICAgICAgICAgICAgICAvKiBEZXRl cm1pbmUgdGhlIG9mZnNldCBvZiB1bmRlcmxpbmluZyBmcm9tIHRoZSBiYXNlbGluZS4gKi8KKyAg ICAgICAgICAgICAgaWYgKHhfdW5kZXJsaW5lX2F0X2Rlc2NlbnRfbGluZSkKKyAgICAgICAgICAg ICAgICBwb3NpdGlvbiA9IGRlc2NlbnQgLSB0aGlja25lc3M7CisgICAgICAgICAgICAgIGVsc2Ug aWYgKHhfdXNlX3VuZGVybGluZV9wb3NpdGlvbl9wcm9wZXJ0aWVzCisgICAgICAgICAgICAgICAg ICAgICAgICYmIGZvbnQgJiYgZm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uID49IDApCisgICAgICAg ICAgICAgICAgcG9zaXRpb24gPSBmb250LT51bmRlcmxpbmVfcG9zaXRpb247CisgICAgICAgICAg ICAgIGVsc2UgaWYgKGZvbnQpCisgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBscm91bmQgKGZv bnQtPmRlc2NlbnQgLyAyKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHBv c2l0aW9uID0gdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0OworICAgICAgICAgICAgICBwb3NpdGlv biA9IG1heCAocG9zaXRpb24sIHVuZGVybGluZV9taW5pbXVtX29mZnNldCk7CisgICAgICAgICAg ICAgIC8qIEVuc3VyZSB1bmRlcmxpbmluZyBpcyBub3QgY3JvcHBlZC4gKi8KKyAgICAgICAgICAg ICAgaWYgKGRlc2NlbnQgPD0gcG9zaXRpb24pCisgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgcG9zaXRpb24gPSBkZXNjZW50IC0gMTsKKyAgICAgICAgICAgICAgICAgIHRoaWNr bmVzcyA9IDE7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlIGlmIChkZXNj ZW50IDwgcG9zaXRpb24gKyB0aGlja25lc3MpCisgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0g MTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBzLT51bmRlcmxpbmVfdGhpY2tuZXNzID0gdGhp Y2tuZXNzOworICAgICAgICAgIHMtPnVuZGVybGluZV9wb3NpdGlvbiA9IHBvc2l0aW9uOworICAg ICAgICAgIHIgPSBOU01ha2VSZWN0ICh4LCBzLT55YmFzZSArIHBvc2l0aW9uLCB3aWR0aCwgdGhp Y2tuZXNzKTsKKyAgICAgICAgICBpZiAoZmFjZS0+dW5kZXJsaW5lX2RlZmF1bHRlZF9wKQorICAg ICAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICBb bnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKGZhY2UtPnVuZGVybGluZV9jb2xvciwgcy0+Zikgc2V0 XTsKKyAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgfQorICAgIH0KKyAgLyogRG8g b3ZlcmxpbmUuIFdlIGZvbGxvdyBvdGhlciB0ZXJtcyBpbiB1c2luZyBhIHRoaWNrbmVzcyBvZiAx CisgICAgIGFuZCBpZ25vcmluZyBvdmVybGluZV9tYXJnaW4uICovCisgIGlmIChmYWNlLT5vdmVy bGluZV9wKQorICAgIHsKKyAgICAgIE5TUmVjdCByOworICAgICAgciA9IE5TTWFrZVJlY3QgKHgs IHMtPnksIHdpZHRoLCAxKTsKKyAgICAgIGlmIChmYWNlLT5vdmVybGluZV9jb2xvcl9kZWZhdWx0 ZWRfcCkKKyAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsKKyAgICAgIGVsc2UKKyAgICAgICAgW25z X2xvb2t1cF9pbmRleGVkX2NvbG9yIChmYWNlLT5vdmVybGluZV9jb2xvciwgcy0+Zikgc2V0XTsK KyAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgIH0KKyAgLyogRG8gc3RyaWtlLXRocm91Z2guICBX ZSBmb2xsb3cgb3RoZXIgdGVybXMgZm9yIHRoaWNrbmVzcyBhbmQKKyAgICAgdmVydGljYWwgcG9z aXRpb24uKi8KKyAgaWYgKGZhY2UtPnN0cmlrZV90aHJvdWdoX3ApCisgICAgeworICAgICAgTlNS ZWN0IHI7CisgICAgICB1bnNpZ25lZCBsb25nIGR5OworICAgICAgZHkgPSBscmludCAoKHMtPmhl aWdodCAtIDEpIC8gMik7CisgICAgICByID0gTlNNYWtlUmVjdCAoeCwgcy0+eSArIGR5LCB3aWR0 aCwgMSk7CisgICAgICBpZiAoZmFjZS0+c3RyaWtlX3Rocm91Z2hfY29sb3JfZGVmYXVsdGVkX3Ap CisgICAgICAgIFtkZWZhdWx0Q29sIHNldF07CisgICAgICBlbHNlCisgICAgICAgIFtuc19sb29r dXBfaW5kZXhlZF9jb2xvciAoZmFjZS0+c3RyaWtlX3Rocm91Z2hfY29sb3IsIHMtPmYpIHNldF07 CisgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICB9Cit9CisKK3N0YXRpYyB2b2lkCittY19uc19k dW1wZ2x5cGhzX3N0cmV0Y2ggKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMsIGludCB3ZCwgc3RydWN0 IGdseXBoX3JvdyAqcm93KQoreworICBOU1JlY3QgclsyXTsKKyAgaW50IG4sIGk7CisgIHN0cnVj dCBmYWNlICpmYWNlOworICBOU0NvbG9yICpmZ0NvbCwgKmJnQ29sOworICBpZiAoIXMtPmJhY2tn cm91bmRfZmlsbGVkX3ApCisgICAgeworICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xp cF9yZWN0IChzLCByKTsKKyAgICAgICpyID0gTlNNYWtlUmVjdCAocy0+eCwgcy0+eSwgcy0+YmFj a2dyb3VuZF93aWR0aCwgcy0+aGVpZ2h0KTsKKyAgICAgIGlmICghbWNfbnNfY2xpcF90b19yZWN0 IChzLT5mLCByLCBuLCByb3cpKQorICAgICAgICByZXR1cm47CisgICAgICBpZiAocy0+aGwgPT0g RFJBV19NT1VTRV9GQUNFKQorICAgICAgIHsKKyAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQg KHMtPmYsIE1PVVNFX0hMX0lORk8gKHMtPmYpLT5tb3VzZV9mYWNlX2ZhY2VfaWQpOworICAgICAg ICAgaWYgKCFmYWNlKQorICAgICAgICAgICBmYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBNT1VT RV9GQUNFX0lEKTsKKyAgICAgICB9CisgICAgICBlbHNlCisgICAgICAgZmFjZSA9IEZBQ0VfRlJP TV9JRCAocy0+Ziwgcy0+Zmlyc3RfZ2x5cGgtPmZhY2VfaWQpOworICAgICAgYmdDb2wgPSBuc19s b29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKSwgcy0+Zik7Cisg ICAgICBmZ0NvbCA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQg KGZhY2UpLCBzLT5mKTsKKyAgICAgIGZvciAoaSA9IDA7IGkgPCBuOyArK2kpCisgICAgICAgIHsK KyAgICAgICAgICBpZiAoIXMtPnJvdy0+ZnVsbF93aWR0aF9wKQorICAgICAgICAgICAgeworICAg ICAgICBpbnQgb3ZlcnJ1biwgbGVmdG92ZXJydW47CisgICAgICAgICAgICAgIC8qIHRydW5jYXRl IHRvIGF2b2lkIG92ZXJ3cml0aW5nIGZyaW5nZSBhbmQvb3Igc2Nyb2xsYmFyICovCisgICAgICAg IG92ZXJydW4gPSBtYXggKDAsIChzLT54ICsgcy0+YmFja2dyb3VuZF93aWR0aCkKKyAgICAgICAg ICAgLSAoV0lORE9XX0JPWF9SSUdIVF9FREdFX1ggKHMtPncpCisgICAgICAgIC0gV0lORE9XX1JJ R0hUX0ZSSU5HRV9XSURUSCAocy0+dykpKTsKKyAgICAgICAgICAgICAgcltpXS5zaXplLndpZHRo IC09IG92ZXJydW47CisgICAgICAgIC8qIHRydW5jYXRlIHRvIGF2b2lkIG92ZXJ3cml0aW5nIHRv IGxlZnQgb2YgdGhlIHdpbmRvdyBib3ggKi8KKyAgICAgICAgbGVmdG92ZXJydW4gPSAoV0lORE9X X0JPWF9MRUZUX0VER0VfWCAocy0+dykKKyAgICAgICAgICAgKyBXSU5ET1dfTEVGVF9GUklOR0Vf V0lEVEggKHMtPncpKSAtIHMtPng7CisgICAgICAgIGlmIChsZWZ0b3ZlcnJ1biA+IDApCisgICAg ICAgICAgeworICAgICAgICAgICAgcltpXS5vcmlnaW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ZXJsaW5pbmcsIGV0Yy4g b24gdGhlIGN1cnNvci4gKi8KKyAgICAgICAgICAgICAgaWYgKHMtPnctPnBoeXNfY3Vyc29yX3R5 cGUgPT0gTUNfRklMTEVEX0JPWCkKKyAgICAgICAgICAgICAgICBtY19uc19kcmF3X3RleHRfZGVj b3JhdGlvbiAocywgZmFjZSwgYmdDb2wsIHdpZHRoLCB4KTsKKyAgICAgICAgICAgICAgICBlbHNl CisgICAgICAgICAgICAgICAgICBtY19uc19kcmF3X3RleHRfZGVjb3JhdGlvbiAocywgZmFjZSwg ZmdDb2wsIHdpZHRoLCB4KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAg ICAgICB7CisgIC8vICBpbnQgcnggPSByW2ldLm9yaWdpbi54OworICAvLyAgaW50IHJ5ID0gcltp XS5vcmlnaW4ueTsKKyAgLy8gIGludCBydyA9IHJbaV0uc2l6ZS53aWR0aDsKKyAgLy8gIGludCBy aCA9IHJbaV0uc2l6ZS5oZWlnaHQ7CisgIC8vICBmcHJpbnRmIChzdGRlcnIsICJtY19uc19kdW1w Z2x5cGhzX3N0cmV0Y2g6ICB2cG9zICglZCkgfCByeCAoJWQpIHwgcnkgKCVkKSB8IHJ3ICglZCkg fCByaCAoJWQpXG4iLAorICAvLyAgICAgICAgICAgICAgICAgICBzLT5maXJzdF9nbHlwaC0+dnBv cywgcngsIHJ5LCBydywgcmgpOworICAgICAgICAgICAgICBOU1JlY3RGaWxsIChyW2ldKTsKKyAg ICAgICAgICAgIH0KKyAgICAgICAgICAvKiBEcmF3IG92ZXJsaW5pbmcsIGV0Yy4gb24gdGhlIHN0 cmV0Y2ggZ2x5cGggKG9yIHRoZSBwYXJ0CisgICAgICAgICAgICAgb2YgdGhlIHN0cmV0Y2ggZ2x5 cGggYWZ0ZXIgdGhlIGN1cnNvcikuICovCisgICAgICAgICAgbWNfbnNfZHJhd190ZXh0X2RlY29y YXRpb24gKHMsIGZhY2UsIGZnQ29sLCByW2ld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naHQpOworICAgICAgTlNSZWN0IGlyID0g TlNNYWtlUmVjdCAocy0+c2xpY2UueCwgcy0+c2xpY2UueSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHMtPnNsaWNlLndpZHRoLCBzLT5zbGljZS5oZWlnaHQpOworICAgICAgW2ltZyBk cmF3SW5SZWN0OiBkcgorICAgICAgICAgICAgIGZyb21SZWN0OiBpcgorICAgICAgICAgICAgIG9w ZXJhdGlvbjogTlNDb21wb3NpdGVTb3VyY2VPdmVyCisgICAgICAgICAgICAgIGZyYWN0aW9uOiAx LjAKKyAgICAgICAgICAgcmVzcGVjdEZsaXBwZWQ6IFlFUworICAgICAgICAgICAgICAgIGhpbnRz OiBuaWxdOworI2Vsc2UKKyAgICAgIFtpbWcgY29tcG9zaXRlVG9Qb2ludDogTlNNYWtlUG9pbnQg KHgsIHkgKyBzLT5zbGljZS5oZWlnaHQpCisgICAgICAgICAgICAgICAgICBvcGVyYXRpb246IE5T Q29tcG9zaXRlU291cmNlT3Zlcl07CisjZW5kaWYKKyAgICB9CisgIGlmIChzLT5obCA9PSBEUkFX X0NVUlNPUikKKyAgICB7CisgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAocy0+Zikgc2V0XTsKKyAg ICBpZiAocy0+dy0+cGh5c19jdXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9YKQorICAgICAgdGRD b2wgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKSwg cy0+Zik7CisgICAgZWxzZQorICAgICAgLyogQ3VycmVudGx5IG9uIE5TIGltZy0+bWFzayBpcyBh bHdheXMgMC4gU2luY2UKKyAgICAgICAgIGdldF93aW5kb3dfY3Vyc29yX3R5cGUgc3BlY2lmaWVz IGEgaG9sbG93IGJveCBjdXJzb3Igd2hlbiBvbgorICAgICAgICAgYSBub24tbWFza2VkIGltYWdl IHdlIG5ldmVyIHJlYWNoIHRoaXMgY2xhdXN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ltZy0+cmVsaWVmKTsKKyAgICAgICAgICByYWlzZWRfcCA9IChzLT5pbWctPnJlbGllZiA+ IDApOworICAgICAgICB9CisgICAgICByLm9yaWdpbi54ID0geCAtIHRoOworICAgICAgci5vcmln aW4ueSA9IHkgLSB0aDsKKyAgICAgIHIuc2l6ZS53aWR0aCA9IHMtPnNsaWNlLndpZHRoICsgMip0 aC0xOworICAgICAgci5zaXplLmhlaWdodCA9IHMtPnNsaWNlLmhlaWdodCArIDIqdGgtMTsKKyAg ICAgIG5zX2RyYXdfcmVsaWVmIChyLCB0aCwgcmFpc2VkX3AsCisgICAgICAgICAgICAgICAgICAg ICAgcy0+c2xpY2UueSA9PSAwLAorICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLnkgKyBz LT5zbGljZS5oZWlnaHQgPT0gcy0+aW1nLT5oZWlnaHQsCisgICAgICAgICAgICAgICAgICAgICAg cy0+c2xpY2UueCA9PSAwLAorICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLnggKyBzLT5z bGljZS53aWR0aCA9PSBzLT5pbWctPndpZHRoLCBzKTsKKyAgICB9CisgIC8qIElmIHRoZXJlIGlz IG5vIG1hc2ssIHRoZSBiYWNrZ3JvdW5kIHdvbid0IGJlIHNlZW4sCisgICAgIHNvIGRyYXcgYSBy ZWN0YW5nbGUgb24gdGhlIGltYWdlIGZvciB0aGUgY3Vyc29yLgorICAgICBEbyB0aGlzIGZvciBh bGwgaW1hZ2VzLCBnZXR0aW5nIHRyYW5zcGFyZW5jeSByaWdodCBpcyBub3QgcmVsaWFibGUuICAq LworICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IpCisgICAgeworICAgICAgaW50IHRoaWNrbmVz cyA9IGFicyAocy0+aW1nLT5yZWxpZWYpOworICAgICAgaWYgKHRoaWNrbmVzcyA9PSAwKSB0aGlj a25lc3MgPSAxOworICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEgKKyAgICAgICAgfHwg Z2x5cGhfZmxhdm9yID09IE1DX0dMWVBITEVTUykKKyAgICAgIHsKKyAgICAgICAgTlNDb2xvciAq Ym9yZGVyX2NvbG9yID0gW05TQ29sb3IgY29sb3JXaXRoQ2FsaWJyYXRlZFJlZDogbHNsLnJlZAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGdyZWVuOiBsc2wuZ3JlZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgYmx1ZTogbHNsLmJsdWUKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHBoYTogMS4wXTsKKyAgICAg ICAgbnNfZHJhd19ib3ggKGJyLCB0aGlja25lc3MsIGJvcmRlcl9jb2xvciwgMSwgMSk7CisgICAg ICB9CisgICAgICBlbHNlCisgICAgICAgIG5zX2RyYXdfYm94IChiciwgdGhpY2tuZXNzLCBGUkFN RV9DVVJTT1JfQ09MT1IgKHMtPmYpLCAxLCAxKTsKKyAgICB9Cit9CisKK3N0YXRpYyB2b2lkCitt Y19uc19vdmVyd3JpdHRlbl9oZWxwZXIgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMsIHN0cnVjdCBn bHlwaF9tYXRyaXggKm1hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGds eXBoX3JvdyAqcm93LCBlbnVtIHR5cGVfb2ZfY2FjaGUgY2FjaGVfdHlwZSwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgc3RydWN0IGdseXBoICpnbHlwaCkKK3sKKyAgLy8gbnNfZHJhd191bmRl cndhdmUgKHMsIHMtPndpZHRoLCBzLT54KTsKKyAgTlNDb2xvciAqaG9sbG93X2NvbG9yID0gRlJB TUVfQkFDS0dST1VORF9DT0xPUiAocy0+Zik7CisgIHN0cnVjdCBmYWNlICpmYWNlID0gRkFDRV9G Uk9NX0lEIChzLT5mLCBERUZBVUxUX0ZBQ0VfSUQpOworICBpbnQgcm93X3Zwb3MgPSBNQVRSSVhf Uk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgc3RydWN0IG11bHRpcGxlX2N1cnNvcnNfY2FjaGUg Zm9vX2VsdHM7CisgIHN3aXRjaCAoY2FjaGVfdHlwZSkKKyAgICB7CisgICAgICBjYXNlIE5PX0NB Q0hFOgorICAgICAgICB7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGNhc2Ug TUNfQ0FDSEU6CisgICAgICAgIHsKKyAgICAgICAgICBmb29fZWx0cy5jYWNoZXMgPSBzLT53LT5t Y19lbHRzLmNhY2hlczsKKyAgICAgICAgICBmb29fZWx0cy5hbGxvY2F0ZWQgPSBzLT53LT5tY19l bHRzLmFsbG9jYXRlZDsKKyAgICAgICAgICBmb29fZWx0cy51c2VkID0gcy0+dy0+bWNfZWx0cy51 c2VkOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBjYXNlIENIX0NBQ0hFOgor ICAgICAgICB7CisgICAgICAgICAgZm9vX2VsdHMuY2FjaGVzID0gcy0+dy0+Y2hfZWx0cy5jYWNo ZXM7CisgICAgICAgICAgZm9vX2VsdHMuYWxsb2NhdGVkID0gcy0+dy0+Y2hfZWx0cy5hbGxvY2F0 ZWQ7CisgICAgICAgICAgZm9vX2VsdHMudXNlZCA9IHMtPnctPmNoX2VsdHMudXNlZDsKKyAgICAg ICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgY2FzZSBGQ19DQUNIRToKKyAgICAgICAgewor ICAgICAgICAgIGZvb19lbHRzLmNhY2hlcyA9IHMtPnctPmZjX2VsdHMuY2FjaGVzOworICAgICAg ICAgIGZvb19lbHRzLmFsbG9jYXRlZCA9IHMtPnctPmZjX2VsdHMuYWxsb2NhdGVkOworICAgICAg ICAgIGZvb19lbHRzLnVzZWQgPSBzLT53LT5mY19lbHRzLnVzZWQ7CisgICAgICAgICAg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aGVzW2VsdF0uZm9yZWdyb3VuZC5ibHVlfTsKKyAg ICAgIHN0cnVjdCBtY19SR0IgbHNsX2JnID0gey5yZWQgPSBmb29fZWx0cy5jYWNoZXNbZWx0XS5i YWNrZ3JvdW5kLnJlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IGZv b19lbHRzLmNhY2hlc1tlbHRdLmJhY2tncm91bmQuZ3JlZW4sCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAuYmx1ZSA9IGZvb19lbHRzLmNhY2hlc1tlbHRdLmJhY2tncm91bmQuYmx1ZX07 CisgICAgICBib29sIGFjdGl2ZV9wID0gZm9vX2VsdHMuY2FjaGVzW2VsdF0uYWN0aXZlX3A7Cisg ICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSBmb29fZWx0cy5jYWNoZXNbZWx0XS5n bHlwaF9mbGF2b3I7CisgICAgICBib29sIGVuYWJsZWRfcCA9IGZvb19lbHRzLmNhY2hlc1tlbHRd LmVuYWJsZWRfcDsKKyAgICAgIGJvb2wgZ29fcCA9ICh2cG9zID09IHJvd192cG9zCisgICAgICAg ICAgICAgICAgICAgJiYgaHBvcyA9PSBnbHlwaC0+aHBvcworICAgICAgICAgICAgICAgICAgICYm IGVuYWJsZWRfcCk7CisgICAgICBpZiAoIWdvX3ApCisgICAgICAgIGNvbnRpbnVlOworICAgICAg TlNSZWN0IHI7CisgICAgICByLm9yaWdpbi54ID0gZng7CisgICAgICByLm9yaWdpbi55ID0gZnk7 CisgICAgICByLnNpemUuaGVpZ2h0ID0gaDsKKyAgICAgIHIuc2l6ZS53aWR0aCA9IHdkOworICAg ICAgW1tOU0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6IGxzbF9mZy5yZWQKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGdyZWVuOiBsc2xfZmcuZ3JlZW4KKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBibHVlOiBsc2xfZmcuYmx1ZQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgYWxwaGE6IDEuMF0gc2V0XTsKKyAgaWYgKGN1cnNvcl90eXBlID09 IE1DX0ZSQU1FRF9CT1gpCisgICAgeworICAgICAgTGlzcF9PYmplY3QgYnVmID0gcy0+dy0+Y29u dGVudHM7CisgICAgICBDSEVDS19CVUZGRVIgKGJ1Zik7CisgICAgICBzdHJ1Y3QgYnVmZmVyICpi ID0gWEJVRkZFUiAoYnVmKTsKKyAgICAgIGJvb2wgcmVnaW9uX2FjdGl2ZV9wID0gKCFOSUxQIChW dHJhbnNpZW50X21hcmtfbW9kZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFO SUxQIChCVkFSIChiLCBtYXJrX2FjdGl2ZSkpKTsKKyAgICAgIHB0cmRpZmZfdCByZWdpb25fYmVn aW5uaW5nID0gKHJlZ2lvbl9hY3RpdmVfcCkgPyBYRklYTlVNIChGcmVnaW9uX2JlZ2lubmluZyAo KSkgOiAtMTsKKyAgICAgIHB0cmRpZmZfdCByZWdpb25fZW5kID0gKHJlZ2lvbl9hY3RpdmVfcCkg PyBYRklYTlVNIChGcmVnaW9uX2VuZCAoKSkgOiAtMTsKKyAgICAgIHB0cmRpZmZfdCBvcG9pbnRf cHQgPSAocy0+dyA9PSBYV0lORE9XIChzZWxlY3RlZF93aW5kb3cpKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gUFQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFhGSVhOVU0g KEZtYXJrZXJfcG9zaXRpb24gKHMtPnctPnBvaW50bSkpOworICAgICAgYm9vbCByZWdpb25faW5f Ym91bmRzX3AgPSAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBvcG9pbnRfcHQgPj0gcmVnaW9uX2JlZ2lubmluZworICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA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Jzb3JfdHlwZSkKKyAg ICAgICAgeworICAgICAgICAgIGNhc2UgTUNfTk9fRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgICAg IGJyZWFrOworICAgICAgICAgIGNhc2UgTUNfTk9fQ1VSU09SOgorICAgICAgICAgICAgYnJlYWs7 CisgICAgICAgICAgY2FzZSBNQ19SSUdIVF9GUklOR0VfQklUTUFQOgorICAgICAgICAgIGNhc2Ug TUNfTEVGVF9GUklOR0VfQklUTUFQOgorICAgICAgICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAg ICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAg Y2FzZSBNQ19GUkFNRURfQk9YOgorICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAg ICAgICBbaG9sbG93X2NvbG9yIHNldF07CisgICAgICAgICAgICBOU1JlY3RGaWxsIChOU0luc2V0 UmVjdCAociwgMSwgMSkpOworICAgICAgICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAocy0+Zikg c2V0XTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIGNhc2UgTUNfSE9MTE9XX0JPWDoK KyAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAgW2hvbGxvd19jb2xvciBz ZXRdOworICAgICAgICAgICAgTlNSZWN0RmlsbCAoTlNJbnNldFJlY3QgKHIsIDEsIDEpKTsKKyAg ICAgICAgICAgIFtGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpIHNldF07CisgICAgICAgICAgICBi cmVhazsKKyAgICAgICAgICBjYXNlIE1DX0hCQVI6CisgICAgICAgICAgICBOU1JlY3RGaWxsIChy KTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIGNhc2UgTUNfQkFSOgorICAgICAgICAg ICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAg LyogSWYgYSB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geworICAgICAgICAgICAgICAgIHN0cnVj dCBmb250ICpmb250ID0gcy0+ZmFjZS0+Zm9udDsKKyAgICAgICAgICAgICAgICBpZiAoIWZvbnQp CisgICAgICAgICAgICAgICAgICBmb250ID0gRlJBTUVfRk9OVCAocy0+Zik7CisgICAgICAgICAg ICAgICAgYm9vbCB3aXRoX2JnX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBmb250LT5kcml2 ZXItPmRyYXcgKHMsIHMtPmNtcF9mcm9tLCBzLT5uY2hhcnMsIHMtPngsIHMtPnliYXNlLCB3aXRo X2JnX3ApOworICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9Cit9CisKK3N0YXRpYyB2 b2lkCittY19uc19kcmF3X292ZXJ3cml0dGVuIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzLCBzdHJ1 Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qg Z2x5cGhfcm93ICpyb3csIHN0cnVjdCBnbHlwaCAqZ2x5cGgpCit7CisgIC8vICBpbnQgdnBvcyA9 IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAvLyAgY2xvY2tfdCBjbG9ja19zdGFy dCA9IGNsb2NrKCk7CisgIG1jX25zX292ZXJ3cml0dGVuX2hlbHBlciAocywgbWF0cml4LCByb3cs IE1DX0NBQ0hFLCBnbHlwaCk7CisgIG1jX25zX292ZXJ3cml0dGVuX2hlbHBlciAocywgbWF0cml4 LCByb3csIENIX0NBQ0hFLCBnbHlwaCk7CisgIG1jX25zX292ZXJ3cml0dGVuX2hlbHBlciAocywg bWF0cml4LCByb3csIEZDX0NBQ0hFLCBnbHlwaCk7CisgIC8vICBjbG9ja190IGNsb2NrX2VuZCA9 IGNsb2NrKCk7CisgIC8vICBkb3VibGUgY3B1X3RpbWVfdXNlZCA9ICgoZG91YmxlKSAoY2xvY2tf ZW5kIC0gY2xvY2tfc3RhcnQpKSAvIENMT0NLU19QRVJfU0VDOworICAvLyAgZnByaW50ZiAoc3Rk ZXJyLCAibnNfZHJhd19vdmVyd3JpdHRlbiAoJWQpOiAgVElNRSAoJWYpXG4iLCB2cG9zLCBjcHVf dGltZV91c2VkKTsKK30KKworc3RhdGljIHZvaWQKK21jX25zX21heWJlX2R1bXBnbHlwaHNfYmFj a2dyb3VuZCAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgY2hhciBmb3JjZV9wKQoreworICBOU1RS QUNFICgibWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIik7CisgIGlmICghcy0+YmFj a2dyb3VuZF9maWxsZWRfcC8qIHx8IHMtPmhsID09IERSQVdfTU9VU0VfRkFDRSovKQorICAgIHsK KyAgICAgIGludCBib3hfbGluZV93aWR0aCA9IG1heCAocy0+ZmFjZS0+Ym94X2xpbmVfd2lkdGgs IDApOworICAgICAgaWYgKEZPTlRfSEVJR0hUIChzLT5mb250KSA8IHMtPmhlaWdodCAtIDIgKiBi b3hfbGluZV93aWR0aAorICAgICAgICAgIC8qIFdoZW4geGRpc3AuYyBpZ25vcmVzIEZPTlRfSEVJ R0hULCB3ZSBjYW5ub3QgdHJ1c3QgZm9udAorICAgICAgICAgICAgIGRpbWVuc2lvbnMsIHNpbmNl IHRoZSBhY3R1YWwgZ2x5cGhzIG1pZ2h0IGJlIG11Y2gKKyAgICAgICAgICAgICBzbWFsbGVyLiAg U28gaW4gdGhhdCBjYXNlIHdlIGFsd2F5cyBjbGVhciB0aGUgcmVjdGFuZ2xlCisgICAgICAgICAg ICAgd2l0aCBiYWNrZ3JvdW5kIGNvbG9yLiAgKi8KKyAgICAgICAgICB8fCBGT05UX1RPT19ISUdI IChzLT5mb250KQorICAgICAgICAgIHx8IHMtPmZvbnRfbm90X2ZvdW5kX3AgfHwgcy0+ZXh0ZW5k c190b19lbmRfb2ZfbGluZV9wIHx8IGZvcmNlX3ApCisgICAgICB7CisgICAgICAgICAgc3RydWN0 IGZhY2UgKmZhY2U7CisgICAgICAgICAgaWYgKHMtPmhsID09IERSQVdfTU9VU0VfRkFDRSkKKyAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwKKyAg ICAgICAgICAgTU9VU0VfSExfSU5GTyAocy0+ZiktPm1vdXNlX2ZhY2VfZmFjZV9pZCk7CisgICAg ICAgICAgICAgIGlmICghZmFjZSkKKyAgICAgICAgICAgICAgICBmYWNlID0gRkFDRV9GUk9NX0lE IChzLT5mLCBNT1VTRV9GQUNFX0lEKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisg ICAgICAgICAgICBmYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBzLT5maXJzdF9nbHlwaC0+ZmFj ZV9pZCk7CisgICAgICAgICAgaWYgKCFmYWNlLT5zdGlwcGxlKQorICAgICAgICAgICAgWyhOU19G QUNFX0JBQ0tHUk9VTkQgKGZhY2UpICE9IDAKKyAgICAgICAgICAgICAgPyBuc19sb29rdXBfaW5k ZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKSwgcy0+ZikKKyAgICAgICAgICAg ICAgOiBGUkFNRV9CQUNLR1JPVU5EX0NPTE9SIChzLT5mKSkgc2V0XTsKKyAgICAgICAgICBlbHNl CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHN0cnVjdCBuc19kaXNwbGF5X2luZm8gKmRw eWluZm8gPSBGUkFNRV9ESVNQTEFZX0lORk8gKHMtPmYpOworICAgICAgICAgICAgICBbW2RweWlu Zm8tPmJpdG1hcHNbZmFjZS0+c3RpcHBsZS0xXS5pbWcgc3RpcHBsZU1hc2tdIHNldF07CisgICAg ICAgICAgICB9CisgICAgICAgICAgaWYgKHMtPmhsICE9IERSQVdfQ1VSU09SKQorICAgICAgICAg ICAgeworICAgICAgICAgICAgICBzLT5yZWN0YW5nbGVfbnVrZWRfcCA9IHRydWU7CisgICAgICAg ICAgICAgIE5TUmVjdCByID0gTlNNYWtlUmVjdCAocy0+eCwgcy0+eSArIGJveF9saW5lX3dpZHRo LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+YmFja2dyb3VuZF93aWR0 aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPmhlaWdodC0yKmJveF9s aW5lX3dpZHRoKTsKKyAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAgICB9 CisgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IDE7CisgICAgICB9CisgICAgfQorfQorCitz dGF0aWMgdm9pZAorbWNfbnNfZHJhd19nbHlwaF9zdHJpbmcgKHN0cnVjdCBnbHlwaF9zdHJpbmcg KnMsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAor ICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsLCBlbnVtIG1jX2ZsYXZv ciBnbHlwaF9mbGF2b3IsCisgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSB0eXBlX29mX2N1 cnNvciBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgd2QsIGJvb2wg YWN0aXZlX3AsIGJvb2wgY3Vyc29yX2djX3ApCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAg RXh0ZXJuYWwgKFJJRik6IE1haW4gZHJhdy10ZXh0IGNhbGwuCisgICAtLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LSAqLworeworICAvKiBUT0RPIChvcHRpbWl6ZSk6IGZvY3VzIGZvciBib3ggYW5kIGNvbnRlbnRz IGRyYXcgKi8KKyAgTlNSZWN0IHJbMl07CisgIGludCBuLCBmbGFnczsKKyAgY2hhciBib3hfZHJh d25fcCA9IDA7CisgIHN0cnVjdCBmb250ICpmb250ID0gcy0+ZmFjZS0+Zm9udDsKKyAgaWYgKCFm b250KQorICAgIGZvbnQgPSBGUkFNRV9GT05UIChzLT5mKTsKKyAgTlNUUkFDRV9XSEVOIChOU1RS QUNFX0dST1VQX0dMWVBIUywgIm1jX25zX2RyYXdfZ2x5cGhfc3RyaW5nIik7CisgIGlmIChzLT5u ZXh0ICYmIHMtPnJpZ2h0X292ZXJoYW5nICYmICFzLT5mb3Jfb3ZlcmxhcHMpCisgICAgeworICAg ICAgaW50IHdpZHRoOworICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAqbmV4dDsKKyAgICAgIGZv ciAod2lkdGggPSAwLCBuZXh0ID0gcy0+bmV4dDsKKyAgICAgICAgICAgbmV4dCAmJiB3aWR0aCA8 IHMtPnJpZ2h0X292ZXJoYW5nOworICAgICAgICAgICB3aWR0aCArPSBuZXh0LT53aWR0aCwgbmV4 dCA9IG5leHQtPm5leHQpCisgICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSAhPSBJ TUFHRV9HTFlQSCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpZiAobmV4dC0+Zmlyc3RfZ2x5 cGgtPnR5cGUgIT0gU1RSRVRDSF9HTFlQSCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgIG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocy0+bmV4dCwgcik7CisgICAg ICAgICAgICAgICAgaWYgKCFtY19uc19jbGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4sIHJvdykpCisg ICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgbWNfbnNfbWF5YmVfZHVt cGdseXBoc19iYWNrZ3JvdW5kIChzLT5uZXh0LCAxKTsKKyAgICAgICAgICAgICAgICBuc19yZXNl dF9jbGlwcGluZyAocy0+Zik7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIG1jX25zX2R1bXBnbHlwaHNfc3RyZXRjaCAo cy0+bmV4dCwgd2QsIHJvdyk7CisgICAgICAgICAgICAgICAgaWYgKChzLT5uZXh0LT5sZWZ0X292 ZXJ3cml0dGVuX3AgfHwgcy0+bmV4dC0+cmlnaHRfb3ZlcndyaXR0ZW5fcCkKKyAgICAgICAgICAg ICAgICAgICAgJiYgcy0+bmV4dC0+YWN0aW9uX3R5cGUgPT0gTUNfRFJBV19HTFlQSCkKKyAgICAg ICAgICAgICAgICAgIG1jX25zX2RyYXdfb3ZlcndyaXR0ZW4gKHMtPm5leHQsIG1hdHJpeCwgcm93 LCBzLT5uZXh0LT5maXJzdF9nbHlwaCk7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG5l eHQtPm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgfQorICAgIH0KKyAgaWYgKCFzLT5mb3Jfb3Zl cmxhcHMgJiYgcy0+ZmFjZS0+Ym94ICE9IEZBQ0VfTk9fQk9YCisgICAgICAmJiAocy0+Zmlyc3Rf Z2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgIHx8IHMtPmZpcnN0X2dseXBoLT50 eXBlID09IENPTVBPU0lURV9HTFlQSCkpCisgICAgeworICAgICAgbiA9IG5zX2dldF9nbHlwaF9z dHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAgICAgIGlmICghbWNfbnNfY2xpcF90b19yZWN0IChz LT5mLCByLCBuLCByb3cpKQorICAgICAgICByZXR1cm47CisgICAgICBtY19uc19tYXliZV9kdW1w Z2x5cGhzX2JhY2tncm91bmQgKHMsIDEpOworICAgICAgbnNfZHVtcGdseXBoc19ib3hfb3JfcmVs aWVmIChzKTsKKyAgICAgIG5z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NfRlJBTUVEX0JPWAorICAgICAgICAgICAgICAgICAmJiBhY3Rp dmVfcCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2 ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAoIistcmVh bC1mYWtlLWN1cnNvci1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhv bGxvd19hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgaG9sbG93X2FjdGl2ZV9mYWNl X2lkKTsKKyAgICAgICAgICAgIE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSkgPSBOU19GQUNF X0ZPUkVHUk9VTkQgKGhvbGxvd19hY3RpdmVfZmFjZSk7CisgICAgICAgICAgfQorICAgICAgICAg IGVsc2UgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SCisgICAgICAgICAgICAgICAgICAgJiYgY3Vy c29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWAorICAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9w KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0 aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ZiwgaW50ZXJuICgiKy1y ZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgIHN0 cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgaG9s bG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICBOU19GQUNFX0ZPUkVHUk9VTkQg KHMtPmZhY2UpID0gTlNfRkFDRV9GT1JFR1JPVU5EIChob2xsb3dfaW5hY3RpdmVfZmFjZSk7Cisg ICAgICAgICAgICB9CisgICAgICB7CisgICAgICAgIEJPT0wgaXNDb21wb3NpdGUgPSBzLT5maXJz dF9nbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEg7CisgICAgICAgIGlmIChpc0NvbXBvc2l0 ZSkKKyAgICAgICAgICBuc19kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAo cyk7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBib29sIHdp dGhfYmdfcCA9ICgoZmxhZ3MgPT0gTlNfRFVNUEdMWVBIX05PUk1BTCAmJiAhcy0+YmFja2dyb3Vu ZF9maWxsZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgZmxhZ3MgPT0g TlNfRFVNUEdMWVBIX01PVVNFRkFDRSk7CisgICAgICAgICAgICAgIGlmICh3aXRoX2JnX3ApCisg ICAgICAgICAgICAgICAgcy0+YmFja2dyb3VuZF9udWtlZF9wID0gdHJ1ZTsKKyAgICAgICAgICAg ICAgZm9udC0+ZHJpdmVyLT5kcmF3IChzLCBzLT5jbXBfZnJvbSwgcy0+bmNoYXJzLCBzLT54LCBz LT55YmFzZSwgd2l0aF9iZ19wKTsKKyAgICAgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIHsKKyAg ICAgICAgTlNDb2xvciAqY29sID0gKE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSkgIT0gMAor ICAgICAgICAgICAgICAgICAgICAgICAgPyBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFD RV9GT1JFR1JPVU5EIChzLT5mYWNlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHMtPmYpCisgICAgICAgICAgICAgICAgICAgICAgICA6IEZSQU1F X0ZPUkVHUk9VTkRfQ09MT1IgKHMtPmYpKTsKKyAgICAgICAgW2NvbCBzZXRdOworICAgICAgIC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IHJvdykpCisgICAgICAgIHJldHVybjsKKyAgICAgIG5zX2R1bXBnbHlwaHNfYm94 X29yX3JlbGllZiAocyk7CisgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgfQor ICBzLT5udW1fY2xpcHMgPSAwOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KIAogICAgTlNU UkFDRSwgVHJhY2Ugc3VwcG9ydC4KQEAgLTExMDksNiArMjE5NCwxNiBAQCBzdGF0aWMgTlNSZWN0 IGNvbnN0cmFpbl9mcmFtZV9yZWN0KE5TUmVjdCBmcmFtZVJlY3QsIGJvb2wgaXNGdWxsc2NyZWVu KQogICAgZXh0ZXJuYWwgKFJJRikgY2FsbDsgd2hvbGUgZnJhbWUsIGNhbGxlZCBiZWZvcmUgdXBk YXRlX3dpbmRvd19iZWdpbgogICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KIHsKKworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5tY191cGRh dGluZ19mcmFtZSA9IGY7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICNpZmRlZiBO U19JTVBMX0NPQ09BCiAgIEVtYWNzVmlldyAqdmlldyA9IEZSQU1FX05TX1ZJRVcgKGYpOwogCkBA IC0xMjA5LDYgKzIzMDQsMTYgQEAgc3RhdGljIE5TUmVjdCBjb25zdHJhaW5fZnJhbWVfcmVjdChO U1JlY3QgZnJhbWVSZWN0LCBib29sIGlzRnVsbHNjcmVlbikKIAogLyogICBpZiAoZiA9PSBNT1VT RV9ITF9JTkZPIChmKS0+bW91c2VfZmFjZV9tb3VzZV9mcmFtZSkgKi8KICAgTU9VU0VfSExfSU5G TyAoZiktPm1vdXNlX2ZhY2VfZGVmZXIgPSAwOworCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gTlVM TDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAKQEAgLTQ4MDMsNiArNTkw OCwxNyBAQCBpbiBjZXJ0YWluIHNpdHVhdGlvbnMgKHJhcGlkIGluY29taW5nIGV2ZW50cykuCiAg ICAgICBiYXIgPSBbW0VtYWNzU2Nyb2xsZXIgYWxsb2NdIGluaXRGcmFtZTogciB3aW5kb3c6IHdp bl07CiAgICAgICB3c2V0X3ZlcnRpY2FsX3Njcm9sbF9iYXIgKHdpbmRvdywgbWFrZV9taW50X3B0 ciAoYmFyKSk7CiAgICAgICB1cGRhdGVfcCA9IFlFUzsKKworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgLyogVGhpcyBpcyBvbmx5IGZv ciBkZWJ1Z2dpbmcgcHVycG9zZXMuICovCisgICAgICBbYmFyIG1jX3NldF9yZWN0YW5nbGU6IHJd OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgfQogICBlbHNlCiAgICAgewpA QCAtNDgxMCwxMiArNTkyNiwzMCBAQCBpbiBjZXJ0YWluIHNpdHVhdGlvbnMgKHJhcGlkIGluY29t aW5nIGV2ZW50cykuCiAgICAgICBiYXIgPSBYTlNfU0NST0xMX0JBUiAod2luZG93LT52ZXJ0aWNh bF9zY3JvbGxfYmFyKTsKICAgICAgIG9sZFJlY3QgPSBbYmFyIGZyYW1lXTsKICAgICAgIHIuc2l6 ZS53aWR0aCA9IG9sZFJlY3Quc2l6ZS53aWR0aDsKKworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogICAgICAgaWYgKEZSQU1FX0xJVkVfUCAoZikg JiYgIU5TRXF1YWxSZWN0cyAob2xkUmVjdCwgcikpCiAgICAgICAgIHsKKyAgICAgICAgICAvKiBU aGUgbWFpbiB3aW5kb3cgaGFzIHByb2JhYmx5IGJlZW4gcmVzaXplZC4gIEdyYWNpb3VzbHkgZGVs ZXRlIHRoZQorICAgICAgICAgIG9sZCBzY3JvbGwgYmFyIHdpdGhvdXQgcmVwYWludGluZyBpdHMg cmVjdGFuZ2xlOyBhbmQsIGNyZWF0ZSBhIG5ldworICAgICAgICAgIHNjcm9sbCBiYXIgZWxzZXdo ZXJlLiovCiAgICAgICAgICAgaWYgKG9sZFJlY3Qub3JpZ2luLnggIT0gci5vcmlnaW4ueCkKKyAg ICAgICAgICAgIHsKICAgICAgICAgICAgICAgbnNfY2xlYXJfZnJhbWVfYXJlYSAoZiwgbGVmdCwg dG9wLCB3aWR0aCwgaGVpZ2h0KTsKKyAgICAgICAgICAgICAgW2JhciBtY19qdWRnZV07CisgICAg ICAgICAgICAgIGJhciA9IFtbRW1hY3NTY3JvbGxlciBhbGxvY10gaW5pdEZyYW1lOiByIHdpbmRv dzogd2luXTsKKyAgICAgICAgICAgICAgd3NldF92ZXJ0aWNhbF9zY3JvbGxfYmFyICh3aW5kb3cs IG1ha2VfbWludF9wdHIgKGJhcikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQog ICAgICAgICAgIFtiYXIgc2V0RnJhbWU6IHJdOwogICAgICAgICB9CisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKICAgICB9CiAKICAgaWYgKHVwZGF0ZV9wKQpAQCAtNDk3NSw5ICs2MTA5 LDU3IEBAIGluIGNlcnRhaW4gc2l0dWF0aW9ucyAocmFwaWQgaW5jb21pbmcgZXZlbnRzKS4KICAg ICB7CiAgICAgICB2aWV3ID0gW3N1YnZpZXdzIG9iamVjdEF0SW5kZXg6IGldOwogICAgICAgaWYg KCFbdmlldyBpc0tpbmRPZkNsYXNzOiBbRW1hY3NTY3JvbGxlciBjbGFzc11dKSBjb250aW51ZTsK LSAgICAgIGlmIChbdmlldyBqdWRnZV0pCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisv KiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogYFhTRVRXSU5ET1cnIHdpbGwgc29tZXRpbWVz IGNhdXNlIEVtYWNzIHRvIGNyYXNoIHdoZW4gcnVubmluZyB1bmRlciBnZGIgZXZlbgorICB0aG91 Z2ggKHcgIT0gTlVMTCkuICBUaGVyZWZvcmUsIHdlIGNhbm5vdCByZWxpYWJseSB1c2UgYFdJTkRP V19MSVZFX1AnLiAqLworICBzdHJ1Y3Qgd2luZG93ICp3ID0gW3ZpZXcgbWNfZ2V0X3dpbmRvd107 CisgIGlmICh3ICE9IE5VTEwKKyAgICAgICYmIE5JTFAgKHctPmNvbnRlbnRzKSkKKyAgICB7Cisg ICAgICBCT09MIGRlYnVnX3AgPSBmYWxzZTsKKyAgICAgIGlmIChkZWJ1Z19wCisgICAgICAgICAg LyogYHdpbmRvd19ib3gnIGNhbGxzIGB3aW5kb3dfYm94X2hlaWdodCcsIHdoaWNoIHdpbGwgY2F1 c2UgRW1hY3MgdG8KKyAgICAgICAgICBjcmFzaCBpZiBGUkFNRVAgKHctPmZyYW1lKSBpcyBub3Qg c2F0aXNmaWVkLiAqLworICAgICAgICAgICYmIEZSQU1FUCAody0+ZnJhbWUpKQorICAgICAgICB7 CisgICAgICAgICAgTlNSZWN0IHIwID0gW3ZpZXcgbWNfZ2V0X3JlY3RhbmdsZV07CisgICAgICAg ICAgaW50IHgwID0gTlNNaW5YIChyMCk7CisgICAgICAgICAgaW50IHkwID0gTlNNaW5ZIChyMCk7 CisgICAgICAgICAgaW50IHdkMCA9IE5TV2lkdGggKHIwKTsKKyAgICAgICAgICBpbnQgaDAgPSBO U0hlaWdodCAocjApOworICAgICAgICAgIGludCB3aW5kb3dfeSwgd2luZG93X2hlaWdodDsKKyAg ICAgICAgICB3aW5kb3dfYm94ICh3LCBBTllfQVJFQSwgMCwgJndpbmRvd195LCAwLCAmd2luZG93 X2hlaWdodCk7CisgICAgICAgICAgaW50IHRvcCA9IHdpbmRvd195OworICAgICAgICAgIGludCBo ZWlnaHQgPSB3aW5kb3dfaGVpZ2h0OworICAgICAgICAgIGludCB3aWR0aCA9IFdJTkRPV19DT05G SUdfU0NST0xMX0JBUl9DT0xTICh3KSAqIEZSQU1FX0NPTFVNTl9XSURUSCAoZik7CisgICAgICAg ICAgaW50IGxlZnQgPSBXSU5ET1dfU0NST0xMX0JBUl9BUkVBX1ggKHcpOworICAgICAgICAgIE5T UmVjdCByMSA9IE5TTWFrZVJlY3QgKGxlZnQsIHRvcCwgd2lkdGgsIGhlaWdodCk7CisgICAgICAg ICAgLyogVGhlIHBhcmVudCB2aWV3IGlzIGZsaXBwZWQsIHNvIHdlIG5lZWQgdG8gZmxpcCB5IHZh bHVlLiAqLworICAgICAgICAgIEVtYWNzVmlldyAqZnJhbWVfdmlldyA9IEZSQU1FX05TX1ZJRVcg KGYpOworICAgICAgICAgIE5TUmVjdCB2ID0gW2ZyYW1lX3ZpZXcgZnJhbWVdOworICAgICAgICAg IHIxLm9yaWdpbi55ID0gKHYuc2l6ZS5oZWlnaHQgLSByMS5zaXplLmhlaWdodCAtIHIxLm9yaWdp bi55KTsKKyAgICAgICAgICBpbnQgeDEgPSBOU01pblggKHIxKTsKKyAgICAgICAgICBpbnQgeTEg PSBOU01pblkgKHIxKTsKKyAgICAgICAgICBpbnQgd2QxID0gTlNXaWR0aCAocjEpOworICAgICAg ICAgIGludCBoMSA9IE5TSGVpZ2h0IChyMSk7CisgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAi JXMgLS0gREVBRDpcblwKKyAgICAgICAgICB4MC94MSAoJWQvJWQpIHwgeTAveTEgKCVkLyVkKSB8 IHdkMC93ZDEgKCVkLyVkKSB8IGgwL2gxICglZC8lZClcbiIsCisgICAgICAgICAgbWNfd2luZG93 ICh3KSwgeDAsIHgxLCB5MCwgeTEsIHdkMCwgd2QxLCBoMCwgaDEpOworICAgICAgICB9CisgICAg ICBpZiAoW3ZpZXcgbWNfanVkZ2VdKQogICAgICAgICByZW1vdmVkID0gWUVTOwogICAgIH0KKyAg ICBlbHNlIGlmIChbdmlldyBqdWRnZV0pCisgICAgICByZW1vdmVkID0gWUVTOworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKworCisgICAgfQogCiAgIGlmIChyZW1vdmVkKQogICAgIFtldmll dyB1cGRhdGVGcmFtZVNpemU6IE5PXTsKQEAgLTUxMDYsNiArNjI4OCwyMSBAQCBzdGF0aWMgTGlz cF9PYmplY3QgbnNfc3RyaW5nX3RvX2xpc3Btb2QgKGNvbnN0IGNoYXIgKnMpCiBleHRlcm4gZnJh bWVfcGFybV9oYW5kbGVyIG5zX2ZyYW1lX3Bhcm1faGFuZGxlcnNbXTsKIHN0YXRpYyBzdHJ1Y3Qg cmVkaXNwbGF5X2ludGVyZmFjZSBuc19yZWRpc3BsYXlfaW50ZXJmYWNlID0KIHsKKworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyogYHJlZGlz cGxheV9pbnRlcmZhY2UnIGluIGBuc3Rlcm0ubWAgbXVzdCBiZSBpbiB0aGUgZXhhY3Qgc2FtZSBv cmRlciBhcyB0aGUKK2ByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgZGlzcGV4dGVybi5oYCEgKi8K KworICBtY194X3dyaXRlX2dseXBocywKKyAgbWNfbnNfZHJhd193aW5kb3dfY3Vyc29yLAorICBt Y19uc19kcmF3X2dseXBoX3N0cmluZywKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog ICBuc19mcmFtZV9wYXJtX2hhbmRsZXJzLAogICB4X3Byb2R1Y2VfZ2x5cGhzLAogICB4X3dyaXRl X2dseXBocywKQEAgLTg3MjEsNiArOTkxOCw0OSBAQCAtIChCT09MKWNhbkJlY29tZU1haW5XaW5k b3cKIAogQGltcGxlbWVudGF0aW9uIEVtYWNzU2Nyb2xsZXIKIAorCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLSAodm9pZCltY19zZXRfcmVjdGFu Z2xlOiAoTlNSZWN0KXJlY3QKK3sKKyAgbWNfcmVjdGFuZ2xlID0gcmVjdDsKK30KKworLSAoTlNS ZWN0KW1jX2dldF9yZWN0YW5nbGUKK3sKKyAgcmV0dXJuIG1jX3JlY3RhbmdsZTsKK30KKworLSAo c3RydWN0IHdpbmRvdyAqKW1jX2dldF93aW5kb3cKK3sKKyAgcmV0dXJuIHdpbmRvdzsKK30KKwor LSAoYm9vbCltY19qdWRnZQoreworICBOU1RSQUNFICgiW0VtYWNzU2Nyb2xsZXIgbWNfanVkZ2Vd Iik7CisgIGJvb2wgcmV0ID0gY29uZGVtbmVkOworICBibG9ja19pbnB1dCAoKTsKKyAgaWYgKGNv bmRlbW5lZCkKKyAgICB7CisgICAgICAvKiBlbnN1cmUgb3RoZXIgc2Nyb2xsYmFyIHVwZGF0ZXMg YWZ0ZXIgZGVsZXRpb24gKi8KKyAgICAgIEVtYWNzVmlldyAqdmlldyA9IChFbWFjc1ZpZXcgKilG UkFNRV9OU19WSUVXIChmcmFtZSk7CisgICAgICBpZiAodmlldyAhPSBuaWwpCisgICAgICAgIHZp ZXctPnNjcm9sbGJhcnNOZWVkaW5nVXBkYXRlKys7CisgICAgfQorICBpZiAod2luZG93KQorICAg IHdzZXRfdmVydGljYWxfc2Nyb2xsX2JhciAod2luZG93LCBRbmlsKTsKKyAgd2luZG93ID0gMDsK KyAgW3NlbGYgcmVtb3ZlRnJvbVN1cGVydmlld1dpdGhvdXROZWVkaW5nRGlzcGxheV07CisgIFtz ZWxmIHJlbGVhc2VdOworICB1bmJsb2NrX2lucHV0ICgpOworICByZXR1cm4gcmV0OworfQorCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBmb3IgcmVwZWF0IGJ1dHRvbiBwdXNoICov CiAjZGVmaW5lIFNDUk9MTF9CQVJfRklSU1RfREVMQVkgMC41CiAjZGVmaW5lIFNDUk9MTF9CQVJf Q09OVElOVU9VU19ERU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h0OworICAgIFJFQ1QgcjsKKyAgICAg ICAgICBIREMgaGRjID0gcy0+aGRjOworICAgIGlmICghcy0+cm93LT5yZXZlcnNlZF9wKQorICAg ICAgeCArPSB3aWR0aDsKKyAgICBlbHNlCisgICAgICB4ID0gcy0+eDsKKyAgICBpZiAocy0+cm93 LT5tb3VzZV9mYWNlX3AKKyAgICAgICAgJiYgY3Vyc29yX2luX21vdXNlX2ZhY2VfcCAocy0+dykp CisgICAgICB7CisgICAgICAgIHhfc2V0X21vdXNlX2ZhY2VfZ2MgKHMpOworICAgICAgICBnYyA9 IHMtPmdjOworICAgICAgfQorICAgIGVsc2UKKyAgICAgIGdjID0gcy0+ZmFjZS0+Z2M7CisgICAg Z2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsICZyKTsKKyAgICB3MzJfc2V0X2NsaXBfcmVj dGFuZ2xlIChoZGMsICZyKTsKKyNpZiAwIC8qIFRPRE86IHN0aXBwbGUgKi8KKyAgICBpZiAocy0+ ZmFjZS0+c3RpcHBsZSkKKyAgICAgIHsKKyAgICAgICAgLyogRmlsbCBiYWNrZ3JvdW5kIHdpdGgg YSBzdGlwcGxlIHBhdHRlcm4uICAqLworICAgICAgICBYU2V0RmlsbFN0eWxlIChzLT5kaXNwbGF5 LCBnYywgRmlsbE9wYXF1ZVN0aXBwbGVkKTsKKyAgICAgICAgWEZpbGxSZWN0YW5nbGUgKHMtPmRp c3BsYXksIHMtPndpbmRvdywgZ2MsIHgsIHksIHcsIGgpOworICAgICAgICBYU2V0RmlsbFN0eWxl IChzLT5kaXNwbGF5LCBnYywgRmlsbFNvbGlkKTsKKyAgICAgIH0KKyAgICBlbHNlCisjZW5kaWYK KyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRj LCBnYy0+YmFja2dyb3VuZCwgeCwgeSwgdywgaCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0K KyAgICB9CisgIGVsc2Ug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ICAg ICAgPSAoV0lORE9XX1RPX0ZSQU1FX1BJWEVMX1kgKHcsIHkpCisgICAgICAgICAgICAgICArIHJv dy0+YXNjZW50IC0gdy0+cGh5c19jdXJzb3JfYXNjZW50KTsKKyAgICAgICAgICB3MzJfc3lzdGVt X2NhcmV0X3dpbmRvdyA9IHc7CisgICAgICAgICAgdzMyX3N5c3RlbV9jYXJldF9oZHJfaGVpZ2h0 ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgICAgICAgICAgdzMyX3N5c3RlbV9j YXJldF9tb2RlX2hlaWdodCA9IFdJTkRPV19NT0RFX0xJTkVfSEVJR0hUICh3KTsKKyAgICAgICAg ICBQb3N0TWVzc2FnZSAoaHduZCwgV01fSU1FX1NUQVJUQ09NUE9TSVRJT04sIDAsIDApOworICAg ICAgICAgIC8qIElmIHRoZSBzaXplIG9mIHRoZSBhY3RpdmUgY3Vyc29yIGNoYW5nZWQsIGRlc3Ry b3kgdGhlIG9sZAorICAgICAgICAgICAgIHN5c3RlbSBjYXJldC4gICovCisgICAgICAgICAgaWYg KHczMl9zeXN0ZW1fY2FyZXRfaHduZAorICAgICAgICAgICAgICAmJiAodzMyX3N5c3RlbV9jYXJl dF9oZWlnaHQgIT0gaCkpCisgICAgICAgICAgICBQb3N0TWVzc2FnZSAoaHduZCwgV01fRU1BQ1Nf REVTVFJPWV9DQVJFVCwgMCwgMCk7CisgICAgICAgICAgdzMyX3N5c3RlbV9jYXJldF9oZWlnaHQg PSBoOworICAgICAgICAgIC8qIE1vdmUgdGhlIHN5c3RlbSBjYXJldC4gICovCisgICAgICAgICAg UG9zdE1lc3NhZ2UgKGh3bmQsIFdNX0VNQUNTX1RSQUNLX0NBUkVULCAwLCAwKTsKKyAgICAgICAg fQorICAgICAgLyogVGhlIGZyaW5nZSBiaXRtYXBzIGFyZSBwcmVzZW50bHkgaGFuZGxlZCBlbHNl d2hlcmUsIGJ1dCBjb3VsZCBzb21lZGF5CisgICAgICBiZSBt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ya19hY3RpdmUpKSk7CisgICAgICBwdHJkaWZm X3QgcmVnaW9uX2JlZ2lubmluZyA9IChyZWdpb25fYWN0aXZlX3ApID8gWEZJWE5VTSAoRnJlZ2lv bl9iZWdpbm5pbmcgKCkpIDogLTE7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2VuZCA9IChyZWdp b25fYWN0aXZlX3ApID8gWEZJWE5VTSAoRnJlZ2lvbl9lbmQgKCkpIDogLTE7CisgICAgICBwdHJk aWZmX3Qgb3BvaW50X3B0ID0gKHcgPT0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93KSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IFBUCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiBYRklYTlVNIChGbWFya2VyX3Bvc2l0aW9uICh3LT5wb2ludG0pKTsKKyAgICAgIGJvb2wgcmVn aW9uX2luX2JvdW5kc19wID0gKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgb3BvaW50X3B0ID49IHJlZ2lvbl9iZWdpbm5pbmcKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF9wdCA8IHJlZ2lvbl9lbmQpOworICAgICAg aWYgKGN1cnNvcl9nbHlwaC0+dHlwZSAhPSBJTUFHRV9HTFlQSCAmJiBsc2wucmVkID49IDAgJiYg bHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8q IFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MnIGJ5IGJv cnJvd2luZyB0aGUKKyAgICAgICAgICBmdW5jdGlvbmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHcz MmZucy5jLiAgKi8KKyAgICAgICAgICBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAg ICYmIHJlZ2lvbl9pbl9ib3VuZHNfcAorICAgICAgICAgICAgICAmJiBhY3RpdmVfcCkKKyAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9u X2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2Ut Y3Vyc29yLXJlZ2lvbi1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAq aG9sbG93X2FjdGl2ZV9yZWdpb25fZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2FjdGl2 ZV9yZWdpb25fZmFjZV9pZCk7CisgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0 aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZh a2UtY3Vyc29yLWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xs b3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7 CisgICAgICAgICAgICAgIGdjX3ZhbHVlcy5mb3JlZ3JvdW5kID0gaG9sbG93X2FjdGl2ZV9mYWNl LT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IGhvbGxv d19hY3RpdmVfcmVnaW9uX2ZhY2UtPmJhY2tncm91bmQ7CisgICAgICAgICAgICB9CisgICAgICAg ICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICYmICFy ZWdpb25faW5fYm91bmRzX3AKKyAgICAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9wKQorICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19h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AqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9N X0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgZ2NfdmFs dWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAg ICAgICAgICAgICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IGhvbGxvd19hY3RpdmVfZmFjZS0+YmFj a2dyb3VuZDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLyogVGhlIHJlZ2lv biBpcyBfbm90XyB2aXNpYmxlIGluIHRoZSBpbmFjdGl2ZSB3aW5kb3cgYmVjYXVzZSB0aGUgb3Zl cmxheSB3aW5kb3cgcHJvcGVydHkgaXMgdXNlZC4gKi8KKyAgICAgICAgICAgICAgICBlbHNlIGlm ICghYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGVu dW0gZmFjZV9pZCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3 LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItaW5hY3RpdmUtZmFjZSIpLCB0cnVlKTsK KyAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19pbmFjdGl2ZV9mYWNlID0g RkFDRV9GUk9NX0lEIChmLCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAg ICAgICAgIGdjX3ZhbHVlcy5mb3JlZ3JvdW5kID0gaG9sbG93X2luYWN0aXZlX2ZhY2UtPmZvcmVn cm91bmQ7CisgICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5iYWNrZ3JvdW5kID0gaG9sbG93 X2luYWN0aXZlX2ZhY2UtPmJhY2tncm91bmQ7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgZi0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9nbHlwaC0+dHlwZSA9PSBJTUFHRV9H TFlQSCAmJiBsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkK KyAgICAgICAgICB7CisgICAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1 dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0 YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAgICAgbWNfdzMyX2Ry YXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBv cywgd2QsIGgpOworICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwg PSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRw dXRfZGF0YS53MzItPmN1cnNvcl9nYycgYnkgYm9ycm93aW5nIHRoZQorICAgICAgICAgICAgICBm dW5jdGlvbmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHczMmZucy5jLiAgKi8KKyAgICAgICAgICAg ICAgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgJiYgcmVnaW9uX2luX2Jv dW5kc19wCisgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcCkKKyAgICAgICAgICAgICAgICB7 CisgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9yZWdpb25fZmFj ZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJz b3ItcmVnaW9uLWZhY2UiKSwgdHJ1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b2xsb3dfYWN0aXZlX3JlZ2lvbl9vdXRfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2Fj dGl2ZV9yZWdpb25fb3V0X2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2Vf aWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVy biAoIistcmVhbC1mYWtlLWN1cnNvci1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAg ICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xs b3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICBnY192YWx1ZXMuZm9yZWdy b3VuZCA9IGhvbGxvd19hY3RpdmVfZmFjZS0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgICAg ICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX3JlZ2lvbl9vdXRfZmFjZS0+ Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2Ug aWYgKCFyZWdpb25fYWN0aXZlX3AgJiYgYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lk ID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1m YWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3df YWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7Cisg ICAgICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVnc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fVzMyX1dJTkRPVyAoZiksIG1hc2ssICZnY192YWx1ZXMpOworICAgICAg ICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgLyogRm9yY2UgYG1jX3czMl9z ZXRfY3Vyc29yX2djJyB0byB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djJy4g ICovCisgICAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX3AgPSB0cnVlOworICAgICAgICAgICAg ICBtY19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4LCBo cG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNsLCBnbHlw aF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsIGN1cnNvcl9nY19wKTsKKyAgICAg ICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MgPSBvcmlnaW5hbF9jdXJzb3Jf Z2M7CisgICAgICAgICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgICAgIG1jX3cz Ml9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3Ms IHZwb3MsIHdkLCBoKTsKKyAgICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBj YXNlIE1DX0hPTExPV19CT1g6CisgICAgeworICAgICAgaWYgKGxzbC5yZWQgPj0gMCAmJiBsc2wu Z3JlZW4gPj0gMCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVt cG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcuICAqLwor ICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gY29sb3JfcGl4ZWw7 CisgICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgs IGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgIGYtPm91dHB1dF9kYXRh LnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9Cisg ICAgICAgIGVsc2UKKyAgICAgICAgICBtY193MzJfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBtYXRy aXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICBicmVhazsK KyAgICB9CisgICAgY2FzZSBNQ19GSUxMRURfQk9YOgorICAgIHsKKyAgICAgIGlmIChsc2wucmVk ID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAgeworICAg ICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3Jf Z2MnIGJ5IGJvcnJvd2luZyB0aGUKKyAgICAgICAgICBmdW5jdGlvbmFsaXR5IG9mIGB4X21ha2Vf Z2MnIGluIHczMmZucy5jLiAgKi8KKyAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAg ICBYR0NWYWx1ZXMgZ2NfdmFsdWVzOworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgbWFzayA9IEdD Rm9udCB8IEdDRm9yZWdyb3VuZCB8IEdDQmFja2dyb3VuZDsKKyAgICAgICAgICBnY192YWx1ZXMu Zm9udCA9IEZSQU1FX0ZPTlQgKGYpOworICAgICAgICAgIGdjX3ZhbHVlcy5mb3JlZ3JvdW5kID0g RlJBTUVfQkFDS0dST1VORF9QSVhFTCAoZik7CisgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91 bmQgPSBjb2xvcl9waXhlbDsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9n YyA9IFhDcmVhdGVHQyAoTlVMTCwgRlJBTUVfVzMyX1dJTkRPVyAoZiksIG1hc2ssICZnY192YWx1 ZXMpOworICAgICAgICAgIC8qIEZvcmNlIGBtY193MzJfc2V0X2N1cnNvcl9nYycgdG8gdXNlIGBz LT5mLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycuICAqLworICAgICAgICAgIGJvb2wgY3Vy c29yX2djX3AgPSB0cnVlOworICAgICAgICAgIG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRy aXgsIHJvdywgRFJBV19DVVJTT1IsIHgsIGhwb3MsIHZwb3MsIGxzbCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9w LCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2Mg PSBvcmlnaW5hbF9jdXJzb3JfZ2M7CisgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAg ICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3Jf Z2NfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJp eCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBsc2wsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVf cCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfZ2NfcCk7CisgICAg ICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfQkFSOgorICAgIHsKKyAg ICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkK KyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2Rh dGEudzMyLT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzIt PmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2lu dmlzaWJsZV9va2F5X3AgPSB0cnVlOworICAgICAgICAgIG1jX3czMl9kcmF3X2Jhcl9jdXJzb3Ig KHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLCBjdXJzb3Jf d2lkdGgsIE1DX0JBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIGYt Pm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOwor ICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBib29sIGN1 cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7CisgICAgICAgICAgICBtY193MzJfZHJh d19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3 ZCwgaCwgY3Vyc29yX3dpZHRoLCBNQ19CQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsK KyAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBNQ19IQkFSOgorICAg IHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUg Pj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0 cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0 YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAgIGJvb2wgY3Vyc29y X2djX2ludmlzaWJsZV9va2F5X3AgPSB0cnVlOworICAgICAgICAgIG1jX3czMl9kcmF3X2Jhcl9j dXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLCBj dXJzb3Jfd2lkdGgsIE1DX0hCQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAg ICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9w aXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAg Ym9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNf dzMyX2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywg dnBvcywgd2QsIGgsIGN1cnNvcl93aWR0aCwgTUNfSEJBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9v a2F5X3ApOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBkZWZhdWx0Ogor ICAgICAgZW1hY3NfYWJvcnQgKCk7CisgIH0KKyAgICB9Cit9CisKKy8qIERyYXcgZ2x5cGggc3Ry aW5nIFMuICAqLworc3RhdGljIHZvaWQKK21jX3czMl9kcmF3X2dseXBoX3N0cmluZyAoc3RydWN0 IGdseXBoX3N0cmluZyAqcywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5 cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNs LCBlbn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yAgICAgICAgICAgIGlmIChu ZXh0LT5maXJzdF9nbHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKQorICAgICAgICAgICAgICBt Y193MzJfZHJhd19zdHJldGNoX2dseXBoX3N0cmluZyAobmV4dCk7CisgICAgICAgICAgICBlbHNl CisgICAgICAgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAobmV4dCwgdHJ1 ZSk7CisgICAgICAgICAgICBuZXh0LT5udW1fY2xpcHMgPSAwOworICAgICAgICAgIH0KKyAgICB9 CisgIC8qIFNldCB1cCBTLT5nYywgc2V0IGNsaXBwaW5nIGFuZCBkcmF3IFMuICAqLworICBtY193 MzJfc2V0X2dseXBoX3N0cmluZ19nYyAocywgY3Vyc29yX2djX3ApOworICAvKiBEcmF3IHJlbGll ZiAoaWYgYW55KSBpbiBhZHZhbmNlIGZvciBjaGFyL2NvbXBvc2l0aW9uIHNvIHRoYXQgdGhlCisg ICAgIGdseXBoIHN0cmluZyBjYW4gYmUgZHJhd24gb3ZlciBpdC4gICovCisgIGlmICghcy0+Zm9y X292ZXJsYXBzCisgICAgICAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gKKyAgICAgICYm IChzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAgICAgfHwgcy0+Zmly c3RfZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKSkKKyAgICB7CisgICAgICB4X3NldF9n bHlwaF9zdHJpbmdfY2xpcHBpbmcgKHMpOworICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19iYWNr Z3JvdW5kIChzLCB0cnVlKTsKKyAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYm94IChzKTsKKyAg ICAgIHhfc2V0X2dseXBoX3N0cmluZ19jbGlwcGluZyAocyk7CisgICAgICByZWxpZWZfZHJhd25f cCA9IDE7CisgICAgfQorICBlbHNlIGlmICghcy0+Y2x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Hhf ZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgZmFsc2UpOworICAgICAgeF9kcmF3X2ds eXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgQ09NUE9T SVRFX0dMWVBIOgorICAgICAgaWYgKHMtPmZvcl9vdmVybGFwcyB8fCAocy0+Y21wX2Zyb20gPiAw CisgICAgICAgICAgJiYgISBzLT5maXJzdF9nbHlwaC0+dS5jbXAuYXV0b21hdGljKSkKKyAgICAg ICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICBlbHNlCisgICAgICAgIHhf ZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgdHJ1ZSk7CisgICAgICB4X2RyYXdfY29t cG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAgICAgIGJyZWFrOworICAgIGNh c2UgR0xZUEhMRVNTX0dMWVBIOgorICAgICAgaWYgKHMtPmZvcl9vdmVybGFwcykKKyAgICAgICAg cy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICBlbHNlCisgICAgICAgIHhfZHJh d19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgZmFsc2UpOworICAgICAgeF9kcmF3X2dseXBo bGVzc19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAgICBicmVhazsKKyAgICBkZWZh dWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7CisgICAgfQorICBpZiAoIXMtPmZvcl9vdmVybGFw cykKKyAgICB7CisgICAgICAvKiBEcmF3IHVuZGVybGluZS4gICovCisgICAgICBpZiAocy0+ZmFj ZS0+dW5kZXJsaW5lX3ApCisgICAgICAgIHsKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJs aW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9XQVZFKQorICAgICAgICAgICAgeworICAgICAgICAgICAg ICBDT0xPUlJFRiBjb2xvcjsKKyAgICAgICAgICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9k ZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICBjb2xvciA9IHMtPmdjLT5mb3JlZ3JvdW5kOwor ICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgY29sb3IgPSBzLT5mYWNlLT51bmRl cmxpbmVfY29sb3I7CisgICAgICAgICAgICAgIHczMl9kcmF3X3VuZGVyd2F2ZSAocywgY29sb3Ip OworICAgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90 eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgdW5z aWduZWQgbG9uZyB0aGlja25lc3MsIHBvc2l0aW9uOworICAgICAgICAgICAgICBpbnQgeTsKKyAg ICAgICAgICAgICAgaWYgKHMtPnByZXYgJiYgcy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3AKKyAg ICAgICAgICAgICAgICAgICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0Vf VU5ERVJfTElORSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBXZSB1 c2UgdGhlIHNhbWUgdW5kZXJsaW5lIHN0eWxlIGFzIHRoZSBwcmV2aW91cyBvbmUuICAqLworICAg ICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+cHJldi0+dW5kZXJsaW5lX3RoaWNrbmVzczsK KyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gcy0+cHJldi0+dW5kZXJsaW5lX3Bvc2l0aW9u OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJsaW5lIHRoaWNrbmVzcy4gIERl ZmF1bHQgaXMgMSBwaXhlbC4gICovCisgICAgICAgICAgICAgICAgICBpZiAocy0+Zm9udCAmJiBz LT5mb250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4gMCkKKyAgICAgICAgICAgICAgICAgICAgdGhp Y2tuZXNzID0gcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAgICAgICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gMTsKKyAgICAgICAgICAgICAg ICAgIGlmICh4X3VuZGVybGluZV9hdF9kZXNjZW50X2xpbmUpCisgICAgICAgICAgICAgICAgICAg IHBvc2l0aW9uID0gKHMtPmhlaWdodCAtIHRoaWNrbmVzcykgLSAocy0+eWJhc2UgLSBzLT55KTsK KyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJsaW5lIHBvc2l0aW9uLiAgVGhpcyBpcyB0aGUg cmVjb21tZW5kZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICB2ZXJ0aWNhbCBvZmZzZXQgaW4g cGl4ZWxzIGZyb20gdGhlIGJhc2VsaW5lIHRvIHRoZSB0b3Agb2YKKyAgICAgICAgICAgICAgICAg ICAgICAgICB0aGUgdW5kZXJsaW5lLiAgVGhpcyBpcyBhIHNpZ25lZCB2YWx1ZSBhY2NvcmRpbmcg dG8gdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgc3BlY3MsIGFuZCBpdHMgZGVmYXVsdCBp cworICAgICAgICAgICAgICAgICAgICAgICAgIFJPVU5EICgobWF4aW11bV9kZXNjZW50KSAvIDIp LCB3aXRoCisgICAgICAgICAgICAgICAgICAgICAgICAgUk9VTkQgKHgpID0gZmxvb3IgKHggKyAw LjUpICAqLworICAgICAgICAgICAgICAgICAgICAgIGlmICh4X3VzZV91bmRlcmxpbmVfcG9zaXRp b25fcHJvcGVydGllcworICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBzLT5mb250ICYmIHMt PmZvbnQtPnVuZGVybGluZV9wb3NpdGlvbiA+PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAg cG9zaXRpb24gPSBzLT5mb250LT51bmRlcmxpbmVfcG9zaXRpb247CisgICAgICAgICAgICAgICAg ICAgICAgZWxzZSBpZiAocy0+Zm9udCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9u ID0gKHMtPmZvbnQtPmRlc2NlbnQgKyAxKSAvIDI7CisgICAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gbWF4IChwb3NpdGlvbiwgdW5kZXJsaW5lX21pbmlt dW1fb2Zmc2V0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIC8qIENoZWNrIHRo ZSBzYW5pdHkgb2YgdGhpY2tuZXNzIGFuZCBwb3NpdGlvbi4gIFdlIHNob3VsZAorICAgICAgICAg ICAgICAgICBhdm9pZCBkcmF3aW5nIHVuZGVybGluZSBvdXQgb2YgdGhlIGN1cnJlbnQgbGluZSBh cmVhLiAgKi8KKyAgICAgICAgICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQgPD0gcy0+eWJhc2Ug KyBwb3NpdGlvbikKKyAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5oZWlnaHQgLSAxKSAt IChzLT55YmFzZSAtIHMtPnkpOworICAgICAgICAgICAgICBpZiAocy0+eSArIHMtPmhlaWdodCA8 IHMtPnliYXNlICsgcG9zaXRpb24gKyB0aGlja25lc3MpCisgICAgICAgICAgICAgICAgdGhpY2tu ZXNzID0gKHMtPnkgKyBzLT5oZWlnaHQpIC0gKHMtPnliYXNlICsgcG9zaXRpb24pOworICAgICAg ICAgICAgICBzLT51bmRlcmxpbmVfdGhpY2tuZXNzID0gdGhpY2tuZXNzOworICAgICAgICAgICAg ICBzLT51bmRlcmxpbmVfcG9zaXRpb24gPXBvc2l0aW9uOworICAgICAgICAgICAgICB5ID0gcy0+ eWJhc2UgKyBwb3NpdGlvbjsKKyAgICAgICAgICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9k ZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMs IHMtPmdjLT5mb3JlZ3JvdW5kLCBzLT54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHksIHMtPndpZHRoLCAxKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHcz Ml9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+ZmFjZS0+dW5kZXJsaW5lX2NvbG9yLCBzLT54 LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHksIHMtPndpZHRoLCAxKTsKKyAgICAg ICAgICAgIH0KKyAgICAgICAgfQorICAgICAgLyogRHJhdyBvdmVybGluZS4gICovCisgICAgICBp ZiAocy0+ZmFjZS0+b3ZlcmxpbmVfcCkKKyAgICAgICAgeworICAgICAgICAgIHVuc2lnbmVkIGxv bmcgZHkgPSAwLCBoID0gMTsKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+b3ZlcmxpbmVfY29sb3Jf ZGVmYXVsdGVkX3ApCisgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMt PmdjLT5mb3JlZ3JvdW5kLCBzLT54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+eSAr IGR5LCBzLT53aWR0aCwgaCk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHczMl9m aWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+ZmFjZS0+b3ZlcmxpbmVfY29sb3IsIHMtPngsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPnkgKyBkeSwgcy0+d2lkdGgsIGgpOworICAg ICAgICB9CisgICAgICAvKiBEcmF3IHN0cmlrZS10aHJvdWdoLiAgKi8KKyAgICAgIGlmIChzLT5m YWNlLT5zdHJpa2VfdGhyb3VnaF9wCisgICAgICAgICAgJiYgIUZPTlRfVEVYVE1FVFJJQyAocy0+ Zm9udCkudG1TdHJ1Y2tPdXQpCisgICAgICAgIHsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIGgg PSAxOworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZHkgPSAocy0+aGVpZ2h0IC0gaCkgLyAyOwor ICAgICAgICAgIGlmIChzLT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9jb2xvcl9kZWZhdWx0ZWRfcCkK KyAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+Z2MtPmZvcmVncm91 bmQsIHMtPngsIHMtPnkgKyBkeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPndpZHRo LCBoKTsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBz LT5oZGMsIHMtPmZhY2UtPnN0cmlrZV90aHJvdWdoX2NvbG9yLCBzLT54LAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgcy0+eSArIGR5LCBzLT53aWR0aCwgaCk7CisgICAgICAgIH0KKyAgICAg IC8qIERyYXcgcmVsaWVmIGlmIG5vdCB5ZXQgZHJhd24uICAqLworICAgICAgaWYgKCFyZWxpZWZf ZHJhd25fcCAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gpCisgICAgICAgIHhfZHJhd19n bHlwaF9zdHJpbmdfYm94IChzKTsKKyAgICAgIGlmIChzLT5wcmV2KQorICAgICAgICB7CisgICAg ICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAqcHJldjsKKyAgICAgICAgICBmb3IgKHByZXYgPSBz LT5wcmV2OyBwcmV2OyBwcmV2ID0gcHJldi0+cHJldikKKyAgICAgICAgICAgIGlmIChwcmV2LT5o bCAhPSBzLT5obAorICAgICAgICAgICAgICAgICYmIHByZXYtPnggKyBwcmV2LT53aWR0aCArIHBy ZXYtPnJpZ2h0X292ZXJoYW5nID4gcy0+eCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgIC8qIEFzIHByZXYgd2FzIGRyYXduIHdoaWxlIGNsaXBwZWQgdG8gaXRzIG93biBhcmVhLCB3 ZQorICAgICAgICAgICAgICAgICAgIG11c3QgZHJhdyB0aGUgcmlnaHRfb3ZlcmhhbmcgcGFydCB1 c2luZyBzLT5obCBub3cuICAqLworICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFj ZSBzYXZlID0gcHJldi0+aGw7CisgICAgICAgICAgICAgICAgcHJldi0+aGwgPSBzLT5obDsKKyAg ICAgICAgICAgICAgICBtY193MzJfc2V0X2dseXBoX3N0cmluZ19nYyAocHJldiwgY3Vyc29yX2dj X3ApOworICAgICAgICAgICAgICAgIHhfc2V0X2dseXBoX3N0cmluZ19jbGlwcGluZ19leGFjdGx5 IChzLCBwcmV2KTsKKyAgICAgICAgICAgICAgICBpZiAocHJldi0+Zmlyc3RfZ2x5cGgtPnR5cGUg PT0gQ0hBUl9HTFlQSCkKKyAgICAgICAgICAgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfZm9y ZWdyb3VuZCAocHJldik7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAg eF9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocHJldik7CisgICAgICAg ICAgICAgICAgdzMyX3NldF9jbGlwX3JlY3RhbmdsZSAocHJldi0+aGRjLCBOVUxMKTsKKyAgICAg ICAgICAgICAgICBwcmV2LT5obCA9IHNhdmU7CisgICAgICAgICAgICAgICAgcHJldi0+bnVtX2Ns aXBzID0gMDsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBpZiAocy0+bmV4dCkK KyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBnbHlwaF9zdHJpbmcgKm5leHQ7CisgICAgICAg ICAgZm9yIChuZXh0ID0gcy0+bmV4dDsgbmV4dDsgbmV4dCA9IG5leHQtPm5leHQpCisgICAgICAg ICAgICBpZiAobmV4dC0+aGwgIT0gcy0+aGwKKyAgICAgICAgICAgICAgICAmJiBuZXh0LT54IC0g bmV4dC0+bGVmdF9vdmVyaGFuZyA8IHMtPnggKyBzLT53aWR0aCkKKyAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgIC8qIEFzIG5leHQgd2lsbCBiZSBkcmF3biB3aGlsZSBjbGlwcGVkIHRv IGl0cyBvd24gYXJlYSwKKyAgICAgICAgICAgICAgICAgICB3ZSBtdXN0IGRyYXcgdGhlIGxlZnRf b3ZlcmhhbmcgcGFydCB1c2luZyBzLT5obCBub3cuICAqLworICAgICAgICAgICAgICAgIGVudW0g ZHJhd19nbHlwaHNfZmFjZSBzYXZlID0gbmV4dC0+aGw7CisgICAgICAgICAgICAgICAgbmV4dC0+ aGwgPSBzLT5obDsKKyAgICAgICAgICAgICAgICBtY193MzJfc2V0X2dseXBoX3N0cmluZ19nYyAo bmV4dCwgY3Vyc29yX2djX3ApOworICAgICAgICAgICAgICAgIHhfc2V0X2dseXBoX3N0cmluZ19j bGlwcGluZ19leGFjdGx5IChzLCBuZXh0KTsKKyAgICAgICAgICAgICAgICBpZiAobmV4dC0+Zmly c3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSCkKKyAgICAgICAgICAgICAgICAgIHhfZHJhd19n bHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAobmV4dCk7CisgICAgICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICAgICAgeF9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAo bmV4dCk7CisgICAgICAgICAgICAgICAgdzMyX3NldF9jbGlwX3JlY3RhbmdsZSAobmV4dC0+aGRj LCBOVUxMKTsKKyAgICAgICAgICAgICAgICBuZXh0LT5obCA9IHNhdmU7CisgICAgICAgICAgICAg ICAgbmV4dC0+bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICAgICAgICBuZXh0LT5jbGlwX2hlYWQg PSBzLT5uZXh0OworICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIC8qIFJlc2V0 IGNsaXBwaW5nLiAgKi8KKyAgdzMyX3NldF9jbGlwX3JlY3RhbmdsZSAocy0+aGRjLCBOVUxMKTsK KyAgcy0+bnVtX2NsaXBzID0gMDsKK30KKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKIC8qIEZyaW5nZSBiaXRtYXBzLiAgKi8KIAogc3Rh dGljIGludCBtYXhfZnJpbmdlX2JtcCA9IDA7CkBAIC01NDUsNiArMTM5OCwxNSBAQCB4X3VwZGF0 ZV9iZWdpbiAoc3RydWN0IGZyYW1lICpmKQogICBpZiAoISBGUkFNRV9XMzJfUCAoZikpCiAgICAg cmV0dXJuOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09S UyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gZjsKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogICAvKiBSZWdlbmVyYXRlIGRpc3BsYXkgcGFsZXR0ZSBiZWZvcmUgZHJhd2lu ZyBpZiBsaXN0IG9mIHJlcXVlc3RlZAogICAgICBjb2xvcnMgaGFzIGNoYW5nZWQuICovCiAgIGlm IChkaXNwbGF5X2luZm8tPnJlZ2VuX3BhbGV0dGUpCkBAIC03NTQsNiArMTYxNiwxNiBAQCB4X3Vw ZGF0ZV9lbmQgKHN0cnVjdCBmcmFtZSAqZikKIAogICAvKiBNb3VzZSBoaWdobGlnaHQgbWF5IGJl IGRpc3BsYXllZCBhZ2Fpbi4gICovCiAgIE1PVVNFX0hMX0lORk8gKGYpLT5tb3VzZV9mYWNlX2Rl ZmVyID0gZmFsc2U7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1D VVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBOVUxMOworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiB9CiAKIApAQCAtNDA0MSwxMyArNDkxMyw3NCBAQCB3MzJfc2V0 X3ZlcnRpY2FsX3Njcm9sbF9iYXIgKHN0cnVjdCB3aW5kb3cgKncsCiAJICAgICAgcmVsZWFzZV9m cmFtZV9kYyAoZiwgaGRjKTsKIAkgICAgICB4X2NsZWFyX3VuZGVyX2ludGVybmFsX2JvcmRlciAo Zik7CiAJICAgIH0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJ UExFLUNVUlNPUlMgKi8KKworLyogUkVQQUlOVElORyBXSEVOIFJFTU9WSU5HIFNDUk9MTCBCQVI6 CisKKy0gU2VxdWVuY2Ugb2YgRXZlbnRzOgorCisgIC4gYHJlZGlzcGxheV9pbnRlcm5hbCcgY2Fs bHMgdGhlIGBjb25kZW1uX3Njcm9sbF9iYXJzX2hvb2snLCB3aGljaCBtYXJrcyBhbGwKKyAgICBz Y3JvbGwgYmFycyBhcyBjYW5kaWRhdGVzIGZvciBkZWxldGlvbi4KKworICAuIFRoZW4gYHJlZGlz c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B3YW50IHRvIHJlcGFpbnQgc28gdGhhdCB0aGUgbmV3IHNjcm9sbCBi YXIKK3dpbmRvdyBpcyB1cGRhdGVkLiAqLworCiAgICAgICAgICAgLyogTWFrZSBzdXJlIHNjcm9s bCBiYXIgaXMgInZpc2libGUiIGJlZm9yZSBtb3ZpbmcsIHRvIGVuc3VyZSB0aGUKICAgICAgICAg ICAgICBhcmVhIG9mIHRoZSBwYXJlbnQgd2luZG93IG5vdyBleHBvc2VkIHdpbGwgYmUgcmVmcmVz aGVkLiAgKi8KLSAgICAgICAgICBteV9zaG93X3dpbmRvdyAoZiwgaHduZCwgU1dfSElERSk7Ci0v KiogICAgICAgICAgIE1vdmVXaW5kb3cgKGh3bmQsIGxlZnQsIHRvcCwgd2lkdGgsIG1heCAoaGVp Z2h0LCAxKSwgVFJVRSk7ICoqLwotCSAgLyogVHJ5IHRvIG5vdCBkcmF3IG92ZXIgY2hpbGQgZnJh bWVzLiAgKi8KLQkgIFNldFdpbmRvd1BvcyAoaHduZCwgSFdORF9CT1RUT00sIGxlZnQsIHRvcCwg d2lkdGgsIG1heCAoaGVpZ2h0LCAxKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIFNXUF9GUkFN RUNIQU5HRUQpOworICAgICAgICAgIGlmIChsZWZ0IDw9IGJhci0+bGVmdCkKKyAgICAgICAgICAg IG15X3Nob3dfd2luZG93IChmLCBod25kLCBTV19ISURFKTsKKyAgICAgICAgICBNb3ZlV2luZG93 IChod25kLCBsZWZ0LCB0b3AsIHdpZHRoLCBtYXggKGhlaWdodCwgMSksIGxlZnQgPD0gYmFyLT5s ZWZ0KTsKKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCiAKIAkgIHNpLmNiU2l6ZSA9IHNpemVvZiAoc2kpOwogCSAgc2kuZk1hc2sgPSBTSUZf UkFOR0U7CkBAIC00MzE2LDYgKzUyNDksMjEgQEAgdzMyX2p1ZGdlX3Njcm9sbF9iYXJzIChzdHJ1 Y3QgZnJhbWUgKmYpCiAgICAgewogICAgICAgc3RydWN0IHNjcm9sbF9iYXIgKmIgPSBYU0NST0xM X0JBUiAoYmFyKTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKworICAgICAgLyogYERlc3Ryb3lXaW5kb3cnIHdpdGhpbiBgeF9zY3JvbGxfYmFy X3JlbW92ZScgcmVwYWludHMgdGhlIHJlY3RhbmdsZS4KKyAgICAgIFRoZXJlZm9yZSwgd2UgZmly c3Qgc2VuZCBhIG1lc3NhZ2UgdG8gaW5oaWJpdCByZXBhaW50aW5nLiAqLworICAgICAgaWYgKCFX SU5ET1dfTElWRV9QIChiLT53aW5kb3cpKQorICAgICAgICB7CisgICAgICAgICAgSFdORCBod25k ID0gU0NST0xMX0JBUl9XMzJfV0lORE9XIChiKTsKKyAgICAgICAgICBTZW5kTWVzc2FnZSAoaHdu ZCwgV01fU0VUUkVEUkFXLCBmYWxzZSwgMCk7CisgICAgICAgIH0KKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogICAgICAgeF9zY3JvbGxfYmFyX3JlbW92ZSAoYik7CiAKICAgICAgIG5l eHQgPSBiLT5uZXh0OwpAQCAtNzA5MSw2ICs4MDM5LDIxIEBAIGV4dGVybiBmcmFtZV9wYXJtX2hh bmRsZXIgdzMyX2ZyYW1lX3Bhcm1faGFuZGxlcnNbXTsKIAogc3RhdGljIHN0cnVjdCByZWRpc3Bs YXlfaW50ZXJmYWNlIHczMl9yZWRpc3BsYXlfaW50ZXJmYWNlID0KIHsKKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyogYHJlZGlzcGxheV9p bnRlcmZhY2UnIGluIGB3MzJ0ZXJtLmNgIG11c3QgYmUgaW4gdGhlIGV4YWN0IHNhbWUgb3JkZXIg YXMgdGhlCitgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYGRpc3BleHRlcm4uaGAhICovCisKKyAg bWNfeF93cml0ZV9nbHlwaHMsCisgIG1jX3czMl9kcmF3X3dpbmRvd19jdXJzb3IsCisgIG1jX3cz Ml9kcmF3X2dseXBoX3N0cmluZywKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICB3 MzJfZnJhbWVfcGFybV9oYW5kbGVycywKICAgeF9wcm9kdWNlX2dseXBocywKICAgeF93cml0ZV9n bHlwaHMsCmRpZmYgLS1naXQgYS9zcmMvd2luZG93LmggYi9zcmMvd2luZG93LmgKaW5kZXggZmRl ZjQwNy4uZjI5NzViZSAxMDA2NDQKLS0tIGEvc3JjL3dpbmRvdy5oCisrKyBiL3NyYy93aW5kb3cu aApAQCAtODgsNiArODgsODQgQEAgZGlzcGxheSB0aGUgbWVudSBiYXIgb3IgdGhlIHRvb2wgYmFy ICh3aGVuIEVtYWNzIHVzZXMgdG9vbGtpdHMgdGhhdAogZG9uJ3QgZGlzcGxheSB0aGVpciBvd24g bWVudSBiYXIgYW5kIHRvb2wgYmFyKSBvciBhIHRvb2x0aXAgaW4gYQogdG9vbHRpcCBmcmFtZSAo d2hlbiB0b29sdGlwcyBhcmUgbm90IGRpc3BsYXkgYnkgdGhlIHRvb2xraXQpLiAgKi8KIAorCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExFLUNVUlNPUlMgKi8KKwor LyogU3VmZml4ZXMgZm9yIHRoZSBgbWNgIHdpbmRvdyBwb2ludGVyIHByZWZpeC4gKi8KK3N0cnVj dCBtdWx0aXBsZV9jdXJzb3JzCit7CisgIC8qIFRoZSByZWNvcmRlZCBwaXhlbCB3aWR0aCBvZiB0 aGUgbGFzdCBsaW5lIG51bWJlciBkcmF3biBkdXJpbmcgcmVkaXNwbGF5ICovCisgIGludCBsbnVt X3BpeGVsX3dpZHRoOworfTsKKworc3RydWN0IG11bHRpcGxlX2N1cnNvcnNfY2FjaGUKK3sKKyAg cHRyZGlmZl90IGFsbG9jYXRlZDsKKyAgcHRyZGlmZl90IHVzZWQ7CisgIGVudW0gdHlwZV9vZl9j YWNoZQorICAgIHsKKyAgICAgIE5PX0NBQ0hFLAorICAgICAgTUNfQ0FDSEUsCisgICAgICBDSF9D QUNIRSwKKyAgICAgIEZDX0NBQ0hFCisgICAgfSBjYWNoZV90eXBlOworICBzdHJ1Y3QgaXRlbXNf aW5fY2FjaGUKKyAgICB7CisgICAgICBpbnQgeDsKKyAgICAgIGludCBmeDsKKyAgICAgIGludCB5 OworICAgICAgaW50IGZ5OworICAgICAgaW50IGhwb3M7CisgICAgICBpbnQgdnBvczsKKyAgICAg IGludCB3ZDsKKyAgICAgIGludCBoOworICAgICAgZW51bSB0eXBlX29mX2N1cnNvcgorICAgICAg ICB7CisgICAgICAgICAgLyogTk9URTogIFRoZSBmcmluZ2UgYml0bWFwIGZyYW1ld29yayByZWxp ZXMgdXBvbiBNQ19OT19GUklOR0VfQklUTUFQCisgICAgICAgICAgSEFWSU5HIEEgVkFMVUUgT0Yg WkVSTyAoMCkuICovCisgICAgICAgICAgTUNfTk9fRlJJTkdFX0JJVE1BUCwKKyAgICAgICAgICBN Q19OT19DVVJTT1IsCisgICAgICAgICAgTUNfUklHSFRfRlJJTkdFX0JJVE1BUCwKKyAgICAgICAg ICBNQ19MRUZUX0ZSSU5HRV9CSVRNQVAsCisgICAgICAgICAgTUNfRlJBTUVEX0JPWCwKKyAgICAg ICAgICBNQ19GSUxMRURfQk9YLAorICAgICAgICAgIE1DX0hPTExPV19CT1gsCisgICAgICAgICAg TUNfQkFSLAorICAgICAgICAgIE1DX0hCQVIKKyAgICAgICAgfSBjdXJzb3JfdHlwZTsKKyAgICAg IGludCBjdXJzb3Jfd2lkdGg7CisgICAgICBzdHJ1Y3QgUkdCCisgICAgICAgIHsKKyAgICAgICAg ICBkb3VibGUgcmVkOworICAgICAgICAgIGRvdWJsZSBncmVlbjsKKyAgICAgICAgICBkb3VibGUg Ymx1ZTsKKyAgICAgICAgfSBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kOworICAgICAgYm9vbCBhY3Rp dmVfcDsKKyAgICAgIGVudW0gbWNfZmxhdm9yCisgICAgICAgIHsKKyAgICAgICAgICBOT19GTEFW T1IsCisgICAgICAgICAgTUNfR0xZUEgsCisgICAgICAgICAgTUNfR0xZUEhMRVNTLAorICAgICAg ICAgIE1DX09WRVJMQVlfQVJST1dfQklUTUFQLAorICAgICAgICAgIE1DX1BJTENST1csCisgICAg ICAgICAgTUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVywKKyAgICAgICAgICBNQ19SRVZF UlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XLAorICAgICAgICAgIE1DX0hPTExPV19S RUNUQU5HTEUsCisgICAgICAgICAgTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XLAorICAgICAg ICAgIE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVywKKyAgICAgICAgICBNQ19W RVJUSUNBTF9CQVIsCisgICAgICAgICAgTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSLAorICAgICAg ICAgIE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgfSBnbHlwaF9mbGF2b3I7Cisg ICAgICBib29sIGVuYWJsZWRfcDsKKyAgICB9ICpjYWNoZXM7Cit9OworCisvKiBlbmQgTVVMVElQ TEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogc3RydWN0IGN1cnNv cl9wb3MKIHsKICAgLyogUGl4ZWwgcG9zaXRpb24uICBUaGVzZSBhcmUgYWx3YXlzIHdpbmRvdyBy ZWxhdGl2ZS4gICovCkBAIC0zMjQsNiArNDAyLDIxIEBAIHN0cnVjdCB3aW5kb3cKIAogI2lmZGVm IEhBVkVfV0lORE9XX1NZU1RFTQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCisgICAgc3RydWN0IG11bHRpcGxlX2N1cnNvcnMgbWM7CisKKyAg ICBzdHJ1Y3QgbXVsdGlwbGVfY3Vyc29yc19jYWNoZSBtY19lbHRzOworCisgICAgc3RydWN0IG11 bHRpcGxlX2N1cnNvcnNfY2FjaGUgY2hfZWx0czsKKworICAgIHN0cnVjdCBtdWx0aXBsZV9jdXJz b3JzX2NhY2hlIGZjX2VsdHM7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAv KiBDdXJzb3IgdHlwZSBvZiBsYXN0IGN1cnNvciBkcmF3biBvbiB0aGUgd2luZG93LiAgKi8KICAg ICBlbnVtIHRleHRfY3Vyc29yX2tpbmRzIHBoeXNfY3Vyc29yX3R5cGU7CiAKQEAgLTExMjAsNiAr MTIxMywxNSBAQCBleHRlcm4gdm9pZCByZWRpc3BsYXlfb3RoZXJfd2luZG93cyAodm9pZCk7CiAK IHN0cnVjdCBnbHlwaCAqZ2V0X3BoeXNfY3Vyc29yX2dseXBoIChzdHJ1Y3Qgd2luZG93ICp3KTsK IAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwor c3RydWN0IGdseXBoICptY19nZXRfY3Vyc29yX2dseXBoIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1 Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgaW50IGhwb3Ms IGludCB2cG9zKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogLyogVHJ1ZSBpZiBX SU5ET1cgaXMgYSB2YWxpZCB3aW5kb3cuICAqLwogI2RlZmluZSBXSU5ET1dfVkFMSURfUChXSU5E T1cpCQkJCQlcCiAgIChXSU5ET1dQIChXSU5ET1cpICYmICFOSUxQIChYV0lORE9XIChXSU5ET1cp LT5jb250ZW50cykpCVwKZGlmZiAtLWdpdCBhL3NyYy94ZGlzcC5jIGIvc3JjL3hkaXNwLmMKaW5k ZXggYTg4ZmM2OS4uODkyNDgxZiAxMDA2NDQKLS0tIGEvc3JjL3hkaXNwLmMKKysrIGIvc3JjL3hk aXNwLmMKQEAgLTkyMSw2ICs5MjEsNDA5MCBAQCBzdGF0aWMgdm9pZCBzaG93X21vdXNlX2ZhY2Ug KE1vdXNlX0hMSW5mbyAqLCBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UpOwogc3RhdGljIGJvb2wgY29v cmRzX2luX21vdXNlX2ZhY2VfcCAoc3RydWN0IHdpbmRvdyAqLCBpbnQsIGludCk7CiAKIAorLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioq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dGVwIDQ6ICAuL2F1dG9nZW4uc2gKKwor U3RlcCA1OiAgLi9jb25maWd1cmUgLi4uIFt5b3VyIGN1c3RvbSBvcHRpb25zXQorCitTdGVwIDY6 ICBtYWtlCisKK1N0ZXAgNzogIG1ha2UgaW5zdGFsbAorCisKK1VTQUdFOgorCistIEZvciBhIG1p bmltYWwgd29ya2luZyBleGFtcGxlIG9mIGJ1aWx0LWluIGZha2UgY3Vyc29ycywgdHlwZTogIE0t eCBtYy10ZXN0CisKKyAgOzs7IFRVUk4gT04gRkFLRSBDVVJTT1JTIChidWZmZXIgcG9zaXRpb24s IGN1cnNvci10eXBlLCBjdXJzb3IgY29sb3IpOgorCisgIChzZXRxIG1jLWNvbmYgJygoMSAiaGJh ciIgIm1hZ2VudGEiKQorICAgICAgICAgICAgICAgICAgKDIgImJhciIgInB1cnBsZSIpCisgICAg ICAgICAgICAgICAgICAoMyAiYm94IiAiIzAwRkYwMCIpCisgICAgICAgICAgICAgICAgICAoNCAi aG9sbG93IiAiIzAwMDBGRiIpCisgICAgICAgICAgICAgICAgICAoNSAoImhiYXIiIDMpIFsxLjAg MC4wIDEuMF0pCisgICAgICAgICAgICAgICAgICAoNiAoImJhciIgMykgWzAuMCAxLjAgMS4wXSkK KyAgICAgICAgICAgICAgICAgICg3ICJmcmFtZWQiICJPcmFuZ2VSZWQiKSkpKQorCisgIDs7OyBU VVJOIE9GRiBGQUtFIENVUlNPUlM6CisKKyAgKHNldHEgbWMtY29uZiBuaWwpCisKKy0gVG8gdHJ5 IG91dCB0aGUgY3Jvc3NoYWlycyBmZWF0dXJlLCB0eXBlOiAgTS14ICstbW9kZQorCistIFRvIHRy eSBvdXQgYnVpbHQtaW4gZmFrZSBjdXJzb3JzIHdpdGggTWFnbmFyIFN2ZWVuJ3MgbXVsdGlwbGUt Y3Vyc29ycyBwYWNrYWdlLAorICBpbnN0YWxsIHRoYXQgcGFja2FnZSBmaXJzdC4gIFtJZiB0aGUg bXVsdGlwbGUtY3Vyc29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BwLT5jb250ZW50c1tpXSA9IFFuaWw7 CisgIHJldHVybiBtYWtlX2xpc3BfcHRyIChwLCBMaXNwX1ZlY3Rvcmxpa2UpOworfQorCitMaXNw X09iamVjdAorbWNfbGlzdG4gKHB0cmRpZmZfdCBjb3VudCwgTGlzcF9PYmplY3QgYXJnLCAuLi4p Cit7CisgIGVhc3N1bWUgKDAgPCBjb3VudCk7CisgIExpc3BfT2JqZWN0IHZhbCA9IEZjb25zIChh cmcsIFFuaWwpOworICBMaXNwX09iamVjdCB0YWlsID0gdmFsOworICB2YV9saXN0IGFwOworICB2 YV9zdGFydCAoYXAsIGFyZyk7CisgIGZvciAocHRyZGlmZl90IGkgPSAxOyBpIDwgY291bnQ7IGkr KykKKyAgICB7CisgICAgICBMaXNwX09iamVjdCBlbGVtID0gRmNvbnMgKHZhX2FyZyAoYXAsIExp c3BfT2JqZWN0KSwgUW5pbCk7CisgICAgICBYU0VUQ0RSICh0YWlsLCBlbGVtKTsKKyAgICAgIHRh aWwgPSBlbGVtOworICAgIH0KKyAgdmFfZW5kIChhcCk7CisgIHJldHVybiB2YWw7Cit9CisKK0xp c3BfT2JqZWN0CittY19tZW1xIChMaXNwX09iamVjdCBlbHQsIExpc3BfT2JqZWN0IGxpc3QpCit7 CisgIHdoaWxlICgxKQorICAgIHsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpIHx8IEVRIChYQ0FS IChsaXN0KSwgZWx0KSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7 CisgICAgICBpZiAoIUNPTlNQIChsaXN0KSB8fCBFUSAoWENBUiAobGlzdCksIGVsdCkpCisgICAg ICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAo bGlzdCkgfHwgRVEgKFhDQVIgKGxpc3QpLCBlbHQpKQorICAgICAgICBicmVhazsKKyAgICAgIGxp c3QgPSBYQ0RSIChsaXN0KTsKKyAgICB9CisgIHJldHVybiBsaXN0OworfQorCitMaXNwX09iamVj dAorbWNfbnRoIChpbnQgbnVtLCBMaXNwX09iamVjdCBsaXN0KQoreworICBmb3IgKGludCBpID0g MDsgaSA8IG51bSAmJiAhTklMUCAobGlzdCk7IGkrKykKKyAgICBsaXN0ID0gWENEUiAobGlzdCk7 CisgIGlmIChDT05TUCAobGlzdCkpCisgICAgcmV0dXJuIFhDQVIgKGxpc3QpOworICAgIGVsc2UK KyAgICAgIHJldHVybiBRbmlsOworfQorCitMaXNwX09iamVjdAorbWNfYXNzcSAoTGlzcF9PYmpl Y3Qga2V5LCBMaXNwX09iamVjdCBsaXN0KQoreworICB3aGlsZSAoMSkKKyAgICB7CisgICAgICBp ZiAoIUNPTlNQIChsaXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAg ICAgICAgICAgICYmIEVRIChYQ0FSIChYQ0FSIChsaXN0KSksIGtleSkpKQorICAgICAgICBicmVh azsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisg ICAgICAgICAgfHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgRVEgKFhD QVIgKFhDQVIgKGxpc3QpKSwga2V5KSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhD RFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1Ag KFhDQVIgKGxpc3QpKQorICAgICAgICAgICAgICAmJiBFUSAoWENBUiAoWENBUiAobGlzdCkpLCBr ZXkpKSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgfQor ICBpZiAoQ09OU1AgKGxpc3QpKQorICAgIHJldHVybiBYQ0FSIChsaXN0KTsKKyAgICBlbHNlCisg ICAgICByZXR1cm4gUW5pbDsKK30KKworTGlzcF9PYmplY3QKK21jX2Fzc29jIChMaXNwX09iamVj dCBrZXksIExpc3BfT2JqZWN0IGxpc3QpCit7CisgIExpc3BfT2JqZWN0IGNhcjsKKyAgd2hpbGUg KDEpCisgICAgeworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1Ag KFhDQVIgKGxpc3QpKQorICAgICAgICAgICAgICAmJiAoY2FyID0gWENBUiAoWENBUiAobGlzdCkp LAorICAgICAgICAgICAgICAgICAgRVEgKGNhciwga2V5KSB8fCAhTklMUCAoRmVxdWFsIChjYXIs IGtleSkpKSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAg ICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQor ICAgICAgICAgICAgICAmJiAoY2FyID0gWENBUiAoWENBUiAobGlzdCkpLAorICAgICAgICAgICAg ICAgICAgRVEgKGNhciwga2V5KSB8fCAhTklMUCAoRmVxdWFsIChjYXIsIGtleSkpKSkpCisgICAg ICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAo bGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAgICAgICAm JiAoY2FyID0gWENBUiAoWENBUiAobGlzdCkpLAorICAgICAgICAgICAgICAgICAgRVEgKGNhciwg a2V5KSB8fCAhTklMUCAoRmVxdWFsIChjYXIsIGtleSkpKSkpCisgICAgICAgIGJyZWFrOworICAg ICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgIH0KKyAgaWYgKENPTlNQIChsaXN0KSkKKyAgICBy ZXR1cm4gWENBUiAobGlzdCk7CisgICAgZWxzZQorICAgICAgcmV0dXJuIFFuaWw7Cit9CisKK0xp c3BfT2JqZWN0CittY19wbGlzdF9nZXQgKExpc3BfT2JqZWN0IHBsaXN0LCBMaXNwX09iamVjdCBw cm9wKQoreworICBMaXNwX09iamVjdCB0YWlsLCBoYWxmdGFpbDsKKyAgLyogaGFsZnRhaWwgaXMg dXNlZCB0byBkZXRlY3QgY2lyY3VsYXIgbGlzdHMuICAqLworICB0YWlsID0gaGFsZnRhaWwgPSBw bGlzdDsKKyAgd2hpbGUgKENPTlNQICh0YWlsKSAmJiBDT05TUCAoWENEUiAodGFpbCkpKQorICAg IHsKKyAgICAgIGlmIChFUSAocHJvcCwgWENBUiAodGFpbCkpKQorICAgICAgICByZXR1cm4gWENB UiAoWENEUiAodGFpbCkpOworICAgICAgdGFpbCA9IFhDRFIgKFhDRFIgKHRhaWwpKTsKKyAgICAg IGhhbGZ0YWlsID0gWENEUiAoaGFsZnRhaWwpOworICAgICAgaWYgKEVRICh0YWlsLCBoYWxmdGFp bCkpCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgcmV0dXJuIFFuaWw7Cit9CisKKy8qIENoZWNr IHRoZSBwcmVzZW5jZSBvZiBhIGRpc3BsYXkgcHJvcGVydHkgYW5kIGNvbXB1dGUgaXRzIHdpZHRo LgorICAgSWYgYSBwcm9wZXJ0eSB3YXMgZm91bmQgYW5kIGl0cyB3aWR0aCB3YXMgZm91bmQgYXMg d2VsbCwgcmV0dXJuCisgICBpdHMgd2lkdGggKD49IDApIGFuZCBzZXQgdGhlIHBvc2l0aW9uIG9m IHRoZSBlbmQgb2YgdGhlIHByb3BlcnR5CisgICBpbiBFTkRQT1MuCisgICBPdGhlcndpc2UganVz dCByZXR1cm4gLTEuICovCitzdGF0aWMgaW50CittY19jaGVja19kaXNwbGF5X3dpZHRoIChwdHJk aWZmX3QgcG9zLCBwdHJkaWZmX3QgY29sLCBwdHJkaWZmX3QgKmVuZHBvcykKK3sKKyAgTGlzcF9P YmplY3QgdmFsLCBvdmVybGF5OworICBpZiAoQ09OU1AgKHZhbCA9IGdldF9jaGFyX3Byb3BlcnR5 X2FuZF9vdmVybGF5CisgICAgICAgKG1ha2VfZml4bnVtIChwb3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AgICAgZWxzZSBpZiAoRkxPQVRQIChwcm9wKSAmJiBjb2wgPD0gWEZMT0FUX0RBVEEg KHByb3ApCisgICAgICAgICAmJiAoWEZMT0FUX0RBVEEgKHByb3ApIDw9IGFsaWduX3RvX21heCkp CisgIHdpZHRoID0gKGludCkoWEZMT0FUX0RBVEEgKHByb3ApICsgMC41KSAtIGNvbDsKKyAgICAg IGlmICh3aWR0aCA+PSAwKQorICB7CisgICAgcHRyZGlmZl90IHN0YXJ0OworICAgIGlmIChPVkVS TEFZUCAob3ZlcmxheSkpCisgICAgICAqZW5kcG9zID0gT1ZFUkxBWV9QT1NJVElPTiAoT1ZFUkxB WV9FTkQgKG92ZXJsYXkpKTsKKyAgICBlbHNlCisgICAgICBnZXRfcHJvcGVydHlfYW5kX3Jhbmdl IChwb3MsIFFkaXNwbGF5LCAmdmFsLCAmc3RhcnQsIGVuZHBvcywgUW5pbCk7CisgICAgLyogRm9y IDpyZWxhdGl2ZS13aWR0aCwgd2UgbmVlZCB0byBtdWx0aXBseSBieSB0aGUgY29sdW1uCisgICAg ICAgd2lkdGggb2YgdGhlIGNoYXJhY3RlciBhdCBQT1MsIGlmIGl0IGlzIGdyZWF0ZXIgdGhhbiAx LiAqLworICAgIGlmICghTklMUCAobWNfcGxpc3RfZ2V0IChwbGlzdCwgUUNyZWxhdGl2ZV93aWR0 aCkpCisgICAgICAgICYmICFOSUxQIChCVkFSIChjdXJyZW50X2J1ZmZlciwgZW5hYmxlX211bHRp Ynl0ZV9jaGFyYWN0ZXJzKSkpCisgICAgICB7CisgICAgICAgIGludCBiLCB3ZDsKKyAgICAgICAg dW5zaWduZWQgY2hhciAqcCA9IEJZVEVfUE9TX0FERFIgKENIQVJfVE9fQllURSAocG9zKSk7Cisg ICAgICAgIE1DX01VTFRJQllURV9CWVRFU19XSURUSCAocCwgYnVmZmVyX2Rpc3BsYXlfdGFibGUg KCksIGIsIHdkKTsKKyAgICAgICAgd2lkdGggKj0gd2Q7CisgICAgICB9CisgIC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DsKKyAgICAg IGlmIChlbmRwID4gc2NhbikgLyogQXZvaWQgaW5maW5pdGUgbG9vcHMgd2l0aCAwLXdpZHRoIG92 ZXJsYXlzLiAqLworICAgICAgICB7CisgICAgc2NhbiA9IGVuZHA7CisgICAgc2Nhbl9ieXRlID0g Q0hBUl9UT19CWVRFIChzY2FuKTsKKyAgICBjb250aW51ZTsKKyAgICAgICAgfQorICAgIH0KKyAg ICAgIH0KKyAgICAgIC8qIENoZWNrIGNvbXBvc2l0aW9uIHNlcXVlbmNlLiAqLworICAgICAgaWYg KGNtcF9pdC5pZCA+PSAwCisgICAgfHwgKHNjYW4gPT0gY21wX2l0LnN0b3BfcG9zCisgICAgICAg ICYmIGNvbXBvc2l0aW9uX3Jlc2VhdF9pdCAoJmNtcF9pdCwgc2Nhbiwgc2Nhbl9ieXRlLCBlbmQs CisgICAgICAgICAgdywgTlVMTCwgUW5pbCkpKQorICBjb21wb3NpdGlvbl91cGRhdGVfaXQgKCZj bXBfaXQsIHNjYW4sIHNjYW5fYnl0ZSwgUW5pbCk7CisgICAgICBpZiAoY21wX2l0LmlkID49IDAp CisgIHsKKyAgICBzY2FuICs9IGNtcF9pdC5uY2hhcnM7CisgICAgc2Nhbl9ieXRlICs9IGNtcF9p dC5uYnl0ZXM7CisgICAgaWYgKHNjYW4gPD0gZW5kKQorICAgICAgY29sICs9IGNtcF9pdC53aWR0 aDsKKyAgICBpZiAoY21wX2l0LnRvID09IGNtcF9pdC5uZ2x5cGhzKQorICAgICAgeworICAgICAg ICBjbXBfaXQuaWQgPSAtMTsKKyAgICAgICAgY29tcG9zaXRpb25fY29tcHV0ZV9zdG9wX3BvcyAo JmNtcF9pdCwgc2Nhbiwgc2Nhbl9ieXRlLCBlbmQsCisgICAgICAgICAgICAgIFFuaWwpOworICAg ICAgfQorICAgIGVsc2UKKyAgICAgIGNtcF9pdC5mcm9tID0gY21wX2l0LnRvOworICAgIGNvbnRp bnVlOworICB9CisgICAgICBjID0gRkVUQ0hfQllUR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l bGVjdGl2ZV9kaXNwbGF5KSwgUXQpKQorICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgaWYgKGMg PT0gJ1x0JykKKyAgICB7CisgICAgICBjb2wgKz0gdGFiX3dpZHRoOworICAgICAgY29sID0gY29s IC8gdGFiX3dpZHRoICogdGFiX3dpZHRoOworICAgIH0KKyAgICAgICAgZWxzZQorICAgICsrY29s OworICAgICAgfQorICB9CisgICAgICBlbHNlCisgIHsKKyAgICAvKiBUaGUgZGlzcGxheSB0YWJs ZSBkb2Vzbid0IGFmZmVjdCB0aGlzIGNoYXJhY3RlcjsKKyAgICAgICBpdCBkaXNwbGF5cyBhcyBp dHNlbGYuICovCisgICAgaWYgKGMgPT0gJ1xuJykKKyAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICBp ZiAoYyA9PSAnXHInICYmIEVRIChCVkFSIChjdXJyZW50X2J1ZmZlciwgc2VsZWN0aXZlX2Rpc3Bs YXkpLCBRdCkpCisgICAgICBnb3RvIGVuZGxvb3A7CisgICAgaWYgKGMgPT0gJ1x0JykKKyAgICAg IHsKKyAgICAgICAgY29sICs9IHRhYl93aWR0aDsKKyAgICAgICAgY29sID0gY29sIC8gdGFiX3dp ZHRoICogdGFiX3dpZHRoOworICAgICAgfQorICAgIGVsc2UgaWYgKG11bHRpYnl0ZSAmJiBMRUFE SU5HX0NPREVfUCAoYykpCisgICAgICB7CisgICAgICAgIC8qIFN0YXJ0IG9mIG11bHRpLWJ5dGUg Zm9ybS4gKi8KKyAgICAgICAgdW5zaWduZWQgY2hhciAqcHRyOworICAgICAgICBpbnQgYnl0ZXMs IHdpZHRoOworICAgICAgICBwdHIgPSBCWVRFX1BPU19BRERSIChzY2FuX2J5dGUpOworICAgICAg ICBNQ19NVUxUSUJZVEVfQllURVNfV0lEVEggKHB0ciwgZHAsIGJ5dGVzLCB3aWR0aCk7CisgICAg ICAgIC8qIFN1YnRyYWN0IG9uZSB0byBjb21wZW5zYXRlIGZvciB0aGUgaW5jc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YiAhPSBjdXJyZW50X2J1ZmZlcikKKyAgICB7CisgICAg ICBvbGRfYnVmZmVyID0gY3VycmVudF9idWZmZXI7CisgICAgICBzZXRfYnVmZmVyX2ludGVybmFs IChiKTsKKyAgICB9CisgIGJvb2wgYmFyZl9jcmFzaCA9IChCVUZfQkVHIChiKSA8PSBwdCAmJiBw dCA8PSBCVUZfWiAoYikpID8gZmFsc2UgOiB0cnVlOworICBpZiAoYmFyZl9jcmFzaCkKKyAgICB7 CisgICAgICBpZiAob2xkX2J1ZmZlcikKKyAgICAgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAob2xk X2J1ZmZlcik7CisgICAgICByZXR1cm4gMDsKKyAgICB9CisgIEVNQUNTX0lOVCBsYXN0X2tub3du X2NvbHVtbl9tb2RpZmllZCA9IDA7CisgIHB0cmRpZmZfdCBsYXN0X2tub3duX2NvbHVtbiA9IDA7 CisgIHB0cmRpZmZfdCBjb2w7CisgIHVuc2lnbmVkIGNoYXIgKnB0ciwgKnN0b3A7CisgIGJvb2wg dGFiX3NlZW47CisgIHB0cmRpZmZfdCBwb3N0X3RhYjsKKyAgaW50IGM7CisgIGludCB0YWJfd2lk dGggPSBTQU5FX1RBQl9XSURUSCAoY3VycmVudF9idWZmZXIpOworICBib29sIGN0bF9hcnJvdyA9 ICFOSUxQIChCVkFSIChjdXJyZW50X2J1ZmZlciwgY3RsX2Fycm93KSk7CisgIHN0cnVjdCBMaXNw X0NoYXJfVGFibGUgKmRwID0gYnVmZmVyX2Rpc3BsYXlfdGFibGUgKCk7CisgIGlmIChwdCA9PSBs YXN0X2tub3duX2NvbHVtbl9wb2ludAorICAgICAgJiYgTU9ESUZGID09IGxhc3Rfa25vd25fY29s dW1uX21vZGlmaWVkKQorICAgIHsKKyAgICAgIGlmIChvbGRfYnVmZmVyKQorICAgICAgICBzZXRf YnVmZmVyX2ludGVybmFsIChvbGRfYnVmZmVyKTsKKyAgICAgIHJldHVybiBsYXN0X2tub3duX2Nv bHVtbjsKK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ZSBpZiAocHQgPD0gR1BUIHx8IEJF R1YgPiBHUFQpCisgICAgc3RvcCA9IEJFR1ZfQUREUjsKKyAgZWxzZQorICAgIHN0b3AgPSBHQVBf RU5EX0FERFI7CisgIGNvbCA9IDAsIHRhYl9zZWVuID0gMCwgcG9zdF90YWIgPSAwOworICB3aGls ZSAoMSkKKyAgICB7CisgICAgICBwdHJkaWZmX3QgaSwgbjsKKyAgICAgIExpc3BfT2JqZWN0IGNo YXJ2ZWM7CisgICAgICBpZiAocHRyID09IHN0b3ApCisgIHsKKyAgICAvKiBXZSBzdG9wcGVkIGVp dGhlciBmb3IgdGhlIGJlZ2lubmluZyBvZiB0aGUgYnVmZmVyCisgICAgICAgb3IgZm9yIHRoZSBn YXAuICovCisgICAgaWYgKHB0ciA9PSBCRUdWX0FERFIpCisgICAgICBicmVhazsKKyAgICAvKiBJ dCB3YXMgdGhlIGdhcC4gIEp1bXAgYmFjayBvdmVyIGl0LiAqLworICAgIHN0b3AgPSBCRUdWX0FE RFI7CisgICAgcHRyID0gR1BUX0FERFI7CisgICAgLyogQ2hlY2sgd2hldGhlciB0aGF0IGJyaW5n cyB1cyB0byBiZWdpbm5pbmcgb2YgYnVmZmVyLiAqLworICAgIGlmIChCRUdWID49IEdQVCkKKyAg ICAgIGJyZWFrOworICB9CisgICAgICBjID0gKi0tcHRyOworICAgICAgaWYgKGRwICYmIFZFQ1RP UlAgKERJU1BfQ0hBUl9WRUNUT1IgKGRwLCBjKSkpCisgIHsKKyAgICBjaGFydmVjID0gRElTUF9D SEFSX1ZFQ1RPUiAoZHAsIGMpOworICAgIG4gPSBBU0laRSAoY2hhcnZlYyk7CisgIH0KKyAgICAg IGVsc2UKKyAgeworICAgIGNoYXJ2ZWMgPSBRbmlsOworICAgIG4gPSAxOworICB9CisgICAgICBm b3IgKGkgPSBuIC0gMTsgaSA+PSAwOyAtLWkpCisgIHsKKyAgICBpZiAoVkVDVE9SUCAoY2hhcnZl YykpCisgICAgICB7CisgICAgICAgIC8qIFRoaXMgc2hvdWxkIGJlIGhhbmRsZWQgdGhlIHNhbWUg YXMKKyAgICAgbmV4dF9lbGVtZW50X2Zyb21fZGlzcGxheV92ZWN0b3IgZG9lcyBpdC4gKi8KKyAg ICAgICAgTGlzcF9PYmplY3QgZW50cnkgPSBBUkVGIChjaGFydmVjLCBpKTsKKyAgICAgICAgaWYg KEdMWVBIX0NPREVfUCAoZW50cnkpKQorICAgIGMgPSBHTFlQSF9DT0RFX0NIQVIgKGVudHJ5KTsK KyAgICAgICAgZWxzZQorICAgIGMgPSAnICc7CisgICAgICB9CisgICAgaWYgKGMgPj0gMDQwICYm IGMgPCAwMTc3KQorICAgICAgY29sKys7CisgICAgZWxzZSBpZiAoYyA9PSAnXG4nCisgICAgICAg fHwgKGMgPT0gJ1xyJworICAgICAgICAgICAmJiBFUSAoQlZBUiAoY3VycmVudF9idWZmZXIsIHNl bGVjdGl2ZV9kaXNwbGF5KSwgUXQpKSkKKyAgICAgIHsKKyAgICAgICAgcHRyKys7CisgICAgICAg IGdvdG8gc3RhcnRfb2ZfbGluZV9mb3VuZDsKKyAgICAgIH0KKyAgICBlbHNlIGlmIChjID09ICdc dCcpCisgICAgICB7CisgICAgICAgIGlmICh0YWJfc2VlbikKKyAgICBjb2wgPSAoKGNvbCArIHRh Yl93aWR0aCkgLyB0YWJfd2lkdGgpICogdGFiX3dpZHRoOworICAgICAgICBwb3N0X3RhYiArPSBj b2w7CisgICAgICAgIGNvbCA9IDA7CisgICAgICAgIHRhYl9zZWVuID0gMTsKKyAgICAgIH0KKyAg ICBlbHNlIGlmIChWRUNUT1JQIChjaGFydmVjKSkKKyAgICAgIC8qIFdpdGggYSBkaXNwbGF5IHRh YmxlIGVudHJ5LCBDIGlzIGRpc3BsYXllZCBhcyBpcywgYW5kCisgICAgICAgICBub3QgZGlzcGxh eWVkIGFzIFxOTk4gb3IgYXMgXk4uICBJZiBDIGlzIGEgc2luZ2xlLWJ5dGUKKyAgICAgICAgIGNo YXJhY3R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UgKHN0cnVjdCBm cmFtZSAqZikKK3sKKyAgTGlzcF9PYmplY3QgZnJhbWU7CisgIFhTRVRGUkFNRSAoZnJhbWUsIGYp OworICByZXR1cm4gU1NEQVRBIChGcHJpbjFfdG9fc3RyaW5nIChmcmFtZSwgUW5pbCkpOworfQor CisvKiBVU0FHRTogIGZwcmludGYgKHN0ZGVyciwgIldJTkRPVyAoJXMpIiwgbWNfd2luZG93ICh3 KSk7ICovCitjaGFyICoKK21jX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdykKK3sKKyAgTGlzcF9P YmplY3Qgd2luZG93OworICBYU0VUV0lORE9XICh3aW5kb3csIHcpOworICByZXR1cm4gU1NEQVRB IChGcHJpbjFfdG9fc3RyaW5nICh3aW5kb3csIFFuaWwpKTsKK30KKworLyogVVNBR0U6ICBmcHJp bnRmIChzdGRlcnIsICJDSEFSQUNURVIgKCVzKSIsIG1jX2NoYXJfdG9fc3RyaW5nIChnbHlwaC0+ dS5jaCkpOyAqLworY2hhciAqCittY19jaGFyX3RvX3N0cmluZyAoaW50IGFyZykKK3sKKyAgTGlz cF9PYmplY3QgY2hhcmFjdGVyID0gKDAgPD0gYXJnICYmIGFyZyA8PSBNQVhfQ0hBUikKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gRmNoYXJfdG9fc3RyaW5nIChtYWtlX2ZpeG51bSAoYXJn KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIDogUW5pbDsKKyAgY2hhciAqIHJlc3VsdCA9 ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICYmIGFyZyA9PSA5KQorICAg ICAgICAgICAgICAgICAgICA/ICJcXHQiCisgICAgICAgICAgICAgICAgICA6ICghTklMUCAoY2hh cmFjdGVyKQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnID09IDEwKQorICAgICAgICAgICAg ICAgICAgICA/ICJcXG4iCisgICAgICAgICAgICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQor ICAgICAgICAgICAgICAgICAgICAgJiYgYXJnID09IDMyKQorICAgICAgICAgICAgICAgICAgICA/ ICJcXHMiCisgICAgICAgICAgICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAg ICAgICAgICAgICAgJiYgYXJnICE9IDkKKyAgICAgICAgICAgICAgICAgICAgICYmIGFyZyAhPSAx MAorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnICE9IDMyKQorICAgICAgICAgICAgICAgICAg ICA/IFNTREFUQSAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgOiAiXFw/IjsKKyAgcmV0 dXJuIHJlc3VsdDsKK30KKworaW50CittY19saXNwX3RvX2N1cnNvcl90eXBlIChMaXNwX09iamVj dCBhcmcpCit7CisgIGNoYXIgKnN0cjsKKyAgaWYgKFhUWVBFIChhcmcpID09IExpc3BfU3RyaW5n KQorICAgIHN0ciA9IFNTREFUQSAoYXJnKTsKKyAgICBlbHNlIGlmIChYVFlQRSAoYXJnKSA9PSBM aXNwX1N5bWJvbCkKKyAgICAgIHN0ciA9IFNTREFUQSAoU1lNQk9MX05BTUUgKGFyZykpOworICAg ICAgZWxzZSByZXR1cm4gLTE7CisgIGlmICghc3RyY21wIChzdHIsICJubyIpKQorICAgIHJldHVy biBNQ19OT19DVVJTT1I7CisgIGlmICghc3RyY21wIChzdHIsICJtYy1sZWZ0LWZyaW5nZS1iaXRt YXAiKSkKKyAgICByZXR1cm4gTUNfTEVGVF9GUklOR0VfQklUTUFQOworICBpZiAoIXN0cmNtcCAo c3RyLCAibWMtcmlnaHQtZnJpbmdlLWJpdG1hcCIpKQorICAgIHJldHVybiBNQ19SSUdIVF9GUklO R0VfQklUTUFQOworICBpZiAoIXN0cmNtcCAoc3RyLCAiYm94IikpCisgICAgcmV0dXJuIE1DX0ZJ TExFRF9CT1g7CisgIGlmICghc3RyY21wIChzdHIsICJmcmFtZWQiKSkKKyAgICByZXR1cm4gTUNf RlJBTUVEX0JPWDsKKyAga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BvdmVyIHRoZSBmb3JlZ3JvdW5kIG9m IGZvbGxvd2luZyBnbHlwaHMuICovCisgICAgICBpID0gcmlnaHRfb3ZlcndyaXRpbmcgKHRhaWwp OworICAgICAgaWYgKGkgPj0gMCkKKyAgeworICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBvdmVy bGFwX2hsOworICAgIGlmIChjaGVja19tb3VzZV9mYWNlCisgICAgICAgICYmIG1vdXNlX2JlZ19j b2wgPCBpICYmIG1vdXNlX2VuZF9jb2wgPiBlbmQpCisgICAgICBvdmVybGFwX2hsID0gRFJBV19N T1VTRV9GQUNFOworICAgIGVsc2UKKyAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX05PUk1BTF9URVhU OworICAgIGlmIChobCA9PSBvdmVybGFwX2hsIHx8IGNsaXBfdGFpbCA9PSBOVUxMKQorICAgICAg Y2xpcF90YWlsID0gdGFpbDsKKyAgICBpKys7ICAgICAgLyogV2UgbXVzdCBpbmNsdWRlIHRoZSBJ dGggZ2x5cGguICovCisgICAgTUNfQlVJTERfR0xZUEhfU1RSSU5HUyAoZW5kLCBpLCBoLCB0LAor ICAgICAgICAgICAgIG92ZXJsYXBfaGwsIHgsIGxhc3RfeCk7CisgICAgZm9yIChzID0gaDsgczsg cyA9IHMtPm5leHQpCisgICAgICBzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wID0gdHJ1ZTsKKyAgICBj b21wdXRlX292ZXJoYW5nc19hbmRfeCAoaCwgdGFpbC0+eCArIHRhaWwtPndpZHRoLCBmYWxzZSk7 CisgICAgYXBwZW5kX2dseXBoX3N0cmluZ19saXN0cyAoJmhlYWQsICZ0YWlsLCBoLCB0KTsKKyAg fQorICAgICAgdGFpbCA9IGdseXBoX3N0cmluZ19jb250YWluaW5nX2JhY2tncm91bmRfd2lkdGgg KHRhaWwpOworICAgICAgaWYgKGNsaXBfdGFpbCkKKyAgY2xpcF90YWlsID0gZ2x5cGhfc3RyaW5n X2NvbnRhaW5pbmdfYmFja2d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isgIHctPm91dHB1dF9j dXJzb3IuaHBvcyArPSBsZW47CisgIHctPm91dHB1dF9jdXJzb3IueCA9IHg7Cit9CisKKy8qIEVY UE9SVDoKKyAgIERyYXcgdGhlIGN1cnNvciBnbHlwaCBvZiB3aW5kb3cgVyBpbiBnbHlwaCByb3cg Uk9XLiAgU2VlIHRoZQorICAgY29tbWVudCBvZiBkcmF3X2dseXBocyBmb3IgdGhlIG1lYW5pbmcg b2YgSEwuICovCit2b2lkCittY19kcmF3X2N1cnNvcl9nbHlwaCAoc3RydWN0IHdpbmRvdyAqdywg c3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAg ICAgICAgICAgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIGhsLCBpbnQgeCwgaW50IGhw b3MsIGludCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsLCBl bnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IsCisgICAgICAgICAgICAgICAgICAgICAgZW51bSB0 eXBlX29mX2N1cnNvciBjdXJzb3JfdHlwZSwgaW50IHdkLCBib29sIGFjdGl2ZV9wLAorICAgICAg ICAgICAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX3ApCit7CisgIHN0cnVjdCBnbHlwaF9yb3cg KmJvdHRvbV9yb3cgPSBNQVRSSVhfQk9UVE9NX1RFWFRfUk9XIChtYXRyaXgsIHcpOworICBpbnQg Ym90dG9tX3Zwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKGJvdHRvbV9yb3csIG1hdHJpeCk7CisvKgor ICAgICAgc3RydWN0IGdseXBoICpjdXJzb3JfZ2x5cGggPSBtY19nZXRfY3Vyc29yX2dseXBoICh3 LCBtYXRyaXgsIHJvdywgaHBvcywgdnBvcyk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19k cmF3X2N1cnNvcl9nbHlwaDogIGNoICglZCkg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Jzb3IgZGlzcGxheWVkIG9yIHJvdyBpbnZhbGlkYXRlZCA9PiBu b3RoaW5nIHRvIGRvIG9uIHRoZSBzY3JlZW4uICovCisgIGlmIChjdXJzb3JfdHlwZSA9PSBNQ19O T19DVVJTT1IpCisgICAgeworICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgIGZwcmludGYgKHN0 ZGVyciwgIm1jX2VyYXNlX2N1cnNvcjogIHJldHVybiAoJWQpXG4iLCAxKTsKKyAgICAgIHJldHVy bjsKKyAgICB9CisgIC8qIFZQT1MgPj0gbWF0cml4LT5ucm93cyBtZWFucyB0aGF0IHdpbmRvdyBo YXMgYmVlbiByZXNpemVkLgorICAgICBEb24ndCBib3RoZXIgdG8gZXJhc2UgdGhlIGN1cnNvci4g Ki8KKyAgaWYgKHZwb3MgPj0gbWF0cml4LT5ucm93cykKKyAgICB7CisgICAgICBpZiAoZGVidWdf cCkKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZXJhc2VfY3Vyc29yOiAgcmV0dXJuICgl ZClcbiIsIDIpOworICAgICAgcmV0dXJuOworICAgIH0KKyAgLyogSWYgcm93IGNvbnRhaW5pbmcg Y3Vyc29yIGlzIG1hcmtlZCBpbnZhbGlkLCB0aGVyZSBpcyBub3RoaW5nIHdlCisgICAgIGNhbiBk by4gKi8KKyAgaWYgKCFyb3ctPmVuYWJsZWRfcCkKKyAgICB7CisgICAgICBpZiAoZGVidWdfcCkK KyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZXJhc2VfY3Vyc29yOiAgcmV0dXJuICglZClc biIsIDMpOworICAgICAgcmV0dXJuOworICAgIH0KKyAgLyogSWYgbGluZSBzcGFjaW5nIGlzID4g MCwgb2xkIGN1cnNvciBtYXkgb25seSBiZSBwYXJ0aWFsbHkgdmlzaWJsZSBpbgorICAgICB3aW5k b3cgYWZ0ZXIgc3BsaXQtd2luZG93LiAgU28gYWRqdXN0IHZpc2libGUgaGVpZ2h0LiAqLworICBy b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sIGhzY2xf YWxsX3RlbXBfcCA9ICh3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9o c2Nyb2xsID09IDApOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBub3RoaW5nLiAq LworICBib29sIGhzY2xfYWxsX3Blcm1fMF9wID0gKHctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gdy0+aHNjcm9sbCk7CisgIC8qIEVYQU1QTEU6ICBD LXUgQy14IDwgYW5kIGRvIHNvbWV0aGluZyBlbHNlIGJlc2lkZXMgaG9yaXpvbnRhbGx5IHNjcm9s bGluZyB0aGUKKyAgICAgICAgICAgICAgIGN1cnJlbnQgbGluZSBkaWZmZXJlbnRseS4KKyAgICAg ICAgICAgICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlm ZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8xX3AgPSAoIXctPnN1c3BlbmRfYXV0 b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21v ZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gdy0+aHNjcm9sbCk7CisgIC8q IEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIC4uLgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5l IGlzIF9ub3RfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4gKi8KKyAgYm9vbCBo c2NsX2FsbF9wZXJtXzJfcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA9PSAwCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg dy0+bWluX2hzY3JvbGwgIT0gdy0+aHNjcm9sbCk7CisgIC8qIEVYQU1QTEU6ICAoc2Nyb2xsLWxl ZnQgNSk7IGFuZCwgdGhlbiBwcmVzcyB0aGUgbGVmdCBhcnJvdyBrZXkgb25lIHRpbWUuCisgICAg ICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVy ZW50bHkuKi8KKyAgYm9vbCBoc2NsX3RlbXBfcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3JvbGwK KyAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBhbmQgZG8gc29t ZXRoaW5nIHRoYXQgY2F1c2VzIHRoZSBjdXJyZW50IGxpbmUgdG8gYmUKKyAgICAgICAgICAgICAg IGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4KKyAgICAgICAgICAgICAgIEN1cnJl bnQgbGluZSBfaXNfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4gKi8KKyAgYm9v bCBoc2NsX3Blcm1fcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAg ICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYg dy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA+ IDAKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCAhPSB3LT5oc2Nyb2xs KTsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIGludCBmcmluZ2Vf Yml0bWFwID0gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgaW50IGZhY2VfaWQgPSBERUZBVUxUX0ZB Q0VfSUQ7CisgIGlmICghcmVtb3ZlX3AKKyAgICAgICYmIGdseXBoX2ZsYXZvciA9PSBNQ19PVkVS TEFZX0FSUk9XX0JJVE1BUAorICAgICAgJiYgIWhzY2xfYWxsX3RlbXBfcAorICAgICAgJiYgIWhz Y2xfdGVtcF9wCisgICAgICAmJiAhaHNjbF9wZXJtX3AKKyAgICAgICYmICFoc2NsX2FsbF9wZXJt XzBfcAorICAgICAgJiYgIWhzY2xfYWxsX3Blcm1fMV9wCisgICAgICAmJiAhaHNjbF9hbGxfcGVy bV8yX3ApCisgICAgeworICAgICAgZW51bSBmYWNlX2lkIG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9 CisgICAgICAgICghYWN0aXZlX3AKKyAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3 LT5jb250ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgPyBsb29rdXBfbmFt ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWluYWN0aXZlLWZhY2UiKSwg dHJ1ZSkKKyAgICAgICAgOiAoYWN0aXZlX3ApCisgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFj ZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAg OiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICBmYWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1DX0xF RlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICA/IG92ZXJsYXlfYXJyb3dfZmFjZV9p ZAorICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgLyogZnJpbmdlX2Jp dG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBRb3ZlcmxheV9hcnJvdywgZmFsc2UsIGZh bHNlKTsgKi8KKyAgICAgIGlmICh3LT5oc2Nyb2xsICE9IDApCisgICAgICAgIGZyaW5nZV9iaXRt YXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1vdmVybGF5LWFycm93Iiks IGZhbHNlLCB0cnVlKTsKKyAgICAgICAgZWxzZQorICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBt Y19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1vdmVybGF5LWFycm93IiksIHRydWUs IHRydWUpOworICAgICAgLyogQXMgdG8gYHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXBgLCB0aGUg ZmFjZSBtYXkgYmUgY2hhbmdlZCB1c2luZworICAgICAgdGhlIGBmYWNlLXJlbWFwcGluZy1hbGlz dCcgc28gbG9uZyBhcyB3ZS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gICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAg ICBmYWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAg ICAgICAgICAgICAgID8gb3ZlcmxheV9hcnJvd19mYWNlX2lkCisgICAgICAgICAgICAgICAgICA6 IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgaWYgKGhzY2xfYWxsX3Blcm1fMF9wKQorICAgICAg ICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1o c2NsLXBlcm0iKSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAgICBlbHNlIGlmIChoc2NsX2FsbF9w ZXJtXzFfcCkKKyAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1h cCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgdHJ1ZSwgZmFsc2UpOworICAgICAgICAgICAg ZWxzZSBpZiAoaHNjbF9hbGxfcGVybV8yX3ApCisgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAg PSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgZmFsc2Us IHRydWUpOworICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX3Blcm1fcCkKKyAgICAgICAgICAg ICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIist aHNjbC1wZXJtIiksIHRydWUsIHRydWUpOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xf YWxsX3RlbXBfcCkKKyAgICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJp bmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXRlbXAiKSwgZmFsc2UsIGZhbHNlKTsKKyAg ICAgICAgICA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bGF3bGlzdCBwcmVmZXJzIG5vdCB0bworICAg ICAgICByZWx5IHVwb24gYSBMaXNwIHNldHRpbmcgdXNpbmcgYHNldC1mcmluZ2UtYml0bWFwLWZh Y2UnLiAqLworICAgICAgICByb3ctPmxlZnRfZnJpbmdlX2JpdG1hcCA9IChjdXJzb3JfdHlwZSA9 PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IGZyaW5nZV9iaXRtYXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgcm93LT5sZWZ0X2Zy aW5nZV9mYWNlX2lkID0gZmFjZV9pZDsKKyAgICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9vZmZzZXQg PSAwOworICAgICAgICByb3ctPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcCA9IGZhbHNlOworICAg ICAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXAgKHcsIHJvdywgdHJ1ZSwgY3Vyc29yX3R5cGUpOwor ICAgICAgfQorICAgICAgZWxzZSBpZiAoIXJlbW92ZV9wCisgICAgICAgICAgICAgICAmJiAoZ2x5 cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAg ICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9S SUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19IT0xM T1dfUkVDVEFOR0xFCisgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZF UlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZv ciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAg ICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAg ICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAgICAg ICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIKSkK KyAgICAgICAgeworICAgICAgICAgIExpc3BfT2JqZWN0IGJpdG1hcF9mbGF2b3IgPSAoZ2x5cGhf Zmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hvbGxvd19yZWN0YW5nbGVfcmlnaHRfYXJy b3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9y ID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfaG9sbG93X3JlY3Rh bmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xlCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNB TF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBRbWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9C QVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBRbWNfcmV2ZXJzZWRfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxf YmFyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZv ciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxfYmFyCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9C QVJfQkFDS1NMQVNIKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g UW1jX3ZlcnRpY2FsX2Jhcl9iYWNrc2xhc2gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOiBRbmlsOworICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUg PT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgPyBs b29rdXBfZnJpbmdlX2JpdG1hcCAoYml0bWFwX2ZsYXZvcikKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgOiBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgIGZhY2VfaWQgPSAoY3Vyc29y X3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAgICAgJiYg KGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9X CisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VE X1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGds eXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpKQorICAgICAgICAgICAgICAg ICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmV2ZXJzZWQtdmVy dGljYWwtYmFyLWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX3R5 cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAgICAgICAmJiBn bHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVwor ICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVS VElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2Zs YXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAg PyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy12ZXJ0aWNhbC1iYXItZmFjZSIp LCB0cnVlKQorICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAg ICByb3ctPmN1cnNvcl9pbl9mcmluZ2VfcCA9IGZhbHNlOworICAgICAgICAgIHJvdy0+cmlnaHRf ZnJpbmdlX2JpdG1hcCA9IGZyaW5nZV9iaXRtYXA7CisgICAgICAgICAgcm93LT5yaWdodF9mcmlu Z2VfZmFjZV9pZCA9IGZhY2VfaWQ7CisgICAgICAgICAgcm93LT5yaWdodF9mcmluZ2Vfb2Zmc2V0 ID0gMDsKKyAgICAgICAgICByb3ctPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcCA9IGZhbHNlOwor ICAgICAgICAgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcCAodywgcm93LCBmYWxzZSwgY3Vyc29yX3R5 cGUpOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQ SAorICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEhMRVNTKQorICAg ICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgb25fcCA9IHRydWU7CisgICAgICAgICAgICBGUkFN RV9SSUYgKGYpLT5tY19zY3JpYmVfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5 LCBocG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdnBv cywgd2QsIGgsIGxzbCwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIGdseXBoX2ZsYXZvciwgb25fcCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2ZV9wKTsKKyAgICAg ICAgICB9Cit9CisKKy8qIER1bXAgY29udGVudHMgb2YgZ2x5cGggR0xZUEggdG8gc3RkZXJyLiAg Uk9XIGFuZCBBUkVBIGFyZQorICAgdGhlIGdseXBoIHJvdyBhbmQgYXJlYSB3aGVyZSB0aGUgZ2x5 cGggY29tZXMgZnJvbS4gKi8KK3ZvaWQKK21jX2R1bXBfZ2x5cGggKHN0cnVjdCBnbHlwaF9yb3cg KnJvdywgc3RydWN0IGdseXBoICpnbHlwaCwgaW50IGFyZWEsIGludCByZWxhdGl2ZV94KQorewor ICBpZiAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgfHwgZ2x5cGgtPnR5cGUgPT0g R0xZUEhMRVNTX0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAg IiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4x ZCAlNWQgJTRkICAlM2QgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBo c1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ct PnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgKGdseXBoLT50 eXBlID09IENIQVJfR0xZUEgKKyAgICAgICAgID8gJ0MnCisgICAgICAgICA6ICdHJyksCisgICAg ICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAg ICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAg ICAgICAgPyAnUycKKyAgICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICAgICAgICA/ICcwJworICAgICAgICAgICAgICAgOiAnLScpKSksCisgICAgICAgIGdseXBoLT5w aXhlbF93aWR0aCwKKyAgICAgICAgZ2x5cGgtPnUuY2gsCisgICAgICAgIGdseXBoLT5mYWNlX2lk LAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRf Ym94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgZ2x5 cGgtPnZwb3MsIGdseXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgIG1jX2NoYXJfdG9f c3RyaW5nIChnbHlwaC0+dS5jaCkpOworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0g U1RSRVRDSF9HTFlQSCkKKyAgICB7CisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICIg JTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNnggJTRkICUxLjFkJTEuMWQg JTVkICU0ZCAgJTNkICAlM2QgJXMgJXNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNb VEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51 c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdTJywKKyAgICAg ICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAg ICAgICAgICAgPyAnQicKKyAgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAg ICAgICAgICAgPyAnUycKKyAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAg ICAgICAgPyAnMCcKKyAgICAgICAgICA6ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dp ZHRoLAorICAgICAgICAwdSwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBo LT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAg ICAgICBnbHlwaC0+eCwgZ2x5cGgtPnksIGdseXBoLT5ocG9zLCBnbHlwaC0+dnBvcywgZ2x5cGgt Pnp2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgIlxcUyIpOworICAgIH0KKyAgZWxzZSBpZiAo Z2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJy LAorICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0 ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNkICVzICVjXG4iLAorICAgICAgICBnbHlwaCAt IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDAp ID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAg ICAnSScsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgt Pm9iamVjdCkKKyAgICAgICAgICAgID8gJ0InCisgICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgt Pm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9i amVjdCkKKyAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgOiAnLScpKSksCisgICAgICAgIGds eXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgKHVuc2lnbmVkIGludCkgZ2x5cGgtPnUuaW1nX2lk LAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVf cCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT54LCBn bHlwaC0+eSwgZ2x5cGgtPmhwb3MsIGdseXBoLT52cG9zLCBnbHlwaC0+enZfcCA/ICJaViIgOiAi LS0iLAorICAgICAgICAnLicpOworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gQ09N UE9TSVRFX0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIiAl NSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCIsCisgICAgICAgIGdseXBo IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0g MCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAg ICAgICcrJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlw aC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnQicKKyAgICAgICAgICA6IChTVFJJTkdQIChnbHlw aC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICA6IChOSUxQIChnbHlwaC0+ b2JqZWN0KQorICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICA6ICctJykpKSwKKyAgICAgICAg Z2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAodW5zaWduZWQgaW50KSBnbHlwaC0+dS5jbXAu aWQpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICU0ZCAlMS4xZCUxLjFkIiwKKyAgICAgICAg Z2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAg IGdseXBoLT5yaWdodF9ib3hfbGluZV9wKTsKKyAgICAgIGlmIChnbHlwaC0+dS5jbXAuYXV0b21h dGljKQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIgJTVkICU0ZCAgJTNkICAlM2QgJXMgLiBb JWQtJWRdXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoLT54LCBnbHlwaC0+eSwg Z2x5cGgtPmhwb3MsIGdseXBoLT52cG9zLCBnbHlwaC0+enZfcCA/ICJaViIgOiAiLS0iLAorICAg ICAgICAgICAgICAgICAgICAgICAgIGdseXBoLT5zbGljZS5jbXAuZnJvbSwgZ2x5cGgtPnNsaWNl LmNtcC50byk7CisgICAgICAgIGVsc2UKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiXG4iKTsK KyAgICB9CisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IFhXSURHRVRfR0xZUEgpCisgICAgewor I2lmbmRlZiBIQVZFX1hXSURHRVRTCisgICAgICBlYXNzdW1lIChmYWxzZSk7CisjZWxzZQorICAg ICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICAlNWQvJS01ZCAlNWQgJTRjICU2ZCAlYyAl M2QgMHglMDV4ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNkICVzICVjXG4iLAorICAg ICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2Vk W2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2 ZV94LAorICAgICAgICAnWCcsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVG RkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNUUklO R1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgOiAnLScpKSwK KyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAg ICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9s aW5lX3AsCisgICAgICAgIGdseXBoLT51Lnh3aWRnZXQsCisgICAgICAgIGdseXBoLT54LCBnbHlw aC0+eSwgZ2x5cGgtPmhwb3MsIGdseXBoLT52cG9zLCBnbHlwaC0+enZfcCA/ICJaViIgOiAiLS0i LAorICAgICAgICAnLicpOworI2VuZGlmCisgICAgfQorfQorCisvKiBEdW1wIHRoZSBjb250ZW50 cyBvZiBnbHlwaCByb3cgYXQgVlBPUyBpbiBNQVRSSVggdG8gc3RkZXJyLgorICAgR0xZUEhTIDAg bWVhbnMgZG9uJ3Qgc2hvdyBnbHlwaCBjb250ZW50cy4KKyAgIEdMWVBIUyAxIG1lYW5zIHNob3cg Z2x5cGhzIGluIHNob3J0IGZvcm0KKyAgIEdMWVBIUyA+IDEgbWVhbnMgc2hvdyBnbHlwaHMgaW4g bG9uZyBmb3JtLiAqLwordm9pZAorbWNfZHVtcF9nbHlwaF9yb3cgKHN0cnVjdCBnbHlwaF9yb3cg KnJvdywgaW50IHZwb3MsIGludCBnbHlwaHMpCit7CisgIGludCByZWxhdGl2ZV94ID0gMDsKKyAg aWYgKGdseXBocyAhPSAxKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIlxuRFVNUCBH TFlQSCBST1dcbiIpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiUm93ICAgICBTdGFydCAgICAg ICBFbmQgVXNlZCBvRT48XFxDVFpGZXNtICAgICBYICAgIFkgICAgVyAgICBIICAgIFYgICAgQSAg ICBQXG4iKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIj09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxu Iik7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIlM2QgJTkicEQiZCAlOSJwRCJkICU0ZCAlMS4x ZCUxLjFkJTEuMWQlMS4xZFwKKyUxLjFkJTEuMWQlMS4xZCUxLjFkJTEuMWQlMS4xZCUxLjFkJTEu MWQgICU0ZCAlNGQgJTRkICU0ZCAlNGQgJTRkICU0ZFxuIiwKKyAgICAgICAgIHZwb3MsCisgICAg ICAgICBNQVRSSVhfUk9XX1NUQVJUX0NIQVJQT1MgKHJvdyksCisgICAgICAgICBNQVRSSVhfUk9X X0VORF9DSEFSUE9TIChyb3cpLAorICAgICAgICAgcm93LT51c2VkW1RFWFRfQVJFQV0sCisgICAg ICAgICByb3ctPmNvbnRhaW5zX292ZXJsYXBwaW5nX2dseXBoc19wLAorICAgICAgICAgcm93LT5l bmFibGVkX3AsCisgICAgICAgICByb3ctPnRydW5jYXRlZF9vbl9sZWZ0X3AsCisgICAgICAgICBy b3ctPnRydW5jYXRlZF9vbl9yaWdodF9wLAorICAgICAgICAgcm93LT5jb250aW51ZWRfcCwKKyAg ICAgICAgIE1BVFJJWF9ST1dfQ09OVElOVUFUSU9OX0xJTkVfUCAocm93KSwKKyAgICAgICAgIE1B VFJJWF9ST1dfRElTUExBWVNfVEVYVF9QIChyb3cpLAorICAgICAgICAgcm93LT5lbmRzX2F0X3p2 X3AsCisgICAgICAgICByb3ctPmZpbGxfbGluZV9wLAorICAgICAgICAgcm93LT5lbmRzX2luX21p ZGRsZV9vZl9jaGFyX3AsCisgICAgICAgICByb3ctPnN0YXJ0c19pbl9taWRkbGVfb2ZfY2hhcl9w LAorICAgICAgICAgcm93LT5tb3VzZV9mYWNlX3AsCisgICAgICAgICByb3ctPngsCisgICAgICAg ICByb3ctPnksCisgICAgICAgICByb3ctPnBpeGVsX3dpZHRoLAorICAgICAgICAgcm93LT5oZWln aHQsCisgICAgICAgICByb3ctPnZpc2libGVfaGVpZ2h0LAorICAgICAgICAgcm93LT5hc2NlbnQs CisgICAgICAgICByb3ctPnBoeXNfYXNjZW50KTsKKyAgICAgIC8qIFRoZSBuZXh0IDMgbGluZXMg c2hvdWxkIGFsaWduIHRvICJTdGFydCIgaW4gdGhlIGhlYWRlci4gKi8KKyAgICAgIGZwcmludGYg KHN0ZGVyciwgIiAgICAlOSJwRCJkICU5InBEImRcdCU1ZFxuIiwgcm93LT5zdGFydC5vdmVybGF5 X3N0cmluZ19pbmRleCwKKyAgICAgICAgIHJvdy0+ZW5kLm92ZXJsYXlfc3RyaW5nX2luZGV4LAor ICAgICAgICAgcm93LT5jb250aW51YXRpb25fbGluZXNfd2lkdGgpOworICAgICAgZnByaW50ZiAo c3RkZXJyLCAiICAgICU5InBEImQgJTkicEQiZFxuIiwKKyAgICAgICAgIENIQVJQT1MgKHJvdy0+ c3RhcnQuc3RyaW5nX3BvcyksCisgICAgICAgICBDSEFSUE9TIChyb3ctPmVuZC5zdHJpbmdfcG9z KSk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgICAgJTlkICU5ZFxuIiwgcm93LT5zdGFydC5k cHZlY19pbmRleCwKKyAgICAgICAgIHJvdy0+ZW5kLmRwdmVjX2luZGV4KTsKKyAgICB9CisgIGlm IChnbHlwaHMgPiAxKQorICAgIHsKKyAgICAgIGZvciAoaW50IGFyZWEgPSBMRUZUX01BUkdJTl9B UkVBOyBhcmVhIDwgTEFTVF9BUkVBOyArK2FyZWEpCisgIHsKKyAgICBzdHJ1Y3QgZ2x5cGggKmds eXBoID0gcm93LT5nbHlwaHNbYXJlYV07CisgICAgc3RydWN0IGdseXBoICpnbHlwaF9lbmQgPSBn bHlwaCArIHJvdy0+dXNlZFthcmVhXTsKKyAgICAvKiBHbHlwaCBmb3IgYSBsaW5lIGVuZCBpbiB0 ZXh0LiAqLworICAgIGlmIChhcmVhID09IFRFWFRfQVJFQSAmJiBnbHlwaCA9PSBnbHlwaF9lbmQg JiYgZ2x5cGgtPmNoYXJwb3MgPiAwKQorICAgICAgKytnbHlwaF9lbmQ7CisgICAgaWYgKGdseXBo IDwgZ2x5cGhfZW5kKQorICAgICAgZnByaW50ZiAoc3RkZXJyLCAiR2x5cGgjL1RvdGFsIFJlbC5Y IFQgICAgICAgUG9zIE8gICBXICAgICBDb2RlIEZhY2UgTFIgICAgIFggICAgWSBIUE9TIFZQT1Mg WlYgQ1xuIik7CisgICAgZm9yICg7IGdseXBoIDwgZ2x5cGhfZW5kOyArK2dseXBoKQorICAgICAg eworICAgICAgICBtY19kdW1wX2dseXBoIChyb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94KTsK KyAgICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICB9CisgIH0K KyAgICB9CisgIGVsc2UgaWYgKGdseXBocyA9PSAxKQorICAgIHsKKyAgICAgIGNoYXIgc1tTSFJU X01BWCArIDRdOworICAgICAgZm9yIChpbnQgYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFyZWEg PCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAgeworICAgIGludCBpOworICAgIGZvciAoaSA9IDA7IGkg PCByb3ctPnVzZWRbYXJlYV07ICsraSkKKyAgICAgIHsKKyAgICAgICAgc3RydWN0IGdseXBoICpn bHlwaCA9IHJvdy0+Z2x5cGhzW2FyZWFdICsgaTsKKyAgICAgICAgaWYgKGkgPT0gcm93LT51c2Vk W2FyZWFdIC0gMQorICAgICAgJiYgYXJlYSA9PSBURVhUX0FSRUEKKyAgICAgICYmIE5JTFAgKGds eXBoLT5vYmplY3QpCisgICAgICAmJiBnbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAm JiBnbHlwaC0+dS5jaCA9PSAnICcpCisgICAgeworICAgICAgc3RyY3B5ICgmc1tpXSwgIltcXG5d Iik7CisgICAgICBpICs9IDQ7CisgICAgfQorICAgICAgICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9 PSBDSEFSX0dMWVBICisgICAgICAgICAgICYmIGdseXBoLT51LmNoIDwgMHg4MAorICAgICAgICAg ICAmJiBnbHlwaC0+dS5jaCA+PSAnICcpCisgICAgc1tpXSA9IGdseXBoLT51LmNoOworICAgICAg ICBlbHNlCisgICAgc1tpXSA9ICcuJzsKKyAgICAgIH0KKyAgICBzW2ldID0gJ1wwJzsKKyAgICBm cHJpbnRmIChzdGRlcnIsICIlM2Q6ICglZCkgJyVzJ1xuIiwgdnBvcywgcm93LT5lbmFibGVkX3As IHMpOworICB9CisgICAgfQorfQorCitERUZVTiAoIm1jLWR1bXAtZ2x5cGgtcm93IiwgRm1jX2R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gICAgOiB5cG9zOworICAgICAgaWYgKHZpc2li bGVfcCkKKyAgICAgICAgdnBvcyA9IHZvZmZzZXQ7CisgICAgICAgIGVsc2UKKyAgICAgICAgICB2 cG9zID0gMDsKKyAgICB9CisgICAgZWxzZQorICAgICAgeworICAgICAgICBDSEVDS19OVU1CRVIg KHJvdyk7CisgICAgICAgIHZwb3MgPSBYRklYTlVNIChyb3cpOworICAgICAgfQorICBtYXRyaXgg PSB3LT5jdXJyZW50X21hdHJpeDsKKyAgaWYgKHZwb3MgPj0gMCAmJiB2cG9zIDwgbWF0cml4LT5u cm93cykKKyAgICBtY19kdW1wX2dseXBoX3JvdyAoTUFUUklYX1JPVyAobWF0cml4LCB2cG9zKSwK KyAgICAgICAgdnBvcywKKyAgICAgICAgVFlQRV9SQU5HRURfRklYTlVNUCAoaW50LCBnbHlwaHMp ID8gWEZJWE5VTSAoZ2x5cGhzKSA6IDIpOworICByZXR1cm4gUW5pbDsKK30KKwordm9pZAorbWNf ZHVtcF9nbHlwaF9tYXRyaXggKHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgaW50IGdseXBo cykKK3sKKyAgaW50IGk7CisgIGZvciAoaSA9IDA7IGkgPCBtYXRyaXgtPm5yb3dzOyArK2kpCisg ICAgbWNfZHVtcF9nbHlwaF9yb3cgKE1BVFJJWF9ST1cgKG1hdHJpeCwgaSksIGksIGdseXBocyk7 Cit9CisKK0RFRlVOICgibWMtZHVtcC1nbHlwaC1tYXRyaXgiLCBGbWNfZHVtcF9nbHlwaF9tYXRy aXgsCisgICAgICAgU21jX2R1bXBfZ2x5cGhfbWF0cml4LCAwLCAxLCAicCIsCisgICAgICAgZG9j OiAvKiBEdW1wIHRoZSBjdXJyZW50IG1hdHJpeCBvZiB0aGUgc2VsZWN0ZWQgd2luZG93IHRvIHN0 ZGVyci4KK1Nob3dzIGNvbnRlbnRzIG9mIGdseXBoIHJvdyBzdHJ1Y3R1cmVzLiAgV2l0aCBub24t bmlsCitwYXJ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OworfQorCit2b2lkCitt Y19yZXNldF9jYWNoZSAoc3RydWN0IHdpbmRvdyAqdywgZW51bSB0eXBlX29mX2NhY2hlIGNhY2hl X3R5cGUpCit7CisgIHN3aXRjaCAoY2FjaGVfdHlwZSkKKyAgICB7CisgICAgICBjYXNlIE5PX0NB Q0hFOgorICAgICAgICB7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGNhc2Ug TUNfQ0FDSEU6CisgICAgICAgIHsKKyAgICAgICAgICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMp CisgICAgICAgICAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNf Y29uZikpCisgICAgICAgICAgICAgICYmIHctPm1jX2VsdHMudXNlZCA+IDEpCisgICAgICAgICAg ICB7CisgICAgICAgICAgICAgIC8qIERlY3JlYXNlIHRoZSBzaXplIG9mIHRoZSBhcnJheSB0byBh IGJhcmUgbWluaW11bS4gKi8KKyAgICAgICAgICAgICAgdy0+bWNfZWx0cy5jYWNoZXMgPSB4bnJl YWxsb2MgKHctPm1jX2VsdHMuY2FjaGVzLCAxLCBzaXplb2YgKnctPm1jX2VsdHMuY2FjaGVzKTsK KyAgICAgICAgICAgICAgdy0+bWNfZWx0cy51c2VkID0gMDsKKyAgICAgICAgICAgICAgdy0+bWNf ZWx0cy5hbGxvY2F0ZWQgPSAxOworICAgICAgICAgICAgfQorICAgICAgICAgICAgLy8gIEFsdGhv dWdoIGl0IHdvdWxkIG5vdCBiZSB2ZXJ5IGVmZmljaWVudCwgaXQgaXMgcG9zc2libGUgdG8gc2V0 CisgICAgICAgICAgICAvLyAgdGhlIF91c2VkXyBlbGVtZW50cyBvZiB0aGUgYXJyYXkgdG8gemVy by4gIEluIHN1Y2ggYSBjYXNlLCB0aGUKKyAgICAgICAgICAgIC8vICAuLi5fZWx0cy5hbGxvY2F0 ZWQgd291bGQgcmVtYWluIHRoZSBzYW1lLgorICAgICAgICAgICAgLy8gIG1lbXNldCAody0+bWNf ZWx0cy5jYWNoZXMsIDAsIHctPm1jX2VsdHMudXNlZCAqIChzaXplb2YgKnctPm1jX2VsdHMuY2Fj aGVzKSk7CisgICAgICAgICAgICAvLyAgQXQgdGhpcyB0aW1lLCB3ZSBhcmUgaW5zdGVhZCBsZWF2 aW5nIHRoZSBhcnJheSBhcy1pcyB3aXRoIHRoZQorICAgICAgICAgICAgLy8gIHVuZGVyc3RhbmRp bmcgdGhhdCBpdCB3aWxsIGNvbnRhaW4gb3V0ZGF0ZWQgZGF0YSAoYWthIGdhcmJhZ2UpLgorICAg ICAgICAgICAgLy8gIFVzaW5nIHRoZSBjb3VudGVyIGB3LT5tY19lbHRzLnVzZWRgLCB3ZSB0cmFj ayBjdXJyZW50IGRhdGEuCisgICAgICAgICAgICBlbHNlIGlmIChCVUZGRVJQICh3LT5jb250ZW50 cykKKyAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIG1jX2NvbmYpKSkKKyAgICAgICAgICAgICAgdy0+bWNfZWx0cy51c2VkID0gMDsKKyAg ICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgY2FzZSBDSF9DQUNIRToKKyAgICAgICAg eworICAgICAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgJiYg TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAg ICAgICAgJiYgdy0+Y2hfZWx0cy51c2VkID4gMSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgLyogRGVjcmVhc2UgdGhlIHNpemUgb2YgdGhlIGFycmF5IHRvIGEgYmFyZSBtaW5pbXVtLiAq LworICAgICAgICAgICAgICB3LT5jaF9lbHRzLmNhY2hlcyA9IHhucmVhbGxvYyAody0+Y2hfZWx0 cy5jYWNoZXMsIDEsIHNpemVvZiAqdy0+Y2hfZWx0cy5jYWNoZXMpOworICAgICAgICAgICAgICB3 LT5jaF9lbHRzLnVzZWQgPSAwOworICAgICAgICAgICAgICB3LT5jaF9lbHRzLmFsbG9jYXRlZCA9 IDE7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvLyAgQWx0aG91Z2ggaXQgd291bGQgbm90 IGJlIHZlcnkgZWZmaWNpZW50LCBpdCBpcyBwb3NzaWJsZSB0byBzZXQKKyAgICAgICAgICAgIC8v ICB0aGUgX3VzZWRfIGVsZW1lbnRzIG9mIHRoZSBhcnJheSB0byB6ZXJvLiAgSW4gc3VjaCBhIGNh c2UsIHRoZQorICAgICAgICAgICAgLy8gIC4uLl9lbHRzLmFsbG9jYXRlZCB3b3VsZCByZW1haW4g dGhlIHNhbWUuCisgICAgICAgICAgICAvLyAgbWVtc2V0ICh3LT5jaF9lbHRzLmNhY2hlcywgMCwg dy0+Y2hfZWx0cy51c2VkICogKHNpemVvZiAqdy0+Y2hfZWx0cy5jYWNoZXMpKTsKKyAgICAgICAg ICAgIC8vICBBdCB0aGlzIHRpbWUsIHdlIGFyZSBpbnN0ZWFkIGxlYXZpbmcgdGhlIGFycmF5IGFz LWlzIHdpdGggdGhlCisgICAgICAgICAgICAvLyAgdW5kZXJzdGFuZGluZyB0aGF0IGl0IHdpbGwg Y29udGFpbiBvdXRkYXRlZCBkYXRhIChha2EgZ2FyYmFnZSkuCisgICAgICAgICAgICAvLyAgVXNp bmcgdGhlIGNvdW50ZXIgYHctPmNoX2VsdHMudXNlZGAsIHdlIHRyYWNrIGN1cnJlbnQgZGF0YS4K KyAgICAgICAgICAgIGVsc2UgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAg ICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWly cykpKQorICAgICAgICAgICAgICB3LT5jaF9lbHRzLnVzZWQgPSAwOworICAgICAgICAgIGJyZWFr OworICAgICAgICB9CisgICAgICBjYXNlIEZDX0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAg aWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAmJiBOSUxQIChCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQorICAgICAgICAgICAgICAmJiB3LT5m Y19lbHRzLnVzZWQgPiAxKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBEZWNyZWFz ZSB0aGUgc2l6ZSBvZiB0aGUgYXJyYXkgdG8gYSBiYXJlIG1pbmltdW0uICovCisgICAgICAgICAg ICAgIHctPmZjX2VsdHMuY2FjaGVzID0geG5yZWFsbG9jICh3LT5mY19lbHRzLmNhY2hlcywgMSwg c2l6ZW9mICp3LT5mY19lbHRzLmNhY2hlcyk7CisgICAgICAgICAgICAgIHctPmZjX2VsdHMudXNl ZCA9IDA7CisgICAgICAgICAgICAgIHctPmZjX2VsdHMuYWxsb2NhdGVkID0gMTsKKyAgICAgICAg ICAgIH0KKyAgICAgICAgICAgIC8vICBBbHRob3VnaCBpdCB3b3VsZCBub3QgYmUgdmVyeSBlZmZp Y2llbnQsIGl0IGlzIHBvc3NpYmxlIHRvIHNldAorICAgICAgICAgICAgLy8gIHRoZSBfdXNlZF8g ZWxlbWVudHMgb2YgdGhlIGFycmF5IHRvIHplcm8uICBJbiBzdWNoIGEgY2FzZSwgdGhlCisgICAg ICAgICAgICAvLyAgLi4uX2VsdHMuYWxsb2NhdGVkIHdvdWxkIHJlbWFpbiB0aGUgc2FtZS4KKyAg ICAgICAgICAgIC8vICBtZW1zZXQgKHctPmZjX2VsdHMuY2FjaGVzLCAwLCB3LT5mY19lbHRzLnVz ZWQgKiAoc2l6ZW9mICp3LT5mY19lbHRzLmNhY2hlcykpOworICAgICAgICAgICAgLy8gIEF0IHRo aXMgdGltZSwgd2UgYXJlIGluc3RlYWQgbGVhdmluZyB0aGUgYXJyYXkgYXMtaXMgd2l0aCB0aGUK KyAgICAgICAgICAgIC8vICB1bmRlcnN0YW5kaW5nIHRoYXQgaXQgd2lsbCBjb250YWluIG91dGRh dGVkIGRhdGEgKGFrYSBnYXJiYWdlKS4KKyAgICAgICAgICAgIC8vICBVc2luZyB0aGUgY291bnRl ciBgdy0+ZmNfZWx0cy51c2VkYCwgd2UgdHJhY2sgY3VycmVudCBkYXRhLgorICAgICAgICAgICAg ZWxzZSBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgICAmJiAh TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpCisgICAgICAg ICAgICAgIHctPmZjX2VsdHMudXNlZCA9IDA7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0K KyAgICB9Cit9CisKK3N0YXRpYyB2b2lkCittY19oZWxwZXIgKHN0cnVjdCB3aW5kb3cgKncsIHN0 cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAg ICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoLCBpbnQgeCwgaW50IGZ4LCBpbnQgeSwgaW50IGZ5LCBp bnQgaHBvcywgaW50IHZwb3MsCisgICAgICAgICAgIGludCB3ZCwgaW50IGgsIGVudW0gdHlwZV9v Zl9jdXJzb3IgY3Vyc29yX3R5cGUsIGludCBjdXJzb3Jfd2lkdGgsCisgICAgICAgICAgIHN0cnVj dCBtY19SR0IgZm9yZWdyb3VuZCwgc3RydWN0IG1jX1JHQiBiYWNrZ3JvdW5kLCBib29sIGFjdGl2 ZV9wLAorICAgICAgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IsIGJvb2wgZHJhd19w LCBlbnVtIHR5cGVfb2ZfY2FjaGUgY2FjaGVfdHlwZSkKK3sKKyAgaWYgKGdseXBoICE9IE5VTEwK KyAgICAgICYmIGdseXBoLT51LmNoID09IDk1CisgICAgICAmJiBjdX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IHctPm1jX2VsdHMudXNlZCkKKyAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgaW50IG9sZF9hbGxvYyA9IHctPm1jX2VsdHMuYWxsb2NhdGVk OworICAgICAgICAgICAgICBpbnQgbmV3X2VsdHMgPSB3LT5tY19lbHRzLnVzZWQgLSB3LT5tY19l bHRzLmFsbG9jYXRlZDsKKyAgICAgICAgICAgICAgdy0+bWNfZWx0cy5jYWNoZXMgPSB4cGFsbG9j ICh3LT5tY19lbHRzLmNhY2hlcywgJnctPm1jX2VsdHMuYWxsb2NhdGVkLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19lbHRzLCBJTlRfTUFYLCBzaXplb2Yg KnctPm1jX2VsdHMuY2FjaGVzKTsKKyAgICAgICAgICAgICAgbWVtc2V0ICh3LT5tY19lbHRzLmNh Y2hlcyArIG9sZF9hbGxvYywgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgKHctPm1jX2VsdHMu YWxsb2NhdGVkIC0gb2xkX2FsbG9jKSAqIHNpemVvZiAqdy0+bWNfZWx0cy5jYWNoZXMpOworICAg ICAgICAgICAgfQorICAgICAgICAgIGZvb19lbHRzLmNhY2hlcyA9IHctPm1jX2VsdHMuY2FjaGVz OworICAgICAgICAgIGZvb19lbHRzLmFsbG9jYXRlZCA9IHctPm1jX2VsdHMuYWxsb2NhdGVkOwor ICAgICAgICAgIGZvb19lbHRzLnVzZWQgPSB3LT5tY19lbHRzLnVzZWQ7CisgICAgICAgICAgYnJl YWs7CisgICAgICAgIH0KKyAgICAgIGNhc2UgQ0hfQ0FDSEU6CisgICAgICAgIHsKKyAgICAgICAg ICArK3ctPmNoX2VsdHMudXNlZDsKKyAgICAgICAgICBpZiAody0+Y2hfZWx0cy5hbGxvY2F0ZWQg PCB3LT5jaF9lbHRzLnVzZWQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGludCBvbGRf YWxsb2MgPSB3LT5jaF9lbHRzLmFsbG9jYXRlZDsKKyAgICAgICAgICAgICAgaW50IG5ld19lbHRz ID0gdy0+Y2hfZWx0cy51c2VkIC0gdy0+Y2hfZWx0cy5hbGxvY2F0ZWQ7CisgICAgICAgICAgICAg IHctPmNoX2VsdHMuY2FjaGVzID0geHBhbGxvYyAody0+Y2hfZWx0cy5jYWNoZXMsICZ3LT5jaF9l bHRzLmFsbG9jYXRlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBuZXdfZWx0cywgSU5UX01BWCwgc2l6ZW9mICp3LT5jaF9lbHRzLmNhY2hlcyk7CisgICAgICAg ICAgICAgIG1lbXNldCAody0+Y2hfZWx0cy5jYWNoZXMgKyBvbGRfYWxsb2MsIDAsCisgICAgICAg ICAgICAgICAgICAgICAgICh3LT5jaF9lbHRzLmFsbG9jYXRlZCAtIG9sZF9hbGxvYykgKiBzaXpl b2YgKnctPmNoX2VsdHMuY2FjaGVzKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBmb29fZWx0 cy5jYWNoZXMgPSB3LT5jaF9lbHRzLmNhY2hlczsKKyAgICAgICAgICBmb29fZWx0cy5hbGxvY2F0 ZWQgPSB3LT5jaF9lbHRzLmFsbG9jYXRlZDsKKyAgICAgICAgICBmb29fZWx0cy51c2VkID0gdy0+ Y2hfZWx0cy51c2VkOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBjYXNlIEZD X0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAgKyt3LT5mY19lbHRzLnVzZWQ7CisgICAgICAg ICAgaWYgKHctPmZjX2VsdHMuYWxsb2NhdGVkIDwgdy0+ZmNfZWx0cy51c2VkKQorICAgICAgICAg ICAgeworICAgICAgICAgICAgICBpbnQgb2xkX2FsbG9jID0gdy0+ZmNfZWx0cy5hbGxvY2F0ZWQ7 CisgICAgICAgICAgICAgIGludCBuZXdfZWx0cyA9IHctPmZjX2VsdHMudXNlZCAtIHctPmZjX2Vs dHMuYWxsb2NhdGVkOworICAgICAgICAgICAgICB3LT5mY19lbHRzLmNhY2hlcyA9IHhwYWxsb2Mg KHctPmZjX2VsdHMuY2FjaGVzLCAmdy0+ZmNfZWx0cy5hbGxvY2F0ZWQsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2VsdHMsIElOVF9NQVgsIHNpemVvZiAq dy0+ZmNfZWx0cy5jYWNoZXMpOworICAgICAgICAgICAgICBtZW1zZXQgKHctPmZjX2VsdHMuY2Fj aGVzICsgb2xkX2FsbG9jLCAwLAorICAgICAgICAgICAgICAgICAgICAgICAody0+ZmNfZWx0cy5h bGxvY2F0ZWQgLSBvbGRfYWxsb2MpICogc2l6ZW9mICp3LT5mY19lbHRzLmNhY2hlcyk7CisgICAg ICAgICAgICB9CisgICAgICAgICAgZm9vX2VsdHMuY2FjaGVzID0gdy0+ZmNfZWx0cy5jYWNoZXM7 CisgICAgICAgICAgZm9vX2VsdHMuYWxsb2NhdGVkID0gdy0+ZmNfZWx0cy5hbGxvY2F0ZWQ7Cisg ICAgICAgICAgZm9vX2VsdHMudXNlZCA9IHctPmZjX2VsdHMudXNlZDsKKyAgICAgICAgICBicmVh azsKKyAgICAgICAgfQorICAgIH0KKyAgaW50IG50aCA9IGZvb19lbHRzLnVzZWQgLSAxOworICBm b29fZWx0cy5jYWNoZXNbbnRoXS54ID0geDsKKyAgZm9vX2VsdHMuY2FjaGVzW250aF0uZnggPSBm eDsKKyAgZm9vX2VsdHMuY2FjaGVzW250aF0ueSA9IHk7CisgIGZvb19lbHRzLmNhY2hlc1tudGhd LmZ5ID0gZnk7CisgIGZvb19lbHRzLmNhY2hlc1tudGhdLmhwb3MgPSBocG9zOworICBmb29fZWx0 cy5jYWNoZXNbbnRoXS52cG9zID0gdnBvczsKKyAgZm9vX2VsdHMuY2FjaGVzW250aF0ud2QgPSB3 ZDsKKyAgZm9vX2VsdHMuY2FjaGVzW250aF0uaCA9IGg7CisgIGZvb19lbHRzLmNhY2h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ICAgICAgTUNfSEJBUiBhcyB0byBgbWMtcmVh bC1mYWtlLWN1cnNvcicuCisgICBNVUxUSVBMRV9DVVJTT1JTOiAgV2UgZG8gbm90IHVzZSB0aGlz IGZ1bmN0aW9uLgorICAgSE9SSVpPTlRBTF9SVUxFUjogIFdlIHdhbnQgYSB1bml2ZXJzYWwgRlkg Y29vcmRpbmF0ZSBmb3IgYSBsZXZlbCBydWxlci4KKyAgIFZFUlRJQ0FMX1JVTEVSIGFuZCBGSUxM X0NPTFVNTjogIFdlIHdhbnQgYW4gSCB0aGF0IGVuc3VyZXMgbm8gZ2FwIGJldHdlZW4gdGhlCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmV2aW91cy9uZXh0IGxpbmUuICBU aGUgRlggY29vcmRpbmF0ZSBpcyBzZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGVsc2V3aGVyZTogIGB3LT5jdXJzb3IueGAgLyBgbWMuZmNfeGAuICovCit2b2lkCittY19n ZXRfY3Vyc29yX2dlb21ldHJ5IChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4 ICptYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cs IGludCB4LCBpbnQgKmZ4LCBpbnQgeSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCAqZnks IGludCBocG9zLCBpbnQgdnBvcywgaW50ICpoLAorICAgICAgICAgICAgICAgICAgICAgICAgZW51 bSB0eXBlX29mX2N1cnNvciBjdXJzb3JfdHlwZSwgaW50IGN1cnNvcl93aWR0aCwKKyAgICAgICAg ICAgICAgICAgICAgICAgIGludCAqd2QpCit7CisgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSBtY19n ZXRfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywgaHBvcywgdnBvcyk7CisgIGlmIChnbHlw aCA9PSBOVUxMKQorICAgIHJldHVybjsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5E T1dfRlJBTUUgKHcpKTsKKyAgKmZ4ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywg eCk7CisgICpoID0gcm93LT52aXNpYmxlX2hlaWdodDsKKyAgLyogRG9uJ3QgbGV0IHRoZSBjdXJz b3IgZXhjZWVkIHRoZSBkaW1lbnNpb25zIG9mIHRoZSByb3csIHNvIHRoYXQKKyAgdGhlIHVwcGVy L2xvd2VyIHNpZGUgb2YgdGhlIGJveCBhcmVuJ3QgY2xpcHBlZC4gICovCisgIGludCB3X2hlYWRl cl9saW5lX2hlaWdodCA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICBpbnQgd190 ZXh0X2JvdHRvbV95ID0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpIC0gKmg7CisgIGlmICh5IDwg d19oZWFkZXJfbGluZV9oZWlnaHQpCisgICAgeworICAgICAgKmggPSBtYXggKCpoIC0gKHdfaGVh ZGVyX2xpbmVfaGVpZ2h0IC0geSkgKyAxLCAqaCk7CisgICAgICB5ID0gd19oZWFkZXJfbGluZV9o ZWlnaHQgLSAxOworICAgICAgLy8gZnByaW50ZiAoc3RkZXJyLCAiQ09ORElUSU9OICMgMVxuIik7 CisgICAgfQorICAgZWxzZSBpZiAoeSA+IHdfdGV4dF9ib3R0b21feSkKKyAgICAgeworICAgICAg ICpoICs9IHkgLSB3X3RleHRfYm90dG9tX3k7CisgICAgICAgeSA9IHdfdGV4dF9ib3R0b21feTsK KyAgICAgICAvLyBmcHJpbnRmIChzdGRlcnIsICJDT05ESVRJT04gIyAyXG4iKTsKKyAgICAgfQor ICAqZnkgPSBXSU5ET1dfVE9fRlJBTUVfUElYRUxfWSAodywgeSk7CisgIHN3aXRjaCAoY3Vyc29y X3R5cGUpCisgICAgeworICAgICAgY2FzZSBNQ19CQVI6CisgICAgICAgIHsKKyAgICAgICAgICBp ZiA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JhbWUpOworICBMaXNwX09iamVjdCBidWYgPSB3 LT5jb250ZW50czsKKyAgQ0hFQ0tfQlVGRkVSIChidWYpOworICBzdHJ1Y3QgYnVmZmVyICpiID0g WEJVRkZFUiAoYnVmKTsKKyAgaW50IHRleHRfYXJlYV93aWR0aCA9IHdpbmRvd19ib3hfd2lkdGgg KHcsIFRFWFRfQVJFQSk7CisgIHN0cnVjdCBnbHlwaF9yb3cgKmN1cnNvcl9yb3cgPSAody0+Y3Vy c29yLnZwb3MgIT0gLTEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1BVFJJ WF9ST1cgKGN1cnNvcl9tYXRyaXgsIHctPmN1cnNvci52cG9zKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiBOVUxMOworICBzdHJ1Y3QgZ2x5cGggKmN1cnNvcl9nbHlwaCA9ICh3 LT5jdXJzb3IudnBvcyAhPSAtMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IG1j X2dldF9jdXJzb3JfZ2x5cGggKHcsIGN1cnNvcl9tYXRyaXgsIGN1cnNvcl9yb3csCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5jdXJzb3Iu aHBvcywgdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBO VUxMOworICBib29sIGN1cnNvcl9hdF9mcmluZ2VfcCA9IChjdXJzb3JfZ2x5cGggPT0gTlVMTAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93ICE9IE5VTEwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gY3Vyc29yX3Jvdy0+ dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9y b3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgdy0+Y3Vyc29yLnggPT0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIHctPmN1cnNvci54ID09IGN1cnNvcl9yb3ctPnBpeGVsX3dpZHRoKTsKKyAg Ym9vbCBjdXJzb3JfYmV5b25kX2ZyaW5nZV9wID0gKGN1cnNvcl9nbHlwaCA9PSBOVUxMCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93ICE9IE5VTEwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID09IGN1cnNvcl9y b3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg IWN1cnNvcl9yb3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5lX3AKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHRleHRfYXJlYV93aWR0aAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0gY3Vyc29yX3Jvdy0+ cGl4ZWxfd2lkdGgpOworICBpbnQgZnJhbWVfY2hhcl93aWR0aCA9IEZSQU1FX0NPTFVNTl9XSURU SCAoZik7CisgIGludCB0ZW1wX2ZhY2VfaWQgPSBnbHlwaC0+ZmFjZV9pZDsKKyAgc3RydWN0IG1j X1JHQiBiYWNrZ3JvdW5kOworICBtY19zZXRfbHNsX2JnICh3LCB0ZW1wX2ZhY2VfaWQsICZiYWNr Z3JvdW5kKTsKKyAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3AgPSAob3BvaW50X3ggPT0gcmVsYXRp dmVfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfaHBvcyA9PSBocG9z CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF95ID09IGdseXBoLT55Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF92cG9zID09IHZwb3MpOworCisv KiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICBCRUdJTjog IENIQVJfR0xZUEggfCBHTFlQSExFU1NfR0xZUEggICAgICAgICAgICAgICAgICAqLworLyogLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tICovCisgIGlmIChnbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAg ICB8fCBnbHlwaC0+dHlwZSA9PSBHTFlQSExFU1NfR0xZUEgpCisgIHsKKyAgICBpZiAobWNfc3Rk ZXJyX3ApCisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICJcbiAlNSJwRCJkLyUtNWQg JTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4xZCAlNWQgJTRkICAlM2Qg ICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAor ICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAx KSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgKGdseXBoLT50eXBlID09IENIQVJfR0xZ UEgKKyAgICAgICAgID8gJ0MnCisgICAgICAgICA6ICdHJyksCisgICAgICAgIGdseXBoLT5jaGFy cG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0InCisg ICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAg ICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICA/ICcwJwor ICAgICAgICAgICAgICAgOiAnLScpKSksCisgICAgICAgICAgICAgIGdseXBoLT5waXhlbF93aWR0 aCwKKyAgICAgICAgZ2x5cGgtPnUuY2gsCisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAg ICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVf cCwKKyAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgZ2x5cGgtPnZwb3Ms IGdseXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nIChn bHlwaC0+dS5jaCkpOworICBzd2l0Y2ggKGFjdGlvbl90eXBlKQorICB7CisvKiAtLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgTVVMVElQTEVfQ1VSU09SUzogIENIQVJfR0xZ UEggfCBHTFlQSExFU1NfR0xZUEggICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tICovCisgICAgY2FzZSBNVUxUSVBMRV9DVVJTT1JTOgorICAgIHsKKyAgICAgIG1jX2hlbHBl ciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZw b3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBm b3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICBhY3RpdmVfcCwgTUNfR0xZ UEgsIGRyYXdfcCwgY2FjaGVfdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgSE9SSVpPTlRBTF9SVUxFUjogIENIQVJf R0xZUEggfCBHTFlQSExFU1NfR0xZUEggICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tICovCisgICAgY2FzZSBIT1JJWk9OVEFMX1JVTEVSOgorICAgIHsKKyAgICAgIGlmIChy ZWxhdGl2ZV94IDwgcm93LT5waXhlbF93aWR0aAorICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vy c29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2 ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1 cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAg ICAgICAgICAgICAgYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGNhY2hlX3R5cGUpOworICAg ICAgaWYgKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0g LSAxCisgICAgICAgICAgJiYgcmVsYXRpdmVfeCA8PSB4X2xpbWl0KQorICAgICAgICB7CisgICAg ICAgICAgaWYgKHJlbGF0aXZlX3ggPCByb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAg ICAgICAgZnggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgfQorICAgICAgICAg IG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnks IGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICB4X2xpbWl0IC0gcmVsYXRpdmVfeCwg aCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgIGZvcmVn cm91bmQsIGJhY2tncm91bmQsIGFjdGl2ZV9wLCBNQ19HTFlQSExFU1MsIGRyYXdfcCwKKyAgICAg ICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUpOworICAgICAgICB9CisgICAgICBicmVhazsKKyAg ICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgVkVSVElDQUxf UlVMRVI6ICBDSEFSX0dMWVBIIHwgR0xZUEhMRVNTX0dMWVBIICAgICAgICAgICAgICAgICAqLwor LyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBWRVJUSUNBTF9SVUxFUjoKKyAgICB7 CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoY3Vyc29yX2F0X2ZyaW5nZV9w CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT5jb250aW51ZWRf cCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9C QVJfQkFDS1NMQVNICisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJz b3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm ICFyb3ctPmNvbnRpbnVlZF9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJS T1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRf ZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+ dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93LT51c2VkW1RFWFRf QVJFQV0gIT0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJv dy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51 c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg b3BvaW50X3ggPj0gcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogKHp2X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g TUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0dM WVBIOworICAgICAgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJS T1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFS X1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JB Ul9CQUNLU0xBU0gKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFS CisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikK KyAgICAgICAgY3Vyc29yX3R5cGUgPSBNQ19SSUdIVF9GUklOR0VfQklUTUFQOworICAgICAgd2Qg PSAxOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gs IG9wb2ludF9meCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBj dXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAg ICAgICAgICAgICBhY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCBkcmF3X3AsIGNhY2hlX3R5cGUpOwor ICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAg ICAgICAgIEZJTExfQ09MVU1OOiAgQ0hBUl9HTFlQSCB8IEdMWVBITEVTU19HTFlQSCAgICAgICAg ICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgRklMTF9DT0xV TU46CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGdseXBoIC0g cm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAg ICAgICAgICAgICYmIGZjX3ggPj0gcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAg ICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgOiAoenZfcCkKKyAgICAgICAg ICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgOiAoIU5JTFAg KEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAg ICAgICAgICAgICAgICAmJiBvcG9pbnRfeSA9PSB5CisgICAgICAgICAgICAgICAgICAgICAgJiYg b3BvaW50X3Zwb3MgPT0gdnBvcykKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNT CisgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIHdkID0gMTsKKyAgICAgIG1j X2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmY19meCwgeSwgZnks IGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29y X3dpZHRoLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICBhY3RpdmVf cCwgZ2x5cGhfZmxhdm9yLCBkcmF3X3AsIGNhY2hlX3R5cGUpOworICAgICAgYnJlYWs7CisgICAg fQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgIH0KKyAgfQorLyogLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgIEVORDogIENIQVJfR0xZUEggfCBHTFlQ SExFU1NfR0xZUEggICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAq LworCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBCRUdJTjogIFNUUkVUQ0hfR0xZUEggICAgICAgICAgICAgICAgICAgICAgICAgICAqLwor LyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IFNUUkVU Q0hfR0xZUEgpCisgIHsKKyAgICBpZiAobWNfc3RkZXJyX3ApCisgICAgICBmcHJpbnRmIChzdGRl cnIsCisgICAgICAgICJcbiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2 eCAlNGQgJTEuMWQlMS4xZCAlNWQgJTRkICAlM2QgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5 cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9 PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAg ICAgICAgJ1MnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGds eXBoLT5vYmplY3QpCisgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgt Pm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+ b2JqZWN0KQorICAgICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAor ICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIDB1LAorICAgICAgICBnbHlwaC0+ ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgt PnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT54LCBnbHlwaC0+eSwgZ2x5cGgtPmhw b3MsIGdseXB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S0tLS0tLS0tLS0tLS0tLS0gKi8K KyAgICBjYXNlIEhPUklaT05UQUxfUlVMRVI6CisgICAgeworICAgICAgaWYgKHJlbGF0aXZlX3gg PCByb3ctPnBpeGVsX3dpZHRoCisgICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAg ICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5 LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUs IGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwKKyAgICAgICAgICAgICAgICAg ICBhY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwgY2FjaGVfdHlwZSk7CisgICAgICBpZiAoZ2x5 cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAg ICAgICAmJiByZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAo cmVsYXRpdmVfeCA8IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICByZWxhdGl2ZV94ICs9 IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICB0ZW1wX2ZhY2VfaWQgPSAocm93LT5maWxs X2xpbmVfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICA/IGdseXBoLT5mYWNlX2lkCisgICAg ICAgICAgICAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgc3RydWN0 IG1jX1JHQiBiYWNrZ3JvdW5kOworICAgICAgICAgIG1jX3NldF9sc2xfYmcgKHcsIHRlbXBfZmFj ZV9pZCwgJmJhY2tncm91bmQpOworICAgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3cs IGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAg ICAgICAgICB4X2xpbWl0IC0gcmVsYXRpdmVfeCwgaCwgY3Vyc29yX3R5cGUsIHhfbGltaXQgLSBy ZWxhdGl2ZV94LAorICAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwg YWN0aXZlX3AsIE1DX0dMWVBITEVTUywgZHJhd19wLAorICAgICAgICAgICAgICAgICAgICAgY2Fj aGVfdHlwZSk7CisgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgIFZFUlRJQ0FMX1JVTEVSOiAg U1RSRVRDSF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KKyAgICBjYXNlIFZFUlRJQ0FMX1JVTEVSOgorICAgIHsKKyAgICAgIGlmIChyb3ctPmZp bGxfbGluZV9wCisgICAgICAgICAgJiYgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09 IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiBvcG9pbnRfeCA+IHJlbGF0aXZlX3gg KyBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAgICAgIHRlbXBfZmFjZV9pZCA9IGdseXBoLT5mYWNl X2lkOworICAgICAgICBlbHNlIGlmICghcm93LT5maWxsX2xpbmVfcAorICAgICAgICAgICAgICAg ICAmJiBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0g MQorICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeCA+IHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4 ZWxfd2lkdGgpCisgICAgICAgICAgdGVtcF9mYWNlX2lkID0gREVGQVVMVF9GQUNFX0lEOworICAg ICAgc3RydWN0IG1jX1JHQiBiYWNrZ3JvdW5kOworICAgICAgbWNfc2V0X2xzbF9iZyAodywgdGVt cF9mYWNlX2lkLCAmYmFja2dyb3VuZCk7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2 b3IgPSAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPmNvbnRpbnVlZF9wCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVIK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2Vf cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0 ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBN Q19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJ R0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3Jf YmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0gIT0gMQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFS CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBITEVTUzsKKyAg ICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAg ICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9B UlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NM QVNICisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAg ICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAg IGN1cnNvcl90eXBlID0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUDsKKyAgICAgIHdkID0gMTsKKyAg ICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCBvcG9pbnRfeCwgb3BvaW50X2Z4 LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBl LCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAg IGFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgY2FjaGVfdHlwZSk7CisgICAgICBicmVh azsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAg ICAgICAgICAgRklMTF9DT0xVTU46ICBTVFJFVENIX0dMWVBIICAgICAgICAgICAgICAgICAgICAg ICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBGSUxMX0NPTFVNTjoKKyAg ICB7CisgICAgICBpZiAocm93LT5maWxsX2xpbmVfcAorICAgICAgICAgICYmIGdseXBoIC0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYg ZmNfeCA+IHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAgICAgIHRlbXBfZmFj ZV9pZCA9IGdseXBoLT5mYWNlX2lkOworICAgICAgICBlbHNlIGlmICghcm93LT5maWxsX2xpbmVf cAorICAgICAgICAgICAgICAgICAmJiBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0g cm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAmJiBmY194ID4gcmVsYXRpdmVf eCArIGdseXBoLT5waXhlbF93aWR0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LS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg QkVHSU46ICBJTUFHRV9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tICovCisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IElNQUdFX0dMWVBI KQorICB7CisgICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAg ICAgICAiXG4gJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNnggJTRkICUx LjFkJTEuMWQgJTVkICU0ZCAgJTNkICAlM2QgJXMgJWNcbiIsCisgICAgICAgIGdseXBoIC0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAw IDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdJ JywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2Jq ZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3Qp CisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkK KyAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAgICA6ICctJykpKSwKKyAgICAgICAg Z2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAodW5zaWduZWQgaW50KSBnbHlwaC0+dS5pbWdf aWQsCisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bG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gICAgICAgICAgSE9SSVpPTlRBTF9SVUxFUjogIElNQUdFX0dM WVBIICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAg ICBjYXNlIEhPUklaT05UQUxfUlVMRVI6CisgICAgeworICAgICAgY3Vyc29yX3R5cGUgPSBNQ19I T0xMT1dfQk9YOworICAgICAgaWYgKCFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hl bHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3Ms IHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lk dGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgICAgYWN0aXZlX3As IE1DX0dMWVBILCBkcmF3X3AsIGNhY2hlX3R5cGUpOworICAgICAgYnJlYWs7CisgICAgfQorLyog LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgIFZFUlRJ Q0FMX1JVTEVSOiAgSU1BR0VfR0xZUEggICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgVkVSVElDQUxfUlVMRVI6CisgICAgeworICAgICAg Y3Vyc29yX3R5cGUgPSBNQ19IT0xMT1dfQk9YOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgs IHJvdywgZ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0gKi8KKyAgfQorICB9CisvKiAtLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFTkQ6ICBJ TUFHRV9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tICovCisKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAg ICAgICAgICAgICAgQkVHSU46ICBDT01QT1NJVEVfR0xZUEggICAgICAgICAgICAgICAgICAgICAg ICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUg PT0gQ09NUE9TSVRFX0dMWVBIKQorICB7CisgICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAgewor ICAgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQg JWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4IiwKKyAgICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhz W1RFWFRfQVJFQV0sCisgICAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93 LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgICAnKycs CisgICAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5v YmplY3QpCisgICAgICAgICAgID8gJ0InCisgICAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5v YmplY3QpCisgICAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICAgIDogKE5JTFAgKGdseXBo LT5vYmplY3QpCisgICAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAgICAgIDogJy0n KSkpLAorICAgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgICAodW5zaWduZWQg aW50KSBnbHlwaC0+dS5jbXAuaWQpOworICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIgJTRkICUx LjFkJTEuMWQiLAorICAgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICAgIGdseXBoLT5s ZWZ0X2JveF9saW5lX3AsCisgICAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3ApOworICAg ICAgaWYgKGdseXBoLT51LmNtcC5hdXRvbWF0aWMpCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwg IiAlNWQgJTRkICAlM2QgICUzZCAlcyAuIFslZC0lZF1cbiIsCisgICAgICAgICAgICAgICAgICAg ICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgZ2x5cGgtPnZwb3MsIGdseXBo LT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGgtPnNs aWNlLmNtcC5mcm9tLCBnbHlwaC0+c2xpY2UuY21wLnRvKTsKKyAgICAgICAgZWxzZQorICAgICAg ICAgIGZwcmludGYgKHN0ZGVyciwgIlxuIik7CisgICAgICB9CisgIHN3aXRjaCAoYWN0aW9uX3R5 cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAg ICAgIE1VTFRJUExFX0NVUlNPUlM6ICBDT01QT1NJVEVfR0xZUEggICAgICAgICAgICAgICAgICAg ICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIE1VTFRJUExFX0NVUlNPUlM6 CisgICAgeworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZl X3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNv cl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAg ICAgICAgIGFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLCBjYWNoZV90eXBlKTsKKyAgICAgIGJy ZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAg ICAgICAgIEhPUklaT05UQUxfUlVMRVI6ICBDT01QT1NJVEVfR0xZUEggICAgICAgICAgICAgICAg ICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEhPUklaT05UQUxfUlVM RVI6CisgICAgeworICAgICAgaWYgKHJlbGF0aXZlX3ggPD0geF9saW1pdAorICAgICAgICAgICYm ICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3cs IGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAg ICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tn cm91bmQsCisgICAgICAgICAgICAgICAgICAgYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGNh Y2hlX3R5cGUpOworICAgICAgaWYgKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSBy b3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYgcmVsYXRpdmVfeCA8PSB4X2xpbWl0KQor ICAgICAgICB7CisgICAgICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7Cisg ICAgICAgICAgd2hpbGUgKHJlbGF0aXZlX3ggPD0geF9saW1pdCkKKyAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gs IGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICB3ZCwgaCwg Y3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICBhY3RpdmVfcCwgTUNfR0xZUEhMRVNTLCBkcmF3X3AsIGNhY2hl X3R5cGUpOworICAgICAgICAgICAgICByZWxhdGl2ZV94ICs9IGZyYW1lX2NoYXJfd2lkdGg7Cisg ICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgVkVSVElDQUxfUlVMRVI6 ICBDT01QT1NJVEVfR0xZUEggICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0gKi8KKyAgICBjYXNlIFZFUlRJQ0FMX1JVTEVSOgorICAgIHsKKyAgICAgIGVudW0gbWNf Zmxhdm9yIGdseXBoX2ZsYXZvciA9IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPmNvbnRpbnVlZF9wKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+Y29udGludWVk X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5j YXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAo Y3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmln aHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNF RF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXSAhPSAxCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25f cmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRVZF UlNFRF9WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog KGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeCA+PSByb3ct PnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1D X0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoenZfcCkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfR0xZUEg7CisgICAgICBpZiAo Z2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8 IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST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+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAm JiBmY194ID4gcmVsYXRpdmVfeCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNT CisgICAgICAgICAgICAgICAgICAgOiAoenZfcCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNf R0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgOiAoIU5JTFAgKEJWQVIgKGIsIGNyb3NzaGFp cnMpKQorICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAgICAmJiBv cG9pbnRfeSA9PSB5CisgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3Zwb3MgPT0gdnBv cykKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAg ICAgOiBNQ19HTFlQSDsKKyAgICAgIHdkID0gMTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4 LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmY19meCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAg ICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5k LCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICBhY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCBk cmF3X3AsIGNhY2hlX3R5cGUpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tICovCisgIH0KKyAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIEVORDogIENPTVBPU0lURV9HTFlQSCAgICAgICAgICAgICAg ICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworCisvKiAtLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCRUdJTjogIFhXSURH RVRfR0xZUEggICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tICovCisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IFhXSURHRVRfR0xZUEgpCisgIHsKKyNp Zm5kZWYgSEFWRV9YV0lER0VUUworICAgIGVhc3N1bWUgKGZhbHNlKTsKKyNlbHNlCisgICAgaWYg KG1jX3N0ZGVycl9wKQorICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiXG4gICU1ZC8l LTVkICU1ZCAlNGMgJTZkICVjICUzZCAweCUwNXggJTRkICUxLjFkJTEuMWQgJTVkICU0ZCAgJTNk ICAlM2QgJXMgJWNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwK KyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0g MSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdYJywKKyAgICAgICAgZ2x5cGgtPmNo YXJwb3M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sIGJhY2tncm91bmQsCisg ICAgICAgICAgICAgICAgIGFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLCBjYWNoZV90eXBlKTsK KyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAg ICAgICAgICAgICAgICAgICBIT1JJWk9OVEFMX1JVTEVSOiAgWFdJREdFVF9HTFlQSCAgICAgICAg ICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEhPUkla T05UQUxfUlVMRVI6CisgICAgeworICAgICAgaWYgKHJlbGF0aXZlX3ggPD0geF9saW1pdAorICAg ICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgbWF0 cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAg ICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91 bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgICAgYWN0aXZlX3AsIE1DX0dMWVBILCBk cmF3X3AsIGNhY2hlX3R5cGUpOworICAgICAgaWYgKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9B UkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYgcmVsYXRpdmVfeCA8PSB4 X2xpbWl0KQorICAgICAgICB7CisgICAgICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxf d2lkdGg7CisgICAgICAgICAgd2hpbGUgKHJlbGF0aXZlX3ggPD0geF9saW1pdCkKKyAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJl bGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAg ICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYmFja2dyb3Vu ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVfcCwgTUNfR0xZUEhMRVNTLCBkcmF3 X3AsIGNhY2hlX3R5cGUpOworICAgICAgICAgICAgICByZWxhdGl2ZV94ICs9IGZyYW1lX2NoYXJf d2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKy8q IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgIFZFUlRJ Q0FMX1JVTEVSOiAgWFdJREdFVF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIFZFUlRJQ0FMX1JVTEVSOgorICAgIHsKKyAgICAg IGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPmNvbnRpbnVlZF9wKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9CQUNL U0xBU0gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9m cmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+ Y29udGludWVkX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFy b3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2Vf cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0 ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBN Q19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXSAh PSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVu Y2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJl YV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRf eCA+PSByb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiAoenZfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQ SExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfR0xZUEg7Cisg ICAgICBpZiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAg ICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRf QVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tT TEFTSAorICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAg ICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAg ICBjdXJzb3JfdHlwZSA9IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA7CisgICAgICBtY19oZWxwZXIg KHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgb3BvaW50X2Z4LCB5LCBmeSwgaHBv cywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lk dGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgIGFjdGl2ZV9wLCBn bHlwaF9mbGF2b3IsIGRyYXdfcCwgY2FjaGVfdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9Cisv KiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgRklM TF9DT0xVTU46ICBYV0lER0VUX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICAqLworLyogLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBGSUxMX0NPTFVNTjoKKyAgICB7CisgICAgICBl bnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FS RUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAmJiBmY194 ID4gcmVsYXRpdmVfeCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAg ICAgICAgICAgICAgICAgOiAoenZfcCkKKyAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhM RVNTCisgICAgICAgICAgICAgICAgICAgOiAoIU5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKQor ICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRf eSA9PSB5CisgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3Zwb3MgPT0gdnBvcykKKyAg ICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgOiBN Q19HTFlQSDsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2 ZV94LCBmY19meCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBj dXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAg ICAgICAgICAgICBhY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCBkcmF3X3AsIGNhY2hlX3R5cGUpOwor ICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgIH0KKyAgfQor LyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBFTkQ6ICBYV0lER0VUX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLSAqLworfQorCit2b2lkCittY19kcmF3X3JvdyAoc3RydWN0IHdpbmRv dyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cs CisgICAgICAgICAgICAgc3RydWN0IGdseXBoICpzdGFydCwgaW50IHgsIGludCBocG9zX2xlbmd0 aCwgaW50IHZwb3MsCisgICAgICAgICAgICAgaW50IGJvdHRvbV92cG9zLCBib29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luZG93OworICBYU0VUV0lORE9XICh3aW5kb3csIHcp OworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgTGlzcF9PYmplY3Qg YnVmID0gdy0+Y29udGVudHM7CisgIENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgc3RydWN0IGJ1ZmZl ciAqYiA9IFhCVUZGRVIgKGJ1Zik7CisgIGludCBvcG9pbnRfZngsIG9wb2ludF9meSwgb3BvaW50 X3dkLCBvcG9pbnRfaDsKKyAgaW50IHRleHRfYXJlYV93aWR0aCA9IHdpbmRvd19ib3hfd2lkdGgg KHcsIFRFWFRfQVJFQSk7CisgIGludCBoZWFkZXJfbGluZV9mb3JtYXQgPSBXSU5ET1dfSEVBREVS X0xJTkVfSEVJR0hUICh3KTsKKyAgc3RydWN0IGdseXBoX3JvdyAqY3Vyc29yX3JvdyA9ICh3LT5j dXJzb3IudnBvcyAhPSAtMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUFU UklYX1JPVyAoY3Vyc29yX21hdHJpeCwgdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IE5VTEw7CisgIHN0cnVjdCBnbHlwaCAqY3Vyc29yX2dseXBoID0g KHctPmN1cnNvci52cG9zICE9IC0xKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g bWNfZ2V0X2N1cnNvcl9nbHlwaCAodywgY3Vyc29yX21hdHJpeCwgY3Vyc29yX3JvdywKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNv ci5ocG9zLCB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IE5VTEw7CisgIGJvb2wgY3Vyc29yX2F0X2ZyaW5nZV9wID0gKGN1cnNvcl9nbHlwaCA9PSBOVUxM CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3cgIT0gTlVMTAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBjdXJzb3Jfcm93 LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29y X3Jvdy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVfcAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5jdXJzb3IueCA9PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gY3Vyc29yX3Jvdy0+cGl4ZWxfd2lkdGgpOwor ICBib29sIGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AgPSAoY3Vyc29yX2dseXBoID09IE5VTEwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3cgIT0gTlVMTAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gY3Vyc29y X3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiAhY3Vyc29yX3Jvdy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVfcAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0gdGV4dF9hcmVhX3dpZHRoCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA+PSBjdXJzb3Jfcm93 LT5waXhlbF93aWR0aCk7CisgIC8vICBib29sIGNnX3AgPSBjdXJzb3JfZ2x5cGggPT0gTlVMTDsK KyAgLy8gIGJvb2wgY3JfcCA9IGN1cnNvcl9yb3cgIT0gTlVMTDsKKyAgLy8gIGJvb2wgY2hfY3J1 ID0gdy0+Y3Vyc29yLmhwb3MgPT0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdOworICAvLyAg Ym9vbCBjcmV3d2xfcCA9ICFjdXJzb3Jfcm93LT5leGFjdF93aW5kb3dfd2lkdGhfbGluZV9wOwor ICAvLyAgYm9vbCBjeF90YXdfcCA9IHctPmN1cnNvci54ID49IHRleHRfYXJlYV93aWR0aDsKKyAg Ly8gIGJvb2wgY3hfY3Jwd19wID0gdy0+Y3Vyc29yLnggPj0gY3Vyc29yX3Jvdy0+cGl4ZWxfd2lk dGg7CisgIC8vICBmcHJpbnRmIChzdGRlcnIsICJ2cG9zICglZCkgfCBocG9zICglZC8lZCkgfCBj dXJzb3IueCAoJWQpIHwgdGF3ICglZCkgfCB1c2VkICglZCkgfCBydF9wICglZClcblwKKyAgLy8g ICAgY2dfcCAoJWQpLCBjcl9wICglZCksIGNoX2NydSAoJWQpLCBjcmV3d2xfcCAoJWQpLCBjeF90 YXdfcCAoJWQpLCBjeF9jcnB3X3AgKCVkKVxuIiwKKyAgLy8gICAgdnBvcywgaHBvc19zdGFydCwg aHBvc19sZW5ndGgsIHctPmN1cnNvci54LCB0ZXh0X2FyZWFfd2lkdGgsIHJvdy0+dXNlZFtURVhU X0FSRUFdLCByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wLAorICAvLyAgICBjZ19wLCBjcl9wLCBj aF9jcnUsIGNyZXd3bF9wLCBjeF90YXdfcCwgY3hfY3Jwd19wKTsKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICBSRVBMQUNFIFRIRSBSRUFMIENVUlNP UgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisgIGVudW0gZmFjZV9pZCBiZ19mYWNlX2lkID0g KGN1cnNvcl9nbHlwaCAhPSBOVUxMKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gY3Vy c29yX2dseXBoLT5mYWNlX2lkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBERUZBVUxU X0ZBQ0VfSUQ7CisgIHN0cnVjdCBtY19SR0IgY3Vyc29yX2JnOworICBtY19zZXRfbHNsX2JnICh3 LCBiZ19mYWNlX2lkLCAmY3Vyc29yX2JnKTsKKyAgLyogRklYTUU6ICBQdXQgaW4gc29tZSBjb2Rl IHRvIGRlZmF1bHQgdG8gTUNfSE9MTE9XX0JPWCBpZiB0aGUgdXNlciBoYXMKKyAgdW53aXR0aW5n bHkgY29tZSB1cCB3aXRoIHNvbWUgdW5hY2NlcHRhYmxlIGZvcm0gb2YgdW5yZWNvZ25pemVkIGN1 cnNvciB0eXBlLiAqLworICBMaXNwX09iamVjdCBsaXNwX3R5cGUgPSBCVkFSIChiLCBtY19yZWFs X2Zha2VfY3Vyc29yKTsKKyAgZW51bSB0eXBlX29mX2N1cnNvciBjdXJzb3JfdHlwZSA9IChDT05T UCAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKFhDQVIgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBtY19saXNwX3RvX2N1cnNvcl90eXBlIChsaXNw X3R5cGUpOworICBpbnQgY3Vyc29yX3dpZHRoID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAg ICAgICAgICAgICAgICAgPyBYRklYTlVNIChYQ0FSIChYQ0RSIChsaXNwX3R5cGUpKSkKKyAgICAg ICAgICAgICAgICAgICAgIDogLTE7CisgIGVudW0gZmFjZV9pZCBjdXJzb3JfZmFjZV9pZCA9Cisg ICAgKCFhY3RpdmVfcAorICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMp LCBjaF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iAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA9PSBmY194Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIWN1cnNvcl9hdF9mcmluZ2VfcAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFjdXJzb3JfYmV5b25kX2ZyaW5nZV9wKTsK KyAgLyogRklYTUU6ICBEZXZpc2UgYSBzeXN0ZW0gc28gdGhhdCB0aGlzIG9ubHkgaGFwcGVucyBv bmNlIHBlciByb3cgd2hlbgorICBgaHBvc19sZW5ndGhgIGlzIGxlc3MgdGhhbiB0aGUgZW50aXJl IHJvdy4gKi8KKyAgaWYgKHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICYmICFOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgJiYgIU5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaG9yaXpvbnRhbF9ydWxlcikpKQorICAg IHsKKyAgICAgIC8qIGZyaW5nZSBiaXRtYXBzIHVzZSBmYWNlX2lkIHRvIHNldCB0aGUgZm9yZWdy b3VuZCBjb2xvci4gIFRoZSBvdmVybGF5LWFycm93CisgICAgICBpcyBwcmVzZW50bHkgdGhlIG9u bHkgc2l0dWF0aW9uIHdoZXJlIHRoZSBgYWN0aXZlX3BgIGFuZCBgbWluaW1hbF9wYCBhcmUKKyAg ICAgIHVzZWQgdG8gZGV0ZXJtaW5lIHRoZSBhcHBsaWNhYmxlIGZhY2VfaWQuICovCisgICAgICBz dHJ1Y3QgbWNfUkdCIGxzbF9mZyA9IHsucmVkID0gLTEuMCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIC5ncmVlbiA9IC0xLjAsCisgICAgICAgICAgICAgICAgICAgICAgIC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BTVBMRSAoYnVmZmVyLWxvY2FsKTogIChzZXRxIG1jLXJlYWwtZmFrZS1jdXJzb3IgbmlsLydu by8ibm8iKSAqLworICBlbHNlIGlmICghY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICYm IGN1cnNvcl9nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICYmIGN1cnNvcl90eXBlID09IE1DX05P X0NVUlNPUgorICAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAg ICYmIHctPmN1cnNvci5ocG9zID49IGhwb3Nfc3RhcnQKKyAgICAgICAgICAgJiYgdy0+Y3Vyc29y Lmhwb3MgPCBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGgpCisgICAgeworICAgICAgLyogV2hlbiBh IHVzZXIgaGFzIG5vdCBzcGVjaWZpZWQgYSB2YWx1ZSBmb3IgYG1jLXJlYWwtZmFrZS1jdXJzb3In LCBvciB0aGUKKyAgICAgIHZhbHVlIGlzIGBub2AgaW4gdGhlIGZvcm0gb2YgYSBzeW1ib2wgb3Ig c3RyaW5nLCB0aGVuIHRoZSBkZWZhdWx0IHdlIHVzZQorICAgICAgYW4gTUNfQkFSIGFuZCBhbiBN Q19IQkFSIC0tIGJvdGggaGF2aW5nIGEgY3Vyc29yX3dpZHRoIG9mIDEuICovCisgICAgICBtY19n ZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRf ZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF9m eSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBNQ19CQVIsIDEsICZvcG9pbnRfd2QpOworICAgICAgbWNfaGVs cGVyICh3LCBtYXRyaXgsIHJvdywgY3Vyc29yX2dseXBoLCB3LT5jdXJzb3IueCwgb3BvaW50X2Z4 LCB3LT5jdXJzb3IueSwKKyAgICAgICAgICAgICAgICAgb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBv cywgdy0+Y3Vyc29yLnZwb3MsIG9wb2ludF93ZCwgb3BvaW50X2gsCisgICAgICAgICAgICAgICAg IE1DX0JBUiwgMSwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsIGFjdGl2ZV9wLCBNQ19HTFlQSExFU1Ms CisgICAgICAgICAgICAgICAgIGRyYXdfcCwgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICA/IENIX0NBQ0hFCisgICAg ICAgICAgICAgICAgICAgICAgICAgOiBNQ19DQUNIRSk7CisgICAgICBtY19nZXRfY3Vyc29yX2dl b21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRfZngsIHctPmN1cnNv ci55LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF9meSwgdy0+Y3Vyc29y Lmhwb3MsIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBNQ19IQkFSLCAxLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0 cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vyc29y LnksCisgICAgICAgICAgICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNv ci52cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9oLAorICAgICAgICAgICAgICAgICBNQ19IQkFSLCAx LCBjdXJzb3JfZmcsIGN1cnNvcl9iZywgYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsCisgICAg ICAgICAgICAgICAgIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikp CisgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAgICAgICAgOiBNQ19DQUNI RSk7CisgICAgfQorICBlbHNlIGlmICghY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICYm IGN1cnNvcl9nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZw b3MKKyAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPj0gaHBvc19zdGFydAorICAgICAgICAg ICAmJiB3LT5jdXJzb3IuaHBvcyA8IGhwb3Nfc3RhcnQgKyBocG9zX2xlbmd0aAorICAgICAgICAg ICAmJiBjdXJzb3JfZ2x5cGgtPnR5cGUgIT0gU1RSRVRDSF9HTFlQSCkKKyAgICB7CisgICAgICBt Y19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9p bnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2lu dF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCAmb3BvaW50 X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+ Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAgICAgICAgIG9wb2lu dF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9o LAorICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBjdXJzb3JfZmcs IGN1cnNvcl9iZywgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgIE1DX0dMWVBILCBkcmF3X3As IE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiBNQ19DQUNIRSk7CisgICAgfQorICBlbHNlIGlmICghY3Vyc29yX2F0 X2ZyaW5nZV9wCisgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaCAhPSBOVUxMCisgICAgICAgICAg ICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3Mg Pj0gaHBvc19zdGFydAorICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA8IGhwb3Nfc3RhcnQg KyBocG9zX2xlbmd0aAorICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPnR5cGUgPT0gU1RSRVRD SF9HTFlQSCkKKyAgICB7CisgICAgICAvKiBJZiBhIHVzZXIgaGFzIHNldCBgeC1zdHJldGNoLWN1 cnNvcicgdG8gYSBub24tbmlsIHZhbHVlLCBoZS9zaGUgY2hvc2UgdG8KKyAgICAgIGhhdmUgYSBj dXJzb3IgdGhhdCBzcGFucyB0aGUgZW50aXJlIGxlbmd0aCBvZiB0aGUgU1RSRVRDSF9HTFlQSC4g Ki8KKyAgICAgIGlmICgheF9zdHJldGNoX2N1cnNvcl9wKQorICAgICAgICB7CisgICAgICAgICAg LyogVGhlIE1DX0hCQVIgc2hhbGwgaGF2ZSBhIGBjdXJzb3Jfd2lkdGhgIG9mIDEuICovCisgICAg ICAgICAgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeSAodywgbWF0cml4LCByb3csIHctPmN1cnNvci54 LCAmb3BvaW50X2Z4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNv ci55LCAmb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLCBNQ19IQkFSLCAxLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICZvcG9pbnRfd2QpOworICAgICAgICAgIG1jX2hl bHBlciAodywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9m eCwKKyAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci55LCBvcG9pbnRfZnksIHctPmN1cnNv ci5ocG9zLCB3LT5jdXJzb3IudnBvcywKKyAgICAgICAgICAgICAgICAgICAgIG9wb2ludF93ZCwg b3BvaW50X2gsIE1DX0hCQVIsIDEsIGN1cnNvcl9mZywgY3Vyc29yX2JnLAorICAgICAgICAgICAg ICAgICAgICAgYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsCisgICAgICAgICAgICAgICAgICAg ICBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAgICAg ICAgICAgICAgICAgPyBDSF9DQUNIRQorICAgICAgICAgICAgICAgICAgICAgOiBNQ19DQUNIRSk7 CisgICAgICAgIH0KKyAgICAgIG1jX2dldF9jdXJzb3JfZ2VvbWV0cnkgKHcsIG1hdHJpeCwgcm93 LCB3LT5jdXJzb3IueCwgJm9wb2ludF9meCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHctPmN1cnNvci55LCAmb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsIGN1cnNvcl90eXBlLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoLCAmb3BvaW50X3dkKTsK KyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29y LngsIG9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAgICAgICAgIG9wb2ludF9meSwg dy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9oLAorICAg ICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBjdXJzb3JfZmcsIGN1cnNv cl9iZywgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgIE1DX0dMWVBILCBkcmF3X3AsIE5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOiBNQ19DQUNIRSk7CisgICAgfQorLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisg ICAgICAgICAgICAgICAgICAgICAgICAgIERSQVcgQU5EIFJFQ09SRCBGQUtFIENVUlNPUlMKKyoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworICBpZiAoaHBvc19sZW5ndGggPT0gMSkKKyAgICB7Cisg ICAgICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQor ICAgICAgICB7CisgICAgICAgICAgLyogVGhlIHNwYWNlIGFwcGVuZGVkIHRvIGEgcm93IGVuZGlu ZyB3aXRoIGEgbmV3IGxpbmUKKyAgICAgICAgICBkb2VzIG5vdCBoYXZlIGEgYGdseXBoLT5jaGFy cG9zYCAoLTEsIDApIHRoYXQgd2UgY2FuCisgICAgICAgICAgdXNlIGZvciB0aGlzIHBhcnRpY3Vs YXIgYXBwbGljYXRpb24uICBXaGVuIHRoZXJlIGlzIGEKKyAgICAgICAgICBgYnVmZmVyLWRpc3Bs YXktdGFibGUnIGVudHJ5IHRoYXQgYXNzaWducyBhIHZpc2libGUKKyAgICAgICAgICBnbHlwaCB0 byBhIG5ldyBsaW5lLCB0aGVyZSBpcyBubyBwcm9ibGVtIGJlY2F1c2UgdGhhdAorICAgICAgICAg IGdseXBoIGhhcyBhIGBnbHlwaC0+Y2hhcnBvcycgdGhhdCB3ZSBjYW4gdXNlLiAgV2hlbgorICAg ICAgICAgIG5vIHZpc2libGUgRU9MIGdseXBoIGV4aXN0cywgd2UgdXNlIHRoZSBmb2xsb3dpbmcK KyAgICAgICAgICB0ZXN0OiAgdGhlIGFwcGVuZGVkIHNwYWNlIGhhcyBhIHBvc2l0aW9uIHRoYXQg aXMgb25lCisgICAgICAgICAgbGVzcyB0aGFuIHRoZSBlbmQgb2YgdGhlIG1hdHJpeCByb3cuICov CisgICAgICAgICAgaW50IGhwb3MgPSBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07Cisg ICAgICAgICAgc3RydWN0IGdseXBoICpwcmV2aW91c19nbHlwaCA9ICgwIDw9IGhwb3MgLSAxICYm IGhwb3MgLSAxIDwgcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIGhwb3MgLSAxCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTlVMTDsKKyAgICAgICAg ICBib29sIHNraXBfcCA9IChwcmV2aW91c19nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgcHJldmlvdXNfZ2x5cGgtPmNoYXJwb3MgPT0gTUFUUklYX1JPV19FTkRfQ0hB UlBPUyAocm93KSAtIDEpOworICAgICAgICAgIGludCBwb3NpbnQgPSAoc3RhcnQgLSByb3ctPmds eXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSkKKyAgICAgICAgICAg ICAgICAgICAgICAgPyBNQVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpIC0gMQorICAgICAgICAg ICAgICAgICAgICAgICA6IHN0YXJ0LT5jaGFycG9zOworICAgICAgICAgIExpc3BfT2JqZWN0IHNw ZWNzID0gbWNfYXNzb2MgKG1ha2VfZml4bnVtIChwb3NpbnQpLCBCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIG1jX2NvbmYpKTsKKyAgICAgICAgICBpZiAoKChoZWFkZXJfbGluZV9mb3JtYXQg PiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09 IDApCisgICAgICAgICAgICAgICYmICFOSUxQIChzcGVjcykKKyAgICAgICAgICAgICAgJiYgc3Rh cnQtPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICYmICFza2lw X3AKKyAgICAgICAgICAgICAgJiYgIXN0YXJ0LT56dl9wKQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBMaXNwX09iamVjdCBsaXNwX3R5cGUgPSBtY19udGggKDEsIHNwZWNzKTsKKyAgICAg ICAgICAgICAgZW51bSB0eXBlX29mX2N1cnNvciBjdXJzb3JfdHlwZSA9IChDT05TUCAobGlzcF90 eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g bWNfbGlzcF90b19jdXJzb3JfdHlwZSAoWENBUiAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogbWNfbGlzcF90b19jdXJzb3JfdHlw ZSAobGlzcF90eXBlKTsKKyAgICAgICAgICAgICAgY3Vyc29yX3R5cGUgPSAoc3RhcnQtPnR5cGUg PT0gSU1BR0VfR0xZUEgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19IT0xMT1df Qk9YCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBjdXJzb3JfdHlwZTsKKyAgICAgICAg ICAgICAgaW50IGN1cnNvcl93aWR0aCA9IChDT05TUCAobGlzcF90eXBlKSkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gWEZJWE5VTSAoWENBUiAoWENEUiAobGlzcF90eXBlKSkp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IC0xOworICAgICAgICAgICAgICBM aXNwX09iamVjdCBtY19mb3JlZ3JvdW5kID0gbWNfbnRoICgyLCBzcGVjcyk7CisgICAgICAgICAg ICAgIHN0cnVjdCBtY19SR0IgZm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgaWYgKFNUUklOR1Ag KG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgIG1jX3h3X2NvbG9yX3ZhbHVlcyAodywg bWNfZm9yZWdyb3VuZCwgJmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKFZF Q1RPUlAgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgICBkb3VibGUgcmVkX2ZnID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQs IDApKTsKKyAgICAgICAgICAgICAgICAgICAgZG91YmxlIGdyZWVuX2ZnID0gWEZMT0FUX0RBVEEg KEFSRUYgKG1jX2ZvcmVncm91bmQsIDEpKTsKKyAgICAgICAgICAgICAgICAgICAgZG91YmxlIGJs dWVfZmcgPSBYRkxPQVRfREFUQSAoQVJFRiAobWNfZm9yZWdyb3VuZCwgMikpOworICAgICAgICAg ICAgICAgICAgICBmb3JlZ3JvdW5kLnJlZCA9IHJlZF9mZzsKKyAgICAgICAgICAgICAgICAgICAg Zm9yZWdyb3VuZC5ncmVlbiA9IGdyZWVuX2ZnOworICAgICAgICAgICAgICAgICAgICBmb3JlZ3Jv dW5kLmJsdWUgPSBibHVlX2ZnOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAg ICAgZWxzZSBpZiAoTklMUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kLnJlZCA9IGNoX2ZvcmVncm91bmQucmVk OworICAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQuZ3JlZW4gPSBjaF9mb3JlZ3JvdW5k LmdyZWVuOworICAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQuYmx1ZSA9IGNoX2ZvcmVn cm91bmQuYmx1ZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBpbnQgdnBv cyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAgICAgICAgICAgICBpbnQgeF9s aW1pdCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAgICAgICAgICAgIG1j X2VuZ2luZSAodywgbWF0cml4LCByb3csIHN0YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGltaXQsIHJv dy0+eSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRf QVJFQV0sIHZwb3MsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNv cl93aWR0aCwgY3Vyc29yX21hdHJpeCwgZmNfeCwgZm9yZWdyb3VuZCwgYWN0aXZlX3AsCisgICAg ICAgICAgICAgICAgICAgICAgICAgTVVMVElQTEVfQ1VSU09SUywgZHJhd19wLCBNQ19DQUNIRSk7 CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGlmICghTklMUCAoQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAmJiBmY194IDw9IHRleHRf YXJlYV93aWR0aAorICAgICAgICAgICYmIGZjX3ggPj0gdy0+bWMubG51bV9waXhlbF93aWR0aCkK KyAgICAgICAgeworICAgICAgICAgIGludCB4X2xpbWl0ID0geCArIHN0YXJ0LT5waXhlbF93aWR0 aDsKKyAgICAgICAgICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9ICh3LT5jdXJzb3IueCA9PSBm Y194CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnkg PT0gc3RhcnQtPnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5j dXJzb3IuaHBvcyA9PSBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0KKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IudnBvcyA9PSB2cG9zKTsKKyAg ICAgICAgICBpZiAoeCArIHN0YXJ0LT5waXhlbF93aWR0aCA8PSB0ZXh0X2FyZWFfd2lkdGgKKyAg ICAgICAgICAgICAgJiYgKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAg ICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAg ICYmICgoZmNfeCA+PSB4CisgICAgICAgICAgICAgICAgICAgJiYgZmNfeCA8IHggKyBzdGFydC0+ cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICB8fCBzdGFydCA9PSByb3ctPmdseXBoc1tU RVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKQorICAgICAgICAgICAgICAmJiBz dGFydC0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAgICAgJiYgIXJl YWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3cs IHN0YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGltaXQsIHJvdy0+eSwKKyAgICAgICAgICAgICAgICAg ICAgICAgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLCB2cG9zLCBNQ19CQVIsIDEsCisg ICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGZjX3gsIGZjX2ZvcmVncm91bmQs IGFjdGl2ZV9wLCBGSUxMX0NPTFVNTiwKKyAgICAgICAgICAgICAgICAgICAgICAgZHJhd19wLCBG Q19DQUNIRSk7CisgICAgICAgIH0KKyAgICAgIGlmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hf aG9yaXpvbnRhbF9ydWxlcikpCisgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcykK KyAgICAgICAgeworICAgICAgICAgIGludCB4X2xpbWl0ID0gKHN0YXJ0ID09IHJvdy0+Z2x5cGhz W1RFWFRfQVJFQV0gKyByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpCisgICAgICAgICAgICAgICAg ICAgICAgICA/IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgOiB4ICsg c3RhcnQtPnBpeGVsX3dpZHRoOworICAgICAgICAgIC8qIFByZXNlcnZlIHN1cHBvcnQgZm9yIGRl ZmF1bHQgYmVoYXZpb3Igc3VjaCB0aGF0IGEgdXNlciBtYXkKKyAgICAgICAgICBzcGVjaWZ5IHRo ZSBoZWlnaHQgb2YgYW4gTUNfSEJBUiwgd2hpY2ggYmVnaW5zIGl0cyBqb3VybmV5CisgICAgICAg ICAgYXMgdGhlIGBjdXJzb3Jfd2lkdGgnLiAgYG1jX2dldF9jdXJzb3JfZ2VvbWV0cnknIHJlYWRq dXN0cy4gKi8KKyAgICAgICAgICBtY19lbmdpbmUgKHcsIG1hdHJpeCwgcm93LCBzdGFydCwgVEVY VF9BUkVBLCB4LCB4X2xpbWl0LCByb3ctPnksCisgICAgICAgICAgICAgICAgICAgICBzdGFydCAt IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sIHZwb3MsIE1DX0hCQVIsIDEsCisgICAgICAgICAgICAg ICAgICAgICBjdXJzb3JfbWF0cml4LCBmY194LCBjaF9mb3JlZ3JvdW5kLCBhY3RpdmVfcCwKKyAg ICAgICAgICAgICAgICAgICAgIEhPUklaT05UQUxfUlVMRVIsIGRyYXdfcCwgQ0hfQ0FDSEUpOwor ICAgICAgICB9CisgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg Y3Jvc3NoYWlycykpCisgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1 bGVyKSkKKyAgICAgICAgICAmJiAhZmlsbF9jb2x1bW5fdHJ1bXBzX3ApCisgICAgICAgIHsKKyAg ICAgICAgICBjdXJzb3JfdHlwZSA9IChzdGFydC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkKKyAgICAg ICAgICAgICAgICAgICAgICAgID8gTUNfSE9MTE9XX0JPWAorICAgICAgICAgICAgICAgICAgICAg ICAgOiBNQ19CQVI7CisgICAgICAgICAgaW50IHhfbGltaXQgPSB3aW5kb3dfYm94X3dpZHRoICh3 LCBURVhUX0FSRUEpOworICAgICAgICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKHctPmN1 cnNvci55ID09IHN0YXJ0LT55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgdy0+Y3Vyc29yLnZwb3MgPT0gdnBvcyk7CisgICAgICAgICAgaWYgKCgoaGVhZGVyX2xpbmVf Zm9ybWF0ID4gMCAmJiB2cG9zID4gMCkKKyAgICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zv cm1hdCA9PSAwKQorICAgICAgICAgICAgICAmJiAoKHctPmN1cnNvci54ID49IHgKKyAgICAgICAg ICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA8IHggKyBzdGFydC0+cGl4ZWxfd2lkdGgpCisgICAg ICAgICAgICAgICAgICB8fCBzdGFydCA9PSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51 c2VkW1RFWFRfQVJFQV0gLSAxKQorICAgICAgICAgICAgICAmJiBzdGFydC0+eSA8PSB3aW5kb3df dGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkK KyAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIHN0YXJ0LCBURVhUX0FSRUEs IHgsIHhfbGltaXQsIHJvdy0+eSwKKyAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgLSByb3ct PmdseXBoc1tURVhUX0FSRUFdLCB2cG9zLCBjdXJzb3JfdHlwZSwgMSwKKyAgICAgICAgICAgICAg ICAgICAgICAgY3Vyc29yX21hdHJpeCwgZmNfeCwgY2hfZm9yZWdyb3VuZCwgYWN0aXZlX3AsCisg ICAgICAgICAgICAgICAgICAgICAgIFZFUlRJQ0FMX1JVTEVSLCBkcmF3X3AsIENIX0NBQ0hFKTsK KyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgICB7CisgICAgICAgIGludCByZWxhdGl2 ZV94ID0gMDsKKyAgICAgICAgZm9yIChpbnQgYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFyZWEg PCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5 cGggKmdseXBoID0gcm93LT5nbHlwaHNbYXJlYV07CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGgg KmdseXBoX2VuZCA9IGdseXBoICsgcm93LT51c2VkW2FyZWFdOworICAgICAgICAgICAgLyogR2x5 cGggZm9yIGEgbGluZSBlbmQgaW4gdGV4dC4gKi8KKyAgICAgICAgICAgIGlmIChhcmVhID09IFRF WFRfQVJFQSAmJiBnbHlwaCA9PSBnbHlwaF9lbmQgJiYgZ2x5cGgtPmNoYXJwb3MgPiAwKQorICAg ICAgICAgICAgICArK2dseXBoX2VuZDsKKyAgICAgICAgICAgIGZvciAoOyBnbHlwaCA8IGdseXBo X2VuZDsgKytnbHlwaCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmICh2cG9z ICE9IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICAgICAgICAgICYmIGdseXBoICE9IGdseXBo X2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgJiYgZmNfeCA8IHJlbGF0aXZlX3gKKyAgICAg ICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPCByZWxhdGl2ZV94CisgICAgICAgICAgICAg ICAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQor ICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgaWYgKCFOSUxQIChCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkKKyAgICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgICAgLyogVGhlIHNwYWNlIGFwcGVuZGVkIHRvIGEgcm93IGVuZGlu ZyB3aXRoIGEgbmV3IGxpbmUgZG9lcworICAgICAgICAgICAgICAgICAgICBub3QgaGF2ZSBhIGBn bHlwaC0+Y2hhcnBvc2AgKC0xLCAwKSB0aGF0IHdlIGNhbiB1c2UgZm9yIHRoaXMKKyAgICAgICAg ICAgICAgICAgICAgcGFydGljdWxhciBhcHBsaWNhdGlvbi4gIFdoZW4gYSBgYnVmZmVyLWRpc3Bs YXktdGFibGUnIGVudHJ5CisgICAgICAgICAgICAgICAgICAgIGFzc2lnbnMgYSB2aXNpYmxlIGds eXBoIHRvIGEgbmV3IGxpbmUsIHRoZXJlIGlzIG5vIHByb2JsZW0KKyAgICAgICAgICAgICAgICAg ICAgYmVjYXVzZSB0aGF0IGdseXBoIGhhcyBhIGBnbHlwaC0+Y2hhcnBvcycgdGhhdCB3ZSBjYW4g dXNlLgorICAgICAgICAgICAgICAgICAgICBXaGVuIG5vIHZpc2libGUgRU9MIGdseXBoIGV4aXN0 cywgd2UgdXNlIHRoZSBmb2xsb3dpbmcgdGVzdDoKKyAgICAgICAgICAgICAgICAgICAgdGhlIGFw cGVuZGVkIHNwYWNlIGhhcyBhIHBvc2l0aW9uIHRoYXQgaXMgb25lIGxlc3MgdGhhbiB0aGUKKyAg ICAgICAgICAgICAgICAgICAgZW5kIG9mIHRoZSBtYXRyaXggcm93LiAqLworICAgICAgICAgICAg ICAgICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAg ICAgICAgICAgICAgICAgc3RydWN0IGdseXBoICpwcmV2aW91c19nbHlwaCA9ICgwIDw9IGhwb3Mg LSAxICYmIGhwb3MgLSAxIDwgcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IHJvdy0+Z2x5cGhzW1RFWFRfQVJF QV0gKyBocG9zIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOiBOVUxMOworICAgICAgICAgICAgICAgICAgICBib29sIHNraXBfcCA9IChwcmV2 aW91c19nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IHByZXZpb3VzX2dseXBoLT5jaGFycG9zID09IE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykg LSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyB0cnVlCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogV2hlbiBhIGBidWZmZXItZGlzcGxheS10YWJs ZScgZW50cnkgY29udGFpbnMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhIHZp c2libGUgdGFiIGNoYXJhY3RlciAoIsK7IiksIHRoZSBzdWJzZXF1ZW50CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgU1RSRVRDSF9HTFlQSCB3aWxsIGhhdmUgdGhlIHNhbWUgZ2x5 cGgtPmNoYXJwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcyB0aGUgYWZv cmVtZW50aW9uZWQgdmlzaWJsZSB0YWIgY2hhcmFjdGVyLiAqLworICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogKHByZXZpb3VzX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiBwcmV2aW91c19nbHlwaC0+Y2hhcnBvcyA9PSBnbHlw aC0+Y2hhcnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gdHJ1ZQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogZmFsc2U7CisgICAgICAgICAgICAg ICAgICAgIGludCBwb3NpbnQgPSAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJv dy0+dXNlZFthcmVhXSAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1B VFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IGdseXBoLT5jaGFycG9zOworICAgICAgICAgICAgICAgICAgICBMaXNwX09iamVj dCBzcGVjcyA9IG1jX2Fzc29jIChtYWtlX2ZpeG51bSAocG9zaW50KSwgQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBtY19jb25mKSk7CisgICAgICAgICAgICAgICAgICAgIGlmICgoKGhlYWRl cl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICAgICAgICAgICAg fHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAh TklMUCAoc3BlY3MpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaC0+eSA8PSB3aW5k b3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICFza2lwX3AK KyAgICAgICAgICAgICAgICAgICAgICAgICYmICFnbHlwaC0+enZfcCkKKyAgICAgICAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBMaXNwX09iamVjdCBsaXNwX3R5cGUg PSBtY19udGggKDEsIHNwZWNzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gdHlwZV9v Zl9jdXJzb3IgY3Vyc29yX3R5cGUgPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY19saXNwX3Rv X2N1cnNvcl90eXBlIChYQ0FSIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogbWNfbGlzcF90b19jdXJzb3JfdHlw ZSAobGlzcF90eXBlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlID0gKGds eXBoLT50eXBlID09IElNQUdFX0dMWVBIKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IE1DX0hPTExPV19CT1gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiBjdXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBjdXJzb3Jf d2lkdGggPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBYRklYTlVNIChYQ0FSIChYQ0RSIChsaXNwX3R5cGUpKSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IC0xOworICAgICAgICAgICAg ICAgICAgICAgICAgTGlzcF9PYmplY3QgbWNfZm9yZWdyb3VuZCA9IG1jX250aCAoMiwgc3BlY3Mp OworICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBmb3JlZ3JvdW5kOworICAg ICAgICAgICAgICAgICAgICAgICAgaWYgKFNUUklOR1AgKG1jX2ZvcmVncm91bmQpKQorICAgICAg ICAgICAgICAgICAgICAgICAgICBtY194d19jb2xvcl92YWx1ZXMgKHcsIG1jX2ZvcmVncm91bmQs ICZmb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoVkVDVE9S UCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgZG91YmxlIHJlZF9mZyA9IFhGTE9BVF9EQVRBIChBUkVG IChtY19mb3JlZ3JvdW5kLCAwKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3Vi bGUgZ3JlZW5fZmcgPSBYRkxPQVRfREFUQSAoQVJFRiAobWNfZm9yZWdyb3VuZCwgMSkpOworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgZG91YmxlIGJsdWVfZmcgPSBYRkxPQVRfREFUQSAo QVJFRiAobWNfZm9yZWdyb3VuZCwgMikpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg Zm9yZWdyb3VuZC5yZWQgPSByZWRfZmc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBm b3JlZ3JvdW5kLmdyZWVuID0gZ3JlZW5fZmc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBmb3JlZ3JvdW5kLmJsdWUgPSBibHVlX2ZnOworICAgICAgICAgICAgICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChOSUxQIChtY19mb3JlZ3Jv dW5kKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBmb3JlZ3JvdW5kLnJlZCA9IGNoX2ZvcmVncm91bmQucmVkOworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZC5ncmVlbiA9IGNoX2ZvcmVncm91bmQuZ3Jl ZW47CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kLmJsdWUgPSBjaF9m b3JlZ3JvdW5kLmJsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgICAgICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsK KyAgICAgICAgICAgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0aCAo dywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0 cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICB4X2xpbWl0LCByb3ctPnksIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9B UkVBXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdnBvcywgY3Vyc29yX3R5 cGUsIGN1cnNvcl93aWR0aCwgY3Vyc29yX21hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgZmNfeCwgZm9yZWdyb3VuZCwgYWN0aXZlX3AsIE1VTFRJUExFX0NVUlNPUlMs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdfcCwgTUNfQ0FDSEUpOwor ICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAg ICAgICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkp CisgICAgICAgICAgICAgICAgICAgICYmIGZjX3ggPD0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAg ICAgICAgICAgICAgICYmIGZjX3ggPj0gdy0+bWMubG51bV9waXhlbF93aWR0aCkKKyAgICAgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaW50IHhfbGltaXQgPSB3aW5kb3dfYm94 X3dpZHRoICh3LCBURVhUX0FSRUEpOworICAgICAgICAgICAgICAgICAgICBib29sIHJlYWxfZmFr ZV9jdXJzb3JfcCA9ICh3LT5jdXJzb3IueCA9PSBmY194CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci55ID09IGdseXBoLT55CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci5o cG9zID09IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IudnBvcyA9PSB2cG9zKTsK KyAgICAgICAgICAgICAgICAgICAgaW50IGhwb3MgPSBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRf QVJFQV07CisgICAgICAgICAgICAgICAgICAgIGlmIChocG9zID49IGhwb3Nfc3RhcnQKKyAgICAg ICAgICAgICAgICAgICAgICAgICYmIGhwb3MgPCBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGgKKyAg ICAgICAgICAgICAgICAgICAgICAgICYmIHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGgg PD0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoKGhlYWRlcl9s aW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg fHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAo KGdseXBoICE9IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg ZmNfeCA+PSByZWxhdGl2ZV94CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGZjX3gg PCByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHx8IChnbHlwaCA9PSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIGZjX3ggPj0gcmVsYXRpdmVfeCkpCisgICAgICAgICAgICAgICAgICAgICAg ICAmJiBnbHlwaC0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAgICAg ICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgICAgICAgICAgICAgICAg bWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIGFyZWEsIHJlbGF0aXZlX3gsIHhfbGlt aXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb3ctPnksIGhwb3MsIHZwb3Ms IE1DX0JBUiwgMSwgY3Vyc29yX21hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGZjX3gsIGZjX2ZvcmVncm91bmQsIGFjdGl2ZV9wLCBGSUxMX0NPTFVNTiwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdfcCwgRkNfQ0FDSEUpOworICAgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgICAgIGlmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIg KGIsIGNoX2hvcml6b250YWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAmJiB2cG9zID09 IHctPmN1cnNvci52cG9zKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg ICBpbnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAgICAg ICAgICAgICAgICAgIGludCBocG9zID0gZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdOwor ICAgICAgICAgICAgICAgICAgICAvKiBQcmVzZXJ2ZSBzdXBwb3J0IGZvciBkZWZhdWx0IGJlaGF2 aW9yIHN1Y2ggdGhhdCBhIHVzZXIgbWF5CisgICAgICAgICAgICAgICAgICAgIHNwZWNpZnkgdGhl IGhlaWdodCBvZiBhbiBNQ19IQkFSLCB3aGljaCBiZWdpbnMgaXRzIGpvdXJuZXkKKyAgICAgICAg ICAgICAgICAgICAgYXMgdGhlIGBjdXJzb3Jfd2lkdGgnLiAgYG1jX2dldF9jdXJzb3JfZ2VvbWV0 cnknIHJlYWRqdXN0cy4gKi8KKyAgICAgICAgICAgICAgICAgICAgaWYgKGhwb3MgPj0gaHBvc19z dGFydAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA8IGhwb3Nfc3RhcnQgKyBocG9z X2xlbmd0aCkKKyAgICAgICAgICAgICAgICAgICAgICBtY19lbmdpbmUgKHcsIG1hdHJpeCwgcm93 LCBnbHlwaCwgYXJlYSwgcmVsYXRpdmVfeCwgeF9saW1pdCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHJvdy0+eSwgaHBvcywgdnBvcywgTUNfSEJBUiwgMSwgY3Vyc29yX21hdHJp eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZjX3gsIGNoX2ZvcmVncm91bmQs IGFjdGl2ZV9wLCBIT1JJWk9OVEFMX1JVTEVSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgZHJhd19wLCBDSF9DQUNIRSk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAg ICAgICAgaWYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMp KQorICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVs ZXIpKQorICAgICAgICAgICAgICAgICAgICAmJiAhZmlsbF9jb2x1bW5fdHJ1bXBzX3ApCisgICAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlID0gKGdseXBo LT50eXBlID09IElNQUdFX0dMWVBIKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gTUNfSE9MTE9XX0JPWAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNf QkFSOworICAgICAgICAgICAgICAgICAgICBpbnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGgg KHcsIFRFWFRfQVJFQSk7CisgICAgICAgICAgICAgICAgICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNv cl9wID0gKHctPmN1cnNvci55ID09IGdseXBoLT55CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci52cG9zID09IHZwb3MpOworICAgICAg ICAgICAgICAgICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsK KyAgICAgICAgICAgICAgICAgICAgaWYgKGhwb3MgPj0gaHBvc19zdGFydAorICAgICAgICAgICAg ICAgICAgICAgICAgJiYgaHBvcyA8IGhwb3Nfc3RhcnQgKyBocG9zX2xlbmd0aAorICAgICAgICAg ICAgICAgICAgICAgICAgJiYgKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQor ICAgICAgICAgICAgICAgICAgICAgICAgJiYgKChnbHlwaCAhPSBnbHlwaF9lbmQgLSAxCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHJlbGF0aXZlX3gKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPCByZWxhdGl2ZV94ICsg Z2x5cGgtPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChnbHlw aCA9PSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHct PmN1cnNvci54ID49IHJlbGF0aXZlX3gpKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5 cGgtPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICAgICAgICAg ICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAgICAgICAgICAgICAgIG1jX2VuZ2lu ZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4X2xpbWl0LAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT55LCBocG9zLCB2cG9zLCBjdXJzb3Jf dHlwZSwgMSwgY3Vyc29yX21hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGZjX3gsIGNoX2ZvcmVncm91bmQsIGFjdGl2ZV9wLCBWRVJUSUNBTF9SVUxFUiwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdfcCwgQ0hfQ0FDSEUpOworICAgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRo OworICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgfQorICAvLyAgY2xvY2tfdCBj bG9ja19lbmQgPSBjbG9jaygpOworICAvLyAgZG91YmxlIGNwdV90aW1lX3VzZWQgPSAoKGRvdWJs ZSkgKGNsb2NrX2VuZCAtIGNsb2NrX3N0YXJ0KSkgLyBDTE9DS1NfUEVSX1NFQzsKKyAgLy8gIGZw cmludGYgKHN0ZGVyciwgIm1jX2RyYXdfcm93ICglcyk6ICBUSU1FICglZilcbiIsIG1jX3dpbmRv dyAodyksIGNwdV90aW1lX3VzZWQpOworfQorCit2b2lkCittY19yZWRyYXdfaGVscGVyIChzdHJ1 Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsIHN0cnVjdCBnbHlwaF9y b3cgKnJvdywKKyAgICAgICAgICAgICAgICAgIGVudW0gdHlwZV9vZl9jYWNoZSBjYWNoZV90eXBl LCBpbnQgc3RhcnRfaHBvcywgaW50IGVuZF9ocG9zKQoreworICBpbnQgcm93X3Zwb3MgPSBNQVRS SVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgc3RydWN0IG11bHRpcGxlX2N1cnNvcnNfY2Fj aGUgZm9vX2VsdHM7CisgIHN3aXRjaCAoY2FjaGVfdHlwZSkKKyAgICB7CisgICAgICBjYXNlIE5P X0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGNh c2UgTUNfQ0FDSEU6CisgICAgICAgIHsKKyAgICAgICAgICBmb29fZWx0cy5jYWNoZXMgPSB3LT5t Y19lbHRzLmNhY2hlczsKKyAgICAgICAgICBmb29fZWx0cy5hbGxvY2F0ZWQgPSB3LT5tY19lbHRz LmFsbG9jYXRlZDsKKyAgICAgICAgICBmb29fZWx0cy51c2VkID0gdy0+bWNfZWx0cy51c2VkOwor ICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBjYXNlIENIX0NBQ0hFOgorICAgICAg ICB7CisgICAgICAgICAgZm9vX2VsdHMuY2FjaGVzID0gdy0+Y2hfZWx0cy5jYWNoZXM7CisgICAg ICAgICAgZm9vX2VsdHMuYWxsb2NhdGVkID0gdy0+Y2hfZWx0cy5hbGxvY2F0ZWQ7CisgICAgICAg ICAgZm9vX2VsdHMudXNlZCA9IHctPmNoX2VsdHMudXNlZDsKKyAgICAgICAgICBicmVhazsKKyAg ICAgICAgfQorICAgICAgY2FzZSBGQ19DQUNIRToKKyAgICAgICAgeworICAgICAgICAgIGZvb19l bHRzLmNhY2hlcyA9IHctPmZjX2VsdHMuY2FjaGVzOworICAgICAgICAgIGZvb19lbHRzLmFsbG9j YXRlZCA9IHctPmZjX2VsdHMuYWxsb2NhdGVkOworICAgICAgICAgIGZvb19lbHRzLnVzZWQgPSB3 LT5mY19lbHRzLnVzZWQ7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisgIC8q IFNUUkVUQ0hfR0xZUEggbWF5IGNvbnRhaW4gbW9yZSB0aGFuIG9uZSBmYWtlIGN1cnNvciBhdCB0 aGUgc2FtZSBIUE9TLiAqLworICBmb3IgKGludCBlbHQgPSAwOyBlbHQgPCBmb29fZWx0cy51c2Vk OyArK2VsdCkKKyAgICB7CisgICAgICBpbnQgeCA9IGZvb19lbHRzLmNhY2hlc1tlbHRdLng7Cisg ICAgICBpbnQgZnggPSBmb29fZWx0cy5jYWNoZXNbZWx0XS5meDsKKyAgICAgIGludCB5ID0gZm9v X2VsdHMuY2FjaGVzW2VsdF0ueTsKKyAgICAgIGludCBmeSA9IGZvb19lbHRzLmNhY2hlc1tlbHRd LmZ5OworICAgICAgaW50IGhwb3MgPSBmb29fZWx0cy5jYWNoZXNbZWx0XS5ocG9zOworICAgICAg aW50IHZwb3MgPSBmb29fZWx0cy5jYWNoZXNbZWx0XS52cG9zOworICAgICAgaW50IHdkID0gZm9v X2VsdHMuY2FjaGVzW2VsdF0ud2Q7CisgICAgICBpbnQgaCA9IGZvb19lbHRzLmNhY2hlc1tlbHRd Lmg7CisgICAg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HN0YXJ0X2hwb3MKKyAgICAg ICAgICAgICAgICYmIGhwb3MgPCBlbmRfaHBvcykKKyAgICAgICAgICAgICAgLyogQSBmbG9hdGlu ZyBjdXJzb3IgYmV5b25kIHRoZSBlbmQgb2YgdGhlIGdseXBoIHJvdy4gKi8KKyAgICAgICAgICAg ICAgfHwgKGhwb3MgKyAxID09IHN0YXJ0X2hwb3MKKyAgICAgICAgICAgICAgICAgICYmIGhwb3Mg KyAxID09IGVuZF9ocG9zKSkKKyAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgIHsKKyAg ICAgICAgICBib29sIHJlbW92ZV9wID0gZmFsc2U7CisgICAgICAgICAgbWNfZHJhd19lcmFzZV9o eWJyaWQgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRo LCBsc2xfZmcsIGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnbHlw aF9mbGF2b3IsIHJlbW92ZV9wKTsKKyAgICAgICAgfQorICAgIH0KK30KKwordm9pZAorbWNfcmVk cmF3X3JvdyAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBz dHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICBpbnQgc3RhcnRfeCwgaW50IHN0 YXJ0X2hwb3MsIGludCBlbmRfaHBvcywgYm9vbCBjbGVhcl9lb2xfcCwKKyAgICAgICAgICAgICAg IGVudW0gZHJhd19nbHlwaHNfZmFjZSBobCkKK3sKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1F IChXSU5ET1dfRlJBTUUgKHcpKTsKKyAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywg bWF0cml4KTsKKyAgVFJBQ0UgKChzdGRlc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BzdHJ1Y3QgbXVsdGlwbGVfY3Vyc29y c19jYWNoZSBmb29fZWx0czsKKyAgc3dpdGNoIChjYWNoZV90eXBlKQorICAgIHsKKyAgICAgIGNh c2UgTk9fQ0FDSEU6CisgICAgICAgIHsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAg ICAgY2FzZSBNQ19DQUNIRToKKyAgICAgICAgeworICAgICAgICAgIGZvb19lbHRzLmNhY2hlcyA9 IHctPm1jX2VsdHMuY2FjaGVzOworICAgICAgICAgIGZvb19lbHRzLmFsbG9jYXRlZCA9IHctPm1j X2VsdHMuYWxsb2NhdGVkOworICAgICAgICAgIGZvb19lbHRzLnVzZWQgPSB3LT5tY19lbHRzLnVz ZWQ7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGNhc2UgQ0hfQ0FDSEU6Cisg ICAgICAgIHsKKyAgICAgICAgICBmb29fZWx0cy5jYWNoZXMgPSB3LT5jaF9lbHRzLmNhY2hlczsK KyAgICAgICAgICBmb29fZWx0cy5hbGxvY2F0ZWQgPSB3LT5jaF9lbHRzLmFsbG9jYXRlZDsKKyAg ICAgICAgICBmb29fZWx0cy51c2VkID0gdy0+Y2hfZWx0cy51c2VkOworICAgICAgICAgIGJyZWFr OworICAgICAgICB9CisgICAgICBjYXNlIEZDX0NBQ0hFOgorICAgICAgICB7CisgICAgICAgICAg Zm9vX2VsdHMuY2FjaGVzID0gdy0+ZmNfZWx0cy5jYWNoZXM7CisgICAgICAgICAgZm9vX2VsdHMu YWxsb2NhdGVkID0gdy0+ZmNfZWx0cy5hbGxvY2F0ZWQ7CisgICAgICAgICAgZm9vX2VsdHMudXNl ZCA9IHctPmZjX2VsdHMudXNlZDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0K KyAgZm9yIChpbnQgZWx0ID0gMDsgZWx0IDwgZm9vX2VsdHMudXNlZDsgKytlbHQpCisgICAgewor ICAgICAgaW50IHggPSBmb29fZWx0cy5jYWNoZXNbZWx0XS54OworICAgICAgaW50IGZ4ID0gZm9v X2VsdHMuY2FjaGVzW2VsdF0uZng7CisgICAgICBpbnQgeSA9IGZvb19lbHRzLmNhY2hlc1tlbHRd Lnk7CisgICAgICBpbnQgZnkgPSBmb29fZWx0cy5jYWNoZXNbZWx0XS5meTsKKyAgICAgIGludCBo cG9zID0gZm9vX2VsdHMuY2FjaGVzW2VsdF0uaHBvczsKKyAgICAgIGludCB2cG9zID0gZm9vX2Vs dHMuY2FjaGVzW2VsdF0udnBvczsKKyAgICAgIGludCB3ZCA9IGZvb19lbHRzLmNhY2hlc1tlbHRd LndkOworICAgICAgaW50IGggPSBmb29fZWx0cy5jYWNoZXNbZWx0XS5oOworICAgICAgZW51bSB0 eXBlX29mX2N1cnNvciBjdXJzb3JfdHlwZSA9IGZvb19lbHRzLmNhY2hlc1tlbHRdLmN1cnNvcl90 eXBlOworICAgICAgaW50IGN1cnNvcl93aWR0aCA9IGZvb19lbHRzLmNhY2hlc1tlbHRdLmN1cnNv cl93aWR0aDsKKyAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnID0gey5yZWQgPSBmb29fZWx0cy5j YWNoZXNbZWx0XS5mb3JlZ3JvdW5kLnJlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IC5ncmVlbiA9IGZvb19lbHRzLmNhY2hlc1tlbHRdLmZvcmVncm91bmQuZ3JlZW4sCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IGZvb19lbHRzLmNhY2hlc1tlbHRdLmZvcmVn cm91bmQuYmx1ZX07CisgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9iZyA9IHsucmVkID0gZm9vX2Vs dHMuY2FjaGVzW2VsdF0uYmFja2dyb3VuZC5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAuZ3JlZW4gPSBmb29fZWx0cy5jYWNoZXNbZWx0XS5iYWNrZ3JvdW5kLmdyZWVuLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBmb29fZWx0cy5jYWNoZXNbZWx0XS5i YWNrZ3JvdW5kLmJsdWV9OworICAgICAgYm9vbCBhY3RpdmVfcCA9IGZvb19lbHRzLmNhY2hlc1tl bHRdLmFjdGl2ZV9wOworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gZm9vX2Vs dHMuY2FjaGVzW2VsdF0uZ2x5cGhfZmxhdm9yOworICAgICAgYm9vbCBlbmFibGVkX3AgPSBmb29f ZWx0cy5jYWNoZXNbZWx0XS5lbmFibGVkX3A7CisgICAgICAvKiBgbWF0cml4X3JvdycgaW4gYGRp c3BuZXcuY2AgY29udGFpbnMgdGhlIGZvbGxvd2luZyB0ZXN0cywKKyAgICAgIGVhc3NlcnQgKG1h dHJpeCAmJiBtYXRyaXgtPnJvd3MpOworICAgICAgZWFzc2VydCAocm93ID49IDAgJiYgcm93IDwg bWF0cml4LT5ucm93cyk7ICovCisgICAgICBib29sIGJhcmZfY3Jhc2hfb25lID0gKG1hdHJpeCAm JiBtYXRyaXgtPnJvd3MpID8gZmFsc2UgOiB0cnVlOworICAgICAgaWYgKGJhcmZfY3Jhc2hfb25l KQorICAgICAgICBjb250aW51ZTsKKyAgICAgIGJvb2wgYmFyZl9jcmFzaF90d28gPSAodnBvcyA+ PSAwICYmIHZwb3MgPCBtYXRyaXgtPm5yb3dzKSA/IGZhbHNlIDogdHJ1ZTsKKyAgICAgIGlmIChi YXJmX2NyYXNoX3R3bykKKyAgICAgICAgY29udGludWU7CisgICAgICBpZiAodnBvcyA9PSByb3df dnBvcworICAgICAgICAgICYmIGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSAorICAgICAgICAgICYm IGVuYWJsZWRfcCkKKyAgICAgICAgeworICAgICAgICAgIG1jX2VyYXNlX2N1cnNvciAodywgbWF0 cml4LCByb3csIHgsIHksIGhwb3MsIHZwb3MsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUs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lX2hlbHBlciAodywgbWF0cml4LCByb3cs IEZDX0NBQ0hFKTsKK30KKwordm9pZAorbWNfc2V0X2Vzc2VudGlhbHMgKHN0cnVjdCB3aW5kb3cg KncsIGJvb2wgYWN0aXZlX3AsIHN0cnVjdCBtY19SR0IgKmNoX2ZvcmVncm91bmQsCisgICAgICAg ICAgICAgICAgICAgc3RydWN0IG1jX1JHQiAqZmNfZm9yZWdyb3VuZCwgaW50ICpmY194KQorewor ICBpZiAoIUJVRkZFUlAgKHctPmNvbnRlbnRzKSkKKyAgICByZXR1cm47CisgIGlmIChOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAgJiYgTklMUCAoQlZB UiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICYmIE5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpKQorICAgIHJldHVybjsKKyAg c3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIExpc3BfT2JqZWN0IGJ1ZiA9 IHctPmNvbnRlbnRzOworICBDSEVDS19CVUZGRVIgKGJ1Zik7CisgIHN0cnVjdCBidWZmZXIgKmIg PSBYQlVGRkVSIChidWYpOworICBzdHJ1Y3QgYnVmZmVyICpvbGRfYnVmZmVyID0gTlVMTDsKKyAg cHRyZGlmZl90IG9wb2ludCA9ICh3ID09IFhXSU5ET1cgKHNlbGVjdGVkX3dpbmRvdykpCisgICAg ICAgICAgICAgICAgICAgICA/IFBUCisgICAgICAgICAgICAgICAgICAgICA6IFhGSVhOVU0gKEZt YXJrZXJfcG9zaXRpb24gKHctPnBvaW50bSkpOworICBwdHJkaWZmX3QgZmNfY3VycmVudF9jb2wg PSBtY19jdXJyZW50X2NvbHVtbiAodywgb3BvaW50KTsKKyAgaW50IGZyYW1lX2NoYXJfd2lkdGgg PSBGUkFNRV9DT0xVTU5fV0lEVEggKGYpOworICBib29sIGZpbGxfY29sdW1uX3AgPSAhTklMUCAo QlZBUiAoYiwgZmlsbF9jb2x1bW4pKTsKKyAgaW50IGZpbGxfY29sID0gWEZJWE5VTSAoQlZBUiAo YiwgZmlsbF9jb2x1bW4pKTsKKyAgaW50IGhzY2xfeCA9IHctPmhzY3JvbGwgKiBmcmFtZV9jaGFy X3dpZHRoOworICBpZiAoYiAhPSBjdXJyZW50X2J1ZmZlcikKKyAgICB7CisgICAgICBvbGRfYnVm ZmVyID0gY3VycmVudF9idWZmZXI7CisgICAgICBzZXRfYnVmZmVyX2ludGVybmFsIChiKTsKKyAg ICB9CisgICpmY194ID0gKGZpbGxfY29sdW1uX3AKKyAgICAgICAgICAgJiYgIU5JTFAgKFZkaXNw bGF5X2xpbmVfbnVtYmVycykpCisgICAgICAgICAgICA/IChmaWxsX2NvbCAqIGZyYW1lX2NoYXJf d2lkdGgpICsgdy0+bWMubG51bV9waXhlbF93aWR0aCAtIGhzY2xfeAorICAgICAgICAgIDogKGZp bGxfY29sdW1uX3AKKyAgICAgICAgICAgICAmJiBOSUxQIChWZGlzcGxheV9saW5lX251bWJlcnMp KQorICAgICAgICAgICAgPyAoZmlsbF9jb2wgKiBmcmFtZV9jaGFyX3dpZHRoKSAtIGhzY2xfeAor ICAgICAgICAgIDogMDsKKyAgaWYgKG9sZF9idWZmZXIpCisgICAgc2V0X2J1ZmZlcl9pbnRlcm5h bCAob2xkX2J1ZmZlcik7CisgIGVudW0gZmFjZV9pZCBmaWxsX2NvbHVtbl9mYWNlX2lkID0KKyAg ICAoIWFjdGl2ZV9wCisgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGZjX2luYWN0aXZlX3dpbmRvd3MpKQorICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYs IGludGVybiAoImZjLWluYWN0aXZlLWZhY2UiKSwgdHJ1ZSkKKyAgICA6ICghYWN0aXZlX3AKKyAg ICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY19pbmFjdGl2ZV93 aW5kb3dzKSkKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBj cm9zc2hhaXJzKSkKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIp KQorICAgICAgICYmIHctPmN1cnNvci54ID09ICpmY194KQorICAgICAgPyBsb29rdXBfbmFtZWRf ZmFjZSAodywgZiwgaW50ZXJuICgiZmMtb3BvaW50LWluYWN0aXZlLWZhY2UiKSwgdHJ1ZSkKKyAg ICA6IChhY3RpdmVfcAorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIGNyb3NzaGFpcnMpKQorICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9y dWxlcikpCisgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gKmZjX3gpCisgICAgICA/IGxvb2t1cF9u YW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCJmYy1vcG9pbnQtZmFjZSIpLCB0cnVlKQorICAgIDog KCFhY3RpdmVfcAorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGZjX2luYWN0aXZlX3dpbmRvd3MpKQorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3 LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92 ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgJiYgdy0+Y3Vyc29yLnggIT0gKmZjX3gpCisgICAgICA/ IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCJmYy1pbmFjdGl2ZS1mYWNlIiksI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kLmdyZWVuOworICAgICAgY2hfZm9yZWdyb3VuZC0+Ymx1ZSA9IGJleW9uZF9maWxsX2Zv cmVncm91bmQuYmx1ZTsKKyAgICB9Cit9CisKK3ZvaWQKK21jX3ByZV9zY3JvbGxfY2xlYW4gKHN0 cnVjdCB3aW5kb3cgKncpCit7CisgIGlmIChNSU5JX1dJTkRPV19QICh3KSkKKyAgICByZXR1cm47 CisgIGJvb2wgZ29fb25lX3AgPSAody0+bWNfZWx0cy51c2VkID4gMCB8fCB3LT5jaF9lbHRzLnVz ZWQgPiAwIHx8IHctPmZjX2VsdHMudXNlZCA+IDApOworICBib29sIGdvX3R3b19wID0gKEJVRkZF UlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICYmICghTklMUCAoQlZBUiAoWEJV RkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAg fHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpCisgICAg ICAgICAgICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IG1jX2NvbmYpKSkpOworICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAgZnByaW50ZiAoc3Rk ZXJyLCAibWNfcHJlX3Njcm9sbF9jbGVhbiAoJXMpOiAgZ29fb25lX3AgKCVzKSB8IGdvX3R3b19w ICglcylcbiIsCisgICAgICAgICAgICAgICAgICAgICBtY193aW5kb3cgKHcpLCBnb19vbmVfcCA/ ICJ5ZXMiIDogIm5vIiwgZ29fdHdvX3AgPyAieWVzIiA6ICJubyIpOworICBpZiAoIWdvX29uZV9w ICYmICFnb190d29fcCkKKyAgICByZXR1cm47CisgIGJvb2wgdXBkYXRpbmdfZnJhbWVfcCA9IGZh bHNlOworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgaWY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2l0aCBBUkcsIHR1cm4gdHJhY2luZyBvbiBpZiBhbmQgb25s eSBpZiBBUkcgaXMgcG9zaXRpdmUuICovKQorICAoTGlzcF9PYmplY3QgYXJnKQoreworICBpZiAo TklMUCAoYXJnKSkKKyAgICBtY19zdGRlcnJfcCA9ICFtY19zdGRlcnJfcDsKKyAgZWxzZQorICAg IHsKKyAgICAgIGFyZyA9IEZwcmVmaXhfbnVtZXJpY192YWx1ZSAoYXJnKTsKKyAgICAgIG1jX3N0 ZGVycl9wID0gWEZJWE5VTSAoYXJnKSA+IDA7CisgICAgfQorICByZXR1cm4gUW5pbDsKK30KKwor LyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK IAwKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKgogCQkgICAgICBXaW5kb3cgZGlzcGxheSBkaW1lbnNpb25zCkBA IC0xMzM5NSw2ICsxNzQ3OSw2OSBAQCBoc2Nyb2xsX3dpbmRvd190cmVlIChMaXNwX09iamVjdCB3 aW5kb3cpCiAJICAgICAgZWxzZQogCQlwdCA9IGNsaXBfdG9fYm91bmRzIChCRUdWLCBtYXJrZXJf cG9zaXRpb24gKHctPnBvaW50bSksIFpWKTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIGJlZ2luIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyogKGdkYikgYnQKKyMwICB0ZXJtaW5h dGVfZHVlX3RvX3NpZ25hbCAoc2lnPTYsIGJhY2t0cmFjZV9saW1pdD0yMTQ3NDgzNjQ3KSBhdCBl bWFjcy5jOjM1OQorIzEgIDB4MDAwMDAwMDEwMDFl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aW5kb3c9Li4uKSBhdCB4ZGlzcC5jOjE4NTQ2CisqLworCisgIC8qIGBpbml0X2l0 ZXJhdG9yJzogIGVhc3NlcnQgKGNoYXJwb3MgPCAwCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHx8IChjaGFycG9zID49IEJVRl9CRUcgKGN1cnJlbnRfYnVmZmVyKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY2hhcnBvcyA8PSBaVikpOyAqLworCisgIHN0 cnVjdCBkaXNwbGF5X3BvcyAqcG9zID0gJmN1cnNvcl9yb3ctPnN0YXJ0OworICBwdHJkaWZmX3Qg Y2hhcnBvcyA9IENIQVJQT1MgKHBvcy0+cG9zKTsKKworICBib29sIGJhcmZfY3Jhc2hfb25lID0g KGNoYXJwb3MgPCAwCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKGNoYXJwb3MgPj0gQlVG X0JFRyAoY3VycmVudF9idWZmZXIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGNo YXJwb3MgPD0gWlYpKQorICAgICAgICAgICAgICAgICAgICAgICAgPyBmYWxzZQorICAgICAgICAg ICAgICAgICAgICAgICAgOiB0cnVlOworICBpZiAoYmFyZl9jcmFzaF9vbmUpCisgICAgcmV0dXJu IGhzY3JvbGxlZF9wOworCisgIC8qIGByZXNlYXRfMSc6ICBDSEFSUE9TIChwb3MpID49IEJFR1Yg JiYgQ0hBUlBPUyAocG9zKSA8PSBaViAqLworICBib29sIGJhcmZfY3Jhc2hfdHdvID0gKGNoYXJw b3MgPj0gQkVHViAmJiBjaGFycG9zIDw9IFpWKQorICAgICAgICAgICAgICAgICAgICAgICAgID8g ZmFsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICA6IHRydWU7CisgIGlmIChiYXJmX2NyYXNo X3R3bykKKyAgICByZXR1cm4gaHNjcm9sbGVkX3A7CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JT ICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAgICAgLyogTW92ZSBpdGVyYXRv ciB0byBwdCBzdGFydGluZyBhdCBjdXJzb3Jfcm93LT5zdGFydCBpbgogCQkgYSBsaW5lIHdpdGgg aW5maW5pdGUgd2lkdGguICAqLwogCSAgICAgIGluaXRfdG9fcm93X3N0YXJ0ICgmaXQsIHcsIGN1 cnNvcl9yb3cpOwpAQCAtMTQyODcsOSArMTg0MzQsMjIgQEAgcmVkaXNwbGF5X2ludGVybmFsICh2 b2lkKQogCSAgICAgICp3LT5kZXNpcmVkX21hdHJpeC0+bWV0aG9kID0gMDsKIAkgICAgICBkZWJ1 Z19tZXRob2RfYWRkICh3LCAib3B0aW1pemF0aW9uIDEiKTsKICNlbmRpZgorCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCiAjaWZkZWYgSEFWRV9X SU5ET1dfU1lTVEVNCisgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICYmICFOSUxQ IChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICBtY191cGRh dGVfd2luZG93X2ZyaW5nZXMgKHcsIGZhbHNlKTsKKyAgICBlbHNlCiAJICAgICAgdXBkYXRlX3dp bmRvd19mcmluZ2VzICh3LCBmYWxzZSk7CiAjZW5kaWYKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogCSAgICAgIGdvdG8gdXBkYXRlOwogCSAgICB9CiAJICBlbHNlCkBAIC0xNzY4Nywx MCArMjE4NDcsMjIgQEAgcmVkaXNwbGF5X3dpbmRvdyAoTGlzcF9PYmplY3Qgd2luZG93LCBib29s IGp1c3RfdGhpc19vbmVfcCkKICAgICB9CiAKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBi b29sIGtlZXBfY3VycmVudF9wID0gKGp1c3RfdGhpc19vbmVfcAorICAgICAgICAgICAgICAgICAg ICAgICAgIHx8ICghdXNlZF9jdXJyZW50X21hdHJpeF9wICYmICFvdmVybGF5X2Fycm93X3NlZW4p CisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgdy0+cHNldWRvX3dpbmRvd19wKTsKKworICBi b29sIGZyaW5nZXNfdXBkYXRlZF9wID0gKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGNyb3NzaGFpcnMpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfdXBkYXRlX3dp bmRvd19mcmluZ2VzICh3LCBrZWVwX2N1cnJlbnRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogdXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCBrZWVwX2N1cnJlbnRfcCk7CisKICAgaWYg KEZSQU1FX1dJTkRPV19QIChmKQotICAgICAgJiYgdXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCAo anVzdF90aGlzX29uZV9wCi0JCQkJICAgIHx8ICghdXNlZF9jdXJyZW50X21hdHJpeF9wICYmICFv dmVybGF5X2Fycm93X3NlZW4pCi0JCQkJICAgIHx8IHctPnBzZXVkb193aW5kb3dfcCkpKQorICAg ICAgJiYgZnJpbmdlc191cGRhdGVkX3ApCiAgICAgewogICAgICAgdXBkYXRlX2JlZ2luIChmKTsK ICAgICAgIGJsb2NrX2lucHV0ICgpOwpAQCAtMTc3MDUsNiArMjE4NzcsOSBAQCByZWRpc3BsYXlf d2luZG93IChMaXNwX09iamVjdCB3aW5kb3csIGJvb2wganVzdF90aGlzX29uZV9wKQogICAgICAg dXBkYXRlX2VuZCAoZik7CiAgICAgfQogCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAg IGlmIChXSU5ET1dfQk9UVE9NX0RJVklERVJfV0lEVEggKHcpKQogICAgIHhfZHJhd19ib3R0b21f ZGl2aWRlciAodyk7CiAjZW5kaWYgLyogSEFWRV9XSU5ET1dfU1lTVEVNICovCkBAIC0xODAxMCw2 ICsyMjE4NSwxOSBAQCB0cnlfd2luZG93X3JldXNpbmdfY3VycmVudF9tYXRyaXggKHN0cnVjdCB3 aW5kb3cgKncpCiAJICAgICBzY3JvbGxfcnVuX2hvb2sgd2lsbCBjbGVhciB0aGUgY3Vyc29yLCBh bmQgdXNlIHRoZQogCSAgICAgY3VycmVudCBtYXRyaXggdG8gZ2V0IHRoZSBoZWlnaHQgb2YgdGhl IHJvdyB0aGUgY3Vyc29yIGlzCiAJICAgICBpbi4gICovCisKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgaWYgKHRyYWNlX3JlZGlzcGxheV9w KQorICAgIGZwcmludGYgKHN0ZGVyciwgInRyeV93aW5kb3dfcmV1c2luZ19jdXJyZW50X21hdHJp eCBbMSBvZiAyXSAoJXMpXG4iLCBtY193aW5kb3cgKHcpKTsKKworICBtY19wcmVfc2Nyb2xsX2Ns ZWFuICh3KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgcnVuLmN1cnJlbnRf eSA9IHN0YXJ0X3Jvdy0+eTsKIAkgIHJ1bi5kZXNpcmVkX3kgPSBpdC5jdXJyZW50X3k7CiAJICBy dW4uaGVpZ2h0ID0gaXQubGFzdF92aXNpYmxlX3kgLSBpdC5jdXJyZW50X3k7CkBAIC0xODE3Myw2 ICsyMjM2MSwxOSBAQCB0cnlfd2luZG93X3JldXNpbmdfY3VycmVudF9tYXRyaXggKHN0cnVjdCB3 aW5kb3cgKncpCiAJfQogCiAgICAgICAvKiBTY3JvbGwgdGhlIGRpc3BsYXkuICAqLworCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlmICh0 cmFjZV9yZWRpc3BsYXlfcCkKKyAgICBmcHJpbnRmIChzdGRlcnIsICJ0cnlfd2luZG93X3JldXNp bmdfY3VycmVudF9tYXRyaXggWzIgb2YgMl0gKCVzKVxuIiwgbWNfd2luZG93ICh3KSk7CisKKyAg bWNfcHJlX3Njcm9sbF9jbGVhbiAodyk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK ICAgICAgIHJ1bi5jdXJyZW50X3kgPSBmaXJzdF9yZXVzYWJsZV9yb3ctPnk7CiAgICAgICBydW4u ZGVzaXJlZF95ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CiAgICAgICBydW4uaGVp Z2h0ID0gaXQubGFzdF92aXNpYmxlX3kgLSBydW4uY3VycmVudF95OwpAQCAtMTkxMjcsNiArMjMz MjgsMTkgQEAgdHJ5X3dpbmRvd19pZCAoc3RydWN0IHdpbmRvdyAqdykKICAgLyogU2Nyb2xsIHRo ZSBkaXNwbGF5LiAgRG8gaXQgYmVmb3JlIGNoYW5naW5nIHRoZSBjdXJyZW50IG1hdHJpeCBzbwog ICAgICB0aGF0IHh0ZXJtLmMgZG9lc24ndCBnZXQgY29uZnVzZWQgYWJvdXQgd2hlcmUgdGhlIGN1 cnNvciBnbHlwaCBpcwogICAgICBmb3VuZC4gICovCisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgaWYgKHRyYWNlX3JlZGlzcGxheV9wKQor ICAgIGZwcmludGYgKHN0ZGVyciwgInRyeV93aW5kb3dfaWQgKCVzKVxuIiwgbWNfd2luZG93ICh3 KSk7CisKKyAgbWNfcHJlX3Njcm9sbF9jbGVhbiAodyk7CisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKICAgaWYgKGR5ICYmIHJ1bi5oZWlnaHQpCiAgICAgewogICAgICAgdXBkYXRlX2Jl Z2luIChmKTsKQEAgLTIwMTMzLDYgKzI0MzQ3LDE3IEBAIGFwcGVuZF9zcGFjZV9mb3JfbmV3bGlu ZSAoc3RydWN0IGl0ICppdCwgYm9vbCBkZWZhdWx0X2ZhY2VfcCkKIAkgIG1lbXNldCAoJml0LT5w b3NpdGlvbiwgMCwgc2l6ZW9mIGl0LT5wb3NpdGlvbik7CiAJICBpdC0+b2JqZWN0ID0gUW5pbDsK IAkgIGl0LT5jID0gaXQtPmNoYXJfdG9fZGlzcGxheSA9ICcgJzsKKworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgaWYgKElUX0JZVEVQ T1MgKCppdCkgPj0gWlZfQllURSkKKyAgICAgICAgaXQtPnp2X3AgPSB0cnVlOworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKworCiAJICBpdC0+bGVuID0gMTsKIAogCSAgLyogSWYgdGhlIGRl ZmF1bHQgZmFjZSB3YXMgcmVtYXBwZWQsIGJlIHN1cmUgdG8gdXNlIHRoZQpAQCAtMjEyNjksOSAr MjU0OTQsMjIgQEAgbWF5YmVfcHJvZHVjZV9saW5lX251bWJlciAoc3RydWN0IGl0ICppdCkKICAg ICAgIGVsc2UKIAl0ZW1faXQuYyA9IHRlbV9pdC5jaGFyX3RvX2Rpc3BsYXkgPSAqcDsKICAgICAg IHRlbV9pdC5sZW4gPSAxOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQ TEUtQ1VSU09SUyAqLworCisgICAgICBpZiAoYmV5b25kX3p2KQorICAgICAgICB0ZW1faXQuenZf cCA9IHRydWU7CisgICAgICB0ZW1faXQuY3VycmVudF95ID0gaXQtPmN1cnJlbnRfeTsKKyAgICAg IHRlbV9pdC52cG9zID0gaXQtPnZwb3M7CiAgICAgICAvKiBNYWtlIHN1cmUgdGhlc2UgZ2x5cGhz IHdpbGwgaGF2ZSBhICJwb3NpdGlvbiIgb2YgLTEuICAqLwogICAgICAgU0VUX1RFWFRfUE9TICh0 ZW1faXQucG9zaXRpb24sIC0xLCAtMSk7CiAgICAgICBQUk9EVUNFX0dMWVBIUyAoJnRlbV9pdCk7 CisgICAgICB0ZW1faXQuaHBvcyArPSAxOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwog CiAgICAgICAvKiBTdG9wIHByb2R1Y2luZyBnbHlwaHMsIGFuZCByZWZyYWluIGZyb20gcHJvZHVj aW5nIHRoZSBsaW5lCiAJIG51bWJlciwgaWYgd2UgZG9uJ3QgaGF2ZSBlbm91Z2ggc3BhY2Ugb24g dGhpcyBsaW5lLiAgKi8KQEAgLTIxMjg0LDYgKzI1NTIyLDMwIEBAIG1heWJlX3Byb2R1Y2VfbGlu ZV9udW1iZXIgKHN0cnVjdCBpdCAqaXQpCiAJfQogICAgIH0KIAorCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBMaXNwX09iamVjdCBidWYgPSBp dC0+dy0+Y29udGVudHM7CisgIENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgc3RydWN0IGJ1ZmZlciAq YiA9IFhCVUZGRVIgKGJ1Zik7CisgIHN0cnVjdCBidWZmZXIgKm9sZF9idWZmZXIgPSBOVUxMOwor ICAvKiBOZWVkZWQgc28gdGhhdCBidWZmZXItbG9jYWwgdmFsdWVzIGNhbiBiZSBkZXRlcm1pbmVk OyBlLmcuLCB3aGVuIHN3aXRjaGluZworICB0byB0aGUgbWluaWJ1ZmZlci4gKi8KKyAgaWYgKGIg IT0gY3VycmVudF9idWZmZXIpCisgICAgeworICAgICAgb2xkX2J1ZmZlciA9IGN1cnJlbnRfYnVm ZmVyOworICAgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAoYik7CisgICAgfQorICBpdC0+dy0+bWMu bG51bV9waXhlbF93aWR0aCA9ICghTklMUCAoVmRpc3BsYXlfbGluZV9udW1iZXJzKSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IHRlbV9pdC5jdXJyZW50X3gKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IDA7CisgIGlmIChvbGRfYnVmZmVyKQorICAgIHNldF9idWZm ZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAgIC8qIFJlY29yZCB0aGUgd2lkdGggaW4gcGl4ZWxzIHdlIG5lZWQgZm9yIHRoZSBsaW5lIG51 bWJlciBkaXNwbGF5LiAgKi8KICAgaXQtPmxudW1fcGl4ZWxfd2lkdGggPSB0ZW1faXQuY3VycmVu dF94OwogICAvKiBDb3B5IHRoZSBwcm9kdWNlZCBnbHlwaHMgaW50byBJVCdzIGdseXBoX3Jvdy4g ICovCkBAIC0yNzA5Miw2ICszMTM1NCwyMCBAQCBhcHBlbmRfZ2x5cGggKHN0cnVjdCBpdCAqaXQp CiAJICAgIGdbMV0gPSAqZzsKIAkgIGdseXBoID0gaXQtPmdseXBoX3Jvdy0+Z2x5cGhzW2FyZWFd OwogCX0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMg Ki8KKworICAgICAgZ2x5cGgtPnggPSBpdC0+Y3VycmVudF94OworICAgICAgZ2x5cGgtPnkgPSBp dC0+Y3VycmVudF95OworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBo LT52cG9zID0gaXQtPnZwb3M7CisgICAgICBnbHlwaC0+enZfcCA9IGl0LT56dl9wOworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1Mg KGl0LT5wb3NpdGlvbik7CiAgICAgICBnbHlwaC0+b2JqZWN0ID0gaXQtPm9iamVjdDsKICAgICAg IGlmIChpdC0+cGl4ZWxfd2lkdGggPiAwKQpAQCAtMjcxNzUsNiArMzE0NTEsMjAgQEAgYXBwZW5k X2NvbXBvc2l0ZV9nbHlwaCAoc3RydWN0IGl0ICppdCkKIAkgICAgZ1sxXSA9ICpnOwogCSAgZ2x5 cGggPSBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbaXQtPmFyZWFdOwogCX0KKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPngg PSBpdC0+Y3VycmVudF94OworICAgICAgZ2x5cGgtPnkgPSBpdC0+Y3VycmVudF95OworICAgICAg Z2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBoLT52cG9zID0gaXQtPnZwb3M7Cisg ICAgICBnbHlwaC0+enZfcCA9IGl0LT56dl9wOworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiAgICAgICBnbHlwaC0+Y2hhcnBvcyA9IGl0LT5jbXBfaXQuY2hhcnBvczsKICAgICAgIGds eXBoLT5vYmplY3QgPSBpdC0+b2JqZWN0OwogICAgICAgZWFzc2VydCAoaXQtPnBpeGVsX3dpZHRo IDw9IFNIUlRfTUFYKTsKQEAgLTI3MzgzLDYgKzMxNjczLDIwIEBAIHByb2R1Y2VfaW1hZ2VfZ2x5 cGggKHN0cnVjdCBpdCAqaXQpCiAJfQogICAgICAgaWYgKGdseXBoIDwgaXQtPmdseXBoX3Jvdy0+ Z2x5cGhzW2FyZWEgKyAxXSkKIAl7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBN VUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGdseXBoLT54ID0gaXQtPmN1cnJlbnRfeDsKKyAg ICAgIGdseXBoLT55ID0gaXQtPmN1cnJlbnRfeTsKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhw b3M7CisgICAgICBnbHlwaC0+dnBvcyA9IGl0LT52cG9zOworICAgICAgZ2x5cGgtPnp2X3AgPSBp dC0+enZfcDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgZ2x5cGgtPmNoYXJw b3MgPSBDSEFSUE9TIChpdC0+cG9zaXRpb24pOwogCSAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmpl Y3Q7CiAJICBnbHlwaC0+cGl4ZWxfd2lkdGggPSBjbGlwX3RvX2JvdW5kcyAoLTEsIGl0LT5waXhl bF93aWR0aCwgU0hSVF9NQVgpOwpAQCAtMjc0ODYsNiArMzE3OTAsMjAgQEAgcHJvZHVjZV94d2lk Z2V0X2dseXBoIChzdHJ1Y3QgaXQgKml0KQogCX0KICAgICAgIGlmIChnbHlwaCA8IGl0LT5nbHlw aF9yb3ctPmdseXBoc1thcmVhICsgMV0pCiAJeworCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+eCA9IGl0LT5jdXJyZW50 X3g7CisgICAgICBnbHlwaC0+eSA9IGl0LT5jdXJyZW50X3k7CisgICAgICBnbHlwaC0+aHBvcyA9 IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPnZwb3MgPSBpdC0+dnBvczsKKyAgICAgIGdseXBoLT56 dl9wID0gaXQtPnp2X3A7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgIGdseXBo LT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKIAkgIGdseXBoLT5vYmplY3QgPSBp dC0+b2JqZWN0OwogCSAgZ2x5cGgtPnBpeGVsX3dpZHRoID0gY2xpcF90b19ib3VuZHMgKC0xLCBp dC0+cGl4ZWxfd2lkdGgsIFNIUlRfTUFYKTsKQEAgLTI3NTcyLDYgKzMxODkwLDIwIEBAIGFwcGVu ZF9zdHJldGNoX2dseXBoIChzdHJ1Y3QgaXQgKml0LCBMaXNwX09iamVjdCBvYmplY3QsCiAJICAg IHdpZHRoIC09IGl0LT5maXJzdF92aXNpYmxlX3ggLSBpdC0+Y3VycmVudF94OwogCSAgZWFzc2Vy dCAod2lkdGggPiAwKTsKIAl9CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKyAgICAgIGdseXBoLT54ID0gaXQtPmN1cnJlbnRfeDsKKyAgICAg IGdseXBoLT55ID0gaXQtPmN1cnJlbnRfeTsKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7 CisgICAgICBnbHlwaC0+dnBvcyA9IGl0LT52cG9zOworICAgICAgZ2x5cGgtPnp2X3AgPSBpdC0+ enZfcDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgZ2x5cGgtPmNoYXJw b3MgPSBDSEFSUE9TIChpdC0+cG9zaXRpb24pOwogICAgICAgZ2x5cGgtPm9iamVjdCA9IG9iamVj dDsKICAgICAgIC8qIEZJWE1FOiBJdCB3b3VsZCBiZSBiZXR0ZXIgdG8gdXNlIFRZUEVfTUFYIGhl cmUsIGJ1dApAQCAtMjgwMjYsNiArMzIzNTgsMjAgQEAgYXBwZW5kX2dseXBobGVzc19nbHlwaCAo c3RydWN0IGl0ICppdCwgaW50IGZhY2VfaWQsIGJvb2wgZm9yX25vX2ZvbnQsIGludCBsZW4sCiAJ ICAgIGdbMV0gPSAqZzsKIAkgIGdseXBoID0gaXQtPmdseXBoX3Jvdy0+Z2x5cGhzW2FyZWFdOwog CX0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8K KworICAgICAgZ2x5cGgtPnggPSBpdC0+Y3VycmVudF94OworICAgICAgZ2x5cGgtPnkgPSBpdC0+ Y3VycmVudF95OworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBoLT52 cG9zID0gaXQtPnZwb3M7CisgICAgICBnbHlwaC0+enZfcCA9IGl0LT56dl9wOworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKworCiAgICAgICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1MgKGl0 LT5wb3NpdGlvbik7CiAgICAgICBnbHlwaC0+b2JqZWN0ID0gaXQtPm9iamVjdDsKICAgICAgIGVh c3NlcnQgKGl0LT5waXhlbF93aWR0aCA8PSBTSFJUX01BWCk7CkBAIC0yOTA3NiwxMCArMzM0MjIs MzMgQEAgeF9pbnNlcnRfZ2x5cGhzIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93 ICp1cGRhdGVkX3JvdywKIAogICAvKiBXcml0ZSB0aGUgZ2x5cGhzLiAgKi8KICAgaHBvcyA9IHN0 YXJ0IC0gcm93LT5nbHlwaHNbdXBkYXRlZF9hcmVhXTsKKworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBpZiAoKHctPm1jX2VsdHMudXNlZCA+ IDAgfHwgdy0+Y2hfZWx0cy51c2VkID4gMCB8fCB3LT5mY19lbHRzLnVzZWQgPiAwKQorICAgICAg JiYgdXBkYXRlZF9hcmVhID09IFRFWFRfQVJFQSkKKyAgICB7CisgICAgICBzdHJ1Y3QgZ2x5cGhf bWF0cml4ICptYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAgICAgIGludCB2cG9zID0gTUFU UklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgICAgICBpbnQgc3RhcnRfeCA9IHctPm91dHB1 dF9jdXJzb3IueDsKKyAgICAgIGludCBzdGFydF9ocG9zID0gaHBvczsKKyAgICAgIGludCBlbmRf aHBvcyA9IGhwb3MgKyBsZW47CisgICAgICBib29sIGNsZWFyX2VvbF9wID0gZmFsc2U7CisgICAg ICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UgaGwgPSBEUkFXX05PUk1BTF9URVhUOworICAgICAgVFJB Q0UgKChzdGRlcnIsICJ4X2luc2VydF9nbHlwaHMgKCVkKTogIHN0YXJ0X3ggKCVkKSB8IHN0YXJ0 X2hwb3MgKCVkKSB8IGVuZF9ocG9zICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgdnBv cywgc3RhcnRfeCwgc3RhcnRfaHBvcywgZW5kX2hwb3MpKTsKKyAgICAgIG1jX3JlZHJhd19yb3cg KHcsIG1hdHJpeCwgcm93LCBzdGFydF94LCBzdGFydF9ocG9zLCBlbmRfaHBvcywgY2xlYXJfZW9s X3AsIGhsKTsKKyAgICB9CisgICAgZWxzZQogICBkcmF3X2dseXBocyAodywgdy0+b3V0cHV0X2N1 cnNvci54LCByb3csIHVwZGF0ZWRfYXJlYSwKIAkgICAgICAgaHBvcywgaHBvcyArIGxlbiwKIAkg ICAgICAgRFJBV19OT1JNQUxfVEVYVCwgMCk7CiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor CisKICAgLyogQWR2YW5jZSB0aGUgb3V0cHV0IGN1cnNvci4gICovCiAgIHctPm91dHB1dF9jdXJz b3IuaHBvcyArPSBsZW47CiAgIHctPm91dHB1dF9jdXJzb3IueCArPSBzaGlmdF9ieV93aWR0aDsK QEAgLTI5NTA1LDkgKzMzODc0LDMxIEBAIHhfZml4X292ZXJsYXBwaW5nX2FyZWEgKHN0cnVjdCB3 aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKIAkgIHdoaWxlIChpIDwgcm93LT51c2Vk W2FyZWFdCiAJCSAmJiByb3ctPmdseXBoc1thcmVhXVtpXS5vdmVybGFwc192ZXJ0aWNhbGx5X3Ap OwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLwor CisgICAgICAgIGlmICgody0+bWNfZWx0cy51c2VkID4gMCB8fCB3LT5jaF9lbHRzLnVzZWQgPiAw IHx8IHctPmZjX2VsdHMudXNlZCA+IDApCisgICAgICAgICAgICAmJiBhcmVhID09IFRFWFRfQVJF QSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgg PSB3LT5jdXJyZW50X21hdHJpeDsKKyAgICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19W UE9TIChyb3csIG1hdHJpeCk7CisgICAgICAgICAgICBpbnQgc3RhcnRfaHBvcyA9IHN0YXJ0Owor ICAgICAgICAgICAgaW50IGVuZF9ocG9zID0gaTsKKyAgICAgICAgICAgIGJvb2wgY2xlYXJfZW9s X3AgPSBmYWxzZTsKKyAgICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBobCA9IERSQVdf Tk9STUFMX1RFWFQ7CisgICAgICAgICAgICBUUkFDRSAoKHN0ZGVyciwgInhfZml4X292ZXJsYXBw aW5nX2FyZWEgKCVkKTogIHN0YXJ0X3ggKCVkKSB8IHN0YXJ0X2hwb3MgKCVkKSB8IGVuZF9ocG9z ICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdnBvcywgc3RhcnRfeCwgc3Rh cnRfaHBvcywgZW5kX2hwb3MpKTsKKyAgICAgICAgICAgIG1jX3JlZHJhd19yb3cgKHcsIG1hdHJp eCwgcm93LCBzdGFydF94LCBzdGFydF9ocG9zLCBlbmRfaHBvcywgY2xlYXJfZW9sX3AsIGhsKTsK KyAgICAgICAgICB9CisgICAgICAgICAgZWxzZQogCSAgZHJhd19nbHlwaHMgKHcsIHN0YXJ0X3gs IHJvdywgYXJlYSwKIAkJICAgICAgIHN0YXJ0LCBpLAogCQkgICAgICAgRFJBV19OT1JNQUxfVEVY VCwgb3ZlcmxhcHMpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJfQogICAgICAg ZWxzZQogCXsKQEAgLTI5NzU4LDEwICszNDE0OSwxNyBAQCBkaXNwbGF5X2FuZF9zZXRfY3Vyc29y IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIG9uLAogICBuZXdfY3Vyc29yX3R5cGUgPSBnZXRfd2lu ZG93X2N1cnNvcl90eXBlICh3LCBnbHlwaCwKIAkJCQkJICAgICZuZXdfY3Vyc29yX3dpZHRoLCAm YWN0aXZlX2N1cnNvcik7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKICAgLyogSWYgY3Vyc29yIGlzIGN1cnJlbnRseSBiZWluZyBzaG93biBh bmQgd2UgZG9uJ3Qgd2FudCBpdCB0byBiZSBvcgogICAgICBpdCBp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QEAgZGlzcGxheV9hbmRfc2V0X2N1cnNvciAoc3RydWN0IHdpbmRvdyAq dywgYm9vbCBvbiwKICAgICAgIHctPnBoeXNfY3Vyc29yLnZwb3MgPSB2cG9zOwogICAgIH0KIAot ICBGUkFNRV9SSUYgKGYpLT5kcmF3X3dpbmRvd19jdXJzb3IgKHcsIGdseXBoX3JvdywgeCwgeSwK LSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfY3Vyc29yX3R5cGUsIG5l d19jdXJzb3Jfd2lkdGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb24s IGFjdGl2ZV9jdXJzb3IpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExF LUNVUlNPUlMgKi8KKworICBpZiAoTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBj cm9zc2hhaXJzKSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg ZmNfdmlzaWJsZSkpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IG1jX2NvbmYpKSkKKyAgICBGUkFNRV9SSUYgKGYpLT5kcmF3X3dpbmRvd19jdXJzb3IgKHcsIGds eXBoX3JvdywgeCwgeSwgbmV3X2N1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgbmV3X2N1cnNvcl93aWR0aCwgb24sIGFjdGl2ZV9jdXJzb3IpOworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiB9CiAKIApAQCAtMjk4ODcsNyArMzQyOTgsMjcg QEAgZHJhd19yb3dfd2l0aF9tb3VzZV9mYWNlIChzdHJ1Y3Qgd2luZG93ICp3LCBpbnQgc3RhcnRf eCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQogICBp ZiAoRlJBTUVfV0lORE9XX1AgKFhGUkFNRSAody0+ZnJhbWUpKSkKICAgICB7CisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGlmICh3 LT5tY19lbHRzLnVzZWQgPiAwIHx8IHctPmNoX2VsdHMudXNlZCA+IDAgfHwgdy0+ZmNfZWx0cy51 c2VkID4gMCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJp eCA9IHctPmN1cnJlbnRfbWF0cml4OworICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19W UE9TIChyb3csIG1hdHJpeCk7CisgICAgICAgICAgYm9vbCBjbGVhcl9lb2xfcCA9IGZhbHNlOwor ICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBobCA9IGRyYXc7CisgICAgICAgICAgVFJB Q0UgKChzdGRlcnIsICJkcmF3X3Jvd193aXRoX21vdXNlX2ZhY2UgKCVkKTogIHN0YXJ0X3ggKCVk KSB8IHN0YXJ0X2hwb3MgKCVkKSB8IGVuZF9ocG9zICglZClcbiIsCisgICAgICAgICAgICAgICAg ICAgICAgICAgIHZwb3MsIHN0YXJ0X3gsIHN0YXJ0X2hwb3MsIGVuZF9ocG9zKSk7CisgICAgICAg ICAgbWNfcmVkcmF3X3JvdyAodywgbWF0cml4LCByb3csIHN0YXJ0X3gsIHN0YXJ0X2hwb3MsIGVu ZF9ocG9zLCBjbGVhcl9lb2xfcCwgaGwpOworICAgICAgICB9CisgICAgICAgIGVsc2UKICAgICAg IGRyYXdfZ2x5cGhzICh3LCBzdGFydF94LCByb3csIFRFWFRfQVJFQSwgc3RhcnRfaHBvcywgZW5k X2hwb3MsIGRyYXcsIDApOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICBy ZXR1cm47CiAgICAgfQogI2VuZGlmCkBAIC0zMTk0NSwxMSArMzYzNzYsMzQgQEAgZXhwb3NlX2Fy ZWEgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgWFJlY3RhbmdsZSAq ciwKICAgc3RydWN0IGdseXBoICpsYXN0OwogICBpbnQgZmlyc3RfeCwgc3RhcnRfeCwgeDsKIAor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogICBp ZiAoYXJlYSA9PSBURVhUX0FSRUEgJiYgcm93LT5maWxsX2xpbmVfcCkKKyAgICB7CisgICAgICBp ZiAody0+bWNfZWx0cy51c2VkID4gMCB8fCB3LT5jaF9lbHRzLnVzZWQgPiAwIHx8IHctPmZjX2Vs dHMudXNlZCA+IDApCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICpt YXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9S T1dfVlBPUyAocm93LCBtYXRyaXgpOworICAgICAgICAgIGludCBzdGFydF94ID0gMDsKKyAgICAg ICAgICBpbnQgc3RhcnRfaHBvcyA9IDA7CisgICAgICAgICAgaW50IGVuZF9ocG9zID0gcm93LT51 c2VkW1RFWFRfQVJFQV07CisgICAgICAgICAgYm9vbCBjbGVhcl9lb2xfcCA9IGZhbHNlOworICAg ICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBobCA9IERSQVdfTk9STUFMX1RFWFQ7CisgICAg ICAgICAgVFJBQ0UgKChzdGRlcnIsICJleHBvc2VfYXJlYSAoJWQpOiAgV3JpdGUgdGhlIHdob2xl IGxpbmUuXG4iLCB2cG9zKSk7CisgICAgICAgICAgbWNfcmVkcmF3X3JvdyAodywgbWF0cml4LCBy b3csIHN0YXJ0X3gsIHN0YXJ0X2hwb3MsIGVuZF9ocG9zLCBjbGVhcl9lb2xfcCwgaGwpOworICAg ICAgICB9CisgICAgICAgIGVsc2UKICAgICAvKiBJZiByb3cgZXh0ZW5kcyBmYWNlIHRvIGVuZCBv ZiBsaW5lIHdyaXRlIHRoZSB3aG9sZSBsaW5lLiAgKi8KICAgICBkcmF3X2dseXBocyAodywgMCwg cm93LCBhcmVhLAogCQkgMCwgcm93LT51c2VkW2FyZWFdLAogCQkgRFJBV19OT1JNQUxfVEVYVCwg MCk7CisgICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIGVsc2UKICAgICB7 CiAgICAgICAvKiBTZXQgU1RBUlRfWCB0byB0aGUgd2luZG93LXJlbGF0aXZlIHN0YXJ0IHBvc2l0 aW9uIGZvciBkcmF3aW5nIGdseXBocyBvZgpAQCAtMzE5ODEsMTEgKzM2NDM1LDM0IEBAIGV4cG9z ZV9hcmVhIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIFhSZWN0YW5n bGUgKnIsCiAJICArK2xhc3Q7CiAJfQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyog TVVMVElQTEUtQ1VSU09SUyAqLworCiAgICAgICAvKiBSZXBhaW50LiAgKi8KLSAgICAgIGlmIChs YXN0ID4gZmlyc3QpCisgICAgICAvKiBGbG9hdGluZyBmYWtlIGN1cnNvcnMgd2lsbCBleGlzdCB3 aGVuIChsYXN0ID09IGZpcnN0KS4gKi8KKyAgICAgIGlmICgody0+bWNfZWx0cy51c2VkID4gMCB8 fCB3LT5jaF9lbHRzLnVzZWQgPiAwIHx8IHctPmZjX2VsdHMudXNlZCA+IDApCisgICAgICAgICAg JiYgYXJlYSA9PSBURVhUX0FSRUEpCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhf bWF0cml4ICptYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAgICAgICAgICBpbnQgdnBvcyA9 IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAgICAgICAgIHN0YXJ0X3ggPSBmaXJz dF94IC0gc3RhcnRfeDsKKyAgICAgICAgICBpbnQgc3RhcnRfaHBvcyA9IGZpcnN0IC0gcm93LT5n bHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICBpbnQgZW5kX2hwb3MgPSBsYXN0IC0gcm93LT5n bHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICBib29sIGNsZWFyX2VvbF9wID0gZmFsc2U7Cisg ICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIGhsID0gRFJBV19OT1JNQUxfVEVYVDsKKyAg ICAgICAgICBUUkFDRSAoKHN0ZGVyciwgImV4cG9zZV9hcmVhICglZCk6ICBzdGFydF94ICglZCkg fCBzdGFydF9ocG9zICglZCkgfCBlbmRfaHBvcyAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAg ICAgICAgICB2cG9zLCBzdGFydF94LCBzdGFydF9ocG9zLCBlbmRfaHBvcykpOworICAgICAgICAg IG1jX3JlZHJhd19yb3cgKHcsIG1hdHJpeCwgcm93LCBzdGFydF94LCBzdGFydF9ocG9zLCBlbmRf aHBvcywgY2xlYXJfZW9sX3AsIGhsKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChsYXN0 ID4gZmlyc3QpCiAJZHJhd19nbHlwaHMgKHcsIGZpcnN0X3ggLSBzdGFydF94LCByb3csIGFyZWEs CiAJCSAgICAgZmlyc3QgLSByb3ctPmdseXBoc1thcmVhXSwgbGFzdCAtIHJvdy0+Z2x5cGhzW2Fy ZWFdLAogCQkgICAgIERSQVdfTk9STUFMX1RFWFQsIDApOworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKworCiAgICAgfQogfQogCkBAIC0zMTk5OSwxMCArMzY0NzYsMzMgQEAgZXhwb3NlX2xp bmUgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgWFJlY3RhbmdsZSAq cikKIHsKICAgZWFzc2VydCAocm93LT5lbmFibGVkX3ApOwogCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCiAgIGlmIChyb3ctPm1vZGVfbGluZV9w IHx8IHctPnBzZXVkb193aW5kb3dfcCkKKyAgICB7CisgICAgICBpZiAody0+bWNfZWx0cy51c2Vk ID4gMCB8fCB3LT5jaF9lbHRzLnVzZWQgPiAwIHx8IHctPmZjX2VsdHMudXNlZCA+IDApCisgICAg ICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXggPSB3LT5jdXJyZW50 X21hdHJpeDsKKyAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRy aXgpOworICAgICAgICAgIGludCBzdGFydF94ID0gMDsKKyAgICAgICAgICBpbnQgc3RhcnRfaHBv cyA9IDA7CisgICAgICAgICAgaW50IGVuZF9ocG9zID0gcm93LT51c2VkW1RFWFRfQVJFQV07Cisg ICAgICAgICAgYm9vbCBjbGVhcl9lb2xfcCA9IGZhbHNlOworICAgICAgICAgIGVudW0gZHJhd19n bHlwaHNfZmFjZSBobCA9IERSQVdfTk9STUFMX1RFWFQ7CisgICAgICAgICAgVFJBQ0UgKChzdGRl cnIsICJleHBvc2VfbGluZSAoJWQpOiAgV3JpdGUgdGhlIHdob2xlIGxpbmUuXG4iLCB2cG9zKSk7 CisgICAgICAgICAgbWNfcmVkcmF3X3JvdyAodywgbWF0cml4LCByb3csIHN0YXJ0X3gsIHN0YXJ0 X2hwb3MsIGVuZF9ocG9zLCBjbGVhcl9lb2xfcCwgaGwpOworICAgICAgICB9CisgICAgICAgIGVs c2UKICAgICBkcmF3X2dseXBocyAodywgMCwgcm93LCBURVhUX0FSRUEsCiAJCSAwLCByb3ctPnVz ZWRbVEVYVF9BUkVBXSwKIAkJIERSQVdfTk9STUFMX1RFWFQsIDApOworICAgIH0KKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogICBlbHNlCiAgICAgewogICAgICAgaWYgKHJvdy0+dXNl ZFtMRUZUX01BUkdJTl9BUkVBXSkKQEAgLTMyNTUwLDYgKzM3MDUwLDIyIEBAIHhfaW50ZXJzZWN0 X3JlY3RhbmdsZXMgKFhSZWN0YW5nbGUgKnIxLCBYUmVjdGFuZ2xlICpyMiwgWFJlY3RhbmdsZSAq cmVzdWx0KQogdm9pZAogc3ltc19vZl94ZGlzcCAodm9pZCkKIHsKKworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBkZWZzdWJyICgmU21jX2R1 bXBfZ2x5cGhfcm93KTsKKworICBkZWZzdWJyICgmU21jX2R1bXBfZ2x5cGhfbWF0cml4KTsKKwor ICBkZWZzdWJyICgmU21jX2N1cnJlbnRfY29sdW1uKTsKKworICBkZWZzdWJyICgmU21jX3N0ZGVy cik7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgVndpdGhfZWNob19hcmVhX3Nh dmVfdmVjdG9yID0gUW5pbDsKICAgc3RhdGljcHJvICgmVndpdGhfZWNob19hcmVhX3NhdmVfdmVj dG9yKTsKIApkaWZmIC0tZ2l0IGEvc3JjL3h0ZXJtLmMgYi9zcmMveHRlcm0uYwppbmRleCA1YWEz ZTNmLi45NTNhMTA0IDEwMDY0NAotLS0gYS9zcmMveHRlcm0uYworKysgYi9zcmMveHRlcm0uYwpA QCAtMTMyLDYgKzEzMiw4NjkgQEAgYWxvbmcgd2l0aCBHTlUgRW1hY3MuICBJZiBub3QsIHNlZSA8 aHR0cHM6Ly93d3cuZ251Lm9yZy9saWNlbnNlcy8+LiAgKi8KICNpbmNsdWRlIDxYMTEvWEtCbGli Lmg+CiAjZW5kaWYKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJ UExFLUNVUlNPUlMgKi8KKworI2lmZGVmIEdMWVBIX0RFQlVHCitzdGF0aWMgdm9pZCB4X2NoZWNr X2ZvbnQgKHN0cnVjdCBmcmFtZSAqLCBzdHJ1Y3QgZm9udCAqKTsKKyNlbmRpZgorCitzdGF0aWMg dm9pZCB4X3NldF9tb2RlX2xpbmVfZmFjZV9nYyAoc3RydWN0IGdseXBoX3N0cmluZyAqKTsKKwor c3RhdGljIHZvaWQgeF9zZXRfbW91c2VfZmFjZV9nYyAoc3RydWN0IGdseXBoX3N0cmluZyAqKTsK Kworc3RhdGljIHZvaWQgeF9jbGlwX3RvX3JvdyAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5 cGhfcm93ICosIGVudW0gZ2x5cGhfcm93X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ludCB4LCBp bnQgZngsIGludCB5LCBpbnQgZnksIGludCBocG9zLCBpbnQgdnBvcywgaW50IHdkLCBpbnQgaCwK KyAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbCwgZW51bSB0eXBlX29m X2N1cnNvciBjdXJzb3JfdHlwZSwgaW50IGN1cnNvcl93aWR0aCwKKyAgICAgICAgICAgICAgICAg ICAgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IsIGJvb2wgb25fcCwgYm9vbCBhY3Rp dmVfcCkKK3sKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsK KyAgLyogVGhlIGZyaW5nZSBiaXRtYXBzIGFyZSBwcmVzZW50bHkgaGFuZGxlZCBlbHNld2hlcmUs IGJ1dCBjb3VsZCBzb21lZGF5CisgIGJlIG1hbmFnZWQgKGluIHBhcnQpIGF0IHRoaXMgc2VjdGlv biBvZiBjb2RlLiAqLworICBpZiAob25fcCkKKyAgICB7CisgICAgICBpZiAocm93LT5leGFjdF93 aW5kb3dfd2lkdGhfbGluZV9wCisgICAgICAgICAgJiYgKHJvdy0+cmV2ZXJzZWRfcAorICAgICAg ICAgICAgICA/IChocG9zIDwgMCkKKyAgICAgICAgICAgICAgOiAoaHBvcyA+PSByb3ctPnVzZWRb VEVYVF9BUkVBXSkpKQorICAgICAgICB7CisgICAgICAgICAgcm93LT5jdXJzb3JfaW5fZnJpbmdl X3AgPSB0cnVlOworICAgICAgICAgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcCAodywgcm93LCByb3ct PnJldmVyc2VkX3AsIGN1cnNvcl90eXBlKTsKKyAgICAgICAgfQorICAgICAgZWxzZQorICAgICAg ICB7CisgIENvbG9ybWFwIGNtYXAgPSBGUkFNRV9YX0NPTE9STUFQIChmKTsKKyAgdW5zaWduZWQg bG9uZyBvcmlnaW5hbF9jdXJzb3JfcGl4ZWwgPSBmLT5vdXRwd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0cnVjdCBnbHlwaCAq Y3Vyc29yX2dseXBoID0gbWNfZ2V0X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIGhwb3Ms IHZwb3MpOworICAgICAgaWYgKGN1cnNvcl9nbHlwaCA9PSBOVUxMKQorICAgICAgICByZXR1cm47 CisgICAgICBMaXNwX09iamVjdCBidWYgPSB3LT5jb250ZW50czsKKyAgICAgIENIRUNLX0JVRkZF UiAoYnVmKTsKKyAgICAgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSIChidWYpOworICAgICAg Ym9vbCByZWdpb25fYWN0aXZlX3AgPSAoIU5JTFAgKFZ0cmFuc2llbnRfbWFya19tb2RlKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIG1hcmtfYWN0aXZl KSkpOworICAgICAgcHRyZGlmZl90IHJlZ2lvbl9iZWdpbm5pbmcgPSAocmVnaW9uX2FjdGl2ZV9w KSA/IFhGSVhOVU0gKEZyZWdpb25fYmVnaW5uaW5nICgpKSA6IC0xOworICAgICAgcHRyZGlmZl90 IHJlZ2lvbl9lbmQgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IFhGSVhOVU0gKEZyZWdpb25fZW5kICgp KSA6IC0xOworICAgICAgcHRyZGlmZl90IG9wb2ludF9wdCA9ICh3ID09IFhXSU5ET1cgKHNlbGVj dGVkX3dpbmRvdykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBQVAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogWEZJWE5VTSAoRm1hcmtlcl9wb3NpdGlvbiAody0+cG9pbnRt KSk7CisgICAgICBib29sIHJlZ2lvbl9pbl9ib3VuZHNfcCA9IChyZWdpb25fYWN0aXZlX3AKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF9wdCA+PSByZWdpb25fYmVn aW5uaW5nCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBv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k KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLyogVGhlIHJlZ2lvbiBpcyBf bm90XyB2aXNpYmxlIGluIHRoZSBpbmFjdGl2ZSB3aW5kb3cgYmVjYXVzZSB0aGUgb3ZlcmxheSB3 aW5kb3cgcHJvcGVydHkgaXMgdXNlZC4gKi8KKyAgICAgICAgICAgICAgICBlbHNlIGlmICghYWN0 aXZlX3ApCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGVudW0gZmFj ZV9pZCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBp bnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItaW5hY3RpdmUtZmFjZSIpLCB0cnVlKTsKKyAgICAg ICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19pbmFjdGl2ZV9mYWNlID0gRkFDRV9G Uk9NX0lEIChmLCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAg IFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5j dXJzb3JfZ2MsIGhvbGxvd19pbmFjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAg ICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9k YXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2luYWN0aXZlX2ZhY2UtPmJhY2tncm91bmQpOworICAg ICAgICAgICAgICAgICAgfQorICAgICAgICAgIGJsb2NrX2lucHV0ICgpOworICAgICAgICAgIC8q IEZvcmNlIGBtY194X3NldF9jdXJzb3JfZ2MnIHRvIHVzZSBgcy0+Zi0+b3V0cHV0X2RhdGEueC0+ Y3Vyc29yX2djJy4gICovCisgICAgICAgICAgYm9vbCBjdXJz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ICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9w aXhlbCcuICAqLworICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0g Y29sb3IucGl4ZWw7CisgICAgICAgICAgICBtY194X2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0 cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgICAg Zi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOwor ICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAg IC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djJyBieSBi b3Jyb3dpbmcgdGhlCisgICAgICAgICAgICAgIGZ1bmN0aW9uYWxpdHkgb2YgYHhfbWFrZV9nYycg aW4geGZucy5jLiAgKi8KKyAgICAgICAgICAgICAgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAg ICAgICAgICAgICAgJiYgcmVnaW9uX2luX2JvdW5kc19wCisgICAgICAgICAgICAgICAgICAmJiBh Y3RpdmVfcCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBlbnVtIGZhY2Vf aWQgaG9sbG93X2FjdGl2ZV9yZWdpb25fZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBm LCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItcmVnaW9uLWZhY2UiKSwgdHJ1ZSk7CisgICAg ICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9yZWdpb25fZmFjZSA9IEZB Q0VfRlJPTV9JRCAoZiwgaG9sbG93X2FjdGl2ZV9yZWdpb25fZmFjZV9pZCk7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G9sbG93X2luYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQp OworICAgICAgICAgICAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExB WSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2luYWN0aXZlX2ZhY2Ut PmJhY2tncm91bmQpOworICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgYmxv Y2tfaW5wdXQgKCk7CisgICAgICAgICAgICAgIC8qIEZvcmNlIGBtY194X3NldF9jdXJzb3JfZ2Mn IHRvIHVzZSBgcy0+Zi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djJy4gICovCisgICAgICAgICAg ICAgIGJvb2wgY3Vyc29yX2djX3AgPSB0cnVlOworICAgICAgICAgICAgICBtY19kcmF3X2N1cnNv cl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4LCBocG9zLCB2cG9zLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNsLCBnbHlwaF9mbGF2b3IsIGN1cnNv cl90eXBlLCB3ZCwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJ U1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIHhnY3YuZm9yZWdyb3VuZCk7 CisgICAgICAgICAgICAgIFhTZXRCYWNrZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5v dXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIHhnY3YuYmFja2dyb3VuZCk7CisgICAgICAgICAgICAg IHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgICAgIC8qIERyYXcgdGhlIGZyYW1lIGFyb3Vu ZCB0aGUgYm94LiAqLworICAgICAgICAgICAgICBtY194X2RyYXdfaG9sbG93X2N1cnNvciAodywg bWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAg ICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfSE9MTE9XX0JPWDoKKyAgICB7 CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49 IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1 dF9kYXRhLngtPmN1cnNvcl9waXhlbCcuICAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngt PmN1cnNvcl9waXhlbCA9IGNvbG9yLnBpeGVsOworICAgICAgICAgIG1jX3hfZHJhd19ob2xsb3df Y3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7 CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vy c29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICBtY194X2RyYXdf aG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywg d2QsIGgpOworICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAg ICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVl ID49IDApCisgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+ Y3Vyc29yX2djJyBieSBib3Jyb3dpbmcgdGhlCisgICAgICAgIGZ1bmN0aW9uYWxpdHkgb2YgYHhf bWFrZV9nYycgaW4geGZucy5jLiAgKi8KKyAgICAgICAgeworICAgICAgICAgIGJsb2NrX2lucHV0 ICgpOworICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5v dXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIEZSQU1FX0JBQ0tHUk9VTkRfUElYRUwgKGYpKTsKKyAg ICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2Rh dGEueC0+Y3Vyc29yX2djLCBjb2xvci5waXhlbCk7CisgICAgICAgICAgLyogRm9yY2UgYG1jX3hf c2V0X2N1cnNvcl9nYycgdG8gdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MnLiAg Ki8KKyAgICAgICAgICBib29sIGN1cnNvcl9nY19wID0gdHJ1ZTsKKyAgICAgICAgICBtY19kcmF3 X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4LCBocG9zLCB2cG9z LCBsc2wsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgY3Vy c29yX3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOworICAgICAgICAgIFhTZXRGb3Jl Z3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2Ms IHhnY3YuZm9yZWdyb3VuZCk7CisgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElT UExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgeGdjdi5iYWNrZ3JvdW5kKTsK KyAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAg ICAgICAgICB7CisgICAgICAgICAgICBib29sIGN1cnNvcl9nY19wID0gZmFsc2U7CisgICAgICAg ICAgICBtY19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4 LCBocG9zLCB2cG9zLCBsc2wsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5 cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9wLCBjdXJzb3JfZ2NfcCk7CisgICAg ICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfQkFSOgorICAgIHsKKyAg ICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkK KyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2Rh dGEueC0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vy c29yX3BpeGVsID0gY29sb3IucGl4ZWw7CisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNp YmxlX29rYXlfcCA9IHRydWU7CisgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1h dHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLCBjdXJzb3Jfd2lkdGgs IE1DX0JBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIGYtPm91dHB1 dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAg fQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2Nf aW52aXNpYmxlX29rYXlfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJz b3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLCBjdXJz b3Jfd2lkdGgsIE1DX0JBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAg IH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0hCQVI6CisgICAgeworICAgICAg aWYgKGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wuYmx1ZSA+PSAwKQorICAg ICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54 LT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3Jf cGl4ZWwgPSBjb2xvci5waXhlbDsKKyAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVf b2theV9wID0gdHJ1ZTsKKyAgICAgICAgICBtY194X2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4 LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsIGN1cnNvcl93aWR0aCwgTUNf SEJBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIGYtPm91dHB1dF9k YXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQor ICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52 aXNpYmxlX29rYXlfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJzb3Ig KHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLCBjdXJzb3Jf d2lkdGgsIE1DX0hCQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICB9 CisgICAgICBicmVhazsKKyAgICB9CisgICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgp OworICB9CisgICAgICAgIH0KKyNpZmRlZiBIQVZFX1hfSTE4TgorICBpZiAodyA9PSBYV0lORE9X IChmLT5zZWxlY3RlZF93aW5kb3cpKQorICAgIGlmIChGUkFNRV9YSUMgKGYpICYmIChGUkFNRV9Y SUNfU1RZTEUgKGYpICYgWElNUHJlZWRpdFBvc2l0aW9uKSkKKyAgICAgIHhpY19zZXRfcHJlZWRp dGFyZWEgKHcsIHgsIHkpOworI2VuZGlmCisgICAgfQorICBYRmx1c2ggKEZSQU1FX1hfRElTUExB WSAoZikpOworfQorCisvKiBEcmF3IHN0cmV0Y2ggZ2x5cGggc3RyaW5nIFMuICAqLworc3RhdGlj IHZvaWQKK21jX3hfZHJhd19zdHJldGNoX2dseXBoX3N0cmluZyAoc3RydWN0IGdseXBoX3N0cmlu ZyAqcykKK3sKKyAgZWFzc2VydCAocy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gU1RSRVRDSF9HTFlQ SCk7CisgIGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUgorICAgICAgJiYgIXhfc3RyZXRjaF9jdXJz b3JfcCkKKyAgICB7CisgICAgICAvKiBJZiBgeC1zdHJldGNoLWN1cnNvcicgaXMgbmlsLCBkb24n dCBkcmF3IGEgYmxvY2sgY3Vyc29yIGFzCisgICB3aWRlIGFzIHRoZSBzdHJldGNoIGdseXBoLiAg Ki8KKyAgICAgIGludCB3aWR0aCwgYmFja2dyb3VuZF93aWR0aCA9IHMtPmJhY2tncm91bmRfd2lk dGg7CisgICAgICBpbnQgeCA9IHMtPng7CisgICAgICBpZiAoIXMtPnJvdy0+cmV2ZXJzZWRfcCkK KyAgeworICAgIGludCBsZWZ0X3ggPSB3aW5kb3dfYm94X2xlZnRfb2Zmc2V0IChzLT53LCBURVhU X0FSRUEpOworICAgIGlmICh4IDwgbGVmdF94KQorICAgICAgeworICAgICAgICBiYWNrZ3JvdW5k X3dpZHRo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IEZBQ0VfVU5ERVJfV0FWRSkKKyAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAg ICAgICAgICB4X2RyYXdfdW5kZXJ3YXZlIChzKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIFhHQ1ZhbHVlcyB4Z2N2OworICAgICAgICAg ICAgICAgICAgWEdldEdDVmFsdWVzIChzLT5kaXNwbGF5LCBzLT5nYywgR0NGb3JlZ3JvdW5kLCAm eGdjdik7CisgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwgcy0+ Z2MsIHMtPmZhY2UtPnVuZGVybGluZV9jb2xvcik7CisgICAgICAgICAgICAgICAgICB4X2RyYXdf dW5kZXJ3YXZlIChzKTsKKyAgICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChzLT5kaXNw bGF5LCBzLT5nYywgeGdjdi5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICB9CisgICAgICAgICAgZWxzZSBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFD RV9VTkRFUl9MSU5FKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICB1bnNpZ25lZCBsb25n IHRoaWNrbmVzcywgcG9zaXRpb247CisgICAgICAgICAgICAgIGludCB5OworICAgICAgICAgICAg ICBpZiAocy0+cHJldiAmJiBzLT5wcmV2LT5mYWNlLT51bmRlcmxpbmVfcAorICAgICAgJiYgcy0+ cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIC8qIFdlIHVzZSB0aGUgc2FtZSB1bmRlcmxpbmUg c3R5bGUgYXMgdGhlIHByZXZpb3VzIG9uZS4gICovCisgICAgICAgICAgICAgICAgICB0aGlja25l c3MgPSBzLT5wcmV2LT51bmRlcmxpbmVfdGhpY2tuZXNzOworICAgICAgICAgICAgICAgICAgcG9z aXRpb24gPSBzLT5wcmV2LT51bmRlcmxpbmVfcG9zaXRpb247CisgICAgICAgICAgICAgICAgfQor ICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg LyogR2V0IHRoZSB1bmRlcmxpbmUgdGhpY2tuZXNzLiAgRGVmYXVsdCBpcyAxIHBpeGVsLiAgKi8K KyAgICAgICAgICAgICAgICAgIGlmIChzLT5mb250ICYmIHMtPmZvbnQtPnVuZGVybGluZV90aGlj a25lc3MgPiAwKQorICAgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSBzLT5mb250LT51bmRl cmxpbmVfdGhpY2tuZXNzOworICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAg ICAgICB0aGlja25lc3MgPSAxOworICAgICAgICAgICAgICAgICAgaWYgKHhfdW5kZXJsaW5lX2F0 X2Rlc2NlbnRfbGluZSkKKyAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+aGVpZ2h0 IC0gdGhpY2tuZXNzKSAtIChzLT55YmFzZSAtIHMtPnkpOworICAgICAgICAgICAgICAgICAgZWxz ZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgLyogR2V0IHRo ZSB1bmRlcmxpbmUgcG9zaXRpb24uICBUaGlzIGlzIHRoZSByZWNvbW1lbmRlZAorICAgICAgICAg ICAgICAgICAgICAgICAgIHZlcnRpY2FsIG9mZnNldCBpbiBwaXhlbHMgZnJvbSB0aGUgYmFzZWxp bmUgdG8gdGhlIHRvcCBvZgorICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSB1bmRlcmxpbmUu ICBUaGlzIGlzIGEgc2lnbmVkIHZhbHVlIGFjY29yZGluZyB0byB0aGUKKyAgICAgICAgICAgICAg ICAgICAgICAgICBzcGVjcywgYW5kIGl0cyBkZWZhdWx0IGlzCisgICAgICAgICAgICAgICAgICAg ICAgICAgUk9VTkQgKChtYXhpbXVtIGRlc2NlbnQpIC8gMiksIHdpdGgKKyAgICAgICAgICAgICAg ICAgICAgICAgICBST1VORCh4KSA9IGZsb29yICh4ICsgMC41KSAgKi8KKyAgICAgICAgICAgICAg ICAgICAgICBpZiAoeF91c2VfdW5kZXJsaW5lX3Bvc2l0aW9uX3Byb3BlcnRpZXMKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgcy0+Zm9udCAmJiBzLT5mb250LT51bmRlcmxpbmVfcG9zaXRp b24gPj0gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gcy0+Zm9udC0+dW5k ZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHMtPmZvbnQp CisgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5mb250LT5kZXNjZW50ICsg MSkgLyAyOworICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAg ICAgIHBvc2l0aW9uID0gdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0OworICAgICAgICAgICAgICAg ICAgICB9CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IG1heCAocG9zaXRpb24sIHVuZGVy bGluZV9taW5pbXVtX29mZnNldCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAv KiBDaGVjayB0aGUgc2FuaXR5IG9mIHRoaWNrbmVzcyBhbmQgcG9zaXRpb24uICBXZSBzaG91bGQK KyAgICAgICAgICAgICAgICAgYXZvaWQgZHJhd2luZyB1bmRlcmxpbmUgb3V0IG9mIHRoZSBjdXJy ZW50IGxpbmUgYXJlYS4gICovCisgICAgICAgICAgICAgIGlmIChzLT55ICsgcy0+aGVpZ2h0IDw9 IHMtPnliYXNlICsgcG9zaXRpb24pCisgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+aGVp Z2h0IC0gMSkgLSAocy0+eWJhc2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgaWYgKHMtPnkgKyBz LT5oZWlnaHQgPCBzLT55YmFzZSArIHBvc2l0aW9uICsgdGhpY2tuZXNzKQorICAgICAgICAgICAg ICAgIHRoaWNrbmVzcyA9IChzLT55ICsgcy0+aGVpZ2h0KSAtIChzLT55YmFzZSArIHBvc2l0aW9u KTsKKyAgICAgICAgICAgICAgcy0+dW5kZXJsaW5lX3RoaWNrbmVzcyA9IHRoaWNrbmVzczsKKyAg ICAgICAgICAgICAgcy0+dW5kZXJsaW5lX3Bvc2l0aW9uID0gcG9zaXRpb247CisgICAgICAgICAg ICAgIHkgPSBzLT55YmFzZSArIHBvc2l0aW9uOworICAgICAgICAgICAgICBpZiAocy0+ZmFjZS0+ dW5kZXJsaW5lX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgICAgIHhfZmlsbF9yZWN0YW5nbGUg KHMtPmYsIHMtPmdjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzLT54LCB5LCBz LT53aWR0aCwgdGhpY2tuZXNzKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgIFhHQ1ZhbHVlcyB4Z2N2OworICAgICAgICAgICAgICAgICAg WEdldEdDVmFsdWVzIChzLT5kaXNwbGF5LCBzLT5nYywgR0NGb3JlZ3JvdW5kLCAmeGdjdik7Cisg ICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwgcy0+Z2MsIHMtPmZh Y2UtPnVuZGVybGluZV9jb2xvcik7CisgICAgICAgICAgICAgICAgICB4X2ZpbGxfcmVjdGFuZ2xl IChzLT5mLCBzLT5nYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzLT54LCB5 LCBzLT53aWR0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VNFX1hJTQogYm9vbCB1c2VfeGltID0gdHJ1ZTsKQEAgLTk5OSw2ICsxODYyLDE1 IEBAIHhfdXBkYXRlX2JlZ2luIChzdHJ1Y3QgZnJhbWUgKmYpCiAgIGlmIChGUkFNRV9UT09MVElQ X1AgKGYpICYmICFGUkFNRV9WSVNJQkxFX1AgKGYpKQogICAgIHJldHVybjsKIAorCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5tY191cGRh dGluZ19mcmFtZSA9IGY7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgaWYgKCEg RlJBTUVfQ1JfU1VSRkFDRSAoZikpCiAgICAgewogICAgICAgaW50IHdpZHRoLCBoZWlnaHQ7CkBA IC0xMjY2LDYgKzIxMzgsMTYgQEAgeF91cGRhdGVfZW5kIChzdHJ1Y3QgZnJhbWUgKmYpCiAgIFhG bHVzaCAoRlJBTUVfWF9ESVNQTEFZIChmKSk7CiAgIHVuYmxvY2tfaW5wdXQgKCk7CiAjZW5kaWYK KworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwor ICBmLT5tY191cGRhdGluZ19mcmFtZSA9IE5VTEw7CisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKIH0KIAogLyogVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgZnJvbSB2YXJpb3VzIHBsYWNl cyBpbiB4ZGlzcC5jCkBAIC0xMzEwMCw2ICsxMzk4MiwyMSBAQCB4X2FjdGl2YXRlX3RpbWVvdXRf YXRpbWVyICh2b2lkKQogCiBzdGF0aWMgc3RydWN0IHJlZGlzcGxheV9pbnRlcmZhY2UgeF9yZWRp c3BsYXlfaW50ZXJmYWNlID0KICAgeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyog TVVMVElQTEUtQ1VSU09SUyAqLworCisvKiBgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYHh0ZXJt LmNgIG11c3QgYmUgaW4gdGhlIGV4YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitgcmVkaXNwbGF5X2lu dGVyZmFjZScgaW4gYGRpc3BleHRlcm4uaGAhICovCisKKyAgbWNfeF93cml0ZV9nbHlwaHMsCisg IG1jX3hfZHJhd193aW5kb3dfY3Vyc29yLAorICBtY194X2RyYXdfZ2x5cGhfc3RyaW5nLAorCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgeF9mcmFtZV9wYXJtX2hhbmRsZXJzLAog ICAgIHhfcHJvZHVjZV9nbHlwaHMsCiAgICAgeF93cml0ZV9nbHlwaHMsCg== --Multipart_Mon_May__6_11:39:09_2019-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs). References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Tue, 28 May 2019 08:33:03 +0000 Resent-Message-ID: <handler.22873.B22873.155903233213128 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22873 <at> debbugs.gnu.org,17684 <at> debbugs.gnu.org Cc: eliz@HIDDEN, johnw@HIDDEN, mbork@HIDDEN, rms@HIDDEN, akioburns@HIDDEN Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.155903233213128 (code B ref 22873); Tue, 28 May 2019 08:33:03 +0000 Received: (at 22873) by debbugs.gnu.org; 28 May 2019 08:32:12 +0000 Received: from localhost ([127.0.0.1]:55016 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1hVXWm-0003Pg-8Z for submit <at> debbugs.gnu.org; Tue, 28 May 2019 04:32:12 -0400 Received: from gateway21.websitewelcome.com ([192.185.46.109]:41706) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1hVXWa-0003On-LA for 22873 <at> debbugs.gnu.org; Tue, 28 May 2019 04:32:01 -0400 Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway21.websitewelcome.com (Postfix) with ESMTP id 47BF4400CCC83 for <22873 <at> debbugs.gnu.org>; Tue, 28 May 2019 03:32:00 -0500 (CDT) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id VXWZhiIB22qH7VXWZhwJGM; Tue, 28 May 2019 03:32:00 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=YZRqbwAdAzJhhL5gkjC6V91iQO8LSYavPEkyTLEojog=; b=SfXSaNXD6PEY7pAk9sR4Aqlb7U MjnmlNb/wUR/bJd32J7zBa8T7v37WOEI3DxvfPVpQGSs961Ln0amRpzdWqLimC0lQylwrvdw2Ayh/ 7hO1HIS9u0wFlsUF/uXRmz48c/4hh0BE+AdtpeccSJ6PSS31Bq/IhERp6nCN+UctgLZiMItjVwV/y L6ApZPPUjHoPa/tixOD+M4tIBo9qMiGF+6kfjQMGRbvpcGobPf9Y2QAU+QQ6i2LvjSnEdWiLK4YJp 0unMiTpVZF8CJt8c0mHEjOhPxbjUuIIQCBIQkZCiKABBCWmraEM4TA3+0bVZB6DuxTdlas9cUbLiq L7/vG2LQ==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:57484 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from <esq@HIDDEN>) id 1hVXWV-000zOR-N6; Tue, 28 May 2019 03:31:58 -0500 Date: Tue, 28 May 2019 01:31:55 -0700 Message-ID: <m2r28jt1xg.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Tue_May_28_01:31:54_2019-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1hVXWV-000zOR-N6 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:57484 X-Source-Auth: lawlist X-Email-Count: 7 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> --Multipart_Tue_May_28_01:31:54_2019-1 Content-Type: text/plain; charset=US-ASCII VERSION: 020.000 [05/27/2019] CHANGELOG: - Consolidated all caches of fake cursors into one master window struct/matrix, which is uncoincidentally somewhat similar in design to the glyph_matrix. - Removing and drawing fake cursors is now mostly limited to the ones that have changed since the previous redisplay. A dry-run of what the prospective `w->current_matrix` will be at tail end of `update_window' is performed at the outset thereof -- without actually writing any glyphs to the glass. During the dry-run, a new cache of fake cursors is created and it is compared to the old cache of fake cursors. Anything that is different gets erased and just the new ones get drawn. As to scrolling the text on the glass directly _before_ `update_window' is called -- `try_window_reusing_current_matrix' and `try_window_id' -- fake cursors are erased from min (r.current_y, r.desired_y) to the top of the mode-line, and any fake cursors above the min (supra) remain. - The multiple fake cursors feature now includes a current column check for each visible cursor and odd/even column colors are assigned if the user has not specified a color preference in the `mc_conf' for the particular cursor being drawn. - Miscellaneous bug fixes. SETUP: Step 1: git clone -b master git://git.sv.gnu.org/emacs.git Step 2: In the new emacs folder, go back to an Emacs version from 04/08/2019: git reset --hard a038df77de7b1aa2d73a6478493b8838b59e4982 Step 3: From within the new emacs folder created in Step 1, apply the patch: git apply /path/to/the/patch.diff Step 4: ./autogen.sh Step 5: ./configure ... [your custom options] Step 6: make Step 7: make install USAGE: - For a minimal working example of built-in fake cursors, type: M-x mc-test ;;; TURN ON FAKE CURSORS (buffer position, cursor-type, cursor color): (setq mc-conf '((1 "hbar" "magenta") (2 "bar" "purple") (3 "box" "#00FF00") (4 "hollow" "#0000FF") (5 ("hbar" 3) [1.0 0.0 1.0]) (6 ("bar" 3) [0.0 1.0 1.0]) (7 "framed" "OrangeRed")))) ;;; TURN OFF FAKE CURSORS: (setq mc-conf nil) - To try out the crosshairs feature, type: M-x +-mode - To try out built-in fake cursors with Magnar Sveen's multiple-cursors package, install that package first. [If the multiple-cursors package is installed, an eval-after-load "multiple-cursors-core" statement within `crosshairs.el` will redefine a couple of functions and set up a few keyboard shortcuts.] If the multiple-cursors package by Magnar Sveen is not already installed, then here are two easy ways to install that package: Type: M-x mc-install OR, evaluate the following snippet: (progn (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) (package-refresh-contents) (package-install 'multiple-cursors)) TODO: - Free memory of w->mc_matrix whenever its associated window ceases to exist. - Consider adding support for different colors when fake cursors are _at_ ZV versus _beyond_ ZV, including, but not limited to the right fringe bitmaps for a cursor at fringe and a cursor beyond the fringe. - `mc_ns_clip_to_rect' is not working as expected. `ns_draw_window_cursor' calls `ns_clip_to_rect', which does _not_ take `row->clip` into consideration when drawing cursors with `NSRectFill'. When it comes time to draw glyphs on top of the box/hollow family of cursors, `row->clip` is taken into consideration by `get_glyph_string_clip'. Fake cursors can be drawn even though the glyphs cannot, resulting in hollow/box family of cursors without text. The issue can be reproduced by calling M-x mc-test and then moving the cursor left/right -- a thick hbar-looking rectangle forms underneath the characters in the boxes. [Reproduction of the issue assumes `mc_ns_intersect_rectangles' is enabled.] https://lists.gnu.org/archive/html/emacs-devel/2019-04/msg00009.html - `mc_ns_draw_overwritten' is not working as expected. It appears that fake cursors are drawn outside of the area clipped, sometimes resulting in cursor fragments that are drawn in a different window; e.g., a top/bottom window split with the top window having crosshairs active. Initial attempts at calling `mc_ns_clip_to_rect' from within `mc_ns_draw_overwritten' produced flickering of lines (presumably in the relevant vicinity). - Add additional support for `ch_inactive_windows' and `fc_inactive_windows' when the variables have a `nil` value. In such a case, the inactive windows should not display the crosshairs and/or visible fill column indicator. - Deal with left/right overwritten glyphs in the w32 and X ports of Emacs. - Is there any additional meaningful optimization that can be added to the three calls of `mc_pre_scroll_clean'? - NOTE: As to `mc_scrolling_window', it would appear that there is no tangible benefit to rotating the current/prospective cache of fake cursors to compare the data before removing the fake cursors. When scrolling the display, only _some_ lines are copied to new locations. Areas that are not overwritten may have fake cursors and those may not necessarily be removed if desired/current matrix glyphs are equal. The test for `GLYPH_EQUAL_P' does not take into consideration the existence of a fake cursor, and the glyph (with a fake cursor) may not be updated as a result thereof. As to lines that are not copied, portions may be updated and fake cursors would be removed thereby. - When an idle-timer fires and point is at the end of a horizontally scrolled line in a narrow window, the temporary horizontal scroll is canceled. Create an minimal working example and file a bug report. - There is a bug affecting an older version of Emacs for the NS port that causes partial line flickering when the same characters are grouped together (;;;;;;) and MC_GLYPHLESS cursors are above or below -- having the same background color as the frame; e.g., black on black (used to erase a glyphless cursor). The partial flickering is only noticeable with rapid fire; e.g., holding down the right/left arrow key. When changing the color of the glyphless cursor, the issue is not present. [@lawlist has verified that the X and HPOS coordinates are accurate.] - There is a bug affecting the recorded `w->mc.lnum_pixel_width` that is observable when not running under gdb, but disappears when running under gdb. While viewing a folded org-mode buffer, the non-gdb instance had a visible line number pixel-width of 44, but Emacs treated it as fluctuating between 44 and 55 as the cursor was moved to the end of line. In the gdb instance, the visible line number pixel width was 55 with no fluctuation under the same conditions as the non-gdb instance. This appears to be a different bug than bug#32177 (current line number shifts one column to the left) because the line number of the current line does not shift left, and changing the bidi settings did not correct the issue. - The current test for `auto_hscroll_mode_p' only looks for `current_line` and all five related tests are based upon that assumption, which may not be true. - Multiple Cursors: If point is in the middle of a composite character, then select a fully composed character so that the fake cursor is visible. - Implement functionality similar to the Lisp multiple-cursors by Magnar Sveen. - Follow up with the Emacs team re bug#32177; i.e., (Current line number shifts one column to the left.) - Follow up with the Emacs team re bug#32060; i.e., Horizontal Scrolling (Current Line): Wrong line gets h-scrolled. - Determine if bug #28936 needs to be fixed and help the Emacs team re same. --Multipart_Tue_May_28_01:31:54_2019-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="2019_05_27__21_42_30_553.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvY3Jvc3NoYWlycy5lbCBiL2xpc3AvY3Jvc3NoYWlycy5lbApuZXcg ZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4zYmJkNjk3Ci0tLSAvZGV2L251bGwKKysr IGIvbGlzcC9jcm9zc2hhaXJzLmVsCkBAIC0wLDAgKzEsMTI4MiBAQAorOzs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Cis7OzsgQkVHSU4gbW9kaWZpY2F0aW9uIG9mIHRoZSBNdWx0aXBsZSBDdXJzb3Jz IGxpYnJhcnkgd3JpdHRlbiBieSAgTWFnbmFyIFN2ZWVuLgorCisoZGVmdmFyIHBhY2thZ2UtYXJj aGl2ZXMpCisKKyhkZWZ2YXIgbWMtLW1heC1jdXJzb3JzLW9yaWdpbmFsKQorKGRlZnZhciBtYy9t YXgtY3Vyc29ycykKKyhkZWZ2YXIgbWMtLW1heC1jdXJzb3JzLW9yaWdpbmFsKQorKGRlZnZhciBt Yy9tYXgtY3Vyc29ycykKKyhkZWZ2YXIgbWMvYWx3YXlzLXJ1bi1mb3ItYWxsKQorKGRlZnZhciBt Yy0tdGhpcy1jb21tYW5kKQorKGRlZnZhciBtYy9jbWRzLXRvLXJ1bi1vbmNlKQorKGRlZnZhciBt Yy0tZGVmYXVsdC1jbWRzLXRvLXJ1bi1mb3It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ZCkKKyAgICAgICAgICAgICAgICAgICAgKG1lc3NhZ2UgIiVTIGlzIG5vdCBzdXBwb3J0 ZWQgd2l0aCBtdWx0aXBsZSBjdXJzb3JzJXMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg IG9yaWdpbmFsLWNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdldCBvcmln aW5hbC1jb21tYW5kICdtYy0tdW5zdXBwb3J0ZWQpKQorICAgICAgICAgICAgICAgICAgKHdoZW4g KGFuZCBvcmlnaW5hbC1jb21tYW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChub3Qg KG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy0tZGVmYXVsdC1jbWRzLXRvLXJ1bi1vbmNlKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKG5vdCAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1j L2NtZHMtdG8tcnVuLW9uY2UpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAob3IgbWMv YWx3YXlzLXJ1bi1mb3ItYWxsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVt cSBvcmlnaW5hbC1jb21tYW5kIG1jLS1kZWZhdWx0LWNtZHMtdG8tcnVuLWZvci1hbGwpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jL2Nt ZHMtdG8tcnVuLWZvci1hbGwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWMv cHJvbXB0LWZvci1pbmNsdXNpb24taW4td2hpdGVsaXN0IG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAg ICAgICAgICAgICAgICAgICAgKG1jL2V4ZWN1dGUtY29tbWFuZC1mb3ItYWxsLWZha2UtY3Vyc29y cyBvcmlnaW5hbC1jb21tYW5kKSkpKQorICAgICAgICAgICAgICAod2hlbiBtYy91c2UtYnVpbHQt aW4tY3Vyc29ycworICA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cGx5aW5nIGVhY2ggZWxlbWVudCBvZiB0aGUgTFNM IGNvbG9yIHZlY3RvciBieSA2NTUzNS4iCisoaW50ZXJhY3RpdmUpCisgIChsZXQgKChidWZmZXIg KGdldC1idWZmZXItY3JlYXRlICIqTUMtVEVTVCoiKSkpCisgICAgKHdpdGgtY3VycmVudC1idWZm ZXIgYnVmZmVyCisgICAgICAoZXJhc2UtYnVmZmVyKQorICAgICAgKGluc2VydCAiVGhpcyBpcyBh IHRlc3QhIikKKyAgICAgIChzZXRxIG1jLWNvbmYgJygoMSAiaGJhciIgIm1hZ2VudGEiKQorICAg ICAgICAgICAgICAgICAgICAgICgyICJiYXIiICJwdXJwbGUiKQorICAgICAgICAgICAgICAgICAg ICAgICgzICJib3giICIjMDBGRjAwIikKKyAgICAgICAgICAgICAgICAgICAgICAoNCAiaG9sbG93 IiAiIzAwMDBGRiIpCisgICAgICAgICAgICAgICAgICAgICAgKDUgKCJoYmFyIiAzKSBbMS4wIDAu MCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg2ICgiYmFyIiAzKSBbMC4wIDEuMCAxLjBd KQorICAgICAgICAgICAgICAgICAgICAgICg3ICJmcmFtZWQiICJPcmFuZ2VSZWQiKQorICAgICAg ICAgICAgICAgICAgICAgICg4ICJib3giICJncmV5MjUiKQorICAgICAgICAgICAgICAgICAgICAg ICg5ICJib3giICJncmV5NzUiKSkpKQorICAgIChzZWxlY3Qtd2luZG93IChkaXNwbGF5LWJ1ZmZl ciBidWZmZXIpKSkpCisKKyhkZWZ1biArLXRpbWVyLWZuICgpCisiU2luY2UgdGhpcyBmaXJlcyBn bG9iYWxseSwgd2UgbXVzdCBjb250cm9sIHdoaWNoIGJ1ZmZlcnMgY3Jvc3NoYWlycyBhcHBlYXIg aW4uIgorICAod2hlbiArLW1vZGUKKyAgICAodW5sZXNzIChvciAobWVtcSBsYXN0LWNvbW1hbmQg Ky1wYXJlbnMtZXhjbHVzaW9ucykKKyAgICAgICAgICAgICAgICAobnVsbCArLXBhcmVucy1wKSkK KyAgICAgICgrLXBhcmVucy1mbikpCisgICAgKHdoZW4gKy10aW1lci12YXIKKyAgICAgIChzZXRx IHRpbWVyLWlkbGUtbGlzdCAoZGVscSArLXRpbWVyLXZhciB0aW1lci1pZGxlLWxpc3QpKQorICAg ICAgKHNldHEgKy10aW1lci12YXIgbmlsKSkpKQorCisoZGVmdW4gKy1kcmF3LWZvcnRod2l0aCAo KQorIkltbWVkaWF0ZWx5IGRlbGV0ZS9kcmF3IG1hdGNoaW5nIHBhcmVudGhlc2VzLiIKKyAgKCst ZHJhdy1jcm9zc2hhaXJzICdmb3JjZSkpCisKKyhkZWZ1biArLWRyYXctY3Jvc3NoYWlycyAoJm9w dGlvbmFsIGZvcmNlKQorIkltbWVkaWF0ZWx5IGRlbGV0ZSBtYXRjaGluZyBwYXJlbnRoZXNlcy4g IElmIEZPUkNFIGlzIG5vbi1uaWwsIHRoZW4gaW1tZWRpYXRlbHkKK2RyYXcgbWF0Y2hpbmcgcGFy ZW50aGVzaXM7IG90aGVyd2lzZSwgZHJhdyB0aGVtIG9uIGFuIGlkbGUtdGllci4iCisgICh3aGVu ICstbW9kZQorICAgICh3aGVuICstdGltZXItdmFyCisgICAgICAoc2V0cSB0aW1lci1pZGxlLWxp c3QgKGRlbHEgKy10aW1lci12YXIgdGltZXItaWRsZS1saXN0KSkKKyAgICAgIChzZXRxICstdGlt ZXItdmFyIG5pbCkpCisgICAgKHVubGVzcyAob3IgKG1lbXEgdGhpcy1jb21tYW5kICstcGFyZW5z LWV4Y2x1c2lvbnMpCisgICAgICAgICAgICAgICAgKGFuZCAobnVsbCArLXBhcmVucy1wKQorICAg ICAgICAgICAgICAgICAgICAgKG51bGwgKy1wYXJlbnMtb3ZlcmxheXMtZXhpc3QtcCkpKQorICAg ICAgKCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykpCisgICAgKGlmIGZvcmNlCisgICAgICAocHJv Z24KKyAgICAgICAgKHdoZW4gKy1wYXJlbnMtcAorICAgICAgICAgICgrLXBhcmVucy1mbikpKQor ICAgICAgKHNldHEgKy10aW1lci12YXIgKHJ1bi13aXRoLWlkbGUtdGltZXIgKy1pZGxlLXRpbWVy LXNlY29uZHMgbmlsICMnKy10aW1lci1mbikpKSkpCisKKyhkZWZ2YXIgZmMtbW9kZSkKKworOzs7 IyMjYXV0b2xvYWQKKyhkZWZpbmUtbWlub3ItbW9kZSArLW1vZGUKKyJNaW5vciBtb2RlIGZvciBk aXNwbGF5aW5nIGEgaG9yaXpvbnRhbCBydWxlci4iCisgIDppbml0LXZhbHVlIG5pbAorICA6bGln aHRlciAiICsiCisgIDprZXltYXAgbmlsCisgIDpnbG9iYWwgbmlsCisgIDpncm91cCAnKy1tb2Rl CisgIChjb25kCisgICAgKCstbW9kZQorICAgICAgOzs7IGArLW1vZGUnIGhhcyB0aGUgYWJpbGl0 eSB0byBhbHNvIGRpc3BsYXkgYSBmaWxsIGNvbHVtbiBpbmRpY2F0b3IuCisgICAgICA7OzsgU2Vl IHRoZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicuCisgICAgICAod2hlbiBmYy1tb2RlCisgICAg ICAgIChmYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgZ2xvYmFsLWVsZG9jLW1vZGUKKyAg ICAgICAgICAgICAgICAgKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAgJ2FueSkKKyAgICAgICAgICAg ICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAgICAgICAgKGdsb2JhbC1l bGRvYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgaml0LWxvY2stY29udGV4dC10aW1lcgor ICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAg ICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAod2hlbiAo dGltZXJwIGppdC1sb2NrLWNvbnRleHQtdGltZXIpCisgICAgICAgICAgKGNhbmNlbC10aW1lciBq aXQtbG9jay1jb250ZXh0LXRpbWVyKSkKKyAgICAgICAgOzsgKHNldHEgaml0LWxvY2stY29udGV4 dC10aW1lciAocnVuLXdpdGgtaWRsZS10aW1lciA1LjAgJ3JlcGVhdCAnaml0LWxvY2stY29udGV4 dC1mb250aWZ5KSkKKyAgICAgICAgKHNldHEgaml0LWxvY2stY29udGV4dC10aW1lciBuaWwpKQor ICAgICAgKHdoZW4gKGFuZCAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAg ICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAod2hlbiAo dGltZXJwIHVuZG8tYXV0by1jdXJyZW50LWJvdW5kYXJ5LXRpbWVyKQorICAgICAgICAgIChjYW5j ZWwtdGltZXIgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpKQorICAgICAgICAoZnNl dCAndW5kby1hdXRvLS11bmRvYWJsZS1jaGFuZ2UKKyAgICAgICAgICAgICAgKGxhbWJkYSAoKSAo YWRkLXRvLWxpc3QgJ3VuZG8tYXV0by0tdW5kb2FibHktY2hhbmdlZC1idWZmZXJzIChjdXJyZW50 LWJ1ZmZlcikpKSkKKyAgICAgICAgKGZzZXQgJ3VuZG8tYXV0by1hbWFsZ2FtYXRlICdpZ25vcmUp KQorICAgICAgKHdoZW4gYmxpbmstY3Vyc29yLW1vZGUKKyAgICAgICAgKGJsaW5rLWN1cnNvci1t b2RlIC0xKQorICAgICAgICAod2hlbiAobWVtcSAnYmxpbmstY3Vyc29yLWNoZWNrIHBvc3QtY29t bWFuZC1ob29rKQorICAgICAgICAgIChyZW1vdmUtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJ2Js aW5rLWN1cnNvci1jaGVjaykpKQorICAgICAgKHNldHEgY3Jvc3NoYWlycyB0KQorICAgICAgKHdo ZW4gKy1maWxsLWNvbHVt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3BsYXktdGFibGUKKyAgICAgICAgICAgICAg ICAgICAgIGZyaW5nZS1pbmRpY2F0b3ItYWxpc3QKKyAgICAgICAgICAgICAgICAgICAgIHRhYi13 aWR0aAorICAgICAgICAgICAgICAgICAgICAgbGluZS1tb3ZlLXZpc3VhbAorICAgICAgICAgICAg ICAgICAgICAgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgICAgICAgICAgICAgIHRydW5jYXRlLXBh cnRpYWwtd2lkdGgtd2luZG93cworICAgICAgICAgICAgICAgICAgICAgd29yZC13cmFwKSkKKyAg ICAgICAgKHdoZW4gKGxvY2FsLXZhcmlhYmxlLXAgdmFyKQorICAgICAgICAgIChwdXNoIChjb25z IHZhciAoc3ltYm9sLXZhbHVlIHZhcikpICstLXNhdmVkLXN0YXRlKSkpCisgICAgICAoc2V0cSBm aWxsLWNvbHVtbiA4MCkKKyAgICAgIChzZXRxIGRpc3BsYXktbGluZS1udW1iZXJzIHQpCisgICAg ICAoc2V0cS1sb2NhbCBhdXRvLWhzY3JvbGwtbW9kZSAnY3VycmVudC1saW5lKQorICAgICAgKHNl dHEtbG9jYWwgaHNjcm9sbC1zdGVwIDUpCisgICAgICAoc2V0cSBidWZmZXItZGlzcGxheS10YWJs ZSArLWJ1ZmZlci1kaXNwbGF5LXRhYmxlKQorICAgICAgKHNldHEgdGFiLXdpZHRoIDQpCisgICAg ICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICdsaW5lLW1vdmUtdmlzdWFsKSB0KQorICAgICAg KHNldHEgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgKGNvbmQKKyAgICAgICAgICAoKGxldCAoKGxz dCArLXRydW5jYXRlLWxpbmVzLWRlcml2ZWQtbW9kZXMpCisgICAgICAgICAgICAgICAgICBtb2Rl KQorICAgICAgICAgICAgKGNhdGNoICdmb3VuZAorICAgICAgICAgICAgICAod2hpbGUgKHNldHEg bW9kZSAocG9wIGxzdCkpCisgICAgICAgICAgICAgICAgKHdoZW4gKGRlcml2ZWQtbW9kZS1wIG1v ZGUpCisgICAgICAgICAgICAgICAgICAodGhyb3cgJ2ZvdW5kIHQpKSkpKSkKKyAgICAgICAgICAg KChtZW1xIG1ham9yLW1vZGUgKy10cnVuY2F0ZS1saW5lcy1tYWpvci1tb2RlcykpCisgICAgICAg ICAgICh0CisgICAgICAgICAgICAgbmlsKSkpCisgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlh YmxlICd0cnVuY2F0ZS1wYXJ0aWFsLXdpZHRoLXdpbmRvd3MpIG5pbCkKKyAgICAgIChzZXRxIHdv cmQtd3JhcCB0KQorICAgICAgKHNldHEgaW5kaWNhdGUtZW1wdHktbGluZXMgdCkKKyAgICAgIChz ZXRxIGluZGljYXRlLWJ1ZmZlci1ib3VuZGFyaWVzICdsZWZ0KQorICAgICAgKHNldHEgZnJpbmdl LWluZGljYXRvci1hbGlzdAorICAgICAgICAgIDs7OyBoc2NsX2FsbF90ZW1wX3AgfCBoc2NsX3Rl bXBfcAorICAgICAgICAnKCgrLWhzY2wtdGVtcCAuICgrLXNpbmdsZS1hbmdsZS1sZWZ0CisgICAg ICAgICAgICAgICAgICAgICAgICAgICstZG91YmxlLWFuZ2xlLWxlZnQpKQorICAgICAgICAgIDs7 OyBoc2NsX2FsbF9wZXJtXzBfcCB8IGhzY2xfYWxsX3Blcm1fMV9wIHwgaHNjbF9hbGxfcGVybV8y X3AgfCBoc2NsX3Blcm1fcAorICAgICAgICAgICgrLWhzY2wtcGVybSAuICgrLXNpbmdsZS1hbmds ZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLWRvdWJsZS1hbmdsZS11cAorICAgICAg ICAgICAgICAgICAgICAgICAgICArLXRyaXBsZS1hbmdsZS11cAorICAgICAgICAgICAgICAgICAg ICAgICAgICArLXF1YWRydXBsZS1hbmdsZS11cCkpCisgICAgICAgICAgKCstb3ZlcmxheS1hcnJv dyAuICgrLWZyaW5nZS1sZWZ0LWFycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAr LWZyaW5nZS1yaWdodC1hcnJvdykpCisgICAgICAgICAgKHRydW5jYXRpb24gLiAoKy1mcmluZ2Ut bGVmdC1hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICstZnJpbmdlLXJpZ2h0LWFycm93 KSkKKyAgICAgICAgICAoY29udGludWF0aW9uIC4gKCstZnJpbmdlLWxlZnQtY3VybHktYXJyb3cK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICstYmFja3NsYXNoKSkKKyAgICAgICAgICAob3Zl cmxheS1hcnJvdyAuICstZnJpbmdlLXJpZ2h0LXRyaWFuZ2xlKQorICAgICAgICAgICh1cCAuICst ZnJpbmdlLXVwLWFycm93KQorICAgICAgICAgIChkb3duIC4gKy1mcmluZ2UtZG93bi1hcnJvdykK KyAgICAgICAgICAodG9wIC4gKy1mcmluZ2UtdG9wLWxlZnQtYW5nbGUpCisgICAgICAgICAgKGJv dHRvbSAuICstZnJpbmdlLWJvdHRvbS1yaWdodC1hbmdsZSkKKyAgICAgICAgICAodG9wLWJvdHRv bSAuICgrLWZyaW5nZS1sZWZ0LWJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICArLWZy aW5nZS1yaWdodC1icmFja2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgKy1mcmluZ2UtdG9w LXJpZ2h0LWFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgKy1mcmluZ2UtdG9wLWxlZnQt YW5nbGUpKQorICAgICAgICAgIChlbXB0eS1saW5lIC4gKy1mcmluZ2UtZW1wdHktbGluZSkKKyAg ICAgICAgICAodW5rbm93biAuICstZnJpbmdlLXF1ZXN0aW9uLW1hcmspKSkKKyAgICAgIChzZXRx IGZyaW5nZS1jdXJzb3ItYWxpc3QgJygoYm94IC4gKy1mcmluZ2UtbGVmdC10cmlhbmdsZSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaG9sbG93IC4gKy1ob2xsb3ctcmVjdGFu Z2xlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChiYXIgLiArLXZlcnRpY2Fs LWJhcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaGJhciAuICstZnJpbmdl LWhvcml6b250YWwtYmFyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChob2xs b3ctc21hbGwgLiArLWZyaW5nZS1ob2xsb3ctc3F1YXJlKSkpCisgICAgICAoaWYgKG9yICstZm9y dGh3aXRoCisgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisg ICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJhdy1mb3J0aHdpdGggJ2Fw cGVuZCAnbG9jYWwpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJh dy1jcm9zc2hhaXJzICdhcHBlbmQgJ2xvY2FsKSkKKyAgICAgICh3aGVuICstZm9ydGh3aXRoCisg ICAgICAgIChhZGQtaG9vayAnd2luZG93LWNvbmZpZ3VyYXRpb24tY2hhbmdlLWhvb2sgJystZHJh dy1mb3J0aHdpdGggbmlsICdsb2NhbCkpCisgICAgICAoYWRkLWhvb2sgJ2NoYW5nZS1tYWpvci1t b2RlLWhvb2sgJ3R1cm4tb2ZmLSstbW9kZSBuaWwgJ2xvY2FsKQorICAgICAgKHdoZW4gKGNhbGxl ZC1pbnRlcmFjdGl2ZWx5LXAgJ2FueSkKKyAgICAgICAgKGNvbmQKKyAgICAgICAgICAoKy1mb3J0 aHdpdGgKKyAgICAgICAgICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScgLS0gRHJhdyBt YXRjaGluZyBwYXJlbnRoZXNlcyBpbW1lZGlhdGVseS4iKSkKKyAgICAgICAgICAoKGVxdWFsIGN1 cnJlbnQtcHJlZml4LWFyZyAnKDQpKQorICAgICAgICAgICAgOzs7IE1hdGNoaW5nIHBhcmVudGhl c2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ICAgICAoa2lsbC1sb2NhbC12YXJpYWJs ZSAnaW5kaWNhdGUtZW1wdHktbGluZXMpCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnaW5k aWNhdGUtYnVmZmVyLWJvdW5kYXJpZXMpCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnZnJp bmdlLWluZGljYXRvci1hbGlzdCkKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdmcmluZ2Ut Y3Vyc29yLWFsaXN0KQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJytmb3J0aHdpdGgpCisg ICAgICAoZG9saXN0IChzYXZlZCArLS1zYXZlZC1zdGF0ZSkKKyAgICAgICAgKHNldCAobWFrZS1s b2NhbC12YXJpYWJsZSAoY2FyIHNhdmVkKSkgKGNkciBzYXZlZCkpKQorICAgICAgKGtpbGwtbG9j YWwtdmFyaWFibGUgJystLXNhdmVkLXN0YXRlKQorICAgICAgKCstZGVsZXRlLXBhcmVucy1vdmVy bGF5cykKKyAgICAgICh3aGVuIChtZW1xICcrLWRyYXctZm9ydGh3aXRoIHBvc3QtY29tbWFuZC1o b29rKQorICAgICAgICAocmVtb3ZlLWhvb2sgJ3Bvc3QtY29tbWFuZC1ob29rICcrLWRyYXctZm9y dGh3aXRoICdsb2NhbCkpCisgICAgICAod2hlbiAobWVtcSAnKy1kcmF3LWNyb3NzaGFpcnMgcG9z dC1jb21tYW5kLWhvb2spCisgICAgICAgIChyZW1vdmUtaG9vayAncG9zdC1jb21tYW5kLWhvb2sg JystZHJhdy1jcm9zc2hhaXJzICdsb2NhbCkpCisgICAgICAod2hlbiAobWVtcSAnKy1kcmF3LWZv cnRod2l0aCB3aW5kb3ctY29uZmlndXJhdGlvbi1jaGFuZ2UtaG9vaykKKyAgICAgICAgKHJlbW92 ZS1ob29rICd3aW5kb3ctY29uZmlndXJhdGlvbi1jaGFuZ2UtaG9vayAnKy1kcmF3LWZvcnRod2l0 aCAnbG9jYWwpKQorICAgICAgKHJlbW92ZS1ob29rICdjaGFuZ2UtbWFqb3ItbW9kZS1ob29rICd0 dXJuLW9mZi0rLW1vZGUgJ2xvY2FsKQorICAgICAgKHdoZW4gKy10aW1lci12YXIKKyAgICAgICAg KHNldHEgdGltZXItaWRsZS1saXN0IChkZWxxICstdGltZXItdmFyIHRpbWVyLWlkbGUtbGlzdCkp CisgICAgICAgIChzZXRxICstdGltZXItdmFyIG5pbCkpCisgICAgICAod2hlbiAoY2FsbGVkLWlu dGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAobWVzc2FnZSAiVHVybmVkIE9GRiBgKy1tb2Rl Jy4iKSkpKSkKKworKGRlZnVuIHR1cm4tb2ZmLSstbW9kZSAoKQorICAoKy1tb2RlIC0xKSkKKwor Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7CisKKyhkZWZ1biArLXBhcmVucy1mbiAoKQorICAiRG9j LXN0cmluZy4iCisgIChsZXQqICgob3BvaW50IChwb2ludCkpCisgICAgICAgICAoZnJvbSAoaWYg Ky1wYXJlbnMtZnJvbS1mbgorICAgICAgICAgICAgICAgICAoZnVuY2FsbCArLXBhcmVucy1mcm9t LWZuKQorICAgICAgICAgICAgICAgICAocG9pbnQtbWluKSkpCisgICAgICAgICAod2luIChzZWxl Y3RlZC13aW5kb3cpKQorICAgICAgICAgKGkgMCkKKyAgICAgICAgIChwcmVjZWRpbmctY2hhciAo cHJlY2VkaW5nLWNoYXIpKQorICAgICAgICAgKG9jaGFyIChjaGFyLWFmdGVyIG9wb2ludCkpCisg ICAgICAgICAocG9zMQorICAgICAgICAgICAoY29uZAorICAgICAgICAgICAgICgoYW5kIG9jaGFy CisgICAgICAgICAgICAgICAgICAgKG9yIDs7OyAoY2hhci10by1zdHJpbmcgNDApID0+IG9wZW5p bmcgcGFyZW50aGVzaXMKKyAgICAgICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgNDApCisgICAg ICAgICAgICAgICAgICAgICAgIDs7OyAoY2hhci10by1zdHJpbmcgOTEpID0+IG9wZW5pbmcgc3F1 YXJlIGJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgOTEpCisgICAgICAg ICAgICAgICAgICAgICAgIDs7OyAoY2hhci10by1zdHJpbmcgMTIzKSA9PiBvcGVuaW5nIHdhdnkg YnJhY2tldAorICAgICAgICAgICAgICAgICAgICAgICAoPSBvY2hhciAxMjMpKSkKKyAgICAgICAg ICAgICAgICAobWluICgxKyBvcG9pbnQpIChwb2ludC1tYXgpKSkKKyAgICAgICAgICAgICAoKG9y IDs7OyAoY2hhci10by1zdHJpbmcgNDEpID0+IGNsb3NpbmcgcGFyZW50aGVzaXMKKyAgICAgICAg ICAgICAgICAgICg9IHByZWNlZGluZy1jaGFyIDQxKQorICAgICAgICAgICAgICAgICAgOzs7IChj aGFyLXRvLXN0cmluZyA5MykgPT4gY2xvc2luZyBzcXVhcmUgYnJhY2tldAorICAgICAgICAgICAg ICAgICAgKD0gcHJlY2VkaW5nLWNoYXIgOTMpCisgICAgICAgICAgICAgICAgICA7OzsgKGNoYXIt dG8tc3RyaW5nIDEyNSkgPT4gY2xvc2luZyB3YXZ5IGJyYWNrZXQKKyAgICAgICAgICAgICAgICAg ICg9IHByZWNlZGluZy1jaGFyIDEyNSkpCisgICAgICAgICAgICAgICAgKG1heCAocG9pbnQtbWlu KSAoMS0gb3BvaW50KSkpCisgICAgICAgICAgICAgKHQKKyAgICAgICAgICAgICAgICBvcG9pbnQp KSkKKyAgICAgICAgIHBvczIKKyAgICAgICAgIHNlbGVjdGVkLWZhY2UpCisgICAgKHNhdmUtZXhj dXJzaW9uCisgICAgICAoY29uZGl0aW9uLWNhc2UgbmlsCisgICAgICAgICh3aGlsZSAoc2V0cSBw b3MxIChudGggMSAocGFyc2UtcGFydGlhbC1zZXhwIGZyb20gcG9zMSkpKQorICAgICAgICAgIChz ZXRxIHBvczIgKHNjYW4tc2V4cHMgcG9zMSAxKSkKKyAgICAgICAgICAoaWYgKD0gaSAxMCkKKyAg ICAgICAgICAgIChzZXRxIGkgMSkKKyAgICAgICAgICAgIChzZXRxIGkgKDErIGkpKSkKKyAgICAg ICAgICAoc2V0cSBzZWxlY3RlZC1mYWNlIChjb25kCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICgoPSBpIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFy ZW5zLW9uZS1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSAyKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy10d28tZmFjZSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgMykKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtdGhyZWUtZmFjZSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgKCg9IGkgNCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAnKy1wYXJlbnMtZm91ci1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo KD0gaSA1KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1maXZl LWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDYpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLXNpeC1mYWNlKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA3KQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICcrLXBhcmVucy1zZXZlbi1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAoKD0gaSA4KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBh cmVucy1laWdodC1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA5 KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1uaW5lLWZhY2Up CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDEwKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy10ZW4tZmFjZSkpKQorICAgICAgICAgIChs ZXQgKChvdiAobWFrZS1vdmVybGF5IHBvczEgKDErIHBvczEpKSkpCisgICAgICAgICAgICAodW5s ZXNzICstcGFyZW5zLWluYWN0aXZlLXdpbmRvd3MKKyAgICAgICAgICAgICAgKG92ZXJsYXktcHV0 IG92ICd3aW5kb3cgd2luKSkKKyAgICAgICAgICAgIChvdmVybGF5LXB1dCBvdiAnZmFjZSBzZWxl Y3RlZC1mYWNlKSkKKyAgICAgICAgICAod2hlbiBwb3MyCisgICAgICAgICAgICAobGV0ICgob3Yg KG1ha2Utb3ZlcmxheSAoMS0gcG9zMikgcG9zMikpKQorICAgICAgICAgICAgICAodW5sZXNzICst cGFyZW5zLWluYWN0aXZlLXdpbmRvd3MKKyAgICAgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3Yg J3dpbmRvdyB3aW4pKQorICAgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ2ZhY2Ugc2VsZWN0 ZWQtZmFjZSkpKSkKKyAgICAgICAgKGVycm9yIG5pbCkpKQorICAgIChzZXRxICstcGFyZW5zLW92 ZXJsYXlzLWV4aXN0LXAgdCkpKQorCisoZGVmdW4gKy1yZW1vdmUtb3ZlcmxheXMgKGJlZyBlbmQg bmFtZSB2YWwpCisiUmVtb3ZlIHRoZSBvdmVybGF5cyB0aGF0IGFyZSBgZXF1YWwtaW5jbHVkaW5n LXByb3BlcnRpZXNgLgorSW5jbHVkZXMgYSB1bmlxdWUgc2l0dWF0aW9uIHdoZW4gYW4gb3Zlcmxh eSB3aXRoIGFuIGAnYWZ0ZXItc3RyaW5nYCBwcm9wZXJ0eQoraXMgYXQgdGhlIHZlcnkgZW5kIG9m IGEgbmFycm93ZWQtYnVmZmVyLiIKKyAgKGxldCogKChwb2ludC1tYXggKHBvaW50LW1heCkpCisg ICAgICAgICAocG9pbnQtbWluIChwb2ludC1taW4pKQorICAgICAgICAgKG5hcnJvd2VkLXAgKGJ1 ZmZlci1uYXJyb3dlZC1wKSkKKyAgICAgICAgIChiZWcgKGlmIGJlZyBiZWcgcG9pbnQtbWluKSkK KyAgICAgICAgIChlbmQKKyAgICAgICAgICAgKGNvbmQKKyAgICAgICAgICAgICAoKGFuZAorICAg ICAgICAgICAgICAgICAobm90IG5hcnJvd2VkLXApCisgICAgICAgICAgICAgICAgIGVuZCkKKyAg ICAgICAgICAgICAgIGVuZCkKKyAgICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAo bm90IG5hcnJvd2VkLXApCisgICAgICAgICAgICAgICAgIChudWxsIGVuZCkpCisgICAgICAgICAg ICAgICBwb2ludC1tYXgpCisgICAgICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFy cm93ZWQtcAorICAgICAgICAgICAgICAgICBlbmQKKyAgICAgICAgICAgICAgICAgKDwgZW5kIHBv aW50LW1heCkpCisgICAgICAgICAgICAgICBlbmQpCisgICAgICAgICAgICAgKChhbmQKKyAgICAg ICAgICAgICAgICAgbmFycm93ZWQtcAorICAgICAgICAgICAgICAgICBlbmQKKyAgICAgICAgICAg ICAgICAgKD0gZW5kIHBvaW50LW1heCkpCisgICAgICAgICAgICAgICAoMSsgZW5kKSkKKyAgICAg ICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICBuYXJyb3dlZC1wCisgICAgICAgICAgICAg ICAgIChudWxsIGVuZCkpCisgICAgICAgICAgICAgICAoMSsgcG9pbnQtbWF4KSkgKSkKKyAgICAg ICAgIChvdmVybGF5cworICAgICAgICAgICAocHJvZ24KKyAgICAgICAgICAgICAob3ZlcmxheS1y ZWNlbnRlciBlbmQpCisgICAgICAgICAgICAgKG92ZXJsYXlzLWluIGJlZyBlbmQpKSkpCisgICAg KHdoZW4gKGFuZCBiZWcgZW5kIG5hbWUgdmFsKQorICAgICAgKGRvbGlzdCAobyBvdmVybGF5cykK KyAgICAgICAgKGNvbmQKKyAgICAgICAgICAoKGFuZCAoZXEgbmFtZSAnZmFjZSkKKyAgICAgICAg ICAgICAgICAoZXEgKG92ZXJsYXktZ2V0IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIDs7IEVp dGhlciBwdXNoIHRoaXMgb3ZlcmxheSBvdXRzaWRlIGJlZy4uLmVuZAorICAgICAgICAgICAgOzsg b3Igc3BsaXQgaXQgdG8gZXhjbHVkZSBiZWcuLi5lbmQKKyAgICAgICAgICAgIDs7IG9yIGRlbGV0 ZSBpdCBlbnRpcmVseSAoaWYgaXQgaXMgY29udGFpbmVkIGluIGJlZy4uLmVuZCkuCisgICAgICAg ICAgICAoaWYgKDwgKG92ZXJsYXktc3RhcnQgbykgYmVnKQorICAgICAgICAgICAgICAgIChpZiAo PiAob3ZlcmxheS1lbmQgbykgZW5kKQorICAgICAgICAgICAgICAocHJvZ24KKyAgICAgICAgICAg ICAgICAobW92ZS1vdmVybGF5IChjb3B5LW92ZXJsYXkgbykKKyAgICAgICAgICAgICAgICAgIChv dmVybGF5LXN0YXJ0IG8pIGJlZykKKyAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gZW5k IChvdmVybGF5LWVuZCBvKSkpCisgICAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gKG92 ZXJsYXktc3RhcnQgbykgYmVnKSkKKyAgICAgICAgICAgICAgKGlmICg+IChvdmVybGF5LWVuZCBv KSBlbmQpCisgICAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVu ZCBvKSkKKyAgICAgICAgICAgICAgICAoZG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F1YWwgY3VycmVudC1wcmVmaXgtYXJnICco NCkpKQorICAgICAgICAoZ2xvYmFsLWVsZG9jLW1vZGUgLTEpKQorICAgICAgKHdoZW4gKGFuZCBq aXQtbG9jay1jb250ZXh0LXRpbWVyCisgICAgICAgICAgICAgICAgIChjYWxsZWQtaW50ZXJhY3Rp dmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcg Jyg0KSkpCisgICAgICAgICh3aGVuICh0aW1lcnAgaml0LWxvY2stY29udGV4dC10aW1lcikKKyAg ICAgICAgICAoY2FuY2VsLXRpbWVyIGppdC1sb2NrLWNvbnRleHQtdGltZXIpKQorICAgICAgICA7 OyAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIChydW4td2l0aC1pZGxlLXRpbWVyIDUuMCAn cmVwZWF0ICdqaXQtbG9jay1jb250ZXh0LWZvbnRpZnkpKQorICAgICAgICAoc2V0cSBqaXQtbG9j ay1jb250ZXh0LXRpbWVyIG5pbCkpCisgICAgICAod2hlbiAoYW5kIChjYWxsZWQtaW50ZXJhY3Rp dmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcg Jyg0KSkpCisgICAgICAgICh3aGVuICh0aW1lcnAgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnkt dGltZXIpCisgICAgICAgICAgKGNhbmNlbC10aW1lciB1bmRvLWF1dG8tY3VycmVudC1ib3VuZGFy eS10aW1lcikpCisgICAgICAgIChmc2V0ICd1bmRvLWF1dG8tLXVuZG9hYmxlLWNoYW5nZQorICAg ICAgICAgICAgICAobGFtYmRhICgpIChhZGQtdG8tbGlzdCAndW5kby1hdXRvLS11bmRvYWJseS1j aGFuZ2VkLWJ1ZmZlcnMgKGN1cnJlbnQtYnVmZmVyKSkpKQorICAgICAgICAoZnNldCAndW5kby1h dXRvLWFtYWxnYW1hdGUgJ2lnbm9yZSkpCisgIC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0+ZmNfaW5hY3RpdmVfd2luZG93c18gPSB2YWw7Cit9CisKKy8qIGVuZCBN VUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiBzdGF0aWMg dm9pZAogYnNldF9hYmJyZXZfbW9kZSAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFs KQogewpAQCAtNTE0Miw2ICs1MjA1LDI0IEBAIGluaXRfYnVmZmVyX29uY2UgKHZvaWQpCiAgIGJz ZXRfbGFzdF9zZWxlY3RlZF93aW5kb3cgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIG1ha2VfZml4bnVt ICgwKSk7CiAKICAgaWR4ID0gMTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1V TFRJUExFLUNVUlNPUlMgKi8KKworICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9m bGFncywgbWNfcmVhbF9mYWtlX2N1cnNvciksIGlkeCk7ICsraWR4OworICBYU0VURkFTVElOVCAo QlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgbWNfY29uZiksIGlkeCk7ICsraWR4OworICBYU0VU RkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgbWNfaW5hY3RpdmVfd2luZG93cyks IGlkeCk7ICsraWR4OworICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywg Y3Jvc3NoYWlycyksIGlkeCk7ICsraWR4OworICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9s b2NhbF9mbGFncywgY2hfaG9yaXpvbnRhbF9ydWxlciksIGlkeCk7ICsraWR4OworICBYU0VURkFT VElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgY2hfdmVydGljYWxfcnVsZXIpLCBpZHgp OyArK2lkeDsKKyAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIGNoX2lu YWN0aXZlX3dpbmRvd3MpLCBpZHgpOyArK2lkeDsKKyAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZm ZXJfbG9jYWxfZmxhZ3MsIGZjX3Zpc2libGUpLCBpZHgpOyArK2lkeDsKKyAgWFNFVEZBU1RJTlQg KEJWQVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIGZjX2luYWN0aXZlX3dpbmRvd3MpLCBpZHgpOyAr K2lkeDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBYU0VURkFTVElOVCAoQlZB UiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgbW9kZV9saW5lX2Zvcm1hdCksIGlkeCk7ICsraWR4Owog ICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgYWJicmV2X21vZGUpLCBp ZHgpOyArK2lkeDsKICAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIG92 ZXJ3cml0ZV9tb2RlKSwgaWR4KTsgKytpZHg7CkBAIC01MjI4LDYgKzUzMDksMjQgQEAgaW5pdF9i dWZmZXJfb25jZSAodm9pZCkKICAgLyogTXVzdCBkbyB0aGVzZSBiZWZvcmUgbWFraW5nIHRoZSBm aXJzdCBidWZmZXIhICovCiAKICAgLyogcmVhbCBzZXR1cCBpcyBkb25lIGluIGJpbmRpbmdzLmVs ICovCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1J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OWZhYzUgMTAwNjQ0Ci0t LSBhL3NyYy9idWZmZXIuaAorKysgYi9zcmMvYnVmZmVyLmgKQEAgLTczNiw2ICs3MzYsNDAgQEAg c3RydWN0IGJ1ZmZlcgogICAgICBpbiB0aGUgZGlzcGxheSBvZiB0aGlzIGJ1ZmZlci4gICovCiAg IExpc3BfT2JqZWN0IGV4dHJhX2xpbmVfc3BhY2luZ187CiAKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogVGhlIGN1cnNvciB0eXBlIG9m IHRoZSByZWFsIGZha2UgY3Vyc29yLiAqLworICBMaXNwX09iamVjdCBtY19yZWFsX2Zha2VfY3Vy c29yXzsKKworICAvKiBUaGUgbmFtZSBvZiBsaXN0IHVzZWQgYnkgbXVsdGlwbGUgY3Vyc29ycyBm b3IgbmV4dCByZWRpc3BsYXkuICovCisgIExpc3BfT2JqZWN0IG1jX2NvbmZfOworCisgIC8qIFdo ZXRoZXIgdG8gZHJhdyBtdWx0aXBsZSBjdXJzb3JzIGluIGluYWN0aXZlIHdpbmRvd3MuICovCisg IExpc3BfT2JqZWN0IG1jX2luYWN0aXZlX3dpbmRvd3NfOworCisgIC8qIFRoZSBuYW1lIG9mIHRo ZSBidWZmZXItbG9jYWwgdmFyaWFibGUuICovCisgIExpc3BfT2JqZWN0IGNyb3NzaGFpcnNfOwor CisgIC8qIFRoZSBuYW1lIG9mIHRoZSBjcm9zc2hhaXJzIGhvcml6b250YWwgcnVsZXIuICovCisg IExpc3BfT2JqZWN0IGNoX2hvcml6b250YWxfcnVsZXJfOworCisgIC8qIFRoZSBuYW1lIG9mIHRo ZSBjcm9zc2hhaXJzIHZlcnRpY2FsIHJ1bGVyLiAqLworICBMaXNwX09iamVjdCBjaF92ZXJ0aWNh bF9ydWxlcl87CisKKyAgLyogV2hldGhlciB0byBkcmF3IGNyb3NzaGFpcnMgaW4gaW5hY3RpdmUg d2luZG93cy4gKi8KKyAgTGlzcF9PYmplY3QgY2hfaW5hY3RpdmVfd2luZG93c187CisKKyAgLyog VGhlIG5hbWUgb2YgdGhlIGJ1ZmZlci1sb2NhbCB2YXJpYWJsZS4gKi8KKyAgTGlzcF9PYmplY3Qg ZmNfdmlzaWJsZV87CisKKyAgLyogV2hldGhlciB0byBkcmF3IG11bHRpcGxlIGN1cnNvcnMgZmls bCBjb2x1bW4gaW4gaW5hY3RpdmUgd2luZG93cy4gKi8KKyAgTGlzcF9PYmplY3QgZmNfaW5hY3Rp dmVfd2luZG93c187CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogQ3Vyc29y IHR5cGUgdG8gZGlzcGxheSBpbiBub24tc2VsZWN0ZWQgd2luZG93cy4KICAgICAgdCBtZWFucyB0 byB1c2UgaG9sbG93IGJveCBjdXJzb3IuCiAgICAgIFNlZSBgY3Vyc29yLXR5cGUnIGZvciBvdGhl ciB2YWx1ZXMuICAqLwpAQCAtNzg3LDE0ICs4MjEsMjEgQEAgc3RydWN0IGJ1ZmZlcgogICAgICBh biBpbmRpcmVjdCBidWZmZXIgc2luY2UgaXQgY291bnRzIGFzIGl0cyBiYXNlIGJ1ZmZlci4gICov CiAgIGludCB3aW5kb3dfY291bnQ7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBN VUxUSVBMRS1DVVJTT1JTICovCisKICAgLyogQSBub24temVybyB2YWx1ZSBpbiBzbG90IElEWCBt ZWFucyB0aGF0IHBlci1idWZmZXIgdmFyaWFibGUKICAgICAgd2l0aCBpbmRleCBJRFggaGFzIGEg bG9jYWwgdmFsdWUgaW4gdGhpcyBidWZmZXIuICBUaGUgaW5kZX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ZG93cyAoc3RydWN0IGJ1ZmZlciAqYiwgTGlz cF9PYmplY3QgdmFsKQoreworICBiLT5jaF9pbmFjdGl2ZV93aW5kb3dzXyA9IHZhbDsKK30KKwor SU5MSU5FIHZvaWQKK2JzZXRfYmx2X2ZjX3Zpc2libGUgKHN0cnVjdCBidWZmZXIgKmIsIExpc3Bf T2JqZWN0IHZhbCkKK3sKKyAgYi0+ZmNfdmlzaWJsZV8gPSB2YWw7Cit9CisKK0lOTElORSB2b2lk Citic2V0X2Jsdl9mY19pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09i amVjdCB2YWwpCit7CisgIGItPmZjX2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQorCisvKiBl bmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogSU5M SU5FIHZvaWQKIGJzZXRfYmlkaV9wYXJhZ3JhcGhfZGlyZWN0aW9uIChzdHJ1Y3QgYnVmZmVyICpi LCBMaXNwX09iamVjdCB2YWwpCiB7CmRpZmYgLS1naXQgYS9zcmMvZGlzcGV4dGVybi5oIGIvc3Jj L2Rpc3BleHRlcm4uaAppbmRleCAxYTUzNjU2Li5lODc3N2MyIDEwMDY0NAotLS0gYS9zcmMvZGlz cGV4dGVybi5oCisrKyBiL3NyYy9kaXNwZXh0ZXJuLmgKQEAgLTEwMCw2ICsxMDAsMTA2IEBAIHR5 cGVkZWYgaW50IEN1cnNvcjsKICNkZWZpbmUgTmF0aXZlUmVjdGFuZ2xlIGludAogI2VuZGlmCiAK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICov CisKK3N0cnVjdCBnbHlwaDsKKworc3RydWN0IGdseXBoX3JvdzsKKworc3RydWN0IGdseXBoX21h dHJpeDsKKworZW51bSBkcmF3X2dseXBoc19mYWNlOworCitlbnVtIGdseXBoX3Jvd19hcmVhOwor CitlbnVtIG1jX2NhY2hlX3R5cGU7CisKK2VudW0gbWNfY3Vyc29yX3R5cGU7CisKK2VudW0gbWNf Zmxhdm9yOworCitzdHJ1Y3QgbWNfUkdCOworCitzdHJ1Y3QgbWNfZXNzZW50aWFsczsKKworZW51 bSBtY19mcm9tX3doZXJlOworCitlbnVtIG1jX2FjdGlvbl90eXBlOworCitleHRlcm4gTGlzcF9P YmplY3QgbWNfbGlzdG4gKHB0cmRpZmZfdCwgTGlzcF9PYmplY3QsIC4uLik7CisKK2V4dGVybiBM aXNwX09iamVjdCBtY19udGggKGludCwgTGlzcF9PYmplY3QpOworCitleHRlcm4gTGlzcF9PYmpl Y3QgbWNfYXNzcSAoTGlzcF9PYmplY3QsIExpc3BfT2JqZWN0KTsKKworZXh0ZXJuIHN0cnVjdCBn bHlwaCAqIG1jX2dldF9jdXJzb3JfZ2x5cGggKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBo X21hdHJpeCAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0 cnVjdCBnbHlwaF9yb3cgKiwgaW50LCBpbnQpOworCitleHRlcm4gdm9pZCBtY194d19jb2xvcl92 YWx1ZXMgKHN0cnVjdCB3aW5kb3cgKiwgTGlzcF9PYmplY3QsIHN0cnVjdCBtY19SR0IgKik7CisK K2V4dGVybiBib29sIG1jX3VwZGF0ZV93aW5kb3dfZnJpbmdlcyAoc3RydWN0IHdpbmRvdyAqLCBi b29sKTsKKworZXh0ZXJuIGNoYXIgKiBtY193aW5kb3cgKHN0cnVjdCB3aW5kb3cgKik7CisKK2V4 dGVybiBjaGFyICogbWNfY2hhcl90b19zdHJpbmcgKGludCk7CisKK2V4dGVybiBjaGFyICogbWNf Y3Vyc29yX3R5cGV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Jhd19yb3cgKHN0 cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICos CisgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoICosIGludCwgaW50LCBpbnQs IGludCwgc3RydWN0IGdseXBoX21hdHJpeCAqLAorICAgICAgICAgICAgICAgICAgICAgICAgIHN0 cnVjdCBtY19lc3NlbnRpYWxzLCBib29sLCBlbnVtIG1jX2Zyb21fd2hlcmUpOworCitleHRlcm4g dm9pZCBtY19yZWRyYXdfcm93IChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXgg Kiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBp bnQsIGludCwgYm9vbCwgZW51bSBkcmF3X2dseXBoc19mYWNlKTsKKworZXh0ZXJuIHZvaWQgbWNf cmVzZXRfY2FjaGUgKHN0cnVjdCB3aW5kb3cgKik7CisKK2V4dGVybiB2b2lkIG1jX2RyYXdfY3Vy c29yX2dseXBoIChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICosIGVudW0gZHJh d19nbHlwaHNfZmFjZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQsIGlu dCwgaW50LCBzdHJ1Y3QgbWNfUkdCLCBlbnVtIG1jX2ZsYXZvciwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlLCBpbnQsIGJvb2wsIGJvb2wpOwor CitleHRlcm4gdm9pZCBtY19lcmFzZV9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGds eXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGludCwgaW50LCBpbnQsIGludCwgZW51bSBtY19mbGF2b3IsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUsIGludCk7CisKK2V4dGVybiB2b2lk IG1jX2RyYXdfZXJhc2VfaHlicmlkIChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRy aXggKiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGludCwgaW50LCBpbnQsIGludCwgaW50LCBpbnQsIGludCwgaW50LAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUsIGludCwgc3RydWN0IG1j X1JHQiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sLCBlbnVtIG1jX2Zs YXZvciwgYm9vbCk7CisKK2V4dGVybiB2b2lkIG1jX3hfd3JpdGVfZ2x5cGhzIChzdHJ1Y3Qgd2lu ZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqLCBlbnVtIGdseXBoX3Jvd19h cmVhLCBpbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBpbnQsIHN0cnVj dCBtY19SR0IsIGVudW0gbWNfZmxhdm9yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGVudW0gbWNfY3Vyc29yX3R5cGUsIGludCwgYm9vbCwgYm9vbCwgYm9vbCk7CisKK2V4dGVybiBz dHJ1Y3QgZ2x5cGhfbWF0cml4ICogbWNfc2F2ZV9nbHlwaF9tYXRyaXggKHN0cnVjdCBnbHlwaF9t YXRyaXggKik7CisKK2V4dGVybiB2b2lkIG1jX3Jlc3RvcmVfZ2x5cGhfbWF0cml4IChzdHJ1Y3Qg Z2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKik7CisKKy8qIGVuZCBNVUxUSVBM RS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBUZXh0IGN1cnNv ciB0eXBlcy4gICovCiAKIGVudW0gdGV4dF9jdXJzb3Jfa2luZHMKQEAgLTM4Miw2ICs0ODIsMjIg QEAgc3RydWN0IGdseXBoX3NsaWNlCiAKIHN0cnVjdCBnbHlwaAogeworCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGludCB4LCB5LCBocG9z LCB2cG9zOworCisgIGludCByZWxhdGl2ZV94OworCisgIGJvb2xfYmYgenZfcCA6IDE7CisKKyAg cHRyZGlmZl90IGJ5dGVwb3M7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyog UG9zaXRpb24gZnJvbSB3aGljaCB0aGlzIGdseXBoIHdhcyBkcmF3bi4gIElmIGBvYmplY3QnIGJl bG93IGlzIGEKICAgICAgTGlzcCBzdHJpbmcsIHRoaXMgaXMgYW4gaW5kZXggaW50byB0aGF0IHN0 cmluZy4gIElmIGl0IGlzIGEKICAgICAgYnVmZmVyLCB0aGlzIGlzIGEgcG9zaXRpb24gaW4gdGhh dCBidWZmZXIuICBJbiBhZGRpdGlvbiwgc29tZQpAQCAtMTI0OCw2ICsxMzY0LDI4IEBAIGVudW0g ZHJhd19nbHlwaHNfZmFjZQogCiBzdHJ1Y3QgZ2x5cGhfc3RyaW5nCiB7CisKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICBib29sX2JmIGxl ZnRfb3ZlcndyaXR0ZW5fcCA6IDE7CisKKyAgICBib29sX2JmIHJpZ2h0X292ZXJ3cml0dGVuX3Ag OiAxOworCisgICAgYm9vbF9iZiByZWN0YW5nbGVfbnVrZWRfcCA6IDE7CisKKyAgICBib29sX2Jm IGJhY2tncm91bmRfbnVrZWRfcCA6IDE7CisKKyAgICBlbnVtIGRyYXdfZ2x5cGhfYWN0aW9uCisg ICAgeworICAgICAgTUNfRFJBV19HTFlQSCwKKyAgICAgIE1DX0VSQVNFX0dMWVBICisgICAgfSBh Y3Rpb25fdHlwZTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBYLW9yaWdp biBvZiB0aGUgc3RyaW5nLiAgKi8KICAgaW50IHg7CiAKQEAgLTIyMTYsNiArMjM1NCwxOCBAQCBz dHJ1Y3QgY29tcG9zaXRpb25faXQKIAogc3RydWN0IGl0CiB7CisKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgYm9vbF9iZiB6dl9wIDogMTsK KworICBwdHJkaWZmX3QgYnl0ZXBvczsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog ICAvKiBUaGUgd2luZG93IGluIHdoaWNoIHdlIGl0ZXJhdGUgb3ZlciBjdXJyZW50X2J1ZmZlciAo b3IgYSBzdHJpbmcpLiAgKi8KICAgTGlzcF9PYmplY3Qgd2luZG93OwogICBzdHJ1Y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EBAIGFs b25nIHdpdGggR05VIEVtYWNzLiAgSWYgbm90LCBzZWUgPGh0dHBzOi8vd3d3LmdudS5vcmcvbGlj ZW5zZXMvPi4gICovCiAjaW5jbHVkZSAidzMyLmgiCiAjZW5kaWYKIAwKKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBzdHJ1Y3Qg Z2x5cGhzX3NraXBwZWQKKyAgeworICAgIHB0cmRpZmZfdCBhbGxvY2F0ZWQ7CisgICAgcHRyZGlm Zl90IHVzZWQ7CisgICAgc3RydWN0IHNraXBwZWRfaXRlbXMKKyAgICAgIHsKKyAgICAgICAgaW50 IHg7CisgICAgICAgIGludCBocG9zOworICAgICAgICBib29sIGVuYWJsZWRfcDsKKyAgICAgIH0g KnNraXBwZWQ7CisgIH0gYXJyYXlfZ2x5cGhzX3NraXBwZWQ7CisKK3N0YXRpYyBib29sIHVwZGF0 ZV93aW5kb3dfbGluZSAoc3RydWN0IHdpbmRvdyAqLCBpbnQsIGJvb2wgKik7CisKK3N0YXRpYyB2 b2lkIHVwZGF0ZV9tYXJnaW5hbF9hcmVhIChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9y b3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIGdseXBoX3Jvd19h cmVhLCBpbnQpOworCitzdGF0aWMgdm9pZCBtYWtlX2N1cnJlbnQgKHN0cnVjdCBnbHlwaF9tYXRy aXggKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLCBpbnQpOworCitzdGF0aWMgYm9vbCByb3dfZXF1 YWxfcCAoc3RydWN0IGdseXBoX3JvdyAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosIGJvb2wpOworCitz dGF0aWMgdm9pZCBhc3NpZ25fcm93IChzdHJ1Y3QgZ2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RfQVJFQV0sIG5ieXRlcyk7 CisgICAgICB0by0+dXNlZFtURVhUX0FSRUFdID0gZnJvbS0+dXNlZFtURVhUX0FSRUFdOworICAg ICAgdG8tPmhhc2ggPSBmcm9tLT5oYXNoOworICAgICAgdG8tPnggPSBmcm9tLT54OworICAgICAg dG8tPnkgPSBmcm9tLT55OworICAgICAgdG8tPnBpeGVsX3dpZHRoID0gZnJvbS0+cGl4ZWxfd2lk dGg7CisgICAgICB0by0+YXNjZW50ID0gZnJvbS0+YXNjZW50OworICAgICAgdG8tPmhlaWdodCA9 IGZyb20tPmhlaWdodDsKKyAgICAgIHRvLT5waHlzX2FzY2VudCA9IGZyb20tPnBoeXNfYXNjZW50 OworICAgICAgdG8tPnBoeXNfaGVpZ2h0ID0gZnJvbS0+cGh5c19oZWlnaHQ7CisgICAgICB0by0+ dmlzaWJsZV9oZWlnaHQgPSBmcm9tLT52aXNpYmxlX2hlaWdodDsKKyAgICAgIHRvLT5leHRyYV9s aW5lX3NwYWNpbmcgPSBmcm9tLT5leHRyYV9saW5lX3NwYWNpbmc7CisgICAgICB0by0+c3RhcnQg PSBmcm9tLT5zdGFydDsKKyAgICAgIHRvLT5lbmQgPSBmcm9tLT5lbmQ7CisgICAgICB0by0+bWlu cG9zID0gZnJvbS0+bWlucG9zOworICAgICAgdG8tPm1heHBvcyA9IGZyb20tPm1heHBvczsKKyAg ICAgIHRvLT5vdmVybGF5X2Fycm93X2JpdG1hcCA9IGZyb20tPm92ZXJsYXlfYXJyb3dfYml0bWFw OworICAgICAgdG8tPmxlZnRfdXNlcl9mcmluZ2VfYml0bWFwID0gZnJvbS0+bGVmdF91c2VyX2Zy aW5nZV9iaXRtYXA7CisgICAgICB0by0+cmlnaHRfdXNlcl9mcmluZ2VfYml0bWFwID0gZnJvbS0+ cmlnaHRfdXNlcl9mcmluZ2VfYml0bWFwOworICAgICAgdG8tPmxlZnRfZnJpbmdlX2JpdG1hcCA9 IGZyb20tPmxlZnRfZnJpbmdlX2Jpd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90dG9tX3kgKHcpOworICBwdHJkaWZmX3QgaTsKKyAgaW50 IGosIGZpcnN0X29sZCwgZmlyc3RfbmV3LCBsYXN0X29sZCwgbGFzdF9uZXc7CisgIGludCBucnVu cywgcnVuX2lkeDsKKyAgcHRyZGlmZl90IG47CisgIHN0cnVjdCBtY19yb3dfZW50cnkgKmVudHJ5 OworICAvLyBzdHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFjZSAqcmlmID0gRlJBTUVfUklGIChYRlJB TUUgKFdJTkRPV19GUkFNRSAodykpKTsKKyAgLyogU2tpcCBvdmVyIHJvd3MgZXF1YWwgYXQgdGhl IHN0YXJ0LiAqLworICBmb3IgKGkgPSBoZWFkZXJfbGluZV9wOyBpIDwgY3VycmVudF9tYXRyaXgt Pm5yb3dzIC0gMTsgKytpKQorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKmQgPSBNQVRS SVhfUk9XIChkZXNpcmVkX21hdHJpeCwgaSk7CisgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpjID0g TUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIGkpOworICAgICAgaWYgKGMtPmVuYWJsZWRfcAor ICAgICAgICAgICYmIGQtPmVuYWJsZWRfcAorICAgICAgICAgICYmICFkLT5yZWRyYXdfZnJpbmdl X2JpdG1hcHNfcAorICAgICAgICAgICYmIGMtPnkgPT0gZC0+eQorICAgICAgICAgICYmIE1BVFJJ WF9ST1dfQk9UVE9NX1kgKGMpIDw9IHliCisgICAgICAgICAgJiYgTUFUUklYX1JPV19CT1RUT01f WSAoZCkgPD0geWIKKyAgICAgICAgICAmJiByb3dfZXF1YWxfcCAoYywgZCwgMSkpCisgICAgICAg IHsKKyAgICAgICAgICBhc3NpZ25fcm93IChjLCBkKTsKKyAgICAgICAgICBkLT5lbmFibGVkX3Ag PSBmYWxzZTsKKyAgICAgICAgfQorICAgICAgZWxzZQorICAgICAgICBicmVhazsKKyAgICB9Cisj aWZkZWYgSEFWRV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SBpbmRleCArIDEgb2YgdGhlIHJv dyB0aGF0IHJlYWNoZXMgdGhlIGJvdHRvbQorICAgICBib3VuZGFyeSBpbiB0aGUgY3VycmVudCBt YXRyaXguICBXZSBkb24ndCBsb29rIGF0IHRoZSBlbmFibGVkCisgICAgIGZsYWcgaGVyZSBiZWNh dXNlIHdlIHBsYW4gdG8gcmV1c2UgcGFydCBvZiB0aGUgZGlzcGxheSBldmVuIGlmCisgICAgIG90 aGVyIHBhcnRzIGFyZSBkaXNhYmxlZC4gKi8KKyAgaSA9IGZpcnN0X29sZCArIDE7CisgIHdoaWxl IChpIDwgY3VycmVudF9tYXRyaXgtPm5yb3dzIC0gMSkKKyAgICB7CisgICAgICBpbnQgYm90dG9t ID0gTUFUUklYX1JPV19CT1RUT01fWSAoTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIGkpKTsK KyAgICAgIGlmIChib3R0b20gPD0geWIpCisgICAgICAgICsraTsKKyAgICAgIGlmIChib3R0b20g Pj0geWIpCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgbGFzdF9vbGQgPSBpOworICAvKiBTa2lw IG92ZXIgcm93cyBlcXVhbCBhdCB0aGUgYm90dG9tLiAqLworICBpID0gbGFzdF9uZXc7CisgIGog PSBsYXN0X29sZDsKKyAgd2hpbGUgKGkgLSAxID4gZmlyc3RfbmV3CisgICAgICAgICAmJiBqIC0g MSA+IGZpcnN0X29sZAorICAgICAgICAgJiYgTUFUUklYX1JPV19FTkFCTEVEX1AgKGN1cnJlbnRf bWF0cml4LCBqIC0gMSkKKyAgICAgICAgICYmIChNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwg aiAtIDEpLT55CisgICAgICAgICAgICAgPT0gTUFUUklYX1JPVyAoZGVzaXJlZF9tYXRyaXgsIGkg LSAxKS0+eSkKKyAgICAgICAgICYmICFNQVRSSVhfUk9XIChkZXNpcmVkX21hdHJpeCwgaSAtIDEp LT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcAor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SVQgPT0gMTEpOworICAg IGVudW0geyBuZXh0X2FsbW9zdF9wcmltZV9pbmNyZW1lbnRfbWF4ID0gMTAgfTsKKyAgICBwdHJk aWZmX3Qgcm93X3RhYmxlX21heCA9CisgICAgICAobWluIChQVFJESUZGX01BWCwgU0laRV9NQVgp IC8gKDMgKiBzaXplb2YgKm1jX3Jvd190YWJsZSkKKyAgICAgICAtIG5leHRfYWxtb3N0X3ByaW1l X2luY3JlbWVudF9tYXgpOworICAgIHB0cmRpZmZfdCBjdXJyZW50X25yb3dzX21heCA9IHJvd190 YWJsZV9tYXggLSBkZXNpcmVkX21hdHJpeC0+bnJvd3M7CisgICAgaWYgKGN1cnJlbnRfbnJvd3Nf bWF4IDwgY3VycmVudF9tYXRyaXgtPm5yb3dzKQorICAgICAgbWVtb3J5X2Z1bGwgKFNJWkVfTUFY KTsKKyAgfQorICAvKiBSZWFsbG9jYXRlIHZlY3RvcnMsIHRhYmxlcyBldGMuIGlmIG5lY2Vzc2Fy eS4gKi8KKyAgaWYgKGN1cnJlbnRfbWF0cml4LT5ucm93cyA+IG1jX29sZF9saW5lc19zaXplKQor ICAgIG1jX29sZF9saW5lcyA9IHhwYWxsb2MgKG1jX29sZF9saW5lcywgJm1jX29sZF9saW5lc19z aXplLAorICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRfbWF0cml4LT5ucm93cyAtIG1j X29sZF9saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgIElOVF9NQVgsIHNpemVv ZiAqbWNfb2xkX2xpbmVzKTsKKyAgaWYgKGRlc2lyZWRfbWF0cml4LT5ucm93cyA+IG1jX25ld19s aW5lc19zaXplKQorICAgIG1jX25ld19saW5lcyA9IHhwYWxsb2MgKG1jX25ld19saW5lcywgJm1j X25ld19saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2lyZWRfbWF0cml4 LT5ucm93cyAtIG1jX25ld19saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAg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gIG1jX3J1bnNfc2l6ZSA9IGRlc2lyZWRfbWF0cml4LT5u cm93czsKKyAgICB9CisgIG5ydW5zID0gcnVuX2lkeCA9IDA7CisgIG1jX3Jvd19lbnRyeV9pZHgg PSAwOworICAvKiBBZGQgcm93cyBmcm9tIHRoZSBjdXJyZW50IGFuZCBkZXNpcmVkIG1hdHJpeCB0 byB0aGUgaGFzaCB0YWJsZQorICAgICByb3dfaGFzaF90YWJsZSB0byBiZSBhYmxlIHRvIGZpbmQg ZXF1YWwgb25lcyBxdWlja2x5LiAqLworICBmb3IgKGkgPSBmaXJzdF9vbGQ7IGkgPCBsYXN0X29s ZDsgKytpKQorICAgIHsKKyAgICAgIGlmIChNQVRSSVhfUk9XX0VOQUJMRURfUCAoY3VycmVudF9t YXRyaXgsIGkpKQorICAgICAgICB7CisgICAgICAgICAgZW50cnkgPSBtY19hZGRfcm93X2VudHJ5 IChNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSkpOworICAgICAgICAgIG1jX29sZF9saW5l c1tpXSA9IGVudHJ5OworICAgICAgICAgICsrZW50cnktPm9sZF91c2VzOworICAgICAgICB9Cisg ICAgICBlbHNlCisgICAgICAgIG1jX29sZF9saW5lc1tpXSA9IE5VTEw7CisgICAgfQorICBmb3Ig KGkgPSBmaXJzdF9uZXc7IGkgPCBsYXN0X25ldzsgKytpKQorICAgIHsKKyAgICAgIGVhc3NlcnQg KE1BVFJJWF9ST1dfRU5BQkxFRF9QIChkZXNpcmVkX21hdHJpeCwgaSkpOworICAgICAgZW50cnkg PSBtY19hZGRfcm93X2VudHJ5IChNQVRSSVhfUk9XIChkZXNpcmVkX21hdHJpeCwgaSkpOworICAg ICAgKytlbnRyeS0+bmV3X3VzZXM7CisgICAgICBlbnRyeS0+bmV3X2xpbmVfbnVtYmVyID0gaTsK KyAgICAgIG1jX25ld19saW5lc1tpXSA9IGVudHJ5OworICAgIH0KKyAgLyogSWRlbnRpZnkgbW92 ZXMgYmFzZWQgb24gbGluZXMgdGhhdCBhcmUgdW5pcXVlIGFuZCBlcXVhbAorICAgICBpbiBib3Ro IG1hdHJpY2VzLiAqLworICBmb3IgKGkgPSBmaXJzdF9vbGQ7IGkgPCBsYXN0X29sZDspCisgICAg aWYgKG1jX29sZF9saW5lc1tpXQorICAgICAgICAmJiBtY19vbGRfbGluZXNbaV0tPm9sZF91c2Vz ID09IDEKKyAgICAgICAgJiYgbWNfb2xkX2xpbmVzW2ldLT5uZXdfdXNlcyA9PSAxKQorICAgICAg eworICAgICAgICBpbnQgcCwgcTsKKyAgICAgICAgaW50IG5ld19saW5lID0gbWNfb2xkX2xpbmVz W2ldLT5uZXdfbGluZV9udW1iZXI7CisgICAgICAgIHN0cnVjdCBydW4gKnJ1biA9IG1jX3J1bl9w b29sICsgcnVuX2lkeCsrOworICAgICAgICAvKiBSZWNvcmQgbW92ZS4gKi8KKyAgICAgICAgcnVu LT5jdXJyZW50X3Zwb3MgPSBpOworICAgICAgICBydW4tPmN1cnJlbnRfeSA9IE1BVFJJWF9ST1cg KGN1cnJlbnRfbWF0cml4LCBpKS0+eTsKKyAgICAgICAgcnVuLT5kZXNpcmVkX3Zwb3MgPSBuZXdf bGluZTsKKyAgICAgICAgcnVuLT5kZXNpcmVkX3kgPSBNQVRSSVhfUk9XIChkZXNpcmVkX21hdHJp eCwgbmV3X2xpbmUpLT55OworICAgICAgICBydW4tPm5yb3dzID0gMTsKKyAgICAgICAgcnVuLT5o ZWlnaHQgPSBNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSktPmhlaWdodDsKKyAgICAgICAg LyogRXh0ZW5kIGJhY2t3YXJkLiAqLworICAgICAgICBwID0gaSAtIDE7CisgICAgICAgIHEgPSBu ZXdfbGluZSAtIDE7CisgICAgICAgIHdoaWxlIChwID4gZmlyc3Rfb2xkCisgICAgICAgICAgICAg ICAmJiBxID4gZmlyc3RfbmV3CisgICAgICAgICAgICAgICAmJiBtY19vbGRfbGluZXNbcF0gPT0g bWNfbmV3X2xpbmVzW3FdKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGludCBoID0gTUFUUklY X1JPVyAoY3VycmVudF9tYXRyaXgsIHApLT5oZWlnaHQ7CisgICAgICAgICAgICAtLXJ1bi0+Y3Vy cmVudF92cG9zOworICAgICAgICAgICAgLS1ydW4tPmRlc2lyZWRfdnBvczsKKyAgICAgICAgICAg ICsrcnVuLT5ucm93czsKKyAgICAgICAgICAgIHJ1bi0+aGVpZ2h0ICs9IGg7CisgICAgICAgICAg ICBydW4tPmRlc2lyZWRfeSAtPSBoOworICAgICAgICAgICAgcnVuLT5jdXJyZW50X3kgLT0gaDsK KyAgICAgICAgICAgIC0tcCwgLS1xOworICAgICAgICAgIH0KKyAgICAgICAgLyogRXh0ZW5kIGZv cndhcmQuICovCisgICAgICAgIHAgPSBpICsgMTsKKyAgICAgICAgcSA9IG5ld19saW5lICsgMTsK KyAgICAgICAgd2hpbGUgKHAgPCBsYXN0X29sZAorICAgICAgICAgICAgICAgJiYgcSA8IGxhc3Rf bmV3CisgICAgICAgICAgICAgICAmJiBtY19vbGRfbGluZXNbcF0gPT0gbWNfbmV3X2xpbmVzW3Fd KQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGludCBoID0gTUFUUklYX1JPVyAoY3VycmVudF9t YXRyaXgsIHApLT5oZWlnaHQ7CisgICAgICAgICAgICArK3J1bi0+bnJvd3M7CisgICAgICAgICAg ICBydW4tPmhlaWdodCArPSBoOworICAgICAgICAgICAgKytwLCArK3E7CisgICAgICAgICAgfQor ICAgICAgICAvKiBJbnNlcnQgcnVuIGludG8gbGlzdCBvZiBhbGwgcnVucy4gIE9yZGVyIHJ1bnMg YnkgY29waWVkCisgICAgICAgICAgIHBpeGVsIGxpbmVzLiAgTm90ZSB0aGF0IHdlIHJlY29yZCBy dW5zIHRoYXQgZG9uJ3QgaGF2ZSB0bworICAgICAgICAgICBiZSBjb3BpZWQgYmVjYXVzZSB0aGV5 IGFyZSBhbHJlYWR5IGluIHBsYWNlLiAgVGhpcyBpcyBkb25lCisgICAgICAgICAgIGJlY2F1c2Ug d2UgY2FuIGF2b2lkIGNhbGxpbmcgdXBkYXRlX3dpbmRvd19saW5lIGluIHRoaXMKKyAgICAgICAg ICAgY2FzZS4gKi8KKyAgICAgICAgZm9yIChwID0gMDsgcCA8IG5ydW5zICYmIG1jX3J1bnNbcF0t PmhlaWdodCA+IHJ1bi0+aGVpZ2h0OyArK3ApCisgICAgICAgICAgOworICAgICAgICBmb3IgKHEg PSBucnVuczsgcSA+IHA7IC0tcSkKKyAgICAgICAgICBtY19ydW5zW3FdID0gbWNfcnVuc1txIC0g MV07CisgICAgICAgIG1jX3J1bnNbcF0gPSBydW47CisgICAgICAgICsrbnJ1bnM7CisgICAgICAg IGkgKz0gcnVuLT5ucm93czsKKyAgICAgIH0KKyAgICBlbHNlCisgICAgICArK2k7CisgIC8qIERv IHRoZSBtb3Zlcy4gIERvIGl0IGluIGEgd2F5IHRoYXQgd2UgZG9uJ3Qgb3ZlcndyaXRlIHNvbWV0 aGluZworICAgICB3ZSB3YW50IHRvIGNvcHkgbGF0ZXIgb24uICBUaGlzIGlzIG5vdCBzb2x2YWJs ZSBpbiBnZW5lcmFsCisgICAgIGJlY2F1c2UgdGhlcmUgaXMgb25seSBvbmUgZGlzcGxheSBhbmQg d2UgZG9uJ3QgaGF2ZSBhIHdheSB0bworICAgICBleGNoYW5nZSBhcmVhcyBvbiB0aGlzIGRpc3Bs YXkuICBFeGFtcGxlOgorICAgICAgICAgICstLS0tLS0tLS0tLSsgICAgICAgKy0tLS0tLS0tLS0t KworICAgICAgICAgIHwgICAgIEEgICAgIHwgICAgICAgfCAgICAgQiAgICAgfAorICAgICAgICAg ICstLS0tLS0tLS0tLSsgIC0tPiAgKy0tLS0tLS0tLS0tKworICAgICAgICAgIHwgICAgIEIgICAg IHwgICAgICAgfCAgICAgQSAgICAgfAorICAgICAgICAgICstLS0tLS0tLS0tLSsgICAgICAgKy0t LS0tLS0tLS0tKworICAgICBJbnN0ZWFkLCBwcmVmZXIgYmlnZ2VyIG1vdmVzLCBhbmQgaW52YWxp ZGF0ZSBtb3ZlcyB0aGF0IHdvdWxkCisgICAgIGNvcHkgZnJvbSB3aGVyZSB3ZSBjb3BpZWQgdG8u ICovCisgIGZvciAoaSA9IDA7IGkgPCBucnVuczsgKytpKQorICAgIGlmIChtY19ydW5zW2ldLT5u cm93cyA+IDApCisgICAgICB7CisgICAgICAgIHN0cnVjdCBydW4gKnIgPSBtY19ydW5zW2ldOwor ICAgICAgICBpZiAoci0+Y3VycmVudF95ICE9IHItPmRlc2lyZWRfeSkKKyAgICAgICAgICB7Cisg ICAgICAgICAgICAvLyAgZnByaW50ZiAoc3RkZXJyLCAiJXM6ICByLT5jdXJyZW50L2Rlc2lyZWRf dnBvcyAoJWQvJWQpIHwgci0+Y3VycmVudC9kZXNpcmVkX3kgKCVkLyVkKVxuIiwKKyAgICAgICAg ICAgIC8vICAgICAgICAgICByLT5jdXJyZW50X3kgPCByLT5kZXNpcmVkX3kgPyAi4oaTIiA6ICLi hpEiLAorICAgICAgICAgICAgLy8gICAgICAgICAgIHItPmN1cnJlbnRfdnBvcywgci0+ZGVzaXJl ZF92cG9zLCByLT5jdXJyZW50X3ksIHItPmRlc2lyZWRfeSk7CisgICAgICAgICAgICAvLyAgcmlm LT5jbGVhcl93aW5kb3dfbW91c2VfZmFjZSAodyk7CisgICAgICAgICAgICAvLyAgcmlmLT5zY3Jv bGxfcnVuX2hvb2sgKHcsIHIpOworICAgICAgICAgIH0KKyAgICAgICAgLyogVHJ1bmNhdGUgcnVu cyB0aGF0IGNvcHkgdG8gd2hlcmUgd2UgY29waWVkIHRvLCBhbmQKKyAgICAgICAgICAgaW52YWxp ZGF0ZSBydW5zIHRoYXQgY29weSBmcm9tIHdoZXJlIHdlIGNvcGllZCB0by4gKi8KKyAgICAgICAg Zm9yIChqID0gbnJ1bnMgLSAxOyBqID4gaTsgLS1qKQorICAgICAgICAgIHsKKyAgICAgICAgICAg IHN0cnVjdCBydW4gKnAgPSBtY19ydW5zW2pdOworICAgICAgICAgICAgYm9vbCB0cnVuY2F0ZWRf cCA9IDA7CisgICAgICAgICAgICBpZiAocC0+bnJvd3MgPiAwCisgICAgICAgICAgICAgICAgJiYg cC0+ZGVzaXJlZF95IDwgci0+ZGVzaXJlZF95ICsgci0+aGVpZ2h0CisgICAgICAgICAgICAgICAg JiYgcC0+ZGVzaXJlZF95ICsgcC0+aGVpZ2h0ID4gci0+ZGVzaXJlZF95KQorICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgaWYgKHAtPmRlc2lyZWRfeSA8IHItPmRlc2lyZWRfeSkKKyAg ICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcC0+bnJvd3MgPSByLT5kZXNp cmVkX3Zwb3MgLSBwLT5kZXNpcmVkX3Zwb3M7CisgICAgICAgICAgICAgICAgICAgIHAtPmhlaWdo dCA9IHItPmRlc2lyZWRfeSAtIHAtPmRlc2lyZWRfeTsKKyAgICAgICAgICAgICAgICAgICAgdHJ1 bmNhdGVkX3AgPSAxOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaW50IG5yb3dzX2NvcGll ZCA9IChyLT5kZXNpcmVkX3Zwb3MgKyByLT5ucm93cworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIC0gcC0+ZGVzaXJlZF92cG9zKTsKKyAgICAgICAgICAgICAgICAgICAg aWYgKHAtPm5yb3dzIDw9IG5yb3dzX2NvcGllZCkKKyAgICAgICAgICAgICAgICAgICAgICBwLT5u cm93cyA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaGVpZ2h0X2NvcGllZCA9IChy LT5kZXNpcmVkX3kgKyByLT5oZWlnaHQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgLSBwLT5kZXNpcmVkX3kpOworICAgICAgICAgICAgICAgICAgICAgICAg ICBwLT5jdXJyZW50X3Zwb3MgKz0gbnJvd3NfY29waWVkOworICAgICAgICAgICAgICAgICAgICAg ICAgICBwLT5kZXNpcmVkX3Zwb3MgKz0gbnJvd3NfY29waWVkOworICAgICAgICAgICAgICAgICAg ICAgICAgICBwLT5ucm93cyAtPSBucm93c19jb3BpZWQ7CisgICAgICAgICAgICAgICAgICAgICAg ICAgIHAtPmN1cnJlbnRfeSArPSBoZWlnaHRfY29waWVkOworICAgICAgICAgICAgICAgICAgICAg ICAgICBwLT5kZXNpcmVkX3kgKz0gaGVpZ2h0X2NvcGllZDsKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgcC0+aGVpZ2h0IC09IGhlaWdodF9jb3BpZWQ7CisgICAgICAgICAgICAgICAgICAgICAg ICAgIHRydW5jYXRlZF9wID0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHItPmN1cnJlbnRf eSAhPSByLT5kZXNpcmVkX3kKKyAgICAgICAgICAgICAgICAvKiBUaGUgY29uZGl0aW9uIGJlbG93 IGlzIGVxdWl2YWxlbnQgdG8KKyAgICAgICAgICAgICAgICAgICAoKHAtPmN1cnJlbnRfeSA+PSBy LT5kZXNpcmVkX3kKKyAgICAgICAgICAgICAgICAgICAgICYmIHAtPmN1cnJlbnRfeSA8IHItPmRl c2lyZWRfeSArIHItPmhlaWdodCkKKyAgICAgICAgICAgICAgICAgICAgfHwgKHAtPmN1cnJlbnRf eSArIHAtPmhlaWdodCA+IHItPmRlc2lyZWRfeQorICAgICAgICAgICAgICAgICAgICAgICAgJiYg KHAtPmN1cnJlbnRfeSArIHAtPmhlaWdodAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDw9 IHItPmRlc2lyZWRfeSArIHItPmhlaWdodCkpKQorICAgICAgICAgICAgICAgICAgIGJlY2F1c2Ug d2UgaGF2ZSAwIDwgcC0+aGVpZ2h0IDw9IHItPmhlaWdodC4gKi8KKyAgICAgICAgICAgICAgICAm JiBwLT5jdXJyZW50X3kgPCByLT5kZXNpcmVkX3kgKyByLT5oZWlnaHQKKyAgICAgICAgICAgICAg ICAmJiBwLT5jdXJyZW50X3kgKyBwLT5oZWlnaHQgPiByLT5kZXNpcmVkX3kpCisgICAgICAgICAg ICAgIHAtPm5yb3dzID0gMDsKKyAgICAgICAgICAgIC8qIFJlb3JkZXIgcnVucyBieSBjb3BpZWQg cGl4ZWwgbGluZXMgaWYgdHJ1bmNhdGVkLiAqLworICAgICAgICAgICAgaWYgKHRydW5jYXRlZF9w ICYmIHAtPm5yb3dzID4gMCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGludCBr ID0gbnJ1bnMgLSAxOworICAgICAgICAgICAgICAgIHdoaWxlIChtY19ydW5zW2tdLT5ucm93cyA9 PSAwIHx8IG1jX3J1bnNba10tPmhlaWdodCA8IHAtPmhlaWdodCkKKyAgICAgICAgICAgICAgICAg IGstLTsKKyAgICAgICAgICAgICAgICBtZW1tb3ZlIChtY19ydW5zICsgaiwgbWNfcnVucyArIGog KyAxLCAoayAtIGopICogc2l6ZW9mICgqbWNfcnVucykpOworICAgICAgICAgICAgICAgIG1jX3J1 bnNba10gPSBwOworICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgICAvKiBBc3Np Z24gbWF0cml4IHJvd3MuICovCisgICAgICAgIGZvciAoaiA9IDA7IGogPCByLT5ucm93czsgKytq KQorICAgICAgICAgIHsKKyAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKmZyb20sICp0bzsK KyAgICAgICAgICAgIGJvb2wgdG9fb3ZlcmxhcHBlZF9wOworICAgICAgICAgICAgdG8gPSBNQVRS SVhfUk9XIChjdXJyZW50X21hdHJpeCwgci0+ZGVzaXJlZF92cG9zICsgaik7CisgICAgICAgICAg ICBmcm9tID0gTUFUUklYX1JPVyAoZGVzaXJlZF9tYXRyaXgsIHItPmRlc2lyZWRfdnBvcyArIGop OworICAgICAgICAgICAgdG9fb3ZlcmxhcHBlZF9wID0gdG8tPm92ZXJsYXBwZWRfcDsKKyAgICAg ICAgICAgIGZyb20tPnJlZHJhd19mcmluZ2VfYml0bWFwc19wID0gZnJvbS0+ZnJpbmdlX2JpdG1h cF9wZXJpb2RpY19wOworICAgICAgICAgICAgYXNzaWduX3JvdyAodG8sIGZyb20pOworICAgICAg ICAgICAgLyogVGhlIGFib3ZlIGBhc3NpZ25fcm93JyBhY3R1YWxseSBkb2VzIHN3YXAsIHNvIGlm IHdlIGhhZAorICAgICAgICAgICAgICAgYW4gb3ZlcmxhcCBpbiB0aGUgY29weSBkZXN0aW5hdGlv biBvZiB0d28gcnVucywgdGhlbgorICAgICAgICAgICAgICAgdGhlIHNlY29uZCBydW4gd291bGQg YXNzaWduIGEgcHJldmlvdXNseSBkaXNhYmxlZCBib2d1cworICAgICAgICAgICAgICAgcm93LiAg QnV0IHRoYW5rcyB0byB0aGUgdHJ1bmNhdGlvbiBjb2RlIGluIHRoZQorICAgICAgICAgICAgICAg cHJlY2VkaW5nIGZvci1sb29wLCB3ZSBubyBsb25nZXIgaGF2ZSBzdWNoIGFuIG92ZXJsYXAsCisg ICAgICAgICAgICAgICBhbmQgdGh1cyB0aGUgYXNzaWduZWQgcm93IHNob3VsZCBhbHdheXMgYmUg ZW5hYmxlZC4gKi8KKyAgICAgICAgICAgIGVhc3NlcnQgKHRvLT5lbmFibGVkX3ApOworICAgICAg ICAgICAgZnJvbS0+ZW5hYmxlZF9wID0gZmFsc2U7CisgICAgICAgICAgICB0by0+b3ZlcmxhcHBl ZF9wID0gdG9fb3ZlcmxhcHBlZF9wOworICAgICAgICAgIH0KKyAgICAgIH0KKyAgLyogQ2xlYXIg dGhlIGhhc2ggdGFibGUsIGZ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ZXJlIHdvdWxkIHJlbWFpbiBhIHBpeGVsIGZyb20gdGhlCisgICAg ICAgYGYnIG9uIHRoZSBzY3JlZW4uICovCisgICAgaWYgKG92ZXJsYXBwaW5nX2dseXBoc19wICYm IGkgPiAwKQorICAgICAgeworICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoID0gJmN1cnJlbnRf cm93LT5nbHlwaHNbVEVYVF9BUkVBXVtpIC0gMV07CisgICAgICAgIGludCBsZWZ0LCByaWdodDsK KyAgICAgICAgcmlmLT5nZXRfZ2x5cGhfb3ZlcmhhbmdzIChnbHlwaCwgWEZSQU1FICh3LT5mcmFt ZSksICZsZWZ0LCAmcmlnaHQpOworICAgICAgICBjYW5fc2tpcF9wID0gKHJpZ2h0ID09IDAgJiYg IWFib3J0X3NraXBwaW5nKTsKKyAgICAgIH0KKworICAgIGlmIChjYW5fc2tpcF9wKQorICAgICAg eworICAgICAgICBpbnQgc3RhcnRfaHBvcyA9IGk7CisKKyAgICAgICAgd2hpbGUgKGkgPCBzdG9w CisgICAgICAgICAgICAgICAmJiBHTFlQSF9FUVVBTF9QIChkZXNpcmVkX2dseXBoLCBjdXJyZW50 X2dseXBoKSkKKyAgICAgICAgICB7CisgICAgICAgICAgICArK2FycmF5X2dseXBoc19za2lwcGVk LnVzZWQ7CisgICAgICAgICAgICBpZiAoYXJyYXlfZ2x5cGhzX3NraXBwZWQuYWxsb2NhdGVkIDwg YXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgIGludCBvbGRfYWxsb2MgPSBhcnJheV9nbHlwaHNfc2tpcHBlZC5hbGxvY2F0ZWQ7CisgICAg ICAgICAgICAgICAgaW50IG5ld19lbHRzID0gYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZCAtIGFy cmF5X2dseXBoc19za2lwcGVkLmFsbG9jYXRlZDsKKyAgICAgICAgICAgICAgICBhcnJheV9nbHlw aHNfc2tpcHBlZC5za2lwcGVkID0KKyAgICAgICAgICAgICAgICAgIHhwYWxsb2MgKGFycmF5X2ds eXBoc19za2lwcGVkLnNraXBwZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmYXJyYXlf Z2x5cGhzX3NraXBwZWQuYWxsb2NhdGVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3 X2VsdHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBJTlRfTUFYLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgc2l6ZW9mICphcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVkKTsKKyAg ICAgICAgICAgICAgICBtZW1zZXQgKGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWQgKyBvbGRf YWxsb2MsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgKGFycmF5X2dseXBoc19za2lwcGVk LmFsbG9jYXRlZCAtIG9sZF9hbGxvYykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICogc2l6 ZW9mICphcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVkKTsKKyAgICAgICAgICAgICAgfQorICAg ICAgICAgICAgaW50IG50aCA9IGFycmF5X2dseXBoc19za2lwcGVkLnVzZWQgLSAxOworICAgICAg ICAgICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZFtudGhdLnggPSB4OworICAgICAgICAg ICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZFtudGhdLmhwb3MgPSBpOworICAgICAgICAg ICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZFtudGhdLmVuYWJsZWRfcCA9IHRydWU7Cisg ICAgICAgICAgICB4ICs9IGRlc2lyZWRfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAg KytkZXNpcmVkX2dseXBoLCArK2N1cnJlbnRfZ2x5cGgsICsraTsKKyAgICAgICAgICB9CisKKyAg ICAgICAgLyogQ29uc2lkZXIgdGhlIGNhc2UgdGhhdCB0aGUgY3VycmVudCByb3cgY29udGFpbnMg Inh4eAorICAgICBwcHAgZ2dnIiBpbiBpdGFsaWMgQ291cmllciBmb250LCBhbmQgdGhlIGRlc2ly ZWQgcm93CisgICAgIGlzICJ4eHggZ2dnIi4gIFRoZSBjaGFyYWN0ZXIgYHAnIGhhcyBsYmVhcmlu ZywgYGcnCisgICAgIGhhcyBub3QuICBUaGUgbG9vcCBhYm92ZSB3aWxsIHN0b3AgaW4gZnJvbnQg b2YgdGhlCisgICAgIGZpcnN0IGBwJyBpbiB0aGUgY3VycmVudCByb3cuICBJZiB3ZSB3b3VsZCBz dGFydAorICAgICB3cml0aW5nIGdseXBocyB0aGVyZSwgd2Ugd291bGRuJ3QgZXJhc2UgdGhlIGxi ZWFyaW5nCisgICAgIG9mIHRoZSBgcCcuICBUaGUgcmVzdCBvZiB0aGUgbGJlYXJpbmcgcHJvYmxl bSBpcyB0aGVuCisgICAgIHRha2VuIGNhcmUgb2YgYnkgZHJhd19nbHlwaHMuICovCisgICAgICAg IGlmIChvdmVybGFwcGluZ19nbHlwaHNfcAorICAgICAgICAgICAgJiYgaSA+IDAKKyAgICAgICAg ICAgICYmIGkgPCBjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAmJiAo Y3VycmVudF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAhPSBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FS RUFdKSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpbnQgbGVmdCwgcmlnaHQ7CisgICAgICAg ICAgICByaWYtPmdldF9nbHlwaF9vdmVyaGFuZ3MgKGN1cnJlbnRfZ2x5cGgsCisgICAgICAgICAg ICAgICAgICAgIFhGUkFNRSAody0+ZnJhbWUpLAorICAgICAgICAgICAgICAgICAgICAmbGVmdCwg JnJpZ2h0KTsKKyAgICAgICAgICAgIHdoaWxlIChsZWZ0ID4gMCAmJiBpID4gMCkKKyAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgIC0taSwgLS1kZXNpcmVkX2dseXBoLCAtLWN1cnJlbnRf Z2x5cGg7CisgICAgICAgICAgICAgICAgeCAtPSBkZXNpcmVkX2dseXBoLT5waXhlbF93aWR0aDsK KyAgICAgICAgICAgICAgICBsZWZ0IC09IGRlc2lyZWRfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAg ICAgICAgICAgICB9CisgICAgICAgICAgICAvKiBBYm9ydCB0aGUgc2tpcHBpbmcgYWxnb3JpdGht IGlmIHdlIGVuZCB1cCBiZWZvcmUKKyAgICAgICAgICAgICAgIG91ciBzdGFydGluZyBwb2ludCwg dG8gYXZvaWQgbG9vcGluZyAoYnVnIzEwNzApLgorICAgICAgICAgICAgICAgVGhpcyBjYW4gaGFw cGVuIHdoZW4gdGhlIGxiZWFyaW5nIGlzIGxhcmdlciB0aGFuCisgICAgICAgICAgICAgICB0aGUg cGl4ZWwgd2lkdGguICovCisgICAgICAgICAgICBhYm9ydF9za2lwcGluZyA9IChpIDwgc3RhcnRf aHBvcyk7CisgICAgICAgICAgfQorICAgICAgfQorCisgICAgLyogVHJ5IHRvIGF2b2lkIHdyaXRp bmcgdGhlIGVudGlyZSByZXN0IG9mIHRoZSBkZXNpcmVkIHJvdworICAgICAgIGJ5IGxvb2tpbmcg Zm9yIGEgcmVzeW5jIHBvaW50LiAgVGhpcyBtYWlubHkgcHJldmVudHMKKyAgICAgICBtb2RlIGxp bmUgZmxpY2tlcmluZyBpbiB0aGUgY2FzZSB0aGUgbW9kZSBsaW5lIGlzIGluCisgICAgICAgZml4 ZWQtcGl0Y2ggZm9udCwgd2hpY2ggaXQgdXN1YWxseSB3aWxsIGJlLiAqLworICAgIGlmIChpIDwg ZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgIHsKKyAgICAgICAgaW50IHN0YXJ0 X3ggPSB4LCBzdGFydF9ocG9zID0gaTsKKyAgICAgICAgc3RydWN0IGdseXBoICpzdGFydCA9IGRl c2lyZWRfZ2x5cGg7CisgICAgICAgIGludCBjdXJyZW50X3ggPSB4OworICAgICAgICBib29sIHNr aXBfZmlyc3RfcCA9ICFjYW5fc2tpcF9wOworICAgICAgICAvKiBGaW5kIHRoZSBuZXh0IGdseXBo IHRoYXQncyBlcXVhbCBhZ2Fpbi4gKi8KKyAgICAgICAgd2hpbGUgKGkgPCBzdG9wCisgICAgICAg ICAgICAgICAmJiAoc2tpcF9maXJzdF9wCisgICAgICAgICAgICAgICAgICAgfHwgIUdMWVBIX0VR VUFMX1AgKGRlc2lyZWRfZ2x5cGgsIGN1cnJlbnRfZ2x5cGgpKQorICAgICAgICAgICAgICAgJiYg eCA9PSBjdXJyZW50X3gpCisgICAgICAgICAgeworICAgICAgICAgICAgeCArPSBkZXNpcmVkX2ds eXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgIGN1cnJlbnRfeCArPSBjdXJyZW50X2dseXBo LT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICsrZGVzaXJlZF9nbHlwaCwgKytjdXJyZW50X2ds eXBoLCArK2k7CisgICAgICAgICAgICBza2lwX2ZpcnN0X3AgPSAwOworICAgICAgICAgIH0KKwor ICBmb3IgKGludCBlbHQgPSAwOworICAgICAgIGVsdCA8IGFycmF5X2dseXBoc19za2lwcGVkLnVz ZWQKKyAgICAgICAmJiB2cG9zICE9IGJvdHRvbV92cG9zOworICAgICAgICsrZWx0KQorICAgIHsK KyAgICAgIGludCB4ID0gYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZFtlbHRdLng7CisgICAg ICBpbnQgaHBvcyA9IGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbZWx0XS5ocG9zOworICAg ICAgc3RydWN0IGdseXBoICp0YXJnZXRfZ2x5cGggPQorICAgICAgICBtY19nZXRfY3Vyc29yX2ds eXBoICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIGhwb3MsIHZwb3MpOworICAgICAg aWYgKGRlYnVnX3ApCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIlNLSVBQRUQ6ICB2cG9zICgl ZCkgfCBjaGFyICglZC8lcykgfCB4OiAoJWQpIHwgaHBvcyAoJWQvJWQpXG4iLAorICAgICAgICAg ICAgICAgICAgICAgICAgIHZwb3MsIHRhcmdldF9nbHlwaC0+dS5jaCwgbWNfY2hhcl90b19zdHJp bmcgKHRhcmdldF9nbHlwaC0+dS5jaCksCisgICAgICAgICAgICAgICAgICAgICAgICAgeCwgaHBv cywgdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpOworICAgICAgbWNfZHJhd19yb3cg KHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBoLCB4LCAxLCB2cG9z LAorICAgICAgICAgICAgICAgICAgIGJvdHRvbV92cG9zLCBjdXJzb3JfbWF0cml4LCBlc3NlbnRp YWxzLCBkcmF3X3AsIFNLSVBQRUQpOworICAgIH0KKworICAgICAgICBpZiAoaSA9PSBzdGFydF9o cG9zIHx8IHggIT0gY3VycmVudF94KQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGkgPSBzdGFy dF9ocG9zOworICAgICAgICAgICAgeCA9IHN0YXJ0X3g7CisgICAgICAgICAgICBkZXNpcmVkX2ds eXBoID0gc3RhcnQ7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICB9CisKKyAgICAgICAg b3V0cHV0X2N1cnNvcl90byAodywgdnBvcywgc3RhcnRfaHBvcywgZGVzaXJlZF9yb3ctPnksIHN0 YXJ0X3gpOworCisgIC8qIFJlLWRyYXcgYSBwb3J0aW9uIG9mIHRoZSByb3cuICovCisKKyAgaWYg KGRlYnVnX3AKKyAgICAgICYmIHZwb3MgIT0gYm90dG9tX3Zwb3MpCisgICAgeworICAgICAgZnBy aW50ZiAoc3RkZXJyLCAiUkVEUkFXIFNFR01FTlQ6XG5cCisgICAgICB2cG9zICglZCkgfCBjaGFy ICglZC8lc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cm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3cs IHN0YXJ0LCB4LAorICAgICAgICAgICAgICAgICAgICAgdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9B UkVBXSAtIGhwb3MsIHZwb3MsIGJvdHRvbV92cG9zLAorICAgICAgICAgICAgICAgICAgICAgY3Vy c29yX21hdHJpeCwgZXNzZW50aWFscywgZHJhd19wLCBQT1NUX0NIQU5HRUQpOworICAgICAgfQor ICAgICAgLyogVGhlcmUgd2VyZSBubyBjaGFuZ2VzIGFuZCBpID09IGRlc2lyZWRfcm93LT51c2Vk W1RFWFRfQVJFQV0gKi8KKyAgICAgIGVsc2UgaWYgKCFjaGFuZ2VkX3ApCisgICAgICAgIHsKKyAg ICAgICAgICBpZiAoZGVidWdfcCkKKyAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIlVOQ0hB TkdFRCAtLSBXUklURSBFTlRJUkUgTElORTogIHZwb3MgKCVkKSB8IHJvdy0+dXNlZCAoJWQpXG4i LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCB1cGRhdGVkX3Jvdy0+dXNlZFtU RVhUX0FSRUFdIC0gMSk7CisgICAgICAgICAgbWNfZHJhd19yb3cgKHcsIGRlc2lyZWRfbWF0cml4 LCB1cGRhdGVkX3JvdywgZGVzaXJlZF9yb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAg ICAgICAgICAgICAgICBkZXNpcmVkX3Jvdy0+eCwgZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVB XSwgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgYm90dG9tX3Zwb3MsIGN1cnNvcl9tYXRy aXgsIGVzc2VudGlhbHMsIGRyYXdfcCwgVU5DSEFOR0VEKTsKKyAgICAgICAgfQorCisgICAgICAv KiBNYXliZSBjbGVhciB0byBlbmQgb2YgbGluZS4gKi8KKyAgICAgIGlmIChNQVRSSVhfUk9XX0VY VEVORFN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5lICh3LCB1cGRhdGVkX3Jv dywgVEVYVF9BUkVBLCAtMSk7CisgICAgICAgICAgY2xlYXJfdG9feCA9IC0xOworICAgICAgICAg IGNoYW5nZWRfcCA9IDE7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKGRlc2lyZWRfcm93LT5w aXhlbF93aWR0aCA8IGN1cnJlbnRfcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgeworICAgICAg ICAgIC8qIE90aGVyd2lzZSBjbGVhciB0byB0aGUgZW5kIG9mIHRoZSBvbGQgcm93LiAgRXZlcnl0 aGluZworICAgICAgICAgICAgIGFmdGVyIHRoYXQgcG9zaXRpb24gc2hvdWxkIGJlIGNsZWFyIGFs cmVhZHkuICovCisgICAgICAgICAgaW50IHhsaW07CisgICAgICAgICAgaWYgKGkgPj0gZGVzaXJl ZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgICAgICAgIG91dHB1dF9jdXJzb3JfdG8gKHcs IHZwb3MsIGksIGRlc2lyZWRfcm93LT55LCBkZXNpcmVkX3Jvdy0+cGl4ZWxfd2lkdGgpOworICAg ICAgICAgIC8qIElmIGN1cnNvciBpcyBkaXNwbGF5ZWQgYXQgdGhlIGVuZCBvZiB0aGUgbGluZSwg bWFrZSBzdXJlCisgICAgICAgICAgICAgaXQncyBjbGVhcmVkLiAgTm93YWRheXMgd2UgZG9uJ3Qg aGF2ZSBhIHBoeXNfY3Vyc29yX2dseXBoCisgICAgICAgICAgICAgd2l0aCB3aGljaCB0byBlcmFz ZSB0aGUgY3Vyc29yIChiZWNhdXNlIHRoaXMgbWV0aG9kCisgICAgICAgICAgICAgZG9lc24ndCB3 b3JrIHdpdGggbGJlYXJpbmcvcmJlYXJpbmcpLCBzbyB3ZSBtdXN0IGRvIGl0IHRoaXMgd2F5LiAq LworICAgICAgICAgIGlmICh2cG9zID09IHctPnBoeXNfY3Vyc29yLnZwb3MKKyAgICAgICAgICAg ICAgJiYgKGRlc2lyZWRfcm93LT5yZXZlcnNlZF9wCisgICAgICAgICAgICAgICAgICA/ICh3LT5w aHlzX2N1cnNvci5ocG9zIDwgMCkKKyAgICAgICAgICAgICAgICAgIDogKHctPnBoeXNfY3Vyc29y Lmhwb3MgPj0gZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSkpKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICB3LT5waHlzX2N1cnNvcl9vbl9wID0gMDsKKyAgICAgICAgICAgICAgeGxp bSA9IC0xOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICB4 bGltID0gY3VycmVudF9yb3ctPnBpeGVsX3dpZHRoOworICAgICAgICAgIGlmIChkcmF3X3ApCisg ICAgICAgICAgICByaWYtPmNsZWFyX2VuZF9vZl9saW5lICh3LCB1cGRhdGVkX3JvdywgVEVYVF9B UkVBLCB4bGltKTsKKyAgICAgICAgICBjbGVhcl90b194ID0geGxpbTsKKyAgICAgICAgICBjaGFu Z2VkX3AgPSAxOworICAgICAgICB9CisKKyAgaWYgKGNoYW5nZWRfcAorICAgICAgJiYgY2xlYXJf dG9feCAhPSAwKQorICAgIHsKKyAgICAgIGludCB0ZXh0X2FyZWFfd2lkdGggPSB3aW5kb3dfYm94 X3dpZHRoICh3LCBURVhUX0FSRUEpOworICAgICAgc3RydWN0IG1jX1JHQiBkZWJ1Z19mZyA9IHsu cmVkID0gMC44NjcsIC5ncmVlbiA9IDAuODY3LCAuYmx1ZSA9IDAuODY3fTsKKyAgICAgIHN0cnVj dCBnbHlwaCAqdGFyZ2V0X2dseXBoID0gdXBkYXRlZF9yb3ctPmdseXBoc1tURVhUX0FSRUFdICsg dXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDE7CisgICAgICAvKiBgbWNfZW5naW5lJyBv bmx5IGRyYXdzIGFuIE1DX0dMWVBIIHdoZW4geCA8IHVwZGF0ZWRfcm93LT5waXhlbF93aWR0aC4K KyAgICAgIFRoZSBjdXJyZW50I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QlVGRkVSICh3LT5j b250ZW50cyksIGNoX2hvcml6b250YWxfcnVsZXIpKQorICAgICAgICAgICYmIHggPCB0ZXh0X2Fy ZWFfd2lkdGgKKyAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAg JiYgdGFyZ2V0X2dseXBoICE9IE5VTEwKKyAgICAgICAgICAmJiBkcmF3X3ApCisgICAgICAgIG1j X2VuZ2luZSAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRfZ2x5cGgsIFRF WFRfQVJFQSwgeCwgeF9saW1pdCwKKyAgICAgICAgICAgICAgICAgICB1cGRhdGVkX3Jvdy0+eSwg aHBvcywgdnBvcywgTUNfSEJBUiwgMSwgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscy5mY194LAor ICAgICAgICAgICAgICAgICAgIGRlYnVnX3AgPyBkZWJ1Z19mZyA6IGVzc2VudGlhbHMuY2hfZmcs IGVzc2VudGlhbHMuYWN0aXZlX3AsIEhPUklaT05UQUxfUlVMRVIsCisgICAgICAgICAgICAgICAg ICAgZHJhd19wLCBOT1dIRVJFLCBOT19DQUNIRSk7CisKKyAgICAgIGlmIChCVUZGRVJQICh3LT5j b250ZW50cykKKyAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMp LCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgJiYgeCA8IHRleHRfYXJlYV93 aWR0aAorICAgICAgICAgICYmIHZwb3MgIT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAgICAmJiB3 LT5jdXJzb3IueCA+PSB4CisgICAgICAgICAgJiYgdGFyZ2V0X2dseXBoICE9IE5VTEwKKyAgICAg ICAgICAmJiBkcmF3X3ApCisgICAgICAgIG1jX2VuZ2luZSAodywgZGVzaXJlZF9tYXRyaXgsIHVw ZGF0ZWRfcm93LCB0YXJnZXRfZ2x5cGgsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwKKyAgICAgICAg ICAgICAgICAgICB1cGRhdGVkX3Jvdy0+eSwgaHBvcywgdnBvcywgTUNfQkFSLCAxLCBjdXJzb3Jf bWF0cml4LCBlc3NlbnRpYWxzLmZjX3gsCisgICAgICAgICAgICAgICAgICAgZGVidWdfcCA/IGRl YnVnX2ZnIDogZXNzZW50aWFscy5jaF9mZywgZXNzZW50aWFscy5hY3RpdmVfcCwgVkVSVElDQUxf UlVMRVIsCisgICAgICAgICAgICAgICAgICAgZHJhd19wLCBOT1dIRVJFLCBOT19DQUNIRSk7CisK KyAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAmJiAhTklMUCAoQlZB UiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAmJiB4IDwg dGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID49IHgKKyAgICAg ICAgICAmJiB0YXJnZXRfZ2x5cGggIT0gTlVMTAorICAgICAgICAgICYmIGRyYXdfcCkKKyAgICAg ICAgbWNfZW5naW5lICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHRhcmdldF9nbHlw aCwgVEVYVF9BUkVBLCB4LCB4X2xpbWl0LAorICAgICAgICAgICAgICAgICAgIHVwZGF0ZWRfcm93 LT55LCBocG9zLCB2cG9zLCBNQ19CQVIsIDEsIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMuZmNf eCwKKyAgICAgICAgICAgICAgICAgICBkZWJ1Z19wID8gZGVidWdfZmcgOiBlc3NlbnRpYWxzLmZj X2ZnLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBGSUxMX0NPTFVNTiwKKyAgICAgICAgICAgICAgICAg ICBkcmF3X3AsIE5PV0hFUkU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ZGF0ZV90ZXh0X2FyZWEgKHcsIGRlc2lyZWRfcm93LCB2cG9zLCBjdXJzb3JfbWF0cml4LAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLCBkcmF3 X3ApOworICAgICAgLyogVXBkYXRlIHRoZSBkaXNwbGF5IG9mIHRoZSB0ZXh0IGFyZWEuICovCisg ICAgICBpZiAodXBkYXRlZF9wKQorICAgICAgICB7CisgICAgICAgICAgY2hhbmdlZF9wID0gMTsK KyAgICAgICAgICBpZiAoY3VycmVudF9yb3ctPm1vdXNlX2ZhY2VfcCkKKyAgICAgICAgICAgICpt b3VzZV9mYWNlX292ZXJ3cml0dGVuX3AgPSAxOworICAgICAgICB9CisgICAgICAvKiBVcGRhdGUg ZGlzcGxheSBvZiB0aGUgcmlnaHQgbWFyZ2luIGFyZWEsIGlmIHRoZXJlIGlzIG9uZS4gKi8KKyAg ICAgIGlmICghZGVzaXJlZF9yb3ctPmZ1bGxfd2lkdGhfcCAmJiB3LT5yaWdodF9tYXJnaW5fY29s cyA+IDApCisgICAgICAgIHsKKyAgICAgICAgICBjaGFuZ2VkX3AgPSAxOworICAgICAgICAgIHVw ZGF0ZV9tYXJnaW5hbF9hcmVhICh3LCBkZXNpcmVkX3JvdywgUklHSFRfTUFSR0lOX0FSRUEsIHZw b3MpOworICAgICAgICB9CisgICAgICAvKiBEcmF3IHRydW5jYXRpb24gbWFya3MgZXRjLiAqLwor ICAgICAgaWYgKCFjdXJyZW50X3Jvdy0+ZW5hYmxlZF9wCisgICAgICAgICAgfHwgZGVzaXJlZF9y b3ctPnkgIT0gY3VycmVudF9yb3ctPnkKKyAgICAgICAgICB8fCBkZXNpcmVkX3Jvdy0+dmlzaWJs ZV9oZWlnaHQgIT0gY3VycmVudF9yb3ctPnZpc2libGVfaGVpZ2h0CisgICAgICAgICAgfHwgZGVz aXJlZF9yb3ctPmN1cnNvcl9pbl9mcmluZ2VfcCAhPSBjdXJyZW50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gb2xk X21hdHJpeC5jdXJzb3JzX3VzZWRbQ0hfQ0FDSEVdID4gMAorICAgICAgICAgICAgICAgICAgIHx8 IG9sZF9tYXRyaXguY3Vyc29yc191c2VkW0ZDX0NBQ0hFXSA+IDApOworICBib29sIGdvX3R3b19w ID0gKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICYmICghTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAg ICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJs ZSkpCisgICAgICAgICAgICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIG1jX2NvbmYpKSkpOworICBib29sIHVwZGF0aW5nX2ZyYW1lX3AgPSBmYWxzZTsK KyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIGlmIChYRlJBTUUgKHct PmZyYW1lKSAhPSBmLT5tY191cGRhdGluZ19mcmFtZQorICAgICAgJiYgKGdvX29uZV9wIHx8IGdv X3R3b19wKSkKKyAgICB7CisgICAgICB1cGRhdGluZ19mcmFtZV9wID0gdHJ1ZTsKKyAgICAgIHVw ZGF0ZV9iZWdpbiAoZik7CisgICAgfQorICBpZiAody0+cGh5c19jdXJzb3Jfb25fcAorICAgICAg JiYgZ29fdHdvX3ApCisgICAgZXJhc2VfcGh5c19jdXJzb3IgKHcpOworCisvKgorICBmb3IgKGlu dCB2bnRoID0gMDsKKyAgICAgICB2bnRoIDwgb2xkX21hdHJpeC52cG9zX3VzZWQ7CisgICAgICAg Kyt2bnRoKQorICAgIGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNI RTsKKyAgICAgICAgIGNhY2hlX3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICAgICsr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RfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBl XSwKKyAgICB2bnRoLCBtY19jYWNoZV90eXBlX3RvX3N0cmluZyAoY2FjaGVfdHlwZSksIG9sZF9t YXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdKTsKKyovCisKKyAgZm9yIChp bnQgdm50aCA9IDA7CisgICAgICAgZ29fb25lX3AKKyAgICAgICAmJiB2bnRoIDwgb2xkX21hdHJp eC52cG9zX3VzZWQ7CisgICAgICAgKyt2bnRoKQorICAgIHsKKyAgICAgIGZvciAoZW51bSBtY19j YWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICAgICAgY2FjaGVfdHlwZSA8 IE5PX0NBQ0hFOworICAgICAgICAgICArK2NhY2hlX3R5cGUpCisgICAgICAgIGZvciAoaW50IHpf bnRoID0gMDsKKyAgICAgICAgICAgICBvbGRfbWF0cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90eXBl XSA+IDAKKyAgICAgICAgICAgICAmJiB6X250aCA8IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZV91c2VkW2NhY2hlX3R5cGVdOworICAgICAgICAgICAgICsrel9udGgpCisgICAgICAgICAgewor ICAgICAgICAgICAgYm9vbCBzYW1lX3AgPSBmYWxzZTsKKyAgICAgICAgICAgIGZvciAoaW50IHdf bnRoID0gMDsgd19udGggPCB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hl X3R5cGVdOyArK3dfbnRoKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc2FtZV9w IHw9IChvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmdseXBo LnR5cGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnR5cGUKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt6 X250aF0uZ2x5cGguYnl0ZXBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGguYnl0ZXBv cworICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3pfbnRoXS5nbHlwaC5jaGFycG9zCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3df bnRoXS5nbHlwaC5jaGFycG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmdseXBoLnUudmFsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC51LnZhbAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3pfbnRoXS5nbHlw aC5mYWNlX2lkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5mYWNlX2lkCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bel9udGhdLmdseXBoLnBhZGRpbmdfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5 cGgucGFkZGluZ19wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmdseXBoLmxlZnRfYm94X2xpbmVfcAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgubGVmdF9ib3hfbGluZV9wCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bel9udGhdLmdseXBoLnJpZ2h0X2JveF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhd LmdseXBoLnJpZ2h0X2JveF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9s ZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt6X250aF0uZ2x5cGgudm9mZnNl dAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgudm9mZnNldAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3pf bnRoXS5nbHlwaC5waXhlbF93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgucGl4 ZWxfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt6X250aF0uZ2x5cGguc2xpY2UuaW1nLngKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bd19udGhdLmdseXBoLnNsaWNlLmltZy54CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmds eXBoLnNsaWNlLmltZy55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5pbWcu eQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3pfbnRoXS5nbHlwaC5zbGljZS5pbWcud2lkdGgKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bd19udGhdLmdseXBoLnNsaWNlLmltZy53aWR0aAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3pfbnRoXS5n bHlwaC5zbGljZS5pbWcuaGVpZ2h0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5zbGlj ZS5pbWcuaGVpZ2h0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmdseXBoLnNsaWNlLmNtcC5mcm9tCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5jbXAuZnJvbQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W3pfbnRoXS54CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS54CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhd LmZ4CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5meAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3pfbnRoXS55Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3dfbnRoXS55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmZ5CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3dfbnRoXS5meQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3pfbnRoXS5ocG9zCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW3dfbnRoXS5ocG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLnZwb3MKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bd19udGhdLnZwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt6X250aF0ud2QKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bd19udGhdLndkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmgKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19u dGhdLmgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVt6X250aF0uY3Vyc29yX3R5cGUKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b d19udGhdLmN1cnNvcl90eXBlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmN1cnNvcl93aWR0aAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVt3X250aF0uY3Vyc29yX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmZv cmVncm91bmQucmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5mb3JlZ3JvdW5kLnJlZAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3pfbnRoXS5mb3JlZ3JvdW5kLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRo XS5mb3JlZ3JvdW5kLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmZvcmVncm91bmQuYmx1ZQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVt3X250aF0uZm9yZWdyb3VuZC5ibHVlCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9u dGhdLmJhY2tncm91bmQucmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5iYWNrZ3JvdW5kLnJl ZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3pfbnRoXS5iYWNrZ3JvdW5kLmdyZWVuCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W3dfbnRoXS5iYWNrZ3JvdW5kLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmJhY2tncm91bmQu Ymx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uYmFja2dyb3VuZC5ibHVlCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bel9udGhdLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5hY3RpdmVfcAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3pfbnRoXS5nbHlwaF9mbGF2b3IKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmds eXBoX2ZsYXZvcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3pfbnRoXS5lbmFibGVkX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bd19udGhdLmVuYWJsZWRfcCk7CisgICAgICAgICAgICAgICAgLyogRm9yY2UgdGhlIGZyaW5n ZSBiaXRtYXBzIHRvIGFsd2F5cyBiZSByZXNldC9yZWRyYXduLiAqLworICAgICAgICAgICAgICAg IGlmIChvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmN1cnNv cl90eXBlCisgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmN1cnNvcl90eXBlCisgICAgICAgICAgICAgICAgICAg ICYmIChvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmN1cnNv cl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAgICAgICAg fHwgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3pfbnRoXS5jdXJzb3Jf dHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQKSkKKyAgICAgICAgICAgICAgICAgIHNhbWVf cCA9IGZhbHNlOworICAgICAgICAgICAgICAgIGlmIChzYW1lX3ApCisgICAgICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgICAgIC8vICBmcHJpbnRmIChzdGRlcnIsICJISVQgKCVzKTog IHZwb3MgKCVkKSB8IGhwb3MgKCVkKSB8IGNoYXIgKCVzKVxuIiwKKyAgICAgICAgICAgICAgICAg ICAgLy8gICAgICAgICAgICAgICAgICAgKGNhY2hlX3R5cGUgPT0gTUNfQ0FDSEUpCisgICAgICAg ICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgPyAiTUMiCisgICAgICAgICAgICAg ICAgICAgIC8vICAgICAgICAgICAgICAgICAgIDogKGNhY2hlX3R5cGUgPT0gQ0hfQ0FDSEUpCisg ICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgPyAiQ0giCisgICAgICAg ICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIDogKGNhY2hlX3R5cGUgPT0gRkNfQ0FD SEUpCisgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgPyAiRkMiCisg ICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIDogIk5PIiwKKyAgICAgICAg ICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLnZwb3MsCisgICAgICAgICAgICAgICAgICAgIC8vICAg ICAgICAgICAgICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W3dfbnRoXS5ocG9zLAorICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICBt Y19jaGFyX3RvX3N0cmluZyAody0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bd19udGhdLmdseXBoLnUuY2gpKTsKKyAgICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLnNhbWVfcCA9IHRydWU7CisgICAg ICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAg Ly8gIGZwcmludGYgKHN0ZGVyciwgIk1JU1MgKCVzKTogIHZwb3MgKCVkKSB8IGhwb3MgKCVkIHYu ICVkKSB8IGNoYXIgKCVzIHYuICVzKSB8IGNhY2hlX3VzZWQgKCVkIHYuICVkKVxuIiwKKyAgICAg ICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAoY2FjaGVfdHlwZSA9PSBNQ19D QUNIRSkKKyAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgID8gIk1D IgorICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIDogKGNhY2hlX3R5 cGUgPT0gQ0hfQ0FDSEUpCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAg ICAgICA/ICJDSCIKKyAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICA6 IChjYWNoZV90eXBlID09IEZDX0NBQ0hFKQorICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAg ICAgICAgICAgICAgICAgPyAiRkMiCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAg ICAgICAgICAgOiAiTk8iLAorICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAg ICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS52cG9z LAorICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt6X250aF0uaHBvcywKKyAgICAgICAgICAgICAg ICAgICAgICAvLyAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVt3X250aF0uaHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAvLyAgICAg ICAgICAgICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAob2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3pfbnRoXS5nbHlwaC51LmNoKSwKKyAgICAgICAgICAgICAgICAgICAg ICAvLyAgICAgICAgICAgICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAody0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnUuY2gpLAorICAgICAgICAg ICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZV91c2VkW2NhY2hlX3R5cGVdLAorICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAg ICAgICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV0p OworICAgICAgICAgICAgICAgICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3dfbnRoXS5zYW1lX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgfQor ICAgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoIXNhbWVfcCkKKyAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgIC8qIGBtYXRyaXhfcm93JyBpbiBgZGlzcG5ldy5jYCBjb250YWlu cyB0aGUgZm9sbG93aW5nIHRlc3RzLAorICAgICAgICAgICAgICAgIGVhc3NlcnQgKG1hdHJpeCAm JiBtYXRyaXgtPnJvd3MpOworICAgICAgICAgICAgICAgIGVhc3NlcnQgKHJvdyA+PSAwICYmIHJv dyA8IG1hdHJpeC0+bnJvd3MpOyAqLworICAgICAgICAgICAgICAgIGJvb2wgYmFyZl9jcmFzaF9v bmUgPSAody0+Y3VycmVudF9tYXRyaXggJiYgdy0+Y3VycmVudF9tYXRyaXgtPnJvd3MpID8gZmFs c2UgOiB0cnVlOworICAgICAgICAgICAgICAgIGlmIChiYXJmX2NyYXNoX29uZSkKKyAgICAgICAg ICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIGJvb2wgYmFyZl9jcmFzaF90d28g PSAodm50aCA+PSAwICYmIHZudGggPCB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3MpID8gZmFsc2Ug OiB0cnVlOworICAgICAgICAgICAgICAgIGlmIChiYXJmX2NyYXNoX3R3bykKKyAgICAgICAgICAg ICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnZudGhf cm93ID0gTUFUUklYX1JPVyAody0+Y3VycmVudF9tYXRyaXgsIHZudGgpOworICAgICAgICAgICAg ICAgIGludCB4XzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9u dGhdLng7CisgICAgICAgICAgICAgICAgaW50IGZ4XzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmZ4OworICAgICAgICAgICAgICAgIGludCB5XzAgPSBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLnk7CisgICAgICAg ICAgICAgICAgaW50IGZ5XzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bel9udGhdLmZ5OworICAgICAgICAgICAgICAgIGludCBocG9zXzAgPSBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmhwb3M7CisgICAgICAgICAgICAgICAg aW50IHZwb3NfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt6X250 aF0udnBvczsKKyAgICAgICAgICAgICAgICBpbnQgd2RfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVt6X250aF0ud2Q7CisgICAgICAgICAgICAgICAgaW50IGhfMCA9 IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt6X250aF0uaDsKKyAgICAg ICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlXzAgPSBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmN1cnNvcl90eXBlOworICAgICAg ICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGhfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVt6X250aF0uY3Vyc29yX3dpZHRoOworICAgICAgICAgICAgICAgIHN0cnVj dCBtY19SR0IgbHNsX2ZnXzAgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVt6X250aF0uZm9yZWdyb3VuZC5yZWQsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bel9udGhdLmZvcmVncm91bmQuZ3JlZW4sCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVt6X250aF0uZm9yZWdyb3VuZC5ibHVlfTsKKyAgICAgICAgICAgICAgICBz dHJ1Y3QgbWNfUkdCIGxzbF9iZ18wID0gey5yZWQgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bel9udGhdLmJhY2tncm91bmQucmVkLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3pfbnRoXS5iYWNrZ3JvdW5kLmdyZWVuLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmJhY2tncm91bmQuYmx1ZX07CisgICAgICAgICAgICAg ICAgYm9vbCBhY3RpdmVfcF8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3pfbnRoXS5hY3RpdmVfcDsKKyAgICAgICAgICAgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlw aF9mbGF2b3JfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt6X250 aF0uZ2x5cGhfZmxhdm9yOworICAgICAgICAgICAgICAgIGJvb2wgZW5hYmxlZF9wXzAgPSBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmVuYWJsZWRfcDsKKyAg ICAgICAgICAgICAgICBpZiAodnBvc18wID09IHZudGgKKyAgICAgICAgICAgICAgICAgICAgJiYg Z2x5cGhfZmxhdm9yXzAgPT0gTUNfR0xZUEgKKyAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxl ZF9wXzAKKyAgICAgICAgICAgICAgICAgICAgJiYgdm50aF9yb3ctPmVuYWJsZWRfcCkKKyAgICAg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbWNfZXJhc2VfY3Vyc29yICh3LCB3 LT5jdXJyZW50X21hdHJpeCwgdm50aF9yb3csIHhfMCwgeV8wLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGhwb3NfMCwgdnBvc18wLCBnbHlwaF9mbGF2b3JfMCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZV8wLCB3ZF8wKTsKKyAg ICAgICAgICAgICAgICAgICAgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W3pfbnRoXS5lbmFibGVkX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgLS1vbGRfbWF0 cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90eXBlXTsKKyAgICAgICAgICAgICAgICAgICAgLyogSWYg d2UgaW5hZHZlcnRlbnRseSBlcmFzZWQgYW5vdGhlciBmYWtlIGN1cnNvciBhdCB0aGUgc2FtZQor ICAgICAgICAgICAgICAgICAgICBIUE9TIHRoYXQgaXMgc3RpbGwgZW5hYmxlZF9wIGluIHRoZSBg b2xkX21hdHJpeGAsIHRoZW4gcmVkcmF3IGl0LiAqLworICAgICAgICAgICAgICAgICAgICBmb3Ig KGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7CisgICAgICAgICAgICAg ICAgICAgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICAgICAgICAgICAgICAg ICAgICsrY2FjaGVfdHlwZSkKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAg ICAgICAgICAgICBmb3IgKGludCBudGhfMSA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIG9sZF9tYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5cGVdID4gMAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBudGhfMSA8IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91 c2VkW2NhY2hlX3R5cGVdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICArK250aF8xKQor ICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg aW50IHhfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0u eDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZnhfMSA9IG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZng7CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgaW50IHlfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMV0ueTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZnlfMSA9IG9sZF9t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZnk7CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgaW50IGhwb3NfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMV0uaHBvczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBp bnQgdnBvc18xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8x XS52cG9zOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB3ZF8xID0gb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS53ZDsKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICBpbnQgaF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8xXS5oOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vy c29yX3R5cGUgY3Vyc29yX3R5cGVfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMV0uY3Vyc29yX3R5cGU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg aW50IGN1cnNvcl93aWR0aF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8xXS5jdXJzb3Jfd2lkdGg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3Ry dWN0IG1jX1JHQiBsc2xfZmdfMSA9IHsucmVkID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF8xXS5mb3JlZ3JvdW5kLnJlZCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZm9yZWdyb3VuZC5ncmVlbiwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0g b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5mb3JlZ3JvdW5k LmJsdWV9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2Jn XzEgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhf MV0uYmFja2dyb3VuZC5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAuZ3JlZW4gPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzFdLmJhY2tncm91bmQuZ3JlZW4sCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uYmFja2dyb3VuZC5ibHVlfTsKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICBib29sIGFjdGl2ZV9wXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmFjdGl2ZV9wOworICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvcl8xID0gb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5nbHlwaF9mbGF2b3I7CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgYm9vbCBlbmFibGVkX3BfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZW5hYmxlZF9wOworICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGJvb2wgZ29fcF8xID0gKGhwb3NfMCA9PSBocG9zXzEKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3BfMSk7CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgaWYgKCFnb19wXzEpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIHJlbW92ZV9w XzEgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtY19kcmF3X2VyYXNlX2h5 YnJpZCAodywgdy0+Y3VycmVudF9tYXRyaXgsIHZudGhfcm93LCB4XzEsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ4XzEsIHlfMSwgZnlfMSwgaHBv c18xLCB2cG9zXzEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHdkXzEsIGhfMSwgY3Vyc29yX3R5cGVfMSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoXzEsIGxzbF9mZ18xLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVfcF8x LCBnbHlwaF9mbGF2b3JfMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgcmVtb3ZlX3BfMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAg ICAgICBlbHNlIGlmICh2cG9zXzAgPT0gdm50aAorICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgZW5hYmxlZF9wXzAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHZudGhfcm93LT5l bmFibGVkX3ApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBi b29sIHJlbW92ZV9wXzAgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgIG1jX2RyYXdfZXJh c2VfaHlicmlkICh3LCB3LT5jdXJyZW50X21hdHJpeCwgdm50aF9yb3csIHhfMCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnhfMCwgeV8wLCBmeV8wLCBocG9z XzAsIHZwb3NfMCwgd2RfMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgaF8wLCBjdXJzb3JfdHlwZV8wLCBjdXJzb3Jfd2lkdGhfMCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNsX2JnXzAsIGFjdGl2ZV9wXzAsIGdseXBo X2ZsYXZvcl8wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBy ZW1vdmVfcF8wKTsKKyAgICAgICAgICAgICAgICAgICAgICBvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmVuYWJsZWRfcCA9IGZhbHNlOworICAgICAgICAgICAg ICAgICAgICAgIC0tb2xkX21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVfdHlwZV07CisgICAgICAg ICAgICAgICAgICAgICAgLyogSWYgd2UgaW5hZHZlcnRlbnRseSBlcmFzZWQgYW5vdGhlciBmYWtl IGN1cnNvciBhdCB0aGUgc2FtZQorICAgICAgICAgICAgICAgICAgICAgIEhQT1MgdGhhdCBpcyBz dGlsbCBlbmFibGVkX3AgaW4gdGhlIGBvbGRfbWF0cml4YCwgdGhlbiByZWRyYXcgaXQuICovCisg ICAgICAgICAgICAgICAgICAgICAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9 IE1DX0NBQ0hFOworICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NB Q0hFOworICAgICAgICAgICAgICAgICAgICAgICAgICAgKytjYWNoZV90eXBlKQorICAgICAgICAg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBudGhf MiA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2xkX21hdHJpeC5jdXJzb3Jz X3VzZWRbY2FjaGVfdHlwZV0gPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg bnRoXzIgPCBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXTsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICArK250aF8yKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB4XzIgPSBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLng7CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBpbnQgZnhfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMl0uZng7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBp bnQgeV8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS55 OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZ5XzIgPSBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmZ5OworICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgaW50IGhwb3NfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMl0uaHBvczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB2 cG9zXzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLnZw b3M7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgd2RfMiA9IG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0ud2Q7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBpbnQgaF8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8yXS5oOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19j dXJzb3JfdHlwZSBjdXJzb3JfdHlwZV8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8yXS5jdXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGludCBjdXJzb3Jfd2lkdGhfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMl0uY3Vyc29yX3dpZHRoOworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgc3RydWN0IG1jX1JHQiBsc2xfZmdfMiA9IHsucmVkID0gb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5mb3JlZ3JvdW5kLnJlZCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5mb3JlZ3JvdW5kLmdyZWVu LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAuYmx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0u Zm9yZWdyb3VuZC5ibHVlfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBt Y19SR0IgbHNsX2JnXzIgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMl0uYmFja2dyb3VuZC5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IG9sZF9tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uYmFja2dyb3VuZC5ncmVlbiwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmJhY2tncm91bmQu Ymx1ZX07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGFjdGl2ZV9wXzIgPSBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmFjdGl2ZV9wOwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9y XzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmdseXBo X2ZsYXZvcjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgZW5hYmxlZF9wXzIg PSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmVuYWJsZWRf cDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgZ29fcF8yID0gKGhwb3NfMCA9 PSBocG9zXzIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IGZ4XzAgPD0gZnhfMgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgZnhfMCArIHdkXzAgPiBmeF8yICsgd2RfMgorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wXzIpOworICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgaWYgKCFnb19wXzIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGNvbnRpbnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCByZW1vdmVfcF8y ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtY19kcmF3X2VyYXNlX2h5 YnJpZCAodywgdy0+Y3VycmVudF9tYXRyaXgsIHZudGhfcm93LCB4XzIsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnhfMiwgeV8yLCBmeV8yLCBo cG9zXzIsIHZwb3NfMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICB3ZF8yLCBoXzIsIGN1cnNvcl90eXBlXzIsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoXzIsIGxzbF9mZ18y LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFj dGl2ZV9wXzIsIGdseXBoX2ZsYXZvcl8yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZV9wXzIpOworICAgICAgICAgICAgICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgfQorCisgIGlmICh1cGRhdGlu Z19mcmFtZV9wKQorICAgIHVwZGF0ZV9lbmQgKGYpOworfQorCit2b2lkCittY191cGRhdGVfd2lu ZG93X2RyeXJ1biAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wLCBzdHJ1Y3QgbWNfZXNz ZW50aWFscyAqZXNzZW50aWFscykKK3sKKyAgaWYgKCFCVUZGRVJQICh3LT5jb250ZW50cykpCisg ICAgcmV0dXJuOworCisgIGlmICh3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW01DX0NBQ0hFXSA9 PSAwCisgICAgICAmJiB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0NIX0NBQ0hFXSA9PSAwCisg ICAgICAmJiB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0ZDX0NBQ0hFXSA9PSAwCisgICAgICAm JiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAgJiYg TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICYm IE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpKQorICAgIHJl dHVybjsKKworICAvLyBjbG9ja190IGNsb2NrX3N0YXJ0ID0gY2xvY2soKTsKKworICBib29sIGRy YXdfcCA9IGZhbHNlOworCisgIHN0cnVjdCBnbHlwaF9tYXRyaXggKnNhdmVkX2Rlc2lyZWQgPSBt Y19zYXZlX2dseXBoX21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NzYXJ5LiAqLworICAgICAgc3RydWN0IGdseXBoX3JvdyAqbW9kZV9saW5lX3JvdyA9IE1BVFJJ WF9NT0RFX0xJTkVfUk9XIChkZXNpcmVkX21hdHJpeCk7CisgICAgICBpZiAobW9kZV9saW5lX3Jv dy0+bW9kZV9saW5lX3AgJiYgbW9kZV9saW5lX3Jvdy0+ZW5hYmxlZF9wKQorICAgICAgICB7Cisg ICAgICAgICAgbW9kZV9saW5lX3Jvdy0+eSA9IHliICsgV0lORE9XX1NDUk9MTF9CQVJfQVJFQV9I RUlHSFQgKHcpOworICAgICAgICAgIHVwZGF0ZV93aW5kb3dfbGluZSAodywgTUFUUklYX1JPV19W UE9TIChtb2RlX2xpbmVfcm93LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBkZXNpcmVkX21hdHJpeCksCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wKTsKKyAgICAgICAgfQorCisgICAgICAvKiBG aW5kIGZpcnN0IGVuYWJsZWQgcm93LiAgT3B0aW1pemF0aW9ucyBpbiByZWRpc3BsYXlfaW50ZXJu YWwKKyAgICAgICAgIG1heSBsZWFkIHRvIGFuIHVwZGF0ZSB3aXRoIG9ubHkgb25lIHJvdyBlbmFi bGVkLiAgVGhlcmUgbWF5CisgICAgICAgICBiZSBhbHNvIGNvbXBsZXRlbHkgZW1wdHkgbWF0cmlj ZXMuICovCisgICAgICB3aGlsZSAocm93IDwgZW5kICYmICFyb3ctPmVuYWJsZWRfcCkKKyAgICAg ICAgKytyb3c7CisKKyAgICAgIC8qIFRyeSByZXVzaW5nIHBhcnQgb2YgdGhlIGRpc3BsYXkgYnkg Y29weWluZy4gKi8KKyAgICAgIGlmIChyb3cgPCBlbmQgJiYgIXctPmRlc2lyZWRfbWF0cml4LT5u b19zY3JvbGxpbmdfcCkKKyAgICAgICAgeworICAgICAgICAgIGludCByYyA9IG1jX3Njcm9sbGlu Z193aW5kb3cgKHcsIGhlYWRlcl9saW5lX3JvdyAhPSBOVUxMKTsKKyAgICAgICAgICBpZiAocmMg PCAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBBbGwgcm93cyB3ZXJlIGZvdW5k IHRvIGJlIGVxdWFsLiAqLworICAgICAgICAgICAgICBwYXVzZWRfcCA9IDA7CisgICAgICAgICAg ICAgIGdvdG8gc2V0X2N1cnNvcjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYg KHJjID4gMCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIFdlJ3ZlIHNjcm9s bGVkIHRoZSBkaXNwbGF5LiAqLworICAgICAgICAgICAgICAgIGZvcmNlX3AgPSAxOworICAgICAg ICAgICAgICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAg ICAgLyogUHJvY2VzcyB0aGUgY3Vyc29yIHJvdyBhdCB0aGUgb3V0c2V0IGlmIGl0IGlzIHdpdGhp biBgZGVzaXJlZF9tYXRyaXhgLgorICAgICAgV2hlbiBwcm9jZXNzaW5nIGFsbCBvdGhlciByb3dz LCB3ZSB3aWxsIHF1ZXJ5IHRoZSBgdy0+Y3VycmVudF9tYXRyaXhgIGZvciBkYXRhCisgICAgICBy ZWxhdGluZyB0byB0aGUgY3Vyc29yIHJvdy4gIGBtYWtlX2N1cnJlbnRgICh3aXRoaW4gYHVwZGF0 ZV93aW5kb3dfbGluZScpCisgICAgICB1cGRhdGVzIHRoZSBgdy0+Y3VycmVudF9tYXRyaXhgIGZv ciB0aGUgYXBwbGljYWJsZSByb3cuICBJbiBkb2luZyBzbywgaG93ZXZlciwKKyAgICAgIHRoZSBh cHBsaWNhYmxlIHJvdyBpbiB0aGUgZGVzaXJlZCBtYXRyaXggaXMgYWx0ZXJlZCBzdWNoIHRoYXQg d2UgY2FuIG5vIGxvbmdlcgorICAgICAgcmVseSB1cG9uIHRoZSBhY2N1cmFjeSBvZiBgUk9XLT51 c2VkW1RFWFRfQVJFQV1gLiAgVGhlcmVmb3JlLCB3ZSBtdXN0IG5vdyByZWx5CisgICAgICBleGNs dXNpdmVseSB1cG9uIGB3LT5jdXJyZW50X21hdHJpeCcgZm9yIGN1cnNvciByb3cgYmFzZWQgZGVj aXNpb25zLiAqLworICAgICAgZm9yIChzdHJ1Y3QgZ2x5cGhfcm93ICptY19yb3cgPSByb3c7Cisg ICAgICAgICAgIG1jX3JvdyA8IGVuZCAmJiAoZm9yY2VfcCB8fCAhaW5wdXRfcGVuZGluZyk7Cisg ICAgICAgICAgICsrbWNfcm93KQorICAgICAgICB7CisgICAgICAgICAgaW50IHZwb3MgPSBNQVRS SVhfUk9XX1ZQT1MgKG1jX3Jvdywgdy0+ZGVzaXJlZF9tYXRyaXgpOworICAgICAgICAgIGlmICht Y19yb3ctPmVuYWJsZWRfcAorICAgICAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9z KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4ID0gdy0+ZGVzaXJl ZF9tYXRyaXg7CisgICAgICAgICAgICAgIGlmICghZm9yY2VfcCAmJiArK25fdXBkYXRlZCAlIHBy ZWVtcHRfY291bnQgPT0gMCkKKyAgICAgICAgICAgICAgICBkZXRlY3RfaW5wdXRfcGVuZGluZ19p Z25vcmVfc3F1ZWV6YWJsZXMgKCk7CisgICAgICAgICAgICAgIGNoYW5nZWRfcCB8PSBtY191cGRh dGVfd2luZG93X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3cml0dGVuX3AsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRy aXgsICplc3NlbnRpYWxzLCBkcmF3X3ApOworICAgICAgICAgICAgICBpZiAoTUFUUklYX1JPV19C T1RUT01fWSAocm93KSA+PSB5YikKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gdnBvcyAr IDE7IGkgPCB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAgICAgICAgICAg ICAgICBTRVRfTUFUUklYX1JPV19FTkFCTEVEX1AgKHctPmN1cnJlbnRfbWF0cml4LCBpLCBmYWxz ZSk7CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAg ICBjdXJzb3JfbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgICAgICAvKiBVcGRhdGUgdGhl IHJlc3Qgb2YgdGhlIGxpbmVzLiAqLworICAgICAgZm9yICg7IHJvdyA8IGVuZCAmJiAoZm9yY2Vf cCB8fCAhaW5wdXRfcGVuZGluZyk7ICsrcm93KQorICAgICAgICAvKiBzY3JvbGxpbmdfd2luZG93 IHJlc2V0cyB0aGUgZW5hYmxlZF9wIGZsYWcgb2YgdGhlIHJvd3MgaXQgcmV1c2VzIGZyb20KKyAg ICAgICAgY3VycmVudF9tYXRyaXguICovCisgICAgICAgIGlmIChyb3ctPmVuYWJsZWRfcCkKKyAg ICAgICAgICB7CisgICAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCB3 LT5kZXNpcmVkX21hdHJpeCk7CisgICAgICAgICAgICAvKiBJZiB0aGUgYGN1cnNvcl9yb3dgIGlz IHdpdGhpbiB0aGUgYGRlc2lyZWRfbWF0cml4YCwgdGhlbiBpdCB3YXMKKyAgICAgICAgICAgIHBy b2Nlc3NlZCBoZXJlaW5hYm92ZSBhbmQgc2hvdWxkIGJlIHNraXBwZWQgYXQgdGhpcyB0aW1lLiAq LworICAgICAgICAgICAgaWYgKHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICBj b250aW51ZTsKKyAgICAgICAgICAgIGludCBpOworICAgICAgICAgICAgLyogV2UnbGwgaGF2ZSB0 byBwbGF5IGEgbGl0dGxlIGJpdCB3aXRoIHdoZW4gdG8KKyAgICAgICAgICAgICAgIGRldGVjdF9p bnB1dF9wZW5kaW5nLiAgSWYgaXQncyBkb25lIHRvbyBvZnRlbiwKKyAgICAgICAgICAgICAgIHNj cm9sbGluZyBsYXJnZSB3aW5kb3dzIHdpdGggcmVwZWF0ZWQgc2Nyb2xsLXVwCisgICAgICAgICAg ICAgICBjb21tYW5kcyB3aWxsIHRvbyBxdWlja2x5IHBhdXNlIHJlZGlzcGxheS4gKi8KKyAgICAg ICAgICAgIGlmICghZm9yY2VfcCAmJiArK25fdXBkYXRlZCAlIHByZWVtcHRfY291bnQgPT0gMCkK KyAgICAgICAgICAgICAgZGV0ZWN0X2lucHV0X3BlbmRpbmdfaWdub3JlX3NxdWVlemFibGVzICgp OworICAgICAgICAgICAgY2hhbmdlZF9wIHw9IG1jX3VwZGF0ZV93aW5kb3dfbGluZSAodywgdnBv cywgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsICplc3NlbnRpYWxzLCBkcmF3X3Ap OworICAgICAgICAgICAgLyogTWFyayBhbGwgcm93cyBiZWxvdyB0aGUgbGFzdCB2aXNpYmxlIG9u ZSBpbiB0aGUgY3VycmVudAorICAgICAgICAgICAgICAgbWF0cml4IGFzIGludmFsaWQuICBUaGlz IGlzIG5lY2Vzc2FyeSBiZWNhdXNlIG9mCisgICAgICAgICAgICAgICB2YXJpYWJsZSBsaW5lIGhl aWdodHMuICBDb25zaWRlciB0aGUgY2FzZSBvZiB0aHJlZQorICAgICAgICAgICAgICAgc3VjY2Vz c2l2ZSByZWRpc3BsYXlzLCB3aGVyZSB0aGUgZmlyc3QgZGlzcGxheXMgNQorICAgICAgICAgICAg ICAgbGluZXMsIHRoZSBzZWNvbmQgMyBsaW5lcywgYW5kIHRoZSB0aGlyZCA1IGxpbmVzIGFnYWlu LgorICAgICAgICAgICAgICAgSW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sbGluZ193 aW5kb3cnIGFib3ZlLAorICAgICAgYHJvd2Agd2FzIGFkdmFuY2VkIHRvIHRoZSBmaXJzdCBgcm93 LT5lbmFibGVkX3BgLiAqLworICAgICAgZm9yIChzdHJ1Y3QgZ2x5cGhfcm93ICpkZXNpcmVkX3Jv dyA9IE1BVFJJWF9ST1cgKHctPmRlc2lyZWRfbWF0cml4LCAwKTsKKyAgICAgICAgICAgZGVzaXJl ZF9yb3cgPCBlbmQKKyAgICAgICAgICAgJiYgKGZvcmNlX3AgfHwgIWlucHV0X3BlbmRpbmcpCisg ICAgICAgICAgIC8qIFczMiBFbWFjcyBjcmFzaGVzIG9uIHN0YXJ0dXAgd2l0aG91dCBhIEJVRkZF UlAgY2hlY2suICovCisgICAgICAgICAgICYmIEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAg ICAgICAmJiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisg ICAgICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9z c2hhaXJzKSkKKyAgICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIGZjX3Zpc2libGUpKSk7CisgICAgICAgICAgICsrZGVzaXJlZF9yb3cpCisgICAgICAg IHsKKyAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAoZGVzaXJlZF9yb3csIHct PmRlc2lyZWRfbWF0cml4KTsKKyAgICAgICAgICBpZiAoZGVzaXJlZF9yb3ctPmVuYWJsZWRfcCkK KyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKmJvdHRv bV9yb3cgPSBNQVRSSVhfQk9UVE9NX1RFWFRfUk9XICh3LT5jdXJyZW50X21hdHJpeCwgdyk7Cisg ICAgICAgICAgaW50IGJvdHRvbV92cG9zID0gTUFUUklYX1JPV19WUE9TIChib3R0b21fcm93LCB3 LT5jdXJyZW50X21hdHJpeCk7CisgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqY3VycmVudF9y b3cgPSBNQVRSSVhfUk9XICh3LT5jdXJyZW50X21hdHJpeCwgdnBvcyk7CisgICAgICAgICAgaWYg KGN1cnJlbnRfcm93LT5lbmFibGVkX3ApCisgICAgICAgICAgICBtY19kcmF3X3JvdyAodywgdy0+ Y3VycmVudF9tYXRyaXgsIGN1cnJlbnRfcm93LCBjdXJyZW50X3Jvdy0+Z2x5cGhzW1RFWFRfQVJF QV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudF9yb3ctPngsIGN1cnJlbnRfcm93 LT51c2VkW1RFWFRfQVJFQV0sIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgYm90dG9t X3Zwb3MsIGN1cnNvcl9tYXRyaXgsICplc3NlbnRpYWxzLCBkcmF3X3AsIFNFVF9DVVJTT1JfT05F KTsKKyAgICAgICAgfQorCisgICAgICBtY19yZXN0b3JlX2dseXBoX21hdHJpeCAoc2F2ZWRfZGVz aXJlZCwgdy0+ZGVzaXJlZF9tYXRyaXgpOworICAgICAgbWNfcmVzdG9yZV9nbHlwaF9tYXRyaXgg KHNhdmVkX2N1cnJlbnQsIHctPmN1cnJlbnRfbWF0cml4KTsKKworICAgICAgbWNfdXBkYXRlX3dp bmRvd19lcmFzZSAodywgb2xkX21hdHJpeCk7CisKKyAgICAgIG1jX3hmcmVlX2NhY2hlX21hdHJp eCAob2xkX21hdHJpeCk7CisKKyAgICB9CisgIC8vIGNsb2NrX3QgY2xvY2tfZW5kID0gY2xvY2so KTsKKyAgLy8gZG91YmxlIGNwdV90aW1lX3VzZWQgPSAoKGRvdWJsZSkgKGNsb2NrX2VuZCAtIGNs b2NrX3N0YXJ0KSkgLyBDTE9DS1NfUEVSX1NFQzsKKyAgLy8gZnByaW50ZiAoc3RkZXJyLCAibWNf c2Nyb2xsaW5nX3dpbmRvdyAoJXMpOiAgVElNRSAoJWYpXG4iLCBtY193aW5kb3cgKHcpLCBjcHVf dGltZV91c2VkKTsKK30KKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKIC8qIFN0cnVjdHVyZSB0byBwYXNzIGRpbWVuc2lvbnMgYXJvdW5k LiAgVXNlZCBmb3IgY2hhcmFjdGVyIGJvdW5kaW5nCiAgICBib3hlcywgZ2x5cGggbWF0cml4IGRp bWVuc2lvbnMgYW5kIGFsaWtlLiAgKi8KIApAQCAtMzM4Nyw2ICs1MTgzLDI2IEBAIGNoZWNrX2N1 cnJlbnRfbWF0cml4X2ZsYWdzIChzdHJ1Y3Qgd2luZG93ICp3KQogc3RhdGljIGJvb2wKIHVwZGF0 ZV93aW5kb3cgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkKIHsKKworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBpZiAodHJhY2Vf cmVkaXNwbGF5X3ApCisgICAgZnByaW50ZiAoc3RkZXJyLCAidXBkYXRlX3dpbmRvdyAoJXMpXG4i LCBtY193aW5kb3cgKHcpKTsKKworICBib29sIGRyYXdfcCA9IHRydWU7CisKKyAgc3RydWN0IG1j X2Vzc2VudGlhbHMgZXNzZW50aWFsczsKKyAgbWNfdXBkYXRlX3dpbmRvd19kcnlydW4gKHcsIGZv cmNlX3AsICZlc3NlbnRpYWxzKTsKKworICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICpjdXJzb3JfbWF0 cml4ID0gTlVMTDsKKworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAo dykpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIHN0cnVjdCBnbHlwaF9tYXRy aXggKmRlc2lyZWRfbWF0cml4ID0gdy0+ZGVzaXJlZF9tYXRyaXg7CiAgIGJvb2wgcGF1c2VkX3A7 CiAgIGludCBwcmVlbXB0X2NvdW50ID0gY2xpcF90b19ib3VuZHMgKDEsIGJhdWRfcmF0ZSAvIDI0 MDAgKyAxLCBJTlRfTUFYKTsKQEAgLTM0NjAsNiArNTI3Niw0NyBAQCB1cGRhdGVfd2luZG93IChz dHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3ApCiAJICAgIH0KIAl9CiAKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogUHJvY2VzcyB0 aGUgY3Vyc29yIHJvdyBhdCB0aGUgb3V0c2V0IGlmIGl0IGlzIHdpdGhpbiBgZGVzaXJlZF9tYXRy aXhgLgorICBXaGVuIHByb2Nlc3NpbmcgYWxsIG90aGVyIHJvd3MsIHdlIHdpbGwgcXVlcnkgdGhl IGB3LT5jdXJyZW50X21hdHJpeGAgZm9yIGRhdGEKKyAgcmVsYXRpbmcgdG8gdGhlIGN1cnNvciBy b3cuICBgbWFrZV9jdXJyZW50YCAod2l0aGluIGB1cGRhdGVfd2luZG93X2xpbmUnKQorICB1cGRh dGVzIHRoZSBgdy0+Y3VycmVudF9tYXRyaXhgIGZvciB0aGUgYXBwbGljYWJsZSByb3cuICBJbiBk b2luZyBzbywgaG93ZXZlciwKKyAgdGhlIGFwcGxpY2FibGUgcm93IGluIHRoZSBkZXNpcmVkIG1h dHJpeCBpcyBhbHRlcmVkIHN1Y2ggdGhhdCB3ZSBjYW4gbm8gbG9uZ2VyCisgIHJlbHkgdXBvbiB0 aGUgYWNjdXJhY3kgb2YgYFJPVy0+dXNlZFtURVhUX0FSRUFdYC4gIFRoZXJlZm9yZSwgd2UgbXVz dCBub3cgcmVseQorICBleGNsdXNpdmVseSB1cG9uIGB3LT5jdXJyZW50X21hdHJpeCcgZm9yIGN1 cnNvciByb3cgYmFzZWQgZGVjaXNpb25zLiAqLworICBmb3IgKHN0cnVjdCBnbHlwaF9yb3cgKm1j X3JvdyA9IHJvdzsKKyAgICAgICBtY19yb3cgPCBlbmQgJiYgKGZvcmNlX3AgfHwgIWlucHV0X3Bl bmRpbmcpOworICAgICAgICsrbWNfcm93KQorICAgIHsKKyAgICAgIGludCB2cG9zID0gTUFUUklY X1JPV19WUE9TIChtY19yb3csIGRlc2lyZWRfbWF0cml4KTsKKyAgICAgIGlmIChtY19yb3ctPmVu YWJsZWRfcAorICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgIHsK KyAgICAgICAgICBjdXJzb3JfbWF0cml4ID0gZGVzaXJlZF9tYXRyaXg7CisgICAgICAgICAgaWYg KCFmb3JjZV9wICYmICsrbl91cGRhdGVkICUgcHJlZW1wdF9jb3VudCA9PSAwKQorICAgICAgICAg ICAgZGV0ZWN0X2lucHV0X3BlbmRpbmdfaWdub3JlX3NxdWVlemFibGVzICgpOworICAgICAgICAg IGNoYW5nZWRfcCB8PSAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAg ICAgICAmJiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgISBO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKSkpCisgICAgICAg ICAgICAgICAgICAgICAgID8gbWNfdXBkYXRlX3dpbmRvd19saW5lICh3LCB2cG9zLCAmbW91c2Vf ZmFjZV9vdmVyd3JpdHRlbl9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgZHJhd19wKQorICAgICAgICAg ICAgICAgICAgICAgICA6IHVwZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywgJm1vdXNlX2ZhY2Vf b3ZlcndyaXR0ZW5fcCk7CisgICAgICAgICAgaWYgKE1BVFJJWF9ST1dfQk9UVE9NX1kgKHJvdykg Pj0geWIpCisgICAgICAgICAgICBmb3IgKGludCBpID0gdnBvcyArIDE7IGkgPCB3LT5jdXJyZW50 X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAgICAgICAgICAgIFNFVF9NQVRSSVhfUk9XX0VO QUJMRURfUCAody0+Y3VycmVudF9tYXRyaXgsIGksIGZhbHNlKTsKKyAgICAgICAgICBicmVhazsK KyAgICAgICAgfQorICAgIH0KKworICBjdXJzb3JfbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7 CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIC8qIFVwZGF0ZSB0aGUgcmVz dCBvZiB0aGUgbGluZXMuICAqLwogICAgICAgZm9yICg7IHJvdyA8IGVuZCAmJiAoZm9yY2VfcCB8 fCAhaW5wdXRfcGVuZGluZyk7ICsrcm93KQogCS8qIHNjcm9sbGluZ193aW5kb3cgcmVzZXRzIHRo ZSBlbmFibGVkX3AgZmxhZyBvZiB0aGUgcm93cyBpdApAQCAtMzQ2Nyw2ICs1MzI0LDE5IEBAIHVw ZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkKIAlpZiAocm93LT5l bmFibGVkX3ApCiAJICB7CiAJICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIGRl c2lyZWRfbWF0cml4KTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExF LUNVUlNPUlMgKi8KKworICAgICAgICAgIC8qIElmIHRoZSBgY3Vyc29yX3Jvd2AgaXMgd2l0aGlu IHRoZSBgZGVzaXJlZF9tYXRyaXhgLCB0aGVuIGl0IHdhcworICAgICAgICAgIHByb2Nlc3NlZCBo ZXJlaW5hYm92ZSBhbmQgc2hvdWxkIGJlIHNraXBwZWQgYXQgdGhpcyB0aW1lLiAqLworICAgICAg ICAgIGlmICh2cG9zID09IHctPmN1cnNvci52cG9zKQorICAgICAgICAgIGNvbnRpbnVlOworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAgIGludCBpOwogCiAJICAgIC8qIFdlJ2xs IGhhdmUgdG8gcGxheSBhIGxpdHRsZSBiaXQgd2l0aCB3aGVuIHRvCkBAIC0zNDc1LDggKzUzNDUs MjEgQEAgdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wKQogCSAg ICAgICBjb21tYW5kcyB3aWxsIHRvbyBxdWlja2x5IHBhdXNlIHJlZGlzcGxheS4gICovCiAJICAg IGlmICghZm9yY2VfcCAmJiArK25fdXBkYXRlZCAlIHByZWVtcHRfY291bnQgPT0gMCkKIAkgICAg ICBkZXRlY3RfaW5wdXRfcGVuZGluZ19pZ25vcmVfc3F1ZWV6YWJsZXMgKCk7Ci0JICAgIGNoYW5n ZWRfcCB8PSB1cGRhdGVfd2luZG93X2xpbmUgKHcsIHZwb3MsCi0JCQkJCSAgICAgJm1vdXNlX2Zh Y2Vfb3ZlcndyaXR0ZW5fcCk7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKyAgICAgICAgICBjaGFuZ2VkX3AgfD0gKEJVRkZFUlAgKHctPmNv bnRlbnRzKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8 ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHx8ICEgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBmY192aXNpYmxlKSkpKQorICAgICAgICAgICAgICAgICAgICAgICA/IG1jX3VwZGF0ZV93 aW5kb3dfbGluZSAodywgdnBvcywgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVz c2VudGlhbHMsIGRyYXdfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgOiB1cGRhdGVfd2luZG93 X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3cml0dGVuX3ApOworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKwogCiAJICAgIC8qIE1hcmsgYWxsIHJvd3MgYmVsb3cgdGhlIGxhc3Qg dmlzaWJsZSBvbmUgaW4gdGhlIGN1cnJlbnQKIAkgICAgICAgbWF0cml4IGFzIGludmFsaWQuICBU aGlzIGlzIG5lY2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mJiAoIU5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAgIHx8ICFOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICB8fCAh TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpOworICAgICAg ICsrZGVzaXJlZF9yb3cpCisgICAgeworICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1Mg KGRlc2lyZWRfcm93LCBkZXNpcmVkX21hdHJpeCk7CisgICAgICBpZiAoZGVzaXJlZF9yb3ctPmVu YWJsZWRfcCkKKyAgICAgICAgY29udGludWU7CisgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpib3R0 b21fcm93ID0gTUFUUklYX0JPVFRPTV9URVhUX1JPVyAody0+Y3VycmVudF9tYXRyaXgsIHcpOwor ICAgICAgaW50IGJvdHRvbV92cG9zID0gTUFUUklYX1JPV19WUE9TIChib3R0b21fcm93LCB3LT5j dXJyZW50X21hdHJpeCk7CisgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpjdXJyZW50X3JvdyA9IE1B VFJJWF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB2cG9zKTsKKyAgICAgIGlmIChjdXJyZW50X3Jv dy0+ZW5hYmxlZF9wKQorICAgICAgICBtY19kcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgs IGN1cnJlbnRfcm93LCBjdXJyZW50X3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAg ICAgICAgICAgICBjdXJyZW50X3Jvdy0+eCwgY3VycmVudF9yb3ctPnVzZWRbVEVYVF9BUkVBXSwg dnBvcywKKyAgICAgICAgICAgICAgICAgICAgIGJvdHRvbV92cG9zLCBjdXJzb3JfbWF0cml4LCBl c3NlbnRpYWxzLCBkcmF3X3AsIFNFVF9DVVJT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29uJ3QgZHJhdyBsaW5lcyB0aGF0IGhhdmUgYWxyZWFkeSBiZWVuIGRyYXduIGluIHVwZGF0ZV93 aW5kb3cKK2xpbmUgYmVjYXVzZSBvdmVybGFwcGVkX3AgaW4gZGVzaXJlZCByb3dzIGlzIDAsIHNv IGFmdGVyIHJvdyBhc3NpZ25tZW50CitvdmVybGFwcGVkX3AgaW4gY3VycmVudCByb3dzIGlzIDAu ICovCisgIGZvciAoaW50IGkgPSAwOyBpIDwgdy0+Y3VycmVudF9tYXRyaXgtPm5yb3dzOyArK2kp CisgICAgeworICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93ID0gdy0+Y3VycmVudF9tYXRyaXgt PnJvd3MgKyBpOworICAgICAgaWYgKCFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgYnJlYWs7Cisg ICAgICAgIGVsc2UgaWYgKHJvdy0+bW9kZV9saW5lX3ApCisgICAgICAgICAgY29udGludWU7Cisg ICAgICBpZiAocm93LT5vdmVybGFwcGVkX3ApCisgICAgICAgIHsKKyAgICAgICAgICBmb3IgKGVu dW0gZ2x5cGhfcm93X2FyZWEgYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFyZWEgPCBMQVNUX0FS RUE7ICsrYXJlYSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgb3V0cHV0X2N1cnNvcl90 byAodywgaSwgMCwgcm93LT55LCBhcmVhID09IFRFWFRfQVJFQSA/IHJvdy0+eCA6IDApOworICAg ICAgICAgICAgICBpZiAoKHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbTUNfQ0FDSEVdID4gMCB8 fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0NIX0NBQ0hFXSA+IDAgfHwgdy0+bWNfbWF0cml4 LmN1cnNvcnNfdXNlZFtGQ19DQUNIRV0gPiAwKQorICAgICAgICAgICAgICAgICAgJiYgYXJlYSA9 PSBURVhUX0FSRUEKKyAgICAgICAgICAgICAgICAgICYmIHJvdy0+dXNlZFthcmVhXSkKKyAgICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRy aXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAgICAgICAgICAgICAgICAgIGludCBzdGFydF94ID0g cm93LT54OworICAgICAgICAgICAgICAgICAgaW50IHN0YXJ0X2hwb3MgPSAwOworICAgICAgICAg ICAgICAgICAgaW50IGVuZF9ocG9zID0gcm93LT51c2VkW2FyZWFdOworICAgICAgICAgICAgICAg ICAgYm9vbCBjbGVhcl9lb2xfcCA9IHRydWU7CisgICAgICAgICAgICAgICAgICBlbnVtIGRyYXdf Z2x5cGhzX2ZhY2UgaGwgPSBEUkFXX05PUk1BTF9URVhUOworICAgICAgICAgICAgICAgICAgbWNf cmVkcmF3X3JvdyAodywgbWF0cml4LCByb3csIHN0YXJ0X3gsIHN0YXJ0X2hwb3MsIGVuZF9ocG9z LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJfZW9sX3AsIGhsKTsKKyAg ICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSBpZiAocm93LT51c2VkW2FyZWFd KQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRV9SSUYgKGYp LT53cml0ZV9nbHlwaHMgKHcsIHJvdywgcm93LT5nbHlwaHNbYXJlYV0sIGFyZWEsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT51c2VkW2FyZWFd KTsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVfUklGIChmKS0+Y2xlYXJfZW5kX29mX2xpbmUg KHcsIHJvdywgYXJlYSwgLTEpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQor ICAgICAgICAgIHJvdy0+b3ZlcmxhcHBlZF9wID0gMDsKKyAgICAgICAgfQorICAgICAgaWYgKE1B VFJJWF9ST1dfQk9UVE9NX1kgKHJvdykgPj0geWIpCisgICAgICAgIGJyZWFrOworICAgIH0KKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgICAgIHJlZHJhd19vdmVybGFwcGluZ19y b3dzICh3LCB5Yik7CiAJICAgIH0KICNlbmRpZgpAQCAtMzUzMSwxMCArNTUwMSwyMSBAQCB1cGRh dGVfd2luZG93IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3ApCiAgICAgICBzdHJjcHkg KHctPmN1cnJlbnRfbWF0cml4LT5tZXRob2QsIHctPmRlc2lyZWRfbWF0cml4LT5tZXRob2QpOwog I2VuZGlmCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JT ICovCisKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KKyAgaWYgKEJVRkZFUlAgKHctPmNvbnRl bnRzKQorICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3No YWlycykpKQorICAgIG1jX3VwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgMCk7CisgICAgZWxzZQog ICAgICAgdXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCAwKTsKICNlbmRpZgogCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAgICAgICAvKiBFbmQgdGhlIHVwZGF0ZSBvZiB3aW5kb3cgVy4g IERvbid0IHNldCB0aGUgY3Vyc29yIGlmIHdlCiAgICAgICAgICBwYXVzZWQgdXBkYXRpbmcgdGhl IGRpc3BsYXkgYmVjYXVzZSBpbiB0aGlzIGNhc2UsCiAgICAgICAgICBzZX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0eV9saW5lX2JpdHNbXSA9IHsKICNkZWZpbmUgU1RBTkRBUkRfQklUTUFQX0hFSUdI VChiaXRzKSAoc2l6ZW9mIChiaXRzKS9CWVRFU19QRVJfQklUTUFQX1JPVykKICNkZWZpbmUgRlJC SVRTKGJpdHMpICBiaXRzLCBTVEFOREFSRF9CSVRNQVBfSEVJR0hUIChiaXRzKQogCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCisvKiBg Ky1mcmluZ2UtaGVscGVyLWRlY2ltYWwnIGRlZmluZWQgaW4gYGNyb3NzaGFpcnMuZWxgICovCisK Ky8qIFRPRE86ICBDb25zaWRlciBhZGRpbmcgdGhlIGZvbGxvd2luZyBmcmluZ2UgYml0bWFwczoK KyAgKGRlZmluZS1mcmluZ2UtYml0bWFwICdicmVha3BvaW50ICJceDNjXHg3ZVx4ZmZceGZmXHhm Zlx4ZmZceDdlXHgzYyIpCisgIChkZWZpbmUtZnJpbmdlLWJpdG1hcCAnaG9sbG93LXJpZ2h0LXRy aWFuZ2xlICJceGUwXHg5MFx4ODhceDg0XHg4NFx4ODhceDkwXHhlMCIpICovCisKKy8qIDI0Cisg ICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInguLi4uLi4uIgorICAgICAg InguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLnh4Li4uIgorICAgICAgIngu Li54eC4uIgorICAgICAgInguLi4ueHguIgorICAgICAgIngueHh4eHh4IgorICAgICAgIngueHh4 eHh4IgorICAgICAgInguLi4ueHguIgorICAgICAgInguLi54eC4uIgorICAgICAgInguLnh4Li4u IgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIikK KyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93X2Jp dHNbXSA9eworICAweDgwLCAweDgwLCAweDgwLCAweDk4LCAweDhjLCAweDg2LCAweGJmLAorICAw eGJmLCAweDg2LCAweDhjLCAweDk4LCAweDgwLCAweDgwLCAweDgwfTsKKworLyogMjUKKyAgICAo Ky1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4u Li4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLnh4Li4ueHgiCisgICAgICAiLi54eC4u eHgiCisgICAgICAiLi4ueHgueHgiCisgICAgICAieHh4eHh4eHgiCisgICAgICAieHh4eHh4eHgi CisgICAgICAiLi4ueHgueHgiCisgICAgICAiLi54eC4ueHgiCisgICAgICAiLnh4Li4ueHgiCisg ICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiKQorKi8K K3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19yZXZlcnNlZF92ZXJ0aWNhbF9iYXJfcmlnaHRfYXJy b3dfYml0c1tdID17CisgIDB4MywgMHgzLCAweDMsIDB4NjMsIDB4MzMsIDB4MWIsIDB4ZmYsIDB4 ZmYsIDB4MWIsIDB4MzMsIDB4NjMsIDB4MywgMHgzLCAweDN9OworCisvKiAyNgorICAgICgrLWZy aW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICJ4eHh4eHh4eCIKKyAgICAgICJ4Li4uLi4u eCIKKyAgICAgICJ4Li4uLi4ueCIKKyAgICAgICJ4Li54eC4ueCIKKyAgICAgICJ4Li4ueHgueCIK KyAgICAgICJ4Li4uLnh4eCIKKyAgICAgICJ4Lnh4eHh4eCIKKyAgICAgICJ4Lnh4eHh4eCIKKyAg ICAgICJ4Li4uLnh4eCIKKyAgICAgICJ4Li4ueHgueCIKKyAgICAgICJ4Li54eC4ueCIKKyAgICAg ICJ4Li4uLi4ueCIKKyAg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4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4 IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4Igor ICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAg ICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAg Ii4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQg bWNfcmV2ZXJzZWRfdmVydGljYWxfYmFyX2JpdHNbXSA9eworICAweDMsIDB4MywgMHgzLCAweDMs IDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4M307CisKKy8q IDMxCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Li4uLi4uIgor ICAgICAgInh4Li4uLi4uIgorICAgICAgIiB4eC4uLi4uIgorICAgICAgIi54eC4uLi4uIgorICAg ICAgIi4ueHguLi4uIgorICAgICAgIi4ueHguLi4uIgorICAgICAgIi4uLnh4Li4uIgorICAgICAg Ii4uLnh4Li4uIgorICAgICAgIi4uLi54eC4uIgorICAgICAgIi4uLi54eC4uIgorICAgICAgIi4u Li4ueHguIgorICAgICAgIi4uLi4ueHguIgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4u Lnh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfYmFja3NsYXNoX2JpdHNbXSA9ewor ICAweGMwLCAweGMwLCAweGUwLCAweDYwLCAweDMwLCAweDMwLCAweDE4LCAweDE4LCAweGMsIDB4 YywgMHg2LCAweDYsIDB4MywgMHgzfTsKKworLyogMzIKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhl eGFkZWNpbWFsCisgICAgICAieHguLi4uLi4iCisgICAgICAieHguLi4uLi4iCisgICAgICAieHh4 Li4uLi4iCisgICAgICAieHh4Li4uLi4iCisgICAgICAieC54eC4uLi4iCisgICAgICAieC54eC4u Li4iCisgICAgICAieC4ueHguLi4iCisgICAgICAieC4ueHguLi4iCisgICAgICAieC4uLnh4Li4i CisgICAgICAieC4uLnh4Li4iCisgICAgICAieC4uLi54eC4iCisgICAgICAieC4uLi54eC4iCisg ICAgICAieC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBz aG9ydCBtY192ZXJ0aWNhbF9iYXJfYmFja3NsYXNoX2JpdHNbXSA9eworICAweGMwLCAweGMwLCAw eGUwLCAweGUwLCAweGIwLCAweGIwLCAweDk4LAorICAweDk4LCAweDhjLCAweDhjLCAweDg2LCAw eDg2LCAweDgzLCAweDgzfTsKKworLyogMzMKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNp bWFsCisgICAgICAiLnh4eHh4eC4iCisgICAgICAieHh4eC54Li4iCisgICAgICAieHh4eC54Li4i CisgICAgICAieHh4eC54Li4iCisgICAgICAiLnh4eC54Li4iCisgICAgICAiLi4ueC54Li4iCisg ICAgICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAg ICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9y dCBtY19waWxjcm93X2JpdHNbXSA9eworICAweDdlLCAweGY0LCAweGY0LCAweGY0LCAweDc0LCAw eDE0LCAweDE0LCAweDE0LCAweDE0LCAweDE0LCAweDE0fTsKKworLyogMzQKKyAgICAoKy1mcmlu Z2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi54eHh4Li4iCisgICAgICAiLnh4eHh4eC4i CisgICAgICAieC4ueHguLngiCisgICAgICAieC4ueHguLngiCisgICAgICAieHh4eHh4eHgiCisg ICAgICAieHguLi4ueHgiCisgICAgICAieHh4Li54eHgiCisgICAgICAiLnh4eHh4eC4iCisgICAg ICAiLi54eHh4Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zbWlsZXlfZmFjZV9i aXRzW10gPXsKKyAgMHgzYywgMHg3ZSwgMHg5OSwgMHg5OSwgMHhmZiwgMHhjMywgMHhlNywgMHg3 ZSwgMHgzY307CisKKy8qIDM1CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAg ICAgIi4ueC4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAg Ii4uLi4ueC4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4u eC4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX3JpZ2h0 X2JpdHNbXSA9eworICAweDIwLCAweDEwLCAweDgsIDB4NCwgMHg4LCAweDEwLCAweDIwfTsKKwor LyogMzYKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi54Li4i CisgICAgICAiLi4uLnguLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54Li4uLi4iCisg ICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLnguLi4iCisgICAgICAiLi4uLi54Li4iKQorKi8K K3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zaW5nbGVfYW5nbGVfbGVmdF9iaXRzW10gPXsKKyAg MHg0LCAweDgsIDB4MTAsIDB4MjAsIDB4MTAsIDB4OCwgMHg0fTsKKworLyogMzcKKyAgICAoKy1m cmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHgueHguLi4iCisgICAgICAiLnh4Lnh4 Li4iCisgICAgICAiLi54eC54eC4iCisgICAgICAiLi4ueHgueHgiCisgICAgICAiLi54eC54eC4i CisgICAgICAiLnh4Lnh4Li4iCisgICAgICAieHgueHguLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25l ZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfcmlnaHRfYml0c1tdID17CisgIDB4ZDgsIDB4NmMsIDB4 MzYsIDB4MWIsIDB4MzYsIDB4NmMsIDB4ZDh9OworCisvKiAzOAorICAgICgrLWZyaW5nZS1oZWxw ZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi54eC54eCIKKyAgICAgICIuLnh4Lnh4LiIKKyAgICAg ICIueHgueHguLiIKKyAgICAgICJ4eC54eC4uLiIKKyAgICAgICIueHgueHguLiIKKyAgICAgICIu Lnh4Lnh4LiIKKyAgICAgICIuLi54eC54eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1j X2RvdWJsZV9hbmdsZV9sZWZ0X2JpdHNbXSA9eworICAweDFiLCAweDM2LCAweDZjLCAweGQ4LCAw eDZjLCAweDM2LCAweDFifTsKKworLyogMzkKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNp bWFsCisgICAgICAieC54LnguLi4iCisgICAgICAiLngueC54Li4iCisgICAgICAiLi54LngueC4i CisgICAgICAiLi4ueC54LngiCisgICAgICAiLi54LngueC4iCisgICAgICAiLngueC54Li4iCisg ICAgICAieC54LnguLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190cmlwbGVfYW5n bGVfcmlnaHRfYml0c1tdID17CisgIDB4YTgsIDB4NTQsIDB4MmEsIDB4MTUsIDB4MmEsIDB4NTQs IDB4YTh9OworCisvKiA0MAorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAg ICIuLi54LngueCIKKyAgICAgICIuLngueC54LiIKKyAgICAgICIueC54LnguLiIKKyAgICAgICJ4 LngueC4uLiIKKyAgICAgICIueC54LnguLiIKKyAgICAgICIuLngueC54LiIKKyAgICAgICIuLi54 LngueCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3RyaXBsZV9hbmdsZV9sZWZ0X2Jp dHNbXSA9eworICAweDE1LCAweDJhLCAweDU0LCAweGE4LCAweDU0LCAweDJhLCAweDE1fTsKKwor LyogNDEKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4i CisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisg ICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAg ICAieC4uLi4ueC4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAi Li4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBt Y19zaW5nbGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4 MTAsIDB4MjgsIDB4NDQsIDB4ODIsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9OworCisvKiA0Mgor ICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4uLiIKKyAgICAg ICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICJ4 Li4uLi54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIuLi54 Li4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4u LiIKKyAgICAgICIuLi4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3Npbmds ZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDgyLCAw eDQ0LCAweDI4LCAweDEwLCAweDAwLCAweDAwLCAweDAwLCAweDAwfTsKKworLyogNDMKKyAgICAo Ky1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4u Li4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54Lngu Li4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4i CisgICAgICAiLnguLi54Li4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLi4uLi4uLi4iCisg ICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBz aG9ydCBtY19kb3VibGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4MDAsIDB4MDAsIDB4MDAsIDB4 MTAsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4ODIsIDB4MDAsIDB4MDAsIDB4MDB9 OworCisvKiA0NAorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4u Li4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICJ4Li4uLi54 LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIK KyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAg ICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIpCisqLwor c3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX2RvdWJsZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAw eDAwLCAweDAwLCAweDAwLCAweDgyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDEw LCAweDAwLCAweDAwLCAweDAwfTsKKworLyogNDUKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFk ZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54Lngu Li4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4i CisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisg ICAgICAiLnguLi54Li4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLi4uLi4uLi4iKQorKi8K K3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190cmlwbGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4 MDAsIDB4MTAsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQs IDB4ODIsIDB4MDB9OworCisvKiA0NgorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwK KyAgICAgICIuLi4uLi4uLiIKKyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIueC4uLnguLiIKKyAg ICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAg ICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIu LngueC4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLi4uLi4uLiIpCisqLworc3RhdGlj IHVuc2lnbmVkIHNob3J0IG1jX3F1YWRydXBsZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAweDAw LCAweDgyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAw eDEwLCAweDAwfTsKKworLyogNDcKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisg ICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAg ICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAi eC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4u eC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4uLi4u eC4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19xdWFkcnVwbGVfYW5nbGVfdXBfYml0 c1tdID17CisgIDB4MTAsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4OTIsIDB4Mjgs IDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4ODJ9OworCisvKiA0OAorICAgICgrLWZyaW5nZS1o ZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIueC4uLnguLiIKKyAg ICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAg ICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIu LngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngu eC4uLiIKKyAgICAgICIuLi54Li4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3Ry aXBsZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAweDgyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0 LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDEwfTsKKwogLyog Tk9URTogIFRoZSBvcmRlciBvZiB0aGVzZSBiaXRtYXBzIG11c3QgbWF0Y2ggdGhlIHNlcXVlbmNl CiAgICB1c2VkIGluIGZyaW5nZS5lbCB0byBkZWZpbmUgdGhlIGNvcnJlc3BvbmRpbmcgc3ltYm9s cy4gICov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ZV9iaXRt YXAgKHN0cnVjdCB3aW5kb3cgKncsIExpc3BfT2JqZWN0IGJpdG1hcCwgaW50IHJpZ2h0X3AsIGlu dCBwYXJ0aWFsX3ApCit7CisgIExpc3BfT2JqZWN0IGNtYXAsIGJtMSA9IFFuaWwsIGJtMiA9IFFu aWwsIGJtOworICBFTUFDU19JTlQgbG4xID0gMCwgbG4yID0gMDsKKyAgaW50IGl4MSA9IHJpZ2h0 X3A7CisgIGludCBpeDIgPSBpeDEgKyAocGFydGlhbF9wID8gMiA6IDApOworICBpZiAoKGNtYXAg PSBCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKSwg IU5JTFAgKGNtYXApKQorICAgIHsKKyAgICAgIGJtMSA9IG1jX2Fzc3EgKGJpdG1hcCwgY21hcCk7 CisgICAgICBpZiAoQ09OU1AgKGJtMSkpCisgIHsKKyAgICBpZiAoKGJtMSA9IFhDRFIgKGJtMSkp LCBOSUxQIChibTEpKQorICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgaWYg KENPTlNQIChibTEpKQorICAgICAgeworICAgICAgICBsbjEgPSBYRklYTlVNIChGbGVuZ3RoIChi bTEpKTsKKyAgICAgICAgaWYgKHBhcnRpYWxfcCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBp ZiAobG4xID4gaXgyKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgYm0gPSBtY19u dGggKGl4MiwgYm0xKTsKKyAgICAgICAgICAgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAg ICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAg ICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChsbjEgPiBpeDEpCisgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBibSA9IG1jX250aCAoaXgxLCBibTEpOworICAg ICAgICAgICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAgICAgICAgICBnb3RvIGZv dW5kOworICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgfQorICAgIGVsc2UgaWYg KChibSA9IGJtMSwgIUVRIChibSwgUXQpKSkKKyAgICAgIGdvdG8gZm91bmQ7CisgIH0KKyAgICB9 CisgIGlmICghRVEgKGNtYXAsIEJWQVIgKCZidWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9pbmRpY2F0 b3JfYWxpc3QpKQorICAgICAgJiYgIU5JTFAgKEJWQVIgKCZidWZmZXJfZGVmYXVsdHMsIGZyaW5n ZV9pbmRpY2F0b3JfYWxpc3QpKSkKKyAgICB7CisgICAgICBibTIgPSBtY19hc3NxIChiaXRtYXAs IEJWQVIgKCZidWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKTsKKyAgICAg IGlmIChDT05TUCAoYm0yKSkKKyAgICAgICAgeworICAgICAgICAgIGlmICgoYm0yID0gWENEUiAo Ym0yKSksICFOSUxQIChibTIpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAoQ09O U1AgKGJtMikpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgbG4yID0gWEZJ WE5VTSAoRmxlbmd0aCAoYm0yKSk7CisgICAgICAgICAgICAgICAgICBpZiAocGFydGlhbF9wKQor ICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgaWYgKGxuMiA+IGl4 MikKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAg Ym0gPSBtY19udGggKGl4MiwgYm0yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFF USAoYm0sIFF0KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5kOworICAg ICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICBpZiAobG4xID4gaXgx KQorICAgIHsKKyAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMSk7CisgICAgICBpZiAoIUVRIChi bSwgUXQpKQorICAgICAgICBnb3RvIGZvdW5kOworICAgIH0KKyAgaWYgKGxuMiA+IGl4MSkKKyAg ICB7CisgICAgICBibSA9IG1jX250aCAoaXgxLCBibTIpOworICAgICAgaWYgKCFFUSAoYm0sIFF0 KSkKKyAgICAgICAgZ290byBmb3VuZDsKKyAgICAgIHJldHVybiBNQ19OT19GUklOR0VfQklUTUFQ OworICAgIH0KKyAgICBlbHNlIGlmICgoYm0gPSBibTIsIE5JTFAgKGJtKSkpCisgICAgICByZXR1 cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgZm91bmQ6CisgIHJldHVybiBsb29rdXBfZnJpbmdl X2JpdG1hcCAoYm0pOworfQorCitzdGF0aWMgaW50CittY19nZXRfbG9naWNhbF9jdXJzb3JfYml0 bWFwIChzdHJ1Y3Qgd2luZG93ICp3LCBMaXNwX09iamVjdCBjdXJzb3IpCit7CisgIExpc3BfT2Jq ZWN0IGNtYXAsIGJtID0gUW5pbDsKKyAgaWYgKChjbWFwID0gQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBmcmluZ2VfY3Vyc29yX2FsaXN0KSksICFOSUxQIChjbWFwKSkKKyAgICB7CisgICAg ICBibSA9IG1jX2Fzc3EgKGN1cnNvciwgY21hcCk7CisgICAgICBpZiAoQ09OU1AgKGJtKSkKKyAg ICAgICAgeworICAgICAgICAgIGlmICgoYm0gPSBYQ0RSIChibSkpLCBOSUxQIChibSkpCisgICAg ICAgICAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICByZXR1cm4gbG9v a3VwX2ZyaW5nZV9iaXRtYXAgKGJtKTsKKyAgICAgICAgfQorICAgIH0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GFueSB2YWx1ZSBp biBsb2NhbCBiaW5kaW5nIGlzIG5vdCBwcmVzZW50IG9yIHQsIHVzZSBnbG9iYWwgdmFsdWUuCisg ICAgIElmIHBhcnRpYWwsIGxvb2t1cCBwYXJ0aWFsIGJpdG1hcCBpbiBkZWZhdWx0IHZhbHVlIGlm IG5vdCBmb3VuZCBoZXJlLgorICAgICBJZiBub3QgcGFydGlhbCwgb3Igbm8gcGFydGlhbCBzcGVj IGlzIHByZXNlbnQsIHVzZSBub24tcGFydGlhbCBiaXRtYXAuICAqLworICBpZiAoKGNtYXAgPSBC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKSwgIU5J TFAgKGNtYXApKQorICAgIHsKKyAgICAgIGJtMSA9IG1jX2Fzc3EgKGJpdG1hcCwgY21hcCk7Cisg ICAgICBpZiAoQ09OU1AgKGJtMSkpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoKGJtMSA9IFhD RFIgKGJtMSkpLCBOSUxQIChibTEpKQorICAgICAgICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9C SVRNQVA7CisgICAgICAgICAgaWYgKENPTlNQIChibTEpKQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBsbjEgPSBYRklYTlVNIChGbGVuZ3RoIChibTEpKTsKKyAgICAgICAgICAgICAgaWYg KHBhcnRpYWxfcCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBpZiAobG4x ID4gaXgyKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgYm0g PSBtY19udGggKGl4MiwgYm0xKTsKKyAgICAgICAgICAgICAgICAgICAgICBpZiAoIUVRIChibSwg UXQpKQorICAgICAgICAgICAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGlmIChsbjEgPiBpeDEpCisgICAgICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBibSA9IG1jX250aCAoaXgxLCBibTEpOwor ICAgICAgICAgICAgICAgICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAgICAgICAg ICAgICAgICBnb3RvIGZvdW5kOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAg ICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAoKGJtID0gYm0xLCAhRVEg KGJtLCBRdCkpKQorICAgICAgICAgICAgICBnb3RvIGZvdW5kOworICAgICAgICB9CisgICAgfQor ICBpZiAoIUVRIChjbWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9y X2FsaXN0KSkKKyAgICAgICYmICFOSUxQIChCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2Vf aW5kaWNhdG9yX2FsaXN0KSkpCisgICAgeworICAgICAgYm0yID0gbWNfYXNzcSAoYml0bWFwLCBC VkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSk7CisgICAgICBp ZiAoQ09OU1AgKGJtMikpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoKGJtMiA9IFhDRFIgKGJt MikpLCAhTklMUCAoYm0yKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKENPTlNQ IChibTIpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGxuMiA9IFhGSVhO VU0gKEZsZW5ndGggKGJtMikpOworICAgICAgICAgICAgICAgICAgaWYgKHBhcnRpYWxfcCkKKyAg ICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGlmIChsbjIgPiBpeDIp CisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGJt ID0gbWNfbnRoIChpeDIsIGJtMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghRVEg KGJtLCBRdCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAg ICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgaWYgKGxuMSA+IGl4MSkK KyAgICB7CisgICAgICBibSA9IG1jX250aCAoaXgxLCBibTEpOworICAgICAgaWYgKCFFUSAoYm0s IFF0KSkKKyAgICAgICAgZ290byBmb3VuZDsKKyAgICB9CisgIGlmIChsbjIgPiBpeDEpCisgICAg eworICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0yKTsKKyAgICAgIGlmICghRVEgKGJtLCBRdCkp CisgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsK KyAgICB9CisgICAgZWxzZSBpZiAoKGJtID0gYm0yLCBOSUxQIChibSkpKQorICAgICAgcmV0dXJu IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgIGZvdW5kOgorICByZXR1cm4gbG9va3VwX2ZyaW5nZV9i aXRtYXAgKGJtKTsKK30KKworLyogUmVjYWxjdWxhdGUgdGhlIGJpdG1hcHMgdG8gc2hvdyBpbiB0 aGUgZnJpbmdlcyBvZiB3aW5kb3cgVy4KKyAgIE9ubHkgbWFyayByb3dzIHdpdGggbW9kaWZpZWQg Yml0bWFwcyBmb3IgdXBkYXRlIGluIHJlZHJhd19mcmluZ2VfYml0bWFwc19wLgorICAgSWYgS0VF UF9DVVJSRU5UX1AgaXMgMCwgdXBkYXRlIGN1cnJlbnRfbWF0cml4IHRvby4gKi8KK2Jvb2wKK21j X3VwZGF0ZV93aW5kb3dfZnJpbmdlcyAoc3RydWN0IHdpbmRvdyAqdywgYm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ctPnBz ZXVkb193aW5kb3dfcCkKKyAgICByZXR1cm4gMDsKKyAgaWYgKCFNSU5JX1dJTkRPV19QICh3KQor ICAgICAgJiYgKGluZCA9IEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgaW5kaWNhdGVfYnVm ZmVyX2JvdW5kYXJpZXMpLCAhTklMUCAoaW5kKSkpCisgICAgeworICAgICAgaWYgKEVRIChpbmQs IFFsZWZ0KSB8fCBFUSAoaW5kLCBRcmlnaHQpKQorICAgICAgICBib3VuZGFyeV90b3AgPSBib3Vu ZGFyeV9ib3QgPSBhcnJvd190b3AgPSBhcnJvd19ib3QgPSBpbmQ7CisgICAgICAgIGVsc2UgaWYg KENPTlNQIChpbmQpCisgICAgICAgICAgICAgICAgICYmIENPTlNQIChYQ0FSIChpbmQpKSkKKyAg ICAgICAgeworICAgICAgICAgIExpc3BfT2JqZWN0IHBvczsKKyAgICAgICAgICBpZiAocG9zID0g bWNfYXNzcSAoUXQsIGluZCksICFOSUxQIChwb3MpKQorICAgICAgICAgICAgYm91bmRhcnlfdG9w ID0gYm91bmRhcnlfYm90ID0gYXJyb3dfdG9wID0gYXJyb3dfYm90ID0gWENEUiAocG9zKTsKKyAg ICAgICAgICBpZiAocG9zID0gbWNfYXNzcSAoUXRvcCwgaW5kKSwgIU5JTFAgKHBvcykpCisgICAg ICAgICAgICBib3VuZGFyeV90b3AgPSBYQ0RSIChwb3MpOworICAgICAgICAgIGlmIChwb3MgPSBt Y19hc3NxIChRYm90dG9tLCBpbmQpLCAhTklMUCAocG9zKSkKKyAgICAgICAgICAgIGJvdW5kYXJ5 X2JvdCA9IFhDRFIgKHBvcyk7CisgICAgICAgICAgaWYgKHBvcyA9IG1jX2Fzc3EgKFF1cCwgaW5k KSwgIU5JTFAgKHBvcykpCisgICAgICAgICAgICBhcnJvd190b3AgPSBYQ0RSIChwb3MpOworICAg ICAgICAgIGlmIChwb3MgPSBtY19hc3NxIChRZG93biwgaW5kKSwgIU5JTFAgKHBvcykpCisgICAg ICAgICAgICBhcnJvd19ib3QgPSBYQ0RSIChwb3MpOworICAgICAgICB9CisgICAgICAgIGVsc2UK KyAgICAgICAgICAvKiBBbnl0aGluZyBlbHNlIG1lYW5zIGJvdW5kYXJ5IG9uIGxlZnQgYW5kIG5v IGFycm93cy4gICovCisgICAgICAgICAgYm91bmRhcnlfdG9wID0gYm91bmRhcnlfYm90ID0gUWxl ZnQ7CisgICAgfQorICB0b3BfaW5kX3JuID0gYm90X2luZF9ybiA9IC0xOworICBpZiAoIU5JTFAg KGluZCkpCisgICAgeworICAgICAgZm9yICh5ID0gdy0+dnNjcm9sbCwgcm4gPSAwOworICAgICAg ICAgICB5IDwgeWIgJiYgcm4gPCBucm93czsKKyAgICAgICAgICAgeSArPSByb3ctPmhlaWdodCwg KytybikKKyAgICAgICAgeworICAgICAgICAgIHJvdyA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dz ICsgcm47CisgICAgICAgICAgaWYgKCFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgICAgIHJvdyA9 IHctPmN1cnJlbnRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgcm93LT5pbmRpY2F0ZV9i b2JfcCA9IHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcCA9IDA7CisgICAgICAgICAgcm93LT5pbmRp Y2F0ZV9lb2JfcCA9IHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCA9IDA7CisgICAgICAgICAg aWYgKCFyb3ctPm1vZGVfbGluZV9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAo dG9wX2luZF9ybiA8IDAgJiYgcm93LT52aXNpYmxlX2hlaWdodCA+IDApCisgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgaWYgKE1BVFJJWF9ST1dfU1RBUlRfQ0hBUlBPUyAocm93 KSA8PSBCVUZfQkVHViAoWEJVRkZFUiAody0+Y29udGVudHMpKQorICAgICAgICAgICAgICAgICAg ICAgICYmICFNQVRSSVhfUk9XX1BBUlRJQUxMWV9WSVNJQkxFX0FUX1RPUF9QICh3LCByb3cpKQor ICAgICAgICAgICAgICAgICAgICByb3ctPmluZGljYXRlX2JvYl9wID0gIU5JTFAgKGJvdW5kYXJ5 X3RvcCk7CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICBy b3ctPmluZGljYXRlX3RvcF9saW5lX3AgPSAhTklMUCAoYXJyb3dfdG9wKTsKKyAgICAgICAgICAg ICAgICAgIHRvcF9pbmRfcm4gPSBybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAg IGlmIChib3RfaW5kX3JuIDwgMCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICBpZiAoTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSA+PSBCVUZfWlYgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSkKKyAgICAgICAgICAgICAgICAgICAgICAmJiAhTUFUUklYX1JPV19QQVJUSUFM TFlfVklTSUJMRV9BVF9CT1RUT01fUCAodywgcm93KSkKKyAgICAgICAgICAgICAgICAgICAgcm93 LT5pbmRpY2F0ZV9lb2JfcCA9ICFOSUxQIChib3VuZGFyeV9ib3QpLCBib3RfaW5kX3JuID0gcm47 CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHkgKyByb3ctPmhlaWdodCA+PSB5YikKKyAg ICAgICAgICAgICAgICAgICAgICByb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3AgPSAhTklMUCAo YXJyb3dfYm90KSwgYm90X2luZF9ybiA9IHJuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgZW1wdHlfcG9zID0gQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBpbmRpY2F0ZV9lbXB0eV9saW5lcyk7CisgIGlmICghTklMUCAoZW1wdHlfcG9z KSAmJiAhRVEgKGVtcHR5X3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HRvcF9pbmRfbWluX3kgPSBib3RfaW5kX21heF95ID0gLTE7CisgIGlmICh0 b3BfaW5kX3JuID49IDApCisgICAgeworICAgICAgaW50IGJuID0gTUNfTk9fRlJJTkdFX0JJVE1B UDsKKyAgICAgIHJvdyA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgdG9wX2luZF9ybjsKKyAg ICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgICAgIHJvdyA9IHctPmN1cnJlbnRfbWF0cml4 LT5yb3dzICsgdG9wX2luZF9ybjsKKyAgICAgIHRvcF9yb3dfZW5kc19hdF96dl9wID0gcm93LT5l bmRzX2F0X3p2X3A7CisgICAgICBpZiAocm93LT5pbmRpY2F0ZV9ib2JfcCkKKyAgICAgICAgewor ICAgICAgICAgIGlmIChFUSAoYm91bmRhcnlfdG9wLCBRbGVmdCkpCisgICAgICAgICAgICBibiA9 ICgocm93LT5pbmRpY2F0ZV9lb2JfcCAmJiBFUSAoYm91bmRhcnlfYm90LCBRbGVmdCkpCisgICAg ICAgICAgICAgICAgICA/IE1DX0xFRlRfRlJJTkdFICgxLCBRdG9wX2JvdHRvbSwgcm93LT5lbmRz X2F0X3p2X3ApCisgICAgICAgICAgICAgICAgICA6IE1DX0xFRlRfRlJJTkdFICgyLCBRdG9wLCAw KSk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGJuID0gKChyb3ctPmluZGljYXRl X2VvYl9wICYmIEVRIChib3VuZGFyeV9ib3QsIFFyaWdodCkpCisgICAgICAgICAgICAgICAgICAg ID8gTUNfUklHSFRfRlJJTkdFICgxLCBRdG9wX2JvdHRvbSwgcm93LT5lbmRzX2F0X3p2X3ApCisg ICAgICAgICAgICAgICAgICAgIDogTUNfUklHSFRfRlJJTkdFICgyLCBRdG9wLCAwKSk7CisgICAg ICAgIH0KKyAgICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV90b3BfbGluZV9wKQorICAgICAg ICAgIHsKKyAgICAgICAgICAgIGlmIChFUSAoYXJyb3dfdG9wLCBRbGVmdCkpCisgICAgICAgICAg ICAgIGJuID0gTUNfTEVGVF9GUklOR0UgKDYsIFF1cCwgMCk7CisgICAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgICBibiA9IE1DX1JJR0hUX0ZSSU5HRSAoNiwgUXVwLCAwKTsKKyAgICAg ICAgICB9CisgICAgICBpZiAoYm4gIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgewor ICAgICAgICAgIHN0cnVjdCBmcmluZ2VfYml0bWFwICpmYiA9IGdldF9mcmluZ2VfYml0bWFwX2Rh dGEgKGJuKTsKKyAgICAgICAgICBpZiAoZmItPmFsaWduID09IEFMSUdOX0JJVE1BUF9UT1AgJiYg ZmItPnBlcmlvZCA9PSAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5 cGhfcm93ICpyb3cxOworICAgICAgICAgICAgICBpbnQgdG9wX2luZF9tYXhfeTsKKyAgICAgICAg ICAgICAgdG9wX2luZF9taW5feSA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICAg ICAgICAgICAgICB0b3BfaW5kX21heF95ID0gdG9wX2luZF9taW5feSArIGZiLT5oZWlnaHQ7Cisg ICAgICAgICAgICAgIGlmICh0b3BfaW5kX21heF95ID4geWIpCisgICAgICAgICAgICAgICAgdG9w X2luZF9tYXhfeSA9IHliOworICAgICAgICAgICAgICBmb3IgKHkgPSByb3ctPnkgKyByb3ctPmhl aWdodCwgcm4gPSB0b3BfaW5kX3JuICsgMTsKKyAgICAgICAgICAgICAgICAgICB5IDwgdG9wX2lu ZF9tYXhfeSAmJiBybiA8IG5yb3dzOworICAgICAgICAgICAgICAgICAgIHkgKz0gcm93MS0+aGVp Z2h0LCBybisrKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGlmIChib3Rf aW5kX3JuID49IDAgJiYgcm4gPj0gYm90X2luZF9ybikKKyAgICAgICAgICAgICAgICAgICAgYnJl YWs7CisgICAgICAgICAgICAgICAgICByb3cxID0gdy0+ZGVzaXJlZF9tYXRyaXgtPnJvd3MgKyBy bjsKKyAgICAgICAgICAgICAgICAgIGlmICghcm93MS0+ZW5hYmxlZF9wKQorICAgICAgICAgICAg ICAgICAgICByb3cxID0gdy0+Y3VycmVudF9tYXRyaXgtPnJvd3MgKyBybjsKKyAgICAgICAgICAg ICAgICAgIHJvdzEtPmluZGljYXRlX2JvYl9wID0gcm93LT5pbmRpY2F0ZV9ib2JfcDsKKyAgICAg ICAgICAgICAgICAgIHJvdzEtPmluZGljYXRlX3RvcF9saW5lX3AgPSByb3ctPmluZGljYXRlX3Rv cF9saW5lX3A7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9Cisg ICAgfQorICBpZiAoYm90X2luZF9ybiA+PSAwKQorICAgIHsKKyAgICAgIGludCBibiA9IE1DX05P X0ZSSU5HRV9CSVRNQVA7CisgICAgICByb3cgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIGJv dF9pbmRfcm47CisgICAgICBpZiAoIXJvdy0+ZW5hYmxlZF9wKQorICAgICAgICByb3cgPSB3LT5j dXJyZW50X21hdHJpeC0+cm93cyArIGJvdF9pbmRfcm47CisgICAgICBib3Rfcm93X2VuZHNfYXRf enZfcCA9IHJvdy0+ZW5kc19hdF96dl9wOworICAgICAgaWYgKHJvdy0+aW5kaWNhdGVfZW9iX3Ap CisgICAgICAgIHsKKyAgICAgICAgICBpZiAoRVEgKGJvdW5kYXJ5X2JvdCwgUWxlZnQpKQorICAg ICAgICAgICAgYm4gPSBNQ19MRUZUX0ZSSU5HRSAoMywgUWJvdHRvbSwgcm93LT5lbmRzX2F0X3p2 X3ApOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBibiA9IE1DX1JJR0hUX0ZSSU5H RSAoMywgUWJvdHRvbSwgcm93LT5lbmRzX2F0X3p2X3ApOworICAgICAgICB9CisgICAgICAgIGVs c2UgaWYgKHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCkKKyAgICAgICAgICB7CisgICAgICAg ICAgICBpZiAoRVEgKGFycm93X2JvdCwgUWxlZnQpKQorICAgICAgICAgICAgICBibiA9IE1DX0xF RlRfRlJJTkdFICg3LCBRZG93biwgMCk7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICBibiA9IE1DX1JJR0hUX0ZSSU5HRSAoNywgUWRvd24sIDApOworICAgICAgICAgIH0KKyAg ICAgIGlmIChibiAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICB7CisgICAgICAgICAg c3RydWN0IGZyaW5nZV9iaXRtYXAgKmZiID0gZ2V0X2ZyaW5nZV9iaXRtYXBfZGF0YSAoYm4pOwor ICAgICAgICAgIGlmIChmYi0+YWxpZ24gPT0gQUxJR05fQklUTUFQX0JPVFRPTSAmJiBmYi0+cGVy aW9kID09IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cg KnJvdzE7CisgICAgICAgICAgICAgIGludCBib3RfaW5kX21pbl95OworICAgICAgICAgICAgICBi b3RfaW5kX21heF95ID0gcm93LT55ICsgcm93LT52aXNpYmxlX2hlaWdodDsKKyAgICAgICAgICAg ICAgYm90X2luZF9taW5feSA9IGJvdF9pbmRfbWF4X3kgLSBmYi0+aGVpZ2h0OworICAgICAgICAg ICAgICBpZiAoYm90X2luZF9taW5feSA8IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpKQor ICAgICAgICAgICAgICAgIGJvdF9pbmRfbWluX3kgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hU ICh3KTsKKyAgICAgICAgICAgICAgZm9yICh5ID0gcm93LT55LCBybiA9IGJvdF9pbmRfcm4gLSAx OworICAgICAgICAgICAgICAgICAgIHkgPj0gYm90X2luZF9taW5feSAmJiBybiA+PSAwOworICAg ICAgICAgICAgICAgICAgIHkgLT0gcm93MS0+aGVpZ2h0LCBybi0tKQorICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgIGlmICh0b3BfaW5kX3JuID49IDAgJiYgcm4gPD0gdG9wX2lu ZF9ybikKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICByb3cx ID0gdy0+ZGVzaXJlZF9tYXRyaXgtPnJvd3MgKyBybjsKKyAgICAgICAgICAgICAgICAgIGlmICgh cm93MS0+ZW5hYmxlZF9wKQorICAgICAgICAgICAgICAgICAgICByb3cxID0gdy0+Y3VycmVudF9t YXRyaXgtPnJvd3MgKyBybjsKKyAgICAgICAgICAgICAgICAgIHJvdzEtPmluZGljYXRlX2VvYl9w ID0gcm93LT5pbmRpY2F0ZV9lb2JfcDsKKyAgICAgICAgICAgICAgICAgIHJvdzEtPmluZGljYXRl X2JvdHRvbV9saW5lX3AgPSByb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3A7CisgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICBMaXNwX09iamVjdCBi dWYgPSB3LT5jb250ZW50czsKKyAgQ0hFQ0tfQlVGRkVSIChidWYpOworICBib29sIGF1dG9faHNj cm9sbF9tb2RlX3AgPSBFUSAoRmJ1ZmZlcl9sb2NhbF92YWx1ZSAoUWF1dG9faHNjcm9sbF9tb2Rl LCBidWYpLCBRY3VycmVudF9saW5lKTsKKyAgLyogRVhBTVBMRTogIChzY3JvbGwtbGVmdCA1KSAq LworICBib29sIGhzY2xfYWxsX3RlbXBfcCA9ICh3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHctPm1pbl9oc2Nyb2xsID09IDApOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFu ZCBkbyBub3RoaW5nLiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMF9wID0gKHctPnN1c3BlbmRf YXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xs X21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gdy0+aHNjcm9sbCk7Cisg IC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIHNvbWV0aGluZyBlbHNlIGJlc2lkZXMgaG9y aXpvbnRhbGx5IHNjcm9sbGluZyB0aGUKKyAgICAgICAgICAgICAgIGN1cnJlbnQgbGluZSBkaWZm ZXJlbnRseS4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFs bHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8xX3AgPSAo IXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg YXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhz Y3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwg PiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gdy0+ aHNjcm9sbCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIC4uLgorICAgICAgICAgICAg ICAgQ3VycmVudCBsaW5lIGlzIF9ub3RfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRs eS4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzJfcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3Jv bGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA9PSAwCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgIT0gdy0+aHNjcm9sbCk7CisgIC8qIEVYQU1Q TEU6ICAoc2Nyb2xsLWxlZnQgNSk7IGFuZCwgdGhlbiBwcmVzcyB0aGUgbGVmdCBhcnJvdyBrZXkg b25lIHRpbWUuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkg c2Nyb2xsZWQgZGlmZmVyZW50bHkuKi8KKyAgYm9vbCBoc2NsX3RlbXBfcCA9ICghdy0+c3VzcGVu ZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9k ZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMtdSBD LXggPCBhbmQgZG8gc29tZXRoaW5nIHRoYXQgY2F1c2VzIHRoZSBjdXJyZW50IGxpbmUgdG8gYmUK KyAgICAgICAgICAgICAgIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4KKyAgICAg ICAgICAgICAgIEN1cnJlbnQgbGluZSBfaXNfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJl bnRseS4gKi8KKyAgYm9vbCBoc2NsX3Blc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wgaW50ZXJuICgiKy1vdmVybGF5LWFy cm93LWluYWN0aXZlLWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgIDogKGFjdGl2ZV9wKQorICAg ICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXkt YXJyb3ctZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAg ICAgICAgbWNfbGVmdF9mcmluZ2VfZmFjZV9pZCA9IChjdXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZS SU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IG92ZXJs YXlfYXJyb3dfZmFjZV9pZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBE RUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgaWYgKHctPmhzY3JvbGwgIT0gMCkKKyAgICAgICAg ICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1v dmVybGF5LWFycm93IiksIGZhbHNlLCB0cnVlKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIr LW92ZXJsYXktYXJyb3ciKSwgdHJ1ZSwgdHJ1ZSk7CisgICAgICAgICAgbWNfbGVmdF9mcmluZ2Vf Yml0bWFwID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBmcmluZ2VfYml0bWFwCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgfQor ICAgICAgICBlbHNlIGlmICgodnBvcyA9PSB2cG9zX2Rlc2lyZWQgfHwgdnBvcyA9PSB2cG9zX2N1 cnJlbnQpCisgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciA9PSBNQ19PVkVSTEFZX0FS Uk9XX0JJVE1BUAorICAgICAgICAgICAgICAgICAmJiAoaHNjbF9hbGxfdGVtcF9wCisgICAgICAg ICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzBfcAorICAgICAgICAgICAgICAgICAgICAg fHwgaHNjbF9hbGxfcGVybV8xX3AKKyAgICAgICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxsX3Bl cm1fMl9wCisgICAgICAgICAgICAgICAgICAgICB8fCBoc2NsX3RlbXBfcAorICAgICAgICAgICAg ICAgICAgICAgfHwgaHNjbF9wZXJtX3ApCisgICAgICAgICAgICAgICAgICYmIGVuYWJsZWRfcCkK KyAgICAgICAgICB7CisgICAgICAgICAgICBpbnQgZnJpbmdlX2JpdG1hcCA9IE1DX05PX0ZSSU5H RV9CSVRNQVA7CisgICAgICAgICAgICBlbnVtIGZhY2VfaWQgb3ZlcmxheV9hcnJvd19mYWNlX2lk ID0KKyAgICAgICAgICAgICAgKCFhY3RpdmVfcAorICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaW5hY3RpdmVfd2luZG93cykpKQorICAgICAg ICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJy b3ctaHNjbC1pbmFjdGl2ZS1mYWNlIiksIHRydWUpCisgICAgICAgICAgICAgIDogKGFjdGl2ZV9w KQorICAgICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIist b3ZlcmxheS1hcnJvdy1oc2NsLWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgOiBERUZBVUxU X0ZBQ0VfSUQ7CisgICAgICAgICAgICBtY19sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gKGN1cnNvcl90 eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBvdmVybGF5X2Fycm93X2ZhY2VfaWQKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgICBpZiAoaHNj bF9hbGxfcGVybV8wX3ApCisgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJp bmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgZmFsc2UsIGZhbHNlKTsKKyAg ICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF9hbGxfcGVybV8xX3ApCisgICAgICAgICAgICAgICAg ZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wt cGVybSIpLCB0cnVlLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF9hbGxf cGVybV8yX3ApCisgICAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5n ZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIGZhbHNlLCB0cnVlKTsKKyAgICAg ICAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xfcGVybV9wKQorICAgICAgICAgICAgICAgICAgICBm cmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC1w ZXJtIiksIHRydWUsIHRydWUpOworICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX2Fs bF90ZW1wX3ApCisgICAgICAgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9m cmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtdGVtcCIpLCBmYWxzZSwgZmFsc2UpOwor ICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xfdGVtcF9wKQorICAgICAgICAgICAg ICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRl cm4gKCIrLWhzY2wtdGVtcCIpLCB0cnVlLCBmYWxzZSk7CisgICAgICAgICAgICBtY19sZWZ0X2Zy aW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAg ICAgICAgICB9CisgICAgICAgICAgZWxzZSBpZiAoKHZwb3MgPT0gdnBvc19kZXNpcmVkIHx8IHZw b3MgPT0gdnBvc19jdXJyZW50KQorICAgICAgICAgICAgICAgICAgICAmJiAoZ2x5cGhfZmxhdm9y ID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAg ICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hU X0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfSE9M TE9XX1JFQ1RBTkdMRQorICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09 IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgfHwg Z2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAg ICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUgor ICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZF UlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1D X1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gpCisgICAgICAgICAgICAgICAgICAgICYmIGVuYWJsZWRf cCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgTGlzcF9PYmplY3QgYml0bWFwX2ZsYXZv ciA9IChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVykKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hvbGxvd19yZWN0 YW5nbGVfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hU X0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFt Y19yZXZlcnNlZF9ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JF Q1RBTkdMRSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBR bWNfaG9sbG93X3JlY3RhbmdsZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVykKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxf YmFyX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9X KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19yZXZl cnNlZF92ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jh cgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxh dm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxfYmFyCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNf VkVSVElDQUxfQkFSX0JBQ0tTTEFTSCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyX2JhY2tzbGFzaAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBRbmlsOworICAgICAgICAgICAgICBtY19yaWdo dF9mcmluZ2VfYml0bWFwID0gKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBsb29rdXBfZnJpbmdl X2JpdG1hcCAoYml0bWFwX2ZsYXZvcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgICAgICAgIG1jX3JpZ2h0X2Zy aW5nZV9mYWNlX2lkID0KKyAgICAgICAgICAgICAgICAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRf RlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAmJiAoZ2x5cGhfZmxhdm9yID09IE1DX1JF VkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAg IHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cK KyAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJU SUNBTF9CQVIpKQorICAgICAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwg aW50ZXJuICgiKy1yZXZlcnNlZC12ZXJ0aWNhbC1iYXItZmFjZSIpLCB0cnVlKQorICAgICAgICAg ICAgICAgIDogKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAg ICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdM RV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19S RVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAmJiBn bHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAg ICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy12ZXJ0aWNhbC1iYXItZmFj ZSIpLCB0cnVlKQorICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAg ICAgfQorICAgICAgICB9CisgICAgICBpZiAoIXJvdy0+ZW5hYmxlZF9wKQorICAgICAgICByb3cg PSBjdXI7CisgICAgICBsZWZ0X2ZhY2VfaWQgPSByaWdodF9mYWNlX2lkID0gREVGQVVMVF9GQUNF X0lEOworICAgICAgbGVmdF9vZmZzZXQgPSByaWdodF9vZmZzZXQgPSAwOworICAgICAgcGVyaW9k aWNfcCA9IDA7CisgICAgICAvKiBEZWNpZGUgd2hpY2ggYml0bWFwIHRvIGRyYXcgaW4gdGhlIGxl ZnQgZnJpbmdlLiAgKi8KKyAgICAgIGlmIChXSU5ET1dfTEVGVF9GUklOR0VfV0lEVEggKHcpID09 IDApCisgICAgICAgIGxlZnQgPSBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgZWxzZSBpZiAo cm93LT5sZWZ0X3VzZXJfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAg ICAgICB7CisgICAgICAgICAgbGVmdCA9IHJvdy0+bGVmdF91c2VyX2ZyaW5nZV9iaXRtYXA7Cisg ICAgICAgICAgbGVmdF9mYWNlX2lkID0gcm93LT5sZWZ0X3VzZXJfZnJpbmdlX2ZhY2VfaWQ7Cisg ICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKCghcm93LT5yZXZlcnNlZF9wICYmIHJvdy0+dHJ1bmNh dGVkX29uX2xlZnRfcCkKKyAgICAgICAgICAgICAgIHx8IChyb3ctPnJldmVyc2VkX3AgJiYgcm93 LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkpCisgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAo MCwgUXRydW5jYXRpb24sIDApOworICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9ib2JfcCAm JiBFUSAoYm91bmRhcnlfdG9wLCBRbGVmdCkpCisgICAgICAgIHsKKyAgICAgICAgICBsZWZ0ID0g KChyb3ctPmluZGljYXRlX2VvYl9wICYmIEVRIChib3VuZGFyeV9ib3QsIFFsZWZ0KSkKKyAgICAg ICAgICAgICAgICAgPyBNQ19MRUZUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20sIHRvcF9yb3dfZW5k c19hdF96dl9wKQorICAgICAgICAgICAgICAgICA6IE1DX0xFRlRfRlJJTkdFICgyLCBRdG9wLCAw KSk7CisgICAgICAgICAgaWYgKHRvcF9pbmRfbWluX3kgPj0gMCkKKyAgICAgICAgICAgIGxlZnRf b2Zmc2V0ID0gdG9wX2luZF9taW5feSAtIHJvdy0+eTsKKyAgICAgICAgfQorICAgICAgZWxzZSBp ZiAocm93LT5pbmRpY2F0ZV9lb2JfcCAmJiBFUSAoYm91bmRhcnlfYm90LCBRbGVmdCkpCisgICAg ICAgIHsKKyAgICAgICAgICBsZWZ0ID0gTUNfTEVGVF9GUklOR0UgKDMsIFFib3R0b20sIGJvdF9y b3dfZW5kc19hdF96dl9wKTsKKyAgICAgICAgICBpZiAoYm90X2luZF9tYXhfeSA+PSAwKQorICAg ICAgICAgICAgbGVmdF9vZmZzZXQgPSBib3RfaW5kX21heF95IC0gKHJvdy0+eSArIHJvdy0+dmlz aWJsZV9oZWlnaHQpOworICAgICAgICB9CisgICAgICBlbHNlIGlmICgoIXJvdy0+cmV2ZXJzZWRf cCAmJiBNQVRSSVhfUk9XX0NPTlRJTlVBVElPTl9MSU5FX1AgKHJvdykpCisgICAgICAgICAgICAg ICB8fCAocm93LT5yZXZlcnNlZF9wICYmIHJvdy0+Y29udGludWVkX3ApKQorICAgICAgICBsZWZ0 ID0gTUNfTEVGVF9GUklOR0UgKDQsIFFjb250aW51YXRpb24sIDApOworICAgICAgZWxzZSBpZiAo cm93LT5pbmRpY2F0ZV9lbXB0eV9saW5lX3AgJiYgRVEgKGVtcHR5X3BvcywgUWxlZnQpKQorICAg ICAgICBsZWZ0ID0gTUNfTEVG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ICAg ICAgcmlnaHRfZmFjZV9pZCA9IHJvdy0+cmlnaHRfdXNlcl9mcmluZ2VfZmFjZV9pZDsKKyAgICAg ICAgfQorICAgICAgZWxzZSBpZiAoKCFyb3ctPnJldmVyc2VkX3AgJiYgcm93LT50cnVuY2F0ZWRf b25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgIHx8IChyb3ctPnJldmVyc2VkX3AgJiYgcm93LT50 cnVuY2F0ZWRfb25fbGVmdF9wKSkKKyAgICAgICAgcmlnaHQgPSBNQ19SSUdIVF9GUklOR0UgKDAs IFF0cnVuY2F0aW9uLCAwKTsKKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfYm9iX3AgJiYg RVEgKGJvdW5kYXJ5X3RvcCwgUXJpZ2h0KSkKKyAgICAgICAgeworICAgICAgICAgIHJpZ2h0ID0g KChyb3ctPmluZGljYXRlX2VvYl9wICYmIEVRIChib3VuZGFyeV9ib3QsIFFyaWdodCkpCisgICAg ICAgICAgICAgPyBNQ19SSUdIVF9GUklOR0UgKDEsIFF0b3BfYm90dG9tLCB0b3Bfcm93X2VuZHNf YXRfenZfcCkKKyAgICAgICAgICAgICA6IE1DX1JJR0hUX0ZSSU5HRSAoMiwgUXRvcCwgMCkpOwor ICAgICAgICAgIGlmICh0b3BfaW5kX21pbl95ID49IDApCisgICAgICAgICAgICByaWdodF9vZmZz ZXQgPSB0b3BfaW5kX21pbl95IC0gcm93LT55OworICAgICAgICB9CisgICAgICBlbHNlIGlmIChy b3ctPmluZGljYXRlX2VvYl9wICYmIEVRIChib3VuZGFyeV9ib3QsIFFyaWdodCkpCisgICAgICAg IHsKKyAgICAgICAgICByaWdodCA9IE1DX1JJR0hUX0ZSSU5HRSAoMywgUWJvdHRvbSwgYm90X3Jv d19lbmRzX2F0X3p2X3ApOworICAgICAgICAgIGlmIChib3RfaW5kX21heF95ID49IDApCisgICAg ICAgICAgICByaWdodF9vZmZzZXQgPSBib3RfaW5kX21heF95IC0gKHJvdy0+eSArIHJvdy0+dmlz aWJsZV9oZWlnaHQpOworICAgICAgICB9CisgICAgICBlbHNlIGlmICgoIXJvdy0+cmV2ZXJzZWRf cCAmJiByb3ctPmNvbnRpbnVlZF9wKQorICAgICAgICAgICAgICAgfHwgKHJvdy0+cmV2ZXJzZWRf cCAmJiBNQVRSSVhfUk9XX0NPTlRJTlVBVElPTl9MSU5FX1AgKHJvdykpKQorICAgICAgICByaWdo dCA9IE1DX1JJR0hUX0ZSSU5HRSAoNCwgUWNvbnRpbnVhdGlvbiwgMCk7CisgICAgICBlbHNlIGlm IChyb3ctPmluZGljYXRlX3RvcF9saW5lX3AgJiYgRVEgKGFycm93X3RvcCwgUXJpZ2h0KSkKKyAg ICAgICAgeworICAgICAgICAgIHJpZ2h0ID0gTUNfUklHSFRfRlJJTkdFICg2LCBRdXAsIDApOwor ICAgICAgICAgIGlmICh0b3BfaW5kX21pbl95ID49IDApCisgICAgICAgICAgICByaWdodF9vZmZz ZXQgPSB0b3BfaW5kX21pbl95IC0gcm93LT55OworICAgICAgICB9CisgICAgICBlbHNlIGlmIChy b3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3AgJiYgRVEgKGFycm93X2JvdCwgUXJpZ2h0KSkKKyAg ICAgICAgeworICAgICAgICAgIHJpZ2h0ID0gTUNfUklHSFRfRlJJTkdFICg3LCBRZG93biwgMCk7 CisgICAgICAgICAgaWYgKGJvdF9pbmRfbWF4X3kgPj0gMCkKKyAgICAgICAgICAgIHJpZ2h0X29m ZnNldCA9IGJvdF9pbmRfbWF4X3kgLSAocm93LT55ICsgcm93LT52aXNpYmxlX2hlaWdodCk7Cisg ICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfZW1wdHlfbGluZV9wICYmIEVR IChlbXB0eV9wb3MsIFFyaWdodCkpCisgICAgICAgIHJpZ2h0ID0gTUNfUklHSFRfRlJJTkdFICg1 LCBRZW1wdHlfbGluZSwgMCk7CisgICAgICBlbHNlCisgICAg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lcF9jdXJyZW50 X3ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGN1ci0+cmVkcmF3X2ZyaW5nZV9iaXRt YXBzX3AgPSAxOworICAgICAgICAgICAgICBpZiAobWNfbGVmdF9mcmluZ2VfYml0bWFwICE9IE1D X05PX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgIHx8IG1jX3JpZ2h0X2ZyaW5nZV9i aXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICBjdXItPmZyaW5n ZV9iaXRtYXBfcGVyaW9kaWNfcCA9IGZhbHNlOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgICAgICAgIGN1ci0+ZnJpbmdlX2JpdG1hcF9wZXJpb2RpY19wID0gcGVyaW9kaWNfcDsK KyAgICAgICAgICAgICAgaWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0Vf QklUTUFQKQorICAgICAgICAgICAgICAgIGN1ci0+bGVmdF9mcmluZ2VfYml0bWFwID0gbWNfbGVm dF9mcmluZ2VfYml0bWFwOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAg IGN1ci0+bGVmdF9mcmluZ2VfYml0bWFwID0gbGVmdDsKKyAgICAgICAgICAgICAgaWYgKG1jX2xl ZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAg IGN1ci0+bGVmdF9mcmluZ2VfZmFjZV9pZCA9IG1jX2xlZnRfZnJpbmdlX2ZhY2VfaWQ7CisgICAg ICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgY3VyLT5sZWZ0X2ZyaW5nZV9mYWNl X2lkID0gbGVmdF9mYWNlX2lkOworICAgICAgICAgICAgICBpZiAobWNfbGVmdF9mcmluZ2VfYml0 bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgY3VyLT5sZWZ0X2Zy aW5nZV9vZmZzZXQgPSAwOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAg IGN1ci0+bGVmdF9mcmluZ2Vfb2Zmc2V0ID0gbGVmdF9vZmZzZXQ7CisgICAgICAgICAgICAgIGlm IChtY19yaWdodF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAg ICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2VfYml0bWFwID0gbWNfcmlnaHRfZnJpbmdlX2JpdG1h cDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPnJpZ2h0X2Zy aW5nZV9iaXRtYXAgPSByaWdodDsKKyAgICAgICAgICAgICAgaWYgKG1jX3JpZ2h0X2ZyaW5nZV9i aXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICBjdXItPnJpZ2h0 X2ZyaW5nZV9mYWNlX2lkID0gbWNfcmlnaHRfZnJpbmdlX2ZhY2VfaWQ7CisgICAgICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2VfZmFjZV9pZCA9IHJp Z2h0X2ZhY2VfaWQ7CisgICAgICAgICAgICAgIGlmIChtY19yaWdodF9mcmluZ2VfYml0bWFwICE9 IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2Vf b2Zmc2V0ID0gMDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXIt PnJpZ2h0X2ZyaW5nZV9vZmZzZXQgPSByaWdodF9vZmZzZXQ7CisgICAgICAgICAgICB9CisgICAg ICAgIH0KKyAgICAgIGlmIChyb3ctPm92ZXJsYXlfYXJyb3dfYml0bWFwIDwgMCkKKyAgICAgICAg cm93LT5vdmVybGF5X2Fycm93X2JpdG1hcCA9IG1jX2dldF9sb2dpY2FsX2ZyaW5nZV9iaXRtYXAg KHcsIFFvdmVybGF5X2Fycm93LCAwLCAwKTsKKyAgICAgIGlmIChyb3ctPm92ZXJsYXlfYXJyb3df Yml0bWFwICE9IGN1ci0+b3ZlcmxheV9hcnJvd19iaXRtYXApCisgICAgICAgIHsKKyAgICAgICAg ICByZWRyYXdfcCA9IDEsIHJvdy0+cmVkcmF3X2ZyaW5nZV9iaXRtYXBzX3AgPSAxOworICAgICAg ICAgIGlmICgha2VlcF9jdXJyZW50X3ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGN1 ci0+cmVkcmF3X2ZyaW5nZV9iaXRtYXBzX3AgPSAxOworICAgICAgICAgICAgICBjdXItPm92ZXJs YXlfYXJyb3dfYml0bWFwID0gcm93LT5vdmVybGF5X2Fycm93X2JpdG1hcDsKKyAgICAgICAgICAg IH0KKyAgICAgICAgfQorICAgICAgaWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19G UklOR0VfQklUTUFQCisgICAgICAgICAgfHwgbWNfcmlnaHRfZnJpbmdlX2JpdG1hcCAhPSBNQ19O T19GUklOR0VfQklUTUFQKQorICAgICAgICByb3ctPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcCA9 IGZhbHNlOworICAgICAgICBlbHNlCisgICAgICAgICAgcm93LT5mcmluZ2VfYml0bWFwX3Blcmlv ZGljX3AgPSBwZXJpb2RpY19wOworICAgICAgaWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBN Q19OT19GUklOR0VfQklUTUFQKQorICAgICAgICByb3ctPmxlZnRfZnJpbmdlX2JpdG1hcCA9IG1j X2xlZnRfZnJpbmdlX2JpdG1hcDsKKyAgICAgICAgZWxzZQorICAgICAgICAgIHJvdy0+bGVmdF9m cmluZ2VfYml0bWFwID0gbGVmdDsKKyAgICAgIGlmIChtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgIT0g TUNfTk9fRl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IHAuYnggPSAtMTsKKyAgaGVhZGVyX2xpbmVfaGVpZ2h0 ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgIHAuYnkgPSBXSU5ET1dfVE9fRlJB TUVfUElYRUxfWSAodywgbWF4IChoZWFkZXJfbGluZV9oZWlnaHQsIHJvdy0+eSkpOworICBwLm55 ID0gcm93LT52aXNpYmxlX2hlaWdodDsKKyAgaWYgKGxlZnRfcCkKKyAgICB7CisgICAgICBpbnQg d2QgPSBXSU5ET1dfTEVGVF9GUklOR0VfV0lEVEggKHcpOworICAgICAgaW50IHggPSB3aW5kb3df Ym94X2xlZnQgKHcsIChXSU5ET1dfSEFTX0ZSSU5HRVNfT1VUU0lERV9NQVJHSU5TICh3KQorICAg ICAgICAgICA/IExFRlRfTUFSR0lOX0FSRUEKKyAgICAgICAgICAgOiBURVhUX0FSRUEpKTsKKyAg ICAgIGlmIChwLndkID4gd2QpCisgICAgICAgIHAud2QgPSB3ZDsKKyAgICAgIHAueCA9IHggLSBw LndkIC0gKHdkIC0gcC53ZCkgLyAyOworICAgICAgaWYgKHAud2QgPCB3ZCB8fCBwLnkgPiBwLmJ5 IHx8IHAueSArIHAuaCA8IHAuYnkgKyBwLm55KQorICAgICAgICB7CisgICAgICAgICAgLyogSWYg VyBoYXMgYSB2ZXJ0aWNhbCBib3JkZXIgdG8gaXRzIGxlZnQsIGRvbid0IGRyYXcgb3ZlciBpdC4g ICovCisgICAgICAgICAgd2QgLT0gKCghV0lORE9XX0xFRlRNT1NUX1AgKHcpCisgICAgICAgICAg ICAvKiBUaGlzIGNvdWxkIGJlIHdyb25nIHdoZW4gd2UgYWxsb3cgd2luZG93IGxvY2FsCisgICAg ICAgICAgICAgICByaWdodCBkaXZpZGVycyAtIGJ1dCB0aGUgd2luZG93IG9uIHRoZSBsZWZ0IGlz IGhhcmQKKyAgICAgICAgICAgICAgIHRvIGdldC4gICovCisgICAgICAgICAgICAmJiAhRlJBTUVf UklHSFRfRElWSURFUl9XSURUSCAoZikKKyAgICAgICAgICAgICYmICFXSU5ET1dfSEFTX1ZFUlRJ Q0FMX1NDUk9MTF9CQVIgKHcpCisgICAgICAgICAgICAvKiBCdXQgZG9uJ3QgcmVkdWNlIHRoZSBm cmluZ2Ugd2lkdGggaWYgdGhlIHdpbmRvdworICAgICAgICAgICAgICAgaGFzIGEgbGVmdCBtYXJn aW4sIGJlY2F1c2UgdGhhdCBtZWFucyB3ZSBhcmUgbm90CisgICAgICAgICAgICAgICBpbiBkYW5n ZXIgb2YgZHJhd2luZyBvdmVyIHRoZSB2ZXJ0aWNhbCBib3JkZXIsCisgICAgICAgICAgICAgICBh bmQgT1RPSCBsZWF2aW5nIG91dCB0aGF0IG9uZSBwaXhlbCBsZWF2ZXMgYmVoaW5kCisgICAgICAg ICAgICAgICB0cmFjZXMgb2YgdGhlIGN1cnNvciwgaWYgaXQgd2FzIGluIGNvbHVtbiB6ZXJvCisg ICAgICAgICAgICAgICBiZWZvcmUgZHJhd2luZyBub24tZW1wdHkgbWFyZ2luIGFyZWEuICAqLwor ICAgICAgICAgICAgJiYgdy0+bGVmdF9tYXJnaW5fY29scyA9PSAwKQorICAgICAgICAgICA/IDEg OiAwKTsKKyAgICAgICAgICBwLmJ4ID0geCAtIHdkOworICAgICAgICAgIHAubnggPSB3ZDsKKyAg ICAgICAgfQorICAgIH0KKyAgZWxzZQorICAgIHsKKyAgICAgIGludCB4ID0gd2luZG93X2JveF9y aWdodCAodywKKyAgICAgICAgKFdJTkRPV19IQVNfRlJJTkdFU19PVVRTSURFX01BUkdJTlMgKHcp CisgICAgICAgICA/IFJJR0hUX01BUkdJTl9BUkVBCisgICAgICAgICA6IFRFWFRfQVJFQSkpOwor ICAgICAgaW50IHdkID0gV0lORE9XX1JJR0hUX0ZSSU5HRV9XSURUSCAodyk7CisgICAgICBpZiAo cC53ZCA+IHdkKQorICAgICAgICBwLndkID0gd2Q7CisgICAgICBwLnggPSB4ICsgKHdkIC0gcC53 ZCkgLyAyOworICAgICAgLyogQ2xlYXIgcmlnaHQgZnJpbmdlIGlmIG5vIGJpdG1hcCB0byBkcmF3 IG9mIGlmIGJpdG1hcCBkb2Vzbid0IGZpbGwKKyAgIHRoZSBmcmluZ2UuICAqLworICAgICAgaWYg KHAud2QgPCB3ZCB8fCBwLnkgPiBwLmJ5IHx8IHAueSArIHAuaCA8IHAuYnkgKyBwLm55KQorICAg ICAgICB7CisgICAgICAgICAgcC5ieCA9IHg7CisgICAgICAgICAgcC5ueCA9IHdkOworICAgICAg ICB9CisgICAgfQorICBpZiAocC54ID49IFdJTkRPV19CT1hfTEVGVF9FREdFX1ggKHcpCisgICAg ICAmJiAocC54ICsgcC53ZCkgPD0gV0lORE9XX0JPWF9MRUZUX0VER0VfWCAodykgKyBXSU5ET1df UElYRUxfV0lEVEggKHcpKQorICAgIEZSQU1FX1JJRiAoZiktPmRyYXdfZnJpbmdlX2JpdG1hcCAo dywgcm93LCAmcCk7Cit9CisKK3ZvaWQKK21jX2RyYXdfZnJpbmdlX2JpdG1hcCAoc3RydWN0IHdp bmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqcm93LCBpbnQgbGVmdF9wLCBlbnVtIG1jX2N1cnNv cl90eXBlIGN1cnNvcl90eXBlKQoreworICBpbnQgb3ZlcmxheSA9IDA7CisgIGlmIChsZWZ0X3Ag PT0gcm93LT5yZXZlcnNlZF9wICYmIHJvdy0+Y3Vyc29yX2luX2ZyaW5nZV9wKQorICAgIHsKKyAg ICAgIExpc3BfT2JqZWN0IGN1cnNvciA9IFFuaWw7CisgICAgICBzd2l0Y2ggKGN1cnNvcl90eXBl KQorICAgICAgICB7CisgICAgICAgIGNhc2UgTUNfRlJBTUVEX0JPWDoKKyAgICAgICAgICBpZiAo cm93LT52aXNpYmxlX2hlaWdodCA+PSBTVEFOREFSRF9CSVRNQVBfSEVJR0hUIChob2xsb3dfcmVj dGFuZ2xlX2JpdHMpKQorICAgICAgICAgICAgY3Vyc29yID0gUWhvbGxvdzsKKyAgICAgICAgICBl bHNlCisgICAgICAgICAgICBjdXJzb3IgPSBRaG9sbG93X3NtYWxsOworICAgICAgICAgIGJyZWFr OworICAgICAgICBjYXNlIE1DX0hPTExPV19CT1g6CisgICAgICAgICAgaWYgKHJvdy0+dmlzaWJs ZV9oZWlnaHQgPj0gU1RBTkRBUkRfQklUTUFQX0hFSUdIVCAoaG9sbG93X3JlY3RhbmdsZV9iaXRz KSkKKyAgICAgICAgICAgIGN1cnNvciA9IFFob2xsb3c7CisgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgY3Vyc29yID0gUWhvbGxvd19zbWFsbDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAg Y2FzZSBNQ19GSUxMRURfQk9YOgorICAgICAgICAgIGN1cnNvciA9IFFib3g7CisgICAgICAgICAg YnJlYWs7CisgICAgICAgIGNhc2UgTUNfQkFSOgorICAgICAgICAgIGN1cnNvciA9IFFiYXI7Cisg ICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTUNfSEJBUjoKKyAgICAgICAgICBjdXJzb3Ig PSBRaGJhcjsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19OT19GUklOR0VfQklU TUFQOgorICAgICAgICBjYXNlIE1DX05PX0NVUlNPUjoKKyAgICAgICAgY2FzZSBNQ19SSUdIVF9G UklOR0VfQklUTUFQOgorICAgICAgICBjYXNlIE1DX0xFRlRfRlJJTkdFX0JJVE1BUDoKKyAgICAg ICAgZGVmYXVsdDoKKyAgICAgICAgICB3LT5waHlzX2N1cnNvcl9vbl9wID0gMDsKKyAgICAgICAg ICByb3ctPmN1cnNvcl9pbl9mcmluZ2VfcCA9IDA7CisgICAgICAgICAgYnJlYWs7CisgICAgICAg IH0KKyAgICAgIGlmICghTklMUCAoY3Vyc29yKSkKKyAgICAgICAgeworICAgICAgICAgIGludCBi bSA9IG1jX2dldF9sb2dpY2FsX2N1cnNvcl9iaXRtYXAgKHcsIGN1cnNvcik7CisgICAgICAgICAg aWYgKGJtICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcF8xICh3LCByb3csIGxlZnRfcCwgMiwgYm0pOworICAg ICAgICAgICAgICBvdmVybGF5ID0gRVEgKGN1cnNvciwgUWJveCkgPyAzIDogMTsKKyAgICAgICAg ICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgbWNfZHJhd19mcmluZ2VfYml0bWFwXzEgKHcsIHJv dywgbGVmdF9wLCBvdmVybGF5LCBNQ19OT19GUklOR0VfQklUTUFQKTsKKyAgaWYgKGxlZnRfcCAm JiByb3ctPm92ZXJsYXlfYXJyb3dfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAg bWNfZHJhd19mcmluZ2VfYml0bWFwXzEgKHcsIHJvdywgMSwgMSwgcm93LT5vdmVybGF5X2Fycm93 X2JpdG1hcCk7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKworCiAjZGVmaW5lIE5PX0ZSSU5HRV9CSVRNQVAgMAogI2RlZmluZSBVTkRF Rl9GUklOR0VfQklUTUFQIDEKICNkZWZpbmUgTUFYX1NUQU5EQVJEX0ZSSU5HRV9CSVRNQVBTIEFS UkFZRUxUUyAoc3RhbmRhcmRfYml0bWFwcykKQEAgLTE3MDAsNiArMzE5NSwxNjggQEAgUmV0dXJu IG5pbCBpZiBQT1MgaXMgbm90IHZpc2libGUgaW4gV0lORE9XLiAgKi8pCiB2b2lkCiBzeW1zX29m X2ZyaW5nZSAodm9pZCkKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2l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lX2Rvd24sIFFmcmlu Z2UsIG1ha2VfZml4bnVtICg0OCkpOworICAvKiAoZ2V0ICcrLXF1YWRydXBsZS1hbmdsZS1kb3du ICdmcmluZ2UpID0+IDQ4ICovCisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKworCiAgIERFRlNZTSAoUXRydW5jYXRpb24sICJ0cnVuY2F0aW9u Iik7CiAgIERFRlNZTSAoUWNvbnRpbnVhdGlvbiwgImNvbnRpbnVhdGlvbiIpOwogICBERUZTWU0g KFFvdmVybGF5X2Fycm93LCAib3ZlcmxheS1hcnJvdyIpOwpkaWZmIC0tZ2l0IGEvc3JjL25zdGVy bS5oIGIvc3JjL25zdGVybS5oCmluZGV4IDc4Y2U2MDguLjhlZjBkZmUgMTAwNjQ0Ci0tLSBhL3Ny Yy9uc3Rlcm0uaAorKysgYi9zcmMvbnN0ZXJtLmgKQEAgLTY2MCw2ICs2NjAsMTYgQEAgdHlwZWRl ZiBpZCBpbnN0YW5jZXR5cGU7CiAKIEBpbnRlcmZhY2UgRW1hY3NTY3JvbGxlciA6IE5TU2Nyb2xs ZXIKICAgeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09S UyAqLworCisgICAgTlNSZWN0IG1jX3JlY3RhbmdsZTsKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogICAgc3RydWN0IHdpbmRvdyAqd2luZG93OwogICAgc3RydWN0IGZyYW1lICpmcmFt ZTsKICAgIE5TUmVzcG9uZGVyICpwcmV2UmVzcG9uZGVyOwpAQCAtNjgwLDYgKzY5MCwxOCBAQCB0 eXBlZGVmIGlkIGluc3RhbmNldHlwZTsKICAgIGludCBlbV93aG9sZTsKICAgIH0KIAorCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLSAodm9pZClt Y19zZXRfcmVjdGFuZ2xlOiAoTlNSZWN0KXJlY3Q7CistIChOU1JlY3QpbWNfZ2V0X3JlY3Rhbmds ZTsKKy0gKHN0cnVjdCB3aW5kb3cgKiltY19nZXRfd2luZG93OworLSAoYm9vbCltY19qdWRnZTsK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogLSAoaW5zdGFuY2V0eXBlKSBpbml0RnJh bWU6IChOU1JlY3QgKXIgd2luZG93OiAoTGlzcF9PYmplY3Qpd2luOwogLSAodm9pZClzZXRGcmFt ZTogKE5TUmVjdClyOwogCmRpZmYgLS1naXQgYS9zcmMvbnN0ZXJtLm0gYi9zcmMvbnN0ZXJtLm0K aW5kZXggODFkMzZiZS4uZDY4OTA5OCAxMDA2NDQKLS0tIGEvc3JjL25zdGVybS5tCisrKyBiL3Ny Yy9uc3Rlcm0ubQpAQCAtNzYsNiArNzYsMTA2MSBAQCBVcGRhdGVkIGJ5IENocmlzdGlhbiBMaW1w YWNoIChjaHJpc0BuaWNlLmNoKQogc3RhdGljIEVtYWNzTWVudSAqbWFpbk1lbnU7CiAjZW5kaWYK IAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExFLUNVUlNPUlMg Ki8KKworc3RhdGljIHZvaWQgbnNfcmVzZXRfY2xpcHBpbmcgKHN0cnVjdCBmcmFtZSAqKTsKK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FDRV9SRUNUICgiciIs ICpyKTsKKyAgICAgIGlmIChbTlNWaWV3IGZvY3VzVmlld10gPT0gRlJBTUVfTlNfVklFVyAoZikp CisgICAgICAgIHsKKyAgICAgICAgICBbW05TR3JhcGhpY3NDb250ZXh0IGN1cnJlbnRDb250ZXh0 XSBzYXZlR3JhcGhpY3NTdGF0ZV07CisgICAgICAgICAgaWYgKG4gPT0gMikKKyAgICAgICAgICAg IE5TUmVjdENsaXBMaXN0IChyLCAyKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgIC8qIEZJWE1FOiAgVGhpcyBpcyBub3Qgd29ya2luZyB3aXRoIHBh dGNoIHZlcnNpb24gMDIwLjAwMC4gKi8KKyAgICAgICAgICAgICAgICAvLyAgaWYgKHJvdy0+Y2xp cCAhPSBOVUxMKQorICAgICAgICAgICAgICAgIC8vICAgIHsKKyAgICAgICAgICAgICAgICAvLyAg ICAgIE5TUmVjdCByX2NsaXA7CisgICAgICAgICAgICAgICAgLy8gICAgICByX2NsaXAub3JpZ2lu LnggPSByb3ctPmNsaXAtPng7CisgICAgICAgICAgICAgICAgLy8gICAgICByX2NsaXAub3JpZ2lu LnkgPSByb3ctPmNsaXAtPnk7CisgICAgICAgICAgICAgICAgLy8gICAgICByX2NsaXAuc2l6ZS53 aWR0aCA9IHJvdy0+Y2xpcC0+d2lkdGg7CisgICAgICAgICAgICAgICAgLy8gICAgICByX2NsaXAu c2l6ZS5oZWlnaHQgPSByb3ctPmNsaXAtPmhlaWdodDsKKyAgICAgICAgICAgICAgICAvLyAgICAg IE5TUmVjdCByX3NhdmU7CisgICAgICAgICAgICAgICAgLy8gICAgICByX3NhdmUub3JpZ2luLngg PSByWzBdLm9yaWdpbi54OworICAgICAgICAgICAgICAgIC8vICAgICAgcl9zYXZlLm9yaWdpbi55 ID0gclswXS5vcmlnaW4ueTsKKyAgICAgICAgICAgICAgICAvLyAgICAgIHJfc2F2ZS5zaXplLndp ZHRoID0gclswXS5zaXplLndpZHRoOworICAgICAgICAgICAgICAgIC8vICAgICAgcl9zYXZlLnNp emUuaGVpZ2h0ID0gclswXS5zaXplLmhlaWdodDsKKyAgICAgICAgICAgICAgICAvLyAgICAgIG1j X25zX2ludGVyc2VjdF9yZWN0YW5nbGVzICgmcl9zYXZlLCAmcl9jbGlwLCAmclswXSk7CisgICAg ICAgICAgICAgICAgLy8gICAgfQorICAgICAgICAgICAgICAgIE5TUmVjdENsaXAgKCpyKTsKKyAg ICAgICAgICAgICAgfQorICAgICAgICAgIHJldHVybiBZRVM7CisgICAgICAgIH0KKyAgICAgIGVs c2UKKyAgICAgICAgeworICAgICAgICAgIE5TVmlldyAqdmlldyA9IEZSQU1FX05TX1ZJRVcgKGYp OworICAgICAgICAgIGludCBpOworICAgICAgICAgIGZvciAoaSA9IDAgOyBpIDwgbiA7IGkrKykK KyAgICAgICAgICAgIFt2aWV3IHNldE5lZWRzRGlzcGxheUluUmVjdDpyW2ldXTsKKyAgICAgICAg fQorICAgIH0KKyAgcmV0dXJuIE5POworfQorCitzdGF0aWMgdm9pZAorbWNfbnNfZHJhd193aW5k b3dfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgs IHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKKyAgICAgICAgICAgICAgICAgIGludCB4LCBpbnQgZngs IGludCB5LCBpbnQgZnksIGludCBocG9zLCBpbnQgdnBvcywgaW50IHdkLCBpbnQgaCwKKyAgICAg ICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsLCBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNv cl90eXBlLAorICAgICAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aCwgZW51bSBtY19mbGF2 b3IgZ2x5cGhfZmxhdm9yLCBib29sIG9uX3AsIGJvb2wgYWN0aXZlX3ApCit7CisgIC8qIFRoZSBw cmlvciBidWcgb2YgYSBk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SU5ERVhdOworICAg ICBmcHJpbnRmIChzdGRlcnIsICJcbmZvcmVncm91bmQgKCVzKSB8IGJhY2tncm91bmQgKCVzKVxu IiwKKyAgICAgICAgICAgICAgICAgICAgICAoIU5JTFAgKGZvcmVncm91bmQpID8gU1NEQVRBIChm b3JlZ3JvdW5kKSA6ICJOSUxQIiksCisgICAgICAgICAgICAgICAgICAgICAgKCFOSUxQIChiYWNr Z3JvdW5kKSA/IFNTREFUQSAoYmFja2dyb3VuZCkgOiAiTklMUCIpKTsKKyAgLSAgRVhBTVBMRSBP RiBIT1cgVE8gQ1JFQVRFIEEgQ09MT1IgV0lUSCBSR0IvTFNMIGZsb2F0IHZhbHVlczoKKyAgICAg TlNDb2xvciAqbXlfY29sb3IgPSBbTlNDb2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiAxLjAK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdyZWVu OiAxLjAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBibHVlOiAxLjAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGFscGhhOiAxLjBdOworICAtICBBTFRFUk5BVElWRSBFWEFNUExFOgorICAgICBlbnVt IGZhY2VfaWQgZGVidWdnaW5nX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ ZiwgaW50ZXJuICgiKy1kZWJ1Z2dpbmctZmFjZSIpLCB0cnVlKTsKKyAgICAgc3RydWN0IGZhY2Ug KmRlYnVnZ2luZ19mYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBkZWJ1Z2dpbmdfZmFjZV9pZCk7 CisgICAgIE5TQ29sb3IgKmNvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0Vf Rk9SRUdST1VORCAoZGVidWdnaW5nX2ZhY2UpLCBzLT5mKTsKKyAgICAgW2NvbG9yIHNldF07ICov CisgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEgKKyAgICAgIHx8IGdseXBoX2ZsYXZvciA9 PSBNQ19HTFlQSExFU1MpCisgICAgW1tOU0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6IGxz bC5yZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBncmVlbjogbHNsLmdyZWVuCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJsdWU6IGxzbC5ibHVlCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgYWxwaGE6IDEuMF0gc2V0XTsKKyAgICBlbHNlCisgICAgICBb RlJBTUVfQ1VSU09SX0NPTE9SIChmKSBzZXRdOworICBpZiAoY3Vyc29yX3R5cGUgPT0gTUNfRlJB TUVEX0JPWCkKKyAgICB7CisgICAgICBMaXNwX09iamVjdCBidWYgPSB3LT5jb250ZW50czsKKyAg ICAgIENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgICAgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVS IChidWYpOworICAgICAgYm9vbCByZWdpb25fYWN0aXZlX3AgPSAoIU5JTFAgKFZ0cmFuc2llbnRf bWFya19tb2RlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIg KGIsIG1hcmtfYWN0aXZlKSkpOworICAgICAgcHRyZGlmZl90IHJlZ2lvbl9iZWdpbm5pbmcgPSAo cmVnaW9uX2FjdGl2ZV9wKSA/IFhGSVhOVU0gKEZyZWdpb25fYmVnaW5uaW5nICgpKSA6IC0xOwor ICAgICAgcHRyZGlmZl90IHJlZ2lvbl9lbmQgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IFhGSVhOVU0g KEZyZWdpb25fZW5kICgpKSA6IC0xOworICAgICAgcHRyZGlmZl90IG9wb2ludF9wdCA9ICh3ID09 IFhXSU5ET1cgKHNlbGVjdGVkX3dpbmRvdykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBQVAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogWEZJWE5VTSAoRm1hcmtlcl9wb3Np dGlvbiAody0+cG9pbnRtKSk7CisgICAgICBib29sIHJlZ2lvbl9pbl9ib3VuZHNfcCA9IChyZWdp b25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF9w dCA+PSByZWdpb25fYmVnaW5uaW5nCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvcG9pbnRfcHQgPCByZWdpb25fZW5kKTsKKyAgICAgIGlmIChyZWdpb25fYWN0aXZlX3AKKyAg ICAgICAgICAmJiByZWdpb25faW5fYm91bmRzX3AKKyAgICAgICAgICAmJiBhY3RpdmVfcCkKKyAg ICAgICAgeworICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9mYWNl X2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNv ci1yZWdpb24tZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2Fj dGl2ZV9yZWdpb25fZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2FjdGl2ZV9yZWdpb25f ZmFjZV9pZCk7CisgICAgICAgICAgTlNDb2xvciAqaG9sbG93X2FjdGl2ZV9yZWdpb25fY29sb3Ig PSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5EIChob2xsb3dfYWN0 aXZlX3JlZ2lvbl9mYWNlKSwgZik7CisgICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2Fj dGl2ZV9yZWdpb25fY29sb3I7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAocmVnaW9uX2Fj dGl2ZV9wCisgICAgIC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gKEZSQU1FX0NVUlNPUl9DT0xPUiAoZiksIGYpKQorICAgICAgeworICAgICAg ICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoZmFjZSksIGYp IHNldF07CisgICAgICAgIGhvbGxvd19jb2xvciA9IEZSQU1FX0NVUlNPUl9DT0xPUiAoZik7Cisg ICAgICB9CisjaWZkZWYgTlNfSU1QTF9DT0NPQQorICBOU0Rpc2FibGVTY3JlZW5VcGRhdGVzICgp OworI2VuZGlmCisgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgeworICAgICAgY2FzZSBNQ19O T19GUklOR0VfQklUTUFQOgorICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfTk9fQ1VSU09S OgorICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfUklHSFRfRlJJTkdFX0JJVE1BUDoKKyAg ICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1DX0xFRlRfRlJJTkdFX0JJVE1BUDoKKyAgICAgICAg YnJlYWs7CisgICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAgICAgIE5TUmVjdEZpbGwgKHIp OworICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfRlJBTUVEX0JPWDoKKyAgICAgICAgTlNS ZWN0RmlsbCAocik7CisgICAgICAgIFtob2xsb3dfY29sb3Igc2V0XTsKKyAgICAgICAgTlNSZWN0 RmlsbCAoTlNJbnNldFJlY3QgKHIsIDEsIDEpKTsKKyAgICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xP UiAoZikgc2V0XTsKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1DX0hPTExPV19CT1g6Cisg ICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICBbaG9sbG93X2NvbG9yIHNldF07CisgICAg ICAgIE5TUmVjdEZpbGwgKE5TSW5zZXRSZWN0IChyLCAxLCAxKSk7CisgICAgICAgIFtGUkFNRV9D VVJT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UsIG92ZXJsaW5lLCBhbmQgc3RyaWtlLXRocm91Z2ggb24gZ2x5cGggc3RyaW5nIHMuCisgICAt LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLSAqLworeworICBpZiAocy0+Zm9yX292ZXJsYXBzKQorICAgIHJldHVy bjsKKyAgLyogRG8gdW5kZXJsaW5lLiAqLworICBpZiAoZmFjZS0+dW5kZXJsaW5lX3ApCisgICAg eworICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfV0FWRSkK KyAgICAgICAgeworICAgICAgICAgIGlmIChmYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3ApCisg ICAgICAgICAgICBbZGVmYXVsdENvbCBzZXRdOworICAgICAgICAgICAgZWxzZQorICAgICAgICAg ICAgICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKGZhY2UtPnVuZGVybGluZV9jb2xvciwgcy0+ Zikgc2V0XTsKKyAgICAgICAgICBuc19kcmF3X3VuZGVyd2F2ZSAocywgd2lkdGgsIHgpOworICAg ICAgICB9CisgICAgICAgIGVsc2UgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0Vf VU5ERVJfTElORSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBOU1JlY3QgcjsKKyAgICAgICAg ICAgIHVuc2lnbmVkIGxvbmcgdGhpY2tuZXNzLCBwb3NpdGlvbjsKKyAgICAgICAgICAgIC8qIElm IHRoZSBwcmV2IHdhcyB1bmRlcmxpbmVkLCBtYXRjaCBpdHMgYXBwZWFyYW5jZS4gKi8KKyAgICAg ICAgICAgIGlmIChzLT5wcmV2ICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV9wCisgICAgICAg ICAgICAgICAgJiYgcy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9M SU5FCisgICAgICAgICAgICAgICAgJiYgcy0+cHJldi0+dW5kZXJsaW5lX3RoaWNrbmVzcyA+IDAp CisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB0aGlja25lc3MgPSBzLT5wcmV2LT51 bmRlcmxpbmVfdGhpY2tuZXNzOworICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gcy0+cHJldi0+ dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZm9udCAqZm9udDsK KyAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZGVzY2VudDsKKyAgICAgICAgICAgICAg ICAgIGZvbnQ9cy0+Zm9udDsKKyAgICAgICAgICAgICAgICAgIGRlc2NlbnQgPSBzLT55ICsgcy0+ aGVpZ2h0IC0gcy0+eWJhc2U7CisgICAgICAgICAgICAgICAgICAvKiBVc2UgdW5kZXJsaW5lIHRo aWNrbmVzcyBvZiBmb250LCBkZWZhdWx0aW5nIHRvIDEuICovCisgICAgICAgICAgICAgICAgICB0 aGlja25lc3MgPSAoZm9udCAmJiBmb250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4gMCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gZm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzcworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAxOworICAgICAgICAgICAgICAgICAgLyogRGV0 ZXJtaW5lIHRoZSBvZmZzZXQgb2YgdW5kZXJsaW5pbmcgZnJvbSB0aGUgYmFzZWxpbmUuICovCisg ICAgICAgICAgICAgICAgICBpZiAoeF91bmRlcmxpbmVfYXRfZGVzY2VudF9saW5lKQorICAgICAg ICAgICAgICAgICAgICBwb3NpdGlvbiA9IGRlc2NlbnQgLSB0aGlja25lc3M7CisgICAgICAgICAg ICAgICAgICAgIGVsc2UgaWYgKHhfdXNlX3VuZGVybGluZV9wb3NpdGlvbl9wcm9wZXJ0aWVzCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGZvbnQgJiYgZm9udC0+dW5kZXJsaW5lX3Bv c2l0aW9uID49IDApCisgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBmb250LT51bmRl cmxpbmVfcG9zaXRpb247CisgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoZm9udCkKKyAg ICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gbHJvdW5kIChmb250LT5kZXNjZW50IC8g Mik7CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAg ICAgIHBvc2l0aW9uID0gdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0OworICAgICAgICAgICAgICAg ICAgcG9zaXRpb24gPSBtYXggKHBvc2l0aW9uLCB1bmRlcmxpbmVfbWluaW11bV9vZmZzZXQpOwor ICAgICAgICAgICAgICAgICAgLyogRW5zdXJlIHVuZGVybGluaW5nIGlzIG5vdCBjcm9wcGVkLiAq LworICAgICAgICAgICAgICAgICAgaWYgKGRlc2NlbnQgPD0gcG9zaXRpb24pCisgICAgICAgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IGRlc2NlbnQgLSAx OworICAgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IDE7CisgICAgICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoZGVzY2VudCA8IHBvc2l0aW9uICsg dGhpY2tuZXNzKQorICAgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IDE7CisgICAgICAg ICAgICAgICAgfQorICAgICAgICAgICAgcy0+dW5kZXJsaW5lX3RoaWNrbmVzcyA9IHRoaWNrbmVz czsKKyAgICAgICAgICAgIHMtPnVuZGVybGluZV9wb3NpdGlvbiA9IHBvc2l0aW9uOworICAgICAg ICAgICAgciA9IE5TTWFrZVJlY3QgKHgsIHMtPnliYXNlICsgcG9zaXRpb24sIHdpZHRoLCB0aGlj a25lc3MpOworICAgICAgICAgICAgaWYgKGZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAg ICAgICAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoZmFjZS0+dW5kZXJsaW5lX2NvbG9y LCBzLT5mKSBzZXRdOworICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAgfQor ICAgIH0KKyAgLyogRG8gb3ZlcmxpbmUuIFdlIGZvbGxvdyBvdGhlciB0ZXJtcyBpbiB1c2luZyBh IHRoaWNrbmVzcyBvZiAxCisgICAgIGFuZCBpZ25vcmluZyBvdmVybGluZV9tYXJnaW4uICovCisg IGlmIChmYWNlLT5vdmVybGluZV9wKQorICAgIHsKKyAgICAgIE5TUmVjdCByOworICAgICAgciA9 IE5TTWFrZVJlY3QgKHgsIHMtPnksIHdpZHRoLCAxKTsKKyAgICAgIGlmIChmYWNlLT5vdmVybGlu ZV9jb2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsKKyAgICAgICAg ZWxzZQorICAgICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoZmFjZS0+b3ZlcmxpbmVf Y29sb3IsIHMtPmYpIHNldF07CisgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICB9CisgIC8qIERv IHN0cmlrZS10aHJvdWdoLiAgV2UgZm9sbG93IG90aGVyIHRlcm1zIGZvciB0aGlja25lc3MgYW5k CisgICAgIHZlcnRpY2FsIHBvc2l0aW9uLiovCisgIGlmIChmYWNlLT5zdHJpa2VfdGhyb3VnaF9w KQorICAgIHsKKyAgICAgIE5TUmVjdCByOworICAgICAgdW5zaWduZWQgbG9uZyBkeTsKKyAgICAg IGR5ID0gbHJpbnQgKChzLT5oZWlnaHQgLSAxKSAvIDIpOworICAgICAgciA9IE5TTWFrZVJlY3Qg KHgsIHMtPnkgKyBkeSwgd2lkdGgsIDEpOworICAgICAgaWYgKGZhY2UtPnN0cmlrZV90aHJvdWdo X2NvbG9yX2RlZmF1bHRlZF9wKQorICAgICAgICBbZGVmYXVsdENvbCBzZXRdOworICAgICAgICBl bHNlCisgICAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChmYWNlLT5zdHJpa2VfdGhy b3VnaF9jb2xvciwgcy0+Zikgc2V0XTsKKyAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgIH0KK30K Kworc3RhdGljIHZvaWQKK21jX25zX2R1bXBnbHlwaHNfc3RyZXRjaCAoc3RydWN0IGdseXBoX3N0 cmluZyAqcywgaW50IHdkLCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cpCit7CisgIE5TUmVjdCByWzJd OworICBpbnQgbiwgaTsKKyAgc3RydWN0IGZhY2UgKmZhY2U7CisgIE5TQ29sb3IgKmZnQ29sLCAq YmdDb2w7CisgIGlmICghcy0+YmFja2dyb3VuZF9maWxsZWRfcCkKKyAgICB7CisgICAgICBuID0g bnNfZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsIHIpOworICAgICAgKnIgPSBOU01ha2VS ZWN0IChzLT54LCBzLT55LCBzLT5iYWNrZ3JvdW5kX3dpZHRoLCBzLT5oZWlnaHQpOworICAgICAg aWYgKCFtY19uc19jbGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4sIHJvdykpCisgICAgICAgIHJldHVy bjsKKyAgICAgIGlmIChzLT5obCA9PSBEUkFXX01PVVNFX0ZBQ0UpCisgICAgICAgIHsKKyAgICAg ICAgICBmYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBNT1VTRV9ITF9JTkZPIChzLT5mKS0+bW91 c2VfZmFjZV9mYWNlX2lkKTsKKyAgICAgICAgICBpZiAoIWZhY2UpCisgICAgICAgICAgICBmYWNl ID0gRkFDRV9GUk9NX0lEIChzLT5mLCBNT1VTRV9GQUNFX0lEKTsKKyAgICAgICAgfQorICAgICAg ICBlbHNlCisgICAgICAgICBmYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBzLT5maXJzdF9nbHlw aC0+ZmFjZV9pZCk7CisgICAgICBiZ0NvbCA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19G QUNFX0JBQ0tHUk9VTkQgKGZhY2UpLCBzLT5mKTsKKyAgICAgIGZnQ29sID0gbnNfbG9va3VwX2lu ZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoZmFjZSksIHMtPmYpOworICAgICAgZm9y IChpID0gMDsgaSA8IG47ICsraSkKKyAgICAgICAgeworICAgICAgICAgIGlmICghcy0+cm93LT5m dWxsX3dpZHRoX3ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGludCBvdmVycnVuLCBs ZWZ0b3ZlcnJ1bjsKKyAgICAgICAgICAgICAgLyogdHJ1bmNhdGUgdG8gYXZvaWQgb3ZlcndyaXRp bmcgZnJpbmdlIGFuZC9vciBzY3JvbGxiYXIgKi8KKyAgICAgICAgICAgICAgb3ZlcnJ1biA9IG1h eCAoMCwgKHMtPnggKyBzLT5iYWNrZ3JvdW5kX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgLSAoV0lORE9XX0JPWF9SSUdIVF9FREdFX1ggKHMtPncpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAtIFdJTkRPV19SSUdIVF9GUklOR0VfV0lEVEggKHMtPncpKSk7 CisgICAgICAgICAgICAgICAgICAgIHJbaV0uc2l6ZS53aWR0aCAtPSBvdmVycnVuOworICAgICAg ICAgICAgICAvKiB0cnVuY2F0ZSB0byBhdm9pZCBvdmVyd3JpdGluZyB0byBsZWZ0IG9mIHRoZSB3 aW5kb3cgYm94ICovCisgICAgICAgICAgICAgIGxlZnRvdmVycnVuID0gKFdJTkRPV19CT1hfTEVG VF9FREdFX1ggKHMtPncpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgV0lORE9XX0xF RlRfRlJJTkdFX1dJRFRIIChzLT53KSkgLSBzLT54OworICAgICAgICAgICAgICBpZiAobGVmdG92 ZXJydW4gPiAwKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIHJbaV0ub3Jp Z2luLnggKz0gbGVmdG92ZXJydW47CisgICAgICAgICAgICAgICAgICByW2ldLnNpemUud2lkdGgg LT0gbGVmdG92ZXJydW47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAvKiBYWFg6 IFRyeSB0byB3b3JrIGJldHdlZW4gcHJvYmxlbSB3aGVyZSBhIHN0cmV0Y2ggZ2x5cGggb24KKyAg ICAgICAgICAgICAgICAgYSBwYXJ0aWFsbHktdmlzaWJsZSBib3R0b20gcm93IHdpbGwgY2xlYXIg cGFydCBvZiB0aGUKKyAgICAgICAgICAgICAgICAgbW9kZWxpbmUsIGFuZCBhbm90aGVyIHdoZXJl IGxpc3QtYnVmZmVycyBoZWFkZXJzIGFuZCBzaW1pbGFyCisgICAgICAgICAgICAgICAgIHJvd3Mg ZXJyb25lb3VzbHkgaGF2ZSB2aXNpYmxlX2hlaWdodCBzZXQgdG8gMC4gIE5vdCBzdXJlCisgICAg ICAgICAgICAgICAgIHdoZXJlIHRoaXMgaXMgY29taW5nIGZyb20gYXMgb3RoZXIgdGVybXMgc2Vl bSBub3QgdG8gc2hvdy4gKi8KKyAgICAgICAgICAgICAgcltpXS5zaXplLmhlaWdodCA9IG1pbiAo cy0+aGVpZ2h0LCBzLT5yb3ctPnZpc2libGVfaGVpZ2h0KTsKKyAgICAgICAgICAgIH0KKyAgICAg ICAgICBbYmdDb2wgc2V0XTsKKyAgICAgICAgICAvKiBOT1RFOiB1bmRlciBOUyB0aGlzIGlzI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ldF07CisgICAgICAgICAgICAgIENHRmxv YXQgeCA9IHJbaV0ub3JpZ2luLng7CisgICAgICAgICAgICAgIENHRmxvYXQgd2lkdGggPSB3ZDsK KyAgICAgICAgICAgICAgcltpXS5zaXplLndpZHRoIC09IHdpZHRoOworICAgICAgICAgICAgICBy W2ldLm9yaWdpbi54ICs9IHdpZHRoOworICAgICAgICAgICAgICBOU1JlY3RGaWxsIChyW2ldKTsK KyAgICAgICAgICAgICAgLyogRHJhdyBvdmVybGluaW5nLCBldGMuIG9uIHRoZSBjdXJzb3IuICov CisgICAgICAgICAgICAgIGlmIChzLT53LT5waHlzX2N1cnNvcl90eXBlID09IE1DX0ZJTExFRF9C T1gpCisgICAgICAgICAgICAgICAgbWNfbnNfZHJhd190ZXh0X2RlY29yYXRpb24gKHMsIGZhY2Us IGJnQ29sLCB3aWR0aCwgeCk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAg ICAgbWNfbnNfZHJhd190ZXh0X2RlY29yYXRpb24gKHMsIGZhY2UsIGZnQ29sLCB3aWR0aCwgeCk7 CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAvLyAgaW50 IHJ4ID0gcltpXS5vcmlnaW4ueDsKKyAgLy8gIGludCByeSA9IHJbaV0ub3JpZ2luLnk7CisgIC8v ICBpbnQgcncgPSByW2ldLnNpemUud2lkdGg7CisgIC8vICBpbnQgcmggPSByW2ldLnNpemUuaGVp Z2h0OworICAvLyAgZnByaW50ZiAoc3RkZXJyLCAibWNfbnNfZHVtcGdseXBoc19zdHJldGNoOiAg dnBvcyAoJWQpIHwgcnggKCVkKSB8IHJ5ICglZCkgfCBydyAoJWQpIHwgcmggKCVkKVxuIiwKKyAg Ly8gICAgICAgICAgICAgICAgICAgcy0+Zmlyc3RfZ2x5cGgtPnZwb3MsIHJ4LCByeSwgcncsIHJo KTsKKyAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocltpXSk7CisgICAgICAgICAgICB9CisgICAg ICAgICAgLyogRHJhdyBvdmVybGluaW5nLCBldGMuIG9uIHRoZSBzdHJldGNoIGdseXBoIChvciB0 aGUgcGFydAorICAgICAgICAgICAgIG9mIHRoZSBzdHJldGNoIGdseXBoIGFmdGVyIHRoZSBjdXJz b3IpLiAqLworICAgICAgICAgIG1jX25zX2RyYXdfdGV4dF9kZWNvcmF0aW9uIChzLCBmYWNlLCBm Z0NvbCwgcltpXS5zaXplLndpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICByW2ldLm9yaWdpbi54KTsKKyAgICAgICAgfQorICAgICAgbnNfcmVzZXRfY2xpcHBpbmcg KHMtPmYpOworICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IDE7CisgICAgfQorfQorCitz dGF0aWMgdm9pZAorbWNfbnNfZHVtcGdseXBoc19pbWFnZSAoc3RydWN0IGdseXBoX3N0cmluZyAq cywgTlNSZWN0IHIsIHN0cnVjdCBtY19SR0IgbHNsLAorICAgICAgICAgICAgICAgICAgICAgICAg ZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yLCBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90 eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBhY3RpdmVfcCkKKy8qIC0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tCisgICAgICBSZW5kZXJzIGFuIGltYWdlIGFuZCBhc3NvY2lhdGVkIGJvcmRlcnMu CisgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworeworICBFbWFjc0ltYWdlICppbWcgPSBzLT5pbWct PnBpeG1hcDsKKyAgaW50IGJveF9saW5lX3Z3aWR0aCA9IG1heCA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yB3ZSBuZWVkIHRvIGRyYXcgcGxhY2Vob2xkZXIgaWYgaW1nID09bmls PyAqLworICBpZiAoaW1nICE9IG5pbCkKKyAgICB7CisjaWZkZWYgTlNfSU1QTF9DT0NPQQorICAg ICAgTlNSZWN0IGRyID0gTlNNYWtlUmVjdCAoeCwgeSwgcy0+c2xpY2Uud2lkdGgsIHMtPnNsaWNl LmhlaWdodCk7CisgICAgICBOU1JlY3QgaXIgPSBOU01ha2VSZWN0IChzLT5zbGljZS54LCBzLT5z bGljZS55LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+c2xpY2Uud2lkdGgsIHMt PnNsaWNlLmhlaWdodCk7CisgICAgICBbaW1nIGRyYXdJblJlY3Q6IGRyCisgICAgICAgICAgICAg ZnJvbVJlY3Q6IGlyCisgICAgICAgICAgICAgb3BlcmF0aW9uOiBOU0NvbXBvc2l0ZVNvdXJjZU92 ZXIKKyAgICAgICAgICAgICAgZnJhY3Rpb246IDEuMAorICAgICAgICAgICByZXNwZWN0RmxpcHBl ZDogWUVTCisgICAgICAgICAgICAgICAgaGludHM6IG5pbF07CisjZWxzZQorICAgICAgW2ltZyBj b21wb3NpdGVUb1BvaW50OiBOU01ha2VQb2ludCAoeCwgeSArIHMtPnNsaWNlLmhlaWdodCkKKyAg ICAgICAgICAgICAgICAgIG9wZXJhdGlvbjogTlNDb21wb3NpdGVTb3VyY2VPdmVyXTsKKyNlbmRp ZgorICAgIH0KKyAgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SKQorICAgIHsKKyAgICAgIFtGUkFN RV9DVVJTT1JfQ09MT1IgKHMtPmYpIHNldF07CisgICAgICBpZiAocy0+dy0+cGh5c19jdXJzb3Jf dHlwZSA9PSBNQ19GSUxMRURfQk9YKQorICAgICAgICB0ZENvbCA9IG5zX2xvb2t1cF9pbmRleGVk X2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpLCBzLT5mKTsKKyAgICAgICAgZWxzZQor ICAgICAgICAgIC8qIEN1cnJlbnRseSBvbiBOUyBpbWctPm1hc2sgaXMgYWx3YXlzIDAuIFNpbmNl CisgICAgICAgICAgICAgZ2V0X3dpbmRvd19jdXJzb3JfdHlwZSBzcGVjaWZpZXMgYSBob2xsb3cg Ym94IGN1cnNvciB3aGVuIG9uCisgICAgICAgICAgICAgYSBub24tbWFza2VkIGltYWdlIHdlIG5l dmVyIHJlYWNoIHRoaXMgY2xhdXNlLiBCdXQgd2UgcHV0IGl0CisgICAgICAgICAgICAgaW4gaW4g YW50aWNpcGF0aW9uIG9mIGJldHRlciBzdXBwb3J0IGZvciBpbWFnZSBtYXNrcyBvbiBOUy4gKi8K KyAgICAgICAgICB0ZENvbCA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVH Uk9VTkQgKGZhY2UpLCBzLT5mKTsKKyAgICB9CisgICAgZWxzZQorICAgICAgdGRDb2wgPSBuc19s b29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChmYWNlKSwgcy0+Zik7Cisg IC8qIERyYXcgdW5kZXJsaW5lLCBvdmVybGluZSwgc3RyaWtlLXRocm91Z2guICovCisgIG1jX25z X2RyYXdfdGV4dF9kZWNvcmF0aW9uIChzLCBmYWNlLCB0ZENvbCwgYnIuc2l6ZS53aWR0aCwgYnIu b3JpZ2luLngpOworICAvKiBEcmF3IHJlbGllZiwgaWYgcmVxdWVzdGVkICovCisgIGlmIChzLT5p bWctPnJlbGllZiB8fCBzLT5obCA9PURSQVdfSU1BR0VfUkFJU0VEIHx8IHMtPmhsID09RFJBV19J TUFHRV9TVU5LRU4pCisgICAgeworICAgICAgaWYgKHMtPmhsID09IERSQVdfSU1BR0VfU1VOS0VO IHx8IHMtPmhsID09IERSQVdfSU1BR0VfUkFJU0VEKQorICAgICAgICB7CisgICAgICAgICAgdGgg PSB0b29sX2Jhcl9idXR0b25fcmVsaWVmID49IDAgPworICAgICAgICAgICAgdG9vbF9iYXJfYnV0 dG9uX3JlbGllZiA6IERFRkFVTFRfVE9PTF9CQVJfQlVUVE9OX1JFTElFRjsKKyAgICAgICAgICBy YWlzZWRfcCA9IChzLT5obCA9PSBEUkFXX0lNQUdFX1JBSVNFRCk7CisgICAgICAgIH0KKyAgICAg ICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIHRoID0gYWJzIChzLT5pbWctPnJlbGll Zik7CisgICAgICAgICAgICByYWlzZWRfcCA9IChzLT5pbWctPnJlbGllZiA+IDApOworICAgICAg ICAgIH0KKyAgICAgIHIub3JpZ2luLnggPSB4IC0gdGg7CisgICAgICByLm9yaWdpbi55ID0geSAt IHRoOworICAgICAgci5zaXplLndpZHRoID0gcy0+c2xpY2Uud2lkdGggKyAyKnRoLTE7CisgICAg ICByLnNpemUuaGVpZ2h0ID0gcy0+c2xpY2UuaGVpZ2h0ICsgMip0aC0xOworICAgICAgbnNfZHJh d19yZWxpZWYgKHIsIHRoLCByYWlzZWRfcCwKKyAgICAgICAgICAgICAgICAgICAgICBzLT5zbGlj ZS55ID09IDAsCisgICAgICAgICAgICAgICAgICAgICAgcy0+c2xpY2UueSArIHMtPnNsaWNlLmhl aWdodCA9PSBzLT5pbWctPmhlaWdodCwKKyAgICAgICAgICAgICAgICAgICAgICBzLT5zbGljZS54 ID09IDAsCisgICAgICAgICAgICAgICAgICAgICAgcy0+c2xpY2UueCArIHMtPnNsaWNlLndpZHRo ID09IHMtPmltZy0+d2lkdGgsIHMpOworICAgIH0KKyAgLyogSWYgdGhlcmUgaXMgbm8gbWFzaywg dGhlIGJhY2tncm91bmQgd29uJ3QgYmUgc2VlbiwKKyAgICAgc28gZHJhdyBhIHJlY3RhbmdsZSBv biB0aGUgaW1hZ2UgZm9yIHRoZSBjdXJzb3IuCisgICAgIERvIHRoaXMgZm9yIGFsbCBpbWFnZXMs IGdldHRpbmcgdHJhbnNwYXJlbmN5IHJpZ2h0IGlzIG5vdCByZWxpYWJsZS4gKi8KKyAgaWYgKHMt PmhsID09IERSQVdfQ1VSU09SKQorICAgIHsKKyAgICAgIGludCB0aGlja25lc3MgPSBhYnMgKHMt PmltZy0+cmVsaWVmKTsKKyAgICAgIGlmICh0aGlja25lc3MgPT0gMCkgdGhpY2tuZXNzID0gMTsK KyAgICBpZiAoZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBICisgICAgICAgIHx8IGdseXBoX2ZsYXZv ciA9PSBNQ19HTFlQSExFU1MpCisgICAgICB7CisgICAgICAgIE5TQ29sb3IgKmJvcmRlcl9jb2xv ciA9IFtOU0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6IGxzbC5yZWQKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBncmVlbjogbHNs LmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGJsdWU6IGxzbC5ibHVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwaGE6IDEuMF07CisgICAgICAgIG5zX2RyYXdf Ym94IChiciwgdGhpY2tuZXNzLCBib3JkZXJfY29sb3IsIDEsIDEpOworICAgICAgfQorICAgICAg ZWxzZQorICAgICAgICBuc19kcmF3X2JveCAoYnIsIHRoaWNrbmVzcywgRlJBTUVfQ1VSU09SX0NP TE9SIChzLT5mKSwgMSwgMSk7CisgICAgfQorfQorCitzdGF0aWMgdm9pZAorbWNfbnNfZHJhd19v dmVyd3JpdHRlbiAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgc3RydWN0IGdseXBoX21hdHJpeCAq bWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93LCBz dHJ1Y3QgZ2x5cGggKmdseXBoKQoreworICAvLyAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1Mg KHJvdywgbWF0cml4KTsKKyAgLy8gIGNsb2NrX3QgY2xvY2tfc3RhcnQgPSBjbG9jaygpOworICAv LyBuc19kcmF3X3VuZGVyd2F2ZSAocywgcy0+d2lkdGgsIHMtPngpOworICBOU0NvbG9yICpob2xs b3dfY29sb3IgPSBGUkFNRV9CQUNLR1JPVU5EX0NPTE9SIChzLT5mKTsKKyAgc3RydWN0IGZhY2Ug KmZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIERFRkFVTFRfRkFDRV9JRCk7CisgIGludCB2bnRo ID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgIC8qIFNUUkVUQ0hfR0xZUEggbWF5 IGNvbnRhaW4gbW9yZSB0aGFuIG9uZSBmYWtlIGN1cnNvciBhdCB0aGUgc2FtZSBIUE9TLgorICBO T1RFOiAgQSBmYWtlIGN1cnNvciBmcm9tIG9uZSBjYWNoZSBtYXkgb3ZlcndyaXRlIGEgZmFrZSBj dXJzb3IgZnJvbSBhbm90aGVyCisgIGNhY2hlIC0tIHRodXMsIHdlIG11c3QgY2hlY2sgdGhlbSBh bGwgZm9yIG92ZXJ3cml0dGVuIGZha2UgY3Vyc29ycy4gKi8KKyAgZm9yIChlbnVtIG1jX2NhY2hl X3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOworICAgICAgIGNhY2hlX3R5cGUgPCBOT19DQUNI RTsKKyAgICAgICArK2NhY2hlX3R5cGUpCisgICAgeworICAgICAgZm9yIChpbnQgbnRoID0gMDsK KyAgICAgICAgICAgcworICAgICAgICAgICAmJiBzLT53LT5tY19tYXRyaXguY3Vyc29yc191c2Vk W2NhY2hlX3R5cGVdID4gMAorICAgICAgICAgICAmJiBudGggPCBzLT53LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdOworICAgICAgICAgICArK250aCkKKyAgICAg ICAgeworICAgICAgICAgIGludCB4ID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0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aGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFibGVkX3A7CisgICAgICAgICAgYm9vbCBnb19wID0g KHZwb3MgPT0gdm50aAorICAgICAgICAgICAgICAgICAgICAgICAmJiBocG9zID09IGdseXBoLT5o cG9zCisgICAgICAgICAgICAgICAgICAgICAgICYmIGVuYWJsZWRfcCk7CisgICAgICAgICAgaWYg KCFnb19wKQorICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgTlNSZWN0IHI7CisgICAg ICAgICAgci5vcmlnaW4ueCA9IGZ4OworICAgICAgICAgIHIub3JpZ2luLnkgPSBmeTsKKyAgICAg ICAgICByLnNpemUuaGVpZ2h0ID0gaDsKKyAgICAgICAgICByLnNpemUud2lkdGggPSB3ZDsKKyAg ICAgICAgICBbW05TQ29sb3IgY29sb3JXaXRoQ2FsaWJyYXRlZFJlZDogbHNsX2ZnLnJlZAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdyZWVuOiBsc2xfZmcuZ3JlZW4KKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmx1ZTogbHNsX2ZnLmJsdWUKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHBoYTogMS4wXSBzZXRdOworICAg ICAgaWYgKGN1cnNvcl90eXBlID09IE1DX0ZSQU1FRF9CT1gpCisgICAgICAgIHsKKyAgICAgICAg ICBMaXNwX09iamVjdCBidWYgPSBzLT53LT5jb250ZW50czsKKyAgICAgICAgICBDSEVDS19CVUZG RVIgKGJ1Zik7CisgICAgICAgICAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKGJ1Zik7Cisg ICAgICAgICAgYm9vbCByZWdpb25fYWN0aXZlX3AgPSAoIU5JTFAgKFZ0cmFuc2llbnRfbWFya19t b2RlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChi LCBtYXJrX2FjdGl2ZSkpKTsKKyAgICAgICAgICBwdHJkaWZmX3QgcmVnaW9uX2JlZ2lubmluZyA9 IChyZWdpb25fYWN0aXZlX3ApID8gWEZJWE5VTSAoRnJlZ2lvbl9iZWdpbm5pbmcgKCkpIDogLTE7 CisgICAgICAgICAgcHRyZGlmZl90IHJlZ2lvbl9lbmQgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IFhG SVhOVU0gKEZyZWdpb25fZW5kICgpKSA6IC0xOworICAgICAgICAgIHB0cmRpZmZfdCBvcG9pbnRf cHQgPSAocy0+dyA9PSBYV0lORE9XIChzZWxlY3RlZF93aW5kb3cpKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IFBUCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog WEZJWE5VTSAoRm1hcmtlcl9wb3NpdGlvbiAocy0+dy0+cG9pbnRtKSk7CisgICAgICAgICAgYm9v bCByZWdpb25faW5fYm91bmRzX3AgPSAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3B0ID49IHJlZ2lvbl9iZWdpbm5pbmcKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfcHQgPCByZWdpb25f ZW5kKTsKKyAgICAgICAgICBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICYmIHJl Z2lvbl9pbl9ib3VuZHNfcAorICAgICAgICAgICAgICAmJiBhY3RpdmVfcCkKKyAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2ZhY2Vf aWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ZiwgaW50ZXJuICgiKy1yZWFsLWZha2Ut Y3Vyc29yLXJlZ2lvbi1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAq aG9sbG93X2FjdGl2ZV9yZWdp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gICAgaG9sbG93X2NvbG9y ID0gaG9sbG93X2FjdGl2ZV9yZWdpb25fb3V0X2NvbG9yOworICAgICAgICAgICAgICB9CisgICAg ICAgICAgICAgIGVsc2UgaWYgKCFyZWdpb25fYWN0aXZlX3AgJiYgYWN0aXZlX3ApCisgICAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVf ZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlIChzLT53LCBzLT5mLCBpbnRlcm4gKCIrLXJlYWwt ZmFrZS1jdXJzb3ItZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNl ICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIGhvbGxvd19hY3RpdmVf ZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICBOU0NvbG9yICpob2xsb3dfYWN0aXZlX2NvbG9y ID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoaG9sbG93X2Fj dGl2ZV9mYWNlKSwgcy0+Zik7CisgICAgICAgICAgICAgICAgICBob2xsb3dfY29sb3IgPSBob2xs b3dfYWN0aXZlX2NvbG9yOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvKiBU aGUgcmVnaW9uIGlzIF9ub3RfIHZpc2libGUgaW4gdGhlIGluYWN0aXZlIHdpbmRvdyBiZWNhdXNl IHRoZSBvdmVybGF5IHdpbmRvdyBwcm9wZXJ0eSBpcyB1c2VkLiAqLworICAgICAgICAgICAgICAg IGVsc2UgaWYgKCFhY3RpdmVfcCkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg ICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVk X2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1m YWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2lu YWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lk KTsKKyAgICAgICAgICAgICAgICAgICAgTlNDb2xvciAqaG9sbG93X2luYWN0aXZlX2NvbG9yID0g bnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoaG9sbG93X2luYWN0 aXZlX2ZhY2UpLCBzLT5mKTsKKyAgICAgICAgICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9s bG93X2luYWN0aXZlX2NvbG9yOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAg ICAgIGVsc2UgaWYgKGZhY2UgJiYgTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKSA9PSBuc19pbmRl eF9jb2xvciAoRlJBTUVfQ1VSU09SX0NPTE9SIChzLT5mKSwgcy0+ZikpCisgICAgICAgICAgewor ICAgICAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQg KGZhY2UpLCBzLT5mKSBzZXRdOworICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gRlJBTUVfQ1VS U09SX0NPTE9SIChzLT5mKTsKKyAgICAgICAgICB9CisgICAgICAgICAgc3dpdGNoIChjdXJzb3Jf dHlwZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY2FzZSBNQ19OT19GUklOR0VfQklU TUFQOgorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX05PX0NV UlNPUjoKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSBNQ19SSUdI VF9GUklOR0VfQklUTUFQOgorICAgICAgICAgICAgICBjYXNlIE1DX0xFRlRfRlJJTkdFX0JJVE1B UDoKKyAgICAgICAgICAgICAgY2FzZSBNQ19GSUxMRURfQk9YOgorICAgICAgICAgICAgICAgIE5T UmVjdEZpbGwgKHIpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNl IE1DX0ZSQU1FRF9CT1g6CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAg ICAgICAgICAgW2hvbGxvd19jb2xvciBzZXRdOworICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwg KE5TSW5zZXRSZWN0IChyLCAxLCAxKSk7CisgICAgICAgICAgICAgICAgW0ZSQU1FX0NVUlNPUl9D T0xPUiAocy0+Zikgc2V0XTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAg Y2FzZSBNQ19IT0xMT1dfQk9YOgorICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAg ICAgICAgICAgICAgIFtob2xsb3dfY29sb3Igc2V0XTsKKyAgICAgICAgICAgICAgICBOU1JlY3RG aWxsIChOU0luc2V0UmVjdCAociwgMSwgMSkpOworICAgICAgICAgICAgICAgIFtGUkFNRV9DVVJT T1JfQ09MT1IgKHMtPmYpIHNldF07CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAg ICAgIGNhc2UgTUNfSEJBUjoKKyAgICAgICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAg ICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSBNQ19CQVI6CisgICAgICAgICAg ICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAg ICB9CisgICAgICAgICAgLyogSWYgYSBnbHlwaCBleGlzdHMgKHMtPmNoYXIyYiAhPSBOVUxMKSwg dGhlbiBkcmF3IHRoZSBnbHlwaCBvbiB0b3Agb2YgdGhlCisgICAgICAgICAgbmV3bHkgZHJhd24g cmVjdGFuZ2xlIHRoYXQgd2FzIGNyZWF0ZWQgaGVyZWluYWJvdmUuICBUbyB0aGUgZXh0ZW50IHRo YXQgd2UKKyAgICAgICAgICB3YW50IHRvIGRvdWJsZS1pbXByaW50IGdseXBocyB0byBtYWtlIHRo ZW0gYXBwZWFyIHRvIGJlIHNlbWktYm9sZCwgaXQgY2FuCisgICAgICAgICAgYmUgZG9uZSBoZXJl IGZvciBhbGwgY3Vyc29yIHR5cGVzLiAgVGhlIGJveC1zdHlsZSBjdXJzb3JzIGFyZSBpbXByaW50 ZWQKKyAgICAgICAgICB3aXRoIGdseXBocyBvbmx5IG9uZSAoMSkgdGltZS4gIFRoZSBzZW1pLWJv bGQgYXBwZWFyYW5jZSBpcyBoZWxwZnVsIHdoZW4KKyAgICAgICAgICBkZWJ1Z2dpbmcgdG8gc2Vl IHRoYXQgdGhlIGNvb3JkaW5hdGVzIGFyZSBjb3JyZWN0LiAqLworICAgICAgICAgIGlmIChzLT5j aGFyMmIgIT0gTlVMTAorICAgICAgICAgICAgICAmJiAoY3Vyc29yX3R5cGUgPT0gTUNfRklMTEVE X0JPWAorICAgICAgICAgICAgICAgICAgfHwgY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWAor ICAgICAgICAgICAgICAgICAgfHwgY3Vyc29yX3R5cGUgPT0gTUNfSE9MTE9XX0JPWCkpCisgICAg ICAgICAgICB7CisgICAgICAgICAgICAgIEJPT0wgaXNDb21wb3NpdGUgPSBzLT5maXJzdF9nbHlw aC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEg7CisgICAgICAgICAgICAgIGlmIChpc0NvbXBvc2l0 ZSkKKyAgICAgICAgICAgICAgICBuc19kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdy b3VuZCAocyk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgICBzdHJ1Y3QgZm9udCAqZm9udCA9IHMtPmZhY2UtPmZvbnQ7CisgICAg ICAgICAgICAgICAgICAgIGlmICghZm9udCkKKyAgICAgICAgICAgICAgICAgICAgICBmb250ID0g RlJBTUVfRk9OVCAocy0+Zik7CisgICAgICAgICAgICAgICAgICAgIGJvb2wgd2l0aF9iZ19wID0g ZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIGZvbnQtPmRyaXZlci0+ZHJhdyAocywgcy0+Y21w X2Zyb20sIHMtPm5jaGFycywgcy0+eCwgcy0+eWJhc2UsIHdpdGhfYmdfcCk7CisgICAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIC8vICBjbG9ja190 IGNsb2NrX2VuZCA9IGNsb2NrKCk7CisgIC8vICBkb3VibGUgY3B1X3RpbWVfdXNlZCA9ICgoZG91 YmxlKSAoY2xvY2tfZW5kIC0gY2xvY2tfc3RhcnQpKSAvIENMT0NLU19QRVJfU0VDOworICAvLyAg ZnByaW50ZiAoc3RkZXJyLCAibnNfZHJhd19vdmVyd3JpdHRlbiAoJWQpOiAgVElNRSAoJWYpXG4i LCB2cG9zLCBjcHVfdGltZV91c2VkKTsKK30KKworc3RhdGljIHZvaWQKK21jX25zX21heWJlX2R1 bXBnbHlwaHNfYmFja2dyb3VuZCAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgY2hhciBmb3JjZV9w KQoreworICBOU1RSQUNFICgibWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIik7Cisg IGlmICghcy0+YmFja2dyb3VuZF9maWxsZWRfcC8qIHx8IHMtPmhsID09IERSQVdfTU9VU0VfRkFD RSovKQorICAgIHsKKyAgICAgIGludCBib3hfbGluZV93aWR0aCA9IG1heCAocy0+ZmFjZS0+Ym94 X2xpbmVfd2lkdGgsIDApOworICAgICAgaWYgKEZPTlRfSEVJR0hUIChzLT5mb250KSA8IHMtPmhl aWdodCAtIDIgKiBib3hfbGluZV93aWR0aAorICAgICAgICAgIC8qIFdoZW4geGRpc3AuYyBpZ25v cmVzIEZPTlRfSEVJR0hULCB3ZSBjYW5ub3QgdHJ1c3QgZm9udAorICAgICAgICAgICAgIGRpbWVu c2lvbnMsIHNpbmNlIHRoZSBhY3R1YWwgZ2x5cGhzIG1pZ2h0IGJlIG11Y2gKKyAgICAgICAgICAg ICBzbWFsbGVyLiAgU28gaW4gdGhhdCBjYXNlIHdlIGFsd2F5cyBjbGVhciB0aGUgcmVjdGFuZ2xl CisgICAgICAgICAgICAgd2l0aCBiYWNrZ3JvdW5kIGNvbG9yLiAqLworICAgICAgICAgIHx8IEZP TlRfVE9PX0hJR0ggKHMtPmZvbnQpCisgICAgICAgICAgfHwgcy0+Zm9udF9ub3RfZm91bmRfcCB8 fCBzLT5leHRlbmRzX3RvX2VuZF9vZl9saW5lX3AgfHwgZm9yY2VfcCkKKyAgICAgICAgeworICAg ICAgICAgIHN0cnVjdCBmYWNlICpmYWNlOworICAgICAgICAgIGlmIChzLT5obCA9PSBEUkFXX01P VVNFX0ZBQ0UpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01f SUQgKHMtPmYsIE1PVVNFX0hMX0lORk8gKHMtPmYpLT5tb3VzZV9mYWNlX2ZhY2VfaWQpOworICAg ICAgICAgICAgICBpZiAoIWZhY2UpCisgICAgICAgICAgICAgICAgZmFjZSA9IEZBQ0VfRlJPTV9J RCAocy0+ZiwgTU9VU0VfRkFDRV9JRCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNl CisgICAgICAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIHMtPmZpcnN0X2dseXBo LT5mYWNlX2lkKTsKKyAgICAgICAgICBpZiAoIWZhY2UtPnN0aXBwbGUpCisgICAgICAgICAgICBb KE5TX0ZBQ0VfQkFDS0dST1VORCAoZmFjZSkgIT0gMAorICAgICAgICAgICAgICA/IG5zX2xvb2t1 cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpLCBzLT5mKQorICAgICAg ICAgICAgICA6IEZSQU1FX0JBQ0tHUk9VTkRfQ09MT1IgKHMtPmYpKSBzZXRdOworICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RydWN0IG5zX2Rpc3Bs YXlfaW5mbyAqZHB5aW5mbyA9IEZSQU1FX0RJU1BMQVlfSU5GTyAocy0+Zik7CisgICAgICAgICAg ICAgICAgW1tkcHlpbmZvLT5iaXRtYXBzW2ZhY2UtPnN0aXBwbGUtMV0uaW1nIHN0aXBwbGVNYXNr XSBzZXRdOworICAgICAgICAgICAgICB9CisgICAgICAgICAgaWYgKHMtPmhsICE9IERSQVdfQ1VS U09SKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzLT5yZWN0YW5nbGVfbnVrZWRfcCA9 IHRydWU7CisgICAgICAgICAgICAgIE5TUmVjdCByID0gTlNNYWtlUmVjdCAocy0+eCwgcy0+eSAr IGJveF9saW5lX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+ YmFja2dyb3VuZF93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMt PmhlaWdodC0yKmJveF9saW5lX3dpZHRoKTsKKyAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7 CisgICAgICAgICAgICB9CisgICAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IDE7Cisg ICAgICAgIH0KKyAgICB9Cit9CisKK3N0YXRpYyB2b2lkCittY19uc19kcmF3X2dseXBoX3N0cmlu ZyAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBz dHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1j X1JHQiBsc2wsIGVudW0gbWNfZmxhdm9yIGdseXBo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ZHRoICs9IG5leHQtPndpZHRoLCBuZXh0ID0gbmV4dC0+bmV4dCkKKyAgICAgICAgaWYgKG5leHQt PmZpcnN0X2dseXBoLT50eXBlICE9IElNQUdFX0dMWVBIKQorICAgICAgICAgIHsKKyAgICAgICAg ICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSAhPSBTVFJFVENIX0dMWVBIKQorICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9y ZWN0IChzLT5uZXh0LCByKTsKKyAgICAgICAgICAgICAgICBpZiAoIW1jX25zX2NsaXBfdG9fcmVj dCAocy0+Ziwgciwgbiwgcm93KSkKKyAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAg ICAgICAgICBtY19uc19tYXliZV9kdW1wZ2x5cGhzX2JhY2tncm91bmQgKHMtPm5leHQsIDEpOwor ICAgICAgICAgICAgICAgIG5zX3Jlc2V0X2NsaXBwaW5nIChzLT5mKTsKKyAgICAgICAgICAgICAg fQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbWNf bnNfZHVtcGdseXBoc19zdHJldGNoIChzLT5uZXh0LCB3ZCwgcm93KTsKKyAgICAgICAgICAgICAg ICBpZiAoKHMtPm5leHQtPmxlZnRfb3ZlcndyaXR0ZW5fcCB8fCBzLT5uZXh0LT5yaWdodF9vdmVy d3JpdHRlbl9wKQorICAgICAgICAgICAgICAgICAgICAmJiAocy0+bmV4dC0+YWN0aW9uX3R5cGUg PT0gTUNfRFJBV19HTFlQSCB8fCBzLT5uZXh0LT5hY3Rpb25fdHlwZSA9PSBNQ19FUkFTRV9HTFlQ SCkpCisgICAgICAgICAgICAgICAgICBtY19uc19kcmF3X292ZXJ3cml0dGVuIChzLT5uZXh0LCBt YXRyaXgsIHJvdywgcy0+bmV4dC0+Zmlyc3RfZ2x5cGgpOworICAgICAgICAgICAgICB9CisgICAg ICAgICAgICBuZXh0LT5udW1fY2xpcHMgPSAwOworICAgICAgICAgIH0KKyAgICB9CisgIGlmICgh cy0+Zm9yX292ZXJsYXBzICYmIHMtPmZhY2UtPmJveCAhPSBGQUNFX05PX0JPWAorICAgICAgJiYg KHMtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgICAgICB8fCBzLT5maXJz dF9nbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpKQorICAgIHsKKyAgICAgIG4gPSBuc19n ZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgcik7CisgICAgICBpZiAoIW1jX25zX2NsaXBf dG9fcmVjdCAocy0+Ziwgciwgbiwgcm93KSkKKyAgICAgICAgcmV0dXJuOworICAgICAgbWNfbnNf bWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzLCAxKTsKKyAgICAgIG5zX2R1bXBnbHlwaHNf Ym94X29yX3JlbGllZiAocyk7CisgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAg ICBib3hfZHJhd25fcCA9IDE7CisgICAgfQorICBzd2l0Y2ggKHMtPmZpcnN0X2dseXBoLT50eXBl KQorICAgIHsKKyAgICBjYXNlIElNQUdFX0dMWVBIOgorICAgICAgbiA9IG5zX2dldF9nbHlwaF9z dHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAgICAgIGlmICghbWNfbnNfY2xpcF90b19yZWN0IChz LT5mLCByLCBuLCByb3cpKQorICAgICAgICByZXR1cm47CisgICAgICBtY19uc19kdW1wZ2x5cGhz X2ltYWdlIChzLCByWzBdLCBsc2wsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIGFjdGl2ZV9w KTsKKyAgICAgIG5zX3Jlc2V0X2NsaXBwaW5nIChzLT5mKTsKKyAgICAgIGJyZWFrOworICAgIGNh c2UgU1RSRVRDSF9HTFlQSDoKKyAgICAgIG1jX25zX2R1bXBnbHlwaHNfc3RyZXRjaC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gaWYg KHMtPmhsID09IERSQVdfQ1VSU09SCisgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3R5cGUg PT0gTUNfRlJBTUVEX0JPWAorICAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9wKQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0aXZlX2ZhY2Vf aWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ZiwgaW50ZXJuICgiKy1yZWFsLWZha2Ut Y3Vyc29yLWluYWN0aXZlLWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgIHN0cnVjdCBmYWNl ICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgaG9sbG93X2luYWN0 aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICBOU19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2Up ID0gTlNfRkFDRV9GT1JFR1JPVU5EIChob2xsb3dfaW5hY3RpdmVfZmFjZSk7CisgICAgICAgICAg ICB9CisgICAgICB7CisgICAgICAgIEJPT0wgaXNDb21wb3NpdGUgPSBzLT5maXJzdF9nbHlwaC0+ dHlwZSA9PSBDT01QT1NJVEVfR0xZUEg7CisgICAgICAgIGlmIChpc0NvbXBvc2l0ZSkKKyAgICAg ICAgICBuc19kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAg ICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBib29sIHdpdGhfYmdfcCA9 ICgoZmxhZ3MgPT0gTlNfRFVNUEdMWVBIX05PUk1BTCAmJiAhcy0+YmFja2dyb3VuZF9maWxsZWRf cCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgZmxhZ3MgPT0gTlNfRFVNUEdM WVBIX01PVVNFRkFDRSk7CisgICAgICAgICAgICAgIGlmICh3aXRoX2JnX3ApCisgICAgICAgICAg ICAgICAgcy0+YmFja2dyb3VuZF9udWtlZF9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgZm9udC0+ ZHJpdmVyLT5kcmF3IChzLCBzLT5jbXBfZnJvbSwgcy0+bmNoYXJzLCBzLT54LCBzLT55YmFzZSwg d2l0aF9iZ19wKTsKKyAgICAgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIHsKKyAgICAgICAgTlND b2xvciAqY29sID0gKE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSkgIT0gMAorICAgICAgICAg ICAgICAgICAgICAgICAgPyBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JP VU5EIChzLT5mYWNlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHMtPmYpCisgICAgICAgICAgICAgICAgICAgICAgICA6IEZSQU1FX0ZPUkVHUk9V TkRfQ09MT1IgKHMtPmYpKTsKKyAgICAgICAgW2NvbCBzZXRdOworICAgICAgICAvKiBEcmF3IHVu ZGVybGluZSwgb3ZlcmxpbmUsIHN0cmlrZS10aHJvdWdoLiAqLworICAgICAgICBtY19uc19kcmF3 X3RleHRfZGVjb3JhdGlvbiAocywgcy0+ZmFjZSwgY29sLCBzLT53aWR0aCwgcy0+eCk7CisgICAg ICB9CisgICAgICB7CisgICAgICAgIGlmIChzLT5maXJzdF9nbHlwaC0+dHlwZSAhPSBDT01QT1NJ VEVfR0xZUEgKKyAgICAgICAgICAgICYmIChzLT5sZWZ0X292ZXJ3cml0dGVuX3AgfHwgcy0+cmln aHRfb3ZlcndyaXR0ZW5fcCkKKyAgICAgICAgICAgICYmIChzLT5iYWNrZ3JvdW5kX251a2VkX3Ag fHwgcy0+cmVjdGFuZ2xlX251a2VkX3ApCisgICAgICAgICAgICAmJiAocy0+YWN0aW9uX3R5cGUg PT0gTUNfRFJBV19HTFlQSCB8fCBzLT5hY3Rpb25fdHlwZSA9PSBNQ19FUkFTRV9HTFlQSCkpCisg ICAgICAgICAgbWNfbnNfZHJhd19vdmVyd3JpdHRlbiAocywgbWF0cml4LCByb3csIHMtPmZpcnN0 X2dseXBoKTsKKyAgICAgIH0KKyAgICAgIGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUgorICAgICAg ICAgICYmIGN1cnNvcl90eXBlID09IE1DX0ZJTExFRF9CT1gpCisgICAgICAgIHsKKyAgICAgICAg ICB1bnNpZ25lZCBsb25nIHRtcCA9IE5TX0ZBQ0VfQkFDS0dST1VORCAocy0+ZmFjZSk7CisgICAg ICAgICAgTlNfRkFDRV9CQUNLR1JPVU5EIChzLT5mYWNlKSA9IE5TX0ZBQ0VfRk9SRUdST1VORCAo cy0+ZmFjZSk7CisgICAgICAgICAgTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKSA9IHRtcDsK KyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUgorICAgICAg ICAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YKQorICAgICAgICAgIE5T X0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSkgPSBzYXZlZF9mZzsKKyAgICAgIG5zX3Jlc2V0X2Ns aXBwaW5nIChzLT5mKTsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgR0xZUEhMRVNTX0dMWVBIOgor ICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAgICAgIGlm ICghbWNfbnNfY2xpcF90b19yZWN0IChzLT5mLCByLCBuLCByb3cpKQorICAgICAgICByZXR1cm47 CisgICAgICBpZiAocy0+Zm9yX292ZXJsYXBzIHx8IChzLT5jbXBfZnJvbSA+IDAKKyAgICAgICAg ICAgICYmICEgcy0+Zmlyc3RfZ2x5cGgtPnUuY21wLmF1dG9tYXRpYykpCisgICAgICAgIHMtPmJh Y2tncm91bmRfZmlsbGVkX3AgPSAxOworICAgICAgZWxzZQorICAgICAgICBtY19uc19tYXliZV9k dW1wZ2x5cGhzX2JhY2tncm91bmQgKHMsIHMtPmZpcnN0X2dseXBoLT50eXBlID09IENPTVBPU0lU RV9HTFlQSCk7CisgICAgICAvKiAuLi4gKi8KKyAgICAgIC8qIE5vdCB5ZXQgaW1wbGVtZW50ZWQu ICovCisgICAgICAvKiAuLi4gKi8KKyAgICAgIG5zX3Jlc2V0X2NsaXBwaW5nIChzLT5mKTsKKyAg ICAgIGJyZWFrOworICAgIGRlZmF1bHQ6CisgICAgICBlbWFjc19hYm9ydCAoKTsKKyAgICB9Cisg IC8qIERyYXcgYm94IGlmIG5vdCBkb25lIGFscmVhZHkuICovCisgIGlmICghcy0+Zm9yX292ZXJs YXBzICYmICFib3hfZHJhd25fcCAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gpCisgICAg eworICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAgICAg IGlmICghbWNfbnNfY2xpcF90b19yZWN0IChzLT5mLCByLCBuLCByb3cpKQorICAgICAgICByZXR1 cm47CisgICAgICBuc19kdW1wZ2x5cGhzX2JveF9vcl9yZWxpZWYgKHMpOworICAgICAgbnNfcmVz ZXRfY2xpcHBpbmcgKHMtPmYpOworICAgIH0KKyAgcy0+bnVtX2NsaXBzID0gMDsKK30KKworLyog ZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC8q ID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09CiAKICAgIE5TVFJBQ0UsIFRyYWNlIHN1cHBvcnQuCkBAIC0xMTA5 LDYgKzIxNjQsMTYgQEAgc3RhdGljIE5TUmVjdCBjb25zdHJhaW5fZnJhbWVfcmVjdChOU1JlY3Qg ZnJhbWVSZWN0LCBib29sIGlzRnVsbHNjcmVlbikKICAgIGV4dGVybmFsIChSSUYpIGNhbGw7IHdo b2xlIGZyYW1lLCBjYWxsZWQgYmVmb3JlIHVwZGF0ZV93aW5kb3dfYmVnaW4KICAgIC0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tICovCiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBmOworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAjaWZkZWYgTlNfSU1QTF9DT0NPQQogICBFbWFjc1ZpZXcgKnZp ZXcgPSBGUkFNRV9OU19WSUVXIChmKTsKIApAQCAtMTIwOSw2ICsyMjc0LDE2IEBAIHN0YXRpYyBO U1JlY3QgY29uc3RyYWluX2ZyYW1lX3JlY3QoTlNSZWN0IGZyYW1lUmVjdCwgYm9vbCBpc0Z1bGxz Y3JlZW4pCiAKIC8qICAgaWYgKGYgPT0gTU9VU0VfSExfSU5GTyAoZiktPm1vdXNlX2ZhY2VfbW91 c2VfZnJhbWUpICovCiAgIE1PVVNFX0hMX0lORk8gKGYpLT5tb3VzZV9mYWNlX2RlZmVyID0gMDsK KworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwor ICBmLT5tY191cGRhdGluZ19mcmFtZSA9IE5VTEw7CisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKIH0KIAogCkBAIC00ODAzLDYgKzU4NzgsMTcgQEAgaW4gY2VydGFpbiBzaXR1YXRpb25z IChyYXBpZCBpbmNvbWluZyBldmVudHMpLgogICAgICAgYmFyID0gW1tFbWFjc1Njcm9sbGVyIGFs bG9jXSBpbml0RnJhbWU6IHIgd2luZG93OiB3aW5dOwogICAgICAgd3NldF92ZXJ0aWNhbF9zY3Jv bGxfYmFyICh3aW5kb3csIG1ha2VfbWludF9wdHIgKGJhcikpOwogICAgICAgdXBkYXRlX3AgPSBZ RVM7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKyAgICAgIC8qIFRoaXMgaXMgb25seSBmb3IgZGVidWdnaW5nIHB1cnBvc2VzLiAqLworICAg ICAgW2JhciBtY19zZXRfcmVjdGFuZ2xlOiByXTsKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogICAgIH0KICAgZWxzZQogICAgIHsKQEAgLTQ4MTAsMTIgKzU4OTYsMzAgQEAgaW4gY2Vy dGFpbiBzaXR1YXRpb25zIChyYXBpZCBpbmNvbWluZyBldmVudHMpLgogICAgICAgYmFyID0gWE5T X1NDUk9MTF9CQVIgKHdpbmRvdy0+dmVydGljYWxfc2Nyb2xsX2Jhcik7CiAgICAgICBvbGRSZWN0 ID0gW2JhciBmcmFtZV07CiAgICAgICByLnNpemUud2lkdGggPSBvbGRSZWN0LnNpemUud2lkdGg7 CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK ICAgICAgIGlmIChGUkFNRV9MSVZFX1AgKGYpICYmICFOU0VxdWFsUmVjdHMgKG9sZFJlY3QsIHIp KQogICAgICAgICB7CisgICAgICAgICAgLyogVGhlIG1haW4gd2luZG93IGhhcyBwcm9iYWJseSBi ZWVuIHJlc2l6ZWQuICBHcmFjaW91c2x5IGRlbGV0ZSB0aGUKKyAgICAgICAgICBvbGQgc2Nyb2xs IGJhciB3aXRob3V0IHJlcGFpbnRpbmcgaXRzIHJlY3RhbmdsZTsgYW5kLCBjcmVhdGUgYSBuZXcK KyAgICAgICAgICBzY3JvbGwgYmFyIGVsc2V3aGVyZS4qLwogICAgICAgICAgIGlmIChvbGRSZWN0 Lm9yaWdpbi54ICE9IHIub3JpZ2luLngpCisgICAgICAgICAgICB7CiAgICAgICAgICAgICAgIG5z X2NsZWFyX2ZyYW1lX2FyZWEgKGYsIGxlZnQsIHRvcCwgd2lkdGgsIGhlaWdodCk7CisgICAgICAg ICAgICAgIFtiYXIgbWNfanVkZ2VdOworICAgICAgICAgICAgICBiYXIgPSBbW0VtYWNzU2Nyb2xs ZXIgYWxsb2NdIGluaXRGcmFtZTogciB3aW5kb3c6IHdpbl07CisgICAgICAgICAgICAgIHdzZXRf dmVydGljYWxfc2Nyb2xsX2JhciAod2luZG93LCBtYWtlX21pbnRfcHRyIChiYXIpKTsKKyAgICAg ICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKICAgICAgICAgICBbYmFyIHNldEZyYW1lOiByXTsK ICAgICAgICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgfQogCiAgIGlm ICh1cGRhdGVfcCkKQEAgLTQ5NzUsOSArNjA3OSw1NyBAQCBpbiBjZXJ0YWluIHNpdHVhdGlvbnMg KHJhcGlkIGluY29taW5nIGV2ZW50cykuCiAgICAgewogICAgICAgdmlldyA9IFtzdWJ2aWV3cyBv YmplY3RBdEluZGV4OiBpXTsKICAgICAgIGlmICghW3ZpZXcgaXNLaW5kT2ZDbGFzczogW0VtYWNz U2Nyb2xsZXIgY2xhc3NdXSkgY29udGludWU7Ci0gICAgICBpZiAoW3ZpZXcganVkZ2VdKQorCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8q IGBYU0VUV0lORE9XJyB3aWxsIHNvbWV0aW1lcyBjYXVzZSBFbWFjcyB0byBjcmFzaCB3aGVuIHJ1 bm5pbmcgdW5kZXIgZ2RiIGV2ZW4KKyAgdGhvdWdoICh3ICE9IE5VTEwpLiAgVGhlcmVmb3JlLCB3 ZSBjYW5ub3QgcmVsaWFibHkgdXNlIGBXSU5ET1dfTElWRV9QJy4gKi8KKyAgc3RydWN0IHdpbmRv dyAqdyA9IFt2aWV3IG1jX2dldF93aW5kb3ddOworICBpZiAodyAhPSBOVUxMCisgICAgICAmJiBO SUxQICh3LT5jb250ZW50cykpCisgICAgeworICAgICAgQk9PTCBkZWJ1Z19wID0gZmFsc2U7Cisg ICAgICBpZiAoZGVidWdfcAorICAgICAgICAgIC8qIGB3aW5kb3dfYm94JyBjYWxscyBgd2luZG93 X2JveF9oZWlnaHQnLCB3aGljaCB3aWxsIGNhdXNlIEVtYWNzIHRvCisgICAgICAgICAgY3Jhc2gg aWYgRlJBTUVQICh3LT5mcmFtZSkgaXMgbm90IHNhdGlzZmllZC4gKi8KKyAgICAgICAgICAmJiBG UkFNRVAgKHctPmZyYW1lKSkKKyAgICAgICAgeworICAgICAgICAgIE5TUmVjdCByMCA9IFt2aWV3 IG1jX2dldF9yZWN0YW5nbGVdOworICAgICAgICAgIGludCB4MCA9IE5TTWluWCAocjApOworICAg ICAgICAgIGludCB5MCA9IE5TTWluWSAocjApOworICAgICAgICAgIGludCB3ZDAgPSBOU1dpZHRo IChyMCk7CisgICAgICAgICAgaW50IGgwID0gTlNIZWlnaHQgKHIwKTsKKyAgICAgICAgICBpbnQg d2luZG93X3ksIHdpbmRvd19oZWlnaHQ7CisgICAgICAgICAgd2luZG93X2JveCAodywgQU5ZX0FS RUEsIDAsICZ3aW5kb3dfeSwgMCwgJndpbmRvd19oZWlnaHQpOworICAgICAgICAgIGludCB0b3Ag PSB3aW5kb3dfeTsKKyAgICAgICAgICBpbnQgaGVpZ2h0ID0gd2luZG93X2hlaWdodDsKKyAgICAg ICAgICBpbnQgd2lkdGggPSBXSU5ET1dfQ09ORklHX1NDUk9MTF9CQVJfQ09MUyAodykgKiBGUkFN RV9DT0xVTU5fV0lEVEggKGYpOworICAgICAgICAgIGludCBsZWZ0ID0gV0lORE9XX1NDUk9MTF9C QVJfQVJFQV9YICh3KTsKKyAgICAgICAgICBOU1JlY3QgcjEgPSBOU01ha2VSZWN0IChsZWZ0LCB0 b3AsIHdpZHRoLCBoZWlnaHQpOworICAgICAgICAgIC8qIFRoZSBwYXJlbnQgdmlldyBpcyBmbGlw cGVkLCBzbyB3ZSBuZWVkIHRvIGZsaXAgeSB2YWx1ZS4gKi8KKyAgICAgICAgICBFbWFjc1ZpZXcg KmZyYW1lX3ZpZXcgPSBGUkFNRV9OU19WSUVXIChmKTsKKyAgICAgICAgICBOU1JlY3QgdiA9IFtm cmFtZV92aWV3IGZyYW1lXTsKKyAgICAgICAgICByMS5vcmlnaW4ueSA9ICh2LnNpemUuaGVpZ2h0 IC0gcjEuc2l6ZS5oZWlnaHQgLSByMS5vcmlnaW4ueSk7CisgICAgICAgICAgaW50IHgxID0gTlNN aW5YIChyMSk7CisgICAgICAgICAgaW50IHkxID0gTlNNaW5ZIChyMSk7CisgICAgICAgICAgaW50 IHdkMSA9IE5TV2lkdGggKHIxKTsKKyAgICAgICAgICBpbnQgaDEgPSBOU0hlaWdodCAocjEpOwor ICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiVzIC0tIERFQUQ6XG5cCisgICAgICAgICAgeDAv eDEgKCVkLyVkKSB8IHkwL3kxICglZC8lZCkgfCB3ZDAvd2QxICglZC8lZCkgfCBoMC9oMSAoJWQv JWQpXG4iLAorICAgICAgICAgIG1jX3dpbmRvdyAodyksIHgwLCB4MSwgeTAsIHkxLCB3ZDAsIHdk MSwgaDAsIGgxKTsKKyAgICAgICAgfQorICAgICAgaWYgKFt2aWV3IG1jX2p1ZGdlXSkKICAgICAg ICAgcmVtb3ZlZCA9IFlFUzsKICAgICB9CisgICAgZWxzZSBpZiAoW3ZpZXcganVkZ2VdKQorICAg ICAgcmVtb3ZlZCA9IFlFUzsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKworICAgIH0K IAogICBpZiAocmVtb3ZlZCkKICAgICBbZXZpZXcgdXBkYXRlRnJhbWVTaXplOiBOT107CkBAIC01 MTA2LDYgKzYyNTgsMjEgQEAgc3RhdGljIExpc3BfT2JqZWN0IG5zX3N0cmluZ190b19saXNwbW9k IChjb25zdCBjaGFyICpzKQogZXh0ZXJuIGZyYW1lX3Bhcm1faGFuZGxlciBuc19mcmFtZV9wYXJt X2hhbmRsZXJzW107CiBzdGF0aWMgc3RydWN0IHJlZGlzcGxheV9pbnRlcmZhY2UgbnNfcmVkaXNw bGF5X2ludGVyZmFjZSA9CiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgbnN0ZXJtLm1g IG11c3QgYmUgaW4gdGhlIGV4YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitgcmVkaXNwbGF5X2ludGVy ZmFjZScgaW4gYGRpc3BleHRlcm4uaGAhICovCisKKyAgbWNfeF93cml0ZV9nbHlwaHMsCisgIG1j X25zX2RyYXdfd2luZG93X2N1cnNvciwKKyAgbWNfbnNfZHJhd19nbHlwaF9zdHJpbmcsCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKICAgbnNfZnJhbWVfcGFybV9oYW5kbGVycywKICAg eF9wcm9kdWNlX2dseXBocywKICAgeF93cml0ZV9nbHlwaHMsCkBAIC04NzIxLDYgKzk4ODgsNDkg QEAgLSAoQk9PTCljYW5CZWNvbWVNYWluV2luZG93CiAKIEBpbXBsZW1lbnRhdGlvbiBFbWFjc1Nj cm9sbGVyCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JT ICovCisKKy0gKHZvaWQpbWNfc2V0X3JlY3RhbmdsZTogKE5TUmVjdClyZWN0Cit7CisgIG1jX3Jl Y3RhbmdsZSA9IHJlY3Q7Cit9CisKKy0gKE5TUmVjdCltY19nZXRfcmVjdGFuZ2xlCit7CisgIHJl dHVybiBtY19yZWN0YW5nbGU7Cit9CisKKy0gKHN0cnVjdCB3aW5kb3cgKiltY19nZXRfd2luZG93 Cit7CisgIHJldHVybiB3aW5kb3c7Cit9CisKKy0gKGJvb2wpbWNfanVkZ2UKK3sKKyAgTlNUUkFD RSAoIltFbWFjc1Njcm9sbGVyIG1jX2p1ZGdlXSIpOworICBib29sIHJldCA9IGNvbmRlbW5lZDsK KyAgYmxvY2tfaW5wdXQgKCk7CisgIGlmIChjb25kZW1uZWQpCisgICAgeworICAgICAgLyogZW5z dXJlIG90aGVyIHNjcm9sbGJhciB1cGRhdGVzIGFmdGVyIGRlbGV0aW9uICovCisgICAgICBFbWFj c1ZpZ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C0xLjA7CisgICAgfQorfQor CisvKiBEcmF3IHN0cmV0Y2ggZ2x5cGggc3RyaW5nIFMuICAqLworc3RhdGljIHZvaWQKK21jX3cz Ml9kcmF3X3N0cmV0Y2hfZ2x5cGhfc3RyaW5nIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzKQorewor ICBlYXNzZXJ0IChzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKTsKKyAgaWYg KHMtPmhsID09IERSQVdfQ1VSU09SCisgICAgICAmJiAheF9zdHJldGNoX2N1cnNvcl9wKQorICAg IHsKKyAgICAgIC8qIElmIGB4LXN0cmV0Y2gtY3Vyc29yJyBpcyBuaWwsIGRvbid0IGRyYXcgYSBi bG9jayBjdXJzb3IgYXMKKyAgIHdpZGUgYXMgdGhlIHN0cmV0Y2ggZ2x5cGguICAqLworICAgICAg aW50IHdpZHRoLCBiYWNrZ3JvdW5kX3dpZHRoID0gcy0+YmFja2dyb3VuZF93aWR0aDsKKyAgICAg IGludCB4ID0gcy0+eDsKKyAgICAgIGlmICghcy0+cm93LT5yZXZlcnNlZF9wKQorICAgICAgICB7 CisgICAgICAgICAgaW50IGxlZnRfeCA9IHdpbmRvd19ib3hfbGVmdF9vZmZzZXQgKHMtPncsIFRF WFRfQVJFQSk7CisgICAgICAgICAgaWYgKHggPCBsZWZ0X3gpCisgICAgICAgICAgICB7CisgICAg ICAgICAgICAgIGJhY2tncm91bmRfd2lkdGggLT0gbGVmdF94IC0geDsKKyAgICAgICAgICAgICAg eCA9IGxlZnRfeDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgIGVsc2UKKyAgICAg ICAgeworICAgICAgICAgIC8qIEluIFIyTCByb3dzLCBkcmF3IHRoZSBjdXJzb3Igb24gdGhlIHJp Z2h0IGVkZ2Ugb2YgdGhlCisgICAgICAgICAgICAgc3RyZXRjaCBnbHlwaC4gICovCisgICAgICAg ICAgaW50IHJpZ2h0X3ggPSB3aW5kb3dfYm94X3JpZ2h0IChzLT53LCBURVhUX0FSRUEpOworICAg ICAgICAgIGlmICh4ICsgYmFja2dyb3VuZF93aWR0aCA+IHJpZ2h0X3gpCisgICAgICAgICAgICBi YWNrZ3JvdW5kX3dpZHRoIC09IHggLSByaWdodF94OworICAgICAgICAgIHggKz0gYmFja2dyb3Vu ZF93aWR0aDsKKyAgICAgICAgfQorICAgICAgd2lkdGggPSBtaW4gKEZSQU1FX0NPTFVNTl9XSURU SCAocy0+ZiksIGJhY2tncm91bmRfd2lkdGgpOworICAgICAgaWYgKHMtPnJvdy0+cmV2ZXJzZWRf cCkKKyAgICAgICAgeCAtPSB3aWR0aDsKKyAgICAgIC8qIERyYXcgY3Vyc29yLiAgKi8KKyAgICAg IHhfZHJhd19nbHlwaF9zdHJpbmdfYmdfcmVjdCAocywgeCwgcy0+eSwgd2lkdGgsIHMtPmhlaWdo dCk7CisgICAgICAvKiBDbGVhciByZXN0IHVzaW5nIHRoZSBHQyBvZiB0aGUgb3JpZ2luYWwgbm9u LWN1cnNvciBmYWNlLiAgKi8KKyAgICAgIGlmICh3aWR0aCA8IGJhY2tncm91bmRfd2lkdGgpCisg ICAgICAgIHsKKyAgICAgICAgICBYR0NWYWx1ZXMgKmdjID0gcy0+ZmFjZS0+Z2M7CisgICAgICAg ICAgaW50IHkgPSBzLT55OworICAgICAgICAgIGludCB3ID0gYmFja2dyb3VuZF93aWR0aCAtIHdp ZHRoLCBoID0gcy0+aGVpZ2h0OworICAgICAgICAgIFJFQ1QgcjsKKyAgICAgICAgICAgICAgICBI REMgaGRjID0gcy0+aGRjOworICAgICAgICAgIGlmICghcy0+cm93LT5yZXZlcnNlZF9wKQorICAg ICAgICAgICAgeCArPSB3aWR0aDsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB4ID0gcy0+ eDsKKyAgICAgICAgICBpZiAocy0+cm93LT5tb3VzZV9mYWNlX3AKKyAgICAgICAgICAgICAgJiYg Y3Vyc29yX2luX21vdXNlX2ZhY2VfcCAocy0+dykpCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIHhfc2V0X21vdXNlX2ZhY2VfZ2MgKHMpOworICAgICAgICAgICAgICBnYyA9IHMtPmdjOwor ICAgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGdjID0gcy0+ZmFjZS0+ Z2M7CisgICAgICAgICAgZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsICZyKTsKKyAgICAg ICAgICB3MzJfc2V0X2NsaXBfcmVjdGFuZ2xlIChoZGMsICZyKTsKKyNpZiAwIC8qIFRPRE86IHN0 aXBwbGUgKi8KKyAgICAgICAgICBpZiAocy0+ZmFjZS0+c3RpcHBsZSkKKyAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgLyogRmlsbCBiYWNrZ3JvdW5kIHdpdGggYSBzdGlwcGxlIHBhdHRlcm4u ICAqLworICAgICAgICAgICAgICBYU2V0RmlsbFN0eWxlIChzLT5kaXNwbGF5LCBnYywgRmlsbE9w YXF1ZVN0aXBwbGVkKTsKKyAgICAgICAgICAgICAgWEZpbGxSZWN0YW5nbGUgKHMtPmRpc3BsYXks IHMtPndpbmRvdywgZ2MsIHgsIHksIHcsIGgpOworICAgICAgICAgICAgICBYU2V0RmlsbFN0eWxl IChzLT5kaXNwbGF5LCBnYywgRmlsbFNvbGlkKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBl bHNlCisjZW5kaWYKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAo cy0+Ziwgcy0+aGRjLCBnYy0+YmFja2dyb3VuZCwgeCwgeSwgdywgaCk7CisgICAgICAgICAgICB9 CisgICAgICAgIH0KKyAgICB9CisgIGVsc2UgaWYgKCFzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wKQor ICAgIHsKKyAgICAgIGludCBiYWNrZ3JvdW5kX3dpZHRoID0gcy0+YmFja2dyb3VuZF93aWR0aDsK KyAgICA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ZmFsc2U7CisgICAg fQorICBlbHNlIGlmIChzLT5obCA9PSBEUkFXX01PVVNFX0ZBQ0UpCisgICAgeworICAgICAgeF9z ZXRfbW91c2VfZmFjZV9nYyAocyk7CisgICAgICBzLT5zdGlwcGxlZF9wID0gcy0+ZmFjZS0+c3Rp cHBsZSAhPSAwOworICAgIH0KKyAgZWxzZSBpZiAocy0+aGwgPT0gRFJBV19JTUFHRV9SQUlTRUQK KyAgICAgICAgICAgfHwgcy0+aGwgPT0gRFJBV19JTUFHRV9TVU5LRU4pCisgICAgeworICAgICAg cy0+Z2MgPSBzLT5mYWNlLT5nYzsKKyAgICAgIHMtPnN0aXBwbGVkX3AgPSBzLT5mYWNlLT5zdGlw cGxlICE9IDA7CisgICAgfQorICBlbHNlCisgICAgZW1hY3NfYWJvcnQgKCk7CisgIC8qIEdDIG11 c3QgaGF2ZSBiZWVuIHNldC4gICovCisgIGVhc3NlcnQgKHMtPmdjICE9IDApOworfQorCisvKiBE cmF3IGEgaG9sbG93IGJveCBjdXJzb3Igb24gd2luZG93IFcgaW4gZ2x5cGggcm93IFJPVy4gICov CitzdGF0aWMgdm9pZAorbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAoc3RydWN0IHdpbmRvdyAq dywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgc3RydWN0IGdseXBoX3JvdyAqcm93LCBpbnQgeCwgaW50IGZ4LCBpbnQgeSwgaW50IGZ5LAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGhwb3MsIGludCB2cG9zLCBpbnQgd2QsIGlu dCBoKQoreworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOwor ICBIREMgaGRjOworICBSRUNUIHJlY3Q7CisgIEhCUlVTSCBoYiA9IENyZWF0ZVNvbGlkQnJ1c2gg KGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeG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YWQgaW4gdGhpcworICAgICAgY2FzZSwg b24gdGhlIGFzc3VtcHRpb24gdGhhdCB0aGUgZ2x5cGgncyBjb2xvcnMgYXJlIGNob3NlbiBzbwor ICAgICAgdGhhdCB0aGUgZ2x5cGggaXMgbGVnaWJsZS4gICovCisgICAgICBpZiAoZmFjZS0+YmFj a2dyb3VuZCA9PSBjdXJzb3JfY29sb3IKKyAgICAgICAgICAmJiAhY3Vyc29yX2djX2ludmlzaWJs ZV9va2F5X3ApCisgICAgICAgIGN1cnNvcl9jb2xvciA9IGZhY2UtPmZvcmVncm91bmQ7CisgICAg ICBpbnQgZGVmYXVsdF9meCA9IFdJTkRPV19URVhUX1RPX0ZSQU1FX1BJWEVMX1ggKHcsIHgpOwor ICAgICAgaGRjID0gZ2V0X2ZyYW1lX2RjIChmKTsKKyAgICAgIHczMl9jbGlwX3RvX3JvdyAodywg cm93LCBURVhUX0FSRUEsIGhkYyk7CisgICAgICBpbnQgcnggPSBmeDsKKyAgICAgIGludCByeSA9 IGZ5OworICAgICAgaW50IHJ3ID0gd2Q7CisgICAgICBpbnQgcmggPSBoOworLyoKKyAgICBmcHJp bnRmIChzdGRlcnIsICJNQ19IQkFSOiAgZnggKCVkKSB8IGZ5ICglZCkgfCB3ZCAoJWQpIHwgaCAo JWQpXG4iLCByeCwgcnksIHJ3LCByaCk7CisqLworICAgICAgdzMyX2ZpbGxfYXJlYSAoZiwgaGRj LCBjdXJzb3JfY29sb3IsIHJ4LCByeSwgcncsIHJoKTsKKyAgICAgIHczMl9zZXRfY2xpcF9yZWN0 YW5nbGUgKGhkYywgTlVMTCk7CisgICAgICByZWxlYXNlX2ZyYW1lX2RjIChmLCBoZGMpOworICAg IH0KK30KKworLyogUklGOiBEcmF3IG9yIGNsZWFyIGN1cnNvciBvbiB3aW5kb3cgVy4gICovCitz dGF0aWMgdm9pZAorbWNfdzMyX2RyYXdfd2luZG93X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywg c3RydWN0IGdseXBoX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FyZXRfeQorICAgICAgICAgICAg PSAoV0lORE9XX1RPX0ZSQU1FX1BJWEVMX1kgKHcsIHkpCisgICAgICAgICAgICAgICArIHJvdy0+ YXNjZW50IC0gdy0+cGh5c19jdXJzb3JfYXNjZW50KTsKKyAgICAgICAgICB3MzJfc3lzdGVtX2Nh cmV0X3dpbmRvdyA9IHc7CisgICAgICAgICAgdzMyX3N5c3RlbV9jYXJldF9oZHJfaGVpZ2h0ID0g V0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgICAgICAgICAgdzMyX3N5c3RlbV9jYXJl dF9tb2RlX2hlaWdodCA9IFdJTkRPV19NT0RFX0xJTkVfSEVJR0hUICh3KTsKKyAgICAgICAgICBQ b3N0TWVzc2FnZSAoaHduZCwgV01fSU1FX1NUQVJUQ09NUE9TSVRJT04sIDAsIDApOworICAgICAg ICAgIC8qIElmIHRoZSBzaXplIG9mIHRoZSBhY3RpdmUgY3Vyc29yIGNoYW5nZWQsIGRlc3Ryb3kg dGhlIG9sZAorICAgICAgICAgICAgIHN5c3RlbSBjYXJldC4gICovCisgICAgICAgICAgaWYgKHcz Ml9zeXN0ZW1fY2FyZXRfaHduZAorICAgICAgICAgICAgICAmJiAodzMyX3N5c3RlbV9jYXJldF9o ZWlnaHQgIT0gaCkpCisgICAgICAgICAgICBQb3N0TWVzc2FnZSAoaHduZCwgV01fRU1BQ1NfREVT VFJPWV9DQVJFVCwgMCwgMCk7CisgICAgICAgICAgdzMyX3N5c3RlbV9jYXJldF9oZWlnaHQgPSBo OworICAgICAgICAgIC8qIE1vdmUgdGhlIHN5c3RlbSBjYXJldC4gICovCisgICAgICAgICAgUG9z dE1lc3NhZ2UgKGh3bmQsIFdNX0VNQUNTX1RSQUNLX0NBUkVULCAwLCAwKTsKKyAgICAgICAgfQor ICAgICAgLyogVGhlIGZyaW5nZSBiaXRtYXBzIGFyZSBwcmVzZW50bHkgaGFuZGxlZCBlbHNld2hl cmUsIGJ1dCBjb3VsZCBzb21l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UCAoQlZBUiAoYiwgbWFya19hY3RpdmUpKSk7CisgICAgICBwdHJkaWZmX3Qg cmVnaW9uX2JlZ2lubmluZyA9IChyZWdpb25fYWN0aXZlX3ApID8gWEZJWE5VTSAoRnJlZ2lvbl9i ZWdpbm5pbmcgKCkpIDogLTE7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2VuZCA9IChyZWdpb25f YWN0aXZlX3ApID8gWEZJWE5VTSAoRnJlZ2lvbl9lbmQgKCkpIDogLTE7CisgICAgICBwdHJkaWZm X3Qgb3BvaW50X3B0ID0gKHcgPT0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93KSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IFBUCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBY RklYTlVNIChGbWFya2VyX3Bvc2l0aW9uICh3LT5wb2ludG0pKTsKKyAgICAgIGJvb2wgcmVnaW9u X2luX2JvdW5kc19wID0gKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgb3BvaW50X3B0ID49IHJlZ2lvbl9iZWdpbm5pbmcKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF9wdCA8IHJlZ2lvbl9lbmQpOworICAgICAgaWYg KGN1cnNvcl9nbHlwaC0+dHlwZSAhPSBJTUFHRV9HTFlQSCAmJiBsc2wucmVkID49IDAgJiYgbHNs LmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRl bXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MnIGJ5IGJvcnJv d2luZyB0aGUKKyAgICAgICAgICBmdW5jdGlvbmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHczMmZu cy5jLiAgKi8KKyAgICAgICAgICBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICYm IHJlZ2lvbl9pbl9ib3VuZHNfcAorICAgICAgICAgICAgICAmJiBhY3RpdmVfcCkKKyAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2Zh Y2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vy c29yLXJlZ2lvbi1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9s bG93X2FjdGl2ZV9yZWdpb25fZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2FjdGl2ZV9y ZWdpb25fZmFjZV9pZCk7CisgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZl X2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2Ut Y3Vyc29yLWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3df YWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7Cisg ICAgICAgICAgICAgIGdjX3ZhbHVlcy5mb3JlZ3JvdW5kID0gaG9sbG93X2FjdGl2ZV9mYWNlLT5m b3JlZ3JvdW5kOworICAgICAgICAgICAgICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IGhvbGxvd19h Y3RpdmVfcmVnaW9uX2ZhY2UtPmJhY2tncm91bmQ7CisgICAgICAgICAgICB9CisgICAgICAgICAg ICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICYmICFyZWdp b25faW5fYm91bmRzX3AKKyAgICAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9wKQorICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgZW51bSBm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c2UgaWYgKGN1cnNvcl9nbHlwaC0+dHlwZSA9PSBJTUFHRV9HTFlQ SCAmJiBsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAg ICAgICAgICB7CisgICAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9k YXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53 MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAgICAgbWNfdzMyX2RyYXdf aG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywg d2QsIGgpOworICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBv cmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRf ZGF0YS53MzItPmN1cnNvcl9nYycgYnkgYm9ycm93aW5nIHRoZQorICAgICAgICAgICAgICBmdW5j dGlvbmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHczMmZucy5jLiAgKi8KKyAgICAgICAgICAgICAg aWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgJiYgcmVnaW9uX2luX2JvdW5k c19wCisgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcCkKKyAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9yZWdpb25fZmFjZV9p ZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3It cmVnaW9u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HN0cnVjdCBmYWNlICpob2xs b3dfYWN0aXZlX3JlZ2lvbl9vdXRfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2FjdGl2 ZV9yZWdpb25fb3V0X2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQg aG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAo IistcmVhbC1mYWtlLWN1cnNvci1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICBz dHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3df YWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICBnY192YWx1ZXMuZm9yZWdyb3Vu ZCA9IGhvbGxvd19hY3RpdmVfZmFjZS0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAg Z2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX3JlZ2lvbl9vdXRfZmFjZS0+Zm9y ZWdyb3VuZDsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYg KCFyZWdpb25fYWN0aXZlX3AgJiYgYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0g bG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1mYWNl IiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0 aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAg ICAgICAgICAgICAgICAgICAgZ2Nfd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o TlVMTCwgRlJBTUVfVzMyX1dJTkRPVyAoZiksIG1hc2ssICZnY192YWx1ZXMpOworICAgICAgICAg ICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgLyogRm9yY2UgYG1jX3czMl9zZXRf Y3Vyc29yX2djJyB0byB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djJy4gICov CisgICAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX3AgPSB0cnVlOworICAgICAgICAgICAgICBt Y19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4LCBocG9z LCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNsLCBnbHlwaF9m bGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsIGN1cnNvcl9nY19wKTsKKyAgICAgICAg ICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MgPSBvcmlnaW5hbF9jdXJzb3JfZ2M7 CisgICAgICAgICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgICAgIG1jX3czMl9k cmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZw b3MsIHdkLCBoKTsKKyAgICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNl IE1DX0hPTExPV19CT1g6CisgICAgeworICAgICAgaWYgKGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3Jl ZW4gPj0gMCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9y YXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcuICAqLworICAg ICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gY29sb3JfcGl4ZWw7Cisg ICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4 LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLncz Mi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAg ICAgIGVsc2UKKyAgICAgICAgICBtY193MzJfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBtYXRyaXgs IHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICBicmVhazsKKyAg ICB9CisgICAgY2FzZSBNQ19GSUxMRURfQk9YOgorICAgIHsKKyAgICAgIGlmIChsc2wucmVkID49 IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAgeworICAgICAg ICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2Mn IGJ5IGJvcnJvd2luZyB0aGUKKyAgICAgICAgICBmdW5jdGlvbmFsaXR5IG9mIGB4X21ha2VfZ2Mn IGluIHczMmZucy5jLiAgKi8KKyAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICBY R0NWYWx1ZXMgZ2NfdmFsdWVzOworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgbWFzayA9IEdDRm9u dCB8IEdDRm9yZWdyb3VuZCB8IEdDQmFja2dyb3VuZDsKKyAgICAgICAgICBnY192YWx1ZXMuZm9u dCA9IEZSQU1FX0ZPTlQgKGYpOworICAgICAgICAgIGdjX3ZhbHVlcy5mb3JlZ3JvdW5kID0gRlJB TUVfQkFDS0dST1VORF9QSVhFTCAoZik7CisgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQg PSBjb2xvcl9waXhlbDsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYyA9 IFhDcmVhdGVHQyAoTlVMTCwgRlJBTUVfVzMyX1dJTkRPVyAoZiksIG1hc2ssICZnY192YWx1ZXMp OworICAgICAgICAgIC8qIEZvcmNlIGBtY193MzJfc2V0X2N1cnNvcl9nYycgdG8gdXNlIGBzLT5m LT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycuICAqLworICAgICAgICAgIGJvb2wgY3Vyc29y X2djX3AgPSB0cnVlOworICAgICAgICAgIG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgs IHJvdywgRFJBV19DVVJTT1IsIHgsIGhwb3MsIHZwb3MsIGxzbCwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9wLCBj dXJzb3JfZ2NfcCk7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MgPSBv cmlnaW5hbF9jdXJzb3JfZ2M7CisgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAg fQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2Nf cCA9IGZhbHNlOworICAgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwg cm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBsc2wsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfZ2NfcCk7CisgICAgICAg ICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfQkFSOgorICAgIHsKKyAgICAg IGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAg ICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEu dzMyLT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1 cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlz aWJsZV9va2F5X3AgPSB0cnVlOworICAgICAgICAgIG1jX3czMl9kcmF3X2Jhcl9jdXJzb3IgKHcs IG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl93aWR0aCwgTUNfQkFSLCBjdXJzb3JfZ2Nf aW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3Jf cGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQor ICAgICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3Ag PSBmYWxzZTsKKyAgICAgICAgICAgIG1jX3czMl9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwg cm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgaCwgY3Vyc29yX3dpZHRoLCBNQ19CQVIsIGN1cnNvcl9nY19pbnZpc2li bGVfb2theV9wKTsKKyAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBN Q19IQkFSOgorICAgIHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAg JiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhp amFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgICBm LT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAg IGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSB0cnVlOworICAgICAgICAgIG1jX3cz Ml9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZw b3MsIHdkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl93aWR0 aCwgTUNfSEJBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIGYtPm91 dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAg ICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBib29sIGN1cnNv cl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7CisgICAgICAgICAgICBtY193MzJfZHJhd19i YXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl93aWR0aCwgTUNf SEJBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIH0KKyAgICAgIGJy ZWFrOworICAgIH0KKyAgICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7CisgIH0KKyAg ICB9Cit9CisKKy8qIERyYXcgZ2x5cGggc3RyaW5nIFMuICAqLworc3RhdGljIHZvaWQKK21jX3cz Ml9kcmF3X2dseXBoX3N0cmluZyAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgc3RydWN0IGdseXBo X21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAg ICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsLCBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3Is CisgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5 cGUsIGludCBjdXJzb3Jfd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgYWN0 aXZlX3AsIGJvb2wgY3Vyc29yX2djX3ApCit7CisgIGJvb2wgcmVsaWVmX2RyYXduX3AgPSAwOwor ICAvKiBJZiBTIGRyYXdzIGludG8gdGhlIGJhY2tncm91bmQgb2YgaXRzIHN1Y2Nlc3NvciwgZHJh dyB0aGUKKyAgICAgYmFja2dyb3VuZCBvZiB0aGUgc3VjY2Vzc29yIGZpcnN0IHNvIHRoYXQgUyBj YW4gZHJhdyBpbnRvIGl0LgorICAgICBUaGlzIG1ha2VzIFMtPm5leHQgdXNlIFhEcmF3U3RyaW5n IGluc3RlYWQgb2YgWERyYXdJbWFnZVN0cmluZy4gICovCisgIGlmIChzLT5uZXh0ICYmIHMtPnJp Z2h0X292ZXJoYW5nICYmICFzLT5mb3Jfb3ZlcmxhcHMpCisgICAgeworICAgICAgaW50IHdpZHRo OworICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAqbmV4dDsKKyAgICAgIGZvciAod2lkdGggPSAw LCBuZXh0ID0gcy0+bmV4dDsKKyAgICAgICAgICAgbmV4dCAmJiB3aWR0aCA8IHMtPnJpZ2h0X292 ZXJoYW5nOworICAgICAgICAgICB3aWR0aCArPSBuZXh0LT53aWR0aCwgbmV4dCA9IG5leHQtPm5l eHQpCisgICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSAhPSBJTUFHRV9HTFlQSCkK KyAgICAgICAgICB7CisgICAgICAgICAgICBtY193MzJfc2V0X2dseXBoX3N0cmluZ19nYyAobmV4 dCwgY3Vyc29yX2djX3ApOworICAgICAgICAgICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5n IChuZXh0KTsKKyAgICAgICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSA9PSBTVFJF VENIX0dMWVBIKQorICAgICAgICAgICAgICBtY193MzJfZHJhd19zdHJldGNoX2dseXBoX3N0cmlu ZyAobmV4dCk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHhfZHJhd19nbHlwaF9z dHJpbmdfYmFja2dyb3VuZCAobmV4dCwgdHJ1ZSk7CisgICAgICAgICAgICBuZXh0LT5udW1fY2xp cHMgPSAwOworICAgICAgICAgIH0KKyAgICB9CisgIC8qIFNldCB1cCBTLT5nYywgc2V0IGNsaXBw aW5nIGFuZCBkcmF3IFMuICAqLworICBtY193MzJfc2V0X2dseXBoX3N0cmluZ19nYyAocywgY3Vy c29yX2djX3ApOworICAvKiBEcmF3IHJlbGllZiAoaWYgYW55KSBpbiBhZHZhbmNlIGZvciBjaGFy L2NvbXBvc2l0aW9uIHNvIHRoYXQgdGhlCisgICAgIGdseXBoIHN0cmluZyBjYW4gYmUgZHJhd24g b3ZlciBpdC4gICovCisgIGlmICghcy0+Zm9yX292ZXJsYXBzCisgICAgICAmJiBzLT5mYWNlLT5i b3ggIT0gRkFDRV9OT19CT1gKKyAgICAgICYmIChzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDSEFS X0dMWVBICisgICAgICAgICAgfHwgcy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dM WVBIKSkKKyAgICB7CisgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmcgKHMpOworICAg ICAgeF9kcmF3X2dseXBoX3N0cmluZ19iYWNrZ3JvdW5kIChzLCB0cn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bmcgKHMpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBDSEFSX0dMWVBIOgorICAgICAg aWYgKHMtPmZvcl9vdmVybGFwcykKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRy dWU7CisgICAgICBlbHNlCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAo cywgZmFsc2UpOworICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAg ICAgIGJyZWFrOworICAgIGNhc2UgQ09NUE9TSVRFX0dMWVBIOgorICAgICAgaWYgKHMtPmZvcl9v dmVybGFwcyB8fCAocy0+Y21wX2Zyb20gPiAwCisgICAgICAgICAgJiYgISBzLT5maXJzdF9nbHlw aC0+dS5jbXAuYXV0b21hdGljKSkKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRy dWU7CisgICAgICBlbHNlCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAo cywgdHJ1ZSk7CisgICAgICB4X2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5k IChzKTsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgR0xZUEhMRVNTX0dMWVBIOgorICAgICAgaWYg KHMtPmZvcl9vdmVybGFwcykKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7 CisgICAgICBlbHNlCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywg ZmFsc2UpOworICAgICAgeF9kcmF3X2dseXBobGVzc19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAo cyk7CisgICAgICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7Cisg ICAgfQorICBpZiAoIXMtPmZvcl9vdmVybGFwcykKKyAgICB7CisgICAgICAvKiBEcmF3IHVuZGVy bGluZS4gICovCisgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3ApCisgICAgICAgIHsKKyAg ICAgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9XQVZFKQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICBDT0xPUlJFRiBjb2xvcjsKKyAgICAgICAgICAg ICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICBj b2xvciA9IHMtPmdjLT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAg ICAgICAgY29sb3IgPSBzLT5mYWNlLT51bmRlcmxpbmVfY29sb3I7CisgICAgICAgICAgICAgIHcz Ml9kcmF3X3VuZGVyd2F2ZSAocywgY29sb3IpOworICAgICAgICAgICAgfQorICAgICAgICAgIGVs c2UgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgdW5zaWduZWQgbG9uZyB0aGlja25lc3MsIHBvc2l0aW9u OworICAgICAgICAgICAgICBpbnQgeTsKKyAgICAgICAgICAgICAgaWYgKHMtPnByZXYgJiYgcy0+ cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3AKKyAgICAgICAgICAgICAgICAgICYmIHMtPnByZXYtPmZh Y2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAgICAgICAgICAgICB7 CisgICAgICAgICAgICAgICAgICAvKiBXZSB1c2UgdGhlIHNhbWUgdW5kZXJsaW5lIHN0eWxlIGFz IHRoZSBwcmV2aW91cyBvbmUuICAqLworICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+ cHJldi0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0g cy0+cHJldi0+dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIC8qIEdldCB0 aGUgdW5kZXJsaW5lIHRoaWNrbmVzcy4gIERlZmF1bHQgaXMgMSBwaXhlbC4gICovCisgICAgICAg ICAgICAgICAgICBpZiAocy0+Zm9udCAmJiBzLT5mb250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4g MCkKKyAgICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+Zm9udC0+dW5kZXJsaW5lX3Ro aWNrbmVzczsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgdGhp Y2tuZXNzID0gMTsKKyAgICAgICAgICAgICAgICAgIGlmICh4X3VuZGVybGluZV9hdF9kZXNjZW50 X2xpbmUpCisgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmhlaWdodCAtIHRoaWNr bmVzcykgLSAocy0+eWJhc2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJs aW5lIHBvc2l0aW9uLiAgVGhpcyBpcyB0aGUgcmVjb21tZW5kZWQKKyAgICAgICAgICAgICAgICAg ICAgICAgICB2ZXJ0aWNhbCBvZmZzZXQgaW4gcGl4ZWxzIGZyb20gdGhlIGJhc2VsaW5lIHRvIHRo ZSB0b3Agb2YKKyAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgdW5kZXJsaW5lLiAgVGhpcyBp cyBhIHNpZ25lZCB2YWx1ZSBhY2NvcmRpbmcgdG8gdGhlCisgICAgICAgICAgICAgICAgICAgICAg ICAgc3BlY3MsIGFuZCBpdHMgZGVmYXVsdCBpcworICAgICAgICAgICAgICAgICAgICAgICAgIFJP VU5EICgobWF4aW11bV9kZXNjZW50KSAvIDIpLCB3aXRoCisgICAgICAgICAgICAgICAgICAgICAg ICAgUk9VTkQgKHgpID0gZmxvb3IgKHggKyAwLjUpICAqLworICAgICAgICAgICAgICAgICAgICAg IGlmICh4X3VzZV91bmRlcmxpbmVfcG9zaXRpb25fcHJvcGVydGllcworICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBzLT5mb250ICYmIHMtPmZvbnQtPnVuZGVybGluZV9wb3NpdGlvbiA+PSAw KQorICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBzLT5mb250LT51bmRlcmxpbmVf cG9zaXRpb247CisgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAocy0+Zm9udCkKKyAgICAg ICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmZvbnQtPmRlc2NlbnQgKyAxKSAvIDI7 CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gbWF4 IChwb3NpdGlvbiwgdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0KTsKKyAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAgIC8qIENoZWNrIHRoZSBzYW5pdHkgb2YgdGhpY2tuZXNzIGFuZCBwb3Np dGlvbi4gIFdlIHNob3VsZAorICAgICAgICAgICAgICAgICBhdm9pZCBkcmF3aW5nIHVuZGVybGlu ZSBvdXQgb2YgdGhlIGN1cnJlbnQgbGluZSBhcmVhLiAgKi8KKyAgICAgICAgICAgICAgaWYgKHMt PnkgKyBzLT5oZWlnaHQgPD0gcy0+eWJhc2UgKyBwb3NpdGlvbikKKyAgICAgICAgICAgICAgICBw b3NpdGlvbiA9IChzLT5oZWlnaHQgLSAxKSAtIChzLT55YmFzZSAtIHMtPnkpOworICAgICAgICAg ICAgICBpZiAocy0+eSArIHMtPmhlaWdodCA8IHMtPnliYXNlICsgcG9zaXRpb24gKyB0aGlja25l c3MpCisgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gKHMtPnkgKyBzLT5oZWlnaHQpIC0gKHMt PnliYXNlICsgcG9zaXRpb24pOworICAgICAgICAgICAgICBzLT51bmRlcmxpbmVfdGhpY2tuZXNz ID0gdGhpY2tuZXNzOworICAgICAgICAgICAgICBzLT51bmRlcmxpbmVfcG9zaXRpb24gPXBvc2l0 aW9uOworICAgICAgICAgICAgICB5ID0gcy0+eWJhc2UgKyBwb3NpdGlvbjsKKyAgICAgICAgICAg ICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICB3 MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmdjLT5mb3JlZ3JvdW5kLCBzLT54LAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHksIHMtPndpZHRoLCAxKTsKKyAgICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+ ZmFjZS0+dW5kZXJsaW5lX2NvbG9yLCBzLT54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHksIHMtPndpZHRoLCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgLyog RHJhdyBvdmVybGluZS4gICovCisgICAgICBpZiAocy0+ZmFjZS0+b3ZlcmxpbmVfcCkKKyAgICAg ICAgeworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZHkgPSAwLCBoID0gMTsKKyAgICAgICAgICBp ZiAocy0+ZmFjZS0+b3ZlcmxpbmVfY29sb3JfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICB3MzJf ZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmdjLT5mb3JlZ3JvdW5kLCBzLT54LAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgcy0+eSArIGR5LCBzLT53aWR0aCwgaCk7CisgICAgICAgICAg ICBlbHNlCisgICAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+ZmFj ZS0+b3ZlcmxpbmVfY29sb3IsIHMtPngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMt PnkgKyBkeSwgcy0+d2lkdGgsIGgpOworICAgICAgICB9CisgICAgICAvKiBEcmF3IHN0cmlrZS10 aHJvdWdoLiAgKi8KKyAgICAgIGlmIChzLT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9wCisgICAgICAg ICAgJiYgIUZPTlRfVEVYVE1FVFJJQyAocy0+Zm9udCkudG1TdHJ1Y2tPdXQpCisgICAgICAgIHsK KyAgICAgICAgICB1bnNpZ25lZCBsb25nIGggPSAxOworICAgICAgICAgIHVuc2lnbmVkIGxvbmcg ZHkgPSAocy0+aGVpZ2h0IC0gaCkgLyAyOworICAgICAgICAgIGlmIChzLT5mYWNlLT5zdHJpa2Vf dGhyb3VnaF9jb2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMt PmYsIHMtPmhkYywgcy0+Z2MtPmZvcmVncm91bmQsIHMtPngsIHMtPnkgKyBkeSwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgIHMtPndpZHRoLCBoKTsKKyAgICAgICAgICBlbHNlCisgICAgICAg ICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmZhY2UtPnN0cmlrZV90aHJvdWdo X2NvbG9yLCBzLT54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+eSArIGR5LCBzLT53 aWR0aCwgaCk7CisgICAgICAgIH0KKyAgICAgIC8qIERyYXcgcmVsaWVmIGlmIG5vdCB5ZXQgZHJh d24uICAqLworICAgICAgaWYgKCFyZWxpZWZfZHJhd25fcCAmJiBzLT5mYWNlLT5ib3ggIT0gRkFD RV9OT19CT1gpCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYm94IChzKTsKKyAgICAgIGlm IChzLT5wcmV2KQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAqcHJl djsKKyAgICAgICAgICBmb3IgKHByZXYgPSBzLT5wcmV2OyBwcmV2OyBwcmV2ID0gcHJldi0+cHJl dikKKyAgICAgICAgICAgIGlmIChwcmV2LT5obCAhPSBzLT5obAorICAgICAgICAgICAgICAgICYm IHByZXYtPnggKyBwcmV2LT53aWR0aCArIHByZXYtPnJpZ2h0X292ZXJoYW5nID4gcy0+eCkKKyAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIEFzIHByZXYgd2FzIGRyYXduIHdoaWxl IGNsaXBwZWQgdG8gaXRzIG93biBhcmVhLCB3ZQorICAgICAgICAgICAgICAgICAgIG11c3QgZHJh dyB0aGUgcmlnaHRfb3ZlcmhhbmcgcGFydCB1c2luZyBzLT5obCBub3cuICAqLworICAgICAgICAg ICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBzYXZlID0gcHJldi0+aGw7CisgICAgICAgICAg ICAgICAgcHJldi0+aGwgPSBzLT5obDsKKyAgICAgICAgICAgICAgICBtY193MzJfc2V0X2dseXBo X3N0cmluZ19nYyAocHJldiwgY3Vyc29yX2djX3ApOworICAgICAgICAgICAgICAgIHhfc2V0X2ds eXBoX3N0cmluZ19jbGlwcGluZ19leGFjdGx5IChzLCBwcmV2KTsKKyAgICAgICAgICAgICAgICBp ZiAocHJldi0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSCkKKyAgICAgICAgICAgICAg ICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocHJldik7CisgICAgICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICAgICAgeF9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdf Zm9yZWdyb3VuZCAocHJldik7CisgICAgICAgICAgICAgICAgdzMyX3NldF9jbGlwX3JlY3Rhbmds ZSAocHJldi0+aGRjLCBOVUxMKTsKKyAgICAgICAgICAgICAgICBwcmV2LT5obCA9IHNhdmU7Cisg ICAgICAgICAgICAgICAgcHJldi0+bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICAgICAgfQorICAg ICAgICB9CisgICAgICBpZiAocy0+bmV4dCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBn bHlwaF9zdHJpbmcgKm5leHQ7CisgICAgICAgICAgZm9yIChuZXh0ID0gcy0+bmV4dDsgbmV4dDsg bmV4dCA9IG5leHQtPm5leHQpCisgICAgICAgICAgICBpZiAobmV4dC0+aGwgIT0gcy0+aGwKKyAg ICAgICAgICAgICAgICAmJiBuZXh0LT54IC0gbmV4dC0+bGVmdF9vdmVyaGFuZyA8IHMtPnggKyBz LT53aWR0aCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIEFzIG5leHQgd2ls bCBiZSBkcmF3biB3aGlsZSBjbGlwcGVkIHRvIGl0cyBvd24gYXJlYSwKKyAgICAgICAgICAgICAg ICAgICB3ZSBtdXN0IGRyYXcgdGhlIGxlZnRfb3ZlcmhhbmcgcGFydCB1c2luZyBzLT5obCBub3cu ICAqLworICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBzYXZlID0gbmV4dC0+ aGw7CisgICAgICAgICAgICAgICAgbmV4dC0+aGwgPSBzLT5obDsKKyAgICAgICAgICAgICAgICBt Y193MzJfc2V0X2dseXBoX3N0cmluZ19nYyAobmV4dCwgY3Vyc29yX2djX3ApOworICAgICAgICAg ICAgICAgIHhfc2V0X2dseXBoX3N0cmluZ19jbGlwcGluZ19leGFjdGx5IChzLCBuZXh0KTsKKyAg ICAgICAgICAgICAgICBpZiAobmV4dC0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSCkK KyAgICAgICAgICAgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAobmV4dCk7 CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgeF9kcmF3X2NvbXBvc2l0 ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAobmV4dCk7CisgICAgICAgICAgICAgICAgdzMyX3Nl dF9jbGlwX3JlY3RhbmdsZSAobmV4dC0+aGRjLCBOVUxMKTsKKyAgICAgICAgICAgICAgICBuZXh0 LT5obCA9IHNhdmU7CisgICAgICAgICAgICAgICAgbmV4dC0+bnVtX2NsaXBzID0gMDsKKyAgICAg ICAgICAgICAgICBuZXh0LT5jbGlwX2hlYWQgPSBzLT5uZXh0OworICAgICAgICAgICAgICB9Cisg ICAgICAgIH0KKyAgICB9CisgIC8qIFJlc2V0IGNsaXBwaW5nLiAgKi8KKyAgdzMyX3NldF9jbGlw X3JlY3RhbmdsZSAocy0+aGRjLCBOVUxMKTsKKyAgcy0+bnVtX2NsaXBzID0gMDsKK30KKworLyog ZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC8q IEZyaW5nZSBiaXRtYXBzLiAgKi8KIAogc3RhdGljIGludCBtYXhfZnJpbmdlX2JtcCA9IDA7CkBA IC01NDUsNiArMTQwMSwxNSBAQCB4X3VwZGF0ZV9iZWdpbiAoc3RydWN0IGZyYW1lICpmKQogICBp ZiAoISBGUkFNRV9XMzJfUCAoZikpCiAgICAgcmV0dXJuOwogCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1l ID0gZjsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBSZWdlbmVyYXRlIGRp c3BsYXkgcGFsZXR0ZSBiZWZvcmUgZHJhd2luZyBpZiBsaXN0IG9mIHJlcXVlc3RlZAogICAgICBj b2xvcnMgaGFzIGNoYW5nZWQuICovCiAgIGlmIChkaXNwbGF5X2luZm8tPnJlZ2VuX3BhbGV0dGUp CkBAIC03NTQsNiArMTYxOSwxNiBAQCB4X3VwZGF0ZV9lbmQgKHN0cnVjdCBmcmFtZSAqZikKIAog ICAvKiBNb3VzZSBoaWdobGlnaHQgbWF5IGJlIGRpc3BsYXllZCBhZ2Fpbi4gICovCiAgIE1PVVNF X0hMX0lORk8gKGYpLT5tb3VzZV9mYWNlX2RlZmVyID0gZmFsc2U7CisKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdf ZnJhbWUgPSBOVUxMOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiB9CiAKIApAQCAt NDA0MSwxMyArNDkxNiw3NCBAQCB3MzJfc2V0X3ZlcnRpY2FsX3Njcm9sbF9iYXIgKHN0cnVjdCB3 aW5kb3cgKncsCiAJICAgICAgcmVsZWFzZV9mcmFtZV9kYyAoZiwgaGRjKTsKIAkgICAgICB4X2Ns ZWFyX3VuZGVyX2ludGVybmFsX2JvcmRlciAoZik7CiAJICAgIH0KKworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyogUkVQQUlOVElO RyBXSEVOIFJFTU9WSU5HIFNDUk9MTCBCQVI6CisKKy0gU2VxdWVuY2Ugb2YgRXZlbnRzOgorCisg IC4gYHJlZGlzcGxhe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lMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCiAKIAkgIHNpLmNiU2l6ZSA9IHNpemVv ZiAoc2kpOwogCSAgc2kuZk1hc2sgPSBTSUZfUkFOR0U7CkBAIC00MzE2LDYgKzUyNTIsMjEgQEAg dzMyX2p1ZGdlX3Njcm9sbF9iYXJzIChzdHJ1Y3QgZnJhbWUgKmYpCiAgICAgewogICAgICAgc3Ry dWN0IHNjcm9sbF9iYXIgKmIgPSBYU0NST0xMX0JBUiAoYmFyKTsKIAorCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgLyogYERlc3Ryb3lX aW5kb3cnIHdpdGhpbiBgeF9zY3JvbGxfYmFyX3JlbW92ZScgcmVwYWludHMgdGhlIHJlY3Rhbmds ZS4KKyAgICAgIFRoZXJlZm9yZSwgd2UgZmlyc3Qgc2VuZCBhIG1lc3NhZ2UgdG8gaW5oaWJpdCBy ZXBhaW50aW5nLiAqLworICAgICAgaWYgKCFXSU5ET1dfTElWRV9QIChiLT53aW5kb3cpKQorICAg ICAgICB7CisgICAgICAgICAgSFdORCBod25kID0gU0NST0xMX0JBUl9XMzJfV0lORE9XIChiKTsK KyAgICAgICAgICBTZW5kTWVzc2FnZSAoaHduZCwgV01fU0VUUkVEUkFXLCBmYWxzZSwgMCk7Cisg ICAgICAgIH0KKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgeF9zY3JvbGxf YmFyX3JlbW92ZSAoYik7CiAKICAgICAgIG5leHQgPSBiLT5uZXh0OwpAQCAtNzA5MSw2ICs4MDQy LDIxIEBAIGV4dGVybiBmcmFtZV9wYXJtX2hhbmRsZXIgdzMyX2ZyYW1lX3Bhcm1faGFuZGxlcnNb XTsKIAogc3RhdGljIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlIHczMl9yZWRpc3BsYXlfaW50 ZXJmYWNlID0KIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKworLyogYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGB3MzJ0ZXJtLmNgIG11c3Qg YmUgaW4gdGhlIGV4YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitgcmVkaXNwbGF5X2ludGVyZmFjZScg aW4gYGRpc3BleHRlcm4uaGAhICovCisKKyAgbWNfeF93cml0ZV9nbHlwaHMsCisgIG1jX3czMl9k cmF3X3dpbmRvd19jdXJzb3IsCisgIG1jX3czMl9kcmF3X2dseXBoX3N0cmluZywKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogICB3MzJfZnJhbWVfcGFybV9oYW5kbGVycywKICAgeF9w cm9kdWNlX2dseXBocywKICAgeF93cml0ZV9nbHlwaHMsCmRpZmYgLS1naXQgYS9zcmMvd2luZG93 LmggYi9zcmMvd2luZG93LmgKaW5kZXggZmRlZjQwNy4uN2FjNDBkYyAxMDA2NDQKLS0tIGEvc3Jj L3dpbmRvdy5oCisrKyBiL3NyYy93aW5kb3cuaApAQCAtMzI0LDYgKzMyNCwxMjIgQEAgc3RydWN0 IHdpbmRvdwogCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCiAKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIFN1ZmZpeGVzIGZv ciB0aGUgYG1jYCB3aW5kb3cgcG9pbnRlciBwcmVmaXguICovCitzdHJ1Y3QgbXVsdGlwbGVfY3Vy c29ycworeworICAvKiBUaGUgcmVjb3JkZWQgcGl4ZWwgd2lkdGggb2YgdGhlIGxhc3QgbGluZSBu dW1iZXIgZHJhd24gZHVyaW5nIHJlZGlzcGxheSAqLworICBpbnQgbG51bV9waXhlbF93aWR0aDsK K30gbWM7CisKK3N0cnVjdCBtY19tYXRyaXgKK3sKKyAgcHRyZGlmZl90IHZwb3NfYWxsb2NhdGVk OworICBwdHJkaWZmX3QgdnBvc191c2VkOworICBwdHJkaWZmX3QgY3Vyc29yc191c2VkWzRdOwor ICBlbnVtIG1jX2NhY2hlX3R5cGUKKyAgeworICAgIE1DX0NBQ0hFLAorICAgIENIX0NBQ0hFLAor ICAgIEZDX0NBQ0hFLAorICAgIE5PX0NBQ0hFCisgIH0gY2FjaGVfdHlwZTsKKyAgc3RydWN0IG1j X3Zwb3MKKyAgeworICAgIHB0cmRpZmZfdCBjYWNoZV9hbGxvY2F0ZWRbNF07CisgICAgcHRyZGlm Zl90IGNhY2hlX3VzZWRbNF07CisgICAgc3RydWN0IG1jX2NvbnRlbnRzCisgICAgeworICAgICAg Ym9vbF9iZiBzYW1lX3AgOiAxOworICAgICAgZW51bSBtY19mcm9tX3doZXJlCisgICAgICB7Cisg ICAgICAgIE5PV0hFUkUsCisgICAgICAgIFNDUklCRV9PTkUsCisgICAgICAgIFNDUklCRV9UV08s CisgICAgICAgIFNDUklCRV9USFJFRSwKKyAgICAgICAgU0tJUFBFRCwKKyAgICAgICAgUE9TVF9D SEFOR0VELAorICAgICAgICBVTkNIQU5HRUQsCisgICAgICAgIFNFVF9DVVJTT1JfT05FLAorICAg ICAgICBTRVRfQ1VSU09SX1RXTworICAgICAgfSBmcm9tX3doZXJlOworICAgICAgc3RydWN0IGds eXBoIGdseXBoOworICAgICAgaW50IHg7CisgICAgICBpbnQgZng7CisgICAgICBpbnQgeTsKKyAg ICAgIGludCBmeTsKKyAgICAgIGludCBocG9zOworICAgICAgaW50IHZwb3M7CisgICAgICBpbnQg d2Q7CisgICAgICBpbnQgaDsKKyAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUKKyAgICAgIHsKKyAg ICAgICAgLyogTk9URTogIFRoZSBmcmluZ2UgYml0bWFwIGZyYW1ld29yayByZWxpZXMgdXBvbiBN Q19OT19GUklOR0VfQklUTUFQCisgICAgICAgIGhhdmluZyBhIHZhbHVlIG9mIHplcm8gKDApLiAq LworICAgICAgICBNQ19OT19GUklOR0VfQklUTUFQLAorICAgICAgICBNQ19OT19DVVJTT1IsCisg ICAgICAgIE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAsCisgICAgICAgIE1DX0xFRlRfRlJJTkdFX0JJ VE1BUCwKKyAgICAgICAgTUNfRlJBTUVEX0JPWCwKKyAgICAgICAgTUNfRklMTEVEX0JPWCwKKyAg ICAgICAgTUNfSE9MTE9XX0JPWCwKKyAgICAgICAgTUNfQkFSLAorICAgICAgICBNQ19IQkFSCisg ICAgICB9IGN1cnNvcl90eXBlOworICAgICAgaW50IGN1cnNvcl93aWR0aDsKKyAgICAgIHN0cnVj dCBtY19SR0IKKyAgICAgIHsKKyAgICAgICAgZG91YmxlIHJlZDsKKyAgICAgICAgZG91YmxlIGdy ZWVuOworICAgICAgICBkb3VibGUgYmx1ZTsKKyAgICAgIH0gZm9yZWdyb3VuZCwgYmFja2dyb3Vu ZDsKKyAgICAgIGJvb2xfYmYgYWN0aXZlX3AgOiAxOworICAgICAgZW51bSBtY19mbGF2b3IKKyAg ICAgIHsKKyAgICAgICAgTk9fRkxBVk9SLAorICAgICAgICBNQ19HTFlQSCwKKyAgICAgICAgTUNf R0xZUEhMRVNTLAorICAgICAgICBNQ19PVkVSTEFZX0FSUk9XX0JJVE1BUCwKKyAgICAgICAgTUNf UElMQ1JPVywKKyAgICAgICAgTUNfSE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ioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAvKiBDdXJzb3IgdHlwZSBvZiBsYXN0IGN1 cnNvciBkcmF3biBvbiB0aGUgd2luZG93LiAgKi8KICAgICBlbnVtIHRleHRfY3Vyc29yX2tpbmRz IHBoeXNfY3Vyc29yX3R5cGU7CiAKZGlmZiAtLWdpdCBhL3NyYy94ZGlzcC5jIGIvc3JjL3hkaXNw LmMKaW5kZXggYTg4ZmM2OS4uYmEzNDgwOCAxMDA2NDQKLS0tIGEvc3JjL3hkaXNwLmMKKysrIGIv c3JjL3hkaXNwLmMKQEAgLTkyMSw2ICs5MjEsNDUyMyBAQCBzdGF0aWMgdm9pZCBzaG93X21vdXNl X2ZhY2UgKE1vdXNlX0hMSW5mbyAqLCBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UpOwogc3RhdGljIGJv b2wgY29vcmRzX2luX21vdXNlX2ZhY2VfcCAoc3RydWN0IHdpbmRvdyAqLCBpbnQsIGludCk7CiAK IAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICov CisKKy8qIE1VTFRJUExFLUNVUlNPUlM6ICBFbWFjcyBCdWcgIzIyODczIChmZWF0dXJlIHJlcXVl c3QpCisKKyAgQ1JPU1NIQUlSUzogIEVtYWNzIEJ1ZyAjMTc2ODQgKGZlYXR1cmUgcmVxdWVzdCkK KworCitWRVJTSU9OOgorCistIDAyMC4wMDAgWzA1LzI3LzIwMTldCistIDAxOS4wMDAgWzA0LzIw LzIwMTldCistIDAxOC4wMDAgWzA0LzA4LzIwMTldCistIDAxNy4wMDAgWzEyLzEzLzIwMThdCist IDAxNi4wMDAgWzExLzIwLzIwMThdCistIDAxNS4wMDAgWzExLzEwLzIwMThdCistIDAxNC4wMDAg WzA4LzI4LzIwMThdCisKKworQ0hBTkdFTE9HOgorCistIENv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AgTUNfQlVJTERfSU1B R0VfR0xZUEhfU1RSSU5HIChTVEFSVCwgRU5ELCBIRUFELCBUQUlMLAkJXAorCQkJCQlITCwgWCwg TEFTVF9YKTsJCQlcCisJICAgICAgYnJlYWs7CisKKyNkZWZpbmUgTUNfQlVJTERfR0xZUEhfU1RS SU5HU19YVyhTVEFSVCwgRU5ELCBIRUFELCBUQUlMLCBITCwgWCwgTEFTVF9YKQlcCisgICAgICAg ICAgICBjYXNlIFhXSURHRVRfR0xZUEg6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBcCisgICAgICAgICAgICAgIE1DX0JVSUxEX1hXSURHRVRfR0xZUEhfU1RSSU5HIChT VEFSVCwgRU5ELCBIRUFELCBUQUlMLCAgICAgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBITCwgWCwgTEFTVF9YKTsgICAgICAgICAgICAgICBcCisgICAgICAg ICAgICAgIGJyZWFrOworCisjZGVmaW5lIE1DX0JVSUxEX0dMWVBIX1NUUklOR1NfMihTVEFSVCwg RU5ELCBIRUFELCBUQUlMLCBITCwgWCwgTEFTVF9YKQlcCisJICAgIGNhc2UgR0xZUEhMRVNTX0dM WVBIOgkJCQkJXAorCSAgICAgIE1DX0JVSUxEX0dMWVBITEVTU19HTFlQSF9TVFJJTkcgKFNUQVJU LCBFTkQsIEhFQUQsIFRBSUwsCVwKKwkJCQkJICAgIEhMLCBYLCBMQVNUX1gpOwkJXAorCSAgICAg IGJyZWFrOwkJCQkJCQlcCisJCQkJCQkJCQlcCisJICAgIGRlZmF1bHQ6CQkJCQkJCVwKKwkgICAg ICBlbWFjc19hYm9ydCAoKTsJCQkJCQlcCisJICAgIH0JCQkJCQkJCVwKKwkJCQkJCQkJCVwKKwkg IGlmIChzKQkJCQkJCQlcCisJICAgIHsJCQkJCQkJCVwKKwkgICAgICBzZXRfZ2x5cGhfc3RyaW5n X2JhY2tncm91bmRfd2lkdGggKHMsIFNUQVJ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X21lbXEgKExpc3BfT2JqZWN0IGVsdCwgTGlzcF9PYmplY3QgbGlzdCkKK3sKKyAgd2hpbGUg KDEpCisgICAgeworICAgICAgaWYgKCFDT05TUCAobGlzdCkgfHwgRVEgKFhDQVIgKGxpc3QpLCBl bHQpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlm ICghQ09OU1AgKGxpc3QpIHx8IEVRIChYQ0FSIChsaXN0KSwgZWx0KSkKKyAgICAgICAgYnJlYWs7 CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KSB8fCBF USAoWENBUiAobGlzdCksIGVsdCkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIg KGxpc3QpOworICAgIH0KKyAgcmV0dXJuIGxpc3Q7Cit9CisKK0xpc3BfT2JqZWN0CittY19udGgg KGludCBudW0sIExpc3BfT2JqZWN0IGxpc3QpCit7CisgIGZvciAoaW50IGkgPSAwOyBpIDwgbnVt ICYmICFOSUxQIChsaXN0KTsgaSsrKQorICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgaWYgKENP TlNQIChsaXN0KSkKKyAgICByZXR1cm4gWENBUiAobGlzdCk7CisgICAgZWxzZQorICAgICAgcmV0 dXJuIFFuaWw7Cit9CisKK0xpc3BfT2JqZWN0CittY19hc3NxIChMaXNwX09iamVjdCBrZXksIExp c3BfT2JqZWN0IGxpc3QpCit7CisgIHdoaWxlICgxKQorICAgIHsKKyAgICAgIGlmICghQ09OU1Ag KGxpc3QpCisgICAgICAgICAgfHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAg JiYgRVEgKFhDQVIgKFhDQVIgKGxpc3QpKSwga2V5KSkpCisgICAgICAgIGJyZWFrOworICAgICAg bGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8 fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAgICAgICAmJiBFUSAoWENBUiAoWENBUiAo bGlzdCkpLCBrZXkpKSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7 CisgICAgICBpZiAoIUNPTlNQIChsaXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlz dCkpCisgICAgICAgICAgICAgICYmIEVRIChYQ0FSIChYQ0FSIChsaXN0KSksIGtleSkpKQorICAg ICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICB9CisgIGlmIChDT05T UCAobGlzdCkpCisgICAgcmV0dXJuIFhDQVIgKGxpc3QpOworICAgIGVsc2UKKyAgICAgIHJldHVy biBRbmlsOworfQorCitMaXNwX09iamVjdAorbWNfYXNzb2MgKExpc3BfT2JqZWN0IGtleSwgTGlz cF9PYmplY3QgbGlzdCkKK3sKKyAgTGlzcF9PYmplY3QgY2FyOworICB3aGlsZSAoMSkKKyAgICB7 CisgICAgICBpZiAoIUNPTlNQIChsaXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlz dCkpCisgICAgICAgICAgICAgICYmIChjYXIgPSBYQ0FSIChYQ0FSIChsaXN0KSksCisgICAgICAg ICAgICAgICAgICBFUSAoY2FyLCBrZXkpIHx8ICFOSUxQIChGZXF1YWwgKGNhciwga2V5KSkpKSkK KyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNP TlNQIChsaXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAg ICAgICYmIChjYXIgPSBYQ0FSIChYQ0FSIChsaXN0KSksCisgICAgICAgICAgICAgICAgICBFUSAo Y2FyLCBrZXkpIHx8ICFOSUxQIChGZXF1YWwgKGNhciwga2V5KSkpKSkKKyAgICAgICAgYnJlYWs7 CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KQorICAg ICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAgICYmIChjYXIgPSBY Q0FSIChYQ0FSIChsaXN0KSksCisgICAgICAgICAgICAgICAgICBFUSAoY2FyLCBrZXkpIHx8ICFO SUxQIChGZXF1YWwgKGNhciwga2V5KSkpKSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0g WENEUiAobGlzdCk7CisgICAgfQorICBpZiAoQ09OU1AgKGxpc3QpKQorICAgIHJldHVybiBYQ0FS IChsaXN0KTsKKyAgICBlbHNlCisgICAgICByZXR1cm4gUW5pbDsKK30KKworTGlzcF9PYmplY3QK K21jX3BsaXN0X2dldCAoTGlzcF9PYmplY3QgcGxpc3QsIExpc3BfT2JqZWN0IHByb3ApCit7Cisg IExpc3BfT2JqZWN0IHRhaWwsIGhhbGZ0YWlsOworICAvKiBoYWxmdGFpbCBpcyB1c2VkIHRvIGRl dGVjdCBjaXJjdWxhciBsaXN0cy4gICovCisgIHRhaWwgPSBoYWxmdGFpbCA9IHBsaXN0OworICB3 aGlsZSAoQ09OU1AgKHRhaWwpICYmIENPTlNQIChYQ0RSICh0YWlsKSkpCisgICAgeworICAgICAg aWYgKEVRIChwcm9wLCBYQ0FSICh0YWlsKSkpCisgICAgICAgIHJldHVybiBYQ0FSIChYQ0RSICh0 YWlsKSk7CisgICAgICB0YWlsID0gWENEUiAoWENEUiAodGFpbCkpOworICAgICAgaGFsZnRhaWwg PSBYQ0RSIChoYWxmdGFpbCk7CisgICAgICBpZiAoRVEgKHRhaWwsIGhhbGZ0YWlsKSkKKyAgICAg ICAgYnJlYWs7CisgICAgfQorICByZXR1cm4gUW5pbDsKK30KKworLyogQ2hlY2sgdGhlIHByZXNl bmNlIG9mIGEgZGlzcGxheSBwcm9wZXJ0eSBhbmQgY29tcHV0ZSBpdHMgd2lkdGguCisgICBJZiBh IHByb3BlcnR5IHdh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yogVGVz dCByZWFjaGluZyB0aGUgZ29hbCBjb2x1bW4uICBXZSBkbyB0aGlzIGFmdGVyIHNraXBwaW5nCisg ICBpbnZpc2libGUgY2hhcmFjdGVycywgc28gdGhhdCB3ZSBwdXQgcG9pbnQgYmVmb3JlIHRoZQor ICAgY2hhcmFjdGVyIG9uIHdoaWNoIHRoZSBjdXJzb3Igd2lsbCBhcHBlYXIuICovCisgICAgICBp ZiAoY29sID49IGdvYWwpCisgIGJyZWFrOworICAgICAgcHJldl9jb2wgPSBjb2w7CisgICAgICB7 IC8qIENoZWNrIGRpc3BsYXkgcHJvcGVydHkuICovCisgIHB0cmRpZmZfdCBlbmRwOworICBpbnQg d2lkdGggPSBtY19jaGVja19kaXNwbGF5X3dpZHRoIChzY2FuLCBjb2wsICZlbmRwKTsKKyAgaWYg KHdpZHRoID49IDApCisgICAgeworICAgICAgY29sICs9IHdpZHRoOworICAgICAgaWYgKGVuZHAg PiBzY2FuKSAvKiBBdm9pZCBpbmZpbml0ZSBsb29wcyB3aXRoIDAtd2lkdGggb3ZlcmxheXMuICov CisgICAgICAgIHsKKyAgICBzY2FuID0gZW5kcDsKKyAgICBzY2FuX2J5dGUgPSBDSEFSX1RPX0JZ VEUgKHNjYW4pOworICAgIGNvbnRpbnVlOworICAgICAgICB9CisgICAgfQorICAgICAgfQorICAg ICAgLyogQ2hlY2sgY29tcG9zaXRpb24gc2VxdWVuY2UuICovCisgICAgICBpZiAoY21wX2l0Lmlk ID49IDAKKyAgICB8fCAoc2NhbiA9PSBjbXBfaXQuc3RvcF9wb3MKKyAgICAgICAgJiYgY29tcG9z aXRpb25fcmVzZWF0X2l0ICgmY21wX2l0LCBzY2FuLCBzY2FuX2J5dGUsIGVuZCwKKyAgICAgICAg ICB3LCBOVUxMLCBRbmlsKSkpCisgIGNvbXBvc2l0aW9uX3VwZGF0ZV9pdCAoJmNtcF9pdCwgc2Nh biwgc2Nhbl9ieXRlLCBRbmlsKTsKKyAgICAgIGlmIChjbXBfaXQuaWQgPj0gMCkKKyAgeworICAg IHNjYW4gKz0gY21wX2l0Lm5jaGFyczsKKyAgICBzY2FuX2J5dGUgKz0gY21wX2l0Lm5ieXRlczsK KyAgICBpZiAoc2NhbiA8PSBlbmQpCisgICAgICBjb2wgKz0gY21wX2l0LndpZHRoOworICAgIGlm IChjbXBfaXQudG8gPT0gY21wX2l0Lm5nbHlwaHMpCisgICAgICB7CisgICAgICAgIGNtcF9pdC5p ZCA9IC0xOworICAgICAgICBjb21wb3NpdGlvbl9jb21wdXRlX3N0b3BfcG9zICgmY21wX2l0LCBz Y2FuLCBzY2FuX2J5dGUsIGVuZCwKKyAgICAgICAgICAgICAgUW5pbCk7CisgICAgICB9CisgICAg ZWxzZQorICAgICAgY21wX2l0LmZyb20gPSBjbXBfaXQudG87CisgICAgY29udGludWU7CisgIH0K KyAgICAgIGMgPSBGRVRDSF9CWVRFIChzY2FuX2J5dGUpOworICAgICAgLyogU2VlIGlmIHRoZXJl IGlzIGEgZGlzcGxheSB0YWJsZSBhbmQgaXQgcmVsYXRlcworICAgdG8gdGhpcyBjaGFyYWN0ZXIu ICovCisgICAgICBpZiAoZHAgIT0gMAorICAgICYmICEgKG11bHRpYnl0ZSAmJiBMRUFESU5HX0NP REVfUCAoYykpCisgICAgJiYgVkVDVE9SUCAoRElTUF9DSEFSX1ZFQ1RPUiAoZHAsIGMpKSkKKyAg eworICAgIExpc3BfT2JqZWN0IGNoYXJ2ZWM7CisgICAgcHRyZGlmZl90IGksIG47CisgICAgLyog VGhpcyBjaGFyYWN0ZXIgaXMgZGlzcGxheWVkIHVzaW5nIGEgdmVjdG9yIG9mIGdseXBocy4KKyAg ICAgICBVcGRhdGUgdGhlIGNvbHVtbi9wb3NpdGlvbiBiYXNlZCBvbiB0aG9zZSBnbHlwaHMuICov CisgICAgY2hhcnZlYyA9IERJU1BfQ0hBUl9WRUNUT1IgKGRwLCBjKTsKKyAgICBuID0gQVNJWkUg KGNoYXJ2ZWMpOworICAgIGZvciAoaSA9IDA7IGkgPCBuOyBpKyspCisgICAgICB7CisgICAgICAg IC8qIFRoaXMgc2hvdWxkIGJlIGhhbmRsZWQgdGhlIHNhbWUgYXMKKyAgICAgbmV4dF9lbGVtZW50 X2Zyb21fZGlzcGxheV92ZWN0b3IgZG9lcyBpdC4gKi8KKyAgICAgICAgTGlzcF9PYmplY3QgZW50 cnkgPSBBUkVGIChjaGFydmVjLCBpKTsKKyAgICAgICAgaWYgKEdMWVBIX0NPREVfUCAoZW50cnkp KQorICAgIGMgPSBHTFlQSF9DT0RFX0NIQVIgKGVudHJ5KTsKKyAgICAgICAgZWxzZQorICAgIGMg PSAnICc7CisgICAgICAgIGlmIChjID09ICdcbicpCisgICAgZ290byBlbmRsb29wOworICAgICAg ICBpZiAoYyA9PSAnXHInICYmIEVRIChCVkFSIChjdXJyZW50X2J1ZmZlciwgc2VsZWN0aXZlX2Rp c3BsYXkpLCBRdCkpCisgICAgZ290byBlbmRsb29wOworICAgICAgICBpZiAoYyA9PSAnXHQnKQor ICAgIHsKKyAgICAgIGNvbCArPSB0YWJfd2lkdGg7CisgICAgICBjb2wgPSBjb2wgLyB0YWJfd2lk dGggKiB0YWJfd2lkdGg7CisgICAgfQorICAgICAgICBlbHNlCisgICAgKytjb2w7CisgICAgICB9 CisgIH0KKyAgICAgIGVsc2UKKyAgeworICAgIC8qIFRoZSBkaXNwbGF5IHRhYmxlIGRvZXNuJ3Qg YWZmZWN0IHRoaXMgY2hhcmFjdGVyOworICAgICAgIGl0IGRpc3BsYXlzIGFzIGl0c2VsZi4gKi8K KyAgICBpZiAoYyA9PSAnXG4nKQorICAgICAgZ290byBlbmRsb29wOworICAgIGlmIChjID09ICdc cicgJiYgRVEgKEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBzZWxlY3RpdmVfZGlzcGxheSksIFF0KSkK KyAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICBpZiAoYyA9PSAnXHQnKQorICAgICAgeworICAgICAg ICBjb2wgKz0gdGFiX3dpZHRoOworICAgICAgICBjb2wgPSBjb2wgLyB0YWJfd2lkdGggKiB0YWJf d2lkdGg7CisgICAgICB9CisgICAgZWxzZSBpZiAobXVsdGlieXRlICYmIExFQURJTkdfQ09ERV9Q IChjKSkKKyAgICAgIHsKKyAgICAgICAgLyogU3RhcnQgb2YgbXVsdGktYnl0ZSBmb3JtLiAqLwor ICAgICAgICB1bnNpZ25lZCBjaGFyICpwdHI7CisgICAgICAgIGludCBieXRlcywgd2lkdGg7Cisg ICAgICAgIHB0ciA9IEJZVEVfUE9TX0FERFIgKHNjYW5fYnl0ZSk7CisgICAgICAgIE1DX01VTFRJ QllURV9CWVRFU19XSURUSCAocHRyLCBkcCwgYnl0ZXMsIHdpZHRoKTsKKyAgICAgICAgLyogU3Vi dHJhY3Qgb25lIHRvIGNvbXBlbnNhdGUgZm9yIHRoZSBpbmNyZW1lbnQKKyAgICAgdGhhdCBpcyBn b2luZyB0byBoYXBwZW4gYmVsb3cuICovCisgICAgICAgIHNjYW5fYnl0ZSArPSBieXRlcyAtIDE7 CisgICAgICAgIGNvbCArPSB3aWR0aDsKKyAgICAgIH0KKyAgICBlbHNlIGlmIChjdGxfYXJyb3cg JiYgKGMgPCAwNDAgfHwgYyA9PSAwMTc3KSkKKyAgICAgIGNvbCArPSAyOworICAgIGVsc2UgaWYg KGMgPCAwNDAgfHwgYyA+PSAwMTc3KQorICAgICAgY29sICs9IDQ7CisgICAgZWxzZQorICAgICAg Y29sKys7CisgIH0KKyAgICAgIHNjYW4rKzsKKyAgICAgIHNjYW5fYnl0ZSsrOworICAgIH0KKyBl bmRsb29wOgorICBsYXN0X2tub3duX2NvbHVtbiA9IGNvbDsKKyAgbGFzdF9rbm93bl9jb2x1bW5f cG9pbnQgPSBwdDsKKyAgbGFzdF9rbm93bl9jb2x1bW5fbW9kaWZpZWQgPSBNT0RJRkY7CisgIGlm IChnb2FsY29sKQorICAgICpnb2FsY29sID0gY29sOworICBpZiAoZW5kcG9zKQorICAgICplbmRw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aGVyIHRoYXQgYnJpbmdzIHVzIHRvIGJl Z2lubmluZyBvZiBidWZmZXIuICovCisgICAgaWYgKEJFR1YgPj0gR1BUKQorICAgICAgYnJlYWs7 CisgIH0KKyAgICAgIGMgPSAqLS1wdHI7CisgICAgICBpZiAoZHAgJiYgVkVDVE9SUCAoRElTUF9D SEFSX1ZFQ1RPUiAoZHAsIGMpKSkKKyAgeworICAgIGNoYXJ2ZWMgPSBESVNQX0NIQVJfVkVDVE9S IChkcCwgYyk7CisgICAgbiA9IEFTSVpFIChjaGFydmVjKTsKKyAgfQorICAgICAgZWxzZQorICB7 CisgICAgY2hhcnZlYyA9IFFuaWw7CisgICAgbiA9IDE7CisgIH0KKyAgICAgIGZvciAoaSA9IG4g LSAxOyBpID49IDA7IC0taSkKKyAgeworICAgIGlmIChWRUNUT1JQIChjaGFydmVjKSkKKyAgICAg IHsKKyAgICAgICAgLyogVGhpcyBzaG91bGQgYmUgaGFuZGxlZCB0aGUgc2FtZSBhcworICAgICBu ZXh0X2VsZW1lbnRfZnJvbV9kaXNwbGF5X3ZlY3RvciBkb2VzIGl0LiAqLworICAgICAgICBMaXNw X09iamVjdCBlbnRyeSA9IEFSRUYgKGNoYXJ2ZWMsIGkpOworICAgICAgICBpZiAoR0xZUEhfQ09E RV9QIChlbnRyeSkpCisgICAgYyA9IEdMWVBIX0NPREVfQ0hBUiAoZW50cnkpOworICAgICAgICBl bHNlCisgICAgYyA9ICcgJzsKKyAgICAgIH0KKyAgICBpZiAoYyA+PSAwNDAgJiYgYyA8IDAxNzcp CisgICAgICBjb2wrKzsKKyAgICBlbHNlIGlmIChjID09ICdcbicKKyAgICAgICB8fCAoYyA9PSAn XHInCisgICAgICAgICAgICYmIEVRIChCVkFSIChjdXJyZW50X2J1ZmZlciwgc2VsZWN0aXZlX2Rp c3BsYXkpLCBRdCkpKQorICAgICAgeworICAgICAgICBwdHIrKzsKKyAgICAgICAgZ290byBzdGFy dF9vZl9saW5lX2ZvdW5kOworICAgICAg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F2aW5nIHdpZHRoIDAsIHVubGVzcworYGJ1ZmZlci1pbnZpc2liaWxpdHktc3BlYycgc3Bl Y2lmaWVzIHRoYXQgaXQgaXMgcmVwbGFjZWQgYnkgYW4gZWxsaXBzaXMuICAqLykKKyAgKExpc3Bf T2JqZWN0IHdpbmRvdywgTGlzcF9PYmplY3QgcHQpCit7CisgIHN0cnVjdCB3aW5kb3cgKncgPSBk ZWNvZGVfbGl2ZV93aW5kb3cgKHdpbmRvdyk7CisgIExpc3BfT2JqZWN0IHRlbXA7CisgIFhTRVRG QVNUSU5UICh0ZW1wLCBtY19jdXJyZW50X2NvbHVtbiAodywgWEZJWE5VTSAocHQpKSk7CisgIHJl dHVybiB0ZW1wOworfQorCisvKiBVU0FHRTogIGZwcmludGYgKHN0ZGVyciwgIkZSQU1FICglcyki LCBtY19mcmFtZSAoZikpOyAqLworY2hhciAqCittY19mcmFtZSAoc3RydWN0IGZyYW1lICpmKQor eworICBMaXNwX09iamVjdCBmcmFtZTsKKyAgWFNFVEZSQU1FIChmcmFtZSwgZik7CisgIHJldHVy biBTU0RBVEEgKEZwcmluMV90b19zdHJpbmcgKGZyYW1lLCBRbmlsKSk7Cit9CisKKy8qIFVTQUdF OiAgZnByaW50ZiAoc3RkZXJyLCAiV0lORE9XICglcykiLCBtY193aW5kb3cgKHcpKTsgKi8KK2No YXIgKgorbWNfd2luZG93IChzdHJ1Y3Qgd2luZG93ICp3KQoreworICBMaXNwX09iamVjdCB3aW5k b3c7CisgIFhTRVRXSU5ET1cgKHdpbmRvdywgdyk7CisgIHJldHVybiBTU0RBVEEgKEZwcmluMV90 b19zdHJpbmcgKHdpbmRvdywgUW5pbCkpOworfQorCisvKiBVU0FHRTogIGZwcmludGYgKHN0ZGVy ciwgIkNIQVJBQ1RFUiAoJXMpIiwgbWNfY2hhcl90b19zdHJpbmcgKGdseXBoLT51LmNoKSk7ICov CitjaGFyICoKK21jX2NoYXJfdG9fc3RyaW5nIChpbnQgYXJnKQoreworICBMaXNwX09iamVjdCBj aGFyYWN0ZXIgPSAoMCA8PSBhcmcgJiYgYXJnIDw9IE1BWF9DSEFSKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBGY2hhcl90b19zdHJpbmcgKG1ha2VfZml4bnVtIChhcmcpKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiBRbmlsOworICBjaGFyICogcmVzdWx0ID0gKCFOSUxQIChj aGFyYWN0ZXIpCisgICAgICAgICAgICAgICAgICAgJiYgYXJnID09IDkpCisgICAgICAgICAgICAg ICAgICAgID8gIlxcdCIKKyAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIpCisg ICAgICAgICAgICAgICAgICAgICAmJiBhcmcgPT0gMTApCisgICAgICAgICAgICAgICAgICAgID8g IlxcbiIKKyAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAg ICAgICAgICAgICAmJiBhcmcgPT0gMzIpCisgICAgICAgICAgICAgICAgICAgID8gIlxccyIKKyAg ICAgICAgICAgICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAgICAgICAg ICAmJiBhcmcgIT0gOQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnICE9IDEwCisgICAgICAg ICAgICAgICAgICAgICAmJiBhcmcgIT0gMzIpCisgICAgICAgICAgICAgICAgICAgID8gU1NEQVRB IChjaGFyYWN0ZXIpCisgICAgICAgICAgICAgICAgICA6ICJcXD8iOworICByZXR1cm4gcmVzdWx0 OworfQorCitpbnQKK21jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKExpc3BfT2JqZWN0IGFyZykKK3sK KyAgY2hhciAqc3RyOworICBpZiAoWFRZUEUgKGFyZykgPT0gTGlzcF9TdHJpbmcpCisgICAgc3Ry ID0gU1NEQVRBIChhcmcpOworICAgIGVsc2UgaWYgKFhUWVBFIChhcmcpID09IExpc3BfU3ltYm9s KQorICAgICAgc3RyID0gU1NEQVRBIChTWU1CT0xfTkFNRSAoYXJnKSk7CisgICAgICBlbHNlIHJl dHVybiAtMTsKKyAgaWYgKCFzdHJjbXAgKHN0ciwgIm5vIikpCisgICAgcmV0dXJuIE1DX05PX0NV UlNPUjsKKyAgaWYgKCFzdHJjbXAgKHN0ciwgIm1jLWxlZnQtZnJpbmdlLWJpdG1hcCIpKQorICAg IHJldHVybiBNQ19MRUZUX0ZSSU5HRV9CSVRNQVA7CisgIGlmICghc3RyY21wIChzdHIsICJtYy1y aWdodC1mcmluZ2UtYml0bWFwIikpCisgICAgcmV0dXJuIE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA7 CisgIGlmICghc3RyY21wIChzdHIsICJib3giKSkKKyAgICByZXR1cm4gTUNfRklMTEVEX0JPWDsK KyAgaWYgKCFzdHJjbXAgKHN0ciwgImZyYW1lZCIpKQorICAgIHJldHVybiBNQ19GUkFNRURfQk9Y OworICBpZiAoIXN0cmNtcCAoc3RyLCAiaG9sbG93IikpCisgICAgcmV0dXJuIE1DX0hPTExPV19C T1g7CisgIGlmICghc3RyY21wIChzdHIsICJiYXIiKSkKKyAgICByZXR1cm4gTUNfQkFSOworICBp ZiAoIXN0cmNtcCAoc3RyLCAiaGJhciIpKQorICAgIHJldHVybiBNQ19IQkFSOworICByZXR1cm4g LTE7Cit9CisKKy8qIFVTQUdFOiAgZnByaW50ZiAoc3RkZXJyLCAiQ1VSU09SIFRZUEUgKCVzKSIs IG1jX2N1cnNvcl90eXBlX3RvX3N0cmluZyAoYXJnKSk7ICovCitjaGFyICoKK21jX2N1cnNvcl90 eXBlX3RvX3N0cmluZyAoZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSkKK3sKKyAgc3dp dGNoIChjdXJzb3JfdHlwZSkKKyAgICB7CisgICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6IHJldHVy biAiTUNfRklMTEVEX0JPWCI7CisgICAgICBjYXNlIE1DX0ZSQU1FRF9CT1g6IHJldHVybiAiTUNf R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SX0xBU1RfUElYRUxfRkFDRV9JRCAvKiBRd2luZG93X2RpdmlkZXJfbGFz dF9waXhlbCAqLworICAgICAgICAgIHx8IGZhY2VfaWQgPT0gVkVSVElDQUxfQk9SREVSX0ZBQ0Vf SUQgLyogUXZlcnRpY2FsX2JvcmRlciAqLworICAgICAgICAgIHx8IGZhY2VfaWQgPT0gSU5URVJO QUxfQk9SREVSX0ZBQ0VfSUQpKSAvKiBRaW50ZXJuYWxfYm9yZGVyICovCisgICAgZmFjZSA9IEZB Q0VfRlJPTV9JRCAoZiwgbG9va3VwX2Jhc2ljX2ZhY2UgKHcsIGYsIGZhY2VfaWQpKTsKKyAgICBl bHNlCisgICAgICBmYWNlID0gRkFDRV9GUk9NX0lEIChmLCBmYWNlX2lkKTsKKyAgTGlzcF9PYmpl Y3QgY29sb3IgPSAoZmFjZSAhPSBOVUxMKQorICAgICAgICAgICAgICAgICAgICAgID8gZmFjZS0+ bGZhY2VbTEZBQ0VfQkFDS0dST1VORF9JTkRFWF0KKyAgICAgICAgICAgICAgICAgICAgICA6IGJ1 aWxkX3N0cmluZyAoIk9yYW5nZVJlZCIpOworICBtY194d19jb2xvcl92YWx1ZXMgKHcsIGNvbG9y LCBsc2wpOworfQorCit2b2lkCittY19zZXRfZXNzZW50aWFscyAoc3RydWN0IHdpbmRvdyAqdywg c3RydWN0IG1jX2Vzc2VudGlhbHMgKmVzc2VudGlhbHMpCit7CisgIGlmICghQlVGRkVSUCAody0+ Y29udGVudHMpKQorICAgIHJldHVybjsKKyAgaWYgKE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgbWNfY29uZikpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBmY192aXNpYmxlKSkpCisgICAgcmV0dXJuOworICBzdHJ1Y3QgZnJhbWUgKmYgPSBY RlJBTUUgKHctPmZyYW1lKTsKKyAgZXNzZW50aWFscy0+YWN0aXZlX3AgPSAodyA9PSBYV0lORE9X IChmLT5zZWxlY3RlZF93aW5kb3cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGYgPT0g RlJBTUVfRElTUExBWV9JTkZPIChmKS0+eF9oaWdobGlnaHRfZnJhbWUpOworICBMaXNwX09iamVj dCBidWYgPSB3LT5jb250ZW50czsKKyAgQ0hFQ0tfQlVGRkVSIChidWYpOworICBzdHJ1Y3QgYnVm ZmVyICpiID0gWEJVRkZFUiAoYnVmKTsKKyAgc3RydWN0IGJ1ZmZlciAqb2xkX2J1ZmZlciA9IE5V TEw7CisgIHB0cmRpZmZfdCBvcG9pbnQgPSAodyA9PSBYV0lORE9XIChzZWxlY3RlZF93aW5kb3cp KQorICAgICAgICAgICAgICAgICAgICAgPyBQVAorICAgICAgICAgICAgICAgICAgICAgOiBYRklY TlVNIChGbWFya2VyX3Bvc2l0aW9uICh3LT5wb2ludG0pKTsKKyAgcHRyZGlmZl90IGZjX2N1cnJl bnRfY29sID0gbWNfY3VycmVudF9jb2x1bW4gKHcsIG9wb2ludCk7CisgIGludCBmcmFtZV9jaGFy X3dpZHRoID0gRlJBTUVfQ09MVU1OX1dJRFRIIChmKTsKKyAgYm9vbCBmaWxsX2NvbHVtbl9wID0g IU5JTFAgKEJWQVIgKGIsIGZpbGxfY29sdW1uKSk7CisgIGludCBmaWxsX2NvbCA9IFhGSVhOVU0g KEJWQVIgKGIsIGZpbGxfY29sdW1uKSk7CisgIGludCBoc2NsX3ggPSB3LT5oc2Nyb2xsICogZnJh bWVfY2hhcl93aWR0aDsKKyAgaWYgKGIgIT0gY3VycmVudF9idWZmZXIpCisgICAgeworICAgICAg b2xkX2J1ZmZlciA9IGN1cnJlbnRfYnVmZmVyOworICAgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAo Yik7CisgICAgfQorICBlc3NlbnRpYWxzLT56diA9IFpWOworICBlc3NlbnRpYWxzLT56dl9ieXRl ID0gWlZfQllURTsKKyAgZXNzZW50aWFscy0+ZmNfeCA9IChmaWxsX2NvbHVtbl9wCisgICAgICAg ICAgICAgICAgICAgICAgJiYgIU5JTFAgKFZkaXNwbGF5X2xpbmVfbnVtYmVycykpCisgICAgICAg ICAgICAgICAgICAgICAgID8gKGZpbGxfY29sICogZnJhbWVfY2hhcl93aWR0aCkgKyB3LT5tYy5s bnVtX3BpeGVsX3dpZHRoIC0gaHNjbF94CisgICAgICAgICAgICAgICAgICAgICA6IChmaWxsX2Nv bHVtbl9wCisgICAgICAgICAgICAgICAgICAgICAgICAmJiBOSUxQIChWZGlzcGxheV9saW5lX251 bWJlcnMpKQorICAgICAgICAgICAgICAgICAgICAgICA/IChmaWxsX2NvbCAqIGZyYW1lX2NoYXJf d2lkdGgpIC0gaHNjbF94CisgICAgICAgICAgICAgICAgICAgICA6IDA7CisgIGlmIChvbGRfYnVm ZmVyKQorICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworICBlbnVtIGZhY2Vf aWQgZmlsbF9jb2x1bW5fZmFjZV9pZCA9CisgICAgKCFlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAg ICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY19pbmFjdGl2ZV93aW5k b3dzKSkKKyAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hh aXJzKSkpCisgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCJmYy1pbmFj dGl2ZS1mYWNlIiksIHRydWUpCisgICAgOiAoIWVzc2VudGlhbHMtPmFjdGl2ZV9wCisgICAgICAg JiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfaW5hY3RpdmVfd2luZG93 cykpCisgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGR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mVl ZCB0byBkcmF3IGFkamFjZW50CisgICBnbHlwaHMgdXNpbmcgbW91c2UtZmFjZSBoaWdobGlnaHRp bmcuICovCisgICAgICBpZiAoYXJlYSA9PSBURVhUX0FSRUEgJiYgcm93LT5tb3VzZV9mYWNlX3AK KyAgICAgICAgICAmJiBobGluZm8tPm1vdXNlX2ZhY2VfYmVnX3JvdyA+PSAwCisgICAgICAgICAg JiYgaGxpbmZvLT5tb3VzZV9mYWNlX2VuZF9yb3cgPj0gMCkKKyAgICAgICAgeworICAgICAgICAg IHB0cmRpZmZfdCByb3dfdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCB3LT5jdXJyZW50X21h dHJpeCk7CisgICAgICAgICAgaWYgKHJvd192cG9zID49IGhsaW5mby0+bW91c2VfZmFjZV9iZWdf cm93CisgICAgICAgICAgICAgICYmIHJvd192cG9zIDw9IGhsaW5mby0+bW91c2VfZmFjZV9lbmRf cm93KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBjaGVja19tb3VzZV9mYWNlID0gdHJ1 ZTsKKyAgICAgICAgICAgICAgbW91c2VfYmVnX2NvbCA9IChyb3dfdnBvcyA9PSBobGluZm8tPm1v dXNlX2ZhY2VfYmVnX3JvdykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gaGxpbmZv LT5tb3VzZV9mYWNlX2JlZ19jb2wKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogMDsK KyAgICAgICAgICAgICAgbW91c2VfZW5kX2NvbCA9IChyb3dfdnBvcyA9PSBobGluZm8tPm1vdXNl X2ZhY2VfZW5kX3JvdykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gaGxpbmZvLT5t b3VzZV9mYWNlX2VuZF9jb2wKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogcm93LT51 c2VkW1RFWFRfQVJFQV07CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIC8qIENvbXB1 dGUgb3Zlcmhhbm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PmFjdGlvbl90eXBlID0gYWN0aW9uX3R5cGU7Cisg ICAgICAgICAgICAgIGxlbmd0aCArPSBzLT5maXJzdF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAg ICAgICAgICB9CisgICAgICAgICAgcmVsYXRpdmVfeCA9IHN0YXJ0X3ggLSBsZW5ndGg7CisgICAg ICAgICAgZm9yIChzID0gaDsgczsgcyA9IHMtPm5leHQpCisgICAgICAgICAgICB7CisgICAgICAg ICAgICAgIHMtPmZpcnN0X2dseXBoLT5yZWxhdGl2ZV94ID0gcmVsYXRpdmVfeDsKKyAgICAgICAg ICAgICAgcmVsYXRpdmVfeCArPSBzLT5maXJzdF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAg ICAgICB9CisgICAgICAgICAgc3RhcnQgPSBpOworICAgICAgICAgIGNvbXB1dGVfb3Zlcmhhbmdz X2FuZF94ICh0LCBoZWFkLT54LCB0cnVlKTsKKyAgICAgICAgICBwcmVwZW5kX2dseXBoX3N0cmlu Z19saXN0cyAoJmhlYWQsICZ0YWlsLCBoLCB0KTsKKyAgICAgICAgICBpZiAoY2xpcF9oZWFkID09 IE5VTEwpCisgICAgICAgICAgICBjbGlwX2hlYWQgPSBoZWFkOworICAgICAgICB9CisgICAgICAv KiBQcmVwZW5kIGdseXBoIHN0cmluZ3MgZm9yIGdseXBocyBpbiBmcm9udCBvZiB0aGUgZmlyc3Qg Z2x5cGgKKyAgICAgIHN0cmluZyB0aGF0IG92ZXJ3cml0ZSB0aGF0IGdseXBoIHN0cmluZyBiZWNh dXNlIG9mIHRoZWlyCisgICAgICByaWdodCBvdmVyaGFuZy4gIEZvciB0aGVzZSBzdHJpbmdzLCBv bmx5IHRoZSBmb3JlZ3JvdW5kIG11c3QKKyAgICAgIGJlIGRyYXduLCBiZWNhdXNlIGl0IGRyYXdz IG92ZXIgdGhlIGdseXBoIHN0cmluZyBhdCBgaGVhZCcuCisgICAgICBUaGUgYmFja2dyb3VuZCBt dXN0IG5vdCBiZSBkcmF3biBiZWNhdXNlIHRoaXMgd291bGQgb3ZlcndyaXRlCisgICAgICByaWdo dCBvdmVyaGFuZ3Mgb2YgcHJlY2VkaW5nIGdseXBocyBmb3Igd2hpY2ggbm8gZ2x5cGgKKyAgICAg IHN0cmluZ3MgZXhpc3QuICovCisgICAgICBpID0gbGVmdF9vdmVyd3JpdGluZyAoaGVhZCk7Cisg ICAgICBpZiAoaSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19m YWNlIG92ZXJsYXBfaGw7CisgICAgICAgICAgaWYgKGNoZWNrX21vdXNlX2ZhY2UKKyAgICAgICAg ICAgICAgJiYgbW91c2VfYmVnX2NvbCA8IHN0YXJ0ICYmIG1vdXNlX2VuZF9jb2wgPiBpKQorICAg ICAgICAgICAgb3ZlcmxhcF9obCA9IERSQVdfTU9VU0VfRkFDRTsKKyAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgb3ZlcmxhcF9obCA9IERSQVdfTk9STUFMX1RFWFQ7CisgICAgICAgICAg aWYgKGhsID09IG92ZXJsYXBfaGwgfHwgY2xpcF9oZWFkID09IE5VTEwpCisgICAgICAgICAgICBj bGlwX2hlYWQgPSBoZWFkOworICAgICAgICAgIE1DX0JVSUxEX0dMWVBIX1NUUklOR1MgKGksIHN0 YXJ0LCBoLCB0LCBvdmVybGFwX2hsLCBkdW1teV94LCBsYXN0X3gpOworICAgICAgICAgIGZvciAo cyA9IGg7IHM7IHMgPSBzLT5uZXh0KQorICAgICAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRf cCA9IHRydWU7CisgICAgICAgICAgY29tcHV0ZV9vdmVyaGFuZ3NfYW5kX3ggKHQsIGhlYWQtPngs IHRydWUpOworICAgICAgICAgIHByZXBlbmRfZ2x5cGhfc3RyaW5nX2xpc3RzICgmaGVhZCwgJnRh aWwsIGgsIHQpOworICAgICAgICB9CisgICAgICAvKiBBcHBlbmQgZ2x5cGhzIHN0cmluZ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ICAg YXBwZW5kX2dseXBoX3N0cmluZ19saXN0cyAoJmhlYWQsICZ0YWlsLCBoLCB0KTsKKyAgICAgICAg ICBpZiAoY2xpcF90YWlsID09IE5VTEwpCisgICAgICAgICAgICBjbGlwX3RhaWwgPSB0YWlsOwor ICAgICAgICB9CisgICAgICAvKiBBcHBlbmQgZ2x5cGggc3RyaW5ncyBmb3IgZ2x5cGhzIGZvbGxv d2luZyB0aGUgbGFzdCBnbHlwaAorICAgICAgc3RyaW5nIHRhaWwgdGhhdCBvdmVyd3JpdGUgdGFp bC4gIFRoZSBmb3JlZ3JvdW5kIG9mIHN1Y2gKKyAgICAgIGdseXBocyBoYXMgdG8gYmUgZHJhd24g YmVjYXVzZSBpdCB3cml0ZXMgaW50byB0aGUgYmFja2dyb3VuZAorICAgICAgb2YgdGFpbC4gIFRo ZSBiYWNrZ3JvdW5kIG11c3Qgbm90IGJlIGRyYXduIGJlY2F1c2UgaXQgY291bGQKKyAgICAgIHBh aW50IG92ZXIgdGhlIGZvcmVncm91bmQgb2YgZm9sbG93aW5nIGdseXBocy4gKi8KKyAgICAgIGkg PSByaWdodF9vdmVyd3JpdGluZyAodGFpbCk7CisgICAgICBpZiAoaSA+PSAwKQorICAgICAgICB7 CisgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIG92ZXJsYXBfaGw7CisgICAgICAgICAg aWYgKGNoZWNrX21vdXNlX2ZhY2UKKyAgICAgICAgICAgICAgJiYgbW91c2VfYmVnX2NvbCA8IGkg JiYgbW91c2VfZW5kX2NvbCA+IGVuZCkKKyAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX01P VVNFX0ZBQ0U7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBE UkFXX05PUk1BTF9URVhUOworICAgICAgICAgIGlmIChobCA9PSBvdmVybGFwX2hsIHx8IGNsaXBf dGFpbCA9PSBOVUxMKQorICAgICAgICAgICAgY2xpcF90YWlsID0gdGFpbDsKKyAgICAgICAgICBp Kys7ICAgICAgLyogV2UgbXVzdCBpbmNsdWRlIHRoZSBJdGggZ2x5cGguICovCisgICAgICAgICAg TUNfQlVJTERfR0xZUEhfU1RSSU5HUyAoZW5kLCBpLCBoLCB0LCBvdmVybGFwX2hsLCB4LCBsYXN0 X3gpOworICAgICAgICAgIGZvciAocyA9IGg7IHM7IHMgPSBzLT5uZXh0KQorICAgICAgICAgICAg cy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICAgICAgY29tcHV0ZV9vdmVyaGFu Z3NfYW5kX3ggKGgsIHRhaWwtPnggKyB0YWlsLT53aWR0aCwgZmFsc2UpOworICAgICAgICAgIGFw cGVuZF9nbHlwaF9zdHJpbmdfbGlzdHMgKCZoZWFkLCAmdGFpbCwgaCwgdCk7CisgICAgICAgIH0K KyAgICAgIHRhaWwgPSBnbHlwaF9zdHJpbmdfY29udGFpbmluZ19iYWNrZ3JvdW5kX3dpZHRoICh0 YWlsKTsKKyAgICAgIGlmIChjbGlwX3RhaWwpCisgICAgICAgIGNsaXBfdGFpbCA9IGdseXBoX3N0 cmluZ19jb250YWluaW5nX2JhY2tncm91bmRfd2lkdGggKGNsaXBfdGFpbCk7CisgICAgICBpZiAo Y2xpcF9oZWFkIHx8IGNsaXBfdGFpbCkKKyAgICAgICAgZm9yIChzID0gaGVhZDsgczsgcyA9IHMt Pm5leHQpCisgICAgICAgICAgeworICAgICAgICAgICAgcy0+Y2xpcF9oZWFkID0gY2xpcF9oZWFk OworICAgICAgICAgICAgcy0+Y2xpcF90YWlsID0gY2xpcF90YWlsOworICAgICAgICAgIH0KKyAg ICB9CisgIC8qIERyYXcgYWxsIHN0cmluZ3MuICovCisgIGZvciAocyA9IGhlYWQ7IHMgJiYgZHJh d19wOyBzID0gcy0+bmV4dCkKKyAgICBGUkFNRV9SSUYgKGYpLT5tY19zY3JpYmVfc3RyaW5nIChz LCBtYXRyaXgsIHJvdywgbHNsLCBnbHlwaF9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hdHJpeCwgc3RydWN0IGdseXBoX3Jv dyAqcm93LAorICAgICAgICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBobCwg aW50IHgsIGludCBocG9zLCBpbnQgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qg bWNfUkdCIGxzbCwgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yLAorICAgICAgICAgICAgICAg ICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUsIGludCB3ZCwgYm9vbCBhY3Rp dmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICBib29sIGN1cnNvcl9nY19wKQoreworICBzdHJ1 Y3QgZ2x5cGhfcm93ICpib3R0b21fcm93ID0gTUFUUklYX0JPVFRPTV9URVhUX1JPVyAobWF0cml4 LCB3KTsKKyAgaW50IGJvdHRvbV92cG9zID0gTUFUUklYX1JPV19WUE9TIChib3R0b21fcm93LCBt YXRyaXgpOworLyoKKyAgICAgIHN0cnVjdCBnbHlwaCAqY3Vyc29yX2dseXBoID0gbWNfZ2V0X2N1 cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIGhwb3MsIHZwb3MpOworICAgICAgZnByaW50ZiAo c3RkZXJyLCAibWNfZHJhd19jdXJzb3JfZ2x5cGg6ICBjaCAoJWQpIHwgeCAoJWQpLCBocG9zICgl ZCksIHZwb3MoJWQpLCBobCAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jf Z2x5cGgtPnUuY2gsIHgsIGhwb3MsIHZwb3MsIGhsKTsKKyovCisgIGJsb2NrX2lucHV0ICgpOwor ICBib29sIGRyYXdfcCA9IHRydWU7CisgIG1jX2RyYXdfZ2x5cGhzICh3LCBtYXRyaXgsIHJvdywg eCwgVEVYVF9BUkVBLCBocG9zLCBocG9zICsgMSwgaGwsIDAsCisgICAgICAgICAgICAgICAgICB2 cG9zLCBib3R0b21fdnBvcywgbHNsLCBnb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aXgtPm5yb3dzIG1lYW5zIHRoYXQgd2luZG93IGhhcyBiZWVuIHJlc2l6 ZWQuCisgICAgIERvbid0IGJvdGhlciB0byBlcmFzZSB0aGUgY3Vyc29yLiAqLworICBpZiAodnBv cyA+PSBtYXRyaXgtPm5yb3dzKQorICAgIHsKKyAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICBm cHJpbnRmIChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6ICByZXR1cm4gKCVkKVxuIiwgMik7Cisg ICAgICByZXR1cm47CisgICAgfQorICAvKiBJZiByb3cgY29udGFpbmluZyBjdXJzb3IgaXMgbWFy a2VkIGludmFsaWQsIHRoZXJlIGlzIG5vdGhpbmcgd2UKKyAgICAgY2FuIGRvLiAqLworICBpZiAo IXJvdy0+ZW5hYmxlZF9wKQorICAgIHsKKyAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICBmcHJp bnRmIChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6ICByZXR1cm4gKCVkKVxuIiwgMyk7CisgICAg ICByZXR1cm47CisgICAgfQorICAvKiBJZiBsaW5lIHNwYWNpbmcgaXMgPiAwLCBvbGQgY3Vyc29y IG1heSBvbmx5IGJlIHBhcnRpYWxseSB2aXNpYmxlIGluCisgICAgIHdpbmRvdyBhZnRlciBzcGxp dC13aW5kb3cuICBTbyBhZGp1c3QgdmlzaWJsZSBoZWlnaHQuICovCisgIHJvdy0+dmlzaWJsZV9o ZWlnaHQgPSBtaW4gKHJvdy0+dmlzaWJsZV9oZWlnaHQsCisgICAgICAgICAgICB3aW5kb3dfdGV4 dF9ib3R0b21feSAodykgLSByb3ctPnkpOworICAvKiBJZiByb3cgaXMgY29tcGxldGVseSBpbnZp c2libGUsIGRvbid0IGF0dGVtcHQgdG8gZGVsZXRlIGEgY3Vyc29yIHdoaWNoCisgICAgIGlzbid0 IHRoZXJlLiAgVGhpcyBjYW4gaGFwcGVuIGlmIGN1cnNvciBpcyBhdCB0b3Agb2YgYSB3a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Bl bmQgb2YgYSBsaW5lIChvbiBhIG5ld2xpbmUpLiAgVGhlIGN1cnNvciBhcHBlYXJzIHRoZXJlLCBi dXQKKyAgICAgIG1vdXNlIGhpZ2hsaWdodGluZyBkb2VzIG5vdC4gKi8KKyAgICAgICYmIHJvdy0+ dXNlZFtURVhUX0FSRUFdID4gaHBvcyAmJiBocG9zID49IDApCisgICAgbW91c2VfZmFjZV9oZXJl X3AgPSB0cnVlOworICAvKiBNYXliZSBjbGVhciB0aGUgZGlzcGxheSB1bmRlciB0aGUgY3Vyc29y LiAqLworICBpZiAoY3Vyc29yX3R5cGUgPT0gTUNfSE9MTE9XX0JPWAorICAgICAgfHwgY3Vyc29y X3R5cGUgPT0gTUNfRlJBTUVEX0JPWCkKKyAgICB7CisgICAgICBpbnQgdGVtcF94ID0geDsKKyAg ICAgIGludCBoZWFkZXJfbGluZV9oZWlnaHQgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3 KTsKKyAgICAgIGN1cnNvcl9nbHlwaCA9IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwg cm93LCBocG9zLCB2cG9zKTsKKyAgICAgIGlmIChjdXJzb3JfZ2x5cGggPT0gTlVMTCkKKyAgICAg ICAgeworICAgICAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJy LCAibWNfZXJhc2VfY3Vyc29yOiAgcmV0dXJuICglZClcbiIsIDcpOworICAgICAgICAgIHJldHVy bjsKKyAgICAgICAgfQorICAgICAgaW50IHRlbXBfd2QgPSBjdXJzb3JfZ2x5cGgtPnBpeGVsX3dp ZHRoOworICAgICAgaWYgKHRlbXBfeCA8IDApCisgICAgICAgIHsKKyAgICAgICAgICB0ZW1wX3dk ICs9IHRlbXBfeDsKKyAgICAgICAgICB0ZW1wX3ggPSAwOworICAgICAgICB9CisgICAgICB0ZW1w X3dkID0gbWluICh3ZCwgd2luZG93X2JveF93aWR0aCAodywgVEVYVF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Vz dHMsCisgIGVhc3NlcnQgKG1hdHJpeCAmJiBtYXRyaXgtPnJvd3MpOworICBlYXNzZXJ0IChyb3cg Pj0gMCAmJiByb3cgPCBtYXRyaXgtPm5yb3dzKTsgKi8KKyAgYm9vbCBiYXJmX2NyYXNoX29uZSA9 IChtYXRyaXggJiYgbWF0cml4LT5yb3dzKSA/IGZhbHNlIDogdHJ1ZTsKKyAgaWYgKGJhcmZfY3Jh c2hfb25lKQorICAgIHJldHVybjsKKyAgYm9vbCBiYXJmX2NyYXNoX3R3byA9ICh2cG9zID49IDAg JiYgdnBvcyA8IG1hdHJpeC0+bnJvd3MpID8gZmFsc2UgOiB0cnVlOworICBpZiAoYmFyZl9jcmFz aF90d28pCisgICAgcmV0dXJuOworICBpZiAoeCA8IDAKKyAgICAgIHx8IHkgPCAwCisgICAgICB8 fCBocG9zIDwgMAorICAgICAgfHwgdnBvcyA8IDApCisgICAgcmV0dXJuOworICBMaXNwX09iamVj dCBidWYgPSB3LT5jb250ZW50czsKKyAgQ0hFQ0tfQlVGRkVSIChidWYpOworICBib29sIGF1dG9f aHNjcm9sbF9tb2RlX3AgPSBFUSAoRmJ1ZmZlcl9sb2NhbF92YWx1ZSAoUWF1dG9faHNjcm9sbF9t b2RlLCBidWYpLCBRY3VycmVudF9saW5lKTsKKyAgLyogRVhBTVBMRTogIChzY3JvbGwtbGVmdCA1 KSAqLworICBib29sIGhzY2xfYWxsX3RlbXBfcCA9ICh3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAor ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IDApOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8 IGFuZCBkbyBub3RoaW5nLiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMF9wID0gKHctPnN1c3Bl bmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Ny b2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAw CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gdy0+aHNjcm9sbCk7 CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIHNvbWV0aGluZyBlbHNlIGJlc2lkZXMg aG9yaXpvbnRhbGx5IHNjcm9sbGluZyB0aGUKKyAgICAgICAgICAgICAgIGN1cnJlbnQgbGluZSBk aWZmZXJlbnRseS4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9u dGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8xX3Ag PSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHct PmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3Jv bGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0g dy0+aHNjcm9sbCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIC4uLgorICAgICAgICAg ICAgICAgQ3VycmVudCBsaW5lIGlzIF9ub3RfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJl bnRseS4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzJfcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hz Y3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9w CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA9PSAwCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgIT0gdy0+aHNjcm9sbCk7CisgIC8qIEVY QU1QTEU6ICAoc2Nyb2xsLWxlZnQgNSk7IGFuZCwgdGhlbiBwcmVzcyB0aGUgbGVmdCBhcnJvdyBr ZXkgb25lIHRpbWUuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFs bHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuKi8KKyAgYm9vbCBoc2NsX3RlbXBfcCA9ICghdy0+c3Vz cGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxf bW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAg ICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMt dSBDLXggPCBhbmQgZG8gc29tZXRoaW5nIHRoYXQgY2F1c2VzIHRoZSBjdXJyZW50IGxpbmUgdG8g YmUKKyAgICAgICAgICAgICAgIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4KKyAg ICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBfaXNfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZm ZXJlbnRseS4gKi8KKyAgYm9vbCBoc2NsX3Blcm1fcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3Jv bGwKKyAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAg ICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAm JiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNj cm9sbCAhPSB3LT5oc2Nyb2xsKTsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFt ZSk7CisgIGludCBmcmluZ2VfYml0bWFwID0gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgaW50IGZh Y2VfaWQgPSBERUZBVUxUX0ZBQ0VfSUQ7CisgIGlmICghcmVtb3ZlX3AKKyAgICAgICYmIGdseXBo X2ZsYXZvciA9PSBNQ19PVkVSTEFZX0FSUk9XX0JJVE1BUAorICAgICAgJiYgIWhzY2xfYWxsX3Rl bXBfcAorICAgICAgJiYgIWhzY2xfdGVtcF9wCisgICAgICAmJiAhaHNjbF9wZXJtX3AKKyAgICAg ICYmICFoc2NsX2FsbF9wZXJtXzBfcAorICAgICAgJiYgIWhzY2xfYWxsX3Blcm1fMV9wCisgICAg ICAmJiAhaHNjbF9hbGxfcGVybV8yX3ApCisgICAgeworICAgICAgZW51bSBmYWNlX2lkIG92ZXJs YXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICghYWN0aXZlX3AKKyAgICAgICAgICYmICFOSUxQ IChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAg ICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93 LWluYWN0aXZlLWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgOiAoYWN0aXZlX3ApCisgICAgICAgICAg PyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWZhY2Ui KSwgdHJ1ZSkKKyAgICAgICAg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T0gTUNfT1ZFUkxBWV9BUlJPV19CSVRNQVAKKyAgICAgICAgICAgICAmJiAo aHNjbF9hbGxfdGVtcF9wCisgICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxsX3Blcm1fMF9wCisg ICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxsX3Blcm1fMV9wCisgICAgICAgICAgICAgICAgIHx8 IGhzY2xfYWxsX3Blcm1fMl9wCisgICAgICAgICAgICAgICAgIHx8IGhzY2xfdGVtcF9wCisgICAg ICAgICAgICAgICAgIHx8IGhzY2xfcGVybV9wKSkKKyAgICAgIHsKKyAgICAgICAgZW51bSBmYWNl X2lkIG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICAgKCFhY3RpdmVfcAorICAgICAg ICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF9pbmFjdGl2ZV93 aW5kb3dzKSkpCisgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgi Ky1vdmVybGF5LWFycm93LWhzY2wtaW5hY3RpdmUtZmFjZSIpLCB0cnVlKQorICAgICAgICAgIDog KGFjdGl2ZV9wKQorICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJu ICgiKy1vdmVybGF5LWFycm93LWhzY2wtZmFjZSIpLCB0cnVlKQorICAgICAgICAgIDogREVGQVVM VF9GQUNFX0lEOworICAgICAgICBmYWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJ TkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgID8gb3ZlcmxheV9hcnJvd19mYWNlX2lkCisg ICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgaWYgKGhzY2xfYWxs X3Blcm1fMF9wKQorICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1h cCAodywgaW50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AgICAgICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAg ICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gZmFjZV9pZDsKKyAgICAgICAgcm93LT5s ZWZ0X2ZyaW5nZV9vZmZzZXQgPSAwOworICAgICAgICByb3ctPmZyaW5nZV9iaXRtYXBfcGVyaW9k aWNfcCA9IGZhbHNlOworICAgICAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXAgKHcsIHJvdywgdHJ1 ZSwgY3Vyc29yX3R5cGUpOworICAgICAgfQorICAgICAgZWxzZSBpZiAoIXJlbW92ZV9wCisgICAg ICAgICAgICAgICAmJiAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRf QVJST1cKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURf SE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIHx8IGdseXBo X2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFCisgICAgICAgICAgICAgICAgICAgfHwgZ2x5 cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAg ICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJS T1cKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFS CisgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJ Q0FMX0JBUgorICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNB TF9CQVJfQkFDS1NMQVNIKSkKKyAgICAgICAgeworICAgICAgICAgIExpc3BfT2JqZWN0IGJpdG1h cF9mbGF2b3IgPSAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJS T1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hvbGxvd19y ZWN0YW5nbGVfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRf QVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2 ZXJzZWRfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRSkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVj dGFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2Zs YXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19S RVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9 PSBNQ19WRVJUSUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBRbWNfdmVydGljYWxfYmFyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxf YmFyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZv ciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jhcl9iYWNrc2xhc2gKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBRbmlsOworICAgICAgICAgIGZyaW5nZV9iaXRt YXAgPSAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBsb29rdXBfZnJpbmdlX2JpdG1hcCAoYml0bWFwX2ZsYXZvcikKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICAg IGZhY2VfaWQgPSAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAorICAgICAg ICAgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVD VEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxh dm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAg ICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIp KQorICAgICAgICAgICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVy biAoIistcmV2ZXJzZWQtdmVydGljYWwtYmFyLWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAg ICAgICAgOiAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAorICAgICAgICAg ICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RB TkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3Ig IT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAg ICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAg ICAgICAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy12 ZXJ0aWNhbC1iYXItZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRf RkFDRV9JRDsKKyAgICAgICAgICByb3ctPmN1cnNvcl9pbl9mcmluZ2VfcCA9IGZhbHNlOworICAg ICAgICAgIHJvdy0+cmlnaHRfZnJpbmdlX2JpdG1hcCA9IGZyaW5nZV9iaXRtYXA7CisgICAgICAg ICAgcm93LT5yaWdodF9mcmluZ2VfZmFjZV9pZCA9IGZhY2VfaWQ7CisgICAgICAgICAgcm93LT5y aWdodF9mcmluZ2Vfb2Zmc2V0ID0gMDsKKyAgICAgICAgICByb3ctPmZyaW5nZV9iaXRtYXBfcGVy aW9kaWNfcCA9IGZhbHNlOworICAgICAgICAgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcCAodywgcm93 LCBmYWxzZSwgY3Vyc29yX3R5cGUpOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKGdseXBo X2ZsYXZvciA9PSBNQ19HTFlQSAorICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0g TUNfR0xZUEhMRVNTKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgb25fcCA9IHRydWU7 CisgICAgICAgICAgICBGUkFNRV9SSUYgKGYpLT5tY19zY3JpYmVfY3Vyc29yICh3LCBtYXRyaXgs IHJvdywgeCwgZngsIHksIGZ5LCBocG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgdnBvcywgd2QsIGgsIGxzbCwgY3Vyc29yX3R5cGUsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIGdseXBoX2Zs YXZvciwgb25fcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGFjdGl2ZV9wKTsKKyAgICAgICAgICB9Cit9CisKKy8qIER1bXAgY29udGVudHMgb2YgZ2x5cGgg R0xZUEggdG8gc3RkZXJyLiAgUk9XIGFuZCBBUkVBIGFyZQorICAgdGhlIGdseXBoIHJvdyBhbmQg YXJlYSB3aGVyZSB0aGUgZ2x5cGggY29tZXMgZnJvbS4gKi8KK3ZvaWQKK21jX2R1bXBfZ2x5cGgg KHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgc3RydWN0IGdseXBoICpnbHlwaCwgaW50IGFyZWEsCisg ICAgICAgICAgICAgICBpbnQgcmVsYXRpdmVfeCwgaW50IHZwb3MpCit7CisgIGlmIChnbHlwaC0+ dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICB8fCBnbHlwaC0+dHlwZSA9PSBHTFlQSExFU1NfR0xZ UEgpCisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBEImQvJS01 ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUz ZCAgJTNkICVzICVzXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0s CisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAt IDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9H TFlQSAorICAgICAgICAgPyAnQycKKyAgICAgICAgIDogJ0cnKSwKKyAgICAgICAgZ2x5cGgtPmNo YXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAnQicK KyAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJwor ICAgICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgID8gJzAn CisgICAgICAgICAgICAgICA6ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAor ICAgICAgICBnbHlwaC0+dS5jaCwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGds eXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAor ICAgICAgICBnbHlwaC0+eCwgZ2x5cGgtPnksIGdseXBoLT5ocG9zLCB2cG9zLCBnbHlwaC0+enZf cCA/ICJaViIgOiAiLS0iLAorICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAoZ2x5cGgtPnUuY2gp KTsKKyAgICB9CisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IFNUUkVUQ0hfR0xZUEgpCisgICAg eworICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMg JTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNkICVz ICVzXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAg ICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAg ICAgICByZWxhdGl2ZV94LAorICAgICAgICAnUycsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAor ICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ0InCisgICAg ICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAg ICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJzAnCisgICAgICAg ICAgOiAnLScpKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgMHUsCisg ICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAor ICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPngsIGdseXBo LT55LCBnbHlwaC0+aHBvcywgdnBvcywgZ2x5cGgtPnp2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAg ICAgIlxcUyIpOworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgp CisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBEImQvJS01ZCAl NWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUzZCAg JTNkICVzICVjXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisg ICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEp LAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAnSScsCisgICAgICAgIGdseXBoLT5jaGFy cG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ0In CisgICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1Mn CisgICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJzAnCisg ICAgICAgICAgOiAnLScpKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAg KHVuc2lnbmVkIGludCkgZ2x5cGgtPnUuaW1nX2lkLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwK KyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2Jv eF9saW5lX3AsCisgICAgICAgIGdseXBoLT54LCBnbHlwaC0+eSwgZ2x5cGgtPmhwb3MsIHZwb3Ms IGdseXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7CisgICAgfQorICBlbHNl IGlmIChnbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpCisgICAgeworICAgICAgZnByaW50 ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2Qg MHglMDZ4IiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAg ICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAg ICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJysnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywK KyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdCJworICAg ICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAg ICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICcwJworICAgICAg ICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgICh1bnNp Z25lZCBpbnQpIGdseXBoLT51LmNtcC5pZCk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgJTRk ICUxLjFkJTEuMWQiLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxl ZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3ApOworICAgICAg aWYgKGdseXBoLT51LmNtcC5hdXRvbWF0aWMpCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAl NWQgJTRkICAlM2QgICUzZCAlcyAuIFslZC0lZF1cbiIsCisgICAgICAgICAgICAgICAgICAgICAg ICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgdnBvcywgZ2x5cGgtPnp2X3AgPyAi WlYiIDogIi0tIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaC0+c2xpY2UuY21wLmZy b20sIGdseXBoLT5zbGljZS5jbXAudG8pOworICAgICAgICBlbHNlCisgICAgICAgIGZwcmludGYg KHN0ZGVyciwgIlxuIik7CisgICAgfQorICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBYV0lER0VU X0dMWVBIKQorICAgIHsKKyNpZm5kZWYgSEFWRV9YV0lER0VUUworICAgICAgZWFzc3VtZSAoZmFs c2UpOworI2Vsc2UKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIiAgJTVkLyUtNWQg JTVkICU0YyAlNmQgJWMgJTNkIDB4JTA1eCAlNGQgJTEuMWQlMS4xZCAlNWQgJTRkICAlM2QgICUz ZCAlcyAlY1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAg ICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwK KyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ1gnLAorICAgICAgICBnbHlwaC0+Y2hhcnBv cywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgID8gJ0InCisg ICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAg ICAgICAgIDogJy0nKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgZ2x5 cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGds eXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+dS54d2lkZ2V0LAorICAgICAg ICBnbHlwaC0+eCwgZ2x5cGgtPnksIGdseXBoLT5ocG9zLCB2cG9zLCBnbHlwaC0+enZfcCA/ICJa ViIgOiAiLS0iLAorICAgICAgICAnLicpOworI2VuZGlmCisgICAgfQorfQorCisvKiBEdW1wIHRo ZSBjb250ZW50cyBvZiBnbHlwaCByb3cgYXQgVlBPUyBpbiBNQVRSSVggdG8gc3RkZXJyLgorICAg R0xZUEhTIDAgbWVhbnMgZG9uJ3Qgc2hvdyBnbHlwaCBjb250ZW50cy4KKyAgIEdMWVBIUyAxIG1l YW5zIHNob3cgZ2x5cGhzIGluIHNob3J0IGZvcm0KKyAgIEdMWVBIUyA+IDEgbWVhbnMgc2hvdyBn bHlwaHMgaW4gbG9uZyBmb3JtLiAqLwordm9pZAorbWNfZHVtcF9nbHlwaF9yb3cgKHN0cnVjdCBn bHlwaF9yb3cgKnJvdywgaW50IHZwb3MsIGludCBnbHlwaHMpCit7CisgIGludCByZWxhdGl2ZV94 ID0gMDsKKyAgaWYgKGdseXBocyAhPSAxKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwg IlxuRFVNUCBHTFlQSCBST1dcbiIpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiUm93ICAgICBT dGFydCAgICAgICBFbmQgVXNlZCBvRT48XFxDVFpGZXNtICAgICBYICAgIFkgICAgVyAgICBIICAg IFYgICAgQSAgICBQXG4iKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIj09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PVxuIik7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIlM2QgJTkicEQiZCAlOSJwRCJk ICU0ZCAlMS4xZCUxLjFkJTEuMWQlMS4xZFwKKyUxLjFkJTEuMWQlMS4xZCUxLjFkJTEuMWQlMS4x ZCUxLjFkJTEuMWQgICU0ZCAlNGQgJTRkICU0ZCAlNGQgJTRkICU0ZFxuIiwKKyAgICAgICAgIHZw b3MsCisgICAgICAgICBNQVRSSVhfUk9XX1NUQVJUX0NIQVJQT1MgKHJvdyksCisgICAgICAgICBN QVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpLAorICAgICAgICAgcm93LT51c2VkW1RFWFRfQVJF QV0sCisgICAgICAgICByb3ctPmNvbnRhaW5zX292ZXJsYXBwaW5nX2dseXBoc19wLAorICAgICAg ICAgcm93LT5lbmFibGVkX3AsCisgICAgICAgICByb3ctPnRydW5jYXRlZF9vbl9sZWZ0X3AsCisg ICAgICAgICByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wLAorICAgICAgICAgcm93LT5jb250aW51 ZWRfcCwKKyAgICAgICAgIE1BVFJJWF9ST1dfQ09OVElOVUFUSU9OX0xJTkVfUCAocm93KSwKKyAg ICAgICAgIE1BVFJJWF9ST1dfRElTUExBWVNfVEVYVF9QIChyb3cpLAorICAgICAgICAgcm93LT5l bmRzX2F0X3p2X3AsCisgICAgICAgICByb3ctPmZpbGxfbGluZV9wLAorICAgICAgICAgcm93LT5l bmRzX2luX21pZGRsZV9vZl9jaGFyX3AsCisgICAgICAgICByb3ctPnN0YXJ0c19pbl9taWRkbGVf b2ZfY2hhcl9wLAorICAgICAgICAgcm93LT5tb3VzZV9mYWNlX3AsCisgICAgICAgICByb3ctPngs CisgICAgICAgICByb3ctPnksCisgICAgICAgICByb3ctPnBpeGVsX3dpZHRoLAorICAgICAgICAg cm93LT5oZWlnaHQsCisgICAgICAgICByb3ctPnZpc2libGVfaGVpZ2h0LAorICAgICAgICAgcm93 LT5hc2NlbnQsCisgICAgICAgICByb3ctPnBoeXNfYXNjZW50KTsKKyAgICAgIC8qIFRoZSBuZXh0 IDMgbGluZXMgc2hvdWxkIGFsaWduIHRvICJTdGFydCIgaW4gdGhlIGhlYWRlci4gKi8KKyAgICAg IGZwcmludGYgKHN0ZGVyciwgIiAgICAlOSJwRCJkICU5InBEImRcdCU1ZFxuIiwgcm93LT5zdGFy dC5vdmVybGF5X3N0cmluZ19pbmRleCwKKyAgICAgICAgIHJvdy0+ZW5kLm92ZXJsYXlfc3RyaW5n X2luZGV4LAorICAgICAgICAgcm93LT5jb250aW51YXRpb25fbGluZXNfd2lkdGgpOworICAgICAg ZnByaW50ZiAoc3RkZXJyLCAiICAgICU5InBEImQgJTkicEQiZFxuIiwKKyAgICAgICAgIENIQVJQ T1MgKHJvdy0+c3RhcnQuc3RyaW5nX3BvcyksCisgICAgICAgICBDSEFSUE9TIChyb3ctPmVuZC5z dHJpbmdfcG9zKSk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgICAgJTlkICU5ZFxuIiwgcm93 LT5zdGFydC5kcHZlY19pbmRleCwKKyAgICAgICAgIHJvdy0+ZW5kLmRwdmVjX2luZGV4KTsKKyAg ICB9CisgIGlmIChnbHlwaHMgPiAxKQorICAgIHsKKyAgICAgIGZvciAoaW50IGFyZWEgPSBMRUZU X01BUkdJTl9BUkVBOyBhcmVhIDwgTEFTVF9BUkVBOyArK2FyZWEpCisgIHsKKyAgICBzdHJ1Y3Qg Z2x5cGggKmdseXBoID0gcm93LT5nbHlwaHNbYXJlYV07CisgICAgc3RydWN0IGdseXBoICpnbHlw aF9lbmQgPSBnbHlwaCArIHJvdy0+dXNlZFthcmVhXTsKKyAgICAvKiBHbHlwaCBmb3IgYSBsaW5l IGVuZCBpbiB0ZXh0LiAqLworICAgIGlmIChhcmVhID09IFRFWFRfQVJFQSAmJiBnbHlwaCA9PSBn bHlwaF9lbmQgJiYgZ2x5cGgtPmNoYXJwb3MgPiAwKQorICAgICAgKytnbHlwaF9lbmQ7CisgICAg aWYgKGdseXBoIDwgZ2x5cGhfZW5kKQorICAgICAgZnByaW50ZiAoc3RkZXJyLCAiR2x5cGgjL1Rv dGFsIFJlbC5YIFQgICAgICAgUG9zIE8gICBXICAgICBDb2RlIEZhY2UgTFIgICAgIFggICAgWSBI UE9TIFZQT1MgWlYgQ1xuIik7CisgICAgZm9yICg7IGdseXBoIDwgZ2x5cGhfZW5kOyArK2dseXBo KQorICAgICAgeworICAgICAgICBtY19kdW1wX2dseXBoIChyb3csIGdseXBoLCBhcmVhLCByZWxh dGl2ZV94LCB2cG9zKTsKKyAgICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7 CisgICAgICB9CisgIH0KKyAgICB9CisgIGVsc2UgaWYgKGdseXBocyA9PSAxKQorICAgIHsKKyAg ICAgIGNoYXIgc1tTSFJUX01BWCArIDRdOworICAgICAgZm9yIChpbnQgYXJlYSA9IExFRlRfTUFS R0lOX0FSRUE7IGFyZWEgPCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAgeworICAgIGludCBpOworICAg IGZvciAoaSA9IDA7IGkgPCByb3ctPnVzZWRbYXJlYV07ICsraSkKKyAgICAgIHsKKyAgICAgICAg c3RydWN0IGdseXBoICpnbHlwaCA9IHJvdy0+Z2x5cGhzW2FyZWFdICsgaTsKKyAgICAgICAgaWYg KGkgPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgJiYgYXJlYSA9PSBURVhUX0FSRUEKKyAg ICAgICYmIE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAmJiBnbHlwaC0+dHlwZSA9PSBDSEFS X0dMWVBICisgICAgICAmJiBnbHlwaC0+dS5jaCA9PSAnICcpCisgICAgeworICAgICAgc3RyY3B5 ICgmc1tpXSwgIltcXG5dIik7CisgICAgICBpICs9IDQ7CisgICAgfQorICAgICAgICBlbHNlIGlm IChnbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAgICAgICYmIGdseXBoLT51LmNoIDwg MHg4MAorICAgICAgICAgICAmJiBnbHlwaC0+dS5jaCA+PSAnICcpCisgICAgc1tpXSA9IGdseXBo LT51LmNoOworICAgICAgICBlbHNlCisgICAgc1tpXSA9ICcuJzsKKyAgICAgIH0KKyAgICBzW2ld ID0gJ1wwJzsKKyAgICBmcHJpbnRmIChzdGRlcnIsICIlM2Q6ICglZCkgJyVzJ1xuIiwgdnBvcywg cm93LT5lbmFibGVkX3AsIHMpOworICB9CisgICAgfQorfQorCitERUZVTiAoIm1jLWR1bXAtZ2x5 cGgtcm93IiwgRm1jX2R1bXBfZ2x5cGhfcm93LCBTbWNfZHVtcF9nbHlwaF9yb3csIDEsIDIsICJQ IiwKKyAgICAgICBkb2M6IC8qIER1bXAgZ2x5cGggcm93IFJPVyB0byBzdGRlcnIuCitJbnRlcmFj dGl2ZWx5LCBST1cgaXMgdGhlIHByZWZpeCBudW1lcmljIGFyZ3VtZW50IGFuZCBkZWZhdWx0cyB0 bwordGhlIHJvdyB3aGljaCBkaXNwbGF5cyBwb2ludC4KK09wdGlvbmFsIGFyZ3VtZW50IEdMWVBI UyAwIG1lYW5zIGRvbid0IGR1bXAgZ2x5cGhzLgorR0xZUEhTIDEgbWVhbnMgZHVtcCBnbHlwaHMg aW4gc2hvcnQgZm9ybS4KK0dMWVBIUyA+IDEgb3Igb21pdHRlZCBtZWFucyBkdW1wIGdseXBocyBp biBsb25nIGZvcm0uICAqLykKKyAgKExpc3BfT2JqZWN0IHJvdywgTGlzcF9PYmplY3QgZ2x5cGhz KQoreworICBzdHJ1Y3Qgd2luZG93ICp3ID0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93KTsKKyAg c3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgIEVNQUNT X0lOVCB2cG9zOworICBpZiAoTklMUCAocm93KSkKKyAgICB7CisgICAgICBpbnQgZDEsIGQyLCBk MywgZDQsIGQ1LCB5cG9zOworICAgICAgYm9vbCB2aXNpYmxlX3AgPSBwb3NfdmlzaWJsZV9wICh3 LCBQVCwgJmQxLCAmZDIsICZkMywgJmQ0LCAmZDUsICZ5cG9zKTsKKyAgICAgIGludCBoZWFkZXJf bGluZV9oZWlnaHQgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgICAgIGludCB2 b2Zmc2V0ID0gKGhlYWRlcl9saW5lX2hlaWdodCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICYm IHlwb3MgPiAwKQorICAgICAgICAgICAgICAgICAgICAgID8geXBvcyArIDEKKyAgICAgICAgICAg ICAgICAgICAgICA6IHlwb3M7CisgICAgICBpZiAodmlzaWJsZV9wKQorICAgICAgICB2cG9zID0g dm9mZnNldDsKKyAgICAgICAgZWxzZQorICAgICAgICAgIHZwb3MgPSAwOworICAgIH0KKyAgICBl bHNlCisgICAgICB7CisgICAgICAgIENIRUNLX05VTUJFUiAocm93KTsKKyAgICAgICAgdnBvcyA9 IFhGSVhOVU0gKHJvdyk7CisgICAgICB9CisgIGlmICh2cG9zID49IDAgJiYgdnBvcyA8IG1hdHJp eC0+bnJvd3MpCisgICAgbWNfZHVtcF9nbHlwaF9yb3c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ICBzdHJ1Y3Qgd2luZG93ICp3ID0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93KTsKKyAgc3Ry dWN0IGJ1ZmZlciAqYnVmZmVyID0gWEJVRkZFUiAody0+Y29udGVudHMpOworICBmcHJpbnRmIChz dGRlcnIsICJQVCA9ICUicEQiZCwgQkVHViA9ICUicEQiZC4gWlYgPSAlInBEImRcbiIsCisgICAg IEJVRl9QVCAoYnVmZmVyKSwgQlVGX0JFR1YgKGJ1ZmZlciksIEJVRl9aViAoYnVmZmVyKSk7Cisg IGZwcmludGYgKHN0ZGVyciwgIkN1cnNvciB4ID0gJWQsIHkgPSAlZCwgaHBvcyA9ICVkLCB2cG9z ID0gJWRcbiIsCisgICAgIHctPmN1cnNvci54LCB3LT5jdXJzb3IueSwgdy0+Y3Vyc29yLmhwb3Ms IHctPmN1cnNvci52cG9zKTsKKyAgZnByaW50ZiAoc3RkZXJyLCAiPT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4iKTsKKyAgbWNfZHVtcF9nbHlwaF9tYXRyaXgg KHctPmN1cnJlbnRfbWF0cml4LAorICAgICAgICAgVFlQRV9SQU5HRURfRklYTlVNUCAoaW50LCBn bHlwaHMpID8gWEZJWE5VTSAoZ2x5cGhzKSA6IDApOworICByZXR1cm4gUW5pbDsKK30KKwordm9p ZAorbWNfcmVzZXRfY2FjaGUgKHN0cnVjdCB3aW5kb3cgKncpCit7CisgIGlmICghQlVGRkVSUCAo dy0+Y29udGVudHMpKQorICAgIHJldHVybjsKKyAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2Fj aGVfdHlwZSA9IE1DX0NBQ0hFOworICAgICAgIGNhY2hlX3R5cGUgPCBOT19DQUNIRTsKKyAgICAg ICArK2NhY2hlX3R5cGUpCisgICAgeworICAgICAgYm9vbCBidmFyX2FjdGl2ZV9wOworICAgICAg c3dpdGNoIChjYWNoZV90eXBlKQorICAgICAgICB7CisgICAgICAgICAgY2FzZSBOT19DQUNIRToK KyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAg ICAgICAgIGNhc2UgTUNfQ0FDSEU6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmIChC VUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICYmIE5JTFAgKEJWQVIgKFhC VUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQorICAgICAgICAgICAgICAgIGJ2YXJfYWN0 aXZlX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBlbHNlIGlmIChCVUZGRVJQICh3LT5jb250 ZW50cykKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBtY19jb25mKSkpCisgICAgICAgICAgICAgICAgICBidmFyX2FjdGl2ZV9w ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAg Y2FzZSBDSF9DQUNIRToKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKEJVRkZFUlAg KHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisgICAgICAgICAgICAgICAgYnZhcl9hY3RpdmVf cCA9IGZhbHNlOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRz KQorICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICAgICAgICAgICAgICAgIGJ2YXJfYWN0aXZlX3Ag PSB0cnVlOworICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBj YXNlIEZDX0NBQ0hFOgorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAoQlVGRkVSUCAo dy0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3 LT5jb250ZW50cyksIGZjX3Zpc2libGUpKSkKKyAgICAgICAgICAgICAgICBidmFyX2FjdGl2ZV9w ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoQlVGRkVSUCAody0+Y29udGVudHMp CisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgZmNfdmlzaWJsZSkpKQorICAgICAgICAgICAgICAgICAgYnZhcl9hY3RpdmVfcCA9 IHRydWU7CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9Cisg ICAgICBpZiAoIWJ2YXJfYWN0aXZlX3ApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBEZWNyZWFz ZSB0aGUgc2l6ZSBvZiB0aGUgYXJyYXkgdG8gYSBiYXJlIG1pbmltdW0uICovCisgICAgICAgICAg Zm9yIChpbnQgdm50aCA9IDA7IHZudGggPCB3LT5tY19tYXRyaXgudnBvc191c2VkOyArK3ZudGgp CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmICh3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV0gPiAxKQorICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd ID0KKyAgICAgICAgICAgICAgICAgICAgeG5yZWFsbG9jICh3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXSwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBz aXplb2YgKnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY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oZSBjb3VudGVyIGB3LT5tY19tYXRyaXgudnBvc1tAXS5jYWNoZV91c2VkW2Nh Y2hlX3R5cGVdYCwgd2UgdHJhY2sgY3VycmVudCBkYXRhLgorICAgICAgICBlbHNlIGlmIChidmFy X2FjdGl2ZV9wKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGZvciAoaW50IHZudGggPSAwOyB2 bnRoIDwgdy0+bWNfbWF0cml4LnZwb3NfdXNlZDsgKyt2bnRoKQorICAgICAgICAgICAgICB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdID0gMDsKKyAgICAgICAg ICAgIHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVfdHlwZV0gPSAwOworICAgICAgICAg IH0KKyAgICB9CisvKgorICBmb3IgKGludCB2bnRoID0gMDsKKyAgICAgICB2bnRoIDwgdy0+bWNf bWF0cml4LnZwb3NfdXNlZDsKKyAgICAgICArK3ZudGgpCisgICAgZm9yIChlbnVtIG1jX2NhY2hl X3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOworICAgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NB Q0hFOworICAgICAgICAgKytjYWNoZV90eXBlKQorICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNf cmVzZXRfY2FjaGUgKCVkKTogICVzXG5cCisgIHctPm1jX21hdHJpeC52cG9zX3VzZWQgKCVkKVxu XAorICB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkWyVzXSAoJWQpXG5cCisgIHctPm1jX21hdHJp eC5jdXJzb3JzX3VzZWRbJXNdICglZClcblwKKyAgdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFsl c10gKCVkKVxuXAorICB3LT5tY19tYXRyaXgudnBvc1slZF0uY2FjaGVfdXNlZFslc10gKCVkKVxu XAorICB3LT5tY19tYXRyaXgudnBvc1slZF0uY2FjaGVfdXNlZFslc10gKCVkKVxuXAorICB3LT5t Y19tY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lZCwgZm9yZWdyb3VuZC5ncmVlbiwKKyAgICAgIGZvcmVncm91bmQuYmx1ZSwgYmFj a2dyb3VuZC5yZWQsIGJhY2tncm91bmQuZ3JlZW4sIGJhY2tncm91bmQuYmx1ZSk7CisgICAgfQor ICBib29sIHJlbW92ZV9wID0gZmFsc2U7CisgIGlmIChkcmF3X3AKKyAgICAgICYmIChmcm9tX3do ZXJlID09IFNLSVBQRUQKKyAgICAgICAgICB8fCBmcm9tX3doZXJlID09IFBPU1RfQ0hBTkdFRAor ICAgICAgICAgIHx8IGZyb21fd2hlcmUgPT0gVU5DSEFOR0VECisgICAgICAgICAgfHwgZnJvbV93 aGVyZSA9PSBTRVRfQ1VSU09SX1RXTykpCisgICAgeworICAgICAgYm9vbCBzYW1lX3AgPSBmYWxz ZTsKKyAgICAgIGZvciAoaW50IG50aCA9IDA7IG50aCA8IHctPm1jX21hdHJpeC52cG9zW3JuXS5j YWNoZV91c2VkW2NhY2hlX3R5cGVdOyArK250aCkKKyAgICAgICAgeworICAgICAgICAgIHNhbWVf cCB8PQorICAgICAgICAgICAgKHctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLnNhbWVfcCA9PSB0cnVlCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nb cm5dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGgudHlwZSA9PSBnbHlwaC0+dHlwZQorICAg ICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBlXVtudGhd LmdseXBoLmJ5dGVwb3MgPT0gZ2x5cGgtPmJ5dGVwb3MKKyAgICAgICAgICAgICAmJiB3LT5tY19t YXRyaXgudnBvc1tybl0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5nbHlwaC5jaGFycG9zID09IGds eXBoLT5jaGFycG9zCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hl W2NhY2hlX3R5cGVdW250aF0uZ2x5cGgudS52YWwgPT0gZ2x5cGgtPnUudmFsCisgICAgICAgICAg ICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGgu ZmFjZV9pZCA9PSBnbHlwaC0+ZmFjZV9pZAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52 cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLnBhZGRpbmdfcCA9PSBnbHlwaC0+ cGFkZGluZ19wCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF0uZ2x5cGgubGVmdF9ib3hfbGluZV9wID09IGdseXBoLT5sZWZ0X2JveF9s aW5lX3AKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1tybl0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXS5nbHlwaC5yaWdodF9ib3hfbGluZV9wID09IGdseXBoLT5yaWdodF9ib3hfbGlu ZV9wCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hlW2NhY2hlX3R5 cGVdW250aF0uZ2x5cGgudm9mZnNldCA9PSBnbHlwaC0+dm9mZnNldAorICAgICAgICAgICAgICYm IHctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLnBpeGVs X3dpZHRoID09IGdseXBoLT5waXhlbF93aWR0aAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJp eC52cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLnNsaWNlLmltZy54ID09IGds eXBoLT5zbGljZS5pbWcueAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3JuXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLnNsaWNlLmltZy55ID09IGdseXBoLT5zbGljZS5p bWcueQorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhdLmdseXBoLnNsaWNlLmltZy53aWR0aCA9PSBnbHlwaC0+c2xpY2UuaW1nLndpZHRo CisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hlW2NhY2hlX3R5cGVd W250aF0uZ2x5cGguc2xpY2UuaW1nLmhlaWdodCA9PSBnbHlwaC0+c2xpY2UuaW1nLmhlaWdodAor ICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLmdseXBoLnNsaWNlLmNtcC5mcm9tID09IGdseXBoLT5zbGljZS5jbXAuZnJvbQorICAgICAg ICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLngg PT0geAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhdLmZ4ID09IGZ4CisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbcm5d LmNhY2hlW2NhY2hlX3R5cGVdW250aF0ueSA9PSB5CisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0 cml4LnZwb3Nbcm5dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZnkgPT0gZnkKKyAgICAgICAgICAg ICAmJiB3LT5tY19tYXRyaXgudnBvc1tybl0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5ocG9zID09 IGhwb3MKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1tybl0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXS52cG9zID09IHZwb3MKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBv c1tybl0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS53ZCA9PSB3ZAorICAgICAgICAgICAgICYmIHct Pm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmggPT0gaAorICAgICAg ICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmN1 cnNvcl90eXBlID09IGN1cnNvcl90eXBlCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZw b3Nbcm5dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uY3Vyc29yX3dpZHRoID09IGN1cnNvcl93aWR0 aAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLmZvcmVncm91bmQucmVkID09IGZvcmVncm91bmQucmVkCisgICAgICAgICAgICAgJiYg dy0+bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZm9yZWdyb3VuZC5n cmVlbiA9PSBmb3JlZ3JvdW5kLmdyZWVuCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZw b3Nbcm5dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZm9yZWdyb3VuZC5ibHVlID09IGZvcmVncm91 bmQuYmx1ZQorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhdLmJhY2tncm91bmQucmVkID09IGJhY2tncm91bmQucmVkCisgICAgICAgICAg ICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmFja2dy b3VuZC5ncmVlbiA9PSBiYWNrZ3JvdW5kLmdyZWVuCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0 cml4LnZwb3Nbcm5dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmFja2dyb3VuZC5ibHVlID09IGJh Y2tncm91bmQuYmx1ZQorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhdLmFjdGl2ZV9wID09IGFjdGl2ZV9wCisgICAgICAgICAgICAgJiYg dy0+bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGhfZmxhdm9y ID09IGdseXBoX2ZsYXZvcgorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3JuXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLmVuYWJsZWRfcCA9PSB0cnVlKTsKKyAgICAgICAgfQorICAg ICAgaWYgKCFzYW1lX3ApCisgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCBtYXRyaXgs IHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwgY3Vyc29yX3R5cGUsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGFjdGl2 ZV9wLCBnbHlwaF9mbGF2b3IsIHJlbW92ZV9wKTsKKyAgICAgIHJldHVybjsKKyAgICB9CisgICAg ZWxzZSBpZiAoZHJhd19wCisgICAgICAgICAgICAgJiYgKGZyb21fd2hlcmUgPT0gU0NSSUJFX09O RQorICAgICAgICAgICAgICAgICB8fCBmcm9tX3doZXJlID09IFNDUklCRV9UV08KKyAgICAgICAg ICAgICAgICAgfHwgZnJvbV93aGVyZSA9PSBTQ1JJQkVfVEhSRUUKKyAgICAgICAgICAgICAgICAg fHwgZnJvbV93aGVyZSA9PSBOT1dIRVJFKSkKKyAgICB7CisgICAgICBtY19kcmF3X2VyYXNlX2h5 YnJpZCAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsIGN1 cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgZm9y ZWdyb3VuZCwgYWN0aXZlX3AsIGdseXBoX2ZsYXZvciwgcmVtb3ZlX3ApOworICAgICAgcmV0dXJu OworICAgIH0KKyAgaWYgKGNhY2hlX3R5cGUgPT0gTk9fQ0FDSEUpCisgICAgcmV0dXJuOworICAr K3ctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVfdHlwZV07CisgIGlmICh3LT5tY19tYXRy aXgudnBvc191c2VkIDwgbWF0cml4LT5ucm93cykKKyAgICB3LT5tY19tYXRyaXgudnBvc191c2Vk ID0gbWF0cml4LT5ucm93czsKKyAgaWYgKHctPm1jX21hdHJpeC52cG9zX2FsbG9jYXRlZCA8IHct Pm1jX21hdHJpeC52cG9zX3VzZWQpCisgICAgeworICAgICAgaW50IG9sZF9hbGxvYyA9IHctPm1j X21hdHJpeC52cG9zX2FsbG9jYXRlZDsKKyAgICAgIGludCBuZXdfZWx0cyA9IHctPm1jX21hdHJp eC52cG9zX3VzZWQgLSB3LT5tY19tYXRyaXgudnBvc19hbGxvY2F0ZWQ7CisgICAgICB3LT5tY19t YXRyaXgudnBvcyA9IHhwYWxsb2MgKHctPm1jX21hdHJpeC52cG9zLCAmdy0+bWNfbWF0cml4LnZw b3NfYWxsb2NhdGVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfZWx0 cywgSU5UX01BWCwgc2l6ZW9mICp3LT5tY19tYXRyaXgudnBvcyk7CisgICAgICBtZW1zZXQgKHct Pm1jX21hdHJpeC52cG9zICsgb2xkX2FsbG9jLCAwLAorICAgICAgICAgICAgICAgKHctPm1jX21h dHJpeC52cG9zX2FsbG9jYXRlZCAtIG9sZF9hbGxvYykgKiBzaXplb2YgKnctPm1jX21hdHJpeC52 cG9zKTsKKyAgICB9CisgICsrdy0+bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hlX3VzZWRbY2FjaGVf dHlwZV07CisgIGlmICh3LT5tY19tYXRyaXgudnBvc1tybl0uY2FjaGVfYWxsb2Nhd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y0+VklTSUJMRV9IRUlHSFQuCisgICAgICAgRklYTUU6 ICBBZGQgY29uZGl0aW9ucyBmb3IgdXNlci1zcGVjaWZpZWQgdGhpY2tuZXNzIG9mIE1DX0JBUiBh bmQKKyAgICAgICAgICAgICAgIE1DX0hCQVIgYXMgdG8gYG1jLXJlYWwtZmFrZS1jdXJzb3InLgor ICAgTVVMVElQTEVfQ1VSU09SUzogIFdlIGRvIG5vdCB1c2UgdGhpcyBmdW5jdGlvbi4KKyAgIEhP UklaT05UQUxfUlVMRVI6ICBXZSB3YW50IGEgdW5pdmVyc2FsIEZZIGNvb3JkaW5hdGUgZm9yIGEg bGV2ZWwgcnVsZXIuCisgICBWRVJUSUNBTF9SVUxFUiBhbmQgRklMTF9DT0xVTU46ICBXZSB3YW50 IGFuIEggdGhhdCBlbnN1cmVzIG5vIGdhcCBiZXR3ZWVuIHRoZQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgcHJldmlvdXMvbmV4dCBsaW5lLiAgVGhlIEZYIGNvb3JkaW5hdGUg aXMgc2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNld2hlcmU6ICBg dy0+Y3Vyc29yLnhgIC8gYG1jLmZjX3hgLiAqLwordm9pZAorbWNfZ2V0X2N1cnNvcl9nZW9tZXRy eSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LAorICAgICAg ICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93LCBpbnQgeCwgaW50ICpmeCwg aW50IHksCisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgKmZ5LCBpbnQgaHBvcywgaW50IHZw b3MsIGludCAqaCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUg Y3Vyc29yX3R5cGUsIGludCBjdXJzb3Jfd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICBp bnQgKndkKQoreworICB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yAgKmZ5ID0gV0lORE9XX1RP X0ZSQU1FX1BJWEVMX1kgKHcsIHkpOworICBzd2l0Y2ggKGN1cnNvcl90eXBlKQorICAgIHsKKyAg ICAgIGNhc2UgTUNfQkFSOgorICAgICAgICB7CisgICAgICAgICAgaWYgKGN1cnNvcl93aWR0aCA8 IDEpCisgICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSBtYXggKEZSQU1FX0NVUlNPUl9XSURUSCAo ZiksIDEpOworICAgICAgICAgIGlmIChjdXJzb3Jfd2lkdGggPCBnbHlwaC0+cGl4ZWxfd2lkdGgp CisgICAgICAgICAgKndkID0gY3Vyc29yX3dpZHRoOworICAgICAgICAgIGJyZWFrOworICAgICAg ICB9CisgICAgICBjYXNlIE1DX0hCQVI6CisgICAgICAgIHsKKyAgICAgICAgICBpbnQgY3Vyc29y X2hlaWdodCA9IChjdXJzb3Jfd2lkdGggPCAxKSA/IGxyaW50ICgwLjI1ICogKmgpIDogY3Vyc29y X3dpZHRoOworICAgICAgICAgIGlmIChjdXJzb3JfaGVpZ2h0ID4gcm93LT5oZWlnaHQpCisgICAg ICAgICAgICBjdXJzb3JfaGVpZ2h0ID0gcm93LT5oZWlnaHQ7CisgICAgICAgICAgLyogQ3Vyc29y IHNtYWxsZXIgdGhhbiBsaW5lIGhlaWdodCwgc28gbW92ZSBkb3duLiAqLworICAgICAgICAgIGlm ICgqaCA+IGN1cnNvcl9oZWlnaHQpCisgICAgICAgICAgICAqZnkgKz0gKmggLSBjdXJzb3JfaGVp Z2h0OworICAgICAgICAgICpoID0gY3Vyc29yX2hlaWdodDsKKyAgICAgICAgICAqd2QgPSBnbHlw aC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGNhc2Ug TUNfUklHSFRfRlJJTkdFX0JJVE1BUDoKKyAgICAgIGNhc2UgTUNfTEVGVF9GUklOR0VfQklUTUFQ OgorICAgICAgY2FzZSBNQ19OT19GUklOR0VfQklUTU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SA9PSByb3ctPnVzZWRb YXJlYV0gLSAxCisgICAgICAgICAgICAgICAmJiBNQVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cp ID09IFpWKTsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIExpc3Bf T2JqZWN0IGJ1ZiA9IHctPmNvbnRlbnRzOworICBDSEVDS19CVUZGRVIgKGJ1Zik7CisgIHN0cnVj dCBidWZmZXIgKmIgPSBYQlVGRkVSIChidWYpOworICBpbnQgdGV4dF9hcmVhX3dpZHRoID0gd2lu ZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgc3RydWN0IGdseXBoX3JvdyAqY3Vyc29y X3JvdyA9ICh3LT5jdXJzb3IudnBvcyAhPSAtMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gTUFUUklYX1JPVyAoY3Vyc29yX21hdHJpeCwgdy0+Y3Vyc29yLnZwb3MpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgIHN0cnVjdCBnbHlwaCAqY3Vy c29yX2dseXBoID0gKHctPmN1cnNvci52cG9zICE9IC0xKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gbWNfZ2V0X2N1cnNvcl9nbHlwaCAodywgY3Vyc29yX21hdHJpeCwgY3Vyc29y X3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IE5VTEw7CisgIGJvb2wgY3Vyc29yX2F0X2ZyaW5nZV9wID0gKGN1cnNvcl9n bHlwaCA9PSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3cg IT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9 PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgY3Vyc29yX3Jvdy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVfcAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA9PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gY3Vyc29yX3Jvdy0+cGl4 ZWxfd2lkdGgpOworICBib29sIGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AgPSAoY3Vyc29yX2dseXBo ID09IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3cg IT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhw b3MgPT0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiAhY3Vyc29yX3Jvdy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVfcAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0gdGV4dF9hcmVh X3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA+ PSBjdXJzb3Jfcm93LT5waXhlbF93aWR0aCk7CisgIGludCBmcmFtZV9jaGFyX3dpZHRoID0gRlJB TUVfQ09MVU1OX1dJRFRIIChmKTsKKyAgaW50IHRlbXBfZmFjZV9pZCA9IGdseXBoLT5mYWNlX2lk OworICBzdHJ1Y3QgbWNfUkdCIGJhY2tncm91bmQ7CisgIG1jX3NldF9sc2xfYmcgKHcsIHRlbXBf ZmFjZV9pZCwgJmJhY2tncm91bmQpOworICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9IChvcG9p bnRfeCA9PSByZWxhdGl2ZV94CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2lu dF9ocG9zID09IGhwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3kg PT0gZ2x5cGgtPnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3Zwb3Mg PT0gdnBvcyk7CisKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAg ICAgICAgIEJFR0lOOiAgQ0hBUl9HTFlQSCB8IEdMWVBITEVTU19HTFlQSCAgICAgICAgICAgICAg ICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgaWYgKGdseXBoLT50eXBlID09IENI QVJfR0xZUEgKKyAgICAgIHx8IGdseXBoLT50eXBlID09IEdMWVBITEVTU19HTFlQSCkKKyAgewor ICAgIGlmIChtY19zdGRlcnJfcCkKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIlxu ICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFk ICU1ZCAlNGQgICUzZCAgJTNkICVzICVzXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhz W1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+ dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAoZ2x5cGgtPnR5 cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgPyAnQycKKyAgICAgICAgIDogJ0cnKSwKKyAgICAg ICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAg ICAgICAgPyAnQicKKyAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICAgICA/ICdTJworICAgICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAg ICAgICAgID8gJzAnCisgICAgICAgICAgICAgICA6ICctJykpKSwKKyAgICAgICAgICAgICAgZ2x5 cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICBnbHlwaC0+dS5jaCwKKyAgICAgICAgZ2x5cGgtPmZh Y2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5y aWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+eCwgZ2x5cGgtPnksIGdseXBoLT5ocG9z LCBnbHlwaC0+dnBvcywgZ2x5cGgtPnp2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgbWNfY2hh cl90b19zdHJpbmcgKGdseXBoLT51LmNoKSk7CisgIHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsK Ky8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJT T1JTOiAgQ0hBUl9HTFlQSCB8IEdMWVBITEVTU19HTFlQSCAgICAgICAgICAgICAgICovCisvKiAt LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIE1VTFRJUExFX0NVUlNPUlM6CisgICAgewor ICAgICAgbWNfaGVsc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dGlvbl90eXBl KTsKKyAgICAgIGlmIChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2Vk W2FyZWFdIC0gMQorICAgICAgICAgICYmIHJlbGF0aXZlX3ggPD0geF9saW1pdCkKKyAgICAgICAg eworICAgICAgICAgIGlmIChyZWxhdGl2ZV94IDwgcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7Cisg ICAgICAgICAgICAgIGZ4ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgIH0KKyAg ICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngs IHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgeF9saW1pdCAtIHJlbGF0 aXZlX3gsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsCisgICAgICAgICAgICAgICAgICAg ICBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLCBhY3RpdmVfcCwgTUNfR0xZUEhMRVNTLCBkcmF3X3As CisgICAgICAgICAgICAgICAgICAgICBmcm9tX3doZXJlLCBjYWNoZV90eXBlLCBhY3Rpb25fdHlw ZSk7CisgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LSAqLworLyogICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIENIQVJfR0xZUEggfCBHTFlQ SExFU1NfR0xZUEggICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8K KyAgICBjYXNlIFZFUlRJQ0FMX1JVTEVSOgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGds eXBoX2ZsYXZvciA9IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiByb3ctPmNvbnRpbnVlZF9wKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+Y29udGludWVkX3AKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9y aWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJ Q0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0 X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ct PnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNB TF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog KGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXSAhPSAxCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJU SUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoIC0g cm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeCA+PSByb3ctPnBpeGVsX3dp ZHRoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVT UworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoenZfcCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfR0xZUEg7CisgICAgICBpZiAoZ2x5cGhfZmxh dm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2Zs YXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8 fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgIHx8 IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQV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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoenZfcCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF95ID09IHkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF92cG9zID09IHZwb3MpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgd2QgPSAxOworICAgICAgbWNf aGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZjX2Z4LCB5LCBmeSwg aHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jf d2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgIGFjdGl2ZV9w LCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwgYWN0aW9uX3R5 cGUpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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QgJTVkICU0ZCAgJTNkICAlM2QgJXMgJXNcbiIsCisgICAgICAgIGdseXBoIC0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAw IDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdT JywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2Jq ZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3Qp CisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkK KyAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAgICA6ICctJykpKSwKKyAgICAgICAg Z2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAwdSwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQs CisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdodF9i b3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+eCwgZ2x5cGgtPnksIGdseXBoLT5ocG9zLCBnbHlw aC0+dnBvcywgZ2x5cGgtPnp2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgIlxcUyIpOworICBz d2l0Y2ggKGFjdGlvbl90eXBlKQorICB7CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAg ICAgICAgICAgICAgICAgICAgICAgTVVMVElQTEVfQ1VSU09SUzogIFNUUkVUQ0hfR0xZUEggICAg ICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS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RoLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAor ICAgICAgICAgICAgICAgICAgIGFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLCBmcm9tX3doZXJl LCBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICBpZiAoZ2x5cGggLSByb3ctPmdseXBo c1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiByZWxhdGl2 ZV94IDw9IHhfbGltaXQpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAocmVsYXRpdmVfeCA8IHJv dy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhlbF93 aWR0aDsKKyAgICAgICAgICB0ZW1wX2ZhY2VfaWQgPSAocm93LT5maWxsX2xpbmVfcCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICA/IGdseXBoLT5mYWNlX2lkCisgICAgICAgICAgICAgICAgICAg ICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgc3RydWN0IG1jX1JHQiBiYWNrZ3Jv dW5kOworICAgICAgICAgIG1jX3NldF9sc2xfYmcgKHcsIHRlbXBfZmFjZV9pZCwgJmJhY2tncm91 bmQpOworICAgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2 ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICB4X2xpbWl0 IC0gcmVsYXRpdmVfeCwgaCwgY3Vyc29yX3R5cGUsIHhfbGltaXQgLSByZWxhdGl2ZV94LAorICAg ICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwgYWN0aXZlX3AsIE1DX0dM WVBITEVTUywgZHJhd19wLAorICAgICAgICAgICAgICAgICAgICAgZnJvbV93aGVyZSwgY2FjaGVf dHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisvKiAt LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICBWRVJUSUNB TF9SVUxFUjogIFNUUkVUQ0hfR0xZUEggICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBWRVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAgICBp ZiAocm93LT5maWxsX2xpbmVfcAorICAgICAgICAgICYmIGdseXBoIC0gcm93LT5nbHlwaHNbVEVY VF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYgb3BvaW50X3ggPiBy ZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoKQorICAgICAgICB0ZW1wX2ZhY2VfaWQgPSBn bHlwaC0+ZmFjZV9pZDsKKyAgICAgICAgZWxzZSBpZiAoIXJvdy0+ZmlsbF9saW5lX3AKKyAgICAg ICAgICAgICAgICAgJiYgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNl ZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3ggPiByZWxhdGl2ZV94ICsg Z2x5cGgtPnBpeGVsX3dpZHRoKQorICAgICAgICAgIHRlbXBfZmFjZV9pZCA9IERFRkFVTFRfRkFD RV9JRDsKKyAgICAgIHN0cnVjdCBtY19SR0IgYmFja2dyb3VuZDsKKyAgICAgIG1jX3NldF9sc2xf YmcgKHcsIHRlbXBfZmFjZV9pZCwgJmJhY2tncm91bmQpOworICAgICAgZW51bSBtY19mbGF2b3Ig Z2x5cGhfZmxhdm9yID0gKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29u X3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVS VElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3Jf YXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJv dy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJ Q0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdICE9IDEKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9w KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZF UlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQ SExFU1M7CisgICAgICBpZiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9B UlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9C QVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxf QkFSX0JBQ0tTTEFTSAorICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9C QVIKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFS KQorICAgICAgICBjdXJzb3JfdHlwZSA9IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA7CisgICAgICB3 ZCA9IDE7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgb3BvaW50X3gs IG9wb2ludF9meCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBj dXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAg ICAgICAgICAgICBhY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCBkcmF3X3AsIGZyb21fd2hlcmUsIGNh Y2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICBGSUxMX0NPTFVNTjog IFNUUkVUQ0hfR0xZUEggICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0gKi8KKyAgICBjYXNlIEZJTExfQ09MVU1OOgorICAgIHsKKyAgICAgIGlmIChyb3ctPmZp bGxfbGluZV9wCisgICAgICAgICAgJiYgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09 IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiBmY194ID4gcmVsYXRpdmVfeCArIGds eXBoLT5waXhlbF93aWR0aCkKKyAgICAgICAgdGVtcF9mYWNlX2lkID0gZ2x5cGgtPmZhY2VfaWQ7 CisgICAgICAgIGVsc2UgaWYgKCFyb3ctPmZpbGxfbGluZV9wCisgICAgICAgICAgICAgICAgICYm IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisg ICAgICAgICAgICAgICAgICYmIGZjX3ggPiByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRo KQorICAgICAgICAgIHRlbXBfZmFjZV9pZCA9IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgIHN0cnVj dCBtY19SR0IgYmFja2dyb3VuZDsKKyAgICAgIG1jX3NldF9sc2xfYmcgKHcsIHRlbXBfZmFjZV9p ZCwgJmJhY2tncm91bmQpOworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gTUNf R0xZUEhMRVNTOwor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S0tLS0tLS0tLS0tLS0tICovCisvKiAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJFR0lOOiAgSU1BR0VfR0xZUEggICAgICAgICAg ICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICBlbHNlIGlm IChnbHlwaC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkKKyAgeworICAgIGlmIChtY19zdGRlcnJfcCkK KyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQgJWMg JTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNkICVz ICVjXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAg ICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAg ICAgICByZWxhdGl2ZV94LAorICAgICAgICAnSScsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAor ICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0InCisgICAgICAg ICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAg ICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICA/ICcwJworICAgICAg ICAgICAgICAgOiAnLScpKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAg KHVuc2lnbmVkIGludCkgZ2x5cGgtPnUuaW1nX2lkLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwK KyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKy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QorICAgICAgeworICAgICAgICBmcHJpbnRmIChz dGRlcnIsCisgICAgICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2Qg MHglMDZ4IiwKKyAgICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAg ICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSks CisgICAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgICAnKycsCisgICAgICAgICAgZ2x5cGgt PmNoYXJwb3MsCisgICAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAg ID8gJ0InCisgICAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAg ICAgID8gJ1MnCisgICAgICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICAgIGds eXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgICAodW5zaWduZWQgaW50KSBnbHlwaC0+dS5jbXAu aWQpOworICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIgJTRkICUxLjFkJTEuMWQiLAorICAgICAg ICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisg ICAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3ApOworICAgICAgaWYgKGdseXBoLT51LmNt cC5hdXRvbWF0aWMpCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAlNWQgJTRkICAlM2QgICUz ZCAlcyAuIFslZC0lZF1cbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGgtPngsIGds eXBoLT55LCBnbHlwaC0+aHBvcywgZ2x5cGgtPnZwb3MsIGdseXBoLT56dl9wID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FMX1JVTEVSOiAgQ09NUE9TSVRFX0dMWVBIICAgICAgICAg ICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBIT1JJWk9O VEFMX1JVTEVSOgorICAgIHsKKyAgICAgIGlmIChyZWxhdGl2ZV94IDw9IHhfbGltaXQKKyAgICAg ICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJp eCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAg ICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5k LCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgIGFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJh d19wLCBmcm9tX3doZXJlLCBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICBpZiAoZ2x5 cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAg ICAgICAmJiByZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAgIHsKKyAgICAgICAgICByZWxh dGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICB3aGlsZSAocmVsYXRpdmVf eCA8PSB4X2xpbWl0KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19oZWxwZXIgKHcs IG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAor ICAgICAgICAgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRo LCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2 ZV9wLCBNQ19HTFlQSExFU1MsIGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwKKyAgICAg ICAgICAgICAgICAgICAgICAgICBhY3Rpb25fdHlwZSk7CisgICAgICAgICAgICAgIHJlbGF0aXZl X3ggKz0gZnJhbWVfY2hhcl93aWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAg YnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAg ICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIENPTVBPU0lURV9HTFlQSCAgICAgICAgICAgICAg ICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgVkVSVElDQUxfUlVM RVI6CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1cnNvcl9h dF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+ Y29udGludWVkX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNf VkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3Ap CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFS X1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJz b3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2Vf cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+ dXNlZFtURVhUX0FSRUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFd ID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIG9wb2ludF94ID49IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6ICh6dl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBNQ19HTFlQSDsKKyAgICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFS X1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZF UlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19W RVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZF UlRJQ0FMX0JBUgorICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJU SUNBTF9CQVIpCisgICAgICAgIGN1cnNvcl90eXBlID0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUDsK KyAgICAgIHdkID0gMTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCBy ZWxhdGl2ZV94LCBvcG9pbnRfZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAg ICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYmFja2dyb3Vu ZCwKKyAgICAgICAgICAgICAgICAgYWN0aXZlX3AsIGdseXBoX2ZsYXZvciwgZHJhd19wLCBmcm9t X3doZXJlLCBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9Cisv KiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICBGSUxM X0NPTFVNTjogIENPTVBPU0lURV9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAqLworLyogLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBGSUxMX0NPTFVNTjoKKyAgICB7CisgICAgICBl bnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FS RUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBmY194ID4gcmVsYXRpdmVfeCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogKHp2X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g TUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICghTklM UCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF92ZXJ0aWNh bF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9p bnRfeSA9PSB5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9p bnRfdnBvcyA9PSB2cG9zKQorICAgICAgICA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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLwor LyogICAgICAgICAgICAgICAgICAgICAgICBIT1JJWk9OVEFMX1JVTEVSOiAgWFdJREdFVF9HTFlQ SCAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBj YXNlIEhPUklaT05UQUxfUlVMRVI6CisgICAgeworICAgICAgaWYgKHJlbGF0aXZlX3ggPD0geF9s aW1pdAorICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBl ciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZw b3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgs IGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgICAgYWN0aXZlX3AsIE1D X0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUsIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAg ICAgIGlmIChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFd IC0gMQorICAgICAgICAgICYmIHJlbGF0aXZlX3ggPD0geF9saW1pdCkKKyAgICAgICAgeworICAg ICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgIHdoaWxl IChyZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIG1j X2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhw b3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBj dXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgICAg ICAgICAgYWN0aXZlX3AsIE1DX0dMWVBITEVTUywgZHJhd19wLCBmcm9tX3doZXJlLCBjYWNoZV90 eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGlvbl90eXBlKTsKKyAgICAgICAgICAg ICAgcmVsYXRpdmVfeCArPSBmcmFtZV9jaGFyX3dpZHRoOworICAgICAgICAgICAgfQorICAgICAg ICB9CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAg ICAgICAgICAgICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIFhXSURHRVRfR0xZUEggICAg ICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBW RVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3Ig PSAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmICFyb3ctPmNvbnRpbnVlZF9wCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVIKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRf b25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19W RVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hU X0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5 b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBj dXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0gIT0gMQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaCAtIHJvdy0+Z2x5cGhz W1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3ggPj0gcm93LT5waXhlbF93aWR0aCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKHp2X3ApCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19W RVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNf UkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxh dm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2 b3IgPT0gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JF VkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgY3Vyc29yX3R5cGUgPSBNQ19SSUdIVF9GUklO R0VfQklUTUFQOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0 aXZlX3gsIG9wb2ludF9meCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdk LCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAor ICAgICAgICAgICAgICAgICBhY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCBkcmF3X3AsIGZyb21fd2hl cmUsIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICBGSUxMX0NP TFVNTjogIFhXSURHRVRfR0xZUEggICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEZJTExfQ09MVU1OOgorICAgIHsKKyAgICAgIGVudW0g bWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0g PT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIGZjX3ggPiByZWxhdGl2ZV94KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiAoenZfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19H TFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChC VkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX3ZlcnRpY2FsX3J1 bGVyKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF95 ID09IHkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF92 cG9zID09IHZwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNf R0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBI OworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZj X2Z4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90 eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAg ICAgIGFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlw ZSwgYWN0aW9uX3R5cGUpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tICovCisgICAgY2FzZSBDVVJTT1JfSU5ESUNBVE9SOgorICAgIHsKKyAgICAgIGJyZWFrOwor ICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICB9CisgIH0KKy8qIC0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRU5EOiAgWFdJREdF VF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KK30KKwordm9pZAorbWNfZHJhd19yb3cgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBn bHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAg IHN0cnVjdCBnbHlwaCAqc3RhcnQsIGludCB4LCBpbnQgaHBvc19sZW5ndGgsIGludCB2cG9zLAor ICAgICAgICAgICAgIGludCBib3R0b21fdnBvcywgc3RydWN0IGdseXBoX21hdHJpeCAqY3Vyc29y X21hdHJpeCwKKyAgICAgICAgICAgICAgc3RydWN0IG1jX2Vzc2VudGlhbHMgZXNzZW50aWFscywg Ym9vbCBkcmF3X3AsIGVudW0gbWNfZnJvbV93aGVyZSBmcm9tX3doZXJlKQoreworICAvLyAgY2xv Y2tfdCBjbG9ja19zdGFydCA9IGNsb2NrKCk7CisgIC8qIE5UIEVtYWNzIGNyYXNoZXMgb24gc3Rh cnR1cCB3aXRob3V0IGEgYEJVRkZFUlAnIGNoZWNrIGluIGB1cGRhdGVfd2luZG93Jy4gKi8KKyAg Ym9vbCBkZWJ1Z19wID0gZmFsc2U7CisgIGlmICghQlVGRkVSUCAody0+Y29udGVudHMpKQorICAg IHJldHVybjsKKyAgaWYgKE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29u ZikpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFp cnMpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNp YmxlKSkpCisgICAgcmV0dXJuOworICBpZiAodnBvcyA9PSBib3R0b21fdnBvcykKKyAgICByZXR1 cm47CisgIGlmICghcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgcmV0dXJuOworICBpbnQgaHBv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ICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogLTE7CisgIGludCBwcmV2X21hdHJpeF9yb3dfZW5kX2J5dGVwb3MgPSAodnBvcyAh PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XX0VO RF9CWVRFUE9TIChyb3cgLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiAtMTsKKyAgaW50IHByZXZfbWF0cml4X3Jvd19zdGFydF9jaGFycG9zID0gKHZwb3MgIT0gMCkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XX1NUQVJU X0NIQVJQT1MgKHJvdyAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogLTE7CisgIGludCBwcmV2X21hdHJpeF9yb3dfZW5kX2NoYXJwb3MgPSAodnBvcyAhPSAwKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XX0VORF9DSEFS UE9TIChyb3cgLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAtMTsK KyAgaW50IG1hdHJpeF9yb3dfc3RhcnRfYnl0ZXBvcyA9IE1BVFJJWF9ST1dfU1RBUlRfQllURVBP UyAocm93KTsKKyAgaW50IG1hdHJpeF9yb3dfZW5kX2J5dGVwb3MgPSBNQVRSSVhfUk9XX0VORF9C WVRFUE9TIChyb3cpOworICBpbnQgbWF0cml4X3Jvd19zdGFydF9jaGFycG9zID0gTUFUUklYX1JP V19TVEFSVF9DSEFSUE9TIChyb3cpOworICBpbnQgbWF0cml4X3Jvd19lbmRfY2hhcnBvcyA9IE1B VFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdyk7CisgIC8qIFdoZW4gdGhlcmUgYXJlIG5vIG5hdGl2 ZSBsaW5lIG51bWJlcnMsIGEgcm93IGNvbnRhaW5pbmcgX29ubHlfIFpWIG9yIHJvd3MKKyAgX2Jl eW9uZF8gWlYgd2lsbCBoYXZlIGV4YWN0bHkgb25lIHNwYWNlIHJvdyBlbmQgZ2x5cGggd2l0aCBh IGNoYXJwb3Mgb2YgLTEuCisgIEEgcHJldmlvdXMgcm93IGRvZXMgbm90IGV4aXN0IGlmIFZQT1Mg PT0gMC4gKi8KKyAgc3RydWN0IGdseXBoICpwcmV2X3Jvd19fcGVudWx0aW1hdGVfZ2x5cGgKKyAg ICA9ICh2cG9zID09IDApCisgICAgICAgID8gTlVMTAorICAgICAgOiAoIShyb3cgLSAxKS0+ZW5h YmxlZF9wKQorICAgICAgICA/IE5VTEwKKyAgICAgIDogKChyb3cgLSAxKS0+dXNlZFtURVhUX0FS RUFdID09IDApCisgICAgICAgID8gTlVMTAorICAgICAgOiAoKHJvdyAtIDEpLT51c2VkW1RFWFRf QVJFQV0gPiAxKQorICAgICAgICA/IChyb3cgLSAxKS0+Z2x5cGhzW1RFWFRfQVJFQV0gKyAocm93 IC0gMSktPnVzZWRbVEVYVF9BUkVBXSAtIDIKKyAgICAgIDogTlVMTDsKKyAgaW50IHByZXZfcm93 X19wZW51bHRpbWF0ZV9nbHlwaF9jaGFycG9zID0gKHByZXZfcm93X19wZW51bHRpbWF0ZV9nbHlw aCAhPSBOVUxMKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IHByZXZfcm93X19wZW51bHRpbWF0ZV9nbHlwaC0+Y2hhcnBvcworICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IC0xOworICBzdHJ1Y3QgZ2x5cGggKnByZXZfcm93 X19sYXN0X2dseXBoCisgICAgPSAodnBvcyA9PSAwKQorICAgICAgICA/IE5VTEwKKyAgICAgIDog KCEocm93IC0gMSktPmVuYWJsZWRfcCkKKyAgICAgICAgPyBOVUxMCisgICAgICA6ICgocm93IC0g MSktPnVzZWRbVEVYVF9BUkVBXSA9PSAwKQorICAgICAgICA/IE5VTEwKKyAgICAgIDogKHJvdyAt IDEpLT5nbHlwaHNbVEVYVF9BUkVBXSArIChyb3cgLSAxKS0+dXNlZFtURVhUX0FSRUFdIC0gMTsK KyAgaW50IHByZXZfcm93X19sYXN0X2dseXBoX2NoYXJwb3MgPSAocHJldl9yb3dfX2xhc3RfZ2x5 cGggIT0gTlVMTCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IHByZXZf cm93X19sYXN0X2dseXBoLT5jaGFycG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAtMTsKKyAgLyogV2hlbiB0aGVyZSBhcmUgbm8gbmF0aXZlIGxpbmUgbnVtYmVycywg YSByb3cgY29udGFpbmluZyBfb25seV8gWlYgb3Igcm93cworICBfYmV5b25kXyBaViB3aWxsIGhh dmUgZXhhY3RseSBvbmUgc3BhY2Ugcm93IGVuZCBnbHlwaCB3aXRoIGEgY2hhcnBvcyBvZiAtMS4K KyAgQSBwcmV2aW91cyByb3cgZG9lcyBub3QgZXhpc3QgaWYgVlBPUyA9PSAwLiAqLworICBzdHJ1 Y3QgZ2x5cGggKnBlbnVsdGltYXRlX2dseXBoCisgICAgPSAocm93LT51c2VkW1RFWFRfQVJFQV0g PCAxKQorICAgICAgPyByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJF QV0gLSAyCisgICAgICA6IE5VTEw7CisgIGludCBwZW51bHRpbWF0ZV9nbHlwaF9jaGFycG9zID0g KHBlbnVsdGltYXRlX2dseXBoICE9IE5VTEwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBwZW51bHRpbWF0ZV9nbHlwaC0+Y2hhcnBvcworICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogLTE7CisgIHN0cnVjdCBnbHlwaCAqbGFzdF9nbHlwaAorICAgID0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMTsKKyAgaW50IGxh c3RfZ2x5cGhfY2hhcnBvcyA9IChsYXN0X2dseXBoICE9IE5VTEwpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IGxhc3RfZ2x5cGgtPmNoYXJwb3MKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogLTE7CisgIC8qIFRoaXMgdGVzdHMgZm9yIGEgc29saXRhcnkgcm93IGNvbnRhaW5pbmcg WlYsIHByZWNlZGVkIGJ5IGEgcm93IGNvbnRhaW5pbmcgYQorICBwZW51bHRpbWF0ZSBnbHlwaCB3 aXRoIGEgY2hhcnBvcyBvZiBaViAtIDEgZm9sbG93ZWQgYnkgYW4gZW5kIG9mIHJvdyBzcGFjZQor ICBnbHlwaCB3aXRoIGEgY2hhcnBvcyBvZiAwLiAqLworICBib29sIHJvd19hdF96dl9wID0gKHZw b3MgIT0gMAorICAgICAgICAgICAgICAgICAgICAgICYmIChyb3cgLSAxKS0+dXNlZFtURVhUX0FS RUFdID4gMAorICAgICAgICAgICAgICAgICAgICAgICYmIHByZXZfbWF0cml4X3Jvd19zdGFydF9i eXRlcG9zICE9IHByZXZfbWF0cml4X3Jvd19lbmRfYnl0ZXBvcworICAgICAgICAgICAgICAgICAg ICAgICYmICEocm93IC0gMSktPmVuZHNfYXRfenZfcAorICAgICAgICAgICAgICAgICAgICAgICYm IG1hdHJpeF9yb3dfc3RhcnRfYnl0ZXBvcyA9PSBtYXRyaXhfcm93X2VuZF9ieXRlcG9zCisgICAg ICAgICAgICAgICAgICAgICAgJiYgcm93LT5lbmRzX2F0X3p2X3ApOworICAvKiBJZiBsaW5lLW51 bWJlcnMgYXJlIGFjdGl2ZSwgdGhlbiBzcGFjZSBnbHlwaCBwYWRkaW5nIGVxdWFsIHRvIGl0cyB3 aWR0aAorICBjb3VudGVkIGluIEhQT1MgYXJlIGZvbGxvd2VkIGJ5IGEgc2luZ2xlIHJvdyBlbmQg c3BhY2UgZ2x5cGguICBMaW5lIG51bWJlcgorICBwYWRkaW5nIHNwYWNlIGdseXBocyBoYXZlIGEg Y2hhcnBvcyBvZiAtMSwgd2hlcmVhcyB0aGUgZW5kIG9mIHJvdyBzcGFjZSBnbHlwaAorICBoYXMg YSBjaGFycG9zIG9mIDAuICBJZiBsaW5lIG51bWJlcnMgYXJlIGluYWN0aXZlLCB0aGVuIHRoZSBy b3cgd2lsbCBjb250YWluCisgIGEgc29saXRhcnkgc3BhY2UgZ2x5cGggd2l0aCBhIGNoYXJwb3Mg b2YgLTEuICovCisgIGJvb2wgcm93X2JleW9uZF96dl9wID0gKG1hdHJpeF9yb3dfc3RhcnRfYnl0 ZXBvcyA9PSBtYXRyaXhfcm93X2VuZF9ieXRlcG9zKTsKKyAgc3RydWN0IGdseXBoX3JvdyAqY3Vy c29yX3JvdyA9ICh3LT5jdXJzb3IudnBvcyAhPSAtMSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gTUFUUklYX1JPVyAoY3Vyc29yX21hdHJpeCwgdy0+Y3Vyc29yLnZwb3MpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgIHN0cnVjdCBnbHlwaCAq Y3Vyc29yX2dseXBoID0gKHctPmN1cnNvci52cG9zICE9IC0xKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gbWNfZ2V0X2N1cnNvcl9nbHlwaCAodywgY3Vyc29yX21hdHJpeCwgY3Vy c29yX3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IE5VTEw7CisgIGJvb2wgY3Vyc29yX2F0X2ZyaW5nZV9wID0gKGN1cnNv cl9nbHlwaCA9PSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9y b3cgIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBv cyA9PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgY3Vyc29yX3Jvdy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVfcAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA9PSB0ZXh0X2FyZWFfd2lkdGgKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gY3Vyc29yX3Jvdy0+ cGl4ZWxfd2lkdGgpOworICBib29sIGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AgPSAoY3Vyc29yX2ds eXBoID09IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9y b3cgIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29y Lmhwb3MgPT0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiAhY3Vyc29yX3Jvdy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVfcAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0gdGV4dF9h cmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3Iu eCA+PSBjdXJzb3Jfcm93LT5waXhlbF93aWR0aCk7CisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioK KyAgICAgICAgICAgICAgICAgICAgICAgICAgUkVQTEFDRSBUSEUgUkVBTCBDVVJTT1IKKyoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworICBlbnVtIGZhY2VfaWQgYmdfZmFjZV9pZCA9IChjdXJzb3Jf Z2x5cGggIT0gTlVMTCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGN1cnNvcl9nbHlw aC0+ZmFjZV9pZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lE OworICBzdHJ1Y3QgbWNfUkdCIGN1cnNvcl9iZzsKKyAgbWNfc2V0X2xzbF9iZyAodywgYmdfZmFj ZV9pZCwgJmN1cnNvcl9iZyk7CisgIC8qIEZJWE1FOiAgUHV0IGluIHNvbWUgY29kZSB0byBkZWZh dWx0IHRvIE1DX0hPTExPV19CT1ggaWYgdGhlIHVzZXIgaGFzCisgIHVud2l0dGluZ2x5IGNvbWUg dXAgd2l0aCBzb21lIHVuYWNjZXB0YWJsZSBmb3JtIG9mIHVucmVjb2duaXplZCBjdXJzb3IgdHlw ZS4gKi8KKyAgTGlzcF9PYmplY3QgbGlzcF90eXBlID0gQlZBUiAoYiwgbWNfcmVhbF9mYWtlX2N1 cnNvcik7CisgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUgPSAoQ09OU1AgKGxpc3Bf dHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY19saXNw X3RvX2N1cnNvcl90eXBlIChYQ0FSIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogbWNfbGlzcF90b19jdXJzb3JfdHlwZSAobGlzcF90eXBlKTsK KyAgaW50IGN1cnNvcl93aWR0aCA9IChDT05TUCAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAg ICAgICAgID8gWEZJWE5VTSAoWENBUiAoWENEUiAobGlzcF90eXBlKSkpCisgICAgICAgICAgICAg ICAgICAgICA6IC0xOworICBlbnVtIGZhY2VfaWQgY3Vyc29yX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AgYXJlCisgICAgICB1c2VkIHRvIGRldGVybWluZSB0aGUgYXBwbGljYWJsZSBm YWNlX2lkLiAqLworICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmcgPSB7LnJlZCA9IC0xLjAsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSAtMS4wLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgLmJsdWUgPSAtMS4wfTsKKyAgICAgIC8qIFdlIHVzZSB0aGUgZmly c3QgZ2x5cGggaW4gdGhlIHJvdywgd2l0aCBhbiBYIGFuZCBIUE9TIG9mIHplcm8uICovCisgICAg ICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCByb3ctPmdseXBoc1tURVhUX0FSRUFdLCAwLCAt MSwgdy0+Y3Vyc29yLnksIC0xLAorICAgICAgICAgICAgICAgICAwLCB3LT5jdXJzb3IudnBvcywg LTEsIC0xLCBNQ19MRUZUX0ZSSU5HRV9CSVRNQVAsIC0xLAorICAgICAgICAgICAgICAgICBsc2xf ZmcsIGN1cnNvcl9iZywgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfT1ZFUkxBWV9BUlJPV19CSVRN QVAsIGRyYXdfcCwKKyAgICAgICAgICAgICAgICAgZnJvbV93aGVyZSwgQ0hfQ0FDSEUsIENVUlNP Ul9JTkRJQ0FUT1IpOworICAgIH0KKyAgaWYgKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgJiYg dnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPj0gaHBvc19z dGFydAorICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gaHBvc19zdGFydCArIGhwb3NfbGVuZ3Ro CisgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJz KSkKKyAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2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XZvciBnbHlwaF9mbGF2b3IgPSBNQ19SRVZFUlNF RF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XOworICAgICAgc3RydWN0IGdseXBoICpnbHlw aCA9IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoX2Vu ZCA9IGdseXBoICsgcm93LT51c2VkW1RFWFRfQVJFQV07CisgICAgICAvKiBHbHlwaCBmb3IgYSBs aW5lIGVuZCBpbiB0ZXh0LiAqLworICAgICAgaWYgKGdseXBoID09IGdseXBoX2VuZCAmJiBnbHlw aC0+Y2hhcnBvcyA+IDApCisgICAgICAgICsrZ2x5cGhfZW5kOworICAgICAgbWNfaGVscGVyICh3 LCBtYXRyaXgsIHJvdywgZ2x5cGhfZW5kIC0gMSwgcm93LT5waXhlbF93aWR0aCwgLTEsIHctPmN1 cnNvci55LAorICAgICAgICAgICAgICAgICAtMSwgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxLCB3 LT5jdXJzb3IudnBvcywgLTEsIC0xLAorICAgICAgICAgICAgICAgICBNQ19SSUdIVF9GUklOR0Vf QklUTUFQLCAtMSwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsIGVzc2VudGlhbHMuYWN0aXZlX3AsCisg ICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgZHJhd19wLCBmcm9tX3doZXJlLCBDSF9DQUNI RSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgfQorICAvKiBFWEFNUExFIChidWZmZXItbG9jYWwp OiAgKHNldHEgbWMtcmVhbC1mYWtlLWN1cnNvciBuaWwvJ25vLyJubyIpICovCisgIGVsc2UgaWYg KCFjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoICE9IE5VTEwK KyAgICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gTUNfTk9fQ1VSU09SCisgICAgICAgICAgICYm IHZwb3MgPT0gd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xZUEhMRVNTLAorICAgICAgICAg ICAgICAgICBkcmF3X3AsIGZyb21fd2hlcmUsIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRl bnRzKSwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBD SF9DQUNIRQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfQ0FDSEUs IENVUlNPUl9JTkRJQ0FUT1IpOworICAgICAgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeSAodywgbWF0 cml4LCByb3csIHctPmN1cnNvci54LCAmb3BvaW50X2Z4LCB3LT5jdXJzb3IueSwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICZvcG9pbnRfZnksIHctPmN1cnNvci5ocG9zLCB3LT5jdXJz b3IudnBvcywgJm9wb2ludF9oLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUNfSEJB UiwgMSwgJm9wb2ludF93ZCk7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBjdXJz b3JfZ2x5cGgsIHctPmN1cnNvci54LCBvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAg ICAgICAgICBvcG9pbnRfZnksIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgb3BvaW50 X3dkLCBvcG9pbnRfaCwKKyAgICAgICAgICAgICAgICAgTUNfSEJBUiwgMSwgY3Vyc29yX2ZnLCBj dXJzb3JfYmcsIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsCisgICAgICAg ICAgICAgICAgIGZyb21fd2hlcmUsIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg bWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7Cisg ICAgfQorICBlbHNlIGlmICghY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICYmIGN1cnNv cl9nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MKKyAg ICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPj0gaHBvc19zdGFydAorICAgICAgICAgICAmJiB3 LT5jdXJzb3IuaHBvcyA8IGhwb3Nfc3RhcnQgKyBocG9zX2xlbmd0aAorICAgICAgICAgICAmJiBj dXJzb3JfZ2x5cGgtPnR5cGUgIT0gU1RSRVRDSF9HTFlQSCkKKyAgICB7CisgICAgICBtY19nZXRf Y3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRfZngs IHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF9meSwg dy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCAmb3BvaW50X3dkKTsK KyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29y LngsIG9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAgICAgICAgIG9wb2ludF9meSwg dy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9oLAorICAg ICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBjdXJzb3JfZmcsIGN1cnNv cl9iZywgZXNzZW50aWFscy5hY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgTUNfR0xZUEgsIGRy YXdfcCwgZnJvbV93aGVyZSwgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19j b25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBD SF9DQUNIRQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IE1DX0NBQ0hFLCBDVVJTT1JfSU5ESUNBVE9SKTsKKyAgICB9CisgIGVsc2UgaWYgKCFjdXJzb3Jf YXRfZnJpbmdlX3AKKyAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoICE9IE5VTEwKKyAgICAgICAg ICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBv cyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zIDwgaHBvc19zdGFy dCArIGhwb3NfbGVuZ3RoCisgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+dHlwZSA9PSBTVFJF VENIX0dMWVBIKQorICAgIHsKKyAgICAgIC8qIElmIGEgdXNlciBoYXMgc2V0IGB4LXN0cmV0Y2gt Y3Vyc29yJyB0byBhIG5vbi1uaWwgdmFsdWUsIGhlL3NoZSBjaG9zZSB0bworICAgICAgaGF2ZSBh IGN1cnNvciB0aGF0IHNwYW5zIHRoZSBlbnRpcmUgbGVuZ3RoIG9mIHRoZSBTVFJFVENIX0dMWVBI LiAqLworICAgICAgaWYgKCF4X3N0cmV0Y2hfY3Vyc29yX3ApCisgICAgICAgIHsKKyAgICAgICAg ICAvKiBUaGUgTUNfSEJBUiBzaGFsbCBoYXZlIGEgYGN1cnNvcl93aWR0aGAgb2YgMS4gKi8KKyAg ICAgICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29y LngsICZvcG9pbnRfZngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vy c29yLnksICZvcG9pbnRfZnksIHctPmN1cnNvci5ocG9zLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsIE1DX0hCQVIsIDEsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF93ZCk7CisgICAgICAgICAgbWNf aGVscGVyICh3LCBtYXRyaXgsIHJvdywgY3Vyc29yX2dseXBoLCB3LT5jdXJzb3IueCwgb3BvaW50 X2Z4LAorICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLnksIG9wb2ludF9meSwgdy0+Y3Vy c29yLmhwb3MsIHctPmN1cnNvci52cG9zLAorICAgICAgICAgICAgICAgICAgICAgb3BvaW50X3dk LCBvcG9pbnRfaCwgTUNfSEJBUiwgMSwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsCisgICAgICAgICAg ICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLCBmcm9tX3do ZXJlLAorICAgICAgICAgICAgICAgICAgICAgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAg ICAgICAgICAgICAgIDogTUNfQ0FDSEUsIENVUlNPUl9JTkRJQ0FUT1IpOworICAgICAgICB9Cisg ICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngs ICZvcG9pbnRfZngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5jdXJzb3IueSwg Jm9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgJm9wb2ludF93ZCk7CisgICAgICBtY19oZWxw ZXIgKHcsIG1hdHJpeCwgcm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1cnNvci54LCBvcG9pbnRfZngs IHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICBvcG9pbnRfZnksIHctPmN1cnNvci5ocG9z LCB3LT5jdXJzb3IudnBvcywgb3BvaW50X3dkLCBvcG9pbnRfaCwKKyAgICAgICAgICAgICAgICAg Y3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsIGVzc2VudGlh bHMuYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgIE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hl cmUsIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19DQUNIRSwgQ1VS U09SX0lORElDQVRPUik7CisgICAgfQorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAg ICAgICAgICAgICAgICAgICAgIERSQVcgQU5EIFJFQ09SRCBGQUtFIENVUlNPUlMKKyoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworICBpZiAoaHBvc19sZW5ndGggPT0gMSkKKyAgICB7CisgICAgICBp ZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQorICAgICAg ICB7CisgICAgICAgICAgLyogVGhlIHNwYWNlIGFwcGVuZGVkIHRvIGEgcm93IGVuZGluZyB3aXRo IGEgbmV3IGxpbmUKKyAgICAgICAgICBkb2VzIG5vdCBoYXZlIGEgYGdseXBoLT5jaGFycG9zYCAo LTEsIDApIHRoYXQgd2UgY2FuCisgICAgICAgICAgdXNlIGZvciB0aGlzIHBhcnRpY3VsYXIgYXBw bGljYXRpb24uICBXaGVuIHRoZXJlIGlzIGEKKyAgICAgICAgICBgYnVmZmVyLWRpc3BsYXktdGFi bGUnIGVudHJ5IHRoYXQgYXNzaWducyBhIHZpc2libGUKKyAgICAgICAgICBnbHlwaCB0byBhIG5l dyBsaW5lLCB0aGVyZSBpcyBubyBwcm9ibGVtIGJlY2F1c2UgdGhhdAorICAgICAgICAgIGdseXBo IGhhcyBhIGBnbHlwaC0+Y2hhcnBvcycgdGhhdCB3ZSBjYW4gdXNlLiAgV2hlbgorICAgICAgICAg IG5vIHZpc2libGUgRU9MIGdseXBoIGV4aXN0cywgd2UgdXNlIHRoZSBmb2xsb3dpbmcKKyAgICAg ICAgICB0ZXN0OiAgdGhlIGFwcGVuZGVkIHNwYWNlIGhhcyBhIHBvc2l0aW9uIHRoYXQgaXMgb25l CisgICAgICAgICAgbGVzcyB0aGFuIHRoZSBlbmQgb2YgdGhlIG1hdHJpeCByb3cuICovCisgICAg ICAgICAgaW50IGhwb3MgPSBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICAg ICAgc3RydWN0IGdseXBoICpwcmV2aW91c19nbHlwaCA9ICgwIDw9IGhwb3MgLSAxICYmIGhwb3Mg LSAxIDwgcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIGhwb3MgLSAxCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTlVMTDsKKyAgICAgICAgICAvLyBz dHJ1Y3QgZ2x5cGggKmxhc3RfZ2x5cGggPSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51 c2VkW1RFWFRfQVJFQV0gLSAxOworICAgICAgICAgIGJvb2wgc2tpcF9wID0gKHByZXZpb3VzX2ds eXBoICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiBwcmV2aW91c19nbHlwaC0+ Y2hhcnBvcyA9PSBtYXRyaXhfcm93X2VuZF9jaGFycG9zIC0gMQorICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHN0YXJ0LT5ieXRlcG9zICE9IGVzc2VudGlhbHMuenZfYnl0ZSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgPyB0cnVlCisgICAgICAgICAgICAgICAgICAgICAgICAvKiBXaGVu IGEgYGJ1ZmZlci1kaXNwbGF5LXRhYmxlJyBlbnRyeSBjb250YWlucworICAgICAgICAgICAgICAg ICAgICAgICAgYSB2aXNpYmxlIHRhYiBjaGFyYWN0ZXIgKCLCuyIpLCB0aGUgc3Vic2VxdWVudAor ICAgICAgICAgICAgICAgICAgICAgICAgU1RSRVRDSF9HTFlQSCB3aWxsIGhhdmUgdGhlIHNhbWUg c3RhcnQtPmNoYXJwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgIGFzIHRoZSBhZm9yZW1lbnRp b25lZCB2aXNpYmxlIHRhYiBjaGFyYWN0ZXIuICovCisgICAgICAgICAgICAgICAgICAgICAgICA6 IChwcmV2aW91c19nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBw cmV2aW91c19nbHlwaC0+Y2hhcnBvcyA9PSBzdGFydC0+Y2hhcnBvcykKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgPyB0cnVlCisgICAgICAgICAgICAgICAgICAgICAgICA6IGZhbHNlOworICAg ICAgICAgIGludCBwb3NpbnQgPSAocm93X2JleW9uZF96dl9wCisgICAgICAgICAgICAgICAgICAg ICAgICAmJiAhcm93X2F0X3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgPyAtMQorICAg ICAgICAgICAgICAgICAgICAgICA6IChyb3dfYXRfenZfcCkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBlc3NlbnRpYWxzLnp2CisgICAgICAgICAgICAgICAgICAgICAgIDogKHN0YXJ0LT5i eXRlcG9zICE9IGVzc2VudGlhbHMuenZfYnl0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW1RFWFRfQVJFQV0g LSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgID8gbWF0cml4X3Jvd19lbmRfY2hhcnBvcyAt IDEKKyAgICAgICAgICAgICAgICAgICAgICAgOiAoc3RhcnQtPmJ5dGVwb3MgPT0gZXNzZW50aWFs cy56dl9ieXRlCisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHN0YXJ0IC0gcm93LT5nbHlw aHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpCisgICAgICAgICAgICAg ICAgICAgICAgICAgPyBlc3NlbnRpYWxzLnp2CisgICAgICAgICAgICAgICAgICAgICAgIDogc3Rh cnQtPmNoYXJwb3M7CisgICAgICAgICAgTGlzcF9PYmplY3Qgc3BlY3MgPSBtY19hc3NvYyAobWFr ZV9maXhudW0gKHBvc2ludCksIEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikp OworICBpbnQgc3RhcnRfY2hhcnBvcyA9IHN0YXJ0LT5jaGFycG9zOworICBpZiAoZGVidWdfcCkK KyAgICBmcHJpbnRmIChzdGRlcnIsICJcbkEuICB2cG9zICglZCkgfCBnbHlwaC0+Y2hhcnBvcyAo JWQpIHwgcG9zaW50ICglZCkgfCB6diAoJWQpIHwgenZfYnl0ZSAoJWQpXG5cCisgIHJvdyAtIDE6 ICBwZW51bHRpbWF0ZV9jaGFycG9zICglZCkgfCBsYXN0X2NoYXJwb3MgKCVkKSB8IGVuZHNfYXRf enZfcCAoJXMpXG5cC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ZW5kX2NoYXJwb3MpOworICAgICAgICAg IGlmICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAgICAg ICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAgJiYgIU5JTFAgKHNw ZWNzKQorICAgICAgICAgICAgICAmJiBzdGFydC0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAo dykKKyAgICAgICAgICAgICAgJiYgIXNraXBfcAorICAgICAgICAgICAgICAmJiAocm93X2F0X3p2 X3AgfHwgIXJvd19iZXlvbmRfenZfcCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIExp c3BfT2JqZWN0IGxpc3BfdHlwZSA9IG1jX250aCAoMSwgc3BlY3MpOworICAgICAgICAgICAgICBl bnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY19saXNwX3Rv X2N1cnNvcl90eXBlIChYQ0FSIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiBtY19saXNwX3RvX2N1cnNvcl90eXBlIChsaXNwX3R5 cGUpOworICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IChzdGFydC0+dHlwZSA9PSBJTUFHRV9H TFlQSCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0hPTExPV19CT1gKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IGN1cnNvcl90eXBlOworICAgICAgICAgICAgICBpbnQg Y3Vyc29yX3dpZHRoID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBYRklYTlVNIChYQ0FSIChYQ0RSIChsaXNwX3R5cGUpKSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogLTE7CisgICAgICAgICAgICAgIExpc3BfT2JqZWN0 IG1jX2ZvcmVncm91bmQgPSBtY19udGggKDIsIHNwZWNzKTsKKyAgICAgICAgICAgICAgc3RydWN0 IG1jX1JHQiBmb3JlZ3JvdW5kOworICAgICAgICAgICAgICBpZiAoU1RSSU5HUCAobWNfZm9yZWdy b3VuZCkpCisgICAgICAgICAgICAgICAgbWNfeHdfY29sb3JfdmFsdWVzICh3LCBtY19mb3JlZ3Jv dW5kLCAmZm9yZWdyb3VuZCk7CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoVkVDVE9SUCAobWNf Zm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGZv cmVncm91bmQucmVkID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDApKTsKKyAg ICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZC5ncmVlbiA9IFhGTE9BVF9EQVRBIChBUkVGICht Y19mb3JlZ3JvdW5kLCAxKSk7CisgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQuYmx1ZSA9 IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3JvdW5kLCAyKSk7CisgICAgICAgICAgICAgICAg ICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmIChOSUxQIChtY19mb3JlZ3JvdW5kKSkKKyAg ICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0Ig bHNsX2ZnOworICAgICAgICAgICAgICAgICAgICAgIG1jX2N1cnJlbnRfY29sdW1uX2ZnICh3LCBl c3NlbnRpYWxzLCBwb3NpbnQsICZsc2xfZmcpOworICAgICAgICAgICAgICAgICAgICAgIGZvcmVn cm91bmQucmVkID0gbHNsX2ZnLnJlZDsKKyAgICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5k LmdyZWVuID0gbHNsX2ZnLmdyZWVuOworICAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQu Ymx1ZSA9IGxzbF9mZy5ibHVlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAg IGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgICAgICAgICAgICAg IGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAg ICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgc3RhcnQsIFRFWFRfQVJFQSwgeCwgeF9s aW1pdCwgcm93LT55LAorICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0IC0gcm93LT5nbHlw aHNbVEVYVF9BUkVBXSwgdnBvcywgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAg ICAgY3Vyc29yX3dpZHRoLCBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLmZjX3gsIGZvcmVncm91 bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgTVVMVElQ TEVfQ1VSU09SUywgZHJhd19wLCBmcm9tX3doZXJlLCBNQ19DQUNIRSk7CisgICAgICAgICAgICB9 CisgICAgICAgIH0KKyAgICAgIGlmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMp LCBmY192aXNpYmxlKSkKKyAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPD0gdGV4dF9hcmVh X3dpZHRoCisgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID49IHctPm1jLmxudW1fcGl4ZWxf d2lkdGgpCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgeF9saW1pdCA9IHggKyBzdGFydC0+cGl4 ZWxfd2lkdGg7CisgICAgICAgICAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3AgPSAody0+Y3Vyc29y LnggPT0gZXNzZW50aWFscy5mY194CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgdy0+Y3Vyc29yLnkgPT0gc3RhcnQtPnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRf QVJFQV0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3Iu dnBvcyA9PSB2cG9zKTsKKyAgICAgICAgICBpZiAoeCArIHN0YXJ0LT5waXhlbF93aWR0aCA8PSB0 ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgJiYgKChoZWFkZXJfbGluZV9mb3JtYXQgPiAw ICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09 IDApCisgICAgICAgICAgICAgICYmICgoc3RhcnQgIT0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSAr IHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMQorICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlh bHMuZmNfeCA+PSB4CisgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194IDwgeCAr IHN0YXJ0LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgIHx8IChzdGFydCA9PSByb3ct PmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxCisgICAgICAgICAg ICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID49IHgpKQorICAgICAgICAgICAgICAmJiBz dGFydC0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAgICAgJiYgIXJl YWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3cs IHN0YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGltaXQsIHJvdy0+eSwKKyAgICAgICAgICAgICAgICAg ICAgICAgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLCB2cG9zLCBNQ19CQVIsIDEsCisg ICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMuZmNfeCwgZXNz ZW50aWFscy5mY19mZywgZXNzZW50aWFscy5hY3RpdmVfcCwgRklMTF9DT0xVTU4sCisgICAgICAg ICAgICAgICAgICAgICAgIGRyYXdfcCwgZnJvbV93aGVyZSwgRkNfQ0FDSEUpOworICAgICAgICB9 CisgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWly cykpCisgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2hvcml6b250YWxfcnVsZXIpKQor ICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgIHsKKyAgICAgICAg ICBpbnQgeF9saW1pdCA9IChzdGFydCA9PSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51 c2VkW1RFWFRfQVJFQV0gLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgPyB0ZXh0X2FyZWFf d2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgIDogeCArIHN0YXJ0LT5waXhlbF93aWR0aDsK KyAgICAgICAgICAvKiBQcmVzZXJ2ZSBzdXBwb3J0IGZvciBkZWZhdWx0IGJlaGF2aW9yIHN1Y2gg dGhhdCBhIHVzZXIgbWF5CisgICAgICAgICAgc3BlY2lmeSB0aGUgaGVpZ2h0IG9mIGFuIE1DX0hC QVIsIHdoaWNoIGJlZ2lucyBpdHMgam91cm5leQorICAgICAgICAgIGFzIHRoZSBgY3Vyc29yX3dp ZHRoJy4gIGBtY19nZXRfY3Vyc29yX2dlb21ldHJ5JyByZWFkanVzdHMuICovCisgICAgICAgICAg bWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgc3RhcnQsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwg cm93LT55LAorICAgICAgICAgICAgICAgICAgICAgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FS RUFdLCB2cG9zLCBNQ19IQkFSLCAxLAorICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJp eCwgZXNzZW50aWFscy5mY194LCBlc3NlbnRpYWxzLmNoX2ZnLCBlc3NlbnRpYWxzLmFjdGl2ZV9w LAorICAgICAgICAgICAgICAgICAgICAgSE9SSVpPTlRBTF9SVUxFUiwgZHJhd19wLCBmcm9tX3do ZXJlLCBDSF9DQUNIRSk7CisgICAgICAgIH0KKyAgICAgIGlmICghTklMUCAoQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAmJiAhTklMUCAoQlZBUiAo YiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICYmICFmaWxsX2NvbHVtbl90cnVtcHNf cCkKKyAgICAgICAgeworICAgICAgICAgIGN1cnNvcl90eXBlID0gKHN0YXJ0LT50eXBlID09IElN QUdFX0dMWVBIKQorICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19IT0xMT1dfQk9YCisgICAg ICAgICAgICAgICAgICAgICAgICA6IE1DX0JBUjsKKyAgICAgICAgICBpbnQgeF9saW1pdCA9IHdp bmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAgICAgICAgYm9vbCByZWFsX2Zha2Vf Y3Vyc29yX3AgPSAody0+Y3Vyc29yLnkgPT0gc3RhcnQtPnkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IudnBvcyA9PSB2cG9zKTsKKyAgICAgICAgICBp ZiAoKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAg fHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAgICYmICgoc3RhcnQgIT0g cm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMQorICAgICAg ICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHgKKyAgICAgICAgICAgICAgICAgICAmJiB3 LT5jdXJzb3IueCA8IHggKyBzdGFydC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICB8 fCAoc3RhcnQgPT0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFd IC0gMQorICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHgpKQorICAgICAg ICAgICAgICAmJiBzdGFydC0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAg ICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgIG1jX2VuZ2luZSAodywg bWF0cml4LCByb3csIHN0YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGltaXQsIHJvdy0+eSwKKyAgICAg ICAgICAgICAgICAgICAgICAgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLCB2cG9zLCBj dXJzb3JfdHlwZSwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNz ZW50aWFscy5mY194LCBlc3NlbnRpYWxzLmNoX2ZnLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLAorICAg ICAgICAgICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUiwgZHJhd19wLCBmcm9tX3doZXJlLCBD SF9DQUNIRSk7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgICAgeworICAgICAgICBp bnQgcmVsYXRpdmVfeCA9IDA7CisgICAgICAgIGZvciAoaW50IGFyZWEgPSBMRUZUX01BUkdJTl9B UkVBOyBhcmVhIDwgTEFTVF9BUkVBOyArK2FyZWEpCisgICAgICAgICAgeworICAgICAgICAgICAg c3RydWN0IGdseXBoICpnbHlwaCA9IHJvdy0+Z2x5cGhzW2FyZWFdOworICAgICAgICAgICAgc3Ry dWN0IGdseXBoICpnbHlwaF9lbmQgPSBnbHlwaCArIHJvdy0+dXNlZFthcmVhXTsKKyAgICAgICAg ICAgIC8qIEdseXBoIGZvciBhIGxpbmUgZW5kIGluIHRleHQuICovCisgICAgICAgICAgICBpZiAo YXJlYSA9PSBURVhUX0FSRUEgJiYgZ2x5cGggPT0gZ2x5cGhfZW5kICYmIGdseXBoLT5jaGFycG9z ID4gMCkKKyAgICAgICAgICAgICAgKytnbHlwaF9lbmQ7CisgICAgICAgICAgICBmb3IgKDsgZ2x5 cGggPCBnbHlwaF9lbmQ7ICsrZ2x5cGgpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg ICBpZiAodnBvcyAhPSB3LT5jdXJzb3IudnBvcworICAgICAgICAgICAgICAgICAgICAmJiBnbHlw aCAhPSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNf eCA8IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPCByZWxh dGl2ZV94CisgICAgICAgICAgICAgICAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgbWNfY29uZikpKQorICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAg ICAgICAgaWYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkK KyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLyogVGhlIHNwYWNlIGFw cGVuZGVkIHRvIGEgcm93IGVuZGluZyB3aXRoIGEgbmV3IGxpbmUgZG9lcworICAgICAgICAgICAg ICAgICAgICBub3QgaGF2ZSBhIGBnbHlwaC0+Y2hhcnBvc2AgKC0xLCAwKSB0aGF0IHdlIGNhbiB1 c2UgZm9yIHRoaXMKKyAgICAgICAgICAgICAgICAgICAgcGFydGljdWxhciBhcHBsaWNhdGlvbi4g IFdoZW4gYSBgYnVmZmVyLWRpc3BsYXktdGFibGUnIGVudHJ5CisgICAgICAgICAgICAgICAgICAg IGFzc2lnbnMgYSB2aXNpYmxlIGdseXBoIHRvIGEgbmV3IGxpbmUsIHRoZXJlIGlzIG5vIHByb2Js ZW0KKyAgICAgICAgICAgICAgICAgICAgYmVjYXVzZSB0aGF0IGdseXBoIGhhcyBhIGBnbHlwaC0+ Y2hhcnBvcycgdGhhdCB3ZSBjYW4gdXNlLgorICAgICAgICAgICAgICAgICAgICBXaGVuIG5vIHZp c2libGUgRU9MIGdseXBoIGV4aXN0cywgd2UgdXNlIHRoZSBmb2xsb3dpbmcgdGVzdDoKKyAgICAg ICAgICAgICAgICAgICAgdGhlIGFwcGVuZGVkIHNwYWNlIGhhcyBhIHBvc2l0aW9uIHRoYXQgaXMg b25lIGxlc3MgdGhhbiB0aGUKKyAgICAgICAgICAgICAgICAgICAgZW5kIG9mIHRoZSBtYXRyaXgg cm93LiAqLworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5nbHlw aHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoICpwcmV2aW91 c19nbHlwaCA9ICgwIDw9IGhwb3MgLSAxICYmIGhwb3MgLSAxIDwgcm93LT51c2VkW1RFWFRfQVJF QV0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyBocG9zIC0gMQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOVUxMOworICAgICAgICAgICAgICAgICAg ICAvLyBzdHJ1Y3QgZ2x5cGggKmxhc3RfZ2x5cGggPSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsg cm93LT51c2VkW1RFWFRfQVJFQV0gLSAxOworICAgICAgICAgICAgICAgICAgICBib29sIHNraXBf cCA9IChwcmV2aW91c19nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHByZXZpb3VzX2dseXBoLT5jaGFycG9zID09IG1hdHJpeF9yb3dfZW5kX2NoYXJw b3MgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT5ieXRl cG9zICE9IGVzc2VudGlhbHMuenZfYnl0ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gdHJ1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFdoZW4g YSBgYnVmZmVyLWRpc3BsYXktdGFibGUnIGVudHJ5IGNvbnRhaW5zCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgYSB2aXNpYmxlIHRhYiBjaGFyYWN0ZXIgKCLCuyIpLCB0aGUgc3Vi c2VxdWVudAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNUUkVUQ0hfR0xZUEgg d2lsbCBoYXZlIHRoZSBzYW1lIGdseXBoLT5jaGFycG9zCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgYXMgdGhlIGFmb3JlbWVudGlvbmVkIHZpc2libGUgdGFiIGNoYXJhY3Rlci4g Ki8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChwcmV2aW91c19nbHlwaCAh PSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcHJldmlvdXNf Z2x5cGgtPmNoYXJwb3MgPT0gZ2x5cGgtPmNoYXJwb3MpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IHRydWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBpbnQgcG9zaW50ID0gKHJvd19iZXlvbmRfenZf cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3dfYXRfenZfcCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAtMQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAocm93X2F0X3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IGVzc2VudGlhbHMuenYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogKGdseXBoLT5ieXRlcG9zICE9IGVzc2VudGlhbHMuenZfYnl0ZQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFd ID09IHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBtYXRyaXhfcm93X2VuZF9jaGFycG9zIC0gMQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAoZ2x5cGgtPmJ5dGVwb3MgPT0gZXNzZW50aWFscy56dl9ieXRlCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaCAtIHJvdy0+Z2x5cGhz W1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IGVzc2VudGlhbHMuenYKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogZ2x5cGgtPmNoYXJwb3M7CisgICAgICAgICAgICAgICAgICAgIExpc3Bf T2JqZWN0IHNwZWNzID0gbWNfYXNzb2MgKG1ha2VfZml4bnVtIChwb3NpbnQpLCBCVkFSIChYQlVG RkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKTsKKyAgaW50IGdseXBoX2NoYXJwb3MgPSBnbHlw aC0+Y2h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wgcm93X2JleW9uZF96dl9wID8gInkiIDogIm4iLAorICAgIHBl bnVsdGltYXRlX2dseXBoX2NoYXJwb3MsIGxhc3RfZ2x5cGhfY2hhcnBvcywgcm93LT5lbmRzX2F0 X3p2X3AgPyAieSIgOiAibiIsCisgICAgbWF0cml4X3Jvd19zdGFydF9ieXRlcG9zLCBtYXRyaXhf cm93X2VuZF9ieXRlcG9zLAorICAgICAgbWF0cml4X3Jvd19zdGFydF9jaGFycG9zLCBtYXRyaXhf cm93X2VuZF9jaGFycG9zKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCgoaGVhZGVyX2xpbmVf Zm9ybWF0ID4gMCAmJiB2cG9zID4gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICB8fCBoZWFk ZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChz cGVjcykKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT55IDw9IHdpbmRvd190ZXh0 X2JvdHRvbV95ICh3KQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXNraXBfcAorICAgICAg ICAgICAgICAgICAgICAgICAgJiYgKHJvd19hdF96dl9wIHx8ICFyb3dfYmV5b25kX3p2X3ApKQor ICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExpc3BfT2Jq ZWN0IGxpc3BfdHlwZSA9IG1jX250aCAoMSwgc3BlY3MpOworICAgICAgICAgICAgICAgICAgICAg ICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSA9IChDT05TUCAobGlzcF90eXBlKSkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKFhDQVIgKGxpc3BfdHlwZSkpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBtY19saXNw X3RvX2N1cnNvcl90eXBlIChsaXNwX3R5cGUpOworICAgICAgICAgICAgICAgICAgICAgICAgY3Vy c29yX3R5cGUgPSAoZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUNfSE9MTE9XX0JPWAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IGN1cnNvcl90eXBlOworICAgICAgICAgICAgICAgICAgICAg ICAgaW50IGN1cnNvcl93aWR0aCA9IChDT05TUCAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFhGSVhOVU0gKFhDQVIgKFhDRFIgKGxpc3Bf dHlwZSkpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogLTE7 CisgICAgICAgICAgICAgICAgICAgICAgICBMaXNwX09iamVjdCBtY19mb3JlZ3JvdW5kID0gbWNf bnRoICgyLCBzcGVjcyk7CisgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGZv cmVncm91bmQ7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoU1RSSU5HUCAobWNfZm9yZWdy b3VuZCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX3h3X2NvbG9yX3ZhbHVlcyAodywg bWNfZm9yZWdyb3VuZCwgJmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgICAgICAgICAgICBl bHNlIGlmIChWRUNUT1JQIChtY19mb3JlZ3JvdW5kKSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kLnJlZCA9IFhG TE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3JvdW5kLCAwKSk7CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBmb3JlZ3JvdW5kLmdyZWVuID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVn cm91bmQsIDEpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQuYmx1 ZSA9IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3JvdW5kLCAyKSk7CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKE5J TFAgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgbWNfY3VycmVudF9jb2x1bW5fZmcgKHcsIGVzc2VudGlhbHMs IHBvc2ludCwgJmxzbF9mZyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JlZ3Jv dW5kLnJlZCA9IGxzbF9mZy5yZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3Jl Z3JvdW5kLmdyZWVuID0gbHNsX2ZnLmdyZWVuOworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgZm9yZWdyb3VuZC5ibHVlID0gbHNsX2ZnLmJsdWU7CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQ T1MgKHJvdywgbWF0cml4KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0g d2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgICAgICAgICAgICAg IG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4X2xpbWl0LCByb3ctPnksIGdseXBoIC0g cm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgdnBvcywgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgY3Vyc29yX21hdHJpeCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5mY194LCBmb3JlZ3JvdW5k LCBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBNVUxUSVBMRV9DVVJTT1JTLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBkcmF3X3AsIGZyb21fd2hlcmUsIE1DX0NBQ0hFKTsKKyAgICAg ICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAg aWYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQorICAg ICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPD0gdGV4dF9hcmVhX3dpZHRoCisg ICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSB3LT5tYy5sbnVtX3BpeGVs X3dpZHRoKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpbnQgeF9s aW1pdCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAgICAgICAgICAgICAg ICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKHctPmN1cnNvci54ID09IGVzc2VudGlhbHMu ZmNfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5jdXJzb3IueSA9PSBnbHlwaC0+eQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RF WFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgdy0+Y3Vyc29yLnZwb3MgPT0gdnBvcyk7CisgICAgICAgICAgICAgICAgICAgIGludCBocG9z ID0gZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgICAgICAgICAgICBp ZiAoaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICAgICAgICAgICAgICAmJiBocG9zIDwg aHBvc19zdGFydCArIGhwb3NfbGVuZ3RoCisgICAgICAgICAgICAgICAgICAgICAgICAmJiByZWxh dGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoIDw9IHRleHRfYXJlYV93aWR0aAorICAgICAgICAg ICAgICAgICAgICAgICAgJiYgKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQor ICAgICAgICAgICAgICAgICAgICAgICAgJiYgKChnbHlwaCAhPSBnbHlwaF9lbmQgLSAxCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSByZWxhdGl2ZV94 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA8IHJlbGF0 aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg fHwgKGdseXBoID09IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgZXNzZW50aWFscy5mY194ID49IHJlbGF0aXZlX3gpKQorICAgICAgICAgICAgICAgICAg ICAgICAgJiYgZ2x5cGgtPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAgICAgICAg ICAgICAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAgICAgICAgICAg ICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4 X2xpbWl0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT55LCBocG9zLCB2 cG9zLCBNQ19CQVIsIDEsIGN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBlc3NlbnRpYWxzLmZjX3gsIGVzc2VudGlhbHMuZmNfZmcsIGVzc2VudGlhbHMuYWN0 aXZlX3AsIEZJTExfQ09MVU1OLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJh d19wLCBmcm9tX3doZXJlLCBGQ19DQUNIRSk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgICAgaWYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFp cnMpKQorICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfaG9yaXpvbnRh bF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3Mp CisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0g d2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgICAgICAgICAgaW50 IGhwb3MgPSBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICAgICAgICAgICAg ICAgIC8qIFByZXNlcnZlIHN1cHBvcnQgZm9yIGRlZmF1bHQgYmVoYXZpb3Igc3VjaCB0aGF0IGEg dXNlciBtYXkKKyAgICAgICAgICAgICAgICAgICAgc3BlY2lmeSB0aGUgaGVpZ2h0IG9mIGFuIE1D X0hCQVIsIHdoaWNoIGJlZ2lucyBpdHMgam91cm5leQorICAgICAgICAgICAgICAgICAgICBhcyB0 aGUgYGN1cnNvcl93aWR0aCcuICBgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeScgcmVhZGp1c3RzLiAq LworICAgICAgICAgICAgICAgICAgICBpZiAoaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAg ICAgICAgICAgICAgICAmJiBocG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoKQorICAgICAg ICAgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCBy ZWxhdGl2ZV94LCB4X2xpbWl0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93 LT55LCBocG9zLCB2cG9zLCBNQ19IQkFSLCAxLCBjdXJzb3JfbWF0cml4LAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5mY194LCBlc3NlbnRpYWxzLmNoX2ZnLCBl c3NlbnRpYWxzLmFjdGl2ZV9wLCBIT1JJWk9OVEFMX1JVTEVSLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgZHJhd19wLCBmcm9tX3doZXJlLCBDSF9DQUNIRSk7CisgICAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZB UiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAmJiAhZmlsbF9j b2x1bW5fdHJ1bXBzX3ApCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAg IGN1cnNvcl90eXBlID0gKGdseXBoLT50eXBlID09IElNQUdFX0dMWVBIKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUNfSE9MTE9XX0JPWAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogTUNfQkFSOworICAgICAgICAgICAgICAgICAgICBpbnQgeF9saW1p dCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAgICAgICAgICAgICAgICAg IGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKHctPmN1cnNvci55ID09IGdseXBoLT55CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci52 cG9zID09IHZwb3MpOworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGhwb3MgPj0gaHBv c19zdGFydAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA8IGhwb3Nfc3RhcnQgKyBo cG9zX2xlbmd0aAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKChoZWFkZXJfbGluZV9mb3Jt YXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGhlYWRl cl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKChnbHlwaCAh PSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNv ci54ID49IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vy c29yLnggPCByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHx8IChnbHlwaCA9PSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHJlbGF0aXZlX3gpKQorICAgICAgICAg ICAgICAgICAgICAgICAgJiYgZ2x5cGgtPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisg ICAgICAgICAgICAgICAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAg ICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxh dGl2ZV94LCB4X2xpbWl0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT55 LCBocG9zLCB2cG9zLCBjdXJzb3JfdHlwZSwgMSwgY3Vyc29yX21hdHJpeCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuZmNfeCwgZXNzZW50aWFscy5jaF9mZywg ZXNzZW50aWFscy5hY3RpdmVfcCwgVkVSVElDQUxfUlVMRVIsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBkcmF3X3AsIGZyb21fd2hlcmUsIENIX0NBQ0hFKTsKKyAgICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0 aDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgIH0KKyAgLy8gIGNsb2NrX3Qg Y2xvY2tfZW5kID0gY2xvY2soKTsKKyAgLy8gIGRvdWJsZSBjcHVfdGltZV91c2VkID0gKChkb3Vi bGUpIChjbG9ja19lbmQgLSBjbG9ja19zdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7CisgIC8vICBm cHJpbnRmIChzdGRlcnIsICJtY19kcmF3X3JvdyAoJXMpOiAgVElNRSAoJWYpXG4iLCBtY193aW5k b3cgKHcpLCBjcHVfdGltZV91c2VkKTsKK30KKwordm9pZAorbWNfcmVkcmF3X3JvdyAoc3RydWN0 IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93 ICpyb3csCisgICAgICAgICAgICAgICBpbnQgc3RhcnRfeCwgaW50IHN0YXJ0X2hwb3MsIGludCBl bmRfaHBvcywgYm9vbCBjbGVhcl9lb2xfcCwKKyAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlw aHNfZmFjZSBobCkKK3sKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUg KHcpKTsKKyAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgVFJB Q0UgKChzdGRlcnIsICJtY19yZWRyYXdfcm93ICglZCk6ICB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IG1hdHJpeCk7CisgIC8qIFNUUkVUQ0hfR0xZ UEggbWF5IGNvbnRhaW4gbW9yZSB0aGFuIG9uZSBmYWtlIGN1cnNvciBhdCB0aGUgc2FtZSBIUE9T LiAqLworICBmb3IgKGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7Cisg ICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICsrY2FjaGVfdHlwZSkKKyAgICB7 CisgICAgICBmb3IgKGludCBudGggPSAwOyB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW2NhY2hl X3R5cGVdID4gMCAmJiBudGggPCB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2Nh Y2hlX3R5cGVdOyArK250aCkKKyAgICAgICAgeworICAgICAgICAgIGludCB4ID0gdy0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS54OworICAgICAgICAgIGludCBm eCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZng7Cisg ICAgICAgICAgaW50IHkgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLnk7CisgICAgICAgICAgaW50IGZ5ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXS5meTsKKyAgICAgICAgICBpbnQgaHBvcyA9IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uaHBvczsKKyAgICAgICAgICBpbnQg dnBvcyA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0udnBv czsKKyAgICAgICAgICBpbnQgd2QgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhdLndkOworICAgICAgICAgIGludCBoID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5oOworICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5 cGUgY3Vyc29yX3R5cGUgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLmN1cnNvcl90eXBlOworICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGggPSB3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmN1cnNvcl93aWR0aDsKKyAg ICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZyA9IHsucmVkID0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5mb3JlZ3JvdW5kLnJlZCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLmZvcmVncm91bmQuZ3JlZW4sCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgLmJsdWUgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhdLmZvcmVncm91bmQuYmx1ZX07CisgICAgICAgICAgc3RydWN0IG1jX1JH QiBsc2xfYmcgPSB7LnJlZCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF0uYmFja2dyb3VuZC5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgLmdyZWVuID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XS5iYWNrZ3JvdW5kLmdyZWVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5i bHVlID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5iYWNr Z3JvdW5kLmJsdWV9OworICAgICAgICAgIGJvb2wgYWN0aXZlX3AgPSB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmFjdGl2ZV9wOworICAgICAgICAgIGVudW0g bWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF0uZ2x5cGhfZmxhdm9yOworICAgICAgICAgIGJvb2wgZW5hYmxlZF9wID0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFibGVkX3A7 CisgICAgICAgICAgaWYgKHZwb3MgPT0gdm50aAorICAgICAgICAgICAgICAmJiAoKGhwb3MgPj0g c3RhcnRfaHBvcworICAgICAgICAgICAgICAgICAgICYmIGhwb3MgPCBlbmRfaHBvcykKKyAgICAg ICAgICAgICAgICAgIC8qIEEgZmxvYXRpbmcgY3Vyc29yIGJleW9uZCB0aGUgZW5kIG9mIHRoZSBn bHlwaCByb3cuICovCisgICAgICAgICAgICAgICAgICB8fCAoaHBvcyArIDEgPT0gc3RhcnRfaHBv cworICAgICAgICAgICAgICAgICAgICAgICYmIGhwb3MgKyAxID09IGVuZF9ocG9zKSkKKyAgICAg ICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBib29s IHJlbW92ZV9wID0gZmFsc2U7CisgICAgICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3 LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGxz bF9mZywgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnbHlw aF9mbGF2b3IsIHJlbW92ZV9wKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAg Ly8gIGNsb2NrX2VuZCA9IGNsb2NrKCk7CisgIC8vICBkb3VibGUgdGltZV9jdXJzb3JzID0gKChk b3VibGUpIChjbG9ja19lbmQgLSBjbG9ja19zdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7CisgIC8v ICBmcHJpbnRmIChzdGRlcnIsICJtY19yZWRyYXdfcm93ICglZCk6ICBocG9zICglZC8lZCkgfCBn bHlwaHMgKCVmKSB8IGN1cnNvcnMgKCVmKVxuIiwKKyAgLy8gICAgICAgICAgICAgICAgICAgdnBv cywgc3RhcnRfaHBvcywgZW5kX2hwb3MsIHRpbWVfZ2x5cGhzLCB0aW1lX2N1cnNvcnMpOworfQor Cit2b2lkCittY19lcmFzZV9yb3cgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRy aXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93KQoreworICBpbnQgdnBvcyA9IE1BVFJJ WF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAg ZnByaW50ZiAoc3RkZXJyLCAibWNfZXJhc2Vfcm93ICglcyk6ICB2cG9zICglZClcbiIsIG1jX3dp bmRvdyAodyksIHZwb3MpOworICBpbnQgdm50aCA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRy aXgpOworICAvLyAgaWYgKHRyYWNlX3JlZGlzcGxheV9wKQorICAvLyAgICBmcHJpbnRmIChzdGRl cnIsICJtY19lcmFzZV9oZWxwZXIgKCVzKTogIGNhY2hlICglcykgfCB2cG9zICglZClcbiIsCisg IC8vICAgICAgbWNfd2luZG93ICh3KSwgbWNfY2FjaGVfdHlwZV90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3R5cGVdW250 aF0uYmFja2dyb3VuZC5ibHVlfTsKKyAgICAgICAgICBib29sIGFjdGl2ZV9wID0gdy0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5hY3RpdmVfcDsKKyAgICAgICAg ICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoX2ZsYXZvcjsKKyAgICAgICAgICBib29sIGVuYWJs ZWRfcCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZW5h YmxlZF9wOworICAgICAgICAgIC8qIGBtYXRyaXhfcm93JyBpbiBgZGlzcG5ldy5jYCBjb250YWlu cyB0aGUgZm9sbG93aW5nIHRlc3RzLAorICAgICAgICAgIGVhc3NlcnQgKG1hdHJpeCAmJiBtYXRy aXgtPnJvd3MpOworICAgICAgICAgIGVhc3NlcnQgKHJvdyA+PSAwICYmIHJvdyA8IG1hdHJpeC0+ bnJvd3MpOyAqLworICAgICAgICAgIGJvb2wgYmFyZl9jcmFzaF9vbmUgPSAobWF0cml4ICYmIG1h dHJpeC0+cm93cykgPyBmYWxzZSA6IHRydWU7CisgICAgICAgICAgaWYgKGJhcmZfY3Jhc2hfb25l KQorICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgYm9vbCBiYXJmX2NyYXNoX3R3byA9 ICh2cG9zID49IDAgJiYgdnBvcyA8IG1hdHJpeC0+bnJvd3MpID8gZmFsc2UgOiB0cnVlOworICAg ICAgICAgIGlmIChiYXJmX2NyYXNoX3R3bykKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAg ICAgIGlmICh2cG9zID09IHZudGgKKyAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yID09IE1D X0dMWVBICisgICAgICAgICAgICAgICYmIGVuYWJsZWRfcCkKKyAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgbWNfZXJhc2VfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgeSwgaHBvcywgdnBv cywgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QpOworICAgICAgICAgICAgICB3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmVuYWJsZWRfcCA9IGZhbHNl OworICAgICAgICAgICAgICAtLXctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVfdHlwZV07 CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmICh2cG9zID09IHZudGgKKyAgICAg ICAgICAgICAgICAgICAgICYmIGVuYWJsZWRfcCkKKyAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgIGJvb2wgcmVtb3ZlX3AgPSB0cnVlOworICAgICAgICAgICAgICAgIG1jX2RyYXdfZXJh c2VfaHlicmlkICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwg aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUsIGN1 cnNvcl93aWR0aCwgbHNsX2JnLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgZ2x5cGhfZmxhdm9yLCByZW1vdmVfcCk7CisgICAgICAgICAgICAgICAgdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFibGVkX3AgPSBm YWxzZTsKKyAgICAgICAgICAgICAgICAtLXctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVf dHlwZV07CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXSA9IDA7Cisg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7CisgIHwgICAg ICAgICAgICAgfCAgICBydW4uaGVpZ2h0ID09IDEwODAgLSA1NDAgPT0gNTQwCisgIHwgICAgICAg ICAgICAgfCAgICBbVGhlIGVudGlyZSBib3R0b20gcmVjdGFuZ2xlIGdldHMgY29waWVkIHRvIHVw cGVyIHJ1bi5kZXNpcmVkX3kuXQorICB8ICAgICAgICAgICAgIHwKKyAgKy0tLS0tLS0tLS0tLS0r IDw9IHJ1bi5jdXJyZW50X3kgPT0gNTQwCisgIHwgICAgICAgICAgICAgfAorICB8ICAgICAgICAg ICAgIHwgPD0gcnVuLmRlc2lyZWRfeSA9PSA4MTAgW2Rvd24gKOKGkyldID09IHJ1bi5jdXJyZW50 X3kgPiBydW4uZGVzaXJlZF95CisgIHwgICAgICAgICAgICAgfCAgICBydW4uaGVpZ2h0ID0gaXQu bGFzdF92aXNpYmxlX3kgLSBydW4uZGVzaXJlZF95CisgIHwgICAgICAgICAgICAgfCAgICBydW4u aGVpZ2h0ID09IDEwODAgLSA4MTAgPT0gMjcwCisgIHwgICAgICAgICAgICAgfCAgICBbVG9wIHBh cnQgb2YgdGhlIGxvd2VyIHJlY3RhbmdsZSBnZXRzIGNvcGllZCB0byBsb3dlciBydW4uZGVzaXJl ZF95Ll0KKyAgfCAgICAgICAgICAgICB8CisgICstLS0tLS0tLS0tLS0tKyA8PSBpdC5sYXN0X3Zp c2libGVfeSA9PSAxMDgwICovCit2b2lkCittY19wcmVfc2Nyb2xsX2NsZWFuIChzdHJ1Y3Qgd2lu ZG93ICp3LCBzdHJ1Y3QgcnVuIHJ1biwgaW50IHN0YXJ0X3Zwb3MsCisgICAgICAgICAgICAgICAg ICAgICBpbnQgbnJvd3Nfc2Nyb2xsZWQsIGVudW0gbWNfcHJlX3Njcm9sbF9jbGVhbiBmcm9tX3do ZXJlKQoreworICBpZiAoTUlOSV9XSU5ET1dfUCAodykpCisgICAgcmV0dXJuOworICBib29sIGdv X29uZV9wID0gKHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbTUNfQ0FDSEVdID4gMAorICAgICAg ICAgICAgICAgICAgIHx8IHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbQ0hfQ0FDSEVdID4gMAor ICAgICAgICAgICAgICAgICAgIHx8IHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbRkNfQ0FDSEVd ID4gMCk7CisgIGJvb2wgZ29fdHdvX3AgPSAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAg ICAgICAgICAgICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3Nz aGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKSk7CisgIGlmICh0cmFj ZV9yZWRpc3BsYXlfcCkKKyAgICBmcHJpbnRmIChzdGRlcnIsICJtY19wcmVfc2Nyb2xsX2NsZWFu ICglcyk6XG5cCisgICVzIHwgZ29fb25lX3AgKCVzKSB8IGdvX3R3b19wICglcylcblwKKyAgc3Rh cnRfdnBvcyAoJWQpIHwgbnJvd3Nfc2Nyb2xsZWQgKCVkKVxuXAorICAlczogIHJ1bi5jdXJyZW50 L2Rlc2lyZWRfeSAoJWQvJWQpIHwgcnVuLmhlaWdodCAoJWQpXG4iLAorICAgIG1jX3dpbmRvdyAo dyksIChmcm9tX3doZXJlID09IFRSWV9XSU5ET1dfUkVVU0lOR19DVVJSRU5UX01BVFJJWF9ET1dO KQorICAgICAgICAgICAgICAgICAgICAgPyAiVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFU UklYX0RPV04iCisgICAgICAgICAgICAgICAgICAgOiAoZnJvbV93aGVyZSA9PSBUUllfV0lORE9X X1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfVVApCisgICAgICAgICAgICAgICAgICAgICA/ICJUUllf V0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfVVAiCisgICAgICAgICAgICAgICAgICAgOiAo ZnJvbV93aGVyZSA9PSBUUllfV0lORE9XX0lEKQorICAgICAgICAgICAgICAgICAgICAgPyAiVFJZ X1dJTkRPV19JRCIKKyAgICAgICAgICAgICAgICAgICA6ICJVTktOT1dOIiwKKyAgICBnb19vbmVf cCA/ICJ5ZXMiIDogIm5vIiwgZ29fdHdvX3AgPyAieWVzIiA6ICJubyIsCisgICAgc3RhcnRfdnBv cywgbnJvd3Nfc2Nyb2xsZWQsCisgICAgcnVuLmN1cnJlbnRfeSA8IHJ1bi5kZXNpcmVkX3kgPyAi 4oaTIiA6ICLihpEiLAorICAgIHJ1bi5jdXJyZW50X3ksIHJ1bi5kZXNpcmVkX3ksIHJ1bi5oZWln aHQpOworICBpZiAoIWdvX29uZV9wICYmICFnb190d29fcCkKKyAgICByZXR1cm47CisgIGJvb2wg dXBkYXRpbmdfZnJhbWVfcCA9IGZhbHNlOworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHct PmZyYW1lKTsKKyAgaWYgKFhGUkFNRSAody0+ZnJhbWUpICE9IGYtPm1jX3VwZGF0aW5nX2ZyYW1l CisgICAgICAmJiAoZ29fb25lX3AgfHwgZ29fdHdvX3ApKQorICAgIHsKKyAgICAgIHVwZGF0aW5n X2ZyYW1lX3AgPSB0cnVlOworICAgICAgdXBkYXRlX2JlZ2luIChmKTsKKyAgICB9CisgIGlmICh3 LT5waHlzX2N1cnNvcl9vbl9wCisgICAgICAmJiBnb190d29fcCkKKyAgICBlcmFzZV9waHlzX2N1 cnNvciAodyk7CisgIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0 cml4OworICBmb3IgKGludCB2bnRoID0gc3RhcnRfdnBvczsKKyAgICAgICBtYXRyaXggIT0gTlVM TAorICAgICAgICYmIHZudGggPCBtYXRyaXgtPm5yb3dzCisgICAgICAgJiYgTUFUUklYX1JPVyAo bWF0cml4LCB2bnRoKS0+ZW5hYmxlZF9wCisgICAgICAgJiYgZ29fb25lX3A7CisgICAgICAgKyt2 bnRoKQorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdyA9IE1BVFJJWF9ST1cgKG1h dHJpeCwgdm50aCk7CisgICAgICBtY19lcmFzZV9yb3cgKHcsIG1hdHJpeCwgcm93KTsKKyAgICB9 CisgIGlmICh1cGRhdGluZ19mcmFtZV9wKQorICAgIHVwZGF0ZV9lbmQgKGYpOworICAvLyBtY19y ZXNldF9jYWNoZSAodyk7Cit9CisKK0RFRlVOICgibWMtc3RkZXJyIiwgRm1jX3N0ZGVyciwgU21j X3N0ZGVyciwgMCwgMSwgIlAiLAorICAgICAgIGRvYzogLyogVG9nZ2xlIHRyYWNpbmcgb2YgbXVs dGlwbGUgZmFrZSBjdXJzb3JzLgorV2l0aCBBUkcsIHR1cm4gdHJhY2luZyBvbiBpZiBhbmQgb25s eSBpZiBBUkcgaXMgcG9zaXRpdmUuICovKQorICAoTGlzcF9PYmplY3QgYXJnKQoreworICBpZiAo TklMUCAoYXJnKSkKKyAgICBtY19zdGRlcnJfcCA9ICFtY19zdGRlcnJfcDsKKyAgZWxzZQorICAg IHsKKyAgICAgIGFyZyA9IEZwcmVmaXhfbnVtZXJpY192YWx1ZSAoYXJnKTsKKyAgICAgIG1jX3N0 ZGVycl9wID0gWEZJWE5VTSAoYXJnKSA+IDA7CisgICAgfQorICByZXR1cm4gUW5pbDsKK30KKwor LyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK IAwKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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AgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGNo YXJwb3MgPD0gWlYpKQorICAgICAgICAgICAgICAgICAgICAgICAgPyBmYWxzZQorICAgICAgICAg ICAgICAgICAgICAgICAgOiB0cnVlOworICBpZiAoYmFyZl9jcmFzaF9vbmUpCisgICAgcmV0dXJu IGhzY3JvbGxlZF9wOworCisgIC8qIGByZXNlYXRfMSc6ICBDSEFSUE9TIChwb3MpID49IEJFR1Yg JiYgQ0hBUlBPUyAocG9zKSA8PSBaViAqLworICBib29sIGJhcmZfY3Jhc2hfdHdvID0gKGNoYXJw b3MgPj0gQkVHViAmJiBjaGFycG9zIDw9IFpWKQorICAgICAgICAgICAgICAgICAgICAgICAgID8g ZmFsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICA6IHRydWU7CisgIGlmIChiYXJmX2NyYXNo X3R3bykKKyAgICByZXR1cm4gaHNjcm9sbGVkX3A7CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JT ICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAgICAgLyogTW92ZSBpdGVyYXRv ciB0byBwdCBzdGFydGluZyBhdCBjdXJzb3Jfcm93LT5zdGFydCBpbgogCQkgYSBsaW5lIHdpdGgg aW5maW5pdGUgd2lkdGguICAqLwogCSAgICAgIGluaXRfdG9fcm93X3N0YXJ0ICgmaXQsIHcsIGN1 cnNvcl9yb3cpOwpAQCAtMTQyODcsOSArMTg4NjcsMjIgQEAgcmVkaXNwbGF5X2ludGVybmFsICh2 b2lkKQogCSAgICAgICp3LT5kZXNpcmVkX21hdHJpeC0+bWV0aG9kID0gMDsKIAkgICAgICBkZWJ1 Z19tZXRob2RfYWRkICh3LCAib3B0aW1pemF0aW9uIDEiKTsKICNlbmRpZgorCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCiAjaWZkZWYgSEFWRV9X SU5ET1dfU1lTVEVNCisgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICYmICFOSUxQ IChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICBtY191cGRh dGVfd2luZG93X2ZyaW5nZXMgKHcsIGZhbHNlKTsKKyAgICBlbHNlCiAJICAgICAgdXBkYXRlX3dp bmRvd19mcmluZ2VzICh3LCBmYWxzZSk7CiAjZW5kaWYKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogCSAgICAgIGdvdG8gdXBkYXRlOwogCSAgICB9CiAJICBlbHNlCkBAIC0xNzY4Nywx MCArMjIyODAsMjIgQEAgcmVkaXNwbGF5X3dpbmRvdyAoTGlzcF9PYmplY3Qgd2luZG93LCBib29s IGp1c3RfdGhpc19vbmVfcCkKICAgICB9CiAKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBi b29sIGtlZXBfY3VycmVudF9wID0gKGp1c3RfdGhpc19vbmVfcAorICAgICAgICAgICAgICAgICAg ICAgICAgIHx8ICghdXNlZF9jdXJyZW50X21hdHJpeF9wICYmICFvdmVybGF5X2Fycm93X3NlZW4p CisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgdy0+cHNldWRvX3dpbmRvd19wKTsKKworICBi b29sIGZyaW5nZXNfdXBkYXRlZF9wID0gKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGNyb3NzaGFpcnMpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfdXBkYXRlX3dp bmRvd19mcmluZ2VzICh3LCBrZWVwX2N1cnJlbnRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogdXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCBrZWVwX2N1cnJlbnRfcCk7CisKICAgaWYg KEZSQU1FX1dJTkRPV19QIChmKQotICAgICAgJiYgdXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCAo anVzdF90aGlzX29uZV9wCi0JCQkJICAgIHx8ICghdXNlZF9jdXJyZW50X21hdHJpeF9wICYmICFv dmVybGF5X2Fycm93X3NlZW4pCi0JCQkJICAgIHx8IHctPnBzZXVkb193aW5kb3dfcCkpKQorICAg ICAgJiYgZnJpbmdlc191cGRhdGVkX3ApCiAgICAgewogICAgICAgdXBkYXRlX2JlZ2luIChmKTsK ICAgICAgIGJsb2NrX2lucHV0ICgpOwpAQCAtMTc3MDUsNiArMjIzMTAsOSBAQCByZWRpc3BsYXlf d2luZG93IChMaXNwX09iamVjdCB3aW5kb3csIGJvb2wganVzdF90aGlzX29uZV9wKQogICAgICAg dXBkYXRlX2VuZCAoZik7CiAgICAgfQogCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAg IGlmIChXSU5ET1dfQk9UVE9NX0RJVklERVJfV0lEVEggKHcpKQogICAgIHhfZHJhd19ib3R0b21f ZGl2aWRlciAodyk7CiAjZW5kaWYgLyogSEFWRV9XSU5ET1dfU1lTVEVNICovCkBAIC0xODAxMCw2 ICsyMjYxOCw3IEBAIHRyeV93aW5kb3dfcmV1c2luZ19jdXJyZW50X21hdHJpeCAoc3RydWN0IHdp bmRvdyAqdykKIAkgICAgIHNjcm9sbF9ydW5faG9vayB3aWxsIGNsZWFyIHRoZSBjdXJzb3IsIGFu ZCB1c2UgdGhlCiAJICAgICBjdXJyZW50IG1hdHJpeCB0byBnZXQgdGhlIGhlaWdodCBvZiB0aGUg cm93IHRoZSBjdXJzb3IgaXMKIAkgICAgIGluLiAgKi8KKwogCSAgcnVuLmN1cnJlbnRfeSA9IHN0 YXJ0X3Jvdy0+eTsKIAkgIHJ1bi5kZXNpcmVkX3kgPSBpdC5jdXJyZW50X3k7CiAJICBydW4uaGVp Z2h0ID0gaXQubGFzdF92aXNpYmxlX3kgLSBpdC5jdXJyZW50X3k7CkBAIC0xODAxOSw2ICsyMjYy OCwxNiBAQCB0cnlfd2luZG93X3JldXNpbmdfY3VycmVudF9tYXRyaXggKHN0cnVjdCB3aW5kb3cg KncpCiAJICAgICAgdXBkYXRlX2JlZ2luIChmKTsKIAkgICAgICBGUkFNRV9SSUYgKGYpLT51cGRh dGVfd2luZG93X2JlZ2luX2hvb2sgKHcpOwogCSAgICAgIEZSQU1FX1JJRiAoZiktPmNsZWFyX3dp bmRvd19tb3VzZV9mYWNlICh3KTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1V TFRJUExFLUNVUlNPUlMgKi8KKworICAgIG1jX3ByZV9zY3JvbGxfY2xlYW4gKHcsIHJ1biwgc3Rh cnRfdnBvcywgbnJvd3Nfc2Nyb2xsZWQsIFRSWV9XSU5ET1dfUkVVU0lOR19DVVJSRU5UX01BVFJJ WF9ET1dOKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgICAgIEZSQU1FX1JJ RiAoZiktPnNjcm9sbF9ydW5faG9vayAodywgJnJ1bik7CiAJICAgICAgRlJBTUVfUklGIChmKS0+ dXBkYXRlX3dpbmRvd19lbmRfaG9vayAodywgZmFsc2UsIGZhbHNlKTsKIAkgICAgICB1cGRhdGVf ZW5kIChmKTsKQEAgLTE4MTczLDYgKzIyNzkyLDcgQEAgdHJ5X3dpbmRvd19yZXVzaW5nX2N1cnJl bnRfbWF0cml4IChzdHJ1Y3Qgd2luZG93ICp3KQogCX0KIAogICAgICAgLyogU2Nyb2xsIHRoZSBk aXNwbGF5LiAgKi8KKwogICAgICAgcnVuLmN1cnJlbnRfeSA9IGZpcnN0X3JldXNhYmxlX3Jvdy0+ eTsKICAgICAgIHJ1bi5kZXNpcmVkX3kgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsK ICAgICAgIHJ1bi5oZWlnaHQgPSBpdC5sYXN0X3Zpc2libGVfeSAtIHJ1bi5jdXJyZW50X3k7CkBA IC0xODE4Myw2ICsyMjgwMywxNiBAQCB0cnlfd2luZG93X3JldXNpbmdfY3VycmVudF9tYXRyaXgg KHN0cnVjdCB3aW5kb3cgKncpCiAJICB1cGRhdGVfYmVnaW4gKGYpOwogCSAgRlJBTUVfUklGIChm KS0+dXBkYXRlX3dpbmRvd19iZWdpbl9ob29rICh3KTsKIAkgIEZSQU1FX1JJRiAoZiktPmNsZWFy X3dpbmRvd19tb3VzZV9mYWNlICh3KTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIG1jX3ByZV9zY3JvbGxfY2xlYW4gKHcsIHJ1biwg c3RhcnRfdnBvcywgbnJvd3Nfc2Nyb2xsZWQsIFRSWV9XSU5ET1dfUkVVU0lOR19DVVJSRU5UX01B VFJJWF9VUCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgIEZSQU1FX1JJRiAo ZiktPnNjcm9sbF9ydW5faG9vayAodywgJnJ1bik7CiAJICBGUkFNRV9SSUYgKGYpLT51cGRhdGVf d2luZG93X2VuZF9ob29rICh3LCBmYWxzZSwgZmFsc2UpOwogCSAgdXBkYXRlX2VuZCAoZik7CkBA IC0xOTEyNyw2ICsyMzc1Nyw3IEBAIHRyeV93aW5kb3dfaWQgKHN0cnVjdCB3aW5kb3cgKncpCiAg IC8qIFNjcm9sbCB0aGUgZGlzcGxheS4gIERvIGl0IGJlZm9yZSBjaGFuZ2luZyB0aGUgY3VycmVu dCBtYXRyaXggc28KICAgICAgdGhhdCB4dGVybS5jIGRvZXNuJ3QgZ2V0IGNvbmZ1c2VkIGFib3V0 IHdoZXJlIHRoZSBjdXJzb3IgZ2x5cGggaXMKICAgICAgZm91bmQuICAqLworCiAgIGlmIChkeSAm JiBydW4uaGVpZ2h0KQogICAgIHsKICAgICAgIHVwZGF0ZV9iZWdpbiAoZik7CkBAIC0xOTEzNSw2 ICsyMzc2NiwxNiBAQCB0cnlfd2luZG93X2lkIChzdHJ1Y3Qgd2luZG93ICp3KQogCXsKIAkgIEZS QU1FX1JJRiAoZiktPnVwZGF0ZV93aW5kb3dfYmVnaW5faG9vayAodyk7CiAJICBGUkFNRV9SSUYg KGYpLT5jbGVhcl93aW5kb3dfbW91c2VfZmFjZSAodyk7CisKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICBtY19wcmVfc2Nyb2xsX2NsZWFu ICh3LCBydW4sIGZpcnN0X3VuY2hhbmdlZF9hdF9lbmRfdnBvcywgZHZwb3MsIFRSWV9XSU5ET1df SUQpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICBGUkFNRV9SSUYgKGYpLT5z Y3JvbGxfcnVuX2hvb2sgKHcsICZydW4pOwogCSAgRlJBTUVfUklGIChmKS0+dXBkYXRlX3dpbmRv d19lbmRfaG9vayAodywgZmFsc2UsIGZhbHNlKTsKIAl9CkBAIC0yMDEzMyw2ICsyNDc3NCwxNyBA QCBhcHBlbmRfc3BhY2VfZm9yX25ld2xpbmUgKHN0cnVjdCBpdCAqaXQsIGJvb2wgZGVmYXVsdF9m YWNlX3ApCiAJICBtZW1zZXQgKCZpdC0+cG9zaXRpb24sIDAsIHNpemVvZiBpdC0+cG9zaXRpb24p OwogCSAgaXQtPm9iamVjdCA9IFFuaWw7CiAJICBpdC0+YyA9IGl0LT5jaGFyX3RvX2Rpc3BsYXkg PSAnICc7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JT ICovCisKKyAgICAgIGlmIChJVF9CWVRFUE9TICgqaXQpID49IFpWX0JZVEUpCisgICAgICAgIGl0 LT56dl9wID0gdHJ1ZTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgaXQtPmxl biA9IDE7CiAKIAkgIC8qIElmIHRoZSBkZWZhdWx0IGZhY2Ugd2FzIHJlbWFwcGVkLCBiZSBzdXJl IHRvIHVzZSB0aGUKQEAgLTIxMjY5LDkgKzI1OTIxLDIyIEBAIG1heWJlX3Byb2R1Y2VfbGluZV9u dW1iZXIgKHN0cnVjdCBpdCAqaXQpCiAgICAgICBlbHNlCiAJdGVtX2l0LmMgPSB0ZW1faXQuY2hh cl90b19kaXNwbGF5ID0gKnA7CiAgICAgICB0ZW1faXQubGVuID0gMTsKKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgaWYgKGJleW9u ZF96dikKKyAgICAgICAgdGVtX2l0Lnp2X3AgPSB0cnVlOworICAgICAgdGVtX2l0LmN1cnJlbnRf eSA9IGl0LT5jdXJyZW50X3k7CisgICAgICB0ZW1faXQudnBvcyA9IGl0LT52cG9zOwogICAgICAg LyogTWFrZSBzdXJlIHRoZXNlIGdseXBocyB3aWxsIGhhdmUgYSAicG9zaXRpb24iIG9mIC0xLiAg Ki8KICAgICAgIFNFVF9URVhUX1BPUyAodGVtX2l0LnBvc2l0aW9uLCAtMSwgLTEpOwogICAgICAg UFJPRFVDRV9HTFlQSFMgKCZ0ZW1faXQpOworICAgICAgdGVtX2l0Lmhwb3MgKz0gMTsKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKIAogICAgICAgLyogU3RvcCBwcm9kdWNpbmcgZ2x5cGhz LCBhbmQgcmVmcmFpbiBmcm9tIHByb2R1Y2luZyB0aGUgbGluZQogCSBudW1iZXIsIGlmIHdlIGRv bid0IGhhdmUgZW5vdWdoIHNwYWNlIG9uIHRoaXMgbGluZS4gICovCkBAIC0yMTI4NCw2ICsyNTk0 OSwzMCBAQCBtYXliZV9wcm9kdWNlX2xpbmVfbnVtYmVyIChzdHJ1Y3QgaXQgKml0KQogCX0KICAg ICB9CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKyAgTGlzcF9PYmplY3QgYnVmID0gaXQtPnctPmNvbnRlbnRzOworICBDSEVDS19CVUZGRVIg KGJ1Zik7CisgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSIChidWYpOworICBzdHJ1Y3QgYnVm ZmVyICpvbGRfYnVmZmVyID0gTlVMTDsKKyAgLyogTmVlZGVkIHNvIHRoYXQgYnVmZmVyLWxvY2Fs IHZhbHVlcyBjYW4gYmUgZGV0ZXJtaW5lZDsgZS5nLiwgd2hlbiBzd2l0Y2hpbmcKKyAgdG8gdGhl IG1pbmlidWZmZXIuICovCisgIGlmIChiICE9IGN1cnJlbnRfYnVmZmVyKQorICAgIHsKKyAgICAg IG9sZF9idWZmZXIgPSBjdXJyZW50X2J1ZmZlcjsKKyAgICAgIHNldF9idWZmZXJfaW50ZXJuYWwg KGIpOworICAgIH0KKyAgaXQtPnctPm1jLmxudW1fcGl4ZWxfd2lkdGggPSAoIU5JTFAgKFZkaXNw bGF5X2xpbmVfbnVtYmVycykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyB0ZW1f aXQuY3VycmVudF94CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAwOworICBpZiAo b2xkX2J1ZmZlcikKKyAgICBzZXRfYnVmZmVyX2ludGVybmFsIChvbGRfYnVmZmVyKTsKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBSZWNvcmQgdGhlIHdpZHRoIGluIHBpeGVs cyB3ZSBuZWVkIGZvciB0aGUgbGluZSBudW1iZXIgZGlzcGxheS4gICovCiAgIGl0LT5sbnVtX3Bp eGVsX3dpZHRoID0gdGVtX2l0LmN1cnJlbnRfeDsKICAgLyogQ29weSB0aGUgcHJvZHVjZWQgZ2x5 cGhzIGludG8gSVQncyBnbHlwaF9yb3cuICAqLwpAQCAtMjcwOTIsNiArMzE3ODEsMjEgQEAgYXBw ZW5kX2dseXBoIChzdHJ1Y3QgaXQgKml0KQogCSAgICBnWzFdID0gKmc7CiAJICBnbHlwaCA9IGl0 LT5nbHlwaF9yb3ctPmdseXBoc1thcmVhXTsKIAl9CisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGdseXBoLT54ID0gaXQtPmN1cnJl bnRfeDsKKyAgICAgIGdseXBoLT55ID0gaXQtPmN1cnJlbnRfeTsKKyAgICAgIGdseXBoLT5ocG9z ID0gaXQtPmhwb3M7CisgICAgICBnbHlwaC0+dnBvcyA9IGl0LT52cG9zOworICAgICAgZ2x5cGgt Pnp2X3AgPSBpdC0+enZfcDsKKyAgICAgIGdseXBoLT5ieXRlcG9zID0gSVRfQllURVBPUyAoKml0 KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgZ2x5cGgtPmNoYXJwb3Mg PSBDSEFSUE9TIChpdC0+cG9zaXRpb24pOwogICAgICAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmpl Y3Q7CiAgICAgICBpZiAoaXQtPnBpeGVsX3dpZHRoID4gMCkKQEAgLTI3MTc1LDYgKzMxODc5LDIx IEBAIGFwcGVuZF9jb21wb3NpdGVfZ2x5cGggKHN0cnVjdCBpdCAqaXQpCiAJICAgIGdbMV0gPSAq ZzsKIAkgIGdseXBoID0gaXQtPmdseXBoX3Jvdy0+Z2x5cGhzW2l0LT5hcmVhXTsKIAl9CisKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAg IGdseXBoLT54ID0gaXQtPmN1cnJlbnRfeDsKKyAgICAgIGdseXBoLT55ID0gaXQtPmN1cnJlbnRf eTsKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBnbHlwaC0+dnBvcyA9IGl0 LT52cG9zOworICAgICAgZ2x5cGgtPnp2X3AgPSBpdC0+enZfcDsKKyAgICAgIGdseXBoLT5ieXRl cG9zID0gSVRfQllURVBPUyAoKml0KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog ICAgICAgZ2x5cGgtPmNoYXJwb3MgPSBpdC0+Y21wX2l0LmNoYXJwb3M7CiAgICAgICBnbHlwaC0+ b2JqZWN0ID0gaXQtPm9iamVjdDsKICAgICAgIGVhc3NlcnQgKGl0LT5waXhlbF93aWR0aCA8PSBT SFJUX01BWCk7CkBAIC0yNzM4Myw2ICszMjEwMiwyMSBAQCBwcm9kdWNlX2ltYWdlX2dseXBoIChz dHJ1Y3QgaXQgKml0KQogCX0KICAgICAgIGlmIChnbHlwaCA8IGl0LT5nbHlwaF9yb3ctPmdseXBo c1thcmVhICsgMV0pCiAJeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQ TEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+eCA9IGl0LT5jdXJyZW50X3g7CisgICAgICBn bHlwaC0+eSA9IGl0LT5jdXJyZW50X3k7CisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOwor ICAgICAgZ2x5cGgtPnZwb3MgPSBpdC0+dnBvczsKKyAgICAgIGdseXBoLT56dl9wID0gaXQtPnp2 X3A7CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9IElUX0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKIAkgIGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBv c2l0aW9uKTsKIAkgIGdseXBoLT5vYmplY3QgPSBpdC0+b2JqZWN0OwogCSAgZ2x5cGgtPnBpeGVs X3dpZHRoID0gY2xpcF90b19ib3VuZHMgKC0xLCBpdC0+cGl4ZWxfd2lkdGgsIFNIUlRfTUFYKTsK QEAgLTI3NDg2LDYgKzMyMjIwLDIxIEBAIHByb2R1Y2VfeHdpZGdldF9nbHlwaCAoc3RydWN0IGl0 ICppdCkKIAl9CiAgICAgICBpZiAoZ2x5cGggPCBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJlYSAr IDFdKQogCXsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNP UlMgKi8KKworICAgICAgZ2x5cGgtPnggPSBpdC0+Y3VycmVudF94OworICAgICAgZ2x5cGgtPnkg PSBpdC0+Y3VycmVudF95OworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGds eXBoLT52cG9zID0gaXQtPnZwb3M7CisgICAgICBnbHlwaC0+enZfcCA9IGl0LT56dl9wOworICAg ICAgZ2x5cGgtPmJ5dGVwb3MgPSBJVF9CWVRFUE9TICgqaXQpOworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKworCiAJICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7 CiAJICBnbHlwaC0+b2JqZWN0ID0gaXQtPm9iamVjdDsKIAkgIGdseXBoLT5waXhlbF93aWR0aCA9 IGNsaXBfdG9fYm91bmRzICgtMSwgaXQtPnBpeGVsX3dpZHRoLCBTSFJUX01BWCk7CkBAIC0yNzU3 Miw2ICszMjMyMSwyMSBAQCBhcHBlbmRfc3RyZXRjaF9nbHlwaCAoc3RydWN0IGl0ICppdCwgTGlz cF9PYmplY3Qgb2JqZWN0LAogCSAgICB3aWR0aCAtPSBpdC0+Zmlyc3RfdmlzaWJsZV94IC0gaXQt PmN1cnJlbnRfeDsKIAkgIGVhc3NlcnQgKHdpZHRoID4gMCk7CiAJfQorCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+eCA9 IGl0LT5jdXJyZW50X3g7CisgICAgICBnbHlwaC0+eSA9IGl0LT5jdXJyZW50X3k7CisgICAgICBn bHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPnZwb3MgPSBpdC0+dnBvczsKKyAg ICAgIGdseXBoLT56dl9wID0gaXQtPnp2X3A7CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9IElUX0JZ VEVQT1MgKCppdCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIGdseXBo LT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5vYmplY3Qg PSBvYmplY3Q7CiAgICAgICAvKiBGSVhNRTogSXQgd291bGQgYmUgYmV0dGVyIHRvIHVzZSBUWVBF X01BWCBoZXJlLCBidXQKQEAgLTI4MDI2LDYgKzMyNzkwLDIxIEBAIGFwcGVuZF9nbHlwaGxlc3Nf Z2x5cGggKHN0cnVjdCBpdCAqaXQsIGludCBmYWNlX2lkLCBib29sIGZvcl9ub19mb250LCBpbnQg bGVuLAogCSAgICBnWzFdID0gKmc7CiAJICBnbHlwaCA9IGl0LT5nbHlwaF9yb3ctPmdseXBoc1th cmVhXTsKIAl9CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJT T1JTICovCisKKyAgICAgIGdseXBoLT54ID0gaXQtPmN1cnJlbnRfeDsKKyAgICAgIGdseXBoLT55 ID0gaXQtPmN1cnJlbnRfeTsKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBn bHlwaC0+dnBvcyA9IGl0LT52cG9zOworICAgICAgZ2x5cGgtPnp2X3AgPSBpdC0+enZfcDsKKyAg ICAgIGdseXBoLT5ieXRlcG9zID0gSVRfQllURVBPUyAoKml0KTsKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogICAgICAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9zaXRp b24pOwogICAgICAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAgICAgICBlYXNzZXJ0IChp dC0+cGl4ZWxfd2lkdGggPD0gU0hSVF9NQVgpOwpAQCAtMjkwNzYsMTAgKzMzODU1LDM1IEBAIHhf aW5zZXJ0X2dseXBocyAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqdXBkYXRl ZF9yb3csCiAKICAgLyogV3JpdGUgdGhlIGdseXBocy4gICovCiAgIGhwb3MgPSBzdGFydCAtIHJv dy0+Z2x5cGhzW3VwZGF0ZWRfYXJlYV07CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisv KiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgaWYgKCh3LT5tY19tYXRyaXguY3Vyc29yc191c2Vk W01DX0NBQ0hFXSA+IDAKKyAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0NIX0NB Q0hFXSA+IDAKKyAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0ZDX0NBQ0hFXSA+ IDApCisgICAgICAmJiB1cGRhdGVkX2FyZWEgPT0gVEVYVF9BUkVBKQorICAgIHsKKyAgICAgIHN0 cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworICAgICAgaW50 IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgICAgIGludCBzdGFydF94 ID0gdy0+b3V0cHV0X2N1cnNvci54OworICAgICAgaW50IHN0YXJ0X2hwb3MgPSBocG9zOworICAg ICAgaW50IGVuZF9ocG9zID0gaHBvcyArIGxlbjsKKyAgICAgIGJvb2wgY2xlYXJfZW9sX3AgPSBm YWxzZTsKKyAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBobCA9IERSQVdfTk9STUFMX1RFWFQ7 CisgICAgICBUUkFDRSAoKHN0ZGVyciwgInhfaW5zZXJ0X2dseXBocyAoJWQpOiAgc3RhcnRfeCAo JWQpIHwgc3RhcnRfaHBvcyAoJWQpIHwgZW5kX2hwb3MgKCVkKVxuIiwKKyAgICAgICAgICAgICAg ICAgICAgICB2cG9zLCBzdGFydF94LCBzdGFydF9ocG9zLCBlbmRfaHBvcykpOworICAgICAgbWNf cmVkcmF3X3JvdyAodywgbWF0cml4LCByb3csIHN0YXJ0X3gsIHN0YXJ0X2hwb3MsIGVuZF9ocG9z LCBjbGVhcl9lb2xfcCwgaGwpOworICAgIH0KKyAgICBlbHNlCiAgIGRyYXdfZ2x5cGhzICh3LCB3 LT5vdXRwdXRfY3Vyc29yLngsIHJvdywgdXBkYXRlZF9hcmVhLAogCSAgICAgICBocG9zLCBocG9z ICsgbGVuLAogCSAgICAgICBEUkFXX05PUk1BTF9URVhULCAwKTsKIAorLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogICAvKiBBZHZhbmNlIHRoZSBvdXRwdXQgY3Vyc29yLiAgKi8KICAgdy0+ b3V0cHV0X2N1cnNvci5ocG9zICs9IGxlbjsKICAgdy0+b3V0cHV0X2N1cnNvci54ICs9IHNoaWZ0 X2J5X3dpZHRoOwpAQCAtMjk1MDUsOSArMzQzMDksMzMgQEAgeF9maXhfb3ZlcmxhcHBpbmdfYXJl YSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqcm93LAogCSAgd2hpbGUgKGkg PCByb3ctPnVzZWRbYXJlYV0KIAkJICYmIHJvdy0+Z2x5cGhzW2FyZWFdW2ldLm92ZXJsYXBzX3Zl cnRpY2FsbHlfcCk7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1D VVJTT1JTICovCisKKyAgICAgICAgaWYgKCh3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW01DX0NB Q0hFXSA+IDAKKyAgICAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0NIX0NB Q0hFXSA+IDAKKyAgICAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0ZDX0NB Q0hFXSA+IDApCisgICAgICAgICAgICAmJiBhcmVhID09IFRFWFRfQVJFQSkKKyAgICAgICAgICB7 CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXggPSB3LT5jdXJyZW50X21h dHJpeDsKKyAgICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJp eCk7CisgICAgICAgICAgICBpbnQgc3RhcnRfaHBvcyA9IHN0YXJ0OworICAgICAgICAgICAgaW50 IGVuZF9ocG9zID0gaTsKKyAgICAgICAgICAgIGJvb2wgY2xlYXJfZW9sX3AgPSBmYWxzZTsKKyAg ICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBobCA9IERSQVdfTk9STUFMX1RFWFQ7Cisg ICAgICAgICAgICBUUkFDRSAoKHN0ZGVyciwgInhfZml4X292ZXJsYXBwaW5nX2FyZWEgKCVkKTog IHN0YXJ0X3ggKCVkKSB8IHN0YXJ0X2hwb3MgKCVkKSB8IGVuZF9ocG9zICglZClcbiIsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgdnBvcywgc3RhcnRfeCwgc3RhcnRfaHBvcywgZW5kX2hw b3MpKTsKKyAgICAgICAgICAgIG1jX3JlZHJhd19yb3cgKHcsIG1hdHJpeCwgcm93LCBzdGFydF94 LCBzdGFydF9ocG9zLCBlbmRfaHBvcywgY2xlYXJfZW9sX3AsIGhsKTsKKyAgICAgICAgICB9Cisg ICAgICAgICAgZWxzZQogCSAgZHJhd19nbHlwaHMgKHcsIHN0YXJ0X3gsIHJvdywgYXJlYSwKIAkJ ICAgICAgIHN0YXJ0LCBpLAogCQkgICAgICAgRFJBV19OT1JNQUxfVEVYVCwgb3ZlcmxhcHMpOwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJfQogICAgICAgZWxzZQogCXsKQEAgLTI5 NzU4LDEwICszNDU4NiwxNyBAQCBkaXNwbGF5X2FuZF9zZXRfY3Vyc29yIChzdHJ1Y3Qgd2luZG93 ICp3LCBib29sIG9uLAogICBuZXdfY3Vyc29yX3R5cGUgPSBnZXRfd2luZG93X2N1cnNvcl90eXBl ICh3LCBnbHlwaCwKIAkJCQkJICAgICZuZXdfY3Vyc29yX3dpZHRoLCAmYWN0aXZlX2N1cnNvcik7 CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK ICAgLyogSWYgY3Vyc29yIGlzIGN1cnJlbnRseSBiZWluZyBzaG93biBhbmQgd2UgZ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GhlIGN1cnNvcgpAQCAtMjk3OTIsOSArMzQ2MzAsMTkg QEAgZGlzcGxheV9hbmRfc2V0X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBvbiwKICAg ICAgIHctPnBoeXNfY3Vyc29yLnZwb3MgPSB2cG9zOwogICAgIH0KIAotICBGUkFNRV9SSUYgKGYp LT5kcmF3X3dpbmRvd19jdXJzb3IgKHcsIGdseXBoX3JvdywgeCwgeSwKLSAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBuZXdfY3Vyc29yX3R5cGUsIG5ld19jdXJzb3Jfd2lkdGgs Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb24sIGFjdGl2ZV9jdXJzb3Ip OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwor ICBpZiAoTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAg ICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpCisg ICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkKKyAg ICBGUkFNRV9SSUYgKGYpLT5kcmF3X3dpbmRvd19jdXJzb3IgKHcsIGdseXBoX3JvdywgeCwgeSwg bmV3X2N1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg bmV3X2N1cnNvcl93aWR0aCwgb24sIGFjdGl2ZV9jdXJzb3IpOworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKworCiB9CiAKIApAQCAtMjk4ODcsNyArMzQ3MzUsMjkgQEAgZHJhd19yb3dfd2l0 aF9tb3VzZV9mYWNlIChzdHJ1Y3Qgd2luZG93ICp3LCBpbnQgc3RhcnRfeCwgc3RydWN0IGdseXBo X3JvdyAqcm93LAogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQogICBpZiAoRlJBTUVfV0lORE9X X1AgKFhGUkFNRSAody0+ZnJhbWUpKSkKICAgICB7CisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGlmICh3LT5tY19tYXRyaXguY3Vy c29yc191c2VkW01DX0NBQ0hFXSA+IDAKKyAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29y c191c2VkW0NIX0NBQ0hFXSA+IDAKKyAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191 c2VkW0ZDX0NBQ0hFXSA+IDApCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfbWF0 cml4ICptYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAgICAgICAgICBpbnQgdnBvcyA9IE1B VFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAgICAgICAgIGJvb2wgY2xlYXJfZW9sX3Ag PSBmYWxzZTsKKyAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UgaGwgPSBkcmF3OworICAg ICAgICAgIFRSQUNFICgoc3RkZXJyLCAiZHJhd19yb3dfd2l0aF9tb3VzZV9mYWNlICglZCk6ICBz dGFydF94ICglZCkgfCBzdGFydF9ocG9zICglZCkgfCBlbmRfaHBvcyAoJWQpXG4iLAorICAgICAg ICAgICAgICAgICAgICAgICAgICB2cG9zLCBzdGFydF94LCBzdGFydF9ocG9zLCBlbmRfaHBvcykp OworICAgICAgICAgIG1jX3JlZHJhd19yb3cgKHcsIG1hdHJpeCwgcm93LCBzdGFydF94LCBzdGFy dF9ocG9zLCBlbmRfaHBvcywgY2xlYXJfZW9sX3AsIGhsKTsKKyAgICAgICAgfQorICAgICAgICBl bHNlCiAgICAgICBkcmF3X2dseXBocyAodywgc3RhcnRfeCwgcm93LCBURVhUX0FSRUEsIHN0YXJ0 X2hwb3MsIGVuZF9ocG9zLCBkcmF3LCAwKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisK KwogICAgICAgcmV0dXJuOwogICAgIH0KICNlbmRpZgpAQCAtMzE5NDUsMTEgKzM2ODE1LDM2IEBA IGV4cG9zZV9hcmVhIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIFhS ZWN0YW5nbGUgKnIsCiAgIHN0cnVjdCBnbHlwaCAqbGFzdDsKICAgaW50IGZpcnN0X3gsIHN0YXJ0 X3gsIHg7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JT ICovCisKICAgaWYgKGFyZWEgPT0gVEVYVF9BUkVBICYmIHJvdy0+ZmlsbF9saW5lX3ApCisgICAg eworICAgICAgaWYgKHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbTUNfQ0FDSEVdID4gMAorICAg ICAgICAgIHx8IHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbQ0hfQ0FDSEVdID4gMAorICAgICAg ICAgIHx8IHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbRkNfQ0FDSEVdID4gMCkKKyAgICAgICAg eworICAgICAgICAgIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0 cml4OworICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7 CisgICAgICAgICAgaW50IHN0YXJ0X3ggPSAwOworICAgICAgICAgIGludCBzdGFydF9ocG9zID0g MDsKKyAgICAgICAgICBpbnQgZW5kX2hwb3MgPSByb3ctPnVzZWRbVEVYVF9BUkVBXTsKKyAgICAg ICAgICBib29sIGNsZWFyX2VvbF9wID0gZmFsc2U7CisgICAgICAgICAgZW51bSBkcmF3X2dseXBo c19mYWNlIGhsID0gRFJBV19OT1JNQUxfVEVYVDsKKyAgICAgICAgICBUUkFDRSAoKHN0ZGVyciwg ImV4cG9zZV9hcmVhICglZCk6ICBXcml0ZSB0aGUgd2hvbGUgbGluZS5cbiIsIHZwb3MpKTsKKyAg ICAgICAgICBtY19yZWRyYXdfcm93ICh3LCBtYXRyaXgsIHJvdywgc3RhcnRfeCwgc3RhcnRfaHBv cywgZW5kX2hwb3MsIGNsZWFyX2VvbF9wLCBobCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQog ICAgIC8qIElmIHJvdyBleHRlbmRzIGZhY2UgdG8gZW5kIG9mIGxpbmUgd3JpdGUgdGhlIHdob2xl IGxpbmUuICAqLwogICAgIGRyYXdfZ2x5cGhzICh3LCAwLCByb3csIGFyZWEsCiAJCSAwLCByb3ct PnVzZWRbYXJlYV0sCiAJCSBEUkFXX05PUk1BTF9URVhULCAwKTsKKyAgICB9CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgZWxzZQogICAgIHsKICAgICAgIC8qIFNldCBTVEFSVF9Y IHRvIHRoZSB3aW5kb3ctcmVsYXRpdmUgc3RhcnQgcG9zaXRpb24gZm9yIGRyYXdpbmcgZ2x5cGhz IG9mCkBAIC0zMTk4MSwxMSArMzY4NzYsMzYgQEAgZXhwb3NlX2FyZWEgKHN0cnVjdCB3aW5kb3cg KncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgWFJlY3RhbmdsZSAqciwKIAkgICsrbGFzdDsKIAl9 CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK ICAgICAgIC8qIFJlcGFpbnQuICAqLwotICAgICAgaWYgKGxhc3QgPiBmaXJzdCkKKyAgICAgIC8q IEZsb2F0aW5nIGZha2UgY3Vyc29ycyB3aWxsIGV4aXN0IHdoZW4gKGxhc3QgPT0gZmlyc3QpLiAq LworICAgICAgaWYgKCh3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW01DX0NBQ0hFXSA+IDAKKyAg ICAgICAgICAgfHwgdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtDSF9DQUNIRV0gPiAwCisgICAg ICAgICAgIHx8IHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbRkNfQ0FDSEVdID4gMCkKKyAgICAg ICAgICAmJiBhcmVhID09IFRFWFRfQVJFQSkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBn bHlwaF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworICAgICAgICAgIGludCB2 cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgICAgICAgICAgc3RhcnRfeCA9 IGZpcnN0X3ggLSBzdGFydF94OworICAgICAgICAgIGludCBzdGFydF9ocG9zID0gZmlyc3QgLSBy b3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgIGludCBlbmRfaHBvcyA9IGxhc3QgLSBy b3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgIGJvb2wgY2xlYXJfZW9sX3AgPSBmYWxz ZTsKKyAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UgaGwgPSBEUkFXX05PUk1BTF9URVhU OworICAgICAgICAgIFRSQUNFICgoc3RkZXJyLCAiZXhwb3NlX2FyZWEgKCVkKTogIHN0YXJ0X3gg KCVkKSB8IHN0YXJ0X2hwb3MgKCVkKSB8IGVuZF9ocG9zICglZClcbiIsCisgICAgICAgICAgICAg ICAgICAgICAgICAgIHZwb3MsIHN0YXJ0X3gsIHN0YXJ0X2hwb3MsIGVuZF9ocG9zKSk7CisgICAg ICAgICAgbWNfcmVkcmF3X3JvdyAodywgbWF0cml4LCByb3csIHN0YXJ0X3gsIHN0YXJ0X2hwb3Ms IGVuZF9ocG9zLCBjbGVhcl9lb2xfcCwgaGwpOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYg KGxhc3QgPiBmaXJzdCkKIAlkcmF3X2dseXBocyAodywgZmlyc3RfeCAtIHN0YXJ0X3gsIHJvdywg YXJlYSwKIAkJICAgICBmaXJzdCAtIHJvdy0+Z2x5cGhzW2FyZWFdLCBsYXN0IC0gcm93LT5nbHlw aHNbYXJlYV0sCiAJCSAgICAgRFJBV19OT1JNQUxfVEVYVCwgMCk7CisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKICAgICB9CiB9CiAKQEAgLTMxOTk5LDEwICszNjkxOSwzNSBAQCBleHBv c2VfbGluZSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqcm93LCBYUmVjdGFu Z2xlICpyKQogewogICBlYXNzZXJ0IChyb3ctPmVuYWJsZWRfcCk7CiAKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgaWYgKHJvdy0+bW9kZV9s aW5lX3AgfHwgdy0+cHNldWRvX3dpbmRvd19wKQorICAgIHsKKyAgICAgIGlmICh3LT5tY19tYXRy aXguY3Vyc29yc191c2VkW01DX0NBQ0hFXSA+IDAKKyAgICAgICAgICB8fCB3LT5tY19tYXRyaXgu Y3Vyc29yc191c2VkW0NIX0NBQ0hFXSA+IDAKKyAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vy c29yc191c2VkW0ZDX0NBQ0hFXSA+IDApCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5 cGhfbWF0cml4ICptYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAgICAgICAgICBpbnQgdnBv cyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAgICAgICAgIGludCBzdGFydF94 ID0gMDsKKyAgICAgICAgICBpbnQgc3RhcnRfaHBvcyA9IDA7CisgICAgICAgICAgaW50IGVuZF9o cG9zID0gcm93LT51c2VkW1RFWFRfQVJFQV07CisgICAgICAgICAgYm9vbCBjbGVhcl9lb2xfcCA9 IGZhbHNlOworICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBobCA9IERSQVdfTk9STUFM X1RFWFQ7CisgICAgICAgICAgVFJBQ0UgKChzdGRlcnIsICJleHBvc2VfbGluZSAoJWQpOiAgV3Jp dGUgdGhlIHdob2xlIGxpbmUuXG4iLCB2cG9zKSk7CisgICAgICAgICAgbWNfcmVkcmF3X3JvdyAo dywgbWF0cml4LCByb3csIHN0YXJ0X3gsIHN0YXJ0X2hwb3MsIGVuZF9ocG9zLCBjbGVhcl9lb2xf cCwgaGwpOworICAgICAgICB9CisgICAgICAgIGVsc2UKICAgICBkcmF3X2dseXBocyAodywgMCwg cm93LCBURVhUX0FSRUEsCiAJCSAwLCByb3ctPnVzZWRbVEVYVF9BUkVBXSwKIAkJIERSQVdfTk9S TUFMX1RFWFQsIDApOworICAgIH0KKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBl bHNlCiAgICAgewogICAgICAgaWYgKHJvdy0+dXNlZFtMRUZUX01BUkdJTl9BUkVBXSkKQEAgLTMy NTUwLDYgKzM3NDk1LDIyIEBAIHhfaW50ZXJzZWN0X3JlY3RhbmdsZXMgKFhSZWN0YW5nbGUgKnIx LCBYUmVjdGFuZ2xlICpyMiwgWFJlY3RhbmdsZSAqcmVzdWx0KQogdm9pZAogc3ltc19vZl94ZGlz cCAodm9pZCkKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKworICBkZWZzdWJyICgmU21jX2R1bXBfZ2x5cGhfcm93KTsKKworICBkZWZzdWJy ICgmU21jX2R1bXBfZ2x5cGhfbWF0cml4KTsKKworICBkZWZzdWJyICgmU21jX2N1cnJlbnRfY29s dW1uKTsKKworICBkZWZzdWJyICgmU21jX3N0ZGVycik7CisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKICAgVndpdGhfZWNob19hcmVhX3NhdmVfdmVjdG9yID0gUW5pbDsKICAgc3RhdGlj cHJvICgmVndpdGhfZWNob19hcmVhX3NhdmVfdmVjdG9yKTsKIApkaWZmIC0tZ2l0IGEvc3JjL3h0 ZXJtLmMgYi9zcmMveHRlcm0uYwppbmRleCA1YWEzZTNmLi45NWI2ZTA2IDEwMDY0NAotLS0gYS9z cmMveHRlcm0uYworKysgYi9zcmMveHRlcm0uYwpAQCAtMTMyLDYgKzEzMiw4NjkgQEAgYWxvbmcg d2l0aCBHTlUgRW1hY3MuICBJZiBub3QsIHNlZSA8aHR0cHM6Ly93d3cuZ251Lm9yZy9saWNlbnNl cy8+LiAgKi8KICNpbmNsdWRlIDxYMTEvWEtCbGliLmg+CiAjZW5kaWYKIAorCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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1FX0RJU1BMQVlfSU5GTyAoZiktPnNjcmF0Y2hfY3Vyc29yX2djID0gZ2M7CisgICAgICAg IH0KKyAgICAgIHhfY2xpcF90b19yb3cgKHcsIHJvdywgVEVYVF9BUkVBLCBnYyk7CisgICAgICB4 X2ZpbGxfcmVjdGFuZ2xlIChmLCBnYywgZngsIGZ5LCB3ZCwgaCk7CisgICAgICB4X3Jlc2V0X2Ns aXBfcmVjdGFuZ2xlcyAoZiwgZ2MpOworICAgIH0KK30KKworLyogUklGOiBEcmF3IGN1cnNvciBv biB3aW5kb3cgVy4gKi8KK3N0YXRpYyB2b2lkCittY194X2RyYXdfd2luZG93X2N1cnNvciAoc3Ry dWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhf cm93ICpyb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHgsIGludCBmeCwgaW50IHks IGludCBmeSwgaW50IGhwb3MsIGludCB2cG9zLCBpbnQgd2QsCisgICAgICAgICAgICAgICAgICAg ICAgICAgaW50IGgsIHN0cnVjdCBtY19SR0IgbHNsLCBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNv cl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGgsIGVudW0g bWNfZmxhdm9yIGdseXBoX2ZsYXZvciwgYm9vbCBvbl9wLAorICAgICAgICAgICAgICAgICAgICAg ICAgIGJvb2wgYWN0aXZlX3ApCit7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAoV0lORE9X X0ZSQU1FICh3KSk7CisgIC8qIFRoZSBmcmluZ2UgYml0bWFwcyBhcmUgcHJlc2VudGx5IGhhbmRs ZWQgZWxzZXdoZXJlLCBidXQgY291bGQgc29tZWRheQorICBiZSBtYW5hZ2VkIChpbiBwYXJ0KSBh dCB0aGlzIHNlY3Rpb24gb2YgY29kZS4gKi8KKyAgaWYgKG9uX3ApCisgICA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2JlZ2lubmluZyAoKSkgOiAtMTsKKyAg ICAgIHB0cmRpZmZfdCByZWdpb25fZW5kID0gKHJlZ2lvbl9hY3RpdmVfcCkgPyBYRklYTlVNIChG cmVnaW9uX2VuZCAoKSkgOiAtMTsKKyAgICAgIHB0cmRpZmZfdCBvcG9pbnRfcHQgPSAodyA9PSBY V0lORE9XIChzZWxlY3RlZF93aW5kb3cpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g UFQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFhGSVhOVU0gKEZtYXJrZXJfcG9zaXRp b24gKHctPnBvaW50bSkpOworICAgICAgYm9vbCByZWdpb25faW5fYm91bmRzX3AgPSAocmVnaW9u X2FjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfcHQg Pj0gcmVnaW9uX2JlZ2lubmluZworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg b3BvaW50X3B0IDwgcmVnaW9uX2VuZCk7CisgICAgICBpZiAoY3Vyc29yX2dseXBoLT50eXBlICE9 IElNQUdFX0dMWVBIICYmIGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wuYmx1 ZSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5v dXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MnIGJ5IGJvcnJvd2luZyB0aGUKKyAgICAgICAgICBmdW5j dGlvbmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHhmbnMuYy4gKi8KKyAgICAgICAgICBpZiAocmVn aW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICYmIHJlZ2lvbl9pbl9ib3VuZHNfcAorICAgICAg ICAgICAgICAmJiBhY3RpdmVfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgZW51bSBm YWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9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9pZCk7CisgICAgICAg ICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRw dXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19pbmFjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kKTsK KyAgICAgICAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiks IGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2luYWN0aXZlX2ZhY2UtPmJhY2tn cm91bmQpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgIGJsb2NrX2lucHV0ICgpOwor ICAgICAgICAgIC8qIEZvcmNlIGBtY194X3NldF9jdXJzb3JfZ2MnIHRvIHVzZSBgcy0+Zi0+b3V0 cHV0X2RhdGEueC0+Y3Vyc29yX2djJy4gKi8KKyAgICAgICAgICBib29sIGN1cnNvcl9nY19wID0g dHJ1ZTsKKyAgICAgICAgICBtY19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERS QVdfQ1VSU09SLCB4LCBocG9zLCB2cG9zLCBsc2wsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29yX2dj X3ApOworICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5v dXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIHhnY3YuZm9yZWdyb3VuZCk7CisgICAgICAgICAgWFNl dEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNv cl9nYywgeGdjdi5iYWNrZ3JvdW5kKTsKKyAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAg ICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3Bp eGVsJy4gKi8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBjb2xv ci5waXhlbDsKKyAgICAgICAgICBtY194X2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCBy b3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgIGYtPm91dHB1 dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAg fQorICAgICAgICBlbHNlIGlmIChjdXJzb3JfZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEggJiYg bHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAg ICAgeworICAgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54 LT5jdXJzb3JfcGl4ZWwnLiAqLworICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29y X3BpeGVsID0gY29sb3IucGl4ZWw7CisgICAgICAgICAgICBtY194X2RyYXdfaG9sbG93X2N1cnNv ciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAg ICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29y X3BpeGVsOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAg ICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29y X2djJyBieSBib3Jyb3dpbmcgdGhlCisgICAgICAgICAgICAgIGZ1bmN0aW9uYWxpdHkgb2YgYHhf bWFrZV9nYycgaW4ge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tPmJhY2tncm91bmQp OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0 aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcmVnaW9uX2luX2JvdW5kc19wCisg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICB7 CisgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9v dXRfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFr ZS1jdXJzb3ItcmVnaW9uLWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIHN0cnVj dCBmYWNlICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9vdXRfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwg aG9sbG93X2FjdGl2ZV9yZWdpb25fb3V0X2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICBl bnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcs IGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1mYWNlIiksIHRydWUpOworICAgICAgICAg ICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lE IChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICBYU2V0Rm9y ZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2dj LCBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgICAgICBY U2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZICh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ZlX3ApCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg ICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVk X2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1mYWNlIiks IHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19pbmFj dGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCk7Cisg ICAgICAgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChm KSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfaW5hY3RpdmVfZmFjZS0+Zm9y ZWdyb3VuZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVf WF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfaW5hY3Rp dmVfZmFjZS0+YmFja2dyb3VuZCk7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgLyogRm9yY2UgYG1jX3hfc2V0X2N1 cnNvcl9nYycgdG8gdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MnLiAqLworICAg ICAgICAgICAgICBib29sIGN1cnNvcl9nY19wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgbWNfZHJh d19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBv cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxzbCwgZ2x5cGhfZmxhdm9y LCBjdXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgY3Vyc29yX2djX3ApOworICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJB TUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCB4Z2N2LmZvcmVn cm91bmQpOworICAgICAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChm KSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCB4Z2N2LmJhY2tncm91bmQpOworICAgICAg ICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgICAgICAgICAvKiBEcmF3IHRoZSBmcmFt ZSBhcm91bmQgdGhlIGJveC4gKi8KKyAgICAgICAgICAgICAgbWNfeF9kcmF3X2hvbGxvd19jdXJz b3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAg ICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0hPTExPV19CT1g6 CisgICAgeworICAgICAgaWYgKGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wu Ymx1ZSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBm LT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwnLiAqLworICAgICAgICAgIGYtPm91dHB1dF9k YXRhLngtPmN1cnNvcl9waXhlbCA9IGNvbG9yLnBpeGVsOworICAgICAgICAgIG1jX3hfZHJhd19o b2xsb3dfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3 ZCwgaCk7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2lu YWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICBtY194 X2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywg dnBvcywgd2QsIGgpOworICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfRklMTEVEX0JP WDoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxz bC5ibHVlID49IDApCisgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2Rh dGEueC0+Y3Vyc29yX2djJyBieSBib3Jyb3dpbmcgdGhlCisgICAgICAgIGZ1bmN0aW9uYWxpdHkg b2YgYHhfbWFrZV9nYycgaW4geGZucy5jLiAqLworICAgICAgICB7CisgICAgICAgICAgYmxvY2tf aW5wdXQgKCk7CisgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiks IGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgRlJBTUVfQkFDS0dST1VORF9QSVhFTCAoZikp OworICAgICAgICAgIFhTZXRCYWNrZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRw dXRfZGF0YS54LT5jdXJzb3JfZ2MsIGNvbG9yLnBpeGVsKTsKKyAgICAgICAgICAvKiBGb3JjZSBg bWNfeF9zZXRfY3Vyc29yX2djJyB0byB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9n YycuICovCisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IHRydWU7CisgICAgICAgICAgbWNf ZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywg dnBvcywgbHNsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaF9mbGF2b3Is IGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICBYU2V0 Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29y X2djLCB4Z2N2LmZvcmVncm91bmQpOworICAgICAgICAgIFhTZXRCYWNrZ3JvdW5kIChGUkFNRV9Y X0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIHhnY3YuYmFja2dyb3Vu ZCk7CisgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgfQorICAgICAgICBlbHNl CisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IGZhbHNlOworICAg ICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNP UiwgeCwgaHBvcywgdnBvcywgbHNsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOwor ICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0JBUjoKKyAgICB7 CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49 IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1 dF9kYXRhLngtPmN1cnNvcl9waXhlbCcuICovCisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+ Y3Vyc29yX3BpeGVsID0gY29sb3IucGl4ZWw7CisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52 aXNpYmxlX29rYXlfcCA9IHRydWU7CisgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcs IG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIE1DX0JBUiwgY3Vyc29yX2djX2lu dmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhl bCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAg ICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IGZh bHNlOworICAgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4 LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGgsIGN1cnNvcl93aWR0aCwgTUNfQkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlf cCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfSEJBUjoK KyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5i bHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYt Pm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCcuICovCisgICAgICAgICAgZi0+b3V0cHV0X2Rh dGEueC0+Y3Vyc29yX3BpeGVsID0gY29sb3IucGl4ZWw7CisgICAgICAgICAgYm9vbCBjdXJzb3Jf Z2NfaW52aXNpYmxlX29rYXlfcCA9IHRydWU7CisgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJz b3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIE1DX0hCQVIsIGN1cnNv cl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJz b3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgIH0KKyAgICAgICAgZWxz ZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5 X3AgPSBmYWxzZTsKKyAgICAgICAgICAgIG1jX3hfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgs IHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0hCQVIsIGN1cnNvcl9nY19pbnZpc2li bGVfb2theV9wKTsKKyAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgZGVmYXVs dDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOworICB9CisgICAgICAgIH0KKyNpZmRlZiBIQVZFX1hf STE4TgorICBpZiAodyA9PSBYV0lORE9XIChmLT5zZWxlY3RlZF93aW5kb3cpKQorICAgIGlmIChG UkFNRV9YSUMgKGYpICYmIChGUkFNRV9YSUNfU1RZTEUgKGYpICYgWElNUHJlZWRpdFBvc2l0aW9u KSkKKyAgICAgIHhpY19zZXRfcHJlZWRpdGFyZWEgKHcsIHgsIHkpOworI2VuZGlmCisgICAgfQor ICBYRmx1c2ggKEZSQU1FX1hfRElTUExBWSAoZikpOworfQorCisvKiBEcmF3IHN0cmV0Y2ggZ2x5 cGggc3RyaW5nIFMuICovCitzdGF0aWMgdm9pZAorbWNfeF9kcmF3X3N0cmV0Y2hfZ2x5cGhfc3Ry aW5nIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzKQoreworICBlYXNzZXJ0IChzLT5maXJzdF9nbHlw aC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKTsKKyAgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SCisg ICAgICAmJiAheF9zdHJldGNoX2N1cnNvcl9wKQorICAgIHsKKyAgICAgIC8qIElmIGB4LXN0cmV0 Y2gtY3Vyc29yJyBpcyBuaWwsIGRvbid0IGRyYXcgYSBibG9jayBjdXJzb3IgYXMgd2lkZSBhcyB0 aGUKKyAgICAgIHN0cmV0Y2ggZ2x5cGguICovCisgICAgICBpbnQgd2lkdGgsIGJhY2tncm91bmRf d2lkdGggPSBzLT5iYWNrZ3JvdW5kX3dpZHRoOworICAgICAgaW50IHggPSBzLT54OworICAgICAg aWYgKCFzLT5yb3ctPnJldmVyc2VkX3ApCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgbGVmdF94 ID0gd2luZG93X2JveF9sZWZ0X29mZnNldCAocy0+dywgVEVYVF9BUkVBKTsKKyAgICAgICAgICBp ZiAoeCA8IGxlZnRfeCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgYmFja2dyb3VuZF93 aWR0aCAtPSBsZWZ0X3ggLSB4OworICAgICAgICAgICAgICB4ID0gbGVmdF94OworICAgICAgICAg ICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICAv KiBJbiBSMkwgcm93cywgZHJhdyB0aGUgY3Vyc29yIG9uIHRoZSByaWdodCBlZGdlIG9mIHRoZQor ICAgICAgICAgICAgICAgc3RyZXRjaCBnbHlwaC4gKi8KKyAgICAgICAgICAgIGludCByaWdodF94 ID0gd2luZG93X2JveF9yaWdodCAocy0+dywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgIGlmICh4 ICsgYmFja2dyb3VuZF93aWR0aCA+IHJpZ2h0X3gpCisgICAgICAgICAgICAgIGJhY2tncm91bmRf d2lkdGggLT0geCAtIHJpZ2h0X3g7CisgICAgICAgICAgICB4ICs9IGJhY2tncm91bmRfd2lkdGg7 CisgICAgICAgICAgfQorICAgICAgd2lkdGggPSBtaW4gKEZSQU1FX0NPTFVNTl9XSURUSCAocy0+ ZiksIGJhY2tncm91bmRfd2lkdGgpOworICAgICAgaWYgKHMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAg ICAgICAgeCAtPSB3aWR0aDsKKyAgICAgIC8qIERyYXcgY3Vyc29yLiAqLworICAgICAgeF9kcmF3 X2dseXBoX3N0cmluZ19iZ19yZWN0IChzLCB4LCBzLT55LCB3aWR0aCwgcy0+aGVpZ2h0KTsKKyAg ICAgIC8qIENsZWFyIHJlc3QgdXNpbmcgdGhlIEdDIG9mIHRoZSBvcmlnaW5hbCBub24tY3Vyc29y IGZhY2UuICovCisgICAgICBpZiAod2lkdGggPCBiYWNrZ3JvdW5kX3dpZHRoKQorICAgICAgICB7 CisgICAgICAgICAgaW50IHkgPSBzLT55OworICAgICAgICAgIGludCB3ID0gYmFja2dyb3VuZF93 aWR0aCAtIHdpZHRoLCBoID0gcy0+aGVpZ2h0OworICAgICAgICAgIFhSZWN0YW5nbGUgcjsKKyAg ICAgICAgICBHQyBnYzsKKyAgICAgICAgICBpZiAoIXMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAgICAg ICAgICAgIHggKz0gd2lkdGg7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeCA9IHMtPng7 CisgICAgICAgICAgaWYgKHMtPnJvdy0+bW91c2VfZmFjZV9wCisgICAgICAgICAgICAgICYmIGN1 cnNvcl9pbl9tb3VzZV9mYWNlX3AgKHMtPncpKQorICAgICAgICAgICAgeworICAgICAgICAgICAg ICB4X3NldF9tb3VzZV9mYWNlX2djIChzKTsKKyAgICAgICAgICAgICAgZ2MgPSBzLT5nYzsKKyAg ICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICBnYyA9IHMtPmZhY2UtPmdj OworICAgICAgICAgIGdldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCAmcik7CisgICAgICAg ICAgeF9zZXRfY2xpcF9yZWN0YW5nbGVzIChzLT5mLCBnYywgJnIsIDEpOworICAgICAgICAgIGlm IChzLT5mYWNlLT5zdGlwcGxlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBGaWxs IGJhY2tncm91bmQgd2l0aCBhIHN0aXBwbGUgcGF0dGVybi4gKi8KKyAgICAgICAgICAgICAgWFNl dEZpbGxTdHlsZSAocy0+ZGlzcGxheSwgZ2MsIEZpbGxPcGFxdWVTdGlwcGxlZCk7CisgICAgICAg ICAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIGdjLCB4LCB5LCB3LCBoKTsKKyAgICAgICAg ICAgICAgWFNldEZpbGxTdHlsZSAocy0+ZGlzcGxheSwgZ2MsIEZpbGxTb2xpZCk7CisgICAgICAg ICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBYR0NW YWx1ZXMgeGdjdjsKKyAgICAgICAgICAgICAgWEdldEdDVmFsdWVzIChzLT5kaXNwbGF5LCBnYywg R0NGb3JlZ3JvdW5kIHwgR0NCYWNrZ3JvdW5kLCAmeGdjdik7CisgICAgICAgICAgICAgIFhTZXRG b3JlZ3JvdW5kIChzLT5kaXNwbGF5LCBnYywgeGdjdi5iYWNrZ3JvdW5kKTsKKyAgICAgICAgICAg ICAgeF9maWxsX3JlY3RhbmdsZSAocy0+ZiwgZ2MsIHgsIHksIHcsIGgpOworICAgICAgICAgICAg ICBYU2V0Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwgZ2MsIHhnY3YuZm9yZWdyb3VuZCk7CisgICAg ICAgICAgICB9CisgICAgICAgICAgeF9yZXNldF9jbGlwX3JlY3RhbmdsZXMgKHMtPmYsIGdjKTsK KyAgICAgICAgfQorICAgIH0KKyAgZWxzZSBpZiAoIXMtPmJhY2tncm91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RyYXdfc3RyZXRjaF9nbHlw aF9zdHJpbmcgKG5leHQpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICB4X2RyYXdf Z2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKG5leHQsIHRydWUpOworICAgICAgICAgICAgbmV4dC0+ bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICB9CisgICAgfQorICAvKiBTZXQgdXAgUy0+Z2MsIHNl dCBjbGlwcGluZyBhbmQgZHJhdyBTLiAqLworICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKHMs IGN1cnNvcl9nY19wKTsKKyAgLyogRHJhdyByZWxpZWYgKGlmIGFueSkgaW4gYWR2YW5jZSBmb3Ig Y2hhci9jb21wb3NpdGlvbiBzbyB0aGF0IHRoZQorICAgICBnbHlwaCBzdHJpbmcgY2FuIGJlIGRy YXduIG92ZXIgaXQuICovCisgIGlmICghcy0+Zm9yX292ZXJsYXBzCisgICAgICAmJiBzLT5mYWNl LT5ib3ggIT0gRkFDRV9OT19CT1gKKyAgICAgICYmIChzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBD SEFSX0dMWVBICisgICAgICAgICAgfHwgcy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRF X0dMWVBIKSkKKyAgICB7CisgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmcgKHMpOwor ICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19iYWNrZ3JvdW5kIChzLCB0cnVlKTsKKyAgICAgIHhf ZHJhd19nbHlwaF9zdHJpbmdfYm94IChzKTsKKyAgICAgIHhfc2V0X2dseXBoX3N0cmluZ19jbGlw cGluZyAocyk7CisgICAgICByZWxpZWZfZHJhd25fcCA9IHRydWU7CisgICAgfQorICAgIGVsc2Ug aWYgKCFzLT5jbGlwX2hlYWQgLyogZHJhd19nbHlwaHMgZGlkbid0IHNwZWNpZnkgYSBjbGlwIG1h c2suICovCisgICAgICAgICAgICAgJiYgI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AgZWxzZQorICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKHMsIGZhbHNl KTsKKyAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAgICBicmVh azsKKyAgICBjYXNlIENPTVBPU0lURV9HTFlQSDoKKyAgICAgIGlmIChzLT5mb3Jfb3ZlcmxhcHMg fHwgKHMtPmNtcF9mcm9tID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgISBz LT5maXJzdF9nbHlwaC0+dS5jbXAuYXV0b21hdGljKSkKKyAgICAgICAgcy0+YmFja2dyb3VuZF9m aWxsZWRfcCA9IHRydWU7CisgICAgICBlbHNlCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdf YmFja2dyb3VuZCAocywgdHJ1ZSk7CisgICAgICB4X2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmlu Z19mb3JlZ3JvdW5kIChzKTsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgR0xZUEhMRVNTX0dMWVBI OgorICAgICAgaWYgKHMtPmZvcl9vdmVybGFwcykKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxs ZWRfcCA9IHRydWU7CisgICAgICBlbHNlCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFj a2dyb3VuZCAocywgdHJ1ZSk7CisgICAgICB4X2RyYXdfZ2x5cGhsZXNzX2dseXBoX3N0cmluZ19m b3JlZ3JvdW5kIChzKTsKKyAgICAgIGJyZWFrOworICAgIGRlZmF1bHQ6CisgICAgICBlbWFjc19h Ym9ydCAoKTsKKyAgICB9CisgIGlmICghcy0+Zm9yX292ZXJsYXBzKQorICAgIHsKKyAgICAgIC8q IERyYXcgdW5kZXJsaW5lLiAqLworICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9wKQorICAg ICAgICB7CisgICAgICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5E RVJfV0FWRSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKHMtPmZhY2UtPnVuZGVy bGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICB4X2RyYXdfdW5kZXJ3YXZlIChzKTsK KyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAg IFhHQ1ZhbHVlcyB4Z2N2OworICAgICAgICAgICAgICAgICAgWEdldEdDVmFsdWVzIChzLT5kaXNw bGF5LCBzLT5nYywgR0NGb3JlZ3JvdW5kLCAmeGdjdik7CisgICAgICAgICAgICAgICAgICBYU2V0 Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwgcy0+Z2MsIHMtPmZhY2UtPnVuZGVybGluZV9jb2xvcik7 CisgICAgICAgICAgICAgICAgICB4X2RyYXdfdW5kZXJ3YXZlIChzKTsKKyAgICAgICAgICAgICAg ICAgIFhTZXRGb3JlZ3JvdW5kIChzLT5kaXNwbGF5LCBzLT5nYywgeGdjdi5mb3JlZ3JvdW5kKTsK KyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxzZSBpZiAocy0+ ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIHRoaWNrbmVzcywgcG9zaXRpb247CisgICAgICAg ICAgICAgIGludCB5OworICAgICAgICAgICAgICBpZiAocy0+cHJldiAmJiBzLT5wcmV2LT5mYWNl LT51bmRlcmxpbmVfcAorICAgICAgICAgICAgICAgICAgJiYgcy0+cHJldi0+ZmFjZS0+dW5kZXJs aW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAgIC8qIFdlIHVzZSB0aGUgc2FtZSB1bmRlcmxpbmUgc3R5bGUgYXMgdGhlIHByZXZp b3VzIG9uZS4gKi8KKyAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPnByZXYtPnVuZGVy bGluZV90aGlja25lc3M7CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPnByZXYtPnVu ZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVybGlu ZSB0aGlja25lc3MuICBEZWZhdWx0IGlzIDEgcGl4ZWwuICovCisgICAgICAgICAgICAgICAgICBp ZiAocy0+Zm9udCAmJiBzLT5mb250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4gMCkKKyAgICAgICAg ICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAg ICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gMTsK KyAgICAgICAgICAgICAgICAgIGlmICh4X3VuZGVybGluZV9hdF9kZXNjZW50X2xpbmUpCisgICAg ICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmhlaWdodCAtIHRoaWNrbmVzcykgLSAocy0+ eWJhc2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJsaW5lIHBvc2l0aW9u LiAgVGhpcyBpcyB0aGUgcmVjb21tZW5kZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICB2ZXJ0 aWNhbCBvZmZzZXQgaW4gcGl4ZWxzIGZyb20gdGhlIGJhc2VsaW5lIHRvIHRoZSB0b3Agb2YKKyAg ICAgICAgICAgICAgICAgICAgICAgICB0aGUgdW5kZXJsaW5lLiAgVGhpcyBpcyBhIHNpZ25lZCB2 YWx1ZSBhY2NvcmRpbmcgdG8gdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgc3BlY3MsIGFu ZCBpdHMgZGVmYXVsdCBpcworICAgICAgICAgICAgICAgICAgICAgICAgIFJPVU5EICgobWF4aW11 bSBkZXNjZW50KSAvIDIpLCB3aXRoCisgICAgICAgICAgICAgICAgICAgICAgICAgUk9VTkQoeCkg PSBmbG9vciAoeCArIDAuNSkgICovCisgICAgICAgICAgICAgICAgICAgICAgaWYgKHhfdXNlX3Vu ZGVybGluZV9wb3NpdGlvbl9wcm9wZXJ0aWVzCisgICAgICAgICAgICAgICAgICAgICAgICAgICYm IHMtPmZvbnQgJiYgcy0+Zm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uID49IDApCisgICAgICAgICAg ICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPmZvbnQtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAg ICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChzLT5mb250KQorICAgICAgICAgICAgICAgICAg ICAgICAgcG9zaXRpb24gPSAocy0+Zm9udC0+ZGVzY2VudCArIDEpIC8gMjsKKyAgICAgICAgICAg ICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHVuZGVy bGluZV9taW5pbXVtX29mZnNldDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICAgICAgcG9zaXRpb24gPSBtYXggKHBvc2l0aW9uLCB1bmRlcmxpbmVfbWluaW11bV9vZmZzZXQp OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgLyogQ2hlY2sgdGhlIHNhbml0eSBv ZiB0aGlja25lc3MgYW5kIHBvc2l0aW9uLiAgV2Ugc2hvdWxkCisgICAgICAgICAgICAgICAgIGF2 b2lkIGRyYXdpbmcgdW5kZXJsaW5lIG91dCBvZiB0aGUgY3VycmVudCBsaW5lIGFyZWEuICovCisg ICAgICAgICAgICAgIGlmIChzLT55ICsgcy0+aGVpZ2h0IDw9IHMtPnliYXNlICsgcG9zaXRpb24p CisgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+aGVpZ2h0IC0gMSkgLSAocy0+eWJhc2Ug LSBzLT55KTsKKyAgICAgICAgICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQgPCBzLT55YmFzZSAr IHBvc2l0aW9uICsgdGhpY2tuZXNzKQorICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IChzLT55 ICsgcy0+aGVpZ2h0KSAtIChzLT55YmFzZSArIHBvc2l0aW9uKTsKKyAgICAgICAgICAgICAgcy0+ dW5kZXJsaW5lX3RoaWNrbmVzcyA9IHRoaWNrbmVzczsKKyAgICAgICAgICAgICAgcy0+dW5kZXJs aW5lX3Bvc2l0aW9uID0gcG9zaXRpb247CisgICAgICAgICAgICAgIHkgPSBzLT55YmFzZSArIHBv c2l0aW9uOworICAgICAgICAgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX2RlZmF1bHRlZF9w KQorICAgICAgICAgICAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCB5 LCBzLT53aWR0aCwgdGhpY2tuZXNzKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgIFhHQ1ZhbHVlcyB4Z2N2OworICAgICAgICAgICAgICAg ICAgWEdldEdDVmFsdWVzIChzLT5kaXNwbGF5LCBzLT5nYywgR0NGb3JlZ3JvdW5kLCAmeGdjdik7 CisgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwgcy0+Z2MsIHMt PmZhY2UtPnVuZGVybGluZV9jb2xvcik7CisgICAgICAgICAgICAgICAgICB4X2ZpbGxfcmVjdGFu Z2xlIChzLT5mLCBzLT5nYywgcy0+eCwgeSwgcy0+d2lkdGgsIHRoaWNrbmVzcyk7CisgICAgICAg ICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwgcy0+Z2MsIHhnY3YuZm9yZWdy b3VuZCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAg ICAvKiBEcmF3IG92ZXJsaW5lLiAqLworICAgICAgaWYgKHMtPmZhY2UtPm92ZXJsaW5lX3ApCisg ICAgICAgIHsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIGR5ID0gMCwgaCA9IDE7CisgICAgICAg ICAgaWYgKHMtPmZhY2UtPm92ZXJsaW5lX2NvbG9yX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAg eF9maWxsX3JlY3RhbmdsZSAocy0+Ziwgcy0+Z2MsIHMtPngsIHMtPnkgKyBkeSwgcy0+d2lkdGgs IGgpOworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgWEdDVmFs dWVzIHhnY3Y7CisgICAgICAgICAgICAgIFhHZXRHQ1ZhbHVlcyAocy0+ZGlzcGxheSwgcy0+Z2Ms IEdDRm9yZWdyb3VuZCwgJnhnY3YpOworICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAocy0+ ZGlzcGxheSwgcy0+Z2MsIHMtPmZhY2UtPm92ZXJsaW5lX2NvbG9yKTsKKyAgICAgICAgICAgICAg eF9maWxsX3JlY3RhbmdsZSAocy0+Ziwgcy0+Z2MsIHMtPngsIHMtPnkgKyBkeSwgcy0+d2lkdGgs IGgpOworICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwgcy0+Z2MsIHhn Y3YuZm9yZWdyb3VuZCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIC8qIERyYXcg c3RyaWtlLXRocm91Z2guICovCisgICAgICBpZiAocy0+ZmFjZS0+c3RyaWtlX3Rocm91Z2hfcCkK KyAgICAgICAgeworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgaCA9IDE7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ByZXYpCisgICAgICAgICAgICBpZiAocHJldi0+aGwgIT0gcy0+ aGwKKyAgICAgICAgICAgICAgICAmJiBwcmV2LT54ICsgcHJldi0+d2lkdGggKyBwcmV2LT5yaWdo dF9vdmVyaGFuZyA+IHMtPngpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBB cyBwcmV2IHdhcyBkcmF3biB3aGlsZSBjbGlwcGVkIHRvIGl0cyBvd24gYXJlYSwgd2UKKyAgICAg ICAgICAgICAgICAgICBtdXN0IGRyYXcgdGhlIHJpZ2h0X292ZXJoYW5nIHBhcnQgdXNpbmcgcy0+ aGwgbm93LiAqLworICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBzYXZlID0g cHJldi0+aGw7CisgICAgICAgICAgICAgICAgcHJldi0+aGwgPSBzLT5obDsKKyAgICAgICAgICAg ICAgICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKHByZXYsIGN1cnNvcl9nY19wKTsKKyAgICAg ICAgICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywgcHJldik7 CisgICAgICAgICAgICAgICAgaWYgKHByZXYtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZ UEgpCisgICAgICAgICAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHBy ZXYpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIHhfZHJhd19jb21w b3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHByZXYpOworICAgICAgICAgICAgICAgIHhf cmVzZXRfY2xpcF9yZWN0YW5nbGVzIChwcmV2LT5mLCBwcmV2LT5nYyk7CisgICAgICAgICAgICAg ICAgcHJldi0+aGwgPSBzYXZlOworICAgICAgICAgICAgICAgIHByZXYtPm51bV9jbGlwcyA9IDA7 CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKHMtPm5leHQpCisgICAgICAg IHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpuZXh0OworICAgICAgICAgIGZvciAo bmV4dCA9IHMtPm5leHQ7IG5leHQ7IG5leHQgPSBuZXh0LT5uZXh0KQorICAgICAgICAgICAgaWYg KG5leHQtPmhsICE9IHMtPmhsCisgICAgICAgICAgICAgICAgJiYgbmV4dC0+eCAtIG5leHQtPmxl ZnRfb3ZlcmhhbmcgPCBzLT54ICsgcy0+d2lkdGgpCisgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAvKiBBcyBuZXh0IHdpbGwgYmUgZHJhd24gd2hpbGUgY2xpcHBlZCB0byBpdHMgb3du IGFyZWEsCisgICAgICAgICAgICAgICAgICAgd2UgbXVzdCBkcmF3IHRoZSBsZWZ0X292ZXJoYW5n IHBhcnQgdXNpbmcgcy0+aGwgbm93LiAqLworICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlw aHNfZmFjZSBzYXZlID0gbmV4dC0+aGw7CisgICAgICAgICAgICAgICAgbmV4dC0+aGwgPSBzLT5o bDsKKyAgICAgICAgICAgICAgICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKG5leHQsIGN1cnNv cl9nY19wKTsKKyAgICAgICAgICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhh Y3RseSAocywgbmV4dCk7CisgICAgICAgICAgICAgICAgaWYgKG5leHQtPmZpcnN0X2dseXBoLT50 eXBlID09IENIQVJfR0xZUEgpCisgICAgICAgICAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5n X2ZvcmVncm91bmQgKG5leHQpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAg ICAgIHhfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5leHQpOworICAg ICAgICAgICAgICAgIHhfcmVzZXRfY2xpcF9yZWN0YW5nbGVzIChuZXh0LT5mLCBuZXh0LT5nYyk7 CisgICAgICAgICAgICAgICAgbmV4dC0+aGwgPSBzYXZlOworICAgICAgICAgICAgICAgIG5leHQt Pm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgICAgICAgbmV4dC0+Y2xpcF9oZWFkID0gcy0+bmV4 dDsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAvKiBSZXNldCBjbGlwcGlu Zy4gKi8KKyAgeF9yZXNldF9jbGlwX3JlY3RhbmdsZXMgKHMtPmYsIHMtPmdjKTsKKyAgcy0+bnVt X2NsaXBzID0gMDsKK30KKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKIC8qIERlZmF1bHQgdG8gdXNpbmcgWElNIGlmIGF2YWlsYWJsZS4g ICovCiAjaWZkZWYgVVNFX1hJTQogYm9vbCB1c2VfeGltID0gdHJ1ZTsKQEAgLTk5OSw2ICsxODYy LDE1IEBAIHhfdXBkYXRlX2JlZ2luIChzdHJ1Y3QgZnJhbWUgKmYpCiAgIGlmIChGUkFNRV9UT09M VElQX1AgKGYpICYmICFGUkFNRV9WSVNJQkxFX1AgKGYpKQogICAgIHJldHVybjsKIAorCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5tY191 cGRhdGluZ19mcmFtZSA9IGY7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgaWYg KCEgRlJBTUVfQ1JfU1VSRkFDRSAoZikpCiAgICAgewogICAgICAgaW50IHdpZHRoLCBoZWlnaHQ7 CkBAIC0xMjY2LDYgKzIxMzgsMTYgQEAgeF91cGRhdGVfZW5kIChzdHJ1Y3QgZnJhbWUgKmYpCiAg IFhGbHVzaCAoRlJBTUVfWF9ESVNQTEFZIChmKSk7CiAgIHVuYmxvY2tfaW5wdXQgKCk7CiAjZW5k aWYKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8K KworICBmLT5tY191cGRhdGluZ19mcmFtZSA9IE5VTEw7CisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKIH0KIAogLyogVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgZnJvbSB2YXJpb3VzIHBs YWNlcyBpbiB4ZGlzcC5jCkBAIC0xMzEwMCw2ICsxMzk4MiwyMSBAQCB4X2FjdGl2YXRlX3RpbWVv dXRfYXRpbWVyICh2b2lkKQogCiBzdGF0aWMgc3RydWN0IHJlZGlzcGxheV9pbnRlcmZhY2UgeF9y ZWRpc3BsYXlfaW50ZXJmYWNlID0KICAgeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUtQ1VSU09SUyAqLworCisvKiBgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYHh0 ZXJtLmNgIG11c3QgYmUgaW4gdGhlIGV4YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitgcmVkaXNwbGF5 X2ludGVyZmFjZScgaW4gYGRpc3BleHRlcm4uaGAhICovCisKKyAgbWNfeF93cml0ZV9nbHlwaHMs CisgIG1jX3hfZHJhd193aW5kb3dfY3Vyc29yLAorICBtY194X2RyYXdfZ2x5cGhfc3RyaW5nLAor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgeF9mcmFtZV9wYXJtX2hhbmRsZXJz LAogICAgIHhfcHJvZHVjZV9nbHlwaHMsCiAgICAgeF93cml0ZV9nbHlwaHMsCg== --Multipart_Tue_May_28_01:31:54_2019-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs). References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sun, 02 Jun 2019 07:30:04 +0000 Resent-Message-ID: <handler.22873.B22873.155946056019293 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22873 <at> debbugs.gnu.org,17684 <at> debbugs.gnu.org Cc: eliz@HIDDEN, johnw@HIDDEN, mbork@HIDDEN, rms@HIDDEN, akioburns@HIDDEN Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.155946056019293 (code B ref 22873); Sun, 02 Jun 2019 07:30:04 +0000 Received: (at 22873) by debbugs.gnu.org; 2 Jun 2019 07:29:20 +0000 Received: from localhost ([127.0.0.1]:39329 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1hXKve-000515-UB for submit <at> debbugs.gnu.org; Sun, 02 Jun 2019 03:29:20 -0400 Received: from gateway23.websitewelcome.com ([192.185.50.107]:11680) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1hXKvc-00050r-NA for 22873 <at> debbugs.gnu.org; Sun, 02 Jun 2019 03:29:17 -0400 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway23.websitewelcome.com (Postfix) with ESMTP id 44095380F for <22873 <at> debbugs.gnu.org>; Sun, 2 Jun 2019 02:29:16 -0500 (CDT) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id XKvbhp6JU4FKpXKvbh9d7C; Sun, 02 Jun 2019 02:29:16 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=xdKPWoIP9DPA4m9JVbM7j+E0XdpZThNJ3aMdELUnFzk=; b=gW6MKiXIYC+iuFGG+oTZ0R+qjR zJHU2IPdxiBFL7alJBqMumY5aOeHKJywxuEcvO6o4tCj1XuzR9gITm/MOlfSeF43P7rLiePw9G2qC j5xBfQw6yQRayGo4Y+lfxbjhkezkfFFCqH18QfXwjloh8tTIawb+5ouBIW/X6KcWbGBDApStmCfEg k925/fbp5UwpgclajEqvJRTt/bkTduwm3xh3Fe1v7tKy0mlp6EM8YKe8RL4ewcemhJvT17z6B973R 4yu5U0fOfQfnk0RSXkZJUjVmJu7RFrmhy6LVamT928u8nmuvSHRePkuaoABBLQaXTxsuzn2VFA9Bi PeDJw9nA==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:51715 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from <esq@HIDDEN>) id 1hXKvW-002wzU-QN; Sun, 02 Jun 2019 02:29:14 -0500 Date: Sun, 02 Jun 2019 00:29:09 -0700 Message-ID: <m2muj0qwca.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Sun_Jun__2_00:29:09_2019-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1hXKvW-002wzU-QN X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:51715 X-Source-Auth: lawlist X-Email-Count: 7 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> --Multipart_Sun_Jun__2_00:29:09_2019-1 Content-Type: text/plain; charset=US-ASCII VERSION: 021.000 [06/01/2019] CHANGELOG: - Added a new feature to visually distinguish with user-defined colors when a fake cursor is on a screen line containing _only_ ZV, or subsequent to a screen line containing _only_ ZV, or all screen lines prior to a line containing _only_ ZV (if such a line exists), which includes a screen line that has characters and ends at ZV (i.e., no final new line). SCREENSHOT -- DARK BACKGROUND: https://lawlist.com/images/22873_17684__2019_06_01_dark_bg.png SCREENSHOT -- LIGHT BACKGROUND: https://lawlist.com/images/22873_17684__2019_06_01_light_bg.png - `free_window_matrices': Added a call to free the fake cursor cache matrices. - Tweaked how colors are assigned for the MC_FRAMED_BOX when at region begin, region end, and in between region begin/end. - Fixed a crash caused by NULL glyph when attempting to cache coordinates for a right fringe bitmap when cursor is exactly at the right fringe. When coordinates for the real cursor do not correlate to an actual glyph, we use the last glyph of the current row instead. - Fixed a crash caused by using the built-in region begin/end function, which failed when Fmarker_position returned a NULL Lisp_Object -- leading to one of those hard to debug bugs; i.e., when garbage collection chokes due to a NULL Lisp_Object. `mc_region_limit' is now used instead. - Fixed a bug caused by a failure to have a `fill_column_trump_p` test at the tail end of `mc_update_text_area' which is used to suppress the vertical crosshairs ruler when the fill column indicator trumps at that exact X. - NS port: Fixed a bug relating to `mc_ns_draw_overwritten' drawing fake cursors outside of the clipped area when dealing with STRETCH_GLYPH. - NS port: Created a workaround to deal with the `row->clip' inhibiting the drawing of glyphs on the box family of fake cursors in certain circumstances. [More work needs to be done, but will likely require help from Emacs Devel.] SETUP: Step 1: git clone -b master git://git.sv.gnu.org/emacs.git Step 2: In the new emacs folder, go back to an Emacs version from 04/08/2019: git reset --hard a038df77de7b1aa2d73a6478493b8838b59e4982 Step 3: From within the new emacs folder created in Step 1, apply the patch: git apply /path/to/the/patch.diff Step 4: ./autogen.sh Step 5: ./configure ... [your custom options] Step 6: make Step 7: make install USAGE: - For a minimal working example of built-in fake cursors, type: M-x mc-test ;;; TURN ON FAKE CURSORS (buffer position, cursor-type, cursor color): (setq mc-conf '((1 "hbar" "magenta") (2 "bar" "purple") (3 "box" "#00FF00") (4 "hollow" "#0000FF") (5 ("hbar" 3) [1.0 0.0 1.0]) (6 ("bar" 3) [0.0 1.0 1.0]) (7 "framed" "OrangeRed")))) ;;; TURN OFF FAKE CURSORS: (setq mc-conf nil) - To try out the crosshairs feature, type: M-x +-mode - To try out built-in fake cursors with Magnar Sveen's multiple-cursors package, install that package first. [If the multiple-cursors package is installed, an eval-after-load "multiple-cursors-core" statement within `crosshairs.el` will redefine a couple of functions and set up a few keyboard shortcuts.] If the multiple-cursors package by Magnar Sveen is not already installed, then here are two easy ways to install that package: Type: M-x mc-install OR, evaluate the following snippet: (progn (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) (package-refresh-contents) (package-install 'multiple-cursors)) TODO: - `ns_draw_window_cursor' calls `ns_clip_to_rect', which does _not_ take `row->clip` into consideration when drawing cursors with `NSRectFill'. When it comes time to draw glyphs on top of the box/hollow family of cursors, `row->clip` is taken into consideration by `get_glyph_string_clip'. Fake cursors can be drawn even though the glyphs cannot, resulting in hollow/box family of cursors without text. The issue can be reproduced with M-x mc-test. [A temporary workaround is to disable `row->clip` while drawing the glyphs.] https://lists.gnu.org/archive/html/emacs-devel/2019-04/msg00009.html - Add additional support for `ch_inactive_windows' and `fc_inactive_windows' when the variables have a `nil` value. In such a case, the inactive windows should not display the crosshairs and/or visible fill column indicator. At the present time, fake cursors are drawn in active/inactive windows alike. - Deal with left/right overwritten glyphs in the w32 and X ports of Emacs. - Is there any additional meaningful optimization that can be added to the three calls of `mc_pre_scroll_clean'? - NOTE: As to `mc_scrolling_window', it would appear that there is no tangible benefit to rotating the current/prospective cache of fake cursors to compare the data before removing the fake cursors. When scrolling the display, only _some_ lines are copied to new locations. Areas that are not overwritten may have fake cursors and those may not necessarily be removed if desired/current matrix glyphs are equal. The test for `GLYPH_EQUAL_P' does not take into consideration the existence of a fake cursor, and the glyph (with a fake cursor) may not be updated as a result thereof. As to lines that are not copied, portions may be updated and fake cursors would be removed thereby. - When an idle-timer fires and point is at the end of a horizontally scrolled line in a narrow window, the temporary horizontal scroll is canceled. Create an minimal working example and file a bug report. - There is a bug affecting an older version of Emacs for the NS port that causes partial line flickering when the same characters are grouped together (;;;;;;) and MC_GLYPHLESS cursors are above or below -- having the same background color as the frame; e.g., black on black (used to erase a glyphless cursor). The partial flickering is only noticeable with rapid fire; e.g., holding down the right/left arrow key. When changing the color of the glyphless cursor, the issue is not present. [@lawlist has verified that the X and HPOS coordinates are accurate.] - There is a bug affecting the recorded `w->mc.lnum_pixel_width` that is observable when not running under gdb, but disappears when running under gdb. While viewing a folded org-mode buffer, the non-gdb instance had a visible line number pixel-width of 44, but Emacs treated it as fluctuating between 44 and 55 as the cursor was moved to the end of line. In the gdb instance, the visible line number pixel width was 55 with no fluctuation under the same conditions as the non-gdb instance. This appears to be a different bug than bug#32177 (current line number shifts one column to the left) because the line number of the current line does not shift left, and changing the bidi settings did not correct the issue. - The current test for `auto_hscroll_mode_p' only looks for `current_line` and all five related tests are based upon that assumption, which may not be true. - Multiple Cursors: If point is in the middle of a composite character, then select a fully composed character so that the fake cursor is visible. - Implement functionality similar to the Lisp multiple-cursors by Magnar Sveen. - Follow up with the Emacs team re bug#32177; i.e., (Current line number shifts one column to the left.) - Follow up with the Emacs team re bug#32060; i.e., Horizontal Scrolling (Current Line): Wrong line gets h-scrolled. - Determine if bug #28936 needs to be fixed and help the Emacs team re same. --Multipart_Sun_Jun__2_00:29:09_2019-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="2019_06_01__22_47_04_513.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvY3Jvc3NoYWlycy5lbCBiL2xpc3AvY3Jvc3NoYWlycy5lbApuZXcg ZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4zYmJkNjk3Ci0tLSAvZGV2L251bGwKKysr IGIvbGlzcC9jcm9zc2hhaXJzLmVsCkBAIC0wLDAgKzEsMTI4MiBAQAorOzs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7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bW1hbmQKKyAgICAg ICAgICAobGV0ICgob3JpZ2luYWwtY29tbWFuZCAob3IgbWMtLXRoaXMtY29tbWFuZAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29tbWFuZC1yZW1hcHBpbmcgdGhpcy1v cmlnaW5hbC1jb21tYW5kKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0 aGlzLW9yaWdpbmFsLWNvbW1hbmQpKSkKKyAgICAgICAgICAgIDs7IHNraXAga2V5Ym9hcmQgbWFj cm9zLCBzaW5jZSB0aGV5IHdpbGwgZ2VuZXJhdGUgYWN0dWFsIGNvbW1hbmRzIHRoYXQgYXJlCisg ICAgICAgICAgICA7OyBhbHNvIHJ1biBpbiB0aGUgY29tbWFuZCBsb29wIC0gd2UnbGwgaGFuZGxl IHRob3NlIGxhdGVyIGluc3RlYWQuCisgICAgICAgICAgICAod2hlbiAoZnVuY3Rpb25wIG9yaWdp bmFsLWNvbW1hbmQpCisgICAgICAgICAgICAgIDs7IGlmIGl0J3MgYSBsYW1iZGEsIHdlIGNhbid0 IGtub3cgaWYgaXQncyBzdXBwb3J0ZWQgb3Igbm90CisgICAgICAgICAgICAgIDs7IC0gc28gZ28g YWhlYWQgYW5kIGFzc3VtZSBpdCdzIG9rLCBiZWNhdXNlIHdlJ3JlIGp1c3Qgb3B0aW1pc3RpYyBs aWtlIHRoYXQKKyAgICAgICAgICAgICAgKGlmIChvciAobm90IChzeW1ib2xwIG9yaWdpbmFsLWNv bW1hbmQpKQorICAgICAgICAgICAgICAgICAgICAgIDs7IGxhbWJkYSByZWdpc3RlcmVkIGJ5IHNt YXJ0cmVwCisgICAgICAgICAgICAgICAgICAgICAgKHN0cmluZy1wcmVmaXgtcCAiKCIgKHN5bWJv bC1uYW1lIG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAgICAgICAgICAgICAgICAgIChtYy9leGVjdXRl LWNvbW1hbmQtZm9yLWFsbC1mYWtlLWN1cnNvcnMgb3JpZ2luYWwtY29tbWFuZCkKKyAgICAgICAg ICAgICAgICA7OyBzbWFydHJlcCBgaW50ZXJuJ3MgY29tbWFuZHMgaW50byBvd24gb2JhcnJheSB0 byBoZWxwCisgICAgICAgICAgICAgICAgOzsgYGRlc2NyaWJlLWJpbmRpbmdzJy4gIFNvLCBsZXQn cyByZS1gaW50ZXJuJyBoZXJlIHRvCisgICAgICAgICAgICAgICAgOzsgbWFrZSB0aGUgY29tbWFu ZCBjb21wYXJhYmxlIGJ5IGBlcScuCisgICAgICAgICAgICAgICAgKHNldHEgb3JpZ2luYWwtY29t bWFuZCAoaW50ZXJuIChzeW1ib2wtbmFtZSBvcmlnaW5hbC1jb21tYW5kKSkpCisgICAgICAgICAg ICAgICAgOzsgb3RoZXJ3aXNlIGl0J3MgYSBzeW1ib2wsIGFuZCB3ZSBjYW4gYmUgbW9yZSB0aG9y b3VnaAorICAgICAgICAgICAgICAgIChpZiAoZ2V0IG9yaWdpbmFsLWNvbW1hbmQgJ21jLS11bnN1 cHBvcnRlZCkKKyAgICAgICAgICAgICAgICAgICAgKG1lc3NhZ2UgIiVTIGlzIG5vdCBzdXBwb3J0 ZWQgd2l0aCBtdWx0aXBsZSBjdXJzb3JzJXMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg IG9yaWdpbmFsLWNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdldCBvcmln aW5hbC1jb21tYW5kICdtYy0tdW5zdXBwb3J0ZWQpKQorICAgICAgICAgICAgICAgICAgKHdoZW4g KGFuZCBvcmlnaW5hbC1jb21tYW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChub3Qg KG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy0tZGVmYXVsdC1jbWRzLXRvLXJ1bi1vbmNlKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKG5vdCAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1j L2NtZHMtdG8tcnVuLW9uY2UpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAob3IgbWMv YWx3YXlzLXJ1bi1mb3ItYWxsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVt cSBvcmlnaW5hbC1jb21tYW5kIG1jLS1kZWZhdWx0LWNtZHMtdG8tcnVuLWZvci1hbGwpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jL2Nt ZHMtdG8tcnVuLWZvci1hbGwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWMv cHJvbXB0LWZvci1pbmNsdXNpb24taW4td2hpdGVsaXN0IG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAg ICAgICAgICAgICAgICAgICAgKG1jL2V4ZWN1dGUtY29tbWFuZC1mb3ItYWxsLWZha2UtY3Vyc29y cyBvcmlnaW5hbC1jb21tYW5kKSkpKQorICAgICAgICAgICAgICAod2hlbiBtYy91c2UtYnVpbHQt aW4tY3Vyc29ycworICAgICAgICAgICAgICAgIChzZXRxIG1jLWNvbmYKKyAgICAgICAgICAgICAg ICAgICAgICAgIChtYXBjYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKGxhbWJkYSAoeCkg KGxpc3QgKG92ZXJsYXktc3RhcnQgeCkgImJhciIgbmlsKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgKG1jL2FsbC1mYWtlLWN1cnNvcnMpKSkpKSkpKSkpCisKKyAgKGRlZnVuIG1jL21hcmst bmV4dC1saWtlLXRoaXMtY3ljbGUtZm9yd2FyZCAoKQorICAiTWFya3MgbmV4dCBvY2N1cmVuY2Ug b2Ygd29yZCBsaWtlIHRoaXMgYW5kIGFkdmFuY2VzIGN1cnNvciB0byB0aGlzIG9jY3VycmVuY2Ui CisgIChpbnRlcmFjdGl2ZSkKKyAgICAobWMvbWFyay1uZXh0LWxpa2UtdGhpcyAxKSkKKworICAo ZGVmdW4gbWMvbWFyay1wcm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iAzKSBbMS4wIDAu MCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg2ICgiYmFyIiAzKSBbMC4wIDEuMCAxLjBd KQorICAgICAgICAgICAgICAgICAgICAgICg3ICJmcmFtZWQiICJPcmFuZ2VSZWQiKQorICAgICAg ICAgICAgICAgICAgICAgICg4ICJib3giICJncmV5MjUiKQorICAgICAgICAgICAgICAgICAgICAg ICg5ICJib3giICJncmV5NzUiKSkpKQorICAgIChzZWxlY3Qtd2luZG93IChkaXNwbGF5LWJ1ZmZl ciBidWZmZXIpKSkpCisKKyhkZWZ1biArLXRpbWVyLWZuICgpCisiU2luY2UgdGhpcyBmaXJlcyBn bG9iYWxseSwgd2UgbXVzdCBjb250cm9sIHdoaWNoIGJ1ZmZlcnMgY3Jvc3NoYWlycyBhcHBlYXIg aW4uIgorICAod2hlbiArLW1vZGUKKyAgICAodW5sZXNzIChvciAobWVtcSBsYXN0LWNvbW1hbmQg Ky1wYXJlbnMtZXhjbHVzaW9ucykKKyAgICAgICAgICAgICAgICAobnVsbCArLXBhcmVucy1wKSkK KyAgICAgICgrLXBhcmVucy1mbikpCisgICAgKHdoZW4gKy10aW1lci12YXIKKyAgICAgIChzZXRx IHRpbWVyLWlkbGUtbGlzdCAoZGVscSArLXRpbWVyLXZhciB0aW1lci1pZGxlLWxpc3QpKQorICAg ICAgKHNldHEgKy10aW1lci12YXIgbmlsKSkpKQorCisoZGVmdW4gKy1kcmF3LWZvcnRod2l0aCAo KQorIkltbWVkaWF0ZWx5IGRlbGV0ZS9kcmF3IG1hdGNoaW5nIHBhcmVudGhlc2VzLiIKKyAgKCst ZHJhdy1jcm9zc2hhaXJzICdmb3JjZSkpCisKKyhkZWZ1biArLWRyYXctY3Jvc3NoYWlycyAoJm9w dGlvbmFsIGZvcmNlKQorIkltbWVkaWF0ZWx5IGRlbGV0ZSBtYXRjaGluZyBwYXJlbnRoZXNlcy4g IElmIEZPUkNFIGlzIG5vbi1uaWwsIHRoZW4gaW1tZWRpYXRlbHkKK2RyYXcgbWF0Y2hpbmcgcGFy ZW50aGVzaXM7IG90aGVyd2lzZSwgZHJhdyB0aGVtIG9uIGFuIGlkbGUtdGllci4iCisgICh3aGVu ICstbW9kZQorICAgICh3aGVuICstdGltZXItdmFyCisgICAgICAoc2V0cSB0aW1lci1pZGxlLWxp c3QgKGRlbHEgKy10aW1lci12YXIgdGltZXItaWRsZS1saXN0KSkKKyAgICAgIChzZXRxICstdGlt ZXItdmFyIG5pbCkpCisgICAgKHVubGVzcyAob3IgKG1lbXEgdGhpcy1jb21tYW5kICstcGFyZW5z LWV4Y2x1c2lvbnMpCisgICAgICAgICAgICAgICAgKGFuZCAobnVsbCArLXBhcmVucy1wKQorICAg ICAgICAgICAgICAgICAgICAgKG51bGwgKy1wYXJlbnMtb3ZlcmxheXMtZXhpc3QtcCkpKQorICAg ICAgKCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykpCisgICAgKGlmIGZvcmNlCisgICAgICAocHJv Z24KKyAgICAgICAgKHdoZW4gKy1wYXJlbnMtcAorICAgICAgICAgICgrLXBhcmVucy1mbikpKQor ICAgICAgKHNldHEgKy10aW1lci12YXIgKHJ1bi13aXRoLWlkbGUtdGltZXIgKy1pZGxlLXRpbWVy LXNlY29uZHMgbmlsICMnKy10aW1lci1mbikpKSkpCisKKyhkZWZ2YXIgZmMtbW9kZSkKKworOzs7 IyMjYXV0b2xvYWQKKyhkZWZpbmUtbWlub3ItbW9kZSArLW1vZGUKKyJNaW5vciBtb2RlIGZvciBk aXNwbGF5aW5nIGEgaG9yaXpvbnRhbCBydWxlci4iCisgIDppbml0LXZhbHVlIG5pbAorICA6bGln aHRlciAiICsiCisgIDprZXltYXAgbmlsCisgIDpnbG9iYWwgbmlsCisgIDpncm91cCAnKy1tb2Rl CisgIChjb25kCisgICAgKCstbW9kZQorICAgICAgOzs7IGArLW1vZGUnIGhhcyB0aGUgYWJpbGl0 eSB0byBhbHNvIGRpc3BsYXkgYSBmaWxsIGNvbHVtbiBpbmRpY2F0b3IuCisgICAgICA7OzsgU2Vl IHRoZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicuCisgICAgICAod2hlbiBmYy1tb2RlCisgICAg ICAgIChmYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgZ2xvYmFsLWVsZG9jLW1vZGUKKyAg ICAgICAgICAgICAgICAgKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAgJ2FueSkKKyAgICAgICAgICAg ICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAgICAgICAgKGdsb2JhbC1l bGRvYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgaml0LWxvY2stY29udGV4dC10aW1lcgor ICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAg ICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAod2hlbiAo dGltZXJwIGppdC1sb2NrLWNvbnRleHQtdGltZXIpCisgICAgICAgICAgKGNhbmNlbC10aW1lciBq aXQtbG9jay1jb250ZXh0LXRpbWVyKSkKKyAgICAgICAgOzsgKHNldHEgaml0LWxvY2stY29udGV4 dC10aW1lciAocnVuLXdpdGgtaWRsZS10aW1lciA1LjAgJ3JlcGVhdCAnaml0LWxvY2stY29udGV4 dC1mb250aWZ5KSkKKyAgICAgICAgKHNldHEgaml0LWxvY2stY29udGV4dC10aW1lciBuaWwpKQor ICAgICAgKHdoZW4gKGFuZCAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAg ICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAod2hlbiAo dGltZXJwIHVuZG8tYXV0by1jdXJyZW50LWJvdW5kYXJ5LXRpbWVyKQorICAgICAgICAgIChjYW5j ZWwtdGltZXIgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhc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0CisgICAgICA7OzsgYW5kICMyMjg3MyBvbiBMMlIgbGFuZ3VhZ2VzLiAgVGhlIGZl YXR1cmUgdGVzdCBmaWxlIHVzZWQgYnkgQGxhd2xpc3QKKyAgICAgIDs7OyBib2dzIEVtYWNzIGRv d24gdW5sZXNzIGBiaWRpLWRpc3BsYXktcmVvcmRlcmluZycgaXMgc2V0IHRvIGEgbmlsIHZhbHVl LgorICAgICAgOzs7IEhvd2V2ZXIsIG1vc3QgdXNlcnMgd2lsbCBwcm9iYWJseSBub3Qgd2FudCB0 aGlzIHBhcnRpY3VsYXIgc2V0dGluZy4KKyAgICAgICh1bmxlc3MgKG51bGwgYmlkaS1kaXNwbGF5 LXJlb3JkZXJpbmcpCisgICAgICAgIChzZXRxIGJpZGktZGlzcGxheS1yZW9yZGVyaW5nIG5pbCkp CisgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICcrLS1zYXZlZC1zdGF0ZSkgbmlsKQor ICAgICAgKGRvbGlzdCAodmFyICcoYnVmZmVyLWRpc3BsYXktdGFibGUKKyAgICAgICAgICAgICAg ICAgICAgIGZyaW5nZS1pbmRpY2F0b3ItYWxpc3QKKyAgICAgICAgICAgICAgICAgICAgIHRhYi13 aWR0aAorICAgICAgICAgICAgICAgICAgICAgbGluZS1tb3ZlLXZpc3VhbAorICAgICAgICAgICAg ICAgICAgICAgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgICAgICAgICAgICAgIHRydW5jYXRlLXBh cnRpYWwtd2lkdGgtd2luZG93cworICAgICAgICAgICAgICAgICAgICAgd29yZC13cmFwKSkKKyAg ICAgICAgKHdoZW4gKGxvY2FsLXZhcmlhYmxlLXAgdmFyKQorICAgICAgICAgIChwdXNoIChjb25z IHZhciAoc3ltYm9sLXZhbHVlIHZhcikpICstLXNhdmVkLXN0YXRlKSkpCisgICAgICAoc2V0cSBm aWxsLWNvbHVtbiA4MCkKKyAgICAgIChzZXRxIGRpc3BsYXktbGluZS1udW1iZXJzIHQpCisgICAg ICAoc2V0cS1sb2NhbCBhdXRvLWhzY3JvbGwtbW9kZSAnY3VycmVudC1saW5lKQorICAgICAgKHNl dHEtbG9jYWwgaHNjcm9sbC1zdGVwIDUpCisgICAgICAoc2V0cSBidWZmZXItZGlzcGxheS10YWJs ZSArLWJ1ZmZlci1kaXNwbGF5LXRhYmxlKQorICAgICAgKHNldHEgdGFiLXdpZHRoIDQpCisgICAg ICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICdsaW5lLW1vdmUtdmlzdWFsKSB0KQorICAgICAg KHNldHEgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgKGNvbmQKKyAgICAgICAgICAoKGxldCAoKGxz dCArLXRydW5jYXRlLWxpbmVzLWRlcml2ZWQtbW9kZXMpCisgICAgICAgICAgICAgICAgICBtb2Rl KQorICAgICAgICAgICAgKGNhdGNoICdmb3VuZAorICAgICAgICAgICAgICAod2hpbGUgKHNldHEg bW9kZSAocG9wIGxzdCkpCisgICAgICAgICAgICAgICAgKHdoZW4gKGRlcml2ZWQtbW9kZS1wIG1v ZGUpCisgICAgICAgICAgICAgICAgICAodGhyb3cgJ2ZvdW5kIHQpKSkpKSkKKyAgICAgICAgICAg KChtZW1xIG1ham9yLW1vZGUgKy10cnVuY2F0ZS1saW5lcy1tYWpvci1tb2RlcykpCisgICAgICAg ICAgICh0CisgICAgICAgICAgICAgbmlsKSkpCisgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlh YmxlICd0cnVuY2F0ZS1wYXJ0aWFsLXdpZHRoLXdpbmRvd3MpIG5pbCkKKyAgICAgIChzZXRxIHdv cmQtd3JhcCB0KQorICAgICAgKHNldHEgaW5kaWNhdGUtZW1wdHktbGluZXMgdCkKKyAgICAgIChz ZXRxIGluZGljYXRlLWJ1ZmZlci1ib3VuZGFyaWVzICdsZWZ0KQorICAgICAgKHNldHEgZnJpbmdl LWluZGljYXRvci1hbGlzdAorICAgICAgICAgIDs7OyBoc2NsX2FsbF90ZW1wX3AgfCBoc2NsX3Rl bXBfcAorICAgICAgICAnKCgrLWhzY2wtdGVtcCAuICgrLXNpbmdsZS1hbmdsZS1sZWZ0CisgICAg ICAgICAgICAgICAgICAgICAgICAgICstZG91YmxlLWFuZ2xlLWxlZnQpKQorICAgICAgICAgIDs7 OyBoc2NsX2FsbF9wZXJtXzBfcCB8IGhzY2xfYWxsX3Blcm1fMV9wIHwgaHNjbF9hbGxfcGVybV8y X3AgfCBoc2NsX3Blcm1fcAorICAgICAgICAgICgrLWhzY2wtcGVybSAuICgrLXNpbmdsZS1hbmds ZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLWRvdWJsZS1hbmdsZS11cAorICAgICAg ICAgICAgICAgICAgICAgICAgICArLXRyaXBsZS1hbmdsZS11cAorICAgICAgICAgICAgICAgICAg ICAgICAgICArLXF1YWRydXBsZS1hbmdsZS11cCkpCisgICAgICAgICAgKCstb3ZlcmxheS1hcnJv dyAuICgrLWZyaW5nZS1sZWZ0LWFycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAr LWZyaW5nZS1yaWdodC1hcnJvdykpCisgICAgICAgICAgKHRydW5jYXRpb24gLiAoKy1mcmluZ2Ut bGVmdC1hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICstZnJpbmdlLXJpZ2h0LWFycm93 KSkKKyAgICAgICAgICAoY29udGludWF0aW9uIC4gKCstZnJpbmdlLWxlZnQtY3VybHktYXJyb3cK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICstYmFja3NsYXNoKSkKKyAgICAgICAgICAob3Zl cmxheS1hcnJvdyAuICstZnJpbmdlLXJpZ2h0LXRyaWFuZ2xlKQorICAgICAgICAgICh1cCAuICst ZnJpbmdlLXVwLWFycm93KQorICAgICAgICAgIChkb3duIC4gKy1mcmluZ2UtZG93bi1hcnJvdykK KyAgICAgICAgICAodG9wIC4gKy1mcmluZ2UtdG9wLWxlZnQtYW5nbGUpCisgICAgICAgICAgKGJv dHRvbSAuICstZnJpbmdlLWJvdHRvbS1yaWdodC1hbmdsZSkKKyAgICAgICAgICAodG9wLWJvdHRv bSAuICgrLWZyaW5nZS1sZWZ0LWJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICArLWZy aW5nZS1yaWdodC1icmFja2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgKy1mcmluZ2UtdG9w LXJpZ2h0LWFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgKy1mcmluZ2UtdG9wLWxlZnQt YW5nbGUpKQorICAgICAgICAgIChlbXB0eS1saW5lIC4gKy1mcmluZ2UtZW1wdHktbGluZSkKKyAg ICAgICAgICAodW5rbm93biAuICstZnJpbmdlLXF1ZXN0aW9uLW1hcmspKSkKKyAgICAgIChzZXRx IGZyaW5nZS1jdXJzb3ItYWxpc3QgJygoYm94IC4gKy1mcmluZ2UtbGVmdC10cmlhbmdsZSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaG9sbG93IC4gKy1ob2xsb3ctcmVjdGFu Z2xlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChiYXIgLiArLXZlcnRpY2Fs LWJhcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaGJhciAuICstZnJpbmdl LWhvcml6b250YWwtYmFyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChob2xs b3ctc21hbGwgLiArLWZyaW5nZS1ob2xsb3ctc3F1YXJlKSkpCisgICAgICAoaWYgKG9yICstZm9y dGh3aXRoCisgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisg ICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJhdy1mb3J0aHdpdGggJ2Fw cGVuZCAnbG9jYWwpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJh dy1jcm9zc2hhaXJzICdhcHBlbmQgJ2xvY2FsK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7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7CisKKyhkZWZ1biArLXBhcmVucy1mbiAoKQorICAiRG9j LXN0cmluZy4iCisgIChsZXQqICgob3BvaW50IChwb2ludCkpCisgICAgICAgICAoZnJvbSAoaWYg Ky1wYXJlbnMtZnJvbS1mbgorICAgICAgICAgICAgICAgICAoZnVuY2FsbCArLXBhcmVucy1mcm9t LWZuKQorICAgICAgICAgICAgICAgICAocG9pbnQtbWluKSkpCisgICAgICAgICAod2luIChzZWxl Y3RlZC13aW5kb3cpKQorICAgICAgICAgKGkgMCkKKyAgICAgICAgIChwcmVjZWRpbmctY2hhciAo cHJlY2VkaW5nLWNoYXIpKQorICAgICAgICAgKG9jaGFyIChjaGFyLWFmdGVyIG9wb2ludCkpCisg ICAgICAgICAocG9zMQorICAgICAgICAgICAoY29uZAorICAgICAgICAgICAgICgoYW5kIG9jaGFy CisgICAgICAgICAgICAgICAgICAgKG9yIDs7OyAoY2hhci10by1zdHJpbmcgNDApID0+IG9wZW5p bmcgcGFyZW50aGVzaXMKKyAgICAgICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgNDApCisgICAg ICAgICAgICAgICAgICAgICAgIDs7OyAoY2hhci10by1zdHJpbmcgOTEpID0+IG9wZW5pbmcgc3F1 YXJlIGJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgOTEpCisgICAgICAg ICAgICAgICAgICAgICAgIDs7OyAoY2hhci10by1zdHJpbmcgMTIzKSA9PiBvcGVuaW5nIHdhdnkg YnJhY2tldAorICAgICAgICAgICAgICAgICAgICAgICAoPSBvY2hhciAxMjMpKSkKKyAgICAgICAg ICAgICAgICAobWluICgxKyBvcG9pbnQpIChwb2ludC1tYXgpKSkKKyAgICAgICAgICAgICAoKG9y IDs7OyAoY2hhci10by1zdHJpbmcgNDEpID0+IGNsb3NpbmcgcGFyZW50aGVzaXMKKyAgICAgICAg ICAgICAgICAgICg9IHByZWNlZGluZy1jaGFyIDQxKQorICAgICAgICAgICAgICAgICAgOzs7IChj aGFyLXRvLXN0cmluZyA5MykgPT4gY2xvc2luZyBzcXVhcmUgYnJhY2tldAorICAgICAgICAgICAg ICAgICAgKD0gcHJlY2VkaW5nLWNoYXIgOTMpCisgICAgICAgICAgICAgICAgICA7OzsgKGNoYXIt dG8tc3RyaW5nIDEyNSkgPT4gY2xvc2luZyB3YXZ5IGJyYWNrZXQKKyAgICAgICAgICAgICAgICAg ICg9IHByZWNlZGluZy1jaGFyIDEyNSkpCisgICAgICAgICAgICAgICAgKG1heCAocG9pbnQtbWlu KSAoMS0gb3BvaW50KSkpCisgICAgICAgICAgICAgKHQKKyAgICAgICAgICAgICAgICBvcG9pbnQp KSkKKyAgICAgICAgIHBvczIKKyAgICAgICAgIHNlbGVjdGVkLWZhY2UpCisgICAgKHNhdmUtZXhj dXJzaW9uCisgICAgICAoY29uZGl0aW9uLWNhc2UgbmlsCisgICAgICAgICh3aGlsZSAoc2V0cSBw b3MxIChudGggMSAocGFyc2UtcGFydGlhbC1zZXhwIGZyb20gcG9zMSkpKQorICAgICAgICAgIChz ZXRxIHBvczIgKHNjYW4tc2V4cHMgcG9zMSAxKSkKKyAgICAgICAgICAoaWYgKD0gaSAxMCkKKyAg ICAgICAgICAgIChzZXRxIGkgMSkKKyAgICAgICAgICAgIChzZXRxIGkgKDErIGkpKSkKKyAgICAg ICAgICAoc2V0cSBzZWxlY3RlZC1mYWNlIChjb25kCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICgoPSBpIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFy ZW5zLW9uZS1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSAyKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy10d28tZmFjZSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgMykKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtdGhyZWUtZmFjZSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgKCg9IGkgNCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAnKy1wYXJlbnMtZm91ci1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo KD0gaSA1KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1maXZl LWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDYpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLXNpeC1mYWNlKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA3KQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICcrLXBhcmVucy1zZXZlbi1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAoKD0gaSA4KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBh cmVucy1laWdodC1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA5 KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1uaW5lLWZhY2Up CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDEwKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy10ZW4tZmFjZSkpKQorICAgICAgICAgIChs ZXQgKChvdiAobWFrZS1vdmVybGF5IHBvczEgKDErIHBvczEpKSkpCisgICAgICAgICAgICAodW5s ZXNzICstcGFyZW5zLWluYWN0aXZlLXdpbmRvd3MKKyAgICAgICAgICAgICAgKG92ZXJsYXktcHV0 IG92ICd3aW5kb3cgd2luKSkKKyAgICAgICAgICAgIChvdmVybGF5LXB1dCBvdiAnZmFjZSBzZWxl Y3RlZC1mYWNlKSkKKyAgICAgICAgICAod2hlbiBwb3MyCisgICAgICAgICAgICAobGV0ICgob3Yg KG1ha2Utb3ZlcmxheSAoMS0gcG9zMikgcG9zMikpKQorICAgICAgICAgICAgICAodW5sZXNzICst cGFyZW5zLWluYWN0aXZlLXdpbmRvd3MKKyAgICAgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3Yg J3dpbmRvdyB3aW4pKQorICAgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ2ZhY2Ugc2VsZWN0 ZWQtZmFjZSkpKSkKKyAgICAgICAgKGVycm9yIG5pbCkpKQorICAgIChzZXRxICstcGFyZW5zLW92 ZXJsYXlzLWV4aXN0LXAgdCkpKQorCisoZGVmdW4gKy1yZW1vdmUtb3ZlcmxheXMgKGJlZyBlbmQg bmFtZSB2YWwpCisiUmVtb3ZlIHRoZSBvdmVybGF5cyB0aGF0IGFyZSBgZXF1YWwtaW5jbHVkaW5n LXByb3BlcnRpZXNgLgorSW5jbHVkZXMgYSB1bmlxdWUgc2l0dWF0aW9uIHdoZW4gYW4gb3Zlcmxh eSB3aXRoIGFuIGAnYWZ0ZXItc3RyaW5nYCBwcm9wZXJ0eQoraXMgYXQgdGhlIHZlcnkgZW5kIG9m IGEgbmFycm93ZWQtYnVmZmVyLiIKKyAgKGxldCogKChwb2ludC1tYXggKHBvaW50LW1heCkpCisg ICAgICAgICAocG9pbnQtbWluIChwb2ludC1taW4pKQorICAgICAgICAgKG5hcnJvd2VkLXAgKGJ1 ZmZlci1uYXJyb3dlZC1wKSkKKyAgICAgICAgIChiZWcgKGlmIGJlZyBiZWcgcG9pbnQtbWluKSkK KyAgICAgICAgIChlbmQKKyAgICAgICAgICAgKGNvbmQKKyAgICAgICAgICAgICAoKGFuZAorICAg ICAgICAgICAgICAgICAobm90IG5hcnJvd2VkLXApCisgICAgICAgICAgICAgICAgIGVuZCkKKyAg ICAgICAgICAgICAgIGVuZCkKKyAgICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAo bm90IG5hcnJvd2VkLXApCisgICAgICAgICAgICAgICAgIChudWxsIGVuZCkpCisgICAgICAgICAg ICAgICBwb2ludC1tYXgpCisgICAgICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFy cm93ZWQtcAorICAgICAgICAgICAgICAgICBlbmQKKyAgICAgICAgICAgICAgICAgKDwgZW5kIHBv aW50LW1heCkpCisgICAgICAgICAgICAgICBlbmQpCisgICAgICAgICAgICAgKChhbmQKKyAgICAg ICAgICAgICAgICAgbmFycm93ZWQtcAorICAgICAgICAgICAgICAgICBlbmQKKyAgICAgICAgICAg ICAgICAgKD0gZW5kIHBvaW50LW1heCkpCisgICAgICAgICAgICAgICAoMSsgZW5kKSkKKyAgICAg ICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICBuYXJyb3dlZC1wCisgICAgICAgICAgICAg ICAgIChudWxsIGVuZCkpCisgICAgICAgICAgICAgICAoMSsgcG9pbnQtbWF4KSkgKSkKKyAgICAg ICAgIChvdmVybGF5cworICAgICAgICAgICAocHJvZ24KKyAgICAgICAgICAgICAob3ZlcmxheS1y ZWNlbnRlciBlbmQpCisgICAgICAgICAgICAgKG92ZXJsYXlzLWluIGJlZyBlbmQpKSkpCisgICAg KHdoZW4gKGFuZCBiZWcgZW5kIG5hbWUgdmFsKQorICAgICAgKGRvbGlzdCAobyBvdmVybGF5cykK KyAgICAgICAgKGNvbmQKKyAgICAgICAgICAoKGFuZCAoZXEgbmFtZSAnZmFjZSkKKyAgICAgICAg ICAgICAgICAoZXEgKG92ZXJsYXktZ2V0IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIDs7IEVp dGhlciBwdXNoIHRoaXMgb3ZlcmxheSBvdXRzaWRlIGJlZy4uLmVuZAorICAgICAgICAgICAgOzsg b3Igc3BsaXQgaXQgdG8gZXhjbHVkZSBiZWcuLi5lbmQKKyAgICAgICAgICAgIDs7IG9yIGRlbGV0 ZSBpdCBlbnRpcmVseSAoaWYgaXQgaXMgY29udGFpbmVkIGluIGJlZy4uLmVuZCkuCisgICAgICAg ICAgICAoaWYgKDwgKG92ZXJsYXktc3RhcnQgbykgYmVnKQorICAgICAgICAgICAgICAgIChpZiAo PiAob3ZlcmxheS1lbmQgbykgZW5kKQorICAgICAgICAgICAgICAocHJvZ24KKyAgICAgICAgICAg ICAgICAobW92ZS1vdmVybGF5IChjb3B5LW92ZXJsYXkgbykKKyAgICAgICAgICAgICAgICAgIChv dmVybGF5LXN0YXJ0IG8pIGJlZykKKyAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gZW5k IChvdmVybGF5LWVuZCBvKSkpCisgICAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gKG92 ZXJsYXktc3RhcnQgbykgYmVnKSkKKyAgICAgICAgICAgICAgKGlmICg+IChvdmVybGF5LWVuZCBv KSBlbmQpCisgICAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVu ZCBvKSkKKyAgICAgICAgICAgICAgICAoZGVsZXRlLW92ZXJsYXkgbykpKSkKKyAgICAgICAgICAo KGFuZCAobm90IChlcSBuYW1lICdmYWNlKSkKKyAgICAgICAgICAgICAgICAoZXF1YWwtaW5jbHVk aW5nLXByb3BlcnRpZXMgKG92ZXJsYXktZ2V0IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIChk ZWxldGUtb3ZlcmxheSBvKSkpKSkpKQorCisoZGVmdW4gKy1kZWxldGUtcGFyZW5zLW92ZXJsYXlz ICgpCisgICh3aGVuICstcGFyZW5zLW92ZXJsYXlzLWV4aXN0LXAKKyAgICAoZG9saXN0IChmYWNl ICcoKy1wYXJlbnMtb25lLWZhY2UKKyAgICAgICAgICAgICAgICAgICAgKy1wYXJlbnMtdHdvLWZh Y2UKKyAgICAgICAgICAgICAgICAgICAgKy1wYXJlbnMtdGhyZWUtZmFjZQorICAgICAgICAgICAg ICAgICAgICArLXBhcmVucy1mb3VyLWZhY2UKKyAgIC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lsCisg IDpnbG9iYWwgbmlsCisgIDpncm91cCAnZmMtbW9kZQorICAoY29uZAorICAgIDs7OyBgKy1tb2Rl JyBoYXMgdGhlIGFiaWxpdHkgdG8gYWxzbyBkaXNwbGF5IGEgZmlsbCBjb2x1bW4gaW5kaWNhdG9y LgorICAgIDs7OyBTZWUgdGhlIHZhcmlhYmxlIGArLWZpbGwtY29sdW1uJy4KKyAgICAoKGFuZCBm Yy1tb2RlICstbW9kZSkKKyAgICAgIChzZXRxIGZjLW1vZGUgbmlsKQorICAgICAgKG1lc3NhZ2Ug IlR1cm5lZCBPRkYgYGZjLW1vZGUnICglcykgLS0gc2VlIHRoZSB2YXJpYWJsZSBgKy1maWxsLWNv bHVtbicuIiAoY3VycmVudC1idWZmZXIpKSkKKyAgICAoZmMtbW9kZQorICAgICAgKHdoZW4gKGFu ZCBnbG9iYWwtZWxkb2MtbW9kZQorICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZl bHktcCAnYW55KQorICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICco NCkpKQorICAgICAgICAoZ2xvYmFsLWVsZG9jLW1vZGUgLTEpKQorICAgICAgKHdoZW4gKGFuZCBq aXQtbG9jay1jb250ZXh0LXRpbWVyCisgICAgICAgICAgICAgICAgIChjYWxsZWQtaW50ZXJhY3Rp dmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcg Jyg0KSkpCisgICAgICAgICh3aGVuICh0aW1lcnAgaml0LWxvY2stY29udGV4dC10aW1lcikKKyAg ICAgICAgICAoY2FuY2VsLXRpbWVyIGppdC1sb2NrLWNvbnRleHQtdGltZXIpKQorICAgICAgICA7 OyAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIChydW4td2l0aC1pZGxlLXRpbWVyIDUuMCAn cmVwZWF0ICdqaXQtbG9jay1jb250ZXh0LWZvbnRpZnkpKQorICAgICAgICAoc2V0cSBqaXQtbG9j ay1jb250ZXh0LXRpbWVyIG5pbCkpCisgICAgICAod2hlbiAoYW5kIChjYWxsZWQtaW50ZXJhY3Rp dmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcg Jyg0KSkpCisgICAgICAgICh3aGVuICh0aW1lcnAgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnkt dGltZXIpCisgICAgICAgICAgKGNhbmNlbC10aW1lciB1bmRvLWF1dG8tY3VycmVudC1ib3VuZGFy eS10aW1lcikpCisgICAgICAgIChmc2V0ICd1bmRvLWF1dG8tLXVuZG9hYmxlLWNoYW5nZQorICAg ICAgICAgICAgICAobGFtYmRhICgpIChhZGQtdG8tbGlzdCAndW5kby1hdXRvLS11bmRvYWJseS1j aGFuZ2VkLWJ1ZmZlcnMgKGN1cnJlbnQtYnVmZmVyKSkpKQorICAgICAgICAoZnNldCAndW5kby1h dXRvLWFtYWxnYW1hdGUgJ2lnbm9yZSkpCisgICAgICAod2hlbiBibGluay1jdXJzb3ItbW9kZQor ICAgICAgICAoYmxpbmstY3Vyc29yLW1vZGUgLTEpCisgICAgICAgICh3aGVuIChtZW1xICdibGlu ay1jdXJzb3ItY2hlY2sgcG9zdC1jb21tYW5kLWhvb2spCisgICAgICAgICAgKHJlbW92ZS1ob29r ICdwb3N0LWNvbW1hbmQtaG9vayAnYmxpbmstY3Vyc29yLWNoZWNrKSkpCisgICAgICAoc2V0cSBm Yy12aXNpYmxlIHQpCisgICAgICA7OzsgYGF1dG8tY29tcG9zaXRpb24tbW9kZScgaXMgbmVlZGVk IGZvciBjcm9zc2hhaXJzIHRvIHByb3Blcmx5IGNhbGN1bGF0ZQorICAgICAgOzs7IGNvb3JkaW5h dGVzIG9mIGNvbXBvc2l0aW9uIGNoYXJhY3RlcnMuICBBdXRvbWF0aWNhbGx5IGJlY29tZXMgcGVy bWFuZW50bHkKKyAgICAgIDs7OyBidWZmZXItbG9j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KSkKKyAgIkZhY2UgZm9yIGArLXJldmVyc2VkLWJhci1hdC16di1m YWNlJy4iCisgIDpncm91cCAnKy1tb2RlKQorCisoZGVmZmFjZSArLXJldmVyc2VkLWJhci1wb3N0 LXp2LWZhY2UKKyAgJygodCAoOmZvcmVncm91bmQgImN5YW40IikpKQorICAiRmFjZSBmb3IgYCst cmV2ZXJzZWQtYmFyLXBvc3QtenYtZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZh Y2UgKy1ldmVuLXByZS16di1mYWNlCisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4 KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgInllbGxvdyIpCisgICAgKCgo Y2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpm b3JlZ3JvdW5kICJjeWFuMSIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDE2KSAo YmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgInllbGxvdyIpCisgICAgKCgoY2xh c3MgY29sb3IpIChtaW4tY29sb3JzIDE2KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3Jl Z3JvdW5kICJjeWFuMSIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDgpKQorICAg ICA6Zm9yZWdyb3VuZCAid2hpdGUiKQorICAgICgoKHR5cGUgdHR5KSAoY2xhc3MgbW9ubykpCisg ICAgIDppbnZlcnNlLXZpZGVvIHQpCisgICAgKHQgOmZvcmVncm91bmQgInBpbmsiKSkKKyAgIkZh Y2UgZm9yIGArLWV2ZW4tcHJlLXp2LWZhY2UnLiIKKyAgOmdyb3VwICcrLW1vZGUpCisKKyhkZWZm YWNlICstZXZlbi1pbmFjdGl2ZS1wcmUtenYtZmFjZQorICAnKCgoKGNsYXNzIGNvbG9yKSAobWlu LWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICIjZWVlOGFh IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgODgpIChiYWNrZ3JvdW5kIGxpZ2h0 KSkKKyAgICAgOmZvcmVncm91bmQgImJsdWUxIikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1j b2xvcnMgMTYpIChiYWNrZ3JvdW5kIGRhcmspKQorICAgICA6Zm9yZWdyb3VuZCAiI2VlZThhYSIp CisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDE2KSAoYmFja2dyb3VuZCBsaWdodCkp CisgICAgIDpmb3JlZ3JvdW5kICJibHVlMSIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29s b3JzIDgpKQorICAgICA6Zm9yZWdyb3VuZCAid2hpdGUiKQorICAgICgoKHR5cGUgdHR5KSAoY2xh c3MgbW9ubykpCisgICAgIDppbnZlcnNlLXZpZGVvIHQpCisgICAgKHQgOmZvcmVncm91bmQgInBp bmsiKSkKKyAgIkZhY2UgZm9yIGArLWV2ZW4taW5hY3RpdmUtcHJlLXp2LWZhY2UnLiIKKyAgOmdy b3VwICcrLW1vZGUpCisKKyhkZWZmYWNlICstZXZlbi1hdC16di1mYWNlCisgICcoKCgoY2xhc3Mg Y29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91 bmQgImZpcmVicmljazQiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJh Y2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3VuZCAiZmlyZWJyaWNrNCIpCisgICAgKCgo Y2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDE2KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZv cmVncm91bmQgImZpcmVicmljazQiKQorICAgICgoKGNsYXNzI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aWdodCkpCisgICAgIDpm b3JlZ3JvdW5kICJSb3lhbEJsdWUiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAx NikgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJEYXJrT2xpdmVHcmVlbjQi KQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQp KQorICAgICA6Zm9yZWdyb3VuZCAiUm95YWxCbHVlIikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1p bi1jb2xvcnMgOCkpCisgICAgIDpmb3JlZ3JvdW5kICJ3aGl0ZSIpCisgICAgKCgodHlwZSB0dHkp IChjbGFzcyBtb25vKSkKKyAgICAgOmludmVyc2UtdmlkZW8gdCkKKyAgICAodCA6Zm9yZWdyb3Vu ZCAicGluayIpKQorICAiRmFjZSBmb3IgYCstZXZlbi1pbmFjdGl2ZS1wb3N0LXp2LWZhY2UnLiIK KyAgOmdyb3VwICcrLW1vZGUpCisKKyhkZWZmYWNlICstb2RkLXByZS16di1mYWNlCisgICcoKCgo Y2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZv cmVncm91bmQgInJlZDEiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJh Y2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3VuZCAicmVkMSIpCisgICAgKCgoY2xhc3Mg Y29sb3IpIChtaW4tY29sb3JzIDE2KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91 bmQgInJlZDEiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91 bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3VuZCAicmVkMSIpCisgICAgKCgoY2xhc3MgY29sb3Ip IChtaW4tY29sb3JzIDgpKQorICAgIC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gYCst b2RkLXBvc3QtenYtZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1vZGQt aW5hY3RpdmUtcG9zdC16di1mYWNlCisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4 KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTQiKQorICAgICgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6 Zm9yZWdyb3VuZCAic2llbm5hNCIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDE2 KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTQiKQorICAgICgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6 Zm9yZWdyb3VuZCAic2llbm5hNCIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDgp KQorICAgICA6Zm9yZWdyb3VuZCAid2hpdGUiKQorICAgICgoKHR5cGUgdHR5KSAoY2xhc3MgbW9u bykpCisgICAgIDppbnZlcnNlLXZpZGVvIHQpCisgICAgKHQgOmZvcmVncm91bmQgInBpbmsiKSkK KyAgIkZhY2UgZm9yIGArLW9kZC1pbmFjdGl2ZS1wb3N0LXp2LWZhY2UnLiIKKyAgOmdyb3VwICcr LW1vZGUpCisKKyhkZWZmYWNlICstcG9zdC1maWxsLXByZS16di1mYWNlCisgICcoKCgoY2xhc3Mg Y29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91 bmQgImdyZWVuMSIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dy b3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJncmVlb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3NyYy9idWZmZXIuYwpAQCAtMTMzLDYgKzEzMyw2OSBAQCBDSEVDS19P VkVSTEFZIChMaXNwX09iamVjdCB4KQogCiAvKiBUaGVzZSBzZXR0ZXJzIGFyZSB1c2VkIG9ubHkg aW4gdGhpcyBmaWxlLCBzbyB0aGV5IGNhbiBiZSBwcml2YXRlLgogICAgVGhlIHB1YmxpYyBzZXR0 ZXJzIGFyZSBpbmxpbmUgZnVuY3Rpb25zIGRlZmluZWQgaW4gYnVmZmVyLmguICAqLworCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCitz dGF0aWMgdm9pZAorYnNldF9tY19yZWFsX2Zha2VfY3Vyc29yIChzdHJ1Y3QgYnVmZmVyICpiLCBM aXNwX09iamVjdCB2YWwpCit7CisgIGItPm1jX3JlYWxfZmFrZV9jdXJzb3JfID0gdmFsOworfQor CitzdGF0aWMgdm9pZAorYnNldF9tY19jb25mIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVj dCB2YWwpCit7CisgIGItPm1jX2NvbmZfID0gdmFsOworfQorCitzdGF0aWMgdm9pZAorYnNldF9t Y19pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7 CisgIGItPm1jX2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQorCitzdGF0aWMgdm9pZAorYnNl dF9jcm9zc2hhaXJzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7CisgIGIt PmNyb3NzaGFpcnNfID0gdmFsOworfQorCitzdGF0aWMgdm9pZAorYnNldF9jaF9ob3Jpem9udGFs X3J1bGVyIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7CisgIGItPmNoX2hv cml6b250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ioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBYU0VURkFT VElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgbWNfcmVhbF9mYWtlX2N1cnNvciksIGlk eCk7ICsraWR4OworICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgbWNf Y29uZiksIGlkeCk7ICsraWR4OworICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9m bGFncywgbWNfaW5hY3RpdmVfd2luZG93cyksIGlkeCk7ICsraWR4OworICBYU0VURkFTVElOVCAo QlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgY3Jvc3NoYWlycyksIGlkeCk7ICsraWR4OworICBY U0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgY2hfaG9yaXpvbnRhbF9ydWxl ciksIGlkeCk7ICsraWR4OworICBYU0VURkFTVElOVCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFn cywgY2hfdmVydGljYWxfcnVsZXIpLCBpZHgpOyArK2lkeDsKKyAgWFNFVEZBU1RJTlQgKEJWQVIg KCZidWZmZXJfbG9jYWxfZmxhZ3MsIGNoX2luYWN0aXZlX3dpbmRvd3MpLCBpZHgpOyArK2lkeDsK KyAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIGZjX3Zpc2libGUpLCBp ZHgpOyArK2lkeDsKKyAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIGZj X2luYWN0aXZlX3dpbmRvd3MpLCBpZHgpOyArK2lkeDsKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogICBYU0VURkFTVElO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ZjX3Zpc2libGUg KCZidWZmZXJfZGVmYXVsdHMsIFFuaWwpOworICBic2V0X2ZjX2luYWN0aXZlX3dpbmRvd3MgKCZi dWZmZXJfZGVmYXVsdHMsIFF0KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBi c2V0X21vZGVfbGluZV9mb3JtYXQgKCZidWZmZXJfZGVmYXVsdHMsIGJ1aWxkX3B1cmVfY19zdHJp bmcgKCIlLSIpKTsKICAgYnNldF9oZWFkZXJfbGluZV9mb3JtYXQgKCZidWZmZXJfZGVmYXVsdHMs IFFuaWwpOwogICBic2V0X2FiYnJldl9tb2RlICgmYnVmZmVyX2RlZmF1bHRzLCBRbmlsKTsKQEAg LTU0NTgsNiArNTU1Nyw1MSBAQCBkZWZ2YXJfcGVyX2J1ZmZlciAoc3RydWN0IExpc3BfQnVmZmVy X09iamZ3ZCAqYm9fZndkLCBjb25zdCBjaGFyICpuYW1lc3RyaW5nLAogdm9pZAogc3ltc19vZl9i dWZmZXIgKHZvaWQpCiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKKyAgREVGU1lNIChRbWNfcmVhbF9mYWtlX2N1cnNvciwgIm1jLXJlYWwt ZmFrZS1jdXJzb3IiKTsKKyAgREVGVkFSX1BFUl9CVUZGRVIgKCJtYy1yZWFsLWZha2UtY3Vyc29y IiwgJkJWQVIgKGN1cnJlbnRfYnVmZmVyLCBtY19yZWFsX2Zha2VfY3Vyc29yKSwgUW5pbCwKKyAg ICBkb2M6IC8qIEEgYnVmZXItbG9jYWwgdmFyaWFibGUgdG8gc2V0IHRoZSBjdXJzb3IgdHlwZSBv ZiB0aGUgcmVhbCBmYWtlIGN1cnNvci4gKi8pOworCisgIERFRl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Y3RpdmUtd2luZG93Iik7CisgIERFRlZBUl9QRVJfQlVGRkVSICgiZmMtaW5h Y3RpdmUtd2luZG93cyIsICZCVkFSIChjdXJyZW50X2J1ZmZlciwgZmNfaW5hY3RpdmVfd2luZG93 cyksIFFuaWwsCisgICAgZG9jOiAvKiBXaGVuIG5vbi1uaWwsIGRyYXcgbXVsdGlwbGUgY3Vyc29y cyBmaWxsIGNvbHVtbiBpbiBpbmFjdGl2ZSB3aW5kb3dzLiAqLyk7CisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKICAgc3RhdGljcHJvICgmbGFzdF9vdmVybGF5X21vZGlmaWNhdGlvbl9o b29rcyk7CiAgIGxhc3Rfb3ZlcmxheV9tb2RpZmljYXRpb25faG9va3MgPSBtYWtlX25pbF92ZWN0 b3IgKDEwKTsKIApkaWZmIC0tZ2l0IGEvc3JjL2J1ZmZlci5oIGIvc3JjL2J1ZmZlci5oCmluZGV4 IGY0MmMzZTkuLjE4OWZhYzUgMTAwNjQ0Ci0tLSBhL3NyYy9idWZmZXIuaAorKysgYi9zcmMvYnVm ZmVyLmgKQEAgLTczNiw2ICs3MzYsNDAgQEAgc3RydWN0IGJ1ZmZlcgogICAgICBpbiB0aGUgZGlz cGxheSBvZiB0aGlzIGJ1ZmZlci4gICovCiAgIExpc3BfT2JqZWN0IGV4dHJhX2xpbmVfc3BhY2lu Z187CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKyAgLyogVGhlIGN1cnNvciB0eXBlIG9mIHRoZSByZWFsIGZha2UgY3Vyc29yLiAqLworICBM aXNwX09iamVjdCBtY19yZWFsX2Zha2VfY3Vyc29yXzsKKworICAvKiBUaGUgbmFtZSBvZiBsaXN0 IHVzZWQgYnkgbXVsdGlwbGUgY3Vyc29ycyBmb3IgbmV4dCByZWRpc3BsYXkuICovCisgIExpc3Bf T2JqZWN0IG1jX2NvbmZfOworCisgIC8qIFdoZXRoZXIgdG8gZHJhdyBtdWx0aXBsZSBjdXJzb3Jz IGluIGluYWN0aXZlIHdpbmRvd3MuICovCisgIExpc3BfT2JqZWN0IG1jX2luYWN0aXZlX3dpbmRv d3NfOworCisgIC8qIFRoZSBuYW1lIG9mIHRoZSBidWZmZXItbG9jYWwgdmFyaWFibGUuICovCisg IExpc3BfT2JqZWN0IGNyb3NzaGFpcnNfOworCisgIC8qIFRoZSBuYW1lIG9mIHRoZSBjcm9zc2hh aXJzIGhvcml6b250YWwgcnVsZXIuICovCisgIExpc3BfT2JqZWN0IGNoX2hvcml6b250YWxfcnVs ZXJfOworCisgIC8qIFRoZSBuYW1lIG9mIHRoZSBjcm9zc2hhaXJzIHZlcnRpY2FsIHJ1bGVyLiAq LworICBMaXNwX09iamVjdCBjaF92ZXJ0aWNhbF9ydWxlcl87CisKKyAgLyogV2hldGhlciB0byBk cmF3IGNyb3NzaGFpcnMgaW4gaW5hY3RpdmUgd2luZG93cy4gKi8KKyAgTGlzcF9PYmplY3QgY2hf aW5hY3RpdmVfd2luZG93c187CisKKyAgLyogVGhlIG5hbWUgb2YgdGhlIGJ1ZmZlci1sb2NhbCB2 YXJpYWJsZS4gKi8KKyAgTGlzcF9PYmplY3QgZmNfdmlzaWJsZV87CisKKyAgLyogV2hldGhlciB0 byBkcmF3IG11bHRpcGxlIGN1cnNvcnMgZmlsbCBjb2x1bW4gaW4gaW5hY3RpdmUgd2luZG93cy4g Ki8KKyAgTGlzcF9PYmplY3QgZmNfaW5hY3RpdmVfd2luZG93c187CisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKICAgLyogQ3Vyc29yIHR5cGUgdG8gZGlzcGxheSBpbiBub24tc2VsZWN0 ZWQgd2luZG93cy4KICAgICAgdCBtZWFucyB0byB1c2UgaG9sbG93IGJveCBjdXJzb3IuCiAgICAg IFNlZSBgY3Vyc29yLXR5cGUnIGZvciBvdGhlciB2YWx1ZXMuICAqLwpAQCAtNzg3LDE0ICs4MjEs MjEgQEAgc3RydWN0IGJ1ZmZlcgogICAgICBhbiBpbmRpcmVjdCBidWZmZXIgc2luY2UgaXQgY291 bnRzIGFzIGl0cyBiYXNlIGJ1ZmZlci4gICovCiAgIGludCB3aW5kb3dfY291bnQ7CiAKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgLyogQSBu b24temVybyB2YWx1ZSBpbiBzbG90IElEWCBtZWFucyB0aGF0IHBlci1idWZmZXIgdmFyaWFibGUK ICAgICAgd2l0aCBpbmRleCBJRFggaGFzIGEgbG9jYWwgdmFsdWUgaW4gdGhpcyBidWZmZXIuICBU aGUgaW5kZXggSURYCiAgICAgIGZvciBhIGJ1ZmZlci1sb2NhbCB2YXJpYWJsZSBpcyBzdG9yZWQg aW4gdGhhdCB2YXJpYWJsZSdzIHNsb3QKICAgICAgaW4gYnVmZmVyX2xvY2FsX2ZsYWdzIGFzIGEg TGlzcCBpbnRlZ2VyLiAgSWYgdGhlIGluZGV4IGlzIC0xLAogICAgICB0aGlzIG1lYW5zIHRoZSB2 YXJpYWJsZSBpcyBhbHdheXMgbG9jYWwgaW4gYWxsIGJ1ZmZlcnMuICAqLwotI2RlZmluZSBNQVhf UEVSX0JVRkZFUl9WQVJTIDUwCisjZGVmaW5lIE1BWF9QRVJfQlVGRkVSX1ZBUlMgNjAKICAgY2hh ciBsb2NhbF9mbGFnc1tNQVhfUEVSX0JVRkZFUl9WQVJTXTsKIAorLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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ioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogSU5MSU5FIHZvaWQKIGJzZXRfYmlkaV9wYXJhZ3JhcGhf ZGlyZWN0aW9uIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCiB7CmRpZmYgLS1n aXQgYS9zcmMvZGlzcGV4dGVybi5oIGIvc3JjL2Rpc3BleHRlcm4uaAppbmRleCAxYTUzNjU2Li5m MWJiZjFkIDEwMDY0NAotLS0gYS9zcmMvZGlzcGV4dGVybi5oCisrKyBiL3NyYy9kaXNwZXh0ZXJu LmgKQEAgLTEwMCw2ICsxMDAsMTE0IEBAIHR5cGVkZWYgaW50IEN1cnNvcjsKICNkZWZpbmUgTmF0 aXZlUmVjdGFuZ2xlIGludAogI2VuZGlmCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisv KiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKK3N0cnVjdCBnbHlwaDsKKworc3RydWN0IGds eXBoX3JvdzsKKworc3RydWN0IGdseXBoX21hdHJpeDsKKworZW51bSBkcmF3X2dseXBoc19mYWNl OworCitlbnVtIGdseXBoX3Jvd19hcmVhOworCitlbnVtIG1jX2NhY2hlX3R5cGU7CisKK2VudW0g bWNfY3Vyc29yX3R5cGU7CisKK2VudW0gbWNfZmxhdm9yOworCitzdHJ1Y3QgbWNfUkdCOworCitz dHJ1Y3QgbWNfZXNzZW50aWFsczsKKworZW51bSBtY19mcm9tX3doZXJlOworCitlbnVtIG1jX2Fj dGlvbl90eXBlOworCitlbnVtIG1jX3Jvd19wb3NpdGlvbjsKKworZXh0ZXJuIExpc3BfT2JqZWN0 IG1jX2xpc3RuIChwdHJkaWZmX3QsIExpc3BfT2JqZWN0LCAuLi4pOworCitleHRlcm4gTGlzcF9P YmplY3QgbWNfbnRoIChpbnQsIExpc3BfT2JqZWN0K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ZXJuIHZvaWQgbWNfZHJhd19mcmluZ2VfYml0bWFwIChzdHJ1Y3Qgd2luZG93ICosIHN0 cnVjdCBnbHlwaF9yb3cgKiwgaW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBlbnVtIG1jX2N1cnNvcl90eXBlKTsKKworZXh0ZXJuIGludCBtY19nZXRfZnJpbmdlX2JpdG1h cCAoc3RydWN0IHdpbmRvdyAqLCBMaXNwX09iamVjdCwgaW50LCBpbnQpOworCitleHRlcm4gdm9p ZCBtY19lbmdpbmUgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLCBzdHJ1 Y3QgZ2x5cGhfcm93ICosCisgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqLCBp bnQsIGludCwgaW50LCBpbnQsIGludCwgaW50LAorICAgICAgICAgICAgICAgICAgICAgICBlbnVt IG1jX2N1cnNvcl90eXBlLCBpbnQsIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwgaW50LAorICAgICAg ICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCLCBib29sLCBlbnVtIG1jX2FjdGlvbl90eXBl LCBib29sLAorICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2Zyb21fd2hlcmUsIGVudW0g bWNfY2FjaGVfdHlwZSk7CisKK2V4dGVybiB2b2lkIG1jX3NldF9lc3NlbnRpYWxzIChzdHJ1Y3Qg d2luZG93ICosIHN0cnVjdCBtY19lc3NlbnRpYWxzICopOworCitleHRlcm4gdm9pZCBtY19kcmF3 X3JvdyAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlw aF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKiwgaW50LCBp bnQsIGludCwgaW50LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosCisgICAgICAgICAgICAgICAgICAg ICAgICAgc3RydWN0IG1jX2Vzc2VudGlhbHMsIGVudW0gbWNfcm93X3Bvc2l0aW9uLCBib29sLAor ICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfZnJvbV93aGVyZSk7CisKK2V4dGVybiB2 b2lkIG1jX3JlZHJhd19yb3cgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAq LCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQsIGlu dCwgaW50LCBib29sLCBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UpOworCitleHRlcm4gdm9pZCBtY19y ZXNldF9jYWNoZSAoc3RydWN0IHdpbmRvdyAqKTsKKworZXh0ZXJuIHZvaWQgbWNfZHJhd19jdXJz b3JfZ2x5cGggKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKiwgZW51bSBkcmF3 X2dseXBoc19mYWNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCwgaW50 LCBpbnQsIHN0cnVjdCBtY19SR0IsIGVudW0gbWNfZmxhdm9yLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUsIGludCwgYm9vbCwgYm9vbCk7CisK K2V4dGVybiB2b2lkIG1jX2VyYXNlX2N1cnNvciAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5 cGhfbWF0cml4ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgaW50LCBpbnQsIGludCwgaW50LCBlbnVtIG1jX2ZsYXZvciwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSwgaW50KTsKKworZXh0ZXJuIHZvaWQg bWNfZHJhd19lcmFzZV9oeWJyaWQgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJp eCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgaW50LCBpbnQsIGludCwgaW50LCBpbnQsIGludCwgaW50LCBpbnQsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSwgaW50LCBzdHJ1Y3QgbWNf UkdCLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wsIGVudW0gbWNfZmxh dm9yLCBib29sKTsKKworZXh0ZXJuIHZvaWQgbWNfeF93cml0ZV9nbHlwaHMgKHN0cnVjdCB3aW5k b3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoICosIGVudW0gZ2x5cGhfcm93X2Fy ZWEsIGludCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQsIGludCwgc3RydWN0 IG1jX1JHQiwgZW51bSBtY19mbGF2b3IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ZW51bSBtY19jdXJzb3JfdHlwZSwgaW50LCBib29sLCBib29sLCBib29sKTsKKworZXh0ZXJuIHN0 cnVjdCBnbHlwaF9tYXRyaXggKiBtY19zYXZlX2dseXBoX21hdHJpeCAoc3RydWN0IGdseXBoX21h dHJpeCAqKTsKKworZXh0ZXJuIHZvaWQgbWNfcmVzdG9yZV9nbHlwaF9tYXRyaXggKHN0cnVjdCBn bHlwaF9tYXRyaXggKiwgc3RydWN0IGdseXBoX21hdHJpeCAqKTsKKworLyogZW5kIE1VTFRJUExF LUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC8qIFRleHQgY3Vyc29y IHR5cGVzLiAgKi8KIAogZW51bSB0ZXh0X2N1cnNvcl9raW5kcwpAQCAtMzgyLDYgKzQ5MCwyMiBA QCBzdHJ1Y3QgZ2x5cGhfc2xpY2UKIAogc3RydWN0IGdseXBoCiB7CisKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgaW50IHgsIHksIGhwb3Ms IHZwb3M7CisKKyAgaW50IHJlbGF0aXZlX3g7CisKKyAgYm9vbF9iZiB6dl9wIDogMTsKKworICBw dHJkaWZmX3QgYnl0ZXBvczsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBQ b3NpdGlvbiBmcm9tIHdoaWNoIHRoaXMgZ2x5cGggd2FzIGRyYXduLiAgSWYgYG9iamVjdCcgYmVs b3cgaXMgYQogICAgICBMaXNwIHN0cmluZywgdGhpcyBpcyBhbiBpbmRleCBpbnRvIHRoYXQgc3Ry aW5nLiAgSWYgaXQgaXMgYQogICAgICBidWZmZXIsIHRoaXMgaXMgYSBwb3NpdGlvbiBpbiB0aGF0 IGJ1ZmZlci4gIEluIGFkZGl0aW9uLCBzb21lCkBAIC0xMjQ4LDYgKzEzNzIsMjggQEAgZW51bSBk cmF3X2dseXBoc19mYWNlCiAKIHN0cnVjdCBnbHlwaF9zdHJpbmcKIHsKKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIGJvb2xfYmYgbGVm dF9vdmVyd3JpdHRlbl9wIDogMTsKKworICAgIGJvb2xfYmYgcmlnaHRfb3ZlcndyaXR0ZW5fcCA6 IDE7CisKKyAgICBib29sX2JmIHJlY3RhbmdsZV9udWtlZF9wIDogMTsKKworICAgIGJvb2xfYmYg YmFja2dyb3VuZF9udWtlZF9wIDogMTsKKworICAgIGVudW0gZHJhd19nbHlwaF9hY3Rpb24KKyAg ICB7CisgICAgICBNQ19EUkFXX0dMWVBILAorICAgICAgTUNfRVJBU0VfR0xZUEgKKyAgICB9IGFj dGlvbl90eXBlOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIFgtb3JpZ2lu IG9mIHRoZSBzdHJpbmcuICAqLwogICBpbnQgeDsKIApAQCAtMjIxNiw2ICsyMzYyLDE2IEBAIHN0 cnVjdCBjb21wb3NpdGlvbl9pdAogCiBzdHJ1Y3QgaXQKIHsKKworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBib29sX2JmIHp2X3AgOiAxOwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIFRoZSB3aW5kb3cgaW4gd2hpY2gg d2UgaXRlcmF0ZSBvdmVyIGN1cnJlbnRfYnVmZmVyIChvciBhIHN0cmluZykuICAqLwogICBMaXNw X09iamVjdCB3aW5kb3c7CiAgIHN0cnVjdCB3aW5kb3cgKnc7CkBAIC0yODEyLDYgKzI5NjgsMzIg QEAgdHlwZWRlZiB2b2lkICgqZnJhbWVfcGFybV9oYW5kbGVyKSAoc3RydWN0IGZyYW1lICosIExp c3BfT2JqZWN0LCBMaXNwX09iamVjdCk7CiAKIHN0cnVjdCByZ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qKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4g TVVMVElQTEUtQ1VSU09SUyAqLworCisgIHN0cnVjdCBnbHlwaHNfc2tpcHBlZAorICB7CisgICAg cHRyZGlmZl90IGFsbG9jYXRlZDsKKyAgICBwdHJkaWZmX3QgdXNlZDsKKyAgICBzdHJ1Y3Qgc2tp cHBlZF9pdGVtcworICAgICAgeworICAgICAgICBpbnQgeDsKKyAgICAgICAgaW50IGhwb3M7Cisg ICAgICAgIGJvb2wgZW5hYmxlZF9wOworICAgICAgfSAqc2tpcHBlZDsKKyAgfSBhcnJheV9nbHlw aHNfc2tpcHBlZDsKKworc3RhdGljIGJvb2wgdXBkYXRlX3dpbmRvd19saW5lIChzdHJ1Y3Qgd2lu ZG93ICosIGludCwgYm9vbCAqKTsKKworc3RhdGljIHZvaWQgdXBkYXRlX21hcmdpbmFsX2FyZWEg KHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGVudW0gZ2x5cGhfcm93X2FyZWEsIGludCk7CisKK3N0YXRpYyB2b2lk IG1ha2VfY3VycmVudCAoc3RydWN0IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4 ICosIGludCk7CisKK3N0YXRpYyBib29sIHJvd19lcXVhbF9wIChzdHJ1Y3QgZ2x5cGhfcm93ICos IHN0cnVjdCBnbHlwaF9yb3cgKiwgYm9vbCk7CisKK3N0YXRpYyB2b2lkIGFzc2lnbl9yb3cgKHN0 cnVjdCBnbHlwaF9yb3cgKiwgc3RydWN0IGdseXBoX3JvdyAqKTsKKworc3RydWN0IG1jX3Jvd19l bnRyeQoreworICBpbnQgb2xkX3VzZXMsIG5ld191c2VzOworICBpbnQgbmV3X2xpbmVfbnVtYmVy OworICBwdHJkaWZmX3QgYnVja2V0OworICB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QorICAgIHsKKyAgICAgIC8q IFVwIChyb3RhdGUgbGVmdCwgaS5lLiB0b3dhcmRzIGxvd2VyIGluZGljZXMpLiAqLworICAgICAg YnkgPSAtYnk7CisgICAgICBtY19yZXZlcnNlX3Zwb3MgKG1hdHJpeCwgZmlyc3QsIGZpcnN0ICsg YnkpOworICAgICAgbWNfcmV2ZXJzZV92cG9zIChtYXRyaXgsIGZpcnN0ICsgYnksIGxhc3QpOwor ICAgICAgbWNfcmV2ZXJzZV92cG9zIChtYXRyaXgsIGZpcnN0LCBsYXN0KTsKKyAgICB9CisgICAg ZWxzZSBpZiAoYnkgPiAwKQorICAgICAgeworICAgICAgICAvKiBEb3duIChyb3RhdGUgcmlnaHQs IGkuZS4gdG93YXJkcyBoaWdoZXIgaW5kaWNlcykuICovCisgICAgICAgIG1jX3JldmVyc2VfdnBv cyAobWF0cml4LCBsYXN0IC0gYnksIGxhc3QpOworICAgICAgICBtY19yZXZlcnNlX3Zwb3MgKG1h dHJpeCwgZmlyc3QsIGxhc3QgLSBieSk7CisgICAgICAgIG1jX3JldmVyc2VfdnBvcyAobWF0cml4 LCBmaXJzdCwgbGFzdCk7CisgICAgICB9Cit9CisKK3N0cnVjdCBtY19tYXRyaXgKK21jX3NhdmVf Y2FjaGVfbWF0cml4IChzdHJ1Y3QgbWNfbWF0cml4IG1hdHJpeCkKK3sKKyAgLy8gc3RydWN0IG1j X21hdHJpeCBzYXZlZCA9IHh6YWxsb2MgKHNpemVvZiBzYXZlZCk7CisgIHN0cnVjdCBtY19tYXRy aXggc2F2ZWQ7CisgIHNhdmVkLnZwb3NfYWxsb2NhdGVkID0gbWF0cml4LnZwb3NfYWxsb2NhdGVk OworICBzYXZlZC52cG9zX3VzZWQgPSBtYXRyaXgudnBvc191c2VkOworICBzYXZlZC52cG9zID0g eHphbGxvYyAoc2F2ZWQudnBvc191c2VkICogc2l6ZW9mICpzYXZlZC52cG9zKTsKKyAgc2F2ZWQu Y3Vyc29yc191c2VkW05PX0NBQ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7CisgICAgICBtZW1jcHkgKHRv LT5nbHlwaHNbVEVYVF9BUkVBXSwgZnJvbS0+Z2x5cGhzW1RFWFRfQVJFQV0sIG5ieXRlcyk7Cisg ICAgICB0by0+dXNlZFtURVhUX0FSRUFdID0gZnJvbS0+dXNlZFtURVhUX0FSRUFdOworICAgICAg dG8tPmhhc2ggPSBmcm9tLT5oYXNoOworICAgICAgdG8tPnggPSBmcm9tLT54OworICAgICAgdG8t PnkgPSBmcm9tLT55OworICAgICAgdG8tPnBpeGVsX3dpZHRoID0gZnJvbS0+cGl4ZWxfd2lkdGg7 CisgICAgICB0by0+YXNjZW50ID0gZnJvbS0+YXNjZW50OworICAgICAgdG8tPmhlaWdodCA9IGZy b20tPmhlaWdodDsKKyAgICAgIHRvLT5waHlzX2FzY2VudCA9IGZyb20tPnBoeXNfYXNjZW50Owor ICAgICAgdG8tPnBoeXNfaGVpZ2h0ID0gZnJvbS0+cGh5c19oZWlnaHQ7CisgICAgICB0by0+dmlz aWJsZV9oZWlnaHQgPSBmcm9tLT52aXNpYmxlX2hlaWdodDsKKyAgICAgIHRvLT5leHRyYV9saW5l X3NwYWNpbmcgPSBmcm9tLT5leHRyYV9saW5lX3NwYWNpbmc7CisgICAgICB0by0+c3RhcnQgPSBm cm9tLT5zdGFydDsKKyAgICAgIHRvLT5lbmQgPSBmcm9tLT5lbmQ7CisgICAgICB0by0+bWlucG9z ID0gZnJvbS0+bWlucG9zOworICAgICAgdG8tPm1heHBvcyA9IGZyb20tPm1heHBvczsKKyAgICAg IHRvLT5vdmVybGF5X2Fycm93X2JpdG1hcCA9IGZyb20tPm92ZXJsYXlfYXJyb3dfYml0bWFwOwor ICAgICAgdG8tPmxlZnRfdXNlcl9mcmluZ2VfYml0bWFwID0gZnJvbS0+bGVmdF91c2VyX2ZyaW5n ZV9iaXRtYXA7CisgICAgICB0by0+cmlnaHRfdXNlcl9mcmluZ2VfYml0bWFwID0gZnJvbS0+cmln aHRfdXNlcl9mcmluZ2VfYml0b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yAgc3RydWN0IG1jX3Jvd19lbnRyeSAqZW50cnk7CisgIC8vIHN0cnVjdCByZWRpc3BsYXlf aW50ZXJmYWNlICpyaWYgPSBGUkFNRV9SSUYgKFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSkpOwor ICAvKiBTa2lwIG92ZXIgcm93cyBlcXVhbCBhdCB0aGUgc3RhcnQuICovCisgIGZvciAoaSA9IGhl YWRlcl9saW5lX3A7IGkgPCBjdXJyZW50X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAgewor ICAgICAgc3RydWN0IGdseXBoX3JvdyAqZCA9IE1BVFJJWF9ST1cgKGRlc2lyZWRfbWF0cml4LCBp KTsKKyAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKmMgPSBNQVRSSVhfUk9XIChjdXJyZW50X21hdHJp eCwgaSk7CisgICAgICBpZiAoYy0+ZW5hYmxlZF9wCisgICAgICAgICAgJiYgZC0+ZW5hYmxlZF9w CisgICAgICAgICAgJiYgIWQtPnJlZHJhd19mcmluZ2VfYml0bWFwc19wCisgICAgICAgICAgJiYg Yy0+eSA9PSBkLT55CisgICAgICAgICAgJiYgTUFUUklYX1JPV19CT1RUT01fWSAoYykgPD0geWIK KyAgICAgICAgICAmJiBNQVRSSVhfUk9XX0JPVFRPTV9ZIChkKSA8PSB5YgorICAgICAgICAgICYm IHJvd19lcXVhbF9wIChjLCBkLCAxKSkKKyAgICAgICAgeworICAgICAgICAgIGFzc2lnbl9yb3cg KGMsIGQpOworICAgICAgICAgIGQtPmVuYWJsZWRfcCA9IGZhbHNlOworICAgICAgICB9CisgICAg ICBlbHNlCisgICAgICAgIGJyZWFrOworICAgIH0KKyNpZmRlZiBIQVZFX1hXSURHRVRTCisgIC8q IEN1cnJlbnRseSB0aGlzIHNlZW1zIG5lZWRlZCB0byBkZXRlY3QgeHdpZGdldCBtb3ZlbWVudCBy ZWxpYWJseS4gKi8KKyAgICByZXR1cm4gMDsKKyNlbmRpZgorICAvKiBHaXZlIHVwIGlmIHNvbWUg cm93cyBpbiB0aGUgZGVzaXJlZCBtYXRyaXggYXJlIG5vdCBlbmFibGVkLiAqLworICBpZiAoISBN QVRSSVhfUk9XX0VOQUJMRURfUCAoZGVzaXJlZF9tYXRyaXgsIGkpKQorICAgIHJldHVybiAtMTsK KyAgZmlyc3Rfb2xkID0gZmlyc3RfbmV3ID0gaTsKKyAgLyogU2V0IGxhc3RfbmV3IHRvIHRoZSBp bmRleCArIDEgb2YgdGhlIHJvdyB0aGF0IHJlYWNoZXMgdGhlCisgICAgIGJvdHRvbSBib3VuZGFy eSBpbiB0aGUgZGVzaXJlZCBtYXRyaXguICBHaXZlIHVwIGlmIHdlIGZpbmQgYQorICAgICBkaXNh YmxlZCByb3cgYmVmb3JlIHdlIHJlYWNoIHRoZSBib3R0b20gYm91bmRhcnkuICovCisgIGkgPSBm aXJzdF9uZXcgKyAxOworICB3aGlsZSAoaSA8IGRlc2lyZWRfbWF0cml4LT5ucm93cyAtIDEpCisg ICAgeworICAgICAgaW50IGJvdHRvbTsKKyAgICAgIGlmICghIE1BVFJJWF9ST1dfRU5BQkxFRF9Q IChkZXNpcmVkX21hdHJpeCwgaSkpCisgICAgICAgIHJldHVybiAwOworICAgICAgYm90dG9tID0g TUFUUklYX1JPV19CT1RUT01fWSAoTUFUUklYX1JPVyAoZGVzaXJlZF9tYXRyaXgsIGkpKTsKKyAg ICAgIGlmIChib3R0b20gPD0geWIpCisgICAgICAgICsraTsKKyAgICAgIGlmIChib3R0b20gPj0g eWIpCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgbGFzdF9uZXcgPSBpOworICAvKiBTZXQgbGFz dF9vbGQgdG8gdGhlIGluZGV4ICsgMSBvZiB0aGUgcm93IHRoYXQgcmVhY2hlcyB0aGUgYm90dG9t CisgICAgIGJvdW5kYXJ5IGluIHRoZSBjdXJyZW50IG1hdHJpeC4gIFdlIGRvbid0IGxvb2sgYXQg dGhlIGVuYWJsZWQKKyAgICAgZmxhZyBoZXJlIGJlY2F1c2Ugd2UgcGxhbiB0byByZXVzZSBwYXJ0 IG9mIHRoZSBkaXNwbGF5IGV2ZW4gaWYKKyAgICAgb3RoZXIgcGFydHMgYXJlIGRpc2FibGVkLiAq LworICBpID0gZmlyc3Rfb2xkICsgMTsKKyAgd2hpbGUgKGkgPCBjdXJyZW50X21hdHJpeC0+bnJv d3MgLSAxKQorICAgIHsKKyAgICAgIGludCBib3R0b20gPSBNQVRSSVhfUk9XX0JPVFRPTV9ZIChN QVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSkpOworICAgICAgaWYgKGJvdHRvbSA8PSB5YikK KyAgICAgICAgKytpOworICAgICAgaWYgKGJvdHRvbSA+PSB5YikKKyAgICAgICAgYnJlYWs7Cisg ICAgfQorICBsYXN0X29sZCA9IGk7CisgIC8qIFNraXAgb3ZlciByb3dzIGVxdWFsIGF0IHRoZSBi b3R0b20uICovCisgIGkgPSBsYXN0X25ldzsKKyAgaiA9IGxhc3Rfb2xkOworICB3aGlsZSAoaSAt IDEgPiBmaXJzdF9uZXcKKyAgICAgICAgICYmIGogLSAxID4gZmlyc3Rfb2xkCisgICAgICAgICAm JiBNQVRSSVhfUk9XX0VOQUJMRURfUCAoY3VycmVudF9tYXRyaXgsIGogLSAxKQorICAgICAgICAg JiYgKE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCBqIC0gMSktPnkKKyAgICAgICAgICAgICA9 PSBNQVRSSVhfUk9XIChkZXNpcmVkX21hdHJpeCwgaSAtIDEpLT55KQorICAgICAgICAgJiYgIU1B VFJJWF9ST1cgKGRlc2lyZWRfbWF0cml4LCBpIC0gMSktPnJlZHJhd19mcmluZ2VfYml0bWFwc19w CisgICAgICAgICAmJiByb3dfZXF1YWxfcCAoTUFUUklYX1JPVyAoZGVzaXJlZF9tYXRyaXgsIGkg LSAxKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBNQVRSSVhfUk9XIChjdXJyZW50X21hdHJp eCwgaiAtIDEpLCAxKSkKKyAgICAtLWksIC0tajsKKyAgbGFzdF9uZXcgPSBpOworICBsYXN0X29s ZCA9IGo7CisgIC8qIE5vdGhpbmcgdG8gZG8gaWYgYWxsIHJvd3MgYXJlIGVxdWFsLiAqLworICBp ZiAobGFzdF9uZXcgPT0gZmlyc3RfbmV3KQorICAgIHJldHVybiAwOworICAvKiBDaGVjayBmb3Ig aW50ZWdlciBvdmVyZmxvdyBpbiBzaXplIGNhbGN1bGF0aW9uLgorICAgICBJZiBuZXh0X2FsbW9z dF9wcmltZSBjaGVja3MgKE4pIGZvciBkaXZpc2liaWxpdHkgYnkgMi4uMTAsIHRoZW4KKyAgICAg aXQgY2FuIHJldHVybiBhdCBtb3N0IE4gKyAxMCwgZS5nLiwgbmV4dF9hbG1vc3RfcHJpbWUgKDEp ID09IDExLgorICAgICBTbywgc2V0IG5leHRfYWxtb3N0X3ByaW1lX2luY3JlbWVudF9tYXggdG8g MTAuCisgICAgIEl0J3MganVzdCBhIGNvaW5jaWRlbmNlIHRoYXQgbmV4dF9hbG1vc3RfcHJpbWVf aW5jcmVtZW50X21heCA9PQorICAgICBORVhUX0FMTU9TVF9QUklNRV9MSU1JVCAtIDEuICBJZiBO RVhUX0FMTU9TVF9QUklNRV9MSU1JVCB3ZXJlCisgICAgIDEzLCB0aGVuIG5leHRfYWxtb3N0X3By aW1lX2luY3JlbWVudF9tYXggd291bGQgYmUgMTQsIGUuZy4sCisgICAgIGJlY2F1c2UgbmV4dF9h bG1vc3RfcHJpbWUgKDExMykgd291bGQgYmUgMTI3LiAqLworICB7CisgICAgdmVyaWZ5IChORVhU X0FMTU9TVF9QUklNRV9MSU1JVCA9PSAxMSk7CisgICAgZW51bSB7IG5leHRfYWxtb3N0X3ByaW1l X2luY3JlbWVudF9tYXggPSAxMCB9OworICAgIHB0cmRpZmZfdCByb3dfdGFibGVfbWF4ID0KKyAg ICAgIChtaW4gKFBUUkRJRkZfTUFYLCBTSVpFX01BWCkgLyAoMyAqIHNpemVvZiAqbWNfcm93X3Rh YmxlKQorICAgICAgIC0gbmV4dF9hbG1vc3RfcHJpbWVfaW5jcmVtZW50X21heCk7CisgICAgcHRy ZGlmZl90IGN1cnJlbnRfbnJvd3NfbWF4ID0gcm93X3RhYmxlX21heCAtIGRlc2lyZWRfbWF0cml4 LT5ucm93czsKKyAgICBpZiAoY3VycmVudF9ucm93c19tYXggPCBjdXJyZW50X21hdHJpeC0+bnJv d3MpCisgICAgICBtZW1vcnlfZnVsbCAoU0laRV9NQVgpOworICB9CisgIC8qIFJlYWxsb2NhdGUg dmVjdG9ycywgdGFibGVzIGV0Yy4gaWYgbmVjZXNzYXJ5LiAqLworICBpZiAoY3VycmVudF9tYXRy aXgtPm5yb3dzID4gbWNfb2xkX2xpbmVzX3NpemUpCisgICAgbWNfb2xkX2xpbmVzID0geHBhbGxv YyAobWNfb2xkX2xpbmVzLCAmbWNfb2xkX2xpbmVzX3NpemUsCisgICAgICAgICAgICAgICAgICAg ICAgICAgY3VycmVudF9tYXRyaXgtPm5yb3dzIC0gbWNfb2xkX2xpbmVzX3NpemUsCisgICAgICAg ICAgICAgICAgICAgICAgICAgSU5UX01BWCwgc2l6ZW9mICptY19vbGRfbGluZXMpOworICBpZiAo ZGVzaXJlZF9tYXRyaXgtPm5yb3dzID4gbWNfbmV3X2xpbmVzX3NpemUpCisgICAgbWNfbmV3X2xp bmVzID0geHBhbGxvYyAobWNfbmV3X2xpbmVzLCAmbWNfbmV3X2xpbmVzX3NpemUsCisgICAgICAg ICAgICAgICAgICAgICAgICAgZGVzaXJlZF9tYXRyaXgtPm5yb3dzIC0gbWNfbmV3X2xpbmVzX3Np emUsCisgICAgICAgICAgICAgICAgICAgICAgICAgSU5UX01BWCwgc2l6ZW9mICptY19uZXdfbGlu ZXMpOworICBuID0gZGVzaXJlZF9tYXRyaXgtPm5yb3dzOworICBuICs9IGN1cnJlbnRfbWF0cml4 LT5ucm93czsKKyAgaWYgKG1jX3Jvd190YWJsZV9zaXplIDwgMyAqIG4pCisgICAgeworICAgICAg cHRyZGlmZl90IHNpemUgPSBuZXh0X2FsbW9zdF9wcmltZSAoMyAqIG4pOworICAgICAgbWNfcm93 X3RhYmxlID0geG5yZWFsbG9jIChtY19yb3dfdGFibGUsIHNpemUsIHNpemVvZiAqbWNfcm93X3Rh YmxlKTsKKyAgICAgIG1jX3Jvd190YWJsZV9zaXplID0gc2l6ZTsKKyAgICAgIG1lbXNldCAobWNf cm93X3RhYmxlLCAwLCBzaXplICogc2l6ZW9mICptY19yb3dfdGFibGUpOworICAgIH0KKyAgaWYg KG4gPiBtY19yb3dfZW50cnlfcG9vbF9zaXplKQorICAgIG1jX3Jvd19lbnRyeV9wb29sID0geHBh bGxvYyAobWNfcm93X2VudHJ5X3Bvb2wsICZtY19yb3dfZW50cnlfcG9vbF9zaXplLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgbiAtIG1jX3Jvd19lbnRyeV9wb29sX3NpemUsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAtMSwgc2l6ZW9mICptY19yb3dfZW50cnlfcG9vbCk7 CisgIGlmIChkZXNpcmVkX21hdHJpeC0+bnJvd3MgPiBtY19ydW5zX3NpemUpCisgICAgeworICAg ICAgbWNfcnVucyA9IHhucmVhbGxvYyAobWNfcnVucywgZGVzaXJlZF9tYXRyaXgtPm5yb3dzLCBz aXplb2YgKm1jX3J1bnMpOworICAgICAgbWNfcnVuX3Bvb2wgPSB4bnJlYWxsb2MgKG1jX3J1bl9w b29sLCBkZXNpcmVkX21hdHJpeC0+bnJvd3MsIHNpemVvZiAqbWNfcnVuX3Bvb2wpOworICAgICAg bWNfcnVuc19zaXplID0gZGVzaXJlZF9tYXRyaXgtPm5yb3dzOworICAgIH0KKyAgbnJ1bnMgPSBy dW5faWR4ID0gMDsKKyAgbWNfcm93X2VudHJ5X2lkeCA9IDA7CisgIC8qIEFkZCByb3dzIGZyb20g dGhlIGN1cnJlbnQgYW5kIGRlc2lyZWQgbWF0cml4IHRvIHRoZSBoYXNoIHRhYmxlCisgICAgIHJv d19oYXNoX3RhYmxlIHRvIGJlIGFibGUgdG8gZmluZCBlcXVhbCBvbmVzIHF1aWNrbHkuICovCisg IGZvciAoaSA9IGZpcnN0X29sZDsgaSA8IGxhc3Rfb2xkOyArK2kpCisgICAgeworICAgICAgaWYg KE1BVFJJWF9ST1dfRU5BQkxFRF9QIChjdXJyZW50X21hdHJpeCwgaSkpCisgICAgICAgIHsKKyAg ICAgICAgICBlbnRyeSA9IG1jX2FkZF9yb3dfZW50cnkgKE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0 cml4LCBpKSk7CisgICAgICAgICAgbWNfb2xkX2xpbmVzW2ldID0gZW50cnk7CisgICAgICAgICAg KytlbnRyeS0+b2xkX3VzZXM7CisgICAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgICAgbWNfb2xk X2xpbmVzW2ldID0gTlVMTDsKKyAgICB9CisgIGZvciAoaSA9IGZpcnN0X25ldzsgaSA8IGxhc3Rf bmV3OyArK2kpCisgICAgeworICAgICAgZWFzc2VydCAoTUFUUklYX1JPV19FTkFCTEVEX1AgKGRl c2lyZWRfbWF0cml4LCBpKSk7CisgICAgICBlbnRyeSA9IG1jX2FkZF9yb3dfZW50cnkgKE1BVFJJ WF9ST1cgKGRlc2lyZWRfbWF0cml4LCBpKSk7CisgICAgICArK2VudHJ5LT5uZXdfdXNlczsKKyAg ICAgIGVudHJ5LT5uZXdfbGluZV9udW1iZXIgPSBpOworICAgICAgbWNfbmV3X2xpbmVzW2ldID0g ZW50cnk7CisgICAgfQorICAvKiBJZGVudGlmeSBtb3ZlcyBiYXNlZCBvbiBsaW5lcyB0aGF0IGFy ZSB1bmlxdWUgYW5kIGVxdWFsCisgICAgIGluIGJvdGggbWF0cmljZXMuICovCisgIGZvciAoaSA9 IGZpcnN0X29sZDsgaSA8IGxhc3Rfb2xkOykKKyAgICBpZiAobWNfb2xkX2xpbmVzW2ldCisgICAg ICAgICYmIG1jX29sZF9saW5lc1tpXS0+b2xkX3VzZXMgPT0gMQorICAgICAgICAmJiBtY19vbGRf bGluZXNbaV0tPm5ld191c2VzID09IDEpCisgICAgICB7CisgICAgICAgIGludCBwLCBxOworICAg ICAgICBpbnQgbmV3X2xpbmUgPSBtY19vbGRfbGluZXNbaV0tPm5ld19saW5lX251bWJlcjsKKyAg ICAgICAgc3RydWN0IHJ1biAqcnVuID0gbWNfcnVuX3Bvb2wgKyBydW5faWR4Kys7CisgICAgICAg IC8qIFJlY29yZCBtb3ZlLiAqLworICAgICAgICBydW4tPmN1cnJlbnRfdnBvcyA9IGk7CisgICAg ICAgIHJ1bi0+Y3VycmVudF95ID0gTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIGkpLT55Owor ICAgICAgICBydW4tPmRlc2lyZWRfdnBvcyA9IG5ld19saW5lOworICAgICAgICBydW4tPmRlc2ly ZWRfeSA9IE1BVFJJWF9ST1cgKGRlc2lyZWRfbWF0cml4LCBuZXdfbGluZSktPnk7CisgICAgICAg IHJ1bi0+bnJvd3MgPSAxOworICAgICAgICBydW4tPmhlaWdodCA9IE1BVFJJWF9ST1cgKGN1cnJl bnRfbWF0cml4LCBpKS0+aGVpZ2h0OworICAgICAgICAvKiBFeHRlbmQgYmFja3dhcmQuICovCisg ICAgICAgIHAgPSBpIC0gMTsKKyAgICAgICAgcSA9IG5ld19saW5lIC0gMTsKKyAgICAgICAgd2hp bGUgKHAgPiBmaXJzdF9vbGQKKyAgICAgICAgICAgICAgICYmIHEgPiBmaXJzdF9uZXcKKyAgICAg ICAgICAgICAgICYmIG1jX29sZF9saW5lc1twXSA9PSBtY19uZXdfbGluZXNbcV0pCisgICAgICAg ICAgeworICAgICAgICAgICAgaW50IGggPSBNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgcCkt PmhlaWdodDsKKyAgICAgICAgICAgIC0tcnVuLT5jdXJyZW50X3Zwb3M7CisgICAgICAgICAgICAt LXJ1bi0+ZGVzaXJlZF92cG9zOworICAgICAgICAgICAgKytydW4tPm5yb3dzOworICAgICAgICAg ICAgcnVuLT5oZWlnaHQgKz0gaDsKKyAgICAgICAgICAgIHJ1bi0+ZGVzaXJlZF95IC09IGg7Cisg ICAgICAgICAgICBydW4tPmN1cnJlbnRfeSAtPSBoOworICAgICAgICAgICAgLS1wLCAtLXE7Cisg ICAgICAgICAgfQorICAgICAgICAvKiBFeHRlbmQgZm9yd2FyZC4gKi8KKyAgICAgICAgcCA9IGkg KyAxOworICAgICAgICBxID0gbmV3X2xpbmUgKyAxOworICAgICAgICB3aGlsZSAocCA8IGxhc3Rf b2xkCisgICAgICAgICAgICAgICAmJiBxIDwgbGFzdF9uZXcKKyAgICAgICAgICAgICAgICYmIG1j X29sZF9saW5lc1twXSA9PSBtY19uZXdfbGluZXNbcV0pCisgICAgICAgICAgeworICAgICAgICAg ICAgaW50IGggPSBNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgcCktPmhlaWdodDsKKyAgICAg ICAgICAgICsrcnVuLT5ucm93czsKKyAgICAgICAgICAgIHJ1bi0+aGVpZ2h0ICs9IGg7CisgICAg ICAgICAgICArK3AsICsrcTsKKyAgICAgICAgICB9CisgICAgICAgIC8qIEluc2VydCBydW4gaW50 byBsaXN0IG9mIGFsbCBydW5zLiAgT3JkZXIgcnVucyBieSBjb3BpZWQKKyAgICAgICAgICAgcGl4 ZWwgbGluZXMuICBOb3RlIHRoYXQgd2UgcmVjb3JkIHJ1bnMgdGhhdCBkb24ndCBoYXZlIHRvCisg ICAgICAgICAgIGJlIGNvcGllZCBiZWNhdXNlIHRoZXkgYXJlIGFscmVhZHkgaW4gcGxhY2UuICBU aGlzIGlzIGRvbmUKKyAgICAgICAgICAgYmVjYXVzZSB3ZSBjYW4gYXZvaWQgY2FsbGluZyB1cGRh dGVfd2luZG93X2xpbmUgaW4gdGhpcworICAgICAgICAgICBjYXNlLiAqLworICAgICAgICBmb3Ig KHAgPSAwOyBwIDwgbnJ1bnMgJiYgbWNfcnVuc1twXS0+aGVpZ2h0ID4gcnVuLT5oZWlnaHQ7ICsr cCkKKyAgICAgICAgICA7CisgICAgICAgIGZvciAocSA9IG5ydW5zOyBxID4gcDsgLS1xKQorICAg ICAgICAgIG1jX3J1bnNbcV0gPSBtY19ydW5zW3EgLSAxXTsKKyAgICAgICAgbWNfcnVuc1twXSA9 IHJ1bjsKKyAgICAgICAgKytucnVuczsKKyAgICAgICAgaSArPSBydW4tPm5yb3dzOworICAgICAg fQorICAgIGVsc2UKKyAgICAgICsraTsKKyAgLyogRG8gdGhlIG1vdmVzLiAgRG8gaXQgaW4gYSB3 YXkgdGhhdCB3ZSBkb24ndCBvdmVyd3JpdGUgc29tZXRoaW5nCisgICAgIHdlIHdhbnQgdG8gY29w eSBsYXRlciBvbi4gIFRoaXMgaXMgbm90IHNvbHZhYmxlIGluIGdlbmVyYWwKKyAgICAgYmVjYXVz ZSB0aGVyZSBpcyBvbmx5IG9uZSBkaXNwbGF5IGFuZCB3ZSBkb24ndCBoYXZlIGEgd2F5IHRvCisg ICAgIGV4Y2hhbmdlIGFyZWFzIG9uIHRoaXMgZGlzcGxheS4gIEV4YW1wbGU6CisgICAgICAgICAg Ky0tLS0tLS0tLS0tKyAgICAgICArLS0tLS0tLS0tLS0rCisgICAgICAgICAgfCAgICAgQSAgICAg fCAgICAgICB8ICAgICBCICAgICB8CisgICAgICAgICAgKy0tLS0tLS0tLS0tKyAgLS0+ICArLS0t LS0tLS0tLS0rCisgICAgICAgICAgfCAgICAgQiAgICAgfCAgICAgICB8ICAgICBBICAgICB8Cisg ICAgICAgICAgKy0tLS0tLS0tLS0tKyAgICAgICArLS0tLS0tLS0tLS0rCisgICAgIEluc3RlYWQs IHByZWZlciBiaWdnZXIgbW92ZXMsIGFuZCBpbnZhbGlkYXRlIG1vdmVzIHRoYXQgd291bGQKKyAg ICAgY29weSBmcm9tIHdoZXJlIHdlIGNvcGllZCB0by4gKi8KKyAgZm9yIChpID0gMDsgaSA8IG5y dW5zOyArK2kpCisgICAgaWYgKG1jX3J1bnNbaV0tPm5yb3dzID4gMCkKKyAgICAgIHsKKyAgICAg ICAgc3RydWN0IHJ1biAqciA9IG1jX3J1bnNbaV07CisgICAgICAgIGlmIChyLT5jdXJyZW50X3kg IT0gci0+ZGVzaXJlZF95KQorICAgICAgICAgIHsKKyAgICAgICAgICAgIC8vICBmcHJpbnRmIChz dGRlcnIsICIlczogIHItPmN1cnJlbnQvZGVzaXJlZF92cG9zICglZC8lZCkgfCByLT5jdXJyZW50 L2Rlc2lyZWRfeSAoJWQvJWQpXG4iLAorICAgICAgICAgICAgLy8gICAgICAgICAgIHItPmN1cnJl bnRfeSA8IHItPmRlc2lyZWRfeSA/ICLihpMiIDogIuKGkSIsCisgICAgICAgICAgICAvLyAgICAg ICAgICAgci0+Y3VycmVudF92cG9zLCByLT5kZXNpcmVkX3Zwb3MsIHItPmN1cnJlbnRfeSwgci0+ ZGVzaXJlZF95KTsKKyAgICAgICAgICAgIC8vICByaWYtPmNsZWFyX3dpbmRvd19tb3VzZV9mYWNl ICh3KTsKKyAgICAgICAgICAgIC8vICByaWYtPnNjcm9sbF9ydW5faG9vayAodywgcik7CisgICAg ICAgICAgfQorICAgICAgICAvKiBUcnVuY2F0ZSBydW5zIHRoYXQgY29weSB0byB3aGVyZSB3ZSBj b3BpZWQgdG8sIGFuZAorICAgICAgICAgICBpbnZhbGlkYXRlIHJ1bnMgdGhhdCBjb3B5IGZyb20g d2hlcmUgd2UgY29waWVkIHRvLiAqLworICAgICAgICBmb3IgKGogPSBucnVucyAtIDE7IGogPiBp OyAtLWopCisgICAgICAgICAgeworICAgICAgICAgICAgc3RydWN0IHJ1biAqcCA9IG1jX3J1bnNb al07CisgICAgICAgICAgICBib29sIHRydW5jYXRlZF9wID0gMDsKKyAgICAgICAgICAgIGlmIChw LT5ucm93cyA+IDAKKyAgICAgICAgICAgICAgICAmJiBwLT5kZXNpcmVkX3kgPCByLT5kZXNpcmVk X3kgKyByLT5oZWlnaHQKKyAgICAgICAgICAgICAgICAmJiBwLT5kZXNpcmVkX3kgKyBwLT5oZWln aHQgPiByLT5kZXNpcmVkX3kpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAo cC0+ZGVzaXJlZF95IDwgci0+ZGVzaXJlZF95KQorICAgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgICBwLT5ucm93cyA9IHItPmRlc2lyZWRfdnBvcyAtIHAtPmRlc2lyZWRfdnBv czsKKyAgICAgICAgICAgICAgICAgICAgcC0+aGVpZ2h0ID0gci0+ZGVzaXJlZF95IC0gcC0+ZGVz aXJlZF95OworICAgICAgICAgICAgICAgICAgICB0cnVuY2F0ZWRfcCA9IDE7CisgICAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgICBpbnQgbnJvd3NfY29waWVkID0gKHItPmRlc2lyZWRfdnBvcyArIHIt Pm5yb3dzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBwLT5kZXNp cmVkX3Zwb3MpOworICAgICAgICAgICAgICAgICAgICBpZiAocC0+bnJvd3MgPD0gbnJvd3NfY29w aWVkKQorICAgICAgICAgICAgICAgICAgICAgIHAtPm5yb3dzID0gMDsKKyAgICAgICAgICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICAgICAgICAgIGludCBoZWlnaHRfY29waWVkID0gKHItPmRlc2lyZWRfeSArIHItPmhlaWdodAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIHAtPmRlc2ly ZWRfeSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmN1cnJlbnRfdnBvcyArPSBucm93 c19jb3BpZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmRlc2lyZWRfdnBvcyArPSBu cm93c19jb3BpZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPm5yb3dzIC09IG5yb3dz X2NvcGllZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcC0+Y3VycmVudF95ICs9IGhlaWdo dF9jb3BpZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmRlc2lyZWRfeSArPSBoZWln aHRfY29waWVkOworICAgICAgICAgICAgICAgICAgICAgICAgICBwLT5oZWlnaHQgLT0gaGVpZ2h0 X2NvcGllZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ1bmNhdGVkX3AgPSAxOworICAg ICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICB9CisgICAgICAgICAgICBpZiAoci0+Y3VycmVudF95ICE9IHItPmRlc2lyZWRfeQorICAgICAg ICAgICAgICAgIC8qIFRoZSBjb25kaXRpb24gYmVsb3cgaXMgZXF1aXZhbGVudCB0bworICAgICAg ICAgICAgICAgICAgICgocC0+Y3VycmVudF95ID49IHItPmRlc2lyZWRfeQorICAgICAgICAgICAg ICAgICAgICAgJiYgcC0+Y3VycmVudF95IDwgci0+ZGVzaXJlZF95ICsgci0+aGVpZ2h0KQorICAg ICAgICAgICAgICAgICAgICB8fCAocC0+Y3VycmVudF95ICsgcC0+aGVpZ2h0ID4gci0+ZGVzaXJl ZF95CisgICAgICAgICAgICAgICAgICAgICAgICAmJiAocC0+Y3VycmVudF95ICsgcC0+aGVpZ2h0 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPD0gci0+ZGVzaXJlZF95ICsgci0+aGVpZ2h0 KSkpCisgICAgICAgICAgICAgICAgICAgYmVjYXVzZSB3ZSBoYXZlIDAgPCBwLT5oZWlnaHQgPD0g ci0+aGVpZ2h0LiAqLworICAgICAgICAgICAgICAgICYmIHAtPmN1cnJlbnRfeSA8IHItPmRlc2ly ZWRfeSArIHItPmhlaWdodAorICAgICAgICAgICAgICAgICYmIHAtPmN1cnJlbnRfeSArIHAtPmhl aWdodCA+IHItPmRlc2lyZWRfeSkKKyAgICAgICAgICAgICAgcC0+bnJvd3MgPSAwOworICAgICAg ICAgICAgLyogUmVvcmRlciBydW5zIGJ5IGNvcGllZCBwaXhlbCBsaW5lcyBpZiB0cnVuY2F0ZWQu ICovCisgICAgICAgICAgICBpZiAodHJ1bmNhdGVkX3AgJiYgcC0+bnJvd3MgPiAwKQorICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgaW50IGsgPSBucnVucyAtIDE7CisgICAgICAgICAg ICAgICAgd2hpbGUgKG1jX3J1bnNba10tPm5yb3dzID09IDAgfHwgbWNfcnVuc1trXS0+aGVpZ2h0 IDwgcC0+aGVpZ2h0KQorICAgICAgICAgICAgICAgICAgay0tOworICAgICAgICAgICAgICAgIG1l bW1vdmUgKG1jX3J1bnMgKyBqLCBtY19ydW5zICsgaiArIDEsIChrIC0gaikgKiBzaXplb2YgKCpt Y19ydW5zKSk7CisgICAgICAgICAgICAgICAgbWNfcnVuc1trXSA9IHA7CisgICAgICAgICAgICAg IH0KKyAgICAgICAgICB9CisgICAgICAgIC8qIEFzc2lnbiBtYXRyaXggcm93cy4gKi8KKyAgICAg ICAgZm9yIChqID0gMDsgaiA8IHItPm5yb3dzOyArK2opCisgICAgICAgICAgeworICAgICAgICAg ICAgc3RydWN0IGdseXBoX3JvdyAqZnJvbSwgKnRvOworICAgICAgICAgICAgYm9vbCB0b19vdmVy bGFwcGVkX3A7CisgICAgICAgICAgICB0byA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCBy LT5kZXNpcmVkX3Zwb3MgKyBqKTsKKyAgICAgICAgICAgIGZyb20gPSBNQVRSSVhfUk9XIChkZXNp cmVkX21hdHJpeCwgci0+ZGVzaXJlZF92cG9zICsgaik7CisgICAgICAgICAgICB0b19vdmVybGFw cGVkX3AgPSB0by0+b3ZlcmxhcHBlZF9wOworICAgICAgICAgICAgZnJvbS0+cmVkcmF3X2ZyaW5n ZV9iaX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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XX0VO RF9CWVRFUE9TIChjdXJyZW50X3JvdyAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IC0xOworICBpbnQgbWF0cml4X3Jvd19zdGFydF9ieXRlcG9zID0gTUFUUklYX1JP V19TVEFSVF9CWVRFUE9TIChkZXNpcmVkX3Jvdyk7CisgIGludCBtYXRyaXhfcm93X2VuZF9ieXRl cG9zID0gTUFUUklYX1JPV19FTkRfQllURVBPUyAoZGVzaXJlZF9yb3cpOworICAvKiBUaGlzIHRl c3RzIGZvciBhIHNvbGl0YXJ5IHJvdyBjb250YWluaW5nIFpWLCBwcmVjZWRlZCBieSBhIHJvdyBj b250YWluaW5nIGEKKyAgcGVudWx0aW1hdGUgZ2x5cGggd2l0aCBhIGNoYXJwb3Mgb2YgWlYgLSAx IGZvbGxvd2VkIGJ5IGFuIGVuZCBvZiByb3cgc3BhY2UKKyAgZ2x5cGggd2l0aCBhIGNoYXJwb3Mg b2YgMC4gKi8KKyAgYm9vbCByb3dfYXRfenZfcCA9ICh2cG9zICE9IDAKKyAgICAgICAgICAgICAg ICAgICAgICAmJiAoY3VycmVudF9yb3cgLSAxKS0+dXNlZFtURVhUX0FSRUFdID4gMAorICAgICAg ICAgICAgICAgICAgICAgICYmIHByZXZfbWF0cml4X3Jvd19zdGFydF9ieXRlcG9zICE9IHByZXZf bWF0cml4X3Jvd19lbmRfYnl0ZXBvcworICAgICAgICAgICAgICAgICAgICAgICYmICEoY3VycmVu dF9yb3cgLSAxKS0+ZW5kc19hdF96dl9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgbWF0cml4 X3Jvd19zdGFydF9ieXRlcG9zID09IG1hdHJpeF9yb3dfZW5kX2J5dGVwb3MKKyAgICAgICAgICAg ICAgICAgICAgICAmJiBkZXNpcmVkX3Jvdy0+ZW5kc19hdF96dl9wKTsKKyAgLyogSWYgbGluZS1u dW1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AgIE9uIHRo ZSBvdGhlciBoYW5kLCB3ZSBuZWVkIG5vdGljZW92ZXJ3cml0dGVuX3RleHRfY3Vyc29yIGFzIGxv bmcKKyAgICAgICAgIGFzIG1vdXNlIGhpZ2hsaWdodGluZyBpcyBkb25lIGFzeW5jaHJvbm91c2x5 IG91dHNpZGUgb2YKKyAgICAgICAgIHJlZGlzcGxheS4gKi8KKyAgICAgIGlmICh2cG9zID09IHct PnBoeXNfY3Vyc29yLnZwb3MpCisgICAgICAgIHctPnBoeXNfY3Vyc29yX29uX3AgPSAwOworCisg IC8qIFRoZSBlbnRpcmUgcm93IHdhcyByZWRyYXduIGFib3ZlLCBzbyBhbGwgZmFrZSBjdXJzb3Jz IG11c3QgYmUgcmVkcmF3bi4gKi8KKyAgbWNfZHJhd19yb3cgKHcsIGRlc2lyZWRfbWF0cml4LCB1 cGRhdGVkX3JvdywgZGVzaXJlZF9yb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAgICAg ICAgZGVzaXJlZF9yb3ctPngsIGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0sIHZwb3MsIGJv dHRvbV92cG9zLAorICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93 X3Bvc2l0aW9uLCBkcmF3X3AsIFNDUklCRV9PTkUpOworICAgIH0KKyAgZWxzZQorICAgIHsKKyAg ICAgIGludCBzdG9wLCBpLCB4OworICAgICAgc3RydWN0IGdseXBoICpjdXJyZW50X2dseXBoID0g Y3VycmVudF9yb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgc3RydWN0IGdseXBoICpkZXNp cmVkX2dseXBoID0gZGVzaXJlZF9yb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgYm9vbCBv dmVybGFwcGluZ19nbHlwaHNfcCA9IGN1cnJlbnRfcm93LT5jb250YWluc19vdmVybGFwcGluZ19n bHlwaHNfcDsKKyAgICAgIGludCBkZXNpcmVkX3N0b3Bfc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ICFhYm9ydF9za2lwcGluZyk7CisgICAgICB9CisKKyAgICBpZiAo Y2FuX3NraXBfcCkKKyAgICAgIHsKKyAgICAgICAgaW50IHN0YXJ0X2hwb3MgPSBpOworCisgICAg ICAgIHdoaWxlIChpIDwgc3RvcAorICAgICAgICAgICAgICAgJiYgR0xZUEhfRVFVQUxfUCAoZGVz aXJlZF9nbHlwaCwgY3VycmVudF9nbHlwaCkpCisgICAgICAgICAgeworICAgICAgICAgICAgKyth cnJheV9nbHlwaHNfc2tpcHBlZC51c2VkOworICAgICAgICAgICAgaWYgKGFycmF5X2dseXBoc19z a2lwcGVkLmFsbG9jYXRlZCA8IGFycmF5X2dseXBoc19za2lwcGVkLnVzZWQpCisgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICBpbnQgb2xkX2FsbG9jID0gYXJyYXlfZ2x5cGhzX3NraXBw ZWQuYWxsb2NhdGVkOworICAgICAgICAgICAgICAgIGludCBuZXdfZWx0cyA9IGFycmF5X2dseXBo c19za2lwcGVkLnVzZWQgLSBhcnJheV9nbHlwaHNfc2tpcHBlZC5hbGxvY2F0ZWQ7CisgICAgICAg ICAgICAgICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZCA9CisgICAgICAgICAgICAgICAg ICB4cGFsbG9jIChhcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVkLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgJmFycmF5X2dseXBoc19za2lwcGVkLmFsbG9jYXRlZCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgIG5ld19lbHRzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgSU5U X01BWCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiAqYXJyYXlfZ2x5cGhzX3Nr aXBwZWQuc2tpcHBlZCk7CisgICAgICAgICAgICAgICAgbWVtc2V0IChhcnJheV9nbHlwaHNfc2tp cHBlZC5za2lwcGVkICsgb2xkX2FsbG9jLCAwLAorICAgICAgICAgICAgICAgICAgICAgICAgIChh cnJheV9nbHlwaHNfc2tpcHBlZC5hbGxvY2F0ZWQgLSBvbGRfYWxsb2MpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAqIHNpemVvZiAqYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZCk7Cisg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGludCBudGggPSBhcnJheV9nbHlwaHNfc2tpcHBl ZC51c2VkIC0gMTsKKyAgICAgICAgICAgIGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbbnRo XS54ID0geDsKKyAgICAgICAgICAgIGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbbnRoXS5o cG9zID0gaTsKKyAgICAgICAgICAgIGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbbnRoXS5l bmFibGVkX3AgPSB0cnVlOworICAgICAgICAgICAgeCArPSBkZXNpcmVkX2dseXBoLT5waXhlbF93 aWR0aDsKKyAgICAgICAgICAgICsrZGVzaXJlZF9nbHlwaCwgKytjdXJyZW50X2dseXBoLCArK2k7 CisgICAgICAgICAgfQorCisgICAgICAgIC8qIENvbnNpZGVyIHRoZSBjYXNlIHRoYXQgdGhlIGN1 cnJlbnQgcm93IGNvbnRhaW5zICJ4eHgKKyAgICAgcHBwIGdnZyIgaW4gaXRhbGljIENvdXJpZXIg Zm9udCwgYW5kIHRoZSBkZXNpcmVkIHJvdworICAgICBpcyAieHh4IGdnZyIuICBUaGUgY2hhcmFj dGVyIGBwJyBoYXMgbGJlYXJpbmcsIGBnJworICAgICBoYXMgbm90LiAgVGhlIGxvb3AgYWJvdmUg d2lsbCBzdG9wIGluIGZyb250IG9mIHRoZQorICAgICBmaXJzdCBgcCcgaW4gdGhlIGN1cnJlbnQg cm93LiAgSWYgd2Ugd291bGQgc3RhcnQKKyAgICAgd3JpdGluZyBnbHlwaHMgdGhlcmUsIHdlIHdv dWxkbid0IGVyYXNlIHRoZSBsYmVhcmluZworICAgICBvZiB0aGUgYHAnLiAgVGhlIHJlc3Qgb2Yg dGhlIGxiZWFyaW5nIHByb2JsZW0gaXMgdGhlbgorICAgICB0YWtlbiBjYXJlIG9mIGJ5IGRyYXdf Z2x5cGhzLiAqLworICAgICAgICBpZiAob3ZlcmxhcHBpbmdfZ2x5cGhzX3AKKyAgICAgICAgICAg ICYmIGkgPiAwCisgICAgICAgICAgICAmJiBpIDwgY3VycmVudF9yb3ctPnVzZWRbVEVYVF9BUkVB XQorICAgICAgICAgICAgJiYgKGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0gIT0gZGVzaXJl ZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSkpCisgICAgICAgICAgeworICAgICAgICAgICAgaW50IGxl ZnQsIHJpZ2h0OworICAgICAgICAgICAgcmlmLT5nZXRfZ2x5cGhfb3ZlcmhhbmdzIChjdXJyZW50 X2dseXBoLAorICAgICAgICAgICAgICAgICAgICBYRlJBTUUgKHctPmZyYW1lKSwKKyAgICAgICAg ICAgICAgICAgICAgJmxlZnQsICZyaWdodCk7CisgICAgICAgICAgICB3aGlsZSAobGVmdCA+IDAg JiYgaSA+IDApCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAtLWksIC0tZGVzaXJl ZF9nbHlwaCwgLS1jdXJyZW50X2dseXBoOworICAgICAgICAgICAgICAgIHggLT0gZGVzaXJlZF9n bHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgICAgbGVmdCAtPSBkZXNpcmVkX2dseXBo LT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgLyogQWJvcnQgdGhl IHNraXBwaW5nIGFsZ29yaXRobSBpZiB3ZSBlbmQgdXAgYmVmb3JlCisgICAgICAgICAgICAgICBv dXIgc3RhcnRpbmcgcG9pbnQsIHRvIGF2b2lkIGxvb3BpbmcgKGJ1ZyMxMDcwKS4KKyAgICAgICAg ICAgICAgIFRoaXMgY2FuIGhhcHBlbiB3aGVuIHRoZSBsYmVhcmluZyBpcyBsYXJnZXIgdGhhbgor ICAgICAgICAgICAgICAgdGhlIHBpeGVsIHdpZHRoLiAqLworICAgICAgICAgICAgYWJvcnRfc2tp cHBpbmcgPSAoaSA8IHN0YXJ0X2hwb3MpOworICAgICAgICAgIH0KKyAgICAgIH0KKworICAgIC8q IFRyeSB0byBhdm9pZCB3cml0aW5nIHRoZSBlbnRpcmUgcmVzdCBvZiB0aGUgZGVzaXJlZCByb3cK KyAgICAgICBieSBsb29raW5nIGZvciBhIHJlc3luYyBwb2ludC4gIFRoaXMgbWFpbmx5IHByZXZl bnRzCisgICAgICAgbW9kZSBsaW5lIGZsaWNrZXJpbmcgaW4gdGhlIGNhc2UgdGhlIG1vZGUgbGlu ZSBpcyBpbgorICAgICAgIGZpeGVkLXBpdGNoIGZvbnQsIHdoaWNoIGl0IHVzdWFsbHkgd2lsbCBi ZS4gKi8KKyAgICBpZiAoaSA8IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICB7 CisgICAgICAgIGludCBzdGFydF94ID0geCwgc3RhcnRfaHBvcyA9IGk7CisgICAgICAgIHN0cnVj dCBnbHlwaCAqc3RhcnQgPSBkZXNpcmVkX2dseXBoOworICAgICAgICBpbnQgY3VycmVudF94ID0g eDsKKyAgICAgICAgYm9vbCBza2lwX2ZpcnN0X3AgPSAhY2FuX3NraXBfcDsKKyAgICAgICAgLyog RmluZCB0aGUgbmV4dCBnbHlwaCB0aGF0J3MgZXF1YWwgYWdhaW4uICovCisgICAgICAgIHdoaWxl IChpIDwgc3RvcAorICAgICAgICAgICAgICAgJiYgKHNraXBfZmlyc3RfcAorICAgICAgICAgICAg ICAgICAgIHx8ICFHTFlQSF9FUVVBTF9QIChkZXNpcmVkX2dseXBoLCBjdXJyZW50X2dseXBoKSkK KyAgICAgICAgICAgICAgICYmIHggPT0gY3VycmVudF94KQorICAgICAgICAgIHsKKyAgICAgICAg ICAgIHggKz0gZGVzaXJ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yb3csIHRhcmdl dF9nbHlwaCwgeCwgMSwgdnBvcywKKyAgICAgICAgICAgICAgICAgICBib3R0b21fdnBvcywgY3Vy c29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBkcmF3X3AsIFNLSVBQRUQpOwor ICAgIH0KKworICAgICAgICBpZiAoaSA9PSBzdGFydF9ocG9zIHx8IHggIT0gY3VycmVudF94KQor ICAgICAgICAgIHsKKyAgICAgICAgICAgIGkgPSBzdGFydF9ocG9zOworICAgICAgICAgICAgeCA9 IHN0YXJ0X3g7CisgICAgICAgICAgICBkZXNpcmVkX2dseXBoID0gc3RhcnQ7CisgICAgICAgICAg ICBicmVhazsKKyAgICAgICAgICB9CisKKyAgICAgICAgb3V0cHV0X2N1cnNvcl90byAodywgdnBv cywgc3RhcnRfaHBvcywgZGVzaXJlZF9yb3ctPnksIHN0YXJ0X3gpOworCisgIC8qIFJlLWRyYXcg YSBwb3J0aW9uIG9mIHRoZSByb3cuICovCisKKyAgaWYgKGRlYnVnX3AKKyAgICAgICYmIHZwb3Mg IT0gYm90dG9tX3Zwb3MpCisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiUkVEUkFXIFNF R01FTlQ6XG5cCisgICAgICB2cG9zICglZCkgfCBjaGFyICglZC8lcykgfCB4OiAoJWQpIHwgaHBv cyAoJWQvJWQpIHwgbGVuZ3RoICglZClcbiIsCisgICAgICB2cG9zLCBzdGFydC0+dS5jaCwgbWNf Y2hhcl90b19zdHJpbmcgKHN0YXJ0LT51LmNoKSwKKyAgICAgIHN0YXJ0X3gsIHN0YXJ0X2hwb3Ms IHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxLCBpIC0gc3RhcnRfaHBvcyk7CisgICAg fQorCisgIHJpZi0+bWNfc2NyaWJlX2dseXBocyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRf cm93LCBzdGFydCwgVEVYVF9BUkVBLCBpIC0gc3RhcnRfaH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Rfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAg ICB7CisgICAgICAgIGludCB4ID0gdy0+b3V0cHV0X2N1cnNvci54OworICAgICAgICBpbnQgaHBv cyA9IHctPm91dHB1dF9jdXJzb3IuaHBvczsKKyAgICAgICAgc3RydWN0IGdseXBoICpzdGFydCA9 IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgaHBv cywgdnBvcyk7CisgICAgICAgIGlmICh3LT5vdXRwdXRfY3Vyc29yLnggPT0gdXBkYXRlZF9yb3ct PnBpeGVsX3dpZHRoKQorICAgICAgICAgIHggLT0gc3RhcnQtPnBpeGVsX3dpZHRoOworICAgICAg ICBpZiAoZGVidWdfcCkKKyAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJQT1NULUNIQU5HRUQ6 ICB2cG9zICglZCkgfCB4ICglZCkgfCBocG9zICglZC8lZCkgfCBjaGFyICglZC8lcylcbiIsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCB4LCBocG9zLCB1cGRhdGVkX3Jvdy0+dXNl ZFtURVhUX0FSRUFdIC0gMSwgc3RhcnQtPnUuY2gsIG1jX2NoYXJfdG9fc3RyaW5nIChzdGFydC0+ dS5jaCkpOworICAgICAgICBtY19kcmF3X3JvdyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRf cm93LCBzdGFydCwgeCwKKyAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZWRfcm93LT51c2VkW1RF WFRfQVJFQV0gLSBocG9zLCB2cG9zLCBib3R0b21fdnBvcywKKyAgICAgICAgICAgICAgICAgICAg IGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgZHJhd19wLCBQT1NUX0NI QU5HRUQpOworICAgICAgfQorICAgICAgLyogVGhlcmUgd2VyZSBubyBjaGFuZ2VzIGFuZCBpID09 IGRlc2lyZWRfcm93LT51c2VkW1RF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yAgICAg ICAgICAgICBhcHByb3ByaWF0ZWx5IGFib3ZlLiAqLworICAgICAgICAgIGVhc3NlcnQgKGkgPCBk ZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAgfHwgKChkZXNp cmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdID09IGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0p CisgICAgICAgICAgICAgICAgICAgICAgICYmIE1BVFJJWF9ST1dfRVhURU5EU19GQUNFX1AgKGN1 cnJlbnRfcm93KSkpOworICAgICAgICB9CisgICAgICBlbHNlIGlmIChNQVRSSVhfUk9XX0VYVEVO RFNfRkFDRV9QIChjdXJyZW50X3JvdykpCisgICAgICAgIHsKKyAgICAgICAgICAvKiBJZiBvbGQg cm93IGV4dGVuZHMgdG8gdGhlIGVuZCBvZiB0aGUgdGV4dCBhcmVhLCBjbGVhci4gKi8KKyAgICAg ICAgICBpZiAoaSA+PSBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdKQorICAgICAgICAgICAg b3V0cHV0X2N1cnNvcl90byAodywgdnBvcywgaSwgZGVzaXJlZF9yb3ctPnksIGRlc2lyZWRfcm93 LT5waXhlbF93aWR0aCk7CisgICAgICAgICAgaWYgKGRyYXdfcCkKKyAgICAgICAgICAgIHJpZi0+ Y2xlYXJfZW5kX29mX2xpbmUgKHcsIHVwZGF0ZWRfcm93LCBURVhUX0FSRUEsIC0xKTsKKyAgICAg ICAgICBjbGVhcl90b194ID0gLTE7CisgICAgICAgICAgY2hhbmdlZF9wID0gMTsKKyAgICAgICAg fQorICAgICAgZWxzZSBpZiAoZGVzaXJlZF9yb3ctPnBpeGVsX3dpZHRoIDwgY3VycmVudF9yb3ct PnBpeGVsX3dpZHRoKQorICAgICAgICB7CisgICAgICAgICAgLyogT3RoZXJ3aXNlIGNsZWFyIHRv IHRoZSBlbmQgb2YgdGhlIG9sZCByb3cuICBFdmVyeXRoaW5nCisgICAgICAgICAgICAgYWZ0ZXIg dGhhdCBwb3NpdGlvbiBzaG91bGQgYmUgY2xlYXIgYWxyZWFkeS4gKi8KKyAgICAgICAgICBpbnQg eGxpbTsKKyAgICAgICAgICBpZiAoaSA+PSBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdKQor ICAgICAgICAgICAgb3V0cHV0X2N1cnNvcl90byAodywgdnBvcywgaSwgZGVzaXJlZF9yb3ctPnks IGRlc2lyZWRfcm93LT5waXhlbF93aWR0aCk7CisgICAgICAgICAgLyogSWYgY3Vyc29yIGlzIGRp c3BsYXllZCBhdCB0aGUgZW5kIG9mIHRoZSBsaW5lLCBtYWtlIHN1cmUKKyAgICAgICAgICAgICBp dCdzIGNsZWFyZWQuICBOb3dhZGF5cyB3ZSBkb24ndCBoYXZlIGEgcGh5c19jdXJzb3JfZ2x5cGgK KyAgICAgICAgICAgICB3aXRoIHdoaWNoIHRvIGVyYXNlIHRoZSBjdXJzb3IgKGJlY2F1c2UgdGhp cyBtZXRob2QKKyAgICAgICAgICAgICBkb2Vzbid0IHdvcmsgd2l0aCBsYmVhcmluZy9yYmVhcmlu ZyksIHNvIHdlIG11c3QgZG8gaXQgdGhpcyB3YXkuICovCisgICAgICAgICAgaWYgKHZwb3MgPT0g dy0+cGh5c19jdXJzb3IudnBvcworICAgICAgICAgICAgICAmJiAoZGVzaXJlZF9yb3ctPnJldmVy c2VkX3AKKyAgICAgICAgICAgICAgICAgID8gKHctPnBoeXNfY3Vyc29yLmhwb3MgPCAwKQorICAg ICAgICAgICAgICAgICAgOiAody0+cGh5c19jdXJzb3IuaHBvcyA+PSBkZXNpcmVkX3Jvdy0+dXNl ZFtURVhUX0FSRUFdKSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHctPnBoeXNfY3Vy c29yX29uX3AgPSAwOworICAgICAgICAgICAgICB4bGltID0gLTE7CisgICAgICAgICAgICB9Cisg ICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHhsaW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aXMgZGVzaWduIGlzIG5lZWRlZCBiZWNhdXNlIGEgd29yZC13cmFwcGVkIGxpbmUgZG9lcyBub3Qg cmVjZWl2ZSBhbiBleHRyYQorICAgICAgc3BhY2UgbGlrZSBub24td29yZC13cmFwcGVkIGxpbmVz IGRvLiAqLworICAgICAgaW50IHggPSB1cGRhdGVkX3Jvdy0+cGl4ZWxfd2lkdGg7CisgICAgICBp bnQgaHBvcyA9IHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxOworICAgICAgaW50IHhf bGltaXQgPSAoY2xlYXJfdG9feCA9PSAtMSkKKyAgICAgICAgICAgICAgICAgICAgPyB0ZXh0X2Fy ZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgOiBjbGVhcl90b194OworICAgICAgTGlzcF9P YmplY3QgYnVmID0gdy0+Y29udGVudHM7CisgICAgICBDSEVDS19CVUZGRVIgKGJ1Zik7CisgICAg ICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAoYnVmKTsKKyAgICAgIGJvb2wgZmlsbF9jb2x1 bW5fdHJ1bXBzX3AgPSAoIU5JTFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHctPmN1cnNvci54ID09IGVzc2VudGlhbHMuZmNfeCk7CisKKyAgICAgIGlmICh0cmFj ZV9yZWRpc3BsYXlfcCkKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfdXBkYXRlX3RleHRf YXJlYSAoZmxvYXRpbmcpOiAgdnBvcyAoJWQpIHwgeF9saW1pdCAoJWQpXG4iLCB2cG9zLCB4X2xp bWl0KTsKKworICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICYmICFO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQorICAgICAgICAg ICYmIHggPCB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPj0g eAorICAgICAgICAgICYmIHRhcmdldF9nbHlwaCAhPSBOVUxMCisgICAgICAgICAgJiYgZHJhd19w KQorICAgICAgICBtY19lbmdpbmUgKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgdGFy Z2V0X2dseXBoLCBURVhUX0FSRUEsIHgsIHhfbGltaXQsCisgICAgICAgICAgICAgICAgICAgdXBk YXRlZF9yb3ctPnksIGhwb3MsIHZwb3MsIE1DX0JBUiwgMSwgY3Vyc29yX21hdHJpeCwgZXNzZW50 aWFscy5mY194LAorICAgICAgICAgICAgICAgICAgIGRlYnVnX3AgPyBkZWJ1Z19mZyA6IGVzc2Vu dGlhbHMuZmNfZmdbcm93X3Bvc2l0aW9uXSwgZXNzZW50aWFscy5hY3RpdmVfcCwgRklMTF9DT0xV TU4sCisgICAgICAgICAgICAgICAgICAgZHJhd19wLCBOT1dIRVJFLCBOT19DQUNIRSk7CisKKyAg ICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAmJiAhTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAmJiAhTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF9ob3Jpem9udGFsX3J1bGVyKSkKKyAgICAg ICAgICAmJiB4IDwgdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJz b3IudnBvcworICAgICAgICAgICYmIHRhcmdldF9nbHlwaCAhPSBOVUxMCisgICAgICAgICAgJiYg ZHJhd19wKQorICAgICAgICBtY19lbmdpbmUgKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3Jv dywgdGFyZ2V0X2dseXBoLCBURVhUX0FSRUEsIHgsIHhfbGltaXQsCisgICAgICAgICAgICAgICAg ICAgdXBkYXRlZF9yb3ctPnksIGhwb3MsIHZwb3MsIE1DX0hCQVIsIDEsIGN1cnNvcl9tYXRyaXgs IGVzc2VudGlhbHMuZmNfeCwKKyAgICAgICAgICAgICAgICAgICBkZWJ1Z19wID8gZGVidWdfZmcg OiBlc3NlbnRpYWxzLmNoX2ZnW3Jvd19wb3NpdGlvbl0sIGVzc2VudGlhbHMuYWN0aXZlX3AsIEhP UklaT05UQUxfUlVMRVIsCisgICAgICAgICAgICAgICAgICAgZHJhd19wLCBOT1dIRVJFLCBOT19D QUNIRSk7CisKKyAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAmJiAh TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAg ICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF92ZXJ0aWNhbF9ydWxl cikpCisgICAgICAgICAgJiYgIWZpbGxfY29sdW1uX3RydW1wc19wCisgICAgICAgICAgJiYgeCA8 IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICYmIHZwb3MgIT0gdy0+Y3Vyc29yLnZwb3MKKyAg ICAgICAgICAmJiB3LT5jdXJzb3IueCA+PSB4CisgICAgICAgICAgJiYgdGFyZ2V0X2dseXBoICE9 IE5VTEwKKyAgICAgICAgICAmJiBkcmF3X3ApCisgICAgICAgIG1jX2VuZ2luZSAodywgZGVzaXJl ZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRfZ2x5cGgsIFRFWFRfQVJFQSwgeCwgeF9saW1p dCwKKyAgICAgICAgICAgICAgICAgICB1cGRhdGVkX3Jvdy0+eSwgaHBvcywgdnBvcywgTUNfQkFS LCAxLCBjdXJzb3JfbWF0c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yB0aGUg bGVmdAorICAgICAgICAgICAgIG1hcmdpbiBhcmVhIGNhbiBwb3RlbnRpYWxseSBkcmF3IG92ZXIg dGhlIGJvcmRlci4gKi8KKyAgICAgICAgICBjdXJyZW50X3Jvdy0+cmVkcmF3X2ZyaW5nZV9iaXRt YXBzX3AgPSAxOworICAgICAgICB9CisgICAgICBib29sIHVwZGF0ZWRfcCA9IG1jX3VwZGF0ZV90 ZXh0X2FyZWEgKHcsIGRlc2lyZWRfcm93LCB2cG9zLCBjdXJzb3JfbWF0cml4LAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLCBkcmF3X3ApOwor ICAgICAgLyogVXBkYXRlIHRoZSBkaXNwbGF5IG9mIHRoZSB0ZXh0IGFyZWEuICovCisgICAgICBp ZiAodXBkYXRlZF9wKQorICAgICAgICB7CisgICAgICAgICAgY2hhbmdlZF9wID0gMTsKKyAgICAg ICAgICBpZiAoY3VycmVudF9yb3ctPm1vdXNlX2ZhY2VfcCkKKyAgICAgICAgICAgICptb3VzZV9m YWNlX292ZXJ3cml0dGVuX3AgPSAxOworICAgICAgICB9CisgICAgICAvKiBVcGRhdGUgZGlzcGxh eSBvZiB0aGUgcmlnaHQgbWFyZ2luIGFyZWEsIGlmIHRoZXJlIGlzIG9uZS4gKi8KKyAgICAgIGlm ICghZGVzaXJlZF9yb3ctPmZ1bGxfd2lkdGhfcCAmJiB3LT5yaWdodF9tYXJnaW5fY29scyA+IDAp CisgICAgICAgIHsKKyAgICAgICAgICBjaGFuZ2VkX3AgPSAxOworICAgICAgICAgIHVwZGF0ZV9t YXJnaW5hbF9hcmVhICh3LCBkZXNpcmVkX3JvdywgUklHSFRfTUFSR0lOX0FSRUEsIHZwb3MpOwor ICAgICAgICB9CisgICAgICAvKiBEcmF3IHRydW5jYXRpb24gbWFya3MgZXRjLiAqLworICAgICAg aWYgKCFjdXJyZW50X3Jvdy0+ZW5hYmxlZF9wCisgICAgICAgICA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it9CisK K3ZvaWQKK21jX3VwZGF0ZV93aW5kb3dfZXJhc2UgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBt Y19tYXRyaXggb2xkX21hdHJpeCkKK3sKKyAgYm9vbCBnb19vbmVfcCA9IChvbGRfbWF0cml4LmN1 cnNvcnNfdXNlZFtNQ19DQUNIRV0gPiAwCisgICAgICAgICAgICAgICAgICAgfHwgb2xkX21hdHJp eC5jdXJzb3JzX3VzZWRbQ0hfQ0FDSEVdID4gMAorICAgICAgICAgICAgICAgICAgIHx8IG9sZF9t YXRyaXguY3Vyc29yc191c2VkW0ZDX0NBQ0hFXSA+IDApOworICBib29sIGdvX3R3b19wID0gKEJV RkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICYmICghTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpCisg ICAgICAgICAgICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIG1jX2NvbmYpKSkpOworICBib29sIHVwZGF0aW5nX2ZyYW1lX3AgPSBmYWxzZTsKKyAgc3Ry dWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIGlmIChYRlJBTUUgKHctPmZyYW1l KSAhPSBmLT5tY191cGRhdGluZ19mcmFtZQorICAgICAgJiYgKGdvX29uZV9wIHx8IGdvX3R3b19w KSkKKyAgICB7CisgICAgICB1cGRhdGluZ19mcmFtZV9wID0gdHJ1ZTsKKyAgICAgIHVwZGF0ZV9i ZWdpbiAoZik7CisgICAgfQorICBpZiAody0+cGh5c19jdXJzb3Jfb25fcAorICAgICAgJiYgZ29f dHdvX3ApCisgICAgZXJhc2VfcGh5c19jdXJzb3IgKHcpOworCisvKgor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2VkW2NhY2hlX3R5cGVdLAorICAgIHZudGgsIG1jX2NhY2hlX3R5 cGVfdG9fc3RyaW5nIChjYWNoZV90eXBlKSwgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3Vz ZWRbY2FjaGVfdHlwZV0sCisgICAgdm50aCwgbWNfY2FjaGVfdHlwZV90b19zdHJpbmcgKGNhY2hl X3R5cGUpLCBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXSwKKyAg ICB2bnRoLCBtY19jYWNoZV90eXBlX3RvX3N0cmluZyAoY2FjaGVfdHlwZSksIG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdKTsKKyovCisKKyAgZm9yIChpbnQgdm50 aCA9IDA7CisgICAgICAgZ29fb25lX3AKKyAgICAgICAmJiB2bnRoIDwgb2xkX21hdHJpeC52cG9z X3VzZWQ7CisgICAgICAgKyt2bnRoKQorICAgIHsKKyAgICAgIGZvciAoZW51bSBtY19jYWNoZV90 eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NB Q0hFOworICAgICAgICAgICArK2NhY2hlX3R5cGUpCisgICAgICAgIGZvciAoaW50IHpfbnRoID0g MDsKKyAgICAgICAgICAgICBvbGRfbWF0cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90eXBlXSA+IDAK KyAgICAgICAgICAgICAmJiB6X250aCA8IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2Vk W2NhY2hlX3R5cGVdOworICAgICAgICAgICAgICsrel9udGgpCisgICAgICAgICAgeworICAgICAg ICAgICAgYm9vbCBzYW1lX3AgPSBmYWxzZTsKKyAgICAgICAgICAgIGZvciAoaW50IHdfbnRoID0g MDsgd19udGggPCB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVd OyArK3dfbnRoKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc2FtZV9wIHw9IChv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmdseXBoLnR5cGUK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnR5cGUKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt6X250aF0u Z2x5cGguYnl0ZXBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGguYnl0ZXBvcworICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3pfbnRoXS5nbHlwaC5jaGFycG9zCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5n bHlwaC5jaGFycG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmdseXBoLnUudmFsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW3dfbnRoXS5nbHlwaC51LnZhbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3pfbnRoXS5nbHlwaC5mYWNl X2lkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5mYWNlX2lkCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b el9udGhdLmdseXBoLnBhZGRpbmdfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgucGFk ZGluZ19wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmdseXBoLmxlZnRfYm94X2xpbmVfcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVt3X250aF0uZ2x5cGgubGVmdF9ib3hfbGluZV9wCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9u dGhdLmdseXBoLnJpZ2h0X2JveF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBo LnJpZ2h0X2JveF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt6X250aF0uZ2x5cGgudm9mZnNldAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgudm9mZnNldAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3pfbnRoXS5n bHlwaC5waXhlbF93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgucGl4ZWxfd2lk dGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVt6X250aF0uZ2x5cGguc2xpY2UuaW1nLngKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bd19udGhdLmdseXBoLnNsaWNlLmltZy54CisgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmdseXBoLnNs aWNlLmltZy55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5pbWcueQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3pfbnRoXS5nbHlwaC5zbGljZS5pbWcud2lkdGgKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b d19udGhdLmdseXBoLnNsaWNlLmltZy53aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3pfbnRoXS5nbHlwaC5z bGljZS5pbWcuaGVpZ2h0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5pbWcu aGVpZ2h0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmdseXBoLnNsaWNlLmNtcC5mcm9tCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5jbXAuZnJvbQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3pfbnRo XS54CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS54CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmZ4Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5meAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3pfbnRoXS55CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3dfbnRoXS55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmZ5CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3dfbnRoXS5meQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3pfbnRoXS5ocG9zCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W3dfbnRoXS5ocG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLnZwb3MKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b d19udGhdLnZwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt6X250aF0ud2QKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19u dGhdLndkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmgKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmgK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVt6X250aF0uY3Vyc29yX3R5cGUKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhd LmN1cnNvcl90eXBlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmN1cnNvcl93aWR0aAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVt3X250aF0uY3Vyc29yX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmZvcmVncm91 bmQucmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5mb3JlZ3JvdW5kLnJlZAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3pfbnRoXS5mb3JlZ3JvdW5kLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5mb3Jl Z3JvdW5kLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmZvcmVncm91bmQuYmx1ZQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVt3X250aF0uZm9yZWdyb3VuZC5ibHVlCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmJh Y2tncm91bmQucmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5iYWNrZ3JvdW5kLnJlZAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3pfbnRoXS5iYWNrZ3JvdW5kLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRo XS5iYWNrZ3JvdW5kLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmJhY2tncm91bmQuYmx1ZQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVt3X250aF0uYmFja2dyb3VuZC5ibHVlCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9u dGhdLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5hY3RpdmVfcAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3pfbnRoXS5nbHlwaF9mbGF2b3IKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoX2Zs YXZvcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW3pfbnRoXS5lbmFibGVkX3AKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19u dGhdLmVuYWJsZWRfcCk7CisgICAgICAgICAgICAgICAgLyogRm9yY2UgdGhlIGZyaW5nZSBiaXRt YXBzIHRvIGFsd2F5cyBiZSByZXNldC9yZWRyYXduLiAqLworICAgICAgICAgICAgICAgIGlmIChv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmN1cnNvcl90eXBl CisgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bd19udGhdLmN1cnNvcl90eXBlCisgICAgICAgICAgICAgICAgICAgICYmIChv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmN1cnNvcl90eXBl ID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAgICAgICAgfHwgb2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3pfbnRoXS5jdXJzb3JfdHlwZSA9 PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQKSkKKyAgICAgICAgICAgICAgICAgIHNhbWVfcCA9IGZh bHNlOworICAgICAgICAgICAgICAgIGlmIChzYW1lX3ApCisgICAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgICAgIC8vICBmcHJpbnRmIChzdGRlcnIsICJISVQgKCVzKTogIHZwb3Mg KCVkKSB8IGhwb3MgKCVkKSB8IGNoYXIgKCVzKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgLy8g ICAgICAgICAgICAgICAgICAgKGNhY2hlX3R5cGUgPT0gTUNfQ0FDSEUpCisgICAgICAgICAgICAg ICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgPyAiTUMiCisgICAgICAgICAgICAgICAgICAg IC8vICAgICAgICAgICAgICAgICAgIDogKGNhY2hlX3R5cGUgPT0gQ0hfQ0FDSEUpCisgICAgICAg ICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgPyAiQ0giCisgICAgICAgICAgICAg ICAgICAgIC8vICAgICAgICAgICAgICAgICAgIDogKGNhY2hlX3R5cGUgPT0gRkNfQ0FDSEUpCisg ICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgPyAiRkMiCisgICAgICAg ICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIDogIk5PIiwKKyAgICAgICAgICAgICAg ICAgICAgLy8gICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bd19udGhdLnZwb3MsCisgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAg ICAgICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRo XS5ocG9zLAorICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICBtY19jaGFy X3RvX3N0cmluZyAody0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19u dGhdLmdseXBoLnUuY2gpKTsKKyAgICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLnNhbWVfcCA9IHRydWU7CisgICAgICAgICAg ICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAg ZWxzZQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgLy8gIGZw cmludGYgKHN0ZGVyciwgIk1JU1MgKCVzKTogIHZwb3MgKCVkKSB8IGhwb3MgKCVkIHYuICVkKSB8 IGNoYXIgKCVzIHYuICVzKSB8IGNhY2hlX3VzZWQgKCVkIHYuICVkKVxuIiwKKyAgICAgICAgICAg ICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAoY2FjaGVfdHlwZSA9PSBNQ19DQUNIRSkK KyAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgID8gIk1DIgorICAg ICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIDogKGNhY2hlX3R5cGUgPT0g Q0hfQ0FDSEUpCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICA/ ICJDSCIKKyAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICA6IChjYWNo ZV90eXBlID09IEZDX0NBQ0hFKQorICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAg ICAgICAgICAgPyAiRkMiCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAg ICAgOiAiTk8iLAorICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS52cG9zLAorICAg ICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIG9sZF9tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt6X250aF0uaHBvcywKKyAgICAgICAgICAgICAgICAgICAg ICAvLyAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVt3X250aF0uaHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAg ICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAob2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3pfbnRoXS5nbHlwaC51LmNoKSwKKyAgICAgICAgICAgICAgICAgICAgICAvLyAg ICAgICAgICAgICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAody0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnUuY2gpLAorICAgICAgICAgICAgICAg ICAgICAgIC8vICAgICAgICAgICAgICAgICAgIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91 c2VkW2NhY2hlX3R5cGVdLAorICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAg ICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV0pOworICAg ICAgICAgICAgICAgICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3dfbnRoXS5zYW1lX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgICB9CisgICAgICAgICAgICBpZiAoIXNhbWVfcCkKKyAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgIC8qIGBtYXRyaXhfcm93JyBpbiBgZGlzcG5ldy5jYCBjb250YWlucyB0aGUg Zm9sbG93aW5nIHRlc3RzLAorICAgICAgICAgICAgICAgIGVhc3NlcnQgKG1hdHJpeCAmJiBtYXRy aXgtPnJvd3MpOworICAgICAgICAgICAgICAgIGVhc3NlcnQgKHJvdyA+PSAwICYmIHJvdyA8IG1h dHJpeC0+bnJvd3MpOyAqLworICAgICAgICAgICAgICAgIGJvb2wgYmFyZl9jcmFzaF9vbmUgPSAo dy0+Y3VycmVudF9tYXRyaXggJiYgdy0+Y3VycmVudF9tYXRyaXgtPnJvd3MpID8gZmFsc2UgOiB0 cnVlOworICAgICAgICAgICAgICAgIGlmIChiYXJmX2NyYXNoX29uZSkKKyAgICAgICAgICAgICAg ICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIGJvb2wgYmFyZl9jcmFzaF90d28gPSAodm50 aCA+PSAwICYmIHZudGggPCB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3MpID8gZmFsc2UgOiB0cnVl OworICAgICAgICAgICAgICAgIGlmIChiYXJmX2NyYXNoX3R3bykKKyAgICAgICAgICAgICAgICAg IGNvbnRpbnVlOworICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnZudGhfcm93ID0g TUFUUklYX1JPVyAody0+Y3VycmVudF9tYXRyaXgsIHZudGgpOworICAgICAgICAgICAgICAgIGlu dCB4XzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLng7 CisgICAgICAgICAgICAgICAgaW50IGZ4XzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bel9udGhdLmZ4OworICAgICAgICAgICAgICAgIGludCB5XzAgPSBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLnk7CisgICAgICAgICAgICAg ICAgaW50IGZ5XzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9u dGhdLmZ5OworICAgICAgICAgICAgICAgIGludCBocG9zXzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmhwb3M7CisgICAgICAgICAgICAgICAgaW50IHZw b3NfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt6X250aF0udnBv czsKKyAgICAgICAgICAgICAgICBpbnQgd2RfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVt6X250aF0ud2Q7CisgICAgICAgICAgICAgICAgaW50IGhfMCA9IG9sZF9t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt6X250aF0uaDsKKyAgICAgICAgICAg ICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlXzAgPSBvbGRfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmN1cnNvcl90eXBlOworICAgICAgICAgICAg ICAgIGludCBjdXJzb3Jfd2lkdGhfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVt6X250aF0uY3Vyc29yX3dpZHRoOworICAgICAgICAgICAgICAgIHN0cnVjdCBtY19S R0IgbHNsX2ZnXzAgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVt6X250aF0uZm9yZWdyb3VuZC5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAuZ3JlZW4gPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bel9udGhdLmZvcmVncm91bmQuZ3JlZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAuYmx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVt6X250aF0uZm9yZWdyb3VuZC5ibHVlfTsKKyAgICAgICAgICAgICAgICBzdHJ1Y3Qg bWNfUkdCIGxzbF9iZ18wID0gey5yZWQgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bel9udGhdLmJhY2tncm91bmQucmVkLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgLmdyZWVuID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3pfbnRoXS5iYWNrZ3JvdW5kLmdyZWVuLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bel9udGhdLmJhY2tncm91bmQuYmx1ZX07CisgICAgICAgICAgICAgICAgYm9v bCBhY3RpdmVfcF8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3pf bnRoXS5hY3RpdmVfcDsKKyAgICAgICAgICAgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2 b3JfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt6X250aF0uZ2x5 cGhfZmxhdm9yOworICAgICAgICAgICAgICAgIGJvb2wgZW5hYmxlZF9wXzAgPSBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bel9udGhdLmVuYWJsZWRfcDsKKyAgICAgICAg ICAgICAgICBpZiAodnBvc18wID09IHZudGgKKyAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhf Zmxhdm9yXzAgPT0gTUNfR0xZUEgKKyAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wXzAK KyAgICAgICAgICAgICAgICAgICAgJiYgdm50aF9yb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbWNfZXJhc2VfY3Vyc29yICh3LCB3LT5jdXJy ZW50X21hdHJpeCwgdm50aF9yb3csIHhfMCwgeV8wLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGhwb3NfMCwgdnBvc18wLCBnbHlwaF9mbGF2b3JfMCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZV8wLCB3ZF8wKTsKKyAgICAgICAg ICAgICAgICAgICAgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3pfbnRo XS5lbmFibGVkX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgLS1vbGRfbWF0cml4LmN1 cnNvcnNfdXNlZFtjYWNoZV90eXBlXTsKKyAgICAgICAgICAgICAgICAgICAgLyogSWYgd2UgaW5h ZHZlcnRlbnRseSBlcmFzZWQgYW5vdGhlciBmYWtlIGN1cnNvciBhdCB0aGUgc2FtZQorICAgICAg ICAgICAgICAgICAgICBIUE9TIHRoYXQgaXMgc3RpbGwgZW5hYmxlZF9wIGluIHRoZSBgb2xkX21h dHJpeGAsIHRoZW4gcmVkcmF3IGl0LiAqLworICAgICAgICAgICAgICAgICAgICBmb3IgKGVudW0g bWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7CisgICAgICAgICAgICAgICAgICAg ICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICAgICAgICAgICAgICAgICAgICsr Y2FjaGVfdHlwZSkKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAg ICAgICBmb3IgKGludCBudGhfMSA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9s ZF9tYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5cGVdID4gMAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBudGhfMSA8IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2Nh Y2hlX3R5cGVdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICArK250aF8xKQorICAgICAg ICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHhf MSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0ueDsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZnhfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZng7CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgaW50IHlfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhf MV0ueTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZnlfMSA9IG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZnk7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgaW50IGhwb3NfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMV0uaHBvczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgdnBv c18xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS52cG9z OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB3ZF8xID0gb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS53ZDsKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICBpbnQgaF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF8xXS5oOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5 cGUgY3Vyc29yX3R5cGVfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMV0uY3Vyc29yX3R5cGU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGN1 cnNvcl93aWR0aF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8xXS5jdXJzb3Jfd2lkdGg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1j X1JHQiBsc2xfZmdfMSA9IHsucmVkID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8xXS5mb3JlZ3JvdW5kLnJlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZm9yZWdyb3VuZC5ncmVlbiwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0gb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5mb3JlZ3JvdW5kLmJsdWV9 OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2JnXzEgPSB7 LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uYmFj a2dyb3VuZC5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAuZ3JlZW4gPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXzFdLmJhY2tncm91bmQuZ3JlZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMV0uYmFja2dyb3VuZC5ibHVlfTsKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICBib29sIGFjdGl2ZV9wXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzFdLmFjdGl2ZV9wOworICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvcl8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5nbHlwaF9mbGF2b3I7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgYm9vbCBlbmFibGVkX3BfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMV0uZW5hYmxlZF9wOworICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGJvb2wgZ29fcF8xID0gKGhwb3NfMCA9PSBocG9zXzEKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3BfMSk7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgaWYgKCFnb19wXzEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBj b250aW51ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIHJlbW92ZV9wXzEgPSBm YWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAo dywgdy0+Y3VycmVudF9tYXRyaXgsIHZudGhfcm93LCB4XzEsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ4XzEsIHlfMSwgZnlfMSwgaHBvc18xLCB2 cG9zXzEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHdkXzEsIGhfMSwgY3Vyc29yX3R5cGVfMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoXzEsIGxzbF9mZ18xLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVfcF8xLCBnbHlw aF9mbGF2b3JfMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgcmVtb3ZlX3BfMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBl bHNlIGlmICh2cG9zXzAgPT0gdm50aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZW5h YmxlZF9wXzAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHZudGhfcm93LT5lbmFibGVk X3ApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBib29sIHJl bW92ZV9wXzAgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHli cmlkICh3LCB3LT5jdXJyZW50X21hdHJpeCwgdm50aF9yb3csIHhfMCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnhfMCwgeV8wLCBmeV8wLCBocG9zXzAsIHZw b3NfMCwgd2RfMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg aF8wLCBjdXJzb3JfdHlwZV8wLCBjdXJzb3Jfd2lkdGhfMCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgbHNsX2JnXzAsIGFjdGl2ZV9wXzAsIGdseXBoX2ZsYXZv cl8wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVf cF8wKTsKKyAgICAgICAgICAgICAgICAgICAgICBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bel9udGhdLmVuYWJsZWRfcCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAg ICAgIC0tb2xkX21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVfdHlwZV07CisgICAgICAgICAgICAg ICAgICAgICAgLyogSWYgd2UgaW5hZHZlcnRlbnRseSBlcmFzZWQgYW5vdGhlciBmYWtlIGN1cnNv ciBhdCB0aGUgc2FtZQorICAgICAgICAgICAgICAgICAgICAgIEhQT1MgdGhhdCBpcyBzdGlsbCBl bmFibGVkX3AgaW4gdGhlIGBvbGRfbWF0cml4YCwgdGhlbiByZWRyYXcgaXQuICovCisgICAgICAg ICAgICAgICAgICAgICAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NB Q0hFOworICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgKytjYWNoZV90eXBlKQorICAgICAgICAgICAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBudGhfMiA9IDA7 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2xkX21hdHJpeC5jdXJzb3JzX3VzZWRb Y2FjaGVfdHlwZV0gPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgbnRoXzIg PCBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXTsKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICArK250aF8yKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB4XzIgPSBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLng7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBpbnQgZnhfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMl0uZng7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgeV8y ID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS55OworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZ5XzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmZ5OworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgaW50IGhwb3NfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMl0uaHBvczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB2cG9zXzIg PSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLnZwb3M7Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgd2RfMiA9IG9sZF9tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0ud2Q7CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBpbnQgaF8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF8yXS5oOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3Jf dHlwZSBjdXJzb3JfdHlwZV8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8yXS5jdXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlu dCBjdXJzb3Jfd2lkdGhfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMl0uY3Vyc29yX3dpZHRoOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3Ry dWN0IG1jX1JHQiBsc2xfZmdfMiA9IHsucmVkID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF8yXS5mb3JlZ3JvdW5kLnJlZCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5mb3JlZ3JvdW5kLmdyZWVuLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1 ZSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uZm9yZWdy b3VuZC5ibHVlfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0Ig bHNsX2JnXzIgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMl0uYmFja2dyb3VuZC5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMl0uYmFja2dyb3VuZC5ncmVlbiwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmJhY2tncm91bmQuYmx1ZX07 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGFjdGl2ZV9wXzIgPSBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmFjdGl2ZV9wOworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yXzIgPSBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmdseXBoX2ZsYXZv cjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgZW5hYmxlZF9wXzIgPSBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmVuYWJsZWRfcDsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgZ29fcF8yID0gKGhwb3NfMCA9PSBocG9z XzIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGZ4XzAg PD0gZnhfMgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg ZnhfMCArIHdkXzAgPiBmeF8yICsgd2RfMgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wXzIpOworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgaWYgKCFnb19wXzIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRp bnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCByZW1vdmVfcF8yID0gZmFs c2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAo dywgdy0+Y3VycmVudF9tYXRyaXgsIHZudGhfcm93LCB4XzIsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnhfMiwgeV8yLCBmeV8yLCBocG9zXzIs IHZwb3NfMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICB3ZF8yLCBoXzIsIGN1cnNvcl90eXBlXzIsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoXzIsIGxzbF9mZ18yLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2ZV9w XzIsIGdseXBoX2ZsYXZvcl8yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHJlbW92ZV9wXzIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAg ICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgfQorCisgIGlmICh1cGRhdGluZ19mcmFt ZV9wKQorICAgIHVwZGF0ZV9lbmQgKGYpOworfQorCit2b2lkCittY191cGRhdGVfd2luZG93X2Ry eXJ1biAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wLCBzdHJ1Y3QgbWNfZXNzZW50aWFs cyAqZXNzZW50aWFscykKK3sKKyAgaWYgKCFCVUZGRVJQICh3LT5jb250ZW50cykpCisgICAgcmV0 dXJuOworCisgIGlmICh3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW01DX0NBQ0hFXSA9PSAwCisg ICAgICAmJiB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0NIX0NBQ0hFXSA9PSAwCisgICAgICAm JiB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0ZDX0NBQ0hFXSA9PSAwCisgICAgICAmJiBOSUxQ IChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAgJiYgTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICYmIE5JTFAg KEJ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lmIChyb3ctPm1vZGVfbGluZV9w KQorICAgICAgICB7CisgICAgICAgICAgaGVhZGVyX2xpbmVfcm93ID0gcm93OworICAgICAgICAg ICsrcm93OworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICBoZWFkZXJfbGluZV9y b3cgPSBOVUxMOworCisgICAgICAvKiBVcGRhdGUgdGhlIG1vZGUgbGluZSwgaWYgbmVjZXNzYXJ5 LiAqLworICAgICAgc3RydWN0IGdseXBoX3JvdyAqbW9kZV9saW5lX3JvdyA9IE1BVFJJWF9NT0RF X0xJTkVfUk9XIChkZXNpcmVkX21hdHJpeCk7CisgICAgICBpZiAobW9kZV9saW5lX3Jvdy0+bW9k ZV9saW5lX3AgJiYgbW9kZV9saW5lX3Jvdy0+ZW5hYmxlZF9wKQorICAgICAgICB7CisgICAgICAg ICAgbW9kZV9saW5lX3Jvdy0+eSA9IHliICsgV0lORE9XX1NDUk9MTF9CQVJfQVJFQV9IRUlHSFQg KHcpOworICAgICAgICAgIHVwZGF0ZV93aW5kb3dfbGluZSAodywgTUFUUklYX1JPV19WUE9TICht b2RlX2xpbmVfcm93LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBkZXNpcmVkX21hdHJpeCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm bW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wKTsKKyAgICAgICAgfQorCisgICAgICAvKiBGaW5kIGZp cnN0IGVuYWJsZWQgcm93LiAgT3B0aW1pemF0aW9ucyBpbiByZWRpc3BsYXlfaW50ZXJuYWwKKyAg ICAgICAgIG1heSBsZWFkIHRvIGFuIHVwZGF0ZSB3aXRoIG9ubHkgb25lIHJvdyBlbmFibGVkLiAg VGhlcmUgbWF5CisgICAgICAgICBiZSBhbHNvIGNvbXBsZXRlbHkgZW1wdHkgbWF0cmljZXMuICov CisgICAgICB3aGlsZSAocm93IDwgZW5kICYmICFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgKyty b3c7CisKKyAgICAgIC8qIFRyeSByZXVzaW5nIHBhcnQgb2YgdGhlIGRpc3BsYXkgYnkgY29weWlu Zy4gKi8KKyAgICAgIGlmIChyb3cgPCBlbmQgJiYgIXctPmRlc2lyZWRfbWF0cml4LT5ub19zY3Jv bGxpbmdfcCkKKyAgICAgICAgeworICAgICAgICAgIGludCByYyA9IG1jX3Njcm9sbGluZ193aW5k b3cgKHcsIGhlYWRlcl9saW5lX3JvdyAhPSBOVUxMKTsKKyAgICAgICAgICBpZiAocmMgPCAwKQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBBbGwgcm93cyB3ZXJlIGZvdW5kIHRvIGJl IGVxdWFsLiAqLworICAgICAgICAgICAgICBwYXVzZWRfcCA9IDA7CisgICAgICAgICAgICAgIGdv dG8gc2V0X2N1cnNvcjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKHJjID4g MCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIFdlJ3ZlIHNjcm9sbGVkIHRo ZSBkaXNwbGF5LiAqLworICAgICAgICAgICAgICAgIGZvcmNlX3AgPSAxOworICAgICAgICAgICAg ICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgLyog UHJvY2VzcyB0aGUgY3Vyc29yIHJvdyBhdCB0aGUgb3V0c2V0IGlmIGl0IGlzIHdpdGhpbiBgZGVz aXJlZF9tYXRyaXhgLgorICAgICAgV2hlbiBwcm9jZXNzaW5nIGFsbCBvdGhlciByb3dzLCB3ZSB3 aWxsIHF1ZXJ5IHRoZSBgdy0+Y3VycmVudF9tYXRyaXhgIGZvciBkYXRhCisgICAgICByZWxhdGlu ZyB0byB0aGUgY3Vyc29yIHJvdy4gIGBtYWtlX2N1cnJlbnRgICh3aXRoaW4gYHVwZGF0ZV93aW5k b3dfbGluZScpCisgICAgICB1cGRhdGVzIHRoZSBgdy0+Y3VycmVudF9tYXRyaXhgIGZvciB0aGUg YXBwbGljYWJsZSByb3cuICBJbiBkb2luZyBzbywgaG93ZXZlciwKKyAgICAgIHRoZSBhcHBsaWNh YmxlIHJvdyBpbiB0aGUgZGVzaXJlZCBtYXRyaXggaXMgYWx0ZXJlZCBzdWNoIHRoYXQgd2UgY2Fu IG5vIGxvbmdlcgorICAgICAgcmVseSB1cG9uIHRoZSBhY2N1cmFjeSBvZiBgUk9XLT51c2VkW1RF WFRfQVJFQV1gLiAgVGhlcmVmb3JlLCB3ZSBtdXN0IG5vdyByZWx5CisgICAgICBleGNsdXNpdmVs eSB1cG9uIGB3LT5jdXJyZW50X21hdHJpeCcgZm9yIGN1cnNvciByb3cgYmFzZWQgZGVjaXNpb25z LiAqLworICAgICAgZm9yIChzdHJ1Y3QgZ2x5cGhfcm93ICptY19yb3cgPSByb3c7CisgICAgICAg ICAgIG1jX3JvdyA8IGVuZCAmJiAoZm9yY2VfcCB8fCAhaW5wdXRfcGVuZGluZyk7CisgICAgICAg ICAgICsrbWNfcm93KQorICAgICAgICB7CisgICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9X X1ZQT1MgKG1jX3Jvdywgdy0+ZGVzaXJlZF9tYXRyaXgpOworICAgICAgICAgIGlmIChtY19yb3ct PmVuYWJsZWRfcAorICAgICAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zKQorICAg ICAgICAgICAgeworICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4ID0gdy0+ZGVzaXJlZF9tYXRy aXg7CisgICAgICAgICAgICAgIGlmICghZm9yY2VfcCAmJiArK25fdXBkYXRlZCAlIHByZWVtcHRf Y291bnQgPT0gMCkKKyAgICAgICAgICAgICAgICBkZXRlY3RfaW5wdXRfcGVuZGluZ19pZ25vcmVf c3F1ZWV6YWJsZXMgKCk7CisgICAgICAgICAgICAgIGNoYW5nZWRfcCB8PSBtY191cGRhdGVfd2lu ZG93X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3cml0dGVuX3AsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsICpl c3NlbnRpYWxzLCBkcmF3X3ApOworICAgICAgICAgICAgICBpZiAoTUFUUklYX1JPV19CT1RUT01f WSAocm93KSA+PSB5YikKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gdnBvcyArIDE7IGkg PCB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAgICAgICAgICAgICAgICBT RVRfTUFUUklYX1JPV19FTkFCTEVEX1AgKHctPmN1cnJlbnRfbWF0cml4LCBpLCBmYWxzZSk7Cisg ICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBjdXJz b3JfbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgICAgICAvKiBVcGRhdGUgdGhlIHJlc3Qg b2YgdGhlIGxpbmVzLiAqLworICAgICAgZm9yICg7IHJvdyA8IGVuZCAmJiAoZm9yY2VfcCB8fCAh aW5wdXRfcGVuZGluZyk7ICsrcm93KQorICAgICAgICAvKiBzY3JvbGxpbmdfd2luZG93IHJlc2V0 cyB0aGUgZW5hYmxlZF9wIGZsYWcgb2YgdGhlIHJvd3MgaXQgcmV1c2VzIGZyb20KKyAgICAgICAg Y3VycmVudF9tYXRyaXguICovCisgICAgICAgIGlmIChyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAg ICB7CisgICAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCB3LT5kZXNp cmVkX21hdHJpeCk7CisgICAgICAgICAgICAvKiBJZiB0aGUgYGN1cnNvcl9yb3dgIGlzIHdpdGhp biB0aGUgYGRlc2lyZWRfbWF0cml4YCwgdGhlbiBpdCB3YXMKKyAgICAgICAgICAgIHByb2Nlc3Nl ZCBoZXJlaW5hYm92ZSBhbmQgc2hvdWxkIGJlIHNraXBwZWQgYXQgdGhpcyB0aW1lLiAqLworICAg ICAgICAgICAgaWYgKHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICBjb250aW51 ZTsKKyAgICAgICAgICAgIGludCBpOworICAgICAgICAgICAgLyogV2UnbGwgaGF2ZSB0byBwbGF5 IGEgbGl0dGxlIGJpdCB3aXRoIHdoZW4gdG8KKyAgICAgICAgICAgICAgIGRldGVjdF9pbnB1dF9w ZW5kaW5nLiAgSWYgaXQncyBkb25lIHRvbyBvZnRlbiwKKyAgICAgICAgICAgICAgIHNjcm9sbGlu ZyBsYXJnZSB3aW5kb3dzIHdpdGggcmVwZWF0ZWQgc2Nyb2xsLXVwCisgICAgICAgICAgICAgICBj b21tYW5kcyB3aWxsIHRvbyBxdWlja2x5IHBhdXNlIHJlZGlzcGxheS4gKi8KKyAgICAgICAgICAg IGlmICghZm9yY2VfcCAmJiArK25fdXBkYXRlZCAlIHByZWVtcHRfY291bnQgPT0gMCkKKyAgICAg ICAgICAgICAgZGV0ZWN0X2lucHV0X3BlbmRpbmdfaWdub3JlX3NxdWVlemFibGVzICgpOworICAg ICAgICAgICAgY2hhbmdlZF9wIHw9IG1jX3VwZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywgJm1v dXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsICplc3NlbnRpYWxzLCBkcmF3X3ApOworICAg ICAgICAgICAgLyogTWFyayBhbGwgcm93cyBiZWxvdyB0aGUgbGFzdCB2aXNpYmxlIG9uZSBpbiB0 aGUgY3VycmVudAorICAgICAgICAgICAgICAgbWF0cml4IGFzIGludmFsaWQuICBUaGlzIGlzIG5l Y2Vzc2FyeSBiZWNhdXNlIG9mCisgICAgICAgICAgICAgICB2YXJpYWJsZSBsaW5lIGhlaWdodHMu ICBDb25zaWRlciB0aGUgY2FzZSBvZiB0aHJlZQorICAgICAgICAgICAgICAgc3VjY2Vzc2l2ZSBy ZWRpc3BsYXlzLCB3aGVyZSB0aGUgZmlyc3QgZGlzcGxheXMgNQorICAgICAgICAgICAgICAgbGlu ZXMsIHRoZSBzZWNvbmQgMyBsaW5lcywgYW5kIHRoZSB0aGlyZCA1IGxpbmVzIGFnYWluLgorICAg ICAgICAgICAgICAgSWYgdGhlIHNlY29uZCByZWRpc3BsYXkgd291bGRuJ3QgbWFyayByb3dzIGlu IHRoZQorICAgICAgICAgICAgICAgY3VycmVudCBtYXRyaXggaW52YWxpZCwgdGhlIHRoaXJkIHJl ZGlzcGxheSBtaWdodCBiZQorICAgICAgICAgICAgICAgdGVtcHRlZCB0byBvcHRpbWl6ZSByZWRp c3BsYXkgYmFzZWQgb24gbGluZXMgZGlzcGxheWVkCisgICAgICAgICAgICAgICBpbiB0aGUgZmly c3QgcmVkaXNwbGF5LiAqLworICAgICAgICAgICAgaWYgKE1BVFJJWF9ST1dfQk9UVE9NX1kgKHJv dykgPj0geWIpCisgICAgICAgICAgICAgIGZvciAoaSA9IHZwb3MgKyAxOyBpIDwgdy0+Y3VycmVu dF9tYXRyaXgtPm5yb3dzIC0gMTsgKytpKQorICAgICAgICAgICAgICAgIFNFVF9NQVRSSVhfUk9X X0VOQUJMRURfUCAody0+Y3VycmVudF9tYXRyaXgsIGksIGZhbHNlKTsKKyAgICAgICAgICB9Cisg ICAgICAvKiBXYXMgZGlzcGxheSBwcmVlbXB0ZWQ/ICovCisgICAgICBwYXVzZWRfcCA9IHJvdyA8 IGVuZDsKKyAgICAgIHNldF9jdXJzb3I6CisgICAgICAvKiBJZiB3ZSBqdW1wZWQgaGVyZSBmcm9t IGBzZXRfY3Vyc29yYCwgdGhlbiBzZXQgdGhlIGBjdXJzb3JfbWF0cml4YC4gKi8KKyAgICAgIGlm IChjdXJzb3JfbWF0cml4ID09IE5VTEwpCisgICAgICAgIGN1cnNvcl9tYXRyaXggPSB3L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iAoZGVzaXJlZF9yb3ctPmVuYWJsZWRfcCkKKyAgICAg ICAgICAgIGNvbnRpbnVlOworICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKmJvdHRvbV9yb3cg PSBNQVRSSVhfQk9UVE9NX1RFWFRfUk9XICh3LT5jdXJyZW50X21hdHJpeCwgdyk7CisgICAgICAg ICAgaW50IGJvdHRvbV92cG9zID0gTUFUUklYX1JPV19WUE9TIChib3R0b21fcm93LCB3LT5jdXJy ZW50X21hdHJpeCk7CisgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqY3VycmVudF9yb3cgPSBN QVRSSVhfUk9XICh3LT5jdXJyZW50X21hdHJpeCwgdnBvcyk7CisgICAgICAgICAgZW51bSBtY19y b3dfcG9zaXRpb24gcm93X3Bvc2l0aW9uID0gbWNfcm93X3Bvc2l0aW9uIChjdXJyZW50X3Jvdywg Y3VycmVudF9yb3csIHZwb3MpOworICAgICAgICAgIGlmIChjdXJyZW50X3Jvdy0+ZW5hYmxlZF9w KQorICAgICAgICAgICAgbWNfZHJhd19yb3cgKHcsIHctPmN1cnJlbnRfbWF0cml4LCBjdXJyZW50 X3JvdywgY3VycmVudF9yb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAgICAgICAgICAg ICAgICAgIGN1cnJlbnRfcm93LT54LCBjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdLCB2cG9z LAorICAgICAgICAgICAgICAgICAgICAgICAgIGJvdHRvbV92cG9zLCBjdXJzb3JfbWF0cml4LCAq ZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdf cCwgU0VUX0NVUlNPUl9PTkUpOworICAgICAgICB9CisKKyAgICAgIG1jX3Jlc3RvcmVfZ2x5cGhf bWF0cml4IChzYXZlZF9kZXNpcmVkLCB3LT5kZXNpcmVkX21hdHJpeCk7CisgICAgICBtY19yZXN0 b3JlX2dseXBoX21hdHJpeCAoc2F2ZWRfY3VycmVudCwgdy0+Y3VycmVudF9tYXRyaXgpOworCisg ICAgICBtY191cGRhdGVfd2luZG93X2VyYXNlICh3LCBvbGRfbWF0cml4KTsKKworICAgICAgbWNf eGZyZWVfY2FjaGVfbWF0cml4ICh3LCBvbGRfbWF0cml4KTsKKworICAgIH0KKyAgLy8gY2xvY2tf dCBjbG9ja19lbmQgPSBjbG9jaygpOworICAvLyBkb3VibGUgY3B1X3RpbWVfdXNlZCA9ICgoZG91 YmxlKSAoY2xvY2tfZW5kIC0gY2xvY2tfc3RhcnQpKSAvIENMT0NLU19QRVJfU0VDOworICAvLyBm cHJpbnRmIChzdGRlcnIsICJtY19zY3JvbGxpbmdfd2luZG93ICglcyk6ICBUSU1FICglZilcbiIs IG1jX3dpbmRvdyAodyksIGNwdV90aW1lX3VzZWQpOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VS U09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogLyogU3RydWN0dXJlIHRvIHBh c3MgZGltZW5zaW9ucyBhcm91bmQuICBVc2VkIGZvciBjaGFyYWN0ZXIgYm91bmRpbmcKICAgIGJv eGVzLCBnbHlwaCBtYXRyaXggZGltZW5zaW9ucyBhbmQgYWxpa2UuICAqLwogCkBAIC0yMjQxLDYg KzQwODksMTcgQEAgZnJlZV93aW5kb3dfbWF0cmljZXMgKHN0cnVjdCB3aW5kb3cgKncpCiAJICBm cmVlX2dseXBoX21hdHJpeCAody0+Y3VycmVudF9tYXRyaXgpOwogCSAgZnJlZV9nbHlwaF9tYXRy aXggKHctPmRlc2lyZWRfbWF0cml4KTsKIAkgIHctPmN1cnJlbnRfbWF0cml4ID0gdy0+ZGVzaXJl ZF9tYXRyaXggPSBOVUxMOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQ TEUtQ1VSU09SUyAqLworCisgIGlmICh3LT5tY19tYXRyaXgudnBvc191c2VkID4gMCkKKyAgICBt Y194ZnJlZV9jYWNoZV9tYXRyaXggKHcsIHctPm1jX21hdHJpeCk7CisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKIAl9CiAKICAgICAgIC8qIE5leHQgd2luZG93IG9uIHNhbWUgbGV2ZWwu ICAqLwpAQCAtMzM4Nyw2ICs1MjQ2LDI2IEBAIGNoZWNrX2N1cnJlbnRfbWF0cml4X2ZsYWdzIChz dHJ1Y3Qgd2luZG93ICp3KQogc3RhdGljIGJvb2wKIHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5k b3cgKncsIGJvb2wgZm9yY2VfcCkKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAgZnBy aW50ZiAoc3RkZXJyLCAidXBkYXRlX3dpbmRvdyAoJXMpXG4iLCBtY193aW5kb3cgKHcpKTsKKwor ICBib29sIGRyYXdfcCA9IHRydWU7CisKKyAgc3RydWN0IG1jX2Vzc2VudGlhbHMgZXNzZW50aWFs czsKKyAgbWNfdXBkYXRlX3dpbmRvd19kcnlydW4gKHcsIGZvcmNlX3AsICZlc3NlbnRpYWxzKTsK KworICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICpjdXJzb3JfbWF0cml4ID0gTlVMTDsKKworICBzdHJ1 Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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RUFdYC4gIFRoZXJlZm9yZSwgd2UgbXVzdCBub3cgcmVseQorICBleGNsdXNp dmVseSB1cG9uIGB3LT5jdXJyZW50X21hdHJpeCcgZm9yIGN1cnNvciByb3cgYmFzZWQgZGVjaXNp b25zLiAqLworICBmb3IgKHN0cnVjdCBnbHlwaF9yb3cgKm1jX3JvdyA9IHJvdzsKKyAgICAgICBt Y19yb3cgPCBlbmQgJiYgKGZvcmNlX3AgfHwgIWlucHV0X3BlbmRpbmcpOworICAgICAgICsrbWNf cm93KQorICAgIHsKKyAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChtY19yb3csIGRl c2lyZWRfbWF0cml4KTsKKyAgICAgIGlmIChtY19yb3ctPmVuYWJsZWRfcAorICAgICAgICAgICYm IHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgIHsKKyAgICAgICAgICBjdXJzb3JfbWF0 cml4ID0gZGVzaXJlZF9tYXRyaXg7CisgICAgICAgICAgaWYgKCFmb3JjZV9wICYmICsrbl91cGRh dGVkICUgcHJlZW1wdF9jb3VudCA9PSAwKQorICAgICAgICAgICAgZGV0ZWN0X2lucHV0X3BlbmRp bmdfaWdub3JlX3NxdWVlemFibGVzICgpOworICAgICAgICAgIGNoYW5nZWRfcCB8PSAoQlVGRkVS UCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoIU5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgISBOSUxQIChCVkFSIChYQlVGRkVSICh3 LT5jb250ZW50cyksIGZjX3Zpc2libGUpKSkpCisgICAgICAgICAgICAgICAgICAgICAgID8gbWNf dXBkYXRlX3dpbmRvd19saW5lICh3LCB2cG9zLCAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21h dHJpeCwgZXNzZW50aWFscywgZHJhd19wKQorICAgICAgICAgICAgICAgICAgICAgICA6IHVwZGF0 ZV93aW5kb3dfbGluZSAodywgdnBvcywgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCk7CisgICAg ICAgICAgaWYgKE1BVFJJWF9ST1dfQk9UVE9NX1kgKHJvdykgPj0geWIpCisgICAgICAgICAgICBm b3IgKGludCBpID0gdnBvcyArIDE7IGkgPCB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3MgLSAxOyAr K2kpCisgICAgICAgICAgICAgIFNFVF9NQVRSSVhfUk9XX0VOQUJMRURfUCAody0+Y3VycmVudF9t YXRyaXgsIGksIGZhbHNlKTsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKwor ICBjdXJzb3JfbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworCisKICAgICAgIC8qIFVwZGF0ZSB0aGUgcmVzdCBvZiB0aGUgbGluZXMuICAqLwog ICAgICAgZm9yICg7IHJvdyA8IGVuZCAmJiAoZm9yY2VfcCB8fCAhaW5wdXRfcGVuZGluZyk7ICsr cm93KQogCS8qIHNjcm9sbGluZ193aW5kb3cgcmVzZXRzIHRoZSBlbmFibGVkX3AgZmxhZyBvZiB0 aGUgcm93cyBpdApAQCAtMzQ2Nyw2ICs1Mzg3LDE5IEBAIHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3 aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkKIAlpZiAocm93LT5lbmFibGVkX3ApCiAJICB7CiAJICAg IGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIGRlc2lyZWRfbWF0cml4KTsKKworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAg ICAgIC8qIElmIHRoZSBgY3Vyc29yX3Jvd2AgaXMgd2l0aGluIHRoZSBgZGVzaXJlZF9tYXRyaXhg LCB0aGVuIGl0IHdhcworICAgICAgICAgIHByb2Nlc3NlZCBoZXJlaW5hYm92ZSBhbmQgc2hvdWxk IGJlIHNraXBwZWQgYXQgdGhpcyB0aW1lLiAqLworICAgICAgICAgIGlmICh2cG9zID09IHctPmN1 cnNvci52cG9zKQorICAgICAgICAgIGNvbnRpbnVlOworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKworCiAJICAgIGludCBpOwogCiAJICAgIC8qIFdlJ2xsIGhhdmUgdG8gcGxheSBhIGxpdHRs ZSBiaXQgd2l0aCB3aGVuIHRvCkBAIC0zNDc1LDggKzU0MDgsMjEgQEAgdXBkYXRlX3dpbmRvdyAo c3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wKQogCSAgICAgICBjb21tYW5kcyB3aWxsIHRv byBxdWlja2x5IHBhdXNlIHJlZGlzcGxheS4gICovCiAJICAgIGlmICghZm9yY2VfcCAmJiArK25f dXBkYXRlZCAlIHByZWVtcHRfY291bnQgPT0gMCkKIAkgICAgICBkZXRlY3RfaW5wdXRfcGVuZGlu Z19pZ25vcmVfc3F1ZWV6YWJsZXMgKCk7Ci0JICAgIGNoYW5nZWRfcCB8PSB1cGRhdGVfd2luZG93 X2xpbmUgKHcsIHZwb3MsCi0JCQkJCSAgICAgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCk7CisK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAg ICAgICAgICBjaGFuZ2VkX3AgfD0gKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAg ICAgICAgICAgICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2Nv bmYpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg IHx8ICEgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpKQor ICAgICAgICAgICAgICAgICAgICAgICA/IG1jX3VwZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywg Jm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIGRyYXdfcCkKKyAg ICAgICAgICAgICAgICAgICAgICAgOiB1cGRhdGVfd2luZG93X2xpbmUgKHcsIHZwb3MsICZtb3Vz ZV9mYWNlX292ZXJ3cml0dGVuX3ApOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwogCiAJ ICAgIC8qIE1hcmsgYWxsIHJvd3MgYmVsb3cgdGhlIGxhc3QgdmlzaWJsZSBvbmUgaW4gdGhlIGN1 cnJlbnQKIAkgICAgICAgbWF0cml4IGFzIGludmFsaWQuICBUaGlzIGlzIG5lY2Vzc2FyeSBiZWNh dXNlIG9mCkBAIC0zNDk3LDYgKzU0NDMsNDQgQEAgdXBkYXRlX3dp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isgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpOworICAgICAgICsrZGVzaXJlZF9yb3cpCisgICAg eworICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKGRlc2lyZWRfcm93LCBkZXNpcmVk X21hdHJpeCk7CisgICAgICBpZiAoZGVzaXJlZF9yb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgY29u dGludWU7CisgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpib3R0b21fcm93ID0gTUFUUklYX0JPVFRP TV9URVhUX1JPVyAody0+Y3VycmVudF9tYXRyaXgsIHcpOworICAgICAgaW50IGJvdHRvbV92cG9z ID0gTUFUUklYX1JPV19WUE9TIChib3R0b21fcm93LCB3LT5jdXJyZW50X21hdHJpeCk7CisgICAg ICBzdHJ1Y3QgZ2x5cGhfcm93ICpjdXJyZW50X3JvdyA9IE1BVFJJWF9ST1cgKHctPmN1cnJlbnRf bWF0cml4LCB2cG9zKTsKKyAgICAgIGVudW0gbWNfcm93X3Bvc2l0aW9uIHJvd19wb3NpdGlvbiA9 IG1jX3Jvd19wb3NpdGlvbiAoY3VycmVudF9yb3csIGN1cnJlbnRfcm93LCB2cG9zKTsKKyAgICAg IGlmIChjdXJyZW50X3Jvdy0+ZW5hYmxlZF9wKQorICAgICAgICBtY19kcmF3X3JvdyAodywgdy0+ Y3VycmVudF9tYXRyaXgsIGN1cnJlbnRfcm93LCBjdXJyZW50X3Jvdy0+Z2x5cGhzW1RFWFRfQVJF QV0sCisgICAgICAgICAgICAgICAgICAgICBjdXJyZW50X3Jvdy0+eCwgY3VycmVudF9yb3ctPnVz ZWRbVEVYVF9BUkVBXSwgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgIGJvdHRvbV92cG9zLCBj dXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sCisgICAgICAgICAgICAgICAg ICAgICBkcmF3X3AsIFNFVF9DVVJTT1JfVFdPKTsKKyAgICB9CisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworCisKICAgICAgIC8qIFVwZGF0ZSB0aGUgaGVhZGVyIGxpbmUgYWZ0ZXIgc2Nyb2xs aW5nIGJlY2F1c2UgYSBuZXcgaGVhZGVyCiAJIGxpbmUgd291bGQgb3RoZXJ3aXNlIG92ZXJ3cml0 ZSBsaW5lcyBhdCB0aGUgdG9wIG9mIHRoZSB3aW5kb3cKIAkgdGhhdCBjYW4gYmUgc2Nyb2xsZWQu ICAqLwpAQCAtMzUxMiw3ICs1NDk2LDU4IEBAIHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5kb3cg KncsIGJvb2wgZm9yY2VfcCkKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KIAkgIGlmIChjaGFu Z2VkX3AgJiYgcmlmLT5maXhfb3ZlcmxhcHBpbmdfYXJlYSkKIAkgICAgewotCSAgICAgIHJlZHJh d19vdmVybGFwcGVkX3Jvd3MgKHcsIHliKTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyogYHJlZHJhd19vdmVybGFwcGVkX3Jvd3MnOiAg UmVkcmF3IGxpbmVzIGZyb20gdGhlIGN1cnJlbnQgbWF0cml4IG9mIHdpbmRvdyBXCit0aGF0IGFy ZSBvdmVybGFwcGVkIGJ5IG90aGVyIHJvd3MuICBZQiBpcyBib3R0b20tbW9zdCB5LXBvc2l0aW9u IGluIFcuICBJZiByb3dzCitvdmVybGFwcGluZyBvdGhlcnMg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19DQUNIRV0gPiAwKQorICAgICAgICAgICAgICAgICAgJiYgYXJlYSA9PSBURVhU X0FSRUEKKyAgICAgICAgICAgICAgICAgICYmIHJvdy0+dXNlZFthcmVhXSkKKyAgICAgICAgICAg ICAgICB7CisgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXggPSB3 LT5jdXJyZW50X21hdHJpeDsKKyAgICAgICAgICAgICAgICAgIGludCBzdGFydF94ID0gcm93LT54 OworICAgICAgICAgICAgICAgICAgaW50IHN0YXJ0X2hwb3MgPSAwOworICAgICAgICAgICAgICAg ICAgaW50IGVuZF9ocG9zID0gcm93LT51c2VkW2FyZWFdOworICAgICAgICAgICAgICAgICAgYm9v bCBjbGVhcl9lb2xfcCA9IHRydWU7CisgICAgICAgICAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhz X2ZhY2UgaGwgPSBEUkFXX05PUk1BTF9URVhUOworICAgICAgICAgICAgICAgICAgbWNfcmVkcmF3 X3JvdyAodywgbWF0cml4LCByb3csIHN0YXJ0X3gsIHN0YXJ0X2hwb3MsIGVuZF9ocG9zLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJfZW9sX3AsIGhsKTsKKyAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSBpZiAocm93LT51c2VkW2FyZWFdKQorICAg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRV9SSUYgKGYpLT53cml0 ZV9nbHlwaHMgKHcsIHJvdywgcm93LT5nbHlwaHNbYXJlYV0sIGFyZWEsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT51c2VkW2FyZWFdKTsKKyAg ICAgICAgICAgICAgICAgICAgRlJBTUVfUklGIChmKS0+Y2xlYXJfZW5kX29mX2xpbmUgKHcsIHJv dywgYXJlYSwgLTEpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAg ICAgIHJvdy0+b3ZlcmxhcHBlZF9wID0gMDsKKyAgICAgICAgfQorICAgICAgaWYgKE1BVFJJWF9S T1dfQk9UVE9NX1kgKHJvdykgPj0geWIpCisgICAgICAgIGJyZWFrOworICAgIH0KKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogCSAgICAgIHJlZHJhd19vdmVybGFwcGluZ19yb3dzICh3 LCB5Yik7CiAJICAgIH0KICNlbmRpZgpAQCAtMzUzMSwxMCArNTU2NiwyMSBAQCB1cGRhdGVfd2lu ZG93IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3ApCiAgICAgICBzdHJjcHkgKHctPmN1 cnJlbnRfbWF0cml4LT5tZXRob2QsIHctPmRlc2lyZWRfbWF0cml4LT5tZXRob2QpOwogI2VuZGlm CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK ICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KKyAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQor ICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykp KQorICAgIG1jX3VwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgMCk7CisgICAgZWxzZQogICAgICAg dXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCAwKTsKICNlbmRpZgogCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKworCiAgICAgICAvKiBFbmQgdGhlIHVwZGF0ZSBvZiB3aW5kb3cgVy4gIERvbid0 IHNldCB0aGUgY3Vy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hL3NyYy9mcmluZ2UuYworKysgYi9z cmMvZnJpbmdlLmMKQEAgLTQzOCw2ICs0MzgsNDYwIEBAIHN0YXRpYyB1bnNpZ25lZCBzaG9ydCBl bXB0eV9saW5lX2JpdHNbXSA9IHsKICNkZWZpbmUgU1RBTkRBUkRfQklUTUFQX0hFSUdIVChiaXRz KSAoc2l6ZW9mIChiaXRzKS9CWVRFU19QRVJfQklUTUFQX1JPVykKICNkZWZpbmUgRlJCSVRTKGJp dHMpICBiaXRzLCBTVEFOREFSRF9CSVRNQVBfSEVJR0hUIChiaXRzKQogCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCisvKiBgKy1mcmlu Z2UtaGVscGVyLWRlY2ltYWwnIGRlZmluZWQgaW4gYGNyb3NzaGFpcnMuZWxgICovCisKKy8qIFRP RE86ICBDb25zaWRlciBhZGRpbmcgdGhlIGZvbGxvd2luZyBmcmluZ2UgYml0bWFwczoKKyAgKGRl ZmluZS1mcmluZ2UtYml0bWFwICdicmVha3BvaW50ICJceDNjXHg3ZVx4ZmZceGZmXHhmZlx4ZmZc eDdlXHgzYyIpCisgIChkZWZpbmUtZnJpbmdlLWJpdG1hcCAnaG9sbG93LXJpZ2h0LXRyaWFuZ2xl ICJceGUwXHg5MFx4ODhceDg0XHg4NFx4ODhceDkwXHhlMCIpICovCisKKy8qIDI0CisgICAgKCst ZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4u Li4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLnh4Li4uIgorICAgICAgInguLi54eC4u IgorICAgICAgInguLi4ueHguIgorICAgICAgIngueHh4eHh4IgorICAgICAgIngueHh4eHh4Igor ICAgICAgInguLi4ueHguIgorICAgICAgInguLi54eC4uIgorICAgICAgInguLnh4Li4uIgorICAg ICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIikKKyovCitz dGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93X2JpdHNbXSA9 eworICAweDgwLCAweDgwLCAweDgwLCAweDk4LCAweDhjLCAweDg2LCAweGJmLAorICAweGJmLCAw eDg2LCAweDhjLCAweDk4LCAweDgwLCAweDgwLCAweDgwfTsKKworLyogMjUKKyAgICAoKy1mcmlu Z2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgi CisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLnh4Li4ueHgiCisgICAgICAiLi54eC4ueHgiCisg ICAgICAiLi4ueHgueHgiCisgICAgICAieHh4eHh4eHgiCisgICAgICAieHh4eHh4eHgiCisgICAg ICAiLi4ueHgueHgiCisgICAgICAiLi54eC4ueHgiCisgICAgICAiLnh4Li4ueHgiCisgICAgICAi Li4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiKQorKi8KK3N0YXRp YyB1bnNpZ25lZCBzaG9ydCBtY19yZXZlcnNlZF92ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3dfYml0 c1tdID17CisgIDB4MywgMHgzLCAweDMsIDB4NjMsIDB4MzMsIDB4MWIsIDB4ZmYsIDB4ZmYsIDB4 MWIsIDB4MzMsIDB4NjMsIDB4MywgMHgzLCAweDN9OworCisvKiAyNgorICAgICgrLWZyaW5nZS1o ZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICJ4eHh4eHh4eCIKKyAgICAgICJ4Li4uLi4ueCIKKyAg ICAgICJ4Li4uLi4ueCIKKyAgICAgICJ4Li54eC4ueCIKKyAgICAgICJ4Li4ueHgueCIKKyAgICAg ICJ4Li4uLnh4eCIKKyAgICAgICJ4Lnh4eHh4eCIKKyAgICAgICJ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wgMHg4MCwg MHg4MCwgMHg4MH07CisKKy8qIDMwCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAor ICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAg ICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAg Ii4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4u Li4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4u Lnh4IgorICAgICAgIi4uLi4uLnh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcmV2 ZXJzZWRfdmVydGljYWxfYmFyX2JpdHNbXSA9eworICAweDMsIDB4MywgMHgzLCAweDMsIDB4Mywg MHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4M307CisKKy8qIDMxCisg ICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Li4uLi4uIgorICAgICAg Inh4Li4uLi4uIgorICAgICAgIiB4eC4uLi4uIgorICAgICAgIi54eC4uLi4uIgorICAgICAgIi4u eHguLi4uIgorICAgICAgIi4ueHguLi4uIgorICAgICAgIi4uLnh4Li4uIgorICAgICAgIi4uLnh4 Li4uIgorICAgICAgIi4uLi54eC4uIgorICAgICAgIi4uLi54eC4uIgorICAgICAgIi4uLi4ueHgu IgorICAgICAgIi4uLi4ueHguIgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IikK KyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfYmFja3NsYXNoX2JpdHNbXSA9eworICAweGMw LCAweGMwLCAweGUwLCAweDYwLCAweDMwLCAweDMwLCAweDE4LCAweDE4LCAweGMsIDB4YywgMHg2 LCAweDYsIDB4MywgMHgzfTsKKworLyogMzIKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNp bWFsCisgICAgICAieHguLi4uLi4iCisgICAgICAieHguLi4uLi4iCisgICAgICAieHh4Li4uLi4i CisgICAgICAieHh4Li4uLi4iCisgICAgICAieC54eC4uLi4iCisgICAgICAieC54eC4uLi4iCisg ICAgICAieC4ueHguLi4iCisgICAgICAieC4ueHguLi4iCisgICAgICAieC4uLnh4Li4iCisgICAg ICAieC4uLnh4Li4iCisgICAgICAieC4uLi54eC4iCisgICAgICAieC4uLi54eC4iCisgICAgICAi eC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBt Y192ZXJ0aWNhbF9iYXJfYmFja3NsYXNoX2JpdHNbXSA9eworICAweGMwLCAweGMwLCAweGUwLCAw eGUwLCAweGIwLCAweGIwLCAweDk4LAorICAweDk4LCAweDhjLCAweDhjLCAweDg2LCAweDg2LCAw eDgzLCAweDgzfTsKKworLyogMzMKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisg ICAgICAiLnh4eHh4eC4iCisgICAgICAieHh4eC54Li4iCisgICAgICAieHh4eC54Li4iCisgICAg ICAieHh4eC54Li4iCisgICAgICAiLnh4eC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAgICAi Li4ueC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAgICAiLi4u eC54Li4iCisgICAgICAiLi4ueC54Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19w aWxjcm93X2JpdHNbXSA9eworICAweDdlLCAweGY0LCAweGY0LCAweGY0LCAweDc0LCAweDE0LCAw eDE0LCAweDE0LCAweDE0LCAweDE0LCAweDE0fTsKKworLyogMzQKKyAgICAoKy1mcmluZ2UtaGVs cGVyLWhleGFkZWNpbWFsCisgICAgICAiLi54eHh4Li4iCisgICAgICAiLnh4eHh4eC4iCisgICAg ICAieC4ueHguLngiCisgICAgICAieC4ueHguLngiCisgICAgICAieHh4eHh4eHgiCisgICAgICAi eHguLi4ueHgiCisgICAgICAieHh4Li54eHgiCisgICAgICAiLnh4eHh4eC4iCisgICAgICAiLi54 eHh4Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zbWlsZXlfZmFjZV9iaXRzW10g PXsKKyAgMHgzYywgMHg3ZSwgMHg5OSwgMHg5OSwgMHhmZiwgMHhjMywgMHhlNywgMHg3ZSwgMHgz Y307CisKKy8qIDM1CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4u eC4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4uLi4u eC4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC4uLi4u IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX3JpZ2h0X2JpdHNb XSA9eworICAweDIwLCAweDEwLCAweDgsIDB4NCwgMHg4LCAweDEwLCAweDIwfTsKKworLyogMzYK KyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi54Li4iCisgICAg ICAiLi4uLnguLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54Li4uLi4iCisgICAgICAi Li4ueC4uLi4iCisgICAgICAiLi4uLnguLi4iCisgICAgICAiLi4uLi54Li4iKQorKi8KK3N0YXRp YyB1bnNpZ25lZCBzaG9ydCBtY19zaW5nbGVfYW5nbGVfbGVmdF9iaXRzW10gPXsKKyAgMHg0LCAw eDgsIDB4MTAsIDB4MjAsIDB4MTAsIDB4OCwgMHg0fTsKKworLyogMzcKKyAgICAoKy1mcmluZ2Ut aGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHgueHguLi4iCisgICAgICAiLnh4Lnh4Li4iCisg ICAgICAiLi54eC54eC4iCisgICAgICAiLi4ueHgueHgiCisgICAgICAiLi54eC54eC4iCisgICAg ICAiLnh4Lnh4Li4iCisgICAgICAieHgueHguLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9y dCBtY19kb3VibGVfYW5nbGVfcmlnaHRfYml0c1tdID17CisgIDB4ZDgsIDB4NmMsIDB4MzYsIDB4 MWIsIDB4MzYsIDB4NmMsIDB4ZDh9OworCisvKiAzOAorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4 YWRlY2ltYWwKKyAgICAgICIuLi54eC54eCIKKyAgICAgICIuLnh4Lnh4LiIKKyAgICAgICIueHgu eHguLiIKKyAgICAgICJ4eC54eC4uLiIKKyAgICAgICIueHgueHguLiIKKyAgICAgICIuLnh4Lnh4 LiIKKyAgICAgICIuLi54eC54eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX2RvdWJs ZV9hbmdsZV9sZWZ0X2JpdHNbXSA9eworICAweDFiLCAweDM2LCAweDZjLCAweGQ4LCAweDZjLCAw eDM2LCAweDFifTsKKworLyogMzkKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisg ICAgICAieC54LnguLi4iCisgICAgICAiLngueC54Li4iCisgICAgICAiLi54LngueC4iCisgICAg ICAiLi4ueC54LngiCisgICAgICAiLi54LngueC4iCisgICAgICAiLngueC54Li4iCisgICAgICAi eC54LnguLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190cmlwbGVfYW5nbGVfcmln aHRfYml0c1tdID17CisgIDB4YTgsIDB4NTQsIDB4MmEsIDB4MTUsIDB4MmEsIDB4NTQsIDB4YTh9 OworCisvKiA0MAorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi54 LngueCIKKyAgICAgICIuLngueC54LiIKKyAgICAgICIueC54LnguLiIKKyAgICAgICJ4LngueC4u LiIKKyAgICAgICIueC54LnguLiIKKyAgICAgICIuLngueC54LiIKKyAgICAgICIuLi54LngueCIp CisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3RyaXBsZV9hbmdsZV9sZWZ0X2JpdHNbXSA9 eworICAweDE1LCAweDJhLCAweDU0LCAweGE4LCAweDU0LCAweDJhLCAweDE1fTsKKworLyogNDEK KyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAg ICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAi Li4ueC4uLi4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4u Li4ueC4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4u Li4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zaW5n bGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MTAsIDB4 MjgsIDB4NDQsIDB4ODIsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9OworCisvKiA0MgorICAgICgr LWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4u Li4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICJ4Li4uLi54 LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIuLi54Li4uLiIK KyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAg ICAgICIuLi4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3NpbmdsZV9hbmds ZV9kb3duX2JpdHNbXSA9eworICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDgyLCAweDQ0LCAw eDI4LCAweDEwLCAweDAwLCAweDAwLCAweDAwLCAweDAwfTsKKworLyogNDMKKyAgICAoKy1mcmlu Z2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4i CisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54LnguLi4iCisg ICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAg ICAiLnguLi54Li4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAi Li4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBt Y19kb3VibGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4MDAsIDB4MDAsIDB4MDAsIDB4MTAsIDB4 MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4ODIsIDB4MDAsIDB4MDAsIDB4MDB9OworCisv KiA0NAorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4uLiIK KyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICJ4Li4uLi54LiIKKyAg ICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAg ICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIu Li4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIpCisqLworc3RhdGlj IHVuc2lnbmVkIHNob3J0IG1jX2RvdWJsZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAweDAwLCAw eDAwLCAweDAwLCAweDgyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDEwLCAweDAw LCAweDAwLCAweDAwfTsKKworLyogNDUKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFs CisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54LnguLi4iCisg ICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAg ICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAi LnguLi54Li4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRp YyB1bnNpZ25lZCBzaG9ydCBtY190cmlwbGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4MDAsIDB4 MTAsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4ODIs IDB4MDB9OworCisvKiA0NgorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAg ICIuLi4uLi4uLiIKKyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIu LngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngu eC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4u LiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLi4uLi4uLiIpCisqLworc3RhdGljIHVuc2ln bmVkIHNob3J0IG1jX3F1YWRydXBsZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAweDAwLCAweDgy LCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDEwLCAw eDAwfTsKKworLyogNDcKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAi Li4ueC4uLi4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4u eC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4u eC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4i CisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4uLi4ueC4iKQor Ki8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19xdWFkcnVwbGVfYW5nbGVfdXBfYml0c1tdID17 CisgIDB4MTAsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQs IDB4OTIsIDB4MjgsIDB4NDQsIDB4ODJ9OworCisvKiA0OAorICAgICgrLWZyaW5nZS1oZWxwZXIt aGV4YWRlY2ltYWwKKyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIu LngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngu eC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4u LiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIK KyAgICAgICIuLi54Li4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3RyaXBsZV9h bmdsZV9kb3duX2JpdHNbXSA9eworICAweDgyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4 LCAweDkyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDEwfTsKKwogLyogTk9URTog IFRoZSBvcmRlciBvZiB0aGVzZSBiaXRtYXBzIG11c3QgbWF0Y2gg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FsIHNwZWMgaXMgcHJlc2VudCwg dXNlIG5vbi1wYXJ0aWFsIGJpdG1hcC4gKi8KK2ludAorbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHN0 cnVjdCB3aW5kb3cgKncsIExpc3BfT2JqZWN0IGJpdG1hcCwgaW50IHJpZ2h0X3AsIGludCBwYXJ0 aWFsX3ApCit7CisgIExpc3BfT2JqZWN0IGNtYXAsIGJtMSA9IFFuaWwsIGJtMiA9IFFuaWwsIGJt OworICBFTUFDU19JTlQgbG4xID0gMCwgbG4yID0gMDsKKyAgaW50IGl4MSA9IHJpZ2h0X3A7Cisg IGludCBpeDIgPSBpeDEgKyAocGFydGlhbF9wID8gMiA6IDApOworICBpZiAoKGNtYXAgPSBCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKSwgIU5JTFAg KGNtYXApKQorICAgIHsKKyAgICAgIGJtMSA9IG1jX2Fzc3EgKGJpdG1hcCwgY21hcCk7CisgICAg ICBpZiAoQ09OU1AgKGJtMSkpCisgIHsKKyAgICBpZiAoKGJtMSA9IFhDRFIgKGJtMSkpLCBOSUxQ IChibTEpKQorICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgaWYgKENPTlNQ IChibTEpKQorICAgICAgeworICAgICAgICBsbjEgPSBYRklYTlVNIChGbGVuZ3RoIChibTEpKTsK KyAgICAgICAgaWYgKHBhcnRpYWxfcCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpZiAobG4x ID4gaXgyKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgYm0gPSBtY19udGggKGl4 MiwgYm0xKTsKKyAgICAgICAgICAgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgICAgICAg ICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgICAg ZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChsbjEgPiBpeDEpCisgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICBibSA9IG1jX250aCAoaXgxLCBibTEpOworICAgICAgICAg ICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5kOwor ICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgfQorICAgIGVsc2UgaWYgKChibSA9 IGJtMSwgIUVRIChibSwgUXQpKSkKKyAgICAgIGdvdG8gZm91bmQ7CisgIH0KKyAgICB9CisgIGlm ICghRVEgKGNtYXAsIEJWQVIgKCZidWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9pbmRpY2F0b3JfYWxp c3QpKQorICAgICAgJiYgIU5JTFAgKEJWQVIgKCZidWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9pbmRp Y2F0b3JfYWxpc3QpKSkKKyAgICB7CisgICAgICBibTIgPSBtY19hc3NxIChiaXRtYXAsIEJWQVIg KCZidWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKTsKKyAgICAgIGlmIChD T05TUCAoYm0yKSkKKyAgICAgICAgeworICAgICAgICAgIGlmICgoYm0yID0gWENEUiAoYm0yKSks ICFOSUxQIChibTIpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAoQ09OU1AgKGJt MikpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgbG4yID0gWEZJWE5VTSAo Rmxlbmd0aCAoYm0yKSk7CisgICAgICAgICAgICAgICAgICBpZiAocGFydGlhbF9wKQorICAgICAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgaWYgKGxuMiA+IGl4MikKKyAg ICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgYm0gPSBt Y19udGggKGl4MiwgYm0yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFFUSAoYm0s IFF0KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5kOworICAgICAgICAg ICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICBpZiAobG4xID4gaXgxKQorICAg IHsKKyAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMSk7CisgICAgICBpZiAoIUVRIChibSwgUXQp KQorICAgICAgICBnb3RvIGZvdW5kOworICAgIH0KKyAgaWYgKGxuMiA+IGl4MSkKKyAgICB7Cisg ICAgICBibSA9IG1jX250aCAoaXgxLCBibTIpOworICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAg ICAgICAgZ290byBmb3VuZDsKKyAgICAgIHJldHVybiBNQ19OT19GUklOR0VfQklUTUFQOworICAg IH0KKyAgICBlbHNlIGlmICgoYm0gPSBibTIsIE5JTFAgKGJtKSkpCisgICAgICByZXR1cm4gTUNf Tk9fRlJJTkdFX0JJVE1BUDsKKyAgZm91bmQ6CisgIHJldHVybiBsb29rdXBfZnJpbmdlX2JpdG1h cCAoYm0pOworfQorCitzdGF0aWMgaW50CittY19nZXRfbG9naWNhbF9jdXJzb3JfYml0bWFwIChz dHJ1Y3Qgd2luZG93ICp3LCBMaXNwX09iamVjdCBjdXJzb3IpCit7CisgIExpc3BfT2JqZWN0IGNt YXAsIGJtID0gUW5pbDsKKyAgaWYgKChjbWFwID0gQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMp LCBmcmluZ2VfY3Vyc29yX2FsaXN0KSksICFOSUxQIChjbWFwKSkKKyAgICB7CisgICAgICBibSA9 IG1jX2Fzc3EgKGN1cnNvciwgY21hcCk7CisgICAgICBpZiAoQ09OU1AgKGJtKSkKKyAgICAgICAg eworICAgICAgICAgIGlmICgoYm0gPSBYQ0RSIChibSkpLCBOSUxQIChibSkpCisgICAgICAgICAg ICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJV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BMIFBSKSAgLS0gdXNlIGZvciBsZWZ0 IHJpZ2h0IHBhcnRpYWwtbGVmdCBwYXJ0aWFsLXJpZ2h0CisgIElmIGFueSB2YWx1ZSBpbiBsb2Nh bCBiaW5kaW5nIGlzIG5vdCBwcmVzZW50IG9yIHQsIHVzZSBnbG9iYWwgdmFsdWUuCisgICAgIElm IHBhcnRpYWwsIGxvb2t1cCBwYXJ0aWFsIGJpdG1hcCBpbiBkZWZhdWx0IHZhbHVlIGlmIG5vdCBm b3VuZCBoZXJlLgorICAgICBJZiBub3QgcGFydGlhbCwgb3Igbm8gcGFydGlhbCBzcGVjIGlzIHBy ZXNlbnQsIHVzZSBub24tcGFydGlhbCBiaXRtYXAuICAqLworICBpZiAoKGNtYXAgPSBCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKSwgIU5JTFAgKGNt YXApKQorICAgIHsKKyAgICAgIGJtMSA9IG1jX2Fzc3EgKGJpdG1hcCwgY21hcCk7CisgICAgICBp ZiAoQ09OU1AgKGJtMSkpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoKGJtMSA9IFhDRFIgKGJt MSkpLCBOSUxQIChibTEpKQorICAgICAgICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7 CisgICAgICAgICAgaWYgKENPTlNQIChibTEpKQorICAgICAgICAgICAgeworICAgICAgICAgICAg ICBsbjEgPSBYRklYTlVNIChGbGVuZ3RoIChibTEpKTsKKyAgICAgICAgICAgICAgaWYgKHBhcnRp YWxfcCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBpZiAobG4xID4gaXgy KQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgYm0gPSBtY19u dGggKGl4MiwgYm0xKTsKKyAgICAgICAgICAgICAgICAgICAgICBpZiAoIUVRIChibSwgUXQpKQor ICAgICAgICAgICAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgIGlmIChsbjEgPiBpeDEpCisgICAgICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgICAgICBibSA9IG1jX250aCAoaXgxLCBibTEpOworICAgICAg ICAgICAgICAgICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAgICAgICAgICAgICAg ICBnb3RvIGZvdW5kOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQor ICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAoKGJtID0gYm0xLCAhRVEgKGJtLCBR dCkpKQorICAgICAgICAgICAgICBnb3RvIGZvdW5kOworICAgICAgICB9CisgICAgfQorICBpZiAo IUVRIChjbWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0 KSkKKyAgICAgICYmICFOSUxQIChCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNh dG9yX2FsaXN0KSkpCisgICAgeworICAgICAgYm0yID0gbWNfYXNzcSAoYml0bWFwLCBCVkFSICgm YnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSk7CisgICAgICBpZiAoQ09O U1AgKGJtMikpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoKGJtMiA9IFhDRFIgKGJtMikpLCAh TklMUCAoYm0yKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKENPTlNQIChibTIp KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGxuMiA9IFhGSVhOVU0gKEZs ZW5ndGggKGJtMikpOworICAgICAgICAgICAgICAgICAgaWYgKHBhcnRpYWxfcCkKKyAgICAgICAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGlmIChsbjIgPiBpeDIpCisgICAg ICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGJtID0gbWNf bnRoIChpeDIsIGJtMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghRVEgKGJtLCBR dCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgaWYgKGxuMSA+IGl4MSkKKyAgICB7 CisgICAgICBibSA9IG1jX250aCAoaXgxLCBibTEpOworICAgICAgaWYgKCFFUSAoYm0sIFF0KSkK KyAgICAgICAgZ290byBmb3VuZDsKKyAgICB9CisgIGlmIChsbjIgPiBpeDEpCisgICAgeworICAg ICAgYm0gPSBtY19udGggKGl4MSwgYm0yKTsKKyAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAg ICAgIGdvdG8gZm91bmQ7CisgICAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICB9 CisgICAgZWxzZSBpZiAoKGJtID0gYm0yLCBOSUxQIChibSkpKQorICAgICAgcmV0dXJuIE1DX05P X0ZSSU5HRV9CSVRNQVA7CisgIGZvdW5kOgorICByZXR1cm4gbG9va3VwX2ZyaW5nZV9iaXRtYXAg KGJtKTsKK30KKworLyogUmVjYWxjdWxhdGUgdGhlIGJpdG1hcHMgdG8gc2hvdyBpbiB0aGUgZnJp bmdlcyBvZiB3aW5kb3cgVy4KKyAgIE9ubHkgbWFyayByb3dzIHdpdGggbW9kaWZpZWQgYml0bWFw cyBmb3IgdXBkYXRlIGluIHJlZHJhd19mcmluZ2VfYml0bWFwc19wLgorICAgSWYgS0VFUF9DVVJS RU5UX1AgaXMgMCwgdXBkYXRlIGN1cnJlbnRfbW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X3p2X3AgTUNfSUZfTElOVCAoPSAwKSwg Ym90X3Jvd19lbmRzX2F0X3p2X3AgTUNfSUZfTElOVCAoPSAwKTsKKyAgaWYgKHctPnBzZXVkb193 aW5kb3dfcCkKKyAgICByZXR1cm4gMDsKKyAgaWYgKCFNSU5JX1dJTkRPV19QICh3KQorICAgICAg JiYgKGluZCA9IEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgaW5kaWNhdGVfYnVmZmVyX2Jv dW5kYXJpZXMpLCAhTklMUCAoaW5kKSkpCisgICAgeworICAgICAgaWYgKEVRIChpbmQsIFFsZWZ0 KSB8fCBFUSAoaW5kLCBRcmlnaHQpKQorICAgICAgICBib3VuZGFyeV90b3AgPSBib3VuZGFyeV9i b3QgPSBhcnJvd190b3AgPSBhcnJvd19ib3QgPSBpbmQ7CisgICAgICAgIGVsc2UgaWYgKENPTlNQ IChpbmQpCisgICAgICAgICAgICAgICAgICYmIENPTlNQIChYQ0FSIChpbmQpKSkKKyAgICAgICAg eworICAgICAgICAgIExpc3BfT2JqZWN0IHBvczsKKyAgICAgICAgICBpZiAocG9zID0gbWNfYXNz cSAoUXQsIGluZCksICFOSUxQIChwb3MpKQorICAgICAgICAgICAgYm91bmRhcnlfdG9wID0gYm91 bmRhcnlfYm90ID0gYXJyb3dfdG9wID0gYXJyb3dfYm90ID0gWENEUiAocG9zKTsKKyAgICAgICAg ICBpZiAocG9zID0gbWNfYXNzcSAoUXRvcCwgaW5kKSwgIU5JTFAgKHBvcykpCisgICAgICAgICAg ICBib3VuZGFyeV90b3AgPSBYQ0RSIChwb3MpOworICAgICAgICAgIGlmIChwb3MgPSBtY19hc3Nx IChRYm90dG9tLCBpbmQpLCAhTklMUCAocG9zKSkKKyAgICAgICAgICAgIGJvdW5kYXJ5X2JvdCA9 IFhDRFIgKHBvcyk7CisgICAgICAgICAgaWYgKHBvcyA9IG1jX2Fzc3EgKFF1cCwgaW5kKSwgIU5J TFAgKHBvcykpCisgICAgICAgICAgICBhcnJvd190b3AgPSBYQ0RSIChwb3MpOworICAgICAgICAg IGlmIChwb3MgPSBtY19hc3NxIChRZG93biwgaW5kKSwgIU5JTFAgKHBvcykpCisgICAgICAgICAg ICBhcnJvd19ib3QgPSBYQ0RSIChwb3MpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAg ICAgICAvKiBBbnl0aGluZyBlbHNlIG1lYW5zIGJvdW5kYXJ5IG9uIGxlZnQgYW5kIG5vIGFycm93 cy4gICovCisgICAgICAgICAgYm91bmRhcnlfdG9wID0gYm91bmRhcnlfYm90ID0gUWxlZnQ7Cisg ICAgfQorICB0b3BfaW5kX3JuID0gYm90X2luZF9ybiA9IC0xOworICBpZiAoIU5JTFAgKGluZCkp CisgICAgeworICAgICAgZm9yICh5ID0gdy0+dnNjcm9sbCwgcm4gPSAwOworICAgICAgICAgICB5 IDwgeWIgJiYgcm4gPCBucm93czsKKyAgICAgICAgICAgeSArPSByb3ctPmhlaWdodCwgKytybikK KyAgICAgICAgeworICAgICAgICAgIHJvdyA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgcm47 CisgICAgICAgICAgaWYgKCFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgICAgIHJvdyA9IHctPmN1 cnJlbnRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgcm93LT5pbmRpY2F0ZV9ib2JfcCA9 IHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcCA9IDA7CisgICAgICAgICAgcm93LT5pbmRpY2F0ZV9l b2JfcCA9IHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCA9IDA7CisgICAgICAgICAgaWYgKCFy b3ctPm1vZGVfbGluZV9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAodG9wX2lu ZF9ybiA8IDAgJiYgcm93LT52aXNpYmxlX2hlaWdodCA+IDApCisgICAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgICAgaWYgKE1BVFJJWF9ST1dfU1RBUlRfQ0hBUlBPUyAocm93KSA8PSBC VUZfQkVHViAoWEJVRkZFUiAody0+Y29udGVudHMpKQorICAgICAgICAgICAgICAgICAgICAgICYm ICFNQVRSSVhfUk9XX1BBUlRJQUxMWV9WSVNJQkxFX0FUX1RPUF9QICh3LCByb3cpKQorICAgICAg ICAgICAgICAgICAgICByb3ctPmluZGljYXRlX2JvYl9wID0gIU5JTFAgKGJvdW5kYXJ5X3RvcCk7 CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICByb3ctPmlu ZGljYXRlX3RvcF9saW5lX3AgPSAhTklMUCAoYXJyb3dfdG9wKTsKKyAgICAgICAgICAgICAgICAg IHRvcF9pbmRfcm4gPSBybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGlmIChi b3RfaW5kX3JuIDwgMCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBpZiAo TUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSA+PSBCVUZfWlYgKFhCVUZGRVIgKHctPmNvbnRl bnRzKSkKKyAgICAgICAgICAgICAgICAgICAgICAmJiAhTUFUUklYX1JPV19QQVJUSUFMTFlfVklT SUJMRV9BVF9CT1RUT01fUCAodywgcm93KSkKKyAgICAgICAgICAgICAgICAgICAgcm93LT5pbmRp Y2F0ZV9lb2JfcCA9ICFOSUxQIChib3VuZGFyeV9ib3QpLCBib3RfaW5kX3JuID0gcm47CisgICAg ICAgICAgICAgICAgICAgIGVsc2UgaWYgKHkgKyByb3ctPmhlaWdodCA+PSB5YikKKyAgICAgICAg ICAgICAgICAgICAgICByb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3AgPSAhTklMUCAoYXJyb3df Ym90KSwgYm90X2luZF9ybiA9IHJuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0K KyAgICAgICAgfQorICAgIH0KKyAgZW1wdHlfcG9zID0gQlZBUiAoWEJVRkZFUiAody0+Y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RvbQorICAgICBp bmRpY2F0b3IpIHRvIGFkamFjZW50IHJvd3MgaWYgaXQgZG9lc24ndCBmaXQgaW4gb25lIHJvdy4g ICovCisgIHRvcF9pbmRfbWluX3kgPSBib3RfaW5kX21heF95ID0gLTE7CisgIGlmICh0b3BfaW5k X3JuID49IDApCisgICAgeworICAgICAgaW50IGJuID0gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAg ICAgIHJvdyA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgdG9wX2luZF9ybjsKKyAgICAgIGlm ICghcm93LT5lbmFibGVkX3ApCisgICAgICAgIHJvdyA9IHctPmN1cnJlbnRfbWF0cml4LT5yb3dz ICsgdG9wX2luZF9ybjsKKyAgICAgIHRvcF9yb3dfZW5kc19hdF96dl9wID0gcm93LT5lbmRzX2F0 X3p2X3A7CisgICAgICBpZiAocm93LT5pbmRpY2F0ZV9ib2JfcCkKKyAgICAgICAgeworICAgICAg ICAgIGlmIChFUSAoYm91bmRhcnlfdG9wLCBRbGVmdCkpCisgICAgICAgICAgICBibiA9ICgocm93 LT5pbmRpY2F0ZV9lb2JfcCAmJiBFUSAoYm91bmRhcnlfYm90LCBRbGVmdCkpCisgICAgICAgICAg ICAgICAgICA/IE1DX0xFRlRfRlJJTkdFICgxLCBRdG9wX2JvdHRvbSwgcm93LT5lbmRzX2F0X3p2 X3ApCisgICAgICAgICAgICAgICAgICA6IE1DX0xFRlRfRlJJTkdFICgyLCBRdG9wLCAwKSk7Cisg ICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGJuID0gKChyb3ctPmluZGljYXRlX2VvYl9w ICYmIEVRIChib3VuZGFyeV9ib3QsIFFyaWdodCkpCisgICAgICAgICAgICAgICAgICAgID8gTUNf UklHSFRfRlJJTkdFICgxLCBRdG9wX2JvdHRvbSwgcm93LT5lbmRzX2F0X3p2X3ApCisgICAgICAg ICAgICAgICAgICAgIDogTUNfUklHSFRfRlJJTkdFICgyLCBRdG9wLCAwKSk7CisgICAgICAgIH0K KyAgICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV90b3BfbGluZV9wKQorICAgICAgICAgIHsK KyAgICAgICAgICAgIGlmIChFUSAoYXJyb3dfdG9wLCBRbGVmdCkpCisgICAgICAgICAgICAgIGJu ID0gTUNfTEVGVF9GUklOR0UgKDYsIFF1cCwgMCk7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgICAgICBibiA9IE1DX1JJR0hUX0ZSSU5HRSAoNiwgUXVwLCAwKTsKKyAgICAgICAgICB9 CisgICAgICBpZiAoYm4gIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgeworICAgICAg ICAgIHN0cnVjdCBmcmluZ2VfYml0bWFwICpmYiA9IGdldF9mcmluZ2VfYml0bWFwX2RhdGEgKGJu KTsKKyAgICAgICAgICBpZiAoZmItPmFsaWduID09IEFMSUdOX0JJVE1BUF9UT1AgJiYgZmItPnBl cmlvZCA9PSAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93 ICpyb3cxOworICAgICAgICAgICAgICBpbnQgdG9wX2luZF9tYXhfeTsKKyAgICAgICAgICAgICAg dG9wX2luZF9taW5feSA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICAgICAgICAg ICAgICB0b3BfaW5kX21heF95ID0gdG9wX2luZF9taW5feSArIGZiLT5oZWlnaHQ7CisgICAgICAg ICAgICAgIGlmICh0b3BfaW5kX21heF95ID4geWIpCisgICAgICAgICAgICAgICAgdG9wX2luZF9t YXhfeSA9IHliOworICAgICAgICAgICAgICBmb3IgKHkgPSByb3ctPnkgKyByb3ctPmhlaWdodCwg cm4gPSB0b3BfaW5kX3JuICsgMTsKKyAgICAgICAgICAgICAgICAgICB5IDwgdG9wX2luZF9tYXhf eSAmJiBybiA8IG5yb3dzOworICAgICAgICAgICAgICAgICAgIHkgKz0gcm93MS0+aGVpZ2h0LCBy bisrKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGlmIChib3RfaW5kX3Ju ID49IDAgJiYgcm4gPj0gYm90X2luZF9ybikKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7Cisg ICAgICAgICAgICAgICAgICByb3cxID0gdy0+ZGVzaXJlZF9tYXRyaXgtPnJvd3MgKyBybjsKKyAg ICAgICAgICAgICAgICAgIGlmICghcm93MS0+ZW5hYmxlZF9wKQorICAgICAgICAgICAgICAgICAg ICByb3cxID0gdy0+Y3VycmVudF9tYXRyaXgtPnJvd3MgKyBybjsKKyAgICAgICAgICAgICAgICAg IHJvdzEtPmluZGljYXRlX2JvYl9wID0gcm93LT5pbmRpY2F0ZV9ib2JfcDsKKyAgICAgICAgICAg ICAgICAgIHJvdzEtPmluZGljYXRlX3RvcF9saW5lX3AgPSByb3ctPmluZGljYXRlX3RvcF9saW5l X3A7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQor ICBpZiAoYm90X2luZF9ybiA+PSAwKQorICAgIHsKKyAgICAgIGludCBibiA9IE1DX05PX0ZSSU5H RV9CSVRNQVA7CisgICAgICByb3cgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIGJvdF9pbmRf cm47CisgICAgICBpZiAoIXJvdy0+ZW5hYmxlZF9wKQorICAgICAgICByb3cgPSB3LT5jdXJyZW50 X21hdHJpeC0+cm93cyArIGJvdF9pbmRfcm47CisgICAgICBib3Rfcm93X2VuZHNfYXRfenZfcCA9 IHJvdy0+ZW5kc19hdF96dl9wOworICAgICAgaWYgKHJvdy0+aW5kaWNhdGVfZW9iX3ApCisgICAg ICAgIHsKKyAgICAgICAgICBpZiAoRVEgKGJvdW5kYXJ5X2JvdCwgUWxlZnQpKQorICAgICAgICAg ICAgYm4gPSBNQ19MRUZUX0ZSSU5HRSAoMywgUWJvdHRvbSwgcm93LT5lbmRzX2F0X3p2X3ApOwor ICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBibiA9IE1DX1JJR0hUX0ZSSU5HRSAoMywg UWJvdHRvbSwgcm93LT5lbmRzX2F0X3p2X3ApOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYg KHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBp ZiAoRVEgKGFycm93X2JvdCwgUWxlZnQpKQorICAgICAgICAgICAgICBibiA9IE1DX0xFRlRfRlJJ TkdFICg3LCBRZG93biwgMCk7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBi biA9IE1DX1JJR0hUX0ZSSU5HRSAoNywgUWRvd24sIDApOworICAgICAgICAgIH0KKyAgICAgIGlm IChibiAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0 IGZyaW5nZV9iaXRtYXAgKmZiID0gZ2V0X2ZyaW5nZV9iaXRtYXBfZGF0YSAoYm4pOworICAgICAg ICAgIGlmIChmYi0+YWxpZ24gPT0gQUxJR05fQklUTUFQX0JPVFRPTSAmJiBmYi0+cGVyaW9kID09 IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdzE7 CisgICAgICAgICAgICAgIGludCBib3RfaW5kX21pbl95OworICAgICAgICAgICAgICBib3RfaW5k X21heF95ID0gcm93LT55ICsgcm93LT52aXNpYmxlX2hlaWdodDsKKyAgICAgICAgICAgICAgYm90 X2luZF9taW5feSA9IGJvdF9pbmRfbWF4X3kgLSBmYi0+aGVpZ2h0OworICAgICAgICAgICAgICBp ZiAoYm90X2luZF9taW5feSA8IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpKQorICAgICAg ICAgICAgICAgIGJvdF9pbmRfbWluX3kgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsK KyAgICAgICAgICAgICAgZm9yICh5ID0gcm93LT55LCBybiA9IGJvdF9pbmRfcm4gLSAxOworICAg ICAgICAgICAgICAgICAgIHkgPj0gYm90X2luZF9taW5feSAmJiBybiA+PSAwOworICAgICAgICAg ICAgICAgICAgIHkgLT0gcm93MS0+aGVpZ2h0LCBybi0tKQorICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAgIGlmICh0b3BfaW5kX3JuID49IDAgJiYgcm4gPD0gdG9wX2luZF9ybikK KyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICByb3cxID0gdy0+ ZGVzaXJlZF9tYXRyaXgtPnJvd3MgKyBybjsKKyAgICAgICAgICAgICAgICAgIGlmICghcm93MS0+ ZW5hYmxlZF9wKQorICAgICAgICAgICAgICAgICAgICByb3cxID0gdy0+Y3VycmVudF9tYXRyaXgt PnJvd3MgKyBybjsKKyAgICAgICAgICAgICAgICAgIHJvdzEtPmluZGljYXRlX2VvYl9wID0gcm93 LT5pbmRpY2F0ZV9lb2JfcDsKKyAgICAgICAgICAgICAgICAgIHJvdzEtPmluZGljYXRlX2JvdHRv bV9saW5lX3AgPSByb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3A7CisgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICBMaXNwX09iamVjdCBidWYgPSB3 LT5jb250ZW50czsKKyAgQ0hFQ0tfQlVGRkVSIChidWYpOworICBib29sIGF1dG9faHNjcm9sbF9t b2RlX3AgPSBFUSAoRmJ1ZmZlcl9sb2NhbF92YWx1ZSAoUWF1dG9faHNjcm9sbF9tb2RlLCBidWYp LCBRY3VycmVudF9saW5lKTsKKyAgLyogRVhBTVBMRTogIChzY3JvbGwtbGVmdCA1KSAqLworICBi b29sIGhzY2xfYWxsX3RlbXBfcCA9ICh3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICYm IHctPm1pbl9oc2Nyb2xsID09IDApOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBu b3RoaW5nLiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMF9wID0gKHctPnN1c3BlbmRfYXV0b19o c2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVf cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gdy0+aHNjcm9sbCk7CisgIC8qIEVY QU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIHNvbWV0aGluZyBlbHNlIGJlc2lkZXMgaG9yaXpvbnRh bGx5IHNjcm9sbGluZyB0aGUKKyAgICAgICAgICAgICAgIGN1cnJlbnQgbGluZSBkaWZmZXJlbnRs eS4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFsbHkgc2Ny b2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8xX3AgPSAoIXctPnN1 c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19o c2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwg PiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gdy0+aHNjcm9s bCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIC4uLgorICAgICAgICAgICAgICAgQ3Vy cmVudCBsaW5lIGlzIF9ub3RfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4gKi8K KyAgYm9vbCBoc2NsX2FsbF9wZXJtXzJfcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA9PSAwCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgdy0+bWluX2hzY3JvbGwgIT0gdy0+aHNjcm9sbCk7CisgIC8qIEVYQU1QTEU6ICAo c2Nyb2xsLWxlZnQgNSk7IGFuZCwgdGhlbiBwcmVzcyB0aGUgbGVmdCBhcnJvdyBrZXkgb25lIHRp bWUuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkgc2Nyb2xs ZWQgZGlmZmVyZW50bHkuKi8KKyAgYm9vbCBoc2NsX3RlbXBfcCA9ICghdy0+c3VzcGVuZF9hdXRv X2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBh bmQgZG8gc29tZXRoaW5nIHRoYXQgY2F1c2VzIHRoZSBjdXJyZW50IGxpbmUgdG8gYmUKKyAgICAg ICAgICAgICAgIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4KKyAgICAgICAgICAg ICAgIEN1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lkIG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICAgICAoIWFjdGl2ZV9wCisgICAg ICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaW5hY3Rp dmVfd2luZG93cykpKQorICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50 ZXJuICgiKy1vdmVybGF5LWFycm93LWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpCisgICAg ICAgICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAo dywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LXByZS16di1mYWNlIiksIHRydWUpCisgICAg ICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICBtY19sZWZ0X2ZyaW5nZV9mYWNl X2lkID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gb3ZlcmxheV9hcnJvd19mYWNlX2lkCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAg ICBpZiAody0+aHNjcm9sbCAhPSAwKQorICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dl dF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ciKSwgZmFsc2UsIHRy dWUpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNf Z2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistb3ZlcmxheS1hcnJvdyIpLCB0cnVlLCB0 cnVlKTsKKyAgICAgICAgICBtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0g TUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IGZyaW5nZV9iaXRtYXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBN Q19OT19GUklOR0VfQklUTUFQOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKCh2cG9zID09 IHZwb3NfZGVzaXJlZCB8fCB2cG9zID09IHZwb3NfY3VycmVudCkKKyAgICAgICAgICAgICAgICAg JiYgZ2x5cGhfZmxhdm9yID09IE1DX09WRVJMQVlfQVJST1dfQklUTUFQCisgICAgICAgICAgICAg ICAgICYmIChoc2NsX2FsbF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxs X3Blcm1fMF9wCisgICAgICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzFfcAorICAg ICAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8yX3AKKyAgICAgICAgICAgICAgICAg ICAgIHx8IGhzY2xfdGVtcF9wCisgICAgICAgICAgICAgICAgICAgICB8fCBoc2NsX3Blcm1fcCkK KyAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAgIHsKKyAgICAgICAgICAg IGludCBmcmluZ2VfYml0bWFwID0gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICAgIGVu dW0gZmFjZV9pZCBvdmVybGF5X2Fycm93X2ZhY2VfaWQgPQorICAgICAgICAgICAgICAoIWFjdGl2 ZV9wCisgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMp LCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkpCisgICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2Zh Y2UgKHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1oc2NsLWluYWN0aXZlLXByZS16di1m YWNlIiksIHRydWUpCisgICAgICAgICAgICAgIDogKGFjdGl2ZV9wKQorICAgICAgICAgICAgICAg ID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1oc2Ns LXByZS16di1mYWNlIiksIHRydWUpCisgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOwor ICAgICAgICAgICAgbWNfbGVmdF9mcmluZ2VfZmFjZV9pZCA9IChjdXJzb3JfdHlwZSA9PSBNQ19M RUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gb3ZlcmxheV9hcnJvd19mYWNlX2lkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAgICAgaWYgKGhzY2xfYWxsX3Blcm1f MF9wKQorICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAg KHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIGZhbHNlLCBmYWxzZSk7CisgICAgICAgICAgICAg IGVsc2UgaWYgKGhzY2xfYWxsX3Blcm1fMV9wKQorICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRt YXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgdHJ1 ZSwgZmFsc2UpOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xfYWxsX3Blcm1fMl9wKQor ICAgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3 LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCBmYWxzZSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAg ICBlbHNlIGlmIChoc2NsX3Blcm1fcCkKKyAgICAgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1h cCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCB0cnVl LCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF9hbGxfdGVtcF9wKQor ICAgICAgICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1h cCAodywgaW50ZXJuICgiKy1oc2NsLXRlbXAiKSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAgICAg ICAgICAgICAgICBlbHNlIGlmIChoc2NsX3RlbXBfcCkKKyAgICAgICAgICAgICAgICAgICAgICAg IGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2Ns LXRlbXAiKSwgdHJ1ZSwgZmFsc2UpOworICAgICAgICAgICAgbWNfbGVmdF9mcmluZ2VfYml0bWFw ID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IGZyaW5nZV9iaXRtYXAKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgICAgfQor ICAgICAgICAgIGVsc2UgaWYgKCh2cG9zID09IHZwb3NfZGVzaXJlZCB8fCB2cG9zID09IHZwb3Nf Y3VycmVudCkKKyAgICAgICAgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xM T1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlw aF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAg ICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5H TEUKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNB TF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZv ciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAg ICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAg ICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIK KyAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9C QVJfQkFDS1NMQVNIKQorICAgICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIExpc3BfT2JqZWN0IGJpdG1hcF9mbGF2b3IgPSAoZ2x5cGhf Zmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0 X2Fycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlw aF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVykKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRf aG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEUpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hvbGxvd19y ZWN0YW5nbGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGds eXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jhcl9yaWdodF9h cnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhf Zmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVykKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGlj YWxfYmFyX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXIKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19S RVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gUW1jX3JldmVyc2VkX3ZlcnRpY2FsX2JhcgorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JB Ul9CQUNLU0xBU0gpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gUW1jX3ZlcnRpY2FsX2Jhcl9iYWNrc2xhc2gKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogUW5pbDsKKyAgICAgICAgICAgICAgbWNfcmlnaHRfZnJpbmdlX2Jp dG1hcCA9IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbG9va3VwX2ZyaW5nZV9iaXRtYXAgKGJp dG1hcF9mbGF2b3IpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBN Q19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgICAgICBtY19yaWdodF9mcmluZ2VfZmFjZV9p ZCA9CisgICAgICAgICAgICAgICAgKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRN QVAKKyAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVgorICAgICAgICAg ICAgICAgICAmJiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVf UklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19S RVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgIHx8 IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpKQorICAgICAgICAgICAg ICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZXZlcnNlZC1iYXIt cHJlLXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBN Q19SSUdIVF9GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9u ID09IEFUX1pWCisgICAgICAgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZF UlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAg IHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cK KyAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZF UlRJQ0FMX0JBUikpCisgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBm LCBpbnRlcm4gKCIrLXJldmVyc2VkLWJhci1hdC16di1mYWNlIiksIHRydWUpCisgICAgICAgICAg ICAgICAgOiAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAorICAgICAgICAg ICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQT1NUX1pWCisgICAgICAgICAgICAgICAgICAg JiYgKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FS Uk9XCisgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNF RF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5 cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikpCisgICAgICAgICAgICAgICAg ICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJldmVyc2VkLWJhci1wb3N0 LXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBNQ19S SUdIVF9GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09 IFBSRV9aVgorICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNF RF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgJiYgZ2x5 cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAg ICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIp CisgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIr LWJhci1wcmUtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICAgIDogKGN1cnNvcl90eXBl ID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgICAmJiByb3dfcG9z aXRpb24gPT0gQVRfWlYKKyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNf UkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAg ICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cK KyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElD QUxfQkFSKQorICAgICAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50 ZXJuICgiKy1iYXItYXQtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICAgIDogKGN1cnNv cl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgICAmJiBy b3dfcG9zaXRpb24gPT0gUE9TVF9aVgorICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZv ciAhPSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk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USU5VQVRJ T05fTElORV9QIChyb3cpKQorICAgICAgICAgICAgICAgfHwgKHJvdy0+cmV2ZXJzZWRfcCAmJiBy b3ctPmNvbnRpbnVlZF9wKSkKKyAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdFICg0LCBRY29u dGludWF0aW9uLCAwKTsKKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfZW1wdHlfbGluZV9w ICYmIEVRIChlbXB0eV9wb3MsIFFsZWZ0KSkKKyAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdF ICg1LCBRZW1wdHlfbGluZSwgMCk7CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX3RvcF9s aW5lX3AgJiYgRVEgKGFycm93X3RvcCwgUWxlZnQpKQorICAgICAgICB7CisgICAgICAgICAgbGVm dCA9IE1DX0xFRlRfRlJJTkdFICg2LCBRdXAsIDApOworICAgICAgICAgIGlmICh0b3BfaW5kX21p bl95ID49IDApCisgICAgICAgICAgICBsZWZ0X29mZnNldCA9IHRvcF9pbmRfbWluX3kgLSByb3ct Pnk7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVf cCAmJiBFUSAoYXJyb3dfYm90LCBRbGVmdCkpCisgICAgICAgIHsKKyAgICAgICAgICBsZWZ0ID0g TUNfTEVGVF9GUklOR0UgKDcsIFFkb3duLCAwKTsKKyAgICAgICAgICBpZiAoYm90X2luZF9tYXhf eSA+PSAwKQorICAgICAgICAgICAgbGVmdF9vZmZzZXQgPSBib3RfaW5kX21heF95IC0gKHJvdy0+ eSArIHJvdy0+dmlzaWJsZV9oZWlnaHQpOworICAgICAgICB9CisgICAgICBlbHNlCisgICAgICAg IGxlZnQgPSBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgLyogRGVjaWRlIHdoaWNoIGJpdG1h cCB0byBkcmF3IGluIHRoZSByaWdodCBmcmluZ2UuICAqLworICAgICAgaWYgKFdJTkRPV19SSUdI VF9GUklOR0VfV0lEVEggKHcpID09IDApCisgICAgICAgIHJpZ2h0ID0gTUNfTk9fRlJJTkdFX0JJ VE1BUDsKKyAgICAgIGVsc2UgaWYgKHJvdy0+cmlnaHRfdXNlcl9mcmluZ2VfYml0bWFwICE9IE1D X05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgIHsKKyAgICAgICAgICByaWdodCA9IHJvdy0+cmln aHRfdXNlcl9mcmluZ2VfYml0bWFwOworICAgICAgICAgIHJpZ2h0X2ZhY2VfaWQgPSByb3ctPnJp Z2h0X3VzZXJfZnJpbmdlX2ZhY2VfaWQ7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKCghcm93 LT5yZXZlcnNlZF9wICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAg ICB8fCAocm93LT5yZXZlcnNlZF9wICYmIHJvdy0+dHJ1bmNhdGVkX29uX2xlZnRfcCkpCisgICAg ICAgIHJpZ2h0ID0gTUNfUklHSFRfRlJJTkdFICgwLCBRdHJ1bmNhdGlvbiwgMCk7CisgICAgICBl bHNlIGlmIChyb3ctPmluZGljYXRlX2JvYl9wICYmIEVRIChib3VuZGFyeV90b3AsIFFyaWdodCkp CisgICAgICAgIHsKKyAgICAgICAgICByaWdodCA9ICgocm93LT5pbmRpY2F0ZV9lb2JfcCAmJiBF USAoYm91bmRhcnlfYm90LCBRcmlnaHQpKQorICAgICAgICAgICAgID8gTUNfUklHSFRfRlJJTkdF ICgxLCBRdG9wX2JvdHRvbSwgdG9wX3Jvd19lbmRzX2F0X3p2X3ApCisgICAgICAgICAgICAgOiBN Q19SSUdIVF9GUklOR0UgKDIsIFF0b3AsIDApKTsKKyAgICAgICAgICBpZiAodG9wX2luZF9taW5f eSA+PSAwKQorICAgICAgICAgICAgcmlnaHRfb2Zmc2V0ID0gdG9wX2luZF9taW5feSAtIHJvdy0+ eTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9lb2JfcCAmJiBFUSAo Ym91bmRhcnlfYm90LCBRcmlnaHQpKQorICAgICAgICB7CisgICAgICAgICAgcmlnaHQgPSBNQ19S SUdIVF9GUklOR0UgKDMsIFFib3R0b20sIGJvdF9yb3dfZW5kc19hdF96dl9wKTsKKyAgICAgICAg ICBpZiAoYm90X2luZF9tYXhfeSA+PSAwKQorICAgICAgICAgICAgcmlnaHRfb2Zmc2V0ID0gYm90 X2luZF9tYXhfeSAtIChyb3ctPnkgKyByb3ctPnZpc2libGVfaGVpZ2h0KTsKKyAgICAgICAgfQor ICAgICAgZWxzZSBpZiAoKCFyb3ctPnJldmVyc2VkX3AgJiYgcm93LT5jb250aW51ZWRfcCkKKyAg ICAgICAgICAgICAgIHx8IChyb3ctPnJldmVyc2VkX3AgJiYgTUFUUklYX1JPV19DT05USU5VQVRJ T05fTElORV9QIChyb3cpKSkKKyAgICAgICAgcmlnaHQgPSBNQ19SSUdIVF9GUklOR0UgKDQsIFFj b250aW51YXRpb24sIDApOworICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV90b3BfbGluZV9w ICYmIEVRIChhcnJvd190b3AsIFFyaWdodCkpCisgICAgICAgIHsKKyAgICAgICAgICByaWdodCA9 IE1DX1JJR0hUX0ZSSU5HRSAoNiwgUXVwLCAwKTsKKyAgICAgICAgICBpZiAodG9wX2luZF9taW5f eSA+PSAwKQorICAgICAgICAgICAgcmlnaHRfb2Zmc2V0ID0gdG9wX2luZF9taW5feSAtIHJvdy0+ eTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9w ICYmIEVRIChhcnJvd19ib3QsIFFyaWdodCkpCisgICAgICAgIHsKKyAgICAgICAgICByaWdodCA9 IE1DX1JJR0hUX0ZSSU5HRSAoNywgUWRvd24sIDApOworICAgICAgICAgIGlmIChib3RfaW5kX21h eF95ID49IDApCisgICAgICAgICAgICByaWdodF9vZm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AgICAgICAgIHx8IHBlcmlvZGljX3AgIT0gY3VyLT5mcmluZ2VfYml0bWFwX3BlcmlvZGlj X3AKKyAgICAgICAgICB8fCBjdXItPnJlZHJhd19mcmluZ2VfYml0bWFwc19wKQorICAgICAgICB7 CisgICAgICAgICAgcmVkcmF3X3AgPSAxLCByb3ctPnJlZHJhd19mcmluZ2VfYml0bWFwc19wID0g MTsKKyAgICAgICAgICBpZiAoIWtlZXBfY3VycmVudF9wKQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBjdXItPnJlZHJhd19mcmluZ2VfYml0bWFwc19wID0gMTsKKyAgICAgICAgICAgICAg aWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQCisgICAgICAg ICAgICAgICAgICB8fCBtY19yaWdodF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRN QVApCisgICAgICAgICAgICAgICAgY3VyLT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3AgPSBmYWxz ZTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPmZyaW5nZV9i aXRtYXBfcGVyaW9kaWNfcCA9IHBlcmlvZGljX3A7CisgICAgICAgICAgICAgIGlmIChtY19sZWZ0 X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICBj dXItPmxlZnRfZnJpbmdlX2JpdG1hcCA9IG1jX2xlZnRfZnJpbmdlX2JpdG1hcDsKKyAgICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPmxlZnRfZnJpbmdlX2JpdG1hcCA9 IGxlZnQ7CisgICAgICAgICAgICAgIGlmIChtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9f RlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICBjdXItPmxlZnRfZnJpbmdlX2ZhY2VfaWQg PSBtY19sZWZ0X2ZyaW5nZV9mYWNlX2lkOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgICAgICAgIGN1ci0+bGVmdF9mcmluZ2VfZmFjZV9pZCA9IGxlZnRfZmFjZV9pZDsKKyAgICAg ICAgICAgICAgaWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQ KQorICAgICAgICAgICAgICAgIGN1ci0+bGVmdF9mcmluZ2Vfb2Zmc2V0ID0gMDsKKyAgICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPmxlZnRfZnJpbmdlX29mZnNldCA9 IGxlZnRfb2Zmc2V0OworICAgICAgICAgICAgICBpZiAobWNfcmlnaHRfZnJpbmdlX2JpdG1hcCAh PSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdl X2JpdG1hcCA9IG1jX3JpZ2h0X2ZyaW5nZV9iaXRtYXA7CisgICAgICAgICAgICAgICAgZWxzZQor ICAgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2VfYml0bWFwID0gcmlnaHQ7CisgICAg ICAgICAgICAgIGlmIChtY19yaWdodF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRN QVApCisgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2VfZmFjZV9pZCA9IG1jX3JpZ2h0 X2ZyaW5nZV9mYWNlX2lkOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAg IGN1ci0+cmlnaHRfZnJpbmdlX2ZhY2VfaWQgPSByaWdodF9mYWNlX2lkOworICAgICAgICAgICAg ICBpZiAobWNfcmlnaHRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAg ICAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX29mZnNldCA9IDA7CisgICAgICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2Vfb2Zmc2V0ID0gcmln aHRfb2Zmc2V0OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBpZiAocm93LT5vdmVy bGF5X2Fycm93X2JpdG1hcCA8IDApCisgICAgICAgIHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAg PSBtY19nZXRfbG9naWNhbF9mcmluZ2VfYml0bWFwICh3LCBRb3ZlcmxheV9hcnJvdywgMCwgMCk7 CisgICAgICBpZiAocm93LT5vdmVybGF5X2Fycm93X2JpdG1hcCAhPSBjdXItPm92ZXJsYXlfYXJy b3dfYml0bWFwKQorICAgICAgICB7CisgICAgICAgICAgcmVkcmF3X3AgPSAxLCByb3ctPnJlZHJh d19mcmluZ2VfYml0bWFwc19wID0gMTsKKyAgICAgICAgICBpZiAoIWtlZXBfY3VycmVudF9wKQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICBjdXItPnJlZHJhd19mcmluZ2VfYml0bWFwc19w ID0gMTsKKyAgICAgICAgICAgICAgY3VyLT5vdmVybGF5X2Fycm93X2JpdG1hcCA9IHJvdy0+b3Zl cmxheV9hcnJvd19iaXRtYXA7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGlmICht Y19sZWZ0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUAorICAgICAgICAgIHx8 IG1jX3JpZ2h0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAg cm93LT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3AgPSBmYWxzZTsKKyAgICAgICAgZWxzZQorICAg ICAgICAgIHJvdy0+ZnJpbmdlX2JpdG1hcF9wZXJpb2RpY19wID0gcGVyaW9kaWNfcDsKKyAgICAg IGlmIChtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0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fRkFDRV9JRDsKKyAgaW50IG9mZnNldCwgaGVhZGVyX2xpbmVfaGVp Z2h0OworICBwLm92ZXJsYXlfcCA9IChvdmVybGF5ICYgMSkgPT0gMTsKKyAgcC5jdXJzb3JfcCA9 IChvdmVybGF5ICYgMikgPT0gMjsKKyAgaWYgKHdoaWNoICE9IE1DX05PX0ZSSU5HRV9CSVRNQVAp CisgICAgeworICAgICAgb2Zmc2V0ID0gMDsKKyAgICB9CisgICAgZWxzZSBpZiAobGVmdF9wKQor ICAgICAgeworICAgICAgICB3aGljaCA9IHJvdy0+bGVmdF9mcmluZ2VfYml0bWFwOworICAgICAg ICBmYWNlX2lkID0gcm93LT5sZWZ0X2ZyaW5nZV9mYWNlX2lkOworICAgICAgICBvZmZzZXQgPSBy b3ctPmxlZnRfZnJpbmdlX29mZnNldDsKKyAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgICAgewor ICAgICAgICAgIHdoaWNoID0gcm93LT5yaWdodF9mcmluZ2VfYml0bWFwOworICAgICAgICAgIGZh Y2VfaWQgPSByb3ctPnJpZ2h0X2ZyaW5nZV9mYWNlX2lkOworICAgICAgICAgIG9mZnNldCA9IHJv dy0+cmlnaHRfZnJpbmdlX29mZnNldDsKKyAgICAgICAgfQorICBpZiAoZmFjZV9pZCA9PSBERUZB VUxUX0ZBQ0VfSUQpCisgICAgeworICAgICAgTGlzcF9PYmplY3QgZmFjZSA9IGZyaW5nZV9mYWNl c1t3aGljaF07CisgICAgICBmYWNlX2lkID0gTklMUCAoZmFjZSkgPyBsb29rdXBfbmFtZWRfZmFj ZSAodywgZiwgUWZyaW5nZSwgZmFsc2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBs b29rdXBfZGVyaXZlZF9mYWNlICh3LCBmLCBmYWNlLCBGUklOR0VfRkFDRV9JRCwgMCk7CisgICAg ICBpZiAoZmFjZV9pZCA8IDApCisgICAgICAgIGZhY2VfaWQgPSBGUklOR0VfRkFDRV9JRDsKKyAg ICB9CisgIGZiID0gZ2V0X2ZyaW5nZV9iaXRtYXBfZGF0YSAod2hpY2gpOworICBwZXJpb2QgPSBm Yi0+cGVyaW9kOworICAvKiBDb252ZXJ0IHJvdyB0byBmcmFtZSBjb29yZGluYXRlcy4gICovCisg IHAueSA9IFdJTkRPV19UT19GUkFNRV9QSVhFTF9ZICh3LCByb3ctPnkpICsgb2Zmc2V0OworICBw LndoaWNoID0gd2hpY2g7CisgIHAuYml0cyA9IGZiLT5iaXRzOworICBwLndkID0gZmItPndpZHRo OworICBwLmggPSBmYi0+aGVpZ2h0OworICBwLmRoID0gKHBlcmlvZCA+IDAgPyAocC55ICUgcGVy aW9kKSA6IDApOworICBwLmggLT0gcC5kaDsKKyAgLyogQWRqdXN0IHkgdG8gdGhlIG9mZnNldCBp biB0aGUgcm93IHRvIHN0YXJ0IGRyYXdpbmcgdGhlIGJpdG1hcC4gICovCisgIHN3aXRjaCAoZmIt PmFsaWduKQorICAgIHsKKyAgICBjYXNlIEFMSUdOX0JJVE1BUF9DRU5URVI6CisgICAgICBwLnkg Kz0gKHJvdy0+aGVpZ2h0IC0gcC5oKSAvIDI7CisgICAgICBicmVhazsKKyAgICBjYXNlIEFMSUdO X0JJVE1BUF9CT1RUT006CisgICAgICBwLnkgKz0gKHJvdy0+dmlzaWJsZV9oZWlnaHQgLSBwLmgp OworICAgICAgYnJlYWs7CisgICAgY2FzZSBBTElHTl9CSVRNQVBfVE9QOgorICAgICAgYnJlYWs7 CisgICAgfQorICBwLmZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGZhY2VfaWQpOworICBpZiAocC5m YWNlID09IE5VTEwpCisgICAgeworICAgICAgLyogVGhpcyBjb3VsZCBoYXBwZW4gYWZ0ZXIgY2xl YXJpbmcgZmFjZSBjYWNoZS4KKyAgICAgIEJ1dCBpdCBzaG91bGRuJ3QgaGFwcGVuIGFueW1vcmUu ICArK2tmcyAqLworICAgICAgcmV0dXJuOworICAgIH0KKyAgcHJlcGFyZV9mYWNlX2Zvcl9kaXNw bGF5IChmLCBwLmZhY2UpOworICAvKiBDbGVhciBsZWZ0IGZyaW5nZSBpZiBubyBiaXRtYXAgdG8g ZHJhdyBvciBpZiBiaXRtYXAgZG9lc24ndCBmaWxsCisgICAgIHRoZSBmcmluZ2UuICAqLworICBw LmJ4ID0gLTE7CisgIGhlYWRlcl9saW5lX2hlaWdodCA9IFdJTkRPV19IRUFERVJfTElORV9IRUlH SFQgKHcpOworICBwLmJ5ID0gV0lORE9XX1RPX0ZSQU1FX1BJWEVMX1kgKHcsIG1heCAoaGVhZGVy X2xpbmVfaGVpZ2h0LCByb3ctPnkpKTsKKyAgcC5ueSA9IHJvdy0+dmlzaWJsZV9oZWlnaHQ7Cisg IGlmIChsZWZ0X3ApCisgICAgeworICAgICAgaW50IHdkID0gV0lORE9XX0xFRlRfRlJJTkdFX1dJ RFRIICh3KTsKKyAgICAgIGludCB4ID0gd2luZG93X2JveF9sZWZ0ICh3LCAoV0lORE9XX0hBU19G UklOR0VTX09VVFNJREVfTUFSR0lOUyAodykKKyAgICAgICAgICAgPyBMRUZUX01BUkdJTl9BUkVB CisgICAgICAgICAgIDogVEVYVF9BUkVBKSk7CisgICAgICBpZiAocC53ZCA+IHdkKQorICAgICAg ICBwLndkID0gd2Q7CisgICAgICBwLnggPSB4IC0gcC53ZCAtICh3ZCAtIHAud2QpIC8gMjsKKyAg ICAgIGlmIChwLndkIDwgd2QgfHwgcC55ID4gcC5ieSB8fCBwLnkgKyBwLmggPCBwLmJ5ICsgcC5u eSkKKyAgICAgICAgeworICAgICAgICAgIC8qIElmIFcgaGFzIGEgdmVydGljYWwgYm9yZGVyIHRv IGl0cyBsZWZ0LCBkb24ndCBkcmF3IG92ZXIgaXQuICAqLworICAgICAgICAgIHdkIC09ICgoIVdJ TkRPV19MRUZUTU9TVF9QICh3KQorICAgICAgICAgICAgLyogVGhpcyBjb3VsZCBiZSB3cm9uZyB3 aGVuIHdlIGFsbG93IHdpbmRvdyBsb2NhbAorICAgICAgICAgICAgICAgcmlnaHQgZGl2aWRlcnMg LSBidXQgdGhlIHdpbmRvdyBvbiB0aGUgbGVmdCBpcyBoYXJkCisgICAgICAgICAgICAgICB0byBn ZXQuICAqLworICAgICAgICAgICAgJiYgIUZSQU1FX1JJR0hUX0RJVklERVJfV0lEVEggKGYpCisg ICAgICAgICAgICAmJiAhV0lORE9XX0hBU19WRVJUSUNBTF9TQ1JPTExfQkFSICh3KQorICAgICAg ICAgICAgLyogQnV0IGRvbid0IHJlZHVjZSB0aGUgZnJpbmdlIHdpZHRoIGlmIHRoZSB3aW5kb3cK KyAgICAgICAgICAgICAgIGhhcyBhIGxlZnQgbWFyZ2luLCBiZWNhdXNlIHRoYXQgbWVhbnMgd2Ug YXJlIG5vdAorICAgICAgICAgICAgICAgaW4gZGFuZ2VyIG9mIGRyYXdpbmcgb3ZlciB0aGUgdmVy dGljYWwgYm9yZGVyLAorICAgICAgICAgICAgICAgYW5kIE9UT0ggbGVhdmluZyBvdXQgdGhhdCBv bmUgcGl4ZWwgbGVhdmVzIGJlaGluZAorICAgICAgICAgICAgICAgdHJhY2VzIG9mIHRoZSBjdXJz b3IsIGlmIGl0IHdhcyBpbiBjb2x1bW4gemVybworICAgICAgICAgICAgICAgYmVmb3JlIGRyYXdp bmcgbm9uLWVtcHR5IG1hcmdpbiBhcmVhLiAgKi8KKyAgICAgICAgICAgICYmIHctPmxlZnRfbWFy Z2luX2NvbHMgPT0gMCkKKyAgICAgICAgICAgPyAxIDogMCk7CisgICAgICAgICAgcC5ieCA9IHgg LSB3ZDsKKyAgICAgICAgICBwLm54ID0gd2Q7CisgICAgICAgIH0KKyAgICB9CisgIGVsc2UKKyAg ICB7CisgICAgICBpbnQgeCA9IHdpbmRvd19ib3hfcmlnaHQgKHcsCisgICAgICAgIChXSU5ET1df SEFTX0ZSSU5HRVNfT1VUU0lERV9NQVJHSU5TICh3KQorICAgICAgICAgPyBSSUdIVF9NQVJHSU5f QVJFQQorICAgICAgICAgOiBURVhUX0FSRUEpKTsKKyAgICAgIGludCB3ZCA9IFdJTkRPV19SSUdI VF9GUklOR0VfV0lEVEggKHcpOworICAgICAgaWYgKHAud2QgPiB3ZCkKKyAgICAgICAgcC53ZCA9 IHdkOworICAgICAgcC54ID0geCArICh3ZCAtIHAud2QpIC8gMjsKKyAgICAgIC8qIENsZWFyIHJp Z2h0IGZyaW5nZSBpZiBubyBiaXRtYXAgdG8gZHJhdyBvZiBpZiBiaXRtYXAgZG9lc24ndCBmaWxs CisgICB0aGUgZnJpbmdlLiAgKi8KKyAgICAgIGlmIChwLndkIDwgd2QgfHwgcC55ID4gcC5ieSB8 fCBwLnkgKyBwLmggPCBwLmJ5ICsgcC5ueSkKKyAgICAgICAgeworICAgICAgICAgIHAuYnggPSB4 OworICAgICAgICAgIHAubnggPSB3ZDsKKyAgICAgICAgfQorICAgIH0KKyAgaWYgKHAueCA+PSBX SU5ET1dfQk9YX0xFRlRfRURHRV9YICh3KQorICAgICAgJiYgKHAueCArIHAud2QpIDw9IFdJTkRP V19CT1hfTEVGVF9FREdFX1ggKHcpICsgV0lORE9XX1BJWEVMX1dJRFRIICh3KSkKKyAgICBGUkFN RV9SSUYgKGYpLT5kcmF3X2ZyaW5nZV9iaXRtYXAgKHcsIHJvdywgJnApOworfQorCit2b2lkCitt Y19kcmF3X2ZyaW5nZV9iaXRtYXAgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cg KnJvdywgaW50IGxlZnRfcCwgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSkKK3sKKyAg aW50IG92ZXJsYXkgPSAwOworICBpZiAobGVmdF9wID09IHJvdy0+cmV2ZXJzZWRfcCAmJiByb3ct PmN1cnNvcl9pbl9mcmluZ2VfcCkKKyAgICB7CisgICAgICBMaXNwX09iamVjdCBjdXJzb3IgPSBR bmlsOworICAgICAgc3dpdGNoIChjdXJzb3JfdHlwZSkKKyAgICAgICAgeworICAgICAgICBjYXNl IE1DX0ZSQU1FRF9CT1g6CisgICAgICAgICAgaWYgKHJvdy0+dmlzaWJsZV9oZWlnaHQgPj0gU1RB TkRBUkRfQklUTUFQX0hFSUdIVCAoaG9sbG93X3JlY3RhbmdsZV9iaXRzKSkKKyAgICAgICAgICAg IGN1cnNvciA9IFFob2xsb3c7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgY3Vyc29yID0g UWhvbGxvd19zbWFsbDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19IT0xMT1df Qk9YOgorICAgICAgICAgIGlmIChyb3ctPnZpc2libGVfaGVpZ2h0ID49IFNUQU5EQVJEX0JJVE1B UF9IRUlHSFQgKGhvbGxvd19yZWN0YW5nbGVfYml0cykpCisgICAgICAgICAgICBjdXJzb3IgPSBR aG9sbG93OworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGN1cnNvciA9IFFob2xsb3dfc21h bGw7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAgICAg ICAgICBjdXJzb3IgPSBRYm94OworICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1DX0JB UjoKKyAgICAgICAgICBjdXJzb3IgPSBRYmFyOworICAgICAgICAgIGJyZWFrOworICAgICAgICBj YXNlIE1DX0hCQVI6CisgICAgICAgICAgY3Vyc29yID0gUWhiYXI7CisgICAgICAgICAgYnJlYWs7 CisgICAgICAgIGNhc2UgTUNfTk9fRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgY2FzZSBNQ19OT19D VVJTT1I6CisgICAgICAgIGNhc2UgTUNfUklHSFRfRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgY2Fz ZSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgdy0+ cGh5c19jdXJzb3Jfb25fcCA9IDA7CisgICAgICAgICAgcm93LT5jdXJzb3JfaW5fZnJpbmdlX3Ag PSAwOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBpZiAoIU5JTFAgKGN1cnNv cikpCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgYm0gPSBtY19nZXRfbG9naWNhbF9jdXJzb3Jf Yml0bWFwICh3LCBjdXJzb3IpOworICAgICAgICAgIGlmIChibSAhPSBNQ19OT19GUklOR0VfQklU TUFQKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXBf MSAodywgcm93LCBsZWZ0X3AsIDIsIGJtKTsKKyAgICAgICAgICAgICAgb3ZlcmxheSA9IEVRIChj dXJzb3IsIFFib3gpID8gMyA6IDE7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9Cisg IG1jX2RyYXdfZnJpbmdlX2JpdG1hcF8xICh3LCByb3csIGxlZnRfcCwgb3ZlcmxheSwgTUNfTk9f RlJJTkdFX0JJVE1BUCk7CisgIGlmIChsZWZ0X3AgJiYgcm93LT5vdmVybGF5X2Fycm93X2JpdG1h cCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcF8xICh3 LCByb3csIDEsIDEsIHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXApOworfQorCisvKiBlbmQgTVVM VElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogI2RlZmluZSBO T19GUklOR0VfQklUTUFQIDAKICNkZWZpbmUgVU5ERUZfRlJJTkdFX0JJVE1BUCAxCiAjZGVmaW5l IE1BWF9TVEFOREFSRF9GUklOR0VfQklUTUFQUyBBUlJBWUVMVFMgKHN0YW5kYXJkX2JpdG1hcHMp CkBAIC0xNzAwLDYgKzMyMjIsMTY4IEBAIFJldHVybiBuaWwgaWYgUE9TIGlzIG5vdCB2aXNpYmxl IGluIFdJTkRPVy4gICov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gKFFtY19xdWFkcnVwbGVfYW5nbGVf ZG93biwgIistcXVhZHJ1cGxlLWFuZ2xlLWRvd24iKTsKKyAgVmZyaW5nZV9iaXRtYXBzID0gRmNv bnMgKFFtY19xdWFkcnVwbGVfYW5nbGVfZG93biwgVmZyaW5nZV9iaXRtYXBzKTsKKyAgRnB1dCAo UW1jX3F1YWRydXBsZV9hbmdsZV9kb3duLCBRZnJpbmdlLCBtYWtlX2ZpeG51bSAoNDgpKTsKKyAg LyogKGdldCAnKy1xdWFkcnVwbGUtYW5nbGUtZG93biAnZnJpbmdlKSA9PiA0OCAqLworCisvKiBl bmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBE RUZTWU0gKFF0cnVuY2F0aW9uLCAidHJ1bmNhdGlvbiIpOwogICBERUZTWU0gKFFjb250aW51YXRp b24sICJjb250aW51YXRpb24iKTsKICAgREVGU1lNIChRb3ZlcmxheV9hcnJvdywgIm92ZXJsYXkt YXJyb3ciKTsKZGlmZiAtLWdpdCBhL3NyYy9uc3Rlcm0uaCBiL3NyYy9uc3Rlcm0uaAppbmRleCA3 OGNlNjA4Li44ZWYwZGZlIDEwMDY0NAotLS0gYS9zcmMvbnN0ZXJtLmgKKysrIGIvc3JjL25zdGVy bS5oCkBAIC02NjAsNiArNjYwLDE2IEBAIHR5cGVkZWYgaWQgaW5zdGFuY2V0eXBlOwogCiBAaW50 ZXJmYWNlIEVtYWNzU2Nyb2xsZXIgOiBOU1Njcm9sbGVyCiAgIHsKKworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIE5TUmVjdCBtY19yZWN0 YW5nbGU7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgIHN0cnVjdCB3aW5kb3cg KndpbmRvdzsKICAgIHN0cnVjdCBmcmFtZSAqZnJhbWU7CiAgICBOU1Jlc3BvbmRlciAqcHJldlJl c3BvbmRlcjsKQEAgLTY4MCw2ICs2OTAsMTggQEAgdHlwZWRlZiBpZCBpbnN0YW5jZXR5cGU7CiAg ICBpbnQgZW1fd2hvbGU7CiAgICB9CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBN VUxUSVBMRS1DVVJTT1JTICovCisKKy0gKHZvaWQpbWNfc2V0X3JlY3RhbmdsZTogKE5TUmVjdCly ZWN0OworLSAoTlNSZWN0KW1jX2dldF9yZWN0YW5nbGU7CistIChzdHJ1Y3Qgd2luZG93ICopbWNf Z2V0X3dpbmRvdzsKKy0gKGJvb2wpbWNfanVkZ2U7CisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKIC0gKGluc3RhbmNldHlwZSkgaW5pdEZyYW1lOiAoTlNSZWN0IClyIHdpbmRvdzogKExp c3BfT2JqZWN0KXdpbjsKIC0gKHZvaWQpc2V0RnJhbWU6IChOU1JlY3QpcjsKIApkaWZmIC0tZ2l0 IGEvc3JjL25zdGVybS5tIGIvc3JjL25zdGVybS5tCmluZGV4IDgxZDM2YmUuLmFiMzdlMDYgMTAw NjQ0Ci0tLSBhL3NyYy9uc3Rlcm0ubQorKysgYi9zcmMvbnN0ZXJtLm0KQEAgLTc2LDYgKzc2LDk4 MCBAQCBVcGRhdGVkIGJ5IENocmlzdGlhbiBMaW1wYWNoIChjaHJpc0BuaWNlLmNoKQogc3RhdGlj IEVtYWNzTWVudSAqbWFpbk1lbnU7CiA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+d2lkdGgsIHMtPngpOworICBOU0NvbG9yICpob2xsb3dfY29sb3IgPSBGUkFNRV9CQUNLR1JP VU5EX0NPTE9SIChzLT5mKTsKKyAgc3RydWN0IGZhY2UgKmZhY2UgPSBGQUNFX0ZST01fSUQgKHMt PmYsIERFRkFVTFRfRkFDRV9JRCk7CisgIGludCB2bnRoID0gTUFUUklYX1JPV19WUE9TIChyb3cs IG1hdHJpeCk7CisgIC8qIFNUUkVUQ0hfR0xZUEggbWF5IGNvbnRhaW4gbW9yZSB0aGFuIG9uZSBm YWtlIGN1cnNvciBhdCB0aGUgc2FtZSBIUE9TLgorICBOT1RFOiAgQSBmYWtlIGN1cnNvciBmcm9t IG9uZSBjYWNoZSBtYXkgb3ZlcndyaXRlIGEgZmFrZSBjdXJzb3IgZnJvbSBhbm90aGVyCisgIGNh Y2hlIC0tIHRodXMsIHdlIG11c3QgY2hlY2sgdGhlbSBhbGwgZm9yIG92ZXJ3cml0dGVuIGZha2Ug Y3Vyc29ycy4gKi8KKyAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NB Q0hFOworICAgICAgIGNhY2hlX3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICArK2NhY2hlX3R5cGUp CisgICAgeworICAgICAgZm9yIChpbnQgbnRoID0gMDsKKyAgICAgICAgICAgcworICAgICAgICAg ICAmJiBzLT53LT5tY19tYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5cGVdID4gMAorICAgICAg ICAgICAmJiBudGggPCBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hl X3R5cGVdOworICAgICAgICAgICArK250aCkKKyAgICAgICAgeworICAgICAgICAgIGludCB4ID0g cy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS54OworICAg ICAgICAgIGludCBmeCA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhdL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LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhdLmZvcmVncm91bmQuZ3JlZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgLmJsdWUgPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLmZvcmVncm91bmQuYmx1ZX07CisgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfYmcg PSB7LnJlZCA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF0uYmFja2dyb3VuZC5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdy ZWVuID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5i YWNrZ3JvdW5kLmdyZWVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVl ID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5iYWNr Z3JvdW5kLmJsdWV9OworICAgICAgICAgIGJvb2wgYWN0aXZlX3AgPSBzLT53LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmFjdGl2ZV9wOworICAgICAgICAgIGVu dW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGhfZmxhdm9yOworICAgICAgICAgIGJvb2wgZW5hYmxl ZF9wID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5l bmFibGVkX3A7CisgICAgICAgICAgYm9vbCBnb19wID0gKHZwb3MgPT0gdm50aAorICAgICAgICAg ICAgICAgICAgICAgICAmJiBocG9zID09IGN1cnNvcl9nbHlwaC0+aHBvcworICAgICAgICAgICAg ICAgICAgICAgICAmJiBlbmFibGVkX3ApOworICAgICAgICAgIGlmICghZ29fcCkKKyAgICAgICAg ICAgIGNvbnRpbnVlOworICAgICAgICAgIE5TUmVjdCByOworICAgICAgICAgIHIub3JpZ2luLngg PSBmeDsKKyAgICAgICAgICByLm9yaWdpbi55ID0gZnk7CisgICAgICAgICAgci5zaXplLmhlaWdo dCA9IGg7CisgICAgICAgICAgci5zaXplLndpZHRoID0gd2Q7CisgICAgICAgICAgW1tOU0NvbG9y IGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6IGxzbF9mZy5yZWQKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBncmVlbjogbHNsX2ZnLmdyZWVuCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGJsdWU6IGxzbF9mZy5ibHVlCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgYWxwaGE6IDEuMF0gc2V0XTsKKyAgICAgIGlmIChjdXJzb3JfdHlw ZSA9PSBNQ19GUkFNRURfQk9YKQorICAgICAgICB7CisgICAgICAgICAgTGlzcF9PYmplY3QgYnVm ID0gcy0+dy0+Y29udGVudHM7CisgICAgICAgICAgQ0hFQ0tfQlVGRkVSIChidWYpOworICAgICAg ICAgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSIChidWYpOworICAgICAgICAgIGJvb2wgcmVn aW9uX2FjdGl2ZV9wID0gKCFOSUxQIChWdHJhbnNpZW50X21hcmtfbW9kZSkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgbWFya19hY3RpdmUpKSk7 CisgICAgICAgICAgcHRyZGlmZl90IHJlZ2lvbl9iZWcgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IG1j X3JlZ2lvbl9saW1pdCAoMSkgOiAtMTsK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R1JPVU5E IChob2xsb3dfYWN0aXZlX2ZhY2UpLCBzLT5mKTsKKyAgICAgICAgICAgICAgICAgICAgaG9sbG93 X2NvbG9yID0gaG9sbG93X2FjdGl2ZV9jb2xvcjsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAg ICAgICAgICAgICAgIGVsc2UgaWYgKCFhY3RpdmVfcCkKKyAgICAgICAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfaW5hY3RpdmVfZmFjZV9p ZCA9IGxvb2t1cF9uYW1lZF9mYWNlIChzLT53LCBzLT5mLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1j dXJzb3ItaW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAg ICAgc3RydWN0IGZhY2UgKmhvbGxvd19pbmFjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChzLT5m LCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgTlNDb2xv ciAqaG9sbG93X2luYWN0aXZlX2NvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZB Q0VfQkFDS0dST1VORCAoaG9sbG93X2luYWN0aXZlX2ZhY2UpLCBzLT5mKTsKKyAgICAgICAgICAg ICAgICAgICAgICBob2xsb3dfY29sb3IgPSBob2xsb3dfaW5hY3RpdmVfY29sb3I7CisgICAgICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChmYWNlICYmIE5TX0ZB Q0VfQkFDS0dST1VORCAoZmFjZSkgPT0gbnNfaW5kZXhfY29sb3IgKEZSQU1FX0NVUlNPUl9DT0xP UiAocy0+ZiksIHMtPmYpKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIFtuc19sb29rdXBfaW5k ZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChmYWNlKSwgcy0+Zikgc2V0XTsKKyAgICAg ICAgICAgIGhvbGxvd19jb2xvciA9IEZSQU1FX0NVUlNPUl9DT0xPUiAocy0+Zik7CisgICAgICAg ICAgfQorICAgICAgICAgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgICAgICAgICB7CisgICAg ICAgICAgICAgIGNhc2UgTUNfTk9fRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgICAgICAgICBicmVh azsKKyAgICAgICAgICAgICAgY2FzZSBNQ19OT19DVVJTT1I6CisgICAgICAgICAgICAgICAgYnJl YWs7CisgICAgICAgICAgICAgIGNhc2UgTUNfUklHSFRfRlJJTkdFX0JJVE1BUDoKKyAgICAgICAg ICAgICAgY2FzZSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgICAgICAgIGNhc2UgTUNf RklMTEVEX0JPWDoKKyAgICAgICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAg ICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSBNQ19GUkFNRURfQk9YOgorICAgICAgICAg ICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAgICAgIFtob2xsb3dfY29sb3Igc2V0 XTsKKyAgICAgICAgICAgICAgICBOU1JlY3RGaWxsIChOU0luc2V0UmVjdCAociwgMSwgMSkpOwor ICAgICAgICAgICAgICAgIFtGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpIHNldF07CisgICAgICAg ICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgTUNfSE9MTE9XX0JPWDoKKyAgICAg ICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAgICAgICBbaG9sbG93X2NvbG9y IHNldF07CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAoTlNJbnNldFJlY3QgKHIsIDEsIDEp KTsKKyAgICAgICAgICAgICAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChzLT5mKSBzZXRdOworICAg ICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX0hCQVI6CisgICAgICAg ICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAg ICAgICAgIGNhc2UgTUNfQkFSOgorICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAg ICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgIC8qIElmIGEgZ2x5 cGggZXhpc3RzIChzLT5jaGFyMmIgIT0gTlVMTCksIHRoZW4gZHJhdyB0aGUgZ2x5cGggb24gdG9w IG9mIHRoZQorICAgICAgICAgIG5ld2x5IGRyYXduIHJlY3RhbmdsZSB0aGF0IHdhcyBjcmVhdGVk IGhlcmVpbmFib3ZlLiAgVG8gdGhlIGV4dGVudCB0aGF0IHdlCisgICAgICAgICAgd2FudCB0byBk b3VibGUtaW1wcmludCBnbHlwaHMgdG8gbWFrZSB0aGVtIGFwcGVhciB0byBiZSBzZW1pLWJvbGQs IGl0IGNhbgorICAgICAgICAgIGJlIGRvbmUgaGVyZSBmb3IgYWxsIGN1cnNvciB0eXBlcy4gIFRo ZSBib3gtc3R5bGUgY3Vyc29ycyBhcmUgaW1wcmludGVkCisgICAgICAgICAgd2l0aCBnbHlwaHMg b25seSBvbmUgKDEpIHRpbWUuICBUaGUgc2VtaS1ib2xkIGFwcGVhcmFuY2UgaXMgaGVscGZ1bCB3 aGVuCisgICAgICAgICAgZGVidWdnaW5nIHRvIHNlZSB0aGF0IHRoZSBjb29yZGluYXRlcyBhcmUg Y29ycmVjdC4gKi8KKyAgICAgICAgICBpZiAocy0+Y2hhcjJiICE9IE5VTEwKKyAgICAgICAgICAg ICAgJiYgKGN1cnNvcl90eXBlID09IE1DX0ZJTExFRF9CT1gKKyAgICAgICAgICAgICAgICAgIHx8 IGN1cnNvcl90eXBlID09IE1DX0ZSQU1FRF9CT1gKKyAgICAgICAgICAgICAgICAgIHx8IGN1cnNv cl90eXBlID09IE1DX0hPTExPV19CT1gpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBC T09MIGlzQ29tcG9zaXRlID0gcy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBI OworICAgICAgICAgICAgICBpZiAoaXNDb21wb3NpdGUpCisgICAgICAgICAgICAgICAgbnNfZHJh d19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHMpOworICAgICAgICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZv bnQgKmZvbnQgPSBzLT5mYWNlLT5mb250OworICAgICAgICAgICAgICAgICAgICBpZiAoIWZvbnQp CisgICAgICAgICAgICAgICAgICAgICAgZm9udCA9IEZSQU1FX0ZPTlQgKHMtPmYpOworICAgICAg ICAgICAgICAgICAgICBib29sIHdpdGhfYmdfcCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAg ICBmb250LT5kcml2ZXItPmRyYXcgKHMsIHMtPmNtcF9mcm9tLCBzLT5uY2hhcnMsIHMtPngsIHMt PnliYXNlLCB3aXRoX2JnX3ApOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQor ICAgICAgICB9CisgICAgfQorICAvLyAgY2xvY2tfdCBjbG9ja19lbmQgPSBjbG9jaygpOworICAv LyAgZG91YmxlIGNwdV90aW1lX3VzZWQgPSAoKGRvdWJsZSkgKGNsb2NrX2VuZCAtIGNsb2NrX3N0 YXJ0KSkgLyBDTE9DS1NfUEVSX1NFQzsKKyAgLy8gIGZwcmludGYgKHN0ZGVyciwgIm5zX2RyYXdf b3ZlcndyaXR0ZW4gKCVkKTogIFRJTUUgKCVmKVxuIiwgdnBvcywgY3B1X3RpbWVfdXNlZCk7Cit9 CisKK3N0YXRpYyB2b2lkCittY19uc19kcmF3X3dpbmRvd19jdXJzb3IgKHN0cnVjdCB3aW5k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R1JPVU5EX0lOREVYXTsKKyAgICAgZnByaW50ZiAoc3RkZXJyLCAiXG5mb3Jl Z3JvdW5kICglcykgfCBiYWNrZ3JvdW5kICglcylcbiIsCisgICAgICAgICAgICAgICAgICAgICAg KCFOSUxQIChmb3JlZ3JvdW5kKSA/IFNTREFUQSAoZm9yZWdyb3VuZCkgOiAiTklMUCIpLAorICAg ICAgICAgICAgICAgICAgICAgICghTklMUCAoYmFja2dyb3VuZCkgPyBTU0RBVEEgKGJhY2tncm91 bmQpIDogIk5JTFAiKSk7CisgIC0gIEVYQU1QTEUgT0YgSE9XIFRPIENSRUFURSBBIENPTE9SIFdJ VEggUkdCL0xTTCBmbG9hdCB2YWx1ZXM6CisgICAgIE5TQ29sb3IgKm15X2NvbG9yID0gW05TQ29s b3IgY29sb3JXaXRoQ2FsaWJyYXRlZFJlZDogMS4wCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBncmVlbjogMS4wCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmx1ZTogMS4wCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHBoYTogMS4wXTsKKyAgLSAg QUxURVJOQVRJVkUgRVhBTVBMRToKKyAgICAgZW51bSBmYWNlX2lkIGRlYnVnZ2luZ19mYWNlX2lk ID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAoIistZGVidWdnaW5nLWZh Y2UiKSwgdHJ1ZSk7CisgICAgIHN0cnVjdCBmYWNlICpkZWJ1Z2dpbmdfZmFjZSA9IEZBQ0VfRlJP TV9JRCAocy0+ZiwgZGVidWdnaW5nX2ZhY2VfaWQpOworICAgICBOU0NvbG9yICpjb2xvciA9IG5z X2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQgKGRlYnVnZ2luZ19mYWNl KSwgcy0+Zik7CisgICAgIFtjb2xvciBzZXRdOyAqLworICBpZiAoZ2x5cGhfZmxhdm9yID09IE1D X0dMWVBICisgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEhMRVNTKQorICAgIFtbTlND b2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiBsc2wucmVkCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgZ3JlZW46IGxzbC5ncmVlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBibHVlOiBsc2wuYmx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscGhh OiAxLjBdIHNldF07CisgICAgZWxzZQorICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAoZikgc2V0 XTsKKyAgaWYgKGN1cnNvcl90eXBlID09IE1DX0ZSQU1FRF9CT1gpCisgICAgeworICAgICAgTGlz cF9PYmplY3QgYnVmID0gdy0+Y29udGVudHM7CisgICAgICBDSEVDS19CVUZGRVIgKGJ1Zik7Cisg ICAgICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAoYnVmKTsKKyAgICAgIGJvb2wgcmVnaW9u X2FjdGl2ZV9wID0gKCFOSUxQIChWdHJhbnNpZW50X21hcmtfbW9kZSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBtYXJrX2FjdGl2ZSkpKTsKKyAgICAg IHB0cmRpZmZfdCByZWdpb25fYmVnID0gKHJlZ2lvbl9hY3RpdmVfcCkgPyBtY19yZWdpb25fbGlt aXQgKDEpIDogLTE7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2VuZCA9IChyZWdpb25fYWN0aXZl X3ApID8gbWNfcmVnaW9uX2xpbWl0ICgwKSA6IC0xOworICAgICAgaWYgKHJlZ2lvbl9hY3RpdmVf cAorICAgICAgICAgICYmIGFjdGl2ZV9wCisgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFy cG9z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U19GQUNFX0ZP UkVHUk9VTkQgKGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZSksIGYpOworICAgICAg ICAgICAgICBob2xsb3dfY29sb3IgPSBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2NvbG9y OworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAoYWN0aXZlX3ApCisgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNl X2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNv ci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9s bG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQp OworICAgICAgICAgICAgICAgIE5TQ29sb3IgKmhvbGxvd19hY3RpdmVfY29sb3IgPSBuc19sb29r dXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5EIChob2xsb3dfYWN0aXZlX2ZhY2Up LCBmKTsKKyAgICAgICAgICAgICAgICBob2xsb3dfY29sb3IgPSBob2xsb3dfYWN0aXZlX2NvbG9y OworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIC8qIFRoZSByZWdpb24gaXMgX25vdF8g dmlzaWJsZSBpbiB0aGUgaW5hY3RpdmUgd2luZG93IGJlY2F1c2UgdGhlIG92ZXJsYXkgd2luZG93 IHByb3BlcnR5IGlzIHVzZWQuICovCisgICAgICAgICAgICAgIGVsc2UgaWYgKCFhY3RpdmVfcCkK KyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93 X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1y ZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAg ICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19pbmFjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lE IChmLCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICBOU0NvbG9y ICpob2xsb3dfaW5hY3RpdmVfY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFD RV9CQUNLR1JPVU5EIChob2xsb3dfaW5hY3RpdmVfZmFjZSksIGYpOworICAgICAgICAgICAgICAg ICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2luYWN0aXZlX2NvbG9yOworICAgICAgICAgICAgICAg IH0KKyAgICB9CisgICAgZWxzZSBpZiAoZmFjZSAmJiBOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2Up ID09IG5zX2luZGV4X2NvbG9yIChGUkFNRV9DVVJTT1JfQ09MT1IgKGYpLCBmKSkKKyAgICAgIHsK KyAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQgKGZh Y2UpLCBmKSBzZXRdOworICAgICAgICBob2xsb3dfY29sb3IgPSBGUkFNRV9DVVJTT1JfQ09MT1Ig KGYpOworICAgICAgfQorI2lmZGVmIE5TX0lNUExfQ09DT0EKKyAgTlNEaXNhYmxlU2NyZWVuVXBk YXRlcyAoKTsKKyNlbmRpZgorICBzd2l0Y2ggKGN1cnNvcl90eXBlKQorICAgIHsKKyAgICAgIGNh c2UgTUNfTk9fRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1DX05P X0NVUlNPUjoKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1DX1JJR0hUX0ZSSU5HRV9CSVRN QVA6CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVA6Cisg ICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19GSUxMRURfQk9YOgorICAgICAgICBOU1JlY3RG aWxsIChyKTsKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1DX0ZSQU1FRF9CT1g6CisgICAg ICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICBbaG9sbG93X2NvbG9yIHNldF07CisgICAgICAg IE5TUmVjdEZpbGwgKE5TSW5zZXRSZWN0IChyLCAxLCAxKSk7CisgICAgICAgIFtGUkFNRV9DVVJT T1JfQ09MT1IgKGYpIHNldF07CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19IT0xMT1df Qk9YOgorICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgW2hvbGxvd19jb2xvciBzZXRd OworICAgICAgICBOU1JlY3RGaWxsIChOU0luc2V0UmVjdCAociwgMSwgMSkpOworICAgICAgICBb RlJBTUVfQ1VSU09SX0NPTE9SIChmKSBzZXRdOworICAgICAgICBicmVhazsKKyAgICAgIGNhc2Ug TUNfSEJBUjoKKyAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgIGJyZWFrOworICAgICAg Y2FzZSBNQ19CQVI6CisgICAgICAgIHMgPSByOworICAgICAgICAvKiBAbGF3bGlzdCBpcyBmb2N1 c2luZyB0aGUgaW5pdGlhbCBkZXZlbG9wbWVudCBvZiBmZWF0dXJlIHJlcXVlc3RzCisgICAgICAg ICMxNzY4NCBhbmQgIzIyODczIG9uIEwyUiBsYW5ndWFnZXMuICovCisgICAgICAgIGlmIChnbHlw aF9mbGF2b3IgIT0gTUNfR0xZUEgKKyAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19H TFlQSExFU1MpCisgICAgICAgICAgeworICAgICAgICAgICAgLyogSWYgdGhlIGNoYXJhY3RlciB1 bmRlciBjdXJzb3IgaXMgUjJMLCBkcmF3IHRoZSBiYXIgY3Vyc29yCisgICAgICAgICAgICAgICBv biB0aGUgcmlnaHQgb2YgaXRzIGdseXBoLCByYXRoZXIgdGhhbiBvbiB0aGUgbGVmdC4gKi8KKyAg ICAgICAgICAgIGlmICgoY3Vyc29yX2dseXBoLT5yZXNvbHZlZF9sZXZlbCAmIDEpICE9IDApCisg ICAgICAgICAgICAgIHMub3JpZ2luLnggKz0gY3Vyc29yX2dseXBoLT5waXhlbF93aWR0aCAtIHMu c2l6ZS53aWR0aDsKKyAgICAgICAgICB9CisgICAgICAgIE5TUmVjdEZpbGwgKHMpOworICAgICAg ICBicmVhazsKKyAgICB9CisgIG5zX3Jlc2V0X2NsaXBwaW5nIChmKTsKKyAgLyogZHJhdyB0aGUg Y2hhcmFjdGVyIHVuZGVyIHRoZSBjdXJzb3IgKi8KKyAgaWYgKGdseXBoX2ZsYXZvciAhPSBNQ19H TFlQSExFU1MKKyAgICAgICYmIChjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YCisgICAgICAg ICAgfHwgY3Vyc29yX3R5cGUgPT0gTUNfRklMTEVEX0JPWAorICAgICAgICAgIHx8IGN1cnNvcl90 eXBlID09IE1DX0hPTExPV19CT1gKKyAgICAgICAgICB8fCAoZGVidWdfcAorICAgICAgICAgICAg ICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19IQkFSKQorICAgICAgICAgIHx8IChkZWJ1Z19wCisgICAg ICAgICAgICAgICYmIGN1cnNvcl90eXBlID09IE1DX0JBUikpKQorICAgIHsKKyAgICAgIC8qIGBj dXJzb3JfZ2NfcGAgaXMgdXNlZCBvbmx5IGJ5IGB3MzJ0ZXJtLmNgIGFuZCBgeHRlcm0uYycuICov CisgICAgICBib29sIGN1cnNvcl9nY19wID0gZmFsc2U7CisgICAgICBYUmVjdGFuZ2xlICpzYXZl ZF9jbGlwID0gTlVMTDsKKyAgICAgIGlmIChyb3ctPmNsaXAgIT0gTlVMTCkKKyAgICAgICAgewor ICAgICAgICAgIHNhdmV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0+dW5kZXJsaW5lX3ApCisgICAgewor ICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfV0FWRSkKKyAg ICAgICAgeworICAgICAgICAgIGlmIChmYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3ApCisgICAg ICAgICAgICBbZGVmYXVsdENvbCBzZXRdOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKGZhY2UtPnVuZGVybGluZV9jb2xvciwgcy0+Zikg c2V0XTsKKyAgICAgICAgICBuc19kcmF3X3VuZGVyd2F2ZSAocywgd2lkdGgsIHgpOworICAgICAg ICB9CisgICAgICAgIGVsc2UgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5E RVJfTElORSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBOU1JlY3QgcjsKKyAgICAgICAgICAg IHVuc2lnbmVkIGxvbmcgdGhpY2tuZXNzLCBwb3NpdGlvbjsKKyAgICAgICAgICAgIC8qIElmIHRo ZSBwcmV2IHdhcyB1bmRlcmxpbmVkLCBtYXRjaCBpdHMgYXBwZWFyYW5jZS4gKi8KKyAgICAgICAg ICAgIGlmIChzLT5wcmV2ICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV9wCisgICAgICAgICAg ICAgICAgJiYgcy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5F CisgICAgICAgICAgICAgICAgJiYgcy0+cHJldi0+dW5kZXJsaW5lX3RoaWNrbmVzcyA+IDApCisg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB0aGlja25lc3MgPSBzLT5wcmV2LT51bmRl cmxpbmVfdGhpY2tuZXNzOworICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gcy0+cHJldi0+dW5k ZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZm9udCAqZm9udDsKKyAg ICAgICAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZGVzY2VudDsKKyAgICAgICAgICAgICAgICAg IGZvbnQ9cy0+Zm9udDsKKyAgICAgICAgICAgICAgICAgIGRlc2NlbnQgPSBzLT55ICsgcy0+aGVp Z2h0IC0gcy0+eWJhc2U7CisgICAgICAgICAgICAgICAgICAvKiBVc2UgdW5kZXJsaW5lIHRoaWNr bmVzcyBvZiBmb250LCBkZWZhdWx0aW5nIHRvIDEuICovCisgICAgICAgICAgICAgICAgICB0aGlj a25lc3MgPSAoZm9udCAmJiBmb250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4gMCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gZm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzcworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiAxOworICAgICAgICAgICAgICAgICAgLyogRGV0ZXJt aW5lIHRoZSBvZmZzZXQgb2YgdW5kZXJsaW5pbmcgZnJvbSB0aGUgYmFzZWxpbmUuICovCisgICAg ICAgICAgICAgICAgICBpZiAoeF91bmRlcmxpbmVfYXRfZGVzY2VudF9saW5lKQorICAgICAgICAg ICAgICAgICAgICBwb3NpdGlvbiA9IGRlc2NlbnQgLSB0aGlja25lc3M7CisgICAgICAgICAgICAg ICAgICAgIGVsc2UgaWYgKHhfdXNlX3VuZGVybGluZV9wb3NpdGlvbl9wcm9wZXJ0aWVzCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIGZvbnQgJiYgZm9udC0+dW5kZXJsaW5lX3Bvc2l0 aW9uID49IDApCisgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBmb250LT51bmRlcmxp bmVfcG9zaXRpb247CisgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoZm9udCkKKyAgICAg ICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gbHJvdW5kIChmb250LT5kZXNjZW50IC8gMik7 CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAg IHBvc2l0aW9uID0gdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0OworICAgICAgICAgICAgICAgICAg cG9zaXRpb24gPSBtYXggKHBvc2l0aW9uLCB1bmRlcmxpbmVfbWluaW11bV9vZmZzZXQpOworICAg ICAgICAgICAgICAgICAgLyogRW5zdXJlIHVuZGVybGluaW5nIGlzIG5vdCBjcm9wcGVkLiAqLwor ICAgICAgICAgICAgICAgICAgaWYgKGRlc2NlbnQgPD0gcG9zaXRpb24pCisgICAgICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IGRlc2NlbnQgLSAxOwor ICAgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IDE7CisgICAgICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoZGVzY2VudCA8IHBvc2l0aW9uICsgdGhp Y2tuZXNzKQorICAgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IDE7CisgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgcy0+dW5kZXJsaW5lX3RoaWNrbmVzcyA9IHRoaWNrbmVzczsK KyAgICAgICAgICAgIHMtPnVuZGVybGluZV9wb3NpdGlvbiA9IHBvc2l0aW9uOworICAgICAgICAg ICAgciA9IE5TTWFrZVJlY3QgKHgsIHMtPnliYXNlICsgcG9zaXRpb24sIHdpZHRoLCB0aGlja25l c3MpOworICAgICAgICAgICAgaWYgKGZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAg ICAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAg ICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoZmFjZS0+dW5kZXJsaW5lX2NvbG9yLCBz LT5mKSBzZXRdOworICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAgfQorICAg IH0KKyAgLyogRG8gb3ZlcmxpbmUuIFdlIGZvbGxvdyBvdGhlciB0ZXJtcyBpbiB1c2luZyBhIHRo aWNrbmVzcyBvZiAxCisgICAgIGFuZCBpZ25vcmluZyBvdmVybGluZV9tYXJnaW4uICovCisgIGlm IChmYWNlLT5vdmVybGluZV9wKQorICAgIHsKKyAgICAgIE5TUmVjdCByOworICAgICAgciA9IE5T TWFrZVJlY3QgKHgsIHMtPnksIHdpZHRoLCAxKTsKKyAgICAgIGlmIChmYWNlLT5vdmVybGluZV9j b2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsKKyAgICAgICAgZWxz ZQorICAgICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoZmFjZS0+b3ZlcmxpbmVfY29s b3IsIHMtPmYpIHNldF07CisgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICB9CisgIC8qIERvIHN0 cmlrZS10aHJvdWdoLiAgV2UgZm9sbG93IG90aGVyIHRlcm1zIGZvciB0aGlja25lc3MgYW5kCisg ICAgIHZlcnRpY2FsIHBvc2l0aW9uLiovCisgIGlmIChmYWNlLT5zdHJpa2VfdGhyb3VnaF9wKQor ICAgIHsKKyAgICAgIE5TUmVjdCByOworICAgICAgdW5zaWduZWQgbG9uZyBkeTsKKyAgICAgIGR5 ID0gbHJpbnQgKChzLT5oZWlnaHQgLSAxKSAvIDIpOworICAgICAgciA9IE5TTWFrZVJlY3QgKHgs IHMtPnkgKyBkeSwgd2lkdGgsIDEpOworICAgICAgaWYgKGZhY2UtPnN0cmlrZV90aHJvdWdoX2Nv bG9yX2RlZmF1bHRlZF9wKQorICAgICAgICBbZGVmYXVsdENvbCBzZXRdOworICAgICAgICBlbHNl CisgICAgICAgICAg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0+ZmFjZV9pZCk7 CisgICAgICBiZ0NvbCA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9V TkQgKGZhY2UpLCBzLT5mKTsKKyAgICAgIGZnQ29sID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3Ig KE5TX0ZBQ0VfRk9SRUdST1VORCAoZmFjZSksIHMtPmYpOworICAgICAgZm9yIChpID0gMDsgaSA8 IG47ICsraSkKKyAgICAgICAgeworICAgICAgICAgIGlmICghcy0+cm93LT5mdWxsX3dpZHRoX3Ap CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGludCBvdmVycnVuLCBsZWZ0b3ZlcnJ1bjsK KyAgICAgICAgICAgICAgLyogdHJ1bmNhdGUgdG8gYXZvaWQgb3ZlcndyaXRpbmcgZnJpbmdlIGFu ZC9vciBzY3JvbGxiYXIgKi8KKyAgICAgICAgICAgICAgb3ZlcnJ1biA9IG1heCAoMCwgKHMtPngg KyBzLT5iYWNrZ3JvdW5kX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg LSAoV0lORE9XX0JPWF9SSUdIVF9FREdFX1ggKHMtPncpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAtIFdJTkRPV19SSUdIVF9GUklOR0VfV0lEVEggKHMtPncpKSk7CisgICAgICAgICAg ICAgICAgICAgIHJbaV0uc2l6ZS53aWR0aCAtPSBvdmVycnVuOworICAgICAgICAgICAgICAvKiB0 cnVuY2F0ZSB0byBhdm9pZCBvdmVyd3JpdGluZyB0byBsZWZ0IG9mIHRoZSB3aW5kb3cgYm94ICov CisgICAgICAgICAgICAgIGxlZnRvdmVycnVuID0gKFdJTkRPV19CT1hfTEVGVF9FREdFX1ggKHMt PncpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgV0lORE9XX0xFRlRfRlJJTkdFX1dJ RFRIIChzLT53KSkgLSBzLT54OworICAgICAgICAgICAgICBpZiAobGVmdG92ZXJydW4gPiAwKQor ICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIHJbaV0ub3JpZ2luLnggKz0gbGVm dG92ZXJydW47CisgICAgICAgICAgICAgICAgICByW2ldLnNpemUud2lkdGggLT0gbGVmdG92ZXJy dW47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAvKiBYWFg6IFRyeSB0byB3b3Jr IGJldHdlZW4gcHJvYmxlbSB3aGVyZSBhIHN0cmV0Y2ggZ2x5cGggb24KKyAgICAgICAgICAgICAg ICAgYSBwYXJ0aWFsbHktdmlzaWJsZSBib3R0b20gcm93IHdpbGwgY2xlYXIgcGFydCBvZiB0aGUK KyAgICAgICAgICAgICAgICAgbW9kZWxpbmUsIGFuZCBhbm90aGVyIHdoZXJlIGxpc3QtYnVmZmVy cyBoZWFkZXJzIGFuZCBzaW1pbGFyCisgICAgICAgICAgICAgICAgIHJvd3MgZXJyb25lb3VzbHkg aGF2ZSB2aXNpYmxlX2hlaWdodCBzZXQgdG8gMC4gIE5vdCBzdXJlCisgICAgICAgICAgICAgICAg IHdoZXJlIHRoaXMgaXMgY29taW5nIGZyb20gYXMgb3RoZXIgdGVybXMgc2VlbSBub3QgdG8gc2hv dy4gKi8KKyAgICAgICAgICAgICAgcltpXS5zaXplLmhlaWdodCA9IG1pbiAocy0+aGVpZ2h0LCBz LT5yb3ctPnZpc2libGVfaGVpZ2h0KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBbYmdDb2wg c2V0XTsKKyAgICAgICAgICAvKiBOT1RFOiB1bmRlciBOUyB0aGlzIGlzIE5PVCB1c2VkIHRvIGRy YXcgY3Vyc29ycywgYnV0IHdlIG11c3QgYXZvaWQKKyAgICAgICAgICAgICBvdmVyd3JpdGluZyBj dXJzb3IgKHVzdWFsbHkgd2hlbiBjdXJzb3Igb24gYSB0YWIpICovCisgICAgICAgICAgaWYgKHMt PmhsID09IERSQVdfQ1VSU09SKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBGSVhN RTogIERvIHdlIHN0aWxsIG5lZWQgdG8gcHJldmVudCB0aGlzIHNlY3Rpb24gb2YgY29kZSBmcm9t CisgICAgICAgICAgICAgIGVyYXNpbmcgdGhlIGZha2UgTUNfSEJBUiB0aGF0IGV4dGVuZHMgdGhl IGVudGlyZSBsZW5ndGggb2YgdGhlCisgICAgICAgICAgICAgIFNUUkVUQ0hfR0xZUEg/ICBUaGlz IG1heSBoYXZlIGJlZW4gZG9uZSBwcmlvciB0byB0aGUgZml4IHJlbGF0aW5nCisgICAgICAgICAg ICAgIHRvIGxlZnQvcmlnaHQgb3ZlcndyaXR0ZW4gZ2x5cGhzLiAqLworICAgICAgICAgICAgICBy W2ldLnNpemUuaGVpZ2h0IC09IDE7CisgICAgICAgICAgICAgIC8vICBlbnVtIGZhY2VfaWQgZGVi dWdnaW5nX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ZiwgaW50ZXJuICgi Ky1kZWJ1Z2dpbmctZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgLy8gIHN0cnVjdCBmYWNl ICpkZWJ1Z2dpbmdfZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgZGVidWdnaW5nX2ZhY2VfaWQp OworICAgICAgICAgICAgICAvLyAgTlNDb2xvciAqY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9j b2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChkZWJ1Z2dpbmdfZmFjZSksIHMtPmYpOworICAgICAg ICAgICAgICAvLyAgW2NvbG9yIHNldF07CisgICAgICAgICAgICAgIENHRmxvYXQgeCA9IHJbaV0u b3JpZ2luLng7CisgICAgICAgICAgICAgIENHRmxvYXQgd2lkdGggPSB3ZDsKKyAgICAgICAgICAg ICAgcltpXS5zaXplLndpZHRoIC09IHdpZHRoOworICAgICAgICAgICAgICByW2ldLm9yaWdpbi54 ICs9IHdpZHRoOworICAgICAgICAgICAgICBOU1JlY3RGaWxsIChyW2ldKTsKKyAgICAgICAgICAg ICAgLyogRHJhdyBvdmVybGluaW5nLCBldGMuIG9uIHRoZSBjdXJzb3IuICovCisgICAgICAgICAg ICAgIGlmIChzLT53LT5waHlzX2N1cnNvcl90eXBlID09IE1DX0ZJTExFRF9CT1gpCisgICAgICAg ICAgICAgICAgbWNfbnNfZHJhd190ZXh0X2RlY29yYXRpb24gKHMsIGZhY2UsIGJnQ29sLCB3aWR0 aCwgeCk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgbWNfbnNfZHJh d190ZXh0X2RlY29yYXRpb24gKHMsIGZhY2UsIGZnQ29sLCB3aWR0aCwgeCk7CisgICAgICAgICAg ICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAvLyAgaW50IHJ4ID0gcltpXS5v cmlnaW4ueDsKKyAgLy8gIGludCByeSA9IHJbaV0ub3JpZ2luLnk7CisgIC8vICBpbnQgcncgPSBy W2ldLnNpemUud2lkdGg7CisgIC8vICBpbnQgcmggPSByW2ldLnNpemUuaGVpZ2h0OworICAvLyAg ZnByaW50ZiAoc3RkZXJyLCAibWNfbnNfZHVtcGdseXBoc19zdHJldGNoOiAgdnBvcyAoJWQpIHwg cnggKCVkKSB8IHJ5ICglZCkgfCBydyAoJWQpIHwgcmggKCVkKVxuIiwKKyAgLy8gICAgICAgICAg ICAgICAgICAgcy0+Zmlyc3RfZ2x5cGgtPnZwb3MsIHJ4LCByeSwgcncsIHJoKTsKKyAgICAgICAg ICAgICAgTlNSZWN0RmlsbCAocltpXSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgLyogRHJh dyBvdmVybGluaW5nLCBldGMuIG9uIHRoZSBzdHJldGNoIGdseXBoIChvciB0aGUgcGFydAorICAg ICAgICAgICAgIG9mIHRoZSBzdHJldGNoIGdseXBoIGFmdGVyIHRoZSBjdXJzb3IpLiAqLworICAg ICAgICAgIG1jX25zX2RyYXdfdGV4dF9kZWNvcmF0aW9uICh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WR0aCwgcy0+c2xpY2UuaGVpZ2h0KTsK KyAgTlNSZWN0RmlsbCAoYnIpOworICAvKiBEcmF3IHRoZSBpbWFnZS4uIGRvIHdlIG5lZWQgdG8g ZHJhdyBwbGFjZWhvbGRlciBpZiBpbWcgPT1uaWw/ICovCisgIGlmIChpbWcgIT0gbmlsKQorICAg IHsKKyNpZmRlZiBOU19JTVBMX0NPQ09BCisgICAgICBOU1JlY3QgZHIgPSBOU01ha2VSZWN0ICh4 LCB5LCBzLT5zbGljZS53aWR0aCwgcy0+c2xpY2UuaGVpZ2h0KTsKKyAgICAgIE5TUmVjdCBpciA9 IE5TTWFrZVJlY3QgKHMtPnNsaWNlLngsIHMtPnNsaWNlLnksCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBzLT5zbGljZS53aWR0aCwgcy0+c2xpY2UuaGVpZ2h0KTsKKyAgICAgIFtpbWcg ZHJhd0luUmVjdDogZHIKKyAgICAgICAgICAgICBmcm9tUmVjdDogaXIKKyAgICAgICAgICAgICBv cGVyYXRpb246IE5TQ29tcG9zaXRlU291cmNlT3ZlcgorICAgICAgICAgICAgICBmcmFjdGlvbjog MS4wCisgICAgICAgICAgIHJlc3BlY3RGbGlwcGVkOiBZRVMKKyAgICAgICAgICAgICAgICBoaW50 czogbmlsXTsKKyNlbHNlCisgICAgICBbaW1nIGNvbXBvc2l0ZVRvUG9pbnQ6IE5TTWFrZVBvaW50 ICh4LCB5ICsgcy0+c2xpY2UuaGVpZ2h0KQorICAgICAgICAgICAgICAgICAgb3BlcmF0aW9uOiBO U0NvbXBvc2l0ZVNvdXJjZU92ZXJdOworI2VuZGlmCisgICAgfQorICBpZiAocy0+aGwgPT0gRFJB V19DVVJTT1IpCisgICAgeworICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAocy0+Zikgc2V0XTsK KyAgICAgIGlmIChzLT53LT5waHlzX2N1cnNvcl90eXBlID09IE1DX0ZJTExFRF9CT1gpCisgICAg ICAgIHRkQ29sID0gb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cy0+aGwgPT0gRFJBV19JTUFHRV9SQUlT RUQpCisgICAgICAgIHsKKyAgICAgICAgICB0aCA9IHRvb2xfYmFyX2J1dHRvbl9yZWxpZWYgPj0g MCA/CisgICAgICAgICAgICB0b29sX2Jhcl9idXR0b25fcmVsaWVmIDogREVGQVVMVF9UT09MX0JB Ul9CVVRUT05fUkVMSUVGOworICAgICAgICAgIHJhaXNlZF9wID0gKHMtPmhsID09IERSQVdfSU1B R0VfUkFJU0VEKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAg ICAgICAgdGggPSBhYnMgKHMtPmltZy0+cmVsaWVmKTsKKyAgICAgICAgICAgIHJhaXNlZF9wID0g KHMtPmltZy0+cmVsaWVmID4gMCk7CisgICAgICAgICAgfQorICAgICAgci5vcmlnaW4ueCA9IHgg LSB0aDsKKyAgICAgIHIub3JpZ2luLnkgPSB5IC0gdGg7CisgICAgICByLnNpemUud2lkdGggPSBz LT5zbGljZS53aWR0aCArIDIqdGgtMTsKKyAgICAgIHIuc2l6ZS5oZWlnaHQgPSBzLT5zbGljZS5o ZWlnaHQgKyAyKnRoLTE7CisgICAgICBuc19kcmF3X3JlbGllZiAociwgdGgsIHJhaXNlZF9wLAor ICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLnkgPT0gMCwKKyAgICAgICAgICAgICAgICAg ICAgICBzLT5zbGljZS55ICsgcy0+c2xpY2UuaGVpZ2h0ID09IHMtPmltZy0+aGVpZ2h0LAorICAg ICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLnggPT0gMCwKKyAgICAgICAgICAgICAgICAgICAg ICBzLT5zbGljZS54ICsgcy0+c2xpY2Uud2lkdGggPT0gcy0+aW1nLT53aWR0aCwgcyk7CisgICAg fQorICAvKiBJZiB0aGVyZSBpcyBubyBtYXNrLCB0aGUgYmFja2dyb3VuZCB3b24ndCBiZSBzZWVu LAorICAgICBzbyBkcmF3IGEgcmVjdGFuZ2xlIG9uIHRoZSBpbWFnZSBmb3IgdGhlIGN1cnNvci4K KyAgICAgRG8gdGhpcyBmb3IgYWxsIGltYWdlcywgZ2V0dGluZyB0cmFuc3BhcmVuY3kgcmlnaHQg aXMgbm90IHJlbGlhYmxlLiAqLworICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IpCisgICAgewor ICAgICAgaW50IHRoaWNrbmVzcyA9IGFicyAocy0+aW1nLT5yZWxpZWYpOworICAgICAgaWYgKHRo aWNrbmVzcyA9PSAwKSB0aGlja25lc3MgPSAxOworICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNf R0xZUEgKKyAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBITEVTUykKKyAgICAgIHsK KyAgICAgICAgTlNDb2xvciAqYm9yZGVyX2NvbG9yID0gW05TQ29sb3IgY29sb3JXaXRoQ2FsaWJy YXRlZFJlZDogbHNsLnJlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGdyZWVuOiBsc2wuZ3JlZW4KKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmx1ZTogbHNsLmJsdWUKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBh bHBoYTogMS4wXTsKKyAgICAgICAgbnNfZHJhd19ib3ggKGJyLCB0aGlja25lc3MsIGJvcmRlcl9j b2xvciwgMSwgMSk7CisgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIG5zX2RyYXdfYm94IChi ciwgdGhpY2tuZXNzLCBGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpLCAxLCAxKTsKKyAgICB9Cit9 CisKK3N0YXRpYyB2b2lkCittY19uc19tYXliZV9kdW1wZ2x5cGhzX2JhY2tncm91bmQgKHN0cnVj dCBnbHlwaF9zdHJpbmcgKnMsIGNoYXIgZm9yY2VfcCkKK3sKKyAgTlNUUkFDRSAoIm1jX25zX21h eWJlX2R1bXBnbHlwaHNfYmFja2dyb3VuZCIpOworICBpZiAoIXMtPmJhY2tncm91bmRfZmlsbGVk X3AvKiB8fCBzLT5obCA9PSBEUkFXX01PVVNFX0ZBQ0UqLykKKyAgICB7CisgICAgICBpbnQgYm94 X2xpbmVfd2lkdGggPSBtYXggKHMtPmZhY2UtPmJveF9saW5lX3dpZHRoLCAwKTsKKyAgICAgIGlm IChGT05UX0hFSUdIVCAocy0+Zm9udCkgPCBzLT5oZWlnaHQgLSAyICogYm94X2xpbmVfd2lkdGgK KyAgICAgICAgICAvKiBXaGVuIHhkaXNwLmMgaWdub3JlcyBGT05UX0hFSUdIVCwgd2UgY2Fubm90 IHRydXN0IGZvbnQKKyAgICAgICAgICAgICBkaW1lbnNpb25zLCBzaW5jZSB0aGUgYWN0dWFsIGds eXBocyBtaWdodCBiZSBtdWNoCisgICAgICAgICAgICAgc21hbGxlci4gIFNvIGluIHRoYXQgY2Fz ZSB3ZSBhbHdheXMgY2xlYXIgdGhlIHJlY3RhbmdsZQorICAgICAgICAgICAgIHdpdGggYmFja2dy b3VuZCBjb2xvci4gKi8KKyAgICAgICAgICB8fCBGT05UX1RPT19ISUdIIChzLT5mb250KQorICAg ICAgICAgIHx8IHMtPmZvbnRfbm90X2ZvdW5kX3AgfHwgcy0+ZXh0ZW5kc190b19lbmRfb2ZfbGlu ZV9wIHx8IGZvcmNlX3ApCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZmFjZSAqZmFjZTsK KyAgICAgICAgICBpZiAocy0+aGwgPT0gRFJBV19NT1VTRV9GQUNFKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICBmYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBNT1VTRV9ITF9JTkZPIChz LT5mKS0+bW91c2VfZmFjZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgaWYgKCFmYWNlKQorICAg ICAgICAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIE1PVVNFX0ZBQ0VfSUQpOwor ICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBmYWNlID0gRkFD RV9GUk9NX0lEIChzLT5mLCBzLT5maXJzdF9nbHlwaC0+ZmFjZV9pZCk7CisgICAgICAgICAgaWYg KCFmYWNlLT5zdGlwcGxlKQorICAgICAgICAgICAgWyhOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2Up ICE9IDAKKyAgICAgICAgICAgICAgPyBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9C QUNLR1JPVU5EIChmYWNlKSwgcy0+ZikKKyAgICAgICAgICAgICAgOiBGUkFNRV9CQUNLR1JPVU5E X0NPTE9SIChzLT5mKSkgc2V0XTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgIHN0cnVjdCBuc19kaXNwbGF5X2luZm8gKmRweWluZm8gPSBGUkFNRV9E SVNQTEFZX0lORk8gKHMtPmYpOworICAgICAgICAgICAgICAgIFtbZHB5aW5mby0+Yml0bWFwc1tm YWNlLT5zdGlwcGxlLTFdLmltZyBzdGlwcGxlTWFza10gc2V0XTsKKyAgICAgICAgICAgICAgfQor ICAgICAgICAgIGlmIChzLT5obCAhPSBEUkFXX0NVUlNPUikKKyAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgcy0+cmVjdGFuZ2xlX251a2VkX3AgPSB0cnVlOworICAgICAgICAgICAgICBOU1Jl Y3QgciA9IE5TTWFrZVJlY3QgKHMtPngsIHMtPnkgKyBib3hfbGluZV93aWR0aCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPmJhY2tncm91bmRfd2lkdGgsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzLT5oZWlnaHQtMipib3hfbGluZV93aWR0aCk7 CisgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKH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X0dMWVBIUywgIm1jX25zX2RyYXdfZ2x5cGhfc3RyaW5nIik7CisgIGlmIChzLT5uZXh0 ICYmIHMtPnJpZ2h0X292ZXJoYW5nICYmICFzLT5mb3Jfb3ZlcmxhcHMpCisgICAgeworICAgICAg aW50IHdpZHRoOworICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAqbmV4dDsKKyAgICAgIGZvciAo d2lkdGggPSAwLCBuZXh0ID0gcy0+bmV4dDsKKyAgICAgICAgICAgbmV4dCAmJiB3aWR0aCA8IHMt PnJpZ2h0X292ZXJoYW5nOworICAgICAgICAgICB3aWR0aCArPSBuZXh0LT53aWR0aCwgbmV4dCA9 IG5leHQtPm5leHQpCisgICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSAhPSBJTUFH RV9HTFlQSCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpZiAobmV4dC0+Zmlyc3RfZ2x5cGgt PnR5cGUgIT0gU1RSRVRDSF9HTFlQSCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg IG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocy0+bmV4dCwgcik7CisgICAgICAg ICAgICAgICAgaWYgKCFuc19jbGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4pKQorICAgICAgICAgICAg ICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIG1jX25zX21heWJlX2R1bXBnbHlwaHNfYmFj a2dyb3VuZCAocy0+bmV4dCwgMSk7CisgICAgICAgICAgICAgICAgbnNfcmVzZXRfY2xpcHBpbmcg KHMtPmYpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAg IG1jX25zX2R1bXBnbHlwaHNfc3RyZXRjaCAocy0+bmV4dCwgbWF0cml4LCByb3csIHdkKTsKKyAg ICAgICAgICAgIG5leHQtPm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgfQorICAgIH0KKyAgaWYg KCFzLT5mb3Jfb3ZlcmxhcHMgJiYgcy0+ZmFjZS0+Ym94ICE9IEZBQ0VfTk9fQk9YCisgICAgICAm JiAocy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgIHx8IHMtPmZp cnN0X2dseXBoLT50eXBlID09IENPTVBPU0lURV9HTFlQSCkpCisgICAgeworICAgICAgbiA9IG5z X2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAgICAgIGlmICghbnNfY2xpcF90 b19yZWN0IChzLT5mLCByLCBuKSkKKyAgICAgICAgcmV0dXJuOworICAgICAgbWNfbnNfbWF5YmVf ZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzLCAxKTsKKyAgICAgIG5zX2R1bXBnbHlwaHNfYm94X29y X3JlbGllZiAocyk7CisgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICBib3hf ZHJhd25fcCA9IDE7CisgICAgfQorICBzd2l0Y2ggKHMtPmZpcnN0X2dseXBoLT50eXBlKQorICAg IHsKKyAgICBjYXNlIElNQUdFX0dMWVBIOgorICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdf Y2xpcF9yZWN0IChzLCByKTsKKyAgICAgIGlmICghbnNfY2xpcF90b19yZWN0IChzLT5mLCByLCBu KSkKKyAgICAgICAgcmV0dXJuOworICAgICAgbWNfbnNfZHVtcGdseXBoc19pbWFnZSAocywgclsw XSwgbHNsLCBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCBhY3RpdmVfcCk7CisgICAgICBuc19y ZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICBicmVhazsKKyAgICBjYXNlIFNUUkVUQ0hfR0xZ UEg6CisgICAgICBtY19uc19kdW1wZ2x5cGhzX3N0cmV0Y2ggKHMsIG1hdHJpeCwgcm93LCB3ZCk7 CisgICAgICBicmVhazsKKyAgICBjYXNlIENIQVJfR0xZUEg6CisgICAgY2FzZSBDT01QT1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0VfRk9SRUdST1VORCAocy0+ZmFjZSk7CisgICAgICAg ICAgTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKSA9IHRtcDsKKyAgICAgICAgfQorICAgICAg ICBlbHNlIGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUgorICAgICAgICAgICAgICAgICAmJiBjdXJz b3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YCisgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9wKQor ICAgICAgICAgIHsKKyAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2Vf aWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ZiwgaW50ZXJuICgiKy1yZWFsLWZha2Ut Y3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhv bGxvd19hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgaG9sbG93X2FjdGl2ZV9mYWNl X2lkKTsKKyAgICAgICAgICAgIE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSkgPSBOU19GQUNF X0ZPUkVHUk9VTkQgKGhvbGxvd19hY3RpdmVfZmFjZSk7CisgICAgICAgICAgfQorICAgICAgICAg IGVsc2UgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SCisgICAgICAgICAgICAgICAgICAgJiYgY3Vy c29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWAorICAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9w KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0 aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ZiwgaW50ZXJuICgiKy1y ZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAg ICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2luYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKHMt PmYsIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgTlNfRkFDRV9GT1JF R1JPVU5EIChzLT5mYWNlKSA9IE5TX0ZBQ0VfRk9SRUdST1VORCAoaG9sbG93X2luYWN0aXZlX2Zh Y2UpOworICAgICAgICAgICAgfQorICAgICAgeworICAgICAgICBCT09MIGlzQ29tcG9zaXRlID0g cy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIOworICAgICAgICBpZiAoaXND b21wb3NpdGUpCisgICAgICAgICAgbnNfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVn cm91bmQgKHMpOworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg Ym9vbCB3aXRoX2JnX3AgPSAoKGZsYWdzID09IE5TX0RVTVBHTFlQSF9OT1JNQUwgJiYgIXMtPmJh Y2tncm91bmRfZmlsbGVkX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGZs YWdzID09IE5TX0RVTVBHTFlQSF9NT1VTRUZBQ0UpOworICAgICAgICAgICAgICBpZiAod2l0aF9i Z19wKQorICAgICAgICAgICAgICAgIHMtPmJhY2tncm91bmRfbnVrZWRfcCA9IHRydWU7CisgICAg ICAgICAgICAgIGZvbnQtPmRyaXZlci0+ZHJhdyAocywgcy0+Y21wX2Zyb20sIHMtPm5jaGFycywg cy0+eCwgcy0+eWJhc2UsIHdpdGhfYmdfcCk7CisgICAgICAgICAgICB9CisgICAgICB9CisgICAg ICB7CisgICAgICAgIE5TQ29sb3IgKmNvbCA9IChOU19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2Up ICE9IDAKKyAgICAgICAgICAgICAgICAgICAgICAgID8gbnNfbG9va3VwX2luZGV4ZWRfY29sb3Ig KE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSksCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBzLT5mKQorICAgICAgICAgICAgICAgICAgICAgICAg OiBGUkFNRV9GT1JFR1JPVU5EX0NPTE9SIChzLT5mKSk7CisgICAgICAgIFtjb2wgc2V0XTsKKyAg ICAgICAgLyogRHJhdyB1bmRlcmxpbmUsIG92ZXJsaW5lLCBzdHJpa2UtdGhyb3VnaC4gKi8KKyAg ICAgICAgbWNfbnNfZHJhd190ZXh0X2RlY29yYXRpb24gKHMsIHMtPmZhY2UsIGNvbCwgcy0+d2lk dGgsIHMtPngpOworICAgICAgfQorICAgICAgeworICAgICAgICBpZiAocy0+Zmlyc3RfZ2x5cGgt PnR5cGUgIT0gQ09NUE9TSVRFX0dMWVBICisgICAgICAgICAgICAmJiAocy0+bGVmdF9vdmVyd3Jp dHRlbl9wIHx8IHMtPnJpZ2h0X292ZXJ3cml0dGVuX3ApCisgICAgICAgICAgICAmJiAocy0+YmFj a2dyb3VuZF9udWtlZF9wIHx8IHMtPnJlY3RhbmdsZV9udWtlZF9wKQorICAgICAgICAgICAgJiYg KHMtPmFjdGlvbl90eXBlID09IE1DX0RSQVdfR0xZUEggfHwgcy0+YWN0aW9uX3R5cGUgPT0gTUNf RVJBU0VfR0xZUEgpKQorICAgICAgICAgIG1jX25zX2RyYXdfb3ZlcndyaXR0ZW4gKHMsIG1hdHJp eCwgcm93LCBzLT5maXJzdF9nbHlwaCk7CisgICAgICB9CisgICAgICBpZiAocy0+aGwgPT0gRFJB V19DVVJTT1IKKyAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9YKQorICAg ICAgICB7CisgICAgICAgICAgdW5zaWduZWQgbG9uZyB0bXAgPSBOU19GQUNFX0JBQ0tHUk9VTkQg KHMtPmZhY2UpOworICAgICAgICAgIE5TX0ZBQ0VfQkFDS0dST1VORCAocy0+ZmFjZSkgPSBOU19G QUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2UpOworICAgICAgICAgIE5TX0ZBQ0VfRk9SRUdST1VORCAo cy0+ZmFjZSkgPSB0bXA7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAocy0+aGwgPT0gRFJB V19DVVJTT1IKKyAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JP WCkKKyAgICAgICAgICBOU19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2UpID0gc2F2ZWRfZmc7Cisg ICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICBicmVhazsKKyAgICBjYXNlIEdM WVBITEVTU19HTFlQSDoKKyAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAo cywgcik7CisgICAgICBpZiAoIW5zX2NsaXBfdG9fcmVjdCAocy0+ZiwgciwgbikpCisgICAgICAg IHJldHVybjsKKyAgICAgIGlmIChzLT5mb3Jfb3ZlcmxhcHMgfHwgKHMtPmNtcF9mcm9tID4gMAor ICAgICAgICAgICAgJiYgISBzLT5maXJzdF9nbHlwaC0+dS5jbXAuYXV0b21hdGljKSkKKyAgICAg ICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IDE7CisgICAgICBlbHNlCisgICAgICAgIG1jX25z X21heWJlX2R1bXBnbHlwaHNfYmFja2dyb3VuZCAocywgcy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0g Q09NUE9TSVRFX0dMWVBIKTsKKyAgICAgIC8qIC4uLiAqLworICAgICAgLyogTm90IHlldCBpbXBs ZW1lbnRlZC4gKi8KKyAgICAgIC8qIC4uLiAqLworICAgICAgbnNfcmVzZXRfY2xpcHBpbmcgKHMt PmYpOworICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOwor ICAgIH0KKyAgLyogRHJhdyBib3ggaWYgbm90IGRvbmUgYWxyZWFkeS4gKi8KKyAgaWYgKCFzLT5m b3Jfb3ZlcmxhcHMgJiYgIWJveF9kcmF3bl9wICYmIHMtPmZhY2UtPmJveCAhPSBGQUNFX05PX0JP WCkKKyAgICB7CisgICAgICBuID0gbnNfZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsIHIp OworICAgICAgaWYgKCFuc19jbGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4pKQorICAgICAgICByZXR1 cm47CisgICAgICBuc19kdW1wZ2x5cGhzX2JveF9vcl9yZWxpZWYgKHMpOworICAgICAgbnNfcmVz ZXRfY2xpcHBpbmcgKHMtPmYpOworICAgIH0KKyAgcy0+bnVtX2NsaXBzID0gMDsKK30KKworLyog ZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC8q ID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09CiAKICAgIE5TVFJBQ0UsIFRyYWNlIHN1cHBvcnQuCkBAIC0xMTA5 LDYgKzIwODMsMTYgQEAgc3RhdGljIE5TUmVjdCBjb25zdHJhaW5fZnJhbWVfcmVjdChOU1JlY3Qg ZnJhbWVSZWN0LCBib29sIGlzRnVsbHNjcmVlbikKICAgIGV4dGVybmFsIChSSUYpIGNhbGw7IHdo b2xlIGZyYW1lLCBjYWxsZWQgYmVmb3JlIHVwZGF0ZV93aW5kb3dfYmVnaW4KICAgIC0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tICovCiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBmOworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAjaWZkZWYgTlNfSU1QTF9DT0NPQQogICBFbWFjc1ZpZXcgKnZp ZXcgPSBGUkFNRV9OU19WSUVXIChmKTsKIApAQCAtMTIwOSw2ICsyMTkzLDE2IEBAIHN0YXRpYyBO U1JlY3QgY29uc3RyYWluX2ZyYW1lX3JlY3QoTlNSZWN0IGZyYW1lUmVjdCwgYm9vbCBpc0Z1bGxz Y3JlZW4pCiAKIC8qICAgaWYgKGYgPT0gTU9VU0VfSExfSU5GTyAoZiktPm1vdXNlX2ZhY2VfbW91 c2VfZnJhbWUpICovCiAgIE1PVVNFX0hMX0lORk8gKGYpLT5tb3VzZV9mYWNlX2RlZmVyID0gMDsK KworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwor ICBmLT5tY191cGRhdGluZ19mcmFtZSA9IE5VTEw7CisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKIH0KIAogCkBAIC00ODAzLDYgKzU3OTcsMTcgQEAgaW4gY2VydGFpbiBzaXR1YXRpb25z IChyYXBpZCBpbmNvbWluZyBldmVudHMpLgogICAgICAgYmFyID0gW1tFbWFjc1Njcm9sbGVyIGFs bG9jXSBpbml0RnJhbWU6IHIgd2luZG93OiB3aW5dOwogICAgICAgd3NldF92ZXJ0aWNhbF9zY3Jv bGxfYmFyICh3aW5kb3csIG1ha2VfbWludF9wdHIgKGJhcikpOwogICAgICAgdXBkYXRlX3AgPSBZ RVM7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKyAgICAgIC8qIFRoaXMgaXMgb25seSBmb3IgZGVidWdnaW5nIHB1cnBvc2VzLiAqLworICAg ICAgW2JhciBtY19zZXRfcmVjdGFuZ2xlOiByXTsKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogICAgIH0KICAgZWxzZQogICAgIHsKQEAgLTQ4MTAsMTIgKzU4MTUsMzAgQEAgaW4gY2Vy dGFpbiBzaXR1YXRpb25zIChyYXBpZCBpbmNvbWluZyBldmVudHMpLgogICAgICAgYmFyID0gWE5T X1NDUk9MTF9CQVIgKHdpbmRvdy0+dmVydGljYWxfc2Nyb2xsX2Jhcik7CiAgICAgICBvbGRSZWN0 ID0gW2JhciBmcmFtZV07CiAgICAgICByLnNpemUud2lkdGggPSBvbGRSZWN0LnNpemUud2lkdGg7 CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK ICAgICAgIGlmIChGUkFNRV9MSVZFX1AgKGYpICYmICFOU0VxdWFsUmVjdHMgKG9sZFJlY3QsIHIp KQogICAgICAgICB7CisgICAgICAgICAgLyogVGhlIG1haW4gd2luZG93IGhhcyBwcm9iYWJseSBi ZWVuIHJlc2l6ZWQuICBHcmFjaW91c2x5IGRlbGV0ZSB0aGUKKyAgICAgICAgICBvbGQgc2Nyb2xs IGJhciB3aXRob3V0IHJlcGFpbnRpbmcgaXRzIHJlY3RhbmdsZTsgYW5kLCBjcmVhdGUgYSBuZXcK KyAgICAgICAgICBzY3JvbGwgYmFyIGVsc2V3aGVyZS4qLwogICAgICAgICAgIGlmIChvbGRSZWN0 Lm9yaWdpbi54ICE9IHIub3JpZ2luLngpCisgICAgICAgICAgICB7CiAgICAgICAgICAgICAgIG5z X2NsZWFyX2ZyYW1lX2FyZWEgKGYsIGxlZnQsIHRvcCwgd2lkdGgsIGhlaWdodCk7CisgICAgICAg ICAgICAgIFtiYXIgbWNfanVkZ2VdOworICAgICAgICAgICAgICBiYXIgPSBbW0VtYWNzU2Nyb2xs ZXIgYWxsb2NdIGluaXRGcmFtZTogciB3aW5kb3c6IHdpbl07CisgICAgICAgICAgICAgIHdzZXRf dmVydGljYWxfc2Nyb2xsX2JhciAod2luZG93LCBtYWtlX21pbnRfcHRyIChiYXIpKTsKKyAgICAg ICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKICAgICAgICAgICBbYmFyIHNldEZyYW1lOiByXTsK ICAgICAgICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgfQogCiAgIGlm ICh1cGRhdGVfcCkKQEAgLTQ5NzUsOSArNTk5OCw1NyBAQCBpbiBjZXJ0YWluIHNpdHVhdGlvbnMg KHJhcGlkIGluY29taW5nIGV2ZW50cykuCiAgICAgewogICAgICAgdmlldyA9IFtzdWJ2aWV3cyBv YmplY3RBdEluZGV4OiBpXTsKICAgICAgIGlmICghW3ZpZXcgaXNLaW5kT2ZDbGFzczogW0VtYWNz U2Nyb2xsZXIgY2xhc3NdXSkgY29udGludWU7Ci0gICAgICBpZiAoW3ZpZXcganVkZ2VdKQorCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8q IGBYU0VUV0lORE9XJyB3aWxsIHNvbWV0aW1lcyBjYXVzZSBFbWFjcyB0byBjcmFzaCB3aGVuIHJ1 bm5pbmcgdW5kZXIgZ2RiIGV2ZW4KKyAgdGhvdWdoICh3ICE9IE5VTEwpLiAgVGhlcmVmb3JlLCB3 ZSBjYW5ub3QgcmVsaWFibHkgdXNlIGBXSU5ET1dfTElWRV9QJy4gKi8KKyAgc3RydWN0IHdpbmRv dyAqdyA9IFt2aWV3IG1jX2dldF93aW5kb3ddOworICBpZiAodyAhPSBOVUxMCisgICAgICAmJiBO SUxQICh3LT5jb250ZW50cykpCisgICAgeworICAgICAgQk9PTCBkZWJ1Z19wID0gZmFsc2U7Cisg ICAgICBpZiAoZGVidWdfcAorICAgICAgICAgIC8qIGB3aW5kb3dfYm94JyBjYWxscyBgd2luZG93 X2JveF9oZWlnaHQnLCB3aGljaCB3aWxsIGNhdXNlIEVtYWNzIHRvCisgICAgICAgICAgY3Jhc2gg aWYgRlJBTUVQICh3LT5mcmFtZSkgaXMgbm90IHNhdGlzZmllZC4gKi8KKyAgICAgICAgICAmJiBG UkFNRVAgKHctPmZyYW1lKSkKKyAgICAgICAgeworICAgICAgICAgIE5TUmVjdCByMCA9IFt2aWV3 IG1jX2dldF9yZWN0YW5nbGVdOworICAgICAgICAgIGludCB4MCA9IE5TTWluWCAocjApOworICAg ICAgICAgIGludCB5MCA9IE5TTWluWSAocjApOworICAgICAgICAgIGludCB3ZDAgPSBOU1dpZHRo IChyMCk7CisgICAgICAgICAgaW50IGgwID0gTlNIZWlnaHQgKHIwKTsKKyAgICAgICAgICBpbnQg d2luZG93X3ksIHdpbmRvd19oZWlnaHQ7CisgICAgICAgICAgd2luZG93X2JveCAodywgQU5ZX0FS RUEsIDAsICZ3aW5kb3dfeSwgMCwgJndpbmRvd19oZWlnaHQpOworICAgICAgICAgIGludCB0b3Ag PSB3aW5kb3dfeTsKKyAgICAgICAgICBpbnQgaGVpZ2h0ID0gd2luZG93X2hlaWdodDsKKyAgICAg ICAgICBpbnQgd2lkdGggPSBXSU5ET1dfQ09ORklHX1NDU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b3ZlZCA9IFlFUzsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKworICAgIH0K IAogICBpZiAocmVtb3ZlZCkKICAgICBbZXZpZXcgdXBkYXRlRnJhbWVTaXplOiBOT107CkBAIC01 MTA2LDYgKzYxNzcsMjEgQEAgc3RhdGljIExpc3BfT2JqZWN0IG5zX3N0cmluZ190b19saXNwbW9k IChjb25zdCBjaGFyICpzKQogZXh0ZXJuIGZyYW1lX3Bhcm1faGFuZGxlciBuc19mcmFtZV9wYXJt X2hhbmRsZXJzW107CiBzdGF0aWMgc3RydWN0IHJlZGlzcGxheV9pbnRlcmZhY2UgbnNfcmVkaXNw bGF5X2ludGVyZmFjZSA9CiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgbnN0ZXJtLm1g IG11c3QgYmUgaW4gdGhlIGV4YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitgcmVkaXNwbGF5X2ludGVy ZmFjZScgaW4gYGRpc3BleHRlcm4uaGAhICovCisKKyAgbWNfeF93cml0ZV9nbHlwaHMsCisgIG1j X25zX2RyYXdfd2luZG93X2N1cnNvciwKKyAgbWNfbnNfZHJhd19nbHlwaF9zdHJpbmcsCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKICAgbnNfZnJhbWVfcGFybV9oYW5kbGVycywKICAg eF9wcm9kdWNlX2dseXBocywKICAgeF93cml0ZV9nbHlwaHMsCkBAIC04NzIxLDYgKzk4MDcsNDkg QEAgLSAoQk9PTCljYW5CZWNvbWVNYWluV2luZG93CiAKIEBpbXBsZW1lbnRhdGlvbiBFbWFjc1Nj cm9sbGVyCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JT ICovCisKKy0gKHZvaWQpbWNfc2V0X3JlY3RhbmdsZTogKE5TUmVjdClyZWN0Cit7CisgIG1jX3Jl Y3RhbmdsZSA9IHJlY3Q7Cit9CisKKy0gKE5TUmVjdCltY19nZXRfcmVjdGFuZ2xlCit7CisgIHJl dHVybiBtY19yZWN0YW5nbGU7Cit9CisKKy0gKHN0cnVjdCB3aW5kb3cgKiltY19nZXRfd2luZG93 Cit7CisgIHJldHVybiB3aW5kb3c7Cit9CisKKy0gKGJvb2wpbWNfanVkZ2UKK3sKKyAgTlNUUkFD RSAoIltFbWFjc1Njcm9sbGVyIG1jX2p1ZGdlXSIpOworICBib29sIHJldCA9IGNvbmRlbW5lZDsK KyAgYmxvY2tfaW5wdXQgKCk7CisgIGlmIChjb25kZW1uZWQpCisgICAgeworICAgICAgLyogZW5z dXJlIG90aGVyIHNjcm9sbGJhciB1cGRhdGVzIGFmdGVyIGRlbGV0aW9uICovCisgICAgICBFbWFj c1ZpZXcgKnZpZXcgPSAoRW1hY3NWaWV3ICopRlJBTUVfTlNfVklFVyAoZnJhbWUpOworICAgICAg aWYgKHZpZXcgIT0gbmlsKQorICAgICAgICB2aWV3LT5zY3JvbGxiYXJzTmVlZGluZ1VwZGF0ZSsr OworICAgIH0KKyAgaWYgKHdpbmRvdykKKyAgICB3c2V0X3ZlcnRpY2FsX3Njcm9sbF9iYXIgKHdp bmRvdywgUW5pbCk7CisgIHdpbmRvdyA9IDA7CisgIFtzZWxmIHJlbW92ZUZyb21TdXBlcnZpZXdX aXRob3V0TmVlZGluZ0Rpc3BsYXldOworICBbc2VsZiByZWxlYXNlXTsKKyAgdW5ibG9ja19pbnB1 dCAoKTsKKyAgcm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id0IGRyYXcgYSBi bG9jayBjdXJzb3IgYXMKKyAgIHdpZGUgYXMgdGhlIHN0cmV0Y2ggZ2x5cGguICAqLworICAgICAg aW50IHdpZHRoLCBiYWNrZ3JvdW5kX3dpZHRoID0gcy0+YmFja2dyb3VuZF93aWR0aDsKKyAgICAg IGludCB4ID0gcy0+eDsKKyAgICAgIGlmICghcy0+cm93LT5yZXZlcnNlZF9wKQorICAgICAgICB7 CisgICAgICAgICAgaW50IGxlZnRfeCA9IHdpbmRvd19ib3hfbGVmdF9vZmZzZXQgKHMtPncsIFRF WFRfQVJFQSk7CisgICAgICAgICAgaWYgKHggPCBsZWZ0X3gpCisgICAgICAgICAgICB7CisgICAg ICAgICAgICAgIGJhY2tncm91bmRfd2lkdGggLT0gbGVmdF94IC0geDsKKyAgICAgICAgICAgICAg eCA9IGxlZnRfeDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgIGVsc2UKKyAgICAg ICAgeworICAgICAgICAgIC8qIEluIFIyTCByb3dzLCBkcmF3IHRoZSBjdXJzb3Igb24gdGhlIHJp Z2h0IGVkZ2Ugb2YgdGhlCisgICAgICAgICAgICAgc3RyZXRjaCBnbHlwaC4gICovCisgICAgICAg ICAgaW50IHJpZ2h0X3ggPSB3aW5kb3dfYm94X3JpZ2h0IChzLT53LCBURVhUX0FSRUEpOworICAg ICAgICAgIGlmICh4ICsgYmFja2dyb3VuZF93aWR0aCA+IHJpZ2h0X3gpCisgICAgICAgICAgICBi YWNrZ3JvdW5kX3dpZHRoIC09IHggLSByaWdodF94OworICAgICAgICAgIHggKz0gYmFja2dyb3Vu ZF93aWR0aDsKKyAgICAgICAgfQorICAgICAgd2lkdGggPSBtaW4gKEZSQU1FX0NPTFVNTl9XSURU SCAocy0+ZiksIGJhY2tncm91bmRfd2lkdGgpOworICAgICAgaWYgKHMtPnJvdy0+cmV2ZXJzZWRf cCkKKyAgICAgICAgeCAtPSB3aWR0aDsKKyAgICAgIC8qIERyYXcgY3Vyc29yLiAgKi8KKyAgICAg IHhfZHJhd19nbHlwaF9zdHJpbmdfYmdfcmVjdCAocywgeCwgcy0+eSwgd2lkdGgsIHMtPmhlaWdo dCk7CisgICAgICAvKiBDbGVhciByZXN0IHVzaW5nIHRoZSBHQyBvZiB0aGUgb3JpZ2luYWwgbm9u LWN1cnNvciBmYWNlLiAgKi8KKyAgICAgIGlmICh3aWR0aCA8IGJhY2tncm91bmRfd2lkdGgpCisg ICAgICAgIHsKKyAgICAgICAgICBYR0NWYWx1ZXMgKmdjID0gcy0+ZmFjZS0+Z2M7CisgICAgICAg ICAgaW50IHkgPSBzLT55OworICAgICAgICAgIGludCB3ID0gYmFja2dyb3VuZF93aWR0aCAtIHdp ZHRoLCBoID0gcy0+aGVpZ2h0OworICAgICAgICAgIFJFQ1QgcjsKKyAgICAgICAgICAgICAgICBI REMgaGRjID0gcy0+aGRjOworICAgICAgICAgIGlmICghcy0+cm93LT5yZXZlcnNlZF9wKQorICAg ICAgICAgICAgeCArPSB3aWR0aDsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB4ID0gcy0+ eDsKKyAgICAgICAgICBpZiAocy0+cm93LT5tb3VzZV9mYWNlX3AKKyAgICAgICAgICAgICAgJiYg Y3Vyc29yX2luX21vdXNlX2ZhY2VfcCAocy0+dykpCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIHhfc2V0X21vdXNlX2ZhY2VfZ2MgKHMpOworICAgICAgICAgICAgICBnYyA9IHMtPmdjOwor ICAgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGdjID0gcy0+ZmFjZS0+ Z2M7CisgICAgICAgICAgZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsICZyKTsKKyAgICAg ICAgICB3MzJfc2V0X2NsaXBfcmVjdGFuZ2xlIChoZGMsICZyKTsKKyNpZiAwIC8qIFRPRE86IHN0 aXBwbGUgKi8KKyAgICAgICAgICBpZiAocy0+ZmFjZS0+c3RpcHBsZSkKKyAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgLyogRmlsbCBiYWNrZ3JvdW5kIHdpdGggYSBzdGlwcGxlIHBhdHRlcm4u ICAqLworICAgICAgICAgICAgICBYU2V0RmlsbFN0eWxlIChzLT5kaXNwbGF5LCBnYywgRmlsbE9w YXF1ZVN0aXBwbGVkKTsKKyAgICAgICAgICAgICAgWEZpbGxSZWN0YW5nbGUgKHMtPmRpc3BsYXks IHMtPndpbmRvdywgZ2MsIHgsIHksIHcsIGgpOworICAgICAgICAgICAgICBYU2V0RmlsbFN0eWxl IChzLT5kaXNwbGF5LCBnYywgRmlsbFNvbGlkKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBl bHNlCisjZW5kaWYKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAo cy0+Ziwgcy0+aGRjLCBnYy0+YmFja2dyb3VuZCwgeCwgeSwgdywgaCk7CisgICAgICAgICAgICB9 CisgICAgICAgIH0KKyAgICB9CisgIGVsc2UgaWYgKCFzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wKQor ICAgIHsKKyAgICAgIGludCBiYWNrZ3JvdW5kX3dpZHRoID0gcy0+YmFja2dyb3VuZF93aWR0aDsK KyAgICAgIGludCB4ID0gcy0+eCwgbGVmdF94ID0gd2luZG93X2JveF9sZWZ0X29mZnNldCAocy0+ dywgVEVYVF9BUkVBKTsKKyAgICAgIC8qIERvbid0IGRyYXcgaW50byBsZWZ0IG1hcmdpbiwgZnJp bmdlIG9yIHNjcm9sbGJhciBhcmVhCisgICAgICAgICBleGNlcHQgZm9yIGhlYWRlciBsaW5lIGFu ZCBtb2RlIGxpbmUuICAqLworICAgICAgaWYgKHggPCBsZWZ0X3ggJiYgIXMtPnJvdy0+bW9kZV9s aW5lX3ApCisgICAgICAgIHsKKyAgICAgICAgICBiYWNrZ3JvdW5kX3dpZHRoIC09IGxlZnRfeCAt IHg7CisgICAgICAgICAgeCA9IGx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ICAgICBQ b3N0TWVzc2FnZSAoaHduZCwgV01fSU1FX1NUQVJUQ09NUE9TSVRJT04sIDAsIDApOworICAgICAg ICAgIC8qIElmIHRoZSBzaXplIG9mIHRoZSBhY3RpdmUgY3Vyc29yIGNoYW5nZWQsIGRlc3Ryb3kg dGhlIG9sZAorICAgICAgICAgICAgIHN5c3RlbSBjYXJldC4gICovCisgICAgICAgICAgaWYgKHcz Ml9zeXN0ZW1fY2FyZXRfaHduZAorICAgICAgICAgICAgICAmJiAodzMyX3N5c3RlbV9jYXJldF9o ZWlnaHQgIT0gaCkpCisgICAgICAgICAgICBQb3N0TWVzc2FnZSAoaHduZCwgV01fRU1BQ1NfREVT VFJPWV9DQVJFVCwgMCwgMCk7CisgICAgICAgICAgdzMyX3N5c3RlbV9jYXJldF9oZWlnaHQgPSBo OworICAgICAgICAgIC8qIE1vdmUgdGhlIHN5c3RlbSBjYXJldC4gICovCisgICAgICAgICAgUG9z dE1lc3NhZ2UgKGh3bmQsIFdNX0VNQUNTX1RSQUNLX0NBUkVULCAwLCAwKTsKKyAgICAgICAgfQor ICAgICAgLyogVGhlIGZyaW5nZSBiaXRtYXBzIGFyZSBwcmVzZW50bHkgaGFuZGxlZCBlbHNld2hl cmUsIGJ1dCBjb3VsZCBzb21lZGF5CisgICAgICBiZSBtYW5hZ2VkIChpbiBwYXJ0KSBhdCB0aGlz IHNlY3Rpb24gb2YgY29kZS4gKi8KKyAgICAgIGlmIChyb3ctPmV4YWN0X3dpbmRvd193aWR0aF9s aW5lX3AKKyAgICAgICAgICAmJiAocm93LT5yZXZlcnNlZF9wCisgICAgICAgICAgICAgPyAoaHBv cyA8IDApCisgICAgICAgICAgICAgOiAoaHBvcyA+PSByb3ctPnVzZWRbVEVYVF9BUkVBXSkpKQor ICAgICAgICB7CisgICAgICAgICAgcm93LT5jdXJzb3JfaW5fZnJpbmdlX3AgPSB0cnVlOworICAg ICAgICAgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcCAodywgcm93LC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zIt PmN1cnNvcl9waXhlbCcuICAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29y X3BpeGVsID0gY29sb3JfcGl4ZWw7CisgICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNv ciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAg ICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29y X3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKGN1cnNvcl9nbHlwaC0+dHlwZSA9 PSBJTUFHRV9HTFlQSCAmJiBsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJs dWUgPj0gMCkKKyAgICAgICAgICB7CisgICAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sg YGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgICAgICBmLT5v dXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAgICAg bWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwg aHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJz b3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgICAgfQorICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNr IGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycgYnkgYm9ycm93aW5nIHRoZQorICAgICAg ICAgICAgICBmdW5jdGlvbmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHczMmZucy5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AgICAg ICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgZWxzZSBpZiAocmVnaW9uX2FjdGl2ZV9wCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID4gcmVnaW9uX2JlZworICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zIDwgcmVnaW9uX2VuZCkK KyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9p ZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFj ZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluLXJlZ2lvbi1wcmUtenYtZmFj ZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2Fj dGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZl X3JlZ2lvbl9iZXR3ZWVuX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICAgIGVudW0gZmFj ZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50 ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAg ICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01f SUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgZ2Nf dmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAg ICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX3Jl Z2lvbl9iZXR3ZWVuX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVf ZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1j dXJzb3ItcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1 Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0 aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91 bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgICAg ICAgICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IGhvbGxvd19hY3RpdmVfZmFjZS0+YmFja2dyb3Vu ZDsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgZWxzZSBp ZiAoIWFjdGl2ZV9wKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg ICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBf bmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLXBy ZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgIC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AgICAgICAgICAgICBtY193MzJfZHJhd19ob2xsb3dfY3Vyc29yICh3 LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICAg ICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBNQ19IT0xMT1dfQk9YOgorICAg IHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUg Pj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0 cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0 YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAgIG1jX3czMl9kcmF3 X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3Ms IHdkLCBoKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9y aWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAg bWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwg aHBvcywgdnBvcywgd2QsIGgpOworICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfRklM TEVEX0JPWDoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAw ICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBo aWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djJyBieSBib3Jyb3dpbmcgdGhlCisg ICAgICAgICAg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isgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAg ICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX3AgPSBmYWxzZTsKKyAgICAgICAg ICAgIG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywgRFJBV19DVVJTT1IsIHgs IGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNsLCBnbHlw aF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgY3Vyc29yX2djX3ApOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOwor ICAgIH0KKyAgICBjYXNlIE1DX0JBUjoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYm IGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAv KiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4g ICovCisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBjb2xvcl9w aXhlbDsKKyAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gdHJ1ZTsK KyAgICAgICAgICBtY193MzJfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngs IHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0JBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOwor ICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vy c29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAg ICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7CisgICAgICAgICAg ICBtY193MzJfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBo cG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGgsIGN1 cnNvcl93aWR0aCwgTUNfQkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAg ICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfSEJBUjoKKyAgICB7CisgICAg ICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisg ICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRh LnczMi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5j dXJzb3JfcGl4ZWwgPSBjb2xvcl9waXhlbDsKKyAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZp c2libGVfb2theV9wID0gdHJ1ZTsKKyAgICAgICAgICBtY193MzJfZHJhd19iYXJfY3Vyc29yICh3 LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0hCQVIsIGN1cnNvcl9n Y19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNv cl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNl CisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlf cCA9IGZhbHNlOworICAgICAgICAgICAgbWNfdzMyX2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4 LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0hCQVIsIGN1cnNvcl9nY19pbnZp c2libGVfb2theV9wKTsKKyAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgZGVm YXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOworICB9CisgICAgfQorfQorCisvKiBEcmF3IGds eXBoIHN0cmluZyBTLiAgKi8KK3N0YXRpYyB2b2lkCittY193MzJfZHJhd19nbHlwaF9zdHJpbmcg KHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3Ry dWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNf UkdCIGxzbCwgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yLAorICAgICAgICAgICAgICAgICAg ICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlLCBpbnQgY3Vyc29yX3dpZHRo LAorICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGFjdGl2ZV9wLCBib29sIGN1cnNvcl9n Y19wKQoreworICBib29sIHJlbGllZl9kcmF3bl9wID0gMDsKKyAgLyogSWYgUyBkcmF3cyBpbnRv IHRoZSBiYWNrZ3JvdW5kIG9mIGl0cyBzdWNjZXNzb3IsIGRyYXcgdGhlCisgICAgIGJhY2tncm91 bmQgb2YgdGhlIHN1Y2Nlc3NvciBmaXJzdCBzbyB0aGF0IFMgY2FuIGRyYXcgaW50byBpdC4KKyAg ICAgVGhpcyBtYWtlcyBTLT5uZXh0IHVz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gICAgeF9k cmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAgICBicmVhazsK KyAgICBjYXNlIEdMWVBITEVTU19HTFlQSDoKKyAgICAgIGlmIChzLT5mb3Jfb3ZlcmxhcHMpCisg ICAgICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVlOworICAgICAgZWxzZQorICAgICAg ICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKHMsIGZhbHNlKTsKKyAgICAgIHhfZHJh d19nbHlwaGxlc3NfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHMpOworICAgICAgYnJlYWs7Cisg ICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOworICAgIH0KKyAgaWYgKCFzLT5mb3Jf b3ZlcmxhcHMpCisgICAgeworICAgICAgLyogRHJhdyB1bmRlcmxpbmUuICAqLworICAgICAgaWYg KHMtPmZhY2UtPnVuZGVybGluZV9wKQorICAgICAgICB7CisgICAgICAgICAgaWYgKHMtPmZhY2Ut PnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfV0FWRSkKKyAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgQ09MT1JSRUYgY29sb3I7CisgICAgICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRl cmxpbmVfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICAgICAgY29sb3IgPSBzLT5nYy0+Zm9yZWdy b3VuZDsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIGNvbG9yID0gcy0+ZmFj ZS0+dW5kZXJsaW5lX2NvbG9yOworICAgICAgICAgICAgICB3MzJfZHJhd191bmRlcndhdmUgKHMs IGNvbG9yKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmIChzLT5mYWNlLT51bmRl cmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIHVuc2lnbmVkIGxvbmcgdGhpY2tuZXNzLCBwb3NpdGlvbjsKKyAgICAgICAgICAgICAgaW50 IHk7CisgICAgICAgICAgICAgIGlmIChzLT5wcmV2ICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGlu ZV9wCisgICAgICAgICAgICAgICAgICAmJiBzLT5wcmV2LT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9 PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg LyogV2UgdXNlIHRoZSBzYW1lIHVuZGVybGluZSBzdHlsZSBhcyB0aGUgcHJldmlvdXMgb25lLiAg Ki8KKyAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPnByZXYtPnVuZGVybGluZV90aGlj a25lc3M7CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPnByZXYtPnVuZGVybGluZV9w b3NpdGlvbjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVybGluZSB0aGlja25l c3MuICBEZWZhdWx0IGlzIDEgcGl4ZWwuICAqLworICAgICAgICAgICAgICAgICAgaWYgKHMtPmZv bnQgJiYgcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzcyA+IDApCisgICAgICAgICAgICAgICAg ICAgIHRoaWNrbmVzcyA9IHMtPmZvbnQtPnVuZGVybGluZV90aGlja25lc3M7CisgICAgICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IDE7CisgICAgICAg ICAgICAgICAgICBpZiAoeF91bmRlcmxpbmVfYXRfZGVzY2VudF9saW5lKQorICAgICAgICAgICAg ICAgICAgICBwb3NpdGlvbiA9IChzLT5oZWlnaHQgLSB0aGlja25lc3MpIC0gKHMtPnliYXNlIC0g cy0+eSk7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVybGluZSBwb3NpdGlvbi4gIFRoaXMg aXMgdGhlIHJlY29tbWVuZGVkCisgICAgICAgICAgICAgICAgICAgICAgICAgdmVydGljYWwgb2Zm c2V0IGluIHBpeGVscyBmcm9tIHRoZSBiYXNlbGluZSB0byB0aGUgdG9wIG9mCisgICAgICAgICAg ICAgICAgICAgICAgICAgdGhlIHVuZGVybGluZS4gIFRoaXMgaXMgYSBzaWduZWQgdmFsdWUgYWNj b3JkaW5nIHRvIHRoZQorICAgICAgICAgICAgICAgICAgICAgICAgIHNwZWNzLCBhbmQgaXRzIGRl ZmF1bHQgaXMKKyAgICAgICAgICAgICAgICAgICAgICAgICBST1VORCAoKG1heGltdW1fZGVzY2Vu dCkgLyAyKSwgd2l0aAorICAgICAgICAgICAgICAgICAgICAgICAgIFJPVU5EICh4KSA9IGZsb29y ICh4ICsgMC41KSAgKi8KKyAgICAgICAgICAgICAgICAgICAgICBpZiAoeF91c2VfdW5kZXJsaW5l X3Bvc2l0aW9uX3Byb3BlcnRpZXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcy0+Zm9u dCAmJiBzLT5mb250LT51bmRlcmxpbmVfcG9zaXRpb24gPj0gMCkKKyAgICAgICAgICAgICAgICAg ICAgICAgIHBvc2l0aW9uID0gcy0+Zm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAg ICAgICAgICAgICAgIGVsc2UgaWYgKHMtPmZvbnQpCisgICAgICAgICAgICAgICAgICAgICAgICBw b3NpdGlvbiA9IChzLT5mb250LT5kZXNjZW50ICsgMSkgLyAyOworICAgICAgICAgICAgICAgICAg ICB9CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IG1heCAocG9zaXRpb24sIHVuZGVybGlu ZV9taW5pbXVtX29mZnNldCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAvKiBD aGVjayB0aGUgc2FuaXR5IG9mIHRoaWNrbmVzcyBhbmQgcG9zaXRpb24uICBXZSBzaG91bGQKKyAg ICAgICAgICAgICAgICAgYXZvaWQgZHJhd2luZyB1bmRlcmxpbmUgb3V0IG9mIHRoZSBjdXJyZW50 IGxpbmUgYXJlYS4gICovCisgICAgICAgICAgICAgIGlmIChzLT55ICsgcy0+aGVpZ2h0IDw9IHMt PnliYXNlICsgcG9zaXRpb24pCisgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+aGVpZ2h0 IC0gMSkgLSAocy0+eWJhc2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgaWYgKHMtPnkgKyBzLT5o ZWlnaHQgPCBzLT55YmFzZSArIHBvc2l0aW9uICsgdGhpY2tuZXNzKQorICAgICAgICAgICAgICAg IHRoaWNrbmVzcyA9IChzLT55ICsgcy0+aGVpZ2h0KSAtIChzLT55YmFzZSArIHBvc2l0aW9uKTsK KyAgICAgICAgICAgICAgcy0+dW5kZXJsaW5lX3RoaWNrbmVzcyA9IHRoaWNrbmVzczsKKyAgICAg ICAgICAgICAgcy0+dW5kZXJsaW5lX3Bvc2l0aW9uID1wb3NpdGlvbjsKKyAgICAgICAgICAgICAg eSA9IHMtPnliYXNlICsgcG9zaXRpb247CisgICAgICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRl cmxpbmVfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwg cy0+aGRjLCBzLT5nYy0+Zm9yZWdyb3VuZCwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICB5LCBzLT53aWR0aCwgMSk7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmZhY2UtPnVuZGVybGluZV9jb2xv ciwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5LCBzLT53aWR0aCwgMSk7 CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIC8qIERyYXcgb3ZlcmxpbmUuICAqLwor ICAgICAgaWYgKHMtPmZhY2UtPm92ZXJsaW5lX3ApCisgICAgICAgIHsKKyAgICAgICAgICB1bnNp Z25lZCBsb25nIGR5ID0gMCwgaCA9IDE7CisgICAgICAgICAgaWYgKHMtPmZhY2UtPm92ZXJsaW5l X2NvbG9yX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+ aGRjLCBzLT5nYy0+Zm9yZWdyb3VuZCwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg IHMtPnkgKyBkeSwgcy0+d2lkdGgsIGgpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmZhY2UtPm92ZXJsaW5lX2NvbG9yLCBz LT54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzLT55ICsgZHksIHMtPndpZHRoLCBo KTsKKyAgICAgICAgfQorICAgICAgLyogRHJhdyBzdHJpa2UtdGhyb3VnaC4gICovCisgICAgICBp ZiAocy0+ZmFjZS0+c3RyaWtlX3Rocm91Z2hfcAorICAgICAgICAgICYmICFGT05UX1RFWFRNRVRS SUMgKHMtPmZvbnQpLnRtU3RydWNrT3V0KQorICAgICAgICB7CisgICAgICAgICAgdW5zaWduZWQg bG9uZyBoID0gMTsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIGR5ID0gKHMtPmhlaWdodCAtIGgp IC8gMjsKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+c3RyaWtlX3Rocm91Z2hfY29sb3JfZGVmYXVs dGVkX3ApCisgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmdjLT5m b3JlZ3JvdW5kLCBzLT54LCBzLT55ICsgZHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICBz LT53aWR0aCwgaCk7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAo cy0+Ziwgcy0+aGRjLCBzLT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9jb2xvciwgcy0+eCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgIHMtPnkgKyBkeSwgcy0+d2lkdGgsIGgpOworICAgICAgICB9 CisgICAgICAvKiBEcmF3IHJlbGllZiBpZiBub3QgeWV0IGRyYXduLiAgKi8KKyAgICAgIGlmICgh cmVsaWVmX2RyYXduX3AgJiYgcy0+ZmFjZS0+Ym94ICE9IEZBQ0VfTk9fQk9YKQorICAgICAgICB4 X2RyYXdfZ2x5cGhfc3RyaW5nX2JveCAocyk7CisgICAgICBpZiAocy0+cHJldikKKyAgICAgICAg eworICAgICAgICAgIHN0cnVjdCBnbHlwaF9zdHJpbmcgKnByZXY7CisgICAgICAgICAgZm9yIChw cmV2ID0gcy0+cHJldjsgcHJldjsgcHJldiA9IHByZXYtPnByZXYpCisgICAgICAgICAgICBpZiAo cHJldi0+aGwgIT0gcy0+aGwKKyAgICAgICAgICAgICAgICAmJiBwcmV2LT54ICsgcHJldi0+d2lk dGggKyBwcmV2LT5yaWdodF9vdmVyaGFuZyA+IHMtPngpCisgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAvKiBBcyBwcmV2IHdhcyBkcmF3biB3aGlsZSBjbGlwcGVkIHRvIGl0cyBvd24g YXJlYSwgd2UKKyAgICAgICAgICAgICAgICAgICBtdXN0IGRyYXcgdGhlIHJpZ2h0X292ZXJoYW5n IHBhcnQgdXNpbmcgcy0+aGwgbm93LiAgKi8KKyAgICAgICAgICAgICAgICBlbnVtIGRyYXdfZ2x5 cGhzX2ZhY2Ugc2F2ZSA9IHByZXYtPmhsOworICAgICAgICAgICAgICAgIHByZXYtPmhsID0gcy0+ aGw7CisgICAgICAgICAgICAgICAgbWNfdzMyX3NldF9nbHlwaF9zdHJpbmdfZ2MgKHByZXYsIGN1 cnNvcl9nY19wKTsKKyAgICAgICAgICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdf ZXhhY3RseSAocywgcHJldik7CisgICAgICAgICAgICAgICAgaWYgKHByZXYtPmZpcnN0X2dseXBo LT50eXBlID09IENIQVJfR0xZUEgpCisgICAgICAgICAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3Ry aW5nX2ZvcmVncm91bmQgKHByZXYpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICAgIHhfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHByZXYpOwor ICAgICAgICAgICAgICAgIHczMl9zZXRfY2xpcF9yZWN0YW5nbGUgKHByZXYtPmhkYywgTlVMTCk7 CisgICAgICAgICAgICAgICAgcHJldi0+aGwgPSBzYXZlOworICAgICAgICAgICAgICAgIHByZXYt Pm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKHMt Pm5leHQpCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpuZXh0Owor ICAgICAgICAgIGZvciAobmV4dCA9IHMtPm5leHQ7IG5leHQ7IG5leHQgPSBuZXh0LT5uZXh0KQor ICAgICAgICAgICAgaWYgKG5leHQtPmhsICE9IHMtPmhsCisgICAgICAgICAgICAgICAgJiYgbmV4 dC0+eCAtIG5leHQtPmxlZnRfb3ZlcmhhbmcgPCBzLT54ICsgcy0+d2lkdGgpCisgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAvKiBBcyBuZXh0IHdpbGwgYmUgZHJhd24gd2hpbGUgY2xp cHBlZCB0byBpdHMgb3duIGFyZWEsCisgICAgICAgICAgICAgICAgICAgd2UgbXVzdCBkcmF3IHRo ZSBsZWZ0X292ZXJoYW5nIHBhcnQgdXNpbmcgcy0+aGwgbm93LiAgKi8KKyAgICAgICAgICAgICAg ICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2Ugc2F2ZSA9IG5leHQtPmhsOworICAgICAgICAgICAgICAg IG5leHQtPmhsID0gcy0+aGw7CisgICAgICAgICAgICAgICAgbWNfdzMyX3NldF9nbHlwaF9zdHJp bmdfZ2MgKG5leHQsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICAgICAgICB4X3NldF9nbHlwaF9z dHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywgbmV4dCk7CisgICAgICAgICAgICAgICAgaWYgKG5l eHQtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgpCisgICAgICAgICAgICAgICAgICB4 X2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5leHQpOworICAgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICAgIHhfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVn cm91bmQgKG5leHQpOworICAgICAgICAgICAgICAgIHczMl9zZXRfY2xpcF9yZWN0YW5nbGUgKG5l eHQtPmhkYywgTlVMTCk7CisgICAgICAgICAgICAgICAgbmV4dC0+aGwgPSBzYXZlOworICAgICAg ICAgICAgICAgIG5leHQtPm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgICAgICAgbmV4dC0+Y2xp cF9oZWFkID0gcy0+bmV4dDsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAv KiBSZXNldCBjbGlwcGluZy4gICovCisgIHczMl9zZXRfY2xpcF9yZWN0YW5nbGUgKHMtPmhkYywg TlVMTCk7CisgIHMtPm51bV9jbGlwcyA9IDA7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JT ICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBGcmluZ2UgYml0bWFwcy4gICov CiAKIHN0YXRpYyBpbnQgbWF4X2ZyaW5nZV9ibXAgPSAwOwpAQCAtNTQ1LDYgKzE0MTcsMTUgQEAg eF91cGRhdGVfYmVnaW4gKHN0cnVjdCBmcmFtZSAqZikKICAgaWYgKCEgRlJBTUVfVzMyX1AgKGYp KQogICAgIHJldHVybjsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExF LUNVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGluZ19mcmFtZSA9IGY7CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKICAgLyogUmVnZW5lcmF0ZSBkaXNwbGF5IHBhbGV0dGUgYmVmb3Jl IGRyYXdpbmcgaWYgbGlzdCBvZiByZXF1ZXN0ZWQKICAgICAgY29sb3JzIGhhcyBjaGFuZ2VkLiAq LwogICBpZiAoZGlzcGxheV9pbmZvLT5yZWdlbl9wYWxldHRlKQpAQCAtNzU0LDYgKzE2MzUsMTYg QEAgeF91cGRhdGVfZW5kIChzdHJ1Y3QgZnJhbWUgKmYpCiAKICAgLyogTW91c2UgaGlnaGxpZ2h0 IG1heSBiZSBkaXNwbGF5ZWQgYWdhaW4uICAqLwogICBNT1VTRV9ITF9JTkZPIChmKS0+bW91c2Vf ZmFjZV9kZWZlciA9IGZhbHNlOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gTlVMTDsKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAKQEAgLTQwNDEsMTMgKzQ5MzIsNzQgQEAg dzMyX3NldF92ZXJ0aWNhbF9zY3JvbGxfYmFyIChzdHJ1Y3Qgd2luZG93ICp3LAogCSAgICAgIHJl bGVhc2VfZnJhbWVfZGMgKGYsIGhkYyk7CiAJICAgICAgeF9jbGVhcl91bmRlcl9pbnRlcm5hbF9i b3JkZXIgKGYpOwogCSAgICB9CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdp biBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIFJFUEFJTlRJTkcgV0hFTiBSRU1PVklORyBTQ1JP TEwgQkFSOgorCistIFNlcXVlbmNlIG9mIEV2ZW50czoKKworICAuIGByZWRpc3BsYXlfaW50ZXJu YWwnIGNhbGxzIHRoZSBgY29uZGVtbl9zY3JvbGxfYmFyc19ob29rJywgd2hpY2ggbWFya3MgYWxs CisgICAgc2Nyb2xsIGJhcnMgYXMgY2FuZGlkYXRlcyBmb3IgZGVsZXRpb24uCisKKyAgLiBUaGVu IGByZWRpc3BsYXlfaW50ZXJuYWwnIGNhbGxzIGByZWRpc3BsYXlfd2luZG93cycsIHdoaWNoIHdh bGtzIHRoZQorICAgIHdpbmRvdy10cmVlIGFuZCBleGFtaW5lcyBlYWNoIHdpbmRvdywgd2hlcmVi eSBlYWNoIHdpbmRvdyB0aGF0IGlzIHN0aWxsIGFsaXZlCisgICAgaW4gdGhlIHdpbmRvdy10cmVl ICJyZWRlZW1zIiBpdHMgc2Nyb2xsIGJhcnMgYnkgbWFya2luZyB0aGVtIG5vdCB0byBiZQorICAg IGRlbGV0ZWQuCisKKyAgLiBUaGVuIGByZWRpc3BsYXlfaW50ZXJuYWwnIGNhbGxzIGBqdWRnZV9z Y3JvbGxfYmFyc19ob29rJywgd2hpY2ggcmVtb3Zl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ZlV2luZG93IChod25kLCBsZWZ0LCB0b3AsIHdpZHRoLCBt YXggKGhlaWdodCwgMSksIFRSVUUpOyAqKi8KLQkgIC8qIFRyeSB0byBub3QgZHJhdyBvdmVyIGNo aWxkIGZyYW1lcy4gICovCi0JICBTZXRXaW5kb3dQb3MgKGh3bmQsIEhXTkRfQk9UVE9NLCBsZWZ0 LCB0b3AsIHdpZHRoLCBtYXggKGhlaWdodCwgMSksCi0gICAgICAgICAgICAgICAgICAgICAgICBT V1BfRlJBTUVDSEFOR0VEKTsKKyAgICAgICAgICBpZiAobGVmdCA8PSBiYXItPmxlZnQpCisgICAg ICAgICAgICBteV9zaG93X3dpbmRvdyAoZiwgaHduZCwgU1dfSElERSk7CisgICAgICAgICAgTW92 ZVdpbmRvdyAoaHduZCwgbGVmdCwgdG9wLCB3aWR0aCwgbWF4IChoZWlnaHQsIDEpLCBsZWZ0IDw9 IGJhci0+bGVmdCk7CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKwogCiAJICBzaS5jYlNpemUgPSBzaXplb2YgKHNpKTsKIAkgIHNpLmZNYXNr ID0gU0lGX1JBTkdFOwpAQCAtNDMxNiw2ICs1MjY4LDIxIEBAIHczMl9qdWRnZV9zY3JvbGxfYmFy cyAoc3RydWN0IGZyYW1lICpmKQogICAgIHsKICAgICAgIHN0cnVjdCBzY3JvbGxfYmFyICpiID0g WFNDUk9MTF9CQVIgKGJhcik7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKyAgICAgIC8qIGBEZXN0cm95V2luZG93JyB3aXRoaW4gYHhfc2Ny b2xsX2Jhcl9yZW1vdmUnIHJlcGFpbnRzIHRoZSByZWN0YW5nbGUuCisgICAgICBUaGVyZWZvcmUs IHdlIGZpcnN0IHNlbmQgYSBtZXNzYWdlIHRvIGluaGliaXQgcmVwYWludGluZy4gKi8KKyAgICAg IGlmICghV0lORE9XX0xJVkVfUCAoYi0+d2luZG93KSkKKyAgICAgICAgeworICAgICAgICAgIEhX TkQgaHduZCA9IFNDUk9MTF9CQVJfVzMyX1dJTkRPVyAoYik7CisgICAgICAgICAgU2VuZE1lc3Nh Z2UgKGh3bmQsIFdNX1NFVFJFRFJBVywgZmFsc2UsIDApOworICAgICAgICB9CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgICAgIHhfc2Nyb2xsX2Jhcl9yZW1vdmUgKGIpOwogCiAg ICAgICBuZXh0ID0gYi0+bmV4dDsKQEAgLTcwOTEsNiArODA1OCwyMSBAQCBleHRlcm4gZnJhbWVf cGFybV9oYW5kbGVyIHczMl9mcmFtZV9wYXJtX2hhbmRsZXJzW107CiAKIHN0YXRpYyBzdHJ1Y3Qg cmVkaXNwbGF5X2ludGVyZmFjZSB3MzJfcmVkaXNwbGF5X2ludGVyZmFjZSA9CiB7CisKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRp c3BsYXlfaW50ZXJmYWNlJyBpbiBgdzMydGVybS5jYCBtdXN0IGJlIGluIHRoZSBleGFjdCBzYW1l IG9yZGVyIGFzIHRoZQorYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGBkaXNwZXh0ZXJuLmhgISAq LworCisgIG1jX3hfd3JpdGVfZ2x5cGhzLAorICBtY193MzJfZHJhd193aW5kb3dfY3Vyc29yLAor ICBtY193MzJfZHJhd19nbHlwaF9zdHJpbmcsCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor CisKICAgdzMyX2ZyYW1lX3Bhcm1faGFuZGxlcnMsCiAgIHhfcHJvZHVjZV9nbHlwaHMsCiAgIHhf d3JpdGVfZ2x5cGhzLApkaWZmIC0tZ2l0IGEvc3JjL3dpbmRvdy5oIGIvc3JjL3dpbmRvdy5oCmlu ZGV4IGZkZWY0MDcuLjA1MWZmZjAgMTAwNjQ0Ci0tLSBhL3NyYy93aW5kb3cuaAorKysgYi9zcmMv d2luZG93LmgKQEAgLTMyNCw2ICszMjQsMTI4IEBAIHN0cnVjdCB3aW5kb3cKIAogI2lmZGVmIEhB VkVfV0lORE9XX1NZU1RFTQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4g TVVMVElQTEUtQ1VSU09SUyAqLworCisvKiBTdWZmaXhlcyBmb3IgdGhlIGBtY2Agd2luZG93IHBv aW50ZXIgcHJlZml4LiAqLworc3RydWN0IG11bHRpcGxlX2N1cnNvcnMKK3sKKyAgLyogVGhlIHJl Y29yZGVkIHBpeGVsIHdpZHRoIG9mIHRoZSBsYXN0IGxpbmUgbnVtYmVyIGRyYXduIGR1cmluZyBy ZWRpc3BsYXkgKi8KKyAgaW50IGxudW1fcGl4ZWxfd2lkdGg7Cit9IG1jOworCitzdHJ1Y3QgbWNf bWF0cml4Cit7CisgIHB0cmRpZmZfdCB2cG9zX2FsbG9jYXRlZDsKKyAgcHRyZGlmZl90IHZwb3Nf dXNlZDsKKyAgcHRyZGlmZl90IGN1cnNvcnNfdXNlZFs0XTsKKyAgZW51bSBtY19jYWNoZV90eXBl CisgIHsKKyAgICBNQ19DQUNIRSwKKyAgICBDSF9DQUNIRSwKKyAgICBGQ19DQUNIRSwKKyAgICBO T19DQUNIRQorICB9IGNhY2hlX3R5cGU7CisgIHN0cnVjdCBtY192cG9zCisgIHsKKyAgICBwdHJk aWZmX3QgY2FjaGVfYWxsb2NhdGVkWzRdOworICAgIHB0cmRpZmZfdCBjYWNoZV91c2VkWzRdOwor ICAgIHN0cnVjdCBtY19jb250ZW50cworICAgIHsKKyAgICAgIGJvb2xfYmYgc2FtZV9wIDogMTsK KyAgICAgIGVudW0gbWNfZnJvbV93aGVyZQorICAgICAgeworICAgICAgICBOT1dIRVJFLAorICAg ICAgICBTQ1JJQkVfT05FLAorICAgICAgICBTQ1JJQkVfVFdPLAorICAgICAgICBTQ1JJQkVfVEhS RUUsCisgICAgICAgIFNLSVBQRUQsCisgICAgICAgIFBPU1RfQ0hBTkdFRCwKKyAgICAgICAgVU5D SEFOR0VELAorICAgICAgICBTRVRfQ1VSU09SX09ORSwKKyAgICAgICAgU0VUX0NVUlNPUl9UV08K KyAgICAgIH0gZnJvbV93aGVyZTsKKyAgICAgIHN0cnVjdCBnbHlwaCBnbHlwaDsKKyAgICAgIGlu dCB4OworICAgICAgaW50IGZ4OworICAgICAgaW50IHk7CisgICAgICBpbnQgZnk7CisgICAgICBp bnQgaHBvczsKKyAgICAgIGludCB2cG9zOworICAgICAgaW50IHdkOworICAgICAgaW50IGg7Cisg ICAgICBlbnVtIG1jX2N1cnNvcl90eXBlCisgICAgICB7CisgICAgICAgIC8qIE5PVEU6ICBUaGUg ZnJpbmdlIGJpdG1hcCBmcmFtZXdvcmsgcmVsaWVzIHVwb24gTUNfTk9fRlJJTkdFX0JJVE1BUAor ICAgICAgICBoYXZpbmcgYSB2YWx1ZSBvZiB6ZXJvICgwKS4gKi8KKyAgICAgICAgTUNfTk9fRlJJ TkdFX0JJVE1BUCwKKyAgICAgICAgTUNfTk9fQ1VSU09SLAorICAgICAgICBNQ19SSUdIVF9GUklO R0VfQklUTUFQLAorICAgICAgICBNQ19MRUZUX0ZSSU5HRV9CSVRNQVAsCisgICAgICAgIE1DX0ZS QU1FRF9CT1gsCisgICAgICAgIE1DX0ZJTExFRF9CT1gsCisgICAgICAgIE1DX0hPTExPV19CT1gs CisgICAgICAgIE1DX0JBUiwKKyAgICAgICAgTUNfSEJBUgorICAgICAgfSBjdXJzb3JfdHlwZTsK KyAgICAgIGludCBjdXJzb3Jfd2lkdGg7CisgICAgICBzdHJ1Y3QgbWNfUkdCCisgICAgICB7Cisg ICAgICAgIGRvdWJsZSByZWQ7CisgICAgICAgIGRvdWJsZSBncmVlbjsKKyAgICAgICAgZG91Ymxl IGJsdWU7CisgICAgICB9IGZvcmVncm91bmQsIGJhY2tncm91bmQ7CisgICAgICBib29sX2JmIGFj dGl2ZV9wIDogMTsKKyAgICAgIGVudW0gbWNfZmxhdm9yCisgICAgICB7CisgICAgICAgIE5PX0ZM QVZPUiwKKyAgICAgICAgTUNfR0xZUEgsCisgICAgICAgIE1DX0dMWVBITEVTUywKKyAgICAgICAg TUNfT1ZFUkxBWV9BUlJPV19CSVRNQVAsCisgICAgICAgIE1DX1BJTENST1csCisgICAgICAgIE1D X0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1csCisgICAgICAgIE1DX1JFVkVSU0VEX0hPTExP V19SRUNUQU5HTEVfUklHSFRfQVJST1csCisgICAgICAgIE1DX0hPTExPV19SRUNUQU5HTEUsCisg ICAgICAgIE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVywKKyAgICAgICAgTUNfUkVWRVJTRURf VkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XLAorICAgICAgICBNQ19WRVJUSUNBTF9CQVIsCisgICAg ICAgIE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUiwKKyAgICAgICAgTUNfVkVSVElDQUxfQkFSX0JB Q0tTTEFTSAorICAgICAgfSBnbHlwaF9mbGF2b3I7CisgICAgICBib29sX2JmIGVuYWJsZWRfcCA6 IDE7CisgICAgfSAqY2FjaGVbNF07CisgIH0gKnZwb3M7CisgIC8qIFVzZWQgZWxzZXdoZXJlLiAq LworICBzdHJ1Y3QgbWNfZXNzZW50aWFscworICB7CisgICAgZW51bSBtY19yb3dfcG9zaXRpb24K KyAgICB7CisgICAgICBQUkVfWlYsCisgICAgICBBVF9aViwKKyAgICAgIFBPU1RfWlYKKyAgICB9 IHJvd19wb3NpdGlvbjsKKyAgICBib29sX2JmIGFjdGl2ZV9wIDogMTsKKyAgICBzdHJ1Y3QgbWNf UkdCIGNoX2ZnWzNdLCBmY19mZ1szXSwgc3BfZmc7CisgICAgaW50IGZjX3g7CisgICAgaW50IHp2 OworICAgIGludCB6dl9ieXRlOworICB9IGVzc2VudGlhbHM7CisgIC8qIFVzZWQgZWxzZXdoZXJl LiAqLworICBlbnVtIG1jX2FjdGlvbl90eXBlCisgIHsKKyAgICBNVUxUSVBMRV9DVVJTT1JTLAor ICAgIEhPUklaT05UQUxfUlVMRVIsCisgICAgVkVSVElDQUxfUlVMRVIsCisgICAgRklMTF9DT0xV TU4sCisgICAgQ1VSU09SX0lORElDQVRPUgorICB9IGFjdGlvbl90eXBlOworfSBtY19tYXRyaXg7 CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiAgICAgLyogQ3Vyc29yIHR5cGUgb2YgbGFzdCBjdXJzb3IgZHJhd24gb24gdGhlIHdpbmRv dy4gICovCiAgICAgZW51bSB0ZXh0X2N1cnNvcl9raW5kcyBwaHlzX2N1cnNvcl90eXBlOwogCmRp ZmYgLS1naXQgYS9zcmMveGRpc3AuYyBiL3NyYy94ZGlzcC5jCmluZGV4IGE4OGZjNjkuLjU2MjU5 ZGEgMTAwNjQ0Ci0tLSBhL3NyYy94ZGlzcC5jCisrKyBiL3NyYy94ZGlzcC5jCkBAIC05MjEsNiAr OTIxLDQ2MzQgQEAgc3RhdGljIHZvaWQgc2hvd19tb3VzZV9mYWNlIChNb3VzZV9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jdCBnbHlwaF9zdHJpbmcgKiosCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICosIHN0 cnVjdCBnbHlwaF9zdHJpbmcgKik7CitzdGF0aWMgdm9pZCBpbml0X2dseXBoX3N0cmluZyAoc3Ry dWN0IGdseXBoX3N0cmluZyAqLCBNQ19PUFRJT05BTF9IREMgKGhkYykgWENoYXIyYiAqLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBo X3JvdyAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gZ2x5cGhfcm93X2Fy ZWEsIGludCwgZW51bSBkcmF3X2dseXBoc19mYWNlKTsKK3N0YXRpYyB2b2lkIGNvbXB1dGVfb3Zl cmhhbmdzX2FuZF94IChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICosIGludCwgYm9vbCk7CitzdGF0aWMg c3RydWN0IGdseXBoX3N0cmluZyAqIGdseXBoX3N0cmluZ19jb250YWluaW5nX2JhY2tncm91bmRf d2lkdGggKHN0cnVjdCBnbHlwaF9zdHJpbmcgKik7CitzdGF0aWMgdm9pZCBzZXRfZ2x5cGhfc3Ry aW5nX2JhY2tncm91bmRfd2lkdGggKHN0cnVjdCBnbHlwaF9zdHJpbmcgKiwgaW50LCBpbnQpOwor c3RhdGljIGludCBmaWxsX2dseXBoX3N0cmluZyAoc3RydWN0IGdseXBoX3N0cmluZyAqLCBpbnQs IGludCwgaW50LCBpbnQpOworc3RhdGljIGludCBmaWxsX2dzdHJpbmdfZ2x5cGhfc3RyaW5nIChz dHJ1Y3QgZ2x5cGhfc3RyaW5nICosIGludCwgaW50LCBpbnQsIGludCk7CitzdGF0aWMgaW50IGZp bGxfY29tcG9zaXRlX2dseXBoX3N0cmluZyAoc3RydWN0IGdseXBoX3N0cmluZyAqLCBzdHJ1Y3Qg ZmFjZSAqLCBpbnQ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JCQkJCVwKKwkgICAgY2FzZSBTVFJFVENIX0dMWVBIOgkJCQkJCVwKKwkgICAgICBNQ19C VUlMRF9TVFJFVENIX0dMWVBIX1NUUklORyAoU1RBUlQsIEVORCwgSEVBRCwgVEFJTCwJXAorCQkJ CQkgIEhMLCBYLCBMQVNUX1gpOwkJXAorCSAgICAgIGJyZWFrOwkJCQkJCQlcCisJCQkJCQkJCQlc CisJICAgIGNhc2UgSU1BR0VfR0xZUEg6CQkJCQkJXAorCSAgICAgIE1DX0JVSUxEX0lNQUdFX0dM WVBIX1NUUklORyAoU1RBUlQsIEVORCwgSEVBRCwgVEFJTCwJCVwKKwkJCQkJSEwsIFgsIExBU1Rf WCk7CQkJXAorCSAgICAgIGJyZWFrOworCisjZGVmaW5lIE1DX0JVSUxEX0dMWVBIX1NUUklOR1Nf WFcoU1RBUlQsIEVORCwgSEVBRCwgVEFJTCwgSEwsIFgsIExBU1RfWCkJXAorICAgICAgICAgICAg Y2FzZSBYV0lER0VUX0dMWVBIOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgXAorICAgICAgICAgICAgICBNQ19CVUlMRF9YV0lER0VUX0dMWVBIX1NUUklORyAoU1RBUlQs IEVORCwgSEVBRCwgVEFJTCwgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgSEwsIFgsIExBU1RfWCk7ICAgICAgICAgICAgICAgXAorICAgICAgICAgICAg ICBicmVhazsKKworI2RlZmluZSBNQ19CVUlMRF9HTFlQSF9TVFJJTkdTXzIoU1RBUlQsIEVORCwg SEVBRCwgVEFJTCwgSEwsIFgsIExBU1RfWCkJXAorCSAgICBjYXNlIEdMWVBITEVTU19HTFlQSDoJ CQkJCVwKKwkgICAgICBNQ19CVUlMRF9HTFlQSExFU1NfR0xZUEhfU1RSSU5HIChTVEFSVCwgRU5E LCBIRUFELCBUQUlMLAlcCisJCQkJCSAgICBITCwgWCwgTEFTVF9YKTsJCVwKKwk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SAxOyBpIDwgY291bnQ7IGkrKykKKyAgICB7CisgICAg ICBMaXNwX09iamVjdCBlbGVtID0gRmNvbnMgKHZhX2FyZyAoYXAsIExpc3BfT2JqZWN0KSwgUW5p bCk7CisgICAgICBYU0VUQ0RSICh0YWlsLCBlbGVtKTsKKyAgICAgIHRhaWwgPSBlbGVtOworICAg IH0KKyAgdmFfZW5kIChhcCk7CisgIHJldHVybiB2YWw7Cit9CisKK0xpc3BfT2JqZWN0CittY19t ZW1xIChMaXNwX09iamVjdCBlbHQsIExpc3BfT2JqZWN0IGxpc3QpCit7CisgIHdoaWxlICgxKQor ICAgIHsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpIHx8IEVRIChYQ0FSIChsaXN0KSwgZWx0KSkK KyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNP TlNQIChsaXN0KSB8fCBFUSAoWENBUiAobGlzdCksIGVsdCkpCisgICAgICAgIGJyZWFrOworICAg ICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkgfHwgRVEgKFhD QVIgKGxpc3QpLCBlbHQpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0 KTsKKyAgICB9CisgIHJldHVybiBsaXN0OworfQorCitMaXNwX09iamVjdAorbWNfbnRoIChpbnQg bnVtLCBMaXNwX09iamVjdCBsaXN0KQoreworICBmb3IgKGludCBpID0gMDsgaSA8IG51bSAmJiAh TklMUCAobGlzdCk7IGkrKykKKyAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgIGlmIChDT05TUCAo bGlzdCkpCisgICAgcmV0dXJuIFhDQVIgKGxpc3QpOworICAgIGVsc2UKKyAgICAgIHJldHVybiBR bmlsOworfQorCitMaXNwX09iamVjdAorbWNfYXNzcSAoTGlzcF9PYmplY3Qga2V5LCBMaXNwX09i amVjdCBsaXN0KQoreworICB3aGlsZSAoMSkKKyAgICB7CisgICAgICBpZiAoIUNPTlNQIChsaXN0 KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAgICYmIEVR IChYQ0FSIChYQ0FSIChsaXN0KSksIGtleSkpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3Qg PSBYQ0RSIChsaXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAgfHwgKENP TlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgRVEgKFhDQVIgKFhDQVIgKGxpc3Qp KSwga2V5KSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAg ICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQor ICAgICAgICAgICAgICAmJiBFUSAoWENBUiAoWENBUiAobGlzdCkpLCBrZXkpKSkKKyAgICAgICAg YnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgfQorICBpZiAoQ09OU1AgKGxp c3QpKQorICAgIHJldHVybiBYQ0FSIChsaXN0KTsKKyAgICBlbHNlCisgICAgICByZXR1cm4gUW5p bDsKK30KKworTGlzcF9PYmplY3QKK21jX2Fzc29jIChMaXNwX09iamVjdCBrZXksIExpc3BfT2Jq ZWN0IGxpc3QpCit7CisgIExpc3BfT2JqZWN0IGNhcjsKKyAgd2hpbGUgKDEpCisgICAgeworICAg ICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQor ICAgICAgICAgICAgICAmJiAoY2FyID0gWENBUiAoWENBUiAobGlzdCkpLAorICAgICAgICAgICAg ICAgICAgRVEgKGNhciwga2V5KSB8fCAhTklMUCAoRmVxdWFsIChjYXIsIGtleSkpKSkpCisgICAg ICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAo bGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAgICAgICAm JiAoY2FyID0gWENBUiAoWENBUiAobGlzdCkpLAorICAgICAgICAgICAgICAgICAgRVEgKGNhciwg a2V5KSB8fCAhTklMUCAoRmVxdWFsIChjYXIsIGtleSkpKSkpCisgICAgICAgIGJyZWFrOworICAg ICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAg ICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAgICAgICAmJiAoY2FyID0gWENBUiAo WENBUiAobGlzdCkpLAorICAgICAgICAgICAgICAgICAgRVEgKGNhciwga2V5KSB8fCAhTklMUCAo RmVxdWFsIChjYXIsIGtleSkpKSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIg KGxpc3QpOworICAgIH0KKyAgaWYgKENPTlNQIChsaXN0KSkKKyAgICByZXR1cm4gWENBUiAobGlz dCk7CisgICAgZWxzZQorICAgICAgcmV0dXJuIFFuaWw7Cit9CisKK0xpc3BfT2JqZWN0CittY19w bGlzdF9nZXQgKExpc3BfT2JqZWN0IHBsaXN0LCBMaXNwX09iamVjdCBwcm9wKQoreworICBMaXNw X09iamVjdCB0YWlsLCBoYWxmdGFpbDsKKyAgLyogaGFsZnRhaWwgaXMgdXNlZCB0byBkZXRlY3Qg Y2lyY3VsYXIgbGlzdHMuICAqLworICB0YWlsID0gaGFsZnRhaWwgPSBwbGlzdDsKKyAgd2hpbGUg KENPTlNQICh0YWlsKSAmJiBDT05TUCAoWENEUiAodGFpbCkpKQorICAgIHsKKyAgICAgIGlmIChF USAocHJvcCwgWENBUiAodGFpbCkpKQorICAgICAgICByZXR1cm4gWENBUiAoWENEUiAodGFpbCkp OworICAgICAgdGFpbCA9IFhDRFIgKFhDRFIgKHRhaWwpKTsKKyAgICAgIGhhbGZ0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GVycywgc28gdGhhdCB3ZSBwdXQgcG9pbnQgYmVmb3JlIHRoZQorICAgY2hhcmFj dGVyIG9uIHdoaWNoIHRoZSBjdXJzb3Igd2lsbCBhcHBlYXIuICovCisgICAgICBpZiAoY29sID49 IGdvYWwpCisgIGJyZWFrOworICAgICAgcHJldl9jb2wgPSBjb2w7CisgICAgICB7IC8qIENoZWNr IGRpc3BsYXkgcHJvcGVydHkuICovCisgIHB0cmRpZmZfdCBlbmRwOworICBpbnQgd2lkdGggPSBt Y19jaGVja19kaXNwbGF5X3dpZHRoIChzY2FuLCBjb2wsICZlbmRwKTsKKyAgaWYgKHdpZHRoID49 IDApCisgICAgeworICAgICAgY29sICs9IHdpZHRoOworICAgICAgaWYgKGVuZHAgPiBzY2FuKSAv KiBBdm9pZCBpbmZpbml0ZSBsb29wcyB3aXRoIDAtd2lkdGggb3ZlcmxheXMuICovCisgICAgICAg IHsKKyAgICBzY2FuID0gZW5kcDsKKyAgICBzY2FuX2J5dGUgPSBDSEFSX1RPX0JZVEUgKHNjYW4p OworICAgIGNvbnRpbnVlOworICAgICAgICB9CisgICAgfQorICAgICAgfQorICAgICAgLyogQ2hl Y2sgY29tcG9zaXRpb24gc2VxdWVuY2UuICovCisgICAgICBpZiAoY21wX2l0LmlkID49IDAKKyAg ICB8fCAoc2NhbiA9PSBjbXBfaXQuc3RvcF9wb3MKKyAgICAgICAgJiYgY29tcG9zaXRpb25fcmVz ZWF0X2l0ICgmY21wX2l0LCBzY2FuLCBzY2FuX2J5dGUsIGVuZCwKKyAgICAgICAgICB3LCBOVUxM LCBRbmlsKSkpCisgIGNvbXBvc2l0aW9uX3VwZGF0ZV9pdCAoJmNtcF9pdCwgc2Nhbiwgc2Nhbl9i eXRlLCBRbmlsKTsKKyAgICAgIGlmIChjbXBfaXQuaWQgPj0gMCkKKyAgeworICAgIHNjYW4gKz0g Y21wX2l0Lm5jaGFyczsKKyAgICBzY2FuX2J5dGUgKz0gY21wX2l0Lm5ieXRlczsKKyAgICBpZiAo c2NhbiA8PSBlbmQpCisgICAgICBjb2wgKz0gY21wX2l0LndpZHRoOworICAgIGlmIChjbXBfaXQu dG8gPT0gY21wX2l0Lm5nbHlwaHMpCisgICAgICB7CisgICAgICAgIGNtcF9pdC5pZCA9IC0xOwor ICAgICAgICBjb21wb3NpdGlvbl9jb21wdXRlX3N0b3BfcG9zICgmY21wX2l0LCBzY2FuLCBzY2Fu X2J5dGUsIGVuZCwKKyAgICAgICAgICAgICAgUW5pbCk7CisgICAgICB9CisgICAgZWxzZQorICAg ICAgY21wX2l0LmZyb20gPSBjbXBfaXQudG87CisgICAgY29udGludWU7CisgIH0KKyAgICAgIGMg PSBGRVRDSF9CWVRFIChzY2FuX2J5dGUpOworICAgICAgLyogU2VlIGlmIHRoZXJlIGlzIGEgZGlz cGxheSB0YWJsZSBhbmQgaXQgcmVsYXRlcworICAgdG8gdGhpcyBjaGFyYWN0ZXIuICovCisgICAg ICBpZiAoZHAgIT0gMAorICAgICYmICEgKG11bHRpYnl0ZSAmJiBMRUFESU5HX0NPREVfUCAoYykp CisgICAgJiYgVkVDVE9SUCAoRElTUF9DSEFSX1ZFQ1RPUiAoZHAsIGMpKSkKKyAgeworICAgIExp c3BfT2JqZWN0IGNoYXJ2ZWM7CisgICAgcHRyZGlmZl90IGksIG47CisgICAgLyogVGhpcyBjaGFy YWN0ZXIgaXMgZGlzcGxheWVkIHVzaW5nIGEgdmVjdG9yIG9mIGdseXBocy4KKyAgICAgICBVcGRh dGUgdGhlIGNvbHVtbi9wb3NpdGlvbiBiYXNlZCBvbiB0aG9zZSBnbHlwaHMuICovCisgICAgY2hh cnZlYyA9IERJU1BfQ0hBUl9WRUNUT1IgKGRwLCBjKTsKKyAgICBuID0gQVNJWkUgKGNoYXJ2ZWMp OworICAgIGZvciAoaSA9IDA7IGkgPCBuOyBpKyspCisgICAgICB7CisgICAgICAgIC8qIFRoaXMg c2hvdWxkIGJlIGhhbmRsZWQgdGhlIHNhbWUgYXMKKyAgICAgbmV4dF9lbGVtZW50X2Zyb21fZGlz cGxheV92ZWN0b3IgZG9lcyBpdC4gKi8KKyAgICAgICAgTGlzcF9PYmplY3QgZW50cnkgPSBBUkVG IChjaGFydmVjLCBpKTsKKyAgICAgICAgaWYgKEdMWVBIX0NPREVfUCAoZW50cnkpKQorICAgIGMg PSBHTFlQSF9DT0RFX0NIQVIgKGVudHJ5KTsKKyAgICAgICAgZWxzZQorICAgIGMgPSAnICc7Cisg ICAgICAgIGlmIChjID09ICdcbicpCisgICAgZ290byBlbmRsb29wOworICAgICAgICBpZiAoYyA9 PSAnXHInICYmIEVRIChCVkFSIChjdXJyZW50X2J1ZmZlciwgc2VsZWN0aXZlX2Rpc3BsYXkpLCBR dCkpCisgICAgZ290byBlbmRsb29wOworICAgICAgICBpZiAoYyA9PSAnXHQnKQorICAgIHsKKyAg ICAgIGNvbCArPSB0YWJfd2lkdGg7CisgICAgICBjb2wgPSBjb2wgLyB0YWJfd2lkdGggKiB0YWJf d2lkdGg7CisgICAgfQorICAgICAgICBlbHNlCisgICAgKytjb2w7CisgICAgICB9CisgIH0KKyAg ICAgIGVsc2UKKyAgeworICAgIC8qIFRoZSBkaXNwbGF5IHRhYmxlIGRvZXNuJ3QgYWZmZWN0IHRo aXMgY2hhcmFjdGVyOworICAgICAgIGl0IGRpc3BsYXlzIGFzIGl0c2VsZi4gKi8KKyAgICBpZiAo YyA9PSAnXG4nKQorICAgICAgZ290byBlbmRsb29wOworICAgIGlmIChjID09ICdccicgJiYgRVEg KEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBzZWxlY3RpdmVfZGlzcGxheSksIFF0KSkKKyAgICAgIGdv dG8gZW5kbG9vcDsKKyAgICBpZiAoYyA9PSAnXHQnKQorICAgICAgeworICAgICAgICBjb2wgKz0g dGFiX3dpZHRoOworICAgICAgICBjb2wgPSBjb2wgLyB0YWJfd2lkdGggKiB0YWJfd2lkdGg7Cisg ICAgICB9CisgICAgZWxzZSBpZiAobXVsdGlieXRlICYmIExFQURJTkdfQ09ERV9QIChjKSkKKyAg ICAgIHsKKyAgICAgICAgLyogU3RhcnQgb2YgbXVsdGktYnl0ZSBmb3JtLiAqLworICAgICAgICB1 bnNpZ25lZCBjaGFyICpwdHI7CisgICAgICAgIGludCBieXRlcywgd2lkdGg7CisgICAgICAgIHB0 ciA9IEJZVEVfUE9TX0FERFIgKHNjYW5fYnl0ZSk7CisgICAgICAgIE1DX01VTFRJQllURV9CWVRF U19XSURUSCAocHRyLCBkcCwgYnl0ZXMsIHdpZHRoKTsKKyAgICAgICAgLyogU3VidHJhY3Qgb25l IHRvIGNvbXBlbnNhdGUgZm9yIHRoZSBpbmNyZW1lbnQKKyAgICAgdGhhdCBpcyBnb2luZyB0byBo YXBwZW4gYmVsb3cuICovCisgICAgICAgIHNjYW5fYnl0ZSArPSBieXRlcyAtIDE7CisgICAgICAg IGNvbCArPSB3aWR0aDsKKyAgICAgIH0KKyAgICBlbHNlIGlmIChjdGxfYXJyb3cgJiYgKGMgPCAw NDAgfHwgYyA9PSAwMTc3KSkKKyAgICAgIGNvbCArPSAyOworICAgIGVsc2UgaWYgKGMgPCAwNDAg fHwgYyA+PSAwMTc3KQorICAgICAgY29sICs9IDQ7CisgICAgZWxzZQorICAgICAgY29sKys7Cisg IH0KKyAgICAgIHNjYW4rKzsKKyAgICAgIHNjYW5fYnl0ZSsrOworICAgIH0KKyBlbmRsb29wOgor ICBsYXN0X2tub3duX2NvbHVtbiA9IGNvbDsKKyAgbGFzdF9rbm93bl9jb2x1bW5fcG9pbnQgPSBw dDsKKyAgbGFzdF9rbm93bl9jb2x1bW5fbW9kaWZpZWQgPSBNT0RJRkY7CisgIGlmIChnb2FsY29s KQorICAgICpnb2FsY29sID0gY29sOworICBpZiAoZW5kcG9zKQorICAgICplbmRwb3MgPSBzY2Fu OworICBpZiAocHJldmNvbCkKKyAgICAqcHJldmNvbCA9IHByZXZfY29sOworfQorCitwdHJkaWZm X3QKK21jX2N1cnJlbnRfY29sdW1uIChz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0KKyAg ICAgIGMgPSAqLS1wdHI7CisgICAgICBpZiAoZHAgJiYgVkVDVE9SUCAoRElTUF9DSEFSX1ZFQ1RP UiAoZHAsIGMpKSkKKyAgeworICAgIGNoYXJ2ZWMgPSBESVNQX0NIQVJfVkVDVE9SIChkcCwgYyk7 CisgICAgbiA9IEFTSVpFIChjaGFydmVjKTsKKyAgfQorICAgICAgZWxzZQorICB7CisgICAgY2hh cnZlYyA9IFFuaWw7CisgICAgbiA9IDE7CisgIH0KKyAgICAgIGZvciAoaSA9IG4gLSAxOyBpID49 IDA7IC0taSkKKyAgeworICAgIGlmIChWRUNUT1JQIChjaGFydmVjKSkKKyAgICAgIHsKKyAgICAg ICAgLyogVGhpcyBzaG91bGQgYmUgaGFuZGxlZCB0aGUgc2FtZSBhcworICAgICBuZXh0X2VsZW1l bnRfZnJvbV9kaXNwbGF5X3ZlY3RvciBkb2VzIGl0LiAqLworICAgICAgICBMaXNwX09iamVjdCBl bnRyeSA9IEFSRUYgKGNoYXJ2ZWMsIGkpOworICAgICAgICBpZiAoR0xZUEhfQ09ERV9QIChlbnRy eSkpCisgICAgYyA9IEdMWVBIX0NPREVfQ0hBUiAoZW50cnkpOworICAgICAgICBlbHNlCisgICAg YyA9ICcgJzsKKyAgICAgIH0KKyAgICBpZiAoYyA+PSAwNDAgJiYgYyA8IDAxNzcpCisgICAgICBj b2wrKzsKKyAgICBlbHNlIGlmIChjID09ICdcbicKKyAgICAgICB8fCAoYyA9PSAnXHInCisgICAg ICAgICAgICYmIEVRIChCVkFSIChjdXJyZW50X2J1ZmZlciwgc2VsZWN0aXZlX2Rpc3BsYXkpLCBR dCkpKQorICAgICAgeworICAgICAgICBwdHIrKzsKKyAgICAgICAgZ290byBzdGFydF9vZl9saW5l X2ZvdW5kOworICAgICAgfQorICAgIGVsc2UgaWYgKGMgPT0gJ1x0JykKKyAgICAgIHsKKyAgICAg ICAgaWYgKHRhYl9zZWVuKQorICAgIGNvbCA9ICgoY29sICsgdGFiX3d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WQgYnkgYW4gZWxsaXBzaXMuICAqLykKKyAgKExpc3BfT2JqZWN0IHdp bmRvdywgTGlzcF9PYmplY3QgcHQpCit7CisgIHN0cnVjdCB3aW5kb3cgKncgPSBkZWNvZGVfbGl2 ZV93aW5kb3cgKHdpbmRvdyk7CisgIExpc3BfT2JqZWN0IHRlbXA7CisgIFhTRVRGQVNUSU5UICh0 ZW1wLCBtY19jdXJyZW50X2NvbHVtbiAodywgWEZJWE5VTSAocHQpKSk7CisgIHJldHVybiB0ZW1w OworfQorCisvKiBVU0FHRTogIGZwcmludGYgKHN0ZGVyciwgIkZSQU1FICglcykiLCBtY19mcmFt ZSAoZikpOyAqLworY2hhciAqCittY19mcmFtZSAoc3RydWN0IGZyYW1lICpmKQoreworICBMaXNw X09iamVjdCBmcmFtZTsKKyAgWFNFVEZSQU1FIChmcmFtZSwgZik7CisgIHJldHVybiBTU0RBVEEg KEZwcmluMV90b19zdHJpbmcgKGZyYW1lLCBRbmlsKSk7Cit9CisKKy8qIFVTQUdFOiAgZnByaW50 ZiAoc3RkZXJyLCAiV0lORE9XICglcykiLCBtY193aW5kb3cgKHcpKTsgKi8KK2NoYXIgKgorbWNf d2luZG93IChzdHJ1Y3Qgd2luZG93ICp3KQoreworICBMaXNwX09iamVjdCB3aW5kb3c7CisgIFhT RVRXSU5ET1cgKHdpbmRvdywgdyk7CisgIHJldHVybiBTU0RBVEEgKEZwcmluMV90b19zdHJpbmcg KHdpbmRvdywgUW5pbCkpOworfQorCisvKiBVU0FHRTogIGZwcmludGYgKHN0ZGVyciwgIkNIQVJB Q1RFUiAoJXMpIiwgbWNfY2hhcl90b19zdHJpbmcgKGdseXBoLT51LmNoKSk7ICovCitjaGFyICoK K21jX2NoYXJfdG9fc3RyaW5nIChpbnQgYXJnKQoreworICBMaXNwX09iamVjdCBjaGFyYWN0ZXIg PSAoMCA8PSBhcmcgJiYgYXJnIDw9IE1BWF9DSEFSKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBGY2hhcl90b19zdHJpbmcgKG1ha2VfZml4bnVtIChhcmcpKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiBRbmlsOworICBjaGFyICogcmVzdWx0ID0gKCFOSUxQIChjaGFyYWN0ZXIp CisgICAgICAgICAgICAgICAgICAgJiYgYXJnID09IDkpCisgICAgICAgICAgICAgICAgICAgID8g IlxcdCIKKyAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAg ICAgICAgICAgICAmJiBhcmcgPT0gMTApCisgICAgICAgICAgICAgICAgICAgID8gIlxcbiIKKyAg ICAgICAgICAgICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAgICAgICAg ICAmJiBhcmcgPT0gMzIpCisgICAgICAgICAgICAgICAgICAgID8gIlxccyIKKyAgICAgICAgICAg ICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAgICAgICAgICAmJiBhcmcg IT0gOQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnICE9IDEwCisgICAgICAgICAgICAgICAg ICAgICAmJiBhcmcgIT0gMzIpCisgICAgICAgICAgICAgICAgICAgID8gU1NEQVRBIChjaGFyYWN0 ZXIpCisgICAgICAgICAgICAgICAgICA6ICJcXD8iOworICByZXR1cm4gcmVzdWx0OworfQorCitp bnQKK21jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKExpc3BfT2JqZWN0IGFyZykKK3sKKyAgY2hhciAq c3RyOworICBpZiAoWFRZUEUgKGFyZykgPT0gTGlzcF9TdHJpbmcpCisgICAgc3RyID0gU1NEQVRB IChhcmcpOworICAgIGVsc2UgaWYgKFhUWVBFIChhcmcpID09IExpc3BfU3ltYm9sKQorICAgICAg c3RyID0gU1NEQVRBIChTWU1CT0xfTkFNRSAoYXJnKSk7CisgICAgICBlbHNlIHJldHVybiAtMTsK KyAgaWYgKCFzdHJjbXAgKHN0ciwgIm5vIikpCisgICAgcmV0dXJuIE1DX05PX0NVUlNPUjsKKyAg aWYgKCFzdHJjbXAgKHN0ciwgIm1jLWxlZnQtZnJpbmdlLWJpdG1hcCIpKQorICAgIHJldHVybiBN Q19MRUZUX0ZSSU5HRV9CSVRNQVA7CisgIGlmICghc3RyY21wIChzdHIsICJtYy1yaWdodC1mcmlu Z2UtYml0bWFwIikpCisgICAgcmV0dXJuIE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA7CisgIGlmICgh c3RyY21wIChzdHIsICJib3giKSkKKyAgICByZXR1cm4gTUNfRklMTEVEX0JPWDsKKyAgaWYgKCFz dHJjbXAgKHN0ciwgImZyYW1lZCIpKQorICAgIHJldHVybiBNQ19GUkFNRURfQk9YOworICBpZiAo IXN0cmNtcCAoc3RyLCAiaG9sbG93IikpCisgICAgcmV0dXJuIE1DX0hPTExPV19CT1g7CisgIGlm ICghc3RyY21wIChzdHIsICJiYXIiKSkKKyAgICByZXR1cm4gTUNfQkFSOworICBpZiAoIXN0cmNt cCAoc3RyLCAiaGJhciIpKQorICAgIHJldHVybiBNQ19IQkFSOworICByZXR1cm4gLTE7Cit9CisK Ky8qIFVTQUdFOiAgZnByaW50ZiAoc3RkZXJyLCAiQ1VSU09SIFRZUEUgKCVzKSIsIG1jX2N1cnNv cl90eXBlX3RvX3N0cmluZyAoYXJnKSk7ICovCitjaGFyICoKK21jX2N1cnNvcl90eXBlX3RvX3N0 cmluZyAoZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSkKK3sKKyAgc3dpdGNoIChjdXJz b3JfdHlwZSkKKyAgICB7CisgICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6IHJldHVybiAiTUNfRklM TEVEX0JPWCI7CisgICAgICBjYXNlIE1DX0ZSQU1FRF9CT1g6IHJldHVybiAiTUNfRlJBTUVEX0JP WCI7CisgICAgICBjYXNlIE1DX0hPTExPV19CT1g6IHJldHVybiAiTUNfSE9MTE9XX0JPWCI7Cisg ICAgICBjYXNlIE1DX0JBUjogc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X0lE IC8qIFFtb2RlX2xpbmUgKi8KKyAgICAgICAgICB8fCBmYWNlX2lkID09IE1PREVfTElORV9JTkFD VElWRV9GQUNFX0lEIC8qIFFtb2RlX2xpbmVfaW5hY3RpdmUgKi8KKyAgICAgICAgICB8fCBmYWNl X2lkID09IEhFQURFUl9MSU5FX0ZBQ0VfSUQgLyogUWhlYWRlcl9saW5lICovCisgICAgICAgICAg fHwgZmFjZV9pZCA9PSBUT09MX0JBUl9GQUNFX0lEIC8qIFF0b29sX2JhciAqLworICAgICAgICAg IHx8IGZhY2VfaWQgPT0gRlJJTkdFX0ZBQ0VfSUQgLyogUWZyaW5nZSAqLworICAgICAgICAgIHx8 IGZhY2VfaWQgPT0gU0NST0xMX0JBUl9GQUNFX0lEIC8qIFFzY3JvbGxfYmFyICovCisgICAgICAg ICAgfHwgZmFjZV9pZCA9PSBCT1JERVJfRkFDRV9JRCAvKiBRYm9yZGVyICovCisgICAgICAgICAg fHwgZmFjZV9pZCA9PSBDVVJTT1JfRkFDRV9JRCAvKiBRY3Vyc29yICovCisgICAgICAgICAgfHwg ZmFjZV9pZCA9PSBNT1VTRV9GQUNFX0lEIC8qIFFtb3VzZSAqLworICAgICAgICAgIHx8IGZhY2Vf aWQgPT0gTUVOVV9GQUNFX0lEIC8qIFFtZW51ICovCisgICAgICAgICAgfHwgZmFjZV9pZCA9PSBX SU5ET1dfRElWSURFUl9GQUNFX0lEIC8qIFF3aW5kb3dfZGl2aWRlciAqLworICAgICAgICAgIHx8 IGZhY2VfaWQgPT0gV0lORE9XX0RJVklERVJfRklSU1RfUElYRUxfRkFDRV9JRCAvKiBRd2luZG93 X2RpdmlkZXJfZmlyc3RfcGl4ZWwgKi8KKyAgICAgICAgICB8fCBmYWNlX2lkID09IFdJTkRPV19E SVZJREVSX0xBU1RfUElYRUxfRkFDRV9JRCAvKiBRd2luZG93X2RpdmlkZXJfbGFzdF9waXhlbCAq LworICAgICAgICAgIHx8IGZhY2VfaWQgPT0gVkVSVElDQUxfQk9SREVSX0ZBQ0VfSUQgLyogUXZl cnRpY2FsX2JvcmRlciAqLworICAgICAgICAgIHx8IGZhY2VfaWQgPT0gSU5URVJOQUxfQk9SREVS X0ZBQ0VfSUQpKSAvKiBRaW50ZXJuYWxfYm9yZGVyICovCisgICAgZmFjZSA9IEZBQ0VfRlJPTV9J RCAoZiwgbG9va3VwX2Jhc2ljX2ZhY2UgKHcsIGYsIGZhY2VfaWQpKTsKKyAgICBlbHNlCisgICAg ICBmYWNlID0gRkFDRV9GUk9NX0lEIChmLCBmYWNlX2lkKTsKKyAgTGlzcF9PYmplY3QgY29sb3Ig PSAoZmFjZSAhPSBOVUxMKQorICAgICAgICAgICAgICAgICAgICAgID8gZmFjZS0+bGZhY2VbTEZB Q0VfQkFDS0dST1VORF9JTkRFWF0KKyAgICAgICAgICAgICAgICAgICAgICA6IGJ1aWxkX3N0cmlu ZyAoIk9yYW5nZVJlZCIpOworICBtY194d19jb2xvcl92YWx1ZXMgKHcsIGNvbG9yLCBsc2wpOwor fQorCit2b2lkCittY19zZXRfZXNzZW50aWFscyAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IG1j X2Vzc2VudGlhbHMgKmVzc2VudGlhbHMpCit7CisgIGlmICghQlVGRkVSUCAody0+Y29udGVudHMp KQorICAgIHJldHVybjsKKyAgaWYgKE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg bWNfY29uZikpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNy b3NzaGFpcnMpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBm Y192aXNpYmxlKSkpCisgICAgcmV0dXJuOworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHct PmZyYW1lKTsKKyAgZXNzZW50aWFscy0+YWN0aXZlX3AgPSAodyA9PSBYV0lORE9XIChmLT5zZWxl Y3RlZF93aW5kb3cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGYgPT0gRlJBTUVfRElT UExBWV9JTkZPIChmKS0+eF9oaWdobGlnaHRfZnJhbWUpOworICBMaXNwX09iamVjdCBidWYgPSB3 LT5jb250ZW50czsKKyAgQ0hFQ0tfQlVGRkVSIChidWYpOworICBzdHJ1Y3QgYnVmZmVyICpiID0g WEJVRkZFUiAoYnVmKTsKKyAgc3RydWN0IGJ1ZmZlciAqb2xkX2J1ZmZlciA9IE5VTEw7CisgIHB0 cmRpZmZfdCBvcG9pbnQgPSAodyA9PSBYV0lORE9XIChzZWxlY3RlZF93aW5kb3cpKQorICAgICAg ICAgICAgICAgICAgICAgPyBQVAorICAgICAgICAgICAgICAgICAgICAgOiBYRklYTlVNIChGbWFy a2VyX3Bvc2l0aW9uICh3LT5wb2ludG0pKTsKKyAgcHRyZGlmZl90IGN1cnJlbnRfY29sID0gbWNf Y3VycmVudF9jb2x1bW4gKHcsIG9wb2ludCk7CisgIGludCBmcmFtZV9jaGFyX3dpZHRoID0gRlJB TUVfQ09MVU1OX1dJRFRIIChmKTsKKyAgYm9vbCBmaWxsX2NvbHVtbl9wID0gIU5JTFAgKEJWQVIg KGIsIGZpbGxfY29sdW1uKSk7CisgIGludCBmaWxsX2NvbCA9IFhGSVhOVU0gKEJWQVIgKGIsIGZp bGxfY29sdW1uKSk7CisgIGludCBoc2NsX3ggPSB3LT5oc2Nyb2xsICogZnJhbWVfY2hhcl93aWR0 aDsKKyAgaWYgKGIgIT0gY3VycmVudF9idWZmZXIpCisgICAgeworICAgICAgb2xkX2J1ZmZlciA9 IGN1cnJlbnRfYnVmZmVyOworICAgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAoYik7CisgICAgfQor ICBlc3NlbnRpYWxzLT56diA9IFpWOworICBlc3NlbnRpYWxzLT56dl9ieXRlID0gWlZfQllURTsK KyAgZXNzZW50aWFscy0+ZmNfeCA9IChmaWxsX2NvbHVtbl9wCisgICAgICAgICAgICAgICAgICAg ICAgJiYgIU5JTFAgKFZkaXNwbGF5X2xpbmVfbnVtYmVycykpCisgICAgICAgICAgICAgICAgICAg ICAgID8gKGZpbGxfY29sICogZnJhbWVfY2hhcl93aWR0aCkgKyB3LT5tYy5sbnVtX3BpeGVsX3dp ZHRoIC0gaHNjbF94CisgICAgICAgICAgICAgICAgICAgICA6IChmaWxsX2NvbHVtbl9wCisgICAg ICAgICAgICAgICAgICAgICAgICAmJiBOSUxQIChWZGlzcGxheV9saW5lX251bWJlcnMpKQorICAg ICAgICAgICAgICAgICAgICAgICA/IChmaWxsX2NvbCAqIGZyYW1lX2NoYXJfd2lkdGgpIC0gaHNj bF94CisgICAgICAgICAgICAgICAgICAgICA6IDA7CisgIGlmIChvbGRfYnVmZmVyKQorICAgIHNl dF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworCisgIGVudW0gZmFjZV9pZCBmaWxsX2Nv bHVtbl9wcmVfenZfZmFjZV9pZCA9CisgICAgKCFlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAgICAm JiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY19pbmFjdGl2ZV93aW5kb3dz KSkKKyAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJz KSkpCisgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCJmYy1pbmFjdGl2 ZS1wcmUtenYtZmFjZSIpLCB0cnVlKQorICAgIDogKCFlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAg ICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX2luYWN0aXZlX3dp bmRvd3MpKQorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNy b3NzaGFpcnMpKQorICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikp Cis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GRVIgKHctPmNvbnRlbnRz KSwgY3Jvc3NoYWlycykpKQorICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJu ICgiZmMtaW5hY3RpdmUtYXQtenYtZmFjZSIpLCB0cnVlKQorICAgIDogKCFlc3NlbnRpYWxzLT5h Y3RpdmVfcAorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZj X2luYWN0aXZlX3dpbmRvd3MpKQorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0 aWNhbF9ydWxlcikpCisgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gZXNzZW50aWFscy0+ZmNfeCkK KyAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoImZjLW9wb2ludC1pbmFj dGl2ZS1hdC16di1mYWNlIiksIHRydWUpCisgICAgOiAoZXNzZW50aWFscy0+YWN0aXZlX3AKKyAg ICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkK KyAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICYm IHctPmN1cnNvci54ID09IGVzc2VudGlhbHMtPmZjX3gpCisgICAgICA/IGxvb2t1cF9uYW1lZF9m YWNlICh3LCBmLCBpbnRlcm4gKCJmYy1vcG9pbnQtYXQtenYtZmFjZSIpLCB0cnVlKQorICAgIDog KCFlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3 LT5jb250ZW50cyksIGZjX2luYWN0aXZlX3dpbmRvd3MpKQorICAgICAgICYmICFOSUxQIChCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMp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xvciwgJmJl eW9uZF9maWxsX2ZvcmVncm91bmQpOworICAgICAgLyogcmVkICovCisgICAgICBpZiAoKCFmaWxs X2NvbHVtbl9wCisgICAgICAgICAgICYmIGN1cnJlbnRfY29sICUgMiAhPSAwCisgICAgICAgICAg ICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYpCisgICAgICAgICAgfHwgKGZpbGxfY29sdW1uX3AK KyAgICAgICAgICAgICAgJiYgY3VycmVudF9jb2wgJSAyICE9IDAKKyAgICAgICAgICAgICAgJiYg Y3VycmVudF9jb2wgPD0gZmlsbF9jb2wKKyAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09 IFBSRV9aVikpCisgICAgICAgIHsKKyAgICAgICAgICBsc2xfZmctPnJlZCA9IG9kZF9mb3JlZ3Jv dW5kLnJlZDsKKyAgICAgICAgICBsc2xfZmctPmdyZWVuID0gb2RkX2ZvcmVncm91bmQuZ3JlZW47 CisgICAgICAgICAgbHNsX2ZnLT5ibHVlID0gb2RkX2ZvcmVncm91bmQuYmx1ZTsKKyAgICAgICAg fQorICAgICAgICAvKiB5ZWxsb3cgKi8KKyAgICAgICAgZWxzZSBpZiAoKCFmaWxsX2NvbHVtbl9w CisgICAgICAgICAgICAgICAgICAmJiBjdXJyZW50X2NvbCAlIDIgPT0gMAorICAgICAgICAgICAg ICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVikKKyAgICAgICAgICAgICAgICAgfHwgKGZp bGxfY29sdW1uX3AKKyAgICAgICAgICAgICAgICAgICAgICYmIGN1cnJlbnRfY29sICUgMiA9PSAw CisgICAgICAgICAgICAgICAgICAgICAmJiBjdXJyZW50X2NvbCA8PSBmaWxsX2NvbAorICAgICAg ICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVikpCisgICAgICAgICAgewor ICAgICAgICAgICAgbHNsX2ZnLT5yZWQgPSBldmVuX2ZvcmVncm91bmQucmVkOworICAgICAgICAg ICAgbHNsX2ZnLT5ncmVlbiA9IGV2ZW5fZm9yZWdyb3VuZC5ncmVlbjsKKyAgICAgICAgICAgIGxz bF9mZy0+Ymx1ZSA9IGV2ZW5fZm9yZWdyb3VuZC5ibHVlOworICAgICAgICAgIH0KKyAgICAgICAg ICAvKiBncmVlbiAqLworICAgICAgICAgIGVsc2UgaWYgKGZpbGxfY29sdW1uX3AKKyAgICAgICAg ICAgICAgICAgICAmJiBjdXJyZW50X2NvbCA+IGZpbGxfY29sCisgICAgICAgICAgICAgICAgICAg JiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg bHNsX2ZnLT5yZWQgPSBiZXlvbmRfZmlsbF9mb3JlZ3JvdW5kLnJlZDsKKyAgICAgICAgICAgICAg bHNsX2ZnLT5ncmVlbiA9IGJleW9uZF9maWxsX2ZvcmVncm91bmQuZ3JlZW47CisgICAgICAgICAg ICAgIGxzbF9mZy0+Ymx1ZSA9IGJleW9uZF9maWxsX2ZvcmVncm91bmQuYmx1ZTsKKyAgICAgICAg ICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKHJvd19wb3NpdGlvbiA9PSBBVF9aVikKKyAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgIGxzbF9mZy0+cmVkID0gZXNzZW50aWFscy5zcF9m Zy5yZWQ7CisgICAgICAgICAgICAgICAgbHNsX2ZnLT5ncmVlbiA9IGVzc2VudGlhbHMuc3BfZmcu Z3JlZW47CisgICAgICAgICAgICAgICAgbHNsX2ZnLT5ibHVlID0gZXNzZW50aWFscy5zcF9mZy5i bHVlOworICAgICAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBIT1JJ Wk9OVEFMX1JVTEVSOgorICAgIHsKKyAgICAgIGlmIChnbHlwaCAhPSBOVUxMCisgICAgICAgICAg JiYgZ2x5cGgtPnUuY2ggPT0gOTUKKyAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ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ibHVlID0gZXNzZW50aWFscy5mY19mZ1tyb3dfcG9zaXRp b25dLmJsdWU7CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBDVVJTT1JfSU5ESUNBVE9S OgorICAgIHsKKyAgICAgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICAg ICAgZW51bSBmYWNlX2lkIGN1cnNvcl9mYWNlX2lkID0KKyAgICAgICAgKCFlc3NlbnRpYWxzLmFj dGl2ZV9wCisgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBj aF9pbmFjdGl2ZV93aW5kb3dzKSkKKyAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYp CisgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZh a2UtY3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpCisgICAgICAgIDogKGVzc2Vu dGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVikKKyAg ICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1j dXJzb3ItcHJlLXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgOiAoIWVzc2VudGlhbHMuYWN0aXZl X3AKKyAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hf aW5hY3RpdmVfd2luZG93cykpCisgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBBVF9aVikK KyAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1m YWtlLWN1cnNvci1pbmFjdGl2ZS1hdC16di1mYWNlIiksIHRydWUpCisgICAgICAgIDogKGVzc2Vu dGlhbHMuY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SWYgbW91c2UgaGlnaGxpZ2h0aW5n IGlzIG9uLCB3ZSBtYXkgbmVlZCB0byBkcmF3IGFkamFjZW50CisgICBnbHlwaHMgdXNpbmcgbW91 c2UtZmFjZSBoaWdobGlnaHRpbmcuICovCisgICAgICBpZiAoYXJlYSA9PSBURVhUX0FSRUEgJiYg cm93LT5tb3VzZV9mYWNlX3AKKyAgICAgICAgICAmJiBobGluZm8tPm1vdXNlX2ZhY2VfYmVnX3Jv dyA+PSAwCisgICAgICAgICAgJiYgaGxpbmZvLT5tb3VzZV9mYWNlX2VuZF9yb3cgPj0gMCkKKyAg ICAgICAgeworICAgICAgICAgIHB0cmRpZmZfdCByb3dfdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAo cm93LCB3LT5jdXJyZW50X21hdHJpeCk7CisgICAgICAgICAgaWYgKHJvd192cG9zID49IGhsaW5m by0+bW91c2VfZmFjZV9iZWdfcm93CisgICAgICAgICAgICAgICYmIHJvd192cG9zIDw9IGhsaW5m by0+bW91c2VfZmFjZV9lbmRfcm93KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBjaGVj a19tb3VzZV9mYWNlID0gdHJ1ZTsKKyAgICAgICAgICAgICAgbW91c2VfYmVnX2NvbCA9IChyb3df dnBvcyA9PSBobGluZm8tPm1vdXNlX2ZhY2VfYmVnX3JvdykKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gaGxpbmZvLT5tb3VzZV9mYWNlX2JlZ19jb2wKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogMDsKKyAgICAgICAgICAgICAgbW91c2VfZW5kX2NvbCA9IChyb3dfdnBv cyA9PSBobGluZm8tPm1vdXNlX2ZhY2VfZW5kX3JvdykKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gaGxpbmZvLT5tb3VzZV9mYWNlX2VuZF9jb2wKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogcm93LT51c2VkW1RFWFRfQVJFQV07CisgICAgIC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mluZyBhdCBgaGVhZCcuCisgICAg ICBUaGUgYmFja2dyb3VuZCBtdXN0IG5vdCBiZSBkcmF3biBiZWNhdXNlIHRoaXMgd291bGQgb3Zl cndyaXRlCisgICAgICByaWdodCBvdmVyaGFuZ3Mgb2YgcHJlY2VkaW5nIGdseXBocyBmb3Igd2hp Y2ggbm8gZ2x5cGgKKyAgICAgIHN0cmluZ3MgZXhpc3QuICovCisgICAgICBpID0gbGVmdF9vdmVy d3JpdGluZyAoaGVhZCk7CisgICAgICBpZiAoaSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAg ZW51bSBkcmF3X2dseXBoc19mYWNlIG92ZXJsYXBfaGw7CisgICAgICAgICAgaWYgKGNoZWNrX21v dXNlX2ZhY2UKKyAgICAgICAgICAgICAgJiYgbW91c2VfYmVnX2NvbCA8IHN0YXJ0ICYmIG1vdXNl X2VuZF9jb2wgPiBpKQorICAgICAgICAgICAgb3ZlcmxhcF9obCA9IERSQVdfTU9VU0VfRkFDRTsK KyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgb3ZlcmxhcF9obCA9IERSQVdfTk9STUFM X1RFWFQ7CisgICAgICAgICAgaWYgKGhsID09IG92ZXJsYXBfaGwgfHwgY2xpcF9oZWFkID09IE5V TEwpCisgICAgICAgICAgICBjbGlwX2hlYWQgPSBoZWFkOworICAgICAgICAgIE1DX0JVSUxEX0dM WVBIX1NUUklOR1MgKGksIHN0YXJ0LCBoLCB0LCBvdmVybGFwX2hsLCBkdW1teV94LCBsYXN0X3gp OworICAgICAgICAgIGZvciAocyA9IGg7IHM7IHMgPSBzLT5uZXh0KQorICAgICAgICAgICAgcy0+ YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICAgICAgY29tcHV0ZV9vdmVyaGFuZ3Nf YW5kX3ggKHQsIGhlYWQtPngsIHRydWUpOworICAgICAgICAgIHByZXBlbmRfZ2x5cGhfc3RyaW5n X2xpc3RzICgmaGVhZCwgJnRhaWwsIGgs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eCAoaCwgdGFpbC0+eCArIHRhaWwtPndpZHRoLCBm YWxzZSk7CisgICAgICAgICAgYXBwZW5kX2dseXBoX3N0cmluZ19saXN0cyAoJmhlYWQsICZ0YWls LCBoLCB0KTsKKyAgICAgICAgICBpZiAoY2xpcF90YWlsID09IE5VTEwpCisgICAgICAgICAgICBj bGlwX3RhaWwgPSB0YWlsOworICAgICAgICB9CisgICAgICAvKiBBcHBlbmQgZ2x5cGggc3RyaW5n cyBmb3IgZ2x5cGhzIGZvbGxvd2luZyB0aGUgbGFzdCBnbHlwaAorICAgICAgc3RyaW5nIHRhaWwg dGhhdCBvdmVyd3JpdGUgdGFpbC4gIFRoZSBmb3JlZ3JvdW5kIG9mIHN1Y2gKKyAgICAgIGdseXBo cyBoYXMgdG8gYmUgZHJhd24gYmVjYXVzZSBpdCB3cml0ZXMgaW50byB0aGUgYmFja2dyb3VuZAor ICAgICAgb2YgdGFpbC4gIFRoZSBiYWNrZ3JvdW5kIG11c3Qgbm90IGJlIGRyYXduIGJlY2F1c2Ug aXQgY291bGQKKyAgICAgIHBhaW50IG92ZXIgdGhlIGZvcmVncm91bmQgb2YgZm9sbG93aW5nIGds eXBocy4gKi8KKyAgICAgIGkgPSByaWdodF9vdmVyd3JpdGluZyAodGFpbCk7CisgICAgICBpZiAo aSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIG92ZXJs YXBfaGw7CisgICAgICAgICAgaWYgKGNoZWNrX21vdXNlX2ZhY2UKKyAgICAgICAgICAgICAgJiYg bW91c2VfYmVnX2NvbCA8IGkgJiYgbW91c2VfZW5kX2NvbCA+IGVuZCkKKyAgICAgICAgICAgIG92 ZXJsYXBfaGwgPSBEUkFXX01PVVNFX0ZBQ0U7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAg ICAgIG92ZXJsYXBfaGwgPSBEUkFXX05PUk1BTF9URVhUOworICAgICAgICAgIGlmIChobCA9PSBv dmVybGFwX2hsIHx8IGNsaXBfdGFpbCA9PSBOVUxMKQorICAgICAgICAgICAgY2xpcF90YWlsID0g dGFpbDsKKyAgICAgICAgICBpKys7ICAgICAgLyogV2UgbXVzdCBpbmNsdWRlIHRoZSBJdGggZ2x5 cGguICovCisgICAgICAgICAgTUNfQlVJTERfR0xZUEhfU1RSSU5HUyAoZW5kLCBpLCBoLCB0LCBv dmVybGFwX2hsLCB4LCBsYXN0X3gpOworICAgICAgICAgIGZvciAocyA9IGg7IHM7IHMgPSBzLT5u ZXh0KQorICAgICAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICAg ICAgY29tcHV0ZV9vdmVyaGFuZ3NfYW5kX3ggKGgsIHRhaWwtPnggKyB0YWlsLT53aWR0aCwgZmFs c2UpOworICAgICAgICAgIGFwcGVuZF9nbHlwaF9zdHJpbmdfbGlzdHMgKCZoZWFkLCAmdGFpbCwg aCwgdCk7CisgICAgICAgIH0KKyAgICAgIHRhaWwgPSBnbHlwaF9zdHJpbmdfY29udGFpbmluZ19i YWNrZ3JvdW5kX3dpZHRoICh0YWlsKTsKKyAgICAgIGlmIChjbGlwX3RhaWwpCisgICAgICAgIGNs aXBfdGFpbCA9IGdseXBoX3N0cmluZ19jb250YWluaW5nX2JhY2tncm91bmRfd2lkdGggKGNsaXBf dGFpbCk7CisgICAgICBpZiAoY2xpcF9oZWFkIHx8IGNsaXBfdGFpbCkKKyAgICAgICAgZm9yIChz ID0gaGVhZDsgczsgcyA9IHMtPm5leHQpCisgICAgICAgICAgeworICAgICAgICAgICAgcy0+Y2xp cF9oZWFkID0gY2xpcF9oZWFkOworICAgICAgICAgICAgcy0+Y2xpcF90YWlsID0gY2xpcF90YWls OworICAgICAgICAgIH0KKyAgICB9CisgIC8qIERyYXcgYWxsIHN0cmluZ3MuICovCisgIGZvciAo cyA9IGhlYWQ7IHMgJiYgZHJhd19wOyBzID0gcy0+bmV4dCkKKyAgICBGUkFNRV9SSUYgKGYpLT5t Y19zY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dCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJp eCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAgICAgICAgICAgIGVudW0gZHJh d19nbHlwaHNfZmFjZSBobCwgaW50IHgsIGludCBocG9zLCBpbnQgdnBvcywKKyAgICAgICAgICAg ICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbCwgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9y LAorICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUs IGludCB3ZCwgYm9vbCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICBib29sIGN1cnNv cl9nY19wKQoreworICBzdHJ1Y3QgZ2x5cGhfcm93ICpib3R0b21fcm93ID0gTUFUUklYX0JPVFRP TV9URVhUX1JPVyAobWF0cml4LCB3KTsKKyAgaW50IGJvdHRvbV92cG9zID0gTUFUUklYX1JPV19W UE9TIChib3R0b21fcm93LCBtYXRyaXgpOworLyoKKyAgICAgIHN0cnVjdCBnbHlwaCAqY3Vyc29y X2dseXBoID0gbWNfZ2V0X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIGhwb3MsIHZwb3Mp OworICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZHJhd19jdXJzb3JfZ2x5cGg6ICBjaCAoJWQp IHwgeCAoJWQpLCBocG9zICglZCksIHZwb3MoJWQpLCBobCAoJWQpXG4iLAorICAgICAgICAgICAg ICAgICAgICAgICBjdXJzb3JfZ2x5cGgtPnUuY2gsIHgsIGhwb3MsIHZwb3MsIGhsKTsKKyovCisg IGJsb2NrX2lucHV0ICgpOworICBib29sIGRyYXdfcCA9IHRydWU7CisgIG1jX2RyYXdfZ2x5cGhz ICh3LCBtYXRyaXgsIHJvdywgeCwgVEVYVF9BUkVBLCBocG9zLCBocG9zICsgMSwgaGwsIDAsCisg ICAgICAgICAgICA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worICAgICAg cmV0dXJuOworICAgIH0KKyAgLyogVlBPUyA+PSBtYXRyaXgtPm5yb3dzIG1lYW5zIHRoYXQgd2lu ZG93IGhhcyBiZWVuIHJlc2l6ZWQuCisgICAgIERvbid0IGJvdGhlciB0byBlcmFzZSB0aGUgY3Vy c29yLiAqLworICBpZiAodnBvcyA+PSBtYXRyaXgtPm5yb3dzKQorICAgIHsKKyAgICAgIGlmIChk ZWJ1Z19wKQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6ICByZXR1 cm4gKCVkKVxuIiwgMik7CisgICAgICByZXR1cm47CisgICAgfQorICAvKiBJZiByb3cgY29udGFp bmluZyBjdXJzb3IgaXMgbWFya2VkIGludmFsaWQsIHRoZXJlIGlzIG5vdGhpbmcgd2UKKyAgICAg Y2FuIGRvLiAqLworICBpZiAoIXJvdy0+ZW5hYmxlZF9wKQorICAgIHsKKyAgICAgIGlmIChkZWJ1 Z19wKQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6ICByZXR1cm4g KCVkKVxuIiwgMyk7CisgICAgICByZXR1cm47CisgICAgfQorICAvKiBJZiBsaW5lIHNwYWNpbmcg aXMgPiAwLCBvbGQgY3Vyc29yIG1heSBvbmx5IGJlIHBhcnRpYWxseSB2aXNpYmxlIGluCisgICAg IHdpbmRvdyBhZnRlciBzcGxpdC13aW5kb3cuICBTbyBhZGp1c3QgdmlzaWJsZSBoZWlnaHQuICov CisgIHJvdy0+dmlzaWJsZV9oZWlnaHQgPSBtaW4gKHJvdy0+dmlzaWJsZV9oZWlnaHQsCisgICAg ICAgICAgICB3aW5kb3dfdGV4dF9ib3R0b21feSAodykgLSByb3ctPnkpOworICAvKiBJZiByb3cg aXMgY29tcGxldGVseSBpbnZpc2libGUsIGRvbid0IGF0dGVtcHQgdG8gZGVsZXRlIGEgY3Vyc29y IHdoaWNoCisgICAgIGlzbid0IHRoZXJlLiAgVGhpcyBjYW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90IGluIG1vdXNlIGZhY2UgaWYgaXQg aXMgYXQgdGhlCisgICAgICBlbmQgb2YgYSBsaW5lIChvbiBhIG5ld2xpbmUpLiAgVGhlIGN1cnNv ciBhcHBlYXJzIHRoZXJlLCBidXQKKyAgICAgIG1vdXNlIGhpZ2hsaWdodGluZyBkb2VzIG5vdC4g Ki8KKyAgICAgICYmIHJvdy0+dXNlZFtURVhUX0FSRUFdID4gaHBvcyAmJiBocG9zID49IDApCisg ICAgbW91c2VfZmFjZV9oZXJlX3AgPSB0cnVlOworICAvKiBNYXliZSBjbGVhciB0aGUgZGlzcGxh eSB1bmRlciB0aGUgY3Vyc29yLiAqLworICBpZiAoY3Vyc29yX3R5cGUgPT0gTUNfSE9MTE9XX0JP WAorICAgICAgfHwgY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWCkKKyAgICB7CisgICAgICBp bnQgdGVtcF94ID0geDsKKyAgICAgIGludCBoZWFkZXJfbGluZV9oZWlnaHQgPSBXSU5ET1dfSEVB REVSX0xJTkVfSEVJR0hUICh3KTsKKyAgICAgIGN1cnNvcl9nbHlwaCA9IG1jX2dldF9jdXJzb3Jf Z2x5cGggKHcsIG1hdHJpeCwgcm93LCBocG9zLCB2cG9zKTsKKyAgICAgIGlmIChjdXJzb3JfZ2x5 cGggPT0gTlVMTCkKKyAgICAgICAgeworICAgICAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICAg ICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZXJhc2VfY3Vyc29yOiAgcmV0dXJuICglZClcbiIsIDcp OworICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgaW50IHRlbXBfd2QgPSBjdXJz b3JfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgaWYgKHRlbXBfeCA8IDApCisgICAgICAgIHsK KyAgICAgICAgICB0ZW1wX3dkICs9IHRlbXBfeDsKKyAgICAgICAgICB0ZW1wX3ggPSAwOworICAg ICAgICB9CisgICAgICB0ZW1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BkaXNwbmV3LmNgIGNvbnRhaW5z IHRoZSBmb2xsb3dpbmcgdGVzdHMsCisgIGVhc3NlcnQgKG1hdHJpeCAmJiBtYXRyaXgtPnJvd3Mp OworICBlYXNzZXJ0IChyb3cgPj0gMCAmJiByb3cgPCBtYXRyaXgtPm5yb3dzKTsgKi8KKyAgYm9v bCBiYXJmX2NyYXNoX29uZSA9IChtYXRyaXggJiYgbWF0cml4LT5yb3dzKSA/IGZhbHNlIDogdHJ1 ZTsKKyAgaWYgKGJhcmZfY3Jhc2hfb25lKQorICAgIHJldHVybjsKKyAgYm9vbCBiYXJmX2NyYXNo X3R3byA9ICh2cG9zID49IDAgJiYgdnBvcyA8IG1hdHJpeC0+bnJvd3MpID8gZmFsc2UgOiB0cnVl OworICBpZiAoYmFyZl9jcmFzaF90d28pCisgICAgcmV0dXJuOworICBpZiAoeCA8IDAKKyAgICAg IHx8IHkgPCAwCisgICAgICB8fCBocG9zIDwgMAorICAgICAgfHwgdnBvcyA8IDApCisgICAgcmV0 dXJuOworICBMaXNwX09iamVjdCBidWYgPSB3LT5jb250ZW50czsKKyAgQ0hFQ0tfQlVGRkVSIChi dWYpOworICBib29sIGF1dG9faHNjcm9sbF9tb2RlX3AgPSBFUSAoRmJ1ZmZlcl9sb2NhbF92YWx1 ZSAoUWF1dG9faHNjcm9sbF9tb2RlLCBidWYpLCBRY3VycmVudF9saW5lKTsKKyAgLyogRVhBTVBM RTogIChzY3JvbGwtbGVmdCA1KSAqLworICBib29sIGhzY2xfYWxsX3RlbXBfcCA9ICh3LT5zdXNw ZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3Jv bGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IDApOworICAvKiBF WEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBub3RoaW5nLiAqLworICBib29sIGhzY2xfYWxsX3Bl cm1fMF9wID0gKHctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWlu X2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3Jv bGwgPT0gdy0+aHNjcm9sbCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIHNvbWV0 aGluZyBlbHNlIGJlc2lkZXMgaG9yaXpvbnRhbGx5IHNjcm9sbGluZyB0aGUKKyAgICAgICAgICAg ICAgIGN1cnJlbnQgbGluZSBkaWZmZXJlbnRseS4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGlu ZSBpcyBfbm90XyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wg aHNjbF9hbGxfcGVybV8xX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg dy0+bWluX2hzY3JvbGwgPT0gdy0+aHNjcm9sbCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwg YW5kIC4uLgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIGlzIF9ub3RfIGhvcml6b250YWxs eSBzY3JvbGxlZCBkaWZmZXJlbnRseS4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzJfcCA9ICgh dy0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBh dXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNj cm9sbCA9PSAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwg PiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgIT0gdy0+ aHNjcm9sbCk7CisgIC8qIEVYQU1QTEU6ICAoc2Nyb2xsLWxlZnQgNSk7IGFuZCwgdGhlbiBwcmVz cyB0aGUgbGVmdCBhcnJvdyBrZXkgb25lIHRpbWUuCisgICAgICAgICAgICAgICBDdXJyZW50IGxp bmUgX2lzXyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuKi8KKyAgYm9vbCBoc2Ns X3RlbXBfcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAg ICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNj cm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsK KyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBhbmQgZG8gc29tZXRoaW5nIHRoYXQgY2F1c2VzIHRo ZSBjdXJyZW50IGxpbmUgdG8gYmUKKyAgICAgICAgICAgICAgIGhvcml6b250YWxseSBzY3JvbGxl ZCBkaWZmZXJlbnRseS4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBfaXNfIGhvcml6b250 YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4gKi8KKyAgYm9vbCBoc2NsX3Blcm1fcCA9ICghdy0+ c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3Jv bGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5taW5faHNjcm9sbCAhPSB3LT5oc2Nyb2xsKTsKKyAgc3RydWN0IGZyYW1lICpm ID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIGludCBmcmluZ2VfYml0bWFwID0gTUNfTk9fRlJJTkdF X0JJVE1BUDsKKyAgaW50IGZhY2VfaWQgPSBERUZBVUxUX0ZBQ0VfSUQ7CisgIGlmICghcmVtb3Zl X3AKKyAgICAgICYmIGdseXBoX2ZsYXZvciA9PSBNQ19PVkVSTEFZX0FSUk9XX0JJVE1BUAorICAg ICAgJiYgIWhzY2xfYWxsX3RlbXBfcAorICAgICAgJiYgIWhzY2xfdGVtcF9wCisgICAgICAmJiAh aHNjbF9wZXJtX3AKKyAgICAgICYmICFoc2NsX2FsbF9wZXJtXzBfcAorICAgICAgJiYgIWhzY2xf YWxsX3Blcm1fMV9wCisgICAgICAmJiAhaHNjbF9hbGxfcGVybV8yX3ApCisgICAgeworICAgICAg ZW51bSBmYWNlX2lkIG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICghYWN0aXZlX3AK KyAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2luYWN0 aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJu ICgiKy1vdmVybGF5LWFycm93LWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpCisgICAgICAg IDogKGFjdGl2ZV9wKQorICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVy biAo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nNvcl90eXBlKTsKKyAg ICB9CisgICAgZWxzZSBpZiAoIXJlbW92ZV9wCisgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9y ID09IE1DX09WRVJMQVlfQVJST1dfQklUTUFQCisgICAgICAgICAgICAgJiYgKGhzY2xfYWxsX3Rl bXBfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzBfcAorICAgICAgICAgICAg ICAgICB8fCBoc2NsX2FsbF9wZXJtXzFfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9w ZXJtXzJfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX3RlbXBfcAorICAgICAgICAgICAgICAg ICB8fCBoc2NsX3Blcm1fcCkpCisgICAgICB7CisgICAgICAgIGVudW0gZmFjZV9pZCBvdmVybGF5 X2Fycm93X2ZhY2VfaWQgPQorICAgICAgICAgICghYWN0aXZlX3AKKyAgICAgICAgICAgJiYgIU5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaW5hY3RpdmVfd2luZG93cykpKQor ICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb3ZlcmxheS1h cnJvdy1oc2NsLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpCisgICAgICAgICAgOiAoYWN0 aXZlX3ApCisgICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIr LW92ZXJsYXktYXJyb3ctaHNjbC1wcmUtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICAgIDogREVG QVVMVF9GQUNFX0lEOworICAgICAgICBmYWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRf RlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgID8gb3ZlcmxheV9hcnJvd19mYWNlX2lk CisgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgaWY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fRlJJTkdFX0JJVE1B UCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZnJpbmdlX2Jp dG1hcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19OT19G UklOR0VfQklUTUFQOworICAgICAgICByb3ctPmxlZnRfZnJpbmdlX2ZhY2VfaWQgPSBmYWNlX2lk OworICAgICAgICByb3ctPmxlZnRfZnJpbmdlX29mZnNldCA9IDA7CisgICAgICAgIHJvdy0+ZnJp bmdlX2JpdG1hcF9wZXJpb2RpY19wID0gZmFsc2U7CisgICAgICAgIG1jX2RyYXdfZnJpbmdlX2Jp dG1hcCAodywgcm93LCB0cnVlLCBjdXJzb3JfdHlwZSk7CisgICAgICB9CisgICAgICBlbHNlIGlm ICghcmVtb3ZlX3AKKyAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9X X1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZv ciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAg ICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEUKKyAgICAgICAg ICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9X CisgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJ Q0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9 PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0g TUNfUkVWRVJTRURfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxh dm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gpKQorICAgICAgICB7CisgICAgICAgICAg TGlzcF9PYmplY3QgYml0bWFwX2ZsYXZvciA9IChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JF Q1RBTkdMRV9SSUdIVF9BUlJPVykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBRbWNfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9X X1JFQ1RBTkdMRV9SSUdIVF9BUlJPVykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IFFtY19yZXZlcnNlZF9ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19I T0xMT1dfUkVDVEFOR0xFKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gUW1jX2hvbGxvd19yZWN0YW5nbGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVykKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXJf cmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5 cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVykKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19yZXZlcnNlZF92ZXJ0aWNh bF9iYXJfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXIKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJ Q0FMX0JBUikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19y ZXZlcnNlZF92ZXJ0aWNhbF9iYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyX2JhY2tz bGFzaAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFFuaWw7CisgICAg ICAgICAgZnJpbmdlX2JpdG1hcCA9IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklU TUFQKQorICAgICAgICAgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9mcmluZ2VfYml0bWFwIChi aXRtYXBfZmxhdm9yKQorICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX05PX0ZSSU5HRV9C SVRNQVA7CisgICAgICAgICAgZmFjZV9pZCA9IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklO R0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgICAmJiAoZ2x5cGhfZmxhdm9yID09IE1DX1JF VkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAg ICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FS Uk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVS U0VEX1ZFUlRJQ0FMX0JBUikpCisgICAgICAgICAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRf ZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZXZlcnNlZC1iYXItcHJlLXp2LWZhY2UiKSwgdHJ1ZSkK KyAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJ VE1BUAorICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJT RURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAm JiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisg ICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9WRVJU SUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywg ZiwgaW50ZXJuICgiKy1iYXItcHJlLXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICAg ICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgcm93LT5jdXJzb3JfaW5fZnJpbmdlX3Ag PSBmYWxzZTsKKyAgICAgICAgICByb3ctPnJpZ2h0X2ZyaW5nZV9iaXRtYXAgPSBmcmluZ2VfYml0 bWFwOworICAgICAgICAgIHJvdy0+cmlnaHRfZnJpbmdlX2ZhY2VfaWQgPSBmYWNlX2lkOworICAg ICAgICAgIHJvdy0+cmlnaHRfZnJpbmdlX29mZnNldCA9IDA7CisgICAgICAgICAgcm93LT5mcmlu Z2VfYml0bWFwX3BlcmlvZGljX3AgPSBmYWxzZTsKKyAgICAgICAgICBtY19kcmF3X2ZyaW5nZV9i aXRtYXAgKHcsIHJvdywgZmFsc2UsIGN1cnNvcl90eXBlKTsKKyAgICAgICAgfQorICAgICAgICBl bHNlIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEgKKyAgICAgICAgICAgICAgICAgfHwgZ2x5 cGhfZmxhdm9yID09IE1DX0dMWVBITEVTUykKKyAgICAgICAgICB7CisgICAgICAgICAgICBib29s IG9uX3AgPSB0cnVlOworICAgICAgICAgICAgRlJBTUVfUklGIChmKS0+bWNfc2NyaWJlX2N1cnNv ciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZwb3MsIHdkLCBoLCBsc2wsIGN1cnNvcl90eXBl LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dp ZHRoLCBnbHlwaF9mbGF2b3IsIG9uX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBhY3RpdmVfcCk7CisgICAgICAgICAgfQorfQorCisvKiBEdW1wIGNvbnRl bnRzIG9mIGdseXBoIEdMWVBIIHRvIHN0ZGVyci4gIFJPVyBhbmQgQVJFQSBhcmUKKyAgIHRoZSBn bHlwaCByb3cgYW5kIGFyZWEgd2hlcmUgdGhlIGdseXBoIGNvbWVzIGZyb20uICovCit2b2lkCitt Y19kdW1wX2dseXBoIChzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIHN0cnVjdCBnbHlwaCAqZ2x5cGgs IGludCBhcmVhLAorICAgICAgICAgICAgICAgaW50IHJlbGF0aXZlX3gsIGludCB2cG9zKQorewor ICBpZiAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgfHwgZ2x5cGgtPnR5cGUgPT0g R0xZUEhMRVNTX0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAg IiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4x ZCAlNWQgJTRkICAlM2QgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBo c1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ct PnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgKGdseXBoLT50 eXBlID09IENIQVJfR0xZUEgKKyAgICAgICAgID8gJ0MnCisgICAgICAgICA6ICdHJyksCisgICAg ICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAg ICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAg ICAgICAgPyAnUycKKyAgICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICAgICAgICA/ICcwJworICAgICAgICAgICAgICAgOiAnLScpKSksCisgICAgICAgIGdseXBoLT5w aXhlbF93aWR0aCwKKyAgICAgICAgZ2x5cGgtPnUuY2gsCisgICAgICAgIGdseXBoLT5mYWNlX2lk LAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRf Ym94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgdnBv cywgZ2x5cGgtPnp2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgbWNfY2hhcl90b19zdHJpbmcg KGdseXBoLT51LmNoKSk7CisgICAgfQorICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBTVFJFVENI X0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIiAlNSJwRCJk LyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4xZCAlNWQgJTRk ICAlM2QgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FS RUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJl YV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ1MnLAorICAgICAgICBnbHlw aC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAg ICA/ICdCJworICAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAg ICA/ICdTJworICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ ICcwJworICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisg ICAgICAgIDB1LAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRf Ym94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGds eXBoLT54LCBnbHlwaC0+eSwgZ2x5cGgtPmhwb3MsIHZwb3MsIGdseXBoLT56dl9wID8gIlpWIiA6 ICItLSIsCisgICAgICAgICJcXFMiKTsKKyAgICB9CisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09 IElNQUdFX0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIiAl NSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4xZCAl NWQgJTRkICAlM2QgICUzZCAlcyAlY1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tU RVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVz ZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ0knLAorICAgICAg ICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAg ICAgICAgICA/ICdCJworICAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAg ICAgICAgICA/ICdTJworICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICAgICA/ICcwJworICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lk dGgsCisgICAgICAgICh1bnNpZ25lZCBpbnQpIGdseXBoLT51LmltZ19pZCwKKyAgICAgICAgZ2x5 cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGds eXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+eCwgZ2x5cGgtPnksIGdseXBo LT5ocG9zLCB2cG9zLCBnbHlwaC0+enZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAnLicpOwor ICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKQorICAgIHsK KyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIiAlNSJwRCJkLyUtNWQgJTVkICVjICU5 InBEImQgJWMgJTNkIDB4JTA2eCIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9B UkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2Fy ZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICcrJywKKyAgICAgICAgZ2x5 cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAg ICAgPyAnQicKKyAgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAg ICAgPyAnUycKKyAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAg PyAnMCcKKyAgICAgICAgICA6ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAor ICAgICAgICAodW5zaWduZWQgaW50KSBnbHlwaC0+dS5jbXAuaWQpOworICAgICAgZnByaW50ZiAo c3RkZXJyLCAiICU0ZCAlMS4xZCUxLjFkIiwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAg ICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGlu ZV9wKTsKKyAgICAgIGlmIChnbHlwaC0+dS5jbXAuYXV0b21hdGljKQorICAgICAgICBmcHJpbnRm IChzdGRlcnIsICIgJTVkICU0ZCAgJTNkICAlM2QgJXMgLiBbJWQtJWRdXG4iLAorICAgICAgICAg ICAgICAgICAgICAgICAgIGdseXBoLT54LCBnbHlwaC0+eSwgZ2x5cGgtPmhwb3MsIHZwb3MsIGds eXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGgt PnNsaWNlLmNtcC5mcm9tLCBnbHlwaC0+c2xpY2UuY21wLnRvKTsKKyAgICAgICAgZWxzZQorICAg ICAgICBmcHJpbnRmIChzdGRlcnIsICJcbiIpOworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5 cGUgPT0gWFdJREdFVF9HTFlQSCkKKyAgICB7CisjaWZuZGVmIEhBVkVfWFdJREdFVFMKKyAgICAg IGVhc3N1bWUgKGZhbHNlKTsKKyNlbHNlCisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAg ICIgICU1ZC8lLTVkICU1ZCAlNGMgJTZkICVjICUzZCAweCUwNXggJTRkICUxLjFkJTEuMWQgJTVk ICU0ZCAgJTNkICAlM2QgJXMgJWNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVY VF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2Vk W2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdYJywKKyAgICAgICAg Z2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAg ICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAg ICAgID8gJ1MnCisgICAgICAgICA6ICctJykpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgs CisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9w LAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnUueHdp ZGdldCwKKyAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgdnBvcywgZ2x5 cGgtPnp2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgJy4nKTsKKyNlbmRpZgorICAgIH0KK30K KworLyogRHVtcCB0aGUgY29udGVudHMgb2YgZ2x5cGggcm93IGF0IFZQT1MgaW4gTUFUUklYIHRv IHN0ZGVyci4KKyAgIEdMWVBIUyAwIG1lYW5zIGRvbid0IHNob3cgZ2x5cGggY29udGVudHMuCisg ICBHTFlQSFMgMSBtZWFucyBzaG93IGdseXBocyBpbiBzaG9ydCBmb3JtCisgICBHTFlQSFMgPiAx IG1lYW5zIHNob3cgZ2x5cGhzIGluIGxvbmcgZm9ybS4gKi8KK3ZvaWQKK21jX2R1bXBfZ2x5cGhf cm93IChzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCB2cG9zLCBpbnQgZ2x5cGhzKQoreworICBp bnQgcmVsYXRpdmVfeCA9IDA7CisgIGlmIChnbHlwaHMgIT0gMSkKKyAgICB7CisgICAgICBmcHJp bnRmIChzdGRlcnIsICJcbkRVTVAgR0xZUEggUk9XXG4iKTsKKyAgICAgIGZwcmludGYgKHN0ZGVy ciwgIlJvdyAgICAgU3RhcnQgICAgICAgRW5kIFVzZWQgb0U+PFxcQ1RaRmVzbSAgICAgWCAgICBZ ICAgIFcgICAgSCAgICBWICAgIEEgICAgUFxuIik7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICI9 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT1cbiIpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiJTNkICU5 InBEImQgJTkicEQiZCAlNGQgJTEuMWQlMS4xZCUxLjFkJTEuMWRcCislMS4xZCUxLjFkJTEuMWQl MS4xZCUxLjFkJTEuMWQlMS4xZCUxLjFkICAlNGQgJTRkICU0ZCAlNGQgJTRkICU0ZCAlNGRcbiIs CisgICAgICAgICB2cG9zLAorICAgICAgICAgTUFUUklYX1JPV19TVEFSVF9DSEFSUE9TIChyb3cp LAorICAgICAgICAgTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSwKKyAgICAgICAgIHJvdy0+ dXNlZFtURVhUX0FSRUFdLAorICAgICAgICAgcm93LT5jb250YWluc19vdmVybGFwcGluZ19nbHlw aHNfcCwKKyAgICAgICAgIHJvdy0+ZW5hYmxlZF9wLAorICAgICAgICAgcm93LT50cnVuY2F0ZWRf b25fbGVmdF9wLAorICAgICAgICAgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCwKKyAgICAgICAg IHJvdy0+Y29udGludWVkX3AsCisgICAgICAgICBNQVRSSVhfUk9XX0NPTlRJTlVBVElPTl9MSU5F X1AgKHJvdyksCisgICAgICAgICBNQVRSSVhfUk9XX0RJU1BMQVlTX1RFWFRfUCAocm93KSwKKyAg ICAgICAgIHJvdy0+ZW5kc19hdF96dl9wLAorICAgICAgICAgcm93LT5maWxsX2xpbmVfcCwKKyAg ICAgICAgIHJvdy0+ZW5kc19pbl9taWRkbGVfb2ZfY2hhcl9wLAorICAgICAgICAgcm93LT5zdGFy dHNfaW5fbWlkZGxlX29mX2NoYXJfcCwKKyAgICAgICAgIHJvdy0+bW91c2VfZmFjZV9wLAorICAg ICAgICAgcm93LT54LAorICAgICAgICAgcm93LT55LAorICAgICAgICAgcm93LT5waXhlbF93aWR0 aCwKKyAgICAgICAgIHJvdy0+aGVpZ2h0LAorICAgICAgICAgcm93LT52aXNpYmxlX2hlaWdodCwK KyAgICAgICAgIHJvdy0+YXNjZW50LAorICAgICAgICAgcm93LT5waHlzX2FzY2VudCk7CisgICAg ICAvKiBUaGUgbmV4dCAzIGxpbmVzIHNob3VsZCBhbGlnbiB0byAiU3RhcnQiIGluIHRoZSBoZWFk ZXIuICovCisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgICAgJTkicEQiZCAlOSJwRCJkXHQlNWRc biIsIHJvdy0+c3RhcnQub3ZlcmxheV9zdHJpbmdfaW5kZXgsCisgICAgICAgICByb3ctPmVuZC5v dmVybGF5X3N0cmluZ19pbmRleCwKKyAgICAgICAgIHJvdy0+Y29udGludWF0aW9uX2xpbmVzX3dp ZHRoKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgICAlOSJwRCJkICU5InBEImRcbiIsCisg ICAgICAgICBDSEFSUE9TIChyb3ctPnN0YXJ0LnN0cmluZ19wb3MpLAorICAgICAgICAgQ0hBUlBP UyAocm93LT5lbmQuc3RyaW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zIHRoZSBwcmVmaXggbnVtZXJpYyBhcmd1bWVudCBh bmQgZGVmYXVsdHMgdG8KK3RoZSByb3cgd2hpY2ggZGlzcGxheXMgcG9pbnQuCitPcHRpb25hbCBh cmd1bWVudCBHTFlQSFMgMCBtZWFucyBkb24ndCBkdW1wIGdseXBocy4KK0dMWVBIUyAxIG1lYW5z IGR1bXAgZ2x5cGhzIGluIHNob3J0IGZvcm0uCitHTFlQSFMgPiAxIG9yIG9taXR0ZWQgbWVhbnMg ZHVtcCBnbHlwaHMgaW4gbG9uZyBmb3JtLiAgKi8pCisgIChMaXNwX09iamVjdCByb3csIExpc3Bf T2JqZWN0IGdseXBocykKK3sKKyAgc3RydWN0IHdpbmRvdyAqdyA9IFhXSU5ET1cgKHNlbGVjdGVk X3dpbmRvdyk7CisgIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0 cml4OworICBFTUFDU19JTlQgdnBvczsKKyAgaWYgKE5JTFAgKHJvdykpCisgICAgeworICAgICAg aW50IGQxLCBkMiwgZDMsIGQ0LCBkNSwgeXBvczsKKyAgICAgIGJvb2wgdmlzaWJsZV9wID0gcG9z X3Zpc2libGVfcCAodywgUFQsICZkMSwgJmQyLCAmZDMsICZkNCwgJmQ1LCAmeXBvcyk7CisgICAg ICBpbnQgaGVhZGVyX2xpbmVfaGVpZ2h0ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7 CisgICAgICBpbnQgdm9mZnNldCA9IChoZWFkZXJfbGluZV9oZWlnaHQgPiAwCisgICAgICAgICAg ICAgICAgICAgICAmJiB5cG9zID4gMCkKKyAgICAgICAgICAgICAgICAgICAgICA/IHlwb3MgKyAx CisgICAgICAgICAgICAgICAgICAgICAgOiB5cG9zOworICAgICAgaWYgKHZpc2libGVfcCkKKyAg ICAgICAgdnBvcyA9IHZvZmZzZXQ7CisgICAgICAgIGVsc2UKKyAgICAgICAgICB2cG9zID0gMDsK KyAgICB9CisgICAgZWxzZQorICAgICAgeworICAgICAgICBDSEVDS19OVU1CRVIgKHJvdyk7Cisg ICAgICAgIHZwb3MgPSBYRklYTlVNIChyb3cpOworICAgICAgfQorICBpZiAodnBvcyA+PSAwICYm IHZwb3MgPCBtYXRyaXgtPm5yb3dzKQorICAgIG1jX2R1bXBfZ2x5cGhfcm93IChNQVRSSVhfUk9X IChtYXRyaXgsIHZwb3MpLAorICAgICAgICB2cG9zLAorICAgICAgICBUWVBFX1JBTkdFRF9GSVhO VU1QIChpbnQsIGdseXBocykgPyBYRklYTlVNIChnbHlwaHMpIDogMik7CisgIHJldHVybiBRbmls OworfQorCit2b2lkCittY19kdW1wX2dseXBoX21hdHJpeCAoc3RydWN0IGdseXBoX21hdHJpeCAq bWF0cml4LCBpbnQgZ2x5cGhzKQoreworICBpbnQgaTsKKyAgZm9yIChpID0gMDsgaSA8IG1hdHJp eC0+bnJvd3M7ICsraSkKKyAgICBtY19kdW1wX2dseXBoX3JvdyAoTUFUUklYX1JPVyAobWF0cml4 LCBpKSwgaSwgZ2x5cGhzKTsKK30KKworREVGVU4gKCJtYy1kdW1wLWdseXBoLW1hdHJpeCIsIEZt Y19kdW1wX2dseXBoX21hdHJpeCwKKyAgICAgICBTbWNfZHVtcF9nbHlwaF9tYXRyaXgsIDAsIDEs ICJwIiwKKyAgICAgICBkb2M6IC8qIER1bXAgdGhlIGN1cnJlbnQgbWF0cml4IG9mIHRoZSBzZWxl Y3RlZCB3aW5kb3cgdG8gc3RkZXJyLgorU2hvd3MgY29udGVudHMgb2YgZ2x5cGggcm93IHN0cnVj dHVyZXMuICBXaXRoIG5vbi1uaWwKK3BhcmFtZXRlciBHTFlQSFMsIGR1bXAgZ2x5cGhzIGFzIHdl bGwuICBJZiBHTFlQSFMgaXMgMSBzaG93CitnbHlwaHMgaW4gc2hvcnQgZm9ybSwgb3RoZXJ3aXNl IHNob3cgZ2x5cGhzIGluIGxvbmcgZm9ybS4KKy0gSW50ZXJhY3RpdmVseSwg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GNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICBjYWNoZV90eXBlIDwgTk9f Q0FDSEU7CisgICAgICAgKytjYWNoZV90eXBlKQorICAgIHsKKyAgICAgIGJvb2wgYnZhcl9hY3Rp dmVfcDsKKyAgICAgIHN3aXRjaCAoY2FjaGVfdHlwZSkKKyAgICAgICAgeworICAgICAgICAgIGNh c2UgTk9fQ0FDSEU6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHJldHVybjsKKyAgICAg ICAgICAgIH0KKyAgICAgICAgICBjYXNlIE1DX0NBQ0hFOgorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAmJiBO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkKKyAgICAgICAgICAg ICAgICBidmFyX2FjdGl2ZV9wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoQlVG RkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQorICAgICAgICAgICAgICAgICAg YnZhcl9hY3RpdmVfcCA9IHRydWU7CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAg fQorICAgICAgICAgIGNhc2UgQ0hfQ0FDSEU6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAg IGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICYmIE5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgICAgICAgICAgICAg IGJ2YXJfYWN0aXZlX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBlbHNlIGlmIChCVUZGRVJQ ICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisgICAgICAgICAgICAgICAgICBi dmFyX2FjdGl2ZV9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9 CisgICAgICAgICAgY2FzZSBGQ19DQUNIRToKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg aWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgJiYgTklMUCAoQlZB UiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpCisgICAgICAgICAgICAgICAg YnZhcl9hY3RpdmVfcCA9IGZhbHNlOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKEJVRkZFUlAg KHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKSkKKyAgICAgICAgICAgICAgICAgIGJ2 YXJfYWN0aXZlX3AgPSB0cnVlOworICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0K KyAgICAgICAgfQorICAgICAgaWYgKCFidmFyX2FjdGl2ZV9wKQorICAgICAgICB7CisgICAgICAg ICAgLyogRGVjcmVhc2UgdGhlIHNpemUgb2YgdGhlIGFycmF5IHRvIGEgYmFyZSBtaW5pbXVtLiAq LworICAgICAgICAgIGZvciAoaW50IHZudGggPSAwOyB2bnRoIDwgdy0+bWNfbWF0cml4LnZwb3Nf dXNlZDsgKyt2bnRoKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAody0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVkW2NhY2hlX3R5cGVdID4gMSkKKyAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo 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gQXQgdGhpcyB0aW1lLCB3ZSBhcmUg aW5zdGVhZCBsZWF2aW5nIHRoZSBhcnJheSBhcy1pcyB3aXRoIHRoZQorICAgICAgICAvLyAgdW5k ZXJzdGFuZGluZyB0aGF0IGl0IHdpbGwgY29udGFpbiBvdXRkYXRlZCBkYXRhIChha2EgZ2FyYmFn ZSkuCisgICAgICAgIC8vICBVc2luZyB0aGUgY291bnRlciBgdy0+bWNfbWF0cml4LnZwb3NbQF0u Y2FjaGVfdXNlZFtjYWNoZV90eXBlXWAsIHdlIHRyYWNrIGN1cnJlbnQgZGF0YS4KKyAgICAgICAg ZWxzZSBpZiAoYnZhcl9hY3RpdmVfcCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBmb3IgKGlu dCB2bnRoID0gMDsgdm50aCA8IHctPm1jX21hdHJpeC52cG9zX3VzZWQ7ICsrdm50aCkKKyAgICAg ICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXSA9 IDA7CisgICAgICAgICAgICB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5cGVdID0g MDsKKyAgICAgICAgICB9CisgICAgfQorLyoKKyAgZm9yIChpbnQgdm50aCA9IDA7CisgICAgICAg dm50aCA8IHctPm1jX21hdHJpeC52cG9zX3VzZWQ7CisgICAgICAgKyt2bnRoKQorICAgIGZvciAo ZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICAgIGNhY2hl X3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICAgICsrY2FjaGVfdHlwZSkKKyAgICAgIGZwcmludGYg KHN0ZGVyciwgIm1jX3Jlc2V0X2NhY2hlICglZCk6ICAlc1xuXAorICB3LT5tY19tYXRyaXgudnBv c191c2VkICglZClcblwKKyAgdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFslc10gKCVkKVxuXAor ICB3LT5tY19tYXRyaXguY3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WZ0X2JveF9saW5lX3AKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRy aXgudnBvc1tybl0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5nbHlwaC5yaWdodF9ib3hfbGluZV9w ID09IGdseXBoLT5yaWdodF9ib3hfbGluZV9wCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4 LnZwb3Nbcm5dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGgudm9mZnNldCA9PSBnbHlwaC0+ dm9mZnNldAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhdLmdseXBoLnBpeGVsX3dpZHRoID09IGdseXBoLT5waXhlbF93aWR0aAorICAg ICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBlXVtudGhd LmdseXBoLnNsaWNlLmltZy54ID09IGdseXBoLT5zbGljZS5pbWcueAorICAgICAgICAgICAgICYm IHctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLnNsaWNl LmltZy55ID09IGdseXBoLT5zbGljZS5pbWcueQorICAgICAgICAgICAgICYmIHctPm1jX21hdHJp eC52cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLnNsaWNlLmltZy53aWR0aCA9 PSBnbHlwaC0+c2xpY2UuaW1nLndpZHRoCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZw b3Nbcm5dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGguc2xpY2UuaW1nLmhlaWdodCA9PSBn bHlwaC0+c2xpY2UuaW1nLmhlaWdodAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9z W3JuXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLnNsaWNlLmNtcC5mcm9tID09IGdseXBo LT5zbGljZS5jbXAuZnJvbQorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3JuXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLnggPT0geAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJp eC52cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZ4ID09IGZ4CisgICAgICAgICAgICAg JiYgdy0+bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ueSA9PSB5Cisg ICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hlW2NhY2hlX3R5cGVdW250 aF0uZnkgPT0gZnkKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1tybl0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXS5ocG9zID09IGhwb3MKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRy aXgudnBvc1tybl0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS52cG9zID09IHZwb3MKKyAgICAgICAg ICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1tybl0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS53ZCA9 PSB3ZAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhdLmggPT0gaAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3JuXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLmN1cnNvcl90eXBlID09IGN1cnNvcl90eXBlCisgICAgICAg ICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uY3Vy c29yX3dpZHRoID09IGN1cnNvcl93aWR0aAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52 cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZvcmVncm91bmQucmVkID09IGZvcmVncm91 bmQucmVk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5LCBocG9zLCB2cG9zLCB3 ZCwgaCwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jf d2lkdGgsIGZvcmVncm91bmQsIGFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIHJlbW92ZV9wKTsKKyAg ICAgIHJldHVybjsKKyAgICB9CisgICAgZWxzZSBpZiAoZHJhd19wCisgICAgICAgICAgICAgJiYg KGZyb21fd2hlcmUgPT0gU0NSSUJFX09ORQorICAgICAgICAgICAgICAgICB8fCBmcm9tX3doZXJl ID09IFNDUklCRV9UV08KKyAgICAgICAgICAgICAgICAgfHwgZnJvbV93aGVyZSA9PSBTQ1JJQkVf VEhSRUUKKyAgICAgICAgICAgICAgICAgfHwgZnJvbV93aGVyZSA9PSBOT1dIRVJFKSkKKyAgICB7 CisgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBm eSwgaHBvcywgdnBvcywgd2QsIGgsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYWN0aXZlX3AsIGdseXBoX2ZsYXZvciwg cmVtb3ZlX3ApOworICAgICAgcmV0dXJuOworICAgIH0KKyAgaWYgKGNhY2hlX3R5cGUgPT0gTk9f Q0FDSEUpCisgICAgcmV0dXJuOworICArK3ctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVf dHlwZV07CisgIGlmICh3LT5tY19tYXRyaXgudnBvc191c2VkIDwgbWF0cml4LT5ucm93cykKKyAg ICB3LT5tY19tYXRyaXgudnBvc191c2VkID0gbWF0cml4LT5ucm93czsKKyAgaWYgKHctPm1jX21h dHJpeC52cG9zX2FsbG9jYXRlZCA8IHctPm1jX21hdHJpeC52cG9zX3VzZWQpCisgICAgeworICAg ICAgaW50IG9sZF9hbGxvYyA9IHctPm1jX21hdHJpeC52cG9zX2F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tybl0uY2FjaGVbY2FjaGVfdHlwZV0sICZ3LT5tY19tYXRyaXgudnBvc1ty bl0uY2FjaGVfYWxsb2NhdGVkW2NhY2hlX3R5cGVdLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBuZXdfZWx0cywgSU5UX01BWCwgc2l6ZW9mICp3LT5tY19tYXRyaXgudnBvc1ty bl0uY2FjaGVbY2FjaGVfdHlwZV0pOworICAgICAgbWVtc2V0ICh3LT5tY19tYXRyaXgudnBvc1ty bl0uY2FjaGVbY2FjaGVfdHlwZV0gKyBvbGRfYWxsb2MsIDAsCisgICAgICAgICAgICAgICAody0+ bWNfbWF0cml4LnZwb3Nbcm5dLmNhY2hlX2FsbG9jYXRlZFtjYWNoZV90eXBlXSAtIG9sZF9hbGxv YykgKiBzaXplb2YgKnctPm1jX21hdHJpeC52cG9zW3JuXS5jYWNoZVtjYWNoZV90eXBlXSk7Cisg ICAgfQorLyoKKyAgZm9yIChpbnQgdm50aCA9IDA7CisgICAgICAgdm50aCA8IHctPm1jX21hdHJp eC52cG9zX3VzZWQ7CisgICAgICAgKyt2bnRoKQorICAgIGZvciAoZW51bSBtY19jYWNoZV90eXBl IGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICAgIGNhY2hlX3R5cGUgPCBOT19DQUNIRTsK KyAgICAgICAgICsrY2FjaGVfdHlwZSkKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX2hlbHBl ciAoJWQpOiAgJXNcblwKKyAgdy0+bWNfbWF0cml4LnZwb3NfdXNlZCAoJWQpXG5cCisgIHctPm1j X21hdHJpeC5jdXJzb3JzX3VzZWRbJXNdICglZClcblwKKyAgdy0+bWNfbWF0cml4LmN1cnNvcnNf dXNlZFslc10gKCVkKVxuXAorICB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkWyVzXSAoJWQpXG5c CisgIHctPm1jX21hdHJpeC52cG9zWyVkXS5jYWNoZV91c2VkWyVzXSAoJWQpXG5cCisg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GdhcCBiZXR3ZWVu IHRoZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJldmlvdXMvbmV4dCBs aW5lLiAgVGhlIEZYIGNvb3JkaW5hdGUgaXMgc2V0CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBlbHNld2hlcmU6ICBgdy0+Y3Vyc29yLnhgIC8gYG1jLmZjX3hgLiAqLwordm9p ZAorbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBo X21hdHJpeCAqbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3Jv dyAqcm93LCBpbnQgeCwgaW50ICpmeCwgaW50IHksCisgICAgICAgICAgICAgICAgICAgICAgICBp bnQgKmZ5LCBpbnQgaHBvcywgaW50IHZwb3MsIGludCAqaCwKKyAgICAgICAgICAgICAgICAgICAg ICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUsIGludCBjdXJzb3Jfd2lkdGgsCisg ICAgICAgICAgICAgICAgICAgICAgICBpbnQgKndkKQoreworICBzdHJ1Y3QgZ2x5cGggKmdseXBo ID0gbWNfZ2V0X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIGhwb3MsIHZwb3MpOworICBp ZiAoZ2x5cGggPT0gTlVMTCkKKyAgICByZXR1cm47CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFN RSAoV0lORE9XX0ZSQU1FICh3KSk7CisgICpmeCA9IFdJTkRPV19URVhUX1RPX0ZSQU1FX1BJWEVM X1ggKHcsIHgpOworICAqaCA9IHJvdy0+dmlzaWJsZV9oZWlnaHQ7CisgIC8qIERvbid0IGxldCB0 aGUgY3Vyc29yIGV4Y2VlZCB0aGUgZGltZW5zaW9ucyBvZiB0aGUgcm93LCBzbyB0aGF0CisgIHRo ZSB1cHBlci9sb3dlciBzaWRlIG9mIHRoZSBib3ggYXJlbid0IGNsaXBwZWQuICAqLworICBpbnQg d19oZWFkZXJfbGluZV9oZWlnaHQgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAg aW50IHdfdGV4dF9ib3R0b21feSA9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KSAtICpoOworICBp ZiAoeSA8IHdfaGVhZGVyX2xpbmVfaGVpZ2h0KQorICAgIHsKKyAgICAgICpoID0gbWF4ICgqaCAt ICh3X2hlYWRlcl9saW5lX2hlaWdodCAtIHkpICsgMSwgKmgpOworICAgICAgeSA9IHdfaGVhZGVy X2xpbmVfaGVpZ2h0IC0gMTsKKyAgICAgIC8vIGZwcmludGYgKHN0ZGVyciwgIkNPTkRJVElPTiAj IDFcbiIpOworICAgIH0KKyAgIGVsc2UgaWYgKHkgPiB3X3RleHRfYm90dG9tX3kpCisgICAgIHsK KyAgICAgICAqaCArPSB5IC0gd190ZXh0X2JvdHRvbV95OworICAgICAgIHkgPSB3X3RleHRfYm90 dG9tX3k7CisgICAgICAgLy8gZnByaW50ZiAoc3RkZXJyLCAiQ09ORElUSU9OICMgMlxuIik7Cisg ICAgIH0KKyAgKmZ5ID0gV0lORE9XX1RPX0ZSQU1FX1BJWEVMX1kgKHcsIHkpOworICBzd2l0Y2gg KGN1cnNvcl90eXBlKQorICAgIHsKKyAgICAgIGNhc2UgTUNfQkFSOgorICAgICAgICB7CisgICAg ICAgICAgaWYgKGN1cnNvcl93aWR0aCA8IDEpCisgICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSBt YXggKEZSQU1FX0NVUlNPUl9XSURUSCAoZiksIDEpOworICAgICAgICAgIGlmIChjdXJzb3Jfd2lk dGggPCBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgKndkID0gY3Vyc29yX3dpZHRoOwor ICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBjYXNlIE1DX0hCQVI6CisgICAgICAg IHsKKyAgICAgICAgICBpbnQgY3Vyc29yX2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ICAgICAgKndkID0gKGdseXBoLT50eXBlID09IFNUUkVUQ0hfR0xZUEgKKyAgICAgICAgICAgICAm JiAheF9zdHJldGNoX2N1cnNvcl9wKQorICAgICAgICAgICAgPyBtaW4gKEZSQU1FX0NPTFVNTl9X SURUSCAoZiksIGdseXBoLT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgIDogZ2x5cGgtPnBpeGVs X3dpZHRoOworICAgIH0KKy8qCisgICAgICBmcHJpbnRmIChzdGRlcnIsICJjdXJzb3Jfd2lkdGg6 ICglZCkgfCB4ICglZCkgfCAqZnggKCVkKSB8IHkgKCVkKSB8ICpmeSAoJWQpLCAqd2QgKCVkKSB8 ICpoICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgeCwgKmZ4 LCB5LCAqZnksICp3ZCwgKmgpOworKi8KK30KKwordm9pZAorbWNfZW5naW5lIChzdHJ1Y3Qgd2lu ZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsIHN0cnVjdCBnbHlwaF9yb3cgKnJv dywKKyAgICAgICAgICAgc3RydWN0IGdseXBoICpnbHlwaCwgaW50IGFyZWEsIGludCByZWxhdGl2 ZV94LCBpbnQgeF9saW1pdCwgaW50IHksCisgICAgICAgICAgIGludCBocG9zLCBpbnQgdnBvcywg ZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSwgaW50IGN1cnNvcl93aWR0aCwKKyAgICAg ICAgICAgc3RydWN0IGdseXBoX21hdHJpeCAqY3Vyc29yX21hdHJpeCwgaW50IGZjX3gsIHN0cnVj dCBtY19SR0IgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgYm9vbCBhY3RpdmVfcCwgZW51bSBtY19h Y3Rpb25fdHlwZSBhY3Rpb25fdHlwZSwgYm9vbCBkcmF3X3AsCisgICAgICAgICAgIGVudW0gbWNf ZnJvbV93aGVyZSBmcm9tX3doZXJlLCBlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSkKK3sK KyAgaW50IG9wb2ludF94ID0gdy0+Y3Vyc29yLng7CisgIGludCBvcG9pbnRfeSA9IHctPmN1cnNv ci55OworICBpbnQgb3BvaW50X2hwb3MgPSB3LT5jdXJzb3IuaHBvczsKKyAgaW50IG9wb2ludF92 cG9zID0gdy0+Y3Vyc29yLnZwb3M7CisgIGludCBmeCwgZnksIGgsIHdkOworICBtY19nZXRfY3Vy c29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgcmVsYXRpdmVfeCwgJmZ4LCB5LCAmZnksIGhw b3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICZoLCBjdXJzb3JfdHlwZSwgY3Vy c29yX3dpZHRoLCAmd2QpOworICBpbnQgb3BvaW50X2Z4ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVf UElYRUxfWCAodywgb3BvaW50X3gpOworICBpbnQgZmNfZnggPSBXSU5ET1dfVEVYVF9UT19GUkFN RV9QSVhFTF9YICh3LCBmY194KTsKKyAgYm9vbCB6dl9wID0gKGdseXBoIC0gcm93LT5nbHlwaHNb VEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAmJiBNQVRS SVhfUk9XX0VORF9DSEFSUE9TIChyb3cpID09IFpWKTsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZS QU1FICh3LT5mcmFtZSk7CisgIExpc3BfT2JqZWN0IGJ1ZiA9IHctPmNvbnRlbnRzOworICBDSEVD S19CVUZGRVIgKGJ1Zik7CisgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSIChidWYpOworICBp bnQgdGV4dF9hcmVhX3dpZHRoID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAg c3RydWN0IGdseXBoX3JvdyAqY3Vyc29yX3JvdyA9ICh3LT5jdXJzb3IudnBvcyAhPSAtMSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPVyAoY3Vyc29yX21hdHJp eCwgdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5V TEw7CisgIHN0cnVjdCBnbHlwaCAqY3Vyc29yX2dseXBoID0gKHctPmN1cnNvci52cG9zICE9IC0x KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfZ2V0X2N1cnNvcl9nbHlwaCAo dywgY3Vyc29yX21hdHJpeCwgY3Vyc29yX3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBv cykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgIGJvb2wgY3Vyc29y X2F0X2ZyaW5nZV9wID0gKGN1cnNvcl9nbHlwaCA9PSBOVUxMCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIGN1cnNvcl9yb3cgIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+ZXhhY3Rfd2luZG93X3dp ZHRoX2xpbmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA9 PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vy c29yLnggPT0gY3Vyc29yX3Jvdy0+cGl4ZWxfd2lkdGgpOworICBib29sIGN1cnNvcl9iZXlvbmRf ZnJpbmdlX3AgPSAoY3Vyc29yX2dseXBoID09IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIGN1cnNvcl9yb3cgIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFd CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhY3Vyc29yX3Jvdy0+ZXhhY3Rf d2luZG93X3dpZHRoX2xpbmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg dy0+Y3Vyc29yLnggPj0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiB3LT5jdXJzb3IueCA+PSBjdXJzb3Jfcm93LT5waXhlbF93aWR0aCk7CisgIGlu dCBmcmFtZV9jaGFyX3dpZHRoID0gRlJBTUVfQ09MVU1OX1dJRFRIIChmKTsKKyAgaW50IHRlbXBf ZmFjZV9pZCA9IGdseXBoLT5mYWNlX2lkOworICBzdHJ1Y3QgbWNfUkdCIGJhY2tncm91bmQ7Cisg IG1jX3NldF9sc2xfYmcgKHcsIHRlbXBfZmFjZV9pZCwgJmJhY2tncm91bmQpOworICBib29sIHJl YWxfZmFrZV9jdXJzb3JfcCA9IChvcG9pbnRfeCA9PSByZWxhdGl2ZV94CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIG9wb2ludF9ocG9zID09IGhwb3MKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgb3BvaW50X3kgPT0gZ2x5cGgtPnkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgb3BvaW50X3Zwb3MgPT0gdnBvcyk7CisKKy8qIC0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LSAqLworLyogICAgICAgICAgICAgICAgICAgICAgIEJFR0lOOiAgQ0hBUl9HTFlQSCB8IEdMWVBI TEVTU19HTFlQSCAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8K KyAgaWYgKGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgIHx8IGdseXBoLT50eXBlID09 IEdMWVBITEVTU19HTFlQSCkKKyAgeworICAgIGlmIChtY19zdGRlcnJfcCkKKyAgICAgIGZwcmlu dGYgKHN0ZGVyciwKKyAgICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAl M2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICU1ZCAlNGQgICUzZCAgJTNkICVzICVzXG4iLAorICAg ICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2Vk W2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2 ZV94LAorICAgICAgICAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgPyAnQycK KyAgICAgICAgIDogJ0cnKSwKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZG RVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNUUklOR1Ag KGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgOiAoTklMUCAo Z2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAgICA6ICct JykpKSwKKyAgICAgICAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICBnbHlwaC0+ dS5jaCwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9s aW5lX3AsCisgICAgICAgIGdseXBoLT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SSVpPTlRBTF9SVUxFUjog IENIQVJfR0xZUEggfCBHTFlQSExFU1NfR0xZUEggICAgICAgICAgICAgICAqLworLyogLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBIT1JJWk9OVEFMX1JVTEVSOgorICAgIHsKKyAgICAg IGlmIChyZWxhdGl2ZV94IDwgcm93LT5waXhlbF93aWR0aAorICAgICAgICAgICYmICFyZWFsX2Zh a2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCBy ZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2Qs IGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisg ICAgICAgICAgICAgICAgICAgYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUs IGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGlmIChnbHlwaCAtIHJvdy0+Z2x5cGhz W1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICYmIHJlbGF0aXZl X3ggPD0geF9saW1pdCkKKyAgICAgICAgeworICAgICAgICAgIGlmIChyZWxhdGl2ZV94IDwgcm93 LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgcmVsYXRpdmVfeCAr PSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgIGZ4ICs9IGdseXBoLT5waXhlbF93 aWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93 LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAg ICAgICAgICAgeF9saW1pdCAtIHJlbGF0aXZlX3gsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lk dGgsCisgICAgICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLCBhY3RpdmVf cCwgTUNfR0xZUEhMRVNTLCBkcmF3X3AsCisgICAgICAgICAgICAgICAgICAgICBmcm9tX3doZXJl LCBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAg IH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICBWRVJUSUNBTF9S VUxFUjogIENIQVJfR0xZUEggfCBHTFlQSExFU1NfR0xZUEggICAgICAgICAgICAgICAgICovCisv KiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIFZFUlRJQ0FMX1JVTEVSOgorICAgIHsK KyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChjdXJzb3JfYXRfZnJpbmdlX3AK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPmNvbnRpbnVlZF9w KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JB Ul9CQUNLU0xBU0gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNv cl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg IXJvdy0+Y29udGludWVkX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJP VworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9m cmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50 cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9B UkVBXSAhPSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93 LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVz ZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBv cG9pbnRfeCA+PSByb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAoenZfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBN Q19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfR0xZ UEg7CisgICAgICBpZiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJP VworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJf UklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFS X0JBQ0tTTEFTSAorICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIK KyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQor ICAgICAgICBjdXJzb3JfdHlwZSA9IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA7CisgICAgICB3ZCA9 IDE7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwg b3BvaW50X2Z4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1 cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAg ICAgICAgICAgIGFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgZnJvbV93aGVyZSwgY2Fj aGVfdHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgIEZJTExfQ09MVU1OOiAgQ0hBUl9HTFlQSCB8 IEdMWVBITEVTU19HTFlQSCAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LSAqLworICAgIGNhc2UgRklMTF9DT0xVTU46CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3Ig Z2x5cGhfZmxhdm9yID0gKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVz ZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZmNf eCA+PSByb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiAoenZfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQ SExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChCVkFS IChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX3ZlcnRpY2FsX3J1bGVy KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF95ID09 IHkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF92cG9z ID09IHZwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZ UEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBIOwor ICAgICAgd2QgPSAxOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJl bGF0aXZlX3gsIGZjX2Z4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2Qs IGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisg ICAgICAgICAgICAgICAgIGFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgZnJvbV93aGVy ZSwgY2FjaGVfdHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBDVVJTT1JfSU5ESUNBVE9SOgorICAgIHsKKyAg ICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICB9CisgIH0KKy8q IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICBFTkQ6ICBD SEFSX0dMWVBIIHwgR0xZUEhMRVNTX0dMWVBIICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0gKi8KKworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgQkVHSU46ICBTVFJFVENIX0dMWVBIICAgICAgICAgICAgICAg ICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICBlbHNlIGlmIChnbHlw aC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKQorICB7CisgICAgaWYgKG1jX3N0ZGVycl9wKQorICAg ICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiXG4gJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJw RCJkICVjICUzZCAweCUwNnggJTRkICUxLjFkJTEuMWQgJTVkICU0ZCAgJTNkICAlM2QgJXMgJXNc biIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChy b3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAg IHJlbGF0aXZlX3gsCisgICAgICAgICdTJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAg ICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAgIDog KFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAg OiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAg ICA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xpbmVfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICA/IGdseXBoLT5mYWNl X2lkCisgICAgICAgICAgICAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAg ICAgc3RydWN0IG1jX1JHQiBiYWNrZ3JvdW5kOworICAgICAgICAgIG1jX3NldF9sc2xfYmcgKHcs IHRlbXBfZmFjZV9pZCwgJmJhY2tncm91bmQpOworICAgICAgICAgIG1jX2hlbHBlciAodywgbWF0 cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAg ICAgICAgICAgICAgICAgICB4X2xpbWl0IC0gcmVsYXRpdmVfeCwgaCwgY3Vyc29yX3R5cGUsIHhf bGltaXQgLSByZWxhdGl2ZV94LAorICAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZCwgYmFj a2dyb3VuZCwgYWN0aXZlX3AsIE1DX0dMWVBITEVTUywgZHJhd19wLAorICAgICAgICAgICAgICAg ICAgICAgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAgICB9Cisg ICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAg ICAgICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIFNUUkVUQ0hfR0xZUEggICAgICAgICAg ICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBWRVJUSUNB TF9SVUxFUjoKKyAgICB7CisgICAgICBpZiAocm93LT5maWxsX2xpbmVfcAorICAgICAgICAgICYm IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisg ICAgICAgICAgJiYgb3BvaW50X3ggPiByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoKQor ICAgICAgICB0ZW1wX2ZhY2VfaWQgPSBnbHlwaC0+ZmFjZV9pZDsKKyAgICAgICAgZWxzZSBpZiAo IXJvdy0+ZmlsbF9saW5lX3AKKyAgICAgICAgICAgICAgICAgJiYgZ2x5cGggLSByb3ctPmdseXBo c1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgJiYg b3BvaW50X3ggPiByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoKQorICAgICAgICAgIHRl bXBfZmFjZV9pZCA9IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgIHN0cnVjdCBtY19SR0IgYmFja2dy b3VuZDsKKyAgICAgIG1jX3NldF9sc2xfYmcgKHcsIHRlbXBfZmFjZV9pZCwgJmJhY2tncm91bmQp OworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1cnNvcl9hdF9mcmluZ2Vf cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+Y29udGludWVk X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxf QkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vy c29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FS Uk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5b25k X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ct PnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+dXNlZFtURVhU X0FSRUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFy b3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiBNQ19HTFlQSExFU1M7CisgICAgICBpZiAoZ2x5cGhfZmxhdm9yID09 IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9 PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAg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ZCAgJTNkICVzICVjXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5 cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJv dy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAnSScsCisg ICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkK KyAgICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAg ICAgICAgICAgPyAnUycKKyAgICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAg ICAgICAgICAgICA/ICcwJworICAgICAgICAgICAgICAgOiAnLScpKSksCisgICAgICAgIGdseXBo LT5waXhlbF93aWR0aCwKKyAgICAgICAgKHVuc2lnbmVkIGludCkgZ2x5cGgtPnUuaW1nX2lkLAor ICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwK KyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT54LCBnbHlw aC0+eSwgZ2x5cGgtPmhwb3MsIGdseXBoLT52cG9zLCBnbHlwaC0+enZfcCA/ICJaViIgOiAiLS0i LAorICAgICAgICAnLicpOworICBzd2l0Y2ggKGFjdGlvbl90eXBlKQorICB7CisvKiAtLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgIE1VTFRJUExFX0NVUlNP UlM6ICBJTUFHRV9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tL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gICAgICAgICAgICAgICBF TkQ6ICBJTUFHRV9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tICovCisKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAg ICAgICAgICAgICAgICAgICAgQkVHSU46ICBDT01QT1NJVEVfR0xZUEggICAgICAgICAgICAgICAg ICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgZWxzZSBpZiAoZ2x5cGgt PnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKQorICB7CisgICAgaWYgKG1jX3N0ZGVycl9wKQorICAg ICAgeworICAgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICAgIlxuICU1InBEImQvJS01 ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4IiwKKyAgICAgICAgICBnbHlwaCAtIHJvdy0+ Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAw IDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAg ICAnKycsCisgICAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgICAgKEJVRkZFUlAgKGds eXBoLT5vYmplY3QpCisgICAgICAgICAgID8gJ0InCisgICAgICAgICAgIDogKFNUUklOR1AgKGds eXBoLT5vYmplY3QpCisgICAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICAgIDogKE5JTFAg KGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAgICAg IDogJy0nKSkpLAorICAgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgICAodW5z aWduZWQgaW50KSBnbHlwaC0+dS5jbXAuaWQpOworICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIg JTRkICUxLjFkJTEuMWQiLAorICAgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICAgIGds eXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3Ap OworICAgICAgaWYgKGdseXBoLT51LmNtcC5hdXRvbWF0aWMpCisgICAgICAgIGZwcmludGYgKHN0 ZGVyciwgIiAlNWQgJTRkICAlM2QgICUzZCAlcyAuIFslZC0lZF1cbiIsCisgICAgICAgICAgICAg ICAgICAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgZ2x5cGgtPnZwb3Ms IGdseXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5 cGgtPnNsaWNlLmNtcC5mcm9tLCBnbHlwaC0+c2xpY2UuY21wLnRvKTsKKyAgICAgICAgZWxzZQor ICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIlxuIik7CisgICAgICB9CisgIHN3aXRjaCAoYWN0 aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAg ICAgICAgICAgIE1VTFRJUExFX0NVUlNPUlM6ICBDT01QT1NJVEVfR0xZUEggICAgICAgICAgICAg ICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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pZHRoLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICAg IGFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLCBjYWNoZV90eXBlLCBhY3Rp b25fdHlwZSk7CisgICAgICBpZiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJv dy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiByZWxhdGl2ZV94IDw9IHhfbGltaXQpCisg ICAgICAgIHsKKyAgICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAg ICAgICAgICB3aGlsZSAocmVsYXRpdmVfeCA8PSB4X2xpbWl0KQorICAgICAgICAgICAgeworICAg ICAgICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwg ZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgIHdkLCBoLCBj dXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAg ICAgICAgICAgICAgICAgICAgIGFjdGl2ZV9wLCBNQ19HTFlQSExFU1MsIGRyYXdfcCwgZnJvbV93 aGVyZSwgY2FjaGVfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBhY3Rpb25fdHlwZSk7 CisgICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZnJhbWVfY2hhcl93aWR0aDsKKyAgICAgICAg ICAgIH0KKyAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIENPTVBP U0lURV9HTFlQSCAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAq LworICAgIGNhc2UgVkVSVElDQUxfUlVMRVI6CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3Ig Z2x5cGhfZmxhdm9yID0gKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29u X3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVS VElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3Jf YXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJv dy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJ Q0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdICE9IDEKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9w KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZF UlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGgg LSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF94ID49IHJvdy0+cGl4ZWxf d2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhM RVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICh6dl9wKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIGlmIChnbHlwaF9m bGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhf Zmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAg IHx8IGdseXBoX2ZsY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XSAtIDEKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBmY194ID4gcmVsYXRpdmVfeCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKHp2X3ApCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6ICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeSA9PSB5CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfdnBvcyA9PSB2cG9zKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIHdkID0gMTsKKyAgICAgIG1jX2hl bHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmY19meCwgeSwgZnksIGhw b3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dp ZHRoLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICBhY3RpdmVfcCwg Z2x5cGhfZmxhdm9yLCBkcmF3X3AsIGZyb21fd2hlcmUsIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBl KTsKKyAgICAgIGJyZWFrOworICAgIH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Fsc2UpOworI2Vsc2UK KyAgICBpZiAobWNfc3RkZXJyX3ApCisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICJc biAgJTVkLyUtNWQgJTVkICU0YyAlNmQgJWMgJTNkIDB4JTA1eCAlNGQgJTEuMWQlMS4xZCAlNWQg JTRkICAlM2QgICUzZCAlcyAlY1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhU X0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRb YXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ1gnLAorICAgICAgICBn bHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAg ID8gJ1MnCisgICAgICAgICAgICA6ICctJykpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgs CisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9w LAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnUueHdp ZGdldCwKKyAgICAgICAgZ2x5cGgtPngsIGdseXBoLT55LCBnbHlwaC0+aHBvcywgZ2x5cGgtPnZw b3MsIGdseXBoLT56dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7CisjZW5kaWYKKyAg c3dpdGNoIChhY3Rpb25fdHlwZSkKKyAgeworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAg ICAgICAgICAgICAgICAgICAgICAgIE1VTFRJUExFX0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CwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1 cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAg ICAgICAgICAgICAgYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUsIGNhY2hl X3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGlmIChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRf QVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICYmIHJlbGF0aXZlX3ggPD0g eF9saW1pdCkKKyAgICAgICAgeworICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVs X3dpZHRoOworICAgICAgICAgIHdoaWxlIChyZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCBy ZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAg ICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91 bmQsCisgICAgICAgICAgICAgICAgICAgICAgICAgYWN0aXZlX3AsIE1DX0dMWVBITEVTUywgZHJh d19wLCBmcm9tX3doZXJlLCBjYWNoZV90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgIGFj dGlvbl90eXBlKTsKKyAgICAgICAgICAgICAgcmVsYXRpdmVfeCArPSBmcmFtZV9jaGFyX3dpZHRo OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICBWRVJUSUNBTF9S VUxFUjogIFhXSURHRVRfR0xZUEggICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tICovCisgICAgY2FzZSBWRVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAgICBlbnVt IG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNI CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdl X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPmNvbnRp bnVlZF9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50 cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29u X3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVW RVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IChjdXJzb3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0gIT0gMQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVk X29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNf UkVWRVJTRURfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0g MQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3ggPj0g cm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKHp2 X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNT CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAg aWYgKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAg ICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUk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IChnbHlwaCAt IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGZjX3ggPiByZWxhdGl2ZV94KQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoenZfcCkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogKCFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIG9wb2ludF95ID09IHkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIG9wb2ludF92cG9zID09IHZwb3MpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJv dywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZjX2Z4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAg ICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJh Y2tncm91bmQsCisgICAgICAgICAgICAgICAgIGFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIGRyYXdf cCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSw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pb24s CisgICAgICAgICAgICAgYm9vbCBkcmF3X3AsIGVudW0gbWNfZnJvbV93aGVyZSBmcm9tX3doZXJl KQoreworICAvLyAgY2xvY2tfdCBjbG9ja19zdGFydCA9IGNsb2NrKCk7CisgIC8qIFczMiBFbWFj cyBjcmFzaGVzIG9uIHN0YXJ0dXAgd2l0aG91dCBhIGBCVUZGRVJQJyBjaGVjayBpbiBgdXBkYXRl X3dpbmRvdycuICovCisgIGlmICghQlVGRkVSUCAody0+Y29udGVudHMpKQorICAgIHJldHVybjsK KyAgaWYgKE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAg ICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAg ICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpCisg ICAgcmV0dXJuOworICBpZiAodnBvcyA9PSBib3R0b21fdnBvcykKKyAgICByZXR1cm47CisgIGlm ICghcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgcmV0dXJuOworICBpbnQgaHBvc19zdGFydCA9 IHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgaWYgKHRyYWNlX3JlZGlzcGxheV9w KQorICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX2RyYXdfcm93ICglZCk6ICBkcmF3X3AgKCVzKSB8 IGhwb3MgKCVkKSB8IGxlbiAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgdnBvcywgZHJh d19wID8gInkiIDogIm4iLCBocG9zX3N0YXJ0LCBocG9zX2xlbmd0aCk7CisgIExpc3BfT2JqZWN0 IGJ1ZiA9IHctPmNvbnRlbnRzOworICBDSEVDS19CVUZGRVIgKGJ1Zik7CisgIHN0cnVjdCBidWZm ZXIgKmIgPSBYQlVGRkVSIChidWYpOworICBpbnQgb3BvaW50X2Z4LCBvcG9pbnRfZnksIG9wb2lu dF93ZCwgb3BvaW50X2g7CisgIGludCB0ZXh0X2FyZWFfd2lkdGggPSB3aW5kb3dfYm94X3dpZHRo ICh3LCBURVhUX0FSRUEpOworICBpbnQgaGVhZGVyX2xpbmVfZm9ybWF0ID0gV0lORE9XX0hFQURF Ul9MSU5FX0hFSUdIVCAodyk7CisgIHN0cnVjdCBnbHlwaF9yb3cgKmN1cnNvcl9yb3cgPSAody0+ Y3Vyc29yLnZwb3MgIT0gLTEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1B VFJJWF9ST1cgKGN1cnNvcl9tYXRyaXgsIHctPmN1cnNvci52cG9zKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiBOVUxMOworICBzdHJ1Y3QgZ2x5cGggKmN1cnNvcl9nbHlwaCA9 ICh3LT5jdXJzb3IudnBvcyAhPSAtMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIGN1cnNvcl9tYXRyaXgsIGN1cnNvcl9yb3csCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5jdXJz b3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiBOVUxMOworICBib29sIGN1cnNvcl9hdF9mcmluZ2VfcCA9IChjdXJzb3JfZ2x5cGggPT0gTlVM TAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93ICE9IE5VTEwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gY3Vyc29yX3Jv dy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNv cl9yb3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID09IGN1cnNvcl9yb3ctPnBpeGVsX3dpZHRoKTsK KyAgYm9vbCBjdXJzb3JfYmV5b25kX2ZyaW5nZV9wID0gKGN1cnNvcl9nbHlwaCA9PSBOVUxMCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93ICE9IE5VTEwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID09IGN1cnNv cl9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgIWN1cnNvcl9yb3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5lX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHRleHRfYXJlYV93aWR0aAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0gY3Vyc29yX3Jv dy0+cGl4ZWxfd2lkdGgpOworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAg ICAgICAgICAgICAgIFJFUExBQ0UgVEhFIFJFQUwgQ1VSU09SCisqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKyAgZW51bSBmYWNlX2lkIGJnX2ZhY2VfaWQgPSAoY3Vyc29yX2dseXBoICE9IE5VTEwp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBjdXJzb3JfZ2x5cGgtPmZhY2VfaWQKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgc3RydWN0IG1j X1JHQiBjdXJzb3JfYmc7CisgIG1jX3NldF9sc2xfYmcgKHcsIGJnX2ZhY2VfaWQsICZjdXJzb3Jf YmcpOworICAvKiBGSVhNRTogIFB1dCBpbiBzb21lIGNvZGUgdG8gZGVmYXVsdCB0byBNQ19IT0xM T1dfQk9YIGlmIHRoZSB1c2VyIGhhcworICB1bndpdHRpbmdseSBjb21lIHVwIHdpdGggc29tZSB1 bmFjY2VwdGFibGUgZm9ybSBvZiB1bnJlY29nbml6ZWQgY3Vyc29yIHR5cGUuICovCisgIExpc3Bf T2JqZWN0IGxpc3BfdHlwZSA9IEJWQVIgKGIsIG1jX3JlYWxfZmFrZV9jdXJzb3IpOworICBlbnVt IG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfbGlzcF90b19jdXJzb3JfdHlw ZSAoWENBUiAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKGxpc3BfdHlwZSk7CisgIGludCBjdXJzb3Jf d2lkdGggPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICA/IFhGSVhO VU0gKFhDQVIgKFhDRFIgKGxpc3BfdHlwZSkpKQorICAgICAgICAgICAgICAgICAgICAgOiAtMTsK KyAgc3RydWN0IG1jX1JHQiBjdXJzb3JfZmc7CisgIG1jX2NvbG9yX3BpY2tlciAodywgY3Vyc29y X2dseXBoLCBlc3NlbnRpYWxzLCAmY3Vyc29yX2ZnLCAtMSwgY3Vyc29yX3R5cGUsCisgICAgICAg ICAgICAgICAgICAgICAgcm93X3Bvc2l0aW9uLCBDVVJTT1JfSU5ESUNBVE9SKTsKKyAgYm9vbCBm aWxsX2NvbHVtbl90cnVtcHNfcCA9ICghTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIp KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHctPmN1cnNvci54ID09IGVzc2VudGlhbHMuZmNfeAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmICFjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiAhY3Vyc29yX2JleW9uZF9mcmluZ2VfcCk7CisgIC8qIFdlIHVzZSBhIHRl c3Qgc2ltaWxhciB0byB0aGUgcmVhbCBmYWtlIGN1cnNvciBzbyB0aGF0IHRoZSBmcmluZ2UgYml0 bWFwIGlzCisgIG9ubHkgZHJhd24gb25jZSBwZXIgd2luZG93LiAqLworICBpZiAodnBvcyA9PSB3 LT5jdXJzb3IudnBvcworICAgICAgJiYgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoID09IHJvdy0+ dXNlZFtURVhUX0FSRUFdCisgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIGNoX2hvcml6b250YWxfcnVsZXIpKSkKKyAgICB7CisgICAgICAvKiBmcmluZ2UgYml0 bWFwcyB1c2UgZmFjZV9pZCB0byBzZXQgdGhlIGZvcmVncm91bmQgY29sb3IuICBUaGUgb3Zlcmxh eS1hcnJvdworICAgICAgaXMgcHJlc2VudGx5IHRoZSBvbmx5IHNpdHVhdGlvbiB3aGVyZSB0aGUg YGVzc2VudGlhbHMuYWN0aXZlX3BgIGFuZCBgbWluaW1hbF9wYCBhcmUKKyAgICAgIHVzZWQgdG8g ZGV0ZXJtaW5lIHRoZSBhcHBsaWNhYmxlIGZhY2VfaWQuICovCisgICAgICBzdHJ1Y3QgbWNfUkdC IGxzbF9mZyA9IHsucmVkID0gLTEuMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5n cmVlbiA9IC0xLjAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IC0xLjB9 OworICAgICAgLyogV2UgdXNlIHRoZSBmaXJzdCBnbHlwaCBpbiB0aGUgcm93LCB3aXRoIGFuIFgg YW5kIEhQT1Mgb2YgemVyby4gKi8KKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIHJv dy0+Z2x5cGhzW1RFWFRfQVJFQV0sIDAsIC0xLCB3LT5jdXJzb3IueSwgLTEsCisgICAgICAgICAg ICAgICAgIDAsIHctPmN1cnNvci52cG9zLCAtMSwgLTEsIE1DX0xFRlRfRlJJTkdFX0JJVE1BUCwg LTEsCisgICAgICAgICAgICAgICAgIGxzbF9mZywgY3Vyc29yX2JnLCBlc3NlbnRpYWxzLmFjdGl2 ZV9wLCBNQ19PVkVSTEFZX0FSUk9XX0JJVE1BUCwgZHJhd19wLAorICAgICAgICAgICAgICAgICBm cm9tX3doZXJlLCBDSF9DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgfQorICBpZiAoY3Vy c29yX2F0X2ZyaW5nZV9wCisgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAm JiB3LT5jdXJzb3IuaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9 PSBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGgKKyAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZG RVIgKHctPmNvbnRlbnRzKSwgY2hfaG9yaXpvbnRhbF9ydWxlcikpKQorICAgIHsK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KGhwb3Nfc3RhcnQgKyBocG9zX2xlbmd0aCkgPT0gcm93LT51c2Vk W1RFWFRfQVJFQV0KKyAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRl bnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3 LT5jb250ZW50cyksIGNoX2hvcml6b250YWxfcnVsZXIpKSkKKyAgICB7CisgICAgICBlbnVtIG1j X2ZsYXZvciBnbHlwaF9mbGF2b3IgPSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hU X0FSUk9XOworICAgICAgc3RydWN0IGdseXBoICpnbHlwaCA9IHJvdy0+Z2x5cGhzW1RFWFRfQVJF QV07CisgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoX2VuZCA9IGdseXBoICsgcm93LT51c2VkW1RF WFRfQVJFQV07CisgICAgICAvKiBHbHlwaCBmb3IgYSBsaW5lIGVuZCBpbiB0ZXh0LiAqLworICAg ICAgaWYgKGdseXBoID09IGdseXBoX2VuZCAmJiBnbHlwaC0+Y2hhcnBvcyA+IDApCisgICAgICAg ICsrZ2x5cGhfZW5kOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGhfZW5k IC0gMSwgcm93LT5waXhlbF93aWR0aCwgLTEsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAg ICAtMSwgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxLCB3LT5jdXJzb3IudnBvcywgLTEsIC0xLAor ICAgICAgICAgICAgICAgICBNQ19SSUdIVF9GUklOR0VfQklUTUFQLCAtMSwgY3Vyc29yX2ZnLCBj dXJzb3JfYmcsIGVzc2VudGlhbHMuYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgIGdseXBoX2Zs YXZvciwgZHJhd19wLCBmcm9tX3doZXJlLCBDSF9DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7Cis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peCwgcm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1cnNvci54 LCBvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICBvcG9pbnRfZnksIHct PmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgb3BvaW50X3dkLCBvcG9pbnRfaCwKKyAgICAg ICAgICAgICAgICAgTUNfQkFSLCAxLCBjdXJzb3JfZmcsIGN1cnNvcl9iZywgZXNzZW50aWFscy5h Y3RpdmVfcCwgTUNfR0xZUEhMRVNTLAorICAgICAgICAgICAgICAgICBkcmF3X3AsIGZyb21fd2hl cmUsIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBDSF9DQUNIRQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogTUNfQ0FDSEUsIENVUlNPUl9JTkRJQ0FUT1IpOworICAg ICAgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeSAodywgbWF0cml4LCByb3csIHctPmN1cnNvci54LCAm b3BvaW50X2Z4LCB3LT5jdXJzb3IueSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZv cG9pbnRfZnksIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgTUNfSEJBUiwgMSwgJm9wb2ludF93ZCk7CisgICAg ICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1cnNvci54LCBv cG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICBvcG9pbnRfZnksIHctPmN1 cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgb3BvaW50X3dkLCBvcG9pbnRfaCwKKyAgICAgICAg ICAgICAgICAgTUNfSEJBUiwgMSwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsIGVzc2VudGlhbHMuYWN0 aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsCisgICAgICAgICAgICAgICAgIGZyb21fd2hlcmUsIE5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiBNQ19DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgfQorICBlbHNlIGlmICghY3Vyc29y X2F0X2ZyaW5nZV9wCisgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaCAhPSBOVUxMCisgICAgICAg ICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhw b3MgPj0gaHBvc19zdGFydAorICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA8IGhwb3Nfc3Rh cnQgKyBocG9zX2xlbmd0aAorICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPnR5cGUgIT0gU1RS RVRDSF9HTFlQSCkKKyAgICB7CisgICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRy aXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNv ci52cG9zLCAmb3BvaW50X2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jf dHlwZSwgY3Vyc29yX3dpZHRoLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0 cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vyc29y LnksCisgICAgICAgICAgICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNv ci52cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9oLAorICAgICAgICAgICAgICAgICBjdXJzb3JfdHlw ZSwgY3Vyc29yX3dpZHRoLCBjdXJzb3JfZmcsIGN1cnNvcl9iZywgZXNzZW50aWFscy5hY3RpdmVf cCwKKyAgICAgICAgICAgICAgICAgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwgTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBDSF9DQUNIRQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0NBQ0hFLCBDVVJTT1JfSU5ESUNB VE9SKTsKKyAgICB9CisgIGVsc2UgaWYgKCFjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAg JiYgY3Vyc29yX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3Iu dnBvcworICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAg ICAgICYmIHctPmN1cnNvci5ocG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoCisgICAgICAg ICAgICYmIGN1cnNvcl9nbHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKQorICAgIHsKKyAgICAg IC8qIElmIGEgdXNlciBoYXMgc2V0IGB4LXN0cmV0Y2gtY3Vyc29yJyB0byBhIG5vbi1uaWwgdmFs dWUsIGhlL3NoZSBjaG9zZSB0bworICAgICAgaGF2ZSBhIGN1cnNvciB0aGF0IHNwYW5zIHRoZSBl bnRpcmUgbGVuZ3RoIG9mIHRoZSBTVFJFVENIX0dMWVBILiAqLworICAgICAgaWYgKCF4X3N0cmV0 Y2hfY3Vyc29yX3ApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUaGUgTUNfSEJBUiBzaGFsbCBo YXZlIGEgYGN1cnNvcl93aWR0aGAgb2YgMS4gKi8KKyAgICAgICAgICBtY19nZXRfY3Vyc29yX2dl b21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRfZngsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLnksICZvcG9pbnRfZnksIHctPmN1 cnNvci5ocG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci52 cG9zLCAmb3BvaW50X2gsIE1DX0hCQVIsIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJm9wb2ludF93ZCk7CisgICAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywg Y3Vyc29yX2dseXBoLCB3LT5jdXJzb3IueCwgb3BvaW50X2Z4LAorICAgICAgICAgICAgICAgICAg ICAgdy0+Y3Vyc29yLnksIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9z LAorICAgICAgICAgICAgICAgICAgICAgb3BvaW50X3dkLCBvcG9pbnRfaCwgTUNfSEJBUiwgMSwg Y3Vyc29yX2ZnLCBjdXJzb3JfYmcsCisgICAgICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFj dGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICAg ICAgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAgICAg ICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAgICAgICAgICAgIDogTUNfQ0FDSEUs IENVUlNPUl9JTkRJQ0FUT1IpOworICAgICAgICB9CisgICAgICBtY19nZXRfY3Vyc29yX2dlb21l dHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRfZngsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICB3LT5jdXJzb3IueSwgJm9wb2ludF9meSwgdy0+Y3Vyc29yLmhw b3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5jdXJzb3IudnBvcywgJm9wb2lu dF9oLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93 aWR0aCwgJm9wb2ludF93ZCk7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBjdXJz b3JfZ2x5cGgsIHctPmN1cnNvci54LCBvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAg ICAgICAgICBvcG9pbnRfZnksIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgb3BvaW50 X3dkLCBvcG9pbnRfaCwKKyAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0 aCwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsIGVzc2VudGlhbHMuYWN0aXZlX3AsCisgICAgICAgICAg ICAgICAgIE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUsIE5JTFAgKEJWQVIgKFhCVUZGRVIg KHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiBNQ19DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgfQor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgIERSQVcg QU5EIFJFQ09SRCBGQUtFIENVUlNPUlMKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICBpZiAo aHBvc19sZW5ndGggPT0gMSkKKyAgICB7CisgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIg KHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQorICAgICAgICB7CisgICAgICAgICAgLyogVGhlIHNw YWNlIGFwcGVuZGVkIHRvIGEgcm93IGVuZGluZyB3aXRoIGEgbmV3IGxpbmUKKyAgICAgICAgICBk b2VzIG5vdCBoYXZlIGEgYGdseXBoLT5jaGFycG9zYCAoLTEsIDApIHRoYXQgd2UgY2FuCisgICAg ICAgICAgdXNlIGZvciB0aGlzIHBhcnRpY3VsYXIgYXBwbGljYXRpb24uICBXaGVuIHRoZXJlIGlz IGEKKyAgICAgICAgICBgYnVmZmVyLWRpc3BsYXktdGFibGUnIGVudHJ5IHRoYXQgYXNzaWducyBh IHZpc2libGUKKyAgICAgICAgICBnbHlwaCB0byBhIG5ldyBsaW5lLCB0aGVyZSBpcyBubyBwcm9i bGVtIGJlY2F1c2UgdGhhdAorICAgICAgICAgIGdseXBoIGhhcyBhIGBnbHlwaC0+Y2hhcnBvcycg dGhhdCB3ZSBjYW4gdXNlLiAgV2hlbgorICAgICAgICAgIG5vIHZpc2libGUgRU9MIGdseXBoIGV4 aXN0cywgd2UgdXNlIHRoZSBmb2xsb3dpbmcKKyAgICAgICAgICB0ZXN0OiAgdGhlIGFwcGVuZGVk IHNwYWNlIGhhcyBhIHBvc2l0aW9uIHRoYXQgaXMgb25lCisgICAgICAgICAgbGVzcyB0aGFuIHRo ZSBlbmQgb2YgdGhlIG1hdHJpeCByb3cuICovCisgICAgICAgICAgaW50IGhwb3MgPSBzdGFydCAt IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICAgICAgc3RydWN0IGdseXBoICpwcmV2aW91 c19nbHlwaCA9ICgwIDw9IGhwb3MgLSAxICYmIGhwb3MgLSAxIDwgcm93LT51c2VkW1RFWFRfQVJF QV0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gcm93LT5nbHlw aHNbVEVYVF9BUkVBXSArIGhwb3MgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogTlVMTDsKKyAgICAgICAgICAvLyBzdHJ1Y3QgZ2x5cGggKmxhc3RfZ2x5cGgg PSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxOworICAg ICAgICAgIGJvb2wgc2tpcF9wID0gKHByZXZpb3VzX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBwcmV2aW91c19nbHlwaC0+Y2hhcnBvcyA9PSBNQVRSSVhfUk9XX0VO RF9DSEFSUE9TIChyb3cpIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICYmIHN0YXJ0LT5i eXRlcG9zICE9IGVzc2VudGlhbHMuenZfYnl0ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg PyB0cnVlCisgICAgICAgICAgICAgICAgICAgICAgICAvKiBXaGVuIGEgYGJ1ZmZlci1kaXNwbGF5 LXRhYmxlJyBlbnRyeSBjb250YWlucworICAgICAgICAgICAgICAgICAgICAgICAgYSB2aXNpYmxl IHRhYiBjaGFyYWN0ZXIgKCLCuyIpLCB0aGUgc3Vic2VxdWVudAorICAgICAgICAgICAgICAgICAg ICAgICAgU1RSRVRDSF9HTFlQSCB3aWxsIGhhdmUgdGhlIHNhbWUgc3RhcnQtPmNoYXJwb3MKKyAg ICAgICAgICAgICAgICAgICAgICAgIGFzIHRoZSBhZm9yZW1lbnRpb25lZCB2aXNpYmxlIHRhYiBj aGFyYWN0ZXIuICovCisgICAgICAgICAgICAgICAgICAgICAgICA6IChwcmV2aW91c19nbHlwaCAh PSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBwcmV2aW91c19nbHlwaC0+Y2hh cnBvcyA9PSBzdGFydC0+Y2hhcnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgPyB0cnVl CisgICAgICAgICAgICAgICAgICAgICAgICA6IGZhbHNlOworICAgICAgICAgIGludCBwb3NpbnQg PSAocm93X3Bvc2l0aW9uID09IFBPU1RfWlYpCisgICAgICAgICAgICAgICAgICAgICAgICAgPyAt MQorICAgICAgICAgICAgICAgICAgICAgICA6IChyb3dfcG9zaXRpb24gPT0gQVRfWlYpCisgICAg ICAgICAgICAgICAgICAgICAgICAgID8gZXNzZW50aWFscy56dgorICAgICAgICAgICAgICAgICAg ICAgICA6IChzdGFydC0+Ynl0ZXBvcyAhPSBlc3NlbnRpYWxzLnp2X2J5dGUKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+ dXNlZFtURVhUX0FSRUFdIC0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICA/IE1BVFJJWF9S T1dfRU5EX0NIQVJQT1MgKHJvdykgLSAxCisgICAgICAgICAgICAgICAgICAgICAgIDogKHN0YXJ0 LT5ieXRlcG9zID09IGVzc2VudGlhbHMuenZfYnl0ZQorICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW1RFWFRfQVJF QV0gLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgID8gZXNzZW50aWFscy56dgorICAgICAg ICAgICAgICAgICAgICAgICA6IHN0YXJ0LT5jaGFycG9zOworICAgICAgICAgIExpc3BfT2JqZWN0 IHNwZWNzID0gbWNfYXNzb2MgKG1ha2VfZml4bnVtIChwb3NpbnQpLCBCVkFSIChYQlVGRkVSICh3 LT5jb250ZW50cyksIG1jX2NvbmYpKTsKKyAgICAgICAgICBpZiAoKChoZWFkZXJfbGluZV9mb3Jt YXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0 ID09IDApCisgICAgICAgICAgICAgICYmICFOSUxQIChzcGVjcykKKyAgICAgICAgICAgICAgJiYg c3RhcnQtPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICYmICFz a2lwX3AKKyAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uICE9IFBPU1RfWlYpCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIExpc3BfT2JqZWN0IGxpc3BfdHlwZSA9IG1jX250aCAoMSwg c3BlY3MpOworICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlID0g KENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBtY19saXNwX3RvX2N1cnNvcl90eXBlIChYQ0FSIChsaXNwX3R5cGUpKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBtY19saXNw X3RvX2N1cnNvcl90eXBlIChsaXNwX3R5cGUpOworICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9 IChzdGFydC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IE1DX0hPTExPV19CT1gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGN1cnNvcl90 eXBlOworICAgICAgICAgICAgICBpbnQgY3Vyc29yX3dpZHRoID0gKENPTlNQIChsaXNwX3R5cGUp KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBYRklYTlVNIChYQ0FSIChYQ0RS IChsaXNwX3R5cGUpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogLTE7Cisg ICAgICAgICAgICAgIExpc3BfT2JqZWN0IG1jX2ZvcmVncm91bmQgPSBtY19udGggKDIsIHNwZWNz KTsKKyAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgICAgIGlm IChTVFJJTkdQIChtY19mb3JlZ3JvdW5kKSkKKyAgICAgICAgICAgICAgICBtY194d19jb2xvcl92 YWx1ZXMgKHcsIG1jX2ZvcmVncm91bmQsICZsc2xfZmcpOworICAgICAgICAgICAgICAgIGVsc2Ug aWYgKFZFQ1RPUlAgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgICBsc2xfZmcucmVkID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91 bmQsIDApKTsKKyAgICAgICAgICAgICAgICAgICAgbHNsX2ZnLmdyZWVuID0gWEZMT0FUX0RBVEEg KEFSRUYgKG1jX2ZvcmVncm91bmQsIDEpKTsKKyAgICAgICAgICAgICAgICAgICAgbHNsX2ZnLmJs dWUgPSBYRkxPQVRfREFUQSAoQVJFRiAobWNfZm9yZWdyb3VuZCwgMikpOworICAgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoTklMUCAobWNfZm9yZWdyb3VuZCkp CisgICAgICAgICAgICAgICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywgc3RhcnQsIGVzc2VudGlh bHMsICZsc2xfZmcsIHBvc2ludCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBjdXJzb3JfdHlwZSwgcm93X3Bvc2l0aW9uLCBNVUxUSVBMRV9DVVJTT1JTKTsKKyAgICAg ICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgICAg ICAgICAgICAgaW50IHhfbGltaXQgPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOwor ICAgICAgICAgICAgICBtY19lbmdpbmUgKHcsIG1hdHJpeCwgcm93LCBzdGFydCwgVEVYVF9BUkVB LCB4LCB4X2xpbWl0LCByb3ctPnksCisgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgLSBy b3ctPmdseXBoc1tURVhUX0FSRUFdLCB2cG9zLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAg ICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMuZmNfeCwg bHNsX2ZnLAorICAgICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1V TFRJUExFX0NVUlNPUlMsIGRyYXdfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBmcm9tX3do ZXJlLCBNQ19DQUNIRSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGlmICghTklM UCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAm JiBlc3NlbnRpYWxzLmZjX3ggPD0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgJiYgZXNzZW50 aWFscy5mY194ID49IHctPm1jLmxudW1fcGl4ZWxfd2lkdGgpCisgICAgICAgIHsKKyAgICAgICAg ICBpbnQgeF9saW1pdCA9IHggKyBzdGFydC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgYm9vbCBy ZWFsX2Zha2VfY3Vyc29yX3AgPSAody0+Y3Vyc29yLnggPT0gZXNzZW50aWFscy5mY194CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnkgPT0gc3RhcnQt PnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBv cyA9PSBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IudnBvcyA9PSB2cG9zKTsKKyAgICAgICAgICBz dHJ1Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICBtY19jb2xvcl9waWNrZXIgKHcsIHN0YXJ0 LCBlc3NlbnRpYWxzLCAmbHNsX2ZnLCAtMSwgTUNfQkFSLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgcm93X3Bvc2l0aW9uLCBGSUxMX0NPTFVNTik7CisgICAgICAgICAgaWYgKHggKyBz dGFydC0+cGl4ZWxfd2lkdGggPD0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICYmICgo aGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID4gMCkKKyAgICAgICAgICAgICAgICAgIHx8 IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAgICAmJiAoKHN0YXJ0ICE9IHJv dy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEKKyAgICAgICAg ICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPj0geAorICAgICAgICAgICAgICAgICAgICYm IGVzc2VudGlhbHMuZmNfeCA8IHggKyBzdGFydC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAg ICAgICB8fCAoc3RhcnQgPT0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhU X0FSRUFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSB4 KSkKKyAgICAgICAgICAgICAgJiYgc3RhcnQtPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcp CisgICAgICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgICAgICBtY19l bmdpbmUgKHcsIG1hdHJpeCwgcm93LCBzdGFydCwgVEVYVF9BUkVBLCB4LCB4X2xpbWl0LCByb3ct PnksCisgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVB XSwgdnBvcywgTUNfQkFSLCAxLAorICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4 LCBlc3NlbnRpYWxzLmZjX3gsIGxzbF9mZywgZXNzZW50aWFscy5hY3RpdmVfcCwKKyAgICAgICAg ICAgICAgICAgICAgICAgRklMTF9DT0xVTU4sIGRyYXdfcCwgZnJvbV93aGVyZSwgRkNfQ0FDSEUp OworICAgICAgICB9CisgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2hvcml6b250 YWxfcnVsZXIpKQorICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgICAg IHsKKyAgICAgICAgICBpbnQgeF9saW1pdCA9IChzdGFydCA9PSByb3ctPmdseXBoc1tURVhUX0FS RUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAg PyB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgIDogeCArIHN0YXJ0LT5w aXhlbF93aWR0aDsKKyAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICBt Y19jb2xvcl9waWNrZXIgKHcsIHN0YXJ0LCBlc3NlbnRpYWxzLCAmbHNsX2ZnLCAtMSwgTUNfSEJB UiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgSE9SSVpPTlRB TF9SVUxFUik7CisgICAgICAgICAgLyogUHJlc2VydmUgc3VwcG9ydCBmb3IgZGVmYXVsdCBiZWhh dmlvciBzdWNoIHRoYXQgYSB1c2VyIG1heQorICAgICAgICAgIHNwZWNpZnkgdGhlIGhlaWdodCBv ZiBhbiBNQ19IQkFSLCB3aGljaCBiZWdpbnMgaXRzIGpvdXJuZXkKKyAgICAgICAgICBhcyB0aGUg YGN1cnNvcl93aWR0aCcuICBgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeScgcmVhZGp1c3RzLiAqLwor ICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIHN0YXJ0LCBURVhUX0FSRUEsIHgs IHhfbGltaXQsIHJvdy0+eSwKKyAgICAgICAgICAgICAgICAgICAgIHN0YXJ0IC0gcm93LT5nbHlw aHNbVEVYVF9BUkVBXSwgdnBvcywgTUNfSEJBUiwgMSwKKyAgICAgICAgICAgICAgICAgICAgIGN1 cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMuZmNfeCwgbHNsX2ZnLCBlc3NlbnRpYWxzLmFjdGl2ZV9w LAorICAgICAgICAgICAgICAgICAgICAgSE9SSVpPTlRBTF9SVUxFUiwgZHJhd19wLCBmcm9tX3do ZXJlLCBDSF9DQUNIRSk7CisgICAgICAgIH0KKyAgICAgIGlmICghTklMUCAoQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAmJiAhTklMUCAoQlZBUiAo YiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICYmICFmaWxsX2NvbHVtbl90cnVtcHNf cCkKKyAgICAgICAgeworICAgICAgICAgIGN1cnNvcl90eXBlID0gKHN0YXJ0LT50eXBlID09IElN QUdFX0dMWVBIKQorICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19IT0xMT1dfQk9YCisgICAg ICAgICAgICAgICAgICAgICAgICA6IE1DX0JBUjsKKyAgICAgICAgICBpbnQgeF9saW1pdCA9IHdp bmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAgICAgICAgYm9vbCByZWFsX2Zha2Vf Y3Vyc29yX3AgPSAody0+Y3Vyc29yLnkgPT0gc3RhcnQtPnkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IudnBvcyA9PSB2cG9zKTsKKyAgICAgICAgICBz dHJ1Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICBtY19jb2xvcl9waWNrZXIgKHcsIHN0YXJ0 LCBlc3NlbnRpYWxzLCAmbHNsX2ZnLCAtMSwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICByb3dfcG9zaXRpb24sIFZFUlRJQ0FMX1JVTEVSKTsKKyAgICAgICAgICBp ZiAoKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAg fHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAgICYmICgoc3RhcnQgIT0g cm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMQorICAgICAg ICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHgKKyAgICAgICAgICAgICAgICAgICAmJiB3 LT5jdXJzb3IueCA8IHggKyBzdGFydC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICB8 fCAoc3RhcnQgPT0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFd IC0gMQorICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHgpKQorICAgICAg ICAgICAgICAmJiBzdGFydC0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAg ICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgIG1jX2VuZ2luZSAodywg bWF0cml4LCByb3csIHN0YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGltaXQsIHJvdy0+eSwKKyAgICAg ICAgICAgICAgICAgICAgICAgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLCB2cG9zLCBj dXJzb3JfdHlwZSwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNz ZW50aWFscy5mY194LCBsc2xfZmcsIGVzc2VudGlhbHMuYWN0aXZlX3AsCisgICAgICAgICAgICAg ICAgICAgICAgIFZFUlRJQ0FMX1JVTEVSLCBkcmF3X3AsIGZyb21fd2hlcmUsIENIX0NBQ0hFKTsK KyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgICB7CisgICAgICAgIGludCByZWxhdGl2 ZV94ID0gMDsKKyAgICAgICAgZm9yIChpbnQgYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFyZWEg PCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5 cGggKmdseXBoID0gcm93LT5nbHlwaHNbYXJlYV07CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGgg KmdseXBoX2VuZCA9IGdseXBoICsgcm93LT51c2VkW2FyZWFdOworICAgICAgICAgICAgLyogR2x5 cGggZm9yIGEgbGluZSBlbmQgaW4gdGV4dC4gKi8KKyAgICAgICAgICAgIGlmIChhcmVhID09IFRF WFRfQVJFQSAmJiBnbHlwaCA9PSBnbHlwaF9lbmQgJiYgZ2x5cGgtPmNoYXJwb3MgPiAwKQorICAg ICAgICAgICAgICArK2dseXBoX2VuZDsKKyAgICAgICAgICAgIGZvciAoOyBnbHlwaCA8IGdseXBo X2VuZDsgKytnbHlwaCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmICh2cG9z ICE9IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICAgICAgICAgICYmIGdseXBoICE9IGdseXBo X2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194IDwgcmVsYXRp dmVfeAorICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA8IHJlbGF0aXZlX3gKKyAg ICAgICAgICAgICAgICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBt Y19jb25mKSkpCisgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBpZiAo IU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQorICAgICAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvKiBUaGUgc3BhY2UgYXBwZW5kZWQgdG8g YSByb3cgZW5kaW5nIHdpdGggYSBuZXcgbGluZSBkb2VzCisgICAgICAgICAgICAgICAgICAgIG5v dCBoYXZlIGEgYGdseXBoLT5jaGFycG9zYCAoLTEsIDApIHRoYXQgd2UgY2FuIHVzZSBmb3IgdGhp cworICAgICAgICAgICAgICAgICAgICBwYXJ0aWN1bGFyIGFwcGxpY2F0aW9uLiAgV2hlbiBhIGBi dWZmZXItZGlzcGxheS10YWJsZScgZW50cnkKKyAgICAgICAgICAgICAgICAgICAgYXNzaWducyBh IHZpc2libGUgZ2x5cGggdG8gYSBuZXcgbGluZSwgdGhlcmUgaXMgbm8gcHJvYmxlbQorICAgICAg ICAgICAgICAgICAgICBiZWNhdXNlIHRoYXQgZ2x5cGggaGFzIGEgYGdseXBoLT5jaGFycG9zJyB0 aGF0IHdlIGNhbiB1c2UuCisgICAgICAgICAgICAgICAgICAgIFdoZW4gbm8gdmlzaWJsZSBFT0wg Z2x5cGggZXhpc3RzLCB3ZSB1c2UgdGhlIGZvbGxvd2luZyB0ZXN0OgorICAgICAgICAgICAgICAg ICAgICB0aGUgYXBwZW5kZWQgc3BhY2UgaGFzIGEgcG9zaXRpb24gdGhhdCBpcyBvbmUgbGVzcyB0 aGFuIHRoZQorICAgICAgICAgICAgICAgICAgICBlbmQgb2YgdGhlIG1hdHJpeCByb3cuICovCisg ICAgICAgICAgICAgICAgICAgIGludCBocG9zID0gZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FS RUFdOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnByZXZpb3VzX2dseXBoID0g KDAgPD0gaHBvcyAtIDEgJiYgaHBvcyAtIDEgPCByb3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gcm93LT5nbHlw aHNbVEVYVF9BUkVBXSArIGhwb3MgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgICAgICAgICAgICAgICAgICAgIC8vIHN0cnVj dCBnbHlwaCAqbGFzdF9nbHlwaCA9IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVzZWRb VEVYVF9BUkVBXSAtIDE7CisgICAgICAgICAgICAgICAgICAgIGJvb2wgc2tpcF9wID0gKHByZXZp b3VzX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg cHJldmlvdXNfZ2x5cGgtPmNoYXJwb3MgPT0gTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSAt IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGgtPmJ5dGVwb3Mg IT0gZXNzZW50aWFscy56dl9ieXRlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyB0cnVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogV2hlbiBhIGBi dWZmZXItZGlzcGxheS10YWJsZScgZW50cnkgY29udGFpbnMKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBhIHZpc2libGUgdGFiIGNoYXJhY3RlciAoIsK7IiksIHRoZSBzdWJzZXF1 ZW50CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU1RSRVRDSF9HTFlQSCB3aWxs IGhhdmUgdGhlIHNhbWUgZ2x5cGgtPmNoYXJwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBhcyB0aGUgYWZvcmVtZW50aW9uZWQgdmlzaWJsZSB0YWIgY2hhcmFjdGVyLiAqLwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKHByZXZpb3VzX2dseXBoICE9IE5V TEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBwcmV2aW91c19nbHlw aC0+Y2hhcnBvcyA9PSBnbHlwaC0+Y2hhcnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gdHJ1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogZmFs c2U7CisgICAgICAgICAgICAgICAgICAgIGludCBwb3NpbnQgPSAocm93X3Bvc2l0aW9uID09IFBP U1RfWlYpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gLTEKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogKHJvd19wb3NpdGlvbiA9PSBBVF9aVikKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZXNzZW50aWFscy56dgorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGgtPmJ5dGVwb3MgIT0gZXNzZW50aWFscy56 dl9ieXRlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaCAtIHJv dy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJv dykgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaC0+Ynl0ZXBv cyA9PSBlc3NlbnRpYWxzLnp2X2J5dGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbVEVYVF9B UkVBXSAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZXNzZW50aWFs cy56dgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBnbHlwaC0+Y2hhcnBvczsK KyAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3Qgc3BlY3MgPSBtY19hc3NvYyAobWFrZV9m aXhudW0gKHBvc2ludCksIEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpOwor ICAgICAgICAgICAgICAgICAgICBpZiAoKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3Mg PiAwKQorICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAw KQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKHNwZWNzKQorICAgICAgICAgICAg ICAgICAgICAgICAgJiYgZ2x5cGgtPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAg ICAgICAgICAgICAgICAgICAgICAmJiAhc2tpcF9wCisgICAgICAgICAgICAgICAgICAgICAgICAm JiByb3dfcG9zaXRpb24gIT0gUE9TVF9aVikKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgICAgICAgICBMaXNwX09iamVjdCBsaXNwX3R5cGUgPSBtY19udGggKDEsIHNw ZWNzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29y X3R5cGUgPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY19saXNwX3RvX2N1cnNvcl90eXBlIChY Q0FSIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogbWNfbGlzcF90b19jdXJzb3JfdHlwZSAobGlzcF90eXBlKTsK KyAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlID0gKGdseXBoLT50eXBlID09IElN QUdFX0dMWVBIKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0hP TExPV19CT1gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBjdXJzb3Jf dHlwZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGggPSAoQ09OU1Ag KGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBYRklYTlVNIChYQ0FSIChYQ0RSIChsaXNwX3R5cGUpKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IC0xOworICAgICAgICAgICAgICAgICAgICAgICAgTGlz cF9PYmplY3QgbWNfZm9yZWdyb3VuZCA9IG1jX250aCAoMiwgc3BlY3MpOworICAgICAgICAgICAg ICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgICAgICAgICAgICAg ICBpZiAoU1RSSU5HUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAgICAgICAgICAg IG1jX3h3X2NvbG9yX3ZhbHVlcyAodywgbWNfZm9yZWdyb3VuZCwgJmxzbF9mZyk7CisgICAgICAg ICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKFZFQ1RPUlAgKG1jX2ZvcmVncm91bmQpKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGxzbF9mZy5yZWQgPSBYRkxPQVRfREFUQSAoQVJFRiAobWNfZm9yZWdyb3VuZCwgMCkpOworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNsX2ZnLmdyZWVuID0gWEZMT0FUX0RBVEEgKEFS RUYgKG1jX2ZvcmVncm91bmQsIDEpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxz bF9mZy5ibHVlID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDIpKTsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxz ZSBpZiAoTklMUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBtY19jb2xvcl9waWNrZXIgKHcsIGdseXBoLCBlc3NlbnRpYWxzLCAmbHNsX2ZnLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpbnQsIGN1cnNv cl90eXBlLCByb3dfcG9zaXRpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIE1VTFRJUExFX0NVUlNPUlMpOworICAgICAgICAgICAgICAgICAgICAg ICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgICAgICAgICAg ICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVB KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIGds eXBoLCBhcmVhLCByZWxhdGl2ZV94LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICB4X2xpbWl0LCByb3ctPnksIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdnBvcywgY3Vyc29yX3R5cGUsIGN1cnNvcl93 aWR0aCwgY3Vyc29yX21hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ZXNzZW50aWFscy5mY194LCBsc2xfZmcsIGVzc2VudGlhbHMuYWN0aXZlX3AsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIE1VTFRJUExFX0NVUlNPUlMsIGRyYXdfcCwgZnJvbV93 aGVyZSwgTUNfQ0FDSEUpOworICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRl bnRzKSwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNf eCA8PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5m Y194ID49IHctPm1jLmxudW1fcGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9B UkVBKTsKKyAgICAgICAgICAgICAgICAgICAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3AgPSAody0+ Y3Vyc29yLnggPT0gZXNzZW50aWFscy5mY194CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci55ID09IGdseXBoLT55CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID09 IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IudnBvcyA9PSB2cG9zKTsKKyAgICAg ICAgICAgICAgICAgICAgaW50IGhwb3MgPSBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07 CisgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAgICAgICAgICAg ICAgICAgICBtY19jb2xvcl9waWNrZXIgKHcsIGdseXBoLCBlc3NlbnRpYWxzLCAmbHNsX2ZnLCAt MSwgTUNfQkFSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvd19w b3NpdGlvbiwgRklMTF9DT0xVTU4pOworICAgICAgICAgICAgICAgICAgICBpZiAoaHBvcyA+PSBo cG9zX3N0YXJ0CisgICAgICAgICAgICAgICAgICAgICAgICAmJiBocG9zIDwgaHBvc19zdGFydCAr IGhwb3NfbGVuZ3RoCisgICAgICAgICAgICAgICAgICAgICAgICAmJiByZWxhdGl2ZV94ICsgZ2x5 cGgtPnBpeGVsX3dpZHRoIDw9IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAg ICAgJiYgKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAg ICAgICAgICAgICAgJiYgKChnbHlwaCAhPSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSByZWxhdGl2ZV94CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA8IHJlbGF0aXZlX3ggKyBnbHlw aC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKGdseXBoID09 IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50 aWFscy5mY194ID49IHJlbGF0aXZlX3gpKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5 cGgtPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICAgICAgICAg ICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAgICAgICAgICAgICAgIG1jX2VuZ2lu ZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4X2xpbWl0LAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT55LCBocG9zLCB2cG9zLCBNQ19CQVIs IDEsIGN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlc3Nl bnRpYWxzLmZjX3gsIGxzbF9mZywgZXNzZW50aWFscy5hY3RpdmVfcCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIEZJTExfQ09MVU1OLCBkcmF3X3AsIGZyb21fd2hlcmUsIEZDX0NB Q0hFKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAg ICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9ob3Jpem9udGFsX3J1bGVyKSkKKyAgICAgICAgICAg ICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgICAgaW50IHhfbGltaXQgPSB3aW5kb3dfYm94X3dpZHRoICh3LCBU RVhUX0FSRUEpOworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5n bHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xf Zmc7CisgICAgICAgICAgICAgICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywgZ2x5cGgsIGVzc2Vu dGlhbHMsICZsc2xfZmcsIC0xLCBNQ19IQkFSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgSE9SSVpPTlRBTF9SVUxFUik7CisgICAgICAgICAg ICAgICAgICAgIC8qIFByZXNlcnZlIHN1cHBvcnQgZm9yIGRlZmF1bHQgYmVoYXZpb3Igc3VjaCB0 aGF0IGEgdXNlciBtYXkKKyAgICAgICAgICAgICAgICAgICAgc3BlY2lmeSB0aGUgaGVpZ2h0IG9m IGFuIE1DX0hCQVIsIHdoaWNoIGJlZ2lucyBpdHMgam91cm5leQorICAgICAgICAgICAgICAgICAg ICBhcyB0aGUgYGN1cnNvcl93aWR0aCcuICBgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeScgcmVhZGp1 c3RzLiAqLworICAgICAgICAgICAgICAgICAgICBpZiAoaHBvcyA+PSBocG9zX3N0YXJ0CisgICAg ICAgICAgICAgICAgICAgICAgICAmJiBocG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoKQor ICAgICAgICAgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBh cmVhLCByZWxhdGl2ZV94LCB4X2xpbWl0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgcm93LT55LCBocG9zLCB2cG9zLCBNQ19IQkFSLCAxLCBjdXJzb3JfbWF0cml4LAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5mY194LCBsc2xfZmcsIGVzc2Vu dGlhbHMuYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIT1JJWk9O VEFMX1JVTEVSLCBkcmF3X3AsIGZyb21fd2hlcmUsIENIX0NBQ0hFKTsKKyAgICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRl bnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChi LCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICYmICFmaWxsX2NvbHVt bl90cnVtcHNfcCkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgY3Vy c29yX3R5cGUgPSAoZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBNQ19IT0xMT1dfQk9YCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiBNQ19CQVI7CisgICAgICAgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0g d2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgICAgICAgICAgYm9v bCByZWFsX2Zha2VfY3Vyc29yX3AgPSAody0+Y3Vyc29yLnkgPT0gZ2x5cGgtPnkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnZwb3Mg PT0gdnBvcyk7CisgICAgICAgICAgICAgICAgICAgIGludCBocG9zID0gZ2x5cGggLSByb3ctPmds eXBoc1tURVhUX0FSRUFdOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9m ZzsKKyAgICAgICAgICAgICAgICAgICAgbWNfY29sb3JfcGlja2VyICh3LCBnbHlwaCwgZXNzZW50 aWFscywgJmxzbF9mZywgLTEsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgVkVSVElDQUxfUlVMRVIpOworICAgICAgICAg ICAgICAgICAgICBpZiAoaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICAgICAgICAgICAg ICAmJiBocG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoCisgICAgICAgICAgICAgICAgICAg ICAgICAmJiAoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAg ICAgICAgICAgICAgICAmJiAoKGdseXBoICE9IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0gcmVsYXRpdmVfeAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA8IHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4 ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKGdseXBoID09IGdseXBo X2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLngg Pj0gcmVsYXRpdmVfeCkpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaC0+eSA8PSB3 aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICFyZWFs X2Zha2VfY3Vyc29yX3ApCisgICAgICAgICAgICAgICAgICAgICAgbWNfZW5naW5lICh3LCBtYXRy aXgsIHJvdywgZ2x5cGgsIGFyZWEsIHJlbGF0aXZlX3gsIHhfbGltaXQsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICByb3ctPnksIGhwb3MsIHZwb3MsIGN1cnNvcl90eXBlLCAxLCBj dXJzb3JfbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFs cy5mY194LCBsc2xfZmcsIGVzc2VudGlhbHMuYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUiwgZHJhd19wLCBmcm9tX3doZXJlLCBDSF9DQUNI RSk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmVsYXRpdmVfeCArPSBn bHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICB9CisgICAgICB9 CisgIC8vIC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wZV1bbnRoXS5j dXJzb3Jfd2lkdGg7CisgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmcgPSB7LnJlZCA9IHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZm9yZWdyb3VuZC5y ZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gdy0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5mb3JlZ3JvdW5kLmdyZWVuLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0gdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5mb3JlZ3JvdW5kLmJsdWV9OworICAgICAg ICAgIHN0cnVjdCBtY19SR0IgbHNsX2JnID0gey5yZWQgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJhY2tncm91bmQucmVkLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF0uYmFja2dyb3VuZC5ncmVlbiwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAuYmx1ZSA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF0uYmFja2dyb3VuZC5ibHVlfTsKKyAgICAgICAgICBib29sIGFjdGl2ZV9wID0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5hY3RpdmVfcDsK KyAgICAgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoX2ZsYXZvcjsKKyAgICAgICAgICBi b29sIGVuYWJsZWRfcCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF0uZW5hYmxlZF9wOworICAgICAgICAgIGlmICh2cG9zID09IHZudGgKKyAgICAgICAgICAg ICAgJiYgKChocG9zID49IHN0YXJ0X2hwb3MKKyAgICAgICAgICAgICAgICAgICAmJiBocG9zIDwg ZW5kX2hwb3MpCisgICAgICAgICAgICAgICAgICAvKiBBIGZsb2F0aW5nIGN1cnNvciBiZXlvbmQg dGhlIGVuZCBvZiB0aGUgZ2x5cGggcm93LiAqLworICAgICAgICAgICAgICAgICAgfHwgKGhwb3Mg KyAxID09IHN0YXJ0X2hwb3MKKyAgICAgICAgICAgICAgICAgICAgICAmJiBocG9zICsgMSA9PSBl bmRfaHBvcykpCisgICAgICAgICAgICAgICYmIGVuYWJsZWRfcCkKKyAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgYm9vbCByZW1vdmVfcCA9IGZhbHNlOworICAgICAgICAgICAgICBtY19kcmF3 X2VyYXNlX2h5YnJpZCAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywg d2QsIGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwg Y3Vyc29yX3dpZHRoLCBsc2xfZmcsIGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgZ2x5cGhfZmxhdm9yLCByZW1vdmVfcCk7CisgICAgICAgICAgICB9CisgICAg ICAgIH0KKyAgICB9CisgIC8vICBjbG9ja19lbmQgPSBjbG9jaygpOworICAvLyAgZG91YmxlIHRp bWVfY3Vyc29ycyA9ICgoZG91YmxlKSAoY2xvY2tfZW5kIC0gY2xvY2tfc3RhcnQpKSAvIENMT0NL U19QRVJfU0VDOworICAvLyAgZnByaW50ZiAoc3RkZXJyLCAibWN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52 cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV07ICsrbnRoKQorICAgICAgICB7CisgICAg ICAgICAgaW50IHggPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLng7CisgICAgICAgICAgaW50IGZ4ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXS5meDsKKyAgICAgICAgICBpbnQgeSA9IHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ueTsKKyAgICAgICAgICBpbnQgZnkgPSB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZ5OworICAgICAgICAg IGludCBocG9zID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XS5ocG9zOworICAgICAgICAgIGludCB2cG9zID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXS52cG9zOworICAgICAgICAgIGludCB3ZCA9IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ud2Q7CisgICAgICAgICAgaW50IGgg PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmg7CisgICAg ICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSA9IHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uY3Vyc29yX3R5cGU7CisgICAgICAgICAgaW50 IGN1cnNvcl93aWR0aCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF0uY3Vyc29yX3dpZHRoOworICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnID0gey5y ZWQgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZvcmVn cm91bmQucmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZm9yZWdyb3VuZC5n cmVlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IHctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZm9yZWdyb3VuZC5ibHVlfTsK KyAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9iZyA9IHsucmVkID0gdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5iYWNrZ3JvdW5kLnJlZCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJhY2tncm91bmQuZ3JlZW4sCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhdLmJhY2tncm91bmQuYmx1ZX07CisgICAgICAgICAgYm9vbCBhY3Rp dmVfcCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYWN0 aXZlX3A7CisgICAgICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gdy0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5nbHlwaF9mbGF2b3I7CisgICAg ICAgICAgYm9vbCBlbmFibGVkX3AgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhdLmVuYWJsZWRfcDsKKyAgICAgICAgICAvKiBgbWF0cml4X3JvdycgaW4gYGRp c3BuZXcuY2AgY29udGFpbnMgdGhlIGZvbGxvd2luZyB0ZXN0cywKKyAgICAgICAgICBlYXNzZXJ0 IChtYXRyaXggJiYgbWF0cml4LT5yb3dzKTsKKyAgICAgICAgICBlYXNzZXJ0IChyb3cgPj0gMCAm JiByb3cgPCBtYXRyaXgtPm5yb3dzKTsgKi8KKyAgICAgICAgICBib29sIGJhcmZfY3Jhc2hfb25l ID0gKG1hdHJpeCAmJiBtYXRyaXgtPnJvd3MpID8gZmFsc2UgOiB0cnVlOworICAgICAgICAgIGlm IChiYXJmX2NyYXNoX29uZSkKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgIGJvb2wg YmFyZl9jcmFzaF90d28gPSAodnBvcyA+PSAwICYmIHZwb3MgPCBtYXRyaXgtPm5yb3dzKSA/IGZh bHNlIDogdHJ1ZTsKKyAgICAgICAgICBpZiAoYmFyZl9jcmFzaF90d28pCisgICAgICAgICAgICBj b250aW51ZTsKKyAgICAgICAgICBpZiAodnBvcyA9PSB2bnRoCisgICAgICAgICAgICAgICYmIGds eXBoX2ZsYXZvciA9PSBNQ19HTFlQSAorICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAg ICAgICAgICB7CisgICAgICAgICAgICAgIG1jX2VyYXNlX2N1cnNvciAodywgbWF0cml4LCByb3cs IHgsIHksIGhwb3MsIHZwb3MsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkKTsKKyAgICAg ICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5l bmFibGVkX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgLS13LT5tY19tYXRyaXguY3Vyc29yc191 c2VkW2NhY2hlX3R5cGVdOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAodnBv cyA9PSB2bnRoCisgICAgICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICBib29sIHJlbW92ZV9wID0gdHJ1ZTsKKyAgICAgICAgICAg ICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwg aHBvcywgdnBvcywgd2QsIGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGxzbF9iZywgYWN0aXZlX3AsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgcmVtb3ZlX3ApOworICAg ICAgICAgICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF0uZW5hYmxlZF9wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgLS13LT5tY19tYXRyaXguY3Vy c29yc191c2VkW2NhY2hlX3R5cGVdOworICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAg IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV0gPSAwOworICAg IH0KK30KKworLyogRXJhc2UgZmFrZSBjdXJzb3JzIGZyb20gKG1pbiwgcnVuLmN1cnJlbnRfeSwg cnVuLmRlc2lyZWRfeSkgdG8gZW5kIG9mIHdpbmRvdy4KKyAgVFJZX1dJTkRPV19SRVVTSU5HX0NV UlJFTlRfTUFUUklYX0RPV046CisgICAgcnVuLmhlaWdodCA9IGl0Lmxhc3RfdmlzaWJsZV95IC0g cnVuLmRlc2lyZWRfeQorICAgIFtlbWFjcyAtcTogIEhvbGQgdXAtYXJyb3cga2V5IHRyaWdnZXJp bmcgYXV0by1yZWNlbnR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duICjihpMp XSA9PSBydW4uY3VycmVudF95ID4gcnVuLmRlc2lyZWRfeQorICB8ICAgICAgICAgICAgIHwgICAg cnVuLmhlaWdodCA9IGl0Lmxhc3RfdmlzaWJsZV95IC0gcnVuLmRlc2lyZWRfeQorICB8ICAgICAg ICAgICAgIHwgICAgcnVuLmhlaWdodCA9PSAxMDgwIC0gODEwID09IDI3MAorICB8ICAgICAgICAg ICAgIHwgICAgW1RvcCBwYXJ0IG9mIHRoZSBsb3dlciByZWN0YW5nbGUgZ2V0cyBjb3BpZWQgdG8g bG93ZXIgcnVuLmRlc2lyZWRfeS5dCisgIHwgICAgICAgICAgICAgfAorICArLS0tLS0tLS0tLS0t LSsgPD0gaXQubGFzdF92aXNpYmxlX3kgPT0gMTA4MCAqLwordm9pZAorbWNfcHJlX3Njcm9sbF9j bGVhbiAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IHJ1biBydW4sIGludCBzdGFydF92cG9zLAor ICAgICAgICAgICAgICAgICAgICAgaW50IG5yb3dzX3Njcm9sbGVkLCBlbnVtIG1jX3ByZV9zY3Jv bGxfY2xlYW4gZnJvbV93aGVyZSkKK3sKKyAgaWYgKE1JTklfV0lORE9XX1AgKHcpKQorICAgIHJl dHVybjsKKyAgYm9vbCBnb19vbmVfcCA9ICh3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW01DX0NB Q0hFXSA+IDAKKyAgICAgICAgICAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2Vk W0NIX0NBQ0hFXSA+IDAKKyAgICAgICAgICAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29y c191c2VkW0ZDX0NBQ0hFXSA+IDApOworICBib29sIGdvX3R3b19wID0gKEJVRkZFUlAgKHctPmNv bnRlbnRzKQorICAgICAgICAgICAgICAgICAgICYmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgICAg ICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYp KSkpOworICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAgZnByaW50ZiAoc3RkZXJyLCAibWNf cHJlX3Njcm9sbF9jbGVhbiAoJXMpOlxuXAorICAlcyB8IGdvX29uZV9wICglcykgfCBnb190d29f cCAoJXMpXG5cCisgIHN0YXJ0X3Zwb3MgKCVkKSB8IG5yb3dzX3Njcm9sbGVkICglZClcblwKKyAg JXM6ICBydW4uY3VycmVudC9kZXNpcmVkX3kgKCVkLyVkKSB8IHJ1bi5oZWlnaHQgKCVkKVxuIiwK KyAgICBtY193aW5kb3cgKHcpLCAoZnJvbV93aGVyZSA9PSBUUllfV0lORE9XX1JFVVNJTkdfQ1VS UkVOVF9NQVRSSVhfRE9XTikKKyAgICAgICAgICAgICAgICAgICAgID8gIlRSWV9XSU5ET1dfUkVV U0lOR19DVVJSRU5UX01BVFJJWF9ET1dOIgorICAgICAgICAgICAgICAgICAgIDogKGZyb21fd2hl cmUgPT0gVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX1VQKQorICAgICAgICAgICAg ICAgICAgICAgPyAiVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX1VQIgorICAgICAg ICAgICAgICAgICAgIDogKGZyb21fd2hlcmUgPT0gVFJZX1dJTkRPV19JRCkKKyAgICAgICAgICAg ICAgICAgICAgID8gIlRSWV9XSU5ET1dfSUQiCisgICAgICAgICAgICAgICAgICAgOiAiVU5LTk9X TiIsCisgICAgZ29fb25lX3AgPyAieWVzIiA6ICJubyIsIGdvX3R3b19wID8gInllcyIgOiAibm8i LAorICAgIHN0YXJ0X3Zwb3MsIG5yb3dzX3Njcm9sbGVkLAorICAg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mVzZXRfY2FjaGUgKHcpOworfQorCitERUZVTiAoIm1jLXN0ZGVyciIs IEZtY19zdGRlcnIsIFNtY19zdGRlcnIsIDAsIDEsICJQIiwKKyAgICAgICBkb2M6IC8qIFRvZ2ds ZSB0cmFjaW5nIG9mIG11bHRpcGxlIGZha2UgY3Vyc29ycy4KK1dpdGggQVJHLCB0dXJuIHRyYWNp bmcgb24gaWYgYW5kIG9ubHkgaWYgQVJHIGlzIHBvc2l0aXZlLiAqLykKKyAgKExpc3BfT2JqZWN0 IGFyZykKK3sKKyAgaWYgKE5JTFAgKGFyZykpCisgICAgbWNfc3RkZXJyX3AgPSAhbWNfc3RkZXJy X3A7CisgIGVsc2UKKyAgICB7CisgICAgICBhcmcgPSBGcHJlZml4X251bWVyaWNfdmFsdWUgKGFy Zyk7CisgICAgICBtY19zdGRlcnJfcCA9IFhGSVhOVU0gKGFyZykgPiAwOworICAgIH0KKyAgcmV0 dXJuIFFuaWw7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKworCiAMCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKIAkJICAgICAgV2luZG93IGRpc3Bs YXkgZGltZW5zaW9ucwpAQCAtMTMzOTUsNiArMTgwMjMsNjkgQEAgaHNjcm9sbF93aW5kb3dfdHJl ZSAoTGlzcF9PYmplY3Qgd2luZG93KQogCSAgICAgIGVsc2UKIAkJcHQgPSBjbGlwX3RvX2JvdW5k cyAoQkVHViwgbWFya2VyX3Bvc2l0aW9uICh3LT5wb2ludG0pLCBaVik7CiAKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBiZWdpbiB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CAoaXQ9MHg3ZmZmNWZiZjllMzAsIHc9MHgxMWJmNzJjOTgsCisgICAg cm93PTB4MTIxMjQzZDAwKSBhdCB4ZGlzcC5jOjg0MjMKKyM3ICAweDAwMDAwMDAxMDAwNmMzZjcg aW4gaHNjcm9sbF93aW5kb3dfdHJlZSAod2luZG93PS4uLikgYXQgeGRpc3AuYzoxODU0NgorKi8K KworICAvKiBgaW5pdF9pdGVyYXRvcic6ICBlYXNzZXJ0IChjaGFycG9zIDwgMAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICB8fCAoY2hhcnBvcyA+PSBCVUZfQkVHIChjdXJyZW50X2J1 ZmZlcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGNoYXJwb3MgPD0g WlYpKTsgKi8KKworICBzdHJ1Y3QgZGlzcGxheV9wb3MgKnBvcyA9ICZjdXJzb3Jfcm93LT5zdGFy dDsKKyAgcHRyZGlmZl90IGNoYXJwb3MgPSBDSEFSUE9TIChwb3MtPnBvcyk7CisKKyAgYm9vbCBi YXJmX2NyYXNoX29uZSA9IChjaGFycG9zIDwgMAorICAgICAgICAgICAgICAgICAgICAgICAgIHx8 IChjaGFycG9zID49IEJVRl9CRUcgKGN1cnJlbnRfYnVmZmVyKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBjaGFycG9zIDw9IFpWKSkKKyAgICAgICAgICAgICAgICAgICAgICAgID8g ZmFsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgIDogdHJ1ZTsKKyAgaWYgKGJhcmZfY3Jhc2hf b25lKQorICAgIHJldHVybiBoc2Nyb2xsZWRfcDsKKworICAvKiBgcmVzZWF0XzEnOiAgQ0hBUlBP UyAocG9zKSA+PSBCRUdWICYmIENIQVJQT1MgKHBvcykgPD0gWlYgKi8KKyAgYm9vbCBiYXJmX2Ny YXNoX3R3byA9IChjaGFycG9zID49IEJFR1YgJiYgY2hhcnBvcyA8PSBaVikKKyAgICAgICAgICAg ICAgICAgICAgICAgICA/IGZhbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgOiB0cnVlOwor ICBpZiAoYmFyZl9jcmFzaF90d28pCisgICAgcmV0dXJuIGhzY3JvbGxlZF9wOworCisvKiBlbmQg TVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgICAg IC8qIE1vdmUgaXRlcmF0b3IgdG8gcHQgc3RhcnRpbmcgYXQgY3Vyc29yX3Jvdy0+c3RhcnQgaW4K IAkJIGEgbGluZSB3aXRoIGluZmluaXRlIHdpZHRoLiAgKi8KIAkgICAgICBpbml0X3RvX3Jvd19z dGFydCAoJml0LCB3LCBjdXJzb3Jfcm93KTsKQEAgLTE0Mjg3LDkgKzE4OTc4LDIyIEBAIHJlZGlz cGxheV9pbnRlcm5hbCAodm9pZCkKIAkgICAgICAqdy0+ZGVzaXJlZF9tYXRyaXgtPm1ldGhvZCA9 IDA7CiAJICAgICAgZGVidWdfbWV0aG9kX2FkZCAodywgIm9wdGltaXphdGlvbiAxIik7CiAjZW5k aWYKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8K KwogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQorICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMp CisgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJz KSkpCisgICAgbWNfdXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCBmYWxzZSk7CisgICAgZWxzZQog CSAgICAgIHVwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgZmFsc2UpOwogI2VuZGlmCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKIAkgICAgICBnb3RvIHVwZGF0ZTsKIAkgICAgfQogCSAg ZWxzZQpAQCAtMTc2ODcsMTAgKzIyMzkxLDIyIEBAIHJlZGlzcGxheV93aW5kb3cgKExpc3BfT2Jq ZWN0IHdpbmRvdywgYm9vbCBqdXN0X3RoaXNfb25lX3ApCiAgICAgfQogCiAjaWZkZWYgSEFWRV9X SU5ET1dfU1lTVEVNCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1D VVJTT1JTICovCisKKyAgYm9vbCBrZWVwX2N1cnJlbnRfcCA9IChqdXN0X3RoaXNfb25lX3AKKyAg ICAgICAgICAgICAgICAgICAgICAgICB8fCAoIXVzZWRfY3VycmVudF9tYXRyaXhfcCAmJiAhb3Zl cmxheV9hcnJvd19zZWVuKQorICAgICAgICAgICAgICAgICAgICAgICAgIHx8IHctPnBzZXVkb193 aW5kb3dfcCk7CisKKyAgYm9vbCBmcmluZ2VzX3VwZGF0ZWRfcCA9IChCVUZGRVJQICh3LT5jb250 ZW50cykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IG1jX3VwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywga2VlcF9jdXJyZW50X3ApCisgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IHVwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywga2VlcF9jdXJy ZW50X3ApOworCiAgIGlmIChGUkFNRV9XSU5ET1dfUCAoZikKLSAgICAgICYmIHVwZGF0ZV93aW5k b3dfZnJpbmdlcyAodywgKGp1c3RfdGhpc19vbmVfcAotCQkJCSAgICB8fCAoIXVzZWRfY3VycmVu dF9tYXRyaXhfcCAmJiAhb3ZlcmxheV9hcnJvd19zZWVuKQotCQkJCSAgICB8fCB3LT5wc2V1ZG9f d2luZG93X3ApKSkKKyAgICAgICYmIGZyaW5nZXNfdXBkYXRlZF9wKQogICAgIHsKICAgICAgIHVw ZGF0ZV9iZWdpbiAoZik7CiAgICAgICBibG9ja19pbnB1dCAoKTsKQEAgLTE3NzA1LDYgKzIyNDIx LDkgQEAgcmVkaXNwbGF5X3dpbmRvdyAoTGlzcF9PYmplY3Qgd2luZG93LCBib29sIGp1c3RfdGhp c19vbmVfcCkKICAgICAgIHVwZGF0ZV9lbmQgKGYpOwogICAgIH0KIAorLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogICBpZiAoV0lORE9XX0JPVFRPTV9ESVZJREVSX1dJRFRIICh3KSkKICAg ICB4X2RyYXdfYm90dG9tX2RpdmlkZXIgKHcpOwogI2VuZGlmIC8qIEhBVkVfV0lORE9XX1NZU1RF TSAqLwpAQCAtMTgwMTAsNiArMjI3MjksNyBAQCB0cnlfd2luZG93X3JldXNpbmdfY3VycmVudF9t YXRyaXggKHN0cnVjdCB3aW5kb3cgKncpCiAJICAgICBzY3JvbGxfcnVuX2hvb2sgd2lsbCBjbGVh ciB0aGUgY3Vyc29yLCBhbmQgdXNlIHRoZQogCSAgICAgY3VycmVudCBtYXRyaXggdG8gZ2V0IHRo ZSBoZWlnaHQgb2YgdGhlIHJvdyB0aGUgY3Vyc29yIGlzCiAJICAgICBpbi4gICovCisKIAkgIHJ1 bi5jdXJyZW50X3kgPSBzdGFydF9yb3ctPnk7CiAJICBydW4uZGVzaXJlZF95ID0gaXQuY3VycmVu dF95OwogCSAgcnVuLmhlaWdodCA9IGl0Lmxhc3RfdmlzaWJsZV95IC0gaXQuY3VycmVudF95OwpA QCAtMTgwMTksNiArMjI3MzksMTYgQEAgdHJ5X3dpbmRvd19yZXVzaW5nX2N1cnJlbnRfbWF0cml4 IChzdHJ1Y3Qgd2luZG93ICp3KQogCSAgICAgIHVwZGF0ZV9iZWdpbiAoZik7CiAJICAgICAgRlJB TUVfUklGIChmKS0+dXBkYXRlX3dpbmRvd19iZWdpbl9ob29rICh3KTsKIAkgICAgICBGUkFNRV9S SUYgKGYpLT5jbGVhcl93aW5kb3dfbW91c2VfZmFjZSAodyk7CisKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICBtY19wcmVfc2Nyb2xsX2Ns ZWFuICh3LCBydW4sIHN0YXJ0X3Zwb3MsIG5yb3dzX3Njcm9sbGVkLCBUUllfV0lORE9XX1JFVVNJ TkdfQ1VSUkVOVF9NQVRSSVhfRE9XTik7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK IAkgICAgICBGUkFNRV9SSUYgKGYpLT5zY3JvbGxfcnVuX2hvb2sgKHcsICZydW4pOwogCSAgICAg IEZSQU1FX1JJRiAoZiktPnVwZGF0ZV93aW5kb3dfZW5kX2hvb2sgKHcsIGZhbHNlLCBmYWxzZSk7 CiAJICAgICAgdXBkYXRlX2VuZCAoZik7CkBAIC0xODE3Myw2ICsyMjkwMyw3IEBAIHRyeV93aW5k b3dfcmV1c2luZ19jdXJyZW50X21hdHJpeCAoc3RydWN0IHdpbmRvdyAqdykKIAl9CiAKICAgICAg IC8qIFNjcm9sbCB0aGUgZGlzcGxheS4gICovCisKICAgICAgIHJ1bi5jdXJyZW50X3kgPSBmaXJz dF9yZXVzYWJsZV9yb3ctPnk7CiAgICAgICBydW4uZGVzaXJlZF95ID0gV0lORE9XX0hFQURFUl9M SU5FX0hFSUdIVCAodyk7CiAgICAgICBydW4uaGVpZ2h0ID0gaXQubGFzdF92aXNpYmxlX3kgLSBy dW4uY3VycmVudF95OwpAQCAtMTgxODMsNiArMjI5MTQsMTYgQEAgdHJ5X3dpbmRvd19yZXVzaW5n X2N1cnJlbnRfbWF0cml4IChzdHJ1Y3Qgd2luZG93ICp3KQogCSAgdXBkYXRlX2JlZ2luIChmKTsK IAkgIEZSQU1FX1JJRiAoZiktPnVwZGF0ZV93aW5kb3dfYmVnaW5faG9vayAodyk7CiAJICBGUkFN RV9SSUYgKGYpLT5jbGVhcl93aW5kb3dfbW91c2VfZmFjZSAodyk7CisKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICBtY19wcmVfc2Nyb2xs X2NsZWFuICh3LCBydW4sIHN0YXJ0X3Zwb3MsIG5yb3dzX3Njcm9sbGVkLCBUUllfV0lORE9XX1JF VVNJTkdfQ1VSUkVOVF9NQVRSSVhfVVApOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAJICBGUkFNRV9SSUYgKGYpLT5zY3JvbGxfcnVuX2hvb2sgKHcsICZydW4pOwogCSAgRlJBTUVf UklGIChmKS0+dXBkYXRlX3dpbmRvd19lbmRfaG9vayAodywgZmFsc2UsIGZhbHNlKTsKIAkgIHVw ZGF0ZV9lbmQgKGYpOwpAQCAtMTkxMjcsNiArMjM4NjgsNyBAQCB0cnlfd2luZG93X2lkIChzdHJ1 Y3Qgd2luZG93ICp3KQogICAvKiBTY3JvbGwgdGhlIGRpc3BsYXkuICBEbyBpdCBiZWZvcmUgY2hh bmdpbmcgdGhlIGN1cnJlbnQgbWF0cml4IHNvCiAgICAgIHRoYXQgeHRlcm0uYyBkb2Vzbid0IGdl dCBjb25mdXNlZCBhYm91dCB3aGVyZSB0aGUgY3Vyc29yIGdseXBoIGlzCiAgICAgIGZvdW5kLiAg Ki8KKwogICBpZiAoZHkgJiYgcnVuLmhlaWdodCkKICAgICB7CiAgICAgICB1cGRhdGVfYmVnaW4g KGYpOwpAQCAtMTkxMzUsNiArMjM4NzcsMTYgQEAgdHJ5X3dpbmRvd19pZCAoc3RydWN0IHdpbmRv dyAqdykKIAl7CiAJICBGUkFNRV9SSUYgKGYpLT51cGRhdGVfd2luZG93X2JlZ2luX2hvb2sgKHcp OwogCSAgRlJBTUVfUklGIChmKS0+Y2xlYXJfd2luZG93X21vdXNlX2ZhY2UgKHcpOworCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgbWNf cHJlX3Njcm9sbF9jbGVhbiAodywgcnVuLCBmaXJzdF91bmNoYW5nZWRfYXRfZW5kX3Zwb3MsIGR2 cG9zLCBUUllfV0lORE9XX0lEKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAg RlJBTUVfUklGIChmKS0+c2Nyb2xsX3J1bl9ob29rICh3LCAmcnVuKTsKIAkgIEZSQU1FX1JJRiAo ZiktPnVwZGF0ZV93aW5kb3dfZW5kX2hvb2sgKHcsIGZhbHNlLCBmYWxzZSk7CiAJfQpAQCAtMjAx MzMsNiArMjQ4ODUsMTcgQEAgYXBwZW5kX3NwYWNlX2Zvcl9uZXdsaW5lIChzdHJ1Y3QgaXQgKml0 LCBib29sIGRlZmF1bHRfZmFjZV9wKQogCSAgbWVtc2V0ICgmaXQtPnBvc2l0aW9uLCAwLCBzaXpl b2YgaXQtPnBvc2l0aW9uKTsKIAkgIGl0LT5vYmplY3QgPSBRbmlsOwogCSAgaXQtPmMgPSBpdC0+ Y2hhcl90b19kaXNwbGF5ID0gJyAnOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyog TVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBpZiAoSVRfQllURVBPUyAoKml0KSA+PSBaVl9C WVRFKQorICAgICAgICBpdC0+enZfcCA9IHRydWU7CisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKIAkgIGl0LT5sZW4gPSAxOwogCiAJICAvKiBJZiB0aGUgZGVmYXVsdCBmYWNlIHdhcyBy ZW1hcHBlZCwgYmUgc3VyZSB0byB1c2UgdGhlCkBAIC0yMTI2OSw5ICsyNjAzMiwyMiBAQCBtYXli ZV9wcm9kdWNlX2xpbmVfbnVtYmVyIChzdHJ1Y3QgaXQgKml0KQogICAgICAgZWxzZQogCXRlbV9p dC5jID0gdGVtX2l0LmNoYXJfdG9fZGlzcGxheSA9ICpwOwogICAgICAgdGVtX2l0LmxlbiA9IDE7 CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK KyAgICAgIGlmIChiZXlvbmRfenYpCisgICAgICAgIHRlbV9pdC56dl9wID0gdHJ1ZTsKKyAgICAg IHRlbV9pdC5jdXJyZW50X3kgPSBpdC0+Y3VycmVudF95OworICAgICAgdGVtX2l0LnZwb3MgPSBp dC0+dnBvczsKICAgICAgIC8qIE1ha2Ugc3VyZSB0aGVzZSBnbHlwaHMgd2lsbCBoYXZlIGEgInBv c2l0aW9uIiBvZiAtMS4gICovCiAgICAgICBTRVRfVEVYVF9QT1MgKHRlbV9pdC5wb3NpdGlvbiwg LTEsIC0xKTsKICAgICAgIFBST0RVQ0VfR0xZUEhTICgmdGVtX2l0KTsKKyAgICAgIHRlbV9pdC5o cG9zICs9IDE7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCiAKICAgICAgIC8qIFN0b3Ag cHJvZHVjaW5nIGdseXBocywgYW5kIHJlZnJhaW4gZnJvbSBwcm9kdWNpbmcgdGhlIGxpbmUKIAkg bnVtYmVyLCBpZiB3ZSBkb24ndCBoYXZlIGVub3VnaCBzcGFjZSBvbiB0aGlzIGxpbmUuICAqLwpA QCAtMjEyODQsNiArMjYwNjAsMzAgQEAgbWF5YmVfcHJvZHVjZV9saW5lX251bWJlciAoc3RydWN0 IGl0ICppdCkKIAl9CiAgICAgfQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCisgIExpc3BfT2JqZWN0IGJ1ZiA9IGl0LT53LT5jb250ZW50czsK KyAgQ0hFQ0tfQlVGRkVSIChidWYpOworICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAoYnVm KTsKKyAgc3RydWN0IGJ1ZmZlciAqb2xkX2J1ZmZlciA9IE5VTEw7CisgIC8qIE5lZWRlZCBzbyB0 aGF0IGJ1ZmZlci1sb2NhbCB2YWx1ZXMgY2FuIGJlIGRldGVybWluZWQ7IGUuZy4sIHdoZW4gc3dp dGNoaW5nCisgIHRvIHRoZSBtaW5pYnVmZmVyLiAqLworICBpZiAoYiAhPSBjdXJyZW50X2J1ZmZl cikKKyAgICB7CisgICAgICBvbGRfYnVmZmVyID0gY3VycmVudF9idWZmZXI7CisgICAgICBzZXRf YnVmZmVyX2ludGVybmFsIChiKTsKKyAgICB9CisgIGl0LT53LT5tYy5sbnVtX3BpeGVsX3dpZHRo ID0gKCFOSUxQIChWZGlzcGxheV9saW5lX251bWJlcnMpKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gdGVtX2l0LmN1cnJlbnRfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogMDsKKyAgaWYgKG9sZF9idWZmZXIpCisgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAob2xk X2J1ZmZlcik7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogUmVjb3JkIHRo ZSB3aWR0aCBpbiBwaXhlbHMgd2UgbmVlZCBmb3IgdGhlIGxpbmUgbnVtYmVyIGRpc3BsYXkuICAq LwogICBpdC0+bG51bV9waXhlbF93aWR0aCA9IHRlbV9pdC5jdXJyZW50X3g7CiAgIC8qIENvcHkg dGhlIHByb2R1Y2VkIGdseXBocyBpbnRvIElUJ3MgZ2x5cGhfcm93LiAgKi8KQEAgLTI3MDkyLDYg KzMxODkyLDIxIEBAIGFwcGVuZF9nbHlwaCAoc3RydWN0IGl0ICppdCkKIAkgICAgZ1sxXSA9ICpn OwogCSAgZ2x5cGggPSBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJlYV07CiAJfQorCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlw aC0+eCA9IGl0LT5jdXJyZW50X3g7CisgICAgICBnbHlwaC0+eSA9IGl0LT5jdXJyZW50X3k7Cisg ICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPnZwb3MgPSBpdC0+dnBv czsKKyAgICAgIGdseXBoLT56dl9wID0gaXQtPnp2X3A7CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9 IElUX0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAg IGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5v YmplY3QgPSBpdC0+b2JqZWN0OwogICAgICAgaWYgKGl0LT5waXhlbF93aWR0aCA+IDApCkBAIC0y NzE3NSw2ICszMTk5MCwyMSBAQCBhcHBlbmRfY29tcG9zaXRlX2dseXBoIChzdHJ1Y3QgaXQgKml0 KQogCSAgICBnWzFdID0gKmc7CiAJICBnbHlwaCA9IGl0LT5nbHlwaF9yb3ctPmdseXBoc1tpdC0+ YXJlYV07CiAJfQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VS U09SUyAqLworCisgICAgICBnbHlwaC0+eCA9IGl0LT5jdXJyZW50X3g7CisgICAgICBnbHlwaC0+ eSA9IGl0LT5jdXJyZW50X3k7CisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAg Z2x5cGgtPnZwb3MgPSBpdC0+dnBvczsKKyAgICAgIGdseXBoLT56dl9wID0gaXQtPnp2X3A7Cisg ICAgICBnbHlwaC0+Ynl0ZXBvcyA9IElUX0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKICAgICAgIGdseXBoLT5jaGFycG9zID0gaXQtPmNtcF9pdC5jaGFycG9z OwogICAgICAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAgICAgICBlYXNzZXJ0IChpdC0+ cGl4ZWxfd2lkdGggPD0gU0hSVF9NQVgpOwpAQCAtMjczODMsNiArMzIyMTMsMjEgQEAgcHJvZHVj ZV9pbWFnZV9nbHlwaCAoc3RydWN0IGl0ICppdCkKIAl9CiAgICAgICBpZiAoZ2x5cGggPCBpdC0+ Z2x5cGhfcm93LT5nbHlwaHNbYXJlYSArIDFdKQogCXsKKworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPnggPSBpdC0+Y3Vy cmVudF94OworICAgICAgZ2x5cGgtPnkgPSBpdC0+Y3VycmVudF95OworICAgICAgZ2x5cGgtPmhw b3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBoLT52cG9zID0gaXQtPnZwb3M7CisgICAgICBnbHlw aC0+enZfcCA9IGl0LT56dl9wOworICAgICAgZ2x5cGgtPmJ5dGVwb3MgPSBJVF9CWVRFUE9TICgq aXQpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICBnbHlwaC0+Y2hhcnBvcyA9 IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAJICBnbHlwaC0+b2JqZWN0ID0gaXQtPm9iamVjdDsK IAkgIGdseXBoLT5waXhlbF93aWR0aCA9IGNsaXBfdG9fYm91bmRzICgtMSwgaXQtPnBpeGVsX3dp ZHRoLCBTSFJUX01BWCk7CkBAIC0yNzQ4Niw2ICszMjMzMSwyMSBAQCBwcm9kdWNlX3h3aWRnZXRf Z2x5cGggKHN0cnVjdCBpdCAqaXQpCiAJfQogICAgICAgaWYgKGdseXBoIDwgaXQtPmdseXBoX3Jv dy0+Z2x5cGhzW2FyZWEgKyAxXSkKIAl7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisv KiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGdseXBoLT54ID0gaXQtPmN1cnJlbnRfeDsK KyAgICAgIGdseXBoLT55ID0gaXQtPmN1cnJlbnRfeTsKKyAgICAgIGdseXBoLT5ocG9zID0gaXQt Pmhwb3M7CisgICAgICBnbHlwaC0+dnBvcyA9IGl0LT52cG9zOworICAgICAgZ2x5cGgtPnp2X3Ag PSBpdC0+enZfcDsKKyAgICAgIGdseXBoLT5ieXRlcG9zID0gSVRfQllURVBPUyAoKml0KTsKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9T IChpdC0+cG9zaXRpb24pOwogCSAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAJICBnbHlw aC0+cGl4ZWxfd2lkdGggPSBjbGlwX3RvX2JvdW5kcyAoLTEsIGl0LT5waXhlbF93aWR0aCwgU0hS VF9NQVgpOwpAQCAtMjc1NzIsNiArMzI0MzIsMjEgQEAgYXBwZW5kX3N0cmV0Y2hfZ2x5cGggKHN0 cnVjdCBpdCAqaXQsIExpc3BfT2JqZWN0IG9iamVjdCwKIAkgICAgd2lkdGggLT0gaXQtPmZpcnN0 X3Zpc2libGVfeCAtIGl0LT5jdXJyZW50X3g7CiAJICBlYXNzZXJ0ICh3aWR0aCA+IDApOwogCX0K KworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwor ICAgICAgZ2x5cGgtPnggPSBpdC0+Y3VycmVudF94OworICAgICAgZ2x5cGgtPnkgPSBpdC0+Y3Vy cmVudF95OworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBoLT52cG9z ID0gaXQtPnZwb3M7CisgICAgICBnbHlwaC0+enZfcCA9IGl0LT56dl9wOworICAgICAgZ2x5cGgt PmJ5dGVwb3MgPSBJVF9CWVRFUE9TICgqaXQpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiAgICAgICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAgICAg ICBnbHlwaC0+b2JqZWN0ID0gb2JqZWN0OwogICAgICAgLyogRklYTUU6IEl0IHdvdWxkIGJlIGJl dHRlciB0byB1c2UgVFlQRV9NQVggaGVyZSwgYnV0CkBAIC0yODAyNiw2ICszMjkwMSwyMSBAQCBh cHBlbmRfZ2x5cGhsZXNzX2dseXBoIChzdHJ1Y3QgaXQgKml0LCBpbnQgZmFjZV9pZCwgYm9vbCBm b3Jfbm9fZm9udCwgaW50IGxlbiwKIAkgICAgZ1sxXSA9ICpnOwogCSAgZ2x5cGggPSBpdC0+Z2x5 cGhfcm93LT5nbHlwaHNbYXJlYV07CiAJfQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+eCA9IGl0LT5jdXJyZW50X3g7 CisgICAgICBnbHlwaC0+eSA9IGl0LT5jdXJyZW50X3k7CisgICAgICBnbHlwaC0+aHBvcyA9IGl0 LT5ocG9zOworICAgICAgZ2x5cGgtPnZwb3MgPSBpdC0+dnBvczsKKyAgICAgIGdseXBoLT56dl9w ID0gaXQtPnp2X3A7CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9IElUX0JZVEVQT1MgKCppdCk7CisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIGdseXBoLT5jaGFycG9zID0gQ0hB UlBPUyAoaXQtPnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5vYmplY3QgPSBpdC0+b2JqZWN0Owog ICAgICAgZWFzc2VydCAoaXQtPnBpeGVsX3dpZHRoIDw9IFNIUlRfTUFYKTsKQEAgLTI5MDc2LDEw ICszMzk2NiwzNSBAQCB4X2luc2VydF9nbHlwaHMgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBn bHlwaF9yb3cgKnVwZGF0ZWRfcm93LAogCiAgIC8qIFdyaXRlIHRoZSBnbHlwaHMuICAqLwogICBo cG9zID0gc3RhcnQgLSByb3ctPmdseXBoc1t1cGRhdGVkX2FyZWFdOworCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlmICgody0+bWNfbWF0 cml4LmN1cnNvcnNfdXNlZFtNQ19DQUNIRV0gPiAwCisgICAgICAgfHwgdy0+bWNfbWF0cml4LmN1 cnNvcnNfdXNlZFtDSF9DQUNIRV0gPiAwCisgICAgICAgfHwgdy0+bWNfbWF0cml4LmN1cnNvcnNf dXNlZFtGQ19DQUNIRV0gPiAwKQorICAgICAgJiYgdXBkYXRlZF9hcmVhID09IFRFWFRfQVJFQSkK KyAgICB7CisgICAgICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXggPSB3LT5jdXJyZW50X21h dHJpeDsKKyAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7Cisg ICAgICBpbnQgc3RhcnRfeCA9IHctPm91dHB1dF9jdXJzb3IueDsKKyAgICAgIGludCBzdGFydF9o cG9zID0gaHBvczsKKyAgICAgIGludCBlbmRfaHBvcyA9IGhwb3MgKyBsZW47CisgICAgICBib29s IGNsZWFyX2VvbF9wID0gZmFsc2U7CisgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UgaGwgPSBE UkFXX05PUk1BTF9URVhUOworICAgICAgVFJBQ0UgKChzdGRlcnIsICJ4X2luc2VydF9nbHlwaHMg KCVkKTogIHN0YXJ0X3ggKCVkKSB8IHN0YXJ0X2hwb3MgKCVkKSB8IGVuZF9ocG9zICglZClcbiIs CisgICAgICAgICAgICAgICAgICAgICAgdnBvcywgc3RhcnRfeCwgc3RhcnRfaHBvcywgZW5kX2hw b3MpKTsKKyAgICAgIG1jX3JlZHJhd19yb3cgKHcsIG1hdHJpeCwgcm93LCBzdGFydF94LCBzdGFy dF9ocG9zLCBlbmRfaHBvcywgY2xlYXJfZW9sX3AsIGhsKTsKKyAgICB9CisgICAgZWxzZQogICBk cmF3X2dseXBocyAodywgdy0+b3V0cHV0X2N1cnNvci54LCByb3csIHVwZGF0ZWRfYXJlYSwKIAkg ICAgICAgaHBvcywgaHBvcyArIGxlbiwKIAkgICAgICAgRFJBV19OT1JNQUxfVEVYVCwgMCk7CiAK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogQWR2YW5jZSB0aGUgb3V0cHV0IGN1 cnNvci4gICovCiAgIHctPm91dHB1dF9jdXJzb3IuaHBvcyArPSBsZW47CiAgIHctPm91dHB1dF9j dXJzb3IueCArPSBzaGlmdF9ieV93aWR0aDsKQEAgLTI5NTA1LDkgKzM0NDIwLDMzIEBAIHhfZml4 X292ZXJsYXBwaW5nX2FyZWEgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJv dywKIAkgIHdoaWxlIChpIDwgcm93LT51c2VkW2FyZWFdCiAJCSAmJiByb3ctPmdseXBoc1thcmVh XVtpXS5vdmVybGFwc192ZXJ0aWNhbGx5X3ApOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICAgIGlmICgody0+bWNfbWF0cml4LmN1 cnNvcnNfdXNlZFtNQ19DQUNIRV0gPiAwCisgICAgICAgICAgICAgfHwgdy0+bWNfbWF0cml4LmN1 cnNvcnNfdXNlZFtDSF9DQUNIRV0gPiAwCisgICAgICAgICAgICAgfHwgdy0+bWNfbWF0cml4LmN1 cnNvcnNfdXNlZFtGQ19DQUNIRV0gPiAwKQorICAgICAgICAgICAgJiYgYXJlYSA9PSBURVhUX0FS RUEpCisgICAgICAgICAgeworICAgICAgICAgICAgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4 ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgICAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1df VlBPUyAocm93LCBtYXRyaXgpOworICAgICAgICAgICAgaW50IHN0YXJ0X2hwb3MgPSBzdGFydDsK KyAgICAgICAgICAgIGludCBlbmRfaHBvcyA9IGk7CisgICAgICAgICAgICBib29sIGNsZWFyX2Vv bF9wID0gZmFsc2U7CisgICAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UgaGwgPSBEUkFX X05PUk1BTF9URVhUOworICAgICAgICAgICAgVFJBQ0UgKChzdGRlcnIsICJ4X2ZpeF9vdmVybGFw cGluZ19hcmVhICglZCk6ICBzdGFydF94ICglZCkgfCBzdGFydF9ocG9zICglZCkgfCBlbmRfaHBv cyAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZwb3MsIHN0YXJ0X3gsIHN0 YXJ0X2hwb3MsIGVuZF9ocG9zKSk7CisgICAgICAgICAgICBtY19yZWRyYXdfcm93ICh3LCBtYXRy aXgsIHJvdywgc3RhcnRfeCwgc3RhcnRfaHBvcywgZW5kX2hwb3MsIGNsZWFyX2VvbF9wLCBobCk7 CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKIAkgIGRyYXdfZ2x5cGhzICh3LCBzdGFydF94 LCByb3csIGFyZWEsCiAJCSAgICAgICBzdGFydCwgaSwKIAkJICAgICAgIERSQVdfTk9STUFMX1RF WFQsIG92ZXJsYXBzKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCX0KICAgICAg IGVsc2UKIAl7CkBAIC0yOTc1OCwxMCArMzQ2OTcsMTcgQEAgZGlzcGxheV9hbmRfc2V0X2N1cnNv ciAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBvbiwKICAgbmV3X2N1cnNvcl90eXBlID0gZ2V0X3dp bmRvd19jdXJzb3JfdHlwZSAodywgZ2x5cGgsCiAJCQkJCSAgICAmbmV3X2N1cnNvcl93aWR0aCwg JmFjdGl2ZV9jdXJzb3IpOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQ TEUtQ1VSU09SUyAqLworCiAgIC8qIElmIGN1cnNvciBpcyBjdXJyZW50bHkgYmVpbmcgc2hvd24g YW5kIHdlIGRvbid0IHdhbnQgaXQgdG8gYmUgb3IKICAgICAgaXQgaXMgaW4gdGhlIHdyb25nIHBs YWNlLCBvciB0aGUgY3Vyc29yIHR5cGUgaXMgbm90IHdoYXQgd2Ugd2FudCwKICAgICAgZXJhc2Ug aXQuICAqLwogICBpZiAody0+cGh5c19jdXJzb3Jfb25fcAorICAgICAgJiYgTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICYmIE5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpCisgICAgICAmJiBOSUxQIChCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQogICAgICAgJiYgKCFvbgogCSAgfHwg dy0+cGh5c19jdXJzb3IueCAhPSB4CiAJICB8fCB3LT5waHlzX2N1cnNvci55ICE9IHkKQEAgLTI5 Nzc0LDYgKzM0NzIwLDkgQEAgZGlzcGxheV9hbmRfc2V0X2N1cnNvciAoc3RydWN0IHdpbmRvdyAq dywgYm9vbCBvbiwKIAkgICAgICAmJiBuZXdfY3Vyc29yX3dpZHRoICE9IHctPnBoeXNfY3Vyc29y X3dpZHRoKSkpCiAgICAgZXJhc2VfcGh5c19jdXJzb3IgKHcpOwogCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKworCiAgIC8qIERvbid0IGNoZWNrIHBoeXNfY3Vyc29yX29uX3AgaGVyZSBiZWNh dXNlIHRoYXQgZmxhZyBpcyBvbmx5IHNldAogICAgICB0byBmYWxzZSBpbiBzb21lIGNhc2VzIHdo ZXJlIHdlIGtub3cgdGhhdCB0aGUgY3Vyc29yIGhhcyBiZWVuCiAgICAgIGNvbXBsZXRlbHkgZXJh c2VkLCB0byBhdm9pZCB0aGUgZXh0cmEgd29yayBvZiBlcmFzaW5nIHRoZSBjdXJzb3IKQEAgLTI5 NzkyLDkgKzM0NzQxLDE5IEBAIGRpc3BsYXlfYW5kX3NldF9jdXJzb3IgKHN0cnVjdCB3aW5kb3cg KncsIGJvb2wgb24sCiAgICAgICB3LT5waHlzX2N1cnNvci52cG9zID0gdnBvczsKICAgICB9CiAK LSAgRlJBTUVfUklGIChmKS0+ZHJhd193aW5kb3dfY3Vyc29yICh3LCBnbHlwaF9yb3csIHgsIHks Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2N1cnNvcl90eXBlLCBu ZXdfY3Vyc29yX3dpZHRoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9u LCBhY3RpdmVfY3Vyc29yKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKKyAgaWYgKE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg Y3Jvc3NoYWlycykpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGZjX3Zpc2libGUpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMp LCBtY19jb25mKSkpCisgICAgRlJBTUVfUklGIChmKS0+ZHJhd193aW5kb3dfY3Vyc29yICh3LCBn bHlwaF9yb3csIHgsIHksIG5ld19jdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIG5ld19jdXJzb3Jfd2lkdGgsIG9uLCBhY3RpdmVfY3Vyc29yKTsKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAKQEAgLTI5ODg3LDcgKzM0ODQ2LDI5 IEBAIGRyYXdfcm93X3dpdGhfbW91c2VfZmFjZSAoc3RydWN0IHdpbmRvdyAqdywgaW50IHN0YXJ0 X3gsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KICAg aWYgKEZSQU1FX1dJTkRPV19QIChYRlJBTUUgKHctPmZyYW1lKSkpCiAgICAgeworCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBpZiAo dy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtNQ19DQUNIRV0gPiAwCisgICAgICAgICAgfHwgdy0+ bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtDSF9DQUNIRV0gPiAwCisgICAgICAgICAgfHwgdy0+bWNf bWF0cml4LmN1cnNvcnNfdXNlZFtGQ19DQUNIRV0gPiAwKQorICAgICAgICB7CisgICAgICAgICAg c3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgICAgICAg ICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgICAgICAgICBi b29sIGNsZWFyX2VvbF9wID0gZmFsc2U7CisgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNl IGhsID0gZHJhdzsKKyAgICAgICAgICBUUkFDRSAoKHN0ZGVyciwgImRyYXdfcm93X3dpdGhfbW91 c2VfZmFjZSAoJWQpOiAgc3RhcnRfeCAoJWQpIHwgc3RhcnRfaHBvcyAoJWQpIHwgZW5kX2hwb3Mg KCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdnBvcywgc3RhcnRfeCwgc3RhcnRf aHBvcywgZW5kX2hwb3MpKTsKKyAgICAgICAgICBtY19yZWRyYXdfcm93ICh3LCBtYXRyaXgsIHJv dywgc3RhcnRfeCwgc3RhcnRfaHBvcywgZW5kX2hwb3MsIGNsZWFyX2VvbF9wLCBobCk7CisgICAg ICAgIH0KKyAgICAgICAgZWxzZQogICAgICAgZHJhd19nbHlwaHMgKHcsIHN0YXJ0X3gsIHJvdywg VEVYVF9BUkVBLCBzdGFydF9ocG9zLCBlbmRfaHBvcywgZHJhdywgMCk7CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKICAgICAgIHJldHVybjsKICAgICB9CiAjZW5kaWYKQEAgLTMxOTQ1 LDExICszNjkyNiwzNiBAQCBleHBvc2VfYXJlYSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGds eXBoX3JvdyAqcm93LCBYUmVjdGFuZ2xlICpyLAogICBzdHJ1Y3QgZ2x5cGggKmxhc3Q7CiAgIGlu dCBmaXJzdF94LCBzdGFydF94LCB4OwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyog TVVMVElQTEUtQ1VSU09SUyAqLworCiAgIGlmIChhcmVhID09IFRFWFRfQVJFQSAmJiByb3ctPmZp bGxfbGluZV9wKQorICAgIHsKKyAgICAgIGlmICh3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW01D X0NBQ0hFXSA+IDAKKyAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0NIX0NB Q0hFXSA+IDAKKyAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0ZDX0NBQ0hF XSA+IDApCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgg PSB3LT5jdXJyZW50X21hdHJpeDsKKyAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBP UyAocm93LCBtYXRyaXgpOworICAgICAgICAgIGludCBzdGFydF94ID0gMDsKKyAgICAgICAgICBp bnQgc3RhcnRfaHBvcyA9IDA7CisgICAgICAgICAgaW50IGVuZF9ocG9zID0gcm93LT51c2VkW1RF WFRfQVJFQV07CisgICAgICAgICAgYm9vbCBjbGVhcl9lb2xfcCA9IGZhbHNlOworICAgICAgICAg IGVudW0gZHJhd19nbHlwaHNfZmFjZSBobCA9IERSQVdfTk9STUFMX1RFWFQ7CisgICAgICAgICAg VFJBQ0UgKChzdGRlcnIsICJleHBvc2VfYXJlYSAoJWQpOiAgV3JpdGUgdGhlIHdob2xlIGxpbmUu XG4iLCB2cG9zKSk7CisgICAgICAgICAgbWNfcmVkcmF3X3JvdyAodywgbWF0cml4LCByb3csIHN0 YXJ0X3gsIHN0YXJ0X2hwb3MsIGVuZF9ocG9zLCBjbGVhcl9lb2xfcCwgaGwpOworICAgICAgICB9 CisgICAgICAgIGVsc2UKICAgICAvKiBJZiByb3cgZXh0ZW5kcyBmYWNlIHRvIGVuZCBvZiBsaW5l IHdyaXRlIHRoZSB3aG9sZSBsaW5lLiAgKi8KICAgICBkcmF3X2dseXBocyAodywgMCwgcm93LCBh cmVhLAogCQkgMCwgcm93LT51c2VkW2FyZWFdLAogCQkgRFJBV19OT1JNQUxfVEVYVCwgMCk7Cisg ICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIGVsc2UKICAgICB7CiAgICAg ICAvKiBTZXQgU1RBUlRfWCB0byB0aGUgd2luZG93LXJlbGF0aXZlIHN0YXJ0IHBvc2l0aW9uIGZv ciBkcmF3aW5nIGdseXBocyBvZgpAQCAtMzE5ODEsMTEgKzM2OTg3LDM2IEBAIGV4cG9zZV9hcmVh IChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIFhSZWN0YW5nbGUgKnIs CiAJICArK2xhc3Q7CiAJfQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQ TEUtQ1VSU09SUyAqLworCiAgICAgICAvKiBSZXBhaW50LiAgKi8KLSAgICAgIGlmIChsYXN0ID4g Zmlyc3QpCisgICAgICAvKiBGbG9hdGluZyBmYWtlIGN1cnNvcnMgd2lsbCBleGlzdCB3aGVuIChs YXN0ID09IGZpcnN0KS4gKi8KKyAgICAgIGlmICgody0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtN Q19DQUNIRV0gPiAwCisgICAgICAgICAgIHx8IHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbQ0hf Q0FDSEVdID4gMAorICAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0ZDX0NB Q0hFXSA+IDApCisgICAgICAgICAgJiYgYXJlYSA9PSBURVhUX0FSRUEpCisgICAgICAgIHsKKyAg ICAgICAgICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsK KyAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAg ICAgICAgIHN0YXJ0X3ggPSBmaXJzdF94IC0gc3RhcnRfeDsKKyAgICAgICAgICBpbnQgc3RhcnRf aHBvcyA9IGZpcnN0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICBpbnQgZW5k X2hwb3MgPSBsYXN0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICBib29sIGNs ZWFyX2VvbF9wID0gZmFsc2U7CisgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIGhsID0g RFJBV19OT1JNQUxfVEVYVDsKKyAgICAgICAgICBUUkFDRSAoKHN0ZGVyciwgImV4cG9zZV9hcmVh ICglZCk6ICBzdGFydF94ICglZCkgfCBzdGFydF9ocG9zICglZCkgfCBlbmRfaHBvcyAoJWQpXG4i LAorICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCBzdGFydF94LCBzdGFydF9ocG9zLCBl bmRfaHBvcykpOworICAgICAgICAgIG1jX3JlZHJhd19yb3cgKHcsIG1hdHJpeCwgcm93LCBzdGFy dF94LCBzdGFydF9ocG9zLCBlbmRfaHBvcywgY2xlYXJfZW9sX3AsIGhsKTsKKyAgICAgICAgfQor ICAgICAgICBlbHNlIGlmIChsYXN0ID4gZmlyc3QpCiAJZHJhd19nbHlwaHMgKHcsIGZpcnN0X3gg LSBzdGFydF94LCByb3csIGFyZWEsCiAJCSAgICAgZmlyc3QgLSByb3ctPmdseXBoc1thcmVhXSwg bGFzdCAtIHJvdy0+Z2x5cGhzW2FyZWFdLAogCQkgICAgIERSQVdfTk9STUFMX1RFWFQsIDApOwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgfQogfQogCkBAIC0zMTk5OSwxMCAr MzcwMzAsMzUgQEAgZXhwb3NlX2xpbmUgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9y b3cgKnJvdywgWFJlY3RhbmdsZSAqcikKIHsKICAgZWFzc2VydCAocm93LT5lbmFibGVkX3ApOwog CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCiAg IGlmIChyb3ctPm1vZGVfbGluZV9wIHx8IHctPnBzZXVkb193aW5kb3dfcCkKKyAgICB7CisgICAg ICBpZiAody0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtNQ19DQUNIRV0gPiAwCisgICAgICAgICAg fHwgdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtDSF9DQUNIRV0gPiAwCisgICAgICAgICAgfHwg dy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtGQ19DQUNIRV0gPiAwKQorICAgICAgICB7CisgICAg ICAgICAgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7Cisg ICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgICAg ICAgICBpbnQgc3RhcnRfeCA9IDA7CisgICAgICAgICAgaW50IHN0YXJ0X2hwb3MgPSAwOworICAg ICAgICAgIGludCBlbmRfaHBvcyA9IHJvdy0+dXNlZFtURVhUX0FSRUFdOworICAgICAgICAgIGJv b2wgY2xlYXJfZW9sX3AgPSBmYWxzZTsKKyAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2Ug aGwgPSBEUkFXX05PUk1BTF9URVhUOworICAgICAgICAgIFRSQUNFICgoc3RkZXJyLCAiZXhwb3Nl X2xpbmUgKCVkKTogIFdyaXRlIHRoZSB3aG9sZSBsaW5lLlxuIiwgdnBvcykpOworICAgICAgICAg IG1jX3JlZHJhd19yb3cgKHcsIG1hdHJpeCwgcm93LCBzdGFydF94LCBzdGFydF9ocG9zLCBlbmRf aHBvcywgY2xlYXJfZW9sX3AsIGhsKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCiAgICAgZHJh d19nbHlwaHMgKHcsIDAsIHJvdywgVEVYVF9BUkVBLAogCQkgMCwgcm93LT51c2VkW1RFWFRfQVJF QV0sCiAJCSBEUkFXX05PUk1BTF9URVhULCAwKTsKKyAgICB9CisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworCisKICAgZWxzZQogICAgIHsKICAgICAgIGlmIChyb3ctPnVzZWRbTEVGVF9NQVJH SU5fQVJFQV0pCkBAIC0zMjU1MCw2ICszNzYwNiwyMiBAQCB4X2ludGVyc2VjdF9yZWN0YW5nbGVz IChYUmVjdGFuZ2xlICpyMSwgWFJlY3RhbmdsZSAqcjIsIFhSZWN0YW5nbGUgKnJlc3VsdCkKIHZv aWQKIHN5bXNfb2ZfeGRpc3AgKHZvaWQpCiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZGVmc3ViciAoJlNtY19kdW1wX2dseXBoX3Jv dyk7CisKKyAgZGVmc3ViciAoJlNtY19kdW1wX2dseXBoX21hdHJpeCk7CisKKyAgZGVmc3ViciAo JlNtY19jdXJyZW50X2NvbHVtbik7CisKKyAgZGVmc3ViciAoJlNtY19zdGRlcnIpOworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAgIFZ3aXRoX2VjaG9fYXJlYV9zYXZlX3ZlY3RvciA9 IFFuaWw7CiAgIHN0YXRpY3BybyAoJlZ3aXRoX2VjaG9fYXJlYV9zYXZlX3ZlY3Rvcik7CiAKZGlm ZiAtLWdpdCBhL3NyYy94dGVybS5jIGIvc3JjL3h0ZXJtLmMKaW5kZXggNWFhM2UzZi4uNjI3ZjQx YiAxMDA2NDQKLS0tIGEvc3JjL3h0ZXJtLmMKKysrIGIvc3JjL3h0ZXJtLmMKQEAgLTEzMiw2ICsx MzIsODg1IEBAIGFsb25nIHdpdGggR05VIEVtYWNzLiAgSWYgbm90LCBzZWUgPGh0dHBzOi8vd3d3 LmdudS5vcmcvbGljZW5zZXMvPi4gICovCiAjaW5jbHVkZSA8WDExL1hLQmxpYi5oPgogI2VuZGlm CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JT ICovCisKKyNpZmRlZiBHTFlQSF9ERUJVRworc3RhdGljIHZvaWQgeF9jaGVja19mb250IChzdHJ1 Y3QgZnJhbWUgKiwgc3RydWN0IGZvbnQgKik7CisjZW5kaWYKKworc3RhdGljIHZvaWQgeF9zZXRf bW9kZV9saW5lX2ZhY2VfZ2MgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKik7CisKK3N0YXRpYyB2b2lk IHhfc2V0X21vdXNlX2ZhY2VfZ2MgKHN0cnVjdCBnbHlwaF9zdHJpbmcg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19jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJp eCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAgICAgICAgICAgICAgIGludCB4 LCBpbnQgZngsIGludCB5LCBpbnQgZnksIGludCBocG9zLCBpbnQgdnBvcywgaW50IHdkLAorICAg ICAgICAgICAgICAgICAgICAgICAgIGludCBoLCBzdHJ1Y3QgbWNfUkdCIGxzbCwgZW51bSBtY19j dXJzb3JfdHlwZSBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY3Vy c29yX3dpZHRoLCBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IsIGJvb2wgb25fcCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICBib29sIGFjdGl2ZV9wKQoreworICBzdHJ1Y3QgZnJhbWUgKmYg PSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworICAvKiBUaGUgZnJpbmdlIGJpdG1hcHMgYXJl IHByZXNlbnRseSBoYW5kbGVkIGVsc2V3aGVyZSwgYnV0IGNvdWxkIHNvbWVkYXkKKyAgYmUgbWFu YWdlZCAoaW4gcGFydCkgYXQgdGhpcyBzZWN0aW9uIG9mIGNvZGUuICovCisgIGlmIChvbl9wKQor ICAgIHsKKyAgICAgIGlmIChyb3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5lX3AKKyAgICAgICAg ICAmJiAocm93LT5yZXZlcnNlZF9wCisgICAgICAgICAgICAgID8gKGhwb3MgPCAwKQorICAgICAg ICAgICAgICA6IChocG9zID49IHJvdy0+dXNlZFtURVhUX0FSRUFdKSkpCisgICAgICAgIHsKKyAg ICAgICAgICByb3ctPmN1cnNvcl9pbl9mcmluZ2VfcCA9IHRydWU7CisgICAgICAgICAgbWNfZHJh d19mcmluZ2VfYml0bWFwICh3LCByb3csIHJvdy0+cmV2ZXJzZWRfcCwgY3Vyc29yX3R5cGUpO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klOR0VfQklUTUFQOgorICAgICAgYnJlYWs7CisgICAgY2FzZSBNQ19M RUZUX0ZSSU5HRV9CSVRNQVA6CisgICAgICBicmVhazsKKyAgICBjYXNlIE1DX0ZSQU1FRF9CT1g6 CisgICAgeworICAgICAgc3RydWN0IGdseXBoICpjdXJzb3JfZ2x5cGggPSBtY19nZXRfY3Vyc29y X2dseXBoICh3LCBtYXRyaXgsIHJvdywgaHBvcywgdnBvcyk7CisgICAgICBpZiAoY3Vyc29yX2ds eXBoID09IE5VTEwpCisgICAgICAgIHJldHVybjsKKyAgICAgIExpc3BfT2JqZWN0IGJ1ZiA9IHct PmNvbnRlbnRzOworICAgICAgQ0hFQ0tfQlVGRkVSIChidWYpOworICAgICAgc3RydWN0IGJ1ZmZl ciAqYiA9IFhCVUZGRVIgKGJ1Zik7CisgICAgICBib29sIHJlZ2lvbl9hY3RpdmVfcCA9ICghTklM UCAoVnRyYW5zaWVudF9tYXJrX21vZGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiAhTklMUCAoQlZBUiAoYiwgbWFya19hY3RpdmUpKSk7CisgICAgICBwdHJkaWZmX3QgcmVnaW9u X2JlZyA9IChyZWdpb25fYWN0aXZlX3ApID8gbWNfcmVnaW9uX2xpbWl0ICgxKSA6IC0xOworICAg ICAgcHRyZGlmZl90IHJlZ2lvbl9lbmQgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IG1jX3JlZ2lvbl9s aW1pdCAoMCkgOiAtMTsKKyAgICAgIGlmIChjdXJzb3JfZ2x5cGgtPnR5cGUgIT0gSU1BR0VfR0xZ UEggJiYgbHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisg ICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRh LngtPmN1cnNvcl9nYycgYnkgYm9ycm93aW5nIHRoZQorICAgICAgICAgIGZ1bmN0aW9uYWxp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ZhY2UtPmJhY2tncm91bmQpOwor ICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoIWFjdGl2ZV9w KQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNl X2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGlu dGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1wcmUtenYtZmFjZSIpLCB0cnVlKTsK KyAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2luYWN0aXZlX2ZhY2Ug PSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAg ICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0 X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfaW5hY3RpdmVfZmFjZS0+Zm9yZWdyb3VuZCk7Cisg ICAgICAgICAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiks IGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2luYWN0aXZlX2ZhY2UtPmJhY2tn cm91bmQpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgYmxvY2tfaW5wdXQgKCk7 CisgICAgICAgICAgLyogRm9yY2UgYG1jX3hfc2V0X2N1cnNvcl9nYycgdG8gdXNlIGBzLT5mLT5v dXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MnLiAqLworICAgICAgICAgIGJvb2wgY3Vyc29yX2djX3Ag PSB0cnVlOworICAgICAgICAgIG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywg RFJBV19DVVJTT1IsIHgsIGhwb3MsIHZw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lbmRfZmFj ZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2VfaWQpOwor ICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0g bG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1wcmUt enYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxv d19hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2FjdGl2ZV9mYWNlX2lkKTsK KyAgICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiks IGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9mYWNlLT5mb3JlZ3Jv dW5kKTsKKyAgICAgICAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExB WSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9yZWdpb25f ZW5kX2ZhY2UtPmJhY2tncm91bmQpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICAgICAgZWxzZSBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBhY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBo LT5jaGFycG9zID4gcmVnaW9uX2JlZworICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vy c29yX2dseXBoLT5jaGFycG9zIDwgcmVnaW9uX2VuZCkKKyAgICAgICAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3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AgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3df YWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFs LWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAg ICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9s bG93X2FjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3Jv dW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhv bGxvd19hY3RpdmVfZmFjZS0+Zm9yZWdyb3VuZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBY U2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vy c29yX2djLCBob2xsb3dfYWN0aXZlX2ZhY2UtPmJhY2tncm91bmQpOworICAgICAgICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICghYWN0aXZlX3ApCisgICAg ICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gZmFj ZV9pZCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBp bnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItaW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7 CisgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVf ZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAg ICAgICAgICAg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3JvdW5kKTsKKyAgICAg ICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgLyogRHJhdyB0aGUgZnJh bWUgYXJvdW5kIHRoZSBib3guICovCisgICAgICAgICAgICAgIG1jX3hfZHJhd19ob2xsb3dfY3Vy c29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7Cisg ICAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBNQ19IT0xMT1dfQk9Y OgorICAgIHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNs LmJsdWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBg Zi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsJy4gKi8KKyAgICAgICAgICBmLT5vdXRwdXRf ZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBjb2xvci5waXhlbDsKKyAgICAgICAgICBtY194X2RyYXdf aG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywg d2QsIGgpOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdp bmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgbWNf eF9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3Ms IHZwb3MsIHdkLCBoKTsKKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0ZJTExFRF9C T1g6CisgICAgeworICAgICAgaWYgKGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBs c2wuYmx1ZSA+PSAwKQorICAgICAgICAvKiBUZW1w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tncm91 bmQpOworICAgICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAgIH0KKyAgICAgICAgZWxz ZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX3AgPSBmYWxzZTsKKyAg ICAgICAgICAgIG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywgRFJBV19DVVJT T1IsIHgsIGhwb3MsIHZwb3MsIGxzbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsIGN1cnNvcl9nY19wKTsK KyAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBNQ19CQVI6CisgICAg eworICAgICAgaWYgKGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wuYmx1ZSA+ PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRw dXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwnLiAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngt PmN1cnNvcl9waXhlbCA9IGNvbG9yLnBpeGVsOworICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2lu dmlzaWJsZV9va2F5X3AgPSB0cnVlOworICAgICAgICAgIG1jX3hfZHJhd19iYXJfY3Vyc29yICh3 LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoLCBNQ19CQVIsIGN1cnNvcl9nY19p bnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4 ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAg ICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSBm YWxzZTsKKyAgICAgICAgICAgIG1jX3hfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywg eCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0JBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5 X3ApOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0hCQVI6 CisgICAgeworICAgICAgaWYgKGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wu Ymx1ZSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBm LT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwnLiAqLworICAgICAgICAgIGYtPm91dHB1dF9k YXRhLngtPmN1cnNvcl9waXhlbCA9IGNvbG9yLnBpeGVsOworICAgICAgICAgIGJvb2wgY3Vyc29y X2djX2ludmlzaWJsZV9va2F5X3AgPSB0cnVlOworICAgICAgICAgIG1jX3hfZHJhd19iYXJfY3Vy c29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoLCBNQ19IQkFSLCBjdXJz b3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vy c29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVs c2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2th eV9wID0gZmFsc2U7CisgICAgICAgICAgICBtY194X2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4 LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgaCwgY3Vyc29yX3dpZHRoLCBNQ19IQkFSLCBjdXJzb3JfZ2NfaW52aXNp YmxlX29rYXlfcCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGRlZmF1 bHQ6CisgICAgICBlbWFjc19hYm9ydCAoKTsKKyAgfQorICAgICAgICB9CisjaWZkZWYgSEFWRV9Y X0kxOE4KKyAgaWYgKHcgPT0gWFdJTkRPVyAoZi0+c2VsZWN0ZWRfd2luZG93KSkKKyAgICBpZiAo RlJBTUVfWElDIChmKSAmJiAoRlJBTUVfWElDX1NUWUxFIChmKSAmIFhJTVByZWVkaXRQb3NpdGlv bikpCisgICAgICB4aWNfc2V0X3ByZWVkaXRhcmVhICh3LCB4LCB5KTsKKyNlbmRpZgorICAgIH0K KyAgWEZsdXNoIChGUkFNRV9YX0RJU1BMQVkgKGYpKTsKK30KKworLyogRHJhdyBzdHJldGNoIGds eXBoIHN0cmluZyBTLiAqLworc3RhdGljIHZvaWQKK21jX3hfZHJhd19zdHJldGNoX2dseXBoX3N0 cmluZyAoc3RydWN0IGdseXBoX3N0cmluZyAqcykKK3sKKyAgZWFzc2VydCAocy0+Zmlyc3RfZ2x5 cGgtPnR5cGUgPT0gU1RSRVRDSF9HTFlQSCk7CisgIGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUgor ICAgICAgJiYgIXhfc3RyZXRjaF9jdXJzb3JfcCkKKyAgICB7CisgICAgICAvKiBJZiBgeC1zdHJl dGNoLWN1cnNvcicgaXMgbmlsLCBkb24ndCBkcmF3IGEgYmxvY2sgY3Vyc29yIGFzIHdpZGUgYXMg dGhlCisgICAgICBzdHJldGNoIGdseXBoLiAqLworICAgICAgaW50IHdpZHRoLCBiYWNrZ3JvdW5k X3dpZHRoID0gcy0+YmFja2dyb3VuZF93aWR0aDsKKyAgICAgIGludCB4ID0gcy0+eDsKKyAgICAg IGlmICghcy0+cm93LT5yZXZlcnNlZF9wKQorICAgICAgICB7CisgICAgICAgICAgaW50IGxlZnRf eCA9IHdpbmRvd19ib3hfbGVmdF9vZmZzZXQgKHMtPncsIFRFWFRfQVJFQSk7CisgICAgICAgICAg aWYgKHggPCBsZWZ0X3gpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGJhY2tncm91bmRf d2lkdGggLT0gbGVmdF94IC0geDsKKyAgICAgICAgICAgICAgeCA9IGxlZnRfeDsKKyAgICAgICAg ICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAg LyogSW4gUjJMIHJvd3MsIGRyYXcgdGhlIGN1cnNvciBvbiB0aGUgcmlnaHQgZWRnZSBvZiB0aGUK KyAgICAgICAgICAgICAgIHN0cmV0Y2ggZ2x5cGguICovCisgICAgICAgICAgICBpbnQgcmlnaHRf eCA9IHdpbmRvd19ib3hfcmlnaHQgKHMtPncsIFRFWFRfQVJFQSk7CisgICAgICAgICAgICBpZiAo eCArIGJhY2tncm91bmRfd2lkdGggPiByaWdodF94KQorICAgICAgICAgICAgICBiYWNrZ3JvdW5k X3dpZHRoIC09IHggLSByaWdodF94OworICAgICAgICAgICAgeCArPSBiYWNrZ3JvdW5kX3dpZHRo OworICAgICAgICAgIH0KKyAgICAgIHdpZHRoID0gbWluIChGUkFNRV9DT0xVTU5fV0lEVEggKHMt PmYpLCBiYWNrZ3JvdW5kX3dpZHRoKTsKKyAgICAgIGlmIChzLT5yb3ctPnJldmVyc2VkX3ApCisg ICAgICAgIHggLT0gd2lkdGg7CisgICAgICAvKiBEcmF3IGN1cnNvci4gKi8KKyAgICAgIHhfZHJh d19nbHlwaF9zdHJpbmdfYmdfcmVjdCAocywgeCwgcy0+eSwgd2lkdGgsIHMtPmhlaWdodCk7Cisg ICAgICAvKiBDbGVhciByZXN0IHVzaW5nIHRoZSBHQyBvZiB0aGUgb3JpZ2luYWwgbm9uLWN1cnNv ciBmYWNlLiAqLworICAgICAgaWYgKHdpZHRoIDwgYmFja2dyb3VuZF93aWR0aCkKKyAgICAgICAg eworICAgICAgICAgIGludCB5ID0gcy0+eTsKKyAgICAgICAgICBpbnQgdyA9IGJhY2tncm91bmRf d2lkdGggLSB3aWR0aCwgaCA9IHMtPmhlaWdodDsKKyAgICAgICAgICBYUmVjdGFuZ2xlIHI7Cisg ICAgICAgICAgR0MgZ2M7CisgICAgICAgICAgaWYgKCFzLT5yb3ctPnJldmVyc2VkX3ApCisgICAg ICAgICAgICB4ICs9IHdpZHRoOworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHggPSBzLT54 OworICAgICAgICAgIGlmIChzLT5yb3ctPm1vdXNlX2ZhY2VfcAorICAgICAgICAgICAgICAmJiBj dXJzb3JfaW5fbW91c2VfZmFjZV9wIChzLT53KSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgeF9zZXRfbW91c2VfZmFjZV9nYyAocyk7CisgICAgICAgICAgICAgIGdjID0gcy0+Z2M7Cisg ICAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgZ2MgPSBzLT5mYWNlLT5n YzsKKyAgICAgICAgICBnZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgJnIpOworICAgICAg ICAgIHhfc2V0X2NsaXBfcmVjdGFuZ2xlcyAocy0+ZiwgZ2MsICZyLCAxKTsKKyAgICAgICAgICBp ZiAocy0+ZmFjZS0+c3RpcHBsZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogRmls bCBiYWNrZ3JvdW5kIHdpdGggYSBzdGlwcGxlIHBhdHRlcm4uICovCisgICAgICAgICAgICAgIFhT ZXRGaWxsU3R5bGUgKHMtPmRpc3BsYXksI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b2RlIGxpbmUuICovCisgICAgICBpZiAoeCA8IGxlZnRfeCAmJiAhcy0+cm93LT5tb2RlX2xp bmVfcCkKKyAgICAgICAgeworICAgICAgICAgIGJhY2tncm91bmRfd2lkdGggLT0gbGVmdF94IC0g eDsKKyAgICAgICAgICB4ID0gbGVmdF94OworICAgICAgICB9CisgICAgICBpZiAoYmFja2dyb3Vu ZF93aWR0aCA+IDApCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmdfcmVjdCAocywgeCwg cy0+eSwgYmFja2dyb3VuZF93aWR0aCwgcy0+aGVpZ2h0KTsKKyAgICB9CisgIHMtPmJhY2tncm91 bmRfZmlsbGVkX3AgPSB0cnVlOworfQorCisvKiBEcmF3IGdseXBoIHN0cmluZyBTLiAqLworc3Rh dGljIHZvaWQKK21jX3hfZHJhd19nbHlwaF9zdHJpbmcgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMs IHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAg ICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2wsIGVudW0gbWNfZmxhdm9yIGds eXBoX2ZsYXZvciwKKyAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUg Y3Vyc29yX3R5cGUsIGludCBjdXJzb3Jfd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICBi b29sIGFjdGl2ZV9wLCBib29sIGN1cnNvcl9nY19wKQoreworICBib29sIHJlbGllZl9kcmF3bl9w ID0gZmFsc2U7CisgIC8qIElmIFMgZHJhd3MgaW50byB0aGUgYmFja2dyb3VuZCBvZiBpdHMgc3Vj Y2Vzc29ycywgZHJhdyB0aGUKKyAgICAgYmFja2dyb3VuZCBvZiB0aGUgc3VjY2Vzc29ycyBmaXJz dCBzbyB0aGF0IFMgY2FuIGRyYXcgaW50byBpdC4KKyAgICAgVGhpcyBtYWtlcyBTL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Z2x5cGgtPnUuY21wLmF1dG9tYXRpYykpCisgICAgICAgIHMtPmJhY2tncm91bmRf ZmlsbGVkX3AgPSB0cnVlOworICAgICAgZWxzZQorICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5n X2JhY2tncm91bmQgKHMsIHRydWUpOworICAgICAgeF9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJp bmdfZm9yZWdyb3VuZCAocyk7CisgICAgICBicmVhazsKKyAgICBjYXNlIEdMWVBITEVTU19HTFlQ SDoKKyAgICAgIGlmIChzLT5mb3Jfb3ZlcmxhcHMpCisgICAgICAgIHMtPmJhY2tncm91bmRfZmls bGVkX3AgPSB0cnVlOworICAgICAgZWxzZQorICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2Jh Y2tncm91bmQgKHMsIHRydWUpOworICAgICAgeF9kcmF3X2dseXBobGVzc19nbHlwaF9zdHJpbmdf Zm9yZWdyb3VuZCAocyk7CisgICAgICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAgZW1hY3Nf YWJvcnQgKCk7CisgICAgfQorICBpZiAoIXMtPmZvcl9vdmVybGFwcykKKyAgICB7CisgICAgICAv KiBEcmF3IHVuZGVybGluZS4gKi8KKyAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfcCkKKyAg ICAgICAgeworICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VO REVSX1dBVkUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRl cmxpbmVfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICAgICAgeF9kcmF3X3VuZGVyd2F2ZSAocyk7 CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICBYR0NWYWx1ZXMgeGdjdjsKKyAgICAgICAgICAgICAgICAgIFhHZXRHQ1ZhbHVlcyAocy0+ZGlz cGxheSwgcy0+Z2MsIEdDRm9yZWdyb3VuZCwgJnhnY3YpOworICAgICAgICAgICAgICAgICAgWFNl dEZvcmVncm91bmQgKHMtPmRpc3BsYXksIHMtPmdjLCBzLT5mYWNlLT51bmRlcmxpbmVfY29sb3Ip OworICAgICAgICAgICAgICAgICAgeF9kcmF3X3VuZGVyd2F2ZSAocyk7CisgICAgICAgICAgICAg ICAgICBYU2V0Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwgcy0+Z2MsIHhnY3YuZm9yZWdyb3VuZCk7 CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKHMt PmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgdW5zaWduZWQgbG9uZyB0aGlja25lc3MsIHBvc2l0aW9uOworICAgICAg ICAgICAgICBpbnQgeTsKKyAgICAgICAgICAgICAgaWYgKHMtPnByZXYgJiYgcy0+cHJldi0+ZmFj ZS0+dW5kZXJsaW5lX3AKKyAgICAgICAgICAgICAgICAgICYmIHMtPnByZXYtPmZhY2UtPnVuZGVy bGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAg ICAgICAgICAgICAvKiBXZSB1c2UgdGhlIHNhbWUgdW5kZXJsaW5lIHN0eWxlIGFzIHRoZSBwcmV2 aW91cyBvbmUuICovCisgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSBzLT5wcmV2LT51bmRl cmxpbmVfdGhpY2tuZXNzOworICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBzLT5wcmV2LT51 bmRlcmxpbmVfcG9zaXRpb247CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNl CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgLyogR2V0IHRoZSB1bmRlcmxp bmUgdGhpY2tuZXNzLiAgRGVmYXVsdCBpcyAxIHBpeGVsLiAqLworICAgICAgICAgICAgICAgICAg aWYgKHMtPmZvbnQgJiYgcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzcyA+IDApCisgICAgICAg ICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPmZvbnQtPnVuZGVybGluZV90aGlja25lc3M7Cisg ICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IDE7 CisgICAgICAgICAgICAgICAgICBpZiAoeF91bmRlcmxpbmVfYXRfZGVzY2VudF9saW5lKQorICAg ICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5oZWlnaHQgLSB0aGlja25lc3MpIC0gKHMt PnliYXNlIC0gcy0+eSk7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVybGluZSBwb3NpdGlv bi4gIFRoaXMgaXMgdGhlIHJlY29tbWVuZGVkCisgICAgICAgICAgICAgICAgICAgICAgICAgdmVy dGljYWwgb2Zmc2V0IGluIHBpeGVscyBmcm9tIHRoZSBiYXNlbGluZSB0byB0aGUgdG9wIG9mCisg ICAgICAgICAgICAgICAgICAgICAgICAgdGhlIHVuZGVybGluZS4gIFRoaXMgaXMgYSBzaWduZWQg dmFsdWUgYWNjb3JkaW5nIHRvIHRoZQorICAgICAgICAgICAgICAgICAgICAgICAgIHNwZWNzLCBh bmQgaXRzIGRlZmF1bHQgaXMKKyAgICAgICAgICAgICAgICAgICAgICAgICBST1VORCAoKG1heGlt dW0gZGVzY2VudCkgLyAyKSwgd2l0aAorICAgICAgICAgICAgICAgICAgICAgICAgIFJPVU5EKHgp ID0gZmxvb3IgKHggKyAwLjUpICAqLworICAgICAgICAgICAgICAgICAgICAgIGlmICh4X3VzZV91 bmRlcmxpbmVfcG9zaXRpb25fcHJvcGVydGllcworICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBzLT5mb250ICYmIHMtPmZvbnQtPnVuZGVybGluZV9wb3NpdGlvbiA+PSAwKQorICAgICAgICAg ICAgICAgICAgICAgICAgcG9zaXRpb24gPSBzLT5mb250LT51bmRlcmxpbmVfcG9zaXRpb247Cisg ICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAocy0+Zm9udCkKKyAgICAgICAgICAgICAgICAg ICAgICAgIHBvc2l0aW9uID0gKHMtPmZvbnQtPmRlc2NlbnQgKyAxKSAvIDI7CisgICAgICAgICAg ICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSB1bmRl cmxpbmVfbWluaW11bV9vZmZzZXQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAg ICAgICAgIHBvc2l0aW9uID0gbWF4IChwb3NpdGlvbiwgdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0 KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIC8qIENoZWNrIHRoZSBzYW5pdHkg b2YgdGhpY2tuZXNzIGFuZCBwb3NpdGlvbi4gIFdlIHNob3VsZAorICAgICAgICAgICAgICAgICBh dm9pZCBkcmF3aW5nIHVuZGVybGluZSBvdXQgb2YgdGhlIGN1cnJlbnQgbGluZSBhcmVhLiAqLwor ICAgICAgICAgICAgICBpZiAocy0+eSArIHMtPmhlaWdodCA8PSBzLT55YmFzZSArIHBvc2l0aW9u KQorICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmhlaWdodCAtIDEpIC0gKHMtPnliYXNl IC0gcy0+eSk7CisgICAgICAgICAgICAgIGlmIChzLT55ICsgcy0+aGVpZ2h0IDwgcy0+eWJhc2Ug KyBwb3NpdGlvbiArIHRoaWNrbmVzcykKKyAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAocy0+ eSArIHMtPmhlaWdodCkgLSAocy0+eWJhc2UgKyBwb3NpdGlvbik7CisgICAgICAgICAgICAgIHMt PnVuZGVybGluZV90aGlja25lc3MgPSB0aGlja25lc3M7CisgICAgICAgICAgICAgIHMtPnVuZGVy bGluZV9wb3NpdGlvbiA9IHBvc2l0aW9uOworICAgICAgICAgICAgICB5ID0gcy0+eWJhc2UgKyBw b3NpdGlvbjsKKyAgICAgICAgICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRf cCkKKyAgICAgICAgICAgICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChzLT5mLCBzLT5nYywgcy0+eCwg eSwgcy0+d2lkdGgsIHRoaWNrbmVzcyk7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICB7CisgICAgICAgICAgICAgICAgICBYR0NWYWx1ZXMgeGdjdjsKKyAgICAgICAgICAgICAg ICAgIFhHZXRHQ1ZhbHVlcyAocy0+ZGlzcGxheSwgcy0+Z2MsIEdDRm9yZWdyb3VuZCwgJnhnY3Yp OworICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKHMtPmRpc3BsYXksIHMtPmdjLCBz LT5mYWNlLT51bmRlcmxpbmVfY29sb3IpOworICAgICAgICAgICAgICAgICAgeF9maWxsX3JlY3Rh bmdsZSAocy0+Ziwgcy0+Z2MsIHMtPngsIHksIHMtPndpZHRoLCB0aGlja25lc3MpOworICAgICAg ICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKHMtPmRpc3BsYXksIHMtPmdjLCB4Z2N2LmZvcmVn cm91bmQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAg ICAgLyogRHJhdyBvdmVybGluZS4gKi8KKyAgICAgIGlmIChzLT5mYWNlLT5vdmVybGluZV9wKQor ICAgICAgICB7CisgICAgICAgICAgdW5zaWduZWQgbG9uZyBkeSA9IDAsIGggPSAxOworICAgICAg ICAgIGlmIChzLT5mYWNlLT5vdmVybGluZV9jb2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAg IHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCBzLT55ICsgZHksIHMtPndpZHRo LCBoKTsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIFhHQ1Zh bHVlcyB4Z2N2OworICAgICAgICAgICAgICBYR2V0R0NWYWx1ZXMgKHMtPmRpc3BsYXksIHMtPmdj LCBHQ0ZvcmVncm91bmQsICZ4Z2N2KTsKKyAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKHMt PmRpc3BsYXksIHMtPmdjLCBzLT5mYWNlLT5vdmVybGluZV9jb2xvcik7CisgICAgICAgICAgICAg IHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCBzLT55ICsgZHksIHMtPndpZHRo LCBoKTsKKyAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKHMtPmRpc3BsYXksIHMtPmdjLCB4 Z2N2LmZvcmVncm91bmQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAvKiBEcmF3 IHN0cmlrZS10aHJvdWdoLiAqLworICAgICAgaWYgKHMtPmZhY2UtPnN0cmlrZV90aHJvdWdoX3Ap CisgICAgICAgIHsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIGggPSAxOworICAgICAgICAgIHVu c2lnbmVkIGxvbmcgZHkgPSAocy0+aGVpZ2h0IC0gaCkgLyAyOworICAgICAgICAgIGlmIChzLT5m YWNlLT5zdHJpa2VfdGhyb3VnaF9jb2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgIHhfZmls bF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCBzLT55ICsgZHksIHMtPndpZHRoLCBoKTsK KyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIFhHQ1ZhbHVlcyB4 Z2N2OworICAgICAgICAgICAgICBYR2V0R0NWYWx1ZXMgKHMtPmRpc3BsYXksIHMtPmdjLCBHQ0Zv cmVncm91bmQsICZ4Z2N2KTsKKyAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKHMtPmRpc3Bs YXksIHMtPmdjLCBzLT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9jb2xvcik7CisgICAgICAgICAgICAg IHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCBzLT55ICsgZHksIHMtPndpZHRo LCBoKTsKKyAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKHMtPmRpc3BsYXksIHMtPmdjLCB4 Z2N2LmZvcmVncm91bmQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAvKiBEcmF3 IHJlbGllZiBpZiBub3QgeWV0IGRyYXduLiAqLworICAgICAgaWYgKCFyZWxpZWZfZHJhd25fcCAm JiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gpCisgICAgICAgICAgeF9kcmF3X2dseXBoX3N0 cmluZ19ib3ggKHMpOworICAgICAgaWYgKHMtPnByZXYpCisgICAgICAgIHsKKyAgICAgICAgICBz dHJ1Y3QgZ2x5cGhfc3RyaW5nICpwcmV2OworICAgICAgICAgIGZvciAocHJldiA9IHMtPnByZXY7 IHByZXY7IHByZXYgPSBwcmV2LT5wcmV2KQorICAgICAgICAgICAgaWYgKHByZXYtPmhsICE9IHMt PmhsCisgICAgICAgICAgICAgICAgJiYgcHJldi0+eCArIHByZXYtPndpZHRoICsgcHJldi0+cmln aHRfb3ZlcmhhbmcgPiBzLT54KQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyog QXMgcHJldiB3YXMgZHJhd24gd2hpbGUgY2xpcHBlZCB0byBpdHMgb3duIGFyZWEsIHdlCisgICAg ICAgICAgICAgICAgICAgbXVzdCBkcmF3IHRoZSByaWdodF9vdmVyaGFuZyBwYXJ0IHVzaW5nIHMt PmhsIG5vdy4gKi8KKyAgICAgICAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2Ugc2F2ZSA9 IHByZXYtPmhsOworICAgICAgICAgICAgICAgIHByZXYtPmhsID0gcy0+aGw7CisgICAgICAgICAg ICAgICAgbWNfeF9zZXRfZ2x5cGhfc3RyaW5nX2djIChwcmV2LCBjdXJzb3JfZ2NfcCk7CisgICAg ICAgICAgICAgICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nX2V4YWN0bHkgKHMsIHByZXYp OworICAgICAgICAgICAgICAgIGlmIChwcmV2LT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDSEFSX0dM WVBIKQorICAgICAgICAgICAgICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChw cmV2KTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICB4X2RyYXdfY29t cG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChwcmV2KTsKKyAgICAgICAgICAgICAgICB4 X3Jlc2V0X2NsaXBfcmVjdGFuZ2xlcyAocHJldi0+ZiwgcHJldi0+Z2MpOworICAgICAgICAgICAg ICAgIHByZXYtPmhsID0gc2F2ZTsKKyAgICAgICAgICAgICAgICBwcmV2LT5udW1fY2xpcHMgPSAw OworICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGlmIChzLT5uZXh0KQorICAgICAg ICB7CisgICAgICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAqbmV4dDsKKyAgICAgICAgICBmb3Ig KG5leHQgPSBzLT5uZXh0OyBuZXh0OyBuZXh0ID0gbmV4dC0+bmV4dCkKKyAgICAgICAgICAgIGlm IChuZXh0LT5obCAhPSBzLT5obAorICAgICAgICAgICAgICAgICYmIG5leHQtPnggLSBuZXh0LT5s ZWZ0X292ZXJoYW5nIDwgcy0+eCArIHMtPndpZHRoKQorICAgICAgICAgICAgICB7CisgICAgICAg ICAgICAgICAgLyogQXMgbmV4dCB3aWxsIGJlIGRyYXduIHdoaWxlIGNsaXBwZWQgdG8gaXRzIG93 biBhcmVhLAorICAgICAgICAgICAgICAgICAgIHdlIG11c3QgZHJhdyB0aGUgbGVmdF9vdmVyaGFu ZyBwYXJ0IHVzaW5nIHMtPmhsIG5vdy4gKi8KKyAgICAgICAgICAgICAgICBlbnVtIGRyYXdfZ2x5 cGhzX2ZhY2Ugc2F2ZSA9IG5leHQtPmhsOworICAgICAgICAgICAgICAgIG5leHQtPmhsID0gcy0+ aGw7CisgICAgICAgICAgICAgICAgbWNfeF9zZXRfZ2x5cGhfc3RyaW5nX2djIChuZXh0LCBjdXJz b3JfZ2NfcCk7CisgICAgICAgICAgICAgICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nX2V4 YWN0bHkgKHMsIG5leHQpOworICAgICAgICAgICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+ dHlwZSA9PSBDSEFSX0dMWVBIKQorICAgICAgICAgICAgICAgICAgeF9kcmF3X2dseXBoX3N0cmlu Z19mb3JlZ3JvdW5kIChuZXh0KTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAg ICAgICB4X2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChuZXh0KTsKKyAg ICAgICAgICAgICAgICB4X3Jlc2V0X2NsaXBfcmVjdGFuZ2xlcyAobmV4dC0+ZiwgbmV4dC0+Z2Mp OworICAgICAgICAgICAgICAgIG5leHQtPmhsID0gc2F2ZTsKKyAgICAgICAgICAgICAgICBuZXh0 LT5udW1fY2xpcHMgPSAwOworICAgICAgICAgICAgICAgIG5leHQtPmNsaXBfaGVhZCA9IHMtPm5l eHQ7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgLyogUmVzZXQgY2xpcHBp bmcuICovCisgIHhfcmVzZXRfY2xpcF9yZWN0YW5nbGVzIChzLT5mLCBzLT5nYyk7CisgIHMtPm51 bV9jbGlwcyA9IDA7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAvKiBEZWZhdWx0IHRvIHVzaW5nIFhJTSBpZiBhdmFpbGFibGUu ICAqLwogI2lmZGVmIFVTRV9YSU0KIGJvb2wgdXNlX3hpbSA9IHRydWU7CkBAIC05OTksNiArMTg3 OCwxNSBAQCB4X3VwZGF0ZV9iZWdpbiAoc3RydWN0IGZyYW1lICpmKQogICBpZiAoRlJBTUVfVE9P TFRJUF9QIChmKSAmJiAhRlJBTUVfVklTSUJMRV9QIChmKSkKICAgICByZXR1cm47CiAKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZi0+bWNf dXBkYXRpbmdfZnJhbWUgPSBmOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIGlm ICghIEZSQU1FX0NSX1NVUkZBQ0UgKGYpKQogICAgIHsKICAgICAgIGludCB3aWR0aCwgaGVpZ2h0 OwpAQCAtMTI2Niw2ICsyMTU0LDE2IEBAIHhfdXBkYXRlX2VuZCAoc3RydWN0IGZyYW1lICpmKQog ICBYRmx1c2ggKEZSQU1FX1hfRElTUExBWSAoZikpOwogICB1bmJsb2NrX2lucHV0ICgpOwogI2Vu ZGlmCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBOVUxMOworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKworCiB9CiAKIC8qIFRoaXMgZnVuY3Rpb24gaXMgY2FsbGVkIGZyb20gdmFyaW91cyBw bGFjZXMgaW4geGRpc3AuYwpAQCAtMTMxMDAsNiArMTM5OTgsMjEgQEAgeF9hY3RpdmF0ZV90aW1l b3V0X2F0aW1lciAodm9pZCkKIAogc3RhdGljIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlIHhf cmVkaXNwbGF5X2ludGVyZmFjZSA9CiAgIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyogYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGB4 dGVybS5jYCBtdXN0IGJlIGluIHRoZSBleGFjdCBzYW1lIG9yZGVyIGFzIHRoZQorYHJlZGlzcGxh eV9pbnRlcmZhY2UnIGluIGBkaXNwZXh0ZXJuLmhgISAqLworCisgIG1jX3hfd3JpdGVfZ2x5cGhz LAorICBtY194X2RyYXdfd2luZG93X2N1cnNvciwKKyAgbWNfeF9kcmF3X2dseXBoX3N0cmluZywK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgIHhfZnJhbWVfcGFybV9oYW5kbGVy cywKICAgICB4X3Byb2R1Y2VfZ2x5cGhzLAogICAgIHhfd3JpdGVfZ2x5cGhzLAo= --Multipart_Sun_Jun__2_00:29:09_2019-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs). References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sat, 08 Jun 2019 23:45:02 +0000 Resent-Message-ID: <handler.22873.B22873.156003745928513 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22873 <at> debbugs.gnu.org,17684 <at> debbugs.gnu.org Cc: eliz@HIDDEN, johnw@HIDDEN, mbork@HIDDEN, rms@HIDDEN, akioburns@HIDDEN Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.156003745928513 (code B ref 22873); Sat, 08 Jun 2019 23:45:02 +0000 Received: (at 22873) by debbugs.gnu.org; 8 Jun 2019 23:44:19 +0000 Received: from localhost ([127.0.0.1]:53910 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1hZl0U-0007Po-Rk for submit <at> debbugs.gnu.org; Sat, 08 Jun 2019 19:44:18 -0400 Received: from gateway32.websitewelcome.com ([192.185.145.178]:44881) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1hZl0S-0007Pb-Js for 22873 <at> debbugs.gnu.org; Sat, 08 Jun 2019 19:44:17 -0400 Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway32.websitewelcome.com (Postfix) with ESMTP id 2198820745 for <22873 <at> debbugs.gnu.org>; Sat, 8 Jun 2019 18:44:16 -0500 (CDT) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id Zl0RhtdmV2qH7Zl0Rh5VGF; Sat, 08 Jun 2019 18:44:16 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=TYxRaYP5xRFtQzeCv83IB5TokKUrmipOwyW0yjzbbK4=; b=IDlQ4OSZ16J+GCLLuKJBAL3aAW p6+1jkLRFVLGM+0u6QMmu84hTQwrp9H8aDEannPguEMnz3L1F+FYW8E+HtmdqDhDWK89DMaHDiJh/ +/qaBxVnla1+Ucgwpubk2CXIx4LsWnBkeQ/RfbeJvyYsqniD06vx18M1/7NArqXwU7HaJ9sVZpAG1 DU2By+ZVGz15o8WX/wOp8RCXAklsU6RRxZ0Poo0pBR91K8pt1zzW4FqvB6yfnZRbm/yYmYZedC0tO dQ7mSNEtHRlPYPZ+V+33wKpj4XyE0PqkjQKP5jZWtZEhwBYWsyzvUnO9YDqf50jyFuBdOngus6DA0 tWav8wJA==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:55026 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.92) (envelope-from <esq@HIDDEN>) id 1hZl0N-0007Wx-D7; Sat, 08 Jun 2019 18:44:14 -0500 Date: Sat, 08 Jun 2019 16:44:10 -0700 Message-ID: <m2ftojmylx.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Sat_Jun__8_16:44:10_2019-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1hZl0N-0007Wx-D7 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:55026 X-Source-Auth: lawlist X-Email-Count: 7 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> --Multipart_Sat_Jun__8_16:44:10_2019-1 Content-Type: text/plain; charset=US-ASCII VERSION: 021.001 [06/08/2019] CHANGELOG: - Fixed bugs in `mc_xfree_cache_matrix', the most significant of which was the failure to reset struct members that were not allocated to memory dynamically. - Fixed bugs in `mc_save_cache_matrix', the most significant of which was that some struct members were not being saved. - Added `mc_traverse_cache_p' to be used in various `for` loops, which ensures that a uniform test is used everywhere [which was not previously the case]. - Fixed a bug in `mc_helper' relating to proper bookkeeping of the `vpos_used` member in the `mc_matrix'. - Added `mc_cache_inspector' to help with debugging. - `mc_set_essentials' is now called only once per `update_window' (at outset). - Fixed a bug with respect to determining the `row_position` of the cursor row, which is the one exception where we consult the previous row in the desired matrix instead of consulting the previous row in the current matrix. - Reduced overall footprint a little bit by restoring `it` struct to its original state -- the member `zv_p` is no longer needed by features 17684 / 22873. The code used to record `it` struct member `zv_p` has been removed. Reduced the additional `glyph` struct members to just `hpos`, `bytepos` and `relative_x` (which is not needed, but may be useful if debugging). The code used to record the prior `glyph` struct members `x`, `y`, `vpos` and `zv_p` has been removed. - Miscellaneous cleaning up of unused variables, shortened certain names, and tidied up some of the code. Changed a couple of colors for even-at-zv .... - Added screenshot of most of the features on all three GUI ports (X11, W32, NS). SCREENSHOTS (X11, W32, NS): https://www.lawlist.com/images/22873_17684_light_dark_backgrounds.png SETUP: Step 1: git clone -b master git://git.sv.gnu.org/emacs.git Step 2: In the new emacs folder, go back to an Emacs version from 04/08/2019: git reset --hard a038df77de7b1aa2d73a6478493b8838b59e4982 Step 3: From within the new emacs folder created in Step 1, apply the patch: git apply /path/to/the/patch.diff Step 4: ./autogen.sh Step 5: ./configure ... [your custom options] Step 6: make Step 7: make install USAGE: - For a minimal working example of built-in fake cursors, type: M-x mc-test ;;; TURN ON FAKE CURSORS (buffer position, cursor-type, cursor color): (setq mc-conf '((1 "hbar" "magenta") (2 "bar" "purple") (3 "box" "#00FF00") (4 "hollow" "#0000FF") (5 ("hbar" 3) [1.0 0.0 1.0]) (6 ("bar" 3) [0.0 1.0 1.0]) (7 "framed" "OrangeRed")))) ;;; TURN OFF FAKE CURSORS: (setq mc-conf nil) - To try out both the crosshairs feature and the visible fill column indicator feature, type: M-x +-mode - To try out just the visible fill column indicator feature, type: M-x fc-mode - To try out built-in fake cursors with Magnar Sveen's multiple-cursors package, install that package first. [If the multiple-cursors package is installed, an eval-after-load "multiple-cursors-core" statement within `crosshairs.el` will redefine a couple of functions and set up a few keyboard shortcuts.] If the multiple-cursors package by Magnar Sveen is not already installed, then here are two easy ways to install that package: Type: M-x mc-install OR, evaluate the following snippet: (progn (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) (package-refresh-contents) (package-install 'multiple-cursors)) TODO: - `ns_draw_window_cursor' calls `ns_clip_to_rect', which does _not_ take `row->clip` into consideration when drawing cursors with `NSRectFill'. When it comes time to draw glyphs on top of the box/hollow family of cursors, `row->clip` is taken into consideration by `get_glyph_string_clip'. Fake cursors can be drawn even though the glyphs cannot, resulting in hollow/box family of cursors without text. The issue can be reproduced with M-x mc-test. [A temporary workaround is to disable `row->clip` while drawing the glyphs.] https://lists.gnu.org/archive/html/emacs-devel/2019-04/msg00009.html - Add additional support for `ch_inactive_windows' and `fc_inactive_windows' when the variables have a `nil` value. In such a case, the inactive windows should not display the crosshairs and/or visible fill column indicator. At the present time, fake cursors are drawn in active/inactive windows alike. - Deal with left/right overwritten glyphs in the w32 and X ports of Emacs. - Is there any additional meaningful optimization that can be added to the three calls of `mc_pre_scroll_clean'? - NOTE: As to `mc_scrolling_window', it would appear that there is no tangible benefit to rotating the current/prospective cache of fake cursors to compare the data before removing the fake cursors. When scrolling the display, only _some_ lines are copied to new locations. Areas that are not overwritten may have fake cursors and those may not necessarily be removed if desired/current matrix glyphs are equal. The test for `GLYPH_EQUAL_P' does not take into consideration the existence of a fake cursor, and the glyph (with a fake cursor) may not be updated as a result thereof. As to lines that are not copied, portions may be updated and fake cursors would be removed thereby. - When an idle-timer fires and point is at the end of a horizontally scrolled line in a narrow window, the temporary horizontal scroll is canceled. Create an minimal working example and file a bug report. - There is a bug affecting an older version of Emacs for the NS port that causes partial line flickering when the same characters are grouped together (;;;;;;) and MC_GLYPHLESS cursors are above or below -- having the same background color as the frame; e.g., black on black (used to erase a glyphless cursor). The partial flickering is only noticeable with rapid fire; e.g., holding down the right/left arrow key. When changing the color of the glyphless cursor, the issue is not present. [@lawlist has verified that the X and HPOS coordinates are accurate.] - There is a bug affecting the recorded `w->mc.lnum_pixel_width` that is observable when not running under gdb, but disappears when running under gdb. While viewing a folded org-mode buffer, the non-gdb instance had a visible line number pixel-width of 44, but Emacs treated it as fluctuating between 44 and 55 as the cursor was moved to the end of line. In the gdb instance, the visible line number pixel width was 55 with no fluctuation under the same conditions as the non-gdb instance. This appears to be a different bug than bug#32177 (current line number shifts one column to the left) because the line number of the current line does not shift left, and changing the bidi settings did not correct the issue. - The current test for `auto_hscroll_mode_p' only looks for `current_line` and all five related tests are based upon that assumption, which may not be true. - Multiple Cursors: If point is in the middle of a composite character, then select a fully composed character so that the fake cursor is visible. - Implement functionality similar to the Lisp multiple-cursors by Magnar Sveen. - Follow up with the Emacs team re bug#32177; i.e., (Current line number shifts one column to the left.) - Follow up with the Emacs team re bug#32060; i.e., Horizontal Scrolling (Current Line): Wrong line gets h-scrolled. - Determine if bug #28936 needs to be fixed and help the Emacs team re same. --Multipart_Sat_Jun__8_16:44:10_2019-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="2019_06_08__16_37_35_624.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvY3Jvc3NoYWlycy5lbCBiL2xpc3AvY3Jvc3NoYWlycy5lbApuZXcg ZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4zYmJkNjk3Ci0tLSAvZGV2L251bGwKKysr IGIvbGlzcC9jcm9zc2hhaXJzLmVsCkBAIC0wLDAgKzEsMTI4MiBAQAorOzs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Cis7OzsgQkVHSU4gbW9kaWZpY2F0aW9uIG9mIHRoZSBNdWx0aXBsZSBDdXJzb3Jz IGxpYnJhcnkgd3JpdHRlbiBieSAgTWFnbmFyIFN2ZWVuLgorCisoZGVmdmFyIHBhY2thZ2UtYXJj aGl2ZXMpCisKKyhkZWZ2YXIgbWMtLW1heC1jdXJzb3JzLW9yaWdpbmFsKQorKGRlZnZhciBtYy9t YXgtY3Vyc29ycykKKyhkZWZ2YXIgbWMtLW1heC1jdXJzb3JzLW9yaWdpbmFsKQorKGRlZnZhciBt Yy9tYXgtY3Vyc29ycykKKyhkZWZ2YXIgbWMvYWx3YXlzLXJ1bi1mb3ItYWxsKQorKGRlZn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gICAgICAgIChpZiAoeWVzLW9yLW5vLXAgKGZvcm1hdCAiJWQgYWN0aXZlIGN1 cnNvcnMuIENvbnRpbnVlPyAiIChtYy9udW0tY3Vyc29ycykpKQorICAgICAgICAgICAgKHNldHEg bWMvbWF4LWN1cnNvcnMgKHJlYWQtbnVtYmVyICJFbnRlciBhIG5ldywgdGVtcG9yYXJ5IG1heGlt dW06ICIpKQorICAgICAgICAgIChtYy9yZW1vdmUtZmFrZS1jdXJzb3JzKQorICAgICAgICAgIChl cnJvciAiQWJvcnRlZDogdG9vIG1hbnkgY3Vyc29ycyIpKSkpCisgICAgKGxldCAoKG92ZXJsYXkK KyAgICAgICAgICAgIChpZiBtYy91c2UtYnVpbHQtaW4tY3Vyc29ycworICAgICAgICAgICAgICAo bWFrZS1vdmVybGF5IChwb2ludCkgKHBvaW50KSkKKyAgICAgICAgICAgICAgKG1jL21ha2UtY3Vy c29yLW92ZXJsYXktYXQtcG9pbnQpKSkpCisgICAgICAob3ZlcmxheS1wdXQgb3ZlcmxheSAnbWMt aWQgKG9yIGlkIChtYy9jcmVhdGUtY3Vyc29yLWlkKSkpCisgICAgICAob3ZlcmxheS1wdXQgb3Zl cmxheSAndHlwZSAnZmFrZS1jdXJzb3IpCisgICAgICAob3ZlcmxheS1wdXQgb3ZlcmxheSAncHJp b3JpdHkgMTAwKQorICAgICAgKG1jL3N0b3JlLWN1cnJlbnQtc3RhdGUtaW4tb3ZlcmxheSBvdmVy bGF5KQorICAgICAgKHdoZW4gKHVzZS1yZWdpb24tcCkKKyAgICAgICAgKG92ZXJsYXktcHV0IG92 ZXJsYXkgJ3JlZ2lvbi1vdmVybGF5CisgICAgICAgICAgICAgICAgICAgICAobWMvbWFrZS1yZWdp b24tb3ZlcmxheS1iZXR3ZWVuLXBvaW50LWFuZC1tYXJrKSkpCisgICAgICBvdmVybGF5KSkKKwor ICAoZGVmdW4gbWMvZXhlY3V0ZS1jb21tYW5kLWZvci1hbGwtZmFrZS1jdXJzb3JzIChj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wgaGFuZGxl IHRob3NlIGxhdGVyIGluc3RlYWQuCisgICAgICAgICAgICAod2hlbiAoZnVuY3Rpb25wIG9yaWdp bmFsLWNvbW1hbmQpCisgICAgICAgICAgICAgIDs7IGlmIGl0J3MgYSBsYW1iZGEsIHdlIGNhbid0 IGtub3cgaWYgaXQncyBzdXBwb3J0ZWQgb3Igbm90CisgICAgICAgICAgICAgIDs7IC0gc28gZ28g YWhlYWQgYW5kIGFzc3VtZSBpdCdzIG9rLCBiZWNhdXNlIHdlJ3JlIGp1c3Qgb3B0aW1pc3RpYyBs aWtlIHRoYXQKKyAgICAgICAgICAgICAgKGlmIChvciAobm90IChzeW1ib2xwIG9yaWdpbmFsLWNv bW1hbmQpKQorICAgICAgICAgICAgICAgICAgICAgIDs7IGxhbWJkYSByZWdpc3RlcmVkIGJ5IHNt YXJ0cmVwCisgICAgICAgICAgICAgICAgICAgICAgKHN0cmluZy1wcmVmaXgtcCAiKCIgKHN5bWJv bC1uYW1lIG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAgICAgICAgICAgICAgICAgIChtYy9leGVjdXRl LWNvbW1hbmQtZm9yLWFsbC1mYWtlLWN1cnNvcnMgb3JpZ2luYWwtY29tbWFuZCkKKyAgICAgICAg ICAgICAgICA7OyBzbWFydHJlcCBgaW50ZXJuJ3MgY29tbWFuZHMgaW50byBvd24gb2JhcnJheSB0 byBoZWxwCisgICAgICAgICAgICAgICAgOzsgYGRlc2NyaWJlLWJpbmRpbmdzJy4gIFNvLCBsZXQn cyByZS1gaW50ZXJuJyBoZXJlIHRvCisgICAgICAgICAgICAgICAgOzsgbWFrZSB0aGUgY29tbWFu ZCBjb21wYXJhYmxlIGJ5IGBlcScuCisgICAgICAgICAgICAgICAgKHNldHEgb3JpZ2luYWwtY29t bWFuZCAoaW50ZXJuIChzeW1ib2wtbmFtZSBvcmlnaW5hbC1jb21tYW5kKSkpCisgICAgICAgICAg ICAgICAgOzsgb3RoZXJ3aXNlIGl0J3MgYSBzeW1ib2wsIGFuZCB3ZSBjYW4gYmUgbW9yZSB0aG9y b3VnaAorICAgICAgICAgICAgICAgIChpZiAoZ2V0IG9yaWdpbmFsLWNvbW1hbmQgJ21jLS11bnN1 cHBvcnRlZCkKKyAgICAgICAgICAgICAgICAgICAgKG1lc3NhZ2UgIiVTIGlzIG5vdCBzdXBwb3J0 ZWQgd2l0aCBtdWx0aXBsZSBjdXJzb3JzJXMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg IG9yaWdpbmFsLWNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdldCBvcmln aW5hbC1jb21tYW5kICdtYy0tdW5zdXBwb3J0ZWQpKQorICAgICAgICAgICAgICAgICAgKHdoZW4g KGFuZCBvcmlnaW5hbC1jb21tYW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChub3Qg KG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy0tZGVmYXVsdC1jbWRzLXRvLXJ1bi1vbmNlKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKG5vdCAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1j L2NtZHMtdG8tcnVuLW9uY2UpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAob3IgbWMv YWx3YXlzLXJ1bi1mb3ItYWxsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVt cSBvcmlnaW5hbC1jb21tYW5kIG1jLS1kZWZhdWx0LWNtZHMtdG8tcnVuLWZvci1hbGwpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jL2Nt ZHMtdG8tcnVuLWZvci1hbGwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWMv cHJvbXB0LWZvci1pbmNsdXNpb24taW4td2hpdGVsaXN0IG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAg ICAgICAgICAgICAgICAgICAgKG1jL2V4ZWN1dGUtY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Vjb2xvcl9w aXhlbCcsIHdoaWNoIHVzZXMgMTYtYml0IFJHQiAtLSB0aGUgY29udmVyc2lvbiBmcm9tIExTTAor aGFwcGVucyBpbnRlcm5hbGx5IGJ5IG11bHRpcGx5aW5nIGVhY2ggZWxlbWVudCBvZiB0aGUgTFNM IGNvbG9yIHZlY3RvciBieSA2NTUzNS4iCisoaW50ZXJhY3RpdmUpCisgIChsZXQgKChidWZmZXIg KGdldC1idWZmZXItY3JlYXRlICIqTUMtVEVTVCoiKSkpCisgICAgKHdpdGgtY3VycmVudC1idWZm ZXIgYnVmZmVyCisgICAgICAoZXJhc2UtYnVmZmVyKQorICAgICAgKGluc2VydCAiVGhpcyBpcyBh IHRlc3QhIikKKyAgICAgIChzZXRxIG1jLWNvbmYgJygoMSAiaGJhciIgIm1hZ2VudGEiKQorICAg ICAgICAgICAgICAgICAgICAgICgyICJiYXIiICJwdXJwbGUiKQorICAgICAgICAgICAgICAgICAg ICAgICgzICJib3giICIjMDBGRjAwIikKKyAgICAgICAgICAgICAgICAgICAgICAoNCAiaG9sbG93 IiAiIzAwMDBGRiIpCisgICAgICAgICAgICAgICAgICAgICAgKDUgKCJoYmFyIiAzKSBbMS4wIDAu MCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg2ICgiYmFyIiAzKSBbMC4wIDEuMCAxLjBd KQorICAgICAgICAgICAgICAgICAgICAgICg3ICJmcmFtZWQiICJPcmFuZ2VSZWQiKQorICAgICAg ICAgICAgICAgICAgICAgICg4ICJib3giICJncmV5MjUiKQorICAgICAgICAgICAgICAgICAgICAg ICg5ICJib3giICJncmV5NzUiKSkpKQorICAgIChzZWxlY3Qtd2luZG93IChkaXNwbGF5LWJ1ZmZl ciBidWZmZXIpKSkpCisKKyhkZWZ1biArLXRpbWVyLWZuICgpCisiU2luY2UgdGhpcyBmaXJlcyBn bG9iYWxseSwgd2UgbXVzdCBjb250cm9sIHdoaWNoIGJ1ZmZlcnMgY3Jvc3NoYWlycyBhcHBlYXIg aW4uIgorICAod2hlbiArLW1vZGUKKyAgICAodW5sZXNzIChvciAobWVtcSBsYXN0LWNvbW1hbmQg Ky1wYXJlbnMtZXhjbHVzaW9ucykKKyAgICAgICAgICAgICAgICAobnVsbCArLXBhcmVucy1wKSkK KyAgICAgICgrLXBhcmVucy1mbikpCisgICAgKHdoZW4gKy10aW1lci12YXIKKyAgICAgIChzZXRx IHRpbWVyLWlkbGUtbGlzdCAoZGVscSArLXRpbWVyLXZhciB0aW1lci1pZGxlLWxpc3QpKQorICAg ICAgKHNldHEgKy10aW1lci12YXIgbmlsKSkpKQorCisoZGVmdW4gKy1kcmF3LWZvcnRod2l0aCAo KQorIkltbWVkaWF0ZWx5IGRlbGV0ZS9kcmF3IG1hdGNoaW5nIHBhcmVudGhlc2VzLiIKKyAgKCst ZHJhdy1jcm9zc2hhaXJzICdmb3JjZSkpCisKKyhkZWZ1biArLWRyYXctY3Jvc3NoYWlycyAoJm9w dGlvbmFsIGZvcmNlKQorIkltbWVkaWF0ZWx5IGRlbGV0ZSBtYXRjaGluZyBwYXJlbnRoZXNlcy4g IElmIEZPUkNFIGlzIG5vbi1uaWwsIHRoZW4gaW1tZWRpYXRlbHkKK2RyYXcgbWF0Y2hpbmcgcGFy ZW50aGVzaXM7IG90aGVyd2lzZSwgZHJhdyB0aGVtIG9uIGFuIGlkbGUtdGllci4iCisgICh3aGVu ICstbW9kZQorICAgICh3aGVuICstdGltZXItdmFyCisgICAgICAoc2V0cSB0aW1lci1pZGxlLWxp c3QgKGRlbHEgKy10aW1lci12YXIgdGltZXItaWRsZS1saXN0KSkKKyAgICAgIChzZXRxICstdGlt ZXItdmFyIG5pbCkpCisgICAgKHVubGVzcyAob3IgKG1lbXEgdGhpcy1jb21tYW5kICstcGFyZW5z LWV4Y2x1c2lvbnMpCisgICAgICAgICAgICAgICAgKGFuZCAobnVsbCArLXBhcmVucy1wKQorICAg ICAgICAgICAgICAgICAgICAgKG51bGwgKy1wYXJlbnMtb3ZlcmxheXMtZXhpc3QtcCkpKQorICAg ICAgKCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykpCisgICAgKGlmIGZvcmNlCisgICAgICAocHJv Z24KKyAgICAgICAgKHdoZW4gKy1wYXJlbnMtcAorICAgICAgICAgICgrLXBhcmVucy1mbikpKQor ICAgICAgKHNldHEgKy10aW1lci12YXIgKHJ1bi13aXRoLWlkbGUtdGltZXIgKy1pZGxlLXRpbWVy LXNlY29uZHMgbmlsICMnKy10aW1lci1mbikpKSkpCisKKyhkZWZ2YXIgZmMtbW9kZSkKKworOzs7 IyMjYXV0b2xvYWQKKyhkZWZpbmUtbWlub3ItbW9kZSArLW1vZGUKKyJNaW5vciBtb2RlIGZvciBk aXNwbGF5aW5nIGEgaG9yaXpvbnRhbCBydWxlci4iCisgIDppbml0LXZhbHVlIG5pbAorICA6bGln aHRlciAiICsiCisgIDprZXltYXAgbmlsCisgIDpnbG9iYWwgbmlsCisgIDpncm91cCAnKy1tb2Rl CisgIChjb25kCisgICAgKCstbW9kZQorICAgICAgOzs7IGArLW1vZGUnIGhhcyB0aGUgYWJpbGl0 eSB0byBhbHNvIGRpc3BsYXkgYSBmaWxsIGNvbHVtbiBpbmRpY2F0b3IuCisgICAgICA7OzsgU2Vl IHRoZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicuCisgICAgICAod2hlbiBmYy1tb2RlCisgICAg ICAgIChmYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgZ2xvYmFsLWVsZG9jLW1vZGUKKyAg ICAgICAgICAgICAgICAgKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAgJ2FueSkKKyAgICAgICAgICAg ICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAgICAgICAgKGdsb2JhbC1l bGRvYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgaml0LWxvY2stY29udGV4dC10aW1lcgor ICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAg ICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAod2hlbiAo dGltZXJwIGppdC1sb2NrLWNvbnRleHQtdGltZXIpCisgICAgICAgICAgKGNhbmNlbC10aW1lciBq aXQtbG9jay1jb250ZXh0LXRpbWVyKSkKKyAgICAgICAgOzsgKHNldHEgaml0LWxvY2stY29udGV4 dC10aW1lciAocnVuLXdpdGgtaWRsZS10aW1lciA1LjAgJ3JlcGVhdCAnaml0LWxvY2stY29udGV4 dC1mb250aWZ5KSkKKyAgICAgICAgKHNldHEgaml0LWxvY2stY29udGV4dC10aW1lciBuaWwpKQor ICAgICAgKHdoZW4gKGFuZCAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAg ICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAod2hlbiAo dGltZXJwIHVuZG8tYXV0by1jdXJyZW50LWJvdW5kYXJ5LXRpbWVyKQorICAgICAgICAgIChjYW5j ZWwtdGltZXIgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpKQorICAgICAgICAoZnNl dCAndW5kby1hdXRvLS11bmRvYWJsZS1jaGFuZ2UKKyAgICAgICAgICAgICAgKGxhbWJkYSAoKSAo YWRkLXRvLWxpc3QgJ3VuZG8tYXV0by0tdW5kb2FibHktY2hhbmdlZC1idWZmZXJzIChjdXJyZW50 LWJ1ZmZlcikpKSkKKyAgICAgICAgKGZzZXQgJ3VuZG8tYXV0by1hbWFsZ2FtYXRlICdpZ25vcmUp KQorICAgICAgKHdoZW4gYmxpbmstY3Vyc29yLW1vZGUKKyAgICAgICAgKGJsaW5rLWN1cnNvci1t b2RlIC0xKQorICAgICAgICAod2hlbiAobWVtcSAnYmxpbmstY3Vyc29yLWNoZWNrIHBvc3QtY29t bWFuZC1ob29rKQorICAgICAgICAgIChyZW1vdmUtaG9vay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G5pbCkp CisgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICcrLS1zYXZlZC1zdGF0ZSkgbmlsKQor ICAgICAgKGRvbGlzdCAodmFyICcoYnVmZmVyLWRpc3BsYXktdGFibGUKKyAgICAgICAgICAgICAg ICAgICAgIGZyaW5nZS1pbmRpY2F0b3ItYWxpc3QKKyAgICAgICAgICAgICAgICAgICAgIHRhYi13 aWR0aAorICAgICAgICAgICAgICAgICAgICAgbGluZS1tb3ZlLXZpc3VhbAorICAgICAgICAgICAg ICAgICAgICAgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgICAgICAgICAgICAgIHRydW5jYXRlLXBh cnRpYWwtd2lkdGgtd2luZG93cworICAgICAgICAgICAgICAgICAgICAgd29yZC13cmFwKSkKKyAg ICAgICAgKHdoZW4gKGxvY2FsLXZhcmlhYmxlLXAgdmFyKQorICAgICAgICAgIChwdXNoIChjb25z IHZhciAoc3ltYm9sLXZhbHVlIHZhcikpICstLXNhdmVkLXN0YXRlKSkpCisgICAgICAoc2V0cSBm aWxsLWNvbHVtbiA4MCkKKyAgICAgIChzZXRxIGRpc3BsYXktbGluZS1udW1iZXJzIHQpCisgICAg ICAoc2V0cS1sb2NhbCBhdXRvLWhzY3JvbGwtbW9kZSAnY3VycmVudC1saW5lKQorICAgICAgKHNl dHEtbG9jYWwgaHNjcm9sbC1zdGVwIDUpCisgICAgICAoc2V0cSBidWZmZXItZGlzcGxheS10YWJs ZSArLWJ1ZmZlci1kaXNwbGF5LXRhYmxlKQorICAgICAgKHNldHEgdGFiLXdpZHRoIDQpCisgICAg ICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICdsaW5lLW1vdmUtdmlzdWFsKSB0KQorICAgICAg KHNldHEgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgKGNvbmQKKyAgICAgICAgICAoKGxldCAoKGxz dCArLXRydW5jYXRlLWxpbmVzLWRlcml2ZWQtbW9kZXMpCisgICAgICAgICAgICAgICAgICBtb2Rl KQorICAgICAgICAgICAgKGNhdGNoICdmb3VuZAorICAgICAgICAgICAgICAod2hpbGUgKHNldHEg bW9kZSAocG9wIGxzdCkpCisgICAgICAgICAgICAgICAgKHdoZW4gKGRlcml2ZWQtbW9kZS1wIG1v ZGUpCisgICAgICAgICAgICAgICAgICAodGhyb3cgJ2ZvdW5kIHQpKSkpKSkKKyAgICAgICAgICAg KChtZW1xIG1ham9yLW1vZGUgKy10cnVuY2F0ZS1saW5lcy1tYWpvci1tb2RlcykpCisgICAgICAg ICAgICh0CisgICAgICAgICAgICAgbmlsKSkpCisgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlh YmxlICd0cnVuY2F0ZS1wYXJ0aWFsLXdpZHRoLXdpbmRvd3MpIG5pbCkKKyAgICAgIChzZXRxIHdv cmQtd3JhcCB0KQorICAgICAgKHNldHEgaW5kaWNhdGUtZW1wdHktbGluZXMgdCkKKyAgICAgIChz ZXRxIGluZGljYXRlLWJ1ZmZlci1ib3VuZGFyaWVzICdsZWZ0KQorICAgICAgKHNldHEgZnJpbmdl LWluZGljYXRvci1hbGlzdAorICAgICAgICAgIDs7OyBoc2NsX2FsbF90ZW1wX3AgfCBoc2NsX3Rl bXBfcAorICAgICAgICAnKCgrLWhzY2wtdGVtcCAuICgrLXNpbmdsZS1hbmdsZS1sZWZ0CisgICAg ICAgICAgICAgICAgICAgICAgICAgICstZG91YmxlLWFuZ2xlLWxlZnQpKQorICAgICAgICAgIDs7 OyBoc2NsX2FsbF9wZXJtXzBfcCB8IGhzY2xfYWxsX3Blcm1fMV9wIHwgaHNjbF9hbGxfcGVybV8y X3AgfCBoc2NsX3Blcm1fcAorICAgICAgICAgICgrLWhzY2wtcGVybSAuICgrLXNpbmdsZS1hbmds ZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLWRvdWJsZS1hbmdsZS11cAorICAgICAg ICAgICAgICAgICAgICAgICAgICArLXRyaXBsZS1hbmdsZS11cAorICAgICAgICAgICAgICAgICAg ICAgICAgICArLXF1YWRydXBsZS1hbmdsZS11cCkpCisgICAgICAgICAgKCstb3ZlcmxheS1hcnJv dyAuICgrLWZyaW5nZS1sZWZ0LWFycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAr LWZyaW5nZS1yaWdodC1hcnJvdykpCisgICAgICAgICAgKHRydW5jYXRpb24gLiAoKy1mcmluZ2Ut bGVmdC1hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICstZnJpbmdlLXJpZ2h0LWFycm93 KSkKKyAgICAgICAgICAoY29udGludWF0aW9uIC4gKCstZnJpbmdlLWxlZnQtY3VybHktYXJyb3cK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICstYmFja3NsYXNoKSkKKyAgICAgICAgICAob3Zl cmxheS1hcnJvdyAuICstZnJpbmdlLXJpZ2h0LXRyaWFuZ2xlKQorICAgICAgICAgICh1cCAuICst ZnJpbmdlLXVwLWFycm93KQorICAgICAgICAgIChkb3duIC4gKy1mcmluZ2UtZG93bi1hcnJvdykK KyAgICAgICAgICAodG9wIC4gKy1mcmluZ2UtdG9wLWxlZnQtYW5nbGUpCisgICAgICAgICAgKGJv dHRvbSAuICstZnJpbmdlLWJvdHRvbS1yaWdodC1hbmdsZSkKKyAgICAgICAgICAodG9wLWJvdHRv bSAuICgrLWZyaW5nZS1sZWZ0LWJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICArLWZy aW5nZS1yaWdodC1icmFja2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgKy1mcmluZ2UtdG9w LXJpZ2h0LWFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgKy1mcmluZ2UtdG9wLWxlZnQt YW5nbGUpKQorICAgICAgICAgIChlbXB0eS1saW5lIC4gKy1mcmluZ2UtZW1wdHktbGluZSkKKyAg ICAgICAgICAodW5rbm93biAuICstZnJpbmdlLXF1ZXN0aW9uLW1hcmspKSkKKyAgICAgIChzZXRx IGZyaW5nZS1jdXJzb3ItYWxpc3QgJygoYm94IC4gKy1mcmluZ2UtbGVmdC10cmlhbmdsZSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaG9sbG93IC4gKy1ob2xsb3ctcmVjdGFu Z2xlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChiYXIgLiArLXZlcnRpY2Fs LWJhcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaGJhciAuICstZnJpbmdl LWhvcml6b250YWwtYmFyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChob2xs b3ctc21hbGwgLiArLWZyaW5nZS1ob2xsb3ctc3F1YXJlKSkpCisgICAgICAoaWYgKG9yICstZm9y dGh3aXRoCisgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisg ICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJhdy1mb3J0aHdpdGggJ2Fw cGVuZCAnbG9jYWwpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJh dy1jcm9zc2hhaXJzICdhcHBlbmQgJ2xvY2FsKSkKKyAgICAgICh3aGVuICstZm9ydGh3aXRoCisg ICAgICAgIChhZGQtaG9vayAnd2luZG93LWNvbmZpZ3VyYXRpb24tY2hhbmdlLWhvb2sgJystZHJh dy1mb3J0aHdpdGggbmlsICdsb2NhbCkpCisgICAgICAoYWRkLWhvb2sgJ2NoYW5nZS1tYWpvci1t b2RlLWhvb2sgJ3R1cm4tb2ZmLSstbW9kZSBuaWwgJ2xvY2FsKQorICAgICAgKHdoZW4gKGNhbGxl ZC1pbnRlcmFjdGl2ZWx5LXAgJ2FueSkKKyAgICAgICAgKGNvbmQKKyAgICAgICAgICAoKy1mb3J0 aHdpdGgKKyAgICAgICAgICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScgLS0gRHJhdyBt YXRjaGluZyBwYXJlbnRoZXNlcyBp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pbGwt bG9jYWwtdmFyaWFibGUgJ3RydW5jYXRlLXBhcnRpYWwtd2lkdGgtd2luZG93cykKKyAgICAgIChr aWxsLWxvY2FsLXZhcmlhYmxlICd3b3JkLXdyYXApCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJs ZSAnaW5kaWNhdGUtZW1wdHktbGluZXMpCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnaW5k aWNhdGUtYnVmZmVyLWJvdW5kYXJpZXMpCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnZnJp bmdlLWluZGljYXRvci1hbGlzdCkKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdmcmluZ2Ut Y3Vyc29yLWFsaXN0KQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJytmb3J0aHdpdGgpCisg ICAgICAoZG9saXN0IChzYXZlZCArLS1zYXZlZC1zdGF0ZSkKKyAgICAgICAgKHNldCAobWFrZS1s b2NhbC12YXJpYWJsZSAoY2FyIHNhdmVkKSkgKGNkciBzYXZlZCkpKQorICAgICAgKGtpbGwtbG9j YWwtdmFyaWFibGUgJystLXNhdmVkLXN0YXRlKQorICAgICAgKCstZGVsZXRlLXBhcmVucy1vdmVy bGF5cykKKyAgICAgICh3aGVuIChtZW1xICcrLWRyYXctZm9ydGh3aXRoIHBvc3QtY29tbWFuZC1o b29rKQorICAgICAgICAocmVtb3ZlLWhvb2sgJ3Bvc3QtY29tbWFuZC1ob29rICcrLWRyYXctZm9y dGh3aXRoICdsb2NhbCkpCisgICAgICAod2hlbiAobWVtcSAnKy1kcmF3LWNyb3NzaGFpcnMgcG9z dC1jb21tYW5kLWhvb2spCisgICAgICAgIChyZW1vdmUtaG9vayAncG9zdC1jb21tYW5kLWhvb2sg JystZHJhdy1jcm9zc2hhaXJzICdsb2NhbCkpCisgICAgICAod2hlbiAobWVtcSAnKy1kcmF3LWZv cnRod2l0aCB3aW5kb3ctY29uZmlndXJhdGlvbi1jaGFuZ2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ocG9zMQorICAgICAgICAgICAoY29uZAorICAgICAgICAgICAgICgoYW5kIG9jaGFy CisgICAgICAgICAgICAgICAgICAgKG9yIDs7OyAoY2hhci10by1zdHJpbmcgNDApID0+IG9wZW5p bmcgcGFyZW50aGVzaXMKKyAgICAgICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgNDApCisgICAg ICAgICAgICAgICAgICAgICAgIDs7OyAoY2hhci10by1zdHJpbmcgOTEpID0+IG9wZW5pbmcgc3F1 YXJlIGJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgOTEpCisgICAgICAg ICAgICAgICAgICAgICAgIDs7OyAoY2hhci10by1zdHJpbmcgMTIzKSA9PiBvcGVuaW5nIHdhdnkg YnJhY2tldAorICAgICAgICAgICAgICAgICAgICAgICAoPSBvY2hhciAxMjMpKSkKKyAgICAgICAg ICAgICAgICAobWluICgxKyBvcG9pbnQpIChwb2ludC1tYXgpKSkKKyAgICAgICAgICAgICAoKG9y IDs7OyAoY2hhci10by1zdHJpbmcgNDEpID0+IGNsb3NpbmcgcGFyZW50aGVzaXMKKyAgICAgICAg ICAgICAgICAgICg9IHByZWNlZGluZy1jaGFyIDQxKQorICAgICAgICAgICAgICAgICAgOzs7IChj aGFyLXRvLXN0cmluZyA5MykgPT4gY2xvc2luZyBzcXVhcmUgYnJhY2tldAorICAgICAgICAgICAg ICAgICAgKD0gcHJlY2VkaW5nLWNoYXIgOTMpCisgICAgICAgICAgICAgICAgICA7OzsgKGNoYXIt dG8tc3RyaW5nIDEyNSkgPT4gY2xvc2luZyB3YXZ5IGJyYWNrZXQKKyAgICAgICAgICAgICAgICAg ICg9IHByZWNlZGluZy1jaGFyIDEyNSkpCisgICAgICAgICAgICAgICAgKG1heCAocG9pbnQtbWlu KSAoMS0gb3BvaW50KSkpCisgICAgICAgICAgICAgKHQKKyAgICAgICAgICAgICAgICBvcG9pbnQp KSkKKyAgICAgICAgIHBvczIKKyAgICAgICAgIHNlbGVjdGVkLWZhY2UpCisgICAgKHNhdmUtZXhj dXJzaW9uCisgICAgICAoY29uZGl0aW9uLWNhc2UgbmlsCisgICAgICAgICh3aGlsZSAoc2V0cSBw b3MxIChudGggMSAocGFyc2UtcGFydGlhbC1zZXhwIGZyb20gcG9zMSkpKQorICAgICAgICAgIChz ZXRxIHBvczIgKHNjYW4tc2V4cHMgcG9zMSAxKSkKKyAgICAgICAgICAoaWYgKD0gaSAxMCkKKyAg ICAgICAgICAgIChzZXRxIGkgMSkKKyAgICAgICAgICAgIChzZXRxIGkgKDErIGkpKSkKKyAgICAg ICAgICAoc2V0cSBzZWxlY3RlZC1mYWNlIChjb25kCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICgoPSBpIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFy ZW5zLW9uZS1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSAyKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy10d28tZmFjZSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgMykKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtdGhyZWUtZmFjZSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgKCg9IGkgNCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAnKy1wYXJlbnMtZm91ci1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo KD0gaSA1KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1maXZl LWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDYpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLXNpeC1mYWNlKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA3KQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICcrLXBhcmVucy1zZXZlbi1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAoKD0gaSA4KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBh cmVucy1laWdodC1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA5 KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1uaW5lLWZhY2Up CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDEwKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy10ZW4tZmFjZSkpKQorICAgICAgICAgIChs ZXQgKChvdiAobWFrZS1vdmVybGF5IHBvczEgKDErIHBvczEpKSkpCisgICAgICAgICAgICAodW5s ZXNzICstcGFyZW5zLWluYWN0aXZlLXdpbmRvd3MKKyAgICAgICAgICAgICAgKG92ZXJsYXktcHV0 IG92ICd3aW5kb3cgd2luKSkKKyAgICAgICAgICAgIChvdmVybGF5LXB1dCBvdiAnZmFjZSBzZWxl Y3RlZC1mYWNlKSkKKyAgICAgICAgICAod2hlbiBwb3MyCisgICAgICAgICAgICAobGV0ICgob3Yg KG1ha2Utb3ZlcmxheSAoMS0gcG9zMikgcG9zMikpKQorICAgICAgICAgICAgICAodW5sZXNzICst cGFyZW5zLWluYWN0aXZlLXdpbmRvd3MKKyAgICAgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3Yg J3dpbmRvdyB3aW4pKQorICAgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ2ZhY2Ugc2VsZWN0 ZWQtZmFjZSkpKSkKKyAgICAgICAgKGVycm9yIG5pbCkpKQorICAgIChzZXRxICstcGFyZW5zLW92 ZXJsYXlzLWV4aXN0LXAgdCkpKQorCisoZGVmdW4gKy1yZW1vdmUtb3ZlcmxheXMgKGJlZyBlbmQg bmFtZSB2YWwpCisiUmVtb3ZlIHRoZSBvdmVybGF5cyB0aGF0IGFyZSBgZXF1YWwtaW5jbHVkaW5n LXByb3BlcnRpZXNgLgorSW5jbHVkZXMgYSB1bmlxdWUgc2l0dWF0aW9uIHdoZW4gYW4gb3Zlcmxh eSB3aXRoIGFuIGAnYWZ0ZXItc3RyaW5nYCBwcm9wZXJ0eQoraXMgYXQgdGhlIHZlcnkgZW5kIG9m IGEgbmFycm93ZWQtYnVmZmVyLiIKKyAgKGxldCogKChwb2ludC1tYXggKHBvaW50LW1heCkpCisg ICAgICAgICAocG9pbnQtbWluIChwb2ludC1taW4pKQorICAgICAgICAgKG5hcnJvd2VkLXAgKGJ1 ZmZlci1uYXJyb3dlZC1wKSkKKyAgICAgICAgIChiZWcgKGlmIGJlZyBiZWcgcG9pbnQtbWluKSkK KyAgICAgICAgIChlbmQKKyAgICAgICAgICAgKGNvbmQKKyAgICAgICAgICAgICAoKGFuZAorICAg ICAgICAgICAgICAgICAobm90IG5hcnJvd2VkLXApCisgICAgICAgICAgICAgICAgIGVuZCkKKyAg ICAgICAgICAgICAgIGVuZCkKKyAgICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAo bm90IG5hcnJvd2VkLXApCisgICAgICAgICAgICAgICAgIChudWxsIGVuZCkpCisgICAgICAgICAg ICAgICBwb2ludC1tYXgpCisgICAgICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFy cm93ZWQtcAorICAgICAgICAgICAgICAgICBlbmQKKyAgICAgICAgICAgICAgICAgKDwgZW5kIHBv aW50LW1heCkpCisgICAgICAgICAgICAgICBlbmQpCisgICAgICAgICAgICAgKChhbmQKKyAgICAg ICAgICAgICAgICAgbmFycm93ZWQtcAorICAgICAgICAgICAgICAgICBlbmQKKyAgICAgICAgICAg ICAgICAgKD0gZW5kIHBvaW50LW1heCkpCisgICAgICAgICAgICAgICAoMSsgZW5kKSkKKyAgICAg ICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICBuYXJyb3dlZC1wCisgICAgICAgICAgICAg ICAgIChudWxsIGVuZCkpCisgICAgICAgICAgICAgICAoMSsgcG9pbnQtbWF4KSkgKSkKKyAgICAg ICAgIChvdmVybGF5cworICAgICAgICAgICAocHJvZ24KKyAgICAgICAgICAgICAob3ZlcmxheS1y ZWNlbnRlciBlbmQpCisgICAgICAgICAgICAgKG92ZXJsYXlzLWluIGJlZyBlbmQpKSkpCisgICAg KHdoZW4gKGFuZCBiZWcgZW5kIG5hbWUgdmFsKQorICAgICAgKGRvbGlzdCAobyBvdmVybGF5cykK KyAgICAgICAgKGNvbmQKKyAgICAgICAgICAoKGFuZCAoZXEgbmFtZSAnZmFjZSkKKyAgICAgICAg ICAgICAgICAoZXEgKG92ZXJsYXktZ2V0IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIDs7IEVp dGhlciBwdXNoIHRoaXMgb3ZlcmxheSBvdXRzaWRlIGJlZy4uLmVuZAorICAgICAgICAgICAgOzsg b3Igc3BsaXQgaXQgdG8gZXhjbHVkZSBiZWcuLi5lbmQKKyAgICAgICAgICAgIDs7IG9yIGRlbGV0 ZSBpdCBlbnRpcmVseSAoaWYgaXQgaXMgY29udGFpbmVkIGluIGJlZy4uLmVuZCkuCisgICAgICAg ICAgICAoaWYgKDwgKG92ZXJsYXktc3RhcnQgbykgYmVnKQorICAgICAgICAgICAgICAgIChpZiAo PiAob3ZlcmxheS1lbmQgbykgZW5kKQorICAgICAgICAgICAgICAocHJvZ24KKyAgICAgICAgICAg ICAgICAobW92ZS1vdmVybGF5IChjb3B5LW92ZXJsYXkgbykKKyAgICAgICAgICAgICAgICAgIChv dmVybGF5LXN0YXJ0IG8pIGJlZykKKyAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gZW5k IChvdmVybGF5LWVuZCBvKSkpCisgICAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gKG92 ZXJsYXktc3RhcnQgbykgYmVnKSkKKyAgICAgICAgICAgICAgKGlmICg+IChvdmVybGF5LWVuZCBv KSBlbmQpCisgICAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVu ZCBvKSkKKyAgICAgICAgICAgICAgICAoZGVsZXRlLW92ZXJsYXkgbykpKSkKKyAgICAgICAgICAo KGFuZCAobm90IChlcSBuYW1lICdmYWNlKSkKKyAgICAgICAgICAgICAgICAoZXF1YWwtaW5jbHVk aW5nLXByb3BlcnRpZXMgKG92ZXJsYXktZ2V0IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIChk ZWxldGUtb3ZlcmxheSBvKSkpKSkpKQorCisoZGVmdW4gKy1kZWxldGUtcGFyZW5zLW92ZXJsYXlz ICgpCisgICh3aGVuICstcGFyZW5zLW92ZXJsYXlzLWV4aXN0LXAKKyAgICAoZG9saXN0IChmYWNl ICcoKy1wYXJlbnMtb25lLWZhY2UKKyAgICAgICAgICAgICAgICAgICAgKy1wYXJlbnMtdHdvLWZh Y2UKKyAgICAgICAgICAgICAgICAgICAgKy1wYXJlbnMtdGhyZWUtZmFjZQorICAgICAgICAgICAg ICAgICAgICArLXBhcmVucy1mb3VyLWZhY2UKKyAgICAgICAgICAgICAgICAgICAgKy1wYXJlbnMt Zml2ZS1mYWNlCisgICAgICAgICAgICAgICAgICAgICstcGFyZW5zLXNpeC1mYWNlCisgICAgICAg ICAgICAgICAgICAgICstcGFyZW5zLXNldmVuLWZhY2UKKyAgICAgICAgICAgICAgICAgICAgKy1w YXJlbnMtZWlnaHQtZmFjZQorICAgICAgICAgICAgICAgICAgICArLXBhcmVucy1uaW5lLWZhY2UK KyAgICAgICAgICAgICAgICAgICAgKy1wYXJlbnMtdGVuLWZhY2UpKQorICAgICAgKCstcmVtb3Zl LW92ZXJsYXlzIG5pbCBuaWwgJ2ZhY2UgZmFjZSkpCisgICAgKHNldHEgKy1wYXJlbnMtb3Zlcmxh eXMtZXhpc3QtcCBuaWwpKSkKKworOzs7Ozs7Ozs7Ozs7Ozs7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ICAgKHdoZW4gKGFu ZCBnbG9iYWwtZWxkb2MtbW9kZQorICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZl bHktcCAnYW55KQorICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICco NCkpKQorICAgICAgICAoZ2xvYmFsLWVsZG9jLW1vZGUgLTEpKQorICAgICAgKHdoZW4gKGFuZCBq aXQtbG9jay1jb250ZXh0LXRpbWVyCisgICAgICAgICAgICAgICAgIChjYWxsZWQtaW50ZXJhY3Rp dmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcg Jyg0KSkpCisgICAgICAgICh3aGVuICh0aW1lcnAgaml0LWxvY2stY29udGV4dC10aW1lcikKKyAg ICAgICAgICAoY2FuY2VsLXRpbWVyIGppdC1sb2NrLWNvbnRleHQtdGltZXIpKQorICAgICAgICA7 OyAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIChydW4td2l0aC1pZGxlLXRpbWVyIDUuMCAn cmVwZWF0ICdqaXQtbG9jay1jb250ZXh0LWZvbnRpZnkpKQorICAgICAgICAoc2V0cSBqaXQtbG9j ay1jb250ZXh0LXRpbWVyIG5pbCkpCisgICAgICAod2hlbiAoYW5kIChjYWxsZWQtaW50ZXJhY3Rp dmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcg Jyg0KSkpCisgICAgICAgICh3aGVuICh0aW1lcnAgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnkt dGltZXIpCisgICAgICAgICAgKGNhbmNlbC10aW1lciB1bmRvLWF1dG8tY3VycmVudC1ib3VuZGFy eS10aW1lcikpCisgICAgICAgIChmc2V0ICd1bmRvLWF1dG8tLXVuZG9hYmxlLWNoYW5nZQorICAg ICAgICAgICAgICAobGFtYmRhICgpIChhZGQtdG8tbGlzdCAndW5kby1hdXRvLS11bmRv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SBmb3IgYCstYmFyLXBy ZS16di1mYWNlJy4iCisgIDpncm91cCAnKy1tb2RlKQorCisoZGVmZmFjZSArLWJhci1hdC16di1m YWNlCisgICcoKHQgKDpmb3JlZ3JvdW5kICJ5ZWxsb3ciKSkpCisgICJGYWNlIGZvciBgKy1iYXIt YXQtenYtZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1iYXItcG9zdC16 di1mYWNlCisgICcoKHQgKDpmb3JlZ3JvdW5kICJtYWdlbnRhNCIpKSkKKyAgIkZhY2UgZm9yIGAr LWJhci1wb3N0LXp2LWZhY2UnLiIKKyAgOmdyb3VwICcrLW1vZGUpCisKKyhkZWZmYWNlICstcmV2 ZXJzZWQtYmFyLXByZS16di1mYWNlCisgICcoKHQgKDpmb3JlZ3JvdW5kICJjeWFuMSIpKSkKKyAg IkZhY2UgZm9yIGArLXJldmVyc2VkLWJhci1wcmUtenYtZmFjZScuIgorICA6Z3JvdXAgJystbW9k ZSkKKworKGRlZmZhY2UgKy1yZXZlcnNlZC1iYXItYXQtenYtZmFjZQorICAnKCh0ICg6Zm9yZWdy b3VuZCAiY2hhcnRyZXVzZSIpKSkKKyAgIkZhY2UgZm9yIGArLXJldmVyc2VkLWJhci1hdC16di1m YWNlJy4iCisgIDpncm91cCAnKy1tb2RlKQorCisoZGVmZmFjZSArLXJldmVyc2VkLWJhci1wb3N0 LXp2LWZhY2UKKyAgJygodCAoOmZvcmVncm91bmQgImN5YW40IikpKQorICAiRmFjZSBmb3IgYCst cmV2ZXJzZWQtYmFyLXBvc3QtenYtZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZh Y2UgKy1ldmVuLXByZS16di1mYWNlCisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4 KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgInllbGxvdyIpCisgICAgKCgo Y2xhc3MgY29sb3IpIChtaW4tY29sb3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tY29s b3JzIDgpKQorICAgICA6Zm9yZWdyb3VuZCAid2hpdGUiKQorICAgICgoKHR5cGUgdHR5KSAoY2xh c3MgbW9ubykpCisgICAgIDppbnZlcnNlLXZpZGVvIHQpCisgICAgKHQgOmZvcmVncm91bmQgInBp bmsiKSkKKyAgIkZhY2UgZm9yIGArLWV2ZW4taW5hY3RpdmUtcHJlLXp2LWZhY2UnLiIKKyAgOmdy b3VwICcrLW1vZGUpCisKKyhkZWZmYWNlICstZXZlbi1hdC16di1mYWNlCisgICcoKCgoY2xhc3Mg Y29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91 bmQgIkRlZXBQaW5rMSIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFj a2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJEZWVwUGluazEiKQorICAgICgoKGNs YXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3Jl Z3JvdW5kICJEZWVwUGluazEiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikg KGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3VuZCAiRGVlcFBpbmsxIikKKyAgICAo KChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgOCkpCisgICAgIDpmb3JlZ3JvdW5kICJ3aGl0ZSIp CisgICAgKCgodHlwZSB0dHkpIChjbGFzcyBtb25vKSkKKyAgICAgOmludmVyc2UtdmlkZW8gdCkK KyAgICAodCA6Zm9yZWdyb3VuZCAicGluayIpKQorICAiRmFjZSBmb3IgYCstZXZlbi1hdC16di1m YWNlJy4iCisgIDpncm91cCAnKy1tb2RlKQorCisoZGVmZmFjZSArLWV2ZW4taW5hY3RpdmUtYXQt enYtZmFjZQorICAnKCgoKGNsYXNzIGNvbG9yKSAobWluLWNv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W4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZv cmVncm91bmQgInNpZW5uYTEiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkg KGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3VuZCAiRGFya1NhbG1vbiIpCisgICAg KCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDE2KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAg OmZvcmVncm91bmQgInNpZW5uYTEiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAx NikgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3VuZCAiRGFya1NhbG1vbiIpCisg ICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDgpKQorICAgICA6Zm9yZWdyb3VuZCAid2hp dGUiKQorICAgICgoKHR5cGUgdHR5KSAoY2xhc3MgbW9ubykpCisgICAgIDppbnZlcnNlLXZpZGVv IHQpCisgICAgKHQgOmZvcmVncm91bmQgInBpbmsiKSkKKyAgIkZhY2UgZm9yIGArLW9kZC1wb3N0 LXp2LWZhY2UnLiIKKyAgOmdyb3VwICcrLW1vZGUpCisKKyhkZWZmYWNlICstb2RkLWluYWN0aXZl LXBvc3QtenYtZmFjZQorICAnKCgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tn cm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJzaWVubmE0IikKKyAgICAoKChjbGFzcyBj b2xvcikgKG1pbi1jb2xvcnMgODgpIChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91 bmQgInNpZW5uYTQiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tn cm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJzaWVubmE0IikKKyAgICAoKChjbGFzc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CBMaXNwX09iamVjdCB2YWwpCit7CisgIGItPmZjX3Zpc2libGVfID0gdmFs OworfQorCitzdGF0aWMgdm9pZAorYnNldF9mY19pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3QgYnVm ZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7CisgIGItPmZjX2luYWN0aXZlX3dpbmRvd3NfID0g dmFsOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogc3RhdGljIHZvaWQKIGJzZXRfYWJicmV2X21vZGUgKHN0cnVjdCBidWZmZXIg KmIsIExpc3BfT2JqZWN0IHZhbCkKIHsKQEAgLTUxNDIsNiArNTIwNSwyNCBAQCBpbml0X2J1ZmZl cl9vbmNlICh2b2lkKQogICBic2V0X2xhc3Rfc2VsZWN0ZWRfd2luZG93ICgmYnVmZmVyX2xvY2Fs X2ZsYWdzLCBtYWtlX2ZpeG51bSAoMCkpOwogCiAgIGlkeCA9IDE7CisKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgWFNFVEZBU1RJTlQgKEJW QVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIG1jX3JlYWxfZmFrZV9jdXJzb3IpLCBpZHgpOyArK2lk eDsKKyAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIG1jX2NvbmYpLCBp ZHgpOyArK2lkeDsKKyAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIG1j X2luYWN0aXZlX3dpbmRvd3MpLCBpZHgpOyArK2lkeDsKKyAgWFNFVEZBU1RJTlQgKEJWQVIgKCZi dWZmZ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luZyB0aGUgZmlyc3QgYnVmZmVyISAqLwogCiAgIC8qIHJlYWwgc2V0dXAgaXMg ZG9uZSBpbiBiaW5kaW5ncy5lbCAqLworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyog TVVMVElQTEUtQ1VSU09SUyAqLworCisgIGJzZXRfbWNfcmVhbF9mYWtlX2N1cnNvciAoJmJ1ZmZl cl9kZWZhdWx0cywgUWhvbGxvdyk7CisgIGJzZXRfbWNfY29uZiAoJmJ1ZmZlcl9kZWZhdWx0cywg UW5pbCk7CisgIGJzZXRfbWNfaW5hY3RpdmVfd2luZG93cyAoJmJ1ZmZlcl9kZWZhdWx0cywgUXQp OworICBic2V0X2Nyb3NzaGFpcnMgKCZidWZmZXJfZGVmYXVsdHMsIFFuaWwpOworICBic2V0X2No X2hvcml6b250YWxfcnVsZXIgKCZidWZmZXJfZGVmYXVsdHMsIFF0KTsKKyAgYnNldF9jaF92ZXJ0 aWNhbF9ydWxlciAoJmJ1ZmZlcl9kZWZhdWx0cywgUXQpOworICBic2V0X2NoX2luYWN0aXZlX3dp bmRvd3MgKCZidWZmZXJfZGVmYXVsdHMsIFF0KTsKKyAgYnNldF9mY192aXNpYmxlICgmYnVmZmVy X2RlZmF1bHRzLCBRbmlsKTsKKyAgYnNldF9mY19pbmFjdGl2ZV93aW5kb3dzICgmYnVmZmVyX2Rl ZmF1bHRzLCBRdCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgYnNldF9tb2Rl X2xpbmVfZm9ybWF0ICgmYnVmZmVyX2RlZmF1bHRzLCBidWlsZF9wdXJlX2Nfc3RyaW5nICgiJS0i KSk7CiAgIGJzZXRfaGVhZGVyX2xpbmVfZm9ybWF0ICgmYnVmZmVyX2RlZmF1bHRzLCBR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GUvZGVhY3RpdmF0ZSB0 aGUgY3Jvc3NoYWlycyB2ZXJ0aWNhbCBydWxlci4gKi8pOworCisgIERFRlNZTSAoUWNoX2luYWN0 aXZlX3dpbmRvd3MsICJjaC1pbmFjdGl2ZS13aW5kb3dzIik7CisgIERFRlZBUl9QRVJfQlVGRkVS ICgiY2gtaW5hY3RpdmUtd2luZG93cyIsICZCVkFSIChjdXJyZW50X2J1ZmZlciwgY2hfaW5hY3Rp dmVfd2luZG93cyksIFFuaWwsCisgICAgZG9jOiAvKiBXaGVuIG5vbi1uaWwsIGRyYXcgY3Jvc3No YWlycyBpbiBpbmFjdGl2ZSB3aW5kb3dzLiAqLyk7CisKKyAgREVGU1lNIChRZmNfdmlzaWJsZSwg ImZjLXZpc2libGUiKTsKKyAgREVGVkFSX1BFUl9CVUZGRVIgKCJmYy12aXNpYmxlIiwgJkJWQVIg KGN1cnJlbnRfYnVmZmVyLCBmY192aXNpYmxlKSwgUW5pbCwKKyAgICBkb2M6IC8qIEEgYnVmZXIt bG9jYWwgdmFyaWFibGUgdG8gdHVybiBvbi9vZmYgdGhlIG11bHRpcGxlIGN1cnNvcnMgZmlsbCBj b2x1bW4uICovKTsKKworICBERUZTWU0gKFFmY192aXNpYmxlX2luYWN0aXZlX3dpbmRvdywgImZj LWluYWN0aXZlLXdpbmRvdyIpOworICBERUZWQVJfUEVSX0JVRkZFUiAoImZjLWluYWN0aXZlLXdp bmRvd3MiLCAmQlZBUiAoY3VycmVudF9idWZmZXIsIGZjX2luYWN0aXZlX3dpbmRvd3MpLCBRbmls LAorICAgIGRvYzogLyogV2hlbiBub24tbmlsLCBkcmF3IG11bHRpcGxlIGN1cnNvcnMgZmlsbCBj b2x1bW4gaW4gaW5hY3RpdmUgd2luZG93cy4gKi8pOworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKworCiAgIHN0YXRpY3BybyAoJmx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jp em9udGFsIHJ1bGVyLiAqLworICBMaXNwX09iamVjdCBjaF9ob3Jpem9udGFsX3J1bGVyXzsKKwor ICAvKiBUaGUgbmFtZSBvZiB0aGUgY3Jvc3NoYWlycyB2ZXJ0aWNhbCBydWxlci4gKi8KKyAgTGlz cF9PYmplY3QgY2hfdmVydGljYWxfcnVsZXJfOworCisgIC8qIFdoZXRoZXIgdG8gZHJhdyBjcm9z c2hhaXJzIGluIGluYWN0aXZlIHdpbmRvd3MuICovCisgIExpc3BfT2JqZWN0IGNoX2luYWN0aXZl X3dpbmRvd3NfOworCisgIC8qIFRoZSBuYW1lIG9mIHRoZSBidWZmZXItbG9jYWwgdmFyaWFibGUu ICovCisgIExpc3BfT2JqZWN0IGZjX3Zpc2libGVfOworCisgIC8qIFdoZXRoZXIgdG8gZHJhdyBt dWx0aXBsZSBjdXJzb3JzIGZpbGwgY29sdW1uIGluIGluYWN0aXZlIHdpbmRvd3MuICovCisgIExp c3BfT2JqZWN0IGZjX2luYWN0aXZlX3dpbmRvd3NfOworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKworCiAgIC8qIEN1cnNvciB0eXBlIHRvIGRpc3BsYXkgaW4gbm9uLXNlbGVjdGVkIHdpbmRv d3MuCiAgICAgIHQgbWVhbnMgdG8gdXNlIGhvbGxvdyBib3ggY3Vyc29yLgogICAgICBTZWUgYGN1 cnNvci10eXBlJyBmb3Igb3RoZXIgdmFsdWVzLiAgKi8KQEAgLTc4NywxNCArODIxLDIxIEBAIHN0 cnVjdCBidWZmZXIKICAgICAgYW4gaW5kaXJlY3QgYnVmZmVyIHNpbmNlIGl0IGNvdW50cyBhcyBp dHMgYmFzZSBidWZmZXIuICAqLwogICBpbnQgd2luZG93X2NvdW50OwogCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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ZXNlIGZ1bmN0aW9ucyB0byBzZXQgTGlzcCBmaWVs ZHMgaW4gc3RydWN0CiAgICBidWZmZXIuICAoU29tZSBzZXR0ZXJzIHRoYXQgYXJlIHByaXZhdGUg dG8gYSBzaW5nbGUgLmMgZmlsZSBhcmUKICAgIGRlZmluZWQgYXMgc3RhdGljIGluIHRob3NlIGZp bGVzLikgICovCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBM RS1DVVJTT1JTICovCisKK0lOTElORSB2b2lkCitic2V0X2Jsdl9tY19yZWFsX2Zha2VfY3Vyc29y IChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7CisgIGItPm1jX3JlYWxfZmFr ZV9jdXJzb3JfID0gdmFsOworfQorCitJTkxJTkUgdm9pZAorYnNldF9ibHZfbWNfY29uZiAoc3Ry dWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFsKQoreworICBiLT5tY19jb25mXyA9IHZhbDsK K30KKworSU5MSU5FIHZvaWQKK2JzZXRfYmx2X21jX2luYWN0aXZlX3dpbmRvd3MgKHN0cnVjdCBi dWZmZXIgKmIsIExpc3BfT2JqZWN0IHZhbCkKK3sKKyAgYi0+bWNfaW5hY3RpdmVfd2luZG93c18g PSB2YWw7Cit9CisKK0lOTElORSB2b2lkCitic2V0X2Jsdl9jcm9zc2hhaXJzIChzdHJ1Y3QgYnVm ZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7CisgIGItPmNyb3NzaGFpcnNfID0gdmFsOworfQor CitJTkxJTkUgdm9pZAorYnNldF9ibHZfY2hfaG9yaXpvbnRhbF9ydWxlciAoc3RydWN0IGJ1ZmZl ciAqYiwgTGlzcF9PYmplY3QgdmFsKQoreworICBiLT5jaF9ob3Jpem9udGFsX3J1bGVyXyA9IHZh bDsKK30KKworSU5MSU5FI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maW5lIE5hdGl2ZVJlY3Rh bmdsZSBpbnQKICNlbmRpZgogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4g TVVMVElQTEUtQ1VSU09SUyAqLworCitzdHJ1Y3QgZ2x5cGg7CisKK3N0cnVjdCBnbHlwaF9yb3c7 CisKK3N0cnVjdCBnbHlwaF9tYXRyaXg7CisKK2VudW0gZHJhd19nbHlwaHNfZmFjZTsKKworZW51 bSBnbHlwaF9yb3dfYXJlYTsKKworc3RydWN0IG1jX21hdHJpeDsKKworZW51bSBtY19jYWNoZV90 eXBlOworCitlbnVtIG1jX2N1cnNvcl90eXBlOworCitlbnVtIG1jX2ZsYXZvcjsKKworc3RydWN0 IG1jX1JHQjsKKworc3RydWN0IG1jX2Vzc2VudGlhbHM7CisKK2VudW0gbWNfZnJvbV93aGVyZTsK KworZW51bSBtY19hY3Rpb25fdHlwZTsKKworZW51bSBtY19yb3dfcG9zaXRpb247CisKK2V4dGVy biBMaXNwX09iamVjdCBtY19saXN0biAocHRyZGlmZl90LCBMaXNwX09iamVjdCwgLi4uKTsKKwor ZXh0ZXJuIExpc3BfT2JqZWN0IG1jX250aCAoaW50LCBMaXNwX09iamVjdCk7CisKK2V4dGVybiBM aXNwX09iamVjdCBtY19hc3NxIChMaXNwX09iamVjdCwgTGlzcF9PYmplY3QpOworCitleHRlcm4g ZW51bSBtY19yb3dfcG9zaXRpb24gbWNfcm93X3Bvc2l0aW9uIChzdHJ1Y3QgZ2x5cGhfcm93ICos CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5 cGhfcm93ICosIGludCk7CisKK2V4dGVybiBwdHJkaWZmX3QgbWNfcmVnaW9uX2xpbWl0IChib29s KTsKKworZXh0ZXJuIHN0cnVjdCBnbHlwaCAqIG1jX2dldF9jdXJzb3JfZ2x5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isKK2V4dGVybiBpbnQgbWNfZ2V0X2ZyaW5nZV9iaXRtYXAg KHN0cnVjdCB3aW5kb3cgKiwgTGlzcF9PYmplY3QsIGludCwgaW50KTsKKworZXh0ZXJuIHZvaWQg bWNfZW5naW5lIChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwgc3RydWN0 IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKiwgaW50 LCBpbnQsIGludCwgaW50LCBpbnQsIGludCwKKyAgICAgICAgICAgICAgICAgICAgICAgZW51bSBt Y19jdXJzb3JfdHlwZSwgaW50LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosCisgICAgICAgICAgICAg ICAgICAgICAgIHN0cnVjdCBtY19lc3NlbnRpYWxzLCBlbnVtIG1jX3Jvd19wb3NpdGlvbiwgc3Ry dWN0IG1jX1JHQiwKKyAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19hY3Rpb25fdHlwZSwg Ym9vbCwgZW51bSBtY19mcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1j X2NhY2hlX3R5cGUpOworCitleHRlcm4gdm9pZCBtY19zZXRfZXNzZW50aWFscyAoc3RydWN0IHdp bmRvdyAqLCBzdHJ1Y3QgbWNfZXNzZW50aWFscyAqKTsKKworZXh0ZXJuIHZvaWQgbWNfZHJhd19y b3cgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhf cm93ICosCisgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoICosIGludCwgaW50 LCBpbnQsIGludCwgc3RydWN0IGdseXBoX21hdHJpeCAqLAorICAgICAgICAgICAgICAgICAgICAg ICAgIHN0cnVjdCBtY19lc3NlbnRpYWxzLCBlbnVtIG1jX3Jvd19wb3NpdGlvbiwgYm9vbCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2Zyb21fd2hlcmUpOworCitleHRlcm4gdm9p ZCBtY19yZWRyYXdfcm93IChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwg c3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBpbnQs IGludCwgYm9vbCwgZW51bSBkcmF3X2dseXBoc19mYWNlKTsKKworZXh0ZXJuIHZvaWQgbWNfcmVz ZXRfY2FjaGUgKHN0cnVjdCB3aW5kb3cgKik7CisKK2V4dGVybiB2b2lkIG1jX2RyYXdfY3Vyc29y X2dseXBoIChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICosIGVudW0gZHJhd19n bHlwaHNfZmFjZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQsIGludCwg aW50LCBzdHJ1Y3QgbWNfUkdCLCBlbnVtIG1jX2ZsYXZvciwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlLCBpbnQsIGJvb2wsIGJvb2wpOworCitl eHRlcm4gdm9pZCBtY19lcmFzZV9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBo X21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGludCwgaW50LCBpbnQsIGludCwgZW51bSBtY19mbGF2b3IsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUsIGludCk7CisKK2V4dGVybiB2b2lkIG1j X2RyYXdfZXJhc2VfaHlicmlkIChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXgg Kiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGludCwgaW50LCBpbnQsIGludCwgaW50LCBpbnQsIGludCwgaW50LAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUsIGludCwgc3RydWN0IG1jX1JH QiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sLCBlbnVtIG1jX2ZsYXZv ciwgYm9vbCk7CisKK2V4dGVybiB2b2lkIG1jX3hfd3JpdGVfZ2x5cGhzIChzdHJ1Y3Qgd2luZG93 ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqLCBlbnVtIGdseXBoX3Jvd19hcmVh LCBpbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBpbnQsIHN0cnVjdCBt Y19SR0IsIGVudW0gbWNfZmxhdm9yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVu dW0gbWNfY3Vyc29yX3R5cGUsIGludCwgYm9vbCwgYm9vbCwgYm9vbCk7CisKK2V4dGVybiBzdHJ1 Y3QgZ2x5cGhfbWF0cml4ICogbWNfc2F2ZV9nbHlwaF9tYXRyaXggKHN0cnVjdCBnbHlwaF9tYXRy aXggKik7CisKK2V4dGVybiB2b2lkIG1jX3Jlc3RvcmVfZ2x5cGhfbWF0cml4IChzdHJ1Y3QgZ2x5 cGhfbWF0cml4ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKik7CisKKy8qIGVuZCBNVUxUSVBMRS1D VVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBUZXh0IGN1cnNvciB0 eXBlcy4gICovCiAKIGVudW0gdGV4dF9jdXJzb3Jfa2luZHMKQEAgLTM4Miw2ICs0OTcsMTggQEAg c3RydWN0IGdseXBoX3NsaWNlCiAKIHN0cnVjdCBnbHlwaAogeworCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGludCByZWxhdGl2ZV94LCBo cG9zOworCisgIHB0cmRpZmZfdCBieXRlcG9zOworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiAgIC8qIFBvc2l0aW9uIGZyb20gd2hpY2ggdGhpcyBnbHlwaCB3YXMgZHJhd24uICBJZiBg b2JqZWN0JyBiZWxvdyBpcyBhCiAgICAgIExpc3Agc3RyaW5nLCB0aGlzIGlzIGFuIGluZGV4IGlu dG8gdGhhdCBzdHJpbmcuICBJZiBpdCBpcyBhCiAgICAgIGJ1ZmZlciwgdGhpcyBpcyBhIHBvc2l0 aW9uIGluIHRoYXQgYnVmZmVyLiAgSW4gYWRkaXRpb24sIHNvbWUKQEAgLTEyNDgsNiArMTM3NSwy OCBAQCBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UKIAogc3RydWN0IGdseXBoX3N0cmluZwogeworCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAg Ym9vbF9iZiBsZWZ0X292ZXJ3cml0dGVuX3AgOiAxOworCisgICAgYm9vbF9iZiByaWdodF9vdmVy d3JpdHRlbl9wIDogMTsKKworICAgIGJvb2xfYmYgcmVjdGFuZ2xlX251a2VkX3AgOiAxOworCisg ICAgYm9vbF9iZiBiYWNrZ3JvdW5kX251a2VkX3AgOiAxOworCisgICAgZW51bSBkcmF3X2dseXBo X2FjdGlvbgorICAgIHsKKyAgICAgIE1DX0RSQVdfR0xZUEgsCisgICAgICBNQ19FUkFTRV9HTFlQ SAorICAgIH0gYWN0aW9uX3R5cGU7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAg LyogWC1vcmlnaW4gb2YgdGhlIHN0cmluZy4gICovCiAgIGludCB4OwogCkBAIC0yODEyLDYgKzI5 NjEsMzIgQEAgdHlwZWRlZiB2b2lkICgqZnJhbWVfcGFybV9oYW5kbGVyKSAoc3RydWN0IGZyYW1l ICosIExpc3BfT2JqZWN0LCBMaXNwX09iamVjdCk7CiAKIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJm YWNlCiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JT ICovCisKKy8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgbnN0ZXJtLm1gIFwgYHczMnRlcm0u Y2AgXCBgeHRlcm0uY2AgbXVzdCBiZSBpbiB0aGUKK2V4YWN0IHNhbWUgb3JkZXIgYXMgdGhlIGBy ZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgZGlzcGV4dGVybi5oYCEgKi8KKworICB2b2lkICgqbWNf c2NyaWJlX2dseXBocykgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1h dHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICBzdHJ1Y3QgZ2x5cGggKnN0cmlu ZywgZW51bSBnbHlwaF9yb3dfYXJlYSBhcmVhLCBpbnQgbGVuLCBpbnQgdnBvcywKKyAgICAgICAg aW50IGJvdHRvbV92cG9zLCBzdHJ1Y3Q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igc2V0 dGluZyBmcmFtZSBwYXJhbWV0ZXJzLiAgKi8KICAgZnJhbWVfcGFybV9oYW5kbGVyICpmcmFtZV9w YXJtX2hhbmRsZXJzOwogCmRpZmYgLS1naXQgYS9zcmMvZGlzcG5ldy5jIGIvc3JjL2Rpc3BuZXcu YwppbmRleCBjY2IwOGVjLi5kMTBjODVjIDEwMDY0NAotLS0gYS9zcmMvZGlzcG5ldy5jCisrKyBi L3NyYy9kaXNwbmV3LmMKQEAgLTU2LDYgKzU2LDE4MTYgQEAgYWxvbmcgd2l0aCBHTlUgRW1hY3Mu ICBJZiBub3QsIHNlZSA8aHR0cHM6Ly93d3cuZ251Lm9yZy9saWNlbnNlcy8+LiAgKi8KICNpbmNs dWRlICJ3MzIuaCIKICNlbmRpZgogDAorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyog YmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCisgIHN0cnVjdCBnbHlwaHNfc2tpcHBlZAorICB7 CisgICAgcHRyZGlmZl90IGFsbG9jYXRlZDsKKyAgICBwdHJkaWZmX3QgdXNlZDsKKyAgICBzdHJ1 Y3Qgc2tpcHBlZF9pdGVtcworICAgICAgeworICAgICAgICBpbnQgeDsKKyAgICAgICAgaW50IGhw b3M7CisgICAgICAgIGJvb2wgZW5hYmxlZF9wOworICAgICAgfSAqc2tpcHBlZDsKKyAgfSBhcnJh eV9nbHlwaHNfc2tpcHBlZDsKKworc3RhdGljIGJvb2wgdXBkYXRlX3dpbmRvd19saW5lIChzdHJ1 Y3Qgd2luZG93ICosIGludCwgYm9vbCAqKTsKKworc3RhdGljIHZvaWQgdXBkYXRlX21hcmdpbmFs X2FyZWEgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGVudW0gZ2x5cGhfcm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AgIGludCBib3R0b207CisgICAgICBpZiAoISBNQVRSSVhfUk9X X0VOQUJMRURfUCAoZGVzaXJlZF9tYXRyaXgsIGkpKQorICAgICAgICByZXR1cm4gMDsKKyAgICAg IGJvdHRvbSA9IE1BVFJJWF9ST1dfQk9UVE9NX1kgKE1BVFJJWF9ST1cgKGRlc2lyZWRfbWF0cml4 LCBpKSk7CisgICAgICBpZiAoYm90dG9tIDw9IHliKQorICAgICAgICArK2k7CisgICAgICBpZiAo Ym90dG9tID49IHliKQorICAgICAgICBicmVhazsKKyAgICB9CisgIGxhc3RfbmV3ID0gaTsKKyAg LyogU2V0IGxhc3Rfb2xkIHRvIHRoZSBpbmRleCArIDEgb2YgdGhlIHJvdyB0aGF0IHJlYWNoZXMg dGhlIGJvdHRvbQorICAgICBib3VuZGFyeSBpbiB0aGUgY3VycmVudCBtYXRyaXguICBXZSBkb24n dCBsb29rIGF0IHRoZSBlbmFibGVkCisgICAgIGZsYWcgaGVyZSBiZWNhdXNlIHdlIHBsYW4gdG8g cmV1c2UgcGFydCBvZiB0aGUgZGlzcGxheSBldmVuIGlmCisgICAgIG90aGVyIHBhcnRzIGFyZSBk aXNhYmxlZC4gKi8KKyAgaSA9IGZpcnN0X29sZCArIDE7CisgIHdoaWxlIChpIDwgY3VycmVudF9t YXRyaXgtPm5yb3dzIC0gMSkKKyAgICB7CisgICAgICBpbnQgYm90dG9tID0gTUFUUklYX1JPV19C T1RUT01fWSAoTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIGkpKTsKKyAgICAgIGlmIChib3R0 b20gPD0geWIpCisgICAgICAgICsraTsKKyAgICAgIGlmIChib3R0b20gPj0geWIpCisgICAgICAg IGJyZWFrOworICAgIH0KKyAgbGFzdF9vbGQgPSBpOworICAvKiBTa2lwIG92ZXIgcm93cyBlcXVh bCBhdCB0aGUgYm90dG9tLiAqLworICBpID0gbGFzdF9uZXc7CisgIGogPSBsYXN0X29sZDsKKyAg d2hpbGUgKGkgLSAxID4gZm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1cnJlbnRfbWF0cml4LT5ucm93cyAtIG1jX29sZF9saW5lc19zaXpl LAorICAgICAgICAgICAgICAgICAgICAgICAgIElOVF9NQVgsIHNpemVvZiAqbWNfb2xkX2xpbmVz KTsKKyAgaWYgKGRlc2lyZWRfbWF0cml4LT5ucm93cyA+IG1jX25ld19saW5lc19zaXplKQorICAg IG1jX25ld19saW5lcyA9IHhwYWxsb2MgKG1jX25ld19saW5lcywgJm1jX25ld19saW5lc19zaXpl LAorICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2lyZWRfbWF0cml4LT5ucm93cyAtIG1jX25l d19saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgIElOVF9NQVgsIHNpemVvZiAq bWNfbmV3X2xpbmVzKTsKKyAgbiA9IGRlc2lyZWRfbWF0cml4LT5ucm93czsKKyAgbiArPSBjdXJy ZW50X21hdHJpeC0+bnJvd3M7CisgIGlmIChtY19yb3dfdGFibGVfc2l6ZSA8IDMgKiBuKQorICAg IHsKKyAgICAgIHB0cmRpZmZfdCBzaXplID0gbmV4dF9hbG1vc3RfcHJpbWUgKDMgKiBuKTsKKyAg ICAgIG1jX3Jvd190YWJsZSA9IHhucmVhbGxvYyAobWNfcm93X3RhYmxlLCBzaXplLCBzaXplb2Yg Km1jX3Jvd190YWJsZSk7CisgICAgICBtY19yb3dfdGFibGVfc2l6ZSA9IHNpemU7CisgICAgICBt ZW1zZXQgKG1jX3Jvd190YWJsZSwgMCwgc2l6ZSAqIHNpemVvZiAqbWNfcm93X3RhYmxlKTsKKyAg ICB9CisgIGlmIChuID4gbWNfcm93X2VudHJ5X3Bvb2xfc2l6ZSkKKyAgICBtY19yb3dfZW50cnlf cG9vbCA9IHhwYWxsb2MgKG1jX3Jvd19lbnRyeV9wb29sLCAmbWNfcm93X2VudHJ5X3Bvb2xfc2l6 ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG4gLSBtY19yb3dfZW50cnlfcG9vbF9z aXplLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTEsIHNpemVvZiAqbWNfcm93X2Vu dHJ5X3Bvb2wpOworICBpZiAoZGVzaXJlZF9tYXRyaXgtPm5yb3dzID4gbWNfcnVuc19zaXplKQor ICAgIHsKKyAgICAgIG1jX3J1bnMgPSB4bnJlYWxsb2MgKG1jX3J1bnMsIGRlc2lyZWRfbWF0cml4 LT5ucm93cywgc2l6ZW9mICptY19ydW5zKTsKKyAgICAgIG1jX3J1bl9wb29sID0geG5yZWFsbG9j IChtY19ydW5fcG9vbCwgZGVzaXJlZF9tYXRyaXgtPm5yb3dzLCBzaXplb2YgKm1jX3J1bl9wb29s KTsKKyAgICAgIG1jX3J1bnNfc2l6ZSA9IGRlc2lyZWRfbWF0cml4LT5ucm93czsKKyAgICB9Cisg IG5ydW5zID0gcnVuX2lkeCA9IDA7CisgIG1jX3Jvd19lbnRyeV9pZHggPSAwOworICAvKiBBZGQg cm93cyBmcm9tIHRoZSBjdXJyZW50IGFuZCBkZXNpcmVkIG1hdHJpeCB0byB0aGUgaGFzaCB0YWJs ZQorICAgICByb3dfaGFzaF90YWJsZSB0byBiZSBhYmxlIHRvIGZpbmQgZXF1YWwgb25lcyBxdWlj a2x5LiAqLworICBmb3IgKGkgPSBmaXJzdF9vbGQ7IGkgPCBsYXN0X29sZDsgKytpKQorICAgIHsK KyAgICAgIGlmIChNQVRSSVhfUk9XX0VOQUJMRURfUCAoY3VycmVudF9tYXRyaXgsIGkpKQorICAg ICAgICB7CisgICAgICAgICAgZW50cnkgPSBtY19hZGRfcm93X2VudHJ5IChNQVRSSVhfUk9XIChj dXJyZW50X21hdHJpeCwgaSkpOworICAgICAgICAgIG1jX29sZF9saW5lc1tpXSA9IGVudHJ5Owor ICAgICAgICAgICsrZW50cnktPm9sZF91c2VzOworICAgICAgICB9CisgICAgICBlbHNlCisgICAg ICAgIG1jX29sZF9saW5lc1tpXSA9IE5VTEw7CisgICAgfQorICBmb3IgKGkgPSBmaXJzdF9uZXc7 IGkgPCBsYXN0X25ldzsgKytpKQorICAgIHsKKyAgICAgIGVhc3NlcnQgKE1BVFJJWF9ST1dfRU5B QkxFRF9QIChkZXNpcmVkX21hdHJpeCwgaSkpOworICAgICAgZW50cnkgPSBtY19hZGRfcm93X2Vu dHJ5IChNQVRSSVhfUk9XIChkZXNpcmVkX21hdHJpeCwgaSkpOworICAgICAgKytlbnRyeS0+bmV3 X3VzZXM7CisgICAgICBlbnRyeS0+bmV3X2xpbmVfbnVtYmVyID0gaTsKKyAgICAgIG1jX25ld19s aW5lc1tpXSA9IGVudHJ5OworICAgIH0KKyAgLyogSWRlbnRpZnkgbW92ZXMgYmFzZWQgb24gbGlu ZXMgdGhhdCBhcmUgdW5pcXVlIGFuZCBlcXVhbAorICAgICBpbiBib3RoIG1hdHJpY2VzLiAqLwor ICBmb3IgKGkgPSBmaXJzdF9vbGQ7IGkgPCBsYXN0X29sZDspCisgICAgaWYgKG1jX29sZF9saW5l c1tpXQorICAgICAgICAmJiBtY19vbGRfbGluZXNbaV0tPm9sZF91c2VzID09IDEKKyAgICAgICAg JiYgbWNfb2xkX2xpbmVzW2ldLT5uZXdfdXNlcyA9PSAxKQorICAgICAgeworICAgICAgICBpbnQg cCwgcTsKKyAgICAgICAgaW50IG5ld19saW5lID0gbWNfb2xkX2xpbmVzW2ldLT5uZXdfbGluZV9u dW1iZXI7CisgICAgICAgIHN0cnVjdCBydW4gKnJ1biA9IG1jX3J1bl9wb29sICsgcnVuX2lkeCsr OworICAgICAgICAvKiBSZWNvcmQgbW92ZS4gKi8KKyAgICAgICAgcnVuLT5jdXJyZW50X3Zwb3Mg PSBpOworICAgICAgICBydW4tPmN1cnJlbnRfeSA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4 LCBpKS0+eTsKKyAgICAgICAgcnVuLT5kZXNpcmVkX3Zwb3MgPSBuZXdfbGluZTsKKyAgICAgICAg cnVuLT5kZXNpcmVkX3kgPSBNQVRSSVhfUk9XIChkZXNpcmVkX21hdHJpeCwgbmV3X2xpbmUpLT55 OworICAgICAgICBydW4tPm5yb3dzID0gMTsKKyAgICAgICAgcnVuLT5oZWlnaHQgPSBNQVRSSVhf Uk9XIChjdXJyZW50X21hdHJpeCwgaSktPmhlaWdodDsKKyAgICAgICAgLyogRXh0ZW5kIGJhY2t3 YXJkLiAqLworICAgICAgICBwID0gaSAtIDE7CisgICAgICAgIHEgPSBuZXdfbGluZSAtIDE7Cisg ICAgICAgIHdoaWxlIChwID4gZmlyc3Rfb2xkCisgICAgICAgICAgICAgICAmJiBxID4gZmlyc3Rf bmV3CisgICAgICAgICAgICAgICAmJiBtY19vbGRfbGluZXNbcF0gPT0gbWNfbmV3X2xpbmVzW3Fd KQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGludCBoID0gTUFUUklYX1JPVyAoY3VycmVudF9t YXRyaXgsIHApLT5oZWlnaHQ7CisgICAgICAgICAgICAtLXJ1bi0+Y3VycmVudF92cG9zOworICAg ICAgICAgICAgLS1ydW4tPmRlc2lyZWRfdnBvczsKKyAgICAgICAgICAgICsrcnVuLT5ucm93czsK KyAgICAgICAgICAgIHJ1bi0+aGVpZ2h0ICs9IGg7CisgICAgICAgICAgICBydW4tPmRlc2lyZWRf eSAtPSBoOworICAgICAgICAgICAgcnVuLT5jdXJyZW50X3kgLT0gaDsKKyAgICAgICAgICAgIC0t cCwgLS1xOworICAgICAgICAgIH0KKyAgICAgICAgLyogRXh0ZW5kIGZvcndhcmQuICovCisgICAg ICAgIHAgPSBpICsgMTsKKyAgICAgICAgcSA9IG5ld19saW5lICsgMTsKKyAgICAgICAgd2hpbGUg KHAgPCBsYXN0X29sZAorICAgICAgICAgICAgICAgJiYgcSA8IGxhc3RfbmV3CisgICAgICAgICAg ICAgICAmJiBtY19vbGRfbGluZXNbcF0gPT0gbWNfbmV3X2xpbmVzW3FdKQorICAgICAgICAgIHsK KyAgICAgICAgICAgIGludCBoID0gTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIHApLT5oZWln aHQ7CisgICAgICAgICAgICArK3J1bi0+bnJvd3M7CisgICAgICAgICAgICBydW4tPmhlaWdodCAr PSBoOworICAgICAgICAgICAgKytwLCArK3E7CisgICAgICAgICAgfQorICAgICAgICAvKiBJbnNl cnQgcnVuIGludG8gbGlzdCBvZiBhbGwgcnVucy4gIE9yZGVyIHJ1bnMgYnkgY29waWVkCisgICAg ICAgICAgIHBpeGVsIGxpbmVzLiAgTm90ZSB0aGF0IHdlIHJlY29yZCBydW5zIHRoYXQgZG9uJ3Qg aGF2ZSB0bworICAgICAgICAgICBiZSBjb3BpZWQgYmVjYXVzZSB0aGV5IGFyZSBhbHJlYWR5IGlu IHBsYWNlLiAgVGhpcyBpcyBkb25lCisgICAgICAgICAgIGJlY2F1c2Ugd2UgY2FuIGF2b2lkIGNh bGxpbmcgdXBkYXRlX3dpbmRvd19saW5lIGluIHRoaXMKKyAgICAgICAgICAgY2FzZS4gKi8KKyAg ICAgICAgZm9yIChwID0gMDsgcCA8IG5ydW5zICYmIG1jX3J1bnNbcF0tPmhlaWdodCA+IHJ1bi0+ aGVpZ2h0OyArK3ApCisgICAgICAgICAgOworICAgICAgICBmb3IgKHEgPSBucnVuczsgcSA+IHA7 IC0tcSkKKyAgICAgICAgICBtY19ydW5zW3FdID0gbWNfcnVuc1txIC0gMV07CisgICAgICAgIG1j X3J1bnNbcF0gPSBydW47CisgICAgICAgICsrbnJ1bnM7CisgICAgICAgIGkgKz0gcnVuLT5ucm93 czsKKyAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgICAgKytpOworICAvKiBEbyB0aGUgbW92ZXMu ICBEbyBpdCBpbiBhIHdheSB0aGF0IHdlIGRvbid0IG92ZXJ3cml0ZSBzb21ldGhpbmcKKyAgICAg d2Ugd2FudCB0byBjb3B5IGxhdGVyIG9uLiAgVGhpcyBpcyBub3Qgc29sdmFibGUgaW4gZ2VuZXJh bAorICAgICBiZWNhdXNlIHRoZXJlIGlzIG9ubHkgb25lIGRpc3BsYXkgYW5kIHdlIGRvbid0IGhh dmUgYSB3YXkgdG8KKyAgICAgZXhjaGFuZ2UgYXJlYXMgb24gdGhpcyBkaXNwbGF5LiAgRXhhbXBs ZToKKyAgICAgICAgICArLS0tLS0tLS0tLS0rICAgICAgICstLS0tLS0tLS0tLSsKKyAgICAgICAg ICB8ICAgICBBICAgICB8ICAgICAgIHwgICAgIEIgICAgIHwKKyAgICAgICAgICArLS0tLS0tLS0t LS0rICAtLT4gICstLS0tLS0tLS0tLSsKKyAgICAgICAgICB8ICAgICBCICAgICB8ICAgICAgIHwg ICAgIEEgICAgIHwKKyAgICAgICAgICArLS0tLS0tLS0tLS0rICAgICAgICstLS0tLS0tLS0tLSsK KyAgICAgSW5zdGVhZCwgcHJlZmVyIGJpZ2dlciBtb3ZlcywgYW5kIGludmFsaWRhdGUgbW92ZXMg dGhhdCB3b3VsZAorICAgICBjb3B5IGZyb20gd2hlcmUgd2UgY29waWVkIHRvLiAqLworICBmb3Ig KGkgPSAwOyBpIDwgbnJ1bnM7ICsraSkKKyAgICBpZiAobWNfcnVuc1tpXS0+bnJvd3MgPiAwKQor ICAgICAgeworICAgICAgICBzdHJ1Y3QgcnVuICpyID0gbWNfcnVuc1tpXTsKKyAgICAgICAgaWYg KHItPmN1cnJlbnRfeSAhPSByLT5kZXNpcmVkX3kpCisgICAgICAgICAgeworICAgICAgICAgICAg Ly8gIGZwcmludGYgKHN0ZGVyciwgIiVzOiAgci0+Y3VycmVudC9kZXNpcmVkX3Zwb3MgKCVkLyVk KSB8IHItPmN1cnJlbnQvZGVzaXJlZF95ICglZC8lZClcbiIsCisgICAgICAgICAgICAvLyAgICAg ICAgICAgci0+Y3VycmVudF95IDwgci0+ZGVzaXJlZF95ID8gIuKGkyIgOiAi4oaRIiwKKyAgICAg ICAgICAgIC8vICAgICAgICAgICByLT5jdXJyZW50X3Zwb3MsIHItPmRlc2lyZWRfdnBvcywgci0+ Y3VycmVudF95LCByLT5kZXNpcmVkX3kpOworICAgICAgICAgICAgLy8gIHJpZi0+Y2xlYXJfd2lu ZG93X21vdXNlX2ZhY2UgKHcpOworICAgICAgICAgICAgLy8gIHJpZi0+c2Nyb2xsX3J1bl9ob29r ICh3LCByKTsKKyAgICAgICAgICB9CisgICAgICAgIC8qIFRydW5jYXRlIHJ1bnMgdGhhdCBjb3B5 IHRvIHdoZXJlIHdlIGNvcGllZCB0bywgYW5kCisgICAgICAgICAgIGludmFsaWRhdGUgcnVucyB0 aGF0IGNvcHkgZnJvbSB3aGVyZSB3ZSBjb3BpZWQgdG8uICovCisgICAgICAgIGZvciAoaiA9IG5y dW5zIC0gMTsgaiA+IGk7IC0taikKKyAgICAgICAgICB7CisgICAgICAgICAgICBzdHJ1Y3QgcnVu ICpwID0gbWNfcnVuc1tqXTsKKyAgICAgICAgICAgIGJvb2wgdHJ1bmNhdGVkX3AgPSAwOworICAg ICAgICAgICAgaWYgKHAtPm5yb3dzID4gMAorICAgICAgICAgICAgICAgICYmIHAtPmRlc2lyZWRf eSA8IHItPmRlc2lyZWRfeSArIHItPmhlaWdodAorICAgICAgICAgICAgICAgICYmIHAtPmRlc2ly ZWRfeSArIHAtPmhlaWdodCA+IHItPmRlc2lyZWRfeSkKKyAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgIGlmIChwLT5kZXNpcmVkX3kgPCByLT5kZXNpcmVkX3kpCisgICAgICAgICAgICAg ICAgICB7CisgICAgICAgICAgICAgICAgICAgIHAtPm5yb3dzID0gci0+ZGVzaXJlZF92cG9zIC0g cC0+ZGVzaXJlZF92cG9zOworICAgICAgICAgICAgICAgICAgICBwLT5oZWlnaHQgPSByLT5kZXNp cmVkX3kgLSBwLT5kZXNpcmVkX3k7CisgICAgICAgICAgICAgICAgICAgIHRydW5jYXRlZF9wID0g MTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGludCBucm93c19jb3BpZWQgPSAoci0+ZGVz aXJlZF92cG9zICsgci0+bnJvd3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAtIHAtPmRlc2lyZWRfdnBvcyk7CisgICAgICAgICAgICAgICAgICAgIGlmIChwLT5ucm93 cyA8PSBucm93c19jb3BpZWQpCisgICAgICAgICAgICAgICAgICAgICAgcC0+bnJvd3MgPSAwOwor ICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgaW50IGhlaWdodF9jb3BpZWQgPSAoci0+ZGVzaXJlZF95 ICsgci0+aGVpZ2h0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIC0gcC0+ZGVzaXJlZF95KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcC0+Y3VycmVu dF92cG9zICs9IG5yb3dzX2NvcGllZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcC0+ZGVz aXJlZF92cG9zICs9IG5yb3dzX2NvcGllZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcC0+ bnJvd3MgLT0gbnJvd3NfY29waWVkOworICAgICAgICAgICAgICAgICAgICAgICAgICBwLT5jdXJy ZW50X3kgKz0gaGVpZ2h0X2NvcGllZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcC0+ZGVz aXJlZF95ICs9IGhlaWdodF9jb3BpZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmhl aWdodCAtPSBoZWlnaHRfY29waWVkOworICAgICAgICAgICAgICAgICAgICAgICAgICB0cnVuY2F0 ZWRfcCA9IDE7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChyLT5jdXJyZW50X3kgIT0gci0+ZGVz aXJlZF95CisgICAgICAgICAgICAgICAgLyogVGhlIGNvbmRpdGlvbiBiZWxvdyBpcyBlcXVpdmFs ZW50IHRvCisgICAgICAgICAgICAgICAgICAgKChwLT5jdXJyZW50X3kgPj0gci0+ZGVzaXJlZF95 CisgICAgICAgICAgICAgICAgICAgICAmJiBwLT5jdXJyZW50X3kgPCByLT5kZXNpcmVkX3kgKyBy LT5oZWlnaHQpCisgICAgICAgICAgICAgICAgICAgIHx8IChwLT5jdXJyZW50X3kgKyBwLT5oZWln aHQgPiByLT5kZXNpcmVkX3kKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIChwLT5jdXJyZW50 X3kgKyBwLT5oZWlnaHQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8PSByLT5kZXNpcmVk X3kgKyByLT5oZWlnaHQpKSkKKyAgICAgICAgICAgICAgICAgICBiZWNhdXNlIHdlIGhhdmUgMCA8 IHAtPmhlaWdodCA8PSByLT5oZWlnaHQuICovCisgICAgICAgICAgICAgICAgJiYgcC0+Y3VycmVu dF95IDwgci0+ZGVzaXJlZF95ICsgci0+aGVpZ2h0CisgICAgICAgICAgICAgICAgJiYgcC0+Y3Vy cmVudF95ICsgcC0+aGVpZ2h0ID4gci0+ZGVzaXJlZF95KQorICAgICAgICAgICAgICBwLT5ucm93 cyA9IDA7CisgICAgICAgICAgICAvKiBSZW9yZGVyIHJ1bnMgYnkgY29waWVkIHBpeGVsIGxpbmVz IGlmIHRydW5jYXRlZC4gKi8KKyAgICAgICAgICAgIGlmICh0cnVuY2F0ZWRfcCAmJiBwLT5ucm93 cyA+IDApCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpbnQgayA9IG5ydW5zIC0g MTsKKyAgICAgICAgICAgICAgICB3aGlsZSAobWNfcnVuc1trXS0+bnJvd3MgPT0gMCB8fCBtY19y dW5zW2tdLT5oZWlnaHQgPCBwLT5oZWlnaHQpCisgICAgICAgICAgICAgICAgICBrLS07CisgICAg ICAgICAgICAgICAgbWVtbW92ZSAobWNfcnVucyArIGosIG1jX3J1bnMgKyBq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BNQVRSSVhfUk9XX1NUQVJUX0JZVEVQT1MgKGN1cnJlbnRfcm93IC0gMSkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAtMTsKKyAgaW50IHByZXZfbWF0cml4X3Jvd19l bmRfYnl0ZXBvcyA9ICh2cG9zICE9IDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IE1BVFJJWF9ST1dfRU5EX0JZVEVQT1MgKGN1cnJlbnRfcm93IC0gMSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogLTE7CisgIGludCBtYXRyaXhfcm93X3N0YXJ0 X2J5dGVwb3MgPSBNQVRSSVhfUk9XX1NUQVJUX0JZVEVQT1MgKGRlc2lyZWRfcm93KTsKKyAgaW50 IG1hdHJpeF9yb3dfZW5kX2J5dGVwb3MgPSBNQVRSSVhfUk9XX0VORF9CWVRFUE9TIChkZXNpcmVk X3Jvdyk7CisgIC8qIFRoaXMgdGVzdHMgZm9yIGEgc29saXRhcnkgcm93IGNvbnRhaW5pbmcgWlYs IHByZWNlZGVkIGJ5IGEgcm93IGNvbnRhaW5pbmcgYQorICBwZW51bHRpbWF0ZSBnbHlwaCB3aXRo IGEgY2hhcnBvcyBvZiBaViAtIDEgZm9sbG93ZWQgYnkgYW4gZW5kIG9mIHJvdyBzcGFjZQorICBn bHlwaCB3aXRoIGEgY2hhcnBvcyBvZiAwLiAqLworICBib29sIHJvd19hdF96dl9wID0gKHZwb3Mg IT0gMAorICAgICAgICAgICAgICAgICAgICAgICYmIChjdXJyZW50X3JvdyAtIDEpLT51c2VkW1RF WFRfQVJFQV0gPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgcHJldl9tYXRyaXhfcm93X3N0 YXJ0X2J5dGVwb3MgIT0gcHJldl9tYXRyaXhfcm93X2VuZF9ieXRlcG9zCisgICAgICAgICAgICAg ICAgICAgICAgJiYgIShjdXJyZW50X3JvdyAtIDEpLT5lbmRzX2F0X3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UklYX0JPVFRPTV9URVhUX1JP VyAoZGVzaXJlZF9tYXRyaXgsIHcpOworICBpbnQgYm90dG9tX3Zwb3MgPSBNQVRSSVhfUk9XX1ZQ T1MgKGJvdHRvbV9yb3csIGRlc2lyZWRfbWF0cml4KTsKKyAgaWYgKGRlYnVnX3AKKyAgICAgICYm IHZwb3MgIT0gYm90dG9tX3Zwb3MpCisgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfdXBkYXRlX3Rl eHRfYXJlYSAoJXMpOiAgY3VycmVudC9ib3R0b21fdnBvcyAoJWQvJWQpXG4iLAorICAgICAgICAg ICAgICAgICAgICAgIG1jX3dpbmRvdyAodyksIHZwb3MsIGJvdHRvbV92cG9zKTsKKyAgLyogSW5h c211Y2ggYXMgd2UgcHJvY2VzcyB0aGUgY3Vyc29yIHJvdyBiZWZvcmUgYWxsIG90aGVyIHJvd3Ms IHdlIGNhbiByZWx5CisgIHVwb24gdGhlIHByZXZpb3VzIGBkZXNpcmVkX3Jvd2AgdG8gYmUgYWNj dXJhdGUuICovCisgIGVudW0gbWNfcm93X3Bvc2l0aW9uIHJvd19wb3NpdGlvbiA9ICBtY19yb3df cG9zaXRpb24gKHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGRlc2lyZWRfcm93CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBjdXJy ZW50X3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgZGVzaXJlZF9yb3csIHZwb3MpOworICAvKiBJZiByb3dzIGFyZSBhdCBkaWZmZXJl bnQgWCBvciBZLCBvciByb3dzIGhhdmUgZGlmZmVyZW50IGhlaWdodCwKKyAgICAgb3IgdGhlIGN1 cnJlbnQgcm93IGlzIG1hcmtlZCBpbnZhbGlkLC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VyIGJvbGQgc28gdGhhdCBpdCBvdmVy bGFwcyB0aGUgYCAnIHRvIGl0cyByaWdodC4KKyAgICAgICBJZiB0aGUgZGVzaXJlZCByb3cgaXMg YCAnLCB3ZSB3b3VsZCBza2lwIG92ZXIgdGhlIHNwYWNlCisgICAgICAgYWZ0ZXIgdGhlIGBpZicg YW5kIHRoZXJlIHdvdWxkIHJlbWFpbiBhIHBpeGVsIGZyb20gdGhlCisgICAgICAgYGYnIG9uIHRo ZSBzY3JlZW4uICovCisgICAgaWYgKG92ZXJsYXBwaW5nX2dseXBoc19wICYmIGkgPiAwKQorICAg ICAgeworICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoID0gJmN1cnJlbnRfcm93LT5nbHlwaHNb VEVYVF9BUkVBXVtpIC0gMV07CisgICAgICAgIGludCBsZWZ0LCByaWdodDsKKyAgICAgICAgcmlm LT5nZXRfZ2x5cGhfb3ZlcmhhbmdzIChnbHlwaCwgWEZSQU1FICh3LT5mcmFtZSksICZsZWZ0LCAm cmlnaHQpOworICAgICAgICBjYW5fc2tpcF9wID0gKHJpZ2h0ID09IDAgJiYgIWFib3J0X3NraXBw aW5nKTsKKyAgICAgIH0KKworICAgIGlmIChjYW5fc2tpcF9wKQorICAgICAgeworICAgICAgICBp bnQgc3RhcnRfaHBvcyA9IGk7CisKKyAgICAgICAgd2hpbGUgKGkgPCBzdG9wCisgICAgICAgICAg ICAgICAmJiBHTFlQSF9FUVVBTF9QIChkZXNpcmVkX2dseXBoLCBjdXJyZW50X2dseXBoKSkKKyAg ICAgICAgICB7CisgICAgICAgICAgICArK2FycmF5X2dseXBoc19za2lwcGVkLnVzZWQ7CisgICAg ICAgICAgICBpZiAoYXJyYXlfZ2x5cGhzX3NraXBwZWQuYWxsb2NhdGVkIDwgYXJyYXlfZ2x5cGhz X3NraXBwZWQudXNlZCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGludCBvbGRf YWxsb2MgPSBhcnJheV9nbHlwaHNfc2tpcHBlZC5hbGxvY2F0ZWQ7CisgICAgICAgICAgICAgICAg aW50IG5ld19lbHRzID0gYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZCAtIGFycmF5X2dseXBoc19z a2lwcGVkLmFsbG9jYXRlZDsKKyAgICAgICAgICAgICAgICBhcnJheV9nbHlwaHNfc2tpcHBlZC5z a2lwcGVkID0KKyAgICAgICAgICAgICAgICAgIHhwYWxsb2MgKGFycmF5X2dseXBoc19za2lwcGVk LnNraXBwZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmYXJyYXlfZ2x5cGhzX3NraXBw ZWQuYWxsb2NhdGVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2VsdHMsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICBJTlRfTUFYLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgc2l6ZW9mICphcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVkKTsKKyAgICAgICAgICAgICAg ICBtZW1zZXQgKGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWQgKyBvbGRfYWxsb2MsIDAsCisg ICAgICAgICAgICAgICAgICAgICAgICAgKGFycmF5X2dseXBoc19za2lwcGVkLmFsbG9jYXRlZCAt IG9sZF9hbGxvYykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICogc2l6ZW9mICphcnJheV9n bHlwaHNfc2tpcHBlZC5za2lwcGVkKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgaW50 IG50aCA9IGFycmF5X2dseXBoc19za2lwcGVkLnVzZWQgLSAxOworICAgICAgICAgICAgYXJyYXlf Z2x5cGhzX3NraXBwZWQuc2tpcHBlZFtudGhdLnggPSB4OworICAgICAgICAgICAgYXJyYXlfZ2x5 cGhzX3NraXBwZWQuc2tpcHBlZFtudGhdLmhwb3MgPSBpOworICAgICAgICAgICAgYXJyYXlfZ2x5 cGhzX3NraXBwZWQuc2tpcHBlZFtudGhdLmVuYWJsZWRfcCA9IHRydWU7CisgICAgICAgICAgICB4 ICs9IGRlc2lyZWRfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgKytkZXNpcmVkX2ds eXBoLCArK2N1cnJlbnRfZ2x5cGgsICsraTsKKyAgICAgICAgICB9CisKKyAgICAgICAgLyogQ29u c2lkZXIgdGhlIGNhc2UgdGhhdCB0aGUgY3VycmVudCByb3cgY29udGFpbnMgInh4eAorICAgICBw cHAgZ2dnIiBpbiBpdGFsaWMgQ291cmllciBmb250LCBhbmQgdGhlIGRlc2lyZWQgcm93CisgICAg IGlzICJ4eHggZ2dnIi4gIFRoZSBjaGFyYWN0ZXIgYHAnIGhhcyBsYmVhcmluZywgYGcnCisgICAg IGhhcyBub3QuICBUaGUgbG9vcCBhYm92ZSB3aWxsIHN0b3AgaW4gZnJvbnQgb2YgdGhlCisgICAg IGZpcnN0IGBwJyBpbiB0aGUgY3VycmVudCByb3cuICBJZiB3ZSB3b3VsZCBzdGFydAorICAgICB3 cml0aW5nIGdseXBocyB0aGVyZSwgd2Ugd291bGRuJ3QgZXJhc2UgdGhlIGxiZWFyaW5nCisgICAg IG9mIHRoZSBgcCcuICBUaGUgcmVzdCBvZiB0aGUgbGJlYXJpbmcgcHJvYmxlbSBpcyB0aGVuCisg ICAgIHRha2VuIGNhcmUgb2YgYnkgZHJhd19nbHlwaHMuICovCisgICAgICAgIGlmIChvdmVybGFw cGluZ19nbHlwaHNfcAorICAgICAgICAgICAgJiYgaSA+IDAKKyAgICAgICAgICAgICYmIGkgPCBj dXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAmJiAoY3VycmVudF9yb3ct PnVzZWRbVEVYVF9BUkVBXSAhPSBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdKSkKKyAgICAg ICAgICB7CisgICAgICAgICAgICBpbnQgbGVmdCwgcmlnaHQ7CisgICAgICAgICAgICByaWYtPmdl dF9nbHlwaF9vdmVyaGFuZ3MgKGN1cnJlbnRfZ2x5cGgsCisgICAgICAgICAgICAgICAgICAgIFhG UkFNRSAody0+ZnJhbWUpLAorICAgICAgICAgICAgICAgICAgICAmbGVmdCwgJnJpZ2h0KTsKKyAg ICAgICAgICAgIHdoaWxlIChsZWZ0ID4gMCAmJiBpID4gMCkKKyAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgIC0taSwgLS1kZXNpcmVkX2dseXBoLCAtLWN1cnJlbnRfZ2x5cGg7CisgICAg ICAgICAgICAgICAgeCAtPSBkZXNpcmVkX2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAg ICAgICBsZWZ0IC09IGRlc2lyZWRfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAvKiBBYm9ydCB0aGUgc2tpcHBpbmcgYWxnb3JpdGhtIGlmIHdlIGVuZCB1 cCBiZWZvcmUKKyAgICAgICAgICAgICAgIG91ciBzdGFydGluZyBwb2ludCwgdG8gYXZvaWQgbG9v cGluZyAoYnVnIzEwNzApLgorICAgICAgICAgICAgICAgVGhpcyBjYW4gaGFwcGVuIHdoZW4gdGhl IGxiZWFyaW5nIGlzIGxhcmdlciB0aGFuCisgICAgICAgICAgICAgICB0aGUgcGl4ZWwgd2lkdGgu ICovCisgICAgICAgICAgICBhYm9ydF9za2lwcGluZyA9IChpIDwgc3RhcnRfaHBvcyk7CisgICAg ICAgICAgfQorICAgICAgfQorCisgICAgLyogVHJ5IHRvIGF2b2lkIHdyaXRpbmcgdGhlIGVudGly ZSByZXN0IG9mIHRoZSBkZXNpcmVkIHJvdworICAgICAgIGJ5IGxvb2tpbmcgZm9yIGEgcmVzeW5j IHBvaW50LiAgVGhpcyBtYWlubHkgcHJldmVudHMKKyAgICAgICBtb2RlIGxpbmUgZmxpY2tlcmlu ZyBpbiB0aGUgY2FzZSB0aGUgbW9kZSBsaW5lIGlzIGluCisgICAgICAgZml4ZWQtcGl0Y2ggZm9u dCwgd2hpY2ggaXQgdXN1YWxseSB3aWxsIGJlLiAqLworICAgIGlmIChpIDwgZGVzaXJlZF9yb3ct PnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgIHsKKyAgICAgICAgaW50IHN0YXJ0X3ggPSB4LCBzdGFy dF9ocG9zID0gaTsKKyAgICAgICAgc3RydWN0IGdseXBoICpzdGFydCA9IGRlc2lyZWRfZ2x5cGg7 CisgICAgICAgIGludCBjdXJyZW50X3ggPSB4OworICAgICAgICBib29sIHNraXBfZmlyc3RfcCA9 ICFjYW5fc2tpcF9wOworICAgICAgICAvKiBGaW5kIHRoZSBuZXh0IGdseXBoIHRoYXQncyBlcXVh bCBhZ2Fpbi4gKi8KKyAgICAgICAgd2hpbGUgKGkgPCBzdG9wCisgICAgICAgICAgICAgICAmJiAo c2tpcF9maXJzdF9wCisgICAgICAgICAgICAgICAgICAgfHwgIUdMWVBIX0VRVUFMX1AgKGRlc2ly ZWRfZ2x5cGgsIGN1cnJlbnRfZ2x5cGgpKQorICAgICAgICAgICAgICAgJiYgeCA9PSBjdXJyZW50 X3gpCisgICAgICAgICAgeworICAgICAgICAgICAgeCArPSBkZXNpcmVkX2dseXBoLT5waXhlbF93 aWR0aDsKKyAgICAgICAgICAgIGN1cnJlbnRfeCArPSBjdXJyZW50X2dseXBoLT5waXhlbF93aWR0 aDsKKyAgICAgICAgICAgICsrZGVzaXJlZF9nbHlwaCwgKytjdXJyZW50X2dseXBoLCArK2k7Cisg ICAgICAgICAgICBza2lwX2ZpcnN0X3AgPSAwOworICAgICAgICAgIH0KKworICBmb3IgKGludCBl bHQgPSAwOworICAgICAgIGVsdCA8IGFycmF5X2dseXBoc19za2lwcGVkLnVzZWQKKyAgICAgICAm JiB2cG9zICE9IGJvdHRvbV92cG9zOworICAgICAgICsrZWx0KQorICAgIHsKKyAgICAgIGludCB4 ID0gYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZFtlbHRdLng7CisgICAgICBpbnQgaHBvcyA9 IGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbZWx0XS5ocG9zOworICAgICAgc3RydWN0IGds eXBoICp0YXJnZXRfZ2x5cGggPQorICAgICAgICBtY19nZXRfY3Vyc29yX2dseXBoICh3LCBkZXNp cmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIGhwb3MsIHZwb3MpOworICAgICAgaWYgKGRlYnVnX3Ap CisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIlNLSVBQRUQ6ICB2cG9zICglZCkgfCBjaGFyICgl ZC8lcykgfCB4OiAoJWQpIHwgaHBvcyAoJWQvJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAg ICAgIHZwb3MsIHRhcmdldF9nbHlwaC0+dS5jaCwgbWNfY2hhcl90b19zdHJpbmcgKHRhcmdldF9n bHlwaC0+dS5jaCksCisgICAgICAgICAgICAgICAgICAgICAgICAgeCwgaHBvcywgdXBkYXRlZF9y b3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpOworICAgICAgbWNfZHJhd19yb3cgKHcsIGRlc2lyZWRf bWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBoLCB4LCAxLCB2cG9zLAorICAgICAgICAg ICAgICAgICAgIGJvdHRvbV92cG9zLCBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCByb3dfcG9z aXRpb24sIGRyYXdfcCwgU0tJUFBFRCk7CisgICAgfQorCisgICAgICAgIGlmIChpID09IHN0YXJ0 X2hwb3MgfHwgeCAhPSBjdXJyZW50X3gpCisgICAgICAgICAgeworICAgICAgICAgICAgaSA9IHN0 YXJ0X2hwb3M7CisgICAgICAgICAgICB4ID0gc3RhcnRfeDsKKyAgICAgICAgICAgIGRlc2lyZWRf Z2x5cGggPSBzdGFydDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIH0KKworICAgICAg ICBvdXRwdXRfY3Vyc29yX3RvICh3LCB2cG9zLCBzdGFydF9ocG9zLCBkZXNpcmVkX3Jvdy0+eSwg c3Rhcn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gICAgICAgICAgICAgICAgICAg IGRlc2lyZWRfcm93LT54LCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdLCB2cG9zLAorICAg ICAgICAgICAgICAgICAgICAgICBib3R0b21fdnBvcywgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFs cywgcm93X3Bvc2l0aW9uLCBkcmF3X3AsIFVOQ0hBTkdFRCk7CisgICAgICAgIH0KKworICAgICAg LyogTWF5YmUgY2xlYXIgdG8gZW5kIG9mIGxpbmUuICovCisgICAgICBpZiAoTUFUUklYX1JPV19F WFRFTkRTX0ZBQ0VfUCAoZGVzaXJlZF9yb3cpKQorICAgICAgICB7CisgICAgICAgICAgLyogSWYg bmV3IHJvdyBleHRlbmRzIHRvIHRoZSBlbmQgb2YgdGhlIHRleHQgYXJlYSwgbm90aGluZworICAg ICAgICAgICAgIGhhcyB0byBiZSBjbGVhcmVkLCBpZiBhbmQgb25seSBpZiB3ZSBkaWQgYSB3cml0 ZV9nbHlwaHMKKyAgICAgICAgICAgICBhYm92ZS4gIFRoaXMgaXMgbWFkZSBzdXJlIGJ5IHNldHRp bmcgZGVzaXJlZF9zdG9wX3BvcworICAgICAgICAgICAgIGFwcHJvcHJpYXRlbHkgYWJvdmUuICov CisgICAgICAgICAgZWFzc2VydCAoaSA8IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAg ICAgICAgICAgICAgICAgICB8fCAoKGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gPT0gY3Vy cmVudF9yb3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgTUFU UklYX1JPV19FWFRFTkRTX0ZBQ0VfUCAoY3VycmVudF9yb3cpKSk7CisgICAgICAgIH0KKyAgICAg IGVsc2UgaWYgKE1BVFJJWF9ST1dfRVhURU5EU19GQUNFX1AgKGN1cnJlbnRfcm93KSkKKyAgICAg ICAgeworICAgICAgICAgIC8qIElmIG9sZCByb3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Rvbid0 IGhhdmUgYSBwaHlzX2N1cnNvcl9nbHlwaAorICAgICAgICAgICAgIHdpdGggd2hpY2ggdG8gZXJh c2UgdGhlIGN1cnNvciAoYmVjYXVzZSB0aGlzIG1ldGhvZAorICAgICAgICAgICAgIGRvZXNuJ3Qg d29yayB3aXRoIGxiZWFyaW5nL3JiZWFyaW5nKSwgc28gd2UgbXVzdCBkbyBpdCB0aGlzIHdheS4g Ki8KKyAgICAgICAgICBpZiAodnBvcyA9PSB3LT5waHlzX2N1cnNvci52cG9zCisgICAgICAgICAg ICAgICYmIChkZXNpcmVkX3Jvdy0+cmV2ZXJzZWRfcAorICAgICAgICAgICAgICAgICAgPyAody0+ cGh5c19jdXJzb3IuaHBvcyA8IDApCisgICAgICAgICAgICAgICAgICA6ICh3LT5waHlzX2N1cnNv ci5ocG9zID49IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pKSkKKyAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgdy0+cGh5c19jdXJzb3Jfb25fcCA9IDA7CisgICAgICAgICAgICAgIHhs aW0gPSAtMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAg eGxpbSA9IGN1cnJlbnRfcm93LT5waXhlbF93aWR0aDsKKyAgICAgICAgICBpZiAoZHJhd19wKQor ICAgICAgICAgICAgcmlmLT5jbGVhcl9lbmRfb2ZfbGluZSAodywgdXBkYXRlZF9yb3csIFRFWFRf QVJFQSwgeGxpbSk7CisgICAgICAgICAgY2xlYXJfdG9feCA9IHhsaW07CisgICAgICAgICAgY2hh bmdlZF9wID0gMTsKKyAgICAgICAgfQorCisgIGlmIChjaGFuZ2VkX3AKKyAgICAgICYmIGNsZWFy X3RvX3ggIT0gMCkKKyAgICB7CisgICAgICBpbnQgdGV4dF9hcmVhX3dpZHRoID0gd2luZG93X2Jv eF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgICAgIHN0cnVjdCBtY19SR0IgZGVidW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BMaXNwX09iamVjdCBidWYgPSB3LT5jb250ZW50czsKKyAgICAg IENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgICAgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSIChi dWYpOworICAgICAgYm9vbCBmaWxsX2NvbHVtbl90cnVtcHNfcCA9ICghTklMUCAoQlZBUiAoYiwg Y2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gZXNzZW50aWFs cy5mY194KTsKKworICAgICAgaWYgKHRyYWNlX3JlZGlzcGxheV9wKQorICAgICAgICBmcHJpbnRm IChzdGRlcnIsICJtY191cGRhdGVfdGV4dF9hcmVhIChmbG9hdGluZyk6ICB2cG9zICglZCkgfCB4 X2xpbWl0ICglZClcbiIsIHZwb3MsIHhfbGltaXQpOworCisgICAgICBpZiAoQlVGRkVSUCAody0+ Y29udGVudHMpCisgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgJiYgeCA8IHRleHRfYXJlYV93aWR0aAorICAgICAg ICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSB4CisgICAgICAgICAgJiYgdGFyZ2V0X2dseXBoICE9 IE5VTEwKKyAgICAgICAgICAmJiBkcmF3X3ApCisgICAgICAgIG1jX2VuZ2luZSAodywgZGVzaXJl ZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRfZ2x5cGgsIFRFWFRfQVJFQSwgeCwgeF9saW1p dCwKKyAgICAgICAgICAgICAgICAgICB1cGRhdGVkX3Jvdy0+eSwgaHBvcywgdnBvcywgTUNfQkFS LCAxLCBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLAorICAgICAgICAgICAgICAgICAgIHJvd19w b3NpdGlvbiwgZGVidWdfcCA/IGRlYnVnX2ZnIDogZXNzZW50aWFscy5mY19mZ1tyb3dfcG9zaXRp b25dLAorICAgICAgICAgICAgICAgICAgIEZJTExfQ09MVU1OLCBkcmF3X3AsIE5PV0hFUkUsIE5P X0NBQ0hFKTsKKworICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICYm ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAg ICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2hvcml6b250YWxf cnVsZXIpKQorICAgICAgICAgICYmIHggPCB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAmJiB2 cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgJiYgdGFyZ2V0X2dseXBoICE9IE5VTEwK KyAgICAgICAgICAmJiBkcmF3X3ApCisgICAgICAgIG1jX2VuZ2luZSAodywgZGVzaXJlZF9tYXRy aXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRfZ2x5cGgsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwKKyAg ICAgICAgICAgICAgICAgICB1cGRhdGVkX3Jvdy0+eSwgaHBvcywgdnBvcywgTUNfSEJBUiwgMSwg Y3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywKKyAgICAgICAgICAgICAgICAgICByb3dfcG9zaXRp b24sIGRlYnVnX3AgPyBkZWJ1Z19mZyA6IGVzc2VudGlhbHMuY2hfZmdbcm93X3Bvc2l0aW9uXSwK KyAgICAgICAgICAgICAgICAgICBIT1JJWk9OVEFMX1JVTEVSLCBkcmF3X3AsIE5PV0hFUkUsIE5P X0NBQ0hFKTsKKworICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICYm ICFOSUxQIChCVkF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IGN1 cnJlbnRfcm93LT5tb2RlX2xpbmVfcAorICAgICAgICAgIHx8IGRlc2lyZWRfcm93LT5leGFjdF93 aW5kb3dfd2lkdGhfbGluZV9wICE9IGN1cnJlbnRfcm93LT5leGFjdF93aW5kb3dfd2lkdGhfbGlu ZV9wCisgICAgICAgICAgfHwgKE1BVFJJWF9ST1dfQ09OVElOVUFUSU9OX0xJTkVfUCAoZGVzaXJl ZF9yb3cpCisgICAgICAgICAgICAgICE9IE1BVFJJWF9ST1dfQ09OVElOVUFUSU9OX0xJTkVfUCAo Y3VycmVudF9yb3cpKSkKKyAgICAgICAgcmlmLT5hZnRlcl91cGRhdGVfd2luZG93X2xpbmVfaG9v ayAodywgZGVzaXJlZF9yb3cpOworICAgIH0KKyAgLyogVXBkYXRlIGN1cnJlbnRfcm93IGZyb20g ZGVzaXJlZF9yb3cuICovCisgIG1ha2VfY3VycmVudCAody0+ZGVzaXJlZF9tYXRyaXgsIHctPmN1 cnJlbnRfbWF0cml4LCB2cG9zKTsKKyAgcmV0dXJuIGNoYW5nZWRfcDsKK30KKwordm9pZAorbWNf dXBkYXRlX3dpbmRvd19lcmFzZSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IG1jX21hdHJpeCBv bGRfbWF0cml4KQoreworICBib29sIGdvX29uZV9wID0gKG9sZF9tYXRyaXguY3Vyc29yc191c2Vk W01DX0NBQ0hFXSA+IDAKKyAgICAgICAgICAgICAgICAgICB8fCBvbGRfbWF0cml4LmN1cnNvcnNf dXNlZFtDSF9DQUNIRV0gPiAwCisgICAgICAgICAgICAgICAgICAgfHwgb2xkX21hdHJpeC5jdXJz b3JzX3VzZWRbRkNfQ0FDSEVdID4gMCk7CisgIGJvb2wgZ29fdHdvX3AgPSAoQlVGRkVSUCAody0+ Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3 LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICB8fCAhTklM UCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAg ICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29u ZikpKSk7CisgIGJvb2wgdXBkYXRpbmdfZnJhbWVfcCA9IGZhbHNlOworICBzdHJ1Y3QgZnJhbWUg KmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgaWYgKFhGUkFNRSAody0+ZnJhbWUpICE9IGYtPm1j X3VwZGF0aW5nX2ZyYW1lCisgICAgICAmJiAoZ29fb25lX3AgfHwgZ29fdHdvX3ApKQorICAgIHsK KyAgICAgIHVwZGF0aW5nX2ZyYW1lX3AgPSB0cnVlOworICAgICAgdXBkYXRlX2JlZ2luIChmKTsK KyAgICB9CisgIGlmICh3LT5waHlzX2N1cnNvcl9vbl9wCisgICAgICAmJiBnb190d29fcCkKKyAg ICBlcmFzZV9waHlzX2N1cnNvciAodyk7CisgIGZvciAoaW50IHZudGggPSAwOworICAgICAgIGdv X29uZV9wCisgICAgICAgJiYgdm50aCA8IHctPm1jX21hdHJpeC52cG9zX3VzZWQ7CisgICAgICAg Kyt2bnRoKQorICAgIHsKKyAgICAgIGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUg PSBNQ19DQUNIRTsKKyAgICAgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICAg ICArK2NhY2hlX3R5cGUpCisgICAgICAgIGZvciAoaW50IG50aF8wID0gMDsKKyAgICAgICAgICAg ICBtY190cmF2ZXJzZV9jYWNoZV9wIChvbGRfbWF0cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGhf MCk7CisgICAgICAgICAgICAgKytudGhfMCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBib29s IHNhbWVfcCA9IGZhbHNlOworICAgICAgICAgICAgZm9yIChpbnQgd19udGggPSAwOyB3X250aCA8 IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV07ICsrd19udGgp CisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzYW1lX3AgfD0gKG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGgudHlwZQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVt3X250aF0uZ2x5cGgudHlwZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5ieXRl cG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5ieXRlcG9zCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXzBdLmdseXBoLmNoYXJwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLmNoYXJw b3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGgudS52YWwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19u dGhdLmdseXBoLnUudmFsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLmZhY2VfaWQKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bd19udGhdLmdseXBoLmZhY2VfaWQKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5 cGgucGFkZGluZ19wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5wYWRkaW5nX3AKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMF0uZ2x5cGgubGVmdF9ib3hfbGluZV9wCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W3dfbnRoXS5nbHlwaC5sZWZ0X2JveF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGgu cmlnaHRfYm94X2xpbmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgucmlnaHRfYm94 X2xpbmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC52b2Zmc2V0CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3dfbnRoXS5nbHlwaC52b2Zmc2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnBpeGVs X3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5waXhlbF93aWR0aAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8wXS5nbHlwaC5zbGljZS5pbWcueAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0u Z2x5cGguc2xpY2UuaW1nLngKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGguc2xpY2UuaW1nLnkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnNsaWNlLmltZy55CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXzBdLmdseXBoLnNsaWNlLmltZy53aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5 cGguc2xpY2UuaW1nLndpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnNsaWNlLmltZy5o ZWlnaHQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnNsaWNlLmltZy5oZWlnaHQKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMF0uZ2x5cGguc2xpY2UuY21wLmZyb20KKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b d19udGhdLmdseXBoLnNsaWNlLmNtcC5mcm9tCisgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLngKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bd19udGhdLngKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZngKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bd19udGhdLmZ4CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLnkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b d19udGhdLnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZnkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhd LmZ5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmhwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmhw b3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMF0udnBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0udnBv cworICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8wXS53ZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9 PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0ud2QKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMF0uaAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uaAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS5jdXJzb3JfdHlwZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uY3Vyc29yX3R5 cGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMF0uY3Vyc29yX3dpZHRoCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3df bnRoXS5jdXJzb3Jfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZmcucmVkCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW3dfbnRoXS5mZy5yZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZmcuZ3JlZW4KKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bd19udGhdLmZnLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZnLmJsdWUK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmZnLmJsdWUKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uYmcu cmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5iZy5yZWQKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0u YmcuZ3JlZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmJnLmdyZWVuCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXzBdLmJnLmJsdWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmJnLmJsdWUKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMF0uYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmFjdGl2ZV9wCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoX2ZsYXZvcgorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0u Z2x5cGhfZmxhdm9yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmVuYWJsZWRfcAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVt3X250aF0uZW5hYmxlZF9wKTsKKyAgICAgICAgICAgICAgICAvKiBGb3JjZSB0aGUgZnJp bmdlIGJpdG1hcHMgdG8gYWx3YXlzIGJlIHJlc2V0L3JlZHJhd24uICovCisgICAgICAgICAgICAg ICAgaWYgKG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uY3Vy c29yX3R5cGUKKyAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uY3Vyc29yX3R5cGUKKyAgICAgICAgICAgICAgICAg ICAgJiYgKG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uY3Vy c29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgICAg ICB8fCBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmN1cnNv cl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVApKQorICAgICAgICAgICAgICAgICAgc2Ft ZV9wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgaWYgKHNhbWVfcCkKKyAgICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gIGZwcmludGYgKHN0ZGVyciwgIkhJVCAoJXMp OiAgdnBvcyAoJWQpIHwgaHBvcyAoJWQpIHwgY2hhciAoJXMpXG4iLAorICAgICAgICAgICAgICAg ICAgICAvLyAgICAgICAgICAgICAgICAgICAoY2FjaGVfdHlwZSA9PSBNQ19DQUNIRSkKKyAgICAg ICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICA/ICJNQyIKKyAgICAgICAgICAg ICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgOiAoY2FjaGVfdHlwZSA9PSBDSF9DQUNIRSkK KyAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICA/ICJDSCIKKyAgICAg ICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgOiAoY2FjaGVfdHlwZSA9PSBGQ19D QUNIRSkKKyAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICA/ICJGQyIK KyAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgOiAiTk8iLAorICAgICAg ICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0udnBvcywKKyAgICAgICAgICAgICAgICAgICAgLy8g ICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bd19udGhdLmhwb3MsCisgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAg IG1jX2NoYXJfdG9fc3RyaW5nICh3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVt3X250aF0uZ2x5cGgudS5jaCkpOworICAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uc2FtZV9wID0gdHJ1ZTsKKyAg ICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAg ICAvLyAgZnByaW50ZiAoc3RkZXJyLCAiTUlTUyAoJXMpOiAgdnBvcyAoJWQpIHwgaHBvcyAoJWQg di4gJWQpIHwgY2hhciAoJXMgdi4gJXMpIHwgY2FjaGVfdXNlZCAoJWQgdi4gJWQpXG4iLAorICAg ICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIChjYWNoZV90eXBlID09IE1D X0NBQ0hFKQorICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgPyAi TUMiCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgOiAoY2FjaGVf dHlwZSA9PSBDSF9DQUNIRSkKKyAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAg ICAgICAgID8gIkNIIgorICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAg IDogKGNhY2hlX3R5cGUgPT0gRkNfQ0FDSEUpCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAg ICAgICAgICAgICAgICAgICA/ICJGQyIKKyAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAg ICAgICAgICAgICA6ICJOTyIsCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAg ICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLnZw b3MsCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5ocG9zLAorICAgICAgICAgICAg ICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5ocG9zLAorICAgICAgICAgICAgICAgICAgICAgIC8vICAg ICAgICAgICAgICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nIChvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnUuY2gpLAorICAgICAgICAgICAgICAgICAg ICAgIC8vICAgICAgICAgICAgICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nICh3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgudS5jaCksCisgICAgICAg ICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlX3VzZWRbY2FjaGVfdHlwZV0sCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAg ICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBl XSk7CisgICAgICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bd19udGhdLnNhbWVfcCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICghc2FtZV9wKQorICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgLyogYG1hdHJpeF9yb3cnIGluIGBkaXNwbmV3LmNgIGNvbnRh aW5zIHRoZSBmb2xsb3dpbmcgdGVzdHMsCisgICAgICAgICAgICAgICAgZWFzc2VydCAobWF0cml4 ICYmIG1hdHJpeC0+cm93cyk7CisgICAgICAgICAgICAgICAgZWFzc2VydCAocm93ID49IDAgJiYg cm93IDwgbWF0cml4LT5ucm93cyk7ICovCisgICAgICAgICAgICAgICAgYm9vbCBiYXJmX2NyYXNo X29uZSA9ICh3LT5jdXJyZW50X21hdHJpeCAmJiB3LT5jdXJyZW50X21hdHJpeC0+cm93cykgPyBm YWxzZSA6IHRydWU7CisgICAgICAgICAgICAgICAgaWYgKGJhcmZfY3Jhc2hfb25lKQorICAgICAg ICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgYm9vbCBiYXJmX2NyYXNoX3R3 byA9ICh2bnRoID49IDAgJiYgdm50aCA8IHctPmN1cnJlbnRfbWF0cml4LT5ucm93cykgPyBmYWxz ZSA6IHRydWU7CisgICAgICAgICAgICAgICAgaWYgKGJhcmZfY3Jhc2hfdHdvKQorICAgICAgICAg ICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqdm50 aF9yb3cgPSBNQVRSSVhfUk9XICh3LT5jdXJyZW50X21hdHJpeCwgdm50aCk7CisgICAgICAgICAg ICAgICAgaW50IHhfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhfMF0ueDsKKyAgICAgICAgICAgICAgICBpbnQgZnhfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZng7CisgICAgICAgICAgICAgICAgaW50IHlfMCA9 IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0ueTsKKyAgICAg ICAgICAgICAgICBpbnQgZnlfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMF0uZnk7CisgICAgICAgICAgICAgICAgaW50IGhwb3NfMCA9IG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uaHBvczsKKyAgICAgICAgICAgICAg ICBpbnQgdnBvc18wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8wXS52cG9zOworICAgICAgICAgICAgICAgIGludCB3ZF8wID0gb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS53ZDsKKyAgICAgICAgICAgICAgICBpbnQgaF8w ID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5oOworICAg ICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGVfMCA9IG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uY3Vyc29yX3R5cGU7CisgICAg ICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aF8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8wXS5jdXJzb3Jfd2lkdGg7CisgICAgICAgICAgICAgICAgLy8g IHN0cnVjdCBtY19SR0IgbHNsX2ZnXzAgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZmcucmVkLAorICAgICAgICAgICAgICAgIC8vICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMF0uZmcuZ3JlZW4sCisgICAgICAgICAgICAgICAgLy8gICAgICAg ICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXzBdLmZnLmJsdWV9OworICAgICAgICAgICAgICAgIHN0cnVjdCBtY19S R0IgbHNsX2JnXzAgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMF0uYmcucmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgLmdyZWVuID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8wXS5iZy5ncmVlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IC5ibHVlID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5i Zy5ibHVlfTsKKyAgICAgICAgICAgICAgICBib29sIGFjdGl2ZV9wXzAgPSBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmFjdGl2ZV9wOworICAgICAgICAgICAg ICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvcl8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaF9mbGF2b3I7CisgICAgICAgICAgICAgICAg Ym9vbCBlbmFibGVkX3BfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMF0uZW5hYmxlZF9wOworICAgICAgICAgICAgICAgIGlmICh2cG9zXzAgPT0gdm50aAor ICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3JfMCA9PSBNQ19HTFlQSAorICAgICAg ICAgICAgICAgICAgICAmJiBlbmFibGVkX3BfMAorICAgICAgICAgICAgICAgICAgICAmJiB2bnRo X3Jvdy0+ZW5hYmxlZF9wKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg ICBtY19lcmFzZV9jdXJzb3IgKHcsIHctPmN1cnJlbnRfbWF0cml4LCB2bnRoX3JvdywgeF8wLCB5 XzAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaHBvc18wLCB2cG9zXzAs IGdseXBoX2ZsYXZvcl8wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1 cnNvcl90eXBlXzAsIHdkXzApOworICAgICAgICAgICAgICAgICAgICBvbGRfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmVuYWJsZWRfcCA9IGZhbHNlOworICAgICAg ICAgICAgICAgICAgICAtLW9sZF9tYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5cGVdOworICAg ICAgICAgICAgICAgICAgICAvKiBJZiB3ZSBpbmFkdmVydGVudGx5IGVyYXNlZCBhbm90aGVyIGZh a2UgY3Vyc29yIGF0IHRoZSBzYW1lCisgICAgICAgICAgICAgICAgICAgIEhQT1MgdGhhdCBpcyBz dGlsbCBlbmFibGVkX3AgaW4gdGhlIGBvbGRfbWF0cml4YCwgdGhlbiByZWRyYXcgaXQuICovCisg ICAgICAgICAgICAgICAgICAgIGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBN Q19DQUNIRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7 CisgICAgICAgICAgICAgICAgICAgICAgICAgKytjYWNoZV90eXBlKQorICAgICAgICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IG50aF8xID0gMDsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgbWNfdHJhdmVyc2VfY2FjaGVfcCAob2xkX21hdHJp eCwgY2FjaGVfdHlwZSwgdm50aCwgbnRoXzEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICArK250aF8xKQorICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgaW50IHhfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMV0ueDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZnhfMSA9IG9s ZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZng7CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgaW50IHlfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMV0ueTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQg ZnlfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZnk7 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGhwb3NfMSA9IG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uaHBvczsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICBpbnQgdnBvc18xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8xXS52cG9zOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB3ZF8x ID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS53ZDsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5oOworICAgICAgICAgICAgICAgICAgICAgICAgICAg IGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGVfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uY3Vyc29yX3R5cGU7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8xXS5jdXJzb3Jfd2lkdGg7CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmdfMSA9IHsucmVkID0gb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5mZy5yZWQsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmZnLmdyZWVuLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmZnLmJsdWV9OworICAg ICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBzdHJ1Y3QgbWNfUkdCIGxzbF9iZ18xID0gey5y ZWQgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmJnLnJl ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAuZ3JlZW4gPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XzFdLmJnLmdyZWVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAg ICAgICAgICAgICAgICAgIC5ibHVlID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8xXS5iZy5ibHVlfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29s IGFjdGl2ZV9wXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XzFdLmFjdGl2ZV9wOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfZmxhdm9y IGdseXBoX2ZsYXZvcl8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF8xXS5nbHlwaF9mbGF2b3I7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBl bmFibGVkX3BfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhf MV0uZW5hYmxlZF9wOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgZ29fcF8xID0g KGhwb3NfMCA9PSBocG9zXzEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBlbmFibGVkX3BfMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFn b19wXzEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICBib29sIHJlbW92ZV9wXzEgPSBmYWxzZTsKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgdy0+Y3VycmVudF9tYXRy aXgsIHZudGhfcm93LCB4XzEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGZ4XzEsIHlfMSwgZnlfMSwgaHBvc18xLCB2cG9zXzEsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdkXzEsIGhfMSwgY3Vyc29y X3R5cGVfMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgY3Vyc29yX3dpZHRoXzEsIGxzbF9mZ18xLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVfcF8xLCBnbHlwaF9mbGF2b3JfMSwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3ZlX3BfMSk7 CisgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmICh2cG9zXzAgPT0g dm50aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wXzAKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHZudGhfcm93LT5lbmFibGVkX3ApCisgICAgICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBib29sIHJlbW92ZV9wXzAgPSB0cnVlOwor ICAgICAgICAgICAgICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCB3LT5jdXJyZW50 X21hdHJpeCwgdm50aF9yb3csIHhfMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgZnhfMCwgeV8wLCBmeV8wLCBocG9zXzAsIHZwb3NfMCwgd2RfMCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaF8wLCBjdXJzb3JfdHlwZV8w LCBjdXJzb3Jfd2lkdGhfMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgbHNsX2JnXzAsIGFjdGl2ZV9wXzAsIGdseXBoX2ZsYXZvcl8wLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVfcF8wKTsKKyAgICAgICAgICAg ICAgICAgICAgICBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBd LmVuYWJsZWRfcCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgIC0tb2xkX21hdHJpeC5j dXJzb3JzX3VzZWRbY2FjaGVfdHlwZV07CisgICAgICAgICAgICAgICAgICAgICAgLyogSWYgd2Ug aW5hZHZlcnRlbnRseSBlcmFzZWQgYW5vdGhlciBmYWtlIGN1cnNvciBhdCB0aGUgc2FtZQorICAg ICAgICAgICAgICAgICAgICAgIEhQT1MgdGhhdCBpcyBzdGlsbCBlbmFibGVkX3AgaW4gdGhlIGBv bGRfbWF0cml4YCwgdGhlbiByZWRyYXcgaXQuICovCisgICAgICAgICAgICAgICAgICAgICAgZm9y IChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOworICAgICAgICAgICAg ICAgICAgICAgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICAgICAgICAgICAg ICAgICAgICAgKytjYWNoZV90eXBlKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBudGhfMiA9IDA7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgbWNfdHJhdmVyc2VfY2FjaGVfcCAob2xkX21hdHJpeCwgY2FjaGVfdHlw ZSwgdm50aCwgbnRoXzIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsrbnRoXzIp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgaW50IHhfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhfMl0ueDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmeF8yID0gb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5meDsKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGludCB5XzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXzJdLnk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQg ZnlfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uZnk7 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaHBvc18yID0gb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5ocG9zOworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgaW50IHZwb3NfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMl0udnBvczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlu dCB3ZF8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS53 ZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBoXzIgPSBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmg7CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlXzIgPSBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmN1cnNvcl90eXBlOworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aF8yID0gb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5jdXJzb3Jfd2lkdGg7CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZ18yID0gey5yZWQgPSBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmZnLnJlZCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdy ZWVuID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5mZy5n cmVlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgLmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XzJdLmZnLmJsdWV9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIHN0cnVjdCBt Y19SR0IgbHNsX2JnXzIgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMl0uYmcucmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8g ICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5iZy5ncmVlbiwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0gb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5iZy5ibHVlfTsKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGJvb2wgYWN0aXZlX3BfMiA9IG9sZF9tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uYWN0aXZlX3A7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3JfMiA9IG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uZ2x5cGhfZmxhdm9yOworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBlbmFibGVkX3BfMiA9IG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uZW5hYmxlZF9wOworICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgYm9vbCBnb19wXzIgPSAoaHBvc18wID09IGhwb3NfMgorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZnhfMCA8PSBmeF8yCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBmeF8wICsgd2Rf MCA+IGZ4XzIgKyB3ZF8yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBlbmFibGVkX3BfMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAo IWdvX3BfMikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIHJlbW92ZV9wXzIgPSBmYWxzZTsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCB3LT5jdXJy ZW50X21hdHJpeCwgdm50aF9yb3csIHhfMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBmeF8yLCB5XzIsIGZ5XzIsIGhwb3NfMiwgdnBvc18yLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdkXzIs IGhfMiwgY3Vyc29yX3R5cGVfMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGhfMiwgbHNsX2ZnXzIsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0aXZlX3BfMiwgZ2x5cGhf Zmxhdm9yXzIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgcmVtb3ZlX3BfMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgIH0KKyAgICB9CisgIGlmICh1cGRhdGluZ19mcmFtZV9wKQorICAgIHVw ZGF0ZV9lbmQgKGYpOworfQorCit2b2lkCittY191cGRhdGVfd2luZG93X2RyeXJ1biAoc3RydWN0 IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wLCBzdHJ1Y3QgbWNfZXNzZW50aWFscyBlc3NlbnRpYWxz KQoreworICBpZiAoIUJVRkZFUlAgKHctPmNvbnRlbnRzKSkKKyAgICByZXR1cm47CisKKyAgaWYg KHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbTUNfQ0FDSEVdID09IDAKKyAgICAgICYmIHctPm1j X21hdHJpeC5jdXJzb3JzX3VzZWRbQ0hfQ0FDSEVdID09IDAKKyAgICAgICYmIHctPm1jX21hdHJp eC5jdXJzb3JzX3VzZWRbRkNfQ0FDSEVdID09IDAKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZG RVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpCisgICAgcmV0dXJuOworCisgIC8vIGNsb2Nr X3QgY2xvY2tfc3RhcnQgPSBjbG9jaygpOworCisgIGJvb2wgZHJhd19wID0gZmFsc2U7CisKKyAg c3RydWN0IGdseXBoX21hdHJpeCAqc2F2ZWRfZGVzaXJlZCA9IG1jX3NhdmVfZ2x5cGhfbWF0cml4 ICh3LT5kZXNpcmVkX21hdHJpeCk7CisgIHN0cnVjdCBnbHlwaF9tYXRyaXggKnNhdmVkX2N1cnJl bnQgPSBtY19zYXZlX2dseXBoX21hdHJ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V9wICYmIG1vZGVfbGluZV9yb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgeworICAg ICAgICAgIG1vZGVfbGluZV9yb3ctPnkgPSB5YiArIFdJTkRPV19TQ1JPTExfQkFSX0FSRUFfSEVJ R0hUICh3KTsKKyAgICAgICAgICB1cGRhdGVfd2luZG93X2xpbmUgKHcsIE1BVFJJWF9ST1dfVlBP UyAobW9kZV9saW5lX3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgZGVzaXJlZF9tYXRyaXgpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCk7CisgICAgICAgIH0KKworICAgICAgLyogRmlu ZCBmaXJzdCBlbmFibGVkIHJvdy4gIE9wdGltaXphdGlvbnMgaW4gcmVkaXNwbGF5X2ludGVybmFs CisgICAgICAgICBtYXkgbGVhZCB0byBhbiB1cGRhdGUgd2l0aCBvbmx5IG9uZSByb3cgZW5hYmxl ZC4gIFRoZXJlIG1heQorICAgICAgICAgYmUgYWxzbyBjb21wbGV0ZWx5IGVtcHR5IG1hdHJpY2Vz LiAqLworICAgICAgd2hpbGUgKHJvdyA8IGVuZCAmJiAhcm93LT5lbmFibGVkX3ApCisgICAgICAg ICsrcm93OworCisgICAgICAvKiBUcnkgcmV1c2luZyBwYXJ0IG9mIHRoZSBkaXNwbGF5IGJ5IGNv cHlpbmcuICovCisgICAgICBpZiAocm93IDwgZW5kICYmICF3LT5kZXNpcmVkX21hdHJpeC0+bm9f c2Nyb2xsaW5nX3ApCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgcmMgPSBtY19zY3JvbGxpbmdf d2luZG93ICh3LCBoZWFkZXJfbGluZV9yb3cgIT0gTlVMTCk7CisgICAgICAgICAgaWYgKHJjIDwg MCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogQWxsIHJvd3Mgd2VyZSBmb3VuZCB0 byBiZSBlcXVhbC4gKi8KKyAgICAgICAgICAgICAgcGF1c2VkX3AgPSAwOworICAgICAgICAgICAg ICBnb3RvIHNldF9jdXJzb3I7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmIChy YyA+IDApCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBXZSd2ZSBzY3JvbGxl ZCB0aGUgZGlzcGxheS4gKi8KKyAgICAgICAgICAgICAgICBmb3JjZV9wID0gMTsKKyAgICAgICAg ICAgICAgICBjaGFuZ2VkX3AgPSAxOworICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAg IC8qIFByb2Nlc3MgdGhlIGN1cnNvciByb3cgYXQgdGhlIG91dHNldCBpZiBpdCBpcyB3aXRoaW4g YGRlc2lyZWRfbWF0cml4YC4KKyAgICAgIFdoZW4gcHJvY2Vzc2luZyBhbGwgb3RoZXIgcm93cywg d2Ugd2lsbCBxdWVyeSB0aGUgYHctPmN1cnJlbnRfbWF0cml4YCBmb3IgZGF0YQorICAgICAgcmVs YXRpbmcgdG8gdGhlIGN1cnNvciByb3cuICBgbWFrZV9jdXJyZW50YCAod2l0aGluIGB1cGRhdGVf d2luZG93X2xpbmUnKQorICAgICAgdXBkYXRlcyB0aGUgYHctPmN1cnJlbnRfbWF0cml4YCBmb3Ig dGhlIGFwcGxpY2FibGUgcm93LiAgSW4gZG9pbmcgc28sIGhvd2V2ZXIsCisgICAgICB0aGUgYXBw bGljYWJsZSByb3cgaW4gdGhlIGRlc2lyZWQgbWF0cml4IGlzIGFsdGVyZWQgc3VjaCB0aGF0IHdl IGNhbiBubyBsb25nZXIKKyAgICAgIHJlbHkgdXBvbiB0aGUgYWNjdXJhY3kgb2YgYFJPVy0+dXNl ZFtURVhUX0FSRUFdYC4gIFRoZXJlZm9yZSwgd2UgbXVzdCBub3cgcmVseQorICAgICAgZXhjbHVz aXZlbHkgdXBvbiBgdy0+Y3VycmVudF9tYXRyaXgnIGZvciBjdXJzb3Igcm93IGJhc2VkIGRlY2lz aW9ucy4gKi8KKyAgICAgIGZvciAoc3RydWN0IGdseXBoX3JvdyAqbWNfcm93ID0gcm93OworICAg ICAgICAgICBtY19yb3cgPCBlbmQgJiYgKGZvcmNlX3AgfHwgIWlucHV0X3BlbmRpbmcpOworICAg ICAgICAgICArK21jX3JvdykKKyAgICAgICAgeworICAgICAgICAgIGludCB2cG9zID0gTUFUUklY X1JPV19WUE9TIChtY19yb3csIHctPmRlc2lyZWRfbWF0cml4KTsKKyAgICAgICAgICBpZiAobWNf cm93LT5lbmFibGVkX3AKKyAgICAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcykK KyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCA9IHctPmRlc2lyZWRf bWF0cml4OworICAgICAgICAgICAgICBpZiAoIWZvcmNlX3AgJiYgKytuX3VwZGF0ZWQgJSBwcmVl bXB0X2NvdW50ID09IDApCisgICAgICAgICAgICAgICAgZGV0ZWN0X2lucHV0X3BlbmRpbmdfaWdu b3JlX3NxdWVlemFibGVzICgpOworICAgICAgICAgICAgICBjaGFuZ2VkX3AgfD0gbWNfdXBkYXRl X3dpbmRvd19saW5lICh3LCB2cG9zLCAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4 LCBlc3NlbnRpYWxzLCBkcmF3X3ApOworICAgICAgICAgICAgICBpZiAoTUFUUklYX1JPV19CT1RU T01fWSAocm93KSA+PSB5YikKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gdnBvcyArIDE7 IGkgPCB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAgICAgICAgICAgICAg ICBTRVRfTUFUUklYX1JPV19FTkFCTEVEX1AgKHctPmN1cnJlbnRfbWF0cml4LCBpLCBmYWxzZSk7 CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBj dXJzb3JfbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgICAgICAvKiBVcGRhdGUgdGhlIHJl c3Qgb2YgdGhlIGxpbmVzLiAqLworICAgICAgZm9yICg7IHJvdyA8IGVuZCAmJiAoZm9yY2VfcCB8 fCAhaW5wdXRfcGVuZGluZyk7ICsrcm93KQorICAgICAgICAvKiBzY3JvbGxpbmdfd2luZG93IHJl c2V0cyB0aGUgZW5hYmxlZF9wIGZsYWcgb2YgdGhlIHJvd3MgaXQgcmV1c2VzIGZyb20KKyAgICAg ICAgY3VycmVudF9tYXRyaXguICovCisgICAgICAgIGlmIChyb3ctPmVuYWJsZWRfcCkKKyAgICAg ICAgICB7CisgICAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCB3LT5k ZXNpcmVkX21hdHJpeCk7CisgICAgICAgICAgICAvKiBJZiB0aGUgYGN1cnNvcl9yb3dgIGlzIHdp dGhpbiB0aGUgYGRlc2lyZWRfbWF0cml4YCwgdGhlbiBpdCB3YXMKKyAgICAgICAgICAgIHByb2Nl c3NlZCBoZXJlaW5hYm92ZSBhbmQgc2hvdWxkIGJlIHNraXBwZWQgYXQgdGhpcyB0aW1lLiAqLwor ICAgICAgICAgICAgaWYgKHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICBjb250 aW51ZTsKKyAgICAgICAgICAgIGludCBpOworICAgICAgICAgICAgLyogV2UnbGwgaGF2ZSB0byBw bGF5IGEgbGl0dGxlIGJpdCB3aXRoIHdoZW4gdG8KKyAgICAgICAgICAgICAgIGRldGVjdF9pbnB1 dF9wZW5kaW5nLiAgSWYgaXQncyBkb25lIHRvbyBvZnRlbiwKKyAgICAgICAgICAgICAgIHNjcm9s bGluZyBsYXJnZSB3aW5kb3dzIHdpdGggcmVwZWF0ZWQgc2Nyb2xsLXVwCisgICAgICAgICAgICAg ICBjb21tYW5kcyB3aWxsIHRvbyBxdWlja2x5IHBhdXNlIHJlZGlzcGxheS4gKi8KKyAgICAgICAg ICAgIGlmICghZm9yY2VfcCAmJiArK25fdXBkYXRlZCAlIHByZWVtcHRfY291bnQgPT0gMCkKKyAg ICAgICAgICAgICAgZGV0ZWN0X2lucHV0X3BlbmRpbmdfaWdub3JlX3NxdWVlemFibGVzICgpOwor ICAgICAgICAgICAgY2hhbmdlZF9wIHw9IG1jX3VwZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywg Jm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIGRyYXdfcCk7Cisg ICAgICAgICAgICAvKiBNYXJrIGFsbCByb3dzIGJlbG93IHRoZSBsYXN0IHZpc2libGUgb25lIGlu IHRoZSBjdXJyZW50CisgICAgICAgICAgICAgICBtYXRyaXggYXMgaW52YWxpZC4gIFRoaXMgaXMg bmVjZXNzYXJ5IGJlY2F1c2Ugb2YKKyAgICAgICAgICAgICAgIHZhcmlhYmxlIGxpbmUgaGVpZ2h0 cy4gIENvbnNpZGVyIHRoZSBjYXNlIG9mIHRocmVlCisgICAgICAgICAgICAgICBzdWNjZXNzaXZl IHJlZGlzcGxheXMsIHdoZXJlIHRoZSBmaXJzdCBkaXNwbGF5cyA1CisgICAgICAgICAgICAgICBs aW5lcywgdGhlIHNlY29uZCAzIGxpbmVzLCBhbmQgdGhlIHRoaXJkIDUgbGluZXMgYWdhaW4uCisg ICAgICAgICAgICAgICBJZiB0aGUgc2Vjb25kIHJlZGlzcGxheSB3b3VsZG4ndCBtYXJrIHJvd3Mg aW4gdGhlCisgICAgICAgICAgICAgICBjdXJyZW50IG1hdHJpeCBpbnZhbGlkLCB0aGUgdGhpcmQg cmVkaXNwbGF5IG1pZ2h0IGJlCisgICAgICAgICAgICAgICB0ZW1wdGVkIHRvIG9wdGltaXplIHJl ZGlzcGxheSBiYXNlZCBvbiBsaW5lcyBkaXNwbGF5ZWQKKyAgICAgICAgICAgICAgIGluIHRoZSBm aXJzdCByZWRpc3BsYXkuICovCisgICAgICAgICAgICBpZiAoTUFUUklYX1JPV19CT1RUT01fWSAo cm93KSA+PSB5YikKKyAgICAgICAgICAgICAgZm9yIChpID0gdnBvcyArIDE7IGkgPCB3LT5jdXJy ZW50X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAgICAgICAgICAgICAgU0VUX01BVFJJWF9S T1dfRU5BQkxFRF9QICh3LT5jdXJyZW50X21hdHJpeCwgaSwgZmFsc2UpOworICAgICAgICAgIH0K KyAgICAgIC8qIFdhcyBkaXNwbGF5IHByZWVtcHRlZD8gKi8KKyAgICAgIHBhdXNlZF9wID0gcm93 IDwgZW5kOworICAgICAgc2V0X2N1cnNvcjoKKyAgICAgIC8qIElmIHdlIGp1bXBlZCBoZXJlIGZy b20gYHNldF9jdXJzb3JgLCB0aGVuIHNldCB0aGUgYGN1cnNvcl9tYXRyaXhgLiAqLworICAgICAg aWYgKGN1cnNvcl9tYXRyaXggPT0gTlVMTCkKKyAgICAgICAgY3Vyc29yX21hdHJpeCA9IHctPmN1 cnJlbnRfbWF0cml4OworICAgICAgLyogUmVzZXQgYHJvd2AgdG8gMCBzbyB0aGF0IGZha2UgY3Vy c29ycyBjYW4gYmUgZHJhd24gb24gcm93cyBwcmVjZWRpbmcgdGhlCisgICAgICBmaXJzdCBgcm93 LT5lbmFibGVkX3BgLiAgSnVzdCBwcmlvciB0byB0aGUgY2FsbCB0byBgc2Nyb2xsaW5nX3dpbmRv dycgYWJvdmUsCisgICAgICBgcm93YCB3YXMgYWR2YW5jZWQgdG8gdGhlIGZpcnN0IGByb3ctPmVu YWJsZWRfcGAuICovCisgICAgICBmb3IgKHN0cnVjdCBnbHlwaF9yb3cgKmRlc2lyZWRfcm93ID0g TUFUUklYX1JPVyAody0+ZGVzaXJlZF9tYXRyaXgsIDApOworICAgICAgICAgICBkZXNpcmVkX3Jv dyA8IGVuZAorICAgICAgICAgICAmJiAoZm9yY2VfcCB8fCAhaW5wdXRfcGVuZGluZykKKyAgICAg ICAgICAgLyogVzMyIEVtYWNzIGNyYXNoZXMgb24gc3RhcnR1cCB3aXRob3V0IGEgQlVGRkVSUCBj aGVjay4gKi8KKyAgICAgICAgICAgJiYgQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAg ICYmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAg ICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFp cnMpKQorICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgZmNfdmlzaWJsZSkpKTsKKyAgICAgICAgICAgKytkZXNpcmVkX3JvdykKKyAgICAgICAgewor ICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChkZXNpcmVkX3Jvdywgdy0+ZGVz aXJlZF9tYXRyaXgpOworICAgICAgICAgIGlmIChkZXNpcmVkX3Jvdy0+ZW5hYmxlZF9wKQorICAg ICAgICAgICAgY29udGludWU7CisgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqYm90dG9tX3Jv dyA9IE1BVFJJWF9CT1RUT01fVEVYVF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB3KTsKKyAgICAg ICAgICBpbnQgYm90dG9tX3Zwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKGJvdHRvbV9yb3csIHctPmN1 cnJlbnRfbWF0cml4KTsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpjdXJyZW50X3JvdyA9 IE1BVFJJWF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB2cG9zKTsKKyAgICAgICAgICBlbnVtIG1j X3Jvd19wb3NpdGlvbiByb3dfcG9zaXRpb24gPSBtY19yb3dfcG9zaXRpb24gKGN1cnJlbnRfcm93 LCBjdXJyZW50X3JvdywgdnBvcyk7CisgICAgICAgICAgaWYgKGN1cnJlbnRfcm93LT5lbmFibGVk X3ApCisgICAgICAgICAgICBtY19kcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgsIGN1cnJl bnRfcm93LCBjdXJyZW50X3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgICAgICAg ICAgICAgICAgY3VycmVudF9yb3ctPngsIGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0sIHZw b3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgYm90dG9tX3Zwb3MsIGN1cnNvcl9tYXRyaXgs IGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3 X3AsIFNFVF9DVVJTT1JfT05FKTsKKyAgICAgICAgfQorCisgICAgICBtY19yZXN0b3JlX2dseXBo X21hdHJpeCAoc2F2ZWRfZGVzaXJlZCwgdy0+ZGVzaXJlZF9tYXRyaXgpOworICAgICAgbWNfcmVz dG9yZV9nbHlwaF9tYXRyaXggKHNhdmVkX2N1cnJlbnQsIHctPmN1cnJlbnRfbWF0cml4KTsKKwor ICAgICAgbWNfdXBkYXRlX3dpbmRvd19lcmFzZSAodywgb2xkX21hdHJpeCk7CisKKyAgICAgIG1j X3hmcmVlX2NhY2hlX21hdHJpeCAodywgJm9sZF9tYXRyaXgpOworCisgICAgfQorICAvLyBjbG9j a190IGNsb2NrX2VuZCA9IGNsb2NrKCk7CisgIC8vIGRvdWJsZSBjcHVfdGltZV91c2VkID0gKChk b3VibGUpIChjbG9ja19lbmQgLSBjbG9ja19zdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7CisgIC8v IGZwcmludGYgKHN0ZGVyciwgIm1jX3Njcm9sbGluZ193aW5kb3cgKCVzKTogIFRJTUUgKCVmKVxu IiwgbWNfd2luZG93ICh3KSwgY3B1X3RpbWVfdXNlZCk7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1D VVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBTdHJ1Y3R1cmUgdG8g cGFzcyBkaW1lbnNpb25zIGFyb3VuZC4gIFVzZWQgZm9yIGNoYXJhY3RlciBib3VuZGluZwogICAg Ym94ZXMsIGdseXBoIG1hdHJpeCBkaW1lbnNpb25zIGFuZCBhbGlrZS4gICovCiAKQEAgLTIyNDEs NiArNDA1MSwxNiBAQCBmcmVlX3dpbmRvd19tYXRyaWNlcyAoc3RydWN0IHdpbmRvdyAqdykKIAkg IGZyZWVfZ2x5cGhfbWF0cml4ICh3LT5jdXJyZW50X21hdHJpeCk7CiAJICBmcmVlX2dseXBoX21h dHJpeCAody0+ZGVzaXJlZF9tYXRyaXgpOwogCSAgdy0+Y3VycmVudF9tYXRyaXggPSB3LT5kZXNp cmVkX21hdHJpeCA9IE5VTEw7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKyAgbWNfeGZyZWVfY2FjaGVfbWF0cml4ICh3LCAmdy0+bWNfbWF0 cml4KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCX0KIAogICAgICAgLyogTmV4 dCB3aW5kb3cgb24gc2FtZSBsZXZlbC4gICovCkBAIC0zMzg3LDYgKzUyMDcsMjggQEAgY2hlY2tf Y3VycmVudF9tYXRyaXhfZmxhZ3MgKHN0cnVjdCB3aW5kb3cgKncpCiBzdGF0aWMgYm9vbAogdXBk YXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wKQogeworCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlmICh0cmFj ZV9yZWRpc3BsYXlfcCkKKyAgICBmcHJpbnRmIChzdGRlcnIsICJ1cGRhdGVfd2luZG93ICglcylc biIsIG1jX3dpbmRvdyAodykpOworCisgIGJvb2wgZHJhd19wID0gdHJ1ZTsKKworICBzdHJ1Y3Qg bWNfZXNzZW50aWFscyBlc3NlbnRpYWxzOworICBtY19zZXRfZXNzZW50aWFscyAodywgJmVzc2Vu dGlhbHMpOworCisgIG1jX3VwZGF0ZV93aW5kb3dfZHJ5cnVuICh3LCBmb3JjZV9wLCBlc3NlbnRp YWxzKTsKKworICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICpjdXJzb3JfbWF0cml4ID0gTlVMTDsKKwor ICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKworCiAgIHN0cnVjdCBnbHlwaF9tYXRyaXggKmRlc2lyZWRfbWF0 cml4ID0gdy0+ZGVzaXJlZF9tYXRyaXg7CiAgIGJvb2wgcGF1c2VkX3A7CiAgIGludCBwcmVlbXB0 X2NvdW50ID0gY2xpcF90b19ib3VuZHMgKDEsIGJhdWRfcmF0ZSAvIDI0MDAgKyAxLCBJTlRfTUFY KTsKQEAgLTM0NjAsNiArNTMwMiw0NyBAQCB1cGRhdGVfd2luZG93IChzdHJ1Y3Qgd2luZG93ICp3 LCBib29sIGZvcmNlX3ApCiAJICAgIH0KIAl9CiAKKworLyogKioqKioqKioqKioqKioqKioqK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gIGlmIChtY19yb3ctPmVuYWJsZWRfcAorICAgICAg ICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgIHsKKyAgICAgICAgICBjdXJz b3JfbWF0cml4ID0gZGVzaXJlZF9tYXRyaXg7CisgICAgICAgICAgaWYgKCFmb3JjZV9wICYmICsr bl91cGRhdGVkICUgcHJlZW1wdF9jb3VudCA9PSAwKQorICAgICAgICAgICAgZGV0ZWN0X2lucHV0 X3BlbmRpbmdfaWdub3JlX3NxdWVlemFibGVzICgpOworICAgICAgICAgIGNoYW5nZWRfcCB8PSAo QlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoIU5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3No YWlycykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgISBOSUxQIChCVkFSIChYQlVG RkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKSkpCisgICAgICAgICAgICAgICAgICAgICAg ID8gbWNfdXBkYXRlX3dpbmRvd19saW5lICh3LCB2cG9zLCAmbW91c2VfZmFjZV9vdmVyd3JpdHRl bl9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vy c29yX21hdHJpeCwgZXNzZW50aWFscywgZHJhd19wKQorICAgICAgICAgICAgICAgICAgICAgICA6 IHVwZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCk7 CisgICAgICAgICAgaWYgKE1BVFJJWF9ST1dfQk9UVE9NX1kgKHJvdykgPj0geWIpCisgICAgICAg ICAgICBmb3IgKGludCBpID0gdnBvcyArIDE7IGkgPCB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3Mg LSAxOyArK2kpCisgICAgICAgICAgICAgIFNFVF9NQVRSSVhfUk9XX0VOQUJMRURfUCAody0+Y3Vy cmVudF9tYXRyaXgsIGksIGZhbHNlKTsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAg IH0KKworICBjdXJzb3JfbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKICAgICAgIC8qIFVwZGF0ZSB0aGUgcmVzdCBvZiB0aGUgbGluZXMu ICAqLwogICAgICAgZm9yICg7IHJvdyA8IGVuZCAmJiAoZm9yY2VfcCB8fCAhaW5wdXRfcGVuZGlu Zyk7ICsrcm93KQogCS8qIHNjcm9sbGluZ193aW5kb3cgcmVzZXRzIHRoZSBlbmFibGVkX3AgZmxh ZyBvZiB0aGUgcm93cyBpdApAQCAtMzQ2Nyw2ICs1MzUwLDE5IEBAIHVwZGF0ZV93aW5kb3cgKHN0 cnVjdCB3aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkKIAlpZiAocm93LT5lbmFibGVkX3ApCiAJICB7 CiAJICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIGRlc2lyZWRfbWF0cml4KTsK KworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwor ICAgICAgICAgIC8qIElmIHRoZSBgY3Vyc29yX3Jvd2AgaXMgd2l0aGluIHRoZSBgZGVzaXJlZF9t YXRyaXhgLCB0aGVuIGl0IHdhcworICAgICAgICAgIHByb2Nlc3NlZCBoZXJlaW5hYm92ZSBhbmQg c2hvdWxkIGJlIHNraXBwZWQgYXQgdGhpcyB0aW1lLiAqLworICAgICAgICAgIGlmICh2cG9zID09 IHctPmN1cnNvci52cG9zKQorICAgICAgICAgIGNvbnRpbnVlOworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKworCiAJICAgIGludCBpOwogCiAJICAgIC8qIFdlJ2xsIGhhdmUgdG8gcGxheSBh IGxpdHRsZSBiaXQgd2l0aCB3aGVuIHRvCkBAIC0zNDc1LDggKzUzNzEsMjEgQEAgdXBkYXRlX3dp bmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wKQogCSAgICAgICBjb21tYW5kcyB3 aWxsIHRvbyBxdWlja2x5IHBhdXNlIHJlZGlzcGxheS4gICovCiAJICAgIGlmICghZm9yY2VfcCAm JiArK25fdXBkYXRlZCAlIHByZWVtcHRfY291bnQgPT0gMCkKIAkgICAgICBkZXRlY3RfaW5wdXRf cGVuZGluZ19pZ25vcmVfc3F1ZWV6YWJsZXMgKCk7Ci0JICAgIGNoYW5nZWRfcCB8PSB1cGRhdGVf d2luZG93X2xpbmUgKHcsIHZwb3MsCi0JCQkJCSAgICAgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5f cCk7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKyAgICAgICAgICBjaGFuZ2VkX3AgfD0gKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAg ICAgICAgICAgICAgICAgICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IG1jX2NvbmYpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHx8ICEgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxl KSkpKQorICAgICAgICAgICAgICAgICAgICAgICA/IG1jX3VwZGF0ZV93aW5kb3dfbGluZSAodywg dnBvcywgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIGRyYXdf cCkKKyAgICAgICAgICAgICAgICAgICAgICAgOiB1cGRhdGVfd2luZG93X2xpbmUgKHcsIHZwb3Ms ICZtb3VzZV9mYWNlX292ZXJ3cml0dGVuX3ApOworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KwogCiAJICAgIC8qIE1hcmsgYWxsIHJvd3MgYmVsb3cgdGhlIGxhc3QgdmlzaWJsZSBvbmUgaW4g dGhlIGN1cnJlbnQKIAkgICAgICAgbWF0cml4IGFzIGludmFsaWQuICBUaGlzIGlzIG5lY2Vzc2Fy eSBiZWNhdXNlIG9mCkBAIC0zNDk3LDYgKzU0MDYsNDQgQEAgdXBkYXRlX3dpbmRvdyAoc3RydWN0 IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wKQogCiAgICAgc2V0X2N1cnNvcjoKIAorCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAvKiBJZiB3ZSBq dW1wZWQgaGVyZSBmcm9tIGBzZXRfY3Vyc29yYCwgdGhlbiBzZXQgdGhlIGBjdXJzb3JfbWF0cml4 YC4gKi8KKyAgaWYgKGN1cnNvcl9tYXRyaXggPT0gTlVMTCkKKyAgICBjdXJzb3JfbWF0cml4ID0g d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93ICpib3R0b21fcm93ID0gTUFUUklY X0JPVFRPTV9URVhUX1JPVyAody0+Y3VycmVudF9tYXRyaXgsIHcpOworICAgICAgaW50IGJvdHRv bV92cG9zID0gTUFUUklYX1JPV19WUE9TIChib3R0b21fcm93LCB3LT5jdXJyZW50X21hdHJpeCk7 CisgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpjdXJyZW50X3JvdyA9IE1BVFJJWF9ST1cgKHctPmN1 cnJlbnRfbWF0cml4LCB2cG9zKTsKKyAgICAgIGVudW0gbWNfcm93X3Bvc2l0aW9uIHJvd19wb3Np dGlvbiA9IG1jX3Jvd19wb3NpdGlvbiAoY3VycmVudF9yb3csIGN1cnJlbnRfcm93LCB2cG9zKTsK KyAgICAgIGlmIChjdXJyZW50X3Jvdy0+ZW5hYmxlZF9wKQorICAgICAgICBtY19kcmF3X3JvdyAo dywgdy0+Y3VycmVudF9tYXRyaXgsIGN1cnJlbnRfcm93LCBjdXJyZW50X3Jvdy0+Z2x5cGhzW1RF WFRfQVJFQV0sCisgICAgICAgICAgICAgICAgICAgICBjdXJyZW50X3Jvdy0+eCwgY3VycmVudF9y b3ctPnVzZWRbVEVYVF9BUkVBXSwgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgIGJvdHRvbV92 cG9zLCBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sCisgICAgICAgICAg ICAgICAgICAgICBkcmF3X3AsIFNFVF9DVVJTT1JfVFdPKTsKKyAgICB9CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKICAgICAgIC8qIFVwZGF0ZSB0aGUgaGVhZGVyIGxpbmUgYWZ0ZXIg c2Nyb2xsaW5nIGJlY2F1c2UgYSBuZXcgaGVhZGVyCiAJIGxpbmUgd291bGQgb3RoZXJ3aXNlIG92 ZXJ3cml0ZSBsaW5lcyBhdCB0a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XRyaXgtPm5yb3dzOyArK2kp CisgICAgeworICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93ID0gdy0+Y3VycmVudF9tYXRyaXgt PnJvd3MgKyBpOworICAgICAgaWYgKCFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgYnJlYWs7Cisg ICAgICAgIGVsc2UgaWYgKHJvdy0+bW9kZV9saW5lX3ApCisgICAgICAgICAgY29udGludWU7Cisg ICAgICBpZiAocm93LT5vdmVybGFwcGVkX3ApCisgICAgICAgIHsKKyAgICAgICAgICBmb3IgKGVu dW0gZ2x5cGhfcm93X2FyZWEgYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFyZWEgPCBMQVNUX0FS RUE7ICsrYXJlYSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgb3V0cHV0X2N1cnNvcl90 byAodywgaSwgMCwgcm93LT55LCBhcmVhID09IFRFWFRfQVJFQSA/IHJvdy0+eCA6IDApOworICAg ICAgICAgICAgICBpZiAoKHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbTUNfQ0FDSEVdID4gMCB8 fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0NIX0NBQ0hFXSA+IDAgfHwgdy0+bWNfbWF0cml4 LmN1cnNvcnNfdXNlZFtGQ19DQUNIRV0gPiAwKQorICAgICAgICAgICAgICAgICAgJiYgYXJlYSA9 PSBURVhUX0FSRUEKKyAgICAgICAgICAgICAgICAgICYmIHJvdy0+dXNlZFthcmVhXSkKKyAgICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRy aXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAgICAgICAgICAgICAgICAgIGludCBzdGFydF94ID0g cm93LT54OworICAgICAgICAgICAgICAgICAgaW50IHN0YXJ0X2hwb3MgPSAwOworICAgICAgICAg ICAgICAgICAgaW50IGVuZF9ocG9zID0gcm93LT51c2VkW2FyZWFdOworICAgICAgICAgICAgICAg ICAgYm9vbCBjbGVhcl9lb2xfcCA9IHRydWU7CisgICAgICAgICAgICAgICAgICBlbnVtIGRyYXdf Z2x5cGhzX2ZhY2UgaGwgPSBEUkFXX05PUk1BTF9URVhUOworICAgICAgICAgICAgICAgICAgbWNf cmVkcmF3X3JvdyAodywgbWF0cml4LCByb3csIHN0YXJ0X3gsIHN0YXJ0X2hwb3MsIGVuZF9ocG9z LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJfZW9sX3AsIGhsKTsKKyAg ICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSBpZiAocm93LT51c2VkW2FyZWFd KQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBGUkFNRV9SSUYgKGYp LT53cml0ZV9nbHlwaHMgKHcsIHJvdywgcm93LT5nbHlwaHNbYXJlYV0sIGFyZWEsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT51c2VkW2FyZWFd KTsKKyAgICAgICAgICAgICAgICAgICAgRlJBTUVfUklGIChmKS0+Y2xlYXJfZW5kX29mX2xpbmUg KHcsIHJvdywgYXJlYSwgLTEpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQor ICAgICAgICAgIHJvdy0+b3ZlcmxhcHBlZF9wID0gMDsKKyAgICAgICAgfQorICAgICAgaWYgKE1B VFJJWF9ST1dfQk9UVE9NX1kgKHJvdykgPj0geWIpCisgICAgICAgIGJyZWFrOworICAgIH0KKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgICAgIHJlZHJhd19vdmVybGFwcGluZ19y b3dzICh3LCB5Yik7CiAJICAgIH0KICNlbmRpZgpAQCAtMzUzMSwxMCArNTUyOSwyMSBAQCB1cGRh dGVfd2luZG93IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3ApCiAgICAgICBzdHJjcHkg KHctPmN1cnJlbnRfbWF0cml4LT5tZXRob2QsIHctPmRlc2lyZWRfbWF0cml4LT5tZXRob2QpOwog I2VuZGlmCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JT ICovCisKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KKyAgaWYgKEJVRkZFUlAgKHctPmNvbnRl bnRzKQorICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3No YWlycykpKQorICAgIG1jX3VwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgMCk7CisgICAgZWxzZQog ICAgICAgdXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCAwKTsKICNlbmRpZgogCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAgICAgICAvKiBFbmQgdGhlIHVwZGF0ZSBvZiB3aW5kb3cgVy4g IERvbid0IHNldCB0aGUgY3Vyc29yIGlmIHdlCiAgICAgICAgICBwYXVzZWQgdXBkYXRpbmcgdGhl IGRpc3BsYXkgYmVjYXVzZSBpbiB0aGlzIGNhc2UsCiAgICAgICAgICBzZXRfd2luZG93X2N1cnNv cl9hZnRlcl91cGRhdGUgaGFzbid0IGJlZW4gY2FsbGVkLCBhbmQKZGlmZiAtLWdpdCBhL3NyYy9m cmFtZS5oIGIvc3JjL2ZyYW1lLmgKaW5kZXggZWM4ZjYxNC4uZWVhZjcxZSAxMDA2NDQKLS0tIGEv c3JjL2ZyYW1lLmgKKysrIGIvc3JjL2ZyYW1lLmgKQEAgLTIwNSw2ICsyMDUsMTYgQEAgc3RydWN0 IGZyYW1lCiAgIExpc3BfT2JqZWN0IHRvb2xfYmFyX2l0ZW1zOwogICAvKiB0b29sX2Jhcl9pdGVt cyBzaG91bGQgYmUgdGhlIGxhc3QgTGlzcF9PYmplY3QgbWVtYmVyLiAgKi8KIAorCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAvKiBOb24tbmls IHdoZW4gdGhlIGZyYW1lIGlzIGluIHRoZSBwcm9jZXNzIG9mIGJlaW5nIHVwZGF0ZWQuICovCisg IHN0cnVjdCBmcmFtZSAqbWNfdXBkYXRpbmdfZnJhbWU7CisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKICAgLyogQ2FjaGUgb2YgcmVhbGl6ZWQgZmFjZXMuICAqLwogICBzdHJ1Y3QgZmFj ZV9jYWNoZSAqZmFjZV9jYWNoZTsKIApkaWZmIC0tZ2l0IGEvc3JjL2ZyaW5nZS5jIGIvc3JjL2Zy aW5nZS5jCmluZGV4IDMzNWE2ZWIuLjVlN2JkMTcgMTAwNjQ0Ci0tLSBhL3NyYy9mcmluZ2UuYwor KysgYi9zcmMvZnJpbmdlLmMKQEAgLTQzOCw2ICs0MzgsNDYwIEBAIHN0YXRpYyB1bnNpZ25lZCBz aG9ydCBlbXB0eV9saW5lX2JpdHNbXSA9IHsKICNkZWZpbmUgU1RBTkRBUkRfQklUTUFQX0hFSUdI VChiaXRzKSAoc2l6ZW9mIChiaXRzKS9CWVRFU19QRVJfQklUTUFQX1JPVykKICNkZWZpbmUgRlJC SVRTKGJpdHMpICBiaXRzLCBTVEFOREFSRF9CSVRNQVBfSEVJR0hUIChiaXRzKQogCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCisvKiBg Ky1mcmluZ2UtaGVscGVyLWRlY2ltYWwnIGRlZmluZWQgaW4gYGNyb3NzaGFpcnMuZWxgICovCisK Ky8qIFRPRE86ICBDb25zaWRlciBhZGRpbmcgdGhlIGZvbGxvd2luZyBmcmluZ2UgYml0bWFwczoK KyAgKGRlZmluZS1mcmluZ2UtYml0bWFwICdicmVha3BvaW50ICJceDNjXHg3ZVx4ZmZceGZmXHhm Zlx4ZmZceDdlXHgzYyIpCisgIChkZWZpbmUtZnJpbmdlLWJpdG1hcCAnaG9sbG93LXJpZ2h0LXRy aWFuZ2xlICJceGUwXHg5MFx4ODhceDg0XHg4NFx4ODhceDkwXHhlMCIpICovCisKKy8qIDI0Cisg ICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInguLi4uLi4uIgorICAgICAg InguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLnh4Li4uIgorICAgICAgIngu Li54eC4uIgorICAgICAgInguLi4ueHguIgorICAgICAgIngueHh4eHh4IgorICAgICAgIngueHh4 eHh4IgorICAgICAgInguLi4ueHguIgorICAgICAgInguLi54eC4uIgorICAgICAgInguLnh4Li4u IgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIikK KyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93X2Jp dHNbXSA9eworICAweDgwLCAweDgwLCAweDgwLCAweDk4LCAweDhjLCAweDg2LCAweGJmLAorICAw eGJmLCAweDg2LCAweDhjLCAweDk4LCAweDgwLCAweDgwLCAweDgwfTsKKworLyogMjUKKyAgICAo Ky1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4u Li4ueHgiCisgICAgICAiLi4uLi4ueHgiCisg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IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQg bWNfcmV2ZXJzZWRfdmVydGljYWxfYmFyX2JpdHNbXSA9eworICAweDMsIDB4MywgMHgzLCAweDMs IDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4M307CisKKy8q IDMxCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Li4uLi4uIgor ICAgICAgInh4Li4uLi4uIgorICAgICAgIiB4eC4uLi4uIgorICAgICAgIi54eC4uLi4uIgorICAg ICAgIi4ueHguLi4uIgorICAgICAgIi4ueHguLi4uIgorICAgICAgIi4uLnh4Li4uIgorICAgICAg Ii4uLnh4Li4uIgorICAgICAgIi4uLi54eC4uIgorICAgICAgIi4uLi54eC4uIgorICAgICAgIi4u Li4ueHguIgorICAgICAgIi4uLi4ueHguIgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4u Lnh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfYmFja3NsYXNoX2JpdHNbXSA9ewor ICAweGMwLCAweGMwLCAweGUwLCAweDYwLCAweDMwLCAweDMwLCAweDE4LCAweDE4LCAweGMsIDB4 YywgMHg2LCAweDYsIDB4MywgMHgzfTsKKworLyogMzIKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhl eGFkZWNpbWFsCisgICAgICAieHguLi4uLi4iCisgICAgICAieHguLi4uLi4iCisgICAgICAieHh4 Li4uLi4iCisgICAgICAieHh4Li4uLi4iCisgICAgICAieC54eC4uLi4iCisgICAgICAieC54eC4u Li4iCisgICAgICAieC4ueHguLi4iCisgICAgICAieC4ueHguLi4iCisgICAgICAieC4uLnh4Li4i CisgICAgICAieC4uLnh4Li4iCisgICAgICAieC4uLi54eC4iCisgICAgICAieC4uLi54eC4iCisg ICAgICAieC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBz aG9ydCBtY192ZXJ0aWNhbF9iYXJfYmFja3NsYXNoX2JpdHNbXSA9eworICAweGMwLCAweGMwLCAw eGUwLCAweGUwLCAweGIwLCAweGIwLCAweDk4LAorICAweDk4LCAweDhjLCAweDhjLCAweDg2LCAw eDg2LCAweDgzLCAweDgzfTsKKworLyogMzMKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNp bWFsCisgICAgICAiLnh4eHh4eC4iCisgICAgICAieHh4eC54Li4iCisgICAgICAieHh4eC54Li4i CisgICAgICAieHh4eC54Li4iCisgICAgICAiLnh4eC54Li4iCisgICAgICAiLi4ueC54Li4iCisg ICAgICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAg ICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9y dCBtY19waWxjcm93X2JpdHNbXSA9eworICAweDdlLCAweGY0LCAweGY0LCAweGY0LCAweDc0LCAw eDE0LCAweDE0LCAweDE0LCAweDE0LCAweDE0LCAweDE0fTsKKworLyogMzQKKyAgICAoKy1mcmlu Z2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi54eHh4Li4iCisgICAgICAiLnh4eHh4eC4i CisgICAgICAieC4ueHguLngiCisgICAgICAieC4ueHguLngiCisgICAgICAieHh4eHh4eHgiCisg ICAgICAieHguLi4ueHgiCisgICAgICAieHh4Li54eHgiCisgICAgICAiLnh4eHh4eC4iCisgICAg ICAiLi54eHh4Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zbWlsZXlfZmFjZV9i aXRzW10gPXsKKyAgMHgzYywgMHg3ZSwgMHg5OSwgMHg5OSwgMHhmZiwgMHhjMywgMHhlNywgMHg3 ZSwgMHgzY307CisKKy8qIDM1CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAg ICAgIi4ueC4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAg Ii4uLi4ueC4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4u eC4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX3JpZ2h0 X2JpdHNbXSA9eworICAweDIwLCAweDEwLCAweDgsIDB4NCwgMHg4LCAweDEwLCAweDIwfTsKKwor LyogMzYKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi54Li4i CisgICAgICAiLi4uLnguLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54Li4uLi4iCisg ICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLnguLi4iCisgICAgICAiLi4uLi54Li4iKQorKi8K K3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zaW5nbGVfYW5nbGVfbGVmdF9iaXRzW10gPXsKKyAg MHg0LCAweDgsIDB4MTAsIDB4MjAsIDB4MTAsIDB4OCwgMHg0fTsKKworLyogMzcKKyAgICAoKy1m cmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHgueHguLi4iCisgICAgICAiLnh4Lnh4 Li4iCisgICAgICAiLi54eC54eC4iCisgICAgICAiLi4ueHgueHgiCisgICAgICAiLi54eC54eC4i CisgICAgICAiLnh4Lnh4Li4iCisgICAgICAieHgueHguLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25l ZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfcmlnaHRfYml0c1tdID17CisgIDB4ZDgsIDB4NmMsIDB4 MzYsIDB4MWIsIDB4MzYsIDB4NmMsIDB4ZDh9OworCisvKiAzOAorICAgICgrLWZyaW5nZS1oZWxw ZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi54eC54eCIKKyAgICAgICIuLnh4Lnh4LiIKKyAgICAg ICIueHgueHguLiIKKyAgICAgICJ4eC54eC4uLiIKKyAgICAgICIueHgueHguLiIKKyAgICAgICIu Lnh4Lnh4LiIKKyAgICAgICIuLi54eC54eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1j X2RvdWJsZV9hbmdsZV9sZWZ0X2JpdHNbXSA9eworICAweDFiLCAweDM2LCAweDZjLCAweGQ4LCAw eDZjLCAweDM2LCAweDFifTsKKworLyogMzkKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNp bWFsCisgICAgICAieC54LnguLi4iCisgICAgICAiLngueC54Li4iCisgICAgICAiLi54LngueC4i CisgICAgICAiLi4ueC54LngiCisgICAgICAiLi54LngueC4iCisgICAgICAiLngueC54Li4iCisg ICAgICAieC54LnguLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190cmlwbGVfYW5n bGVfcmlnaHRfYml0c1tdID17CisgIDB4YTgsIDB4NTQsIDB4MmEsIDB4MTUsIDB4MmEsIDB4NTQs IDB4YTh9OworCisvKiA0MAorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAg ICIuLi54LngueCIKKyAgICAgICIuLngueC54LiIKKyAgICAgICIueC54LnguLiIKKyAgICAgICJ4 LngueC4uLiIKKyAgICAgICIueC54LnguLiIKKyAgICAgICIuLngueC54LiIKKyAgICAgICIuLi54 LngueCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3RyaXBsZV9hbmdsZV9sZWZ0X2Jp dHNbXSA9eworICAweDE1LCAweDJhLCAweDU0LCAweGE4LCAweDU0LCAweDJhLCAweDE1fTsKKwor LyogNDEKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4i CisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisg ICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAg ICAieC4uLi4ueC4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAi Li4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBt Y19zaW5nbGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4 MTAsIDB4MjgsIDB4NDQsIDB4ODIsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9OworCisvKiA0Mgor ICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4uLiIKKyAgICAg ICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICJ4 Li4uLi54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIuLi54 Li4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4u LiIKKyAgICAgICIuLi4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3Npbmds ZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDgyLCAw eDQ0LCAweDI4LCAweDEwLCAweDAwLCAweDAwLCAweDAwLCAweDAwfTsKKworLyogNDMKKyAgICAo Ky1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4u Li4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54Lngu Li4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4i CisgICAgICAiLnguLi54Li4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLi4uLi4uLi4iCisg ICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBz aG9ydCBtY19kb3VibGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4MDAsIDB4MDAsIDB4MDAsIDB4 MTAsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4ODIsIDB4MDAsIDB4MDAsIDB4MDB9 OworCisvKiA0NAorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4u Li4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICJ4Li4uLi54 LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIK KyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAg ICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIpCisqLwor c3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX2RvdWJsZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAw eDAwLCAweDAwLCAweDAwLCAweDgyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDEw LCAweDAwLCAweDAwLCAweDAwfTsKKworLyogNDUKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFk ZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54Lngu Li4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4i CisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisg ICAgICAiLnguLi54Li4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLi4uLi4uLi4iKQorKi8K K3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190cmlwbGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4 MDAsIDB4MTAsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQs IDB4ODIsIDB4MDB9OworCisvKiA0NgorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwK KyAgICAgICIuLi4uLi4uLiIKKyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIueC4uLnguLiIKKyAg ICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAg ICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIu LngueC4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLi4uLi4uLiIpCisqLworc3RhdGlj IHVuc2lnbmVkIHNob3J0IG1jX3F1YWRydXBsZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAweDAw LCAweDgyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAw eDEwLCAweDAwfTsKKworLyogNDcKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisg ICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAg ICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAi eC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4u eC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4uLi4u eC4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19xdWFkcnVwbGVfYW5nbGVfdXBfYml0 c1tdID17CisgID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ID8gMiA6IDApOworICBpZiAoKGNtYXAg PSBCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKSwg IU5JTFAgKGNtYXApKQorICAgIHsKKyAgICAgIGJtMSA9IG1jX2Fzc3EgKGJpdG1hcCwgY21hcCk7 CisgICAgICBpZiAoQ09OU1AgKGJtMSkpCisgIHsKKyAgICBpZiAoKGJtMSA9IFhDRFIgKGJtMSkp LCBOSUxQIChibTEpKQorICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgaWYg KENPTlNQIChibTEpKQorICAgICAgeworICAgICAgICBsbjEgPSBYRklYTlVNIChGbGVuZ3RoIChi bTEpKTsKKyAgICAgICAgaWYgKHBhcnRpYWxfcCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBp ZiAobG4xID4gaXgyKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgYm0gPSBtY19u dGggKGl4MiwgYm0xKTsKKyAgICAgICAgICAgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAg ICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAg ICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChsbjEgPiBpeDEpCisgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBibSA9IG1jX250aCAoaXgxLCBibTEpOworICAg ICAgICAgICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAgICAgICAgICBnb3RvIGZv dW5kOworICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgfQorICAgIGVsc2UgaWYg KChibSA9IGJtMSwgIUVRIChibSwgUXQpKSkKKyAgICAgIGdvdG8gZm91bmQ7CisgIH0KKyAgICB9 CisgIGlmICghRVEgKGNtYXAsIEJWQVIgKCZidWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9pbmRpY2F0 b3JfYWxpc3QpKQorICAgICAgJiYgIU5JTFAgKEJWQVIgKCZidWZmZXJfZGVmYXVsdHMsIGZyaW5n ZV9pbmRpY2F0b3JfYWxpc3QpKSkKKyAgICB7CisgICAgICBibTIgPSBtY19hc3NxIChiaXRtYXAs IEJWQVIgKCZidWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKTsKKyAgICAg IGlmIChDT05TUCAoYm0yKSkKKyAgICAgICAgeworICAgICAgICAgIGlmICgoYm0yID0gWENEUiAo Ym0yKSksICFOSUxQIChibTIpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAoQ09O U1AgKGJtMikpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgbG4yID0gWEZJ WE5VTSAoRmxlbmd0aCAoYm0yKSk7CisgICAgICAgICAgICAgICAgICBpZiAocGFydGlhbF9wKQor ICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgaWYgKGxuMiA+IGl4 MikKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAg Ym0gPSBtY19udGggKGl4MiwgYm0yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFF USAoYm0sIFF0KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5kOworICAg ICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICBpZiAobG4xID4gaXgx KQorICAgIHsKKyAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMSk7CisgICAgICBpZiAoIUVRIChi bSwgUXQpKQorICAgICAgICBnb3RvIGZvdW5kOworICAgIH0KKyAgaWYgKGxuMiA+IGl4MSkKKyAg ICB7CisgICAgICBibSA9IG1jX250aCAoaXgxLCBibTIpOworICAgICAgaWYgK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bCBiaXRtYXAuICAqLworICBpZiAoKGNtYXAgPSBC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKSwgIU5J TFAgKGNtYXApKQorICAgIHsKKyAgICAgIGJtMSA9IG1jX2Fzc3EgKGJpdG1hcCwgY21hcCk7Cisg ICAgICBpZiAoQ09OU1AgKGJtMSkpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoKGJtMSA9IFhD RFIgKGJtMSkpLCBOSUxQIChibTEpKQorICAgICAgICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9C SVRNQVA7CisgICAgICAgICAgaWYgKENPTlNQIChibTEpKQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBsbjEgPSBYRklYTlVNIChGbGVuZ3RoIChibTEpKTsKKyAgICAgICAgICAgICAgaWYg KHBhcnRpYWxfcCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBpZiAobG4x ID4gaXgyKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgYm0g PSBtY19udGggKGl4MiwgYm0xKTsKKyAgICAgICAgICAgICAgICAgICAgICBpZiAoIUVRIChibSwg UXQpKQorICAgICAgICAgICAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGlmIChsbjEgPiBpeDEpCisgICAgICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBibSA9IG1jX250aCAoaXgxLCBibTEpOwor ICAgICAgICAgICAgICAgICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAgICAgICAg ICAgICAgICBnb3RvIGZvdW5kOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAg ICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAoKGJtID0gYm0xLCAhRVEg KGJtLCBRdCkpKQorICAgICAgICAgICAgICBnb3RvIGZvdW5kOworICAgICAgICB9CisgICAgfQor ICBpZiAoIUVRIChjbWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9y X2FsaXN0KSkKKyAgICAgICYmICFOSUxQIChCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2Vf aW5kaWNhdG9yX2FsaXN0KSkpCisgICAgeworICAgICAgYm0yID0gbWNfYXNzcSAoYml0bWFwLCBC VkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSk7CisgICAgICBp ZiAoQ09OU1AgKGJtMikpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoKGJtMiA9IFhDRFIgKGJt MikpLCAhTklMUCAoYm0yKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKENPTlNQ IChibTIpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGxuMiA9IFhGSVhO VU0gKEZsZW5ndGggKGJtMikpOworICAgICAgICAgICAgICAgICAgaWYgKHBhcnRpYWxfcCkKKyAg ICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGlmIChsbjIgPiBpeDIp CisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGJt ID0gbWNfbnRoIChpeDIsIGJtMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghRVEg KGJtLCBRdCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAg ICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgaWYgKGxuMSA+I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3VuZGFyeV90b3AgPSBib3Vu ZGFyeV9ib3QgPSBhcnJvd190b3AgPSBhcnJvd19ib3QgPSBpbmQ7CisgICAgICAgIGVsc2UgaWYg KENPTlNQIChpbmQpCisgICAgICAgICAgICAgICAgICYmIENPTlNQIChYQ0FSIChpbmQpKSkKKyAg ICAgICAgeworICAgICAgICAgIExpc3BfT2JqZWN0IHBvczsKKyAgICAgICAgICBpZiAocG9zID0g bWNfYXNzcSAoUXQsIGluZCksICFOSUxQIChwb3MpKQorICAgICAgICAgICAgYm91bmRhcnlfdG9w ID0gYm91bmRhcnlfYm90ID0gYXJyb3dfdG9wID0gYXJyb3dfYm90ID0gWENEUiAocG9zKTsKKyAg ICAgICAgICBpZiAocG9zID0gbWNfYXNzcSAoUXRvcCwgaW5kKSwgIU5JTFAgKHBvcykpCisgICAg ICAgICAgICBib3VuZGFyeV90b3AgPSBYQ0RSIChwb3MpOworICAgICAgICAgIGlmIChwb3MgPSBt Y19hc3NxIChRYm90dG9tLCBpbmQpLCAhTklMUCAocG9zKSkKKyAgICAgICAgICAgIGJvdW5kYXJ5 X2JvdCA9IFhDRFIgKHBvcyk7CisgICAgICAgICAgaWYgKHBvcyA9IG1jX2Fzc3EgKFF1cCwgaW5k KSwgIU5JTFAgKHBvcykpCisgICAgICAgICAgICBhcnJvd190b3AgPSBYQ0RSIChwb3MpOworICAg ICAgICAgIGlmIChwb3MgPSBtY19hc3NxIChRZG93biwgaW5kKSwgIU5JTFAgKHBvcykpCisgICAg ICAgICAgICBhcnJvd19ib3QgPSBYQ0RSIChwb3MpOworICAgICAgICB9CisgICAgICAgIGVsc2UK KyAgICAgICAgICAvKiBBbnl0aGluZyBlbHNlIG1lYW5zIGJvdW5kYXJ5IG9uIGxlZnQgYW5kIG5v IGFycm93cy4gICovCisgICAgICAgICAgYm91bmRhcnlfdG9wID0gYm91bmRhcnlfYm90ID0gUWxl ZnQ7CisgICAgfQorICB0b3BfaW5kX3JuID0gYm90X2luZF9ybiA9IC0xOworICBpZiAoIU5JTFAg KGluZCkpCisgICAgeworICAgICAgZm9yICh5ID0gdy0+dnNjcm9sbCwgcm4gPSAwOworICAgICAg ICAgICB5IDwgeWIgJiYgcm4gPCBucm93czsKKyAgICAgICAgICAgeSArPSByb3ctPmhlaWdodCwg KytybikKKyAgICAgICAgeworICAgICAgICAgIHJvdyA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dz ICsgcm47CisgICAgICAgICAgaWYgKCFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgICAgIHJvdyA9 IHctPmN1cnJlbnRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgcm93LT5pbmRpY2F0ZV9i b2JfcCA9IHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcCA9IDA7CisgICAgICAgICAgcm93LT5pbmRp Y2F0ZV9lb2JfcCA9IHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCA9IDA7CisgICAgICAgICAg aWYgKCFyb3ctPm1vZGVfbGluZV9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAo dG9wX2luZF9ybiA8IDAgJiYgcm93LT52aXNpYmxlX2hlaWdodCA+IDApCisgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgaWYgKE1BVFJJWF9ST1dfU1RBUlRfQ0hBUlBPUyAocm93 KSA8PSBCVUZfQkVHViAoWEJVRkZFUiAody0+Y29udGVudHMpKQorICAgICAgICAgICAgICAgICAg ICAgICYmICFNQVRSSVhfUk9XX1BBUlRJQUxMWV9WSVNJQkxFX0FUX1RPUF9QICh3LCByb3cpKQor ICAgICAgICAgICAgICAgICAgICByb3ctPmluZGljYXRlX2JvYl9wID0gIU5JTFAgKGJvdW5kYXJ5 X3RvcCk7CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICBy b3ctPmluZGljYXRlX3RvcF9saW5lX3AgPSAhTklMUCAoYXJyb3dfdG9wKTsKKyAgICAgICAgICAg ICAgICAgIHRvcF9pbmRfcm4gPSBybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAg IGlmIChib3RfaW5kX3JuIDwgMCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICBpZiAoTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSA+PSBCVUZfWlYgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSkKKyAgICAgICAgICAgICAgICAgICAgICAmJiAhTUFUUklYX1JPV19QQVJUSUFM TFlfVklTSUJMRV9BVF9CT1RUT01fUCAodywgcm93KSkKKyAgICAgICAgICAgICAgICAgICAgcm93 LT5pbmRpY2F0ZV9lb2JfcCA9ICFOSUxQIChib3VuZGFyeV9ib3QpLCBib3RfaW5kX3JuID0gcm47 CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHkgKyByb3ctPmhlaWdodCA+PSB5YikKKyAg ICAgICAgICAgICAgICAgICAgICByb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3AgPSAhTklMUCAo YXJyb3dfYm90KSwgYm90X2luZF9ybiA9IHJuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgZW1wdHlfcG9zID0gQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBpbmRpY2F0ZV9lbXB0eV9saW5lcyk7CisgIGlmICghTklMUCAoZW1wdHlfcG9z KSAmJiAhRVEgKGVtcHR5X3BvcywgUXJpZ2h0KSkKKyAgICBlbXB0eV9wb3MgPSBXSU5ET1dfTEVG VF9GUklOR0VfV0lEVEggKHcpID09IDAgPyBRcmlnaHQgOiBRbGVmdDsKKyAgZm9yICh5ID0gMDsg eSA8IE1BWF9CSVRNQVBfQ0FDSEU7IHkrKykKKyAgICBiaXRtYXBfY2FjaGVbeV0gPSAtMTsKKyNk ZWZpbmUgTUNfTEVGVF9GUklOR0UoY2FjaGUsIHdoaWNoLCBwYXJ0aWFsX3ApCQkJXA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sgdG9wX2luZF9ybjsKKyAgICAgIHRvcF9yb3dfZW5kc19hdF96dl9wID0gcm93LT5l bmRzX2F0X3p2X3A7CisgICAgICBpZiAocm93LT5pbmRpY2F0ZV9ib2JfcCkKKyAgICAgICAgewor ICAgICAgICAgIGlmIChFUSAoYm91bmRhcnlfdG9wLCBRbGVmdCkpCisgICAgICAgICAgICBibiA9 ICgocm93LT5pbmRpY2F0ZV9lb2JfcCAmJiBFUSAoYm91bmRhcnlfYm90LCBRbGVmdCkpCisgICAg ICAgICAgICAgICAgICA/IE1DX0xFRlRfRlJJTkdFICgxLCBRdG9wX2JvdHRvbSwgcm93LT5lbmRz X2F0X3p2X3ApCisgICAgICAgICAgICAgICAgICA6IE1DX0xFRlRfRlJJTkdFICgyLCBRdG9wLCAw KSk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGJuID0gKChyb3ctPmluZGljYXRl X2VvYl9wICYmIEVRIChib3VuZGFyeV9ib3QsIFFyaWdodCkpCisgICAgICAgICAgICAgICAgICAg ID8gTUNfUklHSFRfRlJJTkdFICgxLCBRdG9wX2JvdHRvbSwgcm93LT5lbmRzX2F0X3p2X3ApCisg ICAgICAgICAgICAgICAgICAgIDogTUNfUklHSFRfRlJJTkdFICgyLCBRdG9wLCAwKSk7CisgICAg ICAgIH0KKyAgICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV90b3BfbGluZV9wKQorICAgICAg ICAgIHsKKyAgICAgICAgICAgIGlmIChFUSAoYXJyb3dfdG9wLCBRbGVmdCkpCisgICAgICAgICAg ICAgIGJuID0gTUNfTEVGVF9GUklOR0UgKDYsIFF1cCwgMCk7CisgICAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgICBibiA9IE1DX1JJR0hUX0ZSSU5HRSAoNiwgUXVwLCAwKTsKKyAgICAg ICAgICB9CisgICAgICBpZiAoYm4gIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgewor ICAgICAgICAgIHN0cnVjdCBmcmluZ2VfYml0bWFwICpmYiA9IGdldF9mcmluZ2VfYml0bWFwX2Rh dGEgKGJuKTsKKyAgICAgICAgICBpZiAoZmItPmFsaWduID09IEFMSUdOX0JJVE1BUF9UT1AgJiYg ZmItPnBlcmlvZCA9PSAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5 cGhfcm93ICpyb3cxOworICAgICAgICAgICAgICBpbnQgdG9wX2luZF9tYXhfeTsKKyAgICAgICAg ICAgICAgdG9wX2luZF9taW5feSA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICAg ICAgICAgICAgICB0b3BfaW5kX21heF95ID0gdG9wX2luZF9taW5feSArIGZiLT5oZWlnaHQ7Cisg ICAgICAgICAgICAgIGlmICh0b3BfaW5kX21heF95ID4geWIpCisgICAgICAgICAgICAgICAgdG9w X2luZF9tYXhfeSA9IHliOworICAgICAgICAgICAgICBmb3IgKHkgPSByb3ctPnkgKyByb3ctPmhl aWdodCwgcm4gPSB0b3BfaW5kX3JuICsgMTsKKyAgICAgICAgICAgICAgICAgICB5IDwgdG9wX2lu ZF9tYXhfeSAmJiBybiA8IG5yb3dzOworICAgICAgICAgICAgICAgICAgIHkgKz0gcm93MS0+aGVp Z2h0LCBybisrKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGlmIChib3Rf aW5kX3JuID49IDAgJiYgcm4gPj0gYm90X2luZF9ybikKKyAgICAgICAgICAgICAgICAgICAgYnJl YWs7CisgICAgICAgICAgICAgICAgICByb3cxID0gdy0+ZGVzaXJlZF9tYXRyaXgtPnJvd3MgKyBy bjsKKyAgICAgICAgICAgICAgICAgIGlmICghcm93MS0+ZW5hYmxlZF9wKQorICAgICAgICAgICAg ICAgICAgICByb3cxID0gdy0+Y3VycmVudF9tYXRyaXgtPnJvd3MgKyBybjsKKyAgICAgICAgICAg ICAgICAgIHJvdzEtPmluZGljYXRlX2JvYl9wID0gcm93LT5pbmRpY2F0ZV9ib2JfcDsKKyAgICAg ICAgICAgICAgICAgIHJvdzEtPmluZGljYXRlX3RvcF9saW5lX3AgPSByb3ctPmluZGljYXRlX3Rv cF9saW5lX3A7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9Cisg ICAgfQorICBpZiAoYm90X2luZF9ybiA+PSAwKQorICAgIHsKKyAgICAgIGludCBibiA9IE1DX05P X0ZSSU5HRV9CSVRNQVA7CisgICAgICByb3cgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIGJv dF9pbmRfcm47CisgICAgICBpZiAoIXJvdy0+ZW5hYmxlZF9wKQorICAgICAgICByb3cgPSB3LT5j dXJyZW50X21hdHJpeC0+cm93cyArIGJvdF9pbmRfcm47CisgICAgICBib3Rfcm93X2VuZHNfYXRf enZfcCA9IHJvdy0+ZW5kc19hdF96dl9wOworICAgICAgaWYgKHJvdy0+aW5kaWNhdGVfZW9iX3Ap CisgICAgICAgIHsKKyAgICAgICAgICBpZiAoRVEgKGJvdW5kYXJ5X2JvdCwgUWxlZnQpKQorICAg ICAgICAgICAgYm4gPSBNQ19MRUZUX0ZSSU5HRSAoMywgUWJvdHRvbSwgcm93LT5lbmRzX2F0X3p2 X3ApOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBibiA9IE1DX1JJR0hUX0ZSSU5H RSAoMywgUWJvdHRvbSwgcm93LT5lbmRzX2F0X3p2X3ApOworICAgICAgICB9CisgICAgICAgIGVs c2UgaWYgKHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCkKKyAgICAgICAgICB7CisgICAgICAg ICAgICBpZiAoRVEgKGFycm93X2JvdCwgUWxlZnQpKQorICAgICAgICAgICAgICBibiA9IE1DX0xF RlRfRlJJTkdFICg3LCBRZG93biwgMCk7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICBibiA9IE1DX1JJR0hUX0ZSSU5HRSAoNywgUWRvd24sIDApOworICAgICAgICAgIH0KKyAg ICAgIGlmIChibiAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICB7CisgICAgICAgICAg c3RydWN0IGZyaW5nZV9iaXRtYXAgKmZiID0gZ2V0X2ZyaW5nZV9iaXRtYXBfZGF0YSAoYm4pOwor ICAgICAgICAgIGlmIChmYi0+YWxpZ24gPT0gQUxJR05fQklUTUFQX0JPVFRPTSAmJiBmYi0+cGVy aW9kID09IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cg KnJvdzE7CisgICAgICAgICAgICAgIGludCBib3RfaW5kX21pbl95OworICAgICAgICAgICAgICBi b3RfaW5kX21heF95ID0gcm93LT55ICsgcm93LT52aXNpYmxlX2hlaWdodDsKKyAgICAgICAgICAg ICAgYm90X2luZF9taW5feSA9IGJvdF9pbmRfbWF4X3kgLSBmYi0+aGVpZ2h0OworICAgICAgICAg ICAgICBpZiAoYm90X2luZF9taW5feSA8IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpKQor ICAgICAgICAgICAgICAgIGJvdF9pbmRfbWluX3kgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hU ICh3KTsKKyAgICAgICAgICAgICAgZm9yICh5ID0gcm93LT55LCBybiA9IGJvdF9pbmRfcm4gLSAx OworICAgICAgICAgICAgICAgICAgIHkgPj0gYm90X2luZF9taW5feSAmJiBybiA+PSAwOworICAg ICAgICAgICAgICAgICAgIHkgLT0gcm93MS0+aGVpZ2h0LCBybi0tKQorICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgIGlmICh0b3BfaW5kX3JuID49IDAgJiYgcm4gPD0gdG9wX2lu ZF9ybikKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICByb3cx ID0gdy0+ZGVzaXJlZF9tYXRyaXgtPnJvd3MgKyBybjsKKyAgICAgICAgICAgICAgICAgIGlmICgh cm93MS0+ZW5hYmxlZF9wKQorICAgICAgICAgICAgICAgICAgICByb3cxID0gdy0+Y3VycmVudF9t YXRyaXgtPnJvd3MgKyBybjsKKyAgICAgICAgICAgICAgICAgIHJvdzEtPmluZGljYXRlX2VvYl9w ID0gcm93LT5pbmRpY2F0ZV9lb2JfcDsKKyAgICAgICAgICAgICAgICAgIHJvdzEtPmluZGljYXRl X2JvdHRvbV9saW5lX3AgPSByb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3A7CisgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICBMaXNwX09iamVjdCBi dWYgPSB3LT5jb250ZW50czsKKyAgQ0hFQ0tfQlVGRkVSIChidWYpOworICBib29sIGF1dG9faHNj cm9sbF9tb2RlX3AgPSBFUSAoRmJ1ZmZlcl9sb2NhbF92YWx1ZSAoUWF1dG9faHNjcm9sbF9tb2Rl LCBidWYpLCBRY3VycmVudF9saW5lKTsKKyAgLyogRVhBTVBMRTogIChzY3JvbGwtbGVmdCA1KSAq LworICBib29sIGhzY2xfYWxsX3RlbXBfcCA9ICh3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHctPm1pbl9oc2Nyb2xsID09IDApOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFu ZCBkbyBub3RoaW5nLiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMF9wID0gKHctPnN1c3BlbmRf YXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xs X21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gdy0+aHNjcm9sbCk7Cisg IC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIHNvbWV0aGluZyBlbHNlIGJlc2lkZXMgaG9y aXpvbnRhbGx5IHNjcm9sbGluZyB0aGUKKyAgICAgICAgICAgICAgIGN1cnJlbnQgbGluZSBkaWZm ZXJlbnRseS4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFs bHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8xX3AgPSAo IXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg YXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhz Y3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwg PiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gdy0+ aHNjcm9sbCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIC4uLgorICAgICAgICAgICAg ICAgQ3VycmVudCBsaW5lIGlzIF9ub3RfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRs eS4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzJfcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3Jv bGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA9PSAwCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgIT0gdy0+aHNjcm9sbCk7CisgIC8qIEVYQU1Q TEU6ICAoc2Nyb2xsLWxlZnQgNSk7IGFuZCwgdGhlbiBwcmVzcyB0aGUgbGVmdCBhcnJvdyBrZXkg b25lIHRpbWUuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkg c2Nyb2xsZWQgZGlmZmVyZW50bHkuKi8KKyAgYm9vbCBoc2NsX3RlbXBfcCA9ICghdy0+c3VzcGVu ZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9k ZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMtdSBD LXggPCBhbmQgZG8gc29tZXRoaW5nIHRoYXQgY2F1c2VzIHRoZSBjdXJyZW50IGxpbmUgdG8gYmUK KyAgICAgICAgICAgICAgIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4KKyAgICAg ICAgICAgICAgIEN1cnJlbnQgbGluZSBfaXNfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJl bnRseS4gKi8KKyAgYm9vbCBoc2NsX3Blcm1fcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3JvbGwK KyAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9s bCAhPSB3LT5oc2Nyb2xsKTsKKy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5j YWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoX2ZsYXZvcjsKKyAgICAgIGJvb2wgZW5hYmxlZF9w ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF9jbV0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFi bGVkX3A7CisgICAgICBpZiAoKHZwb3MgPT0gdm50aF9kbSB8fCB2cG9zID09IHZudGhfY20pCisg ICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yID09IE1DX09WRVJMQVlfQVJST1dfQklUTUFQCisgICAg ICAgICAgJiYgIWhzY2xfYWxsX3RlbXBfcAorICAgICAgICAgICYmICFoc2NsX3RlbXBfcAorICAg ICAgICAgICYmICFoc2NsX3Blcm1fcAorICAgICAgICAgICYmICFoc2NsX2FsbF9wZXJtXzBfcAor ICAgICAgICAgICYmICFoc2NsX2FsbF9wZXJtXzFfcAorICAgICAgICAgICYmICFoc2NsX2FsbF9w ZXJtXzJfcAorICAgICAgICAgICYmIGVuYWJsZWRfcCkKKyAgICAgICAgeworICAgICAgICAgIGlu dCBmcmluZ2VfYml0bWFwID0gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICBlbnVtIGZh Y2VfaWQgb3ZlcmxheV9hcnJvd19mYWNlX2lkID0KKyAgICAgICAgICAgICghYWN0aXZlX3AKKyAg ICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF9pbmFj dGl2ZV93aW5kb3dzKSkpCisgICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBp bnRlcm4gKCIrLW92ZXJsYXktYXJyb3ctaW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwgdHJ1ZSkKKyAg ICAgICAgICAgIDogKGFjdGl2ZV9wKQorICAgICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNl ICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ctcHJlLXp2LWZhY2UiKSwgdHJ1ZSkKKyAg ICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAgIG1jX2xlZnRfZnJpbmdlX2Zh Y2VfaWQgPSAoY3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBvdmVybGF5X2Fycm93X2ZhY2VfaWQKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAg ICAgIGlmICh3LT5oc2Nyb2xsICE9IDApCisgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNf Z2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistb3ZlcmxheS1hcnJvdyIpLCBmYWxzZSwg dHJ1ZSk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBt Y19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1vdmVybGF5LWFycm93IiksIHRydWUs IHRydWUpOworICAgICAgICAgIG1jX2xlZnRfZnJpbmdlX2JpdG1hcCA9IChjdXJzb3JfdHlwZSA9 PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoKHZwb3Mg PT0gdm50aF9kbSB8fCB2cG9zID09IHZudGhfY20pCisgICAgICAgICAgICAgICAgICYmIGdseXBo X2ZsYXZvciA9PSBNQ19PVkVSTEFZX0FSUk9XX0JJVE1BUAorICAgICAgICAgICAgICAgICAmJiAo aHNjbF9hbGxfdGVtcF9wCisgICAgICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzBf cAorICAgICAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8xX3AKKyAgICAgICAgICAg ICAgICAgICAgIHx8IGhzY2xfYWxsX3Blcm1fMl9wCisgICAgICAgICAgICAgICAgICAgICB8fCBo c2NsX3RlbXBfcAorICAgICAgICAgICAgICAgICAgICAgfHwgaHNjbF9wZXJtX3ApCisgICAgICAg ICAgICAgICAgICYmIGVuYWJsZWRfcCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpbnQgZnJp bmdlX2JpdG1hcCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgICAgICBlbnVtIGZhY2Vf aWQgb3ZlcmxheV9hcnJvd19mYWNlX2lkID0KKyAgICAgICAgICAgICAgKCFhY3RpdmVfcAorICAg ICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaW5h Y3RpdmVfd2luZG93cykpKQorICAgICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBm LCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ctaHNjbC1pbmFjdGl2ZS1wcmUtenYtZmFjZSIpLCB0 cnVlKQorICAgICAgICAgICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAgICAgICAgICA/IGxvb2t1 cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ctaHNjbC1wcmUtenYt ZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAg ICAgIG1jX2xlZnRfZnJpbmdlX2ZhY2VfaWQgPSAoY3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9GUklO R0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IG92ZXJs YXlfYXJyb3dfZmFjZV9pZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICAgIGlmIChoc2NsX2FsbF9wZXJtXzBfcCkKKyAg ICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRl cm4gKCIrLWhzY2wtcGVybSIpLCBmYWxzZSwgZmFsc2UpOworICAgICAgICAgICAgICBlbHNlIGlm IChoc2NsX2FsbF9wZXJtXzFfcCkKKyAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNf Z2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIHRydWUsIGZhbHNl KTsKKyAgICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX2FsbF9wZXJtXzJfcCkKKyAgICAgICAg ICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJu ICgiKy1oc2NsLXBlcm0iKSwgZmFsc2UsIHRydWUpOworICAgICAgICAgICAgICAgICAgZWxzZSBp ZiAoaHNjbF9wZXJtX3ApCisgICAgICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19n ZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgdHJ1ZSwgdHJ1ZSk7 CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xfYWxsX3RlbXBfcCkKKyAgICAgICAg ICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGlu dGVybiAoIistaHNjbC10ZW1wIiksIGZhbHNlLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAg ICAgZWxzZSBpZiAoaHNjbF90ZW1wX3ApCisgICAgICAgICAgICAgICAgICAgICAgICBmcmluZ2Vf Yml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC10ZW1wIiks IHRydWUsIGZhbHNlKTsKKyAgICAgICAgICAgIG1jX2xlZnRfZnJpbmdlX2JpdG1hcCA9IChjdXJz b3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBmcmluZ2VfYml0bWFwCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgIH0KKyAgICAgICAg ICBlbHNlIGlmICgodnBvcyA9PSB2bnRoX2RtIHx8IHZwb3MgPT0gdm50aF9jbSkKKyAgICAgICAg ICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFX1JJR0hU X0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVW RVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAg ICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEUKKyAgICAgICAgICAgICAg ICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cK KyAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9W RVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBo X2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8IGds eXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAg ICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIKQorICAg ICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIExpc3BfT2JqZWN0IGJpdG1hcF9mbGF2b3IgPSAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExP V19SRUNUQU5HTEVfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfUkVW RVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVykKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfaG9sbG93X3JlY3RhbmdsZV9y aWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAo Z2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEUpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hvbGxvd19yZWN0YW5nbGUKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19W RVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jhcl9yaWdodF9hcnJvdworICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVS U0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVykKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2 b3IgPT0gTUNfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9C QVIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3Jl dmVyc2VkX3ZlcnRpY2FsX2JhcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jh cl9iYWNrc2xhc2gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog UW5pbDsKKyAgICAgICAgICAgICAgbWNfcmlnaHRfZnJpbmdlX2JpdG1hcCA9IChjdXJzb3JfdHlw ZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gbG9va3VwX2ZyaW5nZV9iaXRtYXAgKGJpdG1hcF9mbGF2b3IpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19OT19GUklOR0VfQklUTUFQ OworICAgICAgICAgICAgICBtY19yaWdodF9mcmluZ2VfZmFjZV9pZCA9CisgICAgICAgICAgICAg ICAgKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAg ICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVgorICAgICAgICAgICAgICAgICAmJiAoZ2x5cGhf Zmxhdm9yID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAg ICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9C QVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBN Q19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpKQorICAgICAgICAgICAgICAgICAgPyBsb29rdXBfbmFt ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZXZlcnNlZC1iYXItcHJlLXp2LWZhY2UiKSwgdHJ1 ZSkKKyAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklU TUFQCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IEFUX1pWCisgICAgICAg ICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFO R0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9 PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAg ICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikpCisgICAg ICAgICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJldmVy c2VkLWJhci1hdC16di1mYWNlIiksIHRydWUpCisgICAgICAgICAgICAgICAgOiAoY3Vyc29yX3R5 cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAgICYmIHJvd19w b3NpdGlvbiA9PSBQT1NUX1pWCisgICAgICAgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9 PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAg ICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklH SFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JF VkVSU0VEX1ZFUlRJQ0FMX0JBUikpCisgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9m YWNlICh3LCBmLCBpbnRlcm4gKCIrLXJldmVyc2VkLWJhci1wb3N0LXp2LWZhY2UiKSwgdHJ1ZSkK KyAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQ CisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVgorICAgICAgICAg ICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xF X1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JF VkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICYmIGds eXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAgICAgICAgICAg ICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLWJhci1wcmUtenYtZmFjZSIp LCB0cnVlKQorICAgICAgICAgICAgICAgIDogKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5H RV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gPT0gQVRfWlYKKyAg ICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfSE9MTE9XX1JF Q1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAh PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAg ICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICAg ICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1iYXItYXQtenYt ZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICAgIDogKGN1cnNvcl90eXBlID09IE1DX1JJR0hU X0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gPT0gUE9T VF9aVgorICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9I T0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhf Zmxhdm9yICE9IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAg ICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisg ICAgICAgICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLWJh ci1wb3N0LXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9J RDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKCFyb3ctPmVuYWJs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ICAgICAgID8gTUNfTEVGVF9GUklOR0UgKDEsIFF0b3BfYm90dG9t LCB0b3Bfcm93X2VuZHNfYXRfenZfcCkKKyAgICAgICAgICAgICAgICAgOiBNQ19MRUZUX0ZSSU5H RSAoMiwgUXRvcCwgMCkpOworICAgICAgICAgIGlmICh0b3BfaW5kX21pbl95ID49IDApCisgICAg ICAgICAgICBsZWZ0X29mZnNldCA9IHRvcF9pbmRfbWluX3kgLSByb3ctPnk7CisgICAgICAgIH0K KyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5kYXJ5X2JvdCwg UWxlZnQpKQorICAgICAgICB7CisgICAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdFICgzLCBR Ym90dG9tLCBib3Rfcm93X2VuZHNfYXRfenZfcCk7CisgICAgICAgICAgaWYgKGJvdF9pbmRfbWF4 X3kgPj0gMCkKKyAgICAgICAgICAgIGxlZnRfb2Zmc2V0ID0gYm90X2luZF9tYXhfeSAtIChyb3ct PnkgKyByb3ctPnZpc2libGVfaGVpZ2h0KTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAoKCFy b3ctPnJldmVyc2VkX3AgJiYgTUFUUklYX1JPV19DT05USU5VQVRJT05fTElORV9QIChyb3cpKQor ICAgICAgICAgICAgICAgfHwgKHJvdy0+cmV2ZXJzZWRfcCAmJiByb3ctPmNvbnRpbnVlZF9wKSkK KyAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdFICg0LCBRY29udGludWF0aW9uLCAwKTsKKyAg ICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfZW1wdHlfbGluZV9wICYmIEVRIChlbXB0eV9wb3Ms IFFsZWZ0KSkKKyAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdFICg1LCBRZW1wdHlfbGluZSwg MCk7CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX3RvcF9saW5lX3AgJiYgRVEgKGFycm93 X3RvcCwgUWxlZnQpKQorICAgICAgICB7CisgICAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdF ICg2LCBRdXAsIDApOworICAgICAgICAgIGlmICh0b3BfaW5kX21pbl95ID49IDApCisgICAgICAg ICAgICBsZWZ0X29mZnNldCA9IHRvcF9pbmRfbWluX3kgLSByb3ctPnk7CisgICAgICAgIH0KKyAg ICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCAmJiBFUSAoYXJyb3dfYm90 LCBRbGVmdCkpCisgICAgICAgIHsKKyAgICAgICAgICBsZWZ0ID0gTUNfTEVGVF9GUklOR0UgKDcs IFFkb3duLCAwKTsKKyAgICAgICAgICBpZiAoYm90X2luZF9tYXhfeSA+PSAwKQorICAgICAgICAg ICAgbGVmdF9vZmZzZXQgPSBib3RfaW5kX21heF95IC0gKHJvdy0+eSArIHJvdy0+dmlzaWJsZV9o ZWlnaHQpOworICAgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIGxlZnQgPSBNQ19OT19GUklO R0VfQklUTUFQOworICAgICAgLyogRGVjaWRlIHdoaWNoIGJpdG1hcCB0byBkcmF3IGluIHRoZSBy aWdodCBmcmluZ2UuICAqLworICAgICAgaWYgKFdJTkRPV19SSUdIVF9GUklOR0VfV0lEVEggKHcp ID09IDApCisgICAgICAgIHJpZ2h0ID0gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgIGVsc2Ug aWYgKHJvdy0+cmlnaHRfdXNlcl9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVAp CisgICAgICAgIHsKKyAgICAgICAgICByaWdodCA9IHJvdy0+cmlnaHRfdXNlcl9mcmluZ2VfYml0 bWFwOworICAgICAgICAgIHJpZ2h0X2ZhY2VfaWQgPSByb3ctPnJpZ2h0X3VzZXJfZnJpbmdlX2Zh Y2VfaWQ7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKCghcm93LT5yZXZlcnNlZF9wICYmIHJv dy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICB8fCAocm93LT5yZXZlcnNl ZF9wICYmIHJvdy0+dHJ1bmNhdGVkX29uX2xlZnRfcCkpCisgICAgICAgIHJpZ2h0ID0gTUNfUklH SFRfRlJJTkdFICgwLCBRdHJ1bmNhdGlvbiwgMCk7CisgICAgICBlbHNlIGlmIChyb3ctPmluZGlj YXRlX2JvYl9wICYmIEVRIChib3VuZGFyeV90b3AsIFFyaWdodCkpCisgICAgICAgIHsKKyAgICAg ICAgICByaWdodCA9ICgocm93LT5pbmRpY2F0ZV9lb2JfcCAmJiBFUSAoYm91bmRhcnlfYm90LCBR cmlnaHQpKQorICAgICAgICAgICAgID8gTUNfUklHSFRfRlJJTkdFICgxLCBRdG9wX2JvdHRvbSwg dG9wX3Jvd19lbmRzX2F0X3p2X3ApCisgICAgICAgICAgICAgOiBNQ19SSUdIVF9GUklOR0UgKDIs IFF0b3AsIDApKTsKKyAgICAgICAgICBpZiAodG9wX2luZF9taW5feSA+PSAwKQorICAgICAgICAg ICAgcmlnaHRfb2Zmc2V0ID0gdG9wX2luZF9taW5feSAtIHJvdy0+eTsKKyAgICAgICAgfQorICAg ICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9lb2JfcCAmJiBFUSAoYm91bmRhcnlfYm90LCBRcmln aHQpKQorICAgICAgICB7CisgICAgICAgICAgcmlnaHQgPSBNQ19SSUdIVF9GUklOR0UgKDMsIFFi b3R0b20sIGJvdF9yb3dfZW5kc19hdF96dl9wKTsKKyAgICAgICAgICBpZiAoYm90X2luZF9tYXhf eSA+PSAwKQorICAgICAgICAgICAgcmlnaHRfb2Zmc2V0ID0gYm90X2luZF9tYXhfeSAtIChyb3ct PnkgKyByb3ctPnZpc2libGVfaGVpZ2h0KTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAoKCFy b3ctPnJldmVyc2VkX3AgJiYgcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgICAgIHx8IChy b3ctPnJldmVyc2VkX3AgJiYgTUFUUklYX1JPV19DT05USU5VQVRJT05fTElORV9QIChyb3cpKSkK KyAgICAgICAgcmlnaHQgPSBNQ19SSUdIVF9GUklOR0UgKDQsIFFjb250aW51YXRpb24sIDApOwor ICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV90b3BfbGluZV9wICYmIEVRIChhcnJvd190b3As IFFyaWdodCkpCisgICAgICAgIHsKKyAgICAgICAgICByaWdodCA9IE1DX1JJR0hUX0ZSSU5HRSAo NiwgUXVwLCAwKTsKKyAgICAgICAgICBpZiAodG9wX2luZF9taW5feSA+PSAwKQorICAgICAgICAg ICAgcmlnaHRfb2Zmc2V0ID0gdG9wX2luZF9taW5feSAtIHJvdy0+eTsKKyAgICAgICAgfQorICAg ICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wICYmIEVRIChhcnJvd19ib3Qs IFFyaWdodCkpCisgICAgICAgIHsKKyAgICAgICAgICByaWdodCA9IE1DX1JJR0hUX0ZSSU5HRSAo NywgUWRvd24sIDApOworICAgICAgICAgIGlmIChib3RfaW5kX21heF95ID49IDApCisgICAgICAg ICAgICByaWdodF9vZmZzZXQgPSBib3RfaW5kX21heF95IC0gKHJvdy0+eSArIHJvdy0+dmlzaWJs ZV9oZWlnaHQpOworICAgICAgICB9CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2VtcHR5 X2xpbmVfcCAmJiBFUSAoZW1wdHlfcG9zLCBRcmlnaHQpKQorICAgICAgICByaWdodCA9IE1DX1JJ R0hUX0ZSSU5HRSAoNSwgUWVtcHR5X2xpbmUsIDApOworICAgICAgZWxzZQorICAgICAgICByaWdo dCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICBwZXJpb2RpY19wID0gKGdldF9mcmluZ2Vf Yml0bWFwX2RhdGEgKGxlZnQpLT5wZXJpb2QgIT0gMAorICAgICAgICAgICAgICAgICAgICB8fCBn ZXRfZnJpbmdlX2JpdG1hcF9kYXRhIChyaWdodCktPnBlcmlvZCAhPSAwKTsKKyAgICAgIGlmIChy b3ctPnkgIT0gY3VyLT55CisgICAgICAgICAgfHwgcm93LT52aXNpYmxlX2hlaWdodCAhPSBjdXIt PnZpc2libGVfaGVpZ2h0CisgICAgICAgICAgfHwgcm93LT5lbmRzX2F0X3p2X3AgIT0gY3VyLT5l bmRzX2F0X3p2X3AKKyAgICAgICAgICB8fCBsZWZ0ICE9IGN1ci0+bGVmdF9mcmluZ2VfYml0bWFw CisgICAgICAgICAgfHwgcmlnaHQgIT0gY3VyLT5yaWdodF9mcmluZ2VfYml0bWFwCisgICAgICAg ICAgfHwgbGVmdF9mYWNlX2lkICE9IGN1ci0+bGVmdF9mcmluZ2VfZmFjZV9pZAorICAgICAgICAg IHx8IHJpZ2h0X2ZhY2VfaWQgIT0gY3VyLT5yaWdodF9mcmluZ2VfZmFjZV9pZAorICAgICAgICAg IHx8IGxlZnRfb2Zmc2V0ICE9IGN1ci0+bGVmdF9mcmluZ2Vfb2Zmc2V0CisgICAgICAgICAgfHwg cmlnaHRfb2Zmc2V0ICE9IGN1ci0+cmlnaHRfZnJpbmdlX29mZnNldAorICAgICAgICAgIHx8IHBl cmlvZGljX3AgIT0gY3VyLT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3AKKyAgICAgICAgICB8fCBj dXItPnJlZHJhd19mcmluZ2VfYml0bWFwc19wKQorICAgICAgICB7CisgICAgICAgICAgcmVkcmF3 X3AgPSAxLCByb3ctPnJlZHJhd19mcmluZ2VfYml0bWFwc19wID0gMTsKKyAgICAgICAgICBpZiAo IWtlZXBfY3VycmVudF9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBjdXItPnJlZHJh d19mcmluZ2VfYml0bWFwc19wID0gMTsKKyAgICAgICAgICAgICAgaWYgKG1jX2xlZnRfZnJpbmdl X2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICB8fCBtY19y aWdodF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAg ICAgY3VyLT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAg ICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcCA9 IHBlcmlvZGljX3A7CisgICAgICAgICAgICAgIGlmIChtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgIT0g TUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICBjdXItPmxlZnRfZnJpbmdlX2Jp dG1hcCA9IG1jX2xlZnRfZnJpbmdlX2JpdG1hcDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAg ICAgICAgICAgICAgICBjdXItPmxlZnRfZnJpbmdlX2JpdG1hcCA9IGxlZnQ7CisgICAgICAgICAg ICAgIGlmIChtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAg ICAgICAgICAgICAgICBjdXItPmxlZnRfZnJpbmdlX2ZhY2VfaWQgPSBtY19sZWZ0X2ZyaW5nZV9m YWNlX2lkOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIGN1ci0+bGVm dF9mcmluZ2VfZmFjZV9pZCA9IGxlZnRfZmFjZV9pZDsKKyAgICAgICAgICAgICAgaWYgKG1jX2xl ZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAg IGN1ci0+bGVmdF9mcmluZ2Vfb2Zmc2V0ID0gMDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAg ICAgICAgICAgICAgICBjdXItPmxlZnRfZnJpbmdlX29mZnNldCA9IGxlZnRfb2Zmc2V0OworICAg ICAgICAgICAgICBpZiAobWNfcmlnaHRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklU TUFQKQorICAgICAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX2JpdG1hcCA9IG1jX3JpZ2h0 X2ZyaW5nZV9iaXRtYXA7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAg Y3VyLT5yaWdodF9mcmluZ2VfYml0bWFwID0gcmlnaHQ7CisgICAgICAgICAgICAgIGlmIChtY19y aWdodF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAg ICAgY3VyLT5yaWdodF9mcmluZ2VfZmFjZV9pZCA9IG1jX3JpZ2h0X2ZyaW5nZV9mYWNlX2lkOwor ICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdl X2ZhY2VfaWQgPSByaWdodF9mYWNlX2lkOworICAgICAgICAgICAgICBpZiAobWNfcmlnaHRfZnJp bmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgIGN1ci0+ cmlnaHRfZnJpbmdlX29mZnNldCA9IDA7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAg ICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2Vfb2Zmc2V0ID0gcmlnaHRfb2Zmc2V0OworICAgICAg ICAgICAgfQorICAgICAgICB9CisgICAgICBpZiAocm93LT5vdmVybGF5X2Fycm93X2JpdG1hcCA8 IDApCisgICAgICAgIHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAgPSBtY19nZXRfbG9naWNhbF9m cmluZ2VfYml0bWFwICh3LCBRb3ZlcmxheV9hcnJvdywgMCwgMCk7CisgICAgICBpZiAocm93LT5v dmVybGF5X2Fycm93X2JpdG1hcCAhPSBjdXItPm92ZXJsYXlfYXJyb3dfYml0bWFwKQorICAgICAg ICB7CisgICAgICAgICAgcmV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3ctPmxlZnRfZnJpbmdlX29m ZnNldDsKKyAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgIHdoaWNoID0g cm93LT5yaWdodF9mcmluZ2VfYml0bWFwOworICAgICAgICAgIGZhY2VfaWQgPSByb3ctPnJpZ2h0 X2ZyaW5nZV9mYWNlX2lkOworICAgICAgICAgIG9mZnNldCA9IHJvdy0+cmlnaHRfZnJpbmdlX29m ZnNldDsKKyAgICAgICAgfQorICBpZiAoZmFjZV9pZCA9PSBERUZBVUxUX0ZBQ0VfSUQpCisgICAg eworICAgICAgTGlzcF9PYmplY3QgZmFjZSA9IGZyaW5nZV9mYWNlc1t3aGljaF07CisgICAgICBm YWNlX2lkID0gTklMUCAoZmFjZSkgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgUWZyaW5nZSwg ZmFsc2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBsb29rdXBfZGVyaXZlZF9mYWNl ICh3LCBmLCBmYWNlLCBGUklOR0VfRkFDRV9JRCwgMCk7CisgICAgICBpZiAoZmFjZV9pZCA8IDAp CisgICAgICAgIGZhY2VfaWQgPSBGUklOR0VfRkFDRV9JRDsKKyAgICB9CisgIGZiID0gZ2V0X2Zy aW5nZV9iaXRtYXBfZGF0YSAod2hpY2gpOworICBwZXJpb2QgPSBmYi0+cGVyaW9kOworICAvKiBD b252ZXJ0IHJvdyB0byBmcmFtZSBjb29yZGluYXRlcy4gICovCisgIHAueSA9IFdJTkRPV19UT19G UkFNRV9QSVhFTF9ZICh3LCByb3ctPnkpICsgb2Zmc2V0OworICBwLndoaWNoID0gd2hpY2g7Cisg IHAuYml0cyA9IGZiLT5iaXRzOworICBwLndkID0gZmItPndpZHRoOworICBwLmggPSBmYi0+aGVp Z2h0OworICBwLmRoID0gKHBlcmlvZCA+IDAgPyAocC55ICUgcGVyaW9kKSA6IDApOworICBwLmgg LT0gcC5kaDsKKyAgLyogQWRqdXN0IHkgdG8gdGhlIG9m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eworICAgICAgaW50IHdkID0gV0lORE9XX0xFRlRfRlJJTkdFX1dJRFRIICh3KTsKKyAgICAgIGlu dCB4ID0gd2luZG93X2JveF9sZWZ0ICh3LCAoV0lORE9XX0hBU19GUklOR0VTX09VVFNJREVfTUFS R0lOUyAodykKKyAgICAgICAgICAgPyBMRUZUX01BUkdJTl9BUkVBCisgICAgICAgICAgIDogVEVY VF9BUkVBKSk7CisgICAgICBpZiAocC53ZCA+IHdkKQorICAgICAgICBwLndkID0gd2Q7CisgICAg ICBwLnggPSB4IC0gcC53ZCAtICh3ZCAtIHAud2QpIC8gMjsKKyAgICAgIGlmIChwLndkIDwgd2Qg fHwgcC55ID4gcC5ieSB8fCBwLnkgKyBwLmggPCBwLmJ5ICsgcC5ueSkKKyAgICAgICAgeworICAg ICAgICAgIC8qIElmIFcgaGFzIGEgdmVydGljYWwgYm9yZGVyIHRvIGl0cyBsZWZ0LCBkb24ndCBk cmF3IG92ZXIgaXQuICAqLworICAgICAgICAgIHdkIC09ICgoIVdJTkRPV19MRUZUTU9TVF9QICh3 KQorICAgICAgICAgICAgLyogVGhpcyBjb3VsZCBiZSB3cm9uZyB3aGVuIHdlIGFsbG93IHdpbmRv dyBsb2NhbAorICAgICAgICAgICAgICAgcmlnaHQgZGl2aWRlcnMgLSBidXQgdGhlIHdpbmRvdyBv biB0aGUgbGVmdCBpcyBoYXJkCisgICAgICAgICAgICAgICB0byBnZXQuICAqLworICAgICAgICAg ICAgJiYgIUZSQU1FX1JJR0hUX0RJVklERVJfV0lEVEggKGYpCisgICAgICAgICAgICAmJiAhV0lO RE9XX0hBU19WRVJUSUNBTF9TQ1JPTExfQkFSICh3KQorICAgICAgICAgICAgLyogQnV0IGRvbid0 IHJlZHVjZSB0aGUgZnJpbmdlIHdpZHRoIGlmIHRoZSB3aW5kb3cKKyAgICAgICAgICAgICAgIGhh cyBhIGxlZnQgbWFyZ2luLCBiZWNhdXNlIHRoYXQgbWVhbnMgd2UgYXJlIG5vdAorICAgICAgICAg ICAgICAgaW4gZGFuZ2VyIG9mIGRyYXdpbmcgb3ZlciB0aGUgdmVydGljYWwgYm9yZGVyLAorICAg ICAgICAgICAgICAgYW5kIE9UT0ggbGVhdmluZyBvdXQgdGhhdCBvbmUgcGl4ZWwgbGVhdmVzIGJl aGluZAorICAgICAgICAgICAgICAgdHJhY2VzIG9mIHRoZSBjdXJzb3IsIGlmIGl0IHdhcyBpbiBj b2x1bW4gemVybworICAgICAgICAgICAgICAgYmVmb3JlIGRyYXdpbmcgbm9uLWVtcHR5IG1hcmdp biBhcmVhLiAgKi8KKyAgICAgICAgICAgICYmIHctPmxlZnRfbWFyZ2luX2NvbHMgPT0gMCkKKyAg ICAgICAgICAgPyAxIDogMCk7CisgICAgICAgICAgcC5ieCA9IHggLSB3ZDsKKyAgICAgICAgICBw Lm54ID0gd2Q7CisgICAgICAgIH0KKyAgICB9CisgIGVsc2UKKyAgICB7CisgICAgICBpbnQgeCA9 IHdpbmRvd19ib3hfcmlnaHQgKHcsCisgICAgICAgIChXSU5ET1dfSEFTX0ZSSU5HRVNfT1VUU0lE RV9NQVJHSU5TICh3KQorICAgICAgICAgPyBSSUdIVF9NQVJHSU5fQVJFQQorICAgICAgICAgOiBU RVhUX0FSRUEpKTsKKyAgICAgIGludCB3ZCA9IFdJTkRPV19SSUdIVF9GUklOR0VfV0lEVEggKHcp OworICAgICAgaWYgKHAud2QgPiB3ZCkKKyAgICAgICAgcC53ZCA9IHdkOworICAgICAgcC54ID0g eCArICh3ZCAtIHAud2QpIC8gMjsKKyAgICAgIC8qIENsZWFyIHJpZ2h0IGZyaW5nZSBpZiBubyBi aXRtYXAgdG8gZHJhdyBvZiBpZiBiaXRtYXAgZG9lc24ndCBmaWxsCisgICB0aGUgZnJpbmdlLiAg Ki8KKyAgICAgIGlmIChwLndkIDwgd2QgfHwgcC55ID4gcC5ieSB8fCBwLnkgKyBwLmggPCBwLmJ5 ICsgcC5ueSkKKyAgICAgICAgeworICAgICAgICAgIHAuYnggPSB4OworICAgICAgICAgIHAubngg PSB3ZDsKKyAgICAgICAgfQorICAgIH0KKyAgaWYgKHAueCA+PSBXSU5ET1dfQk9YX0xFRlRfRURH RV9YICh3KQorICAgICAgJiYgKHAueCArIHAud2QpIDw9IFdJTkRPV19CT1hfTEVGVF9FREdFX1gg KHcpICsgV0lORE9XX1BJWEVMX1dJRFRIICh3KSkKKyAgICBGUkFNRV9SSUYgKGYpLT5kcmF3X2Zy aW5nZV9iaXRtYXAgKHcsIHJvdywgJnApOworfQorCit2b2lkCittY19kcmF3X2ZyaW5nZV9iaXRt YXAgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgaW50IGxlZnRfcCwg ZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSkKK3sKKyAgaW50IG92ZXJsYXkgPSAwOwor ICBpZiAobGVmdF9wID09IHJvdy0+cmV2ZXJzZWRfcCAmJiByb3ctPmN1cnNvcl9pbl9mcmluZ2Vf cCkKKyAgICB7CisgICAgICBMaXNwX09iamVjdCBjdXJzb3IgPSBRbmlsOworICAgICAgc3dpdGNo IChjdXJzb3JfdHlwZSkKKyAgICAgICAgeworICAgICAgICBjYXNlIE1DX0ZSQU1FRF9CT1g6Cisg ICAgICAgICAgaWYgKHJvdy0+dmlzaWJsZV9oZWlnaHQgPj0gU1RBTkRBUkRfQklUTUFQX0hFSUdI VCAoaG9sbG93X3JlY3RhbmdsZV9iaXRzKSkKKyAgICAgICAgICAgIGN1cnNvciA9IFFob2xsb3c7 CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgY3Vyc29yID0gUWhvbGxvd19zbWFsbDsKKyAg ICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19IT0xMT1dfQk9YOgorICAgICAgICAgIGlm IChyb3ctPnZpc2libGVfaGVpZ2h0ID49IFNUQU5EQVJEX0JJVE1BUF9IRUlHSFQgKGhvbGxvd19y ZWN0YW5nbGVfYml0cykpCisgICAgICAgICAgICBjdXJzb3IgPSBRaG9sbG93OworICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgIGN1cnNvciA9IFFob2xsb3dfc21hbGw7CisgICAgICAgICAgYnJl YWs7CisgICAgICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAgICAgICAgICBjdXJzb3IgPSBRYm94 OworICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1DX0JBUjoKKyAgICAgICAgICBjdXJz b3IgPSBRYmFyOworICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1DX0hCQVI6CisgICAg ICAgICAgY3Vyc29yID0gUWhiYXI7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTUNf Tk9fRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgY2FzZSBNQ19OT19DVVJTT1I6CisgICAgICAgIGNh c2UgTUNfUklHSFRfRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgY2FzZSBNQ19MRUZUX0ZSSU5HRV9C SVRNQVA6CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgdy0+cGh5c19jdXJzb3Jfb25fcCA9 IDA7CisgICAgICAgICAgcm93LT5jdXJzb3JfaW5fZnJpbmdlX3AgPSAwOworICAgICAgICAgIGJy ZWFrOworICAgICAgICB9CisgICAgICBpZiAoIU5JTFAgKGN1cnNvcikpCisgICAgICAgIHsKKyAg ICAgICAgICBpbnQgYm0gPSBtY19nZXRfbG9naWNhbF9jdXJzb3JfYml0bWFwICh3LCBjdXJzb3Ip OworICAgICAgICAgIGlmIChibSAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAg eworICAgICAgICAgICAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXBfMSAodywgcm93LCBsZWZ0X3As IDIsIGJtKTsKKyAgICAgICAgICAgICAgb3ZlcmxheSA9IEVRIChjdXJzb3IsIFFib3gpID8gMyA6 IDE7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIG1jX2RyYXdfZnJpbmdlX2Jp dG1hcF8xICh3LCByb3csIGxlZnRfcCwgb3ZlcmxheSwgTUNfTk9fRlJJTkdFX0JJVE1BUCk7Cisg IGlmIChsZWZ0X3AgJiYgcm93LT5vdmVybGF5X2Fycm93X2JpdG1hcCAhPSBNQ19OT19GUklOR0Vf QklUTUFQKQorICAgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcF8xICh3LCByb3csIDEsIDEsIHJvdy0+ b3ZlcmxheV9hcnJvd19iaXRtYXApOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogI2RlZmluZSBOT19GUklOR0VfQklUTUFQIDAK ICNkZWZpbmUgVU5ERUZfRlJJTkdFX0JJVE1BUCAxCiAjZGVmaW5lIE1BWF9TVEFOREFSRF9GUklO R0VfQklUTUFQUyBBUlJBWUVMVFMgKHN0YW5kYXJkX2JpdG1hcHMpCkBAIC0xNzAwLDYgKzMyMjAs MTY4IEBAIFJldHVybiBuaWwgaWYgUE9TIGlzIG5vdCB2aXNpYmxlIGluIFdJTkRPVy4gICovKQog dm9pZAogc3ltc19vZl9mcmluZ2UgKHZvaWQpCiB7CisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogKGdldCAnZW1wdHktbGlu ZSAnZnJpbmdlKSA9PiAyMyA9PiB0aGUgbGFzdCBzdGFuZGFyZC1iaXRtYXAgYmVmb3JlIHRoaXMg b25lLgorICBTZWUgYGZyaW5nZS5lbGAuICovCisKKyAgLyogMjQgKi8KKyAgREVGU1lNIChRbWNf dmVydGljYWxfYmFyX3JpZ2h0X2Fycm93LCAiKy12ZXJ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qKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBERUZTWU0gKFF0cnVuY2F0aW9u LCAidHJ1bmNhdGlvbiIpOwogICBERUZTWU0gKFFjb250aW51YXRpb24sICJjb250aW51YXRpb24i KTsKICAgREVGU1lNIChRb3ZlcmxheV9hcnJvdywgIm92ZXJsYXktYXJyb3ciKTsKZGlmZiAtLWdp dCBhL3NyYy9uc3Rlcm0uaCBiL3NyYy9uc3Rlcm0uaAppbmRleCA3OGNlNjA4Li44ZWYwZGZlIDEw MDY0NAotLS0gYS9zcmMvbnN0ZXJtLmgKKysrIGIvc3JjL25zdGVybS5oCkBAIC02NjAsNiArNjYw LDE2IEBAIHR5cGVkZWYgaWQgaW5zdGFuY2V0eXBlOwogCiBAaW50ZXJmYWNlIEVtYWNzU2Nyb2xs ZXIgOiBOU1Njcm9sbGVyCiAgIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1V TFRJUExFLUNVUlNPUlMgKi8KKworICAgIE5TUmVjdCBtY19yZWN0YW5nbGU7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgIHN0cnVjdCB3aW5kb3cgKndpbmRvdzsKICAgIHN0cnVj dCBmcmFtZSAqZnJhbWU7CiAgICBOU1Jlc3BvbmRlciAqcHJldlJlc3BvbmRlcjsKQEAgLTY4MCw2 ICs2OTAsMTggQEAgdHlwZWRlZiBpZCBpbnN0YW5jZXR5cGU7CiAgICBpbnQgZW1fd2hvbGU7CiAg ICB9CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKy0gKHZvaWQpbWNfc2V0X3JlY3RhbmdsZTogKE5TUmVjdClyZWN0OworLSAoTlNSZWN0KW1j X2dldF9yZWN0YW5nbGU7CistIChzdHJ1Y3Qgd2luZG93ICopbWNfZ2V0X3dpbmRvdzsKKy0gKGJv b2wpbWNfanVkZ2U7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC0gKGluc3RhbmNl dHlwZSkgaW5pdEZyYW1lOiAoTlNSZWN0IClyIHdpbmRvdzogKExpc3BfT2JqZWN0KXdpbjsKIC0g KHZvaWQpc2V0RnJhbWU6IChOU1JlY3QpcjsKIApkaWZmIC0tZ2l0IGEvc3JjL25zdGVybS5tIGIv c3JjL25zdGVybS5tCmluZGV4IDgxZDM2YmUuLmY3NTRmYzkgMTAwNjQ0Ci0tLSBhL3NyYy9uc3Rl cm0ubQorKysgYi9zcmMvbnN0ZXJtLm0KQEAgLTc2LDYgKzc2LDk3OSBAQCBVcGRhdGVkIGJ5IENo cmlzdGlhbiBMaW1wYWNoIChjaHJpc0BuaWNlLmNoKQogc3RhdGljIEVtYWNzTWVudSAqbWFpbk1l bnU7CiAjZW5kaWYKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJ UExFLUNVUlNPUlMgKi8KKworc3RhdGljIEJPT0wgbnNfY2xpcF90b19yZWN0IChzdHJ1Y3QgZnJh bWUgKiwgTlNSZWN0ICosIGludCk7CisKK3N0YXRpYyB2b2lkIG5zX3Jlc2V0X2NsaXBwaW5nIChz dHJ1Y3QgZnJhbWUgKik7CisKK3N0YXRpYyB2b2lkIG5zX2R1bXBnbHlwaHNfYm94X29yX3JlbGll ZiAoc3RydWN0IGdseXBoX3N0cmluZyAqKTsKKworc3RhdGljIHZvaWQgbnNf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ZSBjdXJzb3IgZnJvbSBhbm90aGVyCisgIGNhY2hlIC0tIHRodXMsIHdlIG11 c3QgY2hlY2sgdGhlbSBhbGwgZm9yIG92ZXJ3cml0dGVuIGZha2UgY3Vyc29ycy4gKi8KKyAgZm9y IChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOworICAgICAgIGNhY2hl X3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICArK2NhY2hlX3R5cGUpCisgICAgeworICAgICAgZm9y IChpbnQgbnRoID0gMDsKKyAgICAgICAgICAgcworICAgICAgICAgICAmJiBtY190cmF2ZXJzZV9j YWNoZV9wIChzLT53LT5tY19tYXRyaXgsIGNhY2hlX3R5cGUsIHZudGgsIG50aCk7CisgICAgICAg ICAgICsrbnRoKQorICAgICAgICB7CisgICAgICAgICAgLy8gIGludCB4ID0gcy0+dy0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS54OworICAgICAgICAgIGludCBm eCA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZng7 CisgICAgICAgICAgLy8gIGludCB5ID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXS55OworICAgICAgICAgIGludCBmeSA9IHMtPnctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZnk7CisgICAgICAgICAgaW50IGhwb3Mg PSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmhwb3M7 CisgICAgICAgICAgaW50IHZwb3MgPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhdLnZwb3M7CisgICAgICAgICAgaW50IHdkID0gcy0+dy0+bWNfbWF0cml4 LnZw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WVuLAorICAgICAgICAgIC8vICAgICAg ICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF0uYmcuYmx1ZX07CisgICAgICAgICAgYm9vbCBhY3RpdmVfcCA9 IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYWN0aXZl X3A7CisgICAgICAgICAgLy8gIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IHMtPnctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGhfZmxhdm9yOwor ICAgICAgICAgIGJvb2wgZW5hYmxlZF9wID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFibGVkX3A7CisgICAgICAgICAgYm9vbCBnb19wID0gKHZw b3MgPT0gdm50aAorICAgICAgICAgICAgICAgICAgICAgICAmJiBocG9zID09IGN1cnNvcl9nbHlw aC0+aHBvcworICAgICAgICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApOworICAgICAgICAg IGlmICghZ29fcCkKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgIE5TUmVjdCByOwor ICAgICAgICAgIHIub3JpZ2luLnggPSBmeDsKKyAgICAgICAgICByLm9yaWdpbi55ID0gZnk7Cisg ICAgICAgICAgci5zaXplLmhlaWdodCA9IGg7CisgICAgICAgICAgci5zaXplLndpZHRoID0gd2Q7 CisgICAgICAgICAgW1tOU0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6IGxzbF9mZy5yZWQK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBncmVlbjogbHNsX2ZnLmdyZWVu CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJsdWU6IGxzbF9mZy5ibHVl CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwaGE6IDEuMF0gc2V0XTsK KyAgICAgIGlmIChjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YKQorICAgICAgICB7CisgICAg ICAgICAgTGlzcF9PYmplY3QgYnVmID0gcy0+dy0+Y29udGVudHM7CisgICAgICAgICAgQ0hFQ0tf QlVGRkVSIChidWYpOworICAgICAgICAgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSIChidWYp OworICAgICAgICAgIGJvb2wgcmVnaW9uX2FjdGl2ZV9wID0gKCFOSUxQIChWdHJhbnNpZW50X21h cmtfbW9kZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZB UiAoYiwgbWFya19hY3RpdmUpKSk7CisgICAgICAgICAgcHRyZGlmZl90IHJlZ2lvbl9iZWcgPSAo cmVnaW9uX2FjdGl2ZV9wKSA/IG1jX3JlZ2lvbl9saW1pdCAoMSkgOiAtMTsKKyAgICAgICAgICBw dHJkaWZmX3QgcmVnaW9uX2VuZCA9IChyZWdpb25fYWN0aXZlX3ApID8gbWNfcmVnaW9uX2xpbWl0 ICgwKSA6IC0xOworICAgICAgICAgIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAg JiYgYWN0aXZlX3AKKyAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID09IHJl Z2lvbl9iZWcpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xs b3dfYWN0aXZlX3JlZ2lvbl9iZWdfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlIChzLT53LCBz LT5mLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItYXQtcmVnaW9uLXByZS16di1mYWNlIiks IHRydWUpOworICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2F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IChzLT5mLCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCk7CisgICAgICAg ICAgICAgICAgICAgICAgTlNDb2xvciAqaG9sbG93X2luYWN0aXZlX2NvbG9yID0gbnNfbG9va3Vw X2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoaG9sbG93X2luYWN0aXZlX2ZhY2Up LCBzLT5mKTsKKyAgICAgICAgICAgICAgICAgICAgICBob2xsb3dfY29sb3IgPSBob2xsb3dfaW5h Y3RpdmVfY29sb3I7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBl bHNlIGlmIChmYWNlICYmIE5TX0ZBQ0VfQkFDS0dST1VORCAoZmFjZSkgPT0gbnNfaW5kZXhfY29s b3IgKEZSQU1FX0NVUlNPUl9DT0xPUiAocy0+ZiksIHMtPmYpKQorICAgICAgICAgIHsKKyAgICAg ICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChmYWNl KSwgcy0+Zikgc2V0XTsKKyAgICAgICAgICAgIGhvbGxvd19jb2xvciA9IEZSQU1FX0NVUlNPUl9D T0xPUiAocy0+Zik7CisgICAgICAgICAgfQorICAgICAgICAgIHN3aXRjaCAoY3Vyc29yX3R5cGUp CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGNhc2UgTUNfTk9fRlJJTkdFX0JJVE1BUDoK KyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSBNQ19OT19DVVJTT1I6 CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgTUNfUklHSFRfRlJJ TkdFX0JJVE1BUDoKKyAgICAgICAgICAgICAgY2FzZSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVA6Cisg ICAgICAgICAgICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAgICAgICAgICAgICAgICBOU1JlY3RG aWxsIChyKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSBNQ19G UkFNRURfQk9YOgorICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAg ICAgIFtob2xsb3dfY29sb3Igc2V0XTsKKyAgICAgICAgICAgICAgICBOU1JlY3RGaWxsIChOU0lu c2V0UmVjdCAociwgMSwgMSkpOworICAgICAgICAgICAgICAgIFtGUkFNRV9DVVJTT1JfQ09MT1Ig KHMtPmYpIHNldF07CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2Ug TUNfSE9MTE9XX0JPWDoKKyAgICAgICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAg ICAgICAgICBbaG9sbG93X2NvbG9yIHNldF07CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAo TlNJbnNldFJlY3QgKHIsIDEsIDEpKTsKKyAgICAgICAgICAgICAgICBbRlJBTUVfQ1VSU09SX0NP TE9SIChzLT5mKSBzZXRdOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBj YXNlIE1DX0hCQVI6CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAg ICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgTUNfQkFSOgorICAgICAgICAgICAgICAg IE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQor ICAgICAgICAgIC8qIElmIGEgZ2x5cGggZXhpc3RzIChzLT5jaGFyMmIgIT0gTlVMTCksIHRoZW4g ZHJhdyB0aGUgZ2x5cGggb24gdG9wIG9mIHRoZQorICAgICAgICAgIG5ld2x5IGRyYXduIHJlY3Rh bmdsZSB0aGF0IHdhcyBjcmVhdGVkIGhlcmVpbmFib3ZlLiAgVG8gdGhlIGV4dGVudCB0aGF0IHdl CisgICAgICAgICAgd2FudCB0byBkb3VibGUtaW1wcmludCBnbHlwaHMgdG8gbWFrZSB0aGVtIGFw cGVhciB0byBiZSBzZW1pLWJvbGQsIGl0IGNhbgorICAgICAgICAgIGJlIGRvbmUgaGVyZSBmb3Ig YWxsIGN1cnNvciB0eXBlcy4gIFRoZSBib3gtc3R5bGUgY3Vyc29ycyBhcmUgaW1wcmludGVkCisg ICAgICAgICAgd2l0aCBnbHlwaHMgb25seSBvbmUgKDEpIHRpbWUuICBUaGUgc2VtaS1ib2xkIGFw cGVhcmFuY2UgaXMgaGVscGZ1bCB3aGVuCisgICAgICAgICAgZGVidWdnaW5nIHRvIHNlZSB0aGF0 IHRoZSBjb29yZGluYXRlcyBhcmUgY29ycmVjdC4gKi8KKyAgICAgICAgICBpZiAocy0+Y2hhcjJi ICE9IE5VTEwKKyAgICAgICAgICAgICAgJiYgKGN1cnNvcl90eXBlID09IE1DX0ZJTExFRF9CT1gK KyAgICAgICAgICAgICAgICAgIHx8IGN1cnNvcl90eXBlID09IE1DX0ZSQU1FRF9CT1gKKyAgICAg ICAgICAgICAgICAgIHx8IGN1cnNvcl90eXBlID09IE1DX0hPTExPV19CT1gpKQorICAgICAgICAg ICAgeworICAgICAgICAgICAgICBCT09MIGlzQ29tcG9zaXRlID0gcy0+Zmlyc3RfZ2x5cGgtPnR5 cGUgPT0gQ09NUE9TSVRFX0dMWVBIOworICAgICAgICAgICAgICBpZiAoaXNDb21wb3NpdGUpCisg ICAgICAgICAgICAgICAgbnNfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQg KHMpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAgICAgc3RydWN0IGZvbnQgKmZvbnQgPSBzLT5mYWNlLT5mb250OworICAgICAgICAg ICAgICAgICAgICBpZiAoIWZvbnQpCisgICAgICAgICAgICAgICAgICAgICAgZm9udCA9IEZSQU1F X0ZPTlQgKHMtPmYpOworICAgICAgICAgICAgICAgICAgICBib29s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gICAgICAgICBncmVlbjogMS4w CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmx1 ZTogMS4wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBhbHBoYTogMS4wXTsKKyAgLSAgQUxURVJOQVRJVkUgRVhBTVBMRToKKyAgICAgZW51bSBmYWNl X2lkIGRlYnVnZ2luZ19mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMtPmYsIGlu dGVybiAoIistZGVidWdnaW5nLWZhY2UiKSwgdHJ1ZSk7CisgICAgIHN0cnVjdCBmYWNlICpkZWJ1 Z2dpbmdfZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgZGVidWdnaW5nX2ZhY2VfaWQpOworICAg ICBOU0NvbG9yICpjb2xvciA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVH Uk9VTkQgKGRlYnVnZ2luZ19mYWNlKSwgcy0+Zik7CisgICAgIFtjb2xvciBzZXRdOyAqLworICBp ZiAoZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBICisgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNf R0xZUEhMRVNTKQorICAgIFtbTlNDb2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiBsc2wucmVk CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JlZW46IGxzbC5ncmVlbgorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBibHVlOiBsc2wuYmx1ZQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGFscGhhOiAxLjBdIHNldF07CisgICAgZWxzZQorICAgICAgW0ZSQU1F X0NVUlNPUl9DT0xPUiAoZikgc2V0XTsKKyAgaWYgKGN1cnNvcl90eXBlID09IE1DX0ZSQU1FRF9C T1gpCisgICAgeworICAgICAgTGlzcF9PYmplY3QgYnVmID0gdy0+Y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3dfYWN0aXZlX3JlZ2lvbl9iZWdfZmFjZSksIGYpOworICAgICAgICAgIGhvbGxvd19j b2xvciA9IGhvbGxvd19hY3RpdmVfcmVnaW9uX2JlZ19jb2xvcjsKKyAgICAgICAgfQorICAgICAg ICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgJiYgYWN0aXZlX3AK KyAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID09IHJlZ2lvbl9lbmQp CisgICAgICAgICAgeworICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVn aW9uX2VuZF9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVh bC1mYWtlLWN1cnNvci1hdC1yZWdpb24tcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAg ICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2UgPSBGQUNFX0ZST01f SUQgKGYsIGhvbGxvd19hY3RpdmVfcmVnaW9uX2VuZF9mYWNlX2lkKTsKKyAgICAgICAgICAgIE5T Q29sb3IgKmhvbGxvd19hY3RpdmVfcmVnaW9uX2VuZF9jb2xvciA9IG5zX2xvb2t1cF9pbmRleGVk X2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGhvbGxvd19hY3RpdmVfcmVnaW9uX2VuZF9mYWNl KSwgZik7CisgICAgICAgICAgICBob2xsb3dfY29sb3IgPSBob2xsb3dfYWN0aXZlX3JlZ2lvbl9l bmRfY29sb3I7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKHJlZ2lvbl9hY3RpdmVf cAorICAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgJiYg Y3Vyc29yX2dseXBoLT5jaGFycG9zID4gcmVnaW9uX2JlZworICAgICAgICAgICAgICA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ZhY2VfaWQpOworICAgICAgICAgICAgICAgIE5TQ29sb3IgKmhvbGxvd19h Y3RpdmVfY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5E IChob2xsb3dfYWN0aXZlX2ZhY2UpLCBmKTsKKyAgICAgICAgICAgICAgICBob2xsb3dfY29sb3Ig PSBob2xsb3dfYWN0aXZlX2NvbG9yOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIC8q IFRoZSByZWdpb24gaXMgX25vdF8gdmlzaWJsZSBpbiB0aGUgaW5hY3RpdmUgd2luZG93IGJlY2F1 c2UgdGhlIG92ZXJsYXkgd2luZG93IHByb3BlcnR5IGlzIHVzZWQuICovCisgICAgICAgICAgICAg IGVsc2UgaWYgKCFhY3RpdmVfcCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFj ZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNl IiksIHRydWUpOworICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19pbmFjdGl2 ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCk7CisgICAg ICAgICAgICAgICAgICBOU0NvbG9yICpob2xsb3dfaW5hY3RpdmVfY29sb3IgPSBuc19sb29rdXBf aW5kZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5EIChob2xsb3dfaW5hY3RpdmVfZmFjZSks IGYpOworICAgICAgICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2luYWN0aXZlX2Nv bG9yOworICAgICAgICAgICAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZiAoZmFjZSAmJiBOU19G QUNFX0JBQ0tHUk9VTkQgKGZhY2UpID09IG5zX2luZGV4X2NvbG9yIChGUkFNRV9DVVJTT1JfQ09M T1IgKGYpLCBmKSkKKyAgICAgIHsKKyAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChO U19GQUNFX0ZPUkVHUk9VTkQgKGZhY2UpLCBmKSBzZXRdOworICAgICAgICBob2xsb3dfY29sb3Ig PSBGUkFNRV9DVVJTT1JfQ09MT1IgKGYpOworICAgICAgfQorI2lmZGVmIE5TX0lNUExfQ09DT0EK KyAgTlNEaXNhYmxlU2NyZWVuVXBkYXRlcyAoKTsKKyNlbmRpZgorICBzd2l0Y2ggKGN1cnNvcl90 eXBlKQorICAgIHsKKyAgICAgIGNhc2UgTUNfTk9fRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgYnJl YWs7CisgICAgICBjYXNlIE1DX05PX0NVUlNPUjoKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNl IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19M RUZUX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19GSUxMRURf Qk9YOgorICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNl IE1DX0ZSQU1FRF9CT1g6CisgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICBbaG9sbG93 X2NvbG9yIHNldF07CisgICAgICAgIE5TUmVjdEZpbGwgKE5TSW5zZXRSZWN0IChyLCAxLCAxKSk7 CisgICAgICAgIFtGUkFNRV9DVVJTT1JfQ09MT1IgKGYpIHNldF07CisgICAgICAgIGJyZWFrOwor ICAgICAgY2FzZSBNQ19IT0xMT1dfQk9YOgorICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAg ICAgW2hvbGxvd19jb2xvciBzZXRdOworICAgICAgICBOU1JlY3RGaWxsIChOU0luc2V0UmVjdCAo ciwgMSwgMSkpOworICAgICAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChmKSBzZXRdOworICAgICAg ICBicmVhazsKKyAgICAgIGNhc2UgTUNfSEJBUjoKKyAgICAgICAgTlNSZWN0RmlsbCAocik7Cisg ICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19CQVI6CisgICAgICAgIHMgPSByOworICAgICAg ICAvKiBAbGF3bGlzdCBpcyBmb2N1c2luZyB0aGUgaW5pdGlhbCBkZXZlbG9wbWVudCBvZiBmZWF0 dXJlIHJlcXVlc3RzCisgICAgICAgICMxNzY4NCBhbmQgIzIyODczIG9uIEwyUiBsYW5ndWFnZXMu ICovCisgICAgICAgIGlmIChnbHlwaF9mbGF2b3IgIT0gTUNfR0xZUEgKKyAgICAgICAgICAgICYm IGdseXBoX2ZsYXZvciAhPSBNQ19HTFlQSExFU1MpCisgICAgICAgICAgeworICAgICAgICAgICAg LyogSWYgdGhlIGNoYXJhY3RlciB1bmRlciBjdXJzb3IgaXMgUjJMLCBkcmF3IHRoZSBiYXIgY3Vy c29yCisgICAgICAgICAgICAgICBvbiB0aGUgcmlnaHQgb2YgaXRzIGdseXBoLCByYXRoZXIgdGhh biBvbiB0aGUgbGVmdC4gKi8KKyAgICAgICAgICAgIGlmICgoY3Vyc29yX2dseXBoLT5yZXNvbHZl ZF9sZXZlbCAmIDEpICE9IDApCisgICAgICAgICAgICAgIHMub3JpZ2luLnggKz0gY3Vyc29yX2ds eXBoLT5waXhlbF93aWR0aCAtIHMuc2l6ZS53aWR0aDsKKyAgICAgICAgICB9CisgICAgICAgIE5T UmVjdEZpbGwgKHMpOworICAgICAgICBicmVhazsKKyAgICB9CisgIG5zX3Jlc2V0X2NsaXBwaW5n IChmKTsKKyAgLyogZHJhdyB0aGUgY2hhcmFjdGVyIHVuZGVyIHRoZSBjdXJzb3IgKi8KKyAgaWYg KGdseXBoX2ZsYXZvciAhPSBNQ19HTFlQSExFU1MKKyAgICAgICYmIChjdXJzb3JfdHlwZSA9PSBN Q19GUkFNRURfQk9YCisgICAgICAgICAgfHwgY3Vyc29yX3R5cGUgPT0gTUNfRklMTEVEX0JPWAor ICAgICAgICAgIHx8IGN1cnNvcl90eXBlID09IE1DX0hPTExPV19CT1gKKyAgICAgICAgICB8fCAo ZGVidWdfcAorICAgICAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19IQkFSKQorICAgICAg ICAgIHx8IChkZWJ1Z19wCisgICAgICAgICAgICAgICYmIGN1cnNvcl90eXBlID09IE1DX0JBUikp KQorICAgIHsKKyAgICAgIC8qIGBjdXJzb3JfZ2NfcGAgaXMgdXNlZCBvbmx5IGJ5IGB3MzJ0ZXJt LmNgIGFuZCBgeHRlcm0uYycuICovCisgICAgICBib29sIGN1cnNvcl9nY19wID0gZmFsc2U7Cisg ICAgICBYUmVjdGFuZ2xlICpzYXZlZF9jbGlwID0gTlVMTDsKKyAgICAgIGlmIChyb3ctPmNsaXAg IT0gTlVMTCkKKyAgICAgICAgeworICAgICAgICAgIHNhdmVkX2NsaXAgPSByb3ctPmNsaXA7Cisg ICAgICAgICAgcm93LT5jbGlwID0gTlVMTDsKKyAgICAgICAgfQorICAgICAgbWNfZHJhd19jdXJz b3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywgbHNs LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUs IHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOworICAgICAgaWYgKHNhdmVkX2NsaXAgIT0gTlVM TCkKKyAgICAgICAgcm93LT5jbGlwID0gc2F2ZWRfY2xpcDsKKyAgICB9CisjaWZkZWYgTlNfSU1Q TF9DT0NPQQorICBOU0VuYWJsZVNjcmVlblVwZGF0ZXMgKCk7CisjZW5kaWYKK30KKworc3RhdGlj IHZvaWQKK21jX25zX2RyYXdfdGV4dF9kZWNvcmF0aW9u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yAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgdGhpY2tuZXNzLCBwb3NpdGlvbjsK KyAgICAgICAgICAgIC8qIElmIHRoZSBwcmV2IHdhcyB1bmRlcmxpbmVkLCBtYXRjaCBpdHMgYXBw ZWFyYW5jZS4gKi8KKyAgICAgICAgICAgIGlmIChzLT5wcmV2ICYmIHMtPnByZXYtPmZhY2UtPnVu ZGVybGluZV9wCisgICAgICAgICAgICAgICAgJiYgcy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3R5 cGUgPT0gRkFDRV9VTkRFUl9MSU5FCisgICAgICAgICAgICAgICAgJiYgcy0+cHJldi0+dW5kZXJs aW5lX3RoaWNrbmVzcyA+IDApCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB0aGlj a25lc3MgPSBzLT5wcmV2LT51bmRlcmxpbmVfdGhpY2tuZXNzOworICAgICAgICAgICAgICAgIHBv c2l0aW9uID0gcy0+cHJldi0+dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBz dHJ1Y3QgZm9udCAqZm9udDsKKyAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZGVzY2Vu dDsKKyAgICAgICAgICAgICAgICAgIGZvbnQ9cy0+Zm9udDsKKyAgICAgICAgICAgICAgICAgIGRl c2NlbnQgPSBzLT55ICsgcy0+aGVpZ2h0IC0gcy0+eWJhc2U7CisgICAgICAgICAgICAgICAgICAv KiBVc2UgdW5kZXJsaW5lIHRoaWNrbmVzcyBvZiBmb250LCBkZWZhdWx0aW5nIHRvIDEuICovCisg ICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAoZm9udCAmJiBmb250LT51bmRlcmxpbmVfdGhp Y2tuZXNzID4gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZm9udC0+dW5kZXJs aW5lX3RoaWNrbmVzcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAxOworICAgICAg ICAgICAgICAgICAgLyogRGV0ZXJtaW5lIHRoZSBvZmZzZXQgb2YgdW5kZXJsaW5pbmcgZnJvbSB0 aGUgYmFzZWxpbmUuICovCisgICAgICAgICAgICAgICAgICBpZiAoeF91bmRlcmxpbmVfYXRfZGVz Y2VudF9saW5lKQorICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IGRlc2NlbnQgLSB0aGlj a25lc3M7CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHhfdXNlX3VuZGVybGluZV9wb3Np dGlvbl9wcm9wZXJ0aWVzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGZvbnQgJiYg Zm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uID49IDApCisgICAgICAgICAgICAgICAgICAgICAgcG9z aXRpb24gPSBmb250LT51bmRlcmxpbmVfcG9zaXRpb247CisgICAgICAgICAgICAgICAgICAgICAg ZWxzZSBpZiAoZm9udCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gbHJvdW5k IChmb250LT5kZXNjZW50IC8gMik7CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAg ICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0 OworICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBtYXggKHBvc2l0aW9uLCB1bmRlcmxpbmVf bWluaW11bV9vZmZzZXQpOworICAgICAgICAgICAgICAgICAgLyogRW5zdXJlIHVuZGVybGluaW5n IGlzIG5vdCBjcm9wcGVkLiAqLworICAgICAgICAgICAgICAgICAgaWYgKGRlc2NlbnQgPD0gcG9z aXRpb24pCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBwb3Np dGlvbiA9IGRlc2NlbnQgLSAxOworICAgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IDE7 CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoZGVz Y2VudCA8IHBvc2l0aW9uICsgdGhpY2tuZXNzKQorICAgICAgICAgICAgICAgICAgICAgIHRoaWNr bmVzcyA9IDE7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgcy0+dW5kZXJsaW5lX3Ro aWNrbmVzcyA9IHRoaWNrbmVzczsKKyAgICAgICAgICAgIHMtPnVuZGVybGluZV9wb3NpdGlvbiA9 IHBvc2l0aW9uOworICAgICAgICAgICAgciA9IE5TTWFrZVJlY3QgKHgsIHMtPnliYXNlICsgcG9z aXRpb24sIHdpZHRoLCB0aGlja25lc3MpOworICAgICAgICAgICAgaWYgKGZhY2UtPnVuZGVybGlu ZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsKKyAgICAgICAg ICAgICAgZWxzZQorICAgICAgICAgICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoZmFj ZS0+dW5kZXJsaW5lX2NvbG9yLCBzLT5mKSBzZXRdOworICAgICAgICAgICAgTlNSZWN0RmlsbCAo cik7CisgICAgICAgICAgfQorICAgIH0KKyAgLyogRG8gb3ZlcmxpbmUuIFdlIGZvbGxvdyBvdGhl ciB0ZXJtcyBpbiB1c2luZyBhIHRoaWNrbmVzcyBvZiAxCisgICAgIGFuZCBpZ25vcmluZyBvdmVy bGluZV9tYXJnaW4uICovCisgIGlmIChmYWNlLT5vdmVybGluZV9wKQorICAgIHsKKyAgICAgIE5T UmVjdCByOworICAgICAgciA9IE5TTWFrZVJlY3QgKHgsIHMtPnksIHdpZHRoLCAxKTsKKyAgICAg IGlmIChmYWNlLT5vdmVybGluZV9jb2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgW2RlZmF1bHRD b2wgc2V0XTsKKyAgICAgICAgZWxzZQorICAgICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xv ciAoZmFjZS0+b3ZlcmxpbmVfY29sb3IsIHMtPmYpIHNldF07CisgICAgICBOU1JlY3RGaWxsIChy KTsKKyAgICB9CisgIC8qIERvIHN0cmlrZS10aHJvdWdoLiAgV2UgZm9sbG93IG90aGVyIHRlcm1z IGZvciB0aGlja25lc3MgYW5kCisgICAgIHZlcnRpY2FsIHBvc2l0aW9uLiovCisgIGlmIChmYWNl LT5zdHJpa2VfdGhyb3VnaF9wKQorICAgIHsKKyAgICAgIE5TUmVjdCByOworICAgICAgdW5zaWdu ZWQgbG9uZyBkeTsKKyAgICAgIGR5ID0gbHJpbnQgKChzLT5oZWlnaHQgLSAxKSAvIDIpOworICAg ICAgciA9IE5TTWFrZVJlY3QgKHgsIHMtPnkgKyBkeSwgd2lkdGgsIDEpOworICAgICAgaWYgKGZh Y2UtPnN0cmlrZV90aHJvdWdoX2NvbG9yX2RlZmF1bHRlZF9wKQorICAgICAgICBbZGVmYXVsdENv bCBzZXRdOworICAgICAgICBlbHNlCisgICAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9y IChmYWNlLT5zdHJpa2VfdGhyb3VnaF9jb2xvciwgcy0+Zikgc2V0XTsKKyAgICAgIE5TUmVjdEZp bGwgKHIpOworICAgIH0KK30KKworc3RhdGljIHZvaWQKK21jX25zX2R1bXBnbHlwaHNfc3RyZXRj aCAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LAor ICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCB3ZCkK K3sKKyAgTlNSZWN0IHJbMl07CisgIGludCBuLCBpOworICBzdHJ1Y3QgZmFjZSAqZmFjZTsKKyAg TlNDb2xvciAqZmdDb2wsICpiZ0NvbDsKKyAgaWYgKCFzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wKQor ICAgIHsKKyAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgcik7Cisg ICAgICAqciA9IE5TTWFrZVJlY3QgKHMtPngsIHMtPnksIHMtPmJhY2tncm91bmRfd2lkdGgsIHMt PmhlaWdodCk7CisgICAgICBpZiAoIW5zX2NsaXBfdG9fcmVjdCAocy0+ZiwgciwgbikpCisgICAg ICAgIHJldHVybjsKKyAgICAgIGlmIChzLT5obCA9PSBEUkFXX01PVVNFX0ZBQ0UpCisgICAgICAg IHsKKyAgICAgICAgICBmYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBNT1VTRV9ITF9JTkZPIChz LT5mKS0+bW91c2VfZmFjZV9mYWNlX2lkKTsKKyAgICAgICAgICBpZiAoIWZhY2UpCisgICAgICAg ICAgICBmYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBNT1VTRV9GQUNFX0lEKTsKKyAgICAgICAg fQorICAgICAgICBlbHNlCisgICAgICAgICBmYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBzLT5m aXJzdF9nbHlwaC0+ZmFjZV9pZCk7CisgICAgICBiZ0NvbCA9IG5zX2xvb2t1cF9pbmRleGVkX2Nv bG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpLCBzLT5mKTsKKyAgICAgIGZnQ29sID0gbnNf bG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoZmFjZSksIHMtPmYpOwor ICAgICAgZm9yIChpID0gMDsgaSA8IG47ICsraSkKKyAgICAgICAgeworICAgICAgICAgIGlmICgh cy0+cm93LT5mdWxsX3dpZHRoX3ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGludCBv dmVycnVuLCBsZWZ0b3ZlcnJ1bjsKKyAgICAgICAgICAgICAgLyogdHJ1bmNhdGUgdG8gYXZvaWQg b3ZlcndyaXRpbmcgZnJpbmdlIGFuZC9vciBzY3JvbGxiYXIgKi8KKyAgICAgICAgICAgICAgb3Zl cnJ1biA9IG1heCAoMCwgKHMtPnggKyBzLT5iYWNrZ3JvdW5kX3dpZHRoKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgLSAoV0lORE9XX0JPWF9SSUdIVF9FREdFX1ggKHMtPncpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIFdJTkRPV19SSUdIVF9GUklOR0VfV0lEVEgg KHMtPncpKSk7CisgICAgICAgICAgICAgICAgICAgIHJbaV0uc2l6ZS53aWR0aCAtPSBvdmVycnVu OworICAgICAgICAgICAgICAvKiB0cnVuY2F0ZSB0byBhdm9pZCBvdmVyd3JpdGluZyB0byBsZWZ0 IG9mIHRoZSB3aW5kb3cgYm94ICovCisgICAgICAgICAgICAgIGxlZnRvdmVycnVuID0gKFdJTkRP V19CT1hfTEVGVF9FREdFX1ggKHMtPncpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsg V0lORE9XX0xFRlRfRlJJTkdFX1dJRFRIIChzLT53KSkgLSBzLT54OworICAgICAgICAgICAgICBp ZiAobGVmdG92ZXJydW4gPiAwKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAg IHJbaV0ub3JpZ2luLnggKz0gbGVmdG92ZXJydW47CisgICAgICAgICAgICAgICAgICByW2ldLnNp emUud2lkdGggLT0gbGVmdG92ZXJydW47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICAvKiBYWFg6IFRyeSB0byB3b3JrIGJldHdlZW4gcHJvYmxlbSB3aGVyZSBhIHN0cmV0Y2ggZ2x5 cGggb24KKyAgICAgICAgICAgICAgICAgYSBwYXJ0aWFsbHktdmlzaWJsZSBib3R0b20gcm93IHdp bGwgY2xlYXIgcGFydCBvZiB0aGUKKyAgICAgICAgICAgICAgICAgbW9kZWxpbmUsIGFuZCBhbm90 aGVyIHdoZXJlIGxpc3QtYnVmZmVycyBoZWFkZXJzIGFuZCBzaW1pbGFyCisgICAgICAgICAgICAg ICAgIHJvd3MgZXJyb25lb3VzbHkgaGF2ZSB2aXNpYmxlX2hlaWdodCBzZXQgdG8gMC4gIE5vdCBz dXJlCisgICAgICAgICAgICAgICAgIHdoZXJlIHRoaXMgaXMgY29taW5nIGZyb20gYXMgb3RoZXIg dGVybXMgc2VlbSBub3QgdG8gc2hvdy4gKi8KKyAgICAgICAgICAgICAgcltpXS5zaXplLmhlaWdo dCA9IG1pbiAocy0+aGVpZ2h0LCBzLT5yb3ctPnZpc2libGVfaGVpZ2h0KTsKKyAgICAgICAgICAg IH0KKyAgICAgICAgICBbYmdDb2wgc2V0XTsKKyAgICAgICAgICAvKiBOT1RFOiB1bmRlciBOUyB0 aGlzIGlzIE5PVCB1c2VkIHRvIGRyYXcgY3Vyc29ycywgYnV0IHdlIG11c3QgYXZvaWQKKyAgICAg ICAgICAgICBvdmVyd3JpdGluZyBjdXJzb3IgKHVzdWFsbHkgd2hlbiBjdXJzb3Igb24gYSB0YWIp ICovCisgICAgICAgICAgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICAvKiBGSVhNRTogIERvIHdlIHN0aWxsIG5lZWQgdG8gcHJldmVudCB0aGlz IHNlY3Rpb24gb2YgY29kZSBmcm9tCisgICAgICAgICAgICAgIGVyYXNpbmcgdGhlIGZha2UgTUNf SEJBUiB0aGF0IGV4dGVuZHMgdGhlIGVudGlyZSBsZW5ndGggb2YgdGhlCisgICAgICAgICAgICAg IFNUUkVUQ0hfR0xZUEg/ICBUaGlzIG1heSBoYXZlIGJlZW4gZG9uZSBwcmlvciB0byB0aGUgZml4 IHJlbGF0aW5nCisgICAgICAgICAgICAgIHRvIGxlZnQvcmlnaHQgb3ZlcndyaXR0ZW4gZ2x5cGhz LiAqLworICAgICAgICAgICAgICByW2ldLnNpemUuaGVpZ2h0IC09IDE7CisgICAgICAgICAgICAg IC8vICBlbnVtIGZhY2VfaWQgZGVidWdnaW5nX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAo cy0+dywgcy0+ZiwgaW50ZXJuICgiKy1kZWJ1Z2dpbmctZmFjZSIpLCB0cnVlKTsKKyAgICAgICAg ICAgICAgLy8gIHN0cnVjdCBmYWNlICpkZWJ1Z2dpbmdfZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ ZiwgZGVidWdnaW5nX2ZhY2VfaWQpOworICAgICAgICAgICAgICAvLyAgTlNDb2xvciAqY29sb3Ig PSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChkZWJ1Z2dpbmdf ZmFjZSksIHMtPmYpOworICAgICAgICAgICAgICAvLyAgW2NvbG9yIHNldF07CisgICAgICAgICAg ICAgIENHRmxvYXQgeCA9IHJbaV0ub3JpZ2luLng7CisgICAgICAgICAgICAgIENHRmxvYXQgd2lk dGggPSB3ZDsKKyAgICAgICAgICAgICAgcltpXS5zaXplLndpZHRoIC09IHdpZHRoOworICAgICAg ICAgICAgICByW2ldLm9yaWdpbi54ICs9IHdpZHRoOworICAgICAgICAgICAgICBOU1JlY3RGaWxs IChyW2ldKTsKKyAgICAgICAgICAgICAgLyogRHJhdyBvdmVybGluaW5nLCBldGMuIG9uIHRoZSBj dXJzb3IuICovCisgICAgICAgICAgICAgIGlmIChzLT53LT5waHlzX2N1cnNvcl90eXBlID09IE1D X0ZJTExFRF9CT1gpCisgICAgICAgICAgICAgICAgbWNfbnNfZHJhd190ZXh0X2RlY29yYXRpb24g KHMsIGZhY2UsIGJnQ29sLCB3aWR0aCwgeCk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICAgICAgbWNfbnNfZHJhd190ZXh0X2RlY29yYXRpb24gKHMsIGZhY2UsIGZnQ29sLCB3 aWR0aCwgeCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgewor ICAvLyAgaW50IHJ4ID0gcltpXS5vcmlnaW4ueDsKKyAgLy8gIGludCByeSA9IHJbaV0ub3JpZ2lu Lnk7CisgIC8vICBpbnQgcncgPSByW2ldLnNpemUud2lkdGg7CisgIC8vICBpbnQgcmggPSByW2ld LnNpemUuaGVpZ2h0OworICAvLyAgZnByaW50ZiAoc3RkZXJyLCAibWNfbnNfZHVtcGdseXBoc19z dHJldGNoOiAgdnBvcyAoJWQpIHwgcnggKCVkKSB8IHJ5ICglZCkgfCBydyAoJWQpIHwgcmggKCVk KVxuIiwKKyAgLy8gICAgICAgICAgICAgICAgICAgcy0+Zmlyc3RfZ2x5cGgtPnZwb3MsIHJ4LCBy eSwgcncsIHJoKTsKKyAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocltpXSk7CisgICAgICAgICAg ICB9CisgICAgICAgICAgLyogRHJhdyBvdmVybGluaW5nLCBldGMuIG9uIHRoZSBzdHJldGNoIGds eXBoIChvciB0aGUgcGFydAorICAgICAgICAgICAgIG9mIHRoZSBzdHJldGNoIGdseXBoIGFmdGVy IHRoZSBjdXJzb3IpLiAqLworICAgICAgICAgIG1jX25zX2RyYXdfdGV4dF9kZWNvcmF0aW9uIChz LCBmYWNlLCBmZ0NvbCwgcltpXS5zaXplLndpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICByW2ldLm9yaWdpbi54KTsKKyAgICAgICAgfQorICAgICAgaWYgKChzLT5s ZWZ0X292ZXJ3cml0dGVuX3AgfHwgcy0+cmlnaHRfb3ZlcndyaXR0ZW5fcCkKKyAgICAgICAgICAm JiAocy0+YWN0aW9uX3R5cGUgPT0gTUNfRFJBV19HTFlQSCB8fCBzLT5hY3Rpb25fdHlwZSA9PSBN Q19FUkFTRV9HTFlQSCkpCisgICAgICAgIG1jX25zX2RyYXdfb3ZlcndyaXR0ZW4gKHMsIG1hdHJp eCwgcm93LCBzLT5maXJzdF9nbHlwaCk7CisgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7 CisgICAgICBzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wID0gMTsKKyAgICB9Cit9CisKK3N0YX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gICAgICAgICAgICBmcm9tUmVj dDogaXIKKyAgICAgICAgICAgICBvcGVyYXRpb246IE5TQ29tcG9zaXRlU291cmNlT3ZlcgorICAg ICAgICAgICAgICBmcmFjdGlvbjogMS4wCisgICAgICAgICAgIHJlc3BlY3RGbGlwcGVkOiBZRVMK KyAgICAgICAgICAgICAgICBoaW50czogbmlsXTsKKyNlbHNlCisgICAgICBbaW1nIGNvbXBvc2l0 ZVRvUG9pbnQ6IE5TTWFrZVBvaW50ICh4LCB5ICsgcy0+c2xpY2UuaGVpZ2h0KQorICAgICAgICAg ICAgICAgICAgb3BlcmF0aW9uOiBOU0NvbXBvc2l0ZVNvdXJjZU92ZXJdOworI2VuZGlmCisgICAg fQorICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IpCisgICAgeworICAgICAgW0ZSQU1FX0NVUlNP Ul9DT0xPUiAocy0+Zikgc2V0XTsKKyAgICAgIGlmIChzLT53LT5waHlzX2N1cnNvcl90eXBlID09 IE1DX0ZJTExFRF9CT1gpCisgICAgICAgIHRkQ29sID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3Ig KE5TX0ZBQ0VfQkFDS0dST1VORCAoZmFjZSksIHMtPmYpOworICAgICAgICBlbHNlCisgICAgICAg ICAgLyogQ3VycmVudGx5IG9uIE5TIGltZy0+bWFzayBpcyBhbHdheXMgMC4gU2luY2UKKyAgICAg ICAgICAgICBnZXRfd2luZG93X2N1cnNvcl90eXBlIHNwZWNpZmllcyBhIGhvbGxvdyBib3ggY3Vy c29yIHdoZW4gb24KKyAgICAgICAgICAgICBhIG5vbi1tYXNrZWQgaW1hZ2Ugd2UgbmV2ZXIgcmVh Y2ggdGhpcyBjbGF1c2UuIEJ1dCB3ZSBwdXQgaXQKKyAgICAgICAgICAgICBpbiBpbiBhbnRpY2lw YXRpb24gb2YgYmV0dGVyIHN1cHBvcnQgZm9yIGltYWdlIG1hc2tzIG9uIE5TLiAqLworICAgICAg ICAgIHRkQ29sID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAo ZmFjZSksIHMtPmYpOworICAgIH0KKyAgICBlbHNlCisgICAgICB0ZENvbCA9IG5zX2xvb2t1cF9p bmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQgKGZhY2UpLCBzLT5mKTsKKyAgLyogRHJh dyB1bmRlcmxpbmUsIG92ZXJsaW5lLCBzdHJpa2UtdGhyb3VnaC4gKi8KKyAgbWNfbnNfZHJhd190 ZXh0X2RlY29yYXRpb24gKHMsIGZhY2UsIHRkQ29sLCBici5zaXplLndpZHRoLCBici5vcmlnaW4u eCk7CisgIC8qIERyYXcgcmVsaWVmLCBpZiByZXF1ZXN0ZWQgKi8KKyAgaWYgKHMtPmltZy0+cmVs aWVmIHx8IHMtPmhsID09RFJBV19JTUFHRV9SQUlTRUQgfHwgcy0+aGwgPT1EUkFXX0lNQUdFX1NV TktFTikKKyAgICB7CisgICAgICBpZiAocy0+aGwgPT0gRFJBV19JTUFHRV9TVU5LRU4gfHwgcy0+ aGwgPT0gRFJBV19JTUFHRV9SQUlTRUQpCisgICAgICAgIHsKKyAgICAgICAgICB0aCA9IHRvb2xf YmFyX2J1dHRvbl9yZWxpZWYgPj0gMCA/CisgICAgICAgICAgICB0b29sX2Jhcl9idXR0b25fcmVs aWVmIDogREVGQVVMVF9UT09MX0JBUl9CVVRUT05fUkVMSUVGOworICAgICAgICAgIHJhaXNlZF9w ID0gKHMtPmhsID09IERSQVdfSU1BR0VfUkFJU0VEKTsKKyAgICAgICAgfQorICAgICAgICBlbHNl CisgICAgICAgICAgeworICAgICAgICAgICAgdGggPSBhYnMgKHMtPmltZy0+cmVsaWVmKTsKKyAg ICAgICAgICAgIHJhaXNlZF9wID0gKHMtPmltZy0+cmVsaWVmID4gMCk7CisgICAgICAgICAgfQor ICAgICAgci5vcmlnaW4ueCA9IHggLSB0aDsKKyAgICAgIHIub3JpZ2luLnkgPSB5IC0gdGg7Cisg ICAgICByLnNpemUud2lkdGggPSBzLT5zbGljZS53aWR0aCArIDIqdGgtMTsKKyAgICAgIHIuc2l6 ZS5oZWlnaHQgPSBzLT5zbGljZS5oZWlnaHQgKyAyKnRoLTE7CisgICAgICBuc19kcmF3X3JlbGll ZiAociwgdGgsIHJhaXNlZF9wLAorICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLnkgPT0g MCwKKyAgICAgICAgICAgICAgICAgICAgICBzLT5zbGljZS55ICsgcy0+c2xpY2UuaGVpZ2h0ID09 IHMtPmltZy0+aGVpZ2h0LAorICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLnggPT0gMCwK KyAgICAgICAgICAgICAgICAgICAgICBzLT5zbGljZS54ICsgcy0+c2xpY2Uud2lkdGggPT0gcy0+ aW1nLT53aWR0aCwgcyk7CisgICAgfQorICAvKiBJZiB0aGVyZSBpcyBubyBtYXNrLCB0aGUgYmFj a2dyb3VuZCB3b24ndCBiZSBzZWVuLAorICAgICBzbyBkcmF3IGEgcmVjdGFuZ2xlIG9uIHRoZSBp bWFnZSBmb3IgdGhlIGN1cnNvci4KKyAgICAgRG8gdGhpcyBmb3IgYWxsIGltYWdlcywgZ2V0dGlu ZyB0cmFuc3BhcmVuY3kgcmlnaHQgaXMgbm90IHJlbGlhYmxlLiAqLworICBpZiAocy0+aGwgPT0g RFJBV19DVVJTT1IpCisgICAgeworICAgICAgaW50IHRoaWNrbmVzcyA9IGFicyAocy0+aW1nLT5y ZWxpZWYpOworICAgICAgaWYgKHRoaWNrbmVzcyA9PSAwKSB0aGlja25lc3MgPSAxOworICAgIGlm IChnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEgKKyAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1D X0dMWVBITEVTUykKKyAgICAgIHsKKyAgICAgICAgTlNDb2xvciAqYm9yZGVyX2NvbG9yID0gW05T Q29sb3IgY29sb3JXaXRoQ2FsaWJyYXRlZFJlZDogbHNsLnJlZAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdyZWVuOiBsc2wuZ3JlZW4K KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgYmx1ZTogbHNsLmJsdWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBhbHBoYTogMS4wXTsKKyAgICAgICAgbnNfZHJhd19ib3ggKGJy LCB0aGlja25lc3MsIGJvcmRlcl9jb2xvciwgMSwgMSk7CisgICAgICB9CisgICAgICBlbHNlCisg ICAgICAgIG5zX2RyYXdfYm94IChiciwgdGhpY2tuZXNzLCBGUkFNRV9DVVJTT1JfQ09MT1IgKHMt PmYpLCAxLCAxKTsKKyAgICB9Cit9CisKK3N0YXRpYyB2b2lkCittY19uc19tYXliZV9kdW1wZ2x5 cGhzX2JhY2tncm91bmQgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMsIGNoYXIgZm9yY2VfcCkKK3sK KyAgTlNUUkFDRSAoIm1jX25zX21heWJlX2R1bXBnbHlwaHNfYmFja2dyb3VuZCIpOworICBpZiAo IXMtPmJhY2tncm91bmRfZmlsbGVkX3AvKiB8fCBzLT5obCA9PSBEUkFXX01PVVNFX0ZBQ0UqLykK KyAgICB7CisgICAgICBpbnQgYm94X2xpbmVfd2lkdGggPSBtYXggKHMtPmZhY2UtPmJveF9saW5l X3dpZHRoLCAwKTsKKyAgICAgIGlmIChGT05UX0hFSUdIVCAocy0+Zm9udCkgPCBzLT5oZWlnaHQg LSAyICogYm94X2xpbmVfd2lkdGgKKyAgICAgICAgICAvKiBXaGVuIHhkaXNwLmMgaWdub3JlcyBG T05UX0hFSUdIVCwgd2UgY2Fubm90IHRydXN0IGZvbnQKKyAgICAgICAgICAgICBkaW1lbnNpb25z LCBzaW5jZSB0aGUgYWN0dWFsIGdseXBocyBtaWdodCBiZSBtdWNoCisgICAgICAgICAgICAgc21h bGxlci4gIFNvIGluIHRoYXQgY2FzZSB3ZSBhbHdheXMgY2xlYXIgdGhlIHJlY3RhbmdsZQorICAg ICAgICAgICAgIHdpdGggYmFja2dyb3VuZCBjb2xvci4gKi8KKyAgICAgICAgICB8fCBGT05UX1RP T19ISUdIIChzLT5mb250KQorICAgICAgICAgIHx8IHMtPmZvbnRfbm90X2ZvdW5kX3AgfHwgcy0+ ZXh0ZW5kc190b19lbmRfb2ZfbGluZV9wIHx8IGZvcmNlX3ApCisgICAgICAgIHsKKyAgICAgICAg ICBzdHJ1Y3QgZmFjZSAqZmFjZTsKKyAgICAgICAgICBpZiAocy0+aGwgPT0gRFJBV19NT1VTRV9G QUNFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBmYWNlID0gRkFDRV9GUk9NX0lEIChz LT5mLCBNT1VTRV9ITF9JTkZPIChzLT5mKS0+bW91c2VfZmFjZV9mYWNlX2lkKTsKKyAgICAgICAg ICAgICAgaWYgKCFmYWNlKQorICAgICAgICAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQgKHMt PmYsIE1PVVNFX0ZBQ0VfSUQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICBmYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBzLT5maXJzdF9nbHlwaC0+ZmFj ZV9pZCk7CisgICAgICAgICAgaWYgKCFmYWNlLT5zdGlwcGxlKQorICAgICAgICAgICAgWyhOU19G QUNFX0JBQ0tHUk9VTkQgKGZhY2UpICE9IDAKKyAgICAgICAgICAgICAgPyBuc19sb29rdXBfaW5k ZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKSwgcy0+ZikKKyAgICAgICAgICAg ICAgOiBGUkFNRV9CQUNLR1JPVU5EX0NPTE9SIChzLT5mKSkgc2V0XTsKKyAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0cnVjdCBuc19kaXNwbGF5X2lu Zm8gKmRweWluZm8gPSBGUkFNRV9ESVNQTEFZX0lORk8gKHMtPmYpOworICAgICAgICAgICAgICAg IFtbZHB5aW5mby0+Yml0bWFwc1tmYWNlLT5zdGlwcGxlLTFdLmltZyBzdGlwcGxlTWFza10gc2V0 XTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIGlmIChzLT5obCAhPSBEUkFXX0NVUlNPUikK KyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgcy0+cmVjdGFuZ2xlX251a2VkX3AgPSB0cnVl OworICAgICAgICAgICAgICBOU1JlY3QgciA9IE5TTWFrZVJlY3QgKHMtPngsIHMtPnkgKyBib3hf bGluZV93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPmJhY2tn cm91bmRfd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzLT5oZWln aHQtMipib3hfbGluZV93aWR0aCk7CisgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAg ICAgICAgICAgfQorICAgICAgICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSAxOworICAgICAg ICB9CisgICAgfQorfQorCitzdGF0aWMgdm9pZAorbWNfbnNfZHJhd19nbHlwaF9zdHJpbmcgKHN0 cnVjdCBnbHlwaF9zdHJpbmcgKnMsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0 IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0Ig bHNsLCBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IsCisgICAgICAgICAgICAgICAgICAgICAg ICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICBpbnQgd2QsIGJvb2wgYWN0aXZlX3AsIGJvb2wgY3Vyc29yX2djX3ApCisvKiAtLS0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gtPnR5cGUgIT0gU1RSRVRDSF9HTFlQSCkKKyAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAo cy0+bmV4dCwgcik7CisgICAgICAgICAgICAgICAgaWYgKCFuc19jbGlwX3RvX3JlY3QgKHMtPmYs IHIsIG4pKQorICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIG1jX25z X21heWJlX2R1bXBnbHlwaHNfYmFja2dyb3VuZCAocy0+bmV4dCwgMSk7CisgICAgICAgICAgICAg ICAgbnNfcmVzZXRfY2xpcHBpbmcgKHMtPmYpOworICAgICAgICAgICAgICB9CisgICAgICAgICAg ICBlbHNlCisgICAgICAgICAgICAgIG1jX25zX2R1bXBnbHlwaHNfc3RyZXRjaCAocy0+bmV4dCwg bWF0cml4LCByb3csIHdkKTsKKyAgICAgICAgICAgIG5leHQtPm51bV9jbGlwcyA9IDA7CisgICAg ICAgICAgfQorICAgIH0KKyAgaWYgKCFzLT5mb3Jfb3ZlcmxhcHMgJiYgcy0+ZmFjZS0+Ym94ICE9 IEZBQ0VfTk9fQk9YCisgICAgICAmJiAocy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQ SAorICAgICAgICAgIHx8IHMtPmZpcnN0X2dseXBoLT50eXBlID09IENPTVBPU0lURV9HTFlQSCkp CisgICAgeworICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCByKTsK KyAgICAgIGlmICghbnNfY2xpcF90b19yZWN0IChzLT5mLCByLCBuKSkKKyAgICAgICAgcmV0dXJu OworICAgICAgbWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzLCAxKTsKKyAgICAg IG5zX2R1bXBnbHlwaHNfYm94X29yX3JlbGllZiAocyk7CisgICAgICBuc19yZXNldF9jbGlwcGlu ZyAocy0+Zik7CisgICAgICBib3hfZHJhd25fcCA9IDE7CisgICAgfQorICBzd2l0Y2ggKHMtPmZp cnN0X2dseXBoLT50eXBlKQorICAgIHsKKyAgICBjYXNlIElNQUdFX0dMWVBIOgorICAgICAgbiA9 IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAgICAgIGlmICghbnNfY2xp cF90b19yZWN0IChzLT5mLCByLCBuKSkKKyAgICAgICAgcmV0dXJuOworICAgICAgbWNfbnNfZHVt cGdseXBoc19pbWFnZSAocywgclswXSwgbHNsLCBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCBh Y3RpdmVfcCk7CisgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICBicmVhazsK KyAgICBjYXNlIFNUUkVUQ0hfR0xZUEg6CisgICAgICBtY19uc19kdW1wZ2x5cGhzX3N0cmV0Y2gg KHMsIG1hdHJpeCwgcm93LCB3ZCk7CisgICAgICBicmVhazsKKyAgICBjYXNlIENIQVJfR0xZUEg6 CisgICAgY2FzZSBDT01QT1NJVEVfR0xZUEg6CisgICAgICBuID0gbnNfZ2V0X2dseXBoX3N0cmlu Z19jbGlwX3JlY3QgKHMsIHIpOworICAgICAgaWYgKCFuc19jbGlwX3RvX3JlY3QgKHMtPmYsIHIs IG4pKQorICAgICAgICByZXR1cm47CisgICAgICBpZiAocy0+Zm9yX292ZXJsYXBzCisgICAgICAg ICAgfHwgKHMtPmNtcF9mcm9tID4gMAorICAgICAgICAgICAgICAmJiAhIHMtPmZpcnN0X2dseXBo LT51LmNtcC5hdXRvbWF0aWMpKQorICAgICAgICBzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wID0gMTsK KyAgICAgIGVsc2UKKyAgICAgICAgbWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChz LCBzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpOworICAgICAgZmxhZ3Mg PSBzLT5obCA9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EZBQ0VfRlJPTV9JRCAocy0+ ZiwgaG9sbG93X2FjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgIE5TX0ZBQ0VfRk9SRUdST1VO RCAocy0+ZmFjZSkgPSBOU19GQUNFX0ZPUkVHUk9VTkQgKGhvbGxvd19hY3RpdmVfZmFjZSk7Cisg ICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SCisgICAg ICAgICAgICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWAorICAgICAgICAg ICAgICAgICAgICYmIGFjdGl2ZV9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBlbnVt IGZhY2VfaWQgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+ dywgcy0+ZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNl IiksIHRydWUpOworICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2luYWN0aXZlX2Zh Y2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkKTsKKyAgICAg ICAgICAgICAgTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKSA9IE5TX0ZBQ0VfRk9SRUdST1VO RCAoaG9sbG93X2luYWN0aXZlX2ZhY2UpOworICAgICAgICAgICAgfQorICAgICAgeworICAgICAg ICBCT09MIGlzQ29tcG9zaXRlID0gcy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dM WVBIOworICAgICAgICBpZiAoaXNDb21wb3NpdGUpCisgICAgICAgICAgbnNfZHJhd19jb21wb3Np dGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHMpOworICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgYm9vbCB3aXRoX2JnX3AgPSAoKGZsYWdzID09IE5TX0RVTVBH TFlQSF9OT1JNQUwgJiYgIXMtPmJhY2tncm91bmRfZmlsbGVkX3ApCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHx8IGZsYWdzID09IE5TX0RVTVBHTFlQSF9NT1VTRUZBQ0UpOworICAg ICAgICAgICAgICBpZiAod2l0aF9iZ19wKQorICAgICAgICAgICAgICAgIHMtPmJhY2tncm91bmRf bnVrZWRfcCA9IHRydWU7CisgICAgICAgICAgICAgIGZvbnQtPmRyaXZlci0+ZHJhdyAocywgcy0+ Y21wX2Zyb20sIHMtPm5jaGFycywgcy0+eCwgcy0+eWJhc2UsIHdpdGhfYmdfcCk7CisgICAgICAg ICAgICB9CisgICAgICB9CisgICAgICB7CisgICAgICAgIE5TQ29sb3IgKmNvbCA9IChOU19GQUNF X0ZPUkVHUk9VTkQgKHMtPmZhY2UpICE9IDAKKyAgICAgICAgICAgICAgICAgICAgICAgID8gbnNf bG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSksCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzLT5mKQorICAg ICAgICAgICAgICAgICAgICAgICAgOiBGUkFNRV9GT1JFR1JPVU5EX0NPTE9SIChzLT5mKSk7Cisg ICAgICAgIFtjb2wgc2V0XTsKKyAgICAgICAgLyogRHJhdyB1bmRlcmxpbmUsIG92ZXJsaW5lLCBz dHJpa2UtdGhyb3VnaC4gKi8KKyAgICAgICAgbWNfbnNfZHJhd190ZXh0X2RlY29yYXRpb24gKHMs IHMtPmZhY2UsIGNvbCwgcy0+d2lkdGgsIHMtPngpOworICAgICAgfQorICAgICAgeworICAgICAg ICBpZiAocy0+Zmlyc3RfZ2x5cGgtPnR5cGUgIT0gQ09NUE9TSVRFX0dMWVBICisgICAgICAgICAg ICAmJiAocy0+bGVmdF9vdmVyd3Jp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jdCAo cy0+ZiwgciwgbikpCisgICAgICAgIHJldHVybjsKKyAgICAgIGlmIChzLT5mb3Jfb3ZlcmxhcHMg fHwgKHMtPmNtcF9mcm9tID4gMAorICAgICAgICAgICAgJiYgISBzLT5maXJzdF9nbHlwaC0+dS5j bXAuYXV0b21hdGljKSkKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IDE7CisgICAg ICBlbHNlCisgICAgICAgIG1jX25zX21heWJlX2R1bXBnbHlwaHNfYmFja2dyb3VuZCAocywgcy0+ Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKTsKKyAgICAgIC8qIC4uLiAqLwor ICAgICAgLyogTm90IHlldCBpbXBsZW1lbnRlZC4gKi8KKyAgICAgIC8qIC4uLiAqLworICAgICAg bnNfcmVzZXRfY2xpcHBpbmcgKHMtPmYpOworICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoKKyAg ICAgIGVtYWNzX2Fib3J0ICgpOworICAgIH0KKyAgLyogRHJhdyBib3ggaWYgbm90IGRvbmUgYWxy ZWFkeS4gKi8KKyAgaWYgKCFzLT5mb3Jfb3ZlcmxhcHMgJiYgIWJveF9kcmF3bl9wICYmIHMtPmZh Y2UtPmJveCAhPSBGQUNFX05PX0JPWCkKKyAgICB7CisgICAgICBuID0gbnNfZ2V0X2dseXBoX3N0 cmluZ19jbGlwX3JlY3QgKHMsIHIpOworICAgICAgaWYgKCFuc19jbGlwX3RvX3JlY3QgKHMtPmYs IHIsIG4pKQorICAgICAgICByZXR1cm47CisgICAgICBuc19kdW1wZ2x5cGhzX2JveF9vcl9yZWxp ZWYgKHMpOworICAgICAgbnNfcmVzZXRfY2xpcHBpbmcgKHMtPmYpOworICAgIH0KKyAgcy0+bnVt X2NsaXBzID0gMDsKK30KKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKIC8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAKICAgIE5TVFJBQ0UsIFRy YWNlIHN1cHBvcnQuCkBAIC0xMTA5LDYgKzIwODIsMTYgQEAgc3RhdGljIE5TUmVjdCBjb25zdHJh aW5fZnJhbWVfcmVjdChOU1JlY3QgZnJhbWVSZWN0LCBib29sIGlzRnVsbHNjcmVlbikKICAgIGV4 dGVybmFsIChSSUYpIGNhbGw7IHdob2xlIGZyYW1lLCBjYWxsZWQgYmVmb3JlIHVwZGF0ZV93aW5k b3dfYmVnaW4KICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCiB7CisKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdfZnJh bWUgPSBmOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAjaWZkZWYgTlNfSU1QTF9D T0NPQQogICBFbWFjc1ZpZXcgKnZpZXcgPSBGUkFNRV9OU19WSUVXIChmKTsKIApAQCAtMTIwOSw2 ICsyMTkyLDE2IEBAIHN0YXRpYyBOU1JlY3QgY29uc3RyYWluX2ZyYW1lX3JlY3QoTlNSZWN0IGZy YW1lUmVjdCwgYm9vbCBpc0Z1bGxzY3JlZW4pCiAKIC8qICAgaWYgKGYgPT0gTU9VU0VfSExfSU5G TyAoZiktPm1vdXNlX2ZhY2VfbW91c2VfZnJhbWUpICovCiAgIE1PVVNFX0hMX0lORk8gKGYpLT5t b3VzZV9mYWNlX2RlZmVyID0gMDsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1V TFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGluZ19mcmFtZSA9IE5VTEw7CisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKIH0KIAogCkBAIC00ODAzLDYgKzU3OTYsMTcgQEAg aW4gY2VydGFpbiBzaXR1YXRpb25zIChyYXBpZCBpbmNvbWluZyBldmVudHMpLgogICAgICAgYmFy ID0gW1tFbWFjc1Njcm9sbGVyIGFsbG9jXSBpbml0RnJhbWU6IHIgd2luZG93OiB3aW5dOwogICAg ICAgd3NldF92ZXJ0aWNhbF9zY3JvbGxfYmFyICh3aW5kb3csIG1ha2VfbWludF9wdHIgKGJhcikp OwogICAgICAgdXBkYXRlX3AgPSBZRVM7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisv KiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIC8qIFRoaXMgaXMgb25seSBmb3IgZGVidWdn aW5nIHB1cnBvc2VzLiAqLworICAgICAgW2JhciBtY19zZXRfcmVjdGFuZ2xlOiByXTsKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogICAgIH0KICAgZWxzZQogICAgIHsKQEAgLTQ4MTAs MTIgKzU4MTQsMzAgQEAgaW4gY2VydGFpbiBzaXR1YXRpb25zIChyYXBpZCBpbmNvbWluZyBldmVu dHMpLgogICAgICAgYmFyID0gWE5TX1NDUk9MTF9CQVIgKHdpbmRvdy0+dmVydGljYWxfc2Nyb2xs X2Jhcik7CiAgICAgICBvbGRSZWN0ID0gW2JhciBmcmFtZV07CiAgICAgICByLnNpemUud2lkdGgg PSBvbGRSZWN0LnNpemUud2lkdGg7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBN VUxUSVBMRS1DVVJTT1JTICovCisKICAgICAgIGlmIChGUkFNRV9MSVZFX1AgKGYpICYmICFOU0Vx dWFsUmVjdHMgKG9sZFJlY3QsIHIpKQogICAgICAgICB7CisgICAgICAgICAgLyogVGhlIG1haW4g d2luZG93IGhhcyBwcm9iYWJseSBiZWVuIHJlc2l6ZWQuICBHcmFjaW91c2x5IGRlbGV0ZSB0aGUK KyAgICAgICAgICBvbGQgc2Nyb2xsIGJhciB3aXRob3V0IHJlcGFpbnRpbmcgaXRzIHJlY3Rhbmds ZTsgYW5kLCBjcmVhdGUgYSBuZXcKKyAgICAgICAgICBzY3JvbGwgYmFyIGVsc2V3aGVyZS4qLwog ICAgICAgICAgIGlmIChvbGRSZWN0Lm9yaWdpbi54ICE9IHIub3JpZ2luLngpCisgICAgICAgICAg ICB7CiAgICAgICAgICAgICAgIG5zX2NsZWFyX2ZyYW1lX2FyZWEgKGYsIGxlZnQsIHRvcCwgd2lk dGgsIGhlaWdodCk7CisgICAgICAgICAgICAgIFtiYXIgbWNfanVkZ2VdOworICAgICAgICAgICAg ICBiYXIgPSBbW0VtYWNzU2Nyb2xsZXIgYWxsb2NdIGluaXRGcmFtZTogciB3aW5kb3c6IHdpbl07 CisgICAgICAgICAgICAgIHdzZXRfdmVydGljYWxfc2Nyb2xsX2JhciAod2luZG93LCBtYWtlX21p bnRfcHRyIChiYXIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKICAgICAgICAg ICBbYmFyIHNldEZyYW1lOiByXTsKICAgICAgICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKworCiAgICAgfQogCiAgIGlmICh1cGRhdGVfcCkKQEAgLTQ5NzUsOSArNTk5Nyw1NyBAQCBp biBjZXJ0YWluIHNpdHVhdGlvbnMgKHJhcGlkIGluY29taW5nIGV2ZW50cykuCiAgICAgewogICAg ICAgdmlldyA9IFtzdWJ2aWV3cyBvYmplY3RBdEluZGV4OiBpXTsKICAgICAgIGlmICghW3ZpZXcg aXNLaW5kT2ZDbGFzczogW0VtYWNzU2Nyb2xsZXIgY2xhc3NdXSkgY29udGludWU7Ci0gICAgICBp ZiAoW3ZpZXcganVkZ2VdKQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQ TEUtQ1VSU09SUyAqLworCisgIC8qIGBYU0VUV0lORE9XJyB3aWxsIHNvbWV0aW1lcyBjYXVzZSBF bWFjcyB0byBjcmFzaCB3aGVuIHJ1bm5pbmcgdW5kZXIgZ2RiIGV2ZW4KKyAgdGhvdWdoICh3ICE9 IE5VTEwpLiAgVGhlcmVmb3JlLCB3ZSBjYW5ub3QgcmVsaWFibHkgdXNlIGBXSU5ET1dfTElWRV9Q Jy4gKi8KKyAgc3RydWN0IHdpbmRvdyAqdyA9IFt2aWV3IG1jX2dldF93aW5kb3ddOworICBpZiAo dyAhPSBOVUxMCisgICAgICAmJiBOSUxQICh3LT5jb250ZW50cykpCisgICAgeworICAgICAgQk9P TCBkZWJ1Z19wID0gZmFsc2U7CisgICAgICBpZiAoZGVidWdfcAorICAgICAgICAgIC8qIGB3aW5k b3dfYm94JyBjYWxscyBgd2luZG93X2JveF9oZWlnaHQnLCB3aGljaCB3aWxsIGNhdXNlIEVtYWNz IHRvCisgICAgICAgICAgY3Jhc2ggaWYgRlJBTUVQICh3LT5mcmFtZSkgaXMgbm90IHNhdGlzZmll ZC4gKi8KKyAgICAgICAgICAmJiBGUkFNRVAgKHctPmZyYW1lKSkKKyAgICAgICAgeworICAgICAg ICAgIE5TUmVjdCByMCA9IFt2aWV3IG1jX2dldF9yZWN0YW5nbGVdOworICAgICAgICAgIGludCB4 MCA9IE5TTWluWCAocjApOworICAgICAgICAgIGludCB5MCA9IE5TTWluWSAocjApOworICAgICAg ICAgIGludCB3ZDAgPSBOU1dpZHRoIChyMCk7CisgICAgICAgICAgaW50IGgwID0gTlNIZWlnaHQg KHIwKTsKKyAgICAgICAgICBpbnQgd2luZG93X3ksIHdpbmRvd19oZWlnaHQ7CisgICAgICAgICAg d2luZG93X2JveCAodywgQU5ZX0FSRUEsIDAsICZ3aW5kb3dfeSwgMCwgJndpbmRvd19oZWlnaHQp OworICAgICAgICAgIGludCB0b3AgPSB3aW5kb3dfeTsKKyAgICAgICAgICBpbnQgaGVpZ2h0ID0g d2luZG93X2hlaWdodDsKKyAgICAgICAgICBpbnQgd2lkdGggPSBXSU5ET1dfQ09ORklHX1NDUk9M TF9CQVJfQ09MUyAodykgKiBGUkFNRV9DT0xVTU5fV0lEVEggKGYpOworICAgICAgICAgIGludCBs ZWZ0ID0gV0lORE9XX1NDUk9MTF9CQVJfQVJFQV9YICh3KTsKKyAgICAgICAgICBOU1JlY3QgcjEg PSBOU01ha2VSZWN0IChsZWZ0LCB0b3AsIHdpZHRoLCBoZWlnaHQpOworICAgICAgICAgIC8qIFRo ZSBwYXJlbnQgdmlldyBpcyBmbGlwcGVkLCBzbyB3ZSBuZWVkIHRvIGZsaXAgeSB2YWx1ZS4gKi8K KyAgICAgICAgICBFbWFjc1ZpZXcgKmZyYW1lX3ZpZXcgPSBGUkFNRV9OU19WSUVXIChmKTsKKyAg ICAgICAgICBOU1JlY3QgdiA9IFtmcmFtZV92aWV3IGZyYW1lXTsKKyAgICAgICAgICByMS5vcmln aW4ueSA9ICh2LnNpemUuaGVpZ2h0IC0gcjEuc2l6ZS5oZWlnaHQgLSByMS5vcmlnaW4ueSk7Cisg ICAgICAgICAgaW50IHgxID0gTlNNaW5YIChyMSk7CisgICAgICAgICAgaW50IHkxID0gTlNNaW5Z IChyMSk7CisgICAgICAgICAgaW50IHdkMSA9IE5TV2lkdGggKHIxKTsKKyAgICAgICAgICBpbnQg aDEgPSBOU0hlaWdodCAocjEpOworICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiVzIC0tIERF QUQ6XG5cCisgICAgICAgICAgeDAveDEgKCVkLyVkKSB8IHkwL3kxICglZC8lZCkgfCB3ZDAvd2Qx ICglZC8lZCkgfCBoMC9oMSAoJWQvJWQpXG4iLAorICAgICAgICAgIG1jX3dpbmRvdyAodyksIHgw LCB4MSwgeTAsIHkxLCB3ZDAsIHdkMSwgaDAsIGgxKTsKKyAgICAgICAgfQorICAgICAgaWYgKFt2 aWV3IG1jX2p1ZGdlXSkKICAgICAgICAgcmVtb3ZlZCA9IFlFUzsKICAgICB9CisgICAgZWxzZSBp ZiAoW3ZpZXcganVkZ2VdKQorICAgICAgcmVtb3ZlZCA9IFlFUzsKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKworICAgIH0KIAogICBpZiAocmVtb3ZlZCkKICAgICBbZXZpZXcgdXBkYXRl RnJhbWVTaXplOiBOT107CkBAIC01MTA2LDYgKzYxNzYsMjEgQEAgc3RhdGljIExpc3BfT2JqZWN0 IG5zX3N0cmluZ190b19saXNwbW9kIChjb25zdCBjaGFyICpzKQogZXh0ZXJuIGZyYW1lX3Bhcm1f aGFuZGxlciBuc19mcmFtZV9wYXJtX2hhbmRsZXJzW107CiBzdGF0aWMgc3RydWN0IHJlZGlzcGxh eV9pbnRlcmZhY2UgbnNfcmVkaXNwbGF5X2ludGVyZmFjZSA9CiB7CisKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRpc3BsYXlfaW50 ZXJmYWNlJyBpbiBgbnN0ZXJtLm1gIG11c3QgYmUgaW4gdGhlIGV4YWN0IHNhbWUgb3JkZXIgYXMg dGhlCitgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYGRpc3BleHRlcm4uaGAhICovCisKKyAgbWNf eF93cml0ZV9nbHlwaHMsCisgIG1jX25zX2RyYXdfd2luZG93X2N1cnNvciwKKyAgbWNfbnNfZHJh d19nbHlwaF9zdHJpbmcsCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgbnNfZnJh bWVfcGFybV9oYW5kbGVycywKICAgeF9wcm9kdWNlX2dseXBocywKICAgeF93cml0ZV9nbHlwaHMs CkBAIC04NzIxLDYgKzk4MDYsNDkgQEAgLSAoQk9PTCljYW5CZWNvbWVNYWluV2luZG93CiAKIEBp bXBsZW1lbnRhdGlvbiBFbWFjc1Njcm9sbGVyCiAKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy0gKHZvaWQpbWNfc2V0X3JlY3RhbmdsZTogKE5T UmVjdClyZWN0Cit7CisgIG1jX3JlY3RhbmdsZSA9IHJlY3Q7Cit9CisKKy0gKE5TUmVjdCltY19n ZXRfcmVjdGFuZ2xlCit7CisgIHJldHVybiBtY19yZWN0YW5nbGU7Cit9CisKKy0gKHN0cnVjdCB3 aW5kb3cgKiltY19nZXRfd2luZG93Cit7CisgIHJldHVybiB3aW5kb3c7Cit9CisKKy0gKGJvb2wp bWNfanVkZ2UKK3sKKyAgTlNUUkFDRSAoIltFbWFjc1Njcm9sbGVyIG1jX2p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QorICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgIC8qIEluIFIyTCByb3dzLCBkcmF3 IHRoZSBjdXJzb3Igb24gdGhlIHJpZ2h0IGVkZ2Ugb2YgdGhlCisgICAgICAgICAgICAgc3RyZXRj aCBnbHlwaC4gICovCisgICAgICAgICAgaW50IHJpZ2h0X3ggPSB3aW5kb3dfYm94X3JpZ2h0IChz LT53LCBURVhUX0FSRUEpOworICAgICAgICAgIGlmICh4ICsgYmFja2dyb3VuZF93aWR0aCA+IHJp Z2h0X3gpCisgICAgICAgICAgICBiYWNrZ3JvdW5kX3dpZHRoIC09IHggLSByaWdodF94OworICAg ICAgICAgIHggKz0gYmFja2dyb3VuZF93aWR0aDsKKyAgICAgICAgfQorICAgICAgd2lkdGggPSBt aW4gKEZSQU1FX0NPTFVNTl9XSURUSCAocy0+ZiksIGJhY2tncm91bmRfd2lkdGgpOworICAgICAg aWYgKHMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAgICAgICAgeCAtPSB3aWR0aDsKKyAgICAgIC8qIERy YXcgY3Vyc29yLiAgKi8KKyAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmdfcmVjdCAocywgeCwg cy0+eSwgd2lkdGgsIHMtPmhlaWdodCk7CisgICAgICAvKiBDbGVhciByZXN0IHVzaW5nIHRoZSBH QyBvZiB0aGUgb3JpZ2luYWwgbm9uLWN1cnNvciBmYWNlLiAgKi8KKyAgICAgIGlmICh3aWR0aCA8 IGJhY2tncm91bmRfd2lkdGgpCisgICAgICAgIHsKKyAgICAgICAgICBYR0NWYWx1ZXMgKmdjID0g cy0+ZmFjZS0+Z2M7CisgICAgICAgICAgaW50IHkgPSBzLT55OworICAgICAgICAgIGludCB3ID0g YmFja2dyb3VuZF93aWR0aCAtIHdpZHRoLCBoID0gcy0+aGVpZ2h0OworICAgICAgICAgIFJFQ1Qg cjsKKyAgICAgICAgICAgICAgICBIREMgaGRjID0gcy0+aGRjOworICAgICAgICAgIGlmICghcy0+ cm93LT5yZXZlcnNlZF9wKQorICAgICAgICAgICAgeCArPSB3aWR0aDsKKyAgICAgICAgICBlbHNl CisgICAgICAgICAgICB4ID0gcy0+eDsKKyAgICAgICAgICBpZiAocy0+cm93LT5tb3VzZV9mYWNl X3AKKyAgICAgICAgICAgICAgJiYgY3Vyc29yX2luX21vdXNlX2ZhY2VfcCAocy0+dykpCisgICAg ICAgICAgICB7CisgICAgICAgICAgICAgIHhfc2V0X21vdXNlX2ZhY2VfZ2MgKHMpOworICAgICAg ICAgICAgICBnYyA9IHMtPmdjOworICAgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgIGdjID0gcy0+ZmFjZS0+Z2M7CisgICAgICAgICAgZ2V0X2dseXBoX3N0cmluZ19jbGlw X3JlY3QgKHMsICZyKTsKKyAgICAgICAgICB3MzJfc2V0X2NsaXBfcmVjdGFuZ2xlIChoZGMsICZy KTsKKyNpZiAwIC8qIFRPRE86IHN0aXBwbGUgKi8KKyAgICAgICAgICBpZiAocy0+ZmFjZS0+c3Rp cHBsZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogRmlsbCBiYWNrZ3JvdW5kIHdp dGggYSBzdGlwcGxlIHBhdHRlcm4uICAqLworICAgICAgICAgICAgICBYU2V0RmlsbFN0eWxlIChz LT5kaXNwbGF5LCBnYywgRmlsbE9wYXF1ZVN0aXBwbGVkKTsKKyAgICAgICAgICAgICAgWEZpbGxS ZWN0YW5nbGUgKHMtPmRpc3BsYXksIHMtPndpbmRvdywgZ2MsIHgsIHksIHcsIGgpOworICAgICAg ICAgICAgICBYU2V0RmlsbFN0eWxlIChzLT5kaXNwbGF5LCBnYywgRmlsbFNvbGlkKTsKKyAgICAg ICAgICAgIH0KKyAgICAgICAgICBlbHNlCisjZW5kaWYKKyAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBnYy0+YmFja2dyb3VuZ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ZWRfcCA9IHMtPmZhY2UtPnN0aXBwbGUg IT0gMDsKKyAgICB9CisgIGVsc2UgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SKQorICAgIHsKKyAg ICAgIG1jX3czMl9zZXRfY3Vyc29yX2djIChzLCBjdXJzb3JfZ2NfcCk7CisgICAgICBzLT5zdGlw cGxlZF9wID0gZmFsc2U7CisgICAgfQorICBlbHNlIGlmIChzLT5obCA9PSBEUkFXX01PVVNFX0ZB Q0UpCisgICAgeworICAgICAgeF9zZXRfbW91c2VfZmFjZV9nYyAocyk7CisgICAgICBzLT5zdGlw cGxlZF9wID0gcy0+ZmFjZS0+c3RpcHBsZSAhPSAwOworICAgIH0KKyAgZWxzZSBpZiAocy0+aGwg PT0gRFJBV19JTUFHRV9SQUlTRUQKKyAgICAgICAgICAgfHwgcy0+aGwgPT0gRFJBV19JTUFHRV9T VU5LRU4pCisgICAgeworICAgICAgcy0+Z2MgPSBzLT5mYWNlLT5nYzsKKyAgICAgIHMtPnN0aXBw bGVkX3AgPSBzLT5mYWNlLT5zdGlwcGxlICE9IDA7CisgICAgfQorICBlbHNlCisgICAgZW1hY3Nf YWJvcnQgKCk7CisgIC8qIEdDIG11c3QgaGF2ZSBiZWVuIHNldC4gICovCisgIGVhc3NlcnQgKHMt PmdjICE9IDApOworfQorCisvKiBEcmF3IGEgaG9sbG93IGJveCBjdXJzb3Igb24gd2luZG93IFcg aW4gZ2x5cGggcm93IFJPVy4gICovCitzdGF0aWMgdm9pZAorbWNfdzMyX2RyYXdfaG9sbG93X2N1 cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93LCBpbnQgeCwgaW50 IGZ4LCBpbnQgeSwgaW50IGZ5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGhwb3Ms IGludCB2cG9zLCBpbnQgd2QsIGludCB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1dfVEVYVF9UT19GUkFNRV9QSVhF TF9YICh3LCB4KTsKKyAgICAgICAgICAvKiBGSVhNRTogIFdoYXQgc2hvdWxkIHdlIHVzZSBpbnN0 ZWFkIG9mIGB3LT5waHlzX2N1cnNvcl9hc2NlbnQnPyAqLworICAgICAgICAgIHczMl9zeXN0ZW1f Y2FyZXRfeQorICAgICAgICAgICAgPSAoV0lORE9XX1RPX0ZSQU1FX1BJWEVMX1kgKHcsIHkpCisg ICAgICAgICAgICAgICArIHJvdy0+YXNjZW50IC0gdy0+cGh5c19jdXJzb3JfYXNjZW50KTsKKyAg ICAgICAgICB3MzJfc3lzdGVtX2NhcmV0X3dpbmRvdyA9IHc7CisgICAgICAgICAgdzMyX3N5c3Rl bV9jYXJldF9oZHJfaGVpZ2h0ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgICAg ICAgICAgdzMyX3N5c3RlbV9jYXJldF9tb2RlX2hlaWdodCA9IFdJTkRPV19NT0RFX0xJTkVfSEVJ R0hUICh3KTsKKyAgICAgICAgICBQb3N0TWVzc2FnZSAoaHduZCwgV01fSU1FX1NUQVJUQ09NUE9T SVRJT04sIDAsIDApOworICAgICAgICAgIC8qIElmIHRoZSBzaXplIG9mIHRoZSBhY3RpdmUgY3Vy c29yIGNoYW5nZWQsIGRlc3Ryb3kgdGhlIG9sZAorICAgICAgICAgICAgIHN5c3RlbSBjYXJldC4g ICovCisgICAgICAgICAgaWYgKHczMl9zeXN0ZW1fY2FyZXRfaHduZAorICAgICAgICAgICAgICAm JiAodzMyX3N5c3RlbV9jYXJldF9oZWlnaHQgIT0gaCkpCisgICAgICAgICAgICBQb3N0TWVzc2Fn ZSAoaHduZCwgV01fRU1BQ1NfREVTVFJPWV9DQVJFVCwgMCwgMCk7CisgICAgICAgICAgdzMyX3N5 c3RlbV9jYXJldF9oZWlnaHQgPSBoOworICAgICAgICAgIC8qIE1vdmUgdGhlIHN5c3RlbSBjYXJl dC4gICovCisgICAgICAgICA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HN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZSA9IEZB Q0VfRlJPTV9JRCAoZiwgaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2VfaWQpOworICAgICAg ICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFt ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiks IHRydWUpOworICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2Ug PSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAg ICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7 CisgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX3Jl Z2lvbl9lbmRfZmFjZS0+YmFja2dyb3VuZDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgYWN0 aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID4g cmVnaW9uX2JlZworICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJw b3MgPCByZWdpb25fZW5kKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGVu dW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2VfaWQgPSBsb29rdXBf bmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWlu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AgICAgICAvKiBGb3JjZSBg bWNfdzMyX3NldF9jdXJzb3JfZ2MnIHRvIHVzZSBgcy0+Zi0+b3V0cHV0X2RhdGEudzMyLT5jdXJz b3JfZ2MnLiAgKi8KKyAgICAgICAgICBib29sIGN1cnNvcl9nY19wID0gdHJ1ZTsKKyAgICAgICAg ICBtY19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4LCBo cG9zLCB2cG9zLCBsc2wsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoX2Zs YXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOworICAgICAgICAg IGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djID0gb3JpZ2luYWxfY3Vyc29yX2djOworICAg ICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNr IGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcuICAqLworICAgICAgICAgIGYtPm91 dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gY29sb3JfcGl4ZWw7CisgICAgICAgICAgbWNf dzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBv cywgdnBvcywgd2QsIGgpOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3Bp eGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYg KGN1cnNvcl9nbHlwaC0+dHlwZSA9PSBJTUFHRV9HTFlQSCAmJiBsc2wucmVkID49IDAgJiYgbHNs LmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAgICB7CisgICAgICAgICAgICAv KiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4g ICovCisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9y X3BpeGVsOworICAgICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4 LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgICAgZi0+ b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7Cisg ICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg LyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycgYnkg Ym9ycm93aW5nIHRoZQorICAgICAgICAgICAgICBmdW5jdGlvbmFsaXR5IG9mIGB4X21ha2VfZ2Mn IGluIHczMmZucy5jLiAgKi8KKyAgICAgICAgICAgICAgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAg ICAgICAgICAgICAgICAgJiYgYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9n bHlwaC0+Y2hhcnBvcyA9PSByZWdpb25fYmVnKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZWdfZmFjZV9pZCA9 IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItYXQt cmVnaW9uLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgc3RydWN0IGZh Y2UgKmhvbGxvd19hY3RpdmVfcmVnaW9uX2JlZ19mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xs b3dfYWN0aXZlX3J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hY3RpdmVfcmVn aW9uX2VuZF9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxv d19hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJl YWwtZmFrZS1jdXJzb3ItcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAg IHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxv d19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5mb3JlZ3Jv dW5kID0gaG9sbG93X2FjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICAgICAg ICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IGhvbGxvd19hY3RpdmVfcmVnaW9uX2VuZF9mYWNlLT5i YWNrZ3JvdW5kOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgZWxzZSBp ZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVf cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID4g cmVnaW9uX2JlZworICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5j aGFycG9zIDwgcmVnaW9uX2VuZCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2Vf aWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29y LWluLXJlZ2lvbi1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICBz dHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNlID0gRkFDRV9GUk9N X0lEIChmLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2VfaWQpOworICAgICAgICAg ICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBf bmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNl IiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0 aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAg ICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2Zh Y2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91 bmQgPSBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2UtPmZvcmVncm91bmQ7CisgICAg ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoYWN0aXZlX3Ap CisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBm YWNlX2lkIGhvbGxvd19hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBp bnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAg ICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9G Uk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICAg ICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7 CisgICAgICAgICAgICAgICAgICAgICAgICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IGhvbGxvd19h Y3RpdmVfZmFjZS0+YmFja2dyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgICAgICAgICAgZWxzZSBpZiAoIWFjdGl2ZV9wKQorICAgICAgICAgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0 aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZh a2UtY3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAg ICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2luYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01f SUQgKGYsIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfaW5hY3RpdmVfZmFjZS0+Zm9yZWdyb3Vu ZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xs b3dfaW5hY3RpdmVfZmFjZS0+YmFja2dyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MgPSBYQ3JlYXRlR0Mg KE5VTEwsIEZSQU1FX1czMl9XSU5ET1cgKGYpLCBtYXNrLCAmZ2NfdmFsdWVzKTsKKyAgICAgICAg ICAgICAgYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgICAgIC8qIEZvcmNlIGBtY193MzJfc2V0 X2N1cnNvcl9nYycgdG8gdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycuICAq LworICAgICAgICAgICAgICBib29sIGN1cnNvcl9nY19wID0gdHJ1ZTsKKyAgICAgICAgICAgICAg bWNfZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBv cywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxzbCwgZ2x5cGhf Zmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9wLCBjdXJzb3JfZ2NfcCk7CisgICAgICAg ICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djID0gb3JpZ2luYWxfY3Vyc29yX2dj OworICAgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgICAgICAgICBtY193MzJf ZHJhd19ob2xsb3dfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2 cG9zLCB3ZCwgaCk7CisgICAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2Fz ZSBNQ19IT0xMT1dfQk9YOgorICAgIHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdy ZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBv cmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAg ICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOwor ICAgICAgICAgIG1jX3czMl9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCw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ZSQU1FX1czMl9XSU5ET1cgKGYpLCBtYXNrLCAmZ2NfdmFsdWVz KTsKKyAgICAgICAgICAvKiBGb3JjZSBgbWNfdzMyX3NldF9jdXJzb3JfZ2MnIHRvIHVzZSBgcy0+ Zi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MnLiAgKi8KKyAgICAgICAgICBib29sIGN1cnNv cl9nY19wID0gdHJ1ZTsKKyAgICAgICAgICBtY19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4 LCByb3csIERSQVdfQ1VSU09SLCB4LCBocG9zLCB2cG9zLCBsc2wsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwg Y3Vyc29yX2djX3ApOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djID0g b3JpZ2luYWxfY3Vyc29yX2djOworICAgICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAg IH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgY3Vyc29yX2dj X3AgPSBmYWxzZTsKKyAgICAgICAgICAgIG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgs IHJvdywgRFJBV19DVVJTT1IsIHgsIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgbHNsLCBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3As CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX2djX3ApOworICAgICAg ICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0JBUjoKKyAgICB7CisgICAg ICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisg ICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRh LnczMi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5j dXJzb3JfcGl4ZWwgPSBjb2xvcl9waXhlbDsKKyAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZp c2libGVfb2theV9wID0gdHJ1ZTsKKyAgICAgICAgICBtY193MzJfZHJhd19iYXJfY3Vyc29yICh3 LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0JBUiwgY3Vyc29yX2dj X2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29y X3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UK KyAgICAgICAgICB7CisgICAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9w ID0gZmFsc2U7CisgICAgICAgICAgICBtY193MzJfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgs IHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGgsIGN1cnNvcl93aWR0aCwgTUNfQkFSLCBjdXJzb3JfZ2NfaW52aXNp YmxlX29rYXlfcCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2Ug TUNfSEJBUjoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAw ICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBo aWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgICAg Zi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBjb2xvcl9waXhlbDsKKyAgICAgICAg ICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gdHJ1ZTsKKyAgICAgICAgICBtY193 MzJfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2 cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lk dGgsIE1DX0hCQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICBmLT5v dXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAg ICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJz b3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNfdzMyX2RyYXdf YmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2Qs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1D X0hCQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICB9CisgICAgICBi cmVhazsKKyAgICB9CisgICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOworICB9Cisg ICAgfQorfQorCisvKiBEcmF3IGdseXBoIHN0cmluZyBTLiAgKi8KK3N0YXRpYyB2b2lkCittY193 MzJfZHJhd19nbHlwaF9zdHJpbmcgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMsIHN0cnVjdCBnbHlw aF9tYXRyaXggKm1hd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MtPmZhY2UtPnVuZGVybGluZV9wKQorICAgICAgICB7Cisg ICAgICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfV0FWRSkK KyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgQ09MT1JSRUYgY29sb3I7CisgICAgICAgICAg ICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICAgICAg Y29sb3IgPSBzLT5nYy0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAg ICAgICAgIGNvbG9yID0gcy0+ZmFjZS0+dW5kZXJsaW5lX2NvbG9yOworICAgICAgICAgICAgICB3 MzJfZHJhd191bmRlcndhdmUgKHMsIGNvbG9yKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBl bHNlIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAg ICAgICAgICB7CisgICAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgdGhpY2tuZXNzLCBwb3NpdGlv bjsKKyAgICAgICAgICAgICAgaW50IHk7CisgICAgICAgICAgICAgIGlmIChzLT5wcmV2ICYmIHMt PnByZXYtPmZhY2UtPnVuZGVybGluZV9wCisgICAgICAgICAgICAgICAgICAmJiBzLT5wcmV2LT5m YWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgLyogV2UgdXNlIHRoZSBzYW1lIHVuZGVybGluZSBzdHlsZSBh cyB0aGUgcHJldmlvdXMgb25lLiAgKi8KKyAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMt PnByZXYtPnVuZGVybGluZV90aGlja25lc3M7CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9 IHMtPnByZXYtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBHZXQg dGhlIHVuZGVybGluZSB0aGlja25lc3MuICBEZWZhdWx0IGlzIDEgcGl4ZWwuICAqLworICAgICAg ICAgICAgICAgICAgaWYgKHMtPmZvbnQgJiYgcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzcyA+ IDApCisgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPmZvbnQtPnVuZGVybGluZV90 aGlja25lc3M7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHRo aWNrbmVzcyA9IDE7CisgICAgICAgICAgICAgICAgICBpZiAoeF91bmRlcmxpbmVfYXRfZGVzY2Vu dF9saW5lKQorICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5oZWlnaHQgLSB0aGlj a25lc3MpIC0gKHMtPnliYXNlIC0gcy0+eSk7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAg ICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVy bGluZSBwb3NpdGlvbi4gIFRoaXMgaXMgdGhlIHJlY29tbWVuZGVkCisgICAgICAgICAgICAgICAg ICAgICAgICAgdmVydGljYWwgb2Zmc2V0IGluIHBpeGVscyBmcm9tIHRoZSBiYXNlbGluZSB0byB0 aGUgdG9wIG9mCisgICAgICAgICAgICAgICAgICAgICAgICAgdGhlIHVuZGVybGluZS4gIFRoaXMg aXMgYSBzaWduZWQgdmFsdWUgYWNjb3JkaW5nIHRvIHRoZQorICAgICAgICAgICAgICAgICAgICAg ICAgIHNwZWNzLCBhbmQgaXRzIGRlZmF1bHQgaXMKKyAgICAgICAgICAgICAgICAgICAgICAgICBS T1VORCAoKG1heGltdW1fZGVzY2VudCkgLyAyKSwgd2l0aAorICAgICAgICAgICAgICAgICAgICAg ICAgIFJPVU5EICh4KSA9IGZsb29yICh4ICsgMC41KSAgKi8KKyAgICAgICAgICAgICAgICAgICAg ICBpZiAoeF91c2VfdW5kZXJsaW5lX3Bvc2l0aW9uX3Byb3BlcnRpZXMKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgcy0+Zm9udCAmJiBzLT5mb250LT51bmRlcmxpbmVfcG9zaXRpb24gPj0g MCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gcy0+Zm9udC0+dW5kZXJsaW5l X3Bvc2l0aW9uOworICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHMtPmZvbnQpCisgICAg ICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5mb250LT5kZXNjZW50ICsgMSkgLyAy OworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IG1h eCAocG9zaXRpb24sIHVuZGVybGluZV9taW5pbXVtX29mZnNldCk7CisgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgICAvKiBDaGVjayB0aGUgc2FuaXR5IG9mIHRoaWNrbmVzcyBhbmQgcG9z aXRpb24uICBXZSBzaG91bGQKKyAgICAgICAgICAgICAgICAgYXZvaWQgZHJhd2luZyB1bmRlcmxp bmUgb3V0IG9mIHRoZSBjdXJyZW50IGxpbmUgYXJlYS4gICovCisgICAgICAgICAgICAgIGlmIChz LT55ICsgcy0+aGVpZ2h0IDw9IHMtPnliYXNlICsgcG9zaXRpb24pCisgICAgICAgICAgICAgICAg cG9zaXRpb24gPSAocy0+aGVpZ2h0IC0gMSkgLSAocy0+eWJhc2UgLSBzLT55KTsKKyAgICAgICAg ICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQgPCBzLT55YmFzZSArIHBvc2l0aW9uICsgdGhpY2tu ZXNzKQorICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IChzLT55ICsgcy0+aGVpZ2h0KSAtIChz LT55YmFzZSArIHBvc2l0aW9uKTsKKyAgICAgICAgICAgICAgcy0+dW5kZXJsaW5lX3RoaWNrbmVz cyA9IHRoaWNrbmVzczsKKyAgICAgICAgICAgICAgcy0+dW5kZXJsaW5lX3Bvc2l0aW9uID1wb3Np dGlvbjsKKyAgICAgICAgICAgICAgeSA9IHMtPnliYXNlICsgcG9zaXRpb247CisgICAgICAgICAg ICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICAgICAg dzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5nYy0+Zm9yZWdyb3VuZCwgcy0+eCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5LCBzLT53aWR0aCwgMSk7CisgICAgICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMt PmZhY2UtPnVuZGVybGluZV9jb2xvciwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICB5LCBzLT53aWR0aCwgMSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIC8q IERyYXcgb3ZlcmxpbmUuICAqLworICAgICAgaWYgKHMtPmZhY2UtPm92ZXJsaW5lX3ApCisgICAg ICAgIHsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIGR5ID0gMCwgaCA9IDE7CisgICAgICAgICAg aWYgKHMtPmZhY2UtPm92ZXJsaW5lX2NvbG9yX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgdzMy X2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5nYy0+Zm9yZWdyb3VuZCwgcy0+eCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgIHMtPnkgKyBkeSwgcy0+d2lkdGgsIGgpOworICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmZh Y2UtPm92ZXJsaW5lX2NvbG9yLCBzLT54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBz LT55ICsgZHksIHMtPndpZHRoLCBoKTsKKyAgICAgICAgfQorICAgICAgLyogRHJhdyBzdHJpa2Ut dGhyb3VnaC4gICovCisgICAgICBpZiAocy0+ZmFjZS0+c3RyaWtlX3Rocm91Z2hfcAorICAgICAg ICAgICYmICFGT05UX1RFWFRNRVRSSUMgKHMtPmZvbnQpLnRtU3RydWNrT3V0KQorICAgICAgICB7 CisgICAgICAgICAgdW5zaWduZWQgbG9uZyBoID0gMTsKKyAgICAgICAgICB1bnNpZ25lZCBsb25n IGR5ID0gKHMtPmhlaWdodCAtIGgpIC8gMjsKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+c3RyaWtl X3Rocm91Z2hfY29sb3JfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChz LT5mLCBzLT5oZGMsIHMtPmdjLT5mb3JlZ3JvdW5kLCBzLT54LCBzLT55ICsgZHksCisgICAgICAg ICAgICAgICAgICAgICAgICAgICBzLT53aWR0aCwgaCk7CisgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5mYWNlLT5zdHJpa2VfdGhyb3Vn aF9jb2xvciwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPnkgKyBkeSwgcy0+ d2lkdGgsIGgpOworICAgICAgICB9CisgICAgICAvKiBEcmF3IHJlbGllZiBpZiBub3QgeWV0IGRy YXduLiAgKi8KKyAgICAgIGlmICghcmVsaWVmX2RyYXduX3AgJiYgcy0+ZmFjZS0+Ym94ICE9IEZB Q0VfTk9fQk9YKQorICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JveCAocyk7CisgICAgICBp ZiAocy0+cHJldikKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBnbHlwaF9zdHJpbmcgKnBy ZXY7CisgICAgICAgICAgZm9yIChwcmV2ID0gcy0+cHJldjsgcHJldjsgcHJldiA9IHByZXYtPnBy ZXYpCisgICAgICAgICAgICBpZiAocHJldi0+aGwgIT0gcy0+aGwKKyAgICAgICAgICAgICAgICAm JiBwcmV2LT54ICsgcHJldi0+d2lkdGggKyBwcmV2LT5yaWdodF9vdmVyaGFuZyA+IHMtPngpCisg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBBcyBwcmV2IHdhcyBkcmF3biB3aGls ZSBjbGlwcGVkIHRvIGl0cyBvd24gYXJlYSwgd2UKKyAgICAgICAgICAgICAgICAgICBtdXN0IGRy YXcgdGhlIHJpZ2h0X292ZXJoYW5nIHBhcnQgdXNpbmcgcy0+aGwgbm93LiAgKi8KKyAgICAgICAg ICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2Ugc2F2ZSA9IHByZXYtPmhsOworICAgICAgICAg ICAgICAgIHByZXYtPmhsID0gcy0+aGw7CisgICAgICAgICAgICAgICAgbWNfdzMyX3NldF9nbHlw aF9zdHJpbmdfZ2MgKHByZXYsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICAgICAgICB4X3NldF9n bHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywgcHJldik7CisgICAgICAgICAgICAgICAg aWYgKHByZXYtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgpCisgICAgICAgICAgICAg ICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHByZXYpOworICAgICAgICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIHhfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5n X2ZvcmVncm91bmQgKHByZXYpOworICAgICAgICAgICAgICAgIHczMl9zZXRfY2xpcF9yZWN0YW5n bGUgKHByZXYtPmhkYywgTlVMTCk7CisgICAgICAgICAgICAgICAgcHJldi0+aGwgPSBzYXZlOwor ICAgICAgICAgICAgICAgIHByZXYtPm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgICAgIH0KKyAg ICAgICAgfQorICAgICAgaWYgKHMtPm5leHQpCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3Qg Z2x5cGhfc3RyaW5nICpuZXh0OworICAgICAgICAgIGZvciAobmV4dCA9IHMtPm5leHQ7IG5leHQ7 IG5leHQgPSBuZXh0LT5uZXh0KQorICAgICAgICAgICAgaWYgKG5leHQtPmhsICE9IHMtPmhsCisg ICAgICAgICAgICAgICAgJiYgbmV4dC0+eCAtIG5leHQtPmxlZnRfb3ZlcmhhbmcgPCBzLT54ICsg cy0+d2lkdGgpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBBcyBuZXh0IHdp bGwgYmUgZHJhd24gd2hpbGUgY2xpcHBlZCB0byBpdHMgb3duIGFyZWEsCisgICAgICAgICAgICAg ICAgICAgd2UgbXVzdCBkcmF3IHRoZSBsZWZ0X292ZXJoYW5nIHBhcnQgdXNpbmcgcy0+aGwgbm93 LiAgKi8KKyAgICAgICAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2Ugc2F2ZSA9IG5leHQt PmhsOworICAgICAgICAgICAgICAgIG5leHQtPmhsID0gcy0+aGw7CisgICAgICAgICAgICAgICAg bWNfdzMyX3NldF9nbHlwaF9zdHJpbmdfZ2MgKG5leHQsIGN1cnNvcl9nY19wKTsKKyAgICAgICAg ICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywgbmV4dCk7Cisg ICAgICAgICAgICAgICAgaWYgKG5leHQtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgp CisgICAgICAgICAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5leHQp OworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIHhfZHJhd19jb21wb3Np dGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5leHQpOworICAgICAgICAgICAgICAgIHczMl9z ZXRfY2xpcF9yZWN0YW5nbGUgKG5leHQtPmhkYywgTlVMTCk7CisgICAgICAgICAgICAgICAgbmV4 dC0+aGwgPSBzYXZlOworICAgICAgICAgICAgICAgIG5leHQtPm51bV9jbGlwcyA9IDA7CisgICAg ICAgICAgICAgICAgbmV4dC0+Y2xpcF9oZWFkID0gcy0+bmV4dDsKKyAgICAgICAgICAgICAgfQor ICAgICAgICB9CisgICAgfQorICAvKiBSZXNldCBjbGlwcGluZy4gICovCisgIHczMl9zZXRfY2xp cF9yZWN0YW5nbGUgKHMtPmhkYywgTlVMTCk7CisgIHMtPm51bV9jbGlwcyA9IDA7Cit9CisKKy8q IGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAv KiBGcmluZ2UgYml0bWFwcy4gICovCiAKIHN0YXRpYyBpbnQgbWF4X2ZyaW5nZV9ibXAgPSAwOwpA QCAtNTQ1LDYgKzE0MTcsMTUgQEAgeF91cGRhdGVfYmVnaW4gKHN0cnVjdCBmcmFtZSAqZikKICAg aWYgKCEgRlJBTUVfVzMyX1AgKGYpKQogICAgIHJldHVybjsKIAorCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGluZ19mcmFt ZSA9IGY7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogUmVnZW5lcmF0ZSBk aXNwbGF5IHBhbGV0dGUgYmVmb3JlIGRyYXdpbmcgaWYgbGlzdCBvZiByZXF1ZXN0ZWQKICAgICAg Y29sb3JzIGhhcyBjaGFuZ2VkLiAqLwogICBpZiAoZGlzcGxheV9pbmZvLT5yZWdlbl9wYWxldHRl KQpAQCAtNzU0LDYgKzE2MzUsMTYgQEAgeF91cGRhdGVfZW5kIChzdHJ1Y3QgZnJhbWUgKmYpCiAK ICAgLyogTW91c2UgaGlnaGxpZ2h0IG1heSBiZSBkaXNwbGF5ZWQgYWdhaW4uICAqLwogICBNT1VT RV9ITF9JTkZPIChmKS0+bW91c2VfZmFjZV9kZWZlciA9IGZhbHNlOworCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5n X2ZyYW1lID0gTlVMTDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAKQEAg LTQwNDEsMTMgKzQ5MzIsNzQgQEAgdzMyX3NldF92ZXJ0aWNhbF9zY3JvbGxfYmFyIChzdHJ1Y3Qg d2luZG93ICp3LAogCSAgICAgIHJlbGVhc2VfZnJhbWVfZGMgKGYsIGhkYyk7CiAJICAgICAgeF9j bGVhcl91bmRlcl9pbnRlcm5hbF9ib3JkZXIgKGYpOwogCSAgICB9CisKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIFJFUEFJTlRJ TkcgV0hFTiBSRU1PVklORyBTQ1JPTEwgQkFSOgorCistIFNlcXVlbmNlIG9mIEV2ZW50czoKKwor ICAuIGByZWRpc3BsYXlfaW50ZXJuYWwnIGNhbGxzIHRoZSBgY29uZ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VBMRS1DVVJT T1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwogCiAJICBzaS5jYlNpemUgPSBzaXpl b2YgKHNpKTsKIAkgIHNpLmZNYXNrID0gU0lGX1JBTkdFOwpAQCAtNDMxNiw2ICs1MjY4LDIxIEBA IHczMl9qdWRnZV9zY3JvbGxfYmFycyAoc3RydWN0IGZyYW1lICpmKQogICAgIHsKICAgICAgIHN0 cnVjdCBzY3JvbGxfYmFyICpiID0gWFNDUk9MTF9CQVIgKGJhcik7CiAKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIC8qIGBEZXN0cm95 V2luZG93JyB3aXRoaW4gYHhfc2Nyb2xsX2Jhcl9yZW1vdmUnIHJlcGFpbnRzIHRoZSByZWN0YW5n bGUuCisgICAgICBUaGVyZWZvcmUsIHdlIGZpcnN0IHNlbmQgYSBtZXNzYWdlIHRvIGluaGliaXQg cmVwYWludGluZy4gKi8KKyAgICAgIGlmICghV0lORE9XX0xJVkVfUCAoYi0+d2luZG93KSkKKyAg ICAgICAgeworICAgICAgICAgIEhXTkQgaHduZCA9IFNDUk9MTF9CQVJfVzMyX1dJTkRPVyAoYik7 CisgICAgICAgICAgU2VuZE1lc3NhZ2UgKGh3bmQsIFdNX1NFVFJFRFJBVywgZmFsc2UsIDApOwor ICAgICAgICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIHhfc2Nyb2xs X2Jhcl9yZW1vdmUgKGIpOwogCiAgICAgICBuZXh0ID0gYi0+bmV4dDsKQEAgLTcwOTEsNiArODA1 OCwyMSBAQCBleHRlcm4gZnJhbWVfcGFybV9oYW5kbGVyIHczMl9mcmFtZV9wYXJtX2hhbmRsZXJz W107CiAKIHN0YXRpYyBzdHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFjZSB3MzJfcmVkaXNwbGF5X2lu dGVyZmFjZSA9CiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1D VVJTT1JTICovCisKKy8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgdzMydGVybS5jYCBtdXN0 IGJlIGluIHRoZSBleGFjdCBzYW1lIG9yZGVyIGFzIHRoZQorYHJlZGlzcGxheV9pbnRlcmZhY2Un IGluIGBkaXNwZXh0ZXJuLmhgISAqLworCisgIG1jX3hfd3JpdGVfZ2x5cGhzLAorICBtY193MzJf ZHJhd193aW5kb3dfY3Vyc29yLAorICBtY193MzJfZHJhd19nbHlwaF9zdHJpbmcsCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICAgdzMyX2ZyYW1lX3Bhcm1faGFuZGxlcnMsCiAgIHhf cHJvZHVjZV9nbHlwaHMsCiAgIHhfd3JpdGVfZ2x5cGhzLApkaWZmIC0tZ2l0IGEvc3JjL3dpbmRv dy5oIGIvc3JjL3dpbmRvdy5oCmluZGV4IGZkZWY0MDcuLjM1NjI2M2EgMTAwNjQ0Ci0tLSBhL3Ny Yy93aW5kb3cuaAorKysgYi9zcmMvd2luZG93LmgKQEAgLTMyNCw2ICszMjQsMTI4IEBAIHN0cnVj dCB3aW5kb3cKIAogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQogCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworL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gIHN0cnVjdCBn bHlwaCBnbHlwaDsKKyAgICAgIGludCB4OworICAgICAgaW50IGZ4OworICAgICAgaW50IHk7Cisg ICAgICBpbnQgZnk7CisgICAgICBpbnQgaHBvczsKKyAgICAgIGludCB2cG9zOworICAgICAgaW50 IHdkOworICAgICAgaW50IGg7CisgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlCisgICAgICB7Cisg ICAgICAgIC8qIE5PVEU6ICBUaGUgZnJpbmdlIGJpdG1hcCBmcmFtZXdvcmsgcmVsaWVzIHVwb24g TUNfTk9fRlJJTkdFX0JJVE1BUAorICAgICAgICBoYXZpbmcgYSB2YWx1ZSBvZiB6ZXJvICgwKS4g Ki8KKyAgICAgICAgTUNfTk9fRlJJTkdFX0JJVE1BUCwKKyAgICAgICAgTUNfTk9fQ1VSU09SLAor ICAgICAgICBNQ19SSUdIVF9GUklOR0VfQklUTUFQLAorICAgICAgICBNQ19MRUZUX0ZSSU5HRV9C SVRNQVAsCisgICAgICAgIE1DX0ZSQU1FRF9CT1gsCisgICAgICAgIE1DX0ZJTExFRF9CT1gsCisg ICAgICAgIE1DX0hPTExPV19CT1gsCisgICAgICAgIE1DX0JBUiwKKyAgICAgICAgTUNfSEJBUgor ICAgICAgfSBjdXJzb3JfdHlwZTsKKyAgICAgIGludCBjdXJzb3Jfd2lkdGg7CisgICAgICBzdHJ1 Y3QgbWNfUkdCCisgICAgICB7CisgICAgICAgIGRvdWJsZSByZWQ7CisgICAgICAgIGRvdWJsZSBn cmVlbjsKKyAgICAgICAgZG91YmxlIGJsdWU7CisgICAgICB9IGZnLCBiZzsKKyAgICAgIGJvb2xf YmYgYWN0aXZlX3AgOiAxOworICAgICAgZW51bSBtY19mbGF2b3IKKyAgICAgIHsKKyAgICAgICAg Tk9fRkxBVk9SLAorICAgICAgICBNQ19HTFlQSCwKKyAgICAgICAgTUNfR0xZUEhMRVNTLAorICAg ICAgICBNQ19PVkVSTEFZX0FSUk9XX0JJVE1BUCwKKyAgICAgICAg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AgICBDVVJTT1JfSU5ESUNBVE9SCisgIH0gYWN0aW9uX3R5cGU7Cit9IG1jX21h dHJpeDsKKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKICAgICAvKiBDdXJzb3IgdHlwZSBvZiBsYXN0IGN1cnNvciBkcmF3biBvbiB0aGUg d2luZG93LiAgKi8KICAgICBlbnVtIHRleHRfY3Vyc29yX2tpbmRzIHBoeXNfY3Vyc29yX3R5cGU7 CiAKZGlmZiAtLWdpdCBhL3NyYy94ZGlzcC5jIGIvc3JjL3hkaXNwLmMKaW5kZXggYTg4ZmM2OS4u NTI0MmFjZiAxMDA2NDQKLS0tIGEvc3JjL3hkaXNwLmMKKysrIGIvc3JjL3hkaXNwLmMKQEAgLTky MSw2ICs5MjEsNDY3MiBAQCBzdGF0aWMgdm9pZCBzaG93X21vdXNlX2ZhY2UgKE1vdXNlX0hMSW5m byAqLCBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UpOwogc3RhdGljIGJvb2wgY29vcmRzX2luX21vdXNl X2ZhY2VfcCAoc3RydWN0IHdpbmRvdyAqLCBpbnQsIGludCk7CiAKIAorLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIE1VTFRJUExFLUNV UlNPUlM6ICBFbWFjcyBCdWcgIzIyODczIChmZWF0dXJlIHJlcXVlc3QpCisKKyAgQ1JPU1NIQUlS UzogIEVtYWNzIEJ1ZyAjMTc2ODQgKGZlYXR1cmUgcmVxdWVzdCkKKworCitWRVJTSU9OOgorCist IDAyMS4wMDEgWzA2LzA4LzIwMTldCistIDAyMS4wMDAgWzA2LzAxLzIwMTldCistIDAyMC4wMD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TQUdFOgorCistIEZvciBhIG1pbmltYWwgd29ya2luZyBleGFtcGxl IG9mIGJ1aWx0LWluIGZha2UgY3Vyc29ycywgdHlwZTogIE0teCBtYy10ZXN0CisKKyAgOzs7IFRV Uk4gT04gRkFLRSBDVVJTT1JTIChidWZmZXIgcG9zaXRpb24sIGN1cnNvci10eXBlLCBjdXJzb3Ig Y29sb3IpOgorCisgIChzZXRxIG1jLWNvbmYgJygoMSAiaGJhciIgIm1hZ2VudGEiKQorICAgICAg ICAgICAgICAgICAgKDIgImJhciIgInB1cnBsZSIpCisgICAgICAgICAgICAgICAgICAoMyAiYm94 IiAiIzAwRkYwMCIpCisgICAgICAgICAgICAgICAgICAoNCAiaG9sbG93IiAiIzAwMDBGRiIpCisg ICAgICAgICAgICAgICAgICAoNSAoImhiYXIiIDMpIFsxLjAgMC4wIDEuMF0pCisgICAgICAgICAg ICAgICAgICAoNiAoImJhciIgMykgWzAuMCAxLjAgMS4wXSkKKyAgICAgICAgICAgICAgICAgICg3 ICJmcmFtZWQiICJPcmFuZ2VSZWQiKSkpKQorCisgIDs7OyBUVVJOIE9GRiBGQUtFIENVUlNPUlM6 CisKKyAgKHNldHEgbWMtY29uZiBuaWwpCisKKy0gVG8gdHJ5IG91dCBib3RoIHRoZSBjcm9zc2hh aXJzIGZlYXR1cmUgYW5kIHRoZSB2aXNpYmxlIGZpbGwgY29sdW1uIGluZGljYXRvcgorICBmZWF0 dXJlLCB0eXBlOiAgTS14ICstbW9kZQorCistIFRvIHRyeSBvdXQganVzdCB0aGUgdmlzaWJsZSBm aWxsIGNvbHVtbiBpbmRpY2F0b3IgZmVhdHVyZSwgdHlwZTogIE0teCBmYy1tb2RlCisKKy0gVG8g dHJ5IG91dCBidWlsdC1pbiBmYWtlIGN1cnNvcnMgd2l0aCBNYWduYXIgU3ZlZW4ncyBtdWx0aXBs ZS1jdXJzb3JzIHBhY2thZ2UsCisgIGluc3RhbGwgdGhhdCBwYWNrYWdlIGZpcnN0LiAgW0lmI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VSICh3 LT5jb250ZW50cyksIG5hbWUpKSkKKyAgICAgICAgICAgICAgICAgICA/IFNTREFUQSAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBuYW1lKSkKKyAgICAgICAgICAgICAgICAgICA6ICJuaWwi OworZnByaW50ZiAoc3RkZXJyLCAiXG5CdWZmZXIgKCVzKVxuIiwgd19jb250ZW50cyk7CisKK3N0 cnVjdCBmYWNlICpmYWNlID0gLi4uCitMaXNwX09iamVjdCBmb3JlZ3JvdW5kID0gZmFjZS0+bGZh Y2VbTEZBQ0VfRk9SRUdST1VORF9JTkRFWF07CitMaXNwX09iamVjdCBiYWNrZ3JvdW5kID0gZmFj ZS0+bGZhY2VbTEZBQ0VfQkFDS0dST1VORF9JTkRFWF07CitmcHJpbnRmIChzdGRlcnIsICJcbmZv cmVncm91bmQgKCVzKSB8IGJhY2tncm91bmQgKCVzKVxuIiwKKyAgICAgICAgICAgICAgICAgKCFO SUxQIChmb3JlZ3JvdW5kKSA/IFNTREFUQSAoZm9yZWdyb3VuZCkgOiAiTklMUCIpLAorICAgICAg ICAgICAgICAgICAoIU5JTFAgKGJhY2tncm91bmQpID8gU1NEQVRBIChiYWNrZ3JvdW5kKSA6ICJO SUxQIikpOworCitmcHJpbnRmIChzdGRlcnIsICJNeSBsaXNwIG9iamVjdDogICVzXG4iLCBTU0RB VEEgKEZjaGFyX3RvX3N0cmluZyAobWFrZV9maXhudW0gKDEwMSkpKSk7CisKK2ZwcmludGYgKHN0 ZGVyciwgInN0cmluZzogJXMgfCBpbnQ6ICVkXG4iLCAiZm9vIiwgNjkpOworCitpZiAoQlVGRkVS UCAody0+Y29udGVudHMpICYmIFNUUklOR1AgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg bmFtZSkpKQorICBmcHJpbnRmIChzdGRlcnIsICJuc191cGRhdGVfd2luZG93X2VuZDogICVzXG4i LCBTU0RBVEEgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKS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IChkcCwgY2gpKSkJCVwKKwkgIHdpZHRoID0gc2FuaXRpemVfY2hh cl93aWR0aCAoQVNJWkUgKERJU1BfQ0hBUl9WRUNUT1IgKGRwLCBjaCkpKTsgXAorCWVsc2UJCQkJ CQkJCVwKKwkgIHdpZHRoID0gQ0hBUkFDVEVSX1dJRFRIIChjaCk7CQkJCQlcCisgICAgICB9CQkJ CQkJCQkJXAorICB9IHdoaWxlICgwKQorCitMaXNwX09iamVjdAorbWNfdmVjdG9yIChpbnQgbGVu Z3RoKQoreworICBzdHJ1Y3QgTGlzcF9WZWN0b3IgKnAgPSBhbGxvY2F0ZV92ZWN0b3IgKGxlbmd0 aCk7CisgIGZvciAocHRyZGlmZl90IGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspCisgICAgcC0+Y29u dGVudHNbaV0gPSBRbmlsOworICByZXR1cm4gbWFrZV9saXNwX3B0ciAocCwgTGlzcF9WZWN0b3Js aWtlKTsKK30KKworTGlzcF9PYmplY3QKK21jX2xpc3RuIChwdHJkaWZmX3QgY291bnQsIExpc3Bf T2JqZWN0IGFyZywgLi4uKQoreworICBlYXNzdW1lICgwIDwgY291bnQpOworICBMaXNwX09iamVj dCB2YWwgPSBGY29ucyAoYXJnLCBRbmlsKTsKKyAgTGlzcF9PYmplY3QgdGFpbCA9IHZhbDsKKyAg dmFfbGlzdCBhcDsKKyAgdmFfc3RhcnQgKGFwLCBhcmcpOworICBmb3IgKHB0cmRpZmZfdCBpID0g MTsgaSA8IGNvdW50OyBpKyspCisgICAgeworICAgICAgTGlzcF9PYmplY3QgZWxlbSA9IEZjb25z ICh2YV9hcmcgKGFwLCBMaXNwX09iamVjdCksIFFuaWwpOworICAgICAgWFNFVENEUiAodGFpbCwg ZWxlbSk7CisgICAgICB0YWlsID0gZWxlbTsKKyAgICB9CisgIHZhX2VuZCAoYXApOworICByZXR1 cm4gdmFsOworfQorCitMaXNwX09iamVjdAorbWNfbWVtcSAoTGlzcF9PYmplY3QgZWx0LCBMaXNw X09iamVjdCBsaXN0KQoreworICB3aGlsZSAoMSkKKyAgICB7CisgICAgICBpZiAoIUNPTlNQIChs aXN0KSB8fCBFUSAoWENBUiAobGlzdCksIGVsdCkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlz dCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkgfHwgRVEgKFhDQVIgKGxp c3QpLCBlbHQpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAg ICAgIGlmICghQ09OU1AgKGxpc3QpIHx8IEVRIChYQ0FSIChsaXN0KSwgZWx0KSkKKyAgICAgICAg YnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgfQorICByZXR1cm4gbGlzdDsK K30KKworTGlzcF9PYmplY3QKK21jX250aCAoaW50IG51bSwgTGlzcF9PYmplY3QgbGlzdCkKK3sK KyAgZm9yIChpbnQgaSA9IDA7IGkgPCBudW0gJiYgIU5JTFAgKGxpc3QpOyBpKyspCisgICAgbGlz dCA9IFhDRFIgKGxpc3QpOworICBpZiAoQ09OU1AgKGxpc3QpKQorICAgIHJldHVybiBYQ0FSIChs aXN0KTsKKyAgICBlbHNlCisgICAgICByZXR1cm4gUW5pbDsKK30KKworTGlzcF9PYmplY3QKK21j X2Fzc3EgKExpc3BfT2JqZWN0IGtleSwgTGlzcF9PYmplY3QgbGlzdCkKK3sKKyAgd2hpbGUgKDEp CisgICAgeworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhD QVIgKGxpc3QpKQorICAgICAgICAgICAgICAmJiBFUSAoWENBUiAoWENBUiAobGlzdCkpLCBrZXkp KSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAo IUNPTlNQIChsaXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAg ICAgICAgICYmIEVRIChYQ0FSIChYQ0FSIChsaXN0KSksIGtleSkpKQorICAgICAgICBicmVhazsK KyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAg ICAgICAgfHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgRVEgKFhDQVIg KFhDQVIgKGxpc3QpKSwga2V5KSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIg KGxpc3QpOworICAgIH0KKyAgaWYgKENPTlNQIChsaXN0KSkKKyAgICByZXR1cm4gWENBUiAobGlz dCk7CisgICAgZWxzZQorICAgICAgcmV0dXJuIFFuaWw7Cit9CisKK0xpc3BfT2JqZWN0CittY19h c3NvYyAoTGlzcF9PYmplY3Qga2V5LCBMaXNwX09iamVjdCBsaXN0KQoreworICBMaXNwX09iamVj dCBjYXI7CisgIHdoaWxlICgxKQorICAgIHsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAg ICAgICAgfHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgKGNhciA9IFhD QVIgKFhDQVIgKGxpc3QpKSwKKyAgICAgICAgICAgICAgICAgIEVRIChjYXIsIGtleSkgfHwgIU5J TFAgKEZlcXVhbCAoY2FyLCBrZXkpKSkpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBY Q0RSIChsaXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAgfHwgKENPTlNQ IChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgKGNhciA9IFhDQVIgKFhDQVIgKGxpc3Qp KSwKKyAgICAgICAgICAgICAgICAgIEVRIChjYXIsIGtleSkgfHwgIU5JTFAgKEZlcXVhbCAoY2Fy LCBrZXkpKSkpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAg ICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAgfHwgKENPTlNQIChYQ0FSIChsaXN0KSkK KyAgICAgICAgICAgICAgJiYgKGNhciA9IFhDQVIgKFhDQVIgKGxpc3QpKSwKKyAgICAgICAgICAg ICAgICAgIEVRIChjYXIsIGtleSkgfHwgIU5JTFAgKEZlcXVhbCAoY2FyLCBrZXkpKSkpKQorICAg ICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICB9CisgIGlmIChDT05T UCAobGlzdCkpCisgICAgcmV0dXJuIFhDQVIgKGxpc3QpOworICAgIGVsc2UKKyAgICAgIHJldHVy biBRbmlsOworfQorCitMaXNwX09iamVjdAorbWNfcGxpc3RfZ2V0IChMaXNwX09iamVjdCBwbGlz dCwgTGlzcF9PYmplY3QgcHJvcCkKK3sKKyAgTGlzcF9PYmplY3QgdGFpbCwgaGFsZnRhaWw7Cisg IC8qIGhhbGZ0YWlsIGlzIHVzZWQgdG8gZGV0ZWN0IGNpcmN1bGFyIGxpc3RzLiAgKi8KKyAgdGFp bCA9IGhhbGZ0YWlsID0gcGxpc3Q7CisgIHdoaWxlIChDT05TUCAodGFpbCkgJiYgQ09OU1AgKFhD RFIgKHRhaWwpKSkKKyAgICB7CisgICAgICBpZiAoRVEgKHByb3AsIFhDQVIgKHRhaWwpKSkKKyAg ICAgICAgcmV0dXJuIFhDQVIgKFhDRFIgKHRhaWwpKTsKKyAgICAgIHRhaWwgPSBYQ0RSIChYQ0RS ICh0YWlsKSk7CisgICAgICBoYWxmdGFpbCA9IFhDRFIgKGhhbGZ0YWlsKTsKKyAgICAgIGlmIChF USAodGFpbCwgaGFsZnRhaWwpKQorICAgICAgICBicmVhazsKKyAgICB9CisgIHJldHVybiBRbmls OworfQorCisvKiBSRUdJT04gQkVHSU46ICBtY19yZWdpb25fbGltaXQgKDEpCisgICBSRUdJT04g RU5EOiAgbWNfcmVnaW9uX2xpbWl0ICgwKSAqLworcHRyZGlmZl90CittY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LAorICAgIFJB TkdFRF9GSVhOVU1QIChjb2wsIHByb3AsIGFsaWduX3RvX21heCkpKQorICB3aWR0aCA9IFhGSVhO VU0gKHByb3ApIC0gY29sOworICAgICAgZWxzZSBpZiAoRkxPQVRQIChwcm9wKSAmJiBjb2wgPD0g WEZMT0FUX0RBVEEgKHByb3ApCisgICAgICAgICAmJiAoWEZMT0FUX0RBVEEgKHByb3ApIDw9IGFs aWduX3RvX21heCkpCisgIHdpZHRoID0gKGludCkoWEZMT0FUX0RBVEEgKHByb3ApICsgMC41KSAt IGNvbDsKKyAgICAgIGlmICh3aWR0aCA+PSAwKQorICB7CisgICAgcHRyZGlmZl90IHN0YXJ0Owor ICAgIGlmIChPVkVSTEFZUCAob3ZlcmxheSkpCisgICAgICAqZW5kcG9zID0gT1ZFUkxBWV9QT1NJ VElPTiAoT1ZFUkxBWV9FTkQgKG92ZXJsYXkpKTsKKyAgICBlbHNlCisgICAgICBnZXRfcHJvcGVy dHlfYW5kX3JhbmdlIChwb3MsIFFkaXNwbGF5LCAmdmFsLCAmc3RhcnQsIGVuZHBvcywgUW5pbCk7 CisgICAgLyogRm9yIDpyZWxhdGl2ZS13aWR0aCwgd2UgbmVlZCB0byBtdWx0aXBseSBieSB0aGUg Y29sdW1uCisgICAgICAgd2lkdGggb2YgdGhlIGNoYXJhY3RlciBhdCBQT1MsIGlmIGl0IGlzIGdy ZWF0ZXIgdGhhbiAxLiAqLworICAgIGlmICghTklMUCAobWNfcGxpc3RfZ2V0IChwbGlzdCwgUUNy ZWxhdGl2ZV93aWR0aCkpCisgICAgICAgICYmICFOSUxQIChCVkFSIChjdXJyZW50X2J1ZmZlciwg ZW5hYmxlX211bHRpYnl0ZV9jaGFyYWN0ZXJzKSkpCisgICAgICB7CisgICAgICAgIGludCBiLCB3 ZDsKKyAgICAgICAgdW5zaWduZWQgY2hhciAqcCA9IEJZVEVfUE9TX0FERFIgKENIQVJfVE9fQllU RSAocG9zKSk7CisgICAgICAgIE1DX01VTFRJ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yA9PSAnXG4nKQorICAg IGdvdG8gZW5kbG9vcDsKKyAgICAgICAgaWYgKGMgPT0gJ1xyJyAmJiBFUSAoQlZBUiAoY3VycmVu dF9idWZmZXIsIHNlbGVjdGl2ZV9kaXNwbGF5KSwgUXQpKQorICAgIGdvdG8gZW5kbG9vcDsKKyAg ICAgICAgaWYgKGMgPT0gJ1x0JykKKyAgICB7CisgICAgICBjb2wgKz0gdGFiX3dpZHRoOworICAg ICAgY29sID0gY29sIC8gdGFiX3dpZHRoICogdGFiX3dpZHRoOworICAgIH0KKyAgICAgICAgZWxz ZQorICAgICsrY29sOworICAgICAgfQorICB9CisgICAgICBlbHNlCisgIHsKKyAgICAvKiBUaGUg ZGlzcGxheSB0YWJsZSBkb2Vzbid0IGFmZmVjdCB0aGlzIGNoYXJhY3RlcjsKKyAgICAgICBpdCBk aXNwbGF5cyBhcyBpdHNlbGYuICovCisgICAgaWYgKGMgPT0gJ1xuJykKKyAgICAgIGdvdG8gZW5k bG9vcDsKKyAgICBpZiAoYyA9PSAnXHInICYmIEVRIChCVkFSIChjdXJyZW50X2J1ZmZlciwgc2Vs ZWN0aXZlX2Rpc3BsYXkpLCBRdCkpCisgICAgICBnb3RvIGVuZGxvb3A7CisgICAgaWYgKGMgPT0g J1x0JykKKyAgICAgIHsKKyAgICAgICAgY29sICs9IHRhYl93aWR0aDsKKyAgICAgICAgY29sID0g Y29sIC8gdGFiX3dpZHRoICogdGFiX3dpZHRoOworICAgICAgfQorICAgIGVsc2UgaWYgKG11bHRp Ynl0ZSAmJiBMRUFESU5HX0NPREVfUCAoYykpCisgICAgICB7CisgICAgICAgIC8qIFN0YXJ0IG9m IG11bHRpLWJ5dGUgZm9ybS4gKi8KKyAgICAgICAgdW5zaWduZWQgY2hhciAqcHRyOworICAgICAg ICBpbnQgYnl0ZXMsIHdpZHRoOworICAgICAgICBwdHIgPSBCWVRFX1BPU19BRERSIChzY2FuX2J5 dGUpOworICAgICAgICBNQ19NVUxUSUJZVEVfQllUR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G4gPSAxOwor ICB9CisgICAgICBmb3IgKGkgPSBuIC0gMTsgaSA+PSAwOyAtLWkpCisgIHsKKyAgICBpZiAoVkVD VE9SUCAoY2hhcnZlYykpCisgICAgICB7CisgICAgICAgIC8qIFRoaXMgc2hvdWxkIGJlIGhhbmRs ZWQgdGhlIHNhbWUgYXMKKyAgICAgbmV4dF9lbGVtZW50X2Zyb21fZGlzcGxheV92ZWN0b3IgZG9l cyBpdC4gKi8KKyAgICAgICAgTGlzcF9PYmplY3QgZW50cnkgPSBBUkVGIChjaGFydmVjLCBpKTsK KyAgICAgICAgaWYgKEdMWVBIX0NPREVfUCAoZW50cnkpKQorICAgIGMgPSBHTFlQSF9DT0RFX0NI QVIgKGVudHJ5KTsKKyAgICAgICAgZWxzZQorICAgIGMgPSAnICc7CisgICAgICB9CisgICAgaWYg KGMgPj0gMDQwICYmIGMgPCAwMTc3KQorICAgICAgY29sKys7CisgICAgZWxzZSBpZiAoYyA9PSAn XG4nCisgICAgICAgfHwgKGMgPT0gJ1xyJworICAgICAgICAgICAmJiBFUSAoQlZBUiAoY3VycmVu dF9idWZmZXIsIHNlbGVjdGl2ZV9kaXNwbGF5KSwgUXQpKSkKKyAgICAgIHsKKyAgICAgICAgcHRy Kys7CisgICAgICAgIGdvdG8gc3RhcnRfb2ZfbGluZV9mb3VuZDsKKyAgICAgIH0KKyAgICBlbHNl IGlmIChjID09ICdcdCcpCisgICAgICB7CisgICAgICAgIGlmICh0YWJfc2VlbikKKyAgICBjb2wg PSAoKGNvbCArIHRhYl93aWR0aCkgLyB0YWJfd2lkdGgpICogdGFiX3dpZHRoOworICAgICAgICBw b3N0X3RhYiArPSBjb2w7CisgICAgICAgIGNvbCA9IDA7CisgICAgICAgIHRhYl9zZWVuID0gMTsK KyAgICAgIH0KKyAgICBlbHNlIGlmIChWRUNUT1JQIChjaGFydmVjKSkKKyAgICAgIC8qIFdpdGgg YSBkaXNwbGF5IHRhYmxlIGVudHJ5LCBDIGlzIGRpc3BsYXllZCBhcyBpcywgYW5kCisgICAgICAg ICBub3QgZGlzcGxheWVkIGFzIFxOTk4gb3IgYXMgXk4uICBJZiBDIGlzIGEgc2luZ2xlLWJ5dGUK KyAgICAgICAgIGNoYXJhY3RlciwgaXQgdGFrZXMgb25lIGNvbHVtbi4gIElmIEMgaXMgbXVsdGkt Ynl0ZSBpbgorICAgICAgICAgYSB1bmlieXRlIGJ1ZmZlciwgaXQncyB0cmFuc2xhdGVkIHRvIHVu aWJ5dGUsIHNvIGl0CisgICAgICAgICBhbHNvIHRha2VzIG9uZSBjb2x1bW4uICovCisgICAgICAr K2NvbDsKKyAgICBlbHNlCisgICAgICBjb2wgKz0gKGN0bF9hcnJvdyAmJiBjIDwgMDIwMCkgPyAy IDogNDsKKyAgfQorICAgIH0KKyBzdGFydF9vZl9saW5lX2ZvdW5kOgorICBpZiAodGFiX3NlZW4p CisgICAgeworICAgICAgY29sID0gKChjb2wgKyB0YWJfd2lkdGgpIC8gdGFiX3dpZHRoKSAqIHRh Yl93aWR0aDsKKyAgICAgIGNvbCArPSBwb3N0X3RhYjsKKyAgICB9CisgIGxhc3Rfa25vd25fY29s dW1uID0gY29sOworICBsYXN0X2tub3duX2NvbHVtbl9wb2ludCA9IHB0OworICBsYXN0X2tub3du X2NvbHVtbl9tb2RpZmllZCA9IE1PRElGRjsKKyAgaWYgKG9sZF9idWZmZXIpCisgIHNldF9idWZm ZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworICByZXR1cm4gY29sOworfQorCitERUZVTiAoIm1j LWN1cnJlbnQtY29sdW1uIiwgRm1jX2N1cnJlbnRfY29sdW1uLCBTbWNfY3VycmVudF9jb2x1bW4s IDIsIDIsIDAsCisgICAgICAgZG9jOiAvKiBSZXR1cm4gdGhlIGhvcml6b250YWwgcG9zaXRpb24g b2YgcG9pbnQuICBCZWdpbm5pbmcgb2YgbGluZSBpcyBjb2x1bW4gMC4KK1RoaXMgaXMgY2FsY3Vs YXRlZCBieSBhZGRpbmcgdG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gdGVtcDsKK30KKworLyogVVNBR0U6ICBmcHJpbnRm IChzdGRlcnIsICJGUkFNRSAoJXMpIiwgbWNfZnJhbWUgKGYpKTsgKi8KK2NoYXIgKgorbWNfZnJh bWUgKHN0cnVjdCBmcmFtZSAqZikKK3sKKyAgTGlzcF9PYmplY3QgZnJhbWU7CisgIFhTRVRGUkFN RSAoZnJhbWUsIGYpOworICByZXR1cm4gU1NEQVRBIChGcHJpbjFfdG9fc3RyaW5nIChmcmFtZSwg UW5pbCkpOworfQorCisvKiBVU0FHRTogIGZwcmludGYgKHN0ZGVyciwgIldJTkRPVyAoJXMpIiwg bWNfd2luZG93ICh3KSk7ICovCitjaGFyICoKK21jX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdykK K3sKKyAgTGlzcF9PYmplY3Qgd2luZG93OworICBYU0VUV0lORE9XICh3aW5kb3csIHcpOworICBy ZXR1cm4gU1NEQVRBIChGcHJpbjFfdG9fc3RyaW5nICh3aW5kb3csIFFuaWwpKTsKK30KKworLyog VVNBR0U6ICBmcHJpbnRmIChzdGRlcnIsICJDSEFSQUNURVIgKCVzKSIsIG1jX2NoYXJfdG9fc3Ry aW5nIChnbHlwaC0+dS5jaCkpOyAqLworY2hhciAqCittY19jaGFyX3RvX3N0cmluZyAoaW50IGFy ZykKK3sKKyAgTGlzcF9PYmplY3QgY2hhcmFjdGVyID0gKDAgPD0gYXJnICYmIGFyZyA8PSBNQVhf Q0hBUikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgID8gRmNoYXJfdG9fc3RyaW5nIChtYWtl X2ZpeG51bSAoYXJnKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIDogUW5pbDsKKyAgY2hh ciAqIHJlc3VsdCA9ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICYmIGFy ZyA9PSA5KQorICAgICAgICAgICAgICAgICAgICA/ICJcXHQiCisgICAgICAgICAgICAgICAgICA6 ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnID09IDEwKQor ICAgICAgICAgICAgICAgICAgICA/ICJcXG4iCisgICAgICAgICAgICAgICAgICA6ICghTklMUCAo Y2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnID09IDMyKQorICAgICAgICAg ICAgICAgICAgICA/ICJcXHMiCisgICAgICAgICAgICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVy KQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnICE9IDkKKyAgICAgICAgICAgICAgICAgICAg ICYmIGFyZyAhPSAxMAorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnICE9IDMyKQorICAgICAg ICAgICAgICAgICAgICA/IFNTREFUQSAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgOiAi XFw/IjsKKyAgcmV0dXJuIHJlc3VsdDsKK30KKworaW50CittY19saXNwX3RvX2N1cnNvcl90eXBl IChMaXNwX09iamVjdCBhcmcpCit7CisgIGNoYXIgKnN0cjsKKyAgaWYgKFhUWVBFIChhcmcpID09 IExpc3BfU3RyaW5nKQorICAgIHN0ciA9IFNTREFUQSAoYXJnKTsKKyAgICBlbHNlIGlmIChYVFlQ RSAoYXJnKSA9PSBMaXNwX1N5bWJvbCkKKyAgICAgIHN0ciA9IFNTREFUQSAoU1lNQk9MX05BTUUg KGFyZykpOworICAgICAgZWxzZSByZXR1cm4gLTE7CisgIGlmICghc3RyY21wIChzdHIsICJubyIp KQorICAgIHJldHVybiBNQ19OT19DVVJTT1I7CisgIGlmICghc3RyY21wIChzdHIsICJtYy1sZWZ0 LWZyaW5nZS1iaXRtYXAiKSkKKyAgICByZXR1cm4gTUNfTEVGVF9GUklOR0VfQklUTUFQOworICBp ZiAoIXN0cmNtcCAoc3RyLCAibWMtcmlnaHQtZnJpbmdlLWJpdG1hcCIpKQorICAgIHJldHVybiBN Q19SSUdIVF9GUklOR0VfQklUTUFQOworICBpZiAoIXN0cmNtcCAoc3RyLCAiYm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orCisvKiBVU0FHRTogIGZwcmludGYgKHN0ZGVyciwgIkFDVElPTi1UWVBF ICglcykiLCBtY19hY3Rpb25fdHlwZV90b19zdHJpbmcgKGFyZykpOyAqLworY2hhciAqCittY19h Y3Rpb25fdHlwZV90b19zdHJpbmcgKGVudW0gbWNfYWN0aW9uX3R5cGUgYWN0aW9uX3R5cGUpCit7 CisgIHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgICAgeworICAgICAgY2FzZSBNVUxUSVBMRV9DVVJT T1JTOiByZXR1cm4gIk1VTFRJUExFX0NVUlNPUlMiOworICAgICAgY2FzZSBIT1JJWk9OVEFMX1JV TEVSOiByZXR1cm4gIkhPUklaT05UQUxfUlVMRVIiOworICAgICAgY2FzZSBWRVJUSUNBTF9SVUxF UjogcmV0dXJuICJWRVJUSUNBTF9SVUxFUiI7CisgICAgICBjYXNlIEZJTExfQ09MVU1OOiByZXR1 cm4gIkZJTExfQ09MVU1OIjsKKyAgICAgIGNhc2UgQ1VSU09SX0lORElDQVRPUjogcmV0dXJuICJD VVJTT1JfSU5ESUNBVE9SIjsKKyAgICAgIGRlZmF1bHQ6CisgICAgICByZXR1cm4gIlVOS05PV04i OworICAgIH0KK30KKworLyogVVNBR0U6ICBmcHJpbnRmIChzdGRlcnIsICJBQ1RJT04tVFlQRSAo JXMpIiwgbWNfZnJvbV93aGVyZV90b19zdHJpbmcgKGFyZykpOyAqLworY2hhciAqCittY19mcm9t X3doZXJlX3RvX3N0cmluZyAoZW51bSBtY19mcm9tX3doZXJlIGZyb21fd2hlcmUpCit7CisgIHN3 aXRjaCAoZnJvbV93aGVyZSkKKyAgICB7CisgICAgICBjYXNlIE5PV0hFUkU6IHJldHVybiAiTk9X SEVSRSI7CisgICAgICBjYXNlIFNDUklCRV9PTkU6IHJldHVybiAiU0NSSUJFX09ORSI7CisgICAg ICBjYXNlIFNDUklCRV9UV086IHJldHVybiAiU0NSSUJFX1RXTyI7CisgICAgICBjYXNlIFNDUklC RV9USFJFRTogcmV0dXJuICJTQ1JJQkVfVEhSRUUiOworICAgICAgY2FzZSBTS0lQUEVEOiByZXR1 cm4gIlNLSVBQRUQiOworICAgICAgY2FzZSBQT1NUX0NIQU5HRUQ6IHJldHVybiAiUE9TVF9DSEFO R0VEIjsKKyAgICAgIGNhc2UgVU5DSEFOR0VEOiByZXR1cm4gIlVOQ0hBTkdFRCI7CisgICAgICBj YXNlIFNFVF9DVVJTT1JfT05FOiByZXR1cm4gIlNFVF9DVVJTT1JfT05FIjsKKyAgICAgIGNhc2Ug U0VUX0NVUlNPUl9UV086IHJldHVybiAiU0VUX0NVUlNPUl9UV08iOworICAgICAgZGVmYXVsdDoK KyAgICAgIHJldHVybiAiVU5LTk9XTiI7CisgICAgfQorfQorCit2b2lkCittY19jYWNoZV9pbnNw ZWN0b3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBtY19tYXRyaXggbWF0cml4KQoreworICBp bnQgdnBvc19hbGxvY2F0ZWQgPSB3LT5tY19tYXRyaXgudnBvc19hbGxvY2F0ZWQ7CisgIGludCB2 cG9zX3VzZWQgPSB3LT5tY19tYXRyaXgudnBvc191c2VkOworICBmcHJpbnRmIChzdGRlcnIsICIl czogIG1hdHJpeC52cG9zX2FsbG9jYXRlZCAoJWQpIHwgbWF0cml4LnZwb3NfdXNlZCAoJWQpXG4i LAorICAgICAgICAgICAgICAgICAgIG1jX3dpbmRvdyAodyksIHZwb3NfYWxsb2NhdGVkLCB2cG9z X3VzZWQpOworICBmb3IgKGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7 CisgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICsrY2FjaGVfdHlwZSkKKyAg ICB7CisgICAgICBpbnQgY3Vyc29yc191c2VkID0gdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtj YWNoZV90eXBlXTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgbWF0cml4LmN1cnNvcnNfdXNl ZFslc10gKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgbWNfY2FjaGVfdHlwZV90b19z dHJpbmcgKGNhY2hlX3R5cGUpLCBjdXJzb3JzX3VzZWQpOworICAgIH0KKyAgZm9yIChpbnQgdm50 aCA9IDA7CisgICAgICAgdm50aCA8IHctPm1jX21hdHJpeC52cG9zX3VzZWQ7CisgICAgICAgKyt2 bnRoKQorICAgIHsKKyAgICAgIGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBN Q19DQUNIRTsKKyAgICAgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICAgICAr K2NhY2hlX3R5cGUpCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgY2FjaGVfYWxsb2NhdGVkID0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVkW2NhY2hlX3R5cGVdOworICAg ICAgICAgIGludCBjYWNoZV91c2VkID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNl ZFtjYWNoZV90eXBlXTsKKyAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIgICAgdm50aCAoJWQp IHwgY2FjaGVfYWxsb2NhdGVkWyVzXSAoJWQpIHwgY2FjaGVfdXNlZFslc10gKCVkKVxuIiwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgIHZudGgsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICBtY19jYWNoZV90eXBlX3RvX3N0cmluZyAoY2FjaGVfdHlwZSksCisgICAgICAgICAgICAgICAg ICAgICAgICAgICBjYWNoZV9hbGxvY2F0ZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBt Y19jYWNoZV90eXBlX3RvX3N0cmluZyAoY2FjaGVfdHlwZSksCisgICAgICAgICAgICAgICAgICAg ICAgICAgICBjYWNoZV91c2VkKTsKKyAgICAgICAgfQorICAgIH0KK30KKwordm9pZAorbWN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uOworICBp ZiAoTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAgICYm IE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAm JiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKSkKKyAgICBy ZXR1cm47CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBlc3NlbnRp YWxzLT5hY3RpdmVfcCA9ICh3ID09IFhXSU5ET1cgKGYtPnNlbGVjdGVkX3dpbmRvdykKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgZiA9PSBGUkFNRV9ESVNQTEFZX0lORk8gKGYpLT54X2hp Z2hsaWdodF9mcmFtZSk7CisgIExpc3BfT2JqZWN0IGJ1ZiA9IHctPmNvbnRlbnRzOworICBDSEVD S19CVUZGRVIgKGJ1Zik7CisgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSIChidWYpOworICBz dHJ1Y3QgYnVmZmVyICpvbGRfYnVmZmVyID0gTlVMTDsKKyAgcHRyZGlmZl90IG9wb2ludCA9ICh3 ID09IFhXSU5ET1cgKHNlbGVjdGVkX3dpbmRvdykpCisgICAgICAgICAgICAgICAgICAgICA/IFBU CisgICAgICAgICAgICAgICAgICAgICA6IFhGSVhOVU0gKEZtYXJrZXJfcG9zaXRpb24gKHctPnBv aW50bSkpOworICBwdHJkaWZmX3QgY3VycmVudF9jb2wgPSBtY19jdXJyZW50X2NvbHVtbiAodywg b3BvaW50KTsKKyAgaW50IGZyYW1lX2NoYXJfd2lkdGggPSBGUkFNRV9DT0xVTU5fV0lEVEggKGYp OworICBib29sIGZpbGxfY29sdW1uX3AgPSAhTklMUCAoQlZBUiAoYiwgZmlsbF9jb2x1bW4pKTsK KyAgaW50IGZpbGxfY29sID0gWEZJWE5VTSAoQlZBUiAoYiwgZmlsbF9jb2x1bW4pKTsKKyAgaW50 IGhzY2xfeCA9IHctPmhzY3JvbGwgKiBmcmFtZV9jaGFyX3dpZHRoOworICBpZiAoYiAhPSBjdXJy ZW50X2J1ZmZlcikKKyAgICB7CisgICAgICBvbGRfYnVmZmVyID0gY3VycmVudF9idWZmZXI7Cisg ICAgICBzZXRfYnVmZmVyX2ludGVybmFsIChiKTsKKyAgICB9CisgIGVzc2VudGlhbHMtPnp2ID0g WlY7CisgIGVzc2VudGlhbHMtPnp2X2J5dGUgPSBaVl9CWVRFOworICBlc3NlbnRpYWxzLT5mY194 ID0gKGZpbGxfY29sdW1uX3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoVmRpc3Bs YXlfbGluZV9udW1iZXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgPyAoZmlsbF9jb2wgKiBm cmFtZV9jaGFyX3dpZHRoKSArIHctPm1jLmxudW1fcGl4ZWxfd2lkdGggLSBoc2NsX3gKKyAgICAg ICAgICAgICAgICAgICAgIDogKGZpbGxfY29sdW1uX3AKKyAgICAgICAgICAgICAgICAgICAgICAg ICYmIE5JTFAgKFZkaXNwbGF5X2xpbmVfbnVtYmVycykpCisgICAgICAgICAgICAgICAgICAgICAg ID8gKGZpbGxfY29sICogZnJhbWVfY2hhcl93aWR0aCkgLSBoc2NsX3gKKyAgICAgICAgICAgICAg ICAgICAgIDogMDsKKyAgaWYgKG9sZF9idWZmZXIpCisgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAo b2xkX2J1ZmZlcik7CisKKyAgZW51bSBmYWNlX2lkIGZpbGxfY29sdW1uX3ByZV96dl9mYWNlX2lk ID0KKyAgICAoIWVzc2VudGlhbHMtPmFjdGl2ZV9wCisgICAgICYmICFOSUxQIChCVkFSIChYQlVG RkVSICh3LT5jb250ZW50cyksIGZjX2luYWN0aXZlX3dpbmRvd3MpKQorICAgICAmJiBOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICAgID8gbG9va3Vw X25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoImZjLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRy dWUpCisgICAgOiAoIWVzc2VudGlhbHMtPmFjdGl2ZV9wCisgICAgICAgJiYgIU5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfaW5hY3RpdmVfd2luZG93cykpCisgICAgICAgJiYg IU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAg JiYgIU5JTFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAmJiB3LT5jdXJz b3IueCA9PSBlc3NlbnRpYWxzLT5mY194KQorICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywg ZiwgaW50ZXJuICgiZmMtb3BvaW50LWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpCisgICAg OiAoZXNzZW50aWFscy0+YWN0aXZlX3AKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hf dmVydGljYWxfcnVsZXIpKQorICAgICAgICYmIHctPmN1cnNvci54ID09IGVzc2VudGlhbHMtPmZj X3gpCisgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCJmYy1vcG9pbnQt cHJlLXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICA6ICghZXNzZW50aWFscy0+YWN0aXZlX3AKKyAgICAg ICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY19pbmFjdGl2ZV93aW5k b3dzKSkKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9z c2hhaXJzK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3IsICZldmVuX2ZvcmVn cm91bmQpOworICAgICAgZW51bSBmYWNlX2lkIG9kZF9mYWNlX2lkID0KKyAgICAgICAgKCFlc3Nl bnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkpCisgICAgICAgID8gbG9va3VwX25hbWVkX2Zh Y2UgKHcsIGYsIGludGVybiAoIistb2RkLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpCisg ICAgICAgIDogbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb2RkLXByZS16di1m YWNlIiksIHRydWUpOworICAgICAgc3RydWN0IGZhY2UgKm9kZF9mYWNlID0gRkFDRV9GUk9NX0lE IChmLCBvZGRfZmFjZV9pZCk7CisgICAgICBMaXNwX09iamVjdCBvZGRfY29sb3IgPSBvZGRfZmFj ZS0+bGZhY2VbTEZBQ0VfRk9SRUdST1VORF9JTkRFWF07CisgICAgICBzdHJ1Y3QgbWNfUkdCIG9k ZF9mb3JlZ3JvdW5kOworICAgICAgbWNfeHdfY29sb3JfdmFsdWVzICh3LCBvZGRfY29sb3IsICZv ZGRfZm9yZWdyb3VuZCk7CisgICAgICBlbnVtIGZhY2VfaWQgYmV5b25kX2ZpbGxfZmFjZV9pZCA9 CisgICAgICAgICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgJiYgIU5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaW5hY3RpdmVfd2luZG93cykpKQorICAgICAgICA/ IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXBvc3QtZmlsbC1pbmFjdGl2ZS1w cmUtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICA6IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBp bnRlcm4gKCIrLXBvc3QtZmlsbC1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgIHN0cnVjdCBm YWNlICpiZXlvbmRfZmlsbF9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBiZXlvbmRfZmlsbF9mYWNl X2lkKTsKKyAgICAgIExpc3BfT2JqZWN0IGJleW9uZF9maWxsX2NvbG9yID0gYmV5b25kX2ZpbGxf ZmFjZS0+bGZhY2VbTEZBQ0VfRk9SRUdST1VORF9JTkRFWF07CisgICAgICBzdHJ1Y3QgbWNfUkdC IGJleW9uZF9maWxsX2ZvcmVncm91bmQ7CisgICAgICBtY194d19jb2xvcl92YWx1ZXMgKHcsIGJl eW9uZF9maWxsX2NvbG9yLCAmYmV5b25kX2ZpbGxfZm9yZWdyb3VuZCk7CisgICAgICAvKiByZWQg Ki8KKyAgICAgIGlmICgoIWZpbGxfY29sdW1uX3AKKyAgICAgICAgICAgJiYgY3VycmVudF9jb2wg JSAyICE9IDAKKyAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVikKKyAgICAgICAg ICB8fCAoZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAgICAmJiBjdXJyZW50X2NvbCAlIDIgIT0g MAorICAgICAgICAgICAgICAmJiBjdXJyZW50X2NvbCA8PSBmaWxsX2NvbAorICAgICAgICAgICAg ICAmJiByb3dfcG9zaXRpb24gPT0gUFJFX1pWKSkKKyAgICAgICAgeworICAgICAgICAgIGxzbF9m Zy0+cmVkID0gb2RkX2ZvcmVncm91bmQucmVkOworICAgICAgICAgIGxzbF9mZy0+Z3JlZW4gPSBv ZGRfZm9yZWdyb3VuZC5ncmVlbjsKKyAgICAgICAgICBsc2xfZmctPmJsdWUgPSBvZGRfZm9yZWdy b3VuZC5ibHVlOworICAgICAgICB9CisgICAgICAgIC8qIHllbGxvdyAqLworICAgICAgICBlbHNl IGlmICgoIWZpbGxfY29sdW1uX3AKKyAgICAgICAgICAgICAgICAgICYmIGN1cnJlbnRfY29sICUg MiA9PSAwCisgICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gPT0gUFJFX1pWKQorICAg ICAgICAgICAgICAgICB8fCAoZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAgICAgICAgICAgJiYg Y3VycmVudF9jb2wgJSAyID09IDAKKyAgICAgICAgICAgICAgICAgICAgICYmIGN1cnJlbnRfY29s IDw9IGZpbGxfY29sCisgICAgICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gPT0gUFJF X1pWKSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBsc2xfZmctPnJlZCA9IGV2ZW5fZm9yZWdy b3VuZC5yZWQ7CisgICAgICAgICAgICBsc2xfZmctPmdyZWVuID0gZXZlbl9mb3JlZ3JvdW5kLmdy ZWVuOworICAgICAgICAgICAgbHNsX2ZnLT5ibHVlID0gZXZlbl9mb3JlZ3JvdW5kLmJsdWU7Cisg ICAgICAgICAgfQorICAgICAgICAgIC8qIGdyZWVuICovCisgICAgICAgICAgZWxzZSBpZiAoZmls bF9jb2x1bW5fcAorICAgICAgICAgICAgICAgICAgICYmIGN1cnJlbnRfY29sID4gZmlsbF9jb2wK KyAgICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gPT0gUFJFX1pWKQorICAgICAgICAg ICAgeworICAgICAgICAgICAgICBsc2xfZmctPnJlZCA9IGJleW9uZF9maWxsX2ZvcmVncm91bmQu cmVkOworICAgICAgICAgICAgICBsc2xfZmctPmdyZWVuID0gYmV5b25kX2ZpbGxfZm9yZWdyb3Vu ZC5ncmVlbjsKKyAgICAgICAgICAgICAgbHNsX2ZnLT5ibHVlID0gYmV5b25kX2ZpbGxfZm9yZWdy b3VuZC5ibHVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAocm93X3Bvc2l0 aW9uID09IEFUX1pWKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbHNsX2ZnLT5y ZWQgPSBlc3NlbnRpYWxzLnNwX2ZnLnJlZDsKKyAgICAg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JvbnQgb3IgZm9sbG93aW5nIHRoZSBnbHlwaAorICAgICBzdHJpbmdzIGJ1aWx0IGFib3ZlLiAq LworICBpZiAoaGVhZCAmJiAhb3ZlcmxhcHMgJiYgcm93LT5jb250YWluc19vdmVybGFwcGluZ19n bHlwaHNfcCkKKyAgICB7CisgICAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpoLCAqdDsKKyAgICAg IE1vdXNlX0hMSW5mbyAqaGxpbmZvID0gTU9VU0VfSExfSU5GTyAoZik7CisgICAgICBpbnQgbW91 c2VfYmVnX2NvbCBVTklOSVQsIG1vdXNlX2VuZF9jb2wgVU5JTklUOworICAgICAgYm9vbCBjaGVj a19tb3VzZV9mYWNlID0gZmFsc2U7CisgICAgICBpbnQgZHVtbXlfeCA9IDA7CisgICAgICAvKiBJ ZiBtb3VzZSBoaWdobGlnaHRpbmcgaXMgb24sIHdlIG1heSBuZWVkIHRvIGRyYXcgYWRqYWNlbnQK KyAgIGdseXBocyB1c2luZyBtb3VzZS1mYWNlIGhpZ2hsaWdodGluZy4gKi8KKyAgICAgIGlmIChh cmVhID09IFRFWFRfQVJFQSAmJiByb3ctPm1vdXNlX2ZhY2VfcAorICAgICAgICAgICYmIGhsaW5m by0+bW91c2VfZmFjZV9iZWdfcm93ID49IDAKKyAgICAgICAgICAmJiBobGluZm8tPm1vdXNlX2Zh Y2VfZW5kX3JvdyA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgcHRyZGlmZl90IHJvd192cG9z ID0gTUFUUklYX1JPV19WUE9TIChyb3csIHctPmN1cnJlbnRfbWF0cml4KTsKKyAgICAgICAgICBp ZiAocm93X3Zwb3MgPj0gaGxpbmZvLT5tb3VzZV9mYWNlX2JlZ19yb3cKKyAgICAgICAgICAgICAg JiYgcm93X3Zwb3MgPD0gaGxpbmZvLT5tb3VzZV9mYWNlX2VuZF9yb3cpCisgICAgICAgICAgICB7 CisgICAgICAgICAgICAgIGNoZWNrX21vdXNlX2ZhY2UgPSB0cnVlOworICAgICAgICAgICAgICBt b3VzZV9iZWdfY29sID0gKHJvd192cG9zID09IGhsaW5mby0+bW91c2VfZmFjZV9iZWdfcm93KQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBobGluZm8tPm1vdXNlX2ZhY2VfYmVnX2Nv bAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAwOworICAgICAgICAgICAgICBtb3Vz ZV9lbmRfY29sID0gKHJvd192cG9zID09IGhsaW5mby0+bW91c2VfZmFjZV9lbmRfcm93KQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBobGluZm8tPm1vdXNlX2ZhY2VfZW5kX2NvbAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiByb3ctPnVzZWRbVEVYVF9BUkVBXTsKKyAg ICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgLyogQ29tcHV0ZSBvdmVyaGFuZ3MgZm9yIGFs bCBnbHlwaCBzdHJpbmdzLiAqLworICAgICAgaWYgKEZSQU1FX1JJRiAoZiktPmNvbXB1dGVfZ2x5 cGhfc3RyaW5nX292ZXJoYW5ncykKKyAgICAgICAgZm9yIChzID0gaGVhZDsgczsgcyA9IHMtPm5l eHQpCisgICAgICAgICAgRlJBTUVfUklGIChmKS0+Y29tcHV0ZV9nbHlwaF9zdHJpbmdfb3Zlcmhh bmdzIChzKTsKKyAgICAgIC8qIFByZXBlbmQgZ2x5cGggc3RyaW5ncyBmb3IgZ2x5cGhzIGluIGZy b250IG9mIHRoZSBmaXJzdCBnbHlwaAorICAgICAgc3RyaW5nIHRoYXQgYXJlIG92ZXJ3cml0dGVu IGJlY2F1c2Ugb2YgdGhlIGZpcnN0IGdseXBoCisgICAgICBzdHJpbmcncyBsZWZ0IG92ZXJoYW5n LiAgVGhlIGJhY2tncm91bmQgb2YgYWxsIHN0cmluZ3MKKyAgICAgIHByZXBlbmRlZCBtdXN0IGJl IGRyYXduIGJlY2F1c2UgdGhlIGZpcnN0IGdseXBoIHN0cmluZworICAgICAgZHJhd3Mgb3ZlciBp dC4gKi8KKyAgICAgIGkgPSBsZWZ0X292ZXJ3cml0dGVuIChoZWFkKTsKKyAgICAgIGlmIChpID49 IDApCisgICAgICAgIHsKKyAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2Ugb3ZlcmxhcF9o bDsKKyAgICAgICAgICAvKiBJZiB0aGlzIHJvdyBjb250YWlucyBtb3VzZSBoaWdobGlnaHRpbmcs IGF0dGVtcHQgdG8gZHJhdworICAgICAgICAgICAgIHRoZSBvdmVybGFwcGVkIGdseXBocyB3aXRo IHRoZSBjb3JyZWN0IGhpZ2hsaWdodC4gIFRoaXMKKyAgICAgICAgICAgICBjb2RlIGZhaWxzIGlm IHRoZSBvdmVybGFwIGVuY29tcGFzc2VzIG1vcmUgdGhhbiBvbmUgZ2x5cGgKKyAgICAgICAgICAg ICBhbmQgbW91c2UtaGlnaGxpZ2h0IHNwYW5zIG9ubHkgc29tZSBvZiB0aGVzZSBnbHlwaHMuCisg ICAgICAgICAgICAgSG93ZXZlciwgbWFraW5nIGl0IHdvcmsgcGVyZmVjdGx5IGludm9sdmVzIGEg bG90IG1vcmUKKyAgICAgICAgICAgICBjb2RlLCBhbmQgSSBkb24ndCBrbm93IGlmIHRoZSBwYXRo b2xvZ2ljYWwgY2FzZSBvY2N1cnMgaW4KKyAgICAgICAgICAgICBwcmFjdGljZSwgc28gd2UnbGwg c3RpY2sgdG8gdGhpcyBmb3Igbm93LiAgLS0tIGN5ZCAgKi8KKyAgICAgICAgICBpZiAoY2hlY2tf bW91c2VfZmFjZQorICAgICAgICAgICAgICAmJiBtb3VzZV9iZWdfY29sIDwgc3RhcnQgJiYgbW91 c2VfZW5kX2NvbCA+IGkpCisgICAgICAgICAgICBvdmVybGFwX2hsID0gRFJBV19NT1VTRV9GQUNF OworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBvdmVybGFwX2hsID0gRFJBV19OT1JN QUxfVEVYVDsKKyAgICAgIC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gb3ZlciB0aGUgZm9yZWdy b3VuZCBvZiBmb2xsb3dpbmcgZ2x5cGhzLiAqLworICAgICAgaSA9IHJpZ2h0X292ZXJ3cml0aW5n ICh0YWlsKTsKKyAgICAgIGlmIChpID49IDApCisgICAgICAgIHsKKyAgICAgICAgICBlbnVtIGRy YXdfZ2x5cGhzX2ZhY2Ugb3ZlcmxhcF9obDsKKyAgICAgICAgICBpZiAoY2hlY2tfbW91c2VfZmFj ZQorICAgICAgICAgICAgICAmJiBtb3VzZV9iZWdfY29sIDwgaSAmJiBtb3VzZV9lbmRfY29sID4g ZW5kKQorICAgICAgICAgICAgb3ZlcmxhcF9obCA9IERSQVdfTU9VU0VfRkFDRTsKKyAgICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgICAgb3ZlcmxhcF9obCA9IERSQVdfTk9STUFMX1RFWFQ7Cisg ICAgICAgICAgaWYgKGhsID09IG92ZXJsYXBfaGwgfHwgY2xpcF90YWlsID09IE5VTEwpCisgICAg ICAgICAgICBjbGlwX3RhaWwgPSB0YWlsOworICAgICAgICAgIGkrKzsgICAgICAvKiBXZSBtdXN0 IGluY2x1ZGUgdGhlIEl0aCBnbHlwaC4gKi8KKyAgICAgICAgICBNQ19CVUlMRF9HTFlQSF9TVFJJ TkdTIChlbmQsIGksIGgsIHQsIG92ZXJsYXBfaGwsIHgsIGxhc3RfeCk7CisgICAgICAgICAgZm9y IChzID0gaDsgczsgcyA9IHMtPm5leHQpCisgICAgICAgICAgICBzLT5iYWNrZ3JvdW5kX2ZpbGxl ZF9wID0gdHJ1ZTsKKyAgICAgICAgICBjb21wdXRlX292ZXJoYW5nc19hbmRfeCAoaCwgdGFpbC0+ eCArIHRhaWwtPndpZHRoLCBmYWxzZSk7CisgICAgICAgICAgYXBwZW5kX2dseXBoX3N0cmluZ19s aXN0cyAoJmhlYWQsICZ0YWlsLCBoLCB0KTsKKyAgICAgICAgfQorICAgICAgdGFpbCA9IGdseXBo X3N0cmluZ19jb250YWluaW5nX2J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AgICAgICAgICAgICAgICAgICAgICBsc2wsIGdseXBoX2ZsYXZv ciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3AsCisgICAgICAgICAgICAg ICAgICAgICAgICAgIE1DX0RSQVdfR0xZUEgsIGRyYXdfcCk7CisgIHVuYmxvY2tfaW5wdXQgKCk7 CisgIC8qIEFkdmFuY2UgdGhlIG91dHB1dCBjdXJzb3IuICovCisgIHctPm91dHB1dF9jdXJzb3Iu aHBvcyArPSBsZW47CisgIHctPm91dHB1dF9jdXJzb3IueCA9IHg7Cit9CisKKy8qIEVYUE9SVDoK KyAgIERyYXcgdGhlIGN1cnNvciBnbHlwaCBvZiB3aW5kb3cgVyBpbiBnbHlwaCByb3cgUk9XLiAg U2VlIHRoZQorICAgY29tbWVudCBvZiBkcmF3X2dseXBocyBmb3IgdGhlIG1lYW5pbmcgb2YgSEwu ICovCit2b2lkCittY19kcmF3X2N1cnNvcl9nbHlwaCAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0 IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAg ICAgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIGhsLCBpbnQgeCwgaW50IGhwb3MsIGlu dCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsLCBlbnVtIG1j X2ZsYXZvciBnbHlwaF9mbGF2b3IsCisgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJz b3JfdHlwZSBjdXJzb3JfdHlwZSwgaW50IHdkLCBib29sIGFjdGl2ZV9wLAorICAgICAgICAgICAg ICAgICAgICAgIGJvb2wgY3Vyc29yX2djX3ApCit7CisgIHN0cnVjdCBnbHlwaF9yb3cgKmJvdHRv bV9yb3cgPSBNQVRSSVhfQk9UVE9NX1RFWFRfUk9XIChtYXRyaXgsIHcpOworICBpbnQgYm90dG9t X3Z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VkVSTEFQU19TVUNDX1AgKHJvdyAt IDEpKQorICAgICAgICB4X2ZpeF9vdmVybGFwcGluZ19hcmVhICh3LCByb3cgLSAxLCBURVhUX0FS RUEsIE9WRVJMQVBTX0VSQVNFRF9DVVJTT1IpOworICAgICAgaWYgKE1BVFJJWF9ST1dfQk9UVE9N X1kgKHJvdykgPCB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAmJiBNQVRSSVhf Uk9XX09WRVJMQVBTX1BSRURfUCAocm93ICsgMSkpCisgICAgICAgIHhfZml4X292ZXJsYXBwaW5n X2FyZWEgKHcsIHJvdyArIDEsIFRFWFRfQVJFQSwgT1ZFUkxBUFNfRVJBU0VEX0NVUlNPUik7Cisg ICAgfQorfQorCit2b2lkCittY19lcmFzZV9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVj dCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAg ICAgICAgICBpbnQgeCwgaW50IHksIGludCBocG9zLCBpbnQgdnBvcywgZW51bSBtY19mbGF2b3Ig Z2x5cGhfZmxhdm9yLAorICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNv cl90eXBlLCBpbnQgd2QpCit7CisgIGJvb2wgZGVidWdfcCA9IGZhbHNlOworICBpZiAoZGVidWdf cCkKKyAgICBmcHJpbnRmIChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6ICB4ICglZCkgfCB5ICgl ZCkgfCBocG9zICglZCkgfCB2cG9zICglZCkgfCB3ZCAoJWQpXG5cCisgICAgZ2x5cGhfZmxhdm9y ICglcykgfCBjdXJzb3JfdHlwZSAoJXMpXG4iLAorICAgIHgsIHksIGhwb3MsIHZwb3MsIHdkLAor ICAgIG1jX2ZsYXZvcl90b19zdHJpbmcgKGdseXBoX2ZsYXZvciksIG1jX2N1cnNvcl90eXBlX3Rv X3N0cmluZyAoY3Vyc29yX3R5cGUpKTsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5m cmFtZSk7CisgIE1vdXNlX0hMSW5mbyAqaGxpbmZvID0gTU9VU0VfSExfSU5GTyAoZik7CisgIGJv b2wgbW91c2VfZmFjZV9oZXJlX3AgPSBmYWxzZTsKKyAgc3RydWN0IGdseXBoICpjdXJzb3JfZ2x5 cGg7CisgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBobDsKKyAgLyogTm8gY3Vyc29yIGRpc3BsYXll ZCBvciByb3cgaW52YWxpZGF0ZWQgPT4gbm90aGluZyB0byBkbyBvbiB0aGUgc2NyZWVuLiAqLwor ICBpZiAoY3Vyc29yX3R5cGUgPT0gTUNfTk9fQ1VSU09SKQorICAgIHsKKyAgICAgIGlmIChkZWJ1 Z19wKQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6ICByZXR1cm4g KCVkKVxuIiwgMSk7CisgICAgICByZXR1cm47CisgICAgfQorICAvKiBWUE9TID49IG1hdHJpeC0+ bnJvd3MgbWVhbnMgdGhhdCB3aW5kb3cgaGFzIGJlZW4gcmVzaXplZC4KKyAgICAgRG9uJ3QgYm90 aGVyIHRvIGVyYXNlIHRoZSBjdXJzb3IuICovCisgIGlmICh2cG9zID49IG1hdHJpeC0+bnJvd3Mp CisgICAgeworICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIm1j X2VyYXNlX2N1cnNvcjogIHJldHVybiAoJWQpXG4iLCAyKTsKKyAgICAgIHJldHVybjsKKyAgICB9 CisgIC8qIElmIHJvdyBjb250YWluaW5nIGN1cnNvciBpcyBtYXJrZWQgaW52YWxpZCwgdGhlcmUg aXMgbm90aGluZyB3ZQorICAgICBjYW4gZG8uICovCisgIGlmICghcm93LT5lbmFibGVkX3ApCisg ICAgeworICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX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FdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICAgICAgY3Vyc29yX2ds eXBoID0gbWNfZ2V0X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIGhwb3MsIHZwb3MpOwor ICAgICAgaWYgKGN1cnNvcl9nbHlwaCA9PSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgaWYg KGRlYnVnX3ApCisgICAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6 ICByZXR1cm4gKCVkKVxuIiwgNyk7CisgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAg ICBpbnQgdGVtcF93ZCA9IGN1cnNvcl9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICBpZiAodGVt cF94IDwgMCkKKyAgICAgICAgeworICAgICAgICAgIHRlbXBfd2QgKz0gdGVtcF94OworICAgICAg ICAgIHRlbXBfeCA9IDA7CisgICAgICAgIH0KKyAgICAgIHRlbXBfd2QgPSBtaW4gKHdkLCB3aW5k b3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpIC0gdGVtcF94KTsKKyAgICAgIGludCBmeSA9IFdJ TkRPV19UT19GUkFNRV9QSVhFTF9ZICh3LCBtYXggKGhlYWRlcl9saW5lX2hlaWdodCwgcm93LT55 KSk7CisgICAgICBpbnQgZnggPSBXSU5ET1dfVEVYVF9UT19GUkFNRV9QSVhFTF9YICh3LCB0ZW1w X3gpOworICAgICAgaWYgKHRlbXBfd2QgPiAwKQorICAgICAgICBGUkFNRV9SSUYgKGYpLT5jbGVh cl9mcmFtZV9hcmVhIChmLCBmeCwgZnksIHRlbXBfd2QsIHJvdy0+dmlzaWJsZV9oZWlnaHQpOwor ICAgIH0KKyAgLyogRXJhc2UgdGhlIGN1cnNvciBieSByZWRyYXdpbmcgdGhlIGNoYXJhY3RlciB1 bmRlcm5lYXRoIGl0LiAqLworICBpZiAobW91c2VfZmFjZV9oZXJlX3ApCisgICAgaGwgPSBEUk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cnNvcnMuICovCit2b2lkCittY19k cmF3X2VyYXNlX2h5YnJpZCAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAq bWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICAgICAgaW50 IHgsIGludCBmeCwgaW50IHksIGludCBmeSwgaW50IGhwb3MsIGludCB2cG9zLCBpbnQgd2QsIGlu dCBoLAorICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5 cGUsIGludCBjdXJzb3Jfd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JH QiBsc2wsIGJvb2wgYWN0aXZlX3AsIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciwKKyAgICAg ICAgICAgICAgICAgICAgICBib29sIHJlbW92ZV9wKQoreworICAvKiBgbWF0cml4X3JvdycgaW4g YGRpc3BuZXcuY2AgY29udGFpbnMgdGhlIGZvbGxvd2luZyB0ZXN0cywKKyAgZWFzc2VydCAobWF0 cml4ICYmIG1hdHJpeC0+cm93cyk7CisgIGVhc3NlcnQgKHJvdyA+PSAwICYmIHJvdyA8IG1hdHJp eC0+bnJvd3MpOyAqLworICBib29sIGJhcmZfY3Jhc2hfb25lID0gKG1hdHJpeCAmJiBtYXRyaXgt PnJvd3MpID8gZmFsc2UgOiB0cnVlOworICBpZiAoYmFyZl9jcmFzaF9vbmUpCisgICAgcmV0dXJu OworICBib29sIGJhcmZfY3Jhc2hfdHdvID0gKHZwb3MgPj0gMCAmJiB2cG9zIDwgbWF0cml4LT5u cm93cykgPyBmYWxzZSA6IHRydWU7CisgIGlmIChiYXJmX2NyYXNoX3R3bykKKyAgICByZXR1cm47 CisgIGlmICh4IDwgMAorICAgICAgfHwgeSA8IDAKKyAgICAgIHx8IGhwb3MgPCAwCisgICAgICB8 fCB2cG9zIDwgMCkKKyAgICByZXR1cm47CisgIExpc3BfT2JqZWN0IGJ1ZiA9IHctPmNvbnRlbnRz OworICBDSEVDS19CVUZGRVIgKGJ1Zik7CisgIGJvb2wgYXV0b19oc2Nyb2xsX21vZGVfcCA9IEVR IChGYnVmZmVyX2xvY2FsX3ZhbHVlIChRYXV0b19oc2Nyb2xsX21vZGUsIGJ1ZiksIFFjdXJyZW50 X2xpbmUpOworICAvKiBFWEFNUExFOiAgKHNjcm9sbC1sZWZ0IDUpICovCisgIGJvb2wgaHNjbF9h bGxfdGVtcF9wID0gKHctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hz Y3JvbGwgPT0gMCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIG5vdGhpbmcuICov CisgIGJvb2wgaHNjbF9hbGxfcGVybV8wX3AgPSAody0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSB3LT5oc2Nyb2xsKTsKKyAgLyogRVhBTVBMRTogIEMt dSBDLXggPCBhbmQgZG8gc29tZXRoaW5nIGVsc2UgYmVzaWRlcyBob3Jpem9udGFsbHkgc2Nyb2xs aW5nIHRoZQorICAgICAgICAgICAgICAgY3VycmVudCBsaW5lIGRpZmZlcmVudGx5LgorICAgICAg ICAgICAgICAgQ3VycmVudCBsaW5lIGlzIF9ub3RfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZm ZXJlbnRseS4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzFfcCA9ICghdy0+c3VzcGVuZF9hdXRv X2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9k ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSB3LT5oc2Nyb2xsKTsKKyAgLyog RVhBTVBMRTogIEMtdSBDLXggPCBhbmQgLi4uCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUg aXMgX25vdF8gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhz Y2xfYWxsX3Blcm1fMl9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID09IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5taW5faHNjcm9sbCAhPSB3LT5oc2Nyb2xsKTsKKyAgLyogRVhBTVBMRTogIChzY3JvbGwtbGVm dCA1KTsgYW5kLCB0aGVuIHByZXNzIHRoZSBsZWZ0IGFycm93IGtleSBvbmUgdGltZS4KKyAgICAg ICAgICAgICAgIEN1cnJlbnQgbGluZSBfaXNfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJl bnRseS4qLworICBib29sIGhzY2xfdGVtcF9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAor ICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICYmIHct Pm1pbl9oc2Nyb2xsID09IDApOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBzb21l dGhpbmcgdGhhdCBjYXVzZXMgdGhlIGN1cnJlbnQgbGluZSB0byBiZQorICAgICAgICAgICAgICAg aG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LgorICAgICAgICAgICAgICAgQ3VycmVu dCBsaW5lIF9pc18gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29s IGhzY2xfcGVybV9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAg ICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4g MAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhzY3JvbGwp OworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgaW50IGZyaW5nZV9i aXRtYXAgPSBNQ19OT19GUklOR0VfQklUTUFQOworICBpbnQgZmFjZV9pZCA9IERFRkFVTFRfRkFD RV9JRDsKKyAgaWYgKCFyZW1vdmVfcAorICAgICAgJiYgZ2x5cGhfZmxhdm9yID09IE1DX09WRVJM QVlfQVJST1dfQklUTUFQCisgICAgICAmJiAhaHNjbF9hbGxfdGVtcF9wCisgICAgICAmJiAhaHNj bF90ZW1wX3AKKyAgICAgICYmICFoc2NsX3Blcm1fcAorICAgICAgJiYgIWhzY2xfYWxsX3Blcm1f MF9wCisgICAgICAmJiAhaHNjbF9hbGxfcGVybV8xX3AKKyAgICAgICYmICFoc2NsX2FsbF9wZXJt XzJfcCkKKyAgICB7CisgICAgICBlbnVtIGZhY2VfaWQgb3ZlcmxheV9hcnJvd19mYWNlX2lkID0K KyAgICAgICAgKCFhY3RpdmVfcAorICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgY2hfaW5hY3RpdmVfd2luZG93cykpKQorICAgICAgICA/IGxvb2t1cF9uYW1l ZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ctaW5hY3RpdmUtcHJlLXp2LWZh Y2UiKSwgdHJ1ZSkKKyAgICAgICAgOiAoYWN0aXZlX3ApCisgICAgICAgICAgPyBsb29rdXBfbmFt ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LXByZS16di1mYWNlIiksIHRy dWUpCisgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgZmFjZV9pZCA9IChjdXJzb3Jf dHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgPyBvdmVybGF5 X2Fycm93X2ZhY2VfaWQKKyAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAg IC8qIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgUW92ZXJsYXlfYXJy b3csIGZhbHNlLCBmYWxzZSk7ICovCisgICAgICBpZiAody0+aHNjcm9sbCAhPSAwKQorICAgICAg ICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistb3Zl cmxheS1hcnJvdyIpLCBmYWxzZSwgdHJ1ZSk7CisgICAgICAgIGVsc2UKKyAgICAgICAgICBmcmlu Z2VfYml0bW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dXNpbmcgYHNldC1mcmluZ2UtYml0bWFwLWZhY2UnLiAqLwor ICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9G UklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGZyaW5nZV9i aXRtYXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19OT19GUklOR0VfQklU TUFQOworICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gZmFjZV9pZDsKKyAgICAgIHJv dy0+bGVmdF9mcmluZ2Vfb2Zmc2V0ID0gMDsKKyAgICAgIHJvdy0+ZnJpbmdlX2JpdG1hcF9wZXJp b2RpY19wID0gZmFsc2U7CisgICAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXAgKHcsIHJvdywgdHJ1 ZSwgY3Vyc29yX3R5cGUpOworICAgIH0KKyAgICBlbHNlIGlmICghcmVtb3ZlX3AKKyAgICAgICAg ICAgICAmJiBnbHlwaF9mbGF2b3IgPT0gTUNfT1ZFUkxBWV9BUlJPV19CSVRNQVAKKyAgICAgICAg ICAgICAmJiAoaHNjbF9hbGxfdGVtcF9wCisgICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxsX3Bl cm1fMF9wCisgICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxsX3Blcm1fMV9wCisgICAgICAgICAg ICAgICAgIHx8IGhzY2xfYWxsX3Blcm1fMl9wCisgICAgICAgICAgICAgICAgIHx8IGhzY2xfdGVt cF9wCisgICAgICAgICAgICAgICAgIHx8IGhzY2xfcGVybV9wKSkKKyAgICAgIHsKKyAgICAgICAg ZW51bSBmYWNlX2lkIG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICAgKCFhY3RpdmVf cAorICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF9p bmFjdGl2ZV93aW5kb3dzKSkpCisgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwg aW50ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtaW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwgdHJ1 ZSkKKyAgICAgICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2Zh Y2UgKHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1oc2NsLXByZS16di1mYWNlIiksIHRy dWUpCisgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgIGZhY2VfaWQgPSAoY3Vy c29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgPyBv dmVybGF5X2Fycm93X2ZhY2VfaWQKKyAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lE OworICAgICAgICBpZiAoaHNjbF9hbGxfcGVybV8wX3ApCisgICAgICAgICAgZnJpbmdlX2JpdG1h cCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCBmYWxz ZSwgZmFsc2UpOworICAgICAgICAgIGVsc2UgaWYgKGhzY2xfYWxsX3Blcm1fMV9wKQorICAgICAg ICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIr LWhzY2wtcGVybSIpLCB0cnVlLCBmYWxzZSk7CisgICAgICAgICAgICBlbHNlIGlmIChoc2NsX2Fs bF9wZXJtXzJfcCkKKyAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2Vf Yml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCBmYWxzZSwgdHJ1ZSk7CisgICAgICAg ICAgICAgIGVsc2UgaWYgKGhzY2xfcGVybV9wKQorICAgICAgICAgICAgIC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1JJR0hUX0FSUk9XCisgICAgICAgICAgICAg ICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklH SFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9X X1JFQ1RBTkdMRQorICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJU SUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3Ig PT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAg ICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAg IHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIKKyAgICAgICAgICAg ICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSCkpCisg ICAgICAgIHsKKyAgICAgICAgICBMaXNwX09iamVjdCBiaXRtYXBfZmxhdm9yID0gKGdseXBoX2Zs YXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9 PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX2hvbGxvd19yZWN0YW5n bGVfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAo Z2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEUpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBRbWNfaG9sbG93X3JlY3RhbmdsZQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxf QkFSX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gUW1jX3ZlcnRpY2FsX2Jhcl9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFS X1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g UW1jX3JldmVyc2VkX3ZlcnRpY2FsX2Jhcl9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jh cgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3Ig PT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX3ZlcnRpY2FsX2JhcgorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFS X0JBQ0tTTEFTSCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFt Y192ZXJ0aWNhbF9iYXJfYmFja3NsYXNoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogUW5pbDsKKyAgICAgICAgICBmcmluZ2VfYml0bWFwID0gKGN1cnNvcl90eXBlID09 IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAgID8gbG9v a3VwX2ZyaW5nZV9iaXRtYXAgKGJpdG1hcF9mbGF2b3IpCisgICAgICAgICAgICAgICAgICAgICAg ICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICBmYWNlX2lkID0gKGN1cnNvcl90 eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgICAgICYmIChn bHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVwor ICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9W RVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlw aF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKSkKKyAgICAgICAgICAgICAgICAg ICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJldmVyc2VkLWJhci1w cmUtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9 PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBo X2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAg ICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNB TF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9y ICE9IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgICAgICA/IGxv b2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLWJhci1wcmUtenYtZmFjZSIpLCB0cnVl KQorICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICByb3ct PmN1cnNvcl9pbl9mcmluZ2VfcCA9IGZhbHNlOworICAgICAgICAgIHJvdy0+cmlnaHRfZnJpbmdl X2JpdG1hcCA9IGZyaW5nZV9iaXRtYXA7CisgICAgICAgICAgcm93LT5yaWdodF9mcmluZ2VfZmFj ZV9pZCA9IGZhY2VfaWQ7CisgICAgICAgICAgcm93LT5yaWdodF9mcmluZ2Vfb2Zmc2V0ID0gMDsK KyAgICAgICAgICByb3ctPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcCA9IGZhbHNlOworICAgICAg ICAgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcCAodywgcm93LCBmYWxzZSwgY3Vyc29yX3R5cGUpOwor ICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSAorICAg ICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEhMRVNTKQorICAgICAgICAg IHsKKyAgICAgICAgICAgIGJvb2wgb25fcCA9IHRydWU7CisgICAgICAgICAgICBGUkFNRV9SSUYg KGYpLT5tY19zY3JpYmVfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9z LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdnBvcywgd2Qs IGgsIGxzbCwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IC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hBUl9HTFlQSAorICAgICAgICAgPyAn QycKKyAgICAgICAgIDogJ0cnKSwKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChC VUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNUUklO R1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgOiAoTklM UCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAgICA6 ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICBnbHlwaC0+dS5j aCwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5l X3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+aHBv cywgZ2x5cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAo Z2x5cGgtPnUuY2gpKTsKKyAgICB9CisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IFNUUkVUQ0hf R0xZUEgpCisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBEImQv JS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICAlM2QgJXMg JXNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAg KChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAg ICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdTJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisg ICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnQicKKyAgICAg ICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAg ICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnMCcKKyAgICAgICAg ICA6ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAwdSwKKyAg ICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisg ICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+aHBvcywgZ2x5 cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAiXFxTIik7CisgICAgfQorICBlbHNlIGlm IChnbHlwaC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkKKyAgICB7CisgICAgICBmcHJpbnRmIChzdGRl cnIsCisgICAgICAgICIgJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNngg JTRkICUxLjFkJTEuMWQgICUzZCAlcyAlY1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBo c1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ct PnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ0knLAorICAg ICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisg ICAgICAgICAgICA/ICdCJworICAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisg ICAgICAgICAgICA/ICdTJworICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAg ICAgICAgICA/ICcwJworICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxf d2lkdGgsCisgICAgICAgICh1bnNpZ25lZCBpbnQpIGdseXBoLT51LmltZ19pZCwKKyAgICAgICAg Z2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAg IGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+aHBvcywgZ2x5cGhfenZf cCA/ICJaViIgOiAiLS0iLAorICAgICAgICAnLicpOworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgt PnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwK KyAgICAgICAgIiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCIsCisg ICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVz ZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0 aXZlX3gsCisgICAgICAgICcrJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChC VUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnQicKKyAgICAgICAgICA6IChT VFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICA6IChO SUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICA6ICctJykp KSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAodW5zaWduZWQgaW50KSBn bHlwaC0+dS5jbXAuaWQpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICU0ZCAlMS4xZCUxLjFk IiwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5l X3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wKTsKKyAgICAgIGlmIChnbHlwaC0+ dS5jbXAuYXV0b21hdGljKQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIgICUzZCAlcyAuIFsl ZC0lZF1cbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGgtPmhwb3MsIGdseXBoX3p2 X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaC0+c2xpY2Uu Y21wLmZyb20sIGdseXBoLT5zbGljZS5jbXAudG8pOworICAgICAgICBlbHNlCisgICAgICAgIGZw cmludGYgKHN0ZGVyciwgIlxuIik7CisgICAgfQorICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBY V0lER0VUX0dMWVBIKQorICAgIHsKKyNpZm5kZWYgSEFWRV9YV0lER0VUUworICAgICAgZWFzc3Vt ZSAoZmFsc2UpOworI2Vsc2UKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIiAgJTVk LyUtNWQgJTVkICU0YyAlNmQgJWMgJTNkIDB4JTA1eCAlNGQgJTEuMWQlMS4xZCAgJTNkICVzICVj XG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgo cm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAg ICByZWxhdGl2ZV94LAorICAgICAgICAnWCcsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAg ICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgPyAnQicKKyAgICAgICAg IDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAg OiAnLScpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICBnbHlwaC0+ZmFj ZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJp Z2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT51Lnh3aWRnZXQsCisgICAgICAgIGdseXBo LT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7CisjZW5kaWYK KyAgICB9Cit9CisKKy8qIER1bXAgdGhlIGNvbnRlbnRzIG9mIGdseXBoIHJvdyBhdCBWUE9TIGlu IE1BVFJJWCB0byBzdGRlcnIuCisgICBHTFlQSFMgMCBtZWFucyBkb24ndCBzaG93IGdseXBoIGNv bnRlbnRzLgorICAgR0xZUEhTIDEgbWVhbnMgc2hvdyBnbHlwaHMgaW4gc2hvcnQgZm9ybQorICAg R0xZUEhTID4gMSBtZWFucyBzaG93IGdseXBocyBpbiBsb25nIGZvcm0uICovCit2b2lkCittY19k dW1wX2dseXBoX3JvdyAoc3RydWN0IGdseXBoX3JvdyAqcm93LCBpbnQgdnBvcywgaW50IGdseXBo cykKK3sKKyAgaW50IHJlbGF0aXZlX3ggPSAwOworICBpZiAoZ2x5cGhzICE9IDEpCisgICAgewor ICAgICAgZnByaW50ZiAoc3RkZXJyLCAiXG5EVU1QIEdMWVBIIFJPV1xuIik7CisgICAgICBmcHJp bnRmIChzdGRlcnIsICJSb3cgICAgIFN0YXJ0ICAgICAgIEVuZCBVc2VkIG9FPjxcXENUWkZlc20g ICAgIFggICAgWSAgICBXICAgIEggICAgViAgICBBICAgIFBcbiIpOworICAgICAgZnByaW50ZiAo c3RkZXJyLCAiPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4iKTsKKyAgICAgIGZwcmludGYgKHN0ZGVy ciwgIiUzZCAlOSJwRCJkICU5InBEImQgJTRkICUxLjFkJTEuMWQlMS4xZCUxLjFkXAorJTEuMWQl MS4xZCUxLjFkJTEuMWQlMS4xZCUxLjFkJTEuMWQlMS4xZCAgJTRkICU0ZCAlNGQgJTRkICU0ZCAl NGQgJTRkXG4iLAorICAgICAgICAgdnBvcywKKyAgICAgICAgIE1BVFJJWF9ST1dfU1RBUlRfQ0hB UlBPUyAocm93KSwKKyAgICAgICAgIE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdyksCisgICAg ICAgICByb3ctPnVzZWRbVEVYVF9BUkVBXSwKKyAgICAgICAgIHJvdy0+Y29udGFpbnNfb3Zlcmxh cHBpbmdfZ2x5cGhzX3AsCisgICAgICAgICByb3ctPmVuYWJsZWRfcCwKKyAgICAgICAgIHJvdy0+ dHJ1bmNhdGVkX29uX2xlZnRfcCwKKyAgICAgICAgIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3As CisgICAgICAgICByb3ctPmNvbnRpbnVlZF9wLAorICAgICAgICAgTUFUUklYX1JPV19DT05USU5V QVRJT05fTElORV9QIChyb3cpLAorICAgICAgICAgTUFUUklYX1JPV19ESVNQTEFZU19URVhUX1Ag KHJvdyksCisgICAgICAgICByb3ctPmVuZHNfYXRfenZfcCwKKyAgICAgICAgIHJvdy0+ZmlsbF9s aW5lX3AsCisgICAgICAgICByb3ctPmVuZHNfaW5fbWlkZGxlX29mX2NoYXJfcCwKKyAgICAgICAg IHJvdy0+c3RhcnRzX2luX21pZGRsZV9vZl9jaGFyX3AsCisgICAgICAgICByb3ctPm1vdXNlX2Zh Y2VfcCwKKyAgICAgICAgIHJvdy0+eCwKKyAgICAgICAgIHJvdy0+eSwKKyAgICAgICAgIHJvdy0+ cGl4ZWxfd2lkdGgsCisgICAgICAgICByb3ctPmhlaWdodCwKKyAgICAgICAgIHJvdy0+dmlzaWJs ZV9oZWlnaHQsCisgICAgICAgICByb3ctPmFzY2VudCwKKyAgICAgICAgIHJvdy0+cGh5c19hc2Nl bnQpOworICAgICAgLyogVGhlIG5leHQgMyBsaW5lcyBzaG91bGQgYWxpZ24gdG8gIlN0YXJ0IiBp biB0aGUgaGVhZGVyLiAqLworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICAgICU5InBEImQgJTki cEQiZFx0JTVkXG4iLCByb3ctPnN0YXJ0Lm92ZXJsYXlfc3RyaW5nX2luZGV4LAorICAgICAgICAg cm93LT5lbmQub3ZlcmxheV9zdHJpbmdfaW5kZXgsCisgICAgICAgICByb3ctPmNvbnRpbnVhdGlv bl9saW5lc193aWR0aCk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgICAgJTkicEQiZCAlOSJw RCJkXG4iLAorICAgICAgICAgQ0hBUlBPUyAocm93LT5zdGFydC5zdHJpbmdfcG9zKSwKKyAgICAg ICAgIENIQVJQT1MgKHJvdy0+ZW5kLnN0cmluZ19wb3MpKTsKKyAgICAgIGZwcmludGYgKHN0ZGVy ciwgIiAgICAlOWQgJTlkXG4iLCByb3ctPnN0YXJ0LmRwdmVjX2luZGV4LAorICAgICAgICAgcm93 LT5lbmQuZHB2ZWNfaW5kZXgpOworICAgIH0KKyAgaWYgKGdseXBocyA+IDEpCisgICAgeworICAg ICAgZm9yIChpbnQgYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFyZWEgPCBMQVNUX0FSRUE7ICsr YXJlYSkKKyAgeworICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSByb3ctPmdseXBoc1thcmVhXTsK KyAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoX2VuZCA9IGdseXBoICsgcm93LT51c2VkW2FyZWFdOwor ICAgIC8qIEdseXBoIGZvciBhIGxpbmUgZW5kIGluIHRleHQuICovCisgICAgaWYgKGFyZWEgPT0g VEVYVF9BUkVBICYmIGdseXBoID09IGdseXBoX2VuZCAmJiBnbHlwaC0+Y2hhcnBvcyA+IDApCisg ICAgICArK2dseXBoX2VuZDsKKyAgICBpZiAoZ2x5cGggPCBnbHlwaF9lbmQpCisgICAgICBmcHJp bnRmIChzdGRlcnIsICJHbHlwaCMvVG90YW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kNCwgJmQ1LCAmeXBvcyk7CisgICAgICBpbnQg aGVhZGVyX2xpbmVfaGVpZ2h0ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgICAg ICBpbnQgdm9mZnNldCA9IChoZWFkZXJfbGluZV9oZWlnaHQgPiAwCisgICAgICAgICAgICAgICAg ICAgICAmJiB5cG9zID4gMCkKKyAgICAgICAgICAgICAgICAgICAgICA/IHlwb3MgKyAxCisgICAg ICAgICAgICAgICAgICAgICAgOiB5cG9zOworICAgICAgaWYgKHZpc2libGVfcCkKKyAgICAgICAg dnBvcyA9IHZvZmZzZXQ7CisgICAgICAgIGVsc2UKKyAgICAgICAgICB2cG9zID0gMDsKKyAgICB9 CisgICAgZWxzZQorICAgICAgeworICAgICAgICBDSEVDS19OVU1CRVIgKHJvdyk7CisgICAgICAg IHZwb3MgPSBYRklYTlVNIChyb3cpOworICAgICAgfQorICBpZiAodnBvcyA+PSAwICYmIHZwb3Mg PCBtYXRyaXgtPm5yb3dzKQorICAgIG1jX2R1bXBfZ2x5cGhfcm93IChNQVRSSVhfUk9XIChtYXRy aXgsIHZwb3MpLAorICAgICAgICB2cG9zLAorICAgICAgICBUWVBFX1JBTkdFRF9GSVhOVU1QIChp bnQsIGdseXBocykgPyBYRklYTlVNIChnbHlwaHMpIDogMik7CisgIHJldHVybiBRbmlsOworfQor Cit2b2lkCittY19kdW1wX2dseXBoX21hdHJpeCAoc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4 LCBpbnQgZ2x5cGhzKQoreworICBpbnQgaTsKKyAgZm9yIChpID0gMDsgaSA8IG1hdHJpeC0+bnJv d3M7ICsraSkKKyAgICBtY19kdW1wX2dseXBoX3JvdyAoTUFUUklYX1JPVyAobWF0cml4LCBpKSwg aSwgZ2x5cGhzKTsKK30KKworREVGVU4gKCJtYy1kdW1wLWdseXBoLW1hdHJpeCIsIEZtY19kdW1w X2dseXBoX21hdHJpeCwKKyAgICAgICBTbWNfZHVtcF9nbH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N0ZGVyciwgIj09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuIik7CisgIG1jX2R1bXBfZ2x5cGhf bWF0cml4ICh3LT5jdXJyZW50X21hdHJpeCwKKyAgICAgICAgIFRZUEVfUkFOR0VEX0ZJWE5VTVAg KGludCwgZ2x5cGhzKSA/IFhGSVhOVU0gKGdseXBocykgOiAwKTsKKyAgcmV0dXJuIFFuaWw7Cit9 CisKK2Jvb2wKK21jX3RyYXZlcnNlX2NhY2hlX3AgKHN0cnVjdCBtY19tYXRyaXggbWF0cml4LCBl bnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgIGludCB2 bnRoLCBpbnQgbnRoKQoreworICBpZiAodm50aCA8IG1hdHJpeC52cG9zX3VzZWQKKyAgICAgICYm IG1hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVfdHlwZV0gPiAwCisgICAgICAmJiBudGggPCBtYXRy aXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdKQorICAgIHJldHVybiB0cnVlOwor ICAgIGVsc2UKKyAgICAgIHJldHVybiBmYWxzZTsKK30KKwordm9pZAorbWNfcmVzZXRfY2FjaGUg KHN0cnVjdCB3aW5kb3cgKncpCit7CisgIGlmICghQlVGRkVSUCAody0+Y29udGVudHMpKQorICAg IHJldHVybjsKKyAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hF OworICAgICAgIGNhY2hlX3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICArK2NhY2hlX3R5cGUpCisg ICAgeworICAgICAgYm9vbCBidmFyX2FjdGl2ZV9wOworICAgICAgc3dpdGNoIChjYWNoZV90eXBl KQorICAgICAgICB7CisgICAgICAgICAgY2FzZSBOT19DQUNIRToKKyAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICAgIGNhc2UgTUNfQ0FD SEU6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50 cykKKyAgICAgICAgICAgICAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgbWNfY29uZikpKQorICAgICAgICAgICAgICAgIGJ2YXJfYWN0aXZlX3AgPSBmYWxzZTsKKyAg ICAgICAgICAgICAgICBlbHNlIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAg ICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19j b25mKSkpCisgICAgICAgICAgICAgICAgICBidmFyX2FjdGl2ZV9wID0gdHJ1ZTsKKyAgICAgICAg ICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgY2FzZSBDSF9DQUNIRToKKyAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAg ICAgICAgICAgICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9z c2hhaXJzKSkpCisgICAgICAgICAgICAgICAgYnZhcl9hY3RpdmVfcCA9IGZhbHNlOworICAgICAg ICAgICAgICAgIGVsc2UgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAg ICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFp cnMpKSkKKyAgICAgICAgICAgICAgICAgIGJ2YXJfYWN0aXZlX3AgPSB0cnVlOworICAgICAgICAg ICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBjYXNlIEZDX0NBQ0hFOgorICAg ICAgICAgICAgeworICAgICAgICAgICAgICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAg ICAgICAgICAgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zp c2libGUpKSkKKyAgICAgICAgICAgICAgICBidmFyX2FjdGl2ZV9wID0gZmFsc2U7CisgICAgICAg ICAgICAgICAgZWxzZSBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJs ZSkpKQorICAgICAgICAgICAgICAgICAgYnZhcl9hY3RpdmVfcCA9IHRydWU7CisgICAgICAgICAg ICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBpZiAoIWJ2YXJfYWN0 aXZlX3ApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBEZWNyZWFzZSB0aGUgc2l6ZSBvZiB0aGUg YXJyYXkgdG8gYSBiYXJlIG1pbmltdW0uICovCisgICAgICAgICAgZm9yIChpbnQgdm50aCA9IDA7 IHZudGggPCB3LT5tY19tYXRyaXgudnBvc191c2VkOyArK3ZudGgpCisgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgIGlmICh3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRb Y2FjaGVfdHlwZV0gPiAxKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdID0KKyAgICAgICAgICAgICAg ICAgICAgeG5yZWFsbG9jICh3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XSwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YgKnctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdKTsKKyAgICAgICAgICAgICAgICAgIHctPm1j X21hdHJpeC52cG9zW3ZudGhdLm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QuZ3JlZW4s IGJhY2tncm91bmQuYmx1ZSk7CisgICAgfQorICBib29sIHJlbW92ZV9wID0gZmFsc2U7CisgIGlm IChkcmF3X3AKKyAgICAgICYmIChmcm9tX3doZXJlID09IFNLSVBQRUQKKyAgICAgICAgICB8fCBm cm9tX3doZXJlID09IFBPU1RfQ0hBTkdFRAorICAgICAgICAgIHx8IGZyb21fd2hlcmUgPT0gVU5D SEFOR0VECisgICAgICAgICAgfHwgZnJvbV93aGVyZSA9PSBTRVRfQ1VSU09SX1RXTykpCisgICAg eworICAgICAgYm9vbCBzYW1lX3AgPSBmYWxzZTsKKyAgICAgIGZvciAoaW50IG50aCA9IDA7IG50 aCA8IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV07ICsrbnRo KQorICAgICAgICB7CisgICAgICAgICAgc2FtZV9wIHw9CisgICAgICAgICAgICAody0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5zYW1lX3AgPT0gdHJ1ZQorICAg ICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF0uZ2x5cGgudHlwZSA9PSBnbHlwaC0+dHlwZQorICAgICAgICAgICAgICYmIHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGguYnl0ZXBvcyA9PSBnbHlw aC0+Ynl0ZXBvcworICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF0uZ2x5cGguY2hhcnBvcyA9PSBnbHlwaC0+Y2hhcnBvcworICAgICAg ICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0u Z2x5cGgudS52YWwgPT0gZ2x5cGgtPnUudmFsCisgICAgICAgICAgIC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ICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhdLmdseXBoLnNsaWNlLmltZy53aWR0aCA9PSBnbHlwaC0+c2xpY2UuaW1nLndpZHRo CisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXS5nbHlwaC5zbGljZS5pbWcuaGVpZ2h0ID09IGdseXBoLT5zbGljZS5pbWcuaGVpZ2h0 CisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXS5nbHlwaC5zbGljZS5jbXAuZnJvbSA9PSBnbHlwaC0+c2xpY2UuY21wLmZyb20KKyAg ICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLnggPT0geAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF0uZnggPT0gZngKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLnkgPT0geQorICAgICAgICAgICAgICYm IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZnkgPT0gZnkK KyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLmhwb3MgPT0gaHBvcworICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0udnBvcyA9PSB2cG9zCisgICAgICAgICAgICAgJiYg dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS53ZCA9PSB3ZAor ICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF0uaCA9PSBoCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXS5jdXJzb3JfdHlwZSA9PSBjdXJzb3JfdHlwZQorICAgICAgICAg ICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uY3Vy c29yX3dpZHRoID09IGN1cnNvcl93aWR0aAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZmcucmVkID09IGZvcmVncm91bmQucmVk CisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXS5mZy5ncmVlbiA9PSBmb3JlZ3JvdW5kLmdyZWVuCisgICAgICAgICAgICAgJiYgdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5mZy5ibHVlID09IGZv cmVncm91bmQuYmx1ZQorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF0uYmcucmVkID09IGJhY2tncm91bmQucmVkCisgICAgICAgICAg ICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5iZy5n cmVlbiA9PSBiYWNrZ3JvdW5kLmdyZWVuCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5iZy5ibHVlID09IGJhY2tncm91bmQuYmx1 ZQorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF0uYWN0aXZlX3AgPT0gYWN0aXZlX3AKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoX2ZsYXZvciA9PSBnbHlw aF9mbGF2b3IKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhdLmVuYWJsZWRfcCA9PSB0cnVlKTsKKyAgICAgICAgfQorICAgICAgaWYg KCFzYW1lX3ApCisgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCBtYXRyaXgsIHJvdywg eCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwgY3Vyc29yX3R5cGUsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGFjdGl2ZV9wLCBn bHlwaF9mbGF2b3IsIHJlbW92ZV9wKTsKKyAgICAgIHJldHVybjsKKyAgICB9CisgICAgZWxzZSBp ZiAoZHJhd19wCisgICAgICAgICAgICAgJiYgKGZyb21fd2hlcmUgPT0gU0NSSUJFX09ORQorICAg ICAgICAgICAgICAgICB8fCBmcm9tX3doZXJlID09IFNDUklCRV9UV08KKyAgICAgICAgICAgICAg ICAgfHwgZnJvbV93aGVyZSA9PSBTQ1JJQkVfVEhSRUUKKyAgICAgICAgICAgICAgICAgfHwgZnJv bV93aGVyZSA9PSBOT1dIRVJFKSkKKyAgICB7CisgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAo dywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsIGN1cnNvcl90 eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgZm9yZWdyb3Vu ZCwgYWN0aXZlX3AsIGdseXBoX2ZsYXZvciwgcmVtb3ZlX3ApOworICAgICAgcmV0dXJuOworICAg IH0KKyAgaWYgKGNhY2hlX3R5cGUgPT0gTk9fQ0FDSEUpCisgICAgcmV0dXJuOworICArK3ctPm1j X21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVfdHlwZV07CisgIGlmICh2bnRoID49IHctPm1jX21h dHJpeC52cG9zX3VzZWQpCisgICAgdy0+bWNfbWF0cml4LnZwb3NfdXNlZCA9IHZudGggKyAxOwor ICBpZiAody0+bWNfbWF0cml4LnZwb3NfYWxsb2NhdGVkIDwgdy0+bWNfbWF0cml4LnZwb3NfdXNl ZCkKKyAgICB7CisgICAgICBpbnQgb2xkX2FsbG9jID0gdy0+bWNfbWF0cml4LnZwb3NfYWxsb2Nh dGVkOworICAgICAgaW50IG5ld19lbHRzID0gdy0+bWNfbWF0cml4LnZwb3NfdXNlZCAtIHctPm1j X21hdHJpeC52cG9zX2FsbG9jYXRlZDsKKyAgICAgIHctPm1jX21hdHJpeC52cG9zID0geHBhbGxv YyAody0+bWNfbWF0cml4LnZwb3MsICZ3LT5tY19tYXRyaXgudnBvc19hbGxvY2F0ZWQsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19lbHRzLCBJTlRfTUFYLCBzaXplb2Yg KnctPm1jX21hdHJpeC52cG9zKTsKKyAgICAgIG1lbXNldCAody0+bWNfbWF0cml4LnZwb3MgKyBv bGRfYWxsb2MsIDAsCisgICAgICAgICAgICAgICAody0+bWNfbWF0cml4LnZwb3NfYWxsb2NhdGVk IC0gb2xkX2FsbG9jKSAqIHNpemVvZiAqdy0+bWNfbWF0cml4LnZwb3MpOworICAgIH0KKyAgKyt3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdOworICBpZiAody0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVkW2NhY2hlX3R5cGVdIDwgdy0+bWNf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXSkKKyAgICB7CisgICAgICBp bnQgb2xkX2FsbG9jID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVkW2Nh Y2hlX3R5cGVdOworICAgICAgaW50IG5ld19lbHRzID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVfdXNlZFtjYWNoZV90eXBlXSAtIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX2Fs bG9jYXRlZFtjYWNoZV90eXBlXTsKKyAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdID0geHBhbGxvYyAody0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICZ3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2Fj aGVfdHlwZV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIG5ld19lbHRzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBJTlRfTUFYLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YgKnctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdKTsKKyAgICAgIG1lbXNldCAody0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV0gKyBvbGRfYWxsb2MsIDAsCisgICAgICAg ICAgICAgICAody0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVkW2NhY2hlX3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FSIGFuZAorICAgICAgICAgICAgICAgTUNfSEJBUiBhcyB0byBgbWMtcmVhbC1mYWtl LWN1cnNvcicuCisgICBNVUxUSVBMRV9DVVJTT1JTOiAgV2UgZG8gbm90IHVzZSB0aGlzIGZ1bmN0 aW9uLgorICAgSE9SSVpPTlRBTF9SVUxFUjogIFdlIHdhbnQgYSB1bml2ZXJzYWwgRlkgY29vcmRp bmF0ZSBmb3IgYSBsZXZlbCBydWxlci4KKyAgIFZFUlRJQ0FMX1JVTEVSIGFuZCBGSUxMX0NPTFVN TjogIFdlIHdhbnQgYW4gSCB0aGF0IGVuc3VyZXMgbm8gZ2FwIGJldHdlZW4gdGhlCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmV2aW91cy9uZXh0IGxpbmUuICBUaGUgRlgg Y29vcmRpbmF0ZSBpcyBzZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVs c2V3aGVyZTogIGB3LT5jdXJzb3IueGAgLyBgbWMuZmNfeGAuICovCit2b2lkCittY19nZXRfY3Vy c29yX2dlb21ldHJ5IChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRy aXgsCisgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCB4 LCBpbnQgKmZ4LCBpbnQgeSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCAqZnksIGludCBo cG9zLCBpbnQgdnBvcywgaW50ICpoLAorICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19j dXJzb3JfdHlwZSBjdXJzb3JfdHlwZSwgaW50IGN1cnNvcl93aWR0aCwKKyAgICAgICAgICAgICAg ICAgICAgICAgIGludCAqd2QpCit7CisgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSBtY19nZXRfY3Vy c29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywgaHBvcywgdnBvcyk7CisgIGlmIChnbHlwaCA9PSBO VUxMKQorICAgIHJldHVybjsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJB TUUgKHcpKTsKKyAgKmZ4ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgeCk7Cisg ICpoID0gcm93LT52aXNpYmxlX2hlaWdodDsKKyAgLyogRG9uJ3QgbGV0IHRoZSBjdXJzb3IgZXhj ZWVkIHRoZSBkaW1lbnNpb25zIG9mIHRoZSByb3csIHNvIHRoYXQKKyAgdGhlIHVwcGVyL2xvd2Vy IHNpZGUgb2YgdGhlIGJveCBhcmVuJ3QgY2xpcHBlZC4gICovCisgIGludCB3X2hlYWRlcl9saW5l X2hlaWdodCA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICBpbnQgd190ZXh0X2Jv dHRvbV95ID0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpIC0gKmg7CisgIGlmICh5IDwgd19oZWFk ZXJfbGluZV9oZWlnaHQpCisgICAgeworICAgICAgKmggPSBtYXggKCpoIC0gKHdfaGVhZGVyX2xp bmVfaGVpZ2h0IC0geSkgKyAxLCAqaCk7CisgICAgICB5ID0gd19oZWFkZXJfbGluZV9oZWlnaHQg LSAxOworICAgICAgLy8gZnByaW50ZiAoc3RkZXJyLCAiQ09ORElUSU9OICMgMVxuIik7CisgICAg fQorICAgZWxzZSBpZiAoeSA+IHdfdGV4dF9ib3R0b21feSkKKyAgICAgeworICAgICAgICpoICs9 IHkgLSB3X3RleHRfYm90dG9tX3k7CisgICAgICAgeSA9IHdfdGV4dF9ib3R0b21feTsKKyAgICAg ICAvLyBmcHJpbnRmIChzdGRlcnIsICJDT05ESVRJT04gIyAyXG4iKTsKKyAgICAgfQorICAqZnkg PSBXSU5ET1dfVE9fRlJBTUVfUElYRUxfWSAodywgeSk7CisgIHN3aXRjaCAoY3Vyc29yX3R5cGUp CisgICAgeworICAgICAgY2FzZSBNQ19CQVI6CisgICAgICAgIHsKKyAgICAgICAgICBpZiAoY3Vy c29yX3dpZHRoIDwgMSkKKyAgICAgICAgICAgIGN1cnNvcl93aWR0aCA9IG1heCAoRlJBTUVfQ1VS U09SX1dJRFRIIChmKSwgMSk7CisgICAgICAgICAgaWYgKGN1cnNvcl93aWR0aCA8IGdseXBoLT5w aXhlbF93aWR0aCkKKyAgICAgICAgICAqd2QgPSBjdXJzb3Jfd2lkdGg7CisgICAgICAgICAgYnJl YWs7CisgICAgICAgIH0KKyAgICAgIGNhc2UgTUNfSEJBUjoKKyAgICAgICAgeworICAgICAgICAg IGludCBjdXJzb3JfaGVpZ2h0ID0gKGN1cnNvcl93aWR0aCA8IDEpID8gbHJpbnQgKDAuMjUgKiAq aCkgOiBjdXJzb3Jfd2lkdGg7CisgICAgICAgICAgaWYgKGN1cnNvcl9oZWlnaHQgPiByb3ctPmhl aWdodCkKKyAgICAgICAgICAgIGN1cnNvcl9oZWlnaHQgPSByb3ctPmhlaWdodDsKKyAgICAgICAg ICAvKiBDdXJzb3Igc21hbGxlciB0aGFuIGxpbmUgaGVpZ2h0LCBzbyBtb3ZlIGRvd24uICovCisg ICAgICAgICAgaWYgKCpoID4gY3Vyc29yX2hlaWdodCkKKyAgICAgICAgICAgICpmeSArPSAqaCAt IGN1cnNvcl9oZWlnaHQ7CisgICAgICAgICAgKmggPSBjdXJzb3JfaGVpZ2h0OworICAgICAgICAg ICp3ZCA9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQor ICAgICAgY2FzZSBNQ19SSUdIVF9GUklOR0VfQklUTUFQOgorICAgICAgY2FzZSBNQ19MRUZUX0ZS SU5HRV9CSVRNQVA6CisgICAgICBjYXNlIE1DX05PX0ZSSU5HRV9CSVRNQVA6CisgICAgICBjYXNl IE1DX05PX0NVUlNPUjoKKyAgICAgIGNhc2UgTUNfRlJBTUVEX0JPWDoKKyAgICAgIGNhc2UgTUNf RklMTEVEX0JPWDoKKyAgICAgIGNhc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y0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAg ICYmIE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgPT0gWlYpOworICBzdHJ1Y3QgZnJhbWUg KmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgTGlzcF9PYmplY3QgYnVmID0gdy0+Y29udGVudHM7 CisgIENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKGJ1 Zik7CisgIGludCB0ZXh0X2FyZWFfd2lkdGggPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FS RUEpOworICBzdHJ1Y3QgZ2x5cGhfcm93ICpjdXJzb3Jfcm93ID0gKHctPmN1cnNvci52cG9zICE9 IC0xKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XIChjdXJz b3JfbWF0cml4LCB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogTlVMTDsKKyAgc3RydWN0IGdseXBoICpjdXJzb3JfZ2x5cGggPSAody0+Y3Vyc29yLnZw b3MgIT0gLTEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY19nZXRfY3Vyc29y X2dseXBoICh3LCBjdXJzb3JfbWF0cml4LCBjdXJzb3Jfcm93LAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLmhwb3MsIHctPmN1 cnNvci52cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTlVMTDsKKyAgYm9v bCBjdXJzb3JfYXRfZnJpbmdlX3AgPSAoY3Vyc29yX2dseXBoID09IE5VTEwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3JvdyAhPSBOVUxMCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID09IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9B UkVBXQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93LT5leGFjdF93 aW5kb3dfd2lkdGhfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1 cnNvci54ID09IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiB3LT5jdXJzb3IueCA9PSBjdXJzb3Jfcm93LT5waXhlbF93aWR0aCk7CisgIGJvb2wgY3Vyc29y X2JleW9uZF9mcmluZ2VfcCA9IChjdXJzb3JfZ2x5cGggPT0gTlVMTAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3JvdyAhPSBOVUxMCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBjdXJzb3Jfcm93LT51c2VkW1RF WFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFjdXJzb3Jfcm93 LT5leGFjdF93aW5kb3dfd2lkdGhfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5jdXJzb3IueCA+PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IGN1cnNvcl9yb3ctPnBpeGVsX3dpZHRo KTsKKyAgaW50IGZyYW1lX2NoYXJfd2lkdGggPSBGUkFNRV9DT0xVTU5fV0lEVEggKGYpOworICBp bnQgdGVtcF9mYWNlX2lkID0gZ2x5cGgtPmZhY2VfaWQ7CisgIHN0cnVjdCBtY19SR0IgYmFja2dy b3VuZDsKKyAgbWNfc2V0X2xzbF9iZyAodywgdGVtcF9mYWNlX2lkLCAmYmFja2dyb3VuZCk7Cisg IGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKG9wb2ludF94ID09IHJlbGF0aXZlX3gKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X2hwb3MgPT0gaHBvcworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeSA9PSByb3ctPnkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgb3BvaW50X3Zwb3MgPT0gdnBvcyk7CisKKy8qIC0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgIEJFR0lOOiAgQ0hBUl9HTFlQSCB8 IEdMWVBITEVTU19HTFlQSCAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KKyAgaWYgKGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgIHx8IGdseXBoLT50 eXBlID09IEdMWVBITEVTU19HTFlQSCkKKyAgeworICAgIGlmIChtY19zdGRlcnJfcCkKKyAgICAg IGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQi ZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICAlM2QgJXMgJXNcbiIsCisgICAgICAgIGds eXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0g PT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisg ICAgICAgIChnbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAgICA/ICdDJworICAgICAg ICAgOiAnRycpLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGds eXBoLT5vYmplY3QpCisgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgt Pm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+ b2JqZWN0KQorICAgICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAor ICAgICAgICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIGdseXBoLT51LmNoLAor ICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwK KyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9zLCBn bHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nIChnbHlw aC0+dS5jaCkpOworICBzd2l0Y2ggKGFjdGlvbl90eXBlKQorICB7CisvKiAtLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgTVVMVElQTEVfQ1VSU09SUzogIENIQVJfR0xZUEgg fCBHTFlQSExFU1NfR0xZUEggICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t ICovCisgICAgY2FzZSBNVUxUSVBMRV9DVVJTT1JTOgorICAgIHsKKyAgICAgIG1jX2hlbHBlciAo dywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3Ms CisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3Jl Z3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9w LCBNQ19HTFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLCBjYWNoZV90eXBlLAorICAgICAgICAgICAg ICAgICBhY3Rpb25fdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgSE9SSVpPTlRBTF9SVUxFUjogIENIQVJfR0xZUEgg fCBHTFlQSExFU1NfR0xZUEggICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t ICovCisgICAgY2FzZSBIT1JJWk9OVEFMX1JVTEVSOgorICAgIHsKKyAgICAgIGlmIChyZWxhdGl2 ZV94IDwgcm93LT5waXhlbF93aWR0aAorICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3Ap CisgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBm eCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90 eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAg ICAgICAgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwg Y2FjaGVfdHlwZSwKKyAgICAgICAgICAgICAgICAgICBhY3Rpb25fdHlwZSk7CisgICAgICBpZiAo Z2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAg ICAgICAgICAmJiByZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAgIHsKKyAgICAgICAgICBp ZiAocmVsYXRpdmVfeCA8IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICB7CisgICAgICAg ICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICBm eCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgICAgbWNfaGVs cGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywg dnBvcywKKyAgICAgICAgICAgICAgICAgICAgIHhfbGltaXQgLSByZWxhdGl2ZV94LCBoLCBjdXJz b3JfdHlwZSwgY3Vyc29yX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZCwg YmFja2dyb3VuZCwgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEhMRVNTLAorICAgICAgICAg ICAgICAgICAgICAgZHJhd19wLCBmcm9tX3doZXJlLCBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7 CisgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAq LworLyogICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIENIQVJfR0xZUEggfCBHTFlQSExF U1NfR0xZUEggICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAg ICBjYXNlIFZFUlRJQ0FMX1JVTEVSOgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBo X2ZsYXZvciA9IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiByb3ctPmNvbnRpbnVlZF9wKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+Y29udGludWVkX3AKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdo dF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FM X0JBUgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2Zy aW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRy dW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9C QVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1 cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXSAhPSAxCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNB TF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoIC0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeCA+PSByb3ctPnBpeGVsX3dpZHRo KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfenZfcCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfR0xZUEg7CisgICAgICBpZiAoZ2x5cGhf Zmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBo X2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAg ICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAg IHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICB8fCBnbHlwaF9m bGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICBjdXJzb3JfdHlwZSA9 IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA7CisgICAgICB3ZCA9IDE7CisgICAgICBtY19oZWxwZXIg KHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgb3BvaW50X2Z4LCB5LCBmeSwgaHBv cywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lk dGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMu YWN0aXZlX3AsIGdseXBoX2ZsYXZvciwgZHJhd19wLCBmcm9tX3doZXJlLCBjYWNoZV90eXBlLAor ICAgICAgICAgICAgICAgICBhY3Rpb25fdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAt LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgRklMTF9DT0xVTU46ICBDSEFS X0dMWVBIIHwgR0xZUEhMRVNTX0dMWVBIICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tICovCisgICAgY2FzZSBGSUxMX0NPTFVNTjoKKyAgICB7CisgICAgICBlbnVtIG1j X2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09 IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBlc3NlbnRpYWxzLmZjX3ggPj0gcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogKGdseXBoX3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6ICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBvcG9pbnRfeSA9PSB5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBvcG9pbnRfdnBvcyA9PSB2cG9zKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIHdkID0gMTsKKyAgICAgIG1jX2hlbHBlciAo dywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmY19meCwgeSwgZnksIGhwb3MsIHZw b3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBm b3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2 ZV9wLCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwKKyAgICAg ICAgICAgICAgICAgYWN0aW9uX3R5cGUpOworICAgICAgYnJlYWs7C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iAoc3RkZXJyLAorICAgICAgICAiXG4gJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJk ICVjICUzZCAweCUwNnggJTRkICUxLjFkJTEuMWQgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5 cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9 PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAg ICAgICAgJ1MnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGds eXBoLT5vYmplY3QpCisgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgt Pm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+ b2JqZWN0KQorICAgICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAor ICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIDB1LAorICAgICAgICBnbHlwaC0+ ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgt PnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpW IiA6ICItLSIsCisgICAgICAgICJcXFMiKTsKKyAgc3dpdGNoIChhY3Rpb25fdHlwZSkKKyAgewor LyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgIE1VTFRJ UExFX0NVUlNPUlM6ICBTVFJFVENIX0dMWVBIICAgICAgICAgICAgICAgICAgICAgKi8KKy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HksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAg IHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5k LAorICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3 X3AsIGZyb21fd2hlcmUsIGNhY2hlX3R5cGUsCisgICAgICAgICAgICAgICAgICAgYWN0aW9uX3R5 cGUpOworICAgICAgaWYgKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVz ZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYgcmVsYXRpdmVfeCA8PSB4X2xpbWl0KQorICAgICAg ICB7CisgICAgICAgICAgaWYgKHJlbGF0aXZlX3ggPCByb3ctPnBpeGVsX3dpZHRoKQorICAgICAg ICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgdGVtcF9m YWNlX2lkID0gKHJvdy0+ZmlsbF9saW5lX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgPyBn bHlwaC0+ZmFjZV9pZAorICAgICAgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lE OworICAgICAgICAgIHN0cnVjdCBtY19SR0IgYmFja2dyb3VuZDsKKyAgICAgICAgICBtY19zZXRf bHNsX2JnICh3LCB0ZW1wX2ZhY2VfaWQsICZiYWNrZ3JvdW5kKTsKKyAgICAgICAgICBtY19oZWxw ZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2 cG9zLAorICAgICAgICAgICAgICAgICAgICAgeF9saW1pdCAtIHJlbGF0aXZlX3gsIGgsIGN1cnNv cl90eXBlLCB4X2xpbWl0IC0gcmVsYXRpdmVfeCwKKyAgICAgICAgICAgICAgICAgICAgIGZvcmVn cm91bmQsIGJhY2tncm91bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBITEVTUywKKyAg ICAgICAgICAgICAgICAgICAgIGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwgYWN0aW9u X3R5cGUpOworICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIFNU UkVUQ0hfR0xZUEggICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t ICovCisgICAgY2FzZSBWRVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAgICBpZiAocm93LT5maWxs X2xpbmVfcAorICAgICAgICAgICYmIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSBy b3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYgb3BvaW50X3ggPiByZWxhdGl2ZV94ICsg Z2x5cGgtPnBpeGVsX3dpZHRoKQorICAgICAgICB0ZW1wX2ZhY2VfaWQgPSBnbHlwaC0+ZmFjZV9p ZDsKKyAgICAgICAgZWxzZSBpZiAoIXJvdy0+ZmlsbF9saW5lX3AKKyAgICAgICAgICAgICAgICAg JiYgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEK KyAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3ggPiByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVs X3dpZHRoKQorICAgICAgICAgIHRlbXBfZmFjZV9pZCA9IERFRkFVTFRfRkFDRV9JRDsKKyAgICAg IHN0cnVjdCBtY19SR0IgYmFja2dyb3VuZDsKKyAgICAgIG1jX3NldF9sc2xfYmcgKHcsIHRlbXBf ZmFjZV9pZCwgJmJhY2tncm91bmQpOworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9y ID0gKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVk X29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNf VkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IChjdXJzb3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdI VF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2Jl eW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg Y3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSExFU1M7CisgICAg ICBpZiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAg ICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJS T1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFT SAorICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAg ICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICBj dXJzb3JfdHlwZSA9IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA7CisgICAgICB3ZCA9IDE7CisgICAg ICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgb3BvaW50X3gsIG9wb2ludF9meCwg eSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwg Y3Vyc29yX3dpZHRoLCBmb3JlZ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ICAgICAgICAgICAgICAgIEVORDogIFNUUkVUQ0hfR0xZUEggICAgICAgICAg ICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisKKy8qIC0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCRUdJTjog IElNQUdFX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0gKi8KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgIHsK KyAgICBpZiAobWNfc3RkZXJyX3ApCisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICJc biAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4x ZCAgJTNkICVzICVjXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0s CisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAt IDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAnSScsCisgICAgICAgIGdseXBoLT5j aGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0In CisgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycK KyAgICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICA/ICcw JworICAgICAgICAgICAgICAgOiAnLScpKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwK KyAgICAgICAgKHVuc2lnbmVkIGludCkgZ2x5cGgtPnUuaW1nX2lkLAorICAgICAgICBnbHlwaC0+ ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgt PnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpW IiA6ICItLSIsCisgICAgICAgICcuJyk7CisgIHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsKKy8q IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgTVVMVElQ TEVfQ1VSU09SUzogIElNQUdFX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIE1VTFRJUExFX0NVUlNPUlM6CisgICAgeworICAg ICAgY3Vyc29yX3R5cGUgPSBNQ19IT0xMT1dfQk9YOworICAgICAgbWNfaGVscGVyICh3LCBtYXRy aXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAg ICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQs IGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dM WVBILCBkcmF3X3AsIGZyb21fd2hlcmUsIGNhY2hlX3R5cGUsCisgICAgICAgICAgICAgICAgIGFj dGlvbl90eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAq LworLyogICAgICAgICAgICAgICAgICAgICAgICAgSE9SSVpPTlRBTF9SVUxFUjogIElNQUdFX0dM WVBIICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAg ICBjYXNlIEhPUklaT05UQUxfUlVMRVI6CisgICAgeworICAgICAgY3Vyc29yX3R5cGUgPSBNQ19I T0xMT1dfQk9YOworICAgICAgaWYgKCFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hl bHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3Ms IHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lk dGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgICAgZXNzZW50aWFs cy5hY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwKKyAg ICAgICAgICAgICAgICAgICBhY3Rpb25fdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAt LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgVkVSVElD QUxfUlVMRVI6ICBJTUFHRV9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBWRVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAgICBj dXJzb3JfdHlwZSA9IE1DX0hPTExPV19CT1g7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwg cm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAg ICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYmFj a2dyb3VuZCwKKyAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEgs IGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwKKyAgICAgICAgICAgICAgICAgYWN0aW9u X3R5cGUpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisv KiAgICAgICAgICAgICAgICAgICAgICAgICAgICBGSUxMX0NPTFVNTjogIElNQUdFX0dMWVBIICAg ICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNh c2UgRklMTF9DT0xVTU46CisgICAgeworICAgICAgY3Vyc29yX3R5cGUgPSBNQ19IT0xMT1dfQk9Y OworICAgICAgbWNfaGVscGVyICh3LCBtYX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tLS0tLSAqLwor LyogICAgICAgICAgICAgICAgICAgICAgICAgICAgQkVHSU46ICBDT01QT1NJVEVfR0xZUEggICAg ICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgZWxz ZSBpZiAoZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKQorICB7CisgICAgaWYgKG1jX3N0 ZGVycl9wKQorICAgICAgeworICAgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICAgIlxu ICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4IiwKKyAgICAgICAgICBn bHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgKChyb3ctPnVzZWRbYXJl YV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgICAgcmVsYXRpdmVf eCwKKyAgICAgICAgICAnKycsCisgICAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgICAg KEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgID8gJ0InCisgICAgICAgICAgIDog KFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAg ICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICAgID8gJzAnCisgICAg ICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAg ICAgICAgICAodW5zaWduZWQgaW50KSBnbHlwaC0+dS5jbXAuaWQpOworICAgICAgICBmcHJpbnRm IChzdGRlcnIsICIgJTRkICUxLjFkJTEuMWQiLAorICAgICAgICAgIGdseXBoLT5mYWNlX2lkLAor ICAgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgICAgZ2x5cGgtPnJpZ2h0 X2JveF9saW5lX3ApOworICAgICAgaWYgKGdseXBoLT51LmNtcC5hdXRvbWF0aWMpCisgICAgICAg IGZwcmludGYgKHN0ZGVyciwgIiAgJTNkICVzIC4gWyVkLSVkXVxuIiwKKyAgICAgICAgICAgICAg ICAgICAgICAgICBnbHlwaC0+aHBvcywgZ2x5cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAg ICAgICAgICAgICAgICAgICAgIGdseXBoLT5zbGljZS5jbXAuZnJvbSwgZ2x5cGgtPnNsaWNlLmNt cC50byk7CisgICAgICAgIGVsc2UKKyAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJcbiIpOwor ICAgICAgfQorICBzd2l0Y2ggKGFjdGlvbl90eXBlKQorICB7CisvKiAtLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTOiAgQ09NUE9T SVRFX0dMWVBIICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICov CisgICAgY2FzZSBNVUxUSVBMRV9DVVJTT1JTOgorICAgIHsKKyAgICAgIG1jX2hlbHBlciAodywg bWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisg ICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3Jv dW5kLCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzL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Wl0KQorICAgICAgICB7CisgICAgICAgICAgcmVsYXRpdmVfeCAr PSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgd2hpbGUgKHJlbGF0aXZlX3ggPD0geF9s aW1pdCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgs IHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAg ICAgICAgICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdy b3VuZCwgYmFja2dyb3VuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFj dGl2ZV9wLCBNQ19HTFlQSExFU1MsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAg ICAgICAgICAgICBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICAgICAgICAgIHJlbGF0 aXZlX3ggKz0gZnJhbWVfY2hhcl93aWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAg ICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAg ICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIENPTVBPU0lURV9HTFlQSCAgICAgICAgICAg ICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgVkVSVElDQUxf UlVMRVI6CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1cnNv cl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJv dy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g TUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0 X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxf QkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChj dXJzb3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmlu Z2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jv dy0+dXNlZFtURVhUX0FSRUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FS RUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIG9wb2ludF94ID49IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF96dl9wKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfVkVS VElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JF VkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZv ciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9y ID09IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZF UlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAgIGN1cnNvcl90eXBlID0gTUNfUklHSFRfRlJJTkdF X0JJVE1BUDsKKyAgICAgIHdkID0gMTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3cs IGdseXBoLCByZWxhdGl2ZV94LCBvcG9pbnRfZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAg ICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwg YmFja2dyb3VuZCwKKyAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVfcCwgZ2x5cGhf Zmxhdm9yLCBkcmF3X3AsIGZyb21fd2hlcmUsCisgICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUs IGFjdGlvbl90eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgIEZJTExfQ09MVU1OOiAgQ09NUE9TSVRF X0dMWVBIICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8K KyAgICBjYXNlIEZJTExfQ09MVU1OOgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBo X2ZsYXZvciA9IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2Fy ZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlh bHMuZmNfeCA+IHJlbGF0aXZlX3gpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IChnbHlwaF96dl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1D X0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoIU5JTFAg KEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfdmVydGljYWxf cnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50 X3kgPT0geQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50 X3Zwb3MgPT0gdnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBN Q19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfR0xZ UEg7CisgICAgICB3ZCA9IDE7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlw aCwgcmVsYXRpdmVfeCwgZmNfZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAg ICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYmFja2dyb3Vu ZCwKKyAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCBk cmF3X3AsIGZyb21fd2hlcmUsIGNhY2hlX3R5cGUsCisgICAgICAgICAgICAgICAgIGFjdGlvbl90 eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAg IGNhc2UgQ1VSU09SX0lORElDQVRPUj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uMWQlMS4xZCAg JTNkICVzICVjXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisg ICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEp LAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAnWCcsCisgICAgICAgIGdseXBoLT5jaGFy cG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0InCisg ICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAg ICAgICAgICAgIDogJy0nKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAg Z2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAg IGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+dS54d2lkZ2V0LAorICAg ICAgICBnbHlwaC0+aHBvcywgZ2x5cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAnLicp OworI2VuZGlmCisgIHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTOiAgWFdJ REdFVF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0g Ki8KKyAgICBjYXNlIE1VTFRJUExFX0NVUlNPUlM6CisgICAgeworICAgICAgbWNfaGVscGVyICh3 LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywK KyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVn cm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZlX3As IE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUsIGNhY2hlX3R5cGUsCisgICAgICAgICAgICAg ICAgIGFjdGlvbl90eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICBIT1JJWk9OVEFMX1JVTEVSOiAgWFdJ REdFVF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0g Ki8KKyAgICBjYXNlIEhPUklaT05UQUxfUlVMRVI6CisgICAgeworICAgICAgaWYgKHJlbGF0aXZl X3ggPD0geF9saW1pdAorICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAg IG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnks IGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJz b3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgICAgZXNz ZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlw ZSwKKyAgICAgICAgICAgICAgICAgICBhY3Rpb25fdHlwZSk7CisgICAgICBpZiAoZ2x5cGggLSBy b3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAm JiByZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAgIHsKKyAgICAgICAgICByZWxhdGl2ZV94 ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICB3aGlsZSAocmVsYXRpdmVfeCA8PSB4 X2xpbWl0KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJp eCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAg ICAgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3Jl Z3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMu YWN0aXZlX3AsIE1DX0dMWVBITEVTUywgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAg ICAgICAgICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgICAgICAgICAgcmVs YXRpdmVfeCArPSBmcmFtZV9jaGFyX3dpZHRoOworICAgICAgICAgICAgfQorICAgICAgICB9Cisg ICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAg ICAgICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIFhXSURHRVRfR0xZUEggICAgICAgICAg ICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBWRVJUSUNB TF9SVUxFUjoKKyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoY3Vy c29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg cm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmICFyb3ctPmNvbnRpbnVlZF9wCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmln aHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNB TF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog KGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9X CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5b25kX2Zy aW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jf cm93LT51c2VkW1RFWFRfQVJFQV0gIT0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRf QVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgb3BvaW50X3ggPj0gcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX3p2X3ApCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19W RVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNf UkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxh dm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAg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ICAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID4gcmVs YXRpdmVfeCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQ SExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX3p2X3Ap CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICghTklMUCAoQlZBUiAoYiwgY3Jv c3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklM UCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeSA9PSB5CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfdnBvcyA9PSB2cG9z KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIG1j X2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmY19meCwgeSwgZnks IGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29y X3dpZHRoLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICBlc3NlbnRp YWxzLmFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAg ICAgICAgICAgY2FjaGVfdHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAgYnJlYWs7Cisg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0gbWNfZnJvbV93aGVyZSBmcm9tX3doZXJlKQorewor ICAvLyAgY2xvY2tfdCBjbG9ja19zdGFydCA9IGNsb2NrKCk7CisgIC8qIFczMiBFbWFjcyBjcmFz aGVzIG9uIHN0YXJ0dXAgd2l0aG91dCBhIGBCVUZGRVJQJyBjaGVjayBpbiBgdXBkYXRlX3dpbmRv dycuICovCisgIGlmICghQlVGRkVSUCAody0+Y29udGVudHMpKQorICAgIHJldHVybjsKKyAgaWYg KE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAmJiBO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgJiYg TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpCisgICAgcmV0 dXJuOworICBpZiAodnBvcyA9PSBib3R0b21fdnBvcykKKyAgICByZXR1cm47CisgIGlmICghcm93 LT51c2VkW1RFWFRfQVJFQV0pCisgICAgcmV0dXJuOworICBpbnQgaHBvc19zdGFydCA9IHN0YXJ0 IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgaWYgKHRyYWNlX3JlZGlzcGxheV9wKQorICAg IGZwcmludGYgKHN0ZGVyciwgIm1jX2RyYXdfcm93ICglZCk6ICBkcmF3X3AgKCVzKSB8IGhwb3Mg KCVkKSB8IGxlbiAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgdnBvcywgZHJhd19wID8g InkiIDogIm4iLCBocG9zX3N0YXJ0LCBocG9zX2xlbmd0aCk7CisgIExpc3BfT2JqZWN0IGJ1ZiA9 IHctPmNvbnRlbnRzOworICBDSEVDS19CVUZGRVIgKGJ1Zik7CisgIHN0cnVjdCBidWZmZXIgKmIg PSBYQlVGRkVSIChidWYpOworICBpbnQgb3BvaW50X2Z4LCBvcG9pbnRfZnksIG9wb2ludF93ZCwg b3BvaW50X2g7CisgIGludCB0ZXh0X2FyZWFfd2lkdGggPSB3aW5kb3dfYm94X3dpZHRoICh3LCBU RVhUX0FSRUEpOworICBpbnQgaGVhZGVyX2xpbmVfZm9ybWF0ID0gV0lORE9XX0hFQURFUl9MSU5F X0hFSUdIVCAodyk7CisgIHN0cnVjdCBnbHlwaF9yb3cgKmN1cnNvcl9yb3cgPSAody0+Y3Vyc29y LnZwb3MgIT0gLTEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1BVFJJWF9S T1cgKGN1cnNvcl9tYXRyaXgsIHctPmN1cnNvci52cG9zKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiBOVUxMOworICBzdHJ1Y3QgZ2x5cGggKmN1cnNvcl9nbHlwaCA9ICh3LT5j dXJzb3IudnBvcyAhPSAtMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IG1jX2dl dF9jdXJzb3JfZ2x5cGggKHcsIGN1cnNvcl9tYXRyaXgsIGN1cnNvcl9yb3csCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5jdXJzb3IuaHBv cywgdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOVUxM OworICBib29sIGN1cnNvcl9hdF9mcmluZ2VfcCA9IChjdXJzb3JfZ2x5cGggPT0gTlVMTAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93ICE9IE5VTEwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gY3Vyc29yX3Jvdy0+dXNl ZFtURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3ct PmV4YWN0X3dpbmRvd193aWR0aF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgdy0+Y3Vyc29yLnggPT0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHctPmN1cnNvci54ID09IGN1cnNvcl9yb3ctPnBpeGVsX3dpZHRoKTsKKyAgYm9v bCBjdXJzb3JfYmV5b25kX2ZyaW5nZV9wID0gKGN1cnNvcl9nbHlwaCA9PSBOVUxMCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93ICE9IE5VTEwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID09IGN1cnNvcl9yb3ct PnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIWN1 cnNvcl9yb3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHRleHRfYXJlYV93aWR0aAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0gY3Vyc29yX3Jvdy0+cGl4 ZWxfd2lkdGgpOworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAg ICAgICAgIFJFUExBQ0UgVEhFIFJFQUwgQ1VSU09SCisqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KyAgZW51bSBmYWNlX2lkIGJnX2ZhY2VfaWQgPSAoY3Vyc29yX2dseXBoICE9IE5VTEwpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBjdXJzb3JfZ2x5cGgtPmZhY2VfaWQKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgc3RydWN0IG1jX1JHQi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gY2hfdmVydGljYWxfcnVsZXIpKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIGZjX3Zpc2libGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IHctPmN1cnNvci54ID09IGVzc2VudGlhbHMuZmNfeAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmICFjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiAhY3Vyc29yX2JleW9uZF9mcmluZ2VfcCk7CisgIC8qIFdlIHVzZSBhIHRlc3Qgc2lt aWxhciB0byB0aGUgcmVhbCBmYWtlIGN1cnNvciBzbyB0aGF0IHRoZSBmcmluZ2UgYml0bWFwIGlz CisgIG9ubHkgZHJhd24gb25jZSBwZXIgd2luZG93LiAqLworICBpZiAodnBvcyA9PSB3LT5jdXJz b3IudnBvcworICAgICAgJiYgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoID09IHJvdy0+dXNlZFtU RVhUX0FSRUFdCisgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBj cm9zc2hhaXJzKSkKKyAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGNoX2hvcml6b250YWxfcnVsZXIpKSkKKyAgICB7CisgICAgICAvKiBmcmluZ2UgYml0bWFwcyB1 c2UgZmFjZV9pZCB0byBzZXQgdGhlIGZvcmVncm91bmQgY29sb3IuICBUaGUgb3ZlcmxheS1hcnJv dworICAgICAgaXMgcHJlc2VudGx5IHRoZSBvbmx5IHNpdHVhdGlvbiB3aGVyZSB0aGUgYGVzc2Vu dGlhbHMuYWN0aXZlX3BgIGFuZCBgbWluaW1hbF9wYCBhcmUKKyAgICAgIHVzZWQgdG8gZGV0ZXJt aW5lIHRoZSBhcHBsaWNhYmxlIGZhY2VfaWQuICovCisgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9m ZyA9IHsucmVkID0gLTEuMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9 IC0xLjAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IC0xLjB9OworICAg ICAgLyogV2UgdXNlIHRoZSBmaXJzdCBnbHlwaCBpbiB0aGUgcm93LCB3aXRoIGFuIFggYW5kIEhQ T1Mgb2YgemVyby4gKi8KKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIHJvdy0+Z2x5 cGhzW1RFWFRfQVJFQV0sIDAsIC0xLCB3LT5jdXJzb3IueSwgLTEsCisgICAgICAgICAgICAgICAg IDAsIHctPmN1cnNvci52cG9zLCAtMSwgLTEsIE1DX0xFRlRfRlJJTkdFX0JJVE1BUCwgLTEsCisg ICAgICAgICAgICAgICAgIGxzbF9mZywgY3Vyc29yX2JnLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBN Q19PVkVSTEFZX0FSUk9XX0JJVE1BUCwgZHJhd19wLAorICAgICAgICAgICAgICAgICBmcm9tX3do ZXJlLCBDSF9DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgfQorICBpZiAoY3Vyc29yX2F0 X2ZyaW5nZV9wCisgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAmJiB3LT5j dXJzb3IuaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBocG9z X3N0YXJ0ICsgaHBvc19sZW5ndGgKKyAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgY2hfaG9yaXpvbnRhbF9ydWxlcikpKQorICAgIHsKKyAgICAgIGVudW0gbWNf Zmxhdm9yIGdseXBoX2Zs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T0gcm93LT51c2VkW1RFWFRf QVJFQV0KKyAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg Y3Jvc3NoYWlycykpCisgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIGNoX2hvcml6b250YWxfcnVsZXIpKSkKKyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZv ciBnbHlwaF9mbGF2b3IgPSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9X OworICAgICAgc3RydWN0IGdseXBoICpnbHlwaCA9IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07Cisg ICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoX2VuZCA9IGdseXBoICsgcm93LT51c2VkW1RFWFRfQVJF QV07CisgICAgICAvKiBHbHlwaCBmb3IgYSBsaW5lIGVuZCBpbiB0ZXh0LiAqLworICAgICAgaWYg KGdseXBoID09IGdseXBoX2VuZCAmJiBnbHlwaC0+Y2hhcnBvcyA+IDApCisgICAgICAgICsrZ2x5 cGhfZW5kOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGhfZW5kIC0gMSwg cm93LT5waXhlbF93aWR0aCwgLTEsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICAtMSwg cm93LT51c2VkW1RFWFRfQVJFQV0gLSAxLCB3LT5jdXJzb3IudnBvcywgLTEsIC0xLAorICAgICAg ICAgICAgICAgICBNQ19SSUdIVF9GUklOR0VfQklUTUFQLCAtMSwgY3Vyc29yX2ZnLCBjdXJzb3Jf YmcsIGVzc2VudGlhbHMuYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwg ZHJhd19wLCBmcm9tX3doZXJlLCBDSF9DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgfQor ICAvKiBFWEFNUExFIChidWZmZXItbG9j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Nvci54LCBvcG9p bnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICBvcG9pbnRfZnksIHctPmN1cnNv ci5ocG9zLCB3LT5jdXJzb3IudnBvcywgb3BvaW50X3dkLCBvcG9pbnRfaCwKKyAgICAgICAgICAg ICAgICAgTUNfQkFSLCAxLCBjdXJzb3JfZmcsIGN1cnNvcl9iZywgZXNzZW50aWFscy5hY3RpdmVf cCwgTUNfR0xZUEhMRVNTLAorICAgICAgICAgICAgICAgICBkcmF3X3AsIGZyb21fd2hlcmUsIE5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBDSF9DQUNIRQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogTUNfQ0FDSEUsIENVUlNPUl9JTkRJQ0FUT1IpOworICAgICAgbWNf Z2V0X2N1cnNvcl9nZW9tZXRyeSAodywgbWF0cml4LCByb3csIHctPmN1cnNvci54LCAmb3BvaW50 X2Z4LCB3LT5jdXJzb3IueSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZvcG9pbnRf ZnksIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgTUNfSEJBUiwgMSwgJm9wb2ludF93ZCk7CisgICAgICBtY19o ZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1cnNvci54LCBvcG9pbnRf ZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICBvcG9pbnRfZnksIHctPmN1cnNvci5o cG9zLCB3LT5jdXJzb3IudnBvcywgb3BvaW50X3dkLCBvcG9pbnRfaCwKKyAgICAgICAgICAgICAg ICAgTUNfSEJBUiwgMSwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsIGVzc2VudGlhbHMuYWN0aXZlX3As IE1DX0dMWVBILCBkcmF3X3AsCisgICAgICAgICAgICAgICAgIGZyb21fd2hlcmUsIE5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19D QUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgfQorICBlbHNlIGlmICghY3Vyc29yX2F0X2Zy aW5nZV9wCisgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICYm IHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPj0g aHBvc19zdGFydAorICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA8IGhwb3Nfc3RhcnQgKyBo cG9zX2xlbmd0aAorICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPnR5cGUgIT0gU1RSRVRDSF9H TFlQSCkKKyAgICB7CisgICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJv dywgdy0+Y3Vyc29yLngsICZvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJm9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9z LCAmb3BvaW50X2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwg Y3Vyc29yX3dpZHRoLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCBy b3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisg ICAgICAgICAgICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9z LCBvcG9pbnRfd2QsIG9wb2ludF9oLAorICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vy c29yX3dpZHRoLCBjdXJzb3JfZmcsIGN1cnNvcl9iZywgZXNzZW50aWFscy5hY3RpdmVfcCwKKyAg ICAgICAgICAgICAgICAgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwgTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBDSF9DQUNIRQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0NBQ0hFLCBDVVJTT1JfSU5ESUNBVE9SKTsK KyAgICB9CisgIGVsc2UgaWYgKCFjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgJiYgY3Vy c29yX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcwor ICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICYm IHctPmN1cnNvci5ocG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoCisgICAgICAgICAgICYm IGN1cnNvcl9nbHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKQorICAgIHsKKyAgICAgIC8qIElm IGEgdXNlciBoYXMgc2V0IGB4LXN0cmV0Y2gtY3Vyc29yJyB0byBhIG5vbi1uaWwgdmFsdWUsIGhl L3NoZSBjaG9zZSB0bworICAgICAgaGF2ZSBhIGN1cnNvciB0aGF0IHNwYW5zIHRoZSBlbnRpcmUg bGVuZ3RoIG9mIHRoZSBTVFJFVENIX0dMWVBILiAqLworICAgICAgaWYgKCF4X3N0cmV0Y2hfY3Vy c29yX3ApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUaGUgTUNfSEJBUiBzaGFsbCBoYXZlIGEg YGN1cnNvcl93aWR0aGAgb2YgMS4gKi8KKyAgICAgICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5 ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRfZngsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLnksICZvcG9pbnRfZnksIHctPmN1cnNvci5o cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci52cG9zLCAm b3BvaW50X2gsIE1DX0hCQVIsIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg Jm9wb2ludF93ZCk7CisgICAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgY3Vyc29y X2dseXBoLCB3LT5jdXJzb3IueCwgb3BvaW50X2Z4LAorICAgICAgICAgICAgICAgICAgICAgdy0+ Y3Vyc29yLnksIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLAorICAg ICAgICAgICAgICAgICAgICAgb3BvaW50X3dkLCBvcG9pbnRfaCwgTUNfSEJBUiwgMSwgY3Vyc29y X2ZnLCBjdXJzb3JfYmcsCisgICAgICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9w LCBNQ19HTFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICAgICAgTklM UCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAgICAgICAgICAg ICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAgICAgICAgICAgIDogTUNfQ0FDSEUsIENVUlNP Ul9JTkRJQ0FUT1IpOworICAgICAgICB9CisgICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3 LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRfZngsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICB3LT5jdXJzb3IueSwgJm9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLCBj dXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwg Jm9wb2ludF93ZCk7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBjdXJzb3JfZ2x5 cGgsIHctPmN1cnNvci54LCBvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAg ICBvcG9pbnRfZnksIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgb3BvaW50X3dkLCBv cG9pbnRfaCwKKyAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgY3Vy c29yX2ZnLCBjdXJzb3JfYmcsIGVzc2VudGlhbHMuYWN0aXZlX3AsCisgICAgICAgICAgICAgICAg IE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUsIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiBNQ19DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgfQorLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgIERSQVcgQU5EIFJF Q09SRCBGQUtFIENVUlNPUlMKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICBpZiAoaHBvc19s ZW5ndGggPT0gMSkKKyAgICB7CisgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgbWNfY29uZikpKQorICAgICAgICB7CisgICAgICAgICAgLyogVGhlIHNwYWNlIGFw cGVuZGVkIHRvIGEgcm93IGVuZGluZyB3aXRoIGEgbmV3IGxpbmUKKyAgICAgICAgICBkb2VzIG5v dCBoYXZlIGEgYGdseXBoLT5jaGFycG9zYCAoLTEsIDApIHRoYXQgd2UgY2FuCisgICAgICAgICAg dXNlIGZvciB0aGlzIHBhcnRpY3VsYXIgYXBwbGljYXRpb24uICBXaGVuIHRoZXJlIGlzIGEKKyAg ICAgICAgICBgYnVmZmVyLWRpc3BsYXktdGFibGUnIGVudHJ5IHRoYXQgYXNzaWducyBhIHZpc2li bGUKKyAgICAgICAgICBnbHlwaCB0byBhIG5ldyBsaW5lLCB0aGVyZSBpcyBubyBwcm9ibGVtIGJl Y2F1c2UgdGhhdAorICAgICAgICAgIGdseXBoIGhhcyBhIGBnbHlwaC0+Y2hhcnBvcycgdGhhdCB3 ZSBjYW4gdXNlLiAgV2hlbgorICAgICAgICAgIG5vIHZpc2libGUgRU9MIGdseXBoIGV4aXN0cywg d2UgdXNlIHRoZSBmb2xsb3dpbmcKKyAgICAgICAgICB0ZXN0OiAgdGhlIGFwcGVuZGVkIHNwYWNl IGhhcyBhIHBvc2l0aW9uIHRoYXQgaXMgb25lCisgICAgICAgICAgbGVzcyB0aGFuIHRoZSBlbmQg b2YgdGhlIG1hdHJpeCByb3cuICovCisgICAgICAgICAgaW50IGhwb3MgPSBzdGFydCAtIHJvdy0+ Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICAgICAgc3RydWN0IGdseXBoICpwcmV2aW91c19nbHlw aCA9ICgwIDw9IGhwb3MgLSAxICYmIGhwb3MgLSAxIDwgcm93LT51c2VkW1RFWFRfQVJFQV0pCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gcm93LT5nbHlwaHNbVEVY VF9BUkVBXSArIGhwb3MgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogTlVMTDsKKyAgICAgICAgICAvLyBzdHJ1Y3QgZ2x5cGggKmxhc3RfZ2x5cGggPSByb3ct PmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxOworICAgICAgICAg IGJvb2wgc2tpcF9wID0gKHByZXZpb3VzX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBwcmV2aW91c19nbHlwaC0+Y2hhcnBvcyA9PSBNQVRSSVhfUk9XX0VORF9DSEFS UE9TIChyb3cpIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICYmIHN0YXJ0LT5ieXRlcG9z ICE9IGVzc2VudGlhbHMuenZfYnl0ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgPyB0cnVl CisgICAgICAgICAgICAgICAgICAgICAgICAvKiBXaGVuIGEgYGJ1ZmZlci1kaXNwbGF5LXRhYmxl JyBlbnRyeSBjb250YWlucworICAgICAgICAgICAgICAgICAgICAgICAgYSB2aXNpYmxlIHRhYiBj aGFyYWN0ZXIgKCLCuyIpLCB0aGUgc3Vic2VxdWVudAorICAgICAgICAgICAgICAgICAgICAgICAg U1RSRVRDSF9HTFlQSCB3aWxsIGhhdmUgdGhlIHNhbWUgc3RhcnQtPmNoYXJwb3MKKyAgICAgICAg ICAgICAgICAgICAgICAgIGFzIHRoZSBhZm9yZW1lbnRpb25lZCB2aXNpYmxlIHRhYiBjaGFyYWN0 ZXIuICovCisgICAgICAgICAgICAgICAgICAgICAgICA6IChwcmV2aW91c19nbHlwaCAhPSBOVUxM CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBwcmV2aW91c19nbHlwaC0+Y2hhcnBvcyA9 PSBzdGFydC0+Y2hhcnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgPyB0cnVlCisgICAg ICAgICAgICAgICAgICAgICAgICA6IGZhbHNlOworICAgICAgICAgIGludCBwb3NpbnQgPSAocm93 X3Bvc2l0aW9uID09IFBPU1RfWlYpCisgICAgICAgICAgICAgICAgICAgICAgICAgPyAtMQorICAg ICAgICAgICAgICAgICAgICAgICA6IChyb3dfcG9zaXRpb24gPT0gQVRfWlYpCisgICAgICAgICAg ICAgICAgICAgICAgICAgID8gZXNzZW50aWFscy56dgorICAgICAgICAgICAgICAgICAgICAgICA6 IChzdGFydC0+Ynl0ZXBvcyAhPSBlc3NlbnRpYWxzLnp2X2J5dGUKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFtU RVhUX0FSRUFdIC0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICA/IE1BVFJJWF9ST1dfRU5E X0NIQVJQT1MgKHJvdykgLSAxCisgICAgICAgICAgICAgICAgICAgICAgIDogKHN0YXJ0LT5ieXRl cG9zID09IGVzc2VudGlhbHMuenZfYnl0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBz dGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW1RFWFRfQVJFQV0gLSAx KQorICAgICAgICAgICAgICAgICAgICAgICAgID8gZXNzZW50aWFscy56dgorICAgICAgICAgICAg ICAgICAgICAgICA6IHN0YXJ0LT5jaGFycG9zOworICAgICAgICAgIExpc3BfT2JqZWN0IHNwZWNz ID0gbWNfYXNzb2MgKG1ha2VfZml4bnVtIChwb3NpbnQpLCBCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIG1jX2NvbmYpKTsKKyAgICAgICAgICBpZiAoKChoZWFkZXJfbGluZV9mb3JtYXQgPiAw ICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDAp CisgICAgICAgICAgICAgICYmICFOSUxQIChzcGVjcykKKyAgICAgICAgICAgICAgJiYgcm93LT55 IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAgICAgICAgICAmJiAhc2tpcF9wCisg ICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiAhPSBQT1NUX1pWKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICBMaXNwX09iamVjdCBsaXNwX3R5cGUgPSBtY19udGggKDEsIHNwZWNzKTsK KyAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSA9IChDT05TUCAo bGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID8gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoWENBUiAobGlzcF90eXBlKSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogbWNfbGlzcF90b19jdXJz b3JfdHlwZSAobGlzcF90eXBlKTsKKyAgICAgICAgICAgICAgY3Vyc29yX3R5cGUgPSAoc3RhcnQt PnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19I T0xMT1dfQk9YCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBjdXJzb3JfdHlwZTsKKyAg ICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aCA9IChDT05TUCAobGlzcF90eXBlKSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gWEZJWE5VTSAoWENBUiAoWENEUiAobGlzcF90 eXBlKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IC0xOworICAgICAgICAg ICAgICBMaXNwX09iamVjdCBtY19mb3JlZ3JvdW5kID0gbWNfbnRoICgyLCBzcGVjcyk7CisgICAg ICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAgICAgICAgICAgICBpZiAoU1RSSU5H UCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAgbWNfeHdfY29sb3JfdmFsdWVzICh3 LCBtY19mb3JlZ3JvdW5kLCAmbHNsX2ZnKTsKKyAgICAgICAgICAgICAgICBlbHNlIGlmIChWRUNU T1JQIChtY19mb3JlZ3JvdW5kKSkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg ICAgICAgbHNsX2ZnLnJlZCA9IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3JvdW5kLCAwKSk7 CisgICAgICAgICAgICAgICAgICAgIGxzbF9mZy5ncmVlbiA9IFhGTE9BVF9EQVRBIChBUkVGICht Y19mb3JlZ3JvdW5kLCAxKSk7CisgICAgICAgICAgICAgICAgICAgIGxzbF9mZy5ibHVlID0gWEZM T0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDIpKTsKKyAgICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKE5JTFAgKG1jX2ZvcmVncm91bmQpKQorICAgICAg ICAgICAgICAgICAgICBtY19jb2xvcl9waWNrZXIgKHcsIHN0YXJ0LCBlc3NlbnRpYWxzLCAmbHNs X2ZnLCBwb3NpbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vy c29yX3R5cGUsIHJvd19wb3NpdGlvbiwgTVVMVElQTEVfQ1VSU09SUyk7CisgICAgICAgICAgICAg IGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgICAgICAgICAgICAg IGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAg ICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgc3RhcnQsIFRFWFRfQVJFQSwgeCwgeF9s aW1pdCwgcm93LT55LAorICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0IC0gcm93LT5nbHlw aHNbVEVYVF9BUkVBXSwgdnBvcywgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAg ICAgY3Vyc29yX3dpZHRoLCBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24s CisgICAgICAgICAgICAgICAgICAgICAgICAgbHNsX2ZnLCBNVUxUSVBMRV9DVVJTT1JTLCBkcmF3 X3AsIGZyb21fd2hlcmUsIE1DX0NBQ0hFKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAg ICAgaWYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQor ICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA8PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAg ICAmJiBlc3NlbnRpYWxzLmZjX3ggPj0gdy0+bWMubG51bV9waXhlbF93aWR0aCkKKyAgICAgICAg eworICAgICAgICAgIGludCB4X2xpbWl0ID0geCArIHN0YXJ0LT5waXhlbF93aWR0aDsKKyAgICAg ICAgICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9ICh3LT5jdXJzb3IueCA9PSBlc3NlbnRpYWxz LmZjX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3Iu eSA9PSByb3ctPnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5j dXJzb3IuaHBvcyA9PSBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0KKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IudnBvcyA9PSB2cG9zKTsKKyAg ICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICBtY19jb2xvcl9waWNrZXIg KHcsIHN0YXJ0LCBlc3NlbnRpYWxzLCAmbHNsX2ZnLCAtMSwgTUNfQkFSLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgcm93X3Bvc2l0aW9uLCBGSUxMX0NPTFVNTik7CisgICAgICAgICAg aWYgKHggKyBzdGFydC0+cGl4ZWxfd2lkdGggPD0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAg ICAgICYmICgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID4gMCkKKyAgICAgICAgICAg ICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAgICAmJiAoKHN0 YXJ0ICE9IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEK KyAgICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPj0geAorICAgICAgICAgICAg ICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA8IHggKyBzdGFydC0+cGl4ZWxfd2lkdGgpCisgICAg ICAgICAgICAgICAgICB8fCAoc3RhcnQgPT0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+ dXNlZFtURVhUX0FSRUFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMu ZmNfeCA+PSB4KSkKKyAgICAgICAgICAgICAgJiYgcm93LT55IDw9IHdpbmRvd190ZXh0X2JvdHRv bV95ICh3KQorICAgICAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAg ICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgc3RhcnQsIFRFWFRfQVJFQSwgeCwgeF9saW1p dCwgcm93LT55LAorICAgICAgICAgICAgICAgICAgICAgICBzdGFydCAtIHJvdy0+Z2x5cGhzW1RF WFRfQVJFQV0sIHZwb3MsIE1DX0JBUiwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29y X21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBsc2xfZmcsCisgICAgICAgICAgICAg ICAgICAgICAgIEZJTExfQ09MVU1OLCBkcmF3X3AsIGZyb21fd2hlcmUsIEZDX0NBQ0hFKTsKKyAg ICAgICAgfQorICAgICAgaWYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNy b3NzaGFpcnMpKQorICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9ob3Jpem9udGFsX3J1 bGVyKSkKKyAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zKQorICAgICAgICB7Cisg ICAgICAgICAgaW50IHhfbGltaXQgPSAoc3RhcnQgPT0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSAr IHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgID8gdGV4 dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICA6IHggKyBzdGFydC0+cGl4ZWxf d2lkdGg7CisgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgbWNfY29s b3JfcGlja2VyICh3LCBzdGFydCwgZXNzZW50aWFscywgJmxzbF9mZywgLTEsIE1DX0hCQVIsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb3dfcG9zaXRpb24sIEhPUklaT05UQUxfUlVM RVIpOworICAgICAgICAgIC8qIFByZXNlcnZlIHN1cHBvcnQgZm9yIGRlZmF1bHQgYmVoYXZpb3Ig c3VjaCB0aGF0IGEgdXNlciBtYXkKKyAgICAgICAgICBzcGVjaWZ5IHRoZSBoZWlnaHQgb2YgYW4g TUNfSEJBUiwgd2hpY2ggYmVnaW5zIGl0cyBqb3VybmV5CisgICAgICAgICAgYXMgdGhlIGBjdXJz b3Jfd2lkdGgnLiAgYG1jX2dldF9jdXJzb3JfZ2VvbWV0cnknIHJlYWRqdXN0cy4gKi8KKyAgICAg ICAgICBtY19lbmdpbmUgKHcsIG1hdHJpeCwgcm93LCBzdGFydCwgVEVYVF9BUkVBLCB4LCB4X2xp bWl0LCByb3ctPnksCisgICAgICAgICAgICAgICAgICAgICBzdGFydCAtIHJvdy0+Z2x5cGhzW1RF WFRfQVJFQV0sIHZwb3MsIE1DX0hCQVIsIDEsCisgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jf bWF0cml4LCBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGxzbF9mZywKKyAgICAgICAgICAgICAg ICAgICAgIEhPUklaT05UQUxfUlVMRVIsIGRyYXdfcCwgZnJvbV93aGVyZSwgQ0hfQ0FDSEUpOwor ICAgICAgICB9CisgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg Y3Jvc3NoYWlycykpCisgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1 bGVyKSkKKyAgICAgICAgICAmJiAhZmlsbF9jb2x1bW5fdHJ1bXBzX3ApCisgICAgICAgIHsKKyAg ICAgICAgICBjdXJzb3JfdHlwZSA9IChzdGFydC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkKKyAgICAg ICAgICAgICAgICAgICAgICAgID8gTUNfSE9MTE9XX0JPWAorICAgICAgICAgICAgICAgICAgICAg ICAgOiBNQ19CQVI7CisgICAgICAgICAgaW50IHhfbGltaXQgPSB3aW5kb3dfYm94X3dpZHRoICh3 LCBURVhUX0FSRUEpOworICAgICAgICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKHctPmN1 cnNvci55ID09IHJvdy0+eQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IHctPmN1cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2Zn OworICAgICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywgc3RhcnQsIGVzc2VudGlhbHMsICZsc2xf ZmcsIC0xLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvd19w b3NpdGlvbiwgVkVSVElDQUxfUlVMRVIpOworICAgICAgICAgIGlmICgoKGhlYWRlcl9saW5lX2Zv cm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICB8fCBoZWFkZXJfbGluZV9mb3Jt YXQgPT0gMCkKKyAgICAgICAgICAgICAgJiYgKChzdGFydCAhPSByb3ctPmdseXBoc1tURVhUX0FS RUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxCisgICAgICAgICAgICAgICAgICAgJiYgdy0+ Y3Vyc29yLnggPj0geAorICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54IDwgeCArIHN0 YXJ0LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgIHx8IChzdGFydCA9PSByb3ctPmds eXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxCisgICAgICAgICAgICAg ICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0geCkpCisgICAgICAgICAgICAgICYmIHJvdy0+eSA8 PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAgICAgJiYgIXJlYWxfZmFrZV9j dXJzb3JfcCkKKyAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIHN0YXJ0LCBU RVhUX0FSRUEsIHgsIHhfbGltaXQsIHJvdy0+eSwKKyAgICAgICAgICAgICAgICAgICAgICAgc3Rh cnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLCB2cG9zLCBjdXJzb3JfdHlwZSwgMSwKKyAgICAg ICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9u LCBsc2xfZmcsCisgICAgICAgICAgICAgICAgICAgICAgIFZFUlRJQ0FMX1JVTEVSLCBkcmF3X3As IGZyb21fd2hlcmUsIENIX0NBQ0hFKTsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAg ICB7CisgICAgICAgIGludCByZWxhdGl2ZV94ID0gMDsKKyAgICAgICAgZm9yIChpbnQgYXJlYSA9 IExFRlRfTUFSR0lOX0FSRUE7IGFyZWEgPCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAgICAgICAgICB7 CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoID0gcm93LT5nbHlwaHNbYXJlYV07Cisg ICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoX2VuZCA9IGdseXBoICsgcm93LT51c2VkW2Fy ZWFdOworICAgICAgICAgICAgLyogR2x5cGggZm9yIGEgbGluZSBlbmQgaW4gdGV4dC4gKi8KKyAg ICAgICAgICAgIGlmIChhcmVhID09IFRFWFRfQVJFQSAmJiBnbHlwaCA9PSBnbHlwaF9lbmQgJiYg Z2x5cGgtPmNoYXJwb3MgPiAwKQorICAgICAgICAgICAgICArK2dseXBoX2VuZDsKKyAgICAgICAg ICAgIGZvciAoOyBnbHlwaCA8IGdseXBoX2VuZDsgKytnbHlwaCkKKyAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgIGlmICh2cG9zICE9IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICAg ICAgICAgICYmIGdseXBoICE9IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgJiYg ZXNzZW50aWFscy5mY194IDwgcmVsYXRpdmVfeAorICAgICAgICAgICAgICAgICAgICAmJiB3LT5j dXJzb3IueCA8IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgJiYgTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkpCisgICAgICAgICAgICAgICAgICBicmVh azsKKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgbWNfY29uZikpKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAv KiBUaGUgc3BhY2UgYXBwZW5kZWQgdG8gYSByb3cgZW5kaW5nIHdpdGggYSBuZXcgbGluZSBkb2Vz CisgICAgICAgICAgICAgICAgICAgIG5vdCBoYXZlIGEgYGdseXBoLT5jaGFycG9zYCAoLTEsIDAp IHRoYXQgd2UgY2FuIHVzZSBmb3IgdGhpcworICAgICAgICAgICAgICAgICAgICBwYXJ0aWN1bGFy IGFwcGxpY2F0aW9uLiAgV2hlbiBhIGBidWZmZXItZGlzcGxheS10YWJsZScgZW50cnkKKyAgICAg ICAgICAgICAgICAgICAgYXNzaWducyBhIHZpc2libGUgZ2x5cGggdG8gYSBuZXcgbGluZSwgdGhl cmUgaXMgbm8gcHJvYmxlbQorICAgICAgICAgICAgICAgICAgICBiZWNhdXNlIHRoYXQgZ2x5cGgg aGFzIGEgYGdseXBoLT5jaGFycG9zJyB0aGF0IHdlIGNhbiB1c2UuCisgICAgICAgICAgICAgICAg ICAgIFdoZW4gbm8gdmlzaWJsZSBFT0wgZ2x5cGggZXhpc3RzLCB3ZSB1c2UgdGhlIGZvbGxvd2lu ZyB0ZXN0OgorICAgICAgICAgICAgICAgICAgICB0aGUgYXBwZW5kZWQgc3BhY2UgaGFzIGEgcG9z aXRpb24gdGhhdCBpcyBvbmUgbGVzcyB0aGFuIHRoZQorICAgICAgICAgICAgICAgICAgICBlbmQg b2YgdGhlIG1hdHJpeCByb3cuICovCisgICAgICAgICAgICAgICAgICAgIGludCBocG9zID0gZ2x5 cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qg Z2x5cGggKnByZXZpb3VzX2dseXBoID0gKDAgPD0gaHBvcyAtIDEgJiYgaHBvcyAtIDEgPCByb3ct PnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIGhwb3MgLSAxCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgICAg ICAgICAgICAgICAgICAgIC8vIHN0cnVjdCBnbHlwaCAqbGFzdF9nbHlwaCA9IHJvdy0+Z2x5cGhz W1RFWFRfQVJFQV0gKyByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDE7CisgICAgICAgICAgICAgICAg ICAgIGJvb2wgc2tpcF9wID0gKHByZXZpb3VzX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgcHJldmlvdXNfZ2x5cGgtPmNoYXJwb3MgPT0gTUFUUklY X1JPV19FTkRfQ0hBUlBPUyAocm93KSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgZ2x5cGgtPmJ5dGVwb3MgIT0gZXNzZW50aWFscy56dl9ieXRlKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyB0cnVlCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgLyogV2hlbiBhIGBidWZmZXItZGlzcGxheS10YWJsZScgZW50cnkgY29udGFp bnMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhIHZpc2libGUgdGFiIGNoYXJh Y3RlciAoIsK7IiksIHRoZSBzdWJzZXF1ZW50CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgU1RSRVRDSF9HTFlQSCB3aWxsIGhhdmUgdGhlIHNhbWUgZ2x5cGgtPmNoYXJwb3MKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcyB0aGUgYWZvcmVtZW50aW9uZWQgdmlz aWJsZSB0YWIgY2hhcmFjdGVyLiAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogKHByZXZpb3VzX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBwcmV2aW91c19nbHlwaC0+Y2hhcnBvcyA9PSBnbHlwaC0+Y2hhcnBvcykKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gdHJ1ZQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIGludCBwb3Np bnQgPSAocm93X3Bvc2l0aW9uID09IFBPU1RfWlYpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gLTEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKHJvd19w b3NpdGlvbiA9PSBBVF9aVikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g ZXNzZW50aWFscy56dgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGgt PmJ5dGVwb3MgIT0gZXNzZW50aWFscy56dl9ieXRlCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2Vk W1RFWFRfQVJFQV0gLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1B VFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IChnbHlwaC0+Ynl0ZXBvcyA9PSBlc3NlbnRpYWxzLnp2X2J5dGUKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9B UkVBXSA9PSByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gZXNzZW50aWFscy56dgorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiBnbHlwaC0+Y2hhcnBvczsKKyAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3Qg c3BlY3MgPSBtY19hc3NvYyAobWFrZV9maXhudW0gKHBvc2ludCksIEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgbWNfY29uZikpOworICAgICAgICAgICAgICAgICAgICBpZiAoKChoZWFkZXJf bGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgICAgICAgICAgIHx8 IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5J TFAgKHNwZWNzKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT55IDw9IHdpbmRvd190 ZXh0X2JvdHRvbV95ICh3KQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXNraXBfcAorICAg ICAgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uICE9IFBPU1RfWlYpCisgICAgICAg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3QgbGlz cF90eXBlID0gbWNfbnRoICgxLCBzcGVjcyk7CisgICAgICAgICAgICAgICAgICAgICAgICBlbnVt IG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNf bGlzcF90b19jdXJzb3JfdHlwZSAoWENBUiAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IG1jX2xpc3BfdG9fY3Vy c29yX3R5cGUgKGxpc3BfdHlwZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlw ZSA9IChnbHlwaC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBNQ19IT0xMT1dfQk9YCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogY3Vyc29yX3R5cGU7CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQg Y3Vyc29yX3dpZHRoID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gWEZJWE5VTSAoWENBUiAoWENEUiAobGlzcF90eXBlKSkp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAtMTsKKyAgICAg ICAgICAgICAgICAgICAgICAgIExpc3BfT2JqZWN0IG1jX2ZvcmVncm91bmQgPSBtY19udGggKDIs IHNwZWNzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnOwor ICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFNUUklOR1AgKG1jX2ZvcmVncm91bmQpKQorICAg ICAgICAgICAgICAgICAgICAgICAgICBtY194d19jb2xvcl92YWx1ZXMgKHcsIG1jX2ZvcmVncm91 bmQsICZsc2xfZmcpOworICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChWRUNUT1JQ IChtY19mb3JlZ3JvdW5kKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBsc2xfZmcucmVkID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1j X2ZvcmVncm91bmQsIDApKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxzbF9mZy5n cmVlbiA9IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3JvdW5kLCAxKSk7CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBsc2xfZmcuYmx1ZSA9IFhGTE9BVF9EQVRBIChBUkVGIChtY19m b3JlZ3JvdW5kLCAyKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKE5JTFAgKG1jX2ZvcmVncm91bmQpKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgbWNfY29sb3JfcGlja2VyICh3LCBnbHlwaCwgZXNzZW50 aWFscywgJmxzbF9mZywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgcG9zaW50LCBjdXJzb3JfdHlwZSwgcm93X3Bvc2l0aW9uLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTKTsK KyAgICAgICAgICAgICAgICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3cs IG1hdHJpeCk7CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgeF9saW1pdCA9IHdpbmRvd19i b3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAgICAgICAgICAgICAgICAgICAgICBtY19lbmdp bmUgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgYXJlYSwgcmVsYXRpdmVfeCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgeF9saW1pdCwgcm93LT55LCBnbHlwaCAtIHJvdy0+Z2x5 cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZwb3Ms IGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgbHNsX2ZnLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTLCBkcmF3 X3AsIGZyb21fd2hlcmUsIE1DX0NBQ0hFKTsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAg ICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKCFOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQorICAgICAgICAgICAgICAgICAgICAmJiBlc3Nl bnRpYWxzLmZjX3ggPD0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICYmIGVz c2VudGlhbHMuZmNfeCA+PSB3LT5tYy5sbnVtX3BpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgICBpbnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGgg KHcsIFRFWFRfQVJFQSk7CisgICAgICAgICAgICAgICAgICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNv cl9wID0gKHctPmN1cnNvci54ID09IGVzc2VudGlhbHMuZmNfeAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueSA9PSByb3ctPnkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29y Lmhwb3MgPT0gZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci52cG9zID09IHZwb3Mp OworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5nbHlwaHNbVEVY VF9BUkVBXTsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAg ICAgICAgICAgICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywgZ2x5cGgsIGVzc2VudGlhbHMsICZs c2xfZmcsIC0xLCBNQ19CQVIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgcm93X3Bvc2l0aW9uLCBGSUxMX0NPTFVNTik7CisgICAgICAgICAgICAgICAgICAgIGlmICho cG9zID49IGhwb3Nfc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIGhwb3MgPCBocG9z X3N0YXJ0ICsgaHBvc19sZW5ndGgKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIHJlbGF0aXZl X3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGggPD0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAg ICAgICAgICAgICAmJiAoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAg ICAgICAgICAgICAgICAgICAgICAmJiAoKGdseXBoICE9IGdseXBoX2VuZCAtIDEKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID49IHJlbGF0aXZlX3gKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194IDwgcmVsYXRpdmVf eCArIGdseXBoLT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAo Z2x5cGggPT0gZ2x5cGhfZW5kIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBlc3NlbnRpYWxzLmZjX3ggPj0gcmVsYXRpdmVfeCkpCisgICAgICAgICAgICAgICAgICAgICAg ICAmJiByb3ctPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICAg ICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAgICAgICAgICAgICAgIG1j X2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4X2xpbWl0 LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT55LCBocG9zLCB2cG9zLCBN Q19CQVIsIDEsIGN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGxzbF9mZywgRklMTF9DT0xVTU4sCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3X3AsIGZyb21fd2hlcmUsIEZDX0NBQ0hFKTsK KyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhC VUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICYm ICFOSUxQIChCVkFSIChiLCBjaF9ob3Jpem9udGFsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAg ICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgICAgaW50IHhfbGltaXQgPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FS RUEpOworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5nbHlwaHNb VEVYVF9BUkVBXTsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7Cisg ICAgICAgICAgICAgICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywgZ2x5cGgsIGVzc2VudGlhbHMs ICZsc2xfZmcsIC0xLCBNQ19IQkFSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHJvd19wb3NpdGlvbiwgSE9SSVpPTlRBTF9SVUxFUik7CisgICAgICAgICAgICAgICAg ICAgIC8qIFByZXNlcnZlIHN1cHBvcnQgZm9yIGRlZmF1bHQgYmVoYXZpb3Igc3VjaCB0aGF0IGEg dXNlciBtYXkKKyAgICAgICAgICAgICAgICAgICAgc3BlY2lmeSB0aGUgaGVpZ2h0IG9mIGFuIE1D X0hCQVIsIHdoaWNoIGJlZ2lucyBpdHMgam91cm5leQorICAgICAgICAgICAgICAgICAgICBhcyB0 aGUgYGN1cnNvcl93aWR0aCcuICBgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeScgcmVhZGp1c3RzLiAq LworICAgICAgICAgICAgICAgICAgICBpZiAoaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAg ICAgICAgICAgICAgICAmJiBocG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoKQorICAgICAg ICAgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCBy ZWxhdGl2ZV94LCB4X2xpbWl0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93 LT55LCBocG9zLCB2cG9zLCBNQ19IQkFSLCAxLCBjdXJzb3JfbWF0cml4LAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBsc2xfZmcsIEhP UklaT05UQUxfUlVMRVIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3X3As IGZyb21fd2hlcmUsIENIX0NBQ0hFKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAg ICAgICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykp CisgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxl cikpCisgICAgICAgICAgICAgICAgICAgICYmICFmaWxsX2NvbHVtbl90cnVtcHNfcCkKKyAgICAg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUgPSAoZ2x5cGgt PnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBNQ19IT0xMT1dfQk9YCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19C QVI7CisgICAgICAgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0aCAo dywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgICAgICAgICAgYm9vbCByZWFsX2Zha2VfY3Vyc29y X3AgPSAody0+Y3Vyc29yLnkgPT0gcm93LT55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAg ICAgICAgICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAg ICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgICAgICAg ICAgIG1jX2NvbG9yX3BpY2tlciAodywgZ2x5cGgsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0xLCBj dXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb3df cG9zaXRpb24sIFZFUlRJQ0FMX1JVTEVSKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGhwb3Mg Pj0gaHBvc19zdGFydAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA8IGhwb3Nfc3Rh cnQgKyBocG9zX2xlbmd0aAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKChoZWFkZXJfbGlu ZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8 IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKChn bHlwaCAhPSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHct PmN1cnNvci54ID49IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg dy0+Y3Vyc29yLnggPCByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHx8IChnbHlwaCA9PSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHJlbGF0aXZlX3gpKQorICAg ICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3 KQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAg ICAgICAgICAgICAgICAgICBtY19lbmdpbmUgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgYXJlYSwg cmVsYXRpdmVfeCwgeF9saW1pdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJv dy0+eSwgaHBvcywgdnBvcywgY3Vyc29yX3R5cGUsIDEsIGN1cnNvcl9tYXRyaXgsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGxzbF9m ZywgVkVSVElDQUxfUlVMRVIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3 X3AsIGZyb21fd2hlcmUsIENIX0NBQ0hFKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAg fQorICAgICAgICAgIH0KKyAgICAgIH0KKyAgLy8gIGNsb2NrX3QgY2xvY2tfZW5kID0gY2xvY2so KTsKKyAgLy8gIGRvdWJsZSBjcHVfdGltZV91c2VkID0gKChkb3VibGUpIChjbG9ja19lbmQgLSBj bG9ja19zdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7CisgIC8vICBmcHJpbnRmIChzdGRlcnIsICJt Y19kcmF3X3JvdyAoJXMpOiAgVElNRSAoJWYpXG4iLCBtY193aW5kb3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BgcmlmLT5tY19zY3JpYmVfZ2x5cGhzJyBp bnN0ZWFkIG9mIGp1c3QgcGxhaW4gb2xkIGBtY19kcmF3X2dseXBocycuICovCisgIGlmIChjbGVh cl9lb2xfcAorICAgICAgJiYgZW5kX2hwb3MgPiBzdGFydF9ocG9zKQorICAgIHsKKyAgICAgIC8q IEFkdmFuY2UgdGhlIG91dHB1dCBjdXJzb3IuICovCisgICAgICB3LT5vdXRwdXRfY3Vyc29yLmhw b3MgPSBlbmRfaHBvczsKKyAgICAgIHctPm91dHB1dF9jdXJzb3IueCA9IHg7CisgICAgICBGUkFN RV9SSUYgKGYpLT5jbGVhcl9lbmRfb2ZfbGluZSAodywgcm93LCBURVhUX0FSRUEsIC0xKTsKKyAg ICB9CisgIC8vICBjbG9ja19zdGFydCA9IGNsb2NrKCk7CisgIGludCB2bnRoID0gTUFUUklYX1JP V19WUE9TIChyb3csIG1hdHJpeCk7CisgIC8qIFNUUkVUQ0hfR0xZUEggbWF5IGNvbnRhaW4gbW9y ZSB0aGFuIG9uZSBmYWtlIGN1cnNvciBhdCB0aGUgc2FtZSBIUE9TLiAqLworICBmb3IgKGVudW0g bWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7CisgICAgICAgY2FjaGVfdHlwZSA8 IE5PX0NBQ0hFOworICAgICAgICsrY2FjaGVfdHlwZSkKKyAgICB7CisgICAgICBmb3IgKGludCBu dGggPSAwOworICAgICAgICAgICBtY190cmF2ZXJzZV9jYWNoZV9wICh3LT5tY19tYXRyaXgsIGNh Y2hlX3R5cGUsIHZudGgsIG50aCk7CisgICAgICAgICAgICsrbnRoKQorICAgICAgICB7CisgICAg ICAgICAgaW50IHggPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLng7CisgICAgICAgICAgaW50IGZ4ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXS5meDsKKyAgICAgICAgICBpbnQgeSA9IHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ueTsKKyAgICAgICAgICBpbnQgZnkgPSB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZ5OworICAgICAgICAg IGludCBocG9zID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XS5ocG9zOworICAgICAgICAgIGludCB2cG9zID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXS52cG9zOworICAgICAgICAgIGludCB3ZCA9IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ud2Q7CisgICAgICAgICAgaW50IGgg PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmg7CisgICAg ICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSA9IHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uY3Vyc29yX3R5cGU7CisgICAgICAgICAgaW50 IGN1cnNvcl93aWR0aCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF0uY3Vyc29yX3dpZHRoOworICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnID0gey5y ZWQgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZnLnJl ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZnLmdyZWVuLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5mZy5ibHVlfTsKKyAgICAgICAgICAvLyAgc3RydWN0IG1j X1JHQiBsc2xfYmcgPSB7LnJlZCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF0uYmcucmVkLAorICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAg ICAuZ3JlZW4gPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhd LmJnLmdyZWVuLAorICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9 IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmcuYmx1ZX07 CisgICAgICAgICAgYm9vbCBhY3RpdmVfcCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF0uYWN0aXZlX3A7CisgICAgICAgICAgZW51bSBtY19mbGF2b3IgZ2x5 cGhfZmxhdm9yID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XS5nbHlwaF9mbGF2b3I7CisgICAgICAgICAgYm9vbCBlbmFibGVkX3AgPSB3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmVuYWJsZWRfcDsKKyAgICAgICAgICBp ZiAodnBvcyA9PSB2bnRoCisgICAgICAgICAgICAgICYmICgoaHBvcyA+PSBzdGFydF9ocG9zCisg ICAgICAgICAgICAgICAgICAgJiYgaHBvcyA8IGVuZF9ocG9zKQorICAgICAgICAgICAgICAgICAg LyogQSBmbG9hdGluZyBjdXJzb3IgYmV5b25kIHRoZSBlbmQgb2YgdGhlIGdseXBoIHJvdy4gKi8K KyAgICAgICAgICAgICAgICAgIHx8IChocG9zICsgMSA9PSBzdGFydF9ocG9zCisgICAgICAgICAg ICAgICAgICAgICAgJiYgaHBvcyArIDEgPT0gZW5kX2hwb3MpKQorICAgICAgICAgICAgICAmJiBl bmFibGVkX3ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGJvb2wgcmVtb3ZlX3AgPSBm YWxzZTsKKyAgICAgICAgICAgICAgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHcsIG1hdHJpeCwgcm93 LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgbHNsX2ZnLCBhY3RpdmVf cCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgcmVt b3ZlX3ApOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAvLyAgY2xvY2tfZW5k ID0gY2xvY2soKTsKKyAgLy8gIGRvdWJsZSB0aW1lX2N1cnNvcnMgPSAoKGRvdWJsZSkgKGNsb2Nr X2VuZCAtIGNsb2NrX3N0YXJ0KSkgLyBDTE9DS1NfUEVSX1NFQzsKKyAgLy8gIGZwcmludGYgKHN0 ZGVyciwgIm1jX3JlZHJhd19yb3cgKCVkKTogIGhwb3MgKCVkLyVkKSB8IGdseXBocyAoJWYpIHwg Y3Vyc29ycyAoJWYpXG4iLAorICAvLyAgICAgICAgICAgICAgICAgICB2cG9zLCBzdGFydF9ocG9z LCBlbmRfaHBvcywgdGltZV9nbHlwaHMsIHRpbWVfY3Vyc29ycyk7Cit9CisKK3ZvaWQKK21jX2Vy YXNlX3JvdyAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBz dHJ1Y3QgZ2x5cGhfcm93ICpyb3cpCit7CisgIGludCB2bnRoID0gTUFUUklYX1JPV19WUE9TIChy b3csIG1hdHJpeCk7CisgIGlmICh0cmFjZV9yZWRpc3BsYXlfcCkKKyAgICBmcHJpbnRmIChzdGRl cnIsICJtY19lcmFzZV9yb3cgKCVzKTogIHZwb3MgKCVkKVxuIiwgbWNfd2luZG93ICh3KSwgdm50 aCk7CisgIC8vICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgIC8vICAgIGZwcmludGYgKHN0ZGVy ciwgIm1jX2VyYXNlX2hlbHBlciAoJXMpOiAgY2FjaGUgKCVzKSB8IHZwb3MgKCVkKVxuIiwKKyAg Ly8gICAgICBtY193aW5kb3cgKHcpLCBtY19jYWNoZV90eXBlX3RvX3N0cmluZyAoY2FjaGVfdHlw ZSksIHZudGgpOworICBmb3IgKGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FD SEU7CisgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICsrY2FjaGVfdHlwZSkK KyAgICB7CisgICAgICBmb3IgKGludCBudGggPSAwOworICAgICAgICAgICBtY190cmF2ZXJzZV9j YWNoZV9wICh3LT5tY19tYXRyaXgsIGNhY2hlX3R5cGUsIHZudGgsIG50aCk7CisgICAgICAgICAg ICsrbnRoKQorICAgICAgICB7CisgICAgICAgICAgaW50IHggPSB3LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLng7CisgICAgICAgICAgaW50IGZ4ID0gdy0+bWNf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5meDsKKyAgICAgICAgICBp bnQgeSA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ueTsK KyAgICAgICAgICBpbnQgZnkgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhdLmZ5OworICAgICAgIC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gICAgIGJvb2wgYmFyZl9jcmFzaF90 d28gPSAodnBvcyA+PSAwICYmIHZwb3MgPCBtYXRyaXgtPm5yb3dzKSA/IGZhbHNlIDogdHJ1ZTsK KyAgICAgICAgICBpZiAoYmFyZl9jcmFzaF90d28pCisgICAgICAgICAgICBjb250aW51ZTsKKyAg ICAgICAgICBpZiAodnBvcyA9PSB2bnRoCisgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciA9 PSBNQ19HTFlQSAorICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgIG1jX2VyYXNlX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIHksIGhwb3Ms IHZwb3MsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkKTsKKyAgICAgICAgICAgICAgdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFibGVkX3AgPSBm YWxzZTsKKyAgICAgICAgICAgICAgLS13LT5tY19tYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5 cGVdOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAodnBvcyA9PSB2bnRoCisg ICAgICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICBib29sIHJlbW92ZV9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICBtY19kcmF3 X2VyYXNlX2h5YnJpZCAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywg d2QsIGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBl LCBjdXJzb3Jfd2lkdGgsIGxzbF9iZywgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgcmVtb3ZlX3ApOworICAg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S0tLS0tLS0tLS0tLSsgPD0gaXQuY3VycmVudF95ID09IDAKKyAgfCAgICAg ICAgICAgICB8CisgIHwgICAgICAgICAgICAgfCA8PSBydW4uZGVzaXJlZF95ID09IDI3MCBbdXAg KOKGkSldID09IHJ1bi5jdXJyZW50X3kgPCBydW4uZGVzaXJlZF95CisgIHwgICAgICAgICAgICAg fCAgICBydW4uaGVpZ2h0ID0gaXQubGFzdF92aXNpYmxlX3kgLSBydW4uY3VycmVudF95OworICB8 ICAgICAgICAgICAgIHwgICAgcnVuLmhlaWdodCA9PSAxMDgwIC0gNTQwID09IDU0MAorICB8ICAg ICAgICAgICAgIHwgICAgW1RoZSBlbnRpcmUgYm90dG9tIHJlY3RhbmdsZSBnZXRzIGNvcGllZCB0 byB1cHBlciBydW4uZGVzaXJlZF95Ll0KKyAgfCAgICAgICAgICAgICB8CisgICstLS0tLS0tLS0t LS0tKyA8PSBydW4uY3VycmVudF95ID09IDU0MAorICB8ICAgICAgICAgICAgIHwKKyAgfCAgICAg ICAgICAgICB8IDw9IHJ1bi5kZXNpcmVkX3kgPT0gODEwIFtkb3duICjihpMpXSA9PSBydW4uY3Vy cmVudF95ID4gcnVuLmRlc2lyZWRfeQorICB8ICAgICAgICAgICAgIHwgICAgcnVuLmhlaWdodCA9 IGl0Lmxhc3RfdmlzaWJsZV95IC0gcnVuLmRlc2lyZWRfeQorICB8ICAgICAgICAgICAgIHwgICAg cnVuLmhlaWdodCA9PSAxMDgwIC0gODEwID09IDI3MAorICB8ICAgICAgICAgICAgIHwgICAgW1Rv cCBwYXJ0IG9mIHRoZSBsb3dlciByZWN0YW5nbGUgZ2V0cyBjb3BpZWQgdG8gbG93ZXIgcnVuLmRl c2lyZWRfeS5dCisgIHwgICAgICAgICAgICAgfAorICArLS0tLS0tLS0tLS0tLSsgPD0gaXQubGFz dF92aXNpYmxlX3kgPT0gMTA4MCAqLwordm9pZAorbWNfcHJlX3Njcm9sbF9jbGVhbiAoc3RydWN0 IHdpbmRvdyAqdywgc3RydWN0IHJ1biBydW4sIGludCBzdGFydF92cG9zLAorICAgICAgICAgICAg ICAgICAgICAgaW50IG5yb3dzX3Njcm9sbGVkLCBlbnVtIG1jX3ByZV9zY3JvbGxfY2xlYW4gZnJv bV93aGVyZSkKK3sKKyAgaWYgKE1JTklfV0lORE9XX1AgKHcpKQorICAgIHJldHVybjsKKyAgYm9v bCBnb19vbmVfcCA9ICh3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW01DX0NBQ0hFXSA+IDAKKyAg ICAgICAgICAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0NIX0NBQ0hFXSA+ IDAKKyAgICAgICAgICAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0ZDX0NB Q0hFXSA+IDApOworICBib29sIGdvX3R3b19wID0gKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAg ICAgICAgICAgICAgICAgICYmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBj cm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZG RVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgICAgICAgICAgICAgIHx8 ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkpOworICBpZiAo dHJhY2VfcmVkaXNwbGF5X3ApCisgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfcHJlX3Njcm9sbF9j bGVhbiAoJXMpOlxuXAorICAlcyB8IGdvX29uZV9wICglcykgfCBnb190d29fcCAoJXMpXG5cCisg IHN0YXJ0X3Zwb3MgKCVkKSB8IG5yb3dzX3Njcm9sbGVkICglZClcblwKKyAgJXM6ICBydW4uY3Vy cmVudC9kZXNpcmVkX3kgKCVkLyVkKSB8IHJ1bi5oZWlnaHQgKCVkKVxuIiwKKyAgICBtY193aW5k b3cgKHcpLCAoZnJvbV93aGVyZSA9PSBUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhf RE9XTikKKyAgICAgICAgICAgICAgICAgICAgID8gIlRSWV9XSU5ET1dfUkVVU0lOR19DVVJSRU5U X01BVFJJWF9ET1dOIgorICAgICAgICAgICAgICAgICAgIDogKGZyb21fd2hlcmUgPT0gVFJZX1dJ TkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX1VQKQorICAgICAgICAgICAgICAgICAgICAgPyAi VFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX1VQIgorICAgICAgICAgICAgICAgICAg IDogKGZyb21fd2hlcmUgPT0gVFJZX1dJTkRPV19JRCkKKyAgICAgICAgICAgICAgICAgICAgID8g IlRSWV9XSU5ET1dfSUQiCisgICAgICAgICAgICAgICAgICAgOiAiVU5LTk9XTiIsCisgICAgZ29f b25lX3AgPyAieWVzIiA6ICJubyIsIGdvX3R3b19wID8gInllcyIgOiAibm8iLAorICAgIHN0YXJ0 X3Zwb3MsIG5yb3dzX3Njcm9sbGVkLAorICAgIHJ1bi5jdXJyZW50X3kgPCBydW4uZGVzaXJlZF95 ID8gIuKGkyIgOiAi4oaRIiwKKyAgICBydW4uY3VycmVudF95LCBydW4uZGVzaXJlZF95LCBydW4u aGVpZ2h0KTsKKyAgaWYgKCFnb19vbmVfcCAmJiAhZ29fdHdvX3ApCisgICAgcmV0dXJuOworICBi b29sIHVwZGF0aW5nX2ZyYW1lX3AgPSBmYWxzZTsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1F ICh3LT5mcmFtZSk7CisgIGlmIChYRlJBTUUgKHctPmZyYW1lKSAhPSBmLT5tY191cGRhdGluZ19m cmFtZQorICAgICAgJiYgKGdvX29uZV9wIHx8IGdvX3R3b19wKSkKKyAgICB7CisgICAgICB1cGRh dGluZ19mcmFtZV9wID0gdHJ1ZTsKKyAgICAgIHVwZGF0ZV9iZWdpbiAoZik7Cis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KGFyZykgPiAwOworICAgIH0KKyAgcmV0dXJuIFFuaWw7Cit9 CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiAMCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioKIAkJICAgICAgV2luZG93IGRpc3BsYXkgZGltZW5zaW9u cwpAQCAtMTMzOTUsNiArMTgwNjEsNjkgQEAgaHNjcm9sbF93aW5kb3dfdHJlZSAoTGlzcF9PYmpl Y3Qgd2luZG93KQogCSAgICAgIGVsc2UKIAkJcHQgPSBjbGlwX3RvX2JvdW5kcyAoQkVHViwgbWFy a2VyX3Bvc2l0aW9uICh3LT5wb2ludG0pLCBaVik7CiAKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIChnZGIpIGJ0CisjMCAgdGVy bWluYXRlX2R1ZV90b19zaWduYWwgKHNpZz02LCBiYWNrdHJhY2VfbGltaXQ9MjE0NzQ4MzY0Nykg YXQgZW1hY3MuYzozNTkKKyMxICAweDAwMDAwMDAxMDAxZWU5OTYgaW4gZGllICgKKyAgICBtc2c9 MHgxMDAzMmZjODggImNoYXJwb3MgPCAwIHx8IChjaGFycG9zID49IEJVRl9CRUcgKGN1cnJlbnRf YnVmZmVyKSAmJiBjaGFycG9zIDw9IFpWKSIsIGZpbGU9MHgxMDAzMmUzMmQgInhkaXNwLmMiLCBs aW5lPTc5NTEpIGF0IGFsbG9jLmM6NzIxNAorIzIgIDB4MDAwMDAwMDEwMDA0ZDJhYiBpbiBpbml0 X2l0ZXJhdG9yIChpdD0weDdmZmY1ZmJmO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ICZjdXJzb3Jfcm93LT5zdGFydDsKKyAgcHRyZGlm Zl90IGNoYXJwb3MgPSBDSEFSUE9TIChwb3MtPnBvcyk7CisKKyAgYm9vbCBiYXJmX2NyYXNoX29u ZSA9IChjaGFycG9zIDwgMAorICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChjaGFycG9zID49 IEJVRl9CRUcgKGN1cnJlbnRfYnVmZmVyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBjaGFycG9zIDw9IFpWKSkKKyAgICAgICAgICAgICAgICAgICAgICAgID8gZmFsc2UKKyAgICAg ICAgICAgICAgICAgICAgICAgIDogdHJ1ZTsKKyAgaWYgKGJhcmZfY3Jhc2hfb25lKQorICAgIHJl dHVybiBoc2Nyb2xsZWRfcDsKKworICAvKiBgcmVzZWF0XzEnOiAgQ0hBUlBPUyAocG9zKSA+PSBC RUdWICYmIENIQVJQT1MgKHBvcykgPD0gWlYgKi8KKyAgYm9vbCBiYXJmX2NyYXNoX3R3byA9IChj aGFycG9zID49IEJFR1YgJiYgY2hhcnBvcyA8PSBaVikKKyAgICAgICAgICAgICAgICAgICAgICAg ICA/IGZhbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgOiB0cnVlOworICBpZiAoYmFyZl9j cmFzaF90d28pCisgICAgcmV0dXJuIGhzY3JvbGxlZF9wOworCisvKiBlbmQgTVVMVElQTEUtQ1VS U09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgICAgIC8qIE1vdmUgaXRl cmF0b3IgdG8gcHQgc3RhcnRpbmcgYXQgY3Vyc29yX3Jvdy0+c3RhcnQgaW4KIAkJIGEgbGluZSB3 aXRoIGluZmluaXRlIHdpZHRoLiAgKi8KIAkgICAgICBpbml0X3RvX3Jvd19zdGFydCAoJml0LCB3 LCBjdXJzb3Jfcm93KTsKQEAgLTE0Mjg3LDkgKzE5MDE2LDIyIEBAIHJlZGlzcGxheV9pbnRlcm5h bCAodm9pZCkKIAkgICAgICAqdy0+ZGVzaXJlZF9tYXRyaXgtPm1ldGhvZCA9IDA7CiAJICAgICAg ZGVidWdfbWV0aG9kX2FkZCAodywgIm9wdGltaXphdGlvbiAxIik7CiAjZW5kaWYKKworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogI2lmZGVmIEhB VkVfV0lORE9XX1NZU1RFTQorICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAmJiAh TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisgICAgbWNf dXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCBmYWxzZSk7CisgICAgZWxzZQogCSAgICAgIHVwZGF0 ZV93aW5kb3dfZnJpbmdlcyAodywgZmFsc2UpOwogI2VuZGlmCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworCisKIAkgICAgICBnb3RvIHVwZGF0ZTsKIAkgICAgfQogCSAgZWxzZQpAQCAtMTc2 ODcsMTAgKzIyNDI5LDIyIEBAIHJlZGlzcGxheV93aW5kb3cgKExpc3BfT2JqZWN0IHdpbmRvdywg Ym9vbCBqdXN0X3RoaXNfb25lX3ApCiAgICAgfQogCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVN CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK KyAgYm9vbCBrZWVwX2N1cnJlbnRfcCA9IChqdXN0X3RoaXNfb25lX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICB8fCAoIXVzZWRfY3VycmVudF9tYXRyaXhfcCAmJiAhb3ZlcmxheV9hcnJvd19z ZWVuKQorICAgICAgICAgICAgICAgICAgICAgICAgIHx8IHctPnBzZXVkb193aW5kb3dfcCk7CisK KyAgYm9vbCBmcmluZ2VzX3VwZGF0ZWRfcCA9IChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBjcm9zc2hhaXJzKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICA/IG1jX3VwZGF0 ZV93aW5kb3dfZnJpbmdlcyAodywga2VlcF9jdXJyZW50X3ApCisgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IHVwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywga2VlcF9jdXJyZW50X3ApOworCiAg IGlmIChGUkFNRV9XSU5ET1dfUCAoZikKLSAgICAgICYmIHVwZGF0ZV93aW5kb3dfZnJpbmdlcyAo dywgKGp1c3RfdGhpc19vbmVfcAotCQkJCSAgICB8fCAoIXVzZWRfY3VycmVudF9tYXRyaXhfcCAm JiAhb3ZlcmxheV9hcnJvd19zZWVuKQotCQkJCSAgICB8fCB3LT5wc2V1ZG9fd2luZG93X3ApKSkK KyAgICAgICYmIGZyaW5nZXNfdXBkYXRlZF9wKQogICAgIHsKICAgICAgIHVwZGF0ZV9iZWdpbiAo Zik7CiAgICAgICBibG9ja19pbnB1dCAoKTsKQEAgLTE3NzA1LDYgKzIyNDU5LDkgQEAgcmVkaXNw bGF5X3dpbmRvdyAoTGlzcF9PYmplY3Qgd2luZG93LCBib29sIGp1c3RfdGhpc19vbmVfcCkKICAg ICAgIHVwZGF0ZV9lbmQgKGYpOwogICAgIH0KIAorLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisK KwogICBpZiAoV0lORE9XX0JPVFRPTV9ESVZJREVSX1dJRFRIICh3KSkKICAgICB4X2RyYXdfYm90 dG9tX2RpdmlkZXIgKHcpOwogI2VuZGlmIC8qIEhBVkVfV0lORE9XX1NZU1RFTSAqLwpAQCAtMTgw MTAsNiArMjI3NjcsNyBAQCB0cnlfd2luZG93X3JldXNpbmdfY3VycmVudF9tYXRyaXggKHN0cnVj dCB3aW5kb3cgKncpCiAJICAgICBzY3JvbGxfcnVuX2hvb2sgd2lsbCBjbGVhciB0aGUgY3Vyc29y LCBhbmQgdXNlIHRoZQogCSAgICAgY3VycmVudCBtYXRyaXggdG8gZ2V0IHRoZSBoZWlnaHQgb2Yg dGhlIHJvdyB0aGUgY3Vyc29yIGlzCiAJICAgICBpbi4gICovCisKIAkgIHJ1bi5jdXJyZW50X3kg PSBzdGFydF9yb3ctPnk7CiAJICBydW4uZGVzaXJlZF95ID0gaXQuY3VycmVudF95OwogCSAgcnVu LmhlaWdodCA9IGl0Lmxhc3RfdmlzaWJsZV95IC0gaXQuY3VycmVudF95OwpAQCAtMTgwMTksNiAr MjI3NzcsMTYgQEAgdHJ5X3dpbmRvd19yZXVzaW5nX2N1cnJlbnRfbWF0cml4IChzdHJ1Y3Qgd2lu ZG93ICp3KQogCSAgICAgIHVwZGF0ZV9iZWdpbiAoZik7CiAJICAgICAgRlJBTUVfUklGIChmKS0+ dXBkYXRlX3dpbmRvd19iZWdpbl9ob29rICh3KTsKIAkgICAgICBGUkFNRV9SSUYgKGYpLT5jbGVh cl93aW5kb3dfbW91c2VfZmFjZSAodyk7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisv KiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICBtY19wcmVfc2Nyb2xsX2NsZWFuICh3LCBydW4s IHN0YXJ0X3Zwb3MsIG5yb3dzX3Njcm9sbGVkLCBUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9N QVRSSVhfRE9XTik7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgICAgICBGUkFN RV9SSUYgKGYpLT5zY3JvbGxfcnVuX2hvb2sgKHcsICZydW4pOwogCSAgICAgIEZSQU1FX1JJRiAo ZiktPnVwZGF0ZV93aW5kb3dfZW5kX2hvb2sgKHcsIGZhbHNlLCBmYWxzZSk7CiAJICAgICAgdXBk YXRlX2VuZCAoZik7CkBAIC0xODE3Myw2ICsyMjk0MSw3IEBAIHRyeV93aW5kb3dfcmV1c2luZ19j dXJyZW50X21hdHJpeCAoc3RydWN0IHdpbmRvdyAqdykKIAl9CiAKICAgICAgIC8qIFNjcm9sbCB0 aGUgZGlzcGxheS4gICovCisKICAgICAgIHJ1bi5jdXJyZW50X3kgPSBmaXJzdF9yZXVzYWJsZV9y b3ctPnk7CiAgICAgICBydW4uZGVzaXJlZF95ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAo dyk7CiAgICAgICBydW4uaGVpZ2h0ID0gaXQubGFzdF92aXNpYmxlX3kgLSBydW4uY3VycmVudF95 OwpAQCAtMTgxODMsNiArMjI5NTIsMTYgQEAgdHJ5X3dpbmRvd19yZXVzaW5nX2N1cnJlbnRfbWF0 cml4IChzdHJ1Y3Qgd2luZG93ICp3KQogCSAgdXBkYXRlX2JlZ2luIChmKTsKIAkgIEZSQU1FX1JJ RiAoZiktPnVwZGF0ZV93aW5kb3dfYmVnaW5faG9vayAodyk7CiAJICBGUkFNRV9SSUYgKGYpLT5j bGVhcl93aW5kb3dfbW91c2VfZmFjZSAodyk7CisKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICBtY19wcmVfc2Nyb2xsX2NsZWFuICh3LCBy dW4sIHN0YXJ0X3Zwb3MsIG5yb3dzX3Njcm9sbGVkLCBUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVO VF9NQVRSSVhfVVApOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICBGUkFNRV9S SUYgKGYpLT5zY3JvbGxfcnVuX2hvb2sgKHcsICZydW4pOwogCSAgRlJBTUVfUklGIChmKS0+dXBk YXRlX3dpbmRvd19lbmRfaG9vayAodywgZmFsc2UsIGZhbHNlKTsKIAkgIHVwZGF0ZV9lbmQgKGYp OwpAQCAtMTkxMjcsNiArMjM5MDYsNyBAQCB0cnlfd2luZG93X2lkIChzdHJ1Y3Qgd2luZG93ICp3 KQogICAvKiBTY3JvbGwgdGhlIGRpc3BsYXkuICBEbyBpdCBiZWZvcmUgY2hhbmdpbmcgdGhlIGN1 cnJlbnQgbWF0cml4IHNvCiAgICAgIHRoYXQgeHRlcm0uYyBkb2Vzbid0IGdldCBjb25mdXNlZCBh Ym91dCB3aGVyZSB0aGUgY3Vyc29yIGdseXBoIGlzCiAgICAgIGZvdW5kLiAgKi8KKwogICBpZiAo ZHkgJiYgcnVuLmhlaWdodCkKICAgICB7CiAgICAgICB1cGRhdGVfYmVnaW4gKGYpOwpAQCAtMTkx MzUsNiArMjM5MTUsMTYgQEAgdHJ5X3dpbmRvd19pZCAoc3RydWN0IHdpbmRvdyAqdykKIAl7CiAJ ICBGUkFNRV9SSUYgKGYpLT51cGRhdGVfd2luZG93X2JlZ2luX2hvb2sgKHcpOwogCSAgRlJBTUVf UklGIChmKS0+Y2xlYXJfd2luZG93X21vdXNlX2ZhY2UgKHcpOworCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgbWNfcHJlX3Njcm9sbF9j bGVhbiAodywgcnVuLCBmaXJzdF91bmNoYW5nZWRfYXRfZW5kX3Zwb3MsIGR2cG9zLCBUUllfV0lO RE9XX0lEKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgRlJBTUVfUklGIChm KS0+c2Nyb2xsX3J1bl9ob29rICh3LCAmcnVuKTsKIAkgIEZSQU1FX1JJRiAoZiktPnVwZGF0ZV93 aW5kb3dfZW5kX2hvb2sgKHcsIGZhbHNlLCBmYWxzZSk7CiAJfQpAQCAtMjEyNzMsNiArMjYwNjMs MTcgQEAgbWF5YmVfcHJvZHVjZV9saW5lX251bWJlciAoc3RydWN0IGl0ICppdCkKICAgICAgIFNF VF9URVhUX1BPUyAodGVtX2l0LnBvc2l0aW9uLCAtMSwgLTEpOwogICAgICAgUFJPRFVDRV9HTFlQ SFMgKCZ0ZW1faXQpOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUt Q1VSU09SUyAqLworCisgICAgICAvKiBUaGlzIHBlcm1pdHMgdXMgdG8gaW5zcGVjdCB0aGUgSFBP UyBvZiBsaW5lIG51bWJlciBnbHlwaHMgYW5kIHRoZSBzcGFjZQorICAgICAgcGFkZGluZyBiZWZv cmUvYWZ0ZXIgdGhlIGxpbmUgbnVtYmVycy4gIFdlIHNldCBgZ2x5cGgtPmhwb3NgIGVsc2V3aGVy ZS4gKi8KKyAgICAgIHRlbV9pdC5ocG9zICs9IDE7CisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKICAgICAgIC8qIFN0b3AgcHJvZHVjaW5nIGdseXBocywgYW5kIHJlZnJhaW4gZnJvbSBw cm9kdWNpbmcgdGhlIGxpbmUKIAkgbnVtYmVyLCBpZiB3ZSBkb24ndCBoYXZlIGVub3VnaCBzcGFj ZSBvbiB0aGlzIGxpbmUuICAqLwogICAgICAgaWYgKHRlbV9pdC5jdXJyZW50X3ggPj0gd2lkdGhf bGltaXQpCkBAIC0yMTI4NCw2ICsyNjA4NSwzMCBAQCBtYXliZV9wcm9kdWNlX2xpbmVfbnVtYmVy IChzdHJ1Y3QgaXQgKml0KQogCX0KICAgICB9CiAKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgTGlzcF9PYmplY3QgYnVmID0gaXQtPnctPmNv bnRlbnRzOworICBDSEVDS19CVUZGRVIgKGJ1Zik7CisgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVG RkVSIChidWYpOworICBzdHJ1Y3QgYnVmZmVyICpvbGRfYnVmZmVyID0gTlVMTDsKKyAgLyogTmVl ZGVkIHNvIHRoYXQgYnVmZmVyLWxvY2FsIHZhbHVlcyBjYW4gYmUgZGV0ZXJtaW5lZDsgZS5nLiwg d2hlbiBzd2l0Y2hpbmcKKyAgdG8gdGhlIG1pbmlidWZmZXIuICovCisgIGlmIChiICE9IGN1cnJl bnRfYnVmZmVyKQorICAgIHsKKyAgICAgIG9sZF9idWZmZXIgPSBjdXJyZW50X2J1ZmZlcjsKKyAg ICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKGIpOworICAgIH0KKyAgaXQtPnctPm1jLmxudW1fcGl4 ZWxfd2lkdGggPSAoIU5JTFAgKFZkaXNwbGF5X2xpbmVfbnVtYmVycykpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyB0ZW1faXQuY3VycmVudF94CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiAwOworICBpZiAob2xkX2J1ZmZlcikKKyAgICBzZXRfYnVmZmVyX2ludGVy bmFsIChvbGRfYnVmZmVyKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBS ZWNvcmQgdGhlIHdpZHRoIGluIHBpeGVscyB3ZSBuZWVkIGZvciB0aGUgbGluZSBudW1iZXIgZGlz cGxheS4gICovCiAgIGl0LT5sbnVtX3BpeGVsX3dpZHRoID0gdGVtX2l0LmN1cnJlbnRfeDsKICAg LyogQ29weSB0aGUgcHJvZHVjZWQgZ2x5cGhzIGludG8gSVQncyBnbHlwaF9yb3cuICAqLwpAQCAt MjcwOTIsNiArMzE5MTcsMTcgQEAgYXBwZW5kX2dseXBoIChzdHJ1Y3QgaXQgKml0KQogCSAgICBn WzFdID0gKmc7CiAJICBnbHlwaCA9IGl0LT5nbHlwaF9yb3ctPmdseXBoc1thcmVhXTsKIAl9CisK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAg ICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9IElUX0JZ VEVQT1MgKCppdCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIGdseXBo LT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5vYmplY3Qg PSBpdC0+b2JqZWN0OwogICAgICAgaWYgKGl0LT5waXhlbF93aWR0aCA+IDApCkBAIC0yNzE3NSw2 ICszMjAxMSwxNyBAQCBhcHBlbmRfY29tcG9zaXRlX2dseXBoIChzdHJ1Y3QgaXQgKml0KQogCSAg ICBnWzFdID0gKmc7CiAJICBnbHlwaCA9IGl0LT5nbHlwaF9yb3ctPmdseXBoc1tpdC0+YXJlYV07 CiAJfQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAq LworCisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPmJ5dGVwb3Mg PSBJVF9CWVRFUE9TICgqaXQpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAg ICBnbHlwaC0+Y2hhcnBvcyA9IGl0LT5jbXBfaXQuY2hhcnBvczsKICAgICAgIGdseXBoLT5vYmpl Y3QgPSBpdC0+b2JqZWN0OwogICAgICAgZWFzc2VydCAoaXQtPnBpeGVsX3dpZHRoIDw9IFNIUlRf TUFYKTsKQEAgLTI3MzgzLDYgKzMyMjMwLDE3IEBAIHByb2R1Y2VfaW1hZ2VfZ2x5cGggKHN0cnVj dCBpdCAqaXQpCiAJfQogICAgICAgaWYgKGdseXBoIDwgaXQtPmdseXBoX3Jvdy0+Z2x5cGhzW2Fy ZWEgKyAxXSkKIAl7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1D VVJTT1JTICovCisKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBnbHlwaC0+ Ynl0ZXBvcyA9IElUX0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor Cis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AJICBlYXNzZXJ0ICh3aWR0aCA+ IDApOwogCX0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNP UlMgKi8KKworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBoLT5ieXRl cG9zID0gSVRfQllURVBPUyAoKml0KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog ICAgICAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9zaXRpb24pOwogICAgICAgZ2x5 cGgtPm9iamVjdCA9IG9iamVjdDsKICAgICAgIC8qIEZJWE1FOiBJdCB3b3VsZCBiZSBiZXR0ZXIg dG8gdXNlIFRZUEVfTUFYIGhlcmUsIGJ1dApAQCAtMjgwMjYsNiArMzI5MDYsMTcgQEAgYXBwZW5k X2dseXBobGVzc19nbHlwaCAoc3RydWN0IGl0ICppdCwgaW50IGZhY2VfaWQsIGJvb2wgZm9yX25v X2ZvbnQsIGludCBsZW4sCiAJICAgIGdbMV0gPSAqZzsKIAkgIGdseXBoID0gaXQtPmdseXBoX3Jv dy0+Z2x5cGhzW2FyZWFdOwogCX0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1V TFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAg IGdseXBoLT5ieXRlcG9zID0gSVRfQllURVBPUyAoKml0KTsKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogICAgICAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9zaXRpb24p OwogICAgICAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAgICAgICBlYXNzZXJ0IChpdC0+ cGl4ZWxfd2lkdGggPD0gU0hSVF9NQVgpOwpAQCAtMjkwNzYsMTAgKzMzOTY3LDM1IEBAIHhfaW5z ZXJ0X2dseXBocyAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqdXBkYXRlZF9y b3csCiAKICAgLyogV3JpdGUgdGhlIGdseXBocy4gICovCiAgIGhwb3MgPSBzdGFydCAtIHJvdy0+ Z2x5cGhzW3VwZGF0ZWRfYXJlYV07CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBN VUxUSVBMRS1DVVJTT1JTICovCisKKyAgaWYgKCh3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW01D X0NBQ0hFXSA+IDAKKyAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0NIX0NBQ0hF XSA+IDAKKyAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0ZDX0NBQ0hFXSA+IDAp CisgICAgICAmJiB1cGRhdGVkX2FyZWEgPT0gVEVYVF9BUkVBKQorICAgIHsKKyAgICAgIHN0cnVj dCBnbHlwaF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworICAgICAgaW50IHZw b3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgICAgIGludCBzdGFydF94ID0g dy0+b3V0cHV0X2N1cnNvci54OworICAgICAgaW50IHN0YXJ0X2hwb3MgPSBocG9zOworICAgICAg aW50IGVuZF9ocG9zID0gaHBvcyArIGxlbjsKKyAgICAgIGJvb2wgY2xlYXJfZW9sX3AgPSBmYWxz ZTsKKyAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBobCA9IERSQVdfTk9STUFMX1RFWFQ7Cisg ICAgICBUUkFDRSAoKHN0ZGVyciwgInhfaW5zZXJ0X2dseXBocyAoJWQpOiAgc3RhcnRfeCAoJWQp IHwgc3RhcnRfaHBvcyAoJWQpIHwgZW5kX2hwb3MgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAg ICAgICB2cG9zLCBzdGFydF94LCBzdGFydF9ocG9zLCBlbmRfaHBvcykpOworICAgICAgbWNfcmVk cmF3X3JvdyAodywgbWF0cml4LCByb3csIHN0YXJ0X3gsIHN0YXJ0X2hwb3MsIGVuZF9ocG9zLCBj bGVhcl9lb2xfcCwgaGwpOworICAgIH0KKyAgICBlbHNlCiAgIGRyYXdfZ2x5cGhzICh3LCB3LT5v dXRwdXRfY3Vyc29yLngsIHJvdywgdXBkYXRlZF9hcmVhLAogCSAgICAgICBocG9zLCBocG9zICsg bGVuLAogCSAgICAgICBEUkFXX05PUk1BTF9URVhULCAwKTsKIAorLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogICAvKiBBZHZhbmNlIHRoZSBvdXRwdXQgY3Vyc29yLiAgKi8KICAgdy0+b3V0 cHV0X2N1cnNvci5ocG9zICs9IGxlbjsKICAgdy0+b3V0cHV0X2N1cnNvci54ICs9IHNoaWZ0X2J5 X3dpZHRoOwpAQCAtMjk1MDUsOSArMzQ0MjEsMzMgQEAgeF9maXhfb3ZlcmxhcHBpbmdfYXJlYSAo c3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqcm93LAogCSAgd2hpbGUgKGkgPCBy b3ctPnVzZWRbYXJlYV0KIAkJICYmIHJvdy0+Z2x5cGhzW2FyZWFdW2ldLm92ZXJsYXBzX3ZlcnRp Y2FsbHlfcCk7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJT T1JTICovCisKKyAgICAgICAgaWYgKCh3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW01DX0NBQ0hF XSA+IDAKKyAgICAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0NIX0NBQ0hF XSA+IDAKKyAgICAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0ZDX0NBQ0hF XSA+IDApCisgICAgICAgICAgICAmJiBhcmVhID09IFRFWFRfQVJFQSkKKyAgICAgICAgICB7Cisg ICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXggPSB3LT5jdXJyZW50X21hdHJp eDsKKyAgICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7 CisgICAgICAgICAgICBpbnQgc3RhcnRfaHBvcyA9IHN0YXJ0OworICAgICAgICAgICAgaW50IGVu ZF9ocG9zID0gaTsKKyAgICAgICAgICAgIGJvb2wgY2xlYXJfZW9sX3AgPSBmYWxzZTsKKyAgICAg ICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBobCA9IERSQVdfTk9STUFMX1RFWFQ7CisgICAg ICAgICAgICBUUkFDRSAoKHN0ZGVyciwgInhfZml4X292ZXJsYXBwaW5nX2FyZWEgKCVkKTogIHN0 YXJ0X3ggKCVkKSB8IHN0YXJ0X2hwb3MgKCVkKSB8IGVuZF9ocG9zICglZClcbiIsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgdnBvcywgc3RhcnRfeCwgc3RhcnRfaHBvcywgZW5kX2hwb3Mp KTsKKyAgICAgICAgICAgIG1jX3JlZHJhd19yb3cgKHcsIG1hdHJpeCwgcm93LCBzdGFydF94LCBz dGFydF9ocG9zLCBlbmRfaHBvcywgY2xlYXJfZW9sX3AsIGhsKTsKKyAgICAgICAgICB9CisgICAg ICAgICAgZWxzZQogCSAgZHJhd19nbHlwaHMgKHcsIHN0YXJ0X3gsIHJvdywgYXJlYSwKIAkJICAg ICAgIHN0YXJ0LCBpLAogCQkgICAgICAgRFJBV19OT1JNQUxfVEVYVCwgb3ZlcmxhcHMpOworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJfQogICAgICAgZWxzZQogCXsKQEAgLTI5NzU4 LDEwICszNDY5OCwxNyBAQCBkaXNwbGF5X2FuZF9zZXRfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3 LCBib29sIG9uLAogICBuZXdfY3Vyc29yX3R5cGUgPSBnZXRfd2luZG93X2N1cnNvcl90eXBlICh3 LCBnbHlwaCwKIAkJCQkJICAgICZuZXdfY3Vyc29yX3dpZHRoLCAmYWN0aXZlX2N1cnNvcik7CiAK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAg LyogSWYgY3Vyc29yIGlzIGN1cnJlbnRseSBiZWluZyBzaG93biBhbmQgd2UgZG9uJ3Qgd2FudCBp dCB0byBiZSBvcgogICAgICBpdCBpcyBpbiB0aGUgd3JvbmcgcGxhY2UsIG9yIHRoZSBjdXJzb3Ig dHlwZSBpcyBub3Qgd2hhdCB3ZSB3YW50LAogICAgICBlcmFzZSBpdC4gICovCiAgIGlmICh3LT5w aHlzX2N1cnNvcl9vbl9wCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIGNyb3NzaGFpcnMpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBmY192aXNpYmxlKSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZ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AgICAgICAgICAgICAgb24sIGFjdGl2ZV9jdXJzb3IpOwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBp ZiAoTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAg ICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpCisgICAg ICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkKKyAgICBG UkFNRV9SSUYgKGYpLT5kcmF3X3dpbmRvd19jdXJzb3IgKHcsIGdseXBoX3JvdywgeCwgeSwgbmV3 X2N1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3 X2N1cnNvcl93aWR0aCwgb24sIGFjdGl2ZV9jdXJzb3IpOworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKworCiB9CiAKIApAQCAtMjk4ODcsNyArMzQ4NDcsMjkgQEAgZHJhd19yb3dfd2l0aF9t b3VzZV9mYWNlIChzdHJ1Y3Qgd2luZG93ICp3LCBpbnQgc3RhcnRfeCwgc3RydWN0IGdseXBoX3Jv dyAqcm93LAogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQogICBpZiAoRlJBTUVfV0lORE9XX1Ag KFhGUkFNRSAody0+ZnJhbWUpKSkKICAgICB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGlmICh3LT5tY19tYXRyaXguY3Vyc29y c191c2VkW01DX0NBQ0hFXSA+IDAKKyAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191 c2VkW0NIX0NBQ0hFXSA+IDAKKyAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2Vk W0ZDX0NBQ0hFXSA+IDApCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfbWF0cml4 ICptYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJ WF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAgICAgICAgIGJvb2wgY2xlYXJfZW9sX3AgPSBm YWxzZTsKKyAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UgaGwgPSBkcmF3OworICAgICAg ICAgIFRSQUNFICgoc3RkZXJyLCAiZHJhd19yb3dfd2l0aF9tb3VzZV9mYWNlICglZCk6ICBzdGFy dF94ICglZCkgfCBzdGFydF9ocG9zICglZCkgfCBlbmRfaHBvcyAoJWQpXG4iLAorICAgICAgICAg ICAgICAgICAgICAgICAgICB2cG9zLCBzdGFydF94LCBzdGFydF9ocG9zLCBlbmRfaHBvcykpOwor ICAgICAgICAgIG1jX3JlZHJhd19yb3cgKHcsIG1hdHJpeCwgcm93LCBzdGFydF94LCBzdGFydF9o cG9zLCBlbmRfaHBvcywgY2xlYXJfZW9sX3AsIGhsKTsKKyAgICAgICAgfQorICAgICAgICBlbHNl CiAgICAgICBkcmF3X2dseXBocyAodywgc3RhcnRfeCwgcm93LCBURVhUX0FSRUEsIHN0YXJ0X2hw b3MsIGVuZF9ocG9zLCBkcmF3LCAwKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog ICAgICAgcmV0dXJuOwogICAgIH0KICNlbmRpZgpAQCAtMzE5NDUsMTEgKzM2OTI3LDM2IEBAIGV4 cG9zZV9hcmVhIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIFhSZWN0 YW5nbGUgKnIsCiAgIHN0cnVjdCBnbHlwaCAqbGFzdDsKICAgaW50IGZpcnN0X3gsIHN0YXJ0X3gs IHg7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKICAgaWYgKGFyZWEgPT0gVEVYVF9BUkVBICYmIHJvdy0+ZmlsbF9saW5lX3ApCisgICAgewor ICAgICAgaWYgKHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbTUNfQ0FDSEVdID4gMAorICAgICAg ICAgIHx8IHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbQ0hfQ0FDSEVdID4gMAorICAgICAgICAg IHx8IHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbRkNfQ0FDSEVdID4gMCkKKyAgICAgICAgewor ICAgICAgICAgIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4 OworICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7Cisg ICAgICAgICAgaW50IHN0YXJ0X3ggPSAwOworICAgICAgICAgIGludCBzdGFydF9ocG9zID0gMDsK KyAgICAgICAgICBpbnQgZW5kX2hwb3MgPSByb3ctPnVzZWRbVEVYVF9BUkVBXTsKKyAgICAgICAg ICBib29sIGNsZWFyX2VvbF9wID0gZmFsc2U7CisgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19m YWNlIGhsID0gRFJBV19OT1JNQUxfVEVYVDsKKyAgICAgICAgICBUUkFDRSAoKHN0ZGVyciwgImV4 cG9zZV9hcmVhICglZCk6ICBXcml0ZSB0aGUgd2hvbGUgbGluZS5cbiIsIHZwb3MpKTsKKyAgICAg ICAgICBtY19yZWRyYXdfcm93ICh3LCBtYXRyaXgsIHJvdywgc3RhcnRfeCwgc3RhcnRfaHBvcywg ZW5kX2hwb3MsIGNsZWFyX2VvbF9wLCBobCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQogICAg IC8qIElmIHJvdyBleHRlbmRzIGZhY2UgdG8gZW5kIG9mIGxpbmUgd3JpdGUgdGhlIHdob2xlIGxp bmUuICAqLwogICAgIGRyYXdfZ2x5cGhzICh3LCAwLCByb3csIGFyZWEsCiAJCSAwLCByb3ctPnVz ZWRbYXJlYV0sCiAJCSBEUkFXX05PUk1BTF9URVhULCAwKTsKKyAgICB9CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKICAgZWxzZQogICAgIHsKICAgICAgIC8qIFNldCBTVEFSVF9YIHRv IHRoZSB3aW5kb3ctcmVsYXRpdmUgc3RhcnQgcG9zaXRpb24gZm9yIGRyYXdpbmcgZ2x5cGhzIG9m CkBAIC0zMTk4MSwxMSArMzY5ODgsMzYgQEAgZXhwb3NlX2FyZWEgKHN0cnVjdCB3aW5kb3cgKncs IHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgWFJlY3RhbmdsZSAqciwKIAkgICsrbGFzdDsKIAl9CiAK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAg ICAgIC8qIFJlcGFpbnQuICAqLwotICAgICAgaWYgKGxhc3QgPiBmaXJzdCkKKyAgICAgIC8qIEZs b2F0aW5nIGZha2UgY3Vyc29ycyB3aWxsIGV4aXN0IHdoZW4gKGxhc3QgPT0gZmlyc3QpLiAqLwor ICAgICAgaWYgKCh3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW01DX0NBQ0hFXSA+IDAKKyAgICAg ICAgICAgfHwgdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtDSF9DQUNIRV0gPiAwCisgICAgICAg ICAgIHx8IHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbRkNfQ0FDSEVdID4gMCkKKyAgICAgICAg ICAmJiBhcmVhID09IFRFWFRfQVJFQSkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBnbHlw aF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworICAgICAgICAgIGludCB2cG9z ID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgICAgICAgICAgc3RhcnRfeCA9IGZp cnN0X3ggLSBzdGFydF94OworICAgICAgICAgIGludCBzdGFydF9ocG9zID0gZmlyc3QgLSByb3ct PmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgIGludCBlbmRfaHBvcyA9IGxhc3QgLSByb3ct PmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgIGJvb2wgY2xlYXJfZW9sX3AgPSBmYWxzZTsK KyAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UgaGwgPSBEUkFXX05PUk1BTF9URVhUOwor ICAgICAgICAgIFRSQUNFICgoc3RkZXJyLCAiZXhwb3NlX2FyZWEgKCVkKTogIHN0YXJ0X3ggKCVk KSB8IHN0YXJ0X2hwb3MgKCVkKSB8IGVuZF9ocG9zICglZClcbiIsCisgICAgICAgICAgICAgICAg ICAgICAgICAgIHZwb3MsIHN0YXJ0X3gsIHN0YXJ0X2hwb3MsIGVuZF9ocG9zKSk7CisgICAgICAg ICAgbWNfcmVkcmF3X3JvdyAodywgbWF0cml4LCByb3csIHN0YXJ0X3gsIHN0YXJ0X2hwb3MsIGVu ZF9ocG9zLCBjbGVhcl9lb2xfcCwgaGwpOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKGxh c3QgPiBmaXJzdCkKIAlkcmF3X2dseXBocyAodywgZmlyc3RfeCAtIHN0YXJ0X3gsIHJvdywgYXJl YSwKIAkJICAgICBmaXJzdCAtIHJvdy0+Z2x5cGhzW2FyZWFdLCBsYXN0IC0gcm93LT5nbHlwaHNb YXJlYV0sCiAJCSAgICAgRFJBV19OT1JNQUxfVEVYVCwgMCk7CisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworCisKICAgICB9CiB9CiAKQEAgLTMxOTk5LDEwICszNzAzMSwzNSBAQCBleHBvc2Vf bGluZSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqcm93LCBYUmVjdGFuZ2xl ICpyKQogewogICBlYXNzZXJ0IChyb3ctPmVuYWJsZWRfcCk7CiAKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgaWYgKHJvdy0+bW9kZV9saW5l X3AgfHwgdy0+cHNldWRvX3dpbmRvd19wKQorICAgIHsKKyAgICAgIGlmICh3LT5tY19tYXRyaXgu Y3Vyc29yc191c2VkW01DX0NBQ0hFXSA+IDAKKyAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vy c29yc191c2VkW0NIX0NBQ0hFXSA+IDAKKyAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29y c191c2VkW0ZDX0NBQ0hFXSA+IDApCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhf bWF0cml4ICptYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAgICAgICAgICBpbnQgdnBvcyA9 IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAgICAgICAgIGludCBzdGFydF94ID0g MDsKKyAgICAgICAgICBpbnQgc3RhcnRfaHBvcyA9IDA7CisgICAgICAgICAgaW50IGVuZF9ocG9z ID0gcm93LT51c2VkW1RFWFRfQVJFQV07CisgICAgICAgICAgYm9vbCBjbGVhcl9lb2xfcCA9IGZh bHNlOworICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBobCA9IERSQVdfTk9STUFMX1RF WFQ7CisgICAgICAgICAgVFJBQ0UgKChzdGRlcnIsICJleHBvc2VfbGluZSAoJWQpOiAgV3JpdGUg dGhlIHdob2xlIGxpbmUuXG4iLCB2cG9zKSk7CisgICAgICAgICAgbWNfcmVkcmF3X3JvdyAodywg bWF0cml4LCByb3csIHN0YXJ0X3gsIHN0YXJ0X2hwb3MsIGVuZF9ocG9zLCBjbGVhcl9lb2xfcCwg aGwpOworICAgICAgICB9CisgICAgICAgIGVsc2UKICAgICBkcmF3X2dseXBocyAodywgMCwgcm93 LCBURVhUX0FSRUEsCiAJCSAwLCByb3ctPnVzZWRbVEVYVF9BUkVBXSwKIAkJIERSQVdfTk9STUFM X1RFWFQsIDApOworICAgIH0KKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBlbHNl CiAgICAgewogICAgICAgaWYgKHJvdy0+dXNlZFtMRUZUX01BUkdJTl9BUkVBXSkKQEAgLTMyNTUw LDYgKzM3NjA3LDIyIEBAIHhfaW50ZXJzZWN0X3JlY3RhbmdsZXMgKFhSZWN0YW5nbGUgKnIxLCBY UmVjdGFuZ2xlICpyMiwgWFJlY3RhbmdsZSAqcmVzdWx0KQogdm9pZAogc3ltc19vZl94ZGlzcCAo dm9pZCkKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNP UlMgKi8KKworICBkZWZzdWJyICgmU21jX2R1bXBfZ2x5cGhfcm93KTsKKworICBkZWZzdWJyICgm U21jX2R1bXBfZ2x5cGhfbWF0cml4KTsKKworICBkZWZzdWJyICgmU21jX2N1cnJlbnRfY29sdW1u KTsKKworICBkZWZzdWJyICgmU21jX3N0ZGVycik7CisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKICAgVndpdGhfZWNob19hcmVhX3NhdmVfdmVjdG9yID0gUW5pbDsKICAgc3RhdGljcHJv ICgmVndpdGhfZWNob19hcmVhX3NhdmVfdmVjdG9yKTsKIApkaWZmIC0tZ2l0IGEvc3JjL3h0ZXJt LmMgYi9zcmMveHRlcm0uYwppbmRleCA1YWEzZTNmLi42MjdmNDFiIDEwMDY0NAotLS0gYS9zcmMv eHRlcm0uYworKysgYi9zcmMveHRlcm0uYwpAQCAtMTMyLDYgKzEzMiw4ODUgQEAgYWxvbmcgd2l0 aCBHTlUgRW1hY3MuICBJZiBub3QsIHNlZSA8aHR0cHM6Ly93d3cuZ251Lm9yZy9saWNlbnNlcy8+ LiAgKi8KICNpbmNsdWRlIDxYMTEvWEtCbGliLmg+CiAjZW5kaWYKIAorCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExFLUNVUlNPUlMgKi8KKworI2lmZGVmIEdMWVBI X0RFQlVHCitzdGF0aWMgdm9pZCB4X2NoZWNrX2ZvbnQgKHN0cnVjdCBmcmFtZSAqLCBzdHJ1Y3Qg Zm9udCAqKTsKKyNlbmRpZgorCitzdGF0aWMgdm9pZCB4X3NldF9tb2RlX2xpbmVfZmFjZV9nYyAo c3RydWN0IGdseXBoX3N0cmluZyAqKTsKKworc3RhdGljIHZvaWQgeF9zZXRfbW91c2VfZmFjZV9n YyAoc3RydWN0IGdseXBoX3N0cmluZyAqKTsKKworc3RhdGlj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lbHNl IGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUikKKyAgICB7CisgICAgICBtY194X3NldF9jdXJzb3Jf Z2MgKHMsIGN1cnNvcl9nY19wKTsKKyAgICAgIHMtPnN0aXBwbGVkX3AgPSBmYWxzZTsKKyAgICB9 CisgIGVsc2UgaWYgKHMtPmhsID09IERSQVdfTU9VU0VfRkFDRSkKKyAgICB7CisgICAgICB4X3Nl dF9tb3VzZV9mYWNlX2djIChzKTsKKyAgICAgIHMtPnN0aXBwbGVkX3AgPSBzLT5mYWNlLT5zdGlw cGxlICE9IDA7CisgICAgfQorICBlbHNlIGlmIChzLT5obCA9PSBEUkFXX0lNQUdFX1JBSVNFRAor ICAgICAgICAgICB8fCBzLT5obCA9PSBEUkFXX0lNQUdFX1NVTktFTikKKyAgICB7CisgICAgICBz LT5nYyA9IHMtPmZhY2UtPmdjOworICAgICAgcy0+c3RpcHBsZWRfcCA9IHMtPmZhY2UtPnN0aXBw bGUgIT0gMDsKKyAgICB9CisgIGVsc2UKKyAgICBlbWFjc19hYm9ydCAoKTsKKyAgLyogR0MgbXVz dCBoYXZlIGJlZW4gc2V0LiAqLworICBlYXNzZXJ0IChzLT5nYyAhPSAwKTsKK30KKworLyogRHJh dyBhIGhvbGxvdyBib3ggY3Vyc29yIG9uIHdpbmRvdyBXIGluIGdseXBoIHJvdyBST1cuICovCitz dGF0aWMgdm9pZAorbWNfeF9kcmF3X2hvbGxvd19jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0 cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAg ICAgICAgICAgICAgICAgICAgIGludCB4LCBpbnQgZngsIGludCB5LCBpbnQgZnksIGludCBocG9z LCBpbnQgdnBvcywgaW50IHdkLCBpbnQgaCkKK3sKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1F IChXSU5ET1dfRlJBTUUgKHcpKTsKKyAgc3RydWN0IHhfZG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pbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93 ICpyb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHgsIGludCBmeCwgaW50IHksIGlu dCBmeSwgaW50IGhwb3MsIGludCB2cG9zLCBpbnQgd2QsCisgICAgICAgICAgICAgICAgICAgICAg ICAgaW50IGgsIHN0cnVjdCBtY19SR0IgbHNsLCBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90 eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGgsIGVudW0gbWNf Zmxhdm9yIGdseXBoX2ZsYXZvciwgYm9vbCBvbl9wLAorICAgICAgICAgICAgICAgICAgICAgICAg IGJvb2wgYWN0aXZlX3ApCit7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAoV0lORE9XX0ZS QU1FICh3KSk7CisgIC8qIFRoZSBmcmluZ2UgYml0bWFwcyBhcmUgcHJlc2VudGx5IGhhbmRsZWQg ZWxzZXdoZXJlLCBidXQgY291bGQgc29tZWRheQorICBiZSBtYW5hZ2VkIChpbiBwYXJ0KSBhdCB0 aGlzIHNlY3Rpb24gb2YgY29kZS4gKi8KKyAgaWYgKG9uX3ApCisgICAgeworICAgICAgaWYgKHJv dy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVfcAorICAgICAgICAgICYmIChyb3ctPnJldmVyc2Vk X3AKKyAgICAgICAgICAgICAgPyAoaHBvcyA8IDApCisgICAgICAgICAgICAgIDogKGhwb3MgPj0g cm93LT51c2VkW1RFWFRfQVJFQV0pKSkKKyAgICAgICAgeworICAgICAgICAgIHJvdy0+Y3Vyc29y X2luX2ZyaW5nZV9wID0gdHJ1ZTsKKyAgICAgICAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXAgKHcs IHJvdywgcm93LT5yZXZlcnNlZF9wLCBjdXJzb3JfdHlwZSk7CisgICAgICAgIH0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uZCk7CisgICAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQg KEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93 X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2UtPmJhY2tncm91bmQpOworICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICAgIGVsc2UgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAg ICAgICAmJiBhY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgt PmNoYXJwb3MgPiByZWdpb25fYmVnCisgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9n bHlwaC0+Y2hhcnBvcyA8IHJlZ2lvbl9lbmQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZV9p ZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3It aW4tcmVnaW9uLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgc3RydWN0 IGZhY2UgKmhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZSA9IEZBQ0VfRlJPTV9JRCAo ZiwgaG9sbG93X2FjdGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNlX2lkKTsKKyAgICAgICAgICAgICAg ICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFj ZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUp OworICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFjZSA9IEZB Q0VfRlJPTV9JRC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mFja2dyb3VuZCk7CisgICAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAgICAgICBlbHNlIGlmICghYWN0aXZlX3ApCisgICAgICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0aXZl X2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2Ut Y3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAg ICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwg aG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICAgIFhTZXRGb3Jl Z3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2Ms IGhvbGxvd19pbmFjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgICAg ICBYU2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+ Y3Vyc29yX2djLCBob2xsb3dfaW5hY3RpdmVfZmFjZS0+YmFja2dyb3VuZCk7CisgICAgICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAvKiBGb3Jj ZSBgbWNfeF9zZXRfY3Vyc29yX2djJyB0byB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLngtPmN1cnNv cl9nYycuICovCisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IHRydWU7CisgICAgICAgICAg bWNfZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBv cywgdnBvcywgb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tPmN1cnNvcl9waXhlbCA9IGNvbG9yLnBp eGVsOworICAgICAgICAgICAgbWNfeF9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93 LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAgICAgICAgICAgIGYtPm91dHB1 dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAg ICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBUZW1w b3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYycgYnkgYm9ycm93aW5n IHRoZQorICAgICAgICAgICAgICBmdW5jdGlvbmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHhmbnMu Yy4gKi8KKyAgICAgICAgICAgICAgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAg ICAgJiYgYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+Y2hhcnBv cyA9PSByZWdpb25fYmVnKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGVu dW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZWdfZmFjZV9pZCA9IGxvb2t1cF9uYW1l ZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItYXQtcmVnaW9uLXByZS16 di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19h Y3RpdmVfcmVnaW9uX2JlZ19mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX3Jl Z2lvbl9iZWdfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93 X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVh bC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgIHN0 cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19h Y3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVf WF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfYWN0aXZl X2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZS QU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2Fj dGl2ZV9yZWdpb25fYmVnX2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBhY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9n bHlwaC0+Y2hhcnBvcyA9PSByZWdpb25fZW5kKQorICAgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2Vf aWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29y LWF0LXJlZ2lvbi1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgc3Ry dWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfcmVnaW9uX2VuZF9mYWNlID0gRkFDRV9GUk9NX0lEIChm LCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAg IGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAo dywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOwor ICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFD RV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAg ICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+ Y3Vyc29yX2djLCBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAg ICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2Rh dGEueC0+Y3Vyc29yX2djLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZS0+YmFja2dyb3Vu ZCk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmIChyZWdp b25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9wCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3MgPiByZWdpb25f YmVnCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3Mg PCByZWdpb25fZW5kKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAg ICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZV9pZ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mYWNlX2lkIGhvbGxvd19hY3RpdmVfZmFjZV9pZCA9IGxv b2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItcHJlLXp2 LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9s bG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQp OworICAgICAgICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExB WSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9mYWNlLT5m b3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIFhTZXRCYWNrZ3JvdW5kIChGUkFN RV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19hY3Rp dmVfZmFjZS0+YmFja2dyb3VuZCk7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgICAgICAgICAgIGVsc2UgaWYgKCFhY3RpdmVfcCkKKyAgICAgICAgICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2 ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtl LWN1cnNvci1pbmFjdGl2ZS1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19pbmFjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lE IChmLCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAg IFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5j dXJzb3JfZ2MsIGhvbGxvd19pbmFjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91 dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2luYWN0aXZlX2ZhY2UtPmJhY2tncm91bmQp OworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBibG9ja19pbnB1dCAo KTsKKyAgICAgICAgICAgICAgLyogRm9yY2UgYG1jX3hfc2V0X2N1cnNvcl9nYycgdG8gdXNlIGBz LT5mLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MnLiAqLworICAgICAgICAgICAgICBib29sIGN1 cnNvcl9nY19wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcs IG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2Qs IGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX2dj X3ApOworICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwg Zi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCB4Z2N2LmZvcmVncm91bmQpOworICAgICAgICAg ICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEu eC0+Y3Vyc29yX2djLCB4Z2N2LmJhY2tncm91bmQpOworICAgICAgICAgICAgICB1bmJsb2NrX2lu cHV0ICgpOworICAgICAgICAgICAgICAvKiBEcmF3IHRoZSBmcmFtZSBhcm91bmQgdGhlIGJveC4g Ki8KKyAgICAgICAgICAgICAgbWNfeF9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93 LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAgICAgICAgICAgIH0KKyAgICAg IGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0hPTExPV19CT1g6CisgICAgeworICAgICAgaWYg KGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAg ICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5j dXJzb3JfcGl4ZWwnLiAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhl bCA9IGNvbG9yLnBpeGVsOworICAgICAgICAgIG1jX3hfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBt YXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICAgICAg Zi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOwor ICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICBtY194X2RyYXdfaG9sbG93X2N1cnNv ciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAg ICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAgICB7CisgICAgICBp ZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAg ICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0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1dCAoKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAg ICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNfZHJhd19j dXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywg bHNsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgY3Vy c29yX3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOworICAgICAgICAgIH0KKyAgICAg IGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0JBUjoKKyAgICB7CisgICAgICBpZiAobHNsLnJl ZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAg ICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9w aXhlbCcuICovCisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gY29s b3IucGl4ZWw7CisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IHRy dWU7CisgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBm eCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBjdXJzb3Jfd2lkdGgsIE1DX0JBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOwor ICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNv cl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAg ICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IGZhbHNlOworICAgICAgICAgICAg bWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3Ms IHZwb3MsIHdkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl93 aWR0aCwgTUNfQkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgfQor ICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfSEJBUjoKKyAgICB7CisgICAgICBpZiAo bHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAg IHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1 cnNvcl9waXhlbCcuICovCisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVs ID0gY29sb3IucGl4ZWw7CisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlf cCA9IHRydWU7CisgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93 LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIE1DX0hCQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2th eV9wKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5h bF9jdXJzb3JfcGl4ZWw7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAg ICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSBmYWxzZTsKKyAgICAg ICAgICAgIG1jX3hfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5 LCBocG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoLCBj dXJzb3Jfd2lkdGgsIE1DX0hCQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAg ICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fi b3J0ICgpOworICB9CisgICAgICAgIH0KKyNpZmRlZiBIQVZFX1hfSTE4TgorICBpZiAodyA9PSBY V0lORE9XIChmLT5zZWxlY3RlZF93aW5kb3cpKQorICAgIGlmIChGUkFNRV9YSUMgKGYpICYmIChG UkFNRV9YSUNfU1RZTEUgKGYpICYgWElNUHJlZWRpdFBvc2l0aW9uKSkKKyAgICAgIHhpY19zZXRf cHJlZWRpdGFyZWEgKHcsIHgsIHkpOworI2VuZGlmCisgICAgfQorICBYRmx1c2ggKEZSQU1FX1hf RElTUExBWSAoZikpOworfQorCisvKiBEcmF3IHN0cmV0Y2ggZ2x5cGggc3RyaW5nIFMuICovCitz dGF0aWMgdm9pZAorbWNfeF9kcmF3X3N0cmV0Y2hfZ2x5cGhfc3RyaW5nIChzdHJ1Y3QgZ2x5cGhf c3RyaW5nICpzKQoreworICBlYXNzZXJ0IChzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBTVFJFVENI X0dMWVBIKTsKKyAgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SCisgICAgICAmJiAheF9zdHJldGNo X2N1cnNvcl9wKQorICAgIHsKKyAgICAgIC8qIElmIGB4LXN0cmV0Y2gtY3Vyc29yJyBpcyBuaWws IGRvbid0IGRyYXcgYSBibG9jayBjdXJzb3IgYXMgd2lkZSBhcyB0aGUKKyAgICAgIHN0cmV0Y2gg Z2x5cGguICovCisgICAgICBpbnQgd2lkdGgsIGJhY2tncm91bmRfd2lkdGggPSBzLT5iYWNrZ3Jv dW5kX3dpZHRoOworICAgICAgaW50IHggPSBzLT54OworICAgICAgaWYgKCFzLT5yb3ctPnJldmVy c2VkX3ApCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgbGVmdF94ID0gd2luZG93X2JveF9sZWZ0 X29mZnNldCAocy0+dywgVEVYVF9BUkVBKTsKKyAgICAgICAgICBpZiAoeCA8IGxlZnRfeCkKKyAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgYmFja2dyb3VuZF93aWR0aCAtPSBsZWZ0X3ggLSB4 OworICAgICAgICAgICAgICB4ID0gbGVmdF94OworICAgICAgICAgICAgfQorICAgICAgICB9Cisg ICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICAvKiBJbiBSMkwgcm93cywgZHJh dyB0aGUgY3Vyc29yIG9uIHRoZSByaWdodCBlZGdlIG9mIHRoZQorICAgICAgICAgICAgICAgc3Ry ZXRjaCBnbHlwaC4gKi8KKyAgICAgICAgICAgIGludCByaWdodF94ID0gd2luZG93X2JveF9yaWdo dCAocy0+dywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgIGlmICh4ICsgYmFja2dyb3VuZF93aWR0 aCA+IHJpZ2h0X3gpCisgICAgICAgICAgICAgIGJhY2tncm91bmRfd2lkdGggLT0geCAtIHJpZ2h0 X3g7CisgICAgICAgICAgICB4ICs9IGJhY2tncm91bmRfd2lkdGg7CisgICAgICAgICAgfQorICAg ICAgd2lkdGggPSBtaW4gKEZSQU1FX0NPTFVNTl9XSURUSCAocy0+ZiksIGJhY2tncm91bmRfd2lk dGgpOworICAgICAgaWYgKHMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAgICAgICAgeCAtPSB3aWR0aDsK KyAgICAgIC8qIERyYXcgY3Vyc29yLiAqLworICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19iZ19y ZWN0IChzLCB4LCBzLT55LCB3aWR0aCwgcy0+aGVpZ2h0KTsKKyAgICAgIC8qIENsZWFyIHJlc3Qg dXNpbmcgdGhlIEdDIG9mIHRoZSBvcmlnaW5hbCBub24tY3Vyc29yIGZhY2UuICovCisgICAgICBp ZiAod2lkdGggPCBiYWNrZ3JvdW5kX3dpZHRoKQorICAgICAgICB7CisgICAgICAgICAgaW50IHkg PSBzLT55OworICAgICAgICAgIGludCB3ID0gYmFja2dyb3VuZF93aWR0aCAtIHdpZHRoLCBoID0g cy0+aGVpZ2h0OworICAgICAgICAgIFhSZWN0YW5nbGUgcjsKKyAgICAgICAgICBHQyBnYzsKKyAg ICAgICAgICBpZiAoIXMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAgICAgICAgICAgIHggKz0gd2lkdGg7 CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeCA9IHMtPng7CisgICAgICAgICAgaWYgKHMt PnJvdy0+bW91c2VfZmFjZV9wCisgICAgICAgICAgICAgICYmIGN1cnNvcl9pbl9tb3VzZV9mYWNl X3AgKHMtPncpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICB4X3NldF9tb3VzZV9mYWNl X2djIChzKTsKKyAgICAgICAgICAgICAgZ2MgPSBzLT5nYzsKKyAgICAgICAgICAgIH0KKyAgICAg ICAgICBlbHNlCisgICAgICAgICAgICBnYyA9IHMtPmZhY2UtPmdjOworICAgICAgICAgIGdldF9n bHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCAmcik7CisgICAgICAgICAgeF9zZXRfY2xpcF9yZWN0 YW5nbGVzIChzLT5mLCBnYywgJnIsIDEpOworICAgICAgICAgIGlmIChzLT5mYWNlLT5zdGlwcGxl KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBGaWxsIGJhY2tncm91bmQgd2l0aCBh IHN0aXBwbGUgcGF0dGVybi4gKi8KKyAgICAgICAgICAgICAgWFNldEZpbGxTdHlsZSAocy0+ZGlz cGxheSwgZ2MsIEZpbGxPcGFxdWVTdGlwcGxlZCk7CisgICAgICAgICAgICAgIHhfZmlsb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yaW5nIGluc3Rl YWQgb2YgWERyYXdJbWFnZVN0cmluZy4gKi8KKyAgaWYgKHMtPm5leHQgJiYgcy0+cmlnaHRfb3Zl cmhhbmcgJiYgIXMtPmZvcl9vdmVybGFwcykKKyAgICB7CisgICAgICBpbnQgd2lkdGg7CisgICAg ICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpuZXh0OworICAgICAgZm9yICh3aWR0aCA9IDAsIG5leHQg PSBzLT5uZXh0OworICAgICAgICAgICBuZXh0ICYmIHdpZHRoIDwgcy0+cmlnaHRfb3Zlcmhhbmc7 CisgICAgICAgICAgIHdpZHRoICs9IG5leHQtPndpZHRoLCBuZXh0ID0gbmV4dC0+bmV4dCkKKyAg ICAgICAgaWYgKG5leHQtPmZpcnN0X2dseXBoLT50eXBlICE9IElNQUdFX0dMWVBIKQorICAgICAg ICAgIHsKKyAgICAgICAgICAgIG1jX3hfc2V0X2dseXBoX3N0cmluZ19nYyAobmV4dCwgY3Vyc29y X2djX3ApOworICAgICAgICAgICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nIChuZXh0KTsK KyAgICAgICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBI KQorICAgICAgICAgICAgICBtY194X2RyYXdfc3RyZXRjaF9nbHlwaF9zdHJpbmcgKG5leHQpOwor ICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tn cm91bmQgKG5leHQsIHRydWUpOworICAgICAgICAgICAgbmV4dC0+bnVtX2NsaXBzID0gMDsKKyAg ICAgICAgICB9CisgICAgfQorICAvKiBTZXQgdXAgUy0+Z2MsIHNldCBjbGlwcGluZyBhbmQgZHJh dyBTLiAqLworICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKHMsIGN1cnNvcl9nY19wKTsKKyAg LyogRHJhdyByZWxpZWYgKGlmIGFueSkgaW4gYWR2YW5j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JoYW5nIHBhcnQgd2lsbCBiZQorICAgICAgICAgZHJhd24gbGF0ZXIgd2hlbiBz LT5uZXh0IGlzIGRyYXduLiAqLworICAgICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nX2V4 YWN0bHkgKHMsIHMpOworICAgICAgZWxzZQorICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xp cHBpbmcgKHMpOworICBzd2l0Y2ggKHMtPmZpcnN0X2dseXBoLT50eXBlKQorICAgIHsKKyAgICBj YXNlIElNQUdFX0dMWVBIOgorICAgICAgeF9kcmF3X2ltYWdlX2dseXBoX3N0cmluZyAocyk7Cisg ICAgICBicmVhazsKKyAgICBjYXNlIFhXSURHRVRfR0xZUEg6CisgICAgICB4X2RyYXdfeHdpZGdl dF9nbHlwaF9zdHJpbmcgKHMpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBTVFJFVENIX0dMWVBI OgorICAgICAgbWNfeF9kcmF3X3N0cmV0Y2hfZ2x5cGhfc3RyaW5nIChzKTsKKyAgICAgIGJyZWFr OworICAgIGNhc2UgQ0hBUl9HTFlQSDoKKyAgICAgIGlmIChzLT5mb3Jfb3ZlcmxhcHMpCisgICAg ICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVlOworICAgICAgZWxzZQorICAgICAgICB4 X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKHMsIGZhbHNlKTsKKyAgICAgIHhfZHJhd19n bHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAgICBicmVhazsKKyAgICBjYXNlIENPTVBP U0lURV9HTFlQSDoKKyAgICAgIGlmIChzLT5mb3Jfb3ZlcmxhcHMgfHwgKHMtPmNtcF9mcm9tID4g MAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgISBzLT5maXJzdF9nbHlwaC0+dS5j bXAuYXV0b21hdGljKSkKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7Cisg ICAgICBlbHNlCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgdHJ1 ZSk7CisgICAgICB4X2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsK KyAgICAgIGJyZWFrOworICAgIGNhc2UgR0xZUEhMRVNTX0dMWVBIOgorICAgICAgaWYgKHMtPmZv cl9vdmVybGFwcykKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAg ICBlbHNlCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgdHJ1ZSk7 CisgICAgICB4X2RyYXdfZ2x5cGhsZXNzX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAg ICAgIGJyZWFrOworICAgIGRlZmF1bHQ6CisgICAgICBlbWFjc19hYm9ydCAoKTsKKyAgICB9Cisg IGlmICghcy0+Zm9yX292ZXJsYXBzKQorICAgIHsKKyAgICAgIC8qIERyYXcgdW5kZXJsaW5lLiAq LworICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9wKQorICAgICAgICB7CisgICAgICAgICAg aWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfV0FWRSkKKyAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkK KyAgICAgICAgICAgICAgICB4X2RyYXdfdW5kZXJ3YXZlIChzKTsKKyAgICAgICAgICAgICAgZWxz ZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIFhHQ1ZhbHVlcyB4Z2N2Owor ICAgICAgICAgICAgICAgICAgWEdldEdDVmFsdWVzIChzLT5kaXNwbGF5LCBzLT5nYywgR0NGb3Jl Z3JvdW5kLCAmeGdjdik7CisgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAocy0+ZGlz cGxheSwgcy0+Z2MsIHMtPmZhY2UtPnVuZGVybGluZV9jb2xvcik7CisgICAgICAgICAgICAgICAg ICB4X2RyYXdfdW5kZXJ3YXZlIChzKTsKKyAgICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5k IChzLT5kaXNwbGF5LCBzLT5nYywgeGdjdi5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxzZSBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3R5 cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICB1bnNp Z25lZCBsb25nIHRoaWNrbmVzcywgcG9zaXRpb247CisgICAgICAgICAgICAgIGludCB5OworICAg ICAgICAgICAgICBpZiAocy0+cHJldiAmJiBzLT5wcmV2LT5mYWNlLT51bmRlcmxpbmVfcAorICAg ICAgICAgICAgICAgICAgJiYgcy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9V TkRFUl9MSU5FKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIC8qIFdlIHVz ZSB0aGUgc2FtZSB1bmRlcmxpbmUgc3R5bGUgYXMgdGhlIHByZXZpb3VzIG9uZS4gKi8KKyAgICAg ICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPnByZXYtPnVuZGVybGluZV90aGlja25lc3M7Cisg ICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPnByZXYtPnVuZGVybGluZV9wb3NpdGlvbjsK KyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7 CisgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVybGluZSB0aGlja25lc3MuICBEZWZh dWx0IGlzIDEgcGl4ZWwuICovCisgICAgICAgICAgICAgICAgICBpZiAocy0+Zm9udCAmJiBzLT5m b250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4gMCkKKyAgICAgICAgICAgICAgICAgICAgdGhpY2tu ZXNzID0gcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gMTsKKyAgICAgICAgICAgICAgICAg IGlmICh4X3VuZGVybGluZV9hdF9kZXNjZW50X2xpbmUpCisgICAgICAgICAgICAgICAgICAgIHBv c2l0aW9uID0gKHMtPmhlaWdodCAtIHRoaWNrbmVzcykgLSAocy0+eWJhc2UgLSBzLT55KTsKKyAg ICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJsaW5lIHBvc2l0aW9uLiAgVGhpcyBpcyB0aGUgcmVj b21tZW5kZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICB2ZXJ0aWNhbCBvZmZzZXQgaW4gcGl4 ZWxzIGZyb20gdGhlIGJhc2VsaW5lIHRvIHRoZSB0b3Agb2YKKyAgICAgICAgICAgICAgICAgICAg ICAgICB0aGUgdW5kZXJsaW5lLiAgVGhpcyBpcyBhIHNpZ25lZCB2YWx1ZSBhY2NvcmRpbmcgdG8g dGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgc3BlY3MsIGFuZCBpdHMgZGVmYXVsdCBpcwor ICAgICAgICAgICAgICAgICAgICAgICAgIFJPVU5EICgobWF4aW11bSBkZXNjZW50KSAvIDIpLCB3 aXRoCisgICAgICAgICAgICAgICAgICAgICAgICAgUk9VTkQoeCkgPSBmbG9vciAoeCArIDAuNSkg ICovCisgICAgICAgICAgICAgICAgICAgICAgaWYgKHhfdXNlX3VuZGVybGluZV9wb3NpdGlvbl9w cm9wZXJ0aWVzCisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHMtPmZvbnQgJiYgcy0+Zm9u dC0+dW5kZXJsaW5lX3Bvc2l0aW9uID49IDApCisgICAgICAgICAgICAgICAgICAgICAgICBwb3Np dGlvbiA9IHMtPmZvbnQtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgICAgICAg ICBlbHNlIGlmIChzLT5mb250KQorICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAo cy0+Zm9udC0+ZGVzY2VudCArIDEpIC8gMjsKKyAgICAgICAgICAgICAgICAgICAgICBlbHNlCisg ICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHVuZGVybGluZV9taW5pbXVtX29mZnNl dDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBt YXggKHBvc2l0aW9uLCB1bmRlcmxpbmVfbWluaW11bV9vZmZzZXQpOworICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgICAgLyogQ2hlY2sgdGhlIHNhbml0eSBvZiB0aGlja25lc3MgYW5kIHBv c2l0aW9uLiAgV2Ugc2hvdWxkCisgICAgICAgICAgICAgICAgIGF2b2lkIGRyYXdpbmcgdW5kZXJs aW5lIG91dCBvZiB0aGUgY3VycmVudCBsaW5lIGFyZWEuICovCisgICAgICAgICAgICAgIGlmIChz LT55ICsgcy0+aGVpZ2h0IDw9IHMtPnliYXNlICsgcG9zaXRpb24pCisgICAgICAgICAgICAgICAg cG9zaXRpb24gPSAocy0+aGVpZ2h0IC0gMSkgLSAocy0+eWJhc2UgLSBzLT55KTsKKyAgICAgICAg ICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQgPCBzLT55YmFzZSArIHBvc2l0aW9uICsgdGhpY2tu ZXNzKQorICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IChzLT55ICsgcy0+aGVpZ2h0KSAtIChz LT55YmFzZSArIHBvc2l0aW9uKTsKKyAgICAgICAgICAgICAgcy0+dW5kZXJsaW5lX3RoaWNrbmVz cyA9IHRoaWNrbmVzczsKKyAgICAgICAgICAgICAgcy0+dW5kZXJsaW5lX3Bvc2l0aW9uID0gcG9z aXRpb247CisgICAgICAgICAgICAgIHkgPSBzLT55YmFzZSArIHBvc2l0aW9uOworICAgICAgICAg ICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgICAg IHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCB5LCBzLT53aWR0aCwgdGhpY2tu ZXNzKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICAgIFhHQ1ZhbHVlcyB4Z2N2OworICAgICAgICAgICAgICAgICAgWEdldEdDVmFsdWVzIChz LT5kaXNwbGF5LCBzLT5nYywgR0NGb3JlZ3JvdW5kLCAmeGdjdik7CisgICAgICAgICAgICAgICAg ICBYU2V0Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwgcy0+Z2MsIHMtPmZhY2UtPnVuZGVybGluZV9j b2xvcik7CisgICAgICAgICAgICAgICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChzLT5mLCBzLT5nYywg cy0+eCwgeSwgcy0+d2lkdGgsIHRoaWNrbmVzcyk7CisgICAgICAgICAgICAgICAgICBYU2V0Rm9y ZWdyb3VuZCAocy0+ZGlzcGxheSwgcy0+Z2MsIHhnY3YuZm9yZWdyb3VuZCk7CisgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAvKiBEcmF3IG92ZXJsaW5l LiAqLworICAgICAgaWYgKHMtPmZhY2UtPm92ZXJsaW5lX3ApCisgICAgICAgIHsKKyAgICAgICAg ICB1bnNpZ25lZCBsb25nIGR5ID0gMCwgaCA9IDE7CisgICAgICAgICAgaWYgKHMtPmZhY2UtPm92 ZXJsaW5lX2NvbG9yX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgeF9maWxsX3JlY3RhbmdsZSAo cy0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z2MsIEdDRm9yZWdyb3VuZCwgJnhnY3YpOwor ICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwgcy0+Z2MsIHMtPmZhY2Ut PnN0cmlrZV90aHJvdWdoX2NvbG9yKTsKKyAgICAgICAgICAgICAgeF9maWxsX3JlY3RhbmdsZSAo cy0+Ziwgcy0+Z2MsIHMtPngsIHMtPnkgKyBkeSwgcy0+d2lkdGgsIGgpOworICAgICAgICAgICAg ICBYU2V0Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwgcy0+Z2MsIHhnY3YuZm9yZWdyb3VuZCk7Cisg ICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIC8qIERyYXcgcmVsaWVmIGlmIG5vdCB5ZXQg ZHJhd24uICovCisgICAgICBpZiAoIXJlbGllZl9kcmF3bl9wICYmIHMtPmZhY2UtPmJveCAhPSBG QUNFX05PX0JPWCkKKyAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JveCAocyk7CisgICAg ICBpZiAocy0+cHJldikKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBnbHlwaF9zdHJpbmcg KnByZXY7CisgICAgICAgICAgZm9yIChwcmV2ID0gcy0+cHJldjsgcHJldjsgcHJldiA9IHByZXYt PnByZXYpCisgICAgICAgICAgICBpZiAocHJldi0+aGwgIT0gcy0+aGwKKyAgICAgICAgICAgICAg ICAmJiBwcmV2LT54ICsgcHJldi0+d2lkdGggKyBwcmV2LT5yaWdodF9vdmVyaGFuZyA+IHMtPngp CisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBBcyBwcmV2IHdhcyBkcmF3biB3 aGlsZSBjbGlwcGVkIHRvIGl0cyBvd24gYXJlYSwgd2UKKyAgICAgICAgICAgICAgICAgICBtdXN0 IGRyYXcgdGhlIHJpZ2h0X292ZXJoYW5nIHBhcnQgdXNpbmcgcy0+aGwgbm93LiAqLworICAgICAg ICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBzYXZlID0gcHJldi0+aGw7CisgICAgICAg ICAgICAgICAgcHJldi0+aGwgPSBzLT5obDsKKyAgICAgICAgICAgICAgICBtY194X3NldF9nbHlw aF9zdHJpbmdfZ2MgKHByZXYsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICAgICAgICB4X3NldF9n bHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywgcHJldik7CisgICAgICAgICAgICAgICAg aWYgKHByZXYtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgpCisgICAgICAgICAgICAg ICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHByZXYpOworICAgICAgICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIHhfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5n X2ZvcmVncm91bmQgKHByZXYpOworICAgICAgICAgICAgICAgIHhfcmVzZXRfY2xpcF9yZWN0YW5n bGVzIChwcmV2LT5mLCBwcmV2LT5nYyk7CisgICAgICAgICAgICAgICAgcHJldi0+aGwgPSBzYXZl OworICAgICAgICAgICAgICAgIHByZXYtPm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgICAgIH0K KyAgICAgICAgfQorICAgICAgaWYgKHMtPm5leHQpCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1 Y3QgZ2x5cGhfc3RyaW5nICpuZXh0OworICAgICAgICAgIGZvciAobmV4dCA9IHMtPm5leHQ7IG5l eHQ7IG5leHQgPSBuZXh0LT5uZXh0KQorICAgICAgICAgICAgaWYgKG5leHQtPmhsICE9IHMtPmhs CisgICAgICAgICAgICAgICAgJiYgbmV4dC0+eCAtIG5leHQtPmxlZnRfb3ZlcmhhbmcgPCBzLT54 ICsgcy0+d2lkdGgpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBBcyBuZXh0 IHdpbGwgYmUgZHJhd24gd2hpbGUgY2xpcHBlZCB0byBpdHMgb3duIGFyZWEsCisgICAgICAgICAg ICAgICAgICAgd2UgbXVzdCBkcmF3IHRoZSBsZWZ0X292ZXJoYW5nIHBhcnQgdXNpbmcgcy0+aGwg bm93LiAqLworICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBzYXZlID0gbmV4 dC0+aGw7CisgICAgICAgICAgICAgICAgbmV4dC0+aGwgPSBzLT5obDsKKyAgICAgICAgICAgICAg ICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKG5leHQsIGN1cnNvcl9nY19wKTsKKyAgICAgICAg ICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywgbmV4dCk7Cisg ICAgICAgICAgICAgICAgaWYgKG5leHQtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgp CisgICAgICAgICAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5leHQp OworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIHhfZHJhd19jb21wb3Np dGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5leHQpOworICAgICAgICAgICAgICAgIHhfcmVz ZXRfY2xpcF9yZWN0YW5nbGVzIChuZXh0LT5mLCBuZXh0LT5nYyk7CisgICAgICAgICAgICAgICAg bmV4dC0+aGwgPSBzYXZlOworICAgICAgICAgICAgICAgIG5leHQtPm51bV9jbGlwcyA9IDA7Cisg ICAgICAgICAgICAgICAgbmV4dC0+Y2xpcF9oZWFkID0gcy0+bmV4dDsKKyAgICAgICAgICAgICAg fQorICAgICAgICB9CisgICAgfQorICAvKiBSZXNldCBjbGlwcGluZy4gKi8KKyAgeF9yZXNldF9j bGlwX3JlY3RhbmdsZXMgKHMtPmYsIHMtPmdjKTsKKyAgcy0+bnVtX2NsaXBzID0gMDsKK30KKwor LyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK IC8qIERlZmF1bHQgdG8gdXNpbmcgWElNIGlmIGF2YWlsYWJsZS4gICovCiAjaWZkZWYgVVNFX1hJ TQogYm9vbCB1c2VfeGltID0gdHJ1ZTsKQEAgLTk5OSw2ICsxODc4LDE1IEBAIHhfdXBkYXRlX2Jl Z2luIChzdHJ1Y3QgZnJhbWUgKmYpCiAgIGlmIChGUkFNRV9UT09MVElQX1AgKGYpICYmICFGUkFN RV9WSVNJQkxFX1AgKGYpKQogICAgIHJldHVybjsKIAorCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGluZ19mcmFtZSA9IGY7 CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgaWYgKCEgRlJBTUVfQ1JfU1VSRkFD RSAoZikpCiAgICAgewogICAgICAgaW50IHdpZHRoLCBoZWlnaHQ7CkBAIC0xMjY2LDYgKzIxNTQs MTYgQEAgeF91cGRhdGVfZW5kIChzdHJ1Y3QgZnJhbWUgKmYpCiAgIFhGbHVzaCAoRlJBTUVfWF9E SVNQTEFZIChmKSk7CiAgIHVuYmxvY2tfaW5wdXQgKCk7CiAjZW5kaWYKKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGlu Z19mcmFtZSA9IE5VTEw7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIH0KIAogLyog VGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgZnJvbSB2YXJpb3VzIHBsYWNlcyBpbiB4ZGlzcC5jCkBA IC0xMzEwMCw2ICsxMzk5OCwyMSBAQCB4X2FjdGl2YXRlX3RpbWVvdXRfYXRpbWVyICh2b2lkKQog CiBzdGF0aWMgc3RydWN0IHJlZGlzcGxheV9pbnRlcmZhY2UgeF9yZWRpc3BsYXlfaW50ZXJmYWNl ID0KICAgeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09S UyAqLworCisvKiBgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYHh0ZXJtLmNgIG11c3QgYmUgaW4g dGhlIGV4YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYGRp c3BleHRlcm4uaGAhICovCisKKyAgbWNfeF93cml0ZV9nbHlwaHMsCisgIG1jX3hfZHJhd193aW5k b3dfY3Vyc29yLAorICBtY194X2RyYXdfZ2x5cGhfc3RyaW5nLAorCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKworCiAgICAgeF9mcmFtZV9wYXJtX2hhbmRsZXJzLAogICAgIHhfcHJvZHVjZV9n bHlwaHMsCiAgICAgeF93cml0ZV9nbHlwaHMsCg== --Multipart_Sat_Jun__8_16:44:10_2019-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs). References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sun, 16 Jun 2019 08:08:02 +0000 Resent-Message-ID: <handler.22873.B22873.156067247726400 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22873 <at> debbugs.gnu.org,17684 <at> debbugs.gnu.org Cc: eliz@HIDDEN, johnw@HIDDEN, mbork@HIDDEN, rms@HIDDEN, akioburns@HIDDEN Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.156067247726400 (code B ref 22873); Sun, 16 Jun 2019 08:08:02 +0000 Received: (at 22873) by debbugs.gnu.org; 16 Jun 2019 08:07:57 +0000 Received: from localhost ([127.0.0.1]:39646 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1hcQCj-0006rk-I7 for submit <at> debbugs.gnu.org; Sun, 16 Jun 2019 04:07:57 -0400 Received: from gateway20.websitewelcome.com ([192.185.68.24]:48990) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1hcQCh-0006rW-Dv for 22873 <at> debbugs.gnu.org; Sun, 16 Jun 2019 04:07:56 -0400 Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 209F540100753 for <22873 <at> debbugs.gnu.org>; Sun, 16 Jun 2019 02:06:40 -0500 (CDT) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id cQCghmuPn2qH7cQCghxQoJ; Sun, 16 Jun 2019 03:07:54 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Jd0TVFOgTlETVYjajjSh+0DBiZQ8r0br+KmaVlov44Q=; b=fNhiL8hmwn0Da66NYDutEFOWGj kYsdI2WnA1AIjssLeyt7lu6TnqtGZBHIMuIsPHRL0FDh58HN/OVLMQcxtE4dSoOB/QVlF7UVpPnj/ tgLqzRVVXLQfAWX/3hIv2khXGwsm+e4Ecvt+lwtFsaqWoWtRV+CY9uJOQqLqEfq4DcJRPckwe6mEW 6TBLmaHbqVX7Mc3E0q9M58/ZxUSEZyXBJkXoYruSBHt7qAtD88cgifgF7NJt1U5KonEVGckayBqhs 5Lx5W2eXNBGXiNpgAJx0K5c+jX0uv3/BMiLvrRtCZVvgUOvxtcCObUxdlr3VJ4E/GK4yYcA9TDajM qY6llDgw==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:58275 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.92) (envelope-from <esq@HIDDEN>) id 1hcQCc-00151f-F8; Sun, 16 Jun 2019 03:07:53 -0500 Date: Sun, 16 Jun 2019 01:07:46 -0700 Message-ID: <m2v9x6kl65.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Sun_Jun_16_01:07:46_2019-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1hcQCc-00151f-F8 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:58275 X-Source-Auth: lawlist X-Email-Count: 7 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> --Multipart_Sun_Jun_16_01:07:46_2019-1 Content-Type: text/plain; charset=US-ASCII VERSION: 021.002 [06/15/2019] CHANGELOG: - `mc_row_position': Added tests for an empty buffer (not narrowed) and an empty buffer (narrowed), both of which will be treated as an AT_ZV situation if VPOS is the first text row in the buffer excluding the header-line-format (if any). - Compacted all of the calls to `mc_redraw_row' so that they are one-liners. - Miscellaneous tidying up of code; changed a few names of some struct members. SCREENSHOTS (X11, W32, NS): https://www.lawlist.com/images/22873_17684_light_dark_backgrounds.png SETUP: Step 1: git clone -b master git://git.sv.gnu.org/emacs.git Step 2: In the new emacs folder, go back to an Emacs version from 04/08/2019: git reset --hard a038df77de7b1aa2d73a6478493b8838b59e4982 Step 3: From within the new emacs folder created in Step 1, apply the patch: git apply /path/to/the/patch.diff Step 4: ./autogen.sh Step 5: ./configure ... [your custom options] Step 6: make Step 7: make install USAGE: - For a minimal working example of built-in fake cursors, type: M-x mc-test ;;; TURN ON FAKE CURSORS (buffer position, cursor-type, cursor color): (setq mc-conf '((1 "hbar" "magenta") (2 "bar" "purple") (3 "box" "#00FF00") (4 "hollow" "#0000FF") (5 ("hbar" 3) [1.0 0.0 1.0]) (6 ("bar" 3) [0.0 1.0 1.0]) (7 "framed" "OrangeRed")))) ;;; TURN OFF FAKE CURSORS: (setq mc-conf nil) - To try out both the crosshairs feature and the visible fill column indicator feature, type: M-x +-mode - To try out just the visible fill column indicator feature, type: M-x fc-mode - To try out built-in fake cursors with Magnar Sveen's multiple-cursors package, install that package first. [If the multiple-cursors package is installed, an eval-after-load "multiple-cursors-core" statement within `crosshairs.el` will redefine a couple of functions and set up a few keyboard shortcuts.] If the multiple-cursors package by Magnar Sveen is not already installed, then here are two easy ways to install that package: Type: M-x mc-install OR, evaluate the following snippet: (progn (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) (package-refresh-contents) (package-install 'multiple-cursors)) TODO: - `ns_draw_window_cursor' calls `ns_clip_to_rect', which does _not_ take `row->clip` into consideration when drawing cursors with `NSRectFill'. When it comes time to draw glyphs on top of the box/hollow family of cursors, `row->clip` is taken into consideration by `get_glyph_string_clip'. Fake cursors can be drawn even though the glyphs cannot, resulting in hollow/box family of cursors without text. The issue can be reproduced with M-x mc-test. [A temporary workaround is to disable `row->clip` while drawing the glyphs.] https://lists.gnu.org/archive/html/emacs-devel/2019-04/msg00009.html - Add additional support for `ch_inactive_windows' and `fc_inactive_windows' when the variables have a `nil` value. In such a case, the inactive windows should not display the crosshairs and/or visible fill column indicator. At the present time, fake cursors are drawn in active/inactive windows alike. - Deal with left/right overwritten glyphs in the w32 and X ports of Emacs. - Is there any additional meaningful optimization that can be added to the three calls of `mc_pre_scroll_clean'? - NOTE: As to `mc_scrolling_window', it would appear that there is no tangible benefit to rotating the current/prospective cache of fake cursors to compare the data before removing the fake cursors. When scrolling the display, only _some_ lines are copied to new locations. Areas that are not overwritten may have fake cursors and those may not necessarily be removed if desired/current matrix glyphs are equal. The test for `GLYPH_EQUAL_P' does not take into consideration the existence of a fake cursor, and the glyph (with a fake cursor) may not be updated as a result thereof. As to lines that are not copied, portions may be updated and fake cursors would be removed thereby. - When an idle-timer fires and point is at the end of a horizontally scrolled line in a narrow window, the temporary horizontal scroll is canceled. Create an minimal working example and file a bug report. - There is a bug affecting an older version of Emacs for the NS port that causes partial line flickering when the same characters are grouped together (;;;;;;) and MC_GLYPHLESS cursors are above or below -- having the same background color as the frame; e.g., black on black (used to erase a glyphless cursor). The partial flickering is only noticeable with rapid fire; e.g., holding down the right/left arrow key. When changing the color of the glyphless cursor, the issue is not present. [@lawlist has verified that the X and HPOS coordinates are accurate.] - There is a bug affecting the recorded `w->mc.lnum_pixel_width` that is observable when not running under gdb, but disappears when running under gdb. While viewing a folded org-mode buffer, the non-gdb instance had a visible line number pixel-width of 44, but Emacs treated it as fluctuating between 44 and 55 as the cursor was moved to the end of line. In the gdb instance, the visible line number pixel width was 55 with no fluctuation under the same conditions as the non-gdb instance. This appears to be a different bug than bug#32177 (current line number shifts one column to the left) because the line number of the current line does not shift left, and changing the bidi settings did not correct the issue. - The current test for `auto_hscroll_mode_p' only looks for `current_line` and all five related tests are based upon that assumption, which may not be true. - Multiple Cursors: If point is in the middle of a composite character, then select a fully composed character so that the fake cursor is visible. - Implement functionality similar to the Lisp multiple-cursors by Magnar Sveen. - Follow up with the Emacs team re bug#32177; i.e., (Current line number shifts one column to the left.) - Follow up with the Emacs team re bug#32060; i.e., Horizontal Scrolling (Current Line): Wrong line gets h-scrolled. - Determine if bug #28936 needs to be fixed and help the Emacs team re same. --Multipart_Sun_Jun_16_01:07:46_2019-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="2019_06_15__21_52_03_071.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvY3Jvc3NoYWlycy5lbCBiL2xpc3AvY3Jvc3NoYWlycy5lbApuZXcg ZmlsZ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t YW5kLWZvci1mYWtlLWN1cnNvcgorICAgICAgKGlmIChlcSAxIChtYy9udW0tY3Vyc29ycykpIDs7 IG5vIGZha2UgY3Vyc29ycz8gZGlzYWJsZSBtYy1tb2RlCisgICAgICAgICAgKG11bHRpcGxlLWN1 cnNvcnMtbW9kZSAwKQorICAgICAgICAod2hlbiB0aGlzLW9yaWdpbmFsLWNvbW1hbmQKKyAgICAg ICAgICAobGV0ICgob3JpZ2luYWwtY29tbWFuZCAob3IgbWMtLXRoaXMtY29tbWFuZAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29tbWFuZC1yZW1hcHBpbmcgdGhpcy1v cmlnaW5hbC1jb21tYW5kKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0 aGlzLW9yaWdpbmFsLWNvbW1hbmQpKSkKKyAgICAgICAgICAgIDs7IHNraXAga2V5Ym9hcmQgbWFj cm9zLCBzaW5jZSB0aGV5IHdpbGwgZ2VuZXJhdGUgYWN0dWFsIGNvbW1hbmRzIHRoYXQgYXJlCisg ICAgICAgICAgICA7OyBhbHNvIHJ1biBpbiB0aGUgY29tbWFuZCBsb29wIC0gd2UnbGwgaGFuZGxl IHRob3NlIGxhdGVyIGluc3RlYWQuCisgICAgICAgICAgICAod2hlbiAoZnVuY3Rpb25wIG9yaWdp bmFsLWNvbW1hbmQpCisgICAgICAgICAgICAgIDs7IGlmIGl0J3MgYSBsYW1iZGEsIHdlIGNhbid0 IGtub3cgaWYgaXQncyBzdXBwb3J0ZWQgb3Igbm90CisgICAgICAgICAgICAgIDs7IC0gc28gZ28g YWhlYWQgYW5kIGFzc3VtZSBpdCdzIG9rLCBiZWNhdXNlIHdlJ3JlIGp1c3Qgb3B0aW1pc3RpYyBs aWtlIHRoYXQKKyAgICAgICAgICAgICAgKGlmIChvciAobm90IChzeW1ib2xwIG9yaWdpbmFsLWNv bW1hbmQpKQorICAgICAgICAgICAgICAgICAgICAgIDs7IGxhbWJkYSByZWdpc3RlcmVkIGJ5IHNt YXJ0cmVwCisgICAgICAgICAgICAgICAgICAgICAgKHN0cmluZy1wcmVmaXgtcCAiKCIgKHN5bWJv bC1uYW1lIG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAgICAgICAgICAgICAgICAgIChtYy9leGVjdXRl LWNvbW1hbmQtZm9yLWFsbC1mYWtlLWN1cnNvcnMgb3JpZ2luYWwtY29tbWFuZCkKKyAgICAgICAg ICAgICAgICA7OyBzbWFydHJlcCBgaW50ZXJuJ3MgY29tbWFuZHMgaW50byBvd24gb2JhcnJheSB0 byBoZWxwCisgICAgICAgICAgICAgICAgOzsgYGRlc2NyaWJlLWJpbmRpbmdzJy4gIFNvLCBsZXQn cyByZS1gaW50ZXJuJyBoZXJlIHRvCisgICAgICAgICAgICAgICAgOzsgbWFrZSB0aGUgY29tbWFu ZCBjb21wYXJhYmxlIGJ5IGBlcScuCisgICAgICAgICAgICAgICAgKHNldHEgb3JpZ2luYWwtY29t bWFuZCAoaW50ZXJuIChzeW1ib2wtbmFtZSBvcmlnaW5hbC1jb21tYW5kKSkpCisgICAgICAgICAg ICAgICAgOzsgb3RoZXJ3aXNlIGl0J3MgYSBzeW1ib2wsIGFuZCB3ZSBjYW4gYmUgbW9yZSB0aG9y b3VnaAorICAgICAgICAgICAgICAgIChpZiAoZ2V0IG9yaWdpbmFsLWNvbW1hbmQgJ21jLS11bnN1 cHBvcnRlZCkKKyAgICAgICAgICAgICAgICAgICAgKG1lc3NhZ2UgIiVTIGlzIG5vdCBzdXBwb3J0 ZWQgd2l0aCBtdWx0aXBsZSBjdXJzb3JzJXMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg IG9yaWdpbmFsLWNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdldCBvcmln aW5hbC1jb21tYW5kICdtYy0tdW5zdXBwb3J0ZWQpKQorICAgICAgICAgICAgICAgICAgKHdoZW4g KGFuZCBvcmlnaW5hbC1jb21tYW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChub3Qg KG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy0tZGVmYXVsdC1jbWRzLXRvLXJ1bi1vbmNlKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKG5vdCAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1j L2NtZHMtdG8tcnVuLW9uY2UpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAob3IgbWMv YWx3YXlzLXJ1bi1mb3ItYWxsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVt cSBvcmlnaW5hbC1jb21tYW5kIG1jLS1kZWZhdWx0LWNtZHMtdG8tcnVuLWZvci1hbGwpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jL2Nt ZHMtdG8tcnVuLWZvci1hbGwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWMv cHJvbXB0LWZvci1pbmNsdXNpb24taW4td2hpdGVsaXN0IG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAg ICAgICAgICAgICAgICAgICAgKG1jL2V4ZWN1dGUtY29tbWFuZC1mb3ItYWxsLWZha2UtY3Vyc29y cyBvcmlnaW5hbC1jb21tYW5kKSkpKQorICAgICAgICAgICAgICAod2hlbiBtYy91c2UtYnVpbHQt aW4tY3Vyc29ycworICAgICAgICAgICAgICAgIChzZXRxIG1jLWNvbmYKKyAgICAgICAgICAgICAg ICAgICAgICAgIChtYXBjYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKGxhbWJkYSAoeCkg KGxpc3QgKG92ZXJsYXktc3RhcnQgeCkgImJhciIgbmlsKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgKG1jL2FsbC1mYWtlLWN1cnNvcnMpKSkpKSkpKSkpCisKKyAgKGRlZnVuIG1jL21hcmst bmV4dC1saWtlLXRoaXMtY3ljbGUtZm9yd2FyZCAoKQor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gIm1hZ2VudGEiKQorICAg ICAgICAgICAgICAgICAgICAgICgyICJiYXIiICJwdXJwbGUiKQorICAgICAgICAgICAgICAgICAg ICAgICgzICJib3giICIjMDBGRjAwIikKKyAgICAgICAgICAgICAgICAgICAgICAoNCAiaG9sbG93 IiAiIzAwMDBGRiIpCisgICAgICAgICAgICAgICAgICAgICAgKDUgKCJoYmFyIiAzKSBbMS4wIDAu MCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg2ICgiYmFyIiAzKSBbMC4wIDEuMCAxLjBd KQorICAgICAgICAgICAgICAgICAgICAgICg3ICJmcmFtZWQiICJPcmFuZ2VSZWQiKQorICAgICAg ICAgICAgICAgICAgICAgICg4ICJib3giICJncmV5MjUiKQorICAgICAgICAgICAgICAgICAgICAg ICg5ICJib3giICJncmV5NzUiKSkpKQorICAgIChzZWxlY3Qtd2luZG93IChkaXNwbGF5LWJ1ZmZl ciBidWZmZXIpKSkpCisKKyhkZWZ1biArLXRpbWVyLWZuICgpCisiU2luY2UgdGhpcyBmaXJlcyBn bG9iYWxseSwgd2UgbXVzdCBjb250cm9sIHdoaWNoIGJ1ZmZlcnMgY3Jvc3NoYWlycyBhcHBlYXIg aW4uIgorICAod2hlbiArLW1vZGUKKyAgICAodW5sZXNzIChvciAobWVtcSBsYXN0LWNvbW1hbmQg Ky1wYXJlbnMtZXhjbHVzaW9ucykKKyAgICAgICAgICAgICAgICAobnVsbCArLXBhcmVucy1wKSkK KyAgICAgICgrLXBhcmVucy1mbikpCisgICAgKHdoZW4gKy10aW1lci12YXIKKyAgICAgIChzZXRx IHRpbWVyLWlkbGUtbGlzdCAoZGVscSArLXRpbWVyLXZhciB0aW1lci1pZGxlLWxpc3QpKQorICAg ICAgKHNldHEgKy10aW1lci12YXIgbmlsKSkpKQorCisoZGVmdW4gKy1kcmF3LWZvcnRod2l0aCAo KQorIkltbWVkaWF0ZWx5IGRlbGV0ZS9kcmF3IG1hdGNoaW5nIHBhcmVudGhlc2VzLiIKKyAgKCst ZHJhdy1jcm9zc2hhaXJzICdmb3JjZSkpCisKKyhkZWZ1biArLWRyYXctY3Jvc3NoYWlycyAoJm9w dGlvbmFsIGZvcmNlKQorIkltbWVkaWF0ZWx5IGRlbGV0ZSBtYXRjaGluZyBwYXJlbnRoZXNlcy4g IElmIEZPUkNFIGlzIG5vbi1uaWwsIHRoZW4gaW1tZWRpYXRlbHkKK2RyYXcgbWF0Y2hpbmcgcGFy ZW50aGVzaXM7IG90aGVyd2lzZSwgZHJhdyB0aGVtIG9uIGFuIGlkbGUtdGllci4iCisgICh3aGVu ICstbW9kZQorICAgICh3aGVuICstdGltZXItdmFyCisgICAgICAoc2V0cSB0aW1lci1pZGxlLWxp c3QgKGRlbHEgKy10aW1lci12YXIgdGltZXItaWRsZS1saXN0KSkKKyAgICAgIChzZXRxICstdGlt ZXItdmFyIG5pbCkpCisgICAgKHVubGVzcyAob3IgKG1lbXEgdGhpcy1jb21tYW5kICstcGFyZW5z LWV4Y2x1c2lvbnMpCisgICAgICAgICAgICAgICAgKGFuZCAobnVsbCArLXBhcmVucy1wKQorICAg ICAgICAgICAgICAgICAgICAgKG51bGwgKy1wYXJlbnMtb3ZlcmxheXMtZXhpc3QtcCkpKQorICAg ICAgKCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykpCisgICAgKGlmIGZvcmNlCisgICAgICAocHJv Z24KKyAgICAgICAgKHdoZW4gKy1wYXJlbnMtcAorICAgICAgICAgICgrLXBhcmVucy1mbikpKQor ICAgICAgKHNldHEgKy10aW1lci12YXIgKHJ1bi13aXRoLWlkbGUtdGltZXIgKy1pZGxlLXRpbWVy LXNlY29uZHMgbmlsICMnKy10aW1lci1mbikpKSkpCisKKyhkZWZ2YXIgZmMtbW9kZSkKKworOzs7 IyMjYXV0b2xvYWQKKyhkZWZpbmUtbWlub3ItbW9kZSArLW1vZGUKKyJNaW5vciBtb2RlIGZvciBk aXNwbGF5aW5nIGEgaG9yaXpvbnRhbCBydWxlci4iCisgIDppbml0LXZhbHVlIG5pbAorICA6bGln aHRlciAiICsiCisgIDprZXltYXAgbmlsCisgIDpnbG9iYWwgbmlsCisgIDpncm91cCAnKy1tb2Rl CisgIChjb25kCisgICAgKCstbW9kZQorICAgICAgOzs7IGArLW1vZGUnIGhhcyB0aGUgYWJpbGl0 eSB0byBhbHNvIGRpc3BsYXkgYSBmaWxsIGNvbHVtbiBpbmRpY2F0b3IuCisgICAgICA7OzsgU2Vl IHRoZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicuCisgICAgICAod2hlbiBmYy1tb2RlCisgICAg ICAgIChmYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgZ2xvYmFsLWVsZG9jLW1vZGUKKyAg ICAgICAgICAgICAgICAgKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAgJ2FueSkKKyAgICAgICAgICAg ICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAgICAgICAgKGdsb2JhbC1l bGRvYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgaml0LWxvY2stY29udGV4dC10aW1lcgor ICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAg ICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAod2hlbiAo dGltZXJwIGppdC1sb2NrLWNvbnRleHQtdGltZXIpCisgICAgICAgICAgKGNhbmNlbC10aW1lciBq aXQtbG9jay1jb250ZXh0LXRpbWVyKSkKKyAgICAgICAgOzsgKHNldHEgaml0LWxvY2stY29udGV4 dC10aW1lciAocnVuLXdpdGgtaWRsZS10aW1lciA1LjAgJ3JlcGVhdCAnaml0LWxvY2stY29udGV4 dC1mb250aWZ5KSkKKyAgICAgICAgKHNldHEgaml0LWxvY2stY29udGV4dC10aW1lciBuaWwpKQor ICAgICAgKHdoZW4gKGFuZCAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAg ICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAod2hlbiAo dGltZXJwIHVuZG8tYXV0by1jdXJyZW50LWJvdW5kYXJ5LXRpbWVyKQorICAgICAgICAgIChjYW5j ZWwtdGltZXIgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpKQorICAgICAgICAoZnNl dCAndW5kby1hdXRvLS11bmRvYWJsZS1jaGFuZ2UKKyAgICAgICAgICAgICAgKGxhbWJkYSAoKSAo YWRkLXRvLWxpc3QgJ3VuZG8tYXV0by0tdW5kb2FibHktY2hhbmdlZC1idWZmZXJzIChjdXJyZW50 LWJ1ZmZlcikpKSkKKyAgICAgICAgKGZzZXQgJ3VuZG8tYXV0by1hbWFsZ2FtYXRlICdpZ25vcmUp KQorICAgICAgKHdoZW4gYmxpbmstY3Vyc29yLW1vZGUKKyAgICAgICAgKGJsaW5rLWN1cnNvci1t b2RlIC0xKQorICAgICAgICAod2hlbiAobWVtcSAnYmxpbmstY3Vyc29yLWNoZWNrIHBvc3QtY29t bWFuZC1ob29rKQorICAgICAgICAgIChyZW1vdmUtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJ2Js aW5rLWN1cnNvci1jaGVjaykpKQorICAgICAgKHNldHEgY3Jvc3NoYWlycyB0KQorICAgICAgKHdo ZW4gKy1maWxsLWNvbHVtbgorICAgICAgICAoc2V0cSBmYy12aXNpYmxlIHQpKQorICAgICAgOzs7 IGBhdXRvLWNvbXBvc2l0aW9uLW1vZGUnIGlzIG5lZWRlZCBmb3IgY3Jvc3NoYWlycyB0byBwcm9w ZXJseSBjYWxjdWxhdGUKKyAgICAgIDs7OyBjb29yZGluYXRlcyBvZiBjb21wb3NpdGlvbiBjaGFy YWN0ZXJzLiAgQXV0b21hdGljYWxseSBiZWNvbWVzIHBlcm1hbmVudGx5CisgICAgICA7OzsgYnVm ZmVyLWxvY2FsIHdoZW4gc2V0LgorICAgICAgKHVubGVzcyBhdXRvLWNvbXBvc2l0aW9uLW1vZGUK KyAgICAgICAgKHNldHEgYXV0by1jb21wb3NpdGlvbi1tb2RlIHQpKQorICAgICAgOzs7IEBsYXds aXN0IGlzIGZvY3VzaW5nIHRoZSBpbml0aWFsIGRldmVsb3BtZW50IG9mIGZlYXR1cmUgcmVxdWVz dHMgIzE3Njg0CisgICAgICA7OzsgYW5kICMyMjg3MyBvbiBMMlIgbGFuZ3VhZ2VzLiAgVGhlIGZl YXR1cmUgdGVzdCBmaWxlIHVzZWQgYnkgQGxhd2xpc3QKKyAgICAgIDs7OyBib2dzIEVtYWNzIGRv d24gdW5sZXNzIGBiaWRpLWRpc3BsYXktcmVvcmRlcmluZycgaXMgc2V0IHRvIGEgbmlsIHZhbHVl LgorICAgICAgOzs7IEhvd2V2ZXIsIG1vc3QgdXNlcnMgd2lsbCBwcm9iYWJseSBub3Qgd2FudCB0 aGlzIHBhcnRpY3VsYXIgc2V0dGluZy4KKyAgICAgICh1bmxlc3MgKG51bGwgYmlkaS1kaXNwbGF5 LXJlb3JkZXJpbmcpCisgICAgICAgIChzZXRxIGJpZGktZGlzcGxheS1yZW9yZGVyaW5nIG5pbCkp CisgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICcrLS1zYXZlZC1zdGF0ZSkgbmlsKQor ICAgICAgKGRvbGlzdCAodmFyICcoYnVmZmVyLWRpc3BsYXktdGFibGUKKyAgICAgICAgICAgICAg ICAgICAgIGZyaW5nZS1pbmRpY2F0b3ItYWxpc3QKKyAgICAgICAgICAgICAgICAgICAgIHRhYi13 aWR0aAorICAgICAgICAgICAgICAgICAgICAgbGluZS1tb3ZlLXZpc3VhbAorICAgICAgICAgICAg ICAgICAgICAgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgICAgICAgICAgICAgIHRydW5jYXRlLXBh cnRpYWwtd2lkdGgtd2luZG93cworICAgICAgICAgICAgICAgICAgICAgd29yZC13cmFwKSkKKyAg ICAgICAgKHdoZW4gKGxvY2FsLXZhcmlhYmxlLXAgdmFyKQorICAgICAgICAgIChwdXNoIChjb25z IHZhciAoc3ltYm9sLXZhbHVlIHZhcikpICstLXNhdmVkLXN0YXRlKSkpCisgICAgICAoc2V0cSBm aWxsLWNvbHVtbiA4MCkKKyAgICAgIChzZXRxIGRpc3BsYXktbGluZS1udW1iZXJzIHQpCisgICAg ICAoc2V0cS1sb2NhbCBhdXRvLWhzY3JvbGwtbW9kZSAnY3VycmVudC1saW5lKQorICAgICAgKHNl dHEtbG9jYWwgaHNjcm9sbC1zdGVwIDUpCisgICAgICAoc2V0cSBidWZmZXItZGlzcGxheS10YWJs ZSArLWJ1ZmZlci1kaXNwbGF5LXRhYmxlKQorICAgICAgKHNldHEgdGFiLXdpZHRoIDQpCisgICAg ICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICdsaW5lLW1vdmUtdmlzdWFsKSB0KQorICAgICAg KHNldHEgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgKGNvbmQKKyAgICAgICAgICAoKGxldCAoKGxz dCArLXRydW5jYXRlLWxpbmVzLWRlcml2ZWQtbW9kZXMpCisgICAgICAgICAgICAgICAgICBtb2Rl KQorICAgICAgICAgICAgKGNhdGNoICdmb3VuZAorICAgICAgICAgICAgICAod2hpbGUgKHNldHEg bW9kZSAocG9wIGxzdCkpCisgICAgICAgICAgICAgICAgKHdoZW4gKGRlcml2ZWQtbW9kZS1wIG1v ZGUpCisgICAgICAgICAgICAgICAgICAodGhyb3cgJ2ZvdW5kIHQpKSkpKSkKKyAgICAgICAgICAg KChtZW1xIG1ham9yLW1vZGUgKy10cnVuY2F0ZS1saW5lcy1tYWpvci1tb2RlcykpCisgICAgICAg ICAgICh0CisgICAgICAgICAgICAgbmlsKSkpCisgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlh YmxlICd0cnVuY2F0ZS1wYXJ0aWFsLXdpZHRoLXdpbmRvd3MpIG5pbCkKKyAgICAgIChzZXRxIHdv cmQtd3JhcCB0KQorICAgICAgKHNldHEgaW5kaWNhdGUtZW1wdHktbGluZXMgdCkKKyAgICAgIChz ZXRxIGluZGljYXRlLWJ1ZmZlci1ib3VuZGFyaWVzICdsZWZ0KQorICAgICAgKHNldHEgZnJpbmdl LWluZGljYXRvci1hbGlzdAorICAgICAgICAgIDs7OyBoc2NsX2FsbF90ZW1wX3AgfCBoc2NsX3Rl bXBfcAorICAgICAgICAnKCgrLWhzY2wtdGVtcCAuICgrLXNpbmdsZS1hbmdsZS1sZWZ0CisgICAg ICAgICAgICAgICAgICAgICAgICAgICstZG91YmxlLWFuZ2xlLWxlZnQpKQorICAgICAgICAgIDs7 OyBoc2NsX2FsbF9wZXJtXzBfcCB8IGhzY2xfYWxsX3Blcm1fMV9wIHwgaHNjbF9hbGxfcGVybV8y X3AgfCBoc2NsX3Blcm1fcAorICAgICAgICAgICgrLWhzY2wtcGVybSAuICgrLXNpbmdsZS1hbmds ZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLWRvdWJsZS1hbmdsZS11cAorICAgICAg ICAgICAgICAgICAgICAgICAgICArLXRyaXBsZS1hbmdsZS11cAorICAgICAgICAgICAgICAgICAg ICAgICAgICArLXF1YWRydXBsZS1hbmdsZS11cCkpCisgICAgICAgICAgKCstb3ZlcmxheS1hcnJv dyAuICgrLWZyaW5nZS1sZWZ0LWFycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAr LWZyaW5nZS1yaWdodC1hcnJvdykpCisgICAgICAgICAgKHRydW5jYXRpb24gLiAoKy1mcmluZ2Ut bGVmdC1hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICstZnJpbmdlLXJpZ2h0LWFycm93 KSkKKyAgICAgICAgICAoY29udGludWF0aW9uIC4gKCstZnJpbmdlLWxlZnQtY3VybHktYXJyb3cK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICstYmFja3NsYXNoKSkKKyAgICAgICAgICAob3Zl cmxheS1hcnJvdyAuICstZnJpbmdlLXJpZ2h0LXRyaWFuZ2xlKQorICAgICAgICAgICh1cCAuICst ZnJpbmdlLXVwLWFycm93KQorICAgICAgICAgIChkb3duIC4gKy1mcmluZ2UtZG93bi1hcnJvdykK KyAgICAgICAgICAodG9wIC4gKy1mcmluZ2UtdG9wLWxlZnQtYW5nbGUpCisgICAgICAgICAgKGJv dHRvbSAuICstZnJpbmdlLWJvdHRvbS1yaWdodC1hbmdsZSkKKyAgICAgICAgICAodG9wLWJvdHRv bSAuICgrLWZyaW5nZS1sZWZ0LWJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICArLWZy aW5nZS1yaWdodC1icmFja2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgKy1mcmluZ2UtdG9w LXJpZ2h0LWFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgKy1mcmluZ2UtdG9wLWxlZnQt YW5nbGUpKQorICAgICAgICAgIChlbXB0eS1saW5lIC4gKy1mcmluZ2UtZW1wdHktbGluZSkKKyAg ICAgICAgICAodW5rbm93biAuICstZnJpbmdlLXF1ZXN0aW9uLW1hcmspKSkKKyAgICAgIChzZXRx IGZyaW5nZS1jdXJzb3ItYWxpc3QgJygoYm94IC4gKy1mcmluZ2UtbGVmdC10cmlhbmdsZSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaG9sbG93IC4gKy1ob2xsb3ctcmVjdGFu Z2xlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChiYXIgLiArLXZlcnRpY2Fs LWJhcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaGJhciAuICstZnJpbmdl LWhvcml6b250YWwtYmFyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChob2xs b3ctc21hbGwgLiArLWZyaW5nZS1ob2xsb3ctc3F1YXJlKSkpCisgICAgICAoaWYgKG9yICstZm9y dGh3aXRoCisgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisg ICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJhdy1mb3J0aHdpdGggJ2Fw cGVuZCAnbG9jYWwpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJh dy1jcm9zc2hhaXJzICdhcHBlbmQgJ2xvY2FsKSkKKyAgICAgICh3aGVuICstZm9ydGh3aXRoCisg ICAgICAgIChhZGQtaG9vayAnd2luZG93LWNvbmZpZ3VyYXRpb24tY2hhbmdlLWhvb2sgJystZHJh dy1mb3J0aHdpdGggbmlsICdsb2NhbCkpCisgICAgICAoYWRkLWhvb2sgJ2NoYW5nZS1tYWpvci1t b2RlLWhvb2sgJ3R1cm4tb2ZmLSstbW9kZSBuaWwgJ2xvY2FsKQorICAgICAgOzs7IE1hdGNoaW5n IHBhcmVudGhlc2VzIGRyYXdpbmcgZm9ydGh3aXRoIGludGVyZmVyZXMgd2l0aCB5YXNuaXBwZXQu CisgICAgICAod2hlbiArLWZvcnRod2l0aAorICAgICAgICAoc2V0cSArLXBhcmVucy1wIG5pbCkp CisgICAgICAod2hlbiAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAoY29u ZAorICAgICAgICAgICgrLWZvcnRod2l0aAorICAgICAgICAgICAgKG1lc3NhZ2UgIlR1cm5lZCBP TiBgKy1tb2RlJyAtLSBEcmF3IG1hdGNoaW5nIHBhcmVudGhlc2VzIGltbWVkaWF0ZWx5LiIpKQor ICAgICAgICAgICgoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpCisgICAgICAgICAgICA7 OzsgTWF0Y2hpbmcgcGFyZW50aGVzZXMgd2lsbCBiZSBkcmF3biBpbW1lZGlhdGVseS4KKyAgICAg ICAgICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScgLS0gT3B0aW1pemVkIGZvciBkZWJ1 Z2dpbmcgcHVycG9zZXMuIikpCisgICAgICAgICAgKHQKKyAgICAgICAgICAgIChtZXNzYWdlICJU dXJuZWQgT04gYCstbW9kZScuIikpKSkpCisgICAgKHQKKyAgICAgIChraWxsLWxvY2FsLXZhcmlh YmxlICdmaWxsLWNvbHVtbikKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdhdXRvLWhzY3Jv bGwtbW9kZSkKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdoc2Nyb2xsLXN0ZXApCisgICAg ICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnY3Jvc3NoYWlycykKKyAgICAgIChraWxsLWxvY2FsLXZh cmlhYmxlICdmYy12aXNpYmxlKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJ2Rpc3BsYXkt bGluZS1udW1iZXJzKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJ2Rpc3BsYXktbGluZS1u dW1iZXJzLXdpZHRoKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJ21jLWNvbmYpCisgICAg ICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnYnVmZmVyLWRpc3BsYXktdGFibGUpCisgICAgICAoa2ls bC1sb2NhbC12YXJpYWJsZSAndGFiLXdpZHRoKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUg J2xpbmUtbW92ZS12aXN1YWwpCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAndHJ1bmNhdGUt bGluZXMpCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAndHJ1bmNhdGUtcGFydGlhbC13aWR0 aC13aW5kb3dzKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJ3dvcmQtd3JhcCkKKyAgICAg IChraWxsLWxvY2FsLXZhcmlhYmxlICdpbmRpY2F0ZS1lbXB0eS1saW5lcykKKyAgICAgIChraWxs LWxvY2FsLXZhcmlhYmxlICdpbmRpY2F0ZS1idWZmZXItYm91bmRhcmllcykKKyAgICAgIChraWxs LWxvY2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XN0IChkZWxxICstdGltZXIt dmFyIHRpbWVyLWlkbGUtbGlzdCkpCisgICAgICAgIChzZXRxICstdGltZXItdmFyIG5pbCkpCisg ICAgICAod2hlbiAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAobWVzc2Fn ZSAiVHVybmVkIE9GRiBgKy1tb2RlJy4iKSkpKSkKKworKGRlZnVuIHR1cm4tb2ZmLSstbW9kZSAo KQorICAoKy1tb2RlIC0xKSkKKworOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7CisKKyhkZWZ1biAr LXBhcmVucy1mbiAoKQorICAiRG9jLXN0cmluZy4iCisgIChsZXQqICgob3BvaW50IChwb2ludCkp CisgICAgICAgICAoZnJvbSAoaWYgKy1wYXJlbnMtZnJvbS1mbgorICAgICAgICAgICAgICAgICAo ZnVuY2FsbCArLXBhcmVucy1mcm9tLWZuKQorICAgICAgICAgICAgICAgICAocG9pbnQtbWluKSkp CisgICAgICAgICAod2luIChzZWxlY3RlZC13aW5kb3cpKQorICAgICAgICAgKGkgMCkKKyAgICAg ICAgIChwcmVjZWRpbmctY2hhciAocHJlY2VkaW5nLWNoYXIpKQorICAgICAgICAgKG9jaGFyIChj aGFyLWFmdGVyIG9wb2ludCkpCisgICAgICAgICAocG9zMQorICAgICAgICAgICAoY29uZAorICAg ICAgICAgICAgICgoYW5kIG9jaGFyCisgICAgICAgICAgICAgICAgICAgKG9yIDs7OyAoY2hhci10 by1zdHJpbmcgNDApID0+IG9wZW5pbmcgcGFyZW50aGVzaXMKKyAgICAgICAgICAgICAgICAgICAg ICAgKD0gb2NoYXIgNDApCisgICAgICAgICAgICAgICAgICAgICAgIDs7OyAoY2hhci10by1zdHJp bmcgOTEpID0+IG9wZW5pbmcgc3F1YXJlIGJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAg KD0gb2NoYXIgOTEpCisgICAgICAgICAgICAgICAgICAgICAgIDs7OyAoY2hhci10by1zdHJpbmcg MTIzKSA9PiBvcGVuaW5nIHdhdnkgYnJhY2tldAorICAgICAgICAgICAgICAgICAgICAgICAoPSBv Y2hhciAxMjMpKSkKKyAgICAgICAgICAgICAgICAobWluICgxKyBvcG9pbnQpIChwb2ludC1tYXgp KSkKKyAgICAgICAgICAgICAoKG9yIDs7OyAoY2hhci10by1zdHJpbmcgNDEpID0+IGNsb3Npbmcg cGFyZW50aGVzaXMKKyAgICAgICAgICAgICAgICAgICg9IHByZWNlZGluZy1jaGFyIDQxKQorICAg ICAgICAgICAgICAgICAgOzs7IChjaGFyLXRvLXN0cmluZyA5MykgPT4gY2xvc2luZyBzcXVhcmUg YnJhY2tldAorICAgICAgICAgICAgICAgICAgKD0gcHJlY2VkaW5nLWNoYXIgOTMpCisgICAgICAg ICAgICAgICAgICA7OzsgKGNoYXItdG8tc3RyaW5nIDEyNSkgPT4gY2xvc2luZyB3YXZ5IGJyYWNr ZXQKKyAgICAgICAgICAgICAgICAgICg9IHByZWNlZGluZy1jaGFyIDEyNSkpCisgICAgICAgICAg ICAgICAgKG1heCAocG9pbnQtbWluKSAoMS0gb3BvaW50KSkpCisgICAgICAgICAgICAgKHQKKyAg ICAgICAgICAgICAgICBvcG9pbnQpKSkKKyAgICAgICAgIHBvczIKKyAgICAgICAgIHNlbGVjdGVk LWZhY2UpCisgICAgKHNhdmUtZXhjdXJzaW9uCisgICAgICAoY29uZGl0aW9uLWNhc2UgbmlsCisg ICAgICAgICh3aGlsZSAoc2V0cSBwb3MxIChudGggMSAocGFyc2UtcGFydGlhbC1zZXhwIGZyb20g cG9zMSkpKQorICAgICAgICAgIChzZXRxIHBvczIgKHNjYW4tc2V4cHMgcG9zMSAxKSkKKyAgICAg ICAgICAoaWYgKD0gaSAxMCkKKyAgICAgICAgICAgIChzZXRxIGkgMSkKKyAgICAgICAgICAgIChz ZXRxIGkgKDErIGkpKSkKKyAgICAgICAgICAoc2V0cSBzZWxlY3RlZC1mYWNlIChjb25kCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDEpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJystcGFyZW5zLW9uZS1mYWNlKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAoKD0gaSAyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcr LXBhcmVucy10d28tZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkg MykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtdGhyZWUtZmFj ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgNCkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtZm91ci1mYWNlKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAoKD0gaSA1KQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICcrLXBhcmVucy1maXZlLWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICgoPSBpIDYpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5z LXNpeC1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA3KQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1zZXZlbi1mYWNlKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA4KQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICcrLXBhcmVucy1laWdodC1mYWNlKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAoKD0gaSA5KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICcrLXBhcmVucy1uaW5lLWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgo PSBpIDEwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy10ZW4t ZmFjZSkpKQorICAgICAgICAgIChsZXQgKChvdiAobWFrZS1vdmVybGF5IHBvczEgKDErIHBvczEp KSkpCisgICAgICAgICAgICAodW5sZXNzICstcGFyZW5zLWluYWN0aXZlLXdpbmRvd3MKKyAgICAg ICAgICAgICAgKG92ZXJsYXktcHV0IG92ICd3aW5kb3cgd2luKSkKKyAgICAgICAgICAgIChvdmVy bGF5LXB1dCBvdiAnZmFjZSBzZWxlY3RlZC1mYWNlKSkKKyAgICAgICAgICAod2hlbiBwb3MyCisg ICAgICAgICAgICAobGV0ICgob3YgKG1ha2Utb3ZlcmxheSAoMS0gcG9zMikgcG9zMikpKQorICAg ICAgICAgICAgICAodW5sZXNzICstcGFyZW5zLWluYWN0aXZlLXdpbmRvd3MKKyAgICAgICAgICAg ICAgICAob3ZlcmxheS1wdXQgb3YgJ3dpbmRvdyB3aW4pKQorICAgICAgICAgICAgICAob3Zlcmxh eS1wdXQgb3YgJ2ZhY2Ugc2VsZWN0ZWQtZmFjZSkpKSkKKyAgICAgICAgKGVycm9yIG5pbCkpKQor ICAgIChzZXRxICstcGFyZW5zLW92ZXJsYXlzLWV4aXN0LXAgdCkpKQorCisoZGVmdW4gKy1yZW1v dmUtb3ZlcmxheXMgKGJlZyBlbmQgbmFtZSB2YWwpCisiUmVtb3ZlIHRoZSBvdmVybGF5cyB0aGF0 IGFyZSBgZXF1YWwtaW5jbHVkaW5nLXByb3BlcnRpZXNgLgorSW5jbHVkZXMgYSB1bmlxdWUgc2l0 dWF0aW9uIHdoZW4gYW4gb3ZlcmxheSB3aXRoIGFuIGAnYWZ0ZXItc3RyaW5nYCBwcm9wZXJ0eQor aXMgYXQgdGhlIHZlcnkgZW5kIG9mIGEgbmFycm93ZWQtYnVmZmVyLiIKKyAgKGxldCogKChwb2lu dC1tYXggKHBvaW50LW1heCkpCisgICAgICAgICAocG9pbnQtbWluIChwb2ludC1taW4pKQorICAg ICAgICAgKG5hcnJvd2VkLXAgKGJ1ZmZlci1uYXJyb3dlZC1wKSkKKyAgICAgICAgIChiZWcgKGlm IGJlZyBiZWcgcG9pbnQtbWluKSkKKyAgICAgICAgIChlbmQKKyAgICAgICAgICAgKGNvbmQKKyAg ICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAobm90IG5hcnJvd2VkLXApCisgICAg ICAgICAgICAgICAgIGVuZCkKKyAgICAgICAgICAgICAgIGVuZCkKKyAgICAgICAgICAgICAoKGFu ZAorICAgICAgICAgICAgICAgICAobm90IG5hcnJvd2VkLXApCisgICAgICAgICAgICAgICAgIChu dWxsIGVuZCkpCisgICAgICAgICAgICAgICBwb2ludC1tYXgpCisgICAgICAgICAgICAgKChhbmQK KyAgICAgICAgICAgICAgICAgbmFycm93ZWQtcAorICAgICAgICAgICAgICAgICBlbmQKKyAgICAg ICAgICAgICAgICAgKDwgZW5kIHBvaW50LW1heCkpCisgICAgICAgICAgICAgICBlbmQpCisgICAg ICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFycm93ZWQtcAorICAgICAgICAgICAg ICAgICBlbmQKKyAgICAgICAgICAgICAgICAgKD0gZW5kIHBvaW50LW1heCkpCisgICAgICAgICAg ICAgICAoMSsgZW5kKSkKKyAgICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICBuYXJy b3dlZC1wCisgICAgICAgICAgICAgICAgIChudWxsIGVuZCkpCisgICAgICAgICAgICAgICAoMSsg cG9pbnQtbWF4KSkgKSkKKyAgICAgICAgIChvdmVybGF5cworICAgICAgICAgICAocHJvZ24KKyAg ICAgICAgICAgICAob3ZlcmxheS1yZWNlbnRlciBlbmQpCisgICAgICAgICAgICAgKG92ZXJsYXlz LWluIGJlZyBlbmQpKSkpCisgICAgKHdoZW4gKGFuZCBiZWcgZW5kIG5hbWUgdmFsKQorICAgICAg KGRvbGlzdCAobyBvdmVybGF5cykKKyAgICAgICAgKGNvbmQKKyAgICAgICAgICAoKGFuZCAoZXEg bmFtZSAnZmFjZSkKKyAgICAgICAgICAgICAgICAoZXEgKG92ZXJsYXktZ2V0IG8gbmFtZSkgdmFs KSkKKyAgICAgICAgICAgIDs7IEVpdGhlciBwdXNoIHRoaXMgb3ZlcmxheSBvdXRzaWRlIGJlZy4u LmVuZAorICAgICAgICAgICAgOzsgb3Igc3BsaXQgaXQgdG8gZXhjbHVkZSBiZWcuLi5lbmQKKyAg ICAgICAgICAgIDs7IG9yIGRlbGV0ZSBpdCBlbnRpcmVseSAoaWYgaXQgaXMgY29udGFpbmVkIGlu IGJlZy4uLmVuZCkuCisgICAgICAgICAgICAoaWYgKDwgKG92ZXJsYXktc3RhcnQgbykgYmVnKQor ICAgICAgICAgICAgICAgIChpZiAoPiAob3ZlcmxheS1lbmQgbykgZW5kKQorICAgICAgICAgICAg ICAocHJvZ24KKyAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IChjb3B5LW92ZXJsYXkgbykK KyAgICAgICAgICAgICAgICAgIChvdmVybGF5LXN0YXJ0IG8pIGJlZykKKyAgICAgICAgICAgICAg ICAobW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVuZCBvKSkpCisgICAgICAgICAgICAgICAg ICAobW92ZS1vdmVybGF5IG8gKG92ZXJsYXktc3RhcnQgbykgYmVnKSkKKyAgICAgICAgICAgICAg KGlmICg+IChvdmVybGF5LWVuZCBvKSBlbmQpCisgICAgICAgICAgICAgICAgICAobW92ZS1vdmVy bGF5IG8gZW5kIChvdmVybGF5LWVuZCBvKSkKKyAgICAgICAgICAgICAgICAoZGVsZXRlLW92ZXJs YXkgbykpKSkKKyAgICAgICAgICAoKGFuZCAobm90IChlcSBuYW1lICdmYWNlKSkKKyAgICAgICAg ICAgICAgICAoZXF1YWwtaW5jbHVkaW5nLXByb3BlcnRpZXMgKG92ZXJsYXktZ2V0IG8gbm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ChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgIChlcXVh bCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVuICh0aW1lcnAgaml0LWxv Y2stY29udGV4dC10aW1lcikKKyAgICAgICAgICAoY2FuY2VsLXRpbWVyIGppdC1sb2NrLWNvbnRl eHQtdGltZXIpKQorICAgICAgICA7OyAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIChydW4t d2l0aC1pZGxlLXRpbWVyIDUuMCAncmVwZWF0ICdqaXQtbG9jay1jb250ZXh0LWZvbnRpZnkpKQor ICAgICAgICAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIG5pbCkpCisgICAgICAod2hlbiAo YW5kIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgIChlcXVh bCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVuICh0aW1lcnAgdW5kby1h dXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpCisgICAgICAgICAgKGNhbmNlbC10aW1lciB1bmRv LWF1dG8tY3VycmVudC1ib3VuZGFyeS10aW1lcikpCisgICAgICAgIChmc2V0ICd1bmRvLWF1dG8t LXVuZG9hYmxlLWNoYW5nZQorICAgICAgICAgICAgICAobGFtYmRhICgpIChhZGQtdG8tbGlzdCAn dW5kby1hdXRvLS11bmRvYWJseS1jaGFuZ2VkLWJ1ZmZlcnMgKGN1cnJlbnQtYnVmZmVyKSkpKQor ICAgICAgICAoZnNldCAndW5kby1hdXRvLWFtYWxnYW1hdGUgJ2lnbm9yZSkpCisgICAgICAod2hl biBibGluay1jdXJzb3ItbW9kZQorICAgICAgICAoYmxpbmstY3Vyc29yLW1vZGUgLTEpCisgICAg ICAgICh3aGVuIChtZW1xICdibGluay1jdXJzb3ItY2hlY2sgcG9zdC1jb21tYW5kLWhvb2spCisg ICAgICAgICA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ZmYWNlICstZXZlbi1hdC16 di1mYWNlCisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBk YXJrKSkKKyAgICAgOmZvcmVncm91bmQgIkRlZXBQaW5rMSIpCisgICAgKCgoY2xhc3MgY29sb3Ip IChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJE ZWVwUGluazEiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91 bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJEZWVwUGluazEiKQorICAgICgoKGNsYXNzIGNv bG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3Vu ZCAiRGVlcFBpbmsxIikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgOCkpCisgICAg IDpmb3JlZ3JvdW5kICJ3aGl0ZSIpCisgICAgKCgodHlwZSB0dHkpIChjbGFzcyBtb25vKSkKKyAg ICAgOmludmVyc2UtdmlkZW8gdCkKKyAgICAodCA6Zm9yZWdyb3VuZCAicGluayIpKQorICAiRmFj ZSBmb3IgYCstZXZlbi1hdC16di1mYWNlJy4iCisgIDpncm91cCAnKy1tb2RlKQorCisoZGVmZmFj ZSArLWV2ZW4taW5hY3RpdmUtYXQtenYtZmFjZQorICAnKCgoKGNsYXNzIGNvbG9yKSAobWluLWNv bG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJEZWVwUGluazQi KQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgbGlnaHQp KQorICAgICA6Zm9yZWdyb3VuZCAiRGVlcFBpbms0IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1p bi1jb2xvcnMgMTYpIChiYWNrZ3Jvd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ZXJzZS12aWRlbyB0KQorICAgICh0IDpmb3JlZ3JvdW5kICJwaW5rIikpCisgICJGYWNlIGZvciBg Ky1ldmVuLXBvc3QtenYtZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1l dmVuLWluYWN0aXZlLXBvc3QtenYtZmFjZQorICAnKCgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9y cyA4OCkgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJEYXJrT2xpdmVHcmVl bjQiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgbGln aHQpKQorICAgICA6Zm9yZWdyb3VuZCAiUm95YWxCbHVlIikKKyAgICAoKChjbGFzcyBjb2xvcikg KG1pbi1jb2xvcnMgMTYpIChiYWNrZ3JvdW5kIGRhcmspKQorICAgICA6Zm9yZWdyb3VuZCAiRGFy a09saXZlR3JlZW40IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgMTYpIChiYWNr Z3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgIlJveWFsQmx1ZSIpCisgICAgKCgoY2xh c3MgY29sb3IpIChtaW4tY29sb3JzIDgpKQorICAgICA6Zm9yZWdyb3VuZCAid2hpdGUiKQorICAg ICgoKHR5cGUgdHR5KSAoY2xhc3MgbW9ubykpCisgICAgIDppbnZlcnNlLXZpZGVvIHQpCisgICAg KHQgOmZvcmVncm91bmQgInBpbmsiKSkKKyAgIkZhY2UgZm9yIGArLWV2ZW4taW5hY3RpdmUtcG9z dC16di1mYWNlJy4iCisgIDpncm91cCAnKy1tb2RlKQorCisoZGVmZmFjZSArLW9kZC1wcmUtenYt ZmFjZQorICAnKCgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFy aykpCisgICAgIDpmb3JlZ3JvdW5kICJyZWQxIikKKyAgICAoKCh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ytpZHg7CisgIFhTRVRG QVNUSU5UIChCVkFSICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSwg aWR4KTsgKytpZHg7CisgIFhTRVRGQVNUSU5UIChCVkFSICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBm Y192aXNpYmxlKSwgaWR4KTsgKytpZHg7CisgIFhTRVRGQVNUSU5UIChCVkFSICgmYnVmZmVyX2xv Y2FsX2ZsYWdzLCBmY19pbmFjdGl2ZV93aW5kb3dzKSwgaWR4KTsgKytpZHg7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxf ZmxhZ3MsIG1vZGVfbGluZV9mb3JtYXQpLCBpZHgpOyArK2lkeDsKICAgWFNFVEZBU1RJTlQgKEJW QVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIGFiYnJldl9tb2RlKSwgaWR4KTsgKytpZHg7CiAgIFhT RVRGQVNUSU5UIChCVkFSICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBvdmVyd3JpdGVfbW9kZSksIGlk eCk7ICsraWR4OwpAQCAtNTIyOCw2ICs1MzA5LDI0IEBAIGluaXRfYnVmZmVyX29uY2UgKHZvaWQp CiAgIC8qIE11c3QgZG8gdGhlc2UgYmVmb3JlIG1ha2luZyB0aGUgZmlyc3QgYnVmZmVyISAqLwog CiAgIC8qIHJlYWwgc2V0dXAgaXMgZG9uZSBpbiBiaW5kaW5ncy5lbCAqLworCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGJzZXRfbWNfcmVh bF9mYWtlX2N1cnNvciAoJmJ1ZmZlc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C03MzYsNiArNzM2LDQwIEBAIHN0cnVjdCBidWZmZXIKICAg ICAgaW4gdGhlIGRpc3BsYXkgb2YgdGhpcyBidWZmZXIuICAqLwogICBMaXNwX09iamVjdCBleHRy YV9saW5lX3NwYWNpbmdfOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQ TEUtQ1VSU09SUyAqLworCisgIC8qIFRoZSBjdXJzb3IgdHlwZSBvZiB0aGUgcmVhbCBmYWtlIGN1 cnNvci4gKi8KKyAgTGlzcF9PYmplY3QgbWNfcmVhbF9mYWtlX2N1cnNvcl87CisKKyAgLyogVGhl IG5hbWUgb2YgbGlzdCB1c2VkIGJ5IG11bHRpcGxlIGN1cnNvcnMgZm9yIG5leHQgcmVkaXNwbGF5 LiAqLworICBMaXNwX09iamVjdCBtY19jb25mXzsKKworICAvKiBXaGV0aGVyIHRvIGRyYXcgbXVs dGlwbGUgY3Vyc29ycyBpbiBpbmFjdGl2ZSB3aW5kb3dzLiAqLworICBMaXNwX09iamVjdCBtY19p bmFjdGl2ZV93aW5kb3dzXzsKKworICAvKiBUaGUgbmFtZSBvZiB0aGUgYnVmZmVyLWxvY2FsIHZh cmlhYmxlLiAqLworICBMaXNwX09iamVjdCBjcm9zc2hhaXJzXzsKKworICAvKiBUaGUgbmFtZSBv ZiB0aGUgY3Jvc3NoYWlycyBob3Jpem9udGFsIHJ1bGVyLiAqLworICBMaXNwX09iamVjdCBjaF9o b3Jpem9udGFsX3J1bGVyXzsKKworICAvKiBUaGUgbmFtZSBvZiB0aGUgY3Jvc3NoYWlycyB2ZXJ0 aWNhbCBydWxlci4gKi8KKyAgTGlzcF9PYmplY3QgY2hfdmVydGljYWxfcnVsZXJfOworCisgIC8q IFdoZXRoZXIgdG8gZHJhdyBjcm9zc2hhaXJzIGluIGluYWN0aXZlIHdpbmRvd3MuICovCisgIExp c3BfT2JqZWN0IGNoX2luYWN0aXZlX3dpbmRvd3NfOworCisgIC8qIFRoZSBuYW1lIG9mIHRoZSBi dWZmZXItbG9jYWwgdmFyaWFibGUuICovCisgIExpc3BfT2JqZWN0IGZjX3Zpc2libGVfOworCisg IC8qIFdoZXRoZXIgdG8gZHJhdyBtdWx0aXBsZSBjdXJzb3JzIGZpbGwgY29sdW1uIGluIGluYWN0 aXZlIHdpbmRvd3MuICovCisgIExpc3BfT2JqZWN0IGZjX2luYWN0aXZlX3dpbmRvd3NfOworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIEN1cnNvciB0eXBlIHRvIGRpc3BsYXkg aW4gbm9uLXNlbGVjdGVkIHdpbmRvd3MuCiAgICAgIHQgbWVhbnMgdG8gdXNlIGhvbGxvdyBib3gg Y3Vyc29yLgogICAgICBTZWUgYGN1cnNvci10eXBlJyBmb3Igb3RoZXIgdmFsdWVzLiAgKi8KQEAg LTc4NywxNCArODIxLDIxIEBAIHN0cnVjdCBidWZmZXIKICAgICAgYW4gaW5kaXJlY3QgYnVmZmVy IHNpbmNlIGl0IGNvdW50cyBhcyBpdHMgYmFzZSBidWZmZXIuICAqLwogICBpbnQgd2luZG93X2Nv dW50OwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAq LworCiAgIC8qIEEgbm9uLXplcm8gdmFsdWUgaW4gc2xvdCBJRFggbWVhbnMgdGhhdCBwZXItYnVm ZmVyIHZhcmlhYmxlCiAgICAgIHdpdGggaW5kZXggSURYIGhhcyBhIGxvY2FsIHZhbHVlIGluIHRo aXMgYnVmZmVyLiAgVGhlIGluZGV4IElEWAogICAgICBmb3IgYSBidWZmZXItbG9jYWwgdmFyaWFi bGUgaXMgc3RvcmVkIGluIHRoYXQgdmFyaWFibGUncyBzbG90CiAgICAgIGluIGJ1ZmZlcl9sb2Nh bF9mbGFncyBhcyBhIExpc3AgaW50ZWdlci4gIElmIHRoZSBpbmRleCBpcyAtMSwKICAgICAgdGhp cyBtZWFucyB0aGUgdmFyaWFibGUgaXMgYWx3YXlzIGxvY2FsIGluIGFsbCBidWZmZXJzLiAgKi8K LSNkZWZpbmUgTUFYX1BFUl9CVUZGRVJfVkFSUyA1MAorI2RlZmluZSBNQVhfUEVSX0JVRkZFUl9W QVJTIDYwCiAgIGNoYXIgbG9jYWxfZmxhZ3NbTUFYX1BFUl9CVUZGRVJfVkFSU107CiAKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICAgLyogU2V0IHRvIHRoZSBtb2R0aW1lIG9mIHRoZSB2 aXNpdGVkIGZpbGUgd2hlbiByZWFkIG9yIHdyaXR0ZW4uCiAgICAgIG1vZHRpbWUudHZfbnNlYyA9 PSBOT05FWElTVEVOVF9NT0RUSU1FX05TRUNTIG1lYW5zCiAgICAgIHZpc2l0ZWQgZmlsZSB3YXMg bm9uZXhpc3RlbnQuICBtb2R0aW1lLnR2X25zZWMgPT0KQEAgLTkwMyw2ICs5NDQsNjkgQEAgWEJV RkZFUiAoTGlzcF9PYmplY3QgYSkKIC8qIE1vc3QgY29kZSBzaG91bGQgdXNlIHRoZXNlIGZ1bmN0 aW9ucyB0byBzZXQgTGlzcCBmaWVsZHMgaW4gc3RydWN0CiAgICBidWZmZXIuICAoU29tZSBzZXR0 ZXJzIHRoYXQgYXJlIHByaXZhdGUgdG8gYSBzaW5nbGUgLmMgZmlsZSBhcmUKICAgIGRlZmluZWQg YXMgc3RhdGljIGluIHRob3NlIGZpbGVzLikgICovCisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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pdmVfd2luZG93c18gPSB2YWw7Cit9CisKK0lOTElORSB2b2lkCitic2V0 X2Jsdl9mY192aXNpYmxlIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7Cisg IGItPmZjX3Zpc2libGVfID0gdmFsOworfQorCitJTkxJTkUgdm9pZAorYnNldF9ibHZfZmNfaW5h Y3RpdmVfd2luZG93cyAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFsKQoreworICBi LT5mY19pbmFjdGl2ZV93aW5kb3dzXyA9IHZhbDsKK30KKworLyogZW5kIE1VTFRJUExFLUNVUlNP UlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIElOTElORSB2b2lkCiBic2V0X2Jp ZGlfcGFyYWdyYXBoX2RpcmVjdGlvbiAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFs KQogewpkaWZmIC0tZ2l0IGEvc3JjL2Rpc3BleHRlcm4uaCBiL3NyYy9kaXNwZXh0ZXJuLmgKaW5k ZXggMWE1MzY1Ni4uYjg2OWRmOSAxMDA2NDQKLS0tIGEvc3JjL2Rpc3BleHRlcm4uaAorKysgYi9z cmMvZGlzcGV4dGVybi5oCkBAIC0xMDAsNiArMTAwLDEyNiBAQCB0eXBlZGVmIGludCBDdXJzb3I7 CiAjZGVmaW5lIE5hdGl2ZVJlY3RhbmdsZSBpbnQKICNlbmRpZgogCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCitzdHJ1Y3QgZ2x5cGg7 CisKK3N0cnVjdCBnbHlwaF9yb3c7CisKK3N0cnVjdCBnbHlwaF9tYXRyaXg7CisKK2VudW0gZHJh d19nbHlwaHNfZmFjZTsKKworZW51bSBnbHlwaF9yb3dfYXJlYTsKKworc3RydWN0IG1jX21hdHJp eDsKKworZW51bSBtY19jYWNoZV90eXBlOworCitlbnVtIG1jX2N1cnNvcl90eXBlOworCitlbnVt IG1jX2ZsYXZvcjsKKworc3RydWN0IG1jX1JHQjsKKworc3RydWN0IG1jX2Vzc2VudGlhbHM7CisK K2VudW0gbWNfZHJhd19yb3dfdHlwZTsKKworZW51bSBtY19lbmdpbmVfdHlwZTsKKworZW51bSBt Y19yb3dfcG9zaXRpb247CisKK2VudW0gbWNfcmVkcmF3X3Jvd190eXBlOworCitleHRlcm4gTGlz cF9PYmplY3QgbWNfbGlzdG4gKHB0cmRpZmZfdCwgTGlzcF9PYmplY3QsIC4uLik7CisKK2V4dGVy biBMaXNwX09iamVjdCBtY19udGggKGludCwgTGlzcF9PYmplY3QpOworCitleHRlcm4gTGlzcF9P YmplY3QgbWNfYXNzcSAoTGlzcF9PYmplY3QsIExpc3BfT2JqZWN0KTsKKworZXh0ZXJuIGVudW0g bWNfcm93X3Bvc2l0aW9uIG1jX3Jvd19wb3NpdGlvbiAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3Qg Z2x5cGhfcm93ICosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBzdHJ1Y3QgZ2x5cGhfcm93ICosIGludCk7CisKK2V4dGVybiBwdHJkaWZmX3QgbWNfcmVnaW9u X2xpbWl0IChib29sKTsKKworZXh0ZXJuIHN0cnVjdCBnbHlwaCAqIG1jX2dldF9jdXJzb3JfZ2x5 cGggKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKiwgaW50LCBp bnQpOworCitleHRlcm4gdm9pZCBtY194d19jb2xvcl92YWx1ZXMgKHN0cnVjdCB3aW5kb3cgKiwg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luZSAoc3RydWN0IHdpbmRvdyAqLCBz dHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAg ICAgICAgICAgc3RydWN0IGdseXBoICosIGludCwgaW50LCBpbnQsIGludCwgaW50LCBpbnQsCisg ICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUsIGludCwgc3RydWN0IGds eXBoX21hdHJpeCAqLAorICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfZXNzZW50aWFs cywgZW51bSBtY19yb3dfcG9zaXRpb24sIHN0cnVjdCBtY19SR0IsCisgICAgICAgICAgICAgICAg ICAgICAgIGVudW0gbWNfZW5naW5lX3R5cGUsIGJvb2wsIGVudW0gbWNfZHJhd19yb3dfdHlwZSwK KyAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jYWNoZV90eXBlKTsKKworZXh0ZXJuIHZv aWQgbWNfc2V0X2Vzc2VudGlhbHMgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IG1jX2Vzc2VudGlh bHMgKik7CisKK2V4dGVybiB2b2lkIG1jX2RyYXdfcm93IChzdHJ1Y3Qgd2luZG93ICosIHN0cnVj dCBnbHlwaF9tYXRyaXggKiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAg ICAgICAgIHN0cnVjdCBnbHlwaCAqLCBpbnQsIGludCwgaW50LCBpbnQsIHN0cnVjdCBnbHlwaF9t YXRyaXggKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfZXNzZW50aWFscywg ZW51bSBtY19yb3dfcG9zaXRpb24sIGJvb2wsCisgICAgICAgICAgICAgICAgICAgICAgICAgZW51 bSBtY19kcmF3X3Jvd190eXBlKTsKKworZXh0ZXJuIGJvb2wgbWNfcmVkcmF3X3JvdyAoc3RydWN0 IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gZ2x5cGhfcm93X2FyZWEsIGludCwgaW50LCBp bnQsIGJvb2wsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2Zh Y2UsIGVudW0gbWNfcmVkcmF3X3Jvd190eXBlKTsKKworZXh0ZXJuIHZvaWQgbWNfcmVzZXRfY2Fj aGUgKHN0cnVjdCB3aW5kb3cgKik7CisKK2V4dGVybiB2b2lkIG1jX2RyYXdfY3Vyc29yX2dseXBo IChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICosIGVudW0gZHJhd19nbHlwaHNf ZmFjZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQsIGludCwgaW50LCBz dHJ1Y3QgbWNfUkdCLCBlbnVtIG1jX2ZsYXZvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlLCBpbnQsIGJvb2wsIGJvb2wpOworCitleHRlcm4g dm9pZCBtY19lcmFzZV9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJp eCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlu dCwgaW50LCBpbnQsIGludCwgZW51bSBtY19mbGF2b3IsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUsIGludCk7CisKK2V4dGVybiB2b2lkIG1jX2RyYXdf ZXJhc2VfaHlicmlkIChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwgc3Ry dWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCwg aW50LCBpbnQsIGludCwgaW50LCBpbnQsIGludCwgaW50LAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUsIGludCwgc3RydWN0IG1jX1JHQiwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sLCBlbnVtIG1jX2ZsYXZvciwgYm9v bCk7CisKK2V4dGVybiB2b2lkIG1jX3hfd3JpdGVfZ2x5cGhzIChzdHJ1Y3Qgd2luZG93ICosIHN0 cnVjdCBnbHlwaF9tYXRyaXggKiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqLCBlbnVtIGdseXBoX3Jvd19hcmVhLCBpbnQs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBpbnQsIHN0cnVjdCBtY19SR0Is IGVudW0gbWNfZmxhdm9yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNf Y3Vyc29yX3R5cGUsIGludCwgYm9vbCwgYm9vbCwgYm9vbCk7CisKK2V4dGVybiBzdHJ1Y3QgZ2x5 cGhfbWF0cml4ICogbWNfc2F2ZV9nbHlwaF9tYXRyaXggKHN0cnVjdCBnbHlwaF9tYXRyaXggKik7 CisKK2V4dGVybiB2b2lkIG1jX3Jlc3RvcmVfZ2x5cGhfbWF0cml4IChzdHJ1Y3QgZ2x5cGhfbWF0 cml4ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKik7CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JT ICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBUZXh0IGN1cnNvciB0eXBlcy4g ICovCiAKIGVudW0gdGV4dF9jdXJzb3Jfa2luZHMKQEAgLTM4Miw2ICs1MDIsMTggQEAgc3RydWN0 IGdseXBoX3NsaWNlCiAKIHN0cnVjdCBnbHlwaAogeworCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGludCByZWxhdGl2ZV94LCBocG9zOwor CisgIHB0cmRpZmZfdCBieXRlcG9zOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAg IC8qIFBvc2l0aW9uIGZyb20gd2hpY2ggdGhpcyBnbHlwaCB3YXMgZHJhd24uICBJZiBgb2JqZWN0 JyBiZWxvdyBpcyBhCiAgICAgIExpc3Agc3RyaW5nLCB0aGlzIGlzIGFuIGluZGV4IGludG8gdGhh dCBzdHJpbmcuICBJZiBpdCBpcyBhCiAgICAgIGJ1ZmZlciwgdGhpcyBpcyBhIHBvc2l0aW9uIGlu IHRoYXQgYnVmZmVyLiAgSW4gYWRkaXRpb24sIHNvbWUKQEAgLTEyNDgsNiArMTM4MCwyOCBAQCBl bnVtIGRyYXdfZ2x5cGhzX2ZhY2UKIAogc3RydWN0IGdseXBoX3N0cmluZwogeworCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgYm9vbF9i ZiBsZWZ0X292ZXJ3cml0dGVuX3AgOiAxOworCisgICAgYm9vbF9iZiByaWdodF9vdmVyd3JpdHRl bl9wIDogMTsKKworICAgIGJvb2xfYmYgcmVjdGFuZ2xlX251a2VkX3AgOiAxOworCisgICAgYm9v bF9iZiBiYWNrZ3JvdW5kX251a2VkX3AgOiAxOworCisgICAgZW51bSBkcmF3X2dseXBoX2FjdGlv bgorICAgIHsKKyAgICAgIE1DX0RSQVdfR0xZUEhfU1RSSU5HLAorICAgICAgTUNfRVJBU0VfR0xZ UEhfU1RSSU5HCisgICAgfSBhY3Rpb25fdHlwZTsKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogICAvKiBYLW9yaWdpbiBvZiB0aGUgc3RyaW5nLiAgKi8KICAgaW50IHg7CiAKQEAgLTI4 MTIsNiArMjk2NiwzMiBAQCB0eXBlZGVmIHZvaWQgKCpmcmFtZV9wYXJtX2hhbmRsZXIpIChzdHJ1 Y3QgZnJhbWUgKiwgTGlzcF9PYmplY3QsIExpc3BfT2JqZWN0KTsKIAogc3RydWN0IHJlZGlzcGxh eV9pbnRlcmZhY2UKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExF LUNVUlNPUlMgKi8KKworLyogYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGBuc3Rlcm0ubWAgXCBg dzMydGVybS5jYCBcIGB4dGVybS5jYCBtdXN0IGJlIGluIHRoZQorZXhhY3Qgc2FtZSBvcmRlciBh cyB0aGUgYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGBkaXNwZXh0ZXJuLmhgISAqLworCisgIHZv aWQgKCptY19zY3JpYmVfZ2x5cGhzKSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21h dHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgIHN0cnVjdCBnbHlw aCAqc3RyaW5nLCBlbnVtIGdseXBoX3Jvd19hcmVhIGFyZWEsIGludCBsZW4sIGludCB2cG9zLAor ICAgICAgICBpbnQgYm90dG9tX3Zwb3MsIHN0cnVjdCBtY19SR0IgbHNsLCBlbnVtIG1jX2ZsYXZv ciBnbHlwaF9mbGF2b3IsCisgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUs IGludCB3ZCwgYm9vbCBhY3RpdmVfcCwgYm9vbCBjdXJzb3JfZ2NfcCwKKyAgICAgICAgYm9vbCBk cmF3X3ApOworCisgIHZvaWQgKCptY19zY3JpYmVfY3Vyc29yKSAoc3RydWN0IHdpbmRvdyAqdywg c3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LAorICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpn bHlwaF9yb3csIGludCB4LCBpbnQgZngsIGludCB5LCBpbnQgZnksIGludCBocG9zLAorICAgICAg ICBpbnQgdnBvcywgaW50IHdkLCBpbnQgaCwgc3RydWN0IG1jX1JHQiBsc2wsIGVudW0gbWNfY3Vy c29yX3R5cGUgY3Vyc29yX3R5cGUsCisgICAgICAgIGludCBjdXJzb3Jfd2lkdGgsIGVudW0gbWNf Zmxhdm9yIGdseXBoX2ZsYXZvciwgYm9vbCBvbl9wLCBib29sIGFjdGl2ZV9wKTsKKworICB2b2lk ICgqbWNfc2NyaWJlX3N0cmluZykgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMsIHN0cnVjdCBnbHlw aF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICBzdHJ1Y3Qg bWNfUkdCIGxzbCwgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yLAorICAgICAgICBlbnVtIG1j X2N1cnNvcl90eXBlIGN1cnNvcl90eXBlLCBpbnQgd2QsIGJvb2wgYWN0aXZlX3AsIGJvb2wgY3Vy c29yX2djX3ApOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIEhhbmRsZXJz IGZvciBzZXR0aW5nIGZyY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ZWRfcAorICAgICAgICAgICYmIGQtPmVuYWJsZWRfcAorICAgICAg ICAgICYmICFkLT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcAorICAgICAgICAgICYmIGMtPnkgPT0g ZC0+eQorICAgICAgICAgICYmIE1BVFJJWF9ST1dfQk9UVE9NX1kgKGMpIDw9IHliCisgICAgICAg ICAgJiYgTUFUUklYX1JPV19CT1RUT01fWSAoZCkgPD0geWIKKyAgICAgICAgICAmJiByb3dfZXF1 YWxfcCAoYywgZCwgMSkpCisgICAgICAgIHsKKyAgICAgICAgICBhc3NpZ25fcm93IChjLCBkKTsK KyAgICAgICAgICBkLT5lbmFibGVkX3AgPSBmYWxzZTsKKyAgICAgICAgfQorICAgICAgICBlbHNl CisgICAgICAgICAgYnJlYWs7CisgICAgfQorI2lmZGVmIEhBVkVfWFdJREdFVFMKKyAgLyogQ3Vy cmVudGx5IHRoaXMgc2VlbXMgbmVlZGVkIHRvIGRldGVjdCB4d2lkZ2V0IG1vdmVtZW50IHJlbGlh Ymx5LiAqLworICAgIHJldHVybiAwOworI2VuZGlmCisgIC8qIEdpdmUgdXAgaWYgc29tZSByb3dz IGluIHRoZSBkZXNpcmVkIG1hdHJpeCBhcmUgbm90IGVuYWJsZWQuICovCisgIGlmICghIE1BVFJJ WF9ST1dfRU5BQkxFRF9QIChkZXNpcmVkX21hdHJpeCwgaSkpCisgICAgcmV0dXJuIC0xOworICBm aXJzdF9vbGQgPSBmaXJzdF9uZXcgPSBpOworICAvKiBTZXQgbGFzdF9uZXcgdG8gdGhlIGluZGV4 ICsgMSBvZiB0aGUgcm93IHRoYXQgcmVhY2hlcyB0aGUKKyAgICAgYm90dG9tIGJvdW5kYXJ5IGlu IHRoZSBkZXNpcmVkIG1hdHJpeC4gIEdpdmUgdXAgaWYgd2UgZmluZCBhCisgICAgIGRpc2FibGVk IHJvdyBiZWZvcmUgd2UgcmVhY2ggdGhlIGJvdHRvbSBib3VuZGFyeS4gKi8KKyAgaSA9IGZpcnN0 X25ldyArIDE7CisgIHdoaWxlIChpIDwgZGVzaXJlZF9tYXRyaXgtPm5yb3dzIC0gMSkKKyAgICB7 CisgICAgICBpbnQgYm90dG9tOworICAgICAgaWYgKCEgTUFUUklYX1JPV19FTkFCTEVEX1AgKGRl c2lyZWRfbWF0cml4LCBpKSkKKyAgICAgICAgcmV0dXJuIDA7CisgICAgICBib3R0b20gPSBNQVRS SVhfUk9XX0JPVFRPTV9ZIChNQVRSSVhfUk9XIChkZXNpcmVkX21hdHJpeCwgaSkpOworICAgICAg aWYgKGJvdHRvbSA8PSB5YikKKyAgICAgICAgKytpOworICAgICAgaWYgKGJvdHRvbSA+PSB5YikK KyAgICAgICAgYnJlYWs7CisgICAgfQorICBsYXN0X25ldyA9IGk7CisgIC8qIFNldCBsYXN0X29s ZCB0byB0aGUgaW5kZXggKyAxIG9mIHRoZSByb3cgdGhhdCByZWFjaGVzIHRoZSBib3R0b20KKyAg ICAgYm91bmRhcnkgaW4gdGhlIGN1cnJlbnQgbWF0cml4LiAgV2UgZG9uJ3QgbG9vayBhdCB0aGUg ZW5hYmxlZAorICAgICBmbGFnIGhlcmUgYmVjYXVzZSB3ZSBwbGFuIHRvIHJldXNlIHBhcnQgb2Yg dGhlIGRpc3BsYXkgZXZlbiBpZgorICAgICBvdGhlciBwYXJ0cyBhcmUgZGlzYWJsZWQuICovCisg IGkgPSBmaXJzdF9vbGQgKyAxOworICB3aGlsZSAoaSA8IGN1cnJlbnRfbWF0cml4LT5ucm93cyAt IDEpCisgICAgeworICAgICAgaW50IGJvdHRvbSA9IE1BVFJJWF9ST1dfQk9UVE9NX1kgKE1BVFJJ WF9ST1cgKGN1cnJlbnRfbWF0cml4LCBpKSk7CisgICAgICBpZiAoYm90dG9tIDw9IHliKQorICAg ICAgICArK2k7CisgICAgICBpZiAoYm90dG9tID49IHliKQorICAgICAgICBicmVhazsKKyAgICB9 CisgIGxhc3Rfb2xkID0gaTsKKyAgLyogU2tpcCBvdmVyIHJvd3MgZXF1YWwgYXQgdGhlIGJvdHRv bS4gKi8KKyAgaSA9IGxhc3RfbmV3OworICBqID0gbGFzdF9vbGQ7CisgIHdoaWxlIChpIC0gMSA+ IGZpcnN0X25ldworICAgICAgICAgJiYgaiAtIDEgPiBmaXJzdF9vbGQKKyAgICAgICAgICYmIE1B VFJJWF9ST1dfRU5BQkxFRF9QIChjdXJyZW50X21hdHJpeCwgaiAtIDEpCisgICAgICAgICAmJiAo TUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIGogLSAxKS0+eQorICAgICAgICAgICAgID09IE1B VFJJWF9ST1cgKGRlc2lyZWRfbWF0cml4LCBpIC0gMSktPnkpCisgICAgICAgICAmJiAhTUFUUklY X1JPVyAoZGVzaXJlZF9tYXRyaXgsIGkgLSAxKS0+cmVkcmF3X2ZyaW5nZV9iaXRtYXBzX3AKKyAg ICAgICAgICYmIHJvd19lcXVhbF9wIChNQVRSSVhfUk9XIChkZXNpcmVkX21hdHJpeCwgaSAtIDEp LAorICAgICAgICAgICAgICAgICAgICAgICAgIE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCBq IC0gMSksIDEpKQorICAgIC0taSwgLS1qOworICBsYXN0X25ldyA9IGk7CisgIGxhc3Rfb2xkID0g ajsKKyAgLyogTm90aGluZyB0byBkbyBpZiBhbGwgcm93cyBhcmUgZXF1YWwuICovCisgIGlmIChs YXN0X25ldyA9PSBmaXJzdF9uZXcpCisgICAgcmV0dXJuIDA7CisgIC8qIENoZWNrIGZvciBpbnRl Z2VyIG92ZXJmbG93IGluIHNpemUgY2FsY3VsYXRpb24uCisgICAgIElmIG5leHRfYWxtb3N0X3By aW1lIGNoZWNrcyAoTikgZm9yIGRpdmlzaWJpbGl0eSBieSAyLi4xMCwgdGhlbgorICAgICBpdCBj YW4gcmV0dXJuIGF0IG1vc3QgTiArIDEwLCBlLmcuLCBuZXh0X2FsbW9zdF9wcmltZSAoMSkgPT0g MTEuCisgICAgIFNvLCBzZXQgbmV4dF9h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9jICht Y19vbGRfbGluZXMsICZtY19vbGRfbGluZXNfc2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICBjdXJyZW50X21hdHJpeC0+bnJvd3MgLSBtY19vbGRfbGluZXNfc2l6ZSwKKyAgICAgICAgICAg ICAgICAgICAgICAgICBJTlRfTUFYLCBzaXplb2YgKm1jX29sZF9saW5lcyk7CisgIGlmIChkZXNp cmVkX21hdHJpeC0+bnJvd3MgPiBtY19uZXdfbGluZXNfc2l6ZSkKKyAgICBtY19uZXdfbGluZXMg PSB4cGFsbG9jIChtY19uZXdfbGluZXMsICZtY19uZXdfbGluZXNfc2l6ZSwKKyAgICAgICAgICAg ICAgICAgICAgICAgICBkZXNpcmVkX21hdHJpeC0+bnJvd3MgLSBtY19uZXdfbGluZXNfc2l6ZSwK KyAgICAgICAgICAgICAgICAgICAgICAgICBJTlRfTUFYLCBzaXplb2YgKm1jX25ld19saW5lcyk7 CisgIG4gPSBkZXNpcmVkX21hdHJpeC0+bnJvd3M7CisgIG4gKz0gY3VycmVudF9tYXRyaXgtPm5y b3dzOworICBpZiAobWNfcm93X3RhYmxlX3NpemUgPCAzICogbikKKyAgICB7CisgICAgICBwdHJk aWZmX3Qgc2l6ZSA9IG5leHRfYWxtb3N0X3ByaW1lICgzICogbik7CisgICAgICBtY19yb3dfdGFi bGUgPSB4bnJlYWxsb2MgKG1jX3Jvd190YWJsZSwgc2l6ZSwgc2l6ZW9mICptY19yb3dfdGFibGUp OworICAgICAgbWNfcm93X3RhYmxlX3NpemUgPSBzaXplOworICAgICAgbWVtc2V0IChtY19yb3df dGFibGUsIDAsIHNpemUgKiBzaXplb2YgKm1jX3Jvd190YWJsZSk7CisgICAgfQorICBpZiAobiA+ IG1jX3Jvd19lbnRyeV9wb29sX3NpemUpCisgICAgbWNfcm93X2VudHJ5X3Bvb2wgPSB4cGFsbG9j IChtY19yb3dfZW50cnlfcG9vbCwgJm1jX3Jvd19lbnRyeV9wb29sX3NpemUsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBuIC0gbWNfcm93X2VudHJ5X3Bvb2xfc2l6ZSwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC0xLCBzaXplb2YgKm1jX3Jvd19lbnRyeV9wb29sKTsKKyAg aWYgKGRlc2lyZWRfbWF0cml4LT5ucm93cyA+IG1jX3J1bnNfc2l6ZSkKKyAgICB7CisgICAgICBt Y19ydW5zID0geG5yZWFsbG9jIChtY19ydW5zLCBkZXNpcmVkX21hdHJpeC0+bnJvd3MsIHNpemVv ZiAqbWNfcnVucyk7CisgICAgICBtY19ydW5fcG9vbCA9IHhucmVhbGxvYyAobWNfcnVuX3Bvb2ws IGRlc2lyZWRfbWF0cml4LT5ucm93cywgc2l6ZW9mICptY19ydW5fcG9vbCk7CisgICAgICBtY19y dW5zX3NpemUgPSBkZXNpcmVkX21hdHJpeC0+bnJvd3M7CisgICAgfQorICBucnVucyA9IHJ1bl9p ZHggPSAwOworICBtY19yb3dfZW50cnlfaWR4ID0gMDsKKyAgLyogQWRkIHJvd3MgZnJvbSB0aGUg Y3VycmVudCBhbmQgZGVzaXJlZCBtYXRyaXggdG8gdGhlIGhhc2ggdGFibGUKKyAgICAgcm93X2hh c2hfdGFibGUgdG8gYmUgYWJsZSB0byBmaW5kIGVxdWFsIG9uZXMgcXVpY2tseS4gKi8KKyAgZm9y IChpID0gZmlyc3Rfb2xkOyBpIDwgbGFzdF9vbGQ7ICsraSkKKyAgICB7CisgICAgICBpZiAoTUFU UklYX1JPV19FTkFCTEVEX1AgKGN1cnJlbnRfbWF0cml4LCBpKSkKKyAgICAgICAgeworICAgICAg ICAgIGVudHJ5ID0gbWNfYWRkX3Jvd19lbnRyeSAoTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgs IGkpKTsKKyAgICAgICAgICBtY19vbGRfbGluZXNbaV0gPSBlbnRyeTsKKyAgICAgICAgICArK2Vu dHJ5LT5vbGRfdXNlczsKKyAgICAgICAgfQorICAgICAgZWxzZQorICAgICAgICBtY19vbGRfbGlu ZXNbaV0gPSBOVUxMOworICAgIH0KKyAgZm9yIChpID0gZmlyc3RfbmV3OyBpIDwgbGFzdF9uZXc7 ICsraSkKKyAgICB7CisgICAgICBlYXNzZXJ0IChNQVRSSVhfUk9XX0VOQUJMRURfUCAoZGVzaXJl ZF9tYXRyaXgsIGkpKTsKKyAgICAgIGVudHJ5ID0gbWNfYWRkX3Jvd19lbnRyeSAoTUFUUklYX1JP VyAoZGVzaXJlZF9tYXRyaXgsIGkpKTsKKyAgICAgICsrZW50cnktPm5ld191c2VzOworICAgICAg ZW50cnktPm5ld19saW5lX251bWJlciA9IGk7CisgICAgICBtY19uZXdfbGluZXNbaV0gPSBlbnRy eTsKKyAgICB9CisgIC8qIElkZW50aWZ5IG1vdmVzIGJhc2VkIG9uIGxpbmVzIHRoYXQgYXJlIHVu aXF1ZSBhbmQgZXF1YWwKKyAgICAgaW4gYm90aCBtYXRyaWNlcy4gKi8KKyAgZm9yIChpID0gZmly c3Rfb2xkOyBpIDwgbGFzdF9vbGQ7KQorICAgIGlmIChtY19vbGRfbGluZXNbaV0KKyAgICAgICAg JiYgbWNfb2xkX2xpbmVzW2ldLT5vbGRfdXNlcyA9PSAxCisgICAgICAgICYmIG1jX29sZF9saW5l c1tpXS0+bmV3X3VzZXMgPT0gMSkKKyAgICAgIHsKKyAgICAgICAgaW50IHAsIHE7CisgICAgICAg IGludCBuZXdfbGluZSA9IG1jX29sZF9saW5lc1tpXS0+bmV3X2xpbmVfbnVtYmVyOworICAgICAg ICBzdHJ1Y3QgcnVuICpydW4gPSBtY19ydW5fcG9vbCArIHJ1bl9pZHgrKzsKKyAgICAgICAgLyog UmVjb3JkIG1vdmUuICovCisgICAgICAgIHJ1bi0+Y3VycmVudF92cG9zID0gaTsKKyAgICAgICAg cnVuLT5jdXJyZW50X3kgPSBNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSktPnk7CisgICAg ICAgIHJ1bi0+ZGVzaXJlZF92cG9zID0gbmV3X2xpbmU7CisgICAgICAgIHJ1bi0+ZGVzaXJlZF95 ID0gTUFUUklYX1JPVyAoZGVzaXJlZF9tYXRyaXgsIG5ld19saW5lKS0+eTsKKyAgICAgICAgcnVu LT5ucm93cyA9IDE7CisgICAgICAgIHJ1bi0+aGVpZ2h0ID0gTUFUUklYX1JPVyAoY3VycmVudF9t YXRyaXgsIGkpLT5oZWlnaHQ7CisgICAgICAgIC8qIEV4dGVuZCBiYWNrd2FyZC4gKi8KKyAgICAg ICAgcCA9IGkgLSAxOworICAgICAgICBxID0gbmV3X2xpbmUgLSAxOworICAgICAgICB3aGlsZSAo cCA+IGZpcnN0X29sZAorICAgICAgICAgICAgICAgJiYgcSA+IGZpcnN0X25ldworICAgICAgICAg ICAgICAgJiYgbWNfb2xkX2xpbmVzW3BdID09IG1jX25ld19saW5lc1txXSkKKyAgICAgICAgICB7 CisgICAgICAgICAgICBpbnQgaCA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCBwKS0+aGVp Z2h0OworICAgICAgICAgICAgLS1ydW4tPmN1cnJlbnRfdnBvczsKKyAgICAgICAgICAgIC0tcnVu LT5kZXNpcmVkX3Zwb3M7CisgICAgICAgICAgICArK3J1bi0+bnJvd3M7CisgICAgICAgICAgICBy dW4tPmhlaWdodCArPSBoOworICAgICAgICAgICAgcnVuLT5kZXNpcmVkX3kgLT0gaDsKKyAgICAg ICAgICAgIHJ1bi0+Y3VycmVudF95IC09IGg7CisgICAgICAgICAgICAtLXAsIC0tcTsKKyAgICAg ICAgICB9CisgICAgICAgIC8qIEV4dGVuZCBmb3J3YXJkLiAqLworICAgICAgICBwID0gaSArIDE7 CisgICAgICAgIHEgPSBuZXdfbGluZSArIDE7CisgICAgICAgIHdoaWxlIChwIDwgbGFzdF9vbGQK KyAgICAgICAgICAgICAgICYmIHEgPCBsYXN0X25ldworICAgICAgICAgICAgICAgJiYgbWNfb2xk X2xpbmVzW3BdID09IG1jX25ld19saW5lc1txXSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBp bnQgaCA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCBwKS0+aGVpZ2h0OworICAgICAgICAg ICAgKytydW4tPm5yb3dzOworICAgICAgICAgICAgcnVuLT5oZWlnaHQgKz0gaDsKKyAgICAgICAg ICAgICsrcCwgKytxOworICAgICAgICAgIH0KKyAgICAgICAgLyogSW5zZXJ0IHJ1biBpbnRvIGxp c3Qgb2YgYWxsIHJ1bnMuICBPcmRlciBydW5zIGJ5IGNvcGllZAorICAgICAgICAgICBwaXhlbCBs aW5lcy4gIE5vdGUgdGhhdCB3ZSByZWNvcmQgcnVucyB0aGF0IGRvbid0IGhhdmUgdG8KKyAgICAg ICAgICAgYmUgY29waWVkIGJlY2F1c2UgdGhleSBhcmUgYWxyZWFkeSBpbiBwbGFjZS4gIFRoaXMg aXMgZG9uZQorICAgICAgICAgICBiZWNhdXNlIHdlIGNhbiBhdm9pZCBjYWxsaW5nIHVwZGF0ZV93 aW5kb3dfbGluZSBpbiB0aGlzCisgICAgICAgICAgIGNhc2UuICovCisgICAgICAgIGZvciAocCA9 IDA7IHAgPCBucnVucyAmJiBtY19ydW5zW3BdLT5oZWlnaHQgPiBydW4tPmhlaWdodDsgKytwKQor ICAgICAgICAgIDsKKyAgICAgICAgZm9yIChxID0gbnJ1bnM7IHEgPiBwOyAtLXEpCisgICAgICAg ICAgbWNfcnVuc1txXSA9IG1jX3J1bnNbcSAtIDFdOworICAgICAgICBtY19ydW5zW3BdID0gcnVu OworICAgICAgICArK25ydW5zOworICAgICAgICBpICs9IHJ1bi0+bnJvd3M7CisgICAgICB9Cisg ICAgICBlbHNlCisgICAgICAgICsraTsKKyAgLyogRG8gdGhlIG1vdmVzLiAgRG8gaXQgaW4gYSB3 YXkgdGhhdCB3ZSBkb24ndCBvdmVyd3JpdGUgc29tZXRoaW5nCisgICAgIHdlIHdhbnQgdG8gY29w eSBsYXRlciBvbi4gIFRoaXMgaXMgbm90IHNvbHZhYmxlIGluIGdlbmVyYWwKKyAgICAgYmVjYXVz ZSB0aGVyZSBpcyBvbmx5IG9uZSBkaXNwbGF5IGFuZCB3ZSBkb24ndCBoYXZlIGEgd2F5IHRvCisg ICAgIGV4Y2hhbmdlIGFyZWFzIG9uIHRoaXMgZGlzcGxheS4gIEV4YW1wbGU6CisgICAgICAgICAg Ky0tLS0tLS0tLS0tKyAgICAgICArLS0tLS0tLS0tLS0rCisgICAgICAgICAgfCAgICAgQSAgICAg fCAgICAgICB8ICAgICBCICAgICB8CisgICAgICAgICAgKy0tLS0tLS0tLS0tKyAgLS0+ICArLS0t LS0tLS0tLS0rCisgICAgICAgICAgfCAgICAgQiAgICAgfCAgICAgICB8ICAgICBBICAgICB8Cisg ICAgICAgICAgKy0tLS0tLS0tLS0tKyAgICAgICArLS0tLS0tLS0tLS0rCisgICAgIEluc3RlYWQs IHByZWZlciBiaWdnZXIgbW92ZXMsIGFuZCBpbnZhbGlkYXRlIG1vdmVzIHRoYXQgd291bGQKKyAg ICAgY29weSBmcm9tIHdoZXJlIHdlIGNvcGllZCB0by4gKi8KKyAgZm9yIChpID0gMDsgaSA8IG5y dW5zOyArK2kpCisgICAgaWYgKG1jX3J1bnNbaV0tPm5yb3dzID4gMCkKKyAgICAgIHsKKyAgICAg ICAgc3RydWN0IHJ1biAqciA9IG1jX3J1bnNbaV07CisgICAgICAgIGlmIChyLT5jdXJyZW50X3kg IT0gci0+ZGVzaXJlZF95KQorICAgICAgICAgIHsKKyAgICAgICAgICAgIC8vICBmcHJpbnRmIChz dGRlcnIsICIlczogIHItPmN1cnJlbnQvZGVzaXJlZF92cG9zICglZC8lZCkgfCByLT5jdXJyZW50 L2Rlc2lyZWRfeSAoJWQvJWQpXG4iLAorICAgICAgICAgICAgLy8gICAgICAgICAgIHItPmN1cnJl bnRfeSA8IHItPmRlc2lyZWRfeSA/ICLihpMiIDogIuKGkSIsCisgICAgICAgICAgICAvLyAgICAg ICAgICAgci0+Y3VycmVudF92cG9zLCByLT5kZXNpcmVkX3Zwb3MsIHItPmN1cnJlbnRfeSwgci0+ ZGVzaXJlZF95KTsKKyAgICAgICAgICAgIC8vICByaWYtPmNsZWFyX3dpbmRvd19tb3VzZV9mYWNl ICh3KTsKKyAgICAgICAgICAgIC8vICByaWYtPnNjcm9sbF9ydW5faG9vayAodywgcik7CisgICAg ICAgICAgfQorICAgICAgICAvKiBUcnVuY2F0ZSBydW5zIHRoYXQgY29weSB0byB3aGVyZSB3ZSBj b3BpZWQgdG8sIGFuZAorICAgICAgICAgICBpbnZhbGlkYXRlIHJ1bnMgdGhhdCBjb3B5IGZyb20g d2hlcmUgd2UgY29waWVkIHRvLiAqLworICAgICAgICBmb3IgKGogPSBucnVucyAtIDE7IGogPiBp OyAtLWopCisgICAgICAgICAgeworICAgICAgICAgICAgc3RydWN0IHJ1biAqcCA9IG1jX3J1bnNb al07CisgICAgICAgICAgICBib29sIHRydW5jYXRlZF9wID0gMDsKKyAgICAgICAgICAgIGlmIChw LT5ucm93cyA+IDAKKyAgICAgICAgICAgICAgICAmJiBwLT5kZXNpcmVkX3kgPCByLT5kZXNpcmVk X3kgKyByLT5oZWlnaHQKKyAgICAgICAgICAgICAgICAmJiBwLT5kZXNpcmVkX3kgKyBwLT5oZWln aHQgPiByLT5kZXNpcmVkX3kpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAo cC0+ZGVzaXJlZF95IDwgci0+ZGVzaXJlZF95KQorICAgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgICBwLT5ucm93cyA9IHItPmRlc2lyZWRfdnBvcyAtIHAtPmRlc2lyZWRfdnBv czsKKyAgICAgICAgICAgICAgICAgICAgcC0+aGVpZ2h0ID0gci0+ZGVzaXJlZF95IC0gcC0+ZGVz aXJlZF95OworICAgICAgICAgICAgICAgICAgICB0cnVuY2F0ZWRfcCA9IDE7CisgICAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgICBpbnQgbnJvd3NfY29waWVkID0gKHItPmRlc2lyZWRfdnBvcyArIHIt Pm5yb3dzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBwLT5kZXNp cmVkX3Zwb3MpOworICAgICAgICAgICAgICAgICAgICBpZiAocC0+bnJvd3MgPD0gbnJvd3NfY29w aWVkKQorICAgICAgICAgICAgICAgICAgICAgIHAtPm5yb3dzID0gMDsKKyAgICAgICAgICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICAgICAgICAgIGludCBoZWlnaHRfY29waWVkID0gKHItPmRlc2lyZWRfeSArIHItPmhlaWdodAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIHAtPmRlc2ly ZWRfeSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmN1cnJlbnRfdnBvcyArPSBucm93 c19jb3BpZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmRlc2lyZWRfdnBvcyArPSBu cm93c19jb3BpZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPm5yb3dzIC09IG5yb3dz X2NvcGllZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcC0+Y3VycmVudF95ICs9IGhlaWdo dF9jb3BpZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmRlc2lyZWRfeSArPSBoZWln aHRfY29waWVkOworICAgICAgICAgICAgICAgICAgICAgICAgICBwLT5oZWlnaHQgLT0gaGVpZ2h0 X2NvcGllZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ1bmNhdGVkX3AgPSAxOworICAg ICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICB9CisgICAgICAgICAgICBpZiAoci0+Y3VycmVudF95ICE9IHItPmRlc2lyZWRfeQorICAgICAg ICAgICAgICAgIC8qIFRoZSBjb25kaXRpb24gYmVsb3cgaXMgZXF1aXZhbGVudCB0bworICAgICAg ICAgICAgICAgICAgICgocC0+Y3VycmVudF95ID49IHItPmRlc2lyZWRfeQorICAgICAgICAgICAg ICAgICAgICAgJiYgcC0+Y3VycmVudF95IDwgci0+ZGVzaXJlZF95ICsgci0+aGVpZ2h0KQorICAg ICAgICAgICAgICAgICAgICB8fCAocC0+Y3VycmVudF95ICsgcC0+aGVpZ2h0ID4gci0+ZGVzaXJl ZF95CisgICAgICAgICAgICAgICAgICAgICAgICAmJiAocC0+Y3VycmVudF95ICsgcC0+aGVpZ2h0 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPD0gci0+ZGVzaXJlZF95ICsgci0+aGVpZ2h0 KSkpCisgICAgICAgICAgICAgICAgICAgYmVjYXVzZSB3ZSBoYXZlIDAgPCBwLT5oZWlnaHQgPD0g ci0+aGVpZ2h0LiAqLworICAgICAgICAgICAgICAgICYmIHAtPmN1cnJlbnRfeSA8IHItPmRlc2ly ZWRfeSArIHItPmhlaWdodAorICAgICAgICAgICAgICAgICYmIHAtPmN1cnJlbnRfeSArIHAtPmhl aWdodCA+IHItPmRlc2lyZWRfeSkKKyAgICAgICAgICAgICAgcC0+bnJvd3MgPSAwOworICAgICAg ICAgICAgLyogUmVvcmRlciBydW5zIGJ5IGNvcGllZCBwaXhlbCBsaW5lcyBpZiB0cnVuY2F0ZWQu ICovCisgICAgICAgICAgICBpZiAodHJ1bmNhdGVkX3AgJiYgcC0+bnJvd3MgPiAwKQorICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgaW50IGsgPSBucnVucyAtIDE7CisgICAgICAgICAg ICAgICAgd2hpbGUgKG1jX3J1bnNba10tPm5yb3dzID09IDAgfHwgbWNfcnVuc1trXS0+aGVpZ2h0 IDwgcC0+aGVpZ2h0KQorICAgICAgICAgICAgICAgICAgay0tOworICAgICAgICAgICAgICAgIG1l bW1vdmUgKG1jX3J1bnMgKyBqLCBtY19ydW5zICsgaiArIDEsIChrIC0gaikgKiBzaXplb2YgKCpt Y19ydW5zKSk7CisgICAgICAgICAgICAgICAgbWNfcnVuc1trXSA9IHA7CisgICAgICAgICAgICAg IH0KKyAgICAgICAgICB9CisgICAgICAgIC8qIEFzc2lnbiBtYXRyaXggcm93cy4gKi8KKyAgICAg ICAgZm9yIChqID0gMDsgaiA8IHItPm5yb3dzOyArK2opCisgICAgICAgICAgeworICAgICAgICAg ICAgc3RydWN0IGdseXBoX3JvdyAqZnJvbSwgKnRvOworICAgICAgICAgICAgYm9vbCB0b19vdmVy bGFwcGVkX3A7CisgICAgICAgICAgICB0byA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCBy LT5kZXNpcmVkX3Zwb3MgKyBqKTsKKyAgICAgICAgICAgIGZyb20gPSBNQVRSSVhfUk9XIChkZXNp cmVkX21hdHJpeCwgci0+ZGVzaXJlZF92cG9zICsgaik7CisgICAgICAgICAgICB0b19vdmVybGFw cGVkX3AgPSB0by0+b3ZlcmxhcHBlZF9wOworICAgICAgICAgICAgZnJvbS0+cmVkcmF3X2ZyaW5n ZV9iaXRtYXBzX3AgPSBmcm9tLT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3A7CisgICAgICAgICAg ICBhc3NpZ25fcm93ICh0bywgZnJvbSk7CisgICAgICAgICAgICAvKiBUaGUgYWJvdmUgYGFzc2ln bl9yb3cnIGFjdHVhbGx5IGRvZXMgc3dhcCwgc28gaWYgd2UgaGFkCisgICAgICAgICAgICAgICBh biBvdmVybGFwIGluIHRoZSBjb3B5IGRlc3RpbmF0aW9uIG9mIHR3byBydW5zLCB0aGVuCisgICAg ICAgICAgICAgICB0aGUgc2Vjb25kIHJ1biB3b3VsZCBhc3NpZ24gYSBwcmV2aW91c2x5IGRpc2Fi bGVkIGJvZ3VzCisgICAgICAgICAgICAgICByb3cuICBCdXQgdGhhbmtzIHRvIHRoZSB0cnV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VseSB1cG9uIHRoZSBwcmV2aW91cyByb3cgaW4gdGhlIGN1cnJl bnQgbWF0cml4LiAgQXMgdG8gdGhlIGN1cnNvciByb3csIHdlCisgIHJlcGx5IHVwb24gdGhlIHBy ZXZpb3VzIHJvdyBpbiB0aGUgZGVzaXJlZCBtYXRyaXggLS0gdGhpcyBpcyBhY2NlcHRhYmxlIGJl Y2F1c2UKKyAgdGhlIHBvaW50ZXJzIGJldHdlZW4gZGVzaXJlZC9jdXJyZW50IHJvdyBtYXRyaWNl cyBoYXZlIG5vdCB5ZXQgYmVlbiBzd2FwcGVkIGJ5CisgIGBtYWtlX2N1cnJlbnQnIGluIGB1cGRh dGVfd2luZG93X2xpbmUnLCBvciBiZWNhdXNlIHRoZSBwcmV2aW91cyByb3cgd291bGQgYmUKKyAg dGhlIHNhbWUgaW4gYm90aCBtYXRyaWNlcyBpZiB3ZSBqdW1wZWQgdG8gYHNldF9jdXJzb3I6YCB3 aXRoaW4gYHVwZGF0ZV93aW5kb3cnCisgIGFuZCBgbWNfdXBkYXRlX3dpbmRvd19kcnlydW4nLiAq LworICBpbnQgcHJldl9tYXRyaXhfcm93X3N0YXJ0X2J5dGVwb3MgPSAodnBvcyAhPSAwKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1BVFJJWF9ST1dfU1RBUlRfQllU RVBPUyAoY3VycmVudF9yb3cgLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IC0xOworICBpbnQgcHJldl9tYXRyaXhfcm93X2VuZF9ieXRlcG9zID0gKHZwb3MgIT0g MCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPV19FTkRf QllURVBPUyAoY3VycmVudF9yb3cgLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAtMTsKKyAgaW50IG1hdHJpeF9yb3dfc3RhcnRfYnl0ZXBvcyA9IE1BVFJJWF9ST1df U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AgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZGVzaXJlZF9yb3cKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBjdXJy ZW50X3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgZGVzaXJlZF9yb3csIHZwb3MpOworICAvKiBJZiByb3dzIGFyZSBhdCBkaWZmZXJl bnQgWCBvciBZLCBvciByb3dzIGhhdmUgZGlmZmVyZW50IGhlaWdodCwKKyAgICAgb3IgdGhlIGN1 cnJlbnQgcm93IGlzIG1hcmtlZCBpbnZhbGlkLCB3cml0ZSB0aGUgZW50aXJlIGxpbmUuICovCisg IGlmICghY3VycmVudF9yb3ctPmVuYWJsZWRfcAorICAgICAgfHwgZGVzaXJlZF9yb3ctPnkgIT0g Y3VycmVudF9yb3ctPnkKKyAgICAgIHx8IGRlc2lyZWRfcm93LT5hc2NlbnQgIT0gY3VycmVudF9y b3ctPmFzY2VudAorICAgICAgfHwgZGVzaXJlZF9yb3ctPnBoeXNfYXNjZW50ICE9IGN1cnJlbnRf cm93LT5waHlzX2FzY2VudAorICAgICAgfHwgZGVzaXJlZF9yb3ctPnBoeXNfaGVpZ2h0ICE9IGN1 cnJlbnRfcm93LT5waHlzX2hlaWdodAorICAgICAgfHwgZGVzaXJlZF9yb3ctPnZpc2libGVfaGVp Z2h0ICE9IGN1cnJlbnRfcm93LT52aXNpYmxlX2hlaWdodAorICAgICAgfHwgY3VycmVudF9yb3ct Pm92ZXJsYXBwZWRfcAorICAgICAgLyogVGhpcyBuZXh0IGxpbmUgaXMgbmVjZXNzYXJ5IGZvciBj b3JyZWN0bHkgcmVkcmF3aW5nCisgICBtb3VzZS1mYWNlIGFyZWFzIGFmdGVyIHNjcm9sbGluZyBh bmQgb3RoZXIgb3BlcmF0aW9ucy4KKyAgIEhvd2V2ZXIsIGl0I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gICAgICBp bnQgc3RhcnRfaHBvcyA9IGk7CisKKyAgICAgICAgd2hpbGUgKGkgPCBzdG9wCisgICAgICAgICAg ICAgICAmJiBHTFlQSF9FUVVBTF9QIChkZXNpcmVkX2dseXBoLCBjdXJyZW50X2dseXBoKSkKKyAg ICAgICAgICB7CisgICAgICAgICAgICArK2FycmF5X2dseXBoc19za2lwcGVkLnVzZWQ7CisgICAg ICAgICAgICBpZiAoYXJyYXlfZ2x5cGhzX3NraXBwZWQuYWxsb2NhdGVkIDwgYXJyYXlfZ2x5cGhz X3NraXBwZWQudXNlZCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGludCBvbGRf YWxsb2MgPSBhcnJheV9nbHlwaHNfc2tpcHBlZC5hbGxvY2F0ZWQ7CisgICAgICAgICAgICAgICAg aW50IG5ld19lbHRzID0gYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZCAtIGFycmF5X2dseXBoc19z a2lwcGVkLmFsbG9jYXRlZDsKKyAgICAgICAgICAgICAgICBhcnJheV9nbHlwaHNfc2tpcHBlZC5z a2lwcGVkID0KKyAgICAgICAgICAgICAgICAgIHhwYWxsb2MgKGFycmF5X2dseXBoc19za2lwcGVk LnNraXBwZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmYXJyYXlfZ2x5cGhzX3NraXBw ZWQuYWxsb2NhdGVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2VsdHMsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICBJTlRfTUFYLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgc2l6ZW9mICphcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVkKTsKKyAgICAgICAgICAgICAg ICBtZW1zZXQgKGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWQgKyBvbGRfYWxsb2MsIDAsCisg ICAgICAgICAgICAgICAgICAgICAgICAgKGFycmF5X2dseXBoc19za2lwcGVkLmFsbG9jYXRlZCAt IG9sZF9hbGxvYykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICogc2l6ZW9mICphcnJheV9n bHlwaHNfc2tpcHBlZC5za2lwcGVkKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgaW50 IG50aCA9IGFycmF5X2dseXBoc19za2lwcGVkLnVzZWQgLSAxOworICAgICAgICAgICAgYXJyYXlf Z2x5cGhzX3NraXBwZWQuc2tpcHBlZFtudGhdLnggPSB4OworICAgICAgICAgICAgYXJyYXlfZ2x5 cGhzX3NraXBwZWQuc2tpcHBlZFtudGhdLmhwb3MgPSBpOworICAgICAgICAgICAgYXJyYXlfZ2x5 cGhzX3NraXBwZWQuc2tpcHBlZFtudGhdLmVuYWJsZWRfcCA9IHRydWU7CisgICAgICAgICAgICB4 ICs9IGRlc2lyZWRfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgKytkZXNpcmVkX2ds eXBoLCArK2N1cnJlbnRfZ2x5cGgsICsraTsKKyAgICAgICAgICB9CisKKyAgICAgICAgLyogQ29u c2lkZXIgdGhlIGNhc2UgdGhhdCB0aGUgY3VycmVudCByb3cgY29udGFpbnMgInh4eAorICAgICBw cHAgZ2dnIiBpbiBpdGFsaWMgQ291cmllciBmb250LCBhbmQgdGhlIGRlc2lyZWQgcm93CisgICAg IGlzICJ4eHggZ2dnIi4gIFRoZSBjaGFyYWN0ZXIgYHAnIGhhcyBsYmVhcmluZywgYGcnCisgICAg IGhhcyBub3QuICBUaGUgbG9vcCBhYm92ZSB3aWxsIHN0b3AgaW4gZnJvbnQgb2YgdGhlCisgICAg IGZpcnN0IGBwJyBpbiB0aGUgY3VycmVudCByb3cuICBJZiB3ZSB3b3VsZCBzdGFydAorICAgICB3 cml0aW5nIGdseXBocyB0aGVyZSwgd2Ugd291bGRuJ3QgZXJhc2UgdGhlIGxiZWFyaW5nCisgICAg IG9mIHRoZSBgcCcuICBUaGUgcmVzdCBvZiB0aGUgbGJlYXJpbmcgcHJvYmxlbSBpcyB0aGVuCisg ICAgIHRha2VuIGNhcmUgb2YgYnkgZHJhd19nbHlwaHMuICovCisgICAgICAgIGlmIChvdmVybGFw cGluZ19nbHlwaHNfcAorICAgICAgICAgICAgJiYgaSA+IDAKKyAgICAgICAgICAgICYmIGkgPCBj dXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAmJiAoY3VycmVudF9yb3ct PnVzZWRbVEVYVF9BUkVBXSAhPSBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdKSkKKyAgICAg ICAgICB7CisgICAgICAgICAgICBpbnQgbGVmdCwgcmlnaHQ7CisgICAgICAgICAgICByaWYtPmdl dF9nbHlwaF9vdmVyaGFuZ3MgKGN1cnJlbnRfZ2x5cGgsCisgICAgICAgICAgICAgICAgICAgIFhG UkFNRSAody0+ZnJhbWUpLAorICAgICAgICAgICAgICAgICAgICAmbGVmdCwgJnJpZ2h0KTsKKyAg ICAgICAgICAgIHdoaWxlIChsZWZ0ID4gMCAmJiBpID4gMCkKKyAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgIC0taSwgLS1kZXNpcmVkX2dseXBoLCAtLWN1cnJlbnRfZ2x5cGg7CisgICAg ICAgICAgICAgICAgeCAtPSBkZXNpcmVkX2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAg ICAgICBsZWZ0IC09IGRlc2lyZWRfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAvKiBBYm9ydCB0aGUgc2tpcHBpbmcgYWxnb3JpdGhtIGlmIHdlIGVuZCB1 cCBiZWZvcmUKKyAgICAgICAgICAgICAgIG91ciBzdGFydGluZyBwb2ludCwgdG8gYXZvaWQgbG9v cGluZyAoYnVnIzEwNzApLgorICAgICAgICAgICAgICAgVGhpcyBjYW4gaGFwcGVuIHdoZW4gdGhl IGxiZWFyaW5nIGlzIGxhcmdlciB0aGFuCisgICAgICAgICAgICAgICB0aGUgcGl4ZWwgd2lkdGgu ICovCisgICAgICAgICAgICBhYm9ydF9za2lwcGluZyA9IChpIDwgc3RhcnRfaHBvcyk7CisgICAg ICAgICAgfQorICAgICAgfQorCisgICAgLyogVHJ5IHRvIGF2b2lkIHdyaXRpbmcgdGhlIGVudGly ZSByZXN0IG9mIHRoZSBkZXNpcmVkIHJvdworICAgICAgIGJ5IGxvb2tpbmcgZm9yIGEgcmVzeW5j IHBvaW50LiAgVGhpcyBtYWlubHkgcHJldmVudHMKKyAgICAgICBtb2RlIGxpbmUgZmxpY2tlcmlu ZyBpbiB0aGUgY2FzZSB0aGUgbW9kZSBsaW5lIGlzIGluCisgICAgICAgZml4ZWQtcGl0Y2ggZm9u dCwgd2hpY2ggaXQgdXN1YWxseSB3aWxsIGJlLiAqLworICAgIGlmIChpIDwgZGVzaXJlZF9yb3ct PnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgIHsKKyAgICAgICAgaW50IHN0YXJ0X3ggPSB4LCBzdGFy dF9ocG9zID0gaTsKKyAgICAgICAgc3RydWN0IGdseXBoICpzdGFydCA9IGRlc2lyZWRfZ2x5cGg7 CisgICAgICAgIGludCBjdXJyZW50X3ggPSB4OworICAgICAgICBib29sIHNraXBfZmlyc3RfcCA9 ICFjYW5fc2tpcF9wOworICAgICAgICAvKiBGaW5kIHRoZSBuZXh0IGdseXBoIHRoYXQncyBlcXVh bCBhZ2Fpbi4gKi8KKyAgICAgICAgd2hpbGUgKGkgPCBzdG9wCisgICAgICAgICAgICAgICAmJiAo c2tpcF9maXJzdF9wCisgICAgICAgICAgICAgICAgICAgfHwgIUdMWVBIX0VRVUFMX1AgKGRlc2ly ZWRfZ2x5cGgsIGN1cnJlbnRfZ2x5cGgpKQorICAgICAgICAgICAgICAgJiYgeCA9PSBjdXJyZW50 X3gpCisgICAgICAgICAgeworICAgICAgICAgICAgeCArPSBkZXNpcmVkX2dseXBoLT5waXhlbF93 aWR0aDsKKyAgICAgICAgICAgIGN1cnJlbnRfeCArPSBjdXJyZW50X2dseXBoLT5waXhlbF93aWR0 aDsKKyAgICAgICAgICAgICsrZGVzaXJlZF9nbHlwaCwgKytjdXJyZW50X2dseXBoLCArK2k7Cisg ICAgICAgICAgICBza2lwX2ZpcnN0X3AgPSAwOworICAgICAgICAgIH0KKworICBmb3IgKGludCBl bHQgPSAwOworICAgICAgIGVsdCA8IGFycmF5X2dseXBoc19za2lwcGVkLnVzZWQKKyAgICAgICAm JiB2cG9zICE9IGJvdHRvbV92cG9zOworICAgICAgICsrZWx0KQorICAgIHsKKyAgICAgIGludCB4 ID0gYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZFtlbHRdLng7CisgICAgICBpbnQgaHBvcyA9 IGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbZWx0XS5ocG9zOworICAgICAgc3RydWN0IGds eXBoICp0YXJnZXRfZ2x5cGggPQorICAgICAgICBtY19nZXRfY3Vyc29yX2dseXBoICh3LCBkZXNp cmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIGhwb3MsIHZwb3MpOworICAgICAgaWYgKGRlYnVnX3Ap CisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIlNLSVBQRUQ6ICB2cG9zICglZCkgfCBjaGFyICgl ZC8lcykgfCB4OiAoJWQpIHwgaHBvcyAoJWQvJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAg ICAgIHZwb3MsIHRhcmdldF9nbHlwaC0+dS5jaCwgbWNfY2hhcl90b19zdHJpbmcgKHRhcmdldF9n bHlwaC0+dS5jaCksCisgICAgICAgICAgICAgICAgICAgICAgICAgeCwgaHBvcywgdXBkYXRlZF9y b3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpOworICAgICAgbWNfZHJhd19yb3cgKHcsIGRlc2lyZWRf bWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBoLCB4LCAxLCB2cG9zLAorICAgICAgICAg ICAgICAgICAgIGJvdHRvbV92cG9zLCBjdXJzb3JfbWF0cml4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IWNoYW5nZWRfcCkKKyAgICAgICAgeworICAgICAgICAgIGlmIChk ZWJ1Z19wKQorICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiVU5DSEFOR0VEIC0tIFdSSVRF IEVOVElSRSBMSU5FOiAgdnBvcyAoJWQpIHwgcm93LT51c2VkICglZClcbiIsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHZwb3MsIHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAx KTsKKyAgICAgICAgICBtY19kcmF3X3JvdyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93 LCBkZXNpcmVkX3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgICAgICAgICAgICAg IGRlc2lyZWRfcm93LT54LCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdLCB2cG9zLAorICAg ICAgICAgICAgICAgICAgICAgICBib3R0b21fdnBvcywgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFs cywgcm93X3Bvc2l0aW9uLCBkcmF3X3AsIFVOQ0hBTkdFRCk7CisgICAgICAgIH0KKworICAgICAg LyogTWF5YmUgY2xlYXIgdG8gZW5kIG9mIGxpbmUuICovCisgICAgICBpZiAoTUFUUklYX1JPV19F WFRFTkRTX0ZBQ0VfUCAoZGVzaXJlZF9yb3cpKQorICAgICAgICB7CisgICAgICAgICAgLyogSWYg bmV3IHJvdyBleHRlbmRzIHRvIHRoZSBlbmQgb2YgdGhlIHRleHQgYXJlYSwgbm90aGluZworICAg ICAgICAgICAgIGhhcyB0byBiZSBjbGVhcmVkLCBpZiBhbmQgb25seSBpZiB3ZSBkaWQgYSB3cml0 ZV9nbHlwaHMKKyAgICAgICAgICAgICBhYm92ZS4gIFRoaXMgaXMgbWFkZSBzdXJlIGJ5IHNldHRp bmcgZGVzaXJlZF9zdG9wX3BvcworICAgICAgICAgICAgIGFwcHJvcHJpYXRlbHkgYWJvdmUuICov CisgICAg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l0aW9uIHNob3VsZCBiZSBjbGVhciBh bHJlYWR5LiAqLworICAgICAgICAgIGludCB4bGltOworICAgICAgICAgIGlmIChpID49IGRlc2ly ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgICAgICBvdXRwdXRfY3Vyc29yX3RvICh3 LCB2cG9zLCBpLCBkZXNpcmVkX3Jvdy0+eSwgZGVzaXJlZF9yb3ctPnBpeGVsX3dpZHRoKTsKKyAg ICAgICAgICAvKiBJZiBjdXJzb3IgaXMgZGlzcGxheWVkIGF0IHRoZSBlbmQgb2YgdGhlIGxpbmUs IG1ha2Ugc3VyZQorICAgICAgICAgICAgIGl0J3MgY2xlYXJlZC4gIE5vd2FkYXlzIHdlIGRvbid0 IGhhdmUgYSBwaHlzX2N1cnNvcl9nbHlwaAorICAgICAgICAgICAgIHdpdGggd2hpY2ggdG8gZXJh c2UgdGhlIGN1cnNvciAoYmVjYXVzZSB0aGlzIG1ldGhvZAorICAgICAgICAgICAgIGRvZXNuJ3Qg d29yayB3aXRoIGxiZWFyaW5nL3JiZWFyaW5nKSwgc28gd2UgbXVzdCBkbyBpdCB0aGlzIHdheS4g Ki8KKyAgICAgICAgICBpZiAodnBvcyA9PSB3LT5waHlzX2N1cnNvci52cG9zCisgICAgICAgICAg ICAgICYmIChkZXNpcmVkX3Jvdy0+cmV2ZXJzZWRfcAorICAgICAgICAgICAgICAgICAgPyAody0+ cGh5c19jdXJzb3IuaHBvcyA8IDApCisgICAgICAgICAgICAgICAgICA6ICh3LT5waHlzX2N1cnNv ci5ocG9zID49IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pKSkKKyAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgdy0+cGh5c19jdXJzb3Jfb25fcCA9IDA7CisgICAgICAgICAgICAgIHhs aW0gPSAtMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAg eGxpbSA9IGN1cnJlbnRfcm93LT5waXh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JlY2F1c2UgYSB3 b3JkLXdyYXBwZWQgbGluZSBkb2VzIG5vdCByZWNlaXZlIGFuIGV4dHJhCisgICAgICBzcGFjZSBs aWtlIG5vbi13b3JkLXdyYXBwZWQgbGluZXMgZG8uICovCisgICAgICBpbnQgeCA9IHVwZGF0ZWRf cm93LT5waXhlbF93aWR0aDsKKyAgICAgIGludCBocG9zID0gdXBkYXRlZF9yb3ctPnVzZWRbVEVY VF9BUkVBXSAtIDE7CisgICAgICBpbnQgeF9saW1pdCA9IChjbGVhcl90b194ID09IC0xKQorICAg ICAgICAgICAgICAgICAgICA/IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICA6 IGNsZWFyX3RvX3g7CisgICAgICBMaXNwX09iamVjdCBidWYgPSB3LT5jb250ZW50czsKKyAgICAg IENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgICAgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSIChi dWYpOworICAgICAgYm9vbCBmaWxsX2NvbHVtbl90cnVtcHNfcCA9ICghTklMUCAoQlZBUiAoYiwg Y2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gZXNzZW50aWFs cy5mY194KTsKKworICAgICAgaWYgKHRyYWNlX3JlZGlzcGxheV9wKQorICAgICAgICBmcHJpbnRm IChzdGRlcnIsICJtY191cGRhdGVfdGV4dF9hcmVhIChmbG9hdGluZyk6ICB2cG9zICglZCkgfCB4 X2xpbWl0ICglZClcbiIsIHZwb3MsIHhfbGltaXQpOworCisgICAgICBpZiAoQlVGRkVSUCAody0+ Y29udGVudHMpCisgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgJiYgeCA8IHRleHRfYXJlYV93aWR0aAorICAgICAg ICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSB4CisgICAgICAgICAgJiYgdGFyZ2V0X2dseXBoICE9 IE5VTEwKKyAgICAgICAgICAmJiBkcmF3X3ApCisgICAgICAgIG1jX2VuZ2luZSAodywgZGVzaXJl ZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRfZ2x5cGgsIFRFWFRfQVJFQSwgeCwgeF9saW1p dCwKKyAgICAgICAgICAgICAgICAgICB1cGRhdGVkX3Jvdy0+eSwgaHBvcywgdnBvcywgTUNfQkFS LCAxLCBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLAorICAgICAgICAgICAgICAgICAgIHJvd19w b3NpdGlvbiwgZGVidWdfcCA/IGRlYnVnX2ZnIDogZXNzZW50aWFscy5mY19mZ1tyb3dfcG9zaXRp b25dLAorICAgICAgICAgICAgICAgICAgIEZJTExfQ09MVU1OLCBkcmF3X3AsIE5PV0hFUkUsIE5P X0NBQ0hFKTsKKworICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICYm ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAg ICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2hvcml6b250YWxf cnVsZXIpKQorICAgICAgICAgICYmIHggPCB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAmJiB2 cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgJiYgdGFyZ2V0X2dseXBoICE9IE5VTEwK KyAgICAgICAgICAmJiBkcmF3X3ApCisgICAgICAgIG1jX2VuZ2luZSAodywgZGVzaXJlZF9tYXRy aXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRfZ2x5cGgsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwKKyAg ICAgICAgICAgICAgICAgICB1cGRhdGVkX3Jvdy0+eSwgaHBvcywgdnBvcywgTUNfSEJBUiwgMSwg Y3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywKKyAgICAgICAgICAgICAgICAgICByb3dfcG9zaXRp b24sIGRlYnVnX3AgPyBkZWJ1Z19mZyA6IGVzc2VudGlhbHMuY2hfZmdbcm93X3Bvc2l0aW9uXSwK KyAgICAgICAgICAgICAgICAgICBIT1JJWk9OVEFMX1JVTEVSLCBkcmF3X3AsIE5PV0hFUkUsIE5P X0NBQ0hFKTsKKworICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICYm ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAg ICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX3ZlcnRpY2FsX3J1 bGVyKSkKKyAgICAgICAgICAmJiAhZmlsbF9jb2x1bW5fdHJ1bXBzX3AKKyAgICAgICAgICAmJiB4 IDwgdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgJiYgdnBvcyAhPSB3LT5jdXJzb3IudnBvcwor ICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHgKKyAgICAgICAgICAmJiB0YXJnZXRfZ2x5cGgg IT0gTlVMTAorICAgICAgICAgICYmIGRyYXdfcCkKKyAgICAgICAgbWNfZW5naW5lICh3LCBkZXNp cmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHRhcmdldF9nbHlwaCwgVEVYVF9BUkVBLCB4LCB4X2xp bWl0LAorICAgICAgICAgICAgICAgICAgIHVwZGF0ZWRfcm93LT55LCBocG9zLCB2cG9zLCBNQ19C QVIsIDEsIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsCisgICAgICAgICAgICAgICAgICAgcm93 X3Bvc2l0aW9uLCBkZWJ1Z19wID8gZGVidWdfZmcgOiB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QoreworICBib29sIGdvX29uZV9wID0gKG9sZF9tYXRyaXguY3Vyc29yc191c2Vk W01DX0NBQ0hFXSA+IDAKKyAgICAgICAgICAgICAgICAgICB8fCBvbGRfbWF0cml4LmN1cnNvcnNf dXNlZFtDSF9DQUNIRV0gPiAwCisgICAgICAgICAgICAgICAgICAgfHwgb2xkX21hdHJpeC5jdXJz b3JzX3VzZWRbRkNfQ0FDSEVdID4gMCk7CisgIGJvb2wgZ29fdHdvX3AgPSAoQlVGRkVSUCAody0+ Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3 LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICB8fCAhTklM UCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAg ICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29u ZikpKSk7CisgIGJvb2wgdXBkYXRpbmdfZnJhbWVfcCA9IGZhbHNlOworICBzdHJ1Y3QgZnJhbWUg KmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgaWYgKFhGUkFNRSAody0+ZnJhbWUpICE9IGYtPm1j X3VwZGF0aW5nX2ZyYW1lCisgICAgICAmJiAoZ29fb25lX3AgfHwgZ29fdHdvX3ApKQorICAgIHsK KyAgICAgIHVwZGF0aW5nX2ZyYW1lX3AgPSB0cnVlOworICAgICAgdXBkYXRlX2JlZ2luIChmKTsK KyAgICB9CisgIGlmICh3LT5waHlzX2N1cnNvcl9vbl9wCisgICAgICAmJiBnb190d29fcCkKKyAg ICBlcmFzZV9waHlzX2N1cnNvciAodyk7CisgIGZvciAoaW50IHZudGggPSAwOworICAgICAgIGdv X29uZV9wCisgICAgICAgJiYgdm50aCA8IHctPm1jX21hdHJpeC52cG9zX3VzZWQ7CisgICAgICAg Kyt2bnRoKQorICAgIHsKKyAgICAgIGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUg PSBNQ19DQUNIRTsKKyAgICAgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICAg ICArK2NhY2hlX3R5cGUpCisgICAgICAgIGZvciAoaW50IG50aF8wID0gMDsKKyAgICAgICAgICAg ICBtY190cmF2ZXJzZV9jYWNoZV9wIChvbGRfbWF0cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGhf MCk7CisgICAgICAgICAgICAgKytudGhfMCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBib29s IHNhbWVfcCA9IGZhbHNlOworICAgICAgICAgICAgZm9yIChpbnQgd19udGggPSAwOyB3X250aCA8 IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV07ICsrd19udGgp CisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzYW1lX3AgfD0gKG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGgudHlwZQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVt3X250aF0uZ2x5cGgudHlwZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5ieXRl cG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5ieXRlcG9zCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXzBdLmdseXBoLmNoYXJwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLmNoYXJw b3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGgudS52YWwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19u dGhdLmdseXBoLnUudmFsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLmZhY2VfaWQKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bd19udGhdLmdseXBoLmZhY2VfaWQKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5 cGgucGFkZGluZ19wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5wYWRkaW5nX3AKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMF0uZ2x5cGgubGVmdF9ib3hfbGluZV9wCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W3dfbnRoXS5nbHlwaC5sZWZ0X2JveF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGgu cmlnaHRfYm94X2xpbmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgucmlnaHRfYm94 X2xpbmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC52b2Zmc2V0CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3dfbnRoXS5nbHlwaC52b2Zmc2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnBpeGVs X3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5waXhlbF93aWR0aAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8wXS5nbHlwaC5zbGljZS5pbWcueAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0u Z2x5cGguc2xpY2UuaW1nLngKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGguc2xpY2UuaW1nLnkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnNsaWNlLmltZy55CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXzBdLmdseXBoLnNsaWNlLmltZy53aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5 cGguc2xpY2UuaW1nLndpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnNsaWNlLmltZy5o ZWlnaHQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnNsaWNlLmltZy5oZWlnaHQKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMF0uZ2x5cGguc2xpY2UuY21wLmZyb20KKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b d19udGhdLmdseXBoLnNsaWNlLmNtcC5mcm9tCisgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLngKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bd19udGhdLngKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZngKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bd19udGhdLmZ4CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLnkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b d19udGhdLnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZnkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhd LmZ5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmhwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmhw b3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMF0udnBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0udnBv cworICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8wXS53ZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9 PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0ud2QKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMF0uaAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uaAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS5jdXJzb3JfdHlwZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uY3Vyc29yX3R5 cGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMF0uY3Vyc29yX3dpZHRoCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3df bnRoXS5jdXJzb3Jfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZmcucmVkCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW3dfbnRoXS5mZy5yZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZmcuZ3JlZW4KKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bd19udGhdLmZnLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZnLmJsdWUK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmZnLmJsdWUKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uYmcu cmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5iZy5yZWQKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0u YmcuZ3JlZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmJnLmdyZWVuCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXzBdLmJnLmJsdWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmJnLmJsdWUKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMF0uYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmFjdGl2ZV9wCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoX2ZsYXZvcgorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0u Z2x5cGhfZmxhdm9yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmVuYWJsZWRfcAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVt3X250aF0uZW5hYmxlZF9wKTsKKyAgICAgICAgICAgICAgICAvKiBGb3JjZSB0aGUgZnJp bmdlIGJpdG1hcHMgdG8gYWx3YXlzIGJlIHJlc2V0L3JlZHJhd24uICovCisgICAgICAgICAgICAg ICAgaWYgKG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uY3Vy c29yX3R5cGUKKyAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uY3Vyc29yX3R5cGUKKyAgICAgICAgICAgICAgICAg ICAgJiYgKG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uY3Vy c29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgICAg ICB8fCBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmN1cnNv cl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVApKQorICAgICAgICAgICAgICAgICAgc2Ft ZV9wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgaWYgKHNhbWVfcCkKKyAgICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gIGZwcmludGYgKHN0ZGVyciwgIkhJVCAoJXMp OiAgdnBvcyAoJWQpIHwgaHBvcyAoJWQpIHwgY2hhciAoJXMpXG4iLAorICAgICAgICAgICAgICAg ICAgICAvLyAgICAgICAgICAgICAgICAgICAoY2FjaGVfdHlwZSA9PSBNQ19DQUNIRSkKKyAgICAg ICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICA/ICJNQyIKKyAgICAgICAgICAg ICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgOiAoY2FjaGVfdHlwZSA9PSBDSF9DQUNIRSkK KyAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICA/ICJDSCIKKyAgICAg ICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgOiAoY2FjaGVfdHlwZSA9PSBGQ19D QUNIRSkKKyAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICA/ICJGQyIK KyAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgOiAiTk8iLAorICAgICAg ICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0udnBvcywKKyAgICAgICAgICAgICAgICAgICAgLy8g ICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bd19udGhdLmhwb3MsCisgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAg IG1jX2NoYXJfdG9fc3RyaW5nICh3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVt3X250aF0uZ2x5cGgudS5jaCkpOworICAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uc2FtZV9wID0gdHJ1ZTsKKyAg ICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAg ICAvLyAgZnByaW50ZiAoc3RkZXJyLCAiTUlTUyAoJXMpOiAgdnBvcyAoJWQpIHwgaHBvcyAoJWQg di4gJWQpIHwgY2hhciAoJXMgdi4gJXMpIHwgY2FjaGVfdXNlZCAoJWQgdi4gJWQpXG4iLAorICAg ICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIChjYWNoZV90eXBlID09IE1D X0NBQ0hFKQorICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgPyAi TUMiCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgOiAoY2FjaGVf dHlwZSA9PSBDSF9DQUNIRSkKKyAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAg ICAgICAgID8gIkNIIgorICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAg IDogKGNhY2hlX3R5cGUgPT0gRkNfQ0FDSEUpCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAg ICAgICAgICAgICAgICAgICA/ICJGQyIKKyAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAg ICAgICAgICAgICA6ICJOTyIsCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAg ICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLnZw b3MsCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5ocG9zLAorICAgICAgICAgICAg ICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5ocG9zLAorICAgICAgICAgICAgICAgICAgICAgIC8vICAg ICAgICAgICAgICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nIChvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnUuY2gpLAorICAgICAgICAgICAgICAgICAg ICAgIC8vICAgICAgICAgICAgICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nICh3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgudS5jaCksCisgICAgICAg ICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlX3VzZWRbY2FjaGVfdHlwZV0sCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAg ICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBl XSk7CisgICAgICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bd19udGhdLnNhbWVfcCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICghc2FtZV9wKQorICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgLyogYG1hdHJpeF9yb3cnIGluIGBkaXNwbmV3LmNgIGNvbnRh aW5zIHRoZSBmb2xsb3dpbmcgdGVzdHMsCisgICAgICAgICAgICAgICAgZWFzc2VydCAobWF0cml4 ICYmIG1hdHJpeC0+cm93cyk7CisgICAgICAgICAgICAgICAgZWFzc2VydCAocm93ID49IDAgJiYg cm93IDwgbWF0cml4LT5ucm93cyk7ICovCisgICAgICAgICAgICAgICAgYm9vbCBiYXJmX2NyYXNo X29uZSA9ICh3LT5jdXJyZW50X21hdHJpeCAmJiB3LT5jdXJyZW50X21hdHJpeC0+cm93cykgPyBm YWxzZSA6IHRydWU7CisgICAgICAgICAgICAgICAgaWYgKGJhcmZfY3Jhc2hfb25lKQorICAgICAg ICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgYm9vbCBiYXJmX2NyYXNoX3R3 byA9ICh2bnRoID49IDAgJiYgdm50aCA8IHctPmN1cnJlbnRfbWF0cml4LT5ucm93cykgPyBmYWxz ZSA6IHRydWU7CisgICAgICAgICAgICAgICAgaWYgKGJhcmZfY3Jhc2hfdHdvKQorICAgICAgICAg ICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqdm50 aF9yb3cgPSBNQVRSSVhfUk9XICh3LT5jdXJyZW50X21hdHJpeCwgdm50aCk7CisgICAgICAgICAg ICAgICAgaW50IHhfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhfMF0ueDsKKyAgICAgICAgICAgICAgICBpbnQgZnhfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZng7CisgICAgICAgICAgICAgICAgaW50IHlfMCA9 IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0ueTsKKyAgICAg ICAgICAgICAgICBpbnQgZnlfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMF0uZnk7CisgICAgICAgICAgICAgICAgaW50IGhwb3NfMCA9IG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uaHBvczsKKyAgICAgICAgICAgICAg ICBpbnQgdnBvc18wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8wXS52cG9zOworICAgICAgICAgICAgICAgIGludCB3ZF8wID0gb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS53ZDsKKyAgICAgICAgICAgICAgICBpbnQgaF8w ID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5oOworICAg ICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGVfMCA9IG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uY3Vyc29yX3R5cGU7CisgICAg ICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aF8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8wXS5jdXJzb3Jfd2lkdGg7CisgICAgICAgICAgICAgICAgLy8g IHN0cnVjdCBtY19SR0IgbHNsX2ZnXzAgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZmcucmVkLAorICAgICAgICAgICAgICAgIC8vICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMF0uZmcuZ3JlZW4sCisgICAgICAgICAgICAgICAgLy8gICAgICAg ICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXzBdLmZnLmJsdWV9OworICAgICAgICAgICAgICAgIHN0cnVjdCBtY19S R0IgbHNsX2JnXzAgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMF0uYmcucmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgLmdyZWVuID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8wXS5iZy5ncmVlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IC5ibHVlID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5i Zy5ibHVlfTsKKyAgICAgICAgICAgICAgICBib29sIGFjdGl2ZV9wXzAgPSBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmFjdGl2ZV9wOworICAgICAgICAgICAg ICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvcl8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaF9mbGF2b3I7CisgICAgICAgICAgICAgICAg Ym9vbCBlbmFibGVkX3BfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMF0uZW5hYmxlZF9wOworICAgICAgICAgICAgICAgIGlmICh2cG9zXzAgPT0gdm50aAor ICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3JfMCA9PSBNQ19HTFlQSAorICAgICAg ICAgICAgICAgICAgICAmJiBlbmFibGVkX3BfMAorICAgICAgICAgICAgICAgICAgICAmJiB2bnRo X3Jvdy0+ZW5hYmxlZF9wKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg ICBtY19lcmFzZV9jdXJzb3IgKHcsIHctPmN1cnJlbnRfbWF0cml4LCB2bnRoX3JvdywgeF8wLCB5 XzAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaHBvc18wLCB2cG9zXzAs IGdseXBoX2ZsYXZvcl8wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1 cnNvcl90eXBlXzAsIHdkXzApOworICAgICAgICAgICAgICAgICAgICBvbGRfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmVuYWJsZWRfcCA9IGZhbHNlOworICAgICAg ICAgICAgICAgICAgICAtLW9sZF9tYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5cGVdOworICAg ICAgICAgICAgICAgICAgICAvKiBJZiB3ZSBpbmFkdmVydGVudGx5IGVyYXNlZCBhbm90aGVyIGZh a2UgY3Vyc29yIGF0IHRoZSBzYW1lCisgICAgICAgICAgICAgICAgICAgIEhQT1MgdGhhdCBpcyBz dGlsbCBlbmFibGVkX3AgaW4gdGhlIGBvbGRfbWF0cml4YCwgdGhlbiByZWRyYXcgaXQuICovCisg ICAgICAgICAgICAgICAgICAgIGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBN Q19DQUNIRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7 CisgICAgICAgICAgICAgICAgICAgICAgICAgKytjYWNoZV90eXBlKQorICAgICAgICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IG50aF8xID0gMDsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgbWNfdHJhdmVyc2VfY2FjaGVfcCAob2xkX21hdHJp eCwgY2FjaGVfdHlwZSwgdm50aCwgbnRoXzEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICArK250aF8xKQorICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgaW50IHhfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMV0ueDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZnhfMSA9IG9s ZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZng7CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgaW50IHlfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMV0ueTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQg ZnlfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZnk7 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGhwb3NfMSA9IG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uaHBvczsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICBpbnQgdnBvc18xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8xXS52cG9zOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB3ZF8x ID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS53ZDsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5oOworICAgICAgICAgICAgICAgICAgICAgICAgICAg IGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGVfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uY3Vyc29yX3R5cGU7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8xXS5jdXJzb3Jfd2lkdGg7CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmdfMSA9IHsucmVkID0gb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5mZy5yZWQsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmZnLmdyZWVuLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmZnLmJsdWV9OworICAg ICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBzdHJ1Y3QgbWNfUkdCIGxzbF9iZ18xID0gey5y ZWQgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmJnLnJl ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAuZ3JlZW4gPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XzFdLmJnLmdyZWVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAg ICAgICAgICAgICAgICAgIC5ibHVlID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8xXS5iZy5ibHVlfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29s IGFjdGl2ZV9wXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XzFdLmFjdGl2ZV9wOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfZmxhdm9y IGdseXBoX2ZsYXZvcl8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF8xXS5nbHlwaF9mbGF2b3I7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBl bmFibGVkX3BfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhf MV0uZW5hYmxlZF9wOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgZ29fcF8xID0g KGhwb3NfMCA9PSBocG9zXzEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBlbmFibGVkX3BfMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFn b19wXzEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICBib29sIHJlbW92ZV9wXzEgPSBmYWxzZTsKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgdy0+Y3VycmVudF9tYXRy aXgsIHZudGhfcm93LCB4XzEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGZ4XzEsIHlfMSwgZnlfMSwgaHBvc18xLCB2cG9zXzEsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdkXzEsIGhfMSwgY3Vyc29y X3R5cGVfMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgY3Vyc29yX3dpZHRoXzEsIGxzbF9mZ18xLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVfcF8xLCBnbHlwaF9mbGF2b3JfMSwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3ZlX3BfMSk7 CisgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmICh2cG9zXzAgPT0g dm50aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wXzAKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHZudGhfcm93LT5lbmFibGVkX3ApCisgICAgICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBib29sIHJlbW92ZV9wXzAgPSB0cnVlOwor ICAgICAgICAgICAgICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCB3LT5jdXJyZW50 X21hdHJpeCwgdm50aF9yb3csIHhfMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgZnhfMCwgeV8wLCBmeV8wLCBocG9zXzAsIHZwb3NfMCwgd2RfMCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaF8wLCBjdXJzb3JfdHlwZV8w LCBjdXJzb3Jfd2lkdGhfMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgbHNsX2JnXzAsIGFjdGl2ZV9wXzAsIGdseXBoX2ZsYXZvcl8wLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVfcF8wKTsKKyAgICAgICAgICAg ICAgICAgICAgICBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBd LmVuYWJsZWRfcCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgIC0tb2xkX21hdHJpeC5j dXJzb3JzX3VzZWRbY2FjaGVfdHlwZV07CisgICAgICAgICAgICAgICAgICAgICAgLyogSWYgd2Ug aW5hZHZlcnRlbnRseSBlcmFzZWQgYW5vdGhlciBmYWtlIGN1cnNvciBhdCB0aGUgc2FtZQorICAg ICAgICAgICAgICAgICAgICAgIEhQT1MgdGhhdCBpcyBzdGlsbCBlbmFibGVkX3AgaW4gdGhlIGBv bGRfbWF0cml4YCwgdGhlbiByZWRyYXcgaXQuICovCisgICAgICAgICAgICAgICAgICAgICAgZm9y IChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOworICAgICAgICAgICAg ICAgICAgICAgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICAgICAgICAgICAg ICAgICAgICAgKytjYWNoZV90eXBlKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBudGhfMiA9IDA7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgbWNfdHJhdmVyc2VfY2FjaGVfcCAob2xkX21hdHJpeCwgY2FjaGVfdHlw ZSwgdm50aCwgbnRoXzIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsrbnRoXzIp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgaW50IHhfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhfMl0ueDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmeF8yID0gb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5meDsKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGludCB5XzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXzJdLnk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQg ZnlfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uZnk7 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaHBvc18yID0gb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5ocG9zOworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgaW50IHZwb3NfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMl0udnBvczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlu dCB3ZF8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS53 ZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBoXzIgPSBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmg7CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlXzIgPSBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmN1cnNvcl90eXBlOworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aF8yID0gb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5jdXJzb3Jfd2lkdGg7CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZ18yID0gey5yZWQgPSBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmZnLnJlZCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdy ZWVuID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5mZy5n cmVlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgLmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XzJdLmZnLmJsdWV9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIHN0cnVjdCBt Y19SR0IgbHNsX2JnXzIgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMl0uYmcucmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8g ICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5iZy5ncmVlbiwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0gb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5iZy5ibHVlfTsKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGJvb2wgYWN0aXZlX3BfMiA9IG9sZF9tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uYWN0aXZlX3A7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3JfMiA9IG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uZ2x5cGhfZmxhdm9yOworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBlbmFibGVkX3BfMiA9IG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uZW5hYmxlZF9wOworICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgYm9vbCBnb19wXzIgPSAoaHBvc18wID09IGhwb3NfMgorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZnhfMCA8PSBmeF8yCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBmeF8wICsgd2Rf MCA+IGZ4XzIgKyB3ZF8yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBlbmFibGVkX3BfMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAo IWdvX3BfMikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIHJlbW92ZV9wXzIgPSBmYWxzZTsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCB3LT5jdXJy ZW50X21hdHJpeCwgdm50aF9yb3csIHhfMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBmeF8yLCB5XzIsIGZ5XzIsIGhwb3NfMiwgdnBvc18yLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdkXzIs IGhfMiwgY3Vyc29yX3R5cGVfMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGhfMiwgbHNsX2ZnXzIsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0aXZlX3BfMiwgZ2x5cGhf Zmxhdm9yXzIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgcmVtb3ZlX3BfMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgIH0KKyAgICB9CisgIGlmICh1cGRhdGluZ19mcmFtZV9wKQorICAgIHVw ZGF0ZV9lbmQgKGYpOworfQorCit2b2lkCittY191cGRhdGVfd2luZG93X2RyeXJ1biAoc3RydWN0 IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wLCBzdHJ1Y3QgbWNfZXNzZW50aWFscyBlc3NlbnRpYWxz KQoreworICBpZiAoIUJVRkZFUlAgKHctPmNvbnRlbnRzKSkKKyAgICByZXR1cm47CisKKyAgaWYg KHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbTUNfQ0FDSEVdID09IDAKKyAgICAgICYmIHctPm1j X21hdHJpeC5jdXJzb3JzX3VzZWRbQ0hfQ0FDSEVdID09IDAKKyAgICAgICYmIHctPm1jX21hdHJp eC5jdXJzb3JzX3VzZWRbRkNfQ0FDSEVdID09IDAKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZG RVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVS ICh3LT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m93LT5tb2RlX2xp bmVfcCkKKyAgICAgICAgeworICAgICAgICAgIGhlYWRlcl9saW5lX3JvdyA9IHJvdzsKKyAgICAg ICAgICArK3JvdzsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgaGVhZGVyX2xp bmVfcm93ID0gTlVMTDsKKworICAgICAgLyogVXBkYXRlIHRoZSBtb2RlIGxpbmUsIGlmIG5lY2Vz c2FyeS4gKi8KKyAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKm1vZGVfbGluZV9yb3cgPSBNQVRSSVhf TU9ERV9MSU5FX1JPVyAoZGVzaXJlZF9tYXRyaXgpOworICAgICAgaWYgKG1vZGVfbGluZV9yb3ct Pm1vZGVfbGluZV9wICYmIG1vZGVfbGluZV9yb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgeworICAg ICAgICAgIG1vZGVfbGluZV9yb3ctPnkgPSB5YiArIFdJTkRPV19TQ1JPTExfQkFSX0FSRUFfSEVJ R0hUICh3KTsKKyAgICAgICAgICB1cGRhdGVfd2luZG93X2xpbmUgKHcsIE1BVFJJWF9ST1dfVlBP UyAobW9kZV9saW5lX3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgZGVzaXJlZF9tYXRyaXgpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCk7CisgICAgICAgIH0KKworICAgICAgLyogRmlu ZCBmaXJzdCBlbmFibGVkIHJvdy4gIE9wdGltaXphdGlvbnMgaW4gcmVkaXNwbGF5X2ludGVybmFs CisgICAgICAgICBtYXkgbGVhZCB0byBhbiB1cGRhdGUgd2l0aCBvbmx5IG9uZSByb3cgZW5hYmxl ZC4gIFRoZXJlIG1heQorICAgICAgICAgYmUgYWxzbyBjb21wbGV0ZWx5IGVtcHR5IG1hdHJpY2Vz LiAqLworICAgICAgd2hpbGUgKHJvdyA8IGVuZCAmJiAhcm93LT5lbmFibGVkX3ApCisgICAgICAg ICsrcm93OworCisgICAgICAvKiBUcnkgcmV1c2luZyBwYXJ0IG9mIHRoZSBkaXNwbGF5IGJ5IGNv cHlpbmcuICovCisgICAgICBpZiAocm93IDwgZW5kICYmICF3LT5kZXNpcmVkX21hdHJpeC0+bm9f c2Nyb2xsaW5nX3ApCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgcmMgPSBtY19zY3JvbGxpbmdf d2luZG93ICh3LCBoZWFkZXJfbGluZV9yb3cgIT0gTlVMTCk7CisgICAgICAgICAgaWYgKHJjIDwg MCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogQWxsIHJvd3Mgd2VyZSBmb3VuZCB0 byBiZSBlcXVhbC4gKi8KKyAgICAgICAgICAgICAgcGF1c2VkX3AgPSAwOworICAgICAgICAgICAg ICBnb3RvIHNldF9jdXJzb3I7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmIChy YyA+IDApCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBXZSd2ZSBzY3JvbGxl ZCB0aGUgZGlzcGxheS4gKi8KKyAgICAgICAgICAgICAgICBmb3JjZV9wID0gMTsKKyAgICAgICAg ICAgICAgICBjaGFuZ2VkX3AgPSAxOworICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAg IC8qIFByb2Nlc3MgdGhlIGN1cnNvciByb3cgYXQgdGhlIG91dHNldCBpZiBpdCBpcyB3aXRoaW4g YGRlc2lyZWRfbWF0cml4YC4KKyAgICAgIFdoZW4gcHJvY2Vzc2luZyBhbGwgb3RoZXIgcm93cywg d2Ugd2lsbCBxdWVyeSB0aGUgYHctPmN1cnJlbnRfbWF0cml4YCBmb3IgZGF0YQorICAgICAgcmVs YXRpbmcgdG8gdGhlIGN1cnNvciByb3cuICBgbWFrZV9jdXJyZW50YCAod2l0aGluIGB1cGRhdGVf d2luZG93X2xpbmUnKQorICAgICAgdXBkYXRlcyB0aGUgYHctPmN1cnJlbnRfbWF0cml4YCBmb3Ig dGhlIGFwcGxpY2FibGUgcm93LiAgSW4gZG9pbmcgc28sIGhvd2V2ZXIsCisgICAgICB0aGUgYXBw bGljYWJsZSByb3cgaW4gdGhlIGRlc2lyZWQgbWF0cml4IGlzIGFsdGVyZWQgc3VjaCB0aGF0IHdl IGNhbiBubyBsb25nZXIKKyAgICAgIHJlbHkgdXBvbiB0aGUgYWNjdXJhY3kgb2YgYFJPVy0+dXNl ZFtURVhUX0FSRUFdYC4gIFRoZXJlZm9yZSwgd2UgbXVzdCBub3cgcmVseQorICAgICAgZXhjbHVz aXZlbHkgdXBvbiBgdy0+Y3VycmVudF9tYXRyaXgnIGZvciBjdXJzb3Igcm93IGJhc2VkIGRlY2lz aW9ucy4gKi8KKyAgICAgIGZvciAoc3RydWN0IGdseXBoX3JvdyAqbWNfcm93ID0gcm93OworICAg ICAgICAgICBtY19yb3cgPCBlbmQgJiYgKGZvcmNlX3AgfHwgIWlucHV0X3BlbmRpbmcpOworICAg ICAgICAgICArK21jX3JvdykKKyAgICAgICAgeworICAgICAgICAgIGludCB2cG9zID0gTUFUUklY X1JPV19WUE9TIChtY19yb3csIHctPmRlc2lyZWRfbWF0cml4KTsKKyAgICAgICAgICBpZiAobWNf cm93LT5lbmFibGVkX3AKKyAgICAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcykK KyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCA9IHctPmRlc2lyZWRf bWF0cml4OworICAgICAgICAgICAgICBpZiAoIWZvcmNlX3AgJiYgKytuX3VwZGF0ZWQgJSBwcmVl bXB0X2NvdW50ID09IDApCisgICAgICAgICAgICAgICAgZGV0ZWN0X2lucHV0X3BlbmRpbmdfaWdu b3JlX3NxdWVlemFibGVzICgpOworICAgICAgICAgICAgICBjaGFuZ2VkX3AgfD0gbWNfdXBkYXRl X3dpbmRvd19saW5lICh3LCB2cG9zLCAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4 LCBlc3NlbnRpYWxzLCBkcmF3X3ApOworICAgICAgICAgICAgICBpZiAoTUFUUklYX1JPV19CT1RU T01fWSAocm93KSA+PSB5YikKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gdnBvcyArIDE7 IGkgPCB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAgICAgICAgICAgICAg ICBTRVRfTUFUUklYX1JPV19FTkFCTEVEX1AgKHctPmN1cnJlbnRfbWF0cml4LCBpLCBmYWxzZSk7 CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBj dXJzb3JfbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgICAgICAvKiBVcGRhdGUgdGhlIHJl c3Qgb2YgdGhlIGxpbmVzLiAqLworICAgICAgZm9yICg7IHJvdyA8IGVuZCAmJiAoZm9yY2VfcCB8 fCAhaW5wdXRfcGVuZGluZyk7ICsrcm93KQorICAgICAgICAvKiBzY3JvbGxpbmdfd2luZG93IHJl c2V0cyB0aGUgZW5hYmxlZF9wIGZsYWcgb2YgdGhlIHJvd3MgaXQgcmV1c2VzIGZyb20KKyAgICAg ICAgY3VycmVudF9tYXRyaXguICovCisgICAgICAgIGlmIChyb3ctPmVuYWJsZWRfcCkKKyAgICAg ICAgICB7CisgICAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCB3LT5k ZXNpcmVkX21hdHJpeCk7CisgICAgICAgICAgICAvKiBJZiB0aGUgYGN1cnNvcl9yb3dgIGlzIHdp dGhpbiB0aGUgYGRlc2lyZWRfbWF0cml4YCwgdGhlbiBpdCB3YXMKKyAgICAgICAgICAgIHByb2Nl c3NlZCBoZXJlaW5hYm92ZSBhbmQgc2hvdWxkIGJlIHNraXBwZWQgYXQgdGhpcyB0aW1lLiAqLwor ICAgICAgICAgICAgaWYgKHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICBjb250 aW51ZTsKKyAgICAgICAgICAgIGludCBpOworICAgICAgICAgICAgLyogV2UnbGwgaGF2ZSB0byBw bGF5IGEgbGl0dGxlIGJpdCB3aXRoIHdoZW4gdG8KKyAgICAgICAgICAgICAgIGRldGVjdF9pbnB1 dF9wZW5kaW5nLiAgSWYgaXQncyBkb25lIHRvbyBvZnRlbiwKKyAgICAgICAgICAgICAgIHNjcm9s bGluZyBsYXJnZSB3aW5kb3dzIHdpdGggcmVwZWF0ZWQgc2Nyb2xsLXVwCisgICAgICAgICAgICAg ICBjb21tYW5kcyB3aWxsIHRvbyBxdWlja2x5IHBhdXNlIHJlZGlzcGxheS4gKi8KKyAgICAgICAg ICAgIGlmICghZm9yY2VfcCAmJiArK25fdXBkYXRlZCAlIHByZWVtcHRfY291bnQgPT0gMCkKKyAg ICAgICAgICAgICAgZGV0ZWN0X2lucHV0X3BlbmRpbmdfaWdub3JlX3NxdWVlemFibGVzICgpOwor ICAgICAgICAgICAgY2hhbmdlZF9wIHw9IG1jX3VwZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywg Jm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIGRyYXdfcCk7Cisg ICAgICAgICAgICAvKiBNYXJrIGFsbCByb3dzIGJlbG93IHRoZSBsYXN0IHZpc2libGUgb25lIGlu IHRoZSBjdXJyZW50CisgICAgICAgICAgICAgICBtYXRyaXggYXMgaW52YWxpZC4gIFRoaXMgaXMg bmVjZXNzYXJ5IGJlY2F1c2Ugb2YKKyAgICAgICAgICAgICAgIHZhcmlhYmxlIGxpbmUgaGVpZ2h0 cy4gIENvbnNpZGVyIHRoZSBjYXNlIG9mIHRocmVlCisgICAgICAgICAgICAgICBzdWNjZXNzaXZl IHJlZGlzcGxheXMsIHdoZXJlIHRoZSBmaXJzdCBkaXNwbGF5cyA1CisgICAgICAgICAgICAgICBs aW5lcywgdGhlIHNlY29uZCAzIGxpbmVzLCBhbmQgdGhlIHRoaXJkIDUgbGluZXMgYWdhaW4uCisg ICAgICAgICAgICAgICBJZiB0aGUgc2Vjb25kIHJlZGlzcGxheSB3b3VsZG4ndCBtYXJrIHJvd3Mg aW4gdGhlCisgICAgICAgICAgICAgICBjdXJyZW50IG1hdHJpeCBpbnZhbGlkLCB0aGUgdGhpcmQg cmVkaXNwbGF5IG1pZ2h0IGJlCisgICAgICAgICAgICAgICB0ZW1wdGVkIHRvIG9wdGltaXplIHJl ZGlzcGxheSBiYXNlZCBvbiBsaW5lcyBkaXNwbGF5ZWQKKyAgICAgICAgICAgICAgIGluIHRoZSBm aXJzdCByZWRpc3BsYXkuICovCisgICAgICAgICAgICBpZiAoTUFUUklYX1JPV19CT1RUT01fWSAo cm93KSA+PSB5YikKKyAgICAgICAgICAgICAgZm9yIChpID0gdnBvcyArIDE7IGkgPCB3LT5jdXJy ZW50X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAgICAgICAgICAgICAgU0VUX01BVFJJWF9S T1dfRU5BQkxFRF9QICh3LT5jdXJyZW50X21hdHJpeCwgaSwgZmFsc2UpOworICAgICAgICAgIH0K KyAgICAgIC8qIFdhcyBkaXNwbGF5IHByZWVtcHRlZD8gKi8KKyAgICAgIHBhdXNlZF9wID0gcm93 IDwgZW5kOworICAgICAgc2V0X2N1cnNvcjoKKyAgICAgIC8qIElmIHdlIGp1bXBlZCBoZXJlIGZy b20gYHNldF9jdXJzb3JgLCB0aGVuIHNldCB0aGUgYGN1cnNvcl9tYXRyaXhgLiAqLworICAgICAg aWYgKGN1cnNvcl9tYXRyaXggPT0gTlVMTCkKKyAgICAgICAgY3Vyc29yX21hdHJpeCA9IHctPmN1 cnJlbnRfbWF0cml4OworICAgICAgLyogUmVzZXQgYHJvd2AgdG8gMCBzbyB0aGF0IGZha2UgY3Vy c29ycyBjYW4gYmUgZHJhd24gb24gcm93cyBwcmVjZWRpbmcgdGhlCisgICAgICBmaXJzdCBgcm93 LT5lbmFibGVkX3BgLiAgSnVzdCBwcmlvciB0byB0aGUgY2FsbCB0byBgc2Nyb2xsaW5nX3dpbmRv dycgYWJvdmUsCisgICAgICBgcm93YCB3YXMgYWR2YW5jZWQgdG8gdGhlIGZpcnN0IGByb3ctPmVu YWJsZWRfcGAuICovCisgICAgICBmb3IgKHN0cnVjdCBnbHlwaF9yb3cgKmRlc2lyZWRfcm93ID0g TUFUUklYX1JPVyAody0+ZGVzaXJlZF9tYXRyaXgsIDApOworICAgICAgICAgICBkZXNpcmVkX3Jv dyA8IGVuZAorICAgICAgICAgICAmJiAoZm9yY2VfcCB8fCAhaW5wdXRfcGVuZGluZykKKyAgICAg ICAgICAgLyogVzMyIEVtYWNzIGNyYXNoZXMgb24gc3RhcnR1cCB3aXRob3V0IGEgQlVGRkVSUCBj aGVjay4gKi8KKyAgICAgICAgICAgJiYgQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAg ICYmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAg ICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFp cnMpKQorICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgZmNfdmlzaWJsZSkpKTsKKyAgICAgICAgICAgKytkZXNpcmVkX3JvdykKKyAgICAgICAgewor ICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChkZXNpcmVkX3Jvdywgdy0+ZGVz aXJlZF9tYXRyaXgpOworICAgICAgICAgIGlmIChkZXNpcmVkX3Jvdy0+ZW5hYmxlZF9wKQorICAg ICAgICAgICAgY29udGludWU7CisgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqYm90dG9tX3Jv dyA9IE1BVFJJWF9CT1RUT01fVEVYVF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB3KTsKKyAgICAg ICAgICBpbnQgYm90dG9tX3Zwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKGJvdHRvbV9yb3csIHctPmN1 cnJlbnRfbWF0cml4KTsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpjdXJyZW50X3JvdyA9 IE1BVFJJWF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB2cG9zKTsKKyAgICAgICAgICBlbnVtIG1j X3Jvd19wb3NpdGlvbiByb3dfcG9zaXRpb24gPSBtY19yb3dfcG9zaXRpb24gKHcsIGN1cnJlbnRf cm93LCBjdXJyZW50X3JvdywgdnBvcyk7CisgICAgICAgICAgaWYgKGN1cnJlbnRfcm93LT5lbmFi bGVkX3ApCisgICAgICAgICAgICBtY19kcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgsIGN1 cnJlbnRfcm93LCBjdXJyZW50X3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgICAg ICAgICAgICAgICAgY3VycmVudF9yb3ctPngsIGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0s IHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgYm90dG9tX3Zwb3MsIGN1cnNvcl9tYXRy aXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBk cmF3X3AsIFNFVF9DVVJTT1JfT05FKTsKKyAgICAgICAgfQorCisgICAgICBtY19yZXN0b3JlX2ds eXBoX21hdHJpeCAoc2F2ZWRfZGVzaXJlZCwgdy0+ZGVzaXJlZF9tYXRyaXgpOworICAgICAgbWNf cmVzdG9yZV9nbHlwaF9tYXRyaXggKHNhdmVkX2N1cnJlbnQsIHctPmN1cnJlbnRfbWF0cml4KTsK KworICAgICAgbWNfdXBkYXRlX3dpbmRvd19lcmFzZSAodywgb2xkX21hdHJpeCk7CisKKyAgICAg IG1jX3hmcmVlX2NhY2hlX21hdHJpeCAodywgJm9sZF9tYXRyaXgpOworCisgICAgfQorICAvLyBj bG9ja190IGNsb2NrX2VuZCA9IGNsb2NrKCk7CisgIC8vIGRvdWJsZSBjcHVfdGltZV91c2VkID0g KChkb3VibGUpIChjbG9ja19lbmQgLSBjbG9ja19zdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7Cisg IC8vIGZwcmludGYgKHN0ZGVyciwgIm1jX3Njcm9sbGluZ193aW5kb3cgKCVzKTogIFRJTUUgKCVm KVxuIiwgbWNfd2luZG93ICh3KSwgY3B1X3RpbWVfdXNlZCk7Cit9CisKKy8qIGVuZCBNVUxUSVBM RS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBTdHJ1Y3R1cmUg dG8gcGFzcyBkaW1lbnNpb25zIGFyb3VuZC4gIFVzZWQgZm9yIGNoYXJhY3RlciBib3VuZGluZwog ICAgYm94ZXMsIGdseXBoIG1hdHJpeCBkaW1lbnNpb25zIGFuZCBhbGlrZS4gICovCiAKQEAgLTIy NDEsNiArNDA2NiwxNiBAQCBmcmVlX3dpbmRvd19tYXRyaWNlcyAoc3RydWN0IHdpbmRvdyAqdykK IAkgIGZyZWVfZ2x5cGhfbWF0cml4ICh3LT5jdXJyZW50X21hdHJpeCk7CiAJICBmcmVlX2dseXBo X21hdHJpeCAody0+ZGVzaXJlZF9tYXRyaXgpOwogCSAgdy0+Y3VycmVudF9tYXRyaXggPSB3LT5k ZXNpcmVkX21hdHJpeCA9IE5VTEw7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBN VUxUSVBMRS1DVVJTT1JTICovCisKKyAgbWNfeGZyZWVfY2FjaGVfbWF0cml4ICh3LCAmdy0+bWNf bWF0cml4KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCX0KIAogICAgICAgLyog TmV4dCB3aW5kb3cgb24gc2FtZSBsZXZlbC4gICovCkBAIC0zMzg3LDYgKzUyMjIsMjYgQEAgY2hl Y2tfY3VycmVudF9tYXRyaXhfZmxhZ3MgKHN0cnVjdCB3aW5kb3cgKncpCiBzdGF0aWMgYm9vbAog dXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wKQogeworCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlmICh0 cmFjZV9yZWRpc3BsYXlfcCkKKyAgICBmcHJpbnRmIChzdGRlcnIsICJ1cGRhdGVfd2luZG93ICgl cylcbiIsIG1jX3dpbmRvdyAodykpOworCisgIHN0cnVjdCBtY19lc3NlbnRpYWxzIGVzc2VudGlh bHM7CisgIG1jX3NldF9lc3NlbnRpYWxzICh3LCAmZXNzZW50aWFscyk7CisKKyAgbWNfdXBkYXRl X3dpbmRvd19kcnlydW4gKHcsIGZvcmNlX3AsIGVzc2VudGlhbHMpOworCisgIHN0cnVjdCBnbHlw aF9tYXRyaXggKmN1cnNvcl9tYXRyaXggPSBOVUxMOworCisgIGJvb2wgZHJhd19wID0gdHJ1ZTsK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBzdHJ1Y3QgZ2x5cG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bHVzaXZlbHkgdXBvbiBgdy0+Y3VycmVudF9tYXRyaXgnIGZvciBjdXJzb3Ig cm93IGJhc2VkIGRlY2lzaW9ucy4gKi8KKyAgZm9yIChzdHJ1Y3QgZ2x5cGhfcm93ICptY19yb3cg PSByb3c7CisgICAgICAgbWNfcm93IDwgZW5kICYmIChmb3JjZV9wIHx8ICFpbnB1dF9wZW5kaW5n KTsKKyAgICAgICArK21jX3JvdykKKyAgICB7CisgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1df VlBPUyAobWNfcm93LCBkZXNpcmVkX21hdHJpeCk7CisgICAgICBpZiAobWNfcm93LT5lbmFibGVk X3AKKyAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zKQorICAgICAgICB7CisgICAg ICAgICAgY3Vyc29yX21hdHJpeCA9IGRlc2lyZWRfbWF0cml4OworICAgICAgICAgIGlmICghZm9y Y2VfcCAmJiArK25fdXBkYXRlZCAlIHByZWVtcHRfY291bnQgPT0gMCkKKyAgICAgICAgICAgIGRl dGVjdF9pbnB1dF9wZW5kaW5nX2lnbm9yZV9zcXVlZXphYmxlcyAoKTsKKyAgICAgICAgICBjaGFu Z2VkX3AgfD0gKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICAgICAg JiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICEgTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpKQorICAgICAgICAgICAg ICAgICAgICAgICA/IG1jX3VwZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywgJm1vdXNlX2ZhY2Vf b3ZlcndyaXR0ZW5fcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIGRyYXdfcCkKKyAgICAgICAgICAgICAg ICAgICAgICAgOiB1cGRhdGVfd2luZG93X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3 cml0dGVuX3ApOworICAgICAgICAgIGlmIChNQVRSSVhfUk9XX0JPVFRPTV9ZIChyb3cpID49IHli KQorICAgICAgICAgICAgZm9yIChpbnQgaSA9IHZwb3MgKyAxOyBpIDwgdy0+Y3VycmVudF9tYXRy aXgtPm5yb3dzIC0gMTsgKytpKQorICAgICAgICAgICAgICBTRVRfTUFUUklYX1JPV19FTkFCTEVE X1AgKHctPmN1cnJlbnRfbWF0cml4LCBpLCBmYWxzZSk7CisgICAgICAgICAgYnJlYWs7CisgICAg ICAgIH0KKyAgICB9CisKKyAgY3Vyc29yX21hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICAvKiBVcGRhdGUgdGhlIHJlc3Qgb2Yg dGhlIGxpbmVzLiAgKi8KICAgICAgIGZvciAoOyByb3cgPCBlbmQgJiYgKGZvcmNlX3AgfHwgIWlu cHV0X3BlbmRpbmcpOyArK3JvdykKIAkvKiBzY3JvbGxpbmdfd2luZG93IHJlc2V0cyB0aGUgZW5h YmxlZF9wIGZsYWcgb2YgdGhlIHJvd3MgaXQKQEAgLTM0NjcsNiArNTM2MywxOSBAQCB1cGRhdGVf d2luZG93IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3ApCiAJaWYgKHJvdy0+ZW5hYmxl ZF9wKQogCSAgewogCSAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBkZXNpcmVk X21hdHJpeCk7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJT T1JTICovCisKKyAgICAgICAgICAvKiBJZiB0aGUgYGN1cnNvcl9yb3dgIGlzIHdpdGhpbiB0aGUg YGRlc2lyZWRfbWF0cml4YCwgdGhlbiBpdCB3YXMKKyAgICAgICAgICBwcm9jZXNzZWQgaGVyZWlu YWJvdmUgYW5kIHNob3VsZCBiZSBza2lwcGVkIGF0IHRoaXMgdGltZS4gKi8KKyAgICAgICAgICBp ZiAodnBvcyA9PSB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICBjb250aW51ZTsKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogCSAgICBpbnQgaTsKIAogCSAgICAvKiBXZSdsbCBoYXZl IHRvIHBsYXkgYSBsaXR0bGUgYml0IHdpdGggd2hlbiB0bwpAQCAtMzQ3NSw4ICs1Mzg0LDIxIEBA IHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkKIAkgICAgICAg Y29tbWFuZHMgd2lsbCB0b28gcXVpY2tseSBwYXVzZSByZWRpc3BsYXkuICAqLwogCSAgICBpZiAo IWZvcmNlX3AgJiYgKytuX3VwZGF0ZWQgJSBwcmVlbXB0X2NvdW50ID09IDApCiAJICAgICAgZGV0 ZWN0X2lucHV0X3BlbmRpbmdfaWdub3JlX3NxdWVlemFibGVzICgpOwotCSAgICBjaGFuZ2VkX3Ag fD0gdXBkYXRlX3dpbmRvd19saW5lICh3LCB2cG9zLAotCQkJCQkgICAgICZtb3VzZV9mYWNlX292 ZXJ3cml0dGVuX3ApOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUt Q1VSU09SUyAqLworCisgICAgICAgICAgY2hhbmdlZF9wIHw9IChCVUZGRVJQICh3LT5jb250ZW50 cykKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAhTklM UCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICB8fCAhIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg ZmNfdmlzaWJsZSkpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgPyBtY191cGRhdGVfd2luZG93 X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3cml0dGVuX3AsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBlc3NlbnRp YWxzLCBkcmF3X3ApCisgICAgICAgICAgICAgICAgICAgICAgIDogdXBkYXRlX3dpbmRvd19saW5l ICh3LCB2cG9zLCAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wKTsKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKIAogCSAgICAvKiBNYXJrIGFsbCByb3dzIGJlbG93IHRoZSBsYXN0IHZpc2li bGUgb25lIGluIHRoZSBjdXJyZW50CiAJICAgICAgIG1hdHJpeCBhcyBpbnZhbGlkLiAgVGhpcyBp cyBuZWNlc3NhcnkgYmVjYXVzZSBvZgpAQCAtMzQ5Nyw2ICs1NDE5LDQ0IEBAIHVwZGF0ZV93aW5k b3cgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkKIAogICAgIHNldF9jdXJzb3I6CiAK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAg LyogSWYgd2UganVtcGVkIGhlcmUgZnJvbSBgc2V0X2N1cnNvcmAsIHRoZW4gc2V0IHRoZSBgY3Vy c29yX21hdHJpeGAuICovCisgIGlmIChjdXJzb3JfbWF0cml4ID09IE5VTEwpCisgICAgY3Vyc29y X21hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworCisgIC8qIFJlc2V0IGByb3dgIHRvIDAgc28g dGhhdCBmYWtlIGN1cnNvcnMgY2FuIGJlIGRyYXduIG9uIHJvd3MgcHJlY2VkaW5nIHRoZQorICBm aXJzdCBgcm93LT5lbmFibGVkX3BgLiAgSnVzdCBwcmlvciB0byB0aGUgY2FsbCB0byBgc2Nyb2xs aW5nX3dpbmRvdycgYWJvdmUsCisgIGByb3dgIHdhcyBhZHZhbmNlZCB0byB0aGUgZmlyc3QgYHJv dy0+ZW5hYmxlZF9wYC4gKi8KKyAgZm9yIChzdHJ1Y3QgZ2x5cGhfcm93ICpkZXNpcmVkX3JvdyA9 IE1BVFJJWF9ST1cgKGRlc2lyZWRfbWF0cml4LCAwKTsKKyAgICAgICBkZXNpcmVkX3JvdyA8IGVu ZAorICAgICAgICYmIChmb3JjZV9wIHx8ICFpbnB1dF9wZW5kaW5nKQorICAgICAgIC8qIFczMiBF bWFjcyBjcmFzaGVzIG9uIHN0YXJ0dXAgd2l0aG91dCBhIEJVRkZFUlAgY2hlY2suICovCisgICAg ICAgJiYgQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgJiYgKCFOSUxQIChCVkFSIChYQlVG RkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgfHwgIU5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpKTsKKyAgICAgICArK2Rl c2lyZWRfcm93KQorICAgIHsKKyAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChkZXNp cmVkX3JvdywgZGVzaXJlZF9tYXRyaXgpOworICAgICAgaWYgKGRlc2lyZWRfcm93LT5lbmFibGVk X3ApCisgICAgICAgIGNvbnRpbnVlOworICAgICAgc3RydWN0IGdseXBoX3JvdyAqYm90dG9tX3Jv dyA9IE1BVFJJWF9CT1RUT01fVEVYVF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB3KTsKKyAgICAg IGludCBib3R0b21fdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAoYm90dG9tX3Jvdywgdy0+Y3VycmVu dF9tYXRyaXgpOworICAgICAgc3RydWN0IGdseXBoX3JvdyAqY3VycmVudF9yb3cgPSBNQVRSSVhf Uk9XICh3LT5jdXJyZW50X21hdHJpeCwgdnBvcyk7CisgICAgICBlbnVtIG1jX3Jvd19wb3NpdGlv biByb3dfcG9zaXRpb24gPSBtY19yb3dfcG9zaXRpb24gKHcsIGN1cnJlbnRfcm93LCBjdXJyZW50 X3JvdywgdnBvcyk7CisgICAgICBpZiAoY3VycmVudF9yb3ctPmVuYWJsZWRfcCkKKyAgICAgICAg bWNfZHJhd19yb3cgKHcsIHctPmN1cnJlbnRfbWF0cml4LCBjdXJyZW50X3JvdywgY3VycmVudF9y b3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAgICAgICAgICAgICAgY3VycmVudF9yb3ct PngsIGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0sIHZwb3MsCisgICAgICAgICAgICAgICAg ICAgICBib3R0b21fdnBvcywgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9u LAorICAgICAgICAgICAgICAgICAgICAgZHJhd19wLCBTRVRfQ1VSU09SX1RXTyk7CisgICAgfQor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICAvKiBVcGRhdGUgdGhlIGhlYWRl ciBsaW5lIGFmdGVyIHNjcm9sbGluZyBiZWNhdXNlIGEgbmV3IGhlYWRlcgogCSBsaW5lIHdvdWxk IG90aGVyd2lzZSBvdmVyd3JpdGUgbGluZXMgYXQgdGhlIHRvcCBvZiB0aGUgd2luZG93CiAJIHRo YXQgY2FuIGJlIHNjcm9sbGVkLiAgKi8KQEAgLTM1MTIsNyArNTQ3Miw0OSBAQCB1cGRhdGVfd2lu ZG93IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3ApCiAjaWZkZWYgSEFWRV9XSU5ET1df U1lTVEVNCiAJICBpZiAoY2hhbmdlZF9wICYmIHJpZi0+Zml4X292ZXJsYXBwaW5nX2FyZWEpCiAJ ICAgIHsKLQkgICAgICByZWRyYXdfb3ZlcmxhcHBlZF9yb3dzICh3LCB5Yik7CisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRyYXdf b3ZlcmxhcHBlZF9yb3dzJzogIFJlZHJhdyBsaW5lcyBmcm9tIHRoZSBjdXJyZW50IG1hdHJpeCBv ZiB3aW5kb3cgVwordGhhdCBhcmUgb3ZlcmxhcHBlZCBieSBvdGhlciByb3dzLiAgWUIgaXMgYm90 dG9tLW1vc3QgeS1wb3NpdGlvbiBpbiBXLiAgSWYgcm93cworb3ZlcmxhcHBpbmcgb3RoZXJzIGhh dmUgYmVlbiBjaGFuZ2VkLCB0aGUgcm93cyBiZWluZyBvdmVybGFwcGVkIGhhdmUgdG8gYmUKK3Jl ZHJhd24uICBUaGlzIHdvbid0IGRyYXcgbGluZXMgdGhhdCBoYXZlIGFscmVhZHkgYmVlbiBkcmF3 biBpbiB1cGRhdGVfd2luZG93CitsaW5lIGJlY2F1c2Ugb3ZlcmxhcHBlZF9wIGluIGRlc2lyZWQg cm93cyBpcyAwLCBzbyBhZnRlciByb3cgYXNzaWdubWVudAorb3ZlcmxhcHBlZF9wIGluIGN1cnJl bnQgcm93cyBpcyAwLiAqLworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFN RSAodykpOworICBmb3IgKGludCBpID0gMDsgaSA8IHctPmN1cnJlbnRfbWF0cml4LT5ucm93czsg KytpKQorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdyA9IHctPmN1cnJlbnRfbWF0 cml4LT5yb3dzICsgaTsKKyAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgICAgIGJyZWFr OworICAgICAgICBlbHNlIGlmIChyb3ctPm1vZGVfbGluZV9wKQorICAgICAgICAgIGNvbnRpbnVl OworICAgICAgaWYgKHJvdy0+b3ZlcmxhcHBlZF9wKQorICAgICAgICB7CisgICAgICAgICAgZm9y IChlbnVtIGdseXBoX3Jvd19hcmVhIGFyZWEgPSBMRUZUX01BUkdJTl9BUkVBOyBhcmVhIDwgTEFT VF9BUkVBOyArK2FyZWEpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIG91dHB1dF9jdXJz b3JfdG8gKHcsIGksIDAsIHJvdy0+eSwgYXJlYSA9PSBURVhUX0FSRUEgPyByb3ctPnggOiAwKTsK KyAgICAgICAgICAgICAgaWYgKCFtY19yZWRyYXdfcm93ICh3LCB3LT5jdXJyZW50X21hdHJpeCwg cm93LCBhcmVhLCByb3ctPngsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg cm93LT51c2VkW2FyZWFdLCB0cnVlLCBEUkFXX05PUk1BTF9URVhULAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIFVQREFURV9XSU5ET1dfX1JFRFJBV19PVkVSTEFQUEVEX1JPV1Mp CisgICAgICAgICAgICAgICAgICAmJiByb3ctPnVzZWRbYXJlYV0pCisgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgRlJBTUVfUklGIChmKS0+d3JpdGVfZ2x5cGhzICh3LCByb3cs IHJvdy0+Z2x5cGhzW2FyZWFdLCBhcmVhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICByb3ctPnVzZWRbYXJlYV0pOworICAgICAgICAgICAgICAgICAgRlJB TUVfUklGIChmKS0+Y2xlYXJfZW5kX29mX2xpbmUgKHcsIHJvdywgYXJlYSwgLTEpOworICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICByb3ctPm92ZXJsYXBwZWRfcCA9 IDA7CisgICAgICAgIH0KKyAgICAgIGlmIChNQVRSSVhfUk9XX0JPVFRPTV9ZIChyb3cpID49IHli KQorICAgICAgICBicmVhazsKKyAgICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK IAkgICAgICByZWRyYXdfb3ZlcmxhcHBpbmdfcm93cyAodywgeWIpOwogCSAgICB9CiAjZW5kaWYK QEAgLTM1MzEsMTAgKzU1MzMsMjEgQEAgdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywg Ym9vbCBmb3JjZV9wKQogICAgICAgc3RyY3B5ICh3LT5jdXJyZW50X21hdHJpeC0+bWV0aG9kLCB3 LT5kZXNpcmVkX21hdHJpeC0+bWV0aG9kKTsKICNlbmRpZgogCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lT VEVNCisgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICYmICFOSUxQIChCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICBtY191cGRhdGVfd2luZG93 X2ZyaW5nZXMgKHcsIDApOworICAgIGVsc2UKICAgICAgIHVwZGF0ZV93aW5kb3dfZnJpbmdlcyAo dywgMCk7CiAjZW5kaWYKIAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgLyog RW5kIHRoZSB1cGRhdGUgb2Ygd2luZG93IFcuICBEb24ndCBzZXQgdGhlIGN1cnNvciBpZiB3ZQog ICAgICAgICAgcGF1c2VkIHVwZGF0aW5nIHRoZSBkaXNwbGF5IGJlY2F1c2UgaW4gdGhpcyBjYXNl LAogICAgICAgICAgc2V0X3dpbmRvd19jdXJzb3JfYWZ0ZXJfdXBkYXRlIGhhc24ndCBiZWVuIGNh bGxlZCwgYW5kCmRpZmYgLS1naXQgYS9zcmMvZnJhbWUuaCBiL3NyYy9mcmFtZS5oCmluZGV4IGVj OGY2MTQuLmVlYWY3MWUgMTAwNjQ0Ci0tLSBhL3NyYy9mcmFtZS5oCisrKyBiL3NyYy9mcmFtZS5o CkBAIC0yMDUsNiArMjA1LDE2IEBAIHN0cnVjdCBmcmFtZQogICBMaXNwX09iamVjdCB0b29sX2Jh cl9pdGVtczsKICAgLyogdG9vbF9iYXJfaXRlbXMgc2hvdWxkIGJlIHRoZSBsYXN0IExpc3BfT2Jq ZWN0IG1lbWJlci4gICovCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKKyAgLyogTm9uLW5pbCB3aGVuIHRoZSBmcmFtZSBpcyBpbiB0aGUgcHJv Y2VzcyBvZiBiZWluZyB1cGRhdGVkLiAqLworICBzdHJ1Y3QgZnJhbWUgKm1jX3VwZGF0aW5nX2Zy YW1lOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIENhY2hlIG9mIHJlYWxp emVkIGZhY2VzLiAgKi8KICAgc3RydWN0IGZhY2VfY2FjaGUgKmZhY2VfY2FjaGU7CiAKZGlmZiAt LWdpdCBhL3NyYy9mcmluZ2UuYyBiL3NyYy9mcmluZ2UuYwppbmRleCAzMzVhNmViLi5kNzBjNTVm IDEwMDY0NAotLS0gYS9zcmMvZnJpbmdlLmMKKysrIGIvc3JjL2ZyaW5nZS5jCkBAIC00MzgsNiAr NDM4LDQ2MCBAQCBzdGF0aWMgdW5zaWduZWQgc2hvcnQgZW1wdHlfbGluZV9iaXRzW10gPSB7CiAj ZGVmaW5lIFNUQU5EQVJEX0JJVE1BUF9IRUlHSFQoYml0cykgKHNpemVvZiAoYml0cykvQllURVNf UEVSX0JJVE1BUF9ST1cpCiAjZGVmaW5lIEZSQklUUyhiaXRzKSAgYml0cywgU1RBTkRBUkRfQklU TUFQX0hFSUdIVCAoYml0cykKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2lu IE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyogYCstZnJpbmdlLWhlbHBlci1kZWNpbWFsJyBkZWZp bmVkIGluIGBjcm9zc2hhaXJzLmVsYCAqLworCisvKiBUT0RPOiAgQ29uc2lkZXIgYWRkaW5nIHRo ZSBmb2xsb3dpbmcgZnJpbmdlIGJpdG1hcHM6CisgIChkZWZpbmUtZnJpbmdlLWJpdG1hcCAnYnJl YWtwb2ludCAiXHgzY1x4N2VceGZmXHhmZlx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uLi4u Lnh4IgorICAgICAgIi4uLi4uLnh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcmV2 ZXJzZWRfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93X2JpdHNbXSA9eworICAweDMsIDB4MywgMHgz LCAweDYzLCAweDMzLCAweDFiLCAweGZmLCAweGZmLCAweDFiLCAweDMzLCAweDYzLCAweDMsIDB4 MywgMHgzfTsKKworLyogMjYKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAg ICAieHh4eHh4eHgiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAi eC4ueHguLngiCisgICAgICAieC4uLnh4LngiCisgICAgICAieC4uLi54eHgiCisgICAgICAieC54 eHh4eHgiCisgICAgICAieC54eHh4eHgiCisgICAgICAieC4uLi54eHgiCisgICAgICAieC4uLnh4 LngiCisgICAgICAieC4ueHguLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngi CisgICAgICAieHh4eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19ob2xsb3df cmVjdGFuZ2xlX3JpZ2h0X2Fycm93X2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweDk5 LCAweDhkLCAweDg3LCAweGJmLAorICAweGJmLCAweDg3LCAweDhkLCAweDk5LCAweDgxLCAweDgx LCAweGZmfTsKKworLyogMjcKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAg ICAieHh4eHh4eHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAi eC54eC4ueHgiCisgICAgICAieC4ueHgueHgiCisgICAgICAieC4uLnh4eHgiCisgICAgICAieHh4 eHh4eHgiCisgICAgICAieHh4eHh4eHgiCisgICAgICAieC4uLnh4eHgiCisgICAgICAieC4ueHgu eHgiCisgICAgICAieC54eC4ueHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgi CisgICAgICAieHh4eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19yZXZlcnNl ZF9ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93X2JpdHNbXSA9eworICAweGZmLCAweDgxLCAw eDgxLCAweGIxLCAweDk5LCAweDhkLCAweGZmLAorICAweGZmLCAweDhkLCAweDk5LCAweGIxLCAw eDgxLCAweDgxLCAweGZmfTsKKworLyogMjgKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNp bWFsCisgICAgICAieHh4eHh4eHgiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngi CisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisg ICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAg ICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAi eC4uLi4uLngiCisgICAgICAieHh4eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBt Y19ob2xsb3dfcmVjdGFuZ2xlX2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweDgxLCAw eDgxLCAweDgxLCAweDgxLAorICAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAw eGZmfTsKKworLyogMjkKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAi eC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4u Li4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4u Li4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4i CisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisg ICAgICAieC4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY192ZXJ0aWNhbF9i YXJfYml0c1tdID17CisgIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAs CisgIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODB9OworCisvKiAzMAor ICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi54eCIKKyAgICAg ICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIu Li4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4u Li54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54 eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIp CisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3JldmVyc2VkX3ZlcnRpY2FsX2Jhcl9iaXRz W10gPXsKKyAgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgz LCAweDMsIDB4MywgMHgzLCAweDN9OworCisvKiAzMQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4 YWRlY2ltYWwKKyAgICAgICJ4eC4uLi4uLiIKKyAgICAgICJ4eC4uLi4uLiIKKyAgICAgICIgeHgu Li4uLiIKKyAgICAgICIueHguLi4uLiIKKyAgICAgICIuLnh4Li4uLiIKKyAgICAgICIuLnh4Li4u LiIKKyAgICAgICIuLi54eC4uLiIKKyAgICAgICIuLi54eC4uLiIKKyAgICAgICIuLi4ueHguLiIK KyAgICAgICIuLi4ueHguLiIKKyAgICAgICIuLi4uLnh4LiIKKyAgICAgICIuLi4uLnh4LiIKKyAg ICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNo b3J0IG1jX2JhY2tzbGFzaF9iaXRzW10gPXsKKyAgMHhjMCwgMHhjMCwgMHhlMCwgMHg2MCwgMHgz MCwgMHgzMCwgMHgxOCwgMHgxOCwgMHhjLCAweGMsIDB4NiwgMHg2LCAweDMsIDB4M307CisKKy8q IDMyCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Li4uLi4uIgor ICAgICAgInh4Li4uLi4uIgorICAgICAgInh4eC4uLi4uIgorICAgICAgInh4eC4uLi4uIgorICAg ICAgIngueHguLi4uIgorICAgICAgIngueHguLi4uIgorICAgICAgInguLnh4Li4uIgorICAgICAg InguLnh4Li4uIgorICAgICAgInguLi54eC4uIgorICAgICAgInguLi54eC4uIgorICAgICAgIngu Li4ueHguIgorICAgICAgInguLi4ueHguIgorICAgICAgInguLi4uLnh4IgorICAgICAgInguLi4u Lnh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdmVydGljYWxfYmFyX2JhY2tzbGFz aF9iaXRzW10gPXsKKyAgMHhjMCwgMHhjMCwgMHhlMCwgMHhlMCwgMHhiMCwgMHhiMCwgMHg5OCwK KyAgMHg5OCwgMHg4YywgMHg4YywgMHg4NiwgMHg4NiwgMHg4MywgMHg4M307CisKKy8qIDMzCisg ICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi54eHh4eHguIgorICAgICAg Inh4eHgueC4uIgorICAgICAgInh4eHgueC4uIgorICAgICAgInh4eHgueC4uIgorICAgICAgIi54 eHgueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngu eC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4u IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcGlsY3Jvd19iaXRzW10gPXsKKyAgMHg3 ZSwgMHhmNCwgMHhmNCwgMHhmNCwgMHg3NCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNCwg MHgxNH07CisKKy8qIDM0CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAg Ii4ueHh4eC4uIgorICAgICAgIi54eHh4eHguIgorICAgICAgInguLnh4Li54IgorICAgICAgIngu Lnh4Li54IgorICAgICAgInh4eHh4eHh4IgorICAgICAgInh4Li4uLnh4IgorICAgICAgInh4eC4u eHh4IgorICAgICAgIi54eHh4eHguIgorICAgICAgIi4ueHh4eC4uIikKKyovCitzdGF0aWMgdW5z aWduZWQgc2hvcnQgbWNfc21pbGV5X2ZhY2VfYml0c1tdID17CisgIDB4M2MsIDB4N2UsIDB4OTks IDB4OTksIDB4ZmYsIDB4YzMsIDB4ZTcsIDB4N2UsIDB4M2N9OworCisvKiAzNQorICAgICgrLWZy aW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLnguLi4uLiIKKyAgICAgICIuLi54Li4u LiIKKyAgICAgICIuLi4ueC4uLiIKKyAgICAgICIuLi4uLnguLiIKKyAgICAgICIuLi4ueC4uLiIK KyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLnguLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVk IHNob3J0IG1jX3NpbmdsZV9hbmdsZV9yaWdodF9iaXRzW10gPXsKKyAgMHgyMCwgMHgxMCwgMHg4 LCAweDQsIDB4OCwgMHgxMCwgMHgyMH07CisKKy8qIDM2CisgICAgKCstZnJpbmdlLWhlbHBlci1o ZXhhZGVjaW1hbAorICAgICAgIi4uLi4ueC4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4u LnguLi4uIgorICAgICAgIi4ueC4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4uLi54 Li4uIgorICAgICAgIi4uLi4ueC4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc2lu Z2xlX2FuZ2xlX2xlZnRfYml0c1tdID17CisgIDB4NCwgMHg4LCAweDEwLCAweDIwLCAweDEwLCAw eDgsIDB4NH07CisKKy8qIDM3CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAg ICAgInh4Lnh4Li4uIgorICAgICAgIi54eC54eC4uIgorICAgICAgIi4ueHgueHguIgorICAgICAg Ii4uLnh4Lnh4IgorICAgICAgIi4ueHgueHguIgorICAgICAgIi54eC54eC4uIgorICAgICAgInh4 Lnh4Li4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xlX3JpZ2h0 X2JpdHNbXSA9eworICAweGQ4LCAweDZjLCAweDM2LCAweDFiLCAweDM2LCAweDZjLCAweGQ4fTsK KworLyogMzgKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4ueHgu eHgiCisgICAgICAiLi54eC54eC4iCisgICAgICAiLnh4Lnh4Li4iCisgICAgICAieHgueHguLi4i CisgICAgICAiLnh4Lnh4Li4iCisgICAgICAiLi54eC54eC4iCisgICAgICAiLi4ueHgueHgiKQor Ki8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfbGVmdF9iaXRzW10gPXsK KyAgMHgxYiwgMHgzNiwgMHg2YywgMHhkOCwgMHg2YywgMHgzNiwgMHgxYn07CisKKy8qIDM5Cisg ICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIngueC54Li4uIgorICAgICAg Ii54LngueC4uIgorICAgICAgIi4ueC54LnguIgorICAgICAgIi4uLngueC54IgorICAgICAgIi4u eC54LnguIgorICAgICAgIi54LngueC4uIgorICAgICAgIngueC54Li4uIikKKyovCitzdGF0aWMg dW5zaWduZWQgc2hvcnQgbWNfdHJpcGxlX2FuZ2xlX3JpZ2h0X2JpdHNbXSA9eworICAweGE4LCAw eDU0LCAweDJhLCAweDE1LCAweDJhLCAweDU0LCAweGE4fTsKKworLyogNDAKKyAgICAoKy1mcmlu Z2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4ueC54LngiCisgICAgICAiLi54LngueC4i CisgICAgICAiLngueC54Li4iCisgICAgICAieC54LnguLi4iCisgICAgICAiLngueC54Li4iCisg ICAgICAiLi54LngueC4iCisgICAgICAiLi4ueC54LngiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBz aG9ydCBtY190cmlwbGVfYW5nbGVfbGVmdF9iaXRzW10gPXsKKyAgMHgxNSwgMHgyYSwgMHg1NCwg MHhhOCwgMHg1NCwgMHgyYSwgMHgxNX07CisKKy8qIDQxCisgICAgKCstZnJpbmdlLWhlbHBlci1o ZXhhZGVjaW1hbAorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4u Li4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54 Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAgICAgIi4uLi4uLi4u IgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIikK KyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX3VwX2JpdHNbXSA9ewor ICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDgyLCAweDAwLCAw eDAwLCAweDAwLCAweDAwfTsKKworLyogNDIKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNp bWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4i CisgICAgICAiLi4uLi4uLi4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLnguLi54Li4iCisg ICAgICAiLi54LnguLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAg ICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0 YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zaW5nbGVfYW5nbGVfZG93bl9iaXRzW10gPXsKKyAgMHgw MCwgMHgwMCwgMHgwMCwgMHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHgxMCwgMHgwMCwgMHgwMCwg MHgwMCwgMHgwMH07CisKKy8qIDQzCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAor ICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAg ICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAg InguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgIngu Li4uLnguIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4u Li4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xlX3VwX2JpdHNb XSA9eworICAweDAwLCAweDAwLCAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAw eDQ0LCAweDgyLCAweDAwLCAweDAwLCAweDAwfTsKKworLyogNDQKKyAgICAoKy1mcmluZ2UtaGVs cGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAg ICAiLi4uLi4uLi4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAi Li54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54 LnguLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4u Li4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19kb3Vi bGVfYW5nbGVfZG93bl9iaXRzW10gPXsKKyAgMHgwMCwgMHgwMCwgMHgwMCwgMHg4MiwgMHg0NCwg MHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHgxMCwgMHgwMCwgMHgwMCwgMHgwMH07CisKKy8qIDQ1 CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4uLi4uIgorICAg ICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAg InguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgIngu LnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLi4u LnguIgorICAgICAgIi4uLi4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdHJp cGxlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAw eDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDgyLCAweDAwfTsKKworLyogNDYKKyAgICAo Ky1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAieC4u Li4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4u eC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4i CisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLi4ueC4uLi4iCisg ICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19xdWFkcnVwbGVf YW5nbGVfZG93bl9iaXRzW10gPXsKKyAgMHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0 NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHgxMCwgMHgwMH07CisKKy8qIDQ3CisgICAgKCst ZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54 Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4u IgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgor ICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAg ICAgIi54Li4ueC4uIgorICAgICAgInguLi4uLnguIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hv cnQgbWNfcXVhZHJ1cGxlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDEwLCAweDI4LCAweDQ0LCAw eDkyLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDgy fTsKKworLyogNDgKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC4u Li4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4u eC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4i CisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisg ICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLi4ueC4uLi4iKQorKi8K K3N0YXRpYyB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VmdCBwYXJ0aWFsLXJp Z2h0CisgIElmIGFueSB2YWx1ZSBpbiBsb2NhbCBiaW5kaW5nIGlzIG5vdCBwcmVzZW50IG9yIHQs IHVzZSBnbG9iYWwgdmFsdWUuCisgICAgIElmIHBhcnRpYWwsIGxvb2t1cCBwYXJ0aWFsIGJpdG1h cCBpbiBkZWZhdWx0IHZhbHVlIGlmIG5vdCBmb3VuZCBoZXJlLgorICAgICBJZiBub3QgcGFydGlh bCwgb3Igbm8gcGFydGlhbCBzcGVjIGlzIHByZXNlbnQsIHVzZSBub24tcGFydGlhbCBiaXRtYXAu ICovCitpbnQKK21jX2dldF9mcmluZ2VfYml0bWFwIChzdHJ1Y3Qgd2luZG93ICp3LCBMaXNwX09i amVjdCBiaXRtYXAsIGludCByaWdodF9wLCBpbnQgcGFydGlhbF9wKQoreworICBMaXNwX09iamVj dCBjbWFwLCBibTEgPSBRbmlsLCBibTIgPSBRbmlsLCBibTsKKyAgRU1BQ1NfSU5UIGxuMSA9IDAs IGxuMiA9IDA7CisgIGludCBpeDEgPSByaWdodF9wOworICBpbnQgaXgyID0gaXgxICsgKHBhcnRp YWxfcCA/IDIgOiAwKTsKKyAgaWYgKChjbWFwID0gQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMp LCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSksICFOSUxQIChjbWFwKSkKKyAgICB7CisgICAgICBi bTEgPSBtY19hc3NxIChiaXRtYXAsIGNtYXApOworICAgICAgaWYgKENPTlNQIChibTEpKQorICB7 CisgICAgaWYgKChibTEgPSBYQ0RSIChibTEpKSwgTklMUCAoYm0xKSkKKyAgICAgIHJldHVybiBN Q19OT19GUklOR0VfQklUTUFQOworICAgIGlmIChDT05TUCAoYm0xKSkKKyAgICAgIHsKKyAgICAg ICAgbG4xID0gWEZJWE5VTSAoRmxlbmd0aCAoYm0xKSk7CisgICAgICAgIGlmIChwYXJ0aWFsX3Ap CisgICAgICAgICAgeworICAgICAgICAgICAgaWYgKGxuMSA+IGl4MikKKyAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMSk7CisgICAgICAgICAgICAg ICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAg ICAgICAgICAgIH0KKyAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICBpZiAobG4xID4gaXgxKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMSk7CisgICAgICAgICAgICAgICAgICBpZiAo IUVRIChibSwgUXQpKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5kOworICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgIH0KKyAgICBlbHNlIGlmICgoYm0gPSBibTEs ICFFUSAoYm0sIFF0KSkpCisgICAgICBnb3RvIGZvdW5kOworICB9CisgICAgfQorICBpZiAoIUVR IChjbWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkK KyAgICAgICYmICFOSUxQIChCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9y X2FsaXN0KSkpCisgICAgeworICAgICAgYm0yID0gbWNfYXNzcSAoYml0bWFwLCBCVkFSICgmYnVm ZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSk7CisgICAgICBpZiAoQ09OU1Ag KGJtMikpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoKGJtMiA9IFhDRFIgKGJtMikpLCAhTklM UCAoYm0yKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKENPTlNQIChibTIpKQor ICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGxuMiA9IFhGSVhOVU0gKEZsZW5n dGggKGJtMikpOworICAgICAgICAgICAgICAgICAgaWYgKHBhcnRpYWxfcCkKKyAgICAgICAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGlmIChsbjIgPiBpeDIpCisgICAgICAg ICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGJtID0gbWNfbnRo IChpeDIsIGJtMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghRVEgKGJtLCBRdCkp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgaWYgKGxuMSA+IGl4MSkKKyAgICB7Cisg ICAgICBibSA9IG1jX250aCAoaXgxLCBibTEpOworICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAg ICAgICAgZ290byBmb3VuZDsKKyAgICB9CisgIGlmIChsbjIgPiBpeDEpCisgICAgeworICAgICAg Ym0gPSBtY19udGggKGl4MSwgYm0yKTsKKyAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAg IGdvdG8gZm91bmQ7CisgICAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICB9Cisg ICAgZWxzZSBpZiAoKGJtID0gYm0yLCBOSUxQIChibSkpKQorICAgICAgcmV0dXJuIE1DX05PX0ZS SU5HRV9CSVRNQVA7CisgIGZvdW5kOgorICByZXR1cm4gbG9va3VwX2ZyaW5nZV9iaXRtYXAgKGJt KTsKK30KKworc3RhdGljIGludAorbWNfZ2V0X2xvZ2ljYWxfY3Vyc29yX2JpdG1hcCAoc3RydWN0 IHdpbmRvdyAqdywgTGlzcF9PYmplY3QgY3Vyc29yKQoreworICBMaXNwX09iamVjdCBjbWFwLCBi bSA9IFFuaWw7CisgIGlmICgoY21hcCA9IEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZnJp bmdlX2N1cnNvcl9hbGlzdCkpLCAhTklMUCAoY21hcCkpCisgICAgeworICAgICAgYm0gPSBtY19h c3NxIChjdXJzb3IsIGNtYXApOworICAgICAgaWYgKENPTlNQIChibSkpCisgICAgICAgIHsKKyAg ICAgICAgICBpZiAoKGJtID0gWENEUiAoYm0pKSwgTklMUCAoYm0pKQorICAgICAgICAgICAgcmV0 dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgICAgcmV0dXJuIGxvb2t1cF9mcmluZ2Vf Yml0bWFwIChibSk7CisgICAgICAgIH0KKyAgICB9CisgIGlmIChFUSAoY21hcCwgQlZBUiAoJmJ1 ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2N1cnNvcl9hbGlzdCkpKQorICAgIHJldHVybiBNQ19OT19G UklOR0VfQklUTUFQOworICBibSA9IG1jX2Fzc3EgKGN1cnNvciwgQlZBUiAoJmJ1ZmZlcl9kZWZh dWx0cywgZnJpbmdlX2N1cnNvcl9hbGlzdCkpOworICBpZiAoIUNPTlNQIChibSkgfHwgKChibSA9 IFhDRFIgKGJtKSksIE5JTFAgKGJtKSkpCisgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7 CisgIHJldHVybiBsb29rdXBfZnJpbmdlX2JpdG1hcCAoYm0pOworfQorCitzdGF0aWMgaW50Citt Y19nZXRfbG9naWNhbF9mcmluZ2VfYml0bWFwIChzdHJ1Y3Qgd2luZG93ICp3LCBMaXNwX09iamVj dCBiaXRtYXAsIGludCByaWdodF9wLCBpbnQgcGFydGlhbF9wKQoreworICBMaXNwX09iamVjdCBj bWFwLCBibTEgPSBRbmlsLCBibTIgPSBRbmlsLCBibTsKKyAgRU1BQ1NfSU5UIGxuMSA9IDAsIGxu MiA9IDA7CisgIGludCBpeDEgPSByaWdodF9wOworICBpbnQgaXgyID0gaXgxICsgKHBhcnRpYWxf cCA/IDIgOiAw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lmIChwYXJ0aWFsX3Ap CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgaWYgKGxuMSA+IGl4MikKKyAg ICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGJtID0gbWNfbnRoIChp eDIsIGJtMSk7CisgICAgICAgICAgICAgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAg ICAgICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgICBpZiAobG4xID4gaXgxKQorICAgICAgICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMSk7Cisg ICAgICAgICAgICAgICAgICAgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgICAgICAgICAg ICAgICAgICAgICBnb3RvIGZvdW5kOworICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKChibSA9IGJt MSwgIUVRIChibSwgUXQpKSkKKyAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgfQor ICAgIH0KKyAgaWYgKCFFUSAoY21hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2lu ZGljYXRvcl9hbGlzdCkpCisgICAgICAmJiAhTklMUCAoQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywg ZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpKQorICAgIHsKKyAgICAgIGJtMiA9IG1jX2Fzc3EgKGJp dG1hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpOwor ICAgICAgaWYgKENPTlNQIChibTIpKQorICAgICAgICB7CisgICAgICAgICAgaWYgKChibTIgPSBY Q0RSIChibTIpKSwgIU5JTFAgKGJtMikpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlm IChDT05TUCAoYm0yKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBsbjIg PSBYRklYTlVNIChGbGVuZ3RoIChibTIpKTsKKyAgICAgICAgICAgICAgICAgIGlmIChwYXJ0aWFs X3ApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBpZiAobG4y ID4gaXgyKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAg ICAgICBibSA9IG1jX250aCAoaXgyLCBibTIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBp ZiAoIUVRIChibSwgUXQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7 CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIGlmIChsbjEg PiBpeDEpCisgICAgeworICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0xKTsKKyAgICAgIGlmICgh RVEgKGJtLCBRdCkpCisgICAgICAgIGdvdG8gZm91bmQ7CisgICAgfQorICBpZiAobG4yID4gaXgx KQorICAgIHsKKyAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMik7CisgICAgICBpZiAoIUVRIChi bSwgUXQpKQorICAgICAgICBnb3RvIGZvdW5kOworICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9C SVRNQVA7CisgICAgfQorICAgIGVsc2UgaWYgKChibSA9IGJtMiwgTklMUCAoYm0pKSkKKyAgICAg IHJldHVybiBNQ19OT19GUklOR0VfQklUTUFQOworICBmb3VuZDoKKyAgcmV0dXJuIGxvb2t1cF9m cmluZ2VfYml0bWFwIChibS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V0LCBzbyBpdCdzIE9LIHRo YXQgdG9wX3Jvd19lbmRzX2F0X3p2X3AKKyAgICAgaXMgbm90IGluaXRpYWxpemVkIGhlcmUuICBT aW1pbGFybHkgZm9yIGJvdF9pbmRfcm4sCisgICAgIHJvdy0+aW5kaWNhdGVfZW9iX3AgYW5kIGJv dF9yb3dfZW5kc19hdF96dl9wLiAgKi8KKyAgaW50IHRvcF9yb3dfZW5kc19hdF96dl9wIE1DX0lG X0xJTlQgKD0gMCksIGJvdF9yb3dfZW5kc19hdF96dl9wIE1DX0lGX0xJTlQgKD0gMCk7CisgIGlm ICh3LT5wc2V1ZG9fd2luZG93X3ApCisgICAgcmV0dXJuIDA7CisgIGlmICghTUlOSV9XSU5ET1df UCAodykKKyAgICAgICYmIChpbmQgPSBCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGluZGlj YXRlX2J1ZmZlcl9ib3VuZGFyaWVzKSwgIU5JTFAgKGluZCkpKQorICAgIHsKKyAgICAgIGlmIChF USAoaW5kLCBRbGVmdCkgfHwgRVEgKGluZCwgUXJpZ2h0KSkKKyAgICAgICAgYm91bmRhcnlfdG9w ID0gYm91bmRhcnlfYm90ID0gYXJyb3dfdG9wID0gYXJyb3dfYm90ID0gaW5kOworICAgICAgICBl bHNlIGlmIChDT05TUCAoaW5kKQorICAgICAgICAgICAgICAgICAmJiBDT05TUCAoWENBUiAoaW5k KSkpCisgICAgICAgIHsKKyAgICAgICAgICBMaXNwX09iamVjdCBwb3M7CisgICAgICAgICAgaWYg KHBvcyA9IG1jX2Fzc3EgKFF0LCBpbmQpLCAhTklMUCAocG9zKSkKKyAgICAgICAgICAgIGJvdW5k YXJ5X3RvcCA9IGJvdW5kYXJ5X2JvdCA9IGFycm93X3RvcCA9IGFycm93X2JvdCA9IFhDRFIgKHBv cyk7CisgICAgICAgICAgaWYgKHBvcyA9IG1jX2Fzc3EgKFF0b3AsIGluZCksICFOSUxQIChwb3Mp KQorICAgICAgICAgICAgYm91bmRhcnlfdG9wID0gWENEUiAocG9zKTsKKyAgICAgICAgICBpZiAo cG9zID0gbWNfYXNzcSAoUWJvdHRvbSwgaW5kKSwgIU5JTFAgKHBvcykpCisgICAgICAgICAgICBi b3VuZGFyeV9ib3QgPSBYQ0RSIChwb3MpOworICAgICAgICAgIGlmIChwb3MgPSBtY19hc3NxIChR dXAsIGluZCksICFOSUxQIChwb3MpKQorICAgICAgICAgICAgYXJyb3dfdG9wID0gWENEUiAocG9z KTsKKyAgICAgICAgICBpZiAocG9zID0gbWNfYXNzcSAoUWRvd24sIGluZCksICFOSUxQIChwb3Mp KQorICAgICAgICAgICAgYXJyb3dfYm90ID0gWENEUiAocG9zKTsKKyAgICAgICAgfQorICAgICAg ICBlbHNlCisgICAgICAgICAgLyogQW55dGhpbmcgZWxzZSBtZWFucyBib3VuZGFyeSBvbiBsZWZ0 IGFuZCBubyBhcnJvd3MuICAqLworICAgICAgICAgIGJvdW5kYXJ5X3RvcCA9IGJvdW5kYXJ5X2Jv dCA9IFFsZWZ0OworICAgIH0KKyAgdG9wX2luZF9ybiA9IGJvdF9pbmRfcm4gPSAtMTsKKyAgaWYg KCFOSUxQIChpbmQpKQorICAgIHsKKyAgICAgIGZvciAoeSA9IHctPnZzY3JvbGwsIHJuID0gMDsK KyAgICAgICAgICAgeSA8IHliICYmIHJuIDwgbnJvd3M7CisgICAgICAgICAgIHkgKz0gcm93LT5o ZWlnaHQsICsrcm4pCisgICAgICAgIHsKKyAgICAgICAgICByb3cgPSB3LT5kZXNpcmVkX21hdHJp eC0+cm93cyArIHJuOworICAgICAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgICAgICAg ICByb3cgPSB3LT5jdXJyZW50X21hdHJpeC0+cm93cyArIHJuOworICAgICAgICAgIHJvdy0+aW5k aWNhdGVfYm9iX3AgPSByb3ctPmluZGljYXRlX3RvcF9saW5lX3AgPSAwOworICAgICAgICAgIHJv dy0+aW5kaWNhdGVfZW9iX3AgPSByb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3AgPSAwOworICAg ICAgICAgIGlmICghcm93LT5tb2RlX2xpbmVfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgaWYgKHRvcF9pbmRfcm4gPCAwICYmIHJvdy0+dmlzaWJsZV9oZWlnaHQgPiAwKQorICAgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGlmIChNQVRSSVhfUk9XX1NUQVJUX0NIQVJQ T1MgKHJvdykgPD0gQlVGX0JFR1YgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSkKKyAgICAgICAgICAg ICAgICAgICAgICAmJiAhTUFUUklYX1JPV19QQVJUSUFMTFlfVklTSUJMRV9BVF9UT1BfUCAodywg cm93KSkKKyAgICAgICAgICAgICAgICAgICAgcm93LT5pbmRpY2F0ZV9ib2JfcCA9ICFOSUxQIChi b3VuZGFyeV90b3ApOworICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAg ICAgICAgcm93LT5pbmRpY2F0ZV90b3BfbGluZV9wID0gIU5JTFAgKGFycm93X3RvcCk7CisgICAg ICAgICAgICAgICAgICB0b3BfaW5kX3JuID0gcm47CisgICAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgICBpZiAoYm90X2luZF9ybiA8IDApCisgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgaWYgKE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgPj0gQlVGX1pWIChYQlVG RkVSICh3LT5jb250ZW50cykpCisgICAgICAgICAgICAgICAgICAgICAgJiYgIU1BVFJJWF9ST1df UEFSVElBTExZX1ZJU0lCTEVfQVRfQk9UVE9NX1AgKHcsIHJvdykpCisgICAgICAgICAgICAgICAg ICAgIHJvdy0+aW5kaWNhdGVfZW9iX3AgPSAhTklMUCAoYm91bmRhcnlfYm90KSwgYm90X2luZF9y biA9IHJuOworICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICh5ICsgcm93LT5oZWlnaHQg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X2NhY2hlW2NhY2hlKjQrMitwYXJ0aWFsX3BdID0JCQlcCisgICAgICBt Y19nZXRfbG9naWNhbF9mcmluZ2VfYml0bWFwICh3LCB3aGljaCwgMSwgcGFydGlhbF9wKSkpCisg IC8qIEV4dGVuZCB0b3AtYWxpZ25lZCB0b3AgaW5kaWNhdG9yIChvciBib3R0b20tYWxpZ25lZCBi b3R0b20KKyAgICAgaW5kaWNhdG9yKSB0byBhZGphY2VudCByb3dzIGlmIGl0IGRvZXNuJ3QgZml0 IGluIG9uZSByb3cuICAqLworICB0b3BfaW5kX21pbl95ID0gYm90X2luZF9tYXhfeSA9IC0xOwor ICBpZiAodG9wX2luZF9ybiA+PSAwKQorICAgIHsKKyAgICAgIGludCBibiA9IE1DX05PX0ZSSU5H RV9CSVRNQVA7CisgICAgICByb3cgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHRvcF9pbmRf cm47CisgICAgICBpZiAoIXJvdy0+ZW5hYmxlZF9wKQorICAgICAgICByb3cgPSB3LT5jdXJyZW50 X21hdHJpeC0+cm93cyArIHRvcF9pbmRfcm47CisgICAgICB0b3Bfcm93X2VuZHNfYXRfenZfcCA9 IHJvdy0+ZW5kc19hdF96dl9wOworICAgICAgaWYgKHJvdy0+aW5kaWNhdGVfYm9iX3ApCisgICAg ICAgIHsKKyAgICAgICAgICBpZiAoRVEgKGJvdW5kYXJ5X3RvcCwgUWxlZnQpKQorICAgICAgICAg ICAgYm4gPSAoKHJvdy0+aW5kaWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5kYXJ5X2JvdCwgUWxlZnQp KQorICAgICAgICAgICAgICAgICAgPyBNQ19MRUZUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20sIHJv dy0+ZW5kc19hdF96dl9wKQorICAgICAgICAgICAgICAgICAgOiBNQ19MRUZUX0ZSSU5HRSAoMiwg UXRvcCwgMCkpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBibiA9ICgocm93LT5p bmRpY2F0ZV9lb2JfcCAmJiBFUSAoYm91bmRhcnlfYm90LCBRcmlnaHQpKQorICAgICAgICAgICAg ICAgICAgICA/IE1DX1JJR0hUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20sIHJvdy0+ZW5kc19hdF96 dl9wKQorICAgICAgICAgICAgICAgICAgICA6IE1DX1JJR0hUX0ZSSU5HRSAoMiwgUXRvcCwgMCkp OworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcCkK KyAgICAgICAgICB7CisgICAgICAgICAgICBpZiAoRVEgKGFycm93X3RvcCwgUWxlZnQpKQorICAg ICAgICAgICAgICBibiA9IE1DX0xFRlRfRlJJTkdFICg2LCBRdXAsIDApOworICAgICAgICAgICAg ICBlbHNlCisgICAgICAgICAgICAgICAgYm4gPSBNQ19SSUdIVF9GUklOR0UgKDYsIFF1cCwgMCk7 CisgICAgICAgICAgfQorICAgICAgaWYgKGJuICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAg ICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZnJpbmdlX2JpdG1hcCAqZmIgPSBnZXRfZnJpbmdlX2Jp dG1hcF9kYXRhIChibik7CisgICAgICAgICAgaWYgKGZiLT5hbGlnbiA9PSBBTElHTl9CSVRNQVBf VE9QICYmIGZiLT5wZXJpb2QgPT0gMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgc3Ry dWN0IGdseXBoX3JvdyAqcm93MTsKKyAgICAgICAgICAgICAgaW50IHRvcF9pbmRfbWF4X3k7Cisg ICAgICAgICAgICAgIHRvcF9pbmRfbWluX3kgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3 KTsKKyAgICAgICAgICAgICAgdG9wX2luZF9tYXhfeSA9IHRvcF9pbmRfbWluX3kgKyBmYi0+aGVp Z2h0OworICAgICAgICAgICAgICBpZiAodG9wX2luZF9tYXhfeSA+IHliKQorICAgICAgICAgICAg ICAgIHRvcF9pbmRfbWF4X3kgPSB5YjsKKyAgICAgICAgICAgICAgZm9yICh5ID0gcm93LT55ICsg cm93LT5oZWlnaHQsIHJuID0gdG9wX2luZF9ybiArIDE7CisgICAgICAgICAgICAgICAgICAgeSA8 IHRvcF9pbmRfbWF4X3kgJiYgcm4gPCBucm93czsKKyAgICAgICAgICAgICAgICAgICB5ICs9IHJv dzEtPmhlaWdodCwgcm4rKykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBp ZiAoYm90X2luZF9ybiA+PSAwICYmIHJuID49IGJvdF9pbmRfcm4pCisgICAgICAgICAgICAgICAg ICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgcm93MSA9IHctPmRlc2lyZWRfbWF0cml4LT5y b3dzICsgcm47CisgICAgICAgICAgICAgICAgICBpZiAoIXJvdzEtPmVuYWJsZWRfcCkKKyAgICAg ICAgICAgICAgICAgICAgcm93MSA9IHctPmN1cnJlbnRfbWF0cml4LT5yb3dzICsgcm47CisgICAg ICAgICAgICAgICAgICByb3cxLT5pbmRpY2F0ZV9ib2JfcCA9IHJvdy0+aW5kaWNhdGVfYm9iX3A7 CisgICAgICAgICAgICAgICAgICByb3cxLT5pbmRpY2F0ZV90b3BfbGluZV9wID0gcm93LT5pbmRp Y2F0ZV90b3BfbGluZV9wOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAg ICAgfQorICAgIH0KKyAgaWYgKGJvdF9pbmRfcm4gPj0gMCkKKyAgICB7CisgICAgICBpbnQgYm4g PSBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgcm93ID0gdy0+ZGVzaXJlZF9tYXRyaXgtPnJv d3MgKyBib3RfaW5kX3JuOworICAgICAgaWYgKCFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgcm93 ID0gdy0+Y3VycmVudF9tYXRyaXgtPnJvd3MgKyBib3RfaW5kX3JuOworICAgICAgYm90X3Jvd19l bmRzX2F0X3p2X3AgPSByb3ctPmVuZHNfYXRfenZfcDsKKyAgICAgIGlmIChyb3ctPmluZGljYXRl X2VvYl9wKQorICAgICAgICB7CisgICAgICAgICAgaWYgKEVRIChib3VuZGFyeV9ib3QsIFFsZWZ0 KSkKKyAgICAgICAgICAgIGJuID0gTUNfTEVGVF9GUklOR0UgKDMsIFFib3R0b20sIHJvdy0+ZW5k c19hdF96dl9wKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgYm4gPSBNQ19SSUdI VF9GUklOR0UgKDMsIFFib3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKTsKKyAgICAgICAgfQorICAg ICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3ApCisgICAgICAgICAgewor ICAgICAgICAgICAgaWYgKEVRIChhcnJvd19ib3QsIFFsZWZ0KSkKKyAgICAgICAgICAgICAgYm4g PSBNQ19MRUZUX0ZSSU5HRSAoNywgUWRvd24sIDApOworICAgICAgICAgICAgICBlbHNlCisgICAg ICAgICAgICAgICAgYm4gPSBNQ19SSUdIVF9GUklOR0UgKDcsIFFkb3duLCAwKTsKKyAgICAgICAg ICB9CisgICAgICBpZiAoYm4gIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgeworICAg ICAgICAgIHN0cnVjdCBmcmluZ2VfYml0bWFwICpmYiA9IGdldF9mcmluZ2VfYml0bWFwX2RhdGEg KGJuKTsKKyAgICAgICAgICBpZiAoZmItPmFsaWduID09IEFMSUdOX0JJVE1BUF9CT1RUT00gJiYg ZmItPnBlcmlvZCA9PSAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5 cGhfcm93ICpyb3cxOworICAgICAgICAgICAgICBpbnQgYm90X2luZF9taW5feTsKKyAgICAgICAg ICAgICAgYm90X2luZF9tYXhfeSA9IHJvdy0+eSArIHJvdy0+dmlzaWJsZV9oZWlnaHQ7CisgICAg ICAgICAgICAgIGJvdF9pbmRfbWluX3kgPSBib3RfaW5kX21heF95IC0gZmItPmhlaWdodDsKKyAg ICAgICAgICAgICAgaWYgKGJvdF9pbmRfbWluX3kgPCBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hU ICh3KSkKKyAgICAgICAgICAgICAgICBib3RfaW5kX21pbl95ID0gV0lORE9XX0hFQURFUl9MSU5F X0hFSUdIVCAodyk7CisgICAgICAgICAgICAgIGZvciAoeSA9IHJvdy0+eSwgcm4gPSBib3RfaW5k X3JuIC0gMTsKKyAgICAgICAgICAgICAgICAgICB5ID49IGJvdF9pbmRfbWluX3kgJiYgcm4gPj0g MDsKKyAgICAgICAgICAgICAgICAgICB5IC09IHJvdzEtPmhlaWdodCwgcm4tLSkKKyAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICBpZiAodG9wX2luZF9ybiA+PSAwICYmIHJuIDw9 IHRvcF9pbmRfcm4pCisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAg ICAgcm93MSA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgICAgICAg ICBpZiAoIXJvdzEtPmVuYWJsZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgcm93MSA9IHctPmN1 cnJlbnRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgICAgICAgICByb3cxLT5pbmRpY2F0 ZV9lb2JfcCA9IHJvdy0+aW5kaWNhdGVfZW9iX3A7CisgICAgICAgICAgICAgICAgICByb3cxLT5p bmRpY2F0ZV9ib3R0b21fbGluZV9wID0gcm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wOworICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgTGlzcF9P YmplY3QgYnVmID0gdy0+Y29udGVudHM7CisgIENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgYm9vbCBh dXRvX2hzY3JvbGxfbW9kZV9wID0gRVEgKEZidWZmZXJfbG9jYWxfdmFsdWUgKFFhdXRvX2hzY3Jv bGxfbW9kZSwgYnVmKSwgUWN1cnJlbnRfbGluZSk7CisgIC8qIEVYQU1QTEU6ICAoc2Nyb2xsLWxl ZnQgNSkgKi8KKyAgYm9vbCBoc2NsX2FsbF90ZW1wX3AgPSAody0+c3VzcGVuZF9hdXRvX2hzY3Jv bGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMtdSBD LXggPCBhbmQgZG8gbm90aGluZy4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzBfcCA9ICh3LT5z dXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9f aHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xs ID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhzY3Jv bGwpOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBzb21ldGhpbmcgZWxzZSBiZXNp ZGVzIGhvcml6b250YWxseSBzY3JvbGxpbmcgdGhlCisgICAgICAgICAgICAgICBjdXJyZW50IGxp bmUgZGlmZmVyZW50bHkuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgaXMgX25vdF8gaG9y aXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfYWxsX3Blcm1f MV9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9o c2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xs ID09IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCAuLi4KKyAgICAg ICAgICAgICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlm ZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8yX3AgPSAoIXctPnN1c3BlbmRfYXV0 b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21v ZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPT0gMAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhzY3JvbGwpOworICAv KiBFWEFNUExFOiAgKHNjcm9sbC1sZWZ0IDUpOyBhbmQsIHRoZW4gcHJlc3MgdGhlIGxlZnQgYXJy b3cga2V5IG9uZSB0aW1lLgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIF9pc18gaG9yaXpv bnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiovCisgIGJvb2wgaHNjbF90ZW1wX3AgPSAoIXct PnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Ny b2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAg ICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gMCk7CisgIC8qIEVYQU1QTEU6 ICBDLXUgQy14IDwgYW5kIGRvIHNvbWV0aGluZyB0aGF0IGNhdXNlcyB0aGUgY3VycmVudCBsaW5l IHRvIGJlCisgICAgICAgICAgICAgICBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHku CisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkgc2Nyb2xsZWQg ZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9wZXJtX3AgPSAoIXctPnN1c3BlbmRfYXV0b19o c2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAg ICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAg ICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWlu X2hzY3JvbGwgIT0gdy0+aHNjcm9sbCk7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ ZnJhbWUpOworICBmb3IgKHkgPSB3LT52c2Nyb2xsLCBybiA9IDA7CisgICAgICAgeSA8IHliICYm IHJuIDwgbnJvd3M7CisgICAgICAgeSArPSByb3ctPmhlaWdodCwgcm4rKykKKyAgICB7CisgIGlu dCBsZWZ0LCByaWdodDsKKyAgdW5zaWduZWQgbGVmdF9mYWNlX2lkLCByaWdodF9mYWNlX2lkOwor ICBpbnQgbGVmdF9vZmZzZXQsIHJpZ2h0X29mZnNldDsKKyAgYm9vbCBwZXJpb2RpY19wOworICBy b3cgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHJuOworICBjdXIgPSB3LT5jdXJyZW50X21h dHJpeC0+cm93cyArIHJuOworICBpbnQgdm50aF9kbSA9IE1BVFJJWF9ST1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AhaHNjbF9hbGxfcGVybV8xX3AKKyAgICAgICAgICAmJiAh aHNjbF9hbGxfcGVybV8yX3AKKyAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgIHsKKyAg ICAgICAgICBpbnQgZnJpbmdlX2JpdG1hcCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAg ICAgZW51bSBmYWNlX2lkIG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICAgICAoIWFj dGl2ZV9wCisgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgY2hfaW5hY3RpdmVfd2luZG93cykpKQorICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFj ZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWluYWN0aXZlLXByZS16di1mYWNlIiks IHRydWUpCisgICAgICAgICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAgICAgICAgPyBsb29rdXBf bmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LXByZS16di1mYWNlIiks IHRydWUpCisgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICBtY19sZWZ0 X2ZyaW5nZV9mYWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gb3ZlcmxheV9hcnJvd19mYWNl X2lkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9J RDsKKyAgICAgICAgICBpZiAody0+aHNjcm9sbCAhPSAwKQorICAgICAgICAgICAgZnJpbmdlX2Jp dG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ci KSwgZmFsc2UsIHRydWUpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBmcmluZ2Vf Yml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistb3ZlcmxheS1hcnJv dyIpLCB0cnVlLCB0cnVlKTsKKyAgICAgICAgICBtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vy c29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IGZyaW5nZV9iaXRtYXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOiBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICB9CisgICAgICAgIGVsc2Ug aWYgKCh2cG9zID09IHZudGhfZG0gfHwgdnBvcyA9PSB2bnRoX2NtKQorICAgICAgICAgICAgICAg ICAmJiBnbHlwaF9mbGF2b3IgPT0gTUNfT1ZFUkxBWV9BUlJPV19CSVRNQVAKKyAgICAgICAgICAg ICAgICAgJiYgKGhzY2xfYWxsX3RlbXBfcAorICAgICAgICAgICAgICAgICAgICAgfHwgaHNjbF9h bGxfcGVybV8wX3AKKyAgICAgICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxsX3Blcm1fMV9wCisg ICAgICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzJfcAorICAgICAgICAgICAgICAg ICAgICAgfHwgaHNjbF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgICAgIHx8IGhzY2xfcGVybV9w KQorICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgeworICAgICAgICAg ICAgaW50IGZyaW5nZV9iaXRtYXAgPSBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgICAg ZW51bSBmYWNlX2lkIG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICAgICAgICghYWN0 aXZlX3AKKyAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRf ZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtaW5hY3RpdmUtcHJlLXp2 LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgOiAoYWN0aXZlX3ApCisgICAgICAgICAgICAg ICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWhz Y2wtcHJlLXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7 CisgICAgICAgICAgICBtY19sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1D X0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBvdmVybGF5X2Fycm93X2ZhY2VfaWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgICBpZiAoaHNjbF9hbGxfcGVy bV8wX3ApCisgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1h cCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAgICAg ICAgZWxzZSBpZiAoaHNjbF9hbGxfcGVybV8xX3ApCisgICAgICAgICAgICAgICAgZnJpbmdlX2Jp dG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCB0 cnVlLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF9hbGxfcGVybV8yX3Ap CisgICAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAg KHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIGZhbHNlLCB0cnVlKTsKKyAgICAgICAgICAgICAg ICAgIGVsc2UgaWYgKGhzY2xfcGVybV9wKQorICAgICAgICAgICAgICAgICAgICBmcmluZ2VfYml0 bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIHRy dWUsIHRydWUpOworICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX2FsbF90ZW1wX3Ap CisgICAgICAgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0 bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtdGVtcCIpLCBmYWxzZSwgZmFsc2UpOworICAgICAgICAg ICAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xfdGVtcF9wKQorICAgICAgICAgICAgICAgICAgICAg ICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhz Y2wtdGVtcCIpLCB0cnVlLCBmYWxzZSk7CisgICAgICAgICAgICBtY19sZWZ0X2ZyaW5nZV9iaXRt YXAgPSAoY3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICB9 CisgICAgICAgICAgZWxzZSBpZiAoKHZwb3MgPT0gdm50aF9kbSB8fCB2cG9zID09IHZudGhfY20p CisgICAgICAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RB TkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9y ID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAg ICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFCisgICAg ICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJ R0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNf UkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAg ICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAg ICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSCisgICAgICAg ICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tT TEFTSCkKKyAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICBMaXNwX09iamVjdCBiaXRtYXBfZmxhdm9yID0gKGdseXBoX2ZsYXZvciA9 PSBNQ19IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBRbWNfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9y ID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX2hvbGxvd19y ZWN0YW5nbGVfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xl CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2 b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3cKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9 PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX3ZlcnRpY2FsX2Jhcl9y aWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAo Z2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURf VkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IFFtY19yZXZlcnNlZF92ZXJ0aWNhbF9iYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NM QVNIKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192 ZXJ0aWNhbF9iYXJfYmFja3NsYXNoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IFFuaWw7CisgICAgICAgICAgICAgIG1jX3JpZ2h0X2ZyaW5nZV9iaXRtYXAgPSAo Y3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9mcmluZ2VfYml0bWFwIChiaXRtYXBfZmxh dm9yKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJ TkdFX0JJVE1BUDsKKyAgICAgICAgICAgICAgbWNfcmlnaHRfZnJpbmdlX2ZhY2VfaWQgPQorICAg ICAgICAgICAgICAgIChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisgICAg ICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYKKyAgICAgICAgICAgICAgICAg JiYgKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FS Uk9XCisgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURf VkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9m bGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKSkKKyAgICAgICAgICAgICAgICAgID8g bG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmV2ZXJzZWQtYmFyLXByZS16di1m YWNlIiksIHRydWUpCisgICAgICAgICAgICAgICAgOiAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRf RlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBBVF9a VgorICAgICAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9M TE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlw aF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAg ICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9C QVIpKQorICAgICAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJu ICgiKy1yZXZlcnNlZC1iYXItYXQtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICAgIDog KGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAg ICAmJiByb3dfcG9zaXRpb24gPT0gUE9TVF9aVgorICAgICAgICAgICAgICAgICAgICYmIChnbHlw aF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAg ICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElD QUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZv ciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpKQorICAgICAgICAgICAgICAgICAgPyBsb29r dXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZXZlcnNlZC1iYXItcG9zdC16di1mYWNl IiksIHRydWUpCisgICAgICAgICAgICAgICAgOiAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJ TkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYK KyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfSE9MTE9X X1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZv ciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAg ICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAg ICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1iYXItcHJl LXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBNQ19S SUdIVF9GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09 IEFUX1pWCisgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VE X0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAmJiBnbHlw aF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAg ICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikK KyAgICAgICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIist YmFyLWF0LXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9 PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0 aW9uID09IFBPU1RfWlYKKyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNf UkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAg ICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cK KyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElD QUxfQkFSKQorICAgICAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50 ZXJuICgiKy1iYXItcG9zdC16di1mYWNlIiksIHRydWUpCisgICAgICAgICAgICAgICAgOiBERUZB VUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGlmICghcm93LT5l bmFibGVkX3ApCisgICAgICAgIHJvdyA9IGN1cjsKKyAgICAgIGxlZnRfZmFjZV9pZCA9IHJpZ2h0 X2ZhY2VfaWQgPSBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICBsZWZ0X29mZnNldCA9IHJpZ2h0X29m ZnNldCA9IDA7CisgICAgICBwZXJpb2RpY19wID0gMDsKKyAgICAgIC8qIERlY2lkZSB3aGljaCBi aXRtYXAgdG8gZHJhdyBpbiB0aGUgbGVmdCBmcmluZ2UuICAqLworICAgICAgaWYgKFdJTkRPV19M RUZUX0ZSSU5HRV9XSURUSCAodykgPT0gMCkKKyAgICAgICAgbGVmdCA9IE1DX05PX0ZSSU5HRV9C SVRNQVA7CisgICAgICBlbHNlIGlmIChyb3ctPmxlZnRfdXNlcl9mcmluZ2VfYml0bWFwICE9IE1D X05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgIHsKKyAgICAgICAgICBsZWZ0ID0gcm93LT5sZWZ0 X3VzZXJfZnJpbmdlX2JpdG1hcDsKKyAgICAgICAgICBsZWZ0X2ZhY2VfaWQgPSByb3ctPmxlZnRf dXNlcl9mcmluZ2VfZmFjZV9pZDsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAoKCFyb3ctPnJl dmVyc2VkX3AgJiYgcm93LT50cnVuY2F0ZWRfb25fbGVmdF9wKQorICAgICAgICAgICAgICAgfHwg KHJvdy0+cmV2ZXJzZWRfcCAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKSkKKyAgICAgICAg bGVmdCA9IE1DX0xFRlRfRlJJTkdFICgwLCBRdHJ1bmNhdGlvbiwgMCk7CisgICAgICBlbHNlIGlm IChyb3ctPmluZGljYXRlX2JvYl9wICYmIEVRIChib3VuZGFyeV90b3AsIFFsZWZ0KSkKKyAgICAg ICAgeworICAgICAgICAgIGxlZnQgPSAoKHJvdy0+aW5kaWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5k YXJ5X2JvdCwgUWxlZnQpKQorICAgICAgICAgICAgICAgICA/IE1DX0xFRlRfRlJJTkdFICgxLCBR dG9wX2JvdHRvbSwgdG9wX3Jvd19lbmRzX2F0X3p2X3ApCisgICAgICAgICAgICAgICAgIDogTUNf TEVGVF9GUklOR0UgKDIsIFF0b3AsIDApKTsKKyAgICAgICAgICBpZiAodG9wX2luZF9taW5feSA+ PSAwKQorICAgICAgICAgICAgbGVmdF9vZmZzZXQgPSB0b3BfaW5kX21pbl95IC0gcm93LT55Owor ICAgICAgICB9CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2VvYl9wICYmIEVRIChib3Vu ZGFyeV9ib3QsIFFsZWZ0KSkKKyAgICAgICAgeworICAgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZS SU5HRSAoMywgUWJvdHRvbSwgYm90X3Jvd19lbmRzX2F0X3p2X3ApOworICAgICAgICAgIGlmIChi b3RfaW5kX21heF95ID49IDApCisgICAgICAgICAgICBsZWZ0X29mZnNldCA9IGJvdF9pbmRfbWF4 X3kgLSAocm93LT55ICsgcm93LT52aXNpYmxlX2hlaWdodCk7CisgICAgICAgIH0KKyAgICAgIGVs c2UgaWYgKCghcm93LT5yZXZlcnNlZF9wICYmIE1BVFJJWF9ST1dfQ09OVElOVUFUSU9OX0xJTkVf UCAocm93KSkKKyAgICAgICAgICAgICAgIHx8IChyb3ctPnJldmVyc2VkX3AgJiYgcm93LT5jb250 aW51ZWRfcCkpCisgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAoNCwgUWNvbnRpbnVhdGlv biwgMCk7CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2VtcHR5X2xpbmVfcCAmJiBFUSAo ZW1wdHlfcG9zLCBRbGVmdCkpCisgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAoNSwgUWVt cHR5X2xpbmUsIDApOworICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV90b3BfbGluZV9wICYm IEVRIChhcnJvd190b3AsIFFsZWZ0KSkKKyAgICAgICAgeworICAgICAgICAgIGxlZnQgPSBNQ19M RUZUX0ZSSU5HRSAoNiwgUXVwLCAwKTsKKyAgICAgICAgICBpZiAodG9wX2luZF9taW5feSA+PSAw KQorICAgICAgICAgICAgbGVmdF9vZmZzZXQgPSB0b3BfaW5kX21pbl95IC0gcm93LT55OworICAg ICAgICB9CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3AgJiYgRVEg KGFycm93X2JvdCwgUWxlZnQpKQorICAgICAgICB7CisgICAgICAgICAgbGVmdCA9IE1DX0xFRlRf RlJJTkdFICg3LCBRZG93biwgMCk7CisgICAgICAgICAgaWYgKGJvdF9pbmRfbWF4X3kgPj0gMCkK KyAgICAgICAgICAgIGxlZnRfb2Zmc2V0ID0gYm90X2luZF9tYXhfeSAtIChyb3ctPnkgKyByb3ct PnZpc2libGVfaGVpZ2h0KTsKKyAgICAgICAgfQorICAgICAgZWxzZQor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xzZQorICAgICAgICAgICAgICAgICAgY3VyLT5sZWZ0X2ZyaW5nZV9iaXRtYXAgPSBsZWZ0Owor ICAgICAgICAgICAgICBpZiAobWNfbGVmdF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9C SVRNQVApCisgICAgICAgICAgICAgICAgY3VyLT5sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gbWNfbGVm dF9mcmluZ2VfZmFjZV9pZDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAg ICBjdXItPmxlZnRfZnJpbmdlX2ZhY2VfaWQgPSBsZWZ0X2ZhY2VfaWQ7CisgICAgICAgICAgICAg IGlmIChtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAg ICAgICAgICAgICBjdXItPmxlZnRfZnJpbmdlX29mZnNldCA9IDA7CisgICAgICAgICAgICAgICAg ZWxzZQorICAgICAgICAgICAgICAgICAgY3VyLT5sZWZ0X2ZyaW5nZV9vZmZzZXQgPSBsZWZ0X29m ZnNldDsKKyAgICAgICAgICAgICAgaWYgKG1jX3JpZ2h0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9f RlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICBjdXItPnJpZ2h0X2ZyaW5nZV9iaXRtYXAg PSBtY19yaWdodF9mcmluZ2VfYml0bWFwOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX2JpdG1hcCA9IHJpZ2h0OworICAgICAgICAgICAg ICBpZiAobWNfcmlnaHRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAg ICAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX2ZhY2VfaWQgPSBtY19yaWdodF9mcmluZ2Vf ZmFjZV9pZDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPnJp Z2h0X2ZyaW5nZV9mYWNlX2lkID0gcmlnaHRfZmFjZV9pZDsKKyAgICAgICAgICAgICAgaWYgKG1j X3JpZ2h0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAg ICAgICBjdXItPnJpZ2h0X2ZyaW5nZV9vZmZzZXQgPSAwOworICAgICAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX29mZnNldCA9IHJpZ2h0X29mZnNl dDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKHJvdy0+b3ZlcmxheV9hcnJv d19iaXRtYXAgPCAwKQorICAgICAgICByb3ctPm92ZXJsYXlfYXJyb3dfYml0bWFwID0gbWNfZ2V0 X2xvZ2ljYWxfZnJpbmdlX2JpdG1hcCAodywgUW92ZXJsYXlfYXJyb3csIDAsIDApOworICAgICAg aWYgKHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAgIT0gY3VyLT5vdmVybGF5X2Fycm93X2JpdG1h cCkKKyAgICAgICAgeworICAgICAgICAgIHJlZHJhd19wID0gMSwgcm93LT5yZWRyYXdfZnJpbmdl X2JpdG1hcHNfcCA9IDE7CisgICAgICAgICAgaWYgKCFrZWVwX2N1cnJlbnRfcCkKKyAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgY3VyLT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcCA9IDE7Cisg ICAgICAgICAgICAgIGN1ci0+b3ZlcmxheV9hcnJvd19iaXRtYXAgPSByb3ctPm92ZXJsYXlfYXJy b3dfYml0bWFwOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBpZiAobWNfbGVmdF9m cmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICB8fCBtY19yaWdo dF9mcmluZ2VfYml0bWFwICE9IE1DX05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hY2UpID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYs IFFmcmluZ2UsIGZhbHNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogbG9va3VwX2Rl cml2ZWRfZmFjZSAodywgZiwgZmFjZSwgRlJJTkdFX0ZBQ0VfSUQsIDApOworICAgICAgaWYgKGZh Y2VfaWQgPCAwKQorICAgICAgICBmYWNlX2lkID0gRlJJTkdFX0ZBQ0VfSUQ7CisgICAgfQorICBm YiA9IGdldF9mcmluZ2VfYml0bWFwX2RhdGEgKHdoaWNoKTsKKyAgcGVyaW9kID0gZmItPnBlcmlv ZDsKKyAgLyogQ29udmVydCByb3cgdG8gZnJhbWUgY29vcmRpbmF0ZXMuICAqLworICBwLnkgPSBX SU5ET1dfVE9fRlJBTUVfUElYRUxfWSAodywgcm93LT55KSArIG9mZnNldDsKKyAgcC53aGljaCA9 IHdoaWNoOworICBwLmJpdHMgPSBmYi0+Yml0czsKKyAgcC53ZCA9IGZiLT53aWR0aDsKKyAgcC5o ID0gZmItPmhlaWdodDsKKyAgcC5kaCA9IChwZXJpb2QgPiAwID8gKHAueSAlIHBlcmlvZCkgOiAw KTsKKyAgcC5oIC09IHAuZGg7CisgIC8qIEFkanVzdCB5IHRvIHRoZSBvZmZzZXQgaW4gdGhlIHJv dyB0byBzdGFydCBkcmF3aW5nIHRoZSBiaXRtYXAuICAqLworICBzd2l0Y2ggKGZiLT5hbGlnbikK KyAgICB7CisgICAgY2FzZSBBTElHTl9CSVRNQVBfQ0VOVEVSOgorICAgICAgcC55ICs9IChyb3ct PmhlaWdodCAtIHAuaCkgLyAyOworICAgICAgYnJlYWs7CisgICAgY2FzZSBBTElHTl9CSVRNQVBf Qk9UVE9NOgorICAgICAgcC55ICs9IChyb3ctPnZpc2libGVfaGVpZ2h0IC0gcC5oKTsKKyAgICAg IGJyZWFrOworICAgIGNhc2UgQUxJR05fQklUTUFQX1RPUDoKKyAgICAgIGJyZWFrOworICAgIH0K KyAgcC5mYWN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ID8gMSA6IDApOworICAgICAgICAgIHAuYnggPSB4IC0gd2Q7Cisg ICAgICAgICAgcC5ueCA9IHdkOworICAgICAgICB9CisgICAgfQorICBlbHNlCisgICAgeworICAg ICAgaW50IHggPSB3aW5kb3dfYm94X3JpZ2h0ICh3LAorICAgICAgICAoV0lORE9XX0hBU19GUklO R0VTX09VVFNJREVfTUFSR0lOUyAodykKKyAgICAgICAgID8gUklHSFRfTUFSR0lOX0FSRUEKKyAg ICAgICAgIDogVEVYVF9BUkVBKSk7CisgICAgICBpbnQgd2QgPSBXSU5ET1dfUklHSFRfRlJJTkdF X1dJRFRIICh3KTsKKyAgICAgIGlmIChwLndkID4gd2QpCisgICAgICAgIHAud2QgPSB3ZDsKKyAg ICAgIHAueCA9IHggKyAod2QgLSBwLndkKSAvIDI7CisgICAgICAvKiBDbGVhciByaWdodCBmcmlu Z2UgaWYgbm8gYml0bWFwIHRvIGRyYXcgb2YgaWYgYml0bWFwIGRvZXNuJ3QgZmlsbAorICAgdGhl IGZyaW5nZS4gICovCisgICAgICBpZiAocC53ZCA8IHdkIHx8IHAueSA+IHAuYnkgfHwgcC55ICsg cC5oIDwgcC5ieSArIHAubnkpCisgICAgICAgIHsKKyAgICAgICAgICBwLmJ4ID0geDsKKyAgICAg ICAgICBwLm54ID0gd2Q7CisgICAgICAgIH0KKyAgICB9CisgIGlmIChwLnggPj0gV0lORE9XX0JP WF9MRUZUX0VER0VfWCAodykKKyAgICAgICYmIChwLnggKyBwLndkKSA8PSBXSU5ET1dfQk9YX0xF RlRfRURHRV9YICh3KSArIFdJTkRPV19QSVhFTF9XSURUSCAodykpCisgICAgRlJBTUVfUklGIChm KS0+ZHJhd19mcmluZ2VfYml0bWFwICh3LCByb3csICZwKTsKK30KKwordm9pZAorbWNfZHJhd19m cmluZ2VfYml0bWFwIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGlu dCBsZWZ0X3AsIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUpCit7CisgIGludCBvdmVy bGF5ID0gMDsKKyAgaWYgKGxlZnRfcCA9PSByb3ctPnJldmVyc2VkX3AgJiYgcm93LT5jdXJzb3Jf aW5fZnJpbmdlX3ApCisgICAgeworICAgICAgTGlzcF9PYmplY3QgY3Vyc29yID0gUW5pbDsKKyAg ICAgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgICAgIHsKKyAgICAgICAgY2FzZSBNQ19GUkFN RURfQk9YOgorICAgICAgICAgIGlmIChyb3ctPnZpc2libGVfaGVpZ2h0ID49IFNUQU5EQVJEX0JJ VE1BUF9IRUlHSFQgKGhvbGxvd19yZWN0YW5nbGVfYml0cykpCisgICAgICAgICAgICBjdXJzb3Ig PSBRaG9sbG93OworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGN1cnNvciA9IFFob2xsb3df c21hbGw7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTUNfSE9MTE9XX0JPWDoKKyAg ICAgICAgICBpZiAocm93LT52aXNpYmxlX2hlaWdodCA+PSBTVEFOREFSRF9CSVRNQVBfSEVJR0hU IChob2xsb3dfcmVjdGFuZ2xlX2JpdHMpKQorICAgICAgICAgICAgY3Vyc29yID0gUWhvbGxvdzsK KyAgICAgICAgICBlbHNlCisgICAgICAgICAgICBjdXJzb3IgPSBRaG9sbG93X3NtYWxsOworICAg ICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAgICAgICAgY3Vy c29yID0gUWJveDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19CQVI6CisgICAg ICAgICAgY3Vyc29yID0gUWJhcjsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19I QkFSOgorICAgICAgICAgIGN1cnNvciA9IFFoYmFyOworICAgICAgICAgIGJyZWFrOworICAgICAg ICBjYXNlIE1DX05PX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGNhc2UgTUNfTk9fQ1VSU09SOgor ICAgICAgICBjYXNlIE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGNhc2UgTUNfTEVG VF9GUklOR0VfQklUTUFQOgorICAgICAgICBkZWZhdWx0OgorICAgICAgICAgIHctPnBoeXNfY3Vy c29yX29uX3AgPSAwOworICAgICAgICAgIHJvdy0+Y3Vyc29yX2luX2ZyaW5nZV9wID0gMDsKKyAg ICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgaWYgKCFOSUxQIChjdXJzb3IpKQorICAg ICAgICB7CisgICAgICAgICAgaW50IGJtID0gbWNfZ2V0X2xvZ2ljYWxfY3Vyc29yX2JpdG1hcCAo dywgY3Vyc29yKTsKKyAgICAgICAgICBpZiAoYm0gIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbWNfZHJhd19mcmluZ2VfYml0bWFwXzEgKHcsIHJv dywgbGVmdF9wLCAyLCBibSk7CisgICAgICAgICAgICAgIG92ZXJsYXkgPSBFUSAoY3Vyc29yLCBR Ym94KSA/IDMgOiAxOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICBtY19kcmF3 X2ZyaW5nZV9iaXRtYXBfMSAodywgcm93LCBsZWZ0X3AsIG92ZXJsYXksIE1DX05PX0ZSSU5HRV9C SVRNQVApOworICBpZiAobGVmdF9wICYmIHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAgIT0gTUNf Tk9fRlJJTkdFX0JJVE1BUCkKKyAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXBfMSAodywgcm93LCAx LCAxLCByb3ctPm92ZXJsYXlfYXJyb3dfYml0bWFwKTsKK30KKworLyogZW5kIE1VTFRJUExFLUNV UlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKio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BzKTsKKyAgRnB1dCAoUW1jX3F1YWRydXBsZV9hbmdsZV91cCwgUWZyaW5nZSwgbWFrZV9maXhu dW0gKDQ3KSk7CisgIC8qIChnZXQgJystcXVhZHJ1cGxlLWFuZ2xlLXVwICdmcmluZ2UpID0+IDQ3 ICovCisKKyAgLyogNDggKi8KKyAgREVGU1lNIChRbWNfcXVhZHJ1cGxlX2FuZ2xlX2Rvd24sICIr LXF1YWRydXBsZS1hbmdsZS1kb3duIik7CisgIFZmcmluZ2VfYml0bWFwcyA9IEZjb25zIChRbWNf cXVhZHJ1cGxlX2FuZ2xlX2Rvd24sIFZmcmluZ2VfYml0bWFwcyk7CisgIEZwdXQgKFFtY19xdWFk cnVwbGVfYW5nbGVfZG93biwgUWZyaW5nZSwgbWFrZV9maXhudW0gKDQ4KSk7CisgIC8qIChnZXQg JystcXVhZHJ1cGxlLWFuZ2xlLWRvd24gJ2ZyaW5nZSkgPT4gNDggKi8KKworLyogZW5kIE1VTFRJ UExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgREVGU1lNIChR dHJ1bmNhdGlvbiwgInRydW5jYXRpb24iKTsKICAgREVGU1lNIChRY29udGludWF0aW9uLCAiY29u dGludWF0aW9uIik7CiAgIERFRlNZTSAoUW92ZXJsYXlfYXJyb3csICJvdmVybGF5LWFycm93Iik7 CmRpZmYgLS1naXQgYS9zcmMvbnN0ZXJtLmggYi9zcmMvbnN0ZXJtLmgKaW5kZXggNzhjZTYwOC4u OGVmMGRmZSAxMDA2NDQKLS0tIGEvc3JjL25zdGVybS5oCisrKyBiL3NyYy9uc3Rlcm0uaApAQCAt NjYwLDYgKzY2MCwxNiBAQCB0eXBlZGVmIGlkIGluc3RhbmNldHlwZTsKIAogQGludGVyZmFjZSBF bWFjc1Njcm9sbGVyIDogTlNTY3JvbGxlcgogICB7CisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICBOU1JlY3QgbWNfcmVjdGFuZ2xlOwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICBzdHJ1Y3Qgd2luZG93ICp3aW5kb3c7 CiAgICBzdHJ1Y3QgZnJhbWUgKmZyYW1lOwogICAgTlNSZXNwb25kZXIgKnByZXZSZXNwb25kZXI7 CkBAIC02ODAsNiArNjkwLDE4IEBAIHR5cGVkZWYgaWQgaW5zdGFuY2V0eXBlOwogICAgaW50IGVt X3dob2xlOwogICAgfQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUt Q1VSU09SUyAqLworCistICh2b2lkKW1jX3NldF9yZWN0YW5nbGU6IChOU1JlY3QpcmVjdDsKKy0g KE5TUmVjdCltY19nZXRfcmVjdGFuZ2xlOworLSAoc3RydWN0IHdpbmRvdyAqKW1jX2dldF93aW5k b3c7CistIChib29sKW1jX2p1ZGdlOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAt IChpbnN0YW5jZXR5cGUpIGluaXRGcmFtZTogKE5TUmVjdCApciB3aW5kb3c6IChMaXNwX09iamVj dCl3aW47CiAtICh2b2lkKXNldEZyYW1lOiAoTlNSZWN0KXI7CiAKZGlmZiAtLWdpdCBhL3NyYy9u c3Rlcm0ubSBiL3NyYy9uc3Rlcm0ubQppbmRleCA4MWQzNmJlLi4zYTI1MDRkIDEwMDY0NAotLS0g YS9zcmMvbnN0ZXJtLm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UUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgIC8vICBjbG9ja190IGNs b2NrX3N0YXJ0ID0gY2xvY2soKTsKKyAgLy8gbnNfZHJhd191bmRlcndhdmUgKHMsIHMtPndpZHRo LCBzLT54KTsKKyAgTlNDb2xvciAqaG9sbG93X2NvbG9yID0gRlJBTUVfQkFDS0dST1VORF9DT0xP UiAocy0+Zik7CisgIHN0cnVjdCBmYWNlICpmYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBERUZB VUxUX0ZBQ0VfSUQpOworICBpbnQgdm50aCA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgp OworICAvKiBTVFJFVENIX0dMWVBIIG1heSBjb250YWluIG1vcmUgdGhhbiBvbmUgZmFrZSBjdXJz b3IgYXQgdGhlIHNhbWUgSFBPUy4KKyAgTk9URTogIEEgZmFrZSBjdXJzb3IgZnJvbSBvbmUgY2Fj aGUgbWF5IG92ZXJ3cml0ZSBhIGZha2UgY3Vyc29yIGZyb20gYW5vdGhlcgorICBjYWNoZSAtLSB0 aHVzLCB3ZSBtdXN0IGNoZWNrIHRoZW0gYWxsIGZvciBvdmVyd3JpdHRlbiBmYWtlIGN1cnNvcnMu ICovCisgIGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAg ICAgICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7CisgICAgICAgKytjYWNoZV90eXBlKQorICAgIHsK KyAgICAgIGZvciAoaW50IG50aCA9IDA7CisgICAgICAgICAgIHMKKyAgICAgICAgICAgJiYgbWNf dHJhdmVyc2VfY2FjaGVfcCAocy0+dy0+bWNfbWF0cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGgp OworICAgICAgICAgICArK250aCkKKyAgICAgICAgeworICAgICAgICAgIC8vICBpbnQgeCA9IHMt PnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ue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yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgLmdyZWVuID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXS5mZy5ncmVlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1 ZSA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZmcu Ymx1ZX07CisgICAgICAgICAgLy8gIHN0cnVjdCBtY19SR0IgbHNsX2JnID0gey5yZWQgPSBzLT53 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLnJlZCwKKyAg ICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gcy0+dy0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5iZy5ncmVlbiwKKyAgICAgICAg ICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBzLT53LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLmJsdWV9OworICAgICAgICAgIGJvb2wg YWN0aXZlX3AgPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLmFjdGl2ZV9wOworICAgICAgICAgIC8vICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3Ig PSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBo X2ZsYXZvcjsKKyAgICAgICAgICBib29sIGVuYWJsZWRfcCA9IHMtPnctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZW5hYmxlZF9wOworICAgICAgICAgIGJvb2wg Z29fcCA9ICh2cG9zID09IHZudGgKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA9PSBj dXJzb3JfZ2x5cGgtPmhwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKTsK KyAgICAgICAgICBpZiAoIWdvX3ApCisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICBO U1JlY3QgcjsKKyAgICAgICAgICByLm9yaWdpbi54ID0gZng7CisgICAgICAgICAgci5vcmlnaW4u eSA9IGZ5OworICAgICAgICAgIHIuc2l6ZS5oZWlnaHQgPSBoOworICAgICAgICAgIHIuc2l6ZS53 aWR0aCA9IHdkOworICAgICAgICAgIFtbTlNDb2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiBs c2xfZmcucmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JlZW46IGxz bF9mZy5ncmVlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBibHVlOiBs c2xfZmcuYmx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscGhhOiAx LjBdIHNldF07CisgICAgICBpZiAoY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWCkKKyAgICAg ICAgeworICAgICAgICAgIExpc3BfT2JqZWN0IGJ1ZiA9IHMtPnctPmNvbnRlbnRzOworICAgICAg ICAgIENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgICAgICAgICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJV RkZFUiAoYnVmKTsKKyAgICAgICAgICBib29sIHJlZ2lvbl9hY3RpdmVfcCA9ICghTklMUCAoVnRy YW5zaWVudF9tYXJrX21vZGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg IU5JTFAgKEJWQVIgKGIsIG1hcmtfYWN0aXZlKSkpOworICAgICAgICAgIHB0cmRpZmZfdCByZWdp b25fYmVnID0gKHJlZ2lvbl9hY3RpdmVfcCkg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nNvcl9n bHlwaC0+Y2hhcnBvcyA9PSByZWdpb25fZW5kKQorICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2VuZF9mYWNlX2lkID0gbG9v a3VwX25hbWVkX2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1h dC1yZWdpb24tcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgc3RydWN0IGZh Y2UgKmhvbGxvd19hY3RpdmVfcmVnaW9uX2VuZF9mYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBo b2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgTlNDb2xv ciAqaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2NvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29s b3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2UpLCBz LT5mKTsKKyAgICAgICAgICAgICAgICBob2xsb3dfY29sb3IgPSBob2xsb3dfYWN0aXZlX3JlZ2lv bl9lbmRfY29sb3I7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZSBpZiAocmVn aW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9wCisgICAgICAg ICAgICAgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+Y2hhcnBvcyA+IHJlZ2lvbl9iZWcKKyAg ICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zIDwgcmVnaW9uX2Vu ZCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9s bG93X2FjdGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNlX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b3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoaG9sbG93X2FjdGl2ZV9mYWNlKSwgcy0+ Zik7CisgICAgICAgICAgICAgICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19hY3RpdmVfY29s b3I7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmICghYWN0 aXZlX3ApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBlbnVt IGZhY2VfaWQgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+ dywgcy0+ZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNl IiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5h Y3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQp OworICAgICAgICAgICAgICAgICAgICAgIE5TQ29sb3IgKmhvbGxvd19pbmFjdGl2ZV9jb2xvciA9 IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGhvbGxvd19pbmFj dGl2ZV9mYWNlKSwgcy0+Zik7CisgICAgICAgICAgICAgICAgICAgICAgaG9sbG93X2NvbG9yID0g aG9sbG93X2luYWN0aXZlX2NvbG9yOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgIH0K KyAgICAgICAgZWxzZSBpZiAoZmFjZSAmJiBOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpID09IG5z X2luZGV4X2NvbG9yIChGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpLCBzLT5mKSkKKyAgICAgICAg ICB7CisgICAgICAgICAgICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdS T1VORCAoZmFjZSksIHMtPmYpIHNldF07CisgICAgICAgICAgICBob2xsb3dfY29sb3IgPSBGUkFN RV9DVVJTT1JfQ09MT1IgKHMtPmYpOworICAgICAgICAgIH0KKyAgICAgICAgICBzd2l0Y2ggKGN1 cnNvcl90eXBlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBjYXNlIE1DX05PX0ZSSU5H RV9CSVRNQVA6CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgTUNf Tk9fQ1VSU09SOgorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1D X1JJR0hUX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgICAgICAgIGNhc2UgTUNfTEVGVF9GUklOR0Vf QklUTUFQOgorICAgICAgICAgICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAgICAgICAgICAg ICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAg IGNhc2UgTUNfRlJBTUVEX0JPWDoKKyAgICAgICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAg ICAgICAgICAgICAgICBbaG9sbG93X2NvbG9yIHNldF07CisgICAgICAgICAgICAgICAgTlNSZWN0 RmlsbCAoTlNJbnNldFJlY3QgKHIsIDEsIDEpKTsKKyAgICAgICAgICAgICAgICBbRlJBTUVfQ1VS U09SX0NPTE9SIChzLT5mKSBzZXRdOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAg ICAgICBjYXNlIE1DX0hPTExPV19CT1g6CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7 CisgICAgICAgICAgICAgICAgW2hvbGxvd19jb2xvciBzZXRdOworICAgICAgICAgICAgICAgIE5T UmVjdEZpbGwgKE5TSW5zZXRSZWN0IChyLCAxLCAxKSk7CisgICAgICAgICAgICAgICAgW0ZSQU1F X0NVUlNPUl9DT0xPUiAocy0+Zikgc2V0XTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAg ICAgICAgICAgY2FzZSBNQ19IQkFSOgorICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOwor ICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX0JBUjoKKyAgICAg ICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAg ICAgICAgIH0KKyAgICAgICAgICAvKiBJZiBhIGdseXBoIGV4aXN0cyAocy0+Y2hhcjJiICE9IE5V TEwpLCB0aGVuIGRyYXcgdGhlIGdseXBoIG9uIHRvcCBvZiB0aGUKKyAgICAgICAgICBuZXdseSBk cmF3biByZWN0YW5nbGUgdGhhdCB3YXMgY3JlYXRlZCBoZXJlaW5hYm92ZS4gIFRvIHRoZSBleHRl bnQgdGhhdCB3ZQorICAgICAgICAgIHdhbnQgdG8gZG91YmxlLWltcHJpbnQgZ2x5cGhzIHRvIG1h a2UgdGhlbSBhcHBlYXIgdG8gYmUgc2VtaS1ib2xkLCBpdCBjYW4KKyAgICAgICAgICBiZSBkb25l IGhlcmUgZm9yIGFsbCBjdXJzb3IgdHlwZXMuICBUaGUgYm94LXN0eWxlIGN1cnNvcnMgYXJlIGlt cHJpbnRlZAorICAgICAgICAgIHdpdGggZ2x5cGhzIG9ubHkgb25lICgxKSB0aW1lLiAgVGhlIHNl bWktYm9sZCBhcHBlYXJhbmNlIGlzIGhlbHBmdWwgd2hlbgorICAgICAgICAgIGRlYnVnZ2luZyB0 byBzZWUgdGhhdCB0aGUgY29vcmRpbmF0ZXMgYXJlIGNvcnJlY3QuICovCisgICAgICAgICAgaWYg KHMtPmNoYXIyYiAhPSBOVUxMCisgICAgICAgICAgICAgICYmIChjdXJzb3JfdHlwZSA9PSBNQ19G SUxMRURfQk9YCisgICAgICAgICAgICAgICAgICB8fCBjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURf Qk9YCisgICAgICAgICAgICAgICAgICB8fCBjdXJzb3JfdHlwZSA9PSBNQ19IT0xMT1dfQk9YKSkK KyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgQk9PTCBpc0NvbXBvc2l0ZSA9IHMtPmZpcnN0 X2dseXBoLT50eXBlID09IENPTVBPU0lURV9HTFlQSDsKKyAgICAgICAgICAgICAgaWYgKGlzQ29t cG9zaXRlKQorICAgICAgICAgICAgICAgIG5zX2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19m b3JlZ3JvdW5kIChzKTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICB7 CisgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmb250ICpmb250ID0gcy0+ZmFjZS0+Zm9udDsK KyAgICAgICAgICAgICAgICAgICAgaWYgKCFmb250KQorICAgICAgICAgICAgICAgICAgICAgIGZv bnQgPSBGUkFNRV9GT05UIChzLT5mKTsKKyAgICAgICAgICAgICAgICAgICAgYm9vbCB3aXRoX2Jn X3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgZm9udC0+ZHJpdmVyLT5kcmF3IChzLCBz LT5jbXBfZnJvbSwgcy0+bmNoYXJzLCBzLT54LCBzLT55YmFzZSwgd2l0aF9iZ19wKTsKKyAgICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgLy8gIGNs b2NrX3QgY2xvY2tfZW5kID0gY2xvY2soKTsKKyAgLy8gIGRvdWJsZSBjcHVfdGltZV91c2VkID0g KChkb3VibGUpIChjbG9ja19lbmQgLSBjbG9ja19zdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7Cisg IC8vICBmcHJpbnRmIChzdGRlcnIsICJuc19kcmF3X292ZXJ3cml0dGVuICglZCk6ICBUSU1FICgl ZilcbiIsIHZwb3MsIGNwdV90aW1lX3VzZWQpOworfQorCitzdGF0aWMgdm9pZAorbWNfbnNfZHJh d193aW5kb3dfY3Vyc29yIChz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rZ3JvdW5kID0gZmFjZS0+bGZhY2VbTEZBQ0VfQkFDS0dST1VORF9JTkRFWF07 CisgICAgIGZwcmludGYgKHN0ZGVyciwgIlxuZm9yZWdyb3VuZCAoJXMpIHwgYmFja2dyb3VuZCAo JXMpXG4iLAorICAgICAgICAgICAgICAgICAgICAgICghTklMUCAoZm9yZWdyb3VuZCkgPyBTU0RB VEEgKGZvcmVncm91bmQpIDogIk5JTFAiKSwKKyAgICAgICAgICAgICAgICAgICAgICAoIU5JTFAg KGJhY2tncm91bmQpID8gU1NEQVRBIChiYWNrZ3JvdW5kKSA6ICJOSUxQIikpOworICAtICBFWEFN UExFIE9GIEhPVyBUTyBDUkVBVEUgQSBDT0xPUiBXSVRIIFJHQi9MU0wgZmxvYXQgdmFsdWVzOgor ICAgICBOU0NvbG9yICpteV9jb2xvciA9IFtOU0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6 IDEuMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg Z3JlZW46IDEuMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGJsdWU6IDEuMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgYWxwaGE6IDEuMF07CisgIC0gIEFMVEVSTkFUSVZFIEVYQU1QTEU6CisgICAg IGVudW0gZmFjZV9pZCBkZWJ1Z2dpbmdfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlIChzLT53 LCBzLT5mLCBpbnRlcm4gKCIrLWRlYnVnZ2luZy1mYWNlIiksIHRydWUpOworICAgICBzdHJ1Y3Qg ZmFjZSAqZGVidWdnaW5nX2ZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIGRlYnVnZ2luZ19mYWNl X2lkKTsKKyAgICAgTlNDb2xvciAqY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNf RkFDRV9GT1JFR1JPVU5EIChkZWJ1Z2dpbmdfZmFjZSksIHMtPmYpOworICAgICBbY29sb3Igc2V0 XTsgKi8KKyAgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSAorICAgICAgfHwgZ2x5cGhfZmxh dm9yID09IE1DX0dMWVBITEVTUykKKyAgICBbW05TQ29sb3IgY29sb3JXaXRoQ2FsaWJyYXRlZFJl ZDogbHNsLnJlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdyZWVuOiBsc2wuZ3Jl ZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmx1ZTogbHNsLmJsdWUKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBhbHBoYTogMS4wXSBzZXRdOworICAgIGVsc2UKKyAg ICAgIFtGUkFNRV9DVVJTT1JfQ09MT1IgKGYpIHNldF07CisgIGlmIChjdXJzb3JfdHlwZSA9PSBN Q19GUkFNRURfQk9YKQorICAgIHsKKyAgICAgIExpc3BfT2JqZWN0IGJ1ZiA9IHctPmNvbnRlbnRz OworICAgICAgQ0hFQ0tfQlVGRkVSIChidWYpOworICAgICAgc3RydWN0IGJ1ZmZlciAqYiA9IFhC VUZGRVIgKGJ1Zik7CisgICAgICBib29sIHJlZ2lvbl9hY3RpdmVfcCA9ICghTklMUCAoVnRyYW5z aWVudF9tYXJrX21vZGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAo QlZBUiAoYiwgbWFya19hY3RpdmUpKSk7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2JlZyA9IChy ZWdpb25fYWN0aXZlX3ApID8gbWNfcmVnaW9uX2xpbWl0ICgxKSA6IC0xOworICAgICAgcHRyZGlm Zl90IHJlZ2lvbl9lbmQgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IG1jX3JlZ2lvbl9saW1pdCAoMCkg OiAtMTsKKyAgICAgIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICA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ICAgIGJyZWFrOwor ICAgICAgY2FzZSBNQ19SSUdIVF9GUklOR0VfQklUTUFQOgorICAgICAgICBicmVhazsKKyAgICAg IGNhc2UgTUNfTEVGVF9GUklOR0VfQklUTUFQOgorICAgICAgICBicmVhazsKKyAgICAgIGNhc2Ug TUNfRklMTEVEX0JPWDoKKyAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgIGJyZWFrOwor ICAgICAgY2FzZSBNQ19GUkFNRURfQk9YOgorICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAg ICAgW2hvbGxvd19jb2xvciBzZXRdOworICAgICAgICBOU1JlY3RGaWxsIChOU0luc2V0UmVjdCAo ciwgMSwgMSkpOworICAgICAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChmKSBzZXRdOworICAgICAg ICBicmVhazsKKyAgICAgIGNhc2UgTUNfSE9MTE9XX0JPWDoKKyAgICAgICAgTlNSZWN0RmlsbCAo cik7CisgICAgICAgIFtob2xsb3dfY29sb3Igc2V0XTsKKyAgICAgICAgTlNSZWN0RmlsbCAoTlNJ bnNldFJlY3QgKHIsIDEsIDEpKTsKKyAgICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAoZikgc2V0 XTsKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1DX0hCQVI6CisgICAgICAgIE5TUmVjdEZp bGwgKHIpOworICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfQkFSOgorICAgICAgICBzID0g cjsKKyAgICAgICAgLyogQGxhd2xpc3QgaXMgZm9jdXNpbmcgdGhlIGluaXRpYWwgZGV2ZWxvcG1l bnQgb2YgZmVhdHVyZSByZXF1ZXN0cworICAgICAgICAjMTc2ODQgYW5kICMyMjg3MyBvbiBMMlIg bGFuZ3VhZ2VzLiAqLworICAgICAgICBpZiAoZ2x5cGhfZmxhdm9yICE9IE1DX0dMWVBICisgICAg ICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfR0xZUEhMRVNTKQorICAgICAgICAgIHsKKyAg ICAgICAgICAgIC8qIElmIHRoZSBjaGFyYWN0ZXIgdW5kZXIgY3Vyc29yIGlzIFIyTCwgZHJhdyB0 aGUgYmFyIGN1cnNvcgorICAgICAgICAgICAgICAgb24gdGhlIHJpZ2h0IG9mIGl0cyBnbHlwaCwg cmF0aGVyIHRoYW4gb24gdGhlIGxlZnQuICovCisgICAgICAgICAgICBpZiAoKGN1cnNvcl9nbHlw aC0+cmVzb2x2ZWRfbGV2ZWwgJiAxKSAhPSAwKQorICAgICAgICAgICAgICBzLm9yaWdpbi54ICs9 IGN1cnNvcl9nbHlwaC0+cGl4ZWxfd2lkdGggLSBzLnNpemUud2lkdGg7CisgICAgICAgICAgfQor ICAgICAgICBOU1JlY3RGaWxsIChzKTsKKyAgICAgICAgYnJlYWs7CisgICAgfQorICBuc19yZXNl dF9jbGlwcGluZyAoZik7CisgIC8qIGRyYXcgdGhlIGNoYXJhY3RlciB1bmRlciB0aGUgY3Vyc29y ICovCisgIGlmIChnbHlwaF9mbGF2b3IgIT0gTUNfR0xZUEhMRVNTCisgICAgICAmJiAoY3Vyc29y X3R5cGUgPT0gTUNfRlJBTUVEX0JPWAorICAgICAgICAgIHx8IGN1cnNvcl90eXBlID09IE1DX0ZJ TExFRF9CT1gKKyAgICAgICAgICB8fCBjdXJzb3JfdHlwZSA9PSBNQ19IT0xMT1dfQk9YCisgICAg ICAgICAgfHwgKGRlYnVnX3AKKyAgICAgICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gTUNfSEJB UikKKyAgICAgICAgICB8fCAoZGVidWdfcAorICAgICAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9 PSBNQ19CQVIpKSkKKyAgICB7CisgICAgICAvKiBgY3Vyc29yX2djX3BgIGlzIHVzZWQgb25seSBi eSBgdzMydGVybS5jYCBhbmQgYHh0ZXJtLmMnLiAqLworICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9 IGZhbHNlOworICAgICAgWFJlY3R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Ki8KK3sKKyAgaWYg KHMtPmZvcl9vdmVybGFwcykKKyAgICByZXR1cm47CisgIC8qIERvIHVuZGVybGluZS4gKi8KKyAg aWYgKGZhY2UtPnVuZGVybGluZV9wKQorICAgIHsKKyAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxp bmVfdHlwZSA9PSBGQUNFX1VOREVSX1dBVkUpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoZmFj ZS0+dW5kZXJsaW5lX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsK KyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9y IChmYWNlLT51bmRlcmxpbmVfY29sb3IsIHMtPmYpIHNldF07CisgICAgICAgICAgbnNfZHJhd191 bmRlcndhdmUgKHMsIHdpZHRoLCB4KTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChzLT5m YWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgeworICAg ICAgICAgICAgTlNSZWN0IHI7CisgICAgICAgICAgICB1bnNpZ25lZCBsb25nIHRoaWNrbmVzcywg cG9zaXRpb247CisgICAgICAgICAgICAvKiBJZiB0aGUgcHJldiB3YXMgdW5kZXJsaW5lZCwgbWF0 Y2ggaXRzIGFwcGVhcmFuY2UuICovCisgICAgICAgICAgICBpZiAocy0+cHJldiAmJiBzLT5wcmV2 LT5mYWNlLT51bmRlcmxpbmVfcAorICAgICAgICAgICAgICAgICYmIHMtPnByZXYtPmZhY2UtPnVu ZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORQorICAgICAgICAgICAgICAgICYmIHMtPnBy ZXYtPnVuZGVybGluZV90aGlja25lc3MgPiAwKQorICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgdGhpY2tuZXNzID0gcy0+cHJldi0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAgICAg ICAgICAgICBwb3NpdGlvbiA9IHMtPnByZXYtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgc3RydWN0IGZvbnQgKmZvbnQ7CisgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBs b25nIGRlc2NlbnQ7CisgICAgICAgICAgICAgICAgICBmb250PXMtPmZvbnQ7CisgICAgICAgICAg ICAgICAgICBkZXNjZW50ID0gcy0+eSArIHMtPmhlaWdodCAtIHMtPnliYXNlOworICAgICAgICAg ICAgICAgICAgLyogVXNlIHVuZGVybGluZSB0aGlja25lc3Mgb2YgZm9udCwgZGVmYXVsdGluZyB0 byAxLiAqLworICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gKGZvbnQgJiYgZm9udC0+dW5k ZXJsaW5lX3RoaWNrbmVzcyA+IDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGZv bnQtPnVuZGVybGluZV90aGlja25lc3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog MTsKKyAgICAgICAgICAgICAgICAgIC8qIERldGVybWluZSB0aGUgb2Zmc2V0IG9mIHVuZGVybGlu aW5nIGZyb20gdGhlIGJhc2VsaW5lLiAqLworICAgICAgICAgICAgICAgICAgaWYgKHhfdW5kZXJs aW5lX2F0X2Rlc2NlbnRfbGluZSkKKyAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBkZXNj ZW50IC0gdGhpY2tuZXNzOworICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICh4X3VzZV91bmRl cmxpbmVfcG9zaXRpb25fcHJvcGVydGllcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBmb250ICYmIGZvbnQtPnVuZGVybGluZV9wb3NpdGlvbiA+PSAwKQorICAgICAgICAgICAgICAg ICAgICAgIHBvc2l0aW9uID0gZm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAg ICAgICAgICAgIGVsc2UgaWYgKGZvbnQpCisgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlv biA9IGxyb3VuZCAoZm9udC0+ZGVzY2VudCAvIDIpOworICAgICAgICAgICAgICAgICAgICAgICAg ZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHVuZGVybGluZV9taW5p bXVtX29mZnNldDsKKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gbWF4IChwb3NpdGlvbiwg dW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0KTsKKyAgICAgICAgICAgICAgICAgIC8qIEVuc3VyZSB1 bmRlcmxpbmluZyBpcyBub3QgY3JvcHBlZC4gKi8KKyAgICAgICAgICAgICAgICAgIGlmIChkZXNj ZW50IDw9IHBvc2l0aW9uKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICAgICAgcG9zaXRpb24gPSBkZXNjZW50IC0gMTsKKyAgICAgICAgICAgICAgICAgICAgICB0aGlj a25lc3MgPSAxOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVs c2UgaWYgKGRlc2NlbnQgPCBwb3NpdGlvbiArIHRoaWNrbmVzcykKKyAgICAgICAgICAgICAgICAg ICAgICB0aGlja25lc3MgPSAxOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHMtPnVu ZGVybGluZV90aGlja25lc3MgPSB0aGlja25lc3M7CisgICAgICAgICAgICBzLT51bmRlcmxpbmVf cG9zaXRpb24gPSBwb3NpdGlvbjsKKyAgICAgICAgICAgIHIgPSBOU01ha2VSZWN0ICh4LCBzLT55 YmFzZSArIHBvc2l0aW9uLCB3aWR0aCwgdGhpY2tuZXNzKTsKKyAgICAgICAgICAgIGlmIChmYWNl LT51bmRlcmxpbmVfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICAgIFtkZWZhdWx0Q29sIHNldF07 CisgIC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ICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgZmFjZSA9IEZBQ0VfRlJPTV9JRCAo cy0+Ziwgcy0+Zmlyc3RfZ2x5cGgtPmZhY2VfaWQpOworICAgICAgYmdDb2wgPSBuc19sb29rdXBf aW5kZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKSwgcy0+Zik7CisgICAgICBm Z0NvbCA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQgKGZhY2Up LCBzLT5mKTsKKyAgICAgIGZvciAoaSA9IDA7IGkgPCBuOyArK2kpCisgICAgICAgIHsKKyAgICAg ICAgICBpZiAoIXMtPnJvdy0+ZnVsbF93aWR0aF9wKQorICAgICAgICAgICAgeworICAgICAgICAg ICAgICBpbnQgb3ZlcnJ1biwgbGVmdG92ZXJydW47CisgICAgICAgICAgICAgIC8qIHRydW5jYXRl IHRvIGF2b2lkIG92ZXJ3cml0aW5nIGZyaW5nZSBhbmQvb3Igc2Nyb2xsYmFyICovCisgICAgICAg ICAgICAgIG92ZXJydW4gPSBtYXggKDAsIChzLT54ICsgcy0+YmFja2dyb3VuZF93aWR0aCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gKFdJTkRPV19CT1hfUklHSFRfRURHRV9Y IChzLT53KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBXSU5ET1dfUklHSFRfRlJJ TkdFX1dJRFRIIChzLT53KSkpOworICAgICAgICAgICAgICAgICAgICByW2ldLnNpemUud2lkdGgg LT0gb3ZlcnJ1bjsKKyAgICAgICAgICAgICAgLyogdHJ1bmNhdGUgdG8gYXZvaWQgb3ZlcndyaXRp bmcgdG8gbGVmdCBvZiB0aGUgd2luZG93IGJveCAqLworICAgICAgICAgICAgICBsZWZ0b3ZlcnJ1 biA9IChXSU5ET1dfQk9YX0xFRlRfRURHRV9YIChzLT53KQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICArIFdJTkRPV19MRUZUX0ZSSU5HRV9XSURUSCAocy0+dykpIC0gcy0+eDsKKyAgICAg ICAgICAgICAgaWYgKGxlZnRvdmVycnVuID4gMCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAg ICAgICAgICAgICByW2ldLm9yaWdpbi54ICs9IGxlZnRvdmVycnVuOworICAgICAgICAgICAgICAg ICAgcltpXS5zaXplLndpZHRoIC09IGxlZnRvdmVycnVuOworICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgLyogWFhYOiBUcnkgdG8gd29yayBiZXR3ZWVuIHByb2JsZW0gd2hlcmUgYSBz dHJldGNoIGdseXBoIG9uCisgICAgICAgICAgICAgICAgIGEgcGFydGlhbGx5LXZpc2libGUgYm90 dG9tIHJvdyB3aWxsIGNsZWFyIHBhcnQgb2YgdGhlCisgICAgICAgICAgICAgICAgIG1vZGVsaW5l LCBhbmQgYW5vdGhlciB3aGVyZSBsaXN0LWJ1ZmZlcnMgaGVhZGVycyBhbmQgc2ltaWxhcgorICAg ICAgICAgICAgICAgICByb3dzIGVycm9uZW91c2x5IGhhdmUgdmlzaWJsZV9oZWlnaHQgc2V0IHRv IDAuICBOb3Qgc3VyZQorICAgICAgICAgICAgICAgICB3aGVyZSB0aGlzIGlzIGNvbWluZyBmcm9t IGFzIG90aGVyIHRlcm1zIHNlZW0gbm90IHRvIHNob3cuICovCisgICAgICAgICAgICAgIHJbaV0u c2l6ZS5oZWlnaHQgPSBtaW4gKHMtPmhlaWdodCwgcy0+cm93LT52aXNpYmxlX2hlaWdodCk7Cisg ICAgICAgICAgICB9CisgICAgICAgICAgW2JnQ29sIHNldF07CisgICAgICAgICAgLyogTk9URTog dW5kZXIgTlMgdGhpcyBpcyBOT1QgdXNlZCB0byBkcmF3IGN1cnNvcnMsIGJ1dCB3ZSBtdXN0IGF2 b2lkCisgICAgICAgICAgICAgb3ZlcndyaXRpbmcgY3Vyc29yICh1c3VhbGx5IHdoZW4gY3Vyc29y I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JbaV0uc2l6ZS53aWR0aCAtPSB3aWR0 aDsKKyAgICAgICAgICAgICAgcltpXS5vcmlnaW4ueCArPSB3aWR0aDsKKyAgICAgICAgICAgICAg TlNSZWN0RmlsbCAocltpXSk7CisgICAgICAgICAgICAgIC8qIERyYXcgb3ZlcmxpbmluZywgZXRj LiBvbiB0aGUgY3Vyc29yLiAqLworICAgICAgICAgICAgICBpZiAocy0+dy0+cGh5c19jdXJzb3Jf dHlwZSA9PSBNQ19GSUxMRURfQk9YKQorICAgICAgICAgICAgICAgIG1jX25zX2RyYXdfdGV4dF9k ZWNvcmF0aW9uIChzLCBmYWNlLCBiZ0NvbCwgd2lkdGgsIHgpOworICAgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICAgIG1jX25zX2RyYXdfdGV4dF9kZWNvcmF0aW9uIChzLCBmYWNl LCBmZ0NvbCwgd2lkdGgsIHgpOworICAgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgIHsKKyAgLy8gIGludCByeCA9IHJbaV0ub3JpZ2luLng7CisgIC8vICBpbnQgcnkgPSBy W2ldLm9yaWdpbi55OworICAvLyAgaW50IHJ3ID0gcltpXS5zaXplLndpZHRoOworICAvLyAgaW50 IHJoID0gcltpXS5zaXplLmhlaWdodDsKKyAgLy8gIGZwcmludGYgKHN0ZGVyciwgIm1jX25zX2R1 bXBnbHlwaHNfc3RyZXRjaDogIHZwb3MgKCVkKSB8IHJ4ICglZCkgfCByeSAoJWQpIHwgcncgKCVk KSB8IHJoICglZClcbiIsCisgIC8vICAgICAgICAgICAgICAgICAgIHMtPmZpcnN0X2dseXBoLT52 cG9zLCByeCwgcnksIHJ3LCByaCk7CisgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHJbaV0pOwor ICAgICAgICAgICAgfQorICAgICAgICAgIC8qIERyYXcgb3ZlcmxpbmluZywgZXRjLiBvbiB0aGUg c3RyZXRjaCBnbHlwaCAob3IgdGhlIHBhcnQKKyAgICA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dfaGVpZ2h0KTsKKyAgICAgIHMtPmJhY2tn cm91bmRfZmlsbGVkX3AgPSAxOworICAgIH0KKyAgICBlbHNlCisgICAgICBiciA9IE5TTWFrZVJl Y3QgKHgsIHksIHMtPnNsaWNlLndpZHRoLCBzLT5zbGljZS5oZWlnaHQpOworICBOU1JlY3RGaWxs IChicik7CisgIC8qIERyYXcgdGhlIGltYWdlLi4gZG8gd2UgbmVlZCB0byBkcmF3IHBsYWNlaG9s ZGVyIGlmIGltZyA9PW5pbD8gKi8KKyAgaWYgKGltZyAhPSBuaWwpCisgICAgeworI2lmZGVmIE5T X0lNUExfQ09DT0EKKyAgICAgIE5TUmVjdCBkciA9IE5TTWFrZVJlY3QgKHgsIHksIHMtPnNsaWNl LndpZHRoLCBzLT5zbGljZS5oZWlnaHQpOworICAgICAgTlNSZWN0IGlyID0gTlNNYWtlUmVjdCAo cy0+c2xpY2UueCwgcy0+c2xpY2UueSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMt PnNsaWNlLndpZHRoLCBzLT5zbGljZS5oZWlnaHQpOworICAgICAgW2ltZyBkcmF3SW5SZWN0OiBk cgorICAgICAgICAgICAgIGZyb21SZWN0OiBpcgorICAgICAgICAgICAgIG9wZXJhdGlvbjogTlND b21wb3NpdGVTb3VyY2VPdmVyCisgICAgICAgICAgICAgIGZyYWN0aW9uOiAxLjAKKyAgICAgICAg ICAgcmVzcGVjdEZsaXBwZWQ6IFlFUworICAgICAgICAgICAgICAgIGhpbnRzOiBuaWxdOworI2Vs c2UKKyAgICAgIFtpbWcgY29tcG9zaXRlVG9Qb2ludDogTlNNYWtlUG9pbnQgKHgsIHkgKyBzLT5z bGljZS5oZWlnaHQpCisgICAgICAgICAgICAgICAgICBvcGVyYXRpb246IE5TQ29tcG9zaXRlU291 cmNlT3Zlcl07CisjZW5kaWYKKyAgICB9CisgIGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUikKKyAg ICB7CisgICAgICBbRlJBTUVfQ1VSU09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JBSVNFRCB8 fCBzLT5obCA9PURSQVdfSU1BR0VfU1VOS0VOKQorICAgIHsKKyAgICAgIGlmIChzLT5obCA9PSBE UkFXX0lNQUdFX1NVTktFTiB8fCBzLT5obCA9PSBEUkFXX0lNQUdFX1JBSVNFRCkKKyAgICAgICAg eworICAgICAgICAgIHRoID0gdG9vbF9iYXJfYnV0dG9uX3JlbGllZiA+PSAwID8KKyAgICAgICAg ICAgIHRvb2xfYmFyX2J1dHRvbl9yZWxpZWYgOiBERUZBVUxUX1RPT0xfQkFSX0JVVFRPTl9SRUxJ RUY7CisgICAgICAgICAgcmFpc2VkX3AgPSAocy0+aGwgPT0gRFJBV19JTUFHRV9SQUlTRUQpOwor ICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICB0aCA9IGFi cyAocy0+aW1nLT5yZWxpZWYpOworICAgICAgICAgICAgcmFpc2VkX3AgPSAocy0+aW1nLT5yZWxp ZWYgPiAwKTsKKyAgICAgICAgICB9CisgICAgICByLm9yaWdpbi54ID0geCAtIHRoOworICAgICAg ci5vcmlnaW4ueSA9IHkgLSB0aDsKKyAgICAgIHIuc2l6ZS53aWR0aCA9IHMtPnNsaWNlLndpZHRo ICsgMip0aC0xOworICAgICAgci5zaXplLmhlaWdodCA9IHMtPnNsaWNlLmhlaWdodCArIDIqdGgt MTsKKyAgICAgIG5zX2RyYXdfcmVsaWVmIChyLCB0aCwgcmFpc2VkX3AsCisgICAgICAgICAgICAg ICAgICAgICAgcy0+c2xpY2UueSA9PSAwLAorICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNl LnkgKyBzLT5zbGljZS5oZWlnaHQgPT0gcy0+aW1nLT5oZWlnaHQsCisgICAgICAgICAgICAgICAg ICAgICAgcy0+c2xpY2UueCA9PSAwLAorICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLngg KyBzLT5zbGljZS53aWR0aCA9PSBzLT5pbWctPndpZHRoLCBzKTsKKyAgICB9CisgIC8qIElmIHRo ZXJlIGlzIG5vIG1hc2ssIHRoZSBiYWNrZ3JvdW5kIHdvbid0IGJlIHNlZW4sCisgICAgIHNvIGRy YXcgYSByZWN0YW5nbGUgb24gdGhlIGltYWdlIGZvciB0aGUgY3Vyc29yLgorICAgICBEbyB0aGlz IGZvciBhbGwgaW1hZ2VzLCBnZXR0aW5nIHRyYW5zcGFyZW5jeSByaWdodCBpcyBub3QgcmVsaWFi bGUuICovCisgIGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUikKKyAgICB7CisgICAgICBpbnQgdGhp Y2tuZXNzID0gYWJzIChzLT5pbWctPnJlbGllZik7CisgICAgICBpZiAodGhpY2tuZXNzID09IDAp IHRoaWNrbmVzcyA9IDE7CisgICAgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSAorICAgICAg ICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEhMRVNTKQorICAgICAgeworICAgICAgICBOU0Nv bG9yICpib3JkZXJfY29sb3IgPSBbTlNDb2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiBsc2wu cmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgZ3JlZW46IGxzbC5ncmVlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBibHVlOiBsc2wuYmx1ZQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscGhhOiAxLjBdOwor ICAgICAgICBuc19kcmF3X2JveCAoYnIsIHRoaWNrbmVzcywgYm9yZGVyX2NvbG9yLCAxLCAxKTsK KyAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgICAgbnNfZHJhd19ib3ggKGJyLCB0aGlja25lc3Ms IEZSQU1FX0NVUlNPUl9DT0xPUiAocy0+ZiksIDEsIDEpOworICAgIH0KK30KKworc3RhdGljIHZv aWQKK21jX25zX21heWJlX2R1bXBnbHlwaHNfYmFja2dyb3VuZCAoc3RydWN0IGdseXBoX3N0cmlu ZyAqcywgY2hhciBmb3JjZV9wKQoreworICBOU1RSQUNFICgibWNfbnNfbWF5YmVfZHVtcGdseXBo c19iYWNrZ3JvdW5kIik7CisgIGlmICghcy0+YmFja2dyb3VuZF9maWxsZWRfcC8qIHx8IHMtPmhs ID09IERSQVdfTU9VU0VfRkFDRSovKQorICAgIHsKKyAgICAgIGludCBib3hfbGluZV93aWR0aCA9 IG1heCAocy0+ZmFjZS0+Ym94X2xpbmVfd2lkdGgsIDApOworICAgICAgaWYgKEZPTlRfSEVJR0hU IChzLT5mb250KSA8IHMtPmhlaWdodCAtIDIgKiBib3hfbGluZV93aWR0aAorICAgICAgICAgIC8q IFdoZW4geGRpc3AuYyBpZ25vcmVzIEZPTlRfSEVJR0hULCB3ZSBjYW5ub3QgdHJ1c3QgZm9udAor ICAgICAgICAgICAgIGRpbWVuc2lvbnMsIHNpbmNlIHRoZSBhY3R1YWwgZ2x5cGhzIG1pZ2h0IGJl IG11Y2gKKyAgICAgICAgICAgICBzbWFsbGVyLiAgU28gaW4gdGhhdCBjYXNlIHdlIGFsd2F5cyBj bGVhciB0aGUgcmVjdGFuZ2xlCisgICAgICAgICAgICAgd2l0aCBiYWNrZ3JvdW5kIGNvbG9yLiAq LworICAgICAgICAgIHx8IEZPTlRfVE9PX0hJR0ggKHMtPmZvbnQpCisgICAgICAgICAgfHwgcy0+ Zm9udF9ub3RfZm91bmRfcCB8fCBzLT5leHRlbmRzX3RvX2VuZF9vZl9saW5lX3AgfHwgZm9yY2Vf cCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBmYWNlICpmYWNlOworICAgICAgICAgIGlm IChzLT5obCA9PSBEUkFXX01PVVNFX0ZBQ0UpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAg IGZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIE1PVVNFX0hMX0lORk8gKHMtPmYpLT5tb3VzZV9m YWNlX2ZhY2VfaWQpOworICAgICAgICAgICAgICBpZiAoIWZhY2UpCisgICAgICAgICAgICAgICAg ZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgTU9VU0VfRkFDRV9JRCk7CisgICAgICAgICAgICB9 CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQgKHMt PmYsIHMtPmZpcnN0X2dseXBoLT5mYWNlX2lkKTsKKyAgICAgICAgICBpZiAoIWZhY2UtPnN0aXBw bGUpCisgICAgICAgICAgICBbKE5TX0ZBQ0VfQkFDS0dST1VORCAoZmFjZSkgIT0gMAorICAgICAg ICAgICAgICA/IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGZh Y2UpLCBzLT5mKQorICAgICAgICAgICAgICA6IEZSQU1FX0JBQ0tHUk9VTkRfQ09MT1IgKHMtPmYp KSBzZXRdOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAg ICAgc3RydWN0IG5zX2Rpc3BsYXlfaW5mbyAqZHB5aW5mbyA9IEZSQU1FX0RJU1BMQVlfSU5GTyAo cy0+Zik7CisgICAgICAgICAgICAgICAgW1tkcHlpbmZvLT5iaXRtYXBzW2ZhY2UtPnN0aXBwbGUt MV0uaW1nIHN0aXBwbGVNYXNrXSBzZXRdOworICAgICAgICAgICAgICB9CisgICAgICAgICAgaWYg KHMtPmhsICE9IERSQVdfQ1VSU09SKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzLT5y ZWN0YW5nbGVfbnVrZWRfcCA9IHRydWU7CisgICAgICAgICAgICAgIE5TUmVjdCByID0gTlNNYWtl UmVjdCAocy0+eCwgcy0+eSArIGJveF9saW5lX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgcy0+YmFja2dyb3VuZF93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHMtPmhlaWdodC0yKmJveF9saW5lX3dpZHRoKTsKKyAgICAgICAgICAg ICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAgICB9CisgICAgICAgICAgcy0+YmFja2dyb3Vu ZF9maWxsZWRfcCA9IDE7CisgICAgICAgIH0KKyAgICB9Cit9CisKK3N0YXRpYyB2b2lkCittY19u c19kcmF3X2dseXBoX3N0cmluZyAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgc3RydWN0IGdseXBo X21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAg ICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2wsIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciwK KyAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBl LAorICAgICAgICAgICAgICAgICAgICAgICAgIGludCB3ZCwgYm9vbCBhY3RpdmVfcCwgYm9vbCBj dXJzb3JfZ2NfcCkKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICBFeHRlcm5hbCAoUklGKTog TWFpbiBkcmF3LXRleHQgY2FsbC4KKyAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCit7CisgIC8qIFRP RE8gKG9wdGltaXplKTogZm9jdXMgZm9yIGJveCBhbmQgY29udGVudHMgZHJhdyAqLworICBOU1Jl Y3QgclsyXTsKKyAgaW50IG4sIGZsYWdzOworICBjaGFyIGJveF9kcmF3bl9wID0gMDsKKyAgc3Ry dWN0IGZvbnQgKmZvbnQgPSBzLT5mYWNlLT5mb250OworICBpZiAoIWZvbnQpCisgICAgZm9udCA9 IEZSQU1FX0ZPTlQgKHMtPmYpOworICBOU1RSQUNFX1dIRU4gKE5TVFJBQ0VfR1JPVVBfR0xZUEhT LCAibWNfbnNfZHJhd19nbHlwaF9zdHJpbmciKTsKKyAgaWYgKHMtPm5leHQgJiYgcy0+cmlnaHRf b3ZlcmhhbmcgJiYgIXMtPmZvcl9vdmVybGFwcykKKyAgICB7CisgICAgICBpbnQgd2lkdGg7Cisg ICAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpuZXh0OworICAgICAgZm9yICh3aWR0aCA9IDAsIG5l eHQgPSBzLT5uZXh0OworICAgICAgICAgICBuZXh0ICYmIHdpZHRoIDwgcy0+cmlnaHRfb3Zlcmhh bmc7CisgICAgICAgICAgIHdpZHRoICs9IG5leHQtPndpZHRoLCBuZXh0ID0gbmV4dC0+bmV4dCkK KyAgICAgICAgaWYgKG5leHQtPmZpcnN0X2dseXBoLT50eXBlICE9IElNQUdFX0dMWVBIKQorICAg ICAgICAgIHsKKyAgICAgICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSAhPSBTVFJF VENIX0dMWVBIKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbiA9IG5zX2dldF9n bHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLT5uZXh0LCByKTsKKyAgICAgICAgICAgICAgICBpZiAo IW5zX2NsaXBfdG9fcmVjdCAocy0+ZiwgciwgbikpCisgICAgICAgICAgICAgICAgICByZXR1cm47 CisgICAgICAgICAgICAgICAgbWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzLT5u ZXh0LCAxKTsKKyAgICAgICAgICAgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgbWNfbnNfZHVtcGds eXBoc19zdHJldGNoIChzLT5uZXh0LCBtYXR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X2R1bXBnbHlwaHNfc3RyZXRjaCAocywgbWF0cml4LCByb3csIHdkKTsKKyAgICAgIGJyZWFr OworICAgIGNhc2UgQ0hBUl9HTFlQSDoKKyAgICBjYXNlIENPTVBPU0lURV9HTFlQSDoKKyAgICAg IG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgcik7CisgICAgICBpZiAoIW5z X2NsaXBfdG9fcmVjdCAocy0+ZiwgciwgbikpCisgICAgICAgIHJldHVybjsKKyAgICAgIGlmIChz LT5mb3Jfb3ZlcmxhcHMKKyAgICAgICAgICB8fCAocy0+Y21wX2Zyb20gPiAwCisgICAgICAgICAg ICAgICYmICEgcy0+Zmlyc3RfZ2x5cGgtPnUuY21wLmF1dG9tYXRpYykpCisgICAgICAgIHMtPmJh Y2tncm91bmRfZmlsbGVkX3AgPSAxOworICAgICAgZWxzZQorICAgICAgICBtY19uc19tYXliZV9k dW1wZ2x5cGhzX2JhY2tncm91bmQgKHMsIHMtPmZpcnN0X2dseXBoLT50eXBlID09IENPTVBPU0lU RV9HTFlQSCk7CisgICAgICBmbGFncyA9IHMtPmhsID09IERSQVdfQ1VSU09SID8gTlNfRFVNUEdM WVBIX0NVUlNPUiA6CisgICAgICAgIChzLT5obCA9PSBEUkFXX01PVVNFX0ZBQ0UgPyBOU19EVU1Q R0xZUEhfTU9VU0VGQUNFIDoKKyAgICAgICAgIChzLT5mb3Jfb3ZlcmxhcHMgPyBOU19EVU1QR0xZ UEhfRk9SRUdST1VORCA6CisgICAgICAgICAgTlNfRFVNUEdMWVBIX05PUk1BTCkpOworICAgICAg dW5zaWduZWQgbG9uZyBzYXZlZF9mZyA9IE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSk7Cisg ICAgICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IgJiYgY3Vyc29yX3R5cGUgPT0gTUNfRklMTEVE X0JPWCkKKyAgICAgICAgeworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgdG1wID0gTlNfRkFDRV9C QUNLR1JPVU5EIChzLT5mYWNlKTsKKyAgICAgICAgICBOU19GQUNFX0JBQ0tHUk9VTkQgKHMtPmZh Y2UpID0gTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKTsKKyAgICAgICAgICBOU19GQUNFX0ZP UkVHUk9VTkQgKHMtPmZhY2UpID0gdG1wOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKHMt PmhsID09IERSQVdfQ1VSU09SCisgICAgICAgICAgICAgICAgICYmIGN1cnNvcl90eXBlID09IE1D X0ZSQU1FRF9CT1gKKyAgICAgICAgICAgICAgICAgJiYgYWN0aXZlX3ApCisgICAgICAgICAgewor ICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9u YW1lZF9mYWNlIChzLT53LCBzLT5mLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItcHJlLXp2 LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9m YWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAg ICAgICAgTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKSA9IE5TX0ZBQ0VfRk9SRUdST1VORCAo aG9sbG93X2FjdGl2ZV9mYWNlKTsKKyAgICAgICAgICB9CisgICAgICAgICAgZWxzZSBpZiAocy0+ aGwgPT0gRFJBV19DVVJTT1IKKyAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBN Q19GUkFNRURfQk9YCisgICAgICAgICAgICAgICAgICAgJiYgYWN0aXZlX3ApCisgICAgICAgICAg ICB7CisgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCA9 IGxvb2t1cF9uYW1lZF9mYWNlIChzL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ICAg TlNDb2xvciAqY29sID0gKE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSkgIT0gMAorICAgICAg ICAgICAgICAgICAgICAgICAgPyBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JF R1JPVU5EIChzLT5mYWNlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHMtPmYpCisgICAgICAgICAgICAgICAgICAgICAgICA6IEZSQU1FX0ZPUkVH Uk9VTkRfQ09MT1IgKHMtPmYpKTsKKyAgICAgICAgW2NvbCBzZXRdOworICAgICAgICAvKiBEcmF3 IHVuZGVybGluZSwgb3ZlcmxpbmUsIHN0cmlrZS10aHJvdWdoLiAqLworICAgICAgICBtY19uc19k cmF3X3RleHRfZGVjb3JhdGlvbiAocywgcy0+ZmFjZSwgY29sLCBzLT53aWR0aCwgcy0+eCk7Cisg ICAgICB9CisgICAgICB7CisgICAgICAgIGlmIChzLT5maXJzdF9nbHlwaC0+dHlwZSAhPSBDT01Q T1NJVEVfR0xZUEgKKyAgICAgICAgICAgICYmIChzLT5sZWZ0X292ZXJ3cml0dGVuX3AgfHwgcy0+ cmlnaHRfb3ZlcndyaXR0ZW5fcCkKKyAgICAgICAgICAgICYmIChzLT5iYWNrZ3JvdW5kX251a2Vk X3AgfHwgcy0+cmVjdGFuZ2xlX251a2VkX3ApCisgICAgICAgICAgICAmJiAocy0+YWN0aW9uX3R5 cGUgPT0gTUNfRFJBV19HTFlQSF9TVFJJTkd8fCBzLT5hY3Rpb25fdHlwZSA9PSBNQ19FUkFTRV9H TFlQSF9TVFJJTkcpKQorICAgICAgICAgIG1jX25zX2RyYXdfb3ZlcndyaXR0ZW4gKHMsIG1hdHJp eCwgcm93LCBzLT5maXJzdF9nbHlwaCk7CisgICAgICB9CisgICAgICBpZiAocy0+aGwgPT0gRFJB V19DVVJTT1IKKyAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9YKQorICAg ICAgICB7CisgICAgICAgICAgdW5zaWduZWQgbG9uZyB0bXAgPSBOU19GQUNFX0JBQ0tHUk9VTkQg KHMtPmZhY2UpOworICAgICAgICAgIE5TX0ZBQ0VfQkFDS0dST1VORCAocy0+ZmFjZSkgPSBOU19G QUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2UpOworICAgICAgICAgIE5TX0ZBQ0VfRk9SRUdST1VORCAo cy0+ZmFjZSkgPSB0bXA7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAocy0+aGwgPT0gRFJB V19DVVJTT1IKKyAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JP WCkKKyAgICAgICAgICBOU19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2UpID0gc2F2ZWRfZmc7Cisg ICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICBicmVhazsKKyAgICBjYXNlIEdM WVBITEVTU19HTFlQSDoKKyAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAo cywgcik7CisgICAgICBpZiAoIW5zX2NsaXBfdG9fcmVjdCAocy0+ZiwgciwgbikpCisgICAgICAg IHJldHVybjsKKyAgICAgIGlmIChzLT5mb3Jfb3ZlcmxhcHMgfHwgKHMtPmNtcF9mcm9tID4gMAor ICAgICAgICAgICAgJiYgISBzLT5maXJzdF9nbHlwaC0+dS5jbXAuYXV0b21hdGljKSkKKyAgICAg ICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IDE7CisgICAgICBlbHNlCisgICAgICAgIG1jX25z X21heWJlX2R1bXBnbHlwaHNfYmFja2dyb3VuZCAocywgcy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0g Q09NUE9TSVRFX0dMWVBIKTsKKyAgICAgIC8qIC4uLiAqLworICAgICAgLyogTm90IHlldCBpbXBs ZW1lbnRlZC4gKi8KKyAgICAgIC8qIC4uLiAqLworICAgICAgbnNfcmVzZXRfY2xpcHBpbmcgKHMt PmYpOworICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOwor ICAgIH0KKyAgLyogRHJhdyBib3ggaWYgbm90IGRvbmUgYWxyZWFkeS4gKi8KKyAgaWYgKCFzLT5m b3Jfb3ZlcmxhcHMgJiYgIWJveF9kcmF3bl9wICYmIHMtPmZhY2UtPmJveCAhPSBGQUNFX05PX0JP WCkKKyAgICB7CisgICAgICBuID0gbnNfZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsIHIp OworICAgICAgaWYgKCFuc19jbGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4pKQorICAgICAgICByZXR1 cm47CisgICAgICBuc19kdW1wZ2x5cGhzX2JveF9vcl9yZWxpZWYgKHMpOworICAgICAgbnNfcmVz ZXRfY2xpcHBpbmcgKHMtPmYpOworICAgIH0KKyAgcy0+bnVtX2NsaXBzID0gMDsKK30KKworLyog ZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC8q ID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09CiAKICAgIE5TVFJBQ0UsIFRyYWNlIHN1cHBvcnQuCkBAIC0xMTA5 LDYgKzIwODIsMTYgQEAgc3RhdGljIE5TUmVjdCBjb25zdHJhaW5fZnJhbWVfcmVjdChOU1JlY3Qg ZnJhbWVSZWN0LCBib29sIGlzRnVsbHNjcmVlbikKICAgIGV4dGVybmFsIChSSUYpIGNhbGw7IHdo b2xlIGZyYW1lLCBjYWxsZWQgYmVmb3JlIHVwZGF0ZV93aW5kb3dfYmVnaW4KICAgIC0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tICovCiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBmOworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAjaWZkZWYgTlNfSU1QTF9DT0NPQQogICBFbWFjc1ZpZXcgKnZp ZXcgPSBGUkFNRV9OU19WSUVXIChmKTsKIApAQCAtMTIwOSw2ICsyMTkyLDE2IEBAIHN0YXRpYyBO U1JlY3QgY29uc3RyYWluX2ZyYW1lX3JlY3QoTlNSZWN0IGZyYW1lUmVjdCwgYm9vbCBpc0Z1bGxz Y3JlZW4pCiAKIC8qICAgaWYgKGYgPT0gTU9VU0VfSExfSU5GTyAoZiktPm1vdXNlX2ZhY2VfbW91 c2VfZnJhbWUpICovCiAgIE1PVVNFX0hMX0lORk8gKGYpLT5tb3VzZV9mYWNlX2RlZmVyID0gMDsK KworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwor ICBmLT5tY191cGRhdGluZ19mcmFtZSA9IE5VTEw7CisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKIH0KIAogCkBAIC00ODAzLDYgKzU3OTYsMTcgQEAgaW4gY2VydGFpbiBzaXR1YXRpb25z IChyYXBpZCBpbmNvbWluZyBldmVudHMpLgogICAgICAgYmFyID0gW1tFbWFjc1Njcm9sbGVyIGFs bG9jXSBpbml0RnJhbWU6IHIgd2luZG93OiB3aW5dOwogICAgICAgd3NldF92ZXJ0aWNhbF9zY3Jv bGxfYmFyICh3aW5kb3csIG1ha2VfbWludF9wdHIgKGJhcikpOwogICAgICAgdXBkYXRlX3AgPSBZ RVM7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKyAgICAgIC8qIFRoaXMgaXMgb25seSBmb3IgZGVidWdnaW5nIHB1cnBvc2VzLiAqLworICAg ICAgW2JhciBtY19zZXRfcmVjdGFuZ2xlOiByXTsKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogICAgIH0KICAgZWxzZQogICAgIHsKQEAgLTQ4MTAsMTIgKzU4MTQsMzAgQEAgaW4gY2Vy dGFpbiBzaXR1YXRpb25zIChyYXBpZCBpbmNvbWluZyBldmVudHMpLgogICAgICAgYmFyID0gWE5T X1NDUk9MTF9CQVIgKHdpbmRvdy0+dmVydGljYWxfc2Nyb2xsX2Jhcik7CiAgICAgICBvbGRSZWN0 ID0gW2JhciBmcmFtZV07CiAgICAgICByLnNpemUud2lkdGggPSBvbGRSZWN0LnNpemUud2lkdGg7 CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK ICAgICAgIGlmIChGUkFNRV9MSVZFX1AgKGYpICYmICFOU0VxdWFsUmVjdHMgKG9sZFJlY3QsIHIp KQogICAgICAgICB7CisgICAgICAgICAgLyogVGhlIG1haW4gd2luZG93IGhhcyBwcm9iYWJseSBi ZWVuIHJlc2l6ZWQuICBHcmFjaW91c2x5IGRlbGV0ZSB0aGUKKyAgICAgICAgICBvbGQgc2Nyb2xs IGJhciB3aXRob3V0IHJlcGFpbnRpbmcgaXRzIHJlY3RhbmdsZTsgYW5kLCBjcmVhdGUgYSBuZXcK KyAgICAgICAgICBzY3JvbGwgYmFyIGVsc2V3aGVyZS4qLwogICAgICAgICAgIGlmIChvbGRSZWN0 Lm9yaWdpbi54ICE9IHIub3JpZ2luLngpCisgICAgICAgICAgICB7CiAgICAgICAgICAgICAgIG5z X2NsZWFyX2ZyYW1lX2FyZWEgKGYsIGxlZnQsIHRvcCwgd2lkdGgsIGhlaWdodCk7CisgICAgICAg ICAgICAgIFtiYXIgbWNfanVkZ2VdOworICAgICAgICAgICAgICBiYXIgPSBbW0VtYWNzU2Nyb2xs ZXIgYWxsb2NdIGluaXRGcmFtZTogciB3aW5kb3c6IHdpbl07CisgICAgICAgICAgICAgIHdzZXRf dmVydGljYWxfc2Nyb2xsX2JhciAod2luZG93LCBtYWtlX21pbnRfcHRyIChiYXIpKTsKKyAgICAg ICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKICAgICAgICAgICBbYmFyIHNldEZyYW1lOiByXTsK ICAgICAgICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgfQogCiAgIGlm ICh1cGRhdGVfcCkKQEAgLTQ5NzUsOSArNTk5Nyw1NyBAQCBpbiBjZXJ0YWluIHNpdHVhdGlvbnMg KHJhcGlkIGluY29taW5nIGV2ZW50cykuCiAgICAgewogICAgICAgdmlldyA9IFtzdWJ2aWV3cyBv YmplY3RBdEluZGV4OiBpXTsKICAgICAgIGlmICghW3ZpZXcgaXNLaW5kT2ZDbGFzczogW0VtYWNz U2Nyb2xsZXIgY2xhc3NdXSkgY29udGludWU7Ci0gICAgICBpZiAoW3ZpZXcganVkZ2VdKQorCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8q IGBYU0VUV0lORE9XJyB3aWxsIHNvbWV0aW1lcyBjYXVzZSBFbWFjcyB0byBjcmFzaCB3aGVuIHJ1 bm5pbmcgdW5kZXIgZ2RiIGV2ZW4KKyAgdGhvdWdoICh3ICE9IE5VTEwpLiAgVGhlcmVmb3JlLCB3 ZSBjYW5ub3QgcmVsaWFibHkgdXNlIGBXSU5ET1dfTElWRV9QJy4gKi8KKyAgc3RydWN0IHdpbmRv dyAqdyA9IFt2aWV3IG1jX2dldF93aW5kb3ddOworICBpZiAodyAhPSBOVUxMCisgICAgICAmJiBO SUxQICh3LT5jb250ZW50cykpCisgICAgeworICAgICAgQk9PTCBkZWJ1Z19wID0gZmFsc2U7Cisg ICAgICBpZiAoZGVidWdfcAorICAgICAgICAgIC8qIGB3aW5kb3dfYm94JyBjYWxscyBgd2luZG93 X2JveF9oZWlnaHQnLCB3aGljaCB3aWxsIGNhdXNlIEVtYWNzIHRvCisgICAgICAgICAgY3Jhc2gg aWYgRlJBTUVQICh3LT5mcmFtZSkgaXMgbm90IHNhdGlzZmllZC4gKi8KKyAgICAgICAgICAmJiBG UkFNRVAgKHctPmZyYW1lKSkKKyAgICAgICAgeworICAgICAgICAgIE5TUmVjdCByMCA9IFt2aWV3 IG1jX2dldF9yZWN0YW5nbGVdOworICAgICAgICAgIGludCB4MCA9IE5TTWluWCAocjApOworICAg ICAgICAgIGludCB5MCA9IE5TTWluWSAocjApOworICAgICAgICAgIGludCB3ZDAgPSBOU1dpZHRo IChyMCk7CisgICAgICAgICAgaW50IGgwID0gTlNIZWlnaHQgKHIwKTsKKyAgICAgICAgICBpbnQg d2luZG93X3ksIHdpbmRvd19oZWlnaHQ7CisgICAgICAgICAgd2luZG93X2JveCAodywgQU5ZX0FS RUEsIDAsICZ3aW5kb3dfeSwg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DAsIHdk MSwgaDAsIGgxKTsKKyAgICAgICAgfQorICAgICAgaWYgKFt2aWV3IG1jX2p1ZGdlXSkKICAgICAg ICAgcmVtb3ZlZCA9IFlFUzsKICAgICB9CisgICAgZWxzZSBpZiAoW3ZpZXcganVkZ2VdKQorICAg ICAgcmVtb3ZlZCA9IFlFUzsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKworICAgIH0K IAogICBpZiAocmVtb3ZlZCkKICAgICBbZXZpZXcgdXBkYXRlRnJhbWVTaXplOiBOT107CkBAIC01 MTA2LDYgKzYxNzYsMjEgQEAgc3RhdGljIExpc3BfT2JqZWN0IG5zX3N0cmluZ190b19saXNwbW9k IChjb25zdCBjaGFyICpzKQogZXh0ZXJuIGZyYW1lX3Bhcm1faGFuZGxlciBuc19mcmFtZV9wYXJt X2hhbmRsZXJzW107CiBzdGF0aWMgc3RydWN0IHJlZGlzcGxheV9pbnRlcmZhY2UgbnNfcmVkaXNw bGF5X2ludGVyZmFjZSA9CiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgbnN0ZXJtLm1g IG11c3QgYmUgaW4gdGhlIGV4YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitgcmVkaXNwbGF5X2ludGVy ZmFjZScgaW4gYGRpc3BleHRlcm4uaGAhICovCisKKyAgbWNfeF93cml0ZV9nbHlwaHMsCisgIG1j X25zX2RyYXdfd2luZG93X2N1cnNvciwKKyAgbWNfbnNfZHJhd19nbHlwaF9zdHJpbmcsCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKICAgbnNfZnJhbWVfcGFybV9oYW5kbGVycywKICAg eF9wcm9kdWNlX2dseXBocywKICAgeF93cml0ZV9nbHlwaHMsCkBAIC04NzIxLDYgKzk4MDYsNDkg QEAgLSAoQk9PTCljYW5CZWNvbWVNYWluV2luZG93CiAKIEBpbXBsZW1lbnRhdGlvbiBFbWFjc1Nj cm9sbGVyCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JT ICovCisKKy0gKHZvaWQpbWNfc2V0X3JlY3RhbmdsZTogKE5TUmVjdClyZWN0Cit7CisgIG1jX3Jl Y3RhbmdsZSA9IHJlY3Q7Cit9CisKKy0gKE5TUmVjdCltY19nZXRfcmVjdGFuZ2xlCit7CisgIHJl dHVybiBtY19yZWN0YW5nbGU7Cit9CisKKy0gKHN0cnVjdCB3aW5kb3cgKiltY19nZXRfd2luZG93 Cit7CisgIHJldHVybiB3aW5kb3c7Cit9CisKKy0gKGJvb2wpbWNfanVkZ2UKK3sKKyAgTlNUUkFD RSAoIltFbWFjc1Njcm9sbGVyIG1jX2p1ZGdlXSIpOworICBib29sIHJldCA9IGNvbmRlbW5lZDsK KyAgYmxvY2tfaW5wdXQgKCk7CisgIGlmIChjb25kZW1uZWQpCisgICAgeworICAgICAgLyogZW5z dXJlIG90aGVyIHNjcm9sbGJhciB1cGRhdGVzIGFmdGVyIGRlbGV0aW9uICovCisgICAgICBFbWFj c1ZpZXcgKnZpZXcgPSAoRW1hY3NWaWV3ICopRlJBTUVfTlNfVklFVyAoZnJhbWUpOworICAgICAg aWYgKHZpZXcgIT0gbmlsKQorICAgICAgICB2aWV3LT5zY3JvbGxiYXJzTmVlZGluZ1VwZGF0ZSsr OworICAgIH0KKyAgaWYgKHdpbmRvdykKKyAgICB3c2V0X3ZlcnRpY2FsX3Njcm9sbF9iYXIgKHdp b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SBTVFJFVENIX0dMWVBIKTsKKyAgaWYg KHMtPmhsID09IERSQVdfQ1VSU09SCisgICAgICAmJiAheF9zdHJldGNoX2N1cnNvcl9wKQorICAg IHsKKyAgICAgIC8qIElmIGB4LXN0cmV0Y2gtY3Vyc29yJyBpcyBuaWwsIGRvbid0IGRyYXcgYSBi bG9jayBjdXJzb3IgYXMKKyAgIHdpZGUgYXMgdGhlIHN0cmV0Y2ggZ2x5cGguICAqLworICAgICAg aW50IHdpZHRoLCBiYWNrZ3JvdW5kX3dpZHRoID0gcy0+YmFja2dyb3VuZF93aWR0aDsKKyAgICAg IGludCB4ID0gcy0+eDsKKyAgICAgIGlmICghcy0+cm93LT5yZXZlcnNlZF9wKQorICAgICAgICB7 CisgICAgICAgICAgaW50IGxlZnRfeCA9IHdpbmRvd19ib3hfbGVmdF9vZmZzZXQgKHMtPncsIFRF WFRfQVJFQSk7CisgICAgICAgICAgaWYgKHggPCBsZWZ0X3gpCisgICAgICAgICAgICB7CisgICAg ICAgICAgICAgIGJhY2tncm91bmRfd2lkdGggLT0gbGVmdF94IC0geDsKKyAgICAgICAgICAgICAg eCA9IGxlZnRfeDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgIGVsc2UKKyAgICAg ICAgeworICAgICAgICAgIC8qIEluIFIyTCByb3dzLCBkcmF3IHRoZSBjdXJzb3Igb24gdGhlIHJp Z2h0IGVkZ2Ugb2YgdGhlCisgICAgICAgICAgICAgc3RyZXRjaCBnbHlwaC4gICovCisgICAgICAg ICAgaW50IHJpZ2h0X3ggPSB3aW5kb3dfYm94X3JpZ2h0IChzLT53LCBURVhUX0FSRUEpOworICAg ICAgICAgIGlmICh4ICsgYmFja2dyb3VuZF93aWR0aCA+IHJpZ2h0X3gpCisgICAgICAgICAgICBi YWNrZ3JvdW5kX3dpZHRoIC09IHggLSByaWdodF94OworICAgICAgICAgIHggKz0gYmFja2dyb3Vu ZF93aWR0aDsKKyAgICAgICAgfQorICAgICAgd2lkdGggPSBtaW4gKEZSQU1FX0NPTFVNTl9XSURU SCAocy0+ZiksIGJhY2tncm91bmRfd2lkdGgpOworICAgICAgaWYgKHMtPnJvdy0+cmV2ZXJzZWRf cCkKKyAgICAgICAgeCAtPSB3aWR0aDsKKyAgICAgIC8qIERyYXcgY3Vyc29yLiAgKi8KKyAgICAg IHhfZHJhd19nbHlwaF9zdHJpbmdfYmdfcmVjdCAocywgeCwgcy0+eSwgd2lkdGgsIHMtPmhlaWdo dCk7CisgICAgICAvKiBDbGVhciByZXN0IHVzaW5nIHRoZSBHQyBvZiB0aGUgb3JpZ2luYWwgbm9u LWN1cnNvciBmYWNlLiAgKi8KKyAgICAgIGlmICh3aWR0aCA8IGJhY2tncm91bmRfd2lkdGgpCisg ICAgICAgIHsKKyAgICAgICAgICBYR0NWYWx1ZXMgKmdjID0gcy0+ZmFjZS0+Z2M7CisgICAgICAg ICAgaW50IHkgPSBzLT55OworICAgICAgICAgIGludCB3ID0gYmFja2dyb3VuZF93aWR0aCAtIHdp ZHRoLCBoID0gcy0+aGVpZ2h0OworICAgICAgICAgIFJFQ1QgcjsKKyAgICAgICAgICAgICAgICBI REMgaGRjID0gcy0+aGRjOworICAgICAgICAgIGlmICghcy0+cm93LT5yZXZlcnNlZF9wKQorICAg ICAgICAgICAgeCArPSB3aWR0aDsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB4ID0gcy0+ eDsKKyAgICAgICAgICBpZiAocy0+cm93LT5tb3VzZV9mYWNlX3AKKyAgICAgICAgICAgICAgJiYg Y3Vyc29yX2luX21vdXNlX2ZhY2VfcCAocy0+dykpCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIHhfc2V0X21vdXNlX2ZhY2VfZ2MgKHMpOworICAgICAgICAgICAgICBnYyA9IHMtPmdjOwor ICAgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGdjID0gcy0+ZmFjZS0+ Z2M7CisgICAgICAgICAgZ2V0X2dseXBoX3N0cm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ICAmJiAhY3Vyc29yX2djX2ludmlzaWJs ZV9va2F5X3ApCisgICAgICAgIGN1cnNvcl9jb2xvciA9IGZhY2UtPmZvcmVncm91bmQ7CisgICAg ICBpbnQgZGVmYXVsdF9meCA9IFdJTkRPV19URVhUX1RPX0ZSQU1FX1BJWEVMX1ggKHcsIHgpOwor ICAgICAgaGRjID0gZ2V0X2ZyYW1lX2RjIChmKTsKKyAgICAgIHczMl9jbGlwX3RvX3JvdyAodywg cm93LCBURVhUX0FSRUEsIGhkYyk7CisgICAgICBpbnQgcnggPSBmeDsKKyAgICAgIGludCByeSA9 IGZ5OworICAgICAgaW50IHJ3ID0gd2Q7CisgICAgICBpbnQgcmggPSBoOworLyoKKyAgICBmcHJp bnRmIChzdGRlcnIsICJNQ19IQkFSOiAgZnggKCVkKSB8IGZ5ICglZCkgfCB3ZCAoJWQpIHwgaCAo JWQpXG4iLCByeCwgcnksIHJ3LCByaCk7CisqLworICAgICAgdzMyX2ZpbGxfYXJlYSAoZiwgaGRj LCBjdXJzb3JfY29sb3IsIHJ4LCByeSwgcncsIHJoKTsKKyAgICAgIHczMl9zZXRfY2xpcF9yZWN0 YW5nbGUgKGhkYywgTlVMTCk7CisgICAgICByZWxlYXNlX2ZyYW1lX2RjIChmLCBoZGMpOworICAg IH0KK30KKworLyogUklGOiBEcmF3IG9yIGNsZWFyIGN1cnNvciBvbiB3aW5kb3cgVy4gICovCitz dGF0aWMgdm9pZAorbWNfdzMyX2RyYXdfd2luZG93X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywg c3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAg ICAgICAgICAgICAgICBpbnQgeCwgaW50IGZ4LCBpbnQgeSwgaW50IGZ5LCBpbnQgaHBvcywgaW50 IHZwb3MsIGludCB3ZCwgaW50IGgsCisgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxz bCwgZW51bSBtY19jd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XJldF9oZHJfaGVpZ2h0ID0g V0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgICAgICAgICAgdzMyX3N5c3RlbV9jYXJl dF9tb2RlX2hlaWdodCA9IFdJTkRPV19NT0RFX0xJTkVfSEVJR0hUICh3KTsKKyAgICAgICAgICBQ b3N0TWVzc2FnZSAoaHduZCwgV01fSU1FX1NUQVJUQ09NUE9TSVRJT04sIDAsIDApOworICAgICAg ICAgIC8qIElmIHRoZSBzaXplIG9mIHRoZSBhY3RpdmUgY3Vyc29yIGNoYW5nZWQsIGRlc3Ryb3kg dGhlIG9sZAorICAgICAgICAgICAgIHN5c3RlbSBjYXJldC4gICovCisgICAgICAgICAgaWYgKHcz Ml9zeXN0ZW1fY2FyZXRfaHduZAorICAgICAgICAgICAgICAmJiAodzMyX3N5c3RlbV9jYXJldF9o ZWlnaHQgIT0gaCkpCisgICAgICAgICAgICBQb3N0TWVzc2FnZSAoaHduZCwgV01fRU1BQ1NfREVT VFJPWV9DQVJFVCwgMCwgMCk7CisgICAgICAgICAgdzMyX3N5c3RlbV9jYXJldF9oZWlnaHQgPSBo OworICAgICAgICAgIC8qIE1vdmUgdGhlIHN5c3RlbSBjYXJldC4gICovCisgICAgICAgICAgUG9z dE1lc3NhZ2UgKGh3bmQsIFdNX0VNQUNTX1RSQUNLX0NBUkVULCAwLCAwKTsKKyAgICAgICAgfQor ICAgICAgLyogVGhlIGZyaW5nZSBiaXRtYXBzIGFyZSBwcmVzZW50bHkgaGFuZGxlZCBlbHNld2hl cmUsIGJ1dCBjb3VsZCBzb21lZGF5CisgICAgICBiZSBtYW5hZ2VkIChpbiBwYXJ0KSBhdCB0aGlz IHNlY3Rpb24gb2YgY29kZS4gKi8KKyAgICAgIGlmIChyb3ctPmV4YWN0X3dpbmRvd193aWR0aF9s aW5lX3AKKyAgICAgICAgICAmJiAocm93LT5yZXZlcnNlZF9wCisgICAgICAgICAgICAgPyAoaHBv cyA8IDApCisgICAgICAgICAgICAgOi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19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91 bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgZ2Nf dmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZS0+YmFja2dy b3VuZDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0 aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgYWN0aXZlX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID4gcmVnaW9uX2JlZworICAgICAgICAg ICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3MgPCByZWdpb25fZW5kKQorICAg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0 aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50 ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluLXJlZ2lvbi1wcmUtenYtZmFjZSIpLCB0cnVlKTsK KyAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3 ZWVuX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5f ZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9m YWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1 cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgIC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dHB1dF9kYXRhLnczMi0+ Y3Vyc29yX2djID0gb3JpZ2luYWxfY3Vyc29yX2djOworICAgICAgICAgIHVuYmxvY2tfaW5wdXQg KCk7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzIt PmN1cnNvcl9waXhlbCcuICAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29y X3BpeGVsID0gY29sb3JfcGl4ZWw7CisgICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNv ciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAg ICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29y X3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKGN1cnNvcl9nbHlwaC0+dHlwZSA9 PSBJTUFHRV9HTFlQSCAmJiBsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJs dWUgPj0gMCkKKyAgICAgICAgICB7CisgICAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sg YGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgICAgICBmLT5v dXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAgICAg bWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwg aHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJz b3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgICAgfQorICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgIC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0gaG9sbG93X2FjdGl2ZV9m YWNlLT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICAgICAgICBnY192YWx1ZXMuYmFja2dyb3Vu ZCA9IGhvbGxvd19hY3RpdmVfcmVnaW9uX2VuZF9mYWNlLT5iYWNrZ3JvdW5kOworICAgICAgICAg ICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgZWxzZSBpZiAocmVnaW9uX2FjdGl2ZV9wCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID4gcmVnaW9uX2JlZworICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zIDwgcmVnaW9uX2VuZCkK KyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9p ZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFj ZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluLXJlZ2lvbi1wcmUtenYtZmFj ZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2Fj dGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZl X3JlZ2lvbl9iZXR3ZWVuX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICAgIGVudW0gZmFj ZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50 ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAg ICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01f SUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgZ2Nf dmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAg ICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX3Jl Z2lvbl9iZXR3ZWVuX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVf ZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1j dXJzb3ItcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1 Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0 aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91 bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgICAg ICAgICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IGhvbGxvd19hY3RpdmVfZmFjZS0+YmFja2dyb3Vu ZDsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgZWxzZSBp ZiAoIWFjdGl2ZV9wKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg ICAgICAgICAgICBlbnVtIGZhY2VfaWQ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d2QsIGFjdGl2ZV9wLCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgICAgIGYtPm91dHB1dF9kYXRh LnczMi0+Y3Vyc29yX2djID0gb3JpZ2luYWxfY3Vyc29yX2djOworICAgICAgICAgICAgICB1bmJs b2NrX2lucHV0ICgpOworICAgICAgICAgICAgICBtY193MzJfZHJhd19ob2xsb3dfY3Vyc29yICh3 LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICAg ICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBNQ19IT0xMT1dfQk9YOgorICAg IHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUg Pj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0 cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0 YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAgIG1jX3czMl9kcmF3 X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3Ms IHdkLCBoKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9y aWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAg bWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwg aHBvcywgdnBvcywgd2QsIGgpOworICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfRklM TEVEX0JPWDoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmV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3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOworICAgICAg ICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djID0gb3JpZ2luYWxfY3Vyc29yX2djOwor ICAgICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAg ICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX3AgPSBmYWxzZTsKKyAgICAgICAg ICAgIG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywgRFJBV19DVVJTT1IsIHgs IGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNsLCBnbHlw aF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgY3Vyc29yX2djX3ApOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOwor ICAgIH0KKyAgICBjYXNlIE1DX0JBUjoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYm IGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAv KiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4g ICovCisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBjb2xvcl9w aXhlbDsKKyAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gdHJ1ZTsK KyAgICAgICAgICBtY193MzJfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngs IHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0JBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOwor ICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vy c29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAg ICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7CisgICAgICAgICAg ICBtY193MzJfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBo cG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGgsIGN1 cnNvcl93aWR0aCwgTUNfQkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAg ICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfSEJBUjoKKyAgICB7CisgICAg ICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisg ICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRh LnczMi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5j dXJzb3JfcGl4ZWwgPSBjb2xvcl9waXhlbDsKKyAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZp c2libGVfb2theV9wID0gdHJ1ZTsKKyAgICAgICAgICBtY193MzJfZHJhd19iYXJfY3Vyc29yICh3 LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0hCQVIsIGN1cnNvcl9n Y19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNv cl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNl CisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlf cCA9IGZhbHNlOworICAgICAgICAgICAgbWNfdzMyX2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4 LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0hCQVIsIGN1cnNvcl9nY19pbnZp c2libGVfb2theV9wKTsKKyAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgZGVm YXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOworICB9CisgICAgfQorfQorCisvKiBEcmF3IGds eXBoIHN0cmluZyBTLiAgKi8KK3N0YXRpYyB2b2lkCittY193MzJfZHJhd19nbHlwaF9zdHJpbmcg KHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3Ry dWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNf UkdCIGxzbCwgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yLAorICAgICAgICAgICAgICAgICAg ICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlLCBpbnQgY3Vyc29yX3dpZHRo LAorICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGFjdGl2ZV9wLCBib29sIGN1cnNvcl9n Y19wKQoreworICBib29sIHJlbGllZl9kcmF3bl9wID0gMDsKKyAgLyogSWYgUyBkcmF3cyBpbnRv IHRoZSBiYWNrZ3JvdW5kIG9m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2x5cGgtPnUuY21wLmF1dG9tYXRpYykp CisgICAgICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVlOworICAgICAgZWxzZQorICAg ICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKHMsIHRydWUpOworICAgICAgeF9k cmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAgICBicmVhazsK KyAgICBjYXNlIEdMWVBITEVTU19HTFlQSDoKKyAgICAgIGlmIChzLT5mb3Jfb3ZlcmxhcHMpCisg ICAgICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVlOworICAgICAgZWxzZQorICAgICAg ICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKHMsIGZhbHNlKTsKKyAgICAgIHhfZHJh d19nbHlwaGxlc3NfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHMpOworICAgICAgYnJlYWs7Cisg ICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOworICAgIH0KKyAgaWYgKCFzLT5mb3Jf b3ZlcmxhcHMpCisgICAgeworICAgICAgLyogRHJhdyB1bmRlcmxpbmUuICAqLworICAgICAgaWYg KHMtPmZhY2UtPnVuZGVybGluZV9wKQorICAgICAgICB7CisgICAgICAgICAgaWYgKHMtPmZhY2Ut PnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfV0FWRSkKKyAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgQ09MT1JSRUYgY29sb3I7CisgICAgICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRl cmxpbmVfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICAgICAgY29sb3IgPSBzLT5nYy0+Zm9yZWdy b3VuZDsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIGNvbG9yID0gcy0+ZmFj ZS0+dW5kZXJsaW5lX2NvbG9yOworICAgICAgICAgICAgICB3MzJfZHJhd191bmRlcndhdmUgKHMs IGNvbG9yKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmIChzLT5mYWNlLT51bmRl cmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIHVuc2lnbmVkIGxvbmcgdGhpY2tuZXNzLCBwb3NpdGlvbjsKKyAgICAgICAgICAgICAgaW50 IHk7CisgICAgICAgICAgICAgIGlmIChzLT5wcmV2ICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGlu ZV9wCisgICAgICAgICAgICAgICAgICAmJiBzLT5wcmV2LT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9 PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg LyogV2UgdXNlIHRoZSBzYW1lIHVuZGVybGluZSBzdHlsZSBhcyB0aGUgcHJldmlvdXMgb25lLiAg Ki8KKyAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPnByZXYtPnVuZGVybGluZV90aGlj a25lc3M7CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPnByZXYtPnVuZGVybGluZV9w b3NpdGlvbjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVybGluZSB0aGlja25l c3MuICBEZWZhdWx0IGlzIDEgcGl4ZWwuICAqLworICAgICAgICAgICAgICAgICAgaWYgKHMtPmZv bnQgJiYgcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzcyA+IDApCisgICAgICAgICAgICAgICAg ICAgIHRoaWNrbmVzcyA9IHMtPmZvbnQtPnVuZGVybGluZV90aGlja25lc3M7CisgICAgICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IDE7CisgICAgICAg ICAgICAgICAgICBpZiAoeF91bmRlcmxpbmVfYXRfZGVzY2VudF9saW5lKQorICAgICAgICAgICAg ICAgICAgICBwb3NpdGlvbiA9IChzLT5oZWlnaHQgLSB0aGlja25lc3MpIC0gKHMtPnliYXNlIC0g cy0+eSk7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVybGluZSBwb3NpdGlvbi4gIFRoaXMg aXMgdGhlIHJlY29tbWVuZGVkCisgICAgICAgICAgICAgICAgICAgICAgICAgdmVydGljYWwgb2Zm c2V0IGluIHBpeGVscyBmcm9tIHRoZSBiYXNlbGluZSB0byB0aGUgdG9wIG9mCisgICAgICAgICAg ICAgICAgICAgICAgICAgdGhlIHVuZGVybGluZS4gIFRoaXMgaXMgYSBzaWduZWQgdmFsdWUgYWNj b3JkaW5nIHRvIHRoZQorICAgICAgICAgICAgICAgICAgICAgICAgIHNwZWNzLCBhbmQgaXRzIGRl ZmF1bHQgaXMKKyAgICAgICAgICAgICAgICAgICAgICAgICBST1VORCAoKG1heGltdW1fZGVzY2Vu dCkgLyAyKSwgd2l0aAorICAgICAgICAgICAgICAgICAgICAgICAgIFJPVU5EICh4KSA9IGZsb29y ICh4ICsgMC41KSAgKi8KKyAgICAgICAgICAgICAgICAgICAgICBpZiAoeF91c2VfdW5kZXJsaW5l X3Bvc2l0aW9uX3Byb3BlcnRpZXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcy0+Zm9u dCAmJiBzLT5mb250LT51bmRlcmxpbmVfcG9zaXRpb24gPj0gMCkKKyAgICAgICAgICAgICAgICAg ICAgICAgIHBvc2l0aW9uID0gcy0+Zm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAg ICAgICAgICAgICAgIGVsc2UgaWYgKHMtPmZvbnQpCisgICAgICAgICAgICAgICAgICAgICAgICBw b3NpdGlvbiA9IChzLT5mb250LT5kZXNjZW50ICsgMSkgLyAyOworICAgICAgICAgICAgICAgICAg ICB9CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IG1heCAocG9zaXRpb24sIHVuZGVybGlu ZV9taW5pbXVtX29mZnNldCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAvKiBD aGVjayB0aGUgc2FuaXR5IG9mIHRoaWNrbmVzcyBhbmQgcG9zaXRpb24uICBXZSBzaG91bGQKKyAg ICAgICAgICAgICAgICAgYXZvaWQgZHJhd2luZyB1bmRlcmxpbmUgb3V0IG9mIHRoZSBjdXJyZW50 IGxpbmUgYXJlYS4gICovCisgICAgICAgICAgICAgIGlmIChzLT55ICsgcy0+aGVpZ2h0IDw9IHMt PnliYXNlICsgcG9zaXRpb24pCisgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+aGVpZ2h0 IC0gMSkgLSAocy0+eWJhc2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgaWYgKHMtPnkgKyBzLT5o ZWlnaHQgPCBzLT55YmFzZSArIHBvc2l0aW9uICsgdGhpY2tuZXNzKQorICAgICAgICAgICAgICAg IHRoaWNrbmVzcyA9IChzLT55ICsgcy0+aGVpZ2h0KSAtIChzLT55YmFzZSArIHBvc2l0aW9uKTsK KyAgICAgICAgICAgICAgcy0+dW5kZXJsaW5lX3RoaWNrbmVzcyA9IHRoaWNrbmVzczsKKyAgICAg ICAgICAgICAgcy0+dW5kZXJsaW5lX3Bvc2l0aW9uID1wb3NpdGlvbjsKKyAgICAgICAgICAgICAg eSA9IHMtPnliYXNlICsgcG9zaXRpb247CisgICAgICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRl cmxpbmVfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwg cy0+aGRjLCBzLT5nYy0+Zm9yZWdyb3VuZCwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICB5LCBzLT53aWR0aCwgMSk7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmZhY2UtPnVuZGVybGluZV9jb2xv ciwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5LCBzLT53aWR0aCwgMSk7 CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIC8qIERyYXcgb3ZlcmxpbmUuICAqLwor ICAgICAgaWYgKHMtPmZhY2UtPm92ZXJsaW5lX3ApCisgICAgICAgIHsKKyAgICAgICAgICB1bnNp Z25lZCBsb25nIGR5ID0gMCwgaCA9IDE7CisgICAgICAgICAgaWYgKHMtPmZhY2UtPm92ZXJsaW5l X2NvbG9yX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+ aGRjLCBzLT5nYy0+Zm9yZWdyb3VuZCwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg IHMtPnkgKyBkeSwgcy0+d2lkdGgsIGgpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmZhY2UtPm92ZXJsaW5lX2NvbG9yLCBz LT54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzLT55ICsgZHksIHMtPndpZHRoLCBo KTsKKyAgICAgICAgfQorICAgICAgLyogRHJhdyBzdHJpa2UtdGhyb3VnaC4gICovCisgICAgICBp ZiAocy0+ZmFjZS0+c3RyaWtlX3Rocm91Z2hfcAorICAgICAgICAgICYmICFGT05UX1RFWFRNRVRS SUMgKHMtPmZvbnQpLnRtU3RydWNrT3V0KQorICAgICAgICB7CisgICAgICAgICAgdW5zaWduZWQg bG9uZyBoID0gMTsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIGR5ID0gKHMtPmhlaWdodCAtIGgp IC8gMjsKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+c3RyaWtlX3Rocm91Z2hfY29sb3JfZGVmYXVs dGVkX3ApCisgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmdjLT5m b3JlZ3JvdW5kLCBzLT54LCBzLT55ICsgZHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICBz LT53aWR0aCwgaCk7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAo cy0+Ziwgcy0+aGRjLCBzLT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9jb2xvciwgcy0+eCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgIHMtPnkgKyBkeSwgcy0+d2lkdGgsIGgpOworICAgICAgICB9 CisgICAgICAvKiBEcmF3IHJlbGllZiBpZiBub3QgeWV0IGRyYXduLiAgKi8KKyAgICAgIGlmICgh cmVsaWVmX2RyYXduX3AgJiYgcy0+ZmFjZS0+Ym94ICE9IEZBQ0VfTk9fQk9YKQorICAgICAgICB4 X2RyYXdfZ2x5cGhfc3RyaW5nX2JveCAocyk7CisgICAgICBpZiAocy0+cHJldikKKyAgICAgICAg eworICAgICAgICAgIHN0cnVjdCBnbHlwaF9zdHJpbmcgKnByZXY7CisgICAgICAgICAgZm9yIChw cmV2ID0gcy0+cHJldjsgcHJldjsgcHJldiA9IHByZXYtPnByZXYpCisgICAgICAgICAgICBpZiAo cHJldi0+aGwgIT0gcy0+aGwKKyAgICAgICAgICAgICAgICAmJiBwcmV2LT54ICsgcHJldi0+d2lk dGggKyBwcmV2LT5yaWdodF9vdmVyaGFuZyA+IHMtPngpCisgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAvKiBBcyBwcmV2IHdhcyBkcmF3biB3aGlsZSBjbGlwcGVkIHRvIGl0cyBvd24g YXJlYSwgd2UKKyAgICAgICAgICAgICAgICAgICBtdXN0IGRyYXcgdGhlIHJpZ2h0X292ZXJoYW5n IHBhcnQgdXNpbmcgcy0+aGwgbm93LiAgKi8KKyAgICAgICAgICAgICAgICBlbnVtIGRyYXdfZ2x5 cGhzX2ZhY2Ugc2F2ZSA9IHByZXYtPmhsOworICAgICAgICAgICAgICAgIHByZXYtPmhsID0gcy0+ aGw7CisgICAgICAgICAgICAgICAgbWNfdzMyX3NldF9nbHlwaF9zdHJpbmdfZ2MgKHByZXYsIGN1 cnNvcl9nY19wKTsKKyAgICAgICAgICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdf ZXhhY3RseSAocywgcHJldik7CisgICAgICAgICAgICAgICAgaWYgKHByZXYtPmZpcnN0X2dseXBo LT50eXBlID09IENIQVJfR0xZUEgpCisgICAgICAgICAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3Ry aW5nX2ZvcmVncm91bmQgKHByZXYpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICAgIHhfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHByZXYpOwor ICAgICAgICAgICAgICAgIHczMl9zZXRfY2xpcF9yZWN0YW5nbGUgKHByZXYtPmhkYywgTlVMTCk7 CisgICAgICAgICAgICAgICAgcHJldi0+aGwgPSBzYXZlOworICAgICAgICAgICAgICAgIHByZXYt Pm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKHMt Pm5leHQpCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpuZXh0Owor ICAgICAgICAgIGZvciAobmV4dCA9IHMtPm5leHQ7IG5leHQ7IG5leHQgPSBuZXh0LT5uZXh0KQor ICAgICAgICAgICAgaWYgKG5leHQtPmhsICE9IHMtPmhsCisgICAgICAgICAgICAgICAgJiYgbmV4 dC0+eCAtIG5leHQtPmxlZnRfb3ZlcmhhbmcgPCBzLT54ICsgcy0+d2lkdGgpCisgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAvKiBBcyBuZXh0IHdpbGwgYmUgZHJhd24gd2hpbGUgY2xp cHBlZCB0byBpdHMgb3duIGFyZWEsCisgICAgICAgICAgICAgICAgICAgd2UgbXVzdCBkcmF3IHRo ZSBsZWZ0X292ZXJoYW5nIHBhcnQgdXNpbmcgcy0+aGwgbm93LiAgKi8KKyAgICAgICAgICAgICAg ICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2Ugc2F2ZSA9IG5leHQtPmhsOworICAgICAgICAgICAgICAg IG5leHQtPmhsID0gcy0+aGw7CisgICAgICAgICAgICAgICAgbWNfdzMyX3NldF9nbHlwaF9zdHJp bmdfZ2MgKG5leHQsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICAgICAgICB4X3NldF9nbHlwaF9z dHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywgbmV4dCk7CisgICAgICAgICAgICAgICAgaWYgKG5l eHQtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgpCisgICAgICAgICAgICAgICAgICB4 X2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5leHQpOworICAgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICAgIHhfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVn cm91bmQgKG5leHQpOworICAgICAgICAgICAgICAgIHczMl9zZXRfY2xpcF9yZWN0YW5nbGUgKG5l eHQtPmhkYywgTlVMTCk7CisgICAgICAgICAgICAgICAgbmV4dC0+aGwgPSBzYXZlOworICAgICAg ICAgICAgICAgIG5leHQtPm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgICAgICAgbmV4dC0+Y2xp cF9oZWFkID0gcy0+bmV4dDsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAv KiBSZXNldCBjbGlwcGluZy4gICovCisgIHczMl9zZXRfY2xpcF9yZWN0YW5nbGUgKHMtPmhkYywg TlVMTCk7CisgIHMtPm51bV9jbGlwcyA9IDA7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JT ICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBGcmluZ2UgYml0bWFwcy4gICov CiAKIHN0YXRpYyBpbnQgbWF4X2ZyaW5nZV9ibXAgPSAwOwpAQCAtNTQ1LDYgKzE0MTcsMTUgQEAg eF91cGRhdGVfYmVnaW4gKHN0cnVjdCBmcmFtZSAqZikKICAgaWYgKCEgRlJBTUVfVzMyX1AgKGYp KQogICAgIHJldHVybjsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExF LUNVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGluZ19mcmFtZSA9IGY7CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKICAgLyogUmVnZW5lcmF0ZSBkaXNwbGF5IHBhbGV0dGUgYmVmb3Jl IGRyYXdpbmcgaWYgbGlzdCBvZiByZXF1ZXN0ZWQKICAgICAgY29sb3JzIGhhcyBjaGFuZ2VkLiAq LwogICBpZiAoZGlzcGxheV9pbmZvLT5yZWdlbl9wYWxldHRlKQpAQCAtNzU0LDYgKzE2MzUsMTYg QEAgeF91cGRhdGVfZW5kIChzdHJ1Y3QgZnJhbWUgKmYpCiAKICAgLyogTW91c2UgaGlnaGxpZ2h0 IG1heSBiZSBkaXNwbGF5ZWQgYWdhaW4uICAqLwogICBNT1VTRV9ITF9JTkZPIChmKS0+bW91c2Vf ZmFjZV9kZWZlciA9IGZhbHNlOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gTlVMTDsKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAKQEAgLTQwNDEsMTMgKzQ5MzIsNzQgQEAg dzMyX3NldF92ZXJ0aWNhbF9zY3JvbGxfYmFyIChzdHJ1Y3Qgd2luZG93ICp3LAogCSAgICAgIHJl bGVhc2VfZnJhbWVfZGMgKGYsIGhkYyk7CiAJICAgICAgeF9jbGVhcl91bmRlcl9pbnRlcm5hbF9i b3JkZXIgKGYpOwogCSAgICB9CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdp biBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIFJFUEFJTlRJTkcgV0hFTiBSRU1PVklORyBTQ1JP TEwgQkFSOgorCistIFNlcXVlbmNlIG9mIEV2ZW50czoKKworICAuIGByZWRpc3BsYXlfaW50ZXJu YWwnIGNhbGxzIHRoZSBgY29uZGVtbl9zY3JvbGxfYmFyc19ob29rJywgd2hpY2ggbWFya3MgYWxs CisgICAgc2Nyb2xsIGJhcnMgYXMgY2FuZGlkYXRlcyBmb3IgZGVsZXRpb24uCisKKyAgLiBUaGVu IGByZWRpc3BsYXlfaW50ZXJuYWwnIGNhbGxzIGByZWRpc3BsYXlfd2luZG93cycsIHdoaWNoIHdh bGtzIHRoZQorICAgIHdpbmRvdy10cmVlIGFuZCBleGFtaW5lcyBlYWNoIHdpbmRvdywgd2hlcmVi eSBlYWNoIHdpbmRvdyB0aGF0IGlzIHN0aWxsIGFsaXZlCisgICAgaW4gdGhlIHdpbmRvdy10cmVl ICJyZWRlZW1zIiBpdHMgc2Nyb2xsI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gICAgYXJlYSBvZiB0aGUgcGFyZW50IHdpbmRvdyBub3cgZXhwb3NlZCB3aWxsIGJl IHJlZnJlc2hlZC4gICovCi0gICAgICAgICAgbXlfc2hvd193aW5kb3cgKGYsIGh3bmQsIFNXX0hJ REUpOwotLyoqICAgICAgICAgICBNb3ZlV2luZG93IChod25kLCBsZWZ0LCB0b3AsIHdpZHRoLCBt YXggKGhlaWdodCwgMSksIFRSVUUpOyAqKi8KLQkgIC8qIFRyeSB0byBub3QgZHJhdyBvdmVyIGNo aWxkIGZyYW1lcy4gICovCi0JICBTZXRXaW5kb3dQb3MgKGh3bmQsIEhXTkRfQk9UVE9NLCBsZWZ0 LCB0b3AsIHdpZHRoLCBtYXggKGhlaWdodCwgMSksCi0gICAgICAgICAgICAgICAgICAgICAgICBT V1BfRlJBTUVDSEFOR0VEKTsKKyAgICAgICAgICBpZiAobGVmdCA8PSBiYXItPmxlZnQpCisgICAg ICAgICAgICBteV9zaG93X3dpbmRvdyAoZiwgaHduZCwgU1dfSElERSk7CisgICAgICAgICAgTW92 ZVdpbmRvdyAoaHduZCwgbGVmdCwgdG9wLCB3aWR0aCwgbWF4IChoZWlnaHQsIDEpLCBsZWZ0IDw9 IGJhci0+bGVmdCk7CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKwogCiAJICBzaS5jYlNpemUgPSBzaXplb2YgKHNpKTsKIAkgIHNpLmZNYXNr ID0gU0lGX1JBTkdFOwpAQCAtNDMxNiw2ICs1MjY4LDIxIEBAIHczMl9qdWRnZV9zY3JvbGxfYmFy cyAoc3RydWN0IGZyYW1lICpmKQogICAgIHsKICAgICAgIHN0cnVjdCBzY3JvbGxfYmFyICpiID0g WFNDUk9MTF9CQVIgKGJhcik7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKyAgICAgIC8qIGBEZXN0cm95V2luZG93JyB3aXRoaW4gYHhfc2Ny b2xsX2Jhcl9yZW1vdmUnIHJlcGFpbnRzIHRoZSByZWN0YW5nbGUuCisgICAgICBUaGVyZWZvcmUs IHdlIGZpcnN0IHNlbmQgYSBtZXNzYWdlIHRvIGluaGliaXQgcmVwYWludGluZy4gKi8KKyAgICAg IGlmICghV0lORE9XX0xJVkVfUCAoYi0+d2luZG93KSkKKyAgICAgICAgeworICAgICAgICAgIEhX TkQgaHduZCA9IFNDUk9MTF9CQVJfVzMyX1dJTkRPVyAoYik7CisgICAgICAgICAgU2VuZE1lc3Nh Z2UgKGh3bmQsIFdNX1NFVFJFRFJBVywgZmFsc2UsIDApOworICAgICAgICB9CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgICAgIHhfc2Nyb2xsX2Jhcl9yZW1vdmUgKGIpOwogCiAg ICAgICBuZXh0ID0gYi0+bmV4dDsKQEAgLTcwOTEsNiArODA1OCwyMSBAQCBleHRlcm4gZnJhbWVf cGFybV9oYW5kbGVyIHczMl9mcmFtZV9wYXJtX2hhbmRsZXJzW107CiAKIHN0YXRpYyBzdHJ1Y3Qg cmVkaXNwbGF5X2ludGVyZmFjZSB3MzJfcmVkaXNwbGF5X2ludGVyZmFjZSA9CiB7CisKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRp c3BsYXlfaW50ZXJmYWNlJyBpbiBgdzMydGVybS5jYCBtdXN0IGJlIGluIHRoZSBleGFjdCBzYW1l IG9yZGVyIGFzIHRoZQorYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGBkaXNwZXh0ZXJuLmhgISAq LworCisgIG1jX3hfd3JpdGVfZ2x5cGhzLAorICBtY193MzJfZHJhd193aW5kb3dfY3Vyc29yLAor ICBtY193MzJfZHJhd19nbHlwaF9zdHJpbmcsCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor CisKICAgdzMyX2ZyYW1lX3Bhcm1faGFuZGxlcnMsCiAgIHhfcHJvZHVjZV9nbHlwaHMsCiAgIHhf d3JpdGVfZ2x5cGhzLApkaWZmIC0tZ2l0IGEvc3JjL3dpbmRvdy5oIGIvc3JjL3dpbmRvdy5oCmlu ZGV4IGZkZWY0MDcuLjJiMGI5YjQgMTAwNjQ0Ci0tLSBhL3NyYy93aW5kb3cuaAorKysgYi9zcmMv d2luZG93LmgKQEAgLTMyNCw2ICszMjQsMTQ3IEBAIHN0cnVjdCB3aW5kb3cKIAogI2lmZGVmIEhB VkVfV0lORE9XX1NZU1RFTQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4g TVVMVElQTEUtQ1VSU09SUyAqLworCisvKiBTdWZmaXhlcyBmb3IgdGhlIGBtY2Agd2luZG93IHBv aW50ZXIgcHJlZml4LiAqLworc3RydWN0IG11bHRpcGxlX2N1cnNvcnMKK3sKKyAgLyogVGhlIHJl Y29yZGVkIHBpeGVsIHdpZHRoIG9mIHRoZSBsYXN0IGxpbmUgbnVtYmVyIGRyYXduIGR1cmluZyBy ZWRpc3BsYXkgKi8KKyAgaW50IGxudW1fcGl4ZWxfd2lkdGg7Cit9IG1jOworCitzdHJ1Y3QgbWNf bWF0cml4Cit7CisgIHB0cmRpZmZfdCB2cG9zX2FsbG9jYXRlZDsKKyAgcHRyZGlmZl90IHZwb3Nf dXNlZDsKKyAgcHRyZGlmZl90IGN1cnNvcnNfdXNlZFs0XTsKKyAgZW51bSBtY19jYWNoZV90eXBl CisgIHsKKyAgICBNQ19DQUNIRSwKKyAgICBDSF9DQUNIRSwKKyAgICBGQ19DQUNIRSwKKyAgICBO T19DQUNIRQorICB9IGNhY2hlX3R5cGU7CisgIHN0cnVjdCBtY192cG9zCisgIHsKKyAgICBwdHJk aWZmX3QgY2FjaGVfYWxsb2NhdGVkWzRdOworICAgIHB0cmRpZmZfdCBjYWNoZV91c2VkWzRdOwor ICAgIHN0cnVjdCBtY19jb250ZW50cworICAgIHsKKyAgICAgIGJvb2xfYmYgc2FtZV9wIDogMTsK KyAgICAgIHN0cnVjdCBnbHlwaCBnbHlwaDsKKyAgICAgIGludCB4OworICAgICAgaW50IGZ4Owor ICAgICAgaW50IHk7CisgICAgICBpbnQgZnk7CisgICAgICBpbnQgaHBvczsKKyAgICAgIGludCB2 cG9zOworICAgICAgaW50IHdkOworICAgICAgaW50IGg7CisgICAgICBlbnVtIG1jX2N1cnNvcl90 eXBlCisgICAgICB7CisgICAgICAgIC8qIE5PVEU6ICBUaGUgZnJpbmdlIGJpdG1hcCBmcmFtZXdv cmsgcmVsaWVzIHVwb24gTUNfTk9fRlJJTkdFX0JJVE1BUAorICAgICAgICBoYXZpbmcgYSB2YWx1 ZSBvZiB6ZXJvICgwKS4gKi8KKyAgICAgICAgTUNfTk9fRlJJTkdFX0JJVE1BUCwKKyAgICAgICAg TUNfTk9fQ1VSU09SLAorICAgICAgICBNQ19SSUdIVF9GUklOR0VfQklUTUFQLAorICAgICAgICBN Q19MRUZUX0ZSSU5HRV9CSVRNQVAsCisgICAgICAgIE1DX0ZSQU1FRF9CT1gsCisgICAgICAgIE1D X0ZJTExFRF9CT1gsCisgICAgICAgIE1DX0hPTExPV19CT1gsCisgICAgICAgIE1DX0JBUiwKKyAg ICAgICAgTUNfSEJBUgorICAgICAgfSBjdXJzb3JfdHlwZTsKKyAgICAgIGludCB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dfcm93 X3R5cGUKKyAgeworICAgIFVQREFURV9XSU5ET1dfX1JFRFJBV19PVkVSTEFQUEVEX1JPV1MsCisg ICAgWF9JTlNFUlRfR0xZUEhTLAorICAgIFhfRklYX09WRVJMQVBQSU5HX0FSRUEsCisgICAgRFJB V19ST1dfV0lUSF9NT1VTRV9GQUNFLAorICAgIEVYUE9TRV9BUkVBX09ORSwKKyAgICBFWFBPU0Vf QVJFQV9UV08sCisgICAgRVhQT1NFX0xJTkUKKyAgfSBtY19yZWRyYXdfcm93X3R5cGVfX2Zyb21f d2hlcmU7Cit9IG1jX21hdHJpeDsKKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICAgICAvKiBDdXJzb3IgdHlwZSBvZiBsYXN0IGN1cnNv ciBkcmF3biBvbiB0aGUgd2luZG93LiAgKi8KICAgICBlbnVtIHRleHRfY3Vyc29yX2tpbmRzIHBo eXNfY3Vyc29yX3R5cGU7CiAKZGlmZiAtLWdpdCBhL3NyYy94ZGlzcC5jIGIvc3JjL3hkaXNwLmMK aW5kZXggYTg4ZmM2OS4uM2UxYzY0YSAxMDA2NDQKLS0tIGEvc3JjL3hkaXNwLmMKKysrIGIvc3Jj L3hkaXNwLmMKQEAgLTkyMSw2ICs5MjEsNDY0OSBAQCBzdGF0aWMgdm9pZCBzaG93X21vdXNlX2Zh Y2UgKE1vdXNlX0hMSW5mbyAqLCBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UpOwogc3RhdGljIGJvb2wg Y29vcmRzX2luX21vdXNlX2ZhY2VfcCAoc3RydWN0IHdpbmRvdyAqLCBpbnQsIGludCk7CiAKIAor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUx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IChTVEFSVCwgRU5ELCBIRUFELCBUQUlMLAlcCisJCQkJCSAgICBI TCwgWCwgTEFTVF9YKTsJCVwKKwkgICAgICBlbHNlCQkJCQkJCVwKKwkJTUNfQlVJTERfQ09NUE9T SVRFX0dMWVBIX1NUUklORyAoU1RBUlQsIEVORCwgSEVBRCwgVEFJTCwJXAorCQkJCQkgICAgICBI TCwgWCwgTEFTVF9YKTsJCVwKKwkgICAgICBicmVhazsJCQkJCQkJXAorCQkJCQkJCQkJXAorCSAg ICBjYXNlIFNUUkVUQ0hfR0xZUEg6CQkJCQkJXAorCSAgICAgIE1DX0JVSUxEX1NUUkVUQ0hfR0xZ UEhfU1RSSU5HIChTVEFSVCwgRU5ELCBIRUFELCBUQUlMLAlcCisJCQkJCSAgSEwsIFgsIExBU1Rf WCk7CQlcCisJICAgICAgYnJlYWs7CQkJCQkJCVwKKwkJCQkJCQkJCVwKKwkgICAgY2FzZSBJTUFH RV9HTFlQSDoJCQkJCQlcCisJICAgICAgTUNfQlVJTERfSU1BR0VfR0xZUEhfU1RSSU5HIChTVEFS VCwgRU5ELCBIRUFELCBUQUlMLAkJXAorCQkJCQlITCwgWCwgTEFTVF9YKTsJCQlcCisJICAgICAg YnJlYWs7CisKKyNkZWZpbmUgTUNfQlVJTERfR0xZUEhfU1RSSU5HU19YVyhTVEFSVCwgRU5ELCBI RUFELCBUQUlMLCBITCwgWCwgTEFTVF9YKQlcCisgICAgICAgICAgICBjYXNlIFhXSURHRVRfR0xZ UEg6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAg ICAgIE1DX0JVSUxEX1hXSURHRVRfR0xZUEhfU1RSSU5HIChTVEFSVCwgRU5ELCBIRUFELCBUQUlM LCAgICAgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBITCwg WCwgTEFTVF9YKTsgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgIGJyZWFrOworCisjZGVm aW5lI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JqZWN0CittY19saXN0biAocHRyZGlmZl90IGNv dW50LCBMaXNwX09iamVjdCBhcmcsIC4uLikKK3sKKyAgZWFzc3VtZSAoMCA8IGNvdW50KTsKKyAg TGlzcF9PYmplY3QgdmFsID0gRmNvbnMgKGFyZywgUW5pbCk7CisgIExpc3BfT2JqZWN0IHRhaWwg PSB2YWw7CisgIHZhX2xpc3QgYXA7CisgIHZhX3N0YXJ0IChhcCwgYXJnKTsKKyAgZm9yIChwdHJk aWZmX3QgaSA9IDE7IGkgPCBjb3VudDsgaSsrKQorICAgIHsKKyAgICAgIExpc3BfT2JqZWN0IGVs ZW0gPSBGY29ucyAodmFfYXJnIChhcCwgTGlzcF9PYmplY3QpLCBRbmlsKTsKKyAgICAgIFhTRVRD RFIgKHRhaWwsIGVsZW0pOworICAgICAgdGFpbCA9IGVsZW07CisgICAgfQorICB2YV9lbmQgKGFw KTsKKyAgcmV0dXJuIHZhbDsKK30KKworTGlzcF9PYmplY3QKK21jX21lbXEgKExpc3BfT2JqZWN0 IGVsdCwgTGlzcF9PYmplY3QgbGlzdCkKK3sKKyAgd2hpbGUgKDEpCisgICAgeworICAgICAgaWYg KCFDT05TUCAobGlzdCkgfHwgRVEgKFhDQVIgKGxpc3QpLCBlbHQpKQorICAgICAgICBicmVhazsK KyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpIHx8IEVR IChYQ0FSIChsaXN0KSwgZWx0KSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAo bGlzdCk7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KSB8fCBFUSAoWENBUiAobGlzdCksIGVsdCkp CisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgIH0KKyAgcmV0 dXJuIGxpc3Q7Cit9CisKK0xpc3BfT2JqZWN0CittY19udGggKGludCBudW0sIExpc3BfT2JqZWN0 IGxpc3QpCit7CisgIGZvciAoaW50IGkgPSAwOyBpIDwgbnVtICYmICFOSUxQIChsaXN0KTsgaSsr KQorICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgaWYgKENPTlNQIChsaXN0KSkKKyAgICByZXR1 cm4gWENBUiAobGlzdCk7CisgICAgZWxzZQorICAgICAgcmV0dXJuIFFuaWw7Cit9CisKK0xpc3Bf T2JqZWN0CittY19hc3NxIChMaXNwX09iamVjdCBrZXksIExpc3BfT2JqZWN0IGxpc3QpCit7Cisg IHdoaWxlICgxKQorICAgIHsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAgfHwg KENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgRVEgKFhDQVIgKFhDQVIgKGxp c3QpKSwga2V5KSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOwor ICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3Qp KQorICAgICAgICAgICAgICAmJiBFUSAoWENBUiAoWENBUiAobGlzdCkpLCBrZXkpKSkKKyAgICAg ICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNPTlNQIChs aXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAgICYm IEVRIChYQ0FSIChYQ0FSIChsaXN0KSksIGtleSkpKQorICAgICAgICBicmVhazsKKyAgICAgIGxp c3QgPSBYQ0RSIChsaXN0KTsKKyAgICB9CisgIGlmIChDT05TUCAobGlzdCkpCisgICAgcmV0dXJu IFhDQVIgKGxpc3QpOworICAgIGVsc2UKKyAgICAgIHJldHVybiBRbmlsOworfQorCitMaXNwX09i amVjdAorbWNfYXNzb2MgKExpc3BfT2JqZWN0IGtleSwgTGlzcF9PYmplY3QgbGlzdCkKK3sKKyAg TGlzcF9PYmplY3QgY2FyOworICB3aGlsZSAoMSkKKyAgICB7CisgICAgICBpZiAoIUNPTlNQIChs aXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAgICYm IChjYXIgPSBYQ0FSIChYQ0FSIChsaXN0KSksCisgICAgICAgICAgICAgICAgICBFUSAoY2FyLCBr ZXkpIHx8ICFOSUxQIChGZXF1YWwgKGNhciwga2V5KSkpKSkKKyAgICAgICAgYnJlYWs7CisgICAg ICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KQorICAgICAgICAg IHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAgICYmIChjYXIgPSBYQ0FSIChY Q0FSIChsaXN0KSksCisgICAgICAgICAgICAgICAgICBFUSAoY2FyLCBrZXkpIHx8ICFOSUxQIChG ZXF1YWwgKGNhciwga2V5KSkpKSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAo bGlzdCk7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENB UiAobGlzdCkpCisgICAgICAgICAgICAgICYmIChjYXIgPSBYQ0FSIChYQ0FSIChsaXN0KSksCisg ICAgICAgICAgICAgICAgICBFUSAoY2FyLCBrZXkpIHx8ICFOSUxQIChGZXF1YWwgKGNhciwga2V5 KSkpKSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgfQor ICBpZiAoQ09OU1AgKGxpc3QpKQorICAgIHJldHVybiBYQ0FSIChsaXN0KTsKKyAgICBlbHNlCisg ICAgICByZXR1cm4gUW5pbDsKK30KKworTGlzcF9PYmplY3QKK21jX3BsaXN0X2dldCAoTGlzcF9P YmplY3QgcGxpc3QsIExpc3BfT2JqZWN0IHByb3ApCit7CisgIExpc3BfT2JqZWN0IHRhaWwsIGhh bGZ0YWlsOworICAvKiBoYWxmdGFpbCBpcyB1c2VkIHRvIGRldGVjdCBjaXJjdWxhciBsaXN0cy4g ICovCisgIHRhaWwgPSBoYWxmdGFpbCA9IHBsaXN0OworICB3aGlsZSAoQ09OU1AgKHRhaWwpICYm IENPTlNQIChYQ0RSICh0YWlsKSkpCisgICAgeworICAgICAgaWYgKEVRIChwcm9wLCBYQ0FSICh0 YWlsKSkpCisgICAgICAgIHJldHVybiBYQ0FSIChYQ0RSICh0YWlsKSk7CisgICAgICB0YWlsID0g WENEUiAoWENEUiAodGFpbCkpOworICAgICAgaGFsZnRhaWwgPSBYQ0RSIChoYWxmdGFpbCk7Cisg ICAgICBpZiAoRVEgKHRhaWwsIGhhbGZ0YWlsKSkKKyAgICAgICAgYnJlYWs7CisgICAgfQorICBy ZXR1cm4gUW5pbDsKK30KKworLyogUkVHSU9OIEJFR0lOOiAgbWNfcmVnaW9uX2xpbWl0ICgxKQor ICAgUkVHSU9OIEVORDogIG1jX3JlZ2lvbl9saW1pdCAoMCkgKi8KK3B0cmRpZmZfdAorbWNfcmVn aW9uX2xpbWl0IChib29sIGJlZ2luX3ApCit7CisgIGlmICghTklMUCAoVnRyYW5zaWVudF9tYXJr X21vZGUpCisgICAgICAmJiBOSUxQIChWbWFya19ldmVuX2lmX2luYWN0aXZlKQorICAgICAgJiYg TklMUCAoQlZBUiAoY3VycmVudF9idWZmZXIsIG1hcmtfYWN0aXZlKSkpCisgICAgeHNpZ25hbDAg KFFtYXJrX2luYWN0aXZlKTsKKyAgTGlzcF9PYmplY3QgbWFya2VyID0gQlZBUiAoY3VycmVudF9i dWZmZXIsIG1hcmspOworICBpbnQgbSA9IChYTUFSS0VSIChtYXJrZXIpLT5idWZmZXIpCisgICAg ICAgICAgPyBYTUFSS0VSIChtYXJrZXIpLT5jaGFycG9zCisgICAgICAgICAgOiAtMTsKKyAgcmV0 dXJuIChtID09IC0xKQorICAgICAgICAgICA/IC0xCisgICAgICAgICA6IChQVCA8IG0pID09IGJl Z2luX3AKKyAgICAgICAgICAgPyBQVAorICAgICAg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AgICAgICAgICAgIDogTU9TVF9QT1NJVElWRV9GSVhOVU0pOworICAgICAgaWYgKChw cm9wID0gbWNfcGxpc3RfZ2V0IChwbGlzdCwgUUN3aWR0aCksIFJBTkdFRF9GSVhOVU1QICgwLCBw cm9wLCBJTlRfTUFYKSkKKyAgICAgICAgICB8fCAocHJvcCA9IG1jX3BsaXN0X2dldCAocGxpc3Qs IFFDcmVsYXRpdmVfd2lkdGgpLAorICAgICAgICAgICAgICBSQU5HRURfRklYTlVNUCAoMCwgcHJv cCwgSU5UX01BWCkpKQorICAgICAgICB3aWR0aCA9IFhGSVhOVU0gKHByb3ApOworICAgICAgICBl bHNlIGlmIChGTE9BVFAgKHByb3ApICYmIDAgPD0gWEZMT0FUX0RBVEEgKHByb3ApCisgICAgICAg ICAgICAgICAgICYmIFhGTE9BVF9EQVRBIChwcm9wKSA8PSBJTlRfTUFYKQorICAgICAgICAgIHdp ZHRoID0gKGludCkoWEZMT0FUX0RBVEEgKHByb3ApICsgMC41KTsKKyAgICAgICAgICBlbHNlIGlm ICgocHJvcCA9IG1jX3BsaXN0X2dldCAocGxpc3QsIFFDYWxpZ25fdG8pLAorICAgICAgICAgICAg ICAgICAgICBSQU5HRURfRklYTlVNUCAoY29sLCBwcm9wLCBhbGlnbl90b19tYXgpKSkKKyAgICAg ICAgICAgIHdpZHRoID0gWEZJWE5VTSAocHJvcCkgLSBjb2w7CisgICAgICAgICAgICAgIGVsc2Ug aWYgKEZMT0FUUCAocHJvcCkgJiYgY29sIDw9IFhGTE9BVF9EQVRBIChwcm9wKQorICAgICAgICAg ICAgICAgICAgICAgICAmJiAoWEZMT0FUX0RBVEEgKHByb3ApIDw9IGFsaWduX3RvX21heCkpCisg ICAgICAgICAgICAgICAgd2lkdGggPSAoaW50KShYRkxPQVRfREFUQSAocHJvcCkgKyAwLjUpIC0g Y29sOworICAgICAgaWYgKHdpZHRoID49IDApCisgICAgICAgIHsKKyAgICAgICAgICBwdHJkaWZm X3Qgc3RhcnQ7CisgICAgICAgICAgaWYgKE9WRVJMQVlQIChvdmVybGF5KSkKKyAgICAgICAgICAg ICplbmRwb3MgPSBPVkVSTEFZX1BPU0lUSU9OIChPVkVSTEFZX0VORCAob3ZlcmxheSkpOworICAg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBnZXRfcHJvcGVydHlfYW5kX3JhbmdlIChwb3Ms IFFkaXNwbGF5LCAmdmFsLCAmc3RhcnQsIGVuZHBvcywgUW5pbCk7CisgICAgICAgICAgLyogRm9y IDpyZWxhdGl2ZS13aWR0aCwgd2UgbmVlZCB0byBtdWx0aXBseSBieSB0aGUgY29sdW1uCisgICAg ICAgICAgICAgd2lkdGggb2YgdGhlIGNoYXJhY3RlciBhdCBQT1MsIGlmIGl0IGlzIGdyZWF0ZXIg dGhhbiAxLiAqLworICAgICAgICAgIGlmICghTklMUCAobWNfcGxpc3RfZ2V0IChwbGlzdCwgUUNy ZWxhdGl2ZV93aWR0aCkpCisgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChjdXJyZW50X2J1 ZmZlciwgZW5hYmxlX211bHRpYnl0ZV9jaGFyYWN0ZXJzKSkpCisgICAgICAgICAgICB7CisgICAg ICAgICAgICAgIGludCBiLCB3ZDsKKyAgICAgICAgICAgICAgdW5zaWduZWQgY2hhciAqcCA9IEJZ VEVfUE9TX0FERFIgKENIQVJfVE9fQllURSAocG9zKSk7CisgICAgICAgICAgICAgIE1DX01VTFRJ QllURV9CWVRFU19XSURUSCAocCwgYnVmZmVyX2Rpc3BsYXlfdGFibGUgKCksIGIsIHdkKTsKKyAg ICAgICAgICAgICAgd2lkdGggKj0gd2Q7CisgICAgICAgICAgICB9CisgICAgICAgICAgcmV0dXJu IHdpZHRoOworICAgICAgICB9CisgICAgfQorICByZXR1cm4gLTE7Cit9CisKKy8qIFNjYW5uaW5n IGZyb20gdGhlIGJlZ2lubmluZyBvZiB0aGUgY3VycmVudCBsaW5lLCBzdG9wIGF0IHRoZSBidWZm ZXIKKyAgIHBv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B0cmRpZmZfdCBvbGRf c2NhbiA9IHNjYW47CisgICAgICAgICAgLyogVGhpcyB1cGRhdGVzIE5FWFRfQk9VTkRBUlkgdG8g dGhlIG5leHQgcGxhY2UKKyAgICAgICAgICAgICB3aGVyZSB3ZSBtaWdodCBuZWVkIHRvIHNraXAg bW9yZSBpbnZpc2libGUgdGV4dC4gKi8KKyAgICAgICAgICBzY2FuID0gc2tpcF9pbnZpc2libGUg KHNjYW4sICZuZXh0X2JvdW5kYXJ5LCBlbmQsIFFuaWwpOworICAgICAgICAgIGlmIChzY2FuICE9 IG9sZF9zY2FuKQorICAgICAgICAgICAgc2Nhbl9ieXRlID0gQ0hBUl9UT19CWVRFIChzY2FuKTsK KyAgICAgICAgICBpZiAoc2NhbiA+PSBlbmQpCisgICAgICAgICAgICBnb3RvIGVuZGxvb3A7Cisg ICAgICAgIH0KKyAgICAgIC8qIFRlc3QgcmVhY2hpbmcgdGhlIGdvYWwgY29sdW1uLiAgV2UgZG8g dGhpcyBhZnRlciBza2lwcGluZworICAgaW52aXNpYmxlIGNoYXJhY3RlcnMsIHNvIHRoYXQgd2Ug cHV0IHBvaW50IGJlZm9yZSB0aGUKKyAgIGNoYXJhY3RlciBvbiB3aGljaCB0aGUgY3Vyc29yIHdp bGwgYXBwZWFyLiAqLworICAgICAgaWYgKGNvbCA+PSBnb2FsKQorICAgICAgICBicmVhazsKKyAg ICAgIHByZXZfY29sID0gY29sOworICAgICAgeyAvKiBDaGVjayBkaXNwbGF5IHByb3BlcnR5LiAq LworICAgICAgICBwdHJkaWZmX3QgZW5kcDsKKyAgICAgICAgaW50IHdpZHRoID0gbWNfY2hlY2tf ZGlzcGxheV93aWR0aCAoc2NhbiwgY29sLCAmZW5kcCk7CisgICAgICAgIGlmICh3aWR0aCA+PSAw KQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGNvbCArPSB3aWR0aDsKKyAgICAgICAgICAgIGlm IChlbmRwID4gc2NhbikgLyogQXZvaWQgaW5maW5pdGUgbG9vcHMgd2l0aCAwLXdpZHRoIG92ZXJs YXlzLiAqLworICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc2NhbiA9IGVuZHA7Cisg ICAgICAgICAgICAgICAgc2Nhbl9ieXRlID0gQ0hBUl9UT19CWVRFIChzY2FuKTsKKyAgICAgICAg ICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgIH0K KyAgICAgIC8qIENoZWNrIGNvbXBvc2l0aW9uIHNlcXVlbmNlLiAqLworICAgICAgaWYgKGNtcF9p dC5pZCA+PSAwCisgICAgICAgICAgfHwgKHNjYW4gPT0gY21wX2l0LnN0b3BfcG9zCisgICAgICAg ICAgICAgICYmIGNvbXBvc2l0aW9uX3Jlc2VhdF9pdCAoJmNtcF9pdCwgc2Nhbiwgc2Nhbl9ieXRl LCBlbmQsIHcsIE5VTEwsIFFuaWwpKSkKKyAgICAgICAgY29tcG9zaXRpb25fdXBkYXRlX2l0ICgm Y21wX2l0LCBzY2FuLCBzY2FuX2J5dGUsIFFuaWwpOworICAgICAgaWYgKGNtcF9pdC5pZCA+PSAw KQorICAgICAgICB7CisgICAgICAgICAgc2NhbiArPSBjbXBfaXQubmNoYXJzOworICAgICAgICAg IHNjYW5fYnl0ZSArPSBjbXBfaXQubmJ5dGVzOworICAgICAgICAgIGlmIChzY2FuIDw9IGVuZCkK KyAgICAgICAgICAgIGNvbCArPSBjbXBfaXQud2lkdGg7CisgICAgICAgICAgaWYgKGNtcF9pdC50 byA9PSBjbXBfaXQubmdseXBocykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY21wX2l0 LmlkID0gLTE7CisgICAgICAgICAgICAgIGNvbXBvc2l0aW9uX2NvbXB1dGVfc3RvcF9wb3MgKCZj bXBfaXQsIHNjYW4sIHNjYW5fYnl0ZSwgZW5kLCBRbmlsKTsKKyAgICAgICAgICAgIH0KKyAgICAg ICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgY21wX2l0LmZyb20gPSBjbXBfaXQudG87CisgICAg ICAgICAgY29udGludWU7CisgICAgICAgIH0KKyAgICAgIGMgPSBGRVRDSF9CWVRFIChzY2FuX2J5 dGUpOworICAgICAgLyogU2VlIGlmIHRoZXJlIGlzIGEgZGlzcGxheSB0YWJsZSBhbmQgaXQgcmVs YXRlcyB0byB0aGlzIGNoYXJhY3Rlci4gKi8KKyAgICAgIGlmIChkcCAhPSAwCisgICAgICAgICAg JiYgISAobXVsdGlieXRlICYmIExFQURJTkdfQ09ERV9QIChjKSkKKyAgICAgICAgICAmJiBWRUNU T1JQIChESVNQX0NIQVJfVkVDVE9SIChkcCwgYykpKQorICAgICAgICB7CisgICAgICAgICAgTGlz cF9PYmplY3QgY2hhcnZlYzsKKyAgICAgICAgICBwdHJkaWZmX3QgaSwgbjsKKyAgICAgICAgICAv KiBUaGlzIGNoYXJhY3RlciBpcyBkaXNwbGF5ZWQgdXNpbmcgYSB2ZWN0b3Igb2YgZ2x5cGhzLgor ICAgICAgICAgICAgIFVwZGF0ZSB0aGUgY29sdW1uL3Bvc2l0aW9uIGJhc2VkIG9uIHRob3NlIGds eXBocy4gKi8KKyAgICAgICAgICBjaGFydmVjID0gRElTUF9DSEFSX1ZFQ1RPUiAoZHAsIGMpOwor ICAgICAgICAgIG4gPSBBU0laRSAoY2hhcnZlYyk7CisgICAgICAgICAgZm9yIChpID0gMDsgaSA8 IG47IGkrKykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogVGhpcyBzaG91bGQgYmUg aGFuZGxlZCB0aGUgc2FtZSBhcworICAgICAgICAgICAgICBuZXh0X2VsZW1lbnRfZnJvbV9kaXNw bGF5X3ZlY3RvciBkb2VzIGl0LiAqLworICAgICAgICAgICAgICBMaXNwX09iamVjdCBlbnRyeSA9 IEFSRUYgKGNoYXJ2ZWMsIGkpOworICAgICAgICAgICAgICBpZiAoR0xZUEhfQ09ERV9QIChlbnRy eSkpCisgICAgICAgICAgICAgICAgYyA9IEdMWVBIX0NPREVfQ0hBUiAoZW50cnkpOworICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgYyA9ICcgJzsKKyAgICAgICAgICAgICAgaWYg KGMgPT0gJ1xuJykKKyAgICAgICAgICAgICAgICBnb3RvIGVuZGxvb3A7CisgICAgICAgICAgICAg IGlmIChjID09ICdccicgJiYgRVEgKEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBzZWxlY3RpdmVfZGlz cGxheSksIFF0KSkKKyAgICAgICAgICAgICAgICBnb3RvIGVuZGxvb3A7CisgICAgICAgICAgICAg IGlmIChjID09ICdcdCcpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgY29s ICs9IHRhYl93aWR0aDsKKyAgICAgICAgICAgICAgICAgIGNvbCA9IGNvbCAvIHRhYl93aWR0aCAq IHRhYl93aWR0aDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICAgICAgKytjb2w7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAg ZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIC8qIFRoZSBkaXNwbGF5IHRhYmxlIGRvZXNu J3QgYWZmZWN0IHRoaXMgY2hhcmFjdGVyOworICAgICAgICAgICAgICAgaXQgZGlzcGxheXMgYXMg aXRzZWxmLiAqLworICAgICAgICAgICAgaWYgKGMgPT0gJ1xuJykKKyAgICAgICAgICAgICAgZ290 byBlbmRsb29wOworICAgICAgICAgICAgaWYgKGMgPT0gJ1xyJyAmJiBFUSAoQlZBUiAoY3VycmVu dF9idWZmZXIsIHNlbGVjdGl2ZV9kaXNwbGF5KSwgUXQpKQorICAgICAgICAgICAgICBnb3RvIGVu ZGxvb3A7CisgICAgICAgICAgICBpZiAoYyA9PSAnXHQnKQorICAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgY29sICs9IHRhYl93aWR0aDsKKyAgICAgICAgICAgICAgICBjb2wgPSBjb2wg LyB0YWJfd2lkdGggKiB0YWJfd2lkdGg7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAg ZWxzZSBpZiAobXVsdGlieXRlICYmIExFQURJTkdfQ09ERV9QIChjKSkKKyAgICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgICAvKiBTdGFydCBvZiBtdWx0aS1ieXRlIGZvcm0uICovCisg ICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyICpwdHI7CisgICAgICAgICAgICAgICAgICBp bnQgYnl0ZXMsIHdpZHRoOworICAgICAgICAgICAgICAgICAgcHRyID0gQllURV9QT1NfQUREUiAo c2Nhbl9ieXRlKTsKKyAgICAgICAgICAgICAgICAgIE1DX01VTFRJQllURV9CWVRFU19XSURUSCAo cHRyLCBkcCwgYnl0ZXMsIHdpZHRoKTsKKyAgICAgICAgICAgICAgICAgIC8qIFN1YnRyYWN0IG9u ZSB0byBjb21wZW5zYXRlIGZvciB0aGUgaW5jcmVtZW50CisgICAgICAgICAgICAgICAgICB0aGF0 IGlzIGdvaW5nIHRvIGhhcHBlbiBiZWxvdy4gKi8KKyAgICAgICAgICAgICAgICAgIHNjYW5fYnl0 ZSArPSBieXRlcyAtIDE7CisgICAgICAgICAgICAgICAgICBjb2wgKz0gd2lkdGg7CisgICAgICAg ICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYgKGN0bF9hcnJvdyAmJiAoYyA8IDA0 MCB8fCBjID09IDAxNzcpKQorICAgICAgICAgICAgICAgICAgY29sICs9IDI7CisgICAgICAgICAg ICAgICAgICBlbHNlIGlmIChjIDwgMDQwIHx8IGMgPj0gMDE3NykKKyAgICAgICAgICAgICAgICAg ICAgY29sICs9IDQ7CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAg ICAgICBjb2wrKzsKKyAgICAgICAgICB9CisgICAgICBzY2FuKys7CisgICAgICBzY2FuX2J5dGUr KzsKKyAgICB9CisgZW5kbG9vcDoKKyAgbG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2tu b3duX2NvbHVtbl9tb2RpZmllZCA9IDA7CisgIHB0cmRpZmZfdCBsYXN0X2tub3duX2NvbHVtbiA9 IDA7CisgIHB0cmRpZmZfdCBjb2w7CisgIHVuc2lnbmVkIGNoYXIgKnB0ciwgKnN0b3A7CisgIGJv b2wgdGFiX3NlZW47CisgIHB0cmRpZmZfdCBwb3N0X3RhYjsKKyAgaW50IGM7CisgIGludCB0YWJf d2lkdGggPSBTQU5FX1RBQl9XSURUSCAoY3VycmVudF9idWZmZXIpOworICBib29sIGN0bF9hcnJv dyA9ICFOSUxQIChCVkFSIChjdXJyZW50X2J1ZmZlciwgY3RsX2Fycm93KSk7CisgIHN0cnVjdCBM aXNwX0NoYXJfVGFibGUgKmRwID0gYnVmZmVyX2Rpc3BsYXlfdGFibGUgKCk7CisgIGlmIChwdCA9 PSBsYXN0X2tub3duX2NvbHVtbl9wb2ludAorICAgICAgJiYgTU9ESUZGID09IGxhc3Rfa25vd25f Y29sdW1uX21vZGlmaWVkKQorICAgIHsKKyAgICAgIGlmIChvbGRfYnVmZmVyKQorICAgICAgICBz ZXRfYnVmZmVyX2ludGVybmFsIChvbGRfYnVmZmVyKTsKKyAgICAgIHJldHVybiBsYXN0X2tub3du X2NvbHVtbjsKKyAgICB9CisgIC8qIElmIHRoZSBidWZmZXIgaGFzIG92ZXJsYXlzLCB0ZXh0IHBy b3BlcnRpZXMsCisgICAgIG9yIG11bHRpYnl0ZSBjaGFyYWN0ZXJzLCB1c2UgYSBtb3JlIGdlbmVy YWwgYWxnb3JpdGhtLiAqLworICBpZiAoYnVmZmVyX2ludGVydmFscyAoY3VycmVudF9idWZmZXIp CisgICAgICB8fCBidWZmZXJfaGFzX292ZXJsYXlzICgpCisgICAgICB8fCBaICE9IFpfQllURSkK KyAgICB7CisgICAgICBFTUFDU19JTlQgY29sID0gTU9TVF9QT1NJVElWRV9GSVhOVU07CisgICAg ICBtY19zY2FuX2Zvcl9jb2x1bW4gKCZwdCwgJmNvbCwgTlVMT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ICAgICAgICAgICAgb3IgZm9yIHRoZSBnYXAuICovCisgICAgICAgICAgaWYgKHB0 ciA9PSBCRUdWX0FERFIpCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAvKiBJdCB3YXMg dGhlIGdhcC4gIEp1bXAgYmFjayBvdmVyIGl0LiAqLworICAgICAgICAgIHN0b3AgPSBCRUdWX0FE RFI7CisgICAgICAgICAgcHRyID0gR1BUX0FERFI7CisgICAgICAgICAgLyogQ2hlY2sgd2hldGhl ciB0aGF0IGJyaW5ncyB1cyB0byBiZWdpbm5pbmcgb2YgYnVmZmVyLiAqLworICAgICAgICAgIGlm IChCRUdWID49IEdQVCkKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBjID0g Ki0tcHRyOworICAgICAgaWYgKGRwICYmIFZFQ1RPUlAgKERJU1BfQ0hBUl9WRUNUT1IgKGRwLCBj KSkpCisgICAgICAgIHsKKyAgICAgICAgICBjaGFydmVjID0gRElTUF9DSEFSX1ZFQ1RPUiAoZHAs IGMpOworICAgICAgICAgIG4gPSBBU0laRSAoY2hhcnZlYyk7CisgICAgICAgIH0KKyAgICAgICAg ZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGNoYXJ2ZWMgPSBRbmlsOworICAgICAgICAg ICAgbiA9IDE7CisgICAgICAgICAgfQorICAgICAgZm9yIChpID0gbiAtIDE7IGkgPj0gMDsgLS1p KQorICAgICAgICB7CisgICAgICAgICAgaWYgKFZFQ1RPUlAgKGNoYXJ2ZWMpKQorICAgICAgICAg ICAgeworICAgICAgICAgICAgICAvKiBUaGlzIHNob3VsZCBiZSBoYW5kbGVkIHRoZSBzYW1lIGFz CisgICAgICAgICAgIG5leHRfZWxlbWVudF9mcm9tX2Rpc3BsYXlfdmVjdG9yIGRvZXMgaXQuICov CisgICAgICAgICAgICAgIExpc3BfT2JqZWN0IGVudHJ5ID0gQVJFRiAoY2hhcnZlYywgaSk7Cisg ICAgICAgICAgICAgIGlmIChHTFlQSF9DT0RFX1AgKGVudHJ5KSkKKyAgICAgICAgICAgICAgICBj ID0gR0xZUEhfQ09ERV9DSEFSIChlbnRyeSk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICAgICAgYyA9ICcgJzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBpZiAoYyA+PSAw NDAgJiYgYyA8IDAxNzcpCisgICAgICAgICAgICBjb2wrKzsKKyAgICAgICAgICAgIGVsc2UgaWYg KGMgPT0gJ1xuJworICAgICAgICAgICAgICAgICAgICAgfHwgKGMgPT0gJ1xyJworICAgICAgICAg ICAgICAgICAgICAgICAgICYmIEVRIChCVkFSIChjdXJyZW50X2J1ZmZlciwgc2VsZWN0aXZlX2Rp c3BsYXkpLCBRdCkpKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcHRyKys7Cisg ICAgICAgICAgICAgICAgZ290byBzdGFydF9vZl9saW5lX2ZvdW5kOworICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAgIGVsc2UgaWYgKGMgPT0gJ1x0JykKKyAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgICBpZiAodGFiX3NlZW4pCisgICAgICAgICAgICAgICAgICAgIGNvbCA9 ICgoY29sICsgdGFiX3dpZHRoKSAvIHRhYl93aWR0aCkgKiB0YWJfd2lkdGg7CisgICAgICAgICAg ICAgICAgICBwb3N0X3RhYiArPSBjb2w7CisgICAgICAgICAgICAgICAgICBjb2wgPSAwOworICAg ICAgICAgICAgICAgICAgdGFiX3NlZW4gPSAxOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgICAgICBlbHNlIGlmIChWRUNUT1JQIChjaGFydmVjKSkKKyAgICAgICAgICAgICAgICAgIC8q IFdpdGggYSBkaXNwbGF5IHRhYmxlIGVudHJ5LCBDIGlzIGRpc3BsYXllZCBhcyBpcywgYW5kCisg ICAgICAgICAgICAgICAgICAgICBub3QgZGlzcGxheWVkIGFzIFxOTk4gb3IgYXMgXk4uICBJZiBD IGlzIGEgc2luZ2xlLWJ5dGUKKyAgICAgICAgICAgICAgICAgICAgIGNoYXJhY3RlciwgaXQgdGFr ZXMgb25lIGNvbHVtbi4gIElmIEMgaXMgbXVsdGktYnl0ZSBpbgorICAgICAgICAgICAgICAgICAg ICAgYSB1bmlieXRlIGJ1ZmZlciwgaXQncyB0cmFuc2xhdGVkIHRvIHVuaWJ5dGUsIHNvIGl0Cisg ICAgICAgICAgICAgICAgICAgICBhbHNvIHRha2VzIG9uZSBjb2x1bW4uICovCisgICAgICAgICAg ICAgICAgICArK2NvbDsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAg ICAgY29sICs9IChjdGxfYXJyb3cgJiYgYyA8IDAyMDApID8gMiA6IDQ7CisgICAgICAgIH0KKyAg ICB9Cisgc3RhcnRfb2ZfbGluZV9mb3VuZDoKKyAgaWYgKHRhYl9zZWVuKQorICAgIHsKKyAgICAg IGNvbCA9ICgoY29sICsgdGFiX3dpZHRoKSAvIHRhYl93aWR0aCkgKiB0YWJfd2lkdGg7CisgICAg ICBjb2wgKz0gcG9zdF90YWI7CisgICAgfQorICBsYXN0X2tub3duX2NvbHVtbiA9IGNvbDsKKyAg bGFzdF9rbm93bl9jb2x1bW5fcG9pbnQgPSBwdDsKKyAgbGFzdF9rbm93bl9jb2x1bW5fbW9kaWZp ZWQgPSBNT0RJRkY7CisgIGlmIChvbGRfYnVmZmVyKQorICAgIHNldF9idWZmZXJfaW50ZXJuYWwg KG9sZF9idWZmZXIpOworICByZXR1cm4gY29sOworfQorCitERUZVTiAoIm1jLWN1cnJlbnQtY29s dW1uIiwgRm1jX2N1cnJlbnRfY29sdW1uLCBTbWNfY3VycmVudF9jb2x1bW4sIDIsIDIsIDAsCisg ICAgICAgZG9jOiAvKiBSZXR1cm4gdGhlIGhvcml6b250YWwgcG9zaXRpb24gb2YgcG9pbnQuICBC ZWdpbm5pbmcgb2YgbGluZSBpcyBjb2x1bW4gMC4KK1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x1bW4gKHcsIFhGSVhOVU0gKHB0 KSkpOworICByZXR1cm4gdGVtcDsKK30KKworLyogVVNBR0U6ICBmcHJpbnRmIChzdGRlcnIsICJG UkFNRSAoJXMpIiwgbWNfZnJhbWUgKGYpKTsgKi8KK2NoYXIgKgorbWNfZnJhbWUgKHN0cnVjdCBm cmFtZSAqZikKK3sKKyAgTGlzcF9PYmplY3QgZnJhbWU7CisgIFhTRVRGUkFNRSAoZnJhbWUsIGYp OworICByZXR1cm4gU1NEQVRBIChGcHJpbjFfdG9fc3RyaW5nIChmcmFtZSwgUW5pbCkpOworfQor CisvKiBVU0FHRTogIGZwcmludGYgKHN0ZGVyciwgIldJTkRPVyAoJXMpIiwgbWNfd2luZG93ICh3 KSk7ICovCitjaGFyICoKK21jX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdykKK3sKKyAgTGlzcF9P YmplY3Qgd2luZG93OworICBYU0VUV0lORE9XICh3aW5kb3csIHcpOworICByZXR1cm4gU1NEQVRB IChGcHJpbjFfdG9fc3RyaW5nICh3aW5kb3csIFFuaWwpKTsKK30KKworLyogVVNBR0U6ICBmcHJp bnRmIChzdGRlcnIsICJDSEFSQUNURVIgKCVzKSIsIG1jX2NoYXJfdG9fc3RyaW5nIChnbHlwaC0+ dS5jaCkpOyAqLworY2hhciAqCittY19jaGFyX3RvX3N0cmluZyAoaW50IGFyZykKK3sKKyAgTGlz cF9PYmplY3QgY2hhcmFjdGVyID0gKDAgPD0gYXJnICYmIGFyZyA8PSBNQVhfQ0hBUikKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gRmNoYXJfdG9fc3RyaW5nIChtYWtlX2ZpeG51bSAoYXJn KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIDogUW5pbDsKKyAgY2hhciAqIHJlc3VsdCA9 ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICYmIGFyZyA9PSA5KQorICAg ICAgICAgICAgICAgICAgICA/ICJcXHQiCisgICAgICAgICAgICAgICAgICA6ICghTklMUCAoY2hh cmFjdGVyKQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnID09IDEwKQorICAgICAgICAgICAg ICAgICAgICA/ICJcXG4iCisgICAgICAgICAgICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQor ICAgICAgICAgICAgICAgICAgICAgJiYgYXJnID09IDMyKQorICAgICAgICAgICAgICAgICAgICA/ ICJcXHMiCisgICAgICAgICAgICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAg ICAgICAgICAgICAgJiYgYXJnICE9IDkKKyAgICAgICAgICAgICAgICAgICAgICYmIGFyZyAhPSAx MAorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnICE9IDMyKQorICAgICAgICAgICAgICAgICAg ICA/IFNTREFUQSAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgOiAiXFw/IjsKKyAgcmV0 dXJuIHJlc3VsdDsKK30KKworaW50CittY19saXNwX3RvX2N1cnNvcl90eXBlIChMaXNwX09iamVj dCBhcmcpCit7CisgIGNoYXIgKnN0cjsKKyAgaWYgKFhUWVBFIChhcmcpID09IExpc3BfU3RyaW5n KQorICAgIHN0ciA9IFNTREFUQSAoYXJnKTsKKyAgICBlbHNlIGlmIChYVFlQRSAoYXJnKSA9PSBM aXNwX1N5bWJvbCkKKyAgICAgIHN0ciA9IFNTREFUQSAoU1lNQk9MX05BTUUgKGFyZykpOworICAg ICAgZWxzZSByZXR1cm4gLTE7CisgIGlmICghc3RyY21wIChzdHIsICJubyIpKQorICAgIHJldHVy biBNQ19OT19DVVJTT1I7CisgIGlmICghc3RyY21wIChzdHIsICJtYy1sZWZ0LWZyaW5nZS1iaXRt YXAiKSkKKyAgICByZXR1cm4gTUNfTEVGVF9GUklOR0VfQklUTUFQOworICBpZiAoIXN0cmNtcCAo c3RyLCAibWMtcmlnaHQtZnJpbmdlLWJpdG1hcCIpKQorICAgIHJldHVybiBNQ19SSUdIVF9GUklO R0Vf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HJldHVybiAiVU5LTk9XTiI7CisgICAgfQor fQorCisvKiBVU0FHRTogIGZwcmludGYgKHN0ZGVyciwgIkFDVElPTi1UWVBFICglcykiLCBtY19l bmdpbmVfdHlwZV90b19zdHJpbmcgKGFyZykpOyAqLworY2hhciAqCittY19lbmdpbmVfdHlwZV90 b19zdHJpbmcgKGVudW0gbWNfZW5naW5lX3R5cGUgYWN0aW9uX3R5cGUpCit7CisgIHN3aXRjaCAo YWN0aW9uX3R5cGUpCisgICAgeworICAgICAgY2FzZSBNVUxUSVBMRV9DVVJTT1JTOiByZXR1cm4g Ik1VTFRJUExFX0NVUlNPUlMiOworICAgICAgY2FzZSBIT1JJWk9OVEFMX1JVTEVSOiByZXR1cm4g IkhPUklaT05UQUxfUlVMRVIiOworICAgICAgY2FzZSBWRVJUSUNBTF9SVUxFUjogcmV0dXJuICJW RVJUSUNBTF9SVUxFUiI7CisgICAgICBjYXNlIEZJTExfQ09MVU1OOiByZXR1cm4gIkZJTExfQ09M VU1OIjsKKyAgICAgIGNhc2UgQ1VSU09SX0lORElDQVRPUjogcmV0dXJuICJDVVJTT1JfSU5ESUNB VE9SIjsKKyAgICAgIGRlZmF1bHQ6CisgICAgICByZXR1cm4gIlVOS05PV04iOworICAgIH0KK30K KworLyogVVNBR0U6ICBmcHJpbnRmIChzdGRlcnIsICJGUk9NX1dIRVJFICglcykiLCBtY19kcmF3 X3Jvd190eXBlX3RvX3N0cmluZyAoYXJnKSk7ICovCitjaGFyICoKK21jX2RyYXdfcm93X3R5cGVf dG9fc3RyaW5nIChlbnVtIG1jX2RyYXdfcm93X3R5cGUgZnJvbV93aGVyZSkKK3sKKyAgc3dpdGNo IChmcm9tX3doZXJlKQorICAgIHsKKyAgICAgIGNhc2UgTk9XSEVSRTogcmV0dXJuICJOT1dIRVJF IjsKKyAgICAgIGNhc2UgU0NSSUJFX09ORTogcmV0dXJuICJTQ1JJQkVfT05FIjsKKyAgICAgIGNh c2UgU0NSSUJFX1RXTzogcmV0dX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k9XX1dJVEhfTU9V U0VfRkFDRSI7CisgICAgICBjYXNlIEVYUE9TRV9BUkVBX09ORTogcmV0dXJuICJFWFBPU0VfQVJF QV9PTkUiOworICAgICAgY2FzZSBFWFBPU0VfQVJFQV9UV086IHJldHVybiAiRVhQT1NFX0FSRUFf VFdPIjsKKyAgICAgIGNhc2UgRVhQT1NFX0xJTkU6IHJldHVybiAiRVhQT1NFX0xJTkUiOworICAg ICAgZGVmYXVsdDoKKyAgICAgIHJldHVybiAiVU5LTk9XTiI7CisgICAgfQorfQorCit2b2lkCitt Y19jYWNoZV9pbnNwZWN0b3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBtY19tYXRyaXggbWF0 cml4KQoreworICBpbnQgdnBvc19hbGxvY2F0ZWQgPSB3LT5tY19tYXRyaXgudnBvc19hbGxvY2F0 ZWQ7CisgIGludCB2cG9zX3VzZWQgPSB3LT5tY19tYXRyaXgudnBvc191c2VkOworICBmcHJpbnRm IChzdGRlcnIsICIlczogIG1hdHJpeC52cG9zX2FsbG9jYXRlZCAoJWQpIHwgbWF0cml4LnZwb3Nf dXNlZCAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgIG1jX3dpbmRvdyAodyksIHZwb3NfYWxs b2NhdGVkLCB2cG9zX3VzZWQpOworICBmb3IgKGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBl ID0gTUNfQ0FDSEU7CisgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICsrY2Fj aGVfdHlwZSkKKyAgICB7CisgICAgICBpbnQgY3Vyc29yc191c2VkID0gdy0+bWNfbWF0cml4LmN1 cnNvcnNfdXNlZFtjYWNoZV90eXBlXTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgbWF0cml4 LmN1cnNvcnNfdXNlZFslc10gKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgbWNfY2Fj aGVfdHlwZV90b19zdHJpbmcgKGNhY2hlX3R5cGUpLCBjdXJzb3JzX3VzZWQpOworICAgIH0KKyAg Zm9yIChpbnQgdm50aCA9IDA7CisgICAgICAgdm50aCA8IHctPm1jX21hdHJpeC52cG9zX3VzZWQ7 CisgICAgICAgKyt2bnRoKQorICAgIHsKKyAgICAgIGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNh Y2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOwor ICAgICAgICAgICArK2NhY2hlX3R5cGUpCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgY2FjaGVf YWxsb2NhdGVkID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVkW2NhY2hl X3R5cGVdOworICAgICAgICAgIGludCBjYWNoZV91c2VkID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXTsKKyAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIg ICAgdm50aCAoJWQpIHwgY2FjaGVfYWxsb2NhdGVkWyVzXSAoJWQpIHwgY2FjaGVfdXNlZFslc10g KCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHZudGgsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICBtY19jYWNoZV90eXBlX3RvX3N0cmluZyAoY2FjaGVfdHlwZSksCisgICAg ICAgICAgICAgICAgICAgICAgICAgICBjYWNoZV9hbGxvY2F0ZWQsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICBtY19jYWNoZV90eXBlX3RvX3N0cmluZyAoY2FjaGVfdHlwZSksCisgICAgICAg ICAgICAgICAgICAgICAgICAgICBjYWNoZV91c2VkKTsKKyAgICAgICAgfQorICAgIH0KK30KKwor dm9pZAorbWNfc2V0X2xzbF9iZyAoc3RydWN0IHdpbmRvdyAqdywgZW51bSBmYWNlX2lkIGZhY2Vf aWQsIHN0cnVjdCBtY19SR0IgKmxzbCkKK3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jdXJyZW50X2J1ZmZlcikKKyAgICB7CisgICAgICBvbGRfYnVmZmVyID0gY3VycmVu dF9idWZmZXI7CisgICAgICBzZXRfYnVmZmVyX2ludGVybmFsIChiKTsKKyAgICB9CisgIGVzc2Vu dGlhbHMtPnp2ID0gWlY7CisgIGVzc2VudGlhbHMtPnp2X2J5dGUgPSBaVl9CWVRFOworICBlc3Nl bnRpYWxzLT5mY194ID0gKGZpbGxfY29sdW1uX3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiAh TklMUCAoVmRpc3BsYXlfbGluZV9udW1iZXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgPyAo ZmlsbF9jb2wgKiBmcmFtZV9jaGFyX3dpZHRoKSArIHctPm1jLmxudW1fcGl4ZWxfd2lkdGggLSBo c2NsX3gKKyAgICAgICAgICAgICAgICAgICAgIDogKGZpbGxfY29sdW1uX3AKKyAgICAgICAgICAg ICAgICAgICAgICAgICYmIE5JTFAgKFZkaXNwbGF5X2xpbmVfbnVtYmVycykpCisgICAgICAgICAg ICAgICAgICAgICAgID8gKGZpbGxfY29sICogZnJhbWVfY2hhcl93aWR0aCkgLSBoc2NsX3gKKyAg ICAgICAgICAgICAgICAgICAgIDogMDsKKyAgaWYgKG9sZF9idWZmZXIpCisgICAgc2V0X2J1ZmZl cl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7CisgIGVudW0gZmFjZV9pZCBmaWxsX2NvbHVtbl9wcmVf enZfZmFjZV9pZCA9CisgICAgKCFlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAgICAmJiAhTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY19pbmFjdGl2ZV93aW5kb3dzKSkKKyAgICAg JiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisgICAg ICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCJmYy1pbmFjdGl2ZS1wcmUt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3QgYmV5b25kX2ZpbGxfY29sb3IgPSBiZXlvbmRfZmlsbF9mYWNlLT5sZmFjZVtMRkFD RV9GT1JFR1JPVU5EX0lOREVYXTsKKyAgICAgIHN0cnVjdCBtY19SR0IgYmV5b25kX2ZpbGxfZm9y ZWdyb3VuZDsKKyAgICAgIG1jX3h3X2NvbG9yX3ZhbHVlcyAodywgYmV5b25kX2ZpbGxfY29sb3Is ICZiZXlvbmRfZmlsbF9mb3JlZ3JvdW5kKTsKKyAgICAgIC8qIHJlZCAqLworICAgICAgaWYgKCgh ZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAmJiBjdXJyZW50X2NvbCAlIDIgIT0gMAorICAgICAg ICAgICAmJiByb3dfcG9zaXRpb24gPT0gUFJFX1pWKQorICAgICAgICAgIHx8IChmaWxsX2NvbHVt bl9wCisgICAgICAgICAgICAgICYmIGN1cnJlbnRfY29sICUgMiAhPSAwCisgICAgICAgICAgICAg ICYmIGN1cnJlbnRfY29sIDw9IGZpbGxfY29sCisgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlv biA9PSBQUkVfWlYpKQorICAgICAgICB7CisgICAgICAgICAgbHNsX2ZnLT5yZWQgPSBvZGRfZm9y ZWdyb3VuZC5yZWQ7CisgICAgICAgICAgbHNsX2ZnLT5ncmVlbiA9IG9kZF9mb3JlZ3JvdW5kLmdy ZWVuOworICAgICAgICAgIGxzbF9mZy0+Ymx1ZSA9IG9kZF9mb3JlZ3JvdW5kLmJsdWU7CisgICAg ICAgIH0KKyAgICAgICAgLyogeWVsbG93ICovCisgICAgICAgIGVsc2UgaWYgKCghZmlsbF9jb2x1 bW5fcAorICAgICAgICAgICAgICAgICAgJiYgY3VycmVudF9jb2wgJSAyID09IDAKKyAgICAgICAg ICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYpCisgICAgICAgICAgICAgICAgIHx8 IChmaWxsX2NvbHVtbl9wCisgICAgICAgICAgICAgICAgICAgICAmJiBjdXJyZW50X2NvbCAlIDIg PT0gMAorICAgICAgICAgICAgICAgICAgICAgJiYgY3VycmVudF9jb2wgPD0gZmlsbF9jb2wKKyAg ICAgICAgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYpKQorICAgICAgICAg IHsKKyAgICAgICAgICAgIGxzbF9mZy0+cmVkID0gZXZlbl9mb3JlZ3JvdW5kLnJlZDsKKyAgICAg ICAgICAgIGxzbF9mZy0+Z3JlZW4gPSBldmVuX2ZvcmVncm91bmQuZ3JlZW47CisgICAgICAgICAg ICBsc2xfZmctPmJsdWUgPSBldmVuX2ZvcmVncm91bmQuYmx1ZTsKKyAgICAgICAgICB9CisgICAg ICAgICAgLyogZ3JlZW4gKi8KKyAgICAgICAgICBlbHNlIGlmIChmaWxsX2NvbHVtbl9wCisgICAg ICAgICAgICAgICAgICAgJiYgY3VycmVudF9jb2wgPiBmaWxsX2NvbAorICAgICAgICAgICAgICAg ICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYpCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIGxzbF9mZy0+cmVkID0gYmV5b25kX2ZpbGxfZm9yZWdyb3VuZC5yZWQ7CisgICAgICAgICAg ICAgIGxzbF9mZy0+Z3JlZW4gPSBiZXlvbmRfZmlsbF9mb3JlZ3JvdW5kLmdyZWVuOworICAgICAg ICAgICAgICBsc2xfZmctPmJsdWUgPSBiZXlvbmRfZmlsbF9mb3JlZ3JvdW5kLmJsdWU7CisgICAg ICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmIChyb3dfcG9zaXRpb24gPT0gQVRfWlYpCisg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsc2xfZmctPnJlZCA9IGVzc2VudGlhbHMu c3BfZmcucmVkOworICAgICAgICAgICAgICAgIGxzbF9mZy0+Z3JlZW4gPSBlc3NlbnRpYWxzLnNw X2ZnLmdyZWVuOworICAgICAgICAgICAgICAgIGxzbF9mZy0+Ymx1ZSA9IGVzc2VudGlhbHMuc3Bf ZmcuYmx1ZTsKKyAgICAgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2Ug SE9SSVpPTlRBTF9SVUxFUjoKKyAgICB7CisgICAgICBpZiAoZ2x5cGggIT0gTlVMTAorICAgICAg ICAgICYmIGdseXBoLT51LmNoID09IDk1CisgICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gTUNf SEJBUikKKyAgICAgICAgeworICAgICAgICAgIGxzbF9mZy0+cmVkID0gZXNzZW50aWFscy5zcF9m Zy5yZWQ7CisgICAgICAgICAgbHNsX2ZnLT5ncmVlbiA9IGVzc2VudGlhbHMuc3BfZmcuZ3JlZW47 CisgICAgICAgICAgbHNsX2ZnLT5ibHVlID0gZXNzZW50aWFscy5zcF9mZy5ibHVlOworICAgICAg ICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBsc2xfZmctPnJlZCA9 IGVzc2VudGlhbHMuY2hfZmdbcm93X3Bvc2l0aW9uXS5yZWQ7CisgICAgICAgICAgICBsc2xfZmct PmdyZWVuID0gZXNzZW50aWFscy5jaF9mZ1tyb3dfcG9zaXRpb25dLmdyZWVuOworICAgICAgICAg ICAgbHNsX2ZnLT5ibHVlID0gZXNzZW50aWFscy5jaF9mZ1tyb3dfcG9zaXRpb25dLmJsdWU7Cisg ICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgVkVSVElDQUxfUlVMRVI6 CisgICAgeworICAgICAgbHNsX2ZnLT5yZWQgPSBlc3NlbnRpYWxzLmNoX2ZnW3Jvd19wb3NpdGlv bl0ucmVkOworICAgICAgbHNsX2ZnLT5ncmVlbiA9IGVzc2VudGlhbHMuY2hfZmdbcm93X3Bvc2l0 aW9uXS5ncmVlbjsKKyAgICAgIGxzbF9mZy0+Ymx1ZSA9IGVzc2VudGlhbHMuY2hfZmdbcm93X3Bv c2l0aW9uXS5ibHVlOworICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgRklMTF9DT0xVTU46 CisgICAgeworICAgICAgbHNsX2ZnLT5yZWQgPSBlc3NlbnRpYWxzLmZjX2ZnW3Jvd19wb3NpdGlv bl0ucmVkOworICAgICAgbHNsX2ZnLT5ncmVlbiA9IGVzc2VudGlhbHMuZmNfZmdbcm93X3Bvc2l0 aW9uXS5ncmVlbjsKKyAgICAgIGxzbF9mZy0+Ymx1ZSA9IGVzc2VudGlhbHMuZmNfZmdbcm93X3Bv c2l0aW9uXS5ibHVlOworICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgQ1VSU09SX0lORElD QVRPUjoKKyAgICB7CisgICAgICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsK KyAgICAgIGVudW0gZmFjZV9pZCBjdXJzb3JfZmFjZV9pZCA9CisgICAgICAgICghZXNzZW50aWFs cy5hY3RpdmVfcAorICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgY2hfaW5hY3RpdmVfd2luZG93cykpCisgICAgICAgICAmJiByb3dfcG9zaXRpb24gPT0gUFJF X1pWKQorICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVh bC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1wcmUtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICA6IChl c3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYp CisgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZh a2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpCisgICAgICAgIDogKCFlc3NlbnRpYWxzLmFj dGl2ZV9wCisgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGNoX2luYWN0aXZlX3dp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gIHN0cnVjdCBnbHlwaF9zdHJpbmcgKmgsICp0OworICAgICAgTW91c2VfSExJbmZvICpo bGluZm8gPSBNT1VTRV9ITF9JTkZPIChmKTsKKyAgICAgIGludCBtb3VzZV9iZWdfY29sIFVOSU5J VCwgbW91c2VfZW5kX2NvbCBVTklOSVQ7CisgICAgICBib29sIGNoZWNrX21vdXNlX2ZhY2UgPSBm YWxzZTsKKyAgICAgIGludCBkdW1teV94ID0gMDsKKyAgICAgIC8qIElmIG1vdXNlIGhpZ2hsaWdo dGluZyBpcyBvbiwgd2UgbWF5IG5lZWQgdG8gZHJhdyBhZGphY2VudAorICAgZ2x5cGhzIHVzaW5n IG1vdXNlLWZhY2UgaGlnaGxpZ2h0aW5nLiAqLworICAgICAgaWYgKGFyZWEgPT0gVEVYVF9BUkVB ICYmIHJvdy0+bW91c2VfZmFjZV9wCisgICAgICAgICAgJiYgaGxpbmZvLT5tb3VzZV9mYWNlX2Jl Z19yb3cgPj0gMAorICAgICAgICAgICYmIGhsaW5mby0+bW91c2VfZmFjZV9lbmRfcm93ID49IDAp CisgICAgICAgIHsKKyAgICAgICAgICBwdHJkaWZmX3Qgcm93X3Zwb3MgPSBNQVRSSVhfUk9XX1ZQ T1MgKHJvdywgdy0+Y3VycmVudF9tYXRyaXgpOworICAgICAgICAgIGlmIChyb3dfdnBvcyA+PSBo bGluZm8tPm1vdXNlX2ZhY2VfYmVnX3JvdworICAgICAgICAgICAgICAmJiByb3dfdnBvcyA8PSBo bGluZm8tPm1vdXNlX2ZhY2VfZW5kX3JvdykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg Y2hlY2tfbW91c2VfZmFjZSA9IHRydWU7CisgICAgICAgICAgICAgIG1vdXNlX2JlZ19jb2wgPSAo cm93X3Zwb3MgPT0gaGxpbmZvLT5tb3VzZV9mYWNlX2JlZ19yb3cpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IGhsaW5mby0+bW91c2VfZmFjZV9iZWdfY29sCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IDA7CisgICAgICAgICAgICAgIG1vdXNlX2VuZF9jb2wgPSAocm93 X3Zwb3MgPT0gaGxpbmZvLT5tb3VzZV9mYWNlX2VuZF9yb3cpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IGhsaW5mby0+bW91c2VfZmFjZV9lbmRfY29sCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IHJvdy0+dXNlZFtURVhUX0FSRUFdOworICAgICAgICAgICAgfQorICAg ICAgICB9CisgICAgICAvKiBDb21wdXRlIG92ZXJoYW5ncyBmb3IgYWxsIGdseXBoIHN0cmluZ3Mu ICovCisgICAgICBpZiAoRlJBTUVfUklGIChmKS0+Y29tcHV0ZV9nbHlwaF9zdHJpbmdfb3Zlcmhh bmdzKQorICAgICAgICBmb3IgKHMgPSBoZWFkOyBzOyBzID0gcy0+bmV4dCkKKyAgICAgICAgICBG UkFNRV9SSUYgKGYpLT5jb21wdXRlX2dseXBoX3N0cmluZ19vdmVyaGFuZ3MgKHMpOworICAgICAg LyogUHJlcGVuZCBnbHlwaCBzdHJpbmdzIGZvciBnbHlwaHMgaW4gZnJvbnQgb2YgdGhlIGZpcnN0 IGdseXBoCisgICAgICBzdHJpbmcgdGhhdCBhcmUgb3ZlcndyaXR0ZW4gYmVjYXVzZSBvZiB0aGUg Zmlyc3QgZ2x5cGgKKyAgICAgIHN0cmluZydzIGxlZnQgb3ZlcmhhbmcuICBUaGUgYmFja2dyb3Vu ZCBvZiBhbGwgc3RyaW5ncworICAgICAgcHJlcGVuZGVkIG11c3QgYmUgZHJhd24gYmVjYXVzZSB0 aGUgZmlyc3QgZ2x5cGggc3RyaW5nCisgICAgICBkcmF3cyBvdmVyIGl0LiAqLworICAgICAgaSA9 IGxlZnRfb3ZlcndyaXR0ZW4gKGhlYWQpOworICAgICAgaWYgKGkgPj0gMCkKKyAgICAgICAgewor ICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBvdmVybGFwX2hsOworICAgICAgICAgIC8q IElmIHRoaXMgcm93IGNvbnRhaW5zIG1vdXNlIGhpZ2hsaWdodGluZywgYXR0ZW1wdCB0byBkcmF3 CisgICAgICAgICAgICAgdGhlIG92ZXJsYXBwZWQgZ2x5cGhzIHdpdGggdGhlIGNvcnJlY3QgaGln aGxpZ2h0LiAgVGhpcworICAgICAgICAgICAgIGNvZGUgZmFpbHMgaWYgdGhlIG92ZXJsYXAgZW5j b21wYXNzZXMgbW9yZSB0aGFuIG9uZSBnbHlwaAorICAgICAgICAgICAgIGFuZCBtb3VzZS1oaWdo bGlnaHQgc3BhbnMgb25seSBzb21lIG9mIHRoZXNlIGdseXBocy4KKyAgICAgICAgICAgICBIb3dl dmVyLCBtYWtpbmcgaXQgd29yayBwZXJmZWN0bHkgaW52b2x2ZXMgYSBsb3QgbW9yZQorICAgICAg ICAgICAgIGNvZGUsIGFuZCBJIGRvbid0IGtub3cgaWYgdGhlIHBhdGhvbG9naWNhbCBjYXNlIG9j Y3VycyBpbgorICAgICAgICAgICAgIHByYWN0aWNlLCBzbyB3ZSdsbCBzdGljayB0byB0aGlzIGZv ciBub3cuICAtLS0gY3lkICAqLworICAgICAgICAgIGlmIChjaGVja19tb3VzZV9mYWNlCisgICAg ICAgICAgICAgICYmIG1vdXNlX2JlZ19jb2wgPCBzdGFydCAmJiBtb3VzZV9lbmRfY29sID4gaSkK KyAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX01PVVNFX0ZBQ0U7CisgICAgICAgICAgICBl bHNlCisgICAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX05PUk1BTF9URVhUOworICAgICAg ICAgIGlmIChobCAhPSBvdmVybGFwX2hsKQorICAgICAgICAgICAgY2xpcF9oZWFkID0gaGVhZDsK KyAgICAgICAgICBqID0gaTsKKyAgICAgICAgICBNQ19CVUlMRF9HTFlQSF9TVFJJTkdTIChqLCBz dGFydCwgaCwgdCwgb3ZlcmxhcF9obC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dXBkYXRlX3dpbmRvdycgKERSQVdfTk9S TUFMX1RFWFQpIGNhbiBhbHNvIGVyYXNlIGZha2UKKyAgICAgICAgICBjdXJzb3JzIHRoYXQgYXJl IGBsZWZ0X292ZXJ3cml0dGVuJy4gKi8KKyAgICAgICAgICBsZW5ndGggPSAwOworICAgICAgICAg IGZvciAocyA9IGg7IHM7IHMgPSBzLT5uZXh0KQorICAgICAgICAgICAgeworICAgICAgICAgICAg ICBzLT5sZWZ0X292ZXJ3cml0dGVuX3AgPSB0cnVlOworICAgICAgICAgICAgICBzLT5hY3Rpb25f dHlwZSA9IGFjdGlvbl90eXBlOworICAgICAgICAgICAgICBsZW5ndGggKz0gcy0+Zmlyc3RfZ2x5 cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgfQorICAgICAgICAgIHJlbGF0aXZlX3ggPSBz dGFydF94IC0gbGVuZ3RoOworICAgICAgICAgIGZvciAocyA9IGg7IHM7IHMgPSBzLT5uZXh0KQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICBzLT5maXJzdF9nbHlwaC0+cmVsYXRpdmVfeCA9 IHJlbGF0aXZlX3g7CisgICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0gcy0+Zmlyc3RfZ2x5cGgt PnBpeGVsX3dpZHRoOworICAgICAgICAgICAgfQorICAgICAgICAgIHN0YXJ0ID0gaTsKKyAgICAg ICAgICBjb21wdXRlX292ZXJoYW5nc19hbmRfeCAodCwgaGVhZC0+eCwgdHJ1ZSk7CisgICAgICAg ICAgcHJlcGVuZF9nbHlwaF9zdHJpbmdfbGlzdHMgKCZoZWFkLCAmdGFpbCwgaCwgdCk7CisgICAg ICAgICAgaWYgKGNsaXBfaGVhZCA9PSBOVUxMKQorICAgICAgICAgICAgY2xpcF9oZWFkID0gaGVh ZDsKKyAgICAgICAgfQorICAgICAgLyogUHJlcGVuZCBnbHlwaCBzdHJpbmdzIGZvciBnbHlwaHMg aW4gZnJvbnQgb2YgdGhlIGZpcnN0IGdseXBoCisgICAgICBzdHJpbmcgdGhhdCBvdmVyd3JpdGUg dGhhdCBnbHlwaCBzdHJpbmcgYmVjYXVzZSBvZiB0aGVpcgorICAgICAgcmlnaHQgb3Zlcmhhbmcu ICBGb3IgdGhlc2Ugc3RyaW5ncywgb25seSB0aGUgZm9yZWdyb3VuZCBtdXN0CisgICAgICBiZSBk cmF3biwgYmVjYXVzZSBpdCBkcmF3cyBvdmVyIHRoZSBnbHlwaCBzdHJpbmcgYXQgYGhlYWQnLgor ICAgICAgVGhlIGJhY2tncm91bmQgbXVzdCBub3QgYmUgZHJhd24gYmVjYXVzZSB0aGlzIHdvdWxk IG92ZXJ3cml0ZQorICAgICAgcmlnaHQgb3ZlcmhhbmdzIG9mIHByZWNlZGluZyBnbHlwaHMgZm9y IHdoaWNoIG5vIGdseXBoCisgICAgICBzdHJpbmdzIGV4aXN0LiAqLworICAgICAgaSA9IGxlZnRf b3ZlcndyaXRpbmcgKGhlYWQpOworICAgICAgaWYgKGkgPj0gMCkKKyAgICAgICAgeworICAgICAg ICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBvdmVybGFwX2hsOworICAgICAgICAgIGlmIChjaGVj a19tb3VzZV9mYWNlCisgICAgICAgICAgICAgICYmIG1vdXNlX2JlZ19jb2wgPCBzdGFydCAmJiBt b3VzZV9lbmRfY29sID4gaSkKKyAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX01PVVNFX0ZB Q0U7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX05P Uk1BTF9URVhUOworICAgICAgICAgIGlmIChobCA9PSBvdmVybGFwX2hsIHx8IGNsaXBfaGVhZCA9 PSBOVUxMKQorICAgICAgICAgICAgY2xpcF9oZWFkID0gaGVhZDsKKyAgICAgICAgICBNQ19CVUlM RF9HTFlQSF9TVFJJTkdTIChpLCBzdGFydCwgaCwgdCwgb3ZlcmxhcF9obCwgZHVtbXlfeCwgbGFz dF94KTsKKyAgICAgICAgICBmb3IgKHMgPSBoOyBzOyBzID0gcy0+bmV4dCkKKyAgICAgICAgICAg IHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVlOworICAgICAgICAgIGNvbXB1dGVfb3Zlcmhh bmdzX2FuZF94ICh0LCBoZWFkLT54LCB0cnVlKTsKKyAgICAgICAgICBwcmVwZW5kX2dseXBoX3N0 cmluZ19saXN0cyAoJmhlYWQsICZ0YWlsLCBoLCB0KTsKKyAgICAgICAgfQorICAgICAgLyogQXBw ZW5kIGdseXBocyBzdHJpbmdzIGZvciBnbHlwaHMgZm9sbG93aW5nIHRoZSBsYXN0IGdseXBoCisg ICAgICBzdHJpbmcgdGFpbCB0aGF0IGFyZSBvdmVyd3JpdHRlbiBieSB0YWlsLiAgVGhlIGJhY2tn cm91bmQgb2YKKyAgICAgIHRoZXNlIHN0cmluZ3MgaGFzIHRvIGJlIGRyYXduIGJlY2F1c2UgdGFp bCdzIGZvcmVncm91bmQgZHJhd3MKKyAgICAgIG92ZXIgaXQuICovCisgICAgICBpID0gcmlnaHRf b3ZlcndyaXR0ZW4gKHRhaWwpOworICAgICAgaWYgKGkgPj0gMCkKKyAgICAgICAgeworICAgICAg ICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBvdmVybGFwX2hsOworICAgICAgICAgIGlmIChjaGVj a19tb3VzZV9mYWNlCisgICAgICAgICAgICAgICYmIG1vdXNlX2JlZ19jb2wgPCBpICYmIG1vdXNl X2VuZF9jb2wgPiBlbmQpCisgICAgICAgICAgICBvdmVybGFwX2hsID0gRFJBV19NT1VTRV9GQUNF OworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBvdmVybGFwX2hsID0gRFJBV19OT1JN QUxfVEVYVDsKKyAgICAgICAgICBpZiAoaGwgIT0gb3ZlcmxhcF9obCkKKyAgICAgICAgICAgIGNs aXBfdGFpbCA9IHRhaWw7CisgICAgICAgICAgTUNfQlVJTERfR0xZUEhfU1RSSU5HUyAoZW5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isgICAgICAgICAgICAg ICYmIG1vdXNlX2JlZ19jb2wgPCBpICYmIG1vdXNlX2VuZF9jb2wgPiBlbmQpCisgICAgICAgICAg ICBvdmVybGFwX2hsID0gRFJBV19NT1VTRV9GQUNFOworICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICBvdmVybGFwX2hsID0gRFJBV19OT1JNQUxfVEVYVDsKKyAgICAgICAgICBpZiAoaGwg PT0gb3ZlcmxhcF9obCB8fCBjbGlwX3RhaWwgPT0gTlVMTCkKKyAgICAgICAgICAgIGNsaXBfdGFp bCA9IHRhaWw7CisgICAgICAgICAgaSsrOyAgICAgIC8qIFdlIG11c3QgaW5jbHVkZSB0aGUgSXRo IGdseXBoLiAqLworICAgICAgICAgIE1DX0JVSUxEX0dMWVBIX1NUUklOR1MgKGVuZCwgaSwgaCwg dCwgb3ZlcmxhcF9obCwgeCwgbGFzdF94KTsKKyAgICAgICAgICBmb3IgKHMgPSBoOyBzOyBzID0g cy0+bmV4dCkKKyAgICAgICAgICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVlOworICAg ICAgICAgIGNvbXB1dGVfb3ZlcmhhbmdzX2FuZF94IChoLCB0YWlsLT54ICsgdGFpbC0+d2lkdGgs IGZhbHNlKTsKKyAgICAgICAgICBhcHBlbmRfZ2x5cGhfc3RyaW5nX2xpc3RzICgmaGVhZCwgJnRh aWwsIGgsIHQpOworICAgICAgICB9CisgICAgICB0YWlsID0gZ2x5cGhfc3RyaW5nX2NvbnRhaW5p bmdfYmFja2dyb3VuZF93aWR0aCAodGFpbCk7CisgICAgICBpZiAoY2xpcF90YWlsKQorICAgICAg ICBjbGlwX3RhaWwgPSBnbHlwaF9zdHJpbmdfY29udGFpbmluZ19iYWNrZ3JvdW5kX3dpZHRoIChj bGlwX3RhaWwpOworICAgICAgaWYgKGNsaXBfaGVhZCB8fCBjbGlwX3RhaWwpCisgICAgICAgIGZv ciAocyA9IGhlYWQ7IHM7IHMgPSBzLT5uZXh0KQorICAgICAgICAgIHsKKyAgICAgICAgICAgIHMt PmNsaXBfaGVhZCA9IGNsaXBfaGVhZDsKKyAgICAgICAgICAgIHMtPmNsaXBfdGFpbCA9IGNsaXBf dGFpbDsKKyAgICAgICAgICB9CisgICAgfQorICAvKiBEcmF3IGFsbCBzdHJpbmdzLiAqLworICBm b3IgKHMgPSBoZWFkOyBzICYmIGRyYXdfcDsgcyA9IHMtPm5leHQpCisgICAgRlJBTUVfUklGIChm KS0+bWNfc2NyaWJlX3N0cmluZyAocywgbWF0cml4LCByb3csIGxzbCwgZ2x5cGhfZmxhdm9yLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCB3ZCwgYWN0 aXZlX3AsIGN1cnNvcl9nY19wKTsKKyNpZm5kZWYgSEFWRV9OUworICAvKiBXaGVuIGZvY3VzIGEg c29sZSBmcmFtZSBhbmQgbW92ZSBob3Jpem9udGFsbHksIHRoaXMgY2xlYXJzIG9uX3AKKyAgICAg Y2F1c2luZyBhIGZhaWx1cmUgdG8gZXJhc2UgcHJldiBjdXJzb3IgcG9zaXRpb24uICovCisgIGlm IChhcmVhID09IFRFWFRfQVJFQQorICAgICAgJiYgIXJvdy0+ZnVsbF93aWR0aF9wCisgICAgICAv KiBXaGVuIGRyYXdpbmcgb3ZlcmxhcHBpbmcgcm93cywgb25seSB0aGUgZ2x5cGggc3RyaW5ncycK KyAgICAgIGZvcmVncm91bmQgaXMgZHJhd24sIHdoaWNoIGRvZXNuJ3QgZXJhc2UgYSBjdXJzb3Ig Y29tcGxldGVseS4gKi8KKyAgICAgICYmICFvdmVybGFwcykKKyAgICB7CisgICAgICBpbnQgeDAg PSBjbGlwX2hlYWQgPyBjbGlwX2hlYWQtPnggOiAoaGVhZCA/IGhlYWQtPnggOiB4KTsKKyAgICAg IGludCB4MSA9IChjbGlwX3RhaWwgPyBjbGlwX3RhaWwtPnggKyBjbGlwX3RhaWwtPmJhY2tncm91 bmRfd2lk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SBs ZW47CisgIHctPm91dHB1dF9jdXJzb3IueCA9IHg7Cit9CisKKy8qIEVYUE9SVDoKKyAgIERyYXcg dGhlIGN1cnNvciBnbHlwaCBvZiB3aW5kb3cgVyBpbiBnbHlwaCByb3cgUk9XLiAgU2VlIHRoZQor ICAgY29tbWVudCBvZiBkcmF3X2dseXBocyBmb3IgdGhlIG1lYW5pbmcgb2YgSEwuICovCit2b2lk CittY19kcmF3X2N1cnNvcl9nbHlwaCAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21h dHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICAg ICAgZW51bSBkcmF3X2dseXBoc19mYWNlIGhsLCBpbnQgeCwgaW50IGhwb3MsIGludCB2cG9zLAor ICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsLCBlbnVtIG1jX2ZsYXZvciBn bHlwaF9mbGF2b3IsCisgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBj dXJzb3JfdHlwZSwgaW50IHdkLCBib29sIGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAgICAg IGJvb2wgY3Vyc29yX2djX3ApCit7CisgIHN0cnVjdCBnbHlwaF9yb3cgKmJvdHRvbV9yb3cgPSBN QVRSSVhfQk9UVE9NX1RFWFRfUk9XIChtYXRyaXgsIHcpOworICBpbnQgYm90dG9tX3Zwb3MgPSBN QVRSSVhfUk9XX1ZQT1MgKGJvdHRvbV9yb3csIG1hdHJpeCk7CisvKgorICAgICAgc3RydWN0IGds eXBoICpjdXJzb3JfZ2x5cGggPSBtY19nZXRfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywg aHBvcywgdnBvcyk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19kcmF3X2N1cnNvcl9nbHlw aDogIGNoICglZCkgfCB4ICglZCksIGhwb3MgKCVkKSwgdnBvcyglZ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7CisgIC8qIE5vIGN1cnNvciBkaXNwbGF5ZWQg b3Igcm93IGludmFsaWRhdGVkID0+IG5vdGhpbmcgdG8gZG8gb24gdGhlIHNjcmVlbi4gKi8KKyAg aWYgKGN1cnNvcl90eXBlID09IE1DX05PX0NVUlNPUikKKyAgICB7CisgICAgICBpZiAoZGVidWdf cCkKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZXJhc2VfY3Vyc29yOiAgcmV0dXJuICgl ZClcbiIsIDEpOworICAgICAgcmV0dXJuOworICAgIH0KKyAgLyogVlBPUyA+PSBtYXRyaXgtPm5y b3dzIG1lYW5zIHRoYXQgd2luZG93IGhhcyBiZWVuIHJlc2l6ZWQuCisgICAgIERvbid0IGJvdGhl ciB0byBlcmFzZSB0aGUgY3Vyc29yLiAqLworICBpZiAodnBvcyA+PSBtYXRyaXgtPm5yb3dzKQor ICAgIHsKKyAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19l cmFzZV9jdXJzb3I6ICByZXR1cm4gKCVkKVxuIiwgMik7CisgICAgICByZXR1cm47CisgICAgfQor ICAvKiBJZiByb3cgY29udGFpbmluZyBjdXJzb3IgaXMgbWFya2VkIGludmFsaWQsIHRoZXJlIGlz IG5vdGhpbmcgd2UKKyAgICAgY2FuIGRvLiAqLworICBpZiAoIXJvdy0+ZW5hYmxlZF9wKQorICAg IHsKKyAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19lcmFz ZV9jdXJzb3I6ICByZXR1cm4gKCVkKVxuIiwgMyk7CisgICAgICByZXR1cm47CisgICAgfQorICAv KiBJZiBsaW5lIHNwYWNpbmcgaXMgPiAwLCBvbGQgY3Vyc29yIG1heSBvbmx5IGJlIHBhcnRpYWxs eSB2aXNpYmxlIGluCisgICAgIHdpbmRvdyBhZnRlciBzcGxpdC13aW5kb3cuICBTbyBhZGp1c3Qg dmlzaWJsZSBoZWlnaHQuICovCisgIHJvdy0+dmlzaWJsZV9oZWlnaHQgPSBtaW4gKHJvdy0+dmlz aWJsZV9oZWlnaHQsCisgICAgICAgICAgICB3aW5kb3dfdGV4dF9ib3R0b21feSAodykgLSByb3ct PnkpOworICAvKiBJZiByb3cgaXMgY29tcGxldGVseSBpbnZpc2libGUsIGRvbid0IGF0dGVtcHQg dG8gZGVsZXRlIGEgY3Vyc29yIHdoaWNoCisgICAgIGlzbid0IHRoZXJlLiAgVGhpcyBjYW4gaGFw cGVuIGlmIGN1cnNvciBpcyBhdCB0b3Agb2YgYSB3aW5kb3csIGFuZAorICAgICB3ZSBzd2l0Y2gg dG8gYSBidWZmZXIgd2l0aCBhIGhlYWRlciBsaW5lIGluIHRoYXQgd2luZG93LiAqLworICBpZiAo cm93LT52aXNpYmxlX2hlaWdodCA8PSAwKQorICAgIHsKKyAgICAgIGlmIChkZWJ1Z19wKQorICAg ICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6ICByZXR1cm4gKCVkKVxuIiwg NCk7CisgICAgICByZXR1cm47CisgICAgfQorICAvKiBJZiBjdXJzb3IgaXMgaW4gdGhlIGZyaW5n ZSwgZXJhc2UgYnkgZHJhd2luZyBhY3R1YWwgYml0bWFwIHRoZXJlLiAqLworICBpZiAocm93LT5j dXJzb3JfaW5fZnJpbmdlX3AKKyAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19HTFlQSCkKKyAg ICB7CisgICAgICByb3ctPmN1cnNvcl9pbl9mcmluZ2VfcCA9IGZhbHNlOworICAgICAgbWNfZHJh d19mcmluZ2VfYml0bWFwICh3LCByb3csIHJvdy0+cmV2ZXJzZWRfcCwgY3Vyc29yX3R5cGUpOwor ICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX2VyYXNlX2N1 cnNvcjogIHJldHVybiAoJWQpXG4iLCA1KTsKKyAgICAgIHJldHVybjsKKyAgICB9CisgIC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LWxlZnQgNSkgKi8KKyAgYm9vbCBo c2NsX2FsbF90ZW1wX3AgPSAody0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5t aW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBhbmQgZG8gbm90aGlu Zy4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzBfcCA9ICh3LT5zdXNwZW5kX2F1dG9faHNjcm9s bAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExF OiAgQy11IEMteCA8IGFuZCBkbyBzb21ldGhpbmcgZWxzZSBiZXNpZGVzIGhvcml6b250YWxseSBz Y3JvbGxpbmcgdGhlCisgICAgICAgICAgICAgICBjdXJyZW50IGxpbmUgZGlmZmVyZW50bHkuCisg ICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgaXMgX25vdF8gaG9yaXpvbnRhbGx5IHNjcm9sbGVk IGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMV9wID0gKCF3LT5zdXNwZW5k X2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9s bF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhzY3JvbGwpOwor ICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCAuLi4KKyAgICAgICAgICAgICAgIEN1cnJlbnQg bGluZSBpcyBfbm90XyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJv b2wgaHNjbF9hbGxfcGVybV8yX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPT0gMAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgKHNjcm9s bC1sZWZ0IDUpOyBhbmQsIHRoZW4gcHJlc3MgdGhlIGxlZnQgYXJyb3cga2V5IG9uZSB0aW1lLgor ICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIF9pc18gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRp ZmZlcmVudGx5LiovCisgIGJvb2wgaHNjbF90ZW1wX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Ny b2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAg ICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAg JiYgdy0+bWluX2hzY3JvbGwgPT0gMCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRv IHNvbWV0aGluZyB0aGF0IGNhdXNlcyB0aGUgY3VycmVudCBsaW5lIHRvIGJlCisgICAgICAgICAg ICAgICBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuCisgICAgICAgICAgICAgICBD dXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisg IGJvb2wgaHNjbF9wZXJtX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAg ICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAg ICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3Jv bGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgIT0gdy0+aHNj cm9sbCk7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBpbnQgZnJp bmdlX2JpdG1hcCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgIGludCBmYWNlX2lkID0gREVGQVVM VF9GQUNFX0lEOworICBpZiAoIXJlbW92ZV9wCisgICAgICAmJiBnbHlwaF9mbGF2b3IgPT0gTUNf T1ZFUkxBWV9BUlJPV19CSVRNQVAKKyAgICAgICYmICFoc2NsX2FsbF90ZW1wX3AKKyAgICAgICYm ICFoc2NsX3RlbXBfcAorICAgICAgJiYgIWhzY2xfcGVybV9wCisgICAgICAmJiAhaHNjbF9hbGxf cGVybV8wX3AKKyAgICAgICYmICFoc2NsX2FsbF9wZXJtXzFfcAorICAgICAgJiYgIWhzY2xfYWxs X3Blcm1fMl9wKQorICAgIHsKKyAgICAgIGVudW0gZmFjZV9pZCBvdmVybGF5X2Fycm93X2ZhY2Vf aWQgPQorICAgICAgICAoIWFjdGl2ZV9wCisgICAgICAgICAmJiAhTklMUCAoQlZB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X05PX0ZSSU5H RV9CSVRNQVA7CisgICAgICByb3ctPmxlZnRfZnJpbmdlX2ZhY2VfaWQgPSBmYWNlX2lkOworICAg ICAgcm93LT5sZWZ0X2ZyaW5nZV9vZmZzZXQgPSAwOworICAgICAgcm93LT5mcmluZ2VfYml0bWFw X3BlcmlvZGljX3AgPSBmYWxzZTsKKyAgICAgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcCAodywgcm93 LCB0cnVlLCBjdXJzb3JfdHlwZSk7CisgICAgfQorICAgIGVsc2UgaWYgKCFyZW1vdmVfcAorICAg ICAgICAgICAgICYmIGdseXBoX2ZsYXZvciA9PSBNQ19PVkVSTEFZX0FSUk9XX0JJVE1BUAorICAg ICAgICAgICAgICYmIChoc2NsX2FsbF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF9h bGxfcGVybV8wX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8xX3AKKyAgICAg ICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8yX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNj bF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF9wZXJtX3ApKQorICAgICAgeworICAg ICAgICBlbnVtIGZhY2VfaWQgb3ZlcmxheV9hcnJvd19mYWNlX2lkID0KKyAgICAgICAgICAoIWFj dGl2ZV9wCisgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3 LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ctaHNjbC1pbmFjdGl2ZS1wcmUtenYtZmFjZSIp LCB0cnVlKQorICAgICAgICAgIDogKGFjdGl2ZV9wKQorICAgICAgICAgICAgPyBsb29rdXBfbmFt ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWF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aXRpb24KKyAgICAgICAgb2YgKHdoaWNoICE9IE5P X0ZSSU5HRV9CSVRNQVApLiAgQXQgdGhpcyB0aW1lLCBAbGF3bGlzdCBwcmVmZXJzIG5vdCB0bwor ICAgICAgICByZWx5IHVwb24gYSBMaXNwIHNldHRpbmcgdXNpbmcgYHNldC1mcmluZ2UtYml0bWFw LWZhY2UnLiAqLworICAgICAgICByb3ctPmxlZnRfZnJpbmdlX2JpdG1hcCA9IChjdXJzb3JfdHlw ZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IGZyaW5nZV9iaXRtYXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgcm93LT5sZWZ0 X2ZyaW5nZV9mYWNlX2lkID0gZmFjZV9pZDsKKyAgICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9vZmZz ZXQgPSAwOworICAgICAgICByb3ctPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcCA9IGZhbHNlOwor ICAgICAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXAgKHcsIHJvdywgdHJ1ZSwgY3Vyc29yX3R5cGUp OworICAgICAgfQorICAgICAgZWxzZSBpZiAoIXJlbW92ZV9wCisgICAgICAgICAgICAgICAmJiAo Z2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAg ICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdM RV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19I T0xMT1dfUkVDVEFOR0xFCisgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1D X1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2Zs YXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAg ICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAg ICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAg ICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNI KSkKKyAgICAgICAgeworICAgICAgICAgIExpc3BfT2JqZWN0IGJpdG1hcF9mbGF2b3IgPSAoZ2x5 cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hvbGxvd19yZWN0YW5nbGVfcmlnaHRf YXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxh dm9yID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfaG9sbG93X3Jl Y3RhbmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xlCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJU SUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBRbWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNB TF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9C QVIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGlj YWxfYmFyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2Zs YXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxfYmFyCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNB TF9CQVJfQkFDS1NMQVNIKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gUW1jX3ZlcnRpY2FsX2Jhcl9iYWNrc2xhc2gKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiBRbmlsOworICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5 cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg PyBsb29rdXBfZnJpbmdlX2JpdG1hcCAoYml0bWFwX2ZsYXZvcikKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgOiBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgIGZhY2VfaWQgPSAoY3Vy c29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAgICAg JiYgKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FS Uk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVS U0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgIHx8 IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpKQorICAgICAgICAgICAg ICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmV2ZXJzZWQt YmFyLXByZS16di1mYWNlIiksIHRydWUpCisgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl90 eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgICAgICAgJiYg Z2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cK KyAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX1ZF UlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9m bGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAgICAgICAg ID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistYmFyLXByZS16di1mYWNlIiks IHRydWUpCisgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAg IHJvdy0+Y3Vyc29yX2luX2ZyaW5nZV9wID0gZmFsc2U7CisgICAgICAgICAgcm93LT5yaWdodF9m cmluZ2VfYml0bWFwID0gZnJpbmdlX2JpdG1hcDsKKyAgICAgICAgICByb3ctPnJpZ2h0X2ZyaW5n ZV9mYWNlX2lkID0gZmFjZV9pZDsKKyAgICAgICAgICByb3ctPnJpZ2h0X2ZyaW5nZV9vZmZzZXQg PSAwOworICAgICAgICAgIHJvdy0+ZnJpbmdlX2JpdG1hcF9wZXJpb2RpY19wID0gZmFsc2U7Cisg ICAgICAgICAgbWNfZHJhd19mcmluZ2VfYml0bWFwICh3LCByb3csIGZhbHNlLCBjdXJzb3JfdHlw ZSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBI CisgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSExFU1MpCisgICAg ICAgICAgeworICAgICAgICAgICAgYm9vbCBvbl9wID0gdHJ1ZTsKKyAgICAgICAgICAgIEZSQU1F X1JJRiAoZiktPm1jX3NjcmliZV9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnks IGhwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9z LCB3ZCwgaCwgbHNsLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgZ2x5cGhfZmxhdm9yLCBvbl9wLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0aXZlX3ApOworICAgICAg ICAgIH0KK30KKworLyogRHVtcCBjb250ZW50cyBvZiBnbHlwaCBHTFlQSCB0byBzdGRlcnIuICBS T1cgYW5kIEFSRUEgYXJlCisgICB0aGUgZ2x5cGggcm93IGFuZCBhcmVhIHdoZXJlIHRoZSBnbHlw aCBjb21lcyBmcm9tLiAqLwordm9pZAorbWNfZHVtcF9nbHlwaCAoc3RydWN0IGdseXBoX3JvdyAq cm93LCBzdHJ1Y3QgZ2x5cGggKmdseXBoLCBpbnQgYXJlYSwKKyAgICAgICAgICAgICAgIGludCBy ZWxhdGl2ZV94LCBpbnQgdnBvcykKK3sKKyAgYm9vbCBnbHlwaF96dl9wID0gKGdseXBoIC0gcm93 LT5nbHlwaHNbYXJlYV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAg ICAgJiYgTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSA9PSBaVik7CisgIGlmIChnbHlwaC0+ dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICB8fCBnbHlwaC0+dHlwZSA9PSBHTFlQSExFU1NfR0xZ UEgpCisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBEImQvJS01 ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICAlM2QgJXMgJXNc biIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChy b3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAg IHJlbGF0aXZlX3gsCisgICAgICAgIChnbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAg ICA/ICdDJworICAgICAgICAgOiAnRycpLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAg ICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICA/ICdCJworICAgICAgICAgOiAo U1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6 IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICAg ICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIGdseXBo LT51LmNoLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94 X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBo LT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgIG1jX2NoYXJfdG9fc3Ry aW5nIChnbHlwaC0+dS5jaCkpOworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gU1RS RVRDSF9HTFlQSCkKKyAgICB7CisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICIgJTUi cEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNnggJTRkICUxLjFkJTEuMWQgICUz ZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAg ICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwK KyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ1MnLAorICAgICAgICBnbHlwaC0+Y2hhcnBv cywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdCJwor ICAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJwor ICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICcwJworICAg ICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIDB1 LAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVf cCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9z LCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICJcXFMiKTsKKyAgICB9CisgIGVs c2UgaWYgKGdseXBoLT50eXBlID09IElNQUdFX0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmludGYg KHN0ZGVyciwKKyAgICAgICAgIiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4 JTA2eCAlNGQgJTEuMWQlMS4xZCAgJTNkICVzICVjXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+ Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6 IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAnSScs CisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVj dCkKKyAgICAgICAgICAgID8gJ0InCisgICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVj dCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkK KyAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgOiAnLScpKSksCisgICAgICAgIGdseXBoLT5w aXhlbF93aWR0aCwKKyAgICAgICAgKHVuc2lnbmVkIGludCkgZ2x5cGgtPnUuaW1nX2lkLAorICAg ICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAg ICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9zLCBnbHlw aF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7CisgICAgfQorICBlbHNlIGlmIChn bHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpCisgICAgeworICAgICAgZnByaW50ZiAoc3Rk ZXJyLAorICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4 IiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJv dy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAg cmVsYXRpdmVfeCwKKyAgICAgICAgJysnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAg ICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdCJworICAgICAgICAg IDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAg IDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICcwJworICAgICAgICAgIDog Jy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgICh1bnNpZ25lZCBp bnQpIGdseXBoLT51LmNtcC5pZCk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgJTRkICUxLjFk JTEuMWQiLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94 X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3ApOworICAgICAgaWYgKGds eXBoLT51LmNtcC5hdXRvbWF0aWMpCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgJTNkICVz IC4gWyVkLSVkXVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaC0+aHBvcywgZ2x5 cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoLT5z bGljZS5jbXAuZnJvbSwgZ2x5cGgtPnNsaWNlLmNtcC50byk7CisgICAgICAgIGVsc2UKKyAgICAg ICAgZnByaW50ZiAoc3RkZXJyLCAiXG4iKTsKKyAgICB9CisgIGVsc2UgaWYgKGdseXBoLT50eXBl ID09IFhXSURHRVRfR0xZUEgpCisgICAgeworI2lmbmRlZiBIQVZFX1hXSURHRVRTCisgICAgICBl YXNzdW1lIChmYWxzZSk7CisjZWxzZQorICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAi ICAlNWQvJS01ZCAlNWQgJTRjICU2ZCAlYyAlM2QgMHglMDV4ICU0ZCAlMS4xZCUxLjFkICAlM2Qg JXMgJWNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAg ICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisg ICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdYJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3Ms CisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICA/ICdCJworICAg ICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAg ICAgICA6ICctJykpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIGdseXBo LT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlw aC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnUueHdpZGdldCwKKyAgICAgICAg Z2x5cGgtPmhwb3MsIGdseXBoX3p2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgJy4nKTsKKyNl bmRpZgorICAgIH0KK30KKworLyogRHVtcCB0aGUgY29udGVudHMgb2YgZ2x5cGggcm93IGF0IFZQ T1MgaW4gTUFUUklYIHRvIHN0ZGVyci4KKyAgIEdMWVBIUyAwIG1lYW5zIGRvbid0IHNob3cgZ2x5 cGggY29udGVudHMuCisgICBHTFlQSFMgMSBtZWFucyBzaG93IGdseXBocyBpbiBzaG9ydCBmb3Jt CisgICBHTFlQSFMgPiAxIG1lYW5zIHNob3cgZ2x5cGhzIGluIGxvbmcgZm9ybS4gKi8KK3ZvaWQK K21jX2R1bXBfZ2x5cGhfcm93IChzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCB2cG9zLCBpbnQg Z2x5cGhzKQoreworICBpbnQgcmVsYXRpdmVfeCA9IDA7CisgIGlmIChnbHlwaHMgIT0gMSkKKyAg ICB7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICJcbkRVTVAgR0xZUEggUk9XXG4iKTsKKyAgICAg IGZwcmludGYgKHN0ZGVyciwgIlJvdyAgICAgU3RhcnQgICAgICAgRW5kIFVzZWQgb0U+PFxcQ1Ra RmVzbSAgICAgWCAgICBZICAgIFcgICAgSCAgICBWICAgIEEgICAgUFxuIik7CisgICAgICBmcHJp bnRmIChzdGRlcnIsICI9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiIpOworICAgICAgZnByaW50ZiAo c3RkZXJyLCAiJTNkICU5InBEImQgJTkicEQiZCAlNGQgJTEuMWQlMS4xZCUxLjFkJTEuMWRcCisl MS4xZCUxLjFkJTEuMWQlMS4xZCUxLjFkJTEuMWQlMS4xZCUxLjFkICAlNGQgJTRkICU0ZCAlNGQg JTRkICU0ZCAlNGRcbiIsCisgICAgICAgICB2cG9zLAorICAgICAgICAgTUFUUklYX1JPV19TVEFS VF9DSEFSUE9TIChyb3cpLAorICAgICAgICAgTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSwK KyAgICAgICAgIHJvdy0+dXNlZFtURVhUX0FSRUFdLAorICAgICAgICAgcm93LT5jb250YWluc19v dmVybGFwcGluZ19nbHlwaHNfcCwKKyAgICAgICAgIHJvdy0+ZW5hYmxlZF9wLAorICAgICAgICAg cm93LT50cnVuY2F0ZWRfb25fbGVmdF9wLAorICAgICAgICAgcm93LT50cnVuY2F0ZWRfb25fcmln aHRfcCwKKyAgICAgICAgIHJvdy0+Y29udGludWVkX3AsCisgICAgICAgICBNQVRSSVhfUk9XX0NP TlRJTlVBVElPTl9MSU5FX1AgKHJvdyksCisgICAgICAgICBNQVRSSVhfUk9XX0RJU1BMQVlTX1RF WFRfUCAocm93KSwKKyAgICAgICAgIHJvdy0+ZW5kc19hdF96dl9wLAorICAgICAgICAgcm93LT5m aWxsX2xpbmVfcCwKKyAgICAgICAgIHJvdy0+ZW5kc19pbl9taWRkbGVfb2ZfY2hhcl9wLAorICAg ICAgICAgcm93LT5zdGFydHNfaW5fbWlkZGxlX29mX2NoYXJfcCwKKyAgICAgICAgIHJvdy0+bW91 c2VfZmFjZV9wLAorICAgICAgICAgcm93LT54LAorICAgICAgICAgcm93LT55LAorICAgICAgICAg cm93LT5waXhlbF93aWR0aCwKKyAgICAgICAgIHJvdy0+aGVpZ2h0LAorICAgICAgICAgcm93LT52 aXNpYmxlX2hlaWdodCwKKyAgICAgICAgIHJvdy0+YXNjZW50LAorICAgICAgICAgcm93LT5waHlz X2FzY2VudCk7CisgICAgICAvKiBUaGUgbmV4dCAzIGxpbmVzIHNob3VsZCBhbGlnbiB0byAiU3Rh cnQiIGluIHRoZSBoZWFkZXIuICovCisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgICAgJTkicEQi ZCAlOSJwRCJkXHQlNWRcbiIsIHJvdy0+c3RhcnQub3ZlcmxheV9zdHJpbmdfaW5kZXgsCisgICAg ICAgICByb3ctPmVuZC5vdmVybGF5X3N0cmluZ19pbmRleCwKKyAgICAgICAgIHJvdy0+Y29udGlu dWF0aW9uX2xpbmVzX3dpZHRoKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgICAlOSJwRCJk ICU5InBEImRcbiIsCisgICAgICAgICBDSEFSUE9TIChyb3ctPnN0YXJ0LnN0cmluZ19wb3MpLAor ICAgICAgICAgQ0hBUlBPUyAocm93LT5lbmQuc3RyaW5nX3BvcykpOworICAgICAgZnByaW50ZiAo c3RkZXJyLCAiICAgICU5ZCAlOWRcbiIsIHJvdy0+c3RhcnQuZHB2ZWNfaW5kZXgsCisgICAgICAg ICByb3ctPmVuZC5kcHZlY19pbmRleCk7CisgICAgfQorICBpZiAoZ2x5cGhzID4gMSkKKyAgICB7 CisgICAgICBmb3IgKGludCBhcmVhID0gTEVGVF9NQVJHSU5fQVJFQTsgYXJlYSA8IExBU1RfQVJF QTsgKythcmVhKQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGdseXBoICpnbHlwaCA9IHJv dy0+Z2x5cGhzW2FyZWFdOworICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGhfZW5kID0gZ2x5 cGggKyByb3ctPnVzZWRbYXJlYV07CisgICAgICAgICAgLyogR2x5cGggZm9yIGEgbGluZSBlbmQg aW4gdGV4dC4gKi8KKyAgICAgICAgICBpZiAoYXJlYSA9PSBURVhUX0FSRUEgJiYgZ2x5cGggPT0g Z2x5cGhfZW5kICYmIGdseXBoLT5jaGFycG9zID4gMCkKKyAgICAgICAgICAgICsrZ2x5cGhfZW5k OworICAgICAgICAgIGlmIChnbHlwaCA8IGdseXBoX2VuZCkKKyAgICAgICAgICAgIGZwcmludGYg KHN0ZGVyciwgIkdseXBoIy9Ub3RhbCBSZWwuWCBUICAgICAgIFBvcyBPICAgVyAgICAgQ29kZSBG YWNlIExSIEhQT1MgWlYgQ1xuIik7CisgICAgICAgICAgZm9yICg7IGdseXBoIDwgZ2x5cGhfZW5k OyArK2dseXBoKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19kdW1wX2dseXBoIChy b3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB2cG9zKTsKKyAgICAgICAgICAgICAgcmVsYXRp dmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAg ICB9CisgICAgZWxzZSBpZiAoZ2x5cGhzID09IDEpCisgICAgICB7CisgICAgICAgIGNoYXIgc1tT SFJUX01BWCArIDRdOworICAgICAgICBmb3IgKGludCBhcmVhID0gTEVGVF9NQVJHSU5fQVJFQTsg YXJlYSA8IExBU1RfQVJFQTsgKythcmVhKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGludCBp OworICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHJvdy0+dXNlZFthcmVhXTsgKytpKQorICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoICpnbHlwaCA9IHJvdy0+ Z2x5cGhzW2FyZWFdICsgaTsKKyAgICAgICAgICAgICAgICBpZiAoaSA9PSByb3ctPnVzZWRbYXJl YV0gLSAxCisgICAgICAgICAgICAgICAgICAgICYmIGFyZWEgPT0gVEVYVF9BUkVBCisgICAgICAg ICAgICAgICAgICAgICYmIE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICAgICAg ICYmIGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgICAgICAgICAgICAgICAgJiYgZ2x5 cGgtPnUuY2ggPT0gJyAnKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg ICBzdHJjcHkgKCZzW2ldLCAiW1xcbl0iKTsKKyAgICAgICAgICAgICAgICAgICAgaSArPSA0Owor ICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoZ2x5cGgtPnR5 cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGgtPnUu Y2ggPCAweDgwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaC0+dS5jaCA+PSAn ICcpCisgICAgICAgICAgICAgICAgICAgIHNbaV0gPSBnbHlwaC0+dS5jaDsKKyAgICAgICAgICAg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgIHNbaV0gPSAnLic7CisgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgIHNbaV0gPSAnXDAnOworICAgICAgICAgICAgZnByaW50ZiAo c3RkZXJyLCAiJTNkOiAoJWQpICclcydcbiIsIHZwb3MsIHJvdy0+ZW5hYmxlZF9wLCBzKTsKKyAg ICAgICAgICB9CisgICAgICB9Cit9CisKK0RFRlVOICgibWMtZHVtcC1nbHlwaC1yb3ciLCBGbWNf ZHVtcF9nbHlwaF9yb3csIFNtY19kdW1wX2dseXBoX3JvdywgMSwgMiwgIlAiLAorICAgICAgIGRv YzogLyogRHVtcCBnbHlwaCByb3cgUk9XIHRvIHN0ZGVyci4KK0ludGVyYWN0aXZlbHksIFJPVyBp cyB0aGUgcHJlZml4IG51bWVyaWMgYXJndW1lbnQgYW5kIGRlZmF1bHRzIHRvCit0aGUgcm93IHdo aWNoIGRpc3BsYXlzIHBvaW50LgorT3B0aW9uYWwgYXJndW1lbnQgR0xZUEhTIDAgbWVhbnMgZG9u J3QgZHVtcCBnbHlwaHMuCitHTFlQSFMgMSBtZWFucyBkdW1wIGdseXBocyBpbiBzaG9ydCBmb3Jt LgorR0xZUEhTID4gMSBvciBvbWl0dGVkIG1lYW5zIGR1bXAgZ2x5cGhzIGluIGxvbmcgZm9ybS4g ICovKQorICAoTGlzcF9PYmplY3Qgcm93LCBMaXNwX09iamVjdCBnbHlwaHMpCit7CisgIHN0cnVj dCB3aW5kb3cgKncgPSBYV0lORE9XIChzZWxlY3RlZF93aW5kb3cpOworICBzdHJ1Y3QgZ2x5cGhf bWF0cml4ICptYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAgRU1BQ1NfSU5UIHZwb3M7Cisg IGlmIChOSUxQIChyb3cpKQorICAgIHsKKyAgICAgIGludCBkMSwgZDIsIGQzLCBkNCwgZDUsIHlw b3M7CisgICAgICBib29sIHZpc2libGVfcCA9IHBvc192aXNpYmxlX3AgKHcsIFBULCAmZDEsICZk MiwgJmQzLCAmZDQsICZkNSwgJnlwb3MpOworICAgICAgaW50IGhlYWRlcl9saW5lX2hlaWdodCA9 IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICAgICAgaW50IHZvZmZzZXQgPSAoaGVh ZGVyX2xpbmVfaGVpZ2h0ID4gMAorICAgICAgICAgICAgICAgICAgICAgJiYgeXBvcyA+IDApCisg ICAgICAgICAgICAgICAgICAgICAgPyB5cG9zICsgMQorICAgICAgICAgICAgICAgICAgICAgIDog eXBvczsKKyAgICAgIGlmICh2aXNpYmxlX3ApCisgICAgICAgIHZwb3MgPSB2b2Zmc2V0OworICAg ICAgICBlbHNlCisgICAgICAgICAgdnBvcyA9IDA7CisgICAgfQorICAgIGVsc2UKKyAgICAgIHsK KyAgICAgICAgQ0hFQ0tfTlVNQkVSIChyb3cpOworICAgICAgICB2cG9zID0gWEZJWE5VTSAocm93 KTsKKyAgICAgIH0KKyAgaWYgKHZwb3MgPj0gMCAmJiB2cG9zIDwgbWF0cml4LT5ucm93cykKKyAg ICBtY19kdW1wX2dseXBoX3JvdyAoTUFUUklYX1JPVyAobWF0cml4LCB2cG9zKSwKKyAgICAgICAg dnBvcywKKyAgICAgICAgVFlQRV9SQU5HRURfRklYTlVNUCAoaW50LCBnbHlwaHMpID8gWEZJWE5V TSAoZ2x5cGhzKSA6IDIpOworICByZXR1cm4gUW5pbDsKK30KKwordm9pZAorbWNfZHVtcF9nbHlw aF9tYXRyaXggKHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgaW50IGdseXBocykKK3sKKyAg aW50IGk7CisgIGZvciAoaSA9IDA7IGkgPCBtYXRyaXgtPm5yb3dzOyArK2kpCisgICAgbWNfZHVt cF9nbHlwaF9yb3cgKE1BVFJJWF9ST1cgKG1hdHJpeCwgaSksIGksIGdseXB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ICAgdy0+Y3Vyc29yLngsIHctPmN1cnNvci55LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZw b3MpOworICBmcHJpbnRmIChzdGRlcnIsICI9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT1cbiIpOworICBtY19kdW1wX2dseXBoX21hdHJpeCAody0+Y3VycmVudF9t YXRyaXgsCisgICAgICAgICBUWVBFX1JBTkdFRF9GSVhOVU1QIChpbnQsIGdseXBocykgPyBYRklY TlVNIChnbHlwaHMpIDogMCk7CisgIHJldHVybiBRbmlsOworfQorCitib29sCittY190cmF2ZXJz ZV9jYWNoZV9wIChzdHJ1Y3QgbWNfbWF0cml4IG1hdHJpeCwgZW51bSBtY19jYWNoZV90eXBlIGNh Y2hlX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICBpbnQgdm50aCwgaW50IG50aCkKK3sKKyAg aWYgKHZudGggPCBtYXRyaXgudnBvc191c2VkCisgICAgICAmJiBtYXRyaXguY3Vyc29yc191c2Vk W2NhY2hlX3R5cGVdID4gMAorICAgICAgJiYgbnRoIDwgbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVf dXNlZFtjYWNoZV90eXBlXSkKKyAgICByZXR1cm4gdHJ1ZTsKKyAgICBlbHNlCisgICAgICByZXR1 cm4gZmFsc2U7Cit9CisKK3ZvaWQKK21jX3Jlc2V0X2NhY2hlIChzdHJ1Y3Qgd2luZG93ICp3KQor eworICBpZiAoIUJVRkZFUlAgKHctPmNvbnRlbnRzKSkKKyAgICByZXR1cm47CisgIGZvciAoZW51 bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICBjYWNoZV90eXBl IDwgTk9fQ0FDSEU7CisgICAgICAgKytjYWNoZV90eXBlKQorICAgIHsKKyAgICAgIGJvb2wgYnZh cl9hY3RpdmVfcDsKKyAgICAgIHN3aXRjaCAoY2FjaGVfdHlwZSkKKyAgICAgICAgeworICAgICAg ICAgIGNhc2UgTk9fQ0FDSEU6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHJldHVybjsK KyAgICAgICAgICAgIH0KKyAgICAgICAgICBjYXNlIE1DX0NBQ0hFOgorICAgICAgICAgICAgewor ICAgICAgICAgICAgICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAg ICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkKKyAgICAg ICAgICAgICAgICBidmFyX2FjdGl2ZV9wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgZWxzZSBp ZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQorICAgICAgICAgICAg ICAgICAgYnZhcl9hY3RpdmVfcCA9IHRydWU7CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAg ICAgICAgfQorICAgICAgICAgIGNhc2UgQ0hfQ0FDSEU6CisgICAgICAgICAgICB7CisgICAgICAg ICAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICYmIE5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgICAgICAg ICAgICAgIGJ2YXJfYWN0aXZlX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBlbHNlIGlmIChC VUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisgICAgICAgICAgICAg ICAgICBidmFyX2FjdGl2ZV9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAg ICAgICB9CisgICAgICAgICAgY2FzZSBGQ19DQUNIRToKKyAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgJiYgTklM UCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpCisgICAgICAgICAg ICAgICAgYnZhcl9hY3RpdmVfcCA9IGZhbHNlOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKEJV RkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKSkKKyAgICAgICAgICAgICAg ICAgIGJ2YXJfYWN0aXZlX3AgPSB0cnVlOworICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAg ICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKCFidmFyX2FjdGl2ZV9wKQorICAgICAgICB7Cisg ICAgICAgICAgLyogRGVjcmVhc2UgdGhlIHNpemUgb2YgdGhlIGFycmF5IHRvIGEgYmFyZSBtaW5p bXVtLiAqLworICAgICAgICAgIGZvciAoaW50IHZudGggPSAwOyB2bnRoIDwgdy0+bWNfbWF0cml4 LnZwb3NfdXNlZDsgKyt2bnRoKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAody0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVkW2NhY2hlX3R5cGVdID4gMSkKKyAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXSA9CisgICAgICAgICAgICAgICAgICAgIHhucmVhbGxvYyAody0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV0sIDEsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgc2l6ZW9mICp3LT5tY19tYXRyaXgudnBvc1t2bn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gICAgIC8vICBVc2luZyB0aGUgY291bnRlciBgdy0+bWNfbWF0cml4LnZw b3NbQF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXWAsIHdlIHRyYWNrIGN1cnJlbnQgZGF0YS4KKyAg ICAgICAgZWxzZSBpZiAoYnZhcl9hY3RpdmVfcCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBm b3IgKGludCB2bnRoID0gMDsgdm50aCA8IHctPm1jX21hdHJpeC52cG9zX3VzZWQ7ICsrdm50aCkK KyAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90 eXBlXSA9IDA7CisgICAgICAgICAgICB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5 cGVdID0gMDsKKyAgICAgICAgICB9CisgICAgfQorfQorCitzdGF0aWMgdm9pZAorbWNfaGVscGVy IChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsIHN0cnVjdCBn bHlwaF9yb3cgKnJvdywKKyAgICAgICAgICAgc3RydWN0IGdseXBoICpnbHlwaCwgaW50IHgsIGlu dCBmeCwgaW50IHksIGludCBmeSwgaW50IGhwb3MsIGludCB2cG9zLAorICAgICAgICAgICBpbnQg d2QsIGludCBoLCBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlLCBpbnQgY3Vyc29yX3dp ZHRoLAorICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGZvcmVncm91bmQsIHN0cnVjdCBtY19SR0Ig YmFja2dyb3VuZCwgYm9vbCBhY3RpdmVfcCwKKyAgICAgICAgICAgZW51bSBtY19mbGF2b3IgZ2x5 cGhfZmxhdm9yLCBib29sIGRyYXdfcCwgZW51bSBtY19kcmF3X3Jvd190eXBlIGZyb21fd2hlcmUs CisgICAgICAgICAgIGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlLCBlbnVtIG1jX2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WQsIGZvcmVncm91bmQuZ3JlZW4sCisgICAgICBmb3JlZ3Jv dW5kLmJsdWUsIGJhY2tncm91bmQucmVkLCBiYWNrZ3JvdW5kLmdyZWVuLCBiYWNrZ3JvdW5kLmJs dWUpOworICAgIH0KKyAgYm9vbCByZW1vdmVfcCA9IGZhbHNlOworICBpZiAoZHJhd19wCisgICAg ICAmJiAoZnJvbV93aGVyZSA9PSBTS0lQUEVECisgICAgICAgICAgfHwgZnJvbV93aGVyZSA9PSBQ T1NUX0NIQU5HRUQKKyAgICAgICAgICB8fCBmcm9tX3doZXJlID09IFVOQ0hBTkdFRAorICAgICAg ICAgIHx8IGZyb21fd2hlcmUgPT0gU0VUX0NVUlNPUl9UV08pKQorICAgIHsKKyAgICAgIGJvb2wg c2FtZV9wID0gZmFsc2U7CisgICAgICBmb3IgKGludCBudGggPSAwOyBudGggPCB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdOyArK250aCkKKyAgICAgICAgewor ICAgICAgICAgIHNhbWVfcCB8PQorICAgICAgICAgICAgKHctPm1jX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF0uc2FtZV9wID09IHRydWUKKyAgICAgICAgICAgICAmJiB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLnR5cGUg PT0gZ2x5cGgtPnR5cGUKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLmJ5dGVwb3MgPT0gZ2x5cGgtPmJ5dGVwb3MKKyAg ICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLmdseXBoLmNoYXJwb3MgPT0gZ2x5cGgtPmNoYXJwb3MKKyAgICAgICAgICAgICAmJiB3LT5t Y19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peC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF0uYmcuYmx1ZSA9PSBiYWNrZ3JvdW5kLmJsdWUKKyAgICAgICAgICAg ICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmFjdGl2 ZV9wID09IGFjdGl2ZV9wCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5nbHlwaF9mbGF2b3IgPT0gZ2x5cGhfZmxhdm9yCisgICAg ICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XS5lbmFibGVkX3AgPT0gdHJ1ZSk7CisgICAgICAgIH0KKyAgICAgIGlmICghc2FtZV9wKQorICAg ICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwg aHBvcywgdnBvcywgd2QsIGgsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBhY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCBy ZW1vdmVfcCk7CisgICAgICByZXR1cm47CisgICAgfQorICAgIGVsc2UgaWYgKGRyYXdfcAorICAg ICAgICAgICAgICYmIChmcm9tX3doZXJlID09IFNDUklCRV9PTkUKKyAgICAgICAgICAgICAgICAg fHwgZnJvbV93aGVyZSA9PSBTQ1JJQkVfVFdPCisgICAgICAgICAgICAgICAgIHx8IGZyb21fd2hl cmUgPT0gU0NSSUJFX1RIUkVFCisgICAgICAgICAgICAgICAgIHx8IGZyb21fd2hlcmUgPT0gTk9X SEVSRSkpCisgICAgICB7CisgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCBtYXRyaXgs IHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwgY3Vyc29yX3R5cGUsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGFjdGl2 ZV9wLCBnbHlwaF9mbGF2b3IsIHJlbW92ZV9wKTsKKyAgICAgICAgcmV0dXJuOworICAgICAgfQor ICBpZiAoY2FjaGVfdHlwZSA9PSBOT19DQUNIRSkKKyAgICByZXR1cm47CisgICsrdy0+bWNfbWF0 cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90eXBlXTsKKyAgaWYgKHZudGggPj0gdy0+bWNfbWF0cml4 LnZwb3NfdXNlZCkKKyAgICB3LT5tY19tYXRyaXgudnBvc191c2VkID0gdm50aCArIDE7CisgIGlm ICh3LT5tY19tYXRyaXgudnBvc19hbGxvY2F0ZWQgPCB3LT5tY19tYXRyaXgudnBvc191c2VkKQor ICAgIHsKKyAgICAgIGludCBvbGRfYWxsb2MgPSB3LT5tY19tYXRyaXgudnBvc19hbGxvY2F0ZWQ7 CisgICAgICBpbnQgbmV3X2VsdHMgPSB3LT5tY19tYXRyaXgudnBvc191c2VkIC0gdy0+bWNfbWF0 cml4LnZwb3NfYWxsb2NhdGVkOworICAgICAgdy0+bWNfbWF0cml4LnZwb3MgPSB4cGFsbG9jICh3 LT5tY19tYXRyaXgudnBvcywgJnctPm1jX21hdHJpeC52cG9zX2FsbG9jYXRlZCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2VsdHMsIElOVF9NQVgsIHNpemVvZiAqdy0+ bWNfbWF0cml4LnZwb3MpOworICAgICAgbWVtc2V0ICh3LT5tY19tYXRyaXgudnBvcyArIG9sZF9h bGxvYywgMCwKKyAgICAgICAgICAgICAgICh3LT5tY19tYXRyaXgudnBvc19hbGxvY2F0ZWQgLSBv bGRfYWxsb2MpICogc2l6ZW9mICp3LT5tY19tYXRyaXgudnBvcyk7CisgICAgfQorICArK3ctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV07CisgIGlmICh3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV0gPCB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdKQorICAgIHsKKyAgICAgIGludCBv bGRfYWxsb2MgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2FjaGVf dHlwZV07CisgICAgICBpbnQgbmV3X2VsdHMgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZV91c2VkW2NhY2hlX3R5cGVdIC0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfYWxsb2Nh dGVkW2NhY2hlX3R5cGVdOworICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV0gPSB4cGFsbG9jICh3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX2FsbG9jYXRlZFtjYWNoZV90 eXBlXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgbmV3X2VsdHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIElOVF9NQVgsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiAqdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV0pOworICAgICAgbWVtc2V0ICh3LT5tY19tYXRyaXgu d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2VyLXNwZWNpZmllZCB0aGlja25lc3Mgb2YgTUNfQkFSIGFuZAorICAgICAgICAg ICAgICAgTUNfSEJBUiBhcyB0byBgbWMtcmVhbC1mYWtlLWN1cnNvcicuCisgICBNVUxUSVBMRV9D VVJTT1JTOiAgV2UgZG8gbm90IHVzZSB0aGlzIGZ1bmN0aW9uLgorICAgSE9SSVpPTlRBTF9SVUxF UjogIFdlIHdhbnQgYSB1bml2ZXJzYWwgRlkgY29vcmRpbmF0ZSBmb3IgYSBsZXZlbCBydWxlci4K KyAgIFZFUlRJQ0FMX1JVTEVSIGFuZCBGSUxMX0NPTFVNTjogIFdlIHdhbnQgYW4gSCB0aGF0IGVu c3VyZXMgbm8gZ2FwIGJldHdlZW4gdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBwcmV2aW91cy9uZXh0IGxpbmUuICBUaGUgRlggY29vcmRpbmF0ZSBpcyBzZXQKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V3aGVyZTogIGB3LT5jdXJzb3IueGAg LyBgbWMuZmNfeGAuICovCit2b2lkCittY19nZXRfY3Vyc29yX2dlb21ldHJ5IChzdHJ1Y3Qgd2lu ZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsCisgICAgICAgICAgICAgICAgICAg ICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCB4LCBpbnQgKmZ4LCBpbnQgeSwKKyAgICAg ICAgICAgICAgICAgICAgICAgIGludCAqZnksIGludCBocG9zLCBpbnQgdnBvcywgaW50ICpoLAor ICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSwg aW50IGN1cnNvcl93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCAqd2QpCit7Cisg IHN0cnVjdCBnbHlwaCAqZ2x5cGggPSBtY19nZXRfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJv dywgaHBvcywgdnBvcyk7CisgIGlmIChnbHlwaCA9PSBOVUxMKQorICAgIHJldHVybjsKKyAgc3Ry dWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAgKmZ4ID0gV0lORE9X X1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgeCk7CisgICpoID0gcm93LT52aXNpYmxlX2hlaWdo dDsKKyAgLyogRG9uJ3QgbGV0IHRoZSBjdXJzb3IgZXhjZWVkIHRoZSBkaW1lbnNpb25zIG9mIHRo ZSByb3csIHNvIHRoYXQKKyAgdGhlIHVwcGVyL2xvd2VyIHNpZGUgb2YgdGhlIGJveCBhcmVuJ3Qg Y2xpcHBlZC4gICovCisgIGludCB3X2hlYWRlcl9saW5lX2hlaWdodCA9IFdJTkRPV19IRUFERVJf TElORV9IRUlHSFQgKHcpOworICBpbnQgd190ZXh0X2JvdHRvbV95ID0gd2luZG93X3RleHRfYm90 dG9tX3kgKHcpIC0gKmg7CisgIGlmICh5IDwgd19oZWFkZXJfbGluZV9oZWlnaHQpCisgICAgewor ICAgICAgKmggPSBtYXggKCpoIC0gKHdfaGVhZGVyX2xpbmVfaGVpZ2h0IC0geSkgKyAxLCAqaCk7 CisgICAgICB5ID0gd19oZWFkZXJfbGluZV9oZWlnaHQgLSAxOworICAgICAgLy8gZnByaW50ZiAo c3RkZXJyLCAiQ09ORElUSU9OICMgMVxuIik7CisgICAgfQorICAgZWxzZSBpZiAoeSA+IHdfdGV4 dF9ib3R0b21feSkKKyAgICAgeworICAgICAgICpoICs9IHkgLSB3X3RleHRfYm90dG9tX3k7Cisg ICAgICAgeSA9IHdfdGV4dF9ib3R0b21feTsKKyAgICAgICAvLyBmcHJpbnRmIChzdGRlcnIsICJD T05ESVRJT04gIyAyXG4iKTsKKyAgICAgfQorICAqZnkgPSBXSU5ET1dfVE9fRlJBTUVfUElYRUxf WSAodywgeSk7CisgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgeworICAgICAgY2FzZSBNQ19C QVI6CisgICAgICAgIHsKKyAgICAgICAgICBpZiAoY3Vyc29yX3dpZHRoIDwgMSkKKyAgICAgICAg ICAgIGN1cnNvcl93aWR0aCA9IG1heCAoRlJBTUVfQ1VSU09SX1dJRFRIIChmKSwgMSk7CisgICAg ICAgICAgaWYgKGN1cnNvcl93aWR0aCA8IGdseXBoLT5waXhlbF93aWR0aCkKKyAgICAgICAgICAq d2QgPSBjdXJzb3Jfd2lkdGg7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGNh c2UgTUNfSEJBUjoKKyAgICAgICAgeworICAgICAgICAgIGludCBjdXJzb3JfaGVpZ2h0ID0gKGN1 cnNvcl93aWR0aCA8IDEpID8gbHJpbnQgKDAuMjUgKiAqaCkgOiBjdXJzb3Jfd2lkdGg7CisgICAg ICAgICAgaWYgKGN1cnNvcl9oZWlnaHQgPiByb3ctPmhlaWdodCkKKyAgICAgICAgICAgIGN1cnNv cl9oZWlnaHQgPSByb3ctPmhlaWdodDsKKyAgICAgICAgICAvKiBDdXJzb3Igc21hbGxlciB0aGFu IGxpbmUgaGVpZ2h0LCBzbyBtb3ZlIGRvd24uICovCisgICAgICAgICAgaWYgKCpoID4gY3Vyc29y X2hlaWdodCkKKyAgICAgICAgICAgICpmeSArPSAqaCAtIGN1cnNvcl9oZWlnaHQ7CisgICAgICAg ICAgKmggPSBjdXJzb3JfaGVpZ2h0OworICAgICAgICAgICp3ZCA9IGdseXBoLT5waXhlbF93aWR0 aDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgY2FzZSBNQ19SSUdIVF9GUklO R0VfQklUTUFQOgorICAgICAgY2FzZSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVA6CisgICAgICBjYXNl IE1DX05PX0ZSSU5HRV9CSVRNQVA6CisgICAgICBjYXNlIE1DX05PX0NVUlNPUjoKKyAgICAgIGNh c2UgTUNfRlJBTUVEX0JPWDoK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3p2X3AgPSAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+ dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICYmIE1BVFJJWF9ST1dfRU5EX0NI QVJQT1MgKHJvdykgPT0gWlYpOworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1l KTsKKyAgTGlzcF9PYmplY3QgYnVmID0gdy0+Y29udGVudHM7CisgIENIRUNLX0JVRkZFUiAoYnVm KTsKKyAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKGJ1Zik7CisgIGludCB0ZXh0X2FyZWFf d2lkdGggPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOworICBzdHJ1Y3QgZ2x5cGhf cm93ICpjdXJzb3Jfcm93ID0gKHctPmN1cnNvci52cG9zICE9IC0xKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XIChjdXJzb3JfbWF0cml4LCB3LT5jdXJzb3Iu dnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTlVMTDsKKyAgc3RydWN0 IGdseXBoICpjdXJzb3JfZ2x5cGggPSAody0+Y3Vyc29yLnZwb3MgIT0gLTEpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBtY19nZXRfY3Vyc29yX2dseXBoICh3LCBjdXJzb3JfbWF0 cml4LCBjdXJzb3Jfcm93LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogTlVMTDsKKyAgYm9vbCBjdXJzb3JfYXRfZnJpbmdlX3Ag PSAoY3Vyc29yX2dseXBoID09IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg Y3Vyc29yX3JvdyAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1 cnNvci5ocG9zID09IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93LT5leGFjdF93aW5kb3dfd2lkdGhfbGluZV9wCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID09IHRleHRfYXJlYV93 aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA9PSBjdXJz b3Jfcm93LT5waXhlbF93aWR0aCk7CisgIGJvb2wgY3Vyc29yX2JleW9uZF9mcmluZ2VfcCA9IChj dXJzb3JfZ2x5cGggPT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg Y3Vyc29yX3JvdyAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5jdXJzb3IuaHBvcyA9PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmICFjdXJzb3Jfcm93LT5leGFjdF93aW5kb3dfd2lkdGhf bGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA+ PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHct PmN1cnNvci54ID49IGN1cnNvcl9yb3ctPnBpeGVsX3dpZHRoKTsKKyAgaW50IGZyYW1lX2NoYXJf d2lkdGggPSBGUkFNRV9DT0xVTU5fV0lEVEggKGYpOworICBpbnQgdGVtcF9mYWNlX2lkID0gZ2x5 cGgtPmZhY2VfaWQ7CisgIHN0cnVjdCBtY19SR0IgYmFja2dyb3VuZDsKKyAgbWNfc2V0X2xzbF9i ZyAodywgdGVtcF9mYWNlX2lkLCAmYmFja2dyb3VuZCk7CisgIGJvb2wgcmVhbF9mYWtlX2N1cnNv cl9wID0gKG9wb2ludF94ID09IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgb3BvaW50X2hwb3MgPT0gaHBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvcG9pbnRfeSA9PSByb3ctPnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3Bv aW50X3Zwb3MgPT0gdnBvcyk7CisKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAg ICAgICAgICAgICAgICAgIEJFR0lOOiAgQ0hBUl9HTFlQSCB8IEdMWVBITEVTU19HTFlQSCAgICAg ICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgaWYgKGdseXBoLT50 eXBlID09IENIQVJfR0xZUEgKKyAgICAgIHx8IGdseXBoLT50eXBlID09IEdMWVBITEVTU19HTFlQ SCkKKyAgeworICAgIGlmIChtY19zdGRlcnJfcCkKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAg ICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAl MS4xZCUxLjFkICAlM2QgJXMgJXNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVY VF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2Vk W2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgIChnbHlwaC0+dHlwZSA9 PSBDSEFSX0dMWVBICisgICAgICAgICA/ICdDJworICAgICAgICAgOiAnRycpLAorICAgICAgICBn bHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAg ID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAg ICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICAgICAgICBnbHlwaC0+ cGl4ZWxfd2lkdGgsCisgICAgICAgIGdseXBoLT51LmNoLAorICAgICAgICBnbHlwaC0+ZmFjZV9p ZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0 X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICIt LSIsCisgICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nIChnbHlwaC0+dS5jaCkpOworICBzd2l0Y2gg KGFjdGlvbl90eXBlKQorICB7CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAg ICAgICAgTVVMVElQTEVfQ1VSU09SUzogIENIQVJfR0xZUEggfCBHTFlQSExFU1NfR0xZUEggICAg ICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBNVUxUSVBM RV9DVVJTT1JTOgorICAgIHsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBo LCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdk LCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAor ICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLCBm cm9tX3doZXJlLCBjYWNoZV90eXBlLAorICAgICAgICAgICAgICAgICBhY3Rpb25fdHlwZSk7Cisg ICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAg ICAgICAgSE9SSVpPTlRBTF9SVUxFUjogIENIQVJfR0xZUEggfCBHTFlQSExFU1NfR0xZUEggICAg ICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBIT1JJWk9O VEFMX1JVTEVSOgorICAgIHsKKyAgICAgIGlmIChyZWxhdGl2ZV94IDwgcm93LT5waXhlbF93aWR0 aAorICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBlciAo dywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3Ms CisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZv cmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3Rp dmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwKKyAgICAgICAg ICAgICAgICAgICBhY3Rpb25fdHlwZSk7CisgICAgICBpZiAoZ2x5cGggLSByb3ctPmdseXBoc1tU RVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiByZWxhdGl2ZV94 IDw9IHhfbGltaXQpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAocmVsYXRpdmVfeCA8IHJvdy0+ cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0g Z2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICBmeCArPSBnbHlwaC0+cGl4ZWxfd2lk dGg7CisgICAgICAgICAgICB9CisgICAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywg Z2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAg ICAgICAgIHhfbGltaXQgLSByZWxhdGl2ZV94LCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRo LAorICAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwgZXNzZW50aWFs cy5hY3RpdmVfcCwgTUNfR0xZUEhMRVNTLAorICAgICAgICAgICAgICAgICAgICAgZHJhd19wLCBm cm9tX3doZXJlLCBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICAgIH0KKyAgICAgIGJy ZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICBW RVJUSUNBTF9SVUxFUjogIENIQVJfR0xZUEggfCBHTFlQSExFU1NfR0xZUEggICAgICAgICAgICAg ICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIFZFUlRJQ0FMX1JVTEVS OgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChjdXJzb3JfYXRf ZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPmNv bnRpbnVlZF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZF UlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgIXJvdy0+Y29udGludWVkX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9S SUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29y X2JleW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3ctPnVz ZWRbVEVYVF9BUkVBXSAhPSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9 PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBvcG9pbnRfeCA+PSByb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAoZ2x5cGhfenZfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogTUNfR0xZUEg7CisgICAgICBpZiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FM X0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNF RF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0g TUNfVkVSVElDQUxfQkFSX0JBQ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cmVhXSAtIDEK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3gg Pj0gcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog KGdseXBoX3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNf R0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICghTklMUCAo QlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF92ZXJ0aWNhbF9y dWxlcikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRf eSA9PSB5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRf dnBvcyA9PSB2cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1D X0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQ SDsKKyAgICAgIHdkID0gMTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBo LCByZWxhdGl2ZV94LCBmY19meCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAg IHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5k LAorICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIGRy YXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwK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BI KQorICB7CisgICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAg ICAgICAiXG4gJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNnggJTRkICUx LjFkJTEuMWQgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhU X0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRb YXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ1MnLAorICAgICAgICBn bHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAg ID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAg ICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxf d2lkdGgsCisgICAgICAgIDB1LAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5 cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisg ICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICJc XFMiKTsKKyAgc3dpdGNoIChhY3Rpb25fdHlwZSkKKyAgeworLyogLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t ICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgIE1VTFRJUExFX0NVUlNPU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gKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHks IGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwg Y3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICAg IGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUsIGNhY2hl X3R5cGUsCisgICAgICAgICAgICAgICAgICAgYWN0aW9uX3R5cGUpOworICAgICAgaWYgKGdseXBo IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAg ICAgJiYgcmVsYXRpdmVfeCA8PSB4X2xpbWl0KQorICAgICAgICB7CisgICAgICAgICAgaWYgKHJl bGF0aXZlX3ggPCByb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgcmVsYXRpdmVfeCArPSBn bHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgdGVtcF9mYWNlX2lkID0gKHJvdy0+ZmlsbF9s aW5lX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgPyBnbHlwaC0+ZmFjZV9pZAorICAgICAg ICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAgIHN0cnVjdCBt Y19SR0IgYmFja2dyb3VuZDsKKyAgICAgICAgICBtY19zZXRfbHNsX2JnICh3LCB0ZW1wX2ZhY2Vf aWQsICZiYWNrZ3JvdW5kKTsKKyAgICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBn bHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAg ICAgICAgeF9saW1pdCAtIHJlbGF0aXZlX3gsIGgsIGN1cnNvcl90eXBlLCB4X2xpbWl0IC0gcmVs YXRpdmVfeCwKKyAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQsIGJhY2tncm91bmQsIGVz c2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBITEVTUywKKyAgICAgICAgICAgICAgICAgICAgIGRy YXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAgICB9Cisg ICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAg ICAgICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIFNUUkVUQ0hfR0xZUEggICAgICAgICAg ICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBWRVJUSUNB TF9SVUxFUjoKKyAgICB7CisgICAgICBpZiAocm93LT5maWxsX2xpbmVfcAorICAgICAgICAgICYm IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisg ICAgICAgICAgJiYgb3BvaW50X3ggPiByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoKQor ICAgICAgICB0ZW1wX2ZhY2VfaWQgPSBnbHlwaC0+ZmFjZV9pZDsKKyAgICAgICAgZWxzZSBpZiAo IXJvdy0+ZmlsbF9saW5lX3AKKyAgICAgICAgICAgICAgICAgJiYgZ2x5cGggLSByb3ctPmdseXBo c1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgJiYg b3BvaW50X3ggPiByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoKQorICAgICAgICAgIHRl bXBfZmFjZV9pZCA9IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgIHN0cnVjdCBtY19SR0IgYmFja2dy b3VuZDsKKyAgICAgIG1jX3NldF9sc2xfYmcgKHcsIHRlbXBfZmFjZV9pZCwgJmJhY2tncm91bmQp OworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1cnNvcl9hdF9mcmluZ2Vf cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+Y29udGludWVk X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxf QkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vy c29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FS Uk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5b25k X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ct PnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+dXNlZFtURVhU X0FSRUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFy b3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiBNQ19HTFlQSExFU1M7CisgICAgICBpZiAoZ2x5cGhfZmxhdm9yID09 IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9 PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlw aF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgIHx8IGdseXBo X2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0g TUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICBjdXJzb3JfdHlwZSA9IE1DX1JJR0hU X0ZSSU5HRV9CSVRNQVA7CisgICAgICB3ZCA9IDE7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJp eCwgcm93LCBnbHlwaCwgb3BvaW50X3gsIG9wb2ludF9meCwgeSwgZnksIGhwb3MsIHZwb3MsCisg ICAgICAgICAgICAgICAgIHdkLCBoL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tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIEVORDogIFNUUkVUQ0hfR0xZUEggICAgICAgICAgICAgICAgICAgICAgICAgICAqLwor LyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyog ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCRUdJTjogIElNQUdFX0dMWVBIICAgICAgICAg ICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgZWxzZSBp ZiAoZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgIHsKKyAgICBpZiAobWNfc3RkZXJyX3Ap CisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICJcbiAlNSJwRCJkLyUtNWQgJTVkICVj ICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4xZCAgJTNkICVzICVjXG4iLAorICAg ICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2Vk W2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2 ZV94LAorICAgICAgICAnSScsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVG RkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJTkdQ IChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICAgIDogKE5JTFAg KGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICA/ICcwJworICAgICAgICAgICAgICAgOiAn LScpKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgKHVuc2lnbmVkIGlu dCkgZ2x5cGgtPnUuaW1nX2lkLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5 cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisg ICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcu Jyk7CisgIHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAq LworLyogICAgICAgICAgICAgICAgICAgICAgICAgTVVMVElQTEVfQ1VSU09SUzogIElNQUdFX0dM WVBIICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAg ICBjYXNlIE1VTFRJUExFX0NVUlNPUlM6CisgICAgeworICAgICAgY3Vyc29yX3R5cGUgPSBNQ19I T0xMT1dfQk9YOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0 aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1 cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAg ICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hl cmUsIGNhY2hlX3R5cGUsCisgICAgICAgICAgICAgICAgIGFjdGlvbl90eXBlKTsKKyAgICAgIGJy ZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAg ICAgICAgICAgSE9SSVpPTlRBTF9SVUxFUjogIElNQUdFX0dMWVBIICAgICAgICAgICAgICAgICAg ICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEhPUklaT05UQUxfUlVM RVI6CisgICAgeworICAgICAgY3Vyc29yX3R5cGUgPSBNQ19IT0xMT1dfQk9YOworICAgICAgaWYg KCFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3cs IGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAg ICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tn cm91bmQsCisgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEgs IGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwKKyAgICAgICAgICAgICAgICAgICBhY3Rp b25fdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8K Ky8qICAgICAgICAgICAgICAgICAgICAgICAgICAgVkVSVElDQUxfUlVMRVI6ICBJTUFHRV9HTFlQ SCAgICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAg Y2FzZSBWRVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAgICBjdXJzb3JfdHlwZSA9IE1DX0hPTExP V19CT1g7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVf eCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICB3ZCwgaCwgY3Vyc29y X3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwKKyAgICAgICAgICAg ICAgICAgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwg Y2FjaGVfdHlwZSwKKyAgICAgICAgICAgICAgICAgYWN0aW9uX3R5cGUpOworICAgICAgYnJlYWs7 CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAg ICAgICAgICBGSUxMX0NPTFVNTjogIElNQUdFX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICAg Ki8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgRklMTF9DT0xVTU46CisgICAg eworICAgICAgY3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0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAg ICAgICAgICAgQkVHSU46ICBDT01QT1NJVEVfR0xZUEggICAgICAgICAgICAgICAgICAgICAgICAg ICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0g Q09NUE9TSVRFX0dMWVBIKQorICB7CisgICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAgeworICAg ICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQgJWMg JTkicEQiZCAlYyAlM2QgMHglMDZ4IiwKKyAgICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RF WFRfQVJFQV0sCisgICAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51 c2VkW2FyZWFdIC0gMSksCisgICAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgICAnKycsCisg ICAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmpl Y3QpCisgICAgICAgICAgID8gJ0InCisgICAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmpl Y3QpCisgICAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5v YmplY3QpCisgICAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAgICAgIDogJy0nKSkp LAorICAgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgICAodW5zaWduZWQgaW50 KSBnbHlwaC0+dS5jbXAuaWQpOworICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIgJTRkICUxLjFk JTEuMWQiLAorICAgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICAgIGdseXBoLT5sZWZ0 X2JveF9saW5lX3AsCisgICAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3ApOworICAgICAg aWYgKGdseXBoLT51LmNtcC5hdXRvbWF0aWMpCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAg JTNkICVzIC4gWyVkLSVkXVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaC0+aHBv cywgZ2x5cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAgICAgICAgICAgICAgICAgIGds eXBoLT5zbGljZS5jbXAuZnJvbSwgZ2x5cGgtPnNsaWNlLmNtcC50byk7CisgICAgICAgIGVsc2UK KyAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJcbiIpOworICAgICAgfQorICBzd2l0Y2ggKGFj dGlvbl90eXBlKQorICB7CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAg ICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTOiAgQ09NUE9TSVRFX0dMWVBIICAgICAgICAgICAg ICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBNVUxUSVBMRV9D VVJTT1JTOgorICAgIHsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCBy ZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBo LCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3Jl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nVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYgcmVsYXRpdmVfeCA8PSB4X2xpbWl0 KQorICAgICAgICB7CisgICAgICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7 CisgICAgICAgICAgd2hpbGUgKHJlbGF0aXZlX3ggPD0geF9saW1pdCkKKyAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZl X3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICB3ZCwg aCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBNQ19HTFlQSExFU1Ms IGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBjYWNoZV90eXBl LCBhY3Rpb25fdHlwZSk7CisgICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZnJhbWVfY2hhcl93 aWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorLyog LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICBWRVJUSUNB TF9SVUxFUjogIENPTVBPU0lURV9HTFlQSCAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgVkVSVElDQUxfUlVMRVI6CisgICAgeworICAgICAg ZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+Y29udGludWVkX3ApCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX0JBQ0tT TEFTSAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2Zy aW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT5j b250aW51ZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJv dy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5b25kX2ZyaW5nZV9w CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRl ZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1D X1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdICE9 IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5j YXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVh XSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF94 ID49IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IChnbHlwaF96dl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1D X0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQ SDsKKyAgICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9X CisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9S SUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJf QkFDS1NMQVNICisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUgor ICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisg ICAgICAgIGN1cnNvcl90eXBlID0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUDsKKyAgICAgIHdkID0g MTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBv cG9pbnRfZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICB3ZCwgaCwgY3Vy c29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwKKyAgICAgICAg ICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCBkcmF3X3AsIGZyb21f d2hlcmUsCisgICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAg IGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAg ICAgICAgICAgICAgIEZJTExfQ09MVU1OOiAgQ09NUE9TSVRFX0dMWVBIICAgICAgICAgICAgICAg ICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEZJTExfQ09MVU1O OgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChnbHlwaCAtIHJv dy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+IHJlbGF0aXZlX3gp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF96dl9wKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoIU5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMp KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3kgPT0geQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3Zwb3MgPT0gdnBvcykKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfR0xZUEg7CisgICAgICB3ZCA9IDE7Cisg ICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZmNfZngs IHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUs IGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwKKyAgICAgICAgICAgICAgICAg ZXNzZW50aWFscy5hY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCBkcmF3X3AsIGZyb21fd2hlcmUsIGNh Y2hlX3R5cGUsCisgICAgICAgICAgICAgICAgIGFjdGlvbl90eXBlKTsKKyAgICAgIGJyZWFrOwor ICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0t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iAgJTVkLyUtNWQgJTVkICU0 YyAlNmQgJWMgJTNkIDB4JTA1eCAlNGQgJTEuMWQlMS4xZCAgJTNkICVzICVjXG4iLAorICAgICAg ICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2VkW2Fy ZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94 LAorICAgICAgICAnWCcsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVS UCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJTkdQIChn bHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICAgIDogJy0nKSksCisg ICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAg ICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGlu ZV9wLAorICAgICAgICBnbHlwaC0+dS54d2lkZ2V0LAorICAgICAgICBnbHlwaC0+aHBvcywgZ2x5 cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAnLicpOworI2VuZGlmCisgIHN3aXRjaCAo YWN0aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAg ICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTOiAgWFdJREdFVF9HTFlQSCAgICAgICAgICAg ICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIE1VTFRJUExF X0NVUlNPUlM6CisgICAgeworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgs IHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2Qs IGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisg ICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGZy b21fd2hlcmUsIGNhY2hlX3R5cGUsCisgICAgICAgICAgICAgICAgIGFjdGlvbl90eXBlKTsKKyAg ICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAg ICAgICAgICAgICAgICBIT1JJWk9OVEFMX1JVTEVSOiAgWFdJREdFVF9HTFlQSCAgICAgICAgICAg ICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEhPUklaT05U QUxfUlVMRVI6CisgICAgeworICAgICAgaWYgKHJlbGF0aXZlX3ggPD0geF9saW1pdAorICAgICAg ICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4 LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAg ICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQs IGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNf R0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwKKyAgICAgICAgICAgICAgICAg ICBhY3Rpb25fdHlwZSk7CisgICAgICBpZiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFd ID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiByZWxhdGl2ZV94IDw9IHhfbGlt aXQpCisgICAgICAgIHsKKyAgICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0 aDsKKyAgICAgICAgICB3aGlsZSAocmVsYXRpdmVfeCA8PSB4X2xpbWl0KQorICAgICAgICAgICAg eworICAgICAgICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRp dmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgIHdk LCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAor ICAgICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBITEVT UywgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICAgICAgICAgIGNhY2hlX3R5 cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgICAgICAgICAgcmVsYXRpdmVfeCArPSBmcmFtZV9jaGFy X3dpZHRoOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9Cisv KiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICBWRVJU SUNBTF9SVUxFUjogIFhXSURHRVRfR0xZUEggICAgICAgICAgICAgICAgICAgICAqLworLyogLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBWRVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAg ICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT5jb250aW51ZWRfcCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfQkFD S1NMQVNICisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRf ZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ct PmNvbnRpbnVlZF9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAh cm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdl X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNh dGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g TUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0g IT0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1 bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2Fy ZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50 X3ggPj0gcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogKGdseXBoX3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g TUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0dM WVBIOworICAgICAgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJS T1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFS X1JJR0hUX0FSUk9XCisgICAgICAgICAgfHw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HNbVEVY VF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID4gcmVsYXRpdmVfeCkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX3p2X3ApCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6ICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBvcG9pbnRfeSA9PSB5CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBvcG9pbnRfdnBvcyA9PSB2cG9zKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCBy b3csIGdseXBoLCByZWxhdGl2ZV94LCBmY19meCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAg ICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBi YWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBnbHlwaF9m bGF2b3IsIGRyYXdfcCwgZnJvbV93aGVyZSwKK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jvd19wb3NpdGlvbiByb3dfcG9zaXRpb24sCisgICAgICAgICAgICAgYm9vbCBkcmF3X3As IGVudW0gbWNfZHJhd19yb3dfdHlwZSBmcm9tX3doZXJlKQoreworICAvLyAgY2xvY2tfdCBjbG9j a19zdGFydCA9IGNsb2NrKCk7CisgIC8qIFczMiBFbWFjcyBjcmFzaGVzIG9uIHN0YXJ0dXAgd2l0 aG91dCBhIGBCVUZGRVJQJyBjaGVjayBpbiBgdXBkYXRlX3dpbmRvdycuICovCisgIGlmICghQlVG RkVSUCAody0+Y29udGVudHMpKQorICAgIHJldHVybjsKKyAgaWYgKE5JTFAgKEJWQVIgKFhCVUZG RVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpCisgICAgcmV0dXJuOworICBpZiAodnBvcyA9 PSBib3R0b21fdnBvcykKKyAgICByZXR1cm47CisgIGlmICghcm93LT51c2VkW1RFWFRfQVJFQV0p CisgICAgcmV0dXJuOworICBpbnQgaHBvc19zdGFydCA9IHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVY VF9BUkVBXTsKKyAgaWYgKHRyYWNlX3JlZGlzcGxheV9wKQorICAgIGZwcmludGYgKHN0ZGVyciwg Im1jX2RyYXdfcm93ICglZCk6ICBkcmF3X3AgKCVzKSB8IGhwb3MgKCVkKSB8IGxlbiAoJWQpXG4i LAorICAgICAgICAgICAgICAgICAgICAgdnBvcywgZHJhd19wID8gInkiIDogIm4iLCBocG9zX3N0 YXJ0LCBocG9zX2xlbmd0aCk7CisgIExpc3BfT2JqZWN0IGJ1ZiA9IHctPmNvbnRlbnRzOworICBD SEVDS19CVUZGRVIgKGJ1Zik7CisgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSIChidWYpOwor ICBpbnQgb3BvaW50X2Z4LCBvcG9pbnRfZnksIG9wb2ludF93ZCwgb3BvaW50X2g7CisgIGludCB0 ZXh0X2FyZWFfd2lkdGggPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOworICBpbnQg aGVhZGVyX2xpbmVfZm9ybWF0ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgIHN0 cnVjdCBnbHlwaF9yb3cgKmN1cnNvcl9yb3cgPSAody0+Y3Vyc29yLnZwb3MgIT0gLTEpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1BVFJJWF9ST1cgKGN1cnNvcl9tYXRyaXgs IHctPmN1cnNvci52cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOVUxM OworICBzdHJ1Y3QgZ2x5cGggKmN1cnNvcl9nbHlwaCA9ICh3LT5jdXJzb3IudnBvcyAhPSAtMSkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcs IGN1cnNvcl9tYXRyaXgsIGN1cnNvcl9yb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3Mp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOVUxMOworICBib29sIGN1cnNvcl9h dF9mcmluZ2VfcCA9IChjdXJzb3JfZ2x5cGggPT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBjdXJzb3Jfcm93ICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3ctPmV4YWN0X3dpbmRvd193aWR0 aF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0g dGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNv ci54ID09IGN1cnNvcl9yb3ctPnBpeGVsX3dpZHRoKTsKKyAgYm9vbCBjdXJzb3JfYmV5b25kX2Zy aW5nZV9wID0gKGN1cnNvcl9nbHlwaCA9PSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBjdXJzb3Jfcm93ICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHctPmN1cnNvci5ocG9zID09IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIWN1cnNvcl9yb3ctPmV4YWN0X3dp bmRvd193aWR0aF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHct PmN1cnNvci54ID49IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgdy0+Y3Vyc29yLnggPj0gY3Vyc29yX3Jvdy0+cGl4ZWxfd2lkdGgpOworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgIFJFUExBQ0UgVEhF IFJFQUwgQ1VSU09SCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAgZW51bSBmYWNlX2lkIGJn X2ZhY2VfaWQgPSAoY3Vyc29yX2dseXBoICE9IE5VTEwpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBjdXJzb3JfZ2x5cGgtPmZhY2VfaWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgc3RydWN0IG1jX1JHQiBjdXJzb3JfYmc7CisgIG1jX3Nl dF9sc2xfYmcgKHcsIGJnX2ZhY2VfaWQsICZjdXJzb3JfYmcpOworICAvKiBGSVhNRTogIFB1dCBp biBzb21lIGNvZGUgdG8gZGVmYXVsdCB0byBNQ19IT0xMT1dfQk9YIGlmIHRoZSB1c2VyIGhhcwor ICB1bndpdHRpbmdseSBjb21lIHVwIHdpdGggc29tZSB1bmFjY2VwdGFibGUgZm9ybSBvZiB1bnJl Y29nbml6ZWQgY3Vyc29yIHR5cGUuICovCisgIExpc3BfT2JqZWN0IGxpc3BfdHlwZSA9IEJWQVIg KGIsIG1jX3JlYWxfZmFrZV9jdXJzb3IpOworICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90 eXBlID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoWENBUiAobGlzcF90eXBlKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IG1jX2xpc3BfdG9fY3Vyc29y X3R5cGUgKGxpc3BfdHlwZSk7CisgIGludCBjdXJzb3Jfd2lkdGggPSAoQ09OU1AgKGxpc3BfdHlw ZSkpCisgICAgICAgICAgICAgICAgICAgICA/IFhGSVhOVU0gKFhDQVIgKFhDRFIgKGxpc3BfdHlw ZSkpKQorICAgICAgICAgICAgICAgICAgICAgOiAtMTsKKyAgc3RydWN0IG1jX1JHQiBjdXJzb3Jf Zmc7CisgIG1jX2NvbG9yX3BpY2tlciAodywgY3Vyc29yX2dseXBoLCBlc3NlbnRpYWxzLCAmY3Vy c29yX2ZnLCAtMSwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgcm93X3Bvc2l0 aW9uLCBDVVJTT1JfSU5ESUNBVE9SKTsKKyAgYm9vbCBmaWxsX2NvbHVtbl90cnVtcHNfcCA9ICgh TklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2li bGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID09IGVz c2VudGlhbHMuZmNfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFjdXJzb3Jf YXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhY3Vyc29yX2Jl eW9uZF9mcmluZ2VfcCk7CisgIC8qIFdlIHVzZSBhIHRlc3Qgc2ltaWxhciB0byB0aGUgcmVhbCBm YWtlIGN1cnNvciBzbyB0aGF0IHRoZSBmcmluZ2UgYml0bWFwIGlzCisgIG9ubHkgZHJhd24gb25j ZSBwZXIgd2luZG93LiAqLworICBpZiAodnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAgJiYg aHBvc19zdGFydCArIGhwb3NfbGVuZ3RoID09IHJvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAm JiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAg ICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2hvcml6b250YWxfcnVs ZXIpKSkKKyAgICB7CisgICAgICAvKiBmcmluZ2UgYml0bWFwcyB1c2UgZmFjZV9pZCB0byBzZXQg dGhlIGZvcmVncm91bmQgY29sb3IuICBUaGUgb3ZlcmxheS1hcnJvdworICAgICAgaXMgcHJlc2Vu dGx5IHRoZSBvbmx5IHNpdHVhdGlvbiB3aGVyZSB0aGUgYGVzc2VudGlhbHMuYWN0aXZlX3BgIGFu ZCBgbWluaW1hbF9wYCBhcmUKKyAgICAgIHVzZWQgdG8gZGV0ZXJtaW5lIHRoZSBhcHBsaWNhYmxl IGZhY2VfaWQuICovCisgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZyA9IHsucmVkID0gLTEuMCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IC0xLjAsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IC0xLjB9OworICAgICAgLyogV2UgdXNlIHRoZSBm aXJzdCBnbHlwaCBpbiB0aGUgcm93LCB3aXRoIGFuIFggYW5kIEhQT1Mgb2YgemVyby4gKi8KKyAg ICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sIDAs IC0xLCB3LT5jdXJzb3IueSwgLTEsCisgICAgICAgICAgICAgICAgIDAsIHctPmN1cnNvci52cG9z LCAtMSwgLTEsIE1DX0xFRlRfRlJJTkdFX0JJVE1BUCwgLTEsCisgICAgICAgICAgICAgICAgIGxz bF9mZywgY3Vyc29yX2JnLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBNQ19PVkVSTEFZX0FSUk9XX0JJ VE1BUCwgZHJhd19wLAorICAgICAgICAgICAgICAgICBmcm9tX3doZXJlLCBDSF9DQUNIRSwgQ1VS U09SX0lORElDQVRPUik7CisgICAgfQorICBpZiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAm JiB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA+PSBocG9z X3N0YXJ0CisgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBocG9zX3N0YXJ0ICsgaHBvc19sZW5n dGgKKyAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFp cnMpKQorICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaG9y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fc3RhcnQKKyAgICAgICAgICAgJiYgKGhwb3Nf c3RhcnQgKyBocG9zX2xlbmd0aCkgPT0gcm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAg JiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAg ICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2hvcml6b250 YWxfcnVsZXIpKSkKKyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSBN Q19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XOworICAgICAgc3RydWN0IGds eXBoICpnbHlwaCA9IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICBzdHJ1Y3QgZ2x5cGgg KmdseXBoX2VuZCA9IGdseXBoICsgcm93LT51c2VkW1RFWFRfQVJFQV07CisgICAgICAvKiBHbHlw aCBmb3IgYSBsaW5lIGVuZCBpbiB0ZXh0LiAqLworICAgICAgaWYgKGdseXBoID09IGdseXBoX2Vu ZCAmJiBnbHlwaC0+Y2hhcnBvcyA+IDApCisgICAgICAgICsrZ2x5cGhfZW5kOworICAgICAgbWNf aGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGhfZW5kIC0gMSwgcm93LT5waXhlbF93aWR0aCwg LTEsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICAtMSwgcm93LT51c2VkW1RFWFRfQVJF QV0gLSAxLCB3LT5jdXJzb3IudnBvcywgLTEsIC0xLAorICAgICAgICAgICAgICAgICBNQ19SSUdI VF9GUklOR0VfQklUTUFQLCAtMSwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsIGVzc2VudGlhbHMuYWN0 aXZlX3AsCisgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgZHJhd19wLCBmcm9tX3doZXJl LCBDSF9DQUNIRS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ICBtY19oZWxwZXIgKHcsIG1hdHJp eCwgcm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1cnNvci54LCBvcG9pbnRfZngsIHctPmN1cnNvci55 LAorICAgICAgICAgICAgICAgICBvcG9pbnRfZnksIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3Iu dnBvcywgb3BvaW50X3dkLCBvcG9pbnRfaCwKKyAgICAgICAgICAgICAgICAgTUNfQkFSLCAxLCBj dXJzb3JfZmcsIGN1cnNvcl9iZywgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEhMRVNTLAor ICAgICAgICAgICAgICAgICBkcmF3X3AsIGZyb21fd2hlcmUsIE5JTFAgKEJWQVIgKFhCVUZGRVIg KHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBDSF9DQUNIRQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog TUNfQ0FDSEUsIENVUlNPUl9JTkRJQ0FUT1IpOworICAgICAgbWNfZ2V0X2N1cnNvcl9nZW9tZXRy eSAodywgbWF0cml4LCByb3csIHctPmN1cnNvci54LCAmb3BvaW50X2Z4LCB3LT5jdXJzb3IueSwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZvcG9pbnRfZnksIHctPmN1cnNvci5ocG9z LCB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgTUNfSEJBUiwgMSwgJm9wb2ludF93ZCk7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwg cm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1cnNvci54LCBvcG9pbnRfZngsIHctPmN1cnNvci55LAor ICAgICAgICAgICAgICAgICBvcG9pbnRfZnksIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBv cywgb3BvaW50X3dkLCBvcG9pbnRfaCwKKyAgICAgICAgICAgICAgICAgTUNfSEJBUiwgMSwgY3Vy c29yX2ZnLCBjdXJzb3JfYmcsIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3As CisgICAgICAgICAgICAgICAgIGZyb21fd2hlcmUsIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gQ0hfQ0FD SEUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19DQUNIRSwgQ1VSU09SX0lORElD QVRPUik7CisgICAgfQorICBlbHNlIGlmICghY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAg ICYmIGN1cnNvcl9nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29y LnZwb3MKKyAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPj0gaHBvc19zdGFydAorICAgICAg ICAgICAmJiB3LT5jdXJzb3IuaHBvcyA8IGhwb3Nfc3RhcnQgKyBocG9zX2xlbmd0aAorICAgICAg ICAgICAmJiBjdXJzb3JfZ2x5cGgtPnR5cGUgIT0gU1RSRVRDSF9HTFlQSCkKKyAgICB7CisgICAg ICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZv cG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9w b2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCAmb3Bv aW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwg dy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAgICAgICAgIG9w b2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCBvcG9pbnRfd2QsIG9wb2lu dF9oLAorICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBjdXJzb3Jf ZmcsIGN1cnNvcl9iZywgZXNzZW50aWFscy5hY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgTUNf R0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBDSF9DQUNIRQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IE1DX0NBQ0hFLCBDVVJTT1JfSU5ESUNBVE9SKTsKKyAgICB9CisgIGVsc2UgaWYg KCFjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoICE9IE5VTEwK KyAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAgICAgICAmJiB3LT5j dXJzb3IuaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zIDwg aHBvc19zdGFydCArIGhwb3NfbGVuZ3RoCisgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+dHlw ZSA9PSBTVFJFVENIX0dMWVBIKQorICAgIHsKKyAgICAgIC8qIElmIGEgdXNlciBoYXMgc2V0IGB4 LXN0cmV0Y2gtY3Vyc29yJyB0byBhIG5vbi1uaWwgdmFsdWUsIGhlL3NoZSBjaG9zZSB0bworICAg ICAgaGF2ZSBhIGN1cnNvciB0aGF0IHNwYW5zIHRoZSBlbnRpcmUgbGVuZ3RoIG9mIHRoZSBTVFJF VENIX0dMWVBILiAqLworICAgICAgaWYgKCF4X3N0cmV0Y2hfY3Vyc29yX3ApCisgICAgICAgIHsK KyAgICAgICAgICAvKiBUaGUgTUNfSEJBUiBzaGFsbCBoYXZlIGEgYGN1cnNvcl93aWR0aGAgb2Yg MS4gKi8KKyAgICAgICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywg dy0+Y3Vyc29yLngsICZvcG9pbnRfZngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgdy0+Y3Vyc29yLnksICZvcG9pbnRfZnksIHctPmN1cnNvci5ocG9zLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsIE1DX0hCQVIs IDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF93ZCk7CisgICAg ICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgY3Vyc29yX2dseXBoLCB3LT5jdXJzb3Iu eCwgb3BvaW50X2Z4LAorICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLnksIG9wb2ludF9m eSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLAorICAgICAgICAgICAgICAgICAgICAg b3BvaW50X3dkLCBvcG9pbnRfaCwgTUNfSEJBUiwgMSwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsCisg ICAgICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19w LCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICAgICAgTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUK KyAgICAgICAgICAgICAgICAgICAgIDogTUNfQ0FDSEUsIENVUlNPUl9JTkRJQ0FUT1IpOworICAg ICAgICB9CisgICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+ Y3Vyc29yLngsICZvcG9pbnRfZngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5j dXJzb3IueSwgJm9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLCBjdXJzb3JfdHlwZSwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgJm9wb2ludF93ZCk7CisgICAg ICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1cnNvci54LCBv cG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICBvcG9pbnRfZnksIHctPmN1 cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgb3BvaW50X3dkLCBvcG9pbnRfaCwKKyAgICAgICAg ICAgICAgICAgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcs IGVzc2VudGlhbHMuYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgIE1DX0dMWVBILCBkcmF3X3As IGZyb21fd2hlcmUsIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gQ0hfQ0FD SEUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19D QUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgfQorLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq CisgICAgICAgICAgICAgICAgICAgICAgICAgIERSQVcgQU5EIFJFQ09SRCBGQUtFIENVUlNPUlMK KyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworICBpZiAoaHBvc19sZW5ndGggPT0gMSkKKyAgICB7 CisgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikp KQorICAgICAgICB7CisgICAgICAgICAgLyogVGhlIHNwYWNlIGFwcGVuZGVkIHRvIGEgcm93IGVu ZGluZyB3aXRoIGEgbmV3IGxpbmUKKyAgICAgICAgICBkb2VzIG5vdCBoYXZlIGEgYGdseXBoLT5j aGFycG9zYCAoLTEsIDApIHRoYXQgd2UgY2FuCisgICAgICAgICAgdXNlIGZvciB0aGlzIHBhcnRp Y3VsYXIgYXBwbGljYXRpb24uICBXaGVuIHRoZXJlIGlzIGEKKyAgICAgICAgICBgYnVmZmVyLWRp c3BsYXktdGFibGUnIGVudHJ5IHRoYXQgYXNzaWducyBhIHZpc2libGUKKyAgICAgICAgICBnbHlw aCB0byBhIG5ldyBsaW5lLCB0aGVyZSBpcyBubyBwcm9ibGVtIGJlY2F1c2UgdGhhdAorICAgICAg ICAgIGdseXBoIGhhcyBhIGBnbHlwaC0+Y2hhcnBvcycgdGhhdCB3ZSBjYW4gdXNlLiAgV2hlbgor ICAgICAgICAgIG5vIHZpc2libGUgRU9MIGdseXBoIGV4aXN0cywgd2UgdXNlIHRoZSBmb2xsb3dp bmcKKyAgICAgICAgICB0ZXN0OiAgdGhlIGFwcGVuZGVkIHNwYWNlIGhhcyBhIHBvc2l0aW9uIHRo YXQgaXMgb25lCisgICAgICAgICAgbGVzcyB0aGFuIHRoZSBlbmQgb2YgdGhlIG1hdHJpeCByb3cu ICovCisgICAgICAgICAgaW50IGhwb3MgPSBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07 CisgICAgICAgICAgc3RydWN0IGdseXBoICpwcmV2aW91c19nbHlwaCA9ICgwIDw9IGhwb3MgLSAx ICYmIGhwb3MgLSAxIDwgcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIGhwb3MgLSAx CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTlVMTDsKKyAgICAg ICAgICAvLyBzdHJ1Y3QgZ2x5cGggKmxhc3RfZ2x5cGggPSByb3ctPmdseXBoc1tURVhUX0FSRUFd ICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxOworICAgICAgICAgIGJvb2wgc2tpcF9wID0gKHBy ZXZpb3VzX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiBwcmV2aW91 c19nbHlwaC0+Y2hhcnBvcyA9PSBNQVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpIC0gMQorICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHN0YXJ0LT5ieXRlcG9zICE9IGVzc2VudGlhbHMuenZf Ynl0ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgPyB0cnVlCisgICAgICAgICAgICAgICAg ICAgICAgICAvKiBXaGVuIGEgYGJ1ZmZlci1kaXNwbGF5LXRhYmxlJyBlbnRyeSBjb250YWlucwor ICAgICAgICAgICAgICAgICAgICAgICAgYSB2aXNpYmxlIHRhYiBjaGFyYWN0ZXIgKCLCuyIpLCB0 aGUgc3Vic2VxdWVudAorICAgICAgICAgICAgICAgICAgICAgICAgU1RSRVRDSF9HTFlQSCB3aWxs IGhhdmUgdGhlIHNhbWUgc3RhcnQtPmNoYXJwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgIGFz IHRoZSBhZm9yZW1lbnRpb25lZCB2aXNpYmxlIHRhYiBjaGFyYWN0ZXIuICovCisgICAgICAgICAg ICAgICAgICAgICAgICA6IChwcmV2aW91c19nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBwcmV2aW91c19nbHlwaC0+Y2hhcnBvcyA9PSBzdGFydC0+Y2hhcnBvcykK KyAgICAgICAgICAgICAgICAgICAgICAgICAgPyB0cnVlCisgICAgICAgICAgICAgICAgICAgICAg ICA6IGZhbHNlOworICAgICAgICAgIGludCBwb3NpbnQgPSAocm93X3Bvc2l0aW9uID09IFBPU1Rf WlYpCisgICAgICAgICAgICAgICAgICAgICAgICAgPyAtMQorICAgICAgICAgICAgICAgICAgICAg ICA6IChyb3dfcG9zaXRpb24gPT0gQVRfWlYpCisgICAgICAgICAgICAgICAgICAgICAgICAgID8g ZXNzZW50aWFscy56dgorICAgICAgICAgICAgICAgICAgICAgICA6IChzdGFydC0+Ynl0ZXBvcyAh PSBlc3NlbnRpYWxzLnp2X2J5dGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgc3RhcnQg LSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICA/IE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgLSAx CisgICAgICAgICAgICAgICAgICAgICAgIDogKHN0YXJ0LT5ieXRlcG9zID09IGVzc2VudGlhbHMu enZfYnl0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBzdGFydCAtIHJvdy0+Z2x5cGhz W1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKQorICAgICAgICAgICAgICAg ICAgICAgICAgID8gZXNzZW50aWFscy56dgorICAgICAgICAgICAgICAgICAgICAgICA6IHN0YXJ0 LT5jaGFycG9zOworICAgICAgICAgIExpc3BfT2JqZWN0IHNwZWNzID0gbWNfYXNzb2MgKG1ha2Vf Zml4bnVtIChwb3NpbnQpLCBCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKTsK KyAgICAgICAgICBpZiAoKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAg ICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAgICYm ICFOSUxQIChzcGVjcykKKyAgICAgICAgICAgICAgJiYgcm93LT55IDw9IHdpbmRvd190ZXh0X2Jv dHRvbV95ICh3KQorICAgICAgICAgICAgICAmJiAhc2tpcF9wCisgICAgICAgICAgICAgICYmIHJv d19wb3NpdGlvbiAhPSBQT1NUX1pWKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBMaXNw X09iamVjdCBsaXNwX3R5cGUgPSBtY19udGggKDEsIHNwZWNzKTsKKyAgICAgICAgICAgICAgZW51 bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSA9IChDT05TUCAobGlzcF90eXBlKSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfbGlzcF90b19j dXJzb3JfdHlwZSAoWENBUiAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogbWNfbGlzcF90b19jdXJzb3JfdHlwZSAobGlzcF90eXBl KTsKKyAgICAgICAgICAgICAgY3Vyc29yX3R5cGUgPSAoc3RhcnQtPnR5cGUgPT0gSU1BR0VfR0xZ UEgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19IT0xMT1dfQk9YCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiBjdXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAgaW50IGN1 cnNvcl93aWR0aCA9IChDT05TUCAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gWEZJWE5VTSAoWENBUiAoWENEUiAobGlzcF90eXBlKSkpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IC0xOworICAgICAgICAgICAgICBMaXNwX09iamVjdCBt Y19mb3JlZ3JvdW5kID0gbWNfbnRoICgyLCBzcGVjcyk7CisgICAgICAgICAgICAgIHN0cnVjdCBt Y19SR0IgbHNsX2ZnOworICAgICAgICAgICAgICBpZiAoU1RSSU5HUCAobWNfZm9yZWdyb3VuZCkp CisgICAgICAgICAgICAgICAgbWNfeHdfY29sb3JfdmFsdWVzICh3LCBtY19mb3JlZ3JvdW5kLCAm bHNsX2ZnKTsKKyAgICAgICAgICAgICAgICBlbHNlIGlmIChWRUNUT1JQIChtY19mb3JlZ3JvdW5k KSkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbHNsX2ZnLnJlZCA9 IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3JvdW5kLCAwKSk7CisgICAgICAgICAgICAgICAg ICAgIGxzbF9mZy5ncmVlbiA9IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3JvdW5kLCAxKSk7 CisgICAgICAgICAgICAgICAgICAgIGxzbF9mZy5ibHVlID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1j X2ZvcmVncm91bmQsIDIpKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAg IGVsc2UgaWYgKE5JTFAgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgICAgICBtY19j b2xvcl9waWNrZXIgKHcsIHN0YXJ0LCBlc3NlbnRpYWxzLCAmbHNsX2ZnLCBwb3NpbnQsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUsIHJvd19wb3Np dGlvbiwgTVVMVElQTEVfQ1VSU09SUyk7CisgICAgICAgICAgICAgIGludCB2cG9zID0gTUFUUklY X1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gd2lu ZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgICAgbWNfZW5naW5lICh3 LCBtYXRyaXgsIHJvdywgc3RhcnQsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwgcm93LT55LAorICAg ICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwgdnBv cywgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoLCBj dXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sCisgICAgICAgICAgICAgICAg ICAgICAgICAgbHNsX2ZnLCBNVUxUSVBMRV9DVVJTT1JTLCBkcmF3X3AsIGZyb21fd2hlcmUsIE1D X0NBQ0hFKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKCFOSUxQIChCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQorICAgICAgICAgICYmIGVzc2Vu dGlhbHMuZmNfeCA8PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZj X3ggPj0gdy0+bWMubG51bV9waXhlbF93aWR0aCkKKyAgICAgICAgeworICAgICAgICAgIGludCB4 X2xpbWl0ID0geCArIHN0YXJ0LT5waXhlbF93aWR0aDsKKyAgICAgICAgICBib29sIHJlYWxfZmFr ZV9jdXJzb3JfcCA9ICh3LT5jdXJzb3IueCA9PSBlc3NlbnRpYWxzLmZjX3gKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueSA9PSByb3ctPnkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBzdGFy dCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiB3LT5jdXJzb3IudnBvcyA9PSB2cG9zKTsKKyAgICAgICAgICBzdHJ1Y3QgbWNf UkdCIGxzbF9mZzsKKyAgICAgICAgICBtY19jb2xvcl9waWNrZXIgKHcsIHN0YXJ0LCBlc3NlbnRp YWxzLCAmbHNsX2ZnLCAtMSwgTUNfQkFSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg cm93X3Bvc2l0aW9uLCBGSUxMX0NPTFVNTik7CisgICAgICAgICAgaWYgKHggKyBzdGFydC0+cGl4 ZWxfd2lkdGggPD0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICYmICgoaGVhZGVyX2xp bmVfZm9ybWF0ID4gMCAmJiB2cG9zID4gMCkKKyAgICAgICAgICAgICAgICAgIHx8IGhlYWRlcl9s aW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAgICAmJiAoKHN0YXJ0ICE9IHJvdy0+Z2x5cGhz W1RFWFRfQVJFQV0gKyByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEKKyAgICAgICAgICAgICAgICAg ICAmJiBlc3NlbnRpYWxzLmZjX3ggPj0geAorICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlh bHMuZmNfeCA8IHggKyBzdGFydC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICB8fCAo c3RhcnQgPT0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFdIC0g MQorICAgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSB4KSkKKyAgICAg ICAgICAgICAgJiYgcm93LT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAgICAg ICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAgICAgbWNfZW5naW5lICh3LCBt YXRyaXgsIHJvdywgc3RhcnQsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwgcm93LT55LAorICAgICAg ICAgICAgICAgICAgICAgICBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sIHZwb3MsIE1D X0JBUiwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFs cywgcm93X3Bvc2l0aW9uLCBsc2xfZmcsCisgICAgICAgICAgICAgICAgICAgICAgIEZJTExfQ09M VU1OLCBkcmF3X3AsIGZyb21fd2hlcmUsIEZDX0NBQ0hFKTsKKyAgICAgICAgfQorICAgICAgaWYg KCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAg ICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9ob3Jpem9udGFsX3J1bGVyKSkKKyAgICAgICAgICAm JiB2cG9zID09IHctPmN1cnNvci52cG9zKQorICAgICAgICB7CisgICAgICAgICAgaW50IHhfbGlt aXQgPSAoc3RhcnQgPT0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FS RUFdIC0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgID8gdGV4dF9hcmVhX3dpZHRoCisgICAg ICAgICAgICAgICAgICAgICAgICA6IHggKyBzdGFydC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAg c3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgbWNfY29sb3JfcGlja2VyICh3LCBzdGFy dCwgZXNzZW50aWFscywgJmxzbF9mZywgLTEsIE1DX0hCQVIsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICByb3dfcG9zaXRpb24sIEhPUklaT05UQUxfUlVMRVIpOworICAgICAgICAgIC8q IFByZXNlcnZlIHN1cHBvcnQgZm9yIGRlZmF1bHQgYmVoYXZpb3Igc3VjaCB0aGF0IGEgdXNlciBt YXkKKyAgICAgICAgICBzcGVjaWZ5IHRoZSBoZWlnaHQgb2YgYW4gTUNfSEJBUiwgd2hpY2ggYmVn aW5zIGl0cyBqb3VybmV5CisgICAgICAgICAgYXMgdGhlIGBjdXJzb3Jfd2lkdGgnLiAgYG1jX2dl dF9jdXJzb3JfZ2VvbWV0cnknIHJlYWRqdXN0cy4gKi8KKyAgICAgICAgICBtY19lbmdpbmUgKHcs IG1hdHJpeCwgcm93LCBzdGFydCwgVEVYVF9BUkVBLCB4LCB4X2xpbWl0LCByb3ctPnksCisgICAg ICAgICAgICAgICAgICAgICBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sIHZwb3MsIE1D X0hCQVIsIDEsCisgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxz LCByb3dfcG9zaXRpb24sIGxzbF9mZywKKyAgICAgICAgICAgICAgICAgICAgIEhPUklaT05UQUxf UlVMRVIsIGRyYXdfcCwgZnJvbV93aGVyZSwgQ0hfQ0FDSEUpOworICAgICAgICB9CisgICAgICBp ZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAg ICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAm JiAhZmlsbF9jb2x1bW5fdHJ1bXBzX3ApCisgICAgICAgIHsKKyAgICAgICAgICBjdXJzb3JfdHlw ZSA9IChzdGFydC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICAgICAgICAgICAgICAg ID8gTUNfSE9MTE9XX0JPWAorICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19CQVI7CisgICAg ICAgICAgaW50IHhfbGltaXQgPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOworICAg ICAgICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKHctPmN1cnNvci55ID09IHJvdy0+eQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci52cG9zID09 IHZwb3MpOworICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAgICAgICAgIG1jX2Nv bG9yX3BpY2tlciAodywgc3RhcnQsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0xLCBjdXJzb3JfdHlw ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgVkVSVElDQUxf UlVMRVIpOworICAgICAgICAgIGlmICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+ IDApCisgICAgICAgICAgICAgICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAg ICAgICAgJiYgKChzdGFydCAhPSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RF WFRfQVJFQV0gLSAxCisgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0geAorICAg ICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54IDwgeCArIHN0YXJ0LT5waXhlbF93aWR0aCkK KyAgICAgICAgICAgICAgICAgIHx8IChzdGFydCA9PSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsg cm93LT51c2VkW1RFWFRfQVJFQV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vy c29yLnggPj0geCkpCisgICAgICAgICAgICAgICYmIHJvdy0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0 b21feSAodykKKyAgICAgICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAg ICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIHN0YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGlt aXQsIHJvdy0+eSwKKyAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgLSByb3ctPmdseXBoc1tU RVhUX0FSRUFdLCB2cG9zLCBjdXJzb3JfdHlwZSwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAg Y3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBsc2xfZmcsCisgICAgICAg ICAgICAgICAgICAgICAgIFZFUlRJQ0FMX1JVTEVSLCBkcmF3X3AsIGZyb21fd2hlcmUsIENIX0NB Q0hFKTsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgICB7CisgICAgICAgIGludCBy ZWxhdGl2ZV94ID0gMDsKKyAgICAgICAgZm9yIChpbnQgYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7 IGFyZWEgPCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBzdHJ1 Y3QgZ2x5cGggKmdseXBoID0gcm93LT5nbHlwaHNbYXJlYV07CisgICAgICAgICAgICBzdHJ1Y3Qg Z2x5cGggKmdseXBoX2VuZCA9IGdseXBoICsgcm93LT51c2VkW2FyZWFdOworICAgICAgICAgICAg LyogR2x5cGggZm9yIGEgbGluZSBlbmQgaW4gdGV4dC4gKi8KKyAgICAgICAgICAgIGlmIChhcmVh ID09IFRFWFRfQVJFQSAmJiBnbHlwaCA9PSBnbHlwaF9lbmQgJiYgZ2x5cGgtPmNoYXJwb3MgPiAw KQorICAgICAgICAgICAgICArK2dseXBoX2VuZDsKKyAgICAgICAgICAgIGZvciAoOyBnbHlwaCA8 IGdseXBoX2VuZDsgKytnbHlwaCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlm ICh2cG9zICE9IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICAgICAgICAgICYmIGdseXBoICE9 IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194IDwg cmVsYXRpdmVfeAorICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA8IHJlbGF0aXZl X3gKKyAgICAgICAgICAgICAgICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBtY19jb25mKSkpCisgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAg ICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQorICAg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvKiBUaGUgc3BhY2UgYXBwZW5k ZWQgdG8gYSByb3cgZW5kaW5nIHdpdGggYSBuZXcgbGluZSBkb2VzCisgICAgICAgICAgICAgICAg ICAgIG5vdCBoYXZlIGEgYGdseXBoLT5jaGFycG9zYCAoLTEsIDApIHRoYXQgd2UgY2FuIHVzZSBm b3IgdGhpcworICAgICAgICAgICAgICAgICAgICBwYXJ0aWN1bGFyIGFwcGxpY2F0aW9uLiAgV2hl biBhIGBidWZmZXItZGlzcGxheS10YWJsZScgZW50cnkKKyAgICAgICAgICAgICAgICAgICAgYXNz aWducyBhIHZpc2libGUgZ2x5cGggdG8gYSBuZXcgbGluZSwgdGhlcmUgaXMgbm8gcHJvYmxlbQor ICAgICAgICAgICAgICAgICAgICBiZWNhdXNlIHRoYXQgZ2x5cGggaGFzIGEgYGdseXBoLT5jaGFy cG9zJyB0aGF0IHdlIGNhbiB1c2UuCisgICAgICAgICAgICAgICAgICAgIFdoZW4gbm8gdmlzaWJs ZSBFT0wgZ2x5cGggZXhpc3RzLCB3ZSB1c2UgdGhlIGZvbGxvd2luZyB0ZXN0OgorICAgICAgICAg ICAgICAgICAgICB0aGUgYXBwZW5kZWQgc3BhY2UgaGFzIGEgcG9zaXRpb24gdGhhdCBpcyBvbmUg bGVzcyB0aGFuIHRoZQorICAgICAgICAgICAgICAgICAgICBlbmQgb2YgdGhlIG1hdHJpeCByb3cu ICovCisgICAgICAgICAgICAgICAgICAgIGludCBocG9zID0gZ2x5cGggLSByb3ctPmdseXBoc1tU RVhUX0FSRUFdOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnByZXZpb3VzX2ds eXBoID0gKDAgPD0gaHBvcyAtIDEgJiYgaHBvcyAtIDEgPCByb3ctPnVzZWRbVEVYVF9BUkVBXSkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXSArIGhwb3MgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgICAgICAgICAgICAgICAgICAgIC8v IHN0cnVjdCBnbHlwaCAqbGFzdF9nbHlwaCA9IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ct PnVzZWRbVEVYVF9BUkVBXSAtIDE7CisgICAgICAgICAgICAgICAgICAgIGJvb2wgc2tpcF9wID0g KHByZXZpb3VzX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgcHJldmlvdXNfZ2x5cGgtPmNoYXJwb3MgPT0gTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAo cm93KSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGgtPmJ5 dGVwb3MgIT0gZXNzZW50aWFscy56dl9ieXRlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyB0cnVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogV2hl biBhIGBidWZmZXItZGlzcGxheS10YWJsZScgZW50cnkgY29udGFpbnMKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBhIHZpc2libGUgdGFiIGNoYXJhY3RlciAoIsK7IiksIHRoZSBz dWJzZXF1ZW50CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU1RSRVRDSF9HTFlQ SCB3aWxsIGhhdmUgdGhlIHNhbWUgZ2x5cGgtPmNoYXJwb3MKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBhcyB0aGUgYWZvcmVtZW50aW9uZWQgdmlzaWJsZSB0YWIgY2hhcmFjdGVy LiAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKHByZXZpb3VzX2dseXBo ICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBwcmV2aW91 c19nbHlwaC0+Y2hhcnBvcyA9PSBnbHlwaC0+Y2hhcnBvcykKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gdHJ1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIGludCBwb3NpbnQgPSAocm93X3Bvc2l0aW9u ID09IFBPU1RfWlYpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gLTEKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKHJvd19wb3NpdGlvbiA9PSBBVF9aVikK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZXNzZW50aWFscy56dgorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGgtPmJ5dGVwb3MgIT0gZXNzZW50 aWFscy56dl9ieXRlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlw aCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1BVFJJWF9ST1dfRU5EX0NIQVJQ T1MgKHJvdykgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaC0+ Ynl0ZXBvcyA9PSBlc3NlbnRpYWxzLnp2X2J5dGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRb VEVYVF9BUkVBXSAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZXNz ZW50aWFscy56dgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBnbHlwaC0+Y2hh cnBvczsKKyAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3Qgc3BlY3MgPSBtY19hc3NvYyAo bWFrZV9maXhudW0gKHBvc2ludCksIEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29u ZikpOworICAgICAgICAgICAgICAgICAgICBpZiAoKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYm IHZwb3MgPiAwKQorICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1h dCA9PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKHNwZWNzKQorICAgICAg ICAgICAgICAgICAgICAgICAgJiYgcm93LT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQor ICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXNraXBfcAorICAgICAgICAgICAgICAgICAgICAg ICAgJiYgcm93X3Bvc2l0aW9uICE9IFBPU1RfWlYpCisgICAgICAgICAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3QgbGlzcF90eXBlID0gbWNfbnRoICgx LCBzcGVjcyk7CisgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1 cnNvcl90eXBlID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfbGlzcF90b19jdXJzb3JfdHlw ZSAoWENBUiAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKGxpc3BfdHlw ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IChnbHlwaC0+dHlwZSA9 PSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBN Q19IT0xMT1dfQk9YCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogY3Vy c29yX3R5cGU7CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY3Vyc29yX3dpZHRoID0gKENP TlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID8gWEZJWE5VTSAoWENBUiAoWENEUiAobGlzcF90eXBlKSkpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAtMTsKKyAgICAgICAgICAgICAgICAgICAgICAg IExpc3BfT2JqZWN0IG1jX2ZvcmVncm91bmQgPSBtY19udGggKDIsIHNwZWNzKTsKKyAgICAgICAg ICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAgICAgICAgICAgICAgICAg ICAgICAgaWYgKFNUUklOR1AgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgICAgICAg ICAgICBtY194d19jb2xvcl92YWx1ZXMgKHcsIG1jX2ZvcmVncm91bmQsICZsc2xfZmcpOworICAg ICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChWRUNUT1JQIChtY19mb3JlZ3JvdW5kKSkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBsc2xfZmcucmVkID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDApKTsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxzbF9mZy5ncmVlbiA9IFhGTE9BVF9EQVRB IChBUkVGIChtY19mb3JlZ3JvdW5kLCAxKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBsc2xfZmcuYmx1ZSA9IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3JvdW5kLCAyKSk7Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAg IGVsc2UgaWYgKE5JTFAgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgbWNfY29sb3JfcGlja2VyICh3LCBnbHlwaCwgZXNzZW50aWFscywgJmxzbF9mZywKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaW50LCBj dXJzb3JfdHlwZSwgcm93X3Bvc2l0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTKTsKKyAgICAgICAgICAgICAgICAg ICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgICAgICAg ICAgICAgICAgICAgICAgICBpbnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRf QVJFQSk7CisgICAgICAgICAgICAgICAgICAgICAgICBtY19lbmdpbmUgKHcsIG1hdHJpeCwgcm93 LCBnbHlwaCwgYXJlYSwgcmVsYXRpdmVfeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgeF9saW1pdCwgcm93LT55LCBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZwb3MsIGN1cnNvcl90eXBlLCBjdXJz b3Jfd2lkdGgsIGN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgbHNsX2ZnLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTLCBkcmF3X3AsIGZyb21fd2hlcmUsIE1D X0NBQ0hFKTsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICAgICAgaWYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZj X3Zpc2libGUpKQorICAgICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPD0gdGV4 dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSB3 LT5tYy5sbnVtX3BpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgICBpbnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7Cisg ICAgICAgICAgICAgICAgICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKHctPmN1cnNvci54 ID09IGVzc2VudGlhbHMuZmNfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5jdXJzb3IueSA9PSByb3ctPnkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gZ2x5cGggLSBy b3ctPmdseXBoc1tURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPmN1cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAgICAgICAg ICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAg ICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgICAgICAgICAgIG1j X2NvbG9yX3BpY2tlciAodywgZ2x5cGgsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0xLCBNQ19CQVIs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93X3Bvc2l0aW9uLCBG SUxMX0NPTFVNTik7CisgICAgICAgICAgICAgICAgICAgIGlmIChocG9zID49IGhwb3Nfc3RhcnQK KyAgICAgICAgICAgICAgICAgICAgICAgICYmIGhwb3MgPCBocG9zX3N0YXJ0ICsgaHBvc19sZW5n dGgKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxf d2lkdGggPD0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoKGhl YWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAgICAgICAgICAg ICAmJiAoKGdseXBoICE9IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgZXNzZW50aWFscy5mY194ID49IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgZXNzZW50aWFscy5mY194IDwgcmVsYXRpdmVfeCArIGdseXBoLT5waXhlbF93 aWR0aCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAoZ2x5cGggPT0gZ2x5cGhfZW5k IC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3gg Pj0gcmVsYXRpdmVfeCkpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnkgPD0gd2lu ZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcmVhbF9m YWtlX2N1cnNvcl9wKQorICAgICAgICAgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4 LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4X2xpbWl0LAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgcm93LT55LCBocG9zLCB2cG9zLCBNQ19CQVIsIDEsIGN1cnNvcl9t YXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLCByb3df cG9zaXRpb24sIGxzbF9mZywgRklMTF9DT0xVTU4sCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBkcmF3X3AsIGZyb21fd2hlcmUsIEZDX0NBQ0hFKTsKKyAgICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBj aF9ob3Jpem9udGFsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5j dXJzb3IudnBvcykKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaW50 IHhfbGltaXQgPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOworICAgICAgICAgICAg ICAgICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAg ICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgICAgICAgICAg IG1jX2NvbG9yX3BpY2tlciAodywgZ2x5cGgsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0xLCBNQ19I QkFSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvd19wb3NpdGlv biwgSE9SSVpPTlRBTF9SVUxFUik7CisgICAgICAgICAgICAgICAgICAgIC8qIFByZXNlcnZlIHN1 cHBvcnQgZm9yIGRlZmF1bHQgYmVoYXZpb3Igc3VjaCB0aGF0IGEgdXNlciBtYXkKKyAgICAgICAg ICAgICAgICAgICAgc3BlY2lmeSB0aGUgaGVpZ2h0IG9mIGFuIE1DX0hCQVIsIHdoaWNoIGJlZ2lu cyBpdHMgam91cm5leQorICAgICAgICAgICAgICAgICAgICBhcyB0aGUgYGN1cnNvcl93aWR0aCcu ICBgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeScgcmVhZGp1c3RzLiAqLworICAgICAgICAgICAgICAg ICAgICBpZiAoaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICAgICAgICAgICAgICAmJiBo cG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoKQorICAgICAgICAgICAgICAgICAgICAgIG1j X2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4X2xpbWl0 LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT55LCBocG9zLCB2cG9zLCBN Q19IQkFSLCAxLCBjdXJzb3JfbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBsc2xfZmcsIEhPUklaT05UQUxfUlVMRVIsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3X3AsIGZyb21fd2hlcmUsIENIX0NB Q0hFKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAg ICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAg ICAgICAgICYmICFmaWxsX2NvbHVtbl90cnVtcHNfcCkKKyAgICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUgPSAoZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZ UEgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19IT0xMT1dfQk9YCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19CQVI7CisgICAgICAgICAgICAg ICAgICAgIGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAg ICAgICAgICAgICAgICAgICAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3AgPSAody0+Y3Vyc29yLnkg PT0gcm93LT55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIHctPmN1cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAgICAgICAgICAgICBpbnQgaHBv cyA9IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICAgICAgICAgICAg c3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgICAgICAgICAgIG1jX2NvbG9yX3BpY2tl ciAodywgZ2x5cGgsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0xLCBjdXJzb3JfdHlwZSwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb3dfcG9zaXRpb24sIFZFUlRJQ0FM X1JVTEVSKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGhwb3MgPj0gaHBvc19zdGFydAorICAg ICAgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA8IGhwb3Nfc3RhcnQgKyBocG9zX2xlbmd0aAor ICAgICAgICAgICAgICAgICAgICAgICAgJiYgKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZw b3MgPiAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1h dCA9PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKChnbHlwaCAhPSBnbHlwaF9lbmQg LSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHJlbGF0 aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPCByZWxh dGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg IHx8IChnbHlwaCA9PSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHctPmN1cnNvci54ID49IHJlbGF0aXZlX3gpKQorICAgICAgICAgICAgICAgICAgICAg ICAgJiYgcm93LT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAgICAgICAgICAg ICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgICAgICAgICAgICBt Y19lbmdpbmUgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgYXJlYSwgcmVsYXRpdmVfeCwgeF9saW1p dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvdy0+eSwgaHBvcywgdnBvcywg Y3Vyc29yX3R5cGUsIDEsIGN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGxzbF9mZywgVkVSVElDQUxfUlVMRVIs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3X3AsIGZyb21fd2hlcmUsIENI X0NBQ0hFKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZWxhdGl2ZV94 ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAg ICAgIH0KKyAgLy8gIGNsb2NrX3QgY2xvY2tfZW5kID0gY2xvY2soKTsKKyAgLy8gIGRvdWJsZSBj cHVfdGltZV91c2VkID0gKChkb3VibGUpIChjbG9ja19lbmQgLSBjbG9ja19zdGFydCkpIC8gQ0xP Q0tTX1BFUl9TRUM7CisgIC8vICBmcHJpbnRmIChzdGRlcnIsICJtY19kcmF3X3JvdyAoJXMpOiAg VElNRSAoJWYpXG4iLCBtY193aW5kb3cgKHcpLCBjcHVfdGltZV91c2VkKTsKK30KKworYm9vbAor bWNfcmVkcmF3X3JvdyAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0 cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICBlbnVtIGdseXBoX3Jv d19hcmVhIGFyZWEsIGludCBzdGFydF94LCBpbnQgc3RhcnRfaHBvcywgaW50IGVuZF9ocG9zLAor ICAgICAgICAgICAgICAgYm9vbCBjbGVhcl9lb2xfcCwgZW51bSBkcmF3X2dseXBoc19mYWNlIGhs LAorICAgICAgICAgICAgICAgZW51bSBtY19yZWRyYXdfcm93X3R5cGUgZnJvbV93aGVyZSkKK3sK KyAgYm9vbCBnb19wID0gKCh3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW01DX0NBQ0hFXSA+IDAK KyAgICAgICAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0NIX0NBQ0hFXSA+ IDAKKyAgICAgICAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0ZDX0NBQ0hF XSA+IDApCisgICAgICAgICAgICAgICAmJiBhcmVhID09IFRFWFRfQVJFQQorICAgICAgICAgICAg ICAgJiYgcm93LT51c2VkW2FyZWFdKTsKKyAgaWYgKCFnb19wKQorICAgIHJldHVybiBmYWxzZTsK KyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAgaW50IHZw b3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgVFJBQ0UgKChzdGRlcnIsICJt Y19yZWRyYXdfcm93ICglZCk6ICAlc1xuXAorICBzdGFydF94ICglZCkgfCBzdGFydF9ocG9zICgl ZCkgfCBlbmRfaHBvcyAoJW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pOworICAvKiBTVFJFVENIX0dMWVBIIG1heSBjb250YWluIG1vcmUgdGhhbiBvbmUg ZmFrZSBjdXJzb3IgYXQgdGhlIHNhbWUgSFBPUy4gKi8KKyAgZm9yIChlbnVtIG1jX2NhY2hlX3R5 cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOworICAgICAgIGNhY2hlX3R5cGUgPCBOT19DQUNIRTsK KyAgICAgICArK2NhY2hlX3R5cGUpCisgICAgeworICAgICAgZm9yIChpbnQgbnRoID0gMDsKKyAg ICAgICAgICAgbWNfdHJhdmVyc2VfY2FjaGVfcCAody0+bWNfbWF0cml4LCBjYWNoZV90eXBlLCB2 bnRoLCBudGgpOworICAgICAgICAgICArK250aCkKKyAgICAgICAgeworICAgICAgICAgIGludCB4 ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS54OworICAg ICAgICAgIGludCBmeCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF0uZng7CisgICAgICAgICAgaW50IHkgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhdLnk7CisgICAgICAgICAgaW50IGZ5ID0gdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5meTsKKyAgICAgICAgICBpbnQgaHBvcyA9 IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uaHBvczsKKyAg ICAgICAgICBpbnQgdnBvcyA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF0udnBvczsKKyAgICAgICAgICBpbnQgd2QgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLndkOworICAgICAgICAgIGludCBoID0gdy0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5oOworICAgICAgICAgIGVudW0g bWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhdLmN1cnNvcl90eXBlOworICAgICAgICAgIGludCBjdXJzb3Jfd2lk dGggPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmN1cnNv cl93aWR0aDsKKyAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZyA9IHsucmVkID0gdy0+bWNf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5mZy5yZWQsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5mZy5ncmVlbiwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAuYmx1ZSA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF0uZmcuYmx1ZX07CisgICAgICAgICAgLy8gIHN0cnVjdCBtY19SR0IgbHNsX2Jn ID0gey5yZWQgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhd LmJnLnJlZCwKKyAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5iZy5ncmVlbiwK KyAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLmJsdWV9OworICAgICAgICAg IGJvb2wgYWN0aXZlX3AgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLmFjdGl2ZV9wOworICAgICAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9 IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGhfZmxh dm9yOworICAgICAgICAgIGJvb2wgZW5hYmxlZF9wID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFibGVkX3A7CisgICAgICAgICAgaWYgKHZwb3MgPT0g dm50aAorICAgICAgICAgICAgICAmJiAoKGhwb3MgPj0gc3RhcnRfaHBvcworICAgICAgICAgICAg ICAgICAgICYmIGhwb3MgPCBlbmRfaHBvcykKKyAgICAgICAgICAgICAgICAgIC8qIEEgZmxvYXRp bmcgY3Vyc29yIGJleW9uZCB0aGUgZW5kIG9mIHRoZSBnbHlwaCByb3cuICovCisgICAgICAgICAg ICAgICAgICB8fCAoaHBvcyArIDEgPT0gc3RhcnRfaHBvcworICAgICAgICAgICAgICAgICAgICAg ICYmIGhwb3MgKyAxID09IGVuZF9ocG9zKSkKKyAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICBib29sIHJlbW92ZV9wID0gZmFsc2U7CisgICAg ICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHks IGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGxzbF9mZywgYWN0aXZlX3AsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaF9mbGF2b3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QUNIRTsKKyAgICAgICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7CisgICAgICAgKytjYWNoZV90 eXBlKQorICAgIHsKKyAgICAgIGZvciAoaW50IG50aCA9IDA7CisgICAgICAgICAgIG1jX3RyYXZl cnNlX2NhY2hlX3AgKHctPm1jX21hdHJpeCwgY2FjaGVfdHlwZSwgdm50aCwgbnRoKTsKKyAgICAg ICAgICAgKytudGgpCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgeCA9IHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ueDsKKyAgICAgICAgICBpbnQgZnggPSB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZ4OworICAgICAg ICAgIGludCB5ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XS55OworICAgICAgICAgIGludCBmeSA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF0uZnk7CisgICAgICAgICAgaW50IGhwb3MgPSB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmhwb3M7CisgICAgICAgICAgaW50IHZwb3Mg PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLnZwb3M7Cisg ICAgICAgICAgaW50IHdkID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXS53ZDsKKyAgICAgICAgICBpbnQgaCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF0uaDsKKyAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1 cnNvcl90eXBlID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGV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G1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoX2ZsYXZvcjsKKyAgICAgICAgICBi b29sIGVuYWJsZWRfcCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF0uZW5hYmxlZF9wOworICAgICAgICAgIC8qIGBtYXRyaXhfcm93JyBpbiBgZGlzcG5ldy5j YCBjb250YWlucyB0aGUgZm9sbG93aW5nIHRlc3RzLAorICAgICAgICAgIGVhc3NlcnQgKG1hdHJp eCAmJiBtYXRyaXgtPnJvd3MpOworICAgICAgICAgIGVhc3NlcnQgKHJvdyA+PSAwICYmIHJvdyA8 IG1hdHJpeC0+bnJvd3MpOyAqLworICAgICAgICAgIGJvb2wgYmFyZl9jcmFzaF9vbmUgPSAobWF0 cml4ICYmIG1hdHJpeC0+cm93cykgPyBmYWxzZSA6IHRydWU7CisgICAgICAgICAgaWYgKGJhcmZf Y3Jhc2hfb25lKQorICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgYm9vbCBiYXJmX2Ny YXNoX3R3byA9ICh2cG9zID49IDAgJiYgdnBvcyA8IG1hdHJpeC0+bnJvd3MpID8gZmFsc2UgOiB0 cnVlOworICAgICAgICAgIGlmIChiYXJmX2NyYXNoX3R3bykKKyAgICAgICAgICAgIGNvbnRpbnVl OworICAgICAgICAgIGlmICh2cG9zID09IHZudGgKKyAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxh dm9yID09IE1DX0dMWVBICisgICAgICAgICAgICAgICYmIGVuYWJsZWRfcCkKKyAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgbWNfZXJhc2VfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgeSwg aHBvcywgdnBvcywgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QpOworICAgICAgICAgICAg ICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmVuYWJsZWRf cCA9IGZhbHNlOworICAgICAgICAgICAgICAtLXctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbY2Fj aGVfdHlwZV07CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmICh2cG9zID09IHZu dGgKKyAgICAgICAgICAgICAgICAgICAgICYmIGVuYWJsZWRfcCkKKyAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgIGJvb2wgcmVtb3ZlX3AgPSB0cnVlOworICAgICAgICAgICAgICAgIG1j X2RyYXdfZXJhc2VfaHlicmlkICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2 cG9zLCB3ZCwgaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29y X3R5cGUsIGN1cnNvcl93aWR0aCwgbHNsX2JnLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgZ2x5cGhfZmxhdm9yLCByZW1vdmVfcCk7CisgICAgICAgICAg ICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFi bGVkX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAtLXctPm1jX21hdHJpeC5jdXJzb3JzX3Vz ZWRbY2FjaGVfdHlwZV07CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgdy0+bWNf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXSA9IDA7CisgICAgfQorfQor CisvKiBFcmFzZSBmYWtlIGN1cnNvcnMgZnJvbSAobWluLCBydW4uY3VycmVudF95LCBydW4uZGVz aXJlZF95KSB0byBlbmQgb2Ygd2luZG93LgorICBUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9N QVRSSVhfRE9XT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pcmVkX3kuXQorICB8ICAgICAgICAgICAgIHwKKyAgKy0tLS0t LS0tLS0tLS0rIDw9IHJ1bi5jdXJyZW50X3kgPT0gNTQwCisgIHwgICAgICAgICAgICAgfAorICB8 ICAgICAgICAgICAgIHwgPD0gcnVuLmRlc2lyZWRfeSA9PSA4MTAgW2Rvd24gKOKGkyldID09IHJ1 bi5jdXJyZW50X3kgPiBydW4uZGVzaXJlZF95CisgIHwgICAgICAgICAgICAgfCAgICBydW4uaGVp Z2h0ID0gaXQubGFzdF92aXNpYmxlX3kgLSBydW4uZGVzaXJlZF95CisgIHwgICAgICAgICAgICAg fCAgICBydW4uaGVpZ2h0ID09IDEwODAgLSA4MTAgPT0gMjcwCisgIHwgICAgICAgICAgICAgfCAg ICBbVG9wIHBhcnQgb2YgdGhlIGxvd2VyIHJlY3RhbmdsZSBnZXRzIGNvcGllZCB0byBsb3dlciBy dW4uZGVzaXJlZF95Ll0KKyAgfCAgICAgICAgICAgICB8CisgICstLS0tLS0tLS0tLS0tKyA8PSBp dC5sYXN0X3Zpc2libGVfeSA9PSAxMDgwICovCit2b2lkCittY19wcmVfc2Nyb2xsX2NsZWFuIChz dHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgcnVuIHJ1biwgaW50IHN0YXJ0X3Zwb3MsCisgICAgICAg ICAgICAgICAgICAgICBpbnQgbnJvd3Nfc2Nyb2xsZWQsIGVudW0gbWNfcHJlX3Njcm9sbF9jbGVh bl90eXBlIGZyb21fd2hlcmUpCit7CisgIGlmIChNSU5JX1dJTkRPV19QICh3KSkKKyAgICByZXR1 cm47CisgIGJvb2wgZ29fb25lX3AgPSAody0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtNQ19DQUNI RV0gPiAwCisgICAgICAgICAgICAgICAgICAgfHwgdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtD SF9DQUNIRV0gPiAwCisgICAgICAgICAgICAgICAgICAgfHwgdy0+bWNfbWF0cml4LmN1cnNvcnNf dXNlZFtGQ19DQUNIRV0gPiAwKTsKKyAgYm9vbCBnb190d29fcCA9IChCVUZGRVJQICh3LT5jb250 ZW50cykKKyAgICAgICAgICAgICAgICAgICAmJiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgIHx8ICFOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQorICAgICAgICAgICAgICAg ICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkp KTsKKyAgaWYgKHRyYWNlX3JlZGlzcGxheV9wKQorICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX3By ZV9zY3JvbGxfY2xlYW4gKCVzKTpcblwKKyAgJXMgfCBnb19vbmVfcCAoJXMpIHwgZ29fdHdvX3Ag KCVzKVxuXAorICBzdGFydF92cG9zICglZCkgfCBucm93c19zY3JvbGxlZCAoJWQpXG5cCisgICVz OiAgcnVuLmN1cnJlbnQvZGVzaXJlZF95ICglZC8lZCkgfCBydW4uaGVpZ2h0ICglZClcbiIsCisg ICAgbWNfd2luZG93ICh3KSwgKGZyb21fd2hlcmUgPT0gVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJF TlRfTUFUUklYX0RPV04pCisgICAgICAgICAgICAgICAgICAgICA/ICJUUllfV0lORE9XX1JFVVNJ TkdfQ1VSUkVOVF9NQVRSSVhfRE9XTiIKKyAgICAgICAgICAgICAgICAgICA6IChmcm9tX3doZXJl ID09IFRSWV9XSU5ET1dfUkVVU0lOR19DVVJSRU5UX01BVFJJWF9VUCkKKyAgICAgICAgICAgICAg ICAgICAgID8gIlRSWV9XSU5ET1dfUkVVU0lOR19DVVJSRU5UX01BVFJJWF9VUCIKKyAgICAgICAg ICAgICAgICAgICA6IChmcm9tX3doZXJlID09IFRSWV9XSU5ET1dfSUQpCisgICAgICAgICAgICAg ICAgICAgICA/ICJUUllfV0lORE9XX0lEIgorICAgICAgICAgICAgICAgICAgIDogIlVOS05PV04i LAorICAgIGdvX29uZV9wID8gInllcyIgOiAibm8iLCBnb190d29fcCA/ICJ5ZXMiIDogIm5vIiwK KyAgICBzdGFydF92cG9zLCBucm93c19zY3JvbGxlZCwKKyAgICBydW4uY3VycmVudF95IDwgcnVu LmRlc2lyZWRfeSA/ICLihpMiIDogIuKGkSIsCisgICAgcnVuLmN1cnJlbnRfeSwgcnVuLmRlc2ly ZWRfeSwgcnVuLmhlaWdodCk7CisgIGlmICghZ29fb25lX3AgJiYgIWdvX3R3b19wKQorICAgIHJl dHVybjsKKyAgYm9vbCB1cGRhdGluZ19mcmFtZV9wID0gZmFsc2U7CisgIHN0cnVjdCBmcmFtZSAq ZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBpZiAoWEZSQU1FICh3LT5mcmFtZSkgIT0gZi0+bWNf dXBkYXRpbmdfZnJhbWUKKyAgICAgICYmIChnb19vbmVfcCB8fCBnb190d29fcCkpCisgICAgewor ICAgICAgdXBkYXRpbmdfZnJhbWVfcCA9IHRydWU7CisgICAgICB1cGRhdGVfYmVnaW4gKGYpOwor ICAgIH0KKyAgaWYgKHctPnBoeXNfY3Vyc29yX29uX3AKKyAgICAgICYmIGdvX3R3b19wKQorICAg IGVyYXNlX3BoeXNfY3Vyc29yICh3KTsKKyAgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4ID0g dy0+Y3VycmVudF9tYXRyaXg7CisgIGZvciAoaW50IHZudGggPSBzdGFydF92cG9zOworICAgICAg IG1hdHJpeCAhPSBOVUxMCisgICAgICAgJiYgdm50aCA8IG1hdHJpeC0+bnJvd3MKKyAgICAgICAm JiBNQVRSSVhfUk9XIChtYXRyaXgsIHZudGgpLT5lbmFibGVkX3AKKyAgICAgICAmJiBnb19vbmVf cDsKKyAgICAgICArK3ZudGgpCisgICAgeworICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93ID0g TUFUUklYX1JPVyAobWF0cml4LCB2bnRoKTsKKyAgICAgIG1jX2VyYXNlX3JvdyAodywgbWF0cml4 LCByb3cpOworICAgIH0KKyAgaWYgKHVwZGF0aW5nX2ZyYW1lX3ApCisgICAgdXBkYXRlX2VuZCAo Zik7CisgIC8vIG1jX3Jlc2V0X2NhY2hlICh3KTsKK30KKworREVGVU4gKCJtYy1zdGRlcnIiLCBG bWNfc3RkZXJyLCBTbWNfc3RkZXJyLCAwLCAxLCAiUCIsCisgICAgICAgZG9jOiAvKiBUb2dnbGUg dHJhY2luZyBvZiBtdWx0aXBsZSBmYWtlIGN1cnNvcnMuCitXaXRoIEFSRywgdHVybiB0cmFjaW5n IG9uIGlmIGFuZCBvbmx5IGlmIEFSRyBpcyBwb3NpdGl2ZS4gKi8pCisgIChMaXNwX09iamVjdCBh cmcpCit7CisgIGlmIChOSUxQIChhcmcpKQorICAgIG1jX3N0ZGVycl9wID0gIW1jX3N0ZGVycl9w OworICBlbHNlCisgICAgeworICAgICAgYXJnID0gRnByZWZpeF9udW1lcmljX3ZhbHVlIChhcmcp OworICAgICAgbWNfc3RkZXJyX3AgPSBYRklYTlVNIChhcmcpID4gMDsKKyAgICB9CisgIHJldHVy biBRbmlsOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogDAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAJCSAgICAgIFdpbmRvdyBkaXNwbGF5 IGRpbWVuc2lvbnMKQEAgLTEzMzk1LDYgKzE4MDM4LDY5IEBAIGhzY3JvbGxfd2luZG93X3RyZWUg KExpc3BfT2JqZWN0IHdpbmRvdykKIAkgICAgICBlbHNlCiAJCXB0ID0gY2xpcF90b19ib3VuZHMg KEJFR1YsIG1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g3ZmZmNWZiZjllMzAsCisgICAgdz0weDExYmY3MmM5OCwgcG9zPTB4 MTIxMjQzZDUwKSBhdCB4ZGlzcC5jOjgyOTkKKyM2ICAweDAwMDAwMDAxMDAwNGQzN2UgaW4gaW5p dF90b19yb3dfc3RhcnQgKGl0PTB4N2ZmZjVmYmY5ZTMwLCB3PTB4MTFiZjcyYzk4LAorICAgIHJv dz0weDEyMTI0M2QwMCkgYXQgeGRpc3AuYzo4NDIzCisjNyAgMHgwMDAwMDAwMTAwMDZjM2Y3IGlu IGhzY3JvbGxfd2luZG93X3RyZWUgKHdpbmRvdz0uLi4pIGF0IHhkaXNwLmM6MTg1NDYKKyovCisK KyAgLyogYGluaXRfaXRlcmF0b3InOiAgZWFzc2VydCAoY2hhcnBvcyA8IDAKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgfHwgKGNoYXJwb3MgPj0gQlVGX0JFRyAoY3VycmVudF9idWZm ZXIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjaGFycG9zIDw9IFpW KSk7ICovCisKKyAgc3RydWN0IGRpc3BsYXlfcG9zICpwb3MgPSAmY3Vyc29yX3Jvdy0+c3RhcnQ7 CisgIHB0cmRpZmZfdCBjaGFycG9zID0gQ0hBUlBPUyAocG9zLT5wb3MpOworCisgIGJvb2wgYmFy Zl9jcmFzaF9vbmUgPSAoY2hhcnBvcyA8IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICB8fCAo Y2hhcnBvcyA+PSBCVUZfQkVHIChjdXJyZW50X2J1ZmZlcikKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgY2hhcnBvcyA8PSBaVikpCisgICAgICAgICAgICAgICAgICAgICAgICA/IGZh bHNlCisgICAgICAgICAgICAgICAgICAgICAgICA6IHRydWU7CisgIGlmIChiYXJmX2NyYXNoX29u ZSkKKyAgICByZXR1cm4gaHNjcm9sbGVkX3A7CisKKyAgLyogYHJlc2VhdF8xJzogIENIQVJQT1Mg KHBvcykgPj0gQkVHViAmJiBDSEFSUE9TIChwb3MpIDw9IFpWICovCisgIGJvb2wgYmFyZl9jcmFz aF90d28gPSAoY2hhcnBvcyA+PSBCRUdWICYmIGNoYXJwb3MgPD0gWlYpCisgICAgICAgICAgICAg ICAgICAgICAgICAgPyBmYWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgIDogdHJ1ZTsKKyAg aWYgKGJhcmZfY3Jhc2hfdHdvKQorICAgIHJldHVybiBoc2Nyb2xsZWRfcDsKKworLyogZW5kIE1V TFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgICAgICAv KiBNb3ZlIGl0ZXJhdG9yIHRvIHB0IHN0YXJ0aW5nIGF0IGN1cnNvcl9yb3ctPnN0YXJ0IGluCiAJ CSBhIGxpbmUgd2l0aCBpbmZpbml0ZSB3aWR0aC4gICovCiAJICAgICAgaW5pdF90b19yb3dfc3Rh cnQgKCZpdCwgdywgY3Vyc29yX3Jvdyk7CkBAIC0xNDI4Nyw5ICsxODk5MywyMiBAQCByZWRpc3Bs YXlfaW50ZXJuYWwgKHZvaWQpCiAJICAgICAgKnctPmRlc2lyZWRfbWF0cml4LT5tZXRob2QgPSAw OwogCSAgICAgIGRlYnVnX21ldGhvZF9hZGQgKHcsICJvcHRpbWl6YXRpb24gMSIpOwogI2VuZGlm CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK ICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KKyAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQor ICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykp KQorICAgIG1jX3VwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgZmFsc2UpOworICAgIGVsc2UKIAkg ICAgICB1cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIGZhbHNlKTsKICNlbmRpZgorCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKworCiAJICAgICAgZ290byB1cGRhdGU7CiAJICAgIH0KIAkgIGVs c2UKQEAgLTE3Njg3LDEwICsyMjQwNiwyMiBAQCByZWRpc3BsYXlfd2luZG93IChMaXNwX09iamVj dCB3aW5kb3csIGJvb2wganVzdF90aGlzX29uZV9wKQogICAgIH0KIAogI2lmZGVmIEhBVkVfV0lO RE9XX1NZU1RFTQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VS U09SUyAqLworCisgIGJvb2wga2VlcF9jdXJyZW50X3AgPSAoanVzdF90aGlzX29uZV9wCisgICAg ICAgICAgICAgICAgICAgICAgICAgfHwgKCF1c2VkX2N1cnJlbnRfbWF0cml4X3AgJiYgIW92ZXJs YXlfYXJyb3dfc2VlbikKKyAgICAgICAgICAgICAgICAgICAgICAgICB8fCB3LT5wc2V1ZG9fd2lu ZG93X3ApOworCisgIGJvb2wgZnJpbmdlc191cGRhdGVkX3AgPSAoQlVGRkVSUCAody0+Y29udGVu dHMpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIg KHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBtY191cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIGtlZXBfY3VycmVudF9wKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiB1cGRhdGVfd2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F95ID0gc3RhcnRfcm93LT55OwogCSAgcnVuLmRlc2lyZWRfeSA9IGl0LmN1cnJlbnRf eTsKIAkgIHJ1bi5oZWlnaHQgPSBpdC5sYXN0X3Zpc2libGVfeSAtIGl0LmN1cnJlbnRfeTsKQEAg LTE4MDE5LDYgKzIyNzU0LDE2IEBAIHRyeV93aW5kb3dfcmV1c2luZ19jdXJyZW50X21hdHJpeCAo c3RydWN0IHdpbmRvdyAqdykKIAkgICAgICB1cGRhdGVfYmVnaW4gKGYpOwogCSAgICAgIEZSQU1F X1JJRiAoZiktPnVwZGF0ZV93aW5kb3dfYmVnaW5faG9vayAodyk7CiAJICAgICAgRlJBTUVfUklG IChmKS0+Y2xlYXJfd2luZG93X21vdXNlX2ZhY2UgKHcpOworCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgbWNfcHJlX3Njcm9sbF9jbGVh biAodywgcnVuLCBzdGFydF92cG9zLCBucm93c19zY3JvbGxlZCwgVFJZX1dJTkRPV19SRVVTSU5H X0NVUlJFTlRfTUFUUklYX0RPV04pOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJ ICAgICAgRlJBTUVfUklGIChmKS0+c2Nyb2xsX3J1bl9ob29rICh3LCAmcnVuKTsKIAkgICAgICBG UkFNRV9SSUYgKGYpLT51cGRhdGVfd2luZG93X2VuZF9ob29rICh3LCBmYWxzZSwgZmFsc2UpOwog CSAgICAgIHVwZGF0ZV9lbmQgKGYpOwpAQCAtMTgxNzMsNiArMjI5MTgsNyBAQCB0cnlfd2luZG93 X3JldXNpbmdfY3VycmVudF9tYXRyaXggKHN0cnVjdCB3aW5kb3cgKncpCiAJfQogCiAgICAgICAv KiBTY3JvbGwgdGhlIGRpc3BsYXkuICAqLworCiAgICAgICBydW4uY3VycmVudF95ID0gZmlyc3Rf cmV1c2FibGVfcm93LT55OwogICAgICAgcnVuLmRlc2lyZWRfeSA9IFdJTkRPV19IRUFERVJfTElO RV9IRUlHSFQgKHcpOwogICAgICAgcnVuLmhlaWdodCA9IGl0Lmxhc3RfdmlzaWJsZV95IC0gcnVu LmN1cnJlbnRfeTsKQEAgLTE4MTgzLDYgKzIyOTI5LDE2IEBAIHRyeV93aW5kb3dfcmV1c2luZ19j dXJyZW50X21hdHJpeCAoc3RydWN0IHdpbmRvdyAqdykKIAkgIHVwZGF0ZV9iZWdpbiAoZik7CiAJ ICBGUkFNRV9SSUYgKGYpLT51cGRhdGVfd2luZG93X2JlZ2luX2hvb2sgKHcpOwogCSAgRlJBTUVf UklGIChmKS0+Y2xlYXJfd2luZG93X21vdXNlX2ZhY2UgKHcpOworCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgbWNfcHJlX3Njcm9sbF9j bGVhbiAodywgcnVuLCBzdGFydF92cG9zLCBucm93c19zY3JvbGxlZCwgVFJZX1dJTkRPV19SRVVT SU5HX0NVUlJFTlRfTUFUUklYX1VQKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog CSAgRlJBTUVfUklGIChmKS0+c2Nyb2xsX3J1bl9ob29rICh3LCAmcnVuKTsKIAkgIEZSQU1FX1JJ RiAoZiktPnVwZGF0ZV93aW5kb3dfZW5kX2hvb2sgKHcsIGZhbHNlLCBmYWxzZSk7CiAJICB1cGRh dGVfZW5kIChmKTsKQEAgLTE5MTI3LDYgKzIzODgzLDcgQEAgdHJ5X3dpbmRvd19pZCAoc3RydWN0 IHdpbmRvdyAqdykKICAgLyogU2Nyb2xsIHRoZSBkaXNwbGF5LiAgRG8gaXQgYmVmb3JlIGNoYW5n aW5nIHRoZSBjdXJyZW50IG1hdHJpeCBzbwogICAgICB0aGF0IHh0ZXJtLmMgZG9lc24ndCBnZXQg Y29uZnVzZWQgYWJvdXQgd2hlcmUgdGhlIGN1cnNvciBnbHlwaCBpcwogICAgICBmb3VuZC4gICov CisKICAgaWYgKGR5ICYmIHJ1bi5oZWlnaHQpCiAgICAgewogICAgICAgdXBkYXRlX2JlZ2luIChm KTsKQEAgLTE5MTM1LDYgKzIzODkyLDE2IEBAIHRyeV93aW5kb3dfaWQgKHN0cnVjdCB3aW5kb3cg KncpCiAJewogCSAgRlJBTUVfUklGIChmKS0+dXBkYXRlX3dpbmRvd19iZWdpbl9ob29rICh3KTsK IAkgIEZSQU1FX1JJRiAoZiktPmNsZWFyX3dpbmRvd19tb3VzZV9mYWNlICh3KTsKKworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIG1jX3By ZV9zY3JvbGxfY2xlYW4gKHcsIHJ1biwgZmlyc3RfdW5jaGFuZ2VkX2F0X2VuZF92cG9zLCBkdnBv cywgVFJZX1dJTkRPV19JRCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgIEZS QU1FX1JJRiAoZiktPnNjcm9sbF9ydW5faG9vayAodywgJnJ1bik7CiAJICBGUkFNRV9SSUYgKGYp LT51cGRhdGVfd2luZG93X2VuZF9ob29rICh3LCBmYWxzZSwgZmFsc2UpOwogCX0KQEAgLTIxMjcz LDYgKzI2MDQwLDE3IEBAIG1heWJlX3Byb2R1Y2VfbGluZV9udW1iZXIgKHN0cnVjdCBpdCAqaXQp CiAgICAgICBTRVRfVEVYVF9QT1MgKHRlbV9pdC5wb3NpdGlvbiwgLTEsIC0xKTsKICAgICAgIFBS T0RVQ0VfR0xZUEhTICgmdGVtX2l0KTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgLyogVGhpcyBwZXJtaXRzIHVzIHRvIGluc3Bl Y3QgdGhlIEhQT1Mgb2YgbGluZSBudW1iZXIgZ2x5cGhzIGFuZCB0aGUgc3BhY2UKKyAgICAgIHBh ZGRpbmcgYmVmb3JlL2FmdGVyIHRoZSBsaW5lIG51bWJlcnMuICBXZSBzZXQgYGdseXBoLT5ocG9z YCBlbHNld2hlcmUuICovCisgICAgICB0ZW1faXQuaHBvcyArPSAxOworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKworCiAgICAgICAvKiBTdG9wIHByb2R1Y2luZyBnbHlwaHMsIGFuZCByZWZy YWluIGZyb20gcHJvZHVjaW5nIHRoZSBsaW5lCiAJIG51bWJlciwgaWYgd2UgZG9uJ3QgaGF2ZSBl bm91Z2ggc3BhY2Ugb24gdGhpcyBsaW5lLiAgKi8KICAgICAgIGlmICh0ZW1faXQuY3VycmVudF94 ID49IHdpZHRoX2xpbWl0KQpAQCAtMjEyODQsNiArMjYwNjIsMzAgQEAgbWF5YmVfcHJvZHVjZV9s aW5lX251bWJlciAoc3RydWN0IGl0ICppdCkKIAl9CiAgICAgfQogCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIExpc3BfT2JqZWN0IGJ1ZiA9 IGl0LT53LT5jb250ZW50czsKKyAgQ0hFQ0tfQlVGRkVSIChidWYpOworICBzdHJ1Y3QgYnVmZmVy ICpiID0gWEJVRkZFUiAoYnVmKTsKKyAgc3RydWN0IGJ1ZmZlciAqb2xkX2J1ZmZlciA9IE5VTEw7 CisgIC8qIE5lZWRlZCBzbyB0aGF0IGJ1ZmZlci1sb2NhbCB2YWx1ZXMgY2FuIGJlIGRldGVybWlu ZWQ7IGUuZy4sIHdoZW4gc3dpdGNoaW5nCisgIHRvIHRoZSBtaW5pYnVmZmVyLiAqLworICBpZiAo YiAhPSBjdXJyZW50X2J1ZmZlcikKKyAgICB7CisgICAgICBvbGRfYnVmZmVyID0gY3VycmVudF9i dWZmZXI7CisgICAgICBzZXRfYnVmZmVyX2ludGVybmFsIChiKTsKKyAgICB9CisgIGl0LT53LT5t Yy5sbnVtX3BpeGVsX3dpZHRoID0gKCFOSUxQIChWZGlzcGxheV9saW5lX251bWJlcnMpKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gdGVtX2l0LmN1cnJlbnRfeAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogMDsKKyAgaWYgKG9sZF9idWZmZXIpCisgICAgc2V0X2J1 ZmZlcl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor CisKICAgLyogUmVjb3JkIHRoZSB3aWR0aCBpbiBwaXhlbHMgd2UgbmVlZCBmb3IgdGhlIGxpbmUg bnVtYmVyIGRpc3BsYXkuICAqLwogICBpdC0+bG51bV9waXhlbF93aWR0aCA9IHRlbV9pdC5jdXJy ZW50X3g7CiAgIC8qIENvcHkgdGhlIHByb2R1Y2VkIGdseXBocyBpbnRvIElUJ3MgZ2x5cGhfcm93 LiAgKi8KQEAgLTI3MDkyLDYgKzMxODk0LDE3IEBAIGFwcGVuZF9nbHlwaCAoc3RydWN0IGl0ICpp dCkKIAkgICAgZ1sxXSA9ICpnOwogCSAgZ2x5cGggPSBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJl YV07CiAJfQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09S UyAqLworCisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPmJ5dGVw b3MgPSBJVF9CWVRFUE9TICgqaXQpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAg ICAgICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAgICAgICBnbHlw aC0+b2JqZWN0ID0gaXQtPm9iamVjdDsKICAgICAgIGlmIChpdC0+cGl4ZWxfd2lkdGggPiAwKQpA QCAtMjcxNzUsNiArMzE5ODgsMTcgQEAgYXBwZW5kX2NvbXBvc2l0ZV9nbHlwaCAoc3RydWN0IGl0 ICppdCkKIAkgICAgZ1sxXSA9ICpnOwogCSAgZ2x5cGggPSBpdC0+Z2x5cGhfcm93LT5nbHlwaHNb aXQtPmFyZWFdOwogCX0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExF LUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBo LT5ieXRlcG9zID0gSVRfQllURVBPUyAoKml0KTsKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogICAgICAgZ2x5cGgtPmNoYXJwb3MgPSBpdC0+Y21wX2l0LmNoYXJwb3M7CiAgICAgICBn bHlwaC0+b2JqZWN0ID0gaXQtPm9iamVjdDsKICAgICAgIGVhc3NlcnQgKGl0LT5waXhlbF93aWR0 aCA8PSBTSFJUX01BWCk7CkBAIC0yNzM4Myw2ICszMjIwNywxNyBAQCBwcm9kdWNlX2ltYWdlX2ds eXBoIChzdHJ1Y3QgaXQgKml0KQogCX0KICAgICAgIGlmIChnbHlwaCA8IGl0LT5nbHlwaF9yb3ct PmdseXBoc1thcmVhICsgMV0pCiAJeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyog TVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAg ICAgZ2x5cGgtPmJ5dGVwb3MgPSBJVF9CWVRFUE9TICgqaXQpOworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKworCiAJICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7 CiAJICBnbHlwaC0+b2JqZWN0ID0gaXQtPm9iamVjdDsKIAkgIGdseXBoLT5waXhlbF93aWR0aCA9 IGNsaXBfdG9fYm91bmRzICgtMSwgaXQtPnBpeGVsX3dpZHRoLCBTSFJUX01BWCk7CkBAIC0yNzQ4 Niw2ICszMjMyMSwxNyBAQCBwcm9kdWNlX3h3aWRnZXRfZ2x5cGggKHN0cnVjdCBpdCAqaXQpCiAJ fQogICAgICAgaWYgKGdseXBoIDwgaXQtPmdseXBoX3Jvdy0+Z2x5cGhzW2FyZWEgKyAxXSkKIAl7 CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK KyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9IElU X0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgIGdseXBo LT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKIAkgIGdseXBoLT5vYmplY3QgPSBp dC0+b2JqZWN0OwogCSAgZ2x5cGgtPnBpeGVsX3dpZHRoID0gY2xpcF90b19ib3VuZHMgKC0xLCBp dC0+cGl4ZWxfd2lkdGgsIFNIUlRfTUFYKTsKQEAgLTI3NTcyLDYgKzMyNDE4LDE3IEBAIGFwcGVu ZF9zdHJldGNoX2dseXBoIChzdHJ1Y3QgaXQgKml0LCBMaXNwX09iamVjdCBvYmplY3QsCiAJICAg IHdpZHRoIC09IGl0LT5maXJzdF92aXNpYmxlX3ggLSBpdC0+Y3VycmVudF94OwogCSAgZWFzc2Vy dCAod2lkdGggPiAwKTsKIAl9CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBn bHlwaC0+Ynl0ZXBvcyA9IElUX0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKICAgICAgIGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsK ICAgICAgIGdseXBoLT5vYmplY3QgPSBvYmplY3Q7CiAgICAgICAvKiBGSVhNRTogSXQgd291bGQg YmUgYmV0dGVyIHRvIHVzZSBUWVBFX01BWCBoZXJlLCBidXQKQEAgLTI4MDI2LDYgKzMyODgzLDE3 IEBAIGFwcGVuZF9nbHlwaGxlc3NfZ2x5cGggKHN0cnVjdCBpdCAqaXQsIGludCBmYWNlX2lkLCBi b29sIGZvcl9ub19mb250LCBpbnQgbGVuLAogCSAgICBnWzFdID0gKmc7CiAJICBnbHlwaCA9IGl0 LT5nbHlwaF9yb3ctPmdseXBoc1thcmVhXTsKIAl9CisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhw b3M7CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9IElUX0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgICAgIGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQt PnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5vYmplY3QgPSBpdC0+b2JqZWN0OwogICAgICAgZWFz c2VydCAoaXQtPnBpeGVsX3dpZHRoIDw9IFNIUlRfTUFYKTsKQEAgLTI5MDc2LDEwICszMzk0NCwy MCBAQCB4X2luc2VydF9nbHlwaHMgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cg KnVwZGF0ZWRfcm93LAogCiAgIC8qIFdyaXRlIHRoZSBnbHlwaHMuICAqLwogICBocG9zID0gc3Rh cnQgLSByb3ctPmdseXBoc1t1cGRhdGVkX2FyZWFdOworCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlmICghbWNfcmVkcmF3X3JvdyAodywg dy0+Y3VycmVudF9tYXRyaXgsIHJvdywgdXBkYXRlZF9hcmVhLCB3LT5vdXRwdXRfY3Vyc29yLngs CisgICAgICAgICAgICAgICAgICAgICAgaHBvcywgaHBvcyArIGxlbiwgZmFsc2UsIERSQVdfTk9S TUFMX1RFWFQsIFhfSU5TRVJUX0dMWVBIUykpCiAgIGRyYXdfZ2x5cGhzICh3LCB3LT5vdXRwdXRf Y3Vyc29yLngsIHJvdywgdXBkYXRlZF9hcmVhLAogCSAgICAgICBocG9zLCBocG9zICsgbGVuLAog CSAgICAgICBEUkFXX05PUk1BTF9URVhULCAwKTsKIAorLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogICAvKiBBZHZhbmNlIHRoZSBvdXRwdXQgY3Vyc29yLiAgKi8KICAgdy0+b3V0cHV0X2N1 cnNvci5ocG9zICs9IGxlbjsKICAgdy0+b3V0cHV0X2N1cnNvci54ICs9IHNoaWZ0X2J5X3dpZHRo OwpAQCAtMjk1MDUsOSArMzQzODMsMTkgQEAgeF9maXhfb3ZlcmxhcHBpbmdfYXJlYSAoc3RydWN0 IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqcm93LAogCSAgd2hpbGUgKGkgPCByb3ctPnVz ZWRbYXJlYV0KIAkJICYmIHJvdy0+Z2x5cGhzW2FyZWFdW2ldLm92ZXJsYXBzX3ZlcnRpY2FsbHlf cCk7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKyAgICAgIGlmICghbWNfcmVkcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgsIHJvdywg YXJlYSwgc3RhcnRfeCwgc3RhcnQsIGksCisgICAgICAgICAgZmFsc2UsIERSQVdfTk9STUFMX1RF WFQsIFhfRklYX09WRVJMQVBQSU5HX0FSRUEpKQogCSAgZHJhd19nbHlwaHMgKHcsIHN0YXJ0X3gs IHJvdywgYXJlYSwKIAkJICAgICAgIHN0YXJ0LCBpLAogCQkgICAgICAgRFJBV19OT1JNQUxfVEVY VCwgb3ZlcmxhcHMpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJfQogICAgICAg ZWxzZQogCXsKQEAgLTI5NzU4LDEwICszNDY0NiwxNyBAQCBkaXNwbGF5X2FuZF9zZXRfY3Vyc29y IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIG9uLAogICBuZXdfY3Vyc29yX3R5cGUgPSBnZXRfd2lu ZG93X2N1cnNvcl90eXBlICh3LCBnbHlwaCwKIAkJCQkJICAgICZuZXdfY3Vyc29yX3dpZHRoLCAm YWN0aXZlX2N1cnNvcik7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKICAgLyogSWYgY3Vyc29yIGlzIGN1cnJlbnRseSBiZWluZyBzaG93biBh bmQgd2UgZG9uJ3Qgd2FudCBpdCB0byBiZSBvcgogICAgICBpdCBpcyBpbiB0aGUgd3JvbmcgcGxh Y2UsIG9yIHRoZSBjdXJzb3IgdHlwZSBpcyBub3Qgd2hhdCB3ZSB3YW50LAogICAgICBlcmFzZSBp dC4gICovCiAgIGlmICh3LT5waHlzX2N1cnNvcl9vbl9wCisgICAgICAmJiBOSUxQIChCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgJiYgTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udG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cGUsIG5l d19jdXJzb3Jfd2lkdGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb24s IGFjdGl2ZV9jdXJzb3IpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExF LUNVUlNPUlMgKi8KKworICBpZiAoTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBj cm9zc2hhaXJzKSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg ZmNfdmlzaWJsZSkpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IG1jX2NvbmYpKSkKKyAgICBGUkFNRV9SSUYgKGYpLT5kcmF3X3dpbmRvd19jdXJzb3IgKHcsIGds eXBoX3JvdywgeCwgeSwgbmV3X2N1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgbmV3X2N1cnNvcl93aWR0aCwgb24sIGFjdGl2ZV9jdXJzb3IpOworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiB9CiAKIApAQCAtMjk4ODcsNyArMzQ3OTUsMTgg QEAgZHJhd19yb3dfd2l0aF9tb3VzZV9mYWNlIChzdHJ1Y3Qgd2luZG93ICp3LCBpbnQgc3RhcnRf eCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQogICBp ZiAoRlJBTUVfV0lORE9XX1AgKFhGUkFNRSAody0+ZnJhbWUpKSkKICAgICB7CisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGlmICgh bWNfcmVkcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgsIHJvdywgVEVYVF9BUkVBLCBzdGFy dF94LAorICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydF9ocG9zLCBlbmRfaHBvcywgZmFs c2UsIGRyYXcsIERSQVdfUk9XX1dJVEhfTU9VU0VfRkFDRSkpCiAgICAgICBkcmF3X2dseXBocyAo dywgc3RhcnRfeCwgcm93LCBURVhUX0FSRUEsIHN0YXJ0X2hwb3MsIGVuZF9ocG9zLCBkcmF3LCAw KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgcmV0dXJuOwogICAgIH0K ICNlbmRpZgpAQCAtMzE5NDUsMTEgKzM2ODY0LDIzIEBAIGV4cG9zZV9hcmVhIChzdHJ1Y3Qgd2lu ZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIFhSZWN0YW5nbGUgKnIsCiAgIHN0cnVjdCBn bHlwaCAqbGFzdDsKICAgaW50IGZpcnN0X3gsIHN0YXJ0X3gsIHg7CiAKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgaWYgKGFyZWEgPT0gVEVY VF9BUkVBICYmIHJvdy0+ZmlsbF9saW5lX3ApCisgICAgeworICAgICAgaWYgKCFtY19yZWRyYXdf cm93ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgcm93LCBhcmVhLCAwLCAwLCByb3ctPnVzZWRbYXJl YV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgIGZhbHNlLCBEUkFXX05PUk1BTF9URVhULCBF WFBPU0VfQVJFQV9PTkUpKQogICAgIC8qIElmIHJvdyBleHRlbmRzIGZhY2UgdG8gZW5kIG9mIGxp bmUgd3JpdGUgdGhlIHdob2xlIGxpbmUuICAqLwogICAgIGRyYXdfZ2x5cGhzICh3LCAwLCByb3cs IGFyZWEsCiAJCSAwLCByb3ctPnVzZWRbYXJlYV0sCiAJCSBEUkFXX05PUk1BTF9URVhULCAwKTsK KyAgICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgZWxzZQogICAgIHsKICAg ICAgIC8qIFNldCBTVEFSVF9YIHRvIHRoZSB3aW5kb3ctcmVsYXRpdmUgc3RhcnQgcG9zaXRpb24g Zm9yIGRyYXdpbmcgZ2x5cGhzIG9mCkBAIC0zMTk4MSwxMSArMzY5MTIsMjMgQEAgZXhwb3NlX2Fy ZWEgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgWFJlY3RhbmdsZSAq ciwKIAkgICsrbGFzdDsKIAl9CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKICAgICAgIC8qIFJlcGFpbnQuICAqLwotICAgICAgaWYgKGxhc3Qg PiBmaXJzdCkKKyAgICAgIC8qIEZsb2F0aW5nIGZha2UgY3Vyc29ycyB3aWxsIGV4aXN0IHdoZW4g KGxhc3QgPT0gZmlyc3QpLiAqLworICAgICAgaWYgKCFtY19yZWRyYXdfcm93ICh3LCB3LT5jdXJy ZW50X21hdHJpeCwgcm93LCBhcmVhLCBmaXJzdF94IC0gc3RhcnRfeCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgZmlyc3QgLSByb3ctPmdseXBoc1thcmVhXSwgbGFzdCAtIHJvdy0+Z2x5cGhz W2FyZWFdLAorICAgICAgICAgICAgICAgICAgICAgICAgICBmYWxzZSwgRFJBV19OT1JNQUxfVEVY VCwgRVhQT1NFX0FSRUFfVFdPKQorICAgICAgICAgICYmIGxhc3QgPiBmaXJzdCkKIAlkcmF3X2ds eXBocyAodywgZmlyc3RfeCAtIHN0YXJ0X3gsIHJvdywgYXJlYSwKIAkJICAgICBmaXJzdCAtIHJv dy0+Z2x5cGhzW2FyZWFdLCBsYXN0IC0gcm93LT5nbHlwaHNbYXJlYV0sCiAJCSAgICAgRFJBV19O T1JNQUxfVEVYVCwgMCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICB9CiB9 CiAKQEAgLTMxOTk5LDEwICszNjk0MiwyMiBAQCBleHBvc2VfbGluZSAoc3RydWN0IHdpbmRvdyAq dywgc3RydWN0IGdseXBoX3JvdyAqcm93LCBYUmVjdGFuZ2xlICpyKQogewogICBlYXNzZXJ0IChy b3ctPmVuYWJsZWRfcCk7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKICAgaWYgKHJvdy0+bW9kZV9saW5lX3AgfHwgdy0+cHNldWRvX3dpbmRv d19wKQorICAgIHsKKyAgICAgIGlmICghbWNfcmVkcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRy aXgsIHJvdywgVEVYVF9BUkVBLCAwLCAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICByb3ct PnVzZWRbVEVYVF9BUkVBXSwgZmFsc2UsIERSQVdfTk9STUFMX1RFWFQsIEVYUE9TRV9MSU5FKSkK ICAgICBkcmF3X2dseXBocyAodywgMCwgcm93LCBURVhUX0FSRUEsCiAJCSAwLCByb3ctPnVzZWRb VEVYVF9BUkVBXSwKIAkJIERSQVdfTk9STUFMX1RFWFQsIDApOworICAgIH0KKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogICBlbHNlCiAgICAgewogICAgICAgaWYgKHJvdy0+dXNlZFtM RUZUX01BUkdJTl9BUkVBXSkKQEAgLTMyNTUwLDYgKzM3NTA1LDIyIEBAIHhfaW50ZXJzZWN0X3Jl Y3RhbmdsZXMgKFhSZWN0YW5nbGUgKnIxLCBYUmVjdGFuZ2xlICpyMiwgWFJlY3RhbmdsZSAqcmVz dWx0KQogdm9pZAogc3ltc19vZl94ZGlzcCAodm9pZCkKIHsKKworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBkZWZzdWJyICgmU21jX2R1bXBf Z2x5cGhfcm93KTsKKworICBkZWZzdWJyICgmU21jX2R1bXBfZ2x5cGhfbWF0cml4KTsKKworICBk ZWZzdWJyICgmU21jX2N1cnJlbnRfY29sdW1uKTsKKworICBkZWZzdWJyICgmU21jX3N0ZGVycik7 CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgVndpdGhfZWNob19hcmVhX3NhdmVf dmVjdG9yID0gUW5pbDsKICAgc3RhdGljcHJvICgmVndpdGhfZWNob19hcmVhX3NhdmVfdmVjdG9y KTsKIApkaWZmIC0tZ2l0IGEvc3JjL3h0ZXJtLmMgYi9zcmMveHRlcm0uYwppbmRleCA1YWEzZTNm Li42MjdmNDFiIDEwMDY0NAotLS0gYS9zcmMveHRlcm0uYworKysgYi9zcmMveHRlcm0uYwpAQCAt MTMyLDYgKzEzMiw4ODUgQEAgYWxvbmcgd2l0aCBHTlUgRW1hY3MuICBJZiBub3QsIHNlZSA8aHR0 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hhbmdlR0MgKGRweSwgZ2MsIG1hc2ssICZ4Z2N2KTsKKyAgICAg IGVsc2UKKyAgICAgICAgeworICAgICAgICAgIGdjID0gWENyZWF0ZUdDIChkcHksIHdpbmRvdywg bWFzaywgJnhnY3YpOworICAgICAgICAgIEZSQU1FX0RJU1BMQVlfSU5GTyAoZiktPnNjcmF0Y2hf Y3Vyc29yX2djID0gZ2M7CisgICAgICAgIH0KKyAgICAgIHhfY2xpcF90b19yb3cgKHcsIHJvdywg VEVYVF9BUkVBLCBnYyk7CisgICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChmLCBnYywgZngsIGZ5LCB3 ZCwgaCk7CisgICAgICB4X3Jlc2V0X2NsaXBfcmVjdGFuZ2xlcyAoZiwgZ2MpOworICAgIH0KK30K KworLyogUklGOiBEcmF3IGN1cnNvciBvbiB3aW5kb3cgVy4gKi8KK3N0YXRpYyB2b2lkCittY194 X2RyYXdfd2luZG93X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJp eCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICAgICAg ICAgaW50IHgsIGludCBmeCwgaW50IHksIGludCBmeSwgaW50IGhwb3MsIGludCB2cG9zLCBpbnQg d2QsCisgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGgsIHN0cnVjdCBtY19SR0IgbHNsLCBl bnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAg IGludCBjdXJzb3Jfd2lkdGgsIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciwgYm9vbCBvbl9w LAorICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgYWN0aXZlX3ApCit7CisgIHN0cnVjdCBm cmFtZSAqZiA9IFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7CisgIC8qIFRoZSBmcmluZ2UgYml0 bWFwcyBhcmU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2ZhY2VfaWQpOworICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9s bG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIist cmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgc3Ry dWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2Fj dGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElT UExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9mYWNl LT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElT UExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9yZWdp b25fYmVnX2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxz ZSBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcAor ICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID09IHJlZ2lvbl9l bmQpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93 X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50 ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWF0LXJlZ2lvbi1wcmUtenYtZmFjZSIpLCB0cnVlKTsK KyAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9yZWdpb25fZW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3Bp eGVsID0gY29sb3IucGl4ZWw7CisgICAgICAgICAgbWNfeF9kcmF3X2hvbGxvd19jdXJzb3IgKHcs IG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAgICAgICAg ICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7 CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoY3Vyc29yX2dseXBoLT50eXBlID09IElNQUdF X0dMWVBIICYmIGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wuYmx1ZSA+PSAw KQorICAgICAgICAgIHsKKyAgICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0 cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsJy4gKi8KKyAgICAgICAgICAgIGYtPm91dHB1dF9kYXRh LngtPmN1cnNvcl9waXhlbCA9IGNvbG9yLnBpeGVsOworICAgICAgICAgICAgbWNfeF9kcmF3X2hv bGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdk LCBoKTsKKyAgICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdp bmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAg ICAgeworICAgICAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRh LngtPmN1cnNvcl9nYycgYnkgYm9ycm93aW5nIHRoZQorICAgICAgICAgICAgICBmdW5jdGlvbmFs aXR5IG9mIGB4X21ha2VfZ2MnIGluIHhmbnMuYy4gKi8KKyAgICAgICAgICAgICAgaWYgKHJlZ2lv bl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgJiYgY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AgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25f YWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcAorICAgICAgICAg ICAgICAgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+Y2hhcnBvcyA9PSByZWdpb25fZW5kKQor ICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9s bG93X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwg aW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWF0LXJlZ2lvbi1wcmUtenYtZmFjZSIpLCB0cnVl KTsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfcmVnaW9u X2VuZF9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFj ZV9pZCk7CisgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2Zh Y2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vy c29yLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFj ZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2Zh Y2VfaWQpOworICAgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQ TEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfYWN0aXZlX2ZhY2Ut PmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVf WF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfYWN0aXZl X3JlZ2lvbl9lbmRfZmFjZS0+YmFja2dyb3VuZCk7CisgICAgICAgICAgICAgICAgICB9CisgICAg ICAgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIGFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJz b3JfZ2x5cGgtPmNoYXJwb3MgPiByZWdpb25fYmVnCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3MgPCByZWdpb25fZW5kKQorICAgICAgICAgICAgICAg ICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVf cmVnaW9uX2JldHdlZW5fZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4g KCIrLXJlYWwtZmFrZS1jdXJzb3ItaW4tcmVnaW9uLXByZS16di1mYWNlIiksIHRydWUpOworICAg ICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3 ZWVuX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5f ZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3Rp dmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFr ZS1jdXJzb3ItcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgc3Ry dWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFjZSA9IEZBQ0Vf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Jzb3JfZ2MsIGhvbGxvd19hY3RpdmVfZmFjZS0+YmFja2dyb3VuZCk7CisgICAgICAg ICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKCFhY3RpdmVf cCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2Ug KHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1wcmUtenYtZmFjZSIp LCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19p bmFjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCk7 CisgICAgICAgICAgICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BM QVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19pbmFjdGl2ZV9mYWNl LT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQg KEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93 X2luYWN0aXZlX2ZhY2UtPmJhY2tncm91bmQpOworICAgICAgICAgICAgICAgICAgICAgICAgfQor ICAgICAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgLyogRm9yY2UgYG1j X3hfc2V0X2N1cnNvcl9nYycgdG8gdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2Mn LiAqLworICAgICAgICAgICAgICBib29sIGN1cnNvcl9nY19wID0gdHJ1ZTsKKyAgICAgICAgICAg ICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwg aHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxzbCwgZ2x5 cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgY3Vyc29yX2djX3ApOworICAgICAgICAgICAgICBYU2V0Rm9yZWdy b3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCB4 Z2N2LmZvcmVncm91bmQpOworICAgICAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVfWF9E SVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCB4Z2N2LmJhY2tncm91bmQp OworICAgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgICAgICAgICAvKiBEcmF3 IHRoZSBmcmFtZSBhcm91bmQgdGhlIGJveC4gKi8KKyAgICAgICAgICAgICAgbWNfeF9kcmF3X2hv bGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdk LCBoKTsKKyAgICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0hP TExPV19CT1g6CisgICAgeworICAgICAgaWYgKGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3JlZW4gPj0g MCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkg aGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwnLiAqLworICAgICAgICAgIGYt Pm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IGNvbG9yLnBpeGVsOworICAgICAgICAgIG1j X3hfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9z LCB2cG9zLCB3ZCwgaCk7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVs ID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAg ICAgICBtY194X2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBm eSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNf RklMTEVEX0JPWDoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+ PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+ b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djJyBieSBib3Jyb3dpbmcgdGhlCisgICAgICAgIGZ1bmN0 aW9uYWxpdHkgb2YgYHhfbWFrZV9nYycgaW4geGZucy5jLiAqLworICAgICAgICB7CisgICAgICAg ICAgYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElT UExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgRlJBTUVfQkFDS0dST1VORF9Q SVhFTCAoZikpOworICAgICAgICAgIFhTZXRCYWNrZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYp LCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGNvbG9yLnBpeGVsKTsKKyAgICAgICAgICAv KiBGb3JjZSBgbWNfeF9zZXRfY3Vyc29yX2djJyB0byB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLngt PmN1cnNvcl9nYycuICovCisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IHRydWU7CisgICAg ICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwg eCwgaHBvcywgdnBvcywgbHNsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnbHlw aF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsIGN1cnNvcl9nY19wKTsKKyAgICAg ICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEu eC0+Y3Vyc29yX2djLCB4Z2N2LmZvcmVncm91bmQpOworICAgICAgICAgIFhTZXRCYWNrZ3JvdW5k IChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIHhnY3Yu YmFja2dyb3VuZCk7CisgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgfQorICAg ICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IGZh bHNlOworICAgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBE UkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywgbHNsLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29y X2djX3ApOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0JB UjoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxz bC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sg YGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCcuICovCisgICAgICAgICAgZi0+b3V0cHV0 X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gY29sb3IucGl4ZWw7CisgICAgICAgICAgYm9vbCBjdXJz b3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IHRydWU7CisgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9j dXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIE1DX0JBUiwgY3Vy c29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1 cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBl bHNlCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29r YXlfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJp eCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGgsIGN1cnNvcl93aWR0aCwgTUNfQkFSLCBjdXJzb3JfZ2NfaW52aXNp YmxlX29rYXlfcCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2Ug TUNfSEJBUjoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAw ICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBo aWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCcuICovCisgICAgICAgICAgZi0+ b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gY29sb3IucGl4ZWw7CisgICAgICAgICAgYm9v bCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IHRydWU7CisgICAgICAgICAgbWNfeF9kcmF3 X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdk LCBoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIE1DX0hC QVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0 YS54LT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgIH0KKyAg ICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlz aWJsZV9va2F5X3AgPSBmYWxzZTsKKyAgICAgICAgICAgIG1jX3hfZHJhd19iYXJfY3Vyc29yICh3 LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0hCQVIsIGN1cnNvcl9n Y19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9Cisg ICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOworICB9CisgICAgICAgIH0KKyNpZmRl ZiBIQVZFX1hfSTE4TgorICBpZiAodyA9PSBYV0lORE9XIChmLT5zZWxlY3RlZF93aW5kb3cpKQor ICAgIGlmIChGUkFNRV9YSUMgKGYpICYmIChGUkFNRV9YSUNfU1RZTEUgKGYpICYgWElNUHJlZWRp dFBvc2l0aW9uKSkKKyAgICAgIHhpY19zZXRfcHJlZWRpdGFyZWEgKHcsIHgsIHkpOworI2VuZGlm CisgICAgfQorICBYRmx1c2ggKEZSQU1FX1hfRElTUExBWSAoZikpOworfQorCisvKiBEcmF3IHN0 cmV0Y2ggZ2x5cGggc3RyaW5nIFMuICovCitzdGF0aWMgdm9pZAorbWNfeF9kcmF3X3N0cmV0Y2hf Z2x5cGhfc3RyaW5nIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzKQoreworICBlYXNzZXJ0IChzLT5m aXJzdF9nbHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKTsKKyAgaWYgKHMtPmhsID09IERSQVdf Q1VSU09SCisgICAgICAmJiAheF9zdHJldGNoX2N1cnNvcl9wKQorICAgIHsKKyAgICAgIC8qIElm IGB4LXN0cmV0Y2gtY3Vyc29yJyBpcyBuaWwsIGRvbid0IGRyYXcgYSBibG9jayBjdXJzb3IgYXMg d2lkZSBhcyB0aGUKKyAgICAgIHN0cmV0Y2ggZ2x5cGguICovCisgICAgICBpbnQgd2lkdGgsIGJh Y2tncm91bmRfd2lkdGggPSBzLT5iYWNrZ3JvdW5kX3dpZHRoOworICAgICAgaW50IHggPSBzLT54 OworICAgICAgaWYgKCFzLT5yb3ctPnJldmVyc2VkX3ApCisgICAgICAgIHsKKyAgICAgICAgICBp bnQgbGVmdF94ID0gd2luZG93X2JveF9sZWZ0X29mZnNldCAocy0+dywgVEVYVF9BUkVBKTsKKyAg ICAgICAgICBpZiAoeCA8IGxlZnRfeCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgYmFj a2dyb3VuZF93aWR0aCAtPSBsZWZ0X3ggLSB4OworICAgICAgICAgICAgICB4ID0gbGVmdF94Owor ICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAg ICAgICAgICAvKiBJbiBSMkwgcm93cywgZHJhdyB0aGUgY3Vyc29yIG9uIHRoZSByaWdodCBlZGdl IG9mIHRoZQorICAgICAgICAgICAgICAgc3RyZXRjaCBnbHlwaC4gKi8KKyAgICAgICAgICAgIGlu dCByaWdodF94ID0gd2luZG93X2JveF9yaWdodCAocy0+dywgVEVYVF9BUkVBKTsKKyAgICAgICAg ICAgIGlmICh4ICsgYmFja2dyb3VuZF93aWR0aCA+IHJpZ2h0X3gpCisgICAgICAgICAgICAgIGJh Y2tncm91bmRfd2lkdGggLT0geCAtIHJpZ2h0X3g7CisgICAgICAgICAgICB4ICs9IGJhY2tncm91 bmRfd2lkdGg7CisgICAgICAgICAgfQorICAgICAgd2lkdGggPSBtaW4gKEZSQU1FX0NPTFVNTl9X SURUSCAocy0+ZiksIGJhY2tncm91bmRfd2lkdGgpOworICAgICAgaWYgKHMtPnJvdy0+cmV2ZXJz ZWRfcCkKKyAgICAgICAgeCAtPSB3aWR0aDsKKyAgICAgIC8qIERyYXcgY3Vyc29yLiAqLworICAg ICAgeF9kcmF3X2dseXBoX3N0cmluZ19iZ19yZWN0IChzLCB4LCBzLT55LCB3aWR0aCwgcy0+aGVp Z2h0KTsKKyAgICAgIC8qIENsZWFyIHJlc3QgdXNpbmcgdGhlIEdDIG9mIHRoZSBvcmlnaW5hbCBu b24tY3Vyc29yIGZhY2UuICovCisgICAgICBpZiAod2lkdGggPCBiYWNrZ3JvdW5kX3dpZHRoKQor ICAgICAgICB7CisgICAgICAgICAgaW50IHkgPSBzLT55OworICAgICAgICAgIGludCB3ID0gYmFj a2dyb3VuZF93aWR0aCAtIHdpZHRoLCBoID0gcy0+aGVpZ2h0OworICAgICAgICAgIFhSZWN0YW5n bGUgcjsKKyAgICAgICAgICBHQyBnYzsKKyAgICAgICAgICBpZiAoIXMtPnJvdy0+cmV2ZXJzZWRf cCkKKyAgICAgICAgICAgIHggKz0gd2lkdGg7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAg eCA9IHMtPng7CisgICAgICAgICAgaWYgKHMtPnJvdy0+bW91c2VfZmFjZV9wCisgICAgICAgICAg ICAgICYmIGN1cnNvcl9pbl9tb3VzZV9mYWNlX3AgKHMtPncpKQorICAgICAgICAgICAgeworICAg ICAgICAgICAgICB4X3NldF9tb3VzZV9mYWNlX2djIChzKTsKKyAgICAgICAgICAgICAgZ2MgPSBz LT5nYzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICBnYyA9IHMt PmZhY2UtPmdjOworICAgICAgICAgIGdldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCAmcik7 CisgICAgICAgICAgeF9zZXRfY2xpcF9yZWN0YW5nbGVzIChzLT5mLCBnYywgJnIsIDEpOworICAg ICAgICAgIGlmIChzLT5mYWNlLT5zdGlwcGxlKQorICAgICAgICAgICAgeworICAgICAgICAgICAg ICAvKiBGaWxsIGJhY2tncm91bmQgd2l0aCBhIHN0aXBwbGUgcGF0dGVybi4gKi8KKyAgICAgICAg ICAgICAgWFNldEZpbGxTdHlsZSAocy0+ZGlzcGxheSwgZ2MsIEZpbGxPcGFxdWVTdGlwcGxlZCk7 CisgICAgICAgICAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIGdjLCB4LCB5LCB3LCBoKTsK KyAgICAgICAgICAgICAgWFNldEZpbGxTdHlsZSAocy0+ZGlzcGxheSwgZ2MsIEZpbGxTb2xpZCk7 CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAg ICAgICBYR0NWYWx1ZXMgeGdjdjsKKyAgICAgICAgICAgICAgWEdldEdDVmFsdWVzIChzLT5kaXNw bGF5LCBnYywgR0NGb3JlZ3JvdW5kIHwgR0NCYWNrZ3JvdW5kLCAmeGdjdik7CisgICAgICAgICAg ICAgIFhTZXRGb3JlZ3JvdW5kIChzLT5kaXNwbGF5LCBnYywgeGdjdi5iYWNrZ3JvdW5kKTsKKyAg ICAgICAgICAgICAgeF9maWxsX3JlY3RhbmdsZSAocy0+ZiwgZ2MsIHgsIHksIHcsIGgpOworICAg ICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwgZ2MsIHhnY3YuZm9yZWdyb3Vu ZCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgeF9yZXNldF9jbGlwX3JlY3RhbmdsZXMgKHMt PmYsIGdjKTsKKyAgICAgICAgfQorICAgIH0KKyAgZWxzZSBpZiAoIXMtPmJhY2tncm91bmRfZmls bGVkX3ApCisgICAgeworICAgICAgaW50IGJhY2tncm91bmRfd2lkdGggPSBzLT5iYWNrZ3JvdW5k X3dpZHRoOworICAgICAgaW50IHggPSBzLT54LCBsZWZ0X3ggPSB3aW5kb3dfYm94X2xlZnRfb2Zm c2V0IChzLT53LCBURVhUX0FSRUEpOworICAgICAgLyogRG9uJ3QgZHJhdyBpbnRvIGxlZnQgbWFy Z2luLCBmcmluZ2Ugb3Igc2Nyb2xsYmFyIGFyZWEKKyAgICAgICAgIGV4Y2VwdCBmb3IgaGVhZGVy IGxpbmUgYW5kIG1vZGUgbGluZS4gKi8KKyAgICAgIGlmICh4IDwgbGVmdF94ICYmICFzLT5yb3ct Pm1vZGVfbGluZV9wKQorICAgICAgICB7CisgICAgICAgICAgYmFja2dyb3VuZF93aWR0aCAtPSBs ZWZ0X3ggLSB4OworICAgICAgICAgIHggPSBsZWZ0X3g7CisgICAgICAgIH0KKyAgICAgIGlmIChi YWNrZ3JvdW5kX3dpZHRoID4gMCkKKyAgICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19iZ19yZWN0 IChzLCB4LCBzLT55LCBiYWNrZ3JvdW5kX3dpZHRoLCBzLT5oZWlnaHQpOworICAgIH0KKyAgcy0+ YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7Cit9CisKKy8qIERyYXcgZ2x5cGggc3RyaW5nIFMu ICovCitzdGF0aWMgdm9pZAorbWNfeF9kcmF3X2dseXBoX3N0cmluZyAoc3RydWN0IGdseXBoX3N0 cmluZyAqcywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpy b3csCisgICAgICAgICAgICAgICAgICAgIC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ZXRfZ2x5 cGhfc3RyaW5nX2NsaXBwaW5nIChuZXh0KTsKKyAgICAgICAgICAgIGlmIChuZXh0LT5maXJzdF9n bHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKQorICAgICAgICAgICAgICBtY194X2RyYXdfc3Ry ZXRjaF9nbHlwaF9zdHJpbmcgKG5leHQpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKG5leHQsIHRydWUpOworICAgICAgICAg ICAgbmV4dC0+bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICB9CisgICAgfQorICAvKiBTZXQgdXAg Uy0+Z2MsIHNldCBjbGlwcGluZyBhbmQgZHJhdyBTLiAqLworICBtY194X3NldF9nbHlwaF9zdHJp bmdfZ2MgKHMsIGN1cnNvcl9nY19wKTsKKyAgLyogRHJhdyByZWxpZWYgKGlmIGFueSkgaW4gYWR2 YW5jZSBmb3IgY2hhci9jb21wb3NpdGlvbiBzbyB0aGF0IHRoZQorICAgICBnbHlwaCBzdHJpbmcg Y2FuIGJlIGRyYXduIG92ZXIgaXQuICovCisgIGlmICghcy0+Zm9yX292ZXJsYXBzCisgICAgICAm JiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gKKyAgICAgICYmIChzLT5maXJzdF9nbHlwaC0+ dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAgICAgfHwgcy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0g Q09NUE9TSVRFX0dMWVBIKSkKKyAgICB7CisgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBp bmcgKHMpOworICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19iYWNrZ3JvdW5kIChzLCB0cnVlKTsK KyAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYm94IChzKTsKKyAgICAgIHhfc2V0X2dseXBoX3N0 cmluZ19jbGlwcGluZyAocyk7CisgICAgICByZWxpZWZfZHJhd25fcCA9IHRydWU7CisgICAgfQor ICAgIGVsc2UgaWYgKCFzLT5jbGlwX2hlYWQgLyogZHJhd19nbHlwaHMgZGlkbid0IHNwZWNpZnkg YSBjbGlwIG1hc2suICovCisgICAgICAgICAgICAgJiYgIXMtPmNsaXBfdGFpbAorICAgICAgICAg ICAgICYmICgocy0+cHJldiAmJiBzLT5wcmV2LT5obCAhPSBzLT5obCAmJiBzLT5sZWZ0X292ZXJo YW5nKQorICAgICAgICAgICAgICAgICB8fCAocy0+bmV4dCAmJiBzLT5uZXh0LT5obCAhPSBzLT5o bCAmJiBzLT5yaWdodF9vdmVyaGFuZykpKQorICAgICAgLyogV2UgbXVzdCBjbGlwIGp1c3QgdGhp cyBnbHlwaC4gIGxlZnRfb3ZlcmhhbmcgcGFydCBoYXMgYWxyZWFkeQorICAgICAgICAgZHJhd24g d2hlbiBzLT5wcmV2IHdhcyBkcmF3biwgYW5kIHJpZ2h0X292ZXJoYW5nIHBhcnQgd2lsbCBiZQor ICAgICAgICAgZHJhd24gbGF0ZXIgd2hlbiBzLT5uZXh0IGlzIGRyYXduLiAqLworICAgICAgeF9z ZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nX2V4YWN0bHkgKHMsIHMpOworICAgICAgZWxzZQorICAg ICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmcgKHMpOworICBzd2l0Y2ggKHMtPmZpcnN0 X2dseXBoLT50eXBlKQorICAgIHsKKyAgICBjYXNlIElNQUdFX0dMWVBIOgorICAgICAgeF9kcmF3 X2ltYWdlX2dseXBoX3N0cmluZyAocyk7CisgICAgICBicmVhazsKKyAgICBjYXNlIFhXSURHRVRf R0xZUEg6CisgICAgICB4X2RyYXdfeHdpZGdldF9nbHlwaF9zdHJpbmcgKHMpOworICAgICAgYnJl YWs7CisgICAgY2FzZSBTVFJFVENIX0dMWVBIOgorICAgICAgbWNfeF9kcmF3X3N0cmV0Y2hfZ2x5 cGhfc3RyaW5nIChzKTsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgQ0hBUl9HTFlQSDoKKyAgICAg IGlmIChzLT5mb3Jfb3ZlcmxhcHMpCisgICAgICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0 cnVlOworICAgICAgZWxzZQorICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQg KHMsIGZhbHNlKTsKKyAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7Cisg ICAgICBicmVhazsKKyAgICBjYXNlIENPTVBPU0lURV9HTFlQSDoKKyAgICAgIGlmIChzLT5mb3Jf b3ZlcmxhcHMgfHwgKHMtPmNtcF9mcm9tID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgISBzLT5maXJzdF9nbHlwaC0+dS5jbXAuYXV0b21hdGljKSkKKyAgICAgICAgcy0+YmFj a2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICBlbHNlCisgICAgICAgIHhfZHJhd19nbHlw aF9zdHJpbmdfYmFja2dyb3VuZCAocywgdHJ1ZSk7CisgICAgICB4X2RyYXdfY29tcG9zaXRlX2ds eXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgR0xZUEhM RVNTX0dMWVBIOgorICAgICAgaWYgKHMtPmZvcl9vdmVybGFwcykKKyAgICAgICAgcy0+YmFja2dy b3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICBlbHNlCisgICAgICAgIHhfZHJhd19nbHlwaF9z dHJpbmdfYmFja2dyb3VuZCAocywgdHJ1ZSk7CisgICAgICB4X2RyYXdfZ2x5cGhsZXNzX2dseXBo X3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAgICAgIGJyZWFrOworICAgIGRlZmF1bHQ6CisgICAg ICBlbWFjc19hYm9ydCAoKTsKKyAgICB9CisgIGlmICghcy0+Zm9yX292ZXJsYXBzKQorICAgIHsK KyAgICAgIC8qIERyYXcgdW5kZXJsaW5lLiAqLworICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGlu ZV9wKQorICAgICAgICB7CisgICAgICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09 IEZBQ0VfVU5ERVJfV0FWRSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKHMtPmZh Y2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICB4X2RyYXdfdW5kZXJ3 YXZlIChzKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAgIFhHQ1ZhbHVlcyB4Z2N2OworICAgICAgICAgICAgICAgICAgWEdldEdDVmFsdWVz IChzLT5kaXNwbGF5LCBzLT5nYywgR0NGb3JlZ3JvdW5kLCAmeGdjdik7CisgICAgICAgICAgICAg ICAgICBYU2V0Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwgcy0+Z2MsIHMtPmZhY2UtPnVuZGVybGlu ZV9jb2xvcik7CisgICAgICAgICAgICAgICAgICB4X2RyYXdfdW5kZXJ3YXZlIChzKTsKKyAgICAg ICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChzLT5kaXNwbGF5LCBzLT5nYywgeGdjdi5mb3Jl Z3JvdW5kKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxz ZSBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIHRoaWNrbmVzcywgcG9zaXRpb247 CisgICAgICAgICAgICAgIGludCB5OworICAgICAgICAgICAgICBpZiAocy0+cHJldiAmJiBzLT5w cmV2LT5mYWNlLT51bmRlcmxpbmVfcAorICAgICAgICAgICAgICAgICAgJiYgcy0+cHJldi0+ZmFj ZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgIC8qIFdlIHVzZSB0aGUgc2FtZSB1bmRlcmxpbmUgc3R5bGUgYXMg dGhlIHByZXZpb3VzIG9uZS4gKi8KKyAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPnBy ZXYtPnVuZGVybGluZV90aGlja25lc3M7CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMt PnByZXYtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhl IHVuZGVybGluZSB0aGlja25lc3MuICBEZWZhdWx0IGlzIDEgcGl4ZWwuICovCisgICAgICAgICAg ICAgICAgICBpZiAocy0+Zm9udCAmJiBzLT5mb250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4gMCkK KyAgICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNr bmVzczsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgdGhpY2tu ZXNzID0gMTsKKyAgICAgICAgICAgICAgICAgIGlmICh4X3VuZGVybGluZV9hdF9kZXNjZW50X2xp bmUpCisgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmhlaWdodCAtIHRoaWNrbmVz cykgLSAocy0+eWJhc2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJsaW5l IHBvc2l0aW9uLiAgVGhpcyBpcyB0aGUgcmVjb21tZW5kZWQKKyAgICAgICAgICAgICAgICAgICAg ICAgICB2ZXJ0aWNhbCBvZmZzZXQgaW4gcGl4ZWxzIGZyb20gdGhlIGJhc2VsaW5lIHRvIHRoZSB0 b3Agb2YKKyAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgdW5kZXJsaW5lLiAgVGhpcyBpcyBh IHNpZ25lZCB2YWx1ZSBhY2NvcmRpbmcgdG8gdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAg c3BlY3MsIGFuZCBpdHMgZGVmYXVsdCBpcworICAgICAgICAgICAgICAgICAgICAgICAgIFJPVU5E ICgobWF4aW11bSBkZXNjZW50KSAvIDIpLCB3aXRoCisgICAgICAgICAgICAgICAgICAgICAgICAg Uk9VTkQoeCkgPSBmbG9vciAoeCArIDAuNSkgICovCisgICAgICAgICAgICAgICAgICAgICAgaWYg KHhfdXNlX3VuZGVybGluZV9wb3NpdGlvbl9wcm9wZXJ0aWVzCisgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHMtPmZvbnQgJiYgcy0+Zm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uID49IDApCisg ICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPmZvbnQtPnVuZGVybGluZV9wb3Np dGlvbjsKKyAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChzLT5mb250KQorICAgICAgICAg ICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+Zm9udC0+ZGVzY2VudCArIDEpIC8gMjsKKyAg ICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlv biA9IHVuZGVybGluZV9taW5pbXVtX29mZnNldDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAg ICAgICAgICAgICAgICAgcG9zaXRpb24gPSBtYXggKHBvc2l0aW9uLCB1bmRlcmxpbmVfbWluaW11 bV9vZmZzZXQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgLyogQ2hlY2sgdGhl IHNhbml0eSBvZiB0aGlja25lc3MgYW5kIHBvc2l0aW9uLiAgV2Ugc2hvdWxkCisgICAgICAgICAg ICAgICAgIGF2b2lkIGRyYXdpbmcgdW5kZXJsaW5lIG91dCBvZiB0aGUgY3VycmVudCBsaW5lIGFy ZWEuICovCisgICAgICAgICAgICAgIGlmIChzLT55ICsgcy0+aGVpZ2h0IDw9IHMtPnliYXNlICsg cG9zaXRpb24pCisgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+aGVpZ2h0IC0gMSkgLSAo cy0+eWJhc2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQgPCBz LT55YmFzZSArIHBvc2l0aW9uICsgdGhpY2tuZXNzKQorICAgICAgICAgICAgICAgIHRoaWNrbmVz cyA9IChzLT55ICsgcy0+aGVpZ2h0KSAtIChzLT55YmFzZSArIHBvc2l0aW9uKTsKKyAgICAgICAg ICAgICAgcy0+dW5kZXJsaW5lX3RoaWNrbmVzcyA9IHRoaWNrbmVzczsKKyAgICAgICAgICAgICAg cy0+dW5kZXJsaW5lX3Bvc2l0aW9uID0gcG9zaXRpb247CisgICAgICAgICAgICAgIHkgPSBzLT55 YmFzZSArIHBvc2l0aW9uOworICAgICAgICAgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX2Rl ZmF1bHRlZF9wKQorICAgICAgICAgICAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdj LCBzLT54LCB5LCBzLT53aWR0aCwgdGhpY2tuZXNzKTsKKyAgICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIFhHQ1ZhbHVlcyB4Z2N2OworICAgICAg ICAgICAgICAgICAgWEdldEdDVmFsdWVzIChzLT5kaXNwbGF5LCBzLT5nYywgR0NGb3JlZ3JvdW5k LCAmeGdjdik7CisgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwg cy0+Z2MsIHMtPmZhY2UtPnV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BpZiAocy0+cHJldikKKyAgICAgICAgeworICAg ICAgICAgIHN0cnVjdCBnbHlwaF9zdHJpbmcgKnByZXY7CisgICAgICAgICAgZm9yIChwcmV2ID0g cy0+cHJldjsgcHJldjsgcHJldiA9IHByZXYtPnByZXYpCisgICAgICAgICAgICBpZiAocHJldi0+ aGwgIT0gcy0+aGwKKyAgICAgICAgICAgICAgICAmJiBwcmV2LT54ICsgcHJldi0+d2lkdGggKyBw cmV2LT5yaWdodF9vdmVyaGFuZyA+IHMtPngpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICAvKiBBcyBwcmV2IHdhcyBkcmF3biB3aGlsZSBjbGlwcGVkIHRvIGl0cyBvd24gYXJlYSwg d2UKKyAgICAgICAgICAgICAgICAgICBtdXN0IGRyYXcgdGhlIHJpZ2h0X292ZXJoYW5nIHBhcnQg dXNpbmcgcy0+aGwgbm93LiAqLworICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFj ZSBzYXZlID0gcHJldi0+aGw7CisgICAgICAgICAgICAgICAgcHJldi0+aGwgPSBzLT5obDsKKyAg ICAgICAgICAgICAgICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKHByZXYsIGN1cnNvcl9nY19w KTsKKyAgICAgICAgICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAo cywgcHJldik7CisgICAgICAgICAgICAgICAgaWYgKHByZXYtPmZpcnN0X2dseXBoLT50eXBlID09 IENIQVJfR0xZUEgpCisgICAgICAgICAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVn cm91bmQgKHByZXYpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIHhf ZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHByZXYpOworICAgICAgICAg ICAgICAgIHhfcmVzZXRfY2xpcF9yZWN0YW5nbGVzIChwcmV2LT5mLCBwcmV2LT5nYyk7CisgICAg ICAgICAgICAgICAgcHJldi0+aGwgPSBzYXZlOworICAgICAgICAgICAgICAgIHByZXYtPm51bV9j bGlwcyA9IDA7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKHMtPm5leHQp CisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpuZXh0OworICAgICAg ICAgIGZvciAobmV4dCA9IHMtPm5leHQ7IG5leHQ7IG5leHQgPSBuZXh0LT5uZXh0KQorICAgICAg ICAgICAgaWYgKG5leHQtPmhsICE9IHMtPmhsCisgICAgICAgICAgICAgICAgJiYgbmV4dC0+eCAt IG5leHQtPmxlZnRfb3ZlcmhhbmcgPCBzLT54ICsgcy0+d2lkdGgpCisgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAvKiBBcyBuZXh0IHdpbGwgYmUgZHJhd24gd2hpbGUgY2xpcHBlZCB0 byBpdHMgb3duIGFyZWEsCisgICAgICAgICAgICAgICAgICAgd2UgbXVzdCBkcmF3IHRoZSBsZWZ0 X292ZXJoYW5nIHBhcnQgdXNpbmcgcy0+aGwgbm93LiAqLworICAgICAgICAgICAgICAgIGVudW0g ZHJhd19nbHlwaHNfZmFjZSBzYXZlID0gbmV4dC0+aGw7CisgICAgICAgICAgICAgICAgbmV4dC0+ aGwgPSBzLT5obDsKKyAgICAgICAgICAgICAgICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKG5l eHQsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xp cHBpbmdfZXhhY3RseSAocywgbmV4dCk7CisgICAgICAgICAgICAgICAgaWYgKG5leHQtPmZpcnN0 X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgpCisgICAgICAgICAgICAgICAgICB4X2RyYXdfZ2x5 cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5leHQpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgICAgICAgIHhfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5l eHQpOworICAgICAgICAgICAgICAgIHhfcmVzZXRfY2xpcF9yZWN0YW5nbGVzIChuZXh0LT5mLCBu ZXh0LT5nYyk7CisgICAgICAgICAgICAgICAgbmV4dC0+aGwgPSBzYXZlOworICAgICAgICAgICAg ICAgIG5leHQtPm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgICAgICAgbmV4dC0+Y2xpcF9oZWFk ID0gcy0+bmV4dDsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAvKiBSZXNl dCBjbGlwcGluZy4gKi8KKyAgeF9yZXNldF9jbGlwX3JlY3RhbmdsZXMgKHMtPmYsIHMtPmdjKTsK KyAgcy0+bnVtX2NsaXBzID0gMDsKK30KKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKIC8qIERlZmF1bHQgdG8gdXNpbmcgWElNIGlmIGF2 YWlsYWJsZS4gICovCiAjaWZkZWYgVVNFX1hJTQogYm9vbCB1c2VfeGltID0gdHJ1ZTsKQEAgLTk5 OSw2ICsxODc4LDE1IEBAIHhfdXBkYXRlX2JlZ2luIChzdHJ1Y3QgZnJhbWUgKmYpCiAgIGlmIChG UkFNRV9UT09MVElQX1AgKGYpICYmICFGUkFNRV9WSVNJQkxFX1AgKGYpKQogICAgIHJldHVybjsK IAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwor ICBmLT5tY191cGRhdGluZ19mcmFtZSA9IGY7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor CisKICAgaWYgKCEgRlJBTUVfQ1JfU1VSRkFDRSAoZikpCiAgICAgewogICAgICAgaW50IHdpZHRo LCBoZWlnaHQ7CkBAIC0xMjY2LDYgKzIxNTQsMTYgQEAgeF91cGRhdGVfZW5kIChzdHJ1Y3QgZnJh bWUgKmYpCiAgIFhGbHVzaCAoRlJBTUVfWF9ESVNQTEFZIChmKSk7CiAgIHVuYmxvY2tfaW5wdXQg KCk7CiAjZW5kaWYKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKworICBmLT5tY191cGRhdGluZ19mcmFtZSA9IE5VTEw7CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKIH0KIAogLyogVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgZnJvbSB2 YXJpb3VzIHBsYWNlcyBpbiB4ZGlzcC5jCkBAIC0xMzEwMCw2ICsxMzk5OCwyMSBAQCB4X2FjdGl2 YXRlX3RpbWVvdXRfYXRpbWVyICh2b2lkKQogCiBzdGF0aWMgc3RydWN0IHJlZGlzcGxheV9pbnRl cmZhY2UgeF9yZWRpc3BsYXlfaW50ZXJmYWNlID0KICAgeworCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisvKiBgcmVkaXNwbGF5X2ludGVyZmFj ZScgaW4gYHh0ZXJtLmNgIG11c3QgYmUgaW4gdGhlIGV4YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitg cmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYGRpc3BleHRlcm4uaGAhICovCisKKyAgbWNfeF93cml0 ZV9nbHlwaHMsCisgIG1jX3hfZHJhd193aW5kb3dfY3Vyc29yLAorICBtY194X2RyYXdfZ2x5cGhf c3RyaW5nLAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgeF9mcmFtZV9wYXJt X2hhbmRsZXJzLAogICAgIHhfcHJvZHVjZV9nbHlwaHMsCiAgICAgeF93cml0ZV9nbHlwaHMsCg== --Multipart_Sun_Jun_16_01:07:46_2019-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs). References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Mon, 24 Jun 2019 02:30:02 +0000 Resent-Message-ID: <handler.22873.B22873.156134339228030 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22873 <at> debbugs.gnu.org,17684 <at> debbugs.gnu.org Cc: eliz@HIDDEN, johnw@HIDDEN, mbork@HIDDEN, rms@HIDDEN, akioburns@HIDDEN Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.156134339228030 (code B ref 22873); Mon, 24 Jun 2019 02:30:02 +0000 Received: (at 22873) by debbugs.gnu.org; 24 Jun 2019 02:29:52 +0000 Received: from localhost ([127.0.0.1]:55339 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1hfEjw-0007I2-0W for submit <at> debbugs.gnu.org; Sun, 23 Jun 2019 22:29:52 -0400 Received: from gateway34.websitewelcome.com ([192.185.148.200]:28503) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1hfEju-0007Hq-1s for 22873 <at> debbugs.gnu.org; Sun, 23 Jun 2019 22:29:50 -0400 Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway34.websitewelcome.com (Postfix) with ESMTP id 6C60F1F549 for <22873 <at> debbugs.gnu.org>; Sun, 23 Jun 2019 21:25:22 -0500 (CDT) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id fEfZhyEdldnCefEfahYM8i; Sun, 23 Jun 2019 21:25:22 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=z6FOA5wOhzxUd3Bu2nENRCnhTcl3ZbMeU/3yEPzD4Lw=; b=ZttKA2I4ILOXd6+p3YWFznS9hx eG77gRNd8ugcVQMiUjqXb4m4NSghqSLQUWINoMgGaDXJ1ff7P9bZUNRpSpg9gc7jOAOda4ywx070E 9uxo/e3jSGkt7EruhKOjo3H2XzP2Zd4LVEcEHTeX+KQCujVPZSU5T7rRcKwwPSwjFpnlBITxagCRO 31ysS8Jyag1BN955f92TAL99FaRDUImSn+trCCrUbA5F4ouvycPXGMlOLAMQgtnrMkcr+WgFVb/a/ PcCl9J+4H7OyaxUz8GOxROQg8rNBAzHH9VIz6oCExatwMvlNoj71c6dEyBuSLwKkSlkfmJ4xIQG97 V1QONLfw==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:51403 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.92) (envelope-from <esq@HIDDEN>) id 1hfEfV-004CBA-QN; Sun, 23 Jun 2019 21:25:21 -0500 Date: Sun, 23 Jun 2019 19:25:16 -0700 Message-ID: <m2k1dbu3cj.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Sun_Jun_23_19:25:16_2019-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1hfEfV-004CBA-QN X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:51403 X-Source-Auth: lawlist X-Email-Count: 7 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> --Multipart_Sun_Jun_23_19:25:16_2019-1 Content-Type: text/plain; charset=US-ASCII VERSION: 021.003 [06/23/2019] CHANGELOG: - `bottom_vpos' has been removed as a function parameter of `mc_draw_row' and `mc_draw_glyphs'. - Removed the `redisplay_interface' component named `mc_scribe_glyphs'. Removed the function `mc_x_write_glyphs'. `mc_draw_glyphs' is now called directly from `mc_update_text_area'. - Revised instructions regarding how to use the built-in fake cursors with Magnar's library (multiple-cursors). [Adjusted calls to `mc/built-in-cursors' within `crosshairs.el'.] - Miscellaneous tidying-up of code. SCREENSHOTS (X11, W32, NS): https://www.lawlist.com/images/22873_17684_light_dark_backgrounds.png SETUP: Step 1: git clone -b master git://git.sv.gnu.org/emacs.git Step 2: In the new emacs folder, go back to an Emacs version from 04/08/2019: git reset --hard a038df77de7b1aa2d73a6478493b8838b59e4982 Step 3: From within the new emacs folder created in Step 1, apply the patch: git apply /path/to/the/patch.diff Step 4: ./autogen.sh Step 5: ./configure ... [your custom options] Step 6: make Step 7: make install USAGE: - For a minimal working example of built-in fake cursors, type: M-x mc-test ;;; TURN ON FAKE CURSORS (buffer position, cursor-type, cursor color): (setq mc-conf '((1 "hbar" "magenta") (2 "bar" "purple") (3 "box" "#00FF00") (4 "hollow" "#0000FF") (5 ("hbar" 3) [1.0 0.0 1.0]) (6 ("bar" 3) [0.0 1.0 1.0]) (7 "framed" "OrangeRed")))) ;;; TURN OFF FAKE CURSORS: (setq mc-conf nil) - To try out both the crosshairs feature and the visible fill column indicator feature, type: M-x +-mode - To try out just the visible fill column indicator feature, type: M-x fc-mode - To try out built-in fake cursors with Magnar Sveen's multiple-cursors package, that package must be installed. If the multiple-cursors package is already installed, then just (require 'crosshairs) and `crosshairs.el` will redefine a few of the multiple-cursors functions and set up a few keyboard shortcuts. If the multiple-cursors package by Magnar Sveen is not already installed, then here are two easy ways to install that package: Type: M-x mc-install OR, evaluate the following snippet: (progn (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) (package-refresh-contents) (package-install 'multiple-cursors) (mc/built-in-cursors)) TODO: - `ns_draw_window_cursor' calls `ns_clip_to_rect', which does _not_ take `row->clip` into consideration when drawing cursors with `NSRectFill'. When it comes time to draw glyphs on top of the box/hollow family of cursors, `row->clip` is taken into consideration by `get_glyph_string_clip'. Fake cursors can be drawn even though the glyphs cannot, resulting in hollow/box family of cursors without text. The issue can be reproduced with M-x mc-test. [A temporary workaround is to disable `row->clip` while drawing the glyphs.] https://lists.gnu.org/archive/html/emacs-devel/2019-04/msg00009.html - Add additional support for `ch_inactive_windows' and `fc_inactive_windows' when the variables have a `nil` value. In such a case, the inactive windows should not display the crosshairs and/or visible fill column indicator. At the present time, fake cursors are drawn in active/inactive windows alike. - Deal with left/right overwritten glyphs in the w32 and X ports of Emacs. - Is there any additional meaningful optimization that can be added to the three calls of `mc_pre_scroll_clean'? - NOTE: As to `mc_scrolling_window', it would appear that there is no tangible benefit to rotating the current/prospective cache of fake cursors to compare the data before removing the fake cursors. When scrolling the display, only _some_ lines are copied to new locations. Areas that are not overwritten may have fake cursors and those may not necessarily be removed if desired/current matrix glyphs are equal. The test for `GLYPH_EQUAL_P' does not take into consideration the existence of a fake cursor, and the glyph (with a fake cursor) may not be updated as a result thereof. As to lines that are not copied, portions may be updated and fake cursors would be removed thereby. - When an idle-timer fires and point is at the end of a horizontally scrolled line in a narrow window, the temporary horizontal scroll is canceled. Create an minimal working example and file a bug report. - There is a bug affecting an older version of Emacs for the NS port that causes partial line flickering when the same characters are grouped together (;;;;;;) and MC_GLYPHLESS cursors are above or below -- having the same background color as the frame; e.g., black on black (used to erase a glyphless cursor). The partial flickering is only noticeable with rapid fire; e.g., holding down the right/left arrow key. When changing the color of the glyphless cursor, the issue is not present. [@lawlist has verified that the X and HPOS coordinates are accurate.] - There is a bug affecting the recorded `w->mc.lnum_pixel_width` that is observable when not running under gdb, but disappears when running under gdb. While viewing a folded org-mode buffer, the non-gdb instance had a visible line number pixel-width of 44, but Emacs treated it as fluctuating between 44 and 55 as the cursor was moved to the end of line. In the gdb instance, the visible line number pixel width was 55 with no fluctuation under the same conditions as the non-gdb instance. This appears to be a different bug than bug#32177 (current line number shifts one column to the left) because the line number of the current line does not shift left, and changing the bidi settings did not correct the issue. - The current test for `auto_hscroll_mode_p' only looks for `current_line` and all five related tests are based upon that assumption, which may not be true. - Multiple Cursors: If point is in the middle of a composite character, then select a fully composed character so that the fake cursor is visible. - Implement functionality similar to the Lisp multiple-cursors by Magnar Sveen. - Follow up with the Emacs team re bug#32177; i.e., (Current line number shifts one column to the left.) - Follow up with the Emacs team re bug#32060; i.e., Horizontal Scrolling (Current Line): Wrong line gets h-scrolled. - Determine if bug #28936 needs to be fixed and help the Emacs team re same. --Multipart_Sun_Jun_23_19:25:16_2019-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="2019_06_23__17_05_04_651.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvY3Jvc3NoYWlycy5lbCBiL2xpc3AvY3Jvc3NoYWlycy5lbApuZXcg ZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi43ODI3NTJmCi0tLSAvZGV2L251bGwKKysr IGIvbGlzcC9jcm9zc2hhaXJzLmVsCkBAIC0wLDAgKzEsMTI4OCBAQAorOzs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Cis7OzsgQkVHSU4gbW9kaWZpY2F0aW9uIG9mIHRoZSBNdWx0aXBsZSBDdXJzb3Jz IGxpYnJhcnkgd3JpdHRlbiBieSAgTWFnbmFyIFN2ZWVuLgorCisoZGVmdmFyIHBhY2thZ2UtYXJj aGl2ZXMpCisKKyhkZWZ2YXIgbWMtLW1heC1jdXJzb3JzLW9yaWdpbmFsK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gICAgICAo c2V0cSBtYy0tbWF4LWN1cnNvcnMtb3JpZ2luYWwgbWMvbWF4LWN1cnNvcnMpKQorICAgICh3aGVu IG1jL21heC1jdXJzb3JzCisgICAgICAodW5sZXNzICg8IChtYy9udW0tY3Vyc29ycykgbWMvbWF4 LWN1cnNvcnMpCisgICAgICAgIChpZiAoeWVzLW9yLW5vLXAgKGZvcm1hdCAiJWQgYWN0aXZlIGN1 cnNvcnMuIENvbnRpbnVlPyAiIChtYy9udW0tY3Vyc29ycykpKQorICAgICAgICAgICAgKHNldHEg bWMvbWF4LWN1cnNvcnMgKHJlYWQtbnVtYmVyICJFbnRlciBhIG5ldywgdGVtcG9yYXJ5IG1heGlt dW06ICIpKQorICAgICAgICAgIChtYy9yZW1vdmUtZmFrZS1jdXJzb3JzKQorICAgICAgICAgIChl cnJvciAiQWJvcnRlZDogdG9vIG1hbnkgY3Vyc29ycyIpKSkpCisgICAgKGxldCAoKG92ZXJsYXkK KyAgICAgICAgICAgIChpZiBtYy91c2UtYnVpbHQtaW4tY3Vyc29ycworICAgICAgICAgICAgICAo bWFrZS1vdmVybGF5IChwb2ludCkgKHBvaW50KSkKKyAgICAgICAgICAgICAgKG1jL21ha2UtY3Vy c29yLW92ZXJsYXktYXQtcG9pbnQpKSkpCisgICAgICAob3ZlcmxheS1wdXQgb3ZlcmxheSAnbWMt aWQgKG9yIGlkIChtYy9jcmVhdGUtY3Vyc29yLWlkKSkpCisgICAgICAob3ZlcmxheS1wdXQgb3Zl cmxheSAndHlwZSAnZmFrZS1jdXJzb3IpCisgICAgICAob3ZlcmxheS1wdXQgb3ZlcmxheSAncHJp b3JpdHkgMTAwKQorICAgICAgKG1jL3N0b3JlLWN1cnJlbnQtc3RhdGUtaW4tb3ZlcmxheSBvdmVy bGF5KQorICAgICAgKHdoZW4gKHVzZS1yZWdpb24tcCkKKyAgICAgICAgKG92ZXJsYXktcHV0IG92 ZXJsYXkgJ3JlZ2lvbi1vdmVybGF5CisgICAgICAgICAgICA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IGJ5IGBlcScuCisgICAgICAgICAgICAgICAgKHNldHEgb3JpZ2luYWwtY29t bWFuZCAoaW50ZXJuIChzeW1ib2wtbmFtZSBvcmlnaW5hbC1jb21tYW5kKSkpCisgICAgICAgICAg ICAgICAgOzsgb3RoZXJ3aXNlIGl0J3MgYSBzeW1ib2wsIGFuZCB3ZSBjYW4gYmUgbW9yZSB0aG9y b3VnaAorICAgICAgICAgICAgICAgIChpZiAoZ2V0IG9yaWdpbmFsLWNvbW1hbmQgJ21jLS11bnN1 cHBvcnRlZCkKKyAgICAgICAgICAgICAgICAgICAgKG1lc3NhZ2UgIiVTIGlzIG5vdCBzdXBwb3J0 ZWQgd2l0aCBtdWx0aXBsZSBjdXJzb3JzJXMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg IG9yaWdpbmFsLWNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdldCBvcmln aW5hbC1jb21tYW5kICdtYy0tdW5zdXBwb3J0ZWQpKQorICAgICAgICAgICAgICAgICAgKHdoZW4g KGFuZCBvcmlnaW5hbC1jb21tYW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChub3Qg KG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy0tZGVmYXVsdC1jbWRzLXRvLXJ1bi1vbmNlKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKG5vdCAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1j L2NtZHMtdG8tcnVuLW9uY2UpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAob3IgbWMv YWx3YXlzLXJ1bi1mb3ItYWxsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVt cSBvcmlnaW5hbC1jb21tYW5kIG1jLS1kZWZhdWx0LWNtZHMtdG8tcnVuLWZvci1hbGwpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jL2Nt ZHMtdG8tcnVuLWZvci1hbGwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWMv cHJvbXB0LWZvci1pbmNsdXNpb24taW4td2hpdGVsaXN0IG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAg ICAgICAgICAgICAgICAgICAgKG1jL2V4ZWN1dGUtY29tbWFuZC1mb3ItYWxsLWZha2UtY3Vyc29y cyBvcmlnaW5hbC1jb21tYW5kKSkpKQorICAgICAgICAgICAgICAod2hlbiBtYy91c2UtYnVpbHQt aW4tY3Vyc29ycworICAgICAgICAgICAgICAgIChzZXRxIG1jLWNvbmYKKyAgICAgICAgICAgICAg ICAgICAgICAgIChtYXBjYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKGxhbWJkYSAoeCkg KGxpc3QgKG92ZXJsYXktc3RhcnQgeCkgImJhciIgbmlsKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgKG1jL2FsbC1mYWtlLWN1cnNvcnMpKSkpKSkpKSkpCisKKyAgKGRlZnVuIG1jL21hcmst bmV4dC1saWtlLXRoaXMtY3ljbGUtZm9yd2FyZCAoKQorICAiTWFya3MgbmV4dCBvY2N1cmVuY2Ug b2Ygd29yZCBsaWtlIHRoaXMgYW5kIGFkdmFuY2VzIGN1cnNvciB0byB0aGlzIG9jY3VycmVuY2Ui CisgIChpbnRlcmFjdGl2ZSkKKyAgICAobWMvbWFyay1uZXh0LWxpa2UtdGhpcyAxKSkKKworICAo ZGVmdW4gbWMvbWFyay1wcmV2aW91cy1saWtlLXRoaXMtY3ljbGUtZm9yd2FyZCAoKQorICAiTWFy a3MgbmV4dCBvY2N1cnJlbmNlIG9mIHdvcmQgbGlrZSB0aGlzIGFuZCBhZHZhbmNlcyBjdXJzb3Ig dG8gdGhpcyBvY2N1cnJlbmNlIgorICAoaW50ZXJhY3RpdmUpCisgICAgKG1jL21hcmstcHJldmlv dXMtbGlrZS10aGlzIDEpKQorCisgIChhZGQtdG8tbGlzdCAnbWMtLWRlZmF1bHQtY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Mgd2VsbCB3aXRoIExTTC4g IGB3MzJ0ZXJtLmMnIHVzZXMKK2BQQUxFVFRFUkdCJyBvciBgUkdCJywgYW5kIHRoZSBjb252ZXJz aW9uIGZyb20gTFNMIGlzIGRvbmUgaW50ZXJuYWxseSBieQorbXVsdGlwbHlpbmcgZWFjaCBlbGVt ZW50IG9mIHRoZSBMU0wgY29sb3IgdmVjdG9yIGJ5IDI1NS4gIGB4dGVybS5jJyB1c2VzCitgeF9t YWtlX3RydWVjb2xvcl9waXhlbCcsIHdoaWNoIHVzZXMgMTYtYml0IFJHQiAtLSB0aGUgY29udmVy c2lvbiBmcm9tIExTTAoraGFwcGVucyBpbnRlcm5hbGx5IGJ5IG11bHRpcGx5aW5nIGVhY2ggZWxl bWVudCBvZiB0aGUgTFNMIGNvbG9yIHZlY3RvciBieSA2NTUzNS4iCisoaW50ZXJhY3RpdmUpCisg IChsZXQgKChidWZmZXIgKGdldC1idWZmZXItY3JlYXRlICIqTUMtVEVTVCoiKSkpCisgICAgKHdp dGgtY3VycmVudC1idWZmZXIgYnVmZmVyCisgICAgICAoZXJhc2UtYnVmZmVyKQorICAgICAgKGlu c2VydCAiVGhpcyBpcyBhIHRlc3QhIikKKyAgICAgIChzZXRxIG1jLWNvbmYgJygoMSAiaGJhciIg Im1hZ2VudGEiKQorICAgICAgICAgICAgICAgICAgICAgICgyICJiYXIiICJwdXJwbGUiKQorICAg ICAgICAgICAgICAgICAgICAgICgzICJib3giICIjMDBGRjAwIikKKyAgICAgICAgICAgICAgICAg ICAgICAoNCAiaG9sbG93IiAiIzAwMDBGRiIpCisgICAgICAgICAgICAgICAgICAgICAgKDUgKCJo YmFyIiAzKSBbMS4wIDAuMCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg2ICgiYmFyIiAz KSBbMC4wIDEuMCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg3ICJmcmFtZWQiICJPcmFu Z2VSZWQiKQorICAgICAgICAgICAgICAgICAgICAgICg4ICJib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Wxpc3QgKGRlbHEgKy10aW1lci12YXIgdGltZXItaWRsZS1saXN0KSkKKyAg ICAgIChzZXRxICstdGltZXItdmFyIG5pbCkpCisgICAgKHVubGVzcyAob3IgKG1lbXEgdGhpcy1j b21tYW5kICstcGFyZW5zLWV4Y2x1c2lvbnMpCisgICAgICAgICAgICAgICAgKGFuZCAobnVsbCAr LXBhcmVucy1wKQorICAgICAgICAgICAgICAgICAgICAgKG51bGwgKy1wYXJlbnMtb3ZlcmxheXMt ZXhpc3QtcCkpKQorICAgICAgKCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykpCisgICAgKGlmIGZv cmNlCisgICAgICAocHJvZ24KKyAgICAgICAgKHdoZW4gKy1wYXJlbnMtcAorICAgICAgICAgICgr LXBhcmVucy1mbikpKQorICAgICAgKHNldHEgKy10aW1lci12YXIgKHJ1bi13aXRoLWlkbGUtdGlt ZXIgKy1pZGxlLXRpbWVyLXNlY29uZHMgbmlsICMnKy10aW1lci1mbikpKSkpCisKKyhkZWZ2YXIg ZmMtbW9kZSkKKworOzs7IyMjYXV0b2xvYWQKKyhkZWZpbmUtbWlub3ItbW9kZSArLW1vZGUKKyJN aW5vciBtb2RlIGZvciBkaXNwbGF5aW5nIGEgaG9yaXpvbnRhbCBydWxlci4iCisgIDppbml0LXZh bHVlIG5pbAorICA6bGlnaHRlciAiICsiCisgIDprZXltYXAgbmlsCisgIDpnbG9iYWwgbmlsCisg IDpncm91cCAnKy1tb2RlCisgIChjb25kCisgICAgKCstbW9kZQorICAgICAgOzs7IGArLW1vZGUn IGhhcyB0aGUgYWJpbGl0eSB0byBhbHNvIGRpc3BsYXkgYSBmaWxsIGNvbHVtbiBpbmRpY2F0b3Iu CisgICAgICA7OzsgU2VlIHRoZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicuCisgICAgICAod2hl biBmYy1tb2RlCisgICAgICAgIChmYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgZ2xvYmFs LWVsZG9jLW1vZGUKKyAgICAgICAgICAgICAgICAgKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAgJ2Fu eSkKKyAgICAgICAgICAgICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAg ICAgICAgKGdsb2JhbC1lbGRvYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgaml0LWxvY2st Y29udGV4dC10aW1lcgorICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAn YW55KQorICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQor ICAgICAgICAod2hlbiAodGltZXJwIGppdC1sb2NrLWNvbnRleHQtdGltZXIpCisgICAgICAgICAg KGNhbmNlbC10aW1lciBqaXQtbG9jay1jb250ZXh0LXRpbWVyKSkKKyAgICAgICAgOzsgKHNldHEg aml0LWxvY2stY29udGV4dC10aW1lciAocnVuLXdpdGgtaWRsZS10aW1lciA1LjAgJ3JlcGVhdCAn aml0LWxvY2stY29udGV4dC1mb250aWZ5KSkKKyAgICAgICAgKHNldHEgaml0LWxvY2stY29udGV4 dC10aW1lciBuaWwpKQorICAgICAgKHdoZW4gKGFuZCAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAn YW55KQorICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQor ICAgICAgICAod2hlbiAodGltZXJwIHVuZG8tYXV0by1jdXJyZW50LWJvdW5kYXJ5LXRpbWVyKQor ICAgICAgICAgIChjYW5jZWwtdGltZXIgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIp KQorICAgICAgICAoZnNldCAndW5kby1hdXRvLS11bmRvYWJsZS1jaGFuZ2UKKyAgICAgICAgICAg ICAgKGxhbWJkYSAoKSAoYWRkLXRvLWxpc3QgJ3VuZG8tYXV0by0tdW5kb2FibHktY2hhbmdlZC1i dWZmZXJzIChjdXJyZW50LWJ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vcmRlcmluZycgaXMgc2V0 IHRvIGEgbmlsIHZhbHVlLgorICAgICAgOzs7IEhvd2V2ZXIsIG1vc3QgdXNlcnMgd2lsbCBwcm9i YWJseSBub3Qgd2FudCB0aGlzIHBhcnRpY3VsYXIgc2V0dGluZy4KKyAgICAgICh1bmxlc3MgKG51 bGwgYmlkaS1kaXNwbGF5LXJlb3JkZXJpbmcpCisgICAgICAgIChzZXRxIGJpZGktZGlzcGxheS1y ZW9yZGVyaW5nIG5pbCkpCisgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICcrLS1zYXZl ZC1zdGF0ZSkgbmlsKQorICAgICAgKGRvbGlzdCAodmFyICcoYnVmZmVyLWRpc3BsYXktdGFibGUK KyAgICAgICAgICAgICAgICAgICAgIGZyaW5nZS1pbmRpY2F0b3ItYWxpc3QKKyAgICAgICAgICAg ICAgICAgICAgIHRhYi13aWR0aAorICAgICAgICAgICAgICAgICAgICAgbGluZS1tb3ZlLXZpc3Vh bAorICAgICAgICAgICAgICAgICAgICAgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgICAgICAgICAg ICAgIHRydW5jYXRlLXBhcnRpYWwtd2lkdGgtd2luZG93cworICAgICAgICAgICAgICAgICAgICAg d29yZC13cmFwKSkKKyAgICAgICAgKHdoZW4gKGxvY2FsLXZhcmlhYmxlLXAgdmFyKQorICAgICAg ICAgIChwdXNoIChjb25zIHZhciAoc3ltYm9sLXZhbHVlIHZhcikpICstLXNhdmVkLXN0YXRlKSkp CisgICAgICAoc2V0cSBmaWxsLWNvbHVtbiA4MCkKKyAgICAgIChzZXRxIGRpc3BsYXktbGluZS1u dW1iZXJzIHQpCisgICAgICAoc2V0cS1sb2NhbCBhdXRvLWhzY3JvbGwtbW9kZSAnY3VycmVudC1s aW5lKQorICAgICAgKHNldHEtbG9jYWwgaHNjcm9sbC1zdGVwIDUpCisgICAgICAoc2V0cSBidWZm ZXItZGlzcGxheS10YWJsZSArLWJ1ZmZlci1kaXNwbGF5LXRhYmxlKQorICAgICAgKHNldHEgdGFi LXdpZHRoIDQpCisgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICdsaW5lLW1vdmUtdmlz dWFsKSB0KQorICAgICAgKHNldHEgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgKGNvbmQKKyAgICAg ICAgICAoKGxldCAoKGxzdCArLXRydW5jYXRlLWxpbmVzLWRlcml2ZWQtbW9kZXMpCisgICAgICAg ICAgICAgICAgICBtb2RlKQorICAgICAgICAgICAgKGNhdGNoICdmb3VuZAorICAgICAgICAgICAg ICAod2hpbGUgKHNldHEgbW9kZSAocG9wIGxzdCkpCisgICAgICAgICAgICAgICAgKHdoZW4gKGRl cml2ZWQtbW9kZS1wIG1vZGUpCisgICAgICAgICAgICAgICAgICAodGhyb3cgJ2ZvdW5kIHQpKSkp KSkKKyAgICAgICAgICAgKChtZW1xIG1ham9yLW1vZGUgKy10cnVuY2F0ZS1saW5lcy1tYWpvci1t b2RlcykpCisgICAgICAgICAgICh0CisgICAgICAgICAgICAgbmlsKSkpCisgICAgICAoc2V0ICht YWtlLWxvY2FsLXZhcmlhYmxlICd0cnVuY2F0ZS1wYXJ0aWFsLXdpZHRoLXdpbmRvd3MpIG5pbCkK KyAgICAgIChzZXRxIHdvcmQtd3JhcCB0KQorICAgICAgKHNldHEgaW5kaWNhdGUtZW1wdHktbGlu ZXMgdCkKKyAgICAgIChzZXRxIGluZGljYXRlLWJ1ZmZlci1ib3VuZGFyaWVzICdsZWZ0KQorICAg ICAgKHNldHEgZnJpbmdlLWluZGljYXRvci1hbGlzdAorICAgICAgICAgIDs7OyBoc2NsX2FsbF90 ZW1wX3AgfCBoc2NsX3RlbXBfcAorICAgICAgICAnKCgrLWhzY2wtdGVtcCAuICgrLXNpbmdsZS1h bmdsZS1sZWZ0CisgICAgICAgICAgICAgICAgICAgICAgICAgICstZG91YmxlLWFuZ2xlLWxlZnQp KQorICAgICAgICAgIDs7OyBoc2NsX2FsbF9wZXJtXzBfcCB8IGhzY2xfYWxsX3Blcm1fMV9wIHwg aHNjbF9hbGxfcGVybV8yX3AgfCBoc2NsX3Blcm1fcAorICAgICAgICAgICgrLWhzY2wtcGVybSAu ICgrLXNpbmdsZS1hbmdsZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLWRvdWJsZS1h bmdsZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLXRyaXBsZS1hbmdsZS11cAorICAg ICAgICAgICAgICAgICAgICAgICAgICArLXF1YWRydXBsZS1hbmdsZS11cCkpCisgICAgICAgICAg KCstb3ZlcmxheS1hcnJvdyAuICgrLWZyaW5nZS1sZWZ0LWFycm93CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICArLWZyaW5nZS1yaWdodC1hcnJvdykpCisgICAgICAgICAgKHRydW5jYXRp b24gLiAoKy1mcmluZ2UtbGVmdC1hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICstZnJp bmdlLXJpZ2h0LWFycm93KSkKKyAgICAgICAgICAoY29udGludWF0aW9uIC4gKCstZnJpbmdlLWxl ZnQtY3VybHktYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICstYmFja3NsYXNoKSkK KyAgICAgICAgICAob3ZlcmxheS1hcnJvdyAuICstZnJpbmdlLXJpZ2h0LXRyaWFuZ2xlKQorICAg ICAgICAgICh1cCAuICstZnJpbmdlLXVwLWFycm93KQorICAgICAgICAgIChkb3duIC4gKy1mcmlu Z2UtZG93bi1hcnJvdykKKyAgICAgICAgICAodG9wIC4gKy1mcmluZ2UtdG9wLWxlZnQtYW5nbGUp CisgICAgICAgICAgKGJvdHRvbSAuICstZnJpbmdlLWJvdHRvbS1yaWdodC1hbmdsZSkKKyAgICAg ICAgICAodG9wLWJvdHRvbSAuICgrLWZyaW5nZS1sZWZ0LWJyYWNrZXQKKyAgICAgICAgICAgICAg ICAgICAgICAgICArLWZyaW5nZS1yaWdodC1icmFja2V0CisgICAgICAgICAgICAgICAgICAgICAg ICAgKy1mcmluZ2UtdG9wLXJpZ2h0LWFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgKy1m cmluZ2UtdG9wLWxlZnQtYW5nbGUpKQorICAgICAgICAgIChlbXB0eS1saW5lIC4gKy1mcmluZ2Ut ZW1wdHktbGluZSkKKyAgICAgICAgICAodW5rbm93biAuICstZnJpbmdlLXF1ZXN0aW9uLW1hcmsp KSkKKyAgICAgIChzZXRxIGZyaW5nZS1jdXJzb3ItYWxpc3QgJygoYm94IC4gKy1mcmluZ2UtbGVm dC10cmlhbmdsZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaG9sbG93IC4g Ky1ob2xsb3ctcmVjdGFuZ2xlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChi YXIgLiArLXZlcnRpY2FsLWJhcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo aGJhciAuICstZnJpbmdlLWhvcml6b250YWwtYmFyKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIChob2xsb3ctc21hbGwgLiArLWZyaW5nZS1ob2xsb3ctc3F1YXJlKSkpCisgICAg ICAoaWYgKG9yICstZm9ydGh3aXRoCisgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZp eC1hcmcgJyg0KSkpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJh dy1mb3J0aHdpdGggJ2FwcGVuZCAnbG9jYWwpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21t YW5kLWhvb2sgJystZHJhdy1jcm9zc2hhaXJzICdhcHBlbmQgJ2xvY2FsKSkKKyAgICAgICh3aGVu ICstZm9ydGh3aXRoCisgICAgICAgIChhZGQtaG9vayAnd2luZG93LWNvbmZpZ3VyYXRpb24tY2hh bmdlLWhvb2sgJystZHJhdy1mb3J0aHdpdGggbmlsICdsb2NhbCkpCisgICAgICAoYWRkLWhvb2sg J2NoYW5nZS1tYWpvci1tb2RlLWhvb2sgJ3R1cm4tb2ZmLSstbW9kZSBuaWwgJ2xvY2FsKQorICAg ICAgOzs7IE1hdGNoaW5nIHBhcmVudGhlc2VzIGRyYXdpbmcgZm9ydGh3aXRoIGludGVyZmVyZXMg d2l0aCB5YXNuaXBwZXQuCisgICAgICAod2hlbiArLWZvcnRod2l0aAorICAgICAgICAoc2V0cSAr LXBhcmVucy1wIG5pbCkpCisgICAgICAod2hlbiAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55 KQorICAgICAgICAoY29uZAorICAgICAgICAgICgrLWZvcnRod2l0aAorICAgICAgICAgICAgKG1l c3NhZ2UgIlR1cm5lZCBPTiBgKy1tb2RlJyAtLSBEcmF3IG1hdGNoaW5nIHBhcmVudGhlc2VzIGlt bWVkaWF0ZWx5LiIpKQorICAgICAgICAgICgoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkp CisgICAgICAgICAgICA7OzsgTWF0Y2hpbmcgcGFyZW50aGVzZXMgd2lsbCBiZSBkcmF3biBpbW1l ZGlhdGVseS4KKyAgICAgICAgICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScgLS0gT3B0 aW1pemVkIGZvciBkZWJ1Z2dpbmcgcHVycG9zZXMuIikpCisgICAgICAgICAgKHQKKyAgICAgICAg ICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScuIikpKSkpCisgICAgKHQKKyAgICAgIChr aWxsLWxvY2FsLXZhcmlhYmxlICdmaWxsLWNvbHVtbikKKyAgICAgIChraWxsLWxvY2FsLXZhcmlh YmxlICdhdXRvLWhzY3JvbGwtbW9kZSkKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdoc2Ny b2xsLXN0ZXApCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnY3Jvc3NoYWlycykKKyAgICAg IChraWxsLWxvY2FsLXZhcmlhYmxlICdmYy12aXNpYmxlKQorICAgICAgKGtpbGwtbG9jYW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s7Ozs7Ozs7 Ozs7CisKKyhkZWZ1biArLXBhcmVucy1mbiAoKQorICAiRG9jLXN0cmluZy4iCisgIChsZXQqICgo b3BvaW50IChwb2ludCkpCisgICAgICAgICAoZnJvbSAoaWYgKy1wYXJlbnMtZnJvbS1mbgorICAg ICAgICAgICAgICAgICAoZnVuY2FsbCArLXBhcmVucy1mcm9tLWZuKQorICAgICAgICAgICAgICAg ICAocG9pbnQtbWluKSkpCisgICAgICAgICAod2luIChzZWxlY3RlZC13aW5kb3cpKQorICAgICAg ICAgKGkgMCkKKyAgICAgICAgIChwcmVjZWRpbmctY2hhciAocHJlY2VkaW5nLWNoYXIpKQorICAg ICAgICAgKG9jaGFyIChjaGFyLWFmdGVyIG9wb2ludCkpCisgICAgICAgICAocG9zMQorICAgICAg ICAgICAoY29uZAorICAgICAgICAgICAgICgoYW5kIG9jaGFyCisgICAgICAgICAgICAgICAgICAg KG9yIDs7OyAoY2hhci10by1zdHJpbmcgNDApID0+IG9wZW5pbmcgcGFyZW50aGVzaXMKKyAgICAg ICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgNDApCisgICAgICAgICAgICAgICAgICAgICAgIDs7 OyAoY2hhci10by1zdHJpbmcgOTEpID0+IG9wZW5pbmcgc3F1YXJlIGJyYWNrZXQKKyAgICAgICAg ICAgICAgICAgICAgICAgKD0gb2NoYXIgOTEpCisgICAgICAgICAgICAgICAgICAgICAgIDs7OyAo Y2hhci10by1zdHJpbmcgMTIzKSA9PiBvcGVuaW5nIHdhdnkgYnJhY2tldAorICAgICAgICAgICAg ICAgICAgICAgICAoPSBvY2hhciAxMjMpKSkKKyAgICAgICAgICAgICAgICAobWluICgxKyBvcG9p bnQpIChwb2ludC1tYXgpKSkKKyAgICAgICAgICAgICAoKG9yIDs7OyAoY2hhci10by1zdHJpbmcg NDEpID0+IGNsb3NpbmcgcGFyZW50aGVzaXMKKyAgICAgICAgICAgICAgICAgICg9IHByZWNlZGlu Zy1jaGFyIDQxKQorICAgICAgICAgICAgICAgICAgOzs7IChjaGFyLXRvLXN0cmluZyA5MykgPT4g Y2xvc2luZyBzcXVhcmUgYnJhY2tldAorICAgICAgICAgICAgICAgICAgKD0gcHJlY2VkaW5nLWNo YXIgOTMpCisgICAgICAgICAgICAgICAgICA7OzsgKGNoYXItdG8tc3RyaW5nIDEyNSkgPT4gY2xv c2luZyB3YXZ5IGJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICg9IHByZWNlZGluZy1jaGFyIDEy NSkpCisgICAgICAgICAgICAgICAgKG1heCAocG9pbnQtbWluKSAoMS0gb3BvaW50KSkpCisgICAg ICAgICAgICAgKHQKKyAgICAgICAgICAgICAgICBvcG9pbnQpKSkKKyAgICAgICAgIHBvczIKKyAg ICAgICAgIHNlbGVjdGVkLWZhY2UpCisgICAgKHNhdmUtZXhjdXJzaW9uCisgICAgICAoY29uZGl0 aW9uLWNhc2UgbmlsCisgICAgICAgICh3aGlsZSAoc2V0cSBwb3MxIChudGggMSAocGFyc2UtcGFy dGlhbC1zZXhwIGZyb20gcG9zMSkpKQorICAgICAgICAgIChzZXRxIHBvczIgKHNjYW4tc2V4cHMg cG9zMSAxKSkKKyAgICAgICAgICAoaWYgKD0gaSAxMCkKKyAgICAgICAgICAgIChzZXRxIGkgMSkK KyAgICAgICAgICAgIChzZXRxIGkgKDErIGkpKSkKKyAgICAgICAgICAoc2V0cSBzZWxlY3RlZC1m YWNlIChjb25kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDEpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLW9uZS1mYWNlKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSAyKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICcrLXBhcmVucy10d28tZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKCg9IGkgMykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1w YXJlbnMtdGhyZWUtZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkg NCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtZm91ci1mYWNl KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA1KQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1maXZlLWZhY2UpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICgoPSBpIDYpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJystcGFyZW5zLXNpeC1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAoKD0gaSA3KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1z ZXZlbi1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA4KQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1laWdodC1mYWNlKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA5KQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICcrLXBhcmVucy1uaW5lLWZhY2UpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICgoPSBpIDEwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICcrLXBhcmVucy10ZW4tZmFjZSkpKQorICAgICAgICAgIChsZXQgKChvdiAobWFrZS1vdmVybGF5 IHBvczEgKDErIHBvczEpKSkpCisgICAgICAgICAgICAodW5sZXNzICstcGFyZW5zLWluYWN0aXZl LXdpbmRvd3MKKyAgICAgICAgICAgICAgKG92ZXJsYXktcHV0IG92ICd3aW5kb3cgd2luKSkKKyAg ICAgICAgICAgIChvdmVybGF5LXB1dCBvdiAnZmFjZSBzZWxlY3RlZC1mYWNlKSkKKyAgICAgICAg ICAod2hlbiBwb3MyCisgICAgICAgICAgICAobGV0ICgob3YgKG1ha2Utb3ZlcmxheSAoMS0gcG9z MikgcG9zMikpKQorICAgICAgICAgICAgICAodW5sZXNzICstcGFyZW5zLWluYWN0aXZlLXdpbmRv d3MKKyAgICAgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ3dpbmRvdyB3aW4pKQorICAgICAg ICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ2ZhY2Ugc2VsZWN0ZWQtZmFjZSkpKSkKKyAgICAgICAg KGVycm9yIG5pbCkpKQorICAgIChzZXRxICstcGFyZW5zLW92ZXJsYXlzLWV4aXN0LXAgdCkpKQor CisoZGVmdW4gKy1yZW1vdmUtb3ZlcmxheXMgKGJlZyBlbmQgbmFtZSB2YWwpCisiUmVtb3ZlIHRo ZSBvdmVybGF5cyB0aGF0IGFyZSBgZXF1YWwtaW5jbHVkaW5nLXByb3BlcnRpZXNgLgorSW5jbHVk ZXMgYSB1bmlxdWUgc2l0dWF0aW9uIHdoZW4gYW4gb3ZlcmxheSB3aXRoIGFuIGAnYWZ0ZXItc3Ry aW5nYCBwcm9wZXJ0eQoraXMgYXQgdGhlIHZlcnkgZW5kIG9mIGEgbmFycm93ZWQtYnVmZmVyLiIK KyAgKGxldCogKChwb2ludC1tYXggKHBvaW50LW1heCkpCisgICAgICAgICAocG9pbnQtbWluIChw b2ludC1taW4pKQorICAgICAgICAgKG5hcnJvd2VkLXAgKGJ1ZmZlci1uYXJyb3dlZC1wKSkKKyAg ICAgICAgIChiZWcgKGlmIGJlZyBiZWcgcG9pbnQtbWluKSkKKyAgICAgICAgIChlbmQKKyAgICAg ICAgICAgKGNvbmQKKyAgICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAobm90IG5h cnJvd2VkLXApCisgICAgICAgICAgICAgICAgIGVuZCkKKyAgICAgICAgICAgICAgIGVuZCkKKyAg ICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAobm90IG5hcnJvd2VkLXApCisgICAg ICAgICAgICAgICAgIChudWxsIGVuZCkpCisgICAgICAgICAgICAgICBwb2ludC1tYXgpCisgICAg ICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFycm93ZWQtcAorICAgICAgICAgICAg ICAgICBlbmQKKyAgICAgICAgICAgICAgICAgKDwgZW5kIHBvaW50LW1heCkpCisgICAgICAgICAg ICAgICBlbmQpCisgICAgICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFycm93ZWQt cAorICAgICAgICAgICAgICAgICBlbmQKKyAgICAgICAgICAgICAgICAgKD0gZW5kIHBvaW50LW1h eCkpCisgICAgICAgICAgICAgICAoMSsgZW5kKSkKKyAgICAgICAgICAgICAoKGFuZAorICAgICAg ICAgICAgICAgICBuYXJyb3dlZC1wCisgICAgICAgICAgICAgICAgIChudWxsIGVuZCkpCisgICAg ICAgICAgICAgICAoMSsgcG9pbnQtbWF4KSkgKSkKKyAgICAgICAgIChvdmVybGF5cworICAgICAg ICAgICAocHJvZ24KKyAgICAgICAgICAgICAob3ZlcmxheS1yZWNlbnRlciBlbmQpCisgICAgICAg ICAgICAgKG92ZXJsYXlzLWluIGJlZyBlbmQpKSkpCisgICAgKHdoZW4gKGFuZCBiZWcgZW5kIG5h bWUgdmFsKQorICAgICAgKGRvbGlzdCAobyBvdmVybGF5cykKKyAgICAgICAgKGNvbmQKKyAgICAg ICAgICAoKGFuZCAoZXEgbmFtZSAnZmFjZSkKKyAgICAgICAgICAgICAgICAoZXEgKG92ZXJsYXkt Z2V0IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIDs7IEVpdGhlciBwdXNoIHRoaXMgb3Zlcmxh eSBvdXRzaWRlIGJlZy4uLmVuZAorICAgICAgICAgICAgOzsgb3Igc3BsaXQgaXQgdG8gZXhjbHVk ZSBiZWcuLi5lbmQKKyAgICAgICAgICAgIDs7IG9yIGRlbGV0ZSBpdCBlbnRpcmVseSAoaWYgaXQg aXMgY29udGFpbmVkIGluIGJlZy4uLmVuZCkuCisgICAgICAgICAgICAoaWYgKDwgKG92ZXJsYXkt c3RhcnQgbykgYmVnKQorICAgICAgICAgICAgICAgIChpZiAoPiAob3ZlcmxheS1lbmQgbykgZW5k KQorICAgICAgICAgICAgICAocHJvZ24KKyAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IChj b3B5LW92ZXJsYXkgbykKKyAgICAgICAgICAgICAgICAgIChvdmVybGF5LXN0YXJ0IG8pIGJlZykK KyAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVuZCBvKSkpCisg ICAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gKG92ZXJsYXktc3RhcnQgbykgYmVnKSkK KyAgICAgICAgICAgICAgKGlmICg+IChvdmVybGF5LWVuZCBvKSBlbmQpCisgICAgICAgICAgICAg ICAgICAobW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVuZCBvKSkKKyAgICAgICAgICAgICAg ICAoZGVsZXRlLW92ZXJsYXkgbykpKSkKKyAgICAgICAgICAoKGFuZCAobm90IChlcSBuYW1lICdm YWNlKSkKKyAgICAgICAgICAgICAgICAoZXF1YWwtaW5jbHVkaW5nLXByb3BlcnRpZXMgKG92ZXJs YXktZ2V0IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIChkZWxldGUtb3ZlcmxheSBvKSkpKSkp KQorCisoZGVmdW4gKy1kZWxldGUtcGFyZW5zLW92ZXJsYXlzICgpCisgICh3aGVuICstcGFyZW5z LW92ZXJsYXlzLWV4aXN0LXAKKyAgICAoZG9saXN0IChmYWNlICcoKy1wYXJlbnMtb25lLWZhY2UK KyAgICAgICAgICAgICAgICAgICAgKy1wYXJlbnMtdHdvLWZhY2UKKyAgICAgICAgICAgICAgICAg ICAgKy1wYXJlbnMtdGhyZWUtZmFjZQorICAgICAgICAgICAgICAgICAgICArLXBhcmVucy1mb3Vy LWZhY2UKKyAgICAgICAgICAgICAgICAgICAgKy1wYXJ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bmlsCisgIDpncm91 cCAnZmMtbW9kZQorICAoY29uZAorICAgIDs7OyBgKy1tb2RlJyBoYXMgdGhlIGFiaWxpdHkgdG8g YWxzbyBkaXNwbGF5IGEgZmlsbCBjb2x1bW4gaW5kaWNhdG9yLgorICAgIDs7OyBTZWUgdGhlIHZh cmlhYmxlIGArLWZpbGwtY29sdW1uJy4KKyAgICAoKGFuZCBmYy1tb2RlICstbW9kZSkKKyAgICAg IChzZXRxIGZjLW1vZGUgbmlsKQorICAgICAgKG1lc3NhZ2UgIlR1cm5lZCBPRkYgYGZjLW1vZGUn ICglcykgLS0gc2VlIHRoZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicuIiAoY3VycmVudC1idWZm ZXIpKSkKKyAgICAoZmMtbW9kZQorICAgICAgKHdoZW4gKGFuZCBnbG9iYWwtZWxkb2MtbW9kZQor ICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAg ICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAoZ2xvYmFs LWVsZG9jLW1vZGUgLTEpKQorICAgICAgKHdoZW4gKGFuZCBqaXQtbG9jay1jb250ZXh0LXRpbWVy CisgICAgICAgICAgICAgICAgIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAg ICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVu ICh0aW1lcnAgaml0LWxvY2stY29udGV4dC10aW1lcikKKyAgICAgICAgICAoY2FuY2VsLXRpbWVy IGppdC1sb2NrLWNvbnRleHQtdGltZXIpKQorICAgICAgICA7OyAoc2V0cSBqaXQtbG9jay1jb250 ZXh0LXRpbWVyIChydW4td2l0aC1pZGxlLXRpbWVyIDUuMCAncmVwZWF0ICdqaXQtbG9jay1jb250 ZXh0LWZvbnRpZnkpKQorICAgICAgICAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIG5pbCkp CisgICAgICAod2hlbiAoYW5kIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAg ICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVu ICh0aW1lcnAgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpCisgICAgICAgICAgKGNh bmNlbC10aW1lciB1bmRvLWF1dG8tY3VycmVudC1ib3VuZGFyeS10aW1lcikpCisgICAgICAgIChm c2V0ICd1bmRvLWF1dG8tLXVuZG9hYmxlLWNoYW5nZQorICAgICAgICAgICAgICAobGFtYmRhICgp IChhZGQtdG8tbGlzdCAndW5kby1hdXRvLS11bmRvYWJseS1jaGFuZ2VkLWJ1ZmZlcnMgKGN1cnJl bnQtYnVmZmVyKSkpKQorICAgICAgICAoZnNldCAndW5kby1hdXRvLWFtYWxnYW1hdGUgJ2lnbm9y ZSkpCisgICAgICAod2hlbiBibGluay1jdXJzb3ItbW9kZQorICAgICAgICAoYmxpbmstY3Vyc29y LW1vZGUgLTEpCisgICAgICAgICh3aGVuIChtZW1xICdibGluay1jdXJzb3ItY2hlY2sgcG9zdC1j b21tYW5kLWhvb2spCisgICAgICAgICAgKHJlbW92ZS1ob29rICdwb3N0LWNvbW1hbmQtaG9vayAn YmxpbmstY3Vyc29yLWNoZWNrKSkpCisgICAgICAoc2V0cSBmYy12aXNpYmxlIHQpCisgICAgICA7 OzsgYGF1dG8tY29tcG9zaXRpb24tbW9kZScgaXMgbmVlZGVkIGZvciBjcm9zc2hhaXJzIHRvIHBy b3Blcmx5IGNhbGN1bGF0ZQorICAgICAgOzs7IGNvb3JkaW5hdGVzIG9mIGNvbXBvc2l0aW9uIGNo YXJhY3RlcnMuICBBdXRvbWF0aWNhbGx5IGJlY29tZXMgcGVybWFuZW50bHkKKyAgICAgIDs7OyBi dWZmZXItbG9jYWwgd2hlbiBzZXQuCisgICA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gZm9yIGArLXJldmVyc2VkLWJhci1hdC16di1mYWNlJy4iCisgIDpncm91cCAnKy1t b2RlKQorCisoZGVmZmFjZSArLXJldmVyc2VkLWJhci1wb3N0LXp2LWZhY2UKKyAgJygodCAoOmZv cmVncm91bmQgImN5YW40IikpKQorICAiRmFjZSBmb3IgYCstcmV2ZXJzZWQtYmFyLXBvc3QtenYt ZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1ldmVuLXByZS16di1mYWNl CisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBkYXJrKSkK KyAgICAgOmZvcmVncm91bmQgInllbGxvdyIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29s b3JzIDg4KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJjeWFuMSIpCisg ICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDE2KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAg ICAgOmZvcmVncm91bmQgInllbGxvdyIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3Jz IDE2KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJjeWFuMSIpCisgICAg KCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDgpKQorICAgICA6Zm9yZWdyb3VuZCAid2hpdGUi KQorICAgICgoKHR5cGUgdHR5KSAoY2xhc3MgbW9ubykpCisgICAgIDppbnZlcnNlLXZpZGVvIHQp CisgICAgKHQgOmZvcmVncm91bmQgInBpbmsiKSkKKyAgIkZhY2UgZm9yIGArLWV2ZW4tcHJlLXp2 LWZhY2UnLiIKKyAgOmdyb3VwICcrLW1vZGUpCisKKyhkZWZmYWNlICstZXZlbi1pbmFjdGl2ZS1w cmUtenYtZmFjZQorICAnKCgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91 bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICIjZWVlOGFhIikKKyAgICAoKChjbGFzcyBjb2xv cikgKG1pbi1jb2xvcnMgODgpIChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQg ImJsdWUxIikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgMTYpIChiYWNrZ3JvdW5k IGRhcmspKQorICAgICA6Zm9yZWdyb3VuZCAiI2VlZThhYSIpCisgICAgKCgoY2xhc3MgY29sb3Ip IChtaW4tY29sb3JzIDE2KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJi bHVlMSIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDgpKQorICAgICA6Zm9yZWdy b3VuZCAid2hpdGUiKQorICAgICgoKHR5cGUgdHR5KSAoY2xhc3MgbW9ubykpCisgICAgIDppbnZl cnNlLXZpZGVvIHQpCisgICAgKHQgOmZvcmVncm91bmQgInBpbmsiKSkKKyAgIkZhY2UgZm9yIGAr LWV2ZW4taW5hY3RpdmUtcHJlLXp2LWZhY2UnLiIKKyAgOmdyb3VwICcrLW1vZGUpCisKKyhkZWZm YWNlICstZXZlbi1hdC16di1mYWNlCisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4 KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgIkRlZXBQaW5rMSIpCisgICAg KCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAg IDpmb3JlZ3JvdW5kICJEZWVwUGluazEiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9y cyAxNikgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJEZWVwUGluazEiKQor ICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9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QtenYtZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1ldmVuLXBv c3QtenYtZmFjZQorICAnKCgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91 bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJEYXJrT2xpdmVHcmVlbjMiKQorICAgICgoKGNs YXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9y ZWdyb3VuZCAiY3lhbjQiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJh Y2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJEYXJrT2xpdmVHcmVlbjMiKQorICAg ICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQpKQorICAg ICA6Zm9yZWdyb3VuZCAiY3lhbjQiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4 KSkKKyAgICAgOmZvcmVncm91bmQgIndoaXRlIikKKyAgICAoKCh0eXBlIHR0eSkgKGNsYXNzIG1v bm8pKQorICAgICA6aW52ZXJzZS12aWRlbyB0KQorICAgICh0IDpmb3JlZ3JvdW5kICJwaW5rIikp CisgICJGYWNlIGZvciBgKy1ldmVuLXBvc3QtenYtZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkK KworKGRlZmZhY2UgKy1ldmVuLWluYWN0aXZlLXBvc3QtenYtZmFjZQorICAnKCgoKGNsYXNzIGNv bG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5k ICJEYXJrT2xpdmVHcmVlbjQiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkg KGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3VuZCAiUm95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b3Vw ICcrLW1vZGUpCisKKyhkZWZmYWNlICstb2RkLWluYWN0aXZlLXBvc3QtenYtZmFjZQorICAnKCgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpm b3JlZ3JvdW5kICJzaWVubmE0IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgODgp IChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTQiKQorICAgICgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpm b3JlZ3JvdW5kICJzaWVubmE0IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgMTYp IChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTQiKQorICAgICgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4KSkKKyAgICAgOmZvcmVncm91bmQgIndoaXRlIikK KyAgICAoKCh0eXBlIHR0eSkgKGNsYXNzIG1vbm8pKQorICAgICA6aW52ZXJzZS12aWRlbyB0KQor ICAgICh0IDpmb3JlZ3JvdW5kICJwaW5rIikpCisgICJGYWNlIGZvciBgKy1vZGQtaW5hY3RpdmUt cG9zdC16di1mYWNlJy4iCisgIDpncm91cCAnKy1tb2RlKQorCisoZGVmZmFjZSArLXBvc3QtZmls bC1wcmUtenYtZmFjZQorICAnKCgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tn cm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJncmVlbjEiKQorICAgICgoKGNsYXNzIGNv bG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3Vu ZCAiZ3JlZW4xIikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1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JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgIlBhbGVHcmVlbjMiKQorICAgICgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4KSkKKyAgICAgOmZvcmVncm91bmQgIndoaXRlIikK KyAgICAoKCh0eXBlIHR0eSkgKGNsYXNzIG1vbm8pKQorICAgICA6aW52ZXJzZS12aWRlbyB0KQor ICAgICh0IDpmb3JlZ3JvdW5kICJwaW5rIikpCisgICJGYWNlIGZvciBgKy1wb3N0LWZpbGwtcG9z dC16di1mYWNlJy4iCisgIDpncm91cCAnKy1tb2RlKQorCisoZGVmZmFjZSArLXBvc3QtZmlsbC1p bmFjdGl2ZS1wb3N0LXp2LWZhY2UKKyAgJygoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgODgp IChiYWNrZ3JvdW5kIGRhcmspKQorICAgICA6Zm9yZWdyb3VuZCAiUGFsZUdyZWVuNCIpCisgICAg KCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAg IDpmb3JlZ3JvdW5kICJEYXJrT2xpdmVHcmVlbiIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4t Y29sb3JzIDE2KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgIlBhbGVHcmVl bjQiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGln aHQpKQorICAgICA6Zm9yZWdyb3VuZCAiRGFya09saXZlR3JlZW4iKQorICAgICgoKGNsYXNzIGNv bG9yKSAobWluLWNvbG9ycyA4KSkKKyAgICAgOmZvcmVncm91bmQgIndoaXRlIikKKyAgICAoKCh0 eXBlIHR0eSkgKGNsYXNzIG1vbm8pKQorICAgICA6aW52ZXJzZS12aWRlbyB0KQorICAgICh0IDpm b3JlZ3JvdW5kICJwaW5rIikpCisgICJGYWNlIGZvciBgKy1wb3N0LWZ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kICJncmV5NjAiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAx NikgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJibHVlIikKKyAgICAoKChj bGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgMTYpIChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZv cmVncm91bmQgImdyZXk2MCIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDgpKQor ICAgICA6Zm9yZWdyb3VuZCAid2hpdGUiKQorICAgICgoKHR5cGUgdHR5KSAoY2xhc3MgbW9ubykp CisgICAgIDppbnZlcnNlLXZpZGVvIHQpCisgICAgKHQgOmZvcmVncm91bmQgInBpbmsiKSkKKyAg IkZhY2UgZm9yIGBmYy1pbmFjdGl2ZS1wcmUtenYtZmFjZScgaW4gdGhlIGluYWN0aXZlIHdpbmRv dy4iCisgIDpncm91cCAnKy1tb2RlKQorCisoZGVmZmFjZSBmYy1hdC16di1mYWNlCisgICcoKCgo Y2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZv cmVncm91bmQgIk9yYW5nZVJlZCIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4 KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJPcmFuZ2VSZWQiKQorICAg ICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgZGFyaykpCisgICAg IDpmb3JlZ3JvdW5kICJPcmFuZ2VSZWQiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9y cyAxNikgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3VuZCAiT3JhbmdlUmVkIikK KyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgOCkpCisgICAgIDpmb3Jl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pem9udGFsX3J1bGVyXyA9IHZhbDsKK30KKwor c3RhdGljIHZvaWQKK2JzZXRfY2hfdmVydGljYWxfcnVsZXIgKHN0cnVjdCBidWZmZXIgKmIsIExp c3BfT2JqZWN0IHZhbCkKK3sKKyAgYi0+Y2hfdmVydGljYWxfcnVsZXJfID0gdmFsOworfQorCitz dGF0aWMgdm9pZAorYnNldF9jaF9pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBM aXNwX09iamVjdCB2YWwpCit7CisgIGItPmNoX2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQor CitzdGF0aWMgdm9pZAorYnNldF9mY192aXNpYmxlIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09i amVjdCB2YWwpCit7CisgIGItPmZjX3Zpc2libGVfID0gdmFsOworfQorCitzdGF0aWMgdm9pZAor YnNldF9mY19pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2 YWwpCit7CisgIGItPmZjX2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQorCisvKiBlbmQgTVVM VElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogc3RhdGljIHZv aWQKIGJzZXRfYWJicmV2X21vZGUgKHN0cnVjdCBidWZmZXIgKmIsIExpc3BfT2JqZWN0IHZhbCkK IHsKQEAgLTUxNDIsNiArNTIwNSwyNCBAQCBpbml0X2J1ZmZlcl9vbmNlICh2b2lkKQogICBic2V0 X2xhc3Rfc2VsZWN0ZWRfd2luZG93ICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBtYWtlX2ZpeG51bSAo MCkpOwogCiAgIGlkeCA9IDE7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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KyAgYnNldF9mY192aXNpYmxlICgmYnVmZmVyX2RlZmF1bHRzLCBRbmlsKTsKKyAg YnNldF9mY19pbmFjdGl2ZV93aW5kb3dzICgmYnVmZmVyX2RlZmF1bHRzLCBRdCk7CisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICAgYnNldF9tb2RlX2xpbmVfZm9ybWF0ICgmYnVmZmVy X2RlZmF1bHRzLCBidWlsZF9wdXJlX2Nfc3RyaW5nICgiJS0iKSk7CiAgIGJzZXRfaGVhZGVyX2xp bmVfZm9ybWF0ICgmYnVmZmVyX2RlZmF1bHRzLCBRbmlsKTsKICAgYnNldF9hYmJyZXZfbW9kZSAo JmJ1ZmZlcl9kZWZhdWx0cywgUW5pbCk7CkBAIC01NDU4LDYgKzU1NTcsNTEgQEAgZGVmdmFyX3Bl cl9idWZmZXIgKHN0cnVjdCBMaXNwX0J1ZmZlcl9PYmpmd2QgKmJvX2Z3ZCwgY29uc3QgY2hhciAq bmFtZXN0cmluZywKIHZvaWQKIHN5bXNfb2ZfYnVmZmVyICh2b2lkKQogeworCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIERFRlNZTSAoUW1j X3JlYWxfZmFrZV9jdXJzb3IsICJtYy1yZWFsLWZha2UtY3Vyc29yIik7CisgIERFRlZBUl9QRVJf QlVGRkVSICgibWMtcmVhbC1mYWtlLWN1cnNvciIsICZCVkFSIChjdXJyZW50X2J1ZmZlciwgbWNf cmVhbF9mYWtlX2N1cnNvciksIFFuaWwsCisgICAgZG9jOiAvKiBBIGJ1ZmVyLWxvY2FsIHZhcmlh YmxlIHRvIHNldCB0aGUgY3Vyc29yIHR5cGUgb2YgdGhlIHJlYWwgZmFrZSBjdXJzb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jLWluYWN0aXZlLXdpbmRvdyIpOwor ICBERUZWQVJfUEVSX0JVRkZFUiAoImZjLWluYWN0aXZlLXdpbmRvd3MiLCAmQlZBUiAoY3VycmVu dF9idWZmZXIsIGZjX2luYWN0aXZlX3dpbmRvd3MpLCBRbmlsLAorICAgIGRvYzogLyogV2hlbiBu b24tbmlsLCBkcmF3IG11bHRpcGxlIGN1cnNvcnMgZmlsbCBjb2x1bW4gaW4gaW5hY3RpdmUgd2lu ZG93cy4gKi8pOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIHN0YXRpY3BybyAo Jmxhc3Rfb3ZlcmxheV9tb2RpZmljYXRpb25faG9va3MpOwogICBsYXN0X292ZXJsYXlfbW9kaWZp Y2F0aW9uX2hvb2tzID0gbWFrZV9uaWxfdmVjdG9yICgxMCk7CiAKZGlmZiAtLWdpdCBhL3NyYy9i dWZmZXIuaCBiL3NyYy9idWZmZXIuaAppbmRleCBmNDJjM2U5Li4xODlmYWM1IDEwMDY0NAotLS0g YS9zcmMvYnVmZmVyLmgKKysrIGIvc3JjL2J1ZmZlci5oCkBAIC03MzYsNiArNzM2LDQwIEBAIHN0 cnVjdCBidWZmZXIKICAgICAgaW4gdGhlIGRpc3BsYXkgb2YgdGhpcyBidWZmZXIuICAqLwogICBM aXNwX09iamVjdCBleHRyYV9saW5lX3NwYWNpbmdfOwogCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8qIFRoZSBjdXJzb3IgdHlwZSBvZiB0 aGUgcmVhbCBmYWtlIGN1cnNvci4gKi8KKyAgTGlzcF9PYmplY3QgbWNfcmVhbF9mYWtlX2N1cnNv cl87CisKKyAgLyogVGhlIG5hbWUgb2YgbGlzdCB1c2VkIGJ5IG11bHRpcGxlIGN1cnNvcnMgZm9y IG5leHQgcmVkaXNwbGF5LiAqLworICBMaXNwX09iamVjdCBtY19jb25mXzsKKworICAvKiBXaGV0 aGVyIHRvIGRyYXcgbXVsdGlwbGUgY3Vyc29ycyBpbiBpbmFjdGl2ZSB3aW5kb3dzLiAqLworICBM aXNwX09iamVjdCBtY19pbmFjdGl2ZV93aW5kb3dzXzsKKworICAvKiBUaGUgbmFtZSBvZiB0aGUg YnVmZmVyLWxvY2FsIHZhcmlhYmxlLiAqLworICBMaXNwX09iamVjdCBjcm9zc2hhaXJzXzsKKwor ICAvKiBUaGUgbmFtZSBvZiB0aGUgY3Jvc3NoYWlycyBob3Jpem9udGFsIHJ1bGVyLiAqLworICBM aXNwX09iamVjdCBjaF9ob3Jpem9udGFsX3J1bGVyXzsKKworICAvKiBUaGUgbmFtZSBvZiB0aGUg Y3Jvc3NoYWlycyB2ZXJ0aWNhbCBydWxlci4gKi8KKyAgTGlzcF9PYmplY3QgY2hfdmVydGljYWxf cnVsZXJfOworCisgIC8qIFdoZXRoZXIgdG8gZHJhdyBjcm9zc2hhaXJzIGluIGluYWN0aXZlIHdp bmRvd3MuICovCisgIExpc3BfT2JqZWN0IGNoX2luYWN0aXZlX3dpbmRvd3NfOworCisgIC8qIFRo ZSBuYW1lIG9mIHRoZSBidWZmZXItbG9jYWwgdmFyaWFibGUuICovCisgIExpc3BfT2JqZWN0IGZj X3Zpc2libGVfOworCisgIC8qIFdoZXRoZXIgdG8gZHJhdyBtdWx0aXBsZSBjdXJzb3JzIGZpbGwg Y29sdW1uIGluIGluYWN0aXZlIHdpbmRvd3MuICovCisgIExpc3BfT2JqZWN0IGZjX2luYWN0aXZl X3dpbmRvd3NfOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIEN1cnNvciB0 eXBlIHRvIGRpc3BsYXkgaW4gbm9uLXNlbGVjdGVkIHdpbmRvd3MuCiAgICAgIHQgbWVhbnMgdG8g dXNlIGhvbGxvdyBib3ggY3Vyc29yLgogICAgICBTZWUgYGN1cnNvci10eXBlJyBmb3Igb3RoZXIg dmFsdWVzLiAgKi8KQEAgLTc4NywxNCArODIxLDIxIEBAIHN0cnVjdCBidWZmZXIKICAgICAgYW4g aW5kaXJlY3QgYnVmZmVyIHNpbmNlIGl0IGNvdW50cyBhcyBpdHMgYmFzZSBidWZmZXIuICAqLwog ICBpbnQgd2luZG93X2NvdW50OwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCiAgIC8qIEEgbm9uLXplcm8gdmFsdWUgaW4gc2xvdCBJRFggbWVh bnMgdGhhdCBwZXItYnVmZmVyIHZhcmlhYmxlCiAgICAgIHdpdGggaW5kZXggSURYIGhhcyBhIGxv Y2FsIHZhbHVlIGluIHRoaXMgYnVmZmVyLiAgVGhlIGluZGV4IElEWAogICAgICBmb3IgYSBidWZm ZXItbG9jYWwgdmFyaWFibGUgaXMgc3RvcmVkIGluIHRoYXQgdmFyaWFibGUncyBzbG90CiAgICAg IGluIGJ1ZmZlcl9sb2NhbF9mbGFncyBhcyBhIExpc3AgaW50ZWdlci4gIElmIHRoZSBpbmRleCBp cyAtMSwKICAgICAgdGhpcyBtZWFucyB0aGUgdmFyaWFibGUgaXMgYWx3YXlzIGxvY2FsIGluIGFs bCBidWZmZXJzLiAgKi8KLSNkZWZpbmUgTUFYX1BFUl9CVUZGRVJfVkFSUyA1MAorI2RlZmluZSBN QVhfUEVSX0JVRkZFUl9WQVJTIDYwCiAgIGNoYXIgbG9jYWxfZmxhZ3NbTUFYX1BFUl9CVUZGRVJf VkFSU107CiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogU2V0IHRvIHRoZSBt b2R0aW1lIG9mIHRoZSB2aXNpdGVkIGZpbGUgd2hlbiByZWFkIG9yIHdyaXR0ZW4uCiAgICAgIG1v ZHRpbWUudHZfbnNlYyA9PSBOT05FWElTVEVOVF9NT0RUSU1FX05TRUNTIG1lYW5zCiAgICAgIHZp c2l0ZWQgZmlsZSB3YXMgbm9uZXhpc3RlbnQuICBtb2R0aW1lLnR2X25zZWMgPT0KQEAgLTkwMyw2 ICs5NDQsNjkgQEAgWEJVRkZFUiAoTGlzcF9PYmplY3QgYSkKIC8qIE1vc3QgY29kZSBzaG91bGQg dXNlIHRoZXNlIGZ1bmN0aW9ucyB0byBzZXQgTGlzcCBmaWVsZHMgaW4gc3RydWN0CiAgICBidWZm ZXIuICAoU29tZSBzZXR0ZXJzIHRoYXQgYXJlIHByaXZhdGUgdG8gYSBzaW5nbGUgLmMgZmlsZSBh cmUKICAgIGRlZmluZWQgYXMgc3RhdGljIGluIHRob3NlIGZpbGVzLikgICovCisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKK0lOTElO RSB2b2lkCitic2V0X2Jsdl9tY19yZWFsX2Zha2VfY3Vyc29yIChzdHJ1Y3QgYnVmZmVyICpiLCBM aXNwX09iamVjdCB2YWwpCit7CisgIGItPm1jX3JlYWxfZmFrZV9jdXJzb3JfID0gdmFsOworfQor CitJTkxJTkUgdm9pZAorYnNldF9ibHZfbWNfY29uZiAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9P YmplY3QgdmFsKQoreworICBiLT5tY19jb25mXyA9IHZhbDsKK30KKworSU5MSU5FIHZvaWQKK2Jz ZXRfYmx2X21jX2luYWN0aXZlX3dpbmRvd3MgKHN0cnVjdCBidWZmZXIgKmI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KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIElOTElO RSB2b2lkCiBic2V0X2JpZGlfcGFyYWdyYXBoX2RpcmVjdGlvbiAoc3RydWN0IGJ1ZmZlciAqYiwg TGlzcF9PYmplY3QgdmFsKQogewpkaWZmIC0tZ2l0IGEvc3JjL2Rpc3BleHRlcm4uaCBiL3NyYy9k aXNwZXh0ZXJuLmgKaW5kZXggMWE1MzY1Ni4uNGQ3NjdlYSAxMDA2NDQKLS0tIGEvc3JjL2Rpc3Bl eHRlcm4uaAorKysgYi9zcmMvZGlzcGV4dGVybi5oCkBAIC0xMDAsNiArMTAwLDEyOSBAQCB0eXBl ZGVmIGludCBDdXJzb3I7CiAjZGVmaW5lIE5hdGl2ZVJlY3RhbmdsZSBpbnQKICNlbmRpZgogCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLwor CitzdHJ1Y3QgZ2x5cGg7CisKK3N0cnVjdCBnbHlwaF9yb3c7CisKK3N0cnVjdCBnbHlwaF9tYXRy aXg7CisKK2VudW0gZHJhd19nbHlwaHNfZmFjZTsKKworZW51bSBnbHlwaF9yb3dfYXJlYTsKKwor c3RydWN0IG1jX21hdHJpeDsKKworZW51bSBtY19jYWNoZV90eXBlOworCitlbnVtIG1jX2N1cnNv cl90eXBlOworCitlbnVtIG1jX2ZsYXZvcjsKKworc3RydWN0IG1jX1JHQjsKKworc3RydWN0IG1j X2Vzc2VudGlhbHM7CisKK2VudW0gbWNfZHJhd19yb3dfdHlwZTsKKworZW51bSBtY19lbmdpbmVf dHlwZTsKKworZW51bSBtY19yb3dfcG9zaXRpb247CisKK2VudW0gbWNfcmVkcmF3X3Jvd190eXBl OworCitlbnVtIGRyYXdfZ2x5cGhfYWN0aW9uOworCitleHRlcm4gTGlzcF9PYmplY3QgbWNfbGlz dG4gKHB0cmRpZmZfdCwgTGlzcF9PYmplY3QsIC4uLik7CisKK2V4dGVybiBMaXNwX09iamVjdCBt Y19udGggKGludCwgTGlzcF9PYmplY3QpOworCitleHRlcm4gTGlzcF9PYmplY3QgbWNfYXNzcSAo TGlzcF9PYmplY3QsIExpc3BfT2JqZWN0KTsKKworZXh0ZXJuIGVudW0gbWNfcm93X3Bvc2l0aW9u IG1jX3Jvd19wb3NpdGlvbiAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhf cm93ICosIGludCk7CisKK2V4dGVybiBwdHJkaWZmX3QgbWNfcmVnaW9uX2xpbWl0IChib29sKTsK KworZXh0ZXJuIHN0cnVjdCBnbHlwaCAqIG1jX2dldF9jdXJzb3JfZ2x5cGggKHN0cnVjdCB3aW5k b3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKiwgaW50LCBpbnQpOworCitleHRlcm4g dm9pZCBtY194d19jb2xvcl92YWx1ZXMgKHN0cnVjdCB3aW5kb3cgKiwgTGlzcF9PYmplY3QsIHN0 cnVjdCBtY19SR0IgKik7CisKK2V4dGVybiBib29sIG1jX3VwZGF0ZV93aW5kb3dfZnJpbmdlcyAo c3RydWN0IHdpbmRvdyAqLCBib29sKTsKKworZXh0ZXJuIGNoYXIgKiBtY193aW5kb3cgKHN0cnVj dCB3aW5kb3cgKik7CisKK2V4dGVybiBjaGFyICogbWNfY2hhcl90b19zdHJpbmcgKGludCk7CisK K2V4dGVybiBjaGFyICogbWNfY3Vyc29yX3R5cGVfdG9fc3RyaW5nIChlbnVtIG1jX2N1cnNvcl90 eXBlKTsKKworZXh0ZXJuIGNoYXIgKiBtY19mbGF2b3JfdG9fc3RyaW5nIChlbnVtIG1jX2ZsYXZv cik7CisKK2V4dGVybiBjaGFyICogbWNfY2FjaGVfdHlwZV90b19zdHJpbmcgKGVudW0gbWNfY2Fj aGVfdHlwZSk7CisKK2V4dGVybiBjaGFyICogbWNfcmVkcmF3X3Jvd190eXBlX3RvX3N0cmluZyAo ZW51bSBtY19yZWRyYXdfcm93X3R5cGUpOworCitleHRlcm4gdm9pZCBtY19jYWNoZV9pbnNwZWN0 b3IgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IG1jX21hdHJpeCk7CisKK2V4dGVybiBib29sIG1j X3RyYXZlcnNlX2NhY2hlX3AgKHN0cnVjdCBtY19tYXRyaXgsIGVudW0gbWNfY2FjaGVfdHlwZSwg aW50LCBpbnQpOworCitleHRlcm4gdm9pZCBtY19kcmF3X2ZyaW5nZV9iaXRtYXAgKHN0cnVjdCB3 aW5kb3cgKiwgc3RydWN0IGdseXBoX3JvdyAqLCBpbnQsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUpOworCitleHRlcm4gaW50IG1jX2dldF9m cmluZ2VfYml0bWFwIChzdHJ1Y3Qgd2luZG93ICosIExpc3BfT2JqZWN0LCBpbnQsIGludCk7CisK K2V4dGVybiB2b2lkIG1jX2VuZ2luZSAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0 cml4ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0 IGdseXBoICosIGludCwgaW50LCBpbnQsIGludCwgaW50LCBpbnQsCisgICAgICAgICAgICAgICAg ICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUsIGludCwgc3RydWN0IGdseXBoX21hdHJpeCAqLAor ICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfZXNzZW50aWFscywgZW51bSBtY19yb3df cG9zaXRpb24sIHN0cnVjdCBtY19SR0IsCisgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNf ZW5naW5lX3R5cGUsIGJvb2wsIGVudW0gbWNfZHJhd19yb3dfdHlwZSwKKyAgICAgICAgICAgICAg ICAgICAgICAgZW51bSBtY19jYWNoZV90eXBlKTsKKworZXh0ZXJuIHZvaWQgbWNfc2V0X2Vzc2Vu dGlhbHMgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IG1jX2Vzc2VudGlhbHMgKik7CisKK2V4dGVy biB2b2lkIG1jX2RyYXdfcm93IChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXgg Kiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBn bHlwaCAqLCBpbnQsIGludCwgaW50LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosCisgICAgICAgICAg ICAgICAgICAgICAgICAgc3RydWN0IG1jX2Vzc2VudGlhbHMsIGVudW0gbWNfcm93X3Bvc2l0aW9u LCBib29sLAorICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfZHJhd19yb3dfdHlwZSk7 CisKK2V4dGVybiBib29sIG1jX3JlZHJhd19yb3cgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGds eXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAgICAgICAgICAgICAgICAgICAg ICAgICBlbnVtIGdseXBoX3Jvd19hcmVhLCBpbnQsIGludCwgaW50LCBib29sLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlLCBlbnVtIG1jX3JlZHJhd19y b3dfdHlwZSk7CisKK2V4dGVybiB2b2lkIG1jX3Jlc2V0X2NhY2hlIChzdHJ1Y3Qgd2luZG93ICop OworCitleHRlcm4gdm9pZCBtY19kcmF3X2N1cnNvcl9nbHlwaCAoc3RydWN0IHdpbmRvdyAqLCBz dHJ1Y3QgZ2x5cGhfbWF0cml4ICosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg c3RydWN0IGdseXBoX3JvdyAqLCBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgaW50LCBpbnQsIGludCwgc3RydWN0IG1jX1JHQiwgZW51bSBt Y19mbGF2b3IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJz b3JfdHlwZSwgaW50LCBib29sLCBib29sKTsKKworZXh0ZXJuIHZvaWQgbWNfZXJhc2VfY3Vyc29y IChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwgc3RydWN0IGdseXBoX3Jv dyAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQsIGludCwgaW50LCBpbnQsIGVu dW0gbWNfZmxhdm9yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNv cl90eXBlLCBpbnQpOworCitleHRlcm4gdm9pZCBtY19kcmF3X2VyYXNlX2h5YnJpZCAoc3RydWN0 IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQsIGludCwgaW50LCBpbnQsIGludCwg aW50LCBpbnQsIGludCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1j X2N1cnNvcl90eXBlLCBpbnQsIHN0cnVjdCBtY19SR0IsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgYm9vbCwgZW51bSBtY19mbGF2b3IsIGJvb2wpOworCitleHRlcm4gaW50IG1j X2RyYXdfZ2x5cGhzIChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwgc3Ry dWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBlbnVtIGds eXBoX3Jvd19hcmVhLCBwdHJkaWZmX3QsIHB0cmRpZmZfdCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSwgaW50LCBpbnQsIHN0cnVjdCBtY19SR0IsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2ZsYXZvciwgZW51bSBtY19jdXJzb3Jf dHlwZSwgaW50LCBib29sLCBib29sLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBk cmF3X2dseXBoX2FjdGlvbiwgYm9vbCk7CisKK2V4dGVybiBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICog bWNfc2F2ZV9nbHlwaF9tYXRyaXggKHN0cnVjdCBnbHlwaF9tYXRyaXggKik7CisKK2V4dGVybiB2 b2lkIG1jX3Jlc3RvcmVfZ2x5cGhfbWF0cml4IChzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVj dCBnbHlwaF9tYXRyaXggKik7CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKworCiAvKiBUZXh0IGN1cnNvciB0eXBlcy4gICovCiAKIGVudW0g dGV4dF9jdXJzb3Jfa2luZHMKQEAgLTM4Miw2ICs1MDUsMTggQEAgc3RydWN0IGdseXBoX3NsaWNl CiAKIHN0cnVjdCBnbHlwaAogeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCisgIGludCByZWxhdGl2ZV94LCBocG9zOworCisgIHB0cmRpZmZf dCBieXRlcG9zOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIFBvc2l0aW9u IGZyb20gd2hpY2ggdGhpcyBnbHlwaCB3YXMgZHJhd24uICBJZiBgb2JqZWN0JyBiZWxvdyBpcyBh CiAgICAgIExpc3Agc3RyaW5nLCB0aGlzIGlzIGFuIGluZGV4IGludG8gdGhhdCBzdHJpbmcuICBJ ZiBpdCBpcyBhCiAgICAgIGJ1ZmZlciwgdGhpcyBpcyBhIHBvc2l0aW9uIGluIHRoYXQgYnVmZmVy LiAgSW4gYWRkaXRpb24sIHNvbWUKQEAgLTEyNDgsNiArMTM4MywyOCBAQCBlbnVtIGRyYXdfZ2x5 cGhzX2ZhY2UKIAogc3RydWN0IGdseXBoX3N0cmluZwogeworCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgYm9vbF9iZiBsZWZ0X292ZXJ3 cml0dGVuX3AgOiAxOworCisgICAgYm9vbF9iZiByaWdodF9vdmVyd3JpdHRlbl9wIDogMTsKKwor ICAgIGJvb2xfYmYgcmVjdGFuZ2xlX251a2VkX3AgOiAxOworCisgICAgYm9vbF9iZiBiYWNrZ3Jv dW5kX251a2VkX3AgOiAxOworCisgICAgZW51bSBkcmF3X2dseXBoX2FjdGlvbgorICAgIHsKKyAg ICAgIE1DX0RSQVdfR0xZUEhfU1RSSU5HLAorICAgICAgTUNfRVJBU0VfR0xZUEhfU1RSSU5HCisg ICAgfSBhY3Rpb25fdHlwZTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBY LW9yaWdpbiBvZiB0aGUgc3RyaW5nLiAgKi8KICAgaW50IHg7CiAKQEAgLTI4MTIsNiArMjk2OSwy OCBAQCB0eXBlZGVm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zJfZHJhd19nbHlwaF9z dHJpbmcnIHwgYG1jX3hfZHJhd19nbHlwaF9zdHJpbmcnICovCisgIHZvaWQgKCptY19zY3JpYmVf c3RyaW5nKSAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0 cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsLCBl bnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IsCisgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUg Y3Vyc29yX3R5cGUsIGludCB3ZCwgYm9vbCBhY3RpdmVfcCwgYm9vbCBjdXJzb3JfZ2NfcCk7CisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogSGFuZGxlcnMgZm9yIHNldHRpbmcg ZnJhbWUgcGFyYW1ldGVycy4gICovCiAgIGZyYW1lX3Bhcm1faGFuZGxlciAqZnJhbWVfcGFybV9o YW5kbGVyczsKIApkaWZmIC0tZ2l0IGEvc3JjL2Rpc3BuZXcuYyBiL3NyYy9kaXNwbmV3LmMKaW5k ZXggY2NiMDhlYy4uYjc1OTQxNyAxMDA2NDQKLS0tIGEvc3JjL2Rpc3BuZXcuYworKysgYi9zcmMv ZGlzcG5ldy5jCkBAIC01Niw2ICs1NiwxODE1IEBAIGFsb25nIHdpdGggR05VIEVtYWNzLiAgSWYg bm90LCBzZWUgPGh0dHBzOi8vd3d3LmdudS5vcmcvbGljZW5zZXMvPi4gICovCiAjaW5jbHVkZSAi dzMyLmgiCiAjZW5kaWYKIAwKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2lu IE1VTFRJUExFLUNVUlNPUlMgKi8KKworc3RydWN0IGdseXBoc19za2lwcGVkCit7CisgIHB0cmRp ZmZfdCBhbGxvY2F0ZWQ7CisgIHB0cmRpZmZfdCB1c2VkOworICBzdHJ1Y3Qgc2tpcHBlZF9pdGVt cworICAgIHsKKyAgICAgIGludCB4OworICAgICAgaW50IGhwb3M7CisgICAgICBib29sIGVuYWJs ZWRfcDsKKyAgICB9ICpza2lwcGVkOworfSBhcnJheV9nbHlwaHNfc2tpcHBlZDsKKworc3RydWN0 IG1jX3Jvd19lbnRyeQoreworICBpbnQgb2xkX3VzZXMsIG5ld191c2VzOworICBpbnQgbmV3X2xp bmVfbnVtYmVyOworICBwdHJkaWZmX3QgYnVja2V0OworICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3c7 CisgIHN0cnVjdCBtY19yb3dfZW50cnkgKm5leHQ7Cit9Oworc3RhdGljIHN0cnVjdCBtY19yb3df ZW50cnkgKm1jX3Jvd19lbnRyeV9wb29sOworc3RhdGljIHB0cmRpZmZfdCBtY19yb3dfZW50cnlf cG9vbF9zaXplOworc3RhdGljIHB0cmRpZmZfdCBtY19yb3dfZW50cnlfaWR4Oworc3RhdGljIHN0 cnVjdCBtY19yb3dfZW50cnkgKiptY19yb3dfdGFibGU7CitzdGF0aWMgcHRyZGlmZl90IG1jX3Jv d190YWJsZV9zaXplOworc3RhdGljIHN0cnVjdCBtY19yb3dfZW50cnkgKiptY19vbGRfbGluZXMs ICoqbWNfbmV3X2xpbmVzOworc3RhdGljIHB0cmRpZmZfdCBtY19vbGRfbGluZXNfc2l6ZSwgbWNf bmV3X2xpbmVzX3NpemU7CitzdGF0aWMgc3RydWN0IHJ1biAqbWNfcnVuX3Bvb2w7CitzdGF0aWMg cHRyZGlmZl90IG1jX3J1bnNfc2l6ZTsKK3N0YXRpYyBzdHJ1Y3QgcnVuICoqbWNfcnVuczsKKwor c3RhdGljIGJvb2wgdXBkYXRlX3dpbmRvd19saW5lIChzdHJ1Y3Qgd2luZG93ICosIGludCwgYm9v bCAqKTsKKworc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yeV9wb29sICsgbWNfcm93X2Vu dHJ5X2lkeCsrOworICAgICAgZW50cnktPnJvdyA9IHJvdzsKKyAgICAgIGVudHJ5LT5vbGRfdXNl cyA9IGVudHJ5LT5uZXdfdXNlcyA9IDA7CisgICAgICBlbnRyeS0+bmV3X2xpbmVfbnVtYmVyID0g MDsKKyAgICAgIGVudHJ5LT5idWNrZXQgPSBpOworICAgICAgZW50cnktPm5leHQgPSBtY19yb3df dGFibGVbaV07CisgICAgICBtY19yb3dfdGFibGVbaV0gPSBlbnRyeTsKKyAgICB9CisgIHJldHVy biBlbnRyeTsKK30KKworLyogUmV2ZXJzZSB0aGUgY29udGVudHMgb2Ygcm93cyBpbiBNQVRSSVgg YmV0d2VlbiBTVEFSVCBhbmQgRU5ELiAgVGhlCisgICBjb250ZW50cyBvZiB0aGUgcm93IGF0IEVO RCAtIDEgZW5kIHVwIGF0IFNUQVJULCBFTkQgLSAyIGF0IFNUQVJUICsKKyAgIDEgZXRjLiAgVGhp cyBpcyBwYXJ0IG9mIHRoZSBpbXBsZW1lbnRhdGlvbiBvZiByb3RhdGVfbWF0cml4IChzZWUKKyAg IGJlbG93KS4gKi8KK3N0YXRpYyB2b2lkCittY19yZXZlcnNlX3Zwb3MgKHN0cnVjdCBtY19tYXRy aXggbWF0cml4LCBpbnQgc3RhcnQsIGludCBlbmQpCit7CisgIGludCBpLCBqOworICBmb3IgKGkg PSBzdGFydCwgaiA9IGVuZCAtIDE7IGkgPCBqOyArK2ksIC0taikKKyAgICB7CisgICAgICAvKiBO b24tSVNPIEhQL1VYIGNvbXBpbGVyIGRvZXNuJ3QgbGlrZSBhdXRvIHN0cnVjdCBpbml0aWFsaXph dGlvbi4gKi8KKyAgICAgIHN0cnVjdCBtY192cG9zIHRlbXA7CisgICAgICB0ZW1wID0gbWF0cml4 LnZwb3NbaV07CisgICAgICBtYXRyaXgudnBvc1tpXSA9IG1hdHJpeC52cG9zW2pdOworICAgICAg bWF0cml4LnZwb3Nbal0gPSB0Z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ljYXRlX2JvYl9wOworICAgICAgdG8tPmluZGljYXRlX3Rv cF9saW5lX3AgPSBmcm9tLT5pbmRpY2F0ZV90b3BfbGluZV9wOworICAgICAgdG8tPmluZGljYXRl X2VvYl9wID0gZnJvbS0+aW5kaWNhdGVfZW9iX3A7CisgICAgICB0by0+aW5kaWNhdGVfYm90dG9t X2xpbmVfcCA9IGZyb20tPmluZGljYXRlX2JvdHRvbV9saW5lX3A7CisgICAgICB0by0+cmV2ZXJz ZWRfcCA9IGZyb20tPnJldmVyc2VkX3A7CisgICAgICB0by0+Y29udGludWF0aW9uX2xpbmVzX3dp ZHRoID0gZnJvbS0+Y29udGludWF0aW9uX2xpbmVzX3dpZHRoOworICAgICAgdG8tPmNsaXAgPSBm cm9tLT5jbGlwOworICAgICAgaWYgKGZyb20tPnVzZWRbTEVGVF9NQVJHSU5fQVJFQV0pCisgICAg ICAgIHsKKyAgICAgICAgICBuYnl0ZXMgPSBmcm9tLT51c2VkW0xFRlRfTUFSR0lOX0FSRUFdICog c2l6ZW9mIChzdHJ1Y3QgZ2x5cGgpOworICAgICAgICAgIHRvLT5nbHlwaHNbTEVGVF9NQVJHSU5f QVJFQV0gPSB4bWFsbG9jIChuYnl0ZXMpOworICAgICAgICAgIG1lbWNweSAodG8tPmdseXBoc1tM RUZUX01BUkdJTl9BUkVBXSwgZnJvbS0+Z2x5cGhzW0xFRlRfTUFSR0lOX0FSRUFdLCBuYnl0ZXMp OworICAgICAgICAgIHRvLT51c2VkW0xFRlRfTUFSR0lOX0FSRUFdID0gZnJvbS0+dXNlZFtMRUZU X01BUkdJTl9BUkVBXTsKKyAgICAgICAgfQorICAgICAgaWYgKGZyb20tPnVzZWRbUklHSFRfTUFS R0lOX0FSRUFdKQorICAgICAgICB7CisgICAgICAgICAgbmJ5dGVzID0gZnJvbS0+dXNlZFtSSUdI VF9NQVJHSU5fQVJFQV0gKiBzaXplb2YgKHN0cnVjdCBnbHlwaCk7CisgICAgICAgICAgdG8tPmds eXBoc1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yk7CisgICAgICB0by0+dXNlZFtURVhUX0FS RUFdID0gZnJvbS0+dXNlZFtURVhUX0FSRUFdOworICAgICAgdG8tPmhhc2ggPSBmcm9tLT5oYXNo OworICAgICAgdG8tPnggPSBmcm9tLT54OworICAgICAgdG8tPnkgPSBmcm9tLT55OworICAgICAg dG8tPnBpeGVsX3dpZHRoID0gZnJvbS0+cGl4ZWxfd2lkdGg7CisgICAgICB0by0+YXNjZW50ID0g ZnJvbS0+YXNjZW50OworICAgICAgdG8tPmhlaWdodCA9IGZyb20tPmhlaWdodDsKKyAgICAgIHRv LT5waHlzX2FzY2VudCA9IGZyb20tPnBoeXNfYXNjZW50OworICAgICAgdG8tPnBoeXNfaGVpZ2h0 ID0gZnJvbS0+cGh5c19oZWlnaHQ7CisgICAgICB0by0+dmlzaWJsZV9oZWlnaHQgPSBmcm9tLT52 aXNpYmxlX2hlaWdodDsKKyAgICAgIHRvLT5leHRyYV9saW5lX3NwYWNpbmcgPSBmcm9tLT5leHRy YV9saW5lX3NwYWNpbmc7CisgICAgICB0by0+c3RhcnQgPSBmcm9tLT5zdGFydDsKKyAgICAgIHRv LT5lbmQgPSBmcm9tLT5lbmQ7CisgICAgICB0by0+bWlucG9zID0gZnJvbS0+bWlucG9zOworICAg ICAgdG8tPm1heHBvcyA9IGZyb20tPm1heHBvczsKKyAgICAgIHRvLT5vdmVybGF5X2Fycm93X2Jp dG1hcCA9IGZyb20tPm92ZXJsYXlfYXJyb3dfYml0bWFwOworICAgICAgdG8tPmxlZnRfdXNlcl9m cmluZ2VfYml0bWFwID0gZnJvbS0+bGVmdF91c2VyX2ZyaW5nZV9iaXRtYXA7CisgICAgICB0by0+ cmlnaHRfdXNlcl9mcmluZ2VfYml0bWFwID0gZnJvbS0+cmlnaHRfdXNlcl9mcmluZ2VfYml0bWFw OworICAgICAgdG8tPmxlZnRfZnJpbmdlX2JpdG1hcCA9IGZyb20tPmxlZnRfZnJpbmdlX2JpdG1h cDsKKyAgICAgIHRvLT5ya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SUYgKFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSkpOworICAvKiBTa2lwIG92ZXIgcm93cyBl cXVhbCBhdCB0aGUgc3RhcnQuICovCisgIGZvciAoaSA9IGhlYWRlcl9saW5lX3A7IGkgPCBjdXJy ZW50X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAgeworICAgICAgc3RydWN0IGdseXBoX3Jv dyAqZCA9IE1BVFJJWF9ST1cgKGRlc2lyZWRfbWF0cml4LCBpKTsKKyAgICAgIHN0cnVjdCBnbHlw aF9yb3cgKmMgPSBNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSk7CisgICAgICBpZiAoYy0+ ZW5hYmxlZF9wCisgICAgICAgICAgJiYgZC0+ZW5hYmxlZF9wCisgICAgICAgICAgJiYgIWQtPnJl ZHJhd19mcmluZ2VfYml0bWFwc19wCisgICAgICAgICAgJiYgYy0+eSA9PSBkLT55CisgICAgICAg ICAgJiYgTUFUUklYX1JPV19CT1RUT01fWSAoYykgPD0geWIKKyAgICAgICAgICAmJiBNQVRSSVhf Uk9XX0JPVFRPTV9ZIChkKSA8PSB5YgorICAgICAgICAgICYmIHJvd19lcXVhbF9wIChjLCBkLCAx KSkKKyAgICAgICAgeworICAgICAgICAgIGFzc2lnbl9yb3cgKGMsIGQpOworICAgICAgICAgIGQt PmVuYWJsZWRfcCA9IGZhbHNlOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICBi cmVhazsKKyAgICB9CisjaWZkZWYgSEFWRV9YV0lER0VUUworICAvKiBDdXJyZW50bHkgdGhpcyBz ZWVtcyBuZWVkZWQgdG8gZGV0ZWN0IHh3aWRnZXQgbW92ZW1lbnQgcmVsaWFibHkuICovCisgICAg cmV0dXJuIDA7CisjZW5kaWYKKyAgLyogR2l2ZSB1cCBpZiBzb21lIHJvd3MgaW4gdGhlIGRlc2ly ZWQgbWF0cml4IGFyZSBub3QgZW5hYmxlZC4gKi8KKyAgaWYgKCEgTUFUUklYX1JPV19FTkFCTEVE X1AgKGRlc2lyZWRfbWF0cml4LCBpKSkKKyAgICByZXR1cm4gLTE7CisgIGZpcnN0X29sZCA9IGZp cnN0X25ldyA9IGk7CisgIC8qIFNldCBsYXN0X25ldyB0byB0aGUgaW5kZXggKyAxIG9mIHRoZSBy b3cgdGhhdCByZWFjaGVzIHRoZQorICAgICBib3R0b20gYm91bmRhcnkgaW4gdGhlIGRlc2lyZWQg bWF0cml4LiAgR2l2ZSB1cCBpZiB3ZSBmaW5kIGEKKyAgICAgZGlzYWJsZWQgcm93IGJlZm9yZSB3 ZSByZWFjaCB0aGUgYm90dG9tIGJvdW5kYXJ5LiAqLworICBpID0gZmlyc3RfbmV3ICsgMTsKKyAg d2hpbGUgKGkgPCBkZXNpcmVkX21hdHJpeC0+bnJvd3MgLSAxKQorICAgIHsKKyAgICAgIGludCBi b3R0b207CisgICAgICBpZiAoISBNQVRSSVhfUk9XX0VOQUJMRURfUCAoZGVzaXJlZF9tYXRyaXgs IGkpKQorICAgICAgICByZXR1cm4gMDsKKyAgICAgIGJvdHRvbSA9IE1BVFJJWF9ST1dfQk9UVE9N X1kgKE1BVFJJWF9ST1cgKGRlc2lyZWRfbWF0cml4LCBpKSk7CisgICAgICBpZiAoYm90dG9tIDw9 IHliKQorICAgICAgICArK2k7CisgICAgICBpZiAoYm90dG9tID49IHliKQorICAgICAgICBicmVh azsKKyAgICB9CisgIGxhc3RfbmV3ID0gaTsKKyAgLyogU2V0IGxhc3Rfb2xkIHRvIHRoZSBpbmRl eCArIDEgb2YgdGhlIHJvdyB0aGF0IHJlYWNoZXMgdGhlIGJvdHRvbQorICAgICBib3VuZGFyeSBp biB0aGUgY3VycmVudCBtYXRyaXguICBXZSBkb24ndCBsb29rIGF0IHRoZSBlbmFibGVkCisgICAg IGZsYWcgaGVyZSBiZWNhdXNlIHdlIHBsYW4gdG8gcmV1c2UgcGFydCBvZiB0aGUgZGlzcGxheSBl dmVuIGlmCisgICAgIG90aGVyIHBhcnRzIGFyZSBkaXNhYmxlZC4gKi8KKyAgaSA9IGZpcnN0X29s ZCArIDE7CisgIHdoaWxlIChpIDwgY3VycmVudF9tYXRyaXgtPm5yb3dzIC0gMSkKKyAgICB7Cisg ICAgICBpbnQgYm90dG9tID0gTUFUUklYX1JPV19CT1RUT01fWSAoTUFUUklYX1JPVyAoY3VycmVu dF9tYXRyaXgsIGkpKTsKKyAgICAgIGlmIChib3R0b20gPD0geWIpCisgICAgICAgICsraTsKKyAg ICAgIGlmIChib3R0b20gPj0geWIpCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgbGFzdF9vbGQg PSBpOworICAvKiBTa2lwIG92ZXIgcm93cyBlcXVhbCBhdCB0aGUgYm90dG9tLiAqLworICBpID0g bGFzdF9uZXc7CisgIGogPSBsYXN0X29sZDsKKyAgd2hpbGUgKGkgLSAxID4gZmlyc3RfbmV3Cisg ICAgICAgICAmJiBqIC0gMSA+IGZpcnN0X29sZAorICAgICAgICAgJiYgTUFUUklYX1JPV19FTkFC TEVEX1AgKGN1cnJlbnRfbWF0cml4LCBqIC0gMSkKKyAgICAgICAgICYmIChNQVRSSVhfUk9XIChj dXJyZW50X21hdHJpeCwgaiAtIDEpLT55CisgICAgICAgICAgICAgPT0gTUFUUklYX1JPVyAoZGVz aXJlZF9tYXRyaXgsIGkgLSAxKS0+eSkKKyAgICAgICAgICYmICFNQVRSSVhfUk9XIChkZXNpcmVk X21hdHJpeCwgaSAtIDEpLT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcAorICAgICAgICAgJiYgcm93 X2VxdWFsX3AgKE1BVFJJWF9ST1cgKGRlc2lyZWRfbWF0cml4LCBpIC0gMSksCisgICAgICAgICAg ICAgICAgICAgICAgICAgTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIGogLSAxKSwgMSkpCisg ICAgLS1pLCAtLWo7CisgIGxhc3RfbmV3ID0gaTsKKyAgbGFzdF9vbGQgPSBqOworICAvKiBOb3Ro aW5nIHRvIGRv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YXgpOworICAgIHB0cmRpZmZfdCBjdXJyZW50X25y b3dzX21heCA9IHJvd190YWJsZV9tYXggLSBkZXNpcmVkX21hdHJpeC0+bnJvd3M7CisgICAgaWYg KGN1cnJlbnRfbnJvd3NfbWF4IDwgY3VycmVudF9tYXRyaXgtPm5yb3dzKQorICAgICAgbWVtb3J5 X2Z1bGwgKFNJWkVfTUFYKTsKKyAgfQorICAvKiBSZWFsbG9jYXRlIHZlY3RvcnMsIHRhYmxlcyBl dGMuIGlmIG5lY2Vzc2FyeS4gKi8KKyAgaWYgKGN1cnJlbnRfbWF0cml4LT5ucm93cyA+IG1jX29s ZF9saW5lc19zaXplKQorICAgIG1jX29sZF9saW5lcyA9IHhwYWxsb2MgKG1jX29sZF9saW5lcywg Jm1jX29sZF9saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRfbWF0 cml4LT5ucm93cyAtIG1jX29sZF9saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAg IElOVF9NQVgsIHNpemVvZiAqbWNfb2xkX2xpbmVzKTsKKyAgaWYgKGRlc2lyZWRfbWF0cml4LT5u cm93cyA+IG1jX25ld19saW5lc19zaXplKQorICAgIG1jX25ld19saW5lcyA9IHhwYWxsb2MgKG1j X25ld19saW5lcywgJm1jX25ld19saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAg IGRlc2lyZWRfbWF0cml4LT5ucm93cyAtIG1jX25ld19saW5lc19zaXplLAorICAgICAgICAgICAg ICAgICAgICAgICAgIElOVF9NQVgsIHNpemVvZiAqbWNfbmV3X2xpbmVzKTsKKyAgbiA9IGRlc2ly ZWRfbWF0cml4LT5ucm93czsKKyAgbiArPSBjdXJyZW50X21hdHJpeC0+bnJvd3M7CisgIGlmICht Y19yb3dfdGFibGVfc2l6ZSA8IDMgKiBuKQorICAgIHsKKyAgICAgIHB0cmRpZmZfdCBzaXplID0g bmV4dF9hbG1vc3RfcHJpbWUgKDMgKiBuKTsKK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mxlIHRvIGZpbmQgZXF1YWwgb25lcyBxdWlja2x5LiAqLworICBmb3IgKGkgPSBmaXJzdF9v bGQ7IGkgPCBsYXN0X29sZDsgKytpKQorICAgIHsKKyAgICAgIGlmIChNQVRSSVhfUk9XX0VOQUJM RURfUCAoY3VycmVudF9tYXRyaXgsIGkpKQorICAgICAgICB7CisgICAgICAgICAgZW50cnkgPSBt Y19hZGRfcm93X2VudHJ5IChNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSkpOworICAgICAg ICAgIG1jX29sZF9saW5lc1tpXSA9IGVudHJ5OworICAgICAgICAgICsrZW50cnktPm9sZF91c2Vz OworICAgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIG1jX29sZF9saW5lc1tpXSA9IE5VTEw7 CisgICAgfQorICBmb3IgKGkgPSBmaXJzdF9uZXc7IGkgPCBsYXN0X25ldzsgKytpKQorICAgIHsK KyAgICAgIGVhc3NlcnQgKE1BVFJJWF9ST1dfRU5BQkxFRF9QIChkZXNpcmVkX21hdHJpeCwgaSkp OworICAgICAgZW50cnkgPSBtY19hZGRfcm93X2VudHJ5IChNQVRSSVhfUk9XIChkZXNpcmVkX21h dHJpeCwgaSkpOworICAgICAgKytlbnRyeS0+bmV3X3VzZXM7CisgICAgICBlbnRyeS0+bmV3X2xp bmVfbnVtYmVyID0gaTsKKyAgICAgIG1jX25ld19saW5lc1tpXSA9IGVudHJ5OworICAgIH0KKyAg LyogSWRlbnRpZnkgbW92ZXMgYmFzZWQgb24gbGluZXMgdGhhdCBhcmUgdW5pcXVlIGFuZCBlcXVh bAorICAgICBpbiBib3RoIG1hdHJpY2VzLiAqLworICBmb3IgKGkgPSBmaXJzdF9vbGQ7IGkgPCBs YXN0X29sZDspCisgICAgaWYgKG1jX29sZF9saW5lc1tpXQorICAgICAgICAmJiBtY19vbGRfbGlu ZXNbaV0tPm9sZF91c2VzID09IDEKKyAgICAgICAgJiYgbWNfb2xkX2xpbmVzW2ldLT5uZXdfdXNl cyA9PSAxKQorICAgICAgeworICAgICAgICBpbnQgcCwgcTsKKyAgICAgICAgaW50IG5ld19saW5l ID0gbWNfb2xkX2xpbmVzW2ldLT5uZXdfbGluZV9udW1iZXI7CisgICAgICAgIHN0cnVjdCBydW4g KnJ1biA9IG1jX3J1bl9wb29sICsgcnVuX2lkeCsrOworICAgICAgICAvKiBSZWNvcmQgbW92ZS4g Ki8KKyAgICAgICAgcnVuLT5jdXJyZW50X3Zwb3MgPSBpOworICAgICAgICBydW4tPmN1cnJlbnRf eSA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCBpKS0+eTsKKyAgICAgICAgcnVuLT5kZXNp cmVkX3Zwb3MgPSBuZXdfbGluZTsKKyAgICAgICAgcnVuLT5kZXNpcmVkX3kgPSBNQVRSSVhfUk9X IChkZXNpcmVkX21hdHJpeCwgbmV3X2xpbmUpLT55OworICAgICAgICBydW4tPm5yb3dzID0gMTsK KyAgICAgICAgcnVuLT5oZWlnaHQgPSBNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSktPmhl aWdodDsKKyAgICAgICAgLyogRXh0ZW5kIGJhY2t3YXJkLiAqLworICAgICAgICBwID0gaSAtIDE7 CisgICAgICAgIHEgPSBuZXdfbGluZSAtIDE7CisgICAgICAgIHdoaWxlIChwID4gZmlyc3Rfb2xk CisgICAgICAgICAgICAgICAmJiBxID4gZmlyc3RfbmV3CisgICAgICAgICAgICAgICAmJiBtY19v bGRfbGluZXNbcF0gPT0gbWNfbmV3X2xpbmVzW3FdKQorICAgICAgICAgIHsKKyAgICAgICAgICAg IGludCBoID0gTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIHApLT5oZWlnaHQ7CisgICAgICAg ICAgICAtLXJ1bi0+Y3VycmVudF92cG9zOworICAgICAgICAgICAgLS1ydW4tPmRlc2lyZWRfdnBv czsKKyAgICAgICAgICAgICsrcnVuLT5ucm93czsKKyAgICAgICAgICAgIHJ1bi0+aGVpZ2h0ICs9 IGg7CisgICAgICAgICAgICBydW4tPmRlc2lyZWRfeSAtPSBoOworICAgICAgICAgICAgcnVuLT5j dXJyZW50X3kgLT0gaDsKKyAgICAgICAgICAgIC0tcCwgLS1xOworICAgICAgICAgIH0KKyAgICAg ICAgLyogRXh0ZW5kIGZvcndhcmQuICovCisgICAgICAgIHAgPSBpICsgMTsKKyAgICAgICAgcSA9 IG5ld19saW5lICsgMTsKKyAgICAgICAgd2hpbGUgKHAgPCBsYXN0X29sZAorICAgICAgICAgICAg ICAgJiYgcSA8IGxhc3RfbmV3CisgICAgICAgICAgICAgICAmJiBtY19vbGRfbGluZXNbcF0gPT0g bWNfbmV3X2xpbmVzW3FdKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGludCBoID0gTUFUUklY X1JPVyAoY3VycmVudF9tYXRyaXgsIHApLT5oZWlnaHQ7CisgICAgICAgICAgICArK3J1bi0+bnJv d3M7CisgICAgICAgICAgICBydW4tPmhlaWdodCArPSBoOworICAgICAgICAgICAgKytwLCArK3E7 CisgICAgICAgICAgfQorICAgICAgICAvKiBJbnNlcnQgcnVuIGludG8gbGlzdCBvZiBhbGwgcnVu cy4gIE9yZGVyIHJ1bnMgYnkgY29waWVkCisgICAgICAgICAgIHBpeGVsIGxpbmVzLiAgTm90ZSB0 aGF0IHdlIHJlY29yZCBydW5zIHRoYXQgZG9uJ3QgaGF2ZSB0bworICAgICAgICAgICBiZSBjb3Bp ZWQgYmVjYXVzZSB0aGV5IGFyZSBhbHJlYWR5IGluIHBsYWNlLiAgVGhpcyBpcyBkb25lCisgICAg ICAgICAgIGJlY2F1c2Ugd2UgY2FuIGF2b2lkIGNhbGxpbmcgdXBkYXRlX3dpbmRvd19saW5lIGlu IHRoaXMKKyAgICAgICAgICAgY2FzZS4gKi8KKyAgICAgICAgZm9yIChwID0gMDsgcCA8IG5ydW5z ICYmIG1jX3J1bnNbcF0tPmhlaWdodCA+IHJ1bi0+aGVpZ2h0OyArK3ApCisgICAgICAgICAgOwor ICAgICAgICBmb3IgKHEgPSBucnVuczsgcSA+IHA7IC0tcSkKKyAgICAgICAgICBtY19ydW5zW3Fd ID0gbWNfcnVuc1txIC0gMV07CisgICAgICAgIG1jX3J1bnNbcF0gPSBydW47CisgICAgICAgICsr bnJ1bnM7CisgICAgICAgIGkgKz0gcnVuLT5ucm93czsKKyAgICAgIH0KKyAgICAgIGVsc2UKKyAg ICAgICAgKytpOworICAvKiBEbyB0aGUgbW92ZXMuICBEbyBpdCBpbiBhIHdheSB0aGF0IHdlIGRv bid0IG92ZXJ3cml0ZSBzb21ldGhpbmcKKyAgICAgd2Ugd2FudCB0byBjb3B5IGxhdGVyIG9uLiAg VGhpcyBpcyBub3Qgc29sdmFibGUgaW4gZ2VuZXJhbAorICAgICBiZWNhdXNlIHRoZXJlIGlzIG9u bHkgb25lIGRpc3BsYXkgYW5kIHdlIGRvbid0IGhhdmUgYSB3YXkgdG8KKyAgICAgZXhjaGFuZ2Ug YXJlYXMgb24gdGhpcyBkaXNwbGF5LiAgRXhhbXBsZToKKyAgICAgICAgICArLS0tLS0tLS0tLS0r ICAgICAgICstLS0tLS0tLS0tLSsKKyAgICAgICAgICB8ICAgICBBICAgICB8ICAgICAgIHwgICAg IEIgICAgIHwKKyAgICAgICAgICArLS0tLS0tLS0tLS0rICAtLT4gICstLS0tLS0tLS0tLSsKKyAg ICAgICAgICB8ICAgICBCICAgICB8ICAgICAgIHwgICAgIEEgICAgIHwKKyAgICAgICAgICArLS0t LS0tLS0tLS0rICAgICAgICstLS0tLS0tLS0tLSsKKyAgICAgSW5zdGVhZCwgcHJlZmVyIGJpZ2dl ciBtb3ZlcywgYW5kIGludmFsaWRhdGUgbW92ZXMgdGhhdCB3b3VsZAorICAgICBjb3B5IGZyb20g d2hlcmUgd2UgY29waWVkIHRvLiAqLworICBmb3IgKGkgPSAwOyBpIDwgbnJ1bnM7ICsraSkKKyAg ICBpZiAobWNfcnVuc1tpXS0+bnJvd3MgPiAwKQorICAgICAgeworICAgICAgICBzdHJ1Y3QgcnVu ICpyID0gbWNfcnVuc1tpXTsKKyAgICAgICAgaWYgKHItPmN1cnJlbnRfeSAhPSByLT5kZXNpcmVk X3kpCisgICAgICAgICAgeworICAgICAgICAgICAgLy8gIGZwcmludGYgKHN0ZGVyciwgIiVzOiAg ci0+Y3VycmVudC9kZXNpcmVkX3Zwb3MgKCVkLyVkKSB8IHItPmN1cnJlbnQvZGVzaXJlZF95ICgl ZC8lZClcbiIsCisgICAgICAgICAgICAvLyAgICAgICAgICAgci0+Y3VycmVudF95IDwgci0+ZGVz aXJlZF95ID8gIuKGkyIgOiAi4oaRIiwKKyAgICAgICAgICAgIC8vICAgICAgICAgICByLT5jdXJy ZW50X3Zwb3MsIHItPmRlc2lyZWRfdnBvcywgci0+Y3VycmVudF95LCByLT5kZXNpcmVkX3kpOwor ICAgICAgICAgICAgLy8gIHJpZi0+Y2xlYXJfd2luZG93X21vdXNlX2ZhY2UgKHcpOworICAgICAg ICAgICAgLy8gIHJpZi0+c2Nyb2xsX3J1bl9ob29rICh3LCByKTsKKyAgICAgICAgICB9CisgICAg ICAgIC8qIFRydW5jYXRlIHJ1bnMgdGhhdCBjb3B5IHRvIHdoZXJlIHdlIGNvcGllZCB0bywgYW5k CisgICAgICAgICAgIGludmFsaWRhdGUgcnVucyB0aGF0IGNvcHkgZnJvbSB3aGVyZSB3ZSBjb3Bp ZWQgdG8uICovCisgICAgICAgIGZvciAoaiA9IG5ydW5zIC0gMTsgaiA+IGk7IC0taikKKyAgICAg ICAgICB7CisgICAgICAgICAgICBzdHJ1Y3QgcnVuICpwID0gbWNfcnVuc1tqXTsKKyAgICAgICAg ICAgIGJvb2wgdHJ1bmNhdGVkX3AgPSAwOworICAgICAgICAgICAgaWYgKHAtPm5yb3dzID4gMAor ICAgICAgICAgICAgICAgICYmIHAtPmRlc2lyZWRfeSA8IHItPmRlc2lyZWRfeSArIHItPmhlaWdo dAorICAgICAgICAgICAgICAgICYmIHAtPmRlc2lyZWRfeSArIHAtPmhlaWdodCA+IHItPmRlc2ly ZWRfeSkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChwLT5kZXNpcmVkX3kg PCByLT5kZXNpcmVkX3kpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAg IHAtPm5yb3dzID0gci0+ZGVzaXJlZF92cG9zIC0gcC0+ZGVzaXJlZF92cG9zOworICAgICAgICAg ICAgICAgICAgICBwLT5oZWlnaHQgPSByLT5kZXNpcmVkX3kgLSBwLT5kZXNpcmVkX3k7CisgICAg ICAgICAgICAgICAgICAgIHRydW5jYXRlZF9wID0gMTsKKyAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICAgIGludCBucm93c19jb3BpZWQgPSAoci0+ZGVzaXJlZF92cG9zICsgci0+bnJvd3MKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIHAtPmRlc2lyZWRfdnBvcyk7Cisg ICAgICAgICAgICAgICAgICAgIGlmIChwLT5ucm93cyA8PSBucm93c19jb3BpZWQpCisgICAgICAg ICAgICAgICAgICAgICAgcC0+bnJvd3MgPSAwOworICAgICAgICAgICAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgaW50 IGhlaWdodF9jb3BpZWQgPSAoci0+ZGVzaXJlZF95ICsgci0+aGVpZ2h0CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gcC0+ZGVzaXJlZF95KTsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgcC0+Y3VycmVudF92cG9zICs9IG5yb3dzX2NvcGllZDsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgcC0+ZGVzaXJlZF92cG9zICs9IG5yb3dzX2NvcGllZDsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgcC0+bnJvd3MgLT0gbnJvd3NfY29waWVkOworICAg ICAgICAgICAgICAgICAgICAgICAgICBwLT5jdXJyZW50X3kgKz0gaGVpZ2h0X2NvcGllZDsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgcC0+ZGVzaXJlZF95ICs9IGhlaWdodF9jb3BpZWQ7Cisg ICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmhlaWdodCAtPSBoZWlnaHRfY29waWVkOworICAg ICAgICAgICAgICAgICAgICAgICAgICB0cnVuY2F0ZWRfcCA9IDE7CisgICAgICAgICAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgIGlmIChyLT5jdXJyZW50X3kgIT0gci0+ZGVzaXJlZF95CisgICAgICAgICAgICAgICAgLyog VGhlIGNvbmRpdGlvbiBiZWxvdyBpcyBlcXVpdmFsZW50IHRvCisgICAgICAgICAgICAgICAgICAg KChwLT5jdXJyZW50X3kgPj0gci0+ZGVzaXJlZF95CisgICAgICAgICAgICAgICAgICAgICAmJiBw LT5jdXJyZW50X3kgPCByLT5kZXNpcmVkX3kgKyByLT5oZWlnaHQpCisgICAgICAgICAgICAgICAg ICAgIHx8IChwLT5jdXJyZW50X3kgKyBwLT5oZWlnaHQgPiByLT5kZXNpcmVkX3kKKyAgICAgICAg ICAgICAgICAgICAgICAgICYmIChwLT5jdXJyZW50X3kgKyBwLT5oZWlnaHQKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICA8PSByLT5kZXNpcmVkX3kgKyByLT5oZWlnaHQpKSkKKyAgICAgICAg ICAgICAgICAgICBiZWNhdXNlIHdlIGhhdmUgMCA8IHAtPmhlaWdodCA8PSByLT5oZWlnaHQuICov CisgICAgICAgICAgICAgICAgJiYgcC0+Y3VycmVudF95IDwgci0+ZGVzaXJlZF95ICsgci0+aGVp Z2h0CisgICAgICAgICAgICAgICAgJiYgcC0+Y3VycmVudF95ICsgcC0+aGVpZ2h0ID4gci0+ZGVz aXJlZF95KQorICAgICAgICAgICAgICBwLT5ucm93cyA9IDA7CisgICAgICAgICAgICAvKiBSZW9y ZGVyIHJ1bnMgYnkgY29waWVkIHBpeGVsIGxpbmVzIGlmIHRydW5jYXRlZC4gKi8KKyAgICAgICAg ICAgIGlmICh0cnVuY2F0ZWRfcCAmJiBwLT5ucm93cyA+IDApCisgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICBpbnQgayA9IG5ydW5zIC0gMTsKKyAgICAgICAgICAgICAgICB3aGlsZSAo bWNfcnVuc1trXS0+bnJvd3MgPT0gMCB8fCBtY19ydW5zW2tdLT5oZWlnaHQgPCBwLT5oZWlnaHQp CisgICAgICAgICAgICAgICAgICBrLS07CisgICAgICAgICAgICAgICAgbWVtbW92ZSAobWNfcnVu cyArIGosIG1jX3J1bnMgKyBqICsgMSwgKGsgLSBqKSAqIHNpemVvZiAoKm1jX3J1bnMpKTsKKyAg ICAgICAgICAgICAgICBtY19ydW5zW2tdID0gcDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAg IH0KKyAgICAgICAgLyogQXNzaWduIG1hdHJpeCByb3dzLiAqLworICAgICAgICBmb3IgKGogPSAw OyBqIDwgci0+bnJvd3M7ICsraikKKyAgICAgICAgICB7CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5 cGhfcm93ICpmcm9tLCAqdG87CisgICAgICAgICAgICBib29sIHRvX292ZXJsYXBwZWRfcDsKKyAg ICAgICAgICAgIHRvID0gTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIHItPmRlc2lyZWRfdnBv cyArIGopOworICAgICAgICAgICAgZnJvbSA9IE1BVFJJWF9ST1cgKGRlc2lyZWRfbWF0cml4LCBy LT5kZXNpcmVkX3Zwb3MgKyBqKTsKKyAgICAgICAgICAgIHRvX292ZXJsYXBwZWRfcCA9IHRvLT5v dmVybGFwcGVkX3A7CisgICAgICAgICAgICBmcm9tLT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfc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ICE9IDApCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPV19TVEFSVF9CWVRFUE9TIChjdXJyZW50 X3JvdyAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogLTE7Cisg IGludCBwcmV2X21hdHJpeF9yb3dfZW5kX2J5dGVwb3MgPSAodnBvcyAhPSAwKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XX0VORF9CWVRFUE9TIChjdXJy ZW50X3JvdyAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IC0xOwor ICBpbnQgbWF0cml4X3Jvd19zdGFydF9ieXRlcG9zID0gTUFUUklYX1JPV19TVEFSVF9CWVRFUE9T IChkZXNpcmVkX3Jvdyk7CisgIGludCBtYXRyaXhfcm93X2VuZF9ieXRlcG9zID0gTUFUUklYX1JP V19FTkRfQllURVBPUyAoZGVzaXJlZF9yb3cpOworICAvKiBUaGUgZmlyc3QgY29uZGl0aW9uIHRl c3RzIGZvciBhIHNvbGl0YXJ5IHJvdyBjb250YWluaW5nIFpWLCBwcmVjZWRlZCBieSBhCisgIHJv dyBjb250YWluaW5nIGEgcGVudWx0aW1hdGUgZ2x5cGggd2l0aCBhIGNoYXJwb3Mgb2YgWlYgLSAx IGZvbGxvd2VkIGJ5IGFuIGVuZAorICBvZiByb3cgc3BhY2UgZ2x5cGggd2l0aCBhIGNoYXJwb3Mg b2YgMC4gIFRoZSBvdGhlciBjb25kaXRpb25zIHRlc3QgZm9yIGFuIGVtcHR5CisgIGJ1ZmZlciAo bm90IG5hcnJvd2VkKSwgb3IgYW4gZW1wdHkgbmFycm93ZWQgYnVmZmVyLiAqLworICBib29sIHJv d19hdF96dl9wID0gKCh2cG9zICE9IDAKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgKGN1cnJl bnRfcm93IC0gMSktPnVzZWRbVEVYVF9BUkVBXSA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAg JiYgcHJldl9tYXRyaXhfcm93X3N0YXJ0X2J5dGVwb3MgIT0gcHJldl9tYXRyaXhfcm93X2VuZF9i eXRlcG9zCisgICAgICAgICAgICAgICAgICAgICAgICYmICEoY3VycmVudF9yb3cgLSAxKS0+ZW5k c19hdF96dl9wCisgICAgICAgICAgICAgICAgICAgICAgICYmIG1hdHJpeF9yb3dfc3RhcnRfYnl0 ZXBvcyA9PSBtYXRyaXhfcm93X2VuZF9ieXRlcG9zCisgICAgICAgICAgICAgICAgICAgICAgICYm IGRlc2lyZWRfcm93LT5lbmRzX2F0X3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgfHwgKCgo aGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID09IDEpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICB8fCAoaGVhZGVyX2xpbmVfZm9ybWF0ID09IDAgJiYgdnBvcyA9PSAwKSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgYnVmZmVyX25hcnJvd2VkX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgYm9iX3Jlc3BlY3RfbmFycm93ID09IGVvYl9yZXNwZWN0X25hcnJvdykK KyAgICAgICAgICAgICAgICAgICAgICB8fCAoKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZw b3MgPT0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChoZWFkZXJfbGluZV9mb3Jt YXQgPT0gMCAmJiB2cG9zID09IDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBib2Jf ZGlzcmVnYXJkX25hcnJvdyA9PSBlb2JfZGlzcmVnYXJkX25hcnJvdykpOworICAvKiBJZiBsaW5l LW51bWJlcnMgYXJlIGFjdGl2ZSwgdGhlbiBzcGFjZSBnbHlwaCBwYWRkaW5nIGVxdWFsIHRvIGl0 cyB3aWR0aAorICBjb3VudGVkIGluIEhQT1MgYXJlIGZvbGxvd2VkIGJ5IGEgc2luZ2xlIHJvdyBl bmQgc3BhY2UgZ2x5cGguICBMaW5lIG51bWJlcgorICBwYWRkaW5nIHNwYWNlIGdseXBocyBoYXZl IGEgY2hhcnBvcyBvZiAtMSwgd2hlcmVhcyB0aGUgZW5kIG9mIHJvdyBzcGFjZSBnbHlwaAorICBo YXMgYSBjaGFycG9zIG9mIDAuICBJZiBsaW5lIG51bWJlcnMgYXJlIGluYWN0aXZlLCB0aGVuIHRo ZSByb3cgd2lsbCBjb250YWluCisgIGEgc29saXRhcnkgc3BhY2UgZ2x5cGggd2l0aCBhIGNoYXJw b3Mgb2YgLTEuICovCisgIGJvb2wgcm93X2JleW9uZF96dl9wID0gKG1hdHJpeF9yb3dfc3RhcnRf Ynl0ZXBvcyA9PSBtYXRyaXhfcm93X2VuZF9ieXRlcG9zCisgICAgICAgICAgICAgICAgICAgICAg ICAgICYmICFyb3dfYXRfenZfcCk7CisgIHJldHVybiAocm93X2F0X3p2X3ApCisgICAgICAgICAg ID8gQVRfWlYKKyAgICAgICAgIDogKHJvd19iZXlvbmRfenZfcCkKKyAgICAgICAgICAgPyBQT1NU X1pWCisgICAgICAgICA6IFBSRV9aVjsKK30KKworLyogVXBkYXRlIHRoZSBkaXNwbGF5IG9mIHRo ZSB0ZXh0IGFyZWEgb2Ygcm93IFZQT1MgaW4gd2luZG93IFcuCisgICBWYWx1ZSBpcyB0cnVlIGlm IGRpc3BsYXkgaGFzIGNoYW5nZWQuICovCitzdGF0aWMgYm9vbAorbWNfdXBkYXRlX3RleHRfYXJl YSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqdXBkYXRlZF9yb3csIGludCB2 cG9zLAorICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX21hdHJpeCAqY3Vyc29yX21h dHJpeCwKKyAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19lc3NlbnRpYWxzIGVzc2VudGlh bHMsIGJvb2wgZHJhd19wK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fcG9zaXRpb24gPSAgbWNf cm93X3Bvc2l0aW9uICh3LCB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZGVzaXJlZF9yb3cK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBjdXJyZW50X3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgZGVzaXJlZF9yb3csIHZwb3MpOworICAvKiBJZiByb3dzIGFyZSBh dCBkaWZmZXJlbnQgWCBvciBZLCBvciByb3dzIGhhdmUgZGlmZmVyZW50IGhlaWdodCwKKyAgICAg b3IgdGhlIGN1cnJlbnQgcm93IGlzIG1hcmtlZCBpbnZhbGlkLCB3cml0ZSB0aGUgZW50aXJlIGxp bmUuICovCisgIGlmICghY3VycmVudF9yb3ctPmVuYWJsZWRfcAorICAgICAgfHwgZGVzaXJlZF9y b3ctPnkgIT0gY3VycmVudF9yb3ctPnkKKyAgICAgIHx8IGRlc2lyZWRfcm93LT5hc2NlbnQgIT0g Y3VycmVudF9yb3ctPmFzY2VudAorICAgICAgfHwgZGVzaXJlZF9yb3ctPnBoeXNfYXNjZW50ICE9 IGN1cnJlbnRfcm93LT5waHlzX2FzY2VudAorICAgICAgfHwgZGVzaXJlZF9yb3ctPnBoeXNfaGVp Z2h0ICE9IGN1cnJlbnRfcm93LT5waHlzX2hlaWdodAorICAgICAgfHwgZGVzaXJlZF9yb3ctPnZp c2libGVfaGVpZ2h0ICE9IGN1cnJlbnRfcm93LT52aXNpYmxlX2hlaWdodAorICAgICAgfHwgY3Vy cmVudF9yb3ctPm92ZXJsYXBwZWRfcAorICAgICAgLyogVGhpcyBuZXh0IGxpbmUgaXMgbmVjZXNz YXJ5IGZvciBjb3JyZWN0bHkgcmVkcmF3aW5nCisgICAgICAgICBtb3VzZS1mY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ZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpOworICAgICAgaWYgKGRl c2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgIHsKKyAgICAgICAgICBibG9ja19p bnB1dCAoKTsKKyAgICAgICAgICBpbnQgbGVuID0gZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVB XTsKKyAgICAgICAgICBpbnQgaHBvcyA9IGRlc2lyZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXSAt IHVwZGF0ZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICB3LT5vdXRwdXRfY3Vy c29yLnggPQorICAgICAgICAgICAgbWNfZHJhd19nbHlwaHMgKHcsIGRlc2lyZWRfbWF0cml4LCB1 cGRhdGVkX3Jvdywgdy0+b3V0cHV0X2N1cnNvci54LAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgIFRFWFRfQVJFQSwgaHBvcywgaHBvcyArIGxlbiwgRFJBV19OT1JNQUxfVEVYVCwgMCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCBsc2wsIGdseXBoX2ZsYXZvciwgY3Vyc29y X3R5cGUsIHdkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZl X3AsIGN1cnNvcl9nY19wLCBNQ19EUkFXX0dMWVBIX1NUUklORywKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICBkcmF3X3ApOworICAgICAgICAgIHctPm91dHB1dF9jdXJzb3IuaHBvcyArPSBs ZW47CisgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgfQorICAgICAgLyogQ2xl YXIgdG8gZW5kIG9mIHdpbmRvdy4gKi8KKyAgICAgIGlmIChkcmF3X3ApCisgICAgICAgIHJpZi0+ Y2xlYXJfZW5kX29mX2xpbmUgKHcsIHVwZGF0ZWRfcm93LCBURVhUX0FSRUEsIC0xKTsKKyAgICAg IGNoYW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NDUklCRV9PTkUpOworICAgIH0KKyAgICBlbHNl CisgICAgICB7CisgICAgICAgIGludCBzdG9wLCBpLCB4OworICAgICAgICBzdHJ1Y3QgZ2x5cGgg KmN1cnJlbnRfZ2x5cGggPSBjdXJyZW50X3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICAg IHN0cnVjdCBnbHlwaCAqZGVzaXJlZF9nbHlwaCA9IGRlc2lyZWRfcm93LT5nbHlwaHNbVEVYVF9B UkVBXTsKKyAgICAgICAgYm9vbCBvdmVybGFwcGluZ19nbHlwaHNfcCA9IGN1cnJlbnRfcm93LT5j b250YWluc19vdmVybGFwcGluZ19nbHlwaHNfcDsKKyAgICAgICAgaW50IGRlc2lyZWRfc3RvcF9w b3MgPSBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdOworICAgICAgICBib29sIGFib3J0X3Nr aXBwaW5nID0gMDsKKyAgICAgICAgLyogSWYgdGhlIGRlc2lyZWQgcm93IGV4dGVuZHMgaXRzIGZh Y2UgdG8gdGhlIHRleHQgYXJlYSBlbmQsIGFuZCB1bmxlc3MgdGhlCisgICAgICAgIGN1cnJlbnQg cm93IGFsc28gZG9lcyBzbyBhdCB0aGUgc2FtZSBwb3NpdGlvbiwgbWFrZSBzdXJlIHdlIHdyaXRl IGF0IGxlYXN0IG9uZQorICAgICAgICBnbHlwaCwgc28gdGhhdCB0aGUgZmFjZSBleHRlbnNpb24g YWN0dWFsbHkgdGFrZXMgcGxhY2UuICovCisgICAgICAgIGlmIChNQVRSSVhfUk9XX0VYVEVORFNf RkFDRV9QIChkZXNpcmVkX3JvdykKKyAgICAgICAgICAgICYmIChkZXNpcmVkX3N0b3BfcG9zIDwg Y3VycmVudF9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgIHx8IChkZXNpcmVk X3N0b3BfcG9zID09IGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAg ICAgICAgJiYgIU1BVFJJWF9ST1dfRVhURU5EU19GQUNFX1AgKGN1cnJlbnRfcm93KSkpKQorICAg ICAgICAgIC0tZGVzaXJlZF9zdG9wX3BvczsKKyAgICAgICAgc3RvcCA9IG1pbiAoY3VycmVudF9y b3ctPnVzZWRbVEVYVF9BUkVBXSwgZGVzaXJlZF9zdG9wX3Bvcyk7CisgICAgICAgIGkgPSAwOwor ICAgICAgICB4ID0gZGVzaXJlZF9yb3ctPng7CisgICAgICAgIGludCBjbGVhcl90b194ID0gMDsK KworICAgICAgICAvKiBMb29wIG92ZXIgZ2x5cGhzIHRoYXQgY3VycmVudCBhbmQgZGVzaXJlZCBy b3cgbWF5IGhhdmUgaW4gY29tbW9uLiAqLworICAgICAgICB3aGlsZSAoaSA8IHN0b3ApCisgICAg ICAgICAgeworICAgICAgICAgICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZCA9IDA7CisgICAg ICAgICAgICBib29sIGNhbl9za2lwX3AgPSAhYWJvcnRfc2tpcHBpbmc7CisgICAgICAgICAgICAv KiBTa2lwIG92ZXIgZ2x5cGhzIHRoYXQgYm90aCByb3dzIGhhdmUgaW4gY29tbW9uLiAgVGhlc2Ug ZG9uJ3QgaGF2ZQorICAgICAgICAgICAgdG8gYmUgd3JpdHRlbi4gIFdlIGNhbid0IHNraXAgaWYg dGhlIGxhc3QgY3VycmVudCBnbHlwaCBvdmVybGFwcyB0aGUKKyAgICAgICAgICAgIGdseXBoIHRv IGl0cyByaWdodC4gIEZvciBleGFtcGxlLCBjb25zaWRlciBhIGN1cnJlbnQgcm93IG9mIGBpZicg d2l0aAorICAgICAgICAgICAgdGhlIGBmJyBpbiBDb3VyaWVyIGJvbGQgc28gdGhhdCBpdCBvdmVy bGFwcyB0aGUgYCAnIHRvIGl0cyByaWdodC4KKyAgICAgICAgICAgIElmIHRoZSBkZXNpcmVkIHJv dyBpcyBgICcsIHdlIHdvdWxkIHNraXAgb3ZlciB0aGUgc3BhY2UgYWZ0ZXIgdGhlCisgICAgICAg ICAgICBgaWYnIGFuZCB0aGVyZSB3b3VsZCByZW1haW4gYSBwaXhlbCBmcm9tIHRoZSBgZicgb24g dGhlIHNjcmVlbi4gKi8KKyAgICAgICAgICAgIGlmIChvdmVybGFwcGluZ19nbHlwaHNfcCAmJiBp ID4gMCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5 cGggPSAmY3VycmVudF9yb3ctPmdseXBoc1tURVhUX0FSRUFdW2kgLSAxXTsKKyAgICAgICAgICAg ICAgICBpbnQgbGVmdCwgcmlnaHQ7CisgICAgICAgICAgICAgICAgcmlmLT5nZXRfZ2x5cGhfb3Zl cmhhbmdzIChnbHlwaCwgWEZSQU1FICh3LT5mcmFtZSksICZsZWZ0LCAmcmlnaHQpOworICAgICAg ICAgICAgICAgIGNhbl9za2lwX3AgPSAocmlnaHQgPT0gMCAmJiAhYWJvcnRfc2tpcHBpbmcpOwor ICAgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoY2FuX3NraXBfcCkKKyAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgIGludCBzdGFydF9ocG9zID0gaTsKKyAgICAgICAgICAgICAg ICB3aGlsZSAoaSA8IHN0b3AKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgR0xZUEhfRVFVQUxf UCAoZGVzaXJlZF9nbHlwaCwgY3VycmVudF9nbHlwaCkpCisgICAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgICAgICsrYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZDsKKyAgICAgICAg ICAgICAgICAgICAgaWYgKGFycmF5X2dseXBoc19za2lwcGVkLmFsbG9jYXRlZCA8IGFycmF5X2ds eXBoc19za2lwcGVkLnVzZWQpCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgICAgICAgaW50IG9sZF9hbGxvYyA9IGFycmF5X2dseXBoc19za2lwcGVkLmFsbG9jYXRl ZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBuZXdfZWx0cyA9IGFycmF5X2dseXBoc19z a2lwcGVkLnVzZWQgLSBhcnJheV9nbHlwaHNfc2tpcHBlZC5hbGxvY2F0ZWQ7CisgICAgICAgICAg ICAgICAgICAgICAgICBhcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVkID0KKyAgICAgICAgICAg ICAgICAgICAgICAgICAgeHBhbGxvYyAoYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmFycmF5X2dseXBoc19za2lwcGVkLmFs bG9jYXRlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2VsdHMsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElOVF9NQVgsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiAqYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBl ZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBtZW1zZXQgKGFycmF5X2dseXBoc19za2lwcGVk LnNraXBwZWQgKyBvbGRfYWxsb2MsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAoYXJyYXlfZ2x5cGhzX3NraXBwZWQuYWxsb2NhdGVkIC0gb2xkX2FsbG9jKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAqIHNpemVvZiAqYXJyYXlfZ2x5cGhzX3NraXBwZWQu c2tpcHBlZCk7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBp bnQgbnRoID0gYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZCAtIDE7CisgICAgICAgICAgICAgICAg ICAgIGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbbnRoXS54ID0geDsKKyAgICAgICAgICAg ICAgICAgICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZFtudGhdLmhwb3MgPSBpOworICAg ICAgICAgICAgICAgICAgICBhcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVkW250aF0uZW5hYmxl ZF9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgeCArPSBkZXNpcmVkX2dseXBoLT5waXhl bF93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgKytkZXNpcmVkX2dseXBoLCArK2N1cnJlbnRf Z2x5cGgsICsraTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvKiBDb25z aWRlciB0aGUgY2FzZSB0aGF0IHRoZSBjdXJyZW50IHJvdyBjb250YWlucyAieHh4IHBwcCBnZ2ci IGluCisgICAgICAgICAgICAgICAgaXRhbGljIENvdXJpZXIgZm9udCwgYW5kIHRoZSBkZXNpcmVk IHJvdyBpcyAieHh4IGdnZyIuICBUaGUgY2hhcmFjdGVyIGBwJworICAgICAgICAgICAgICAgIGhh cyBsYmVhcmluZywgYGcnIGhhcyBub3QuICBUaGUgbG9vcCBhYm92ZSB3aWxsIHN0b3AgaW4gZnJv bnQgb2YgdGhlCisgICAgICAgICAgICAgICAgZmlyc3QgYHAnIGluIHRoZSBjdXJyZW50IHJvdy4g IElmIHdlIHdvdWxkIHN0YXJ0IHdyaXRpbmcgZ2x5cGhzIHRoZXJlLCB3ZQorICAgICAgICAgICAg ICAgIHdvdWxkbid0IGVyYXNlIHRoZSBsYmVhcmluZyBvZiB0aGUgYHAnLiAgVGhlIHJlc3Qgb2Yg dGhlIGxiZWFyaW5nIHByb2JsZW0KKyAgICAgICAgICAgICAgICBpcyB0aGVuIHRha2VuIGNhcmUg b2YgYnkgZHJhd19nbHlwaHMuICovCisgICAgICAgICAgICAgICAgaWYgKG92ZXJsYXBwaW5nX2ds eXBoc19wCisgICAgICAgICAgICAgICAgICAgICYmIGkgPiAwCisgICAgICAgICAgICAgICAgICAg ICYmIGkgPCBjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAg ICYmIChjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdICE9IGRlc2lyZWRfcm93LT51c2VkW1RF WFRfQVJFQV0pKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpbnQg bGVmdCwgcmlnaHQ7CisgICAgICAgICAgICAgICAgICAgIHJpZi0+Z2V0X2dseXBoX292ZXJoYW5n cyAoY3VycmVudF9nbHlwaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBYRlJBTUUgKHct PmZyYW1lKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmbGVmdCwgJnJpZ2h0KTsKKyAg ICAgICAgICAgICAgICAgICAgd2hpbGUgKGxlZnQgPiAwICYmIGkgPiAwKQorICAgICAgICAgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC0taSwgLS1kZXNpcmVkX2dseXBo LCAtLWN1cnJlbnRfZ2x5cGg7CisgICAgICAgICAgICAgICAgICAgICAgICB4IC09IGRlc2lyZWRf Z2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICAgICAgICAgICAgbGVmdCAtPSBkZXNp cmVkX2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgICAgICAgIC8qIEFib3J0IHRoZSBza2lwcGluZyBhbGdvcml0aG0gaWYgd2UgZW5kIHVw IGJlZm9yZQorICAgICAgICAgICAgICAgICAgICAgICBvdXIgc3RhcnRpbmcgcG9pbnQsIHRvIGF2 b2lkIGxvb3BpbmcgKGJ1ZyMxMDcwKS4KKyAgICAgICAgICAgICAgICAgICAgICAgVGhpcyBjYW4g aGFwcGVuIHdoZW4gdGhlIGxiZWFyaW5nIGlzIGxhcmdlciB0aGFuCisgICAgICAgICAgICAgICAg ICAgICAgIHRoZSBwaXhlbCB3aWR0aC4gKi8KKyAgICAgICAgICAgICAgICAgICAgYWJvcnRfc2tp cHBpbmcgPSAoaSA8IHN0YXJ0X2hwb3MpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgICB9CisgICAgICAgICAgICAvKiBUcnkgdG8gYXZvaWQgd3JpdGluZyB0aGUgZW50aXJlIHJl c3Qgb2YgdGhlIGRlc2lyZWQgcm93CisgICAgICAgICAgICAgICBieSBsb29raW5nIGZvciBhIHJl c3luYyBwb2ludC4gIFRoaXMgbWFpbmx5IHByZXZlbnRzCisgICAgICAgICAgICAgICBtb2RlIGxp bmUgZmxpY2tlcmluZyBpbiB0aGUgY2FzZSB0aGUgbW9kZSBsaW5lIGlzIGluCisgICAgICAgICAg ICAgICBmaXhlZC1waXRjaCBmb250LCB3aGljaCBpdCB1c3VhbGx5IHdpbGwgYmUuICovCisgICAg ICAgICAgICBpZiAoaSA8IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICBpbnQgc3RhcnRfeCA9IHgsIHN0YXJ0X2hwb3MgPSBpOwor ICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqc3RhcnQgPSBkZXNpcmVkX2dseXBoOworICAg ICAgICAgICAgICAgIGludCBjdXJyZW50X3ggPSB4OworICAgICAgICAgICAgICAgIGJvb2wgc2tp cF9maXJzdF9wID0gIWNhbl9za2lwX3A7CisgICAgICAgICAgICAgICAgLyogRmluZCB0aGUgbmV4 dCBnbHlwaCB0aGF0J3MgZXF1YWwgYWdhaW4uICovCisgICAgICAgICAgICAgICAgd2hpbGUgKGkg PCBzdG9wCisgICAgICAgICAgICAgICAgICAgICAgICYmIChza2lwX2ZpcnN0X3AKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgIHx8ICFHTFlQSF9FUVVBTF9QIChkZXNpcmVkX2dseXBoLCBjdXJy ZW50X2dseXBoKSkKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgeCA9PSBjdXJyZW50X3gpCisg ICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHggKz0gZGVzaXJlZF9nbHlw aC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRfeCArPSBjdXJyZW50 X2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgKytkZXNpcmVkX2dseXBo LCArK2N1cnJlbnRfZ2x5cGgsICsraTsKKyAgICAgICAgICAgICAgICAgICAgc2tpcF9maXJzdF9w ID0gMDsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBmb3IgKGludCBlbHQg PSAwOworICAgICAgICAgICAgICAgICAgICAgZWx0IDwgYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNl ZDsKKyAgICAgICAgICAgICAgICAgICAgICsrZWx0KQorICAgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgICBpbnQgeCA9IGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbZWx0 XS54OworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGFycmF5X2dseXBoc19za2lwcGVk LnNraXBwZWRbZWx0XS5ocG9zOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnRh cmdldF9nbHlwaCA9CisgICAgICAgICAgICAgICAgICAgICAgbWNfZ2V0X2N1cnNvcl9nbHlwaCAo dywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCBocG9zLCB2cG9zKTsKKyAgICAgICAgICAg ICAgICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgICAgICAgICAgICAgICAgZnByaW50ZiAoc3Rk ZXJyLCAiU0tJUFBFRDogIHZwb3MgKCVkKSB8IGNoYXIgKCVkLyVzKSB8IHg6ICglZCkgfCBocG9z ICglZC8lZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9z LCB0YXJnZXRfZ2x5cGgtPnUuY2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBtY19jaGFyX3RvX3N0cmluZyAodGFyZ2V0X2dseXBoLT51LmNoKSwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHgsIGhwb3MsIHVwZGF0ZWRfcm93LT51c2VkW1RF WFRfQVJFQV0gLSAxKTsKKyAgICAgICAgICAgICAgICAgICAgbWNfZHJhd19yb3cgKHcsIGRlc2ly ZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBoLCB4LCAxLCB2cG9zLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93 X3Bvc2l0aW9uLCBkcmF3X3AsIFNLSVBQRUQpOworICAgICAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgICAgIGlmIChpID09IHN0YXJ0X2hwb3MgfHwgeCAhPSBjdXJyZW50X3gpCisgICAgICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGkgPSBzdGFydF9ocG9zOworICAgICAg ICAgICAgICAgICAgICB4ID0gc3RhcnRfeDsKKyAgICAgICAgICAgICAgICAgICAgZGVzaXJlZF9n bHlwaCA9IHN0YXJ0OworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgICAgICBvdXRwdXRfY3Vyc29yX3RvICh3LCB2cG9zLCBzdGFydF9o cG9zLCBkZXNpcmVkX3Jvdy0+eSwgc3RhcnRfeCk7CisgICAgICAgICAgICAgICAgLyogUmUtZHJh dyBhIHBvcnRpb24gb2YgdGhlIHJvdy4gKi8KKyAgICAgICAgICAgICAgICBpZiAoZGVidWdfcCkK KyAgICAgICAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIlJFRFJBVyBTRUdNRU5UOlxuXAor ICAgICAgICAgICAgICAgICAgICB2cG9zICglZCkgfCBjaGFyICglZC8lcykgfCB4OiAoJWQpIHwg aHBvcyAoJWQvJWQpIHwgbGVuZ3RoICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgIHZwb3Ms IHN0YXJ0LT51LmNoLCBtY19jaGFyX3RvX3N0cmluZyAoc3RhcnQtPnUuY2gpLAorICAgICAgICAg ICAgICAgICAgICBzdGFydF94LCBzdGFydF9ocG9zLCB1cGRhdGVkX3Jvdy0+dXNlZFtURVhUX0FS RUFdIC0gMSwgaSAtIHN0YXJ0X2hwb3MpOworICAgICAgICAgICAgICAgIGJsb2NrX2lucHV0ICgp OworICAgICAgICAgICAgICAgIGludCBsZW4gPSBpIC0gc3RhcnRfaHBvczsKKyAgICAgICAgICAg ICAgICBpbnQgaHBvcyA9IHN0YXJ0IC0gdXBkYXRlZF9yb3ctPmdseXBoc1tURVhUX0FSRUFdOwor ICAgICAgICAgICAgICAgIHctPm91dHB1dF9jdXJzb3IueCA9CisgICAgICAgICAgICAgICAgICBt Y19kcmF3X2dseXBocyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB3LT5vdXRwdXRf Y3Vyc29yLngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVEVYVF9BUkVBLCBo cG9zLCBocG9zICsgbGVuLCBEUkFXX05PUk1BTF9URVhULAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDAsIHZwb3MsIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2Qs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVfcCwg Y3Vyc29yX2djX3AsIE1DX0RSQVdfR0xZUEhfU1RSSU5HLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGRyYXdfcCk7CisgICAgICAgICAgICAgICAgdy0+b3V0cHV0X2N1cnNvci5o cG9zICs9IGxlbjsKKyAgICAgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgICAg ICAgICAgIG1jX2RyYXdfcm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHN0YXJ0 LCBzdGFydF94LCBpIC0gc3RhcnRfaHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg dnBvcywgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBkcmF3X3AsIFND UklCRV9UV08pOworICAgICAgICAgICAgICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAgICAgICAg IH0KKyAgICAgICAgICB9CisKKyAgICAgICAgLyogV3JpdGUgdGhlIHJlc3QuICovCisgICAgICAg IGlmIChpIDwgZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgICAgICB7CisgICAg ICAgICAgICBvdXRwdXRfY3Vyc29yX3RvICh3LCB2cG9zLCBpLCBkZXNpcmVkX3Jvdy0+eSwgeCk7 CisgICAgICAgICAgICBpZiAoZGVidWdfcCkKKyAgICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJy LCAiRFJBVyBSRU1BSU5ERVIgT0YgVEhFIFJPVzpcblwKKyAgICAgICAgICAgICAgICB2cG9zICgl ZCkgfCBjaGFyICglZC8lcykgfCB4OiAoJWQpIHwgaHBvcyAoJWQvJWQpIHwgbGVuZ3RoICglZClc biIsCisgICAgICAgICAgICAgICAgdnBvcywgZGVzaXJlZF9nbHlwaC0+dS5jaCwgbWNfY2hhcl90 b19zdHJpbmcgKGRlc2lyZWRfZ2x5cGgtPnUuY2gpLAorICAgICAgICAgICAgICAgIHgsIGksIGRl c2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxLCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FS RUFdIC0gaSk7CisgICAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgIGludCBs ZW4gPSBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gaTsKKyAgICAgICAgICAgIGludCBo cG9zID0gZGVzaXJlZF9nbHlwaCAtIHVwZGF0ZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAg ICAgICAgICAgIHctPm91dHB1dF9jdXJzb3IueCA9CisgICAgICAgICAgICAgIG1jX2RyYXdfZ2x5 cGhzICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHctPm91dHB1dF9jdXJzb3IueCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRFWFRfQVJFQSwgaHBvcywgaHBvcyArIGxl biwgRFJBV19OT1JNQUxfVEVYVCwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZw b3MsIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBjdXJzb3JfZ2NfcCwgTUNfRFJBV19H TFlQSF9TVFJJTkcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3X3ApOworICAg ICAgICAgICAgdy0+b3V0cHV0X2N1cnNvci5ocG9zICs9IGxlbjsKKyAgICAgICAgICAgIHVuYmxv Y2tfaW5wdXQgKCk7CisgICAgICAgICAgICAvKiBGSVhNRTogIEFsdGhvdWdoIHdlIG5lZWQgdG8g dXBkYXRlIHRoZSBjYWNoZSBiZXR3ZWVuIHRoZSBlbmQgb2YKKyAgICAgICAgICAgIHVwZGF0ZWRf cm93IGFuZCB0aGUgcmlnaHQgd2luZG93IGVkZ2UsIGl0IGlzIG5vdCBuZWNlc3NhcnkgdG8gZHJh dworICAgICAgICAgICAgdGhvc2UgZmFrZSBjdXJzb3JzLiBBbHRob3VnaCB3ZSBtYXkgbm90IGJl IGFibGUgdG8gc2VlIGl0IHdpdGggdGhlCisgICAgICAgICAgICBuYWtlZCBleWUsIHRob3NlIGZh a2UgY3Vyc29ycyBhcmUgYmVpbmcgc3VwZXJpbXBvc2VkIG9uIHRoZSBleGlzdGluZworICAgICAg ICAgICAgZmFrZSBjdXJzb3JzIHRoYXQgZG8gbm90IGdldCBlcmFzZWQgYnkgdGhlIGNvZGUgaW4g dGhlIHNlY3Rpb24gYmVsb3cuCisgICAgICAgICAgICBJdCB3b3VsZCBiZSBiZXR0ZXIgdG8gb25s eSB1cGRhdGUgdGhlIGNhY2hlIGFuZCBzdXBwcmVzcyBkb3VibGUtZHJhd2luZworICAgICAgICAg ICAgdGhlIGZha2UgY3Vyc29ycyBmb3IgdGhlIGFmb3JlbWVudGlvbmVkIGFyZWEgYXQgaXNzdWUu ICovCisgICAgICAgICAgICBtY19kcmF3X3JvdyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRf cm93LCBkZXNpcmVkX2dseXBoLCB4LAorICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2lyZWRf cm93LT51c2VkW1RFWFRfQVJFQV0gLSBpLCB2cG9zLCBjdXJzb3JfbWF0cml4LAorICAgICAgICAg ICAgICAgICAgICAgICAgIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgZHJhd19wLCBTQ1JJQkVf VEhSRUUpOworICAgICAgICAgICAgY2hhbmdlZF9wID0gMTsKKyAgICAgICAgICB9CisgICAgICAg ICAgLyogRXZlcnl0aGluZyBhZnRlciB0aGUgcHJldmlvdXMgY2hhbmdlIHJlbWFpbmVkIHRoZSBz YW1lLiAgYGlgIGFuZCBgeGAgd2VyZQorICAgICAgICAgIGluY3JlbWVudGVkIHRvIHRoZSBlbmQg b2YgdGhlIGdseXBoIHJvdy4gIGkgPT0gZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAg ICAgICAgIFRoZSBgdy0+b3V0cHV0X2N1cnNvci54L3kvaHBvcy92cG9zYCBpcyBhdCB0aGUgZW5k IG9mIHRoZSBwcmV2aW91cyBjaGFuZ2UuCisgICAgICAgICAgV2hlbiB0aGlzIHNpdHVhdGlvbiBl eGlzdHMsIHRoZSBkaXN0YW5jZSBiZXR3ZWVuIHRoZSBlbmQgb2YgdGhlIGdseXBoIHJvdyBhbmQK KyAgICAgICAgICB0aGUgcmlnaHQgZWRnZSBvZiB0aGUgd2luZG93IHdpbGwgX25vdF8gYmUgY2xl YXJlZC4gIFRoZXJlZm9yZSwgaXQgaXMgb2theSB0bworICAgICAgICAgIGRyYXcgdGhlIGZsb2F0 aW5nIGdseXBocyBmb3IgdGhlIGhvcml6b250YWwvdmVydGljYWwgcnVsZXJzIGhlcmUuICovCisg ICAgICAgICAgZWxzZSBpZiAoY2hhbmdlZF9wCisgICAgICAgICAgICAgICAgICAgJiYgdy0+b3V0 cHV0X2N1cnNvci5ocG9zICE9IHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIGludCB4ID0gdy0+b3V0cHV0X2N1cnNvci54OworICAgICAg ICAgICAgICBpbnQgaHBvcyA9IHctPm91dHB1dF9jdXJzb3IuaHBvczsKKyAgICAgICAgICAgICAg c3RydWN0IGdseXBoICpzdGFydCA9IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIGRlc2lyZWRfbWF0 cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgdXBkYXRlZF9yb3csIGhwb3MsIHZwb3MpOworICAgICAgICAgICAgICBpZiAody0+b3V0 cHV0X2N1cnNvci54ID09IHVwZGF0ZWRfcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAg ICB4IC09IHN0YXJ0LT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgaWYgKGRlYnVnX3ApCisg ICAgICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiUE9TVC1DSEFOR0VEOiAgdnBvcyAoJWQp IHwgeCAoJWQpIHwgaHBvcyAoJWQvJWQpIHwgY2hhciAoJWQvJXMpXG4iLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgdnBvcywgeCwgaHBvcywgdXBkYXRlZF9yb3ctPnVzZWRbVEVY VF9BUkVBXSAtIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydC0+dS5j aCwgbWNfY2hhcl90b19zdHJpbmcgKHN0YXJ0LT51LmNoKSk7CisgICAgICAgICAgICAgIG1jX2Ry YXdfcm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHN0YXJ0LCB4LAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIGhwb3Ms IHZwb3MsIGN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBlc3NlbnRp YWxzLCByb3dfcG9zaXRpb24sIGRyYXdfcCwgUE9TVF9DSEFOR0VEKTsKKyAgICAgICAgICAgIH0K KyAgICAgICAgICAgIC8qIFRoZXJlIHdlcmUgbm8gY2hhbmdlcyBhbmQgaSA9PSBkZXNpcmVkX3Jv dy0+dXNlZFtURVhUX0FSRUFdICovCisgICAgICAgICAgICBlbHNlIGlmICghY2hhbmdlZF9wKQor ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgICAg ICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJVTkNIQU5HRUQgLS0gV1JJVEUgRU5USVJFIExJTkU6 ICB2cG9zICglZCkgfCByb3ctPnVzZWQgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgdnBvcywgdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpOworICAg ICAgICAgICAgICAgIG1jX2RyYXdfcm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3cs IGRlc2lyZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgZGVzaXJlZF9yb3ctPngsIGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0sIHZwb3Ms CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMs IHJvd19wb3NpdGlvbiwgZHJhd19wLCBVTkNIQU5HRUQpOworICAgICAgICAgICAgICB9CisKKyAg ICAgICAgLyogTWF5YmUgY2xlYXIgdG8gZW5kIG9mIGxpbmUuICovCisgICAgICAgIGlmIChNQVRS SVhfUk9XX0VYVEVORFNfRkFDRV9QIChkZXNpcmVkX3JvdykpCisgICAgICAgICAgeworICAgICAg ICAgICAgLyogSWYgbmV3IHJvdyBleHRlbmRzIHRvIHRoZSBlbmQgb2YgdGhlIHRleHQgYXJlYSwg bm90aGluZworICAgICAgICAgICAgICAgaGFzIHRvIGJlIGNsZWFyZWQsIGlmIGFuZCBvbmx5IGlm IHdlIGRpZCBhIHdyaXRlX2dseXBocworICAgICAgICAgICAgICAgYWJvdmUuICBUaGlzIGlzIG1h ZGUgc3VyZSBieSBzZXR0aW5nIGRlc2lyZWRfc3RvcF9wb3MKKyAgICAgICAgICAgICAgIGFwcHJv cHJpYXRlbHkgYWJvdmUuICovCisgICAgICAgICAgICBlYXNzZXJ0IChpIDwgZGVzaXJlZF9yb3ct PnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAgICAgfHwgKChkZXNpcmVkX3Jvdy0+ dXNlZFtURVhUX0FSRUFdID09IGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgTUFUUklYX1JPV19FWFRFTkRTX0ZBQ0VfUCAoY3VycmVudF9y b3cpKSk7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKE1BVFJJWF9ST1dfRVhURU5E U19GQUNFX1AgKGN1cnJlbnRfcm93KSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyog SWYgb2xkIHJvdyBleHRlbmRzIHRvIHRoZSBlbmQgb2YgdGhlIHRleHQgYXJlYSwgY2xlYXIuICov CisgICAgICAgICAgICAgIGlmIChpID49IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisg ICAgICAgICAgICAgICAgb3V0cHV0X2N1cnNvcl90byAodywgdnBvcywgaSwgZGVzaXJlZF9yb3ct PnksIGRlc2lyZWRfcm93LT5waXhlbF93aWR0aCk7CisgICAgICAgICAgICAgIGlmIChkcmF3X3Ap CisgICAgICAgICAgICAgICAgcmlmLT5jbGVhcl9lbmRfb2ZfbGluZSAodywgdXBkYXRlZF9yb3cs IFRFWFRfQVJFQSwgLTEpOworICAgICAgICAgICAgICBjbGVhcl90b194ID0gLTE7CisgICAgICAg ICAgICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlm IChkZXNpcmVkX3Jvdy0+cGl4ZWxfd2lkdGggPCBjdXJyZW50X3Jvdy0+cGl4ZWxfd2lkdGgpCisg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBPdGhlcndpc2UgY2xlYXIgdG8gdGhl IGVuZCBvZiB0aGUgb2xkIHJvdy4gIEV2ZXJ5dGhpbmcKKyAgICAgICAgICAgICAgICAgICBhZnRl ciB0aGF0IHBvc2l0aW9uIHNob3VsZCBiZSBjbGVhciBhbHJlYWR5LiAqLworICAgICAgICAgICAg ICAgIGludCB4bGltOworICAgICAgICAgICAgICAgIGlmIChpID49IGRlc2lyZWRfcm93LT51c2Vk W1RFWFRfQVJFQV0pCisgICAgICAgICAgICAgICAgICBvdXRwdXRfY3Vyc29yX3RvICh3LCB2cG9z LCBpLCBkZXNpcmVkX3Jvdy0+eSwgZGVzaXJlZF9yb3ctPnBpeGVsX3dpZHRoKTsKKyAgICAgICAg ICAgICAgICAvKiBJZiBjdXJzb3IgaXMgZGlzcGxheWVkIGF0IHRoZSBlbmQgb2YgdGhlIGxpbmUs IG1ha2Ugc3VyZQorICAgICAgICAgICAgICAgICAgIGl0J3MgY2xlYXJlZC4gIE5vd2FkYXlzIHdl IGRvbid0IGhhdmUgYSBwaHlzX2N1cnNvcl9nbHlwaAorICAgICAgICAgICAgICAgICAgIHdpdGgg d2hpY2ggdG8gZXJhc2UgdGhlIGN1cnNvciAoYmVjYXVzZSB0aGlzIG1ldGhvZAorICAgICAgICAg ICAgICAgICAgIGRvZXNuJ3Qgd29yayB3aXRoIGxiZWFyaW5nL3JiZWFyaW5nKSwgc28gd2UgbXVz dCBkbyBpdCB0aGlzIHdheS4gKi8KKyAgICAgICAgICAgICAgICBpZiAodnBvcyA9PSB3LT5waHlz X2N1cnNvci52cG9zCisgICAgICAgICAgICAgICAgICAgICYmIChkZXNpcmVkX3Jvdy0+cmV2ZXJz ZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAgPyAody0+cGh5c19jdXJzb3IuaHBvcyA8IDAp CisgICAgICAgICAgICAgICAgICAgICAgICA6ICh3LT5waHlzX2N1cnNvci5ocG9zID49IGRlc2ly ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pKSkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAgICAgdy0+cGh5c19jdXJzb3Jfb25fcCA9IDA7CisgICAgICAgICAgICAgICAgICAg IHhsaW0gPSAtMTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgICAgICAgeGxpbSA9IGN1cnJlbnRfcm93LT5waXhlbF93aWR0aDsKKyAg ICAgICAgICAgICAgICBpZiAoZHJhd19wKQorICAgICAgICAgICAgICAgICAgcmlmLT5jbGVhcl9l bmRfb2ZfbGluZSAodywgdXBkYXRlZF9yb3csIFRFWFRfQVJFQSwgeGxpbSk7CisgICAgICAgICAg ICAgICAgY2xlYXJfdG9feCA9IHhsaW07CisgICAgICAgICAgICAgICAgY2hhbmdlZF9wID0gMTsK KyAgICAgICAgICAgICAgfQorCisgICAgICAgIGlmICh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ICAgICAgICBpbnQgeCA9IHVwZGF0ZWRfcm93LT5waXhlbF93aWR0aDsKKyAgICAgICAg ICAgIGludCBocG9zID0gdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDE7CisgICAgICAg ICAgICBpbnQgeF9saW1pdCA9IChjbGVhcl90b194ID09IC0xKQorICAgICAgICAgICAgICAgICAg ICAgICAgICA/IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICA6IGNs ZWFyX3RvX3g7CisgICAgICAgICAgICBMaXNwX09iamVjdCBidWYgPSB3LT5jb250ZW50czsKKyAg ICAgICAgICAgIENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgICAgICAgICAgIHN0cnVjdCBidWZmZXIg KmIgPSBYQlVGRkVSIChidWYpOworICAgICAgICAgICAgYm9vbCBmaWxsX2NvbHVtbl90cnVtcHNf cCA9ICghTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gZXNzZW50aWFscy5mY194KTsKKyAgICAgICAgICAgIGlm ICh0cmFjZV9yZWRpc3BsYXlfcCkKKyAgICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNf dXBkYXRlX3RleHRfYXJlYSAoZmxvYXRpbmcpOiAgdnBvcyAoJWQpIHwgeF9saW1pdCAoJWQpXG4i LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZwb3MsIHhfbGltaXQpOworICAgICAg ICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICYmICFOSUxQ IChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQorICAgICAgICAgICAg ICAgICYmIHggPCB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxz LmZjX3ggPj0geAorICAgICAgICAgICAgICAgICYmIHRhcmdldF9nbHlwaCAhPSBOVUxMCisgICAg ICAgICAgICAgICAgJiYgZHJhd19wKQorICAgICAgICAgICAgICBtY19lbmdpbmUgKHcsIGRlc2ly ZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBoLCBURVhUX0FSRUEsCisgICAgICAg ICAgICAgICAgICAgICAgICAgeCwgeF9saW1pdCwgdXBkYXRlZF9yb3ctPnksIGhwb3MsIHZwb3Ms IE1DX0JBUiwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBlc3Nl bnRpYWxzLCByb3dfcG9zaXRpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgZGVidWdfcCA/ IGRlYnVnX2ZnIDogZXNzZW50aWFscy5mY19mZ1tyb3dfcG9zaXRpb25dLAorICAgICAgICAgICAg ICAgICAgICAgICAgIEZJTExfQ09MVU1OLCBkcmF3X3AsIE5PV0hFUkUsIE5PX0NBQ0hFKTsKKyAg ICAgICAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAmJiAh TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAg ICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF9ob3Jpem9u dGFsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAmJiB4IDwgdGV4dF9hcmVhX3dpZHRoCisgICAg ICAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAgICAgICAgICAgICYm IHRhcmdldF9nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICAgICAgJiYgZHJhd19wKQorICAgICAg ICAgICAgICBtY19lbmdpbmUgKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0 X2dseXBoLCBURVhUX0FSRUEsCisgICAgICAgICAgICAgICAgICAgICAgICAgeCwgeF9saW1pdCwg dXBkYXRlZF9yb3ctPnksIGhwb3MsIHZwb3MsIE1DX0hCQVIsIDEsCisgICAgICAgICAgICAgICAg ICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLAorICAgICAg ICAgICAgICAgICAgICAgICAgIGRlYnVnX3AgPyBkZWJ1Z19mZyA6IGVzc2VudGlhbHMuY2hfZmdb cm93X3Bvc2l0aW9uXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBIT1JJWk9OVEFMX1JVTEVS LCBkcmF3X3AsIE5PV0hFUkUsIE5PX0NBQ0hFKTsKKyAgICAgICAgICAgIGlmIChCVUZGRVJQICh3 LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAg ICAgJiYgIWZpbGxfY29sdW1uX3RydW1wc19wCisgICAgICAgICAgICAgICAgJiYgeCA8IHRleHRf YXJlYV93aWR0aAorICAgICAgICAgICAgICAgICYmIHZwb3MgIT0gdy0+Y3Vyc29yLnZwb3MKKyAg ICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA+PSB4CisgICAgICAgICAgICAgICAgJiYgdGFy Z2V0X2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAgICAmJiBkcmF3X3ApCisgICAgICAgICAg ICAgIG1jX2VuZ2luZSAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRfZ2x5 cGgsIFRFWFRfQVJFQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICB4LCB4X2xpbWl0LCB1cGRh dGVkX3Jvdy0+eSwgaHBvcywgdnBvcywgTUNfQkFSLCAxLAorICAgICAgICAgICAgICAgICAgICAg ICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwKKyAgICAgICAgICAg ICAgICAgICAgICAgICBkZWJ1Z19wID8gZGVidWdfZmcgOiBlc3NlbnRpYWxzLmNoX2ZnW3Jvd19w b3NpdGlvbl0sCisgICAgICAgICAgICAgICAgICAgICAgICAgVkVSVElDQUxfUlVMRVIsIGRyYXdf cCwgTk9XSEVSRSwgTk9fQ0FDSEUpOworICAgICAgICAgIH0KKworICAgICAgfQorICByZXR1cm4g Y2hhbmdlZF9wOworfQorCisvKiBVcGRhdGUgcm93IFZQT1MgaW4gd2luZG93IFcuICBWYWx1ZSBp cyB0cnVlIGlmIGRpc3BsYXkgaGFzIGJlZW4gY2hhbmdlZC4gKi8KK3N0YXRpYyBib29sCittY191 cGRhdGVfd2luZG93X2xpbmUgKHN0cnVjdCB3aW5kb3cgKncsIGludCB2cG9zLCBib29sICptb3Vz ZV9mYWNlX292ZXJ3cml0dGVuX3AsCisgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlw aF9tYXRyaXggKmN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBt Y19lc3NlbnRpYWxzIGVzc2VudGlhbHMsIGJvb2wgZHJhd19wKQoreworICBzdHJ1Y3QgZ2x5cGhf cm93ICpjdXJyZW50X3JvdyA9IE1BVFJJWF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB2cG9zKTsK KyAgc3RydWN0IGdseXBoX3JvdyAqZGVzaXJlZF9yb3cgPSBNQVRSSVhfUk9XICh3LT5kZXNpcmVk X21hdHJpeCwgdnBvcyk7CisgIHN0cnVj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gYm9yZGVyLCBpZgorICAgICAgICAgICAg IGFueSwgYmV0d2VlbiB0aGlzIHdpbmRvdyBhbmQgdGhlIG9uZSBvbiBpdHMgbGVmdCB3aWxsIGJl CisgICAgICAgICAgICAgcmVkcmF3bi4gIFRoaXMgaXMgbmVjZXNzYXJ5IGJlY2F1c2UgdXBkYXRp bmcgdGhlIGxlZnQKKyAgICAgICAgICAgICBtYXJnaW4gYXJlYSBjYW4gcG90ZW50aWFsbHkgZHJh dyBvdmVyIHRoZSBib3JkZXIuICovCisgICAgICAgICAgY3VycmVudF9yb3ctPnJlZHJhd19mcmlu Z2VfYml0bWFwc19wID0gMTsKKyAgICAgICAgfQorICAgICAgYm9vbCB1cGRhdGVkX3AgPSBtY191 cGRhdGVfdGV4dF9hcmVhICh3LCBkZXNpcmVkX3JvdywgdnBvcywgY3Vyc29yX21hdHJpeCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscywgZHJh d19wKTsKKyAgICAgIC8qIFVwZGF0ZSB0aGUgZGlzcGxheSBvZiB0aGUgdGV4dCBhcmVhLiAqLwor ICAgICAgaWYgKHVwZGF0ZWRfcCkKKyAgICAgICAgeworICAgICAgICAgIGNoYW5nZWRfcCA9IDE7 CisgICAgICAgICAgaWYgKGN1cnJlbnRfcm93LT5tb3VzZV9mYWNlX3ApCisgICAgICAgICAgICAq bW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wID0gMTsKKyAgICAgICAgfQorICAgICAgLyogVXBkYXRl IGRpc3BsYXkgb2YgdGhlIHJpZ2h0IG1hcmdpbiBhcmVhLCBpZiB0aGVyZSBpcyBvbmUuICovCisg ICAgICBpZiAoIWRlc2lyZWRfcm93LT5mdWxsX3dpZHRoX3AgJiYgdy0+cmlnaHRfbWFyZ2luX2Nv bHMgPiAwKQorICAgICAgICB7CisgICAgICAgICAgY2hhbmdlZF9wID0gMTsKKyAgICAgICAgICB1 cGRhdGVfbWFyZ2luYWxfYXJlYSAodywgZGVzaXJlZF9yb3csIFJJR0hUX01BUkdJTl9BUkVBLCB2 cG9zKTsKKyAgICAgICAgfQorICAgICAgLyogRHJhdyB0cnVuY2F0aW9uIG1hcmtzIGV0Yy4gKi8K KyAgICAgIGlmICghY3VycmVudF9yb3ctPmVuYWJsZWRfcAorICAgICAgICAgIHx8IGRlc2lyZWRf cm93LT55ICE9IGN1cnJlbnRfcm93LT55CisgICAgICAgICAgfHwgZGVzaXJlZF9yb3ctPnZpc2li bGVfaGVpZ2h0ICE9IGN1cnJlbnRfcm93LT52aXNpYmxlX2hlaWdodAorICAgICAgICAgIHx8IGRl c2lyZWRfcm93LT5jdXJzb3JfaW5fZnJpbmdlX3AgIT0gY3VycmVudF9yb3ctPmN1cnNvcl9pbl9m cmluZ2VfcAorICAgICAgICAgIHx8IGRlc2lyZWRfcm93LT5vdmVybGF5X2Fycm93X2JpdG1hcCAh PSBjdXJyZW50X3Jvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAKKyAgICAgICAgICB8fCBjdXJyZW50 X3Jvdy0+cmVkcmF3X2ZyaW5nZV9iaXRtYXBzX3AKKyAgICAgICAgICB8fCBkZXNpcmVkX3Jvdy0+ bW9kZV9saW5lX3AgIT0gY3VycmVudF9yb3ctPm1vZGVfbGluZV9wCisgICAgICAgICAgfHwgZGVz aXJlZF9yb3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5lX3AgIT0gY3VycmVudF9yb3ctPmV4YWN0 X3dpbmRvd193aWR0aF9saW5lX3AKKyAgICAgICAgICB8fCAoTUFUUklYX1JPV19DT05USU5VQVRJ T05fTElORV9QIChkZXNpcmVkX3JvdykKKyAgICAgICAgICAgICAgIT0gTUFUUklYX1JPV19DT05U SU5VQVRJT05fTElORV9QIChjdXJyZW50X3JvdykpKQorICAgICAgICByaWYtPmFmdGVyX3VwZGF0 ZV93aW5kb3dfbGluZV9ob29rICh3LCBkZXNpcmVkX3Jvdyk7CisgICAgfQorICAvKiBVcGRhdGUg Y3VycmVudF9yb3cgZnJvbSBkZXNpcmVkX3Jvdy4gKi8KKyAgbWFrZV9jdXJyZW50ICh3LT5kZXNp cmVkX21hdHJpeCwgdy0+Y3VycmVudF9tYXRyaXgsIHZwb3MpOworICByZXR1cm4gY2hhbmdlZF9w OworfQorCit2b2lkCittY191cGRhdGVfd2luZG93X2VyYXNlIChzdHJ1Y3Qgd2luZG93ICp3LCBz dHJ1Y3QgbWNfbWF0cml4IG9sZF9tYXRyaXgpCit7CisgIGJvb2wgZ29fb25lX3AgPSAob2xkX21h dHJpeC5jdXJzb3JzX3VzZWRbTUNfQ0FDSEVdID4gMAorICAgICAgICAgICAgICAgICAgIHx8IG9s ZF9tYXRyaXguY3Vyc29yc191c2VkW0NIX0NBQ0hFXSA+IDAKKyAgICAgICAgICAgICAgICAgICB8 fCBvbGRfbWF0cml4LmN1cnNvcnNfdXNlZFtGQ19DQUNIRV0gPiAwKTsKKyAgYm9vbCBnb190d29f cCA9IChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICAmJiAoIU5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAg ICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2li bGUpKQorICAgICAgICAgICAgICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBtY19jb25mKSkpKTsKKyAgYm9vbCB1cGRhdGluZ19mcmFtZV9wID0gZmFsc2U7 CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBpZiAoWEZSQU1FICh3 LT5mcmFtZSkgIT0gZi0+bWNfdXBkYXRpbmdfZnJhbWUKKyAgICAgICYmIChnb19vbmVfcCB8fCBn b190d29fcCkpCisgICAgeworICAgICAgdXBkYXRpbmdfZnJhbWVfcCA9IHRydWU7CisgICAgICB1 cGRhdGVfYmVnaW4gKGYpOworICAgIH0KKyAgaWYgKHctPnBoeXNfY3Vyc29yX29uX3AKKyAgICAg ICYmIGdvX3R3b19wKQorICAgIGVyYXNlX3BoeXNfY3Vyc29yICh3KTsKKyAgZm9yIChpbnQgdm50 aCA9IDA7CisgICAgICAgZ29fb25lX3AKKyAgICAgICAmJiB2bnRoIDwgdy0+bWNfbWF0cml4LnZw b3NfdXNlZDsKKyAgICAgICArK3ZudGgpCisgICAgeworICAgICAgZm9yIChlbnVtIG1jX2NhY2hl X3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOworICAgICAgICAgICBjYWNoZV90eXBlIDwgTk9f Q0FDSEU7CisgICAgICAgICAgICsrY2FjaGVfdHlwZSkKKyAgICAgICAgZm9yIChpbnQgbnRoXzAg PSAwOworICAgICAgICAgICAgIG1jX3RyYXZlcnNlX2NhY2hlX3AgKG9sZF9tYXRyaXgsIGNhY2hl X3R5cGUsIHZudGgsIG50aF8wKTsKKyAgICAgICAgICAgICArK250aF8wKQorICAgICAgICAgIHsK KyAgICAgICAgICAgIGJvb2wgc2FtZV9wID0gZmFsc2U7CisgICAgICAgICAgICBmb3IgKGludCB3 X250aCA9IDA7IHdfbnRoIDwgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNo ZV90eXBlXTsgKyt3X250aCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNhbWVf cCB8PSAob2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlw aC50eXBlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC50eXBlCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXzBdLmdseXBoLmJ5dGVwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLmJ5dGVw b3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGguY2hhcnBvcworICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3 X250aF0uZ2x5cGguY2hhcnBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC51LnZhbAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgudS52YWwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5 cGguZmFjZV9pZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGguZmFjZV9pZAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8wXS5nbHlwaC5wYWRkaW5nX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmds eXBoLnBhZGRpbmdfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5sZWZ0X2JveF9saW5lX3AK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLmxlZnRfYm94X2xpbmVfcAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS5nbHlwaC5yaWdodF9ib3hfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRo XS5nbHlwaC5yaWdodF9ib3hfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnZvZmZz ZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnZvZmZzZXQKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhfMF0uZ2x5cGgucGl4ZWxfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnBp eGVsX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnNsaWNlLmltZy54CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5pbWcueAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5n bHlwaC5zbGljZS5pbWcueQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGguc2xpY2UuaW1n LnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGguc2xpY2UuaW1nLndpZHRoCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5pbWcud2lkdGgKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0u Z2x5cGguc2xpY2UuaW1nLmhlaWdodAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGguc2xp Y2UuaW1nLmhlaWdodAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5zbGljZS5jbXAuZnJvbQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGguc2xpY2UuY21wLmZyb20KKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMF0ueAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0ueAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8w XS5meAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZngKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0ueQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVt3X250aF0ueQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5meQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVt3X250aF0uZnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uaHBvcworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVt3X250aF0uaHBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS52cG9zCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW3dfbnRoXS52cG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLndkCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3dfbnRoXS53ZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5oCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3df bnRoXS5oCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmN1cnNvcl90eXBlCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W3dfbnRoXS5jdXJzb3JfdHlwZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5jdXJzb3Jfd2lkdGgKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bd19udGhdLmN1cnNvcl93aWR0aAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5m Zy5yZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmZnLnJlZAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8w XS5mZy5ncmVlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZmcuZ3JlZW4KKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMF0uZmcuYmx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZmcuYmx1ZQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8wXS5iZy5yZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmJnLnJlZAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8wXS5iZy5ncmVlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9 PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uYmcuZ3Jl ZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMF0uYmcuYmx1ZQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0u YmcuYmx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3 X250aF0uYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGhfZmxhdm9yCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3dfbnRoXS5nbHlwaF9mbGF2b3IKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZW5hYmxl ZF9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5lbmFibGVkX3ApOworICAgICAgICAgICAgICAg IC8qIEZvcmNlIHRoZSBmcmluZ2UgYml0bWFwcyB0byBhbHdheXMgYmUgcmVzZXQvcmVkcmF3bi4g Ki8KKyAgICAgICAgICAgICAgICBpZiAob2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8wXS5jdXJzb3JfdHlwZQorICAgICAgICAgICAgICAgICAgICAgID09IHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5jdXJzb3JfdHlwZQor ICAgICAgICAgICAgICAgICAgICAmJiAob2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8wXS5jdXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVAKKyAgICAg ICAgICAgICAgICAgICAgICAgIHx8IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMF0uY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUCkpCisgICAg ICAgICAgICAgICAgICBzYW1lX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBpZiAoc2FtZV9w KQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvLyAgZnByaW50ZiAo c3RkZXJyLCAiSElUICglcyk6ICB2cG9zICglZCkgfCBocG9zICglZCkgfCBjaGFyICglcylcbiIs CisgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIChjYWNoZV90eXBlID09 IE1DX0NBQ0hFKQorICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgID8g Ik1DIgorICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICA6IChjYWNoZV90 eXBlID09IENIX0NBQ0hFKQorICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAg ICAgID8gIkNIIgorICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICA6IChj YWNoZV90eXBlID09IEZDX0NBQ0hFKQorICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAg ICAgICAgICAgID8gIkZDIgorICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAg ICA6ICJOTyIsCisgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS52cG9zLAorICAgICAg ICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uaHBvcywKKyAgICAgICAgICAgICAgICAgICAgLy8g ICAgICAgICAgICAgICAgICAgbWNfY2hhcl90b19zdHJpbmcgKHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC51LmNoKSk7CisgICAgICAgICAgICAg ICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5z YW1lX3AgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgICAgIC8vICBmcHJpbnRmIChzdGRlcnIsICJNSVNTICglcyk6ICB2cG9z ICglZCkgfCBocG9zICglZCB2LiAlZCkgfCBjaGFyICglcyB2LiAlcykgfCBjYWNoZV91c2VkICgl ZCB2LiAlZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAg KGNhY2hlX3R5cGUgPT0gTUNfQ0FDSEUpCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAg ICAgICAgICAgICAgICA/ICJNQyIKKyAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAg ICAgICAgICA6IChjYWNoZV90eXBlID09IENIX0NBQ0hFKQorICAgICAgICAgICAgICAgICAgICAg IC8vICAgICAgICAgICAgICAgICAgICAgPyAiQ0giCisgICAgICAgICAgICAgICAgICAgICAgLy8g ICAgICAgICAgICAgICAgICAgOiAoY2FjaGVfdHlwZSA9PSBGQ19DQUNIRSkKKyAgICAgICAgICAg ICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgID8gIkZDIgorICAgICAgICAgICAgICAg ICAgICAgIC8vICAgICAgICAgICAgICAgICAgIDogIk5PIiwKKyAgICAgICAgICAgICAgICAgICAg ICAvLyAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVt3X250aF0udnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAg ICAgICAgICBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmhw b3MsCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmhwb3MsCisgICAgICAgICAg ICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgbWNfY2hhcl90b19zdHJpbmcgKG9sZF9t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGgudS5jaCksCisg ICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgbWNfY2hhcl90b19zdHJp bmcgKHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlw aC51LmNoKSwKKyAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXSwKKyAgICAgICAgICAgICAg ICAgICAgICAvLyAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZV91c2VkW2NhY2hlX3R5cGVdKTsKKyAgICAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uc2FtZV9wID0gZmFsc2U7CisgICAg ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKCFzYW1l X3ApCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBgbWF0cml4X3JvdycgaW4g YGRpc3BuZXcuY2AgY29udGFpbnMgdGhlIGZvbGxvd2luZyB0ZXN0cywKKyAgICAgICAgICAgICAg ICBlYXNzZXJ0IChtYXRyaXggJiYgbWF0cml4LT5yb3dzKTsKKyAgICAgICAgICAgICAgICBlYXNz ZXJ0IChyb3cgPj0gMCAmJiByb3cgPCBtYXRyaXgtPm5yb3dzKTsgKi8KKyAgICAgICAgICAgICAg ICBib29sIGJhcmZfY3Jhc2hfb25lID0gKHctPmN1cnJlbnRfbWF0cml4ICYmIHctPmN1cnJlbnRf bWF0cml4LT5yb3dzKSA/IGZhbHNlIDogdHJ1ZTsKKyAgICAgICAgICAgICAgICBpZiAoYmFyZl9j cmFzaF9vbmUpCisgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICBi b29sIGJhcmZfY3Jhc2hfdHdvID0gKHZudGggPj0gMCAmJiB2bnRoIDwgdy0+Y3VycmVudF9tYXRy aXgtPm5yb3dzKSA/IGZhbHNlIDogdHJ1ZTsKKyAgICAgICAgICAgICAgICBpZiAoYmFyZl9jcmFz aF90d28pCisgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICBzdHJ1 Y3QgZ2x5cGhfcm93ICp2bnRoX3JvdyA9IE1BVFJJWF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB2 bnRoKTsKKyAgICAgICAgICAgICAgICBpbnQgeF8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8wXS54OworICAgICAgICAgICAgICAgIGludCBmeF8wID0gb2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5meDsKKyAgICAgICAg ICAgICAgICBpbnQgeV8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF8wXS55OworICAgICAgICAgICAgICAgIGludCBmeV8wID0gb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5meTsKKyAgICAgICAgICAgICAgICBpbnQgaHBv c18wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5ocG9z OworICAgICAgICAgICAgICAgIGludCB2cG9zXzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzBdLnZwb3M7CisgICAgICAgICAgICAgICAgaW50IHdkXzAgPSBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLndkOworICAgICAg ICAgICAgICAgIGludCBoXzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXzBdLmg7CisgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3Jf dHlwZV8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5j dXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAgICBpbnQgY3Vyc29yX3dpZHRoXzAgPSBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmN1cnNvcl93aWR0aDsKKyAg ICAgICAgICAgICAgICAvLyAgc3RydWN0IG1jX1JHQiBsc2xfZmdfMCA9IHsucmVkID0gb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5mZy5yZWQsCisgICAgICAg ICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5mZy5ncmVlbiwKKyAgICAgICAg ICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZmcuYmx1ZX07CisgICAgICAgICAg ICAgICAgc3RydWN0IG1jX1JHQiBsc2xfYmdfMCA9IHsucmVkID0gb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5iZy5yZWQsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzBdLmJnLmdyZWVuLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgLmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzBdLmJnLmJsdWV9OworICAgICAgICAgICAgICAgIGJvb2wgYWN0aXZlX3Bf MCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uYWN0aXZl X3A7CisgICAgICAgICAgICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yXzAgPSBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoX2ZsYXZvcjsK KyAgICAgICAgICAgICAgICBib29sIGVuYWJsZWRfcF8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5lbmFibGVkX3A7CisgICAgICAgICAgICAgICAgaWYg KHZwb3NfMCA9PSB2bnRoCisgICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvcl8wID09 IE1DX0dMWVBICisgICAgICAgICAgICAgICAgICAgICYmIGVuYWJsZWRfcF8wCisgICAgICAgICAg ICAgICAgICAgICYmIHZudGhfcm93LT5lbmFibGVkX3ApCisgICAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgICAgIG1jX2VyYXNlX2N1cnNvciAodywgdy0+Y3VycmVudF9tYXRyaXgs IHZudGhfcm93LCB4XzAsIHlfMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBocG9zXzAsIHZwb3NfMCwgZ2x5cGhfZmxhdm9yXzAsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgY3Vyc29yX3R5cGVfMCwgd2RfMCk7CisgICAgICAgICAgICAgICAgICAg IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZW5hYmxlZF9w ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIC0tb2xkX21hdHJpeC5jdXJzb3JzX3VzZWRb Y2FjaGVfdHlwZV07CisgICAgICAgICAgICAgICAgICAgIC8qIElmIHdlIGluYWR2ZXJ0ZW50bHkg ZXJhc2VkIGFub3RoZXIgZmFrZSBjdXJzb3IgYXQgdGhlIHNhbWUKKyAgICAgICAgICAgICAgICAg ICAgSFBPUyB0aGF0IGlzIHN0aWxsIGVuYWJsZWRfcCBpbiB0aGUgYG9sZF9tYXRyaXhgLCB0aGVu IHJlZHJhdyBpdC4gKi8KKyAgICAgICAgICAgICAgICAgICAgZm9yIChlbnVtIG1jX2NhY2hlX3R5 cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOworICAgICAgICAgICAgICAgICAgICAgICAgIGNhY2hl X3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICArK2NhY2hlX3R5cGUp CisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChp bnQgbnRoXzEgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtY190cmF2ZXJzZV9j YWNoZV9wIChvbGRfbWF0cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGhfMSk7CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICsrbnRoXzEpCisgICAgICAgICAgICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgeF8xID0gb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS54OworICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGludCBmeF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8xXS5meDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgeV8xID0gb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS55OworICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGludCBmeV8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8xXS5meTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaHBvc18x ID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5ocG9zOwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB2cG9zXzEgPSBvbGRfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLnZwb3M7CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgaW50IHdkXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXzFdLndkOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBoXzEgPSBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmg7CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZV8xID0gb2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5jdXJzb3JfdHlwZTsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY3Vyc29yX3dpZHRoXzEgPSBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmN1cnNvcl93aWR0aDsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZ18xID0gey5yZWQg PSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmZnLnJlZCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5n cmVlbiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZmcu Z3JlZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAuYmx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhf MV0uZmcuYmx1ZX07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIHN0cnVjdCBtY19S R0IgbHNsX2JnXzEgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMV0uYmcucmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMV0uYmcuZ3JlZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmJnLmJsdWV9OworICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGJvb2wgYWN0aXZlX3BfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMV0uYWN0aXZlX3A7CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmdseXBoX2ZsYXZvcjsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICBib29sIGVuYWJsZWRfcF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF8xXS5lbmFibGVkX3A7CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgYm9vbCBnb19wXzEgPSAoaHBvc18wID09IGhwb3NfMQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIGVuYWJsZWRfcF8xKTsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICBpZiAoIWdvX3BfMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNv bnRpbnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgcmVtb3ZlX3BfMSA9IGZh bHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3 LCB3LT5jdXJyZW50X21hdHJpeCwgdm50aF9yb3csIHhfMSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnhfMSwgeV8xLCBmeV8xLCBocG9zXzEsIHZw b3NfMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg d2RfMSwgaF8xLCBjdXJzb3JfdHlwZV8xLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGhfMSwgbHNsX2ZnXzEsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2ZV9wXzEsIGdseXBo X2ZsYXZvcl8xLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICByZW1vdmVfcF8xKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVs c2UgaWYgKHZwb3NfMCA9PSB2bnRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBlbmFi bGVkX3BfMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdm50aF9yb3ctPmVuYWJsZWRf cCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGJvb2wgcmVt b3ZlX3BfMCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgbWNfZHJhd19lcmFzZV9oeWJy aWQgKHcsIHctPmN1cnJlbnRfbWF0cml4LCB2bnRoX3JvdywgeF8wLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmeF8wLCB5XzAsIGZ5XzAsIGhwb3NfMCwgdnBv c18wLCB3ZF8wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBo XzAsIGN1cnNvcl90eXBlXzAsIGN1cnNvcl93aWR0aF8wLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBsc2xfYmdfMCwgYWN0aXZlX3BfMCwgZ2x5cGhfZmxhdm9y XzAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZV9w XzApOworICAgICAgICAgICAgICAgICAgICAgIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMF0uZW5hYmxlZF9wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAg ICAgLS1vbGRfbWF0cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90eXBlXTsKKyAgICAgICAgICAgICAg ICAgICAgICAvKiBJZiB3ZSBpbmFkdmVydGVudGx5IGVyYXNlZCBhbm90aGVyIGZha2UgY3Vyc29y IGF0IHRoZSBzYW1lCisgICAgICAgICAgICAgICAgICAgICAgSFBPUyB0aGF0IGlzIHN0aWxsIGVu YWJsZWRfcCBpbiB0aGUgYG9sZF9tYXRyaXhgLCB0aGVuIHJlZHJhdyBpdC4gKi8KKyAgICAgICAg ICAgICAgICAgICAgICBmb3IgKGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FD SEU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICArK2NhY2hlX3R5cGUpCisgICAgICAgICAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IG50aF8yID0gMDsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtY190cmF2ZXJzZV9jYWNoZV9wIChvbGRf bWF0cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGhfMik7CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKytudGhfMikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBpbnQgeF8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8yXS54OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg aW50IGZ4XzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJd LmZ4OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHlfMiA9IG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0ueTsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGludCBmeV8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8yXS5meTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBocG9z XzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmhwb3M7 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgdnBvc18yID0gb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS52cG9zOworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgaW50IHdkXzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzJdLndkOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGhf MiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uaDsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5 cGVfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uY3Vy c29yX3R5cGU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY3Vyc29yX3dpZHRo XzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmN1cnNv cl93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNs X2ZnXzIgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhfMl0uZmcucmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAuZ3JlZW4gPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXzJdLmZnLmdyZWVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMl0uZmcuYmx1ZX07CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAvLyAgc3RydWN0IG1jX1JHQiBsc2xfYmdfMiA9IHsucmVkID0gb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5iZy5yZWQsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmJnLmdyZWVuLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAg LmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmJn LmJsdWV9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBhY3RpdmVfcF8yID0g b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5hY3RpdmVfcDsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZv cl8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5nbHlw aF9mbGF2b3I7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGVuYWJsZWRfcF8y ID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5lbmFibGVk X3A7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGdvX3BfMiA9IChocG9zXzAg PT0gaHBvc18yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBmeF8wIDw9IGZ4XzIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIGZ4XzAgKyB3ZF8wID4gZnhfMiArIHdkXzIKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIGVuYWJsZWRfcF8yKTsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGlmICghZ29fcF8yKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgcmVtb3ZlX3Bf MiA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWNfZHJhd19lcmFzZV9o eWJyaWQgKHcsIHctPmN1cnJlbnRfbWF0cml4LCB2bnRoX3JvdywgeF8yLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ4XzIsIHlfMiwgZnlfMiwg aHBvc18yLCB2cG9zXzIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgd2RfMiwgaF8yLCBjdXJzb3JfdHlwZV8yLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aF8yLCBsc2xfZmdf MiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBh Y3RpdmVfcF8yLCBnbHlwaF9mbGF2b3JfMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVfcF8yKTsKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgIH0KKyAgaWYgKHVwZGF0aW5n X2ZyYW1lX3ApCisgICAgdXBkYXRlX2VuZCAoZik7Cit9CisKK3ZvaWQKK21jX3VwZGF0ZV93aW5k b3dfZHJ5cnVuIChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3AsIHN0cnVjdCBtY19lc3Nl bnRpYWxzIGVzc2VudGlhbHMpCit7CisgIGlmICghQlVGRkVSUCAody0+Y29udGVudHMpKQorICAg IHJldHVybjsKKworICBpZiAody0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtNQ19DQUNIRV0gPT0g MAorICAgICAgJiYgdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtDSF9DQU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KyAgICAgIC8qIFRha2Ugbm90ZSBvZiB0aGUgaGVh ZGVyIGxpbmUsIGlmIHRoZXJlIGlzIG9uZS4gIFdlIHdpbGwKKyAgICAgICAgIHVwZGF0ZSBpdCBi ZWxvdywgYWZ0ZXIgdXBkYXRpbmcgYWxsIG9mIHRoZSB3aW5kb3cncyBsaW5lcy4gKi8KKyAgICAg IGlmIChyb3ctPm1vZGVfbGluZV9wKQorICAgICAgICB7CisgICAgICAgICAgaGVhZGVyX2xpbmVf cm93ID0gcm93OworICAgICAgICAgICsrcm93OworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAg ICAgICAgICBoZWFkZXJfbGluZV9yb3cgPSBOVUxMOworCisgICAgICAvKiBVcGRhdGUgdGhlIG1v ZGUgbGluZSwgaWYgbmVjZXNzYXJ5LiAqLworICAgICAgc3RydWN0IGdseXBoX3JvdyAqbW9kZV9s aW5lX3JvdyA9IE1BVFJJWF9NT0RFX0xJTkVfUk9XIChkZXNpcmVkX21hdHJpeCk7CisgICAgICBp ZiAobW9kZV9saW5lX3Jvdy0+bW9kZV9saW5lX3AgJiYgbW9kZV9saW5lX3Jvdy0+ZW5hYmxlZF9w KQorICAgICAgICB7CisgICAgICAgICAgbW9kZV9saW5lX3Jvdy0+eSA9IHliICsgV0lORE9XX1ND Uk9MTF9CQVJfQVJFQV9IRUlHSFQgKHcpOworICAgICAgICAgIHVwZGF0ZV93aW5kb3dfbGluZSAo dywgTUFUUklYX1JPV19WUE9TIChtb2RlX2xpbmVfcm93LAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNpcmVkX21hdHJpeCksCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wKTsKKyAgICAgICAg fQorCisgICAgICAvKiBGaW5kIGZpcnN0IGVuYWJsZWQgcm93LiAgT3B0aW1pemF0aW9ucyBpbiBy ZWRpc3BsYXlfaW50ZXJuYWwKKyAgICAgICAgIG1heSBsZWFkIHRvIGFuIHVwZGF0ZSB3aXRoIG9u bHkgb25lIHJvdyBlbmFibGVkLiAgVGhlcmUgbWF5CisgICAgICAgICBiZSBhbHNvIGNvbXBsZXRl bHkgZW1wdHkgbWF0cmljZXMuICovCisgICAgICB3aGlsZSAocm93IDwgZW5kICYmICFyb3ctPmVu YWJsZWRfcCkKKyAgICAgICAgKytyb3c7CisKKyAgICAgIC8qIFRyeSByZXVzaW5nIHBhcnQgb2Yg dGhlIGRpc3BsYXkgYnkgY29weWluZy4gKi8KKyAgICAgIGlmIChyb3cgPCBlbmQgJiYgIXctPmRl c2lyZWRfbWF0cml4LT5ub19zY3JvbGxpbmdfcCkKKyAgICAgICAgeworICAgICAgICAgIGludCBy YyA9IG1jX3Njcm9sbGluZ193aW5kb3cgKHcsIGhlYWRlcl9saW5lX3JvdyAhPSBOVUxMKTsKKyAg ICAgICAgICBpZiAocmMgPCAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBBbGwg cm93cyB3ZXJlIGZvdW5kIHRvIGJlIGVxdWFsLiAqLworICAgICAgICAgICAgICBwYXVzZWRfcCA9 IDA7CisgICAgICAgICAgICAgIGdvdG8gc2V0X2N1cnNvcjsKKyAgICAgICAgICAgIH0KKyAgICAg ICAgICAgIGVsc2UgaWYgKHJjID4gMCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg IC8qIFdlJ3ZlIHNjcm9sbGVkIHRoZSBkaXNwbGF5LiAqLworICAgICAgICAgICAgICAgIGZvcmNl X3AgPSAxOworICAgICAgICAgICAgICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAgICAgICAgIH0K KyAgICAgICAgfQorICAgICAgLyogUHJvY2VzcyB0aGUgY3Vyc29yIHJvdyBhdCB0aGUgb3V0c2V0 IGlmIGl0IGlzIHdpdGhpbiBgZGVzaXJlZF9tYXRyaXhgLgorICAgICAgV2hlbiBwcm9jZXNzaW5n IGFsbCBvdGhlciByb3dzL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m9yY2VfcCAmJiAr K25fdXBkYXRlZCAlIHByZWVtcHRfY291bnQgPT0gMCkKKyAgICAgICAgICAgICAgICBkZXRlY3Rf aW5wdXRfcGVuZGluZ19pZ25vcmVfc3F1ZWV6YWJsZXMgKCk7CisgICAgICAgICAgICAgIGNoYW5n ZWRfcCB8PSBtY191cGRhdGVfd2luZG93X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3 cml0dGVuX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIGRyYXdfcCk7CisgICAgICAgICAgICAgIGlm IChNQVRSSVhfUk9XX0JPVFRPTV9ZIChyb3cpID49IHliKQorICAgICAgICAgICAgICAgIGZvciAo aW50IGkgPSB2cG9zICsgMTsgaSA8IHctPmN1cnJlbnRfbWF0cml4LT5ucm93cyAtIDE7ICsraSkK KyAgICAgICAgICAgICAgICAgIFNFVF9NQVRSSVhfUk9XX0VOQUJMRURfUCAody0+Y3VycmVudF9t YXRyaXgsIGksIGZhbHNlKTsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9Cisg ICAgICAgIH0KKyAgICAgIGN1cnNvcl9tYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAgICAg IC8qIFVwZGF0ZSB0aGUgcmVzdCBvZiB0aGUgbGluZXMuICovCisgICAgICBmb3IgKDsgcm93IDwg ZW5kICYmIChmb3JjZV9wIHx8ICFpbnB1dF9wZW5kaW5nKTsgKytyb3cpCisgICAgICAgIC8qIHNj cm9sbGluZ193aW5kb3cgcmVzZXRzIHRoZSBlbmFibGVkX3AgZmxhZyBvZiB0aGUgcm93cyBpdCBy ZXVzZXMgZnJvbQorICAgICAgICBjdXJyZW50X21hdHJpeC4gKi8KKyAgICAgICAgaWYgKHJvdy0+ ZW5hYmxlZF9wKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JP V19WUE9TIChyb3csIHctPmRlc2lyZWRfbWF0cml4KTsKKyAgICAgICAgICAgIC8qIElmIHRoZSBg Y3Vyc29yX3Jvd2AgaXMgd2l0aGluIHRoZSBgZGVzaXJlZF9tYXRyaXhgLCB0aGVuIGl0IHdhcwor ICAgICAgICAgICAgcHJvY2Vzc2VkIGhlcmVpbmFib3ZlIGFuZCBzaG91bGQgYmUgc2tpcHBlZCBh dCB0aGlzIHRpbWUuICovCisgICAgICAgICAgICBpZiAodnBvcyA9PSB3LT5jdXJzb3IudnBvcykK KyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgaW50IGk7CisgICAgICAgICAgICAv KiBXZSdsbCBoYXZlIHRvIHBsYXkgYSBsaXR0bGUgYml0IHdpdGggd2hlbiB0bworICAgICAgICAg ICAgICAgZGV0ZWN0X2lucHV0X3BlbmRpbmcuICBJZiBpdCdzIGRvbmUgdG9vIG9mdGVuLAorICAg ICAgICAgICAgICAgc2Nyb2xsaW5nIGxhcmdlIHdpbmRvd3Mgd2l0aCByZXBlYXRlZCBzY3JvbGwt dXAKKyAgICAgICAgICAgICAgIGNvbW1hbmRzIHdpbGwgdG9vIHF1aWNrbHkgcGF1c2UgcmVkaXNw bGF5LiAqLworICAgICAgICAgICAgaWYgKCFmb3JjZV9wICYmICsrbl91cGRhdGVkICUgcHJlZW1w dF9jb3VudCA9PSAwKQorICAgICAgICAgICAgICBkZXRlY3RfaW5wdXRfcGVuZGluZ19pZ25vcmVf c3F1ZWV6YWJsZXMgKCk7CisgICAgICAgICAgICBjaGFuZ2VkX3AgfD0gbWNfdXBkYXRlX3dpbmRv d19saW5lICh3LCB2cG9zLCAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50 aWFscywgZHJhd19wKTsKKyAgICAgICAgICAgIC8qIE1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ICAgcGF1c2VkX3AgPSByb3cgPCBlbmQ7CisgICAgICBzZXRfY3Vyc29yOgorICAgICAgLyogSWYg d2UganVtcGVkIGhlcmUgZnJvbSBgc2V0X2N1cnNvcmAsIHRoZW4gc2V0IHRoZSBgY3Vyc29yX21h dHJpeGAuICovCisgICAgICBpZiAoY3Vyc29yX21hdHJpeCA9PSBOVUxMKQorICAgICAgICBjdXJz b3JfbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgICAgICAvKiBSZXNldCBgcm93YCB0byAw IHNvIHRoYXQgZmFrZSBjdXJzb3JzIGNhbiBiZSBkcmF3biBvbiByb3dzIHByZWNlZGluZyB0aGUK KyAgICAgIGZpcnN0IGByb3ctPmVuYWJsZWRfcGAuICBKdXN0IHByaW9yIHRvIHRoZSBjYWxsIHRv IGBzY3JvbGxpbmdfd2luZG93JyBhYm92ZSwKKyAgICAgIGByb3dgIHdhcyBhZHZhbmNlZCB0byB0 aGUgZmlyc3QgYHJvdy0+ZW5hYmxlZF9wYC4gKi8KKyAgICAgIGZvciAoc3RydWN0IGdseXBoX3Jv dyAqZGVzaXJlZF9yb3cgPSBNQVRSSVhfUk9XICh3LT5kZXNpcmVkX21hdHJpeCwgMCk7CisgICAg ICAgICAgIGRlc2lyZWRfcm93IDwgZW5kCisgICAgICAgICAgICYmIChmb3JjZV9wIHx8ICFpbnB1 dF9wZW5kaW5nKQorICAgICAgICAgICAvKiBXMzIgRW1hY3MgY3Jhc2hlcyBvbiBzdGFydHVwIHdp dGhvdXQgYSBCVUZGRVJQIGNoZWNrLiAqLworICAgICAgICAgICAmJiBCVUZGRVJQICh3LT5jb250 ZW50cykKKyAgICAgICAgICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IG1jX2NvbmYpKQorICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJV RkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpOworICAgICAgICAgICArK2Rlc2lyZWRf cm93KQorICAgICAgICB7CisgICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKGRl c2lyZWRfcm93LCB3LT5kZXNpcmVkX21hdHJpeCk7CisgICAgICAgICAgaWYgKGRlc2lyZWRfcm93 LT5lbmFibGVkX3ApCisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5 cGhfcm93ICpjdXJyZW50X3JvdyA9IE1BVFJJWF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB2cG9z KTsKKyAgICAgICAgICBlbnVtIG1jX3Jvd19wb3NpdGlvbiByb3dfcG9zaXRpb24gPSBtY19yb3df cG9zaXRpb24gKHcsIGN1cnJlbnRfcm93LCBjdXJyZW50X3JvdywgdnBvcyk7CisgICAgICAgICAg aWYgKGN1cnJlbnRfcm93LT5lbmFibGVkX3ApCisgICAgICAgICAgICBtY19kcmF3X3JvdyAodywg dy0+Y3VycmVudF9tYXRyaXgsIGN1cnJlbnRfcm93LCBjdXJyZW50X3Jvdy0+Z2x5cGhzW1RFWFRf QVJFQV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudF9yb3ctPngsIGN1cnJlbnRf cm93LT51c2VkW1RFWFRfQVJFQV0sIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgY3Vy c29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBkcmF3X3AsCisgICAgICAgICAg ICAgICAgICAgICAgICAgU0VUX0NVUlNPUl9PTkUpOworICAgICAgICB9CisKKyAgICAgIG1jX3Jl c3RvcmVfZ2x5cGhfbWF0cml4IChzYXZlZF9kZXNpcmVkLCB3LT5kZXNpcmVkX21hdHJpeCk7Cisg ICAgICBtY19yZXN0b3JlX2dseXBoX21hdHJpeCAoc2F2ZWRfY3VycmVudCwgdy0+Y3VycmVudF9t YXRyaXgpOworCisgICAgICBtY191cGRhdGVfd2luZG93X2VyYXNlICh3LCBvbGRfbWF0cml4KTsK KworICAgICAgbWNfeGZyZWVfY2FjaGVfbWF0cml4ICh3LCAmb2xkX21hdHJpeCk7CisKKyAgICB9 CisgIC8vIGNsb2NrX3QgY2xvY2tfZW5kID0gY2xvY2soKTsKKyAgLy8gZG91YmxlIGNwdV90aW1l X3VzZWQgPSAoKGRvdWJsZSkgKGNsb2NrX2VuZCAtIGNsb2NrX3N0YXJ0KSkgLyBDTE9DS1NfUEVS X1NFQzsKKyAgLy8gZnByaW50ZiAoc3RkZXJyLCAibWNfc2Nyb2xsaW5nX3dpbmRvdyAoJXMpOiAg VElNRSAoJWYpXG4iLCBtY193aW5kb3cgKHcpLCBjcHVfdGltZV91c2VkKTsKK30KKworLyogZW5k IE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC8qIFN0 cnVjdHVyZSB0byBwYXNzIGRpbWVuc2lvbnMgYXJvdW5kLiAgVXNlZCBmb3IgY2hhcmFjdGVyIGJv dW5kaW5nCiAgICBib3hlcywgZ2x5cGggbWF0cml4IGRpbWVuc2lvbnMgYW5kIGFsaWtlLiAgKi8K IApAQCAtMjI0MSw2ICs0MDUwLDE2IEBAIGZyZWVfd2luZG93X21hdHJpY2VzIChzdHJ1Y3Qgd2lu ZG93ICp3KQogCSAgZnJlZV9nbHlwaF9tYXRyaXggKHctPmN1cnJlbnRfbWF0cml4KTsKIAkgIGZy ZWVfZ2x5cGhfbWF0cml4ICh3LT5kZXNpcmVkX21hdHJpeCk7CiAJICB3LT5jdXJyZW50X21hdHJp eCA9IHctPmRlc2lyZWRfbWF0cml4ID0gTlVMTDsKKworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBtY194ZnJlZV9jYWNoZV9tYXRyaXggKHcs ICZ3LT5tY19tYXRyaXgpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJfQogCiAg ICAgICAvKiBOZXh0IHdpbmRvdyBvbiBzYW1lIGxldmVsLiAgKi8KQEAgLTMzODcsNiArNTIwNiwy NiBAQCBjaGVja19jdXJyZW50X21hdHJpeF9mbGFncyAoc3RydWN0IHdpbmRvdyAqdykKIHN0YXRp YyBib29sCiB1cGRhdGVfd2luZG93IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3ApCiB7 CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK KyAgaWYgKHRyYWNlX3JlZGlzcGxheV9wKQorICAgIGZwcmludGYgKHN0ZGVyciwgInVwZGF0ZV93 aW5kb3cgKCVzKVxuIiwgbWNfd2luZG93ICh3KSk7CisKKyAgc3RydWN0IG1jX2Vzc2VudGlhbHMg ZXNzZW50aWFsczsKKyAgbWNfc2V0X2Vzc2VudGlhbHMgKHcsICZlc3NlbnRpYWxzKTsKKworICBt Y191cGRhdGVfd2luZG93X2RyeXJ1biAodywgZm9yY2VfcCwgZXNzZW50aWFscyk7CisKKyAgc3Ry dWN0IGdseXBoX21hdHJpeCAqY3Vyc29yX21hdHJpeCA9IE5VTEw7CisKKyAgYm9vbCBkcmF3X3Ag PSB0cnVlOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIHN0cn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mVseQorICBleGNsdXNpdmVseSB1cG9uIGB3LT5jdXJyZW50X21hdHJpeCcgZm9y IGN1cnNvciByb3cgYmFzZWQgZGVjaXNpb25zLiAqLworICBmb3IgKHN0cnVjdCBnbHlwaF9yb3cg Km1jX3JvdyA9IHJvdzsKKyAgICAgICBtY19yb3cgPCBlbmQgJiYgKGZvcmNlX3AgfHwgIWlucHV0 X3BlbmRpbmcpOworICAgICAgICsrbWNfcm93KQorICAgIHsKKyAgICAgIGludCB2cG9zID0gTUFU UklYX1JPV19WUE9TIChtY19yb3csIGRlc2lyZWRfbWF0cml4KTsKKyAgICAgIGlmIChtY19yb3ct PmVuYWJsZWRfcAorICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgICAg IHsKKyAgICAgICAgICBjdXJzb3JfbWF0cml4ID0gZGVzaXJlZF9tYXRyaXg7CisgICAgICAgICAg aWYgKCFmb3JjZV9wICYmICsrbl91cGRhdGVkICUgcHJlZW1wdF9jb3VudCA9PSAwKQorICAgICAg ICAgICAgZGV0ZWN0X2lucHV0X3BlbmRpbmdfaWdub3JlX3NxdWVlemFibGVzICgpOworICAgICAg ICAgIGNoYW5nZWRfcCB8PSAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAg ICAgICAgICAmJiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwg ISBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKSkpCisgICAg ICAgICAgICAgICAgICAgICAgID8gbWNfdXBkYXRlX3dpbmRvd19saW5lICh3LCB2cG9zLCAmbW91 c2VfZmFjZV9vdmVyd3JpdHRlbl9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgZHJhd19wKQorICAgICAg ICAgICAgICAgICAgICAgICA6IHVwZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywgJm1vdXNlX2Zh Y2Vfb3ZlcndyaXR0ZW5fcCk7CisgICAgICAgICAgaWYgKE1BVFJJWF9ST1dfQk9UVE9NX1kgKHJv dykgPj0geWIpCisgICAgICAgICAgICBmb3IgKGludCBpID0gdnBvcyArIDE7IGkgPCB3LT5jdXJy ZW50X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAgICAgICAgICAgIFNFVF9NQVRSSVhfUk9X X0VOQUJMRURfUCAody0+Y3VycmVudF9tYXRyaXgsIGksIGZhbHNlKTsKKyAgICAgICAgICBicmVh azsKKyAgICAgICAgfQorICAgIH0KKworICBjdXJzb3JfbWF0cml4ID0gdy0+Y3VycmVudF9tYXRy aXg7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIC8qIFVwZGF0ZSB0aGUg cmVzdCBvZiB0aGUgbGluZXMuICAqLwogICAgICAgZm9yICg7IHJvdyA8IGVuZCAmJiAoZm9yY2Vf cCB8fCAhaW5wdXRfcGVuZGluZyk7ICsrcm93KQogCS8qIHNjcm9sbGluZ193aW5kb3cgcmVzZXRz IHRoZSBlbmFibGVkX3AgZmxhZyBvZiB0aGUgcm93cyBpdApAQCAtMzQ2Nyw2ICs1MzQ3LDE5IEBA IHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkKIAlpZiAocm93 LT5lbmFibGVkX3ApCiAJICB7CiAJICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3cs IGRlc2lyZWRfbWF0cml4KTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJ UExFLUNVUlNPUlMgKi8KKworICAgICAgICAgIC8qIElmIHRoZSBgY3Vyc29yX3Jvd2AgaXMgd2l0 aGluIHRoZSBgZGVzaXJlZF9tYXRyaXhgLCB0aGVuIGl0IHdhcworICAgICAgICAgIHByb2Nlc3Nl ZCBoZXJlaW5hYm92ZSBhbmQgc2hvdWxkIGJlIHNraXBwZWQgYXQgdGhpcyB0aW1lLiAqLworICAg ICAgICAgIGlmICh2cG9zID09IHctPmN1cnNvci52cG9zKQorICAgICAgICAgIGNvbnRpbnVlOwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAgIGludCBpOwogCiAJICAgIC8qIFdl J2xsIGhhdmUgdG8gcGxheSBhIGxpdHRsZSBiaXQgd2l0aCB3aGVuIHRvCkBAIC0zNDc1LDggKzUz NjgsMjEgQEAgdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wKQog CSAgICAgICBjb21tYW5kcyB3aWxsIHRvbyBxdWlja2x5IHBhdXNlIHJlZGlzcGxheS4gICovCiAJ ICAgIGlmICghZm9yY2VfcCAmJiArK25fdXBkYXRlZCAlIHByZWVtcHRfY291bnQgPT0gMCkKIAkg ICAgICBkZXRlY3RfaW5wdXRfcGVuZGluZ19pZ25vcmVfc3F1ZWV6YWJsZXMgKCk7Ci0JICAgIGNo YW5nZWRfcCB8PSB1cGRhdGVfd2luZG93X2xpbmUgKHcsIHZwb3MsCi0JCQkJCSAgICAgJm1vdXNl X2ZhY2Vfb3ZlcndyaXR0ZW5fcCk7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBN VUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgICAgICBjaGFuZ2VkX3AgfD0gKEJVRkZFUlAgKHct PmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKCFOSUxQIChCVkFSIChYQlVG RkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg IHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICEgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBmY192aXNpYmxlKSkpKQorICAgICAgICAgICAgICAgICAgICAgICA/IG1jX3VwZGF0 ZV93aW5kb3dfbGluZSAodywgdnBvcywgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgs IGVzc2VudGlhbHMsIGRyYXdfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgOiB1cGRhdGVfd2lu ZG93X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3cml0dGVuX3ApOworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKwogCiAJICAgIC8qIE1hcmsgYWxsIHJvd3MgYmVsb3cgdGhlIGxh c3QgdmlzaWJsZSBvbmUgaW4gdGhlIGN1cnJlbnQKIAkgICAgICAgbWF0cml4IGFzIGludmFsaWQu ICBUaGlzIGlzIG5lY2Vzc2FyeSBiZWNhdXNlIG9mCkBAIC0zNDk3LDYgKzU0MDMsNDEgQEAgdXBk YXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3Jj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SICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICB8 fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpOworICAg ICAgICsrZGVzaXJlZF9yb3cpCisgICAgeworICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQ T1MgKGRlc2lyZWRfcm93LCBkZXNpcmVkX21hdHJpeCk7CisgICAgICBpZiAoZGVzaXJlZF9yb3ct PmVuYWJsZWRfcCkKKyAgICAgICAgY29udGludWU7CisgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpj dXJyZW50X3JvdyA9IE1BVFJJWF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB2cG9zKTsKKyAgICAg IGVudW0gbWNfcm93X3Bvc2l0aW9uIHJvd19wb3NpdGlvbiA9IG1jX3Jvd19wb3NpdGlvbiAodywg Y3VycmVudF9yb3csIGN1cnJlbnRfcm93LCB2cG9zKTsKKyAgICAgIGlmIChjdXJyZW50X3Jvdy0+ ZW5hYmxlZF9wKQorICAgICAgICBtY19kcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgsIGN1 cnJlbnRfcm93LCBjdXJyZW50X3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgICAg ICAgICAgICBjdXJyZW50X3Jvdy0+eCwgY3VycmVudF9yb3ctPnVzZWRbVEVYVF9BUkVBXSwgdnBv cywKKyAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIHJvd19w b3NpdGlvbiwgZHJhd19wLCBTRVRfQ1VSU09SX1RXTyk7CisgICAgfQorCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKworCiAgICAgICAvKiBVcGRhdGUgdGhlIGhlYWRlciBsaW5lIGFmdGVyIHNj cm9sbGluZyB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cHBlZF9wIGluIGN1cnJlbnQgcm93cyBpcyAwLiAq LworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworICBmb3Ig KGludCBpID0gMDsgaSA8IHctPmN1cnJlbnRfbWF0cml4LT5ucm93czsgKytpKQorICAgIHsKKyAg ICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdyA9IHctPmN1cnJlbnRfbWF0cml4LT5yb3dzICsgaTsK KyAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgICAgIGJyZWFrOworICAgICAgICBlbHNl IGlmIChyb3ctPm1vZGVfbGluZV9wKQorICAgICAgICAgIGNvbnRpbnVlOworICAgICAgaWYgKHJv dy0+b3ZlcmxhcHBlZF9wKQorICAgICAgICB7CisgICAgICAgICAgZm9yIChlbnVtIGdseXBoX3Jv d19hcmVhIGFyZWEgPSBMRUZUX01BUkdJTl9BUkVBOyBhcmVhIDwgTEFTVF9BUkVBOyArK2FyZWEp CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIG91dHB1dF9jdXJzb3JfdG8gKHcsIGksIDAs IHJvdy0+eSwgYXJlYSA9PSBURVhUX0FSRUEgPyByb3ctPnggOiAwKTsKKyAgICAgICAgICAgICAg aWYgKCFtY19yZWRyYXdfcm93ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgcm93LCBhcmVhLCByb3ct PngsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT51c2VkW2FyZWFd LCB0cnVlLCBEUkFXX05PUk1BTF9URVhULAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIFVQREFURV9XSU5ET1dfX1JFRFJBV19PVkVSTEFQUEVEX1JPV1MpCisgICAgICAgICAgICAg ICAgICAmJiByb3ctPnVzZWRbYXJlYV0pCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgRlJBTUVfUklGIChmKS0+d3JpdGVfZ2x5cGhzICh3LCByb3csIHJvdy0+Z2x5cGhzW2Fy ZWFdLCBhcmVhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICByb3ctPnVzZWRbYXJlYV0pOworICAgICAgICAgICAgICAgICAgRlJBTUVfUklGIChmKS0+Y2xl YXJfZW5kX29mX2xpbmUgKHcsIHJvdywgYXJlYSwgLTEpOworICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgIH0KKyAgICAgICAgICByb3ctPm92ZXJsYXBwZWRfcCA9IDA7CisgICAgICAgIH0K KyAgICAgIGlmIChNQVRSSVhfUk9XX0JPVFRPTV9ZIChyb3cpID49IHliKQorICAgICAgICBicmVh azsKKyAgICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgICAgICByZWRyYXdf b3ZlcmxhcHBpbmdfcm93cyAodywgeWIpOwogCSAgICB9CiAjZW5kaWYKQEAgLTM1MzEsMTAgKzU1 MTQsMjEgQEAgdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wKQog ICAgICAgc3RyY3B5ICh3LT5jdXJyZW50X21hdHJpeC0+bWV0aG9kLCB3LT5kZXNpcmVkX21hdHJp eC0+bWV0aG9kKTsKICNlbmRpZgogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCisgIGlmIChCVUZG RVJQICh3LT5jb250ZW50cykKKyAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICBtY191cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIDAp OworICAgIGVsc2UKICAgICAgIHVwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgMCk7CiAjZW5kaWYK IAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgLyogRW5kIHRoZSB1cGRhdGUg b2Ygd2luZG93IFcuICBEb24ndCBzZXQgdGhlIGN1cnNvciBpZiB3ZQogICAgICAgICAgcGF1c2Vk IHVwZGF0aW5nIHRoZSBkaXNwbGF5IGJlY2F1c2UgaW4gdGhpcyBjYXNlLAogICAgICAgICAgc2V0 X3dpbmRvd19jdXJzb3JfYWZ0ZXJfdXBkYXRlIGhhc24ndCBiZWVuIGNhbGxlZCwgYW5kCmRpZmYg LS1naXQgYS9zcmMvZnJhbWUuaCBiL3NyYy9mcmFtZS5oCmluZGV4IGVjOGY2MTQuLmVlYWY3MWUg MTAwNjQ0Ci0tLSBhL3NyYy9mcmFtZS5oCisrKyBiL3NyYy9mcmFtZS5oCkBAIC0yMDUsNiArMjA1 LDE2IEBAIHN0cnVjdCBmcmFtZQogICBMaXNwX09iamVjdCB0b29sX2Jhcl9pdGVtczsKICAgLyog dG9vbF9iYXJfaXRlbXMgc2hvdWxkIGJlIHRoZSBsYXN0IExpc3BfT2JqZWN0IG1lbWJlci4gICov CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK KyAgLyogTm9uLW5pbCB3aGVuIHRoZSBmcmFtZSBpcyBpbiB0aGUgcHJvY2VzcyBvZiBiZWluZyB1 cGRhdGVkLiAqLworICBzdHJ1Y3QgZnJhbWUgKm1jX3VwZGF0aW5nX2ZyYW1lOworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiog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mLCAweDFiLCAweDMzLCAweDYzLCAweDMsIDB4MywgMHgzfTsKKworLyog MjYKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHh4eHh4eHgiCisg ICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4ueHguLngiCisgICAg ICAieC4uLnh4LngiCisgICAgICAieC4uLi54eHgiCisgICAgICAieC54eHh4eHgiCisgICAgICAi eC54eHh4eHgiCisgICAgICAieC4uLi54eHgiCisgICAgICAieC4uLnh4LngiCisgICAgICAieC4u eHguLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieHh4eHh4 eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0 X2Fycm93X2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweDk5LCAweDhkLCAweDg3LCAw eGJmLAorICAweGJmLCAweDg3LCAweDhkLCAweDk5LCAweDgxLCAweDgxLCAweGZmfTsKKworLyog MjcKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHh4eHh4eHgiCisg ICAgICAieC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieC54eC4ueHgiCisgICAg ICAieC4ueHgueHgiCisgICAgICAieC4uLnh4eHgiCisgICAgICAieHh4eHh4eHgiCisgICAgICAi eHh4eHh4eHgiCisgICAgICAieC4uLnh4eHgiCisgICAgICAieC4ueHgueHgiCisgICAgICAieC54 eC4ueHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieHh4eHh4 eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19yZXZlcnNlZF9ob2xsb3dfcmVjdGFu Z2xlX3JpZ2h0X2Fycm93X2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweGIxLCAweDk5 LCAweDhkLCAweGZmLAorICAweGZmLCAweDhkLCAweDk5LCAweGIxLCAweDgxLCAweDgxLCAweGZm fTsKKworLyogMjgKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHh4 eHh4eHgiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4u LngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngi CisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisg ICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAg ICAieHh4eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19ob2xsb3dfcmVjdGFu Z2xlX2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgx LAorICAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweGZmfTsKKworLyogMjkK KyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC4uLi4uLi4iCisgICAg ICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAi eC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4u Li4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4u Li4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4i KQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY192ZXJ0aWNhbF9iYXJfYml0c1tdID17Cisg IDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsCisgIDB4ODAsIDB4ODAs IDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODB9OworCisvKiAzMAorICAgICgrLWZyaW5nZS1o ZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAg ICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAg ICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIu Li4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4u Li54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIpCisqLworc3RhdGljIHVu c2lnbmVkIHNob3J0IG1jX3JldmVyc2VkX3ZlcnRpY2FsX2Jhcl9iaXRzW10gPXsKKyAgMHgzLCAw eDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgz LCAweDN9OworCisvKiAzMQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAg ICJ4eC4uLi4uLiIKKyAgICAgICJ4eC4uLi4uLiIKKyAgICAgICIgeHguLi4uLiIKKyAgICAgICIu eHguLi4uLiIKKyAgICAgICIuLnh4Li4uLiIKKyAgICAgICIuLnh4Li4uLiIKKyAgICAgICIuLi54 eC4uLiIKKyAgICAgICIuLi54eC4uLiIKKyAgICAgICIuLi4ueHguLiIKKyAgICAgICIuLi4ueHgu LiIKKyAgICAgICIuLi4uLnh4LiIKKyAgICAgICIuLi4uLnh4LiIKKyAgICAgICIuLi4uLi54eCIK KyAgICAgICIuLi4uLi54eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX2JhY2tzbGFz aF9iaXRzW10gPXsKKyAgMHhjMCwgMHhjMCwgMHhlMCwgMHg2MCwgMHgzMCwgMHgzMCwgMHgxOCwg MHgxOCwgMHhjLCAweGMsIDB4NiwgMHg2LCAweDMsIDB4M307CisKKy8qIDMyCisgICAgKCstZnJp bmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Li4uLi4uIgorICAgICAgInh4Li4uLi4u IgorICAgICAgInh4eC4uLi4uIgorICAgICAgInh4eC4uLi4uIgorICAgICAgIngueHguLi4uIgor ICAgICAgIngueHguLi4uIgorICAgICAgInguLnh4Li4uIgorICAgICAgInguLnh4Li4uIgorICAg ICAgInguLi54eC4uIgorICAgICAgInguLi54eC4uIgorICAgICAgInguLi4ueHguIgorICAgICAg InguLi4ueHguIgorICAgICAgInguLi4uLnh4IgorICAgICAgInguLi4uLnh4IikKKyovCitzdGF0 aWMgdW5zaWduZWQgc2hvcnQgbWNfdmVydGljYWxfYmFyX2JhY2tzbGFzaF9iaXRzW10gPXsKKyAg MHhjMCwgMHhjMCwgMHhlMCwgMHhlMCwgMHhiMCwgMHhiMCwgMHg5OCwKKyAgMHg5OCwgMHg4Yywg MHg4YywgMHg4NiwgMHg4NiwgMHg4MywgMHg4M307CisKKy8qIDMzCisgICAgKCstZnJpbmdlLWhl bHBlci1oZXhhZGVjaW1hbAorICAgICAgIi54eHh4eHguIgorICAgICAgInh4eHgueC4uIgorICAg ICAgInh4eHgueC4uIgorICAgICAgInh4eHgueC4uIgorICAgICAgIi54eHgueC4uIgorICAgICAg Ii4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4u LngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIikKKyovCitzdGF0aWMg dW5zaWduZWQgc2hvcnQgbWNfcGlsY3Jvd19iaXRzW10gPXsKKyAgMHg3ZSwgMHhmNCwgMHhmNCwg MHhmNCwgMHg3NCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNH07CisKKy8qIDM0 CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4ueHh4eC4uIgorICAg ICAgIi54eHh4eHguIgorICAgICAgInguLnh4Li54IgorICAgICAgInguLnh4Li54IgorICAgICAg Inh4eHh4eHh4IgorICAgICAgInh4Li4uLnh4IgorICAgICAgInh4eC4ueHh4IgorICAgICAgIi54 eHh4eHguIgorICAgICAgIi4ueHh4eC4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNf c21pbGV5X2ZhY2VfYml0c1tdID17CisgIDB4M2MsIDB4N2UsIDB4OTksIDB4OTksIDB4ZmYsIDB4 YzMsIDB4ZTcsIDB4N2UsIDB4M2N9OworCisvKiAzNQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4 YWRlY2ltYWwKKyAgICAgICIuLnguLi4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLi4u eC4uLiIKKyAgICAgICIuLi4uLnguLiIKKyAgICAgICIuLi4ueC4uLiIKKyAgICAgICIuLi54Li4u LiIKKyAgICAgICIuLnguLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3Npbmds ZV9hbmdsZV9yaWdodF9iaXRzW10gPXsKKyAgMHgyMCwgMHgxMCwgMHg4LCAweDQsIDB4OCwgMHgx MCwgMHgyMH07CisKKy8qIDM2CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAg ICAgIi4uLi4ueC4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAg Ii4ueC4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4u Li4ueC4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX2xlZnRf Yml0c1tdID17CisgIDB4NCwgMHg4LCAweDEwLCAweDIwLCAweDEwLCAweDgsIDB4NH07CisKKy8q IDM3CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Lnh4Li4uIgor ICAgICAgIi54eC54eC4uIgorICAgICAgIi4ueHgueHguIgorICAgICAgIi4uLnh4Lnh4IgorICAg ICAgIi4ueHgueHguIgorICAgICAgIi54eC54eC4uIgorICAgICAgInh4Lnh4Li4uIikKKyovCitz dGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xlX3JpZ2h0X2JpdHNbXSA9eworICAw eGQ4LCAweDZjLCAweDM2LCAweDFiLCAweDM2LCAweDZjLCAweGQ4fTsKKworLyogMzgKKyAgICAo Ky1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4ueHgueHgiCisgICAgICAiLi54 eC54eC4iCisgICAgICAiLnh4Lnh4Li4iCisgICAgICAieHgueHguLi4iCisgICAgICAiLnh4Lnh4 Li4iCisgICAgICAiLi54eC54eC4iCisgICAgICAiLi4ueHgueHgiKQorKi8KK3N0YXRpYyB1bnNp Z25lZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfbGVmdF9iaXRzW10gPXsKKyAgMHgxYiwgMHgzNiwg MHg2YywgMHhkOCwgMHg2YywgMHgzNiwgMHgxYn07CisKKy8qIDM5CisgICAgKCstZnJpbmdlLWhl bHBlci1oZXhhZGVjaW1hbAorICAgICAgIngueC54Li4uIgorICAgICAgIi54LngueC4uIgorICAg ICAgIi4ueC54LnguIgorICAgICAgIi4uLngueC54IgorICAgICAgIi4ueC54LnguIgorICAgICAg Ii54LngueC4uIgorICAgICAgIngueC54Li4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQg bWNfdHJpcGxlX2FuZ2xlX3JpZ2h0X2JpdHNbXSA9eworICAweGE4LCAweDU0LCAweDJhLCAweDE1 LCAweDJhLCAweDU0LCAweGE4fTsKKworLyogNDAKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFk ZWNpbWFsCisgICAgICAiLi4ueC54LngiCisgICAgICAiLi54LngueC4iCisgICAgICAiLngueC54 Li4iCisgICAgICAieC54LnguLi4iCisgICAgICAiLngueC54Li4iCisgICAgICAiLi54LngueC4i CisgICAgICAiLi4ueC54LngiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190cmlwbGVf YW5nbGVfbGVmdF9iaXRzW10gPXsKKyAgMHgxNSwgMHgyYSwgMHg1NCwgMHhhOCwgMHg1NCwgMHgy YSwgMHgxNX07CisKKy8qIDQxCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAg ICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAg Ii4uLi4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54 Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4u Li4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIikKKyovCitzdGF0aWMgdW5z aWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDAwLCAweDAwLCAw eDAwLCAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDgyLCAweDAwLCAweDAwLCAweDAwLCAweDAw fTsKKworLyogNDIKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4u Li4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4u Li4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4i CisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisg ICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBz aG9ydCBtY19zaW5nbGVfYW5nbGVfZG93bl9iaXRzW10gPXsKKyAgMHgwMCwgMHgwMCwgMHgwMCwg MHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHgxMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMH07CisK Ky8qIDQzCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4uLi4u IgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLnguLi4uIgor ICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAg ICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAgICAg Ii4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIikKKyovCitzdGF0 aWMgdW5zaWduZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDAwLCAw eDAwLCAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDgyLCAweDAw LCAweDAwLCAweDAwfTsKKworLyogNDQKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFs CisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisg ICAgICAieC4uLi4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAg ICAieC4ueC4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAi Li4ueC4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4u Li4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfZG93bl9i aXRzW10gPXsKKyAgMHgwMCwgMHgwMCwgMHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0 NCwgMHgyOCwgMHgxMCwgMHgwMCwgMHgwMCwgMHgwMH07CisKKy8qIDQ1CisgICAgKCstZnJpbmdl LWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLnguLi4uIgor ICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAg ICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAg Ii4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAgICAgIi4u Li4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdHJpcGxlX2FuZ2xlX3VwX2Jp dHNbXSA9eworICAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDky LCAweDI4LCAweDQ0LCAweDgyLCAweDAwfTsKKworLyogNDYKKyAgICAoKy1mcmluZ2UtaGVscGVy LWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAi LnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLngu Li54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54 Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLi4uLi4i KQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19xdWFkcnVwbGVfYW5nbGVfZG93bl9iaXRz W10gPXsKKyAgMHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHg5Miwg MHg0NCwgMHgyOCwgMHgxMCwgMHgwMH07CisKKy8qIDQ3CisgICAgKCstZnJpbmdlLWhlbHBlci1o ZXhhZGVjaW1hbAorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54 Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4u eC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4u IgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgor ICAgICAgInguLi4uLnguIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcXVhZHJ1cGxl X2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0 LCAweDkyLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDgyfTsKKworLyogNDgKKyAg ICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC4uLi4ueC4iCisgICAgICAi LnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLngu Li54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54 Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54Li4i CisgICAgICAiLi54LnguLi4iCisgICAgICAiLi4ueC4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25l ZCBzaG9ydCBtY190cmlwbGVfYW5nbGVfZG93bl9iaXRzW10gPXsKKyAgMHg4MiwgMHg0NCwgMHgy OCwgMHg5MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwg MHgxMH07CisKIC8qIE5PVEU6ICBUaGUgb3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HZh bHVlIGlmIG5vdCBmb3VuZCBoZXJlLgorICAgICBJZiBub3QgcGFydGlhbCwgb3Igbm8gcGFydGlh bCBzcGVjIGlzIHByZXNlbnQsIHVzZSBub24tcGFydGlhbCBiaXRtYXAuICovCitpbnQKK21jX2dl dF9mcmluZ2VfYml0bWFwIChzdHJ1Y3Qgd2luZG93ICp3LCBMaXNwX09iamVjdCBiaXRtYXAsIGlu dCByaWdodF9wLCBpbnQgcGFydGlhbF9wKQoreworICBMaXNwX09iamVjdCBjbWFwLCBibTEgPSBR bmlsLCBibTIgPSBRbmlsLCBibTsKKyAgRU1BQ1NfSU5UIGxuMSA9IDAsIGxuMiA9IDA7CisgIGlu dCBpeDEgPSByaWdodF9wOworICBpbnQgaXgyID0gaXgxICsgKHBhcnRpYWxfcCA/IDIgOiAwKTsK KyAgaWYgKChjbWFwID0gQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmcmluZ2VfaW5kaWNh dG9yX2FsaXN0KSksICFOSUxQIChjbWFwKSkKKyAgICB7CisgICAgICBibTEgPSBtY19hc3NxIChi aXRtYXAsIGNtYXApOworICAgICAgaWYgKENPTlNQIChibTEpKQorICB7CisgICAgaWYgKChibTEg PSBYQ0RSIChibTEpKSwgTklMUCAoYm0xKSkKKyAgICAgIHJldHVybiBNQ19OT19GUklOR0VfQklU TUFQOworICAgIGlmIChDT05TUCAoYm0xKSkKKyAgICAgIHsKKyAgICAgICAgbG4xID0gWEZJWE5V TSAoRmxlbmd0aCAoYm0xKSk7CisgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgICAgICAgewor ICAgICAgICAgICAgaWYgKGxuMSA+IGl4MikKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMSk7CisgICAgICAgICAgICAgICAgaWYgKCFFUSAoYm0s IFF0KSkKKyAgICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICAgIH0KKyAg ICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBp ZiAobG4xID4gaXgxKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGJtID0g bWNfbnRoIChpeDEsIGJtMSk7CisgICAgICAgICAgICAgICAgICBpZiAoIUVRIChibSwgUXQpKQor ICAgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5kOworICAgICAgICAgICAgICAgIH0KKyAgICAg ICAgICAgIH0KKyAgICAgIH0KKyAgICBlbHNlIGlmICgoYm0gPSBibTEsICFFUSAoYm0sIFF0KSkp CisgICAgICBnb3RvIGZvdW5kOworICB9CisgICAgfQorICBpZiAoIUVRIChjbWFwLCBCVkFSICgm YnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkKKyAgICAgICYmICFOSUxQ IChCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkpCisgICAg eworICAgICAgYm0yID0gbWNfYXNzcSAoYml0bWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBm cmluZ2VfaW5kaWNhdG9yX2FsaXN0KSk7CisgICAgICBpZiAoQ09OU1AgKGJtMikpCisgICAgICAg IHsKKyAgICAgICAgICBpZiAoKGJtMiA9IFhDRFIgKGJtMikpLCAhTklMUCAoYm0yKSkKKyAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKENPTlNQIChibTIpKQorICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgIGxuMiA9IFhGSVhOVU0gKEZsZW5ndGggKGJtMikpOworICAg ICAgICAgICAgICAgICAgaWYgKHBhcnRpYWxfcCkKKyAgICAgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgICAgIGlmIChsbjIgPiBpeDIpCisgICAgICAgICAgICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMik7Cisg ICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAg ICAgICAgfQorICAgIH0KKyAgaWYgKGxuMSA+IGl4MSkKKyAgICB7CisgICAgICBibSA9IG1jX250 aCAoaXgxLCBibTEpOworICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAgZ290byBmb3Vu ZDsKKyAgICB9CisgIGlmIChsbjIgPiBpeDEpCisgICAgeworICAgICAgYm0gPSBtY19udGggKGl4 MSwgYm0yKTsKKyAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgIGdvdG8gZm91bmQ7Cisg ICAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICB9CisgICAgZWxzZSBpZiAoKGJt ID0gYm0yLCBOSUxQIChibSkpKQorICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7Cisg IGZvdW5kOgorICByZXR1cm4gbG9va3VwX2ZyaW5nZV9iaXRtYXAgKGJtKTsKK30KKworc3RhdGlj IGludAorbWNfZ2V0X2xvZ2ljYWxfY3Vyc29yX2JpdG1hcCAoc3RydWN0IHdpbmRvdyAqdywgTGlz cF9PYmplY3QgY3Vyc29yKQoreworICBMaXNwX09iamVjdCBjbWFwLCBibSA9IFFuaWw7CisgIGlm ICgoY21hcCA9IEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZnJpbmdlX2N1cnNvcl9hbGlz dCkpLCAhTklMUCAoY21hcCkpCisgICAgeworICAgICAgYm0gPSBtY19hc3NxIChjdXJzb3IsIGNt YXApOworICAgICAgaWYgKENPTlNQIChibSkpCisgICAgICAgIHsKKyAgICAgICA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Bmb3IgbGVmdCByaWdodCAod2hldGhlciBwYXJ0aWFsIG9y IG5vdCkKKyAgKEwgUiBQTCBQUikgIC0tIHVzZSBmb3IgbGVmdCByaWdodCBwYXJ0aWFsLWxlZnQg cGFydGlhbC1yaWdodAorICBJZiBhbnkgdmFsdWUgaW4gbG9jYWwgYmluZGluZyBpcyBub3QgcHJl c2VudCBvciB0LCB1c2UgZ2xvYmFsIHZhbHVlLgorICAgICBJZiBwYXJ0aWFsLCBsb29rdXAgcGFy dGlhbCBiaXRtYXAgaW4gZGVmYXVsdCB2YWx1ZSBpZiBub3QgZm91bmQgaGVyZS4KKyAgICAgSWYg bm90IHBhcnRpYWwsIG9yIG5vIHBhcnRpYWwgc3BlYyBpcyBwcmVzZW50LCB1c2Ugbm9uLXBhcnRp YWwgYml0bWFwLiAgKi8KKyAgaWYgKChjbWFwID0gQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMp LCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSksICFOSUxQIChjbWFwKSkKKyAgICB7CisgICAgICBi bTEgPSBtY19hc3NxIChiaXRtYXAsIGNtYXApOworICAgICAgaWYgKENPTlNQIChibTEpKQorICAg ICAgICB7CisgICAgICAgICAgaWYgKChibTEgPSBYQ0RSIChibTEpKSwgTklMUCAoYm0xKSkKKyAg ICAgICAgICAgIHJldHVybiBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgIGlmIChDT05T UCAoYm0xKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbG4xID0gWEZJWE5VTSAoRmxl bmd0aCAoYm0xKSk7CisgICAgICAgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgaWYgKGxuMSA+IGl4MikKKyAgICAgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMSk7CisgICAg ICAgICAgICAgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAgICAgICAgICAgICAg ICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgICBpZiAobG4xID4gaXgxKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAgICAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMSk7CisgICAgICAgICAgICAgICAg ICAgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICBnb3Rv IGZvdW5kOworICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKChibSA9IGJtMSwgIUVRIChibSwgUXQp KSkKKyAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgfQorICAgIH0KKyAgaWYgKCFF USAoY21hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRvcl9hbGlzdCkp CisgICAgICAmJiAhTklMUCAoQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRv cl9hbGlzdCkpKQorICAgIHsKKyAgICAgIGJtMiA9IG1jX2Fzc3EgKGJpdG1hcCwgQlZBUiAoJmJ1 ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpOworICAgICAgaWYgKENPTlNQ IChibTIpKQorICAgICAgICB7CisgICAgICAgICAgaWYgKChibTIgPSBYQ0RSIChibTIpKSwgIU5J TFAgKGJtMikpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmIChDT05TUCAoYm0yKSkK KyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBsbjIgPSBYRklYTlVNIChGbGVu Z3RoIChibTIpKTsKKyAgICAgICAgICAgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgICAgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBpZiAobG4yID4gaXgyKQorICAgICAg ICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICBibSA9IG1jX250 aCAoaXgyLCBibTIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIUVRIChibSwgUXQp KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIGlmIChsbjEgPiBpeDEpCisgICAgewor ICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0xKTsKKyAgICAgIGlmICghRVEgKGJtLCBRdCkpCisg ICAgICAgIGdvdG8gZm91bmQ7CisgICAgfQorICBpZiAobG4yID4gaXgxKQorICAgIHsKKyAgICAg IGJtID0gbWNfbnRoIChpeDEsIGJtMik7CisgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAg ICBnb3RvIGZvdW5kOworICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgfQor ICAgIGVsc2UgaWYgKChibSA9IGJtMiwgTklMUCAoYm0pKSkKKyAgICAgIHJldHVybiBNQ19OT19G UklOR0VfQklUTUFQOworICBmb3VuZDoKKyAgcmV0dXJuIGxvb2t1cF9mcmluZ2VfYml0bWFwIChi bSk7Cit9CisKKy8qIFJlY2FsY3VsYXRlIHRoZSBiaXRtYXBzIHRvIHNob3cgaW4gdGhlIGZyaW5n ZXMgb2Ygd2luZG93IFcuCisgICBPbmx5IG1hcmsgcm93cyB3aXRoIG1vZGlmaWVkIGJpdG1hcHMg Zm9yIHVwZGF0ZSBpbiByZWRyYXdfZnJpbmdlX2Jp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9wLiAgKi8KKyAgaW50IHRvcF9yb3dfZW5kc19hdF96dl9wIE1DX0lGX0xJTlQgKD0gMCksIGJv dF9yb3dfZW5kc19hdF96dl9wIE1DX0lGX0xJTlQgKD0gMCk7CisgIGlmICh3LT5wc2V1ZG9fd2lu ZG93X3ApCisgICAgcmV0dXJuIDA7CisgIGlmICghTUlOSV9XSU5ET1dfUCAodykKKyAgICAgICYm IChpbmQgPSBCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGluZGljYXRlX2J1ZmZlcl9ib3Vu ZGFyaWVzKSwgIU5JTFAgKGluZCkpKQorICAgIHsKKyAgICAgIGlmIChFUSAoaW5kLCBRbGVmdCkg fHwgRVEgKGluZCwgUXJpZ2h0KSkKKyAgICAgICAgYm91bmRhcnlfdG9wID0gYm91bmRhcnlfYm90 ID0gYXJyb3dfdG9wID0gYXJyb3dfYm90ID0gaW5kOworICAgICAgICBlbHNlIGlmIChDT05TUCAo aW5kKQorICAgICAgICAgICAgICAgICAmJiBDT05TUCAoWENBUiAoaW5kKSkpCisgICAgICAgIHsK KyAgICAgICAgICBMaXNwX09iamVjdCBwb3M7CisgICAgICAgICAgaWYgKHBvcyA9IG1jX2Fzc3Eg KFF0LCBpbmQpLCAhTklMUCAocG9zKSkKKyAgICAgICAgICAgIGJvdW5kYXJ5X3RvcCA9IGJvdW5k YXJ5X2JvdCA9IGFycm93X3RvcCA9IGFycm93X2JvdCA9IFhDRFIgKHBvcyk7CisgICAgICAgICAg aWYgKHBvcyA9IG1jX2Fzc3EgKFF0b3AsIGluZCksICFOSUxQIChwb3MpKQorICAgICAgICAgICAg Ym91bmRhcnlfdG9wID0gWENEUiAocG9zKTsKKyAgICAgICAgICBpZiAocG9zID0gbWNfYXNzcSAo UWJvdHRvbSwgaW5kKSwgIU5JTFAgKHBvcykpCisgICAgICAgICAgICBib3VuZGFyeV9ib3QgPSBY Q0RSIChwb3MpOworICAgICAgICAgIGlmIChwb3MgPSBtY19hc3NxIChRdXAsIGluZCksICFOSUxQ IChwb3MpKQorICAgICAgICAgICAgYXJyb3dfdG9wID0gWENEUiAocG9zKTsKKyAgICAgICAgICBp ZiAocG9zID0gbWNfYXNzcSAoUWRvd24sIGluZCksICFOSUxQIChwb3MpKQorICAgICAgICAgICAg YXJyb3dfYm90ID0gWENEUiAocG9zKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAg ICAgLyogQW55dGhpbmcgZWxzZSBtZWFucyBib3VuZGFyeSBvbiBsZWZ0IGFuZCBubyBhcnJvd3Mu ICAqLworICAgICAgICAgIGJvdW5kYXJ5X3RvcCA9IGJvdW5kYXJ5X2JvdCA9IFFsZWZ0OworICAg IH0KKyAgdG9wX2luZF9ybiA9IGJvdF9pbmRfcm4gPSAtMTsKKyAgaWYgKCFOSUxQIChpbmQpKQor ICAgIHsKKyAgICAgIGZvciAoeSA9IHctPnZzY3JvbGwsIHJuID0gMDsKKyAgICAgICAgICAgeSA8 IHliICYmIHJuIDwgbnJvd3M7CisgICAgICAgICAgIHkgKz0gcm93LT5oZWlnaHQsICsrcm4pCisg ICAgICAgIHsKKyAgICAgICAgICByb3cgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHJuOwor ICAgICAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgICAgICAgICByb3cgPSB3LT5jdXJy ZW50X21hdHJpeC0+cm93cyArIHJuOworICAgICAgICAgIHJvdy0+aW5kaWNhdGVfYm9iX3AgPSBy b3ctPmluZGljYXRlX3RvcF9saW5lX3AgPSAwOworICAgICAgICAgIHJvdy0+aW5kaWNhdGVfZW9i X3AgPSByb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3AgPSAwOworICAgICAgICAgIGlmICghcm93 LT5tb2RlX2xpbmVfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKHRvcF9pbmRf cm4gPCAwICYmIHJvdy0+dmlzaWJsZV9oZWlnaHQgPiAwKQorICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAgIGlmIChNQVRSSVhfUk9XX1NUQVJUX0NIQVJQT1MgKHJvdykgPD0gQlVG X0JFR1YgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSkKKyAgICAgICAgICAgICAgICAgICAgICAmJiAh TUFUUklYX1JPV19QQVJUSUFMTFlfVklTSUJMRV9BVF9UT1BfUCAodywgcm93KSkKKyAgICAgICAg ICAgICAgICAgICAgcm93LT5pbmRpY2F0ZV9ib2JfcCA9ICFOSUxQIChib3VuZGFyeV90b3ApOwor ICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgcm93LT5pbmRp Y2F0ZV90b3BfbGluZV9wID0gIU5JTFAgKGFycm93X3RvcCk7CisgICAgICAgICAgICAgICAgICB0 b3BfaW5kX3JuID0gcm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBpZiAoYm90 X2luZF9ybiA8IDApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgaWYgKE1B VFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgPj0gQlVGX1pWIChYQlVGRkVSICh3LT5jb250ZW50 cykpCisgICAgICAgICAgICAgICAgICAgICAgJiYgIU1BVFJJWF9ST1dfUEFSVElBTExZX1ZJU0lC TEVfQVRfQk9UVE9NX1AgKHcsIHJvdykpCisgICAgICAgICAgICAgICAgICAgIHJvdy0+aW5kaWNh dGVfZW9iX3AgPSAhTklMUCAoYm91bmRhcnlfYm90KSwgYm90X2luZF9ybiA9IHJuOworICAgICAg ICAgICAgICAgICAgICBlbHNlIGlmICh5ICsgcm93LT5oZWlnaHQgPj0geWIpCisgICAgICAgICAg ICAgICAgICAgICAgcm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wID0gIU5JTFAgKGFycm93X2Jv dCksIGJvdF9pbmRfcm4gPSBybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9Cisg ICAgICAgIH0KKyAgICB9CisgIGV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ib3R0b20tYWxpZ25lZCBib3R0b20KKyAgICAgaW5k aWNhdG9yKSB0byBhZGphY2VudCByb3dzIGlmIGl0IGRvZXNuJ3QgZml0IGluIG9uZSByb3cuICAq LworICB0b3BfaW5kX21pbl95ID0gYm90X2luZF9tYXhfeSA9IC0xOworICBpZiAodG9wX2luZF9y biA+PSAwKQorICAgIHsKKyAgICAgIGludCBibiA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAg ICByb3cgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHRvcF9pbmRfcm47CisgICAgICBpZiAo IXJvdy0+ZW5hYmxlZF9wKQorICAgICAgICByb3cgPSB3LT5jdXJyZW50X21hdHJpeC0+cm93cyAr IHRvcF9pbmRfcm47CisgICAgICB0b3Bfcm93X2VuZHNfYXRfenZfcCA9IHJvdy0+ZW5kc19hdF96 dl9wOworICAgICAgaWYgKHJvdy0+aW5kaWNhdGVfYm9iX3ApCisgICAgICAgIHsKKyAgICAgICAg ICBpZiAoRVEgKGJvdW5kYXJ5X3RvcCwgUWxlZnQpKQorICAgICAgICAgICAgYm4gPSAoKHJvdy0+ aW5kaWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5kYXJ5X2JvdCwgUWxlZnQpKQorICAgICAgICAgICAg ICAgICAgPyBNQ19MRUZUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20sIHJvdy0+ZW5kc19hdF96dl9w KQorICAgICAgICAgICAgICAgICAgOiBNQ19MRUZUX0ZSSU5HRSAoMiwgUXRvcCwgMCkpOworICAg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBibiA9ICgocm93LT5pbmRpY2F0ZV9lb2JfcCAm JiBFUSAoYm91bmRhcnlfYm90LCBRcmlnaHQpKQorICAgICAgICAgICAgICAgICAgICA/IE1DX1JJ R0hUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKQorICAgICAgICAg ICAgICAgICAgICA6IE1DX1JJR0hUX0ZSSU5HRSAoMiwgUXRvcCwgMCkpOworICAgICAgICB9Cisg ICAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcCkKKyAgICAgICAgICB7Cisg ICAgICAgICAgICBpZiAoRVEgKGFycm93X3RvcCwgUWxlZnQpKQorICAgICAgICAgICAgICBibiA9 IE1DX0xFRlRfRlJJTkdFICg2LCBRdXAsIDApOworICAgICAgICAgICAgICBlbHNlCisgICAgICAg ICAgICAgICAgYm4gPSBNQ19SSUdIVF9GUklOR0UgKDYsIFF1cCwgMCk7CisgICAgICAgICAgfQor ICAgICAgaWYgKGJuICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgIHsKKyAgICAgICAg ICBzdHJ1Y3QgZnJpbmdlX2JpdG1hcCAqZmIgPSBnZXRfZnJpbmdlX2JpdG1hcF9kYXRhIChibik7 CisgICAgICAgICAgaWYgKGZiLT5hbGlnbiA9PSBBTElHTl9CSVRNQVBfVE9QICYmIGZiLT5wZXJp b2QgPT0gMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAq cm93MTsKKyAgICAgICAgICAgICAgaW50IHRvcF9pbmRfbWF4X3k7CisgICAgICAgICAgICAgIHRv cF9pbmRfbWluX3kgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgICAgICAgICAg ICAgdG9wX2luZF9tYXhfeSA9IHRvcF9pbmRfbWluX3kgKyBmYi0+aGVpZ2h0OworICAgICAgICAg ICAgICBpZiAodG9wX2luZF9tYXhfeSA+IHliKQorICAgICAgICAgICAgICAgIHRvcF9pbmRfbWF4 X3kgPSB5YjsKKyAgICAgICAgICAgICAgZm9yICh5ID0gcm93LT55ICsgcm93LT5oZWlnaHQsIHJu ID0gdG9wX2luZF9ybiArIDE7CisgICAgICAgICAgICAgICAgICAgeSA8IHRvcF9pbmRfbWF4X3kg JiYgcm4gPCBucm93czsKKyAgICAgICAgICAgICAgICAgICB5ICs9IHJvdzEtPmhlaWdodCwgcm4r KykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBpZiAoYm90X2luZF9ybiA+ PSAwICYmIHJuID49IGJvdF9pbmRfcm4pCisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAg ICAgICAgICAgICAgICAgcm93MSA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgcm47CisgICAg ICAgICAgICAgICAgICBpZiAoIXJvdzEtPmVuYWJsZWRfcCkKKyAgICAgICAgICAgICAgICAgICAg cm93MSA9IHctPmN1cnJlbnRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgICAgICAgICBy b3cxLT5pbmRpY2F0ZV9ib2JfcCA9IHJvdy0+aW5kaWNhdGVfYm9iX3A7CisgICAgICAgICAgICAg ICAgICByb3cxLT5pbmRpY2F0ZV90b3BfbGluZV9wID0gcm93LT5pbmRpY2F0ZV90b3BfbGluZV9w OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAg aWYgKGJvdF9pbmRfcm4gPj0gMCkKKyAgICB7CisgICAgICBpbnQgYm4gPSBNQ19OT19GUklOR0Vf QklUTUFQOworICAgICAgcm93ID0gdy0+ZGVzaXJlZF9tYXRyaXgtPnJvd3MgKyBib3RfaW5kX3Ju OworICAgICAgaWYgKCFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgcm93ID0gdy0+Y3VycmVudF9t YXRyaXgtPnJvd3MgKyBib3RfaW5kX3JuOworICAgICAgYm90X3Jvd19lbmRzX2F0X3p2X3AgPSBy b3ctPmVuZHNfYXRfenZfcDsKKyAgICAgIGlmIChyb3ctPmluZGljYXRlX2VvYl9wKQorICAgICAg ICB7CisgICAgICAgICAgaWYgKEVRIChib3VuZGFyeV9ib3QsIFFsZWZ0KSkKKyAgICAgICAgICAg IGJuID0gTUNfTEVGVF9GUklOR0UgKDMsIFFib3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKTsKKyAg ICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgYm4gPSBNQ19SSUdIVF9GUklOR0UgKDMsIFFi b3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChy b3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3ApCisgICAgICAgICAgeworICAgICAgICAgICAgaWYg KEVRIChhcnJvd19ib3QsIFFsZWZ0KSkKKyAgICAgICAgICAgICAgYm4gPSBNQ19MRUZUX0ZSSU5H RSAoNywgUWRvd24sIDApOworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgYm4g PSBNQ19SSUdIVF9GUklOR0UgKDcsIFFkb3duLCAwKTsKKyAgICAgICAgICB9CisgICAgICBpZiAo Ym4gIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBm cmluZ2VfYml0bWFwICpmYiA9IGdldF9mcmluZ2VfYml0bWFwX2RhdGEgKGJuKTsKKyAgICAgICAg ICBpZiAoZmItPmFsaWduID09IEFMSUdOX0JJVE1BUF9CT1RUT00gJiYgZmItPnBlcmlvZCA9PSAw KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cxOwor ICAgICAgICAgICAgICBpbnQgYm90X2luZF9taW5feTsKKyAgICAgICAgICAgICAgYm90X2luZF9t YXhfeSA9IHJvdy0+eSArIHJvdy0+dmlzaWJsZV9oZWlnaHQ7CisgICAgICAgICAgICAgIGJvdF9p bmRfbWluX3kgPSBib3RfaW5kX21heF95IC0gZmItPmhlaWdodDsKKyAgICAgICAgICAgICAgaWYg KGJvdF9pbmRfbWluX3kgPCBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KSkKKyAgICAgICAg ICAgICAgICBib3RfaW5kX21pbl95ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7Cisg ICAgICAgICAgICAgIGZvciAoeSA9IHJvdy0+eSwgcm4gPSBib3RfaW5kX3JuIC0gMTsKKyAgICAg ICAgICAgICAgICAgICB5ID49IGJvdF9pbmRfbWluX3kgJiYgcm4gPj0gMDsKKyAgICAgICAgICAg ICAgICAgICB5IC09IHJvdzEtPmhlaWdodCwgcm4tLSkKKyAgICAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgICBpZiAodG9wX2luZF9ybiA+PSAwICYmIHJuIDw9IHRvcF9pbmRfcm4pCisg ICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgcm93MSA9IHctPmRl c2lyZWRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgICAgICAgICBpZiAoIXJvdzEtPmVu YWJsZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgcm93MSA9IHctPmN1cnJlbnRfbWF0cml4LT5y b3dzICsgcm47CisgICAgICAgICAgICAgICAgICByb3cxLT5pbmRpY2F0ZV9lb2JfcCA9IHJvdy0+ aW5kaWNhdGVfZW9iX3A7CisgICAgICAgICAgICAgICAgICByb3cxLT5pbmRpY2F0ZV9ib3R0b21f bGluZV9wID0gcm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wOworICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgTGlzcF9PYmplY3QgYnVmID0gdy0+ Y29udGVudHM7CisgIENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgYm9vbCBhdXRvX2hzY3JvbGxfbW9k ZV9wID0gRVEgKEZidWZmZXJfbG9jYWxfdmFsdWUgKFFhdXRvX2hzY3JvbGxfbW9kZSwgYnVmKSwg UWN1cnJlbnRfbGluZSk7CisgIC8qIEVYQU1QTEU6ICAoc2Nyb2xsLWxlZnQgNSkgKi8KKyAgYm9v bCBoc2NsX2FsbF90ZW1wX3AgPSAody0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBhbmQgZG8gbm90 aGluZy4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzBfcCA9ICh3LT5zdXNwZW5kX2F1dG9faHNj cm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhzY3JvbGwpOworICAvKiBFWEFN UExFOiAgQy11IEMteCA8IGFuZCBkbyBzb21ldGhpbmcgZWxzZSBiZXNpZGVzIGhvcml6b250YWxs eSBzY3JvbGxpbmcgdGhlCisgICAgICAgICAgICAgICBjdXJyZW50IGxpbmUgZGlmZmVyZW50bHku CisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgaXMgX25vdF8gaG9yaXpvbnRhbGx5IHNjcm9s bGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMV9wID0gKCF3LT5zdXNw ZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNj cm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4g MAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhzY3JvbGwp OworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCAuLi4KKyAgICAgICAgICAgICAgIEN1cnJl bnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisg IGJvb2wgaHNjbF9hbGxfcGVybV8yX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPT0gMAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgKHNj cm9sbC1sZWZ0IDUpOyBhbmQsIHRoZW4gcHJlc3MgdGhlIGxlZnQgYXJyb3cga2V5IG9uZSB0aW1l LgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIF9pc18gaG9yaXpvbnRhbGx5IHNjcm9sbGVk IGRpZmZlcmVudGx5LiovCisgIGJvb2wgaHNjbF90ZW1wX3AgPSAoIXctPnN1c3BlbmRfYXV0b19o c2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAg ICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAg ICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gMCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5k IGRvIHNvbWV0aGluZyB0aGF0IGNhdXNlcyB0aGUgY3VycmVudCBsaW5lIHRvIGJlCisgICAgICAg ICAgICAgICBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuCisgICAgICAgICAgICAg ICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICov CisgIGJvb2wgaHNjbF9wZXJtX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAg ICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAg ICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hz Y3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgIT0gdy0+ aHNjcm9sbCk7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBmb3Ig KHkgPSB3LT52c2Nyb2xsLCBybiA9IDA7CisgICAgICAgeSA8IHliICYmIHJuIDwgbnJvd3M7Cisg ICAgICAgeSArPSByb3ctPmhlaWdodCwgcm4rKykKKyAgICB7CisgIGludCBsZWZ0LCByaWdodDsK KyAgdW5zaWduZWQgbGVmdF9mYWNlX2lkLCByaWdodF9mYWNlX2lkOworICBpbnQgbGVmdF9vZmZz ZXQsIHJpZ2h0X29mZnNldDsKKyAgYm9vbCBwZXJpb2RpY19wOworICByb3cgPSB3LT5kZXNpcmVk X21hdHJpeC0+cm93cyArIHJuOworICBjdXIgPSB3LT5jdXJyZW50X21hdHJpeC0+cm93cyArIHJu OworICBpbnQgdm50aF9kbSA9IE1BVFJJWF9ST1dfVlBPUyAody0+ZGVzaXJlZF9tYXRyaXgtPnJv d3MgKyBybiwgdy0+ZGVzaXJlZF9tYXRyaXgpOworICBpbnQgdm50aF9jbSA9IE1BVFJJWF9ST1df VlBPUyAody0+Y3VycmVudF9tYXRyaXgtPnJvd3MgKyBybiwgdy0+Y3VycmVudF9tYXRyaXgpOwor ICBlb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gICAgICAgZW51bSBmYWNlX2lk IG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICAgICAoIWFjdGl2ZV9wCisgICAgICAg ICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaW5hY3RpdmVf d2luZG93cykpKQorICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJu ICgiKy1vdmVybGF5LWFycm93LWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpCisgICAgICAg ICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywg ZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LXByZS16di1mYWNlIiksIHRydWUpCisgICAgICAg ICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICBtY19sZWZ0X2ZyaW5nZV9mYWNlX2lk ID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gb3ZlcmxheV9hcnJvd19mYWNlX2lkCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICBp ZiAody0+aHNjcm9sbCAhPSAwKQorICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9m cmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ciKSwgZmFsc2UsIHRydWUp OworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0 X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistb3ZlcmxheS1hcnJvdyIpLCB0cnVlLCB0cnVl KTsKKyAgICAgICAgICBtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0gTUNf TEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IGZyaW5nZV9iaXRtYXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19O T19GUklOR0VfQklUTUFQOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKCh2cG9zID09IHZu dGhfZG0gfHwgdnBvcyA9PSB2bnRoX2NtKQorICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2 b3IgPT0gTUNfT1ZFUkxBWV9BUlJPV19CSVRNQVAKKyAgICAgICAgICAgICAgICAgJiYgKGhzY2xf YWxsX3RlbXBfcAorICAgICAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8wX3AKKyAg ICAgICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxsX3Blcm1fMV9wCisgICAgICAgICAgICAgICAg ICAgICB8fCBoc2NsX2FsbF9wZXJtXzJfcAorICAgICAgICAgICAgICAgICAgICAgfHwgaHNjbF90 ZW1wX3AKKyAgICAgICAgICAgICAgICAgICAgIHx8IGhzY2xfcGVybV9wKQorICAgICAgICAgICAg ICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgeworICAgICAgICAgICAgaW50IGZyaW5nZV9i aXRtYXAgPSBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgICAgZW51bSBmYWNlX2lkIG92 ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICAgICAgICghYWN0aXZlX3AKKyAgICAgICAg ICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2luYWN0aXZl X3dpbmRvd3MpKSkKKyAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50 ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtaW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwgdHJ1ZSkK KyAgICAgICAgICAgICAgOiAoYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgPyBsb29rdXBfbmFt ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtcHJlLXp2LWZhY2Ui KSwgdHJ1ZSkKKyAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgICBt Y19sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJ VE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBvdmVybGF5X2Fy cm93X2ZhY2VfaWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBERUZB VUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgICBpZiAoaHNjbF9hbGxfcGVybV8wX3ApCisgICAgICAg ICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgi Ky1oc2NsLXBlcm0iKSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAgICAgICAgZWxzZSBpZiAoaHNj bF9hbGxfcGVybV8xX3ApCisgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9m cmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCB0cnVlLCBmYWxzZSk7Cisg ICAgICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF9hbGxfcGVybV8yX3ApCisgICAgICAgICAgICAg ICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIist aHNjbC1wZXJtIiksIGZhbHNlLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGhz Y2xfcGVybV9wKQorICAgICAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2Zy aW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIHRydWUsIHRydWUpOworICAg ICAgICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX2FsbF90ZW1wX3ApCisgICAgICAgICAgICAg ICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4g KCIrLWhzY2wtdGVtcCIpLCBmYWxzZSwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgIGVs c2UgaWYgKGhzY2xfdGVtcF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1h cCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtdGVtcCIpLCB0cnVl LCBmYWxzZSk7CisgICAgICAgICAgICBtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5 cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICB9CisgICAgICAgICAgZWxz ZSBpZiAoKHZwb3MgPT0gdm50aF9kbSB8fCB2cG9zID09IHZudGhfY20pCisgICAgICAgICAgICAg ICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJP VworICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VE X0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8 IGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFCisgICAgICAgICAgICAgICAgICAg ICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAg ICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElD QUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2 b3IgPT0gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9m bGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAg ICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSCkKKyAgICAgICAg ICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBM aXNwX09iamVjdCBiaXRtYXBfZmxhdm9yID0gKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVD VEFOR0xFX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBRbWNfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VE X0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX2hvbGxvd19yZWN0YW5nbGVfcmlnaHRf YXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBo X2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xlCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElD QUxfQkFSX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9W RVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX3ZlcnRpY2FsX2Jhcl9yaWdodF9hcnJvdworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09 IE1DX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBRbWNfdmVydGljYWxfYmFyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19yZXZlcnNl ZF92ZXJ0aWNhbF9iYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXJfYmFj a3NsYXNoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFFuaWw7 CisgICAgICAgICAgICAgIG1jX3JpZ2h0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0g TUNfUklHSFRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IGxvb2t1cF9mcmluZ2VfYml0bWFwIChiaXRtYXBfZmxhdm9yKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAg ICAgICAgICAgICAgbWNfcmlnaHRfZnJpbmdlX2ZhY2VfaWQgPQorICAgICAgICAgICAgICAgIChj dXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICYm IHJvd19wb3NpdGlvbiA9PSBQUkVfWlYKKyAgICAgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZv ciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAg ICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJ R0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVW RVJTRURfVkVSVElDQUxfQkFSKSkKKyAgICAgICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2Zh Y2UgKHcsIGYsIGludGVybiAoIistcmV2ZXJzZWQtYmFyLXByZS16di1mYWNlIiksIHRydWUpCisg ICAgICAgICAgICAgICAgOiAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAor ICAgICAgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBBVF9aVgorICAgICAgICAgICAg ICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9S SUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNf UkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAg IHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpKQorICAgICAgICAg ICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZXZlcnNlZC1i YXItYXQtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICAgIDogKGN1cnNvcl90eXBlID09 IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRp b24gPT0gUE9TVF9aVgorICAgICAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNf UkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAg ICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FS Uk9XCisgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNF RF9WRVJUSUNBTF9CQVIpKQorICAgICAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAo dywgZiwgaW50ZXJuICgiKy1yZXZlcnNlZC1iYXItcG9zdC16di1mYWNlIiksIHRydWUpCisgICAg ICAgICAgICAgICAgOiAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAorICAg ICAgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYKKyAgICAgICAgICAgICAg ICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdI VF9BUlJPVworICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNF RF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9m bGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAgICAgPyBs b29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1iYXItcHJlLXp2LWZhY2UiKSwgdHJ1 ZSkKKyAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklU TUFQCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IEFUX1pWCisgICAgICAg ICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5H TEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNf UkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgJiYg Z2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAg ICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistYmFyLWF0LXp2LWZhY2Ui KSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklO R0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBPU1RfWlYK KyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfSE9MTE9X X1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAg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GVmdF9wKQorICAgICAgICAgICAgICAgfHwgKHJvdy0+cmV2ZXJzZWRf cCAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKSkKKyAgICAgICAgbGVmdCA9IE1DX0xFRlRf RlJJTkdFICgwLCBRdHJ1bmNhdGlvbiwgMCk7CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRl X2JvYl9wICYmIEVRIChib3VuZGFyeV90b3AsIFFsZWZ0KSkKKyAgICAgICAgeworICAgICAgICAg IGxlZnQgPSAoKHJvdy0+aW5kaWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5kYXJ5X2JvdCwgUWxlZnQp KQorICAgICAgICAgICAgICAgICA/IE1DX0xFRlRfRlJJTkdFICgxLCBRdG9wX2JvdHRvbSwgdG9w X3Jvd19lbmRzX2F0X3p2X3ApCisgICAgICAgICAgICAgICAgIDogTUNfTEVGVF9GUklOR0UgKDIs IFF0b3AsIDApKTsKKyAgICAgICAgICBpZiAodG9wX2luZF9taW5feSA+PSAwKQorICAgICAgICAg ICAgbGVmdF9vZmZzZXQgPSB0b3BfaW5kX21pbl95IC0gcm93LT55OworICAgICAgICB9CisgICAg ICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2VvYl9wICYmIEVRIChib3VuZGFyeV9ib3QsIFFsZWZ0 KSkKKyAgICAgICAgeworICAgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAoMywgUWJvdHRv bSwgYm90X3Jvd19lbmRzX2F0X3p2X3ApOworICAgICAgICAgIGlmIChib3RfaW5kX21heF95ID49 IDApCisgICAgICAgICAgICBsZWZ0X29mZnNldCA9IGJvdF9pbmRfbWF4X3kgLSAocm93LT55ICsg cm93LT52aXNpYmxlX2hlaWdodCk7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKCghcm93LT5y ZXZlcnNlZF9wICYmIE1BVFJJWF9ST1dfQ09OVElOVUFUSU9OX0xJTkVfUCAocm93KSkKKyAgICAg ICAgICAgICAgIHx8IChyb3ctPnJldmVyc2VkX3AgJiYgcm93LT5jb250aW51ZWRfcCkpCisgICAg ICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAoNCwgUWNvbnRpbnVhdGlvbiwgMCk7CisgICAgICBl bHNlIGlmIChyb3ctPmluZGljYXRlX2VtcHR5X2xpbmVfcCAmJiBFUSAoZW1wdHlfcG9zLCBRbGVm dCkpCisgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAoNSwgUWVtcHR5X2xpbmUsIDApOwor ICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV90b3BfbGluZV9wICYmIEVRIChhcnJvd190b3As IFFsZWZ0KSkKKyAgICAgICAgeworICAgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAoNiwg UXVwLCAwKTsKKyAgICAgICAgICBpZiAodG9wX2luZF9taW5feSA+PSAwKQorICAgICAgICAgICAg bGVmdF9vZmZzZXQgPSB0b3BfaW5kX21pbl95IC0gcm93LT55OworICAgICAgICB9CisgICAgICBl bHNlIGlmIChyb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3AgJiYgRVEgKGFycm93X2JvdCwgUWxl ZnQpKQorICAgICAgICB7CisgICAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdFICg3LCBRZG93 biwgMCk7CisgICAgICAgICAgaWYgKGJvdF9pbmRfbWF4X3kgPj0gMCkKKyAgICAgICAgICAgIGxl ZnRfb2Zmc2V0ID0gYm90X2luZF9tYXhfeSAtIChyb3ctPnkgKyByb3ctPnZpc2libGVfaGVpZ2h0 KTsKKyAgICAgICAgfQorICAgICAgZWxzZQorICAgICAgICBsZWZ0ID0gTUNfTk9fRlJJTkdFX0JJ VE1BUDsKKyAgICAgIC8qIERlY2lkZSB3aGljaCBiaXRtYXAgdG8gZHJhdyBpbiB0aGUgcmlnaHQg ZnJpbmdlLiAgKi8KKyAgICAgIGlmIChXSU5ET1dfUklHSFRfRlJJTkdFX1dJRFRIICh3KSA9PSAw KQorICAgICAgICByaWdodCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICBlbHNlIGlmIChy b3ctPnJpZ2h0X3VzZXJfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAg ICAgICB7CisgICAgICAgICAgcmlnaHQgPSByb3ctPnJpZ2h0X3VzZXJfZnJpbmdlX2JpdG1hcDsK KyAgICAgICAgICByaWdodF9mYWNlX2lkID0gcm93LT5yaWdodF91c2VyX2ZyaW5nZV9mYWNlX2lk OworICAgICAgICB9CisgICAgICBlbHNlIGlmICgoIXJvdy0+cmV2ZXJzZWRfcCAmJiByb3ctPnRy dW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgfHwgKHJvdy0+cmV2ZXJzZWRfcCAm JiByb3ctPnRydW5jYXRlZF9vbl9sZWZ0X3ApKQorICAgICAgICByaWdodCA9IE1DX1JJR0hUX0ZS SU5HRSAoMCwgUXRydW5jYXRpb24sIDApOworICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9i b2JfcCAmJiBFUSAoYm91bmRhcnlfdG9wLCBRcmlnaHQpKQorICAgICAgICB7CisgICAgICAgICAg cmlnaHQgPSAoKHJvdy0+aW5kaWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5kYXJ5X2JvdCwgUXJpZ2h0 KSkKKyAgICAgICAgICAgICA/IE1DX1JJR0hUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20sIHRvcF9y b3dfZW5kc19hdF96dl9wKQorICAgICAgICAgICAgIDogTUNfUklHSFRfRlJJTkdFICgyLCBRdG9w LCAwKSk7CisgICAgICAgICAgaWYgKHRvcF9pbmRfbWluX3kgPj0gMCkKKyAgICAgICAgICAgIHJp Z2h0X29mZnNldCA9IHRvcF9pbmRfbWluX3kgLSByb3ctPnk7CisgICAgICAgIH0KKyAgICAgIGVs c2UgaWYgKHJvdy0+aW5kaWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5kYXJ5X2JvdCwgUXJpZ2h0KSkK KyAgICAgICAgeworICAgICAgICAgIHJpZ2h0ID0gTUNfUklHSFRfRlJJTkdFICgzLCBRYm90dG9t LCBib3Rfcm93X2VuZHNfYXRfenZfcCk7CisgICAgICAgICAgaWYgKGJvdF9pbmRfbWF4X3kgPj0g MCkKKyAgICAgICAgICAgIHJpZ2h0X29mZnNldCA9IGJvdF9pbmRfbWF4X3kgLSAocm93LT55ICsg cm93LT52aXNpYmxlX2hlaWdodCk7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKCghcm93LT5y ZXZlcnNlZF9wICYmIHJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAgICB8fCAocm93LT5y ZXZlcnNlZF9wICYmIE1BVFJJWF9ST1dfQ09OVElOVUFUSU9OX0xJTkVfUCAocm93KSkpCisgICAg ICAgIHJpZ2h0ID0gTUNfUklHSFRfRlJJTkdFICg0LCBRY29udGludWF0aW9uLCAwKTsKKyAgICAg IGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcCAmJiBFUSAoYXJyb3dfdG9wLCBRcmln aHQpKQorICAgICAgICB7CisgICAgICAgICAgcmlnaHQgPSBNQ19SSUdIVF9GUklOR0UgKDYsIFF1 cCwgMCk7CisgICAgICAgICAgaWYgKHRvcF9pbmRfbWluX3kgPj0gMCkKKyAgICAgICAgICAgIHJp Z2h0X29mZnNldCA9IHRvcF9pbmRfbWluX3kgLSByb3ctPnk7CisgICAgICAgIH0KKyAgICAgIGVs c2UgaWYgKHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCAmJiBFUSAoYXJyb3dfYm90LCBRcmln aHQpKQorICAgICAgICB7CisgICAgICAgICAgcmlnaHQgPSBNQ19SSUdIVF9GUklOR0UgKDcsIFFk b3duLCAwKTsKKyAgICAgICAgICBpZiAoYm90X2luZF9tYXhfeSA+PSAwKQorICAgICAgICAgICAg cmlnaHRfb2Zmc2V0ID0gYm90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gICB8fCBwZXJpb2Rp Y19wICE9IGN1ci0+ZnJpbmdlX2JpdG1hcF9wZXJpb2RpY19wCisgICAgICAgICAgfHwgY3VyLT5y ZWRyYXdfZnJpbmdlX2JpdG1hcHNfcCkKKyAgICAgICAgeworICAgICAgICAgIHJlZHJhd19wID0g MSwgcm93LT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcCA9IDE7CisgICAgICAgICAgaWYgKCFrZWVw X2N1cnJlbnRfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY3VyLT5yZWRyYXdfZnJp bmdlX2JpdG1hcHNfcCA9IDE7CisgICAgICAgICAgICAgIGlmIChtY19sZWZ0X2ZyaW5nZV9iaXRt YXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAgfHwgbWNfcmlnaHRf ZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgIGN1 ci0+ZnJpbmdlX2JpdG1hcF9wZXJpb2RpY19wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgZWxz ZQorICAgICAgICAgICAgICAgICAgY3VyLT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3AgPSBwZXJp b2RpY19wOworICAgICAgICAgICAgICBpZiAobWNfbGVmdF9mcmluZ2VfYml0bWFwICE9IE1DX05P X0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgY3VyLT5sZWZ0X2ZyaW5nZV9iaXRtYXAg PSBtY19sZWZ0X2ZyaW5nZV9iaXRtYXA7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAg ICAgICAgICAgY3VyLT5sZWZ0X2ZyaW5nZV9iaXRtYXAgPSBsZWZ0OworICAgICAgICAgICAgICBp ZiAobWNfbGVmdF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAg ICAgICAgICAgY3VyLT5sZWZ0X2ZyaW5nZV9mYWN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aW5nZV9vZmZzZXQgPSAwOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAg ICAgIGN1ci0+cmlnaHRfZnJpbmdlX29mZnNldCA9IHJpZ2h0X29mZnNldDsKKyAgICAgICAgICAg IH0KKyAgICAgICAgfQorICAgICAgaWYgKHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAgPCAwKQor ICAgICAgICByb3ctPm92ZXJsYXlfYXJyb3dfYml0bWFwID0gbWNfZ2V0X2xvZ2ljYWxfZnJpbmdl X2JpdG1hcCAodywgUW92ZXJsYXlfYXJyb3csIDAsIDApOworICAgICAgaWYgKHJvdy0+b3Zlcmxh eV9hcnJvd19iaXRtYXAgIT0gY3VyLT5vdmVybGF5X2Fycm93X2JpdG1hcCkKKyAgICAgICAgewor ICAgICAgICAgIHJlZHJhd19wID0gMSwgcm93LT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcCA9IDE7 CisgICAgICAgICAgaWYgKCFrZWVwX2N1cnJlbnRfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgY3VyLT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcCA9IDE7CisgICAgICAgICAgICAgIGN1 ci0+b3ZlcmxheV9hcnJvd19iaXRtYXAgPSByb3ctPm92ZXJsYXlfYXJyb3dfYml0bWFwOworICAg ICAgICAgICAgfQorICAgICAgICB9CisgICAgICBpZiAobWNfbGVmdF9mcmluZ2VfYml0bWFwICE9 IE1DX05PX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICB8fCBtY19yaWdodF9mcmluZ2VfYml0bWFw ICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgIHJvdy0+ZnJpbmdlX2JpdG1hcF9wZXJp b2RpY19wID0gZmFsc2U7CisgICAgICAgIGVsc2UKKyAgICAgICAgICByb3ctPmZyaW5nZV9iaXRt YXBfcGVyaW9kaWNfcCA9IHBlcmlvZGljX3A7CisgICAgICBpZiAobWNfbGVmdF9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yAg ICAgICAgICAgIC8qIFRoaXMgY291bGQgYmUgd3Jvbmcgd2hlbiB3ZSBhbGxvdyB3aW5kb3cgbG9j YWwKKyAgICAgICAgICAgICAgIHJpZ2h0IGRpdmlkZXJzIC0gYnV0IHRoZSB3aW5kb3cgb24gdGhl IGxlZnQgaXMgaGFyZAorICAgICAgICAgICAgICAgdG8gZ2V0LiAgKi8KKyAgICAgICAgICAgICYm ICFGUkFNRV9SSUdIVF9ESVZJREVSX1dJRFRIIChmKQorICAgICAgICAgICAgJiYgIVdJTkRPV19I QVNfVkVSVElDQUxfU0NST0xMX0JBUiAodykKKyAgICAgICAgICAgIC8qIEJ1dCBkb24ndCByZWR1 Y2UgdGhlIGZyaW5nZSB3aWR0aCBpZiB0aGUgd2luZG93CisgICAgICAgICAgICAgICBoYXMgYSBs ZWZ0IG1hcmdpbiwgYmVjYXVzZSB0aGF0IG1lYW5zIHdlIGFyZSBub3QKKyAgICAgICAgICAgICAg IGluIGRhbmdlciBvZiBkcmF3aW5nIG92ZXIgdGhlIHZlcnRpY2FsIGJvcmRlciwKKyAgICAgICAg ICAgICAgIGFuZCBPVE9IIGxlYXZpbmcgb3V0IHRoYXQgb25lIHBpeGVsIGxlYXZlcyBiZWhpbmQK KyAgICAgICAgICAgICAgIHRyYWNlcyBvZiB0aGUgY3Vyc29yLCBpZiBpdCB3YXMgaW4gY29sdW1u IHplcm8KKyAgICAgICAgICAgICAgIGJlZm9yZSBkcmF3aW5nIG5vbi1lbXB0eSBtYXJnaW4gYXJl YS4gICovCisgICAgICAgICAgICAmJiB3LT5sZWZ0X21hcmdpbl9jb2xzID09IDApCisgICAgICAg ICAgID8gMSA6IDApOworICAgICAgICAgIHAuYnggPSB4IC0gd2Q7CisgICAgICAgICAgcC5ueCA9 IHdkOworICAgICAgICB9CisgICAgfQorICBlbHNlCisgICAgeworICAgICAgaW50IHggPSB3aW5k b3dfYm94X3JpZ2h0ICh3LAorICAgICAgICAoV0lORE9XX0hBU19GUklOR0VTX09VVFNJREVfTUFS R0lOUyAodykKKyAgICAgICAgID8gUklHSFRfTUFSR0lOX0FSRUEKKyAgICAgICAgIDogVEVYVF9B UkVBKSk7CisgICAgICBpbnQgd2QgPSBXSU5ET1dfUklHSFRfRlJJTkdFX1dJRFRIICh3KTsKKyAg ICAgIGlmIChwLndkID4gd2QpCisgICAgICAgIHAud2QgPSB3ZDsKKyAgICAgIHAueCA9IHggKyAo d2QgLSBwLndkKSAvIDI7CisgICAgICAvKiBDbGVhciByaWdodCBmcmluZ2UgaWYgbm8gYml0bWFw IHRvIGRyYXcgb2YgaWYgYml0bWFwIGRvZXNuJ3QgZmlsbAorICAgdGhlIGZyaW5nZS4gICovCisg ICAgICBpZiAocC53ZCA8IHdkIHx8IHAueSA+IHAuYnkgfHwgcC55ICsgcC5oIDwgcC5ieSArIHAu bnkpCisgICAgICAgIHsKKyAgICAgICAgICBwLmJ4ID0geDsKKyAgICAgICAgICBwLm54ID0gd2Q7 CisgICAgICAgIH0KKyAgICB9CisgIGlmIChwLnggPj0gV0lORE9XX0JPWF9MRUZUX0VER0VfWCAo dykKKyAgICAgICYmIChwLnggKyBwLndkKSA8PSBXSU5ET1dfQk9YX0xFRlRfRURHRV9YICh3KSAr IFdJTkRPV19QSVhFTF9XSURUSCAodykpCisgICAgRlJBTUVfUklGIChmKS0+ZHJhd19mcmluZ2Vf Yml0bWFwICh3LCByb3csICZwKTsKK30KKwordm9pZAorbWNfZHJhd19mcmluZ2VfYml0bWFwIChz dHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCBsZWZ0X3AsIGVudW0g bWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUpCit7CisgIGludCBvdmVybGF5ID0gMDsKKyAgaWYg KGxlZnRfcCA9PSByb3ctPnJldmVyc2VkX3AgJiYgcm93LT5jdXJzb3JfaW5fZnJpbmdlX3ApCisg ICAgeworICAgICAgTGlzcF9PYmplY3QgY3Vyc29yID0gUW5pbDsKKyAgICAgIHN3aXRjaCAoY3Vy c29yX3R5cGUpCisgICAgICAgIHsKKyAgICAgICAgY2FzZSBNQ19GUkFNRURfQk9YOgorICAgICAg ICAgIGlmIChyb3ctPnZpc2libGVfaGVpZ2h0ID49IFNUQU5EQVJEX0JJVE1BUF9IRUlHSFQgKGhv bGxvd19yZWN0YW5nbGVfYml0cykpCisgICAgICAgICAgICBjdXJzb3IgPSBRaG9sbG93OworICAg ICAgICAgIGVsc2UKKyAgICAgICAgICAgIGN1cnNvciA9IFFob2xsb3dfc21hbGw7CisgICAgICAg ICAgYnJlYWs7CisgICAgICAgIGNhc2UgTUNfSE9MTE9XX0JPWDoKKyAgICAgICAgICBpZiAocm93 LT52aXNpYmxlX2hlaWdodCA+PSBTVEFOREFSRF9CSVRNQVBfSEVJR0hUIChob2xsb3dfcmVjdGFu Z2xlX2JpdHMpKQorICAgICAgICAgICAgY3Vyc29yID0gUWhvbGxvdzsKKyAgICAgICAgICBlbHNl CisgICAgICAgICAgICBjdXJzb3IgPSBRaG9sbG93X3NtYWxsOworICAgICAgICAgIGJyZWFrOwor ICAgICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAgICAgICAgY3Vyc29yID0gUWJveDsKKyAg ICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19CQVI6CisgICAgICAgICAgY3Vyc29yID0g UWJhcjsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19IQkFSOgorICAgICAgICAg IGN1cnNvciA9IFFoYmFyOworICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1DX05PX0ZS SU5HRV9CSVRNQVA6CisgICAgICAgIGNhc2UgTUNfTk9fQ1VSU09SOgorICAgICAgICBjYXNlIE1D X1JJR0hUX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGNhc2UgTUNfTEVGVF9GUklOR0VfQklUTUFQ OgorICAgICAgICBkZWZhdWx0OgorICAgICAgICAgIHctPnBoeXNfY3Vyc29yX29uX3AgPSAwOwor ICAgICAgICAgIHJvdy0+Y3Vyc29yX2luX2ZyaW5nZV9wID0gMDsKKyAgICAgICAgICBicmVhazsK KyAgICAgICAgfQorICAgICAgaWYgKCFOSUxQIChjdXJzb3IpKQorICAgICAgICB7CisgICAgICAg ICAgaW50IGJtID0gbWNfZ2V0X2xvZ2ljYWxfY3Vyc29yX2JpdG1hcCAodywgY3Vyc29yKTsKKyAg ICAgICAgICBpZiAoYm0gIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgbWNfZHJhd19mcmluZ2VfYml0bWFwXzEgKHcsIHJvdywgbGVmdF9wLCAyLCBi bSk7CisgICAgICAgICAgICAgIG92ZXJsYXkgPSBFUSAoY3Vyc29yLCBRYm94KSA/IDMgOiAxOwor ICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICBtY19kcmF3X2ZyaW5nZV9iaXRtYXBf MSAodywgcm93LCBsZWZ0X3AsIG92ZXJsYXksIE1DX05PX0ZSSU5HRV9CSVRNQVApOworICBpZiAo bGVmdF9wICYmIHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1B UCkKKyAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXBfMSAodywgcm93LCAxLCAxLCByb3ctPm92ZXJs YXlfYXJyb3dfYml0bWFwKTsKK30KKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICNkZWZpbmUgTk9fRlJJTkdFX0JJVE1BUCAwCiAjZGVm aW5lIFVOREVGX0ZSSU5HRV9CSVRNQVAgMQogI2RlZmluZSBNQVhfU1RBTkRBUkRfRlJJTkdFX0JJ VE1BUFMgQVJSQVlFTFRTIChzdGFuZGFyZF9iaXRtYXBzK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KKyAgREVGU1lNIChRbWNfcXVhZHJ1cGxlX2FuZ2xlX2Rvd24sICIrLXF1YWRydXBsZS1hbmds ZS1kb3duIik7CisgIFZmcmluZ2VfYml0bWFwcyA9IEZjb25zIChRbWNfcXVhZHJ1cGxlX2FuZ2xl X2Rvd24sIFZmcmluZ2VfYml0bWFwcyk7CisgIEZwdXQgKFFtY19xdWFkcnVwbGVfYW5nbGVfZG93 biwgUWZyaW5nZSwgbWFrZV9maXhudW0gKDQ4KSk7CisgIC8qIChnZXQgJystcXVhZHJ1cGxlLWFu Z2xlLWRvd24gJ2ZyaW5nZSkgPT4gNDggKi8KKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8K Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgREVGU1lNIChRdHJ1bmNhdGlvbiwgInRy dW5jYXRpb24iKTsKICAgREVGU1lNIChRY29udGludWF0aW9uLCAiY29udGludWF0aW9uIik7CiAg IERFRlNZTSAoUW92ZXJsYXlfYXJyb3csICJvdmVybGF5LWFycm93Iik7CmRpZmYgLS1naXQgYS9z cmMvbnN0ZXJtLmggYi9zcmMvbnN0ZXJtLmgKaW5kZXggNzhjZTYwOC4uOGVmMGRmZSAxMDA2NDQK LS0tIGEvc3JjL25zdGVybS5oCisrKyBiL3NyYy9uc3Rlcm0uaApAQCAtNjYwLDYgKzY2MCwxNiBA QCB0eXBlZGVmIGlkIGluc3RhbmNldHlwZTsKIAogQGludGVyZmFjZSBFbWFjc1Njcm9sbGVyIDog TlNTY3JvbGxlcgogICB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKKyAgICBOU1JlY3QgbWNfcmVjdGFuZ2xlOworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKworCiAgICBzdHJ1Y3Qgd2luZG93ICp3aW5kb3c7CiAgICBzdHJ1Y3QgZnJh bWUgKmZyYW1lOwogICAgTlNSZXNwb25kZXIgKnByZXZSZXNwb25kZXI7CkBAIC02ODAsNiArNjkw LDE4IEBAIHR5cGVkZWYgaWQgaW5zdGFuY2V0eXBlOwogICAgaW50IGVtX3dob2xlOwogICAgfQog CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCist ICh2b2lkKW1jX3NldF9yZWN0YW5nbGU6IChOU1JlY3QpcmVjdDsKKy0gKE5TUmVjdCltY19nZXRf cmVjdGFuZ2xlOworLSAoc3RydWN0IHdpbmRvdyAqKW1jX2dldF93aW5kb3c7CistIChib29sKW1j X2p1ZGdlOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAtIChpbnN0YW5jZXR5cGUp IGluaXRGcmFtZTogKE5TUmVjdCApciB3aW5kb3c6IChMaXNwX09iamVjdCl3aW47CiAtICh2b2lk KXNldEZyYW1lOiAoTlNSZWN0KXI7CiAKZGlmZiAtLWdpdCBhL3NyYy9uc3Rlcm0ubSBiL3NyYy9u c3Rlcm0ubQppbmRleCA4MWQzNmJlLi4xMWNmYzE2IDEwMDY0NAotLS0gYS9zcmMvbnN0ZXJtLm0K KysrIGIvc3JjL25zdGVybS5tCkBAIC03Niw2ICs3Niw5NzkgQEAgVXBkYXRlZCBieSBDaHJpc3Rp YW4gTGltcGFjaCAoY2hyaXNAbmljZS5jaCkKIHN0YXRpYyBFbWFjc01lbnUgKm1haW5NZW51Owog I2VuZGlmCiAKKworLyogKioqKioqK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3IsIHN0cnVjdCBtY19S R0IgKmxzbCkKK3sKKyAgQ0hFQ0tfU1RSSU5HIChjb2xvcik7CisgIE5TQ29sb3IgKiBjb2w7Cisg IEVtYWNzQ0dGbG9hdCByZWQsIGdyZWVuLCBibHVlLCBhbHBoYTsKKyAgY2hlY2tfd2luZG93X3N5 c3RlbSAoTlVMTCk7CisgIGJsb2NrX2lucHV0ICgpOworICBpZiAobnNfbGlzcF90b19jb2xvciAo Y29sb3IsICZjb2wpKQorICAgIHsKKyAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICBsc2wt PnJlZCA9IC0xLjA7CisgICAgICBsc2wtPmdyZWVuID0gLTEuMDsKKyAgICAgIGxzbC0+Ymx1ZSA9 IC0xLjA7CisgICAgfQorICBbW2NvbCBjb2xvclVzaW5nRGVmYXVsdENvbG9yU3BhY2VdCisgICAg ICAgIGdldFJlZDogJnJlZCBncmVlbjogJmdyZWVuIGJsdWU6ICZibHVlIGFscGhhOiAmYWxwaGFd OworICB1bmJsb2NrX2lucHV0ICgpOworICBsc2wtPnJlZCA9IHJlZDsKKyAgbHNsLT5ncmVlbiA9 IGdyZWVuOworICBsc2wtPmJsdWUgPSBibHVlOworfQorCitzdGF0aWMgdm9pZAorbWNfbnNfZHJh d19vdmVyd3JpdHRlbiAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgc3RydWN0IGdseXBoX21hdHJp eCAqbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93 LCBzdHJ1Y3QgZ2x5cGggKmN1cnNvcl9nbHlwaCkKK3sKKyAgLy8gIGludCB2cG9zID0gTUFUUklY X1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgIC8vICBjbG9ja190IGNsb2NrX3N0YXJ0ID0gY2xv Y2soKTsKKyAgLy8gbnNfZHJhd191bmRlcndhdmUgKHMsIHMtPndpZHRoLCBzLT54KTsKKyAgTlND b2xvciAqaG9sbG93X2NvbG9yID0gR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hl X3R5cGVdW250aF0ueTsKKyAgICAgICAgICBpbnQgZnkgPSBzLT53LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZ5OworICAgICAgICAgIGludCBocG9zID0gcy0+ dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5ocG9zOworICAg ICAgICAgIGludCB2cG9zID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXS52cG9zOworICAgICAgICAgIGludCB3ZCA9IHMtPnctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ud2Q7CisgICAgICAgICAgaW50IGggPSBzLT53 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmg7CisgICAgICAg ICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSA9IHMtPnctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uY3Vyc29yX3R5cGU7CisgICAgICAgICAgLy8g IGludCBjdXJzb3Jfd2lkdGggPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhdLmN1cnNvcl93aWR0aDsKKyAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9m ZyA9IHsucmVkID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXS5mZy5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0g cy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5mZy5ncmVl biwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IHMtPnctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZmcuYmx1ZX07CisgICAgICAg ICAgLy8gIHN0cnVjdCBtY19SR0IgbHNsX2JnID0gey5yZWQgPSBzLT53LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLnJlZCwKKyAgICAgICAgICAvLyAgICAg ICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5iZy5ncmVlbiwKKyAgICAgICAgICAvLyAgICAgICAgICAg ICAgICAgICAgICAgICAgLmJsdWUgPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhdLmJnLmJsdWV9OworICAgICAgICAgIGJvb2wgYWN0aXZlX3AgPSBzLT53 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmFjdGl2ZV9wOwor ICAgICAgICAgIC8vICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSBzLT53LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoX2ZsYXZvcjsKKyAgICAg ICAgICBib29sIGVuYWJsZWRfcCA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF0uZW5hYmxlZF9wOworICAgICAgICAgIGJvb2wgZ29fcCA9ICh2cG9zID09 IHZudGgKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA9PSBjdXJzb3JfZ2x5cGgtPmhw b3MKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKTsKKyAgICAgICAgICBpZiAo IWdvX3ApCisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICBOU1JlY3QgcjsKKyAgICAg ICAgICByLm9yaWdpbi54ID0gZng7CisgICAgICAgICAgci5vcmlnaW4ueSA9IGZ5OworICAgICAg ICAgIHIuc2l6ZS5oZWlnaHQgPSBoOworICAgICAgICAgIHIuc2l6ZS53aWR0aCA9IHdkOworICAg ICAgICAgIFtbTlNDb2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiBsc2xfZmcucmVkCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JlZW46IGxzbF9mZy5ncmVlbgorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBibHVlOiBsc2xfZmcuYmx1ZQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscGhhOiAxLjBdIHNldF07CisgICAg ICBpZiAoY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWCkKKyAgICAgICAgeworICAgICAgICAg IExpc3BfT2JqZWN0IGJ1ZiA9IHMtPnctPmNvbnRlbnRzOworICAgICAgICAgIENIRUNLX0JVRkZF UiAoYnVmKTsKKyAgICAgICAgICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAoYnVmKTsKKyAg ICAgICAgICBib29sIHJlZ2lvbl9hY3RpdmVfcCA9ICghTklMUCAoVnRyYW5zaWVudF9tYXJrX21v ZGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIs IG1hcmtfYWN0aXZlKSkpOworICAgICAgICAgIHB0cmRpZmZfdCByZWdpb25fYmVnID0gKHJlZ2lv bl9hY3RpdmVfcCkgPyBtY19yZWdpb25fbGltaXQgKDEpIDogLTE7CisgICAgICAgICAgcHRyZGlm Zl90IHJlZ2lvbl9lbmQgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IG1jX3JlZ2lvbl9saW1pdCAoMCkg OiAtMTsKKyAgICAgICAgICBpZiAocmVnaW9uX2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bG93X2FjdGl2ZV9yZWdpb25fYmV0d2Vl bl9mYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVu X2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgTlNDb2xvciAqaG9sbG93X2FjdGl2ZV9yZWdp b25fYmV0d2Vlbl9jb2xvciA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVH Uk9VTkQgKGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZSksIHMtPmYpOworICAgICAg ICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2FjdGl2ZV9yZWdpb25fYmV0d2Vlbl9j b2xvcjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoYWN0aXZl X3ApCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9p ZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+Ziwg aW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAg ICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9N X0lEIChzLT5mLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICBO U0NvbG9yICpob2xsb3dfYWN0aXZlX2NvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5T X0ZBQ0VfQkFDS0dST1VORCAoaG9sbG93X2FjdGl2ZV9mYWNlKSwgcy0+Zik7CisgICAgICAgICAg ICAgICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19hY3RpdmVfY29sb3I7CisgICAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmICghYWN0aXZlX3ApCisgICAgICAg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93 X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ZiwgaW50ZXJu ICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpOworICAg ICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9IEZB Q0VfRlJPTV9JRCAocy0+ZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAg ICAgICAgICAgIE5TQ29sb3IgKmhvbGxvd19pbmFjdGl2ZV9jb2xvciA9IG5zX2xvb2t1cF9pbmRl eGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGhvbGxvd19pbmFjdGl2ZV9mYWNlKSwgcy0+ Zik7CisgICAgICAgICAgICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2luYWN0aXZl X2NvbG9yOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBp ZiAoZmFjZSAmJiBOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpID09IG5zX2luZGV4X2NvbG9yIChG UkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpLCBzLT5mKSkKKyAgICAgICAgICB7CisgICAgICAgICAg ICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoZmFjZSksIHMt PmYpIHNldF07CisgICAgICAgICAgICBob2xsb3dfY29sb3IgPSBGUkFNRV9DVVJTT1JfQ09MT1Ig KHMtPmYpOworICAgICAgICAgIH0KKyAgICAgICAgICBzd2l0Y2ggKGN1cnNvcl90eXBlKQorICAg ICAgICAgICAgeworICAgICAgICAgICAgICBjYXNlIE1DX05PX0ZSSU5HRV9CSVRNQVA6CisgICAg ICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgTUNfTk9fQ1VSU09SOgorICAg ICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX1JJR0hUX0ZSSU5HRV9C SVRNQVA6CisgICAgICAgICAgICAgIGNhc2UgTUNfTEVGVF9GUklOR0VfQklUTUFQOgorICAgICAg ICAgICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAo cik7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgTUNfRlJBTUVE X0JPWDoKKyAgICAgICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAgICAgICBb aG9sbG93X2NvbG9yIHNldF07CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAoTlNJbnNldFJl Y3QgKHIsIDEsIDEpKTsKKyAgICAgICAgICAgICAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChzLT5m KSBzZXRdOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX0hP TExPV19CT1g6CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAgICAg ICAgW2hvbGxvd19jb2xvciBzZXRdOworICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKE5TSW5z ZXRSZWN0IChyLCAxLCAxKSk7CisgICAgICAgICAgICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAo cy0+Zikgc2V0XTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSBN Q19IQkFSOgorICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAgICAg IGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX0JBUjoKKyAgICAgICAg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AgICAgICAgICAgICAgaWYgKGlzQ29tcG9zaXRlKQorICAgICAg ICAgICAgICAgIG5zX2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsK KyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAg ICAgICAgIHN0cnVjdCBmb250ICpmb250ID0gcy0+ZmFjZS0+Zm9udDsKKyAgICAgICAgICAgICAg ICAgICAgaWYgKCFmb250KQorICAgICAgICAgICAgICAgICAgICAgIGZvbnQgPSBGUkFNRV9GT05U IChzLT5mKTsKKyAgICAgICAgICAgICAgICAgICAgYm9vbCB3aXRoX2JnX3AgPSBmYWxzZTsKKyAg ICAgICAgICAgICAgICAgICAgZm9udC0+ZHJpdmVyLT5kcmF3IChzLCBzLT5jbXBfZnJvbSwgcy0+ bmNoYXJzLCBzLT54LCBzLT55YmFzZSwgd2l0aF9iZ19wKTsKKyAgICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgLy8gIGNsb2NrX3QgY2xvY2tfZW5k ID0gY2xvY2soKTsKKyAgLy8gIGRvdWJsZSBjcHVfdGltZV91c2VkID0gKChkb3VibGUpIChjbG9j a19lbmQgLSBjbG9ja19zdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7CisgIC8vICBmcHJpbnRmIChz dGRlcnIsICJuc19kcmF3X292ZXJ3cml0dGVuICglZCk6ICBUSU1FICglZilcbiIsIHZwb3MsIGNw dV90aW1lX3VzZWQpOworfQorCitzdGF0aWMgdm9pZAorbWNfbnNfZHJhd193aW5kb3dfY3Vyc29y IChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsIHN0cnVjdCBn bHlwaF9yb3cgKnJvdywKKyAgICAgICAgICAgICAgICAgIGludCB4LCBpbnQgZngsIGludCB5LCBp bnQgZnksIGludCBocG9zLCBpbn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ICAgICghTklMUCAoZm9yZWdyb3VuZCkgPyBTU0RBVEEgKGZvcmVncm91bmQp IDogIk5JTFAiKSwKKyAgICAgICAgICAgICAgICAgICAgICAoIU5JTFAgKGJhY2tncm91bmQpID8g U1NEQVRBIChiYWNrZ3JvdW5kKSA6ICJOSUxQIikpOworICAtICBFWEFNUExFIE9GIEhPVyBUTyBD UkVBVEUgQSBDT0xPUiBXSVRIIFJHQi9MU0wgZmxvYXQgdmFsdWVzOgorICAgICBOU0NvbG9yICpt eV9jb2xvciA9IFtOU0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6IDEuMAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JlZW46IDEuMAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJsdWU6IDEu MAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxw aGE6IDEuMF07CisgIC0gIEFMVEVSTkFUSVZFIEVYQU1QTEU6CisgICAgIGVudW0gZmFjZV9pZCBk ZWJ1Z2dpbmdfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlIChzLT53LCBzLT5mLCBpbnRlcm4g KCIrLWRlYnVnZ2luZy1mYWNlIiksIHRydWUpOworICAgICBzdHJ1Y3QgZmFjZSAqZGVidWdnaW5n X2ZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIGRlYnVnZ2luZ19mYWNlX2lkKTsKKyAgICAgTlND b2xvciAqY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5E IChkZWJ1Z2dpbmdfZmFjZSksIHMtPmYpOworICAgICBbY29sb3Igc2V0XTsgKi8KKyAgaWYgKGds eXBoX2ZsYXZvciA9PSBNQ19HTFlQSAorICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBI TEVTUykKKyAgICBbW05TQ29sb3IgY29sb3JXaXRoQ2FsaWJyYXRlZFJlZDogbHNsLnJlZAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdyZWVuOiBsc2wuZ3JlZW4KKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgYmx1ZTogbHNsLmJsdWUKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBhbHBoYTogMS4wXSBzZXRdOworICAgIGVsc2UKKyAgICAgIFtGUkFNRV9DVVJT T1JfQ09MT1IgKGYpIHNldF07CisgIGlmIChjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YKQor ICAgIHsKKyAgICAgIExpc3BfT2JqZWN0IGJ1ZiA9IHctPmNvbnRlbnRzOworICAgICAgQ0hFQ0tf QlVGRkVSIChidWYpOworICAgICAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKGJ1Zik7Cisg ICAgICBib29sIHJlZ2lvbl9hY3RpdmVfcCA9ICghTklMUCAoVnRyYW5zaWVudF9tYXJrX21vZGUp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgbWFya19h Y3RpdmUpKSk7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2JlZyA9IChyZWdpb25fYWN0aXZlX3Ap ID8gbWNfcmVnaW9uX2xpbWl0ICgxKSA6IC0xOworICAgICAgcHRyZGlmZl90IHJlZ2lvbl9lbmQg PSAocmVnaW9uX2FjdGl2ZV9wKSA/IG1jX3JlZ2lvbl9saW1pdCAoMCkgOiAtMTsKKyAgICAgIGlm IChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAmJiBhY3RpdmVfcAorICAgICAgICAgICYmIGN1 cnNvcl9nbHlwaC0+Y2hhcnBvcyA9PSByZWdpb25fYmVnKQorICAgICAgICB7CisgICAgICAgICAg ZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2JlZ19mYWNlX2lkID0g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sbG93X2FjdGl2ZV9yZWdp b25fYmV0d2Vlbl9jb2xvcjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKGFj dGl2ZV9wKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhv bGxvd19hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIr LXJlYWwtZmFrZS1jdXJzb3ItcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAg c3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93 X2FjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICBOU0NvbG9yICpob2xsb3dfYWN0aXZl X2NvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoaG9s bG93X2FjdGl2ZV9mYWNlKSwgZik7CisgICAgICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9s bG93X2FjdGl2ZV9jb2xvcjsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAvKiBUaGUg cmVnaW9uIGlzIF9ub3RfIHZpc2libGUgaW4gdGhlIGluYWN0aXZlIHdpbmRvdyBiZWNhdXNlIHRo ZSBvdmVybGF5IHdpbmRvdyBwcm9wZXJ0eSBpcyB1c2VkLiAqLworICAgICAgICAgICAgICBlbHNl IGlmICghYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgZW51 bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcs IGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1wcmUtenYtZmFjZSIpLCB0 cnVlKTsKKyAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFj ZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAg ICAgICAgICAgTlNDb2xvciAqaG9sbG93X2luYWN0aXZlX2NvbG9yID0gbnNfbG9va3VwX2luZGV4 ZWRfY29sb3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoaG9sbG93X2luYWN0aXZlX2ZhY2UpLCBmKTsK KyAgICAgICAgICAgICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19pbmFjdGl2ZV9jb2xvcjsK KyAgICAgICAgICAgICAgICB9CisgICAgfQorICAgIGVsc2UgaWYgKGZhY2UgJiYgTlNfRkFDRV9C QUNLR1JPVU5EIChmYWNlKSA9PSBuc19pbmRleF9jb2xvciAoRlJBTUVfQ1VSU09SX0NPTE9SIChm KSwgZikpCisgICAgICB7CisgICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFD RV9GT1JFR1JPVU5EIChmYWNlKSwgZikgc2V0XTsKKyAgICAgICAgaG9sbG93X2NvbG9yID0gRlJB TUVfQ1VSU09SX0NPTE9SIChmKTsKKyAgICAgIH0KKyNpZmRlZiBOU19JTVBMX0NPQ09BCisgIE5T RGlzYWJsZVNjcmVlblVwZGF0ZXMgKCk7CisjZW5kaWYKKyAgc3dpdGNoIChjdXJzb3JfdHlwZSkK KyAgICB7CisgICAgICBjYXNlIE1DX05PX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGJyZWFrOwor ICAgICAgY2FzZSBNQ19OT19DVVJTT1I6CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19S SUdIVF9GUklOR0VfQklUTUFQOgorICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfTEVGVF9G UklOR0VfQklUTUFQOgorICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfRklMTEVEX0JPWDoK KyAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19G UkFNRURfQk9YOgorICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgW2hvbGxvd19jb2xv ciBzZXRdOworICAgICAgICBOU1JlY3RGaWxsIChOU0luc2V0UmVjdCAociwgMSwgMSkpOworICAg ICAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChmKSBzZXRdOworICAgICAgICBicmVhazsKKyAgICAg IGNhc2UgTUNfSE9MTE9XX0JPWDoKKyAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgIFto b2xsb3dfY29sb3Igc2V0XTsKKyAgICAgICAgTlNSZWN0RmlsbCAoTlNJbnNldFJlY3QgKHIsIDEs IDEpKTsKKyAgICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAoZikgc2V0XTsKKyAgICAgICAgYnJl YWs7CisgICAgICBjYXNlIE1DX0hCQVI6CisgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAg ICBicmVhazsKKyAgICAgIGNhc2UgTUNfQkFSOgorICAgICAgICBzID0gcjsKKyAgICAgICAgLyog QGxhd2xpc3QgaXMgZm9jdXNpbmcgdGhlIGluaXRpYWwgZGV2ZWxvcG1lbnQgb2YgZmVhdHVyZSBy ZXF1ZXN0cworICAgICAgICAjMTc2ODQgYW5kICMyMjg3MyBvbiBMMlIgbGFuZ3VhZ2VzLiAqLwor ICAgICAgICBpZiAoZ2x5cGhfZmxhdm9yICE9IE1DX0dMWVBICisgICAgICAgICAgICAmJiBnbHlw aF9mbGF2b3IgIT0gTUNfR0xZUEhMRVNTKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIC8qIElm IHRoZSBjaGFyYWN0ZXIgdW5kZXIgY3Vyc29yIGlzIFIyTCwgZHJhdyB0aGUgYmFyIGN1cnNvcgor ICAgICAgICAgICAgICAgb24gdGhlIHJpZ2h0IG9mIGl0cyBnbHlwaCwgcmF0aGVyIHRoYW4gb24g dGhlIGxlZnQuICovCisgICAgICAgICAgICBpZiAoKGN1cnNvcl9nbHlwaC0+cmVzb2x2ZWRfbGV2 ZWwgJiAxKSAhPSAwKQorICAgICAgICAgICAgICBzLm9yaWdpbi54ICs9IGN1cnNvcl9nbHlwaC0+ cGl4ZWxfd2lkdGggLSBzLnNpemUud2lkdGg7CisgICAgICAgICAgfQorICAgICAgICBOU1JlY3RG aWxsIChzKTsKKyAgICAgICAgYnJlYWs7CisgICAgfQorICBuc19yZXNldF9jbGlwcGluZyAoZik7 CisgIC8qIGRyYXcgdGhlIGNoYXJhY3RlciB1bmRlciB0aGUgY3Vyc29yICovCisgIGlmIChnbHlw aF9mbGF2b3IgIT0gTUNfR0xZUEhMRVNTCisgICAgICAmJiAoY3Vyc29yX3R5cGUgPT0gTUNfRlJB TUVEX0JPWAorICAgICAgICAgIHx8IGN1cnNvcl90eXBlID09IE1DX0ZJTExFRF9CT1gKKyAgICAg ICAgICB8fCBjdXJzb3JfdHlwZSA9PSBNQ19IT0xMT1dfQk9YCisgICAgICAgICAgfHwgKGRlYnVn X3AKKyAgICAgICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gTUNfSEJBUikKKyAgICAgICAgICB8 fCAoZGVidWdfcAorICAgICAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19CQVIpKSkKKyAg ICB7CisgICAgICAvKiBgY3Vyc29yX2djX3BgIGlzIHVzZWQgb25seSBieSBgdzMydGVybS5jYCBh bmQgYHh0ZXJtLmMnLiAqLworICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IGZhbHNlOworICAgICAg WFJlY3RhbmdsZSAqc2F2ZWRfY2xpcCA9IE5VTEw7CisgICAgICBpZiAocm93LT5jbGlwICE9IE5V TEwpCisgICAgICAgIHsKKyAgICAgICAgICBzYXZlZF9jbGlwID0gcm93LT5jbGlwOworICAgICAg ICAgIHJvdy0+Y2xpcCA9IE5VTEw7CisgICAgICAgIH0KKyAgICAgIG1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SX1dBVkUpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoZmFjZS0+dW5kZXJsaW5lX2Rl ZmF1bHRlZF9wKQorICAgICAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsKKyAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChmYWNlLT51bmRlcmxp bmVfY29sb3IsIHMtPmYpIHNldF07CisgICAgICAgICAgbnNfZHJhd191bmRlcndhdmUgKHMsIHdp ZHRoLCB4KTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChzLT5mYWNlLT51bmRlcmxpbmVf dHlwZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgeworICAgICAgICAgICAgTlNSZWN0 IHI7CisgICAgICAgICAgICB1bnNpZ25lZCBsb25nIHRoaWNrbmVzcywgcG9zaXRpb247CisgICAg ICAgICAgICAvKiBJZiB0aGUgcHJldiB3YXMgdW5kZXJsaW5lZCwgbWF0Y2ggaXRzIGFwcGVhcmFu Y2UuICovCisgICAgICAgICAgICBpZiAocy0+cHJldiAmJiBzLT5wcmV2LT5mYWNlLT51bmRlcmxp bmVfcAorICAgICAgICAgICAgICAgICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV90eXBlID09 IEZBQ0VfVU5ERVJfTElORQorICAgICAgICAgICAgICAgICYmIHMtPnByZXYtPnVuZGVybGluZV90 aGlja25lc3MgPiAwKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdGhpY2tuZXNz ID0gcy0+cHJldi0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAgICAgICAgICAgICBwb3NpdGlv biA9IHMtPnByZXYtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgc3RydWN0 IGZvbnQgKmZvbnQ7CisgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIGRlc2NlbnQ7Cisg ICAgICAgICAgICAgICAgICBmb250PXMtPmZvbnQ7CisgICAgICAgICAgICAgICAgICBkZXNjZW50 ID0gcy0+eSArIHMtPmhlaWdodCAtIHMtPnliYXNlOworICAgICAgICAgICAgICAgICAgLyogVXNl IHVuZGVybGluZSB0aGlja25lc3Mgb2YgZm9udCwgZGVmYXVsdGluZyB0byAxLiAqLworICAgICAg ICAgICAgICAgICAgdGhpY2tuZXNzID0gKGZvbnQgJiYgZm9udC0+dW5kZXJsaW5lX3RoaWNrbmVz cyA+IDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGZvbnQtPnVuZGVybGluZV90 aGlja25lc3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogMTsKKyAgICAgICAgICAg ICAgICAgIC8qIERldGVybWluZSB0aGUgb2Zmc2V0IG9mIHVuZGVybGluaW5nIGZyb20gdGhlIGJh c2VsaW5lLiAqLworICAgICAgICAgICAgICAgICAgaWYgKHhfdW5kZXJsaW5lX2F0X2Rlc2NlbnRf bGluZSkKKyAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBkZXNjZW50IC0gdGhpY2tuZXNz OworICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICh4X3VzZV91bmRlcmxpbmVfcG9zaXRpb25f cHJvcGVydGllcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBmb250ICYmIGZvbnQt PnVuZGVybGluZV9wb3NpdGlvbiA+PSAwKQorICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9u ID0gZm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICAgICAgICAgIGVsc2Ug aWYgKGZvbnQpCisgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IGxyb3VuZCAoZm9u dC0+ZGVzY2VudCAvIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAg ICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHVuZGVybGluZV9taW5pbXVtX29mZnNldDsKKyAg ICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gbWF4IChwb3NpdGlvbiwgdW5kZXJsaW5lX21pbmlt dW1fb2Zmc2V0KTsKKyAgICAgICAgICAgICAgICAgIC8qIEVuc3VyZSB1bmRlcmxpbmluZyBpcyBu b3QgY3JvcHBlZC4gKi8KKyAgICAgICAgICAgICAgICAgIGlmIChkZXNjZW50IDw9IHBvc2l0aW9u KQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24g PSBkZXNjZW50IC0gMTsKKyAgICAgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAxOworICAg ICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGRlc2NlbnQg PCBwb3NpdGlvbiArIHRoaWNrbmVzcykKKyAgICAgICAgICAgICAgICAgICAgICB0aGlja25lc3Mg PSAxOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHMtPnVuZGVybGluZV90aGlja25l c3MgPSB0aGlja25lc3M7CisgICAgICAgICAgICBzLT51bmRlcmxpbmVfcG9zaXRpb24gPSBwb3Np dGlvbjsKKyAgICAgICAgICAgIHIgPSBOU01ha2VSZWN0ICh4LCBzLT55YmFzZSArIHBvc2l0aW9u LCB3aWR0aCwgdGhpY2tuZXNzKTsKKyAgICAgICAgICAgIGlmIChmYWNlLT51bmRlcmxpbmVfZGVm YXVsdGVkX3ApCisgICAgICAgICAgICAgIFtkZWZhdWx0Q29sIHNldF07CisgICAgICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgICAgICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKGZhY2UtPnVu ZGVybGluZV9jb2xvciwgcy0+Zikgc2V0XTsKKyAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOwor ICAgICAgICAgIH0KKyAgICB9CisgIC8qIERv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VU5EIChmYWNlKSwgcy0+Zik7CisgICAgICBmZ0NvbCA9IG5zX2xvb2t1 cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQgKGZhY2UpLCBzLT5mKTsKKyAgICAg IGZvciAoaSA9IDA7IGkgPCBuOyArK2kpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoIXMtPnJv dy0+ZnVsbF93aWR0aF9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpbnQgb3ZlcnJ1 biwgbGVmdG92ZXJydW47CisgICAgICAgICAgICAgIC8qIHRydW5jYXRlIHRvIGF2b2lkIG92ZXJ3 cml0aW5nIGZyaW5nZSBhbmQvb3Igc2Nyb2xsYmFyICovCisgICAgICAgICAgICAgIG92ZXJydW4g PSBtYXggKDAsIChzLT54ICsgcy0+YmFja2dyb3VuZF93aWR0aCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIC0gKFdJTkRPV19CT1hfUklHSFRfRURHRV9YIChzLT53KQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgLSBXSU5ET1dfUklHSFRfRlJJTkdFX1dJRFRIIChzLT53 KSkpOworICAgICAgICAgICAgICAgICAgICByW2ldLnNpemUud2lkdGggLT0gb3ZlcnJ1bjsKKyAg ICAgICAgICAgICAgLyogdHJ1bmNhdGUgdG8gYXZvaWQgb3ZlcndyaXRpbmcgdG8gbGVmdCBvZiB0 aGUgd2luZG93IGJveCAqLworICAgICAgICAgICAgICBsZWZ0b3ZlcnJ1biA9IChXSU5ET1dfQk9Y X0xFRlRfRURHRV9YIChzLT53KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIFdJTkRP V19MRUZUX0ZSSU5HRV9XSURUSCAocy0+dykpIC0gcy0+eDsKKyAgICAgICAgICAgICAgaWYgKGxl ZnRvdmVycnVuID4gMCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICByW2ld Lm9yaWdpbi54ICs9IGxlZnRvdmVycnVuOworICAgICAgICAgICAgICAgICAgcltpXS5zaXplLndp ZHRoIC09IGxlZnRvdmVycnVuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgLyog WFhYOiBUcnkgdG8gd29yayBiZXR3ZWVuIHByb2JsZW0gd2hlcmUgYSBzdHJldGNoIGdseXBoIG9u CisgICAgICAgICAgICAgICAgIGEgcGFydGlhbGx5LXZpc2libGUgYm90dG9tIHJvdyB3aWxsIGNs ZWFyIHBhcnQgb2YgdGhlCisgICAgICAgICAgICAgICAgIG1vZGVsaW5lLCBhbmQgYW5vdGhlciB3 aGVyZSBsaXN0LWJ1ZmZlcnMgaGVhZGVycyBhbmQgc2ltaWxhcgorICAgICAgICAgICAgICAgICBy b3dzIGVycm9uZW91c2x5IGhhdmUgdmlzaWJsZV9oZWlnaHQgc2V0IHRvIDAuICBOb3Qgc3VyZQor ICAgICAgICAgICAgICAgICB3aGVyZSB0aGlzIGlzIGNvbWluZyBmcm9tIGFzIG90aGVyIHRlcm1z IHNlZW0gbm90IHRvIHNob3cuICovCisgICAgICAgICAgICAgIHJbaV0uc2l6ZS5oZWlnaHQgPSBt aW4gKHMtPmhlaWdodCwgcy0+cm93LT52aXNpYmxlX2hlaWdodCk7CisgICAgICAgICAgICB9Cisg ICAgICAgICAgW2JnQ29sIHNldF07CisgICAgICAgICAgLyogTk9URTogdW5kZXIgTlMgdGhpcyBp cyBOT1QgdXNlZCB0byBkcmF3IGN1cnNvcnMsIGJ1dCB3ZSBtdXN0IGF2b2lkCisgICAgICAgICAg ICAgb3ZlcndyaXRpbmcgY3Vyc29yICh1c3VhbGx5IHdoZW4gY3Vyc29yIG9uIGEgdGFiKSAqLwor ICAgICAgICAgIGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUikKKyAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgLyogRklYTUU6ICBEbyB3ZSBzdGlsbCBuZWVkIHRvIHByZXZlbnQgdGhpcyBzZWN0 aW9uIG9mIGNvZGUgZnJvbQorICAgICAgICAgICAgICBlcmFzaW5nIHRoZSBmYWtlIE1DX0hCQVIg dGhhdCBleHRlbmRzIHRoZSBlbnRpcmUgbGVuZ3RoIG9mIHRoZQorICAgICAgICAgICAgICBTVFJF VENIX0dMWVBIPyAgVGhpcyBtYXkgaGF2ZSBiZWVuIGRvbmUgcHJpb3IgdG8gdGhlIGZpeCByZWxh dGluZworICAgICAgICAgICAgICB0byBsZWZ0L3JpZ2h0IG92ZXJ3cml0dGVuIGdseXBocy4gKi8K KyAgICAgICAgICAgICAgcltpXS5zaXplLmhlaWdodCAtPSAxOworICAgICAgICAgICAgICAvLyAg ZW51bSBmYWNlX2lkIGRlYnVnZ2luZ19mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncs IHMtPmYsIGludGVybiAoIistZGVidWdnaW5nLWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAg IC8vICBzdHJ1Y3QgZmFjZSAqZGVidWdnaW5nX2ZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIGRl YnVnZ2luZ19mYWNlX2lkKTsKKyAgICAgICAgICAgICAgLy8gIE5TQ29sb3IgKmNvbG9yID0gbnNf bG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoZGVidWdnaW5nX2ZhY2Up LCBzLT5mKTsKKyAgICAgICAgICAgICAgLy8gIFtjb2xvciBzZXRdOworICAgICAgICAgICAgICBD R0Zsb2F0IHggPSByW2ldLm9yaWdpbi54OworICAgICAgICAgICAgICBDR0Zsb2F0IHdpZHRoID0g d2Q7CisgICAgICAgICAgICAgIHJbaV0uc2l6ZS53aWR0aCAtPSB3aWR0aDsKKyAgICAgICAgICAg ICAgcltpXS5vcmlnaW4ueCArPSB3aWR0aDsKKyAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocltp XSk7CisgICAgICAgICAgICAgIC8qIERyYXcgb3ZlcmxpbmluZywgZXRjLiBvbiB0aGUgY3Vyc29y LiAqLworICAgICAgICAgICAgICBpZiAocy0+dy0+cGh5c19jdXJzb3JfdHlwZSA9PSBNQ19GSUxM RURfQk9YKQorICAgICAgICAgICAgICAgIG1jX25zX2RyYXdfdGV4dF9kZWNvcmF0aW9uIChzLCBm YWNlLCBiZ0NvbCwgd2lkdGgsIHgpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICAgIG1jX25zX2RyYXdfdGV4dF9kZWNvcmF0aW9uIChzLCBmYWNlLCBmZ0NvbCwgd2lkdGgs IHgpOworICAgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgLy8g IGludCByeCA9IHJbaV0ub3JpZ2luLng7CisgIC8vICBpbnQgcnkgPSByW2ldLm9yaWdpbi55Owor ICAvLyAgaW50IHJ3ID0gcltpXS5zaXplLndpZHRoOworICAvLyAgaW50IHJoID0gcltpXS5zaXpl LmhlaWdodDsKKyAgLy8gIGZwcmludGYgKHN0ZGVyciwgIm1jX25zX2R1bXBnbHlwaHNfc3RyZXRj aDogIHZwb3MgKCVkKSB8IHJ4ICglZCkgfCByeSAoJWQpIHwgcncgKCVkKSB8IHJoICglZClcbiIs CisgIC8vICAgICAgICAgICAgICAgICAgIHMtPmZpcnN0X2dseXBoLT52cG9zLCByeCwgcnksIHJ3 LCByaCk7CisgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHJbaV0pOworICAgICAgICAgICAgfQor ICAgICAgICAgIC8qIERyYXcgb3ZlcmxpbmluZywgZXRjLiBvbiB0aGUgc3RyZXRjaCBnbHlwaCAo b3IgdGhlIHBhcnQKKyAgICAgICAgICAgICBvZiB0aGUgc3RyZXRjaCBnbHlwaCBhZnRlciB0aGUg Y3Vyc29yKS4gKi8KKyAgICAgICAgICBtY19uc19kcmF3X3RleHRfZGVjb3JhdGlvbiAocywgZmFj ZSwgZmdDb2wsIHJbaV0uc2l6ZS53aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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hlIGltYWdlLi4gZG8gd2UgbmVlZCB0byBkcmF3IHBsYWNlaG9sZGVyIGlmIGltZyA9PW5p bD8gKi8KKyAgaWYgKGltZyAhPSBuaWwpCisgICAgeworI2lmZGVmIE5TX0lNUExfQ09DT0EKKyAg ICAgIE5TUmVjdCBkciA9IE5TTWFrZVJlY3QgKHgsIHksIHMtPnNsaWNlLndpZHRoLCBzLT5zbGlj ZS5oZWlnaHQpOworICAgICAgTlNSZWN0IGlyID0gTlNNYWtlUmVjdCAocy0+c2xpY2UueCwgcy0+ c2xpY2UueSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLndpZHRoLCBz LT5zbGljZS5oZWlnaHQpOworICAgICAgW2ltZyBkcmF3SW5SZWN0OiBkcgorICAgICAgICAgICAg IGZyb21SZWN0OiBpcgorICAgICAgICAgICAgIG9wZXJhdGlvbjogTlNDb21wb3NpdGVTb3VyY2VP dmVyCisgICAgICAgICAgICAgIGZyYWN0aW9uOiAxLjAKKyAgICAgICAgICAgcmVzcGVjdEZsaXBw ZWQ6IFlFUworICAgICAgICAgICAgICAgIGhpbnRzOiBuaWxdOworI2Vsc2UKKyAgICAgIFtpbWcg Y29tcG9zaXRlVG9Qb2ludDogTlNNYWtlUG9pbnQgKHgsIHkgKyBzLT5zbGljZS5oZWlnaHQpCisg ICAgICAgICAgICAgICAgICBvcGVyYXRpb246IE5TQ29tcG9zaXRlU291cmNlT3Zlcl07CisjZW5k aWYKKyAgICB9CisgIGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUikKKyAgICB7CisgICAgICBbRlJB TUVfQ1VSU09SX0NPTE9SIChzLT5mKSBzZXRdOworICAgICAgaWYgKHMtPnctPnBoeXNfY3Vyc29y X3R5cGUgPT0gTUNfRklMTEVEX0JPWCkKKyAgICAgICAgdGRDb2wgPSBuc19sb29rdXBfaW5kZXhl ZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKSwgcy0+Zik7CisgICA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3JlbGllZiA+PSAwID8KKyAgICAgICAgICAgIHRvb2xfYmFyX2J1 dHRvbl9yZWxpZWYgOiBERUZBVUxUX1RPT0xfQkFSX0JVVFRPTl9SRUxJRUY7CisgICAgICAgICAg cmFpc2VkX3AgPSAocy0+aGwgPT0gRFJBV19JTUFHRV9SQUlTRUQpOworICAgICAgICB9CisgICAg ICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICB0aCA9IGFicyAocy0+aW1nLT5yZWxp ZWYpOworICAgICAgICAgICAgcmFpc2VkX3AgPSAocy0+aW1nLT5yZWxpZWYgPiAwKTsKKyAgICAg ICAgICB9CisgICAgICByLm9yaWdpbi54ID0geCAtIHRoOworICAgICAgci5vcmlnaW4ueSA9IHkg LSB0aDsKKyAgICAgIHIuc2l6ZS53aWR0aCA9IHMtPnNsaWNlLndpZHRoICsgMip0aC0xOworICAg ICAgci5zaXplLmhlaWdodCA9IHMtPnNsaWNlLmhlaWdodCArIDIqdGgtMTsKKyAgICAgIG5zX2Ry YXdfcmVsaWVmIChyLCB0aCwgcmFpc2VkX3AsCisgICAgICAgICAgICAgICAgICAgICAgcy0+c2xp Y2UueSA9PSAwLAorICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLnkgKyBzLT5zbGljZS5o ZWlnaHQgPT0gcy0+aW1nLT5oZWlnaHQsCisgICAgICAgICAgICAgICAgICAgICAgcy0+c2xpY2Uu eCA9PSAwLAorICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLnggKyBzLT5zbGljZS53aWR0 aCA9PSBzLT5pbWctPndpZHRoLCBzKTsKKyAgICB9CisgIC8qIElmIHRoZXJlIGlzIG5vIG1hc2ss IHRoZSBiYWNrZ3JvdW5kIHdvbid0IGJlIHNlZW4sCisgICAgIHNvIGRyYXcgYSByZWN0YW5nbGUg b24gdGhlIGltYWdlIGZvciB0aGUgY3Vyc29yLgorICAgICBEbyB0aGlzIGZvciBhbGwgaW1hZ2Vz LCBnZXR0aW5nIHRyYW5zcGFyZW5jeSByaWdodCBpcyBub3QgcmVsaWFibGUuICovCisgIGlmIChz LT5obCA9PSBEUkFXX0NVUlNPUikKKyAgICB7CisgICAgICBpbnQgdGhpY2tuZXNzID0gYWJzIChz LT5pbWctPnJlbGllZik7CisgICAgICBpZiAodGhpY2tuZXNzID09IDApIHRoaWNrbmVzcyA9IDE7 CisgICAgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSAorICAgICAgICB8fCBnbHlwaF9mbGF2 b3IgPT0gTUNfR0xZUEhMRVNTKQorICAgICAgeworICAgICAgICBOU0NvbG9yICpib3JkZXJfY29s b3IgPSBbTlNDb2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiBsc2wucmVkCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JlZW46IGxz bC5ncmVlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBibHVlOiBsc2wuYmx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscGhhOiAxLjBdOworICAgICAgICBuc19kcmF3 X2JveCAoYnIsIHRoaWNrbmVzcywgYm9yZGVyX2NvbG9yLCAxLCAxKTsKKyAgICAgIH0KKyAgICAg IGVsc2UKKyAgICAgICAgbnNfZHJhd19ib3ggKGJyLCB0aGlja25lc3MsIEZSQU1FX0NVUlNPUl9D T0xPUiAocy0+ZiksIDEsIDEpOworICAgIH0KK30KKworc3RhdGljIHZvaWQKK21jX25zX21heWJl X2R1bXBnbHlwaHNfYmFja2dyb3VuZCAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgY2hhciBmb3Jj ZV9wKQoreworICBOU1RSQUNFICgibWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIik7 CisgIGlmICghcy0+YmFja2dyb3VuZF9maWxsZWRfcC8qIHx8IHMtPmhsID09IERSQVdfTU9VU0Vf RkFDRSovKQorICAgIHsKKyAgICAgIGludCBib3hfbGluZV93aWR0aCA9IG1heCAocy0+ZmFjZS0+ Ym94X2xpbmVfd2lkdGgsIDApOworICAgICAgaWYgKEZPTlRfSEVJR0hUIChzLT5mb250KSA8IHMt PmhlaWdodCAtIDIgKiBib3hfbGluZV93aWR0aAorICAgICAgICAgIC8qIFdoZW4geGRpc3AuYyBp Z25vcmVzIEZPTlRfSEVJR0hULCB3ZSBjYW5ub3QgdHJ1c3QgZm9udAorICAgICAgICAgICAgIGRp bWVuc2lvbnMsIHNpbmNlIHRoZSBhY3R1YWwgZ2x5cGhzIG1pZ2h0IGJlIG11Y2gKKyAgICAgICAg ICAgICBzbWFsbGVyLiAgU28gaW4gdGhhdCBjYXNlIHdlIGFsd2F5cyBjbGVhciB0aGUgcmVjdGFu Z2xlCisgICAgICAgICAgICAgd2l0aCBiYWNrZ3JvdW5kIGNvbG9yLiAqLworICAgICAgICAgIHx8 IEZPTlRfVE9PX0hJR0ggKHMtPmZvbnQpCisgICAgICAgICAgfHwgcy0+Zm9udF9ub3RfZm91bmRf cCB8fCBzLT5leHRlbmRzX3RvX2VuZF9vZl9saW5lX3AgfHwgZm9yY2VfcCkKKyAgICAgICAgewor ICAgICAgICAgIHN0cnVjdCBmYWNlICpmYWNlOworICAgICAgICAgIGlmIChzLT5obCA9PSBEUkFX X01PVVNFX0ZBQ0UpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGZhY2UgPSBGQUNFX0ZS T01fSUQgKHMtPmYsIE1PVVNFX0hMX0lORk8gKHMtPmYpLT5tb3VzZV9mYWNlX2ZhY2VfaWQpOwor ICAgICAgICAgICAgICBpZiAoIWZhY2UpCisgICAgICAgICAgICAgICAgZmFjZSA9IEZBQ0VfRlJP TV9JRCAocy0+ZiwgTU9VU0VfRkFDRV9JRCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBl bHNlCisgICAgICAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIHMtPmZpcnN0X2ds eXBoLT5mYWNlX2lkKTsKKyAgICAgICAgICBpZiAoIWZhY2UtPnN0aXBwbGUpCisgICAgICAgICAg ICBbKE5TX0ZBQ0VfQkFDS0dST1VORCAoZmFjZSkgIT0gMAorICAgICAgICAgICAgICA/IG5zX2xv b2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpLCBzLT5mKQorICAg ICAgICAgICAgICA6IEZSQU1FX0JBQ0tHUk9VTkRfQ09MT1IgKHMtPmYpKSBzZXRdOworICAgICAg ICAgICAgZWxzZQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RydWN0IG5zX2Rp c3BsYXlfaW5mbyAqZHB5aW5mbyA9IEZSQU1FX0RJU1BMQVlfSU5GTyAocy0+Zik7CisgICAgICAg ICAgICAgICAgW1tkcHlpbmZvLT5iaXRtYXBzW2ZhY2UtPnN0aXBwbGUtMV0uaW1nIHN0aXBwbGVN YXNrXSBzZXRdOworICAgICAgICAgICAgICB9CisgICAgICAgICAgaWYgKHMtPmhsICE9IERSQVdf Q1VSU09SKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzLT5yZWN0YW5nbGVfbnVrZWRf cCA9IHRydWU7CisgICAgICAgICAgICAgIE5TUmVjdCByID0gTlNNYWtlUmVjdCAocy0+eCwgcy0+ eSArIGJveF9saW5lX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg cy0+YmFja2dyb3VuZF93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHMtPmhlaWdodC0yKmJveF9saW5lX3dpZHRoKTsKKyAgICAgICAgICAgICAgTlNSZWN0RmlsbCAo cik7CisgICAgICAgICAgICB9CisgICAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IDE7 CisgICAgICAgIH0KKyAgICB9Cit9CisKK3N0YX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Mt PmZvcl9vdmVybGFwcykKKyAgICB7CisgICAgICBpbnQgd2lkdGg7CisgICAgICBzdHJ1Y3QgZ2x5 cGhfc3RyaW5nICpuZXh0OworICAgICAgZm9yICh3aWR0aCA9IDAsIG5leHQgPSBzLT5uZXh0Owor ICAgICAgICAgICBuZXh0ICYmIHdpZHRoIDwgcy0+cmlnaHRfb3Zlcmhhbmc7CisgICAgICAgICAg IHdpZHRoICs9IG5leHQtPndpZHRoLCBuZXh0ID0gbmV4dC0+bmV4dCkKKyAgICAgICAgaWYgKG5l eHQtPmZpcnN0X2dseXBoLT50eXBlICE9IElNQUdFX0dMWVBIKQorICAgICAgICAgIHsKKyAgICAg ICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSAhPSBTVFJFVENIX0dMWVBIKQorICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xp cF9yZWN0IChzLT5uZXh0LCByKTsKKyAgICAgICAgICAgICAgICBpZiAoIW5zX2NsaXBfdG9fcmVj dCAocy0+ZiwgciwgbikpCisgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAg ICAgbWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzLT5uZXh0LCAxKTsKKyAgICAg ICAgICAgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgbWNfbnNfZHVtcGdseXBoc19zdHJldGNoIChz LT5uZXh0LCBtYXRyaXgsIHJvdywgd2QpOworICAgICAgICAgICAgbmV4dC0+bnVtX2NsaXBzID0g MDsKKyAgICAgICAgICB9CisgICAgfQorICBpZiAoIXMtPmZvcl9vdmVybGFwcyAmJiBzLT5mYWNl LT5ib3ggIT0gRkFDRV9OT19CT1gKKyAgICAgICYmIChzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBD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N0aXZlX2ZhY2VfaWQp OworICAgICAgICAgICAgICBOU19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2UpID0gTlNfRkFDRV9G T1JFR1JPVU5EIChob2xsb3dfaW5hY3RpdmVfZmFjZSk7CisgICAgICAgICAgICB9CisgICAgICB7 CisgICAgICAgIEJPT0wgaXNDb21wb3NpdGUgPSBzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDT01Q T1NJVEVfR0xZUEg7CisgICAgICAgIGlmIChpc0NvbXBvc2l0ZSkKKyAgICAgICAgICBuc19kcmF3 X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAgICAgICAgZWxzZQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICBib29sIHdpdGhfYmdfcCA9ICgoZmxhZ3MgPT0g TlNfRFVNUEdMWVBIX05PUk1BTCAmJiAhcy0+YmFja2dyb3VuZF9maWxsZWRfcCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgfHwgZmxhZ3MgPT0gTlNfRFVNUEdMWVBIX01PVVNFRkFD RSk7CisgICAgICAgICAgICAgIGlmICh3aXRoX2JnX3ApCisgICAgICAgICAgICAgICAgcy0+YmFj a2dyb3VuZF9udWtlZF9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgZm9udC0+ZHJpdmVyLT5kcmF3 IChzLCBzLT5jbXBfZnJvbSwgcy0+bmNoYXJzLCBzLT54LCBzLT55YmFzZSwgd2l0aF9iZ19wKTsK KyAgICAgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIHsKKyAgICAgICAgTlNDb2xvciAqY29sID0g KE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSkgIT0gMAorICAgICAgICAgICAgICAgICAgICAg ICAgPyBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNl KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMt PmYpCisgICAgICAgICAgICAgICAgICAgICAgICA6IEZSQU1FX0ZPUkVHUk9VTkRfQ09MT1IgKHMt PmYpKTsKKyAgICAgICAgW2NvbCBzZXRdOworICAgICAgICAvKiBEcmF3IHVuZGVybGluZSwgb3Zl cmxpbmUsIHN0cmlrZS10aHJvdWdoLiAqLworICAgICAgICBtY19uc19kcmF3X3RleHRfZGVjb3Jh dGlvbiAocywgcy0+ZmFjZSwgY29sLCBzLT53aWR0aCwgcy0+eCk7CisgICAgICB9CisgICAgICB7 CisgICAgICAgIGlmIChzLT5maXJzdF9nbHlwaC0+dHlwZSAhPSBDT01QT1NJVEVfR0xZUEgKKyAg ICAgICAgICAgICYmIChzLT5sZWZ0X292ZXJ3cml0dGVuX3AgfHwgcy0+cmlnaHRfb3ZlcndyaXR0 ZW5fcCkKKyAgICAgICAgICAgICYmIChzLT5iYWNrZ3JvdW5kX251a2VkX3AgfHwgcy0+cmVjdGFu Z2xlX251a2VkX3ApCisgICAgICAgICAgICAmJiAocy0+YWN0aW9uX3R5cGUgPT0gTUNfRFJBV19H TFlQSF9TVFJJTkd8fCBzLT5hY3Rpb25fdHlwZSA9PSBNQ19FUkFTRV9HTFlQSF9TVFJJTkcpKQor ICAgICAgICAgIG1jX25zX2RyYXdfb3ZlcndyaXR0ZW4gKHMsIG1hdHJpeCwgcm93LCBzLT5maXJz dF9nbHlwaCk7CisgICAgICB9CisgICAgICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IKKyAgICAg ICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9YKQorICAgICAgICB7CisgICAgICAg ICAgdW5zaWduZWQgbG9uZyB0bXAgPSBOU19GQUNFX0JBQ0tHUk9VTkQgKHMtPmZhY2UpOworICAg ICAgICAgIE5TX0ZBQ0VfQkFDS0dST1VORCAocy0+ZmFjZSkgPSBOU19GQUNFX0ZPUkVHUk9VTkQg KHMtPmZhY2UpOworICAgICA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HMgJiYg IWJveF9kcmF3bl9wICYmIHMtPmZhY2UtPmJveCAhPSBGQUNFX05PX0JPWCkKKyAgICB7CisgICAg ICBuID0gbnNfZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsIHIpOworICAgICAgaWYgKCFu c19jbGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4pKQorICAgICAgICByZXR1cm47CisgICAgICBuc19k dW1wZ2x5cGhzX2JveF9vcl9yZWxpZWYgKHMpOworICAgICAgbnNfcmVzZXRfY2xpcHBpbmcgKHMt PmYpOworICAgIH0KKyAgcy0+bnVtX2NsaXBzID0gMDsKK30KKworLyogZW5kIE1VTFRJUExFLUNV UlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC8qID09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09CiAKICAgIE5TVFJBQ0UsIFRyYWNlIHN1cHBvcnQuCkBAIC0xMTA5LDYgKzIwODIsMTYgQEAg c3RhdGljIE5TUmVjdCBjb25zdHJhaW5fZnJhbWVfcmVjdChOU1JlY3QgZnJhbWVSZWN0LCBib29s IGlzRnVsbHNjcmVlbikKICAgIGV4dGVybmFsIChSSUYpIGNhbGw7IHdob2xlIGZyYW1lLCBjYWxs ZWQgYmVmb3JlIHVwZGF0ZV93aW5kb3dfYmVnaW4KICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCiB7 CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK KyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBmOworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiAjaWZkZWYgTlNfSU1QTF9DT0NPQQogICBFbWFjc1ZpZXcgKnZpZXcgPSBGUkFNRV9OU19W SUVXIChmKTsKIApAQCAtMTIwOSw2ICsyMTkyLDE2IEBAIHN0YXRpYyBOU1JlY3QgY29uc3RyYWlu X2ZyYW1lX3JlY3QoTlNSZWN0IGZyYW1lUmVjdCwgYm9vbCBpc0Z1bGxzY3JlZW4pCiAKIC8qICAg aWYgKGYgPT0gTU9VU0VfSExfSU5GTyAoZiktPm1vdXNlX2ZhY2VfbW91c2VfZnJhbWUpICovCiAg IE1PVVNFX0hMX0lORk8gKGYpLT5tb3VzZV9mYWNlX2RlZmVyID0gMDsKKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGlu Z19mcmFtZSA9IE5VTEw7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIH0KIAogCkBA IC00ODAzLDYgKzU3OTYsMTcgQEAgaW4gY2VydGFpbiBzaXR1YXRpb25zIChyYXBpZCBpbmNvbWlu ZyBldmVudHMpLgogICAgICAgYmFyID0gW1tFbWFjc1Njcm9sbGVyIGFsbG9jXSBpbml0RnJhbWU6 IHIgd2luZG93OiB3aW5dOwogICAgICAgd3NldF92ZXJ0aWNhbF9zY3JvbGxfYmFyICh3aW5kb3cs IG1ha2VfbWludF9wdHIgKGJhcikpOwogICAgICAgdXBkYXRlX3AgPSBZRVM7CisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIC8qIFRo aXMgaXMgb25seSBmb3IgZGVidWdnaW5nIHB1cnBvc2VzLiAqLworICAgICAgW2JhciBtY19zZXRf cmVjdGFuZ2xlOiByXTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgIH0KICAg ZWxzZQogICAgIHsKQEAgLTQ4MTAsMTIgKzU4MTQsMzAgQEAgaW4gY2VydGFpbiBzaXR1YXRpb25z IChyYXBpZCBpbmNvbWluZyBldmVudHMpLgogICAgICAgYmFyID0gWE5TX1NDUk9MTF9CQVIgKHdp bmRvdy0+dmVydGljYWxfc2Nyb2xsX2Jhcik7CiAgICAgICBvbGRSZWN0ID0gW2JhciBmcmFtZV07 CiAgICAgICByLnNpemUud2lkdGggPSBvbGRSZWN0LnNpemUud2lkdGg7CisKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgICAgIGlmIChGUkFN RV9MSVZFX1AgKGYpICYmICFOU0VxdWFsUmVjdHMgKG9sZFJlY3QsIHIpKQogICAgICAgICB7Cisg ICAgICAgICAgLyogVGhlIG1haW4gd2luZG93IGhhcyBwcm9iYWJseSBiZWVuIHJlc2l6ZWQuICBH cmFjaW91c2x5IGRlbGV0ZSB0aGUKKyAgICAgICAgICBvbGQgc2Nyb2xsIGJhciB3aXRob3V0IHJl cGFpbnRpbmcgaXRzIHJlY3RhbmdsZTsgYW5kLCBjcmVhdGUgYSBuZXcKKyAgICAgICAgICBzY3Jv bGwgYmFyIGVsc2V3aGVyZS4qLwogICAgICAgICAgIGlmIChvbGRSZWN0Lm9yaWdpbi54ICE9IHIu b3JpZ2luLngpCisgICAgICAgICAgICB7CiAgICAgICAgICAgICAgIG5zX2NsZWFyX2ZyYW1lX2Fy ZWEgKGYsIGxlZnQsIHRvcCwgd2lkdGgsIGhlaWdodCk7CisgICAgICAgICAgICAgIFtiYXIgbWNf anVkZ2VdOworICAgICAgICAgICAgICBiYXIgPSBbW0VtYWNzU2Nyb2xsZXIgYWxsb2NdIGluaXRG cmFtZTogciB3aW5kb3c6IHdpbl07CisgICAgICAgICAgICAgIHdzZXRfdmVydGljYWxfc2Nyb2xs X2JhciAod2luZG93LCBtYWtlX21pbnRfcHRyIChiYXIpKTsKKyAgICAgICAgICAgIH0KKyAgICAg ICAgICAgIGVsc2UKICAgICAgICAgICBbYmFyIHNldEZyYW1lOiByXTsKICAgICAgICAgfQorCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgfQogCiAgIGlmICh1cGRhdGVfcCkKQEAg LTQ5NzUsOSArNTk5Nyw1NyBAQCBpbiBjZXJ0YWluIHNpdHVhdGlvbnMgKHJhcGlkIGluY29taW5n IGV2ZW50cykuCiAgICAgewogICAgICAgdmlldyA9IFtzdWJ2aWV3cyBvYmplY3RBdEluZGV4OiBp XTsKICAgICAgIGlmICghW3ZpZXcgaXNLaW5kT2ZDbGFzczogW0VtYWNzU2Nyb2xsZXIgY2xhc3Nd XSkgY29udGludWU7Ci0gICAgICBpZiAoW3ZpZXcganVkZ2VdKQorCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8qIGBYU0VUV0lORE9XJyB3 aWxsIHNvbWV0aW1lcyBjYXVzZSBFbWFjcyB0byBjcmFzaCB3aGVuIHJ1bm5pbmcgdW5kZXIgZ2Ri IGV2ZW4KKyAgdGhvdWdoICh3ICE9IE5VTEwpLiAgVGhlcmVmb3JlLCB3ZSBjYW5ub3QgcmVsaWFi bHkgdXNlIGBXSU5ET1dfTElWRV9QJy4gKi8KKyAgc3RydWN0IHdpbmRvdyAqdyA9IFt2aWV3IG1j X2dldF93aW5kb3ddOworICBpZiAodyAhPSBOVUxMCisgICAgICAmJiBOSUxQICh3LT5jb250ZW50 cykpCisgICAgeworICAgICAgQk9PTCBkZWJ1Z19wID0gZmFsc2U7CisgICAgICBpZiAoZGVidWdf cAorICAgICAgICAgIC8qIGB3aW5kb3dfYm94JyBjYWxscyBgd2luZG93X2JveF9oZWlnaHQnLCB3 aGljaCB3aWxsIGNhdXNlIEVtYWNzIHRvCisgICAgICAgICAgY3Jhc2ggaWYgRlJBTUVQICh3LT5m cmFtZSkgaXMgbm90IHNhdGlzZmllZC4gKi8KKyAgICAgICAgICAmJiBGUkFNRVAgKHctPmZyYW1l KSkKKyAgICAgICAgeworICAgICAgICAgIE5TUmVjdCByMCA9IFt2aWV3IG1jX2dldF9yZWN0YW5n bGVdOworICAgICAgICAgIGludCB4MCA9IE5TTWluWCAocjApOworICAgICAgICAgIGludCB5MCA9 IE5TTWluWSAocjApOworICAgICAgICAgIGludCB3ZDAgPSBOU1dpZHRoIChyMCk7CisgICAgICAg ICAgaW50IGgwID0gTlNIZWlnaHQgKHIwKTsKKyAgICAgICAgICBpbnQgd2luZG93X3ksIHdpbmRv d19oZWlnaHQ7CisgICAgICAgICAgd2luZG93X2JveCAodywgQU5ZX0FSRUEsIDAsICZ3aW5kb3df eSwgMCwgJndpbmRvd19oZWlnaHQpOworICAgICAgICAgIGludCB0b3AgPSB3aW5kb3dfeTsKKyAg ICAgICAgICBpbnQgaGVpZ2h0ID0gd2luZG93X2hlaWdodDsKKyAgICAgICAgICBpbnQgd2lkdGgg PSBXSU5ET1dfQ09ORklHX1NDUk9MTF9CQVJfQ09MUyAodykgKiBGUkFNRV9DT0xVTU5fV0lEVEgg KGYpOworICAgICAgICAgIGludCBsZWZ0ID0gV0lORE9XX1NDUk9MTF9CQVJfQVJFQV9YICh3KTsK KyAgICAgICAgICBOU1JlY3QgcjEgPSBOU01ha2VSZWN0IChsZWZ0LCB0b3AsIHdpZHRoLCBoZWln aHQpOworICAgICAgICAgIC8qIFRoZSBwYXJlbnQgdmlldyBpcyBmbGlwcGVkLCBzbyB3ZSBuZWVk IHRvIGZsaXAgeSB2YWx1ZS4gKi8KKyAgICAgICAgICBFbWFjc1ZpZXcgKmZyYW1lX3ZpZXcgPSBG UkFNRV9OU19WSUVXIChmKTsKKyAgICAgICAgICBOU1JlY3QgdiA9IFtmcmFtZV92aWV3IGZyYW1l XTsKKyAgICAgICAgICByMS5vcmlnaW4ueSA9ICh2LnNpemUuaGVpZ2h0IC0gcjEuc2l6ZS5oZWln aHQgLSByMS5vcmlnaW4ueSk7CisgICAgICAgICAgaW50IHgxID0gTlNNaW5YIChyMSk7CisgICAg ICAgICAgaW50IHkxID0gTlNNaW5ZIChyMSk7CisgICAgICAgICAgaW50IHdkMSA9IE5TV2lkdGgg KHIxKTsKKyAgICAgICAgICBpbnQgaDEgPSBOU0hlaWdodCAocjEpOworICAgICAgICAgIGZwcmlu dGYgKHN0ZGVyciwgIiVzIC0tIERFQUQ6XG5cCisgICAgICAgICAgeDAveDEgKCVkLyVkKSB8IHkw L3kxICglZC8lZCkgfCB3ZDAvd2QxICglZC8lZCkgfCBoMC9oMSAoJWQvJWQpXG4iLAorICAgICAg ICAgIG1jX3dpbmRvdyAodyksIHgwLCB4MSwgeTAsIHkxLCB3ZDAsIHdkMSwgaDAsIGgxKTsKKyAg ICAgICAgfQorICAgICAgaWYgKFt2aWV3IG1jX2p1ZGdlXSkKICAgICAgICAgcmVtb3ZlZCA9IFlF UzsKICAgICB9CisgICAgZWxzZSBpZiAoW3ZpZXcganVkZ2VdKQorICAgICAgcmVtb3ZlZCA9IFlF UzsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKworICAgIH0KIAogICBpZiAocmVtb3Zl ZCkKICAgICBbZXZpZXcgdXBkYXRlRnJhbWVTaXplOiBOT107CkBAIC01MTA2LDYgKzYxNzYsMjAg QEAgc3RhdGljIExpc3BfT2JqZWN0IG5zX3N0cmluZ190b19saXNwbW9kIChjb25zdCBjaGFyICpz KQogZXh0ZXJuIGZyYW1lX3Bhcm1faGFuZGxlciBuc19mcmFtZV9wYXJtX2hhbmRsZXJzW107CiBz dGF0aWMgc3RydWN0IHJlZGlzcGxheV9pbnRlcmZhY2UgbnNfcmVkaXNwbGF5X2ludGVyZmFjZSA9 CiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKy8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgbnN0ZXJtLm1gIG11c3QgYmUgaW4gdGhl IGV4YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYGRpc3Bl eHRlcm4uaGAhICovCisKKyAgbWNfbnNfZHJhd193aW5kb3dfY3Vyc29yLAorICBtY19uc19kcmF3 X2dseXBoX3N0cmluZywKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBuc19mcmFt ZV9wYXJtX2hhbmRsZXJzLAogICB4X3Byb2R1Y2VfZ2x5cGhzLAogICB4X3dyaXRlX2dseXBocywK QEAgLTg3MjEsNiArOTgwNSw0OSBAQCAtIChCT09MKWNhbkJlY29tZU1haW5XaW5kb3cKIAogQGlt cGxlbWVudGF0aW9uIEVtYWNzU2Nyb2xsZXIKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLSAodm9pZCltY19zZXRfcmVjdGFuZ2xlOiAoTlNS ZWN0KXJlY3QKK3sKKyAgbWNfcmVjdGFuZ2xlID0gcmVjdDsKK30KKworLSAoTlNSZWN0KW1jX2dl dF9yZWN0YW5nbGUKK3sKKyAgcmV0dXJuIG1jX3JlY3RhbmdsZTsKK30KKworLSAoc3RydWN0IHdp bmRvdyAqKW1jX2dldF93aW5kb3cKK3sKKyAgcmV0dXJuIHdpbmRvdzsKK30KKworLSAoYm9vbClt Y19qdWRnZQoreworICBOU1RSQUNFICgiW0VtYWNzU2Nyb2xsZXIgbWNfanVkZ2VdIik7CisgIGJv b2wgcmV0ID0gY29uZGVtbmVkOworICBibG9ja19pbnB1dCAoKTsKKyAgaWYgKGNvbmRlbW5lZCkK KyAgICB7CisgICAgICAvKiBlbnN1cmUgb3RoZXIgc2Nyb2xsYmFyIHVwZGF0ZXMgYWZ0ZXIgZGVs ZXRpb24gKi8KKyAgICAgIEVtYWNzVmlldyAqdmlldyA9IChFbWFjc1ZpZXcgKilGUkFNRV9OU19W SUVXIChmcmFtZSk7CisgICAgICBpZiAodmlldyAhPSBuaWwpCisgICAgICAgIHZpZXctPnNjcm9s bGJhcnNOZWVkaW5nVXBkYXRlKys7CisgICAgfQorICBpZiAod2luZG93KQorICAgIHdzZXRfdmVy dGljYWxfc2Nyb2xsX2JhciAod2luZG93LCBRbmlsKTsKKyAgd2luZG93ID0gMDsKKyAgW3NlbGYg cmVtb3ZlRnJvbVN1cGVydmlld1dpdGhvdXROZWVkaW5nRGlzcGxheV07CisgIFtzZWxmIHJlbGVh c2VdOworICB1bmJsb2NrX2lucHV0ICgpOworICByZXR1cm4gcmV0OworfQorCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqK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S5vcmcvbGljZW5zZXMvPi4gICovCiAjaW5jbHVkZSAiYml0bWFwcy9ncmF5LnhibSIKICNl bmRpZgogDAorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4gTVVMVElQTEUt Q1VSU09SUyAqLworCisjaWZkZWYgR0xZUEhfREVCVUcKK3N0YXRpYyB2b2lkIHhfY2hlY2tfZm9u dCAoc3RydWN0IGZyYW1lICosIHN0cnVjdCBmb250ICopOworI2VuZGlmCisKK3N0YXRpYyB2b2lk IFhDaGFuZ2VHQyAodm9pZCAqLCBYR0NWYWx1ZXMgKiwgdW5zaWduZWQgbG9uZywgWEdDVmFsdWVz ICopOworCitzdGF0aWMgdm9pZCB3MzJfZHJhd191bmRlcndhdmUgKHN0cnVjdCBnbHlwaF9zdHJp bmcgKiwgQ09MT1JSRUYpOworCitzdGF0aWMgdm9pZCB4X3NldF9tb2RlX2xpbmVfZmFjZV9nYyAo c3RydWN0IGdseXBoX3N0cmluZyAqKTsKKworc3RhdGljIHZvaWQgeF9zZXRfbW91c2VfZmFjZV9n YyAoc3RydWN0IGdseXBoX3N0cmluZyAqKTsKKworc3RhdGljIHZvaWQgdzMyX2NsaXBfdG9fcm93 IChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwgZW51bSBnbHlwaF9yb3dfYXJl YSwgSERDKTsKKworc3RhdGljIHZvaWQgdzMyX3NldF9jbGlwX3JlY3RhbmdsZSAoSERDLCBSRUNU ICopOworCitzdGF0aWMgdm9pZCB4X3NldF9nbHlwaF9zdHJpbmdfZ2MgKHN0cnVjdCBnbHlwaF9z dHJpbmcgKik7CisKK3N0YXRpYyB2b2lkIHhfc2V0X2dseXBoX3N0cmluZ19jbGlwcGluZyAoc3Ry dWN0IGdseXBoX3N0cmluZyAqKTsKKworc3RhdGljIHZvaWQgeF9kcmF3X2dseXB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BzLT54OworICAgICAgaWYgKCFzLT5yb3ctPnJl dmVyc2VkX3ApCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgbGVmdF94ID0gd2luZG93X2JveF9s ZWZ0X29mZnNldCAocy0+dywgVEVYVF9BUkVBKTsKKyAgICAgICAgICBpZiAoeCA8IGxlZnRfeCkK KyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgYmFja2dyb3VuZF93aWR0aCAtPSBsZWZ0X3gg LSB4OworICAgICAgICAgICAgICB4ID0gbGVmdF94OworICAgICAgICAgICAgfQorICAgICAgICB9 CisgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgLyogSW4gUjJMIHJvd3MsIGRyYXcg dGhlIGN1cnNvciBvbiB0aGUgcmlnaHQgZWRnZSBvZiB0aGUKKyAgICAgICAgICAgICBzdHJldGNo IGdseXBoLiAgKi8KKyAgICAgICAgICBpbnQgcmlnaHRfeCA9IHdpbmRvd19ib3hfcmlnaHQgKHMt PncsIFRFWFRfQVJFQSk7CisgICAgICAgICAgaWYgKHggKyBiYWNrZ3JvdW5kX3dpZHRoID4gcmln aHRfeCkKKyAgICAgICAgICAgIGJhY2tncm91bmRfd2lkdGggLT0geCAtIHJpZ2h0X3g7CisgICAg ICAgICAgeCArPSBiYWNrZ3JvdW5kX3dpZHRoOworICAgICAgICB9CisgICAgICB3aWR0aCA9IG1p biAoRlJBTUVfQ09MVU1OX1dJRFRIIChzLT5mKSwgYmFja2dyb3VuZF93aWR0aCk7CisgICAgICBp ZiAocy0+cm93LT5yZXZlcnNlZF9wKQorICAgICAgICB4IC09IHdpZHRoOworICAgICAgLyogRHJh dyBjdXJzb3IuICAqLworICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19iZ19yZWN0IChzLCB4LCBz LT55LCB3aWR0aCwgcy0+aGVpZ2h0KTsKKyAgICAgIC8qIENsZWFyIHJlc3QgdXNpbmcgdGhlIEdD IG9mIHRoZSBvcmlnaW5hbCBub24tY3Vyc29yIGZhY2UuICAqLworICAgICAgaWYgKHdpZHRoIDwg YmFja2dyb3VuZF93aWR0aCkKKyAgICAgICAgeworICAgICAgICAgIFhHQ1ZhbHVlcyAqZ2MgPSBz LT5mYWNlLT5nYzsKKyAgICAgICAgICBpbnQgeSA9IHMtPnk7CisgICAgICAgICAgaW50IHcgPSBi YWNrZ3JvdW5kX3dpZHRoIC0gd2lkdGgsIGggPSBzLT5oZWlnaHQ7CisgICAgICAgICAgUkVDVCBy OworICAgICAgICAgICAgICAgIEhEQyBoZGMgPSBzLT5oZGM7CisgICAgICAgICAgaWYgKCFzLT5y b3ctPnJldmVyc2VkX3ApCisgICAgICAgICAgICB4ICs9IHdpZHRoOworICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgIHggPSBzLT54OworICAgICAgICAgIGlmIChzLT5yb3ctPm1vdXNlX2ZhY2Vf cAorICAgICAgICAgICAgICAmJiBjdXJzb3JfaW5fbW91c2VfZmFjZV9wIChzLT53KSkKKyAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgeF9zZXRfbW91c2VfZmFjZV9nYyAocyk7CisgICAgICAg ICAgICAgIGdjID0gcy0+Z2M7CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgZ2MgPSBzLT5mYWNlLT5nYzsKKyAgICAgICAgICBnZXRfZ2x5cGhfc3RyaW5nX2NsaXBf cmVjdCAocywgJnIpOworICAgICAgICAgIHczMl9zZXRfY2xpcF9yZWN0YW5nbGUgKGhkYywgJnIp OworI2lmIDAgLyogVE9ETzogc3RpcHBsZSAqLworICAgICAgICAgIGlmIChzLT5mYWNlLT5zdGlw cGxlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBGaWxsIGJhY2tncm91bmQgd2l0 aCBhIHN0aXBwbGUgcGF0dGVybi4gICovCisgICAgICAgICAgICAgIFhTZXRGaWxsU3R5bGUgKHMt PmRpc3BsYXksIGdjLCBGaWxsT3BhcXVlU3RpcHBsZWQpOworICAgICAgICAgICAgICBYRmlsbFJl Y3RhbmdsZSAocy0+ZGlzcGxheSwgcy0+d2luZG93LCBnYywgeCwgeSwgdywgaCk7CisgICAgICAg ICAgICAgIFhTZXRGaWxsU3R5bGUgKHMtPmRpc3BsYXksIGdjLCBGaWxsU29saWQpOworICAgICAg ICAgICAgfQorICAgICAgICAgIGVsc2UKKyNlbmRpZgorICAgICAgICAgICAgeworICAgICAgICAg ICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIGdjLT5iYWNrZ3JvdW5kLCB4LCB5LCB3 LCBoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgZWxzZSBpZiAoIXMtPmJh Y2tncm91bmRfZmlsbGVkX3ApCisgICAgeworICAgICAgaW50IGJhY2tncm91bmRfd2lkdGggPSBz LT5iYWNrZ3JvdW5kX3dpZHRoOworICAgICAgaW50IHggPSBzLT54LCBsZWZ0X3ggPSB3aW5kb3df Ym94X2xlZnRfb2Zmc2V0IChzLT53LCBURVhUX0FSRUEpOworICAgICAgLyogRG9uJ3QgZHJhdyBp bnRvIGxlZnQgbWFyZ2luLCBmcmluZ2Ugb3Igc2Nyb2xsYmFyIGFyZWEKKyAgICAgICAgIGV4Y2Vw dCBmb3IgaGVhZGVyIGxpbmUgYW5kIG1vZGUgbGluZS4gICovCisgICAgICBpZiAoeCA8IGxlZnRf eCAmJiAhcy0+cm93LT5tb2RlX2xpbmVfcCkKKyAgICAgICAgeworICAgICAgICAgIGJhY2tncm91 bmRfd2lkdGggLT0gbGVmdF94IC0geDsKKyAgICAgICAgICB4ID0gbGVmdF94OworICAgICAgICB9 CisgICAgICBpZiAoYmFja2dyb3VuZF93aWR0aCA+IDApCisgICAgICAgIHhfZHJhd19nbHlwaF9z dHJpbmdfYmdfcmVjdCAocywgeCwgcy0+eSwgYmFja2dyb3VuZF93aWR0aCwgcy0+aGVpZ2h0KTsK KyAgICB9CisgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0c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gbWFnbmlmaWVycworICAgICAgYW5kIHNwZWVjaCBzeW50aGVzaXplcnMgY2Fu IGZvbGxvdyB0aGUgY3Vyc29yLiAgKi8KKyAgICAgIGlmIChhY3RpdmVfcCkKKyAgICAgICAgewor ICAgICAgICAgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7Cisg ICAgICAgICAgSFdORCBod25kID0gRlJBTUVfVzMyX1dJTkRPVyAoZik7CisgICAgICAgICAgdzMy X3N5c3RlbV9jYXJldF94CisgICAgICAgICAgICA9IFdJTkRPV19URVhUX1RPX0ZSQU1FX1BJWEVM X1ggKHcsIHgpOworICAgICAgICAgIC8qIEZJWE1FOiAgV2hhdCBzaG91bGQgd2UgdXNlIGluc3Rl YWQgb2YgYHctPnBoeXNfY3Vyc29yX2FzY2VudCc/ICovCisgICAgICAgICAgdzMyX3N5c3RlbV9j YXJldF95CisgICAgICAgICAgICA9IChXSU5ET1dfVE9fRlJBTUVfUElYRUxfWSAodywgeSkKKyAg ICAgICAgICAgICAgICsgcm93LT5hc2NlbnQgLSB3LT5waHlzX2N1cnNvcl9hc2NlbnQpOworICAg ICAgICAgIHczMl9zeXN0ZW1fY2FyZXRfd2luZG93ID0gdzsKKyAgICAgICAgICB3MzJfc3lzdGVt X2NhcmV0X2hkcl9oZWlnaHQgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgICAg ICAgICB3MzJfc3lzdGVtX2NhcmV0X21vZGVfaGVpZ2h0ID0gV0lORE9XX01PREVfTElORV9IRUlH SFQgKHcpOworICAgICAgICAgIFBvc3RNZXNzYWdlIChod25kLCBXTV9JTUVfU1RBUlRDT01QT1NJ VElPTiwgMCwgMCk7CisgICAgICAgICAgLyogSWYgdGhlIHNpemUgb2YgdGhlIGFjdGl2ZSBjdXJz b3IgY2hhbmdlZCwgZGVzdHJveSB0aGUgb2xkCisgICAgICAgICAgICAgc3lzdGVtIGNhcmV0LiAg Ki8KKyAgICAgICAgICBpZiAodzMyX3N5c3RlbV9jYXJldF9od25kCisgICAgICAgICAgICAgICYm ICh3MzJfc3lzdGVtX2NhcmV0X2hlaWdodCAhPSBoKSkKKyAgICAgICAgICAgIFBvc3RNZXNzYWdl IChod25kLCBXTV9FTUFDU19ERVNUUk9ZX0NBUkVULCAwLCAwKTsKKyAgICAgICAgICB3MzJfc3lz dGVtX2NhcmV0X2hlaWdodCA9IGg7CisgICAgICAgICAgLyogTW92ZSB0aGUgc3lzdGVtIGNhcmV0 LiAgKi8KKyAgICAgICAgICBQb3N0TWVzc2FnZSAoaHduZCwgV01fRU1BQ1NfVFJBQ0tfQ0FSRVQs IDAsIDApOworICAgICAgICB9CisgICAgICAvKiBUaGUgZnJpbmdlIGJpdG1hcHMgYXJlIHByZXNl bnRseSBoYW5kbGVkIGVsc2V3aGVyZSwgYnV0IGNvdWxkIHNvbWVkYXkKKyAgICAgIGJlIG1hbmFn ZWQgKGluIHBhcnQpIGF0IHRoaXMgc2VjdGlvbiBvZiBjb2RlLiAqLworICAgICAgaWYgKHJvdy0+ ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVfcAorICAgICAgICAgICYmIChyb3ctPnJldmVyc2VkX3AK KyAgICAgICAgICAgICA/IChocG9zIDwgMCkKKyAgICAgICAgICAgICA6IChocG9zID49IHJvdy0+ dXNlZFtURVhUX0FSRUFdKSkpCisgICAgICAgIHsKKyAgICAgICAgICByb3ctPmN1cnNvcl9pbl9m cmluZ2VfcCA9IHRydWU7CisgICAgICAgICAgbWNfZHJhd19mcmluZ2VfYml0bWFwICh3LCByb3cs IHJvdy0+cmV2ZXJzZWRfcCwgY3Vyc29yX3R5cGUpOworICAgICAgICAgIHJldHVybjsKKyAgICAg ICAgfQorICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworICBD T0xPUlJFRiBvcmlnaW5hbF9jdXJzb3JfcGl4ZWwgPSBmLT5vdXRwdXR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KGFjdGl2ZV9wKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg ICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2Ug KHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsK KyAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFjZSA9IEZB Q0VfRlJPTV9JRCAoZiwgaG9sbG93X2FjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAg ICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7 CisgICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5iYWNrZ3JvdW5kID0gaG9sbG93X2FjdGl2 ZV9mYWNlLT5iYWNrZ3JvdW5kOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAg ICAgZWxzZSBpZiAoIWFjdGl2ZV9wKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkID0gbG9va3Vw X25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1w cmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAq aG9sbG93X2luYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19pbmFjdGl2ZV9m YWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAgICBnY192YWx1ZXMuZm9yZWdyb3VuZCA9IGhv bGxvd19pbmFjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICAg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gICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4 ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAo Y3Vyc29yX2dseXBoLT50eXBlID09IElNQUdFX0dMWVBIICYmIGxzbC5yZWQgPj0gMCAmJiBsc2wu Z3JlZW4gPj0gMCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIC8q IFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwnLiAg Ki8KKyAgICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gY29sb3Jf cGl4ZWw7CisgICAgICAgICAgICBtY193MzJfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBtYXRyaXgs IHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICAgICAgICBmLT5v dXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAg ICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAv KiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djJyBieSBi b3Jyb3dpbmcgdGhlCisgICAgICAgICAgICAgIGZ1bmN0aW9uYWxpdHkgb2YgYHhfbWFrZV9nYycg aW4gdzMyZm5zLmMuICAqLworICAgICAgICAgICAgICBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAg ICAgICAgICAgICAgICAmJiBhY3RpdmVfcAorICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2ds eXBoLT5jaGFycG9zID09IHJlZ2lvbl9iZWcpCisgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgZW51bS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gICAgICAgICAgZW51bSBm YWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2VuZF9mYWNlX2lkID0gbG9va3VwX25hbWVkX2Zh Y2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1hdC1yZWdpb24tcHJlLXp2LWZh Y2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0 aXZlX3JlZ2lvbl9lbmRfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2FjdGl2ZV9yZWdp b25fZW5kX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93 X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVh bC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAg c3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93 X2FjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91 bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgICAg IGdjX3ZhbHVlcy5iYWNrZ3JvdW5kID0gaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2UtPmJh Y2tncm91bmQ7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlm IChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9w CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3MgPiBy ZWdpb25fYmVnCisgICAgICAgICAg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cCkK KyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIGZh Y2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGlu dGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAg ICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZS T01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAg ICBnY192YWx1ZXMuZm9yZWdyb3VuZCA9IGhvbGxvd19hY3RpdmVfZmFjZS0+Zm9yZWdyb3VuZDsK KyAgICAgICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5iYWNrZ3JvdW5kID0gaG9sbG93X2Fj dGl2ZV9mYWNlLT5iYWNrZ3JvdW5kOworICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgICAgICAgICAgICBlbHNlIGlmICghYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfaW5hY3Rp dmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFr ZS1jdXJzb3ItaW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAg ICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9J RCAoZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICAgICAg ICBnY192YWx1ZXMuZm9yZWdyb3VuZCA9IGhvbGxvd19pbmFjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5k OworICAgICAgICAgICAgICAgICAgICAgICAgICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IGhvbGxv d19pbmFjdGl2ZV9mYWNlLT5iYWNrZ3JvdW5kOworICAgICAgICAgICAgICAgICAgICAgICAgfQor ICAgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYyA9IFhDcmVhdGVHQyAo TlVMTCwgRlJBTUVfVzMyX1dJTkRPVyAoZiksIG1hc2ssICZnY192YWx1ZXMpOworICAgICAgICAg ICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgLyogRm9yY2UgYG1jX3czMl9zZXRf Y3Vyc29yX2djJyB0byB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djJy4gICov CisgICAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX3AgPSB0cnVlOworICAgICAgICAgICAgICBt Y19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4LCBocG9z LCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNsLCBnbHlwaF9m bGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsIGN1cnNvcl9nY19wKTsKKyAgICAgICAg ICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MgPSBvcmlnaW5hbF9jdXJzb3JfZ2M7 CisgICAgICAgICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgICAgIG1jX3czMl9k cmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZw b3MsIHdkLCBoKTsKKyAgICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNl IE1DX0hPTExPV19CT1g6CisgICAgeworICAgICAgaWYgKGxzbC5y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B8IEdDQmFja2dyb3VuZDsKKyAgICAgICAgICBnY192YWx1ZXMuZm9u dCA9IEZSQU1FX0ZPTlQgKGYpOworICAgICAgICAgIGdjX3ZhbHVlcy5mb3JlZ3JvdW5kID0gRlJB TUVfQkFDS0dST1VORF9QSVhFTCAoZik7CisgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQg PSBjb2xvcl9waXhlbDsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYyA9 IFhDcmVhdGVHQyAoTlVMTCwgRlJBTUVfVzMyX1dJTkRPVyAoZiksIG1hc2ssICZnY192YWx1ZXMp OworICAgICAgICAgIC8qIEZvcmNlIGBtY193MzJfc2V0X2N1cnNvcl9nYycgdG8gdXNlIGBzLT5m LT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycuICAqLworICAgICAgICAgIGJvb2wgY3Vyc29y X2djX3AgPSB0cnVlOworICAgICAgICAgIG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgs IHJvdywgRFJBV19DVVJTT1IsIHgsIGhwb3MsIHZwb3MsIGxzbCwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9wLCBj dXJzb3JfZ2NfcCk7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MgPSBv cmlnaW5hbF9jdXJzb3JfZ2M7CisgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAg fQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2Nf cCA9IGZhbHNlOworICAgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwg cm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBsc2wsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfZ2NfcCk7CisgICAgICAg ICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfQkFSOgorICAgIHsKKyAgICAg IGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAg ICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEu dzMyLT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1 cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlz aWJsZV9va2F5X3AgPSB0cnVlOworICAgICAgICAgIG1jX3czMl9kcmF3X2Jhcl9jdXJzb3IgKHcs IG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl93aWR0aCwgTUNfQkFSLCBjdXJzb3JfZ2Nf aW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3Jf cGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQor ICAgICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3Ag PSBmYWxzZTsKKyAgICAgICAgICAgIG1jX3czMl9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwg cm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgaCwgY3Vyc29yX3dpZHRoLCBNQ19CQVIsIGN1cnNvcl9nY19pbnZpc2li bGVfb2theV9wKTsKKyAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBN Q19IQkFSOgorICAgIHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAg JiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhp amFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAgICAgICAgICBm LT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAg IGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSB0cnVlOworICAgICAgICAgIG1jX3cz Ml9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZw b3MsIHdkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl93aWR0 aCwgTUNfSEJBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIGYtPm91 dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAg ICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBib29sIGN1cnNv cl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7CisgICAgICAgICAgICBtY193MzJfZHJhd19i YXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl93aWR0aCwgTUNf SEJBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIH0KKyAgICAgIGJy ZWFrOworICAgIH0KKyAgICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7CisgIH0KKyAg ICB9Cit9CisKKy8qIERyYXcgZ2x5cGggc3RyaW5nIFMuICAqLworc3RhdGljIHZvaWQKK21jX3cz Ml9kcmF3X2dseXBoX3N0cmluZyAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgc3RydWN0IGdseXBo X21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAg ICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsLCBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3Is CisgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5 cGUsIGludCBjdXJzb3Jfd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgYWN0 aXZlX3AsIGJvb2wgY3Vyc29yX2djX3ApCit7CisgIGJvb2wgcmVsaWVmX2RyYXduX3AgPSAwOwor ICAvKiBJZiBTIGRyYXdzIGludG8gdGhlIGJhY2tncm91bmQgb2YgaXRzIHN1Y2Nlc3NvciwgZHJh dyB0aGUKKyAgICAgYmFja2dyb3VuZCBvZiB0aGUgc3VjY2Vzc29yIGZpcnN0IHNvIHRoYXQgUyBj YW4gZHJhdyBpbnRvIGl0LgorICAgICBUaGlzIG1ha2VzIFMtPm5leHQgdXNlIFhEcmF3U3RyaW5n IGluc3RlYWQgb2YgWERyYXdJbWFnZVN0cmluZy4gICovCisgIGlmIChzLT5uZXh0ICYmIHMtPnJp Z2h0X292ZXJoYW5nICYmICFzLT5mb3Jfb3ZlcmxhcHMpCisgICAgeworICAgICAgaW50IHdpZHRo OworICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAqbmV4dDsKKyAgICAgIGZvciAod2lkdGggPSAw LCBuZXh0ID0gcy0+bmV4dDsKKyAgICAgICAgICAgbmV4dCAmJiB3aWR0aCA8IHMtPnJpZ2h0X292 ZXJoYW5nOworICAgICAgICAgICB3aWR0aCArPSBuZXh0LT53aWR0aCwgbmV4dCA9IG5leHQtPm5l eHQpCisgICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSAhPSBJTUFHRV9HTFlQSCkK KyAgICAgICAgICB7CisgICAgICAgICAgICBtY193MzJfc2V0X2dseXBoX3N0cmluZ19nYyAobmV4 dCwgY3Vyc29yX2djX3ApOworICAgICAgICAgICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5n IChuZXh0KTsKKyAgICAgICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSA9PSBTVFJF VENIX0dMWVBIKQorICAgICAgICAgICAgICBtY193MzJfZHJhd19zdHJldGNoX2dseXBoX3N0cmlu ZyAobmV4dCk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHhfZHJhd19nbHlwaF9z dHJpbmdfYmFja2dyb3VuZCAobmV4dCwgdHJ1ZSk7CisgICAgICAgICAgICBuZXh0LT5udW1fY2xp cHMgPSAwOworICAgICAgICAgIH0KKyAgICB9CisgIC8qIFNldCB1cCBTLT5nYywgc2V0IGNsaXBw aW5nIGFuZCBkcmF3IFMuICAqLworICBtY193MzJfc2V0X2dseXBoX3N0cmluZ19nYyAocywgY3Vy c29yX2djX3ApOworICAvKiBEcmF3IHJlbGllZiAoaWYgYW55KSBpbiBhZHZhbmNlIGZvciBjaGFy L2NvbXBvc2l0aW9uIHNvIHRoYXQgdGhlCisgICAgIGdseXBoIHN0cmluZyBjYW4gYmUgZHJhd24g b3ZlciBpdC4gICovCisgIGlmICghcy0+Zm9yX292ZXJsYXBzCisgICAgICAmJiBzLT5mYWNlLT5i b3ggIT0gRkFDRV9OT19CT1gKKyAgICAgICYmIChzLT5maXJ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sK KyAgc3dpdGNoIChzLT5maXJzdF9nbHlwaC0+dHlwZSkKKyAgICB7CisgICAgY2FzZSBJTUFHRV9H TFlQSDoKKyAgICAgIHhfZHJhd19pbWFnZV9nbHlwaF9zdHJpbmcgKHMpOworICAgICAgYnJlYWs7 CisgICAgY2FzZSBTVFJFVENIX0dMWVBIOgorICAgICAgbWNfdzMyX2RyYXdfc3RyZXRjaF9nbHlw aF9zdHJpbmcgKHMpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBDSEFSX0dMWVBIOgorICAgICAg aWYgKHMtPmZvcl9vdmVybGFwcykKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRy dWU7CisgICAgICBlbHNlCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAo cywgZmFsc2UpOworICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAg ICAgIGJyZWFrOworICAgIGNhc2UgQ09NUE9TSVRFX0dMWVBIOgorICAgICAgaWYgKHMtPmZvcl9v dmVybGFwcyB8fCAocy0+Y21wX2Zyb20gPiAwCisgICAgICAgICAgJiYgISBzLT5maXJzdF9nbHlw aC0+dS5jbXAuYXV0b21hdGljKSkKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRy dWU7CisgICAgICBlbHNlCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAo cywgdHJ1ZSk7CisgICAgICB4X2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5k IChzKTsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgR0xZUEhMRVNTX0dMWVBIOgorICAgICAgaWYg KHMtPmZvcl9vdmVybGFwcykKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7 CisgICAgICBlbHNlCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywg ZmFsc2UpOworICAgICAgeF9kcmF3X2dseXBobGVzc19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAo cyk7CisgICAgICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7Cisg ICAgfQorICBpZiAoIXMtPmZvcl9vdmVybGFwcykKKyAgICB7CisgICAgICAvKiBEcmF3IHVuZGVy bGluZS4gICovCisgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3ApCisgICAgICAgIHsKKyAg ICAgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9XQVZFKQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICBDT0xPUlJFRiBjb2xvcjsKKyAgICAgICAgICAg ICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICBj b2xvciA9IHMtPmdjLT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAg ICAgICAgY29sb3IgPSBzLT5mYWNlLT51bmRlcmxpbmVfY29sb3I7CisgICAgICAgICAgICAgIHcz Ml9kcmF3X3VuZGVyd2F2ZSAocywgY29sb3IpOworICAgICAgICAgICAgfQorICAgICAgICAgIGVs c2UgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgdW5zaWduZWQgbG9uZyB0aGlja25lc3MsIHBvc2l0aW9u OworICAgICAgICAgICAgICBpbnQgeTsKKyAgICAgICAgICAgICAgaWYgKHMtPnByZXYgJiYgcy0+ cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3AKKyAgICAgICAgICAgICAgICAgICYmIHMtPnByZXYtPmZh Y2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAgICAgICAgICAgICB7 CisgICAgICAgICAgICAgICAgICAvKiBXZSB1c2UgdGhlIHNhbWUgdW5kZXJsaW5lIHN0eWxlIGFz IHRoZSBwcmV2aW91cyBvbmUuICAqLworICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+ cHJldi0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0g cy0+cHJldi0+dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIC8qIEdldCB0 aGUgdW5kZXJsaW5lIHRoaWNrbmVzcy4gIERlZmF1bHQgaXMgMSBwaXhlbC4gICovCisgICAgICAg ICAgICAgICAgICBpZiAocy0+Zm9udCAmJiBzLT5mb250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4g MCkKKyAgICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+Zm9udC0+dW5kZXJsaW5lX3Ro aWNrbmVzczsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgdGhp Y2tuZXNzID0gMTsKKyAgICAgICAgICAgICAgICAgIGlmICh4X3VuZGVybGluZV9hdF9kZXNjZW50 X2xpbmUpCisgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmhlaWdodCAtIHRoaWNr bmVzcykgLSAocy0+eWJhc2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJs aW5lIHBvc2l0aW9uLiAgVGhpcyBpcyB0aGUgcmVjb21tZW5kZWQKKyAgICAgICAgICAgICAgICAg ICAgICAgICB2ZXJ0aWNhbCBvZmZzZXQgaW4gcGl4ZWxzIGZyb20gdGhlIGJhc2VsaW5lIHRvIHRo ZSB0b3Agb2YKKyAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgdW5kZXJsaW5lLiAgVGhpcyBp cyBhIHNpZ25lZCB2YWx1ZSBhY2NvcmRpbmcgdG8gdGhlCisgICAgICAgICAgICAgICAgICAgICAg ICAgc3BlY3MsIGFuZCBpdHMgZGVmYXVsdCBpcworICAgICAgICAgICAgICAgICAgICAgICAgIFJP VU5EICgobWF4aW11bV9kZXNjZW50KSAvIDIpLCB3aXRoCisgICAgICAgICAgICAgICAgICAgICAg ICAgUk9VTkQgKHgpID0gZmxvb3IgKHggKyAwLjUpICAqLworICAgICAgICAgICAgICAgICAgICAg IGlmICh4X3VzZV91bmRlcmxpbmVfcG9zaXRpb25fcHJvcGVydGllcworICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBzLT5mb250ICYmIHMtPmZvbnQtPnVuZGVybGluZV9wb3NpdGlvbiA+PSAw KQorICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBzLT5mb250LT51bmRlcmxpbmVf cG9zaXRpb247CisgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAocy0+Zm9udCkKKyAgICAg ICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmZvbnQtPmRlc2NlbnQgKyAxKSAvIDI7 CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gbWF4 IChwb3NpdGlvbiwgdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0KTsKKyAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAgIC8qIENoZWNrIHRoZSBzYW5pdHkgb2YgdGhpY2tuZXNzIGFuZCBwb3Np dGlvbi4gIFdlIHNob3VsZAorICAgICAgICAgICAgICAgICBhdm9pZCBkcmF3aW5nIHVuZGVybGlu ZSBvdXQgb2YgdGhlIGN1cnJlbnQgbGluZSBhcmVhLiAgKi8KKyAgICAgICAgICAgICAgaWYgKHMt PnkgKyBzLT5oZWlnaHQgPD0gcy0+eWJhc2UgKyBwb3NpdGlvbikKKyAgICAgICAgICAgICAgICBw b3NpdGlvbiA9IChzLT5oZWlnaHQgLSAxKSAtIChzLT55YmFzZSAtIHMtPnkpOworICAgICAgICAg ICAgICBpZiAocy0+eSArIHMtPmhlaWdodCA8IHMtPnliYXNlICsgcG9zaXRpb24gKyB0aGlja25l c3MpCisgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gKHMtPnkgKyBzLT5oZWlnaHQpIC0gKHMt PnliYXNlICsgcG9zaXRpb24pOworICAgICAgICAgICAgICBzLT51bmRlcmxpbmVfdGhpY2tuZXNz ID0gdGhpY2tuZXNzOworICAgICAgICAgICAgICBzLT51bmRlcmxpbmVfcG9zaXRpb24gPXBvc2l0 aW9uOworICAgICAgICAgICAgICB5ID0gcy0+eWJhc2UgKyBwb3NpdGlvbjsKKyAgICAgICAgICAg ICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICB3 MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmdjLT5mb3JlZ3JvdW5kLCBzLT54LAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHksIHMtPndpZHRoLCAxKTsKKyAgICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+ ZmFjZS0+dW5kZXJsaW5lX2NvbG9yLCBzLT54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHksIHMtPndpZHRoLCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgLyog RHJhdyBvdmVybGluZS4gICovCisgICAgICBpZiAocy0+ZmFjZS0+b3ZlcmxpbmVfcCkKKyAgICAg ICAgeworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZHkgPSAwLCBoID0gMTsKKyAgICAgICAgICBp ZiAocy0+ZmFjZS0+b3ZlcmxpbmVfY29sb3JfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICB3MzJf ZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmdjLT5mb3JlZ3JvdW5kLCBzLT54LAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgcy0+eSArIGR5LCBzLT53aWR0aCwgaCk7CisgICAgICAgICAg ICBlbHNlCisgICAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+ZmFj ZS0+b3ZlcmxpbmVfY29sb3IsIHMtPngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMt PnkgKyBkeSwgcy0+d2lkdGgsIGgpOworICAgICAgICB9CisgICAgICAvKiBEcmF3IHN0cmlrZS10 aHJvdWdoLiAgKi8KKyAgICAgIGlmIChzLT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9wCisgICAgICAg ICAgJiYgIUZPTlRfVEVYVE1FVFJJQyAocy0+Zm9udCkudG1TdHJ1Y2tPdXQpCisgICAgICAgIHsK KyAgICAgICAgICB1bnNpZ25lZCBsb25nIGggPSAxOworICAgICAgICAgIHVuc2lnbmVkIGxvbmcg ZHkgPSAocy0+aGVpZ2h0IC0gaCkgLyAyOworICAgICAgICAgIGlmIChzLT5mYWNlLT5zdHJpa2Vf dGhyb3VnaF9jb2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMt PmYsIHMtPmhkYywgcy0+Z2MtPmZvcmVncm91bmQsIHMtPngsIHMtPnkgKyBkeSwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgIHMtPndpZHRoLCBoKTsKKyAgICAgICAgICBlbHNlCisgICAgICAg ICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmZhY2UtPnN0cmlrZV90aHJvdWdo X2NvbG9yLCBzLT54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+eSArIGR5LCBzLT53 aWR0aCwgaCk7CisgICAgICAgIH0KKyAgICAgIC8qIERyYXcgcmVsaWVmIGlmIG5vdCB5ZXQgZHJh d24uICAqLworICAgICAgaWYgKCFyZWxpZWZfZHJhd25fcCAmJiBzLT5mYWNlLT5ib3ggIT0gRkFD RV9OT19CT1gpCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYm94IChzKTsKKyAgICAgIGlm IChzLT5wcmV2KQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAqcHJl djsKKyAgICAgICAgICBmb3IgKHByZXYgPSBzLT5wcmV2OyBwcmV2OyBwcmV2ID0gcHJldi0+cHJl dikKKyAgICAgICAgICAgIGlmIChwcmV2LT5obCAhPSBzLT5obAorICAgICAgICAgICAgICAgICYm IHByZXYtPnggKyBwcmV2LT53aWR0aCArIHByZXYtPnJpZ2h0X292ZXJoYW5nID4gcy0+eCkKKyAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIEFzIHByZXYgd2FzIGRyYXduIHdoaWxl IGNsaXBwZWQgdG8gaXRzIG93biBhcmVhLCB3ZQorICAgICAgICAgICAgICAgICAgIG11c3QgZHJh dyB0aGUgcmlnaHRfb3ZlcmhhbmcgcGFydCB1c2luZyBzLT5obCBub3cuICAqLworICAgICAgICAg ICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBzYXZlID0gcHJldi0+aGw7CisgICAgICAgICAg ICAgICAgcHJldi0+aGwgPSBzLT5obDsKKyAgICAgICAgICAgICAgICBtY193MzJfc2V0X2dseXBo X3N0cmluZ19nYyAocHJldiwgY3Vyc29yX2djX3ApOworICAgICAgICAgICAgICAgIHhfc2V0X2ds eXBoX3N0cmluZ19jbGlwcGluZ19leGFjdGx5IChzLCBwcmV2KTsKKyAgICAgICAgICAgICAgICBp ZiAocHJldi0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSCkKKyAgICAgICAgICAgICAg ICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocHJldik7CisgICAgICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICAgICAgeF9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdf Zm9yZWdyb3VuZCAocHJldik7CisgICAgICAgICAgICAgICAgdzMyX3NldF9jbGlwX3JlY3Rhbmds ZSAocHJldi0+aGRjLCBOVUxMKTsKKyAgICAgICAgICAgICAgICBwcmV2LT5obCA9IHNhdmU7Cisg ICAgICAgICAgICAgICAgcHJldi0+bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICAgICAgfQorICAg ICAgICB9CisgICAgICBpZiAocy0+bmV4dCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBn bHlwaF9zdHJpbmcgKm5leHQ7CisgICAgICAgICAgZm9yIChuZXh0ID0gcy0+bmV4dDsgbmV4dDsg bmV4dCA9IG5leHQtPm5leHQpCisgICAgICAgICAgICBpZiAobmV4dC0+aGwgIT0gcy0+aGwKKyAg ICAgICAgICAgICAgICAmJiBuZXh0LT54IC0gbmV4dC0+bGVmdF9vdmVyaGFuZyA8IHMtPnggKyBz LT53aWR0aCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIEFzIG5leHQgd2ls bCBiZSBkcmF3biB3aGlsZSBjbGlwcGVkIHRvIGl0cyBvd24gYXJlYSwKKyAgICAgICAgICAgICAg ICAgICB3ZSBtdXN0IGRyYXcgdGhlIGxlZnRfb3ZlcmhhbmcgcGFydCB1c2luZyBzLT5obCBub3cu ICAqLworICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBzYXZlID0gbmV4dC0+ aGw7CisgICAgICAgICAgICAgICAgbmV4dC0+aGwgPSBzLT5obDsKKyAgICAgICAgICAgICAgICBt Y193MzJfc2V0X2dseXBoX3N0cmluZ19nYyAobmV4dCwgY3Vyc29yX2djX3ApOworICAgICAgICAg ICAgICAgIHhfc2V0X2dseXBoX3N0cmluZ19jbGlwcGluZ19leGFjdGx5IChzLCBuZXh0KTsKKyAg ICAgICAgICAgICAgICBpZiAobmV4dC0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSCkK KyAgICAgICAgICAgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAobmV4dCk7 CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgeF9kcmF3X2NvbXBvc2l0 ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAobmV4dCk7CisgICAgICAgICAgICAgICAgdzMyX3Nl dF9jbGlwX3JlY3RhbmdsZSAobmV4dC0+aGRjLCBOVUxMKTsKKyAgICAgICAgICAgICAgICBuZXh0 LT5obCA9IHNhdmU7CisgICAgICAgICAgICAgICAgbmV4dC0+bnVtX2NsaXBzID0gMDsKKyAgICAg ICAgICAgICAgICBuZXh0LT5jbGlwX2hlYWQgPSBzLT5uZXh0OworICAgICAgICAgICAgICB9Cisg ICAgICAgIH0KKyAgICB9CisgIC8qIFJlc2V0IGNsaXBwaW5nLiAgKi8KKyAgdzMyX3NldF9jbGlw X3JlY3RhbmdsZSAocy0+aGRjLCBOVUxMKTsKKyAgcy0+bnVtX2NsaXBzID0gMDsKK30KKworLyog ZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC8q IEZyaW5nZSBiaXRtYXBzLiAgKi8KIAogc3RhdGljIGludCBtYXhfZnJpbmdlX2JtcCA9IDA7CkBA IC01NDUsNiArMTQxNywxNSBAQCB4X3VwZGF0ZV9iZWdpbiAoc3RydWN0IGZyYW1lICpmKQogICBp ZiAoISBGUkFNRV9XMzJfUCAoZikpCiAgICAgcmV0dXJuOwogCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1l ID0gZjsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBSZWdlbmVyYXRlIGRp c3BsYXkgcGFsZXR0ZSBiZWZvcmUgZHJhd2luZyBpZiBsaXN0IG9mIHJlcXVlc3RlZAogICAgICBj b2xvcnMgaGFzIGNoYW5nZWQuICovCiAgIGlmIChkaXNwbGF5X2luZm8tPnJlZ2VuX3BhbGV0dGUp CkBAIC03NTQsNiArMTYzNSwxNiBAQCB4X3VwZGF0ZV9lbmQgKHN0cnVjdCBmcmFtZSAqZikKIAog ICAvKiBNb3VzZSBoaWdobGlnaHQgbWF5IGJlIGRpc3BsYXllZCBhZ2Fpbi4gICovCiAgIE1PVVNF X0hMX0lORk8gKGYpLT5tb3VzZV9mYWNlX2RlZmVyID0gZmFsc2U7CisKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdf ZnJhbWUgPSBOVUxMOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiB9CiAKIApAQCAt NDA0MSwxMyArNDkzMiw3NCBAQCB3MzJfc2V0X3ZlcnRpY2FsX3Njcm9sbF9iYXIgKHN0cnVjdCB3 aW5kb3cgKncsCiAJICAgICAgcmVsZWFzZV9mcmFtZV9kYyAoZiwgaGRjKTsKIAkgICAgICB4X2Ns ZWFyX3VuZGVyX2ludGVybmFsX2JvcmRlciAoZik7CiAJICAgIH0KKworCisvKiAqKioq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AgIGlmIChsZWZ0 IDw9IGJhci0+bGVmdCkKKyAgICAgICAgICAgIG15X3Nob3dfd2luZG93IChmLCBod25kLCBTV19I SURFKTsKKyAgICAgICAgICBNb3ZlV2luZG93IChod25kLCBsZWZ0LCB0b3AsIHdpZHRoLCBtYXgg KGhlaWdodCwgMSksIGxlZnQgPD0gYmFyLT5sZWZ0KTsKKworLyogZW5kIE1VTFRJUExFLUNVUlNP UlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCiAKIAkgIHNpLmNiU2l6ZSA9IHNpemVv ZiAoc2kpOwogCSAgc2kuZk1hc2sgPSBTSUZfUkFOR0U7CkBAIC00MzE2LDYgKzUyNjgsMjEgQEAg dzMyX2p1ZGdlX3Njcm9sbF9iYXJzIChzdHJ1Y3QgZnJhbWUgKmYpCiAgICAgewogICAgICAgc3Ry dWN0IHNjcm9sbF9iYXIgKmIgPSBYU0NST0xMX0JBUiAoYmFyKTsKIAorCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgLyogYERlc3Ryb3lX aW5kb3cnIHdpdGhpbiBgeF9zY3JvbGxfYmFyX3JlbW92ZScgcmVwYWludHMgdGhlIHJlY3Rhbmds ZS4KKyAgICAgIFRoZXJlZm9yZSwgd2UgZmlyc3Qgc2VuZCBhIG1lc3NhZ2UgdG8gaW5oaWJpdCBy ZXBhaW50aW5nLiAqLworICAgICAgaWYgKCFXSU5ET1dfTElWRV9QIChiLT53aW5kb3cpKQorICAg ICAgICB7CisgICAgICAgICAgSFdORCBod25kID0gU0NST0xMX0JBUl9XMzJfV0lORE9XIChiKTsK KyAgICAgICAgICBTZW5kTWVzc2FnZSAoaHduZCwgV01fU0VUUkVEUkFXLCBmYWxzZSwgMCk7Cisg ICAgICAgIH0KKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgeF9zY3JvbGxf YmFyX3JlbW92ZSAoYik7CiAKICAgICAgIG5leHQgPSBiLT5uZXh0OwpAQCAtNzA5MSw2ICs4MDU4 LDIwIEBAIGV4dGVybiBmcmFtZV9wYXJtX2hhbmRsZXIgdzMyX2ZyYW1lX3Bhcm1faGFuZGxlcnNb XTsKIAogc3RhdGljIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlIHczMl9yZWRpc3BsYXlfaW50 ZXJmYWNlID0KIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKworLyogYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGB3MzJ0ZXJtLmNgIG11c3Qg YmUgaW4gdGhlIGV4YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitgcmVkaXNwbGF5X2ludGVyZmFjZScg aW4gYGRpc3BleHRlcm4uaGAhICovCisKKyAgbWNfdzMyX2RyYXdfd2luZG93X2N1cnNvciwKKyAg bWNfdzMyX2RyYXdfZ2x5cGhfc3RyaW5nLAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAgIHczMl9mcmFtZV9wYXJtX2hhbmRsZXJzLAogICB4X3Byb2R1Y2VfZ2x5cGhzLAogICB4X3dy aXRlX2dseXBocywKZGlmZiAtLWdpdCBhL3NyYy93aW5kb3cuaCBiL3NyYy93aW5kb3cuaAppbmRl eCBmZGVmNDA3Li4yYjBiOWI0IDEwMDY0NAotLS0gYS9zcmMvd2luZG93LmgKKysrIGIvc3JjL3dp bmRvdy5oCkBAIC0zMjQsNiArMzI0LDE0NyBAQCBzdHJ1Y3Qgd2luZG93CiAKICNpZmRlZiBIQVZF X1dJTkRPV19TWVNURU0KIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1V TFRJUExFLUNVUlNPUlMgKi8KKworLyogU3VmZml4ZXMgZm9yIHRoZSBgbWNgIHdpbmRvdyBwb2lu dGVyIHByZWZpeC4gKi8KK3N0cnVjdCBtdWx0aXBsZV9jdXJzb3JzCit7CisgIC8qIFRoZSByZWNv cmRlZCBwaXhlbCB3aWR0aCBvZiB0aGUgbGFzdCBsaW5lIG51bWJlciBkcmF3biBkdXJpbmcgcmVk aXNwbGF5ICovCisgIGludCBsbnVtX3BpeGVsX3dpZHRoOworfSBtYzsKKworc3RydWN0IG1jX21h dHJpeAoreworICBwdHJkaWZmX3QgdnBvc19hbGxvY2F0ZWQ7CisgIHB0cmRpZmZfdCB2cG9zX3Vz ZWQ7CisgIHB0cmRpZmZfdCBjdXJzb3JzX3VzZWRbNF07CisgIGVudW0gbWNfY2FjaGVfdHlwZQor ICB7CisgICAgTUNfQ0FDSEUsCisgICAgQ0hfQ0FDSEUsCisgICAgRkNfQ0FDSEUsCisgICAgTk9f Q0FDSEUKKyAgfSBjYWNoZV90eXBlOworICBzdHJ1Y3QgbWNfdnBvcworICB7CisgICAgcHRyZGlm Zl90IGNhY2hlX2FsbG9jYXRlZFs0XTsKKyAgICBwdHJkaWZmX3QgY2FjaGVfdXNlZFs0XTsKKyAg ICBzdHJ1Y3QgbWNfY29udGVudHMKKyAgICB7CisgICAgICBib29sX2JmIHNhbWVfcCA6IDE7Cisg ICAgICBzdHJ1Y3QgZ2x5cGggZ2x5cGg7CisgICAgICBpbnQgeDsKKyAgICAgIGludCBmeDsKKyAg ICAgIGludCB5OworICAgICAgaW50IGZ5OworICAgICAgaW50IGhwb3M7CisgICAgICBpbnQgdnBv czsKKyAgICAgIGludCB3ZDsKKyAgICAgIGludCBoOworICAgICAgZW51bSBtY19jdXJzb3JfdHlw ZQorICAgICAgeworICAgICAgICAvKiBOT1RFOiAgVGhlIGZyaW5nZSBiaXRtYXAgZnJhbWV3b3Jr IHJlbGllcyB1cG9uIE1DX05PX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgaGF2aW5nIGEgdmFsdWUg b2YgemVybyAoMCkuICovCisgICAgICAgIE1DX05PX0ZSSU5HRV9CSVRNQVAsCisgICAgICAgIE1D X05PX0NVUlNPUiwKKyAgICAgICAgTUNfUklHSFRfRlJJTkdFX0JJVE1BUCwKKyAgICAgICAgTUNf TEVGVF9GUklOR0VfQklUTUFQLAorICAgICAgICBNQ19GUkFNRURfQk9YLAorICAgICAgICBNQ19G SUxMRURfQk9YLAorICAgICAgICBNQ19IT0xMT1dfQk9YLAorICAgICAgICBNQ19CQVIsCisgICAg ICAgIE1DX0hCQVIKKyAgICAgIH0gY3Vyc29yX3R5cGU7CisgICAgICBpbnQgY3Vyc29yX3dpZHRo OworICAgICAgc3RydWN0IG1jX1JHQgorICAgICAgeworICAgICAgICBkb3VibGUgcmVkOworICAg ICAgICBkb3VibGUgZ3JlZW47CisgICAgICAgIGRvdWJsZSBibHVlOworICAgICAgfSBmZywgYmc7 CisgICAgICBib29sX2JmIGFjdGl2ZV9wIDogMTsKKyAgICAgIGVudW0gbWNfZmxhdm9yCisgICAg ICB7CisgICAgICAgIE5PX0ZMQVZPUiwKKyAgICAgICAgTUNfR0xZUEgsCisgICAgICAgIE1DX0dM WVBITEVTUywKKyAgICAgICAgTUNfT1ZFUkxBWV9BUlJPV19CSVRNQVAsCisgICAgICAgIE1DX1BJ TENST1csCisgICAgICAgIE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1csCisgICAgICAg IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1csCisgICAgICAgIE1DX0hP TExPV19SRUNUQU5HTEUsCisgICAgICAgIE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVywKKyAg ICAgICAgTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XLAorICAgICAgICBNQ19W RVJUSUNBTF9CQVIsCisgICAgICAgIE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUiwKKyAgICAgICAg TUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgfSBnbHlwaF9mbGF2b3I7CisgICAgICBi b29sX2JmIGVuYWJsZWRfcCA6IDE7CisgICAgfSAqY2FjaGVbNF07CisgIH0gKnZwb3M7CisgIC8q IFVzZWQgZWxzZXdoZXJlLiAqLworICBzdHJ1Y3QgbWNfZXNzZW50aWFscworICB7CisgICAgZW51 bSBtY19yb3dfcG9zaXRpb24KKyAgICB7CisgICAgICBQUkVfWlYsCisgICAgICBBVF9aViwKKyAg ICAgIFBPU1RfWlYKKyAgICB9IHJvd19wb3NpdGlvbjsKKyAgICBib29sX2JmIGFjdGl2ZV9wIDog MTsKKyAgICBzdHJ1Y3QgbWNfUkdCIGNoX2ZnWzNdLCBmY19mZ1szXSwgc3BfZmc7CisgICAgaW50 IGZjX3g7CisgICAgaW50IHp2OworICAgIGludCB6dl9ieXRlOworICB9IGVzc2VudGlhbHM7Cisg IC8qIFVzZWQgZWxzZXdoZXJlLiAqLworICBlbnVtIG1jX2VuZ2luZV90eXBlCisgIHsKKyAgICBN VUxUSVBMRV9DVVJTT1JTLAorICAgIEhPUklaT05UQUxfUlVMRVIsCisgICAgVkVSVElDQUxfUlVM RVIsCisgICAgRklMTF9DT0xVTU4sCisgICAgQ1VSU09SX0lORElDQVRPUgorICB9IGFjdGlvbl90 eXBlOworICAvKiBVc2VkIGVsc2V3aGVyZS4gKi8KKyAgZW51bSBtY19wcmVfc2Nyb2xsX2NsZWFu X3R5cGUKKyAgeworICAgIFRSWV9XSU5ET1dfUkVVU0lOR19DVVJSRU5UX01BVFJJWF9ET1dOLAor ICAgIFRSWV9XSU5ET1dfUkVVU0lOR19DVVJSRU5UX01BVFJJWF9VUCwKKyAgICBUUllfV0lORE9X X0lECisgIH0gbWNfcHJlX3Njcm9sbF9jbGVhbl90eXBlX19mcm9tX3doZXJlOworICAvKiBVc2Vk IGVsc2V3aGVyZS4gKi8KKyAgZW51bSBtY19kcmF3X3Jvd190eXBlCisgIHsKKyAgICBOT1dIRVJF LAorICAgIFNDUklCRV9PTkUsCisgICAgU0NSSUJFX1RXTywKKyAgICBTQ1JJQkVfVEhSRUUsCisg ICAgU0tJUFBFRCwKKyAgICBQT1NUX0NIQU5HRUQsCisgICAgVU5DSEFOR0VELAorICAgIFNFVF9D VVJTT1JfT05FLAorICAgIFNFVF9DVVJTT1JfVFdPCisgIH0gbWNfZHJhd19yb3dfdHlwZV9fZnJv bV93aGVyZTsKKyAgLyogVXNlZCBlbHNld2hlcmUuICovCisgIGVudW0gbWNfcmVkcmF3X3Jvd190 eXBlCisgIHsKKyAgICBVUERBVEVfV0lORE9XX19SRURSQVdfT1ZFUkxBUFBFRF9ST1dTLAorICAg IFhfSU5TRVJUX0dMWVBIUywKKyAgICBYX0ZJWF9PVkVSTEFQUElOR19BUkVBLAorICAgIERSQVdf Uk9XX1dJVEhfTU9VU0VfRkFDRSwKKyAgICBFWFBPU0VfQVJFQV9PTkUsCisgICAgRVhQT1NFX0FS RUFfVFdPLAorICAgIEVYUE9TRV9MSU5FCisgIH0gbWNfcmVkcmF3X3Jvd190eXBlX19mcm9tX3do ZXJlOworfSBtY19tYXRyaXg7CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKworCiAgICAgLyogQ3Vyc29yIHR5cGUgb2YgbGFzdCBjdXJzb3Ig ZHJhd24gb24gdGhlIHdpb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CByZXNldCAtLWhh cmQgYTAzOGRmNzdkZTdiMWFhMmQ3M2E2NDc4NDkzYjg4MzhiNTllNDk4MgorCitTdGVwIDM6ICBG cm9tIHdpdGhpbiB0aGUgbmV3IGVtYWNzIGZvbGRlciBjcmVhdGVkIGluIFN0ZXAgMSwgYXBwbHkg dGhlIHBhdGNoOgorCitnaXQgYXBwbHkgL3BhdGgvdG8vdGhlL3BhdGNoLmRpZmYKKworU3RlcCA0 OiAgLi9hdXRvZ2VuLnNoCisKK1N0ZXAgNTogIC4vY29uZmlndXJlIC4uLiBbeW91ciBjdXN0b20g b3B0aW9uc10KKworU3RlcCA2OiAgbWFrZQorCitTdGVwIDc6ICBtYWtlIGluc3RhbGwKKworCitV U0FHRToKKworLSBGb3IgYSBtaW5pbWFsIHdvcmtpbmcgZXhhbXBsZSBvZiBidWlsdC1pbiBmYWtl IGN1cnNvcnMsIHR5cGU6ICBNLXggbWMtdGVzdAorCisgIDs7OyBUVVJOIE9OIEZBS0UgQ1VSU09S UyAoYnVmZmVyIHBvc2l0aW9uLCBjdXJzb3ItdHlwZSwgY3Vyc29yIGNvbG9yKToKKworICAoc2V0 cSBtYy1jb25mICcoKDEgImhiYXIiICJtYWdlbnRhIikKKyAgICAgICAgICAgICAgICAgICgyICJi YXIiICJwdXJwbGUiKQorICAgICAgICAgICAgICAgICAgKDMgImJveCIgIiMwMEZGMDAiKQorICAg ICAgICAgICAgICAgICAgKDQgImhvbGxvdyIgIiMwMDAwRkYiKQorICAgICAgICAgICAgICAgICAg KDUgKCJoYmFyIiAzKSBbMS4wIDAuMCAxLjBdKQorICAgICAgICAgICAgICAgICAgKDYgKCJiYXIi IDMpIFswLjAgMS4wIDEuMF0pCisgICAgICAgICAgICAgICAgICAoNyAiZnJhbWVkIiAiT3Jhbmdl UmVkIikpKSkKKworICA7OzsgVFVSTiBPRkYgRkFLRSBDVVJTT1JTOgorCisgIChzZXRxIG1jLWNv bmYgbmlsKQorCistIFRvIHRyeSBvdXQgYm90a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gICAgTGlzcF9PYmplY3QgZWxlbSA9IEZjb25zICh2YV9h cmcgKGFwLCBMaXNwX09iamVjdCksIFFuaWwpOworICAgICAgWFNFVENEUiAodGFpbCwgZWxlbSk7 CisgICAgICB0YWlsID0gZWxlbTsKKyAgICB9CisgIHZhX2VuZCAoYXApOworICByZXR1cm4gdmFs OworfQorCitMaXNwX09iamVjdAorbWNfbWVtcSAoTGlzcF9PYmplY3QgZWx0LCBMaXNwX09iamVj dCBsaXN0KQoreworICB3aGlsZSAoMSkKKyAgICB7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KSB8 fCBFUSAoWENBUiAobGlzdCksIGVsdCkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhD RFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkgfHwgRVEgKFhDQVIgKGxpc3QpLCBl bHQpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlm ICghQ09OU1AgKGxpc3QpIHx8IEVRIChYQ0FSIChsaXN0KSwgZWx0KSkKKyAgICAgICAgYnJlYWs7 CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgfQorICByZXR1cm4gbGlzdDsKK30KKwor TGlzcF9PYmplY3QKK21jX250aCAoaW50IG51bSwgTGlzcF9PYmplY3QgbGlzdCkKK3sKKyAgZm9y IChpbnQgaSA9IDA7IGkgPCBudW0gJiYgIU5JTFAgKGxpc3QpOyBpKyspCisgICAgbGlzdCA9IFhD RFIgKGxpc3QpOworICBpZiAoQ09OU1AgKGxpc3QpKQorICAgIHJldHVybiBYQ0FSIChsaXN0KTsK KyAgICBlbHNlCisgICAgICByZXR1cm4gUW5pbDsKK30KKworTGlzcF9PYmplY3QKK21jX2Fzc3Eg KExpc3BfT2JqZWN0IGtleSwgTGlzcF9PYmplY3QgbGlzdCkKK3sKKyAgd2hpbGUgKDEpCisgICAg eworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxp c3QpKQorICAgICAgICAgICAgICAmJiBFUSAoWENBUiAoWENBUiAobGlzdCkpLCBrZXkpKSkKKyAg ICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNPTlNQ IChsaXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAg ICYmIEVRIChYQ0FSIChYQ0FSIChsaXN0KSksIGtleSkpKQorICAgICAgICBicmVhazsKKyAgICAg IGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAg fHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgRVEgKFhDQVIgKFhDQVIg KGxpc3QpKSwga2V5KSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3Qp OworICAgIH0KKyAgaWYgKENPTlNQIChsaXN0KSkKKyAgICByZXR1cm4gWENBUiAobGlzdCk7Cisg ICAgZWxzZQorICAgICAgcmV0dXJuIFFuaWw7Cit9CisKK0xpc3BfT2JqZWN0CittY19hc3NvYyAo TGlzcF9PYmplY3Qga2V5LCBMaXNwX09iamVjdCBsaXN0KQoreworICBMaXNwX09iamVjdCBjYXI7 CisgIHdoaWxlICgxKQorICAgIHsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAg fHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgKGNhciA9IFhDQVIgKFhD QVIgKGxpc3QpKSwKKyAgICAgICAgICAgICAgICAgIEVRIChjYXIsIGtleSkgfHwgIU5JTFAgKEZl cXVhbCAoY2FyLCBrZXkpKSkpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChs aXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3Qp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gICBoYWxmdGFpbCA9IFhDRFIgKGhhbGZ0YWlsKTsKKyAgICAgIGlmIChFUSAodGFp bCwgaGFsZnRhaWwpKQorICAgICAgICBicmVhazsKKyAgICB9CisgIHJldHVybiBRbmlsOworfQor CisvKiBSRUdJT04gQkVHSU46ICBtY19yZWdpb25fbGltaXQgKDEpCisgICBSRUdJT04gRU5EOiAg bWNfcmVnaW9uX2xpbWl0ICgwKSAqLworcHRyZGlmZl90CittY19yZWdpb25fbGltaXQgKGJvb2wg YmVnaW5fcCkKK3sKKyAgaWYgKCFOSUxQIChWdHJhbnNpZW50X21hcmtfbW9kZSkKKyAgICAgICYm IE5JTFAgKFZtYXJrX2V2ZW5faWZfaW5hY3RpdmUpCisgICAgICAmJiBOSUxQIChCVkFSIChjdXJy ZW50X2J1ZmZlciwgbWFya19hY3RpdmUpKSkKKyAgICB4c2lnbmFsMCAoUW1hcmtfaW5hY3RpdmUp OworICBMaXNwX09iamVjdCBtYXJrZXIgPSBCVkFSIChjdXJyZW50X2J1ZmZlciwgbWFyayk7Cisg IGludCBtID0gKFhNQVJLRVIgKG1hcmtlciktPmJ1ZmZlcikKKyAgICAgICAgICA/IFhNQVJLRVIg KG1hcmtlciktPmNoYXJwb3MKKyAgICAgICAgICA6IC0xOworICByZXR1cm4gKG0gPT0gLTEpCisg ICAgICAgICAgID8gLTEKKyAgICAgICAgIDogKFBUIDwgbSkgPT0gYmVnaW5fcAorICAgICAgICAg ICA/IFBUCisgICAgICAgICA6IGNsaXBfdG9fYm91bmRzIChCRUdWLCBtLCBaVik7Cit9CisKKy8q IENoZWNrIHRoZSBwcmVzZW5jZSBvZiBhIGRpc3BsYXkgcHJvcGVydHkgYW5kIGNvbXB1dGUgaXRz IHdpZHRoLgorICAgSWYgYSBwcm9wZXJ0eSB3YXMgZm91bmQgYW5kIGl0cyB3aWR0aCB3YXMgZm91 bmQgYXMgd2VsbCwgcmV0dXJuCisgICBpdHMgd2lkdGggKD49IDApIGFuZCBzZXQgdGhlIHBvc2l0 aW9uIG9mIHRoZSBlbmQgb2YgdGhlIHByb3BlcnR5CisgICBpbiBFTkRQT1MuCisgICBPdGhlcndp c2UganVzdCByZXR1cm4gLTEuICovCitzdGF0aWMgaW50CittY19jaGVja19kaXNwbGF5X3dpZHRo IChwdHJkaWZmX3QgcG9zLCBwdHJkaWZmX3QgY29sLCBwdHJkaWZmX3QgKmVuZHBvcykKK3sKKyAg TGlzcF9PYmplY3QgdmFsLCBvdmVybGF5OworICBpZiAoQ09OU1AgKHZhbCA9IGdldF9jaGFyX3By b3BlcnR5X2FuZF9vdmVybGF5CisgICAgICAgICAgICAgIChtYWtlX2ZpeG51bSAocG9zKSwgUWRp c3BsYXksIFFuaWwsICZvdmVybGF5KSkKKyAgICAgICYmIEVRIChRc3BhY2UsIFhDQVIgKHZhbCkp KQorICAgIHsgLyogRklYTUU6IFVzZSBjYWxjX3BpeGVsX3dpZHRoX29yX2hlaWdodC4gKi8KKyAg ICAgIExpc3BfT2JqZWN0IHBsaXN0ID0gWENEUiAodmFsKSwgcHJvcDsKKyAgICAgIGludCB3aWR0 aCA9IC0xOworICAgICAgRU1BQ1NfSU5UIGFsaWduX3RvX21heCA9IChjb2wgPCBNT1NUX1BPU0lU SVZFX0ZJWE5VTSAtIElOVF9NQVgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g KEVNQUNTX0lOVCkgSU5UX01BWCArIGNvbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBNT1NUX1BPU0lUSVZFX0ZJWE5VTSk7CisgICAgICBpZiAoKHByb3AgPSBtY19wbGlzdF9n ZXQgKHBsaXN0LCBRQ3dpZHRoKSwgUkFOR0VEX0ZJWE5VTVAgKDAsIHByb3AsIElOVF9NQVgpKQor ICAgICAgICAgIHx8IChwcm9wID0gbWNfcGxpc3RfZ2V0IChwbGlzdCwgUUNyZWxhdGl2ZV93aWR0 aCksCisgICAgICAgICAgICAgIFJBTkdFRF9GSVhOVU1QICgwLCBwcm9wLCBJTlRfTUFYKSkpCisg ICAgICAgIHdpZHRoID0gWEZJWE5VTSAocHJvcCk7CisgICAgICAgIGVsc2UgaWYgKEZMT0FUUCAo cHJvcCkgJiYgMCA8PSBYRkxPQVRfREFUQSAocHJvcCkKKyAgICAgICAgICAgICAgICAgJiYgWEZM T0FUX0RBVEEgKHByb3ApIDw9IElOVF9NQVgpCisgICAgICAgICAgd2lkdGggPSAoaW50KShYRkxP QVRfREFUQSAocHJvcCkgKyAwLjUpOworICAgICAgICAgIGVsc2UgaWYgKChwcm9wID0gbWNfcGxp c3RfZ2V0IChwbGlzdCwgUUNhbGlnbl90byksCisgICAgICAgICAgICAgICAgICAgIFJBTkdFRF9G SVhOVU1QIChjb2wsIHByb3AsIGFsaWduX3RvX21heCkpKQorICAgICAgICAgICAgd2lkdGggPSBY RklYTlVNIChwcm9wKSAtIGNvbDsKKyAgICAgICAgICAgICAgZWxzZSBpZiAoRkxPQVRQIChwcm9w KSAmJiBjb2wgPD0gWEZMT0FUX0RBVEEgKHByb3ApCisgICAgICAgICAgICAgICAgICAgICAgICYm IChYRkxPQVRfREFUQSAocHJvcCkgPD0gYWxpZ25fdG9fbWF4KSkKKyAgICAgICAgICAgICAgICB3 aWR0aCA9IChpbnQpKFhGTE9BVF9EQVRBIChwcm9wKSArIDAuNSkgLSBjb2w7CisgICAgICBpZiAo d2lkdGggPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIHB0cmRpZmZfdCBzdGFydDsKKyAgICAg ICAgICBpZiAoT1ZFUkxBWVAgKG92ZXJsYXkpKQorICAgICAgICAgICAgKmVuZHBvcyA9IE9WRVJM QVlfUE9TSVRJT04gKE9WRVJMQVlfRU5EIChvdmVybGF5KSk7CisgICAgICAgICAgICBlbHNlCisg ICAgICAgICAgICAgIGdldF9wcm9wZXJ0eV9hbmRfcmFuZ2UgKHBvcywgUWRpc3BsYXksICZ2YWws ICZzdGFydCwgZW5kcG9zLCBRbmlsKTsKKyAgICAgICAgICAvKi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oc2NhbiwgJm5leHRfYm91 bmRhcnksIGVuZCwgUW5pbCk7CisgICAgICAgICAgaWYgKHNjYW4gIT0gb2xkX3NjYW4pCisgICAg ICAgICAgICBzY2FuX2J5dGUgPSBDSEFSX1RPX0JZVEUgKHNjYW4pOworICAgICAgICAgIGlmIChz Y2FuID49IGVuZCkKKyAgICAgICAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgfQorICAgICAg LyogVGVzdCByZWFjaGluZyB0aGUgZ29hbCBjb2x1bW4uICBXZSBkbyB0aGlzIGFmdGVyIHNraXBw aW5nCisgICBpbnZpc2libGUgY2hhcmFjdGVycywgc28gdGhhdCB3ZSBwdXQgcG9pbnQgYmVmb3Jl IHRoZQorICAgY2hhcmFjdGVyIG9uIHdoaWNoIHRoZSBjdXJzb3Igd2lsbCBhcHBlYXIuICovCisg ICAgICBpZiAoY29sID49IGdvYWwpCisgICAgICAgIGJyZWFrOworICAgICAgcHJldl9jb2wgPSBj b2w7CisgICAgICB7IC8qIENoZWNrIGRpc3BsYXkgcHJvcGVydHkuICovCisgICAgICAgIHB0cmRp ZmZfdCBlbmRwOworICAgICAgICBpbnQgd2lkdGggPSBtY19jaGVja19kaXNwbGF5X3dpZHRoIChz Y2FuLCBjb2wsICZlbmRwKTsKKyAgICAgICAgaWYgKHdpZHRoID49IDApCisgICAgICAgICAgewor ICAgICAgICAgICAgY29sICs9IHdpZHRoOworICAgICAgICAgICAgaWYgKGVuZHAgPiBzY2FuKSAv KiBBdm9pZCBpbmZpbml0ZSBsb29wcyB3aXRoIDAtd2lkdGggb3ZlcmxheXMuICovCisgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICBzY2FuID0gZW5kcDsKKyAgICAgICAgICAgICAgICBz Y2FuX2J5dGUgPSBDSEFSX1RPX0JZVEUgKHNjYW4pOworICAgICAgICAgICAgICAgIGNvbnRpbnVl OworICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgfQorICAgICAgLyogQ2hlY2sg Y29tcG9zaXRpb24gc2VxdWVuY2UuICovCisgICAgICBpZiAoY21wX2l0LmlkID49IDAKKyAgICAg ICAgICB8fCAoc2NhbiA9PSBjbXBfaXQuc3RvcF9wb3MKKyAgICAgICAgICAgICAgJiYgY29tcG9z aXRpb25fcmVzZWF0X2l0ICgmY21wX2l0LCBzY2FuLCBzY2FuX2J5dGUsIGVuZCwgdywgTlVMTCwg UW5pbCkpKQorICAgICAgICBjb21wb3NpdGlvbl91cGRhdGVfaXQgKCZjbXBfaXQsIHNjYW4sIHNj YW5fYnl0ZSwgUW5pbCk7CisgICAgICBpZiAoY21wX2l0LmlkID49IDApCisgICAgICAgIHsKKyAg ICAgICAgICBzY2FuICs9IGNtcF9pdC5uY2hhcnM7CisgICAgICAgICAgc2Nhbl9ieXRlICs9IGNt cF9pdC5uYnl0ZXM7CisgICAgICAgICAgaWYgKHNjYW4gPD0gZW5kKQorICAgICAgICAgICAgY29s ICs9IGNtcF9pdC53aWR0aDsKKyAgICAgICAgICBpZiAoY21wX2l0LnRvID09IGNtcF9pdC5uZ2x5 cGhzKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBjbXBfaXQuaWQgPSAtMTsKKyAgICAg ICAgICAgICAgY29tcG9zaXRpb25fY29tcHV0ZV9zdG9wX3BvcyAoJmNtcF9pdCwgc2Nhbiwgc2Nh bl9ieXRlLCBlbmQsIFFuaWwpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICBjbXBfaXQuZnJvbSA9IGNtcF9pdC50bzsKKyAgICAgICAgICBjb250aW51ZTsK KyAgICAgICAgfQorICAgICAgYyA9IEZFVENIX0JZVEUgKHNjYW5fYnl0ZSk7CisgICAgICAvKiBT ZWUgaWYgdGhlcmUgaXMgYSBkaXNwbGF5IHRhYmxlIGFuZCBpdCByZWxhdGVzIHRvIHRoaXMgY2hh cmFjdGVyLiAqLworICAgICAgaWYgKGRwICE9IDAKKyAgICAgICAgICAmJiAhIChtdWx0aWJ5dGUg JiYgTEVBRElOR19DT0RFX1AgKGMpKQorICAgICAgICAgICYmIFZFQ1RPUlAgKERJU1BfQ0hBUl9W RUNUT1IgKGRwLCBjKSkpCisgICAgICAgIHsKKyAgICAgICAgICBMaXNwX09iamVjdCBjaGFydmVj OworICAgICAgICAgIHB0cmRpZmZfdCBpLCBuOworICAgICAgICAgIC8qIFRoaXMgY2hhcmFjdGVy IGlzIGRpc3BsYXllZCB1c2luZyBhIHZlY3RvciBvZiBnbHlwaHMuCisgICAgICAgICAgICAgVXBk YXRlIHRoZSBjb2x1bW4vcG9zaXRpb24gYmFzZWQgb24gdGhvc2UgZ2x5cGhzLiAqLworICAgICAg ICAgIGNoYXJ2ZWMgPSBESVNQX0NIQVJfVkVDVE9SIChkcCwgYyk7CisgICAgICAgICAgbiA9IEFT SVpFIChjaGFydmVjKTsKKyAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgbjsgaSsrKQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICAvKiBUaGlzIHNob3VsZCBiZSBoYW5kbGVkIHRoZSBzYW1l IGFzCisgICAgICAgICAgICAgIG5leHRfZWxlbWVudF9mcm9tX2Rpc3BsYXlfdmVjdG9yIGRvZXMg aXQuICovCisgICAgICAgICAgICAgIExpc3BfT2JqZWN0IGVudHJ5ID0gQVJFRiAoY2hhcnZlYywg aSk7CisgICAgICAgICAgICAgIGlmIChHTFlQSF9DT0RFX1AgKGVudHJ5KSkKKyAgICAgICAgICAg ICAgICBjID0gR0xZUEhfQ09ERV9DSEFSIChlbnRyeSk7CisgICAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgICBjID0gJyAnOworICAgICAgICAgICAgICBpZiAoYyA9PSAnXG4nKQorICAg ICAgICAgICAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgICAgICAgaWYgKGMgPT0gJ1xyJyAm JiBFUSAoQlZBUiAoY3VycmVudF9idWZmZXIsIHNlbGVjdGl2ZV9kaXNwbGF5KSwgUXQpKQorICAg ICAgICAgICAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgICAgICAgaWYgKGMgPT0gJ1x0JykK KyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBjb2wgKz0gdGFiX3dpZHRoOwor ICAgICAgICAgICAgICAgICAgY29sID0gY29sIC8gdGFiX3dpZHRoICogdGFiX3dpZHRoOworICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAr K2NvbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAg eworICAgICAgICAgICAgLyogVGhlIGRpc3BsYXkgdGFibGUgZG9lc24ndCBhZmZlY3QgdGhpcyBj aGFyYWN0ZXI7CisgICAgICAgICAgICAgICBpdCBkaXNwbGF5cyBhcyBpdHNlbGYuICovCisgICAg ICAgICAgICBpZiAoYyA9PSAnXG4nKQorICAgICAgICAgICAgICBnb3RvIGVuZGxvb3A7CisgICAg ICAgICAgICBpZiAoYyA9PSAnXHInICYmIEVRIChCVkFSIChjdXJyZW50X2J1ZmZlciwgc2VsZWN0 aXZlX2Rpc3BsYXkpLCBRdCkpCisgICAgICAgICAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAg ICAgIGlmIChjID09ICdcdCcpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjb2wg Kz0gdGFiX3dpZHRoOworICAgICAgICAgICAgICAgIGNvbCA9IGNvbCAvIHRhYl93aWR0aCAqIHRh Yl93aWR0aDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlIGlmIChtdWx0aWJ5 dGUgJiYgTEVBRElOR19DT0RFX1AgKGMpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICAgIC8qIFN0YXJ0IG9mIG11bHRpLWJ5dGUgZm9ybS4gKi8KKyAgICAgICAgICAgICAgICAg IHVuc2lnbmVkIGNoYXIgKnB0cjsKKyAgICAgICAgICAgICAgICAgIGludCBieXRlcywgd2lkdGg7 CisgICAgICAgICAgICAgICAgICBwdHIgPSBCWVRFX1BPU19BRERSIChzY2FuX2J5dGUpOworICAg ICAgICAgICAgICAgICAgTUNfTVVMVElCWVRFX0JZVEVTX1dJRFRIIChwdHIsIGRwLCBieXRlcywg d2lkdGgpOworICAgICAgICAgICAgICAgICAgLyogU3VidHJhY3Qgb25lIHRvIGNvbXBlbnNhdGUg Zm9yIHRoZSBpbmNyZW1lbnQKKyAgICAgICAgICAgICAgICAgIHRoYXQgaXMgZ29pbmcgdG8gaGFw cGVuIGJlbG93LiAqLworICAgICAgICAgICAgICAgICAgc2Nhbl9ieXRlICs9IGJ5dGVzIC0gMTsK KyAgICAgICAgICAgICAgICAgIGNvbCArPSB3aWR0aDsKKyAgICAgICAgICAgICAgICB9CisgICAg ICAgICAgICAgICAgZWxzZSBpZiAoY3RsX2Fycm93ICYmIChjIDwgMDQwIHx8IGMgPT0gMDE3Nykp CisgICAgICAgICAgICAgICAgICBjb2wgKz0gMjsKKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYg KGMgPCAwNDAgfHwgYyA+PSAwMTc3KQorICAgICAgICAgICAgICAgICAgICBjb2wgKz0gNDsKKyAg ICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgIGNvbCsrOworICAg ICAgICAgIH0KKyAgICAgIHNjYW4rKzsKKyAgICAgIHNjYW5fYnl0ZSsrOworICAgIH0KKyBlbmRs b29wOgorICBsYXN0X2tub3duX2NvbHVtbiA9IGNvbDsKKyAgbGFzdF9rbm93bl9jb2x1bW5fcG9p bnQgPSBwdDsKKyAgbGFzdF9rbm93bl9jb2x1bW5fbW9kaWZpZWQgPSBNT0RJRkY7CisgIGlmIChn b2FsY29sKQorICAgICpnb2FsY29sID0gY29sOworICBpZiAoZW5kcG9zKQorICAgICplbmRwb3Mg PSBzY2FuOworICBpZiAocHJldmNvbCkKKyAgICAqc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ICAgY291bnRpbmcgd2lkdGguICBUYWIg Y2hhcmFjdGVycyBhcmUgdGhlIG9ubHkgY29tcGxpY2F0ZWQgY2FzZS4gKi8KKyAgLyogTWFrZSBh IHBvaW50ZXIgZm9yIGRlY3JlbWVudGluZyB0aHJvdWdoIHRoZSBjaGFycyBiZWZvcmUgcG9pbnQu ICovCisgIHB0ciA9IEJZVEVfUE9TX0FERFIgKENIQVJfVE9fQllURSAocHQpIC0gMSkgKyAxOwor ICAvKiBNYWtlIGEgcG9pbnRlciB0byB3aGVyZSBjb25zZWN1dGl2ZSBjaGFycyBsZWF2ZSBvZmYs CisgICAgIGdvaW5nIGJhY2t3YXJkcyBmcm9tIHBvaW50LiAqLworICBpZiAocHQgPT0gQkVHVikK KyAgICBzdG9wID0gcHRyOworICAgIGVsc2UgaWYgKHB0IDw9IEdQVCB8fCBCRUdWID4gR1BUKQor ICAgICAgc3RvcCA9IEJFR1ZfQUREUjsKKyAgICAgIGVsc2UKKyAgICAgICAgc3RvcCA9IEdBUF9F TkRfQUREUjsKKyAgY29sID0gMCwgdGFiX3NlZW4gPSAwLCBwb3N0X3RhYiA9IDA7CisgIHdoaWxl ICgxKQorICAgIHsKKyAgICAgIHB0cmRpZmZfdCBpLCBuOworICAgICAgTGlzcF9PYmplY3QgY2hh cnZlYzsKKyAgICAgIGlmIChwdHIgPT0gc3RvcCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFdl IHN0b3BwZWQgZWl0aGVyIGZvciB0aGUgYmVnaW5uaW5nIG9mIHRoZSBidWZmZXIKKyAgICAgICAg ICAgICBvciBmb3IgdGhlIGdhcC4gKi8KKyAgICAgICAgICBpZiAocHRyID09IEJFR1ZfQUREUikK KyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIC8qIEl0IHdhcyB0aGUgZ2FwLiAgSnVtcCBi YWNrIG92ZXIgaXQuICovCisgICAgICAgICAgc3RvcCA9IEJFR1ZfQUREUjsKKyAgICAgICAgICBw dHIgPSBHUFRfQUREUjsKKyAgICAgICAgICAvKiBDaGVjayB3aGV0aGVyIHRoYXQgYnJpbmdzIHVz IHRvIGJlZ2lubmluZyBvZiBidWZmZXIuICovCisgICAgICAgICAgaWYgKEJFR1YgPj0gR1BUKQor ICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGMgPSAqLS1wdHI7CisgICAgICBp ZiAoZHAgJiYgVkVDVE9SUCAoRElTUF9DSEFSX1ZFQ1RPUiAoZHAsIGMpKSkKKyAgICAgICAgewor ICAgICAgICAgIGNoYXJ2ZWMgPSBESVNQX0NIQVJfVkVDVE9SIChkcCwgYyk7CisgICAgICAgICAg biA9IEFTSVpFIChjaGFydmVjKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAg eworICAgICAgICAgICAgY2hhcnZlYyA9IFFuaWw7CisgICAgICAgICAgICBuID0gMTsKKyAgICAg ICAgICB9CisgICAgICBmb3IgKGkgPSBuIC0gMTsgaSA+PSAwOyAtLWkpCisgICAgICAgIHsKKyAg ICAgICAgICBpZiAoVkVDVE9SUCAoY2hhcnZlYykpCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIC8qIFRoaXMgc2hvdWxkIGJlIGhhbmRsZWQgdGhlIHNhbWUgYXMKKyAgICAgICAgICAgbmV4 dF9lbGVtZW50X2Zyb21fZGlzcGxheV92ZWN0b3IgZG9lcyBpdC4gKi8KKyAgICAgICAgICAgICAg TGlzcF9PYmplY3QgZW50cnkgPSBBUkVGIChjaGFydmVjLCBpKTsKKyAgICAgICAgICAgICAgaWYg KEdMWVBIX0NPREVfUCAoZW50cnkpKQorICAgICAgICAgICAgICAgIGMgPSBHTFlQSF9DT0RFX0NI QVIgKGVudHJ5KTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjID0g JyAnOworICAgICAgICAgICAgfQorICAgICAgICAgIGlmIChjID49IDA0MCAmJiBjIDwgMDE3NykK KyAgICAgICAgICAgIGNvbCsrOworICAgICAgICAgICAgZWxzZSBpZiAoYyA9PSAnXG4nCisgICAg ICAgICAgICAgICAgICAgICB8fCAoYyA9PSAnXHInCisgICAgICAgICAgICAgICAgICAgICAgICAg JiYgRVEgKEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBzZWxlY3RpdmVfZGlzcGxheSksIFF0KSkpCisg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwdHIrKzsKKyAgICAgICAgICAgICAgICBn b3RvIHN0YXJ0X29mX2xpbmVfZm91bmQ7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAg ZWxzZSBpZiAoYyA9PSAnXHQnKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAg IGlmICh0YWJfc2VlbikKKyAgICAgICAgICAgICAgICAgICAgY29sID0gKChjb2wgKyB0YWJfd2lk dGgpIC8gdGFiX3dpZHRoKSAqIHRhYl93aWR0aDsKKyAgICAgICAgICAgICAgICAgIHBvc3RfdGFi ICs9IGNvbDsKKyAgICAgICAgICAgICAgICAgIGNvbCA9IDA7CisgICAgICAgICAgICAgICAgICB0 YWJfc2VlbiA9IDE7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYg KFZFQ1RPUlAgKGNoYXJ2ZWMpKQorICAgICAgICAgICAgICAgICAgLyogV2l0aCBhIGRpc3BsYXkg dGFibGUgZW50cnksIEMgaXMgZGlzcGxheWVkIGFzIGlzLCBhbmQKKyAgICAgICAgICAgICAgICAg ICAgIG5vdCBkaXNwbGF5ZWQgYXMgXE5OTiBvciBhcyBeTi4gIElmIEMgaXMgYSBzaW5nbGUtYnl0 ZQorICAgICAgICAgICAgICAgICAgICAgY2hhcmFjdGVyLCBpdCB0YWtlcyBvbmUgY29sdW1uLiAg SWYgQyBpcyBtdWx0aS1ieXRlIGluCisgICAgICAgICAgICAgICAgICAgICBhIHVuaWJ5dGUgYnVm ZmVyLCBpdCdzIHRyYW5zbGF0ZWQgdG8gdW5pYnl0ZSwgc28gaXQKKyAgICAgICAgICAgICAgICAg ICAgIGFsc28gdGFrZXMgb25lIGNvbHVtbi4gKi8KKyAgICAgICAgICAgICAgICAgICsrY29sOwor ICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICBjb2wgKz0gKGN0bF9h cnJvdyAmJiBjIDwgMDIwMCkgPyAyIDogNDsKKyAgICAgICAgfQorICAgIH0KKyBzdGFydF9vZl9s aW5lX2ZvdW5kOgorICBpZiAodGFiX3NlZW4pCisgICAgeworICAgICAgY29sID0gKChjb2wgKyB0 YWJfd2lkdGgpIC8gdGFiX3dpZHRoKSAqIHRhYl93aWR0aDsKKyAgICAgIGNvbCArPSBwb3N0X3Rh YjsKKyAgICB9CisgIGxhc3Rfa25vd25fY29sdW1uID0gY29sOworICBsYXN0X2tub3duX2NvbHVt bl9wb2ludCA9IHB0OworICBsYXN0X2tub3duX2NvbHVtbl9tb2RpZmllZCA9IE1PRElGRjsKKyAg aWYgKG9sZF9idWZmZXIpCisgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7Cisg IHJldHVybiBjb2w7Cit9CisKK0RFRlVOICgibWMtY3VycmVudC1jb2x1bW4iLCBGbWNfY3VycmVu dF9jb2x1bW4sIFNtY19jdXJyZW50X2NvbHVtbiwgMiwgMiwgMCwKKyAgICAgICBkb2M6IC8qIFJl dHVybiB0aGUgaG9yaXpvbnRhbCBwb3NpdGlvbiBvZiBwb2ludC4gIEJlZ2lubmluZyBvZiBsaW5l IGlzIGNvbHVtbiAwLgorVGhpcyBpcyBjYWxjdWxhdGVkIGJ5IGFkZGluZyB0b2dldGhlciB0aGUg d2lkdGhzIG9mIGFsbCB0aGUgZGlzcGxheWVkCityZXByZXNlbnRhdGlvbnMgb2YgdGhlIGNoYXJh Y3RlciBiZXR3ZWVuIHRoZSBzdGFydCBvZiB0aGUgcHJldmlvdXMgbGluZQorYW5kIHBvaW50IChl LmcuLCBjb250cm9sIGNoYX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FIChmcmFtZSwgZik7CisgIHJldHVybiBTU0RB VEEgKEZwcmluMV90b19zdHJpbmcgKGZyYW1lLCBRbmlsKSk7Cit9CisKKy8qIFVTQUdFOiAgZnBy aW50ZiAoc3RkZXJyLCAiV0lORE9XICglcykiLCBtY193aW5kb3cgKHcpKTsgKi8KK2NoYXIgKgor bWNfd2luZG93IChzdHJ1Y3Qgd2luZG93ICp3KQoreworICBMaXNwX09iamVjdCB3aW5kb3c7Cisg IFhTRVRXSU5ET1cgKHdpbmRvdywgdyk7CisgIHJldHVybiBTU0RBVEEgKEZwcmluMV90b19zdHJp bmcgKHdpbmRvdywgUW5pbCkpOworfQorCisvKiBVU0FHRTogIGZwcmludGYgKHN0ZGVyciwgIkNI QVJBQ1RFUiAoJXMpIiwgbWNfY2hhcl90b19zdHJpbmcgKGdseXBoLT51LmNoKSk7ICovCitjaGFy ICoKK21jX2NoYXJfdG9fc3RyaW5nIChpbnQgYXJnKQoreworICBMaXNwX09iamVjdCBjaGFyYWN0 ZXIgPSAoMCA8PSBhcmcgJiYgYXJnIDw9IE1BWF9DSEFSKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBGY2hhcl90b19zdHJpbmcgKG1ha2VfZml4bnVtIChhcmcpKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiBRbmlsOworICBjaGFyICogcmVzdWx0ID0gKCFOSUxQIChjaGFyYWN0 ZXIpCisgICAgICAgICAgICAgICAgICAgJiYgYXJnID09IDkpCisgICAgICAgICAgICAgICAgICAg ID8gIlxcdCIKKyAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAg ICAgICAgICAgICAgICAmJiBhcmcgPT0gMTApCisgICAgICAgICAgICAgICAgICAgID8gIlxcbiIK KyAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAgICAg ICAgICAmJiBhcmcgPT0gMzIpCisgICAgICAgICAgICAgICAgICAgID8gIlxccyIKKyAgICAgICAg ICAgICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAgICAgICAgICAmJiBh cmcgIT0gOQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnICE9IDEwCisgICAgICAgICAgICAg ICAgICAgICAmJiBhcmcgIT0gMzIpCisgICAgICAgICAgICAgICAgICAgID8gU1NEQVRBIChjaGFy YWN0ZXIpCisgICAgICAgICAgICAgICAgICA6ICJcXD8iOworICByZXR1cm4gcmVzdWx0OworfQor CitpbnQKK21jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKExpc3BfT2JqZWN0IGFyZykKK3sKKyAgY2hh ciAqc3RyOworICBpZiAoWFRZUEUgKGFyZykgPT0gTGlzcF9TdHJpbmcpCisgICAgc3RyID0gU1NE QVRBIChhcmcpOworICAgIGVsc2UgaWYgKFhUWVBFIChhcmcpID09IExpc3BfU3ltYm9sKQorICAg ICAgc3RyID0gU1NEQVRBIChTWU1CT0xfTkFNRSAoYXJnKSk7CisgICAgICBlbHNlIHJldHVybiAt MTsKKyAgaWYgKCFzdHJjbXAgKHN0ciwgIm5vIikpCisgICAgcmV0dXJuIE1DX05PX0NVUlNPUjsK KyAgaWYgKCFzdHJjbXAgKHN0ciwgIm1jLWxlZnQtZnJpbmdlLWJpdG1hcCIpKQorICAgIHJldHVy biBNQ19MRUZUX0ZSSU5HRV9CSVRNQVA7CisgIGlmICghc3RyY21wIChzdHIsICJtYy1yaWdodC1m cmluZ2UtYml0bWFwIikpCisgICAgcmV0dXJuIE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA7CisgIGlm ICghc3RyY21wIChzdHIsICJib3giKSkKKyAgICByZXR1cm4gTUNfRklMTEVEX0JPWDsKKyAgaWYg KCFzdHJjbXAgKHN0ciwgImZyYW1lZCIpKQorICAgIHJldHVybiBNQ19GUkFNRURfQk9YOworICBp ZiAoIXN0cmNtcCAoc3RyLCAiaG9sbG93IikpCisgICAgcmV0dXJuIE1DX0hPT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FRCI7CisgICAgICBjYXNlIFVO Q0hBTkdFRDogcmV0dXJuICJVTkNIQU5HRUQiOworICAgICAgY2FzZSBTRVRfQ1VSU09SX09ORTog cmV0dXJuICJTRVRfQ1VSU09SX09ORSI7CisgICAgICBjYXNlIFNFVF9DVVJTT1JfVFdPOiByZXR1 cm4gIlNFVF9DVVJTT1JfVFdPIjsKKyAgICAgIGRlZmF1bHQ6CisgICAgICByZXR1cm4gIlVOS05P V04iOworICAgIH0KK30KKworLyogVVNBR0U6ICBmcHJpbnRmIChzdGRlcnIsICJGUk9NX1dIRVJF ICglcykiLCBtY19kcmF3X3Jvd190eXBlX3RvX3N0cmluZyAoYXJnKSk7ICovCitjaGFyICoKK21j X3JlZHJhd19yb3dfdHlwZV90b19zdHJpbmcgKGVudW0gbWNfcmVkcmF3X3Jvd190eXBlIGZyb21f d2hlcmUpCit7CisgIHN3aXRjaCAoZnJvbV93aGVyZSkKKyAgICB7CisgICAgICBjYXNlIFVQREFU RV9XSU5ET1dfX1JFRFJBV19PVkVSTEFQUEVEX1JPV1M6IHJldHVybiAiVVBEQVRFX1dJTkRPV19f UkVEUkFXX09WRVJMQVBQRURfUk9XUyI7CisgICAgICBjYXNlIFhfSU5TRVJUX0dMWVBIUzogcmV0 dXJuICJYX0lOU0VSVF9HTFlQSFMiOworICAgICAgY2FzZSBYX0ZJWF9PVkVSTEFQUElOR19BUkVB OiByZXR1cm4gIlhfRklYX09WRVJMQVBQSU5HX0FSRUEiOworICAgICAgY2FzZSBEUkFXX1JPV19X SVRIX01PVVNFX0ZBQ0U6IHJldHVybiAiRFJBV19ST1dfV0lUSF9NT1VTRV9GQUNFIjsKKyAgICAg IGNhc2UgRVhQT1NFX0FSRUFfT05FOiByZXR1cm4gIkVYUE9TRV9BUkVBX09ORSI7CisgICAgICBj YXNlIEVYUE9TRV9BUkVBX1RXTzogcmV0dXJuICJFWFBPU0VfQVJFQV9UV08iOworICAgICAgY2Fz ZSBFWFBPU0VfTElORTogcmV0dXJuICJFWFBPU0VfTElORSI7CisgICAgICBkZWZhdWx0OgorICAg ICAgcmV0dXJuICJVTktOT1dOIjsKKyAgICB9Cit9CisKK3ZvaWQKK21jX2NhY2hlX2luc3BlY3Rv ciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IG1jX21hdHJpeCBtYXRyaXgpCit7CisgIGludCB2 cG9zX2FsbG9jYXRlZCA9IHctPm1jX21hdHJpeC52cG9zX2FsbG9jYXRlZDsKKyAgaW50IHZwb3Nf dXNlZCA9IHctPm1jX21hdHJpeC52cG9zX3VzZWQ7CisgIGZwcmludGYgKHN0ZGVyciwgIiVzOiAg bWF0cml4LnZwb3NfYWxsb2NhdGVkICglZCkgfCBtYXRyaXgudnBvc191c2VkICglZClcbiIsCisg ICAgICAgICAgICAgICAgICAgbWNfd2luZG93ICh3KSwgdnBvc19hbGxvY2F0ZWQsIHZwb3NfdXNl ZCk7CisgIGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAg ICAgICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7CisgICAgICAgKytjYWNoZV90eXBlKQorICAgIHsK KyAgICAgIGludCBjdXJzb3JzX3VzZWQgPSB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW2NhY2hl X3R5cGVdOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICBtYXRyaXguY3Vyc29yc191c2VkWyVz XSAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgICBtY19jYWNoZV90eXBlX3RvX3N0cmlu ZyAoY2FjaGVfdHlwZSksIGN1cnNvcnNfdXNlZCk7CisgICAgfQorICBmb3IgKGludCB2bnRoID0g MDsKKyAgICAgICB2bnRoIDwgdy0+bWNfbWF0cml4LnZwb3NfdXNlZDsKKyAgICAgICArK3ZudGgp CisgICAgeworICAgICAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NB Q0hFOworICAgICAgICAgICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7CisgICAgICAgICAgICsrY2Fj aGVfdHlwZSkKKyAgICAgICAgeworICAgICAgICAgIGludCBjYWNoZV9hbGxvY2F0ZWQgPSB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV07CisgICAgICAg ICAgaW50IGNhY2hlX3VzZWQgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2Nh Y2hlX3R5cGVdOworICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgICB2bnRoICglZCkgfCBj YWNoZV9hbGxvY2F0ZWRbJXNdICglZCkgfCBjYWNoZV91c2VkWyVzXSAoJWQpXG4iLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgdm50aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG1j X2NhY2hlX3R5cGVfdG9fc3RyaW5nIChjYWNoZV90eXBlKSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgIGNhY2hlX2FsbG9jYXRlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2Nh Y2hlX3R5cGVfdG9fc3RyaW5nIChjYWNoZV90eXBlKSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgIGNhY2hlX3VzZWQpOworICAgICAgICB9CisgICAgfQorfQorCit2b2lkCittY19zZXRfbHNs X2JnIChzdHJ1Y3Qgd2luZG93ICp3LCBlbnVtIGZhY2VfaWQgZmFjZV9pZCwgc3RydWN0IG1jX1JH QiAqbHNsKQoreworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgc3Ry dWN0IGZhY2UgKmZhY2U7CisgIGlmICghTklMUCAoVmZhY2VfcmVtYXBwaW5nX2FsaXN0KQorICAg ICAgJiYgKGZhY2VfaWQgPT0gREVGQVVMVF9GQUNFX0lEIC8qIFFkZWZhdWx0ICovCisgICAgICAg ICA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VEU7CisgIGVzc2VudGlhbHMtPmZjX3ggPSAo ZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChWZGlzcGxheV9s aW5lX251bWJlcnMpKQorICAgICAgICAgICAgICAgICAgICAgICA/IChmaWxsX2NvbCAqIGZyYW1l X2NoYXJfd2lkdGgpICsgdy0+bWMubG51bV9waXhlbF93aWR0aCAtIGhzY2xfeAorICAgICAgICAg ICAgICAgICAgICAgOiAoZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAgICAgICAgICAgICAgJiYg TklMUCAoVmRpc3BsYXlfbGluZV9udW1iZXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgPyAo ZmlsbF9jb2wgKiBmcmFtZV9jaGFyX3dpZHRoKSAtIGhzY2xfeAorICAgICAgICAgICAgICAgICAg ICAgOiAwOworICBpZiAob2xkX2J1ZmZlcikKKyAgICBzZXRfYnVmZmVyX2ludGVybmFsIChvbGRf YnVmZmVyKTsKKyAgZW51bSBmYWNlX2lkIGZpbGxfY29sdW1uX3ByZV96dl9mYWNlX2lkID0KKyAg ICAoIWVzc2VudGlhbHMtPmFjdGl2ZV9wCisgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3 LT5jb250ZW50cyksIGZjX2luYWN0aXZlX3dpbmRvd3MpKQorICAgICAmJiBOSUxQIChCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICAgID8gbG9va3VwX25hbWVk X2ZhY2UgKHcsIGYsIGludGVybiAoImZjLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpCisg ICAgOiAoIWVzc2VudGlhbHMtPmFjdGl2ZV9wCisgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZG RVIgKHctPmNvbnRlbnRzKSwgZmNfaW5hY3RpdmVfd2luZG93cykpCisgICAgICAgJiYgIU5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3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NvbnRlbnRzKSwgZmNfaW5hY3RpdmVfd2luZG93cykpCisgICAgICYmIE5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgICAgPyBs b29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiZmMtaW5hY3RpdmUtYXQtenYtZmFjZSIp LCB0cnVlKQorICAgIDogKCFlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAgICAgICYmICFOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX2luYWN0aXZlX3dpbmRvd3MpKQorICAgICAg ICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAg ICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgJiYgdy0+ Y3Vyc29yLnggPT0gZXNzZW50aWFscy0+ZmNfeCkKKyAgICAgID8gbG9va3VwX25hbWVkX2ZhY2Ug KHcsIGYsIGludGVybiAoImZjLW9wb2ludC1pbmFjdGl2ZS1hdC16di1mYWNlIiksIHRydWUpCisg ICAgOiAoZXNzZW50aWFscy0+YWN0aXZlX3AKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwg Y2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICYmIHctPmN1cnNvci54ID09IGVzc2VudGlhbHMt PmZjX3gpCisgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCJmYy1vcG9p bnQtYXQtenYtZmFjZSIpLCB0cnVlKQorICAgIDogKCFlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAg ICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX2luYWN0aXZlX3dp bmRv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hCVUZGRVIg KHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNo X3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAmJiB3LT5jdXJzb3IueCA9PSBlc3NlbnRpYWxzLT5m Y194KQorICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiZmMtb3BvaW50 LXBvc3QtenYtZmFjZSIpLCB0cnVlKQorICAgIDogKCFlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAg ICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX2luYWN0aXZlX3dp bmRvd3MpKQorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNy b3NzaGFpcnMpKQorICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikp CisgICAgICAgJiYgdy0+Y3Vyc29yLnggIT0gZXNzZW50aWFscy0+ZmNfeCkKKyAgICAgID8gbG9v a3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoImZjLWluYWN0aXZlLXBvc3QtenYtZmFjZSIp LCB0cnVlKQorICAgIDogKGVzc2VudGlhbHMtPmFjdGl2ZV9wCisgICAgICAgJiYgIU5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgJiYgIU5JTFAg KEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAmJiB3LT5jdXJzb3IueCAhPSBl c3NlbnRpYWxzLT5mY194KQorICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJu ICgiZmMtcG9zdC16di1mYWNlIiksIHRydWUpCisgICAgOiBsb29rdXBfbmFtZWRfZmFjZSAodywg ZiwgaW50ZXJuICgiZmMtcG9zdC16di1mYWNlIiksIHR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bWNfeHdfY29sb3JfdmFsdWVzICh3LCBiZXlvbmRfZmlsbF9jb2xvciwgJmJleW9uZF9maWxsX2Zv cmVncm91bmQpOworICAgICAgLyogcmVkICovCisgICAgICBpZiAoKCFmaWxsX2NvbHVtbl9wCisg ICAgICAgICAgICYmIGN1cnJlbnRfY29sICUgMiAhPSAwCisgICAgICAgICAgICYmIHJvd19wb3Np dGlvbiA9PSBQUkVfWlYpCisgICAgICAgICAgfHwgKGZpbGxfY29sdW1uX3AKKyAgICAgICAgICAg ICAgJiYgY3VycmVudF9jb2wgJSAyICE9IDAKKyAgICAgICAgICAgICAgJiYgY3VycmVudF9jb2wg PD0gZmlsbF9jb2wKKyAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVikpCisg ICAgICAgIHsKKyAgICAgICAgICBsc2xfZmctPnJlZCA9IG9kZF9mb3JlZ3JvdW5kLnJlZDsKKyAg ICAgICAgICBsc2xfZmctPmdyZWVuID0gb2RkX2ZvcmVncm91bmQuZ3JlZW47CisgICAgICAgICAg bHNsX2ZnLT5ibHVlID0gb2RkX2ZvcmVncm91bmQuYmx1ZTsKKyAgICAgICAgfQorICAgICAgICAv KiB5ZWxsb3cgKi8KKyAgICAgICAgZWxzZSBpZiAoKCFmaWxsX2NvbHVtbl9wCisgICAgICAgICAg ICAgICAgICAmJiBjdXJyZW50X2NvbCAlIDIgPT0gMAorICAgICAgICAgICAgICAgICAgJiYgcm93 X3Bvc2l0aW9uID09IFBSRV9aVikKKyAgICAgICAgICAgICAgICAgfHwgKGZpbGxfY29sdW1uX3AK KyAgICAgICAgICAgICAgICAgICAgICYmIGN1cnJlbnRfY29sICUgMiA9PSAwCisgICAgICAgICAg ICAgICAgICAgICAmJiBjdXJyZW50X2NvbCA8PSBmaWxsX2NvbAorICAgICAgICAgICAgICAgICAg ICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVikpCisgICAgICAgICAgeworICAgICAgICAgICAg bHNsX2ZnLT5yZWQgPSBldmVuX2ZvcmVncm91bmQucmVkOworICAgICAgICAgICAgbHNsX2ZnLT5n cmVlbiA9IGV2ZW5fZm9yZWdyb3VuZC5ncmVlbjsKKyAgICAgICAgICAgIGxzbF9mZy0+Ymx1ZSA9 IGV2ZW5fZm9yZWdyb3VuZC5ibHVlOworICAgICAgICAgIH0KKyAgICAgICAgICAvKiBncmVlbiAq LworICAgICAgICAgIGVsc2UgaWYgKGZpbGxfY29sdW1uX3AKKyAgICAgICAgICAgICAgICAgICAm JiBjdXJyZW50X2NvbCA+IGZpbGxfY29sCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0 aW9uID09IFBSRV9aVikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbHNsX2ZnLT5yZWQg PSBiZXlvbmRfZmlsbF9mb3JlZ3JvdW5kLnJlZDsKKyAgICAgICAgICAgICAgbHNsX2ZnLT5ncmVl biA9IGJleW9uZF9maWxsX2ZvcmVncm91bmQuZ3JlZW47CisgICAgICAgICAgICAgIGxzbF9mZy0+ Ymx1ZSA9IGJleW9uZF9maWxsX2ZvcmVncm91bmQuYmx1ZTsKKyAgICAgICAgICAgIH0KKyAgICAg ICAgICAgIGVsc2UgaWYgKHJvd19wb3NpdGlvbiA9PSBBVF9aVikKKyAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgIGxzbF9mZy0+cmVkID0gZXNzZW50aWFscy5zcF9mZy5yZWQ7CisgICAg ICAgICAgICAgICAgbHNsX2ZnLT5ncmVlbiA9IGVzc2VudGlhbHMuc3BfZmcuZ3JlZW47CisgICAg ICAgICAgICAgICAgbHNsX2ZnLT5ibHVlID0gZXNzZW50aWFscy5zcF9mZy5ibHVlOworICAgICAg ICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBIT1JJWk9OVEFMX1JVTEVS OgorICAgIHsKKyAgICAgIGlmIChnbHlwaCAhPSBOVUxMCisgICAgICAgICAgJiYgZ2x5cGgtPnUu Y2gg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hdC16di1mYWNlIiksIHRydWUpCisgICAgICAgIDogKGVzc2VudGlhbHMuYWN0aXZl X3AKKyAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IEFUX1pWKQorICAgICAgICAgID8gbG9v a3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1hdC16di1m YWNlIiksIHRydWUpCisgICAgICAgIDogbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAo IistcmVhbC1mYWtlLWN1cnNvci1hdC16di1mYWNlIiksIHRydWUpOworICAgICAgc3RydWN0IGZh Y2UgKmN1cnNvcl9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBjdXJzb3JfZmFjZV9pZCk7CisgICAg ICBMaXNwX09iamVjdCBjdXJzb3JfY29sb3IgPSBjdXJzb3JfZmFjZS0+bGZhY2VbTEZBQ0VfRk9S RUdST1VORF9JTkRFWF07CisgICAgICBtY194d19jb2xvcl92YWx1ZXMgKHcsIGN1cnNvcl9jb2xv ciwgbHNsX2ZnKTsKKyAgICAgIGJyZWFrOworICAgIH0KKyAgfQorfQorCisvKiBEcmF3IGdseXBo cyBiZXR3ZWVuIFNUQVJUIGFuZCBFTkQgaW4gQVJFQSBvZiBST1cgb24gd2luZG93IFcsCisgICBz dGFydGluZyBhdCB4LXBvc2l0aW9uIFguICBYIGlzIHJlbGF0aXZlIHRvIEFSRUEgaW4gVy4gIEhM IGlzIGEKKyAgIGZhY2Utb3ZlcnJpZGUgd2l0aCB0aGUgZm9sbG93aW5nIG1lYW5pbmc6CisgICAt ICBEUkFXX05PUk1BTF9URVhUICBkcmF3IG5vcm1hbGx5CisgICAtICBEUkFXX0NVUlNPUiAgICBk cmF3IGluIGN1cnNvciBmYWNlCisgICAtICBEUkFXX01PVVNFX0ZBQ0UgIGRyYXcgaW4gbW91c2Ug ZmFjZS4KKyAgIC0gIERSQVdfSU5WRVJTRV9WSURFTyAgZHJhdyBpbiBtb2RlIGxp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mFjZSA9IGZhbHNlOworICAgICAgaW50IGR1bW15X3ggPSAwOworICAgICAgLyog SWYgbW91c2UgaGlnaGxpZ2h0aW5nIGlzIG9uLCB3ZSBtYXkgbmVlZCB0byBkcmF3IGFkamFjZW50 CisgICBnbHlwaHMgdXNpbmcgbW91c2UtZmFjZSBoaWdobGlnaHRpbmcuICovCisgICAgICBpZiAo YXJlYSA9PSBURVhUX0FSRUEgJiYgcm93LT5tb3VzZV9mYWNlX3AKKyAgICAgICAgICAmJiBobGlu Zm8tPm1vdXNlX2ZhY2VfYmVnX3JvdyA+PSAwCisgICAgICAgICAgJiYgaGxpbmZvLT5tb3VzZV9m YWNlX2VuZF9yb3cgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIHB0cmRpZmZfdCByb3dfdnBv cyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCB3LT5jdXJyZW50X21hdHJpeCk7CisgICAgICAgICAg aWYgKHJvd192cG9zID49IGhsaW5mby0+bW91c2VfZmFjZV9iZWdfcm93CisgICAgICAgICAgICAg ICYmIHJvd192cG9zIDw9IGhsaW5mby0+bW91c2VfZmFjZV9lbmRfcm93KQorICAgICAgICAgICAg eworICAgICAgICAgICAgICBjaGVja19tb3VzZV9mYWNlID0gdHJ1ZTsKKyAgICAgICAgICAgICAg bW91c2VfYmVnX2NvbCA9IChyb3dfdnBvcyA9PSBobGluZm8tPm1vdXNlX2ZhY2VfYmVnX3JvdykK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gaGxpbmZvLT5tb3VzZV9mYWNlX2JlZ19j b2wKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogMDsKKyAgICAgICAgICAgICAgbW91 c2VfZW5kX2NvbCA9IChyb3dfdnBvcyA9PSBobGluZm8tPm1vdXNlX2ZhY2VfZW5kX3JvdykKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gaGxpbmZvLT5tb3VzZV9mYWNlX2VuZF9jb2wK KyAgICAgICAgICAgICAg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yA9IHMtPm5leHQpCisgICAgICAgICAg ICB7CisgICAgICAgICAgICAgIHMtPmxlZnRfb3ZlcndyaXR0ZW5fcCA9IHRydWU7CisgICAgICAg ICAgICAgIHMtPmFjdGlvbl90eXBlID0gYWN0aW9uX3R5cGU7CisgICAgICAgICAgICAgIGxlbmd0 aCArPSBzLT5maXJzdF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAg ICAgcmVsYXRpdmVfeCA9IHN0YXJ0X3ggLSBsZW5ndGg7CisgICAgICAgICAgZm9yIChzID0gaDsg czsgcyA9IHMtPm5leHQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHMtPmZpcnN0X2ds eXBoLT5yZWxhdGl2ZV94ID0gcmVsYXRpdmVfeDsKKyAgICAgICAgICAgICAgcmVsYXRpdmVfeCAr PSBzLT5maXJzdF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgICAg c3RhcnQgPSBpOworICAgICAgICAgIGNvbXB1dGVfb3ZlcmhhbmdzX2FuZF94ICh0LCBoZWFkLT54 LCB0cnVlKTsKKyAgICAgICAgICBwcmVwZW5kX2dseXBoX3N0cmluZ19saXN0cyAoJmhlYWQsICZ0 YWlsLCBoLCB0KTsKKyAgICAgICAgICBpZiAoY2xpcF9oZWFkID09IE5VTEwpCisgICAgICAgICAg ICBjbGlwX2hlYWQgPSBoZWFkOworICAgICAgICB9CisgICAgICAvKiBQcmVwZW5kIGdseXBoIHN0 cmluZ3MgZm9yIGdseXBocyBpbiBmcm9udCBvZiB0aGUgZmlyc3QgZ2x5cGgKKyAgICAgIHN0cmlu ZyB0aGF0IG92ZXJ3cml0ZSB0aGF0IGdseXBoIHN0cmluZyBiZWNhdXNlIG9mIHRoZWlyCisgICAg ICByaWdodCBvdmVyaGFuZy4gIEZvciB0aGVzZSBzdHJpbmdzLCBvbmx5IHRoZSBmb3JlZ3JvdW5k IG11c3QKKyAgICAgIGJlIGRyYXduLCBiZWNhdXNlIGl0IGRyYXdzIG92ZXIgdGhlIGdseXBoIHN0 cmluZyBhdCBgaGVhZCcuCisgICAgICBUaGUgYmFja2dyb3VuZCBtdXN0IG5vdCBiZSBkcmF3biBi ZWNhdXNlIHRoaXMgd291bGQgb3ZlcndyaXRlCisgICAgICByaWdodCBvdmVyaGFuZ3Mgb2YgcHJl Y2VkaW5nIGdseXBocyBmb3Igd2hpY2ggbm8gZ2x5cGgKKyAgICAgIHN0cmluZ3MgZXhpc3QuICov CisgICAgICBpID0gbGVmdF9vdmVyd3JpdGluZyAoaGVhZCk7CisgICAgICBpZiAoaSA+PSAwKQor ICAgICAgICB7CisgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIG92ZXJsYXBfaGw7Cisg ICAgICAgICAgaWYgKGNoZWNrX21vdXNlX2ZhY2UKKyAgICAgICAgICAgICAgJiYgbW91c2VfYmVn X2NvbCA8IHN0YXJ0ICYmIG1vdXNlX2VuZF9jb2wgPiBpKQorICAgICAgICAgICAgb3ZlcmxhcF9o bCA9IERSQVdfTU9VU0VfRkFDRTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgb3Zl cmxhcF9obCA9IERSQVdfTk9STUFMX1RFWFQ7CisgICAgICAgICAgaWYgKGhsID09IG92ZXJsYXBf aGwgfHwgY2xpcF9oZWFkID09IE5VTEwpCisgICAgICAgICAgICBjbGlwX2hlYWQgPSBoZWFkOwor ICAgICAgICAgIE1DX0JVSUxEX0dMWVBIX1NUUklOR1MgKGksIHN0YXJ0LCBoLCB0LCBvdmVybGFw X2hsLCBkdW1teV94LCBsYXN0X3gpOworICAgICAgICAgIGZvciAocyA9IGg7IHM7IHMgPSBzLT5u ZXh0KQorICAgICAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICAg ICAgY29tcHV0ZV9vdmVyaGFuZ3NfYW5kX3ggKHQsIGhlYWQtPngsIHRydWUpOworICAgICAgICAg IH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BpOycgaGVyZS4gKi8KKyAgICAgICAgICBjb21wdXRlX292ZXJoYW5nc19hbmRfeCAoaCwgdGFp bC0+eCArIHRhaWwtPndpZHRoLCBmYWxzZSk7CisgICAgICAgICAgYXBwZW5kX2dseXBoX3N0cmlu Z19saXN0cyAoJmhlYWQsICZ0YWlsLCBoLCB0KTsKKyAgICAgICAgICBpZiAoY2xpcF90YWlsID09 IE5VTEwpCisgICAgICAgICAgICBjbGlwX3RhaWwgPSB0YWlsOworICAgICAgICB9CisgICAgICAv KiBBcHBlbmQgZ2x5cGggc3RyaW5ncyBmb3IgZ2x5cGhzIGZvbGxvd2luZyB0aGUgbGFzdCBnbHlw aAorICAgICAgc3RyaW5nIHRhaWwgdGhhdCBvdmVyd3JpdGUgdGFpbC4gIFRoZSBmb3JlZ3JvdW5k IG9mIHN1Y2gKKyAgICAgIGdseXBocyBoYXMgdG8gYmUgZHJhd24gYmVjYXVzZSBpdCB3cml0ZXMg aW50byB0aGUgYmFja2dyb3VuZAorICAgICAgb2YgdGFpbC4gIFRoZSBiYWNrZ3JvdW5kIG11c3Qg bm90IGJlIGRyYXduIGJlY2F1c2UgaXQgY291bGQKKyAgICAgIHBhaW50IG92ZXIgdGhlIGZvcmVn cm91bmQgb2YgZm9sbG93aW5nIGdseXBocy4gKi8KKyAgICAgIGkgPSByaWdodF9vdmVyd3JpdGlu ZyAodGFpbCk7CisgICAgICBpZiAoaSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgZW51bSBk cmF3X2dseXBoc19mYWNlIG92ZXJsYXBfaGw7CisgICAgICAgICAgaWYgKGNoZWNrX21vdXNlX2Zh Y2UKKyAgICAgICAgICAgICAgJiYgbW91c2VfYmVnX2NvbCA8IGkgJiYgbW91c2VfZW5kX2NvbCA+ IGVuZCkKKyAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX01PVVNFX0ZBQ0U7CisgICAgICAg ICAgICBlbHNlCisgICAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX05PUk1BTF9URVhUOwor ICAgICAgICAgIGlmIChobCA9PSBvdmVybGFwX2hsIHx8IGNsaXBfdGFpbCA9PSBOVUxMKQorICAg ICAgICAgICAgY2xpcF90YWlsID0gdGFpbDsKKyAgICAgICAgICBpKys7ICAgICAgLyogV2UgbXVz dCBpbmNsdWRlIHRoZSBJdGggZ2x5cGguICovCisgICAgICAgICAgTUNfQlVJTERfR0xZUEhfU1RS SU5HUyAoZW5kLCBpLCBoLCB0LCBvdmVybGFwX2hsLCB4LCBsYXN0X3gpOworICAgICAgICAgIGZv ciAocyA9IGg7IHM7IHMgPSBzLT5uZXh0KQorICAgICAgICAgICAgcy0+YmFja2dyb3VuZF9maWxs ZWRfcCA9IHRydWU7CisgICAgICAgICAgY29tcHV0ZV9vdmVyaGFuZ3NfYW5kX3ggKGgsIHRhaWwt PnggKyB0YWlsLT53aWR0aCwgZmFsc2UpOworICAgICAgICAgIGFwcGVuZF9nbHlwaF9zdHJpbmdf bGlzdHMgKCZoZWFkLCAmdGFpbCwgaCwgdCk7CisgICAgICAgIH0KKyAgICAgIHRhaWwgPSBnbHlw aF9zdHJpbmdfY29udGFpbmluZ19iYWNrZ3JvdW5kX3dpZHRoICh0YWlsKTsKKyAgICAgIGlmIChj bGlwX3RhaWwpCisgICAgICAgIGNsaXBfdGFpbCA9IGdseXBoX3N0cmluZ19jb250YWluaW5nX2Jh Y2tncm91bmRfd2lkdGggKGNsaXBfdGFpbCk7CisgICAgICBpZiAoY2xpcF9oZWFkIHx8IGNsaXBf dGFpbCkKKyAgICAgICAgZm9yIChzID0gaGVhZDsgczsgcyA9IHMtPm5leHQpCisgICAgICAgICAg eworICAgICAgICAgICAgcy0+Y2xpcF9oZWFkID0gY2xpcF9oZWFkOworICAgICAgICAgICAgcy0+ Y2xpcF90YWlsID0gY2xpcF90YWlsOworICAgICAgICAgIH0KKyAgICB9CisgIC8qIERyYXcgYWxs IHN0cmluZ3MuICovCisgIGZvciAocyA9IGhlYWQ7IHM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ICAgICAgICAgJiYgTUFUUklYX1JPV19PVkVSTEFQU19TVUNDX1AgKHJvdyAtIDEp KQorICAgICAgICB4X2ZpeF9vdmVybGFwcGluZ19hcmVhICh3LCByb3cgLSAxLCBURVhUX0FSRUEs IE9WRVJMQVBTX0VSQVNFRF9DVVJTT1IpOworICAgICAgaWYgKE1BVFJJWF9ST1dfQk9UVE9NX1kg KHJvdykgPCB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAmJiBNQVRSSVhfUk9X X09WRVJMQVBTX1BSRURfUCAocm93ICsgMSkpCisgICAgICAgIHhfZml4X292ZXJsYXBwaW5nX2Fy ZWEgKHcsIHJvdyArIDEsIFRFWFRfQVJFQSwgT1ZFUkxBUFNfRVJBU0VEX0NVUlNPUik7CisgICAg fQorfQorCit2b2lkCittY19lcmFzZV9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBn bHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAg ICAgICBpbnQgeCwgaW50IHksIGludCBocG9zLCBpbnQgdnBvcywgZW51bSBtY19mbGF2b3IgZ2x5 cGhfZmxhdm9yLAorICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90 eXBlLCBpbnQgd2QpCit7CisgIGJvb2wgZGVidWdfcCA9IGZhbHNlOworICBpZiAoZGVidWdfcCkK KyAgICBmcHJpbnRmIChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6ICB4ICglZCkgfCB5ICglZCkg fCBocG9zICglZCkgfCB2cG9zICglZCkgfCB3ZCAoJWQpXG5cCisgICAgZ2x5cGhfZmxhdm9yICgl cykgfCBjdXJzb3JfdHlwZSAoJXMpXG4iLAorICAgIHgsIHksIGhwb3MsIHZwb3MsIHdkLAorICAg IG1jX2ZsYXZvcl90b19zdHJpbmcgKGdseXBoX2ZsYXZvciksIG1jX2N1cnNvcl90eXBlX3RvX3N0 cmluZyAoY3Vyc29yX3R5cGUpKTsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFt ZSk7CisgIE1vdXNlX0hMSW5mbyAqaGxpbmZvID0gTU9VU0VfSExfSU5GTyAoZik7CisgIGJvb2wg bW91c2VfZmFjZV9oZXJlX3AgPSBmYWxzZTsKKyAgc3RydWN0IGdseXBoICpjdXJzb3JfZ2x5cGg7 CisgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBobDsKKyAgLyogTm8gY3Vyc29yIGRpc3BsYXllZCBv ciByb3cgaW52YWxpZGF0ZWQgPT4gbm90aGluZyB0byBkbyBvbiB0aGUgc2NyZWVuLiAqLworICBp ZiAoY3Vyc29yX3R5cGUgPT0gTUNfTk9fQ1VSU09SKQorICAgIHsKKyAgICAgIGlmIChkZWJ1Z19w KQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6ICByZXR1cm4gKCVk KVxuIiwgMSk7CisgICAgICByZXR1cm47CisgICAgfQorICAvKiBWUE9TID49IG1hdHJpeC0+bnJv d3MgbWVhbnMgdGhhdCB3aW5kb3cgaGFzIGJlZW4gcmVzaXplZC4KKyAgICAgRG9uJ3QgYm90aGVy IHRvIGVyYXNlIHRoZSBjdXJzb3IuICovCisgIGlmICh2cG9zID49IG1hdHJpeC0+bnJvd3MpCisg ICAgeworICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX2Vy YXNlX2N1cnNvcjogIHJldHVybiAoJWQpXG4iLCAyKTsKKyAgICAgIHJldHVybjsKKyAgICB9Cisg IC8qIElmIHJvdyBjb250YWluaW5nIGN1cnNvciBpcyBtYXJrZWQgaW52YWxpZCwgdGhlcmUgaXMg bm90aGluZyB3ZQorICAgICBjYW4gZG8uICovCisgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAg eworICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgIGZwcm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hlYWRlcl9saW5lX2hl aWdodCA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICAgICAgY3Vyc29yX2dseXBo ID0gbWNfZ2V0X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIGhwb3MsIHZwb3MpOworICAg ICAgaWYgKGN1cnNvcl9nbHlwaCA9PSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgaWYgKGRl YnVnX3ApCisgICAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6ICBy ZXR1cm4gKCVkKVxuIiwgNyk7CisgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICBp bnQgdGVtcF93ZCA9IGN1cnNvcl9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICBpZiAodGVtcF94 IDwgMCkKKyAgICAgICAgeworICAgICAgICAgIHRlbXBfd2QgKz0gdGVtcF94OworICAgICAgICAg IHRlbXBfeCA9IDA7CisgICAgICAgIH0KKyAgICAgIHRlbXBfd2QgPSBtaW4gKHdkLCB3aW5kb3df Ym94X3dpZHRoICh3LCBURVhUX0FSRUEpIC0gdGVtcF94KTsKKyAgICAgIGludCBmeSA9IFdJTkRP V19UT19GUkFNRV9QSVhFTF9ZICh3LCBtYXggKGhlYWRlcl9saW5lX2hlaWdodCwgcm93LT55KSk7 CisgICAgICBpbnQgZnggPSBXSU5ET1dfVEVYVF9UT19GUkFNRV9QSVhFTF9YICh3LCB0ZW1wX3gp OworICAgICAgaWYgKHRlbXBfd2QgPiAwKQorICAgICAgICBGUkFNRV9SSUYgKGYpLT5jbGVhcl9m cmFtZV9hcmVhIChmLCBmeCwgZnksIHRlbXBfd2QsIHJvdy0+dmlzaWJsZV9oZWlnaHQpOworICAg IH0KKyAgLyogRXJhc2UgdGhlIGN1cnNvciBieSByZWRyYXdpbmcgdGhlIGNoYXJhY3RlciB1bmRl cm5lYXRoIGl0LiAqLworICBpZiAobW91c2VfZmFjZV9oZXJl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X2hz Y3JvbGxfbW9kZSwgYnVmKSwgUWN1cnJlbnRfbGluZSk7CisgIC8qIEVYQU1QTEU6ICAoc2Nyb2xs LWxlZnQgNSkgKi8KKyAgYm9vbCBoc2NsX2FsbF90ZW1wX3AgPSAody0+c3VzcGVuZF9hdXRvX2hz Y3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAor ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMt dSBDLXggPCBhbmQgZG8gbm90aGluZy4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzBfcCA9ICh3 LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1 dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Ny b2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4g MAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhz Y3JvbGwpOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBzb21ldGhpbmcgZWxzZSBi ZXNpZGVzIGhvcml6b250YWxseSBzY3JvbGxpbmcgdGhlCisgICAgICAgICAgICAgICBjdXJyZW50 IGxpbmUgZGlmZmVyZW50bHkuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgaXMgX25vdF8g aG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfYWxsX3Bl cm1fMV9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1p bl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Ny b2xsID09IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCAuLi4KKyAg ICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFsbHkgc2Nyb2xsZWQg ZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8yX3AgPSAoIXctPnN1c3BlbmRf YXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xs X21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPT0gMAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhzY3JvbGwpOwor ICAvKiBFWEFNUExFOiAgKHNjcm9sbC1sZWZ0IDUpOyBhbmQsIHRoZW4gcHJlc3MgdGhlIGxlZnQg YXJyb3cga2V5IG9uZSB0aW1lLgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIF9pc18gaG9y aXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiovCisgIGJvb2wgaHNjbF90ZW1wX3AgPSAo IXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19o c2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gMCk7CisgIC8qIEVYQU1Q TEU6ICBDLXUgQy14IDwgYW5kIGRvIHNvbWV0aGluZyB0aGF0IGNhdXNlcyB0aGUgY3VycmVudCBs aW5lIHRvIGJlCisgICAgICAgICAgICAgICBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50 bHkuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkgc2Nyb2xs ZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9wZXJtX3AgPSAoIXctPnN1c3BlbmRfYXV0 b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAor ICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAg ICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+ bWluX2hzY3JvbGwgIT0gdy0+aHNjcm9sbCk7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAo dy0+ZnJhbWUpOworICBpbnQgZnJpbmdlX2JpdG1hcCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7Cisg IGludCBmYWNlX2lkID0gREVGQVVMVF9GQUNFX0lEOworICBpZiAoIXJlbW92ZV9wCisgICAgICAm JiBnbHlwaF9mbGF2b3IgPT0gTUNfT1ZFUkxBWV9BUlJPV19CSVRNQVAKKyAgICAgICYmICFoc2Ns X2FsbF90ZW1wX3AKKyAgICAgICYmICFoc2NsX3RlbXBfcAorICAgICAgJiYgIWhzY2xfcGVybV9w CisgICAgICAmJiAhaHNjbF9hbGxfcGVybV8wX3AKKyAgICAgICYmICFoc2NsX2FsbF9wZXJtXzFf cAorICAgICAgJiYgIWhzY2xfYWxsX3Blcm1fMl9wKQorICAgIHsKKyAgICAgIGVudW0gZmFjZV9p ZCBvdmVybGF5X2Fycm93X2ZhY2VfaWQgPQorICAgICAgICAoIWFjdGl2ZV9wCisgICAgICAgICAm JiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF9pbmFjdGl2ZV93aW5kb3dz KSkpCisgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb3Zlcmxh eS1hcnJvdy1pbmFjdGl2ZS1wcmUtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICA6IChhY3RpdmVf cCkKKyAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJs YXktYXJyb3ctcHJlLXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7 CisgICAgICBmYWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkK KyAgICAgICAgICAgICAgICA/IG92ZXJsYXlfYXJyb3dfZmFjZV9pZAorICAgICAgICAgICAgICAg IDogREVGQVVMVF9GQUNFX0lEOworICAgICAgLyogZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmlu Z2VfYml0bWFwICh3LCBRb3ZlcmxheV9hcnJvdywgZmFsc2UsIGZhbHNlKTsgKi8KKyAgICAgIGlm ICh3LT5oc2Nyb2xsICE9IDApCisgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdl X2JpdG1hcCAodywgaW50ZXJuICgiKy1vdmVybGF5LWFycm93IiksIGZhbHNlLCB0cnVlKTsKKyAg ICAgICAgZWxzZQorICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1h cCAodywgaW50ZXJuICgiKy1vdmVybGF5LWFycm93IiksIHRydWUsIHRydWUpOworICAgICAgLyog QXMgdG8gYHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXBgLCB0aGU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gICAgICAg ICAgICAgICAgICAgICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICByb3ctPmxlZnRfZnJpbmdlX2Zh Y2VfaWQgPSBmYWNlX2lkOworICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9vZmZzZXQgPSAwOworICAg ICAgcm93LT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3AgPSBmYWxzZTsKKyAgICAgIG1jX2RyYXdf ZnJpbmdlX2JpdG1hcCAodywgcm93LCB0cnVlLCBjdXJzb3JfdHlwZSk7CisgICAgfQorICAgIGVs c2UgaWYgKCFyZW1vdmVfcAorICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciA9PSBNQ19PVkVS TEFZX0FSUk9XX0JJVE1BUAorICAgICAgICAgICAgICYmIChoc2NsX2FsbF90ZW1wX3AKKyAgICAg ICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8wX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNj bF9hbGxfcGVybV8xX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8yX3AKKyAg ICAgICAgICAgICAgICAgfHwgaHNjbF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF9w ZXJtX3ApKQorICAgICAgeworICAgICAgICBlbnVtIGZhY2VfaWQgb3ZlcmxheV9hcnJvd19mYWNl X2lkID0KKyAgICAgICAgICAoIWFjdGl2ZV9wCisgICAgICAgICAgICYmICFOSUxQIChCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgICA/ IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ctaHNjbC1p bmFjdGl2ZS1wcmUtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICAgIDogKGFj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0byBzZWUgdGhhdCBgcm93 LT5vdmVybGF5X2Fycm93X2JpdG1hcGAgc2F0aXNmaWVzIHRoZSBmaXJzdCBjb25kaXRpb24KKyAg ICAgICAgb2YgKHdoaWNoICE9IE5PX0ZSSU5HRV9CSVRNQVApLiAgQXQgdGhpcyB0aW1lLCBAbGF3 bGlzdCBwcmVmZXJzIG5vdCB0bworICAgICAgICByZWx5IHVwb24gYSBMaXNwIHNldHRpbmcgdXNp bmcgYHNldC1mcmluZ2UtYml0bWFwLWZhY2UnLiAqLworICAgICAgICByb3ctPmxlZnRfZnJpbmdl X2JpdG1hcCA9IChjdXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGZyaW5nZV9iaXRtYXAKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJVE1B UDsKKyAgICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gZmFjZV9pZDsKKyAgICAgICAg cm93LT5sZWZ0X2ZyaW5nZV9vZmZzZXQgPSAwOworICAgICAgICByb3ctPmZyaW5nZV9iaXRtYXBf cGVyaW9kaWNfcCA9IGZhbHNlOworICAgICAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXAgKHcsIHJv dywgdHJ1ZSwgY3Vyc29yX3R5cGUpOworICAgICAgfQorICAgICAgZWxzZSBpZiAoIXJlbW92ZV9w CisgICAgICAgICAgICAgICAmJiAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVf UklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVW RVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIHx8 IGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFCisgICAgICAgICAgICAgICAgICAg fHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAg ICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklH SFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElD QUxfQkFSCisgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VE X1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19W RVJUSUNBTF9CQVJfQkFDS1NMQVNIKSkKKyAgICAgICAgeworICAgICAgICAgIExpc3BfT2JqZWN0 IGJpdG1hcF9mbGF2b3IgPSAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklH SFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hv bGxvd19yZWN0YW5nbGVfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVf UklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBR bWNfcmV2ZXJzZWRfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RB TkdMRSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xs b3dfcmVjdGFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGds eXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9 PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxfYmFyX3JpZ2h0 X2Fycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2Zs YXZvciA9PSBNQ19WRVJUSUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVy dGljYWxfYmFyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBo X2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jhcl9iYWNrc2xhc2gKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBRbmlsOworICAgICAgICAgIGZyaW5n ZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBsb29rdXBfZnJpbmdlX2JpdG1hcCAoYml0bWFwX2ZsYXZv cikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19OT19GUklOR0VfQklUTUFQOworICAg ICAgICAgIGZhY2VfaWQgPSAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAor ICAgICAgICAgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xM T1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5 cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAg ICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNB TF9CQVIpKQorICAgICAgICAgICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYs IGludGVybiAoIistcmV2ZXJzZWQtYmFyLXByZS16di1mYWNlIiksIHRydWUpCisgICAgICAgICAg ICAgICAgICAgIDogKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAg ICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX0hPTExPV19S RUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxh dm9yICE9IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAg ICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQor ICAgICAgICAgICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAo IistYmFyLXByZS16di1mYWNlIiksIHRydWUpCisgICAgICAgICAgICAgICAgICAgIDogREVGQVVM VF9GQUNFX0lEOworICAgICAgICAgIHJvdy0+Y3Vyc29yX2luX2ZyaW5nZV9wID0gZmFsc2U7Cisg ICAgICAgICAgcm93LT5yaWdodF9mcmluZ2VfYml0bWFwID0gZnJpbmdlX2JpdG1hcDsKKyAgICAg ICAgICByb3ctPnJpZ2h0X2ZyaW5nZV9mYWNlX2lkID0gZmFjZV9pZDsKKyAgICAgICAgICByb3ct PnJpZ2h0X2ZyaW5nZV9vZmZzZXQgPSAwOworICAgICAgICAgIHJvdy0+ZnJpbmdlX2JpdG1hcF9w ZXJpb2RpY19wID0gZmFsc2U7CisgICAgICAgICAgbWNfZHJhd19mcmluZ2VfYml0bWFwICh3LCBy b3csIGZhbHNlLCBjdXJzb3JfdHlwZSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoZ2x5 cGhfZmxhdm9yID09IE1DX0dMWVBICisgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9 PSBNQ19HTFlQSExFU1MpCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBvbl9wID0gdHJ1 ZTsKKyAgICAgICAgICAgIEZSQU1FX1JJRiAoZiktPm1jX3NjcmliZV9jdXJzb3IgKHcsIG1hdHJp eCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICB2cG9zLCB3ZCwgaCwgbHNsLCBjdXJzb3JfdHlwZSwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgZ2x5cGhf Zmxhdm9yLCBvbl9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgYWN0aXZlX3ApOworICAgICAgICAgIH0KK30KKworLyogRHVtcCBjb250ZW50cyBvZiBnbHlw aCBHTFlQSCB0byBzdGRlcnIuICBST1cgYW5kIEFSRUEgYXJlCisgICB0aGUgZ2x5cGggcm93IGFu ZCBhcmVhIHdoZXJlIHRoZSBnbHlwaCBjb21lcyBmcm9tLiAqLwordm9pZAorbWNfZHVtcF9nbHlw aCAoc3RydWN0IGdseXBoX3JvdyAqcm93LCBzdHJ1Y3QgZ2x5cGggKmdseXBoLCBpbnQgYXJlYSwK KyAgICAgICAgICAgICAgIGludCByZWxhdGl2ZV94LCBpbnQgdnBvcykKK3sKKyAgYm9vbCBnbHlw aF96dl9wID0gKGdseXBoIC0gcm93LT5nbHlwaHNbYXJlYV0gPT0gcm93LT51c2VkW2FyZWFdIC0g MQorICAgICAgICAgICAgICAgICAgICAgJiYgTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSA9 PSBaVik7CisgIGlmIChnbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICB8fCBnbHlwaC0+ dHlwZSA9PSBHTFlQSExFU1NfR0xZUEgpCisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJyLAor ICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAl MS4xZCUxLjFkICAlM2QgJXMgJXNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVY VF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2Vk W2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgIChnbHlwaC0+dHlwZSA9 PSBDSEFSX0dMWVBICisgICAgICAgICA/ICdDJworICAgICAgICAgOiAnRycpLAorICAgICAgICBn bHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAg ID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAg ICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxf d2lkdGgsCisgICAgICAgIGdseXBoLT51LmNoLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAg ICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9s aW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisg ICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nIChnbHlwaC0+dS5jaCkpOworICAgIH0KKyAgZWxzZSBp ZiAoZ2x5cGgtPnR5cGUgPT0gU1RSRVRDSF9HTFlQSCkKKyAgICB7CisgICAgICBmcHJpbnRmIChz dGRlcnIsCisgICAgICAgICIgJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUw NnggJTRkICUxLjFkJTEuMWQgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmds eXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiBy b3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ1MnLAor ICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3Qp CisgICAgICAgICAgICA/ICdCJworICAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3Qp CisgICAgICAgICAgICA/ICdTJworICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisg ICAgICAgICAgICA/ICcwJworICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4 ZWxfd2lkdGgsCisgICAgICAgIDB1LAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAg Z2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3As CisgICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAg ICJcXFMiKTsKKyAgICB9CisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IElNQUdFX0dMWVBIKQor ICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIiAlNSJwRCJkLyUtNWQgJTVk ICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4xZCAgJTNkICVzICVjXG4iLAor ICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51 c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxh dGl2ZV94LAorICAgICAgICAnSScsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAo QlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ0InCisgICAgICAgICAgOiAo U1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgOiAo TklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgOiAnLScp KSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgKHVuc2lnbmVkIGludCkg Z2x5cGgtPnUuaW1nX2lkLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgt PmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAg ICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7 CisgICAgfQorICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpCisgICAg eworICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMg JTkicEQiZCAlYyAlM2QgMHglMDZ4IiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhU X0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRb YXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJysnLAorICAgICAgICBn bHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICAgICA/ICdCJworICAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICAgICA/ICdTJworICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAg ICA/ICcwJworICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgs CisgICAgICAgICh1bnNpZ25lZCBpbnQpIGdseXBoLT51LmNtcC5pZCk7CisgICAgICBmcHJpbnRm IChzdGRlcnIsICIgJTRkICUxLjFkJTEuMWQiLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAg ICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9s aW5lX3ApOworICAgICAgaWYgKGdseXBoLT51LmNtcC5hdXRvbWF0aWMpCisgICAgICAgIGZwcmlu dGYgKHN0ZGVyciwgIiAgJTNkICVzIC4gWyVkLSVkXVxuIiwKKyAgICAgICAgICAgICAgICAgICAg ICAgICBnbHlwaC0+aHBvcywgZ2x5cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAgICAg ICAgICAgICAgICAgIGdseXBoLT5zbGljZS5jbXAuZnJvbSwgZ2x5cGgtPnNsaWNlLmNtcC50byk7 CisgICAgICAgIGVsc2UKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiXG4iKTsKKyAgICB9Cisg IGVsc2UgaWYgKGdseXBoLT50eXBlID09IFhXSURHRVRfR0xZUEgpCisgICAgeworI2lmbmRlZiBI QVZFX1hXSURHRVRTCisgICAgICBlYXNzdW1lIChmYWxzZSk7CisjZWxzZQorICAgICAgZnByaW50 ZiAoc3RkZXJyLAorICAgICAgICAiICAlNWQvJS01ZCAlNWQgJTRjICU2ZCAlYyAlM2QgMHglMDV4 ICU0ZCAlMS4xZCUxLjFkICAlM2QgJXMgJWNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlw aHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93 LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdYJywKKyAg ICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQor ICAgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAg ICAgICAgICAgID8gJ1MnCisgICAgICAgICA6ICctJykpLAorICAgICAgICBnbHlwaC0+cGl4ZWxf d2lkdGgsCisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hf bGluZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgt PnUueHdpZGdldCwKKyAgICAgICAgZ2x5cGgtPmhwb3MsIGdseXBoX3p2X3AgPyAiWlYiIDogIi0t IiwKKyAgICAgICAgJy4nKTsKKyNlbmRpZgorICAgIH0KK30KKworLyogRHVtcCB0aGUgY29udGVu dHMgb2YgZ2x5cGggcm93IGF0IFZQT1MgaW4gTUFUUklYIHRvIHN0ZGVyci4KKyAgIEdMWVBIUyAw IG1lYW5zIGRvbid0IHNob3cgZ2x5cGggY29udGVudHMuCisgICBHTFlQSFMgMSBtZWFucyBzaG93 IGdseXBocyBpbiBzaG9ydCBmb3JtCisgICBHTFlQSFMgPiAxIG1lYW5zIHNob3cgZ2x5cGhzIGlu IGxvbmcgZm9ybS4gKi8KK3ZvaWQKK21jX2R1bXBfZ2x5cGhfcm93IChzdHJ1Y3QgZ2x5cGhfcm93 ICpyb3csIGludCB2cG9zLCBpbnQgZ2x5cGhzKQoreworICBpbnQgcmVsYXRpdmVfeCA9IDA7Cisg IGlmIChnbHlwaHMgIT0gMSkKKyAgICB7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICJcbkRVTVAg R0xZUEggUk9XXG4iKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIlJvdyAgICAgU3RhcnQgICAg ICAgRW5kIFVzZWQgb0U+PFxcQ1RaRmVzbSAgICAgWCAgICBZICAgIFcgICAgSCAgICBWICAgIEEg ICAgUFxuIik7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICI9PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1c biIpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiJTNkICU5InBEImQgJTkicEQiZCAlNGQgJTEu MWQlMS4xZCUxLjFkJTEuMWRcCislMS4xZCUxLjFkJTEuMWQlMS4xZCUxLjFkJTEuMWQlMS4xZCUx LjFkICAlNGQgJTRkICU0ZCAlNGQgJTRkICU0ZCAlNGRcbiIsCisgICAgICAgICB2cG9zLAorICAg ICAgICAgTUFUUklYX1JPV19TVEFSVF9DSEFSUE9TIChyb3cpLAorICAgICAgICAgTUFUUklYX1JP V19FTkRfQ0hBUlBPUyAocm93KSwKKyAgICAgICAgIHJvdy0+dXNlZFtURVhUX0FSRUFdLAorICAg ICAgICAgcm93LT5jb250YWluc19vdmVybGFwcGluZ19nbHlwaHNfcCwKKyAgICAgICAgIHJvdy0+ ZW5hYmxlZF9wLAorICAgICAgICAgcm93LT50cnVuY2F0ZWRfb25fbGVmdF9wLAorICAgICAgICAg cm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCwKKyAgICAgICAgIHJvdy0+Y29udGludWVkX3AsCisg ICAgICAgICBNQVRSSVhfUk9XX0NPTlRJTlVBVElPTl9MSU5FX1AgKHJvdyksCisgICAgICAgICBN QVRSSVhfUk9XX0RJU1BMQVlTX1RFWFRfUCAocm93KSwKKyAgICAgICAgIHJvdy0+ZW5kc19hdF96 dl9wLAorICAgICAgICAgcm93LT5maWxsX2xpbmVfcCwKKyAgICAgICAgIHJvdy0+ZW5kc19pbl9t aWRkbGVfb2ZfY2hhcl9wLAorICAgICAgICAgcm93LT5zdGFydHNfaW5fbWlkZGxlX29mX2NoYXJf cCwKKyAgICAgICAgIHJvdy0+bW91c2VfZmFjZV9wLAorICAgICAgICAgcm93LT54LAorICAgICAg ICAgcm93LT55LAorICAgICAgICAgcm93LT5waXhlbF93aWR0aCwKKyAgICAgICAgIHJvdy0+aGVp Z2h0LAorICAgICAgICAgcm93LT52aXNpYmxlX2hlaWdodCwKKyAgICAgICAgIHJvdy0+YXNjZW50 LAorICAgICAgICAgcm93LT5waHlzX2FzY2VudCk7CisgICAgICAvKiBUaGUgbmV4dCAzIGxpbmVz IHNob3VsZCBhbGlnbiB0byAiU3RhcnQiIGluIHRoZSBoZWFkZXIuICovCisgICAgICBmcHJpbnRm IChzdGRlcnIsICIgICAgJTkicEQiZCAlOSJwRCJkXHQlNWRcbiIsIHJvdy0+c3RhcnQub3Zlcmxh eV9zdHJpbmdfaW5kZXgsCisgICAgICAgICByb3ctPmVuZC5vdmVybGF5X3N0cmluZ19pbmRleCwK KyAgICAgICAgIHJvdy0+Y29udGludWF0aW9uX2xpbmVzX3dpZHRoKTsKKyAgICAgIGZwcmludGYg KHN0ZGVyciwgIiAgICAlOSJwRCJkICU5InBEImRcbiIsCisgICAgICAgICBDSEFSUE9TIChyb3ct PnN0YXJ0LnN0cmluZ19wb3MpLAorICAgICAgICAgQ0hBUlBPUyAocm93LT5lbmQuc3RyaW5nX3Bv cykpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICAgICU5ZCAlOWRcbiIsIHJvdy0+c3RhcnQu ZHB2ZWNfaW5kZXgsCisgICAgICAgICByb3ctPmVuZC5kcHZlY19pbmRleCk7CisgICAgfQorICBp ZiAoZ2x5cGhzID4gMSkKKyAgICB7CisgICAgICBmb3IgKGludCBhcmVhID0gTEVGVF9NQVJHSU5f QVJFQTsgYXJlYSA8IExBU1RfQVJFQTsgKythcmVhKQorICAgICAgICB7CisgICAgICAgICAgc3Ry dWN0IGdseXBoICpnbHlwaCA9IHJvdy0+Z2x5cGhzW2FyZWFdOworICAgICAgICAgIHN0cnVjdCBn bHlwaCAqZ2x5cGhfZW5kID0gZ2x5cGggKyByb3ctPnVzZWRbYXJlYV07CisgICAgICAgICAgLyog R2x5cGggZm9yIGEgbGluZSBlbmQgaW4gdGV4dC4gKi8KKyAgICAgICAgICBpZiAoYXJlYSA9PSBU RVhUX0FSRUEgJiYgZ2x5cGggPT0gZ2x5cGhfZW5kICYmIGdseXBoLT5jaGFycG9zID4gMCkKKyAg ICAgICAgICAgICsrZ2x5cGhfZW5kOworICAgICAgICAgIGlmIChnbHlwaCA8IGdseXBoX2VuZCkK KyAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIkdseXBoIy9Ub3RhbCBSZWwuWCBUICAgICAg IFBvcyBPICAgVyAgICAgQ29kZSBGYWNlIExSIEhQT1MgWlYgQ1xuIik7CisgICAgICAgICAgZm9y ICg7IGdseXBoIDwgZ2x5cGhfZW5kOyArK2dseXBoKQorICAgICAgICAgICAgeworICAgICAgICAg ICAgICBtY19kdW1wX2dseXBoIChyb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB2cG9zKTsK KyAgICAgICAgICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAg ICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZiAoZ2x5cGhzID09IDEpCisgICAg ICB7CisgICAgICAgIGNoYXIgc1tTSFJUX01BWCArIDRdOworICAgICAgICBmb3IgKGludCBhcmVh ID0gTEVGVF9NQVJHSU5fQVJFQTsgYXJlYSA8IExBU1RfQVJFQTsgKythcmVhKQorICAgICAgICAg IHsKKyAgICAgICAgICAgIGludCBpOworICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHJvdy0+ dXNlZFthcmVhXTsgKytpKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RydWN0 IGdseXBoICpnbHlwaCA9IHJvdy0+Z2x5cGhzW2FyZWFdICsgaTsKKyAgICAgICAgICAgICAgICBp ZiAoaSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICYmIGFyZWEg PT0gVEVYVF9BUkVBCisgICAgICAgICAgICAgICAgICAgICYmIE5JTFAgKGdseXBoLT5vYmplY3Qp CisgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAg ICAgICAgICAgICAgICAgJiYgZ2x5cGgtPnUuY2ggPT0gJyAnKQorICAgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgICBzdHJjcHkgKCZzW2ldLCAiW1xcbl0iKTsKKyAgICAgICAg ICAgICAgICAgICAgaSArPSA0OworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAg ICAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgZ2x5cGgtPnUuY2ggPCAweDgwCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBnbHlwaC0+dS5jaCA+PSAnICcpCisgICAgICAgICAgICAgICAgICAgIHNbaV0gPSBnbHlw aC0+dS5jaDsKKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAg IHNbaV0gPSAnLic7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHNbaV0gPSAnXDAnOwor ICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiJTNkOiAoJWQpICclcydcbiIsIHZwb3MsIHJv dy0+ZW5hYmxlZF9wLCBzKTsKKyAgICAgICAgICB9CisgICAgICB9Cit9CisKK0RFRlVOICgibWMt ZHVtcC1nbHlwaC1yb3ciLCBGbWNfZHVtcF9nbHlwaF9yb3csIFNtY19kdW1wX2dseXBoX3Jvdywg MSwgMiwgIlAiLAorICAgICAgIGRvYzogLyogRHVtcCBnbHlwaCByb3cgUk9XIHRvIHN0ZGVyci4K K0ludGVyYWN0aXZlbHksIFJPVyBpcyB0aGUgcHJlZml4IG51bWVyaWMgYXJndW1lbnQgYW5kIGRl ZmF1bHRzIHRvCit0aGUgcm93IHdoaWNoIGRpc3BsYXlzIHBvaW50LgorT3B0aW9uYWwgYXJndW1l bnQgR0xZUEhTIDAgbWVhbnMgZG9uJ3QgZHVtcCBnbHlwaHMuCitHTFlQSFMgMSBtZWFucyBkdW1w IGdseXBocyBpbiBzaG9ydCBmb3JtLgorR0xZUEhTID4gMSBvciBvbWl0dGVkIG1lYW5zIGR1bXAg Z2x5cGhzIGluIGxvbmcgZm9ybS4gICovKQorICAoTGlzcF9PYmplY3Qgcm93LCBMaXNwX09iamVj dCBnbHlwaHMpCit7CisgIHN0cnVjdCB3aW5kb3cgKncgPSBYV0lORE9XIChzZWxlY3RlZF93aW5k b3cpOworICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsK KyAgRU1BQ1NfSU5UIHZwb3M7CisgIGlmIChOSUxQIChyb3cpKQorICAgIHsKKyAgICAgIGludCBk MSwgZDIsIGQzLCBkNCwgZDUsIHlwb3M7CisgICAgICBib29sIHZpc2libGVfcCA9IHBvc192aXNp YmxlX3AgKHcsIFBULCAmZDEsICZkMiwgJmQzLCAmZDQsICZkNSwgJnlwb3MpOworICAgICAgaW50 IGhlYWRlcl9saW5lX2hlaWdodCA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICAg ICAgaW50IHZvZmZzZXQgPSAoaGVhZGVyX2xpbmVfaGVpZ2h0ID4gMAorICAgICAgICAgICAgICAg ICAgICAgJiYgeXBvcyA+IDApCisgICAgICAgICAgICAgICAgICAgICAgPyB5cG9zICsgMQorICAg ICAgICAgICAgICAgICAgICAgIDogeXBvczsKKyAgICAgIGlmICh2aXNpYmxlX3ApCisgICAgICAg IHZwb3MgPSB2b2Zmc2V0OworICAgICAgICBlbHNlCisgICAgICAgICAgdnBvcyA9IDA7CisgICAg fQorICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgQ0hFQ0tfTlVNQkVSIChyb3cpOworICAgICAg ICB2cG9zID0gWEZJWE5VTSAocm93KTsKKyAgICAgIH0KKyAgaWYgKHZwb3MgPj0gMCAmJiB2cG9z IDwgbWF0cml4LT5ucm93cykKKyAgICBtY19kdW1wX2dseXBoX3JvdyAoTUFUUklYX1JPVyAobWF0 cml4LCB2cG9zKSwKKyAgICAgICAgdnBvcywKKyAgICAgICAgVFlQRV9SQU5HRURfRklYTlVNUCAo aW50LCBnbHlwaHMpID8gWEZJWE5VTSAoZ2x5cGhzKSA6IDIpOworICByZXR1cm4gUW5pbDsKK30K Kwordm9pZAorbWNfZHVtcF9nbHlwaF9tYXRyaXggKHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJp eCwgaW50IGdseXBocykKK3sKKyAgaW50IGk7CisgIGZvciAoaSA9IDA7IGkgPCBtYXRyaXgtPm5y b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kZXJyLCAiQ3Vyc29yIHggPSAlZCwgeSA9ICVkLCBocG9zID0g JWQsIHZwb3MgPSAlZFxuIiwKKyAgICAgdy0+Y3Vyc29yLngsIHctPmN1cnNvci55LCB3LT5jdXJz b3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MpOworICBmcHJpbnRmIChzdGRlcnIsICI9PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiIpOworICBtY19kdW1wX2dseXBo X21hdHJpeCAody0+Y3VycmVudF9tYXRyaXgsCisgICAgICAgICBUWVBFX1JBTkdFRF9GSVhOVU1Q IChpbnQsIGdseXBocykgPyBYRklYTlVNIChnbHlwaHMpIDogMCk7CisgIHJldHVybiBRbmlsOwor fQorCitib29sCittY190cmF2ZXJzZV9jYWNoZV9wIChzdHJ1Y3QgbWNfbWF0cml4IG1hdHJpeCwg ZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICBpbnQg dm50aCwgaW50IG50aCkKK3sKKyAgaWYgKHZudGggPCBtYXRyaXgudnBvc191c2VkCisgICAgICAm JiBtYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5cGVdID4gMAorICAgICAgJiYgbnRoIDwgbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXSkKKyAgICByZXR1cm4gdHJ1ZTsK KyAgICBlbHNlCisgICAgICByZXR1cm4gZmFsc2U7Cit9CisKK3ZvaWQKK21jX3Jlc2V0X2NhY2hl IChzdHJ1Y3Qgd2luZG93ICp3KQoreworICBpZiAoIUJVRkZFUlAgKHctPmNvbnRlbnRzKSkKKyAg ICByZXR1cm47CisgIGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNI RTsKKyAgICAgICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7CisgICAgICAgKytjYWNoZV90eXBlKQor ICAgIHsKKyAgICAgIGJvb2wgYnZhcl9hY3RpdmVfcDsKKyAgICAgIHN3aXRjaCAoY2FjaGVfdHlw ZSkKKyAgICAgICAgeworICAgICAgICAgIGNhc2UgTk9fQ0FDSEU6CisgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBjYXNlIE1DX0NB Q0hFOgorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAoQlVGRkVSUCAody0+Y29udGVu dHMpCisgICAgICAgICAgICAgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIG1jX2NvbmYpKSkKKyAgICAgICAgICAgICAgICBidmFyX2FjdGl2ZV9wID0gZmFsc2U7Cisg ICAgICAgICAgICAgICAgZWxzZSBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNf Y29uZikpKQorICAgICAgICAgICAgICAgICAgYnZhcl9hY3RpdmVfcCA9IHRydWU7CisgICAgICAg ICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgIGNhc2UgQ0hfQ0FDSEU6Cisg ICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAg ICAgICAgICAgICAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jv c3NoYWlycykpKQorICAgICAgICAgICAgICAgIGJ2YXJfYWN0aXZlX3AgPSBmYWxzZTsKKyAgICAg ICAgICAgICAgICBlbHNlIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAg ICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hh aXJzKSkpCisgICAgICAgICAgICAgICAgICBidmFyX2FjdGl2ZV9wID0gdHJ1ZTsKKyAgICAgICAg ICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgY2FzZSBGQ19DQUNIRToKKyAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAg ICAgICAgICAgICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192 aXNpYmxlKSkpCisgICAgICAgICAgICAgICAgYnZhcl9hY3RpdmVfcCA9IGZhbHNlOworICAgICAg ICAgICAgICAgIGVsc2UgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAg ICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2li bGUpKSkKKyAgICAgICAgICAgICAgICAgIGJ2YXJfYWN0aXZlX3AgPSB0cnVlOworICAgICAgICAg ICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKCFidmFyX2Fj dGl2ZV9wKQorICAgICAgICB7CisgICAgICAgICAgLyogRGVjcmVhc2UgdGhlIHNpemUgb2YgdGhl IGFycmF5IHRvIGEgYmFyZSBtaW5pbXVtLiAqLworICAgICAgICAgIGZvciAoaW50IHZudGggPSAw OyB2bnRoIDwgdy0+bWNfbWF0cml4LnZwb3NfdXNlZDsgKyt2bnRoKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICBpZiAody0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVk W2NhY2hlX3R5cGVdID4gMSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXSA9CisgICAgICAgICAgICAg ICAgICAgIHhucmVhbGxvYyAody0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf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SEVSRSkpCisgICAgICB7CisgICAgICAgIG1jX2RyYXdfZXJh c2VfaHlicmlkICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwg aCwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lk dGgsIGZvcmVncm91bmQsIGFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIHJlbW92ZV9wKTsKKyAgICAg ICAgcmV0dXJuOworICAgICAgfQorICBpZiAoY2FjaGVfdHlwZSA9PSBOT19DQUNIRSkKKyAgICBy ZXR1cm47CisgICsrdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90eXBlXTsKKyAgaWYg KHZudGggPj0gdy0+bWNfbWF0cml4LnZwb3NfdXNlZCkKKyAgICB3LT5tY19tYXRyaXgudnBvc191 c2VkID0gdm50aCArIDE7CisgIGlmICh3LT5tY19tYXRyaXgudnBvc19hbGxvY2F0ZWQgPCB3LT5t Y19tYXRyaXgudnBvc191c2VkKQorICAgIHsKKyAgICAgIGludCBvbGRfYWxsb2MgPSB3LT5tY19t YXRyaXgudnBvc19hbGxvY2F0ZWQ7CisgICAgICBpbnQgbmV3X2VsdHMgPSB3LT5tY19tYXRyaXgu dnBvc191c2VkIC0gdy0+bWNfbWF0cml4LnZwb3NfYWxsb2NhdGVkOworICAgICAgdy0+bWNfbWF0 cml4LnZwb3MgPSB4cGFsbG9jICh3LT5tY19tYXRyaXgudnBvcywgJnctPm1jX21hdHJpeC52cG9z X2FsbG9jYXRlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2VsdHMs IElOVF9NQVgsIHNpemVvZiAqdy0+bWNfbWF0cml4LnZwb3MpOworICAgICAgbWVtc2V0ICh3LT5t Y19tYXRyaXgudnBvcyArIG9sZF9hbGxvYywgMCwKKyAgICAgICAgICAgICAgICh3LT5tY19tYXRy aXgudnBvc19hbGxvY2F0ZWQgLSBvbGRfYWxsb2MpICogc2l6ZW9mICp3LT5tY19tYXRyaXgudnBv cyk7CisgICAgfQorICArK3ctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVf dHlwZV07CisgIGlmICh3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2Fj aGVfdHlwZV0gPCB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVd KQorICAgIHsKKyAgICAgIGludCBvbGRfYWxsb2MgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV07CisgICAgICBpbnQgbmV3X2VsdHMgPSB3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdIC0gdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVkW2NhY2hlX3R5cGVdOworICAgICAgdy0+bWNfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV0gPSB4cGFsbG9jICh3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlX2FsbG9jYXRlZFtjYWNoZV90eXBlXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2VsdHMsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElOVF9NQVgsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNp emVvZiAqdy0+bWNfb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aGVycyBhcmUgUk9XLT5WSVNJQkxFX0hFSUdIVC4KKyAgICAg ICBGSVhNRTogIEFkZCBjb25kaXRpb25zIGZvciB1c2VyLXNwZWNpZmllZCB0aGlja25lc3Mgb2Yg TUNfQkFSIGFuZAorICAgICAgICAgICAgICAgTUNfSEJBUiBhcyB0byBgbWMtcmVhbC1mYWtlLWN1 cnNvcicuCisgICBNVUxUSVBMRV9DVVJTT1JTOiAgV2UgZG8gbm90IHVzZSB0aGlzIGZ1bmN0aW9u LgorICAgSE9SSVpPTlRBTF9SVUxFUjogIFdlIHdhbnQgYSB1bml2ZXJzYWwgRlkgY29vcmRpbmF0 ZSBmb3IgYSBsZXZlbCBydWxlci4KKyAgIFZFUlRJQ0FMX1JVTEVSIGFuZCBGSUxMX0NPTFVNTjog IFdlIHdhbnQgYW4gSCB0aGF0IGVuc3VyZXMgbm8gZ2FwIGJldHdlZW4gdGhlCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBwcmV2aW91cy9uZXh0IGxpbmUuICBUaGUgRlggY29v cmRpbmF0ZSBpcyBzZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V3 aGVyZTogIGB3LT5jdXJzb3IueGAgLyBgbWMuZmNfeGAuICovCit2b2lkCittY19nZXRfY3Vyc29y X2dlb21ldHJ5IChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgs CisgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCB4LCBp bnQgKmZ4LCBpbnQgeSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCAqZnksIGludCBocG9z LCBpbnQgdnBvcywgaW50ICpoLAorICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJz b3JfdHlwZSBjdXJzb3JfdHlwZSwgaW50IGN1cnNvcl93aWR0aCwKKyAgICAgICAgICAgICAgICAg ICAgICAgIGludCAqd2QpCit7CisgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSBtY19nZXRfY3Vyc29y X2dseXBoICh3LCBtYXRyaXgsIHJvdywgaHBvcywgdnBvcyk7CisgIGlmIChnbHlwaCA9PSBOVUxM KQorICAgIHJldHVybjsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUg KHcpKTsKKyAgKmZ4ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgeCk7CisgICpo ID0gcm93LT52aXNpYmxlX2hlaWdodDsKKyAgLyogRG9uJ3QgbGV0IHRoZSBjdXJzb3IgZXhjZWVk IHRoZSBkaW1lbnNpb25zIG9mIHRoZSByb3csIHNvIHRoYXQKKyAgdGhlIHVwcGVyL2xvd2VyIHNp ZGUgb2YgdGhlIGJveCBhcmVuJ3QgY2xpcHBlZC4gICovCisgIGludCB3X2hlYWRlcl9saW5lX2hl aWdodCA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICBpbnQgd190ZXh0X2JvdHRv bV95ID0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpIC0gKmg7CisgIGlmICh5IDwgd19oZWFkZXJf bGluZV9oZWlnaHQpCisgICAgeworICAgICAgKmggPSBtYXggKCpoIC0gKHdfaGVhZGVyX2xpbmVf aGVpZ2h0IC0geSkgKyAxLCAqaCk7CisgICAgICB5ID0gd19oZWFkZXJfbGluZV9oZWlnaHQgLSAx OworICAgICAgLy8gZnByaW50ZiAoc3RkZXJyLCAiQ09ORElUSU9OICMgMVxuIik7CisgICAgfQor ICAgZWxzZSBpZiAoeSA+IHdfdGV4dF9ib3R0b21feSkKKyAgICAgeworICAgICAgICpoICs9IHkg LSB3X3RleHRfYm90dG9tX3k7CisgICAgICAgeSA9IHdfdGV4dF9ib3R0b21feTsKKyAgICAgICAv LyBmcHJpbnRmIChzdGRlcnIsICJDT05ESVRJT04gIyAyXG4iKTsKKyAgICAgfQorICAqZnkgPSBX SU5ET1dfVE9fRlJBTUVfUElYRUxfWSAodywgeSk7CisgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCisg ICAgeworICAgICAgY2FzZSBNQ19CQVI6CisgICAgICAgIHsKKyAgICAgICAgICBpZiAoY3Vyc29y X3dpZHRoIDwgMSkKKyAgICAgICAgICAgIGN1cnNvcl93aWR0aCA9IG1heCAoRlJBTUVfQ1VSU09S X1dJRFRIIChmKSwgMSk7CisgICAgICAgICAgaWYgKGN1cnNvcl93aWR0aCA8IGdseXBoLT5waXhl bF93aWR0aCkKKyAgICAgICAgICAqd2QgPSBjdXJzb3Jfd2lkdGg7CisgICAgICAgICAgYnJlYWs7 CisgICAgICAgIH0KKyAgICAgIGNhc2UgTUNfSEJBUjoKKyAgICAgICAgeworICAgICAgICAgIGlu dCBjdXJzb3JfaGVpZ2h0ID0gKGN1cnNvcl93aWR0aCA8IDEpID8gbHJpbnQgKDAuMjUgKiAqaCkg OiBjdXJzb3Jfd2lkdGg7CisgICAgICAgICAgaWYgKGN1cnNvcl9oZWlnaHQgPiByb3ctPmhlaWdo dCkKKyAgICAgICAgICAgIGN1cnNvcl9oZWlnaHQgPSByb3ctPmhlaWdodDsKKyAgICAgICAgICAv KiBDdXJzb3Igc21hbGxlciB0aGFuIGxpbmUgaGVpZ2h0LCBzbyBtb3ZlIGRvd24uICovCisgICAg ICAgICAgaWYgKCpoID4gY3Vyc29yX2hlaWdodCkKKyAgICAgICAgICAgICpmeSArPSAqaCAtIGN1 cnNvcl9oZWlnaHQ7CisgICAgICAgICAgKmggPSBjdXJzb3JfaGVpZ2h0OworICAgICAgICAgICp3 ZCA9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAg ICAgY2FzZSBNQ19SSUdIVF9GUklOR0VfQklUTUFQOgorICAgICAgY2FzZSBNQ19MRUZUX0ZSSU5H RV9CSVRNQVA6CisgICAgICBjYXNlIE1DX05PX0ZSSU5HRV9CS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fVEVYVF9UT19GUkFNRV9QSVhFTF9YICh3LCBl c3NlbnRpYWxzLmZjX3gpOworICBib29sIGdseXBoX3p2X3AgPSAoZ2x5cGggLSByb3ctPmdseXBo c1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAg ICYmIE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgPT0gWlYpOworICBzdHJ1Y3QgZnJhbWUg KmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgTGlzcF9PYmplY3QgYnVmID0gdy0+Y29udGVudHM7 CisgIENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKGJ1 Zik7CisgIGludCB0ZXh0X2FyZWFfd2lkdGggPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FS RUEpOworICBzdHJ1Y3QgZ2x5cGhfcm93ICpjdXJzb3Jfcm93ID0gKHctPmN1cnNvci52cG9zICE9 IC0xKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XIChjdXJz b3JfbWF0cml4LCB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogTlVMTDsKKyAgc3RydWN0IGdseXBoICpjdXJzb3JfZ2x5cGggPSAody0+Y3Vyc29yLnZw b3MgIT0gLTEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY19nZXRfY3Vyc29y X2dseXBoICh3LCBjdXJzb3JfbWF0cml4LCBjdXJzb3Jfcm93LAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLmhwb3MsIHctPmN1 cnNvci52cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTlVMTDsKKyAgYm9v bCBjdXJzb3JfYXRfZnJpbmdlX3AgPSAoY3Vyc29yX2dseXBoID09IE5VTEwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3JvdyAhPSBOVUxMCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID09IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9B UkVBXQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93LT5leGFjdF93 aW5kb3dfd2lkdGhfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1 cnNvci54ID09IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiB3LT5jdXJzb3IueCA9PSBjdXJzb3Jfcm93LT5waXhlbF93aWR0aCk7CisgIGJvb2wgY3Vyc29y X2JleW9uZF9mcmluZ2VfcCA9IChjdXJzb3JfZ2x5cGggPT0gTlVMTAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3JvdyAhPSBOVUxMCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBjdXJzb3Jfcm93LT51c2VkW1RF WFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFjdXJzb3Jfcm93 LT5leGFjdF93aW5kb3dfd2lkdGhfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5jdXJzb3IueCA+PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IGN1cnNvcl9yb3ctPnBpeGVsX3dpZHRo KTsKKyAgaW50IGZyYW1lX2NoYXJfd2lkdGggPSBGUkFNRV9DT0xVTU5fV0lEVEggKGYpOworICBp bnQgdGVtcF9mYWNlX2lkID0gZ2x5cGgtPmZhY2VfaWQ7CisgIHN0cnVjdCBtY19SR0IgYmFja2dy b3VuZDsKKyAgbWNfc2V0X2xzbF9iZyAodywgdGVtcF9mYWNlX2lkLCAmYmFja2dyb3VuZCk7Cisg IGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKG9wb2ludF94ID09IHJlbGF0aXZlX3gKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X2hwb3MgPT0gaHBvcworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeSA9PSByb3ctPnkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgb3BvaW50X3Zwb3MgPT0gdnBvcyk7CisKKy8qIC0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgIEJFR0lOOiAgQ0hBUl9HTFlQSCB8 IEdMWVBITEVTU19HTFlQSCAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KKyAgaWYgKGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgIHx8IGdseXBoLT50 eXBlID09IEdMWVBITEVTU19HTFlQSCkKKyAgeworICAgIGlmIChtY19zdGRlcnJfcCkKKyAgICAg IGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQi ZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICAlM2QgJXMgJXNcbiIsCisgICAgICAgIGds eXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0g PT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisg ICAgICAgIChnbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAgICA/ICdDJworICAgICAg ICAgOiAnRycpLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGds eXBoLT5vYmplY3QpCisgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgt Pm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+ b2JqZWN0KQorICAgICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAor ICAgICAgICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIGdseXBoLT51LmNoLAor ICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwK KyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9zLCBn bHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nIChnbHlw aC0+dS5jaCkpOworICBzd2l0Y2ggKGFjdGlvbl90eXBlKQorICB7CisvKiAtLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgTVVMVElQTEVfQ1VSU09SUzogIENIQVJfR0xZUEgg fCBHTFlQSExFU1NfR0xZUEggICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t ICovCisgICAgY2FzZSBNVUxUSVBMRV9DVVJTT1JTOgorICAgIHsKKyAgICAgIG1jX2hlbHBlciAo dywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3Ms CisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3Jl Z3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9w LCBNQ19HTFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLCBjYWNoZV90eXBlLAorICAgICAgICAgICAg ICAgICBhY3Rpb25fdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgSE9SSVpPTlRBTF9SVUxFUjogIENIQVJfR0xZUEgg fCBHTFlQSExFU1NfR0xZUEggICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t ICovCisgICAgY2FzZSBIT1JJWk9OVEFMX1JVTEVSOgorICAgIHsKKyAgICAgIGlmIChyZWxhdGl2 ZV94IDwgcm93LT5waXhlbF93aWR0aAorICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3Ap CisgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBm eCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90 eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAg ICAgICAgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwg Y2FjaGVfdHlwZSwKKyAgICAgICAgICAgICAgICAgICBhY3Rpb25fdHlwZSk7CisgICAgICBpZiAo Z2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAg ICAgICAgICAmJiByZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAgIHsKKyAgICAgICAgICBp ZiAocmVsYXRpdmVfeCA8IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICB7CisgICAgICAg ICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICBm eCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgICAgbWNfaGVs cGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywg dnBvcywKKyAgICAgICAgICAgICAgICAgICAgIHhfbGltaXQgLSByZWxhdGl2ZV94LCBoLCBjdXJz b3JfdHlwZSwgY3Vyc29yX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZCwg YmFja2dyb3VuZCwgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEhMRVNTLAorICAgICAgICAg ICAgICAgICAgICAgZHJhd19wLCBmcm9tX3doZXJlLCBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7 CisgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAq LworLyogICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIENIQVJfR0xZUEggfCBHTFlQSExF U1NfR0xZUEggICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAg ICBjYXNlIFZFUlRJQ0FMX1JVTEVSOgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBo X2ZsYXZvciA9IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiByb3ctPmNvbnRpbnVlZF9wKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+Y29udGludWVkX3AKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdo dF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FM X0JBUgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2Zy aW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRy dW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9C QVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1 cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXSAhPSAxCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNB TF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoIC0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeCA+PSByb3ctPnBpeGVsX3dpZHRo KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfenZfcCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfR0xZUEg7CisgICAgICBpZiAoZ2x5cGhf Zmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBo X2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJ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b3IgPSAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09 IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBlc3NlbnRpYWxzLmZjX3ggPj0gcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogKGdseXBoX3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6ICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBvcG9pbnRfeSA9PSB5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBvcG9pbnRfdnBvcyA9PSB2cG9zKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIHdkID0gMTsKKyAgICAgIG1jX2hlbHBlciAo dywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmY19meCwgeSwgZnksIGhwb3MsIHZw b3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBm b3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFjd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S0tLS0tLS0tLS0tLS0tLSAqLworICBlbHNlIGlmIChnbHlwaC0+ dHlwZSA9PSBTVFJFVENIX0dMWVBIKQorICB7CisgICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAg ZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiXG4gJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJk ICVjICUzZCAweCUwNnggJTRkICUxLjFkJTEuMWQgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5 cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9 PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAg ICAgICAgJ1MnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGds eXBoLT5vYmplY3QpCisgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgt Pm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+ b2JqZWN0KQorICAgICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAor ICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIDB1LAorICAgICAgICBnbHlwaC0+ ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgt PnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpW IiA6ICItLSIsCisgICAgICAgICJcXFMiKTsKKyAgc3dpdGNoIChhY3Rpb25fdHlwZSkKKyAgewor LyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0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xfd2lkdGgKKyAgICAgICAgICAmJiAhcmVh bF9mYWtlX2N1cnNvcl9wKQorICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlw aCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAg IHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5k LAorICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3 X3AsIGZyb21fd2hlcmUsIGNhY2hlX3R5cGUsCisgICAgICAgICAgICAgICAgICAgYWN0aW9uX3R5 cGUpOworICAgICAgaWYgKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVz ZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYgcmVsYXRpdmVfeCA8PSB4X2xpbWl0KQorICAgICAg ICB7CisgICAgICAgICAgaWYgKHJlbGF0aXZlX3ggPCByb3ctPnBpeGVsX3dpZHRoKQorICAgICAg ICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgdGVtcF9m YWNlX2lkID0gKHJvdy0+ZmlsbF9saW5lX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgPyBn bHlwaC0+ZmFjZV9pZAorICAgICAgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lE OworICAgICAgICAgIHN0cnVjdCBtY19SR0IgYmFja2dyb3VuZDsKKyAgICAgICAgICBtY19zZXRf bHNsX2JnICh3LCB0ZW1wX2ZhY2VfaWQsICZiYWNrZ3JvdW5kKTsKKyAgICAgICAgICBtY19oZWxw ZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2 cG9zLAorICAgICAgICAgICAgICAgICAgICAgeF9saW1pdCAtIHJlbGF0aXZlX3gsIGgsIGN1cnNv cl90eXBlLCB4X2xpbWl0IC0gcmVsYXRpdmVfeCwKKyAgICAgICAgICAgICAgICAgICAgIGZvcmVn cm91bmQsIGJhY2tncm91bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBITEVTUywKKyAg ICAgICAgICAgICAgICAgICAgIGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwgYWN0aW9u X3R5cGUpOworICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIFNU UkVUQ0hfR0xZUEggICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t ICovCisgICAgY2FzZSBWRVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAgICBpZiAocm93LT5maWxs X2xpbmVfcAorICAgICAgICAgICYmIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSBy b3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYgb3BvaW50X3ggPiByZWxhdGl2ZV94ICsg Z2x5cGgtPnBpeGVsX3dpZHRoKQorICAgICAgICB0ZW1wX2ZhY2VfaWQgPSBnbHlwaC0+ZmFjZV9p ZDsKKyAgICAgICAgZWxzZSBpZiAoIXJvdy0+ZmlsbF9saW5lX3AKKyAgICAgICAgICAgICAgICAg JiYgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEK KyAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3ggPiByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVs X3dpZHRoKQorICAgICAgICAgIHRlbXBfZmFjZV9pZCA9IERFRkFVTFRfRkFDRV9JRDsKKyAgICAg IHN0cnVjdCBtY19SR0IgYmFja2dyb3VuZDsKKyAgICAgIG1jX3NldF9sc2xfYmcgKHcsIHRlbXBf ZmFjZV9pZCwgJmJhY2tncm91bmQpOworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9y ID0gKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVk X29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNf VkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IChjdXJzb3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdI VF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2Jl eW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg Y3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSExFU1M7CisgICAg ICBpZiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAg ICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJS T1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFT SAorICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAg ICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICBj dXJzb3JfdHlwZSA9IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA7CisgICAgICB3ZCA9IDE7CisgICAg ICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHl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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVORDogIFNUUkVUQ0hfR0xZUEggICAgICAgICAg ICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisKKy8qIC0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCRUdJTjog IElNQUdFX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0gKi8KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgIHsK KyAgICBpZiAobWNfc3RkZXJyX3ApCisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICJc biAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4x ZCAgJTNkICVzICVjXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0s CisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAt IDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAnSScsCisgICAgICAgIGdseXBoLT5j aGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0In CisgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycK KyAgICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICA/ICcw JworICAgICAgICAgICAgICAgOiAnLScpKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwK KyAgICAgICAgKHVuc2lnbmVkIGludCkgZ2x5cGgtPnUuaW1nX2lkLAorICAgICAgICBnbHlwaC0+ ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgt PnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpW IiA6ICItLSIsCisgICAgICAgICcuJyk7CisgIHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsKKy8q IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgTVVMVElQ TEVfQ1VSU09SUzogIElNQUdFX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIE1VTFRJUExFX0NVUlNPUlM6CisgICAgeworICAg ICAgY3Vyc29yX3R5cGUgPSBNQ19IT0xMT1dfQk9YOworICAgICAgbWNfaGVscGVyICh3LCBtYXRy aXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAg ICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQs IGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dM WVBILCBkcmF3X3AsIGZyb21fd2hlcmUsIGNhY2hlX3R5cGUsCisgICAgICAgICAgICAgICAgIGFj dGlvbl90eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAq LworLyogICAgICAgICAgICAgICAgICAgICAgICAgSE9SSVpPTlRBTF9SVUxFUjogIElNQUdFX0dM WVBIICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAg ICBjYXNlIEhPUklaT05UQUxfUlVMRVI6CisgICAgeworICAgICAgY3Vyc29yX3R5cGUgPSBNQ19I T0xMT1dfQk9YOworICAgICAgaWYgKCFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hl bHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3Ms IHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lk dGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgICAgZXNzZW50aWFs cy5hY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwKKyAg ICAgICAgICAgICAgICAgICBhY3Rpb25fdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAt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tLS0tLS0tLS0tLS0tLS0tICovCisKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLwor LyogICAgICAgICAgICAgICAgICAgICAgICAgICAgQkVHSU46ICBDT01QT1NJVEVfR0xZUEggICAg ICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgZWxz ZSBpZiAoZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKQorICB7CisgICAgaWYgKG1jX3N0 ZGVycl9wKQorICAgICAgeworICAgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICAgIlxu ICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4IiwKKyAgICAgICAgICBn bHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgKChyb3ctPnVzZWRbYXJl YV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgICAgcmVsYXRpdmVf eCwKKyAgICAgICAgICAnKycsCisgICAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgICAg KEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgID8gJ0InCisgICAgICAgICAgIDog KFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAg ICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICAgID8gJzAnCisgICAg ICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAg ICAgICAgICAodW5zaWduZWQgaW50KSBnbHlwaC0+dS5jbXAuaWQpOworICAgICAgICBmcHJpbnRm IChzdGRlcnIsICIgJTRkICUxLjFkJTEuMWQiLAorICAgICAgICAgIGdseXBoLT5mYWNlX2lkLAor ICAgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgICAgZ2x5cGgtPnJpZ2h0 X2JveF9saW5lX3ApOworICAgICAgaWYgKGdseXBoLT51LmNtcC5hdXRvbWF0aWMpCisgICAgICAg IGZwcmludGYgKHN0ZGVyciwgIiAgJTNkICVzIC4gWyVkLSVkXVxuIiwKKyAgICAgICAgICAgICAg ICAgICAgICAgICBnbHlwaC0+aHBvcywgZ2x5cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAg ICAgICAgICAgICAgICAgICAgIGdseXBoLT5zbGljZS5jbXAuZnJvbSwgZ2x5cGgtPnNsaWNlLmNt cC50byk7CisgICAgICAgIGVsc2UKKyAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJcbiIpOwor ICAgICAgfQorICBzd2l0Y2ggKGFjdGlvbl90eXBlKQorICB7CisvKiAtLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTOiAgQ09NUE9T SVRFX0dMWVBIICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICov CisgICAgY2FzZSBNVUxUSVBMRV9DVVJTT1JTOgorICAgIHsKKyAgICAgIG1jX2hlbHBlciAodywg bWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisg ICAg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UpOworICAgICAgaWYgKGdseXBoIC0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYg cmVsYXRpdmVfeCA8PSB4X2xpbWl0KQorICAgICAgICB7CisgICAgICAgICAgcmVsYXRpdmVfeCAr PSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgd2hpbGUgKHJlbGF0aXZlX3ggPD0geF9s aW1pdCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgs IHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAg ICAgICAgICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdy b3VuZCwgYmFja2dyb3VuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFj dGl2ZV9wLCBNQ19HTFlQSExFU1MsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAg ICAgICAgICAgICBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICAgICAgICAgIHJlbGF0 aXZlX3ggKz0gZnJhbWVfY2hhcl93aWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAg ICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAg ICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIENPTVBPU0lURV9HTFlQSCAgICAgICAgICAg ICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgVkVSVElDQUxf UlVMRVI6CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1cnNv cl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJv dy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g TUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0 X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxf QkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChj dXJzb3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmlu Z2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jv dy0+dXNlZFtURVhUX0FSRUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FS RUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIG9wb2ludF94ID49IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF96dl9wKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfVkVS VElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JF VkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZv ciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9y ID09IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgI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IHJlbGF0aXZlX3gpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IChnbHlwaF96dl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1D X0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoIU5JTFAg KEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfdmVydGljYWxf cnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50 X3kgPT0geQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50 X3Zwb3MgPT0gdnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBN Q19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfR0xZ UEg7CisgICAgICB3ZCA9IDE7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlw aCwgcmVsYXRpdmVfeCwgZmNfZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAg ICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYmFja2dyb3Vu ZCwKKyAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCBk cmF3X3AsIGZyb21fd2hlcmUsIGNhY2hlX3R5cGUsCisgICAgICAgICAgICAgICAgIGFjdGlvbl90 eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0t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KyAgICBpZiAobWNfc3RkZXJyX3ApCisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAg ICJcbiAgJTVkLyUtNWQgJTVkICU0YyAlNmQgJWMgJTNkIDB4JTA1eCAlNGQgJTEuMWQlMS4xZCAg JTNkICVzICVjXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisg ICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEp LAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAnWCcsCisgICAgICAgIGdseXBoLT5jaGFy cG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0InCisg ICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAg ICAgICAgICAgIDogJy0nKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAg Z2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAg IGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+dS54d2lkZ2V0LAorICAg ICAgICBnbHlwaC0+aHBvcywgZ2x5cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAnLicp OworI2VuZGlmCisgIHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTOiAgWFdJ REdFVF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0g Ki8KKyAgICBjYXNlIE1VTFRJUExFX0NVUlNPUlM6CisgICAgeworICAgICAgbWNfaGVscGVyICh3 LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywK KyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVn cm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZlX3As IE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUsIGNhY2hlX3R5cGUsCisgICAgICAgICAgICAg ICAgIGFjdGlvbl90eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICBIT1JJWk9OVEFMX1JVTEVSOiAgWFdJ REdFVF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0g Ki8KKyAgICBjYXNlIEhPUklaT05UQUxfUlVMRVI6CisgICAgeworICAgICAgaWYgKHJlbGF0aXZl X3ggPD0geF9saW1pdAorICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAg IG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnks IGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJz b3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgICAgZXNz ZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlw ZSwKKyAgICAgICAgICAgICAgICAgICBhY3Rpb25fdHlwZSk7CisgICAgICBpZiAoZ2x5cGggLSBy b3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAm JiByZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAgIHsKKyAgICAgICAgICByZWxhdGl2ZV94 ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICB3aGlsZSAocmVsYXRpdmVfeCA8PSB4 X2xpbWl0KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJp eCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAg ICAgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3Jl Z3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMu YWN0aXZlX3AsIE1DX0dMWVBITEVTUywgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAg ICAgICAgICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgICAgICAgICAgcmVs YXRpdmVfeCArPSBmcmFtZV9jaGFyX3dpZHRoOworICAgICAgICAgICAgfQorICAgICAgICB9Cisg ICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAg ICAgICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIFhXSURHRVRfR0xZUEggICAgICAgICAg ICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBWRVJUSUNB TF9SVUxFUjoKKyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoY3Vy c29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg cm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmICFyb3ctPmNvbnRpbnVlZF9wCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmln aHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNB TF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog KGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9X CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5b25kX2Zy aW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jf cm93LT51c2VkW1RFWFRfQVJFQV0gIT0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRf QVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgb3BvaW50X3ggPj0gcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX3p2X3ApCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19W RVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gT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W51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGds eXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID4gcmVs YXRpdmVfeCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQ SExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX3p2X3Ap CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICghTklMUCAoQlZBUiAoYiwgY3Jv c3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklM UCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeSA9PSB5CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfdnBvcyA9PSB2cG9z KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIG1j X2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmY19meCwgeSwgZnks IGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29y X3dpZHRoLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICBlc3NlbnRp YWxzLmFjdG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AgICAgICAgICAgICAgICAgICB2cG9zLCBkcmF3X3AgPyAieSIgOiAibiIsIGhw b3Nfc3RhcnQsIGhwb3NfbGVuZ3RoKTsKKyAgTGlzcF9PYmplY3QgYnVmID0gdy0+Y29udGVudHM7 CisgIENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKGJ1 Zik7CisgIGludCBvcG9pbnRfZngsIG9wb2ludF9meSwgb3BvaW50X3dkLCBvcG9pbnRfaDsKKyAg aW50IHRleHRfYXJlYV93aWR0aCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7Cisg IGludCBoZWFkZXJfbGluZV9mb3JtYXQgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsK KyAgc3RydWN0IGdseXBoX3JvdyAqY3Vyc29yX3JvdyA9ICh3LT5jdXJzb3IudnBvcyAhPSAtMSkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPVyAoY3Vyc29yX21h dHJpeCwgdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IE5VTEw7CisgIHN0cnVjdCBnbHlwaCAqY3Vyc29yX2dseXBoID0gKHctPmN1cnNvci52cG9zICE9 IC0xKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfZ2V0X2N1cnNvcl9nbHlw aCAodywgY3Vyc29yX21hdHJpeCwgY3Vyc29yX3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3Iu dnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgIGJvb2wgY3Vy c29yX2F0X2ZyaW5nZV9wID0gKGN1cnNvcl9nbHlwaCA9PSBOVUxMCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIGN1cnNvcl9yb3cgIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0K KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+ZXhhY3Rfd2luZG93 X3dpZHRoX2xpbmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3Iu eCA9PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+ Y3Vyc29yLnggPT0gY3Vyc29yX3Jvdy0+cGl4ZWxfd2lkdGgpOworICBib29sIGN1cnNvcl9iZXlv bmRfZnJpbmdlX3AgPSAoY3Vyc29yX2dseXBoID09IE5VTEwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIGN1cnNvcl9yb3cgIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FS RUFdCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhY3Vyc29yX3Jvdy0+ZXhh Y3Rfd2luZG93X3dpZHRoX2xpbmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgdy0+Y3Vyc29yLnggPj0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA+PSBjdXJzb3Jfcm93LT5waXhlbF93aWR0aCk7Cisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgUkVQTEFD RSBUSEUgUkVBTCBDVVJTT1IKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICBlbnVtIGZhY2Vf aWQgYmdfZmFjZV9pZCA9IChjdXJzb3JfZ2x5cGggIT0gTlVMTCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IGN1cnNvcl9nbHlwaC0+ZmFjZV9pZAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICBzdHJ1Y3QgbWNfUkdCIGN1cnNvcl9iZzsKKyAg bWNfc2V0X2xzbF9iZyAodywgYmdfZmFjZV9pZCwgJmN1cnNvcl9iZyk7CisgIC8qIEZJWE1FOiAg UHV0IGluIHNvbWUgY29kZSB0byBkZWZhdWx0IHRvIE1DX0hPTExPV19CT1ggaWYgdGhlIHVzZXIg aGFzCisgIHVud2l0dGluZ2x5IGNvbWUgdXAgd2l0aCBzb21lIHVuYWNjZXB0YWJsZSBmb3JtIG9m IHVucmVjb2duaXplZCBjdXJzb3IgdHlwZS4gKi8KKyAgTGlzcF9PYmplY3QgbGlzcF90eXBlID0g QlZBUiAoYiwgbWNfcmVhbF9mYWtlX2N1cnNvcik7CisgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vy c29yX3R5cGUgPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBtY19saXNwX3RvX2N1cnNvcl90eXBlIChYQ0FSIChsaXNwX3R5cGUp KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogbWNfbGlzcF90b19j dXJzb3JfdHlwZSAobGlzcF90eXBlKTsKKyAgaW50IGN1cnNvcl93aWR0aCA9IChDT05TUCAobGlz cF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgID8gWEZJWE5VTSAoWENBUiAoWENEUiAobGlz cF90eXBlKSkpCisgICAgICAgICAgICAgICAgICAgICA6IC0xOworICBzdHJ1Y3QgbWNfUkdCIGN1 cnNvcl9mZzsKKyAgbWNfY29sb3JfcGlja2VyICh3LCBjdXJzb3JfZ2x5cGgsIGVzc2VudGlhbHMs ICZjdXJzb3JfZmcsIC0xLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICByb3df cG9zaXRpb24sIENVUlNPUl9JTkRJQ0FUT1IpOworICBib29sIGZpbGxfY29sdW1uX3RydW1wc19w ID0gKCFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNf dmlzaWJsZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLngg PT0gZXNzZW50aWFscy5mY194CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIWN1 cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFjdXJz b3JfYmV5b25kX2ZyaW5nZV9wKTsKKyAgLyogV2UgdXNlIGEgdGVzdCBzaW1pbGFyIHRvIHRoZSBy ZWFsIGZha2UgY3Vyc29yIHNvIHRoYXQgdGhlIGZyaW5nZSBiaXRtYXAgaXMKKyAgb25seSBkcmF3 biBvbmNlIHBlciB3aW5kb3cuICovCisgIGlmICh2cG9zID09IHctPmN1cnNvci52cG9zCisgICAg ICAmJiBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGggPT0gcm93LT51c2VkW1RFWFRfQVJFQV0KKyAg ICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQor ICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaG9yaXpvbnRh bF9ydWxlcikpKQorICAgIHsKKy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SAodywgbWF0cml4LCByb3csIHctPmN1cnNvci54LCAmb3BvaW50X2Z4LCB3LT5j dXJzb3IueSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZvcG9pbnRfZnksIHctPmN1 cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgTUNfQkFSLCAxLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywg bWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vy c29yLnksCisgICAgICAgICAgICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1 cnNvci52cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9oLAorICAgICAgICAgICAgICAgICBNQ19CQVIs IDEsIGN1cnNvcl9mZywgY3Vyc29yX2JnLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBNQ19HTFlQSExF U1MsCisgICAgICAgICAgICAgICAgIGRyYXdfcCwgZnJvbV93aGVyZSwgTklMUCAoQlZBUiAoWEJV RkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IENIX0NBQ0hFCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBNQ19DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgICBtY19nZXRfY3Vyc29yX2dl b21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRfZngsIHctPmN1cnNv ci55LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF9meSwgdy0+Y3Vyc29y Lmhwb3MsIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBNQ19IQkFSLCAxLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0 cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vyc29y LnksCisgICAgICAgICAgICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNv ci52cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9oLAorICAgICAgICAgICAgICAgICBNQ19IQkFSLCAx LCBjdXJzb3JfZmcsIGN1cnNvcl9iZywgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEgsIGRy YXdfcCwKKyAgICAgICAgICAgICAgICAgZnJvbV93aGVyZSwgTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBD SF9DQUNIRQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0NBQ0hFLCBDVVJTT1Jf SU5ESUNBVE9SKTsKKyAgICB9CisgIGVsc2UgaWYgKCFjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAg ICAgICAgJiYgY3Vyc29yX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5j dXJzb3IudnBvcworICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA+PSBocG9zX3N0YXJ0Cisg ICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoCisg ICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+dHlwZSAhPSBTVFJFVENIX0dMWVBIKQorICAgIHsK KyAgICAgIG1jX2dldF9jdXJzb3JfZ2VvbWV0cnkgKHcsIG1hdHJpeCwgcm93LCB3LT5jdXJzb3Iu eCwgJm9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MsICZvcG9pbnRfaCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgs ICZvcG9pbnRfd2QpOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgY3Vyc29yX2ds eXBoLCB3LT5jdXJzb3IueCwgb3BvaW50X2Z4LCB3LT5jdXJzb3IueSwKKyAgICAgICAgICAgICAg ICAgb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MsIG9wb2ludF93ZCwg b3BvaW50X2gsCisgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGN1 cnNvcl9mZywgY3Vyc29yX2JnLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLAorICAgICAgICAgICAgICAg ICBNQ19HTFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLCBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIG1jX2NvbmYpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IENIX0NBQ0hFCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogTUNfQ0FDSEUsIENVUlNPUl9JTkRJQ0FUT1IpOworICAgIH0KKyAgZWxz ZSBpZiAoIWN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGggIT0g TlVMTAorICAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICYm IHctPmN1cnNvci5ocG9zID49IGhwb3Nfc3RhcnQKKyAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhw b3MgPCBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGgKKyAgICAgICAgICAgJiYgY3Vyc29yX2dseXBo LT50eXBlID09IFNUUkVUQ0hfR0xZUEgpCisgICAgeworICAgICAgLyogSWYgYSB1c2VyIGhhcyBz ZXQgYHgtc3RyZXRjaC1jdXJzb3InIHRvIGEgbm9uLW5pbCB2YWx1ZSwgaGUvc2hlIGNob3NlIHRv CisgICAgICBoYXZlIGEgY3Vyc29yIHRoYXQgc3BhbnMgdGhlIGVudGlyZSBsZW5ndGggb2YgdGhl IFNUUkVUQ0hfR0xZUEguICovCisgICAgICBpZiAoIXhfc3RyZXRjaF9jdXJzb3JfcCkKKyAgICAg ICAgeworICAgICAgICAgIC8qIFRoZSBNQ19IQkFSIHNoYWxsIGhhdmUgYSBgY3Vyc29yX3dpZHRo YCBvZiAxLiAqLworICAgICAgICAgIG1jX2dldF9jdXJzb3JfZ2VvbWV0cnkgKHcsIG1hdHJpeCwg cm93LCB3LT5jdXJzb3IueCwgJm9wb2ludF9meCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICB3LT5jdXJzb3IueSwgJm9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLnZwb3MsICZvcG9pbnRfaCwgTUNf SEJBUiwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmb3BvaW50X3dkKTsK KyAgICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1 cnNvci54LCBvcG9pbnRfZngsCisgICAgICAgICAgICAgICAgICAgICB3LT5jdXJzb3IueSwgb3Bv aW50X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MsCisgICAgICAgICAgICAgICAg ICAgICBvcG9pbnRfd2QsIG9wb2ludF9oLCBNQ19IQkFSLCAxLCBjdXJzb3JfZmcsIGN1cnNvcl9i ZywKKyAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBk cmF3X3AsIGZyb21fd2hlcmUsCisgICAgICAgICAgICAgICAgICAgICBOSUxQIChCVkFSIChYQlVG RkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAgICAgICAgICAgICAgICAgPyBDSF9D QUNIRQorICAgICAgICAgICAgICAgICAgICAgOiBNQ19DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7 CisgICAgICAgIH0KKyAgICAgIG1jX2dldF9jdXJzb3JfZ2VvbWV0cnkgKHcsIG1hdHJpeCwgcm93 LCB3LT5jdXJzb3IueCwgJm9wb2ludF9meCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHctPmN1cnNvci55LCAmb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsIGN1cnNvcl90eXBlLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoLCAmb3BvaW50X3dkKTsK KyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29y LngsIG9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAgICAgICAgIG9wb2ludF9meSwg dy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9oLAorICAg ICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBjdXJzb3JfZmcsIGN1cnNv cl9iZywgZXNzZW50aWFscy5hY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgTUNfR0xZUEgsIGRy YXdfcCwgZnJvbV93aGVyZSwgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19j b25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBD SF9DQUNIRQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IE1DX0NBQ0hFLCBDVVJTT1JfSU5ESUNBVE9SKTsKKyAgICB9CisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgRFJBVyBBTkQgUkVDT1JEIEZBS0UgQ1VS U09SUworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisgIGlmIChocG9zX2xlbmd0aCA9PSAxKQor ICAgIHsKKyAgICAgIGlmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19j b25mKSkpCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUaGUgc3BhY2UgYXBwZW5kZWQgdG8gYSBy b3cgZW5kaW5nIHdpdGggYSBuZXcgbGluZQorICAgICAgICAgIGRvZXMgbm90IGhhdmUgYSBgZ2x5 cGgtPmNoYXJwb3NgICgtMSwgMCkgdGhhdCB3ZSBjYW4KKyAgICAgICAgICB1c2UgZm9yIHRoaXMg cGFydGljdWxhciBhcHBsaWNhdGlvbi4gIFdoZW4gdGhlcmUgaXMgYQorICAgICAgICAgIGBidWZm ZXItZGlzcGxheS10YWJsZScgZW50cnkgdGhhdCBhc3NpZ25zIGEgdmlzaWJsZQorICAgICAgICAg IGdseXBoIHRvIGEgbmV3IGxpbmUsIHRoZXJlIGlzIG5vIHByb2JsZW0gYmVjYXVzZSB0aGF0Cisg ICAgICAgICAgZ2x5cGggaGFzIGEgYGdseXBoLT5jaGFycG9zJyB0aGF0IHdlIGNhbiB1c2UuICBX aGVuCisgICAgICAgICAgbm8gdmlzaWJsZSBFT0wgZ2x5cGggZXhpc3RzLCB3ZSB1c2UgdGhlIGZv bGxvd2luZworICAgICAgICAgIHRlc3Q6ICB0aGUgYXBwZW5kZWQgc3BhY2UgaGFzIGEgcG9zaXRp b24gdGhhdCBpcyBvbmUKKyAgICAgICAgICBsZXNzIHRoYW4gdGhlIGVuZCBvZiB0aGUgbWF0cml4 IHJvdy4gKi8KKyAgICAgICAgICBpbnQgaHBvcyA9IHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9B UkVBXTsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnByZXZpb3VzX2dseXBoID0gKDAgPD0gaHBv cyAtIDEgJiYgaHBvcyAtIDEgPCByb3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgaHBv cyAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOVUxMOwor ICAgICAgICAgIC8vIHN0cnVjdCBnbHlwaCAqbGFzdF9nbHlwaCA9IHJvdy0+Z2x5cGhzW1RFWFRf QVJFQV0gKyByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDE7CisgICAgICAgICAgYm9vbCBza2lwX3Ag PSAocHJldmlvdXNfZ2x5cGggIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICYmIHBy ZXZpb3VzX2dseXBoLT5jaGFycG9zID09IE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgLSAx CisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgc3RhcnQtPmJ5dGVwb3MgIT0gZXNzZW50aWFs cy56dl9ieXRlKQorICAgICAgICAgICAgICAgICAgICAgICAgICA/IHRydWUKKyAgICAgICAgICAg ICAgICAgICAgICAgIC8qIFdoZW4gYSBgYnVmZmVyLWRpc3BsYXktdGFibGUnIGVudHJ5IGNvbnRh aW5zCisgICAgICAgICAgICAgICAgICAgICAgICBhIHZpc2libGUgdGFiIGNoYXJhY3RlciAoIsK7 IiksIHRoZSBzdWJzZXF1ZW50CisgICAgICAgICAgICAgICAgICAgICAgICBTVFJFVENIX0dMWVBI IHdpbGwgaGF2ZSB0aGUgc2FtZSBzdGFydC0+Y2hhcnBvcworICAgICAgICAgICAgICAgICAgICAg ICAgYXMgdGhlIGFmb3JlbWVudGlvbmVkIHZpc2libGUgdGFiIGNoYXJhY3Rlci4gKi8KKyAgICAg ICAgICAgICAgICAgICAgICAgIDogKHByZXZpb3VzX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHByZXZpb3VzX2dseXBoLT5jaGFycG9zID09IHN0YXJ0LT5jaGFy cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICA/IHRydWUKKyAgICAgICAgICAgICAgICAg ICAgICAgIDogZmFsc2U7CisgICAgICAgICAgaW50IHBvc2ludCA9IChyb3dfcG9zaXRpb24gPT0g UE9TVF9aVikKKyAgICAgICAgICAgICAgICAgICAgICAgICA/IC0xCisgICAgICAgICAgICAgICAg ICAgICAgIDogKHJvd19wb3NpdGlvbiA9PSBBVF9aVikKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBlc3NlbnRpYWxzLnp2CisgICAgICAgICAgICAgICAgICAgICAgIDogKHN0YXJ0LT5ieXRl cG9zICE9IGVzc2VudGlhbHMuenZfYnl0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBz dGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW1RFWFRfQVJFQV0gLSAx KQorICAgICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93 KSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgOiAoc3RhcnQtPmJ5dGVwb3MgPT0gZXNzZW50 aWFscy56dl9ieXRlCisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHN0YXJ0IC0gcm93LT5n bHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpCisgICAgICAgICAg ICAgICAgICAgICAgICAgPyBlc3NlbnRpYWxzLnp2CisgICAgICAgICAgICAgICAgICAgICAgIDog c3RhcnQtPmNoYXJwb3M7CisgICAgICAgICAgTGlzcF9PYmplY3Qgc3BlY3MgPSBtY19hc3NvYyAo bWFrZV9maXhudW0gKHBvc2ludCksIEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29u ZikpOworICAgICAgICAgIGlmICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDAp CisgICAgICAgICAgICAgICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAg ICAgJiYgIU5JTFAgKHNwZWNzKQorICAgICAgICAgICAgICAmJiByb3ctPnkgPD0gd2luZG93X3Rl eHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICYmICFza2lwX3AKKyAgICAgICAgICAgICAg JiYgcm93X3Bvc2l0aW9uICE9IFBPU1RfWlYpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAg IExpc3BfT2JqZWN0IGxpc3BfdHlwZSA9IG1jX250aCAoMSwgc3BlY3MpOworICAgICAgICAgICAg ICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlID0gKENPTlNQIChsaXNwX3R5cGUpKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY19saXNw X3RvX2N1cnNvcl90eXBlIChYQ0FSIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBtY19saXNwX3RvX2N1cnNvcl90eXBlIChsaXNw X3R5cGUpOworICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IChzdGFydC0+dHlwZSA9PSBJTUFH RV9HTFlQSCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0hPTExPV19CT1gKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IGN1cnNvcl90eXBlOworICAgICAgICAgICAgICBp bnQgY3Vyc29yX3dpZHRoID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBYRklYTlVNIChYQ0FSIChYQ0RSIChsaXNwX3R5cGUpKSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogLTE7CisgICAgICAgICAgICAgIExpc3BfT2Jq ZWN0IG1jX2ZvcmVncm91bmQgPSBtY19udGggKDIsIHNwZWNzKTsKKyAgICAgICAgICAgICAgc3Ry dWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgICAgIGlmIChTVFJJTkdQIChtY19mb3JlZ3Jv dW5kKSkKKyAgICAgICAgICAgICAgICBtY194d19jb2xvcl92YWx1ZXMgKHcsIG1jX2ZvcmVncm91 bmQsICZsc2xfZmcpOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKFZFQ1RPUlAgKG1jX2ZvcmVn cm91bmQpKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBsc2xfZmcu cmVkID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDApKTsKKyAgICAgICAgICAg ICAgICAgICAgbHNsX2ZnLmdyZWVuID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQs IDEpKTsKKyAgICAgICAgICAgICAgICAgICAgbHNsX2ZnLmJsdWUgPSBYRkxPQVRfREFUQSAoQVJF RiAobWNfZm9yZWdyb3VuZCwgMikpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICAgICAgZWxzZSBpZiAoTklMUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAgICAg IG1jX2NvbG9yX3BpY2tlciAodywgc3RhcnQsIGVzc2VudGlhbHMsICZsc2xfZmcsIHBvc2ludCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgcm93 X3Bvc2l0aW9uLCBNVUxUSVBMRV9DVVJTT1JTKTsKKyAgICAgICAgICAgICAgaW50IHZwb3MgPSBN QVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgICAgICAgICAgICAgaW50IHhfbGltaXQg PSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOworICAgICAgICAgICAgICBtY19lbmdp bmUgKHcsIG1hdHJpeCwgcm93LCBzdGFydCwgVEVYVF9BUkVBLCB4LCB4X2xpbWl0LCByb3ctPnks CisgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFd LCB2cG9zLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lk dGgsIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwKKyAgICAgICAgICAg ICAgICAgICAgICAgICBsc2xfZmcsIE1VTFRJUExFX0NVUlNPUlMsIGRyYXdfcCwgZnJvbV93aGVy ZSwgTUNfQ0FDSEUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBpZiAoIU5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgJiYg ZXNzZW50aWFscy5mY194IDw9IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICYmIGVzc2VudGlh bHMuZmNfeCA+PSB3LT5tYy5sbnVtX3BpeGVsX3dpZHRoKQorICAgICAgICB7CisgICAgICAgICAg aW50IHhfbGltaXQgPSB4ICsgc3RhcnQtPnBpeGVsX3dpZHRoOworICAgICAgICAgIGJvb2wgcmVh bF9mYWtlX2N1cnNvcl9wID0gKHctPmN1cnNvci54ID09IGVzc2VudGlhbHMuZmNfeAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci55ID09IHJvdy0+eQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID09 IHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPmN1cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAgIHN0cnVj dCBtY19SR0IgbHNsX2ZnOworICAgICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywgc3RhcnQsIGVz c2VudGlhbHMsICZsc2xfZmcsIC0xLCBNQ19CQVIsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICByb3dfcG9zaXRpb24sIEZJTExfQ09MVU1OKTsKKyAgICAgICAgICBpZiAoeCArIHN0YXJ0 LT5waXhlbF93aWR0aCA8PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgJiYgKChoZWFk ZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgICAgfHwgaGVh ZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAgICYmICgoc3RhcnQgIT0gcm93LT5n bHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMQorICAgICAgICAgICAg ICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSB4CisgICAgICAgICAgICAgICAgICAgJiYgZXNz ZW50aWFscy5mY194IDwgeCArIHN0YXJ0LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAg IHx8IChzdGFydCA9PSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJF QV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID49IHgpKQor ICAgICAgICAgICAgICAmJiByb3ctPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAg ICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgICAgICBtY19lbmdpbmUg KHcsIG1hdHJpeCwgcm93LCBzdGFydCwgVEVYVF9BUkVBLCB4LCB4X2xpbWl0LCByb3ctPnksCisg ICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwgdnBv cywgTUNfQkFSLCAxLAorICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBlc3Nl bnRpYWxzLCByb3dfcG9zaXRpb24sIGxzbF9mZywKKyAgICAgICAgICAgICAgICAgICAgICAgRklM TF9DT0xVTU4sIGRyYXdfcCwgZnJvbV93aGVyZSwgRkNfQ0FDSEUpOworICAgICAgICB9CisgICAg ICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisg ICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2hvcml6b250YWxfcnVsZXIpKQorICAgICAg ICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgIHsKKyAgICAgICAgICBpbnQg eF9saW1pdCA9IChzdGFydCA9PSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RF WFRfQVJFQV0gLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgPyB0ZXh0X2FyZWFfd2lkdGgK KyAgICAgICAgICAgICAgICAgICAgICAgIDogeCArIHN0YXJ0LT5waXhlbF93aWR0aDsKKyAgICAg ICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICBtY19jb2xvcl9waWNrZXIgKHcs IHN0YXJ0LCBlc3NlbnRpYWxzLCAmbHNsX2ZnLCAtMSwgTUNfSEJBUiwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgSE9SSVpPTlRBTF9SVUxFUik7CisgICAgICAg ICAgLyogUHJlc2VydmUgc3VwcG9ydCBmb3IgZGVmYXVsdCBiZWhhdmlvciBzdWNoIHRoYXQgYSB1 c2VyIG1heQorICAgICAgICAgIHNwZWNpZnkgdGhlIGhlaWdodCBvZiBhbiBNQ19IQkFSLCB3aGlj aCBiZWdpbnMgaXRzIGpvdXJuZXkKKyAgICAgICAgICBhcyB0aGUgYGN1cnNvcl93aWR0aCcuICBg bWNfZ2V0X2N1cnNvcl9nZW9tZXRyeScgcmVhZGp1c3RzLiAqLworICAgICAgICAgIG1jX2VuZ2lu ZSAodywgbWF0cml4LCByb3csIHN0YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGltaXQsIHJvdy0+eSwK KyAgICAgICAgICAgICAgICAgICAgIHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwgdnBv cywgTUNfSEJBUiwgMSwKKyAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2Vu dGlhbHMsIHJvd19wb3NpdGlvbiwgbHNsX2ZnLAorICAgICAgICAgICAgICAgICAgICAgSE9SSVpP TlRBTF9SVUxFUiwgZHJhd19wLCBmcm9tX3doZXJlLCBDSF9DQUNIRSk7CisgICAgICAgIH0KKyAg ICAgIGlmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkK KyAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAg ICAgICYmICFmaWxsX2NvbHVtbl90cnVtcHNfcCkKKyAgICAgICAgeworICAgICAgICAgIGN1cnNv cl90eXBlID0gKHN0YXJ0LT50eXBlID09IElNQUdFX0dMWVBIKQorICAgICAgICAgICAgICAgICAg ICAgICAgPyBNQ19IT0xMT1dfQk9YCisgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0JBUjsK KyAgICAgICAgICBpbnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7 CisgICAgICAgICAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3AgPSAody0+Y3Vyc29yLnkgPT0gcm93 LT55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnZw b3MgPT0gdnBvcyk7CisgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAg bWNfY29sb3JfcGlja2VyICh3LCBzdGFydCwgZXNzZW50aWFscywgJmxzbF9mZywgLTEsIGN1cnNv cl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93X3Bvc2l0aW9uLCBWRVJU SUNBTF9SVUxFUik7CisgICAgICAgICAgaWYgKCgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2 cG9zID4gMCkKKyAgICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAg ICAgICAgICAgICAmJiAoKHN0YXJ0ICE9IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVz ZWRbVEVYVF9BUkVBXSAtIDEKKyAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA+PSB4 CisgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPCB4ICsgc3RhcnQtPnBpeGVsX3dp ZHRoKQorICAgICAgICAgICAgICAgICAgfHwgKHN0YXJ0ID09IHJvdy0+Z2x5cGhzW1RFWFRfQVJF QV0gKyByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5jdXJzb3IueCA+PSB4KSkKKyAgICAgICAgICAgICAgJiYgcm93LT55IDw9IHdpbmRvd190ZXh0 X2JvdHRvbV95ICh3KQorICAgICAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAg ICAgICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgc3RhcnQsIFRFWFRfQVJFQSwgeCwg eF9saW1pdCwgcm93LT55LAorICAgICAgICAgICAgICAgICAgICAgICBzdGFydCAtIHJvdy0+Z2x5 cGhzW1RFWFRfQVJFQV0sIHZwb3MsIGN1cnNvcl90eXBlLCAxLAorICAgICAgICAgICAgICAgICAg ICAgICBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGxzbF9mZywKKyAg ICAgICAgICAgICAgICAgICAgICAgVkVSVElDQUxfUlVMRVIsIGRyYXdfcCwgZnJvbV93aGVyZSwg Q0hfQ0FDSEUpOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAg aW50IHJlbGF0aXZlX3ggPSAwOworICAgICAgICBmb3IgKGludCBhcmVhID0gTEVGVF9NQVJHSU5f QVJFQTsgYXJlYSA8IExBU1RfQVJFQTsgKythcmVhKQorICAgICAgICAgIHsKKyAgICAgICAgICAg IHN0cnVjdCBnbHlwaCAqZ2x5cGggPSByb3ctPmdseXBoc1thcmVhXTsKKyAgICAgICAgICAgIHN0 cnVjdCBnbHlwaCAqZ2x5cGhfZW5kID0gZ2x5cGggKyByb3ctPnVzZWRbYXJlYV07CisgICAgICAg ICAgICAvKiBHbHlwaCBmb3IgYSBsaW5lIGVuZCBpbiB0ZXh0LiAqLworICAgICAgICAgICAgaWYg KGFyZWEgPT0gVEVYVF9BUkVBICYmIGdseXBoID09IGdseXBoX2VuZCAmJiBnbHlwaC0+Y2hhcnBv cyA+IDApCisgICAgICAgICAgICAgICsrZ2x5cGhfZW5kOworICAgICAgICAgICAgZm9yICg7IGds eXBoIDwgZ2x5cGhfZW5kOyArK2dseXBoKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAg ICAgaWYgKHZwb3MgIT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAgICAgICAgICAgICAgJiYgZ2x5 cGggIT0gZ2x5cGhfZW5kIC0gMQorICAgICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZj X3ggPCByZWxhdGl2ZV94CisgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54IDwgcmVs YXRpdmVfeAorICAgICAgICAgICAgICAgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIG1jX2NvbmYpKSkKKyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAg ICAgICAgIGlmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkp CisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8qIFRoZSBzcGFjZSBh cHBlbmRlZCB0byBhIHJvdyBlbmRpbmcgd2l0aCBhIG5ldyBsaW5lIGRvZXMKKyAgICAgICAgICAg ICAgICAgICAgbm90IGhhdmUgYSBgZ2x5cGgtPmNoYXJwb3NgICgtMSwgMCkgdGhhdCB3ZSBjYW4g dXNlIGZvciB0aGlzCisgICAgICAgICAgICAgICAgICAgIHBhcnRpY3VsYXIgYXBwbGljYXRpb24u ICBXaGVuIGEgYGJ1ZmZlci1kaXNwbGF5LXRhYmxlJyBlbnRyeQorICAgICAgICAgICAgICAgICAg ICBhc3NpZ25zIGEgdmlzaWJsZSBnbHlwaCB0byBhIG5ldyBsaW5lLCB0aGVyZSBpcyBubyBwcm9i bGVtCisgICAgICAgICAgICAgICAgICAgIGJlY2F1c2UgdGhhdCBnbHlwaCBoYXMgYSBgZ2x5cGgt PmNoYXJwb3MnIHRoYXQgd2UgY2FuIHVzZS4KKyAgICAgICAgICAgICAgICAgICAgV2hlbiBubyB2 aXNpYmxlIEVPTCBnbHlwaCBleGlzdHMsIHdlIHVzZSB0aGUgZm9sbG93aW5nIHRlc3Q6CisgICAg ICAgICAgICAgICAgICAgIHRoZSBhcHBlbmRlZCBzcGFjZSBoYXMgYSBwb3NpdGlvbiB0aGF0IGlz IG9uZSBsZXNzIHRoYW4gdGhlCisgICAgICAgICAgICAgICAgICAgIGVuZCBvZiB0aGUgbWF0cml4 IHJvdy4gKi8KKyAgICAgICAgICAgICAgICAgICAgaW50IGhwb3MgPSBnbHlwaCAtIHJvdy0+Z2x5 cGhzW1RFWFRfQVJFQV07CisgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqcHJldmlv dXNfZ2x5cGggPSAoMCA8PSBocG9zIC0gMSAmJiBocG9zIC0gMSA8IHJvdy0+dXNlZFtURVhUX0FS RUFdKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgaHBvcyAtIDEKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTlVMTDsKKyAgICAgICAgICAgICAgICAg ICAgLy8gc3RydWN0IGdseXBoICpsYXN0X2dseXBoID0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSAr IHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMTsKKyAgICAgICAgICAgICAgICAgICAgYm9vbCBza2lw X3AgPSAocHJldmlvdXNfZ2x5cGggIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBwcmV2aW91c19nbHlwaC0+Y2hhcnBvcyA9PSBNQVRSSVhfUk9XX0VORF9DSEFS UE9TIChyb3cpIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlw aC0+Ynl0ZXBvcyAhPSBlc3NlbnRpYWxzLnp2X2J5dGUpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IHRydWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAv KiBXaGVuIGEgYGJ1ZmZlci1kaXNwbGF5LXRhYmxlJyBlbnRyeSBjb250YWlucworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGEgdmlzaWJsZSB0YWIgY2hhcmFjdGVyICgiwrsiKSwg dGhlIHN1YnNlcXVlbnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTVFJFVENI X0dMWVBIIHdpbGwgaGF2ZSB0aGUgc2FtZSBnbHlwaC0+Y2hhcnBvcworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGFzIHRoZSBhZm9yZW1lbnRpb25lZCB2aXNpYmxlIHRhYiBjaGFy YWN0ZXIuICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAocHJldmlvdXNf Z2x5cGggIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHBy ZXZpb3VzX2dseXBoLT5jaGFycG9zID09IGdseXBoLT5jaGFycG9zKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyB0cnVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgaW50IHBvc2ludCA9IChyb3dfcG9z aXRpb24gPT0gUE9TVF9aVikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAt MQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAocm93X3Bvc2l0aW9uID09IEFU X1pWKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBlc3NlbnRpYWxzLnp2 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaC0+Ynl0ZXBvcyAhPSBl c3NlbnRpYWxzLnp2X2J5dGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbVEVYVF9BUkVBXSAt IDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPV19FTkRf Q0hBUlBPUyAocm93KSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGds eXBoLT5ieXRlcG9zID09IGVzc2VudGlhbHMuenZfYnl0ZQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+ dXNlZFtURVhUX0FSRUFdIC0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBlc3NlbnRpYWxzLnp2CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGdseXBo LT5jaGFycG9zOworICAgICAgICAgICAgICAgICAgICBMaXNwX09iamVjdCBzcGVjcyA9IG1jX2Fz c29jIChtYWtlX2ZpeG51bSAocG9zaW50KSwgQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBt Y19jb25mKSk7CisgICAgICAgICAgICAgICAgICAgIGlmICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+ IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVf Zm9ybWF0ID09IDApCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoc3BlY3MpCisg ICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kg KHcpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAhc2tpcF9wCisgICAgICAgICAgICAgICAg ICAgICAgICAmJiByb3dfcG9zaXRpb24gIT0gUE9TVF9aVikKKyAgICAgICAgICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgICAgICAgICBMaXNwX09iamVjdCBsaXNwX3R5cGUgPSBtY19u dGggKDEsIHNwZWNzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5 cGUgY3Vyc29yX3R5cGUgPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY19saXNwX3RvX2N1cnNv cl90eXBlIChYQ0FSIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogbWNfbGlzcF90b19jdXJzb3JfdHlwZSAobGlz cF90eXBlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlID0gKGdseXBoLT50 eXBlID09IElNQUdFX0dMWVBIKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IE1DX0hPTExPV19CT1gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiBjdXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGgg PSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBYRklYTlVNIChYQ0FSIChYQ0RSIChsaXNwX3R5cGUpKSkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IC0xOworICAgICAgICAgICAgICAgICAg ICAgICAgTGlzcF9PYmplY3QgbWNfZm9yZWdyb3VuZCA9IG1jX250aCAoMiwgc3BlY3MpOworICAg ICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgICAg ICAgICAgICAgICBpZiAoU1RSSU5HUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAg ICAgICAgICAgIG1jX3h3X2NvbG9yX3ZhbHVlcyAodywgbWNfZm9yZWdyb3VuZCwgJmxzbF9mZyk7 CisgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKFZFQ1RPUlAgKG1jX2ZvcmVncm91 bmQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGxzbF9mZy5yZWQgPSBYRkxPQVRfREFUQSAoQVJFRiAobWNfZm9yZWdyb3VuZCwg MCkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNsX2ZnLmdyZWVuID0gWEZMT0FU X0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDEpKTsKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGxzbF9mZy5ibHVlID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDIp KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgZWxzZSBpZiAoTklMUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBtY19jb2xvcl9waWNrZXIgKHcsIGdseXBoLCBlc3NlbnRpYWxzLCAmbHNsX2Zn LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3Np bnQsIGN1cnNvcl90eXBlLCByb3dfcG9zaXRpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIE1VTFRJUExFX0NVUlNPUlMpOworICAgICAgICAgICAg ICAgICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAg ICAgICAgICAgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0aCAodywg VEVYVF9BUkVBKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4 LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICB4X2xpbWl0LCByb3ctPnksIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVB XSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdnBvcywgY3Vyc29yX3R5cGUs IGN1cnNvcl93aWR0aCwgY3Vyc29yX21hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBsc2xfZmcsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIE1VTFRJUExFX0NVUlNPUlMsIGRyYXdfcCwgZnJvbV93aGVy ZSwgTUNfQ0FDSEUpOworICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA8 PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194 ID49IHctPm1jLmxudW1fcGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAg ICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVB KTsKKyAgICAgICAgICAgICAgICAgICAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3AgPSAody0+Y3Vy c29yLnggPT0gZXNzZW50aWFscy5mY194CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci55ID09IHJvdy0+eQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBnbHlw aCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnZwb3MgPT0gdnBvcyk7CisgICAgICAgICAg ICAgICAgICAgIGludCBocG9zID0gZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAg ICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICAgICAgICAg ICAgbWNfY29sb3JfcGlja2VyICh3LCBnbHlwaCwgZXNzZW50aWFscywgJmxzbF9mZywgLTEsIE1D X0JBUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb3dfcG9zaXRp b24sIEZJTExfQ09MVU1OKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGhwb3MgPj0gaHBvc19z dGFydAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA8IGhwb3Nfc3RhcnQgKyBocG9z X2xlbmd0aAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgcmVsYXRpdmVfeCArIGdseXBoLT5w aXhlbF93aWR0aCA8PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICYm ICgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID4gMCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICYmICgoZ2x5cGggIT0gZ2x5cGhfZW5kIC0gMQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPj0gcmVsYXRpdmVfeAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPCByZWxhdGl2ZV94ICsgZ2x5cGgtPnBp eGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChnbHlwaCA9PSBnbHlw aF9lbmQgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMu ZmNfeCA+PSByZWxhdGl2ZV94KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+eSA8 PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICFy ZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgICAgICAgICAgICAgICAgbWNfZW5naW5lICh3LCBt YXRyaXgsIHJvdywgZ2x5cGgsIGFyZWEsIHJlbGF0aXZlX3gsIHhfbGltaXQsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICByb3ctPnksIGhwb3MsIHZwb3MsIE1DX0JBUiwgMSwgY3Vy c29yX21hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMs IHJvd19wb3NpdGlvbiwgbHNsX2ZnLCBGSUxMX0NPTFVNTiwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGRyYXdfcCwgZnJvbV93aGVyZSwgRkNfQ0FDSEUpOworICAgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgICAgIGlmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIg KGIsIGNoX2hvcml6b250YWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAmJiB2cG9zID09 IHctPmN1cnNvci52cG9zKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg ICBpbnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAgICAg ICAgICAgICAgICAgIGludCBocG9zID0gZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdOwor ICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICAgICAg ICAgICAgbWNfY29sb3JfcGlja2VyICh3LCBnbHlwaCwgZXNzZW50aWFscywgJmxzbF9mZywgLTEs IE1DX0hCQVIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93X3Bv c2l0aW9uLCBIT1JJWk9OVEFMX1JVTEVSKTsKKyAgICAgICAgICAgICAgICAgICAgLyogUHJlc2Vy dmUgc3VwcG9ydCBmb3IgZGVmYXVsdCBiZWhhdmlvciBzdWNoIHRoYXQgYSB1c2VyIG1heQorICAg ICAgICAgICAgICAgICAgICBzcGVjaWZ5IHRoZSBoZWlnaHQgb2YgYW4gTUNfSEJBUiwgd2hpY2gg YmVnaW5zIGl0cyBqb3VybmV5CisgICAgICAgICAgICAgICAgICAgIGFzIHRoZSBgY3Vyc29yX3dp ZHRoJy4gIGBtY19nZXRfY3Vyc29yX2dlb21ldHJ5JyByZWFkanVzdHMuICovCisgICAgICAgICAg ICAgICAgICAgIGlmIChocG9zID49IGhwb3Nfc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgICAg ICYmIGhwb3MgPCBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGgpCisgICAgICAgICAgICAgICAgICAg ICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIGFyZWEsIHJlbGF0aXZlX3gsIHhf bGltaXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb3ctPnksIGhwb3MsIHZw b3MsIE1DX0hCQVIsIDEsIGN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGxzbF9mZywgSE9SSVpPTlRBTF9SVUxF UiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdfcCwgZnJvbV93aGVyZSwg Q0hfQ0FDSEUpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICghTklM UCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAg ICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAg ICAgICAgICAgICAgJiYgIWZpbGxfY29sdW1uX3RydW1wc19wKQorICAgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IChnbHlwaC0+dHlwZSA9PSBJTUFH RV9HTFlQSCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0hPTExPV19C T1gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0JBUjsKKyAgICAgICAg ICAgICAgICAgICAgaW50IHhfbGltaXQgPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEp OworICAgICAgICAgICAgICAgICAgICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9ICh3LT5jdXJz b3IueSA9PSByb3ctPnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgdy0+Y3Vyc29yLnZwb3MgPT0gdnBvcyk7CisgICAgICAgICAgICAgICAgICAgIGlu dCBocG9zID0gZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgICAgICAg ICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICAgICAgICAgICAgbWNfY29sb3Jf cGlja2VyICh3LCBnbHlwaCwgZXNzZW50aWFscywgJmxzbF9mZywgLTEsIGN1cnNvcl90eXBlLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgVkVS VElDQUxfUlVMRVIpOworICAgICAgICAgICAgICAgICAgICBpZiAoaHBvcyA+PSBocG9zX3N0YXJ0 CisgICAgICAgICAgICAgICAgICAgICAgICAmJiBocG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVu Z3RoCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAg JiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVf Zm9ybWF0ID09IDApCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoKGdseXBoICE9IGdseXBo X2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0g cmVsYXRpdmVfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA8 IHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgfHwgKGdseXBoID09IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0gcmVsYXRpdmVfeCkpCisgICAgICAgICAgICAgICAg ICAgICAgICAmJiByb3ctPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAgICAgICAg ICAgICAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAgICAgICAgICAg ICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4 X2xpbWl0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT55LCBocG9zLCB2 cG9zLCBjdXJzb3JfdHlwZSwgMSwgY3Vyc29yX21hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgbHNsX2ZnLCBWRVJUSUNBTF9S VUxFUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdfcCwgZnJvbV93aGVy ZSwgQ0hfQ0FDSEUpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJlbGF0 aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICB9CisgICAgICAgICAg fQorICAgICAgfQorICAvLyAgY2xvY2tfdCBjbG9ja19lbmQgPSBjbG9jaygpOworICAvLyAgZG91 YmxlIGNwdV90aW1lX3VzZWQgPSAoKGRvdWJsZSkgKGNsb2NrX2VuZCAtIGNsb2NrX3N0YXJ0KSkg LyBDTE9DS1NfUEVSX1NFQzsKKyAgLy8gIGZwcmludGYgKHN0ZGVyciwgIm1jX2RyYXdfcm93ICgl cyk6ICBUSU1FICglZilcbiIsIG1jX3dpbmRvdyAodyksIGNwdV90aW1lX3VzZWQpOworfQorCiti b29sCittY19yZWRyYXdfcm93IChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4 ICptYXRyaXgsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKKyAgICAgICAgICAgICAgIGVudW0gZ2x5 cGhfcm93X2FyZWEgYXJlYSwgaW50IHN0YXJ0X3gsIGludCBzdGFydF9ocG9zLCBpbnQgZW5kX2hw b3MsCisgICAgICAgICAgICAgICBib29sIGNsZWFyX2VvbF9wLCBlbnVtIGRyYXdfZ2x5cGhzX2Zh Y2UgaGwsCisgICAgICAgICAgICAgICBlbnVtIG1jX3JlZHJhd19yb3dfdHlwZSBmcm9tX3doZXJl KQoreworICBib29sIGdvX3AgPSAoKHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbTUNfQ0FDSEVd ID4gMAorICAgICAgICAgICAgICAgIHx8IHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbQ0hfQ0FD SEVdID4gMAorICAgICAgICAgICAgICAgIHx8IHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbRkNf Q0FDSEVdID4gMCkKKyAgICAgICAgICAgICAgICYmIGFyZWEgPT0gVEVYVF9BUkVBCisgICAgICAg ICAgICAgICAmJiByb3ctPnVzZWRbYXJlYV0pOworICBpZiAoIWdvX3ApCisgICAgcmV0dX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NBQ0hFOworICAg ICAgICsrY2FjaGVfdHlwZSkKKyAgICB7CisgICAgICBmb3IgKGludCBudGggPSAwOworICAgICAg ICAgICBtY190cmF2ZXJzZV9jYWNoZV9wICh3LT5tY19tYXRyaXgsIGNhY2hlX3R5cGUsIHZudGgs IG50aCk7CisgICAgICAgICAgICsrbnRoKQorICAgICAgICB7CisgICAgICAgICAgaW50IHggPSB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLng7CisgICAgICAg ICAgaW50IGZ4ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XS5meDsKKyAgICAgICAgICBpbnQgeSA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF0ueTsKKyAgICAgICAgICBpbnQgZnkgPSB3LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZ5OworICAgICAgICAgIGludCBocG9zID0gdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5ocG9zOworICAgICAg ICAgIGludCB2cG9zID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXS52cG9zOworICAgICAgICAgIGludCB3ZCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF0ud2Q7CisgICAgICAgICAgaW50IGggPSB3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmg7CisgICAgICAgICAgZW51bSBtY19j dXJzb3JfdHlwZSBjdXJzb3JfdHlwZSA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF0uY3Vyc29yX3R5cGU7CisgICAgICAgICAgaW50IGN1cnNvcl93aWR0aCA9 IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uY3Vyc29yX3dp ZHRoOworICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnID0gey5yZWQgPSB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZnLnJlZCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLmZnLmdyZWVuLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIC5ibHVlID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXS5mZy5ibHVlfTsKKyAgICAgICAgICAvLyAgc3RydWN0IG1jX1JHQiBsc2xfYmcgPSB7 LnJlZCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmcu cmVkLAorICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLmdyZWVuLAorICAg ICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmcuYmx1ZX07CisgICAgICAgICAgYm9v bCBhY3RpdmVfcCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF0uYWN0aXZlX3A7CisgICAgICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5nbHlwaF9mbGF2b3I7 CisgICAgICAgICAgYm9vbCBlbmFibGVkX3AgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhdLmVuYWJsZWRfcDsKKyAgICAgICAgICBpZiAodnBvcyA9PSB2bnRo CisgICAgICAgICAgICAgICYmICgoaHBvcyA+PSBzdGFydF9ocG9zCisgICAgICAgICAgICAgICAg ICAgJiYgaHBvcyA8IGVuZF9ocG9zKQorICAgICAgICAgICAgICAgICAgLyogQSBmbG9hdGluZyBj dXJzb3IgYmV5b25kIHRoZSBlbmQgb2YgdGhlIGdseXBoIHJvdy4gKi8KKyAgICAgICAgICAgICAg ICAgIHx8IChocG9zICsgMSA9PSBzdGFydF9ocG9zCisgICAgICAgICAgICAgICAgICAgICAgJiYg aHBvcyArIDEgPT0gZW5kX2hwb3MpKQorICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAg ICAgICAgICB7CisgICAgICAgICAgICAgIGJvb2wgcmVtb3ZlX3AgPSBmYWxzZTsKKyAgICAgICAg ICAgICAgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnks IGhwb3MsIHZwb3MsIHdkLCBoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg Y3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgbHNsX2ZnLCBhY3RpdmVfcCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgcmVtb3ZlX3ApOworICAgICAg ICAgICAgfQorICAgICAgICB9CisgICAgfQorICByZXR1cm4gdHJ1ZTsKKyAgLy8gIGNsb2NrX2Vu ZCA9IGNsb2NrKCk7CisgIC8vICBkb3VibGUgdGltZV9jdXJzb3JzID0gKChkb3VibGUpIChjbG9j a19lbmQgLSBjbG9ja19zdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7CisgIC8vICBmcHJpbnRmIChz dGRlcnIsICJtY19yZWRyYXdfcm93ICglZCk6ICBocG9zICglZC8lZCkgfCBnbHlwaHMgKCVmKSB8 IGN1cnNvcnMgKCVmKVxuIiwKKyAgLy8gICAgICAgICAgICAgICAgICAgdnBvcywgc3RhcnRfaHBv cywgZW5kX2hwb3MsIHRpbWVfZ2x5cGhzLCB0aW1lX2N1cnNvcnMpOworfQorCit2b2lkCittY19l cmFzZV9yb3cgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwg c3RydWN0IGdseXBoX3JvdyAqcm93KQoreworICBpbnQgdm50aCA9IE1BVFJJWF9ST1dfVlBPUyAo cm93LCBtYXRyaXgpOworICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAgZnByaW50ZiAoc3Rk ZXJyLCAibWNfZXJhc2Vfcm93ICglcyk6ICB2cG9zICglZClcbiIsIG1jX3dpbmRvdyAodyksIHZu dGgpOworICAvLyAgaWYgKHRyYWNlX3JlZGlzcGxheV9wKQorICAvLyAgICBmcHJpbnRmIChzdGRl cnIsICJtY19lcmFzZV9oZWxwZXIgKCVzKTogIGNhY2hlICglcykgfCB2cG9zICglZClcbiIsCisg IC8vICAgICAgbWNfd2luZG93ICh3KSwgbWNfY2FjaGVfdHlwZV90b19zdHJpbmcgKGNhY2hlX3R5 cGUpLCB2bnRoKTsKKyAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NB Q0hFOworICAgICAgIGNhY2hlX3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICArK2NhY2hlX3R5cGUp CisgICAgeworICAgICAgZm9yIChpbnQgbnRoID0gMDsKKyAgICAgICAgICAgbWNfdHJhdmVyc2Vf Y2FjaGVfcCAody0+bWNfbWF0cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGgpOworICAgICAgICAg ICArK250aCkKKyAgICAgICAgeworICAgICAgICAgIGludCB4ID0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS54OworICAgICAgICAgIGludCBmeCA9IHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZng7CisgICAgICAgICAg aW50IHkgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLnk7 CisgICAgICAgICAgaW50IGZ5ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXS5meTsKKyAgICAgICAgICBpbnQgaHBvcyA9IHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uaHBvczsKKyAgICAgICAgICBpbnQgdnBvcyA9IHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0udnBvczsKKyAgICAg ICAgICBpbnQgd2QgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLndkOworICAgICAgICAgIGludCBoID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXS5oOworICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29y X3R5cGUgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmN1 cnNvcl90eXBlOworICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGggPSB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmN1cnNvcl93aWR0aDsKKyAgICAgICAgICAv LyAgc3RydWN0IG1jX1JHQiBsc2xfZmcgPSB7LnJlZCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZmcucmVkLAorICAgICAgICAgIC8vICAgICAgICAgICAg ICAgICAgICAgICAgICAuZ3JlZW4gPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhdLmZnLmdyZWVuLAorICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAg ICAgICAuYmx1ZSA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF0uZmcuYmx1ZX07CisgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfYmcgPSB7LnJlZCA9IHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmcucmVkLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmcuZ3JlZW4sCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgLmJsdWUgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhdLmJnLmJsdWV9OworICAgICAgICAgIGJvb2wgYWN0aXZlX3AgPSB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmFjdGl2ZV9wOworICAg ICAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGhfZmxhdm9yOworICAgICAgICAgIGJvb2wg ZW5hYmxlZF9wID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XS5lbmFibGVkX3A7CisgICAgICAgICAgLyogYG1hdHJpeF9yb3cnIGluIGBkaXNwbmV3LmNgIGNv bnRhaW5zIHRoZSBmb2xsb3dpbmcgdGVzdHMsCisgICAgICAgICAgZWFzc2VydCAobWF0cml4ICYm IG1hdHJpeC0+cm93cyk7CisgICAgICAgICAgZWFzc2VydCAocm93ID49IDAgJiYgcm93IDwgbWF0 cml4LT5ucm93cyk7ICovCisgICAgICAgICAgYm9vbCBiYXJmX2NyYXNoX29uZSA9IChtYXRyaXgg JiYgbWF0cml4LT5yb3dzKSA/IGZhbHNlIDogdHJ1ZTsKKyAgICAgICAgICBpZiAoYmFyZl9jcmFz aF9vbmUpCisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICBib29sIGJhcmZfY3Jhc2hf dHdvID0gKHZwb3MgPj0gMCAmJiB2cG9zIDwgbWF0cml4LT5ucm93cykgPyBmYWxzZSA6IHRydWU7 CisgICAgICAgICAgaWYgKGJhcmZfY3Jhc2hfdHdvKQorICAgICAgICAgICAgY29udGludWU7Cisg ICAgICAgICAgaWYgKHZwb3MgPT0gdm50aAorICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3Ig PT0gTUNfR0xZUEgKKyAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICBtY19lcmFzZV9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCB5LCBocG9z LCB2cG9zLCBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCk7CisgICAgICAgICAgICAgIHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZW5hYmxlZF9wID0g ZmFsc2U7CisgICAgICAgICAgICAgIC0tdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90 eXBlXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKHZwb3MgPT0gdm50aAor ICAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgYm9vbCByZW1vdmVfcCA9IHRydWU7CisgICAgICAgICAgICAgICAgbWNfZHJh d19lcmFzZV9oeWJyaWQgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3Ms IHdkLCBoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlw ZSwgY3Vyc29yX3dpZHRoLCBsc2xfYmcsIGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBnbHlwaF9mbGF2b3IsIHJlbW92ZV9wKTsKKyAgICAgICAgICAgICAg ICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmVuYWJsZWRf cCA9IGZhbHNlOworICAgICAgICAgICAgICAgIC0tdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtj YWNoZV90eXBlXTsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdID0gMDsKKyAgICB9Cit9CisKKy8q IEVyYXNlIGZha2UgY3Vyc29ycyBmcm9tIChtaW4sIHJ1bi5jdXJyZW50X3ksIHJ1bi5kZXNpcmVk X3kpIHRvIGVuZCBvZiB3aW5kb3cuCisgIFRSWV9XSU5ET1dfUkVVU0lOR19DVVJSRU5UX01BVFJJ WF9ET1dOOgorICAgIHJ1bi5oZWlnaHQgPSBpdC5sYXN0X3Zpc2libGVfeSAtIHJ1bi5kZXNpcmVk X3kKKyAgICBbZW1hY3MgLXE6ICBIb2xkIHVwLWFycm93IGtleSB0cmlnZ2VyaW5nIGF1dG8tcmVj ZW50ZXIgYXQgc2Nyb2xsLW1hcmdpbi5dCisgIFRSWV9XSU5ET1dfUkVVU0lOR19DVVJSRU5UX01B VFJJWF9VUDoKKyAgICByd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bnRlbnRzKSwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgICAgICAgICAg ICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkpOwor ICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfcHJlX3Nj cm9sbF9jbGVhbiAoJXMpOlxuXAorICAlcyB8IGdvX29uZV9wICglcykgfCBnb190d29fcCAoJXMp XG5cCisgIHN0YXJ0X3Zwb3MgKCVkKSB8IG5yb3dzX3Njcm9sbGVkICglZClcblwKKyAgJXM6ICBy dW4uY3VycmVudC9kZXNpcmVkX3kgKCVkLyVkKSB8IHJ1bi5oZWlnaHQgKCVkKVxuIiwKKyAgICBt Y193aW5kb3cgKHcpLCAoZnJvbV93aGVyZSA9PSBUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9N QVRSSVhfRE9XTikKKyAgICAgICAgICAgICAgICAgICAgID8gIlRSWV9XSU5ET1dfUkVVU0lOR19D VVJSRU5UX01BVFJJWF9ET1dOIgorICAgICAgICAgICAgICAgICAgIDogKGZyb21fd2hlcmUgPT0g VFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX1VQKQorICAgICAgICAgICAgICAgICAg ICAgPyAiVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX1VQIgorICAgICAgICAgICAg ICAgICAgIDogKGZyb21fd2hlcmUgPT0gVFJZX1dJTkRPV19JRCkKKyAgICAgICAgICAgICAgICAg ICAgID8gIlRSWV9XSU5ET1dfSUQiCisgICAgICAgICAgICAgICAgICAgOiAiVU5LTk9XTiIsCisg ICAgZ29fb25lX3AgPyAieWVzIiA6ICJubyIsIGdvX3R3b19wID8gInllcyIgOiAibm8iLAorICAg IHN0YXJ0X3Zwb3MsIG5yb3dzX3Njcm9sbGVkLAorICAgIHJ1bi5jdXJyZW50X3kgPCBydW4uZGVz aXJlZF95ID8gIuKGkyIgOiAi4oaRIiwKKyAgICBydW4uY3VycmVudF95LCBydW4uZGVzaXJlZF95 LCBydW4uaGVpZ2h0KTsKKyAgaWYgKCFnb19vbmVfcCAmJiAhZ29fdHdvX3ApCisgICAgcmV0dXJu OworICBib29sIHVwZGF0aW5nX2ZyYW1lX3AgPSBmYWxzZTsKKyAgc3RydWN0IGZyYW1lICpmID0g WEZSQU1FICh3LT5mcmFtZSk7CisgIGlmIChYRlJBTUUgKHctPmZyYW1lKSAhPSBmLT5tY191cGRh dGluZ19mcmFtZQorICAgICAgJiYgKGdvX29uZV9wIHx8IGdvX3R3b19wKSkKKyAgICB7CisgICAg ICB1cGRhdGluZ19mcmFtZV9wID0gdHJ1ZTsKKyAgICAgIHVwZGF0ZV9iZWdpbiAoZik7CisgICAg fQorICBpZiAody0+cGh5c19jdXJzb3Jfb25fcAorICAgICAgJiYgZ29fdHdvX3ApCisgICAgZXJh c2VfcGh5c19jdXJzb3IgKHcpOworICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXggPSB3LT5j dXJyZW50X21hdHJpeDsKKyAgZm9yIChpbnQgdm50aCA9IHN0YXJ0X3Zwb3M7CisgICAgICAgbWF0 cml4ICE9IE5VTEwKKyAgICAgICAmJiB2bnRoIDwgbWF0cml4LT5ucm93cworICAgICAgICYmIE1B VFJJWF9ST1cgKG1hdHJpeCwgdm50aCktPmVuYWJsZWRfcAorICAgICAgICYmIGdvX29uZV9wOwor ICAgICAgICsrdm50aCkKKyAgICB7CisgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cgPSBNQVRS SVhfUk9XIChtYXRyaXgsIHZudGgpOworICAgICAgbWNfZXJhc2Vfcm93ICh3LCBtYXRyaXgsIHJv dyk7CisgICAgfQorICBpZiAodXBkYXRpbmdfZnJhbWVfcCkKKyAgICB1cGRhdGVfZW5kIChmKTsK KyAgLy8gbWNfcmVzZXRfY2FjaGUgKHcpOworfQorCitERUZVTiAoIm1jLXN0ZGVyciIsIEZtY19z dGRlcnIsIFNtY19zdGRlcnIsIDAsIDEsICJQIiwKKyAgICAgICBkb2M6IC8qIFRvZ2dsZSB0cmFj aW5nIG9mIG11bHRpcGxlIGZha2UgY3Vyc29ycy4KK1dpdGggQVJHLCB0dXJuIHRyYWNpbmcgb24g aWYgYW5kIG9ubHkgaWYgQVJHIGlzIHBvc2l0aXZlLiAqLykKKyAgKExpc3BfT2JqZWN0IGFyZykK K3sKKyAgaWYgKE5JTFAgKGFyZykpCisgICAgbWNfc3RkZXJyX3AgPSAhbWNfc3RkZXJyX3A7Cisg IGVsc2UKKyAgICB7CisgICAgICBhcmcgPSBGcHJlZml4X251bWVyaWNfdmFsdWUgKGFyZyk7Cisg ICAgICBtY19zdGRlcnJfcCA9IFhGSVhOVU0gKGFyZykgPiAwOworICAgIH0KKyAgcmV0dXJuIFFu aWw7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKworCiAMCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioKIAkJICAgICAgV2luZG93IGRpc3BsYXkgZGlt ZW5zaW9ucwpAQCAtMTMzOTUsNiArMTgwMDksNjkgQEAgaHNjcm9sbF93aW5kb3dfdHJlZSAoTGlz cF9PYmplY3Qgd2luZG93KQogCSAgICAgIGVsc2UKIAkJcHQgPSBjbGlwX3RvX2JvdW5kcyAoQkVH ViwgbWFya2VyX3Bvc2l0aW9uICh3LT5wb2ludG0pLCBaVik7CiAKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIChnZGIpIGJ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JmNzJjOTgsCisgICAgcm93PTB4 MTIxMjQzZDAwKSBhdCB4ZGlzcC5jOjg0MjMKKyM3ICAweDAwMDAwMDAxMDAwNmMzZjcgaW4gaHNj cm9sbF93aW5kb3dfdHJlZSAod2luZG93PS4uLikgYXQgeGRpc3AuYzoxODU0NgorKi8KKworICAv KiBgaW5pdF9pdGVyYXRvcic6ICBlYXNzZXJ0IChjaGFycG9zIDwgMAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICB8fCAoY2hhcnBvcyA+PSBCVUZfQkVHIChjdXJyZW50X2J1ZmZlcikK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGNoYXJwb3MgPD0gWlYpKTsg Ki8KKworICBzdHJ1Y3QgZGlzcGxheV9wb3MgKnBvcyA9ICZjdXJzb3Jfcm93LT5zdGFydDsKKyAg cHRyZGlmZl90IGNoYXJwb3MgPSBDSEFSUE9TIChwb3MtPnBvcyk7CisKKyAgYm9vbCBiYXJmX2Ny YXNoX29uZSA9IChjaGFycG9zIDwgMAorICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChjaGFy cG9zID49IEJVRl9CRUcgKGN1cnJlbnRfYnVmZmVyKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBjaGFycG9zIDw9IFpWKSkKKyAgICAgICAgICAgICAgICAgICAgICAgID8gZmFsc2UK KyAgICAgICAgICAgICAgICAgICAgICAgIDogdHJ1ZTsKKyAgaWYgKGJhcmZfY3Jhc2hfb25lKQor ICAgIHJldHVybiBoc2Nyb2xsZWRfcDsKKworICAvKiBgcmVzZWF0XzEnOiAgQ0hBUlBPUyAocG9z KSA+PSBCRUdWICYmIENIQVJQT1MgKHBvcykgPD0gWlYgKi8KKyAgYm9vbCBiYXJmX2NyYXNoX3R3 byA9IChjaGFycG9zID49IEJFR1YgJiYgY2hhcnBvcyA8PSBaVikKKyAgICAgICAgICAgICAgICAg ICAgICAgICA/IGZhbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgOiB0cnVlOworICBpZiAo YmFyZl9jcmFzaF90d28pCisgICAgcmV0dXJuIGhzY3JvbGxlZF9wOworCisvKiBlbmQgTVVMVElQ TEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgICAgIC8qIE1v dmUgaXRlcmF0b3IgdG8gcHQgc3RhcnRpbmcgYXQgY3Vyc29yX3Jvdy0+c3RhcnQgaW4KIAkJIGEg bGluZSB3aXRoIGluZmluaXRlIHdpZHRoLiAgKi8KIAkgICAgICBpbml0X3RvX3Jvd19zdGFydCAo Jml0LCB3LCBjdXJzb3Jfcm93KTsKQEAgLTE0Mjg3LDkgKzE4OTY0LDIyIEBAIHJlZGlzcGxheV9p bnRlcm5hbCAodm9pZCkKIAkgICAgICAqdy0+ZGVzaXJlZF9tYXRyaXgtPm1ldGhvZCA9IDA7CiAJ ICAgICAgZGVidWdfbWV0aG9kX2FkZCAodywgIm9wdGltaXphdGlvbiAxIik7CiAjZW5kaWYKKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogI2lm ZGVmIEhBVkVfV0lORE9XX1NZU1RFTQorICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAg ICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisg ICAgbWNfdXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCBmYWxzZSk7CisgICAgZWxzZQogCSAgICAg IHVwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgZmFsc2UpOwogI2VuZGlmCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKIAkgICAgICBnb3RvIHVwZGF0ZTsKIAkgICAgfQogCSAgZWxzZQpA QCAtMTc2ODcsMTAgKzIyMzc3LDIyIEBAIHJlZGlzcGxheV93aW5kb3cgKExpc3BfT2JqZWN0IHdp bmRvdywgYm9vbCBqdXN0X3RoaXNfb25lX3ApCiAgICAgfQogCiAjaWZkZWYgSEFWRV9XSU5ET1df U1lTVEVNCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JT ICovCisKKyAgYm9vbCBrZWVwX2N1cnJlbnRfcCA9IChqdXN0X3RoaXNfb25lX3AKKyAgICAgICAg ICAgICAgICAgICAgICAgICB8fCAoIXVzZWRfY3VycmVudF9tYXRyaXhfcCAmJiAhb3ZlcmxheV9h cnJvd19zZWVuKQorICAgICAgICAgICAgICAgICAgICAgICAgIHx8IHctPnBzZXVkb193aW5kb3df cCk7CisKKyAgYm9vbCBmcmluZ2VzX3VwZGF0ZWRfcCA9IChCVUZGRVJQICh3LT5jb250ZW50cykK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICA/IG1j X3VwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywga2VlcF9jdXJyZW50X3ApCisgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IHVwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywga2VlcF9jdXJyZW50X3Ap OworCiAgIGlmIChGUkFNRV9XSU5ET1dfUCAoZikKLSAgICAgICYmIHVwZGF0ZV93aW5kb3dfZnJp bmdlcyAodywgKGp1c3RfdGhpc19vbmVfcAotCQkJCSAgICB8fCAoIXVzZWRfY3VycmVudF9tYXRy aXhfcCAmJiAhb3ZlcmxheV9hcnJvd19zZWVuKQotCQkJCSAgICB8fCB3LT5wc2V1ZG9fd2luZG93 X3ApKSkKKyAgICAgICYmIGZyaW5nZXNfdXBkYXRlZF9wKQogICAgIHsKICAgICAgIHVwZGF0ZV9i ZWdpbiAoZik7CiAgICAgICBibG9ja19pbnB1dCAoKTsKQEAgLTE3NzA1LDYgKzIyNDA3LDkgQEAg cmVkaXNwbGF5X3dpbmRvdyAoTGlzcF9PYmplY3Qgd2luZG93LCBib29sIGp1c3RfdGhpc19vbmVf cCkKICAgICAgIHVwZGF0ZV9lbmQgKGYpOwogICAgIH0KIAorLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogICBpZiAoV0lORE9XX0JPVFRPTV9ESVZJREVSX1dJRFRIICh3KSkKICAgICB4X2Ry YXdfYm90dG9tX2RpdmlkZXIgKHcpOwogI2VuZGlmIC8qIEhBVkVfV0lORE9XX1NZU1RFTSAqLwpA QCAtMTgwMTAsNiArMjI3MTUsNyBAQCB0cnlfd2luZG93X3JldXNpbmdfY3VycmVudF9tYXRyaXgg KHN0cnVjdCB3aW5kb3cgKncpCiAJICAgICBzY3JvbGxfcnVuX2hvb2sgd2lsbCBjbGVhciB0aGUg Y3Vyc29yLCBhbmQgdXNlIHRoZQogCSAgICAgY3VycmVudCBtYXRyaXggdG8gZ2V0IHRoZSBoZWln aHQgb2YgdGhlIHJvdyB0aGUgY3Vyc29yIGlzCiAJICAgICBpbi4gICovCisKIAkgIHJ1bi5jdXJy ZW50X3kgPSBzdGFydF9yb3ctPnk7CiAJICBydW4uZGVzaXJlZF95ID0gaXQuY3VycmVudF95Owog CSAgcnVuLmhlaWdodCA9IGl0Lmxhc3RfdmlzaWJsZV95IC0gaXQuY3VycmVudF95OwpAQCAtMTgw MTksNiArMjI3MjUsMTYgQEAgdHJ5X3dpbmRvd19yZXVzaW5nX2N1cnJlbnRfbWF0cml4IChzdHJ1 Y3Qgd2luZG93ICp3KQogCSAgICAgIHVwZGF0ZV9iZWdpbiAoZik7CiAJICAgICAgRlJBTUVfUklG IChmKS0+dXBkYXRlX3dpbmRvd19iZWdpbl9ob29rICh3KTsKIAkgICAgICBGUkFNRV9SSUYgKGYp LT5jbGVhcl93aW5kb3dfbW91c2VfZmFjZSAodyk7CisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICBtY19wcmVfc2Nyb2xsX2NsZWFuICh3 LCBydW4sIHN0YXJ0X3Zwb3MsIG5yb3dzX3Njcm9sbGVkLCBUUllfV0lORE9XX1JFVVNJTkdfQ1VS UkVOVF9NQVRSSVhfRE9XTik7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgICAg ICBGUkFNRV9SSUYgKGYpLT5zY3JvbGxfcnVuX2hvb2sgKHcsICZydW4pOwogCSAgICAgIEZSQU1F X1JJRiAoZiktPnVwZGF0ZV93aW5kb3dfZW5kX2hvb2sgKHcsIGZhbHNlLCBmYWxzZSk7CiAJICAg ICAgdXBkYXRlX2VuZCAoZik7CkBAIC0xODE3Myw2ICsyMjg4OSw3IEBAIHRyeV93aW5kb3dfcmV1 c2luZ19jdXJyZW50X21hdHJpeCAoc3RydWN0IHdpbmRvdyAqdykKIAl9CiAKICAgICAgIC8qIFNj cm9sbCB0aGUgZGlzcGxheS4gICovCisKICAgICAgIHJ1bi5jdXJyZW50X3kgPSBmaXJzdF9yZXVz YWJsZV9yb3ctPnk7CiAgICAgICBydW4uZGVzaXJlZF95ID0gV0lORE9XX0hFQURFUl9MSU5FX0hF SUdIVCAodyk7CiAgICAgICBydW4uaGVpZ2h0ID0gaXQubGFzdF92aXNpYmxlX3kgLSBydW4uY3Vy cmVudF95OwpAQCAtMTgxODMsNiArMjI5MDAsMTYgQEAgdHJ5X3dpbmRvd19yZXVzaW5nX2N1cnJl bnRfbWF0cml4IChzdHJ1Y3Qgd2luZG93ICp3KQogCSAgdXBkYXRlX2JlZ2luIChmKTsKIAkgIEZS QU1FX1JJRiAoZiktPnVwZGF0ZV93aW5kb3dfYmVnaW5faG9vayAodyk7CiAJICBGUkFNRV9SSUYg KGYpLT5jbGVhcl93aW5kb3dfbW91c2VfZmFjZSAodyk7CisKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICBtY19wcmVfc2Nyb2xsX2NsZWFu ICh3LCBydW4sIHN0YXJ0X3Zwb3MsIG5yb3dzX3Njcm9sbGVkLCBUUllfV0lORE9XX1JFVVNJTkdf Q1VSUkVOVF9NQVRSSVhfVVApOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICBG UkFNRV9SSUYgKGYpLT5zY3JvbGxfcnVuX2hvb2sgKHcsICZydW4pOwogCSAgRlJBTUVfUklGIChm KS0+dXBkYXRlX3dpbmRvd19lbmRfaG9vayAodywgZmFsc2UsIGZhbHNlKTsKIAkgIHVwZGF0ZV9l bmQgKGYpOwpAQCAtMTkxMjcsNiArMjM4NTQsNyBAQCB0cnlfd2luZG93X2lkIChzdHJ1Y3Qgd2lu ZG93ICp3KQogICAvKiBTY3JvbGwgdGhlIGRpc3BsYXkuICBEbyBpdCBiZWZvcmUgY2hhbmdpbmcg dGhlIGN1cnJlbnQgbWF0cml4IHNvCiAgICAgIHRoYXQgeHRlcm0uYyBkb2Vzbid0IGdldCBjb25m dXNlZCBhYm91dCB3aGVyZSB0aGUgY3Vyc29yIGdseXBoIGlzCiAgICAgIGZvdW5kLiAgKi8KKwog ICBpZiAoZHkgJiYgcnVuLmhlaWdodCkKICAgICB7CiAgICAgICB1cGRhdGVfYmVnaW4gKGYpOwpA QCAtMTkxMzUsNiArMjM4NjMsMTYgQEAgdHJ5X3dpbmRvd19pZCAoc3RydWN0IHdpbmRvdyAqdykK IAl7CiAJICBGUkFNRV9SSUYgKGYpLT51cGRhdGVfd2luZG93X2JlZ2luX2hvb2sgKHcpOwogCSAg RlJBTUVfUklGIChmKS0+Y2xlYXJfd2luZG93X21vdXNlX2ZhY2UgKHcpOworCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgbWNfcHJlX3Nj cm9sbF9jbGVhbiAodywgcnVuLCBmaXJzdF91bmNoYW5nZWRfYXRfZW5kX3Zwb3MsIGR2cG9zLCBU UllfV0lORE9XX0lEKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgRlJBTUVf UklGIChmKS0+c2Nyb2xsX3J1bl9ob29rICh3LCAmcnVuKTsKIAkgIEZSQU1FX1JJRiAoZiktPnVw ZGF0ZV93aW5kb3dfZW5kX2hvb2sgKHcsIGZhbHNlLCBmYWxzZSk7CiAJfQpAQCAtMjEyNzMsNiAr MjYwMTEsMTcgQEAgbWF5YmVfcHJvZHVjZV9saW5lX251bWJlciAoc3RydWN0IGl0ICppdCkKICAg ICAgIFNFVF9URVhUX1BPUyAodGVtX2l0LnBvc2l0aW9uLCAtMSwgLTEpOwogICAgICAgUFJPRFVD RV9HTFlQSFMgKCZ0ZW1faXQpOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCisgICAgICAvKiBUaGlzIHBlcm1pdHMgdXMgdG8gaW5zcGVjdCB0 aGUgSFBPUyBvZiBsaW5lIG51bWJlciBnbHlwaHMgYW5kIHRoZSBzcGFjZQorICAgICAgcGFkZGlu ZyBiZWZvcmUvYWZ0ZXIgdGhlIGxpbmUgbnVtYmVycy4gIFdlIHNldCBgZ2x5cGgtPmhwb3NgIGVs c2V3aGVyZS4gKi8KKyAgICAgIHRlbV9pdC5ocG9zICs9IDE7CisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworCisKICAgICAgIC8qIFN0b3AgcHJvZHVjaW5nIGdseXBocywgYW5kIHJlZnJhaW4g ZnJvbSBwcm9kdWNpbmcgdGhlIGxpbmUKIAkgbnVtYmVyLCBpZiB3ZSBkb24ndCBoYXZlIGVub3Vn aCBzcGFjZSBvbiB0aGlzIGxpbmUuICAqLwogICAgICAgaWYgKHRlbV9pdC5jdXJyZW50X3ggPj0g d2lkdGhfbGltaXQpCkBAIC0yMTI4NCw2ICsyNjAzMywzMCBAQCBtYXliZV9wcm9kdWNlX2xpbmVf bnVtYmVyIChzdHJ1Y3QgaXQgKml0KQogCX0KICAgICB9CiAKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgTGlzcF9PYmplY3QgYnVmID0gaXQt PnctPmNvbnRlbnRzOworICBDSEVDS19CVUZGRVIgKGJ1Zik7CisgIHN0cnVjdCBidWZmZXIgKmIg PSBYQlVGRkVSIChidWYpOworICBzdHJ1Y3QgYnVmZmVyICpvbGRfYnVmZmVyID0gTlVMTDsKKyAg LyogTmVlZGVkIHNvIHRoYXQgYnVmZmVyLWxvY2FsIHZhbHVlcyBjYW4gYmUgZGV0ZXJtaW5lZDsg ZS5nLiwgd2hlbiBzd2l0Y2hpbmcKKyAgdG8gdGhlIG1pbmlidWZmZXIuICovCisgIGlmIChiICE9 IGN1cnJlbnRfYnVmZmVyKQorICAgIHsKKyAgICAgIG9sZF9idWZmZXIgPSBjdXJyZW50X2J1ZmZl cjsKKyAgICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKGIpOworICAgIH0KKyAgaXQtPnctPm1jLmxu dW1fcGl4ZWxfd2lkdGggPSAoIU5JTFAgKFZkaXNwbGF5X2xpbmVfbnVtYmVycykpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyB0ZW1faXQuY3VycmVudF94CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiAwOworICBpZiAob2xkX2J1ZmZlcikKKyAgICBzZXRfYnVmZmVy X2ludGVybmFsIChvbGRfYnVmZmVyKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog ICAvKiBSZWNvcmQgdGhlIHdpZHRoIGluIHBpeGVscyB3ZSBuZWVkIGZvciB0aGUgbGluZSBudW1i ZXIgZGlzcGxheS4gICovCiAgIGl0LT5sbnVtX3BpeGVsX3dpZHRoID0gdGVtX2l0LmN1cnJlbnRf eDsKICAgLyogQ29weSB0aGUgcHJvZHVjZWQgZ2x5cGhzIGludG8gSVQncyBnbHlwaF9yb3cuICAq LwpAQCAtMjcwOTIsNiArMzE4NjUsMTcgQEAgYXBwZW5kX2dseXBoIChzdHJ1Y3QgaXQgKml0KQog CSAgICBnWzFdID0gKmc7CiAJICBnbHlwaCA9IGl0LT5nbHlwaF9yb3ctPmdseXBoc1thcmVhXTsK IAl9CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9 IElUX0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAg IGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5v YmplY3QgPSBpdC0+b2JqZWN0OwogICAgICAgaWYgKGl0LT5waXhlbF93aWR0aCA+IDApCkBAIC0y NzE3NSw2ICszMTk1OSwxNyBAQCBhcHBlbmRfY29tcG9zaXRlX2dseXBoIChzdHJ1Y3QgaXQgKml0 KQogCSAgICBnWzFdID0gKmc7CiAJICBnbHlwaCA9IGl0LT5nbHlwaF9yb3ctPmdseXBoc1tpdC0+ YXJlYV07CiAJfQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VS U09SUyAqLworCisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPmJ5 dGVwb3MgPSBJVF9CWVRFUE9TICgqaXQpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAgICAgICBnbHlwaC0+Y2hhcnBvcyA9IGl0LT5jbXBfaXQuY2hhcnBvczsKICAgICAgIGdseXBo LT5vYmplY3QgPSBpdC0+b2JqZWN0OwogICAgICAgZWFzc2VydCAoaXQtPnBpeGVsX3dpZHRoIDw9 IFNIUlRfTUFYKTsKQEAgLTI3MzgzLDYgKzMyMTc4LDE3IEBAIHByb2R1Y2VfaW1hZ2VfZ2x5cGgg KHN0cnVjdCBpdCAqaXQpCiAJfQogICAgICAgaWYgKGdseXBoIDwgaXQtPmdseXBoX3Jvdy0+Z2x5 cGhzW2FyZWEgKyAxXSkKIAl7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBn bHlwaC0+Ynl0ZXBvcyA9IElUX0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKIAkgIGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKIAkg IGdseXBoLT5vYmplY3QgPSBpdC0+b2JqZWN0OwogCSAgZ2x5cGgtPnBpeGVsX3dpZHRoID0gY2xp cF90b19ib3VuZHMgKC0xLCBpdC0+cGl4ZWxfd2lkdGgsIFNIUlRfTUFYKTsKQEAgLTI3NDg2LDYg KzMyMjkyLDE3IEBAIHByb2R1Y2VfeHdpZGdldF9nbHlwaCAoc3RydWN0IGl0ICppdCkKIAl9CiAg ICAgICBpZiAoZ2x5cGggPCBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJlYSArIDFdKQogCXsKKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAg ICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBoLT5ieXRlcG9zID0gSVRfQllU RVBPUyAoKml0KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgZ2x5cGgtPmNo YXJwb3MgPSBDSEFSUE9TIChpdC0+cG9zaXRpb24pOwogCSAgZ2x5cGgtPm9iamVjdCA9IGl0LT5v YmplY3Q7CiAJICBnbHlwaC0+cGl4ZWxfd2lkdGggPSBjbGlwX3RvX2JvdW5kcyAoLTEsIGl0LT5w aXhlbF93aWR0aCwgU0hSVF9NQVgpOwpAQCAtMjc1NzIsNiArMzIzODksMTcgQEAgYXBwZW5kX3N0 cmV0Y2hfZ2x5cGggKHN0cnVjdCBpdCAqaXQsIExpc3BfT2JqZWN0IG9iamVjdCwKIAkgICAgd2lk dGggLT0gaXQtPmZpcnN0X3Zpc2libGVfeCAtIGl0LT5jdXJyZW50X3g7CiAJICBlYXNzZXJ0ICh3 aWR0aCA+IDApOwogCX0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExF LUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBo LT5ieXRlcG9zID0gSVRfQllURVBPUyAoKml0KTsKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogICAgICAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9zaXRpb24pOwogICAg ICAgZ2x5cGgtPm9iamVjdCA9IG9iamVjdDsKICAgICAgIC8qIEZJWE1FOiBJdCB3b3VsZCBiZSBi ZXR0ZXIgdG8gdXNlIFRZUEVfTUFYIGhlcmUsIGJ1dApAQCAtMjgwMjYsNiArMzI4NTQsMTcgQEAg YXBwZW5kX2dseXBobGVzc19nbHlwaCAoc3RydWN0IGl0ICppdCwgaW50IGZhY2VfaWQsIGJvb2wg Zm9yX25vX2ZvbnQsIGludCBsZW4sCiAJICAgIGdbMV0gPSAqZzsKIAkgIGdseXBoID0gaXQtPmds eXBoX3Jvdy0+Z2x5cGhzW2FyZWFdOwogCX0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsK KyAgICAgIGdseXBoLT5ieXRlcG9zID0gSVRfQllURVBPUyAoKml0KTsKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisKKwogICAgICAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9z aXRpb24pOwogICAgICAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAgICAgICBlYXNzZXJ0 IChpdC0+cGl4ZWxfd2lkdGggPD0gU0hSVF9NQVgpOwpAQCAtMjkwNzYsMTAgKzMzOTE1LDIwIEBA IHhfaW5zZXJ0X2dseXBocyAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqdXBk YXRlZF9yb3csCiAKICAgLyogV3JpdGUgdGhlIGdseXBocy4gICovCiAgIGhwb3MgPSBzdGFydCAt IHJvdy0+Z2x5cGhzW3VwZGF0ZWRfYXJlYV07CisKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgaWYgKCFtY19yZWRyYXdfcm93ICh3LCB3LT5j dXJyZW50X21hdHJpeCwgcm93LCB1cGRhdGVkX2FyZWEsIHctPm91dHB1dF9jdXJzb3IueCwKKyAg ICAgICAgICAgICAgICAgICAgICBocG9zLCBocG9zICsgbGVuLCBmYWxzZSwgRFJBV19OT1JNQUxf VEVYVCwgWF9JTlNFUlRfR0xZUEhTKSkKICAgZHJhd19nbHlwaHMgKHcsIHctPm91dHB1dF9jdXJz b3IueCwgcm93LCB1cGRhdGVkX2FyZWEsCiAJICAgICAgIGhwb3MsIGhwb3MgKyBsZW4sCiAJICAg ICAgIERSQVdfTk9STUFMX1RFWFQsIDApOwogCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAgIC8qIEFkdmFuY2UgdGhlIG91dHB1dCBjdXJzb3IuICAqLwogICB3LT5vdXRwdXRfY3Vyc29y Lmhwb3MgKz0gbGVuOwogICB3LT5vdXRwdXRfY3Vyc29yLnggKz0gc2hpZnRfYnlfd2lkdGg7CkBA IC0yOTUwNSw5ICszNDM1NCwxOSBAQCB4X2ZpeF9vdmVybGFwcGluZ19hcmVhIChzdHJ1Y3Qgd2lu ZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCiAJICB3aGlsZSAoaSA8IHJvdy0+dXNlZFth cmVhXQogCQkgJiYgcm93LT5nbHlwaHNbYXJlYV1baV0ub3ZlcmxhcHNfdmVydGljYWxseV9wKTsK IAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwor ICAgICAgaWYgKCFtY19yZWRyYXdfcm93ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgcm93LCBhcmVh LCBzdGFydF94LCBzdGFydCwgaSwKKyAgICAgICAgICBmYWxzZSwgRFJBV19OT1JNQUxfVEVYVCwg WF9GSVhfT1ZFUkxBUFBJTkdfQVJFQSkpCiAJICBkcmF3X2dseXBocyAodywgc3RhcnRfeCwgcm93 LCBhcmVhLAogCQkgICAgICAgc3RhcnQsIGksCiAJCSAgICAgICBEUkFXX05PUk1BTF9URVhULCBv dmVybGFwcyk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAl9CiAgICAgICBlbHNl CiAJewpAQCAtMjk3NTgsMTAgKzM0NjE3LDE3IEBAIGRpc3BsYXlfYW5kX3NldF9jdXJzb3IgKHN0 cnVjdCB3aW5kb3cgKncsIGJvb2wgb24sCiAgIG5ld19jdXJzb3JfdHlwZSA9IGdldF93aW5kb3df Y3Vyc29yX3R5cGUgKHcsIGdseXBoLAogCQkJCQkgICAgJm5ld19jdXJzb3Jfd2lkdGgsICZhY3Rp dmVfY3Vyc29yKTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKwogICAvKiBJZiBjdXJzb3IgaXMgY3VycmVudGx5IGJlaW5nIHNob3duIGFuZCB3 ZSBkb24ndCB3YW50IGl0IHRvIGJlIG9yCiAgICAgIGl0IGlzIGluIHRoZSB3cm9uZyBwbGFjZSwg b3IgdGhlIGN1cnNvciB0eXBlIGlzIG5vdCB3aGF0IHdlIHdhbnQsCiAgICAgIGVyYXNlIGl0LiAg Ki8KICAgaWYgKHctPnBoeXNfY3Vyc29yX29uX3AKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZG RVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVG RkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJV RkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkKICAgICAgICYmICghb24KIAkgIHx8IHctPnBo eXNfY3Vyc29yLnggIT0geAogCSAgfHwgdy0+cGh5c19jdXJzb3IueSAhPSB5CkBAIC0yOTc3NCw2 ICszNDY0MCw5IEBAIGRpc3BsYXlfYW5kX3NldF9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIGJv b2wgb24sCiAJICAgICAgJiYgbmV3X2N1cnNvcl93aWR0aCAhPSB3LT5waHlzX2N1cnNvcl93aWR0 aCkpKQogICAgIGVyYXNlX3BoeXNfY3Vyc29yICh3KTsKIAorLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogICAvKiBEb24ndCBjaGVjayBwaHlzX2N1cnNvcl9vbl9wIGhlcmUgYmVjYXVzZSB0 aGF0IGZsYWcgaXMgb25seSBzZXQKICAgICAgdG8gZmFsc2UgaW4gc29tZSBjYXNlcyB3aGVyZSB3 ZSBrbm93IHRoYXQgdGhlIGN1cnNvciBoYXMgYmVlbgogICAgICBjb21wbGV0ZWx5IGVyYXNlZCwg dG8gYXZvaWQgdGhlIGV4dHJhIHdvcmsgb2YgZXJhc2luZyB0aGUgY3Vyc29yCkBAIC0yOTc5Miw5 ICszNDY2MSwxOSBAQCBkaXNwbGF5X2FuZF9zZXRfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBi b29sIG9uLAogICAgICAgdy0+cGh5c19jdXJzb3IudnBvcyA9IHZwb3M7CiAgICAgfQogCi0gIEZS QU1FX1JJRiAoZiktPmRyYXdfd2luZG93X2N1cnNvciAodywgZ2x5cGhfcm93LCB4LCB5LAotICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19jdXJzb3JfdHlwZSwgbmV3X2N1 cnNvcl93aWR0aCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbiwgYWN0 aXZlX2N1cnNvcik7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VS U09SUyAqLworCisgIGlmIChOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3Nz aGFpcnMpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192 aXNpYmxlKSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNf Y29uZikpKQorICAgIEZSQU1FX1JJRiAoZiktPmRyYXdfd2luZG93X2N1cnNvciAodywgZ2x5cGhf cm93LCB4LCB5LCBuZXdfY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBuZXdfY3Vyc29yX3dpZHRoLCBvbiwgYWN0aXZlX2N1cnNvcik7CisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKIH0KIAogCkBAIC0yOTg4Nyw3ICszNDc2NiwxOCBAQCBk cmF3X3Jvd193aXRoX21vdXNlX2ZhY2UgKHN0cnVjdCB3aW5kb3cgKncsIGludCBzdGFydF94LCBz dHJ1Y3QgZ2x5cGhfcm93ICpyb3csCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCiAgIGlmIChG UkFNRV9XSU5ET1dfUCAoWEZSQU1FICh3LT5mcmFtZSkpKQogICAgIHsKKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgaWYgKCFtY19y ZWRyYXdfcm93ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgcm93LCBURVhUX0FSRUEsIHN0YXJ0X3gs CisgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0X2hwb3MsIGVuZF9ocG9zLCBmYWxzZSwg ZHJhdywgRFJBV19ST1dfV0lUSF9NT1VTRV9GQUNFKSkKICAgICAgIGRyYXdfZ2x5cGhzICh3LCBz dGFydF94LCByb3csIFRFWFRfQVJFQSwgc3RhcnRfaHBvcywgZW5kX2hwb3MsIGRyYXcsIDApOwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICByZXR1cm47CiAgICAgfQogI2Vu ZGlmCkBAIC0zMTk0NSwxMSArMzY4MzUsMjMgQEAgZXhwb3NlX2FyZWEgKHN0cnVjdCB3aW5kb3cg KncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgWFJlY3RhbmdsZSAqciwKICAgc3RydWN0IGdseXBo ICpsYXN0OwogICBpbnQgZmlyc3RfeCwgc3RhcnRfeCwgeDsKIAorCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogICBpZiAoYXJlYSA9PSBURVhUX0FS RUEgJiYgcm93LT5maWxsX2xpbmVfcCkKKyAgICB7CisgICAgICBpZiAoIW1jX3JlZHJhd19yb3cg KHcsIHctPmN1cnJlbnRfbWF0cml4LCByb3csIGFyZWEsIDAsIDAsIHJvdy0+dXNlZFthcmVhXSwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgZmFsc2UsIERSQVdfTk9STUFMX1RFWFQsIEVYUE9T RV9BUkVBX09ORSkpCiAgICAgLyogSWYgcm93IGV4dGVuZHMgZmFjZSB0byBlbmQgb2YgbGluZSB3 cml0ZSB0aGUgd2hvbGUgbGluZS4gICovCiAgICAgZHJhd19nbHlwaHMgKHcsIDAsIHJvdywgYXJl YSwKIAkJIDAsIHJvdy0+dXNlZFthcmVhXSwKIAkJIERSQVdfTk9STUFMX1RFWFQsIDApOworICAg IH0KKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBlbHNlCiAgICAgewogICAgICAg LyogU2V0IFNUQVJUX1ggdG8gdGhlIHdpbmRvdy1yZWxhdGl2ZSBzdGFydCBwb3NpdGlvbiBmb3Ig ZHJhd2luZyBnbHlwaHMgb2YKQEAgLTMxOTgxLDExICszNjg4MywyMyBAQCBleHBvc2VfYXJlYSAo c3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqcm93LCBYUmVjdGFuZ2xlICpyLAog CSAgKytsYXN0OwogCX0KIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExF LUNVUlNPUlMgKi8KKwogICAgICAgLyogUmVwYWludC4gICovCi0gICAgICBpZiAobGFzdCA+IGZp cnN0KQorICAgICAgLyogRmxvYXRpbmcgZmFrZSBjdXJzb3JzIHdpbGwgZXhpc3Qgd2hlbiAobGFz dCA9PSBmaXJzdCkuICovCisgICAgICBpZiAoIW1jX3JlZHJhd19yb3cgKHcsIHctPmN1cnJlbnRf bWF0cml4LCByb3csIGFyZWEsIGZpcnN0X3ggLSBzdGFydF94LAorICAgICAgICAgICAgICAgICAg ICAgICAgICBmaXJzdCAtIHJvdy0+Z2x5cGhzW2FyZWFdLCBsYXN0IC0gcm93LT5nbHlwaHNbYXJl YV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgIGZhbHNlLCBEUkFXX05PUk1BTF9URVhULCBF WFBPU0VfQVJFQV9UV08pCisgICAgICAgICAgJiYgbGFzdCA+IGZpcnN0KQogCWRyYXdfZ2x5cGhz ICh3LCBmaXJzdF94IC0gc3RhcnRfeCwgcm93LCBhcmVhLAogCQkgICAgIGZpcnN0IC0gcm93LT5n bHlwaHNbYXJlYV0sIGxhc3QgLSByb3ctPmdseXBoc1thcmVhXSwKIAkJICAgICBEUkFXX05PUk1B TF9URVhULCAwKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgIH0KIH0KIApA QCAtMzE5OTksMTAgKzM2OTEzLDIyIEBAIGV4cG9zZV9saW5lIChzdHJ1Y3Qgd2luZG93ICp3LCBz dHJ1Y3QgZ2x5cGhfcm93ICpyb3csIFhSZWN0YW5nbGUgKnIpCiB7CiAgIGVhc3NlcnQgKHJvdy0+ ZW5hYmxlZF9wKTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKwogICBpZiAocm93LT5tb2RlX2xpbmVfcCB8fCB3LT5wc2V1ZG9fd2luZG93X3Ap CisgICAgeworICAgICAgaWYgKCFtY19yZWRyYXdfcm93ICh3LCB3LT5jdXJyZW50X21hdHJpeCwg cm93LCBURVhUX0FSRUEsIDAsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHJvdy0+dXNl ZFtURVhUX0FSRUFdLCBmYWxzZSwgRFJBV19OT1JNQUxfVEVYVCwgRVhQT1NFX0xJTkUpKQogICAg IGRyYXdfZ2x5cGhzICh3LCAwLCByb3csIFRFWFRfQVJFQSwKIAkJIDAsIHJvdy0+dXNlZFtURVhU X0FSRUFdLAogCQkgRFJBV19OT1JNQUxfVEVYVCwgMCk7CisgICAgfQorCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKworCiAgIGVsc2UKICAgICB7CiAgICAgICBpZiAocm93LT51c2VkW0xFRlRf TUFSR0lOX0FSRUFdKQpAQCAtMzI1NTAsNiArMzc0NzYsMjIgQEAgeF9pbnRlcnNlY3RfcmVjdGFu Z2xlcyAoWFJlY3RhbmdsZSAqcjEsIFhSZWN0YW5nbGUgKnIyLCBYUmVjdGFuZ2xlICpyZXN1bHQp CiB2b2lkCiBzeW1zX29mX3hkaXNwICh2b2lkKQogeworCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGRlZnN1YnIgKCZTbWNfZHVtcF9nbHlw aF9yb3cpOworCisgIGRlZnN1YnIgKCZTbWNfZHVtcF9nbHlwaF9tYXRyaXgpOworCisgIGRlZnN1 YnIgKCZTbWNfY3VycmVudF9jb2x1bW4pOworCisgIGRlZnN1YnIgKCZTbWNfc3RkZXJyKTsKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBWd2l0aF9lY2hvX2FyZWFfc2F2ZV92ZWN0 b3IgPSBRbmlsOwogICBzdGF0aWNwcm8gKCZWd2l0aF9lY2hvX2FyZWFfc2F2ZV92ZWN0b3IpOwog CmRpZmYgLS1naXQgYS9zcmMveHRlcm0uYyBiL3NyYy94dGVybS5jCmluZGV4IDVhYTNlM2YuLjBl NWQ3NWIgMTAwNjQ0Ci0tLSBhL3NyYy94dGVybS5jCisrKyBiL3NyYy94dGVybS5jCkBAIC0xMzIs NiArMTMyLDg4NSBAQCBhbG9uZyB3aXRoIEdOVSBFbWFjcy4gIElmIG5vdCwgc2VlIDxodHRwczov L3d3dy5nbnUub3JnL2xpY2Vuc2VzLz4uICAqLwogI2luY2x1ZGUgPFgxMS9YS0JsaWIuaD4KICNl bmRpZgogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKio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KTsKKyAgaWYgKHMtPmhsID09 IERSQVdfTk9STUFMX1RFWFQpCisgICAgeworICAgICAgcy0+Z2MgPSBzLT5mYWNlLT5nYzsKKyAg ICAgIHMtPnN0aXBwbGVkX3AgPSBzLT5mYWNlLT5zdGlwcGxlICE9IDA7CisgICAgfQorICBlbHNl IGlmIChzLT5obCA9PSBEUkFXX0lOVkVSU0VfVklERU8pCisgICAgeworICAgICAgeF9zZXRfbW9k ZV9saW5lX2ZhY2VfZ2MgKHMpOworICAgICAgcy0+c3RpcHBsZWRfcCA9IHMtPmZhY2UtPnN0aXBw bGUgIT0gMDsKKyAgICB9CisgIGVsc2UgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SKQorICAgIHsK KyAgICAgIG1jX3hfc2V0X2N1cnNvcl9nYyAocywgY3Vyc29yX2djX3ApOworICAgICAgcy0+c3Rp cHBsZWRfcCA9IGZhbHNlOworICAgIH0KKyAgZWxzZSBpZiAocy0+aGwgPT0gRFJBV19NT1VTRV9G QUNFKQorICAgIHsKKyAgICAgIHhfc2V0X21vdXNlX2ZhY2VfZ2MgKHMpOworICAgICAgcy0+c3Rp cHBsZWRfcCA9IHMtPmZhY2UtPnN0aXBwbGUgIT0gMDsKKyAgICB9CisgIGVsc2UgaWYgKHMtPmhs ID09IERSQVdfSU1BR0VfUkFJU0VECisgICAgICAgICAgIHx8IHMtPmhsID09IERSQVdfSU1BR0Vf U1VOS0VOKQorICAgIHsKKyAgICAgIHMtPmdjID0gcy0+ZmFjZS0+Z2M7CisgICAgICBzLT5zdGlw cGxlZF9wID0gcy0+ZmFjZS0+c3RpcHBsZSAhPSAwOworICAgIH0KKyAgZWxzZQorICAgIGVtYWNz X2Fib3J0ICgpOworICAvKiBHQyBtdXN0IGhhdmUgYmVlbiBzZXQuICovCisgIGVhc3NlcnQgKHMt PmdjICE9IDApOworfQorCisvKiBEcmF3IGEgaG9sbG93IGJveCBjdXJzb3Igb24gd2luZG93IFcg aW4gZ2x5cGggcm93IFJPVy4g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ydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBz dHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICAgICAgaW50IHgsIGludCBm eCwgaW50IHksIGludCBmeSwgaW50IGhwb3MsIGludCB2cG9zLCBpbnQgd2QsIGludCBoLAorICAg ICAgICAgICAgICAgICAgICAgIGludCB3aWR0aCwgZW51bSBtY19jdXJzb3JfdHlwZSBraW5kLCBi b29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKQoreworICBzdHJ1Y3QgZnJhbWUgKmYgPSBY RlJBTUUgKHctPmZyYW1lKTsKKyAgLyogSWYgY3Vyc29yIGlzIG91dCBvZiBib3VuZHMsIGRvbid0 IGRyYXcgZ2FyYmFnZS4gIFRoaXMgY2FuIGhhcHBlbgorICAgICBpbiBtaW5pLWJ1ZmZlciB3aW5k b3dzIHdoZW4gc3dpdGNoaW5nIGJldHdlZW4gZWNobyBhcmVhIGdseXBocworICAgICBhbmQgbWlu aS1idWZmZXIuICovCisgIHN0cnVjdCBnbHlwaCAqY3Vyc29yX2dseXBoID0gbWNfZ2V0X2N1cnNv cl9nbHlwaCAodywgbWF0cml4LCByb3csIGhwb3MsIHZwb3MpOworICBpZiAoY3Vyc29yX2dseXBo ID09IE5VTEwpCisgICAgcmV0dXJuOworICAvKiBFeHBlcmltZW50YWwgYXZvaWRhbmNlIG9mIGN1 cnNvciBvbiB4d2lkZ2V0LiAqLworICBpZiAoY3Vyc29yX2dseXBoLT50eXBlID09IFhXSURHRVRf R0xZUEgpCisgICAgcmV0dXJuOworICAvKiBJZiBvbiBhbiBpbWFnZSwgZHJhdyBsaWtlIGEgbm9y bWFsIGN1cnNvci4gIFRoYXQncyB1c3VhbGx5IGJldHRlcgorICAgICB2aXNpYmxlIHRoYW4gZHJh d2luZyBhIGJhciwgZXNwLiBpZiB0aGUgaW1hZ2UgaXMgbGFyZ2Ugc28gdGhhdAorICAgICB0aGUg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IHRoZSBgY29s b3IucGl4ZWxgLiAqLworICB4X2FsbG9jX25lYXJlc3RfY29sb3IgKGYsIGNtYXAsICZjb2xvcik7 CisgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgIHsKKyAgICBjYXNlIE1DX05PX0ZSSU5HRV9CSVRN QVA6CisgICAgICBicmVhazsKKyAgICBjYXNlIE1DX05PX0NVUlNPUjoKKyAgICAgIGJyZWFrOwor ICAgIGNhc2UgTUNfUklHSFRfRlJJTkdFX0JJVE1BUDoKKyAgICAgIGJyZWFrOworICAgIGNhc2Ug TUNfTEVGVF9GUklOR0VfQklUTUFQOgorICAgICAgYnJlYWs7CisgICAgY2FzZSBNQ19GUkFNRURf Qk9YOgorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlwaCAqY3Vyc29yX2dseXBoID0gbWNfZ2V0X2N1 cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIGhwb3MsIHZwb3MpOworICAgICAgaWYgKGN1cnNv cl9nbHlwaCA9PSBOVUxMKQorICAgICAgICByZXR1cm47CisgICAgICBMaXNwX09iamVjdCBidWYg PSB3LT5jb250ZW50czsKKyAgICAgIENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgICAgIHN0cnVjdCBi dWZmZXIgKmIgPSBYQlVGRkVSIChidWYpOworICAgICAgYm9vbCByZWdpb25fYWN0aXZlX3AgPSAo IU5JTFAgKFZ0cmFuc2llbnRfbWFya19tb2RlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgIU5JTFAgKEJWQVIgKGIsIG1hcmtfYWN0aXZlKSkpOworICAgICAgcHRyZGlmZl90IHJl Z2lvbl9iZWcgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IG1jX3JlZ2lvbl9saW1pdCAoMSkgOiAtMTsK KyAgICAgIHB0cmRpZmZfdCByZWdpb25fZW5kID0gKHJlZ2lvbl9hY3RpdmVfcCkgPyBtY19yZWdp b25fbGltaXQgKDApIDogLTE7CisgICAgICBpZiAoY3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FX1hfRElTUExBWSAoZiksIGYtPm91dHB1 dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAg ICAgICAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYt Pm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9mYWNlLT5iYWNrZ3JvdW5k KTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKCFhY3Rp dmVfcCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGVudW0g ZmFjZV9pZCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBm LCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItaW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwgdHJ1 ZSk7CisgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19pbmFjdGl2ZV9m YWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCk7CisgICAgICAg ICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91 dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2luYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQp OworICAgICAgICAgICAgICAgICAgICAgIFhTZXRCYWNrZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkg KGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19pbmFjdGl2ZV9mYWNlLT5i YWNrZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgIGJsb2NrX2lucHV0 ICgpOworICAgICAgICA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gSU1BR0VfR0xZ UEggJiYgbHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisg ICAgICAgICAgeworICAgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRf ZGF0YS54LT5jdXJzb3JfcGl4ZWwnLiAqLworICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+ Y3Vyc29yX3BpeGVsID0gY29sb3IucGl4ZWw7CisgICAgICAgICAgICBtY194X2RyYXdfaG9sbG93 X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgp OworICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxf Y3Vyc29yX3BpeGVsOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7 CisgICAgICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+ Y3Vyc29yX2djJyBieSBib3Jyb3dpbmcgdGhlCisgICAgICAgICAgICAgIGZ1bmN0aW9uYWxpdHkg b2YgYHhfbWFrZV9nYycgaW4geGZucy5jLiAqLworICAgICAgICAgICAgICBpZiAocmVnaW9uX2Fj dGl2ZV9wCisgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcAorICAgICAgICAgICAgICAgICAg JiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID09IHJlZ2lvbl9iZWcpCisgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2Jl Z19mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtl LWN1cnNvci1hdC1yZWdpb24tcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICA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fRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93 X2FjdGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChhY3RpdmVfcCkKKyAgICAgICAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9s bG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIist cmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAg ICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYs IGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBYU2V0Rm9y ZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2dj LCBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgICAgICAg ICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngt PmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9mYWNlLT5iYWNrZ3JvdW5kKTsKKyAgICAgICAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoIWFjdGl2ZV9wKQor ICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVt IGZhY2VfaWQgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywg ZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRy dWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2luYWN0 aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkKTsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAo ZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2luYWN0aXZlX2ZhY2UtPmZv cmVncm91bmQpOworICAgICAgICAgICAgICAgICAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJB TUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfaW5h Y3RpdmVfZmFjZS0+YmFja2dyb3VuZCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAg ICAgICAgICAgIGJsb2NrX2lucHV0ICgpOworICAgICAgICAgICAgICAvKiBGb3JjZSBgbWNfeF9z ZXRfY3Vyc29yX2djJyB0byB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYycuICov CisgICAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX3AgPSB0cnVlOworICAgICAgICAgICAgICBt Y19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4LCBocG9z LCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNsLCBnbHlwaF9m bGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5k IChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIHhnY3Yu Zm9yZWdyb3VuZCk7CisgICAgICAgICAgICAgIFhTZXRCYWNrZ3JvdW5kIChGUkFNRV9YX0RJU1BM QVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIHhnY3YuYmFja2dyb3VuZCk7Cisg ICAgICAgICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgICAgIC8qIERyYXcgdGhl IGZyYW1lIGFyb3VuZCB0aGUgYm94LiAqLworICAgICAgICAgICAgICBtY194X2RyYXdfaG9sbG93 X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgp OworICAgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfSE9MTE9X X0JPWDoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYm IGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWph Y2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCcuICovCisgICAgICAgICAgZi0+b3V0 cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gY29sb3IucGl4ZWw7CisgICAgICAgICAgbWNfeF9k cmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZw b3MsIHdkLCBoKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBv cmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAg IG1jX3hfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ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VkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5j dXJzb3JfZ2MsIHhnY3YuZm9yZWdyb3VuZCk7CisgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZS QU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgeGdjdi5iYWNr Z3JvdW5kKTsKKyAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgICB9CisgICAgICAg IGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBib29sIGN1cnNvcl9nY19wID0gZmFsc2U7 CisgICAgICAgICAgICBtY19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdf Q1VSU09SLCB4LCBocG9zLCB2cG9zLCBsc2wsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9wLCBjdXJzb3JfZ2Nf cCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfQkFSOgor ICAgIHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJs dWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+ b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsJy4gKi8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0 YS54LT5jdXJzb3JfcGl4ZWwgPSBjb2xvci5waXhlbDsKKyAgICAgICAgICBib29sIGN1cnNvcl9n Y19pbnZpc2libGVfb2theV9wID0gdHJ1ZTsKKyAgICAgICAgICBtY194X2RyYXdfYmFyX2N1cnNv ciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgTUNfQkFSLCBjdXJzb3Jf Z2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29y X3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UK KyAgICAgICAgICB7CisgICAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9w ID0gZmFsc2U7CisgICAgICAgICAgICBtY194X2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCBy b3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgaCwgY3Vyc29yX3dpZHRoLCBNQ19CQVIsIGN1cnNvcl9nY19pbnZpc2libGVf b2theV9wKTsKKyAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBNQ19I QkFSOgorICAgIHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYg bHNsLmJsdWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFj ayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsJy4gKi8KKyAgICAgICAgICBmLT5vdXRw dXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBjb2xvci5waXhlbDsKKyAgICAgICAgICBib29sIGN1 cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gdHJ1ZTsKKyAgICAgICAgICBtY194X2RyYXdfYmFy X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgTUNfSEJBUiwg Y3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngt PmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAg ICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxl X29rYXlfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1h dHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl93aWR0aCwgTUNfSEJBUiwgY3Vyc29yX2djX2lu dmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBk ZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7CisgIH0KKyAgICAgICAgfQorI2lmZGVmIEhB VkVfWF9JMThOCisgIGlmICh3ID09IFhXSU5ET1cgKGYtPnNlbGVjdGVkX3dpbmRvdykpCisgICAg aWYgKEZSQU1FX1hJQyAoZikgJiYgKEZSQU1FX1hJQ19TVFlMRSAoZikgJiBYSU1QcmVlZGl0UG9z aXRpb24pKQorICAgICAgeGljX3NldF9wcmVlZGl0YXJlYSAodywgeCwgeSk7CisjZW5kaWYKKyAg ICB9CisgIFhGbHVzaCAoRlJBTUVfWF9ESVNQTEFZIChmKSk7Cit9CisKKy8qIERyYXcgc3RyZXRj aCBnbHlwaCBzdHJpbmcgUy4gKi8KK3N0YXRpYyB2b2lkCittY194X2RyYXdfc3RyZXRjaF9nbHlw aF9zdHJpbmcgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMpCit7CisgIGVhc3NlcnQgKHMtPmZpcnN0 X2dseXBoLT50eXBlID09IFNUUkVUQ0hfR0xZUEgpOworICBpZiAocy0+aGwgPT0gRFJBV19DVVJT T1IKKyAgICAgICYmICF4X3N0cmV0Y2hfY3Vyc29yX3ApCisgICAgeworICAgICAgLyogSWYgYHgt c3RyZXRjaC1jdXJzb3InIGlzIG5pbCwgZG9uJ3QgZHJhdyBhIGJsb2NrIGN1cnNvciBhcyB3aWRl IGFzIHRoZQorICAgICAgc3RyZXRjaCBnbHlwaC4gKi8KKyAgICAgIGludCB3aWR0aCwgYmFja2dy b3VuZF93aWR0aCA9IHMtPmJhY2tncm91bmRfd2lkdGg7CisgICAgICBpbnQgeCA9IHMtPng7Cisg ICAgICBpZiAoIXMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAgICAgICAgeworICAgICAgICAgIGludCBs ZWZ0X3ggPSB3aW5kb3dfYm94X2xlZnRfb2Zmc2V0IChzLT53LCBURVhUX0FSRUEpOworICAgICAg ICAgIGlmICh4IDwgbGVmdF94KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBiYWNrZ3Jv dW5kX3dpZHRoIC09IGxlZnRfeCAtIHg7CisgICAgICAgICAgICAgIHggPSBsZWZ0X3g7CisgICAg ICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAg ICAgIC8qIEluIFIyTCByb3dzLCBkcmF3IHRoZSBjdXJzb3Igb24gdGhlIHJpZ2h0IGVkZ2Ugb2Yg dGhlCisgICAgICAgICAgICAgICBzdHJldGNoIGdseXBoLiAqLworICAgICAgICAgICAgaW50IHJp Z2h0X3ggPSB3aW5kb3dfYm94X3JpZ2h0IChzLT53LCBURVhUX0FSRUEpOworICAgICAgICAgICAg aWYgKHggKyBiYWNrZ3JvdW5kX3dpZHRoID4gcmlnaHRfeCkKKyAgICAgICAgICAgICAgYmFja2dy b3VuZF93aWR0aCAtPSB4IC0gcmlnaHRfeDsKKyAgICAgICAgICAgIHggKz0gYmFja2dyb3VuZF93 aWR0aDsKKyAgICAgICAgICB9CisgICAgICB3aWR0aCA9IG1pbiAoRlJBTUVfQ09MVU1OX1dJRFRI IChzLT5mKSwgYmFja2dyb3VuZF93aWR0aCk7CisgICAgICBpZiAocy0+cm93LT5yZXZlcnNlZF9w KQorICAgICAgICB4IC09IHdpZHRoOworICAgICAgLyogRHJhdyBjdXJzb3IuICovCisgICAgICB4 X2RyYXdfZ2x5cGhfc3RyaW5nX2JnX3JlY3QgKHMsIHgsIHMtPnksIHdpZHRoLCBzLT5oZWlnaHQp OworICAgICAgLyogQ2xlYXIgcmVzdCB1c2luZyB0aGUgR0Mgb2YgdGhlIG9yaWdpbmFsIG5vbi1j dXJzb3IgZmFjZS4gKi8KKyAgICAgIGlmICh3aWR0aCA8IGJhY2tncm91bmRfd2lkdGgpCisgICAg ICAgIHsKKyAgICAgICAgICBpbnQgeSA9IHMtPnk7CisgICAgICAgICAgaW50IHcgPSBiYWNrZ3Jv dW5kX3dpZHRoIC0gd2lkdGgsIGggPSBzLT5oZWlnaHQ7CisgICAgICAgICAgWFJlY3RhbmdsZSBy OworICAgICAgICAgIEdDIGdjOworICAgICAgICAgIGlmICghcy0+cm93LT5yZXZlcnNlZF9wKQor ICAgICAgICAgICAgeCArPSB3aWR0aDsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB4ID0g cy0+eDsKKyAgICAgICAgICBpZiAocy0+cm93LT5tb3VzZV9mYWNlX3AKKyAgICAgICAgICAgICAg JiYgY3Vyc29yX2luX21vdXNlX2ZhY2VfcCAocy0+dykpCisgICAgICAgICAgICB7CisgICAgICAg ICAgICAgIHhfc2V0X21vdXNlX2ZhY2VfZ2MgKHMpOworICAgICAgICAgICAgICBnYyA9IHMtPmdj OworICAgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGdjID0gcy0+ZmFj ZS0+Z2M7CisgICAgICAgICAgZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsICZyKTsKKyAg ICAgICAgICB4X3NldF9jbGlwX3JlY3RhbmdsZXMgKHMtPmYsIGdjLCAmciwgMSk7CisgICAgICAg ICAgaWYgKHMtPmZhY2UtPnN0aXBwbGUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIC8q IEZpbGwgYmFja2dyb3VuZCB3aXRoIGEgc3RpcHBsZSBwYXR0ZXJuLiAqLworICAgICAgICAgICAg ICBYU2V0RmlsbFN0eWxlIChzLT5kaXNwbGF5LCBnYywgRmlsbE9wYXF1ZVN0aXBwbGVkKTsKKyAg ICAgICAgICAgICAgeF9maWxsX3JlY3RhbmdsZSAocy0+ZiwgZ2MsIHgsIHksIHcsIGgpOworICAg ICAgICAgICAgICBYU2V0RmlsbFN0eWxlIChzLT5kaXNwbGF5LCBnYywgRmlsbFNvbGlkKTsKKyAg ICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAg IFhHQ1ZhbHVlcyB4Z2N2OworICAgICAgICAgICAgICBYR2V0R0NWYWx1ZXMgKHMtPmRpc3BsYXks IGdjLCBHQ0ZvcmVncm91bmQgfCBHQ0JhY2tncm91bmQsICZ4Z2N2KTsKKyAgICAgICAgICAgICAg WFNldEZvcmVncm91bmQgKHMtPmRpc3BsYXksIGdjLCB4Z2N2LmJhY2tncm91bmQpOworICAgICAg ICAgICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChzLT5mLCBnYywgeCwgeSwgdywgaCk7CisgICAgICAg ICAgICAgIFhTZXRGb3JlZ3JvdW5kIChzLT5kaXNwbGF5LCBnYywgeGdjdi5mb3JlZ3JvdW5kKTsK KyAgICAgICAgICAgIH0KKyAgICAgICAgICB4X3Jlc2V0X2NsaXBfcmVjdGFuZ2xlcyAocy0+Ziwg Z2MpOworICAgICAgICB9CisgICAgfQorICBlbHNlIGlmICghcy0+YmFja2dyb3VuZF9maWxsZWRf cCkKKyAgICB7CisgICAgICBpbnQgYmFja2dyb3VuZF93aWR0aCA9IHMtPmJhY2tncm91bmRfd2lk dGg7CisgICAgICBpbnQgeCA9IHMtPngsIGxlZnRfeCA9IHdpbmRvd19ib3hfbGVmdF9vZmZzZXQg KHMtPncsIF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sICE9IHMtPmhsICYm IHMtPnJpZ2h0X292ZXJoYW5nKSkpCisgICAgICAvKiBXZSBtdXN0IGNsaXAganVzdCB0aGlzIGds eXBoLiAgbGVmdF9vdmVyaGFuZyBwYXJ0IGhhcyBhbHJlYWR5CisgICAgICAgICBkcmF3biB3aGVu IHMtPnByZXYgd2FzIGRyYXduLCBhbmQgcmlnaHRfb3ZlcmhhbmcgcGFydCB3aWxsIGJlCisgICAg ICAgICBkcmF3biBsYXRlciB3aGVuIHMtPm5leHQgaXMgZHJhd24uICovCisgICAgICB4X3NldF9n bHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywgcyk7CisgICAgICBlbHNlCisgICAgICAg IHhfc2V0X2dseXBoX3N0cmluZ19jbGlwcGluZyAocyk7CisgIHN3aXRjaCAocy0+Zmlyc3RfZ2x5 cGgtPnR5cGUpCisgICAgeworICAgIGNhc2UgSU1BR0VfR0xZUEg6CisgICAgICB4X2RyYXdfaW1h Z2VfZ2x5cGhfc3RyaW5nIChzKTsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgWFdJREdFVF9HTFlQ SDoKKyAgICAgIHhfZHJhd194d2lkZ2V0X2dseXBoX3N0cmluZyAocyk7CisgICAgICBicmVhazsK KyAgICBjYXNlIFNUUkVUQ0hfR0xZUEg6CisgICAgICBtY194X2RyYXdfc3RyZXRjaF9nbHlwaF9z dHJpbmcgKHMpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBDSEFSX0dMWVBIOgorICAgICAgaWYg KHMtPmZvcl9vdmVybGFwcykKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7 CisgICAgICBlbHNlCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywg ZmFsc2UpOworICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAgICAg IGJyZWFrOworICAgIGNhc2UgQ09NUE9TSVRFX0dMWVBIOgorICAgICAgaWYgKHMtPmZvcl9vdmVy bGFwcyB8fCAocy0+Y21wX2Zyb20gPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiAhIHMtPmZpcnN0X2dseXBoLT51LmNtcC5hdXRvbWF0aWMpKQorICAgICAgICBzLT5iYWNrZ3Jv dW5kX2ZpbGxlZF9wID0gdHJ1ZTsKKyAgICAgIGVsc2UKKyAgICAgICAgeF9kcmF3X2dseXBoX3N0 cmluZ19iYWNrZ3JvdW5kIChzLCB0cnVlKTsKKyAgICAgIHhfZHJhd19jb21wb3NpdGVfZ2x5cGhf c3RyaW5nX2ZvcmVncm91bmQgKHMpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBHTFlQSExFU1Nf R0xZUEg6CisgICAgICBpZiAocy0+Zm9yX292ZXJsYXBzKQorICAgICAgICBzLT5iYWNrZ3JvdW5k X2ZpbGxlZF9wID0gdHJ1ZTsKKyAgICAgIGVsc2UKKyAgICAgICAgeF9kcmF3X2dseXBoX3N0cmlu Z19iYWNrZ3JvdW5kIChzLCB0cnVlKTsKKyAgICAgIHhfZHJhd19nbHlwaGxlc3NfZ2x5cGhfc3Ry aW5nX2ZvcmVncm91bmQgKHMpOworICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoKKyAgICAgIGVt YWNzX2Fib3J0ICgpOworICAgIH0KKyAgaWYgKCFzLT5mb3Jfb3ZlcmxhcHMpCisgICAgeworICAg ICAgLyogRHJhdyB1bmRlcmxpbmUuICovCisgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3Ap CisgICAgICAgIHsKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFD RV9VTkRFUl9XQVZFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAocy0+ZmFjZS0+ dW5kZXJsaW5lX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgICAgIHhfZHJhd191bmRlcndhdmUg KHMpOworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgWEdDVmFsdWVzIHhnY3Y7CisgICAgICAgICAgICAgICAgICBYR2V0R0NWYWx1ZXMgKHMt PmRpc3BsYXksIHMtPmdjLCBHQ0ZvcmVncm91bmQsICZ4Z2N2KTsKKyAgICAgICAgICAgICAgICAg IFhTZXRGb3JlZ3JvdW5kIChzLT5kaXNwbGF5LCBzLT5nYywgcy0+ZmFjZS0+dW5kZXJsaW5lX2Nv bG9yKTsKKyAgICAgICAgICAgICAgICAgIHhfZHJhd191bmRlcndhdmUgKHMpOworICAgICAgICAg ICAgICAgICAgWFNldEZvcmVncm91bmQgKHMtPmRpc3BsYXksIHMtPmdjLCB4Z2N2LmZvcmVncm91 bmQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlm IChzLT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAg ICB7CisgICAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgdGhpY2tuZXNzLCBwb3NpdGlvbjsKKyAg ICAgICAgICAgICAgaW50IHk7CisgICAgICAgICAgICAgIGlmIChzLT5wcmV2ICYmIHMtPnByZXYt PmZhY2UtPnVuZGVybGluZV9wCisgICAgICAgICAgICAgICAgICAmJiBzLT5wcmV2LT5mYWNlLT51 bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgLyogV2UgdXNlIHRoZSBzYW1lIHVuZGVybGluZSBzdHlsZSBhcyB0aGUg cHJldmlvdXMgb25lLiAqLworICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+cHJldi0+ dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gcy0+cHJl di0+dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAg ZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgdW5k ZXJsaW5lIHRoaWNrbmVzcy4gIERlZmF1bHQgaXMgMSBwaXhlbC4gKi8KKyAgICAgICAgICAgICAg ICAgIGlmIChzLT5mb250ICYmIHMtPmZvbnQtPnVuZGVybGluZV90aGlja25lc3MgPiAwKQorICAg ICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSBzLT5mb250LT51bmRlcmxpbmVfdGhpY2tuZXNz OworICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB0aGlja25lc3Mg PSAxOworICAgICAgICAgICAgICAgICAgaWYgKHhfdW5kZXJsaW5lX2F0X2Rlc2NlbnRfbGluZSkK KyAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+aGVpZ2h0IC0gdGhpY2tuZXNzKSAt IChzLT55YmFzZSAtIHMtPnkpOworICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgLyogR2V0IHRoZSB1bmRlcmxpbmUgcG9z aXRpb24uICBUaGlzIGlzIHRoZSByZWNvbW1lbmRlZAorICAgICAgICAgICAgICAgICAgICAgICAg IHZlcnRpY2FsIG9mZnNldCBpbiBwaXhlbHMgZnJvbSB0aGUgYmFzZWxpbmUgdG8gdGhlIHRvcCBv ZgorICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSB1bmRlcmxpbmUuICBUaGlzIGlzIGEgc2ln bmVkIHZhbHVlIGFjY29yZGluZyB0byB0aGUKKyAgICAgICAgICAgICAgICAgICAgICAgICBzcGVj cywgYW5kIGl0cyBkZWZhdWx0IGlzCisgICAgICAgICAgICAgICAgICAgICAgICAgUk9VTkQgKCht YXhpbXVtIGRlc2NlbnQpIC8gMiksIHdpdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICBST1VO RCh4KSA9IGZsb29yICh4ICsgMC41KSAgKi8KKyAgICAgICAgICAgICAgICAgICAgICBpZiAoeF91 c2VfdW5kZXJsaW5lX3Bvc2l0aW9uX3Byb3BlcnRpZXMKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgcy0+Zm9udCAmJiBzLT5mb250LT51bmRlcmxpbmVfcG9zaXRpb24gPj0gMCkKKyAgICAg ICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gcy0+Zm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9u OworICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHMtPmZvbnQpCisgICAgICAgICAgICAg ICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5mb250LT5kZXNjZW50ICsgMSkgLyAyOworICAgICAg ICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0g dW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0OworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgICAgICBwb3NpdGlvbiA9IG1heCAocG9zaXRpb24sIHVuZGVybGluZV9taW5pbXVtX29m ZnNldCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAvKiBDaGVjayB0aGUgc2Fu aXR5IG9mIHRoaWNrbmVzcyBhbmQgcG9zaXRpb24uICBXZSBzaG91bGQKKyAgICAgICAgICAgICAg ICAgYXZvaWQgZHJhd2luZyB1bmRlcmxpbmUgb3V0IG9mIHRoZSBjdXJyZW50IGxpbmUgYXJlYS4g Ki8KKyAgICAgICAgICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQgPD0gcy0+eWJhc2UgKyBwb3Np dGlvbikKKyAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5oZWlnaHQgLSAxKSAtIChzLT55 YmFzZSAtIHMtPnkpOworICAgICAgICAgICAgICBpZiAocy0+eSArIHMtPmhlaWdodCA8IHMtPnli YXNlICsgcG9zaXRpb24gKyB0aGlja25lc3MpCisgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0g KHMtPnkgKyBzLT5oZWlnaHQpIC0gKHMtPnliYXNlICsgcG9zaXRpb24pOworICAgICAgICAgICAg ICBzLT51bmRlcmxpbmVfdGhpY2tuZXNzID0gdGhpY2tuZXNzOworICAgICAgICAgICAgICBzLT51 bmRlcmxpbmVfcG9zaXRpb24gPSBwb3NpdGlvbjsKKyAgICAgICAgICAgICAgeSA9IHMtPnliYXNl ICsgcG9zaXRpb247CisgICAgICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfZGVmYXVs dGVkX3ApCisgICAgICAgICAgICAgICAgeF9maWxsX3JlY3RhbmdsZSAocy0+Ziwgcy0+Z2MsIHMt PngsIHksIHMtPndpZHRoLCB0aGlja25lc3MpOworICAgICAgICAgICAgICBlbHNlCisgICAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgICAgWEdDVmFsdWVzIHhnY3Y7CisgICAgICAgICAg ICAgICAgICBYR2V0R0NWYWx1ZXMgKHMtPmRpc3BsYXksIHMtPmdjLCBHQ0ZvcmVncm91bmQsICZ4 Z2N2KTsKKyAgICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChzLT5kaXNwbGF5LCBzLT5n Yywgcy0+ZmFjZS0+dW5kZXJsaW5lX2NvbG9yKTsKKyAgICAgICAgICAgICAgICAgIHhfZmlsbF9y ZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCB5LCBzLT53aWR0aCwgdGhpY2tuZXNzKTsKKyAg ICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChzLT5kaXNwbGF5LCBzLT5nYywgeGdjdi5m b3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0K KyAgICAgIC8qIERyYXcgb3ZlcmxpbmUuICovCisgICAgICBpZiAocy0+ZmFjZS0+b3Zlcmx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cy0+eCwgcy0+eSArIGR5LCBzLT53aWR0aCwg aCk7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBYR0NWYWx1 ZXMgeGdjdjsKKyAgICAgICAgICAgICAgWEdldEdDVmFsdWVzIChzLT5kaXNwbGF5LCBzLT5nYywg R0NGb3JlZ3JvdW5kLCAmeGdjdik7CisgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChzLT5k aXNwbGF5LCBzLT5nYywgcy0+ZmFjZS0+c3RyaWtlX3Rocm91Z2hfY29sb3IpOworICAgICAgICAg ICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChzLT5mLCBzLT5nYywgcy0+eCwgcy0+eSArIGR5LCBzLT53 aWR0aCwgaCk7CisgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChzLT5kaXNwbGF5LCBzLT5n YywgeGdjdi5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgLyog RHJhdyByZWxpZWYgaWYgbm90IHlldCBkcmF3bi4gKi8KKyAgICAgIGlmICghcmVsaWVmX2RyYXdu X3AgJiYgcy0+ZmFjZS0+Ym94ICE9IEZBQ0VfTk9fQk9YKQorICAgICAgICAgIHhfZHJhd19nbHlw aF9zdHJpbmdfYm94IChzKTsKKyAgICAgIGlmIChzLT5wcmV2KQorICAgICAgICB7CisgICAgICAg ICAgc3RydWN0IGdseXBoX3N0cmluZyAqcHJldjsKKyAgICAgICAgICBmb3IgKHByZXYgPSBzLT5w cmV2OyBwcmV2OyBwcmV2ID0gcHJldi0+cHJldikKKyAgICAgICAgICAgIGlmIChwcmV2LT5obCAh PSBzLT5obAorICAgICAgICAgICAgICAgICYmIHByZXYtPnggKyBwcmV2LT53aWR0aCArIHByZXYt PnJpZ2h0X292ZXJoYW5nID4gcy0+eCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg IC8qIEFzIHByZXYgd2FzIGRyYXduIHdoaWxlIGNsaXBwZWQgdG8gaXRzIG93biBhcmVhLCB3ZQor ICAgICAgICAgICAgICAgICAgIG11c3QgZHJhdyB0aGUgcmlnaHRfb3ZlcmhhbmcgcGFydCB1c2lu ZyBzLT5obCBub3cuICovCisgICAgICAgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIHNh dmUgPSBwcmV2LT5obDsKKyAgICAgICAgICAgICAgICBwcmV2LT5obCA9IHMtPmhsOworICAgICAg ICAgICAgICAgIG1jX3hfc2V0X2dseXBoX3N0cmluZ19nYyAocHJldiwgY3Vyc29yX2djX3ApOwor ICAgICAgICAgICAgICAgIHhfc2V0X2dseXBoX3N0cmluZ19jbGlwcGluZ19leGFjdGx5IChzLCBw cmV2KTsKKyAgICAgICAgICAgICAgICBpZiAocHJldi0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hB Ul9HTFlQSCkKKyAgICAgICAgICAgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfZm9yZWdyb3Vu ZCAocHJldik7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgeF9kcmF3 X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocHJldik7CisgICAgICAgICAgICAg ICAgeF9yZXNldF9jbGlwX3JlY3RhbmdsZXMgKHByZXYtPmYsIHByZXYtPmdjKTsKKyAgICAgICAg ICAgICAgICBwcmV2LT5obCA9IHNhdmU7CisgICAgICAgICAgICAgICAgcHJldi0+bnVtX2NsaXBz ID0gMDsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBpZiAocy0+bmV4dCkKKyAg ICAgICAgeworICAgICAgICAgIHN0cnVjdCBnbHlwaF9zdHJpbmcgKm5leHQ7CisgICAgICAgICAg Zm9yIChuZXh0ID0gcy0+bmV4dDsgbmV4dDsgbmV4dCA9IG5leHQtPm5leHQpCisgICAgICAgICAg ICBpZiAobmV4dC0+aGwgIT0gcy0+aGwKKyAgICAgICAgICAgICAgICAmJiBuZXh0LT54IC0gbmV4 dC0+bGVmdF9vdmVyaGFuZyA8IHMtPnggKyBzLT53aWR0aCkKKyAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgIC8qIEFzIG5leHQgd2lsbCBiZSBkcmF3biB3aGlsZSBjbGlwcGVkIHRvIGl0 cyBvd24gYXJlYSwKKyAgICAgICAgICAgICAgICAgICB3ZSBtdXN0IGRyYXcgdGhlIGxlZnRfb3Zl cmhhbmcgcGFydCB1c2luZyBzLT5obCBub3cuICovCisgICAgICAgICAgICAgICAgZW51bSBkcmF3 X2dseXBoc19mYWNlIHNhdmUgPSBuZXh0LT5obDsKKyAgICAgICAgICAgICAgICBuZXh0LT5obCA9 IHMtPmhsOworICAgICAgICAgICAgICAgIG1jX3hfc2V0X2dseXBoX3N0cmluZ19nYyAobmV4dCwg Y3Vyc29yX2djX3ApOworICAgICAgICAgICAgICAgIHhfc2V0X2dseXBoX3N0cmluZ19jbGlwcGlu Z19leGFjdGx5IChzLCBuZXh0KTsKKyAgICAgICAgICAgICAgICBpZiAobmV4dC0+Zmlyc3RfZ2x5 cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSCkKKyAgICAgICAgICAgICAgICAgIHhfZHJhd19nbHlwaF9z dHJpbmdfZm9yZWdyb3VuZCAobmV4dCk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAg ICAgICAgICAgeF9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAobmV4dCk7 CisgICAgICAgICAgICAgICAgeF9yZXNldF9jbGlwX3JlY3RhbmdsZXMgKG5leHQtPmYsIG5leHQt PmdjKTsKKyAgICAgICAgICAgICAgICBuZXh0LT5obCA9IHNhdmU7CisgICAgICAgICAgICAgICAg bmV4dC0+bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICAgICAgICBuZXh0LT5jbGlwX2hlYWQgPSBz LT5uZXh0OworICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIC8qIFJlc2V0IGNs aXBwaW5nLiAqLworICB4X3Jlc2V0X2NsaXBfcmVjdGFuZ2xlcyAocy0+Ziwgcy0+Z2MpOworICBz LT5udW1fY2xpcHMgPSAwOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogLyogRGVmYXVsdCB0byB1c2luZyBYSU0gaWYgYXZhaWxh YmxlLiAgKi8KICNpZmRlZiBVU0VfWElNCiBib29sIHVzZV94aW0gPSB0cnVlOwpAQCAtOTk5LDYg KzE4NzgsMTUgQEAgeF91cGRhdGVfYmVnaW4gKHN0cnVjdCBmcmFtZSAqZikKICAgaWYgKEZSQU1F X1RPT0xUSVBfUCAoZikgJiYgIUZSQU1FX1ZJU0lCTEVfUCAoZikpCiAgICAgcmV0dXJuOwogCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYt Pm1jX3VwZGF0aW5nX2ZyYW1lID0gZjsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog ICBpZiAoISBGUkFNRV9DUl9TVVJGQUNFIChmKSkKICAgICB7CiAgICAgICBpbnQgd2lkdGgsIGhl aWdodDsKQEAgLTEyNjYsNiArMjE1NCwxNiBAQCB4X3VwZGF0ZV9lbmQgKHN0cnVjdCBmcmFtZSAq ZikKICAgWEZsdXNoIChGUkFNRV9YX0RJU1BMQVkgKGYpKTsKICAgdW5ibG9ja19pbnB1dCAoKTsK ICNlbmRpZgorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09S UyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gTlVMTDsKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogfQogCiAvKiBUaGlzIGZ1bmN0aW9uIGlzIGNhbGxlZCBmcm9tIHZhcmlv dXMgcGxhY2VzIGluIHhkaXNwLmMKQEAgLTEzMTAwLDYgKzEzOTk4LDIwIEBAIHhfYWN0aXZhdGVf dGltZW91dF9hdGltZXIgKHZvaWQpCiAKIHN0YXRpYyBzdHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFj ZSB4X3JlZGlzcGxheV9pbnRlcmZhY2UgPQogICB7CisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBp biBgeHRlcm0uY2AgbXVzdCBiZSBpbiB0aGUgZXhhY3Qgc2FtZSBvcmRlciBhcyB0aGUKK2ByZWRp c3BsYXlfaW50ZXJmYWNlJyBpbiBgZGlzcGV4dGVybi5oYCEgKi8KKworICBtY194X2RyYXdfd2lu ZG93X2N1cnNvciwKKyAgbWNfeF9kcmF3X2dseXBoX3N0cmluZywKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogICAgIHhfZnJhbWVfcGFybV9oYW5kbGVycywKICAgICB4X3Byb2R1Y2Vf Z2x5cGhzLAogICAgIHhfd3JpdGVfZ2x5cGhzLAo= --Multipart_Sun_Jun_23_19:25:16_2019-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs). References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sun, 30 Jun 2019 05:43:03 +0000 Resent-Message-ID: <handler.22873.B22873.156187333916677 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22873 <at> debbugs.gnu.org,17684 <at> debbugs.gnu.org Cc: eliz@HIDDEN, johnw@HIDDEN, mbork@HIDDEN, rms@HIDDEN, akioburns@HIDDEN Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.156187333916677 (code B ref 22873); Sun, 30 Jun 2019 05:43:03 +0000 Received: (at 22873) by debbugs.gnu.org; 30 Jun 2019 05:42:19 +0000 Received: from localhost ([127.0.0.1]:45245 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1hhSbT-0004Kq-49 for submit <at> debbugs.gnu.org; Sun, 30 Jun 2019 01:42:19 -0400 Received: from gateway36.websitewelcome.com ([192.185.197.22]:36276) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1hhSbR-0004Ka-Ci for 22873 <at> debbugs.gnu.org; Sun, 30 Jun 2019 01:42:17 -0400 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway36.websitewelcome.com (Postfix) with ESMTP id 33F8E400D0016 for <22873 <at> debbugs.gnu.org>; Sun, 30 Jun 2019 00:04:37 -0500 (CDT) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id hSbPhs6yJ4FKphSbPh7W3M; Sun, 30 Jun 2019 00:42:16 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=afngZaUX0wcFQEsRkU6LIPE0DTtlWWO3YSgqdGO+IW0=; b=lGrVEJZxfX5hVkDWOT56yf1ivE sD3TUyRrVEbQOfvPxgRE6WEPNdmeyAKwZbaPcstl7nTsuKYb6rk6zfRr/0HaXrHLcXchn84KisWfK bQWOUSO824CSg5qtoHNVuzCgROF94OeDl064g4itYZ3KJjOov4iajSoXRtsdST1DGvL+Xk0bLvHDO ILd5FV2if9BaEzs1nxY0SfJByE9QASo3KPHn+QECxmXFB99bz6IuYTmkUVb2s9csoiR/OtT1L2Snz wS+T1boptync7gFtcpG1KP4867Lko+dx36NeY7A9JrGm2ogD8QbFK1DYkEHhNzLPiJgzJrdjxMPzA relbw6yg==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:54194 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from <esq@HIDDEN>) id 1hhSbL-003tZj-I8; Sun, 30 Jun 2019 00:42:14 -0500 Date: Sat, 29 Jun 2019 22:42:10 -0700 Message-ID: <m2sgrr39zh.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Sat_Jun_29_22:42:10_2019-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1hhSbL-003tZj-I8 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:54194 X-Source-Auth: lawlist X-Email-Count: 7 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> --Multipart_Sat_Jun_29_22:42:10_2019-1 Content-Type: text/plain; charset=US-ASCII VERSION: 021.004 [06/29/2019] CHANGELOG: - Fake cursors can now be suppressed in the inactive windows by setting to `nil' the buffer-local variables `mc-inactive-windows', `fc-inactive-windows', and/or `ch-inactive-windows'. The left fringe bitmap indicator that coincides with the line containing POINT (if `ch-horizontal-ruler' is non-nil) is drawn in the inactive windows regardless of the boolean value of `ch-inactive-windows' -- this is an intended feature. The real fake cursor coinciding with the line containing POINT for inactive windows is drawn in the inactive windows -- this is an intended feature. [Support for _suppression_ of fake cursors in the inactive windows had previously been disabled for an appreciable period of time because work needed to be done to ensure fake cursors are drawn correctly when `mc/fc/ch-inactive-windows' is non-nil; e.g., different colors for fake cursors in the inactive-windows.] - Miscellaneous tidying-up of some code. SCREENSHOTS (X11, W32, NS): https://www.lawlist.com/images/22873_17684_light_dark_backgrounds.png SETUP: Step 1: git clone -b master git://git.sv.gnu.org/emacs.git Step 2: In the new emacs folder, go back to an Emacs version from 04/08/2019: git reset --hard a038df77de7b1aa2d73a6478493b8838b59e4982 Step 3: From within the new emacs folder created in Step 1, apply the patch: git apply /path/to/the/patch.diff Step 4: ./autogen.sh Step 5: ./configure ... [your custom options] Step 6: make Step 7: make install USAGE: - For a minimal working example of built-in fake cursors, type: M-x mc-test ;;; TURN ON FAKE CURSORS (buffer position, cursor-type, cursor color): (setq mc-conf '((1 "hbar" "magenta") (2 "bar" "purple") (3 "box" "#00FF00") (4 "hollow" "#0000FF") (5 ("hbar" 3) [1.0 0.0 1.0]) (6 ("bar" 3) [0.0 1.0 1.0]) (7 "framed" "OrangeRed")))) ;;; TURN OFF FAKE CURSORS: (setq mc-conf nil) - To try out both the crosshairs feature and the visible fill column indicator feature, type: M-x +-mode - To try out just the visible fill column indicator feature, type: M-x fc-mode - To try out built-in fake cursors with Magnar Sveen's multiple-cursors package, that package must be installed. If the multiple-cursors package is already installed, then just (require 'crosshairs) and `crosshairs.el` will redefine a few of the multiple-cursors functions and set up a few keyboard shortcuts. If the multiple-cursors package by Magnar Sveen is not already installed, then here are two easy ways to install that package: Type: M-x mc-install OR, evaluate the following snippet: (progn (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) (package-refresh-contents) (package-install 'multiple-cursors) (mc/built-in-cursors)) TODO: - When an idle-timer fires and point is at the end of a horizontally scrolled line in a narrow window, the temporary horizontal scroll is canceled. Create a minimal working example and file a bug report. - `ns_draw_window_cursor' calls `ns_clip_to_rect', which does _not_ take `row->clip` into consideration when drawing cursors with `NSRectFill'. When it comes time to draw glyphs on top of the box/hollow family of cursors, `row->clip` is taken into consideration by `get_glyph_string_clip'. Fake cursors can be drawn even though the glyphs cannot, resulting in hollow/box family of cursors without text. The issue can be reproduced with M-x mc-test. [A temporary workaround is to disable `row->clip` while drawing the glyphs.] https://lists.gnu.org/archive/html/emacs-devel/2019-04/msg00009.html - Deal with left/right overwritten glyphs in the w32 and X ports of Emacs. - There is a bug affecting the recorded `w->mc.lnum_pixel_width` that is observable when not running under gdb, but disappears when running under gdb. While viewing a folded org-mode buffer, the non-gdb instance had a visible line number pixel-width of 44, but Emacs treated it as fluctuating between 44 and 55 as the cursor was moved to the end of line. In the gdb instance, the visible line number pixel width was 55 with no fluctuation under the same conditions as the non-gdb instance. This appears to be a different bug than bug#32177 (current line number shifts one column to the left) because the line number of the current line does not shift left, and changing the bidi settings did not correct the issue. - The current test for `auto_hscroll_mode_p' only looks for `current_line` and all five related tests are based upon that assumption, which may not be true. - Multiple Cursors: If point is in the middle of a composite character, then select a fully composed character so that the fake cursor is visible. - Implement functionality similar to the Lisp multiple-cursors by Magnar Sveen. - Follow up with the Emacs team re bug#32177; i.e., (Current line number shifts one column to the left.) - Follow up with the Emacs team re bug#32060; i.e., Horizontal Scrolling (Current Line): Wrong line gets h-scrolled. - Determine if bug #28936 needs to be fixed and help the Emacs team re same. - Is there any additional meaningful optimization that can be added to the three calls of `mc_pre_scroll_clean'? - There is a bug affecting an older version of Emacs for the NS port that causes partial line flickering when the same characters are grouped together (;;;;;;) and MC_GLYPHLESS cursors are above or below -- having the same background color as the frame; e.g., black on black (used to erase a glyphless cursor). The partial flickering is only noticeable with rapid fire; e.g., holding down the right/left arrow key. When changing the color of the glyphless cursor, the issue is not present. [@lawlist has verified that the X and HPOS coordinates are accurate.] - NOTE: As to `mc_scrolling_window', it would appear that there is no tangible benefit to rotating the current/prospective cache of fake cursors to compare the data before removing the fake cursors. When scrolling the display, only _some_ lines are copied to new locations. Areas that are not overwritten may have fake cursors and those may not necessarily be removed if desired/current matrix glyphs are equal. The test for `GLYPH_EQUAL_P' does not take into consideration the existence of a fake cursor, and the glyph (with a fake cursor) may not be updated as a result thereof. As to lines that are not copied, portions may be updated and fake cursors would be removed thereby. --Multipart_Sat_Jun_29_22:42:10_2019-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="2019_06_29__20_23_09_354.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvY3Jvc3NoYWlycy5lbCBiL2xpc3AvY3Jvc3NoYWlycy5lbApuZXcg ZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi43ODI3NTJmCi0tLSAvZGV2L251bGwKKysr IGIvbGlzcC9jcm9zc2hhaXJzLmVsCkBAIC0wLDAgKzEsMTI4OCBAQAorOzs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Cis7OzsgQkVHSU4gbW9kaWZpY2F0aW9uIG9mIHRoZSBNdWx0aXBsZSBDdXJzb3Jz IGxpYnJhcnkgd3JpdHRlbiBieSAgTWFnbmFyIFN2ZWVuLgorCisoZGVmdmFyIHBhY2thZ2UtYXJj aGl2ZXMpCisKKyhkZWZ2YXIgbWMtLW1heC1jdXJzb3JzLW9yaWdpbmFsKQorKGRlZnZhciBtYy9t YXgtY3Vyc29ycykKKyhkZWZ2YXIgbWMtLW1heC1jdXJzb3JzLW9yaWdpbmFsKQorKGRlZnZhciBt Yy9tYXgtY3Vyc29ycykKKyhkZWZ2YXIgbWMvYWx3YXlzLXJ1bi1mb3ItYWxsKQorKGRlZnZhciBt Yy0tdGhpcy1jb21tYW5kKQorKGRlZnZhciBtYy9jbWRzLXRvLXJ1bi1vbmNlKQorKGRlZnZhciBt Yy0tZGVmYXVsdC1jbWRzLXRvLXJ1bi1mb3ItYWxsKQorKGRlZnZhciBtYy9jbWRzLXRvLXJ1bi1m b3ItYWxsKQorKGRlZnZhciBtYy0tZGVmYX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XJ5IG1heGlt dW06ICIpKQorICAgICAgICAgIChtYy9yZW1vdmUtZmFrZS1jdXJzb3JzKQorICAgICAgICAgIChl cnJvciAiQWJvcnRlZDogdG9vIG1hbnkgY3Vyc29ycyIpKSkpCisgICAgKGxldCAoKG92ZXJsYXkK KyAgICAgICAgICAgIChpZiBtYy91c2UtYnVpbHQtaW4tY3Vyc29ycworICAgICAgICAgICAgICAo bWFrZS1vdmVybGF5IChwb2ludCkgKHBvaW50KSkKKyAgICAgICAgICAgICAgKG1jL21ha2UtY3Vy c29yLW92ZXJsYXktYXQtcG9pbnQpKSkpCisgICAgICAob3ZlcmxheS1wdXQgb3ZlcmxheSAnbWMt aWQgKG9yIGlkIChtYy9jcmVhdGUtY3Vyc29yLWlkKSkpCisgICAgICAob3ZlcmxheS1wdXQgb3Zl cmxheSAndHlwZSAnZmFrZS1jdXJzb3IpCisgICAgICAob3ZlcmxheS1wdXQgb3ZlcmxheSAncHJp b3JpdHkgMTAwKQorICAgICAgKG1jL3N0b3JlLWN1cnJlbnQtc3RhdGUtaW4tb3ZlcmxheSBvdmVy bGF5KQorICAgICAgKHdoZW4gKHVzZS1yZWdpb24tcCkKKyAgICAgICAgKG92ZXJsYXktcHV0IG92 ZXJsYXkgJ3JlZ2lvbi1vdmVybGF5CisgICAgICAgICAgICAgICAgICAgICAobWMvbWFrZS1yZWdp b24tb3ZlcmxheS1iZXR3ZWVuLXBvaW50LWFuZC1tYXJrKSkpCisgICAgICBvdmVybGF5KSkKKwor ICAoZGVmdW4gbWMvZXhlY3V0ZS1jb21tYW5kLWZvci1hbGwtZmFrZS1jdXJzb3JzIChjbWQpCisg ICAgIkNhbGxzIENNRCBpbnRlcmFjdGl2ZWx5IGZvciBlYWNoIGN1cnNvci4KKyAgSXQgd29ya3Mg YnkgbW92aW5nIHBvaW50IHRvIHRoZSBmYWtlIGN1cnNvciwgc2V0dGluZworICB1cCB0aGUgcHJv cGVyIGVudmlyb25tZW50LCBhbmQgdGhlbiByZW1vd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l0aCBtdWx0aXBsZSBjdXJzb3JzJXMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg IG9yaWdpbmFsLWNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdldCBvcmln aW5hbC1jb21tYW5kICdtYy0tdW5zdXBwb3J0ZWQpKQorICAgICAgICAgICAgICAgICAgKHdoZW4g KGFuZCBvcmlnaW5hbC1jb21tYW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChub3Qg KG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy0tZGVmYXVsdC1jbWRzLXRvLXJ1bi1vbmNlKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKG5vdCAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1j L2NtZHMtdG8tcnVuLW9uY2UpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAob3IgbWMv YWx3YXlzLXJ1bi1mb3ItYWxsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVt cSBvcmlnaW5hbC1jb21tYW5kIG1jLS1kZWZhdWx0LWNtZHMtdG8tcnVuLWZvci1hbGwpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jL2Nt ZHMtdG8tcnVuLWZvci1hbGwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWMv cHJvbXB0LWZvci1pbmNsdXNpb24taW4td2hpdGVsaXN0IG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAg ICAgICAgICAgICAgICAgICAgKG1jL2V4ZWN1dGUtY29tbWFuZC1mb3ItYWxsLWZha2UtY3Vyc29y cyBvcmlnaW5hbC1jb21tYW5kKSkpKQorICAgICAgICAgICAgICAod2hlbiBtYy91c2UtYnVpbHQt aW4tY3Vyc29ycworICAgICAgICAgICAgICAgIChzZXRxIG1jLWNvbmYKKyAgICAgICAgICAgICAg ICAgICAgICAgIChtYXBjYXIKKy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m5hbGx5IGJ5IG11bHRpcGx5aW5nIGVhY2ggZWxl bWVudCBvZiB0aGUgTFNMIGNvbG9yIHZlY3RvciBieSA2NTUzNS4iCisoaW50ZXJhY3RpdmUpCisg IChsZXQgKChidWZmZXIgKGdldC1idWZmZXItY3JlYXRlICIqTUMtVEVTVCoiKSkpCisgICAgKHdp dGgtY3VycmVudC1idWZmZXIgYnVmZmVyCisgICAgICAoZXJhc2UtYnVmZmVyKQorICAgICAgKGlu c2VydCAiVGhpcyBpcyBhIHRlc3QhIikKKyAgICAgIChzZXRxIG1jLWNvbmYgJygoMSAiaGJhciIg Im1hZ2VudGEiKQorICAgICAgICAgICAgICAgICAgICAgICgyICJiYXIiICJwdXJwbGUiKQorICAg ICAgICAgICAgICAgICAgICAgICgzICJib3giICIjMDBGRjAwIikKKyAgICAgICAgICAgICAgICAg ICAgICAoNCAiaG9sbG93IiAiIzAwMDBGRiIpCisgICAgICAgICAgICAgICAgICAgICAgKDUgKCJo YmFyIiAzKSBbMS4wIDAuMCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg2ICgiYmFyIiAz KSBbMC4wIDEuMCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg3ICJmcmFtZWQiICJPcmFu Z2VSZWQiKQorICAgICAgICAgICAgICAgICAgICAgICg4ICJib3giICJncmV5MjUiKQorICAgICAg ICAgICAgICAgICAgICAgICg5ICJib3giICJncmV5NzUiKSkpKQorICAgIChzZWxlY3Qtd2luZG93 IChkaXNwbGF5LWJ1ZmZlciBidWZmZXIpKSkpCisKKyhkZWZ1biArLXRpbWVyLWZuICgpCisiU2lu Y2UgdGhpcyBmaXJlcyBnbG9iYWxseSwgd2UgbXVzdCBjb250cm9sIHdoaWNoIGJ1ZmZlcnMgY3Jv c3NoYWlycyBhcHBlYXIgaW4uIgorICAod2hlbiArLW1vZGUKKyAgICAodW5sZXNzIChvciAobWVt cSBsYXN0LWNvbW1hbmQgKy1wYXJlbnMtZXhjbHVzaW9ucykKKyAgICAgICAgICAgICAgICAobnVs bCArLXBhcmVucy1wKSkKKyAgICAgICgrLXBhcmVucy1mbikpCisgICAgKHdoZW4gKy10aW1lci12 YXIKKyAgICAgIChzZXRxIHRpbWVyLWlkbGUtbGlzdCAoZGVscSArLXRpbWVyLXZhciB0aW1lci1p ZGxlLWxpc3QpKQorICAgICAgKHNldHEgKy10aW1lci12YXIgbmlsKSkpKQorCisoZGVmdW4gKy1k cmF3LWZvcnRod2l0aCAoKQorIkltbWVkaWF0ZWx5IGRlbGV0ZS9kcmF3IG1hdGNoaW5nIHBhcmVu dGhlc2VzLiIKKyAgKCstZHJhdy1jcm9zc2hhaXJzICdmb3JjZSkpCisKKyhkZWZ1biArLWRyYXct Y3Jvc3NoYWlycyAoJm9wdGlvbmFsIGZvcmNlKQorIkltbWVkaWF0ZWx5IGRlbGV0ZSBtYXRjaGlu ZyBwYXJlbnRoZXNlcy4gIElmIEZPUkNFIGlzIG5vbi1uaWwsIHRoZW4gaW1tZWRpYXRlbHkKK2Ry YXcgbWF0Y2hpbmcgcGFyZW50aGVzaXM7IG90aGVyd2lzZSwgZHJhdyB0aGVtIG9uIGFuIGlkbGUt dGllci4iCisgICh3aGVuICstbW9kZQorICAgICh3aGVuICstdGltZXItdmFyCisgICAgICAoc2V0 cSB0aW1lci1pZGxlLWxpc3QgKGRlbHEgKy10aW1lci12YXIgdGltZXItaWRsZS1saXN0KSkKKyAg ICAgIChzZXRxICstdGltZXItdmFyIG5pbCkpCisgICAgKHVubGVzcyAob3IgKG1lbXEgdGhpcy1j b21tYW5kICstcGFyZW5zLWV4Y2x1c2lvbnMpCisgICAgICAgICAgICAgICAgKGFuZCAobnVsbCAr LXBhcmVucy1wKQorICAgICAgICAgICAgICAgICAgICAgKG51bGwgKy1wYXJlbnMtb3ZlcmxheXMt ZXhpc3QtcCkpKQorICAgICAgKCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykpCisgICAgKGlmIGZv cmNlCisgICAgICAocHJvZ24KKyAgICAgICAgKHdoZW4gKy1wYXJlbnMtcAorICAgICAgICAgICgr LXBhcmVucy1mbikpKQorICAgICAgKHNldHEgKy10aW1lci12YXIgKHJ1bi13aXRoLWlkbGUtdGlt ZXIgKy1pZGxlLXRpbWVyLXNlY29uZHMgbmlsICMnKy10aW1lci1mbikpKSkpCisKKyhkZWZ2YXIg ZmMtbW9kZSkKKworOzs7IyMjYXV0b2xvYWQKKyhkZWZpbmUtbWlub3ItbW9kZSArLW1vZGUKKyJN aW5vciBtb2RlIGZvciBkaXNwbGF5aW5nIGEgaG9yaXpvbnRhbCBydWxlci4iCisgIDppbml0LXZh bHVlIG5pbAorICA6bGlnaHRlciAiICsiCisgIDprZXltYXAgbmlsCisgIDpnbG9iYWwgbmlsCisg IDpncm91cCAnKy1tb2RlCisgIChjb25kCisgICAgKCstbW9kZQorICAgICAgOzs7IGArLW1vZGUn IGhhcyB0aGUgYWJpbGl0eSB0byBhbHNvIGRpc3BsYXkgYSBmaWxsIGNvbHVtbiBpbmRpY2F0b3Iu CisgICAgICA7OzsgU2VlIHRoZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicuCisgICAgICAod2hl biBmYy1tb2RlCisgICAgICAgIChmYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgZ2xvYmFs LWVsZG9jLW1vZGUKKyAgICAgICAgICAgICAgICAgKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAgJ2Fu eSkKKyAgICAgICAgICAgICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAg ICAgICAgKGdsb2JhbC1lbGRvYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgaml0LWxvY2st Y29udGV4dC10aW1lcgorICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAn YW55KQorICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQor ICAgICAgICAod2hlbiAodGltZXJwIGppdC1sb2NrLWNvbnRleHQtdGltZXIpCisgICAgICAgICAg KGNhbmNlbC10aW1lciBqaXQtbG9jay1jb250ZXh0LXRpbWVyKSkKKyAgICAgICAgOzsgKHNldHEg aml0LWxvY2stY29udGV4dC10aW1lciAocnVuLXdpdGgtaWRsZS10aW1lciA1LjAgJ3JlcGVhdCAn aml0LWxvY2stY29udGV4dC1mb250aWZ5KSkKKyAgICAgICAgKHNldHEgaml0LWxvY2stY29udGV4 dC10aW1lciBuaWwpKQorICAgICAgKHdoZW4gKGFuZCAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAn YW55KQorICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQor ICAgICAgICAod2hlbiAodGltZXJwIHVuZG8tYXV0by1jdXJyZW50LWJvdW5kYXJ5LXRpbWVyKQor ICAgICAgICAgIChjYW5jZWwtdGltZXIgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIp KQorICAgICAgICAoZnNldCAndW5kby1hdXRvLS11bmRvYWJsZS1jaGFuZ2UKKyAgICAgICAgICAg ICAgKGxhbWJkYSAoKSAoYWRkLXRvLWxpc3QgJ3VuZG8tYXV0by0tdW5kb2FibHktY2hhbmdlZC1i dWZmZXJzIChjdXJyZW50LWJ1ZmZlcikpKSkKKyAgICAgICAgKGZzZXQgJ3VuZG8tYXV0by1hbWFs Z2FtYXRlICdpZ25vcmUpKQorICAgICAgKHdoZW4gYmxpbmstY3Vyc29yLW1vZGUKKyAgICAgICAg KGJsaW5rLWN1cnNvci1tb2RlIC0xKQorICAgICAgICAod2hlbiAobWVtcSAnYmxpbmstY3Vyc29y LWNoZWNrIHBvc3QtY29tbWFuZC1ob29rKQorICAgICAgICAgIChyZW1vdmUtaG9vayAncG9zdC1j b21tYW5kLWhvb2sgJ2JsaW5rLWN1cnNvci1jaGVjaykpKQorICAgICAgKHNldHEgY3Jvc3NoYWly cyB0KQorICAgICAgKHdoZW4g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yICcoYnVmZmVyLWRpc3BsYXktdGFibGUK KyAgICAgICAgICAgICAgICAgICAgIGZyaW5nZS1pbmRpY2F0b3ItYWxpc3QKKyAgICAgICAgICAg ICAgICAgICAgIHRhYi13aWR0aAorICAgICAgICAgICAgICAgICAgICAgbGluZS1tb3ZlLXZpc3Vh bAorICAgICAgICAgICAgICAgICAgICAgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgICAgICAgICAg ICAgIHRydW5jYXRlLXBhcnRpYWwtd2lkdGgtd2luZG93cworICAgICAgICAgICAgICAgICAgICAg d29yZC13cmFwKSkKKyAgICAgICAgKHdoZW4gKGxvY2FsLXZhcmlhYmxlLXAgdmFyKQorICAgICAg ICAgIChwdXNoIChjb25zIHZhciAoc3ltYm9sLXZhbHVlIHZhcikpICstLXNhdmVkLXN0YXRlKSkp CisgICAgICAoc2V0cSBmaWxsLWNvbHVtbiA4MCkKKyAgICAgIChzZXRxIGRpc3BsYXktbGluZS1u dW1iZXJzIHQpCisgICAgICAoc2V0cS1sb2NhbCBhdXRvLWhzY3JvbGwtbW9kZSAnY3VycmVudC1s aW5lKQorICAgICAgKHNldHEtbG9jYWwgaHNjcm9sbC1zdGVwIDUpCisgICAgICAoc2V0cSBidWZm ZXItZGlzcGxheS10YWJsZSArLWJ1ZmZlci1kaXNwbGF5LXRhYmxlKQorICAgICAgKHNldHEgdGFi LXdpZHRoIDQpCisgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICdsaW5lLW1vdmUtdmlz dWFsKSB0KQorICAgICAgKHNldHEgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgKGNvbmQKKyAgICAg ICAgICAoKGxldCAoKGxzdCArLXRydW5jYXRlLWxpbmVzLWRlcml2ZWQtbW9kZXMpCisgICAgICAg ICAgICAgICAgICBtb2RlKQorICAgICAgICAgICAgKGNhdGNoICdmb3VuZAorICAgICAgICAgICAg ICAod2hpbGUgKHNldHEgbW9kZSAocG9wIGxzdCkpCisgICAgICAgICAgICAgICAgKHdoZW4gKGRl cml2ZWQtbW9kZS1wIG1vZGUpCisgICAgICAgICAgICAgICAgICAodGhyb3cgJ2ZvdW5kIHQpKSkp KSkKKyAgICAgICAgICAgKChtZW1xIG1ham9yLW1vZGUgKy10cnVuY2F0ZS1saW5lcy1tYWpvci1t b2RlcykpCisgICAgICAgICAgICh0CisgICAgICAgICAgICAgbmlsKSkpCisgICAgICAoc2V0ICht YWtlLWxvY2FsLXZhcmlhYmxlICd0cnVuY2F0ZS1wYXJ0aWFsLXdpZHRoLXdpbmRvd3MpIG5pbCkK KyAgICAgIChzZXRxIHdvcmQtd3JhcCB0KQorICAgICAgKHNldHEgaW5kaWNhdGUtZW1wdHktbGlu ZXMgdCkKKyAgICAgIChzZXRxIGluZGljYXRlLWJ1ZmZlci1ib3VuZGFyaWVzICdsZWZ0KQorICAg ICAgKHNldHEgZnJpbmdlLWluZGljYXRvci1hbGlzdAorICAgICAgICAgIDs7OyBoc2NsX2FsbF90 ZW1wX3AgfCBoc2NsX3RlbXBfcAorICAgICAgICAnKCgrLWhzY2wtdGVtcCAuICgrLXNpbmdsZS1h bmdsZS1sZWZ0CisgICAgICAgICAgICAgICAgICAgICAgICAgICstZG91YmxlLWFuZ2xlLWxlZnQp KQorICAgICAgICAgIDs7OyBoc2NsX2FsbF9wZXJtXzBfcCB8IGhzY2xfYWxsX3Blcm1fMV9wIHwg aHNjbF9hbGxfcGVybV8yX3AgfCBoc2NsX3Blcm1fcAorICAgICAgICAgICgrLWhzY2wtcGVybSAu ICgrLXNpbmdsZS1hbmdsZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLWRvdWJsZS1h bmdsZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLXRyaXBsZS1hbmdsZS11cAorICAg ICAgICAgICAgICAgICAgICAgICAgICArLXF1YWRydXBsZS1hbmdsZS11cCkpCisgICAgICAgICAg KCstb3ZlcmxheS1hcnJvdyAuICgrLWZyaW5nZS1sZWZ0LWFycm93CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICArLWZyaW5nZS1yaWdodC1hcnJvdykpCisgICAgICAgICAgKHRydW5jYXRp b24gLiAoKy1mcmluZ2UtbGVmdC1hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICstZnJp bmdlLXJpZ2h0LWFycm93KSkKKyAgICAgICAgICAoY29udGludWF0aW9uIC4gKCstZnJpbmdlLWxl ZnQtY3VybHktYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICstYmFja3NsYXNoKSkK KyAgICAgICAgICAob3ZlcmxheS1hcnJvdyAuICstZnJpbmdlLXJpZ2h0LXRyaWFuZ2xlKQorICAg ICAgICAgICh1cCAuICstZnJpbmdlLXVwLWFycm93KQorICAgICAgICAgIChkb3duIC4gKy1mcmlu Z2UtZG93bi1hcnJvdykKKyAgICAgICAgICAodG9wIC4gKy1mcmluZ2UtdG9wLWxlZnQtYW5nbGUp CisgICAgICAgICAgKGJvdHRvbSAuICstZnJpbmdlLWJvdHRvbS1yaWdodC1hbmdsZSkKKyAgICAg ICAgICAodG9wLWJvdHRvbSAuICgrLWZyaW5nZS1sZWZ0LWJyYWNrZXQKKyAgICAgICAgICAgICAg ICAgICAgICAgICArLWZyaW5nZS1yaWdodC1icmFja2V0CisgICAgICAgICAgICAgICAgICAgICAg ICAgKy1mcmluZ2UtdG9wLXJpZ2h0LWFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgKy1m cmluZ2UtdG9wLWxlZnQtYW5nbGUpKQorICAgICAgICAgIChlbXB0eS1saW5lIC4gKy1mcmluZ2Ut ZW1wdHktbGluZSkKKyAgICAgICAgICAodW5rbm93biAuICstZnJpbmdlLXF1ZXN0aW9uLW1hcmsp KSkKKyAgICAgIChzZXRxIGZyaW5nZS1jdXJzb3ItYWxpc3QgJygoYm94IC4gKy1mcmluZ2UtbGVm dC10cmlhbmdsZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaG9sbG93IC4g Ky1ob2xsb3ctcmVjdGFuZ2xlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChi YXIgLiArLXZlcnRpY2FsLWJhcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo aGJhciAuICstZnJpbmdlLWhvcml6b250YWwtYmFyKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIChob2xsb3ctc21hbGwgLiArLWZyaW5nZS1ob2xsb3ctc3F1YXJlKSkpCisgICAg ICAoaWYgKG9yICstZm9ydGh3aXRoCisgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZp eC1hcmcgJyg0KSkpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJh dy1mb3J0aHdpdGggJ2FwcGVuZCAnbG9jYWwpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21t YW5kLWhvb2sgJystZHJhdy1jcm9zc2hhaXJzICdhcHBlbmQgJ2xvY2FsKSkKKyAgICAgICh3aGVu ICstZm9ydGh3aXRoCisgICAgICAgIChhZGQtaG9vayAnd2luZG93LWNvbmZpZ3VyYXRpb24tY2hh bmdlLWhvb2sgJystZHJhdy1mb3J0aHdpdGggbmlsICdsb2NhbCkpCisgICAgICAoYWRkLWhvb2sg J2NoYW5nZS1tYWpvci1tb2RlLWhvb2sgJ3R1cm4tb2ZmLSstbW9kZSBuaWwgJ2xvY2FsKQorICAg ICAgOzs7IE1hdGNoaW5nIHBhcmVudGhlc2VzIGRyYXdpbmcgZm9ydGh3aXRoIGludGVyZmVyZXMg d2l0aCB5YXNuaXBwZXQuCisgICAgICAod2hlbiArLWZvcnRod2l0aAorICAgICAgICAoc2V0cSAr LXBhcmVucy1wIG5pbCkpCisgICAgICAod2hlbiAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55 KQorICAgICAgICAoY29uZAorICAgICAgICAgICgrLWZvcnRod2l0aAorICAgICAgICAgICAgKG1l c3NhZ2UgIlR1cm5lZCBPTiBgKy1tb2RlJyAtLSBEcmF3IG1hdGNoaW5nIHBhcmVudGhlc2VzIGlt bWVkaWF0ZWx5LiIpKQorICAgICAgICAgICgoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkp CisgICAgICAgICAgICA7OzsgTWF0Y2hpbmcgcGFyZW50aGVzZXMgd2lsbCBiZSBkcmF3biBpbW1l ZGlhdGVseS4KKyAgICAgICAgICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScgLS0gT3B0 aW1pemVkIGZvciBkZWJ1Z2dpbmcgcHVycG9zZXMuIikpCisgICAgICAgICAgKHQKKyAgICAgICAg ICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScuIikpKSkpCisgICAgKHQKKyAgICAgIChr aWxsLWxvY2FsLXZhcmlhYmxlICdmaWxsLWNvbHVtbikKKyAgICAgIChraWxsLWxvY2FsLXZhcmlh YmxlICdhdXRvLWhzY3JvbGwtbW9kZSkKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdoc2Ny b2xsLXN0ZXApCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnY3Jvc3NoYWlycykKKyAgICAg IChraWxsLWxvY2FsLXZhcmlhYmxlICdmYy12aXNpYmxlKQorICAgICAgKGtpbGwtbG9jYWwtdmFy aWFibGUgJ2Rpc3BsYXktbGluZS1udW1iZXJzKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUg J2Rpc3BsYXktbGluZS1udW1iZXJzLXdpZHRoKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUg J21jLWNvbmYpCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnYnVmZmVyLWRpc3BsYXktdGFi bGUpCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAndGFiLXdpZHRoKQorICAgICAgKGtpbGwt bG9jYWwtdmFyaWFibGUgJ2xpbmUtbW92ZS12aXN1YWwpCisgICAgICAoa2lsbC1sb2NhbC12YXJp YWJsZSAndHJ1bmNhdGUtbGluZXMpCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAndHJ1bmNh dGUtcGFydGlhbC13aWR0aC13aW5kb3dzKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJ3dv cmQtd3JhcCkKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdpbmRpY2F0ZS1lbXB0eS1saW5l cykKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdpbmRpY2F0ZS1idWZmZXItYm91bmRhcmll cykKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdmcmluZ2UtaW5kaWNhdG9yLWFsaXN0KQor ICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJ2ZyaW5nZS1jdXJzb3ItYWxpc3QpCisgICAgICAo a2lsbC1sb2NhbC12YXJpYWJsZSAnKy1mb3J0aHdpdGgpCisgICAgICAoZG9saXN0IChzYXZlZCAr LS1zYXZlZC1zdGF0ZSkKKyAgICAgICAgKHNldCAobWFrZS1sb2NhbC12YXJpYWJsZSAoY2FyIHNh dmVkKSkgKGNkciBzYXZlZCkpKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJystLXNhdmVk LXN0YXRlKQorICAgICAgKCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykKKyAgICAgICh3aGVuICht ZW1xICcrLWRyYXctZm9ydGh3aXRoIHBvc3QtY29tbWFuZC1ob29rKQorICAgICAgICAocmVtb3Zl LWhvb2sgJ3Bvc3QtY29tbWFuZC1ob29rICcrLWRyYXctZm9ydGh3aXRoICdsb2NhbCkpCisgICAg ICAod2hlbiAobWVtcSAnKy1kcmF3LWNyb3NzaGFpcnMgcG9zdC1jb21tYW5kLWhvb2spCisgICAg ICAgIChyZW1vdmUtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJhdy1jcm9zc2hhaXJzICds b2NhbCkpCisgICAgICAod2hlbiAobWVtcSAnKy1kcmF3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AgKG9jaGFyIChjaGFyLWFmdGVyIG9wb2ludCkpCisgICAgICAgICAocG9zMQorICAgICAg ICAgICAoY29uZAorICAgICAgICAgICAgICgoYW5kIG9jaGFyCisgICAgICAgICAgICAgICAgICAg KG9yIDs7OyAoY2hhci10by1zdHJpbmcgNDApID0+IG9wZW5pbmcgcGFyZW50aGVzaXMKKyAgICAg ICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgNDApCisgICAgICAgICAgICAgICAgICAgICAgIDs7 OyAoY2hhci10by1zdHJpbmcgOTEpID0+IG9wZW5pbmcgc3F1YXJlIGJyYWNrZXQKKyAgICAgICAg ICAgICAgICAgICAgICAgKD0gb2NoYXIgOTEpCisgICAgICAgICAgICAgICAgICAgICAgIDs7OyAo Y2hhci10by1zdHJpbmcgMTIzKSA9PiBvcGVuaW5nIHdhdnkgYnJhY2tldAorICAgICAgICAgICAg ICAgICAgICAgICAoPSBvY2hhciAxMjMpKSkKKyAgICAgICAgICAgICAgICAobWluICgxKyBvcG9p bnQpIChwb2ludC1tYXgpKSkKKyAgICAgICAgICAgICAoKG9yIDs7OyAoY2hhci10by1zdHJpbmcg NDEpID0+IGNsb3NpbmcgcGFyZW50aGVzaXMKKyAgICAgICAgICAgICAgICAgICg9IHByZWNlZGlu Zy1jaGFyIDQxKQorICAgICAgICAgICAgICAgICAgOzs7IChjaGFyLXRvLXN0cmluZyA5MykgPT4g Y2xvc2luZyBzcXVhcmUgYnJhY2tldAorICAgICAgICAgICAgICAgICAgKD0gcHJlY2VkaW5nLWNo YXIgOTMpCisgICAgICAgICAgICAgICAgICA7OzsgKGNoYXItdG8tc3RyaW5nIDEyNSkgPT4gY2xv c2luZyB3YXZ5IGJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICg9IHByZWNlZGluZy1jaGFyIDEy NSkpCisgICAgICAgICAgICAgICAgKG1heCAocG9pbnQtbWluKSAoMS0gb3BvaW50KSkpCisgICAg ICAgICAgICAgKHQKKyAgICAgICAgICAgICAgICBvcG9pbnQpKSkKKyAgICAgICAgIHBvczIKKyAg ICAgICAgIHNlbGVjdGVkLWZhY2UpCisgICAgKHNhdmUtZXhjdXJzaW9uCisgICAgICAoY29uZGl0 aW9uLWNhc2UgbmlsCisgICAgICAgICh3aGlsZSAoc2V0cSBwb3MxIChudGggMSAocGFyc2UtcGFy dGlhbC1zZXhwIGZyb20gcG9zMSkpKQorICAgICAgICAgIChzZXRxIHBvczIgKHNjYW4tc2V4cHMg cG9zMSAxKSkKKyAgICAgICAgICAoaWYgKD0gaSAxMCkKKyAgICAgICAgICAgIChzZXRxIGkgMSkK KyAgICAgICAgICAgIChzZXRxIGkgKDErIGkpKSkKKyAgICAgICAgICAoc2V0cSBzZWxlY3RlZC1m YWNlIChjb25kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDEpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLW9uZS1mYWNlKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSAyKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICcrLXBhcmVucy10d28tZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKCg9IGkgMykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1w YXJlbnMtdGhyZWUtZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkg NCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtZm91ci1mYWNl KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA1KQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1maXZlLWZhY2UpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICgoPSBpIDYpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJystcGFyZW5zLXNpeC1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAoKD0gaSA3KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1z ZXZlbi1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA4KQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1laWdodC1mYWNlKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA5KQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICcrLXBhcmVucy1uaW5lLWZhY2UpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICgoPSBpIDEwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICcrLXBhcmVucy10ZW4tZmFjZSkpKQorICAgICAgICAgIChsZXQgKChvdiAobWFrZS1vdmVybGF5 IHBvczEgKDErIHBvczEpKSkpCisgICAgICAgICAgICAodW5sZXNzICstcGFyZW5zLWluYWN0aXZl LXdpbmRvd3MKKyAgICAgICAgICAgICAgKG92ZXJsYXktcHV0IG92ICd3aW5kb3cgd2luKSkKKyAg ICAgICAgICAgIChvdmVybGF5LXB1dCBvdiAnZmFjZSBzZWxlY3RlZC1mYWNlKSkKKyAgICAgICAg ICAod2hlbiBwb3MyCisgICAgICAgICAgICAobGV0ICgob3YgKG1ha2Utb3ZlcmxheSAoMS0gcG9z MikgcG9zMikpKQorICAgICAgICAgICAgICAodW5sZXNzICstcGFyZW5zLWluYWN0aXZlLXdpbmRv d3MKKyAgICAgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ3dpbmRvdyB3aW4pKQorICAgICAg ICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ2ZhY2Ugc2VsZWN0ZWQtZmFjZSkpKSkKKyAgICAgICAg KGVycm9yIG5pbCkpKQorICAgIChzZXRxICstcGFyZW5zLW92ZXJsYXlzLWV4aXN0LXAgdCkpKQor CisoZGVmdW4gKy1yZW1vdmUtb3ZlcmxheXMgKGJlZyBlbmQgbmFtZSB2YWwpCisiUmVtb3ZlIHRo ZSBvdmVybGF5cyB0aGF0IGFyZSBgZXF1YWwtaW5jbHVkaW5nLXByb3BlcnRpZXNgLgorSW5jbHVk ZXMgYSB1bmlxdWUgc2l0dWF0aW9uIHdoZW4gYW4gb3ZlcmxheSB3aXRoIGFuIGAnYWZ0ZXItc3Ry aW5nYCBwcm9wZXJ0eQoraXMgYXQgdGhlIHZlcnkgZW5kIG9mIGEgbmFycm93ZWQtYnVmZmVyLiIK KyAgKGxldCogKChwb2ludC1tYXggKHBvaW50LW1heCkpCisgICAgICAgICAocG9pbnQtbWluIChw b2ludC1taW4pKQorICAgICAgICAgKG5hcnJvd2VkLXAgKGJ1ZmZlci1uYXJyb3dlZC1wKSkKKyAg ICAgICAgIChiZWcgKGlmIGJlZyBiZWcgcG9pbnQtbWluKSkKKyAgICAgICAgIChlbmQKKyAgICAg ICAgICAgKGNvbmQKKyAgICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAobm90IG5h cnJvd2VkLXApCisgICAgICAgICAgICAgICAgIGVuZCkKKyAgICAgICAgICAgICAgIGVuZCkKKyAg ICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAobm90IG5hcnJvd2VkLXApCisgICAg ICAgICAgICAgICAgIChudWxsIGVuZCkpCisgICAgICAgICAgICAgICBwb2ludC1tYXgpCisgICAg ICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFycm93ZWQtcAorICAgICAgICAgICAg ICAgICBlbmQKKyAgICAgICAgICAgICAgICAgKDwgZW5kIHBvaW50LW1heCkpCisgICAgICAgICAg ICAgICBlbmQpCisgICAgICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFycm93ZWQt cAorICAgICAgICAgICAgICAgICBlbmQKKyAgICAgICAgICAgICAgICAgKD0gZW5kIHBvaW50LW1h eCkpCisgICAgICAgICAgICAgICAoMSsgZW5kKSkKKyAgICAgICAgICAgICAoKGFuZAorICAgICAg ICAgICAgICAgICBuYXJyb3dlZC1wCisgICAgICAgICAgICAgICAgIChudWxsIGVuZCkpCisgICAg ICAgICAgICAgICAoMSsgcG9pbnQtbWF4KSkgKSkKKyAgICAgICAgIChvdmVybGF5cworICAgICAg ICAgICAocHJvZ24KKyAgICAgICAgICAgICAob3ZlcmxheS1yZWNlbnRlciBlbmQpCisgICAgICAg ICAgICAgKG92ZXJsYXlzLWluIGJlZyBlbmQpKSkpCisgICAgKHdoZW4gKGFuZCBiZWcgZW5kIG5h bWUgdmFsKQorICAgICAgKGRvbGlzdCAobyBvdmVybGF5cykKKyAgICAgICAgKGNvbmQKKyAgICAg ICAgICAoKGFuZCAoZXEgbmFtZSAnZmFjZSkKKyAgICAgICAgICAgICAgICAoZXEgKG92ZXJsYXkt Z2V0IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIDs7IEVpdGhlciBwdXNoIHRoaXMgb3Zlcmxh eSBvdXRzaWRlIGJlZy4uLmVuZAorICAgICAgICAgICAgOzsgb3Igc3BsaXQgaXQgdG8gZXhjbHVk ZSBiZWcuLi5lbmQKKyAgICAgICAgICAgIDs7IG9yIGRlbGV0ZSBpdCBlbnRpcmVseSAoaWYgaXQg aXMgY29udGFpbmVkIGluIGJlZy4uLmVuZCkuCisgICAgICAgICAgICAoaWYgKDwgKG92ZXJsYXkt c3RhcnQgbykgYmVnKQorICAgICAgICAgICAgICAgIChpZiAoPiAob3ZlcmxheS1lbmQgbykgZW5k KQorICAgICAgICAgICAgICAocHJvZ24KKyAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IChj b3B5LW92ZXJsYXkgbykKKyAgICAgICAgICAgICAgICAgIChvdmVybGF5LXN0YXJ0IG8pIGJlZykK KyAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVuZCBvKSkpCisg ICAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gKG92ZXJsYXktc3RhcnQgbykgYmVnKSkK KyAgICAgICAgICAgICAgKGlmICg+IChvdmVybGF5LWVuZCBvKSBlbmQpCisgICAgICAgICAgICAg ICAgICAobW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVuZCBvKSkKKyAgICAgICAgICAgICAg ICAoZGVsZXRlLW92ZXJsYXkgbykpKSkKKyAgICAgICAgICAoKGFuZCAobm90IChlcSBuYW1lICdm YWNlKSkKKyAgICAgICAgICAgICAgICAoZXF1YWwtaW5jbHVkaW5nLXByb3BlcnRpZXMgKG92ZXJs YXktZ2V0IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIChkZWxldGUtb3ZlcmxheSBvKSkpKSkp KQorCisoZGVmdW4gKy1kZWxldGUtcGFyZW5zLW92ZXJsYXlzICgpCisgICh3aGVuICstcGFyZW5z LW92ZXJsYXlzLWV4aXN0LXAKKyAgICAoZG9saXN0IChmYWNlICcoKy1wYXJlbnMtb25lLWZhY2UK KyAgICAgICAgICAgICAgICAgICAgKy1wYXJlbnMtdHdvLWZhY2UKKyAgICAgICAgICAgICAgICAg ICAgKy1wYXJlbnMtdGhyZWUtZmFjZQorICAgICAgICAgICAgICAgICAgICArLXBhcmVucy1mb3Vy LWZhY2UKKyAgICAgICAgICAgICAgICAgICAgKy1wYXJlbnMtZml2ZS1mYWNlCisgICAgICAgICAg ICAgICAgICAgICstcGFyZW5zLXNpeC1mYWNlCisgICAgICAgICAgICAgICAgICAgICstcGFyZW5z LXNldmVuLWZhY2UKKyAgICAgICAgICAgICAgICAgICAgKy1wYXJlbnMtZWlnaHQtZmFjZQorICAg ICAgICAgICAgICAgICAgICArLXBhcmVucy1uaW5lLWZhY2UKKyAgICAgICAgICAgICAgICAgICAg Ky1wYXJlbnMtdGVuLWZhY2UpKQorICAgICAgKCstcmVtb3ZlLW92ZXJsYXlzIG5pbCBuaWwgJ2Zh Y2UgZmFjZSkpCisgICAgKHNldHEgKy1wYXJlbnMtb3ZlcmxheXMt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HVtbicuIiAoY3VycmVudC1idWZm ZXIpKSkKKyAgICAoZmMtbW9kZQorICAgICAgKHdoZW4gKGFuZCBnbG9iYWwtZWxkb2MtbW9kZQor ICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAg ICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAoZ2xvYmFs LWVsZG9jLW1vZGUgLTEpKQorICAgICAgKHdoZW4gKGFuZCBqaXQtbG9jay1jb250ZXh0LXRpbWVy CisgICAgICAgICAgICAgICAgIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAg ICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVu ICh0aW1lcnAgaml0LWxvY2stY29udGV4dC10aW1lcikKKyAgICAgICAgICAoY2FuY2VsLXRpbWVy IGppdC1sb2NrLWNvbnRleHQtdGltZXIpKQorICAgICAgICA7OyAoc2V0cSBqaXQtbG9jay1jb250 ZXh0LXRpbWVyIChydW4td2l0aC1pZGxlLXRpbWVyIDUuMCAncmVwZWF0ICdqaXQtbG9jay1jb250 ZXh0LWZvbnRpZnkpKQorICAgICAgICAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIG5pbCkp CisgICAgICAod2hlbiAoYW5kIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAg ICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVu ICh0aW1lcnAgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpCisgICAgICAgICAgKGNh bmNlbC10aW1lciB1bmRvLWF1dG8tY3VycmVudC1ib3VuZGFyeS10aW1lcikpCisgICAgICAgIChm c2V0ICd1bmRvLWF1dG8tLXVuZG9hYmxlLWNoYW5nZQorICAgICAgICAgIC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LWZhY2UKKyAgJygodCAoOmZvcmVncm91bmQg Im1hZ2VudGExIikpKQorICAiRmFjZSBmb3IgYCstYmFyLXByZS16di1mYWNlJy4iCisgIDpncm91 cCAnKy1tb2RlKQorCisoZGVmZmFjZSArLWJhci1hdC16di1mYWNlCisgICcoKHQgKDpmb3JlZ3Jv dW5kICJ5ZWxsb3ciKSkpCisgICJGYWNlIGZvciBgKy1iYXItYXQtenYtZmFjZScuIgorICA6Z3Jv dXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1iYXItcG9zdC16di1mYWNlCisgICcoKHQgKDpmb3Jl Z3JvdW5kICJtYWdlbnRhNCIpKSkKKyAgIkZhY2UgZm9yIGArLWJhci1wb3N0LXp2LWZhY2UnLiIK KyAgOmdyb3VwICcrLW1vZGUpCisKKyhkZWZmYWNlICstcmV2ZXJzZWQtYmFyLXByZS16di1mYWNl CisgICcoKHQgKDpmb3JlZ3JvdW5kICJjeWFuMSIpKSkKKyAgIkZhY2UgZm9yIGArLXJldmVyc2Vk LWJhci1wcmUtenYtZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1yZXZl cnNlZC1iYXItYXQtenYtZmFjZQorICAnKCh0ICg6Zm9yZWdyb3VuZCAiY2hhcnRyZXVzZSIpKSkK KyAgIkZhY2UgZm9yIGArLXJldmVyc2VkLWJhci1hdC16di1mYWNlJy4iCisgIDpncm91cCAnKy1t b2RlKQorCisoZGVmZmFjZSArLXJldmVyc2VkLWJhci1wb3N0LXp2LWZhY2UKKyAgJygodCAoOmZv cmVncm91bmQgImN5YW40IikpKQorICAiRmFjZSBmb3IgYCstcmV2ZXJzZWQtYmFyLXBvc3QtenYt ZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1ldmVuLXByZS16di1mYWNl CisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBkYXJrKSkK KyAgICAgOmZvcmVncm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3JlZ3JvdW5kICJi bHVlMSIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDgpKQorICAgICA6Zm9yZWdy b3VuZCAid2hpdGUiKQorICAgICgoKHR5cGUgdHR5KSAoY2xhc3MgbW9ubykpCisgICAgIDppbnZl cnNlLXZpZGVvIHQpCisgICAgKHQgOmZvcmVncm91bmQgInBpbmsiKSkKKyAgIkZhY2UgZm9yIGAr LWV2ZW4taW5hY3RpdmUtcHJlLXp2LWZhY2UnLiIKKyAgOmdyb3VwICcrLW1vZGUpCisKKyhkZWZm YWNlICstZXZlbi1hdC16di1mYWNlCisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4 KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgIkRlZXBQaW5rMSIpCisgICAg KCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAg IDpmb3JlZ3JvdW5kICJEZWVwUGluazEiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9y cyAxNikgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJEZWVwUGluazEiKQor ICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQpKQor ICAgICA6Zm9yZWdyb3VuZCAiRGVlcFBpbmsxIikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1j b2xvcnMgOCkpCisgICAgIDpmb3JlZ3JvdW5kICJ3aGl0ZSIpCisgICAgKCgodHlwZSB0dHkpIChj bGFzcyBtb25vKSkKKyAgICAgOmludmVyc2UtdmlkZW8gdCkKKyAgICAodCA6Zm9yZWdyb3VuZCAi cGluayIpKQorICAiRmFjZSBmb3IgYCstZXZlbi1hdC16di1mYWNlJy4iCisgIDpncm91cCAnKy1t b2RlKQorCisoZGVmZmFjZSArLWV2ZW4taW5hY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bW9ubykpCisgICAgIDppbnZlcnNl LXZpZGVvIHQpCisgICAgKHQgOmZvcmVncm91bmQgInBpbmsiKSkKKyAgIkZhY2UgZm9yIGArLWV2 ZW4taW5hY3RpdmUtcG9zdC16di1mYWNlJy4iCisgIDpncm91cCAnKy1tb2RlKQorCisoZGVmZmFj ZSArLW9kZC1wcmUtenYtZmFjZQorICAnKCgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkg KGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJyZWQxIikKKyAgICAoKChjbGFz cyBjb2xvcikgKG1pbi1jb2xvcnMgODgpIChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVn cm91bmQgInJlZDEiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tn cm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJyZWQxIikKKyAgICAoKChjbGFzcyBjb2xv cikgKG1pbi1jb2xvcnMgMTYpIChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQg InJlZDEiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4KSkKKyAgICAgOmZvcmVn cm91bmQgIndoaXRlIikKKyAgICAoKCh0eXBlIHR0eSkgKGNsYXNzIG1vbm8pKQorICAgICA6aW52 ZXJzZS12aWRlbyB0KQorICAgICh0IDpmb3JlZ3JvdW5kICJwaW5rIikpCisgICJGYWNlIGZvciBg Ky1vZGQtcHJlLXp2LWZhY2UnLiIKKyAgOmdyb3VwICcrLW1vZGUpCisKKyhkZWZmYWNlICstb2Rk LWluYWN0aXZlLXByZS16di1mYWNlCisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4 KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgIiNmZjYzNDciKQorICAgICgo KGNsYXNzIGNvbG9yKSAob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cG9zdC16di1mYWNlCisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29s b3JzIDg4KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTEiKQor ICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgbGlnaHQpKQor ICAgICA6Zm9yZWdyb3VuZCAiRGFya1NhbG1vbiIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4t Y29sb3JzIDE2KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTEi KQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQp KQorICAgICA6Zm9yZWdyb3VuZCAiRGFya1NhbG1vbiIpCisgICAgKCgoY2xhc3MgY29sb3IpICht aW4tY29sb3JzIDgpKQorICAgICA6Zm9yZWdyb3VuZCAid2hpdGUiKQorICAgICgoKHR5cGUgdHR5 KSAoY2xhc3MgbW9ubykpCisgICAgIDppbnZlcnNlLXZpZGVvIHQpCisgICAgKHQgOmZvcmVncm91 bmQgInBpbmsiKSkKKyAgIkZhY2UgZm9yIGArLW9kZC1wb3N0LXp2LWZhY2UnLiIKKyAgOmdyb3Vw ICcrLW1vZGUpCisKKyhkZWZmYWNlICstb2RkLWluYWN0aXZlLXBvc3QtenYtZmFjZQorICAnKCgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpm b3JlZ3JvdW5kICJzaWVubmE0IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgODgp IChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTQiKQorICAgICgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgZGFyaykpCisgICAgI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Gl2ZS1wb3N0LXp2LWZhY2UKKyAgJygoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgODgp IChiYWNrZ3JvdW5kIGRhcmspKQorICAgICA6Zm9yZWdyb3VuZCAiUGFsZUdyZWVuNCIpCisgICAg KCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAg IDpmb3JlZ3JvdW5kICJEYXJrT2xpdmVHcmVlbiIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4t Y29sb3JzIDE2KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgIlBhbGVHcmVl bjQiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGln aHQpKQorICAgICA6Zm9yZWdyb3VuZCAiRGFya09saXZlR3JlZW4iKQorICAgICgoKGNsYXNzIGNv bG9yKSAobWluLWNvbG9ycyA4KSkKKyAgICAgOmZvcmVncm91bmQgIndoaXRlIikKKyAgICAoKCh0 eXBlIHR0eSkgKGNsYXNzIG1vbm8pKQorICAgICA6aW52ZXJzZS12aWRlbyB0KQorICAgICh0IDpm b3JlZ3JvdW5kICJwaW5rIikpCisgICJGYWNlIGZvciBgKy1wb3N0LWZpbGwtaW5hY3RpdmUtcG9z dC16di1mYWNlJy4iCisgIDpncm91cCAnKy1tb2RlKQorCisoZGVmZmFjZSBmYy1wcmUtenYtZmFj ZQorICAnKCgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykp CisgICAgIDpmb3JlZ3JvdW5kICJncmV5MTUiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNv bG9ycyA4OCkgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3VuZCAiZ3JleTE1IikK KyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgMTYpIChiYW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lIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09i amVjdCB2YWwpCit7CisgIGItPmZjX3Zpc2libGVfID0gdmFsOworfQorCitzdGF0aWMgdm9pZAor YnNldF9mY19pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2 YWwpCit7CisgIGItPmZjX2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQorCisvKiBlbmQgTVVM VElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogc3RhdGljIHZv aWQKIGJzZXRfYWJicmV2X21vZGUgKHN0cnVjdCBidWZmZXIgKmIsIExpc3BfT2JqZWN0IHZhbCkK IHsKQEAgLTUxNDIsNiArNTIwNSwyNCBAQCBpbml0X2J1ZmZlcl9vbmNlICh2b2lkKQogICBic2V0 X2xhc3Rfc2VsZWN0ZWRfd2luZG93ICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBtYWtlX2ZpeG51bSAo MCkpOwogCiAgIGlkeCA9IDE7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKyAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxfZmxh Z3MsIG1jX3JlYWxfZmFrZV9jdXJzb3IpLCBpZHgpOyArK2lkeDsKKyAgWFNFVEZBU1RJTlQgKEJW QVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIG1jX2NvbmYpLCBpZHgpOyArK2lkeDsKKyAgWFNFVEZB U1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIG1jX2luYWN0aXZlX3dpbmRvd3MpLCBp ZHgpOyArK2lkeDsKKyAgWFNFVEZ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Ghlc2UgYmVmb3JlIG1ha2luZyB0aGUgZmly c3QgYnVmZmVyISAqLwogCiAgIC8qIHJlYWwgc2V0dXAgaXMgZG9uZSBpbiBiaW5kaW5ncy5lbCAq LworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLwor CisgIGJzZXRfbWNfcmVhbF9mYWtlX2N1cnNvciAoJmJ1ZmZlcl9kZWZhdWx0cywgUWhvbGxvdyk7 CisgIGJzZXRfbWNfY29uZiAoJmJ1ZmZlcl9kZWZhdWx0cywgUW5pbCk7CisgIGJzZXRfbWNfaW5h Y3RpdmVfd2luZG93cyAoJmJ1ZmZlcl9kZWZhdWx0cywgUXQpOworICBic2V0X2Nyb3NzaGFpcnMg KCZidWZmZXJfZGVmYXVsdHMsIFFuaWwpOworICBic2V0X2NoX2hvcml6b250YWxfcnVsZXIgKCZi dWZmZXJfZGVmYXVsdHMsIFF0KTsKKyAgYnNldF9jaF92ZXJ0aWNhbF9ydWxlciAoJmJ1ZmZlcl9k ZWZhdWx0cywgUXQpOworICBic2V0X2NoX2luYWN0aXZlX3dpbmRvd3MgKCZidWZmZXJfZGVmYXVs dHMsIFF0KTsKKyAgYnNldF9mY192aXNpYmxlICgmYnVmZmVyX2RlZmF1bHRzLCBRbmlsKTsKKyAg YnNldF9mY19pbmFjdGl2ZV93aW5kb3dzICgmYnVmZmVyX2RlZmF1bHRzLCBRdCk7CisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICAgYnNldF9tb2RlX2xpbmVfZm9ybWF0ICgmYnVmZmVy X2RlZmF1bHRzLCBidWlsZF9wdXJlX2Nfc3RyaW5nICgiJS0iKSk7CiAgIGJzZXRfaGVhZGVyX2xp bmVfZm9ybWF0ICgmYnV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Jvc3NoYWlycyBob3Jpem9udGFsIHJ1bGVyLiAqLworICBM aXNwX09iamVjdCBjaF9ob3Jpem9udGFsX3J1bGVyXzsKKworICAvKiBUaGUgbmFtZSBvZiB0aGUg Y3Jvc3NoYWlycyB2ZXJ0aWNhbCBydWxlci4gKi8KKyAgTGlzcF9PYmplY3QgY2hfdmVydGljYWxf cnVsZXJfOworCisgIC8qIFdoZXRoZXIgdG8gZHJhdyBjcm9zc2hhaXJzIGluIGluYWN0aXZlIHdp bmRvd3MuICovCisgIExpc3BfT2JqZWN0IGNoX2luYWN0aXZlX3dpbmRvd3NfOworCisgIC8qIFRo ZSBuYW1lIG9mIHRoZSBidWZmZXItbG9jYWwgdmFyaWFibGUuICovCisgIExpc3BfT2JqZWN0IGZj X3Zpc2libGVfOworCisgIC8qIFdoZXRoZXIgdG8gZHJhdyBtdWx0aXBsZSBjdXJzb3JzIGZpbGwg Y29sdW1uIGluIGluYWN0aXZlIHdpbmRvd3MuICovCisgIExpc3BfT2JqZWN0IGZjX2luYWN0aXZl X3dpbmRvd3NfOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIEN1cnNvciB0 eXBlIHRvIGRpc3BsYXkgaW4gbm9uLXNlbGVjdGVkIHdpbmRvd3MuCiAgICAgIHQgbWVhbnMgdG8g dXNlIGhvbGxvdyBib3ggY3Vyc29yLgogICAgICBTZWUgYGN1cnNvci10eXBlJyBmb3Igb3RoZXIg dmFsdWVzLiAgKi8KQEAgLTc4NywxNCArODIxLDIxIEBAIHN0cnVjdCBidWZmZXIKICAgICAgYW4g aW5kaXJlY3QgYnVmZmVyIHNpbmNlIGl0IGNvdW50cyBhcyBpdHMgYmFzZSBidWZmZXIuICAqLwog ICBpbnQgd2luZG93X2NvdW50OwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioq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aG91bGQg dXNlIHRoZXNlIGZ1bmN0aW9ucyB0byBzZXQgTGlzcCBmaWVsZHMgaW4gc3RydWN0CiAgICBidWZm ZXIuICAoU29tZSBzZXR0ZXJzIHRoYXQgYXJlIHByaXZhdGUgdG8gYSBzaW5nbGUgLmMgZmlsZSBh cmUKICAgIGRlZmluZWQgYXMgc3RhdGljIGluIHRob3NlIGZpbGVzLikgICovCisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKK0lOTElO RSB2b2lkCitic2V0X2Jsdl9tY19yZWFsX2Zha2VfY3Vyc29yIChzdHJ1Y3QgYnVmZmVyICpiLCBM aXNwX09iamVjdCB2YWwpCit7CisgIGItPm1jX3JlYWxfZmFrZV9jdXJzb3JfID0gdmFsOworfQor CitJTkxJTkUgdm9pZAorYnNldF9ibHZfbWNfY29uZiAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9P YmplY3QgdmFsKQoreworICBiLT5tY19jb25mXyA9IHZhbDsKK30KKworSU5MSU5FIHZvaWQKK2Jz ZXRfYmx2X21jX2luYWN0aXZlX3dpbmRvd3MgKHN0cnVjdCBidWZmZXIgKmIsIExpc3BfT2JqZWN0 IHZhbCkKK3sKKyAgYi0+bWNfaW5hY3RpdmVfd2luZG93c18gPSB2YWw7Cit9CisKK0lOTElORSB2 b2lkCitic2V0X2Jsdl9jcm9zc2hhaXJzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2 YWwpCit7CisgIGItPmNyb3NzaGFpcnNfID0gdmFsOworfQorCitJTkxJTkUgdm9pZAorYnNldF9i bHZfY2hfaG9yaXpvbnRhbF9ydWxlciAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFs KQoreworICBiLT5jaF9ob3Jpem9udGFsX3J1bGVyXyA9IHZhbDs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dXJzb3I7CiAjZGVmaW5lIE5hdGl2ZVJlY3RhbmdsZSBpbnQKICNlbmRpZgogCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLwor CitzdHJ1Y3QgZ2x5cGg7CisKK3N0cnVjdCBnbHlwaF9yb3c7CisKK3N0cnVjdCBnbHlwaF9tYXRy aXg7CisKK2VudW0gZHJhd19nbHlwaHNfZmFjZTsKKworZW51bSBnbHlwaF9yb3dfYXJlYTsKKwor c3RydWN0IG1jX21hdHJpeDsKKworZW51bSBtY19jYWNoZV90eXBlOworCitlbnVtIG1jX2N1cnNv cl90eXBlOworCitlbnVtIG1jX2ZsYXZvcjsKKworc3RydWN0IG1jX1JHQjsKKworc3RydWN0IG1j X2Vzc2VudGlhbHM7CisKK2VudW0gbWNfZHJhd19yb3dfdHlwZTsKKworZW51bSBtY19lbmdpbmVf dHlwZTsKKworZW51bSBtY19yb3dfcG9zaXRpb247CisKK2VudW0gbWNfcmVkcmF3X3Jvd190eXBl OworCitlbnVtIGRyYXdfZ2x5cGhfYWN0aW9uOworCitleHRlcm4gTGlzcF9PYmplY3QgbWNfbGlz dG4gKHB0cmRpZmZfdCwgTGlzcF9PYmplY3QsIC4uLik7CisKK2V4dGVybiBMaXNwX09iamVjdCBt Y19udGggKGludCwgTGlzcF9PYmplY3QpOworCitleHRlcm4gTGlzcF9PYmplY3QgbWNfYXNzcSAo TGlzcF9PYmplY3QsIExpc3BfT2JqZWN0KTsKKworZXh0ZXJuIGVudW0gbWNfcm93X3Bvc2l0aW9u IG1jX3Jvd19wb3NpdGlvbiAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhf cm93ICosIGludCk7CisKK2V4dGVybiBwdHJkaWZmX3QgbWNfcmVnaW9uX2xpbWl0IChib29sKTsK KworZXh0ZXJuIHN0cnVjdCBnbHlwaCAqIG1jX2dldF9jdXJzb3JfZ2x5cGggKHN0cnVjdCB3aW5k b3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKiwgaW50LCBpbnQpOworCitleHRlcm4g dm9pZCBtY194d19jb2xvcl92YWx1ZXMgKHN0cnVjdCB3aW5kb3cgKiwgTGlzcF9PYmplY3QsIHN0 cnVjdCBtY19SR0IgKik7CisKK2V4dGVybiBib29sIG1jX3VwZGF0ZV93aW5kb3dfZnJpbmdlcyAo c3RydWN0IHdpbmRvdyAqLCBib29sKTsKKworZXh0ZXJuIGNoYXIgKiBtY193aW5kb3cgKHN0cnVj dCB3aW5kb3cgKik7CisKK2V4dGVybiBjaGFyICogbWNfY2hhcl90b19zdHJpbmcgKGludCk7CisK K2V4dGVybiBjaGFyICogbWNfY3Vyc29yX3R5cGVfdG9fc3RyaW5nIChlbnVtIG1jX2N1cnNvcl90 eXBlKTsKKworZXh0ZXJuIGNoYXIgKiBtY19mbGF2b3JfdG9fc3RyaW5nIChlbnVtIG1jX2ZsYXZv cik7CisKK2V4dGVybiBjaGFyICogbWNfY2FjaGVfdHlwZV90b19zdHJpbmcgKGVudW0gbWNfY2Fj aGVfdHlwZSk7CisKK2V4dGVybiBjaGFyICogbWNfcmVkcmF3X3Jvd190eXBlX3RvX3N0cmluZyAo ZW51bSBtY19yZWRyYXdfcm93X3R5cGUpOworCitleHRlcm4gdm9pZCBtY19jYWNoZV9pbnNwZWN0 b3IgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IG1jX21hdHJpeCk7CisKK2V4dGVybiBib29sIG1j X3RyYXZlcnNlX2NhY2hlX3AgKHN0cnVjdCBtY19tYXRyaXgsIGVudW0gbWNfY2FjaGVfdHlwZSwg aW50LCBpbnQpOworCitleHRlcm4gdm9pZCBtY19kcmF3X2ZyaW5nZV9iaXRtYXAgKHN0cnVjdCB3 aW5kb3cgKiwgc3RydWN0IGdseXBoX3JvdyAqLCBpbnQsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUpOworCitleHRlcm4gaW50IG1jX2dldF9m cmluZ2VfYml0bWFwIChzdHJ1Y3Qgd2luZG93ICosIExpc3BfT2JqZWN0LCBpbnQsIGludCk7CisK K2V4dGVybiB2b2lkIG1jX2VuZ2luZSAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0 cml4ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0 IGdseXBoICosIGludCwgaW50LCBpbnQsIGludCwgaW50LCBpbnQsCisgICAgICAgICAgICAgICAg ICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUsIGludCwgc3RydWN0IGdseXBoX21hdHJpeCAqLAor ICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfZXNzZW50aWFscywgZW51bSBtY19yb3df cG9zaXRpb24sIHN0cnVjdCBtY19SR0IsCisgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNf ZW5naW5lX3R5cGUsIGJvb2wsIGVudW0gbWNfZHJhd19yb3dfdHlwZSwKKyAgICAgICAgICAgICAg ICAgICAgICAgZW51bSBtY19jYWNoZV90eXBlKTsKKworZXh0ZXJuIHZvaWQgbWNfc2V0X2Vzc2Vu dGlhbHMgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IG1jX2Vzc2VudGlhbHMgKik7CisKK2V4dGVy biB2b2lkIG1jX2RyYXdfcm93IChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXgg Kiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBn bHlwaCAqLCBpbnQsIGludCwgaW50LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosCisgICAgICAgICAg ICAgICAgICAgICAgICAgc3RydWN0IG1jX2Vzc2VudGlhbHMsIGVudW0gbWNfcm93X3Bvc2l0aW9u LCBib29sLAorICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfZHJhd19yb3dfdHlwZSk7 CisKK2V4dGVybiBib29sIG1jX3JlZHJhd19yb3cgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGds eXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAgICAgICAgICAgICAgICAgICAg ICAgICBlbnVtIGdseXBoX3Jvd19hcmVhLCBpbnQsIGludCwgaW50LCBib29sLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlLCBlbnVtIG1jX3JlZHJhd19y b3dfdHlwZSk7CisKK2V4dGVybiB2b2lkIG1jX3Jlc2V0X2NhY2hlIChzdHJ1Y3Qgd2luZG93ICop OworCitleHRlcm4gdm9pZCBtY19kcmF3X2N1cnNvcl9nbHlwaCAoc3RydWN0IHdpbmRvdyAqLCBz dHJ1Y3QgZ2x5cGhfbWF0cml4ICosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg c3RydWN0IGdseXBoX3JvdyAqLCBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgaW50LCBpbnQsIGludCwgc3RydWN0IG1jX1JHQiwgZW51bSBt Y19mbGF2b3IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJz b3JfdHlwZSwgaW50LCBib29sLCBib29sKTsKKworZXh0ZXJuIHZvaWQgbWNfZXJhc2VfY3Vyc29y IChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwgc3RydWN0IGdseXBoX3Jv dyAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQsIGludCwgaW50LCBpbnQsIGVu dW0gbWNfZmxhdm9yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNv cl90eXBlLCBpbnQpOworCitleHRlcm4gdm9pZCBtY19kcmF3X2VyYXNlX2h5YnJpZCAoc3RydWN0 IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQsIGludCwgaW50LCBpbnQsIGludCwg aW50LCBpbnQsIGludCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1j X2N1cnNvcl90eXBlLCBpbnQsIHN0cnVjdCBtY19SR0IsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgYm9vbCwgZW51bSBtY19mbGF2b3IsIGJvb2wpOworCitleHRlcm4gaW50IG1j X2RyYXdfZ2x5cGhzIChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwgc3Ry dWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBlbnVtIGds eXBoX3Jvd19hcmVhLCBwdHJkaWZmX3QsIHB0cmRpZmZfdCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSwgaW50LCBpbnQsIHN0cnVjdCBtY19SR0IsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2ZsYXZvciwgZW51bSBtY19jdXJzb3Jf dHlwZSwgaW50LCBib29sLCBib29sLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBk cmF3X2dseXBoX2FjdGlvbiwgYm9vbCk7CisKK2V4dGVybiBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICog bWNfc2F2ZV9nbHlwaF9tYXRyaXggKHN0cnVjdCBnbHlwaF9tYXRyaXggKik7CisKK2V4dGVybiB2 b2lkIG1jX3Jlc3RvcmVfZ2x5cGhfbWF0cml4IChzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVj dCBnbHlwaF9tYXRyaXggKik7CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKworCiAvKiBUZXh0IGN1cnNvciB0eXBlcy4gICovCiAKIGVudW0g dGV4dF9jdXJzb3Jfa2luZHMKQEAgLTM4Miw2ICs1MDUsMTggQEAgc3RydWN0IGdseXBoX3NsaWNl CiAKIHN0cnVjdCBnbHlwaAogeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCisgIGludCByZWxhdGl2ZV94LCBocG9zOworCisgIHB0cmRpZmZf dCBieXRlcG9zOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIFBvc2l0aW9u IGZyb20gd2hpY2ggdGhpcyBnbHlwaCB3YXMgZHJhd24uICBJZiBgb2JqZWN0JyBiZWxvdyBpcyBh CiAgICAgIExpc3Agc3RyaW5nLCB0aGlzIGlzIGFuIGluZGV4IGludG8gdGhhdCBzdHJpbmcuICBJ ZiBpdCBpcyBhCiAgICAgIGJ1ZmZlciwgdGhpcyBpcyBhIHBvc2l0aW9uIGluIHRoYXQgYnVmZmVy LiAgSW4gYWRkaXRpb24sIHNvbWUKQEAgLTEyNDgsNiArMTM4MywyOCBAQCBlbnVtIGRyYXdfZ2x5 cGhzX2ZhY2UKIAogc3RydWN0IGdseXBoX3N0cmluZwogeworCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgYm9vbF9iZiBsZWZ0X292ZXJ3 cml0dGVuX3AgOiAxOworCisgICAgYm9vbF9iZiByaWdodF9vdmVyd3JpdHRlbl9wIDogMTsKKwor ICAgIGJvb2xfYmYgcmVjdGFuZ2xlX251a2VkX3AgOiAxOworCisgICAgYm9vbF9iZiBiYWNrZ3Jv dW5kX251a2VkX3AgOiAxOworCisgICAgZW51bSBkcmF3X2dseXBoX2FjdGlvbgorICAgIHsKKyAg ICAgIE1DX0RSQVdfR0xZUEhfU1RSSU5HLAorICAgICAgTUNfRVJBU0VfR0xZUEhfU1RSSU5HCisg ICAgfSBhY3Rpb25fdHlwZTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBY LW9yaWdpbiBvZiB0aGUgc3RyaW5nLiAgKi8KICAgaW50IHg7CiAKQEAgLTI4MTIsNiArMjk2OSwy OCBAQCB0eXBlZGVmIHZvaWQgKCpmcmFtZV9wYXJtX2hhbmRsZXIpIChzdHJ1Y3QgZnJhbWUgKiwg TGlzcF9PYmplY3QsIExpc3BfT2JqZWN0KTsKIAogc3RydWN0IHJlZGlzcGxheV9pbnRlcmZhY2UK IHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8K KworLyogYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGBuc3Rlcm0ubWAgfCBgdzMydGVybS5jYCB8 IGB4dGVybS5jYCBtdXN0IGJ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wgYm9vbCBjdXJzb3JfZ2NfcCk7CisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogSGFuZGxlcnMgZm9yIHNldHRpbmcg ZnJhbWUgcGFyYW1ldGVycy4gICovCiAgIGZyYW1lX3Bhcm1faGFuZGxlciAqZnJhbWVfcGFybV9o YW5kbGVyczsKIApkaWZmIC0tZ2l0IGEvc3JjL2Rpc3BuZXcuYyBiL3NyYy9kaXNwbmV3LmMKaW5k ZXggY2NiMDhlYy4uNWUyODA4YiAxMDA2NDQKLS0tIGEvc3JjL2Rpc3BuZXcuYworKysgYi9zcmMv ZGlzcG5ldy5jCkBAIC01Niw2ICs1NiwxODI0IEBAIGFsb25nIHdpdGggR05VIEVtYWNzLiAgSWYg bm90LCBzZWUgPGh0dHBzOi8vd3d3LmdudS5vcmcvbGljZW5zZXMvPi4gICovCiAjaW5jbHVkZSAi dzMyLmgiCiAjZW5kaWYKIAwKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2lu IE1VTFRJUExFLUNVUlNPUlMgKi8KKworc3RydWN0IGdseXBoc19za2lwcGVkCit7CisgIHB0cmRp ZmZfdCBhbGxvY2F0ZWQ7CisgIHB0cmRpZmZfdCB1c2VkOworICBzdHJ1Y3Qgc2tpcHBlZF9pdGVt cworICAgIHsKKyAgICAgIGludCB4OworICAgICAgaW50IGhwb3M7CisgICAgICBib29sIGVuYWJs ZWRfcDsKKyAgICB9ICpza2lwcGVkOworfSBhcnJheV9nbHlwaHNfc2tpcHBlZDsKKworc3RydWN0 IG1jX3Jvd19lbnRyeQoreworICBpbnQgb2xkX3VzZXMsIG5ld191c2VzOworICBpbnQgbmV3X2xp bmVfbnVtYmVyOworICBwdHJkaWZmX3QgYnVja2V0OworICBz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9vbCk7CisKK3N0YXRpYyB2b2lkIGFzc2lnbl9yb3cgKHN0cnVjdCBnbHlwaF9yb3cg Kiwgc3RydWN0IGdseXBoX3JvdyAqKTsKKworc3RhdGljIGJvb2wKK21jX3ZlcmlmeV9yb3dfaGFz aCAoc3RydWN0IGdseXBoX3JvdyAqcm93KQoreworICByZXR1cm4gcm93LT5oYXNoID09IHJvd19o YXNoIChyb3cpOworfQorCitzdGF0aWMgc3RydWN0IG1jX3Jvd19lbnRyeSAqCittY19hZGRfcm93 X2VudHJ5IChzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cpCit7CisgIHN0cnVjdCBtY19yb3dfZW50cnkg KmVudHJ5OworICBwdHJkaWZmX3QgaSA9IHJvdy0+aGFzaCAlIG1jX3Jvd190YWJsZV9zaXplOwor ICBlbnRyeSA9IG1jX3Jvd190YWJsZVtpXTsKKyAgZWFzc2VydCAoZW50cnkgfHwgbWNfdmVyaWZ5 X3Jvd19oYXNoIChyb3cpKTsKKyAgd2hpbGUgKGVudHJ5ICYmICFyb3dfZXF1YWxfcCAoZW50cnkt PnJvdywgcm93LCAxKSkKKyAgICBlbnRyeSA9IGVudHJ5LT5uZXh0OworICBpZiAoZW50cnkgPT0g TlVMTCkKKyAgICB7CisgICAgICBlbnRyeSA9IG1jX3Jvd19lbnRyeV9wb29sICsgbWNfcm93X2Vu dHJ5X2lkeCsrOworICAgICAgZW50cnktPnJvdyA9IHJvdzsKKyAgICAgIGVudHJ5LT5vbGRfdXNl cyA9IGVudHJ5LT5uZXdfdXNlcyA9IDA7CisgICAgICBlbnRyeS0+bmV3X2xpbmVfbnVtYmVyID0g MDsKKyAgICAgIGVudHJ5LT5idWNrZXQgPSBpOworICAgICAgZW50cnktPm5leHQgPSBtY19yb3df dGFibGVbaV07CisgICAgICBtY19yb3dfdGFibGVbaV0gPSBlbnRyeTsKKyAgICB9CisgIHJldHVy biBlbnRyeTsKK30KKworLyogUmV2ZXJzZSB0aGUgY29udGVudHMgb2Ygcm93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 ZW5hYmxlZF9wCisgICAgICAgICAgJiYgZC0+ZW5hYmxlZF9wCisgICAgICAgICAgJiYgIWQtPnJl ZHJhd19mcmluZ2VfYml0bWFwc19wCisgICAgICAgICAgJiYgYy0+eSA9PSBkLT55CisgICAgICAg ICAgJiYgTUFUUklYX1JPV19CT1RUT01fWSAoYykgPD0geWIKKyAgICAgICAgICAmJiBNQVRSSVhf Uk9XX0JPVFRPTV9ZIChkKSA8PSB5YgorICAgICAgICAgICYmIHJvd19lcXVhbF9wIChjLCBkLCAx KSkKKyAgICAgICAgeworICAgICAgICAgIGFzc2lnbl9yb3cgKGMsIGQpOworICAgICAgICAgIGQt PmVuYWJsZWRfcCA9IGZhbHNlOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICBi cmVhazsKKyAgICB9CisjaWZkZWYgSEFWRV9YV0lER0VUUworICAvKiBDdXJyZW50bHkgdGhpcyBz ZWVtcyBuZWVkZWQgdG8gZGV0ZWN0IHh3aWRnZXQgbW92ZW1lbnQgcmVsaWFibHkuICovCisgICAg cmV0dXJuIDA7CisjZW5kaWYKKyAgLyogR2l2ZSB1cCBpZiBzb21lIHJvd3MgaW4gdGhlIGRlc2ly ZWQgbWF0cml4IGFyZSBub3QgZW5hYmxlZC4gKi8KKyAgaWYgKCEgTUFUUklYX1JPV19FTkFCTEVE X1AgKGRlc2lyZWRfbWF0cml4LCBpKSkKKyAgICByZXR1cm4gLTE7CisgIGZpcnN0X29sZCA9IGZp cnN0X25ldyA9IGk7CisgIC8qIFNldCBsYXN0X25ldyB0byB0aGUgaW5kZXggKyAxIG9mIHRoZSBy b3cgdGhhdCByZWFjaGVzIHRoZQorICAgICBib3R0b20gYm91bmRhcnkgaW4gdGhlIGRlc2lyZWQg bWF0cml4LiAgR2l2ZSB1cCBpZiB3ZSBmaW5kIGEKKyAgICAgZGlzYWJsZWQgcm93IGJlZm9yZSB3 ZSByZWFjaCB0aGUgYm90dG9tIGJvdW5kYXJ5LiAqLworICBpID0gZmlyc3RfbmV3ICsgMTsKKyAg d2hpbGUgKGkgPCBkZXNpcmVkX21hdHJpeC0+bnJvd3MgLSAxKQorICAgIHsKKyAgICAgIGludCBi b3R0b207CisgICAgICBpZiAoISBNQVRSSVhfUk9XX0VOQUJMRURfUCAoZGVzaXJlZF9tYXRyaXgs IGkpKQorICAgICAgICByZXR1cm4gMDsKKyAgICAgIGJvdHRvbSA9IE1BVFJJWF9ST1dfQk9UVE9N X1kgKE1BVFJJWF9ST1cgKGRlc2lyZWRfbWF0cml4LCBpKSk7CisgICAgICBpZiAoYm90dG9tIDw9 IHliKQorICAgICAgICArK2k7CisgICAgICBpZiAoYm90dG9tID49IHliKQorICAgICAgICBicmVh azsKKyAgICB9CisgIGxhc3RfbmV3ID0gaTsKKyAgLyogU2V0IGxhc3Rfb2xkIHRvIHRoZSBpbmRl eCArIDEgb2YgdGhlIHJvdyB0aGF0IHJlYWNoZXMgdGhlIGJvdHRvbQorICAgICBib3VuZGFyeSBp biB0aGUgY3VycmVudCBtYXRyaXguICBXZSBkb24ndCBsb29rIGF0IHRoZSBlbmFibGVkCisgICAg IGZsYWcgaGVyZSBiZWNhdXNlIHdlIHBsYW4gdG8gcmV1c2UgcGFydCBvZiB0aGUgZGlzcGxheSBl dmVuIGlmCisgICAgIG90aGVyIHBhcnRzIGFyZSBkaXNhYmxlZC4gKi8KKyAgaSA9IGZpcnN0X29s ZCArIDE7CisgIHdoaWxlIChpIDwgY3VycmVudF9tYXRyaXgtPm5yb3dzIC0gMSkKKyAgICB7Cisg ICAgICBpbnQgYm90dG9tID0gTUFUUklYX1JPV19CT1RUT01fWSAoTUFUUklYX1JPVyAoY3VycmVu dF9tYXRyaXgsIGkpKTsKKyAgICAgIGlmIChib3R0b20gPD0geWIpCisgICAgICAgICsraTsKKyAg ICAgIGlmIChib3R0b20gPj0geWIpCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgbGFzdF9vbGQg PSBpOworICAvKiBTa2lwIG92ZXIgcm93cyBl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29sZF9saW5lcyA9IHhwYWxsb2MgKG1jX29sZF9saW5lcywg Jm1jX29sZF9saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRfbWF0 cml4LT5ucm93cyAtIG1jX29sZF9saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAg IElOVF9NQVgsIHNpemVvZiAqbWNfb2xkX2xpbmVzKTsKKyAgaWYgKGRlc2lyZWRfbWF0cml4LT5u cm93cyA+IG1jX25ld19saW5lc19zaXplKQorICAgIG1jX25ld19saW5lcyA9IHhwYWxsb2MgKG1j X25ld19saW5lcywgJm1jX25ld19saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAg IGRlc2lyZWRfbWF0cml4LT5ucm93cyAtIG1jX25ld19saW5lc19zaXplLAorICAgICAgICAgICAg ICAgICAgICAgICAgIElOVF9NQVgsIHNpemVvZiAqbWNfbmV3X2xpbmVzKTsKKyAgbiA9IGRlc2ly ZWRfbWF0cml4LT5ucm93czsKKyAgbiArPSBjdXJyZW50X21hdHJpeC0+bnJvd3M7CisgIGlmICht Y19yb3dfdGFibGVfc2l6ZSA8IDMgKiBuKQorICAgIHsKKyAgICAgIHB0cmRpZmZfdCBzaXplID0g bmV4dF9hbG1vc3RfcHJpbWUgKDMgKiBuKTsKKyAgICAgIG1jX3Jvd190YWJsZSA9IHhucmVhbGxv YyAobWNfcm93X3RhYmxlLCBzaXplLCBzaXplb2YgKm1jX3Jvd190YWJsZSk7CisgICAgICBtY19y b3dfdGFibGVfc2l6ZSA9IHNpemU7CisgICAgICBtZW1zZXQgKG1jX3Jvd190YWJsZSwgMCwgc2l6 ZSAqIHNpemVvZiAqbWNfcm93X3RhYmxlKTsKKyAgICB9CisgIGlmIChuID4gbWNfcm93X2VudHJ5 X3Bvb2xfc2l6ZSkKKyAgICBtY19yb3dfZW50cnlfcG9vbCA9IHhwYWxsb2MgKG1jX3Jvd19lbnRy eV9wb29sLCAmbWNfcm93X2VudHJ5X3Bvb2xfc2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIG4gLSBtY19yb3dfZW50cnlfcG9vbF9zaXplLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgLTEsIHNpemVvZiAqbWNfcm93X2VudHJ5X3Bvb2wpOworICBpZiAoZGVzaXJlZF9t YXRyaXgtPm5yb3dzID4gbWNfcnVuc19zaXplKQorICAgIHsKKyAgICAgIG1jX3J1bnMgPSB4bnJl YWxsb2MgKG1jX3J1bnMsIGRlc2lyZWRfbWF0cml4LT5ucm93cywgc2l6ZW9mICptY19ydW5zKTsK KyAgICAgIG1jX3J1bl9wb29sID0geG5yZWFsbG9jIChtY19ydW5fcG9vbCwgZGVzaXJlZF9tYXRy aXgtPm5yb3dzLCBzaXplb2YgKm1jX3J1bl9wb29sKTsKKyAgICAgIG1jX3J1bnNfc2l6ZSA9IGRl c2lyZWRfbWF0cml4LT5ucm93czsKKyAgICB9CisgIG5ydW5zID0gcnVuX2lkeCA9IDA7CisgIG1j X3Jvd19lbnRyeV9pZHggPSAwOworICAvKiBBZGQgcm93cyBmcm9tIHRoZSBjdXJyZW50IGFuZCBk ZXNpcmVkIG1hdHJpeCB0byB0aGUgaGFzaCB0YWJsZQorICAgICByb3dfaGFzaF90YWJsZSB0byBi ZSBhYmxlIHRvIGZpbmQgZXF1YWwgb25lcyBxdWlja2x5LiAqLworICBmb3IgKGkgPSBmaXJzdF9v bGQ7IGkgPCBsYXN0X29sZDsgKytpKQorICAgIHsKKyAgICAgIGlmIChNQVRSSVhfUk9XX0VOQUJM RURfUCAoY3VycmVudF9tYXRyaXgsIGkpKQorICAgICAgICB7CisgICAgICAgICAgZW50cnkgPSBt Y19hZGRfcm93X2VudHJ5IChNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSkpOworICAgICAg ICAgIG1jX29sZF9saW5lc1tpXSA9IGVudHJ5OworICAgICAgICAgICsrZW50cnktPm9sZF91c2Vz OworICAgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIG1jX29sZF9saW5lc1tpXSA9IE5VTEw7 CisgICAgfQorICBmb3IgKGkgPSBmaXJzdF9uZXc7IGkgPCBsYXN0X25ldzsgKytpKQorICAgIHsK KyAgICAgIGVhc3NlcnQgKE1BVFJJWF9ST1dfRU5BQkxFRF9QIChkZXNpcmVkX21hdHJpeCwgaSkp OworICAgICAgZW50cnkgPSBtY19hZGRfcm93X2VudHJ5IChNQVRSSVhfUk9XIChkZXNpcmVkX21h dHJpeCwgaSkpOworICAgICAgKytlbnRyeS0+bmV3X3VzZXM7CisgICAgICBlbnRyeS0+bmV3X2xp bmVfbnVtYmVyID0gaTsKKyAgICAgIG1jX25ld19saW5lc1tpXSA9IGVudHJ5OworICAgIH0KKyAg LyogSWRlbnRpZnkgbW92ZXMgYmFzZWQgb24gbGluZXMgdGhhdCBhcmUgdW5pcXVlIGFuZCBlcXVh bAorICAgICBpbiBib3RoIG1hdHJpY2VzLiAqLworICBmb3IgKGkgPSBmaXJzdF9vbGQ7IGkgPCBs YXN0X29sZDspCisgICAgaWYgKG1jX29sZF9saW5lc1tpXQorICAgICAgICAmJiBtY19vbGRfbGlu ZXNbaV0tPm9sZF91c2VzID09IDEKKyAgICAgICAgJiYgbWNfb2xkX2xpbmVzW2ldLT5uZXdfdXNl cyA9PSAxKQorICAgICAgeworICAgICAgICBpbnQgcCwgcTsKKyAgICAgICAgaW50IG5ld19saW5l ID0gbWNfb2xkX2xpbmVzW2ldLT5uZXdfbGluZV9udW1iZXI7CisgICAgICAgIHN0cnVjdCBydW4g KnJ1biA9IG1jX3J1bl9wb29sICsgcnVuX2lkeCsrOworICAgICAgICAvKiBSZWNvcmQgbW92ZS4g Ki8KKyAgICAgICAgcnVuLT5jdXJyZW50X3Zwb3MgPSBpOworICAgICAgICBydW4tPmN1cnJlbnRf eSA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCBpKS0+eTsKKyAgICAgICAgcnVuLT5kZXNp cmVkX3Zwb3MgPSBuZXdfbGluZTsKKyAgICAgICAgcnVuLT5kZXNpcmVkX3kgPSBNQVRSSVhfUk9X IChkZXNpcmVkX21hdHJpeCwgbmV3X2xpbmUpLT55OworICAgICAgICBydW4tPm5yb3dzID0gMTsK KyAgICAgICAgcnVuLT5oZWlnaHQgPSBNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSktPmhl aWdodDsKKyAgICAgICAgLyogRXh0ZW5kIGJhY2t3YXJkLiAqLworICAgICAgICBwID0gaSAtIDE7 CisgICAgICAgIHEgPSBuZXdfbGluZSAtIDE7CisgICAgICAgIHdoaWxlIChwID4gZmlyc3Rfb2xk CisgICAgICAgICAgICAgICAmJiBxID4gZmlyc3RfbmV3CisgICAgICAgICAgICAgICAmJiBtY19v bGRfbGluZXNbcF0gPT0gbWNfbmV3X2xpbmVzW3FdKQorICAgICAgICAgIHsKKyAgICAgICAgICAg IGludCBoID0gTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIHApLT5oZWlnaHQ7CisgICAgICAg ICAgICAtLXJ1bi0+Y3VycmVudF92cG9zOworICAgICAgICAgICAgLS1ydW4tPmRlc2lyZWRfdnBv czsKKyAgICAgICAgICAgICsrcnVuLT5ucm93czsKKyAgICAgICAgICAgIHJ1bi0+aGVpZ2h0ICs9 IGg7CisgICAgICAgICAgICBydW4tPmRlc2lyZWRfeSAtPSBoOworICAgICAgICAgICAgcnVuLT5j dXJyZW50X3kgLT0gaDsKKyAgICAgICAgICAgIC0tcCwgLS1xOworICAgICAgICAgIH0KKyAgICAg ICAgLyogRXh0ZW5kIGZvcndhcmQuICovCisgICAgICAgIHAgPSBpICsgMTsKKyAgICAgICAgcSA9 IG5ld19saW5lICsgMTsKKyAgICAgICAgd2hpbGUgKHAgPCBsYXN0X29sZAorICAgICAgICAgICAg ICAgJiYgcSA8IGxhc3RfbmV3CisgICAgICAgICAgICAgICAmJiBtY19vbGRfbGluZXNbcF0gPT0g bWNfbmV3X2xpbmVzW3FdKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGludCBoID0gTUFUUklY X1JPVyAoY3VycmVudF9tYXRyaXgsIHApLT5oZWlnaHQ7CisgICAgICAgICAgICArK3J1bi0+bnJv d3M7CisgICAgICAgICAgICBydW4tPmhlaWdodCArPSBoOworICAgICAgICAgICAgKytwLCArK3E7 CisgICAgICAgICAgfQorICAgICAgICAvKiBJbnNlcnQgcnVuIGludG8gbGlzdCBvZiBhbGwgcnVu cy4gIE9yZGVyIHJ1bnMgYnkgY29waWVkCisgICAgICAgICAgIHBpeGVsIGxpbmVzLiAgTm90ZSB0 aGF0IHdlIHJlY29yZCBydW5zIHRoYXQgZG9uJ3QgaGF2ZSB0bworICAgICAgICAgICBiZSBjb3Bp ZWQgYmVjYXVzZSB0aGV5IGFyZSBhbHJlYWR5IGluIHBsYWNlLiAgVGhpcyBpcyBkb25lCisgICAg ICAgICAgIGJlY2F1c2Ugd2UgY2FuIGF2b2lkIGNhbGxpbmcgdXBkYXRlX3dpbmRvd19saW5lIGlu IHRoaXMKKyAgICAgICAgICAgY2FzZS4gKi8KKyAgICAgICAgZm9yIChwID0gMDsgcCA8IG5ydW5z ICYmIG1jX3J1bnNbcF0tPmhlaWdodCA+IHJ1bi0+aGVpZ2h0OyArK3ApCisgICAgICAgICAgOwor ICAgICAgICBmb3IgKHEgPSBucnVuczsgcSA+IHA7IC0tcSkKKyAgICAgICAgICBtY19ydW5zW3Fd ID0gbWNfcnVuc1txIC0gMV07CisgICAgICAgIG1jX3J1bnNbcF0gPSBydW47CisgICAgICAgICsr bnJ1bnM7CisgICAgICAgIGkgKz0gcnVuLT5ucm93czsKKyAgICAgIH0KKyAgICAgIGVsc2UKKyAg ICAgICAgKytpOworICAvKiBEbyB0aGUgbW92ZXMuICBEbyBpdCBpbiBhIHdheSB0aGF0IHdlIGRv bid0IG92ZXJ3cml0ZSBzb21ldGhpbmcKKyAgICAgd2Ugd2FudCB0byBjb3B5IGxhdGVyIG9uLiAg VGhpcyBpcyBub3Qgc29sdmFibGUgaW4gZ2VuZXJhbAorICAgICBiZWNhdXNlIHRoZXJlIGlzIG9u bHkgb25lIGRpc3BsYXkgYW5kIHdlIGRvbid0IGhhdmUgYSB3YXkgdG8KKyAgICAgZXhjaGFuZ2Ug YXJlYXMgb24gdGhpcyBkaXNwbGF5LiAgRXhhbXBsZToKKyAgICAgICAgICArLS0tLS0tLS0tLS0r ICAgICAgICstLS0tLS0tLS0tLSsKKyAgICAgICAgICB8ICAgICBBICAgICB8ICAgICAgIHwgICAg IEIgICAgIHwKKyAgICAgICAgICArLS0tLS0tLS0tLS0rICAtLT4gICstLS0tLS0tLS0tLSsKKyAg ICAgICAgICB8ICAgICBCICAgICB8ICAgICAgIHwgICAgIEEgICAgIHwKKyAgICAgICAgICArLS0t LS0tLS0tLS0rICAgICAgICstLS0tLS0tLS0tLSsKKyAgICAgSW5zdGVhZCwgcHJlZmVyIGJpZ2dl ciBtb3ZlcywgYW5kIGludmFsaWRhdGUgbW92ZXMgdGhhdCB3b3VsZAorICAgICBjb3B5IGZyb20g d2hlcmUgd2UgY29waWVkIHRvLiAqLworICBmb3IgKGkgPSAwOyBpIDwgbnJ1bnM7ICsraSkKKyAg ICBpZiAobWNfcnVuc1tpXS0+bnJvd3MgPiAwKQorICAgICAgeworICAgICAgICBzdHJ1Y3QgcnVu ICpyID0gbWNfcnVuc1tpXTsKKyAgICAgICAgaWYgKHItPmN1cnJlbnRfeSAhPSByLT5kZXNpcmVk X3kpCisgICAgICAgICAgeworICAgICAgICAgICAgLy8gIGZwcmludGYgKHN0ZGVyciwgIiVzOiAg ci0+Y3VycmVudC9kZXNpcmVkX3Zwb3MgKCVkLyVkKSB8IHItPmN1cnJlbnQvZGVzaXJlZF95ICgl ZC8lZClcbiIsCisgICAgICAgICAgICAvLyAgICAgICAgICAgci0+Y3VycmVudF95IDwgci0+ZGVz aXJlZF95ID8gIuKGkyIgOiAi4oaRIiwKKyAgICAgICAgICAgIC8vICAgICAgICAgICByLT5jdXJy ZW50X3Zwb3MsIHItPmRlc2lyZWRfdnBvcywgci0+Y3VycmVudF95LCByLT5kZXNpcmVkX3kpOwor ICAgICAgICAgICAgLy8gIHJpZi0+Y2xlYXJfd2luZG93X21vdXNlX2ZhY2UgKHcpOworICAgICAg ICAgICAgLy8gIHJpZi0+c2Nyb2xsX3J1bl9ob29rICh3LCByKTsKKyAgICAgICAgICB9CisgICAg ICAgIC8qIFRydW5jYXRlIHJ1bnMgdGhhdCBjb3B5IHRvIHdoZXJlIHdlIGNvcGllZCB0bywgYW5k CisgICAgICAgICAgIGludmFsaWRhdGUgcnVucyB0aGF0IGNvcHkgZnJvbSB3aGVyZSB3ZSBjb3Bp ZWQgdG8uICovCisgICAgICAgIGZvciAoaiA9IG5ydW5zIC0gMTsgaiA+IGk7IC0taikKKyAgICAg ICAgICB7CisgICAgICAgICAgICBzdHJ1Y3QgcnVuICpwID0gbWNfcnVuc1tqXTsKKyAgICAgICAg ICAgIGJvb2wgdHJ1bmNhdGVkX3AgPSAwOworICAgICAgICAgICAgaWYgKHAtPm5yb3dzID4gMAor ICAgICAgICAgICAgICAgICYmIHAtPmRlc2lyZWRfeSA8IHItPmRlc2lyZWRfeSArIHItPmhlaWdo dAorICAgICAgICAgICAgICAgICYmIHAtPmRlc2lyZWRfeSArIHAtPmhlaWdodCA+IHItPmRlc2ly ZWRfeSkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChwLT5kZXNpcmVkX3kg PCByLT5kZXNpcmVkX3kpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAg IHAtPm5yb3dzID0gci0+ZGVzaXJlZF92cG9zIC0gcC0+ZGVzaXJlZF92cG9zOworICAgICAgICAg ICAgICAgICAgICBwLT5oZWlnaHQgPSByLT5kZXNpcmVkX3kgLSBwLT5kZXNpcmVkX3k7CisgICAg ICAgICAgICAgICAgICAgIHRydW5jYXRlZF9wID0gMTsKKyAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICAgIGludCBucm93c19jb3BpZWQgPSAoci0+ZGVzaXJlZF92cG9zICsgci0+bnJvd3MKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIHAtPmRlc2lyZWRfdnBvcyk7Cisg ICAgICAgICAgICAgICAgICAgIGlmIChwLT5ucm93cyA8PSBucm93c19jb3BpZWQpCisgICAgICAg ICAgICAgICAgICAgICAgcC0+bnJvd3MgPSAwOworICAgICAgICAgICAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgaW50 IGhlaWdodF9jb3BpZWQgPSAoci0+ZGVzaXJlZF95ICsgci0+aGVpZ2h0CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gcC0+ZGVzaXJlZF95KTsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgcC0+Y3VycmVudF92cG9zICs9IG5yb3dzX2NvcGllZDsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgcC0+ZGVzaXJlZF92cG9zICs9IG5yb3dzX2NvcGllZDsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgcC0+bnJvd3MgLT0gbnJvd3NfY29waWVkOworICAg ICAgICAgICAgICAgICAgICAgICAgICBwLT5jdXJyZW50X3kgKz0gaGVpZ2h0X2NvcGllZDsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgcC0+ZGVzaXJlZF95ICs9IGhlaWdodF9jb3BpZWQ7Cisg ICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmhlaWdodCAtPSBoZWlnaHRfY29waWVkOworICAg ICAgICAgICAgICAgICAgICAgICAgICB0cnVuY2F0ZWRfcCA9IDE7CisgICAgICAgICAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgIGlmIChyLT5jdXJyZW50X3kgIT0gci0+ZGVzaXJlZF95CisgICAgICAgICAgICAgICAgLyog VGhlIGNvbmRpdGlvbiBiZWxvdyBpcyBlcXVpdmFsZW50IHRvCisgICAgICAgICAgICAgICAgICAg KChwLT5jdXJyZW50X3kgPj0gci0+ZGVzaXJlZF95CisgICAgICAgICAgICAgICAgICAgICAmJiBw LT5jdXJyZW50X3kgPCByLT5kZXNpcmVkX3kgKyByLT5oZWlnaHQpCisgICAgICAgICAgICAgICAg ICAgIHx8IChwLT5jdXJyZW50X3kgKyBwLT5oZWlnaHQgPiByLT5kZXNpcmVkX3kKKyAgICAgICAg ICAgICAgICAgICAgICAgICYmIChwLT5jdXJyZW50X3kgKyBwLT5oZWlnaHQKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICA8PSByLT5kZXNpcmVkX3kgKyByLT5oZWlnaHQpKSkKKyAgICAgICAg ICAgICAgICAgICBiZWNhdXNlIHdlIGhhdmUgMCA8IHAtPmhlaWdodCA8PSByLT5oZWlnaHQuICov CisgICAgICAgICAgICAgICAgJiYgcC0+Y3VycmVudF95IDwgci0+ZGVzaXJlZF95ICsgci0+aGVp Z2h0CisgICAgICAgICAgICAgICAgJiYgcC0+Y3VycmVudF95ICsgcC0+aGVpZ2h0ID4gci0+ZGVz aXJlZF95KQorICAgICAgICAgICAgICBwLT5ucm93cyA9IDA7CisgICAgICAgICAgICAvKiBSZW9y ZGVyIHJ1bnMgYnkgY29waWVkIHBpeGVsIGxpbmVzIGlmIHRydW5jYXRlZC4gKi8KKyAgICAgICAg ICAgIGlmICh0cnVuY2F0ZWRfcCAmJiBwLT5ucm93cyA+IDApCisgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICBpbnQgayA9IG5ydW5zIC0gMTsKKyAgICAgICAgICAgICAgICB3aGlsZSAo bWNfcnVuc1trXS0+bnJvd3MgPT0gMCB8fCBtY19ydW5zW2tdLT5oZWlnaHQgPCBwLT5oZWlnaHQp CisgICAgICAgICAgICAgICAgICBrLS07CisgICAgICAgICAgICAgICAgbWVtbW92ZSAobWNfcnVu cyArIGosIG1jX3J1bnMgKyBqICsgMSwgKGsgLSBqKSAqIHNpemVvZiAoKm1jX3J1bnMpKTsKKyAg ICAgICAgICAgICAgICBtY19ydW5zW2tdID0gcDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAg IH0KKyAgICAgICAgLyogQXNzaWduIG1hdHJpeCByb3dzLiAqLworICAgICAgICBmb3IgKGogPSAw OyBqIDwgci0+bnJvd3M7ICsraikKKyAgICAgICAgICB7CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5 cGhfcm93ICpmcm9tLCAqdG87CisgICAgICAgICAgICBib29sIHRvX292ZXJsYXBwZWRfcDsKKyAg ICAgICAgICAgIHRvID0gTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIHItPmRlc2lyZWRfdnBv cyArIGopOworICAgICAgICAgICAgZnJvbSA9IE1BVFJJWF9ST1cgKGRlc2lyZWRfbWF0cml4LCBy LT5kZXNpcmVkX3Zwb3MgKyBqKTsKKyAgICAgICAgICAgIHRvX292ZXJsYXBwZWRfcCA9IHRvLT5v dmVybGFwcGVkX3A7CisgICAgICAgICAgICBmcm9tLT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcCA9 IGZyb20tPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcDsKKyAgICAgICAgICAgIGFzc2lnbl9yb3cg KHRvLCBmcm9tKTsKKyAgICAgICAgICAgIC8qIFRoZSBhYm92ZSBgYXNzaWduX3JvdycgYWN0dWFs bHkgZG9lcyBzd2FwLCBzbyBpZiB3ZSBoYWQKKyAgICAgICAgICAgICAgIGFuIG92ZXJsYXAgaW4g dGhlIGNvcHkgZGVzdGluYXRpb24gb2YgdHdvIHJ1bnMsIHRoZW4KKyAgICAgICAgICAgICAgIHRo ZSBzZWNvbmQgcnVuIHdvdWxkIGFzc2lnbiBhIHByZXZpb3VzbHkgZGlzYW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aWNoIGlzIHByb2Nlc3NlZCBiZWZvcmUgYWxsIG90aGVyIHJvd3MpLCB3 ZQorICByZWx5IHVwb24gdGhlIHByZXZpb3VzIHJvdyBpbiB0aGUgY3VycmVudCBtYXRyaXguICBB cyB0byB0aGUgY3Vyc29yIHJvdywgd2UKKyAgcmVwbHkgdXBvbiB0aGUgcHJldmlvdXMgcm93IGlu IHRoZSBkZXNpcmVkIG1hdHJpeCAtLSB0aGlzIGlzIGFjY2VwdGFibGUgYmVjYXVzZQorICB0aGUg cG9pbnRlcnMgYmV0d2VlbiBkZXNpcmVkL2N1cnJlbnQgcm93IG1hdHJpY2VzIGhhdmUgbm90IHll dCBiZWVuIHN3YXBwZWQgYnkKKyAgYG1ha2VfY3VycmVudCcgaW4gYHVwZGF0ZV93aW5kb3dfbGlu ZScsIG9yIGJlY2F1c2UgdGhlIHByZXZpb3VzIHJvdyB3b3VsZCBiZQorICB0aGUgc2FtZSBpbiBi b3RoIG1hdHJpY2VzIGlmIHdlIGp1bXBlZCB0byBgc2V0X2N1cnNvcjpgIHdpdGhpbiBgdXBkYXRl X3dpbmRvdycKKyAgYW5kIGBtY191cGRhdGVfd2luZG93X2RyeXJ1bicuICovCisgIGludCBwcmV2 X21hdHJpeF9yb3dfc3RhcnRfYnl0ZXBvcyA9ICh2cG9zICE9IDApCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPV19TVEFSVF9CWVRFUE9TIChjdXJyZW50 X3JvdyAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogLTE7Cisg IGludCBwcmV2X21hdHJpeF9yb3dfZW5kX2J5dGVwb3MgPSAodnBvcyAhPSAwKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XX0VORF9CWVRFUE9TIChjdXJy ZW50X3JvdyAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IC0xOwor ICBpbnQgbWF0cml4X3Jvd19zdGFydF9ieXRlcG9zID0gTUFUUklYX1JPV19TVEFSVF9CWVRFUE9T IChkZXNpcmVkX3Jvdyk7CisgIGludCBtYXRyaXhfcm93X2VuZF9ieXRlcG9zID0gTUFUUklYX1JP V19FTkRfQllURVBPUyAoZGVzaXJlZF9yb3cpOworICAvKiBUaGUgZmlyc3QgY29uZGl0aW9uIHRl c3RzIGZvciBhIHNvbGl0YXJ5IHJvdyBjb250YWluaW5nIFpWLCBwcmVjZWRlZCBieSBhCisgIHJv dyBjb250YWluaW5nIGEgcGVudWx0aW1hdGUgZ2x5cGggd2l0aCBhIGNoYXJwb3Mgb2YgWlYgLSAx IGZvbGxvd2VkIGJ5IGFuIGVuZAorICBvZiByb3cgc3BhY2UgZ2x5cGggd2l0aCBhIGNoYXJwb3Mg b2YgMC4gIFRoZSBvdGhlciBjb25kaXRpb25zIHRlc3QgZm9yIGFuIGVtcHR5CisgIGJ1ZmZlciAo bm90IG5hcnJvd2VkKSwgb3IgYW4gZW1wdHkgbmFycm93ZWQgYnVmZmVyLiAqLworICBib29sIHJv d19hdF96dl9wID0gKCh2cG9zICE9IDAKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgKGN1cnJl bnRfcm93IC0gMSktPnVzZWRbVEVYVF9BUkVBXSA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAg JiYgcHJldl9tYXRyaXhfcm93X3N0YXJ0X2J5dGVwb3MgIT0gcHJldl9tYXRyaXhfcm93X2VuZF9i eXRlcG9zCisgICAgICAgICAgICAgICAgICAgICAgICYmICEoY3VycmVudF9yb3cgLSAxKS0+ZW5k c19hdF96dl9wCisgICAgICAgICAgICAgICAgICAgICAgICYmIG1hdHJpeF9yb3dfc3RhcnRfYnl0 ZXBvcyA9PSBtYXRyaXhfcm93X2VuZF9ieXRlcG9zCisgICAgICAgICAgICAgICAgICAgICAgICYm IGRlc2lyZWRfcm93LT5lbmRzX2F0X3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgfHwgKCgo aGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID09IDEpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICB8fCAoaGVhZGVyX2xpbmVfZm9ybWF0ID09IDAgJiYgdnBvcyA9PSAwKSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgYnVmZmVyX25hcnJvd2VkX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgYm9iX3Jlc3BlY3RfbmFycm93ID09IGVvYl9yZXNwZWN0X25hcnJvdykK KyAgICAgICAgICAgICAgICAgICAgICB8fCAoKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZw b3MgPT0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChoZWFkZXJfbGluZV9mb3Jt YXQgPT0gMCAmJiB2cG9zID09IDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBib2Jf ZGlzcmVnYXJkX25hcnJvdyA9PSBlb2JfZGlzcmVnYXJkX25hcnJvdykpOworICAvKiBJZiBsaW5l LW51bWJlcnMgYXJlIGFjdGl2ZSwgdGhlbiBzcGFjZSBnbHlwaCBwYWRkaW5nIGVxdWFsIHRvIGl0 cyB3aWR0aAorICBjb3VudGVkIGluIEhQT1MgYXJlIGZvbGxvd2VkIGJ5IGEgc2luZ2xlIHJvdyBl bmQgc3BhY2UgZ2x5cGguICBMaW5lIG51bWJlcgorICBwYWRkaW5nIHNwYWNlIGdseXBocyBoYXZl IGEgY2hhcnBvcyBvZiAtMSwgd2hlcmVhcyB0aGUgZW5kIG9mIHJvdyBzcGFjZSBnbHlwaAorICBo YXMgYSBjaGFycG9zIG9mIDAuICBJZiBsaW5lIG51bWJlcnMgYXJlIGluYWN0aXZlLCB0aGVuIHRo ZSByb3cgd2lsbCBjb250YWluCisgIGEgc29saXRhcnkgc3BhY2UgZ2x5cGggd2l0aCBhIGNoYXJw b3Mgb2YgLTEuICovCisgIGJvb2wgcm93X2JleW9uZF96dl9wID0gKG1hdHJpeF9yb3dfc3RhcnRf Ynl0ZXBvcyA9PSBtYXRyaXhfcm93X2VuZF9ieXRlcG9zCisgICAgICAgICAgICAgICAgICAgICAg ICAgICYmICFyb3dfYXRfenZfcCk7CisgIHJldHVybiAocm93X2F0X3p2X3ApCisgICAgICAgICAg ID8gQVRfWlYKKyAgICAgICAgIDogKHJvd19iZXlvbmRfenZfcCkKKyAgICAgICAgICAgPyBQT1NU X1pWCisgICAgICAgICA6IFBSRV9aVjsKK30KKworLyogVXBkYXRlIHRoZSBkaXNwbGF5IG9mIHRo ZSB0ZXh0IGFyZWEgb2Ygcm93IFZQT1MgaW4gd2luZG93IFcuCisgICBWYWx1ZSBpcyB0cnVlIGlm IGRpc3BsYXkgaGFzIGNoYW5nZWQuICovCitzdGF0aWMgYm9vbAorbWNfdXBkYXRlX3RleHRfYXJl YSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqdXBkYXRlZF9yb3csIGludCB2 cG9zLAorICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX21hdHJpeCAqY3Vyc29yX21h dHJpeCwKKyAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19lc3NlbnRpYWxzIGVzc2VudGlh bHMsIGJvb2wgZHJhd19wKQoreworICBib29sIGRlYnVnX3AgPSBmYWxzZTsKKyAgc3RydWN0IGds eXBoX3JvdyAqY3VycmVudF9yb3cgPSBNQVRSSVhfUk9XICh3LT5jdXJyZW50X21hdHJpeCwgdnBv cyk7CisgIHN0cnVjdCBnbHlwaF9yb3cgKmRlc2lyZWRfcm93ID0gTUFUUklYX1JPVyAody0+ZGVz aXJlZF9tYXRyaXgsIHZwb3MpOworICBzdHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFjZSAqcmlmID0g RlJBTUVfUklGIChYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpKTsKKyAgYm9vbCBjaGFuZ2VkX3Ag PSAwOworICBzdHJ1Y3QgbWNfUkdCIGxzbCA9IHsucmVkID0gLTEuMCwgLmdyZWVuID0gLTEuMCwg LmJsdWUgPSAtMS4wfTsKKyAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gTk9fRkxBVk9S OworICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlID0gTk9fQ1VSU09SOworICBpbnQg d2QgPSAtMTsKKyAgYm9vbCBjdXJzb3JfZ2NfcCA9IGZhbHNlOworICBzdHJ1Y3QgZ2x5cGhfbWF0 cml4ICpkZXNpcmVkX21hdHJpeCA9IHctPmRlc2lyZWRfbWF0cml4OworICBpZiAoZGVidWdfcCkK KyAgICBmcHJpbnRmIChzdGRlcnIsICJtY191cGRhdGVfdGV4dF9hcmVhICglcyk6ICB2cG9zICgl ZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgbWNfd2luZG93ICh3KSwgdnBvcyk7CisgIC8q IEluYXNtdWNoIGFzIHdlIHByb2Nlc3MgdGhlIGN1cnNvciByb3cgYmVmb3JlIGFsbCBvdGhlciBy b3dzLCB3ZSBjYW4gcmVseQorICB1cG9uIHRoZSBwcmV2aW91cyBgZGVzaXJlZF9yb3dgIHRvIGJl IGFjY3VyYXRlLiAqLworICBlbnVtIG1jX3Jvd19wb3NpdGlvbiByb3dfcG9zaXRpb24gPSAgbWNf cm93X3Bvc2l0aW9uICh3LCB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZGVzaXJlZF9yb3cK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBjdXJyZW50X3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgZGVzaXJlZF9yb3csIHZwb3MpOworICAvKiBJZiByb3dzIGFyZSBh dCBkaWZmZXJlbnQgW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AgICAgICAgbWNfZHJhd19nbHlwaHMgKHcsIGRlc2lyZWRfbWF0cml4LCB1 cGRhdGVkX3Jvdywgdy0+b3V0cHV0X2N1cnNvci54LAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgIFRFWFRfQVJFQSwgaHBvcywgaHBvcyArIGxlbiwgRFJBV19OT1JNQUxfVEVYVCwgMCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCBsc2wsIGdseXBoX2ZsYXZvciwgY3Vyc29y X3R5cGUsIHdkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZl X3AsIGN1cnNvcl9nY19wLCBNQ19EUkFXX0dMWVBIX1NUUklORywKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICBkcmF3X3ApOworICAgICAgICAgIHctPm91dHB1dF9jdXJzb3IuaHBvcyArPSBs ZW47CisgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgfQorICAgICAgLyogQ2xl YXIgdG8gZW5kIG9mIHdpbmRvdy4gKi8KKyAgICAgIGlmIChkcmF3X3ApCisgICAgICAgIHJpZi0+ Y2xlYXJfZW5kX29mX2xpbmUgKHcsIHVwZGF0ZWRfcm93LCBURVhUX0FSRUEsIC0xKTsKKyAgICAg IGNoYW5nZWRfcCA9IDE7CisgICAgICAvKiBUaGlzIGVyYXNlcyB0aGUgY3Vyc29yLiAgV2UgZG8g dGhpcyBoZXJlIGJlY2F1c2UKKyAgICAgICAgIG5vdGljZW92ZXJ3cml0dGVuX3RleHRfY3Vyc29y IGNhbm5vdCBlYXNpbHkgY2hlY2sgdGhpcywgd2hpY2gKKyAgICAgICAgIG1pZ2h0IGluZGljYXRl IHRoYXQgdGhlIHdob2xlIGZ1bmN0aW9uYWxpdHkgb2YKKyAgICAgICAgIG5vdGljZW92ZXJ3cml0 dGVuX3RleHRfY3Vyc29yIHdvdWxkIGJldHRlciBiZSBpbXBsZW1lbnRlZCBoZXJlLgor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DsKKyAgICAgICAgaW50IGRlc2lyZWRfc3RvcF9w b3MgPSBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdOworICAgICAgICBib29sIGFib3J0X3Nr aXBwaW5nID0gMDsKKyAgICAgICAgLyogSWYgdGhlIGRlc2lyZWQgcm93IGV4dGVuZHMgaXRzIGZh Y2UgdG8gdGhlIHRleHQgYXJlYSBlbmQsIGFuZCB1bmxlc3MgdGhlCisgICAgICAgIGN1cnJlbnQg cm93IGFsc28gZG9lcyBzbyBhdCB0aGUgc2FtZSBwb3NpdGlvbiwgbWFrZSBzdXJlIHdlIHdyaXRl IGF0IGxlYXN0IG9uZQorICAgICAgICBnbHlwaCwgc28gdGhhdCB0aGUgZmFjZSBleHRlbnNpb24g YWN0dWFsbHkgdGFrZXMgcGxhY2UuICovCisgICAgICAgIGlmIChNQVRSSVhfUk9XX0VYVEVORFNf RkFDRV9QIChkZXNpcmVkX3JvdykKKyAgICAgICAgICAgICYmIChkZXNpcmVkX3N0b3BfcG9zIDwg Y3VycmVudF9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgIHx8IChkZXNpcmVk X3N0b3BfcG9zID09IGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAg ICAgICAgJiYgIU1BVFJJWF9ST1dfRVhURU5EU19GQUNFX1AgKGN1cnJlbnRfcm93KSkpKQorICAg ICAgICAgIC0tZGVzaXJlZF9zdG9wX3BvczsKKyAgICAgICAgc3RvcCA9IG1pbiAoY3VycmVudF9y b3ctPnVzZWRbVEVYVF9BUkVBXSwgZGVzaXJlZF9zdG9wX3Bvcyk7CisgICAgICAgIGkgPSAwOwor ICAgICAgICB4ID0gZGVzaXJlZF9yb3ctPng7CisgICAgICAgIGludCBjbGVhcl90b194ID0gMDsK KworICAgICAgICAvKiBMb29wIG92ZXIgZ2x5cGhzIHRoYXQgY3VycmVudCBhbmQgZGVzaXJlZCBy b3cgbWF5IGhhdmUgaW4gY29tbW9uLiAqLworICAgICAgICB3aGlsZSAoaSA8IHN0b3ApCisgICAg ICAgICAgeworICAgICAgICAgICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZCA9IDA7CisgICAg ICAgICAgICBib29sIGNhbl9za2lwX3AgPSAhYWJvcnRfc2tpcHBpbmc7CisgICAgICAgICAgICAv KiBTa2lwIG92ZXIgZ2x5cGhzIHRoYXQgYm90aCByb3dzIGhhdmUgaW4gY29tbW9uLiAgVGhlc2Ug ZG9uJ3QgaGF2ZQorICAgICAgICAgICAgdG8gYmUgd3JpdHRlbi4gIFdlIGNhbid0IHNraXAgaWYg dGhlIGxhc3QgY3VycmVudCBnbHlwaCBvdmVybGFwcyB0aGUKKyAgICAgICAgICAgIGdseXBoIHRv IGl0cyByaWdodC4gIEZvciBleGFtcGxlLCBjb25zaWRlciBhIGN1cnJlbnQgcm93IG9mIGBpZicg d2l0aAorICAgICAgICAgICAgdGhlIGBmJyBpbiBDb3VyaWVyIGJvbGQgc28gdGhhdCBpdCBvdmVy bGFwcyB0aGUgYCAnIHRvIGl0cyByaWdodC4KKyAgICAgICAgICAgIElmIHRoZSBkZXNpcmVkIHJv dyBpcyBgICcsIHdlIHdvdWxkIHNraXAgb3ZlciB0aGUgc3BhY2UgYWZ0ZXIgdGhlCisgICAgICAg ICAgICBgaWYnIGFuZCB0aGVyZSB3b3VsZCByZW1haW4gYSBwaXhlbCBmcm9tIHRoZSBgZicgb24g dGhlIHNjcmVlbi4gKi8KKyAgICAgICAgICAgIGlmIChvdmVybGFwcGluZ19nbHlwaHNfcCAmJiBp ID4gMCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5 cGggPSAmY3VycmVudF9yb3ctPmdseXBoc1tURVhUX0FSRUFdW2kgLSAxXTsKKyAgICAgICAgICAg ICAgICBpbnQgbGVmdCwgcmlnaHQ7CisgICAgICAgICAgICAgICAgcmlmLT5nZXRfZ2x5cGhfb3Zl cmhhbmdzIChnbHlwaCwgWEZSQU1FICh3LT5mcmFtZSksICZsZWZ0LCAmcmlnaHQpOworICAgICAg ICAgICAgICAgIGNhbl9za2lwX3AgPSAocmlnaHQgPT0gMCAmJiAhYWJvcnRfc2tpcHBpbmcpOwor ICAgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoY2FuX3NraXBfcCkKKyAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgIGludCBzdGFydF9ocG9zID0gaTsKKyAgICAgICAgICAgICAg ICB3aGlsZSAoaSA8IHN0b3AKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgR0xZUEhfRVFVQUxf UCAoZGVzaXJlZF9nbHlwaCwgY3VycmVudF9nbHlwaCkpCisgICAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgICAgICsrYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZDsKKyAgICAgICAg ICAgICAgICAgICAgaWYgKGFycmF5X2dseXBoc19za2lwcGVkLmFsbG9jYXRlZCA8IGFycmF5X2ds eXBoc19za2lwcGVkLnVzZWQpCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgICAgICAgaW50IG9sZF9hbGxvYyA9IGFycmF5X2dseXBoc19za2lwcGVkLmFsbG9jYXRl ZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBuZXdfZWx0cyA9IGFycmF5X2dseXBoc19z a2lwcGVkLnVzZWQgLSBhcnJheV9nbHlwaHNfc2tpcHBlZC5hbGxvY2F0ZWQ7CisgICAgICAgICAg ICAgICAgICAgICAgICBhcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVkID0KKyAgICAgICAgICAg ICAgICAgICAgICAgICAgeHBhbGxvYyAoYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmFycmF5X2dseXBoc19za2lwcGVkLmFs bG9jYXRlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2VsdHMsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElOVF9NQVgsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiAqYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBl ZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBtZW1zZXQgKGFycmF5X2dseXBoc19za2lwcGVk LnNraXBwZWQgKyBvbGRfYWxsb2MsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAoYXJyYXlfZ2x5cGhzX3NraXBwZWQuYWxsb2NhdGVkIC0gb2xkX2FsbG9jKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAqIHNpemVvZiAqYXJyYXlfZ2x5cGhzX3NraXBwZWQu c2tpcHBlZCk7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBp bnQgbnRoID0gYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZCAtIDE7CisgICAgICAgICAgICAgICAg ICAgIGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbbnRoXS54ID0geDsKKyAgICAgICAgICAg ICAgICAgICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZFtudGhdLmhwb3MgPSBpOworICAg ICAgICAgICAgICAgICAgICBhcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVkW250aF0uZW5hYmxl ZF9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgeCArPSBkZXNpcmVkX2dseXBoLT5waXhl bF93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgKytkZXNpcmVkX2dseXBoLCArK2N1cnJlbnRf Z2x5cGgsICsraTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvKiBDb25z aWRlciB0aGUgY2FzZSB0aGF0IHRoZSBjdXJyZW50IHJvdyBjb250YWlucyAieHh4IHBwcCBnZ2ci IGluCisgICAgICAgICAgICAgICAgaXRhbGljIENvdXJpZXIgZm9udCwgYW5kIHRoZSBkZXNpcmVk IHJvdyBpcyAieHh4IGdnZyIuICBUaGUgY2hhcmFjdGVyIGBwJworICAgICAgICAgICAgICAgIGhh cyBsYmVhcmluZywgYGcnIGhhcyBub3QuICBUaGUgbG9vcCBhYm92ZSB3aWxsIHN0b3AgaW4gZnJv bnQgb2YgdGhlCisgICAgICAgICAgICAgICAgZmlyc3QgYHAnIGluIHRoZSBjdXJyZW50IHJvdy4g IElmIHdlIHdvdWxkIHN0YXJ0IHdyaXRpbmcgZ2x5cGhzIHRoZXJlLCB3ZQorICAgICAgICAgICAg ICAgIHdvdWxkbid0IGVyYXNlIHRoZSBsYmVhcmluZyBvZiB0aGUgYHAnLiAgVGhlIHJlc3Qgb2Yg dGhlIGxiZWFyaW5nIHByb2JsZW0KKyAgICAgICAgICAgICAgICBpcyB0aGVuIHRha2VuIGNhcmUg b2YgYnkgZHJhd19nbHlwaHMuICovCisgICAgICAgICAgICAgICAgaWYgKG92ZXJsYXBwaW5nX2ds eXBoc19wCisgICAgICAgICAgICAgICAgICAgICYmIGkgPiAwCisgICAgICAgICAgICAgICAgICAg ICYmIGkgPCBjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAg ICYmIChjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdICE9IGRlc2lyZWRfcm93LT51c2VkW1RF WFRfQVJFQV0pKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpbnQg bGVmdCwgcmlnaHQ7CisgICAgICAgICAgICAgICAgICAgIHJpZi0+Z2V0X2dseXBoX292ZXJoYW5n cyAoY3VycmVudF9nbHlwaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBYRlJBTUUgKHct PmZyYW1lKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmbGVmdCwgJnJpZ2h0KTsKKyAg ICAgICAgICAgICAgICAgICAgd2hpbGUgKGxlZnQgPiAwICYmIGkgPiAwKQorICAgICAgICAgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC0taSwgLS1kZXNpcmVkX2dseXBo LCAtLWN1cnJlbnRfZ2x5cGg7CisgICAgICAgICAgICAgICAgICAgICAgICB4IC09IGRlc2lyZWRf Z2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICAgICAgICAgICAgbGVmdCAtPSBkZXNp cmVkX2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgICAgICAgIC8qIEFib3J0IHRoZSBza2lwcGluZyBhbGdvcml0aG0gaWYgd2UgZW5kIHVw IGJlZm9yZQorICAgICAgICAgICAgICAgICAgICAgICBvdXIgc3RhcnRpbmcgcG9pbnQsIHRvIGF2 b2lkIGxvb3BpbmcgKGJ1ZyMxMDcwKS4KKyAgICAgICAgICAgICAgICAgICAgICAgVGhpcyBjYW4g aGFwcGVuIHdoZW4gdGhlIGxiZWFyaW5nIGlzIGxhcmdlciB0aGFuCisgICAgICAgICAgICAgICAg ICAgICAgIHRoZSBwaXhlbCB3aWR0aC4gKi8KKyAgICAgICAgICAgICAgICAgICAgYWJvcnRfc2tp cHBpbmcgPSAoaSA8IHN0YXJ0X2hwb3MpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgICB9CisgICAgICAgICAgICAvKiBUcnkgdG8gYXZvaWQgd3JpdGluZyB0aGUgZW50aXJlIHJl c3Qgb2YgdGhlIGRlc2lyZWQgcm93CisgICAgICAgICAgICAgICBieSBsb29raW5nIGZvciBhIHJl c3luYyBwb2ludC4gIFRoaXMgbWFpbmx5IHByZXZlbnRzCisgICAgICAgICAgICAgICBtb2RlIGxp bmUgZmxpY2tlcmluZyBpbiB0aGUgY2FzZSB0aGUgbW9kZSBsaW5lIGlzIGluCisgICAgICAgICAg ICAgICBmaXhlZC1waXRjaCBmb250LCB3aGljaCBpdCB1c3VhbGx5IHdpbGwgYmUuICovCisgICAg ICAgICAgICBpZiAoaSA8IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICBpbnQgc3RhcnRfeCA9IHgsIHN0YXJ0X2hwb3MgPSBpOwor ICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqc3RhcnQgPSBkZXNpcmVkX2dseXBoOworICAg ICAgICAgICAgICAgIGludCBjdXJyZW50X3ggPSB4OworICAgICAgICAgICAgICAgIGJvb2wgc2tp cF9maXJzdF9wID0gIWNhbl9za2lwX3A7CisgICAgICAgICAgICAgICAgLyogRmluZCB0aGUgbmV4 dCBnbHlwaCB0aGF0J3MgZXF1YWwgYWdhaW4uICovCisgICAgICAgICAgICAgICAgd2hpbGUgKGkg PCBzdG9wCisgICAgICAgICAgICAgICAgICAgICAgICYmIChza2lwX2ZpcnN0X3AKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgIHx8ICFHTFlQSF9FUVVBTF9QIChkZXNpcmVkX2dseXBoLCBjdXJy ZW50X2dseXBoKSkKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgeCA9PSBjdXJyZW50X3gpCisg ICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHggKz0gZGVzaXJlZF9nbHlw aC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRfeCArPSBjdXJyZW50 X2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgKytkZXNpcmVkX2dseXBo LCArK2N1cnJlbnRfZ2x5cGgsICsraTsKKyAgICAgICAgICAgICAgICAgICAgc2tpcF9maXJzdF9w ID0gMDsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBmb3IgKGludCBlbHQg PSAwOworICAgICAgICAgICAgICAgICAgICAgZWx0IDwgYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNl ZDsKKyAgICAgICAgICAgICAgICAgICAgICsrZWx0KQorICAgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgICBpbnQgeCA9IGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbZWx0 XS54OworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGFycmF5X2dseXBoc19za2lwcGVk LnNraXBwZWRbZWx0XS5ocG9zOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnRh cmdldF9nbHlwaCA9CisgICAgICAgICAgICAgICAgICAgICAgbWNfZ2V0X2N1cnNvcl9nbHlwaCAo dywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCBocG9zLCB2cG9zKTsKKyAgICAgICAgICAg ICAgICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgICAgICAgICAgICAgICAgZnByaW50ZiAoc3Rk ZXJyLCAiU0tJUFBFRDogIHZwb3MgKCVkKSB8IGNoYXIgKCVkLyVzKSB8IHg6ICglZCkgfCBocG9z ICglZC8lZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9z LCB0YXJnZXRfZ2x5cGgtPnUuY2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBtY19jaGFyX3RvX3N0cmluZyAodGFyZ2V0X2dseXBoLT51LmNoKSwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHgsIGhwb3MsIHVwZGF0ZWRfcm93LT51c2VkW1RF WFRfQVJFQV0gLSAxKTsKKyAgICAgICAgICAgICAgICAgICAgbWNfZHJhd19yb3cgKHcsIGRlc2ly ZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBoLCB4LCAxLCB2cG9zLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93 X3Bvc2l0aW9uLCBkcmF3X3AsIFNLSVBQRUQpOworICAgICAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgICAgIGlmIChpID09IHN0YXJ0X2hwb3MgfHwgeCAhPSBjdXJyZW50X3gpCisgICAgICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGkgPSBzdGFydF9ocG9zOworICAgICAg ICAgICAgICAgICAgICB4ID0gc3RhcnRfeDsKKyAgICAgICAgICAgICAgICAgICAgZGVzaXJlZF9n bHlwaCA9IHN0YXJ0OworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgICAgICBvdXRwdXRfY3Vyc29yX3RvICh3LCB2cG9zLCBzdGFydF9o cG9zLCBkZXNpcmVkX3Jvdy0+eSwgc3RhcnRfeCk7CisgICAgICAgICAgICAgICAgLyogUmUtZHJh dyBhIHBvcnRpb24gb2YgdGhlIHJvdy4gKi8KKyAgICAgICAgICAgICAgICBpZiAoZGVidWdfcCkK KyAgICAgICAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIlJFRFJBVyBTRUdNRU5UOlxuXAor ICAgICAgICAgICAgICAgICAgICB2cG9zICglZCkgfCBjaGFyICglZC8lcykgfCB4OiAoJWQpIHwg aHBvcyAoJWQvJWQpIHwgbGVuZ3RoICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgIHZwb3Ms IHN0YXJ0LT51LmNoLCBtY19jaGFyX3RvX3N0cmluZyAoc3RhcnQtPnUuY2gpLAorICAgICAgICAg ICAgICAgICAgICBzdGFydF94LCBzdGFydF9ocG9zLCB1cGRhdGVkX3Jvdy0+dXNlZFtURVhUX0FS RUFdIC0gMSwgaSAtIHN0YXJ0X2hwb3MpOworICAgICAgICAgICAgICAgIGJsb2NrX2lucHV0ICgp OworICAgICAgICAgICAgICAgIGludCBsZW4gPSBpIC0gc3RhcnRfaHBvczsKKyAgICAgICAgICAg ICAgICBpbnQgaHBvcyA9IHN0YXJ0IC0gdXBkYXRlZF9yb3ctPmdseXBoc1tURVhUX0FSRUFdOwor ICAgICAgICAgICAgICAgIHctPm91dHB1dF9jdXJzb3IueCA9CisgICAgICAgICAgICAgICAgICBt Y19kcmF3X2dseXBocyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB3LT5vdXRwdXRf Y3Vyc29yLngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVEVYVF9BUkVBLCBo cG9zLCBocG9zICsgbGVuLCBEUkFXX05PUk1BTF9URVhULAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDAsIHZwb3MsIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2Qs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVfcCwg Y3Vyc29yX2djX3AsIE1DX0RSQVdfR0xZUEhfU1RSSU5HLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGRyYXdfcCk7CisgICAgICAgICAgICAgICAgdy0+b3V0cHV0X2N1cnNvci5o cG9zICs9IGxlbjsKKyAgICAgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgICAg ICAgICAgIG1jX2RyYXdfcm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHN0YXJ0 LCBzdGFydF94LCBpIC0gc3RhcnRfaHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg dnBvcywgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBkcmF3X3AsIFND UklCRV9UV08pOworICAgICAgICAgICAgICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAgICAgICAg IH0KKyAgICAgICAgICB9CisKKyAgICAgICAgLyogV3JpdGUgdGhlIHJlc3QuICovCisgICAgICAg IGlmIChpIDwgZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgICAgICB7CisgICAg ICAgICAgICBvdXRwdXRfY3Vyc29yX3RvICh3LCB2cG9zLCBpLCBkZXNpcmVkX3Jvdy0+eSwgeCk7 CisgICAgICAgICAgICBpZiAoZGVidWdfcCkKKyAgICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJy LCAiRFJBVyBSRU1BSU5ERVIgT0YgVEhFIFJPVzpcblwKKyAgICAgICAgICAgICAgICB2cG9zICgl ZCkgfCBjaGFyICglZC8lcykgfCB4OiAoJWQpIHwgaHBvcyAoJWQvJWQpIHwgbGVuZ3RoICglZClc biIsCisgICAgICAgICAgICAgICAgdnBvcywgZGVzaXJlZF9nbHlwaC0+dS5jaCwgbWNfY2hhcl90 b19zdHJpbmcgKGRlc2lyZWRfZ2x5cGgtPnUuY2gpLAorICAgICAgICAgICAgICAgIHgsIGksIGRl c2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxLCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FS RUFdIC0gaSk7CisgICAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgIGludCBs ZW4gPSBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gaTsKKyAgICAgICAgICAgIGludCBo cG9zID0gZGVzaXJlZF9nbHlwaCAtIHVwZGF0ZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAg ICAgICAgICAgIHctPm91dHB1dF9jdXJzb3IueCA9CisgICAgICAgICAgICAgIG1jX2RyYXdfZ2x5 cGhzICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHctPm91dHB1dF9jdXJzb3IueCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRFWFRfQVJFQSwgaHBvcywgaHBvcyArIGxl biwgRFJBV19OT1JNQUxfVEVYVCwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZw b3Ms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XJlZF9tYXRyaXgsIHVwZGF0ZWRf cm93LCBkZXNpcmVkX2dseXBoLCB4LAorICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2lyZWRf cm93LT51c2VkW1RFWFRfQVJFQV0gLSBpLCB2cG9zLCBjdXJzb3JfbWF0cml4LAorICAgICAgICAg ICAgICAgICAgICAgICAgIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgZHJhd19wLCBTQ1JJQkVf VEhSRUUpOworICAgICAgICAgICAgY2hhbmdlZF9wID0gMTsKKyAgICAgICAgICB9CisgICAgICAg ICAgLyogRXZlcnl0aGluZyBhZnRlciB0aGUgcHJldmlvdXMgY2hhbmdlIHJlbWFpbmVkIHRoZSBz YW1lLiAgYGlgIGFuZCBgeGAgd2VyZQorICAgICAgICAgIGluY3JlbWVudGVkIHRvIHRoZSBlbmQg b2YgdGhlIGdseXBoIHJvdy4gIGkgPT0gZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAg ICAgICAgIFRoZSBgdy0+b3V0cHV0X2N1cnNvci54L3kvaHBvcy92cG9zYCBpcyBhdCB0aGUgZW5k IG9mIHRoZSBwcmV2aW91cyBjaGFuZ2UuCisgICAgICAgICAgV2hlbiB0aGlzIHNpdHVhdGlvbiBl eGlzdHMsIHRoZSBkaXN0YW5jZSBiZXR3ZWVuIHRoZSBlbmQgb2YgdGhlIGdseXBoIHJvdyBhbmQK KyAgICAgICAgICB0aGUgcmlnaHQgZWRnZSBvZiB0aGUgd2luZG93IHdpbGwgX25vdF8gYmUgY2xl YXJlZC4gIFRoZXJlZm9yZSwgaXQgaXMgb2theSB0bworICAgICAgICAgIGRyYXcgdGhlIGZsb2F0 aW5nIGdseXBocyBmb3IgdGhlIGhvcml6b250YWwvdmVydGljYWwgcnVsZXJzIGhlcmUuICovCisg ICAgICAgICAgZWxzZSBpZiAoY2hhbmdlZF9wCisgICAgICAgICAgICAgICAgICAgJiYgdy0+b3V0 cHV0X2N1cnNvci5ocG9zICE9IHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIGludCB4ID0gdy0+b3V0cHV0X2N1cnNvci54OworICAgICAg ICAgICAgICBpbnQgaHBvcyA9IHctPm91dHB1dF9jdXJzb3IuaHBvczsKKyAgICAgICAgICAgICAg c3RydWN0IGdseXBoICpzdGFydCA9IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIGRlc2lyZWRfbWF0 cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgdXBkYXRlZF9yb3csIGhwb3MsIHZwb3MpOworICAgICAgICAgICAgICBpZiAody0+b3V0 cHV0X2N1cnNvci54ID09IHVwZGF0ZWRfcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAg ICB4IC09IHN0YXJ0LT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgaWYgKGRlYnVnX3ApCisg ICAgICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiUE9TVC1DSEFOR0VEOiAgdnBvcyAoJWQp IHwgeCAoJWQpIHwgaHBvcyAoJWQvJWQpIHwgY2hhciAoJWQvJXMpXG4iLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgdnBvcywgeCwgaHBvcywgdXBkYXRlZF9yb3ctPnVzZWRbVEVY VF9BUkVBXSAtIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydC0+dS5j aCwgbWNfY2hhcl90b19zdHJpbmcgKHN0YXJ0LT51LmNoKSk7CisgICAgICAgICAgICAgIG1jX2Ry YXdfcm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHN0YXJ0LCB4LAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIGhwb3Ms IHZwb3MsIGN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBlc3NlbnRp YWxzLCByb3dfcG9zaXRpb24sIGRyYXdfcCwgUE9TVF9DSEFOR0VEKTsKKyAgICAgICAgICAgIH0K KyAgICAgICAgICAgIC8qIFRoZXJlIHdlcmUgbm8gY2hhbmdlcyBhbmQgaSA9PSBkZXNpcmVkX3Jv dy0+dXNlZFtURVhUX0FSRUFdICovCisgICAgICAgICAgICBlbHNlIGlmICghY2hhbmdlZF9wKQor ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgICAg ICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJVTkNIQU5HRUQgLS0gV1JJVEUgRU5USVJFIExJTkU6 ICB2cG9zICglZCkgfCByb3ctPnVzZWQgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgdnBvcywgdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpOworICAg ICAgICAgICAgICAgIG1jX2RyYXdfcm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3cs IGRlc2lyZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgZGVzaXJlZF9yb3ctPngsIGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0sIHZwb3Ms CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMs IHJvd19wb3NpdGlvbiwgZHJhd19wLCBVTkNIQU5HRUQpOworICAgICAgICAgICAgICB9CisKKyAg ICAgICAgLyogTWF5YmUgY2xlYXIgdG8gZW5kIG9mIGxpbmUuICovCisgICAgICAgIGlmIChNQVRS SVhfUk9XX0VYVEVORFNfRkFDRV9QIChkZXNpcmVkX3JvdykpCisgICAgICAgICAgeworICAgICAg ICAgICAgLyogSWYgbmV3IHJvdyBleHRlbmRzIHRvIHRoZSBlbmQgb2YgdGhlIHRleHQgYXJlYSwg bm90aGluZworICAgICAgICAgICAgICAgaGFzIHRvIGJlIGNsZWFyZWQsIGlmIGFuZCBvbmx5IGlm IHdlIGRpZCBhIHdyaXRlX2dseXBocworICAgICAgICAgICAgICAgYWJvdmUuICBUaGlzIGlzIG1h ZGUgc3VyZSBieSBzZXR0aW5nIGRlc2lyZWRfc3RvcF9wb3MKKyAgICAgICAgICAgICAgIGFwcHJv cHJpYXRlbHkgYWJvdmUuICovCisgICAgICAgICAgICBlYXNzZXJ0IChpIDwgZGVzaXJlZF9yb3ct PnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAgICAgfHwgKChkZXNpcmVkX3Jvdy0+ dXNlZFtURVhUX0FSRUFdID09IGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgTUFUUklYX1JPV19FWFRFTkRTX0ZBQ0VfUCAoY3VycmVudF9y b3cpKSk7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKE1BVFJJWF9ST1dfRVhURU5E U19GQUNFX1AgKGN1cnJlbnRfcm93KSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyog SWYgb2xkIHJvdyBleHRlbmRzIHRvIHRoZSBlbmQgb2YgdGhlIHRleHQgYXJlYSwgY2xlYXIuICov CisgICAgICAgICAgICAgIGlmIChpID49IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisg ICAgICAgICAgICAgICAgb3V0cHV0X2N1cnNvcl90byAodywgdnBvcywgaSwgZGVzaXJlZF9yb3ct PnksIGRlc2lyZWRfcm93LT5waXhlbF93aWR0aCk7CisgICAgICAgICAgICAgIGlmIChkcmF3X3Ap CisgICAgICAgICAgICAgICAgcmlmLT5jbGVhcl9lbmRfb2ZfbGluZSAodywgdXBkYXRlZF9yb3cs IFRFWFRfQVJFQSwgLTEpOworICAgICAgICAgICAgICBjbGVhcl90b194ID0gLTE7CisgICAgICAg ICAgICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlm IChkZXNpcmVkX3Jvdy0+cGl4ZWxfd2lkdGggPCBjdXJyZW50X3Jvdy0+cGl4ZWxfd2lkdGgpCisg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBPdGhlcndpc2UgY2xlYXIgdG8gdGhl IGVuZCBvZiB0aGUgb2xkIHJvdy4gIEV2ZXJ5dGhpbmcKKyAgICAgICAgICAgICAgICAgICBhZnRl ciB0aGF0IHBvc2l0aW9uIHNob3VsZCBiZSBjbGVhciBhbHJlYWR5LiAqLworICAgICAgICAgICAg ICAgIGludCB4bGltOworICAgICAgICAgICAgICAgIGlmIChpID49IGRlc2lyZWRfcm93LT51c2Vk W1RFWFRfQVJFQV0pCisgICAgICAgICAgICAgICAgICBvdXRwdXRfY3Vyc29yX3RvICh3LCB2cG9z LCBpLCBkZXNpcmVkX3Jvdy0+eSwgZGVzaXJlZF9yb3ctPnBpeGVsX3dpZHRoKTsKKyAgICAgICAg ICAgICAgICAvKiBJZiBjdXJzb3IgaXMgZGlzcGxheWVkIGF0IHRoZSBlbmQgb2YgdGhlIGxpbmUs IG1ha2Ugc3VyZQorICAgICAgICAgICAgICAgICAgIGl0J3MgY2xlYXJlZC4gIE5vd2FkYXlzIHdl IGRvbid0IGhhdmUgYSBwaHlzX2N1cnNvcl9nbHlwaAorICAgICAgICAgICAgICAgICAgIHdpdGgg d2hpY2ggdG8gZXJhc2UgdGhlIGN1cnNvciAoYmVjYXVzZSB0aGlzIG1ldGhvZAorICAgICAgICAg ICAgICAgICAgIGRvZXNuJ3Qgd29yayB3aXRoIGxiZWFyaW5nL3JiZWFyaW5nKSwgc28gd2UgbXVz dCBkbyBpdCB0aGlzIHdheS4gKi8KKyAgICAgICAgICAgICAgICBpZiAodnBvcyA9PSB3LT5waHlz X2N1cnNvci52cG9zCisgICAgICAgICAgICAgICAgICAgICYmIChkZXNpcmVkX3Jvdy0+cmV2ZXJz ZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAgPyAody0+cGh5c19jdXJzb3IuaHBvcyA8IDAp CisgICAgICAgICAgICAgICAgICAgICAgICA6ICh3LT5waHlzX2N1cnNvci5ocG9zID49IGRlc2ly ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pKSkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAgICAgdy0+cGh5c19jdXJzb3Jfb25fcCA9IDA7CisgICAgICAgICAgICAgICAgICAg IHhsaW0gPSAtMTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgICAgICAgeGxpbSA9IGN1cnJlbnRfcm93LT5waXhlbF93aWR0aDsKKyAg ICAgICAgICAgICAgICBpZiAoZHJhd19wKQorICAgICAgICAgICAgICAgICAgcmlmLT5jbGVhcl9l bmRfb2ZfbGluZSAodywgdXBkYXRlZF9yb3csIFRFWFRfQVJFQSwgeGxpbSk7CisgICAgICAgICAg ICAgICAgY2xlYXJfdG9feCA9IHhsaW07CisgICAgICAgICAgICAgICAgY2hhbmdlZF9wID0gMTsK KyAgICAgICAgICAgICAgfQorCisgICAgICAgIGlmIChjaGFuZ2VkX3AKKyAgICAgICAgICAgICYm IGNsZWFyX3RvX3ggIT0gMCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpbnQgdGV4dF9hcmVh X3dpZHRoID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgIHN0 cnVjdCBtY19SR0IgZGVidWdfZmcgPSB7LnJlZCA9IDAuODY3LCAuZ3JlZW4gPSAwLjg2NywgLmJs dWUgPSAwLjg2N307CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnRhcmdldF9nbHlwaCA9Cisg ICAgICAgICAgICAgIHVwZGF0ZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHVwZGF0ZWRfcm93 LT51c2VkW1RFWFRfQVJFQV0gLSAxOworICAgICAgICAgICAgLyogYG1jX2VuZ2luZScgb25seSBk cmF3cyBhbiBNQ19HTFlQSCB3aGVuIHggPCB1cGRhdGVkX3Jvdy0+cGl4ZWxfd2lkdGguCisgICAg ICAgICAgICBUaGUgY3VycmVudCBkZXNpZ24gaW5oaWJpdHMgZHJhd2luZyBvdmVyIGFuIGV4aXN0 aW5nIGdseXBoIGF0IHRoZSBlbmQgb2YgYQorICAgICAgICAgICAgd29yZC13cmFwcGVkIGxpbmUu ICBTYWlkIGdseXBoIHJlY2VpdmVzIGEgZmFrZSBjdXJzb3IgaW4gZWl0aGVyIG9uZSBvZiB0aGUK KyAgICAgICAgICAgIHByZXZpb3VzIHNlY3Rpb25zIGFib3ZlLCBhbmQgc2hvdWxkIG5vdCBiZSBv dmVyd3JpdHRlbiB3aXRoIGFub3RoZXIgb25lLgorICAgICAgICAgICAgVGhpcyBkZXNpZ24gaXMg bmVlZGVkIGJlY2F1c2UgYSB3b3JkLXdyYXBwZWQgbGluZSBkb2VzIG5vdCByZWNlaXZlIGFuIGV4 dHJhCisgICAgICAgICAgICBzcGFjZSBsaWtlIG5vbi13b3JkLXdyYXBwZWQgbGluZXMgZG8uICov CisgICAgICAgICAgICBpbnQgeCA9IHVwZGF0ZWRfcm93LT5waXhlbF93aWR0aDsKKyAgICAgICAg ICAgIGludCBocG9zID0gdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDE7CisgICAgICAg ICAgICBpbnQgeF9saW1pdCA9IChjbGVhcl90b194ID09IC0xKQorICAgICAgICAgICAgICAgICAg ICAgICAgICA/IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICA6IGNs ZWFyX3RvX3g7CisgICAgICAgICAgICBMaXNwX09iamVjdCBidWYgPSB3LT5jb250ZW50czsKKyAg ICAgICAgICAgIENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgICAgICAgICAgIHN0cnVjdCBidWZmZXIg KmIgPSBYQlVGRkVSIChidWYpOworICAgICAgICAgICAgYm9vbCBmaWxsX2NvbHVtbl90cnVtcHNf cCA9ICghTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgZmNfdmlzaWJsZSkp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54 ID09IGVzc2VudGlhbHMuZmNfeCk7CisgICAgICAgICAgICBpZiAodHJhY2VfcmVkaXNwbGF5X3Ap CisgICAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX3VwZGF0ZV90ZXh0X2FyZWEgKGZs b2F0aW5nKTogIHZwb3MgKCVkKSB8IHhfbGltaXQgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICB2cG9zLCB4X2xpbWl0KTsKKyAgICAgICAgICAgIGlmIChCVUZGRVJQICh3 LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgZmNfdmlzaWJs ZSkpCisgICAgICAgICAgICAgICAgJiYgKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAg ICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAg ICAmJiAhTklMUCAoQlZBUiAoYiwgZmNfaW5hY3RpdmVfd2luZG93cykpKSkKKyAgICAgICAgICAg ICAgICAmJiB4IDwgdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFs cy5mY194ID49IHgKKyAgICAgICAgICAgICAgICAmJiB0YXJnZXRfZ2x5cGggIT0gTlVMTAorICAg ICAgICAgICAgICAgICYmIGRyYXdfcCkKKyAgICAgICAgICAgICAgbWNfZW5naW5lICh3LCBkZXNp cmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHRhcmdldF9nbHlwaCwgVEVYVF9BUkVBLAorICAgICAg ICAgICAgICAgICAgICAgICAgIHgsIHhfbGltaXQsIHVwZGF0ZWRfcm93LT55LCBocG9zLCB2cG9z LCBNQ19CQVIsIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNz ZW50aWFscywgcm93X3Bvc2l0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgIGRlYnVnX3Ag PyBkZWJ1Z19mZyA6IGVzc2VudGlhbHMuZmNfZmdbcm93X3Bvc2l0aW9uXSwKKyAgICAgICAgICAg ICAgICAgICAgICAgICBGSUxMX0NPTFVNTiwgZHJhd19wLCBOT1dIRVJFLCBOT19DQUNIRSk7Cisg ICAgICAgICAgICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgJiYg IU5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICYmICFOSUxQIChC VkFSIChiLCBjaF9ob3Jpem9udGFsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAmJiAoZXNzZW50 aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICB8fCAoIWVzc2VudGlhbHMuYWN0aXZl X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9pbmFjdGl2 ZV93aW5kb3dzKSkpKQorICAgICAgICAgICAgICAgICYmIHggPCB0ZXh0X2FyZWFfd2lkdGgKKyAg ICAgICAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICAgICAg JiYgdGFyZ2V0X2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAgICAmJiBkcmF3X3ApCisgICAg ICAgICAgICAgIG1jX2VuZ2luZSAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0YXJn ZXRfZ2x5cGgsIFRFWFRfQVJFQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICB4LCB4X2xpbWl0 LCB1cGRhdGVkX3Jvdy0+eSwgaHBvcywgdnBvcywgTUNfSEJBUiwgMSwKKyAgICAgICAgICAgICAg ICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sCisgICAg ICAgICAgICAgICAgICAgICAgICAgZGVidWdfcCA/IGRlYnVnX2ZnIDogZXNzZW50aWFscy5jaF9m Z1tyb3dfcG9zaXRpb25dLAorICAgICAgICAgICAgICAgICAgICAgICAgIEhPUklaT05UQUxfUlVM RVIsIGRyYXdfcCwgTk9XSEVSRSwgTk9fQ0FDSEUpOworICAgICAgICAgICAgaWYgKEJVRkZFUlAg KHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjcm9zc2hh aXJzKSkKKyAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVs ZXIpKQorICAgICAgICAgICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAg ICAgICAgICAgIHx8ICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAg ICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkpCisgICAgICAgICAg ICAgICAgJiYgIWZpbGxfY29sdW1uX3RydW1wc19wCisgICAgICAgICAgICAgICAgJiYgeCA8IHRl eHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICYmIHZwb3MgIT0gdy0+Y3Vyc29yLnZwb3MK KyAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA+PSB4CisgICAgICAgICAgICAgICAgJiYg dGFyZ2V0X2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAgICAmJiBkcmF3X3ApCisgICAgICAg ICAgICAgIG1jX2VuZ2luZSAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRf Z2x5cGgsIFRFWFRfQVJFQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICB4LCB4X2xpbWl0LCB1 cGRhdGVkX3Jvdy0+eSwgaHBvcywgdnBvcywgTUNfQkFSLCAxLAorICAgICAgICAgICAgICAgICAg ICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwKKyAgICAgICAg ICAgICAgICAgICAgICAgICBkZWJ1Z19wID8gZGVidWdfZmcgOiBlc3NlbnRpYWxzLmNoX2ZnW3Jv d19wb3NpdGlvbl0sCisgICAgICAgICAgICAgICAgICAgICAgICAgVkVSVElDQUxfUlVMRVIsIGRy YXdfcCwgTk9XSEVSRSwgTk9fQ0FDSEUpOworICAgICAgICAgIH0KKworICAgICAgfQorICByZXR1 cm4gY2hhbmdlZF9wOworfQorCisvKiBVcGRhdGUgcm93IFZQT1MgaW4gd2luZG93IFcuICBWYWx1 ZSBpcyB0cnVlIGlmIGRpc3BsYXkgaGFzIGJlZW4gY2hhbmdlZC4gKi8KK3N0YXRpYyBib29sCitt Y191cGRhdGVfd2luZG93X2xpbmUgKHN0cnVjdCB3aW5kb3cgKncsIGludCB2cG9zLCBib29sICpt b3VzZV9mYWNlX292ZXJ3cml0dGVuX3AsCisgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBn bHlwaF9tYXRyaXggKmN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgIHN0cnVj dCBtY19lc3NlbnRpYWxzIGVzc2VudGlhbHMsIGJvb2wgZHJhd19wKQoreworICBzdHJ1Y3QgZ2x5 cGhfcm93ICpjdXJyZW50X3JvdyA9IE1BVFJJWF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB2cG9z KTsKKyAgc3RydWN0IGdseXBoX3JvdyAqZGVzaXJlZF9yb3cgPSBNQ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TZXR0aW5n IHRoaXMgZmxhZyB3aWxsIGVuc3VyZSB0aGUgdmVydGljYWwgYm9yZGVyLCBpZgorICAgICAgICAg ICAgIGFueSwgYmV0d2VlbiB0aGlzIHdpbmRvdyBhbmQgdGhlIG9uZSBvbiBpdHMgbGVmdCB3aWxs IGJlCisgICAgICAgICAgICAgcmVkcmF3bi4gIFRoaXMgaXMgbmVjZXNzYXJ5IGJlY2F1c2UgdXBk YXRpbmcgdGhlIGxlZnQKKyAgICAgICAgICAgICBtYXJnaW4gYXJlYSBjYW4gcG90ZW50aWFsbHkg ZHJhdyBvdmVyIHRoZSBib3JkZXIuICovCisgICAgICAgICAgY3VycmVudF9yb3ctPnJlZHJhd19m cmluZ2VfYml0bWFwc19wID0gMTsKKyAgICAgICAgfQorICAgICAgYm9vbCB1cGRhdGVkX3AgPSBt Y191cGRhdGVfdGV4dF9hcmVhICh3LCBkZXNpcmVkX3JvdywgdnBvcywgY3Vyc29yX21hdHJpeCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscywg ZHJhd19wKTsKKyAgICAgIC8qIFVwZGF0ZSB0aGUgZGlzcGxheSBvZiB0aGUgdGV4dCBhcmVhLiAq LworICAgICAgaWYgKHVwZGF0ZWRfcCkKKyAgICAgICAgeworICAgICAgICAgIGNoYW5nZWRfcCA9 IDE7CisgICAgICAgICAgaWYgKGN1cnJlbnRfcm93LT5tb3VzZV9mYWNlX3ApCisgICAgICAgICAg ICAqbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wID0gMTsKKyAgICAgICAgfQorICAgICAgLyogVXBk YXRlIGRpc3BsYXkgb2YgdGhlIHJpZ2h0IG1hcmdpbiBhcmVhLCBpZiB0aGVyZSBpcyBvbmUuICov CisgICAgICBpZiAoIWRlc2lyZWRfcm93LT5mdWxsX3dpZHRoX3AgJiYgdy0+cmlnaHRfbWFyZ2lu X2NvbHMgPiAwKQorICAgICAgICB7CisgICAgICAgICAgY2hhbmdlZF9wID0gMTsKKyAgICAgICAg ICB1cGRhdGVfbWFyZ2luYWxfYXJlYSAodywgZGVzaXJlZF9yb3csIFJJR0hUX01BUkdJTl9BUkVB LCB2cG9zKTsKKyAgICAgICAgfQorICAgICAgLyogRHJhdyB0cnVuY2F0aW9uIG1hcmtzIGV0Yy4g Ki8KKyAgICAgIGlmICghY3VycmVudF9yb3ctPmVuYWJsZWRfcAorICAgICAgICAgIHx8IGRlc2ly ZWRfcm93LT55ICE9IGN1cnJlbnRfcm93LT55CisgICAgICAgICAgfHwgZGVzaXJlZF9yb3ctPnZp c2libGVfaGVpZ2h0ICE9IGN1cnJlbnRfcm93LT52aXNpYmxlX2hlaWdodAorICAgICAgICAgIHx8 IGRlc2lyZWRfcm93LT5jdXJzb3JfaW5fZnJpbmdlX3AgIT0gY3VycmVudF9yb3ctPmN1cnNvcl9p bl9mcmluZ2VfcAorICAgICAgICAgIHx8IGRlc2lyZWRfcm93LT5vdmVybGF5X2Fycm93X2JpdG1h cCAhPSBjdXJyZW50X3Jvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAKKyAgICAgICAgICB8fCBjdXJy ZW50X3Jvdy0+cmVkcmF3X2ZyaW5nZV9iaXRtYXBzX3AKKyAgICAgICAgICB8fCBkZXNpcmVkX3Jv dy0+bW9kZV9saW5lX3AgIT0gY3VycmVudF9yb3ctPm1vZGVfbGluZV9wCisgICAgICAgICAgfHwg ZGVzaXJlZF9yb3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5lX3AgIT0gY3VycmVudF9yb3ctPmV4 YWN0X3dpbmRvd193aWR0aF9saW5lX3AKKyAgICAgICAgICB8fCAoTUFUUklYX1JPV19DT05USU5V QVRJT05fTElORV9QIChkZXNpcmVkX3JvdykKKyAgICAgICAgICAgICAgIT0gTUFUUklYX1JPV19D T05USU5VQVRJT05fTElORV9QIChjdXJyZW50X3JvdykpKQorICAgICAgICByaWYtPmFmdGVyX3Vw ZGF0ZV93aW5kb3dfbGluZV9ob29rICh3LCBkZXNpcmVkX3Jvdyk7CisgICAgfQorICAvKiBVcGRh dGUgY3VycmVudF9yb3cgZnJvbSBkZXNpcmVkX3Jvdy4gKi8KKyAgbWFrZV9jdXJyZW50ICh3LT5k ZXNpcmVkX21hdHJpeCwgdy0+Y3VycmVudF9tYXRyaXgsIHZwb3MpOworICByZXR1cm4gY2hhbmdl ZF9wOworfQorCit2b2lkCittY191cGRhdGVfd2luZG93X2VyYXNlIChzdHJ1Y3Qgd2luZG93ICp3 LCBzdHJ1Y3QgbWNfbWF0cml4IG9sZF9tYXRyaXgpCit7CisgIGJvb2wgZ29fb25lX3AgPSAob2xk X21hdHJpeC5jdXJzb3JzX3VzZWRbTUNfQ0FDSEVdID4gMAorICAgICAgICAgICAgICAgICAgIHx8 IG9sZF9tYXRyaXguY3Vyc29yc191c2VkW0NIX0NBQ0hFXSA+IDAKKyAgICAgICAgICAgICAgICAg ICB8fCBvbGRfbWF0cml4LmN1cnNvcnNfdXNlZFtGQ19DQUNIRV0gPiAwKTsKKyAgYm9vbCBnb190 d29fcCA9IChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICAmJiAoIU5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAg ICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zp c2libGUpKQorICAgICAgICAgICAgICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBtY19jb25mKSkpKTsKKyAgYm9vbCB1cGRhdGluZ19mcmFtZV9wID0gZmFs c2U7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBpZiAoWEZSQU1F ICh3LT5mcmFtZSkgIT0gZi0+bWNfdXBkYXRpbmdfZnJhbWUKKyAgICAgICYmIChnb19vbmVfcCB8 fCBnb190d29fcCkpCisgICAgeworICAgICAgdXBkYXRpbmdfZnJhbWVfcCA9IHRydWU7CisgICAg ICB1cGRhdGVfYmVnaW4gKGYpOworICAgIH0KKyAgaWYgKHctPnBoeXNfY3Vyc29yX29uX3AKKyAg ICAgICYmIGdvX3R3b19wKQorICAgIGVyYXNlX3BoeXNfY3Vyc29yICh3KTsKKyAgZm9yIChpbnQg dm50aCA9IDA7CisgICAgICAgZ29fb25lX3AKKyAgICAgICAmJiB2bnRoIDwgdy0+bWNfbWF0cml4 LnZwb3NfdXNlZDsKKyAgICAgICArK3ZudGgpCisgICAgeworICAgICAgZm9yIChlbnVtIG1jX2Nh Y2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOworICAgICAgICAgICBjYWNoZV90eXBlIDwg Tk9fQ0FDSEU7CisgICAgICAgICAgICsrY2FjaGVfdHlwZSkKKyAgICAgICAgZm9yIChpbnQgbnRo XzAgPSAwOworICAgICAgICAgICAgIG1jX3RyYXZlcnNlX2NhY2hlX3AgKG9sZF9tYXRyaXgsIGNh Y2hlX3R5cGUsIHZudGgsIG50aF8wKTsKKyAgICAgICAgICAgICArK250aF8wKQorICAgICAgICAg IHsKKyAgICAgICAgICAgIGJvb2wgc2FtZV9wID0gZmFsc2U7CisgICAgICAgICAgICBmb3IgKGlu dCB3X250aCA9IDA7IHdfbnRoIDwgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtj YWNoZV90eXBlXTsgKyt3X250aCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNh bWVfcCB8PSAob2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5n bHlwaC50eXBlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC50eXBlCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXzBdLmdseXBoLmJ5dGVwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLmJ5 dGVwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGguY2hhcnBvcworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVt3X250aF0uZ2x5cGguY2hhcnBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC51LnZhbAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgudS52YWwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0u Z2x5cGguZmFjZV9pZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGguZmFjZV9pZAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8wXS5nbHlwaC5wYWRkaW5nX3AKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhd LmdseXBoLnBhZGRpbmdfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5sZWZ0X2JveF9saW5l X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLmxlZnRfYm94X2xpbmVfcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8wXS5nbHlwaC5yaWdodF9ib3hfbGluZV9wCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3df bnRoXS5nbHlwaC5yaWdodF9ib3hfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnZv ZmZzZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnZvZmZzZXQKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMF0uZ2x5cGgucGl4ZWxfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBo LnBpeGVsX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnNsaWNlLmltZy54CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5pbWcueAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8w XS5nbHlwaC5zbGljZS5pbWcueQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGguc2xpY2Uu aW1nLnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGguc2xpY2UuaW1nLndpZHRoCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5pbWcud2lkdGgKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhf MF0uZ2x5cGguc2xpY2UuaW1nLmhlaWdodAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9 PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgu c2xpY2UuaW1nLmhlaWdodAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5zbGljZS5jbXAuZnJv bQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGguc2xpY2UuY21wLmZyb20KKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMF0ueAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0ueAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8wXS5meAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZngKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0u eQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0ueQorICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5meQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVt3X250aF0uZnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9s ZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uaHBvcworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVt3X250aF0uaHBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS52cG9zCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3dfbnRoXS52cG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLndkCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW3dfbnRoXS53ZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5oCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W3dfbnRoXS5oCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmN1cnNvcl90eXBlCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3dfbnRoXS5jdXJzb3JfdHlwZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5jdXJzb3Jfd2lkdGgK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmN1cnNvcl93aWR0aAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8w XS5mZy5yZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmZnLnJlZAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8wXS5mZy5ncmVlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZmcuZ3JlZW4KKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMF0uZmcuYmx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZmcuYmx1ZQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8wXS5iZy5yZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmJnLnJlZAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF8wXS5iZy5ncmVlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uYmcu Z3JlZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uYmcuYmx1ZQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250 aF0uYmcuYmx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5hY3RpdmVfcAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVt3X250aF0uYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGhfZmxhdm9yCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaF9mbGF2b3IKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZW5h YmxlZF9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5lbmFibGVkX3ApOworICAgICAgICAgICAg ICAgIC8qIEZvcmNlIHRoZSBmcmluZ2UgYml0bWFwcyB0byBhbHdheXMgYmUgcmVzZXQvcmVkcmF3 bi4gKi8KKyAgICAgICAgICAgICAgICBpZiAob2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8wXS5jdXJzb3JfdHlwZQorICAgICAgICAgICAgICAgICAgICAgID09IHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5jdXJzb3JfdHlw ZQorICAgICAgICAgICAgICAgICAgICAmJiAob2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8wXS5jdXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVAKKyAg ICAgICAgICAgICAgICAgICAgICAgIHx8IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMF0uY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUCkpCisg ICAgICAgICAgICAgICAgICBzYW1lX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBpZiAoc2Ft ZV9wKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvLyAgZnByaW50 ZiAoc3RkZXJyLCAiSElUICglcyk6ICB2cG9zICglZCkgfCBocG9zICglZCkgfCBjaGFyICglcylc biIsCisgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIChjYWNoZV90eXBl ID09IE1DX0NBQ0hFKQorICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAg ID8gIk1DIgorICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICA6IChjYWNo ZV90eXBlID09IENIX0NBQ0hFKQorICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAg ICAgICAgID8gIkNIIgorICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICA6 IChjYWNoZV90eXBlID09IEZDX0NBQ0hFKQorICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAg ICAgICAgICAgICAgID8gIkZDIgorICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAg ICAgICA6ICJOTyIsCisgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS52cG9zLAorICAg ICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uaHBvcywKKyAgICAgICAgICAgICAgICAgICAg Ly8gICAgICAgICAgICAgICAgICAgbWNfY2hhcl90b19zdHJpbmcgKHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC51LmNoKSk7CisgICAgICAgICAg ICAgICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRo XS5zYW1lX3AgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgICAgICAgIC8vICBmcHJpbnRmIChzdGRlcnIsICJNSVNTICglcyk6ICB2 cG9zICglZCkgfCBocG9zICglZCB2LiAlZCkgfCBjaGFyICglcyB2LiAlcykgfCBjYWNoZV91c2Vk ICglZCB2LiAlZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAg ICAgKGNhY2hlX3R5cGUgPT0gTUNfQ0FDSEUpCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAg ICAgICAgICAgICAgICAgICA/ICJNQyIKKyAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAg ICAgICAgICAgICA6IChjYWNoZV90eXBlID09IENIX0NBQ0hFKQorICAgICAgICAgICAgICAgICAg ICAgIC8vICAgICAgICAgICAgICAgICAgICAgPyAiQ0giCisgICAgICAgICAgICAgICAgICAgICAg Ly8gICAgICAgICAgICAgICAgICAgOiAoY2FjaGVfdHlwZSA9PSBGQ19DQUNIRSkKKyAgICAgICAg ICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgID8gIkZDIgorICAgICAgICAgICAg ICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIDogIk5PIiwKKyAgICAgICAgICAgICAgICAg ICAgICAvLyAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVt3X250aF0udnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAg ICAgICAgICAgICBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBd Lmhwb3MsCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgdy0+bWNf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmhwb3MsCisgICAgICAg ICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgbWNfY2hhcl90b19zdHJpbmcgKG9s ZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGgudS5jaCks CisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgbWNfY2hhcl90b19z dHJpbmcgKHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5n bHlwaC51LmNoKSwKKyAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXSwKKyAgICAgICAgICAg ICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZV91c2VkW2NhY2hlX3R5cGVdKTsKKyAgICAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uc2FtZV9wID0gZmFsc2U7Cisg ICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKCFz YW1lX3ApCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBgbWF0cml4X3Jvdycg aW4gYGRpc3BuZXcuY2AgY29udGFpbnMgdGhlIGZvbGxvd2luZyB0ZXN0cywKKyAgICAgICAgICAg ICAgICBlYXNzZXJ0IChtYXRyaXggJiYgbWF0cml4LT5yb3dzKTsKKyAgICAgICAgICAgICAgICBl YXNzZXJ0IChyb3cgPj0gMCAmJiByb3cgPCBtYXRyaXgtPm5yb3dzKTsgKi8KKyAgICAgICAgICAg ICAgICBib29sIGJhcmZfY3Jhc2hfb25lID0gKHctPmN1cnJlbnRfbWF0cml4ICYmIHctPmN1cnJl bnRfbWF0cml4LT5yb3dzKSA/IGZhbHNlIDogdHJ1ZTsKKyAgICAgICAgICAgICAgICBpZiAoYmFy Zl9jcmFzaF9vbmUpCisgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAg ICBib29sIGJhcmZfY3Jhc2hfdHdvID0gKHZudGggPj0gMCAmJiB2bnRoIDwgdy0+Y3VycmVudF9t YXRyaXgtPm5yb3dzKSA/IGZhbHNlIDogdHJ1ZTsKKyAgICAgICAgICAgICAgICBpZiAoYmFyZl9j cmFzaF90d28pCisgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICBz dHJ1Y3QgZ2x5cGhfcm93ICp2bnRoX3JvdyA9IE1BVFJJWF9ST1cgKHctPmN1cnJlbnRfbWF0cml4 LCB2bnRoKTsKKyAgICAgICAgICAgICAgICBpbnQgeF8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS54OworICAgICAgICAgICAgICAgIGludCBmeF8wID0g b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5meDsKKyAgICAg ICAgICAgICAgICBpbnQgeV8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS55OworICAgICAgICAgICAgICAgIGludCBmeV8wID0gb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5meTsKKyAgICAgICAgICAgICAgICBpbnQg aHBvc18wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5o cG9zOworICAgICAgICAgICAgICAgIGludCB2cG9zXzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLnZwb3M7CisgICAgICAgICAgICAgICAgaW50IHdkXzAg PSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLndkOworICAg ICAgICAgICAgICAgIGludCBoXzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXzBdLmg7CisgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJz b3JfdHlwZV8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8w XS5jdXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAgICBpbnQgY3Vyc29yX3dpZHRoXzAgPSBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmN1cnNvcl93aWR0aDsK KyAgICAgICAgICAgICAgICAvLyAgc3RydWN0IG1jX1JHQiBsc2xfZmdfMCA9IHsucmVkID0gb2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5mZy5yZWQsCisgICAg ICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5mZy5ncmVlbiwKKyAgICAg ICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZmcuYmx1ZX07CisgICAgICAg ICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfYmdfMCA9IHsucmVkID0gb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5iZy5yZWQsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmJnLmdyZWVuLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXzBdLmJnLmJsdWV9OworICAgICAgICAgICAgICAgIGJvb2wgYWN0aXZl X3BfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uYWN0 aXZlX3A7CisgICAgICAgICAgICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yXzAgPSBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoX2ZsYXZv cjsKKyAgICAgICAgICAgICAgICBib29sIGVuYWJsZWRfcF8wID0gb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5lbmFibGVkX3A7CisgICAgICAgICAgICAgICAg aWYgKHZwb3NfMCA9PSB2bnRoCisgICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvcl8w ID09IE1DX0dMWVBICisgICAgICAgICAgICAgICAgICAgICYmIGVuYWJsZWRfcF8wCisgICAgICAg ICAgICAgICAgICAgICYmIHZudGhfcm93LT5lbmFibGVkX3ApCisgICAgICAgICAgICAgICAgICB7 CisgICAgICAgICAgICAgICAgICAgIG1jX2VyYXNlX2N1cnNvciAodywgdy0+Y3VycmVudF9tYXRy aXgsIHZudGhfcm93LCB4XzAsIHlfMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBocG9zXzAsIHZwb3NfMCwgZ2x5cGhfZmxhdm9yXzAsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGVfMCwgd2RfMCk7CisgICAgICAgICAgICAgICAg ICAgIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZW5hYmxl ZF9wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIC0tb2xkX21hdHJpeC5jdXJzb3JzX3Vz ZWRbY2FjaGVfdHlwZV07CisgICAgICAgICAgICAgICAgICAgIC8qIElmIHdlIGluYWR2ZXJ0ZW50 bHkgZXJhc2VkIGFub3RoZXIgZmFrZSBjdXJzb3IgYXQgdGhlIHNhbWUKKyAgICAgICAgICAgICAg ICAgICAgSFBPUyB0aGF0IGlzIHN0aWxsIGVuYWJsZWRfcCBpbiB0aGUgYG9sZF9tYXRyaXhgLCB0 aGVuIHJlZHJhdyBpdC4gKi8KKyAgICAgICAgICAgICAgICAgICAgZm9yIChlbnVtIG1jX2NhY2hl X3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOworICAgICAgICAgICAgICAgICAgICAgICAgIGNh Y2hlX3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICArK2NhY2hlX3R5 cGUpCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgZm9y IChpbnQgbnRoXzEgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtY190cmF2ZXJz ZV9jYWNoZV9wIChvbGRfbWF0cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGhfMSk7CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICsrbnRoXzEpCisgICAgICAgICAgICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgeF8xID0gb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS54OworICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGludCBmeF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF8xXS5meDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgeV8xID0gb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS55OworICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGludCBmeV8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8xXS5meTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaHBv c18xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5ocG9z OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB2cG9zXzEgPSBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLnZwb3M7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgaW50IHdkXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXzFdLndkOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBoXzEgPSBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmg7CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZV8xID0g b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5jdXJzb3JfdHlw ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY3Vyc29yX3dpZHRoXzEgPSBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmN1cnNvcl93aWR0aDsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZ18xID0gey5y ZWQgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmZnLnJl ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IC5ncmVlbiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0u ZmcuZ3JlZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAuYmx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhfMV0uZmcuYmx1ZX07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIHN0cnVjdCBt Y19SR0IgbHNsX2JnXzEgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMV0uYmcucmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICAg ICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMV0uYmcuZ3JlZW4sCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmJnLmJsdWV9OworICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGJvb2wgYWN0aXZlX3BfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMV0uYWN0aXZlX3A7CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmdseXBoX2ZsYXZvcjsKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICBib29sIGVuYWJsZWRfcF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8xXS5lbmFibGVkX3A7CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgYm9vbCBnb19wXzEgPSAoaHBvc18wID09IGhwb3NfMQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIGVuYWJsZWRfcF8xKTsKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICBpZiAoIWdvX3BfMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGNvbnRpbnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgcmVtb3ZlX3BfMSA9 IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlk ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgdm50aF9yb3csIHhfMSwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnhfMSwgeV8xLCBmeV8xLCBocG9zXzEs IHZwb3NfMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgd2RfMSwgaF8xLCBjdXJzb3JfdHlwZV8xLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGhfMSwgbHNsX2ZnXzEsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2ZV9wXzEsIGds eXBoX2ZsYXZvcl8xLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICByZW1vdmVfcF8xKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAg IGVsc2UgaWYgKHZwb3NfMCA9PSB2bnRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBl bmFibGVkX3BfMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdm50aF9yb3ctPmVuYWJs ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGJvb2wg cmVtb3ZlX3BfMCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgbWNfZHJhd19lcmFzZV9o eWJyaWQgKHcsIHctPmN1cnJlbnRfbWF0cml4LCB2bnRoX3JvdywgeF8wLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmeF8wLCB5XzAsIGZ5XzAsIGhwb3NfMCwg dnBvc18wLCB3ZF8wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBoXzAsIGN1cnNvcl90eXBlXzAsIGN1cnNvcl93aWR0aF8wLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBsc2xfYmdfMCwgYWN0aXZlX3BfMCwgZ2x5cGhfZmxh dm9yXzAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92 ZV9wXzApOworICAgICAgICAgICAgICAgICAgICAgIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMF0uZW5hYmxlZF9wID0gZmFsc2U7CisgICAgICAgICAgICAgICAg ICAgICAgLS1vbGRfbWF0cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90eXBlXTsKKyAgICAgICAgICAg ICAgICAgICAgICAvKiBJZiB3ZSBpbmFkdmVydGVudGx5IGVyYXNlZCBhbm90aGVyIGZha2UgY3Vy c29yIGF0IHRoZSBzYW1lCisgICAgICAgICAgICAgICAgICAgICAgSFBPUyB0aGF0IGlzIHN0aWxs IGVuYWJsZWRfcCBpbiB0aGUgYG9sZF9tYXRyaXhgLCB0aGVuIHJlZHJhdyBpdC4gKi8KKyAgICAg ICAgICAgICAgICAgICAgICBmb3IgKGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlID0gTUNf Q0FDSEU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7 CisgICAgICAgICAgICAgICAgICAgICAgICAgICArK2NhY2hlX3R5cGUpCisgICAgICAgICAgICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IG50aF8yID0g MDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtY190cmF2ZXJzZV9jYWNoZV9wIChv bGRfbWF0cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGhfMik7CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgKytudGhfMikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgeF8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS54OworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgaW50IGZ4XzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XzJdLmZ4OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHlfMiA9IG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0ueTsKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGludCBmeV8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8yXS5meTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBo cG9zXzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmhw b3M7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgdnBvc18yID0gb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS52cG9zOworICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgaW50IHdkXzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXzJdLndkOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50 IGhfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uaDsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29y X3R5cGVfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0u Y3Vyc29yX3R5cGU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY3Vyc29yX3dp ZHRoXzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmN1 cnNvcl93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0Ig bHNsX2ZnXzIgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMl0uZmcucmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAuZ3JlZW4gPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzJdLmZnLmdyZWVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMl0uZmcuYmx1ZX07CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAvLyAgc3RydWN0IG1jX1JHQiBsc2xfYmdfMiA9IHsucmVkID0gb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5iZy5yZWQsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmJnLmdyZWVuLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAg ICAgLmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJd LmJnLmJsdWV9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBhY3RpdmVfcF8y ID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5hY3RpdmVf cDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2Zs YXZvcl8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5n bHlwaF9mbGF2b3I7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGVuYWJsZWRf cF8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5lbmFi bGVkX3A7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGdvX3BfMiA9IChocG9z XzAgPT0gaHBvc18yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBmeF8wIDw9IGZ4XzIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIGZ4XzAgKyB3ZF8wID4gZnhfMiArIHdkXzIKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIGVuYWJsZWRfcF8yKTsKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGlmICghZ29fcF8yKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgcmVtb3Zl X3BfMiA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWNfZHJhd19lcmFz ZV9oeWJyaWQgKHcsIHctPmN1cnJlbnRfbWF0cml4LCB2bnRoX3JvdywgeF8yLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ4XzIsIHlfMiwgZnlf MiwgaHBvc18yLCB2cG9zXzIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgd2RfMiwgaF8yLCBjdXJzb3JfdHlwZV8yLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aF8yLCBsc2xf ZmdfMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBhY3RpdmVfcF8yLCBnbHlwaF9mbGF2b3JfMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVfcF8yKTsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgIH0KKyAgaWYgKHVwZGF0 aW5nX2ZyYW1lX3ApCisgICAgdXBkYXRlX2VuZCAoZik7Cit9CisKK3ZvaWQKK21jX3VwZGF0ZV93 aW5kb3dfZHJ5cnVuIChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3AsIHN0cnVjdCBtY19l c3NlbnRpYWxzIGVzc2VudGlhbHMpCit7CisgIGlmICghQlVGRkVSUCAody0+Y29udGVudHMpKQor ICAgIHJldHVybjsKKworICBpZiAody0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtNQ19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lwaF9yb3cgKmVuZCA9IE1BVFJJWF9NT0RF X0xJTkVfUk9XIChkZXNpcmVkX21hdHJpeCk7CisKKyAgICAgIC8qIFRha2Ugbm90ZSBvZiB0aGUg aGVhZGVyIGxpbmUsIGlmIHRoZXJlIGlzIG9uZS4gIFdlIHdpbGwKKyAgICAgICAgIHVwZGF0ZSBp dCBiZWxvdywgYWZ0ZXIgdXBkYXRpbmcgYWxsIG9mIHRoZSB3aW5kb3cncyBsaW5lcy4gKi8KKyAg ICAgIGlmIChyb3ctPm1vZGVfbGluZV9wKQorICAgICAgICB7CisgICAgICAgICAgaGVhZGVyX2xp bmVfcm93ID0gcm93OworICAgICAgICAgICsrcm93OworICAgICAgICB9CisgICAgICAgIGVsc2UK KyAgICAgICAgICBoZWFkZXJfbGluZV9yb3cgPSBOVUxMOworCisgICAgICAvKiBVcGRhdGUgdGhl IG1vZGUgbGluZSwgaWYgbmVjZXNzYXJ5LiAqLworICAgICAgc3RydWN0IGdseXBoX3JvdyAqbW9k ZV9saW5lX3JvdyA9IE1BVFJJWF9NT0RFX0xJTkVfUk9XIChkZXNpcmVkX21hdHJpeCk7CisgICAg ICBpZiAobW9kZV9saW5lX3Jvdy0+bW9kZV9saW5lX3AgJiYgbW9kZV9saW5lX3Jvdy0+ZW5hYmxl ZF9wKQorICAgICAgICB7CisgICAgICAgICAgbW9kZV9saW5lX3Jvdy0+eSA9IHliICsgV0lORE9X X1NDUk9MTF9CQVJfQVJFQV9IRUlHSFQgKHcpOworICAgICAgICAgIHVwZGF0ZV93aW5kb3dfbGlu ZSAodywgTUFUUklYX1JPV19WUE9TIChtb2RlX2xpbmVfcm93LAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNpcmVkX21hdHJpeCksCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wKTsKKyAgICAg ICAgfQorCisgICAgICAvKiBGaW5kIGZpcnN0IGVuYWJsZWQgcm93LiAgT3B0aW1pemF0aW9ucyBp biByZWRpc3BsYXlfaW50ZXJuYWwKKyAgICAgICAgIG1heSBsZWFkIHRvIGFuIHVwZGF0ZSB3aXRo IG9ubHkgb25lIHJvdyBlbmFibGVkLiAgVGhlcmUgbWF5CisgICAgICAgICBiZSBhbHNvIGNvbXBs ZXRlbHkgZW1wdHkgbWF0cmljZXMuICovCisgICAgICB3aGlsZSAocm93IDwgZW5kICYmICFyb3ct PmVuYWJsZWRfcCkKKyAgICAgICAgKytyb3c7CisKKyAgICAgIC8qIFRyeSByZXVzaW5nIHBhcnQg b2YgdGhlIGRpc3BsYXkgYnkgY29weWluZy4gKi8KKyAgICAgIGlmIChyb3cgPCBlbmQgJiYgIXct PmRlc2lyZWRfbWF0cml4LT5ub19zY3JvbGxpbmdfcCkKKyAgICAgICAgeworICAgICAgICAgIGlu dCByYyA9IG1jX3Njcm9sbGluZ193aW5kb3cgKHcsIGhlYWRlcl9saW5lX3JvdyAhPSBOVUxMKTsK KyAgICAgICAgICBpZiAocmMgPCAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBB bGwgcm93cyB3ZXJlIGZvdW5kIHRvIGJlIGVxdWFsLiAqLworICAgICAgICAgICAgICBwYXVzZWRf cCA9IDA7CisgICAgICAgICAgICAgIGdvdG8gc2V0X2N1cnNvcjsKKyAgICAgICAgICAgIH0KKyAg ICAgICAgICAgIGVsc2UgaWYgKHJjID4gMCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgIC8qIFdlJ3ZlIHNjcm9sbGVkIHRoZSBkaXNwbGF5LiAqLworICAgICAgICAgICAgICAgIGZv cmNlX3AgPSAxOworICAgICAgICAgICAgICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAgICAgICAg IH0KKyAgICAgICAgfQorICAgICAgLyogUHJvY2VzcyB0aGUgY3Vyc29yIHJvdyBhdCB0aGUgb3V0 c2V0IGlmIGl0IGlzIHdpdGhpbiBgZ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f bWF0cml4ID0gdy0+ZGVzaXJlZF9tYXRyaXg7CisgICAgICAgICAgICAgIGlmICghZm9yY2VfcCAm JiArK25fdXBkYXRlZCAlIHByZWVtcHRfY291bnQgPT0gMCkKKyAgICAgICAgICAgICAgICBkZXRl Y3RfaW5wdXRfcGVuZGluZ19pZ25vcmVfc3F1ZWV6YWJsZXMgKCk7CisgICAgICAgICAgICAgIGNo YW5nZWRfcCB8PSBtY191cGRhdGVfd2luZG93X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292 ZXJ3cml0dGVuX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIGRyYXdfcCk7CisgICAgICAgICAgICAg IGlmIChNQVRSSVhfUk9XX0JPVFRPTV9ZIChyb3cpID49IHliKQorICAgICAgICAgICAgICAgIGZv ciAoaW50IGkgPSB2cG9zICsgMTsgaSA8IHctPmN1cnJlbnRfbWF0cml4LT5ucm93cyAtIDE7ICsr aSkKKyAgICAgICAgICAgICAgICAgIFNFVF9NQVRSSVhfUk9XX0VOQUJMRURfUCAody0+Y3VycmVu dF9tYXRyaXgsIGksIGZhbHNlKTsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9 CisgICAgICAgIH0KKyAgICAgIGN1cnNvcl9tYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAg ICAgIC8qIFVwZGF0ZSB0aGUgcmVzdCBvZiB0aGUgbGluZXMuICovCisgICAgICBmb3IgKDsgcm93 IDwgZW5kICYmIChmb3JjZV9wIHx8ICFpbnB1dF9wZW5kaW5nKTsgKytyb3cpCisgICAgICAgIC8q IHNjcm9sbGluZ193aW5kb3cgcmVzZXRzIHRoZSBlbmFibGVkX3AgZmxhZyBvZiB0aGUgcm93cyBp dCByZXVzZXMgZnJvbQorICAgICAgICBjdXJyZW50X21hdHJpeC4gKi8KKyAgICAgICAgaWYgKHJv dy0+ZW5hYmxlZF9wKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGludCB2cG9zID0gTUFUUklY X1JPV19WUE9TIChyb3csIHctPmRlc2lyZWRfbWF0cml4KTsKKyAgICAgICAgICAgIC8qIElmIHRo ZSBgY3Vyc29yX3Jvd2AgaXMgd2l0aGluIHRoZSBgZGVzaXJlZF9tYXRyaXhgLCB0aGVuIGl0IHdh cworICAgICAgICAgICAgcHJvY2Vzc2VkIGhlcmVpbmFib3ZlIGFuZCBzaG91bGQgYmUgc2tpcHBl ZCBhdCB0aGlzIHRpbWUuICovCisgICAgICAgICAgICBpZiAodnBvcyA9PSB3LT5jdXJzb3IudnBv cykKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgaW50IGk7CisgICAgICAgICAg ICAvKiBXZSdsbCBoYXZlIHRvIHBsYXkgYSBsaXR0bGUgYml0IHdpdGggd2hlbiB0bworICAgICAg ICAgICAgICAgZGV0ZWN0X2lucHV0X3BlbmRpbmcuICBJZiBpdCdzIGRvbmUgdG9vIG9mdGVuLAor ICAgICAgICAgICAgICAgc2Nyb2xsaW5nIGxhcmdlIHdpbmRvd3Mgd2l0aCByZXBlYXRlZCBzY3Jv bGwtdXAKKyAgICAgICAgICAgICAgIGNvbW1hbmRzIHdpbGwgdG9vIHF1aWNrbHkgcGF1c2UgcmVk aXNwbGF5LiAqLworICAgICAgICAgICAgaWYgKCFmb3JjZV9wICYmICsrbl91cGRhdGVkICUgcHJl ZW1wdF9jb3VudCA9PSAwKQorICAgICAgICAgICAgICBkZXRlY3RfaW5wdXRfcGVuZGluZ19pZ25v cmVfc3F1ZWV6YWJsZXMgKCk7CisgICAgICAgICAgICBjaGFuZ2VkX3AgfD0gbWNfdXBkYXRlX3dp bmRvd19saW5lICh3LCB2cG9zLCAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vy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gICAgICAgfQorICAgICAgLyogV2FzIGRpc3BsYXkgcHJlZW1wdGVkPyAqLwor ICAgICAgcGF1c2VkX3AgPSByb3cgPCBlbmQ7CisgICAgICBzZXRfY3Vyc29yOgorICAgICAgLyog SWYgd2UganVtcGVkIGhlcmUgZnJvbSBgc2V0X2N1cnNvcmAsIHRoZW4gc2V0IHRoZSBgY3Vyc29y X21hdHJpeGAuICovCisgICAgICBpZiAoY3Vyc29yX21hdHJpeCA9PSBOVUxMKQorICAgICAgICBj dXJzb3JfbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgICAgICAvKiBSZXNldCBgcm93YCB0 byAwIHNvIHRoYXQgZmFrZSBjdXJzb3JzIGNhbiBiZSBkcmF3biBvbiByb3dzIHByZWNlZGluZyB0 aGUKKyAgICAgIGZpcnN0IGByb3ctPmVuYWJsZWRfcGAuICBKdXN0IHByaW9yIHRvIHRoZSBjYWxs IHRvIGBzY3JvbGxpbmdfd2luZG93JyBhYm92ZSwKKyAgICAgIGByb3dgIHdhcyBhZHZhbmNlZCB0 byB0aGUgZmlyc3QgYHJvdy0+ZW5hYmxlZF9wYC4gKi8KKyAgICAgIGZvciAoc3RydWN0IGdseXBo X3JvdyAqZGVzaXJlZF9yb3cgPSBNQVRSSVhfUk9XICh3LT5kZXNpcmVkX21hdHJpeCwgMCk7Cisg ICAgICAgICAgIGRlc2lyZWRfcm93IDwgZW5kCisgICAgICAgICAgICYmIChmb3JjZV9wIHx8ICFp bnB1dF9wZW5kaW5nKQorICAgICAgICAgICAvKiBXMzIgRW1hY3MgY3Jhc2hlcyBvbiBzdGFydHVw IHdpdGhvdXQgYSBCVUZGRVJQIGNoZWNrLiAqLworICAgICAgICAgICAmJiBCVUZGRVJQICh3LT5j b250ZW50cykKKyAgICAgICAgICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIG1jX2NvbmYpKQorICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpOworICAgICAgICAgICArK2Rlc2ly ZWRfcm93KQorICAgICAgICB7CisgICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1Mg KGRlc2lyZWRfcm93LCB3LT5kZXNpcmVkX21hdHJpeCk7CisgICAgICAgICAgaWYgKGRlc2lyZWRf cm93LT5lbmFibGVkX3ApCisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICBzdHJ1Y3Qg Z2x5cGhfcm93ICpjdXJyZW50X3JvdyA9IE1BVFJJWF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB2 cG9zKTsKKyAgICAgICAgICBlbnVtIG1jX3Jvd19wb3NpdGlvbiByb3dfcG9zaXRpb24gPSBtY19y b3dfcG9zaXRpb24gKHcsIGN1cnJlbnRfcm93LCBjdXJyZW50X3JvdywgdnBvcyk7CisgICAgICAg ICAgaWYgKGN1cnJlbnRfcm93LT5lbmFibGVkX3ApCisgICAgICAgICAgICBtY19kcmF3X3JvdyAo dywgdy0+Y3VycmVudF9tYXRyaXgsIGN1cnJlbnRfcm93LCBjdXJyZW50X3Jvdy0+Z2x5cGhzW1RF WFRfQVJFQV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudF9yb3ctPngsIGN1cnJl bnRfcm93LT51c2VkW1RFWFRfQVJFQV0sIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAg Y3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBkcmF3X3AsCisgICAgICAg ICAgICAgICAgICAgICAgICAgU0VUX0NVUlNPUl9PTkUpOworICAgICAgICB9CisKKyAgICAgIG1j X3Jlc3RvcmVfZ2x5cGhfbWF0cml4IChzYXZlZF9kZXNpcmVkLCB3LT5kZ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RfbWF0cml4ID0gTlVMTDsKKworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBtY194ZnJlZV9jYWNoZV9tYXRyaXgg KHcsICZ3LT5tY19tYXRyaXgpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJfQog CiAgICAgICAvKiBOZXh0IHdpbmRvdyBvbiBzYW1lIGxldmVsLiAgKi8KQEAgLTMzODcsNiArNTIx NSwyNiBAQCBjaGVja19jdXJyZW50X21hdHJpeF9mbGFncyAoc3RydWN0IHdpbmRvdyAqdykKIHN0 YXRpYyBib29sCiB1cGRhdGVfd2luZG93IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3Ap CiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKyAgaWYgKHRyYWNlX3JlZGlzcGxheV9wKQorICAgIGZwcmludGYgKHN0ZGVyciwgInVwZGF0 ZV93aW5kb3cgKCVzKVxuIiwgbWNfd2luZG93ICh3KSk7CisKKyAgc3RydWN0IG1jX2Vzc2VudGlh bHMgZXNzZW50aWFsczsKKyAgbWNfc2V0X2Vzc2VudGlhbHMgKHcsICZlc3NlbnRpYWxzKTsKKwor ICBtY191cGRhdGVfd2luZG93X2RyeXJ1biAodywgZm9yY2VfcCwgZXNzZW50aWFscyk7CisKKyAg c3RydWN0IGdseXBoX21hdHJpeCAqY3Vyc29yX21hdHJpeCA9IE5VTEw7CisKKyAgYm9vbCBkcmF3 X3AgPSB0cnVlOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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b2YgYFJPVy0+dXNlZFtURVhUX0FSRUFdYC4gIFRoZXJlZm9yZSwg d2UgbXVzdCBub3cgcmVseQorICBleGNsdXNpdmVseSB1cG9uIGB3LT5jdXJyZW50X21hdHJpeCcg Zm9yIGN1cnNvciByb3cgYmFzZWQgZGVjaXNpb25zLiAqLworICBmb3IgKHN0cnVjdCBnbHlwaF9y b3cgKm1jX3JvdyA9IHJvdzsKKyAgICAgICBtY19yb3cgPCBlbmQgJiYgKGZvcmNlX3AgfHwgIWlu cHV0X3BlbmRpbmcpOworICAgICAgICsrbWNfcm93KQorICAgIHsKKyAgICAgIGludCB2cG9zID0g TUFUUklYX1JPV19WUE9TIChtY19yb3csIGRlc2lyZWRfbWF0cml4KTsKKyAgICAgIGlmIChtY19y b3ctPmVuYWJsZWRfcAorICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAg ICAgIHsKKyAgICAgICAgICBjdXJzb3JfbWF0cml4ID0gZGVzaXJlZF9tYXRyaXg7CisgICAgICAg ICAgaWYgKCFmb3JjZV9wICYmICsrbl91cGRhdGVkICUgcHJlZW1wdF9jb3VudCA9PSAwKQorICAg ICAgICAgICAgZGV0ZWN0X2lucHV0X3BlbmRpbmdfaWdub3JlX3NxdWVlemFibGVzICgpOworICAg ICAgICAgIGNoYW5nZWRfcCB8PSAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAg ICAgICAgICAgICAmJiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29u ZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIg KHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg fHwgISBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKSkpCisg ICAgICAgICAgICAgICAgICAgICAgID8gbWNfdXBkYXRlX3dpbmRvd19saW5lICh3LCB2cG9zLCAm bW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgZHJhd19wKQorICAg ICAgICAgICAgICAgICAgICAgICA6IHVwZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywgJm1vdXNl X2ZhY2Vfb3ZlcndyaXR0ZW5fcCk7CisgICAgICAgICAgaWYgKE1BVFJJWF9ST1dfQk9UVE9NX1kg KHJvdykgPj0geWIpCisgICAgICAgICAgICBmb3IgKGludCBpID0gdnBvcyArIDE7IGkgPCB3LT5j dXJyZW50X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAgICAgICAgICAgIFNFVF9NQVRSSVhf Uk9XX0VOQUJMRURfUCAody0+Y3VycmVudF9tYXRyaXgsIGksIGZhbHNlKTsKKyAgICAgICAgICBi cmVhazsKKyAgICAgICAgfQorICAgIH0KKworICBjdXJzb3JfbWF0cml4ID0gdy0+Y3VycmVudF9t YXRyaXg7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIC8qIFVwZGF0ZSB0 aGUgcmVzdCBvZiB0aGUgbGluZXMuICAqLwogICAgICAgZm9yICg7IHJvdyA8IGVuZCAmJiAoZm9y Y2VfcCB8fCAhaW5wdXRfcGVuZGluZyk7ICsrcm93KQogCS8qIHNjcm9sbGluZ193aW5kb3cgcmVz ZXRzIHRoZSBlbmFibGVkX3AgZmxhZyBvZiB0aGUgcm93cyBpdApAQCAtMzQ2Nyw2ICs1MzU2LDE5 IEBAIHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkKIAlpZiAo cm93LT5lbmFibGVkX3ApCiAJICB7CiAJICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChy b3csIGRlc2lyZWRfbWF0cml4KTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1V TFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgICAgIC8qIElmIHRoZSBgY3Vyc29yX3Jvd2AgaXMg d2l0aGluIHRoZSBgZGVzaXJlZF9tYXRyaXhgLCB0aGVuIGl0IHdhcworICAgICAgICAgIHByb2Nl c3NlZCBoZXJlaW5hYm92ZSBhbmQgc2hvdWxkIGJlIHNraXBwZWQgYXQgdGhpcyB0aW1lLiAqLwor ICAgICAgICAgIGlmICh2cG9zID09IHctPmN1cnNvci52cG9zKQorICAgICAgICAgIGNvbnRpbnVl OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAgIGludCBpOwogCiAJICAgIC8q IFdlJ2xsIGhhdmUgdG8gcGxheSBhIGxpdHRsZSBiaXQgd2l0aCB3aGVuIHRvCkBAIC0zNDc1LDgg KzUzNzcsMjEgQEAgdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9w KQogCSAgICAgICBjb21tYW5kcyB3aWxsIHRvbyBxdWlja2x5IHBhdXNlIHJlZGlzcGxheS4gICov CiAJICAgIGlmICghZm9yY2VfcCAmJiArK25fdXBkYXRlZCAlIHByZWVtcHRfY291bnQgPT0gMCkK IAkgICAgICBkZXRlY3RfaW5wdXRfcGVuZGluZ19pZ25vcmVfc3F1ZWV6YWJsZXMgKCk7Ci0JICAg IGNoYW5nZWRfcCB8PSB1cGRhdGVfd2luZG93X2xpbmUgKHcsIHZwb3MsCi0JCQkJCSAgICAgJm1v dXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCk7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisv KiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgICAgICBjaGFuZ2VkX3AgfD0gKEJVRkZFUlAg KHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKCFOSUxQIChCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICEgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBmY192aXNpYmxlKSkpKQorICAgICAgICAgICAgICAgICAgICAgICA/IG1jX3Vw ZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRy aXgsIGVzc2VudGlhbHMsIGRyYXdfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgOiB1cGRhdGVf d2luZG93X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3cml0dGVuX3ApOworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKwogCiAJICAgIC8qIE1hcmsgYWxsIHJvd3MgYmVsb3cgdGhl IGxhc3QgdmlzaWJsZSBvbmUgaW4gdGhlIGN1cnJlbnQKIAkgICAgICAgbWF0cml4IGFzIGludmFs aWQuICBUaGlzIGlzIG5lY2Vzc2FyeSBiZWNhdXNlIG9mCkBAIC0zNDk3LDYgKzU0MT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bnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAgIHx8ICFO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAg ICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpOwor ICAgICAgICsrZGVzaXJlZF9yb3cpCisgICAgeworICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9X X1ZQT1MgKGRlc2lyZWRfcm93LCBkZXNpcmVkX21hdHJpeCk7CisgICAgICBpZiAoZGVzaXJlZF9y b3ctPmVuYWJsZWRfcCkKKyAgICAgICAgY29udGludWU7CisgICAgICBzdHJ1Y3QgZ2x5cGhfcm93 ICpjdXJyZW50X3JvdyA9IE1BVFJJWF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB2cG9zKTsKKyAg ICAgIGVudW0gbWNfcm93X3Bvc2l0aW9uIHJvd19wb3NpdGlvbiA9IG1jX3Jvd19wb3NpdGlvbiAo dywgY3VycmVudF9yb3csIGN1cnJlbnRfcm93LCB2cG9zKTsKKyAgICAgIGlmIChjdXJyZW50X3Jv dy0+ZW5hYmxlZF9wKQorICAgICAgICBtY19kcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgs IGN1cnJlbnRfcm93LCBjdXJyZW50X3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAg ICAgICAgICAgICBjdXJyZW50X3Jvdy0+eCwgY3VycmVudF9yb3ctPnVzZWRbVEVYVF9BUkVBXSwg dnBvcywKKyAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIHJv d19wb3NpdGlvbiwgZHJhd19wLCBTRVRfQ1VSU09SX1RXTyk7CisgICAgfQorCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKwor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yZWQgcm93cyBpcyAwLCBz byBhZnRlciByb3cgYXNzaWdubWVudAorb3ZlcmxhcHBlZF9wIGluIGN1cnJlbnQgcm93cyBpcyAw LiAqLworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworICBm b3IgKGludCBpID0gMDsgaSA8IHctPmN1cnJlbnRfbWF0cml4LT5ucm93czsgKytpKQorICAgIHsK KyAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdyA9IHctPmN1cnJlbnRfbWF0cml4LT5yb3dzICsg aTsKKyAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgICAgIGJyZWFrOworICAgICAgICBl bHNlIGlmIChyb3ctPm1vZGVfbGluZV9wKQorICAgICAgICAgIGNvbnRpbnVlOworICAgICAgaWYg KHJvdy0+b3ZlcmxhcHBlZF9wKQorICAgICAgICB7CisgICAgICAgICAgZm9yIChlbnVtIGdseXBo X3Jvd19hcmVhIGFyZWEgPSBMRUZUX01BUkdJTl9BUkVBOyBhcmVhIDwgTEFTVF9BUkVBOyArK2Fy ZWEpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIG91dHB1dF9jdXJzb3JfdG8gKHcsIGks IDAsIHJvdy0+eSwgYXJlYSA9PSBURVhUX0FSRUEgPyByb3ctPnggOiAwKTsKKyAgICAgICAgICAg ICAgaWYgKCFtY19yZWRyYXdfcm93ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgcm93LCBhcmVhLCBy b3ctPngsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT51c2VkW2Fy ZWFdLCB0cnVlLCBEUkFXX05PUk1BTF9URVhULAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIFVQREFURV9XSU5ET1dfX1JFRFJBV19PVkVSTEFQUEVEX1JPV1MpCisgICAgICAgICAg ICAgICAgICAmJiByb3ctPnVzZWRbYXJlYV0pCisgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgRlJBTUVfUklGIChmKS0+d3JpdGVfZ2x5cGhzICh3LCByb3csIHJvdy0+Z2x5cGhz W2FyZWFdLCBhcmVhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICByb3ctPnVzZWRbYXJlYV0pOworICAgICAgICAgICAgICAgICAgRlJBTUVfUklGIChmKS0+ Y2xlYXJfZW5kX29mX2xpbmUgKHcsIHJvdywgYXJlYSwgLTEpOworICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgIH0KKyAgICAgICAgICByb3ctPm92ZXJsYXBwZWRfcCA9IDA7CisgICAgICAg IH0KKyAgICAgIGlmIChNQVRSSVhfUk9XX0JPVFRPTV9ZIChyb3cpID49IHliKQorICAgICAgICBi cmVhazsKKyAgICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgICAgICByZWRy YXdfb3ZlcmxhcHBpbmdfcm93cyAodywgeWIpOwogCSAgICB9CiAjZW5kaWYKQEAgLTM1MzEsMTAg KzU1MjMsMjEgQEAgdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9w KQogICAgICAgc3RyY3B5ICh3LT5jdXJyZW50X21hdHJpeC0+bWV0aG9kLCB3LT5kZXNpcmVkX21h dHJpeC0+bWV0aG9kKTsKICNlbmRpZgogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyog TVVMVElQTEUtQ1VSU09SUyAqLworCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCisgIGlmIChC VUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICBtY191cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcs IDApOworICAgIGVsc2UKICAgICAgIHVwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgMCk7CiAjZW5k aWYKIAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgLyogRW5kIHRoZSB1cGRh dGUgb2Ygd2luZG93IFcuICBEb24ndCBzZXQgdGhlIGN1cnNvciBpZiB3ZQogICAgICAgICAgcGF1 c2VkIHVwZGF0aW5nIHRoZSBkaXNwbGF5IGJlY2F1c2UgaW4gdGhpcyBjYXNlLAogICAgICAgICAg c2V0X3dpbmRvd19jdXJzb3JfYWZ0ZXJfdXBkYXRlIGhhc24ndCBiZWVuIGNhbGxlZCwgYW5kCmRp ZmYgLS1naXQgYS9zcmMvZnJhbWUuaCBiL3NyYy9mcmFtZS5oCmluZGV4IGVjOGY2MTQuLmVlYWY3 MWUgMTAwNjQ0Ci0tLSBhL3NyYy9mcmFtZS5oCisrKyBiL3NyYy9mcmFtZS5oCkBAIC0yMDUsNiAr MjA1LDE2IEBAIHN0cnVjdCBmcmFtZQogICBMaXNwX09iamVjdCB0b29sX2Jhcl9pdGVtczsKICAg LyogdG9vbF9iYXJfaXRlbXMgc2hvdWxkIGJlIHRoZSBsYXN0IExpc3BfT2JqZWN0IG1lbWJlci4g ICovCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKyAgLyogTm9uLW5pbCB3aGVuIHRoZSBmcmFtZSBpcyBpbiB0aGUgcHJvY2VzcyBvZiBiZWlu ZyB1cGRhdGVkLiAqLworICBzdHJ1Y3QgZnJhbWUgKm1jX3VwZGF0aW5nX2ZyYW1lOworCisvKiAq KioqKioqKioqKioqKioqKioq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bXSA9eworICAweDMsIDB4MywgMHgzLCAweDYzLCAweDMz LCAweDFiLCAweGZmLCAweGZmLCAweDFiLCAweDMzLCAweDYzLCAweDMsIDB4MywgMHgzfTsKKwor LyogMjYKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHh4eHh4eHgi CisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4ueHguLngiCisg ICAgICAieC4uLnh4LngiCisgICAgICAieC4uLi54eHgiCisgICAgICAieC54eHh4eHgiCisgICAg ICAieC54eHh4eHgiCisgICAgICAieC4uLi54eHgiCisgICAgICAieC4uLnh4LngiCisgICAgICAi eC4ueHguLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieHh4 eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19ob2xsb3dfcmVjdGFuZ2xlX3Jp Z2h0X2Fycm93X2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweDk5LCAweDhkLCAweDg3 LCAweGJmLAorICAweGJmLCAweDg3LCAweDhkLCAweDk5LCAweDgxLCAweDgxLCAweGZmfTsKKwor LyogMjcKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHh4eHh4eHgi CisgICAgICAieC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieC54eC4ueHgiCisg ICAgICAieC4ueHgueHgiCisgICAgICAieC4uLnh4eHgiCisgICAgICAieHh4eHh4eHgiCisgICAg ICAieHh4eHh4eHgiCisgICAgICAieC4uLnh4eHgiCisgICAgICAieC4ueHgueHgiCisgICAgICAi eC54eC4ueHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieHh4 eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19yZXZlcnNlZF9ob2xsb3dfcmVj dGFuZ2xlX3JpZ2h0X2Fycm93X2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweGIxLCAw eDk5LCAweDhkLCAweGZmLAorICAweGZmLCAweDhkLCAweDk5LCAweGIxLCAweDgxLCAweDgxLCAw eGZmfTsKKworLyogMjgKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAi eHh4eHh4eHgiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4u Li4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4u LngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngi CisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisg ICAgICAieHh4eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19ob2xsb3dfcmVj dGFuZ2xlX2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAw eDgxLAorICAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweGZmfTsKKworLyog MjkKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC4uLi4uLi4iCisg ICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAg ICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAi eC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4u Li4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4u Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY192ZXJ0aWNhbF9iYXJfYml0c1tdID17 CisgIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsCisgIDB4ODAsIDB4 ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODB9OworCisvKiAzMAorICAgICgrLWZyaW5n ZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIK KyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAg ICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAg ICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIu Li4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIpCisqLworc3RhdGlj IHVuc2lnbmVkIHNob3J0IG1jX3JldmVyc2VkX3ZlcnRpY2FsX2Jhcl9iaXRzW10gPXsKKyAgMHgz LCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4Mywg MHgzLCAweDN9OworCisvKiAzMQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAg ICAgICJ4eC4uLi4uLiIKKyAgICAgICJ4eC4uLi4uLiIKKyAgICAgICIgeHguLi4uLiIKKyAgICAg ICIueHguLi4uLiIKKyAgICAgICIuLnh4Li4uLiIKKyAgICAgICIuLnh4Li4uLiIKKyAgICAgICIu Li54eC4uLiIKKyAgICAgICIuLi54eC4uLiIKKyAgICAgICIuLi4ueHguLiIKKyAgICAgICIuLi4u eHguLiIKKyAgICAgICIuLi4uLnh4LiIKKyAgICAgICIuLi4uLnh4LiIKKyAgICAgICIuLi4uLi54 eCIKKyAgICAgICIuLi4uLi54eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX2JhY2tz bGFzaF9iaXRzW10gPXsKKyAgMHhjMCwgMHhjMCwgMHhlMCwgMHg2MCwgMHgzMCwgMHgzMCwgMHgx OCwgMHgxOCwgMHhjLCAweGMsIDB4NiwgMHg2LCAweDMsIDB4M307CisKKy8qIDMyCisgICAgKCst ZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Li4uLi4uIgorICAgICAgInh4Li4u Li4uIgorICAgICAgInh4eC4uLi4uIgorICAgICAgInh4eC4uLi4uIgorICAgICAgIngueHguLi4u IgorICAgICAgIngueHguLi4uIgorICAgICAgInguLnh4Li4uIgorICAgICAgInguLnh4Li4uIgor ICAgICAgInguLi54eC4uIgorICAgICAgInguLi54eC4uIgorICAgICAgInguLi4ueHguIgorICAg ICAgInguLi4ueHguIgorICAgICAgInguLi4uLnh4IgorICAgICAgInguLi4uLnh4IikKKyovCitz dGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdmVydGljYWxfYmFyX2JhY2tzbGFzaF9iaXRzW10gPXsK KyAgMHhjMCwgMHhjMCwgMHhlMCwgMHhlMCwgMHhiMCwgMHhiMCwgMHg5OCwKKyAgMHg5OCwgMHg4 YywgMHg4YywgMHg4NiwgMHg4NiwgMHg4MywgMHg4M307CisKKy8qIDMzCisgICAgKCstZnJpbmdl LWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi54eHh4eHguIgorICAgICAgInh4eHgueC4uIgor ICAgICAgInh4eHgueC4uIgorICAgICAgInh4eHgueC4uIgorICAgICAgIi54eHgueC4uIgorICAg ICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAg Ii4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIikKKyovCitzdGF0 aWMgdW5zaWduZWQgc2hvcnQgbWNfcGlsY3Jvd19iaXRzW10gPXsKKyAgMHg3ZSwgMHhmNCwgMHhm NCwgMHhmNCwgMHg3NCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNH07CisKKy8q IDM0CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4ueHh4eC4uIgor ICAgICAgIi54eHh4eHguIgorICAgICAgInguLnh4Li54IgorICAgICAgInguLnh4Li54IgorICAg ICAgInh4eHh4eHh4IgorICAgICAgInh4Li4uLnh4IgorICAgICAgInh4eC4ueHh4IgorICAgICAg Ii54eHh4eHguIgorICAgICAgIi4ueHh4eC4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQg bWNfc21pbGV5X2ZhY2VfYml0c1tdID17CisgIDB4M2MsIDB4N2UsIDB4OTksIDB4OTksIDB4ZmYs IDB4YzMsIDB4ZTcsIDB4N2UsIDB4M2N9OworCisvKiAzNQorICAgICgrLWZyaW5nZS1oZWxwZXIt aGV4YWRlY2ltYWwKKyAgICAgICIuLnguLi4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIu Li4ueC4uLiIKKyAgICAgICIuLi4uLnguLiIKKyAgICAgICIuLi4ueC4uLiIKKyAgICAgICIuLi54 Li4uLiIKKyAgICAgICIuLnguLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3Np bmdsZV9hbmdsZV9yaWdodF9iaXRzW10gPXsKKyAgMHgyMCwgMHgxMCwgMHg4LCAweDQsIDB4OCwg MHgxMCwgMHgyMH07CisKKy8qIDM2CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAor ICAgICAgIi4uLi4ueC4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4uLnguLi4uIgorICAg ICAgIi4ueC4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAg Ii4uLi4ueC4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX2xl ZnRfYml0c1tdID17CisgIDB4NCwgMHg4LCAweDEwLCAweDIwLCAweDEwLCAweDgsIDB4NH07CisK Ky8qIDM3CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Lnh4Li4u IgorICAgICAgIi54eC54eC4uIgorICAgICAgIi4ueHgueHguIgorICAgICAgIi4uLnh4Lnh4Igor ICAgICAgIi4ueHgueHguIgorICAgICAgIi54eC54eC4uIgorICAgICAgInh4Lnh4Li4uIikKKyov CitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xlX3JpZ2h0X2JpdHNbXSA9ewor ICAweGQ4LCAweDZjLCAweDM2LCAweDFiLCAweDM2LCAweDZjLCAweGQ4fTsKKworLyogMzgKKyAg ICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4ueHgueHgiCisgICAgICAi Li54eC54eC4iCisgICAgICAiLnh4Lnh4Li4iCisgICAgICAieHgueHguLi4iCisgICAgICAiLnh4 Lnh4Li4iCisgICAgICAiLi54eC54eC4iCisgICAgICAiLi4ueHgueHgiKQorKi8KK3N0YXRpYyB1 bnNpZ25lZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfbGVmdF9iaXRzW10gPXsKKyAgMHgxYiwgMHgz NiwgMHg2YywgMHhkOCwgMHg2YywgMHgzNiwgMHgxYn07CisKKy8qIDM5CisgICAgKCstZnJpbmdl LWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIngueC54Li4uIgorICAgICAgIi54LngueC4uIgor ICAgICAgIi4ueC54LnguIgorICAgICAgIi4uLngueC54IgorICAgICAgIi4ueC54LnguIgorICAg ICAgIi54LngueC4uIgorICAgICAgIngueC54Li4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hv cnQgbWNfdHJpcGxlX2FuZ2xlX3JpZ2h0X2JpdHNbXSA9eworICAweGE4LCAweDU0LCAweDJhLCAw eDE1LCAweDJhLCAweDU0LCAweGE4fTsKKworLyogNDAKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhl eGFkZWNpbWFsCisgICAgICAiLi4ueC54LngiCisgICAgICAiLi54LngueC4iCisgICAgICAiLngu eC54Li4iCisgICAgICAieC54LnguLi4iCisgICAgICAiLngueC54Li4iCisgICAgICAiLi54Lngu eC4iCisgICAgICAiLi4ueC54LngiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190cmlw bGVfYW5nbGVfbGVmdF9iaXRzW10gPXsKKyAgMHgxNSwgMHgyYSwgMHg1NCwgMHhhOCwgMHg1NCwg MHgyYSwgMHgxNX07CisKKy8qIDQxCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAor ICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAg ICAgIi4uLi4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAg Ii54Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4u Li4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIikKKyovCitzdGF0aWMg dW5zaWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDAwLCAweDAw LCAweDAwLCAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDgyLCAweDAwLCAweDAwLCAweDAwLCAw eDAwfTsKKworLyogNDIKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAi Li4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4u Li4uLi4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54Lngu Li4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4i CisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25l ZCBzaG9ydCBtY19zaW5nbGVfYW5nbGVfZG93bl9iaXRzW10gPXsKKyAgMHgwMCwgMHgwMCwgMHgw MCwgMHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHgxMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMH07 CisKKy8qIDQzCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4u Li4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLnguLi4u IgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgor ICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAg ICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIikKKyovCitz dGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDAw LCAweDAwLCAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDgyLCAw eDAwLCAweDAwLCAweDAwfTsKKworLyogNDQKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNp bWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4i CisgICAgICAieC4uLi4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisg ICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAg ICAiLi4ueC4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAi Li4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfZG93 bl9iaXRzW10gPXsKKyAgMHgwMCwgMHgwMCwgMHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHg5Miwg MHg0NCwgMHgyOCwgMHgxMCwgMHgwMCwgMHgwMCwgMHgwMH07CisKKy8qIDQ1CisgICAgKCstZnJp bmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLnguLi4u IgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgor ICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAg ICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAgICAg Ii4uLi4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdHJpcGxlX2FuZ2xlX3Vw X2JpdHNbXSA9eworICAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAw eDkyLCAweDI4LCAweDQ0LCAweDgyLCAweDAwfTsKKworLyogNDYKKyAgICAoKy1mcmluZ2UtaGVs cGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAieC4uLi4ueC4iCisgICAg ICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAi LnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLngu Li54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLi4u Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19xdWFkcnVwbGVfYW5nbGVfZG93bl9i aXRzW10gPXsKKyAgMHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHg5 MiwgMHg0NCwgMHgyOCwgMHgxMCwgMHgwMH07CisKKy8qIDQ3CisgICAgKCstZnJpbmdlLWhlbHBl ci1oZXhhZGVjaW1hbAorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAg Ii54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54 Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4u eC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4u IgorICAgICAgInguLi4uLnguIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcXVhZHJ1 cGxlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAw eDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDgyfTsKKworLyogNDgK KyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC4uLi4ueC4iCisgICAg ICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAi LnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLngu Li54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54 Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLi4ueC4uLi4iKQorKi8KK3N0YXRpYyB1bnNp Z25lZCBzaG9ydCBtY190cmlwbGVfYW5nbGVfZG93bl9iaXRzW10gPXsKKyAgMHg4MiwgMHg0NCwg MHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHg5MiwgMH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uCisgICAgIElmIHBhcnRpYWwsIGxvb2t1cCBwYXJ0aWFsIGJpdG1hcCBpbiBkZWZhdWx0 IHZhbHVlIGlmIG5vdCBmb3VuZCBoZXJlLgorICAgICBJZiBub3QgcGFydGlhbCwgb3Igbm8gcGFy dGlhbCBzcGVjIGlzIHByZXNlbnQsIHVzZSBub24tcGFydGlhbCBiaXRtYXAuICovCitpbnQKK21j X2dldF9mcmluZ2VfYml0bWFwIChzdHJ1Y3Qgd2luZG93ICp3LCBMaXNwX09iamVjdCBiaXRtYXAs IGludCByaWdodF9wLCBpbnQgcGFydGlhbF9wKQoreworICBMaXNwX09iamVjdCBjbWFwLCBibTEg PSBRbmlsLCBibTIgPSBRbmlsLCBibTsKKyAgRU1BQ1NfSU5UIGxuMSA9IDAsIGxuMiA9IDA7Cisg IGludCBpeDEgPSByaWdodF9wOworICBpbnQgaXgyID0gaXgxICsgKHBhcnRpYWxfcCA/IDIgOiAw KTsKKyAgaWYgKChjbWFwID0gQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmcmluZ2VfaW5k aWNhdG9yX2FsaXN0KSksICFOSUxQIChjbWFwKSkKKyAgICB7CisgICAgICBibTEgPSBtY19hc3Nx IChiaXRtYXAsIGNtYXApOworICAgICAgaWYgKENPTlNQIChibTEpKQorICB7CisgICAgaWYgKChi bTEgPSBYQ0RSIChibTEpKSwgTklMUCAoYm0xKSkKKyAgICAgIHJldHVybiBNQ19OT19GUklOR0Vf QklUTUFQOworICAgIGlmIChDT05TUCAoYm0xKSkKKyAgICAgIHsKKyAgICAgICAgbG4xID0gWEZJ WE5VTSAoRmxlbmd0aCAoYm0xKSk7CisgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgICAgICAg eworICAgICAgICAgICAgaWYgKGxuMSA+IGl4MikKKyAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMSk7CisgICAgICAgICAgICAgICAgaWYgKCFFUSAo Ym0sIFF0KSkKKyAgICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICAgIH0K KyAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAg ICBpZiAobG4xID4gaXgxKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGJt ID0gbWNfbnRoIChpeDEsIGJtMSk7CisgICAgICAgICAgICAgICAgICBpZiAoIUVRIChibSwgUXQp KQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5kOworICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgIH0KKyAgICAgIH0KKyAgICBlbHNlIGlmICgoYm0gPSBibTEsICFFUSAoYm0sIFF0 KSkpCisgICAgICBnb3RvIGZvdW5kOworICB9CisgICAgfQorICBpZiAoIUVRIChjbWFwLCBCVkFS ICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkKKyAgICAgICYmICFO SUxQIChCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkpCisg ICAgeworICAgICAgYm0yID0gbWNfYXNzcSAoYml0bWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRz LCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSk7CisgICAgICBpZiAoQ09OU1AgKGJtMikpCisgICAg ICAgIHsKKyAgICAgICAgICBpZiAoKGJtMiA9IFhDRFIgKGJtMikpLCAhTklMUCAoYm0yKSkKKyAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKENPTlNQIChibTIpKQorICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgIGxuMiA9IFhGSVhOVU0gKEZsZW5ndGggKGJtMikpOwor ICAgICAgICAgICAgICAgICAgaWYgKHBhcnRpYWxfcCkKKyAgICAgICAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgICAgICAgIGlmIChsbjIgPiBpeDIpCisgICAgICAgICAgICAgICAgICAg ICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMik7 CisgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0K KyAgICAgICAgfQorICAgIH0KKyAgaWYgKGxuMSA+IGl4MSkKKyAgICB7CisgICAgICBibSA9IG1j X250aCAoaXgxLCBibTEpOworICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAgZ290byBm b3VuZDsKKyAgICB9CisgIGlmIChsbjIgPiBpeDEpCisgICAgeworICAgICAgYm0gPSBtY19udGgg KGl4MSwgYm0yKTsKKyAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgIGdvdG8gZm91bmQ7 CisgICAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICB9CisgICAgZWxzZSBpZiAo KGJtID0gYm0yLCBOSUxQIChibSkpKQorICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7 CisgIGZvdW5kOgorICByZXR1cm4gbG9va3VwX2ZyaW5nZV9iaXRtYXAgKGJtKTsKK30KKworc3Rh dGljIGludAorbWNfZ2V0X2xvZ2ljYWxfY3Vyc29yX2JpdG1hcCAoc3RydWN0IHdpbmRvdyAqdywg TGlzcF9PYmplY3QgY3Vyc29yKQoreworICBMaXNwX09iamVjdCBjbWFwLCBibSA9IFFuaWw7Cisg IGlmICgoY21hcCA9IEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZnJpbmdlX2N1cnNvcl9h bGlzdCkpLCAhTklMUCAoY21hcCkpCisgICAgeworICAgICAgYm0gPSBtY19hc3NxIChjdXJzb3Is IGNtYXApOworICAgICAgaWYgKENPTlNQIChibSkpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAo KGJtID0gWENEUiAoYm0pKSwgTklMUCAoYm0pKQorICAgICAgICAgICAgcmV0dXJuIE1DX05PX0ZS SU5HRV9CSVRNQVA7CisgICAgICAgICAgcmV0dXJuIGxvb2t1cF9mcmluZ2VfYml0bWFwIChibSk7 CisgICAgICAgIH0KKyAgICB9CisgIGlmIChFUSAoY21hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0 cywgZnJpbmdlX2N1cnNvcl9hbGlzdCkpKQorICAgIHJldHVybiBNQ19OT19GUklOR0VfQklUTUFQ OworICBibSA9IG1jX2Fzc3EgKGN1cnNvciwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdl X2N1cnNvcl9hbGlzdCkpOworICBpZiAoIUNPTlNQIChibSkgfHwgKChibSA9IFhDRFIgKGJtKSks IE5JTFAgKGJtKSkpCisgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgIHJldHVybiBs b29rdXBfZnJpbmdlX2JpdG1hcCAoYm0pOworfQorCitzdGF0aWMgaW50CittY19nZXRfbG9naWNh bF9mcmluZ2VfYml0bWFwIChzdHJ1Y3Qgd2luZG93ICp3LCBMaXNwX09iamVjdCBiaXRtYXAsIGlu dCByaWdodF9wLCBpbnQgcGFydGlhbF9wKQoreworICBMaXNwX09iamVjdCBjbWFwLCBibTEgPSBR bmlsLCBibTIgPSBRbmlsLCBibTsKKyAgRU1BQ1NfSU5UIGxuMSA9IDAsIGxuMiA9IDA7CisgIGlu dCBpeDEgPSByaWdodF9wOworICBpbnQgaXgyID0gaXgxICsgKHBhcnRpYWxfcCA/IDIgOiAwKTsK KyAgLyogTG9va3VwIGluIGJ1ZmZlci1sb2NhbCBmcmluZ2UtaW5kaWNhdG9yLWFsaXN0IGJlZm9y ZSBnbG9iYWwgYWxpc3QuCisgICAgIEVsZW1lbnRzIGFyZToKKyAgQklUTUFQICAgIC0tIHVzZSBm b3IgYWxsCisgIChMIFIpICAgIC0tIHVzZSBmb3IgbGVmdCByaWdodCAod2hldGhlciBwYXJ0aWFs IG9yIG5vdCkKKyAgKEwgUiBQTCBQUikgIC0tIHVzZSBmb3IgbGVmdCByaWdodCBwYXJ0aWFsLWxl ZnQgcGFydGlhbC1yaWdodAorICBJZiBhbnkgdmFsdWUgaW4gbG9jYWwgYmluZGluZyBpcyBub3Qg cHJlc2VudCBvciB0LCB1c2UgZ2xvYmFsIHZhbHVlLgorICAgICBJZiBwYXJ0aWFsLCBsb29rdXAg cGFydGlhbCBiaXRtYXAgaW4gZGVmYXVsdCB2YWx1ZSBpZiBub3QgZm91bmQgaGVyZS4KKyAgICAg SWYgbm90IHBhcnRpYWwsIG9yIG5vIHBhcnRpYWwgc3BlYyBpcyBwcmVzZW50LCB1c2Ugbm9uLXBh cnRpYWwgYml0bWFwLiAgKi8KKyAgaWYgKChjbWFwID0gQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSksICFOSUxQIChjbWFwKSkKKyAgICB7CisgICAg ICBibTEgPSBtY19hc3NxIChiaXRtYXAsIGNtYXApOworICAgICAgaWYgKENPTlNQIChibTEpKQor ICAgICAgICB7CisgICAgICAgICAgaWYgKChibTEgPSBYQ0RSIChibTEpKSwgTklMUCAoYm0xKSkK KyAgICAgICAgICAgIHJldHVybiBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgIGlmIChD T05TUCAoYm0xKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbG4xID0gWEZJWE5VTSAo Rmxlbmd0aCAoYm0xKSk7CisgICAgICAgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgaWYgKGxuMSA+IGl4MikKKyAgICAgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMSk7Cisg ICAgICAgICAgICAgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAgICAgICAgICAg ICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAg ICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgICBpZiAobG4xID4gaXgxKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgICAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMSk7CisgICAgICAgICAgICAg ICAgICAgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICBn b3RvIGZvdW5kOworICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKChibSA9IGJtMSwgIUVRIChibSwg UXQpKSkKKyAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgfQorICAgIH0KKyAgaWYg KCFFUSAoY21hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRvcl9hbGlz dCkpCisgICAgICAmJiAhTklMUCAoQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGlj YXRvcl9hbGlzdCkpKQorICAgIHsKKyAgICAgIGJtMiA9IG1jX2Fzc3EgKGJpdG1hcCwgQlZBUiAo JmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpOworICAgICAgaWYgKENP TlNQIChibTIpKQorICAgICAgICB7CisgICAgICAgICAgaWYgKChibTIgPSBYQ0RSIChibTIpKSwg IU5JTFAgKGJtMikpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmIChDT05TUCAoYm0y KSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBsbjIgPSBYRklYTlVNIChG bGVuZ3RoIChibTIpKTsKKyAgICAgICAgICAgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgICAg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBpZiAobG4yID4gaXgyKQorICAg ICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICBibSA9IG1j X250aCAoaXgyLCBibTIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIUVRIChibSwg UXQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAg ICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIGlmIChsbjEgPiBpeDEpCisgICAg eworICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0xKTsKKyAgICAgIGlmICghRVEgKGJtLCBRdCkp CisgICAgICAgIGdvdG8gZm91bmQ7CisgICAgfQorICBpZiAobG4yID4gaXgxKQorICAgIHsKKyAg ICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMik7CisgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAg ICAgICBnb3RvIGZvdW5kOworICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAg fQorICAgIGVsc2UgaWYgKChibSA9IGJtMiwgTklMUCAoYm0pKSkKKyAgICAgIHJldHVybiBNQ19O T19GUklOR0VfQklUTUFQOworICBmb3VuZDoKKyAgcmV0dXJuIGxvb2t1cF9mcmluZ2VfYml0bWFw IChibSk7Cit9CisKKy8qIFJlY2FsY3VsYXRlIHRoZSBiaXRtYXBzIHRvIHNob3cgaW4gdGhlIGZy aW5nZXMgb2Ygd2luZG93IFcuCisgICBPbmx5IG1hcmsgcm93cyB3aXRoIG1v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isgICAgIHJvdy0+aW5kaWNhdGVfZW9iX3AgYW5kIGJvdF9yb3dfZW5kc19h dF96dl9wLiAgKi8KKyAgaW50IHRvcF9yb3dfZW5kc19hdF96dl9wIE1DX0lGX0xJTlQgKD0gMCks IGJvdF9yb3dfZW5kc19hdF96dl9wIE1DX0lGX0xJTlQgKD0gMCk7CisgIGlmICh3LT5wc2V1ZG9f d2luZG93X3ApCisgICAgcmV0dXJuIDA7CisgIGlmICghTUlOSV9XSU5ET1dfUCAodykKKyAgICAg ICYmIChpbmQgPSBCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGluZGljYXRlX2J1ZmZlcl9i b3VuZGFyaWVzKSwgIU5JTFAgKGluZCkpKQorICAgIHsKKyAgICAgIGlmIChFUSAoaW5kLCBRbGVm dCkgfHwgRVEgKGluZCwgUXJpZ2h0KSkKKyAgICAgICAgYm91bmRhcnlfdG9wID0gYm91bmRhcnlf Ym90ID0gYXJyb3dfdG9wID0gYXJyb3dfYm90ID0gaW5kOworICAgICAgICBlbHNlIGlmIChDT05T UCAoaW5kKQorICAgICAgICAgICAgICAgICAmJiBDT05TUCAoWENBUiAoaW5kKSkpCisgICAgICAg IHsKKyAgICAgICAgICBMaXNwX09iamVjdCBwb3M7CisgICAgICAgICAgaWYgKHBvcyA9IG1jX2Fz c3EgKFF0LCBpbmQpLCAhTklMUCAocG9zKSkKKyAgICAgICAgICAgIGJvdW5kYXJ5X3RvcCA9IGJv dW5kYXJ5X2JvdCA9IGFycm93X3RvcCA9IGFycm93X2JvdCA9IFhDRFIgKHBvcyk7CisgICAgICAg ICAgaWYgKHBvcyA9IG1jX2Fzc3EgKFF0b3AsIGluZCksICFOSUxQIChwb3MpKQorICAgICAgICAg ICAgYm91bmRhcnlfdG9wID0gWENEUiAocG9zKTsKKyAgICAgICAgICBpZiAocG9zID0gbWNfYXNz cSAoUWJvdHRvbSwgaW5kKSwgIU5JTFAgKHBvcykpCisgICAgICAgICAgICBib3VuZGFyeV9ib3Qg PSBYQ0RSIChwb3MpOworICAgICAgICAgIGlmIChwb3MgPSBtY19hc3NxIChRdXAsIGluZCksICFO SUxQIChwb3MpKQorICAgICAgICAgICAgYXJyb3dfdG9wID0gWENEUiAocG9zKTsKKyAgICAgICAg ICBpZiAocG9zID0gbWNfYXNzcSAoUWRvd24sIGluZCksICFOSUxQIChwb3MpKQorICAgICAgICAg ICAgYXJyb3dfYm90ID0gWENEUiAocG9zKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAg ICAgICAgLyogQW55dGhpbmcgZWxzZSBtZWFucyBib3VuZGFyeSBvbiBsZWZ0IGFuZCBubyBhcnJv d3MuICAqLworICAgICAgICAgIGJvdW5kYXJ5X3RvcCA9IGJvdW5kYXJ5X2JvdCA9IFFsZWZ0Owor ICAgIH0KKyAgdG9wX2luZF9ybiA9IGJvdF9pbmRfcm4gPSAtMTsKKyAgaWYgKCFOSUxQIChpbmQp KQorICAgIHsKKyAgICAgIGZvciAoeSA9IHctPnZzY3JvbGwsIHJuID0gMDsKKyAgICAgICAgICAg eSA8IHliICYmIHJuIDwgbnJvd3M7CisgICAgICAgICAgIHkgKz0gcm93LT5oZWlnaHQsICsrcm4p CisgICAgICAgIHsKKyAgICAgICAgICByb3cgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHJu OworICAgICAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgICAgICAgICByb3cgPSB3LT5j dXJyZW50X21hdHJpeC0+cm93cyArIHJuOworICAgICAgICAgIHJvdy0+aW5kaWNhdGVfYm9iX3Ag PSByb3ctPmluZGljYXRlX3RvcF9saW5lX3AgPSAwOworICAgICAgICAgIHJvdy0+aW5kaWNhdGVf ZW9iX3AgPSByb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3AgPSAwOworICAgICAgICAgIGlmICgh cm93LT5tb2RlX2xpbmVfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKHRvcF9p bmRfcm4gPCAwICYmIHJvdy0+dmlzaWJsZV9oZWlnaHQgPiAwKQorICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgIGlmIChNQVRSSVhfUk9XX1NUQVJUX0NIQVJQT1MgKHJvdykgPD0g QlVGX0JFR1YgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSkKKyAgICAgICAgICAgICAgICAgICAgICAm JiAhTUFUUklYX1JPV19QQVJUSUFMTFlfVklTSUJMRV9BVF9UT1BfUCAodywgcm93KSkKKyAgICAg ICAgICAgICAgICAgICAgcm93LT5pbmRpY2F0ZV9ib2JfcCA9ICFOSUxQIChib3VuZGFyeV90b3Ap OworICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgcm93LT5p bmRpY2F0ZV90b3BfbGluZV9wID0gIU5JTFAgKGFycm93X3RvcCk7CisgICAgICAgICAgICAgICAg ICB0b3BfaW5kX3JuID0gcm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBpZiAo Ym90X2luZF9ybiA8IDApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgaWYg KE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgPj0gQlVGX1pWIChYQlVGRkVSICh3LT5jb250 ZW50cykpCisgICAgICAgICAgICAgICAgICAgICAgJiYgIU1BVFJJWF9ST1dfUEFSVElBTExZX1ZJ U0lCTEVfQVRfQk9UVE9NX1AgKHcsIHJvdykpCisgICAgICAgICAgICAgICAgICAgIHJvdy0+aW5k aWNhdGVfZW9iX3AgPSAhTklMUCAoYm91bmRhcnlfYm90KSwgYm90X2luZF9ybiA9IHJuOworICAg ICAgICAgICAgICAgICAgICBlbHNlIGlmICh5ICsgcm93LT5oZWlnaHQgPj0geWIpCisgICAgICAg ICAgICAgICAgICAgICAgcm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wID0gIU5JTFAgKGFycm93 X2JvdCksIGJvdF9pbmRfcm4gPSBybjsKKyAgICAgICAg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IC8qIEV4dGVuZCB0 b3AtYWxpZ25lZCB0b3AgaW5kaWNhdG9yIChvciBib3R0b20tYWxpZ25lZCBib3R0b20KKyAgICAg aW5kaWNhdG9yKSB0byBhZGphY2VudCByb3dzIGlmIGl0IGRvZXNuJ3QgZml0IGluIG9uZSByb3cu ICAqLworICB0b3BfaW5kX21pbl95ID0gYm90X2luZF9tYXhfeSA9IC0xOworICBpZiAodG9wX2lu ZF9ybiA+PSAwKQorICAgIHsKKyAgICAgIGludCBibiA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7Cisg ICAgICByb3cgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHRvcF9pbmRfcm47CisgICAgICBp ZiAoIXJvdy0+ZW5hYmxlZF9wKQorICAgICAgICByb3cgPSB3LT5jdXJyZW50X21hdHJpeC0+cm93 cyArIHRvcF9pbmRfcm47CisgICAgICB0b3Bfcm93X2VuZHNfYXRfenZfcCA9IHJvdy0+ZW5kc19h dF96dl9wOworICAgICAgaWYgKHJvdy0+aW5kaWNhdGVfYm9iX3ApCisgICAgICAgIHsKKyAgICAg ICAgICBpZiAoRVEgKGJvdW5kYXJ5X3RvcCwgUWxlZnQpKQorICAgICAgICAgICAgYm4gPSAoKHJv dy0+aW5kaWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5kYXJ5X2JvdCwgUWxlZnQpKQorICAgICAgICAg ICAgICAgICAgPyBNQ19MRUZUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20sIHJvdy0+ZW5kc19hdF96 dl9wKQorICAgICAgICAgICAgICAgICAgOiBNQ19MRUZUX0ZSSU5HRSAoMiwgUXRvcCwgMCkpOwor ICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBibiA9ICgocm93LT5pbmRpY2F0ZV9lb2Jf cCAmJiBFUSAoYm91bmRhcnlfYm90LCBRcmlnaHQpKQorICAgICAgICAgICAgICAgICAgICA/IE1D X1JJR0hUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKQorICAgICAg ICAgICAgICAgICAgICA6IE1DX1JJR0hUX0ZSSU5HRSAoMiwgUXRvcCwgMCkpOworICAgICAgICB9 CisgICAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcCkKKyAgICAgICAgICB7 CisgICAgICAgICAgICBpZiAoRVEgKGFycm93X3RvcCwgUWxlZnQpKQorICAgICAgICAgICAgICBi biA9IE1DX0xFRlRfRlJJTkdFICg2LCBRdXAsIDApOworICAgICAgICAgICAgICBlbHNlCisgICAg ICAgICAgICAgICAgYm4gPSBNQ19SSUdIVF9GUklOR0UgKDYsIFF1cCwgMCk7CisgICAgICAgICAg fQorICAgICAgaWYgKGJuICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgIHsKKyAgICAg ICAgICBzdHJ1Y3QgZnJpbmdlX2JpdG1hcCAqZmIgPSBnZXRfZnJpbmdlX2JpdG1hcF9kYXRhIChi bik7CisgICAgICAgICAgaWYgKGZiLT5hbGlnbiA9PSBBTElHTl9CSVRNQVBfVE9QICYmIGZiLT5w ZXJpb2QgPT0gMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3Jv dyAqcm93MTsKKyAgICAgICAgICAgICAgaW50IHRvcF9pbmRfbWF4X3k7CisgICAgICAgICAgICAg IHRvcF9pbmRfbWluX3kgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgICAgICAg ICAgICAgdG9wX2luZF9tYXhfeSA9IHRvcF9pbmRfbWluX3kgKyBmYi0+aGVpZ2h0OworICAgICAg ICAgICAgICBpZiAodG9wX2luZF9tYXhfeSA+IHliKQorICAgICAgICAgICAgICAgIHRvcF9pbmRf bWF4X3kgPSB5YjsKKyAgICAgICAgICAgICAgZm9yICh5ID0gcm93LT55ICsgcm93LT5oZWlnaHQs IHJuID0gdG9wX2luZF9ybiArIDE7CisgICAgICAgICAgICAgICAgICAgeSA8IHRvcF9pbmRfbWF4 X3kgJiYgcm4gPCBucm93czsKKyAgICAgICAgICAgICAgICAgICB5ICs9IHJvdzEtPmhlaWdodCwg cm4rKykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBpZiAoYm90X2luZF9y biA+PSAwICYmIHJuID49IGJvdF9pbmRfcm4pCisgICAgICAgICAgICAgICAgICAgIGJyZWFrOwor ICAgICAgICAgICAgICAgICAgcm93MSA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgcm47Cisg ICAgICAgICAgICAgICAgICBpZiAoIXJvdzEtPmVuYWJsZWRfcCkKKyAgICAgICAgICAgICAgICAg ICAgcm93MSA9IHctPmN1cnJlbnRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgICAgICAg ICByb3cxLT5pbmRpY2F0ZV9ib2JfcCA9IHJvdy0+aW5kaWNhdGVfYm9iX3A7CisgICAgICAgICAg ICAgICAgICByb3cxLT5pbmRpY2F0ZV90b3BfbGluZV9wID0gcm93LT5pbmRpY2F0ZV90b3BfbGlu ZV9wOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0K KyAgaWYgKGJvdF9pbmRfcm4gPj0gMCkKKyAgICB7CisgICAgICBpbnQgYm4gPSBNQ19OT19GUklO R0VfQklUTUFQOworICAgICAgcm93ID0gdy0+ZGVzaXJlZF9tYXRyaXgtPnJvd3MgKyBib3RfaW5k X3JuOworICAgICAgaWYgKCFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgcm93ID0gdy0+Y3VycmVu dF9tYXRyaXgtPnJvd3MgKyBib3RfaW5kX3JuOworICAgICAgYm90X3Jvd19lbmRzX2F0X3p2X3Ag PSByb3ctPmVuZHNfYXRfenZfcDsKKyAgICAgIGlmIChyb3ctPmluZGljYXRlX2VvYl9wKQorICAg ICAgICB7CisgICAgICAgICAgaWYgKEVRIChib3VuZGFyeV9ib3QsIFFsZWZ0KSkKKyAgICAgICAg ICAgIGJuID0gTUNfTEVGVF9GUklOR0UgKDMsIFFib3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKTsK KyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgYm4gPSBNQ19SSUdIVF9GUklOR0UgKDMs IFFib3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlm IChyb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3ApCisgICAgICAgICAgeworICAgICAgICAgICAg aWYgKEVRIChhcnJvd19ib3QsIFFsZWZ0KSkKKyAgICAgICAgICAgICAgYm4gPSBNQ19MRUZUX0ZS SU5HRSAoNywgUWRvd24sIDApOworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAg Ym4gPSBNQ19SSUdIVF9GUklOR0UgKDcsIFFkb3duLCAwKTsKKyAgICAgICAgICB9CisgICAgICBp ZiAoYm4gIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVj dCBmcmluZ2VfYml0bWFwICpmYiA9IGdldF9mcmluZ2VfYml0bWFwX2RhdGEgKGJuKTsKKyAgICAg ICAgICBpZiAoZmItPmFsaWduID09IEFMSUdOX0JJVE1BUF9CT1RUT00gJiYgZmItPnBlcmlvZCA9 PSAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cx OworICAgICAgICAgICAgICBpbnQgYm90X2luZF9taW5feTsKKyAgICAgICAgICAgICAgYm90X2lu ZF9tYXhfeSA9IHJvdy0+eSArIHJvdy0+dmlzaWJsZV9oZWlnaHQ7CisgICAgICAgICAgICAgIGJv dF9pbmRfbWluX3kgPSBib3RfaW5kX21heF95IC0gZmItPmhlaWdodDsKKyAgICAgICAgICAgICAg aWYgKGJvdF9pbmRfbWluX3kgPCBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KSkKKyAgICAg ICAgICAgICAgICBib3RfaW5kX21pbl95ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7 CisgICAgICAgICAgICAgIGZvciAoeSA9IHJvdy0+eSwgcm4gPSBib3RfaW5kX3JuIC0gMTsKKyAg ICAgICAgICAgICAgICAgICB5ID49IGJvdF9pbmRfbWluX3kgJiYgcm4gPj0gMDsKKyAgICAgICAg ICAgICAgICAgICB5IC09IHJvdzEtPmhlaWdodCwgcm4tLSkKKyAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgICBpZiAodG9wX2luZF9ybiA+PSAwICYmIHJuIDw9IHRvcF9pbmRfcm4p CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgcm93MSA9IHct PmRlc2lyZWRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgICAgICAgICBpZiAoIXJvdzEt PmVuYWJsZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgcm93MSA9IHctPmN1cnJlbnRfbWF0cml4 LT5yb3dzICsgcm47CisgICAgICAgICAgICAgICAgICByb3cxLT5pbmRpY2F0ZV9lb2JfcCA9IHJv dy0+aW5kaWNhdGVfZW9iX3A7CisgICAgICAgICAgICAgICAgICByb3cxLT5pbmRpY2F0ZV9ib3R0 b21fbGluZV9wID0gcm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wOworICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgTGlzcF9PYmplY3QgYnVmID0g dy0+Y29udGVudHM7CisgIENIRUNLX0JVRkZFUiAoYnVmKTsKKyAgYm9vbCBhdXRvX2hzY3JvbGxf bW9kZV9wID0gRVEgKEZidWZmZXJfbG9jYWxfdmFsdWUgKFFhdXRvX2hzY3JvbGxfbW9kZSwgYnVm KSwgUWN1cnJlbnRfbGluZSk7CisgIC8qIEVYQU1QTEU6ICAoc2Nyb2xsLWxlZnQgNSkgKi8KKyAg Ym9vbCBoc2NsX2FsbF90ZW1wX3AgPSAody0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAm JiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBhbmQgZG8g bm90aGluZy4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzBfcCA9ICh3LT5zdXNwZW5kX2F1dG9f aHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2Rl X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhzY3JvbGwpOworICAvKiBF WEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBzb21ldGhpbmcgZWxzZSBiZXNpZGVzIGhvcml6b250 YWxseSBzY3JvbGxpbmcgdGhlCisgICAgICAgICAgICAgICBjdXJyZW50IGxpbmUgZGlmZmVyZW50 bHkuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgaXMgX25vdF8gaG9yaXpvbnRhbGx5IHNj cm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMV9wID0gKCF3LT5z dXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9f aHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xs ID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhzY3Jv bGwpOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCAuLi4KKyAgICAgICAgICAgICAgIEN1 cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICov CisgIGJvb2wgaHNjbF9hbGxfcGVybV8yX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPT0gMAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAg KHNjcm9sbC1sZWZ0IDUpOyBhbmQsIHRoZW4gcHJlc3MgdGhlIGxlZnQgYXJyb3cga2V5IG9uZSB0 aW1lLgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIF9pc18gaG9yaXpvbnRhbGx5IHNjcm9s bGVkIGRpZmZlcmVudGx5LiovCisgIGJvb2wgaHNjbF90ZW1wX3AgPSAoIXctPnN1c3BlbmRfYXV0 b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAor ICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAg ICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gMCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwg YW5kIGRvIHNvbWV0aGluZyB0aGF0IGNhdXNlcyB0aGUgY3VycmVudCBsaW5lIHRvIGJlCisgICAg ICAgICAgICAgICBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuCisgICAgICAgICAg ICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHku ICovCisgIGJvb2wgaHNjbF9wZXJtX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAg ICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAg ICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWlu X2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgIT0g dy0+aHNjcm9sbCk7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBm b3IgKHkgPSB3LT52c2Nyb2xsLCBybiA9IDA7CisgICAgICAgeSA8IHliICYmIHJuIDwgbnJvd3M7 CisgICAgICAgeSArPSByb3ctPmhlaWdodCwgcm4rKykKKyAgICB7CisgIGludCBsZWZ0LCByaWdo dDsKKyAgdW5zaWduZWQgbGVmdF9mYWNlX2lkLCByaWdodF9mYWNlX2lkOworICBpbnQgbGVmdF9v ZmZzZXQsIHJpZ2h0X29mZnNldDsKKyAgYm9vbCBwZXJpb2RpY19wOworICByb3cgPSB3LT5kZXNp cmVkX21hdHJpeC0+cm93cyArIHJuOworICBjdXIgPSB3LT5jdXJyZW50X21hdHJpeC0+cm93cyAr IHJuOworICBpbnQgdm50aF9kbSA9IE1BVFJJWF9ST1dfVlBPUyAody0+ZGVzaXJlZF9tYXRyaXgt PnJvd3MgKyBybiwgdy0+ZGVzaXJlZF9tYXRyaXgpOworICBpbnQgdm50aF9jbSA9IE1BVFJJWF9S T1dfVlBPUyAody0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AgICAgICAgICBpbnQg ZnJpbmdlX2JpdG1hcCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgICAgZW51bSBmYWNl X2lkIG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICAgICAoIWFjdGl2ZV9wCisgICAg ICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaW5hY3Rp dmVfd2luZG93cykpKQorICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50 ZXJuICgiKy1vdmVybGF5LWFycm93LWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpCisgICAg ICAgICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAo dywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LXByZS16di1mYWNlIiksIHRydWUpCisgICAg ICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICBtY19sZWZ0X2ZyaW5nZV9mYWNl X2lkID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gb3ZlcmxheV9hcnJvd19mYWNlX2lkCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAg ICBpZiAody0+aHNjcm9sbCAhPSAwKQorICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dl dF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ciKSwgZmFsc2UsIHRy dWUpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNf Z2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistb3ZlcmxheS1hcnJvdyIpLCB0cnVlLCB0 cnVlKTsKKyAgICAgICAgICBtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0g TUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IGZyaW5nZV9iaXRtYXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBN Q19OT19GUklOR0VfQklUTUFQOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKCh2cG9zID09 IHZudGhfZG0gfHwgdnBvcyA9PSB2bnRoX2NtKQorICAgICAgICAgICAgICAgICAmJiBnbHlwaF9m bGF2b3IgPT0gTUNfT1ZFUkxBWV9BUlJPV19CSVRNQVAKKyAgICAgICAgICAgICAgICAgJiYgKGhz Y2xfYWxsX3RlbXBfcAorICAgICAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8wX3AK KyAgICAgICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxsX3Blcm1fMV9wCisgICAgICAgICAgICAg ICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzJfcAorICAgICAgICAgICAgICAgICAgICAgfHwgaHNj bF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgICAgIHx8IGhzY2xfcGVybV9wKQorICAgICAgICAg ICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgeworICAgICAgICAgICAgaW50IGZyaW5n ZV9iaXRtYXAgPSBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgICAgZW51bSBmYWNlX2lk IG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICAgICAgICghYWN0aXZlX3AKKyAgICAg ICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2luYWN0 aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwg aW50ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtaW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwgdHJ1 ZSkKKyAgICAgICAgICAgICAgOiAoYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgPyBsb29rdXBf bmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtcHJlLXp2LWZh Y2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAg ICBtY19sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdF X0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBvdmVybGF5 X2Fycm93X2ZhY2VfaWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBE RUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgICBpZiAoaHNjbF9hbGxfcGVybV8wX3ApCisgICAg ICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJu ICgiKy1oc2NsLXBlcm0iKSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAgICAgICAgZWxzZSBpZiAo aHNjbF9hbGxfcGVybV8xX3ApCisgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dl dF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCB0cnVlLCBmYWxzZSk7 CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF9hbGxfcGVybV8yX3ApCisgICAgICAgICAg ICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAo IistaHNjbC1wZXJtIiksIGZhbHNlLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYg KGhzY2xfcGVybV9wKQorICAgICAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0 X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIHRydWUsIHRydWUpOwor ICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX2FsbF90ZW1wX3ApCisgICAgICAgICAg ICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRl cm4gKCIrLWhzY2wtdGVtcCIpLCBmYWxzZSwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAg IGVsc2UgaWYgKGhzY2xfdGVtcF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgZnJpbmdlX2Jp dG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtdGVtcCIpLCB0 cnVlLCBmYWxzZSk7CisgICAgICAgICAgICBtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29y X3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICB9CisgICAgICAgICAg ZWxzZSBpZiAoKHZwb3MgPT0gdm50aF9kbSB8fCB2cG9zID09IHZudGhfY20pCisgICAgICAgICAg ICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9B UlJPVworICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVS U0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAg IHx8IGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFCisgICAgICAgICAgICAgICAg ICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisg ICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVS VElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9m bGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlw aF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAg ICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSCkKKyAgICAg ICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAg ICBMaXNwX09iamVjdCBiaXRtYXBfZmxhdm9yID0gKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1df UkVDVEFOR0xFX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBRbWNfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVS U0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX2hvbGxvd19yZWN0YW5nbGVfcmln aHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGds eXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xlCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfVkVS VElDQUxfQkFSX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNF RF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX3ZlcnRpY2FsX2Jhcl9yaWdodF9hcnJvdwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9y ID09IE1DX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFS KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19yZXZl cnNlZF92ZXJ0aWNhbF9iYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXJf YmFja3NsYXNoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFFu aWw7CisgICAgICAgICAgICAgIG1jX3JpZ2h0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUg PT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IGxvb2t1cF9mcmluZ2VfYml0bWFwIChiaXRtYXBfZmxhdm9yKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsK KyAgICAgICAgICAgICAgbWNfcmlnaHRfZnJpbmdlX2ZhY2VfaWQgPQorICAgICAgICAgICAgICAg IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAg ICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYKKyAgICAgICAgICAgICAgICAgJiYgKGdseXBoX2Zs YXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAg ICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFS X1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNf UkVWRVJTRURfVkVSVElDQUxfQkFSKSkKKyAgICAgICAgICAgICAgICAgID8gbG9va3VwX25hbWVk X2ZhY2UgKHcsIGYsIGludGVybiAoIistcmV2ZXJzZWQtYmFyLXByZS16di1mYWNlIiksIHRydWUp CisgICAgICAgICAgICAgICAgOiAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1B UAorICAgICAgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBBVF9aVgorICAgICAgICAg ICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdM RV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0g TUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAg ICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpKQorICAgICAg ICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZXZlcnNl ZC1iYXItYXQtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICAgIDogKGN1cnNvcl90eXBl ID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgICAmJiByb3dfcG9z aXRpb24gPT0gUE9TVF9aVgorICAgICAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0g TUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAg ICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hU X0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZF UlNFRF9WRVJUSUNBTF9CQVIpKQorICAgICAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFj ZSAodywgZiwgaW50ZXJuICgiKy1yZXZlcnNlZC1iYXItcG9zdC16di1mYWNlIiksIHRydWUpCisg ICAgICAgICAgICAgICAgOiAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAor ICAgICAgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYKKyAgICAgICAgICAg ICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9S SUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZF UlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAmJiBnbHlw aF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAgICAg PyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1iYXItcHJlLXp2LWZhY2UiKSwg dHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0Vf QklUTUFQCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IEFUX1pWCisgICAg ICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX0hPTExPV19SRUNU QU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0g TUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAg JiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAg ICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistYmFyLWF0LXp2LWZh Y2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9G UklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBPU1Rf WlYKKyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWR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ICAgZWxzZSBpZiAoKCFyb3ctPnJldmVyc2VkX3AgJiYg cm93LT50cnVuY2F0ZWRfb25fbGVmdF9wKQorICAgICAgICAgICAgICAgfHwgKHJvdy0+cmV2ZXJz ZWRfcCAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKSkKKyAgICAgICAgbGVmdCA9IE1DX0xF RlRfRlJJTkdFICgwLCBRdHJ1bmNhdGlvbiwgMCk7CisgICAgICBlbHNlIGlmIChyb3ctPmluZGlj YXRlX2JvYl9wICYmIEVRIChib3VuZGFyeV90b3AsIFFsZWZ0KSkKKyAgICAgICAgeworICAgICAg ICAgIGxlZnQgPSAoKHJvdy0+aW5kaWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5kYXJ5X2JvdCwgUWxl ZnQpKQorICAgICAgICAgICAgICAgICA/IE1DX0xFRlRfRlJJTkdFICgxLCBRdG9wX2JvdHRvbSwg dG9wX3Jvd19lbmRzX2F0X3p2X3ApCisgICAgICAgICAgICAgICAgIDogTUNfTEVGVF9GUklOR0Ug KDIsIFF0b3AsIDApKTsKKyAgICAgICAgICBpZiAodG9wX2luZF9taW5feSA+PSAwKQorICAgICAg ICAgICAgbGVmdF9vZmZzZXQgPSB0b3BfaW5kX21pbl95IC0gcm93LT55OworICAgICAgICB9Cisg ICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2VvYl9wICYmIEVRIChib3VuZGFyeV9ib3QsIFFs ZWZ0KSkKKyAgICAgICAgeworICAgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAoMywgUWJv dHRvbSwgYm90X3Jvd19lbmRzX2F0X3p2X3ApOworICAgICAgICAgIGlmIChib3RfaW5kX21heF95 ID49IDApCisgICAgICAgICAgICBsZWZ0X29mZnNldCA9IGJvdF9pbmRfbWF4X3kgLSAocm93LT55 ICsgcm93LT52aXNpYmxlX2hlaWdodCk7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKCghcm93 LT5yZXZlcnNlZF9wICYmIE1BVFJJWF9ST1dfQ09OVElOVUFUSU9OX0xJTkVfUCAocm93KSkKKyAg ICAgICAgICAgICAgIHx8IChyb3ctPnJldmVyc2VkX3AgJiYgcm93LT5jb250aW51ZWRfcCkpCisg ICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAoNCwgUWNvbnRpbnVhdGlvbiwgMCk7CisgICAg ICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2VtcHR5X2xpbmVfcCAmJiBFUSAoZW1wdHlfcG9zLCBR bGVmdCkpCisgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAoNSwgUWVtcHR5X2xpbmUsIDAp OworICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV90b3BfbGluZV9wICYmIEVRIChhcnJvd190 b3AsIFFsZWZ0KSkKKyAgICAgICAgeworICAgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAo NiwgUXVwLCAwKTsKKyAgICAgICAgICBpZiAodG9wX2luZF9taW5feSA+PSAwKQorICAgICAgICAg ICAgbGVmdF9vZmZzZXQgPSB0b3BfaW5kX21pbl95IC0gcm93LT55OworICAgICAgICB9CisgICAg ICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3AgJiYgRVEgKGFycm93X2JvdCwg UWxlZnQpKQorICAgICAgICB7CisgICAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdFICg3LCBR ZG93biwgMCk7CisgICAgICAgICAgaWYgKGJvdF9pbmRfbWF4X3kgPj0gMCkKKyAgICAgICAgICAg IGxlZnRfb2Zmc2V0ID0gYm90X2luZF9tYXhfeSAtIChyb3ctPnkgKyByb3ctPnZpc2libGVfaGVp Z2h0KTsKKyAgICAgICAgfQorICAgICAgZWxzZQorICAgICAgICBsZWZ0ID0gTUNfTk9fRlJJTkdF X0JJVE1BUDsKKyAgICAgIC8qIERlY2lkZSB3aGljaCBiaXRtYXAgdG8gZHJhdyBpbiB0aGUgcmln aHQgZnJpbmdlLiAgKi8KKyAgICAgIGlmIChXSU5ET1dfUklHSFRfRlJJTkdFX1dJRFRIICh3KSA9 PSAwKQorICAgICAgICByaWdodCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICBlbHNlIGlm IChyb3ctPnJpZ2h0X3VzZXJfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQor ICAgICAgICB7CisgICAgICAgICAgcmlnaHQgPSByb3ctPnJpZ2h0X3VzZXJfZnJpbmdlX2JpdG1h cDsKKyAgICAgICAgICByaWdodF9mYWNlX2lkID0gcm93LT5yaWdodF91c2VyX2ZyaW5nZV9mYWNl X2lkOworICAgICAgICB9CisgICAgICBlbHNlIGlmICgoIXJvdy0+cmV2ZXJzZWRfcCAmJiByb3ct PnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgfHwgKHJvdy0+cmV2ZXJzZWRf cCAmJiByb3ctPnRydW5jYXRlZF9vbl9sZWZ0X3ApKQorICAgICAgICByaWdodCA9IE1DX1JJR0hU X0ZSSU5HRSAoMCwgUXRydW5jYXRpb24sIDApOworICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0 ZV9ib2JfcCAmJiBFUSAoYm91bmRhcnlfdG9wLCBRcmlnaHQpKQorICAgICAgICB7CisgICAgICAg ICAgcmlnaHQgPSAoKHJvdy0+aW5kaWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5kYXJ5X2JvdCwgUXJp Z2h0KSkKKyAgICAgICAgICAgICA/IE1DX1JJR0hUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20sIHRv cF9yb3dfZW5kc19hdF96dl9wKQorICAgICAgICAgICAgIDogTUNfUklHSFRfRlJJTkdFICgyLCBR dG9wLCAwKSk7CisgICAgICAgICAgaWYgKHRvcF9pbmRfbWluX3kgPj0gMCkKKyAgICAgICAgICAg IHJpZ2h0X29mZnNldCA9IHRvcF9pbmRfbWluX3kgLSByb3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AorICAgICAgICAgIHx8IHJp Z2h0X29mZnNldCAhPSBjdXItPnJpZ2h0X2ZyaW5nZV9vZmZzZXQKKyAgICAgICAgICB8fCBwZXJp b2RpY19wICE9IGN1ci0+ZnJpbmdlX2JpdG1hcF9wZXJpb2RpY19wCisgICAgICAgICAgfHwgY3Vy LT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcCkKKyAgICAgICAgeworICAgICAgICAgIHJlZHJhd19w ID0gMSwgcm93LT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcCA9IDE7CisgICAgICAgICAgaWYgKCFr ZWVwX2N1cnJlbnRfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY3VyLT5yZWRyYXdf ZnJpbmdlX2JpdG1hcHNfcCA9IDE7CisgICAgICAgICAgICAgIGlmIChtY19sZWZ0X2ZyaW5nZV9i aXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAgfHwgbWNfcmln aHRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAg IGN1ci0+ZnJpbmdlX2JpdG1hcF9wZXJpb2RpY19wID0gZmFsc2U7CisgICAgICAgICAgICAgICAg ZWxzZQorICAgICAgICAgICAgICAgICAgY3VyLT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3AgPSBw ZXJpb2RpY19wOworICAgICAgICAgICAgICBpZiAobWNfbGVmdF9mcmluZ2VfYml0bWFwICE9IE1D X05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgY3VyLT5sZWZ0X2ZyaW5nZV9iaXRt YXAgPSBtY19sZWZ0X2ZyaW5nZV9iaXRtYXA7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICAgICAgY3VyLT5sZWZ0X2ZyaW5nZV9iaXRtYXAgPSBsZWZ0OworICAgICAgICAgICAg ICBpZiAobWNfbGVmdF9mcmluZ2VfYml0bWF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aXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICBjdXItPnJp Z2h0X2ZyaW5nZV9vZmZzZXQgPSAwOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX29mZnNldCA9IHJpZ2h0X29mZnNldDsKKyAgICAgICAg ICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAgPCAw KQorICAgICAgICByb3ctPm92ZXJsYXlfYXJyb3dfYml0bWFwID0gbWNfZ2V0X2xvZ2ljYWxfZnJp bmdlX2JpdG1hcCAodywgUW92ZXJsYXlfYXJyb3csIDAsIDApOworICAgICAgaWYgKHJvdy0+b3Zl cmxheV9hcnJvd19iaXRtYXAgIT0gY3VyLT5vdmVybGF5X2Fycm93X2JpdG1hcCkKKyAgICAgICAg eworICAgICAgICAgIHJlZHJhd19wID0gMSwgcm93LT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcCA9 IDE7CisgICAgICAgICAgaWYgKCFrZWVwX2N1cnJlbnRfcCkKKyAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgY3VyLT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcCA9IDE7CisgICAgICAgICAgICAg IGN1ci0+b3ZlcmxheV9hcnJvd19iaXRtYXAgPSByb3ctPm92ZXJsYXlfYXJyb3dfYml0bWFwOwor ICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBpZiAobWNfbGVmdF9mcmluZ2VfYml0bWFw ICE9IE1DX05PX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICB8fCBtY19yaWdodF9mcmluZ2VfYml0 bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgIHJvdy0+ZnJpbmdlX2JpdG1hcF9w ZXJpb2RpY19wID0gZmFsc2U7CisgICAgICAgIGVsc2UKKyAgICAgICAgICByb3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vdmVyIGl0LiAgKi8KKyAgICAgICAgICB3ZCAtPSAoKCFXSU5ET1dfTEVGVE1PU1RfUCAodykK KyAgICAgICAgICAgIC8qIFRoaXMgY291bGQgYmUgd3Jvbmcgd2hlbiB3ZSBhbGxvdyB3aW5kb3cg bG9jYWwKKyAgICAgICAgICAgICAgIHJpZ2h0IGRpdmlkZXJzIC0gYnV0IHRoZSB3aW5kb3cgb24g dGhlIGxlZnQgaXMgaGFyZAorICAgICAgICAgICAgICAgdG8gZ2V0LiAgKi8KKyAgICAgICAgICAg ICYmICFGUkFNRV9SSUdIVF9ESVZJREVSX1dJRFRIIChmKQorICAgICAgICAgICAgJiYgIVdJTkRP V19IQVNfVkVSVElDQUxfU0NST0xMX0JBUiAodykKKyAgICAgICAgICAgIC8qIEJ1dCBkb24ndCBy ZWR1Y2UgdGhlIGZyaW5nZSB3aWR0aCBpZiB0aGUgd2luZG93CisgICAgICAgICAgICAgICBoYXMg YSBsZWZ0IG1hcmdpbiwgYmVjYXVzZSB0aGF0IG1lYW5zIHdlIGFyZSBub3QKKyAgICAgICAgICAg ICAgIGluIGRhbmdlciBvZiBkcmF3aW5nIG92ZXIgdGhlIHZlcnRpY2FsIGJvcmRlciwKKyAgICAg ICAgICAgICAgIGFuZCBPVE9IIGxlYXZpbmcgb3V0IHRoYXQgb25lIHBpeGVsIGxlYXZlcyBiZWhp bmQKKyAgICAgICAgICAgICAgIHRyYWNlcyBvZiB0aGUgY3Vyc29yLCBpZiBpdCB3YXMgaW4gY29s dW1uIHplcm8KKyAgICAgICAgICAgICAgIGJlZm9yZSBkcmF3aW5nIG5vbi1lbXB0eSBtYXJnaW4g YXJlYS4gICovCisgICAgICAgICAgICAmJiB3LT5sZWZ0X21hcmdpbl9jb2xzID09IDApCisgICAg ICAgICAgID8gMSA6IDApOworICAgICAgICAgIHAuYnggPSB4IC0gd2Q7CisgICAgICAgICAgcC5u eCA9IHdkOworICAgICAgICB9CisgICAgfQorICBlbHNlCisgICAgeworICAgICAgaW50IHggPSB3 aW5kb3dfYm94X3JpZ2h0ICh3LAorICAgICAgICAoV0lORE9XX0hBU19GUklOR0VTX09VVFNJREVf TUFSR0lOUyAodykKKyAgICAgICAgID8gUklHSFRfTUFSR0lOX0FSRUEKKyAgICAgICAgIDogVEVY VF9BUkVBKSk7CisgICAgICBpbnQgd2QgPSBXSU5ET1dfUklHSFRfRlJJTkdFX1dJRFRIICh3KTsK KyAgICAgIGlmIChwLndkID4gd2QpCisgICAgICAgIHAud2QgPSB3ZDsKKyAgICAgIHAueCA9IHgg KyAod2QgLSBwLndkKSAvIDI7CisgICAgICAvKiBDbGVhciByaWdodCBmcmluZ2UgaWYgbm8gYml0 bWFwIHRvIGRyYXcgb2YgaWYgYml0bWFwIGRvZXNuJ3QgZmlsbAorICAgdGhlIGZyaW5nZS4gICov CisgICAgICBpZiAocC53ZCA8IHdkIHx8IHAueSA+IHAuYnkgfHwgcC55ICsgcC5oIDwgcC5ieSAr IHAubnkpCisgICAgICAgIHsKKyAgICAgICAgICBwLmJ4ID0geDsKKyAgICAgICAgICBwLm54ID0g d2Q7CisgICAgICAgIH0KKyAgICB9CisgIGlmIChwLnggPj0gV0lORE9XX0JPWF9MRUZUX0VER0Vf WCAodykKKyAgICAgICYmIChwLnggKyBwLndkKSA8PSBXSU5ET1dfQk9YX0xFRlRfRURHRV9YICh3 KSArIFdJTkRPV19QSVhFTF9XSURUSCAodykpCisgICAgRlJBTUVfUklGIChmKS0+ZHJhd19mcmlu Z2VfYml0bWFwICh3LCByb3csICZwKTsKK30KKwordm9pZAorbWNfZHJhd19mcmluZ2VfYml0bWFw IChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCBsZWZ0X3AsIGVu dW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUpCit7CisgIGludCBvdmVybGF5ID0gMDsKKyAg aWYgKGxlZnRfcCA9PSByb3ctPnJldmVyc2VkX3AgJiYgcm93LT5jdXJzb3JfaW5fZnJpbmdlX3Ap CisgICAgeworICAgICAgTGlzcF9PYmplY3QgY3Vyc29yID0gUW5pbDsKKyAgICAgIHN3aXRjaCAo Y3Vyc29yX3R5cGUpCisgICAgICAgIHsKKyAgICAgICAgY2FzZSBNQ19GUkFNRURfQk9YOgorICAg ICAgICAgIGlmIChyb3ctPnZpc2libGVfaGVpZ2h0ID49IFNUQU5EQVJEX0JJVE1BUF9IRUlHSFQg KGhvbGxvd19yZWN0YW5nbGVfYml0cykpCisgICAgICAgICAgICBjdXJzb3IgPSBRaG9sbG93Owor ICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGN1cnNvciA9IFFob2xsb3dfc21hbGw7CisgICAg ICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTUNfSE9MTE9XX0JPWDoKKyAgICAgICAgICBpZiAo cm93LT52aXNpYmxlX2hlaWdodCA+PSBTVEFOREFSRF9CSVRNQVBfSEVJR0hUIChob2xsb3dfcmVj dGFuZ2xlX2JpdHMpKQorICAgICAgICAgICAgY3Vyc29yID0gUWhvbGxvdzsKKyAgICAgICAgICBl bHNlCisgICAgICAgICAgICBjdXJzb3IgPSBRaG9sbG93X3NtYWxsOworICAgICAgICAgIGJyZWFr OworICAgICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAgICAgICAgY3Vyc29yID0gUWJveDsK KyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19CQVI6CisgICAgICAgICAgY3Vyc29y ID0gUWJhcjsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19IQkFSOgorICAgICAg ICAgIGN1cnNvciA9IFFoYmFyOworICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1DX05P X0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGNhc2UgTUNfTk9fQ1VSU09SOgorICAgICAgICBjYXNl IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGNhc2UgTUNfTEVGVF9GUklOR0VfQklU TUFQOgorICAgICAgICBkZWZhdWx0OgorICAgICAgICAgIHctPnBoeXNfY3Vyc29yX29uX3AgPSAw OworICAgICAgICAgIHJvdy0+Y3Vyc29yX2luX2ZyaW5nZV9wID0gMDsKKyAgICAgICAgICBicmVh azsKKyAgICAgICAgfQorICAgICAgaWYgKCFOSUxQIChjdXJzb3IpKQorICAgICAgICB7CisgICAg ICAgICAgaW50IGJtID0gbWNfZ2V0X2xvZ2ljYWxfY3Vyc29yX2JpdG1hcCAodywgY3Vyc29yKTsK KyAgICAgICAgICBpZiAoYm0gIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgbWNfZHJhd19mcmluZ2VfYml0bWFwXzEgKHcsIHJvdywgbGVmdF9wLCAy LCBibSk7CisgICAgICAgICAgICAgIG92ZXJsYXkgPSBFUSAoY3Vyc29yLCBRYm94KSA/IDMgOiAx OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICBtY19kcmF3X2ZyaW5nZV9iaXRt YXBfMSAodywgcm93LCBsZWZ0X3AsIG92ZXJsYXksIE1DX05PX0ZSSU5HRV9CSVRNQVApOworICBp ZiAobGVmdF9wICYmIHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJ VE1BUCkKKyAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXBfMSAodywgcm93LCAxLCAxLCByb3ctPm92 ZXJsYXlfYXJyb3dfYml0bWFwKTsKK30KKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKICNkZWZpbmUgTk9fRlJJTkdFX0JJVE1BUCAwCiAj ZGVmaW5lIFVOREVGX0ZSSU5HRV9CSVRNQVAgMQogI2RlZmluZSBNQVhfU1RB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XQgJystcXVhZHJ1cGxlLWFuZ2xlLXVwICdmcmluZ2UpID0+IDQ3ICovCisKKyAgLyog NDggKi8KKyAgREVGU1lNIChRbWNfcXVhZHJ1cGxlX2FuZ2xlX2Rvd24sICIrLXF1YWRydXBsZS1h bmdsZS1kb3duIik7CisgIFZmcmluZ2VfYml0bWFwcyA9IEZjb25zIChRbWNfcXVhZHJ1cGxlX2Fu Z2xlX2Rvd24sIFZmcmluZ2VfYml0bWFwcyk7CisgIEZwdXQgKFFtY19xdWFkcnVwbGVfYW5nbGVf ZG93biwgUWZyaW5nZSwgbWFrZV9maXhudW0gKDQ4KSk7CisgIC8qIChnZXQgJystcXVhZHJ1cGxl LWFuZ2xlLWRvd24gJ2ZyaW5nZSkgPT4gNDggKi8KKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMg Ki8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgREVGU1lNIChRdHJ1bmNhdGlvbiwg InRydW5jYXRpb24iKTsKICAgREVGU1lNIChRY29udGludWF0aW9uLCAiY29udGludWF0aW9uIik7 CiAgIERFRlNZTSAoUW92ZXJsYXlfYXJyb3csICJvdmVybGF5LWFycm93Iik7CmRpZmYgLS1naXQg YS9zcmMvbnN0ZXJtLmggYi9zcmMvbnN0ZXJtLmgKaW5kZXggNzhjZTYwOC4uOGVmMGRmZSAxMDA2 NDQKLS0tIGEvc3JjL25zdGVybS5oCisrKyBiL3NyYy9uc3Rlcm0uaApAQCAtNjYwLDYgKzY2MCwx NiBAQCB0eXBlZGVmIGlkIGluc3RhbmNldHlwZTsKIAogQGludGVyZmFjZSBFbWFjc1Njcm9sbGVy IDogTlNTY3JvbGxlcgogICB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKyAgICBOU1JlY3QgbWNfcmVjdGFuZ2xlOworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAgICBzdHJ1Y3Qgd2luZG93ICp3aW5kb3c7CiAgICBzdHJ1Y3Qg ZnJhbWUgKmZyYW1lOwogICAgTlNSZXNwb25kZXIgKnByZXZSZXNwb25kZXI7CkBAIC02ODAsNiAr NjkwLDE4IEBAIHR5cGVkZWYgaWQgaW5zdGFuY2V0eXBlOwogICAgaW50IGVtX3dob2xlOwogICAg fQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLwor CistICh2b2lkKW1jX3NldF9yZWN0YW5nbGU6IChOU1JlY3QpcmVjdDsKKy0gKE5TUmVjdCltY19n ZXRfcmVjdGFuZ2xlOworLSAoc3RydWN0IHdpbmRvdyAqKW1jX2dldF93aW5kb3c7CistIChib29s KW1jX2p1ZGdlOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAtIChpbnN0YW5jZXR5 cGUpIGluaXRGcmFtZTogKE5TUmVjdCApciB3aW5kb3c6IChMaXNwX09iamVjdCl3aW47CiAtICh2 b2lkKXNldEZyYW1lOiAoTlNSZWN0KXI7CiAKZGlmZiAtLWdpdCBhL3NyYy9uc3Rlcm0ubSBiL3Ny Yy9uc3Rlcm0ubQppbmRleCA4MWQzNmJlLi5kZmU2MDU5IDEwMDY0NAotLS0gYS9zcmMvbnN0ZXJt Lm0KKysrIGIvc3JjL25zdGVybS5tCkBAIC03Niw2ICs3Niw5NzkgQEAgVXBkYXRlZCBieSBDaHJp c3RpYW4gTGltcGFjaCAo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m50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5mZy5n cmVlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IHMtPnctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZmcuYmx1ZX07CisgICAg ICAgICAgLy8gIHN0cnVjdCBtY19SR0IgbHNsX2JnID0gey5yZWQgPSBzLT53LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLnJlZCwKKyAgICAgICAgICAvLyAg ICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5iZy5ncmVlbiwKKyAgICAgICAgICAvLyAgICAgICAg ICAgICAgICAgICAgICAgICAgLmJsdWUgPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhdLmJnLmJsdWV9OworICAgICAgICAgIGJvb2wgYWN0aXZlX3AgPSBz LT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmFjdGl2ZV9w OworICAgICAgICAgIC8vICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSBzLT53LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoX2ZsYXZvcjsKKyAg ICAgICAgICBib29sIGVuYWJsZWRfcCA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF0uZW5hYmxlZF9wOworICAgICAgICAgIGJvb2wgZ29fcCA9ICh2cG9z ID09IHZudGgKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA9PSBjdXJzb3JfZ2x5cGgt Pmhwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKTsKKyAgICAgICAgICBp ZiAoIWdvX3ApCisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICBOU1JlY3QgcjsKKyAg ICAgICAgICByLm9yaWdpbi54ID0gZng7CisgICAgICAgICAgci5vcmlnaW4ueSA9IGZ5OworICAg ICAgICAgIHIuc2l6ZS5oZWlnaHQgPSBoOworICAgICAgICAgIHIuc2l6ZS53aWR0aCA9IHdkOwor ICAgICAgICAgIFtbTlNDb2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiBsc2xfZmcucmVkCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JlZW46IGxzbF9mZy5ncmVlbgor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBibHVlOiBsc2xfZmcuYmx1ZQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscGhhOiAxLjBdIHNldF07Cisg ICAgICBpZiAoY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWCkKKyAgICAgICAgeworICAgICAg ICAgIExpc3BfT2JqZWN0IGJ1ZiA9IHMtPnctPmNvbnRlbnRzOworICAgICAgICAgIENIRUNLX0JV RkZFUiAoYnVmKTsKKyAgICAgICAgICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAoYnVmKTsK KyAgICAgICAgICBib29sIHJlZ2lvbl9hY3RpdmVfcCA9ICghTklMUCAoVnRyYW5zaWVudF9tYXJr X21vZGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIg KGIsIG1hcmtfYWN0aXZlKSkpOworICAgICAgICAgIHB0cmRpZmZfdCByZWdpb25fYmVnID0gKHJl Z2lvbl9hY3RpdmVfcCkgPyBtY19yZWdpb25fbGltaXQgKDEpIDogLTE7CisgICAgICAgICAgcHRy ZGlmZl90IHJlZ2lvbl9lbmQgP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gICAg ICAgICAgICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19hY3RpdmVfY29sb3I7CisgICAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmICghYWN0aXZlX3ApCisgICAg ICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9s bG93X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ZiwgaW50 ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpOwor ICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9 IEZBQ0VfRlJPTV9JRCAocy0+ZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAg ICAgICAgICAgICAgIE5TQ29sb3IgKmhvbGxvd19pbmFjdGl2ZV9jb2xvciA9IG5zX2xvb2t1cF9p bmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGhvbGxvd19pbmFjdGl2ZV9mYWNlKSwg cy0+Zik7CisgICAgICAgICAgICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2luYWN0 aXZlX2NvbG9yOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxz ZSBpZiAoZmFjZSAmJiBOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpID09IG5zX2luZGV4X2NvbG9y IChGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpLCBzLT5mKSkKKyAgICAgICAgICB7CisgICAgICAg ICAgICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoZmFjZSks IHMtPmYpIHNldF07CisgICAgICAgICAgICBob2xsb3dfY29sb3IgPSBGUkFNRV9DVVJTT1JfQ09M T1IgKHMtPmYpOworICAgICAgICAgIH0KKyAgICAgICAgICBzd2l0Y2ggKGN1cnNvcl90eXBlKQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICBjYXNlIE1DX05PX0ZSSU5HRV9CSVRNQVA6Cisg ICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgTUNfTk9fQ1VSU09SOgor ICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX1JJR0hUX0ZSSU5H RV9CSVRNQVA6CisgICAgICAgICAgICAgIGNhc2UgTUNfTEVGVF9GUklOR0VfQklUTUFQOgorICAg ICAgICAgICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAgICAgICAgICAgICAgTlNSZWN0Rmls bCAocik7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgTUNfRlJB TUVEX0JPWDoKKyAgICAgICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAgICAg ICBbaG9sbG93X2NvbG9yIHNldF07CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAoTlNJbnNl dFJlY3QgKHIsIDEsIDEpKTsKKyAgICAgICAgICAgICAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChz LT5mKSBzZXRdOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1D X0hPTExPV19CT1g6CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAg ICAgICAgW2hvbGxvd19jb2xvciBzZXRdOworICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKE5T SW5zZXRSZWN0IChyLCAxLCAxKSk7CisgICAgICAgICAgICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xP UiAocy0+Zikgc2V0XTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2Fz ZSBNQ19IQkFSOgorICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAg ICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX0JBUjoKKyAgICAgICAgICAgICAgICBO U1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAg ICAgICAgICAvKiBJZiBhIGdseXBoIGV4aXN0cyAocy0+Y2hhcjJiICE9IE5VTEwpLCB0aGVuIGRy YXcgdGhlIGdseXBoIG9uIHRvcCBvZiB0aGUKKyAgICAgICAgICBuZXdseSBkcmF3biByZWN0YW5n bGUgdGhhdCB3YXMgY3JlYXRlZCBoZXJlaW5hYm92ZS4gIFRvIHRoZSBleHRlbnQgdGhhdCB3ZQor ICAgICAgICAgIHdhbnQgdG8gZG91YmxlLWltcHJpbnQgZ2x5cGhzIHRvIG1ha2UgdGhlbSBhcHBl YXIgdG8gYmUgc2VtaS1ib2xkLCBpdCBjYW4KKyAgICAgICAgICBiZSBkb25lIGhlcmUgZm9yIGFs bCBjdXJzb3IgdHlwZXMuICBUaGUgYm94LXN0eWxlIGN1cnNvcnMgYXJlIGltcHJpbnRlZAorICAg ICAgICAgIHdpdGggZ2x5cGhzIG9ubHkgb25lICgxKSB0aW1lLiAgVGhlIHNlbWktYm9sZCBhcHBl YXJhbmNlIGlzIGhlbHBmdWwgd2hlbgorICAgICAgICAgIGRlYnVnZ2luZyB0byBzZWUgdGhhdCB0 aGUgY29vcmRpbmF0ZXMgYXJlIGNvcnJlY3QuICovCisgICAgICAgICAgaWYgKHMtPmNoYXIyYiAh PSBOVUxMCisgICAgICAgICAgICAgICYmIChjdXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9YCisg ICAgICAgICAgICAgICAgICB8fCBjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YCisgICAgICAg ICAgICAgICAgICB8fCBjdXJzb3JfdHlwZSA9PSBNQ19IT0xMT1dfQk9YKSkKKyAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgQk9PTCBpc0NvbXBvc2l0ZSA9IHMtPmZpcnN0X2dseXBoLT50eXBl ID09IENPTVBPU0lURV9HTFlQSDsKKyAgICAgICAgICAgICAgaWYgKGlzQ29tcG9zaXRlKQorICAg ICAgICAgICAgICAgIG5zX2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChz KTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgICAgIHN0cnVjdCBmb250ICpmb250ID0gcy0+ZmFjZS0+Zm9udDsKKyAgICAgICAgICAg ICAgICAgICAgaWYgKCFmb250KQorICAgICAgICAgICAgICAgICAgICAgIGZvbnQgPSBGUkFNRV9G T05UIChzLT5mKTsKKyAgICAgICAgICAgICAgICAgICAgYm9vbCB3aXRoX2JnX3AgPSBmYWxzZTsK KyAgICAgICAgICAgICAgICAgICAgZm9udC0+ZHJpdmVyLT5kcmF3IChzLCBzLT5jbXBfZnJvbSwg cy0+bmNoYXJzLCBzLT54LCBzLT55YmFzZSwgd2l0aF9iZ19wKTsKKyAgICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgLy8gIGNsb2NrX3QgY2xvY2tf ZW5kID0gY2xvY2soKTsKKyAgLy8gIGRvdWJsZSBjcHVfdGltZV91c2VkID0gKChkb3VibGUpIChj bG9ja19lbmQgLSBjbG9ja19zdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7CisgIC8vICBmcHJpbnRm IChzdGRlcnIsICJuc19kcmF3X292ZXJ3cml0dGVuICglZCk6ICBUSU1FICglZilcbiIsIHZwb3Ms IGNwdV90aW1lX3VzZWQpOworfQorCitzdGF0aWMgdm9pZAorbWNfbnNfZHJhd193aW5kb3dfY3Vy c29yIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsIHN0cnV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jZV9pZCk7Cisg ICAgIE5TQ29sb3IgKmNvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9S RUdST1VORCAoZmFjZSksIGYpOworICAtICBFWEFNUExFIE9GIEhPVyBUTyBQUklOVCBBIENPTE9S IFRPIFNUREVSUjoKKyAgICAgTGlzcF9PYmplY3QgZm9yZWdyb3VuZCA9IGZhY2UtPmxmYWNlW0xG QUNFX0ZPUkVHUk9VTkRfSU5ERVhdOworICAgICBMaXNwX09iamVjdCBiYWNrZ3JvdW5kID0gZmFj ZS0+bGZhY2VbTEZBQ0VfQkFDS0dST1VORF9JTkRFWF07CisgICAgIGZwcmludGYgKHN0ZGVyciwg IlxuZm9yZWdyb3VuZCAoJXMpIHwgYmFja2dyb3VuZCAoJXMpXG4iLAorICAgICAgICAgICAgICAg ICAgICAgICghTklMUCAoZm9yZWdyb3VuZCkgPyBTU0RBVEEgKGZvcmVncm91bmQpIDogIk5JTFAi KSwKKyAgICAgICAgICAgICAgICAgICAgICAoIU5JTFAgKGJhY2tncm91bmQpID8gU1NEQVRBIChi YWNrZ3JvdW5kKSA6ICJOSUxQIikpOworICAtICBFWEFNUExFIE9GIEhPVyBUTyBDUkVBVEUgQSBD T0xPUiBXSVRIIFJHQi9MU0wgZmxvYXQgdmFsdWVzOgorICAgICBOU0NvbG9yICpteV9jb2xvciA9 IFtOU0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6IDEuMAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JlZW46IDEuMAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJsdWU6IDEuMAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwaGE6IDEuMF07 CisgIC0gIEFMVEVSTkFUSVZFIEVYQU1QTEU6CisgICAgIGVudW0gZmFjZV9pZ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gICAgICAgICAg ICAgICYmIGN1cnNvcl9nbHlwaC0+Y2hhcnBvcyA9PSByZWdpb25fZW5kKQorICAgICAgICAgIHsK KyAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZV9p ZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3It YXQtcmVnaW9uLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgc3RydWN0IGZhY2Ug KmhvbGxvd19hY3RpdmVfcmVnaW9uX2VuZF9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3df YWN0aXZlX3JlZ2lvbl9lbmRfZmFjZV9pZCk7CisgICAgICAgICAgICBOU0NvbG9yICpob2xsb3df YWN0aXZlX3JlZ2lvbl9lbmRfY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFD RV9CQUNLR1JPVU5EIChob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZSksIGYpOworICAgICAg ICAgICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2NvbG9yOworICAg ICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAg ICAgICAgICAmJiBhY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+ Y2hhcnBvcyA+IHJlZ2lvbl9iZWcKKyAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgt PmNoYXJwb3MgPCByZWdpb25fZW5kKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBlbnVt IGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNlX2lkID0gbG9va3VwX25h bWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC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9sbG93X2FjdGl2 ZV9jb2xvcjsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAvKiBUaGUgcmVnaW9uIGlz IF9ub3RfIHZpc2libGUgaW4gdGhlIGluYWN0aXZlIHdpbmRvdyBiZWNhdXNlIHRoZSBvdmVybGF5 IHdpbmRvdyBwcm9wZXJ0eSBpcyB1c2VkLiAqLworICAgICAgICAgICAgICBlbHNlIGlmICghYWN0 aXZlX3ApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lk IGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVy biAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAg ICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9IEZBQ0Vf RlJPTV9JRCAoZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAg TlNDb2xvciAqaG9sbG93X2luYWN0aXZlX2NvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3Ig KE5TX0ZBQ0VfQkFDS0dST1VORCAoaG9sbG93X2luYWN0aXZlX2ZhY2UpLCBmKTsKKyAgICAgICAg ICAgICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19pbmFjdGl2ZV9jb2xvcjsKKyAgICAgICAg ICAgICAgICB9CisgICAgfQorICAgIGVsc2UgaWYgKGZhY2UgJiYgTlNfRkFDRV9CQUNLR1JPVU5E IChmYWNlKSA9PSBuc19pbmRleF9jb2xvciAoRlJBTUVfQ1VSU09SX0NPTE9SIChmKSwgZikpCisg ICAgICB7CisgICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JP VU5EIChmYWNlKSwgZikgc2V0XTsKKyAgICAgICAgaG9sbG93X2NvbG9yID0gRlJBTUVfQ1VSU09S X0NPTE9SIChmKTsKKyAgICAgIH0KKyNpZmRlZiBOU19JTVBMX0NPQ09BCisgIE5TRGlzYWJsZVNj cmVlblVwZGF0ZXMgKCk7CisjZW5kaWYKKyAgc3dpdGNoIChjdXJzb3JfdHlwZSkKKyAgICB7Cisg ICAgICBjYXNlIE1DX05PX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGJyZWFrOworICAgICAgY2Fz ZSBNQ19OT19DVVJTT1I6CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19SSUdIVF9GUklO R0VfQklUTUFQOgorICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfTEVGVF9GUklOR0VfQklU TUFQOgorICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAgICAgICAg TlNSZWN0RmlsbCAocik7CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19GUkFNRURfQk9Y OgorICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgW2hvbGxvd19jb2xvciBzZXRdOwor ICAgICAgICBOU1JlY3RGaWxsIChOU0luc2V0UmVjdCAociwgMSwgMSkpOworICAgICAgICBbRlJB TUVfQ1VSU09SX0NPTE9SIChmKSBzZXRdOworICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNf SE9MTE9XX0JPWDoKKyAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgIFtob2xsb3dfY29s b3Igc2V0XTsKKyAgICAgICAgTlNSZWN0RmlsbCAoTlNJbnNldFJlY3QgKHIsIDEsIDEpKTsKKyAg ICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAoZikgc2V0XTsKKyAgICAgICAgYnJlYWs7CisgICAg ICBjYXNlIE1DX0hCQVI6CisgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICBicmVhazsK KyAgICAgIGNhc2UgTUNfQkFSOgorICAgICAgIC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ICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gTUNfSEJBUikKKyAgICAgICAgICB8fCAoZGVidWdf cAorICAgICAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19CQVIpKSkKKyAgICB7CisgICAg ICAvKiBgY3Vyc29yX2djX3BgIGlzIHVzZWQgb25seSBieSBgdzMydGVybS5jYCBhbmQgYHh0ZXJt LmMnLiAqLworICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IGZhbHNlOworICAgICAgWFJlY3Rhbmds ZSAqc2F2ZWRfY2xpcCA9IE5VTEw7CisgICAgICBpZiAocm93LT5jbGlwICE9IE5VTEwpCisgICAg ICAgIHsKKyAgICAgICAgICBzYXZlZF9jbGlwID0gcm93LT5jbGlwOworICAgICAgICAgIHJvdy0+ Y2xpcCA9IE5VTEw7CisgICAgICAgIH0KKyAgICAgIG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBt YXRyaXgsIHJvdywgRFJBV19DVVJTT1IsIHgsIGhwb3MsIHZwb3MsIGxzbCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3As IGN1cnNvcl9nY19wKTsKKyAgICAgIGlmIChzYXZlZF9jbGlwICE9IE5VTEwpCisgICAgICAgIHJv dy0+Y2xpcCA9IHNhdmVkX2NsaXA7CisgICAgfQorI2lmZGVmIE5TX0lNUExfQ09DT0EKKyAgTlNF bmFibGVTY3JlZW5VcGRhdGVzICgpOworI2VuZGlmCit9CisKK3N0YXRpYyB2b2lkCittY19uc19k cmF3X3RleHRfZGVjb3JhdGlvbiAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgc3RydWN0IGZhY2Ug KmZhY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgTlNDb2xvciAqZGVmYXVsdENvbCwgQ0dG bG9hdCB3aWR0aCwgQ0dGbG9hdCB4KQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgIERyYXcgdW5k ZXJsaW5lLCBvdmVybGluZSwgYW5kIHN0cmlrZS10aHJvdWdoIG9uIGdseXBoIHN0cmluZyBzLgor ICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KK3sKKyAgaWYgKHMtPmZvcl9vdmVybGFwcykKKyAgICBy ZXR1cm47CisgIC8qIERvIHVuZGVybGluZS4gKi8KKyAgaWYgKGZhY2UtPnVuZGVybGluZV9wKQor ICAgIHsKKyAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX1dB VkUpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoZmFjZS0+dW5kZXJsaW5lX2RlZmF1bHRlZF9w KQorICAgICAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChmYWNlLT51bmRlcmxpbmVfY29sb3Is IHMtPmYpIHNldF07CisgICAgICAgICAgbnNfZHJhd191bmRlcndhdmUgKHMsIHdpZHRoLCB4KTsK KyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBG QUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgeworICAgICAgICAgICAgTlNSZWN0IHI7CisgICAg ICAgICAgICB1bnNpZ25lZCBsb25nIHRoaWNrbmVzcywgcG9zaXRpb247CisgICAgICAgICAgICAv KiBJZiB0aGUgcHJldiB3YXMgdW5kZXJsaW5lZCwgbWF0Y2ggaXRzIGFwcGVhcmFuY2UuICovCisg ICAgICAgICAgICBpZiAocy0+cHJldiAmJiBzLT5wcmV2LT5mYWNlLT51bmRlcmxpbmVfcAorICAg ICAgICAgICAgICAgICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5E RVJfTElORQorICAgICAgICAgICAgICAgICYmIHMtPnByZXYtPnVuZGVybGluZV90aGlja25lc3Mg PiAwKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+cHJl di0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPnBy ZXYtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBl bHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgc3RydWN0IGZvbnQgKmZv bnQ7CisgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIGRlc2NlbnQ7CisgICAgICAgICAg ICAgICAgICBmb250PXMtPmZvbnQ7CisgICAgICAgICAgICAgICAgICBkZXNjZW50ID0gcy0+eSAr IHMtPmhlaWdodCAtIHMtPnliYXNlOworICAgICAgICAgICAgICAgICAgLyogVXNlIHVuZGVybGlu ZSB0aGlja25lc3Mgb2YgZm9udCwgZGVmYXVsdGluZyB0byAxLiAqLworICAgICAgICAgICAgICAg ICAgdGhpY2tuZXNzID0gKGZvbnQgJiYgZm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzcyA+IDApCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGZvbnQtPnVuZGVybGluZV90aGlja25lc3MK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogMTsKKyAgICAgICAgICAgICAgICAgIC8q IERldGVybWluZSB0aGUgb2Zmc2V0IG9mIHVuZGVybGluaW5nIGZyb20gdGhlIGJhc2VsaW5lLiAq LworICAgICAgICAgICAgICAgICAgaWYgKHhfdW5kZXJsaW5lX2F0X2Rlc2NlbnRfbGluZSkKKyAg ICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBkZXNjZW50IC0gdGhpY2tuZXNzOworICAgICAg ICAgICAgICAgICAgICBlbHNlIGlmICh4X3VzZV91bmRlcmxpbmVfcG9zaXRpb25fcHJvcGVydGll cworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBmb250ICYmIGZvbnQtPnVuZGVybGlu ZV9wb3NpdGlvbiA+PSAwKQorICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gZm9udC0+ dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGZvbnQp CisgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IGxyb3VuZCAoZm9udC0+ZGVzY2Vu dCAvIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAg ICAgICAgICBwb3NpdGlvbiA9IHVuZGVybGluZV9taW5pbXVtX29mZnNldDsKKyAgICAgICAgICAg ICAgICAgIHBvc2l0aW9uID0gbWF4IChwb3NpdGlvbiwgdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0 KTsKKyAgICAgICAgICAgICAgICAgIC8qIEVuc3VyZSB1bmRlcmxpbmluZyBpcyBub3QgY3JvcHBl ZC4gKi8KKyAgICAgICAgICAgICAgICAgIGlmIChkZXNjZW50IDw9IHBvc2l0aW9uKQorICAgICAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBkZXNjZW50 IC0gMTsKKyAgICAgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAxOworICAgICAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGRlc2NlbnQgPCBwb3NpdGlv biArIHRoaWNrbmVzcykKKyAgICAgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAxOworICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHMtPnVuZGVybGluZV90aGlja25lc3MgPSB0aGlj a25lc3M7CisgICAgICAgICAgICBzLT51bmRlcmxpbmVfcG9zaXRpb24gPSBwb3NpdGlvbjsKKyAg ICAgICAgICAgIHIgPSBOU01ha2VSZWN0ICh4LCBzLT55YmFzZSArIHBvc2l0aW9uLCB3aWR0aCwg dGhpY2tuZXNzKTsKKyAgICAgICAgICAgIGlmIChmYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3Ap CisgICAgICAgICAgICAgIFtkZWZhdWx0Q29sIHNldF07CisgICAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKGZhY2UtPnVuZGVybGluZV9j b2xvciwgcy0+Zikgc2V0XTsKKyAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAg IH0KKyAgICB9CisgIC8qIERvIG92ZXJsaW5lLiBXZSBmb2xsb3cgb3RoZXIgdGVybXMgaW4gdXNp bmcgYSB0aGlja25lc3Mgb2YgMQorICAgICBhbmQgaWdub3Jpbmcgb3ZlcmxpbmVfbWFyZ2luLiAq LworICBpZiAoZmFjZS0+b3ZlcmxpbmVfcCkKKyAgICB7CisgICAgICBOU1JlY3QgcjsKKyAgICAg IHIgPSBOU01ha2VSZWN0ICh4LCBzLT55LCB3aWR0aCwgMSk7CisgICAgICBpZiAoZmFjZS0+b3Zl cmxpbmVfY29sb3JfZGVmYXVsdGVkX3ApCisgICAgICAgIFtkZWZhdWx0Q29sIHNldF07CisgICAg ICAgIGVsc2UKKyAgICAgICAgICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKGZhY2UtPm92ZXJs aW5lX2NvbG9yLCBzLT5mKSBzZXRdOworICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgfQorICAv KiBEbyBzdHJpa2UtdGhyb3VnaC4gIFdlIGZvbGxvdyBvdGhlciB0ZXJtcyBmb3IgdGhpY2tuZXNz IGFuZAorICAgICB2ZXJ0aWNhbCBw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XR1cm47Cisg ICAgICBpZiAocy0+aGwgPT0gRFJBV19NT1VTRV9GQUNFKQorICAgICAgICB7CisgICAgICAgICAg ZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgTU9VU0VfSExfSU5GTyAocy0+ZiktPm1vdXNlX2Zh Y2VfZmFjZV9pZCk7CisgICAgICAgICAgaWYgKCFmYWNlKQorICAgICAgICAgICAgZmFjZSA9IEZB Q0VfRlJPTV9JRCAocy0+ZiwgTU9VU0VfRkFDRV9JRCk7CisgICAgICAgIH0KKyAgICAgICAgZWxz ZQorICAgICAgICAgZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+Ziwgcy0+Zmlyc3RfZ2x5cGgtPmZh Y2VfaWQpOworICAgICAgYmdDb2wgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9C QUNLR1JPVU5EIChmYWNlKSwgcy0+Zik7CisgICAgICBmZ0NvbCA9IG5zX2xvb2t1cF9pbmRleGVk X2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQgKGZhY2UpLCBzLT5mKTsKKyAgICAgIGZvciAoaSA9 IDA7IGkgPCBuOyArK2kpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoIXMtPnJvdy0+ZnVsbF93 aWR0aF9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpbnQgb3ZlcnJ1biwgbGVmdG92 ZXJydW47CisgICAgICAgICAgICAgIC8qIHRydW5jYXRlIHRvIGF2b2lkIG92ZXJ3cml0aW5nIGZy aW5nZSBhbmQvb3Igc2Nyb2xsYmFyICovCisgICAgICAgICAgICAgIG92ZXJydW4gPSBtYXggKDAs IChzLT54ICsgcy0+YmFja2dyb3VuZF93aWR0aCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIC0gKFdJTkRPV19CT1hfUklHSFRfRURHRV9YIChzLT53KQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgLSBXSU5ET1dfUklHSFRfRlJJTkdFX1dJRFRIIChzLT53KSkpOworICAg ICAgICAgICAgICAgICAgICByW2ldLnNpemUud2lkdGggLT0gb3ZlcnJ1bjsKKyAgICAgICAgICAg ICAgLyogdHJ1bmNhdGUgdG8gYXZvaWQgb3ZlcndyaXRpbmcgdG8gbGVmdCBvZiB0aGUgd2luZG93 IGJveCAqLworICAgICAgICAgICAgICBsZWZ0b3ZlcnJ1biA9IChXSU5ET1dfQk9YX0xFRlRfRURH RV9YIChzLT53KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIFdJTkRPV19MRUZUX0ZS SU5HRV9XSURUSCAocy0+dykpIC0gcy0+eDsKKyAgICAgICAgICAgICAgaWYgKGxlZnRvdmVycnVu ID4gMCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICByW2ldLm9yaWdpbi54 ICs9IGxlZnRvdmVycnVuOworICAgICAgICAgICAgICAgICAgcltpXS5zaXplLndpZHRoIC09IGxl ZnRvdmVycnVuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgLyogWFhYOiBUcnkg dG8gd29yayBiZXR3ZWVuIHByb2JsZW0gd2hlcmUgYSBzdHJldGNoIGdseXBoIG9uCisgICAgICAg ICAgICAgICAgIGEgcGFydGlhbGx5LXZpc2libGUgYm90dG9tIHJvdyB3aWxsIGNsZWFyIHBhcnQg b2YgdGhlCisgICAgICAgICAgICAgICAgIG1vZGVsaW5lLCBhbmQgYW5vdGhlciB3aGVyZSBsaXN0 LWJ1ZmZlcnMgaGVhZGVycyBhbmQgc2ltaWxhcgorICAgICAgICAgICAgICAgICByb3dzIGVycm9u ZW91c2x5IGhhdmUgdmlzaWJsZV9oZWlnaHQgc2V0IHRvIDAuICBOb3Qgc3VyZQorICAgICAgICAg ICAgICAgICB3aGVyZSB0aGlzIGlzIGNvbWluZyBmcm9tIGFzIG90aGVyIHRlcm1zIHNlZW0gbm90 IHRvIHNob3cuICovCisgICAgICAgICAgICAgIHJbaV0uc2l6ZS5oZWlnaHQgPSBtaW4gKHMtPmhl aWdodCwgcy0+cm93LT52aXNpYmxlX2hlaWdodCk7CisgICAgICAgICAgICB9CisgICAgICAgICAg W2JnQ29sIHNldF07CisgICAgICAgICAgLyogTk9URTogdW5kZXIgTlMgdGhpcyBpcyBOT1QgdXNl ZCB0byBkcmF3IGN1cnNvcnMsIGJ1dCB3ZSBtdXN0IGF2b2lkCisgICAgICAgICAgICAgb3Zlcndy aXRpbmcgY3Vyc29yICh1c3VhbGx5IHdoZW4gY3Vyc29yIG9uIGEgdGFiKSAqLworICAgICAgICAg IGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg LyogRklYTUU6ICBEbyB3ZSBzdGlsbCBuZWVkIHRvIHByZXZlbnQgdGhpcyBzZWN0aW9uIG9mIGNv ZGUgZnJvbQorICAgICAgICAgICAgICBlcmFzaW5nIHRoZSBmYWtlIE1DX0hCQVIgdGhhdCBleHRl bmRzIHRoZSBlbnRpcmUgbGVuZ3RoIG9mIHRoZQorICAgICAgICAgICAgICBTVFJFVENIX0dMWVBI PyAgVGhpcyBtYXkgaGF2ZSBiZWVuIGRvbmUgcHJpb3IgdG8gdGhlIGZpeCByZWxhdGluZworICAg ICAgICAgICAgICB0byBsZWZ0L3JpZ2h0IG92ZXJ3cml0dGVuIGdseXBocy4gKi8KKyAgICAgICAg ICAgICAgcltpXS5zaXplLmhlaWdodCAtPSAxOworICAgICAgICAgICAgICAvLyAgZW51bSBmYWNl X2lkIGRlYnVnZ2luZ19mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMtPmYsIGlu dGVybiAoIistZGVidWdnaW5nLWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgIC8vICBzdHJ1 Y3QgZmFjZSAqZGVidWdnaW5nX2ZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIGRlYnVnZ2luZ19m YWNlX2lkKTsKKyAgICAgICAgICAgICAgLy8gIE5TQ29sb3IgKmNvbG9yID0gbnNfbG9va3VwX2lu ZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoZGVidWdnaW5nX2ZhY2UpLCBzLT5mKTsK KyAgICAgICAgICAgICAgLy8gIFtjb2xvciBzZXRdOworICAgICAgICAgICAgICBDR0Zsb2F0IHgg PSByW2ldLm9yaWdpbi54OworICAgICAgICAgICAgICBDR0Zsb2F0IHdpZHRoID0gd2Q7CisgICAg ICAgICAgICAgIHJbaV0uc2l6ZS53aWR0aCAtPSB3aWR0aDsKKyAgICAgICAgICAgICAgcltpXS5v cmlnaW4ueCArPSB3aWR0aDsKKyAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocltpXSk7CisgICAg ICAgICAgICAgIC8qIERyYXcgb3ZlcmxpbmluZywgZXRjLiBvbiB0aGUgY3Vyc29yLiAqLworICAg ICAgICAgICAgICBpZiAocy0+dy0+cGh5c19jdXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9YKQor ICAgICAgICAgICAgICAgIG1jX25zX2RyYXdfdGV4dF9kZWNvcmF0aW9uIChzLCBmYWNlLCBiZ0Nv bCwgd2lkdGgsIHgpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIG1j X25zX2RyYXdfdGV4dF9kZWNvcmF0aW9uIChzLCBmYWNlLCBmZ0NvbCwgd2lkdGgsIHgpOworICAg ICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgLy8gIGludCByeCA9 IHJbaV0ub3JpZ2luLng7CisgIC8vICBpbnQgcnkgPSByW2ldLm9yaWdpbi55OworICAvLyAgaW50 IHJ3ID0gcltpXS5zaXplLndpZHRoOworICAvLyAgaW50IHJoID0gcltpXS5zaXplLmhlaWdodDsK KyAgLy8gIGZwcmludGYgKHN0ZGVyciwgIm1jX25zX2R1bXBnbHlwaHNfc3RyZXRjaDogIHZwb3Mg KCVkKSB8IHJ4ICglZCkgfCByeSAoJWQpIHwgcncgKCVkKSB8IHJoICglZClcbiIsCisgIC8vICAg ICAgICAgICAgICAgICAgIHMtPmZpcnN0X2dseXBoLT52cG9zLCByeCwgcnksIHJ3LCByaCk7Cisg ICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHJbaV0pOworICAgICAgICAgICAgfQorICAgICAgICAg IC8qIERyYXcgb3ZlcmxpbmluZywgZXRjLiBvbiB0aGUgc3RyZXRjaCBnbHlwaCAob3IgdGhlIHBh cnQKKyAgICAgICAgICAgICBvZiB0aGUgc3RyZXRjaCBnbHlwaCBhZnRlciB0aGUgY3Vyc29yKS4g Ki8KKyAgICAgICAgICBtY19uc19kcmF3X3RleHRfZGVjb3JhdGlvbiAocywgZmFjZSwgZmdDb2ws IHJbaV0uc2l6ZS53aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg cltpXS5vcmlnaW4ueCk7CisgICAgICAgIH0KKyAgICAgIGlmICgocy0+bGVmdF9vdmVyd3JpdHRl bl9wIHx8IHMtPnJpZ2h0X292ZXJ3cml0dGVuX3ApCisgICAgICAgICAgJiYgKHMtPmFjdGlvbl90 eXBlID09IE1DX0RSQVdfR0xZUEhfU1RSSU5HfHwgcy0+YWN0aW9uX3R5cGUgPT0gTUNfRVJBU0Vf R0xZUEhfU1RSSU5HKSkKKyAgICAgICAgbWNfbnNfZHJhd19vdmVyd3JpdHRlbiAocywgbWF0cml4 LCByb3csIHMtPmZpcnN0X2dseXBoKTsKKyAgICAgIG5zX3Jlc2V0X2NsaXBwaW5nIChzLT5mKTsK KyAgICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSAxOworICAgIH0KK30KKworc3RhdGljIHZv aWQKK21jX25zX2R1bXBnbHlwaHNfaW1hZ2UgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMsIE5TUmVj dCByLCBzdHJ1Y3QgbWNfUkdCIGxzbCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGVudW0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laWdodCA+IHMtPnNsaWNlLmhlaWdodCB8fCBzLT5p bWctPmhtYXJnaW4gfHwgcy0+aW1nLT52bWFyZ2luCisgICAgICB8fCBzLT5pbWctPm1hc2sgfHwg cy0+aW1nLT5waXhtYXAgPT0gMCB8fCBzLT53aWR0aCAhPSBzLT5iYWNrZ3JvdW5kX3dpZHRoKQor ICAgIHsKKyAgICAgIGJyID0gTlNNYWtlUmVjdCAoYmdfeCwgYmdfeSwgcy0+YmFja2dyb3VuZF93 aWR0aCwgYmdfaGVpZ2h0KTsKKyAgICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSAxOworICAg IH0KKyAgICBlbHNlCisgICAgICBiciA9IE5TTWFrZVJlY3QgKHgsIHksIHMtPnNsaWNlLndpZHRo LCBzLT5zbGljZS5oZWlnaHQpOworICBOU1JlY3RGaWxsIChicik7CisgIC8qIERyYXcgdGhlIGlt YWdlLi4gZG8gd2UgbmVlZCB0byBkcmF3IHBsYWNlaG9sZGVyIGlmIGltZyA9PW5pbD8gKi8KKyAg aWYgKGltZyAhPSBuaWwpCisgICAgeworI2lmZGVmIE5TX0lNUExfQ09DT0EKKyAgICAgIE5TUmVj dCBkciA9IE5TTWFrZVJlY3QgKHgsIHksIHMtPnNsaWNlLndpZHRoLCBzLT5zbGljZS5oZWlnaHQp OworICAgICAgTlNSZWN0IGlyID0gTlNNYWtlUmVjdCAocy0+c2xpY2UueCwgcy0+c2xpY2UueSwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLndpZHRoLCBzLT5zbGljZS5o ZWlnaHQpOworICAgICAgW2ltZyBkcmF3SW5SZWN0OiBkcgorICAgICAgICAgICAgIGZyb21SZWN0 OiBpcgorICAgICAgICAgICAgIG9wZXJhdGlvbjogTlNDb21wb3NpdGVTb3VyY2VPdmVyCisgICAg ICAgICAgICAgIGZyYWN0aW9uOiAxLjAKKyAgICAgICAgICAgcmVzcGVjdEZsaXBwZWQ6IFlFUwor ICAgICAg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HMtPmYpOworICAvKiBEcmF3 IHVuZGVybGluZSwgb3ZlcmxpbmUsIHN0cmlrZS10aHJvdWdoLiAqLworICBtY19uc19kcmF3X3Rl eHRfZGVjb3JhdGlvbiAocywgZmFjZSwgdGRDb2wsIGJyLnNpemUud2lkdGgsIGJyLm9yaWdpbi54 KTsKKyAgLyogRHJhdyByZWxpZWYsIGlmIHJlcXVlc3RlZCAqLworICBpZiAocy0+aW1nLT5yZWxp ZWYgfHwgcy0+aGwgPT1EUkFXX0lNQUdFX1JBSVNFRCB8fCBzLT5obCA9PURSQVdfSU1BR0VfU1VO S0VOKQorICAgIHsKKyAgICAgIGlmIChzLT5obCA9PSBEUkFXX0lNQUdFX1NVTktFTiB8fCBzLT5o bCA9PSBEUkFXX0lNQUdFX1JBSVNFRCkKKyAgICAgICAgeworICAgICAgICAgIHRoID0gdG9vbF9i YXJfYnV0dG9uX3JlbGllZiA+PSAwID8KKyAgICAgICAgICAgIHRvb2xfYmFyX2J1dHRvbl9yZWxp ZWYgOiBERUZBVUxUX1RPT0xfQkFSX0JVVFRPTl9SRUxJRUY7CisgICAgICAgICAgcmFpc2VkX3Ag PSAocy0+aGwgPT0gRFJBV19JTUFHRV9SQUlTRUQpOworICAgICAgICB9CisgICAgICAgIGVsc2UK KyAgICAgICAgICB7CisgICAgICAgICAgICB0aCA9IGFicyAocy0+aW1nLT5yZWxpZWYpOworICAg ICAgICAgICAgcmFpc2VkX3AgPSAocy0+aW1nLT5yZWxpZWYgPiAwKTsKKyAgICAgICAgICB9Cisg ICAgICByLm9yaWdpbi54ID0geCAtIHRoOworICAgICAgci5vcmlnaW4ueSA9IHkgLSB0aDsKKyAg ICAgIHIuc2l6ZS53aWR0aCA9IHMtPnNsaWNlLndpZHRoICsgMip0aC0xOworICAgICAgci5zaXpl LmhlaWdodCA9IHMtPnNsaWNlLmhlaWdodCArIDIqdGgtMTsKKyAgICAgIG5zX2RyYXdfcmVsaWVm IChyLCB0aCwgcmFpc2VkX3AsCisgICAgICAgICAgICAgICAgICAgICAgcy0+c2xpY2UueSA9PSAw LAorICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLnkgKyBzLT5zbGljZS5oZWlnaHQgPT0g cy0+aW1nLT5oZWlnaHQsCisgICAgICAgICAgICAgICAgICAgICAgcy0+c2xpY2UueCA9PSAwLAor ICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLnggKyBzLT5zbGljZS53aWR0aCA9PSBzLT5p bWctPndpZHRoLCBzKTsKKyAgICB9CisgIC8qIElmIHRoZXJlIGlzIG5vIG1hc2ssIHRoZSBiYWNr Z3JvdW5kIHdvbid0IGJlIHNlZW4sCisgICAgIHNvIGRyYXcgYSByZWN0YW5nbGUgb24gdGhlIGlt YWdlIGZvciB0aGUgY3Vyc29yLgorICAgICBEbyB0aGlzIGZvciBhbGwgaW1hZ2VzLCBnZXR0aW5n IHRyYW5zcGFyZW5jeSByaWdodCBpcyBub3QgcmVsaWFibGUuICovCisgIGlmIChzLT5obCA9PSBE UkFXX0NVUlNPUikKKyAgICB7CisgICAgICBpbnQgdGhpY2tuZXNzID0gYWJzIChzLT5pbWctPnJl bGllZik7CisgICAgICBpZiAodGhpY2tuZXNzID09IDApIHRoaWNrbmVzcyA9IDE7CisgICAgaWYg KGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSAorICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNf R0xZUEhMRVNTKQorICAgICAgeworICAgICAgICBOU0NvbG9yICpib3JkZXJfY29sb3IgPSBbTlND b2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiBsc2wucmVkCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JlZW46IGxzbC5ncmVlbgor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBibHVlOiBsc2wuYmx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGFscGhhOiAxLjBdOworICAgICAgICBuc19kcmF3X2JveCAoYnIs IHRoaWNrbmVzcywgYm9yZGVyX2NvbG9yLCAxLCAxKTsKKyAgICAgIH0KKyAgICAgIGVsc2UKKyAg ICAgICAgbnNfZHJhd19ib3ggKGJyLCB0aGlja25lc3MsIEZSQU1FX0NVUlNPUl9DT0xPUiAocy0+ ZiksIDEsIDEpOworICAgIH0KK30KKworc3RhdGljIHZvaWQKK21jX25zX21heWJlX2R1bXBnbHlw aHNfYmFja2dyb3VuZCAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgY2hhciBmb3JjZV9wKQorewor ICBOU1RSQUNFICgibWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIik7CisgIGlmICgh cy0+YmFja2dyb3VuZF9maWxsZWRfcC8qIHx8IHMtPmhsID09IERSQVdfTU9VU0VfRkFDRSovKQor ICAgIHsKKyAgICAgIGludCBib3hfbGluZV93aWR0aCA9IG1heCAocy0+ZmFjZS0+Ym94X2xpbmVf d2lkdGgsIDApOworICAgICAgaWYgKEZPTlRfSEVJR0hUIChzLT5mb250KSA8IHMtPmhlaWdodCAt IDIgKiBib3hfbGluZV93aWR0aAorICAgICAgICAgIC8qIFdoZW4geGRpc3AuYyBpZ25vcmVzIEZP TlRfSEVJR0hULCB3ZSBjYW5ub3QgdHJ1c3QgZm9udAorICAgICAgICAgICAgIGRpbWVuc2lvbnMs IHNpbmNlIHRoZSBhY3R1YWwgZ2x5cGhzIG1pZ2h0IGJlIG11Y2gKKyAgICAgICAgICAgICBzbWFs bGVyLiAgU28gaW4gdGhhdCBjYXNlIHdlIGFsd2F5cyBjbGVhciB0aGUgcmVjdGFuZ2xlCisgICAg ICAgICAgICAgd2l0aCBiYWNrZ3JvdW5kIGNvbG9yLiAqLworICAgICAgICAgIHx8IEZPTlRfVE9P X0hJR0ggKHMtPmZvbnQpCisgICAgICAgICAgfHwgcy0+Zm9udF9ub3RfZm91bmRfcCB8fCBzLT5l eHRlbmRzX3RvX2VuZF9vZl9saW5lX3AgfHwgZm9yY2VfcCkKKyAgICAgICAgeworICAgICAgICAg IHN0cnVjdCBmYWNlICpmYWNlOworICAgICAgICAgIGlmIChzLT5obCA9PSBEUkFXX01PVVNFX0ZB Q0UpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQgKHMt PmYsIE1PVVNFX0hMX0lORk8gKHMtPmYpLT5tb3VzZV9mYWNlX2ZhY2VfaWQpOworICAgICAgICAg ICAgICBpZiAoIWZhY2UpCisgICAgICAgICAgICAgICAgZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ ZiwgTU9VU0VfRkFDRV9JRCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAg ICAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIHMtPmZpcnN0X2dseXBoLT5mYWNl X2lkKTsKKyAgICAgICAgICBpZiAoIWZhY2UtPnN0aXBwbGUpCisgICAgICAgICAgICBbKE5TX0ZB Q0VfQkFDS0dST1VORCAoZmFjZSkgIT0gMAorICAgICAgICAgICAgICA/IG5zX2xvb2t1cF9pbmRl eGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpLCBzLT5mKQorICAgICAgICAgICAg ICA6IEZSQU1FX0JBQ0tHUk9VTkRfQ09MT1IgKHMtPmYpKSBzZXRdOworICAgICAgICAgICAgZWxz ZQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RydWN0IG5zX2Rpc3BsYXlfaW5m byAqZHB5aW5mbyA9IEZSQU1FX0RJU1BMQVlfSU5GTyAocy0+Zik7CisgICAgICAgICAgICAgICAg W1tkcHlpbmZvLT5iaXRtYXBzW2ZhY2UtPnN0aXBwbGUtMV0uaW1nIHN0aXBwbGVNYXNrXSBzZXRd OworICAgICAgICAgICAgICB9CisgICAgICAgICAgaWYgKHMtPmhsICE9IERSQVdfQ1VSU09SKQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICBzLT5yZWN0YW5nbGVfbnVrZWRfcCA9IHRydWU7 CisgICAgICAgICAgICAgIE5TUmVjdCByID0gTlNNYWtlUmVjdCAocy0+eCwgcy0+eSArIGJveF9s aW5lX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+YmFja2dy b3VuZF93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPmhlaWdo dC0yKmJveF9saW5lX3dpZHRoKTsKKyAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAg ICAgICAgICB9CisgICAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IDE7CisgICAgICAg IH0KKyAgICB9Cit9CisKK3N0YXRpYyB2b2lkCittY19uc19kcmF3X2dseXBoX3N0cmluZyAoc3Ry dWN0IGdseXBoX3N0cmluZyAqcywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3Qg Z2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBs c2wsIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciwKKyAgICAgICAgICAgICAgICAgICAgICAg ICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAg ICAgIGludCB3ZCwgYm9vbCBhY3RpdmVfcCwgYm9vbCBjdXJzb3JfZ2NfcCkKKy8qIC0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tCisgICAgICBFeHRlcm5hbCAoUklGKTogTWFpbiBkcmF3LXRleHQgY2FsbC4KKyAg IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tICovCit7CisgIE5TUmVjdCByWzJdOworICBpbnQgbjsKKyAgY2hh ciBib3hfZHJhd25fcCA9IDA7CisgIHN0cnVjdCBmb250ICpmb250ID0gcy0+ZmFjZS0+Zm9udDsK KyAgaWYgKCFmb250KQorICAgIGZvbnQgPSBGUkFNRV9GT05UIChzLT5mKTsKKyAgTlNUUkFDRV9X SEVOIChOU1RSQUNFX0dST1VQX0dMWVBIUywgIm1jX25zX2RyYXdfZ2x5cGhfc3RyaW5nIik7Cisg IGlmIChzLT5uZXh0ICYmIHMtPnJpZ2h0X292ZXJoYW5nICYmICFzLT5mb3Jfb3ZlcmxhcHMpCisg ICAgeworICAgICAgaW50IHdpZHRoOworICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAqbmV4dDsK KyAgICAgIGZvciAod2lkdGggPSAwLCBuZXh0ID0gcy0+bmV4dDsKKyAgICAgICAgICAgbmV4dCAm JiB3aWR0aCA8IHMtPnJpZ2h0X292ZXJoYW5nOworICAgICAgICAgICB3aWR0aCArPSBuZXh0LT53 aWR0aCwgbmV4dCA9IG5leHQtPm5leHQpCisgICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+ dHlwZSAhPSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpZiAobmV4dC0+ Zmlyc3RfZ2x5cGgtPnR5cGUgIT0gU1RSRVRDSF9HTFlQSCkKKyAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocy0+bmV4dCwg cik7CisgICAgICAgICAgICAgICAgaWYgKCFuc19jbGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4pKQor ICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIG1jX25zX21heWJlX2R1 bXBnbHlwaHNfYmFja2dyb3VuZCAocy0+bmV4dCwgMSk7CisgICAgICAgICAgICAgICAgbnNfcmVz ZXRfY2xpcHBpbmcgKHMtPmYpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgICBtY19uc19kdW1wZ2x5cGhzX3N0cmV0Y2ggKHMtPm5leHQsIG1hdHJp eCwgcm93LCB3ZCk7CisgICAgICAgICAgICBuZXh0LT5udW1fY2xpcHMgPSAwOworICAgICAgICAg IH0KKyAgICB9CisgIGlmICghcy0+Zm9yX292ZXJsYXBzICYmIHMtPmZhY2UtPmJveCAhPSBGQUNF X05PX0JPWAorICAgICAgJiYgKHMtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAg ICAgICAgICB8fCBzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpKQorICAg IHsKKyAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgcik7CisgICAg ICBpZiAoIW5zX2NsaXBfdG9fcmVjdCAocy0+ZiwgciwgbikpCisgICAgICAgIHJldHVybjsKKyAg ICAgIG1jX25zX21heWJlX2R1bXBnbHlwaHNfYmFja2dyb3VuZCAocywgMSk7CisgICAgICBuc19k dW1wZ2x5cGhzX2JveF9vcl9yZWxpZWYgKHMpOworICAgICAgbnNfcmVzZXRfY2xpcHBpbmcgKHMt PmYpOworICAgICAgYm94X2RyYXduX3AgPSAxOworICAgIH0KKyAgc3dpdGNoIChzLT5maXJzdF9n bHlwaC0+dHlwZSkKKyAgICB7CisgICAgY2FzZSBJTUFHRV9HTFlQSDoKKyAgICAgIG4gPSBuc19n ZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgcik7CisgICAgICBpZiAoIW5zX2NsaXBfdG9f cmVjdCAocy0+ZiwgciwgbikpCisgICAgICAgIHJldHVybjsKKyAgICAgIG1jX25zX2R1bXBnbHlw aHNfaW1hZ2UgKHMsIHJbMF0sIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgYWN0aXZl X3ApOworICAgICAgbnNfcmVzZXRfY2xpcHBpbmcgKHMtPmYpOworICAgICAgYnJlYWs7CisgICAg Y2FzZSBTVFJFVENIX0dMWVBIOgorICAgICAgbWNfbnNfZHVtcGdseXBoc19zdHJldGNoIChzLCBt YXRyaXgsIHJvdywgd2QpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBDSEFSX0dMWVBIOgorICAg IGNhc2UgQ09NUE9TSVRFX0dMWVBIOgorICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xp cF9yZWN0IChzLCByKTsKKyAgICAgIGlmICghbnNfY2xpcF90b19yZWN0IChzLT5mLCByLCBuKSkK KyAgICAgICAgcmV0dXJuOworICAgICAgaWYgKHMtPmZvcl9vdmVybGFwcworICAgICAgICAgIHx8 IChzLT5jbXBfZnJvbSA+IDAKKyAgICAgICAgICAgICAgJiYgISBzLT5maXJzdF9nbHlwaC0+dS5j bXAuYXV0b21hdGljKSkKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IDE7CisgICAg ICAgIGVsc2UKKyAgICAgICAgICBtY19uc19tYXliZV9kdW1wZ2x5cGhzX2JhY2tncm91bmQgKHMs IHMtPmZpcnN0X2dseXBoLT50eXBlID09IENPTVBPU0lURV9HTFlQSCk7CisgICAgICBpbnQgZmxh Z3MgPSAocy0+aGwgPT0gRFJBV19DVVJTT1IpCisgICAgICAgICAgICAgICAgICAgID8gTlNfRFVN UEdMWVBIX0NVUlNPUgorICAgICAgICAgICAgICAgICAgOiAocy0+aGwgPT0gRFJBV19NT1VTRV9G QUNFKQorICAgICAgICAgICAgICAgICAgICA/IE5TX0RVTVBHTFlQSF9NT1VTRUZBQ0UKKyAgICAg ICAgICAgICAgICAgIDogKHMtPmZvcl9vdmVybGFwcykKKyAgICAgICAgICAgICAgICAgICAgPyBO U19EVU1QR0xZUEhfR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WNlKTsKKyAgICAg ICAgICB9CisgICAgICAgICAgZWxzZSBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IKKyAgICAgICAg ICAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YCisgICAgICAgICAgICAg ICAgICAgJiYgYWN0aXZlX3ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGVudW0gZmFj ZV9pZCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCA9CisgICAgICAgICAgICAgICAgbG9va3VwX25h bWVkX2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2 ZS1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxv d19pbmFjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBob2xsb3dfaW5hY3RpdmVfZmFj ZV9pZCk7CisgICAgICAgICAgICAgIE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSkgPSBOU19G QUNFX0ZPUkVHUk9VTkQgKGhvbGxvd19pbmFjdGl2ZV9mYWNlKTsKKyAgICAgICAgICAgIH0KKyAg ICAgIGlmIChzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpCisgICAgICAg IG5zX2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAgICAgICAg ZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgd2l0aF9iZ19wID0gKChmbGFncyA9 PSBOU19EVU1QR0xZUEhfTk9STUFMICYmICFzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgfHwgZmxhZ3MgPT0gTlNfRFVNUEdMWVBIX01PVVNFRkFD RSk7CisgICAgICAgICAgICBpZiAod2l0aF9iZ19wKQorICAgICAgICAgICAgICBzLT5iYWNrZ3Jv dW5kX251a2VkX3AgPSB0cnVlOworICAgICAgICAgICAgZm9udC0+ZHJpdmVyLT5kcmF3IChzLCBz LT5jbXBfZnJvbSwgcy0+bmNoYXJzLCBzLT54LCBzLT55YmFzZSwgd2l0aF9iZ19wKTsKKyAgICAg ICAgICB9CisgICAgICBOU0NvbG9yICpjb2wgPSAoTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNl KSAhPSAwCisgICAgICAgICAgICAgICAgICAgICA/IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChO U19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2UpLCBzLT5mKQorICAgICAgICAgICAgICAgICAgICAg OiBGUkFNRV9GT1JFR1JPVU5EX0NPTE9SIChzLT5mKSk7CisgICAgICBbY29sIHNldF07CisgICAg ICAvKiBEcmF3IHVuZGVybGluZSwgb3ZlcmxpbmUsIHN0cmlrZS10aHJvdWdoLiAqLworICAgICAg bWNfbnNfZHJhd190ZXh0X2RlY29yYXRpb24gKHMsIHMtPmZhY2UsIGNvbCwgcy0+d2lkdGgsIHMt PngpOworICAgICAgaWYgKHMtPmZpcnN0X2dseXBoLT50eXBlICE9IENPTVBPU0lURV9HTFlQSAor ICAgICAgICAgICYmIChzLT5sZWZ0X292ZXJ3cml0dGVuX3AgfHwgcy0+cmlnaHRfb3ZlcndyaXR0 ZW5fcCkKKyAgICAgICAgICAmJiAocy0+YmFja2dyb3VuZF9udWtlZF9wIHx8IHMtPnJlY3Rhbmds ZV9udWtlZF9wKQorICAgICAgICAgICYmIChzLT5hY3Rpb25fdHlwZSA9PSBNQ19EUkFXX0dMWVBI X1NUUklOR3x8IHMtPmFjdGlvbl90eXBlID09IE1DX0VSQVNFX0dMWVBIX1NUUklORykpCisgICAg ICAgIG1jX25zX2RyYXdfb3ZlcndyaXR0ZW4gKHMsIG1hdHJpeCwgcm93LCBzLT5maXJzdF9nbHlw aCk7CisgICAgICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IKKyAgICAgICAgICAmJiBjdXJzb3Jf dHlwZSA9PSBNQ19GSUxMRURfQk9YKQorICAgICAgICB7CisgICAgICAgICAgdW5zaWduZWQgbG9u ZyB0bXAgPSBOU19GQUNFX0JBQ0tHUk9VTkQgKHMtPmZhY2UpOworICAgICAgICAgIE5TX0ZBQ0Vf QkFDS0dST1VORCAocy0+ZmFjZSkgPSBOU19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2UpOworICAg ICAgICAgIE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSkgPSB0bXA7CisgICAgICAgIH0KKyAg ICAgICAgZWxzZSBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IKKyAgICAgICAgICAgICAgICAgJiYg Y3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWCkKKyAgICAgICAgICBOU19GQUNFX0ZPUkVHUk9V TkQgKHMtPmZhY2UpID0gc2F2ZWRfZmc7CisgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7 CisgICAgICBicmVhazsKKyAgICBjYXNlIEdMWVBITEVTU19HTFlQSDoKKyAgICAgIG4gPSBuc19n ZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgcik7CisgICAgICBpZiAoIW5zX2NsaXBfdG9f cmVjdCAocy0+ZiwgciwgbikpCisgICAgICAgIHJldHVybjsKKyAgICAgIGlmIChzLT5mb3Jfb3Zl cmxhcHMKKyAgICAgICAgICB8fCAocy0+Y21wX2Zyb20gPiAwCisgICAgICAgICAgICAgICYmICEg cy0+Zmlyc3RfZ2x5cGgtPnUuY21wLmF1dG9tYXRpYykpCisgICAgICAgIHMtPmJhY2tncm91bmRf ZmlsbGVkX3AgPSAxOworICAgICAgZWxzZQorICAgICAgICBtY19uc19tYXliZV9kdW1wZ2x5cGhz X2JhY2tncm91bmQgKHMsIHMtPmZpcnN0X2dseXBoLT50eXBlID09IENPTVBPU0lURV9HTFlQSCk7 CisgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICBicmVhazsKKyAgICBkZWZh dWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7CisgICAgfQorICAvKiBEcmF3IGJveCBpZiBub3Qg ZG9uZSBhbHJlYWR5LiAqLworICBpZiAoIXMtPmZvcl9vdmVybGFwcworICAgICAgJiYgIWJveF9k cmF3bl9wCisgICAgICAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gpCisgICAgeworICAg ICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAgICAgIGlmICgh bnNfY2xpcF90b19yZWN0IChzLT5mLCByLCBuKSkKKyAgICAgICAgcmV0dXJuOworICAgICAgbnNf ZHVtcGdseXBoc19ib3hfb3JfcmVsaWVmIChzKTsKKyAgICAgIG5zX3Jlc2V0X2NsaXBwaW5nIChz LT5mKTsKKyAgICB9CisgIHMtPm51bV9jbGlwcyA9IDA7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1D VVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiA9PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PQogCiAgICBOU1RSQUNFLCBUcmFjZSBzdXBwb3J0LgpAQCAtMTEwOSw2ICsyMDgyLDE2IEBA IHN0YXRpYyBOU1JlY3QgY29uc3RyYWluX2ZyYW1lX3JlY3QoTlNSZWN0IGZyYW1lUmVjdCwgYm9v bCBpc0Z1bGxzY3JlZW4pCiAgICBleHRlcm5hbCAoUklGKSBjYWxsOyB3aG9sZSBmcmFtZSwgY2Fs bGVkIGJlZm9yZSB1cGRhdGVfd2luZG93X2JlZ2luCiAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLwog eworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLwor CisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gZjsKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogI2lmZGVmIE5TX0lNUExfQ09DT0EKICAgRW1hY3NWaWV3ICp2aWV3ID0gRlJBTUVfTlNf VklFVyAoZik7CiAKQEAgLTEyMDksNiArMjE5MiwxNiBAQCBzdGF0aWMgTlNSZWN0IGNvbnN0cmFp bl9mcmFtZV9yZWN0KE5TUmVjdCBmcmFtZVJlY3QsIGJvb2wgaXNGdWxsc2NyZWVuKQogCiAvKiAg IGlmIChmID09IE1PVVNFX0hMX0lORk8gKGYpLT5tb3VzZV9mYWNlX21vdXNlX2ZyYW1lKSAqLwog ICBNT1VTRV9ITF9JTkZPIChmKS0+bW91c2VfZmFjZV9kZWZlciA9IDA7CisKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRp bmdfZnJhbWUgPSBOVUxMOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiB9CiAKIApA QCAtNDgwMyw2ICs1Nzk2LDE3IEBAIGluIGNlcnRhaW4gc2l0dWF0aW9ucyAocmFwaWQgaW5jb21p bmcgZXZlbnRzKS4KICAgICAgIGJhciA9IFtbRW1hY3NTY3JvbGxlciBhbGxvY10gaW5pdEZyYW1l OiByIHdpbmRvdzogd2luXTsKICAgICAgIHdzZXRfdmVydGljYWxfc2Nyb2xsX2JhciAod2luZG93 LCBtYWtlX21pbnRfcHRyIChiYXIpKTsKICAgICAgIHVwZGF0ZV9wID0gWUVTOworCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICAvKiBU aGlzIGlzIG9ubHkgZm9yIGRlYnVnZ2luZyBwdXJwb3Nlcy4gKi8KKyAgICAgIFtiYXIgbWNfc2V0 X3JlY3RhbmdsZTogcl07CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICB9CiAg IGVsc2UKICAgICB7CkBAIC00ODEwLDEyICs1ODE0LDMwIEBAIGluIGNlcnRhaW4gc2l0dWF0aW9u cyAocmFwaWQgaW5jb21pbmcgZXZlbnRzKS4KICAgICAgIGJhciA9IFhOU19TQ1JPTExfQkFSICh3 aW5kb3ctPnZlcnRpY2FsX3Njcm9sbF9iYXIpOwogICAgICAgb2xkUmVjdCA9IFtiYXIgZnJhbWVd OwogICAgICAgci5zaXplLndpZHRoID0gb2xkUmVjdC5zaXplLndpZHRoOworCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCiAgICAgICBpZiAoRlJB TUVfTElWRV9QIChmKSAmJiAhTlNFcXVhbFJlY3RzIChvbGRSZWN0LCByKSkKICAgICAgICAgewor ICAgICAgICAgIC8qIFRoZSBtYWluIHdpbmRvdyBoYXMgcHJvYmFibHkgYmVlbiByZXNpemVkLiAg R3JhY2lvdXNseSBkZWxldGUgdGhlCisgICAgICAgICAgb2xkIHNjcm9sbCBiYXIgd2l0aG91dCBy ZXBhaW50aW5nIGl0cyByZWN0YW5nbGU7IGFuZCwgY3JlYXRlIGEgbmV3CisgICAgICAgICAgc2Ny b2xsIGJhciBlbHNld2hlcmUuKi8KICAgICAgICAgICBpZiAob2xkUmVjdC5vcmlnaW4ueCAhPSBy Lm9yaWdpbi54KQorICAgICAgICAgICAgewogICAgICAgICAgICAgICBuc19jbGVhcl9mcmFtZV9h cmVhIChmLCBsZWZ0LCB0b3AsIHdpZHRoLCBoZWlnaHQpOworICAgICAgICAgICAgICBbYmFyIG1j X2p1ZGdlXTsKKyAgICAgICAgICAgICAgYmFyID0gW1tFbWFjc1Njcm9sbGVyIGFsbG9jXSBpbml0 RnJhbWU6IHIgd2luZG93OiB3aW5dOworICAgICAgICAgICAgICB3c2V0X3ZlcnRpY2FsX3Njcm9s bF9iYXIgKHdpbmRvdywgbWFrZV9taW50X3B0ciAoYmFyKSk7CisgICAgICAgICAgICB9CisgICAg ICAgICAgICBlbHNlCiAgICAgICAgICAgW2JhciBzZXRGcmFtZTogcl07CiAgICAgICAgIH0KKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgIH0KIAogICBpZiAodXBkYXRlX3ApCkBA IC00OTc1LDkgKzU5OTcsNTcgQEAgaW4gY2VydGFpbiBzaXR1YXRpb25zIChyYXBpZCBpbmNvbWlu ZyBldmVudHMpLgogICAgIHsKICAgICAgIHZpZXcgPSBbc3Vidmlld3Mgb2JqZWN0QXRJbmRleDog aV07CiAgICAgICBpZiAoIVt2aWV3IGlzS2luZE9mQ2xhc3M6IFtFbWFjc1Njcm9sbGVyIGNsYXNz XV0pIGNvbnRpbnVlOwotICAgICAgaWYgKFt2aWV3IGp1ZGdlXSkKKworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAvKiBgWFNFVFdJTkRPVycg d2lsbCBzb21ldGltZXMgY2F1c2UgRW1hY3MgdG8gY3Jhc2ggd2hlbiBydW5uaW5nIHVuZGVyIGdk YiBldmVuCisgIHRob3VnaCAodyAhPSBOVUxMKS4gIFRoZXJlZm9yZSwgd2UgY2Fubm90IHJlbGlh Ymx5IHVzZSBgV0lORE9XX0xJVkVfUCcuICovCisgIHN0cnVjdCB3aW5kb3cgKncgPSBbdmlldyBt Y19nZXRfd2luZG93XTsKKyAgaWYgKHcgIT0gTlVMTAorICAgICAgJiYgTklMUCAody0+Y29udGVu dHMpKQorICAgIHsKKyAgICAgIEJPT0wgZGVidWdfcCA9IGZhbHNlOworICAgICAgaWYgKGRlYnVn X3AKKyAgICAgICAgICAvKiBgd2luZG93X2JveCcgY2FsbHMgYHdpbmRvd19ib3hfaGVpZ2h0Jywg d2hpY2ggd2lsbCBjYXVzZSBFbWFjcyB0bworICAgICAgICAgIGNyYXNoIGlmIEZSQU1FUCAody0+ ZnJhbWUpIGlzIG5vdCBzYXRpc2ZpZWQuICovCisgICAgICAgICAgJiYgRlJBTUVQICh3LT5mcmFt ZSkpCisgICAgICAgIHsKKyAgICAgICAgICBOU1JlY3QgcjAgPSBbdmlldyBtY19nZXRfcmVjdGFu Z2xlXTsKKyAgICAgICAgICBpbnQgeDAgPSBOU01pblggKHIwKTsKKyAgICAgICAgICBpbnQgeTAg PSBOU01pblkgKHIwKTsKKyAgICAgICAgICBpbnQgd2QwID0gTlNXaWR0aCAocjApOworICAgICAg ICAgIGludCBoMCA9IE5TSGVpZ2h0IChyMCk7CisgICAgICAgICAgaW50IHdpbmRvd195LCB3aW5k b3dfaGVpZ2h0OworICAgICAgICAgIHdpbmRvd19ib3ggKHcsIEFOWV9BUkVBLCAwLCAmd2luZG93 X3ksIDAsICZ3aW5kb3dfaGVpZ2h0KTsKKyAgICAgICAgICBpbnQgdG9wID0gd2luZG93X3k7Cisg ICAgICAgICAgaW50IGhlaWdodCA9IHdpbmRvd19oZWlnaHQ7CisgICAgICAgICAgaW50IHdpZHRo ID0gV0lORE9XX0NPTkZJR19TQ1JPTExfQkFSX0NPTFMgKHcpICogRlJBTUVfQ09MVU1OX1dJRFRI IChmKTsKKyAgICAgICAgICBpbnQgbGVmdCA9IFdJTkRPV19TQ1JPTExfQkFSX0FSRUFfWCAodyk7 CisgICAgICAgICAgTlNSZWN0IHIxID0gTlNNYWtlUmVjdCAobGVmdCwgdG9wLCB3aWR0aCwgaGVp Z2h0KTsKKyAgICAgICAgICAvKiBUaGUgcGFyZW50IHZpZXcgaXMgZmxpcHBlZCwgc28gd2UgbmVl ZCB0byBmbGlwIHkgdmFsdWUuICovCisgICAgICAgICAgRW1hY3NWaWV3ICpmcmFtZV92aWV3ID0g RlJBTUVfTlNfVklFVyAoZik7CisgICAgICAgICAgTlNSZWN0IHYgPSBbZnJhbWVfdmlldyBmcmFt ZV07CisgICAgICAgICAgcjEub3JpZ2luLnkgPSAodi5zaXplLmhlaWdodCAtIHIxLnNpemUuaGVp Z2h0IC0gcjEub3JpZ2luLnkpOworICAgICAgICAgIGludCB4MSA9IE5TTWluWCAocjEpOworICAg ICAgICAgIGludCB5MSA9IE5TTWluWSAocjEpOworICAgICAgICAgIGludCB3ZDEgPSBOU1dpZHRo IChyMSk7CisgICAgICAgICAgaW50IGgxID0gTlNIZWlnaHQgKHIxKTsKKyAgICAgICAgICBmcHJp bnRmIChzdGRlcnIsICIlcyAtLSBERUFEOlxuXAorICAgICAgICAgIHgwL3gxICglZC8lZCkgfCB5 MC95MSAoJWQvJWQpIHwgd2QwL3dkMSAoJWQvJWQpIHwgaDAvaDEgKCVkLyVkKVxuIiwKKyAgICAg ICAgICBtY193aW5kb3cgKHcpLCB4MCwgeDEsIHkwLCB5MSwgd2QwLCB3ZDEsIGgwLCBoMSk7Cisg ICAgICAgIH0KKyAgICAgIGlmIChbdmlldyBtY19qdWRnZV0pCiAgICAgICAgIHJlbW92ZWQgPSBZ RVM7CiAgICAgfQorICAgIGVsc2UgaWYgKFt2aWV3IGp1ZGdlXSkKKyAgICAgIHJlbW92ZWQgPSBZ RVM7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKKyAgICB9CiAKICAgaWYgKHJlbW92 ZWQpCiAgICAgW2V2aWV3IHVwZGF0ZUZyYW1lU2l6ZTogTk9dOwpAQCAtNTEwNiw2ICs2MTc2LDIw IEBAIHN0YXRpYyBMaXNwX09iamVjdCBuc19zdHJpbmdfdG9fbGlzcG1vZCAoY29uc3QgY2hhciAq cykKIGV4dGVybiBmcmFtZV9wYXJtX2hhbmRsZXIgbnNfZnJhbWVfcGFybV9oYW5kbGVyc1tdOwog c3RhdGljIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlIG5zX3JlZGlzcGxheV9pbnRlcmZhY2Ug PQogeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAq LworCisvKiBgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYG5zdGVybS5tYCBtdXN0IGJlIGluIHRo ZSBleGFjdCBzYW1lIG9yZGVyIGFzIHRoZQorYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGBkaXNw ZXh0ZXJuLmhgISAqLworCisgIG1jX25zX2RyYXdfd2luZG93X2N1cnNvciwKKyAgbWNfbnNfZHJh d19nbHlwaF9zdHJpbmcsCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgbnNfZnJh bWVfcGFybV9oYW5kbGVycywKICAgeF9wcm9kdWNlX2dseXBocywKICAgeF93cml0ZV9nbHlwaHMs CkBAIC04NzIxLDYgKzk4MDUsNDkgQEAgLSAoQk9PTCljYW5CZWNvbWVNYWluV2luZG93CiAKIEBp bXBsZW1lbnRhdGlvbiBFbWFjc1Njcm9sbGVyCiAKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy0gKHZvaWQpbWNfc2V0X3JlY3RhbmdsZTogKE5T UmVjdClyZWN0Cit7CisgIG1jX3JlY3RhbmdsZSA9IHJlY3Q7Cit9CisKKy0gKE5TUmVjdCltY19n ZXRfcmVjdGFuZ2xlCit7CisgIHJldHVybiBtY19yZWN0YW5nbGU7Cit9CisKKy0gKHN0cnVjdCB3 aW5kb3cgKiltY19nZXRfd2luZG93Cit7CisgIHJldHVybiB3aW5kb3c7Cit9CisKKy0gKGJvb2wp bWNfanVkZ2UKK3sKKyAgTlNUUkFDRSAoIltFbWFjc1Njcm9sbGVyIG1jX2p1ZGdlXSIpOworICBi b29sIHJldCA9IGNvbmRlbW5lZDsKKyAgYmxvY2tfaW5wdXQgKCk7CisgIGlmIChjb25kZW1uZWQp CisgICAgeworICAgICAgLyogZW5zdXJlIG90aGVyIHNjcm9sbGJhciB1cGRhdGVzIGFmdGVyIGRl bGV0aW9uICovCisgICAgICBFbWFjc1ZpZXcgKnZpZXcgPSAoRW1hY3NWaWV3ICopRlJBTUVfTlNf VklFVyAoZnJhbWUpOworICAgICAgaWYgKHZpZXcgIT0gbmlsKQorICAgICAgICB2aWV3LT5zY3Jv bGxiYXJzTmVlZGluZ1VwZGF0ZSsrOworICAgIH0KKyAgaWYgKHdpbmRvdykKKyAgICB3c2V0X3Zl cnRpY2FsX3Njcm9sbF9iYXIgKHdpbmRvdywgUW5pbCk7CisgIHdpbmRvdyA9IDA7CisgIFtzZ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hsID09IERSQVdfQ1VSU09SCisgICAgICAmJiAheF9z dHJldGNoX2N1cnNvcl9wKQorICAgIHsKKyAgICAgIC8qIElmIGB4LXN0cmV0Y2gtY3Vyc29yJyBp cyBuaWwsIGRvbid0IGRyYXcgYSBibG9jayBjdXJzb3IgYXMKKyAgIHdpZGUgYXMgdGhlIHN0cmV0 Y2ggZ2x5cGguICAqLworICAgICAgaW50IHdpZHRoLCBiYWNrZ3JvdW5kX3dpZHRoID0gcy0+YmFj a2dyb3VuZF93aWR0aDsKKyAgICAgIGludCB4ID0gcy0+eDsKKyAgICAgIGlmICghcy0+cm93LT5y ZXZlcnNlZF9wKQorICAgICAgICB7CisgICAgICAgICAgaW50IGxlZnRfeCA9IHdpbmRvd19ib3hf bGVmdF9vZmZzZXQgKHMtPncsIFRFWFRfQVJFQSk7CisgICAgICAgICAgaWYgKHggPCBsZWZ0X3gp CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGJhY2tncm91bmRfd2lkdGggLT0gbGVmdF94 IC0geDsKKyAgICAgICAgICAgICAgeCA9IGxlZnRfeDsKKyAgICAgICAgICAgIH0KKyAgICAgICAg fQorICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgIC8qIEluIFIyTCByb3dzLCBkcmF3 IHRoZSBjdXJzb3Igb24gdGhlIHJpZ2h0IGVkZ2Ugb2YgdGhlCisgICAgICAgICAgICAgc3RyZXRj aCBnbHlwaC4gICovCisgICAgICAgICAgaW50IHJpZ2h0X3ggPSB3aW5kb3dfYm94X3JpZ2h0IChz LT53LCBURVhUX0FSRUEpOworICAgICAgICAgIGlmICh4ICsgYmFja2dyb3VuZF93aWR0aCA+IHJp Z2h0X3gpCisgICAgICAgICAgICBiYWNrZ3JvdW5kX3dpZHRoIC09IHggLSByaWdodF94OworICAg ICAgICAgIHggKz0gYmFja2dyb3VuZF93aWR0aDsKKyAgICAgICAgfQorICAgICAgd2lkdGggPSBt aW4gKEZSQU1FX0NPTFVNTl9XSURUSCAocy0+ZiksIGJhY2tncm91bmRfd2lkdGgpOworICAgICAg aWYgKHMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAgICAgICAgeCAtPSB3aWR0aDsKKyAgICAgIC8qIERy YXcgY3Vyc29yLiAgKi8KKyAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmdfcmVjdCAocywgeCwg cy0+eSwgd2lkdGgsIHMtPmhlaWdodCk7CisgICAgICAvKiBDbGVhciByZXN0IHVzaW5nIHRoZSBH QyBvZiB0aGUgb3JpZ2luYWwgbm9uLWN1cnNvciBmYWNlLiAgKi8KKyAgICAgIGlmICh3aWR0aCA8 IGJhY2tncm91bmRfd2lkdGgpCisgICAgICAgIHsKKyAgICAgICAgICBYR0NWYWx1ZXMgKmdjID0g cy0+ZmFjZS0+Z2M7CisgICAgICAgICAgaW50IHkgPSBzLT55OworICAgICAgICAgIGludCB3ID0g YmFja2dyb3VuZF93aWR0aCAtIHdpZHRoLCBoID0gcy0+aGVpZ2h0OworICAgICAgICAgIFJFQ1Qg cjsKKyAgICAgICAgICAgICAgICBIREMgaGRjID0gcy0+aGRjOworICAgICAgICAgIGlmICghcy0+ cm93LT5yZXZlcnNlZF9wKQorICAgICAgICAgICAgeCArPSB3aWR0aDsKKyAgICAgICAgICBlbHNl CisgICAgICAgICAgICB4ID0gcy0+eDsKKyAgICAgICAgICBpZiAocy0+cm93LT5tb3VzZV9mYWNl X3AKKyAgICAgICAgICAgICAgJiYgY3Vyc29yX2luX21vdXNlX2ZhY2VfcCAocy0+dykpCisgICAg ICAgICAgICB7CisgICAgICAgICAgICAgIHhfc2V0X21vdXNlX2ZhY2VfZ2MgKHMpOworICAgICAg ICAgICAgICBnYyA9IHMtPmdjOworICAgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgIGdjID0gcy0+ZmFjZS0+Z2M7CisgICAgICAgICAgZ2V0X2dseXBoX3N0cmluZ19jbGlw X3JlY3QgKHMsICZyKTsKKyAgICAgICAgICB3Mz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N1cnNvcl9jb2xvciA9IGZh Y2UtPmZvcmVncm91bmQ7CisgICAgICBpbnQgZGVmYXVsdF9meCA9IFdJTkRPV19URVhUX1RPX0ZS QU1FX1BJWEVMX1ggKHcsIHgpOworICAgICAgaGRjID0gZ2V0X2ZyYW1lX2RjIChmKTsKKyAgICAg IHczMl9jbGlwX3RvX3JvdyAodywgcm93LCBURVhUX0FSRUEsIGhkYyk7CisgICAgICBpbnQgcngg PSBmeDsKKyAgICAgIGludCByeSA9IGZ5OworICAgICAgaW50IHJ3ID0gd2Q7CisgICAgICBpbnQg cmggPSBoOworLyoKKyAgICBmcHJpbnRmIChzdGRlcnIsICJNQ19IQkFSOiAgZnggKCVkKSB8IGZ5 ICglZCkgfCB3ZCAoJWQpIHwgaCAoJWQpXG4iLCByeCwgcnksIHJ3LCByaCk7CisqLworICAgICAg dzMyX2ZpbGxfYXJlYSAoZiwgaGRjLCBjdXJzb3JfY29sb3IsIHJ4LCByeSwgcncsIHJoKTsKKyAg ICAgIHczMl9zZXRfY2xpcF9yZWN0YW5nbGUgKGhkYywgTlVMTCk7CisgICAgICByZWxlYXNlX2Zy YW1lX2RjIChmLCBoZGMpOworICAgIH0KK30KKworLyogUklGOiBEcmF3IG9yIGNsZWFyIGN1cnNv ciBvbiB3aW5kb3cgVy4gICovCitzdGF0aWMgdm9pZAorbWNfdzMyX2RyYXdfd2luZG93X2N1cnNv ciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3Qg Z2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICBpbnQgeCwgaW50IGZ4LCBpbnQgeSwg aW50IGZ5LCBpbnQgaHBvcywgaW50IHZwb3MsIGludCB3ZCwgaW50IGgsCisgICAgICAgICAgICAg ICAgICBzdHJ1Y3QgbWNfUkdCIGxzbCwgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSwK KyAgICAgICAgICAgICAgICAgIG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IVCAodyk7CisgICAg ICAgICAgdzMyX3N5c3RlbV9jYXJldF9tb2RlX2hlaWdodCA9IFdJTkRPV19NT0RFX0xJTkVfSEVJ R0hUICh3KTsKKyAgICAgICAgICBQb3N0TWVzc2FnZSAoaHduZCwgV01fSU1FX1NUQVJUQ09NUE9T SVRJT04sIDAsIDApOworICAgICAgICAgIC8qIElmIHRoZSBzaXplIG9mIHRoZSBhY3RpdmUgY3Vy c29yIGNoYW5nZWQsIGRlc3Ryb3kgdGhlIG9sZAorICAgICAgICAgICAgIHN5c3RlbSBjYXJldC4g ICovCisgICAgICAgICAgaWYgKHczMl9zeXN0ZW1fY2FyZXRfaHduZAorICAgICAgICAgICAgICAm JiAodzMyX3N5c3RlbV9jYXJldF9oZWlnaHQgIT0gaCkpCisgICAgICAgICAgICBQb3N0TWVzc2Fn ZSAoaHduZCwgV01fRU1BQ1NfREVTVFJPWV9DQVJFVCwgMCwgMCk7CisgICAgICAgICAgdzMyX3N5 c3RlbV9jYXJldF9oZWlnaHQgPSBoOworICAgICAgICAgIC8qIE1vdmUgdGhlIHN5c3RlbSBjYXJl dC4gICovCisgICAgICAgICAgUG9zdE1lc3NhZ2UgKGh3bmQsIFdNX0VNQUNTX1RSQUNLX0NBUkVU LCAwLCAwKTsKKyAgICAgICAgfQorICAgICAgLyogVGhlIGZyaW5nZSBiaXRtYXBzIGFyZSBwcmVz ZW50bHkgaGFuZGxlZCBlbHNld2hlcmUsIGJ1dCBjb3VsZCBzb21lZGF5CisgICAgICBiZSBtYW5h Z2VkIChpbiBwYXJ0KSBhdCB0aGlzIHNlY3Rpb24gb2YgY29kZS4gKi8KKyAgICAgIGlmIChyb3ct PmV4YWN0X3dpbmRvd193aWR0aF9saW5lX3AKKyAgICAgICAgICAmJiAocm93LT5yZXZlcnNlZF9w CisgICAgICAgICAgICAgPyAoaHBvcyA8IDApCisgICAgICAgICAgICAgOiAoaHBvcyA+PSByb3ct PnVzZWRbVEVYVF9BUkVBXSkpKQorICAgICAgIC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Ag ICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNr IGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcuICAqLworICAgICAgICAgIGYtPm91 dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gY29sb3JfcGl4ZWw7CisgICAgICAgICAgbWNf dzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBv cywgdnBvcywgd2QsIGgpOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3Bp eGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYg KGN1cnNvcl9nbHlwaC0+dHlwZSA9PSBJTUFHRV9HTFlQSCAmJiBsc2wucmVkID49IDAgJiYgbHNs LmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAgICB7CisgICAgICAgICAgICAv KiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4g ICovCisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9y X3BpeGVsOworICAgICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4 LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgICAgZi0+ b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7Cisg ICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg LyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPm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gICAg ICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IGhvbGxvd19hY3RpdmVfcmVnaW9uX2VuZF9mYWNlLT5i YWNrZ3JvdW5kOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgZWxzZSBp ZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVf cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID4g cmVnaW9uX2JlZworICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5j aGFycG9zIDwgcmVnaW9uX2VuZCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2Vf aWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29y LWluLXJlZ2lvbi1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICBz dHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNlID0gRkFDRV9GUk9N X0lEIChmLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2VfaWQpOworICAgICAgICAg ICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBf bmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNl IiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0 aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAg ICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2Zh Y2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91 bmQgPSBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2UtPmZvcmVncm91bmQ7CisgICAg ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoYWN0aXZlX3Ap CisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBm YWNlX2lkIGhvbGxvd19hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBp bnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAg ICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9G Uk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICAg ICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7 CisgICAgICAgICAgICAgICAgICAgICAgICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IGhvbGxvd19h Y3RpdmVfZmFjZS0+YmFja2dyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgICAgICAgICAgZWxzZSBpZiAoIWFjdGl2ZV9wKQorICAgICAgICAgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0 aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW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YXRhLnczMi0+Y3Vyc29yX2djID0gb3JpZ2luYWxfY3Vyc29yX2dj OworICAgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgICAgICAgICBtY193MzJf ZHJhd19ob2xsb3dfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2 cG9zLCB3ZCwgaCk7CisgICAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2Fz ZSBNQ19IT0xMT1dfQk9YOgorICAgIHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdy ZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBv cmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwnLiAgKi8KKyAg ICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOwor ICAgICAgICAgIG1jX3czMl9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBm eCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53 MzItPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAg ICAgICBlbHNlCisgICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4 LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgYnJlYWs7Cisg ICAgfQorICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+ PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAg ICAgICAvKiBU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91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djID0g b3JpZ2luYWxfY3Vyc29yX2djOworICAgICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAg IH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgY3Vyc29yX2dj X3AgPSBmYWxzZTsKKyAgICAgICAgICAgIG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgs IHJvdywgRFJBV19DVVJTT1IsIHgsIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgbHNsLCBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3As CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX2djX3ApOworICAgICAg ICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0JBUjoKKyAgICB7CisgICAg ICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisg ICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRh LnczMi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5j dXJzb3JfcGl4ZWwgPSBjb2xvcl9waXhlbDsKKyAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZp c2libGVfb2theV9wID0gdHJ1ZTsKKyAgICAgICAgICBtY193MzJfZHJhd19iYXJfY3Vyc29yICh3 LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0JBUiwgY3Vyc29yX2dj X2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29y X3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UK KyAgICAgICAgICB7CisgICAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9w ID0gZmFsc2U7CisgICAgICAgICAgICBtY193MzJfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgs IHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGgsIGN1cnNvcl93aWR0aCwgTUNfQkFSLCBjdXJzb3JfZ2NfaW52aXNp YmxlX29rYXlfcCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2Ug TUNfSEJBUjoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAw ICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBo aWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4gICovCisgICAgICAgICAg Zi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBjb2xvcl9waXhlbDsKKyAgICAgICAg ICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gdHJ1ZTsKKyAgICAgICAgICBtY193 MzJfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2 cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lk dGgsIE1DX0hCQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICBmLT5v dXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAg ICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJz b3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNfdzMyX2RyYXdf YmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2Qs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1D X0hCQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICB9CisgICAgICBi cmVhazsKKyAgICB9CisgICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOworICB9Cisg ICAgfQorfQorCisvKiBEcmF3IGdseXBoIHN0cmluZyBTLiAgKi8KK3N0YXRpYyB2b2lkCittY193 MzJfZHJhd19nbHlwaF9zdHJpbmcgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMsIHN0cnVjdCBnbHlw aF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAgICAg ICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbCwgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9y LAorICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90 eXBlLCBpbnQgY3Vyc29yX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGFj dGl2ZV9wLCBib29sIGN1cnNvcl9nY19wKQoreworICBib29sIHJlbGllZl9kcmF3bl9wID0gMDsK KyAgLyogSWYgUyBkcmF3cyBpbnRvIHRoZSBiYWNrZ3JvdW5kIG9mIGl0cyBzdWNjZXNzb3IsIGRy YXcgdGhlCisgICAgIGJhY2tncm91bmQgb2YgdGhlIHN1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SB0 cnVlOworICAgICAgZWxzZQorICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQg KHMsIHRydWUpOworICAgICAgeF9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3Vu ZCAocyk7CisgICAgICBicmVhazsKKyAgICBjYXNlIEdMWVBITEVTU19HTFlQSDoKKyAgICAgIGlm IChzLT5mb3Jfb3ZlcmxhcHMpCisgICAgICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVl OworICAgICAgZWxzZQorICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKHMs IGZhbHNlKTsKKyAgICAgIHhfZHJhd19nbHlwaGxlc3NfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQg KHMpOworICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOwor ICAgIH0KKyAgaWYgKCFzLT5mb3Jfb3ZlcmxhcHMpCisgICAgeworICAgICAgLyogRHJhdyB1bmRl cmxpbmUuICAqLworICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9wKQorICAgICAgICB7Cisg ICAgICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfV0FWRSkK KyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgQ09MT1JSRUYgY29sb3I7CisgICAgICAgICAg ICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICAgICAg Y29sb3IgPSBzLT5nYy0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAg ICAgICAgIGNvbG9yID0gcy0+ZmFjZS0+dW5kZXJsaW5lX2NvbG9yOworICAgICAgICAgICAgICB3 MzJfZHJhd191bmRlcndhdmUgKHMsIGNvbG9yKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBl bHNlIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAg ICAgICAgICB7CisgICAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgdGhpY2tuZXNzLCBwb3NpdGlv bjsKKyAgICAgICAgICAgICAgaW50IHk7CisgICAgICAgICAgICAgIGlmIChzLT5wcmV2ICYmIHMt PnByZXYtPmZhY2UtPnVuZGVybGluZV9wCisgICAgICAgICAgICAgICAgICAmJiBzLT5wcmV2LT5m YWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgLyogV2UgdXNlIHRoZSBzYW1lIHVuZGVybGluZSBzdHlsZSBh cyB0aGUgcHJldmlvdXMgb25lLiAgKi8KKyAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMt PnByZXYtPnVuZGVybGluZV90aGlja25lc3M7CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9 IHMtPnByZXYtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBHZXQg dGhlIHVuZGVybGluZSB0aGlja25lc3MuICBEZWZhdWx0IGlzIDEgcGl4ZWwuICAqLworICAgICAg ICAgICAgICAgICAgaWYgKHMtPmZvbnQgJiYgcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzcyA+ IDApCisgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPmZvbnQtPnVuZGVybGluZV90 aGlja25lc3M7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHRo aWNrbmVzcyA9IDE7CisgICAgICAgICAgICAgICAgICBpZiAoeF91bmRlcmxpbmVfYXRfZGVzY2Vu dF9saW5lKQorICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5oZWlnaHQgLSB0aGlj a25lc3MpIC0gKHMtPnliYXNlIC0gcy0+eSk7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAg ICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVy bGluZSBwb3NpdGlvbi4gIFRoaXMgaXMgdGhlIHJlY29tbWVuZGVkCisgICAgICAgICAgICAgICAg ICAgICAgICAgdmVydGljYWwgb2Zmc2V0IGluIHBpeGVscyBmcm9tIHRoZSBiYXNlbGluZSB0byB0 aGUgdG9wIG9mCisgICAgICAgICAgICAgICAgICAgICAgICAgdGhlIHVuZGVybGluZS4gIFRoaXMg aXMgYSBzaWduZWQgdmFsdWUgYWNjb3JkaW5nIHRvIHRoZQorICAgICAgICAgICAgICAgICAgICAg ICAgIHNwZWNzLCBhbmQgaXRzIGRlZmF1bHQgaXMKKyAgICAgICAgICAgICAgICAgICAgICAgICBS T1VORCAoKG1heGltdW1fZGVzY2VudCkgLyAyKSwgd2l0aAorICAgICAgICAgICAgICAgICAgICAg ICAgIFJPVU5EICh4KSA9IGZsb29yICh4ICsgMC41KSAgKi8KKyAgICAgICAgICAgICAgICAgICAg ICBpZiAoeF91c2VfdW5kZXJsaW5lX3Bvc2l0aW9uX3Byb3BlcnRpZXMKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgcy0+Zm9udCAmJiBzLT5mb250LT51bmRlcmxpbmVfcG9zaXRpb24gPj0g MCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gcy0+Zm9udC0+dW5kZXJsaW5l X3Bvc2l0aW9uOworICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHMtPmZvbnQpCisgICAg ICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5mb250LT5kZXNjZW50ICsgMSkgLyAy OworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IG1h eCAocG9zaXRpb24sIHVuZGVybGluZV9taW5pbXVtX29mZnNldCk7CisgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgICAvKiBDaGVjayB0aGUgc2FuaXR5IG9mIHRoaWNrbmVzcyBhbmQgcG9z aXRpb24uICBXZSBzaG91bGQKKyAgICAgICAgICAgICAgICAgYXZvaWQgZHJhd2luZyB1bmRlcmxp bmUgb3V0IG9mIHRoZSBjdXJyZW50IGxpbmUgYXJlYS4gICovCisgICAgICAgICAgICAgIGlmIChz LT55ICsgcy0+aGVpZ2h0IDw9IHMtPnliYXNlICsgcG9zaXRpb24pCisgICAgICAgICAgICAgICAg cG9zaXRpb24gPSAocy0+aGVpZ2h0IC0gMSkgLSAocy0+eWJhc2UgLSBzLT55KTsKKyAgICAgICAg ICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQgPCBzLT55YmFzZSArIHBvc2l0aW9uICsgdGhpY2tu ZXNzKQorICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IChzLT55ICsgcy0+aGVpZ2h0KSAtIChz LT55YmFzZSArIHBvc2l0aW9uKTsKKyAgICAgICAgICAgICAgcy0+dW5kZXJsaW5lX3RoaWNrbmVz cyA9IHRoaWNrbmVzczsKKyAgICAgICAgICAgICAgcy0+dW5kZXJsaW5lX3Bvc2l0aW9uID1wb3Np dGlvbjsKKyAgICAgICAgICAgICAgeSA9IHMtPnliYXNlICsgcG9zaXRpb247CisgICAgICAgICAg ICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICAgICAg dzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5nYy0+Zm9yZWdyb3VuZCwgcy0+eCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5LCBzLT53aWR0aCwgMSk7CisgICAgICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMt PmZhY2UtPnVuZGVybGluZV9jb2xvciwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICB5LCBzLT53aWR0aCwgMSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIC8q IERyYXcgb3ZlcmxpbmUuICAqLworICAgICAgaWYgKHMtPmZhY2UtPm92ZXJsaW5lX3ApCisgICAg ICAgIHsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIGR5ID0gMCwgaCA9IDE7CisgICAgICAgICAg aWYgKHMtPmZhY2UtPm92ZXJsaW5lX2NvbG9yX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgdzMy X2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5nYy0+Zm9yZWdyb3VuZCwgcy0+eCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgIHMtPnkgKyBkeSwgcy0+d2lkdGgsIGgpOworICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmZh Y2UtPm92ZXJsaW5lX2NvbG9yLCBzLT54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBz LT55ICsgZHksIHMtPndpZHRoLCBoKTsKKyAgICAgICAgfQorICAgICAgLyogRHJhdyBzdHJpa2Ut dGhyb3VnaC4gICovCisgICAgICBpZiAocy0+ZmFjZS0+c3RyaWtlX3Rocm91Z2hfcAorICAgICAg ICAgICYmICFGT05UX1RFWFRNRVRSSUMgKHMtPmZvbnQpLnRtU3RydWNrT3V0KQorICAgICAgICB7 CisgICAgICAgICAgdW5zaWduZWQgbG9uZyBoID0gMTsKKyAgICAgICAgICB1bnNpZ25lZCBsb25n IGR5ID0gKHMtPmhlaWdodCAtIGgpIC8gMjsKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+c3RyaWtl X3Rocm91Z2hfY29sb3JfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChz LT5mLCBzLT5oZGMsIHMtPmdjLT5mb3JlZ3JvdW5kLCBzLT54LCBzLT55ICsgZHksCisgICAgICAg ICAgICAgICAgICAgICAgICAgICBzLT53aWR0aCwgaCk7CisgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5mYWNlLT5zdHJpa2VfdGhyb3Vn aF9jb2xvciwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPnkgKyBkeSwgcy0+ d2lkdGgsIGgpOworICAgICAgICB9CisgICAgICAvKiBEcmF3IHJlbGllZiBpZiBub3QgeWV0IGRy YXduLiAgKi8KKyAgICAgIGlmICghcmVsaWVmX2RyYXduX3AgJiYgcy0+ZmFjZS0+Ym94ICE9IEZB Q0VfTk9fQk9YKQorICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JveCAocyk7CisgICAgICBp ZiAocy0+cHJldikKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBnbHlwaF9zdHJpbmcgKnBy ZXY7CisgICAgICAgICAgZm9yIChwcmV2ID0gcy0+cHJldjsgcHJldjsgcHJldiA9IHByZXYtPnBy ZXYpCisgICAgICAgICAgICBpZiAocHJldi0+aGwgIT0gcy0+aGwKKyAgICAgICAgICAgICAgICAm JiBwcmV2LT54ICsgcHJldi0+d2lkdGggKyBwcmV2LT5yaWdodF9vdmVyaGFuZyA+IHMtPngpCisg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBBcyBwcmV2IHdhcyBkcmF3biB3aGls ZSBjbGlwcGVkIHRvIGl0cyBvd24gYXJlYSwgd2UKKyAgICAgICAgICAgICAgICAgICBtdXN0IGRy YXcgdGhlIHJpZ2h0X292ZXJoYW5nIHBhcnQgdXNpbmcgcy0+aGwgbm93LiAgKi8KKyAgICAgICAg ICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2Ugc2F2ZSA9IHByZXYtPmhsOworICAgICAgICAg ICAgICAgIHByZXYtPmhsID0gcy0+aGw7CisgICAgICAgICAgICAgICAgbWNfdzMyX3NldF9nbHlw aF9zdHJpbmdfZ2MgKHByZXYsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICAgICAgICB4X3NldF9n bHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywgcHJldik7CisgICAgICAgICAgICAgICAg aWYgKHByZXYtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgpCisgICAgICAgICAgICAg ICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHByZXYpOworICAgICAgICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIHhfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5n X2ZvcmVncm91bmQgKHByZXYpOworICAgICAgICAgICAgICAgIHczMl9zZXRfY2xpcF9yZWN0YW5n bGUgKHByZXYtPmhkYywgTlVMTCk7CisgICAgICAgICAgICAgICAgcHJldi0+aGwgPSBzYXZlOwor ICAgICAgICAgICAgICAgIHByZXYtPm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgICAgIH0KKyAg ICAgICAgfQorICAgICAgaWYgKHMtPm5leHQpCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3Qg Z2x5cGhfc3RyaW5nICpuZXh0OworICAgICAgICAgIGZvciAobmV4dCA9IHMtPm5leHQ7IG5leHQ7 IG5leHQgPSBuZXh0LT5uZXh0KQorICAgICAgICAgICAgaWYgKG5leHQtPmhsICE9IHMtPmhsCisg ICAgICAgICAgICAgICAgJiYgbmV4dC0+eCAtIG5leHQtPmxlZnRfb3ZlcmhhbmcgPCBzLT54ICsg cy0+d2lkdGgpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBBcyBuZXh0IHdp bGwgYmUgZHJhd24gd2hpbGUgY2xpcHBlZCB0byBpdHMgb3duIGFyZWEsCisgICAgICAgICAgICAg ICAgICAgd2UgbXVzdCBkcmF3IHRoZSBsZWZ0X292ZXJoYW5nIHBhcnQgdXNpbmcgcy0+aGwgbm93 LiAgKi8KKyAgICAgICAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2Ugc2F2ZSA9IG5leHQt PmhsOworICAgICAgICAgICAgICAgIG5leHQtPmhsID0gcy0+aGw7CisgICAgICAgICAgICAgICAg bWNfdzMyX3NldF9nbHlwaF9zdHJpbmdfZ2MgKG5leHQsIGN1cnNvcl9nY19wKTsKKyAgICAgICAg ICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywgbmV4dCk7Cisg ICAgICAgICAgICAgICAgaWYgKG5leHQtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgp CisgICAgICAgICAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5leHQp OworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIHhfZHJhd19jb21wb3Np dGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5leHQpOworICAgICAgICAgICAgICAgIHczMl9z ZXRfY2xpcF9yZWN0YW5nbGUgKG5leHQtPmhkYywgTlVMTCk7CisgICAgICAgICAgICAgICAgbmV4 dC0+aGwgPSBzYXZlOworICAgICAgICAgICAgICAgIG5leHQtPm51bV9jbGlwcyA9IDA7CisgICAg ICAgICAgICAgICAgbmV4dC0+Y2xpcF9oZWFkID0gcy0+bmV4dDsKKyAgICAgICAgICAgICAgfQor ICAgICAgICB9CisgICAgfQorICAvKiBSZXNldCBjbGlwcGluZy4gICovCisgIHczMl9zZXRfY2xp cF9yZWN0YW5nbGUgKHMtPmhkYywgTlVMTCk7CisgIHMtPm51bV9jbGlwcyA9IDA7Cit9CisKKy8q IGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAv KiBGcmluZ2UgYml0bWFwcy4gICovCiAKIHN0YXRpYyBpbnQgbWF4X2ZyaW5nZV9ibXAgPSAwOwpA QCAtNTQ1LDYgKzE0MTcsMTUgQEAgeF91cGRhdGVfYmVnaW4gKHN0cnVjdCBmcmFtZSAqZikKICAg aWYgKCEgRlJBTUVfVzMyX1AgKGYpKQogICAgIHJldHVybjsKIAorCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGluZ19mcmFt ZSA9IGY7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogUmVnZW5lcmF0ZSBk aXNwbGF5IHBhbGV0dGUgYmVmb3JlIGRyYXdpbmcgaWYgbGlzdCBvZiByZXF1ZXN0ZWQKICAgICAg Y29sb3JzIGhhcyBjaGFuZ2VkLiAqLwogICBpZiAoZGlzcGxheV9pbmZvLT5yZWdlbl9wYWxldHRl KQpAQCAtNzU0LDYgKzE2MzUsMTYgQEAgeF91cGRhdGVfZW5kIChzdHJ1Y3QgZnJhbWUgKmYpCiAK ICAgLyogTW91c2UgaGlnaGxpZ2h0IG1heSBiZSBkaXNwbGF5ZWQgYWdhaW4uICAqLwogICBNT1VT RV9ITF9JTkZPIChmKS0+bW91c2VfZmFjZV9kZWZlciA9IGZhbHNlOworCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5n X2ZyYW1lID0gTlVMTDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAKQEAg LTQwNDEsMTMgKzQ5MzIsNzQgQEAgdzMyX3NldF92ZXJ0aWNhbF9zY3JvbGxfYmFyIChzdHJ1Y3Qg d2luZG93ICp3LAogCSAgICAgIHJlbGVhc2VfZnJhbWVfZGMgKGYsIGhkYyk7CiAJICAgICAgeF9j bGVhcl91bmRlcl9pbnRlcm5hbF9ib3JkZXIgKGYpOwogCSAgICB9CisKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIFJFUEFJTlRJ TkcgV0hFTiBSRU1PVklORyBTQ1JPTEwgQkFSOgorCistIFNlcXVlbmNlIG9mIEV2ZW50czoKKwor ICAuIGByZWRpc3BsYXlfaW50ZXJuYWwnIGNhbGxzIHRoZSBgY29uZGVtbl9zY3JvbGxfYmFyc19o b29rJywgd2hpY2ggbWFya3MgYWxsCisgICAgc2Nyb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qKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwogCiAJICBzaS5jYlNpemUgPSBzaXpl b2YgKHNpKTsKIAkgIHNpLmZNYXNrID0gU0lGX1JBTkdFOwpAQCAtNDMxNiw2ICs1MjY4LDIxIEBA IHczMl9qdWRnZV9zY3JvbGxfYmFycyAoc3RydWN0IGZyYW1lICpmKQogICAgIHsKICAgICAgIHN0 cnVjdCBzY3JvbGxfYmFyICpiID0gWFNDUk9MTF9CQVIgKGJhcik7CiAKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIC8qIGBEZXN0cm95 V2luZG93JyB3aXRoaW4gYHhfc2Nyb2xsX2Jhcl9yZW1vdmUnIHJlcGFpbnRzIHRoZSByZWN0YW5n bGUuCisgICAgICBUaGVyZWZvcmUsIHdlIGZpcnN0IHNlbmQgYSBtZXNzYWdlIHRvIGluaGliaXQg cmVwYWludGluZy4gKi8KKyAgICAgIGlmICghV0lORE9XX0xJVkVfUCAoYi0+d2luZG93KSkKKyAg ICAgICAgeworICAgICAgICAgIEhXTkQgaHduZCA9IFNDUk9MTF9CQVJfVzMyX1dJTkRPVyAoYik7 CisgICAgICAgICAgU2VuZE1lc3NhZ2UgKGh3bmQsIFdNX1NFVFJFRFJBVywgZmFsc2UsIDApOwor ICAgICAgICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIHhfc2Nyb2xs X2Jhcl9yZW1vdmUgKGIpOwogCiAgICAgICBuZXh0ID0gYi0+bmV4dDsKQEAgLTcwOTEsNiArODA1 OCwyMCBAQCBleHRlcm4gZnJhbWVfcGFybV9oYW5kbGVyIHczMl9mcmFtZV9wYXJtX2hhbmRsZXJz W107CiAKIHN0YXRpYyBzdHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFjZSB3MzJfcmVkaXNwbGF5X2lu dGVyZmFjZSA9CiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1D VVJTT1JTICovCisKKy8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgdzMydGVybS5jYCBtdXN0 IGJlIGluIHRoZSBleGFjdCBzYW1lIG9yZGVyIGFzIHRoZQorYHJlZGlzcGxheV9pbnRlcmZhY2Un IGluIGBkaXNwZXh0ZXJuLmhgISAqLworCisgIG1jX3czMl9kcmF3X3dpbmRvd19jdXJzb3IsCisg IG1jX3czMl9kcmF3X2dseXBoX3N0cmluZywKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisK KwogICB3MzJfZnJhbWVfcGFybV9oYW5kbGVycywKICAgeF9wcm9kdWNlX2dseXBocywKICAgeF93 cml0ZV9nbHlwaHMsCmRpZmYgLS1naXQgYS9zcmMvd2luZG93LmggYi9zcmMvd2luZG93LmgKaW5k ZXggZmRlZjQwNy4uMmIwYjliNCAxMDA2NDQKLS0tIGEvc3JjL3dpbmRvdy5oCisrKyBiL3NyYy93 aW5kb3cuaApAQCAtMzI0LDYgKzMyNCwxNDcgQEAgc3RydWN0IHdpbmRvdwogCiAjaWZkZWYgSEFW RV9XSU5ET1dfU1lTVEVNCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBN VUxUSVBMRS1DVVJTT1JTICovCisKKy8qIFN1ZmZpeGVzIGZvciB0aGUgYG1jYCB3aW5kb3cgcG9p bnRlciBwcmVmaXguICovCitzdHJ1Y3QgbXVsdGlwbGVfY3Vyc29ycworeworICAvKiBUaGUgcmVj b3JkZWQgcGl4ZWwgd2lkdGggb2YgdGhlIGxhc3QgbGluZSBudW1iZXIgZHJhd24gZHVyaW5nIHJl ZGlzcGxheSAqLworICBpbnQgbG51bV9waXhlbF93aWR0aDsKK30gbWM7CisKK3N0cnVjdCBtY19t YXRyaXgKK3sKKyAgcHRyZGlmZl90IHZwb3NfYWxsb2NhdGVkOworICBwdHJkaWZmX3QgdnBvc191 c2VkOworICBwdHJkaWZmX3QgY3Vyc29yc191c2VkWzRdOworICBlbnVtIG1jX2NhY2hlX3R5cGUK KyAgeworICAgIE1DX0NBQ0hFLAorICAgIENIX0NBQ0hFLAorICAgIEZDX0NBQ0hFLAorICAgIE5P X0NBQ0hFCisgIH0gY2FjaGVfdHlwZTsKKyAgc3RydWN0IG1jX3Zwb3MKKyAgeworICAgIHB0cmRp ZmZfdCBjYWNoZV9hbGxvY2F0ZWRbNF07CisgICAgcHRyZGlmZl90IGNhY2hlX3VzZWRbNF07Cisg ICAgc3RydWN0IG1jX2NvbnRlbnRzCisgICAgeworICAgICAgYm9vbF9iZiBzYW1lX3AgOiAxOwor ICAgICAgc3RydWN0IGdseXBoIGdseXBoOworICAgICAgaW50IHg7CisgICAgICBpbnQgZng7Cisg ICAgICBpbnQgeTsKKyAgICAgIGludCBmeTsKKyAgICAgIGludCBocG9zOworICAgICAgaW50IHZw b3M7CisgICAgICBpbnQgd2Q7CisgICAgICBpbnQgaDsKKyAgICAgIGVudW0gbWNfY3Vyc29yX3R5 cGUKKyAgICAgIHsKKyAgICAgICAgLyogTk9URTogIFRoZSBmcmluZ2UgYml0bWFwIGZyYW1ld29y ayByZWxpZXMgdXBvbiBNQ19OT19GUklOR0VfQklUTUFQCisgICAgICAgIGhhdmluZyBhIHZhbHVl IG9mIHplcm8gKDApLiAqLworICAgICAgICBNQ19OT19GUklOR0VfQklUTUFQLAorICAgICAgICBN Q19OT19DVVJTT1IsCisgICAgICAgIE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAsCisgICAgICAgIE1D X0xFRlRfRlJJTkdFX0JJVE1BUCwKKyAgICAgICAgTUNfRlJBTUVEX0JPWCwKKyAgICAgICAgTUNf RklMTEVEX0JPWCwKKyAgICAgICAgTUNfSE9MTE9XX0JPWCwKKyAgICAgICAgTUNfQkFSLAorICAg ICAgICBNQ19IQkFSCisgICAgICB9IGN1cnNvcl90eXBlOworICAgICAgaW50IGN1cnNvcl93aWR0 aDsKKyAgICAgIHN0cnVjdCBtY19SR0IKKyAgICAgIHsKKyAgICAgICAgZG91YmxlIHJlZDsKKyAg ICAgICAgZG91YmxlIGdyZWVuOworICAgICAgICBkb3VibGUgYmx1ZTsKKyAgICAgIH0gZmcsIGJn OworICAgICAgYm9vbF9iZiBhY3RpdmVfcCA6IDE7CisgICAgICBlbnVtIG1jX2ZsYXZvcgorICAg ICAgeworICAgICAgICBOT19GTEFWT1IsCisgICAgICAgIE1DX0dMWVBILAorICAgICAgICBNQ19H TFlQSExFU1MsCisgICAgICAgIE1DX09WRVJMQVlfQVJST1dfQklUTUFQLAorICAgICAgICBNQ19Q SUxDUk9XLAorICAgICAgICBNQ19IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XLAorICAgICAg ICBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XLAorICAgICAgICBNQ19I T0xMT1dfUkVDVEFOR0xFLAorICAgICAgICBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1csCisg ICAgICAgIE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVywKKyAgICAgICAgTUNf VkVSVElDQUxfQkFSLAorICAgICAgICBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIsCisgICAgICAg IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgIH0gZ2x5cGhfZmxhdm9yOworICAgICAg Ym9vbF9iZiBlbmFibGVkX3AgOiAxOworICAgIH0gKmNhY2hlWzRdOworICB9ICp2cG9zOworICAv KiBVc2VkIGVsc2V3aGVyZS4gKi8KKyAgc3RydWN0IG1jX2Vzc2VudGlhbHMKKyAgeworICAgIGVu dW0gbWNfcm93X3Bvc2l0aW9uCisgICAgeworICAgICAgUFJFX1pWLAorICAgICAgQVRfWlYsCisg ICAgICBQT1NUX1pWCisgICAgfSByb3dfcG9zaXRpb247CisgICAgYm9vbF9iZiBhY3RpdmVfcCA6 IDE7CisgICAgc3RydWN0IG1jX1JHQiBjaF9mZ1szXSwgZmNfZmdbM10sIHNwX2ZnOworICAgIGlu dCBmY194OworICAgIGludCB6djsKKyAgICBpbnQgenZfYnl0ZTsKKyAgfSBlc3NlbnRpYWxzOwor ICAvKiBVc2VkIGVsc2V3aGVyZS4gKi8KKyAgZW51bSBtY19lbmdpbmVfdHlwZQorICB7CisgICAg TVVMVElQTEVfQ1VSU09SUywKKyAgICBIT1JJWk9OVEFMX1JVTEVSLAorICAgIFZFUlRJQ0FMX1JV TEVSLAorICAgIEZJTExfQ09MVU1OLAorICAgIENVUlNPUl9JTkRJQ0FUT1IKKyAgfSBhY3Rpb25f dHlwZTsKKyAgLyogVXNlZCBlbHNld2hlcmUuICovCisgIGVudW0gbWNfcHJlX3Njcm9sbF9jbGVh bl90eXBlCisgIHsKKyAgICBUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfRE9XTiwK KyAgICBUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfVVAsCisgICAgVFJZX1dJTkRP V19JRAorICB9IG1jX3ByZV9zY3JvbGxfY2xlYW5fdHlwZV9fZnJvbV93aGVyZTsKKyAgLyogVXNl ZCBlbHNld2hlcmUuICovCisgIGVudW0gbWNfZHJhd19yb3dfdHlwZQorICB7CisgICAgTk9XSEVS RSwKKyAgICBTQ1JJQkVfT05FLAorICAgIFNDUklCRV9UV08sCisgICAgU0NSSUJFX1RIUkVFLAor ICAgIFNLSVBQRUQsCisgICAgUE9TVF9DSEFOR0VELAorICAgIFVOQ0hBTkdFRCwKKyAgICBTRVRf Q1VSU09SX09ORSwKKyAgICBTRVRfQ1VSU09SX1RXTworICB9IG1jX2RyYXdfcm93X3R5cGVfX2Zy b21fd2hlcmU7CisgIC8qIFVzZWQgZWxzZXdoZXJlLiAqLworICBlbnVtIG1jX3JlZHJhd19yb3df dHlwZQorICB7CisgICAgVVBEQVRFX1dJTkRPV19fUkVEUkFXX09WRVJMQVBQRURfUk9XUywKKyAg ICBYX0lOU0VSVF9HTFlQSFMsCisgICAgWF9GSVhfT1ZFUkxBUFBJTkdfQVJFQSwKKyAgICBEUkFX X1JPV19XSVRIX01PVVNFX0ZBQ0UsCisgICAgRVhQT1NFX0FSRUFfT05FLAorICAgIEVYUE9TRV9B UkVBX1RXTywKKyAgICBFWFBPU0VfTElORQorICB9IG1jX3JlZHJhd19yb3dfdHlwZV9fZnJvbV93 aGVyZTsKK30gbWNfbWF0cml4OworCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogICAgIC8qIEN1cnNvciB0eXBlIG9mIGxhc3QgY3Vyc29y IGRyYXduIG9uIHRoZSB3aW5kb3cuICAqLwogICAgIGVudW0gdGV4dF9jdXJzb3Jfa2luZHMgcGh5 c19jdXJzb3JfdHlwZTsKIApkaWZmIC0tZ2l0IGEvc3JjL3hkaXNwLmMgYi9zcmMveGRpc3AuYwpp bmRleCBhODhmYzY5Li5kZTY0ZjI1IDEwMDY0NAotLS0gYS9zcmMveGRpc3AuYworKysgYi9zcmMv eGRpc3AuYwpAQCAtOTIxLDYgKzkyMSw0NjQ3IEBAIHN0YXRpYyB2b2lkIHNob3dfbW91c2VfZmFj ZSAoTW91c2VfSExJbmZvICosIGVudW0gZHJhd19nbHlwaHNf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pOworICAgICAgWFNFVENEUiAodGFpbCwgZWxlbSk7CisgICAgICB0 YWlsID0gZWxlbTsKKyAgICB9CisgIHZhX2VuZCAoYXApOworICByZXR1cm4gdmFsOworfQorCitM aXNwX09iamVjdAorbWNfbWVtcSAoTGlzcF9PYmplY3QgZWx0LCBMaXNwX09iamVjdCBsaXN0KQor eworICB3aGlsZSAoMSkKKyAgICB7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KSB8fCBFUSAoWENB UiAobGlzdCksIGVsdCkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3Qp OworICAgICAgaWYgKCFDT05TUCAobGlzdCkgfHwgRVEgKFhDQVIgKGxpc3QpLCBlbHQpKQorICAg ICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlmICghQ09OU1Ag KGxpc3QpIHx8IEVRIChYQ0FSIChsaXN0KSwgZWx0KSkKKyAgICAgICAgYnJlYWs7CisgICAgICBs aXN0ID0gWENEUiAobGlzdCk7CisgICAgfQorICByZXR1cm4gbGlzdDsKK30KKworTGlzcF9PYmpl Y3QKK21jX250aCAoaW50IG51bSwgTGlzcF9PYmplY3QgbGlzdCkKK3sKKyAgZm9yIChpbnQgaSA9 IDA7IGkgPCBudW0gJiYgIU5JTFAgKGxpc3QpOyBpKyspCisgICAgbGlzdCA9IFhDRFIgKGxpc3Qp OworICBpZiAoQ09OU1AgKGxpc3QpKQorICAgIHJldHVybiBYQ0FSIChsaXN0KTsKKyAgICBlbHNl CisgICAgICByZXR1cm4gUW5pbDsKK30KKworTGlzcF9PYmplY3QKK21jX2Fzc3EgKExpc3BfT2Jq ZWN0IGtleSwgTGlzcF9PYmplY3QgbGlzdCkKK3sKKyAgd2hpbGUgKDEpCisgICAgeworICAgICAg aWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQorICAg ICAgICAgICAgICAmJiBFUSAoWENBUiAoWENBUiAobGlzdCkpLCBrZXkpKSkKKyAgICAgICAgYnJl YWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KQor ICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAgICYmIEVRIChY Q0FSIChYQ0FSIChsaXN0KSksIGtleSkpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBY Q0RSIChsaXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAgfHwgKENPTlNQ IChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgRVEgKFhDQVIgKFhDQVIgKGxpc3QpKSwg a2V5KSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgIH0K KyAgaWYgKENPTlNQIChsaXN0KSkKKyAgICByZXR1cm4gWENBUiAobGlzdCk7CisgICAgZWxzZQor ICAgICAgcmV0dXJuIFFuaWw7Cit9CisKK0xpc3BfT2JqZWN0CittY19hc3NvYyAoTGlzcF9PYmpl Y3Qga2V5LCBMaXNwX09iamVjdCBsaXN0KQoreworICBMaXNwX09iamVjdCBjYXI7CisgIHdoaWxl ICgxKQorICAgIHsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAgfHwgKENPTlNQ IChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgKGNhciA9IFhDQVIgKFhDQVIgKGxpc3Qp KSwKKyAgICAgICAgICAgICAgICAgIEVRIChjYXIsIGtleSkgfHwgIU5JTFAgKEZlcXVhbCAoY2Fy LCBrZXkpKSkpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAg ICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAgfHwgKENPTlNQIChYQ0FSIChsaXN0KSkK KyAgICAgICAgICAgICAgJiYgKG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GFpbCwgaGFsZnRh aWwpKQorICAgICAgICBicmVhazsKKyAgICB9CisgIHJldHVybiBRbmlsOworfQorCisvKiBSRUdJ T04gQkVHSU46ICBtY19yZWdpb25fbGltaXQgKDEpCisgICBSRUdJT04gRU5EOiAgbWNfcmVnaW9u X2xpbWl0ICgwKSAqLworcHRyZGlmZl90CittY19yZWdpb25fbGltaXQgKGJvb2wgYmVnaW5fcCkK K3sKKyAgaWYgKCFOSUxQIChWdHJhbnNpZW50X21hcmtfbW9kZSkKKyAgICAgICYmIE5JTFAgKFZt YXJrX2V2ZW5faWZfaW5hY3RpdmUpCisgICAgICAmJiBOSUxQIChCVkFSIChjdXJyZW50X2J1ZmZl ciwgbWFya19hY3RpdmUpKSkKKyAgICB4c2lnbmFsMCAoUW1hcmtfaW5hY3RpdmUpOworICBMaXNw X09iamVjdCBtYXJrZXIgPSBCVkFSIChjdXJyZW50X2J1ZmZlciwgbWFyayk7CisgIGludCBtID0g KFhNQVJLRVIgKG1hcmtlciktPmJ1ZmZlcikKKyAgICAgICAgICA/IFhNQVJLRVIgKG1hcmtlcikt PmNoYXJwb3MKKyAgICAgICAgICA6IC0xOworICByZXR1cm4gKG0gPT0gLTEpCisgICAgICAgICAg ID8gLTEKKyAgICAgICAgIDogKFBUIDwgbSkgPT0gYmVnaW5fcAorICAgICAgICAgICA/IFBUCisg ICAgICAgICA6IGNsaXBfdG9fYm91bmRzIChCRUdWLCBtLCBaVik7Cit9CisKKy8qIENoZWNrIHRo ZSBwcmVzZW5jZSBvZiBhIGRpc3BsYXkgcHJvcGVydHkgYW5kIGNvbXB1dGUgaXRzIHdpZHRoLgor ICAgSWYgYSBwcm9wZXJ0eSB3YXMgZm91bmQgYW5kIGl0cyB3aWR0aCB3YXMgZm91bmQgYXMgd2Vs bCwgcmV0dXJuCisgICBpdHMgd2lkdGggKD49IDApIGFuZCBzZXQgdGhlIHBvc2l0aW9uIG9mIHRo ZSBlbmQgb2YgdGhlIHByb3BlcnR5CisgICBpbiBFTkRQT1MuCisgICBPdGhlcndpc2UganVzdCBy ZXR1cm4gLTEuICovCitzdGF0aWMgaW50CittY19jaGVja19kaXNwbGF5X3dpZHRoIChwdHJkaWZm X3QgcG9zLCBwdHJkaWZmX3QgY29sLCBwdHJkaWZmX3QgKmVuZHBvcykKK3sKKyAgTGlzcF9PYmpl Y3QgdmFsLCBvdmVybGF5OworICBpZiAoQ09OU1AgKHZhbCA9IGdldF9jaGFyX3Byb3BlcnR5X2Fu ZF9vdmVybGF5CisgICAgICAgICAgICAgIChtYWtlX2ZpeG51bSAocG9zKSwgUWRpc3BsYXksIFFu aWwsICZvdmVybGF5KSkKKyAgICAgICYmIEVRIChRc3BhY2UsIFhDQVIgKHZhbCkpKQorICAgIHsg LyogRklYTUU6IFVzZSBjYWxjX3BpeGVsX3dpZHRoX29yX2hlaWdodC4gKi8KKyAgICAgIExpc3Bf T2JqZWN0IHBsaXN0ID0gWENEUiAodmFsKSwgcHJvcDsKKyAgICAgIGludCB3aWR0aCA9IC0xOwor ICAgICAgRU1BQ1NfSU5UIGFsaWduX3RvX21heCA9IChjb2wgPCBNT1NUX1BPU0lUSVZFX0ZJWE5V TSAtIElOVF9NQVgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gKEVNQUNTX0lO VCkgSU5UX01BWCArIGNvbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNT1NU X1BPU0lUSVZFX0ZJWE5VTSk7CisgICAgICBpZiAoKHByb3AgPSBtY19wbGlzdF9nZXQgKHBsaXN0 LCBRQ3dpZHRoKSwgUkFOR0VEX0ZJWE5VTVAgKDAsIHByb3AsIElOVF9NQVgpKQorICAgICAgICAg IHx8IChwcm9wID0gbWNfcGxpc3RfZ2V0IChwbGlzdCwgUUNyZWxhdGl2ZV93aWR0aCksCisgICAg ICAgICAgICAgIFJBTkdFRF9GSVhOVU1QICgwLCBwcm9wLCBJTlRfTUFYKSkpCisgICAgICAgIHdp ZHRoID0gWEZJWE5VTSAocHJvcCk7CisgICAgICAgIGVsc2UgaWYgKEZMT0FUUCAocHJvcCkgJiYg MCA8PSBYRkxPQVRfREFUQSAocHJvcCkKKyAgICAgICAgICAgICAgICAgJiYgWEZMT0FUX0RBVEEg KHByb3ApIDw9IElOVF9NQVgpCisgICAgICAgICAgd2lkdGggPSAoaW50KShYRkxPQVRfREFUQSAo cHJvcCkgKyAwLjUpOworICAgICAgICAgIGVsc2UgaWYgKChwcm9wID0gbWNfcGxpc3RfZ2V0IChw bGlzdCwgUUNhbGlnbl90byksCisgICAgICAgICAgICAgICAgICAgIFJBTkdFRF9GSVhOVU1QIChj b2wsIHByb3AsIGFsaWduX3RvX21heCkpKQorICAgICAgICAgICAgd2lkdGggPSBYRklYTlVNIChw cm9wKSAtIGNvbDsKKyAgICAgICAgICAgICAgZWxzZSBpZiAoRkxPQVRQIChwcm9wKSAmJiBjb2wg PD0gWEZMT0FUX0RBVEEgKHByb3ApCisgICAgICAgICAgICAgICAgICAgICAgICYmIChYRkxPQVRf REFUQSAocHJvcCkgPD0gYWxpZ25fdG9fbWF4KSkKKyAgICAgICAgICAgICAgICB3aWR0aCA9IChp bnQpKFhGTE9BVF9EQVRBIChwcm9wKSArIDAuNSkgLSBjb2w7CisgICAgICBpZiAod2lkdGggPj0g MCkKKyAgICAgICAgeworICAgICAgICAgIHB0cmRpZmZfdCBzdGFydDsKKyAgICAgICAgICBpZiAo T1ZFUkxBWVAgKG92ZXJsYXkpKQorICAgICAgICAgICAgKmVuZHBvcyA9IE9WRVJMQVlfUE9TSVRJ T04gKE9WRVJMQVlfRU5EIChvdmVybGF5KSk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAg ICAgIGdldF9wcm9wZXJ0eV9hbmRfcmFuZ2UgKHBvcywgUWRpc3BsYXksICZ2YWwsICZzdGFydCwg ZW5kcG9zLCBRbmlsKTsKKyAgICAgICAgICAvKiBGb3IgOnJlbGF0aXZlLXdpZHRoLCB3ZSBuZWVk IHRvIG11bHRpc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ICAgICAgaWYgKHNjYW4gIT0gb2xkX3NjYW4pCisgICAgICAgICAgICBz Y2FuX2J5dGUgPSBDSEFSX1RPX0JZVEUgKHNjYW4pOworICAgICAgICAgIGlmIChzY2FuID49IGVu ZCkKKyAgICAgICAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgfQorICAgICAgLyogVGVzdCBy ZWFjaGluZyB0aGUgZ29hbCBjb2x1bW4uICBXZSBkbyB0aGlzIGFmdGVyIHNraXBwaW5nCisgICBp bnZpc2libGUgY2hhcmFjdGVycywgc28gdGhhdCB3ZSBwdXQgcG9pbnQgYmVmb3JlIHRoZQorICAg Y2hhcmFjdGVyIG9uIHdoaWNoIHRoZSBjdXJzb3Igd2lsbCBhcHBlYXIuICovCisgICAgICBpZiAo Y29sID49IGdvYWwpCisgICAgICAgIGJyZWFrOworICAgICAgcHJldl9jb2wgPSBjb2w7CisgICAg ICB7IC8qIENoZWNrIGRpc3BsYXkgcHJvcGVydHkuICovCisgICAgICAgIHB0cmRpZmZfdCBlbmRw OworICAgICAgICBpbnQgd2lkdGggPSBtY19jaGVja19kaXNwbGF5X3dpZHRoIChzY2FuLCBjb2ws ICZlbmRwKTsKKyAgICAgICAgaWYgKHdpZHRoID49IDApCisgICAgICAgICAgeworICAgICAgICAg ICAgY29sICs9IHdpZHRoOworICAgICAgICAgICAgaWYgKGVuZHAgPiBzY2FuKSAvKiBBdm9pZCBp bmZpbml0ZSBsb29wcyB3aXRoIDAtd2lkdGggb3ZlcmxheXMuICovCisgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICBzY2FuID0gZW5kcDsKKyAgICAgICAgICAgICAgICBzY2FuX2J5dGUg PSBDSEFSX1RPX0JZVEUgKHNjYW4pOworICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAg ICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgfQorICAgICAgLyogQ2hlY2sgY29tcG9zaXRp b24gc2VxdWVuY2UuICovCisgICAgICBpZiAoY21wX2l0LmlkID49IDAKKyAgICAgICAgICB8fCAo c2NhbiA9PSBjbXBfaXQuc3RvcF9wb3MKKyAgICAgICAgICAgICAgJiYgY29tcG9zaXRpb25fcmVz ZWF0X2l0ICgmY21wX2l0LCBzY2FuLCBzY2FuX2J5dGUsIGVuZCwgdywgTlVMTCwgUW5pbCkpKQor ICAgICAgICBjb21wb3NpdGlvbl91cGRhdGVfaXQgKCZjbXBfaXQsIHNjYW4sIHNjYW5fYnl0ZSwg UW5pbCk7CisgICAgICBpZiAoY21wX2l0LmlkID49IDApCisgICAgICAgIHsKKyAgICAgICAgICBz Y2FuICs9IGNtcF9pdC5uY2hhcnM7CisgICAgICAgICAgc2Nhbl9ieXRlICs9IGNtcF9pdC5uYnl0 ZXM7CisgICAgICAgICAgaWYgKHNjYW4gPD0gZW5kKQorICAgICAgICAgICAgY29sICs9IGNtcF9p dC53aWR0aDsKKyAgICAgICAgICBpZiAoY21wX2l0LnRvID09IGNtcF9pdC5uZ2x5cGhzKQorICAg ICAgICAgICAgeworICAgICAgICAgICAgICBjbXBfaXQuaWQgPSAtMTsKKyAgICAgICAgICAgICAg Y29tcG9zaXRpb25fY29tcHV0ZV9zdG9wX3BvcyAoJmNtcF9pdCwgc2Nhbiwgc2Nhbl9ieXRlLCBl bmQsIFFuaWwpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICBjbXBfaXQuZnJvbSA9IGNtcF9pdC50bzsKKyAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAg fQorICAgICAgYyA9IEZFVENIX0JZVEUgKHNjYW5fYnl0ZSk7CisgICAgICAvKiBTZWUgaWYgdGhl cmUgaXMgYSBkaXNwbGF5IHRhYmxlIGFuZCBpdCByZWxhdGVzIHRvIHRoaXMgY2hhcmFjdGVyLiAq LworICAgICAgaWYgKGRwICE9IDAKKyAgICAgICAgICAmJiAhIChtdWx0aWJ5dGUgJiYgTEVBRElO R19DT0RFX1AgKGMpKQorICAgICAgICAgICYmIFZFQ1RPUlAgKERJU1BfQ0hBUl9WRUNUT1IgKGRw LCBjKSkpCisgICAgICAgIHsKKyAgICAgICAgICBMaXNwX09iamVjdCBjaGFydmVjOworICAgICAg ICAgIHB0cmRpZmZfdCBpLCBuOworICAgICAgICAgIC8qIFRoaXMgY2hhcmFjdGVyIGlzIGRpc3Bs YXllZCB1c2luZyBhIHZlY3RvciBvZiBnbHlwaHMuCisgICAgICAgICAgICAgVXBkYXRlIHRoZSBj b2x1bW4vcG9zaXRpb24gYmFzZWQgb24gdGhvc2UgZ2x5cGhzLiAqLworICAgICAgICAgIGNoYXJ2 ZWMgPSBESVNQX0NIQVJfVkVDVE9SIChkcCwgYyk7CisgICAgICAgICAgbiA9IEFTSVpFIChjaGFy dmVjKTsKKyAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgbjsgaSsrKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICAvKiBUaGlzIHNob3VsZCBiZSBoYW5kbGVkIHRoZSBzYW1lIGFzCisgICAg ICAgICAgICAgIG5leHRfZWxlbWVudF9mcm9tX2Rpc3BsYXlfdmVjdG9yIGRvZXMgaXQuICovCisg ICAgICAgICAgICAgIExpc3BfT2JqZWN0IGVudHJ5ID0gQVJFRiAoY2hhcnZlYywgaSk7CisgICAg ICAgICAgICAgIGlmIChHTFlQSF9DT0RFX1AgKGVudHJ5KSkKKyAgICAgICAgICAgICAgICBjID0g R0xZUEhfQ09ERV9DSEFSIChlbnRyeSk7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICBjID0gJyAnOworICAgICAgICAgICAgICBpZiAoYyA9PSAnXG4nKQorICAgICAgICAgICAg ICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgICAgICAgaWYgKGMgPT0gJ1xyJyAmJiBFUSAoQlZB UiAoY3VycmVudF9idWZmZXIsIHNlbGVjdGl2ZV9kaXNwbGF5KSwgUXQpKQorICAgICAgICAgICAg ICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgICAgICAgaWYgKGMgPT0gJ1x0JykKKyAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICBjb2wgKz0gdGFiX3dpZHRoOworICAgICAgICAg ICAgICAgICAgY29sID0gY29sIC8gdGFiX3dpZHRoICogdGFiX3dpZHRoOworICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICArK2NvbDsKKyAg ICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAg ICAgICAgLyogVGhlIGRpc3BsYXkgdGFibGUgZG9lc24ndCBhZmZlY3QgdGhpcyBjaGFyYWN0ZXI7 CisgICAgICAgICAgICAgICBpdCBkaXNwbGF5cyBhcyBpdHNlbGYuICovCisgICAgICAgICAgICBp ZiAoYyA9PSAnXG4nKQorICAgICAgICAgICAgICBnb3RvIGVuZGxvb3A7CisgICAgICAgICAgICBp ZiAoYyA9PSAnXHInICYmIEVRIChCVkFSIChjdXJyZW50X2J1ZmZlciwgc2VsZWN0aXZlX2Rpc3Bs YXkpLCBRdCkpCisgICAgICAgICAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgICAgIGlmIChj ID09ICdcdCcpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjb2wgKz0gdGFiX3dp ZHRoOworICAgICAgICAgICAgICAgIGNvbCA9IGNvbCAvIHRhYl93aWR0aCAqIHRhYl93aWR0aDsK KyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlIGlmIChtdWx0aWJ5dGUgJiYgTEVB RElOR19DT0RFX1AgKGMpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIC8q IFN0YXJ0IG9mIG11bHRpLWJ5dGUgZm9ybS4gKi8KKyAgICAgICAgICAgICAgICAgIHVuc2lnbmVk IGNoYXIgKnB0cjsKKyAgICAgICAgICAgICAgICAgIGludCBieXRlcywgd2lkdGg7CisgICAgICAg ICAgICAgICAgICBwdHIgPSBCWVRFX1BPU19BRERSIChzY2FuX2J5dGUpOworICAgICAgICAgICAg ICAgICAgTUNfTVVMVElCWVRFX0JZVEVTX1dJRFRIIChwdHIsIGRwLCBieXRlcywgd2lkdGgpOwor ICAgICAgICAgICAgICAgICAgLyogU3VidHJhY3Qgb25lIHRvIGNvbXBlbnNhdGUgZm9yIHRoZSBp bmNyZW1lbnQKKyAgICAgICAgICAgICAgICAgIHRoYXQgaXMgZ29pbmcgdG8gaGFwcGVuIGJlbG93 LiAqLworICAgICAgICAgICAgICAgICAgc2Nhbl9ieXRlICs9IGJ5dGVzIC0gMTsKKyAgICAgICAg ICAgICAgICAgIGNvbCArPSB3aWR0aDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAg ICAgZWxzZSBpZiAoY3RsX2Fycm93ICYmIChjIDwgMDQwIHx8IGMgPT0gMDE3NykpCisgICAgICAg ICAgICAgICAgICBjb2wgKz0gMjsKKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGMgPCAwNDAg fHwgYyA+PSAwMTc3KQorICAgICAgICAgICAgICAgICAgICBjb2wgKz0gNDsKKyAgICAgICAgICAg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgIGNvbCsrOworICAgICAgICAgIH0K KyAgICAgIHNjYW4rKzsKKyAgICAgIHNjYW5fYnl0ZSsrOworICAgIH0KKyBlbmRsb29wOgorICBs YXN0X2tub3duX2NvbHVtbiA9IGNvbDsKKyAgbGFzdF9rbm93bl9jb2x1bW5fcG9pbnQgPSBwdDsK KyAgbGFzdF9rbm93bl9jb2x1bW5fbW9kaWZpZWQgPSBNT0RJRkY7CisgIGlmIChnb2FsY29sKQor ICAgICpnb2FsY29sID0gY29sOworICBpZiAoZW5kcG9zKQorICAgICplbmRwb3MgPSBzY2FuOwor ICBpZiAocHJldmNvbCkKKyAgICAqcHJldmNvbCA9IHByZXZfY29sOworfQorCitwdHJkaWZmX3QK K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yIHRoYXQgYnJpbmdzIHVzIHRvIGJlZ2lu bmluZyBvZiBidWZmZXIuICovCisgICAgICAgICAgaWYgKEJFR1YgPj0gR1BUKQorICAgICAgICAg ICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGMgPSAqLS1wdHI7CisgICAgICBpZiAoZHAgJiYg VkVDVE9SUCAoRElTUF9DSEFSX1ZFQ1RPUiAoZHAsIGMpKSkKKyAgICAgICAgeworICAgICAgICAg IGNoYXJ2ZWMgPSBESVNQX0NIQVJfVkVDVE9SIChkcCwgYyk7CisgICAgICAgICAgbiA9IEFTSVpF IChjaGFydmVjKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAg ICAgICAgY2hhcnZlYyA9IFFuaWw7CisgICAgICAgICAgICBuID0gMTsKKyAgICAgICAgICB9Cisg ICAgICBmb3IgKGkgPSBuIC0gMTsgaSA+PSAwOyAtLWkpCisgICAgICAgIHsKKyAgICAgICAgICBp ZiAoVkVDVE9SUCAoY2hhcnZlYykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIC8qIFRo aXMgc2hvdWxkIGJlIGhhbmRsZWQgdGhlIHNhbWUgYXMKKyAgICAgICAgICAgbmV4dF9lbGVtZW50 X2Zyb21fZGlzcGxheV92ZWN0b3IgZG9lcyBpdC4gKi8KKyAgICAgICAgICAgICAgTGlzcF9PYmpl Y3QgZW50cnkgPSBBUkVGIChjaGFydmVjLCBpKTsKKyAgICAgICAgICAgICAgaWYgKEdMWVBIX0NP REVfUCAoZW50cnkpKQorICAgICAgICAgICAgICAgIGMgPSBHTFlQSF9DT0RFX0NIQVIgKGVudHJ5 KTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjID0gJyAnOworICAg ICAgICAgICAgfQorICAgICAgICAgIGlmIChjID49IDA0MCAmJiBjIDwgMDE3NykKKyAgICAgICAg ICAgIGNvbCsrOworICAgICAgICAgICAgZWxzZSBpZiAoYyA9PSAnXG4nCisgICAgICAgICAgICAg ICAgICAgICB8fCAoYyA9PSAnXHInCisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgRVEgKEJW QVIgKGN1cnJlbnRfYnVmZmVyLCBzZWxlY3RpdmVfZGlzcGxheSksIFF0KSkpCisgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICBwdHIrKzsKKyAgICAgICAgICAgICAgICBnb3RvIHN0YXJ0 X29mX2xpbmVfZm91bmQ7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZSBpZiAo YyA9PSAnXHQnKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGlmICh0YWJf c2VlbikKKyAgICAgICAgICAgICAgICAgICAgY29sID0gKChjb2wgKyB0YWJfd2lkdGgpIC8gdGFi X3dpZHRoKSAqIHRhYl93aWR0aDsKKyAgICAgICAgICAgICAgICAgIHBvc3RfdGFiICs9IGNvbDsK KyAgICAgICAgICAgICAgICAgIGNvbCA9IDA7CisgICAgICAgICAgICAgICAgICB0YWJfc2VlbiA9 IDE7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYgKFZFQ1RPUlAg KGNoYXJ2ZWMpKQorICAgICAgICAgICAgICAgICAgLyogV2l0aCBhIGRpc3BsYXkgdGFibGUgZW50 cnksIEMgaXMgZGlzcGxheWVkIGFzIGlzLCBhbmQKKyAgICAgICAgICAgICAgICAgICAgIG5vdCBk aXNwbGF5ZWQgYXMgXE5OTiBvciBhcyBeTi4gIElmIEMgaXMgYSBzaW5nbGUtYnl0ZQorICAgICAg ICAgICAgICAgICAgICAgY2hhcmFjdGVyLCBpdCB0YWtlcyBvbmUgY29sdW1uLiAgSWYgQyBpcyBt dWx0aS1ieXRlIGluCisgICAgICAgICAgICAgICAgICAgICBhIHVuaWJ5dGUgYnVmZmVyLCBpdCdz IHRyYW5zbGF0ZWQgdG8gdW5pYnl0ZSwgc28gaXQKKyAgICAgICAgICAgICAgICAgICAgIGFsc28g dGFrZXMgb25lIGNvbHVtbi4gKi8KKyAgICAgICAgICAgICAgICAgICsrY29sOworICAgICAgICAg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICBjb2wgKz0gKGN0bF9hcnJvdyAmJiBj IDwgMDIwMCkgPyAyIDogNDsKKyAgICAgICAgfQorICAgIH0KKyBzdGFydF9vZl9saW5lX2ZvdW5k OgorICBpZiAodGFiX3NlZW4pCisgICAgeworICAgICAgY29sID0gKChjb2wgKyB0YWJfd2lkdGgp IC8gdGFiX3dpZHRoKSAqIHRhYl93aWR0aDsKKyAgICAgIGNvbCArPSBwb3N0X3RhYjsKKyAgICB9 CisgIGxhc3Rfa25vd25fY29sdW1uID0gY29sOworICBsYXN0X2tub3duX2NvbHVtbl9wb2ludCA9 IHB0OworICBsYXN0X2tub3duX2NvbHVtbl9tb2RpZmllZCA9IE1PRElGRjsKKyAgaWYgKG9sZF9i dWZmZXIpCisgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7CisgIHJldHVybiBj b2w7Cit9CisKK0RFRlVOICgibWMtY3VycmVudC1jb2x1bW4iLCBGbWNfY3VycmVudF9jb2x1bW4s IFNtY19jdXJyZW50X2NvbHVtbiwgMiwgMiwgMCwKKyAgICAgICBkb2M6IC8qIFJldHVybiB0aGUg aG9yaXpvbnRhbCBwb3NpdGlvbiBvZiBwb2ludC4gIEJlZ2lubmluZyBvZiBsaW5lIGlzIGNvbHVt biAwLgorVGhpcyBpcyBjYWxjdWxhdGVkIGJ5IGFkZGluZyB0b2dldGhlciB0aGUgd2lkdGhzIG9m IGFsbCB0aGUgZGlzcGxheWVkCityZXByZXNlbnRhdGlvbnMgb2YgdGhlIGNoYXJhY3RlciBiZXR3 ZWVuIHRoZSBzdGFydCBvZiB0aGUgcHJldmlvdXMgbGluZQorYW5kIHBvaW50IChlLmcuLCBjb250 cm9sIGNoYXJhY3RlcnMgd2lsbCBoYXZlIGEgd2lkdGggb2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Zwcmlu MV90b19zdHJpbmcgKGZyYW1lLCBRbmlsKSk7Cit9CisKKy8qIFVTQUdFOiAgZnByaW50ZiAoc3Rk ZXJyLCAiV0lORE9XICglcykiLCBtY193aW5kb3cgKHcpKTsgKi8KK2NoYXIgKgorbWNfd2luZG93 IChzdHJ1Y3Qgd2luZG93ICp3KQoreworICBMaXNwX09iamVjdCB3aW5kb3c7CisgIFhTRVRXSU5E T1cgKHdpbmRvdywgdyk7CisgIHJldHVybiBTU0RBVEEgKEZwcmluMV90b19zdHJpbmcgKHdpbmRv dywgUW5pbCkpOworfQorCisvKiBVU0FHRTogIGZwcmludGYgKHN0ZGVyciwgIkNIQVJBQ1RFUiAo JXMpIiwgbWNfY2hhcl90b19zdHJpbmcgKGdseXBoLT51LmNoKSk7ICovCitjaGFyICoKK21jX2No YXJfdG9fc3RyaW5nIChpbnQgYXJnKQoreworICBMaXNwX09iamVjdCBjaGFyYWN0ZXIgPSAoMCA8 PSBhcmcgJiYgYXJnIDw9IE1BWF9DSEFSKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBG Y2hhcl90b19zdHJpbmcgKG1ha2VfZml4bnVtIChhcmcpKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiBRbmlsOworICBjaGFyICogcmVzdWx0ID0gKCFOSUxQIChjaGFyYWN0ZXIpCisgICAg ICAgICAgICAgICAgICAgJiYgYXJnID09IDkpCisgICAgICAgICAgICAgICAgICAgID8gIlxcdCIK KyAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAgICAg ICAgICAmJiBhcmcgPT0gMTApCisgICAgICAgICAgICAgICAgICAgID8gIlxcbiIKKyAgICAgICAg ICAgICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAgICAgICAgICAmJiBh cmcgPT0gMzIpCisgICAgICAgICAgICAgICAgICAgID8gIlxccyIKKyAgICAgICAgICAgICAgICAg IDogKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAgICAgICAgICAmJiBhcmcgIT0gOQor ICAgICAgICAgICAgICAgICAgICAgJiYgYXJnICE9IDEwCisgICAgICAgICAgICAgICAgICAgICAm JiBhcmcgIT0gMzIpCisgICAgICAgICAgICAgICAgICAgID8gU1NEQVRBIChjaGFyYWN0ZXIpCisg ICAgICAgICAgICAgICAgICA6ICJcXD8iOworICByZXR1cm4gcmVzdWx0OworfQorCitpbnQKK21j X2xpc3BfdG9fY3Vyc29yX3R5cGUgKExpc3BfT2JqZWN0IGFyZykKK3sKKyAgY2hhciAqc3RyOwor ICBpZiAoWFRZUEUgKGFyZykgPT0gTGlzcF9TdHJpbmcpCisgICAgc3RyID0gU1NEQVRBIChhcmcp OworICAgIGVsc2UgaWYgKFhUWVBFIChhcmcpID09IExpc3BfU3ltYm9sKQorICAgICAgc3RyID0g U1NEQVRBIChTWU1CT0xfTkFNRSAoYXJnKSk7CisgICAgICBlbHNlIHJldHVybiAtMTsKKyAgaWYg KCFzdHJjbXAgKHN0ciwgIm5vIikpCisgICAgcmV0dXJuIE1DX05PX0NVUlNPUjsKKyAgaWYgKCFz dHJjbXAgKHN0ciwgIm1jLWxlZnQtZnJpbmdlLWJpdG1hcCIpKQorICAgIHJldHVybiBNQ19MRUZU X0ZSSU5HRV9CSVRNQVA7CisgIGlmICghc3RyY21wIChzdHIsICJtYy1yaWdodC1mcmluZ2UtYml0 bWFwIikpCisgICAgcmV0dXJuIE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA7CisgIGlmICghc3RyY21w IChzdHIsICJib3giKSkKKyAgICByZXR1cm4gTUNfRklMTEVEX0JPWDsKKyAgaWYgKCFzdHJjbXAg KHN0ciwgImZyYW1lZCIpKQorICAgIHJldHVybiBNQ19GUkFNRURfQk9YOworICBpZiAoIXN0cmNt cCAoc3RyLCAiaG9sbG93IikpCisgICAgcmV0dXJuIE1DX0hPTExPV19CT1g7CisgIGlmICghc3Ry Y21wIChzdHIsICJiYXI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dXJuICJVTkNIQU5HRUQiOworICAgICAgY2FzZSBTRVRfQ1VSU09SX09ORTogcmV0dXJuICJT RVRfQ1VSU09SX09ORSI7CisgICAgICBjYXNlIFNFVF9DVVJTT1JfVFdPOiByZXR1cm4gIlNFVF9D VVJTT1JfVFdPIjsKKyAgICAgIGRlZmF1bHQ6CisgICAgICByZXR1cm4gIlVOS05PV04iOworICAg IH0KK30KKworLyogVVNBR0U6ICBmcHJpbnRmIChzdGRlcnIsICJGUk9NX1dIRVJFICglcykiLCBt Y19kcmF3X3Jvd190eXBlX3RvX3N0cmluZyAoYXJnKSk7ICovCitjaGFyICoKK21jX3JlZHJhd19y b3dfdHlwZV90b19zdHJpbmcgKGVudW0gbWNfcmVkcmF3X3Jvd190eXBlIGZyb21fd2hlcmUpCit7 CisgIHN3aXRjaCAoZnJvbV93aGVyZSkKKyAgICB7CisgICAgICBjYXNlIFVQREFURV9XSU5ET1df X1JFRFJBV19PVkVSTEFQUEVEX1JPV1M6IHJldHVybiAiVVBEQVRFX1dJTkRPV19fUkVEUkFXX09W RVJMQVBQRURfUk9XUyI7CisgICAgICBjYXNlIFhfSU5TRVJUX0dMWVBIUzogcmV0dXJuICJYX0lO U0VSVF9HTFlQSFMiOworICAgICAgY2FzZSBYX0ZJWF9PVkVSTEFQUElOR19BUkVBOiByZXR1cm4g IlhfRklYX09WRVJMQVBQSU5HX0FSRUEiOworICAgICAgY2FzZSBEUkFXX1JPV19XSVRIX01PVVNF X0ZBQ0U6IHJldHVybiAiRFJBV19ST1dfV0lUSF9NT1VTRV9GQUNFIjsKKyAgICAgIGNhc2UgRVhQ T1NFX0FSRUFfT05FOiByZXR1cm4gIkVYUE9TRV9BUkVBX09ORSI7CisgICAgICBjYXNlIEVYUE9T RV9BUkVBX1RXTzogcmV0dXJuICJFWFBPU0VfQVJFQV9UV08iOworICAgICAgY2FzZSBFWFBPU0Vf TElORTogcmV0dXJuICJFWFBPU0VfTElORSI7CisgICAgICBkZWZhdWx0OgorICAgICAgcmV0dXJu ICJVTktOT1dOIjsKKyAgICB9Cit9CisKK3ZvaWQKK21jX2NhY2hlX2luc3BlY3RvciAoc3RydWN0 IHdpbmRvdyAqdywgc3RydWN0IG1jX21hdHJpeCBtYXRyaXgpCit7CisgIGludCB2cG9zX2FsbG9j YXRlZCA9IHctPm1jX21hdHJpeC52cG9zX2FsbG9jYXRlZDsKKyAgaW50IHZwb3NfdXNlZCA9IHct Pm1jX21hdHJpeC52cG9zX3VzZWQ7CisgIGZwcmludGYgKHN0ZGVyciwgIiVzOiAgbWF0cml4LnZw b3NfYWxsb2NhdGVkICglZCkgfCBtYXRyaXgudnBvc191c2VkICglZClcbiIsCisgICAgICAgICAg ICAgICAgICAgbWNfd2luZG93ICh3KSwgdnBvc19hbGxvY2F0ZWQsIHZwb3NfdXNlZCk7CisgIGZv ciAoZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICBjYWNo ZV90eXBlIDwgTk9fQ0FDSEU7CisgICAgICAgKytjYWNoZV90eXBlKQorICAgIHsKKyAgICAgIGlu dCBjdXJzb3JzX3VzZWQgPSB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5cGVdOwor ICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICBtYXRyaXguY3Vyc29yc191c2VkWyVzXSAoJWQpXG4i LAorICAgICAgICAgICAgICAgICAgICAgICBtY19jYWNoZV90eXBlX3RvX3N0cmluZyAoY2FjaGVf dHlwZSksIGN1cnNvcnNfdXNlZCk7CisgICAgfQorICBmb3IgKGludCB2bnRoID0gMDsKKyAgICAg ICB2bnRoIDwgdy0+bWNfbWF0cml4LnZwb3NfdXNlZDsKKyAgICAgICArK3ZudGgpCisgICAgewor ICAgICAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOworICAg ICAgICAgICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7CisgICAgICAgICAgICsrY2FjaGVfdHlwZSkK KyAgICAgICAgeworICAgICAgICAgIGludCBjYWNoZV9hbGxvY2F0ZWQgPSB3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV07CisgICAgICAgICAgaW50IGNh Y2hlX3VzZWQgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVd OworICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgICB2bnRoICglZCkgfCBjYWNoZV9hbGxv Y2F0ZWRbJXNdICglZCkgfCBjYWNoZV91c2VkWyVzXSAoJWQpXG4iLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgdm50aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2NhY2hlX3R5 cGVfdG9fc3RyaW5nIChjYWNoZV90eXBlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGNh Y2hlX2FsbG9jYXRlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2NhY2hlX3R5cGVf dG9fc3RyaW5nIChjYWNoZV90eXBlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhY2hl X3VzZWQpOworICAgICAgICB9CisgICAgfQorfQorCit2b2lkCittY19zZXRfbHNsX2JnIChzdHJ1 Y3Qgd2luZG93ICp3LCBlbnVtIGZhY2VfaWQgZmFjZV9pZCwgc3RydWN0IG1jX1JHQiAqbHNsKQor eworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgc3RydWN0IGZhY2Ug KmZhY2U7CisgIGlmICghTklMUCAoVmZhY2VfcmVtYXBwaW5nX2FsaXN0KQorICAgICAgJiYgKGZh Y2VfaWQgPT0gREVGQVVMVF9GQUNFX0lEIC8qIFFkZWZhdWx0ICovCisgICAgICAgICAgfHwgZmFj ZV9pZCA9PSBNT0RFX0xJTkVfRkFDRV9JR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ZmlsbF9jb2x1 bW5fcAorICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChWZGlzcGxheV9saW5lX251bWJl cnMpKQorICAgICAgICAgICAgICAgICAgICAgICA/IChmaWxsX2NvbCAqIGZyYW1lX2NoYXJfd2lk dGgpICsgdy0+bWMubG51bV9waXhlbF93aWR0aCAtIGhzY2xfeAorICAgICAgICAgICAgICAgICAg ICAgOiAoZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgTklMUCAoVmRp c3BsYXlfbGluZV9udW1iZXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgPyAoZmlsbF9jb2wg KiBmcmFtZV9jaGFyX3dpZHRoKSAtIGhzY2xfeAorICAgICAgICAgICAgICAgICAgICAgOiAwOwor ICBpZiAob2xkX2J1ZmZlcikKKyAgICBzZXRfYnVmZmVyX2ludGVybmFsIChvbGRfYnVmZmVyKTsK KyAgZW51bSBmYWNlX2lkIGZpbGxfY29sdW1uX3ByZV96dl9mYWNlX2lkID0KKyAgICAoIWVzc2Vu dGlhbHMtPmFjdGl2ZV9wCisgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIGZjX2luYWN0aXZlX3dpbmRvd3MpKQorICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3 LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcs IGYsIGludGVybiAoImZjLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpCisgICAgOiAoIWVz c2VudGlhbHMtPmFjdGl2ZV9wCisgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgZmNfaW5hY3RpdmVfd2luZG93cykpCisgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhC VUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgJiYgIU5JTFAgKEJWQVIg KGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAmJiB3LT5jdXJzb3IueCA9PSBlc3NlbnRp YWxzLT5mY194KQorICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiZmMt b3BvaW50LWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpCisgICAgOiAoZXNzZW50aWFscy0+ YWN0aXZlX3AKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBj cm9zc2hhaXJzKSkKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIp KQorICAgICAgICYmIHctPmN1cnNvci54ID09IGVzc2VudGlhbHMtPmZjX3gpCisgICAgICA/IGxv b2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCJmYy1vcG9pbnQtcHJlLXp2LWZhY2UiKSwg dHJ1ZSkKKyAgICA6ICghZXNzZW50aWFscy0+YWN0aXZlX3AKKyAgICAgICAmJiAhTklMUCAoQlZB UiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY19pbmFjdGl2ZV93aW5kb3dzKSkKKyAgICAgICAm JiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAg ICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICYmIHctPmN1 cnNvci54ICE9IGVzc2VudGlhbHMtPmZjX3gpCisgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3 LCBmLCBpbnRlcm4gKCJmYy1pbmFjdGl2ZS1wcmUtenYtZmFjZSIpLCB0cnVlKQorICAgIDogKGVz c2VudGlhbHMtPmFjdGl2ZV9wCisgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAg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pCisgICAgICYmIE5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgICAgPyBsb29rdXBfbmFt ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiZmMtaW5hY3RpdmUtYXQtenYtZmFjZSIpLCB0cnVlKQor ICAgIDogKCFlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVG RkVSICh3LT5jb250ZW50cyksIGZjX2luYWN0aXZlX3dpbmRvd3MpKQorICAgICAgICYmICFOSUxQ IChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICYmICFO SUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgJiYgdy0+Y3Vyc29yLngg PT0gZXNzZW50aWFscy0+ZmNfeCkKKyAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGlu dGVybiAoImZjLW9wb2ludC1pbmFjdGl2ZS1hdC16di1mYWNlIiksIHRydWUpCisgICAgOiAoZXNz ZW50aWFscy0+YWN0aXZlX3AKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGlj YWxfcnVsZXIpKQorICAgICAgICYmIHctPmN1cnNvci54ID09IGVzc2VudGlhbHMtPmZjX3gpCisg ICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCJmYy1vcG9pbnQtYXQtenYt ZmFjZSIpLCB0cnVlKQorICAgIDogKCFlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAgICAgICYmICFO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX2luYWN0aXZlX3dpbmRvd3MpKQor ICAgICAgICYmICFOSUxQIChCVkFSIChYQ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wgY3Jvc3NoYWlycykpCisgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2Fs X3J1bGVyKSkKKyAgICAgICAmJiB3LT5jdXJzb3IueCA9PSBlc3NlbnRpYWxzLT5mY194KQorICAg ICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiZmMtb3BvaW50LXBvc3QtenYt ZmFjZSIpLCB0cnVlKQorICAgIDogKCFlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAgICAgICYmICFO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX2luYWN0aXZlX3dpbmRvd3MpKQor ICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMp KQorICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAg JiYgdy0+Y3Vyc29yLnggIT0gZXNzZW50aWFscy0+ZmNfeCkKKyAgICAgID8gbG9va3VwX25hbWVk X2ZhY2UgKHcsIGYsIGludGVybiAoImZjLWluYWN0aXZlLXBvc3QtenYtZmFjZSIpLCB0cnVlKQor ICAgIDogKGVzc2VudGlhbHMtPmFjdGl2ZV9wCisgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZG RVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIs IGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAmJiB3LT5jdXJzb3IueCAhPSBlc3NlbnRpYWxz LT5mY194KQorICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiZmMtcG9z dC16di1mYWNlIiksIHRydWUpCisgICAgOiBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJu ICgiZmMtcG9zdC16di1mYWNlIiksIHRydWUpOworICBzdHJ1Y3QgZmFjZSAq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fdmFsdWVzICh3LCBiZXlvbmRfZmlsbF9jb2xvciwgJmJleW9uZF9maWxsX2ZvcmVncm91bmQp OworICAgICAgLyogcmVkICovCisgICAgICBpZiAoKCFmaWxsX2NvbHVtbl9wCisgICAgICAgICAg ICYmIGN1cnJlbnRfY29sICUgMiAhPSAwCisgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQ UkVfWlYpCisgICAgICAgICAgfHwgKGZpbGxfY29sdW1uX3AKKyAgICAgICAgICAgICAgJiYgY3Vy cmVudF9jb2wgJSAyICE9IDAKKyAgICAgICAgICAgICAgJiYgY3VycmVudF9jb2wgPD0gZmlsbF9j b2wKKyAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVikpCisgICAgICAgIHsK KyAgICAgICAgICBsc2xfZmctPnJlZCA9IG9kZF9mb3JlZ3JvdW5kLnJlZDsKKyAgICAgICAgICBs c2xfZmctPmdyZWVuID0gb2RkX2ZvcmVncm91bmQuZ3JlZW47CisgICAgICAgICAgbHNsX2ZnLT5i bHVlID0gb2RkX2ZvcmVncm91bmQuYmx1ZTsKKyAgICAgICAgfQorICAgICAgICAvKiB5ZWxsb3cg Ki8KKyAgICAgICAgZWxzZSBpZiAoKCFmaWxsX2NvbHVtbl9wCisgICAgICAgICAgICAgICAgICAm JiBjdXJyZW50X2NvbCAlIDIgPT0gMAorICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9u ID09IFBSRV9aVikKKyAgICAgICAgICAgICAgICAgfHwgKGZpbGxfY29sdW1uX3AKKyAgICAgICAg ICAgICAgICAgICAgICYmIGN1cnJlbnRfY29sICUgMiA9PSAwCisgICAgICAgICAgICAgICAgICAg ICAmJiBjdXJyZW50X2NvbCA8PSBmaWxsX2NvbAorICAgICAgICAgICAgICAgICAgICAgJiYgcm93 X3Bvc2l0aW9uID09IFBSRV9aVikpCisgICAgICAgICAgeworICAgICAgICAgICAgbHNsX2ZnLT5y ZWQgPSBldmVuX2ZvcmVncm91bmQucmVkOworICAgICAgICAgICAgbHNsX2ZnLT5ncmVlbiA9IGV2 ZW5fZm9yZWdyb3VuZC5ncmVlbjsKKyAgICAgICAgICAgIGxzbF9mZy0+Ymx1ZSA9IGV2ZW5fZm9y ZWdyb3VuZC5ibHVlOworICAgICAgICAgIH0KKyAgICAgICAgICAvKiBncmVlbiAqLworICAgICAg ICAgIGVsc2UgaWYgKGZpbGxfY29sdW1uX3AKKyAgICAgICAgICAgICAgICAgICAmJiBjdXJyZW50 X2NvbCA+IGZpbGxfY29sCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBS RV9aVikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbHNsX2ZnLT5yZWQgPSBiZXlvbmRf ZmlsbF9mb3JlZ3JvdW5kLnJlZDsKKyAgICAgICAgICAgICAgbHNsX2ZnLT5ncmVlbiA9IGJleW9u ZF9maWxsX2ZvcmVncm91bmQuZ3JlZW47CisgICAgICAgICAgICAgIGxzbF9mZy0+Ymx1ZSA9IGJl eW9uZF9maWxsX2ZvcmVncm91bmQuYmx1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVs c2UgaWYgKHJvd19wb3NpdGlvbiA9PSBBVF9aVikKKyAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgIGxzbF9mZy0+cmVkID0gZXNzZW50aWFscy5zcF9mZy5yZWQ7CisgICAgICAgICAgICAg ICAgbHNsX2ZnLT5ncmVlbiA9IGVzc2VudGlhbHMuc3BfZmcuZ3JlZW47CisgICAgICAgICAgICAg ICAgbHNsX2ZnLT5ibHVlID0gZXNzZW50aWFscy5zcF9mZy5ibHVlOworICAgICAgICAgICAgICB9 CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBIT1JJWk9OVEFMX1JVTEVSOgorICAgIHsK KyAgICAgIGlmIChnbHlwaCAhPSBOVUxMCisgICAgICAgICAgJiYgZ2x5cGgtPnUuY2ggPT0gOTUK K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pb25dLmdyZWVuOworICAgICAgbHNsX2Zn LT5ibHVlID0gZXNzZW50aWFscy5mY19mZ1tyb3dfcG9zaXRpb25dLmJsdWU7CisgICAgICBicmVh azsKKyAgICB9CisgICAgY2FzZSBDVVJTT1JfSU5ESUNBVE9SOgorICAgIHsKKyAgICAgIHN0cnVj dCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICAgICAgZW51bSBmYWNlX2lkIGN1cnNv cl9mYWNlX2lkID0KKyAgICAgICAgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAmJiAh TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkK KyAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYpCisgICAgICAgICAgPyBsb29rdXBf bmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLXBy ZS16di1mYWNlIiksIHRydWUpCisgICAgICAgIDogKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAg ICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVikKKyAgICAgICAgICA/IGxvb2t1cF9uYW1l ZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItcHJlLXp2LWZhY2UiKSwg dHJ1ZSkKKyAgICAgICAgOiAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgJiYgIU5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaW5hY3RpdmVfd2luZG93cykpCisg ICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBBVF9aVikKKyAgICAgICAgICAgID8gbG9va3Vw X25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1h dC16di1mYWNlIiksIHRydWUpCisgICAgICAgIDogKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAg ICAgICAgJiYgcm93X3Bvc2l0aW9uID09IEFUX1pWKQorICAgICAgICAgID8gbG9va3VwX25hbWVk X2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1hdC16di1mYWNlIiksIHRy dWUpCisgICAgICAgIDogbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1m YWtlLWN1cnNvci1hdC16di1mYWNlIiksIHRydWUpOworICAgICAgc3RydWN0IGZhY2UgKmN1cnNv cl9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBjdXJzb3JfZmFjZV9pZCk7CisgICAgICBMaXNwX09i amVjdCBjdXJzb3JfY29sb3IgPSBjdXJzb3JfZmFjZS0+bGZhY2VbTEZBQ0VfRk9SRUdST1VORF9J TkRFWF07CisgICAgICBtY194d19jb2xvcl92YWx1ZXMgKHcsIGN1cnNvcl9jb2xvciwgbHNsX2Zn KTsKKyAgICAgIGJyZWFrOworICAgIH0KKyAgfQorfQorCisvKiBEcmF3IGdseXBocyBiZXR3ZWVu IFNUQVJUIGFuZCBFTkQgaW4gQVJFQSBvZiBST1cgb24gd2luZG93IFcsCisgICBzdGFydGluZyBh dCB4LXBvc2l0aW9uIFguICBYIGlzIHJlbGF0aXZlIHRvIEFSRUEgaW4gVy4gIEhMIGlzIGEKKyAg IGZhY2Utb3ZlcnJpZGUgd2l0aCB0aGUgZm9sbG93aW5nIG1lYW5pbmc6CisgICAtICBEUkFXX05P Uk1BTF9URVhUICBkcmF3IG5vcm1hbGx5CisgICAtICBEUkFXX0NVUlNPUiAgICBkcmF3IGluIGN1 cnNvciBmYWNlCisgICAtICBEUkFXX01PVVNFX0ZBQ0UgIGRyYXcgaW4gbW91c2UgZmFjZS4KKyAg IC0gIERSQVdfSU5WRVJTRV9WSURFTyAgZHJhdyBpbiBtb2RlIGxpbmUgZmFjZQorICAgLSAgRFJ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ICAgaW50IGR1bW15X3ggPSAwOworICAgICAgLyogSWYgbW91c2Ug aGlnaGxpZ2h0aW5nIGlzIG9uLCB3ZSBtYXkgbmVlZCB0byBkcmF3IGFkamFjZW50CisgICBnbHlw aHMgdXNpbmcgbW91c2UtZmFjZSBoaWdobGlnaHRpbmcuICovCisgICAgICBpZiAoYXJlYSA9PSBU RVhUX0FSRUEgJiYgcm93LT5tb3VzZV9mYWNlX3AKKyAgICAgICAgICAmJiBobGluZm8tPm1vdXNl X2ZhY2VfYmVnX3JvdyA+PSAwCisgICAgICAgICAgJiYgaGxpbmZvLT5tb3VzZV9mYWNlX2VuZF9y b3cgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIHB0cmRpZmZfdCByb3dfdnBvcyA9IE1BVFJJ WF9ST1dfVlBPUyAocm93LCB3LT5jdXJyZW50X21hdHJpeCk7CisgICAgICAgICAgaWYgKHJvd192 cG9zID49IGhsaW5mby0+bW91c2VfZmFjZV9iZWdfcm93CisgICAgICAgICAgICAgICYmIHJvd192 cG9zIDw9IGhsaW5mby0+bW91c2VfZmFjZV9lbmRfcm93KQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBjaGVja19tb3VzZV9mYWNlID0gdHJ1ZTsKKyAgICAgICAgICAgICAgbW91c2VfYmVn X2NvbCA9IChyb3dfdnBvcyA9PSBobGluZm8tPm1vdXNlX2ZhY2VfYmVnX3JvdykKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gaGxpbmZvLT5tb3VzZV9mYWNlX2JlZ19jb2wKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogMDsKKyAgICAgICAgICAgICAgbW91c2VfZW5kX2Nv bCA9IChyb3dfdnBvcyA9PSBobGluZm8tPm1vdXNlX2ZhY2VfZW5kX3JvdykKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gaGxpbmZvLT5tb3VzZV9mYWNlX2VuZF9jb2wKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAg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MtPm5leHQpCisgICAgICAgICAgICB7CisgICAg ICAgICAgICAgIHMtPmxlZnRfb3ZlcndyaXR0ZW5fcCA9IHRydWU7CisgICAgICAgICAgICAgIHMt PmFjdGlvbl90eXBlID0gYWN0aW9uX3R5cGU7CisgICAgICAgICAgICAgIGxlbmd0aCArPSBzLT5m aXJzdF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgICAgcmVsYXRp dmVfeCA9IHN0YXJ0X3ggLSBsZW5ndGg7CisgICAgICAgICAgZm9yIChzID0gaDsgczsgcyA9IHMt Pm5leHQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHMtPmZpcnN0X2dseXBoLT5yZWxh dGl2ZV94ID0gcmVsYXRpdmVfeDsKKyAgICAgICAgICAgICAgcmVsYXRpdmVfeCArPSBzLT5maXJz dF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgICAgc3RhcnQgPSBp OworICAgICAgICAgIGNvbXB1dGVfb3ZlcmhhbmdzX2FuZF94ICh0LCBoZWFkLT54LCB0cnVlKTsK KyAgICAgICAgICBwcmVwZW5kX2dseXBoX3N0cmluZ19saXN0cyAoJmhlYWQsICZ0YWlsLCBoLCB0 KTsKKyAgICAgICAgICBpZiAoY2xpcF9oZWFkID09IE5VTEwpCisgICAgICAgICAgICBjbGlwX2hl YWQgPSBoZWFkOworICAgICAgICB9CisgICAgICAvKiBQcmVwZW5kIGdseXBoIHN0cmluZ3MgZm9y IGdseXBocyBpbiBmcm9udCBvZiB0aGUgZmlyc3QgZ2x5cGgKKyAgICAgIHN0cmluZyB0aGF0IG92 ZXJ3cml0ZSB0aGF0IGdseXBoIHN0cmluZyBiZWNhdXNlIG9mIHRoZWlyCisgICAgICByaWdodCBv dmVyaGFuZy4gIEZvciB0aGVzZSBzdHJpbmdzLCBvbmx5IHRoZSBmb3JlZ3JvdW5kIG11c3QKKyAg ICAgIGJlIGRyYXduLCBiZWNhdXNlIGl0IGRyYXdzIG92ZXIgdGhlIGdseXBoIHN0cmluZyBhdCBg aGVhZCcuCisgICAgICBUaGUgYmFja2dyb3VuZCBtdXN0IG5vdCBiZSBkcmF3biBiZWNhdXNlIHRo aXMgd291bGQgb3ZlcndyaXRlCisgICAgICByaWdodCBvdmVyaGFuZ3Mgb2YgcHJlY2VkaW5nIGds eXBocyBmb3Igd2hpY2ggbm8gZ2x5cGgKKyAgICAgIHN0cmluZ3MgZXhpc3QuICovCisgICAgICBp ID0gbGVmdF9vdmVyd3JpdGluZyAoaGVhZCk7CisgICAgICBpZiAoaSA+PSAwKQorICAgICAgICB7 CisgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIG92ZXJsYXBfaGw7CisgICAgICAgICAg aWYgKGNoZWNrX21vdXNlX2ZhY2UKKyAgICAgICAgICAgICAgJiYgbW91c2VfYmVnX2NvbCA8IHN0 YXJ0ICYmIG1vdXNlX2VuZF9jb2wgPiBpKQorICAgICAgICAgICAgb3ZlcmxhcF9obCA9IERSQVdf TU9VU0VfRkFDRTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgb3ZlcmxhcF9obCA9 IERSQVdfTk9STUFMX1RFWFQ7CisgICAgICAgICAgaWYgKGhsID09IG92ZXJsYXBfaGwgfHwgY2xp cF9oZWFkID09IE5VTEwpCisgICAgICAgICAgICBjbGlwX2hlYWQgPSBoZWFkOworICAgICAgICAg IE1DX0JVSUxEX0dMWVBIX1NUUklOR1MgKGksIHN0YXJ0LCBoLCB0LCBvdmVybGFwX2hsLCBkdW1t eV94LCBsYXN0X3gpOworICAgICAgICAgIGZvciAocyA9IGg7IHM7IHMgPSBzLT5uZXh0KQorICAg ICAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICAgICAgY29tcHV0 ZV9vdmVyaGFuZ3NfYW5kX3ggKHQsIGhlYWQtPngsIHRydWUpOworICAgICAgICAgIHByZXBlbmRf Z2x5cG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KKyAgICAgICAgICBjb21wdXRlX292ZXJoYW5nc19hbmRfeCAoaCwgdGFpbC0+eCArIHRh aWwtPndpZHRoLCBmYWxzZSk7CisgICAgICAgICAgYXBwZW5kX2dseXBoX3N0cmluZ19saXN0cyAo JmhlYWQsICZ0YWlsLCBoLCB0KTsKKyAgICAgICAgICBpZiAoY2xpcF90YWlsID09IE5VTEwpCisg ICAgICAgICAgICBjbGlwX3RhaWwgPSB0YWlsOworICAgICAgICB9CisgICAgICAvKiBBcHBlbmQg Z2x5cGggc3RyaW5ncyBmb3IgZ2x5cGhzIGZvbGxvd2luZyB0aGUgbGFzdCBnbHlwaAorICAgICAg c3RyaW5nIHRhaWwgdGhhdCBvdmVyd3JpdGUgdGFpbC4gIFRoZSBmb3JlZ3JvdW5kIG9mIHN1Y2gK KyAgICAgIGdseXBocyBoYXMgdG8gYmUgZHJhd24gYmVjYXVzZSBpdCB3cml0ZXMgaW50byB0aGUg YmFja2dyb3VuZAorICAgICAgb2YgdGFpbC4gIFRoZSBiYWNrZ3JvdW5kIG11c3Qgbm90IGJlIGRy YXduIGJlY2F1c2UgaXQgY291bGQKKyAgICAgIHBhaW50IG92ZXIgdGhlIGZvcmVncm91bmQgb2Yg Zm9sbG93aW5nIGdseXBocy4gKi8KKyAgICAgIGkgPSByaWdodF9vdmVyd3JpdGluZyAodGFpbCk7 CisgICAgICBpZiAoaSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgZW51bSBkcmF3X2dseXBo c19mYWNlIG92ZXJsYXBfaGw7CisgICAgICAgICAgaWYgKGNoZWNrX21vdXNlX2ZhY2UKKyAgICAg ICAgICAgICAgJiYgbW91c2VfYmVnX2NvbCA8IGkgJiYgbW91c2VfZW5kX2NvbCA+IGVuZCkKKyAg ICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX01PVVNFX0ZBQ0U7CisgICAgICAgICAgICBlbHNl CisgICAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX05PUk1BTF9URVhUOworICAgICAgICAg IGlmIChobCA9PSBvdmVybGFwX2hsIHx8IGNsaXBfdGFpbCA9PSBOVUxMKQorICAgICAgICAgICAg Y2xpcF90YWlsID0gdGFpbDsKKyAgICAgICAgICBpKys7ICAgICAgLyogV2UgbXVzdCBpbmNsdWRl IHRoZSBJdGggZ2x5cGguICovCisgICAgICAgICAgTUNfQlVJTERfR0xZUEhfU1RSSU5HUyAoZW5k LCBpLCBoLCB0LCBvdmVybGFwX2hsLCB4LCBsYXN0X3gpOworICAgICAgICAgIGZvciAocyA9IGg7 IHM7IHMgPSBzLT5uZXh0KQorICAgICAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRy dWU7CisgICAgICAgICAgY29tcHV0ZV9vdmVyaGFuZ3NfYW5kX3ggKGgsIHRhaWwtPnggKyB0YWls LT53aWR0aCwgZmFsc2UpOworICAgICAgICAgIGFwcGVuZF9nbHlwaF9zdHJpbmdfbGlzdHMgKCZo ZWFkLCAmdGFpbCwgaCwgdCk7CisgICAgICAgIH0KKyAgICAgIHRhaWwgPSBnbHlwaF9zdHJpbmdf Y29udGFpbmluZ19iYWNrZ3JvdW5kX3dpZHRoICh0YWlsKTsKKyAgICAgIGlmIChjbGlwX3RhaWwp CisgICAgICAgIGNsaXBfdGFpbCA9IGdseXBoX3N0cmluZ19jb250YWluaW5nX2JhY2tncm91bmRf d2lkdGggKGNsaXBfdGFpbCk7CisgICAgICBpZiAoY2xpcF9oZWFkIHx8IGNsaXBfdGFpbCkKKyAg ICAgICAgZm9yIChzID0gaGVhZDsgczsgcyA9IHMtPm5leHQpCisgICAgICAgICAgeworICAgICAg ICAgICAgcy0+Y2xpcF9oZWFkID0gY2xpcF9oZWFkOworICAgICAgICAgICAgcy0+Y2xpcF90YWls ID0gY2xpcF90YWlsOworICAgICAgICAgIH0KKyAgICB9CisgIC8qIERyYXcgYWxsIHN0cmluZ3Mu ICovCisgIGZvciAocyA9IGhlYWQ7IHMgJiYgZHJhd19wOyBzID0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UklYX1JPV19PVkVSTEFQU19TVUNDX1AgKHJvdyAtIDEpKQorICAgICAg ICB4X2ZpeF9vdmVybGFwcGluZ19hcmVhICh3LCByb3cgLSAxLCBURVhUX0FSRUEsIE9WRVJMQVBT X0VSQVNFRF9DVVJTT1IpOworICAgICAgaWYgKE1BVFJJWF9ST1dfQk9UVE9NX1kgKHJvdykgPCB3 aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAmJiBNQVRSSVhfUk9XX09WRVJMQVBT X1BSRURfUCAocm93ICsgMSkpCisgICAgICAgIHhfZml4X292ZXJsYXBwaW5nX2FyZWEgKHcsIHJv dyArIDEsIFRFWFRfQVJFQSwgT1ZFUkxBUFNfRVJBU0VEX0NVUlNPUik7CisgICAgfQorfQorCit2 b2lkCittY19lcmFzZV9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRy aXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAgICAgICBpbnQg eCwgaW50IHksIGludCBocG9zLCBpbnQgdnBvcywgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9y LAorICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlLCBpbnQg d2QpCit7CisgIGJvb2wgZGVidWdfcCA9IGZhbHNlOworICBpZiAoZGVidWdfcCkKKyAgICBmcHJp bnRmIChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6ICB4ICglZCkgfCB5ICglZCkgfCBocG9zICgl ZCkgfCB2cG9zICglZCkgfCB3ZCAoJWQpXG5cCisgICAgZ2x5cGhfZmxhdm9yICglcykgfCBjdXJz b3JfdHlwZSAoJXMpXG4iLAorICAgIHgsIHksIGhwb3MsIHZwb3MsIHdkLAorICAgIG1jX2ZsYXZv cl90b19zdHJpbmcgKGdseXBoX2ZsYXZvciksIG1jX2N1cnNvcl90eXBlX3RvX3N0cmluZyAoY3Vy c29yX3R5cGUpKTsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIE1v dXNlX0hMSW5mbyAqaGxpbmZvID0gTU9VU0VfSExfSU5GTyAoZik7CisgIGJvb2wgbW91c2VfZmFj ZV9oZXJlX3AgPSBmYWxzZTsKKyAgc3RydWN0IGdseXBoICpjdXJzb3JfZ2x5cGg7CisgIGVudW0g ZHJhd19nbHlwaHNfZmFjZSBobDsKKyAgLyogTm8gY3Vyc29yIGRpc3BsYXllZCBvciByb3cgaW52 YWxpZGF0ZWQgPT4gbm90aGluZyB0byBkbyBvbiB0aGUgc2NyZWVuLiAqLworICBpZiAoY3Vyc29y X3R5cGUgPT0gTUNfTk9fQ1VSU09SKQorICAgIHsKKyAgICAgIGlmIChkZWJ1Z19wKQorICAgICAg ICBmcHJpbnRmIChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6ICByZXR1cm4gKCVkKVxuIiwgMSk7 CisgICAgICByZXR1cm47CisgICAgfQorICAvKiBWUE9TID49IG1hdHJpeC0+bnJvd3MgbWVhbnMg dGhhdCB3aW5kb3cgaGFzIGJlZW4gcmVzaXplZC4KKyAgICAgRG9uJ3QgYm90aGVyIHRvIGVyYXNl IHRoZSBjdXJzb3IuICovCisgIGlmICh2cG9zID49IG1hdHJpeC0+bnJvd3MpCisgICAgeworICAg ICAgaWYgKGRlYnVnX3ApCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX2VyYXNlX2N1cnNv cjogIHJldHVybiAoJWQpXG4iLCAyKTsKKyAgICAgIHJldHVybjsKKyAgICB9CisgIC8qIElmIHJv dyBjb250YWluaW5nIGN1cnNvciBpcyBtYXJrZWQgaW52YWxpZCwgdGhlcmUgaXMgbm90aGluZyB3 ZQorICAgICBjYW4gZG8uICovCisgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgeworICAgICAg aWYgKGRlYnVnX3ApCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIm1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WdodCA9IFdJ TkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICAgICAgY3Vyc29yX2dseXBoID0gbWNfZ2V0 X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIGhwb3MsIHZwb3MpOworICAgICAgaWYgKGN1 cnNvcl9nbHlwaCA9PSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgaWYgKGRlYnVnX3ApCisg ICAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6ICByZXR1cm4gKCVk KVxuIiwgNyk7CisgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICBpbnQgdGVtcF93 ZCA9IGN1cnNvcl9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICBpZiAodGVtcF94IDwgMCkKKyAg ICAgICAgeworICAgICAgICAgIHRlbXBfd2QgKz0gdGVtcF94OworICAgICAgICAgIHRlbXBfeCA9 IDA7CisgICAgICAgIH0KKyAgICAgIHRlbXBfd2QgPSBtaW4gKHdkLCB3aW5kb3dfYm94X3dpZHRo ICh3LCBURVhUX0FSRUEpIC0gdGVtcF94KTsKKyAgICAgIGludCBmeSA9IFdJTkRPV19UT19GUkFN RV9QSVhFTF9ZICh3LCBtYXggKGhlYWRlcl9saW5lX2hlaWdodCwgcm93LT55KSk7CisgICAgICBp bnQgZnggPSBXSU5ET1dfVEVYVF9UT19GUkFNRV9QSVhFTF9YICh3LCB0ZW1wX3gpOworICAgICAg aWYgKHRlbXBfd2QgPiAwKQorICAgICAgICBGUkFNRV9SSUYgKGYpLT5jbGVhcl9mcmFtZV9hcmVh IChmLCBmeCwgZnksIHRlbXBfd2QsIHJvdy0+dmlzaWJsZV9oZWlnaHQpOworICAgIH0KKyAgLyog RXJhc2UgdGhlIGN1cnNvciBieSByZWRyYXdpbmcgdGhlIGNoYXJhY3RlciB1bmRlcm5lYXRoIGl0 LiAqLworICBpZiAobW91c2VfZmFjZV9oZXJlX3ApCisgICAgaGwgP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ZSwgYnVmKSwgUWN1cnJlbnRfbGluZSk7CisgIC8qIEVYQU1QTEU6ICAoc2Nyb2xsLWxlZnQgNSkg Ki8KKyAgYm9vbCBoc2NsX2FsbF90ZW1wX3AgPSAody0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBh bmQgZG8gbm90aGluZy4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzBfcCA9ICh3LT5zdXNwZW5k X2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9s bF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhzY3JvbGwpOwor ICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBzb21ldGhpbmcgZWxzZSBiZXNpZGVzIGhv cml6b250YWxseSBzY3JvbGxpbmcgdGhlCisgICAgICAgICAgICAgICBjdXJyZW50IGxpbmUgZGlm ZmVyZW50bHkuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgaXMgX25vdF8gaG9yaXpvbnRh bGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMV9wID0g KCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5o c2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xs ID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHct PmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCAuLi4KKyAgICAgICAgICAg ICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50 bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8yX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Ny b2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPT0gMAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhzY3JvbGwpOworICAvKiBFWEFN UExFOiAgKHNjcm9sbC1sZWZ0IDUpOyBhbmQsIHRoZW4gcHJlc3MgdGhlIGxlZnQgYXJyb3cga2V5 IG9uZSB0aW1lLgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIF9pc18gaG9yaXpvbnRhbGx5 IHNjcm9sbGVkIGRpZmZlcmVudGx5LiovCisgIGJvb2wgaHNjbF90ZW1wX3AgPSAoIXctPnN1c3Bl bmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21v ZGVfcAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gMCk7CisgIC8qIEVYQU1QTEU6ICBDLXUg Qy14IDwgYW5kIGRvIHNvbWV0aGluZyB0aGF0IGNhdXNlcyB0aGUgY3VycmVudCBsaW5lIHRvIGJl CisgICAgICAgICAgICAgICBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuCisgICAg ICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVy ZW50bHkuICovCisgIGJvb2wgaHNjbF9wZXJtX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xs CisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAg ICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYg dy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3Jv bGwgIT0gdy0+aHNjcm9sbCk7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUp OworICBpbnQgZnJpbmdlX2JpdG1hcCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgIGludCBmYWNl X2lkID0gREVGQVVMVF9GQUNFX0lEOworICBpZiAoIXJlbW92ZV9wCisgICAgICAmJiBnbHlwaF9m bGF2b3IgPT0gTUNfT1ZFUkxBWV9BUlJPV19CSVRNQVAKKyAgICAgICYmICFoc2NsX2FsbF90ZW1w X3AKKyAgICAgICYmICFoc2NsX3RlbXBfcAorICAgICAgJiYgIWhzY2xfcGVybV9wCisgICAgICAm JiAhaHNjbF9hbGxfcGVybV8wX3AKKyAgICAgICYmICFoc2NsX2FsbF9wZXJtXzFfcAorICAgICAg JiYgIWhzY2xfYWxsX3Blcm1fMl9wKQorICAgIHsKKyAgICAgIGVudW0gZmFjZV9pZCBvdmVybGF5 X2Fycm93X2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ICAgICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICByb3ctPmxlZnRfZnJpbmdlX2ZhY2VfaWQgPSBm YWNlX2lkOworICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9vZmZzZXQgPSAwOworICAgICAgcm93LT5m cmluZ2VfYml0bWFwX3BlcmlvZGljX3AgPSBmYWxzZTsKKyAgICAgIG1jX2RyYXdfZnJpbmdlX2Jp dG1hcCAodywgcm93LCB0cnVlLCBjdXJzb3JfdHlwZSk7CisgICAgfQorICAgIGVsc2UgaWYgKCFy ZW1vdmVfcAorICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciA9PSBNQ19PVkVSTEFZX0FSUk9X X0JJVE1BUAorICAgICAgICAgICAgICYmIChoc2NsX2FsbF90ZW1wX3AKKyAgICAgICAgICAgICAg ICAgfHwgaHNjbF9hbGxfcGVybV8wX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVy bV8xX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8yX3AKKyAgICAgICAgICAg ICAgICAgfHwgaHNjbF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF9wZXJtX3ApKQor ICAgICAgeworICAgICAgICBlbnVtIGZhY2VfaWQgb3ZlcmxheV9hcnJvd19mYWNlX2lkID0KKyAg ICAgICAgICAoIWFjdGl2ZV9wCisgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3 LT5jb250ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgICA/IGxvb2t1cF9u YW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ctaHNjbC1pbmFjdGl2ZS1w cmUtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICAgIDogKGFjdGl2ZV9wKQorICAgICAgICAgICAg PyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wt cHJlLXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAg ICAgZmFjZV9pZCA9IChjdXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAg ICAgICAgICAgICAgICA/IG92ZXJsYXlfYXJyb3dfZmFjZV9pZAorICAgICAgICAgICAgICAgICAg OiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgIGlmIChoc2NsX2FsbF9wZXJtXzBfcCkKKyAgICAg ICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIist aHNjbC1wZXJtIiksIGZhbHNlLCBmYWxzZSk7CisgICAgICAgICAgZWxzZSBpZiAoaHNjbF9hbGxf cGVybV8xX3ApCisgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRt YXAgKHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIHRydWUsIGZhbHNlKTsKKyAgICAgICAgICAg IGVsc2UgaWYgKGhzY2xfYWxsX3Blcm1fMl9wKQorICAgICAgICAgICAgICBmcmluZ2VfYml0bWFw ID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIGZhbHNl LCB0cnVlKTsKKyAgICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF9wZXJtX3ApCisgICAgICAgICAg ICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIr LWhzY2wtcGVybSIpLCB0cnVlLCB0cnVlKTsKKyAgICAgICAgICAgICAgICBlbHNlIGlmIChoc2Ns X2FsbF90ZW1wX3ApCisgICAgICAgICAgICAgICAg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gcm93LT5vdmVybGF5 X2Fycm93X2JpdG1hcGAgc2F0aXNmaWVzIHRoZSBmaXJzdCBjb25kaXRpb24KKyAgICAgICAgb2Yg KHdoaWNoICE9IE5PX0ZSSU5HRV9CSVRNQVApLiAgQXQgdGhpcyB0aW1lLCBAbGF3bGlzdCBwcmVm ZXJzIG5vdCB0bworICAgICAgICByZWx5IHVwb24gYSBMaXNwIHNldHRpbmcgdXNpbmcgYHNldC1m cmluZ2UtYml0bWFwLWZhY2UnLiAqLworICAgICAgICByb3ctPmxlZnRfZnJpbmdlX2JpdG1hcCA9 IChjdXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IGZyaW5nZV9iaXRtYXAKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAg ICAgcm93LT5sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gZmFjZV9pZDsKKyAgICAgICAgcm93LT5sZWZ0 X2ZyaW5nZV9vZmZzZXQgPSAwOworICAgICAgICByb3ctPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNf cCA9IGZhbHNlOworICAgICAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXAgKHcsIHJvdywgdHJ1ZSwg Y3Vyc29yX3R5cGUpOworICAgICAgfQorICAgICAgZWxzZSBpZiAoIXJlbW92ZV9wCisgICAgICAg ICAgICAgICAmJiAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJS T1cKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9M TE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2Zs YXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFCisgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhf Zmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAg IHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cK KyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSCisg ICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FM X0JBUgorICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9C QVJfQkFDS1NMQVNIKSkKKyAgICAgICAgeworICAgICAgICAgIExpc3BfT2JqZWN0IGJpdG1hcF9m bGF2b3IgPSAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hvbGxvd19yZWN0 YW5nbGVfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJS T1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJz ZWRfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFu Z2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZv ciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZF UlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBN Q19WRVJUSUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBRbWNfdmVydGljYWxfYmFyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxfYmFy CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9 PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jhcl9iYWNrc2xhc2gKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiBRbmlsOworICAgICAgICAgIGZyaW5nZV9iaXRtYXAg PSAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBsb29rdXBfZnJpbmdlX2JpdG1hcCAoYml0bWFwX2ZsYXZvcikKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgOiBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgIGZh Y2VfaWQgPSAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAorICAgICAgICAg ICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFO R0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9y ID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAg ICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpKQor ICAgICAgICAgICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAo IistcmV2ZXJzZWQtYmFyLXByZS16di1mYWNlIiksIHRydWUpCisgICAgICAgICAgICAgICAgICAg IDogKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAg ICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVf UklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1D X1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAg ICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICAg ICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistYmFyLXBy ZS16di1mYWNlIiksIHRydWUpCisgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lE OworICAgICAgICAgIHJvdy0+Y3Vyc29yX2luX2ZyaW5nZV9wID0gZmFsc2U7CisgICAgICAgICAg cm93LT5yaWdodF9mcmluZ2VfYml0bWFwID0gZnJpbmdlX2JpdG1hcDsKKyAgICAgICAgICByb3ct PnJpZ2h0X2ZyaW5nZV9mYWNlX2lkID0gZmFjZV9pZDsKKyAgICAgICAgICByb3ctPnJpZ2h0X2Zy aW5nZV9vZmZzZXQgPSAwOworICAgICAgICAgIHJvdy0+ZnJpbmdlX2JpdG1hcF9wZXJpb2RpY19w ID0gZmFsc2U7CisgICAgICAgICAgbWNfZHJhd19mcmluZ2VfYml0bWFwICh3LCByb3csIGZhbHNl LCBjdXJzb3JfdHlwZSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoZ2x5cGhfZmxhdm9y ID09IE1DX0dMWVBICisgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQ SExFU1MpCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBvbl9wID0gdHJ1ZTsKKyAgICAg ICAgICAgIEZSQU1FX1JJRiAoZiktPm1jX3NjcmliZV9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4 LCBmeCwgeSwgZnksIGhwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICB2cG9zLCB3ZCwgaCwgbHNsLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgZ2x5cGhfZmxhdm9yLCBv bl9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0aXZl X3ApOworICAgICAgICAgIH0KK30KKworLyogRHVtcCBjb250ZW50cyBvZiBnbHlwaCBHTFlQSCB0 byBzdGRlcnIuICBST1cgYW5kIEFSRUEgYXJlCisgICB0aGUgZ2x5cGggcm93IGFuZCBhcmVhIHdo ZXJlIHRoZSBnbHlwaCBjb21lcyBmcm9tLiAqLwordm9pZAorbWNfZHVtcF9nbHlwaCAoc3RydWN0 IGdseXBoX3JvdyAqcm93LCBzdHJ1Y3QgZ2x5cGggKmdseXBoLCBpbnQgYXJlYSwKKyAgICAgICAg ICAgICAgIGludCByZWxhdGl2ZV94LCBpbnQgdnBvcykKK3sKKyAgYm9vbCBnbHlwaF96dl9wID0g KGdseXBoIC0gcm93LT5nbHlwaHNbYXJlYV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAg ICAgICAgICAgICAgICAgJiYgTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSA9PSBaVik7Cisg IGlmIChnbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICB8fCBnbHlwaC0+dHlwZSA9PSBH TFlQSExFU1NfR0xZUEgpCisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAi ICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFk ICAlM2QgJXMgJXNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwK KyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0g MSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgIChnbHlwaC0+dHlwZSA9PSBDSEFSX0dM WVBICisgICAgICAgICA/ICdDJworICAgICAgICAgOiAnRycpLAorICAgICAgICBnbHlwaC0+Y2hh cnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICA/ICdCJwor ICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisg ICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgICAgPyAnMCcK KyAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisg ICAgICAgIGdseXBoLT51LmNoLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5 cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisg ICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgIG1j X2NoYXJfdG9fc3RyaW5nIChnbHlwaC0+dS5jaCkpOworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgt PnR5cGUgPT0gU1RSRVRDSF9HTFlQSCkKKyAgICB7CisgICAgICBmcHJpbnRmIChzdGRlcnIsCisg ICAgICAgICIgJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNnggJTRkICUx LjFkJTEuMWQgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhU X0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRb YXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ1MnLAorICAgICAgICBn bHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICAgICA/ICdCJworICAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICAgICA/ICdTJworICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAg ICA/ICcwJworICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgs CisgICAgICAgIDB1LAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxl ZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAg IGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICJcXFMiKTsK KyAgICB9CisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IElNQUdFX0dMWVBIKQorICAgIHsKKyAg ICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBE ImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4xZCAgJTNkICVzICVjXG4iLAorICAgICAgICBn bHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2VkW2FyZWFd ID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94LAor ICAgICAgICAnSScsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAo Z2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ0InCisgICAgICAgICAgOiAoU1RSSU5HUCAo Z2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgOiAoTklMUCAoZ2x5 cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgOiAnLScpKSksCisgICAg ICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgKHVuc2lnbmVkIGludCkgZ2x5cGgtPnUu aW1nX2lkLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94 X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBo LT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7CisgICAgfQor ICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpCisgICAgeworICAgICAg ZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAl YyAlM2QgMHglMDZ4IiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAor ICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAx KSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJysnLAorICAgICAgICBnbHlwaC0+Y2hh cnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdC JworICAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdT JworICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICcwJwor ICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAg ICh1bnNpZ25lZCBpbnQpIGdseXBoLT51LmNtcC5pZCk7CisgICAgICBmcHJpbnRmIChzdGRlcnIs ICIgJTRkICUxLjFkJTEuMWQiLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5 cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3ApOwor ICAgICAgaWYgKGdseXBoLT51LmNtcC5hdXRvbWF0aWMpCisgICAgICAgIGZwcmludGYgKHN0ZGVy ciwgIiAgJTNkICVzIC4gWyVkLSVkXVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBnbHlw aC0+aHBvcywgZ2x5cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAgICAgICAgICAgICAg ICAgIGdseXBoLT5zbGljZS5jbXAuZnJvbSwgZ2x5cGgtPnNsaWNlLmNtcC50byk7CisgICAgICAg IGVsc2UKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiXG4iKTsKKyAgICB9CisgIGVsc2UgaWYg KGdseXBoLT50eXBlID09IFhXSURHRVRfR0xZUEgpCisgICAgeworI2lmbmRlZiBIQVZFX1hXSURH RVRTCisgICAgICBlYXNzdW1lIChmYWxzZSk7CisjZWxzZQorICAgICAgZnByaW50ZiAoc3RkZXJy LAorICAgICAgICAiICAlNWQvJS01ZCAlNWQgJTRjICU2ZCAlYyAlM2QgMHglMDV4ICU0ZCAlMS4x ZCUxLjFkICAlM2QgJXMgJWNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9B UkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2Fy ZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdYJywKKyAgICAgICAgZ2x5 cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAg ICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAg ID8gJ1MnCisgICAgICAgICA6ICctJykpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisg ICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAor ICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnUueHdpZGdl dCwKKyAgICAgICAgZ2x5cGgtPmhwb3MsIGdseXBoX3p2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAg ICAgJy4nKTsKKyNlbmRpZgorICAgIH0KK30KKworLyogRHVtcCB0aGUgY29udGVudHMgb2YgZ2x5 cGggcm93IGF0IFZQT1MgaW4gTUFUUklYIHRvIHN0ZGVyci4KKyAgIEdMWVBIUyAwIG1lYW5zIGRv bid0IHNob3cgZ2x5cGggY29udGVudHMuCisgICBHTFlQSFMgMSBtZWFucyBzaG93IGdseXBocyBp biBzaG9ydCBmb3JtCisgICBHTFlQSFMgPiAxIG1lYW5zIHNob3cgZ2x5cGhzIGluIGxvbmcgZm9y bS4gKi8KK3ZvaWQKK21jX2R1bXBfZ2x5cGhfcm93IChzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGlu dCB2cG9zLCBpbnQgZ2x5cGhzKQoreworICBpbnQgcmVsYXRpdmVfeCA9IDA7CisgIGlmIChnbHlw aHMgIT0gMSkKKyAgICB7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICJcbkRVTVAgR0xZUEggUk9X XG4iKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIlJvdyAgICAgU3RhcnQgICAgICAgRW5kIFVz ZWQgb0U+PFxcQ1RaRmVzbSAgICAgWCAgICBZICAgIFcgICAgSCAgICBWICAgIEEgICAgUFxuIik7 CisgICAgICBmcHJpbnRmIChzdGRlcnIsICI9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiIpOworICAg ICAgZnByaW50ZiAoc3RkZXJyLCAiJTNkICU5InBEImQgJTkicEQiZCAlNGQgJTEuMWQlMS4xZCUx LjFkJTEuMWRcCislMS4xZCUxLjFkJTEuMWQlMS4xZCUxLjFkJTEuMWQlMS4xZCUxLjFkICAlNGQg JTRkICU0ZCAlNGQgJTRkICU0ZCAlNGRcbiIsCisgICAgICAgICB2cG9zLAorICAgICAgICAgTUFU UklYX1JPV19TVEFSVF9DSEFSUE9TIChyb3cpLAorICAgICAgICAgTUFUUklYX1JPV19FTkRfQ0hB UlBPUyAocm93KSwKKyAgICAgICAgIHJvdy0+dXNlZFtURVhUX0FSRUFdLAorICAgICAgICAgcm93 LT5jb250YWluc19vdmVybGFwcGluZ19nbHlwaHNfcCwKKyAgICAgICAgIHJvdy0+ZW5hYmxlZF9w LAorICAgICAgICAgcm93LT50cnVuY2F0ZWRfb25fbGVmdF9wLAorICAgICAgICAgcm93LT50cnVu Y2F0ZWRfb25fcmlnaHRfcCwKKyAgICAgICAgIHJvdy0+Y29udGludWVkX3AsCisgICAgICAgICBN QVRSSVhfUk9XX0NPTlRJTlVBVElPTl9MSU5FX1AgKHJvdyksCisgICAgICAgICBNQVRSSVhfUk9X X0RJU1BMQVlTX1RFWFRfUCAocm93KSwKKyAgICAgICAgIHJvdy0+ZW5kc19hdF96dl9wLAorICAg ICAgICAgcm93LT5maWxsX2xpbmVfcCwKKyAgICAgICAgIHJvdy0+ZW5kc19pbl9taWRkbGVfb2Zf Y2hhcl9wLAorICAgICAgICAgcm93LT5zdGFydHNfaW5fbWlkZGxlX29mX2NoYXJfcCwKKyAgICAg ICAgIHJvdy0+bW91c2VfZmFjZV9wLAorICAgICAgICAgcm93LT54LAorICAgICAgICAgcm93LT55 LAorICAgICAgICAgcm93LT5waXhlbF93aWR0aCwKKyAgICAgICAgIHJvdy0+aGVpZ2h0LAorICAg ICAgICAgcm93LT52aXNpYmxlX2hlaWdodCwKKyAgICAgICAgIHJvdy0+YXNjZW50LAorICAgICAg ICAgcm93LT5waHlzX2FzY2VudCk7CisgICAgICAvKiBUaGUgbmV4dCAzIGxpbmVzIHNob3VsZCBh bGlnbiB0byAiU3RhcnQiIGluIHRoZSBoZWFkZXIuICovCisgICAgICBmcHJpbnRmIChzdGRlcnIs ICIgICAgJTkicEQiZCAlOSJwRCJkXHQlNWRcbiIsIHJvdy0+c3RhcnQub3ZlcmxheV9zdHJpbmdf aW5kZXgsCisgICAgICAgICByb3ctPmVuZC5vdmVybGF5X3N0cmluZ19pbmRleCwKKyAgICAgICAg IHJvdy0+Y29udGludWF0aW9uX2xpbmVzX3dpZHRoKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwg IiAgICAlOSJwRCJkICU5InBEImRcbiIsCisgICAgICAgICBDSEFSUE9TIChyb3ctPnN0YXJ0LnN0 cmluZ19wb3MpLAorICAgICAgICAgQ0hBUlBPUyAocm93LT5lbmQuc3RyaW5nX3BvcykpOworICAg ICAgZnByaW50ZiAoc3RkZXJyLCAiICAgICU5ZCAlOWRcbiIsIHJvdy0+c3RhcnQuZHB2ZWNfaW5k ZXgsCisgICAgICAgICByb3ctPmVuZC5kcHZlY19pbmRleCk7CisgICAgfQorICBpZiAoZ2x5cGhz ID4gMSkKKyAgICB7CisgICAgICBmb3IgKGludCBhcmVhID0gTEVGVF9NQVJHSU5fQVJFQTsgYXJl YSA8IExBU1RfQVJFQTsgKythcmVhKQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGdseXBo ICpnbHlwaCA9IHJvdy0+Z2x5cGhzW2FyZWFdOworICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5 cGhfZW5kID0gZ2x5cGggKyByb3ctPnVzZWRbYXJlYV07CisgICAgICAgICAgLyogR2x5cGggZm9y IGEgbGluZSBlbmQgaW4gdGV4dC4gKi8KKyAgICAgICAgICBpZiAoYXJlYSA9PSBURVhUX0FSRUEg JiYgZ2x5cGggPT0gZ2x5cGhfZW5kICYmIGdseXBoLT5jaGFycG9zID4gMCkKKyAgICAgICAgICAg ICsrZ2x5cGhfZW5kOworICAgICAgICAgIGlmIChnbHlwaCA8IGdseXBoX2VuZCkKKyAgICAgICAg ICAgIGZwcmludGYgKHN0ZGVyciwgIkdseXBoIy9Ub3RhbCBSZWwuWCBUICAgICAgIFBvcyBPICAg VyAgICAgQ29kZSBGYWNlIExSIEhQT1MgWlYgQ1xuIik7CisgICAgICAgICAgZm9yICg7IGdseXBo IDwgZ2x5cGhfZW5kOyArK2dseXBoKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19k dW1wX2dseXBoIChyb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB2cG9zKTsKKyAgICAgICAg ICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICB9Cisg ICAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZiAoZ2x5cGhzID09IDEpCisgICAgICB7CisgICAg ICAgIGNoYXIgc1tTSFJUX01BWCArIDRdOworICAgICAgICBmb3IgKGludCBhcmVhID0gTEVGVF9N QVJHSU5fQVJFQTsgYXJlYSA8IExBU1RfQVJFQTsgKythcmVhKQorICAgICAgICAgIHsKKyAgICAg ICAgICAgIGludCBpOworICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHJvdy0+dXNlZFthcmVh XTsgKytpKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoICpn bHlwaCA9IHJvdy0+Z2x5cGhzW2FyZWFdICsgaTsKKyAgICAgICAgICAgICAgICBpZiAoaSA9PSBy b3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICYmIGFyZWEgPT0gVEVYVF9B UkVBCisgICAgICAgICAgICAgICAgICAgICYmIE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICAgICAgICAgICAgICYmIGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgICAgICAgICAg ICAgICAgJiYgZ2x5cGgtPnUuY2ggPT0gJyAnKQorICAgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgICBzdHJjcHkgKCZzW2ldLCAiW1xcbl0iKTsKKyAgICAgICAgICAgICAgICAg ICAgaSArPSA0OworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgZWxzZSBp ZiAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgZ2x5cGgtPnUuY2ggPCAweDgwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlw aC0+dS5jaCA+PSAnICcpCisgICAgICAgICAgICAgICAgICAgIHNbaV0gPSBnbHlwaC0+dS5jaDsK KyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgIHNbaV0gPSAn Lic7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHNbaV0gPSAnXDAnOworICAgICAgICAg ICAgZnByaW50ZiAoc3RkZXJyLCAiJTNkOiAoJWQpICclcydcbiIsIHZwb3MsIHJvdy0+ZW5hYmxl ZF9wLCBzKTsKKyAgICAgICAgICB9CisgICAgICB9Cit9CisKK0RFRlVOICgibWMtZHVtcC1nbHlw aC1yb3ciLCBGbWNfZHVtcF9nbHlwaF9yb3csIFNtY19kdW1wX2dseXBoX3JvdywgMSwgMiwgIlAi LAorICAgICAgIGRvYzogLyogRHVtcCBnbHlwaCByb3cgUk9XIHRvIHN0ZGVyci4KK0ludGVyYWN0 aXZlbHksIFJPVyBpcyB0aGUgcHJlZml4IG51bWVyaWMgYXJndW1lbnQgYW5kIGRlZmF1bHRzIHRv Cit0aGUgcm93IHdoaWNoIGRpc3BsYXlzIHBvaW50LgorT3B0aW9uYWwgYXJndW1lbnQgR0xZUEhT IDAgbWVhbnMgZG9uJ3QgZHVtcCBnbHlwaHMuCitHTFlQSFMgMSBtZWFucyBkdW1wIGdseXBocyBp biBzaG9ydCBmb3JtLgorR0xZUEhTID4gMSBvciBvbWl0dGVkIG1lYW5zIGR1bXAgZ2x5cGhzIGlu IGxvbmcgZm9ybS4gICovKQorICAoTGlzcF9PYmplY3Qgcm93LCBMaXNwX09iamVjdCBnbHlwaHMp Cit7CisgIHN0cnVjdCB3aW5kb3cgKncgPSBYV0lORE9XIChzZWxlY3RlZF93aW5kb3cpOworICBz dHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAgRU1BQ1Nf SU5UIHZwb3M7CisgIGlmIChOSUxQIChyb3cpKQorICAgIHsKKyAgICAgIGludCBkMSwgZDIsIGQz LCBkNCwgZDUsIHlwb3M7CisgICAgICBib29sIHZpc2libGVfcCA9IHBvc192aXNpYmxlX3AgKHcs IFBULCAmZDEsICZkMiwgJmQzLCAmZDQsICZkNSwgJnlwb3MpOworICAgICAgaW50IGhlYWRlcl9s aW5lX2hlaWdodCA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICAgICAgaW50IHZv ZmZzZXQgPSAoaGVhZGVyX2xpbmVfaGVpZ2h0ID4gMAorICAgICAgICAgICAgICAgICAgICAgJiYg eXBvcyA+IDApCisgICAgICAgICAgICAgICAgICAgICAgPyB5cG9zICsgMQorICAgICAgICAgICAg ICAgICAgICAgIDogeXBvczsKKyAgICAgIGlmICh2aXNpYmxlX3ApCisgICAgICAgIHZwb3MgPSB2 b2Zmc2V0OworICAgICAgICBlbHNlCisgICAgICAgICAgdnBvcyA9IDA7CisgICAgfQorICAgIGVs c2UKKyAgICAgIHsKKyAgICAgICAgQ0hFQ0tfTlVNQkVSIChyb3cpOworICAgICAgICB2cG9zID0g WEZJWE5VTSAocm93KTsKKyAgICAgIH0KKyAgaWYgKHZwb3MgPj0gMCAmJiB2cG9zIDwgbWF0cml4 LT5ucm93cykKKyAgICBtY19kdW1wX2dseXBoX3JvdyAoTUFUUklYX1JPVyAobWF0cml4LCB2cG9z KSwKKyAgICAgICAgdnBvcywKKyAgICAgICAgVFlQRV9SQU5HRURfRklYTlVNUCAoaW50LCBnbHlw aHMpID8gWEZJWE5VTSAoZ2x5cGhzKSA6IDIpOworICByZXR1cm4gUW5pbDsKK30KKwordm9pZAor bWNfZHVtcF9nbHlwaF9tYXRyaXggKHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgaW50IGds eXBocykKK3sKKyAgaW50IGk7CisgIGZvciAoaSA9IDA7IGkgPCBtYXRyaXgtPm5yb3dzOyArK2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yLCAiQ3Vyc29yIHggPSAlZCwgeSA9ICVkLCBocG9zID0gJWQsIHZwb3Mg PSAlZFxuIiwKKyAgICAgdy0+Y3Vyc29yLngsIHctPmN1cnNvci55LCB3LT5jdXJzb3IuaHBvcywg dy0+Y3Vyc29yLnZwb3MpOworICBmcHJpbnRmIChzdGRlcnIsICI9PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiIpOworICBtY19kdW1wX2dseXBoX21hdHJpeCAo dy0+Y3VycmVudF9tYXRyaXgsCisgICAgICAgICBUWVBFX1JBTkdFRF9GSVhOVU1QIChpbnQsIGds eXBocykgPyBYRklYTlVNIChnbHlwaHMpIDogMCk7CisgIHJldHVybiBRbmlsOworfQorCitib29s CittY190cmF2ZXJzZV9jYWNoZV9wIChzdHJ1Y3QgbWNfbWF0cml4IG1hdHJpeCwgZW51bSBtY19j YWNoZV90eXBlIGNhY2hlX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICBpbnQgdm50aCwgaW50 IG50aCkKK3sKKyAgaWYgKHZudGggPCBtYXRyaXgudnBvc191c2VkCisgICAgICAmJiBtYXRyaXgu Y3Vyc29yc191c2VkW2NhY2hlX3R5cGVdID4gMAorICAgICAgJiYgbnRoIDwgbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXSkKKyAgICByZXR1cm4gdHJ1ZTsKKyAgICBlbHNl CisgICAgICByZXR1cm4gZmFsc2U7Cit9CisKK3ZvaWQKK21jX3Jlc2V0X2NhY2hlIChzdHJ1Y3Qg d2luZG93ICp3KQoreworICBpZiAoIUJVRkZFUlAgKHctPmNvbnRlbnRzKSkKKyAgICByZXR1cm47 CisgIGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAg ICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7CisgICAgICAgKytjYWNoZV90eXBlKQorICAgIHsKKyAg ICAgIGJvb2wgYnZhcl9hY3RpdmVfcDsKKyAgICAgIHN3aXRjaCAoY2FjaGVfdHlwZSkKKyAgICAg ICAgeworICAgICAgICAgIGNhc2UgTk9fQ0FDSEU6CisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBjYXNlIE1DX0NBQ0hFOgorICAg ICAgICAgICAgeworICAgICAgICAgICAgICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAg ICAgICAgICAgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2Nv bmYpKSkKKyAgICAgICAgICAgICAgICBidmFyX2FjdGl2ZV9wID0gZmFsc2U7CisgICAgICAgICAg ICAgICAgZWxzZSBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQor ICAgICAgICAgICAgICAgICAgYnZhcl9hY3RpdmVfcCA9IHRydWU7CisgICAgICAgICAgICAgIGJy ZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgIGNhc2UgQ0hfQ0FDSEU6CisgICAgICAgICAg ICB7CisgICAgICAgICAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAg ICAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykp KQorICAgICAgICAgICAgICAgIGJ2YXJfYWN0aXZlX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAg ICBlbHNlIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICAgICAg ICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisg ICAgICAgICAgICAgICAgICBidmFyX2FjdGl2ZV9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgYnJl YWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgY2FzZSBGQ19DQUNIRToKKyAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAg ICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkp CisgICAgICAgICAgICAgICAgYnZhcl9hY3RpdmVfcCA9IGZhbHNlOworICAgICAgICAgICAgICAg IGVsc2UgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICAgICAg ICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKSkKKyAg ICAgICAgICAgICAgICAgIGJ2YXJfYWN0aXZlX3AgPSB0cnVlOworICAgICAgICAgICAgICBicmVh azsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKCFidmFyX2FjdGl2ZV9wKQor ICAgICAgICB7CisgICAgICAgICAgLyogRGVjcmVhc2UgdGhlIHNpemUgb2YgdGhlIGFycmF5IHRv IGEgYmFyZSBtaW5pbXVtLiAqLworICAgICAgICAgIGZvciAoaW50IHZudGggPSAwOyB2bnRoIDwg dy0+bWNfbWF0cml4LnZwb3NfdXNlZDsgKyt2bnRoKQorICAgICAgICAgICAgeworICAgICAgICAg ICAgICBpZiAody0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVkW2NhY2hlX3R5 cGVdID4gMSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXSA9CisgICAgICAgICAgICAgICAgICAgIHhu cmVhbGxvYyAody0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV0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vyc29yX3dpZHRoLCAoYWN0aXZlX3Ag PyAidHJ1ZSIgOiAiZmFsc2UiKSwgZm9yZWdyb3VuZC5yZWQsIGZvcmVncm91bmQuZ3JlZW4sCisg ICAgICBmb3JlZ3JvdW5kLmJsdWUsIGJhY2tncm91bmQucmVkLCBiYWNrZ3JvdW5kLmdyZWVuLCBi YWNrZ3JvdW5kLmJsdWUpOworICAgIH0KKyAgYm9vbCByZW1vdmVfcCA9IGZhbHNlOworICBpZiAo ZHJhd19wCisgICAgICAmJiAoZnJvbV93aGVyZSA9PSBTS0lQUEVECisgICAgICAgICAgfHwgZnJv bV93aGVyZSA9PSBQT1NUX0NIQU5HRUQKKyAgICAgICAgICB8fCBmcm9tX3doZXJlID09IFVOQ0hB TkdFRAorICAgICAgICAgIHx8IGZyb21fd2hlcmUgPT0gU0VUX0NVUlNPUl9UV08pKQorICAgIHsK KyAgICAgIGJvb2wgc2FtZV9wID0gZmFsc2U7CisgICAgICBmb3IgKGludCBudGggPSAwOyBudGgg PCB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdOyArK250aCkK KyAgICAgICAgeworICAgICAgICAgIHNhbWVfcCB8PQorICAgICAgICAgICAgKHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uc2FtZV9wID09IHRydWUKKyAgICAg ICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhd LmdseXBoLnR5cGUgPT0gZ2x5cGgtPnR5cGUKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLmJ5dGVwb3MgPT0gZ2x5cGgt PmJ5dGVwb3MKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudG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F0uYmcuZ3Jl ZW4gPT0gYmFja2dyb3VuZC5ncmVlbgorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmcuYmx1ZSA9PSBiYWNrZ3JvdW5kLmJsdWUK KyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLmFjdGl2ZV9wID09IGFjdGl2ZV9wCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5nbHlwaF9mbGF2b3IgPT0gZ2x5cGhf Zmxhdm9yCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXS5lbmFibGVkX3AgPT0gdHJ1ZSk7CisgICAgICAgIH0KKyAgICAgIGlmICgh c2FtZV9wKQorICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgbWF0cml4LCByb3csIHgs IGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBhY3RpdmVfcCwgZ2x5 cGhfZmxhdm9yLCByZW1vdmVfcCk7CisgICAgICByZXR1cm47CisgICAgfQorICAgIGVsc2UgaWYg KGRyYXdfcAorICAgICAgICAgICAgICYmIChmcm9tX3doZXJlID09IFNDUklCRV9PTkUKKyAgICAg ICAgICAgICAgICAgfHwgZnJvbV93aGVyZSA9PSBTQ1JJQkVfVFdPCisgICAgICAgICAgICAgICAg IHx8IGZyb21fd2hlcmUgPT0gU0NSSUJFX1RIUkVFCisgICAgICAgICAgICAgICAgIHx8IGZyb21f d2hlcmUgPT0gTk9XSEVSRSkpCisgICAgICB7CisgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlk ICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwgY3Vyc29y X3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIGZvcmVn cm91bmQsIGFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIHJlbW92ZV9wKTsKKyAgICAgICAgcmV0dXJu OworICAgICAgfQorICBpZiAoY2FjaGVfdHlwZSA9PSBOT19DQUNIRSkKKyAgICByZXR1cm47Cisg ICsrdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90eXBlXTsKKyAgaWYgKHZudGggPj0g dy0+bWNfbWF0cml4LnZwb3NfdXNlZCkKKyAgICB3LT5tY19tYXRyaXgudnBvc191c2VkID0gdm50 aCArIDE7CisgIGlmICh3LT5tY19tYXRyaXgudnBvc19hbGxvY2F0ZWQgPCB3LT5tY19tYXRyaXgu dnBvc191c2VkKQorICAgIHsKKyAgICAgIGludCBvbGRfYWxsb2MgPSB3LT5tY19tYXRyaXgudnBv c19hbGxvY2F0ZWQ7CisgICAgICBpbnQgbmV3X2VsdHMgPSB3LT5tY19tYXRyaXgudnBvc191c2Vk IC0gdy0+bWNfbWF0cml4LnZwb3NfYWxsb2NhdGVkOworICAgICAgdy0+bWNfbWF0cml4LnZwb3Mg PSB4cGFsbG9jICh3LT5tY19tYXRyaXgudnBvcywgJnctPm1jX21hdHJpeC52cG9zX2FsbG9jYXRl ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2VsdHMsIElOVF9NQVgs IHNpemVvZiAqdy0+bWNfbWF0cml4LnZwb3MpOworICAgICAgbWVtc2V0ICh3LT5tY19tYXRyaXgu dnBvcyArIG9sZF9hbGxvYywgMCwKKyAgICAgICAgICAgICAgICh3LT5tY19tYXRyaXgudnBvc19h bGxvY2F0ZWQgLSBvbGRfYWxsb2MpICogc2l6ZW9mICp3LT5tY19tYXRyaXgudnBvcyk7CisgICAg fQorICArK3ctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV07Cisg IGlmICh3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV0g PCB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdKQorICAgIHsK KyAgICAgIGludCBvbGRfYWxsb2MgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxv Y2F0ZWRbY2FjaGVfdHlwZV07CisgICAgICBpbnQgbmV3X2VsdHMgPSB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdIC0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVfYWxsb2NhdGVkW2NhY2hlX3R5cGVdOworICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV0gPSB4cGFsbG9jICh3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX2FsbG9j YXRlZFtjYWNoZV90eXBlXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgbmV3X2VsdHMsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElOVF9NQVgsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiAqdy0+ bWNfbWF0cml4LnZwb3N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LCBzbyB0aGF0IG5vIG1lYW5p bmdmdWwgZ2x5cGggY2FuIGJlIHJldHVybmVkLiAqLworc3RydWN0IGdseXBoICoKK21jX2dldF9j dXJzb3JfZ2x5cGggKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJp eCwKKyAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgaW50IGhwb3Ms IGludCB2cG9zKQoreworICBzdHJ1Y3QgZ2x5cGggKmdseXBoOworICBpZiAoISh2cG9zID49IDAK KyAgICAgICAgJiYgdnBvcyA8IG1hdHJpeC0+bnJvd3MpKQorICAgIHJldHVybiBOVUxMOworICBp ZiAoIXJvdy0+ZW5hYmxlZF9wKQorICAgIHJldHVybiBOVUxMOworICBpZiAody0+aHNjcm9sbCkK KyAgICB7CisgICAgICAvKiBXaGVuIHRoZSB3aW5kb3cgaXMgaHNjcm9sbGVkLCBjdXJzb3IgaHBv cyBjYW4gbGVnaXRpbWF0ZWx5IGJlCisgICAgICBvdXQgb2YgYm91bmRzLCBidXQgd2UgZHJhdyB0 aGUgY3Vyc29yIGF0IHRoZSBjb3JyZXNwb25kaW5nCisgICAgICB3aW5kb3cgbWFyZ2luIGluIHRo YXQgY2FzZS4gKi8KKyAgICAgIGlmICghcm93LT5yZXZlcnNlZF9wICYmIGhwb3MgPCAwKQorICAg ICAgICBocG9zID0gMDsKKyAgICAgIGlmIChyb3ctPnJldmVyc2VkX3AgJiYgaHBvcyA+PSByb3ct PnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgICAgaHBvcyA9IHJvdy0+dXNlZFtURVhUX0FSRUFdIC0g MTsKKyAgICB9CisgIGlmICgwIDw9IGhwb3MgJiYgaHBvcyA8IHJvdy0+dXNlZFtURVhUX0FSRUFd KQorICAgIGdseXBoID0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIGhwb3M7CisgICAgZWxzZQor ICAgICAgZ2x5cGggPSBOVUxM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k9XLT5WSVNJQkxFX0hFSUdIVC4KKyAgICAgICBGSVhNRTog IEFkZCBjb25kaXRpb25zIGZvciB1c2VyLXNwZWNpZmllZCB0aGlja25lc3Mgb2YgTUNfQkFSIGFu ZAorICAgICAgICAgICAgICAgTUNfSEJBUiBhcyB0byBgbWMtcmVhbC1mYWtlLWN1cnNvcicuCisg ICBNVUxUSVBMRV9DVVJTT1JTOiAgV2UgZG8gbm90IHVzZSB0aGlzIGZ1bmN0aW9uLgorICAgSE9S SVpPTlRBTF9SVUxFUjogIFdlIHdhbnQgYSB1bml2ZXJzYWwgRlkgY29vcmRpbmF0ZSBmb3IgYSBs ZXZlbCBydWxlci4KKyAgIFZFUlRJQ0FMX1JVTEVSIGFuZCBGSUxMX0NPTFVNTjogIFdlIHdhbnQg YW4gSCB0aGF0IGVuc3VyZXMgbm8gZ2FwIGJldHdlZW4gdGhlCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBwcmV2aW91cy9uZXh0IGxpbmUuICBUaGUgRlggY29vcmRpbmF0ZSBp cyBzZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V3aGVyZTogIGB3 LT5jdXJzb3IueGAgLyBgbWMuZmNfeGAuICovCit2b2lkCittY19nZXRfY3Vyc29yX2dlb21ldHJ5 IChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsCisgICAgICAg ICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCB4LCBpbnQgKmZ4LCBp bnQgeSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCAqZnksIGludCBocG9zLCBpbnQgdnBv cywgaW50ICpoLAorICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBj dXJzb3JfdHlwZSwgaW50IGN1cnNvcl93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGlu dCAqd2QpCit7CisgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSBtY19nZXRfY3Vyc29yX2dseXBoICh3 LCBtYXRyaXgsIHJvdywgaHBvcywgdnBvcyk7CisgIGlmIChnbHlwaCA9PSBOVUxMKQorICAgIHJl dHVybjsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAg KmZ4ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgeCk7CisgICpoID0gcm93LT52 aXNpYmxlX2hlaWdodDsKKyAgLyogRG9uJ3QgbGV0IHRoZSBjdXJzb3IgZXhjZWVkIHRoZSBkaW1l bnNpb25zIG9mIHRoZSByb3csIHNvIHRoYXQKKyAgdGhlIHVwcGVyL2xvd2VyIHNpZGUgb2YgdGhl IGJveCBhcmVuJ3QgY2xpcHBlZC4gICovCisgIGludCB3X2hlYWRlcl9saW5lX2hlaWdodCA9IFdJ TkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICBpbnQgd190ZXh0X2JvdHRvbV95ID0gd2lu ZG93X3RleHRfYm90dG9tX3kgKHcpIC0gKmg7CisgIGlmICh5IDwgd19oZWFkZXJfbGluZV9oZWln aHQpCisgICAgeworICAgICAgKmggPSBtYXggKCpoIC0gKHdfaGVhZGVyX2xpbmVfaGVpZ2h0IC0g eSkgKyAxLCAqaCk7CisgICAgICB5ID0gd19oZWFkZXJfbGluZV9oZWlnaHQgLSAxOworICAgICAg Ly8gZnByaW50ZiAoc3RkZXJyLCAiQ09ORElUSU9OICMgMVxuIik7CisgICAgfQorICAgZWxzZSBp ZiAoeSA+IHdfdGV4dF9ib3R0b21feSkKKyAgICAgeworICAgICAgICpoICs9IHkgLSB3X3RleHRf Ym90dG9tX3k7CisgICAgICAgeSA9IHdfdGV4dF9ib3R0b21feTsKKyAgICAgICAvLyBmcHJpbnRm IChzdGRlcnIsICJDT05ESVRJT04gIyAyXG4iKTsKKyAgICAgfQorICAqZnkgPSBXSU5ET1dfVE9f RlJBTUVfUElYRUxfWSAodywgeSk7CisgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgeworICAg ICAgY2FzZSBNQ19CQVI6CisgICAgICAgIHsKKyAgICAgICAgICBpZiAoY3Vyc29yX3dpZHRoIDwg MSkKKyAgICAgICAgICAgIGN1cnNvcl93aWR0aCA9IG1heCAoRlJBTUVfQ1VSU09SX1dJRFRIIChm KSwgMSk7CisgICAgICAgICAgaWYgKGN1cnNvcl93aWR0aCA8IGdseXBoLT5waXhlbF93aWR0aCkK KyAgICAgICAgICAqd2QgPSBjdXJzb3Jfd2lkdGg7CisgICAgICAgICAgYnJlYWs7CisgICAgICAg IH0KKyAgICAgIGNhc2UgTUNfSEJBUjoKKyAgICAgICAgeworICAgICAgICAgIGludCBjdXJzb3Jf aGVpZ2h0ID0gKGN1cnNvcl93aWR0aCA8IDEpID8gbHJpbnQgKDAuMjUgKiAqaCkgOiBjdXJzb3Jf d2lkdGg7CisgICAgICAgICAgaWYgKGN1cnNvcl9oZWlnaHQgPiByb3ctPmhlaWdodCkKKyAgICAg ICAgICAgIGN1cnNvcl9oZWlnaHQgPSByb3ctPmhlaWdodDsKKyAgICAgICAgICAvKiBDdXJzb3Ig c21hbGxlciB0aGFuIGxpbmUgaGVpZ2h0LCBzbyBtb3ZlIGRvd24uICovCisgICAgICAgICAgaWYg KCpoID4gY3Vyc29yX2hlaWdodCkKKyAgICAgICAgICAgICpmeSArPSAqaCAtIGN1cnNvcl9oZWln aHQ7CisgICAgICAgICAgKmggPSBjdXJzb3JfaGVpZ2h0OworICAgICAgICAgICp3ZCA9IGdseXBo LT5waXhlbF93aWR0aDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgY2FzZSBN Q19SSUdIVF9GUklOR0VfQklUTUFQOgorICAgICAgY2FzZSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVA6 CisgICAgICBjYXNlIE1DX05PX0ZSSU5HRV9CSVRNQVA6Cis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T19GUkFNRV9QSVhFTF9YICh3LCBlc3NlbnRpYWxz LmZjX3gpOworICBib29sIGdseXBoX3p2X3AgPSAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FS RUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICYmIE1BVFJJ WF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgPT0gWlYpOworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJB TUUgKHctPmZyYW1lKTsKKyAgTGlzcF9PYmplY3QgYnVmID0gdy0+Y29udGVudHM7CisgIENIRUNL X0JVRkZFUiAoYnVmKTsKKyAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKGJ1Zik7CisgIGlu dCB0ZXh0X2FyZWFfd2lkdGggPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOworICBz dHJ1Y3QgZ2x5cGhfcm93ICpjdXJzb3Jfcm93ID0gKHctPmN1cnNvci52cG9zICE9IC0xKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XIChjdXJzb3JfbWF0cml4 LCB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTlVM TDsKKyAgc3RydWN0IGdseXBoICpjdXJzb3JfZ2x5cGggPSAody0+Y3Vyc29yLnZwb3MgIT0gLTEp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY19nZXRfY3Vyc29yX2dseXBoICh3 LCBjdXJzb3JfbWF0cml4LCBjdXJzb3Jfcm93LAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9z KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTlVMTDsKKyAgYm9vbCBjdXJzb3Jf YXRfZnJpbmdlX3AgPSAoY3Vyc29yX2dseXBoID09IE5VTEwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgY3Vyc29yX3JvdyAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHctPmN1cnNvci5ocG9zID09IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93LT5leGFjdF93aW5kb3dfd2lk dGhfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID09 IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJz b3IueCA9PSBjdXJzb3Jfcm93LT5waXhlbF93aWR0aCk7CisgIGJvb2wgY3Vyc29yX2JleW9uZF9m cmluZ2VfcCA9IChjdXJzb3JfZ2x5cGggPT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgY3Vyc29yX3JvdyAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0K KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFjdXJzb3Jfcm93LT5leGFjdF93 aW5kb3dfd2lkdGhfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5jdXJzb3IueCA+PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHctPmN1cnNvci54ID49IGN1cnNvcl9yb3ctPnBpeGVsX3dpZHRoKTsKKyAgaW50 IGZyYW1lX2NoYXJfd2lkdGggPSBGUkFNRV9DT0xVTU5fV0lEVEggKGYpOworICBpbnQgdGVtcF9m YWNlX2lkID0gZ2x5cGgtPmZhY2VfaWQ7CisgIHN0cnVjdCBtY19SR0IgYmFja2dyb3VuZDsKKyAg bWNfc2V0X2xzbF9iZyAodywgdGVtcF9mYWNlX2lkLCAmYmFja2dyb3VuZCk7CisgIGJvb2wgcmVh bF9mYWtlX2N1cnNvcl9wID0gKG9wb2ludF94ID09IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgb3BvaW50X2hwb3MgPT0gaHBvcworICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBvcG9pbnRfeSA9PSByb3ctPnkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgb3BvaW50X3Zwb3MgPT0gdnBvcyk7CisKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAq LworLyogICAgICAgICAgICAgICAgICAgICAgIEJFR0lOOiAgQ0hBUl9HTFlQSCB8IEdMWVBITEVT U19HTFlQSCAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAg aWYgKGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgIHx8IGdseXBoLT50eXBlID09IEdM WVBITEVTU19HTFlQSCkKKyAgeworICAgIGlmIChtY19zdGRlcnJfcCkKKyAgICAgIGZwcmludGYg KHN0ZGVyciwKKyAgICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2Qg MHglMDZ4ICU0ZCAlMS4xZCUxLjFkICAlM2QgJXMgJXNcbiIsCisgICAgICAgIGdseXBoIC0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAw IDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgIChn bHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAgICA/ICdDJworICAgICAgICAgOiAnRycp LAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmpl Y3QpCisgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkK KyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQor ICAgICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICAg ICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIGdseXBoLT51LmNoLAorICAgICAgICBn bHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAg Z2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9w ID8gIlpWIiA6ICItLSIsCisgICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nIChnbHlwaC0+dS5jaCkp OworICBzd2l0Y2ggKGFjdGlvbl90eXBlKQorICB7CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8K Ky8qICAgICAgICAgICAgICAgTVVMVElQTEVfQ1VSU09SUzogIENIQVJfR0xZUEggfCBHTFlQSExF U1NfR0xZUEggICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAg Y2FzZSBNVUxUSVBMRV9DVVJTT1JTOgorICAgIHsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4 LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAg ICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBi YWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBNQ19HTFlQ SCwgZHJhd19wLCBmcm9tX3doZXJlLCBjYWNoZV90eXBlLAorICAgICAgICAgICAgICAgICBhY3Rp b25fdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8K Ky8qICAgICAgICAgICAgICAgSE9SSVpPTlRBTF9SVUxFUjogIENIQVJfR0xZUEggfCBHTFlQSExF U1NfR0xZUEggICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAg Y2FzZSBIT1JJWk9OVEFMX1JVTEVSOgorICAgIHsKKyAgICAgIGlmIChyZWxhdGl2ZV94IDwgcm93 LT5waXhlbF93aWR0aAorICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAg IG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnks IGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJz b3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgICAgZXNz ZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlw ZSwKKyAgICAgICAgICAgICAgICAgICBhY3Rpb25fdHlwZSk7CisgICAgICBpZiAoZ2x5cGggLSBy b3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAm JiByZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAocmVsYXRp dmVfeCA8IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHJl bGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICBmeCArPSBnbHlw aC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgICAgbWNfaGVscGVyICh3LCBt YXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAg ICAgICAgICAgICAgICAgICAgIHhfbGltaXQgLSByZWxhdGl2ZV94LCBoLCBjdXJzb3JfdHlwZSwg Y3Vyc29yX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZCwgYmFja2dyb3Vu ZCwgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEhMRVNTLAorICAgICAgICAgICAgICAgICAg ICAgZHJhd19wLCBmcm9tX3doZXJlLCBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICAg IH0KKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAg ICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIENIQVJfR0xZUEggfCBHTFlQSExFU1NfR0xZUEgg ICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIFZF UlRJQ0FMX1JVTEVSOgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9 IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiByb3ctPmNvbnRpbnVlZF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+Y29udGludWVkX3AKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUgorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9v bl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZF UlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRf QVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlv bmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1 cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXSAhPSAxCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoIC0gcm93LT5nbHlwaHNb VEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeCA+PSByb3ctPnBpeGVsX3dpZHRoKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfenZfcCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogTUNfR0xZUEg7CisgICAgICBpZiAoZ2x5cGhfZmxhdm9yID09 IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9 PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICA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x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNl ZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBlc3Nl bnRpYWxzLmZjX3ggPj0gcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogKGdseXBoX3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6ICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBj aF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBvcG9pbnRfeSA9PSB5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBvcG9pbnRfdnBvcyA9PSB2cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBNQ19HTFlQSDsKKyAgICAgIHdkID0gMTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4 LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmY19meCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAg ICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5k LCBiYWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9wLCB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tLS0tLS0tLSAqLworICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBT VFJFVENIX0dMWVBIKQorICB7CisgICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAgZnByaW50ZiAo c3RkZXJyLAorICAgICAgICAiXG4gJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAw eCUwNnggJTRkICUxLjFkJTEuMWQgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ct PmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAg OiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ1Mn LAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmpl Y3QpCisgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkK KyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQor ICAgICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBn bHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIDB1LAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwK KyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2Jv eF9saW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIs CisgICAgICAgICJcXFMiKTsKKyAgc3dpdGNoIChhY3Rpb25fdHlwZSkKKyAgeworLyogLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0t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gICAgICAmJiAhcmVhbF9mYWtlX2N1 cnNvcl9wKQorICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRp dmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgIHdkLCBoLCBj dXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAg ICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGZyb21f d2hlcmUsIGNhY2hlX3R5cGUsCisgICAgICAgICAgICAgICAgICAgYWN0aW9uX3R5cGUpOworICAg ICAgaWYgKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0g LSAxCisgICAgICAgICAgJiYgcmVsYXRpdmVfeCA8PSB4X2xpbWl0KQorICAgICAgICB7CisgICAg ICAgICAgaWYgKHJlbGF0aXZlX3ggPCByb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgcmVs YXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgdGVtcF9mYWNlX2lkID0g KHJvdy0+ZmlsbF9saW5lX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgPyBnbHlwaC0+ZmFj ZV9pZAorICAgICAgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAg ICAgIHN0cnVjdCBtY19SR0IgYmFja2dyb3VuZDsKKyAgICAgICAgICBtY19zZXRfbHNsX2JnICh3 LCB0ZW1wX2ZhY2VfaWQsICZiYWNrZ3JvdW5kKTsKKyAgICAgICAgICBtY19oZWxwZXIgKHcsIG1h dHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAg ICAgICAgICAgICAgICAgICAgeF9saW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gICAg ICAgICAgICAgJiYgb3BvaW50X3ggPiByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoKQor ICAgICAgICAgIHRlbXBfZmFjZV9pZCA9IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgIHN0cnVjdCBt Y19SR0IgYmFja2dyb3VuZDsKKyAgICAgIG1jX3NldF9sc2xfYmcgKHcsIHRlbXBfZmFjZV9pZCwg JmJhY2tncm91bmQpOworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1cnNv cl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJv dy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g TUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0 X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxf QkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChj dXJzb3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmlu Z2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jv dy0+dXNlZFtURVhUX0FSRUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSExFU1M7CisgICAgICBpZiAoZ2x5 cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGds eXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAg ICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAg ICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICB8fCBnbHlw aF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICBjdXJzb3JfdHlw ZSA9IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA7CisgICAgICB3ZCA9IDE7CisgICAgICBtY19oZWxw ZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgb3Bv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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIEVORDogIFNUUkVUQ0hfR0xZUEggICAgICAgICAgICAgICAgICAg ICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisKKy8qIC0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCRUdJTjogIElNQUdFX0dM WVBIICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0g Ki8KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgIHsKKyAgICBpZiAo bWNfc3RkZXJyX3ApCisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICJcbiAlNSJwRCJk LyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4xZCAgJTNkICVz ICVjXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAg ICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAg ICAgICByZWxhdGl2ZV94LAorICAgICAgICAnSScsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAor ICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0InCisgICAgICAg ICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAg ICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICA/ICcwJworICAgICAg ICAgICAgICAgOiAnLScpKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAg KHVuc2lnbmVkIGludCkgZ2x5cGgtPnUuaW1nX2lkLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwK KyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2Jv eF9saW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIs CisgICAgICAgICcuJyk7CisgIHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgTVVMVElQTEVfQ1VSU09S UzogIElNQUdFX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0gKi8KKyAgICBjYXNlIE1VTFRJUExFX0NVUlNPUlM6CisgICAgeworICAgICAgY3Vyc29y X3R5cGUgPSBNQ19IT0xMT1dfQk9YOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywg Z2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAg ICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGJhY2tncm91 bmQsCisgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3 X3AsIGZyb21fd2hlcmUsIGNhY2hlX3R5cGUsCisgICAgICAgICAgICAgICAgIGFjdGlvbl90eXBl KTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAg ICAgICAgICAgICAgICAgICAgICAgSE9SSVpPTlRBTF9SVUxFUjogIElNQUdFX0dMWVBIICAgICAg ICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEhP UklaT05UQUxfUlVMRVI6CisgICAgeworICAgICAgY3Vyc29yX3R5cGUgPSBNQ19IT0xMT1dfQk9Y OworICAgICAgaWYgKCFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywg bWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisg ICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGZvcmVn cm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVf cCwgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwKKyAgICAgICAgICAg ICAgICAgICBhY3Rpb25fdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKi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0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tICovCisKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAg ICAgICAgICAgICAgICAgICAgICAgQkVHSU46ICBDT01QT1NJVEVfR0xZUEggICAgICAgICAgICAg ICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgZWxzZSBpZiAoZ2x5 cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKQorICB7CisgICAgaWYgKG1jX3N0ZGVycl9wKQor ICAgICAgeworICAgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICAgIlxuICU1InBEImQv JS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4IiwKKyAgICAgICAgICBnbHlwaCAtIHJv dy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkg PyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAg ICAgICAnKycsCisgICAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgICAgKEJVRkZFUlAg KGdseXBoLT5vYmplY3QpCisgICAgICAgICAgID8gJ0InCisgICAgICAgICAgIDogKFNUUklOR1Ag KGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICAgIDogKE5J TFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAg ICAgIDogJy0nKSkpLAorICAgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgICAo dW5zaWduZWQgaW50KSBnbHlwaC0+dS5jbXAuaWQpOworICAgICAgICBmcHJpbnRmIChzdGRlcnIs ICIgJTRkICUxLjFkJTEuMWQiLAorICAgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICAg IGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5l X3ApOworICAgICAgaWYgKGdseXBoLT51LmNtcC5hdXRvbWF0aWMpCisgICAgICAgIGZwcmludGYg KHN0ZGVyciwgIiAgJTNkICVzIC4gWyVkLSVkXVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAg ICBnbHlwaC0+aHBvcywgZ2x5cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAgICAgICAg ICAgICAgICAgIGdseXBoLT5zbGljZS5jbXAuZnJvbSwgZ2x5cGgtPnNsaWNlLmNtcC50byk7Cisg ICAgICAgIGVsc2UKKyAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJcbiIpOworICAgICAgfQor ICBzd2l0Y2ggKGFjdGlvbl90eXBlKQorICB7CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8q ICAgICAgICAgICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTOiAgQ09NUE9TSVRFX0dMWVBI ICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2Fz ZSBNVUxUSVBMRV9DVVJTT1JTOgorICAgIHsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCBy b3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsI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gYWN0aW9uX3R5cGUpOworICAgICAgaWYgKGdseXBoIC0gcm93LT5nbHlwaHNb VEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYgcmVsYXRpdmVf eCA8PSB4X2xpbWl0KQorICAgICAgICB7CisgICAgICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+ cGl4ZWxfd2lkdGg7CisgICAgICAgICAgd2hpbGUgKHJlbGF0aXZlX3ggPD0geF9saW1pdCkKKyAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5 cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAg ICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYmFj a2dyb3VuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBN Q19HTFlQSExFU1MsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0g ZnJhbWVfY2hhcl93aWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgYnJlYWs7 CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAg ICAgICBWRVJUSUNBTF9SVUxFUjogIENPTVBPU0lURV9HTFlQSCAgICAgICAgICAgICAgICAgICAg Ki8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgVkVSVElDQUxfUlVMRVI6Cisg ICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1cnNvcl9hdF9mcmlu Z2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+Y29udGlu dWVkX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElD QUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAo Y3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX1JJR0hU X0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5 b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBy b3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+dXNlZFtU RVhUX0FSRUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm ICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJv dy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIG9wb2ludF94ID49IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IChnbHlwaF96dl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBNQ19HTFlQSDsKKyAgICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFS X1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZF UlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19W RVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZF UlRJQ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YmIGVzc2VudGlhbHMuZmNfeCA+ IHJlbGF0aXZlX3gpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNf R0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF96 dl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVT UworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoIU5JTFAgKEJWQVIgKGIs IGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg IU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfdmVydGljYWxfcnVsZXIpKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3kgPT0geQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3Zwb3MgPT0g dnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExF U1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfR0xZUEg7CisgICAg ICB3ZCA9IDE7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRp dmVfeCwgZmNfZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICB3ZCwgaCwg Y3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwKKyAgICAg ICAgICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCBkcmF3X3AsIGZy b21fd2hlcmUsIGNhY2hlX3R5cGUsCisgICAgICAgICAgICAgICAgIGFjdGlvbl90eXBlKTsKKyAg ICAgIGJyZWFrOwor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ZSAoZmFsc2UpOworI2Vsc2UKKyAgICBp ZiAobWNfc3RkZXJyX3ApCisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICJcbiAgJTVk LyUtNWQgJTVkICU0YyAlNmQgJWMgJTNkIDB4JTA1eCAlNGQgJTEuMWQlMS4xZCAgJTNkICVzICVj XG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgo cm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAg ICByZWxhdGl2ZV94LAorICAgICAgICAnWCcsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAg ICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0InCisgICAgICAgICA6 IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICAg IDogJy0nKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgZ2x5cGgtPmZh Y2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5y aWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+dS54d2lkZ2V0LAorICAgICAgICBnbHlw aC0+aHBvcywgZ2x5cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAnLicpOworI2VuZGlm CisgIHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLwor LyogICAgICAgICAgICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTOiAgWFdJREdFVF9HTFlQ SCAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tL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gICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgs IGZvcmVncm91bmQsIGJhY2tncm91bmQsCisgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5h Y3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwKKyAgICAg ICAgICAgICAgICAgICBhY3Rpb25fdHlwZSk7CisgICAgICBpZiAoZ2x5cGggLSByb3ctPmdseXBo c1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiByZWxhdGl2 ZV94IDw9IHhfbGltaXQpCisgICAgICAgIHsKKyAgICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBo LT5waXhlbF93aWR0aDsKKyAgICAgICAgICB3aGlsZSAocmVsYXRpdmVfeCA8PSB4X2xpbWl0KQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBn bHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAg ICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBi YWNrZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZlX3As IE1DX0dMWVBITEVTUywgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICAgICAg ICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgICAgICAgICAgcmVsYXRpdmVfeCAr PSBmcmFtZV9jaGFyX3dpZHRoOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBicmVh azsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAg ICAgICAgICBWRVJUSUNBTF9SVUxFUjogIFhXSURHRVRfR0xZUEggICAgICAgICAgICAgICAgICAg ICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBWRVJUSUNBTF9SVUxFUjoK KyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoY3Vyc29yX2F0X2Zy aW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT5jb250 aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJU SUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmICFyb3ctPmNvbnRpbnVlZF9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfUklH SFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9i ZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5b25kX2ZyaW5nZV9wCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93LT51c2Vk W1RFWFRfQVJFQV0gIT0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0g cm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgb3BvaW50X3ggPj0gcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogKGdseXBoX3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IE1DX0dMWVBIOworICAgICAgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9C QVJfUklHSFRfQVJST1cKKyAgICAgICAgIC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MTF9DT0xVTU46 CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGdseXBoIC0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID4gcmVsYXRpdmVfeCkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX3p2X3ApCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6ICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeSA9PSB5CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfdnBvcyA9PSB2cG9zKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIG1jX2hlbHBlciAo dywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmY19meCwgeSwgZnksIGhwb3MsIHZw b3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBm b3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLAorICAgICAg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HN0cnVjdCBtY19lc3NlbnRpYWxzIGVzc2VudGlhbHMsCisgICAgICAgICAgICAgZW51bSBtY19y b3dfcG9zaXRpb24gcm93X3Bvc2l0aW9uLCBib29sIGRyYXdfcCwgZW51bSBtY19kcmF3X3Jvd190 eXBlIGZyb21fd2hlcmUpCit7CisgIC8vICBjbG9ja190IGNsb2NrX3N0YXJ0ID0gY2xvY2soKTsK KyAgLyogVzMyIEVtYWNzIGNyYXNoZXMgb24gc3RhcnR1cCB3aXRob3V0IGEgYEJVRkZFUlAnIGNo ZWNrIGluIGB1cGRhdGVfd2luZG93Jy4gKi8KKyAgaWYgKCFCVUZGRVJQICh3LT5jb250ZW50cykp CisgICAgcmV0dXJuOworICBMaXNwX09iamVjdCBidWYgPSB3LT5jb250ZW50czsKKyAgQ0hFQ0tf QlVGRkVSIChidWYpOworICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAoYnVmKTsKKyAgaWYg KE5JTFAgKEJWQVIgKGIsIG1jX2NvbmYpKQorICAgICAgJiYgTklMUCAoQlZBUiAoYiwgY3Jvc3No YWlycykpCisgICAgICAmJiBOSUxQIChCVkFSIChiLCBmY192aXNpYmxlKSkpCisgICAgcmV0dXJu OworICBzdHJ1Y3QgZ2x5cGhfcm93ICpib3R0b21fcm93ID0gTUFUUklYX0JPVFRPTV9URVhUX1JP VyAobWF0cml4LCB3KTsKKyAgaW50IGJvdHRvbV92cG9zID0gTUFUUklYX1JPV19WUE9TIChib3R0 b21fcm93LCBtYXRyaXgpOworICBpZiAodnBvcyA9PSBib3R0b21fdnBvcykKKyAgICByZXR1cm47 CisgIGlmICghcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgcmV0dXJuOworICBpbnQgaHBvc19z dGFydCA9IHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgaWYgKHRyYWNlX3JlZGlz cGxheV9wKQorICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX2RyYXdfcm93ICglZCk6ICBkcmF3X3Ag KCVzKSB8IGhwb3MgKCVkKSB8IGxlbiAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgdnBv cywgZHJhd19wID8gInkiIDogIm4iLCBocG9zX3N0YXJ0LCBocG9zX2xlbmd0aCk7CisgIGludCBv cG9pbnRfZngsIG9wb2ludF9meSwgb3BvaW50X3dkLCBvcG9pbnRfaDsKKyAgaW50IHRleHRfYXJl YV93aWR0aCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgIGludCBoZWFkZXJf bGluZV9mb3JtYXQgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgc3RydWN0IGds eXBoX3JvdyAqY3Vyc29yX3JvdyA9ICh3LT5jdXJzb3IudnBvcyAhPSAtMSkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPVyAoY3Vyc29yX21hdHJpeCwgdy0+Y3Vy c29yLnZwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgIHN0 cnVjdCBnbHlwaCAqY3Vyc29yX2dseXBoID0gKHctPmN1cnNvci52cG9zICE9IC0xKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfZ2V0X2N1cnNvcl9nbHlwaCAodywgY3Vyc29y X21hdHJpeCwgY3Vyc29yX3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcykKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgIGJvb2wgY3Vyc29yX2F0X2ZyaW5n ZV9wID0gKGN1cnNvcl9nbHlwaCA9PSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIGN1cnNvcl9yb3cgIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5jdXJzb3IuaHBvcyA9PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVf cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA9PSB0ZXh0X2Fy ZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0g Y3Vyc29yX3Jvdy0+cGl4ZWxfd2lkdGgpOworICBib29sIGN1cnNvcl9iZXlvbmRfZnJpbmdlX3Ag PSAoY3Vyc29yX2dseXBoID09IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIGN1cnNvcl9yb3cgIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgdy0+Y3Vyc29yLmhwb3MgPT0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhY3Vyc29yX3Jvdy0+ZXhhY3Rfd2luZG93X3dp ZHRoX2xpbmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29y LnggPj0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiB3LT5jdXJzb3IueCA+PSBjdXJzb3Jfcm93LT5waXhlbF93aWR0aCk7CisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgUkVQTEFDRSBUSEUgUkVBTCBD VVJTT1IKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioq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jX2NvbG9y X3BpY2tlciAodywgY3Vyc29yX2dseXBoLCBlc3NlbnRpYWxzLCAmY3Vyc29yX2ZnLCAtMSwgY3Vy c29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgcm93X3Bvc2l0aW9uLCBDVVJTT1JfSU5ESUNB VE9SKTsKKyAgYm9vbCBmaWxsX2NvbHVtbl90cnVtcHNfcCA9ICghTklMUCAoQlZBUiAoYiwgY2hf dmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQ IChCVkFSIChiLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiB3LT5jdXJzb3IueCA9PSBlc3NlbnRpYWxzLmZjX3gKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiAhY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgIWN1cnNvcl9iZXlvbmRfZnJpbmdlX3ApOworICAvKiBXZSB1c2UgYSB0ZXN0IHNp bWlsYXIgdG8gdGhlIHJlYWwgZmFrZSBjdXJzb3Igc28gdGhhdCB0aGUgZnJpbmdlIGJpdG1hcCBp cworICBvbmx5IGRyYXduIG9uY2UgcGVyIHdpbmRvdy4gKi8KKyAgaWYgKHZwb3MgPT0gdy0+Y3Vy c29yLnZwb3MKKyAgICAgICYmIGhwb3Nfc3RhcnQgKyBocG9zX2xlbmd0aCA9PSByb3ctPnVzZWRb VEVYVF9BUkVBXQorICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAg JiYgIU5JTFAgKEJWQVIgKGIsIGNoX2hvcml6b250YWxfcnVsZXIpKSkKKyAgICB7CisgICAgICAv KiBmcmluZ2UgYml0bWFwcyB1c2UgZmFjZV9pZCB0byBzZXQgdGhlIGZvcmVncm91bmQgY29sb3Iu ICBUaGUgb3ZlcmxheS1hcnJvdworICAgICAgaXMgc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vbV93aGVyZSwgQ0hfQ0FDSEUsIENVUlNPUl9JTkRJQ0FUT1IpOworICAgIH0KKyAgLyog RVhBTVBMRSAoYnVmZmVyLWxvY2FsKTogIChzZXRxIG1jLXJlYWwtZmFrZS1jdXJzb3IgbmlsLydu by8ibm8iKSAqLworICBlbHNlIGlmICghY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICYm IGN1cnNvcl9nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICYmIGN1cnNvcl90eXBlID09IE1DX05P X0NVUlNPUgorICAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAg ICYmIHctPmN1cnNvci5ocG9zID49IGhwb3Nfc3RhcnQKKyAgICAgICAgICAgJiYgdy0+Y3Vyc29y Lmhwb3MgPCBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGgpCisgICAgeworICAgICAgLyogV2hlbiBh IHVzZXIgaGFzIG5vdCBzcGVjaWZpZWQgYSB2YWx1ZSBmb3IgYG1jLXJlYWwtZmFrZS1jdXJzb3In LCBvciB0aGUKKyAgICAgIHZhbHVlIGlzIGBub2AgaW4gdGhlIGZvcm0gb2YgYSBzeW1ib2wgb3Ig c3RyaW5nLCB0aGVuIHRoZSBkZWZhdWx0IHdlIHVzZQorICAgICAgYW4gTUNfQkFSIGFuZCBhbiBN Q19IQkFSIC0tIGJvdGggaGF2aW5nIGEgY3Vyc29yX3dpZHRoIG9mIDEuICovCisgICAgICBtY19n ZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRf ZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF9m eSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBNQ19CQVIsIDEsICZvcG9pbnRfd2QpOworICAgICAgbWNfaGVs cGVyICh3LCBtYXRyaXgsIHJvdywgY3Vyc29yX2dseXBoLCB3LT5jdXJzb3IueCwgb3BvaW50X2Z4 LCB3LT5jdXJzb3IueSwKKyAgICAgICAgICAgICAgICAgb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBv cywgdy0+Y3Vyc29yLnZwb3MsIG9wb2ludF93ZCwgb3BvaW50X2gsCisgICAgICAgICAgICAgICAg IE1DX0JBUiwgMSwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1D X0dMWVBITEVTUywKKyAgICAgICAgICAgICAgICAgZHJhd19wLCBmcm9tX3doZXJlLCBOSUxQIChC VkFSIChiLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IENIX0NBQ0hFCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19DQUNI RSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBt YXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1 cnNvci52cG9zLCAmb3BvaW50X2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQ19I QkFSLCAxLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGN1 cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAg ICAgICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCBvcG9p bnRfd2QsIG9wb2ludF9oLAorICAgICAgICAgICAgICAgICBNQ19IQkFSLCAxLCBjdXJzb3JfZmcs IGN1cnNvcl9iZywgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwKKyAgICAg ICAgICAgICAgICAgZnJvbV93aGVyZSwgTklMUCAoQlZBUiAoYiwgbWNfY29uZikpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiBNQ19DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgfQorICBlbHNlIGlmICgh Y3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaCAhPSBOVUxMCisg ICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAgICAgJiYgdy0+Y3Vy c29yLmhwb3MgPj0gaHBvc19zdGFydAorICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA8IGhw b3Nfc3RhcnQgKyBocG9zX2xlbmd0aAorICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPnR5cGUg IT0gU1RSRVRDSF9HTFlQSCkKKyAgICB7CisgICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3 LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHct PmN1cnNvci52cG9zLCAmb3BvaW50X2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBj dXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAo dywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+ Y3Vyc29yLnksCisgICAgICAgICAgICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHct PmN1cnNvci52cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9oLAorICAgICAgICAgICAgICAgICBjdXJz b3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBjdXJzb3JfZmcsIGN1cnNvcl9iZywgZXNzZW50aWFscy5h Y3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwg TklMUCAoQlZBUiAoYiwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiBNQ19DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgfQor ICBlbHNlIGlmICghY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICYmIGN1cnNvcl9nbHlw aCAhPSBOVUxMCisgICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAg ICAgJiYgdy0+Y3Vyc29yLmhwb3MgPj0gaHBvc19zdGFydAorICAgICAgICAgICAmJiB3LT5jdXJz b3IuaHBvcyA8IGhwb3Nfc3RhcnQgKyBocG9zX2xlbmd0aAorICAgICAgICAgICAmJiBjdXJzb3Jf Z2x5cGgtPnR5cGUgPT0gU1RSRVRDSF9HTFlQSCkKKyAgICB7CisgICAgICAvKiBJZiBhIHVzZXIg aGFzIHNldCBgeC1zdHJldGNoLWN1cnNvcicgdG8gYSBub24tbmlsIHZhbHVlLCBoZS9zaGUgY2hv c2UgdG8KKyAgICAgIGhhdmUgYSBjdXJzb3IgdGhhdCBzcGFucyB0aGUgZW50aXJlIGxlbmd0aCBv ZiB0aGUgU1RSRVRDSF9HTFlQSC4gKi8KKyAgICAgIGlmICgheF9zdHJldGNoX2N1cnNvcl9wKQor ICAgICAgICB7CisgICAgICAgICAgLyogVGhlIE1DX0hCQVIgc2hhbGwgaGF2ZSBhIGBjdXJzb3Jf d2lkdGhgIG9mIDEuICovCisgICAgICAgICAgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeSAodywgbWF0 cml4LCByb3csIHctPmN1cnNvci54LCAmb3BvaW50X2Z4LAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHctPmN1cnNvci55LCAmb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9o LCBNQ19IQkFSLCAxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZvcG9pbnRf d2QpOworICAgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwg dy0+Y3Vyc29yLngsIG9wb2ludF9meCwKKyAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci55 LCBvcG9pbnRfZnksIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywKKyAgICAgICAgICAg ICAgICAgICAgIG9wb2ludF93ZCwgb3BvaW50X2gsIE1DX0hCQVIsIDEsIGN1cnNvcl9mZywgY3Vy c29yX2JnLAorICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZ UEgsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgICAgIE5JTFAgKEJWQVIg KGIsIG1jX2NvbmYpKQorICAgICAgICAgICAgICAgICAgICAgPyBDSF9DQUNIRQorICAgICAgICAg ICAgICAgICAgICAgOiBNQ19DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgICAgIH0KKyAg ICAgIG1jX2dldF9jdXJzb3JfZ2VvbWV0cnkgKHcsIG1hdHJpeCwgcm93LCB3LT5jdXJzb3IueCwg Jm9wb2ludF9meCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci55LCAm b3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBl ciAodywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwg dy0+Y3Vyc29yLnksCisgICAgICAgICAgICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3Ms IHctPmN1cnNvci52cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9oLAorICAgICAgICAgICAgICAgICBj dXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBjdXJzb3JfZmcsIGN1cnNvcl9iZywgZXNzZW50aWFs cy5hY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVy ZSwgTklMUCAoQlZBUiAoYiwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiBNQ19DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAg fQorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgIERS QVcgQU5EIFJFQ09SRCBGQUtFIENVUlNPUlMKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICBp ZiAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICYmIE5JTFAgKEJWQVIgKGIsIG1jX2luYWN0 aXZlX3dpbmRvd3MpKQorICAgICAgJiYgTklMUCAoQlZBUiAoYiwgY2hfaW5hY3RpdmVfd2luZG93 cykpCisgICAgICAmJiBOSUxQIChCVkFSIChiLCBmY19pbmFjdGl2ZV93aW5kb3dzKSkpCisgICAg cmV0dXJuOworICBpZiAoaHBvc19sZW5ndGggPT0gMSkKKyAgICB7CisgICAgICBpZiAoIU5JTFAg KEJWQVIgKGIsIG1jX2NvbmYpKQorICAgICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisg ICAgICAgICAgICAgIHx8ICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAg JiYgIU5JTFAgKEJWQVIgKGIsIG1jX2luYWN0aXZlX3dpbmRvd3MpKSkpKQorICAgICAgICB7Cisg ICAgICAgICAgLyogVGhlIHNwYWNlIGFwcGVuZGVkIHRvIGEgcm93IGVuZGluZyB3aXRoIGEgbmV3 IGxpbmUKKyAgICAgICAgICBkb2VzIG5vdCBoYXZlIGEgYGdseXBoLT5jaGFycG9zYCAoLTEsIDAp IHRoYXQgd2UgY2FuCisgICAgICAgICAgdXNlIGZvciB0aGlzIHBhcnRpY3VsYXIgYXBwbGljYXRp b24uICBXaGVuIHRoZXJlIGlzIGEKKyAgICAgICAgICBgYnVmZmVyLWRpc3BsYXktdGFibGUnIGVu dHJ5IHRoYXQgYXNzaWducyBhIHZpc2libGUKKyAgICAgICAgICBnbHlwaCB0byBhIG5ldyBsaW5l LCB0aGVyZSBpcyBubyBwcm9ibGVtIGJlY2F1c2UgdGhhdAorICAgICAgICAgIGdseXBoIGhhcyBh IGBnbHlwaC0+Y2hhcnBvcycgdGhhdCB3ZSBjYW4gdXNlLiAgV2hlbgorICAgICAgICAgIG5vIHZp c2libGUgRU9MIGdseXBoIGV4aXN0cywgd2UgdXNlIHRoZSBmb2xsb3dpbmcKKyAgICAgICAgICB0 ZXN0OiAgdGhlIGFwcGVuZGVkIHNwYWNlIGhhcyBhIHBvc2l0aW9uIHRoYXQgaXMgb25lCisgICAg ICAgICAgbGVzcyB0aGFuIHRoZSBlbmQgb2YgdGhlIG1hdHJpeCByb3cuICovCisgICAgICAgICAg aW50IGhwb3MgPSBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICAgICAgc3Ry dWN0IGdseXBoICpwcmV2aW91c19nbHlwaCA9ICgwIDw9IGhwb3MgLSAxICYmIGhwb3MgLSAxIDwg cm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIGhwb3MgLSAxCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTlVMTDsKKyAgICAgICAgICAvLyBzdHJ1Y3Qg Z2x5cGggKmxhc3RfZ2x5cGggPSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RF WFRfQVJFQV0gLSAxOworICAgICAgICAgIGJvb2wgc2tpcF9wID0gKHByZXZpb3VzX2dseXBoICE9 IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiBwcmV2aW91c19nbHlwaC0+Y2hhcnBv cyA9PSBNQVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpIC0gMQorICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHN0YXJ0LT5ieXRlcG9zICE9IGVzc2VudGlhbHMuenZfYnl0ZSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgPyB0cnVlCisgICAgICAgICAgICAgICAgICAgICAgICAvKiBXaGVu IGEgYGJ1ZmZlci1kaXNwbGF5LXRhYmxlJyBlbnRyeSBjb250YWlucworICAgICAgICAgICAgICAg ICAgICAgICAgYSB2aXNpYmxlIHRhYiBjaGFyYWN0ZXIgKCLCuyIpLCB0aGUgc3Vic2VxdWVudAor ICAgICAgICAgICAgICAgICAgICAgICAgU1RSRVRDSF9HTFlQSCB3aWxsIGhhdmUgdGhlIHNhbWUg c3RhcnQtPmNoYXJwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgIGFzIHRoZSBhZm9yZW1lbnRp b25lZCB2aXNpYmxlIHRhYiBjaGFyYWN0ZXIuICovCisgICAgICAgICAgICAgICAgICAgICAgICA6 IChwcmV2aW91c19nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBw cmV2aW91c19nbHlwaC0+Y2hhcnBvcyA9PSBzdGFydC0+Y2hhcnBvcykKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgPyB0cnVlCisgICAgICAgICAgICAgICAgICAgICAgICA6IGZhbHNlOworICAg ICAgICAgIGludCBwb3NpbnQgPSAocm93X3Bvc2l0aW9uID09IFBPU1RfWlYpCisgICAgICAgICAg ICAgICAgICAgICAgICAgPyAtMQorICAgICAgICAgICAgICAgICAgICAgICA6IChyb3dfcG9zaXRp b24gPT0gQVRfWlYpCisgICAgICAgICAgICAgICAgICAgICAgICAgID8gZXNzZW50aWFscy56dgor ICAgICAgICAgICAgICAgICAgICAgICA6IChzdGFydC0+Ynl0ZXBvcyAhPSBlc3NlbnRpYWxzLnp2 X2J5dGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgc3RhcnQgLSByb3ctPmdseXBoc1tU RVhUX0FSRUFdID09IHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICA/IE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgLSAxCisgICAgICAgICAgICAg ICAgICAgICAgIDogKHN0YXJ0LT5ieXRlcG9zID09IGVzc2VudGlhbHMuenZfYnl0ZQorICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0g cm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgID8gZXNz ZW50aWFscy56dgorICAgICAgICAgICAgICAgICAgICAgICA6IHN0YXJ0LT5jaGFycG9zOworICAg ICAgICAgIExpc3BfT2JqZWN0IHNwZWNzID0gbWNfYXNzb2MgKG1ha2VfZml4bnVtIChwb3NpbnQp LCBCVkFSIChiLCBtY19jb25mKSk7CisgICAgICAgICAgaWYgKCgoaGVhZGVyX2xpbmVfZm9ybWF0 ID4gMCAmJiB2cG9zID4gMCkKKyAgICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9 PSAwKQorICAgICAgICAgICAgICAmJiAhTklMUCAoc3BlY3MpCisgICAgICAgICAgICAgICYmIHJv dy0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAgICAgJiYgIXNraXBf cAorICAgICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gIT0gUE9TVF9aVikKKyAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgTGlzcF9PYmplY3QgbGlzcF90eXBlID0gbWNfbnRoICgxLCBzcGVj cyk7CisgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUgPSAoQ09O U1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKFhDQVIgKGxpc3BfdHlwZSkpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IG1jX2xpc3BfdG9f Y3Vyc29yX3R5cGUgKGxpc3BfdHlwZSk7CisgICAgICAgICAgICAgIGN1cnNvcl90eXBlID0gKHN0 YXJ0LT50eXBlID09IElNQUdFX0dMWVBIKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g TUNfSE9MTE9XX0JPWAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogY3Vyc29yX3R5cGU7 CisgICAgICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGggPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFhGSVhOVU0gKFhDQVIgKFhDRFIgKGxp c3BfdHlwZSkpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAtMTsKKyAgICAg ICAgICAgICAgTGlzcF9PYmplY3QgbWNfZm9yZWdyb3VuZCA9IG1jX250aCAoMiwgc3BlY3MpOwor ICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICAgICAgaWYgKFNU UklOR1AgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgIG1jX3h3X2NvbG9yX3ZhbHVl cyAodywgbWNfZm9yZWdyb3VuZCwgJmxzbF9mZyk7CisgICAgICAgICAgICAgICAgZWxzZSBpZiAo VkVDVE9SUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgICAgIGxzbF9mZy5yZWQgPSBYRkxPQVRfREFUQSAoQVJFRiAobWNfZm9yZWdyb3VuZCwg MCkpOworICAgICAgICAgICAgICAgICAgICBsc2xfZmcuZ3JlZW4gPSBYRkxPQVRfREFUQSAoQVJF RiAobWNfZm9yZWdyb3VuZCwgMSkpOworICAgICAgICAgICAgICAgICAgICBsc2xfZmcuYmx1ZSA9 IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3JvdW5kLCAyKSk7CisgICAgICAgICAgICAgICAg ICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmIChOSUxQIChtY19mb3JlZ3JvdW5kKSkKKyAg ICAgICAgICAgICAgICAgICAgbWNfY29sb3JfcGlja2VyICh3LCBzdGFydCwgZXNzZW50aWFscywg JmxzbF9mZywgcG9zaW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1 cnNvcl90eXBlLCByb3dfcG9zaXRpb24sIE1VTFRJUExFX0NVUlNPUlMpOworICAgICAgICAgICAg ICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAgICAgICAgICAg ICBpbnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAgICAg ICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIHN0YXJ0LCBURVhUX0FSRUEsIHgsIHhf bGltaXQsIHJvdy0+eSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydCAtIHJvdy0+Z2x5 cGhzW1RFWFRfQVJFQV0sIHZwb3MsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAg ICAgIGN1cnNvcl93aWR0aCwgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9u LAorICAgICAgICAgICAgICAgICAgICAgICAgIGxzbF9mZywgTVVMVElQTEVfQ1VSU09SUywgZHJh d19wLCBmcm9tX3doZXJlLCBNQ19DQUNIRSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAg ICAgIGlmICghTklMUCAoQlZBUiAoYiwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgJiYgKGVzc2Vu dGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisg ICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgZmNfaW5hY3RpdmVfd2luZG93cykp KSkKKyAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPD0gdGV4dF9hcmVhX3dpZHRoCisgICAg ICAgICAgJiYgZXNzZW50aWFscy5mY194ID49IHctPm1jLmxudW1fcGl4ZWxfd2lkdGgpCisgICAg ICAgIHsKKyAgICAgICAgICBpbnQgeF9saW1pdCA9IHggKyBzdGFydC0+cGl4ZWxfd2lkdGg7Cisg ICAgICAgICAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3AgPSAody0+Y3Vyc29yLnggPT0gZXNzZW50 aWFscy5mY194CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vy c29yLnkgPT0gcm93LT55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg dy0+Y3Vyc29yLmhwb3MgPT0gc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnZwb3MgPT0gdnBvcyk7 CisgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgbWNfY29sb3JfcGlj a2VyICh3LCBzdGFydCwgZXNzZW50aWFscywgJmxzbF9mZywgLTEsIE1DX0JBUiwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgRklMTF9DT0xVTU4pOworICAgICAgICAg IGlmICh4ICsgc3RhcnQtPnBpeGVsX3dpZHRoIDw9IHRleHRfYXJlYV93aWR0aAorICAgICAgICAg ICAgICAmJiAoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAg ICAgICAgICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAgJiYgKChz dGFydCAhPSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAx CisgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID49IHgKKyAgICAgICAgICAg ICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPCB4ICsgc3RhcnQtPnBpeGVsX3dpZHRoKQorICAg ICAgICAgICAgICAgICAgfHwgKHN0YXJ0ID09IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ct PnVzZWRbVEVYVF9BUkVBXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxz LmZjX3ggPj0geCkpCisgICAgICAgICAgICAgICYmIHJvdy0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0 b21feSAodykKKyAgICAgICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAg ICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIHN0YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGlt aXQsIHJvdy0+eSwKKyAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgLSByb3ctPmdseXBoc1tU RVhUX0FSRUFdLCB2cG9zLCBNQ19CQVIsIDEsCisgICAgICAgICAgICAgICAgICAgICAgIGN1cnNv cl9tYXRyaXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgbHNsX2ZnLAorICAgICAgICAgICAg ICAgICAgICAgICBGSUxMX0NPTFVNTiwgZHJhd19wLCBmcm9tX3doZXJlLCBGQ19DQUNIRSk7Cisg ICAgICAgIH0KKyAgICAgIGlmICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAg ICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2hvcml6b250YWxfcnVsZXIpKQorICAgICAgICAgICYm IChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgIHx8ICghZXNzZW50aWFscy5hY3Rp dmVfcAorICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2luYWN0aXZlX3dp bmRvd3MpKSkpCisgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcykKKyAgICAgICAg eworICAgICAgICAgIGludCB4X2xpbWl0ID0gKHN0YXJ0ID09IHJvdy0+Z2x5cGhzW1RFWFRfQVJF QV0gKyByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICA/ IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgOiB4ICsgc3RhcnQtPnBp eGVsX3dpZHRoOworICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAgICAgICAgIG1j X2NvbG9yX3BpY2tlciAodywgc3RhcnQsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0xLCBNQ19IQkFS LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93X3Bvc2l0aW9uLCBIT1JJWk9OVEFMX1JV TEVSKTsKKyAgICAgICAgICAvKiBQcmVzZXJ2ZSBzdXBwb3J0IGZvciBkZWZhdWx0IGJlaGF2aW9y IHN1Y2ggdGhhdCBhIHVzZXIgbWF5CisgICAgICAgICAgc3BlY2lmeSB0aGUgaGVpZ2h0IG9mIGFu IE1DX0hCQVIsIHdoaWNoIGJlZ2lucyBpdHMgam91cm5leQorICAgICAgICAgIGFzIHRoZSBgY3Vy c29yX3dpZHRoJy4gIGBtY19nZXRfY3Vyc29yX2dlb21ldHJ5JyByZWFkanVzdHMuICovCisgICAg ICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgc3RhcnQsIFRFWFRfQVJFQSwgeCwgeF9s aW1pdCwgcm93LT55LAorICAgICAgICAgICAgICAgICAgICAgc3RhcnQgLSByb3ctPmdseXBoc1tU RVhUX0FSRUFdLCB2cG9zLCBNQ19IQkFSLCAxLAorICAgICAgICAgICAgICAgICAgICAgY3Vyc29y X21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBsc2xfZmcsCisgICAgICAgICAgICAg ICAgICAgICBIT1JJWk9OVEFMX1JVTEVSLCBkcmF3X3AsIGZyb21fd2hlcmUsIENIX0NBQ0hFKTsK KyAgICAgICAgfQorICAgICAgaWYgKCFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAg ICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICYm IChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgIHx8ICghZXNzZW50aWFscy5hY3Rp dmVfcAorICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2luYWN0aXZlX3dp bmRvd3MpKSkpCisgICAgICAgICAgJiYgIWZpbGxfY29sdW1uX3RydW1wc19wKQorICAgICAgICB7 CisgICAgICAgICAgY3Vyc29yX3R5cGUgPSAoc3RhcnQtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisg ICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0hPTExPV19CT1gKKyAgICAgICAgICAgICAgICAg ICAgICAgIDogTUNfQkFSOworICAgICAgICAgIGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0 aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAgICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9ICh3 LT5jdXJzb3IueSA9PSByb3ctPnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiB3LT5jdXJzb3IudnBvcyA9PSB2cG9zKTsKKyAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxz bF9mZzsKKyAgICAgICAgICBtY19jb2xvcl9waWNrZXIgKHcsIHN0YXJ0LCBlc3NlbnRpYWxzLCAm bHNsX2ZnLCAtMSwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICByb3df cG9zaXRpb24sIFZFUlRJQ0FMX1JVTEVSKTsKKyAgICAgICAgICBpZiAoKChoZWFkZXJfbGluZV9m b3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9y bWF0ID09IDApCisgICAgICAgICAgICAgICYmICgoc3RhcnQgIT0gcm93LT5nbHlwaHNbVEVYVF9B UkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMQorICAgICAgICAgICAgICAgICAgICYmIHct PmN1cnNvci54ID49IHgKKyAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA8IHggKyBz dGFydC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICB8fCAoc3RhcnQgPT0gcm93LT5n bHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMQorICAgICAgICAgICAg ICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHgpKQorICAgICAgICAgICAgICAmJiByb3ctPnkg PD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICYmICFyZWFsX2Zha2Vf Y3Vyc29yX3ApCisgICAgICAgICAgICBtY19lbmdpbmUgKHcsIG1hdHJpeCwgcm93LCBzdGFydCwg VEVYVF9BUkVBLCB4LCB4X2xpbWl0LCByb3ctPnksCisgICAgICAgICAgICAgICAgICAgICAgIHN0 YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwgdnBvcywgY3Vyc29yX3R5cGUsIDEsCisgICAg ICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlv biwgbHNsX2ZnLAorICAgICAgICAgICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUiwgZHJhd19w LCBmcm9tX3doZXJlLCBDSF9DQUNIRSk7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAg ICAgeworICAgICAgICBpbnQgcmVsYXRpdmVfeCA9IDA7CisgICAgICAgIGZvciAoaW50IGFyZWEg PSBMRUZUX01BUkdJTl9BUkVBOyBhcmVhIDwgTEFTVF9BUkVBOyArK2FyZWEpCisgICAgICAgICAg eworICAgICAgICAgICAgc3RydWN0IGdseXBoICpnbHlwaCA9IHJvdy0+Z2x5cGhzW2FyZWFdOwor ICAgICAgICAgICAgc3RydWN0IGdseXBoICpnbHlwaF9lbmQgPSBnbHlwaCArIHJvdy0+dXNlZFth cmVhXTsKKyAgICAgICAgICAgIC8qIEdseXBoIGZvciBhIGxpbmUgZW5kIGluIHRleHQuICovCisg ICAgICAgICAgICBpZiAoYXJlYSA9PSBURVhUX0FSRUEgJiYgZ2x5cGggPT0gZ2x5cGhfZW5kICYm IGdseXBoLT5jaGFycG9zID4gMCkKKyAgICAgICAgICAgICAgKytnbHlwaF9lbmQ7CisgICAgICAg ICAgICBmb3IgKDsgZ2x5cGggPCBnbHlwaF9lbmQ7ICsrZ2x5cGgpCisgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICBpZiAodnBvcyAhPSB3LT5jdXJzb3IudnBvcworICAgICAgICAgICAg ICAgICAgICAmJiBnbHlwaCAhPSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAgICAgICAgICAgICYm IGVzc2VudGlhbHMuZmNfeCA8IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgJiYgdy0+ Y3Vyc29yLnggPCByZWxhdGl2ZV94CisgICAgICAgICAgICAgICAgICAgICYmIE5JTFAgKEJWQVIg KGIsIG1jX2NvbmYpKSkKKyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAg IGlmICghTklMUCAoQlZBUiAoYiwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICYmIChl c3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICB8fCAoIWVzc2VudGlh bHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAo YiwgbWNfaW5hY3RpdmVfd2luZG93cykpKSkpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAg ICAgICAgICAgICAgIC8qIFRoZSBzcGFjZSBhcHBlbmRlZCB0byBhIHJvdyBlbmRpbmcgd2l0aCBh IG5ldyBsaW5lIGRvZXMKKyAgICAgICAgICAgICAgICAgICAgbm90IGhhdmUgYSBgZ2x5cGgtPmNo YXJwb3NgICgtMSwgMCkgdGhhdCB3ZSBjYW4gdXNlIGZvciB0aGlzCisgICAgICAgICAgICAgICAg ICAgIHBhcnRpY3VsYXIgYXBwbGljYXRpb24uICBXaGVuIGEgYGJ1ZmZlci1kaXNwbGF5LXRhYmxl JyBlbnRyeQorICAgICAgICAgICAgICAgICAgICBhc3NpZ25zIGEgdmlzaWJsZSBnbHlwaCB0byBh IG5ldyBsaW5lLCB0aGVyZSBpcyBubyBwcm9ibGVtCisgICAgICAgICAgICAgICAgICAgIGJlY2F1 c2UgdGhhdCBnbHlwaCBoYXMgYSBgZ2x5cGgtPmNoYXJwb3MnIHRoYXQgd2UgY2FuIHVzZS4KKyAg ICAgICAgICAgICAgICAgICAgV2hlbiBubyB2aXNpYmxlIEVPTCBnbHlwaCBleGlzdHMsIHdlIHVz ZSB0aGUgZm9sbG93aW5nIHRlc3Q6CisgICAgICAgICAgICAgICAgICAgIHRoZSBhcHBlbmRlZCBz cGFjZSBoYXMgYSBwb3NpdGlvbiB0aGF0IGlzIG9uZSBsZXNzIHRoYW4gdGhlCisgICAgICAgICAg ICAgICAgICAgIGVuZCBvZiB0aGUgbWF0cml4IHJvdy4gKi8KKyAgICAgICAgICAgICAgICAgICAg aW50IGhwb3MgPSBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICAgICAgICAg ICAgICAgIHN0cnVjdCBnbHlwaCAqcHJldmlvdXNfZ2x5cGggPSAoMCA8PSBocG9zIC0gMSAmJiBo cG9zIC0gMSA8IHJvdy0+dXNlZFtURVhUX0FSRUFdKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgaHBv cyAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogTlVMTDsKKyAgICAgICAgICAgICAgICAgICAgLy8gc3RydWN0IGdseXBoICpsYXN0X2dseXBo ID0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMTsKKyAg ICAgICAgICAgICAgICAgICAgYm9vbCBza2lwX3AgPSAocHJldmlvdXNfZ2x5cGggIT0gTlVMTAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBwcmV2aW91c19nbHlwaC0+Y2hh cnBvcyA9PSBNQVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpIC0gMQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaC0+Ynl0ZXBvcyAhPSBlc3NlbnRpYWxzLnp2X2J5 dGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IHRydWUKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBXaGVuIGEgYGJ1ZmZlci1kaXNwbGF5LXRhYmxl JyBlbnRyeSBjb250YWlucworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGEgdmlz aWJsZSB0YWIgY2hhcmFjdGVyICgiwrsiKSwgdGhlIHN1YnNlcXVlbnQKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBTVFJFVENIX0dMWVBIIHdpbGwgaGF2ZSB0aGUgc2FtZSBnbHlw aC0+Y2hhcnBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFzIHRoZSBhZm9y ZW1lbnRpb25lZCB2aXNpYmxlIHRhYiBjaGFyYWN0ZXIuICovCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAocHJldmlvdXNfZ2x5cGggIT0gTlVMTAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHByZXZpb3VzX2dseXBoLT5jaGFycG9zID09IGdseXBo LT5jaGFycG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyB0cnVlCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBmYWxzZTsKKyAgICAgICAgICAgICAg ICAgICAgaW50IHBvc2ludCA9IChyb3dfcG9zaXRpb24gPT0gUE9TVF9aVikKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyAtMQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAocm93X3Bvc2l0aW9uID09IEFUX1pWKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBlc3NlbnRpYWxzLnp2CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IChnbHlwaC0+Ynl0ZXBvcyAhPSBlc3NlbnRpYWxzLnp2X2J5dGUKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVB XSA9PSByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSAtIDEKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoLT5ieXRlcG9zID09IGVzc2VudGlhbHMuenZf Ynl0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGggLSByb3ct PmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBlc3NlbnRpYWxzLnp2CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IGdseXBoLT5jaGFycG9zOworICAgICAgICAgICAgICAgICAg ICBMaXNwX09iamVjdCBzcGVjcyA9IG1jX2Fzc29jIChtYWtlX2ZpeG51bSAocG9zaW50KSwgQlZB UiAoYiwgbWNfY29uZikpOworICAgICAgICAgICAgICAgICAgICBpZiAoKChoZWFkZXJfbGluZV9m b3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGhlYWRl cl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKHNw ZWNzKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT55IDw9IHdpbmRvd190ZXh0X2Jv dHRvbV95ICh3KQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXNraXBfcAorICAgICAgICAg ICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uICE9IFBPU1RfWlYpCisgICAgICAgICAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3QgbGlzcF90eXBl ID0gbWNfbnRoICgxLCBzcGVjcyk7CisgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1 cnNvcl90eXBlIGN1cnNvcl90eXBlID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfbGlzcF90 b19jdXJzb3JfdHlwZSAoWENBUiAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IG1jX2xpc3BfdG9fY3Vyc29yX3R5 cGUgKGxpc3BfdHlwZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IChn bHlwaC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBNQ19IT0xMT1dfQk9YCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogY3Vyc29yX3R5cGU7CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY3Vyc29y X3dpZHRoID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gWEZJWE5VTSAoWENBUiAoWENEUiAobGlzcF90eXBlKSkpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAtMTsKKyAgICAgICAgICAg ICAgICAgICAgICAgIExpc3BfT2JqZWN0IG1jX2ZvcmVncm91bmQgPSBtY19udGggKDIsIHNwZWNz KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAgICAg ICAgICAgICAgICAgICAgICAgaWYgKFNUUklOR1AgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAg ICAgICAgICAgICAgICAgICBtY194d19jb2xvcl92YWx1ZXMgKHcsIG1jX2ZvcmVncm91bmQsICZs c2xfZmcpOworICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChWRUNUT1JQIChtY19m b3JlZ3JvdW5kKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBsc2xfZmcucmVkID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVn cm91bmQsIDApKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxzbF9mZy5ncmVlbiA9 IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3JvdW5kLCAxKSk7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBsc2xfZmcuYmx1ZSA9IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3Jv dW5kLCAyKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGVsc2UgaWYgKE5JTFAgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgbWNfY29sb3JfcGlja2VyICh3LCBnbHlwaCwgZXNzZW50aWFscywg JmxzbF9mZywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg cG9zaW50LCBjdXJzb3JfdHlwZSwgcm93X3Bvc2l0aW9uLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTKTsKKyAgICAgICAgICAg ICAgICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7Cisg ICAgICAgICAgICAgICAgICAgICAgICBpbnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGggKHcs IFRFWFRfQVJFQSk7CisgICAgICAgICAgICAgICAgICAgICAgICBtY19lbmdpbmUgKHcsIG1hdHJp eCwgcm93LCBnbHlwaCwgYXJlYSwgcmVsYXRpdmVfeCwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgeF9saW1pdCwgcm93LT55LCBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJF QV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZwb3MsIGN1cnNvcl90eXBl LCBjdXJzb3Jfd2lkdGgsIGN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgbHNsX2ZnLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTLCBkcmF3X3AsIGZyb21fd2hl cmUsIE1DX0NBQ0hFKTsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAg ICB9CisgICAgICAgICAgICAgICAgaWYgKCFOSUxQIChCVkFSIChiLCBmY192aXNpYmxlKSkKKyAg ICAgICAgICAgICAgICAgICAgJiYgKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgIHx8ICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmICFOSUxQIChCVkFSIChiLCBmY19pbmFjdGl2ZV93aW5kb3dzKSkpKQorICAgICAg ICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPD0gdGV4dF9hcmVhX3dpZHRoCisgICAg ICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSB3LT5tYy5sbnVtX3BpeGVsX3dp ZHRoKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpbnQgeF9saW1p dCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAgICAgICAgICAgICAgICAg IGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKHctPmN1cnNvci54ID09IGVzc2VudGlhbHMuZmNf eAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5j dXJzb3IueSA9PSByb3ctPnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FS RUFdCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHct PmN1cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGds eXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0 IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgICAgICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywg Z2x5cGgsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0xLCBNQ19CQVIsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgcm93X3Bvc2l0aW9uLCBGSUxMX0NPTFVNTik7CisgICAgICAg ICAgICAgICAgICAgIGlmIChocG9zID49IGhwb3Nfc3RhcnQKKyAgICAgICAgICAgICAgICAgICAg ICAgICYmIGhwb3MgPCBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGgKKyAgICAgICAgICAgICAgICAg ICAgICAgICYmIHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGggPD0gdGV4dF9hcmVhX3dp ZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAg JiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVf Zm9ybWF0ID09IDApCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoKGdseXBoICE9IGdseXBo X2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194 ID49IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFs cy5mY194IDwgcmVsYXRpdmVfeCArIGdseXBoLT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICB8fCAoZ2x5cGggPT0gZ2x5cGhfZW5kIC0gMQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPj0gcmVsYXRpdmVfeCkpCisgICAg ICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcp CisgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAg ICAgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCBy ZWxhdGl2ZV94LCB4X2xpbWl0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93 LT55LCBocG9zLCB2cG9zLCBNQ19CQVIsIDEsIGN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGxzbF9mZywgRklM TF9DT0xVTU4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3X3AsIGZyb21f d2hlcmUsIEZDX0NBQ0hFKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBp ZiAoIU5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAmJiAh TklMUCAoQlZBUiAoYiwgY2hfaG9yaXpvbnRhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAg ICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICB8fCAoIWVz c2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAo QlZBUiAoYiwgY2hfaW5hY3RpdmVfd2luZG93cykpKSkKKyAgICAgICAgICAgICAgICAgICAgJiYg dnBvcyA9PSB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICAgICAgaW50IHhfbGltaXQgPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOwor ICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9B UkVBXTsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAg ICAgICAgICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywgZ2x5cGgsIGVzc2VudGlhbHMsICZsc2xf ZmcsIC0xLCBNQ19IQkFSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJv d19wb3NpdGlvbiwgSE9SSVpPTlRBTF9SVUxFUik7CisgICAgICAgICAgICAgICAgICAgIC8qIFBy ZXNlcnZlIHN1cHBvcnQgZm9yIGRlZmF1bHQgYmVoYXZpb3Igc3VjaCB0aGF0IGEgdXNlciBtYXkK KyAgICAgICAgICAgICAgICAgICAgc3BlY2lmeSB0aGUgaGVpZ2h0IG9mIGFuIE1DX0hCQVIsIHdo aWNoIGJlZ2lucyBpdHMgam91cm5leQorICAgICAgICAgICAgICAgICAgICBhcyB0aGUgYGN1cnNv cl93aWR0aCcuICBgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeScgcmVhZGp1c3RzLiAqLworICAgICAg ICAgICAgICAgICAgICBpZiAoaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICAgICAgICAg ICAgICAmJiBocG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoKQorICAgICAgICAgICAgICAg ICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94 LCB4X2xpbWl0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT55LCBocG9z LCB2cG9zLCBNQ19IQkFSLCAxLCBjdXJzb3JfbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBsc2xfZmcsIEhPUklaT05UQUxf UlVMRVIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3X3AsIGZyb21fd2hl cmUsIENIX0NBQ0hFKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAo IU5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAmJiAhTklM UCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAmJiAo ZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgfHwgKCFlc3NlbnRp YWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIg KGIsIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkpCisgICAgICAgICAgICAgICAgICAgICYmICFmaWxs X2NvbHVtbl90cnVtcHNfcCkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAg ICAgY3Vyc29yX3R5cGUgPSAoZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19IT0xMT1dfQk9YCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiBNQ19CQVI7CisgICAgICAgICAgICAgICAgICAgIGludCB4X2xp bWl0ID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgICAgICAg ICAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3AgPSAody0+Y3Vyc29yLnkgPT0gcm93LT55CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci52 cG9zID09IHZwb3MpOworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBs c2xfZmc7CisgICAgICAgICAgICAgICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywgZ2x5cGgsIGVz c2VudGlhbHMsICZsc2xfZmcsIC0xLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICByb3dfcG9zaXRpb24sIFZFUlRJQ0FMX1JVTEVSKTsKKyAgICAgICAg ICAgICAgICAgICAgaWYgKGhwb3MgPj0gaHBvc19zdGFydAorICAgICAgICAgICAgICAgICAgICAg ICAgJiYgaHBvcyA8IGhwb3Nfc3RhcnQgKyBocG9zX2xlbmd0aAorICAgICAgICAgICAgICAgICAg ICAgICAgJiYgKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAg ICAgICAgICAgICAgICAgJiYgKChnbHlwaCAhPSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHJlbGF0aXZlX3gKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPCByZWxhdGl2ZV94ICsgZ2x5cGgtPnBp eGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChnbHlwaCA9PSBnbHlw aF9lbmQgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54 ID49IHJlbGF0aXZlX3gpKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT55IDw9IHdp bmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJlYWxf ZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgICAgICAgICAgICBtY19lbmdpbmUgKHcsIG1hdHJp eCwgcm93LCBnbHlwaCwgYXJlYSwgcmVsYXRpdmVfeCwgeF9saW1pdCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHJvdy0+eSwgaHBvcywgdnBvcywgY3Vyc29yX3R5cGUsIDEsIGN1 cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlc3NlbnRpYWxz LCByb3dfcG9zaXRpb24sIGxzbF9mZywgVkVSVElDQUxfUlVMRVIsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBkcmF3X3AsIGZyb21fd2hlcmUsIENIX0NBQ0hFKTsKKyAgICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhlbF93 aWR0aDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgIH0KKyAgLy8gIGNsb2Nr X3QgY2xvY2tfZW5kID0gY2xvY2soKTsKKyAgLy8gIGRvdWJsZSBjcHVfdGltZV91c2VkID0gKChk b3VibGUpIChjbG9ja19lbmQgLSBjbG9ja19zdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7CisgIC8v ICBmcHJpbnRmIChzdGRlcnIsICJtY19kcmF3X3JvdyAoJXMpOiAgVElNRSAoJWYpXG4iLCBtY193 aW5kb3cgKHcpLCBjcHVfdGltZV91c2VkKTsKK30KKworYm9vbAorbWNfcmVkcmF3X3JvdyAoc3Ry dWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhf cm93ICpyb3csCisgICAgICAgICAgICAgICBlbnVtIGdseXBoX3Jvd19hcmVhIGFyZWEsIGludCBz dGFydF94LCBpbnQgc3RhcnRfaHBvcywgaW50IGVuZF9ocG9zLAorICAgICAgICAgICAgICAgYm9v bCBjbGVhcl9lb2xfcCwgZW51bSBkcmF3X2dseXBoc19mYWNlIGhsLAorICAgICAgICAgICAgICAg ZW51bSBtY19yZWRyYXdfcm93X3R5cGUgZnJvbV93aGVyZSkKK3sKKyAgYm9vbCBnb19wID0gKCh3 LT5tY19tYXRyaXguY3Vyc29yc191c2VkW01DX0NBQ0hFXSA+IDAKKyAgICAgICAgICAgICAgICB8 fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0NIX0NBQ0hFXSA+IDAKKyAgICAgICAgICAgICAg ICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0ZDX0NBQ0hFXSA+IDApCisgICAgICAgICAg ICAgICAmJiBhcmVhID09IFRFWFRfQVJFQQorICAgICAgICAgICAgICAgJiYgcm93LT51c2VkW2Fy ZWFdKTsKKyAgaWYgKCFnb19wKQorICAgIHJldHVybiBmYWxzZTsKKyAgc3RydWN0IGZyY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5cGUpCisgICAg eworICAgICAgZm9yIChpbnQgbnRoID0gMDsKKyAgICAgICAgICAgbWNfdHJhdmVyc2VfY2FjaGVf cCAody0+bWNfbWF0cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGgpOworICAgICAgICAgICArK250 aCkKKyAgICAgICAgeworICAgICAgICAgIGludCB4ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXS54OworICAgICAgICAgIGludCBmeCA9IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZng7CisgICAgICAgICAgaW50IHkg PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLnk7CisgICAg ICAgICAgaW50IGZ5ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXS5meTsKKyAgICAgICAgICBpbnQgaHBvcyA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF0uaHBvczsKKyAgICAgICAgICBpbnQgdnBvcyA9IHctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0udnBvczsKKyAgICAgICAgICBp bnQgd2QgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLndk OworICAgICAgICAgIGludCBoID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXS5oOworICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUg PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmN1cnNvcl90 eXBlOworICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGggPSB3LT5tY19tYXRya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5cGhfZmxhdm9yOworICAgICAgICAgIGJvb2wgZW5hYmxl ZF9wID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFi bGVkX3A7CisgICAgICAgICAgaWYgKHZwb3MgPT0gdm50aAorICAgICAgICAgICAgICAmJiAoKGhw b3MgPj0gc3RhcnRfaHBvcworICAgICAgICAgICAgICAgICAgICYmIGhwb3MgPCBlbmRfaHBvcykK KyAgICAgICAgICAgICAgICAgIC8qIEEgZmxvYXRpbmcgY3Vyc29yIGJleW9uZCB0aGUgZW5kIG9m IHRoZSBnbHlwaCByb3cuICovCisgICAgICAgICAgICAgICAgICB8fCAoaHBvcyArIDEgPT0gc3Rh cnRfaHBvcworICAgICAgICAgICAgICAgICAgICAgICYmIGhwb3MgKyAxID09IGVuZF9ocG9zKSkK KyAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAg ICBib29sIHJlbW92ZV9wID0gZmFsc2U7CisgICAgICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHli cmlkICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lk dGgsIGxzbF9mZywgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBnbHlwaF9mbGF2b3IsIHJlbW92ZV9wKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAg IH0KKyAgcmV0dXJuIHRydWU7CisgIC8vICBjbG9ja19lbmQgPSBjbG9jaygpOworICAvLyAgZG91 YmxlIHRpbWVfY3Vyc29ycyA9ICgoZG91YmxlKSAoY2xvY2tfZW5kIC0gY2xvY2tfc3RhcnQpKSAv IENMT0NLU19QRVJfU0VDOworICAvLyAgZnByaW50Zi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c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhd LmZnLnJlZCwKKyAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5mZy5ncmVlbiwK KyAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZnLmJsdWV9OworICAgICAgICAg IHN0cnVjdCBtY19SR0IgbHNsX2JnID0gey5yZWQgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLnJlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAuZ3JlZW4gPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLmJnLmdyZWVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVl ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5iZy5ibHVl fTsKKyAgICAgICAgICBib29sIGFjdGl2ZV9wID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXS5hY3RpdmVfcDsKKyAgICAgICAgICBlbnVtIG1jX2ZsYXZvciBn bHlwaF9mbGF2b3IgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLmdseXBoX2ZsYXZvcjsKKyAgICAgICAgICBib29sIGVuYWJsZWRfcCA9IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZW5hYmxlZF9wOworICAgICAgICAg IC8qIGBtYXRyaXhfcm93JyBpbiBgZGlzcG5ldy5jYCBjb250YWlucyB0aGUgZm9sbG93aW5nIHRl c3RzLAorICAgICAgICAgIGVhc3NlcnQgKG1hdHJpeCAmJiBtYXRyaXgtPnJvd3MpOworICAgICAg ICAgIGVhc3NlcnQgKHJvdyA+PSAwICYmIHJvdyA8IG1hdHJpeC0+bnJvd3MpOyAqLworICAgICAg ICAgIGJvb2wgYmFyZl9jcmFzaF9vbmUgPSAobWF0cml4ICYmIG1hdHJpeC0+cm93cykgPyBmYWxz ZSA6IHRydWU7CisgICAgICAgICAgaWYgKGJhcmZfY3Jhc2hfb25lKQorICAgICAgICAgICAgY29u dGludWU7CisgICAgICAgICAgYm9vbCBiYXJmX2NyYXNoX3R3byA9ICh2cG9zID49IDAgJiYgdnBv cyA8IG1hdHJpeC0+bnJvd3MpID8gZmFsc2UgOiB0cnVlOworICAgICAgICAgIGlmIChiYXJmX2Ny YXNoX3R3bykKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgIGlmICh2cG9zID09IHZu dGgKKyAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBICisgICAgICAgICAg ICAgICYmIGVuYWJsZWRfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbWNfZXJhc2Vf Y3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgeSwgaHBvcywgdnBvcywgZ2x5cGhfZmxhdm9yLCBj dXJzb3JfdHlwZSwgd2QpOworICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLmVuYWJsZWRfcCA9IGZhbHNlOworICAgICAgICAgICAgICAt LXctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVfdHlwZV07CisgICAgICAgICAgICB9Cisg ICAgICAgICAgICBlbHNlIGlmICh2cG9zID09IHZudGgKKyAgICAgICAgICAgICAgICAgICAgICYm IGVuYWJsZWRfcCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGJvb2wgcmVtb3Zl X3AgPSB0cnVlOworICAgICAgICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCBtYXRy aXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgbHNsX2Jn LCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGhf Zmxhdm9yLCByZW1vdmVfcCk7CisgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFibGVkX3AgPSBmYWxzZTsKKyAgICAgICAgICAg ICAgICAtLXctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVfdHlwZV07CisgICAgICAgICAg ICAgIH0KKyAgICAgICAgfQorICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNl ZFtjYWNoZV90eXBlXSA9IDA7CisgICAgfQorfQorCisvKiBFcmFzZSBmYWtlIGN1cnNvcnMgZnJv bSAobWluLCBydW4uY3VycmVudF95LCBydW4uZGVzaXJlZF95KSB0byBlbmQgb2Ygd2luZG93Lgor ICBUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfRE9XTjoKKyAgICBydW4uaGVpZ2h0 ID0gaXQubGFzdF92aXNpYmxlX3kgLSBydW4uZGVzaXJlZF95CisgICAgW2VtYWNzIC1xOiAgSG9s ZCB1cC1hcnJvdyBrZXkgdHJpZ2dlcmluZyBhdXRvLXJlY2VudGVyIGF0IHNjcm9sbC1tYXJnaW4u XQorICBUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfVVA6CisgICAgcnVuLm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gICAgfCAgICBydW4uaGVpZ2h0ID0gaXQubGFzdF92aXNpYmxlX3kgLSBy dW4uZGVzaXJlZF95CisgIHwgICAgICAgICAgICAgfCAgICBydW4uaGVpZ2h0ID09IDEwODAgLSA4 MTAgPT0gMjcwCisgIHwgICAgICAgICAgICAgfCAgICBbVG9wIHBhcnQgb2YgdGhlIGxvd2VyIHJl Y3RhbmdsZSBnZXRzIGNvcGllZCB0byBsb3dlciBydW4uZGVzaXJlZF95Ll0KKyAgfCAgICAgICAg ICAgICB8CisgICstLS0tLS0tLS0tLS0tKyA8PSBpdC5sYXN0X3Zpc2libGVfeSA9PSAxMDgwICov Cit2b2lkCittY19wcmVfc2Nyb2xsX2NsZWFuIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgcnVu IHJ1biwgaW50IHN0YXJ0X3Zwb3MsCisgICAgICAgICAgICAgICAgICAgICBpbnQgbnJvd3Nfc2Ny b2xsZWQsIGVudW0gbWNfcHJlX3Njcm9sbF9jbGVhbl90eXBlIGZyb21fd2hlcmUpCit7CisgIGlm IChNSU5JX1dJTkRPV19QICh3KSkKKyAgICByZXR1cm47CisgIGJvb2wgZ29fb25lX3AgPSAody0+ bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtNQ19DQUNIRV0gPiAwCisgICAgICAgICAgICAgICAgICAg fHwgdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtDSF9DQUNIRV0gPiAwCisgICAgICAgICAgICAg ICAgICAgfHwgdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtGQ19DQUNIRV0gPiAwKTsKKyAgYm9v bCBnb190d29fcCA9IChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICAm JiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAg ICAgICAgICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGZjX3Zpc2libGUpKQorICAgICAgICAgICAgICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJV RkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkpKTsKKyAgaWYgKHRyYWNlX3JlZGlzcGxheV9w KQorICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX3ByZV9zY3JvbGxfY2xlYW4gKCVzKTpcblwKKyAg JXMgfCBnb19vbmVfcCAoJXMpIHwgZ29fdHdvX3AgKCVzKVxuXAorICBzdGFydF92cG9zICglZCkg fCBucm93c19zY3JvbGxlZCAoJWQpXG5cCisgICVzOiAgcnVuLmN1cnJlbnQvZGVzaXJlZF95ICgl ZC8lZCkgfCBydW4uaGVpZ2h0ICglZClcbiIsCisgICAgbWNfd2luZG93ICh3KSwgKGZyb21fd2hl cmUgPT0gVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX0RPV04pCisgICAgICAgICAg ICAgICAgICAgICA/ICJUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfRE9XTiIKKyAg ICAgICAgICAgICAgICAgICA6IChmcm9tX3doZXJlID09IFRSWV9XSU5ET1dfUkVVU0lOR19DVVJS RU5UX01BVFJJWF9VUCkKKyAgICAgICAgICAgICAgICAgICAgID8gIlRSWV9XSU5ET1dfUkVVU0lO R19DVVJSRU5UX01BVFJJWF9VUCIKKyAgICAgICAgICAgICAgICAgICA6IChmcm9tX3doZXJlID09 IFRSWV9XSU5ET1dfSUQpCisgICAgICAgICAgICAgICAgICAgICA/ICJUUllfV0lORE9XX0lEIgor ICAgICAgICAgICAgICAgICAgIDogIlVOS05PV04iLAorICAgIGdvX29uZV9wID8gInllcyIgOiAi bm8iLCBnb190d29fcCA/ICJ5ZXMiIDogIm5vIiwKKyAgICBzdGFydF92cG9zLCBucm93c19zY3Jv bGxlZCwKKyAgICBydW4uY3VycmVudF95IDwgcnVuLmRlc2lyZWRfeSA/ICLihpMiIDogIuKGkSIs CisgICAgcnVuLmN1cnJlbnRfeSwgcnVuLmRlc2lyZWRfeSwgcnVuLmhlaWdodCk7CisgIGlmICgh Z29fb25lX3AgJiYgIWdvX3R3b19wKQorICAgIHJldHVybjsKKyAgYm9vbCB1cGRhdGluZ19mcmFt ZV9wID0gZmFsc2U7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBp ZiAoWEZSQU1FICh3LT5mcmFtZSkgIT0gZi0+bWNfdXBkYXRpbmdfZnJhbWUKKyAgICAgICYmIChn b19vbmVfcCB8fCBnb190d29fcCkpCisgICAgeworICAgICAgdXBkYXRpbmdfZnJhbWVfcCA9IHRy dWU7CisgICAgICB1cGRhdGVfYmVnaW4gKGYpOworICAgIH0KKyAgaWYgKHctPnBoeXNfY3Vyc29y X29uX3AKKyAgICAgICYmIGdvX3R3b19wKQorICAgIGVyYXNlX3BoeXNfY3Vyc29yICh3KTsKKyAg c3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgIGZvciAo aW50IHZudGggPSBzdGFydF92cG9zOworICAgICAgIG1hdHJpeCAhPSBOVUxMCisgICAgICAgJiYg dm50aCA8IG1hdHJpeC0+bnJvd3MKKyAgICAgICAmJiBNQVRSSVhfUk9XIChtYXRyaXgsIHZudGgp LT5lbmFibGVkX3AKKyAgICAgICAmJiBnb19vbmVfcDsKKyAgICAgICArK3ZudGgpCisgICAgewor ICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93ID0gTUFUUklYX1JPVyAobWF0cml4LCB2bnRoKTsK KyAgICAgIG1jX2VyYXNlX3JvdyAodywgbWF0cml4LCByb3cpOworICAgIH0KKyAgaWYgKHVwZGF0 aW5nX2ZyYW1lX3ApCisgICAgdXBkYXRlX2VuZCAoZik7CisgIC8vIG1jX3Jlc2V0X2NhY2hlICh3 KTsKK30KKworREVGVU4gKCJtYy1zdGRlcnIiLCBGbWNfc3RkZXJyLCBTbWNfc3RkZXJyLCAwLCAx LCAiUCIsCisgICAgICAgZG9jOiAvKiBUb2dnbGUgdHJhY2luZyBvZiBtdWx0aXBsZSBmYWtlIGN1 cnNvcnMuCitXaXRoIEFSRywgdHVybiB0cmFjaW5nIG9uIGlmIGFuZCBvbmx5IGlmIEFSRyBpcyBw b3NpdGl2ZS4gKi8pCisgIChMaXNwX09iamVjdCBhcmcpCit7CisgIGlmIChOSUxQIChhcmcpKQor ICAgIG1jX3N0ZGVycl9wID0gIW1jX3N0ZGVycl9wOworICBlbHNlCisgICAgeworICAgICAgYXJn ID0gRnByZWZpeF9udW1lcmljX3ZhbHVlIChhcmcpOworICAgICAgbWNfc3RkZXJyX3AgPSBYRklY TlVNIChhcmcpID4gMDsKKyAgICB9CisgIHJldHVybiBRbmlsOworfQorCisvKiBlbmQgTVVMVElQ TEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogDAogLyoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqCiAJCSAgICAgIFdpbmRvdyBkaXNwbGF5IGRpbWVuc2lvbnMKQEAgLTEzMzk1LDYgKzE4 MDM2LDY5IEBAIGhzY3JvbGxfd2luZG93X3RyZWUgKExpc3BfT2JqZWN0IHdpbmRvdykKIAkgICAg ICBlbHNlCiAJCXB0ID0gY2xpcF90b19ib3VuZHMgKEJFR1YsIG1hcmtlcl9wb3NpdGlvbiAody0+ cG9pbnRtKSwgWlYpOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4gTVVM VElQTEUtQ1VSU09SUyAqLworCisvKiAoZ2RiKSBidAorIzAgIHRlcm1pbmF0ZV9kdWVfdG9fc2ln bmFsIChzaW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XQgeGRpc3AuYzo4 NDIzCisjNyAgMHgwMDAwMDAwMTAwMDZjM2Y3IGluIGhzY3JvbGxfd2luZG93X3RyZWUgKHdpbmRv dz0uLi4pIGF0IHhkaXNwLmM6MTg1NDYKKyovCisKKyAgLyogYGluaXRfaXRlcmF0b3InOiAgZWFz c2VydCAoY2hhcnBvcyA8IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKGNo YXJwb3MgPj0gQlVGX0JFRyAoY3VycmVudF9idWZmZXIpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBjaGFycG9zIDw9IFpWKSk7ICovCisKKyAgc3RydWN0IGRpc3BsYXlf cG9zICpwb3MgPSAmY3Vyc29yX3Jvdy0+c3RhcnQ7CisgIHB0cmRpZmZfdCBjaGFycG9zID0gQ0hB UlBPUyAocG9zLT5wb3MpOworCisgIGJvb2wgYmFyZl9jcmFzaF9vbmUgPSAoY2hhcnBvcyA8IDAK KyAgICAgICAgICAgICAgICAgICAgICAgICB8fCAoY2hhcnBvcyA+PSBCVUZfQkVHIChjdXJyZW50 X2J1ZmZlcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY2hhcnBvcyA8PSBaVikp CisgICAgICAgICAgICAgICAgICAgICAgICA/IGZhbHNlCisgICAgICAgICAgICAgICAgICAgICAg ICA6IHRydWU7CisgIGlmIChiYXJmX2NyYXNoX29uZSkKKyAgICByZXR1cm4gaHNjcm9sbGVkX3A7 CisKKyAgLyogYHJlc2VhdF8xJzogIENIQVJQT1MgKHBvcykgPj0gQkVHViAmJiBDSEFSUE9TIChw b3MpIDw9IFpWICovCisgIGJvb2wgYmFyZl9jcmFzaF90d28gPSAoY2hhcnBvcyA+PSBCRUdWICYm IGNoYXJwb3MgPD0gWlYpCisgICAgICAgICAgICAgICAgICAgICAgICAgPyBmYWxzZQorICAgICAg ICAgICAgICAgICAgICAgICAgIDogdHJ1ZTsKKyAgaWYgKGJhcmZfY3Jhc2hfdHdvKQorICAgIHJl dHVybiBoc2Nyb2xsZWRfcDsKKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKIAkgICAgICAvKiBNb3ZlIGl0ZXJhdG9yIHRvIHB0IHN0YXJ0 aW5nIGF0IGN1cnNvcl9yb3ctPnN0YXJ0IGluCiAJCSBhIGxpbmUgd2l0aCBpbmZpbml0ZSB3aWR0 aC4gICovCiAJICAgICAgaW5pdF90b19yb3dfc3RhcnQgKCZpdCwgdywgY3Vyc29yX3Jvdyk7CkBA IC0xNDI4Nyw5ICsxODk5MSwyMiBAQCByZWRpc3BsYXlfaW50ZXJuYWwgKHZvaWQpCiAJICAgICAg KnctPmRlc2lyZWRfbWF0cml4LT5tZXRob2QgPSAwOwogCSAgICAgIGRlYnVnX21ldGhvZF9hZGQg KHcsICJvcHRpbWl6YXRpb24gMSIpOwogI2VuZGlmCisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0K KyAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZG RVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgIG1jX3VwZGF0ZV93aW5kb3dfZnJp bmdlcyAodywgZmFsc2UpOworICAgIGVsc2UKIAkgICAgICB1cGRhdGVfd2luZG93X2ZyaW5nZXMg KHcsIGZhbHNlKTsKICNlbmRpZgorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAg ICAgZ290byB1cGRhdGU7CiAJICAgIH0KIAkgIGVsc2UKQEAgLTE3Njg3LDEwICsyMjQwNCwyMiBA QCByZWRpc3BsYXlfd2luZG93IChMaXNwX09iamVjdCB3aW5kb3csIGJvb2wganVzdF90aGlzX29u ZV9wKQogICAgIH0KIAogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQorCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGJvb2wga2VlcF9jdXJy ZW50X3AgPSAoanVzdF90aGlzX29uZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKCF1 c2VkX2N1cnJlbnRfbWF0cml4X3AgJiYgIW92ZXJsYXlfYXJyb3dfc2VlbikKKyAgICAgICAgICAg ICAgICAgICAgICAgICB8fCB3LT5wc2V1ZG9fd2luZG93X3ApOworCisgIGJvb2wgZnJpbmdlc191 cGRhdGVkX3AgPSAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykp KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY191cGRhdGVfd2luZG93X2ZyaW5nZXMg KHcsIGtlZXBfY3VycmVudF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgOiB1cGRhdGVf d2luZG93X2ZyaW5nZXMgKHcsIGtlZXBfY3VycmVudF9wKTsKKwogICBpZiAoRlJBTUVfV0lORE9X X1AgKGYpCi0gICAgICAmJiB1cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIChqdXN0X3RoaXNfb25l X3AKLQkJCQkgICAgfHwgKCF1c2VkX2N1cnJlbnRfbWF0cml4X3AgJiYgIW92ZXJsYXlfYXJyb3df c2VlbikKLQkJCQ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vdyAqdykKIAkgICAgICB1 cGRhdGVfYmVnaW4gKGYpOwogCSAgICAgIEZSQU1FX1JJRiAoZiktPnVwZGF0ZV93aW5kb3dfYmVn aW5faG9vayAodyk7CiAJICAgICAgRlJBTUVfUklGIChmKS0+Y2xlYXJfd2luZG93X21vdXNlX2Zh Y2UgKHcpOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09S UyAqLworCisgICAgbWNfcHJlX3Njcm9sbF9jbGVhbiAodywgcnVuLCBzdGFydF92cG9zLCBucm93 c19zY3JvbGxlZCwgVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX0RPV04pOworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAgICAgRlJBTUVfUklGIChmKS0+c2Nyb2xs X3J1bl9ob29rICh3LCAmcnVuKTsKIAkgICAgICBGUkFNRV9SSUYgKGYpLT51cGRhdGVfd2luZG93 X2VuZF9ob29rICh3LCBmYWxzZSwgZmFsc2UpOwogCSAgICAgIHVwZGF0ZV9lbmQgKGYpOwpAQCAt MTgxNzMsNiArMjI5MTYsNyBAQCB0cnlfd2luZG93X3JldXNpbmdfY3VycmVudF9tYXRyaXggKHN0 cnVjdCB3aW5kb3cgKncpCiAJfQogCiAgICAgICAvKiBTY3JvbGwgdGhlIGRpc3BsYXkuICAqLwor CiAgICAgICBydW4uY3VycmVudF95ID0gZmlyc3RfcmV1c2FibGVfcm93LT55OwogICAgICAgcnVu LmRlc2lyZWRfeSA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOwogICAgICAgcnVuLmhl aWdodCA9IGl0Lmxhc3RfdmlzaWJsZV95IC0gcnVuLmN1cnJlbnRfeTsKQEAgLTE4MTgzLDYgKzIy OTI3LDE2IEBAIHRyeV93aW5kb3dfcmV1c2luZ19jdXJyZW50X21hdHJpeCAoc3RydWN0IHdpbmRv dyAqdykKIAkgIHVwZGF0ZV9iZWdpbiAoZik7CiAJICBGUkFNRV9SSUYgKGYpLT51cGRhdGVfd2lu ZG93X2JlZ2luX2hvb2sgKHcpOwogCSAgRlJBTUVfUklGIChmKS0+Y2xlYXJfd2luZG93X21vdXNl X2ZhY2UgKHcpOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VS U09SUyAqLworCisgICAgbWNfcHJlX3Njcm9sbF9jbGVhbiAodywgcnVuLCBzdGFydF92cG9zLCBu cm93c19zY3JvbGxlZCwgVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX1VQKTsKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgRlJBTUVfUklGIChmKS0+c2Nyb2xsX3J1 bl9ob29rICh3LCAmcnVuKTsKIAkgIEZSQU1FX1JJRiAoZiktPnVwZGF0ZV93aW5kb3dfZW5kX2hv b2sgKHcsIGZhbHNlLCBmYWxzZSk7CiAJICB1cGRhdGVfZW5kIChmKTsKQEAgLTE5MTI3LDYgKzIz ODgxLDcgQEAgdHJ5X3dpbmRvd19pZCAoc3RydWN0IHdpbmRvdyAqdykKICAgLyogU2Nyb2xsIHRo ZSBkaXNwbGF5LiAgRG8gaXQgYmVmb3JlIGNoYW5naW5nIHRoZSBjdXJyZW50IG1hdHJpeCBzbwog ICAgICB0aGF0IHh0ZXJtLmMgZG9lc24ndCBnZXQgY29uZnVzZWQgYWJvdXQgd2hlcmUgdGhlIGN1 cnNvciBnbHlwaCBpcwogICAgICBmb3VuZC4gICovCisKICAgaWYgKGR5ICYmIHJ1bi5oZWlnaHQp CiAgICAgewogICAgICAgdXBkYXRlX2JlZ2luIChmKTsKQEAgLTE5MTM1LDYgKzIzODkwLDE2IEBA IHRyeV93aW5kb3dfaWQgKHN0cnVjdCB3aW5kb3cgKncpCiAJewogCSAgRlJBTUVfUklGIChmKS0+ dXBkYXRlX3dpbmRvd19iZWdpbl9ob29rICh3KTsKIAkgIEZSQU1FX1JJRiAoZiktPmNsZWFyX3dp bmRvd19tb3VzZV9mYWNlICh3KTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1V TFRJUExFLUNVUlNPUlMgKi8KKworICAgIG1jX3ByZV9zY3JvbGxfY2xlYW4gKHcsIHJ1biwgZmly c3RfdW5jaGFuZ2VkX2F0X2VuZF92cG9zLCBkdnBvcywgVFJZX1dJTkRPV19JRCk7CisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKIAkgIEZSQU1FX1JJRiAoZiktPnNjcm9sbF9ydW5faG9v ayAodywgJnJ1bik7CiAJICBGUkFNRV9SSUYgKGYpLT51cGRhdGVfd2luZG93X2VuZF9ob29rICh3 LCBmYWxzZSwgZmFsc2UpOwogCX0KQEAgLTIxMjczLDYgKzI2MDM4LDE3IEBAIG1heWJlX3Byb2R1 Y2VfbGluZV9udW1iZXIgKHN0cnVjdCBpdCAqaXQpCiAgICAgICBTRVRfVEVYVF9QT1MgKHRlbV9p dC5wb3NpdGlvbiwgLTEsIC0xKTsKICAgICAgIFBST0RVQ0VfR0xZUEhTICgmdGVtX2l0KTsKIAor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAg ICAgLyogVGhpcyBwZXJtaXRzIHVzIHRvIGluc3BlY3QgdGhlIEhQT1Mgb2YgbGluZSBudW1iZXIg Z2x5cGhzIGFuZCB0aGUgc3BhY2UKKyAgICAgIHBhZGRpbmcgYmVmb3JlL2FmdGVyIHRoZSBsaW5l IG51bWJlcnMuICBXZSBzZXQgYGdseXBoLT5ocG9zYCBlbHNld2hlcmUuICovCisgICAgICB0ZW1f aXQuaHBvcyArPSAxOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICAvKiBT dG9wIHByb2R1Y2luZyBnbHlwaHMsIGFuZCByZWZyYWluIGZyb20gcHJvZHVjaW5nIHRoZSBsaW5l CiAJIG51bWJlciwgaWYgd2UgZG9uJ3QgaGF2ZSBlbm91Z2ggc3BhY2Ugb24gdGhpcyBsaW5lLiAg Ki8KICAgICAgIGlmICh0ZW1faXQuY3VycmVudF94ID49IHdpZHRoX2xpbWl0KQpAQCAtMjEyODQs NiArMjYwNjAsMzAgQEAgbWF5YmVfcHJvZHVjZV9saW5lX251bWJlciAoc3RydWN0IGl0ICppdCkK IAl9CiAgICAgfQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VS U09SUyAqLworCisgIExpc3BfT2JqZWN0IGJ1ZiA9IGl0LT53LT5jb250ZW50czsKKyAgQ0hFQ0tf QlVGRkVSIChidWYpOworICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAoYnVmKTsKKyAgc3Ry dWN0IGJ1ZmZlciAqb2xkX2J1ZmZlciA9IE5VTEw7CisgIC8qIE5lZWRlZCBzbyB0aGF0IGJ1ZmZl ci1sb2NhbCB2YWx1ZXMgY2FuIGJlIGRldGVybWluZWQ7IGUuZy4sIHdoZW4gc3dpdGNoaW5nCisg IHRvIHRoZSBtaW5pYnVmZmVyLiAqLworICBpZiAoYiAhPSBjdXJyZW50X2J1ZmZlcikKKyAgICB7 CisgICAgICBvbGRfYnVmZmVyID0gY3VycmVudF9idWZmZXI7CisgICAgICBzZXRfYnVmZmVyX2lu dGVybmFsIChiKTsKKyAgICB9CisgIGl0LT53LT5tYy5sbnVtX3BpeGVsX3dpZHRoID0gKCFOSUxQ IChWZGlzcGxheV9saW5lX251bWJlcnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gdGVtX2l0LmN1cnJlbnRfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogMDsK KyAgaWYgKG9sZF9idWZmZXIpCisgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7 CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogUmVjb3JkIHRoZSB3aWR0aCBp biBwaXhlbHMgd2UgbmVlZCBmb3IgdGhlIGxpbmUgbnVtYmVyIGRpc3BsYXkuICAqLwogICBpdC0+ bG51bV9waXhlbF93aWR0aCA9IHRlbV9pdC5jdXJyZW50X3g7CiAgIC8qIENvcHkgdGhlIHByb2R1 Y2VkIGdseXBocyBpbnRvIElUJ3MgZ2x5cGhfcm93LiAgKi8KQEAgLTI3MDkyLDYgKzMxODkyLDE3 IEBAIGFwcGVuZF9nbHlwaCAoc3RydWN0IGl0ICppdCkKIAkgICAgZ1sxXSA9ICpnOwogCSAgZ2x5 cGggPSBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJlYV07CiAJfQorCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+aHBvcyA9 IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPmJ5dGVwb3MgPSBJVF9CWVRFUE9TICgqaXQpOworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQ T1MgKGl0LT5wb3NpdGlvbik7CiAgICAgICBnbHlwaC0+b2JqZWN0ID0gaXQtPm9iamVjdDsKICAg ICAgIGlmIChpdC0+cGl4ZWxfd2lkdGggPiAwKQpAQCAtMjcxNzUsNiArMzE5ODYsMTcgQEAgYXBw ZW5kX2NvbXBvc2l0ZV9nbHlwaCAoc3RydWN0IGl0ICppdCkKIAkgICAgZ1sxXSA9ICpnOwogCSAg Z2x5cGggPSBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbaXQtPmFyZWFdOwogCX0KKworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgt Pmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBoLT5ieXRlcG9zID0gSVRfQllURVBPUyAoKml0 KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgZ2x5cGgtPmNoYXJwb3Mg PSBpdC0+Y21wX2l0LmNoYXJwb3M7CiAgICAgICBnbHlwaC0+b2JqZWN0ID0gaXQtPm9iamVjdDsK ICAgICAgIGVhc3NlcnQgKGl0LT5waXhlbF93aWR0aCA8PSBTSFJUX01BWCk7CkBAIC0yNzM4Myw2 ICszMjIwNSwxNyBAQCBwcm9kdWNlX2ltYWdlX2dseXBoIChzdHJ1Y3QgaXQgKml0KQogCX0KICAg ICAgIGlmIChnbHlwaCA8IGl0LT5nbHlwaF9yb3ctPmdseXBoc1thcmVhICsgMV0pCiAJeworCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAg ICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPmJ5dGVwb3MgPSBJVF9CWVRF UE9TICgqaXQpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICBnbHlwaC0+Y2hh cnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAJICBnbHlwaC0+b2JqZWN0ID0gaXQtPm9i amVjdDsKIAkgIGdseXBoLT5waXhlbF93aWR0aCA9IGNsaXBfdG9fYm91bmRzICgtMSwgaXQtPnBp eGVsX3dpZHRoLCBTSFJUX01BWCk7CkBAIC0yNzQ4Niw2ICszMjMxOSwxNyBAQCBwcm9kdWNlX3h3 aWRnZXRfZ2x5cGggKHN0cnVjdCBpdCAqaXQpCiAJfQogICAgICAgaWYgKGdseXBoIDwgaXQtPmds eXBoX3Jvdy0+Z2x5cGhzW2FyZWEgKyAxXSkKIAl7CisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhw b3M7CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9IElUX0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKIAkgIGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBv c2l0aW9uKTsKIAkgIGdseXBoLT5vYmplY3QgPSBpdC0+b2JqZWN0OwogCSAgZ2x5cGgtPnBpeGVs X3dpZHRoID0gY2xpcF90b19ib3VuZHMgKC0xLCBpdC0+cGl4ZWxfd2lkdGgsIFNIUlRfTUFYKTsK QEAgLTI3NTcyLDYgKzMyNDE2LDE3IEBAIGFwcGVuZF9zdHJldGNoX2dseXBoIChzdHJ1Y3QgaXQg Kml0LCBMaXNwX09iamVjdCBvYmplY3QsCiAJICAgIHdpZHRoIC09IGl0LT5maXJzdF92aXNpYmxl X3ggLSBpdC0+Y3VycmVudF94OwogCSAgZWFzc2VydCAod2lkdGggPiAwKTsKIAl9CisKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGds eXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9IElUX0JZVEVQT1Mg KCppdCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIGdseXBoLT5jaGFy cG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5vYmplY3QgPSBvYmpl Y3Q7CiAgICAgICAvKiBGSVhNRTogSXQgd291bGQgYmUgYmV0dGVyIHRvIHVzZSBUWVBFX01BWCBo ZXJlLCBidXQKQEAgLTI4MDI2LDYgKzMyODgxLDE3IEBAIGFwcGVuZF9nbHlwaGxlc3NfZ2x5cGgg KHN0cnVjdCBpdCAqaXQsIGludCBmYWNlX2lkLCBib29sIGZvcl9ub19mb250LCBpbnQgbGVuLAog CSAgICBnWzFdID0gKmc7CiAJICBnbHlwaCA9IGl0LT5nbHlwaF9yb3ctPmdseXBoc1thcmVhXTsK IAl9CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9 IElUX0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAg IGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5v YmplY3QgPSBpdC0+b2JqZWN0OwogICAgICAgZWFzc2VydCAoaXQtPnBpeGVsX3dpZHRoIDw9IFNI UlRfTUFYKTsKQEAgLTI5MDc2LDEwICszMzk0MiwyMCBAQCB4X2luc2VydF9nbHlwaHMgKHN0cnVj dCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnVwZGF0ZWRfcm93LAogCiAgIC8qIFdyaXRl IHRoZSBnbHlwaHMuICAqLwogICBocG9zID0gc3RhcnQgLSByb3ctPmdseXBoc1t1cGRhdGVkX2Fy ZWFdOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAq LworCisgIGlmICghbWNfcmVkcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgsIHJvdywgdXBk YXRlZF9hcmVhLCB3LT5vdXRwdXRfY3Vyc29yLngsCisgICAgICAgICAgICAgICAgICAgICAgaHBv cywgaHBvcyArIGxlbiwgZmFsc2UsIERSQVdfTk9STUFMX1RFWFQsIFhfSU5TRVJUX0dMWVBIUykp CiAgIGRyYXdfZ2x5cGhzICh3LCB3LT5vdXRwdXRfY3Vyc29yLngsIHJvdywgdXBkYXRlZF9hcmVh LAogCSAgICAgICBocG9zLCBocG9zICsgbGVuLAogCSAgICAgICBEUkFXX05PUk1BTF9URVhULCAw KTsKIAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBBZHZhbmNlIHRoZSBvdXRw dXQgY3Vyc29yLiAgKi8KICAgdy0+b3V0cHV0X2N1cnNvci5ocG9zICs9IGxlbjsKICAgdy0+b3V0 cHV0X2N1cnNvci54ICs9IHNoaWZ0X2J5X3dpZHRoOwpAQCAtMjk1MDUsOSArMzQzODEsMTkgQEAg eF9maXhfb3ZlcmxhcHBpbmdfYXJlYSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3Jv dyAqcm93LAogCSAgd2hpbGUgKGkgPCByb3ctPnVzZWRbYXJlYV0KIAkJICYmIHJvdy0+Z2x5cGhz W2FyZWFdW2ldLm92ZXJsYXBzX3ZlcnRpY2FsbHlfcCk7CiAKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGlmICghbWNfcmVkcmF3X3Jv dyAodywgdy0+Y3VycmVudF9tYXRyaXgsIHJvdywgYXJlYSwgc3RhcnRfeCwgc3RhcnQsIGksCisg ICAgICAgICAgZmFsc2UsIERSQVdfTk9STUFMX1RFWFQsIFhfRklYX09WRVJMQVBQSU5HX0FSRUEp KQogCSAgZHJhd19nbHlwaHMgKHcsIHN0YXJ0X3gsIHJvdywgYXJlYSwKIAkJICAgICAgIHN0YXJ0 LCBpLAogCQkgICAgICAgRFJBV19OT1JNQUxfVEVYVCwgb3ZlcmxhcHMpOworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAJfQogICAgICAgZWxzZQogCXsKQEAgLTI5NzU4LDEwICszNDY0 NCwxNyBAQCBkaXNwbGF5X2FuZF9zZXRfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIG9u LAogICBuZXdfY3Vyc29yX3R5cGUgPSBnZXRfd2luZG93X2N1cnNvcl90eXBlICh3LCBnbHlwaCwK IAkJCQkJICAgICZuZXdfY3Vyc29yX3dpZHRoLCAmYWN0aXZlX2N1cnNvcik7CiAKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgLyogSWYgY3Vy c29yIGlzIGN1cnJlbnRseSBiZWluZyBzaG93biBhbmQgd2UgZG9uJ3Qgd2FudCBpdCB0byBiZSBv cgogICAgICBpdCBpcyBpbiB0aGUgd3JvbmcgcGxhY2UsIG9yIHRoZSBjdXJzb3IgdHlwZSBpcyBu b3Qgd2hhdCB3ZSB3YW50LAogICAgICBlcmFzZSBpdC4gICovCiAgIGlmICh3LT5waHlzX2N1cnNv cl9vbl9wCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3Nz aGFpcnMpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192 aXNpYmxlKSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNf Y29uZikpCiAgICAgICAmJiAoIW9uCiAJICB8fCB3LT5waHlzX2N1cnNvci54ICE9IHgKIAkgIHx8 IHctPnBoeXNfY3Vyc29yLnkgIT0geQpAQCAtMjk3NzQsNiArMzQ2NjcsOSBAQCBkaXNwbGF5X2Fu ZF9zZXRfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIG9uLAogCSAgICAgICYmIG5ld19j dXJzb3Jfd2lkdGggIT0gdy0+cGh5c19jdXJzb3Jfd2lkdGgpKSkKICAgICBlcmFzZV9waHlzX2N1 cnNvciAodyk7CiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogRG9uJ3QgY2hl Y2sgcGh5c19jdXJzb3Jfb25fcCBoZXJlIGJlY2F1c2UgdGhhdCBmbGFnIGlzIG9ubHkgc2V0CiAg ICAgIHRvIGZhbHNlIGluIHNvbWUgY2FzZXMgd2hlcmUgd2Uga25vdyB0aGF0IHRoZSBjdXJzb3Ig aGFzIGJlZW4KICAgICAgY29tcGxldGVseSBlcmFzZWQsIHRvIGF2b2lkIHRoZSBleHRyYSB3b3Jr IG9mIGVyYXNpbmcgdGhlIGN1cnNvcgpAQCAtMjk3OTIsOSArMzQ2ODgsMTkgQEAgZGlzcGxheV9h bmRfc2V0X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBvbiwKICAgICAgIHctPnBoeXNf Y3Vyc29yLnZwb3MgPSB2cG9zOwogICAgIH0KIAotICBGUkFNRV9SSUYgKGYpLT5kcmF3X3dpbmRv d19jdXJzb3IgKHcsIGdseXBoX3JvdywgeCwgeSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBuZXdfY3Vyc29yX3R5cGUsIG5ld19jdXJzb3Jfd2lkdGgsCi0gICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgb24sIGFjdGl2ZV9jdXJzb3IpOworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBpZiAoTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICYmIE5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpCisgICAgICAmJiBOSUxQ IChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkKKyAgICBGUkFNRV9SSUYg KGYpLT5kcmF3X3dpbmRvd19jdXJzb3IgKHcsIGdseXBoX3JvdywgeCwgeSwgbmV3X2N1cnNvcl90 eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2N1cnNvcl93 aWR0aCwgb24sIGFjdGl2ZV9jdXJzb3IpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiB9CiAKIApAQCAtMjk4ODcsNyArMzQ3OTMsMTggQEAgZHJhd19yb3dfd2l0aF9tb3VzZV9mYWNl IChzdHJ1Y3Qgd2luZG93ICp3LCBpbnQgc3RhcnRfeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAog I2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQogICBpZiAoRlJBTUVfV0lORE9XX1AgKFhGUkFNRSAo dy0+ZnJhbWUpKSkKICAgICB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKyAgICAgIGlmICghbWNfcmVkcmF3X3JvdyAodywgdy0+Y3VycmVu dF9tYXRyaXgsIHJvdywgVEVYVF9BUkVBLCBzdGFydF94LAorICAgICAgICAgICAgICAgICAgICAg ICAgICBzdGFydF9ocG9zLCBlbmRfaHBvcywgZmFsc2UsIGRyYXcsIERSQVdfUk9XX1dJVEhfTU9V U0VfRkFDRSkpCiAgICAgICBkcmF3X2dseXBocyAodywgc3RhcnRfeCwgcm93LCBURVhUX0FSRUEs IHN0YXJ0X2hwb3MsIGVuZF9ocG9zLCBkcmF3LCAwKTsKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogICAgICAgcmV0dXJuOwogICAgIH0KICNlbmRpZgpAQCAtMzE5NDUsMTEgKzM2ODYy LDIzIEBAIGV4cG9zZV9hcmVhIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpy b3csIFhSZWN0YW5nbGUgKnIsCiAgIHN0cnVjdCBnbHlwaCAqbGFzdDsKICAgaW50IGZpcnN0X3gs IHN0YXJ0X3gsIHg7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1D VVJTT1JTICovCisKICAgaWYgKGFyZWEgPT0gVEVYVF9BUkVBICYmIHJvdy0+ZmlsbF9saW5lX3Ap CisgICAgeworICAgICAgaWYgKCFtY19yZWRyYXdfcm93ICh3LCB3LT5jdXJyZW50X21hdHJpeCwg cm93LCBhcmVhLCAwLCAwLCByb3ctPnVzZWRbYXJlYV0sCisgICAgICAgICAgICAgICAgICAgICAg ICAgIGZhbHNlLCBEUkFXX05PUk1BTF9URVhULCBFWFBPU0VfQVJFQV9PTkUpKQogICAgIC8qIElm IHJvdyBleHRlbmRzIGZhY2UgdG8gZW5kIG9mIGxpbmUgd3JpdGUgdGhlIHdob2xlIGxpbmUuICAq LwogICAgIGRyYXdfZ2x5cGhzICh3LCAwLCByb3csIGFyZWEsCiAJCSAwLCByb3ctPnVzZWRbYXJl YV0sCiAJCSBEUkFXX05PUk1BTF9URVhULCAwKTsKKyAgICB9CisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworCisKICAgZWxzZQogICAgIHsKICAgICAgIC8qIFNldCBTVEFSVF9YIHRvIHRoZSB3 aW5kb3ctcmVsYXRpdmUgc3RhcnQgcG9zaXRpb24gZm9yIGRyYXdpbmcgZ2x5cGhzIG9mCkBAIC0z MTk4MSwxMSArMzY5MTAsMjMgQEAgZXhwb3NlX2FyZWEgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVj dCBnbHlwaF9yb3cgKnJvdywgWFJlY3RhbmdsZSAqciwKIAkgICsrbGFzdDsKIAl9CiAKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgICAgIC8q IFJlcGFpbnQuICAqLwotICAgICAgaWYgKGxhc3QgPiBmaXJzdCkKKyAgICAgIC8qIEZsb2F0aW5n IGZha2UgY3Vyc29ycyB3aWxsIGV4aXN0IHdoZW4gKGxhc3QgPT0gZmlyc3QpLiAqLworICAgICAg aWYgKCFtY19yZWRyYXdfcm93ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgcm93LCBhcmVhLCBmaXJz dF94IC0gc3RhcnRfeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZmlyc3QgLSByb3ctPmds eXBoc1thcmVhXSwgbGFzdCAtIHJvdy0+Z2x5cGhzW2FyZWFdLAorICAgICAgICAgICAgICAgICAg ICAgICAgICBmYWxzZSwgRFJBV19OT1JNQUxfVEVYVCwgRVhQT1NFX0FSRUFfVFdPKQorICAgICAg ICAgICYmIGxhc3QgPiBmaXJzdCkKIAlkcmF3X2dseXBocyAodywgZmlyc3RfeCAtIHN0YXJ0X3gs IHJvdywgYXJlYSwKIAkJICAgICBmaXJzdCAtIHJvdy0+Z2x5cGhzW2FyZWFdLCBsYXN0IC0gcm93 LT5nbHlwaHNbYXJlYV0sCiAJCSAgICAgRFJBV19OT1JNQUxfVEVYVCwgMCk7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgICB9CiB9CiAKQEAgLTMxOTk5LDEwICszNjk0MCwyMiBA QCBleHBvc2VfbGluZSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqcm93LCBY UmVjdGFuZ2xlICpyKQogewogICBlYXNzZXJ0IChyb3ctPmVuYWJsZWRfcCk7CiAKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgaWYgKHJvdy0+ bW9kZV9saW5lX3AgfHwgdy0+cHNldWRvX3dpbmRvd19wKQorICAgIHsKKyAgICAgIGlmICghbWNf cmVkcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgsIHJvdywgVEVYVF9BUkVBLCAwLCAwLAor ICAgICAgICAgICAgICAgICAgICAgICAgICByb3ctPnVzZWRbVEVYVF9BUkVBXSwgZmFsc2UsIERS QVdfTk9STUFMX1RFWFQsIEVYUE9TRV9MSU5FKSkKICAgICBkcmF3X2dseXBocyAodywgMCwgcm93 LCBURVhUX0FSRUEsCiAJCSAwLCByb3ctPnVzZWRbVEVYVF9BUkVBXSwKIAkJIERSQVdfTk9STUFM X1RFWFQsIDApOworICAgIH0KKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBlbHNl CiAgICAgewogICAgICAgaWYgKHJvdy0+dXNlZFtMRUZUX01BUkdJTl9BUkVBXSkKQEAgLTMyNTUw LDYgKzM3NTAzLDIyIEBAIHhfaW50ZXJzZWN0X3JlY3RhbmdsZXMgKFhSZWN0YW5nbGUgKnIxLCBY UmVjdGFuZ2xlICpyMiwgWFJlY3RhbmdsZSAqcmVzdWx0KQogdm9pZAogc3ltc19vZl94ZGlzcCAo dm9pZCkKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNP UlMgKi8KKworICBkZWZzdWJyICgmU21jX2R1bXBfZ2x5cGhfcm93KTsKKworICBkZWZzdWJyICgm U21jX2R1bXBfZ2x5cGhfbWF0cml4KTsKKworICBkZWZzdWJyICgmU21jX2N1cnJlbnRfY29sdW1u KTsKKworICBkZWZzdWJyICgmU21jX3N0ZGVycik7CisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKICAgVndpdGhfZWNob19hcmVhX3NhdmVfdmVjdG9yID0gUW5pbDsKICAgc3RhdGljcHJv ICgmVndpdGhfZWNob19hcmVhX3NhdmVfdmVjdG9yKTsKIApkaWZmIC0tZ2l0IGEvc3JjL3h0ZXJt LmMgYi9zcmMveHRlcm0uYwppbmRleCA1YWEzZTNmLi4wZTVkNzViIDEwMDY0NAotLS0gYS9zcmMv eHRlcm0uYworKysgYi9zcmMveHRlcm0uYwpAQCAtMTMyLDYgKzEzMiw4ODUgQEAgYWxvbmcgd2l0 aCBHTlUgRW1hY3MuICBJZiBub3QsIHNlZSA8aHR0cHM6Ly93d3cuZ251Lm9yZy9saWNlbnNlcy8+ LiAgKi8KICNpbmNsdWRlIDxYMTEvWEtCbGliLmg+CiAjZW5kaWYKIAorCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExFLUNVUlNPUlMgKi8KKworI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HhfY2xpcF90b19yb3cgKHcsIHJvdywgVEVYVF9BUkVBLCBnYyk7CisgICAgICB4X2Zp bGxfcmVjdGFuZ2xlIChmLCBnYywgZngsIGZ5LCB3ZCwgaCk7CisgICAgICB4X3Jlc2V0X2NsaXBf cmVjdGFuZ2xlcyAoZiwgZ2MpOworICAgIH0KK30KKworLyogUklGOiBEcmF3IGN1cnNvciBvbiB3 aW5kb3cgVy4gKi8KK3N0YXRpYyB2b2lkCittY194X2RyYXdfd2luZG93X2N1cnNvciAoc3RydWN0 IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93 ICpyb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHgsIGludCBmeCwgaW50IHksIGlu dCBmeSwgaW50IGhwb3MsIGludCB2cG9zLCBpbnQgd2QsCisgICAgICAgICAgICAgICAgICAgICAg ICAgaW50IGgsIHN0cnVjdCBtY19SR0IgbHNsLCBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90 eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGgsIGVudW0gbWNf Zmxhdm9yIGdseXBoX2ZsYXZvciwgYm9vbCBvbl9wLAorICAgICAgICAgICAgICAgICAgICAgICAg IGJvb2wgYWN0aXZlX3ApCit7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAoV0lORE9XX0ZS QU1FICh3KSk7CisgIC8qIFRoZSBmcmluZ2UgYml0bWFwcyBhcmUgcHJlc2VudGx5IGhhbmRsZWQg ZWxzZXdoZXJlLCBidXQgY291bGQgc29tZWRheQorICBiZSBtYW5hZ2VkIChpbiBwYXJ0KSBhdCB0 aGlzIHNlY3Rpb24gb2YgY29kZS4gKi8KKyAgaWYgKG9uX3ApCisgICAgeworICAgICAgaWYgKHJv dy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVfcAorICAgICAgICAgICYmIChyb3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ZSIpLCB0cnVlKTsKKyAgICAgICAgICAg ICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBo b2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChG UkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19h Y3RpdmVfZmFjZS0+Zm9yZWdyb3VuZCk7CisgICAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQg KEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93 X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2UtPmJhY2tncm91bmQpOworICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICAgIGVsc2UgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAg ICAgICAmJiBhY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgt PmNoYXJwb3MgPiByZWdpb25fYmVnCisgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9n bHlwaC0+Y2hhcnBvcyA8IHJlZ2lvbl9lbmQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZV9p ZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3It aW4tcmVnaW9uLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgc3RydWN0 IGZhY2UgKmhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZSA9IEZBQ0VfRlJPTV9JRCAo ZiwgaG9sbG93X2FjdG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gIH0KKyAgICAgICAgZWxzZSBp ZiAoY3Vyc29yX2dseXBoLT50eXBlID09IElNQUdFX0dMWVBIICYmIGxzbC5yZWQgPj0gMCAmJiBs c2wuZ3JlZW4gPj0gMCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAgICAgIHsKKyAgICAgICAgICAg IC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsJy4g Ki8KKyAgICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IGNvbG9yLnBp eGVsOworICAgICAgICAgICAgbWNfeF9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93 LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAgICAgICAgICAgIGYtPm91dHB1 dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAg ICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBUZW1w b3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYycgYnkgYm9ycm93aW5n IHRoZQorICAgICAgICAgICAgICBmdW5jdGlvbmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHhmbnMu Yy4gKi8KKyAgICAgICAgICAgICAgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAg ICAgJiYgYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+Y2hhcnBv cyA9PSByZWdpb25fYmVnKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGVu dW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZWdfZmFjZV9pZCA9IGxvb2t1cF9uYW1l ZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItYXQtcmVnaW9uLXByZS16 di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19h Y3RpdmVfcmVnaW9uX2JlZ19mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX3Jl Z2lvbl9iZWdfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93 X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVh bC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgIHN0 cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19h Y3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVf WF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfYWN0aXZl X2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZS QU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2Fj dGl2ZV9yZWdpb25fYmVnX2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBhY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9n bHlwaC0+Y2hhcnBvcyA9PSByZWdpb25fZW5kKQorICAgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgIC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TZXRCYWNrZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBm LT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5f ZmFjZS0+Zm9yZWdyb3VuZCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAg ICAgICAgZWxzZSBpZiAoYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfZmFjZV9pZCA9IGxv b2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItcHJlLXp2 LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9s bG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQp OworICAgICAgICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExB WSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9mYWNlLT5m b3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIFhTZXRCYWNrZ3JvdW5kIChGUkFN RV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19hY3Rp dmVfZmFjZS0+YmFja2dyb3VuZCk7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgICAgICAgICAgIGVsc2UgaWYgKCFhY3RpdmVfcCkKKyAgICAgICAgICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2 ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtl LWN1cnNvci1pbmFjdGl2ZS1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19pbmFjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lE IChmLCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAg IFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5j dXJzb3JfZ2MsIGhvbGxvd19pbmFjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91 dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2luYWN0aXZlX2ZhY2UtPmJhY2tncm91bmQp OworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBibG9ja19pbnB1dCAo KTsKKyAgICAgICAgICAgICAgLyogRm9yY2UgYG1jX3hfc2V0X2N1cnNvcl9nYycgdG8gdXNlIGBz LT5mLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MnLiAqLworICAgICAgICAgICAgICBib29sIGN1 cnNvcl9nY19wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcs IG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2Qs IGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX2dj X3ApOworICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwg Zi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCB4Z2N2LmZvcmVncm91bmQpOworICAgICAgICAg ICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEu eC0+Y3Vyc29yX2djLCB4Z2N2LmJhY2tncm91bmQpOworICAgICAgICAgICAgICB1bmJsb2NrX2lu cHV0ICgpOworICAgICAgICAgICAgICAvKiBEcmF3IHRoZSBmcmFtZSBhcm91bmQgdGhlIGJveC4g Ki8KKyAgICAgICAgICAgICAgbWNfeF9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93 LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAgICAgICAgICAgIH0KKyAgICAg IGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0hPTExPV19CT1g6CisgICAgeworICAgICAgaWYg KGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAg ICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5j dXJzb3JfcGl4ZWwnLiAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhl bCA9IGNvbG9yLnBpeGVsOworICAgICAgICAgIG1jX3hfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBt YXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICAgICAg Zi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOwor ICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICBtY194X2RyYXdfaG9sbG93X2N1cnNv ciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAg ICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAgICB7CisgICAgICBp ZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAg ICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djJyBi eSBib3Jyb3dpbmcgdGhlCisgICAgICAgIGZ1bmN0aW9uYWxpdHkgb2YgYHhfbWFrZV9nYycgaW4g eGZucy5jLiAqLworICAgICAgICB7CisgICAgICAgICAgYmxvY2tfaW5wdXQgKCk7CisgICAgICAg ICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngt PmN1cnNvcl9nYywgRlJBTUVfQkFDS0dST1VORF9QSVhFTCAoZikpOworICAgICAgICAgIFhTZXRC YWNrZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3Jf Z2MsIGNvbG9yLnBpeGVsKTsKKyAgICAgICAgICAvKiBGb3JjZSBgbWNfeF9zZXRfY3Vyc29yX2dj JyB0byB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYycuICovCisgICAgICAgICAg Ym9vbCBjdXJzb3JfZ2NfcCA9IHRydWU7CisgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGgg KHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywgbHNsLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwg YWN0aXZlX3AsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVf WF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCB4Z2N2LmZvcmVncm91 bmQpOworICAgICAgICAgIFhTZXRCYWNrZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5v dXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIHhnY3YuYmFja2dyb3VuZCk7CisgICAgICAgICAgdW5i bG9ja19pbnB1dCAoKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAg ICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNfZHJhd19j dXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywg bHNsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgY3Vy c29yX3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOworICAgICAgICAgIH0KKyAgICAg IGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0JBUjoKKyAgICB7CisgICAgICBpZiAobHNsLnJl ZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAg ICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9w aXhlbCcuICovCisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gY29s b3IucGl4ZWw7CisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IHRy dWU7CisgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBm eCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBjdXJzb3Jfd2lkdGgsIE1DX0JBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOwor ICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNv cl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAg ICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IGZhbHNlOworICAgICAgICAgICAg bWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3Ms IHZwb3MsIHdkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl93 aWR0aCwgTUNfQkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgfQor ICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfSEJBUjoKKyAgICB7CisgICAgICBpZiAo bHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAg IHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1 cnNvcl9waXhlbCcuICovCisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVs ID0gY29sb3IucGl4ZWw7CisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlf cCA9IHRydWU7CisgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93 LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIE1DX0hCQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2th eV9wKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5h bF9jdXJzb3JfcGl4ZWw7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAg ICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSBmYWxzZTsKKyAgICAg ICAgICAgIG1jX3hfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5 LCBocG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoLCBj dXJzb3Jfd2lkdGgsIE1DX0hCQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAg ICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fi b3J0ICgpOworICB9CisgICAgICAgIH0KKyNpZmRlZiBIQVZFX1hfSTE4TgorICBpZiAodyA9PSBY V0lORE9XIChmLT5zZWxlY3RlZF93aW5kb3cpKQorICAgIGlmIChGUkFNRV9YSUMgKGYpICYmIChG UkFNRV9YSUNfU1RZTEUgKGYpICYgWElNUHJlZWRpdFBvc2l0aW9uKSkKKyAgICAgIHhpY19zZXRf cHJlZWRpdGFyZWEgKHcsIHgsIHkpOworI2VuZGlmCisgICAgfQorICBYRmx1c2ggKEZSQU1FX1hf RElTUExBWSAoZikpOworfQorCisvKiBEcmF3IHN0cmV0Y2ggZ2x5cGggc3RyaW5nIFMuICovCitz dGF0aWMgdm9pZAorbWNfeF9kcmF3X3N0cmV0Y2hfZ2x5cGhfc3RyaW5nIChzdHJ1Y3QgZ2x5cGhf c3RyaW5nICpzKQoreworICBlYXNzZXJ0IChzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBTVFJFVENI X0dMWVBIKTsKKyAgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SCisgICAgICAmJiAheF9zdHJldGNo X2N1cnNvcl9wKQorICAgIHsKKyAgICAgIC8qIElmIGB4LXN0cmV0Y2gtY3Vyc29yJyBpcyBuaWws IGRvbid0IGRyYXcgYSBibG9jayBjdXJzb3IgYXMgd2lkZSBhcyB0aGUKKyAgICAgIHN0cmV0Y2gg Z2x5cGguICovCisgICAgICBpbnQgd2lkdGgsIGJhY2tncm91bmRfd2lkdGggPSBzLT5iYWNrZ3Jv dW5kX3dpZHRoOworICAgICAgaW50IHggPSBzLT54OworICAgICAgaWYgKCFzLT5yb3ctPnJldmVy c2VkX3ApCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgbGVmdF94ID0gd2luZG93X2JveF9sZWZ0 X29mZnNldCAocy0+dywgVEVYVF9BUkVBKTsKKyAgICAgICAgICBpZiAoeCA8IGxlZnRfeCkKKyAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgYmFja2dyb3VuZF93aWR0aCAtPSBsZWZ0X3ggLSB4 OworICAgICAgICAgICAgICB4ID0gbGVmdF94OworICAgICAgICAgICAgfQorICAgICAgICB9Cisg ICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICAvKiBJbiBSMkwgcm93cywgZHJh dyB0aGUgY3Vyc29yIG9uIHRoZSByaWdodCBlZGdlIG9mIHRoZQorICAgICAgICAgICAgICAgc3Ry ZXRjaCBnbHlwaC4gKi8KKyAgICAgICAgICAgIGludCByaWdodF94ID0gd2luZG93X2JveF9yaWdo dCAocy0+dywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgIGlmICh4ICsgYmFja2dyb3VuZF93aWR0 aCA+IHJpZ2h0X3gpCisgICAgICAgICAgICAgIGJhY2tncm91bmRfd2lkdGggLT0geCAtIHJpZ2h0 X3g7CisgICAgICAgICAgICB4ICs9IGJhY2tncm91bmRfd2lkdGg7CisgICAgICAgICAgfQorICAg ICAgd2lkdGggPSBtaW4gKEZSQU1FX0NPTFVNTl9XSURUSCAocy0+ZiksIGJhY2tncm91bmRfd2lk dGgpOworICAgICAgaWYgKHMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAgICAgICAgeCAtPSB3aWR0aDsK KyAgICAgIC8qIERyYXcgY3Vyc29yLiAqLworICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19iZ19y ZWN0IChzLCB4LCBzLT55LCB3aWR0aCwgcy0+aGVpZ2h0KTsKKyAgICAgIC8qIENsZWFyIHJlc3Qg dXNpbmcgdGhlIEdDIG9mIHRoZSBvcmlnaW5hbCBub24tY3Vyc29yIGZhY2UuICovCisgICAgICBp ZiAod2lkdGggPCBiYWNrZ3JvdW5kX3dpZHRoKQorICAgICAgICB7CisgICAgICAgICAgaW50IHkg PSBzLT55OworICAgICAgICAgIGludCB3ID0gYmFja2dyb3VuZF93aWR0aCAtIHdpZHRoLCBoID0g cy0+aGVpZ2h0OworICAgICAgICAgIFhSZWN0YW5nbGUgcjsKKyAgICAgICAgICBHQyBnYzsKKyAg ICAgICAgICBpZiAoIXMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAgICAgICAgICAgIHggKz0gd2lkdGg7 CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeCA9IHMtPng7CisgICAgICAgICAgaWYgKHMt PnJvdy0+bW91c2VfZmFjZV9wCisgICAgICAgICAgICAgICYmIGN1cnNvcl9pbl9tb3VzZV9mYWNl X3AgKHMtPncpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICB4X3NldF9tb3VzZV9mYWNl X2djIChzKTsKKyAgICAgICAgICAgICAgZ2MgPSBzLT5nYzsKKyAgICAgICAgICAgIH0KKyAgICAg ICAgICBlbHNlCisgICAgICAgICAgICBnYyA9IHMtPmZhY2UtPmdjOworICAgICAgICAgIGdldF9n bHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCAmcik7CisgICAgICAgICAgeF9zZXRfY2xpcF9yZWN0 YW5nbGVzIChzLT5mLCBnYywgJnIsIDEpOworICAgICAgICAgIGlmIChzLT5mYWNlLT5zdGlwcGxl KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBGaWxsIGJhY2tncm91bmQgd2l0aCBh IHN0aXBwbGUgcGF0dGVybi4gKi8KKyAgICAgICAgICAgICAgWFNldEZpbGxTdHlsZSAocy0+ZGlz cGxheSwgZ2MsIEZpbGxPcGFxdWVTdGlwcGxlZCk7CisgICAgICAgICAgICAgIHhfZmlsbF9yZWN0 YW5nbGUgKHMtPmYsIGdjLCB4LCB5LCB3LCBoKTsKKyAgICAgICAgICAgICAgWFNldEZpbGxTdHls ZSAocy0+ZGlzcGxheSwgZ2MsIEZpbGxTb2xpZCk7CisgICAgICAgICAgICB9CisgICAgICAgICAg ZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBYR0NWYWx1ZXMgeGdjdjsKKyAgICAg ICAgICAgICAgWEdldEdDVmFsdWVzIChzLT5kaXNwbGF5LCBnYywgR0NGb3JlZ3JvdW5kIHwgR0NC YWNrZ3JvdW5kLCAmeGdjdik7CisgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChzLT5kaXNw bGF5LCBnYywgeGdjdi5iYWNrZ3JvdW5kKTsKKyAgICAgICAgICAgICAgeF9maWxsX3JlY3Rhbmds ZSAocy0+ZiwgZ2MsIHgsIHksIHcsIGgpOworICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAo cy0+ZGlzcGxheSwgZ2MsIHhnY3YuZm9yZWdyb3VuZCk7CisgICAgICAgICAgICB9CisgICAgICAg ICAgeF9yZXNldF9jbGlwX3JlY3RhbmdsZXMgKHMtPmYsIGdjKTsKKyAgICAgICAgfQorICAgIH0K KyAgZWxzZSBpZiAoIXMtPmJhY2tncm91bmRfZmlsbGVkX3ApCisgICAgeworICAgICAgaW50IGJh Y2tncm91bmRfd2lkdGggPSBzLT5iYWNrZ3JvdW5kX3dp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2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tn cm91bmQgKG5leHQsIHRydWUpOworICAgICAgICAgICAgbmV4dC0+bnVtX2NsaXBzID0gMDsKKyAg ICAgICAgICB9CisgICAgfQorICAvKiBTZXQgdXAgUy0+Z2MsIHNldCBjbGlwcGluZyBhbmQgZHJh dyBTLiAqLworICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKHMsIGN1cnNvcl9nY19wKTsKKyAg LyogRHJhdyByZWxpZWYgKGlmIGFueSkgaW4gYWR2YW5jZSBmb3IgY2hhci9jb21wb3NpdGlvbiBz byB0aGF0IHRoZQorICAgICBnbHlwaCBzdHJpbmcgY2FuIGJlIGRyYXduIG92ZXIgaXQuICovCisg IGlmICghcy0+Zm9yX292ZXJsYXBzCisgICAgICAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19C T1gKKyAgICAgICYmIChzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAg ICAgfHwgcy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKSkKKyAgICB7Cisg ICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmcgKHMpOworICAgICAgeF9kcmF3X2dseXBo X3N0cmluZ19iYWNrZ3JvdW5kIChzLCB0cnVlKTsKKyAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdf Ym94IChzKTsKKyAgICAgIHhfc2V0X2dseXBoX3N0cmluZ19jbGlwcGluZyAocyk7CisgICAgICBy ZWxpZWZfZHJhd25fcCA9IHRydWU7CisgICAgfQorICAgIGVsc2UgaWYgKCFzLT5jbGlwX2hlYWQg LyogZHJhd19nbHlwaHMgZGlkbid0IHNwZWNpZnkgYSBjbGlwIG1hc2suICovCisgICAgICAgICAg ICAgJiYgIXMtPmNsaXBfdGFpbAorICAgICAgICAgICAgICYmICgocy0+cHJldiAmJiBzLT5wcmV2 LT5obCAhPSBzLT5obCAmJ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gIHhfZHJhd19n bHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAgICBicmVhazsKKyAgICBjYXNlIENPTVBP U0lURV9HTFlQSDoKKyAgICAgIGlmIChzLT5mb3Jfb3ZlcmxhcHMgfHwgKHMtPmNtcF9mcm9tID4g MAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgISBzLT5maXJzdF9nbHlwaC0+dS5j bXAuYXV0b21hdGljKSkKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7Cisg ICAgICBlbHNlCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgdHJ1 ZSk7CisgICAgICB4X2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsK KyAgICAgIGJyZWFrOworICAgIGNhc2UgR0xZUEhMRVNTX0dMWVBIOgorICAgICAgaWYgKHMtPmZv cl9vdmVybGFwcykKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAg ICBlbHNlCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgdHJ1ZSk7 CisgICAgICB4X2RyYXdfZ2x5cGhsZXNzX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAg ICAgIGJyZWFrOworICAgIGRlZmF1bHQ6CisgICAgICBlbWFjc19hYm9ydCAoKTsKKyAgICB9Cisg IGlmICghcy0+Zm9yX292ZXJsYXBzKQorICAgIHsKKyAgICAgIC8qIERyYXcgdW5kZXJsaW5lLiAq LworICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9wKQorICAgICAgICB7CisgICAgICAgICAg aWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfV0FWRSkKKyAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkK KyAgICAgICAgICAgICAgICB4X2RyYXdfdW5kZXJ3YXZlIChzKTsKKyAgICAgICAgICAgICAgZWxz ZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIFhHQ1ZhbHVlcyB4Z2N2Owor ICAgICAgICAgICAgICAgICAgWEdldEdDVmFsdWVzIChzLT5kaXNwbGF5LCBzLT5nYywgR0NGb3Jl Z3JvdW5kLCAmeGdjdik7CisgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAocy0+ZGlz cGxheSwgcy0+Z2MsIHMtPmZhY2UtPnVuZGVybGluZV9jb2xvcik7CisgICAgICAgICAgICAgICAg ICB4X2RyYXdfdW5kZXJ3YXZlIChzKTsKKyAgICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5k IChzLT5kaXNwbGF5LCBzLT5nYywgeGdjdi5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxzZSBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3R5 cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICB1bnNp Z25lZCBsb25nIHRoaWNrbmVzcywgcG9zaXRpb247CisgICAgICAgICAgICAgIGludCB5OworICAg ICAgICAgICAgICBpZiAocy0+cHJldiAmJiBzLT5wcmV2LT5mYWNlLT51bmRlcmxpbmVfcAorICAg ICAgICAgICAgICAgICAgJiYgcy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9V TkRFUl9MSU5FKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIC8qIFdlIHVz ZSB0aGUgc2FtZSB1bmRlcmxpbmUgc3R5bGUgYXMgdGhlIHByZXZpb3VzIG9uZS4gKi8KKyAgICAg ICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPnByZXYtPnVuZGVybGluZV90aGlja25lc3M7Cisg ICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPnByZXYtPnVuZGVybGluZV9wb3NpdGlvbjsK KyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7 CisgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVybGluZSB0aGlja25lc3MuICBEZWZh dWx0IGlzIDEgcGl4ZWwuICovCisgICAgICAgICAgICAgICAgICBpZiAocy0+Zm9udCAmJiBzLT5m b250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4gMCkKKyAgICAgICAgICAgICAgICAgICAgdGhpY2tu ZXNzID0gcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gMTsKKyAgICAgICAgICAgICAgICAg IGlmICh4X3VuZGVybGluZV9hdF9kZXNjZW50X2xpbmUpCisgICAgICAgICAgICAgICAgICAgIHBv c2l0aW9uID0gKHMtPmhlaWdodCAtIHRoaWNrbmVzcykgLSAocy0+eWJhc2UgLSBzLT55KTsKKyAg ICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJsaW5lIHBvc2l0aW9uLiAgVGhpcyBpcyB0aGUgcmVj b21tZW5kZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICB2ZXJ0aWNhbCBvZmZzZXQgaW4gcGl4 ZWxzIGZyb20gdGhlIGJhc2VsaW5lIHRvIHRoZSB0b3Agb2YKKyAgICAgICAgICAgICAgICAgICAg ICAgICB0aGUgdW5kZXJsaW5lLiAgVGhpcyBpcyBhIHNpZ25lZCB2YWx1ZSBhY2NvcmRpbmcgdG8g dGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgc3BlY3MsIGFuZCBpdHMgZGVmYXVsdCBpcwor ICAgICAgICAgICAgICAgICAgICAgICAgIFJPVU5EICgobWF4aW11bSBkZXNjZW50KSAvIDIpLCB3 aXRoCisgICAgICAgICAgICAgICAgICAgICAgICAgUk9VTkQoeCkgPSBmbG9vciAoeCArIDAuNSkg ICovCisgICAgICAgICAgICAgICAgICAgICAgaWYgKHhfdXNlX3VuZGVybGluZV9wb3NpdGlvbl9w cm9wZXJ0aWVzCisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHMtPmZvbnQgJiYgcy0+Zm9u dC0+dW5kZXJsaW5lX3Bvc2l0aW9uID49IDApCisgICAgICAgICAgICAgICAgICAgICAgICBwb3Np dGlvbiA9IHMtPmZvbnQtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgICAgICAg ICBlbHNlIGlmIChzLT5mb250KQorICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAo cy0+Zm9udC0+ZGVzY2VudCArIDEpIC8gMjsKKyAgICAgICAgICAgICAgICAgICAgICBlbHNlCisg ICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHVuZGVybGluZV9taW5pbXVtX29mZnNl dDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBt YXggKHBvc2l0aW9uLCB1bmRlcmxpbmVfbWluaW11bV9vZmZzZXQpOworICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgICAgLyogQ2hlY2sgdGhlIHNhbml0eSBvZiB0aGlja25lc3MgYW5kIHBv c2l0aW9uLiAgV2Ugc2hvdWxkCisgICAgICAgICAgICAgICAgIGF2b2lkIGRyYXdpbmcgdW5kZXJs aW5lIG91dCBvZiB0aGUgY3VycmVudCBsaW5lIGFyZWEuICovCisgICAgICAgICAgICAgIGlmIChz LT55ICsgcy0+aGVpZ2h0IDw9IHMtPnliYXNlICsgcG9zaXRpb24pCisgICAgICAgICAgICAgICAg cG9zaXRpb24gPSAocy0+aGVpZ2h0IC0gMSkgLSAocy0+eWJhc2UgLSBzLT55KTsKKyAgICAgICAg ICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQgPCBzLT55YmFzZSArIHBvc2l0aW9uICsgdGhpY2tu ZXNzKQorICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IChzLT55ICsgcy0+aGVpZ2h0KSAtIChz LT55YmFzZSArIHBvc2l0aW9uKTsKKyAgICAgICAgICAgICAgcy0+dW5kZXJsaW5lX3RoaWNrbmVz cyA9IHRoaWNrbmVzczsKKyAgICAgICAgICAgICAgcy0+dW5kZXJsaW5lX3Bvc2l0aW9uID0gcG9z aXRpb247CisgICAgICAgICAgICAgIHkgPSBzLT55YmFzZSArIHBvc2l0aW9uOworICAgICAgICAg ICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgICAg IHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCB5LCBzLT53aWR0aCwgdGhpY2tu ZXNzKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICAgIFhHQ1ZhbHVlcyB4Z2N2OworICAgICAgICAgICAgICAgICAgWEdldEdDVmFsdWVzIChz LT5kaXNwbGF5LCBzLT5nYywgR0NGb3JlZ3JvdW5kLCAmeGdjdik7CisgICAgICAgICAgICAgICAg ICBYU2V0Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwgcy0+Z2MsIHMtPmZhY2UtPnVuZGVybGluZV9j b2xvcik7CisgICAgICAgICAgICAgICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChzLT5mLCBzLT5nYywg cy0+eCwgeSwgcy0+d2lkdGgsIHRoaWNrbmVzcyk7CisgICAgICAgICAgICAgICAgICBYU2V0Rm9y ZWdyb3VuZCAocy0+ZGlzcGxheSwgcy0+Z2MsIHhnY3YuZm9yZWdyb3VuZCk7CisgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAvKiBEcmF3IG92ZXJsaW5l LiAqLworICAgICAgaWYgKHMtPmZhY2UtPm92ZXJsaW5lX3ApCisgICAgICAgIHsKKyAgICAgICAg ICB1bnNpZ25lZCBsb25nIGR5ID0gMCwgaCA9IDE7CisgICAgICAgICAgaWYgKHMtPmZhY2UtPm92 ZXJsaW5lX2NvbG9yX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgeF9maWxsX3JlY3RhbmdsZSAo cy0+Ziwgcy0+Z2MsIHMtPngsIHMtPnkgKyBkeSwgcy0+d2lkdGgsIGgpOworICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgWEdDVmFsdWVzIHhnY3Y7CisgICAgICAg ICAgICAgIFhHZXRHQ1ZhbHVlcyAocy0+ZGlzcGxheSwgcy0+Z2MsIEdDRm9yZWdyb3VuZCwgJnhn Y3YpOworICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwgcy0+Z2MsIHMt PmZhY2UtPm92ZXJsaW5lX2NvbG9yKTsKKyAgICAgICAgICAgICAgeF9maWxsX3JlY3RhbmdsZSAo cy0+Ziwgcy0+Z2MsIHMtPngsIHMtPnkgKyBkeSwgcy0+d2lkdGgsIGgpOworICAgICAgICAgICAg ICBYU2V0Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwgcy0+Z2MsIHhnY3YuZm9yZWdyb3VuZCk7Cisg ICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIC8qIERyYXcgc3RyaWtlLXRocm91Z2guICov CisgICAgICBpZiAocy0+ZmFjZS0+c3RyaWtlX3Rocm91Z2hfcCkKKyAgICAgICAgeworICAgICAg ICAgIHVuc2lnbmVkIGxvbmcgaCA9IDE7CisgICAgICAgICAgdW5zaWduZWQgbG9uZyBkeSA9IChz LT5oZWlnaHQgLSBoKSAvIDI7CisgICAgICAgICAgaWYgKHMtPmZhY2UtPnN0cmlrZV90aHJvdWdo X2NvbG9yX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgeF9maWxsX3JlY3RhbmdsZSAocy0+Ziwg cy0+Z2MsIHMtPngsIHMtPnkgKyBkeSwgcy0+d2lkdGgsIGgpOworICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgWEdDVmFsdWVzIHhnY3Y7CisgICAgICAgICAgICAg IFhHZXRHQ1ZhbHVlcyAocy0+ZGlzcGxheSwgcy0+Z2MsIEdDRm9yZWdyb3VuZCwgJnhnY3YpOwor ICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwgcy0+Z2MsIHMtPmZhY2Ut PnN0cmlrZV90aHJvdWdoX2NvbG9yKTsKKyAgICAgICAgICAgICAgeF9maWxsX3JlY3RhbmdsZSAo cy0+Ziwgcy0+Z2MsIHMtPngsIHMtPnkgKyBkeSwgcy0+d2lkdGgsIGgpOworICAgICAgICAgICAg ICBYU2V0Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwgcy0+Z2MsIHhnY3YuZm9yZWdyb3VuZCk7Cisg ICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIC8qIERyYXcgcmVsaWVmIGlmIG5vdCB5ZXQg ZHJhd24uICovCisgICAgICBpZiAoIXJlbGllZl9kcmF3bl9wICYmIHMtPmZhY2UtPmJveCAhPSBG QUNFX05PX0JPWCkKKyAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JveCAocyk7CisgICAg ICBpZiAocy0+cHJldikKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBnbHlwaF9zdHJpbmcg KnByZXY7CisgICAgICAgICAgZm9yIChwcmV2ID0gcy0+cHJldjsgcHJldjsgcHJldiA9IHByZXYt PnByZXYpCisgICAgICAgICAgICBpZiAocHJldi0+aGwgIT0gcy0+aGwKKyAgICAgICAgICAgICAg ICAmJiBwcmV2LT54ICsgcHJldi0+d2lkdGggKyBwcmV2LT5yaWdodF9vdmVyaGFuZyA+IHMtPngp CisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBBcyBwcmV2IHdhcyBkcmF3biB3 aGlsZSBjbGlwcGVkIHRvIGl0cyBvd24gYXJlYSwgd2UKKyAgICAgICAgICAgICAgICAgICBtdXN0 IGRyYXcgdGhlIHJpZ2h0X292ZXJoYW5nIHBhcnQgdXNpbmcgcy0+aGwgbm93LiAqLworICAgICAg ICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBzYXZlID0gcHJldi0+aGw7CisgICAgICAg ICAgICAgICAgcHJldi0+aGwgPSBzLT5obDsKKyAgICAgICAgICAgICAgICBtY194X3NldF9nbHlw aF9zdHJpbmdfZ2MgKHByZXYsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICAgICAgICB4X3NldF9n bHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywgcHJldik7CisgICAgICAgICAgICAgICAg aWYgKHByZXYtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgpCisgICAgICAgICAgICAg ICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHByZXYpOworICAgICAgICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIHhfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5n X2ZvcmVncm91bmQgKHByZXYpOworICAgICAgICAgICAgICAgIHhfcmVzZXRfY2xpcF9yZWN0YW5n bGVzIChwcmV2LT5mLCBwcmV2LT5nYyk7CisgICAgICAgICAgICAgICAgcHJldi0+aGwgPSBzYXZl OworICAgICAgICAgICAgICAgIHByZXYtPm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgICAgIH0K KyAgICAgICAgfQorICAgICAgaWYgKHMtPm5leHQpCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1 Y3QgZ2x5cGhfc3RyaW5nICpuZXh0OworICAgICAgICAgIGZvciAobmV4dCA9IHMtPm5leHQ7IG5l eHQ7IG5leHQgPSBuZXh0LT5uZXh0KQorICAgICAgICAgICAgaWYgKG5leHQtPmhsICE9IHMtPmhs CisgICAgICAgICAgICAgICAgJiYgbmV4dC0+eCAtIG5leHQtPmxlZnRfb3ZlcmhhbmcgPCBzLT54 ICsgcy0+d2lkdGgpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBBcyBuZXh0 IHdpbGwgYmUgZHJhd24gd2hpbGUgY2xpcHBlZCB0byBpdHMgb3duIGFyZWEsCisgICAgICAgICAg ICAgICAgICAgd2UgbXVzdCBkcmF3IHRoZSBsZWZ0X292ZXJoYW5nIHBhcnQgdXNpbmcgcy0+aGwg bm93LiAqLworICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBzYXZlID0gbmV4 dC0+aGw7CisgICAgICAgICAgICAgICAgbmV4dC0+aGwgPSBzLT5obDsKKyAgICAgICAgICAgICAg ICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKG5leHQsIGN1cnNvcl9nY19wKTsKKyAgICAgICAg ICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywgbmV4dCk7Cisg ICAgICAgICAgICAgICAgaWYgKG5leHQtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgp CisgICAgICAgICAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5leHQp OworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIHhfZHJhd19jb21wb3Np dGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5leHQpOworICAgICAgICAgICAgICAgIHhfcmVz ZXRfY2xpcF9yZWN0YW5nbGVzIChuZXh0LT5mLCBuZXh0LT5nYyk7CisgICAgICAgICAgICAgICAg bmV4dC0+aGwgPSBzYXZlOworICAgICAgICAgICAgICAgIG5leHQtPm51bV9jbGlwcyA9IDA7Cisg ICAgICAgICAgICAgICAgbmV4dC0+Y2xpcF9oZWFkID0gcy0+bmV4dDsKKyAgICAgICAgICAgICAg fQorICAgICAgICB9CisgICAgfQorICAvKiBSZXNldCBjbGlwcGluZy4gKi8KKyAgeF9yZXNldF9j bGlwX3JlY3RhbmdsZXMgKHMtPmYsIHMtPmdjKTsKKyAgcy0+bnVtX2NsaXBzID0gMDsKK30KKwor LyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK IC8qIERlZmF1bHQgdG8gdXNpbmcgWElNIGlmIGF2YWlsYWJsZS4gICovCiAjaWZkZWYgVVNFX1hJ TQogYm9vbCB1c2VfeGltID0gdHJ1ZTsKQEAgLTk5OSw2ICsxODc4LDE1IEBAIHhfdXBkYXRlX2Jl Z2luIChzdHJ1Y3QgZnJhbWUgKmYpCiAgIGlmIChGUkFNRV9UT09MVElQX1AgKGYpICYmICFGUkFN RV9WSVNJQkxFX1AgKGYpKQogICAgIHJldHVybjsKIAorCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGluZ19mcmFtZSA9IGY7 CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgaWYgKCEgRlJBTUVfQ1JfU1VSRkFD RSAoZikpCiAgICAgewogICAgICAgaW50IHdpZHRoLCBoZWlnaHQ7CkBAIC0xMjY2LDYgKzIxNTQs MTYgQEAgeF91cGRhdGVfZW5kIChzdHJ1Y3QgZnJhbWUgKmYpCiAgIFhGbHVzaCAoRlJBTUVfWF9E SVNQTEFZIChmKSk7CiAgIHVuYmxvY2tfaW5wdXQgKCk7CiAjZW5kaWYKKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGlu Z19mcmFtZSA9IE5VTEw7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIH0KIAogLyog VGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgZnJvbSB2YXJpb3VzIHBsYWNlcyBpbiB4ZGlzcC5jCkBA IC0xMzEwMCw2ICsxMzk5OCwyMCBAQCB4X2FjdGl2YXRlX3RpbWVvdXRfYXRpbWVyICh2b2lkKQog CiBzdGF0aWMgc3RydWN0IHJlZGlzcGxheV9pbnRlcmZhY2UgeF9yZWRpc3BsYXlfaW50ZXJmYWNl ID0KICAgeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09S UyAqLworCisvKiBgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYHh0ZXJtLmNgIG11c3QgYmUgaW4g dGhlIGV4YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYGRp c3BleHRlcm4uaGAhICovCisKKyAgbWNfeF9kcmF3X3dpbmRvd19jdXJzb3IsCisgIG1jX3hfZHJh d19nbHlwaF9zdHJpbmcsCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICB4X2Zy YW1lX3Bhcm1faGFuZGxlcnMsCiAgICAgeF9wcm9kdWNlX2dseXBocywKICAgICB4X3dyaXRlX2ds eXBocywK --Multipart_Sat_Jun_29_22:42:10_2019-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs). References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Tue, 16 Jul 2019 19:29:02 +0000 Resent-Message-ID: <handler.22873.B22873.156330529318491 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22873 <at> debbugs.gnu.org,17684 <at> debbugs.gnu.org Cc: eliz@HIDDEN, johnw@HIDDEN, mbork@HIDDEN, rms@HIDDEN, akioburns@HIDDEN Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.156330529318491 (code B ref 22873); Tue, 16 Jul 2019 19:29:02 +0000 Received: (at 22873) by debbugs.gnu.org; 16 Jul 2019 19:28:13 +0000 Received: from localhost ([127.0.0.1]:51176 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1hnT7U-0004oA-4S for submit <at> debbugs.gnu.org; Tue, 16 Jul 2019 15:28:12 -0400 Received: from gateway30.websitewelcome.com ([192.185.144.21]:34832) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1hnT7R-0004nx-Ar for 22873 <at> debbugs.gnu.org; Tue, 16 Jul 2019 15:28:10 -0400 Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway30.websitewelcome.com (Postfix) with ESMTP id CF00C11AB7 for <22873 <at> debbugs.gnu.org>; Tue, 16 Jul 2019 14:28:08 -0500 (CDT) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id nT7PhKvOUiQernT7QhmQUb; Tue, 16 Jul 2019 14:28:08 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=ptBcZ3vpyVBKtKSpUFqv/7o7kIQjzo7rVnPwM2ynvfU=; b=XxubGpp95Pew2Ztlkgdl9OqsEw dAihHyB/AmaXpc5gPC+WgQJZbzYK0mZxWKXnJBOSXZHMoniIJ9fdLMbppioeJoGeR/DzN0BlOi+dm 9ZBt0GFfNeWyJyu8bA8Toqfv/aA3mnOcKN7mjTh0IwFNrfyE1OH0imIrRVi/eqqqtSh0DNcAv9hF4 nc4NmWSwv0uDB+Lh1/X8175GQB6Rp0Np9aKe8/X33BogEcjQS78Wm4slIMar8/IP5PhIktSjgsu4R VHkhhwjAA4a+ZkC3IgAy+MmqIFfIq8sqk4tTT12xW9x+eKufwAaTxwX7rCwfcWwXC3k/168KK+fxn cQBytj0w==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:51359 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from <esq@HIDDEN>) id 1hnT7L-001oGk-Vf; Tue, 16 Jul 2019 14:28:07 -0500 Date: Tue, 16 Jul 2019 12:28:02 -0700 Message-ID: <m2r26pkce5.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Tue_Jul_16_12:28:01_2019-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1hnT7L-001oGk-Vf X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:51359 X-Source-Auth: lawlist X-Email-Count: 7 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> --Multipart_Tue_Jul_16_12:28:01_2019-1 Content-Type: text/plain; charset=US-ASCII VERSION: 022.000 [07/14/2019] CHANGELOG: - Fast forward from 04/08/2019 to 07/14/2019; i.e., the attached patch applies to a recent version of the master branch as of 07/14/2019. Each GUI port has been lightly tested to verify features 17684/22873 work as expected. - Added a new member of the `mc_contents` struct to record the `row_position`, which is now used (in part) by `mc_update_window_erase' to determine whether an AT_ZV / POST_ZV fake cursor is the same as the previous loop -- disregarding lack of equality of the `*.bytepos` and `*.charpos` struct members. An example where this is helpful is when a user adds / removes characters from the buffer, but does not add / remove a row. - As to features 17684/22873, removed all calls to CHECK_BUFFER. None of the buffer lisp objects are coming from the user (outside of C), so a `BUFFERP' check of `w->contents` is sufficient. - Added screen recordings of features 17684/22873. - Miscellaneous tidying-up of code. VIDEOS: w32: https://youtu.be/r3BdJVlsAnQ ns: https://youtu.be/bc1h8jtbXmw x11: https://youtu.be/aCIFhD2Xz5s SCREENSHOTS: https://www.lawlist.com/images/22873_17684_light_dark_backgrounds.png SETUP: Step 1: git clone -b master git://git.sv.gnu.org/emacs.git Step 2: In the new emacs folder, go back to an Emacs version from 07/14/2019: git reset --hard ac57c5093829ee09084c562bbbc1c412179be13d Step 3: From within the new emacs folder created in Step 1, apply the patch: git apply /path/to/the/patch.diff Step 4: ./autogen.sh Step 5: ./configure ... [your custom options] Step 6: make Step 7: make install USAGE: - For a minimal working example of built-in fake cursors, type: M-x mc-test ;;; TURN ON FAKE CURSORS (buffer position, cursor-type, cursor color): (setq mc-conf '((1 "hbar" "magenta") (2 "bar" "purple") (3 "box" "#00FF00") (4 "hollow" "#0000FF") (5 ("hbar" 3) [1.0 0.0 1.0]) (6 ("bar" 3) [0.0 1.0 1.0]) (7 "framed" "OrangeRed")))) ;;; TURN OFF FAKE CURSORS: (setq mc-conf nil) - To try out both the crosshairs feature and the visible fill column indicator feature, type: M-x +-mode - To try out just the visible fill column indicator feature, type: M-x fc-mode - To try out built-in fake cursors with Magnar Sveen's multiple-cursors package, that package must be installed. If the multiple-cursors package is already installed, then just (require 'crosshairs) and `crosshairs.el` will redefine a few of the multiple-cursors functions and set up a few keyboard shortcuts. If the multiple-cursors package by Magnar Sveen is not already installed, then here are two easy ways to install that package: Type: M-x mc-install OR, evaluate the following snippet: (progn (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) (package-refresh-contents) (package-install 'multiple-cursors) (mc/built-in-cursors)) TODO: - When an idle-timer fires and point is at the end of a horizontally scrolled line in a narrow window, the temporary horizontal scroll is canceled. Create a minimal working example and file a bug report. (progn (defun test () (interactive) (let ((ov (make-overlay (point) (1+ (point)) nil t t))) (overlay-put ov 'face '(:foreground "red")))) (global-set-key [f5] 'test) (split-window-horizontally) (switch-to-buffer (get-buffer-create "foo")) (setq bidi-display-reordering nil) (setq-local auto-hscroll-mode 'current-line) (dotimes (i 80) (insert (char-to-string (+ 65 i))))) - `ns_draw_window_cursor' calls `ns_clip_to_rect', which does _not_ take `row->clip` into consideration when drawing cursors with `NSRectFill'. When it comes time to draw glyphs on top of the box/hollow family of cursors, `row->clip` is taken into consideration by `get_glyph_string_clip'. Fake cursors can be drawn even though the glyphs cannot, resulting in hollow/box family of cursors without text. The issue can be reproduced with M-x mc-test. [A temporary workaround is to disable `row->clip` while drawing the glyphs.] https://lists.gnu.org/archive/html/emacs-devel/2019-04/msg00009.html - Deal with left/right overwritten glyphs in the w32 and X ports of Emacs. - There is a bug affecting the recorded `w->mc.lnum_pixel_width` that is observable when not running under gdb, but disappears when running under gdb. While viewing a folded org-mode buffer, the non-gdb instance had a visible line number pixel-width of 44, but Emacs treated it as fluctuating between 44 and 55 as the cursor was moved to the end of line. In the gdb instance, the visible line number pixel width was 55 with no fluctuation under the same conditions as the non-gdb instance. This appears to be a different bug than bug#32177 (current line number shifts one column to the left) because the line number of the current line does not shift left, and changing the bidi settings did not correct the issue. - The current test for `auto_hscroll_mode_p' only looks for `current_line` and all five related tests are based upon that assumption, which may not be true. - Multiple Cursors: If point is in the middle of a composite character, then select a fully composed character so that the fake cursor is visible. - Implement functionality similar to the Lisp multiple-cursors by Magnar Sveen. - Follow up with the Emacs team re bug#32177; i.e., (Current line number shifts one column to the left.) - Follow up with the Emacs team re bug#32060; i.e., Horizontal Scrolling (Current Line): Wrong line gets h-scrolled. - Determine if bug #28936 needs to be fixed and help the Emacs team re same. - Is there any additional meaningful optimization that can be added to the three calls of `mc_pre_scroll_clean'? - There is a bug affecting an older version of Emacs for the NS port that causes partial line flickering when the same characters are grouped together (;;;;;;) and MC_GLYPHLESS cursors are above or below -- having the same background color as the frame; e.g., black on black (used to erase a glyphless cursor). The partial flickering is only noticeable with rapid fire; e.g., holding down the right/left arrow key. When changing the color of the glyphless cursor, the issue is not present. [@lawlist has verified that the X and HPOS coordinates are accurate.] - NOTE: As to `mc_scrolling_window', it would appear that there is no tangible benefit to rotating the current/prospective cache of fake cursors to compare the data before removing the fake cursors. When scrolling the display, only _some_ lines are copied to new locations. Areas that are not overwritten may have fake cursors and those may not necessarily be removed if desired/current matrix glyphs are equal. The test for `GLYPH_EQUAL_P' does not take into consideration the existence of a fake cursor, and the glyph (with a fake cursor) may not be updated as a result thereof. As to lines that are not copied, portions may be updated and fake cursors would be removed thereby. --Multipart_Tue_Jul_16_12:28:01_2019-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="2019_07_16__12_05_58_696.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvY3Jvc3NoYWlycy5lbCBiL2xpc3AvY3Jvc3NoYWlycy5lbApuZXcg ZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi43ODI3NTJmCi0tLSAvZGV2L251bGwKKysr IGIvbGlzcC9jcm9zc2hhaXJzLmVsCkBAIC0wLDAgKzEsMTI4OCBAQAorOzs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Cis7OzsgQkVHSU4gbW9kaWZpY2F0aW9uIG9mIHRoZSBNdWx0aXBsZSBDdXJzb3Jz IGxpYnJhcnkgd3JpdHRlbiBieSAgTWFnbmFyIFN2ZWVuLgorCisoZGVmdmFyIHBhY2thZ2UtYXJj aGl2ZXMpCisKKyhkZWZ2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3MgbWMtLW1heC1jdXJzb3JzLW9yaWdpbmFsCisgICAgICAo c2V0cSBtYy0tbWF4LWN1cnNvcnMtb3JpZ2luYWwgbWMvbWF4LWN1cnNvcnMpKQorICAgICh3aGVu IG1jL21heC1jdXJzb3JzCisgICAgICAodW5sZXNzICg8IChtYy9udW0tY3Vyc29ycykgbWMvbWF4 LWN1cnNvcnMpCisgICAgICAgIChpZiAoeWVzLW9yLW5vLXAgKGZvcm1hdCAiJWQgYWN0aXZlIGN1 cnNvcnMuIENvbnRpbnVlPyAiIChtYy9udW0tY3Vyc29ycykpKQorICAgICAgICAgICAgKHNldHEg bWMvbWF4LWN1cnNvcnMgKHJlYWQtbnVtYmVyICJFbnRlciBhIG5ldywgdGVtcG9yYXJ5IG1heGlt dW06ICIpKQorICAgICAgICAgIChtYy9yZW1vdmUtZmFrZS1jdXJzb3JzKQorICAgICAgICAgIChl cnJvciAiQWJvcnRlZDogdG9vIG1hbnkgY3Vyc29ycyIpKSkpCisgICAgKGxldCAoKG92ZXJsYXkK KyAgICAgICAgICAgIChpZiBtYy91c2UtYnVpbHQtaW4tY3Vyc29ycworICAgICAgICAgICAgICAo bWFrZS1vdmVybGF5IChwb2ludCkgKHBvaW50KSkKKyAgICAgICAgICAgICAgKG1jL21ha2UtY3Vy c29yLW92ZXJsYXktYXQtcG9pbnQpKSkpCisgICAgICAob3ZlcmxheS1wdXQgb3ZlcmxheSAnbWMt aWQgKG9yIGlkIChtYy9jcmVhdGUtY3Vyc29yLWlkKSkpCisgICAgICAob3ZlcmxheS1wdXQgb3Zl cmxheSAndHlwZSAnZmFrZS1jdXJzb3IpCisgICAgICAob3ZlcmxheS1wdXQgb3ZlcmxheSAncHJp b3JpdHkgMTAwKQorICAgICAgKG1jL3N0b3JlLWN1cnJlbnQtc3RhdGUtaW4tb3ZlcmxheSBvdmVy bGF5KQorICAgICAgKHdoZW4gKHVzZS1yZWdpb24tcCkKKyAgICAgICAgKG92ZXJsYXktcHV0IG92 ZXJsYXk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gbWFrZSB0aGUgY29tbWFu ZCBjb21wYXJhYmxlIGJ5IGBlcScuCisgICAgICAgICAgICAgICAgKHNldHEgb3JpZ2luYWwtY29t bWFuZCAoaW50ZXJuIChzeW1ib2wtbmFtZSBvcmlnaW5hbC1jb21tYW5kKSkpCisgICAgICAgICAg ICAgICAgOzsgb3RoZXJ3aXNlIGl0J3MgYSBzeW1ib2wsIGFuZCB3ZSBjYW4gYmUgbW9yZSB0aG9y b3VnaAorICAgICAgICAgICAgICAgIChpZiAoZ2V0IG9yaWdpbmFsLWNvbW1hbmQgJ21jLS11bnN1 cHBvcnRlZCkKKyAgICAgICAgICAgICAgICAgICAgKG1lc3NhZ2UgIiVTIGlzIG5vdCBzdXBwb3J0 ZWQgd2l0aCBtdWx0aXBsZSBjdXJzb3JzJXMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg IG9yaWdpbmFsLWNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdldCBvcmln aW5hbC1jb21tYW5kICdtYy0tdW5zdXBwb3J0ZWQpKQorICAgICAgICAgICAgICAgICAgKHdoZW4g KGFuZCBvcmlnaW5hbC1jb21tYW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChub3Qg KG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy0tZGVmYXVsdC1jbWRzLXRvLXJ1bi1vbmNlKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKG5vdCAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1j L2NtZHMtdG8tcnVuLW9uY2UpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAob3IgbWMv YWx3YXlzLXJ1bi1mb3ItYWxsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVt cSBvcmlnaW5hbC1jb21tYW5kIG1jLS1kZWZhdWx0LWNtZHMtdG8tcnVuLWZvci1hbGwpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jL2Nt ZHMtdG8tcnVuLWZvci1hbGwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWMv cHJvbXB0LWZvci1pbmNsdXNpb24taW4td2hpdGVsaXN0IG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAg ICAgICAgICAgICAgICAgICAgKG1jL2V4ZWN1dGUtY29tbWFuZC1mb3ItYWxsLWZha2UtY3Vyc29y cyBvcmlnaW5hbC1jb21tYW5kKSkpKQorICAgICAgICAgICAgICAod2hlbiBtYy91c2UtYnVpbHQt aW4tY3Vyc29ycworICAgICAgICAgICAgICAgIChzZXRxIG1jLWNvbmYKKyAgICAgICAgICAgICAg ICAgICAgICAgIChtYXBjYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKGxhbWJkYSAoeCkg KGxpc3QgKG92ZXJsYXktc3RhcnQgeCkgImJhciIgbmlsKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgKG1jL2FsbC1mYWtlLWN1cnNvcnMpKSkpKSkpKSkpCisKKyAgKGRlZnVuIG1jL21hcmst bmV4dC1saWtlLXRoaXMtY3ljbGUtZm9yd2FyZCAoKQorICAiTWFya3MgbmV4dCBvY2N1cmVuY2Ug b2Ygd29yZCBsaWtlIHRoaXMgYW5kIGFkdmFuY2VzIGN1cnNvciB0byB0aGlzIG9jY3VycmVuY2Ui CisgIChpbnRlcmFjdGl2ZSkKKyAgICAobWMvbWFyay1uZXh0LWxpa2UtdGhpcyAxKSkKKworICAo ZGVmdW4gbWMvbWFyay1wcmV2aW91cy1saWtlLXRoaXMtY3ljbGUtZm9yd2FyZCAoKQorICAiTWFy a3MgbmV4dCBvY2N1cnJlbmNlIG9mIHdvcmQgbGlrZSB0aGlzIGFuZCBhZHZhbmNlcyBjdXJzb3Ig dG8gdGhpcyBvY2N1cnJlbmNlIgorICAoaW50ZXJhY3RpdmUpCisgICAgKG1jL21hcmstcHJldmlv dXMtbGlrZS10aGlzIDEpKQorCisg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JyB1c2VzIGBOU0NvbG9yJywgd2hpY2ggd29ya3Mgd2VsbCB3aXRoIExTTC4g IGB3MzJ0ZXJtLmMnIHVzZXMKK2BQQUxFVFRFUkdCJyBvciBgUkdCJywgYW5kIHRoZSBjb252ZXJz aW9uIGZyb20gTFNMIGlzIGRvbmUgaW50ZXJuYWxseSBieQorbXVsdGlwbHlpbmcgZWFjaCBlbGVt ZW50IG9mIHRoZSBMU0wgY29sb3IgdmVjdG9yIGJ5IDI1NS4gIGB4dGVybS5jJyB1c2VzCitgeF9t YWtlX3RydWVjb2xvcl9waXhlbCcsIHdoaWNoIHVzZXMgMTYtYml0IFJHQiAtLSB0aGUgY29udmVy c2lvbiBmcm9tIExTTAoraGFwcGVucyBpbnRlcm5hbGx5IGJ5IG11bHRpcGx5aW5nIGVhY2ggZWxl bWVudCBvZiB0aGUgTFNMIGNvbG9yIHZlY3RvciBieSA2NTUzNS4iCisoaW50ZXJhY3RpdmUpCisg IChsZXQgKChidWZmZXIgKGdldC1idWZmZXItY3JlYXRlICIqTUMtVEVTVCoiKSkpCisgICAgKHdp dGgtY3VycmVudC1idWZmZXIgYnVmZmVyCisgICAgICAoZXJhc2UtYnVmZmVyKQorICAgICAgKGlu c2VydCAiVGhpcyBpcyBhIHRlc3QhIikKKyAgICAgIChzZXRxIG1jLWNvbmYgJygoMSAiaGJhciIg Im1hZ2VudGEiKQorICAgICAgICAgICAgICAgICAgICAgICgyICJiYXIiICJwdXJwbGUiKQorICAg ICAgICAgICAgICAgICAgICAgICgzICJib3giICIjMDBGRjAwIikKKyAgICAgICAgICAgICAgICAg ICAgICAoNCAiaG9sbG93IiAiIzAwMDBGRiIpCisgICAgICAgICAgICAgICAgICAgICAgKDUgKCJo YmFyIiAzKSBbMS4wIDAuMCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg2ICgiYmFyIiAz KSBbMC4wIDEuMCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg3ICJmcmFtZWQiICJPcmFu Z2VSZWQiKQorICAgICAgICAgICAgICAgICAgICAgICg4ICJib3giICJncmV5MjUiKQorICAgICAg ICAgICAgICAgICAgICAgICg5ICJib3giICJncmV5NzUiKSkpKQorICAgIChzZWxlY3Qtd2luZG93 IChkaXNwbGF5LWJ1ZmZlciBidWZmZXIpKSkpCisKKyhkZWZ1biArLXRpbWVyLWZuICgpCisiU2lu Y2UgdGhpcyBmaXJlcyBnbG9iYWxseSwgd2UgbXVzdCBjb250cm9sIHdoaWNoIGJ1ZmZlcnMgY3Jv c3NoYWlycyBhcHBlYXIgaW4uIgorICAod2hlbiArLW1vZGUKKyAgICAodW5sZXNzIChvciAobWVt cSBsYXN0LWNvbW1hbmQgKy1wYXJlbnMtZXhjbHVzaW9ucykKKyAgICAgICAgICAgICAgICAobnVs bCArLXBhcmVucy1wKSkKKyAgICAgICgrLXBhcmVucy1mbikpCisgICAgKHdoZW4gKy10aW1lci12 YXIKKyAgICAgIChzZXRxIHRpbWVyLWlkbGUtbGlzdCAoZGVscSArLXRpbWVyLXZhciB0aW1lci1p ZGxlLWxpc3QpKQorICAgICAgKHNldHEgKy10aW1lci12YXIgbmlsKSkpKQorCisoZGVmdW4gKy1k cmF3LWZvcnRod2l0aCAoKQorIkltbWVkaWF0ZWx5IGRlbGV0ZS9kcmF3IG1hdGNoaW5nIHBhcmVu dGhlc2VzLiIKKyAgKCstZHJhdy1jcm9zc2hhaXJzICdmb3JjZSkpCisKKyhkZWZ1biArLWRyYXct Y3Jvc3NoYWlycyAoJm9wdGlvbmFsIGZvcmNlKQorIkltbWVkaWF0ZWx5IGRlbGV0ZSBtYXRjaGlu ZyBwYXJlbnRoZXNlcy4gIElmIEZPUkNFIGlzIG5vbi1uaWwsIHRoZW4gaW1tZWRpYXRlbHkKK2Ry YXcgbWF0Y2hpbmcgcGFyZW50aGVzaXM7IG90aGVyd2lzZSwgZHJhdyB0aGVtIG9uIGFuIGlkbGUt dGllci4iCisgICh3aGVuICstbW9kZQorICAgICh3aGVuICstdGltZXItdmFyCisgICAgICAoc2V0 cSB0aW1lci1pZGxlLWxpc3QgKGRlbHEgKy10aW1lci12YXIgdGltZXItaWRsZS1saXN0KSkKKyAg ICAgIChzZXRxICstdGltZXItdmFyIG5pbCkpCisgICAgKHVubGVzcyAob3IgKG1lbXEgdGhpcy1j b21tYW5kICstcGFyZW5zLWV4Y2x1c2lvbnMpCisgICAgICAgICAgICAgICAgKGFuZCAobnVsbCAr LXBhcmVucy1wKQorICAgICAgICAgICAgICAgICAgICAgKG51bGwgKy1wYXJlbnMtb3ZlcmxheXMt ZXhpc3QtcCkpKQorICAgICAgKCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykpCisgICAgKGlmIGZv cmNlCisgICAgICAocHJvZ24KKyAgICAgICAgKHdoZW4gKy1wYXJlbnMtcAorICAgICAgICAgICgr LXBhcmVucy1mbikpKQorICAgICAgKHNldHEgKy10aW1lci12YXIgKHJ1bi13aXRoLWlkbGUtdGlt ZXIgKy1pZGxlLXRpbWVyLXNlY29uZHMgbmlsICMnKy10aW1lci1mbikpKSkpCisKKyhkZWZ2YXIg ZmMtbW9kZSkKKworOzs7IyMjYXV0b2xvYWQKKyhkZWZpbmUtbWlub3ItbW9kZSArLW1vZGUKKyJN aW5vciBtb2RlIGZvciBkaXNwbGF5aW5nIGEgaG9yaXpvbnRhbCBydWxlci4iCisgIDppbml0LXZh bHVlIG5pbAorICA6bGlnaHRlciAiICsiCisgIDprZXltYXAgbmlsCisgIDpnbG9iYWwgbmlsCisg IDpncm91cCAnKy1tb2RlCisgIChjb25kCisgICAgKCstbW9kZQorICAgICAgOzs7IGArLW1vZGUn IGhhcyB0aGUgYWJpbGl0eSB0byBhbHNvIGRpc3BsYXkgYSBmaWxsIGNvbHVtbiBpbmRpY2F0b3Iu CisgICAgICA7OzsgU2VlIHRoZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicuCisgICAgICAod2hl biBmYy1tb2RlCisgICAgICAgIChmYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgZ2xvYmFs LWVsZG9jLW1vZGUKKyAgICAgICAgICAgICAgICAgKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAgJ2Fu eSkKKyAgICAgICAgICAgICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAg ICAgICAgKGdsb2JhbC1lbGRvYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgaml0LWxvY2st Y29udGV4dC10aW1lcgorICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAn YW55KQorICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQor ICAgICAgICAod2hlbiAodGltZXJwIGppdC1sb2NrLWNvbnRleHQtdGltZXIpCisgICAgICAgICAg KGNhbmNlbC10aW1lciBqaXQtbG9jay1jb250ZXh0LXRpbWVyKSkKKyAgICAgICAgOzsgKHNldHEg aml0LWxvY2stY29udGV4dC10aW1lciAocnVuLXdpdGgtaWRsZS10aW1lciA1LjAgJ3JlcGVhdCAn aml0LWxvY2stY29udGV4dC1mb250aWZ5KSkKKyAgICAgICAgKHNldHEgaml0LWxvY2stY29udGV4 dC10aW1lciBuaWwpKQorICAgICAgKHdoZW4gKGFuZCAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAn YW55KQorICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQor ICAgICAgICAod2hlbiAodGltZXJwIHVuZG8tYXV0by1jdXJyZW50LWJvdW5kYXJ5LXRpbWVyKQor ICAgICAgICAgIChjYW5jZWwtdGltZXIgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIp KQorICAgICAgICAoZnNldCAndW5kby1hdXRvLS11bmRvYWJsZS1jaGFuZ2UKKyAgICAgICAgICAg ICAgKGxhbWJkYSAoKSAoYWRkLXRvLWxpc3QgJ3VuZG8tYXV0by0tdW5kb2F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GRvd24gdW5sZXNzIGBiaWRpLWRpc3BsYXktcmVvcmRlcmluZycgaXMgc2V0 IHRvIGEgbmlsIHZhbHVlLgorICAgICAgOzs7IEhvd2V2ZXIsIG1vc3QgdXNlcnMgd2lsbCBwcm9i YWJseSBub3Qgd2FudCB0aGlzIHBhcnRpY3VsYXIgc2V0dGluZy4KKyAgICAgICh1bmxlc3MgKG51 bGwgYmlkaS1kaXNwbGF5LXJlb3JkZXJpbmcpCisgICAgICAgIChzZXRxIGJpZGktZGlzcGxheS1y ZW9yZGVyaW5nIG5pbCkpCisgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICcrLS1zYXZl ZC1zdGF0ZSkgbmlsKQorICAgICAgKGRvbGlzdCAodmFyICcoYnVmZmVyLWRpc3BsYXktdGFibGUK KyAgICAgICAgICAgICAgICAgICAgIGZyaW5nZS1pbmRpY2F0b3ItYWxpc3QKKyAgICAgICAgICAg ICAgICAgICAgIHRhYi13aWR0aAorICAgICAgICAgICAgICAgICAgICAgbGluZS1tb3ZlLXZpc3Vh bAorICAgICAgICAgICAgICAgICAgICAgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgICAgICAgICAg ICAgIHRydW5jYXRlLXBhcnRpYWwtd2lkdGgtd2luZG93cworICAgICAgICAgICAgICAgICAgICAg d29yZC13cmFwKSkKKyAgICAgICAgKHdoZW4gKGxvY2FsLXZhcmlhYmxlLXAgdmFyKQorICAgICAg ICAgIChwdXNoIChjb25zIHZhciAoc3ltYm9sLXZhbHVlIHZhcikpICstLXNhdmVkLXN0YXRlKSkp CisgICAgICAoc2V0cSBmaWxsLWNvbHVtbiA4MCkKKyAgICAgIChzZXRxIGRpc3BsYXktbGluZS1u dW1iZXJzIHQpCisgICAgICAoc2V0cS1sb2NhbCBhdXRvLWhzY3JvbGwtbW9kZSAnY3VycmVudC1s aW5lKQorICAgICAgKHNldHEtbG9jYWwgaHNjcm9sbC1zdGVwIDUpCisgICAgICAoc2V0cSBidWZm ZXItZGlzcGxheS10YWJsZSArLWJ1ZmZlci1kaXNwbGF5LXRhYmxlKQorICAgICAgKHNldHEgdGFi LXdpZHRoIDQpCisgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICdsaW5lLW1vdmUtdmlz dWFsKSB0KQorICAgICAgKHNldHEgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgKGNvbmQKKyAgICAg ICAgICAoKGxldCAoKGxzdCArLXRydW5jYXRlLWxpbmVzLWRlcml2ZWQtbW9kZXMpCisgICAgICAg ICAgICAgICAgICBtb2RlKQorICAgICAgICAgICAgKGNhdGNoICdmb3VuZAorICAgICAgICAgICAg ICAod2hpbGUgKHNldHEgbW9kZSAocG9wIGxzdCkpCisgICAgICAgICAgICAgICAgKHdoZW4gKGRl cml2ZWQtbW9kZS1wIG1vZGUpCisgICAgICAgICAgICAgICAgICAodGhyb3cgJ2ZvdW5kIHQpKSkp KSkKKyAgICAgICAgICAgKChtZW1xIG1ham9yLW1vZGUgKy10cnVuY2F0ZS1saW5lcy1tYWpvci1t b2RlcykpCisgICAgICAgICAgICh0CisgICAgICAgICAgICAgbmlsKSkpCisgICAgICAoc2V0ICht YWtlLWxvY2FsLXZhcmlhYmxlICd0cnVuY2F0ZS1wYXJ0aWFsLXdpZHRoLXdpbmRvd3MpIG5pbCkK KyAgICAgIChzZXRxIHdvcmQtd3JhcCB0KQorICAgICAgKHNldHEgaW5kaWNhdGUtZW1wdHktbGlu ZXMgdCkKKyAgICAgIChzZXRxIGluZGljYXRlLWJ1ZmZlci1ib3VuZGFyaWVzICdsZWZ0KQorICAg ICAgKHNldHEgZnJpbmdlLWluZGljYXRvci1hbGlzdAorICAgICAgICAgIDs7OyBoc2NsX2FsbF90 ZW1wX3AgfCBoc2NsX3RlbXBfcAorICAgICAgICAnKCgrLWhzY2wtdGVtcCAuICgrLXNpbmdsZS1h bmdsZS1sZWZ0CisgICAgICAgICAgICAgICAgICAgICAgICAgICstZG91YmxlLWFuZ2xlLWxlZnQp KQorICAgICAgICAgIDs7OyBoc2NsX2FsbF9wZXJtXzBfcCB8IGhzY2xfYWxsX3Blcm1fMV9wIHwg aHNjbF9hbGxfcGVybV8yX3AgfCBoc2NsX3Blcm1fcAorICAgICAgICAgICgrLWhzY2wtcGVybSAu ICgrLXNpbmdsZS1hbmdsZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLWRvdWJsZS1h bmdsZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLXRyaXBsZS1hbmdsZS11cAorICAg ICAgICAgICAgICAgICAgICAgICAgICArLXF1YWRydXBsZS1hbmdsZS11cCkpCisgICAgICAgICAg KCstb3ZlcmxheS1hcnJvdyAuICgrLWZyaW5nZS1sZWZ0LWFycm93CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICArLWZyaW5nZS1yaWdodC1hcnJvdykpCisgICAgICAgICAgKHRydW5jYXRp b24gLiAoKy1mcmluZ2UtbGVmdC1hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICstZnJp bmdlLXJpZ2h0LWFycm93KSkKKyAgICAgICAgICAoY29udGludWF0aW9uIC4gKCstZnJpbmdlLWxl ZnQtY3VybHktYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICstYmFja3NsYXNoKSkK KyAgICAgICAgICAob3ZlcmxheS1hcnJvdyAuICstZnJpbmdlLXJpZ2h0LXRyaWFuZ2xlKQorICAg ICAgICAgICh1cCAuICstZnJpbmdlLXVwLWFycm93KQorICAgICAgICAgIChkb3duIC4gKy1mcmlu Z2UtZG93bi1hcnJvdykKKyAgICAgICAgICAodG9wIC4gKy1mcmluZ2UtdG9wLWxlZnQtYW5nbGUp CisgICAgICAgICAgKGJvdHRvbSAuICstZnJpbmdlLWJvdHRvbS1yaWdodC1hbmdsZSkKKyAgICAg ICAgICAodG9wLWJvdHRvbSAuICgrLWZyaW5nZS1sZWZ0LWJyYWNrZXQKKyAgICAgICAgICAgICAg ICAgICAgICAgICArLWZyaW5nZS1yaWdodC1icmFja2V0CisgICAgICAgICAgICAgICAgICAgICAg ICAgKy1mcmluZ2UtdG9wLXJpZ2h0LWFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgKy1m cmluZ2UtdG9wLWxlZnQtYW5nbGUpKQorICAgICAgICAgIChlbXB0eS1saW5lIC4gKy1mcmluZ2Ut ZW1wdHktbGluZSkKKyAgICAgICAgICAodW5rbm93biAuICstZnJpbmdlLXF1ZXN0aW9uLW1hcmsp KSkKKyAgICAgIChzZXRxIGZyaW5nZS1jdXJzb3ItYWxpc3QgJygoYm94IC4gKy1mcmluZ2UtbGVm dC10cmlhbmdsZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaG9sbG93IC4g Ky1ob2xsb3ctcmVjdGFuZ2xlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChi YXIgLiArLXZlcnRpY2FsLWJhcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo aGJhciAuICstZnJpbmdlLWhvcml6b250YWwtYmFyKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIChob2xsb3ctc21hbGwgLiArLWZyaW5nZS1ob2xsb3ctc3F1YXJlKSkpCisgICAg ICAoaWYgKG9yICstZm9ydGh3aXRoCisgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZp eC1hcmcgJyg0KSkpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJh dy1mb3J0aHdpdGggJ2FwcGVuZCAnbG9jYWwpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21t YW5kLWhvb2sgJystZHJhdy1jcm9zc2hhaXJzICdhcHBlbmQgJ2xvY2FsKSkKKyAgICAgICh3aGVu ICstZm9ydGh3aXRoCisgICAgICAgIChhZGQtaG9vayAnd2luZG93LWNvbmZpZ3VyYXRpb24tY2hh bmdlLWhvb2sgJystZHJhdy1mb3J0aHdpdGggbmlsICdsb2NhbCkpCisgICAgICAoYWRkLWhvb2sg J2NoYW5nZS1tYWpvci1tb2RlLWhvb2sgJ3R1cm4tb2ZmLSstbW9kZSBuaWwgJ2xvY2FsKQorICAg ICAgOzs7IE1hdGNoaW5nIHBhcmVudGhlc2VzIGRyYXdpbmcgZm9ydGh3aXRoIGludGVyZmVyZXMg d2l0aCB5YXNuaXBwZXQuCisgICAgICAod2hlbiArLWZvcnRod2l0aAorICAgICAgICAoc2V0cSAr LXBhcmVucy1wIG5pbCkpCisgICAgICAod2hlbiAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55 KQorICAgICAgICAoY29uZAorICAgICAgICAgICgrLWZvcnRod2l0aAorICAgICAgICAgICAgKG1l c3NhZ2UgIlR1cm5lZCBPTiBgKy1tb2RlJyAtLSBEcmF3IG1hdGNoaW5nIHBhcmVudGhlc2VzIGlt bWVkaWF0ZWx5LiIpKQorICAgICAgICAgICgoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkp CisgICAgICAgICAgICA7OzsgTWF0Y2hpbmcgcGFyZW50aGVzZXMgd2lsbCBiZSBkcmF3biBpbW1l ZGlhdGVseS4KKyAgICAgICAgICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScgLS0gT3B0 aW1pemVkIGZvciBkZWJ1Z2dpbmcgcHVycG9zZXMuIikpCisgICAgICAgICAgKHQKKyAgICAgICAg ICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScuIikpKSkpCisgICAgKHQKKyAgICAgIChr aWxsLWxvY2FsLXZhcmlhYmxlICdmaWxsLWNvbHVtbikKKyAgICAgIChraWxsLWxvY2FsLXZhcmlh YmxlICdhdXRvLWhzY3JvbGwtbW9kZSkKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdoc2Ny b2xsLXN0ZXApCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnY3Jvc3NoYWlycykKKyAgICAg IChraWxsLWxvY2FsLXZhcmlhYmxlIC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ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7CisKKyhkZWZ1biArLXBhcmVucy1mbiAoKQorICAiRG9jLXN0cmluZy4iCisgIChsZXQqICgo b3BvaW50IChwb2ludCkpCisgICAgICAgICAoZnJvbSAoaWYgKy1wYXJlbnMtZnJvbS1mbgorICAg ICAgICAgICAgICAgICAoZnVuY2FsbCArLXBhcmVucy1mcm9tLWZuKQorICAgICAgICAgICAgICAg ICAocG9pbnQtbWluKSkpCisgICAgICAgICAod2luIChzZWxlY3RlZC13aW5kb3cpKQorICAgICAg ICAgKGkgMCkKKyAgICAgICAgIChwcmVjZWRpbmctY2hhciAocHJlY2VkaW5nLWNoYXIpKQorICAg ICAgICAgKG9jaGFyIChjaGFyLWFmdGVyIG9wb2ludCkpCisgICAgICAgICAocG9zMQorICAgICAg ICAgICAoY29uZAorICAgICAgICAgICAgICgoYW5kIG9jaGFyCisgICAgICAgICAgICAgICAgICAg KG9yIDs7OyAoY2hhci10by1zdHJpbmcgNDApID0+IG9wZW5pbmcgcGFyZW50aGVzaXMKKyAgICAg ICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgNDApCisgICAgICAgICAgICAgICAgICAgICAgIDs7 OyAoY2hhci10by1zdHJpbmcgOTEpID0+IG9wZW5pbmcgc3F1YXJlIGJyYWNrZXQKKyAgICAgICAg ICAgICAgICAgICAgICAgKD0gb2NoYXIgOTEpCisgICAgICAgICAgICAgICAgICAgICAgIDs7OyAo Y2hhci10by1zdHJpbmcgMTIzKSA9PiBvcGVuaW5nIHdhdnkgYnJhY2tldAorICAgICAgICAgICAg ICAgICAgICAgICAoPSBvY2hhciAxMjMpKSkKKyAgICAgICAgICAgICAgICAobWluICgxKyBvcG9p bnQpIChwb2ludC1tYXgpKSkKKyAgICAgICAgICAgICAoKG9yIDs7OyAoY2hhci10by1zdHJpbmcg NDEpID0+IGNsb3NpbmcgcGFyZW50aGVzaXMKKyAgICAgICAgICAgICAgICAgICg9IHByZWNlZGlu Zy1jaGFyIDQxKQorICAgICAgICAgICAgICAgICAgOzs7IChjaGFyLXRvLXN0cmluZyA5MykgPT4g Y2xvc2luZyBzcXVhcmUgYnJhY2tldAorICAgICAgICAgICAgICAgICAgKD0gcHJlY2VkaW5nLWNo YXIgOTMpCisgICAgICAgICAgICAgICAgICA7OzsgKGNoYXItdG8tc3RyaW5nIDEyNSkgPT4gY2xv c2luZyB3YXZ5IGJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICg9IHByZWNlZGluZy1jaGFyIDEy NSkpCisgICAgICAgICAgICAgICAgKG1heCAocG9pbnQtbWluKSAoMS0gb3BvaW50KSkpCisgICAg ICAgICAgICAgKHQKKyAgICAgICAgICAgICAgICBvcG9pbnQpKSkKKyAgICAgICAgIHBvczIKKyAg ICAgICAgIHNlbGVjdGVkLWZhY2UpCisgICAgKHNhdmUtZXhjdXJzaW9uCisgICAgICAoY29uZGl0 aW9uLWNhc2UgbmlsCisgICAgICAgICh3aGlsZSAoc2V0cSBwb3MxIChudGggMSAocGFyc2UtcGFy dGlhbC1zZXhwIGZyb20gcG9zMSkpKQorICAgICAgICAgIChzZXRxIHBvczIgKHNjYW4tc2V4cHMg cG9zMSAxKSkKKyAgICAgICAgICAoaWYgKD0gaSAxMCkKKyAgICAgICAgICAgIChzZXRxIGkgMSkK KyAgICAgICAgICAgIChzZXRxIGkgKDErIGkpKSkKKyAgICAgICAgICAoc2V0cSBzZWxlY3RlZC1m YWNlIChjb25kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDEpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLW9uZS1mYWNlKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSAyKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICcrLXBhcmVucy10d28tZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKCg9IGkgMykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1w YXJlbnMtdGhyZWUtZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkg NCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtZm91ci1mYWNl KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA1KQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1maXZlLWZhY2UpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICgoPSBpIDYpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJystcGFyZW5zLXNpeC1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAoKD0gaSA3KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1z ZXZlbi1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA4KQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1laWdodC1mYWNlKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA5KQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICcrLXBhcmVucy1uaW5lLWZhY2UpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICgoPSBpIDEwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICcrLXBhcmVucy10ZW4tZmFjZSkpKQorICAgICAgICAgIChsZXQgKChvdiAobWFrZS1vdmVybGF5 IHBvczEgKDErIHBvczEpKSkpCisgICAgICAgICAgICAodW5sZXNzICstcGFyZW5zLWluYWN0aXZl LXdpbmRvd3MKKyAgICAgICAgICAgICAgKG92ZXJsYXktcHV0IG92ICd3aW5kb3cgd2luKSkKKyAg ICAgICAgICAgIChvdmVybGF5LXB1dCBvdiAnZmFjZSBzZWxlY3RlZC1mYWNlKSkKKyAgICAgICAg ICAod2hlbiBwb3MyCisgICAgICAgICAgICAobGV0ICgob3YgKG1ha2Utb3ZlcmxheSAoMS0gcG9z MikgcG9zMikpKQorICAgICAgICAgICAgICAodW5sZXNzICstcGFyZW5zLWluYWN0aXZlLXdpbmRv d3MKKyAgICAgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ3dpbmRvdyB3aW4pKQorICAgICAg ICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ2ZhY2Ugc2VsZWN0ZWQtZmFjZSkpKSkKKyAgICAgICAg KGVycm9yIG5pbCkpKQorICAgIChzZXRxICstcGFyZW5zLW92ZXJsYXlzLWV4aXN0LXAgdCkpKQor CisoZGVmdW4gKy1yZW1vdmUtb3ZlcmxheXMgKGJlZyBlbmQgbmFtZSB2YWwpCisiUmVtb3ZlIHRo ZSBvdmVybGF5cyB0aGF0IGFyZSBgZXF1YWwtaW5jbHVkaW5nLXByb3BlcnRpZXNgLgorSW5jbHVk ZXMgYSB1bmlxdWUgc2l0dWF0aW9uIHdoZW4gYW4gb3ZlcmxheSB3aXRoIGFuIGAnYWZ0ZXItc3Ry aW5nYCBwcm9wZXJ0eQoraXMgYXQgdGhlIHZlcnkgZW5kIG9mIGEgbmFycm93ZWQtYnVmZmVyLiIK KyAgKGxldCogKChwb2ludC1tYXggKHBvaW50LW1heCkpCisgICAgICAgICAocG9pbnQtbWluIChw b2ludC1taW4pKQorICAgICAgICAgKG5hcnJvd2VkLXAgKGJ1ZmZlci1uYXJyb3dlZC1wKSkKKyAg ICAgICAgIChiZWcgKGlmIGJlZyBiZWcgcG9pbnQtbWluKSkKKyAgICAgICAgIChlbmQKKyAgICAg ICAgICAgKGNvbmQKKyAgICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAobm90IG5h cnJvd2VkLXApCisgICAgICAgICAgICAgICAgIGVuZCkKKyAgICAgICAgICAgICAgIGVuZCkKKyAg ICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAobm90IG5hcnJvd2VkLXApCisgICAg ICAgICAgICAgICAgIChudWxsIGVuZCkpCisgICAgICAgICAgICAgICBwb2ludC1tYXgpCisgICAg ICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFycm93ZWQtcAorICAgICAgICAgICAg ICAgICBlbmQKKyAgICAgICAgICAgICAgICAgKDwgZW5kIHBvaW50LW1heCkpCisgICAgICAgICAg ICAgICBlbmQpCisgICAgICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFycm93ZWQt cAorICAgICAgICAgICAgICAgICBlbmQKKyAgICAgICAgICAgICAgICAgKD0gZW5kIHBvaW50LW1h eCkpCisgICAgICAgICAgICAgICAoMSsgZW5kKSkKKyAgICAgICAgICAgICAoKGFuZAorICAgICAg ICAgICAgICAgICBuYXJyb3dlZC1wCisgICAgICAgICAgICAgICAgIChudWxsIGVuZCkpCisgICAg ICAgICAgICAgICAoMSsgcG9pbnQtbWF4KSkgKSkKKyAgICAgICAgIChvdmVybGF5cworICAgICAg ICAgICAocHJvZ24KKyAgICAgICAgICAgICAob3ZlcmxheS1yZWNlbnRlciBlbmQpCisgICAgICAg ICAgICAgKG92ZXJsYXlzLWluIGJlZyBlbmQpKSkpCisgICAgKHdoZW4gKGFuZCBiZWcgZW5kIG5h bWUgdmFsKQorICAgICAgKGRvbGlzdCAobyBvdmVybGF5cykKKyAgICAgICAgKGNvbmQKKyAgICAg ICAgICAoKGFuZCAoZXEgbmFtZSAnZmFjZSkKKyAgICAgICAgICAgICAgICAoZXEgKG92ZXJsYXkt Z2V0IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIDs7IEVpdGhlciBwdXNoIHRoaXMgb3Zlcmxh eSBvdXRzaWRlIGJlZy4uLmVuZAorICAgICAgICAgICAgOzsgb3Igc3BsaXQgaXQgdG8gZXhjbHVk ZSBiZWcuLi5lbmQKKyAgICAgICAgICAgIDs7IG9yIGRlbGV0ZSBpdCBlbnRpcmVseSAoaWYgaXQg aXMgY29udGFpbmVkIGluIGJlZy4uLmVuZCkuCisgICAgICAgICAgICAoaWYgKDwgKG92ZXJsYXkt c3RhcnQgbykgYmVnKQorICAgICAgICAgICAgICAgIChpZiAoPiAob3ZlcmxheS1lbmQgbykgZW5k KQorICAgICAgICAgICAgICAocHJvZ24KKyAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IChj b3B5LW92ZXJsYXkgbykKKyAgICAgICAgICAgICAgICAgIChvdmVybGF5LXN0YXJ0IG8pIGJlZykK KyAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVuZCBvKSkpCisg ICAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gKG92ZXJsYXktc3RhcnQgbykgYmVnKSkK KyAgICAgICAgICAgICAgKGlmICg+IChvdmVybGF5LWVuZCBvKSBlbmQpCisgICAgICAgICAgICAg ICAgICAobW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVuZCBvKSkKKyAgICAgICAgICAgICAg ICAoZGVsZXRlLW92ZXJsYXkgbykpKSkKKyAgICAgICAgICAoKGFuZCAobm90IChlcSBuYW1lICdm YWNlKSkKKyAgICAgICAgICAgICAgICAoZXF1YWwtaW5jbHVkaW5nLXByb3BlcnRpZXMgKG92ZXJs YXktZ2V0IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIChkZWxldGUtb3ZlcmxheSBvKSkpKSkp KQorCisoZGVmdW4gKy1kZWxldGUtcGFyZW5zLW92ZXJsYXlzICgpCisgICh3aGVuICstcGFyZW5z LW92ZXJsYXlzLWV4aXN0LXAKKyAgICAoZG9saXN0IChmYWNlICcoKy1wYXJlbnMtb25lLWZhY2UK KyAgICAgICAgICAgICAgICAgICAgKy1wYXJlbnMtdHdvLWZhY2UKKyAgICAgICAgICAgICAgICAg ICAgKy1wYXJlbnMtdGhyZWUtZmFjZQorICAgICAgICAgICAgICAgICAgICArLXBhcmVucy1mb3Vy L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RkMiCisgIDprZXltYXAgbmlsCisgIDpnbG9iYWwgbmlsCisgIDpncm91 cCAnZmMtbW9kZQorICAoY29uZAorICAgIDs7OyBgKy1tb2RlJyBoYXMgdGhlIGFiaWxpdHkgdG8g YWxzbyBkaXNwbGF5IGEgZmlsbCBjb2x1bW4gaW5kaWNhdG9yLgorICAgIDs7OyBTZWUgdGhlIHZh cmlhYmxlIGArLWZpbGwtY29sdW1uJy4KKyAgICAoKGFuZCBmYy1tb2RlICstbW9kZSkKKyAgICAg IChzZXRxIGZjLW1vZGUgbmlsKQorICAgICAgKG1lc3NhZ2UgIlR1cm5lZCBPRkYgYGZjLW1vZGUn ICglcykgLS0gc2VlIHRoZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicuIiAoY3VycmVudC1idWZm ZXIpKSkKKyAgICAoZmMtbW9kZQorICAgICAgKHdoZW4gKGFuZCBnbG9iYWwtZWxkb2MtbW9kZQor ICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAg ICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAoZ2xvYmFs LWVsZG9jLW1vZGUgLTEpKQorICAgICAgKHdoZW4gKGFuZCBqaXQtbG9jay1jb250ZXh0LXRpbWVy CisgICAgICAgICAgICAgICAgIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAg ICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVu ICh0aW1lcnAgaml0LWxvY2stY29udGV4dC10aW1lcikKKyAgICAgICAgICAoY2FuY2VsLXRpbWVy IGppdC1sb2NrLWNvbnRleHQtdGltZXIpKQorICAgICAgICA7OyAoc2V0cSBqaXQtbG9jay1jb250 ZXh0LXRpbWVyIChydW4td2l0aC1pZGxlLXRpbWVyIDUuMCAncmVwZWF0ICdqaXQtbG9jay1jb250 ZXh0LWZvbnRpZnkpKQorICAgICAgICAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIG5pbCkp CisgICAgICAod2hlbiAoYW5kIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAg ICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVu ICh0aW1lcnAgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpCisgICAgICAgICAgKGNh bmNlbC10aW1lciB1bmRvLWF1dG8tY3VycmVudC1ib3VuZGFyeS10aW1lcikpCisgICAgICAgIChm c2V0ICd1bmRvLWF1dG8tLXVuZG9hYmxlLWNoYW5nZQorICAgICAgICAgICAgICAobGFtYmRhICgp IChhZGQtdG8tbGlzdCAndW5kby1hdXRvLS11bmRvYWJseS1jaGFuZ2VkLWJ1ZmZlcnMgKGN1cnJl bnQtYnVmZmVyKSkpKQorICAgICAgICAoZnNldCAndW5kby1hdXRvLWFtYWxnYW1hdGUgJ2lnbm9y ZSkpCisgICAgICAod2hlbiBibGluay1jdXJzb3ItbW9kZQorICAgICAgICAoYmxpbmstY3Vyc29y LW1vZGUgLTEpCisgICAgICAgICh3aGVuIChtZW1xICdibGluay1jdXJzb3ItY2hlY2sgcG9zdC1j b21tYW5kLWhvb2spCisgICAgICAgICAgKHJlbW92ZS1ob29rICdwb3N0LWNvbW1hbmQtaG9vayAn YmxpbmstY3Vyc29yLWNoZWNrKSkpCisgICAgICAoc2V0cSBmYy12aXNpYmxlIHQpCisgICAgICA7 OzsgYGF1dG8tY29tcG9zaXRpb24tbW9kZScgaXMgbmVlZGVkIGZvciBjcm9zc2hhaXJzIHRvIHBy b3Blcmx5IGNhbGN1bGF0ZQorICAgICAgOzs7IGNvb3JkaW5hdGVzIG9mIGNvbXBvc2l0aW9uIGNo YXJhY3RlcnMuICBBdXRvbWF0aWNhbGx5IGJlY29tZXMgcGVybWFuZW50bHkKKyAgICAgIDs7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uZCAiY2hhcnRyZXVzZSIpKSkK KyAgIkZhY2UgZm9yIGArLXJldmVyc2VkLWJhci1hdC16di1mYWNlJy4iCisgIDpncm91cCAnKy1t b2RlKQorCisoZGVmZmFjZSArLXJldmVyc2VkLWJhci1wb3N0LXp2LWZhY2UKKyAgJygodCAoOmZv cmVncm91bmQgImN5YW40IikpKQorICAiRmFjZSBmb3IgYCstcmV2ZXJzZWQtYmFyLXBvc3QtenYt ZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1ldmVuLXByZS16di1mYWNl CisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBkYXJrKSkK KyAgICAgOmZvcmVncm91bmQgInllbGxvdyIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29s b3JzIDg4KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJjeWFuMSIpCisg ICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDE2KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAg ICAgOmZvcmVncm91bmQgInllbGxvdyIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3Jz IDE2KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJjeWFuMSIpCisgICAg KCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDgpKQorICAgICA6Zm9yZWdyb3VuZCAid2hpdGUi KQorICAgICgoKHR5cGUgdHR5KSAoY2xhc3MgbW9ubykpCisgICAgIDppbnZlcnNlLXZpZGVvIHQp CisgICAgKHQgOmZvcmVncm91bmQgInBpbmsiKSkKKyAgIkZhY2UgZm9yIGArLWV2ZW4tcHJlLXp2 LWZhY2UnLiIKKyAgOmdyb3VwICcrLW1vZGUpCisKKyhkZWZmYWNlICstZXZlbi1pbmFjdGl2ZS1w cmUtenYtZmFjZQorICAnKCgoKGNs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bGFzcyBjb2xv cikgKG1pbi1jb2xvcnMgMTYpIChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQg IlN0ZWVsQmx1ZTQiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4KSkKKyAgICAg OmZvcmVncm91bmQgIndoaXRlIikKKyAgICAoKCh0eXBlIHR0eSkgKGNsYXNzIG1vbm8pKQorICAg ICA6aW52ZXJzZS12aWRlbyB0KQorICAgICh0IDpmb3JlZ3JvdW5kICJwaW5rIikpCisgICJGYWNl IGZvciBgKy1vZGQtaW5hY3RpdmUtYXQtenYtZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKwor KGRlZmZhY2UgKy1vZGQtcG9zdC16di1mYWNlCisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29s b3JzIDg4KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTEiKQor ICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgbGlnaHQpKQor ICAgICA6Zm9yZWdyb3VuZCAiRGFya1NhbG1vbiIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4t Y29sb3JzIDE2KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTEi KQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQp KQorICAgICA6Zm9yZWdyb3VuZCAiRGFya1NhbG1vbiIpCisgICAgKCgoY2xhc3MgY29sb3IpICht aW4tY29sb3JzIDgpKQorICAgICA6Zm9yZWdyb3VuZCAid2hpdGUiKQorICAgICgoKHR5cGUgdHR5 KSAoY2xhc3MgbW9ubykpCisgICAgIDppbnZlcnNlLXZpZGVvIHQpCisgICAgKHQgOmZvcmVncm91 bmQgInBpbmsiKSkKKyAgIkZhY2UgZm9yIGAr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3VuZCBsaWdodCkpCisgICAg IDpmb3JlZ3JvdW5kICJncmV5NjAiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAx NikgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJibHVlIikKKyAgICAoKChj bGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgMTYpIChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZv cmVncm91bmQgImdyZXk2MCIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDgpKQor ICAgICA6Zm9yZWdyb3VuZCAid2hpdGUiKQorICAgICgoKHR5cGUgdHR5KSAoY2xhc3MgbW9ubykp CisgICAgIDppbnZlcnNlLXZpZGVvIHQpCisgICAgKHQgOmZvcmVncm91bmQgInBpbmsiKSkKKyAg IkZhY2UgZm9yIGBmYy1pbmFjdGl2ZS1wcmUtenYtZmFjZScgaW4gdGhlIGluYWN0aXZlIHdpbmRv dy4iCisgIDpncm91cCAnKy1tb2RlKQorCisoZGVmZmFjZSBmYy1hdC16di1mYWNlCisgICcoKCgo Y2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZv cmVncm91bmQgIk9yYW5nZVJlZCIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4 KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJPcmFuZ2VSZWQiKQorICAg ICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgZGFyaykpCisgICAg IDpmb3JlZ3JvdW5kICJPcmFuZ2VSZWQiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9y cyAxNikgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3VuZCAiT3JhbmdlUmVkIikK KyAgICAoKChjbGFzcyBjb2xvc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z cF9PYmplY3QgdmFsKQoreworICBiLT5jaF9ob3Jpem9udGFsX3J1bGVyXyA9IHZhbDsKK30KKwor c3RhdGljIHZvaWQKK2JzZXRfY2hfdmVydGljYWxfcnVsZXIgKHN0cnVjdCBidWZmZXIgKmIsIExp c3BfT2JqZWN0IHZhbCkKK3sKKyAgYi0+Y2hfdmVydGljYWxfcnVsZXJfID0gdmFsOworfQorCitz dGF0aWMgdm9pZAorYnNldF9jaF9pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBM aXNwX09iamVjdCB2YWwpCit7CisgIGItPmNoX2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQor CitzdGF0aWMgdm9pZAorYnNldF9mY192aXNpYmxlIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09i amVjdCB2YWwpCit7CisgIGItPmZjX3Zpc2libGVfID0gdmFsOworfQorCitzdGF0aWMgdm9pZAor YnNldF9mY19pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2 YWwpCit7CisgIGItPmZjX2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQorCisvKiBlbmQgTVVM VElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogc3RhdGljIHZv aWQKIGJzZXRfYWJicmV2X21vZGUgKHN0cnVjdCBidWZmZXIgKmIsIExpc3BfT2JqZWN0IHZhbCkK IHsKQEAgLTUxNDUsNiArNTIwOCwyNCBAQCBpbml0X2J1ZmZlcl9vbmNlICh2b2lkKQogICBic2V0 X2xhc3Rfc2VsZWN0ZWRfd2luZG93ICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBtYWtlX2ZpeG51bSAo MCkpOwogCiAgIGlkeCA9IDE7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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vd3MgKCZidWZmZXJfZGVmYXVs dHMsIFF0KTsKKyAgYnNldF9mY192aXNpYmxlICgmYnVmZmVyX2RlZmF1bHRzLCBRbmlsKTsKKyAg YnNldF9mY19pbmFjdGl2ZV93aW5kb3dzICgmYnVmZmVyX2RlZmF1bHRzLCBRdCk7CisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICAgYnNldF9tb2RlX2xpbmVfZm9ybWF0ICgmYnVmZmVy X2RlZmF1bHRzLCBidWlsZF9wdXJlX2Nfc3RyaW5nICgiJS0iKSk7CiAgIGJzZXRfaGVhZGVyX2xp bmVfZm9ybWF0ICgmYnVmZmVyX2RlZmF1bHRzLCBRbmlsKTsKICAgYnNldF9hYmJyZXZfbW9kZSAo JmJ1ZmZlcl9kZWZhdWx0cywgUW5pbCk7CkBAIC01NDYxLDYgKzU1NjAsNTEgQEAgZGVmdmFyX3Bl cl9idWZmZXIgKHN0cnVjdCBMaXNwX0J1ZmZlcl9PYmpmd2QgKmJvX2Z3ZCwgY29uc3QgY2hhciAq bmFtZXN0cmluZywKIHZvaWQKIHN5bXNfb2ZfYnVmZmVyICh2b2lkKQogeworCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIERFRlNZTSAoUW1j X3JlYWxfZmFrZV9jdXJzb3IsICJtYy1yZWFsLWZha2UtY3Vyc29yIik7CisgIERFRlZBUl9QRVJf QlVGRkVSICgibWMtcmVhbC1mYWtlLWN1cnNvciIsICZCVkFSIChjdXJyZW50X2J1ZmZlciwgbWNf cmVhbF9mYWtlX2N1cnNvciksIFFuaWwsCisgICAgZG9jOiAvKiBBIGJ1ZmVyLWxvY2FsIHZhcmlh YmxlIHRvIHNldCB0aGUgY3Vyc29yI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FmY192aXNpYmxlX2luYWN0aXZlX3dpbmRvdywgImZjLWluYWN0aXZlLXdpbmRvdyIpOwor ICBERUZWQVJfUEVSX0JVRkZFUiAoImZjLWluYWN0aXZlLXdpbmRvd3MiLCAmQlZBUiAoY3VycmVu dF9idWZmZXIsIGZjX2luYWN0aXZlX3dpbmRvd3MpLCBRbmlsLAorICAgIGRvYzogLyogV2hlbiBu b24tbmlsLCBkcmF3IG11bHRpcGxlIGN1cnNvcnMgZmlsbCBjb2x1bW4gaW4gaW5hY3RpdmUgd2lu ZG93cy4gKi8pOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIHN0YXRpY3BybyAo Jmxhc3Rfb3ZlcmxheV9tb2RpZmljYXRpb25faG9va3MpOwogICBsYXN0X292ZXJsYXlfbW9kaWZp Y2F0aW9uX2hvb2tzID0gbWFrZV9uaWxfdmVjdG9yICgxMCk7CiAKZGlmZiAtLWdpdCBhL3NyYy9i dWZmZXIuaCBiL3NyYy9idWZmZXIuaAppbmRleCAyMDgwYTZmLi4xYWRhOTNlIDEwMDY0NAotLS0g YS9zcmMvYnVmZmVyLmgKKysrIGIvc3JjL2J1ZmZlci5oCkBAIC03NDAsNiArNzQwLDQwIEBAIHN0 cnVjdCBidWZmZXIKICAgICAgaW4gdGhlIGRpc3BsYXkgb2YgdGhpcyBidWZmZXIuICAqLwogICBM aXNwX09iamVjdCBleHRyYV9saW5lX3NwYWNpbmdfOwogCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8qIFRoZSBjdXJzb3IgdHlwZSBvZiB0 aGUgcmVhbCBmYWtlIGN1cnNvci4gKi8KKyAgTGlzcF9PYmplY3QgbWNfcmVhbF9mYWtlX2N1cnNv cl87CisKKyAgLyogVGhlIG5hbWUgb2YgbGlzdCB1c2VkIGJ5IG11bHRpcGxlIGN1cnNvcnMgZm9y IG5leHQgcmVkaXNwbGF5LiAqLworICBMaXNwX09iamVjdCBtY19jb25mXzsKKworICAvKiBXaGV0 aGVyIHRvIGRyYXcgbXVsdGlwbGUgY3Vyc29ycyBpbiBpbmFjdGl2ZSB3aW5kb3dzLiAqLworICBM aXNwX09iamVjdCBtY19pbmFjdGl2ZV93aW5kb3dzXzsKKworICAvKiBUaGUgbmFtZSBvZiB0aGUg YnVmZmVyLWxvY2FsIHZhcmlhYmxlLiAqLworICBMaXNwX09iamVjdCBjcm9zc2hhaXJzXzsKKwor ICAvKiBUaGUgbmFtZSBvZiB0aGUgY3Jvc3NoYWlycyBob3Jpem9udGFsIHJ1bGVyLiAqLworICBM aXNwX09iamVjdCBjaF9ob3Jpem9udGFsX3J1bGVyXzsKKworICAvKiBUaGUgbmFtZSBvZiB0aGUg Y3Jvc3NoYWlycyB2ZXJ0aWNhbCBydWxlci4gKi8KKyAgTGlzcF9PYmplY3QgY2hfdmVydGljYWxf cnVsZXJfOworCisgIC8qIFdoZXRoZXIgdG8gZHJhdyBjcm9zc2hhaXJzIGluIGluYWN0aXZlIHdp bmRvd3MuICovCisgIExpc3BfT2JqZWN0IGNoX2luYWN0aXZlX3dpbmRvd3NfOworCisgIC8qIFRo ZSBuYW1lIG9mIHRoZSBidWZmZXItbG9jYWwgdmFyaWFibGUuICovCisgIExpc3BfT2JqZWN0IGZj X3Zpc2libGVfOworCisgIC8qIFdoZXRoZXIgdG8gZHJhdyBtdWx0aXBsZSBjdXJzb3JzIGZpbGwg Y29sdW1uIGluIGluYWN0aXZlIHdpbmRvd3MuICovCisgIExpc3BfT2JqZWN0IGZjX2luYWN0aXZl X3dpbmRvd3NfOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworC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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogU2V0IHRvIHRoZSBt b2R0aW1lIG9mIHRoZSB2aXNpdGVkIGZpbGUgd2hlbiByZWFkIG9yIHdyaXR0ZW4uCiAgICAgIG1v ZHRpbWUudHZfbnNlYyA9PSBOT05FWElTVEVOVF9NT0RUSU1FX05TRUNTIG1lYW5zCiAgICAgIHZp c2l0ZWQgZmlsZSB3YXMgbm9uZXhpc3RlbnQuICBtb2R0aW1lLnR2X25zZWMgPT0KQEAgLTkwNyw2 ICs5NDgsNjkgQEAgWEJVRkZFUiAoTGlzcF9PYmplY3QgYSkKIC8qIE1vc3QgY29kZSBzaG91bGQg dXNlIHRoZXNlIGZ1bmN0aW9ucyB0byBzZXQgTGlzcCBmaWVsZHMgaW4gc3RydWN0CiAgICBidWZm ZXIuICAoU29tZSBzZXR0ZXJzIHRoYXQgYXJlIHByaXZhdGUgdG8gYSBzaW5nbGUgLmMgZmlsZSBh cmUKICAgIGRlZmluZWQgYXMgc3RhdGljIGluIHRob3NlIGZpbGVzLikgICovCisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKK0lOTElO RSB2b2lkCitic2V0X2Jsdl9tY19yZWFsX2Zha2VfY3Vyc29yIChzdHJ1Y3QgYnVmZmVyICpiLCBM aXNwX09iamVjdCB2YWwpCit7CisgIGItPm1jX3JlYWxfZmFrZV9jdXJzb3JfID0gdmFsOworfQor CitJTkxJTkUgdm9pZAorYnNldF9ibHZfbWNfY29uZiAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9P YmplY3QgdmFsKQoreworICBiLT5tY19jb25mXyA9IHZhbDsKK30KKworSU5MSU5FIHZvaWQKK2Jz ZXRfYmx2X21jX2luYWN0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ioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIElOTElO RSB2b2lkCiBic2V0X2JpZGlfcGFyYWdyYXBoX2RpcmVjdGlvbiAoc3RydWN0IGJ1ZmZlciAqYiwg TGlzcF9PYmplY3QgdmFsKQogewpkaWZmIC0tZ2l0IGEvc3JjL2Rpc3BleHRlcm4uaCBiL3NyYy9k aXNwZXh0ZXJuLmgKaW5kZXggNGU5NDdkYS4uM2MxMTBlMiAxMDA2NDQKLS0tIGEvc3JjL2Rpc3Bl eHRlcm4uaAorKysgYi9zcmMvZGlzcGV4dGVybi5oCkBAIC0xNDUsNiArMTQ1LDEzMSBAQCB0eXBl ZGVmIHZvaWQgKkVtYWNzX0N1cnNvcjsKICNkZWZpbmUgTmF0aXZlUmVjdGFuZ2xlIGludAogI2Vu ZGlmCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJT T1JTICovCisKK2V4dGVybiBib29sIHRyYWNlX3JlZGlzcGxheV9wIEVYVEVSTkFMTFlfVklTSUJM RTsKKworc3RydWN0IGdseXBoOworCitzdHJ1Y3QgZ2x5cGhfcm93OworCitzdHJ1Y3QgZ2x5cGhf bWF0cml4OworCitlbnVtIGRyYXdfZ2x5cGhzX2ZhY2U7CisKK2VudW0gZ2x5cGhfcm93X2FyZWE7 CisKK3N0cnVjdCBtY19tYXRyaXg7CisKK2VudW0gbWNfY2FjaGVfdHlwZTsKKworZW51bSBtY19j dXJzb3JfdHlwZTsKKworZW51bSBtY19mbGF2b3I7CisKK3N0cnVjdCBtY19SR0I7CisKK3N0cnVj dCBtY19lc3NlbnRpYWxzOworCitlbnVtIG1jX2RyYXdfcm93X3R5cGU7CisKK2VudW0gbWNfZW5n aW5lX3R5cGU7CisKK2VudW0gbWNfcm93X3Bvc2l0aW9uOworCitlbnVtIG1jX3JlZHJhd19yb3df dHlwZTsKKworZW51bSBkcmF3X2dseXBoX2FjdGlvbjsKKworZXh0ZXJuIExpc3BfT2JqZWN0IG1j X2xpc3RuIChwdHJkaWZmX3QsIExpc3BfT2JqZWN0LCAuLi4pOworCitleHRlcm4gTGlzcF9PYmpl Y3QgbWNfbnRoIChpbnQsIExpc3BfT2JqZWN0KTsKKworZXh0ZXJuIExpc3BfT2JqZWN0IG1jX2Fz c3EgKExpc3BfT2JqZWN0LCBMaXNwX09iamVjdCk7CisKK2V4dGVybiBlbnVtIG1jX3Jvd19wb3Np dGlvbiBtY19yb3dfcG9zaXRpb24gKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX3JvdyAq LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGds eXBoX3JvdyAqLCBpbnQpOworCitleHRlcm4gcHRyZGlmZl90IG1jX3JlZ2lvbl9saW1pdCAoYm9v bCk7CisKK2V4dGVybiBzdHJ1Y3QgZ2x5cGggKiBtY19nZXRfY3Vyc29yX2dseXBoIChzdHJ1Y3Qg d2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICosIGludCwgaW50KTsKKworZXh0 ZXJuIHZvaWQgbWNfeHdfY29sb3JfdmFsdWVzIChzdHJ1Y3Qgd2luZG93ICosIExpc3BfT2JqZWN0 LCBzdHJ1Y3QgbWNfUkdCICopOworCitleHRlcm4gYm9vbCBtY191cGRhdGVfd2luZG93X2ZyaW5n ZXMgKHN0cnVjdCB3aW5kb3cgKiwgYm9vbCk7CisKK2V4dGVybiBjaGFyICogbWNfd2luZG93IChz dHJ1Y3Qgd2luZG93ICopOworCitleHRlcm4gY2hhciAqIG1jX2NoYXJfdG9fc3RyaW5nIChpbnQp OworCitleHRlcm4gY2hhciAqIG1jX2N1cnNvcl90eXBlX3RvX3N0cmluZyAoZW51bSBtY19jdXJz b3JfdHlwZSk7CisKK2V4dGVybiBjaGFyICogbWNfZmxhdm9yX3RvX3N0cmluZyAoZW51bSBtY19m bGF2b3IpOworCitleHRlcm4gY2hhciAqIG1jX2NhY2hlX3R5cGVfdG9fc3RyaW5nIChlbnVtIG1j X2NhY2hlX3R5cGUpOworCitleHRlcm4gY2hhciAqIG1jX3JlZHJhd19yb3dfdHlwZV90b19zdHJp bmcgKGVudW0gbWNfcmVkcmF3X3Jvd190eXBlKTsKKworZXh0ZXJuIHZvaWQgbWNfY2FjaGVfaW5z cGVjdG9yIChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBtY19tYXRyaXgpOworCitleHRlcm4gYm9v bCBtY190cmF2ZXJzZV9jYWNoZV9wIChzdHJ1Y3QgbWNfbWF0cml4LCBlbnVtIG1jX2NhY2hlX3R5 cGUsIGludCwgaW50KTsKKworZXh0ZXJuIHZvaWQgbWNfZHJhd19mcmluZ2VfYml0bWFwIChzdHJ1 Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwgaW50LAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlKTsKKworZXh0ZXJuIGludCBtY19n ZXRfZnJpbmdlX2JpdG1hcCAoc3RydWN0IHdpbmRvdyAqLCBMaXNwX09iamVjdCwgaW50LCBpbnQp OworCitleHRlcm4gdm9pZCBtY19lbmdpbmUgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBo X21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAgICAgICAgICAgICAgICAgICAgIHN0 cnVjdCBnbHlwaCAqLCBpbnQsIGludCwgaW50LCBpbnQsIGludCwgaW50LAorICAgICAgICAgICAg ICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlLCBpbnQsIHN0cnVjdCBnbHlwaF9tYXRyaXgg KiwKKyAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX2Vzc2VudGlhbHMsIGVudW0gbWNf cm93X3Bvc2l0aW9uLCBzdHJ1Y3QgbWNfUkdCLAorICAgICAgICAgICAgICAgICAgICAgICBlbnVt IG1jX2VuZ2luZV90eXBlLCBib29sLCBlbnVtIG1jX2RyYXdfcm93X3R5cGUsCisgICAgICAgICAg ICAgICAgICAgICAgIGVudW0gbWNfY2FjaGVfdHlwZSk7CisKK2V4dGVybiB2b2lkIG1jX3NldF9l c3NlbnRpYWxzIChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBtY19lc3NlbnRpYWxzICopOworCitl eHRlcm4gdm9pZCBtY19kcmF3X3JvdyAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0 cml4ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1 Y3QgZ2x5cGggKiwgaW50LCBpbnQsIGludCwgc3RydWN0IGdseXBoX21hdHJpeCAqLAorICAgICAg ICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19lc3NlbnRpYWxzLCBlbnVtIG1jX3Jvd19wb3Np dGlvbiwgYm9vbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2RyYXdfcm93X3R5 cGUpOworCitleHRlcm4gYm9vbCBtY19yZWRyYXdfcm93IChzdHJ1Y3Qgd2luZG93ICosIHN0cnVj dCBnbHlwaF9tYXRyaXggKiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgZW51bSBnbHlwaF9yb3dfYXJlYSwgaW50LCBpbnQsIGludCwgYm9vbCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSwgZW51bSBtY19yZWRy YXdfcm93X3R5cGUpOworCitleHRlcm4gdm9pZCBtY19yZXNldF9jYWNoZSAoc3RydWN0IHdpbmRv dyAqKTsKKworZXh0ZXJuIHZvaWQgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHN0cnVjdCB3aW5kb3cg Kiwgc3RydWN0IGdseXBoX21hdHJpeCAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHN0cnVjdCBnbHlwaF9yb3cgKiwgZW51bSBkcmF3X2dseXBoc19mYWNlLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGludCwgaW50LCBpbnQsIHN0cnVjdCBtY19SR0IsIGVu dW0gbWNfZmxhdm9yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNf Y3Vyc29yX3R5cGUsIGludCwgYm9vbCwgYm9vbCk7CisKK2V4dGVybiB2b2lkIG1jX2VyYXNlX2N1 cnNvciAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlw aF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBpbnQsIGludCwgaW50 LCBlbnVtIG1jX2ZsYXZvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19j dXJzb3JfdHlwZSwgaW50KTsKKworZXh0ZXJuIHZvaWQgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHN0 cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICos CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBpbnQsIGludCwgaW50LCBp bnQsIGludCwgaW50LCBpbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51 bSBtY19jdXJzb3JfdHlwZSwgaW50LCBzdHJ1Y3QgbWNfUkdCLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGJvb2wsIGVudW0gbWNfZmxhdm9yLCBib29sKTsKKworZXh0ZXJuIGlu dCBtY19kcmF3X2dseXBocyAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICos IHN0cnVjdCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCwgZW51 bSBnbHlwaF9yb3dfYXJlYSwgcHRyZGlmZl90LCBwdHJkaWZmX3QsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UsIGludCwgaW50LCBzdHJ1Y3QgbWNfUkdC LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19mbGF2b3IsIGVudW0gbWNfY3Vy c29yX3R5cGUsIGludCwgYm9vbCwgYm9vbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGVu dW0gZHJhd19nbHlwaF9hY3Rpb24sIGJvb2wpOworCitleHRlcm4gc3RydWN0IGdseXBoX21hdHJp eCAqIG1jX3NhdmVfZ2x5cGhfbWF0cml4IChzdHJ1Y3QgZ2x5cGhfbWF0cml4ICopOworCitleHRl cm4gdm9pZCBtY19yZXN0b3JlX2dseXBoX21hdHJpeCAoc3RydWN0IGdseXBoX21hdHJpeCAqLCBz dHJ1Y3QgZ2x5cGhfbWF0cml4ICopOworCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogLyogVGV4dCBjdXJzb3IgdHlwZXMuICAqLwogCiBl bnVtIHRleHRfY3Vyc29yX2tpbmRzCkBAIC00MDQsNiArNTI5LDE4IEBAIHN0cnVjdCBnbHlwaF9z bGljZQogCiBzdHJ1Y3QgZ2x5cGgKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBpbnQgcmVsYXRpdmVfeCwgaHBvczsKKworICBwdHJk aWZmX3QgYnl0ZXBvczsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBQb3Np dGlvbiBmcm9tIHdoaWNoIHRoaXMgZ2x5cGggd2FzIGRyYXduLiAgSWYgYG9iamVjdCcgYmVsb3cg aXMgYQogICAgICBMaXNwIHN0cmluZywgdGhpcyBpcyBhbiBpbmRleCBpbnRvIHRoYXQgc3RyaW5n LiAgSWYgaXQgaXMgYQogICAgICBidWZmZXIsIHRoaXMgaXMgYSBwb3NpdGlvbiBpbiB0aGF0IGJ1 ZmZlci4gIEluIGFkZGl0aW9uLCBzb21lCkBAIC0xMjcwLDYgKzE0MDcsMjggQEAgZW51bSBkcmF3 X2dseXBoc19mYWNlCiAKIHN0cnVjdCBnbHlwaF9zdHJpbmcKIHsKKworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIGJvb2xfYmYgbGVmdF9v dmVyd3JpdHRlbl9wIDogMTsKKworICAgIGJvb2xfYmYgcmlnaHRfb3ZlcndyaXR0ZW5fcCA6IDE7 CisKKyAgICBib29sX2JmIHJlY3RhbmdsZV9udWtlZF9wIDogMTsKKworICAgIGJvb2xfYmYgYmFj a2dyb3VuZF9udWtlZF9wIDogMTsKKworICAgIGVudW0gZHJhd19nbHlwaF9hY3Rpb24KKyAgICB7 CisgICAgICBNQ19EUkFXX0dMWVBIX1NUUklORywKKyAgICAgIE1DX0VSQVNFX0dMWVBIX1NUUklO RworICAgIH0gYWN0aW9uX3R5cGU7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAg LyogWC1vcmlnaW4gb2YgdGhlIHN0cmluZy4gICovCiAgIGludCB4OwogCkBAIC0yODM0LDYgKzI5 OTMsMjggQEAgdHlwZWRlZiB2b2lkICgqZnJhbWVfcGFybV9oYW5kbGVyKSAoc3RydWN0IGZyYW1l ICosIExpc3BfT2JqZWN0LCBMaXNwX09iamVjdCk7CiAKIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJm YWNlCiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JT ICovCisKKy8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgbnN0ZXJtLm1gIHwgYHczMnRlcm0u Y2AgfCBgeHRlcm0uY2AgbXVzdCBiZSBpbiB0aGUKK2V4YWN0IHNhbWUgb3JkZXIgYXMgdGhlIGBy ZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgZGlzcGV4dGVybi5oYCEgKi8KKworICAvKiBgbWNfbnNf ZHJhd193aW5kb3dfY3Vyc29yJyB8IGBtY193MzJfZHJhd193aW5kb3dfY3Vyc29yJyB8IGBtY194 X2RyYXdfd2luZG93X2N1cnNvcicgKi8KKyAgdm9pZCAoKm1jX3NjcmliZV9jdXJzb3IpIChzdHJ1 Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsCisgICAgICAgIHN0cnVj dCBnbHlwaF9yb3cgKmdseXBoX3JvdywgaW50IHgsIGludCBmeCwgaW50IHksIGludCBmeSwgaW50 IGhwb3MsCisgICAgICAgIGludCB2cG9zLCBpbnQgd2QsIGludCBoLCBzdHJ1Y3QgbWNfUkdCIGxz bCwgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSwKKyAgICAgICAgaW50IGN1cnNvcl93 aW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isKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBi ZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKK3N0cnVjdCBnbHlwaHNfc2tpcHBlZAoreworICBw dHJkaWZmX3QgYWxsb2NhdGVkOworICBwdHJkaWZmX3QgdXNlZDsKKyAgc3RydWN0IHNraXBwZWRf aXRlbXMKKyAgICB7CisgICAgICBpbnQgeDsKKyAgICAgIGludCBocG9zOworICAgICAgYm9vbCBl bmFibGVkX3A7CisgICAgfSAqc2tpcHBlZDsKK30gYXJyYXlfZ2x5cGhzX3NraXBwZWQ7CisKK3N0 cnVjdCBtY19yb3dfZW50cnkKK3sKKyAgaW50IG9sZF91c2VzLCBuZXdfdXNlczsKKyAgaW50IG5l d19saW5lX251bWJlcjsKKyAgcHRyZGlmZl90IGJ1Y2tldDsKKyAgc3RydWN0IGdseXBoX3JvdyAq cm93OworICBzdHJ1Y3QgbWNfcm93X2VudHJ5ICpuZXh0OworfTsKK3N0YXRpYyBzdHJ1Y3QgbWNf cm93X2VudHJ5ICptY19yb3dfZW50cnlfcG9vbDsKK3N0YXRpYyBwdHJkaWZmX3QgbWNfcm93X2Vu dHJ5X3Bvb2xfc2l6ZTsKK3N0YXRpYyBwdHJkaWZmX3QgbWNfcm93X2VudHJ5X2lkeDsKK3N0YXRp YyBzdHJ1Y3QgbWNfcm93X2VudHJ5ICoqbWNfcm93X3RhYmxlOworc3RhdGljIHB0cmRpZmZfdCBt Y19yb3dfdGFibGVfc2l6ZTsKK3N0YXRpYyBzdHJ1Y3QgbWNfcm93X2VudHJ5ICoqbWNfb2xkX2xp bmVzLCAqKm1jX25ld19saW5lczsKK3N0YXRpYyBwdHJkaWZmX3QgbWNfb2xkX2xpbmVzX3NpemUs IG1jX25ld19saW5lc19zaXplOworc3RhdGljIHN0cnVjdCBydW4gKm1jX3J1bl9wb29sOworc3Rh dGljIHB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gIHdoaWxlIChlbnRyeSAmJiAhcm93X2VxdWFsX3AgKGVu dHJ5LT5yb3csIHJvdywgMSkpCisgICAgZW50cnkgPSBlbnRyeS0+bmV4dDsKKyAgaWYgKGVudHJ5 ID09IE5VTEwpCisgICAgeworICAgICAgZW50cnkgPSBtY19yb3dfZW50cnlfcG9vbCArIG1jX3Jv d19lbnRyeV9pZHgrKzsKKyAgICAgIGVudHJ5LT5yb3cgPSByb3c7CisgICAgICBlbnRyeS0+b2xk X3VzZXMgPSBlbnRyeS0+bmV3X3VzZXMgPSAwOworICAgICAgZW50cnktPm5ld19saW5lX251bWJl ciA9IDA7CisgICAgICBlbnRyeS0+YnVja2V0ID0gaTsKKyAgICAgIGVudHJ5LT5uZXh0ID0gbWNf cm93X3RhYmxlW2ldOworICAgICAgbWNfcm93X3RhYmxlW2ldID0gZW50cnk7CisgICAgfQorICBy ZXR1cm4gZW50cnk7Cit9CisKKy8qIFJldmVyc2UgdGhlIGNvbnRlbnRzIG9mIHJvd3MgaW4gTUFU UklYIGJldHdlZW4gU1RBUlQgYW5kIEVORC4gIFRoZQorICAgY29udGVudHMgb2YgdGhlIHJvdyBh dCBFTkQgLSAxIGVuZCB1cCBhdCBTVEFSVCwgRU5EIC0gMiBhdCBTVEFSVCArCisgICAxIGV0Yy4g IFRoaXMgaXMgcGFydCBvZiB0aGUgaW1wbGVtZW50YXRpb24gb2Ygcm90YXRlX21hdHJpeCAoc2Vl CisgICBiZWxvdykuICovCitzdGF0aWMgdm9pZAorbWNfcmV2ZXJzZV92cG9zIChzdHJ1Y3QgbWNf bWF0cml4IG1hdHJpeCwgaW50IHN0YXJ0LCBpbnQgZW5kKQoreworICBpbnQgaSwgajsKKyAgZm9y IChpID0gc3RhcnQsIGogPSBlbmQgLSAxOyBpIDwgajsgKytpLCAtLWopCisgICAgeworICAgICAg LyogTm9uLUlTTyBIUC9VWCBjb21waWxlciBkb2Vzbid0IGxpa2UgYXV0byBzdHJ1Y3QgaW5pdGlh bGl6Y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+Z2x5cGhzW1RFWFRf QVJFQV0sIG5ieXRlcyk7CisgICAgICB0by0+dXNlZFtURVhUX0FSRUFdID0gZnJvbS0+dXNlZFtU RVhUX0FSRUFdOworICAgICAgdG8tPmhhc2ggPSBmcm9tLT5oYXNoOworICAgICAgdG8tPnggPSBm cm9tLT54OworICAgICAgdG8tPnkgPSBmcm9tLT55OworICAgICAgdG8tPnBpeGVsX3dpZHRoID0g ZnJvbS0+cGl4ZWxfd2lkdGg7CisgICAgICB0by0+YXNjZW50ID0gZnJvbS0+YXNjZW50OworICAg ICAgdG8tPmhlaWdodCA9IGZyb20tPmhlaWdodDsKKyAgICAgIHRvLT5waHlzX2FzY2VudCA9IGZy b20tPnBoeXNfYXNjZW50OworICAgICAgdG8tPnBoeXNfaGVpZ2h0ID0gZnJvbS0+cGh5c19oZWln aHQ7CisgICAgICB0by0+dmlzaWJsZV9oZWlnaHQgPSBmcm9tLT52aXNpYmxlX2hlaWdodDsKKyAg ICAgIHRvLT5leHRyYV9saW5lX3NwYWNpbmcgPSBmcm9tLT5leHRyYV9saW5lX3NwYWNpbmc7Cisg ICAgICB0by0+c3RhcnQgPSBmcm9tLT5zdGFydDsKKyAgICAgIHRvLT5lbmQgPSBmcm9tLT5lbmQ7 CisgICAgICB0by0+bWlucG9zID0gZnJvbS0+bWlucG9zOworICAgICAgdG8tPm1heHBvcyA9IGZy b20tPm1heHBvczsKKyAgICAgIHRvLT5vdmVybGF5X2Fycm93X2JpdG1hcCA9IGZyb20tPm92ZXJs YXlfYXJyb3dfYml0bWFwOworICAgICAgdG8tPmxlZnRfdXNlcl9mcmluZ2VfYml0bWFwID0gZnJv bS0+bGVmdF91c2VyX2ZyaW5nZV9iaXRtYXA7CisgICAgICB0by0+cmlnaHRfdXNlcl9mcmluZ2Vf Yml0bWFwID0gZnJvbS0+cmlnaHRfdXNlcl9mcmluZ2VfYml0bWFwOworICAgICAgdG8tPmxlZnRf ZnJpbmdlX2JpdG1hcCA9IGZyb20tPmxlZn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KKyAgaW50IHliID0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpOworICBwdHJk aWZmX3QgaTsKKyAgaW50IGosIGZpcnN0X29sZCwgZmlyc3RfbmV3LCBsYXN0X29sZCwgbGFzdF9u ZXc7CisgIGludCBucnVucywgcnVuX2lkeDsKKyAgcHRyZGlmZl90IG47CisgIHN0cnVjdCBtY19y b3dfZW50cnkgKmVudHJ5OworICAvLyBzdHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFjZSAqcmlmID0g RlJBTUVfUklGIChYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpKTsKKyAgLyogU2tpcCBvdmVyIHJv d3MgZXF1YWwgYXQgdGhlIHN0YXJ0LiAqLworICBmb3IgKGkgPSBoZWFkZXJfbGluZV9wOyBpIDwg Y3VycmVudF9tYXRyaXgtPm5yb3dzIC0gMTsgKytpKQorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlw aF9yb3cgKmQgPSBNQVRSSVhfUk9XIChkZXNpcmVkX21hdHJpeCwgaSk7CisgICAgICBzdHJ1Y3Qg Z2x5cGhfcm93ICpjID0gTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIGkpOworICAgICAgaWYg KGMtPmVuYWJsZWRfcAorICAgICAgICAgICYmIGQtPmVuYWJsZWRfcAorICAgICAgICAgICYmICFk LT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcAorICAgICAgICAgICYmIGMtPnkgPT0gZC0+eQorICAg ICAgICAgICYmIE1BVFJJWF9ST1dfQk9UVE9NX1kgKGMpIDw9IHliCisgICAgICAgICAgJiYgTUFU UklYX1JPV19CT1RUT01fWSAoZCkgPD0geWIKKyAgICAgICAgICAmJiByb3dfZXF1YWxfcCAoYywg ZCwgMSkpCisgICAgICAgIHsKKyAgICAgICAgICBhc3NpZ25fcm93IChjLCBkKTsKKyAgICAgICAg ICBkLT5lbmFibGVkX3AgPSBmYWxzZTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAg ICA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8qIFNldCBsYXN0X29sZCB0byB0aGUg aW5kZXggKyAxIG9mIHRoZSByb3cgdGhhdCByZWFjaGVzIHRoZSBib3R0b20KKyAgICAgYm91bmRh cnkgaW4gdGhlIGN1cnJlbnQgbWF0cml4LiAgV2UgZG9uJ3QgbG9vayBhdCB0aGUgZW5hYmxlZAor ICAgICBmbGFnIGhlcmUgYmVjYXVzZSB3ZSBwbGFuIHRvIHJldXNlIHBhcnQgb2YgdGhlIGRpc3Bs YXkgZXZlbiBpZgorICAgICBvdGhlciBwYXJ0cyBhcmUgZGlzYWJsZWQuICovCisgIGkgPSBmaXJz dF9vbGQgKyAxOworICB3aGlsZSAoaSA8IGN1cnJlbnRfbWF0cml4LT5ucm93cyAtIDEpCisgICAg eworICAgICAgaW50IGJvdHRvbSA9IE1BVFJJWF9ST1dfQk9UVE9NX1kgKE1BVFJJWF9ST1cgKGN1 cnJlbnRfbWF0cml4LCBpKSk7CisgICAgICBpZiAoYm90dG9tIDw9IHliKQorICAgICAgICArK2k7 CisgICAgICBpZiAoYm90dG9tID49IHliKQorICAgICAgICBicmVhazsKKyAgICB9CisgIGxhc3Rf b2xkID0gaTsKKyAgLyogU2tpcCBvdmVyIHJvd3MgZXF1YWwgYXQgdGhlIGJvdHRvbS4gKi8KKyAg aSA9IGxhc3RfbmV3OworICBqID0gbGFzdF9vbGQ7CisgIHdoaWxlIChpIC0gMSA+IGZpcnN0X25l dworICAgICAgICAgJiYgaiAtIDEgPiBmaXJzdF9vbGQKKyAgICAgICAgICYmIE1BVFJJWF9ST1df RU5BQkxFRF9QIChjdXJyZW50X21hdHJpeCwgaiAtIDEpCisgICAgICAgICAmJiAoTUFUUklYX1JP VyAoY3VycmVudF9tYXRyaXgsIGogLSAxKS0+eQorICAgICAgICAgICAgID09IE1BVFJJWF9ST1cg KGRlc2lyZWRfbWF0cml4LCBpIC0gMSktPnkpCisgICAgICAgICAmJiAhTUFUUklYX1JPVyAoZGVz aXJlZF9tYXRyaXgsIGkgLSAxK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FRfQUxNT1NUX1BSSU1F X0xJTUlUID09IDExKTsKKyAgICBlbnVtIHsgbmV4dF9hbG1vc3RfcHJpbWVfaW5jcmVtZW50X21h eCA9IDEwIH07CisgICAgcHRyZGlmZl90IHJvd190YWJsZV9tYXggPQorICAgICAgKG1pbiAoUFRS RElGRl9NQVgsIFNJWkVfTUFYKSAvICgzICogc2l6ZW9mICptY19yb3dfdGFibGUpCisgICAgICAg LSBuZXh0X2FsbW9zdF9wcmltZV9pbmNyZW1lbnRfbWF4KTsKKyAgICBwdHJkaWZmX3QgY3VycmVu dF9ucm93c19tYXggPSByb3dfdGFibGVfbWF4IC0gZGVzaXJlZF9tYXRyaXgtPm5yb3dzOworICAg IGlmIChjdXJyZW50X25yb3dzX21heCA8IGN1cnJlbnRfbWF0cml4LT5ucm93cykKKyAgICAgIG1l bW9yeV9mdWxsIChTSVpFX01BWCk7CisgIH0KKyAgLyogUmVhbGxvY2F0ZSB2ZWN0b3JzLCB0YWJs ZXMgZXRjLiBpZiBuZWNlc3NhcnkuICovCisgIGlmIChjdXJyZW50X21hdHJpeC0+bnJvd3MgPiBt Y19vbGRfbGluZXNfc2l6ZSkKKyAgICBtY19vbGRfbGluZXMgPSB4cGFsbG9jIChtY19vbGRfbGlu ZXMsICZtY19vbGRfbGluZXNfc2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50 X21hdHJpeC0+bnJvd3MgLSBtY19vbGRfbGluZXNfc2l6ZSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICBJTlRfTUFYLCBzaXplb2YgKm1jX29sZF9saW5lcyk7CisgIGlmIChkZXNpcmVkX21hdHJp eC0+bnJvd3MgPiBtY19uZXdfbGluZXNfc2l6ZSkKKyAgICBtY19uZXdfbGluZXMgPSB4cGFsbG9j IChtY19uZXdfbGluZXMsICZtY19uZXdfbGluZXNfc2l6ZSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICBkZXNpcmVkX21hdHJpeC0+bnJvd3MgLSBtY19uZXdfbGluZXNfc2l6ZSwKKyAgICAgICAg ICAgICAgICAgICAgICAgICBJTlRfTUFYLCBzaXplb2YgKm1jX25ld19saW5lcyk7CisgIG4gPSBk ZXNpcmVkX21hdHJpeC0+bnJvd3M7CisgIG4gKz0gY3VycmVudF9tYXRyaXgtPm5yb3dzOworICBp ZiAobWNfcm93X3RhYmxlX3NpemUgPCAzICogbikKKyAgICB7CisgICAgICBwdHJkaWZmX3Qgc2l6 ZSA9IG5leHRfYWxtb3N0X3ByaW1lICgzICogbik7CisgICAgICBtY19yb3dfdGFibGUgPSB4bnJl YWxsb2MgKG1jX3Jvd190YWJsZSwgc2l6ZSwgc2l6ZW9mICptY19yb3dfdGFibGUpOworICAgICAg bWNfcm93X3RhYmxlX3NpemUgPSBzaXplOworICAgICAgbWVtc2V0IChtY19yb3dfdGFibGUsIDAs IHNpemUgKiBzaXplb2YgKm1jX3Jvd190YWJsZSk7CisgICAgfQorICBpZiAobiA+IG1jX3Jvd19l bnRyeV9wb29sX3NpemUpCisgICAgbWNfcm93X2VudHJ5X3Bvb2wgPSB4cGFsbG9jIChtY19yb3df ZW50cnlfcG9vbCwgJm1jX3Jvd19lbnRyeV9wb29sX3NpemUsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBuIC0gbWNfcm93X2VudHJ5X3Bvb2xfc2l6ZSwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIC0xLCBzaXplb2YgKm1jX3Jvd19lbnRyeV9wb29sKTsKKyAgaWYgKGRlc2ly ZWRfbWF0cml4LT5ucm93cyA+IG1jX3J1bnNfc2l6ZSkKKyAgICB7CisgICAgICBtY19ydW5zID0g eG5yZWFsbG9jIChtY19ydW5zLCBkZXNpcmVkX21hdHJpeC0+bnJvd3MsIHNpemVvZiAqbWNfcnVu cyk7CisgICAgICBtY19ydW5fcG9vbCA9IHhucmVhbGxvYyAobWNfcnVuX3Bvb2wsIGRlc2lyZWRf bWF0cml4LT5ucm93cywgc2l6ZW9mICptY19ydW5fcG9vbCk7CisgICAgICBtY19ydW5zX3NpemUg PSBkZXNpcmVkX21hdHJpeC0+bnJvd3M7CisgICAgfQorICBucnVucyA9IHJ1bl9pZHggPSAwOwor ICBtY19yb3dfZW50cnlfaWR4ID0gMDsKKyAgLyogQWRkIHJvd3MgZnJvbSB0aGUgY3VycmVudCBh bmQgZGVzaXJlZCBtYXRyaXggdG8gdGhlIGhhc2ggdGFibGUKKyAgICAgcm93X2hhc2hfdGFibGUg dG8gYmUgYWJsZSB0byBmaW5kIGVxdWFsIG9uZXMgcXVpY2tseS4gKi8KKyAgZm9yIChpID0gZmly c3Rfb2xkOyBpIDwgbGFzdF9vbGQ7ICsraSkKKyAgICB7CisgICAgICBpZiAoTUFUUklYX1JPV19F TkFCTEVEX1AgKGN1cnJlbnRfbWF0cml4LCBpKSkKKyAgICAgICAgeworICAgICAgICAgIGVudHJ5 ID0gbWNfYWRkX3Jvd19lbnRyeSAoTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIGkpKTsKKyAg ICAgICAgICBtY19vbGRfbGluZXNbaV0gPSBlbnRyeTsKKyAgICAgICAgICArK2VudHJ5LT5vbGRf dXNlczsKKyAgICAgICAgfQorICAgICAgZWxzZQorICAgICAgICBtY19vbGRfbGluZXNbaV0gPSBO VUxMOworICAgIH0KKyAgZm9yIChpID0gZmlyc3RfbmV3OyBpIDwgbGFzdF9uZXc7ICsraSkKKyAg ICB7CisgICAgICBlYXNzZXJ0IChNQVRSSVhfUk9XX0VOQUJMRURfUCAoZGVzaXJlZF9tYXRyaXgs IGkpKTsKKyAgICAgIGVudHJ5ID0gbWNfYWRkX3Jvd19lbnRyeSAoTUFUUklYX1JPVyAoZGVzaXJl ZF9tYXRyaXgsIGkpKTsKKyAgICAgICsrZW50cnktPm5ld191c2VzOworICAgICAgZW50cnktPm5l d19saW5lX251bWJlciA9IGk7CisgICAgICBtY19uZXdfbGluZXNbaV0gPSBlbnRyeTsKKyAgICB9 CisgIC8qIElkZW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gICAgICAgICAgJiYg bWNfb2xkX2xpbmVzW3BdID09IG1jX25ld19saW5lc1txXSkKKyAgICAgICAgICB7CisgICAgICAg ICAgICBpbnQgaCA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCBwKS0+aGVpZ2h0OworICAg ICAgICAgICAgLS1ydW4tPmN1cnJlbnRfdnBvczsKKyAgICAgICAgICAgIC0tcnVuLT5kZXNpcmVk X3Zwb3M7CisgICAgICAgICAgICArK3J1bi0+bnJvd3M7CisgICAgICAgICAgICBydW4tPmhlaWdo dCArPSBoOworICAgICAgICAgICAgcnVuLT5kZXNpcmVkX3kgLT0gaDsKKyAgICAgICAgICAgIHJ1 bi0+Y3VycmVudF95IC09IGg7CisgICAgICAgICAgICAtLXAsIC0tcTsKKyAgICAgICAgICB9Cisg ICAgICAgIC8qIEV4dGVuZCBmb3J3YXJkLiAqLworICAgICAgICBwID0gaSArIDE7CisgICAgICAg IHEgPSBuZXdfbGluZSArIDE7CisgICAgICAgIHdoaWxlIChwIDwgbGFzdF9vbGQKKyAgICAgICAg ICAgICAgICYmIHEgPCBsYXN0X25ldworICAgICAgICAgICAgICAgJiYgbWNfb2xkX2xpbmVzW3Bd ID09IG1jX25ld19saW5lc1txXSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpbnQgaCA9IE1B VFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCBwKS0+aGVpZ2h0OworICAgICAgICAgICAgKytydW4t Pm5yb3dzOworICAgICAgICAgICAgcnVuLT5oZWlnaHQgKz0gaDsKKyAgICAgICAgICAgICsrcCwg KytxOworICAgICAgICAgIH0KKyAgICAgICAgLyogSW5zZXJ0IHJ1biBpbnRvIGxpc3Qgb2YgYWxs IHJ1bnMuICBPcmRlciBydW5zIGJ5IGNvcGllZAorICAgICAgICAgICBwaXhlbCBsaW5lcy4gIE5v dGUgdGhhdCB3ZSByZWNvcmQgcnVucyB0aGF0IGRvbid0IGhhdmUgdG8KKyAgICAgICAgICAgYmUg Y29waWVkIGJlY2F1c2UgdGhleSBhcmUgYWxyZWFkeSBpbiBwbGFjZS4gIFRoaXMgaXMgZG9uZQor ICAgICAgICAgICBiZWNhdXNlIHdlIGNhbiBhdm9pZCBjYWxsaW5nIHVwZGF0ZV93aW5kb3dfbGlu ZSBpbiB0aGlzCisgICAgICAgICAgIGNhc2UuICovCisgICAgICAgIGZvciAocCA9IDA7IHAgPCBu cnVucyAmJiBtY19ydW5zW3BdLT5oZWlnaHQgPiBydW4tPmhlaWdodDsgKytwKQorICAgICAgICAg IDsKKyAgICAgICAgZm9yIChxID0gbnJ1bnM7IHEgPiBwOyAtLXEpCisgICAgICAgICAgbWNfcnVu c1txXSA9IG1jX3J1bnNbcSAtIDFdOworICAgICAgICBtY19ydW5zW3BdID0gcnVuOworICAgICAg ICArK25ydW5zOworICAgICAgICBpICs9IHJ1bi0+bnJvd3M7CisgICAgICB9CisgICAgICBlbHNl CisgICAgICAgICsraTsKKyAgLyogRG8gdGhlIG1vdmVzLiAgRG8gaXQgaW4gYSB3YXkgdGhhdCB3 ZSBkb24ndCBvdmVyd3JpdGUgc29tZXRoaW5nCisgICAgIHdlIHdhbnQgdG8gY29weSBsYXRlciBv bi4gIFRoaXMgaXMgbm90IHNvbHZhYmxlIGluIGdlbmVyYWwKKyAgICAgYmVjYXVzZSB0aGVyZSBp cyBvbmx5IG9uZSBkaXNwbGF5IGFuZCB3ZSBkb24ndCBoYXZlIGEgd2F5IHRvCisgICAgIGV4Y2hh bmdlIGFyZWFzIG9uIHRoaXMgZGlzcGxheS4gIEV4YW1wbGU6CisgICAgICAgICAgKy0tLS0tLS0t LS0tKyAgICAgICArLS0tLS0tLS0tLS0rCisgICAgICAgICAgfCAgICAgQSAgICAgfCAgICAgICB8 ICAgICBCICAgICB8CisgICAgICAgICAgKy0tLS0tLS0tLS0tKyAgLS0+ICArLS0tLS0tLS0tLS0r CisgICAgICAgICAgfCAgICAgQiAgICAgfCAgICAgICB8ICAgICBBICAgICB8CisgICAgICAgICAg Ky0tLS0tLS0tLS0tKyAgICAgICArLS0tLS0tLS0tLS0rCisgICAgIEluc3RlYWQsIHByZWZlciBi aWdnZXIgbW92ZXMsIGFuZCBpbnZhbGlkYXRlIG1vdmVzIHRoYXQgd291bGQKKyAgICAgY29weSBm cm9tIHdoZXJlIHdlIGNvcGllZCB0by4gKi8KKyAgZm9yIChpID0gMDsgaSA8IG5ydW5zOyArK2kp CisgICAgaWYgKG1jX3J1bnNbaV0tPm5yb3dzID4gMCkKKyAgICAgIHsKKyAgICAgICAgc3RydWN0 IHJ1biAqciA9IG1jX3J1bnNbaV07CisgICAgICAgIGlmIChyLT5jdXJyZW50X3kgIT0gci0+ZGVz aXJlZF95KQorICAgICAgICAgIHsKKyAgICAgICAgICAgIC8vICBmcHJpbnRmIChzdGRlcnIsICIl czogIHItPmN1cnJlbnQvZGVzaXJlZF92cG9zICglZC8lZCkgfCByLT5jdXJyZW50L2Rlc2lyZWRf eSAoJWQvJWQpXG4iLAorICAgICAgICAgICAgLy8gICAgICAgICAgIHItPmN1cnJlbnRfeSA8IHIt PmRlc2lyZWRfeSA/ICLihpMiIDogIuKGkSIsCisgICAgICAgICAgICAvLyAgICAgICAgICAgci0+ Y3VycmVudF92cG9zLCByLT5kZXNpcmVkX3Zwb3MsIHItPmN1cnJlbnRfeSwgci0+ZGVzaXJlZF95 KTsKKyAgICAgICAgICAgIC8vICByaWYtPmNsZWFyX3dpbmRvd19tb3VzZV9mYWNlICh3KTsKKyAg ICAgICAgICAgIC8vICByaWYtPnNjcm9sbF9ydW5faG9vayAodywgcik7CisgICAgICAgICAgfQor ICAgICAgICAvKiBUcnVuY2F0ZSBydW5zIHRoYXQgY29weSB0byB3aGVyZSB3ZSBjb3BpZWQgdG8s IGFuZAorICAgICAgICAgICBpbnZhbGlkYXRlIHJ1bnMgdGhhdCBjb3B5IGZyb20gd2hlcmUgd2Ug Y29waWVkIHRvLiAqLworICAgICAgICBmb3IgKGogPSBucnVucyAtIDE7IGogPiBpOyAtLWopCisg ICAgICAgICAgeworICAgICAgICAgICAgc3RydWN0IHJ1biAqcCA9IG1jX3J1bnNbal07CisgICAg ICAgICAgICBib29sIHRydW5jYXRlZF9wID0gMDsKKyAgICAgICAgICAgIGlmIChwLT5ucm93cyA+ IDAKKyAgICAgICAgICAgICAgICAmJiBwLT5kZXNpcmVkX3kgPCByLT5kZXNpcmVkX3kgKyByLT5o ZWlnaHQKKyAgICAgICAgICAgICAgICAmJiBwLT5kZXNpcmVkX3kgKyBwLT5oZWlnaHQgPiByLT5k ZXNpcmVkX3kpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAocC0+ZGVzaXJl ZF95IDwgci0+ZGVzaXJlZF95KQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg ICAgICBwLT5ucm93cyA9IHItPmRlc2lyZWRfdnBvcyAtIHAtPmRlc2lyZWRfdnBvczsKKyAgICAg ICAgICAgICAgICAgICAgcC0+aGVpZ2h0ID0gci0+ZGVzaXJlZF95IC0gcC0+ZGVzaXJlZF95Owor ICAgICAgICAgICAgICAgICAgICB0cnVuY2F0ZWRfcCA9IDE7CisgICAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgICBpbnQgbnJvd3NfY29waWVkID0gKHItPmRlc2lyZWRfdnBvcyArIHItPm5yb3dzCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBwLT5kZXNpcmVkX3Zwb3Mp OworICAgICAgICAgICAgICAgICAgICBpZiAocC0+bnJvd3MgPD0gbnJvd3NfY29waWVkKQorICAg ICAgICAgICAgICAgICAgICAgIHAtPm5yb3dzID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICBl bHNlCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAg IGludCBoZWlnaHRfY29waWVkID0gKHItPmRlc2lyZWRfeSArIHItPmhlaWdodAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIHAtPmRlc2lyZWRfeSk7Cisg ICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmN1cnJlbnRfdnBvcyArPSBucm93c19jb3BpZWQ7 CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmRlc2lyZWRfdnBvcyArPSBucm93c19jb3Bp ZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPm5yb3dzIC09IG5yb3dzX2NvcGllZDsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgcC0+Y3VycmVudF95ICs9IGhlaWdodF9jb3BpZWQ7 CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmRlc2lyZWRfeSArPSBoZWlnaHRfY29waWVk OworICAgICAgICAgICAgICAgICAgICAgICAgICBwLT5oZWlnaHQgLT0gaGVpZ2h0X2NvcGllZDsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ1bmNhdGVkX3AgPSAxOworICAgICAgICAgICAg ICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICB9CisgICAg ICAgICAgICBpZiAoci0+Y3VycmVudF95ICE9IHItPmRlc2lyZWRfeQorICAgICAgICAgICAgICAg IC8qIFRoZSBjb25kaXRpb24gYmVsb3cgaXMgZXF1aXZhbGVudCB0bworICAgICAgICAgICAgICAg ICAgICgocC0+Y3VycmVudF95ID49IHItPmRlc2lyZWRfeQorICAgICAgICAgICAgICAgICAgICAg JiYgcC0+Y3VycmVudF95IDwgci0+ZGVzaXJlZF95ICsgci0+aGVpZ2h0KQorICAgICAgICAgICAg ICAgICAgICB8fCAocC0+Y3VycmVudF95ICsgcC0+aGVpZ2h0ID4gci0+ZGVzaXJlZF95CisgICAg ICAgICAgICAgICAgICAgICAgICAmJiAocC0+Y3VycmVudF95ICsgcC0+aGVpZ2h0CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPD0gci0+ZGVzaXJlZF95ICsgci0+aGVpZ2h0KSkpCisgICAg ICAgICAgICAgICAgICAgYmVjYXVzZSB3ZSBoYXZlIDAgPCBwLT5oZWlnaHQgPD0gci0+aGVpZ2h0 LiAqLworICAgICAgICAgICAgICAgICYmIHAtPmN1cnJlbnRfeSA8IHItPmRlc2lyZWRfeSArIHIt PmhlaWdodAorICAgICAgICAgICAgICAgICYmIHAtPmN1cnJlbnRfeSArIHAtPmhlaWdodCA+IHIt PmRlc2lyZWRfeSkKKyAgICAgICAgICAgICAgcC0+bnJvd3MgPSAwOworICAgICAgICAgICAgLyog UmVvcmRlciBydW5zIGJ5IGNvcGllZCBwaXhlbCBsaW5lcyBpZiB0cnVuY2F0ZWQuICovCisgICAg ICAgICAgICBpZiAodHJ1bmNhdGVkX3AgJiYgcC0+bnJvd3MgPiAwKQorICAgICAgICAgICAgICB7 CisgICAgICAgICAgICAgICAgaW50IGsgPSBucnVucyAtIDE7CisgICAgICAgICAgICAgICAgd2hp bGUgKG1jX3J1bnNba10tPm5yb3dzID09IDAgfHwgbWNfcnVuc1trXS0+aGVpZ2h0IDwgcC0+aGVp Z2h0KQorICAgICAgICAgICAgICAgICAgay0tOworICAgICAgICAgICAgICAgIG1lbW1vdmUgKG1j X3J1bnMgKyBqLCBtY19ydW5zICsgaiArIDEsIChrIC0gaikgKiBzaXplb2YgKCptY19ydW5zKSk7 CisgICAgICAgICAgICAgICAgbWNfcnVuc1trXSA9IHA7CisgICAgICAgICAgICAgIH0KKyAgICAg ICAgICB9CisgICAgICAgIC8qIEFzc2lnbiBtYXRyaXggcm93cy4gKi8KKyAgICAgICAgZm9yIChq ID0gMDsgaiA8IHItPm5yb3dzOyArK2opCisgICAgICAgICAgeworICAgICAgICAgICAgc3RydWN0 IGdseXBoX3JvdyAqZnJvbSwgKnRvOworICAgICAgICAgICAgYm9vbCB0b19vdmVybGFwcGVkX3A7 CisgICAgICAgICAgICB0byA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCByLT5kZXNpcmVk X3Zwb3MgKyBqKTsKKyAgICAgICAgICAgIGZyb20gPSBNQVRSSVhfUk9XIChkZXNpcmVkX21hdHJp eCwgci0+ZGVzaXJlZF92cG9zICsgaik7CisgICAgICAgICAgICB0b19vdmVybGFwcGVkX3AgPSB0 by0+b3ZlcmxhcHBlZF9wOworICAgICAgICAgICAgZnJvbS0+cmVkcmF3X2ZyaW5nZV9iaXRtYXBz X3AgPSBmcm9tLT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3A7CisgICAgICAgICAgICBhc3NpZ25f cm93ICh0bywgZnJvbSk7CisgICAgICAgICAgICAvKiBUaGUgYWJvdmUgYGFzc2lnbl9yb3cnIGFj dHVhbGx5IGRvZXMgc3dhcCwgc28gaWYgd2UgaGFkCisgICAgICAgICAgICAgICBhbiBvdmVybGFw IGluIHRoZSBjb3B5IGRlc3RpbmF0aW9uIG9mIHR3byBydW5zLCB0aGVuCisgICAgICAgICAgICAg ICB0aGUgc2Vjb25kIHJ1biB3b3VsZCBhc3NpZ24gYSBwcmV2aW91c2x5IGRpc2FibGVkIGJvZ3Vz CisgICAgICAgICAgICAgICByb3cuICBCdXQgdGhhbmtzIHRvIHRoZSB0cnVuY2F0aW9uIGNvZGUg aW4gdGhlCisgICAgICAgICAgICAgICBwcmVjZWRpbmcgZm9yLWxvb3AsIHdlIG5vIGxvbmdlciBo YXZlIHN1Y2ggYW4gb3ZlcmxhcCwKKyAgICAgICAgICAgICAgIGFuZCB0aHVzIHRoZSBhc3NpZ25l ZCByb3cgc2hvdWxkIGFsd2F5cyBiZSBlbmFibGVkLiAqLworICAgICAgICAgICAgZWFzc2VydCAo dG8tPmVuYWJsZWRfcCk7CisgICAgICAgICAgICBmcm9tLT5lbmFibGVkX3AgPSBmYWxzZTsKKyAg ICAgICAgICAgIHRvLT5vdmVybGFwcGVkX3AgPSB0b19vdmVybGFwcGVkX3A7CisgICAgICAgICAg fQorICAgICAgfQorICAvKiBDbGVhciB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aW91cyByb3cgd291bGQgYmUKKyAgdGhlIHNhbWUg aW4gYm90aCBtYXRyaWNlcyBpZiB3ZSBqdW1wZWQgdG8gYHNldF9jdXJzb3I6YCB3aXRoaW4gYHVw ZGF0ZV93aW5kb3cnCisgIGFuZCBgbWNfdXBkYXRlX3dpbmRvd19kcnlydW4nLiAqLworICBpbnQg cHJldl9tYXRyaXhfcm93X3N0YXJ0X2J5dGVwb3MgPSAodnBvcyAhPSAwKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1BVFJJWF9ST1dfU1RBUlRfQllURVBPUyAoY3Vy cmVudF9yb3cgLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IC0x OworICBpbnQgcHJldl9tYXRyaXhfcm93X2VuZF9ieXRlcG9zID0gKHZwb3MgIT0gMCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPV19FTkRfQllURVBPUyAo Y3VycmVudF9yb3cgLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAt MTsKKyAgaW50IG1hdHJpeF9yb3dfc3RhcnRfYnl0ZXBvcyA9IE1BVFJJWF9ST1dfU1RBUlRfQllU RVBPUyAoZGVzaXJlZF9yb3cpOworICBpbnQgbWF0cml4X3Jvd19lbmRfYnl0ZXBvcyA9IE1BVFJJ WF9ST1dfRU5EX0JZVEVQT1MgKGRlc2lyZWRfcm93KTsKKyAgLyogVGhlIGZpcnN0IGNvbmRpdGlv biB0ZXN0cyBmb3IgYSBzb2xpdGFyeSByb3cgY29udGFpbmluZyBaViwgcHJlY2VkZWQgYnkgYQor ICByb3cgY29udGFpbmluZyBhIHBlbnVsdGltYXRlIGdseXBoIHdpdGggYSBjaGFycG9zIG9mIFpW IC0gMSBmb2xsb3dlZCBieSBhbiBlbmQKKyAgb2Ygcm93IHNwYWNlIGdseXBoIHdpdGggYSBjaGFy cG9zIG9mIDAuICBUaGUgb3RoZXIgY29uZGl0aW9ucyB0ZXN0IGZvciBhbiBlbXB0eQorICBidWZm ZXIgKG5vdCBuYXJyb3dlZCksIG9yIGFuIGVtcHR5IG5hcnJvd2VkIGJ1ZmZlci4gKi8KKyAgYm9v bCByb3dfYXRfenZfcCA9ICgodnBvcyAhPSAwCisgICAgICAgICAgICAgICAgICAgICAgICYmIChj dXJyZW50X3JvdyAtIDEpLT51c2VkW1RFWFRfQVJFQV0gPiAwCisgICAgICAgICAgICAgICAgICAg ICAgICYmIHByZXZfbWF0cml4X3Jvd19zdGFydF9ieXRlcG9zICE9IHByZXZfbWF0cml4X3Jvd19l bmRfYnl0ZXBvcworICAgICAgICAgICAgICAgICAgICAgICAmJiAhKGN1cnJlbnRfcm93IC0gMSkt PmVuZHNfYXRfenZfcAorICAgICAgICAgICAgICAgICAgICAgICAmJiBtYXRyaXhfcm93X3N0YXJ0 X2J5dGVwb3MgPT0gbWF0cml4X3Jvd19lbmRfYnl0ZXBvcworICAgICAgICAgICAgICAgICAgICAg ICAmJiBkZXNpcmVkX3Jvdy0+ZW5kc19hdF96dl9wKQorICAgICAgICAgICAgICAgICAgICAgIHx8 ICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA9PSAxKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgfHwgKGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwICYmIHZwb3MgPT0gMCkpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIGJ1ZmZlcl9uYXJyb3dlZF9wCisgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIGJvYl9yZXNwZWN0X25hcnJvdyA9PSBlb2JfcmVzcGVjdF9uYXJy b3cpCisgICAgICAgICAgICAgICAgICAgICAgfHwgKCgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAm JiB2cG9zID09IDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAoaGVhZGVyX2xpbmVf Zm9ybWF0ID09IDAgJ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HRfYXJlYSAoJXMpOiAgdnBv cyAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgIG1jX3dpbmRvdyAodyksIHZwb3MpOwor ICAvKiBJbmFzbXVjaCBhcyB3ZSBwcm9jZXNzIHRoZSBjdXJzb3Igcm93IGJlZm9yZSBhbGwgb3Ro ZXIgcm93cywgd2UgY2FuIHJlbHkKKyAgdXBvbiB0aGUgcHJldmlvdXMgYGRlc2lyZWRfcm93YCB0 byBiZSBhY2N1cmF0ZS4gKi8KKyAgZW51bSBtY19yb3dfcG9zaXRpb24gcm93X3Bvc2l0aW9uID0g IG1jX3Jvd19wb3NpdGlvbiAodywgdnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGRlc2lyZWRf cm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogY3VycmVudF9yb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGRlc2lyZWRfcm93LCB2cG9zKTsKKyAgLyogSWYgcm93cyBh cmUgYXQgZGlmZmVyZW50IFggb3IgWSwgb3Igcm93cyBoYXZlIGRpZmZlcmVudCBoZWlnaHQsCisg ICAgIG9yIHRoZSBjdXJyZW50IHJvdyBpcyBtYXJrZWQgaW52YWxpZCwgd3JpdGUgdGhlIGVudGly ZSBsaW5lLiAqLworICBpZiAoIWN1cnJlbnRfcm93LT5lbmFibGVkX3AKKyAgICAgIHx8IGRlc2ly ZWRfcm93LT55ICE9IGN1cnJlbnRfcm93LT55CisgICAgICB8fCBkZXNpcmVkX3Jvdy0+YXNjZW50 ICE9IGN1cnJlbnRfcm93LT5hc2NlbnQKKyAgICAgIHx8IGRlc2lyZWRfcm93LT5waHlzX2FzY2Vu dCAhPSBjdXJyZW50X3Jvdy0+cGh5c19hc2NlbnQKKyAgIC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zdCBvbmUKKyAgICAgICAgZ2x5cGgsIHNvIHRoYXQgdGhlIGZhY2UgZXh0ZW5z aW9uIGFjdHVhbGx5IHRha2VzIHBsYWNlLiAqLworICAgICAgICBpZiAoTUFUUklYX1JPV19FWFRF TkRTX0ZBQ0VfUCAoZGVzaXJlZF9yb3cpCisgICAgICAgICAgICAmJiAoZGVzaXJlZF9zdG9wX3Bv cyA8IGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAgICB8fCAoZGVz aXJlZF9zdG9wX3BvcyA9PSBjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAg ICAgICAgICAgICYmICFNQVRSSVhfUk9XX0VYVEVORFNfRkFDRV9QIChjdXJyZW50X3JvdykpKSkK KyAgICAgICAgICAtLWRlc2lyZWRfc3RvcF9wb3M7CisgICAgICAgIHN0b3AgPSBtaW4gKGN1cnJl bnRfcm93LT51c2VkW1RFWFRfQVJFQV0sIGRlc2lyZWRfc3RvcF9wb3MpOworICAgICAgICBpID0g MDsKKyAgICAgICAgeCA9IGRlc2lyZWRfcm93LT54OworICAgICAgICBpbnQgY2xlYXJfdG9feCA9 IDA7CisKKyAgICAgICAgLyogTG9vcCBvdmVyIGdseXBocyB0aGF0IGN1cnJlbnQgYW5kIGRlc2ly ZWQgcm93IG1heSBoYXZlIGluIGNvbW1vbi4gKi8KKyAgICAgICAgd2hpbGUgKGkgPCBzdG9wKQor ICAgICAgICAgIHsKKyAgICAgICAgICAgIGFycmF5X2dseXBoc19za2lwcGVkLnVzZWQgPSAwOwor ICAgICAgICAgICAgYm9vbCBjYW5fc2tpcF9wID0gIWFib3J0X3NraXBwaW5nOworICAgICAgICAg ICAgLyogU2tpcCBvdmVyIGdseXBocyB0aGF0IGJvdGggcm93cyBoYXZlIGluIGNvbW1vbi4gIFRo ZXNlIGRvbid0IGhhdmUKKyAgICAgICAgICAgIHRvIGJlIHdyaXR0ZW4uICBXZSBjYW4ndCBza2lw IGlmIHRoZSBsYXN0IGN1cnJlbnQgZ2x5cGggb3ZlcmxhcHMgdGhlCisgICAgICAgICAgICBnbHlw aCB0byBpdHMgcmlnaHQuICBGb3IgZXhhbXBsZSwgY29uc2lkZXIgYSBjdXJyZW50IHJvdyBvZiBg aWYnIHdpdGgKKyAgICAgICAgICAgIHRoZSBgZicgaW4gQ291cmllciBib2xkIHNvIHRoYXQgaXQg b3ZlcmxhcHMgdGhlIGAgJyB0byBpdHMgcmlnaHQuCisgICAgICAgICAgICBJZiB0aGUgZGVzaXJl ZCByb3cgaXMgYCAnLCB3ZSB3b3VsZCBza2lwIG92ZXIgdGhlIHNwYWNlIGFmdGVyIHRoZQorICAg ICAgICAgICAgYGlmJyBhbmQgdGhlcmUgd291bGQgcmVtYWluIGEgcGl4ZWwgZnJvbSB0aGUgYGYn IG9uIHRoZSBzY3JlZW4uICovCisgICAgICAgICAgICBpZiAob3ZlcmxhcHBpbmdfZ2x5cGhzX3Ag JiYgaSA+IDApCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGgg KmdseXBoID0gJmN1cnJlbnRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXVtpIC0gMV07CisgICAgICAg ICAgICAgICAgaW50IGxlZnQsIHJpZ2h0OworICAgICAgICAgICAgICAgIHJpZi0+Z2V0X2dseXBo X292ZXJoYW5ncyAoZ2x5cGgsIFhGUkFNRSAody0+ZnJhbWUpLCAmbGVmdCwgJnJpZ2h0KTsKKyAg ICAgICAgICAgICAgICBjYW5fc2tpcF9wID0gKHJpZ2h0ID09IDAgJiYgIWFib3J0X3NraXBwaW5n KTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKGNhbl9za2lwX3ApCisgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICBpbnQgc3RhcnRfaHBvcyA9IGk7CisgICAgICAgICAg ICAgICAgd2hpbGUgKGkgPCBzdG9wCisgICAgICAgICAgICAgICAgICAgICAgICYmIEdMWVBIX0VR VUFMX1AgKGRlc2lyZWRfZ2x5cGgsIGN1cnJlbnRfZ2x5cGgpKQorICAgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgICArK2FycmF5X2dseXBoc19za2lwcGVkLnVzZWQ7CisgICAg ICAgICAgICAgICAgICAgIGlmIChhcnJheV9nbHlwaHNfc2tpcHBlZC5hbGxvY2F0ZWQgPCBhcnJh eV9nbHlwaHNfc2tpcHBlZC51c2VkKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAgICAgICAgIGludCBvbGRfYWxsb2MgPSBhcnJheV9nbHlwaHNfc2tpcHBlZC5hbGxv Y2F0ZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgbmV3X2VsdHMgPSBhcnJheV9nbHlw aHNfc2tpcHBlZC51c2VkIC0gYXJyYXlfZ2x5cGhzX3NraXBwZWQuYWxsb2NhdGVkOworICAgICAg ICAgICAgICAgICAgICAgICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZCA9CisgICAgICAg ICAgICAgICAgICAgICAgICAgIHhwYWxsb2MgKGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWQs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZhcnJheV9nbHlwaHNfc2tpcHBl ZC5hbGxvY2F0ZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19lbHRz LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJTlRfTUFYLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YgKmFycmF5X2dseXBoc19za2lwcGVkLnNr aXBwZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgbWVtc2V0IChhcnJheV9nbHlwaHNfc2tp cHBlZC5za2lwcGVkICsgb2xkX2FsbG9jLCAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgKGFycmF5X2dseXBoc19za2lwcGVkLmFsbG9jYXRlZCAtIG9sZF9hbGxvYykKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBzaXplb2YgKmFycmF5X2dseXBoc19za2lw cGVkLnNraXBwZWQpOworICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAg ICAgaW50IG50aCA9IGFycmF5X2dseXBoc19za2lwcGVkLnVzZWQgLSAxOworICAgICAgICAgICAg ICAgICAgICBhcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVkW250aF0ueCA9IHg7CisgICAgICAg ICAgICAgICAgICAgIGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbbnRoXS5ocG9zID0gaTsK KyAgICAgICAgICAgICAgICAgICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZFtudGhdLmVu YWJsZWRfcCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIHggKz0gZGVzaXJlZF9nbHlwaC0+ cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgICAgICAgICsrZGVzaXJlZF9nbHlwaCwgKytjdXJy ZW50X2dseXBoLCArK2k7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLyog Q29uc2lkZXIgdGhlIGNhc2UgdGhhdCB0aGUgY3VycmVudCByb3cgY29udGFpbnMgInh4eCBwcHAg Z2dnIiBpbgorICAgICAgICAgICAgICAgIGl0YWxpYyBDb3VyaWVyIGZvbnQsIGFuZCB0aGUgZGVz aXJlZCByb3cgaXMgInh4eCBnZ2ciLiAgVGhlIGNoYXJhY3RlciBgcCcKKyAgICAgICAgICAgICAg ICBoYXMgbGJlYXJpbmcsIGBnJyBoYXMgbm90LiAgVGhlIGxvb3AgYWJvdmUgd2lsbCBzdG9wIGlu IGZyb250IG9mIHRoZQorICAgICAgICAgICAgICAgIGZpcnN0IGBwJyBpbiB0aGUgY3VycmVudCBy b3cuICBJZiB3ZSB3b3VsZCBzdGFydCB3cml0aW5nIGdseXBocyB0aGVyZSwgd2UKKyAgICAgICAg ICAgICAgICB3b3VsZG4ndCBlcmFzZSB0aGUgbGJlYXJpbmcgb2YgdGhlIGBwJy4gIFRoZSByZXN0 IG9mIHRoZSBsYmVhcmluZyBwcm9ibGVtCisgICAgICAgICAgICAgICAgaXMgdGhlbiB0YWtlbiBj YXJlIG9mIGJ5IGRyYXdfZ2x5cGhzLiAqLworICAgICAgICAgICAgICAgIGlmIChvdmVybGFwcGlu Z19nbHlwaHNfcAorICAgICAgICAgICAgICAgICAgICAmJiBpID4gMAorICAgICAgICAgICAgICAg ICAgICAmJiBpIDwgY3VycmVudF9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAg ICAgICAmJiAoY3VycmVudF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAhPSBkZXNpcmVkX3Jvdy0+dXNl ZFtURVhUX0FSRUFdKSkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAg aW50IGxlZnQsIHJpZ2h0OworICAgICAgICAgICAgICAgICAgICByaWYtPmdldF9nbHlwaF9vdmVy aGFuZ3MgKGN1cnJlbnRfZ2x5cGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgWEZSQU1F ICh3LT5mcmFtZSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmxlZnQsICZyaWdodCk7 CisgICAgICAgICAgICAgICAgICAgIHdoaWxlIChsZWZ0ID4gMCAmJiBpID4gMCkKKyAgICAgICAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAtLWksIC0tZGVzaXJlZF9n bHlwaCwgLS1jdXJyZW50X2dseXBoOworICAgICAgICAgICAgICAgICAgICAgICAgeCAtPSBkZXNp cmVkX2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxlZnQgLT0g ZGVzaXJlZF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAg ICAgICAgICAgICAgICAgICAvKiBBYm9ydCB0aGUgc2tpcHBpbmcgYWxnb3JpdGhtIGlmIHdlIGVu ZCB1cCBiZWZvcmUKKyAgICAgICAgICAgICAgICAgICAgICAgb3VyIHN0YXJ0aW5nIHBvaW50LCB0 byBhdm9pZCBsb29waW5nIChidWcjMTA3MCkuCisgICAgICAgICAgICAgICAgICAgICAgIFRoaXMg Y2FuIGhhcHBlbiB3aGVuIHRoZSBsYmVhcmluZyBpcyBsYXJnZXIgdGhhbgorICAgICAgICAgICAg ICAgICAgICAgICB0aGUgcGl4ZWwgd2lkdGguICovCisgICAgICAgICAgICAgICAgICAgIGFib3J0 X3NraXBwaW5nID0gKGkgPCBzdGFydF9ocG9zKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAg ICAgICAgICAgfQorICAgICAgICAgICAgLyogVHJ5IHRvIGF2b2lkIHdyaXRpbmcgdGhlIGVudGly ZSByZXN0IG9mIHRoZSBkZXNpcmVkIHJvdworICAgICAgICAgICAgICAgYnkgbG9va2luZyBmb3Ig YSByZXN5bmMgcG9pbnQuICBUaGlzIG1haW5seSBwcmV2ZW50cworICAgICAgICAgICAgICAgbW9k ZSBsaW5lIGZsaWNrZXJpbmcgaW4gdGhlIGNhc2UgdGhlIG1vZGUgbGluZSBpcyBpbgorICAgICAg ICAgICAgICAgZml4ZWQtcGl0Y2ggZm9udCwgd2hpY2ggaXQgdXN1YWxseSB3aWxsIGJlLiAqLwor ICAgICAgICAgICAgaWYgKGkgPCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdKQorICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgaW50IHN0YXJ0X3ggPSB4LCBzdGFydF9ocG9zID0g aTsKKyAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnN0YXJ0ID0gZGVzaXJlZF9nbHlwaDsK KyAgICAgICAgICAgICAgICBpbnQgY3VycmVudF94ID0geDsKKyAgICAgICAgICAgICAgICBib29s IHNraXBfZmlyc3RfcCA9ICFjYW5fc2tpcF9wOworICAgICAgICAgICAgICAgIC8qIEZpbmQgdGhl IG5leHQgZ2x5cGggdGhhdCdzIGVxdWFsIGFnYWluLiAqLworICAgICAgICAgICAgICAgIHdoaWxl IChpIDwgc3RvcAorICAgICAgICAgICAgICAgICAgICAgICAmJiAoc2tpcF9maXJzdF9wCisgICAg ICAgICAgICAgICAgICAgICAgICAgICB8fCAhR0xZUEhfRVFVQUxfUCAoZGVzaXJlZF9nbHlwaCwg Y3VycmVudF9nbHlwaCkpCisgICAgICAgICAgICAgICAgICAgICAgICYmIHggPT0gY3VycmVudF94 KQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB4ICs9IGRlc2lyZWRf Z2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICAgICAgICBjdXJyZW50X3ggKz0gY3Vy cmVudF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgICAgICAgICsrZGVzaXJlZF9n bHlwaCwgKytjdXJyZW50X2dseXBoLCArK2k7CisgICAgICAgICAgICAgICAgICAgIHNraXBfZmly c3RfcCA9IDA7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZm9yIChpbnQg ZWx0ID0gMDsKKyAgICAgICAgICAgICAgICAgICAgIGVsdCA8IGFycmF5X2dseXBoc19za2lwcGVk LnVzZWQ7CisgICAgICAgICAgICAgICAgICAgICArK2VsdCkKKyAgICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgICAgaW50IHggPSBhcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVk W2VsdF0ueDsKKyAgICAgICAgICAgICAgICAgICAgaW50IGhwb3MgPSBhcnJheV9nbHlwaHNfc2tp cHBlZC5za2lwcGVkW2VsdF0uaHBvczsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBo ICp0YXJnZXRfZ2x5cGggPQorICAgICAgICAgICAgICAgICAgICAgIG1jX2dldF9jdXJzb3JfZ2x5 cGggKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgaHBvcywgdnBvcyk7CisgICAgICAg ICAgICAgICAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICAgICAgICAgICAgICAgIGZwcmludGYg KHN0ZGVyciwgIlNLSVBQRUQ6ICB2cG9zICglZCkgfCBjaGFyICglZC8lcykgfCB4OiAoJWQpIHwg aHBvcyAoJWQvJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg dnBvcywgdGFyZ2V0X2dseXBoLT51LmNoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgbWNfY2hhcl90b19zdHJpbmcgKHRhcmdldF9nbHlwaC0+dS5jaCksCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4LCBocG9zLCB1cGRhdGVkX3Jvdy0+dXNl ZFtURVhUX0FSRUFdIC0gMSk7CisgICAgICAgICAgICAgICAgICAgIG1jX2RyYXdfcm93ICh3LCBk ZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHRhcmdldF9nbHlwaCwgeCwgMSwgdnBvcywKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMs IHJvd19wb3NpdGlvbiwgZHJhd19wLCBTS0lQUEVEKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgICBpZiAoaSA9PSBzdGFydF9ocG9zIHx8IHggIT0gY3VycmVudF94KQorICAg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpID0gc3RhcnRfaHBvczsKKyAg ICAgICAgICAgICAgICAgICAgeCA9IHN0YXJ0X3g7CisgICAgICAgICAgICAgICAgICAgIGRlc2ly ZWRfZ2x5cGggPSBzdGFydDsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgb3V0cHV0X2N1cnNvcl90byAodywgdnBvcywgc3Rh cnRfaHBvcywgZGVzaXJlZF9yb3ctPnksIHN0YXJ0X3gpOworICAgICAgICAgICAgICAgIC8qIFJl LWRyYXcgYSBwb3J0aW9uIG9mIHRoZSByb3cuICovCisgICAgICAgICAgICAgICAgaWYgKGRlYnVn X3ApCisgICAgICAgICAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJSRURSQVcgU0VHTUVOVDpc blwKKyAgICAgICAgICAgICAgICAgICAgdnBvcyAoJWQpIHwgY2hhciAoJWQvJXMpIHwgeDogKCVk KSB8IGhwb3MgKCVkLyVkKSB8IGxlbmd0aCAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICB2 cG9zLCBzdGFydC0+dS5jaCwgbWNfY2hhcl90b19zdHJpbmcgKHN0YXJ0LT51LmNoKSwKKyAgICAg ICAgICAgICAgICAgICAgc3RhcnRfeCwgc3RhcnRfaHBvcywgdXBkYXRlZF9yb3ctPnVzZWRbVEVY VF9BUkVBXSAtIDEsIGkgLSBzdGFydF9ocG9zKTsKKyAgICAgICAgICAgICAgICBibG9ja19pbnB1 dCAoKTsKKyAgICAgICAgICAgICAgICBpbnQgbGVuID0gaSAtIHN0YXJ0X2hwb3M7CisgICAgICAg ICAgICAgICAgaW50IGhwb3MgPSBzdGFydCAtIHVwZGF0ZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVB XTsKKyAgICAgICAgICAgICAgICB3LT5vdXRwdXRfY3Vyc29yLnggPQorICAgICAgICAgICAgICAg ICAgbWNfZHJhd19nbHlwaHMgKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3Jvdywgdy0+b3V0 cHV0X2N1cnNvci54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRFWFRfQVJF QSwgaHBvcywgaHBvcyArIGxlbiwgRFJBV19OT1JNQUxfVEVYVCwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAwLCB2cG9zLCBsc2wsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUs IHdkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZl X3AsIGN1cnNvcl9nY19wLCBNQ19EUkFXX0dMWVBIX1NUUklORywKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBkcmF3X3ApOworICAgICAgICAgICAgICAgIHctPm91dHB1dF9jdXJz b3IuaHBvcyArPSBsZW47CisgICAgICAgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAg ICAgICAgICAgICBtY19kcmF3X3JvdyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCBz dGFydCwgc3RhcnRfeCwgaSAtIHN0YXJ0X2hwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHZwb3MsIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgZHJhd19w LCBTQ1JJQkVfVFdPKTsKKyAgICAgICAgICAgICAgICBjaGFuZ2VkX3AgPSAxOworICAgICAgICAg ICAgICB9CisgICAgICAgICAgfQorCisgICAgICAgIC8qIFdyaXRlIHRoZSByZXN0LiAqLworICAg ICAgICBpZiAoaSA8IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgICAgewor ICAgICAgICAgICAgb3V0cHV0X2N1cnNvcl90byAodywgdnBvcywgaSwgZGVzaXJlZF9yb3ctPnks IHgpOworICAgICAgICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgICAgICAgIGZwcmludGYgKHN0 ZGVyciwgIkRSQVcgUkVNQUlOREVSIE9GIFRIRSBST1c6XG5cCisgICAgICAgICAgICAgICAgdnBv cyAoJWQpIHwgY2hhciAoJWQvJXMpIHwgeDogKCVkKSB8IGhwb3MgKCVkLyVkKSB8IGxlbmd0aCAo JWQpXG4iLAorICAgICAgICAgICAgICAgIHZwb3MsIGRlc2lyZWRfZ2x5cGgtPnUuY2gsIG1jX2No YXJfdG9fc3RyaW5nIChkZXNpcmVkX2dseXBoLT51LmNoKSwKKyAgICAgICAgICAgICAgICB4LCBp LCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSwgZGVzaXJlZF9yb3ctPnVzZWRbVEVY VF9BUkVBXSAtIGkpOworICAgICAgICAgICAgYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgICBp bnQgbGVuID0gZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIGk7CisgICAgICAgICAgICBp bnQgaHBvcyA9IGRlc2lyZWRfZ2x5cGggLSB1cGRhdGVkX3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV07 CisgICAgICAgICAgICB3LT5vdXRwdXRfY3Vyc29yLnggPQorICAgICAgICAgICAgICBtY19kcmF3 X2dseXBocyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB3LT5vdXRwdXRfY3Vyc29y LngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBURVhUX0FSRUEsIGhwb3MsIGhwb3Mg KyBsZW4sIERSQVdfTk9STUFMX1RFWFQsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICB2cG9zLCBsc2wsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVfcCwgY3Vyc29yX2djX3AsIE1DX0RS QVdfR0xZUEhfU1RSSU5HLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhd19wKTsK KyAgICAgICAgICAgIHctPm91dHB1dF9jdXJzb3IuaHBvcyArPSBsZW47CisgICAgICAgICAgICB1 bmJsb2NrX2lucHV0ICgpOworICAgICAgICAgICAgLyogRklYTUU6ICBBbHRob3VnaCB3ZSBuZWVk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AgICAgICAg ICAgICAgICAgIHVwZGF0ZWRfcm93LCBocG9zLCB2cG9zKTsKKyAgICAgICAgICAgICAgaWYgKHct Pm91dHB1dF9jdXJzb3IueCA9PSB1cGRhdGVkX3Jvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAg ICAgICAgeCAtPSBzdGFydC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgIGlmIChkZWJ1Z19w KQorICAgICAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIlBPU1QtQ0hBTkdFRDogIHZwb3Mg KCVkKSB8IHggKCVkKSB8IGhwb3MgKCVkLyVkKSB8IGNoYXIgKCVkLyVzKVxuIiwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHZwb3MsIHgsIGhwb3MsIHVwZGF0ZWRfcm93LT51c2Vk W1RFWFRfQVJFQV0gLSAxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQt PnUuY2gsIG1jX2NoYXJfdG9fc3RyaW5nIChzdGFydC0+dS5jaCkpOworICAgICAgICAgICAgICBt Y19kcmF3X3JvdyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCBzdGFydCwgeCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSBo cG9zLCB2cG9zLCBjdXJzb3JfbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNz ZW50aWFscywgcm93X3Bvc2l0aW9uLCBkcmF3X3AsIFBPU1RfQ0hBTkdFRCk7CisgICAgICAgICAg ICB9CisgICAgICAgICAgICAvKiBUaGVyZSB3ZXJlIG5vIGNoYW5nZXMgYW5kIGkgPT0gZGVzaXJl ZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAqLworICAgICAgICAgICAgZWxzZSBpZiAoIWNoYW5nZWRf cCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChkZWJ1Z19wKQorICAgICAg ICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiVU5DSEFOR0VEIC0tIFdSSVRFIEVOVElSRSBM SU5FOiAgdnBvcyAoJWQpIHwgcm93LT51c2VkICglZClcbiIsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHZwb3MsIHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKTsK KyAgICAgICAgICAgICAgICBtY19kcmF3X3JvdyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRf cm93LCBkZXNpcmVkX3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGRlc2lyZWRfcm93LT54LCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdLCB2 cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBlc3NlbnRp YWxzLCByb3dfcG9zaXRpb24sIGRyYXdfcCwgVU5DSEFOR0VEKTsKKyAgICAgICAgICAgICAgfQor CisgICAgICAgIC8qIE1heWJlIGNsZWFyIHRvIGVuZCBvZiBsaW5lLiAqLworICAgICAgICBpZiAo TUFUUklYX1JPV19FWFRFTkRTX0ZBQ0VfUCAoZGVzaXJlZF9yb3cpKQorICAgICAgICAgIHsKKyAg ICAgICAgICAgIC8qIElmIG5ldyByb3cgZXh0ZW5kcyB0byB0aGUgZW5kIG9mIHRoZSB0ZXh0IGFy ZWEsIG5vdGhpbmcKKyAgICAgICAgICAgICAgIGhhcyB0byBiZSBjbGVhcmVkLCBpZiBhbmQgb25s eSBpZiB3ZSBkaWQgYSB3cml0ZV9nbHlwaHMKKyAgICAgICAgICAgICAgIGFib3ZlLiAgVGhpcyBp cyBtYWRlIHN1cmUgYnkgc2V0dGluZyBkZXNpcmVkX3N0b3BfcG9zCisgICAgICAgICAgICAgICBh cHByb3ByaWF0ZWx5IGFib3ZlLiAqLworICAgICAgICAgICAgZWFzc2VydCAoaSA8IGRlc2lyZWRf cm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICAgIHx8ICgoZGVzaXJlZF9y b3ctPnVzZWRbVEVYVF9BUkVBXSA9PSBjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdKQorICAg ICAgICAgICAgICAgICAgICAgICAgICYmIE1BVFJJWF9ST1dfRVhURU5EU19GQUNFX1AgKGN1cnJl bnRfcm93KSkpOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmIChNQVRSSVhfUk9XX0VY VEVORFNfRkFDRV9QIChjdXJyZW50X3JvdykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAg IC8qIElmIG9sZCByb3cgZXh0ZW5kcyB0byB0aGUgZW5kIG9mIHRoZSB0ZXh0IGFyZWEsIGNsZWFy LiAqLworICAgICAgICAgICAgICBpZiAoaSA+PSBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFd KQorICAgICAgICAgICAgICAgIG91dHB1dF9jdXJzb3JfdG8gKHcsIHZwb3MsIGksIGRlc2lyZWRf cm93LT55LCBkZXNpcmVkX3Jvdy0+cGl4ZWxfd2lkdGgpOworICAgICAgICAgICAgICBpZiAoZHJh d19wKQorICAgICAgICAgICAgICAgIHJpZi0+Y2xlYXJfZW5kX29mX2xpbmUgKHcsIHVwZGF0ZWRf cm93LCBURVhUX0FSRUEsIC0xKTsKKyAgICAgICAgICAgICAgY2xlYXJfdG9feCA9IC0xOworICAg ICAgICAgICAgICBjaGFuZ2VkX3AgPSAxOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxz ZSBpZiAoZGVzaXJlZF9yb3ctPnBpeGVsX3dpZHRoIDwgY3VycmVudF9yb3ctPnBpeGVsX3dpZHRo KQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogT3RoZXJ3aXNlIGNsZWFyIHRv IHRoZSBlbmQgb2YgdGhlIG9sZCByb3cuICBFdmVyeXRoaW5nCisgICAgICAgICAgICAgICAgICAg YWZ0ZXIgdGhhdCBwb3NpdGlvbiBzaG91bGQgYmUgY2xlYXIgYWxyZWFkeS4gKi8KKyAgICAgICAg ICAgICAgICBpbnQgeGxpbTsKKyAgICAgICAgICAgICAgICBpZiAoaSA+PSBkZXNpcmVkX3Jvdy0+ dXNlZFtURVhUX0FSRUFdKQorICAgICAgICAgICAgICAgICAgb3V0cHV0X2N1cnNvcl90byAodywg dnBvcywgaSwgZGVzaXJlZF9yb3ctPnksIGRlc2lyZWRfcm93LT5waXhlbF93aWR0aCk7CisgICAg ICAgICAgICAgICAgLyogSWYgY3Vyc29yIGlzIGRpc3BsYXllZCBhdCB0aGUgZW5kIG9mIHRoZSBs aW5lLCBtYWtlIHN1cmUKKyAgICAgICAgICAgICAgICAgICBpdCdzIGNsZWFyZWQuICBOb3dhZGF5 cyB3ZSBkb24ndCBoYXZlIGEgcGh5c19jdXJzb3JfZ2x5cGgKKyAgICAgICAgICAgICAgICAgICB3 aXRoIHdoaWNoIHRvIGVyYXNlIHRoZSBjdXJzb3IgKGJlY2F1c2UgdGhpcyBtZXRob2QKKyAgICAg ICAgICAgICAgICAgICBkb2Vzbid0IHdvcmsgd2l0aCBsYmVhcmluZy9yYmVhcmluZyksIHNvIHdl IG11c3QgZG8gaXQgdGhpcyB3YXkuICovCisgICAgICAgICAgICAgICAgaWYgKHZwb3MgPT0gdy0+ cGh5c19jdXJzb3IudnBvcworICAgICAgICAgICAgICAgICAgICAmJiAoZGVzaXJlZF9yb3ctPnJl dmVyc2VkX3AKKyAgICAgICAgICAgICAgICAgICAgICAgID8gKHctPnBoeXNfY3Vyc29yLmhwb3Mg PCAwKQorICAgICAgICAgICAgICAgICAgICAgICAgOiAody0+cGh5c19jdXJzb3IuaHBvcyA+PSBk ZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdKSkpCisgICAgICAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgICAgIHctPnBoeXNfY3Vyc29yX29uX3AgPSAwOworICAgICAgICAgICAgICAg ICAgICB4bGltID0gLTE7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBl bHNlCisgICAgICAgICAgICAgICAgICAgIHhsaW0gPSBjdXJyZW50X3Jvdy0+cGl4ZWxfd2lkdGg7 CisgICAgICAgICAgICAgICAgaWYgKGRyYXdfcCkKKyAgICAgICAgICAgICAgICAgIHJpZi0+Y2xl YXJfZW5kX29mX2xpbmUgKHcsIHVwZGF0ZWRfcm93LCBURVhUX0FSRUEsIHhsaW0pOworICAgICAg ICAgICAgICAgIGNsZWFyX3RvX3ggPSB4bGltOworICAgICAgICAgICAgICAgIGNoYW5nZWRfcCA9 IDE7CisgICAgICAgICAgICAgIH0KKworICAgICAgICBpZiAoY2hhbmdlZF9wCisgICAgICAgICAg ICAmJiBjbGVhcl90b194ICE9IDApCisgICAgICAgICAgeworICAgICAgICAgICAgaW50IHRleHRf YXJlYV93aWR0aCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAgICAgICAg ICBzdHJ1Y3QgbWNfUkdCIGRlYnVnX2ZnID0gey5yZWQgPSAwLjg2NywgLmdyZWVuID0gMC44Njcs IC5ibHVlID0gMC44Njd9OworICAgICAgICAgICAgc3RydWN0IGdseXBoICp0YXJnZXRfZ2x5cGgg PQorICAgICAgICAgICAgICB1cGRhdGVkX3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyB1cGRhdGVk X3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gMTsKKyAgICAgICAgICAgIC8qIGBtY19lbmdpbmUnIG9u bHkgZHJhd3MgYW4gTUNfR0xZUEggd2hlbiB4IDwgdXBkYXRlZF9yb3ctPnBpeGVsX3dpZHRoLgor ICAgICAgICAgICAgVGhlIGN1cnJlbnQgZGVzaWduIGluaGliaXRzIGRyYXdpbmcgb3ZlciBhbiBl eGlzdGluZyBnbHlwaCBhdCB0aGUgZW5kIG9mIGEKKyAgICAgICAgICAgIHdvcmQtd3JhcHBlZCBs aW5lLiAgU2FpZCBnbHlwaCByZWNlaXZlcyBhIGZha2UgY3Vyc29yIGluIGVpdGhlciBvbmUgb2Yg dGhlCisgICAgICAgICAgICBwcmV2aW91cyBzZWN0aW9ucyBhYm92ZSwgYW5kIHNob3VsZCBub3Qg YmUgb3ZlcndyaXR0ZW4gd2l0aCBhbm90aGVyIG9uZS4KKyAgICAgICAgICAgIFRoaXMgZGVzaWdu IGlzIG5lZWRlZCBiZWNhdXNlIGEgd29yZC13cmFwcGVkIGxpbmUgZG9lcyBub3QgcmVjZWl2ZSBh biBleHRyYQorICAgICAgICAgICAgc3BhY2UgbGlrZSBub24td29yZC13cmFwcGVkIGxpbmVzIGRv LiAqLworICAgICAgICAgICAgaW50IHggPSB1cGRhdGVkX3Jvdy0+cGl4ZWxfd2lkdGg7CisgICAg ICAgICAgICBpbnQgaHBvcyA9IHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxOworICAg ICAgICAgICAgaW50IHhfbGltaXQgPSAoY2xlYXJfdG9feCA9PSAtMSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgPyB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAg OiBjbGVhcl90b194OworICAgICAgICAgICAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKHct PmNvbnRlbnRzKTsKKyAgICAgICAgICAgIGJvb2wgZmlsbF9jb2x1bW5fdHJ1bXBzX3AgPSAoIU5J TFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGZjX3Zpc2libGUpKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA9PSBlc3Nl bnRpYWxzLmZjX3gpOworICAgICAgICAgICAgaWYgKHRyYWNlX3JlZGlzcGxheV9wKQorICAgICAg ICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJtY191cGRhdGVfdGV4dF9hcmVhIChmbG9hdGluZyk6 ICB2cG9zICglZCkgfCB4X2xpbWl0ICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgdnBvcywgeF9saW1pdCk7CisgICAgICAgICAgICBpZiAoQlVGRkVSUCAody0+Y29udGVu dHMpCisgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGZjX3Zpc2libGUpKQorICAg ICAgICAgICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAg IHx8ICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5J TFAgKEJWQVIgKGIsIGZjX2luYWN0aXZlX3dpbmRvd3MpKSkpCisgICAgICAgICAgICAgICAgJiYg eCA8IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+ PSB4CisgICAgICAgICAgICAgICAgJiYgdGFyZ2V0X2dseXBoICE9IE5VTEwKKyAgICAgICAgICAg ICAgICAmJiBkcmF3X3ApCisgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgZGVzaXJlZF9tYXRy aXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRfZ2x5cGgsIFRFWFRfQVJFQSwKKyAgICAgICAgICAgICAg ICAgICAgICAgICB4LCB4X2xpbWl0LCB1cGRhdGVkX3Jvdy0+eSwgaHBvcywgdnBvcywgTUNfQkFS LCAxLAorICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMs IHJvd19wb3NpdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBkZWJ1Z19wID8gZGVidWdf ZmcgOiBlc3NlbnRpYWxzLmZjX2ZnW3Jvd19wb3NpdGlvbl0sCisgICAgICAgICAgICAgICAgICAg ICAgICAgRklMTF9DT0xVTU4sIGRyYXdfcCwgTk9XSEVSRSwgTk9fQ0FDSEUpOworICAgICAgICAg ICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICYmICFOSUxQIChC VkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwg Y2hfaG9yaXpvbnRhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgJiYgKGVzc2VudGlhbHMuYWN0 aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAg ICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfaW5hY3RpdmVfd2luZG93 cykpKSkKKyAgICAgICAgICAgICAgICAmJiB4IDwgdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAg ICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAgICAgICAgICAgICYmIHRhcmdl dF9nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICAgICAgJiYgZHJhd19wKQorICAgICAgICAgICAg ICBtY19lbmdpbmUgKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBo LCBURVhUX0FSRUEsCisgICAgICAgICAgICAgICAgICAgICAgICAgeCwgeF9saW1pdCwgdXBkYXRl ZF9yb3ctPnksIGhwb3MsIHZwb3MsIE1DX0hCQVIsIDEsCisgICAgICAgICAgICAgICAgICAgICAg ICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLAorICAgICAgICAgICAg ICAgICAgICAgICAgIGRlYnVnX3AgPyBkZWJ1Z19mZyA6IGVzc2VudGlhbHMuY2hfZmdbcm93X3Bv c2l0aW9uXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBIT1JJWk9OVEFMX1JVTEVSLCBkcmF3 X3AsIE5PV0hFUkUsIE5PX0NBQ0hFKTsKKyAgICAgICAgICAgIGlmIChCVUZGRVJQICh3LT5jb250 ZW50cykKKyAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisg ICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAg ICAgICAgICAgICAgICAmJiAoZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAg ICB8fCAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICFO SUxQIChCVkFSIChiLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkpKQorICAgICAgICAgICAgICAgICYm ICFmaWxsX2NvbHVtbl90cnVtcHNfcAorICAgICAgICAgICAgICAgICYmIHggPCB0ZXh0X2FyZWFf d2lkdGgKKyAgICAgICAgICAgICAgICAmJiB2cG9zICE9IHctPmN1cnNvci52cG9zCisgICAgICAg ICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0geAorICAgICAgICAgICAgICAgICYmIHRhcmdldF9n bHlwaCAhPSBOVUxMCisgICAgICAgICAgICAgICAgJiYgZHJhd19wKQorICAgICAgICAgICAgICBt Y19lbmdpbmUgKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBoLCBU RVhUX0FSRUEsCisgICAgICAgICAgICAgICAgICAgICAgICAgeCwgeF9saW1pdCwgdXBkYXRlZF9y b3ctPnksIGhwb3MsIHZwb3MsIE1DX0JBUiwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBj dXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sCisgICAgICAgICAgICAgICAg ICAgICAgICAgZGVidWdfcCA/IGRlYnVnX2ZnIDogZXNzZW50a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AqLworICAgICAgICAgIGN1cnJlbnRfcm93LT5yZWRyYXdfZnJpbmdlX2Jp dG1hcHNfcCA9IDE7CisgICAgICAgIH0KKyAgICAgIGJvb2wgdXBkYXRlZF9wID0gbWNfdXBkYXRl X3RleHRfYXJlYSAodywgZGVzaXJlZF9yb3csIHZwb3MsIGN1cnNvcl9tYXRyaXgsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMsIGRyYXdfcCk7 CisgICAgICAvKiBVcGRhdGUgdGhlIGRpc3BsYXkgb2YgdGhlIHRleHQgYXJlYS4gKi8KKyAgICAg IGlmICh1cGRhdGVkX3ApCisgICAgICAgIHsKKyAgICAgICAgICBjaGFuZ2VkX3AgPSAxOworICAg ICAgICAgIGlmIChjdXJyZW50X3Jvdy0+bW91c2VfZmFjZV9wKQorICAgICAgICAgICAgKm1vdXNl X2ZhY2Vfb3ZlcndyaXR0ZW5fcCA9IDE7CisgICAgICAgIH0KKyAgICAgIC8qIFVwZGF0ZSBkaXNw bGF5IG9mIHRoZSByaWdodCBtYXJnaW4gYXJlYSwgaWYgdGhlcmUgaXMgb25lLiAqLworICAgICAg aWYgKCFkZXNpcmVkX3Jvdy0+ZnVsbF93aWR0aF9wICYmIHctPnJpZ2h0X21hcmdpbl9jb2xzID4g MCkKKyAgICAgICAgeworICAgICAgICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAgICAgdXBkYXRl X21hcmdpbmFsX2FyZWEgKHcsIGRlc2lyZWRfcm93LCBSSUdIVF9NQVJHSU5fQVJFQSwgdnBvcyk7 CisgICAgICAgIH0KKyAgICAgIC8qIERyYXcgdHJ1bmNhdGlvbiBtYXJrcyBldGMuICovCisgICAg ICBpZiAoIWN1cnJlbnRfcm93LT5lbmFibGVkX3AKKyAgICAgICAgICB8fCBkZXNpcmVkX3Jvdy0+ eSAhPSBjdXJyZW50X3Jvdy0+eQorICAgICAgICAgIHx8IGRlc2lyZWRfcm93LT52aXN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QoreworICBib29sIGdvX29uZV9wID0gKG9sZF9tYXRyaXgu Y3Vyc29yc191c2VkW01DX0NBQ0hFXSA+IDAKKyAgICAgICAgICAgICAgICAgICB8fCBvbGRfbWF0 cml4LmN1cnNvcnNfdXNlZFtDSF9DQUNIRV0gPiAwCisgICAgICAgICAgICAgICAgICAgfHwgb2xk X21hdHJpeC5jdXJzb3JzX3VzZWRbRkNfQ0FDSEVdID4gMCk7CisgIGJvb2wgZ29fdHdvX3AgPSAo QlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgJiYgKCFOSUxQIChCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAg ICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkK KyAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRl bnRzKSwgbWNfY29uZikpKSk7CisgIGJvb2wgdXBkYXRpbmdfZnJhbWVfcCA9IGZhbHNlOworICBz dHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgaWYgKFhGUkFNRSAody0+ZnJh bWUpICE9IGYtPm1jX3VwZGF0aW5nX2ZyYW1lCisgICAgICAmJiAoZ29fb25lX3AgfHwgZ29fdHdv X3ApKQorICAgIHsKKyAgICAgIHVwZGF0aW5nX2ZyYW1lX3AgPSB0cnVlOworICAgICAgdXBkYXRl X2JlZ2luIChmKTsKKyAgICB9CisgIGlmICh3LT5waHlzX2N1cnNvcl9vbl9wCisgICAgICAmJiBn b190d29fcCkKKyAgICBlcmFzZV9waHlzX2N1cnNvciAodyk7CisgIGZvciAoaW50IHZudGggPSAw OworICAgICAgIGdvX29uZV9wCisgICAgICAgJiYgdm50aCA8IHctPm1jX21hdHJpeC52cG9zX3Vz ZWQ7CisgICAgICAgKyt2bnRoKQorICAgIHsKKyAgICAgIGZvciAoZW51bSBtY19jYWNoZV90eXBl IGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hF OworICAgICAgICAgICArK2NhY2hlX3R5cGUpCisgICAgICAgIGZvciAoaW50IG50aF8wID0gMDsK KyAgICAgICAgICAgICBtY190cmF2ZXJzZV9jYWNoZV9wIChvbGRfbWF0cml4LCBjYWNoZV90eXBl LCB2bnRoLCBudGhfMCk7CisgICAgICAgICAgICAgKytudGhfMCkKKyAgICAgICAgICB7CisgICAg ICAgICAgICBib29sIHNhbWVfcCA9IGZhbHNlOworICAgICAgICAgICAgZm9yIChpbnQgd19udGgg PSAwOyB3X250aCA8IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlw ZV07ICsrd19udGgpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzYW1lX3AgfD0g KG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGgudHlw ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgudHlwZQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgKChvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XzBdLmdseXBoLmJ5dGVwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLmJ5dGVw b3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKG9sZF9tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0ucm93X3Bvc2l0aW9uID09IEFUX1pWCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5yb3dfcG9zaXRpb24gPT0gQVRfWlYpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgfHwgKG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMF0ucm93X3Bvc2l0aW9uID09IFBPU1RfWlYKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bd19udGhdLnJvd19wb3NpdGlvbiA9PSBQT1NUX1pWKSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmICgob2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF8wXS5nbHlwaC5jaGFycG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09 IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5j aGFycG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLnJvd19wb3NpdGlvbiA9PSBBVF9aVgor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0ucm93X3Bvc2l0aW9uID09IEFUX1pWKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzBdLnJvd19wb3NpdGlvbiA9PSBQT1NUX1pWCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW3dfbnRoXS5yb3dfcG9zaXRpb24gPT0gUE9TVF9aVikpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXzBdLmdseXBoLnUudmFsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC51LnZh bAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5mYWNlX2lkCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3df bnRoXS5nbHlwaC5mYWNlX2lkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnBhZGRpbmdfcAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgucGFkZGluZ19wCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XzBdLmdseXBoLmxlZnRfYm94X2xpbmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9 PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgu bGVmdF9ib3hfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnJpZ2h0X2JveF9saW5l X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnJpZ2h0X2JveF9saW5lX3AKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMF0uZ2x5cGgudm9mZnNldAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5 cGgudm9mZnNldAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5waXhlbF93aWR0aAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVt3X250aF0uZ2x5cGgucGl4ZWxfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0u Z2x5cGguc2xpY2UuaW1nLngKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnNsaWNlLmlt Zy54CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnNsaWNlLmltZy55CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5pbWcueQorICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5z bGljZS5pbWcud2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnNsaWNlLmltZy53 aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5zbGljZS5pbWcuaGVpZ2h0CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5pbWcuaGVpZ2h0CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XzBdLmdseXBoLnNsaWNlLmNtcC5mcm9tCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09 IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5z bGljZS5jbXAuZnJvbQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS54CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3df bnRoXS54CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZ4CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5m eAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8wXS55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09 IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS55CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzBdLmZ5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5meQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS5ocG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5ocG9zCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXzBdLnZwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLnZwb3MKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMF0ud2QKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLndkCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XzBdLmgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmgKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uY3Vy c29yX3R5cGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmN1cnNvcl90eXBlCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXzBdLmN1cnNvcl93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uY3Vyc29yX3dp ZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZnLnJlZAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0u ZmcucmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZnLmdyZWVuCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3df bnRoXS5mZy5ncmVlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5mZy5ibHVlCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3dfbnRoXS5mZy5ibHVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmJnLnJlZAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVt3X250aF0uYmcucmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmJnLmdyZWVuCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW3dfbnRoXS5iZy5ncmVlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5iZy5ibHVl CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5iZy5ibHVlCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmFj dGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5hY3RpdmVfcAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8wXS5nbHlwaF9mbGF2b3IKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoX2ZsYXZvcgor ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF8wXS5lbmFibGVkX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmVu YWJsZWRfcCk7CisgICAgICAgICAgICAgICAgLyogRm9yY2UgdGhlIGZyaW5nZSBiaXRtYXBzIHRv IGFsd2F5cyBiZSByZXNldC9yZWRyYXduLiAqLworICAgICAgICAgICAgICAgIGlmIChvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmN1cnNvcl90eXBlCisgICAg ICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bd19udGhdLmN1cnNvcl90eXBlCisgICAgICAgICAgICAgICAgICAgICYmIChvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmN1cnNvcl90eXBlID09IE1D X0xFRlRfRlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAgICAgICAgfHwgb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5jdXJzb3JfdHlwZSA9PSBNQ19S SUdIVF9GUklOR0VfQklUTUFQKSkKKyAgICAgICAgICAgICAgICAgIHNhbWVfcCA9IGZhbHNlOwor ICAgICAgICAgICAgICAgIGlmIChzYW1lX3ApCisgICAgICAgICAgICAgICAgICB7CisgICAgICAg ICAgICAgICAgICAgIC8vICBmcHJpbnRmIChzdGRlcnIsICJISVQgKCVzKTogIHZwb3MgKCVkKSB8 IGhwb3MgKCVkKSB8IGNoYXIgKCVzKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgLy8gICAgICAg ICAgICAgICAgICAgKGNhY2hlX3R5cGUgPT0gTUNfQ0FDSEUpCisgICAgICAgICAgICAgICAgICAg IC8vICAgICAgICAgICAgICAgICAgICAgPyAiTUMiCisgICAgICAgICAgICAgICAgICAgIC8vICAg ICAgICAgICAgICAgICAgIDogKGNhY2hlX3R5cGUgPT0gQ0hfQ0FDSEUpCisgICAgICAgICAgICAg ICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgPyAiQ0giCisgICAgICAgICAgICAgICAgICAg IC8vICAgICAgICAgICAgICAgICAgIDogKGNhY2hlX3R5cGUgPT0gRkNfQ0FDSEUpCisgICAgICAg ICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgPyAiRkMiCisgICAgICAgICAgICAg ICAgICAgIC8vICAgICAgICAgICAgICAgICAgIDogIk5PIiwKKyAgICAgICAgICAgICAgICAgICAg Ly8gICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bd19udGhdLnZwb3MsCisgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAg ICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5ocG9z LAorICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICBtY19jaGFyX3RvX3N0 cmluZyAody0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmds eXBoLnUuY2gpKTsKKyAgICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLnNhbWVfcCA9IHRydWU7CisgICAgICAgICAgICAgICAg ICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgZWxzZQor ICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgLy8gIGZwcmludGYg KHN0ZGVyciwgIk1JU1MgKCVzKTogIHZwb3MgKCVkKSB8IGhwb3MgKCVkIHYuICVkKSB8IGNoYXIg KCVzIHYuICVzKSB8IGNhY2hlX3VzZWQgKCVkIHYuICVkKVxuIiwKKyAgICAgICAgICAgICAgICAg ICAgICAvLyAgICAgICAgICAgICAgICAgICAoY2FjaGVfdHlwZSA9PSBNQ19DQUNIRSkKKyAgICAg ICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgID8gIk1DIgorICAgICAgICAg ICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIDogKGNhY2hlX3R5cGUgPT0gQ0hfQ0FD SEUpCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICA/ICJDSCIK KyAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICA6IChjYWNoZV90eXBl ID09IEZDX0NBQ0hFKQorICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAg ICAgPyAiRkMiCisgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgOiAi Tk8iLAorICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIHctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS52cG9zLAorICAgICAgICAg ICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMF0uaHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAvLyAg ICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVt3X250aF0uaHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAg ICBtY19jaGFyX3RvX3N0cmluZyAob2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS5nbHlwaC51LmNoKSwKKyAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAg ICAgICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAody0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnUuY2gpLAorICAgICAgICAgICAgICAgICAgICAg IC8vICAgICAgICAgICAgICAgICAgIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2Nh Y2hlX3R5cGVdLAorICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV0pOworICAgICAgICAg ICAgICAgICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3df bnRoXS5zYW1lX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICB9CisgICAgICAgICAgICBpZiAoIXNhbWVfcCkKKyAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgIC8qIGBtYXRyaXhfcm93JyBpbiBgZGlzcG5ldy5jYCBjb250YWlucyB0aGUgZm9sbG93 aW5nIHRlc3RzLAorICAgICAgICAgICAgICAgIGVhc3NlcnQgKG1hdHJpeCAmJiBtYXRyaXgtPnJv d3MpOworICAgICAgICAgICAgICAgIGVhc3NlcnQgKHJvdyA+PSAwICYmIHJvdyA8IG1hdHJpeC0+ bnJvd3MpOyAqLworICAgICAgICAgICAgICAgIGJvb2wgYmFyZl9jcmFzaF9vbmUgPSAody0+Y3Vy cmVudF9tYXRyaXggJiYgdy0+Y3VycmVudF9tYXRyaXgtPnJvd3MpID8gZmFsc2UgOiB0cnVlOwor ICAgICAgICAgICAgICAgIGlmIChiYXJmX2NyYXNoX29uZSkKKyAgICAgICAgICAgICAgICAgIGNv bnRpbnVlOworICAgICAgICAgICAgICAgIGJvb2wgYmFyZl9jcmFzaF90d28gPSAodm50aCA+PSAw ICYmIHZudGggPCB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3MpID8gZmFsc2UgOiB0cnVlOworICAg ICAgICAgICAgICAgIGlmIChiYXJmX2NyYXNoX3R3bykKKyAgICAgICAgICAgICAgICAgIGNvbnRp bnVlOworICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnZudGhfcm93ID0gTUFUUklY X1JPVyAody0+Y3VycmVudF9tYXRyaXgsIHZudGgpOworICAgICAgICAgICAgICAgIGludCB4XzAg PSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLng7CisgICAg ICAgICAgICAgICAgaW50IGZ4XzAgPSBvbGRfbWF0cml4LnZwb3Nbd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dLmZnLnJlZCwKKyAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAuZ3JlZW4gPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXzBdLmZnLmdyZWVuLAorICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAg ICAgICAgIC5ibHVlID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8wXS5mZy5ibHVlfTsKKyAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9iZ18wID0g ey5yZWQgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmJn LnJlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9 IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uYmcuZ3JlZW4s CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IG9sZF9t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uYmcuYmx1ZX07CisgICAg ICAgICAgICAgICAgYm9vbCBhY3RpdmVfcF8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF8wXS5hY3RpdmVfcDsKKyAgICAgICAgICAgICAgICBlbnVtIG1jX2Zs YXZvciBnbHlwaF9mbGF2b3JfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMF0uZ2x5cGhfZmxhdm9yOworICAgICAgICAgICAgICAgIGJvb2wgZW5hYmxlZF9w XzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmVuYWJs ZWRfcDsKKyAgICAgICAgICAgICAgICBpZiAodnBvc18wID09IHZudGgKKyAgICAgICAgICAgICAg ICAgICAgJiYgZ2x5cGhfZmxhdm9yXzAgPT0gTUNfR0xZUEgKKyAgICAgICAgICAgICAgICAgICAg JiYgZW5hYmxlZF9wXzAKKyAgICAgICAgICAgICAgICAgICAgJiYgdm50aF9yb3ctPmVuYWJsZWRf cCkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbWNfZXJhc2VfY3Vy c29yICh3LCB3LT5jdXJyZW50X21hdHJpeCwgdm50aF9yb3csIHhfMCwgeV8wLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhwb3NfMCwgdnBvc18wLCBnbHlwaF9mbGF2b3Jf MCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZV8wLCB3 ZF8wKTsKKyAgICAgICAgICAgICAgICAgICAgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8wXS5lbmFibGVkX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAg LS1vbGRfbWF0cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90eXBlXTsKKyAgICAgICAgICAgICAgICAg ICAgLyogSWYgd2UgaW5hZHZlcnRlbnRseSBlcmFzZWQgYW5vdGhlciBmYWtlIGN1cnNvciBhdCB0 aGUgc2FtZQorICAgICAgICAgICAgICAgICAgICBIUE9TIHRoYXQgaXMgc3RpbGwgZW5hYmxlZF9w IGluIHRoZSBgb2xkX21hdHJpeGAsIHRoZW4gcmVkcmF3IGl0LiAqLworICAgICAgICAgICAgICAg ICAgICBmb3IgKGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7CisgICAg ICAgICAgICAgICAgICAgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICAgICAg ICAgICAgICAgICAgICsrY2FjaGVfdHlwZSkKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBudGhfMSA9IDA7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIG1jX3RyYXZlcnNlX2NhY2hlX3AgKG9sZF9tYXRyaXgsIGNhY2hlX3R5cGUs IHZudGgsIG50aF8xKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKytudGhfMSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlu dCB4XzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLng7 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZ4XzEgPSBvbGRfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmZ4OworICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGludCB5XzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXzFdLnk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZ5XzEgPSBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmZ5OworICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGludCBocG9zXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXzFdLmhwb3M7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50 IHZwb3NfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0u dnBvczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgd2RfMSA9IG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0ud2Q7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgaW50IGhfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMV0uaDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNv cl90eXBlIGN1cnNvcl90eXBlXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXzFdLmN1cnNvcl90eXBlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlu dCBjdXJzb3Jfd2lkdGhfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMV0uY3Vyc29yX3dpZHRoOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVj dCBtY19SR0IgbHNsX2ZnXzEgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMV0uZmcucmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8xXS5mZy5ncmVlbiwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0gb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5mZy5ibHVlfTsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAvLyAgc3RydWN0IG1jX1JHQiBsc2xfYmdfMSA9IHsucmVkID0gb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5iZy5yZWQsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0g b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5iZy5ncmVlbiwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAuYmx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0u YmcuYmx1ZX07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBhY3RpdmVfcF8xID0g b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5hY3RpdmVfcDsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3Jf MSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZ2x5cGhf Zmxhdm9yOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgZW5hYmxlZF9wXzEgPSBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmVuYWJsZWRfcDsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGdvX3BfMSA9IChocG9zXzAgPT0gaHBv c18xCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxl ZF9wXzEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZ29fcF8xKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgYm9vbCByZW1vdmVfcF8xID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHcsIHctPmN1cnJlbnRfbWF0cml4LCB2bnRoX3Jvdywg eF8xLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBm eF8xLCB5XzEsIGZ5XzEsIGhwb3NfMSwgdnBvc18xLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICB3ZF8xLCBoXzEsIGN1cnNvcl90eXBlXzEsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0 aF8xLCBsc2xfZmdfMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgYWN0aXZlX3BfMSwgZ2x5cGhfZmxhdm9yXzEsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZV9wXzEpOworICAgICAgICAgICAg ICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAg ICAgfQorICAgICAgICAgICAgICAgICAgZWxzZSBpZiAodnBvc18wID09IHZudGgKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIGVuYWJsZWRfcF8wCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiB2bnRoX3Jvdy0+ZW5hYmxlZF9wKQorICAgICAgICAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgICAgICAgYm9vbCByZW1vdmVfcF8wID0gdHJ1ZTsKKyAgICAgICAgICAgICAg ICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgdy0+Y3VycmVudF9tYXRyaXgsIHZudGhf cm93LCB4XzAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ4 XzAsIHlfMCwgZnlfMCwgaHBvc18wLCB2cG9zXzAsIHdkXzAsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGhfMCwgY3Vyc29yX3R5cGVfMCwgY3Vyc29yX3dpZHRo XzAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxzbF9iZ18w LCBhY3RpdmVfcF8wLCBnbHlwaF9mbGF2b3JfMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgcmVtb3ZlX3BfMCk7CisgICAgICAgICAgICAgICAgICAgICAgb2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5lbmFibGVkX3AgPSBm YWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAtLW9sZF9tYXRyaXguY3Vyc29yc191c2VkW2Nh Y2hlX3R5cGVdOworICAgICAgICAgICAgICAgICAgICAgIC8qIElmIHdlIGluYWR2ZXJ0ZW50bHkg ZXJhc2VkIGFub3RoZXIgZmFrZSBjdXJzb3IgYXQgdGhlIHNhbWUKKyAgICAgICAgICAgICAgICAg ICAgICBIUE9TIHRoYXQgaXMgc3RpbGwgZW5hYmxlZF9wIGluIHRoZSBgb2xkX21hdHJpeGAsIHRo ZW4gcmVkcmF3IGl0LiAqLworICAgICAgICAgICAgICAgICAgICAgIGZvciAoZW51bSBtY19jYWNo ZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAg IGNhY2hlX3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICsrY2Fj aGVfdHlwZSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgZm9yIChpbnQgbnRoXzIgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IG1jX3RyYXZlcnNlX2NhY2hlX3AgKG9sZF9tYXRyaXgsIGNhY2hlX3R5cGUsIHZudGgsIG50aF8y KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArK250aF8yKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB4XzIg PSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLng7CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZnhfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uZng7CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBpbnQgeV8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8yXS55OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZ5XzIgPSBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmZ5OworICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgaW50IGhwb3NfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMl0uaHBvczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGludCB2cG9zXzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XzJdLnZwb3M7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgd2RfMiA9IG9sZF9t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0ud2Q7CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBpbnQgaF8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF8yXS5oOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51 bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZV8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8yXS5jdXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGhfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMl0uY3Vyc29yX3dpZHRoOworICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmdfMiA9IHsucmVkID0gb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5mZy5yZWQsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uZmcuZ3JlZW4sCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0g b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5mZy5ibHVlfTsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBzdHJ1Y3QgbWNfUkdCIGxzbF9iZ18y ID0gey5yZWQgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJd LmJnLnJlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAg ICAgICAgICAgICAgIC5ncmVlbiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMl0uYmcuZ3JlZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMl0uYmcuYmx1ZX07CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBib29sIGFjdGl2ZV9wXzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzJdLmFjdGl2ZV9wOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yXzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzJdLmdseXBoX2ZsYXZvcjsKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGJvb2wgZW5hYmxlZF9wXzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXzJdLmVuYWJsZWRfcDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGJvb2wgZ29fcF8yID0gKGhwb3NfMCA9PSBocG9zXzIKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIGZ4XzAgPD0gZnhfMgorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZnhfMCArIHdkXzAgPiBmeF8yICsgd2Rf MgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxl ZF9wXzIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFnb19wXzIpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgYm9vbCByZW1vdmVfcF8yID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgdy0+Y3VycmVudF9tYXRyaXgsIHZu dGhfcm93LCB4XzIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgZnhfMiwgeV8yLCBmeV8yLCBocG9zXzIsIHZwb3NfMiwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ZF8yLCBoXzIsIGN1cnNvcl90 eXBlXzIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgY3Vyc29yX3dpZHRoXzIsIGxzbF9mZ18yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2ZV9wXzIsIGdseXBoX2ZsYXZvcl8yLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZV9w XzIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICB9CisgICAgICAgICAg ICB9CisgICAgfQorICBpZiAodXBkYXRpbmdfZnJhbWVfcCkKKyAgICB1cGRhdGVfZW5kIChmKTsK K30KKwordm9pZAorbWNfdXBkYXRlX3dpbmRvd19kcnlydW4gKHN0cnVjdCB3aW5kb3cgKncsIGJv b2wgZm9yY2VfcCwgc3RydWN0IG1jX2Vzc2VudGlhbHMgZXNzZW50aWFscykKK3sKKyAgaWYgKCFC VUZGRVJQICh3LT5jb250ZW50cykpCisgICAgcmV0dXJuOworCisgIGlmICh3LT5tY19tYXRyaXgu Y3Vyc29yc191c2VkW01DX0NBQ0hFXSA9PSAwCisgICAgICAmJiB3LT5tY19tYXRyaXguY3Vyc29y c191c2VkW0NIX0NBQ0hFXSA9PSAwCisgICAgICAmJiB3LT5tY19tYXRyaXguY3Vyc29yc191c2Vk W0ZDX0NBQ0hFXSA9PSAwCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j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XQgdGhlIGZpcnN0IHRpbWUgc28gdGhhdCB3ZSBjYW4gcXVpY2ts eSByZXR1cm4uICovCisgIGlmICghZm9yY2VfcCkKKyAgICBkZXRlY3RfaW5wdXRfcGVuZGluZ19p Z25vcmVfc3F1ZWV6YWJsZXMgKCk7CisKKyAgLyogSWYgZm9yY2VkIHRvIGNvbXBsZXRlIHRoZSB1 cGRhdGUsIG9yIGlmIG5vIGlucHV0IGlzIHBlbmRpbmcsIGRvIHRoZSB1cGRhdGUuICovCisgIGlm IChmb3JjZV9wIHx8ICFpbnB1dF9wZW5kaW5nIHx8ICFOSUxQIChkb19tb3VzZV90cmFja2luZykp CisgICAgeworICAgICAgc3RydWN0IGdseXBoX3JvdyAqaGVhZGVyX2xpbmVfcm93OworICAgICAg Ym9vbCBjaGFuZ2VkX3AgPSAwOworICAgICAgYm9vbCBtb3VzZV9mYWNlX292ZXJ3cml0dGVuX3Ag PSAwOworICAgICAgaW50IG5fdXBkYXRlZCA9IDA7CisgICAgICAvLyAgc3RydWN0IHJlZGlzcGxh eV9pbnRlcmZhY2UgKnJpZiA9IEZSQU1FX1JJRiAoWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKSk7 CisgICAgICAvLyAgcmlmLT51cGRhdGVfd2luZG93X2JlZ2luX2hvb2sgKHcpOworICAgICAgaW50 IHliID0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpOworICAgICAgc3RydWN0IGdseXBoX3JvdyAq cm93ID0gTUFUUklYX1JPVyAoZGVzaXJlZF9tYXRyaXgsIDApOworICAgICAgc3RydWN0IGdseXBo X3JvdyAqZW5kID0gTUFUUklYX01PREVfTElORV9ST1cgKGRlc2lyZWRfbWF0cml4KTsKKworICAg ICAgLyogVGFrZSBub3RlIG9mIHRoZSBoZWFkZXIgbGluZSwgaWYgdGhlcmUgaXMgb25lLiAgV2Ug d2lsbAorICAgICAgICAgdXBkYXRlIGl0IGJlbG93LCBhZnRlciB1cGRhdGluZyBhbGwgb2YgdGhl IHdpbmRvdydzIGxpbmVzLiAqLworICAgICAgaWYgKHJvdy0+bW9kZV9saW5lX3ApCisgICAgICAg IHsKKyAgICAgICAgICBoZWFkZXJfbGluZV9yb3cgPSByb3c7CisgICAgICAgICAgKytyb3c7Cisg ICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIGhlYWRlcl9saW5lX3JvdyA9IE5VTEw7 CisKKyAgICAgIC8qIFVwZGF0ZSB0aGUgbW9kZSBsaW5lLCBpZiBuZWNlc3NhcnkuICovCisgICAg ICBzdHJ1Y3QgZ2x5cGhfcm93ICptb2RlX2xpbmVfcm93ID0gTUFUUklYX01PREVfTElORV9ST1cg KGRlc2lyZWRfbWF0cml4KTsKKyAgICAgIGlmIChtb2RlX2xpbmVfcm93LT5tb2RlX2xpbmVfcCAm JiBtb2RlX2xpbmVfcm93LT5lbmFibGVkX3ApCisgICAgICAgIHsKKyAgICAgICAgICBtb2RlX2xp bmVfcm93LT55ID0geWIgKyBXSU5ET1dfU0NST0xMX0JBUl9BUkVBX0hFSUdIVCAodyk7CisgICAg ICAgICAgdXBkYXRlX3dpbmRvd19saW5lICh3LCBNQVRSSVhfUk9XX1ZQT1MgKG1vZGVfbGluZV9y b3csCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRl c2lyZWRfbWF0cml4KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZtb3VzZV9mYWNl X292ZXJ3cml0dGVuX3ApOworICAgICAgICB9CisKKyAgICAgIC8qIEZpbmQgZmlyc3QgZW5hYmxl ZCByb3cuICBPcHRpbWl6YXRpb25zIGluIHJlZGlzcGxheV9pbnRlcm5hbAorICAgICAgICAgbWF5 IGxlYWQgdG8gYW4gdXBkYXRlIHdpdGggb25seSBvbmUgcm93IGVuYWJsZWQuICBUaGVyZSBtYXkK KyAgICAgICAgIGJlIGFsc28gY29tcGxldGVseSBlbXB0eSBtYXRyaWNlcy4gKi8KKyAgICAgIHdo aWxlIChyb3cgPCBlbmQgJiYgIXJvdy0+ZW5hYmxlZF9wKQorICAgICAgICArK3JvdzsKKworICAg ICAgLyogVHJ5IHJldXNpbmcgcGFydCBvZiB0aGUgZGlzcGxheSBieSBjb3B5aW5nLiAqLworICAg ICAgaWYgKHJvdyA8IGVuZCAmJiAhdy0+ZGVzaXJlZF9tYXRyaXgtPm5vX3Njcm9sbGluZ19wKQor ICAgICAgICB7CisgICAgICAgICAgaW50IHJjID0gbWNfc2Nyb2xsaW5nX3dpbmRvdyAodywgaGVh ZGVyX2xpbmVfcm93ICE9IE5VTEwpOworICAgICAgICAgIGlmIChyYyA8IDApCisgICAgICAgICAg ICB7CisgICAgICAgICAgICAgIC8qIEFsbCByb3dzIHdlcmUgZm91bmQgdG8gYmUgZXF1YWwuICov CisgICAgICAgICAgICAgIHBhdXNlZF9wID0gMDsKKyAgICAgICAgICAgICAgZ290byBzZXRfY3Vy c29yOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAocmMgPiAwKQorICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogV2UndmUgc2Nyb2xsZWQgdGhlIGRpc3BsYXku ICovCisgICAgICAgICAgICAgICAgZm9yY2VfcCA9IDE7CisgICAgICAgICAgICAgICAgY2hhbmdl ZF9wID0gMTsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAvKiBQcm9jZXNzIHRo ZSBjdXJzb3Igcm93IGF0IHRoZSBvdXRzZXQgaWYgaXQgaXMgd2l0aGluIGBkZXNpcmVkX21hdHJp eGAuCisgICAgICBXaGVuIHByb2Nlc3NpbmcgYWxsIG90aGVyIHJvd3MsIHdlIHdpbGwgcXVlcnkg dGhlIGB3LT5jdXJyZW50X21hdHJpeGAgZm9yIGRhdGEKKyAgICAgIHJlbGF0aW5nIHRvIHRoZSBj dXJzb3Igcm93LiAgYG1ha2VfY3VycmVudGAgKHdpdGhpbiBgdXBkYXRlX3dpbmRvd19saW5lJykK KyAgICAg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9IG1jX3VwZGF0ZV93aW5kb3dfbGluZSAo dywgdnBvcywgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywg ZHJhd19wKTsKKyAgICAgICAgICAgICAgaWYgKE1BVFJJWF9ST1dfQk9UVE9NX1kgKHJvdykgPj0g eWIpCisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IHZwb3MgKyAxOyBpIDwgdy0+Y3VycmVu dF9tYXRyaXgtPm5yb3dzIC0gMTsgKytpKQorICAgICAgICAgICAgICAgICAgU0VUX01BVFJJWF9S T1dfRU5BQkxFRF9QICh3LT5jdXJyZW50X21hdHJpeCwgaSwgZmFsc2UpOworICAgICAgICAgICAg ICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgY3Vyc29yX21hdHJpeCA9 IHctPmN1cnJlbnRfbWF0cml4OworICAgICAgLyogVXBkYXRlIHRoZSByZXN0IG9mIHRoZSBsaW5l cy4gKi8KKyAgICAgIGZvciAoOyByb3cgPCBlbmQgJiYgKGZvcmNlX3AgfHwgIWlucHV0X3BlbmRp bmcpOyArK3JvdykKKyAgICAgICAgLyogc2Nyb2xsaW5nX3dpbmRvdyByZXNldHMgdGhlIGVuYWJs ZWRfcCBmbGFnIG9mIHRoZSByb3dzIGl0IHJldXNlcyBmcm9tCisgICAgICAgIGN1cnJlbnRfbWF0 cml4LiAqLworICAgICAgICBpZiAocm93LT5lbmFibGVkX3ApCisgICAgICAgICAgeworICAgICAg ICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgdy0+ZGVzaXJlZF9tYXRyaXgp OworICAgICAgICAgICAgLyogSWYgdGhlIGBjdXJzb3Jfcm93YCBpcyB3aXRoaW4gdGhlIGBkZXNp cmVkX21hdHJpeGAsIHRoZW4gaXQgd2FzCisgICAgICAgICAgICBwcm9jZXNzZWQgaGVyZWluYWJv dmUgYW5kIHNob3VsZCBiZSBza2lwcGVkIGF0IHRoaXMgdGltZS4gKi8KKyAgICAgICAgICAgIGlm ICh2cG9zID09IHctPmN1cnNvci52cG9zKQorICAgICAgICAgICAgY29udGludWU7CisgICAgICAg ICAgICBpbnQgaTsKKyAgICAgICAgICAgIC8qIFdlJ2xsIGhhdmUgdG8gcGxheSBhIGxpdHRsZSBi aXQgd2l0aCB3aGVuIHRvCisgICAgICAgICAgICAgICBkZXRlY3RfaW5wdXRfcGVuZGluZy4gIElm IGl0J3MgZG9uZSB0b28gb2Z0ZW4sCisgICAgICAgICAgICAgICBzY3JvbGxpbmcgbGFyZ2Ugd2lu ZG93cyB3aXRoIHJlcGVhdGVkIHNjcm9sbC11cAorICAgICAgICAgICAgICAgY29tbWFuZHMgd2ls bCB0b28gcXVpY2tseSBwYXVzZSByZWRpc3BsYXkuICovCisgICAgICAgICAgICBpZiAoIWZvcmNl X3AgJiYgKytuX3VwZGF0ZWQgJSBwcmVlbXB0X2NvdW50ID09IDApCisgICAgICAgICAgICAgIGRl dGVjdF9pbnB1dF9wZW5kaW5nX2lnbm9yZV9zcXVlZXphYmxlcyAoKTsKKyAgICAgICAgICAgIGNo YW5nZWRfcCB8PSBtY191cGRhdGVfd2luZG93X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292 ZXJ3cml0dGVuX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCBkcmF3X3ApOworICAgICAgICAgICAgLyog TWFyayBhbGwgcm93cyBiZWxvdyB0aGUgbGFzdCB2aXNpYmxlIG9uZSBpbiB0aGUgY3VycmVudAor ICAgICAgICAgICAgICAgbWF0cml4IGFzIGludmFsaWQuICBUaGlzIGlzIG5lY2Vzc2FyeSBiZWNh dXNlIG9mCisgICAgICAgICAgICAgICB2YXJpYWJsZSBsaW5lIGhlaWdodHMuICBDb25zaWRlciB0 aGUgY2FzZSBvZiB0aHJlZQorICAgICAgICAgICAgICAgc3VjY2Vzc2l2ZSByZWRpc3BsYXlzLCB3 aGVyZSB0aGUgZmlyc3QgZGlzcGxheXMgNQorICAgICAgICAgICAgICAgbGluZXMsIHRoZSBzZWNv bmQgMyBsaW5lcywgYW5kIHRoZSB0aGlyZCA1IGxpbmVzIGFnYWluLgorICAgICAgICAgICAgICAg SWYgdGhlIHNlY29uZCByZWRpc3BsYXkgd291bGRuJ3QgbWFyayByb3dzIGluIHRoZQorICAgICAg ICAgICAgICAgY3VycmVudCBtYXRyaXggaW52YWxpZCwgdGhlIHRoaXJkIHJlZGlzcGxheSBtaWdo dCBiZQorICAgICAgICAgICAgICAgdGVtcHRlZCB0byBvcHRpbWl6ZSByZWRpc3BsYXkgYmFzZWQg b24gbGluZXMgZGlzcGxheWVkCisgICAgICAgICAgICAgICBpbiB0aGUgZmlyc3QgcmVkaXNwbGF5 LiAqLworICAgICAgICAgICAgaWYgKE1BVFJJWF9ST1dfQk9UVE9NX1kgKHJvdykgPj0geWIpCisg ICAgICAgICAgICAgIGZvciAoaSA9IHZwb3MgKyAxOyBpIDwgdy0+Y3VycmVudF9tYXRyaXgtPm5y b3dzIC0gMTsgKytpKQorICAgICAgICAgICAgICAgIFNFVF9NQVRSSVhfUk9XX0VOQUJMRURfUCAo dy0+Y3VycmVudF9tYXRyaXgsIGksIGZhbHNlKTsKKyAgICAgICAgICB9CisgICAgICAvKiBXYXMg ZGlzcGxheSBwcmVlbXB0ZWQ/ICovCisgICAgICBwYXVzZWRfcCA9IHJvdyA8IGVuZDsKKyAgICAg IHNldF9jdXJzb3I6CisgICAgICAvKiBJZiB3ZSBqdW1wZWQgaGVyZSBmcm9tIGBzZXRfY3Vyc29y YCwgdGhlbiBzZXQgdGhlIGBjdXJzb3JfbWF0cml4YC4gKi8KKyAgICAgIGlmIChjdXJzb3JfbWF0 cml4ID09IE5VTEwp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lyZWRfbWF0cml4KTsK KyAgICAgICAgICBpZiAoZGVzaXJlZF9yb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgICAgIGNvbnRp bnVlOworICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKmN1cnJlbnRfcm93ID0gTUFUUklYX1JP VyAody0+Y3VycmVudF9tYXRyaXgsIHZwb3MpOworICAgICAgICAgIGVudW0gbWNfcm93X3Bvc2l0 aW9uIHJvd19wb3NpdGlvbiA9IG1jX3Jvd19wb3NpdGlvbiAodywgY3VycmVudF9yb3csIGN1cnJl bnRfcm93LCB2cG9zKTsKKyAgICAgICAgICBpZiAoY3VycmVudF9yb3ctPmVuYWJsZWRfcCkKKyAg ICAgICAgICAgIG1jX2RyYXdfcm93ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgY3VycmVudF9yb3cs IGN1cnJlbnRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICBjdXJyZW50X3Jvdy0+eCwgY3VycmVudF9yb3ctPnVzZWRbVEVYVF9BUkVBXSwgdnBvcywKKyAg ICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCByb3dfcG9z aXRpb24sIGRyYXdfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBTRVRfQ1VSU09SX09ORSk7 CisgICAgICAgIH0KKworICAgICAgbWNfcmVzdG9yZV9nbHlwaF9tYXRyaXggKHNhdmVkX2Rlc2ly ZWQsIHctPmRlc2lyZWRfbWF0cml4KTsKKyAgICAgIG1jX3Jlc3RvcmVfZ2x5cGhfbWF0cml4IChz YXZlZF9jdXJyZW50LCB3LT5jdXJyZW50X21hdHJpeCk7CisKKyAgICAgIG1jX3VwZGF0ZV93aW5k b3dfZXJhc2UgKHcsIG9sZF9tYXRyaXgpOworCisgICAgICBtY194ZnJlZV9jYWNoZV9tYXRyaXgg KHcsICZvbGRfbWF0cml4KTsKKworICAgIH0KKyAgLy8gY2xvY2tfdCBjbG9ja19lbmQgPSBjbG9j aygpOworICAvLyBkb3VibGUgY3B1X3RpbWVfdXNlZCA9ICgoZG91YmxlKSAoY2xvY2tfZW5kIC0g Y2xvY2tfc3RhcnQpKSAvIENMT0NLU19QRVJfU0VDOworICAvLyBmcHJpbnRmIChzdGRlcnIsICJt Y19zY3JvbGxpbmdfd2luZG93ICglcyk6ICBUSU1FICglZilcbiIsIG1jX3dpbmRvdyAodyksIGNw dV90aW1lX3VzZWQpOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogLyogU3RydWN0dXJlIHRvIHBhc3MgZGltZW5zaW9ucyBhcm91 bmQuICBVc2VkIGZvciBjaGFyYWN0ZXIgYm91bmRpbmcKICAgIGJveGVzLCBnbHlwaCBtYXRyaXgg ZGltZW5zaW9ucyBhbmQgYWxpa2UuICAqLwogCkBAIC0yMjQxLDYgKzQwNjUsMTYgQEAgZnJlZV93 aW5kb3dfbWF0cmljZXMgKHN0cnVjdCB3aW5kb3cgKncpCiAJICBmcmVlX2dseXBoX21hdHJpeCAo dy0+Y3VycmVudF9tYXRyaXgpOwogCSAgZnJlZV9nbHlwaF9tYXRyaXggKHctPmRlc2lyZWRfbWF0 cml4KTsKIAkgIHctPmN1cnJlbnRfbWF0cml4ID0gdy0+ZGVzaXJlZF9tYXRyaXggPSBOVUxMOwor CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisg IG1jX3hmcmVlX2NhY2hlX21hdHJpeCAodywgJnctPm1jX21hdHJpeCk7CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKIAl9CiAKICAgICAgIC8qIE5leHQgd2luZG93IG9uIHNhbWUgbGV2 ZWwuICAqLwpAQCAtMzM4Nyw2ICs1MjIxLDI2IEBAIGNoZWNrX2N1cnJlbnRfbWF0cml4X2ZsYWdz IChzdHJ1Y3Qgd2luZG93ICp3KQogc3RhdGljIGJvb2wKIHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3 aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAg ZnByaW50ZiAoc3RkZXJyLCAidXBkYXRlX3dpbmRvdyAoJXMpXG4iLCBtY193aW5kb3cgKHcpKTsK KworICBzdHJ1Y3QgbWNfZXNzZW50aWFscyBlc3NlbnRpYWxzOworICBtY19zZXRfZXNzZW50aWFs cyAodywgJmVzc2VudGlhbHMpOworCisgIG1jX3VwZGF0ZV93aW5kb3dfZHJ5cnVuICh3LCBmb3Jj ZV9wLCBlc3NlbnRpYWxzKTsKKworICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICpjdXJzb3JfbWF0cml4 ID0gTlVMTDsKKworICBib29sIGRyYXdfcCA9IHRydWU7CisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKICAgc3RydWN0IGdseXBoX21hdHJpeCAqZGVzaXJlZF9tYXRyaXggPSB3LT5kZXNp cmVkX21hdHJpeDsKICAgYm9vbCBwYXVzZWRfcDsKICAgaW50IHByZWVtcHRfY291bnQgPSBjbGlw X3RvX2JvdW5kcyAoMSwgYmF1ZF9yYXRlIC8gMjQwMCArIDEsIElOVF9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iAoZm9yY2VfcCB8fCAhaW5wdXRfcGVuZGluZyk7CisgICAgICAgKyttY19yb3cpCisg ICAgeworICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKG1jX3JvdywgZGVzaXJlZF9t YXRyaXgpOworICAgICAgaWYgKG1jX3Jvdy0+ZW5hYmxlZF9wCisgICAgICAgICAgJiYgdnBvcyA9 PSB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgeworICAgICAgICAgIGN1cnNvcl9tYXRyaXggPSBk ZXNpcmVkX21hdHJpeDsKKyAgICAgICAgICBpZiAoIWZvcmNlX3AgJiYgKytuX3VwZGF0ZWQgJSBw cmVlbXB0X2NvdW50ID09IDApCisgICAgICAgICAgICBkZXRlY3RfaW5wdXRfcGVuZGluZ19pZ25v cmVfc3F1ZWV6YWJsZXMgKCk7CisgICAgICAgICAgY2hhbmdlZF9wIHw9IChCVUZGRVJQICh3LT5j b250ZW50cykKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICghTklMUCAoQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8 fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICB8fCAhIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRl bnRzKSwgZmNfdmlzaWJsZSkpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgPyBtY191cGRhdGVf d2luZG93X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3cml0dGVuX3AsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBl c3NlbnRpYWxzLCBkcmF3X3ApCisgICAgICAgICAgICAgICAgICAgICAgIDogdXBkYXRlX3dpbmRv d19saW5lICh3LCB2cG9zLCAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wKTsKKyAgICAgICAgICBp ZiAoTUFUUklYX1JPV19CT1RUT01fWSAocm93KSA+PSB5YikKKyAgICAgICAgICAgIGZvciAoaW50 IGkgPSB2cG9zICsgMTsgaSA8IHctPmN1cnJlbnRfbWF0cml4LT5ucm93cyAtIDE7ICsraSkKKyAg ICAgICAgICAgICAgU0VUX01BVFJJWF9ST1dfRU5BQkxFRF9QICh3LT5jdXJyZW50X21hdHJpeCwg aSwgZmFsc2UpOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorCisgIGN1cnNv cl9tYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogICAgICAgLyogVXBkYXRlIHRoZSByZXN0IG9mIHRoZSBsaW5lcy4gICovCiAgICAgICBm b3IgKDsgcm93IDwgZW5kICYmIChmb3JjZV9wIHx8ICFpbnB1dF9wZW5kaW5nKTsgKytyb3cpCiAJ Lyogc2Nyb2xsaW5nX3dpbmRvdyByZXNldHMgdGhlIGVuYWJsZWRfcCBmbGFnIG9mIHRoZSByb3dz IGl0CkBAIC0zNDcxLDYgKzUzNjYsMTkgQEAgdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAq dywgYm9vbCBmb3JjZV9wKQogCWlmIChyb3ctPmVuYWJsZWRfcCkKIAkgIHsKIAkgICAgaW50IHZw b3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgZGVzaXJlZF9tYXRyaXgpOworCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICAgICAgLyog SWYgdGhlIGBjdXJzb3Jfcm93YCBpcyB3aXRoaW4gdGhlIGBkZXNpcmVkX21hdHJpeGAsIHRoZW4g aXQgd2FzCisgICAgICAgICAgcHJvY2Vzc2VkIGhlcmVpbmFib3ZlIGFuZCBzaG91bGQgYmUgc2tp cHBlZCBhdCB0aGlzIHRpbWUuICovCisgICAgICAgICAgaWYgKHZwb3MgPT0gdy0+Y3Vyc29yLnZw b3MpCisgICAgICAgICAgY29udGludWU7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK IAkgICAgaW50IGk7CiAKIAkgICAgLyogV2UnbGwgaGF2ZSB0byBwbGF5IGEgbGl0dGxlIGJpdCB3 aXRoIHdoZW4gdG8KQEAgLTM0NzksOCArNTM4NywyMSBAQCB1cGRhdGVfd2luZG93IChzdHJ1Y3Qg d2luZG93ICp3LCBib29sIGZvcmNlX3ApCiAJICAgICAgIGNvbW1hbmRzIHdpbGwgdG9vIHF1aWNr bHkgcGF1c2UgcmVkaXNwbGF5LiAgKi8KIAkgICAgaWYgKCFmb3JjZV9wICYmICsrbl91cGRhdGVk ICUgcHJlZW1wdF9jb3VudCA9PSAwKQogCSAgICAgIGRldGVjdF9pbnB1dF9wZW5kaW5nX2lnbm9y ZV9zcXVlZXphYmxlcyAoKTsKLQkgICAgY2hhbmdlZF9wIHw9IHVwZGF0ZV93aW5kb3dfbGluZSAo dywgdnBvcywKLQkJCQkJICAgICAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wKTsKKworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgICAg IGNoYW5nZWRfcCB8PSAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAg ICAgICAmJiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgISBO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKSkpCisgICAgICAg ICAgICAgICAgICAgICAgID8gbWNfdXBkYXRlX3dpbmRvd19saW5lICh3LCB2cG9zLCAmbW91c2Vf ZmFjZV9vdmVyd3JpdHRlbl9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgZHJhd19wKQorICAgICAgICAg ICAgICAgICAgICAgICA6IHVwZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywgJm1vdXNlX2ZhY2Vf b3ZlcndyaXR0ZW5fcCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCiAKIAkgICAgLyog TWFyayBhbGwgcm93cyBiZWxvdyB0aGUgbGFzdCB2aXNpYmxlIG9uZSBpbiB0aGUgY3VycmVudAog CSAgICAgICBtYXRyaXggYXMgaW52YWxpZC4gIFRoaXMgaXMgbmVjZXNzYXJ5IGJlY2F1c2Ugb2YK QEAgLTM1MDEsNiArNTQyMiw0MSBAQCB1cGRhdGVfd2luZG93IChzdHJ1Y3Qgd2luZG93ICp3LCBi b29sIGZvcmNlX3ApCiAKICAgICBzZXRfY3Vyc29yOgogCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8qIElmIHdlIGp1bXBlZCBoZXJlIGZ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3RydWN0IGdseXBoX3JvdyAqcm93ID0gdy0+ Y3VycmVudF9tYXRyaXgtPnJvd3MgKyBpOworICAgICAgaWYgKCFyb3ctPmVuYWJsZWRfcCkKKyAg ICAgICAgYnJlYWs7CisgICAgICAgIGVsc2UgaWYgKHJvdy0+bW9kZV9saW5lX3ApCisgICAgICAg ICAgY29udGludWU7CisgICAgICBpZiAocm93LT5vdmVybGFwcGVkX3ApCisgICAgICAgIHsKKyAg ICAgICAgICBmb3IgKGVudW0gZ2x5cGhfcm93X2FyZWEgYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7 IGFyZWEgPCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg b3V0cHV0X2N1cnNvcl90byAodywgaSwgMCwgcm93LT55LCBhcmVhID09IFRFWFRfQVJFQSA/IHJv dy0+eCA6IDApOworICAgICAgICAgICAgICBpZiAoIW1jX3JlZHJhd19yb3cgKHcsIHctPmN1cnJl bnRfbWF0cml4LCByb3csIGFyZWEsIHJvdy0+eCwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICByb3ctPnVzZWRbYXJlYV0sIHRydWUsIERSQVdfTk9STUFMX1RFWFQsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVVBEQVRFX1dJTkRPV19fUkVEUkFXX09WRVJM QVBQRURfUk9XUykKKyAgICAgICAgICAgICAgICAgICYmIHJvdy0+dXNlZFthcmVhXSkKKyAgICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBGUkFNRV9SSUYgKGYpLT53cml0ZV9nbHlw aHMgKHcsIHJvdywgcm93LT5nbHlwaHNbYXJlYV0sIGFyZWEsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvdy0+dXNlZFthcmVhXSk7CisgICAgICAgICAg ICAgICAgICBGUkFNRV9SSUYgKGYpLT5jbGVhcl9lbmRfb2ZfbGluZSAodywgcm93LCBhcmVhLCAt MSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgIHJvdy0+b3Zl cmxhcHBlZF9wID0gMDsKKyAgICAgICAgfQorICAgICAgaWYgKE1BVFJJWF9ST1dfQk9UVE9NX1kg KHJvdykgPj0geWIpCisgICAgICAgIGJyZWFrOworICAgIH0KKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogCSAgICAgIHJlZHJhd19vdmVybGFwcGluZ19yb3dzICh3LCB5Yik7CiAJICAg IH0KICNlbmRpZgpAQCAtMzUzNiw4ICs1NTM0LDIwIEBAIHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3 aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkKICNlbmRpZgogCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lT VEVNCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKyAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgJiYgIU5JTFAgKEJWQVIgKFhC VUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgIG1jX3VwZGF0ZV93aW5kb3df ZnJpbmdlcyAodywgMCk7CisgICAgZWxzZQogICAgICAgdXBkYXRlX3dpbmRvd19mcmluZ2VzICh3 LCAwKTsKIAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgLyogRW5kIHRoZSB1 cGRhdGUgb2Ygd2luZG93IFcuICBEb24ndCBzZXQgdGhlIGN1cnNvciBpZiB3ZQogICAgICAgICAg cGF1c2VkIHVwZGF0aW5nIHRoZSB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KyAgICAgICJ4Li4uLi4uLiIKKyAgICAgICJ4Li4uLi4uLiIK KyAgICAgICJ4Li4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3ZlcnRpY2Fs X2Jhcl9yaWdodF9hcnJvd19iaXRzW10gPXsKKyAgMHg4MCwgMHg4MCwgMHg4MCwgMHg5OCwgMHg4 YywgMHg4NiwgMHhiZiwKKyAgMHhiZiwgMHg4NiwgMHg4YywgMHg5OCwgMHg4MCwgMHg4MCwgMHg4 MH07CisKKy8qIDI1CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4u Li4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi54eC4u Lnh4IgorICAgICAgIi4ueHguLnh4IgorICAgICAgIi4uLnh4Lnh4IgorICAgICAgInh4eHh4eHh4 IgorICAgICAgInh4eHh4eHh4IgorICAgICAgIi4uLnh4Lnh4IgorICAgICAgIi4ueHguLnh4Igor ICAgICAgIi54eC4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAg ICAgIi4uLi4uLnh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcmV2ZXJzZWRfdmVy dGljYWxfYmFyX3JpZ2h0X2Fycm93X2JpdHNbXSA9eworICAweDMsIDB4MywgMHgzLCAweDYzLCAw eDMzLCAweDFiLCAweGZmLCAweGZmLCAweDFiLCAweDMzLCAweDYzLCAweDMsIDB4MywgMHgzfTsK KworLyogMjYKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHh4eHh4 eHgiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4ueHguLngi CisgICAgICAieC4uLnh4LngiCisgICAgICAieC4uLi54eHgiCisgICAgICAieC54eHh4eHgiCisg ICAgICAieC54eHh4eHgiCisgICAgICAieC4uLi54eHgiCisgICAgICAieC4uLnh4LngiCisgICAg ICAieC4ueHguLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAi eHh4eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19ob2xsb3dfcmVjdGFuZ2xl X3JpZ2h0X2Fycm93X2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweDk5LCAweDhkLCAw eDg3LCAweGJmLAorICAweGJmLCAweDg3LCAweDhkLCAweDk5LCAweDgxLCAweDgxLCAweGZmfTsK KworLyogMjcKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHh4eHh4 eHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieC54eC4ueHgi CisgICAgICAieC4ueHgueHgiCisgICAgICAieC4uLnh4eHgiCisgICAgICAieHh4eHh4eHgiCisg ICAgICAieHh4eHh4eHgiCisgICAgICAieC4uLnh4eHgiCisgICAgICAieC4ueHgueHgiCisgICAg ICAieC54eC4ueHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAi eHh4eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19yZXZlcnNlZF9ob2xsb3df cmVjdGFuZ2xlX3JpZ2h0X2Fycm93X2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweGIx LCAweDk5LCAweDhkLCAweGZmLAorICAweGZmLCAweDhkLCAweDk5LCAweGIxLCAweDgxLCAweDgx LCAweGZmfTsKKworLyogMjgKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAg ICAieHh4eHh4eHgiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAi eC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4u Li4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4u LngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngi CisgICAgICAieHh4eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19ob2xsb3df cmVjdGFuZ2xlX2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgx LCAweDgxLAorICAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweGZmfTsKKwor LyogMjkKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC4uLi4uLi4i CisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisg ICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAg ICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAi eC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4u Li4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY192ZXJ0aWNhbF9iYXJfYml0c1td ID17CisgIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsCisgIDB4ODAs IDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODB9OworCisvKiAzMAorICAgICgrLWZy aW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54 eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIK KyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAg ICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAg ICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIpCisqLworc3Rh dGljIHVuc2lnbmVkIHNob3J0IG1jX3JldmVyc2VkX3ZlcnRpY2FsX2Jhcl9iaXRzW10gPXsKKyAg MHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4 MywgMHgzLCAweDN9OworCisvKiAzMQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwK KyAgICAgICJ4eC4uLi4uLiIKKyAgICAgICJ4eC4uLi4uLiIKKyAgICAgICIgeHguLi4uLiIKKyAg ICAgICIueHguLi4uLiIKKyAgICAgICIuLnh4Li4uLiIKKyAgICAgICIuLnh4Li4uLiIKKyAgICAg ICIuLi54eC4uLiIKKyAgICAgICIuLi54eC4uLiIKKyAgICAgICIuLi4ueHguLiIKKyAgICAgICIu Li4ueHguLiIKKyAgICAgICIuLi4uLnh4LiIKKyAgICAgICIuLi4uLnh4LiIKKyAgICAgICIuLi4u Li54eCIKKyAgICAgICIuLi4uLi54eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX2Jh Y2tzbGFzaF9iaXRzW10gPXsKKyAgMHhjMCwgMHhjMCwgMHhlMCwgMHg2MCwgMHgzMCwgMHgzMCwg MHgxOCwgMHgxOCwgMHhjLCAweGMsIDB4NiwgMHg2LCAweDMsIDB4M307CisKKy8qIDMyCisgICAg KCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Li4uLi4uIgorICAgICAgInh4 Li4uLi4uIgorICAgICAgInh4eC4uLi4uIgorICAgICAgInh4eC4uLi4uIgorICAgICAgIngueHgu Li4uIgorICAgICAgIngueHguLi4uIgorICAgICAgInguLnh4Li4uIgorICAgICAgInguLnh4Li4u IgorICAgICAgInguLi54eC4uIgorICAgICAgInguLi54eC4uIgorICAgICAgInguLi4ueHguIgor ICAgICAgInguLi4ueHguIgorICAgICAgInguLi4uLnh4IgorICAgICAgInguLi4uLnh4IikKKyov CitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdmVydGljYWxfYmFyX2JhY2tzbGFzaF9iaXRzW10g PXsKKyAgMHhjMCwgMHhjMCwgMHhlMCwgMHhlMCwgMHhiMCwgMHhiMCwgMHg5OCwKKyAgMHg5OCwg MHg4YywgMHg4YywgMHg4NiwgMHg4NiwgMHg4MywgMHg4M307CisKKy8qIDMzCisgICAgKCstZnJp bmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi54eHh4eHguIgorICAgICAgInh4eHgueC4u IgorICAgICAgInh4eHgueC4uIgorICAgICAgInh4eHgueC4uIgorICAgICAgIi54eHgueC4uIgor ICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAg ICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIikKKyovCitz dGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcGlsY3Jvd19iaXRzW10gPXsKKyAgMHg3ZSwgMHhmNCwg MHhmNCwgMHhmNCwgMHg3NCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNH07CisK Ky8qIDM0CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4ueHh4eC4u IgorICAgICAgIi54eHh4eHguIgorICAgICAgInguLnh4Li54IgorICAgICAgInguLnh4Li54Igor ICAgICAgInh4eHh4eHh4IgorICAgICAgInh4Li4uLnh4IgorICAgICAgInh4eC4ueHh4IgorICAg ICAgIi54eHh4eHguIgorICAgICAgIi4ueHh4eC4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hv cnQgbWNfc21pbGV5X2ZhY2VfYml0c1tdID17CisgIDB4M2MsIDB4N2UsIDB4OTksIDB4OTksIDB4 ZmYsIDB4YzMsIDB4ZTcsIDB4N2UsIDB4M2N9OworCisvKiAzNQorICAgICgrLWZyaW5nZS1oZWxw ZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLnguLi4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAg ICIuLi4ueC4uLiIKKyAgICAgICIuLi4uLnguLiIKKyAgICAgICIuLi4ueC4uLiIKKyAgICAgICIu Li54Li4uLiIKKyAgICAgICIuLnguLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1j X3NpbmdsZV9hbmdsZV9yaWdodF9iaXRzW10gPXsKKyAgMHgyMCwgMHgxMCwgMHg4LCAweDQsIDB4 OCwgMHgxMCwgMHgyMH07CisKKy8qIDM2CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1h bAorICAgICAgIi4uLi4ueC4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4uLnguLi4uIgor ICAgICAgIi4ueC4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4uLi54Li4uIgorICAg ICAgIi4uLi4ueC4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xl X2xlZnRfYml0c1tdID17CisgIDB4NCwgMHg4LCAweDEwLCAweDIwLCAweDEwLCAweDgsIDB4NH07 CisKKy8qIDM3CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Lnh4 Li4uIgorICAgICAgIi54eC54eC4uIgorICAgICAgIi4ueHgueHguIgorICAgICAgIi4uLnh4Lnh4 IgorICAgICAgIi4ueHgueHguIgorICAgICAgIi54eC54eC4uIgorICAgICAgInh4Lnh4Li4uIikK KyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xlX3JpZ2h0X2JpdHNbXSA9 eworICAweGQ4LCAweDZjLCAweDM2LCAweDFiLCAweDM2LCAweDZjLCAweGQ4fTsKKworLyogMzgK KyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4ueHgueHgiCisgICAg ICAiLi54eC54eC4iCisgICAgICAiLnh4Lnh4Li4iCisgICAgICAieHgueHguLi4iCisgICAgICAi Lnh4Lnh4Li4iCisgICAgICAiLi54eC54eC4iCisgICAgICAiLi4ueHgueHgiKQorKi8KK3N0YXRp YyB1bnNpZ25lZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfbGVmdF9iaXRzW10gPXsKKyAgMHgxYiwg MHgzNiwgMHg2YywgMHhkOCwgMHg2YywgMHgzNiwgMHgxYn07CisKKy8qIDM5CisgICAgKCstZnJp bmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIngueC54Li4uIgorICAgICAgIi54LngueC4u IgorICAgICAgIi4ueC54LnguIgorICAgICAgIi4uLngueC54IgorICAgICAgIi4ueC54LnguIgor ICAgICAgIi54LngueC4uIgorICAgICAgIngueC54Li4uIikKKyovCitzdGF0aWMgdW5zaWduZWQg c2hvcnQgbWNfdHJpcGxlX2FuZ2xlX3JpZ2h0X2JpdHNbXSA9eworICAweGE4LCAweDU0LCAweDJh LCAweDE1LCAweDJhLCAweDU0LCAweGE4fTsKKworLyogNDAKKyAgICAoKy1mcmluZ2UtaGVscGVy LWhleGFkZWNpbWFsCisgICAgICAiLi4ueC54LngiCisgICAgICAiLi54LngueC4iCisgICAgICAi LngueC54Li4iCisgICAgICAieC54LnguLi4iCisgICAgICAiLngueC54Li4iCisgICAgICAiLi54 LngueC4iCisgICAgICAiLi4ueC54LngiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190 cmlwbGVfYW5nbGVfbGVmdF9iaXRzW10gPXsKKyAgMHgxNSwgMHgyYSwgMHg1NCwgMHhhOCwgMHg1 NCwgMHgyYSwgMHgxNX07CisKKy8qIDQxCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1h bAorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgor ICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54Li4uIgorICAg ICAgIi54Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAgICAgIi4uLi4uLi4uIgorICAgICAg Ii4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIikKKyovCitzdGF0 aWMgdW5zaWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDAwLCAw eDAwLCAweDAwLCAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDgyLCAweDAwLCAweDAwLCAweDAw LCAweDAwfTsKKworLyogNDIKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAg ICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAi Li4uLi4uLi4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54 LnguLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4u Li4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNp Z25lZCBzaG9ydCBtY19zaW5nbGVfYW5nbGVfZG93bl9iaXRzW10gPXsKKyAgMHgwMCwgMHgwMCwg MHgwMCwgMHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHgxMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgw MH07CisKKy8qIDQzCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4u Li4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLngu Li4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLngu IgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLi4uLnguIgor ICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIikKKyov CitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAw eDAwLCAweDAwLCAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDgy LCAweDAwLCAweDAwLCAweDAwfTsKKworLyogNDQKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFk ZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4u Li4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4i CisgICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisg ICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAg ICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19kb3VibGVfYW5nbGVf ZG93bl9iaXRzW10gPXsKKyAgMHgwMCwgMHgwMCwgMHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHg5 MiwgMHg0NCwgMHgyOCwgMHgxMCwgMHgwMCwgMHgwMCwgMHgwMH07CisKKy8qIDQ1CisgICAgKCst ZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLngu Li4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLngu IgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgor ICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAg ICAgIi4uLi4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdHJpcGxlX2FuZ2xl X3VwX2JpdHNbXSA9eworICAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0 LCAweDkyLCAweDI4LCAweDQ0LCAweDgyLCAweDAwfTsKKworLyogNDYKKyAgICAoKy1mcmluZ2Ut aGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAieC4uLi4ueC4iCisg ICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAg ICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAi LnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4u Li4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19xdWFkcnVwbGVfYW5nbGVfZG93 bl9iaXRzW10gPXsKKyAgMHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwg MHg5MiwgMHg0NCwgMHgyOCwgMHgxMCwgMHgwMH07CisKKy8qIDQ3CisgICAgKCstZnJpbmdlLWhl bHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54Li4uIgorICAg ICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAg Ii54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54 Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4u eC4uIgorICAgICAgInguLi4uLnguIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcXVh ZHJ1cGxlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4 LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDgyfTsKKworLyog NDgKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC4uLi4ueC4iCisg ICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAg ICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAi LnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLngu Li54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLi4ueC4uLi4iKQorKi8KK3N0YXRpYyB1 bnNpZ25lZCBzaG9ydCBtY190cmlwbGVfYW5nbGVfZG93bl9iaXRzW10gPXsKKyAgMHg4MiwgMHg0 NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwg MHgyOCwgMHgxMH07CisKIC8qIE5PVEU6ICBUaGUgb3JkZXIgb2YgdGhlc2UgYml0bWFwcyBtdXN0 IG1hdGNoIHRoZSBzZXF1ZW5jZQogICAgdXNlZCBpbiBmcmluZ2UuZWwgdG8gZGVmaW5lIHRoZSBj b3JyZXNwb25kaW5nIHN5bWJvbHMuICAqLwogCkBAIC00NjYsOCArOTIwLDEwNzIgQEAgc3RhdGlj IHN0cnVjdCBmcmluZ2VfYml0bWFwIHN0YW5kYXJkX2JpdG1hcHNbXSA9CiAgIHsgRlJCSVRTICh2 ZX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X09iamVjdCBjbWFwLCBi bTEgPSBRbmlsLCBibTIgPSBRbmlsLCBibTsKKyAgRU1BQ1NfSU5UIGxuMSA9IDAsIGxuMiA9IDA7 CisgIGludCBpeDEgPSByaWdodF9wOworICBpbnQgaXgyID0gaXgxICsgKHBhcnRpYWxfcCA/IDIg OiAwKTsKKyAgaWYgKChjbWFwID0gQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmcmluZ2Vf aW5kaWNhdG9yX2FsaXN0KSksICFOSUxQIChjbWFwKSkKKyAgICB7CisgICAgICBibTEgPSBtY19h c3NxIChiaXRtYXAsIGNtYXApOworICAgICAgaWYgKENPTlNQIChibTEpKQorICB7CisgICAgaWYg KChibTEgPSBYQ0RSIChibTEpKSwgTklMUCAoYm0xKSkKKyAgICAgIHJldHVybiBNQ19OT19GUklO R0VfQklUTUFQOworICAgIGlmIChDT05TUCAoYm0xKSkKKyAgICAgIHsKKyAgICAgICAgbG4xID0g WEZJWE5VTSAoRmxlbmd0aCAoYm0xKSk7CisgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgICAg ICAgeworICAgICAgICAgICAgaWYgKGxuMSA+IGl4MikKKyAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMSk7CisgICAgICAgICAgICAgICAgaWYgKCFF USAoYm0sIFF0KSkKKyAgICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICAg IH0KKyAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAg ICAgICBpZiAobG4xID4gaXgxKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAg IGJtID0gbWNfbnRoIChpeDEsIGJtMSk7CisgICAgICAgICAgICAgICAgICBpZiAoIUVRIChibSwg UXQpKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5kOworICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgIH0KKyAgICAgIH0KKyAgICBlbHNlIGlmICgoYm0gPSBibTEsICFFUSAoYm0s IFF0KSkpCisgICAgICBnb3RvIGZvdW5kOworICB9CisgICAgfQorICBpZiAoIUVRIChjbWFwLCBC VkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkKKyAgICAgICYm ICFOSUxQIChCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkp CisgICAgeworICAgICAgYm0yID0gbWNfYXNzcSAoYml0bWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1 bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSk7CisgICAgICBpZiAoQ09OU1AgKGJtMikpCisg ICAgICAgIHsKKyAgICAgICAgICBpZiAoKGJtMiA9IFhDRFIgKGJtMikpLCAhTklMUCAoYm0yKSkK KyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKENPTlNQIChibTIpKQorICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGxuMiA9IFhGSVhOVU0gKEZsZW5ndGggKGJtMikp OworICAgICAgICAgICAgICAgICAgaWYgKHBhcnRpYWxfcCkKKyAgICAgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgICAgIGlmIChsbjIgPiBpeDIpCisgICAgICAgICAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJt Mik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAg IH0KKyAgICAgICAgfQorICAgIH0KKyAgaWYgKGxuMSA+IGl4MSkKKyAgICB7CisgICAgICBibSA9 IG1jX250aCAoaXgxLCBibTEpOworICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAgZ290 byBmb3VuZDsKKyAgICB9CisgIGlmIChsbjIgPiBpeDEpCisgICAgeworICAgICAgYm0gPSBtY19u dGggKGl4MSwgYm0yKTsKKyAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgIGdvdG8gZm91 bmQ7CisgICAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICB9CisgICAgZWxzZSBp ZiAoKGJtID0gYm0yLCBOSUxQIChibSkpKQorICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRN QVA7CisgIGZvdW5kOgorICByZXR1cm4gbG9va3VwX2ZyaW5nZV9iaXRtYXAgKGJtKTsKK30KKwor c3RhdGljIGludAorbWNfZ2V0X2xvZ2ljYWxfY3Vyc29yX2JpdG1hcCAoc3RydWN0IHdpbmRvdyAq dywgTGlzcF9PYmplY3QgY3Vyc29yKQoreworICBMaXNwX09iamVjdCBjbWFwLCBibSA9IFFuaWw7 CisgIGlmICgoY21hcCA9IEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZnJpbmdlX2N1cnNv cl9hbGlzdCkpLCAhTklMUCAoY21hcCkpCisgICAgeworICAgICAgYm0gPSBtY19hc3NxIChjdXJz b3IsIGNtYXApOworICAgICAgaWYgKENPTlNQIChibSkpCisgICAgICAgIHsKKyAgICAgICAgICBp ZiAoKGJtID0gWENEUiAoYm0pKSwgTklMUCAoYm0pKQorICAgICAgICAgICAgcmV0dXJuIE1DX05P X0ZSSU5HRV9CSVRNQVA7CisgICAgICAgICAgcmV0dXJuIGxvb2t1cF9mcmluZ2VfYml0bWFwIChi bSk7CisgICAgICAgIH0KKyAgICB9CisgIGlmIChFUSAoY21hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZh dWx0cywgZnJpbmdlX2N1cnNvcl9hbGlzdCkpKQorICAgIHJldHVybiB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aXRtYXAgaW4gZGVmYXVsdCB2YWx1ZSBpZiBub3QgZm91bmQgaGVyZS4KKyAg ICAgSWYgbm90IHBhcnRpYWwsIG9yIG5vIHBhcnRpYWwgc3BlYyBpcyBwcmVzZW50LCB1c2Ugbm9u LXBhcnRpYWwgYml0bWFwLiAgKi8KKyAgaWYgKChjbWFwID0gQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSksICFOSUxQIChjbWFwKSkKKyAgICB7Cisg ICAgICBibTEgPSBtY19hc3NxIChiaXRtYXAsIGNtYXApOworICAgICAgaWYgKENPTlNQIChibTEp KQorICAgICAgICB7CisgICAgICAgICAgaWYgKChibTEgPSBYQ0RSIChibTEpKSwgTklMUCAoYm0x KSkKKyAgICAgICAgICAgIHJldHVybiBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgIGlm IChDT05TUCAoYm0xKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbG4xID0gWEZJWE5V TSAoRmxlbmd0aCAoYm0xKSk7CisgICAgICAgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgICAgaWYgKGxuMSA+IGl4MikKKyAgICAgICAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMSk7 CisgICAgICAgICAgICAgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAgICAgICAg ICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAg ICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgICBpZiAobG4xID4gaXgxKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAgICAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMSk7CisgICAgICAgICAg ICAgICAgICAgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgICAgICAgICAgICAgICAgICAg ICBnb3RvIGZvdW5kOworICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKChibSA9IGJtMSwgIUVRIChi bSwgUXQpKSkKKyAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgfQorICAgIH0KKyAg aWYgKCFFUSAoY21hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRvcl9h bGlzdCkpCisgICAgICAmJiAhTklMUCAoQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2lu ZGljYXRvcl9hbGlzdCkpKQorICAgIHsKKyAgICAgIGJtMiA9IG1jX2Fzc3EgKGJpdG1hcCwgQlZB UiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpOworICAgICAgaWYg KENPTlNQIChibTIpKQorICAgICAgICB7CisgICAgICAgICAgaWYgKChibTIgPSBYQ0RSIChibTIp KSwgIU5JTFAgKGJtMikpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmIChDT05TUCAo Ym0yKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBsbjIgPSBYRklYTlVN IChGbGVuZ3RoIChibTIpKTsKKyAgICAgICAgICAgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAg ICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBpZiAobG4yID4gaXgyKQor ICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICBibSA9 IG1jX250aCAoaXgyLCBibTIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIUVRIChi bSwgUXQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAg ICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAg ICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIGlmIChsbjEgPiBpeDEpCisg ICAgeworICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0xKTsKKyAgICAgIGlmICghRVEgKGJtLCBR dCkpCisgICAgICAgIGdvdG8gZm91bmQ7CisgICAgfQorICBpZiAobG4yID4gaXgxKQorICAgIHsK KyAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMik7CisgICAgICBpZiAoIUVRIChibSwgUXQpKQor ICAgICAgICBnb3RvIGZvdW5kOworICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7Cisg ICAgfQorICAgIGVsc2UgaWYgKChibSA9IGJtMiwgTklMUCAoYm0pKSkKKyAgICAgIHJldHVybiBN Q19OT19GUklOR0VfQklUTUFQOworICBmb3VuZDoKKyAgcmV0dXJuIGxvb2t1cF9mcmluZ2VfYml0 bWFwIChibSk7Cit9CisKKy8qIFJlY2FsY3VsYXRlIHRoZSBiaXRtYXBzIHRvIHNob3cgaW4gdGhl IGZyaW5nZXMgb2Ygd2luZG93IFcuCisgICBPbmx5IG1hcmsgcm93cyB3aXRoIG1vZGlmaWVkIGJp dG1hcHMgZm9yIHVwZGF0ZSBpbiByZWRyYXdfZnJpbmdlX2JpdG1hcHNfcC4KKyAgIElmIEtFRVBf Q1VSUkVOVF9QIGlzIDAsIHVwZGF0ZSBjdXJyZW50X21hdHJpeCB0b28uICovCitib29sCittY191 cGRhdGVfd2luZG93X2ZyaW5nZXMgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wga2VlcF9jdXJyZW50 X3ApCit7CisgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgKmN1ciA9IDA7CisgIGludCB5YiA9IHdp bmRvd190ZXh0X2JvdHRvbV95ICh3K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J1ZmZl cl9ib3VuZGFyaWVzKSwgIU5JTFAgKGluZCkpKQorICAgIHsKKyAgICAgIGlmIChFUSAoaW5kLCBR bGVmdCkgfHwgRVEgKGluZCwgUXJpZ2h0KSkKKyAgICAgICAgYm91bmRhcnlfdG9wID0gYm91bmRh cnlfYm90ID0gYXJyb3dfdG9wID0gYXJyb3dfYm90ID0gaW5kOworICAgICAgICBlbHNlIGlmIChD T05TUCAoaW5kKQorICAgICAgICAgICAgICAgICAmJiBDT05TUCAoWENBUiAoaW5kKSkpCisgICAg ICAgIHsKKyAgICAgICAgICBMaXNwX09iamVjdCBwb3M7CisgICAgICAgICAgaWYgKHBvcyA9IG1j X2Fzc3EgKFF0LCBpbmQpLCAhTklMUCAocG9zKSkKKyAgICAgICAgICAgIGJvdW5kYXJ5X3RvcCA9 IGJvdW5kYXJ5X2JvdCA9IGFycm93X3RvcCA9IGFycm93X2JvdCA9IFhDRFIgKHBvcyk7CisgICAg ICAgICAgaWYgKHBvcyA9IG1jX2Fzc3EgKFF0b3AsIGluZCksICFOSUxQIChwb3MpKQorICAgICAg ICAgICAgYm91bmRhcnlfdG9wID0gWENEUiAocG9zKTsKKyAgICAgICAgICBpZiAocG9zID0gbWNf YXNzcSAoUWJvdHRvbSwgaW5kKSwgIU5JTFAgKHBvcykpCisgICAgICAgICAgICBib3VuZGFyeV9i b3QgPSBYQ0RSIChwb3MpOworICAgICAgICAgIGlmIChwb3MgPSBtY19hc3NxIChRdXAsIGluZCks ICFOSUxQIChwb3MpKQorICAgICAgICAgICAgYXJyb3dfdG9wID0gWENEUiAocG9zKTsKKyAgICAg ICAgICBpZiAocG9zID0gbWNfYXNzcSAoUWRvd24sIGluZCksICFOSUxQIChwb3MpKQorICAgICAg ICAgICAgYXJyb3dfYm90ID0gWENEUiAocG9zKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisg ICAgICAgICAgLyogQW55dGhpbmcgZWxzZSBtZWFucyBib3VuZGFyeSBvbiBsZWZ0IGFuZCBubyBh cnJvd3MuICAqLworICAgICAgICAgIGJvdW5kYXJ5X3RvcCA9IGJvdW5kYXJ5X2JvdCA9IFFsZWZ0 OworICAgIH0KKyAgdG9wX2luZF9ybiA9IGJvdF9pbmRfcm4gPSAtMTsKKyAgaWYgKCFOSUxQIChp bmQpKQorICAgIHsKKyAgICAgIGZvciAoeSA9IHctPnZzY3JvbGwsIHJuID0gMDsKKyAgICAgICAg ICAgeSA8IHliICYmIHJuIDwgbnJvd3M7CisgICAgICAgICAgIHkgKz0gcm93LT5oZWlnaHQsICsr cm4pCisgICAgICAgIHsKKyAgICAgICAgICByb3cgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyAr IHJuOworICAgICAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgICAgICAgICByb3cgPSB3 LT5jdXJyZW50X21hdHJpeC0+cm93cyArIHJuOworICAgICAgICAgIHJvdy0+aW5kaWNhdGVfYm9i X3AgPSByb3ctPmluZGljYXRlX3RvcF9saW5lX3AgPSAwOworICAgICAgICAgIHJvdy0+aW5kaWNh dGVfZW9iX3AgPSByb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3AgPSAwOworICAgICAgICAgIGlm ICghcm93LT5tb2RlX2xpbmVfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKHRv cF9pbmRfcm4gPCAwICYmIHJvdy0+dmlzaWJsZV9oZWlnaHQgPiAwKQorICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgIGlmIChNQVRSSVhfUk9XX1NUQVJUX0NIQVJQT1MgKHJvdykg PD0gQlVGX0JFR1YgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSkKKyAgICAgICAgICAgICAgICAgICAg ICAmJiAhTUFUUklYX1JPV19QQVJUSUFMTFlfVklTSUJMRV9BVF9UT1BfUCAodywgcm93KSkKKyAg ICAgICAgICAgICAgICAgICAgcm93LT5pbmRpY2F0ZV9ib2JfcCA9ICFOSUxQIChib3VuZGFyeV90 b3ApOworICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgcm93 LT5pbmRpY2F0ZV90b3BfbGluZV9wID0gIU5JTFAgKGFycm93X3RvcCk7CisgICAgICAgICAgICAg ICAgICB0b3BfaW5kX3JuID0gcm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBp ZiAoYm90X2luZF9ybiA8IDApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg aWYgKE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgPj0gQlVGX1pWIChYQlVGRkVSICh3LT5j b250ZW50cykpCisgICAgICAgICAgICAgICAgICAgICAgJiYgIU1BVFJJWF9ST1dfUEFSVElBTExZ X1ZJU0lCTEVfQVRfQk9UVE9NX1AgKHcsIHJvdykpCisgICAgICAgICAgICAgICAgICAgIHJvdy0+ aW5kaWNhdGVfZW9iX3AgPSAhTklMUCAoYm91bmRhcnlfYm90KSwgYm90X2luZF9ybiA9IHJuOwor ICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICh5ICsgcm93LT5oZWlnaHQgPj0geWIpCisgICAg ICAgICAgICAgICAgICAgICAgcm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wID0gIU5JTFAgKGFy cm93X2JvdCksIGJvdF9pbmRfcm4gPSBybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAg ICB9CisgICAgICAgIH0KKyAgICB9CisgIGVtcHR5X3BvcyA9IEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgaW5kaWNhdGVfZW1wdHlfbGluZXMpOworICBpZiAoIU5JTFAgKGVtcHR5X3Bvcykg JiYgIUVRIChlbXB0eV9wb3MsIFFyaWdodCkpCisgICAgZW1wdHlfcG9zID0gV0lORE9XX0xFRlRf RlJJTkdFX1dJRFRIICh3KSA9PSAwID8gUXJpZ2h0IDogUWxlZnQ7CisgIGZvciAoeSA9IDA7IHkg PCBNQVhfQklUTUF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peC0+cm93cyArIHRvcF9pbmRfcm47CisgICAg ICBpZiAoIXJvdy0+ZW5hYmxlZF9wKQorICAgICAgICByb3cgPSB3LT5jdXJyZW50X21hdHJpeC0+ cm93cyArIHRvcF9pbmRfcm47CisgICAgICB0b3Bfcm93X2VuZHNfYXRfenZfcCA9IHJvdy0+ZW5k c19hdF96dl9wOworICAgICAgaWYgKHJvdy0+aW5kaWNhdGVfYm9iX3ApCisgICAgICAgIHsKKyAg ICAgICAgICBpZiAoRVEgKGJvdW5kYXJ5X3RvcCwgUWxlZnQpKQorICAgICAgICAgICAgYm4gPSAo KHJvdy0+aW5kaWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5kYXJ5X2JvdCwgUWxlZnQpKQorICAgICAg ICAgICAgICAgICAgPyBNQ19MRUZUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20sIHJvdy0+ZW5kc19h dF96dl9wKQorICAgICAgICAgICAgICAgICAgOiBNQ19MRUZUX0ZSSU5HRSAoMiwgUXRvcCwgMCkp OworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBibiA9ICgocm93LT5pbmRpY2F0ZV9l b2JfcCAmJiBFUSAoYm91bmRhcnlfYm90LCBRcmlnaHQpKQorICAgICAgICAgICAgICAgICAgICA/ IE1DX1JJR0hUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKQorICAg ICAgICAgICAgICAgICAgICA6IE1DX1JJR0hUX0ZSSU5HRSAoMiwgUXRvcCwgMCkpOworICAgICAg ICB9CisgICAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcCkKKyAgICAgICAg ICB7CisgICAgICAgICAgICBpZiAoRVEgKGFycm93X3RvcCwgUWxlZnQpKQorICAgICAgICAgICAg ICBibiA9IE1DX0xFRlRfRlJJTkdFICg2LCBRdXAsIDApOworICAgICAgICAgICAgICBlbHNlCisg ICAgICAgICAgICAgICAgYm4gPSBNQ19SSUdIVF9GUklOR0UgKDYsIFF1cCwgMCk7CisgICAgICAg ICAgfQorICAgICAgaWYgKGJuICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgIHsKKyAg ICAgICAgICBzdHJ1Y3QgZnJpbmdlX2JpdG1hcCAqZmIgPSBnZXRfZnJpbmdlX2JpdG1hcF9kYXRh IChibik7CisgICAgICAgICAgaWYgKGZiLT5hbGlnbiA9PSBBTElHTl9CSVRNQVBfVE9QICYmIGZi LT5wZXJpb2QgPT0gMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgc3RydWN0IGdseXBo X3JvdyAqcm93MTsKKyAgICAgICAgICAgICAgaW50IHRvcF9pbmRfbWF4X3k7CisgICAgICAgICAg ICAgIHRvcF9pbmRfbWluX3kgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgICAg ICAgICAgICAgdG9wX2luZF9tYXhfeSA9IHRvcF9pbmRfbWluX3kgKyBmYi0+aGVpZ2h0OworICAg ICAgICAgICAgICBpZiAodG9wX2luZF9tYXhfeSA+IHliKQorICAgICAgICAgICAgICAgIHRvcF9p bmRfbWF4X3kgPSB5YjsKKyAgICAgICAgICAgICAgZm9yICh5ID0gcm93LT55ICsgcm93LT5oZWln aHQsIHJuID0gdG9wX2luZF9ybiArIDE7CisgICAgICAgICAgICAgICAgICAgeSA8IHRvcF9pbmRf bWF4X3kgJiYgcm4gPCBucm93czsKKyAgICAgICAgICAgICAgICAgICB5ICs9IHJvdzEtPmhlaWdo dCwgcm4rKykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBpZiAoYm90X2lu ZF9ybiA+PSAwICYmIHJuID49IGJvdF9pbmRfcm4pCisgICAgICAgICAgICAgICAgICAgIGJyZWFr OworICAgICAgICAgICAgICAgICAgcm93MSA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgcm47 CisgICAgICAgICAgICAgICAgICBpZiAoIXJvdzEtPmVuYWJsZWRfcCkKKyAgICAgICAgICAgICAg ICAgICAgcm93MSA9IHctPmN1cnJlbnRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgICAg ICAgICByb3cxLT5pbmRpY2F0ZV9ib2JfcCA9IHJvdy0+aW5kaWNhdGVfYm9iX3A7CisgICAgICAg ICAgICAgICAgICByb3cxLT5pbmRpY2F0ZV90b3BfbGluZV9wID0gcm93LT5pbmRpY2F0ZV90b3Bf bGluZV9wOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAg IH0KKyAgaWYgKGJvdF9pbmRfcm4gPj0gMCkKKyAgICB7CisgICAgICBpbnQgYm4gPSBNQ19OT19G UklOR0VfQklUTUFQOworICAgICAgcm93ID0gdy0+ZGVzaXJlZF9tYXRyaXgtPnJvd3MgKyBib3Rf aW5kX3JuOworICAgICAgaWYgKCFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgcm93ID0gdy0+Y3Vy cmVudF9tYXRyaXgtPnJvd3MgKyBib3RfaW5kX3JuOworICAgICAgYm90X3Jvd19lbmRzX2F0X3p2 X3AgPSByb3ctPmVuZHNfYXRfenZfcDsKKyAgICAgIGlmIChyb3ctPmluZGljYXRlX2VvYl9wKQor ICAgICAgICB7CisgICAgICAgICAgaWYgKEVRIChib3VuZGFyeV9ib3QsIFFsZWZ0KSkKKyAgICAg ICAgICAgIGJuID0gTUNfTEVGVF9GUklOR0UgKDMsIFFib3R0b20sIHJvdy0+ZW5kc19hdF96dl9w KTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgYm4gPSBNQ19SSUdIVF9GUklOR0Ug KDMsIFFib3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKTsKKyAgICAgICAgfQorICAgICAgICBlbHNl IGlmIChyb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3ApCisgICAgICAgICAgeworICAgICAgICAg ICAgaWYgKEVRIChhcnJvd19ib3QsIFFsZWZ0KSkKKyAgICAgICAgICAgICAgYm4gPSBNQ19MRUZU X0ZSSU5HRSAoNywgUWRvd24sIDApOworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAg ICAgYm4gPSBNQ19SSUdIVF9GUklOR0UgKDcsIFFkb3duLCAwKTsKKyAgICAgICAgICB9CisgICAg ICBpZiAoYm4gIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgeworICAgICAgICAgIHN0 cnVjdCBmcmluZ2VfYml0bWFwICpmYiA9IGdldF9mcmluZ2VfYml0bWFwX2RhdGEgKGJuKTsKKyAg ICAgICAgICBpZiAoZmItPmFsaWduID09IEFMSUdOX0JJVE1BUF9CT1RUT00gJiYgZmItPnBlcmlv ZCA9PSAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpy b3cxOworICAgICAgICAgICAgICBpbnQgYm90X2luZF9taW5feTsKKyAgICAgICAgICAgICAgYm90 X2luZF9tYXhfeSA9IHJvdy0+eSArIHJvdy0+dmlzaWJsZV9oZWlnaHQ7CisgICAgICAgICAgICAg IGJvdF9pbmRfbWluX3kgPSBib3RfaW5kX21heF95IC0gZmItPmhlaWdodDsKKyAgICAgICAgICAg ICAgaWYgKGJvdF9pbmRfbWluX3kgPCBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KSkKKyAg ICAgICAgICAgICAgICBib3RfaW5kX21pbl95ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAo dyk7CisgICAgICAgICAgICAgIGZvciAoeSA9IHJvdy0+eSwgcm4gPSBib3RfaW5kX3JuIC0gMTsK KyAgICAgICAgICAgICAgICAgICB5ID49IGJvdF9pbmRfbWluX3kgJiYgcm4gPj0gMDsKKyAgICAg ICAgICAgICAgICAgICB5IC09IHJvdzEtPmhlaWdodCwgcm4tLSkKKyAgICAgICAgICAgICAgICB7 CisgICAgICAgICAgICAgICAgICBpZiAodG9wX2luZF9ybiA+PSAwICYmIHJuIDw9IHRvcF9pbmRf cm4pCisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgcm93MSA9 IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgICAgICAgICBpZiAoIXJv dzEtPmVuYWJsZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgcm93MSA9IHctPmN1cnJlbnRfbWF0 cml4LT5yb3dzICsgcm47CisgICAgICAgICAgICAgICAgICByb3cxLT5pbmRpY2F0ZV9lb2JfcCA9 IHJvdy0+aW5kaWNhdGVfZW9iX3A7CisgICAgICAgICAgICAgICAgICByb3cxLT5pbmRpY2F0ZV9i b3R0b21fbGluZV9wID0gcm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wOworICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgYm9vbCBhdXRvX2hzY3Jv bGxfbW9kZV9wID0gRVEgKEZidWZmZXJfbG9jYWxfdmFsdWUgKFFhdXRvX2hzY3JvbGxfbW9kZSwg dy0+Y29udGVudHMpLCBRY3VycmVudF9saW5lKTsKKyAgLyogRVhBTVBMRTogIChzY3JvbGwtbGVm dCA1KSAqLworICBib29sIGhzY2xfYWxsX3RlbXBfcCA9ICh3LT5zdXNwZW5kX2F1dG9faHNjcm9s bAorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IDApOworICAvKiBFWEFNUExFOiAgQy11IEMt eCA8IGFuZCBkbyBub3RoaW5nLiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMF9wID0gKHctPnN1 c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19o c2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwg PiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gdy0+aHNjcm9s bCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIHNvbWV0aGluZyBlbHNlIGJlc2lk ZXMgaG9yaXpvbnRhbGx5IHNjcm9sbGluZyB0aGUKKyAgICAgICAgICAgICAgIGN1cnJlbnQgbGlu ZSBkaWZmZXJlbnRseS4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jp em9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8x X3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hz Y3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwg PT0gdy0+aHNjcm9sbCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIC4uLgorICAgICAg ICAgICAgICAgQ3VycmVudCBsaW5lIGlzIF9ub3RfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZm ZXJlbnRseS4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzJfcCA9ICghdy0+c3VzcGVuZF9hdXRv X2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9k ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA9PSAwCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgIT0gdy0+aHNjcm9sbCk7CisgIC8q IEVYQU1QTEU6ICAoc2Nyb2xsLWxlZnQgNSk7IGFuZCwgdGhlbiBwcmVzcyB0aGUgbGVmdCBhcnJv dyBrZXkgb25lIHRpbWUuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9u dGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuKi8KKyAgYm9vbCBoc2NsX3RlbXBfcCA9ICghdy0+ c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3Jv bGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTog IEMtdSBDLXggPCBhbmQgZG8gc29tZXRoaW5nIHRoYXQgY2F1c2VzIHRoZSBjdXJyZW50IGxpbmUg dG8gYmUKKyAgICAgICAgICAgICAgIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4K KyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBfaXNfIGhvcml6b250YWxseSBzY3JvbGxlZCBk aWZmZXJlbnRseS4gKi8KKyAgYm9vbCBoc2NsX3Blcm1fcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hz Y3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAg ICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgIC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c29yX3R5cGUg PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoX2NtXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmN1cnNv cl90eXBlOworICAgICAgLy8gIGludCBjdXJzb3Jfd2lkdGggPSB3LT5tY19tYXRyaXgudnBvc1t2 bnRoX2NtXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmN1cnNvcl93aWR0aDsKKyAgICAgIC8vICBz dHJ1Y3QgbWNfUkdCIGxzbF9mZyA9IHsucmVkID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF9jbV0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5mZy5yZWQsCisgICAgICAvLyAgICAgICAgICAgICAgICAg ICAgICAgICAgLmdyZWVuID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF9jbV0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXS5mZy5ncmVlbiwKKyAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAu Ymx1ZSA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhfY21dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0u ZmcuYmx1ZX07CisgICAgICAvLyAgc3RydWN0IG1jX1JHQiBsc2xfYmcgPSB7LnJlZCA9IHctPm1j X21hdHJpeC52cG9zW3ZudGhfY21dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmcucmVkLAorICAg ICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IHctPm1jX21hdHJpeC52cG9z W3ZudGhfY21dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmcuZ3JlZW4sCisgICAgICAvLyAgICAg ICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoX2NtXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLmJsdWV9OworICAgICAgYm9vbCBhY3RpdmVfcCA9IHct Pm1jX21hdHJpeC52cG9zW3ZudGhfY21dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYWN0aXZlX3A7 CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSB3LT5tY19tYXRyaXgudnBvc1t2 bnRoX2NtXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoX2ZsYXZvcjsKKyAgICAgIGJvb2wg ZW5hYmxlZF9wID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF9jbV0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXS5lbmFibGVkX3A7CisgICAgICBpZiAoKHZwb3MgPT0gdm50aF9kbSB8fCB2cG9zID09IHZu dGhfY20pCisgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yID09IE1DX09WRVJMQVlfQVJST1dfQklU TUFQCisgICAgICAgICAgJiYgIWhzY2xfYWxsX3RlbXBfcAorICAgICAgICAgICYmICFoc2NsX3Rl bXBfcAorICAgICAgICAgICYmICFoc2NsX3Blcm1fcAorICAgICAgICAgICYmICFoc2NsX2FsbF9w ZXJtXzBfcAorICAgICAgICAgICYmICFoc2NsX2FsbF9wZXJtXzFfcAorICAgICAgICAgICYmICFo c2NsX2FsbF9wZXJtXzJfcAorICAgICAgICAgICYmIGVuYWJsZWRfcCkKKyAgICAgICAgeworICAg ICAgICAgIGludCBmcmluZ2VfYml0bWFwID0gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAg ICBlbnVtIGZhY2VfaWQgb3ZlcmxheV9hcnJvd19mYWNlX2lkID0KKyAgICAgICAgICAgICghYWN0 aXZlX3AKKyAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMp LCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkpCisgICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNl ICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ctaW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwg dHJ1ZSkKKyAgICAgICAgICAgIDogKGFjdGl2ZV9wKQorICAgICAgICAgICAgICA/IGxvb2t1cF9u YW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ctcHJlLXp2LWZhY2UiKSwg dHJ1ZSkKKyAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAgIG1jX2xlZnRf ZnJpbmdlX2ZhY2VfaWQgPSAoY3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBvdmVybGF5X2Fycm93X2ZhY2Vf aWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lE OworICAgICAgICAgIGlmICh3LT5oc2Nyb2xsICE9IDApCisgICAgICAgICAgICBmcmluZ2VfYml0 bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistb3ZlcmxheS1hcnJvdyIp LCBmYWxzZSwgdHJ1ZSk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGZyaW5nZV9i aXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1vdmVybGF5LWFycm93 IiksIHRydWUsIHRydWUpOworICAgICAgICAgIG1jX2xlZnRfZnJpbmdlX2JpdG1hcCA9IChjdXJz b3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBp ZiAoKHZwb3MgPT0gdm50aF9kbSB8fCB2cG9zID09IHZudGhfY20pCisgICAgICAgICAgICAgICAg ICYmIGdseXBoX2ZsYXZvciA9PSBNQ19PVkVSTEFZX0FSUk9XX0JJVE1BUAorICAgICAgICAgICAg ICAgICAmJiAoaHNjbF9hbGxfdGVtcF9wCisgICAgICAgICAgICAgICAgICAgICB8fCBoc2NsX2Fs bF9wZXJtXzBfcAorICAgICAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8xX3AKKyAg ICAgICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxsX3Blcm1fMl9wCisgICAgICAgICAgICAgICAg ICAgICB8fCBoc2NsX3RlbXBfcAorICAgICAgICAgICAgICAgICAgICAgfHwgaHNjbF9wZXJtX3Ap CisgICAgICAgICAgICAgICAgICYmIGVuYWJsZWRfcCkKKyAgICAgICAgICB7CisgICAgICAgICAg ICBpbnQgZnJpbmdlX2JpdG1hcCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgICAgICBl bnVtIGZhY2VfaWQgb3ZlcmxheV9hcnJvd19mYWNlX2lkID0KKyAgICAgICAgICAgICAgKCFhY3Rp dmVfcAorICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgY2hfaW5hY3RpdmVfd2luZG93cykpKQorICAgICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9m YWNlICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ctaHNjbC1pbmFjdGl2ZS1wcmUtenYt ZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAgICAgICAg ICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ctaHNj bC1wcmUtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsK KyAgICAgICAgICAgIG1jX2xlZnRfZnJpbmdlX2ZhY2VfaWQgPSAoY3Vyc29yX3R5cGUgPT0gTUNf TEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IG92ZXJsYXlfYXJyb3dfZmFjZV9pZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICAgIGlmIChoc2NsX2FsbF9wZXJt XzBfcCkKKyAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFw ICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCBmYWxzZSwgZmFsc2UpOworICAgICAgICAgICAg ICBlbHNlIGlmIChoc2NsX2FsbF9wZXJtXzFfcCkKKyAgICAgICAgICAgICAgICBmcmluZ2VfYml0 bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIHRy dWUsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX2FsbF9wZXJtXzJfcCkK KyAgICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAo dywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgZmFsc2UsIHRydWUpOworICAgICAgICAgICAgICAg ICAgZWxzZSBpZiAoaHNjbF9wZXJtX3ApCisgICAgICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRt YXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgdHJ1 ZSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xfYWxsX3RlbXBfcCkK KyAgICAgICAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRt YXAgKHcsIGludGVybiAoIistaHNjbC10ZW1wIiksIGZhbHNlLCBmYWxzZSk7CisgICAgICAgICAg ICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF90ZW1wX3ApCisgICAgICAgICAgICAgICAgICAgICAg ICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNj bC10ZW1wIiksIHRydWUsIGZhbHNlKTsKKyAgICAgICAgICAgIG1jX2xlZnRfZnJpbmdlX2JpdG1h cCA9IChjdXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBmcmluZ2VfYml0bWFwCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgIH0K KyAgICAgICAgICBlbHNlIGlmICgodnBvcyA9PSB2bnRoX2RtIHx8IHZwb3MgPT0gdm50aF9jbSkK KyAgICAgICAgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFO R0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3Ig PT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAg ICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEUKKyAgICAg ICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklH SFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19S RVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAg IHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAg ICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIKKyAgICAgICAg ICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NM QVNIKQorICAgICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgIExpc3BfT2JqZWN0IGJpdG1hcF9mbGF2b3IgPSAoZ2x5cGhfZmxhdm9yID09 IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3Ig PT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVykKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfaG9sbG93X3Jl Y3RhbmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEUpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hvbGxvd19yZWN0YW5nbGUK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZv ciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jhcl9yaWdodF9hcnJvdworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09 IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVykKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxfYmFyX3Jp Z2h0X2Fycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChn bHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXIKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9W RVJUSUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gUW1jX3JldmVyc2VkX3ZlcnRpY2FsX2JhcgorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xB U0gpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3Zl cnRpY2FsX2Jhcl9iYWNrc2xhc2gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogUW5pbDsKKyAgICAgICAgICAgICAgbWNfcmlnaHRfZnJpbmdlX2JpdG1hcCA9IChj dXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gbG9va3VwX2ZyaW5nZV9iaXRtYXAgKGJpdG1hcF9mbGF2 b3IpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19OT19GUklO R0VfQklUTUFQOworICAgICAgICAgICAgICBtY19yaWdodF9mcmluZ2VfZmFjZV9pZCA9CisgICAg ICAgICAgICAgICAgKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAg ICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVgorICAgICAgICAgICAgICAgICAm JiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJS T1cKKyAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9W RVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2Zs YXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpKQorICAgICAgICAgICAgICAgICAgPyBs b29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZXZlcnNlZC1iYXItcHJlLXp2LWZh Y2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9G UklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IEFUX1pW CisgICAgICAgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xM T1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBo X2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAg ICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JB UikpCisgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4g KCIrLXJldmVyc2VkLWJhci1hdC16di1mYWNlIiksIHRydWUpCisgICAgICAgICAgICAgICAgOiAo Y3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAg ICYmIHJvd19wb3NpdGlvbiA9PSBQT1NUX1pWCisgICAgICAgICAgICAgICAgICAgJiYgKGdseXBo X2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAg ICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNB TF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9y ID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikpCisgICAgICAgICAgICAgICAgICA/IGxvb2t1 cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJldmVyc2VkLWJhci1wb3N0LXp2LWZhY2Ui KSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklO R0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVgor ICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9IT0xMT1df UkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9y ICE9IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAg ICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAg ICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLWJhci1wcmUt enYtZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICAgIDogKGN1cnNvcl90eXBlID09IE1DX1JJ R0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gPT0g QVRfWlYKKyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURf SE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICYmIGdseXBo X2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAg ICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQor ICAgICAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1i YXItYXQtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICAgIDogKGN1cnNvcl90eXBlID09 IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRp b24gPT0gUE9TVF9aVgorICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19S RVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAg JiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVwor ICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNB TF9CQVIpCisgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRl cm4gKCIrLWJhci1wb3N0LXp2LWZhY2UiKS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nQpKQorICAgICAg ICB7CisgICAgICAgICAgbGVmdCA9ICgocm93LT5pbmRpY2F0ZV9lb2JfcCAmJiBFUSAoYm91bmRh cnlfYm90LCBRbGVmdCkpCisgICAgICAgICAgICAgICAgID8gTUNfTEVGVF9GUklOR0UgKDEsIFF0 b3BfYm90dG9tLCB0b3Bfcm93X2VuZHNfYXRfenZfcCkKKyAgICAgICAgICAgICAgICAgOiBNQ19M RUZUX0ZSSU5HRSAoMiwgUXRvcCwgMCkpOworICAgICAgICAgIGlmICh0b3BfaW5kX21pbl95ID49 IDApCisgICAgICAgICAgICBsZWZ0X29mZnNldCA9IHRvcF9pbmRfbWluX3kgLSByb3ctPnk7Cisg ICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5k YXJ5X2JvdCwgUWxlZnQpKQorICAgICAgICB7CisgICAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJ TkdFICgzLCBRYm90dG9tLCBib3Rfcm93X2VuZHNfYXRfenZfcCk7CisgICAgICAgICAgaWYgKGJv dF9pbmRfbWF4X3kgPj0gMCkKKyAgICAgICAgICAgIGxlZnRfb2Zmc2V0ID0gYm90X2luZF9tYXhf eSAtIChyb3ctPnkgKyByb3ctPnZpc2libGVfaGVpZ2h0KTsKKyAgICAgICAgfQorICAgICAgZWxz ZSBpZiAoKCFyb3ctPnJldmVyc2VkX3AgJiYgTUFUUklYX1JPV19DT05USU5VQVRJT05fTElORV9Q IChyb3cpKQorICAgICAgICAgICAgICAgfHwgKHJvdy0+cmV2ZXJzZWRfcCAmJiByb3ctPmNvbnRp bnVlZF9wKSkKKyAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdFICg0LCBRY29udGludWF0aW9u LCAwKTsKKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfZW1wdHlfbGluZV9wICYmIEVRIChl bXB0eV9wb3MsIFFsZWZ0KSkKKyAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdFICg1LCBRZW1w dHlfbGluZSwgMCk7CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX3RvcF9saW5lX3AgJiYg RVEgKGFycm93X3RvcCwgUWxlZnQpKQorICAgICAgICB7CisgICAgICAgICAgbGVmdCA9IE1DX0xF RlRfRlJJTkdFICg2LCBRdXAsIDApOworICAgICAgICAgIGlmICh0b3BfaW5kX21pbl95ID49IDAp CisgICAgICAgICAgICBsZWZ0X29mZnNldCA9IHRvcF9pbmRfbWluX3kgLSByb3ctPnk7CisgICAg ICAgIH0KKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCAmJiBFUSAo YXJyb3dfYm90LCBRbGVmdCkpCisgICAgICAgIHsKKyAgICAgICAgICBsZWZ0ID0gTUNfTEVGVF9G UklOR0UgKDcsIFFkb3duLCAwKTsKKyAgICAgICAgICBpZiAoYm90X2luZF9tYXhfeSA+PSAwKQor ICAgICAgICAgICAgbGVmdF9vZmZzZXQgPSBib3RfaW5kX21heF95IC0gKHJvdy0+eSArIHJvdy0+ dmlzaWJsZV9oZWlnaHQpOworICAgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIGxlZnQgPSBN Q19OT19GUklOR0VfQklUTUFQOworICAgICAgLyogRGVjaWRlIHdoaWNoIGJpdG1hcCB0byBkcmF3 IGluIHRoZSByaWdodCBmcmluZ2UuICAqLworICAgICAgaWYgKFdJTkRPV19SSUdIVF9GUklOR0Vf V0lEVEggKHcpID09IDApCisgICAgICAgIHJpZ2h0ID0gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAg ICAgIGVsc2UgaWYgKHJvdy0+cmlnaHRfdXNlcl9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5H RV9CSVRNQVApCisgICAgICAgIHsKKyAgICAgICAgICByaWdodCA9IHJvdy0+cmlnaHRfdXNlcl9m cmluZ2VfYml0bWFwOworICAgICAgICAgIHJpZ2h0X2ZhY2VfaWQgPSByb3ctPnJpZ2h0X3VzZXJf ZnJpbmdlX2ZhY2VfaWQ7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKCghcm93LT5yZXZlcnNl ZF9wICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICB8fCAocm93 LT5yZXZlcnNlZF9wICYmIHJvdy0+dHJ1bmNhdGVkX29uX2xlZnRfcCkpCisgICAgICAgIHJpZ2h0 ID0gTUNfUklHSFRfRlJJTkdFICgwLCBRdHJ1bmNhdGlvbiwgMCk7CisgICAgICBlbHNlIGlmIChy b3ctPmluZGljYXRlX2JvYl9wICYmIEVRIChib3VuZGFyeV90b3AsIFFyaWdodCkpCisgICAgICAg IHsKKyAgICAgICAgICByaWdodCA9ICgocm93LT5pbmRpY2F0ZV9lb2JfcCAmJiBFUSAoYm91bmRh cnlfYm90LCBRcmlnaHQpKQorICAgICAgICAgICAgID8gTUNfUklHSFRfRlJJTkdFICgxLCBRdG9w X2JvdHRvbSwgdG9wX3Jvd19lbmRzX2F0X3p2X3ApCisgICAgICAgICAgICAgOiBNQ19SSUdIVF9G UklOR0UgKDIsIFF0b3AsIDApKTsKKyAgICAgICAgICBpZiAodG9wX2luZF9taW5feSA+PSAwKQor ICAgICAgICAgICAgcmlnaHRfb2Zmc2V0ID0gdG9wX2luZF9taW5feSAtIHJvdy0+eTsKKyAgICAg ICAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9lb2JfcCAmJiBFUSAoYm91bmRhcnlf Ym90LCBRcmlnaHQpKQorICAgICAgICB7CisgICAgICAgICAgcmlnaHQgPSBNQ19SSUdIVF9GUklO R0UgKDMsIFFib3R0b20sIGJvdF9yb3dfZW5kc19hdF96dl9wKTsKKyAgICAgICAgICBpZiAoYm90 X2luZF9tYXhfeSA+PSAwKQorICAgICAgICAgICAgcmlnaHRfb2Zmc2V0ID0gYm90X2luZF9tYXhf eSAtIChyb3ctPnkgKyByb3ctPnZpc2libGVfaGVpZ2h0KTsKKyAgICAgICAgfQorICAgICAgZWxz ZSBpZiAoKCFyb3ctPnJldmVyc2VkX3AgJiYgcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAg ICAgIHx8IChyb3ctPnJldmVyc2VkX3AgJiYgTUFUUklYX1JPV19DT05USU5VQVRJT05fTElORV9Q IChyb3cpKSkKKyAgICAgICAgcmlnaHQgPSBNQ19SSUdIVF9GUklOR0UgKDQsIFFjb250aW51YXRp b24sIDApOworICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV90b3BfbGluZV9wICYmIEVRIChh cnJvd190b3AsIFFyaWdodCkpCisgICAgICAgIHsKKyAgICAgICAgICByaWdodCA9IE1DX1JJR0hU X0ZSSU5HRSAoNiwgUXVwLCAwKTsKKyAgICAgICAgICBpZiAodG9wX2luZF9taW5feSA+PSAwKQor ICAgICAgICAgICAgcmlnaHRfb2Zmc2V0ID0gdG9wX2luZF9taW5feSAtIHJvdy0+eTsKKyAgICAg ICAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wICYmIEVRIChh cnJvd19ib3QsIFFyaWdodCkpCisgICAgICAgIHsKKyAgICAgICAgICByaWdodCA9IE1DX1JJR0hU X0ZSSU5HRSAoNywgUWRvd24sIDApOworICAgICAgICAgIGlmIChib3RfaW5kX21heF95ID49IDAp CisgICAgICAgICAgICByaWdodF9vZmZzZXQgPSBib3RfaW5kX21heF95IC0gKHJvdy0+eSArIHJv dy0+dmlzaWJsZV9oZWlnaHQpOworICAgICAgICB9CisgICAgICBlbHNlIGlmIChyb3ctPmluZGlj YXRlX2VtcHR5X2xpbmVfcCAmJiBFUSAoZW1wdHlfcG9zLCBRcmlnaHQpKQorICAgICAgICByaWdo dCA9IE1DX1JJR0hUX0ZSSU5HRSAoNSwgUWVtcHR5X2xpbmUsIDApOworICAgICAgZWxzZQorICAg ICAgICByaWdodCA9IE1DX05PX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ICBj dXItPnJlZHJhd19mcmluZ2VfYml0bWFwc19wID0gMTsKKyAgICAgICAgICAgICAgaWYgKG1jX2xl ZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAg ICB8fCBtY19yaWdodF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAg ICAgICAgICAgICAgY3VyLT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3AgPSBmYWxzZTsKKyAgICAg ICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPmZyaW5nZV9iaXRtYXBfcGVy aW9kaWNfcCA9IHBlcmlvZGljX3A7CisgICAgICAgICAgICAgIGlmIChtY19sZWZ0X2ZyaW5nZV9i aXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICBjdXItPmxlZnRf ZnJpbmdlX2JpdG1hcCA9IG1jX2xlZnRfZnJpbmdlX2JpdG1hcDsKKyAgICAgICAgICAgICAgICBl bHNlCisgICAgICAgICAgICAgICAgICBjdXItPmxlZnRfZnJpbmdlX2JpdG1hcCA9IGxlZnQ7Cisg ICAgICAgICAgICAgIGlmIChtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJ VE1BUCkKKyAgICAgICAgICAgICAgICBjdXItPmxlZnRfZnJpbmdlX2ZhY2VfaWQgPSBtY19sZWZ0 X2ZyaW5nZV9mYWNlX2lkOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAg IGN1ci0+bGVmdF9mcmluZ2VfZmFjZV9pZCA9IGxlZnRfZmFjZV9pZDsKKyAgICAgICAgICAgICAg aWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAg ICAgICAgICAgIGN1ci0+bGVmdF9mcmluZ2Vfb2Zmc2V0ID0gMDsKKyAgICAgICAgICAgICAgICBl bHNlCisgICAgICAgICAgICAgICAgICBjdXItPmxlZnRfZnJpbmdlX29mZnNldCA9IGxlZnRfb2Zm c2V0OworICAgICAgICAgICAgICBpZiAobWNfcmlnaHRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19G UklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX2JpdG1hcCA9 IG1jX3JpZ2h0X2ZyaW5nZV9iaXRtYXA7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAg ICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2VfYml0bWFwID0gcmlnaHQ7CisgICAgICAgICAgICAg IGlmIChtY19yaWdodF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAg ICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2VfZmFjZV9pZCA9IG1jX3JpZ2h0X2ZyaW5nZV9m YWNlX2lkOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIGN1ci0+cmln aHRfZnJpbmdlX2ZhY2VfaWQgPSByaWdodF9mYWNlX2lkOworICAgICAgICAgICAgICBpZiAobWNf cmlnaHRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAg ICAgIGN1ci0+cmlnaHRfZnJpbmdlX29mZnNldCA9IDA7CisgICAgICAgICAgICAgICAgZWxzZQor ICAgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2Vfb2Zmc2V0ID0gcmlnaHRfb2Zmc2V0 OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBpZiAocm93LT5vdmVybGF5X2Fycm93 X2JpdG1hcCA8IDApCisgICAgICAgIHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAgPSBtY19nZXRf bG9naWNhbF9mcmluZ2VfYml0bWFwICh3LCBRb3ZlcmxheV9hcnJvdywg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gICAgICB3aGljaCA9IHJvdy0+bGVmdF9mcmluZ2VfYml0bWFwOworICAgICAgICBmYWNlX2lk ID0gcm93LT5sZWZ0X2ZyaW5nZV9mYWNlX2lkOworICAgICAgICBvZmZzZXQgPSByb3ctPmxlZnRf ZnJpbmdlX29mZnNldDsKKyAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAg IHdoaWNoID0gcm93LT5yaWdodF9mcmluZ2VfYml0bWFwOworICAgICAgICAgIGZhY2VfaWQgPSBy b3ctPnJpZ2h0X2ZyaW5nZV9mYWNlX2lkOworICAgICAgICAgIG9mZnNldCA9IHJvdy0+cmlnaHRf ZnJpbmdlX29mZnNldDsKKyAgICAgICAgfQorICBpZiAoZmFjZV9pZCA9PSBERUZBVUxUX0ZBQ0Vf SUQpCisgICAgeworICAgICAgTGlzcF9PYmplY3QgZmFjZSA9IGZyaW5nZV9mYWNlc1t3aGljaF07 CisgICAgICBmYWNlX2lkID0gTklMUCAoZmFjZSkgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwg UWZyaW5nZSwgZmFsc2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBsb29rdXBfZGVy aXZlZF9mYWNlICh3LCBmLCBmYWNlLCBGUklOR0VfRkFDRV9JRCwgMCk7CisgICAgICBpZiAoZmFj ZV9pZCA8IDApCisgICAgICAgIGZhY2VfaWQgPSBGUklOR0VfRkFDRV9JRDsKKyAgICB9CisgIGZi ID0gZ2V0X2ZyaW5nZV9iaXRtYXBfZGF0YSAod2hpY2gpOworICBwZXJpb2QgPSBmYi0+cGVyaW9k OworICAvKiBDb252ZXJ0IHJvdyB0byBmcmFtZSBjb29yZGluYXRlcy4gICovCisgIHAueSA9IFdJ TkRPV19UT19GUkFNRV9QSVhFTF9ZICh3LCByb3ctPnkpICsgb2Zmc2V0OworICBwLndoaWNoID0g d2hpY2g7CisgIHAuYml0cyA9IGZiLT5iaXRzOworICBwLndkID0gZmItPndpZHRoOworICBw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WEVMX1kgKHcsIG1heCAoaGVhZGVyX2xpbmVfaGVp Z2h0LCByb3ctPnkpKTsKKyAgcC5ueSA9IHJvdy0+dmlzaWJsZV9oZWlnaHQ7CisgIGlmIChsZWZ0 X3ApCisgICAgeworICAgICAgaW50IHdkID0gV0lORE9XX0xFRlRfRlJJTkdFX1dJRFRIICh3KTsK KyAgICAgIGludCB4ID0gd2luZG93X2JveF9sZWZ0ICh3LCAoV0lORE9XX0hBU19GUklOR0VTX09V VFNJREVfTUFSR0lOUyAodykKKyAgICAgICAgICAgPyBMRUZUX01BUkdJTl9BUkVBCisgICAgICAg ICAgIDogVEVYVF9BUkVBKSk7CisgICAgICBpZiAocC53ZCA+IHdkKQorICAgICAgICBwLndkID0g d2Q7CisgICAgICBwLnggPSB4IC0gcC53ZCAtICh3ZCAtIHAud2QpIC8gMjsKKyAgICAgIGlmIChw LndkIDwgd2QgfHwgcC55ID4gcC5ieSB8fCBwLnkgKyBwLmggPCBwLmJ5ICsgcC5ueSkKKyAgICAg ICAgeworICAgICAgICAgIC8qIElmIFcgaGFzIGEgdmVydGljYWwgYm9yZGVyIHRvIGl0cyBsZWZ0 LCBkb24ndCBkcmF3IG92ZXIgaXQuICAqLworICAgICAgICAgIHdkIC09ICgoIVdJTkRPV19MRUZU TU9TVF9QICh3KQorICAgICAgICAgICAgLyogVGhpcyBjb3VsZCBiZSB3cm9uZyB3aGVuIHdlIGFs bG93IHdpbmRvdyBsb2NhbAorICAgICAgICAgICAgICAgcmlnaHQgZGl2aWRlcnMgLSBidXQgdGhl IHdpbmRvdyBvbiB0aGUgbGVmdCBpcyBoYXJkCisgICAgICAgICAgICAgICB0byBnZXQuICAqLwor ICAgICAgICAgICAgJiYgIUZSQU1FX1JJR0hUX0RJVklERVJfV0lEVEggKGYpCisgICAgICAgICAg ICAmJiAhV0lORE9XX0hBU19WRVJUSUNBTF9TQ1JPTExfQkFSICh3KQorICAgICAgICAgICAgLyog QnV0IGRvbid0IHJlZHVjZSB0aGUg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g ZnJpbmdlLiAgKi8KKyAgICAgIGlmIChwLndkIDwgd2QgfHwgcC55ID4gcC5ieSB8fCBwLnkgKyBw LmggPCBwLmJ5ICsgcC5ueSkKKyAgICAgICAgeworICAgICAgICAgIHAuYnggPSB4OworICAgICAg ICAgIHAubnggPSB3ZDsKKyAgICAgICAgfQorICAgIH0KKyAgaWYgKHAueCA+PSBXSU5ET1dfQk9Y X0xFRlRfRURHRV9YICh3KQorICAgICAgJiYgKHAueCArIHAud2QpIDw9IFdJTkRPV19CT1hfTEVG VF9FREdFX1ggKHcpICsgV0lORE9XX1BJWEVMX1dJRFRIICh3KSkKKyAgICBGUkFNRV9SSUYgKGYp LT5kcmF3X2ZyaW5nZV9iaXRtYXAgKHcsIHJvdywgJnApOworfQorCit2b2lkCittY19kcmF3X2Zy aW5nZV9iaXRtYXAgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgaW50 IGxlZnRfcCwgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSkKK3sKKyAgaW50IG92ZXJs YXkgPSAwOworICBpZiAobGVmdF9wID09IHJvdy0+cmV2ZXJzZWRfcCAmJiByb3ctPmN1cnNvcl9p bl9mcmluZ2VfcCkKKyAgICB7CisgICAgICBMaXNwX09iamVjdCBjdXJzb3IgPSBRbmlsOworICAg ICAgc3dpdGNoIChjdXJzb3JfdHlwZSkKKyAgICAgICAgeworICAgICAgICBjYXNlIE1DX0ZSQU1F RF9CT1g6CisgICAgICAgICAgaWYgKHJvdy0+dmlzaWJsZV9oZWlnaHQgPj0gU1RBTkRBUkRfQklU TUFQX0hFSUdIVCAoaG9sbG93X3JlY3RhbmdsZV9iaXRzKSkKKyAgICAgICAgICAgIGN1cnNvciA9 IFFob2xsb3c7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgY3Vyc29yID0gUWhvbGxvd19z bWFsbDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19IT0xMT1dfQk9YOgorICAg ICAgICAgIGlmIChyb3ctPnZpc2libGVfaGVpZ2h0ID49IFNUQU5EQVJEX0JJVE1BUF9IRUlHSFQg KGhvbGxvd19yZWN0YW5nbGVfYml0cykpCisgICAgICAgICAgICBjdXJzb3IgPSBRaG9sbG93Owor ICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGN1cnNvciA9IFFob2xsb3dfc21hbGw7CisgICAg ICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAgICAgICAgICBjdXJz b3IgPSBRYm94OworICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1DX0JBUjoKKyAgICAg ICAgICBjdXJzb3IgPSBRYmFyOworICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1DX0hC QVI6CisgICAgICAgICAgY3Vyc29yID0gUWhiYXI7CisgICAgICAgICAgYnJlYWs7CisgICAgICAg IGNhc2UgTUNfTk9fRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgY2FzZSBNQ19OT19DVVJTT1I6Cisg ICAgICAgIGNhc2UgTUNfUklHSFRfRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgY2FzZSBNQ19MRUZU X0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgdy0+cGh5c19jdXJz b3Jfb25fcCA9IDA7CisgICAgICAgICAgcm93LT5jdXJzb3JfaW5fZnJpbmdlX3AgPSAwOworICAg ICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBpZiAoIU5JTFAgKGN1cnNvcikpCisgICAg ICAgIHsKKyAgICAgICAgICBpbnQgYm0gPSBtY19nZXRfbG9naWNhbF9jdXJzb3JfYml0bWFwICh3 LCBjdXJzb3IpOworICAgICAgICAgIGlmIChibSAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAg ICAgICAgICAgeworICAgICAgICAgICAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXBfMSAodywgcm93 LCBsZWZ0X3AsIDIsIGJtKTsKKyAgICAgICAgICAgICAgb3ZlcmxheSA9IEVRIChjdXJzb3IsIFFi b3gpID8gMyA6IDE7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIG1jX2RyYXdf ZnJpbmdlX2JpdG1hcF8xICh3LCByb3csIGxlZnRfcCwgb3ZlcmxheSwgTUNfTk9fRlJJTkdFX0JJ VE1BUCk7CisgIGlmIChsZWZ0X3AgJiYgcm93LT5vdmVybGF5X2Fycm93X2JpdG1hcCAhPSBNQ19O T19GUklOR0VfQklUTUFQKQorICAgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcF8xICh3LCByb3csIDEs IDEsIHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXApOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VS U09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogI2RlZmluZSBOT19GUklOR0Vf QklUTUFQIDAKICNkZWZpbmUgVU5ERUZfRlJJTkdFX0JJVE1BUCAxCiAjZGVmaW5lIE1BWF9TVEFO REFSRF9GUklOR0VfQklUTUFQUyBBUlJBWUVMVFMgKHN0YW5kYXJkX2JpdG1hcHMpCkBAIC0xNjk5 LDYgKzMyMTcsMTY4IEBAIFJldHVybiBuaWwgaWYgUE9TIGlzIG5vdCB2aXNpYmxlIGluIFdJTkRP Vy4gICovKQogdm9pZAogc3ltc19vZl9mcmluZ2UgKHZvaWQpCiB7CisKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogKGdldCAn ZW1wdHktbGluZSAnZnJpbmdlKSA9PiAyMyA9PiB0aGUgbGFzdCBzdGFuZGFyZC1iaXRtYXAg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WFkcnVwbGUtYW5nbGUtZG93biAnZnJpbmdlKSA9PiA0OCAqLworCisvKiBlbmQgTVVMVElQ TEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBERUZTWU0gKFF0 cnVuY2F0aW9uLCAidHJ1bmNhdGlvbiIpOwogICBERUZTWU0gKFFjb250aW51YXRpb24sICJjb250 aW51YXRpb24iKTsKICAgREVGU1lNIChRb3ZlcmxheV9hcnJvdywgIm92ZXJsYXktYXJyb3ciKTsK ZGlmZiAtLWdpdCBhL3NyYy9uc3Rlcm0uaCBiL3NyYy9uc3Rlcm0uaAppbmRleCA5NzczZWIzLi5l MzRhMTE2IDEwMDY0NAotLS0gYS9zcmMvbnN0ZXJtLmgKKysrIGIvc3JjL25zdGVybS5oCkBAIC02 NjMsNiArNjYzLDE2IEBAIHR5cGVkZWYgaWQgaW5zdGFuY2V0eXBlOwogCiBAaW50ZXJmYWNlIEVt YWNzU2Nyb2xsZXIgOiBOU1Njcm9sbGVyCiAgIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIE5TUmVjdCBtY19yZWN0YW5nbGU7CisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgIHN0cnVjdCB3aW5kb3cgKndpbmRvdzsK ICAgIHN0cnVjdCBmcmFtZSAqZnJhbWU7CiAgICBOU1Jlc3BvbmRlciAqcHJldlJlc3BvbmRlcjsK QEAgLTY4Myw2ICs2OTMsMTggQEAgdHlwZWRlZiBpZCBpbnN0YW5jZXR5cGU7CiAgICBpbnQgZW1f d2hvbGU7CiAgICB9CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1D VVJTT1JTICovCisKKy0gKHZvaWQpbWNfc2V0X3JlY3RhbmdsZTogKE5TUmVjdClyZWN0OworLSAo TlNSZWN0KW1jX2dldF9yZWN0YW5nbGU7CistIChzdHJ1Y3Qgd2luZG93ICopbWNfZ2V0X3dpbmRv dzsKKy0gKGJvb2wpbWNfanVkZ2U7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC0g KGluc3RhbmNldHlwZSkgaW5pdEZyYW1lOiAoTlNSZWN0IClyIHdpbmRvdzogKExpc3BfT2JqZWN0 KXdpbjsKIC0gKHZvaWQpc2V0RnJhbWU6IChOU1JlY3QpcjsKIApkaWZmIC0tZ2l0IGEvc3JjL25z dGVybS5tIGIvc3JjL25zdGVybS5tCmluZGV4IDAyMzMxODIuLmMyNGE2NDAgMTAwNjQ0Ci0tLSBh L3NyYy9uc3Rlcm0ubQorKysgYi9zcmMvbnN0ZXJtLm0KQEAgLTc2LDYgKzc2LDk3NSBAQCBVcGRh dGVkIGJ5IENocmlzdGlhbiBMaW1wYWNoIChjaHJpc0BuaWNlLmNoKQogc3RhdGljIEVtYWNzTWVu dSAqbWFpbk1lbnU7CiAjZW5kaWYKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJl Z2luIE1VTFRJUExFLUNVUlNPUlMgKi8KKworc3RhdGljIEJPT0wgbnNfY2xpcF90b19yZWN0IChz dHJ1Y3QgZnJhbWUgKiwgTlNSZWN0ICosIGludCk7CisKK3N0YXRpYyB2b2lkIG5zX3Jlc2V0X2Ns aXBwaW5nIChzdHJ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W9yZSB0aGFuIG9uZSBmYWtlIGN1cnNv ciBhdCB0aGUgc2FtZSBIUE9TLgorICBOT1RFOiAgQSBmYWtlIGN1cnNvciBmcm9tIG9uZSBjYWNo ZSBtYXkgb3ZlcndyaXRlIGEgZmFrZSBjdXJzb3IgZnJvbSBhbm90aGVyCisgIGNhY2hlIC0tIHRo dXMsIHdlIG11c3QgY2hlY2sgdGhlbSBhbGwgZm9yIG92ZXJ3cml0dGVuIGZha2UgY3Vyc29ycy4g Ki8KKyAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOworICAg ICAgIGNhY2hlX3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICArK2NhY2hlX3R5cGUpCisgICAgewor ICAgICAgZm9yIChpbnQgbnRoID0gMDsKKyAgICAgICAgICAgcworICAgICAgICAgICAmJiBtY190 cmF2ZXJzZV9jYWNoZV9wIChzLT53LT5tY19tYXRyaXgsIGNhY2hlX3R5cGUsIHZudGgsIG50aCk7 CisgICAgICAgICAgICsrbnRoKQorICAgICAgICB7CisgICAgICAgICAgLy8gIGludCB4ID0gcy0+ dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS54OworICAgICAg ICAgIGludCBmeCA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF0uZng7CisgICAgICAgICAgLy8gIGludCB5ID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS55OworICAgICAgICAgIGludCBmeSA9IHMtPnctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZnk7CisgICAgICAgICAg aW50IGhwb3MgPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLmhwb3M7CisgICA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YmcucmVkLAorICAg ICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSBzLT53LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLmdyZWVuLAorICAgICAgICAg IC8vICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IHMtPnctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmcuYmx1ZX07CisgICAgICAgICAgYm9vbCBh Y3RpdmVfcCA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF0uYWN0aXZlX3A7CisgICAgICAgICAgLy8gIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9 IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGhf Zmxhdm9yOworICAgICAgICAgIGJvb2wgZW5hYmxlZF9wID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFibGVkX3A7CisgICAgICAgICAgYm9vbCBn b19wID0gKHZwb3MgPT0gdm50aAorICAgICAgICAgICAgICAgICAgICAgICAmJiBocG9zID09IGN1 cnNvcl9nbHlwaC0+aHBvcworICAgICAgICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApOwor ICAgICAgICAgIGlmICghZ29fcCkKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgIE5T UmVjdCByOworICAgICAgICAgIHIub3JpZ2luLnggPSBmeDsKKyAgICAgICAgICByLm9yaWdpbi55 ID0gZnk7CisgICAgICAgICAgci5zaXplLmhlaWdodCA9IGg7CisgICAgICAgICAgci5zaXplLndp ZHRoID0gd2Q7CisgICAgICAgICAgW1tOU0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6IGxz bF9mZy5yZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBncmVlbjogbHNs X2ZnLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJsdWU6IGxz bF9mZy5ibHVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwaGE6IDEu MF0gc2V0XTsKKyAgICAgIGlmIChjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YKQorICAgICAg ICB7CisgICAgICAgICAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKHMtPnctPmNvbnRlbnRz KTsKKyAgICAgICAgICBib29sIHJlZ2lvbl9hY3RpdmVfcCA9ICghTklMUCAoVnRyYW5zaWVudF9t YXJrX21vZGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJW QVIgKGIsIG1hcmtfYWN0aXZlKSkpOworICAgICAgICAgIHB0cmRpZmZfdCByZWdpb25fYmVnID0g KHJlZ2lvbl9hY3RpdmVfcCkgPyBtY19yZWdpb25fbGltaXQgKDEpIDogLTE7CisgICAgICAgICAg cHRyZGlmZl90IHJlZ2lvbl9lbmQgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IG1jX3JlZ2lvbl9saW1p dCAoMCkgOiAtMTsKKyAgICAgICAgICBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAg ICYmIGFjdGl2ZV9wCisgICAgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+Y2hhcnBvcyA9PSBy ZWdpb25fYmVnKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9s bG93X2FjdGl2ZV9yZWdpb25fYmVnX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywg cy0+ZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWF0LXJlZ2lvbi1wcmUtenYtZ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mYpOwor ICAgICAgICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2FjdGl2ZV9yZWdpb25fYmV0 d2Vlbl9jb2xvcjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSBpZiAo YWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGVudW0g ZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywg cy0+ZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOwor ICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFD RV9GUk9NX0lEIChzLT5mLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAg ICAgICBOU0NvbG9yICpob2xsb3dfYWN0aXZlX2NvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29s b3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoaG9sbG93X2FjdGl2ZV9mYWNlKSwgcy0+Zik7CisgICAg ICAgICAgICAgICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19hY3RpdmVfY29sb3I7CisgICAg ICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmICghYWN0aXZlX3ApCisg ICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQg aG9sbG93X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+Ziwg aW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUp OworICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFj ZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAg ICAgICAgICAgICAgICAgIE5TQ29sb3IgKmhvbGxvd19pbmFjdGl2ZV9jb2xvciA9IG5zX2xvb2t1 cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGhvbGxvd19pbmFjdGl2ZV9mYWNl KSwgcy0+Zik7CisgICAgICAgICAgICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2lu YWN0aXZlX2NvbG9yOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAg ZWxzZSBpZiAoZmFjZSAmJiBOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpID09IG5zX2luZGV4X2Nv bG9yIChGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpLCBzLT5mKSkKKyAgICAgICAgICB7CisgICAg ICAgICAgICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoZmFj ZSksIHMtPmYpIHNldF07CisgICAgICAgICAgICBob2xsb3dfY29sb3IgPSBGUkFNRV9DVVJTT1Jf Q09MT1IgKHMtPmYpOworICAgICAgICAgIH0KKyAgICAgICAgICBzd2l0Y2ggKGN1cnNvcl90eXBl KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBjYXNlIE1DX05PX0ZSSU5HRV9CSVRNQVA6 CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgTUNfTk9fQ1VSU09S OgorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX1JJR0hUX0ZS SU5HRV9CSVRNQVA6CisgICAgICAgICAgICAgIGNhc2UgTUNfTEVGVF9GUklOR0VfQklUTUFQOgor ICAgICAgICAgICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAgICAgICAgICAgICAgTlNSZWN0 RmlsbCAocik7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgTUNf RlJBTUVEX0JPWDoKKyAgICAgICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAg ICAgICBbaG9sbG93X2NvbG9yIHNldF07CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAoTlNJ bnNldFJlY3QgKHIsIDEsIDEpKTsKKyAgICAgICAgICAgICAgICBbRlJBTUVfQ1VSU09SX0NPTE9S IChzLT5mKSBzZXRdOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNl IE1DX0hPTExPV19CT1g6CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAg ICAgICAgICAgW2hvbGxvd19jb2xvciBzZXRdOworICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwg KE5TSW5zZXRSZWN0IChyLCAxLCAxKSk7CisgICAgICAgICAgICAgICAgW0ZSQU1FX0NVUlNPUl9D T0xPUiAocy0+Zikgc2V0XTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAg Y2FzZSBNQ19IQkFSOgorICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAg ICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX0JBUjoKKyAgICAgICAgICAgICAg ICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0K KyAgICAgICAgICAvKiBJZiBhIGdseXBoIGV4aXN0cyAocy0+Y2hhcjJiICE9IE5VTEwpLCB0aGVu IGRyYXcgdGhlIGdseXBoIG9uIHRvcCBvZiB0aGUKKyAgICAgICAgICBuZXdseSBkcmF3biByZWN0 YW5nbGUgdGhhdCB3YXMgY3JlYXRlZCBoZXJlaW5hYm92ZS4gIFRvIHRoZSBleHRlbnQgdGhhdCB3 ZQorICAgICAgICAgIHdhbnQgdG8gZG91YmxlLWltcHJpbnQgZ2x5cGhzIHRvIG1ha2UgdGhlbSBh cHBlYXIgdG8gYmUgc2VtaS1ib2xkLCBpdCBjYW4KKyAgICAgICAgICBiZSBkb25lIGhlcmUgZm9y IGFsbCBjdXJzb3IgdHlwZXMuICBUaGUgYm94LXN0eWxlIGN1cnNvcnMgYXJlIGltcHJpbnRlZAor ICAgICAgICAgIHdpdGggZ2x5cGhzIG9ubHkgb25lICgxKSB0aW1lLiAgVGhlIHNlbWktYm9sZCBh cHBlYXJhbmNlIGlzIGhlbHBmdWwgd2hlbgorICAgICAgICAgIGRlYnVnZ2luZyB0byBzZWUgdGhh dCB0aGUgY29vcmRpbmF0ZXMgYXJlIGNvcnJlY3QuICovCisgICAgICAgICAgaWYgKHMtPmNoYXIy YiAhPSBOVUxMCisgICAgICAgICAgICAgICYmIChjdXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9Y CisgICAgICAgICAgICAgICAgICB8fCBjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YCisgICAg ICAgICAgICAgICAgICB8fCBjdXJzb3JfdHlwZSA9PSBNQ19IT0xMT1dfQk9YKSkKKyAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgQk9PTCBpc0NvbXBvc2l0ZSA9IHMtPmZpcnN0X2dseXBoLT50 eXBlID09IENPTVBPU0lURV9HTFlQSDsKKyAgICAgICAgICAgICAgaWYgKGlzQ29tcG9zaXRlKQor ICAgICAgICAgICAgICAgIG5zX2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5k IChzKTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICB7CisgICAgICAg ICAgICAgICAgICAgIHN0cnVjdCBmb250ICpmb250ID0gcy0+ZmFjZS0+Zm9udDsKKyAgICAgICAg ICAgICAgICAgICAgaWYgKCFmb250KQorICAgICAgICAgICAgICAgICAgICAgIGZvbnQgPSBGUkFN RV9GT05UIChzLT5mKTsKKyAgICAgICAgICAgICAgICAgICAgYm9vbCB3aXRoX2JnX3AgPSBmYWxz ZTsKKyAgICAgICAgICAgICAgICAgICAgZm9udC0+ZHJpdmVyLT5kcmF3IChzLCBzLT5jbXBfZnJv bSwgcy0+bmNoYXJzLCBzLT54LCBzLT55YmFzZSwgd2l0aF9iZ19wKTsKKyAgICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgLy8gIGNsb2NrX3QgY2xv Y2tfZW5kID0gY2xvY2soKTsKKyAgLy8gIGRvdWJsZSBjcHVfdGltZV91c2VkID0gKChkb3VibGUp IChjbG9ja19lbmQgLSBjbG9ja19zdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7CisgIC8vICBmcHJp bnRmIChzdGRlcnIsICJuc19kcmF3X292ZXJ3cml0dGVuICglZCk6ICBUSU1FICglZilcbiIsIHZw b3MsIGNwdV90aW1lX3VzZWQpOworfQorCitzdGF0aWMgdm9pZAorbWNfbnNfZHJhd193aW5kb3df Y3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsIHN0 cnVjdCBnbHlwaF9yb3cgKnJvdywKKyAgICAgICAgICAgICAgICAgIGludCB4LCBpbnQgZngsIGlu dCB5LCBpbnQgZnksIGludCBocG9zLCBpbnQgdnBvcywgaW50IHdkLCBpbnQgaCwKKyAgICAgICAg ICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsLCBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90 eXBlLAorICAgICAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aCwgZW51bSBtY19mbGF2b3Ig Z2x5cGhfZmxhdm9yLCBib29sIG9uX3AsIGJvb2wgYWN0aXZlX3ApCit7CisgIC8qIFRoZSBwcmlv ciBidWcgb2YgYSBkb3VibGUgaW1wcmludCBvbiB0aGUgZ2x5cGggd2hlc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wgYmFja2dyb3VuZCAoJXMpXG4iLAorICAgICAgICAgICAg ICAgICAgICAgICghTklMUCAoZm9yZWdyb3VuZCkgPyBTU0RBVEEgKGZvcmVncm91bmQpIDogIk5J TFAiKSwKKyAgICAgICAgICAgICAgICAgICAgICAoIU5JTFAgKGJhY2tncm91bmQpID8gU1NEQVRB IChiYWNrZ3JvdW5kKSA6ICJOSUxQIikpOworICAtICBFWEFNUExFIE9GIEhPVyBUTyBDUkVBVEUg QSBDT0xPUiBXSVRIIFJHQi9MU0wgZmxvYXQgdmFsdWVzOgorICAgICBOU0NvbG9yICpteV9jb2xv ciA9IFtOU0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6IDEuMAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JlZW46IDEuMAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJsdWU6IDEuMAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwaGE6IDEu MF07CisgIC0gIEFMVEVSTkFUSVZFIEVYQU1QTEU6CisgICAgIGVudW0gZmFjZV9pZCBkZWJ1Z2dp bmdfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlIChzLT53LCBzLT5mLCBpbnRlcm4gKCIrLWRl YnVnZ2luZy1mYWNlIiksIHRydWUpOworICAgICBzdHJ1Y3QgZmFjZSAqZGVidWdnaW5nX2ZhY2Ug PSBGQUNFX0ZST01fSUQgKHMtPmYsIGRlYnVnZ2luZ19mYWNlX2lkKTsKKyAgICAgTlNDb2xvciAq Y29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChkZWJ1 Z2dpbmdfZmFjZSksIHMtPmYpOworICAgICBbY29sb3Igc2V0XTsgKi8KKyAgaWYgKGdseXBoX2Zs YXZvciA9PSBNQ19HTFlQSAorICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBITEVTUykK KyAgICBbW05TQ29sb3IgY29sb3JXaXRoQ2FsaWJyYXRlZFJlZDogbHNsLnJlZAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGdyZWVuOiBsc2wuZ3JlZW4KKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgYmx1ZTogbHNsLmJsdWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBhbHBoYTogMS4wXSBzZXRdOworICAgIGVsc2UKKyAgICAgIFtGUkFNRV9DVVJTT1JfQ09M T1IgKGYpIHNldF07CisgIGlmIChjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YKQorICAgIHsK KyAgICAgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSICh3LT5jb250ZW50cyk7CisgICAgICBi b29sIHJlZ2lvbl9hY3RpdmVfcCA9ICghTklMUCAoVnRyYW5zaWVudF9tYXJrX21vZGUpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgbWFya19hY3RpdmUp KSk7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2JlZyA9IChyZWdpb25fYWN0aXZlX3ApID8gbWNf cmVnaW9uX2xpbWl0ICgxKSA6IC0xOworICAgICAgcHRyZGlmZl90IHJlZ2lvbl9lbmQgPSAocmVn aW9uX2FjdGl2ZV9wKSA/IG1jX3JlZ2lvbl9saW1pdCAoMCkgOiAtMTsKKyAgICAgIGlmIChyZWdp b25fYWN0aXZlX3AKKyAgICAgICAgICAmJiBhY3RpdmVfcAorICAgICAgICAgICYmIGN1cnNvcl9n bHlwaC0+Y2hhcnBvcyA9PSByZWdpb25fYmVnKQorICAgICAgICB7CisgICAgICAgICAgZW51bSBm YWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2JlZ19mYWNlX2lkID0gbG9va3VwX25hbWVkX2Zh Y2UgKHcsI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xsb3dfaW5hY3RpdmVfZmFjZSA9IEZB Q0VfRlJPTV9JRCAoZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAg ICAgTlNDb2xvciAqaG9sbG93X2luYWN0aXZlX2NvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29s b3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoaG9sbG93X2luYWN0aXZlX2ZhY2UpLCBmKTsKKyAgICAg ICAgICAgICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19pbmFjdGl2ZV9jb2xvcjsKKyAgICAg ICAgICAgICAgICB9CisgICAgfQorICAgIGVsc2UgaWYgKGZhY2UgJiYgTlNfRkFDRV9CQUNLR1JP VU5EIChmYWNlKSA9PSBuc19pbmRleF9jb2xvciAoRlJBTUVfQ1VSU09SX0NPTE9SIChmKSwgZikp CisgICAgICB7CisgICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JF R1JPVU5EIChmYWNlKSwgZikgc2V0XTsKKyAgICAgICAgaG9sbG93X2NvbG9yID0gRlJBTUVfQ1VS U09SX0NPTE9SIChmKTsKKyAgICAgIH0KKyNpZmRlZiBOU19JTVBMX0NPQ09BCisgIE5TRGlzYWJs ZVNjcmVlblVwZGF0ZXMgKCk7CisjZW5kaWYKKyAgc3dpdGNoIChjdXJzb3JfdHlwZSkKKyAgICB7 CisgICAgICBjYXNlIE1DX05PX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGJyZWFrOworICAgICAg Y2FzZSBNQ19OT19DVVJTT1I6CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19SSUdIVF9G UklOR0VfQklUTUFQOgorICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfTEVGVF9GUklOR0Vf QklUTUFQOgorICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAgICAg ICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19GUkFNRURf Qk9YOgorICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgW2hvbGxvd19jb2xvciBzZXRd OworICAgICAgICBOU1JlY3RGaWxsIChOU0luc2V0UmVjdCAociwgMSwgMSkpOworICAgICAgICBb RlJBTUVfQ1VSU09SX0NPTE9SIChmKSBzZXRdOworICAgICAgICBicmVhazsKKyAgICAgIGNhc2Ug TUNfSE9MTE9XX0JPWDoKKyAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgIFtob2xsb3df Y29sb3Igc2V0XTsKKyAgICAgICAgTlNSZWN0RmlsbCAoTlNJbnNldFJlY3QgKHIsIDEsIDEpKTsK KyAgICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAoZikgc2V0XTsKKyAgICAgICAgYnJlYWs7Cisg ICAgICBjYXNlIE1DX0hCQVI6CisgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICBicmVh azsKKyAgICAgIGNhc2UgTUNfQkFSOgorICAgICAgICBzID0gcjsKKyAgICAgICAgLyogQGxhd2xp c3QgaXMgZm9jdXNpbmcgdGhlIGluaXRpYWwgZGV2ZWxvcG1lbnQgb2YgZmVhdHVyZSByZXF1ZXN0 cworICAgICAgICAjMTc2ODQgYW5kICMyMjg3MyBvbiBMMlIgbGFuZ3VhZ2VzLiAqLworICAgICAg ICBpZiAoZ2x5cGhfZmxhdm9yICE9IE1DX0dMWVBICisgICAgICAgICAgICAmJiBnbHlwaF9mbGF2 b3IgIT0gTUNfR0xZUEhMRVNTKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIC8qIElmIHRoZSBj aGFyYWN0ZXIgdW5kZXIgY3Vyc29yIGlzIFIyTCwgZHJhdyB0aGUgYmFyIGN1cnNvcgorICAgICAg ICAgICAgICAgb24gdGhlIHJpZ2h0IG9mIGl0cyBnbHlwaCwgcmF0aGVyIHRoYW4gb24gdGhlIGxl ZnQuICovCisgICAgICAgICAgICBpZiAoKGN1cnNvcl9nbHlwaC0+cmVzb2x2ZWRfbGV2ZWwgJiAx KSAhPSAwKQorICAgICAgICAgICAgICBzLm9yaWdpbi54ICs9IGN1cnNvcl9nbHlwaC0+cGl4ZWxf d2lkdGggLSBzLnNpemUud2lkdGg7CisgICAgICAgICAgfQorICAgICAgICBOU1JlY3RGaWxsIChz KTsKKyAgICAgICAgYnJlYWs7CisgICAgfQorICBuc19yZXNldF9jbGlwcGluZyAoZik7CisgIC8q IGRyYXcgdGhlIGNoYXJhY3RlciB1bmRlciB0aGUgY3Vyc29yICovCisgIGlmIChnbHlwaF9mbGF2 b3IgIT0gTUNfR0xZUEhMRVNTCisgICAgICAmJiAoY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JP WAorICAgICAgICAgIHx8IGN1cnNvcl90eXBlID09IE1DX0ZJTExFRF9CT1gKKyAgICAgICAgICB8 fCBjdXJzb3JfdHlwZSA9PSBNQ19IT0xMT1dfQk9YCisgICAgICAgICAgfHwgKGRlYnVnX3AKKyAg ICAgICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gTUNfSEJBUikKKyAgICAgICAgICB8fCAoZGVi dWdfcAorICAgICAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19CQVIpKSkKKyAgICB7Cisg ICAgICAvKiBgY3Vyc29yX2djX3BgIGlzIHVzZWQgb25seSBieSBgdzMydGVybS5jYCBhbmQgYHh0 ZXJtLmMnLiAqLworICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IGZhbHNlOworICAgICAgY29uc3Qg RW1hY3NfUmVjdGFuZ2xlICpzYXZlZF9jbGlwID0gTlVMTDsKKyAgICAgIGlmIChyb3ctPmNsaXAg IT0gTlVMTCkKKyAgICAgICAgeworICAgICAgICAgIHNhdmVkX2NsaXAgPSByb3ctPmNsaXA7Cisg ICAgICAgICAgcm93LT5jbGlwID0gTlVMTDsKKyAgICAgICAgfQorICAgICAgbWNfZ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ERVJfV0FWRSkKKyAgICAgICAgeworICAgICAgICAgIGlmIChmYWNlLT51bmRlcmxp bmVfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICBbZGVmYXVsdENvbCBzZXRdOworICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKGZhY2UtPnVu ZGVybGluZV9jb2xvciwgcy0+Zikgc2V0XTsKKyAgICAgICAgICBuc19kcmF3X3VuZGVyd2F2ZSAo cywgd2lkdGgsIHgpOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKHMtPmZhY2UtPnVuZGVy bGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBO U1JlY3QgcjsKKyAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgdGhpY2tuZXNzLCBwb3NpdGlvbjsK KyAgICAgICAgICAgIC8qIElmIHRoZSBwcmV2IHdhcyB1bmRlcmxpbmVkLCBtYXRjaCBpdHMgYXBw ZWFyYW5jZS4gKi8KKyAgICAgICAgICAgIGlmIChzLT5wcmV2ICYmIHMtPnByZXYtPmZhY2UtPnVu ZGVybGluZV9wCisgICAgICAgICAgICAgICAgJiYgcy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3R5 cGUgPT0gRkFDRV9VTkRFUl9MSU5FCisgICAgICAgICAgICAgICAgJiYgcy0+cHJldi0+dW5kZXJs aW5lX3RoaWNrbmVzcyA+IDApCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB0aGlj a25lc3MgPSBzLT5wcmV2LT51bmRlcmxpbmVfdGhpY2tuZXNzOworICAgICAgICAgICAgICAgIHBv c2l0aW9uID0gcy0+cHJldi0+dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBz dHJ1Y3QgZm9udCAqZm9udDsKKyAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZGVzY2Vu dDsKKyAgICAgICAgICAgICAgICAgIGZvbnQ9cy0+Zm9udDsKKyAgICAgICAgICAgICAgICAgIGRl c2NlbnQgPSBzLT55ICsgcy0+aGVpZ2h0IC0gcy0+eWJhc2U7CisgICAgICAgICAgICAgICAgICAv KiBVc2UgdW5kZXJsaW5lIHRoaWNrbmVzcyBvZiBmb250LCBkZWZhdWx0aW5nIHRvIDEuICovCisg ICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAoZm9udCAmJiBmb250LT51bmRlcmxpbmVfdGhp Y2tuZXNzID4gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZm9udC0+dW5kZXJs aW5lX3RoaWNrbmVzcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAxOworICAgICAg ICAgICAgICAgICAgLyogRGV0ZXJtaW5lIHRoZSBvZmZzZXQgb2YgdW5kZXJsaW5pbmcgZnJvbSB0 aGUgYmFzZWxpbmUuICovCisgICAgICAgICAgICAgICAgICBpZiAoeF91bmRlcmxpbmVfYXRfZGVz Y2VudF9saW5lKQorICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IGRlc2NlbnQgLSB0aGlj a25lc3M7CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHhfdXNlX3VuZGVybGluZV9wb3Np dGlvbl9wcm9wZXJ0aWVzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGZvbnQgJiYg Zm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uID49IDApCisgICAgICAgICAgICAgICAgICAgICAgcG9z aXRpb24gPSBmb250LT51bmRlcmxpbmVfcG9zaXRpb247CisgICAgICAgICAgICAgICAgICAgICAg ZWxzZSBpZiAoZm9udCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gbHJvdW5k IChmb250LT5kZXNjZW50IC8gMik7CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAg ICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0 OworICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBtYXggKHBvc2l0aW9uLCB1bmRlcmxpbmVf bWluaW11bV9vZmZzZXQpOworICAgICAgICAgICAgICAgICAgLyogRW5zdXJlIHVuZGVybGluaW5n IGlzIG5vdCBjcm9wcGVkLiAqLworICAgICAgICAgICAgICAgICAgaWYgKGRlc2NlbnQgPD0gcG9z aXRpb24pCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBwb3Np dGlvbiA9IGRlc2NlbnQgLSAxOworICAgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IDE7 CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoZGVz Y2VudCA8IHBvc2l0aW9uICsgdGhpY2tuZXNzKQorICAgICAgICAgICAgICAgICAgICAgIHRoaWNr bmVzcyA9IDE7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgcy0+dW5kZXJsaW5lX3Ro aWNrbmVzcyA9IHRoaWNrbmVzczsKKyAgICAgICAgICAgIHMtPnVuZGVybGluZV9wb3NpdGlvbiA9 IHBvc2l0aW9uOworICAgICAgICAgICAgciA9IE5TTWFrZVJlY3QgKHgsIHMtPnliYXNlICsgcG9z aXRpb24sIHdpZHRoLCB0aGlja25lc3MpOworICAgICAgICAgICAgaWYgKGZhY2UtPnVuZGVybGlu ZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsKKyAgICAgICAg ICAgICAgZWxzZQorICAgICAgICAgICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoZmFj ZS0+dW5kZXJsaW5lX2NvbG9yLCBzLT5mKSBzZXRdOworICAgICAgICAgICAgTlNSZWN0RmlsbCAo cik7CisgICAgICAgICAgfQorICAgIH0KKyAgLyogRG8gb3ZlcmxpbmUuIFdlIGZvbGxvdyBvdGhl ciB0ZXJtcyBpbiB1c2luZyBhIHRoaWNrbmVzcyBvZiAxCisgICAgIGFuZCBpZ25vcmluZyBvdmVy bGluZV9tYXJnaW4uICovCisgIGlmIChmYWNlLT5vdmVybGluZV9wKQorICAgIHsKKyAgICAgIE5T UmVjdCByOworICAgICAgciA9IE5TTWFrZVJlY3QgKHgsIHMtPnksIHdpZHRoLCAxKTsKKyAgICAg IGlmIChmYWNlLT5vdmVybGluZV9jb2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgW2RlZmF1bHRD b2wgc2V0XTsKKyAgICAgICAgZWxzZQorICAgICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xv ciAoZmFjZS0+b3ZlcmxpbmVfY29sb3IsIHMtPmYpIHNldF07CisgICAgICBOU1JlY3RGaWxsIChy KTsKKyAgICB9CisgIC8qIERvIHN0cmlrZS10aHJvdWdoLiAgV2UgZm9sbG93IG90aGVyIHRlcm1z IGZvciB0aGlja25lc3MgYW5kCisgICAgIHZlcnRpY2FsIHBvc2l0aW9uLiovCisgIGlmIChmYWNl LT5zdHJpa2VfdGhyb3VnaF9wKQorICAgIHsKKyAgICAgIE5TUmVjdCByOworICAgICAgdW5zaWdu ZWQgbG9uZyBkeTsKKyAgICAgIGR5ID0gbHJpbnQgKChzLT5oZWlnaHQgLSAxKSAvIDIpOworICAg ICAgciA9IE5TTWFrZVJlY3QgKHgsIHMtPnkgKyBkeSwgd2lkdGgsIDEpOworICAgICAgaWYgKGZh Y2UtPnN0cmlrZV90aHJvdWdoX2NvbG9yX2RlZmF1bHRlZF9wKQorICAgICAgICBbZGVmYXVsdENv bCBzZXRdOworICAgICAgICBlbHNlCisgICAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9y IChmYWNlLT5zdHJpa2VfdGhyb3VnaF9jb2xvciwgcy0+Zikgc2V0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HUk9VTkQgKGZhY2UpLCBzLT5mKTsKKyAgICAgIGZnQ29sID0gbnNf bG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoZmFjZSksIHMtPmYpOwor ICAgICAgZm9yIChpID0gMDsgaSA8IG47ICsraSkKKyAgICAgICAgeworICAgICAgICAgIGlmICgh cy0+cm93LT5mdWxsX3dpZHRoX3ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGludCBv dmVycnVuLCBsZWZ0b3ZlcnJ1bjsKKyAgICAgICAgICAgICAgLyogdHJ1bmNhdGUgdG8gYXZvaWQg b3ZlcndyaXRpbmcgZnJpbmdlIGFuZC9vciBzY3JvbGxiYXIgKi8KKyAgICAgICAgICAgICAgb3Zl cnJ1biA9IG1heCAoMCwgKHMtPnggKyBzLT5iYWNrZ3JvdW5kX3dpZHRoKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgLSAoV0lORE9XX0JPWF9SSUdIVF9FREdFX1ggKHMtPncpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIFdJTkRPV19SSUdIVF9GUklOR0VfV0lEVEgg KHMtPncpKSk7CisgICAgICAgICAgICAgICAgICAgIHJbaV0uc2l6ZS53aWR0aCAtPSBvdmVycnVu OworICAgICAgICAgICAgICAvKiB0cnVuY2F0ZSB0byBhdm9pZCBvdmVyd3JpdGluZyB0byBsZWZ0 IG9mIHRoZSB3aW5kb3cgYm94ICovCisgICAgICAgICAgICAgIGxlZnRvdmVycnVuID0gKFdJTkRP V19CT1hfTEVGVF9FREdFX1ggKHMtPncpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsg V0lORE9XX0xFRlRfRlJJTkdFX1dJRFRIIChzLT53KSkgLSBzLT54OworICAgICAgICAgICAgICBp ZiAobGVmdG92ZXJydW4gPiAwKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAg IHJbaV0ub3JpZ2luLnggKz0gbGVmdG92ZXJydW47CisgICAgICAgICAgICAgICAgICByW2ldLnNp emUud2lkdGggLT0gbGVmdG92ZXJydW47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICAvKiBYWFg6IFRyeSB0byB3b3JrIGJldHdlZW4gcHJvYmxlbSB3aGVyZSBhIHN0cmV0Y2ggZ2x5 cGggb24KKyAgICAgICAgICAgICAgICAgYSBwYXJ0aWFsbHktdmlzaWJsZSBib3R0b20gcm93IHdp bGwgY2xlYXIgcGFydCBvZiB0aGUKKyAgICAgICAgICAgICAgICAgbW9kZWxpbmUsIGFuZCBhbm90 aGVyIHdoZXJlIGxpc3QtYnVmZmVycyBoZWFkZXJzIGFuZCBzaW1pbGFyCisgICAgICAgICAgICAg ICAgIHJvd3MgZXJyb25lb3VzbHkgaGF2ZSB2aXNpYmxlX2hlaWdodCBzZXQgdG8gMC4gIE5vdCBz dXJlCisgICAgICAgICAgICAgICAgIHdoZXJlIHRoaXMgaXMgY29taW5nIGZyb20gYXMgb3RoZXIg dGVybXMgc2VlbSBub3QgdG8gc2hvdy4gKi8KKyAgICAgICAgICAgICAgcltpXS5zaXplLmhlaWdo dCA9IG1pbiAocy0+aGVpZ2h0LCBzLT5yb3ctPnZpc2libGVfaGVpZ2h0KTsKKyAgICAgICAgICAg IH0KKyAgICAgICAgICBbYmdDb2wgc2V0XTsKKyAgICAgICAgICAvKiBOT1RFOiB1bmRlciBOUyB0 aGlzIGlzIE5PVCB1c2VkIHRvIGRyYXcgY3Vyc29ycywgYnV0IHdlIG11c3QgYXZvaWQKKyAgICAg ICAgICAgICBvdmVyd3JpdGluZyBjdXJzb3IgKHVzdWFsbHkgd2hlbiBjdXJzb3Igb24gYSB0YWIp ICovCisgICAgICAgICAgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICAvKiBGSVhNRTogIERvIHdlIHN0aWxsIG5lZWQgdG8gcHJldmVudCB0aGlz IHNlY3Rpb24gb2YgY29kZSBmcm9tCisgICAgICAgICAgICAgIGVyYXNpbmcgdGhlIGZha2UgTUNf SEJBUiB0aGF0IGV4dGVuZHMgdGhlIGVudGlyZSBsZW5ndGggb2YgdGhlCisgICAgICAgICAgICAg IFNUUkVUQ0hfR0xZUEg/ICBUaGlzIG1heSBoYXZlIGJlZW4gZG9uZSBwcmlvciB0byB0aGUgZml4 IHJlbGF0aW5nCisgICAgICAgICAgICAgIHRvIGxlZnQvcmlnaHQgb3ZlcndyaXR0ZW4gZ2x5cGhz LiAqLworICAgICAgICAgICAgICByW2ldLnNpemUuaGVpZ2h0IC09IDE7CisgICAgICAgICAgICAg IC8vICBlbnVtIGZhY2VfaWQgZGVidWdnaW5nX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAo cy0+dywgcy0+ZiwgaW50ZXJuICgiKy1kZWJ1Z2dpbmctZmFjZSIpLCB0cnVlKTsKKyAgICAgICAg ICAgICAgLy8gIHN0cnVjdCBmYWNlICpkZWJ1Z2dpbmdfZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ ZiwgZGVidWdnaW5nX2ZhY2VfaWQpOworICAgICAgICAgICAgICAvLyAgTlNDb2xvciAqY29sb3Ig PSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChkZWJ1Z2dpbmdf ZmFjZSksIHMtPmYpOworICAgICAgICAgICAgICAvLyAgW2NvbG9yIHNldF07CisgICAgICAgICAg ICAgIENHRmxvYXQgeCA9IHJbaV0ub3JpZ2luLng7CisgICAgICAgICAgICAgIENHRmxvYXQgd2lk dGggPSB3ZDsKKyAgICAgICAgICAgICAgcltpXS5zaXplLndpZHRoIC09IHdpZHRoOworICAgICAg ICAgICAgICByW2ldLm9yaWdpbi54ICs9IHdpZHRoOworICAgICAgICAgICAgICBOU1JlY3RGaWxs IChyW2ldKTsKKyAgICAgICAgICAgICAgLyogRHJhdyBvdmVybGluaW5nLCBldGMuIG9uIHRoZSBj dXJzb3IuICovCisgICAgICAgICAgICAgIGlmIChzLT53LT5waHlzX2N1cnNvcl90eXBlID09IE1D X0ZJTExFRF9CT1gpCisgICAgICAgICAgICAgICAgbWNfbnNfZHJhd190ZXh0X2RlY29yYXRpb24g KHMsIGZhY2UsIGJnQ29sLCB3aWR0aCwgeCk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICAgICAgbWNfbnNfZHJhd190ZXh0X2RlY29yYXRpb24gKHMsIGZhY2UsIGZnQ29sLCB3 aWR0aCwgeCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgewor ICAvLyAgaW50IHJ4ID0gcltpXS5vcmlnaW4ueDsKKyAgLy8gIGludCByeSA9IHJbaV0ub3JpZ2lu Lnk7CisgIC8vICBpbnQgcncgPSByW2ldLnNpemUud2lkdGg7CisgIC8vICBpbnQgcmggPSByW2ld LnNpemUuaGVpZ2h0OworICAvLyAgZnByaW50ZiAoc3RkZXJyLCAibWNfbnNfZHVtcGdseXBoc19z dHJldGNoOiAgdnBvcyAoJWQpIHwgcnggKCVkKSB8IHJ5ICglZCkgfCBydyAoJWQpIHwgcmggKCVk KVxuIiwKKyAgLy8gICAgICAgICAgICAgICAgICAgcy0+Zmlyc3RfZ2x5cGgtPnZwb3MsIHJ4LCBy eSwgcncsIHJoKTsKKyAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocltpXSk7CisgICAgICAgICAg ICB9CisgICAgICAgICAgLyogRHJhdyBvdmVybGluaW5nLCBldGMuIG9uIHRoZSBzdHJldGNoIGds eXBoIChvciB0aGUgcGFydAorICAgICAgICAgICAgIG9mIHRoZSBzdHJldGNoIGdseXBoIGFmdGVy IHRoZSBjdXJzb3IpLiAqLworICAgICAgICAgIG1jX25zX2RyYXdfdGV4dF9kZWNvcmF0aW9uIChz LCBmYWNlLCBmZ0NvbCwgcltpXS5zaXplLndpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICByW2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uLiBkbyB3ZSBuZWVkIHRvIGRyYXcgcGxhY2Vob2xkZXIgaWYgaW1n ID09bmlsPyAqLworICBpZiAoaW1nICE9IG5pbCkKKyAgICB7CisjaWZkZWYgTlNfSU1QTF9DT0NP QQorICAgICAgTlNSZWN0IGRyID0gTlNNYWtlUmVjdCAoeCwgeSwgcy0+c2xpY2Uud2lkdGgsIHMt PnNsaWNlLmhlaWdodCk7CisgICAgICBOU1JlY3QgaXIgPSBOU01ha2VSZWN0IChzLT5zbGljZS54 LCBzLT5zbGljZS55LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+c2xpY2Uud2lk dGgsIHMtPnNsaWNlLmhlaWdodCk7CisgICAgICBbaW1nIGRyYXdJblJlY3Q6IGRyCisgICAgICAg ICAgICAgZnJvbVJlY3Q6IGlyCisgICAgICAgICAgICAgb3BlcmF0aW9uOiBOU0NvbXBvc2l0ZVNv dXJjZU92ZXIKKyAgICAgICAgICAgICAgZnJhY3Rpb246IDEuMAorICAgICAgICAgICByZXNwZWN0 RmxpcHBlZDogWUVTCisgICAgICAgICAgICAgICAgaGludHM6IG5pbF07CisjZWxzZQorICAgICAg W2ltZyBjb21wb3NpdGVUb1BvaW50OiBOU01ha2VQb2ludCAoeCwgeSArIHMtPnNsaWNlLmhlaWdo dCkKKyAgICAgICAgICAgICAgICAgIG9wZXJhdGlvbjogTlNDb21wb3NpdGVTb3VyY2VPdmVyXTsK KyNlbmRpZgorICAgIH0KKyAgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SKQorICAgIHsKKyAgICAg IFtGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpIHNldF07CisgICAgICBpZiAocy0+dy0+cGh5c19j dXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9YKQorICAgICAgICB0ZENvbCA9IG5zX2xvb2t1cF9p bmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpLCBzLT5mKTsKKyAgICAgICAg ZWxzZQorICAgICAgICAgIC8qIEN1cnJlbnRseSBvbiBOUyBpbWctPm1hc2sgaXMgYWx3YXlzIDAu IFNpbmNlCisgICAgICAgICAgICAgZ2V0X3dpbmRvd19jdXJzb3JfdHlwZSBzcGVjaWZpZXMgYSBo b2xsb3cgYm94IGN1cnNvciB3aGVuIG9uCisgICAgICAgICAgICAgYSBub24tbWFza2VkIGltYWdl IHdlIG5ldmVyIHJlYWNoIHRoaXMgY2xhdXNlLiBCdXQgd2UgcHV0IGl0CisgICAgICAgICAgICAg aW4gaW4gYW50aWNpcGF0aW9uIG9mIGJldHRlciBzdXBwb3J0IGZvciBpbWFnZSBtYXNrcyBvbiBO Uy4gKi8KKyAgICAgICAgICB0ZENvbCA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNF X0ZPUkVHUk9VTkQgKGZhY2UpLCBzLT5mKTsKKyAgICB9CisgICAgZWxzZQorICAgICAgdGRDb2wg PSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChmYWNlKSwgcy0+ Zik7CisgIC8qIERyYXcgdW5kZXJsaW5lLCBvdmVybGluZSwgc3RyaWtlLXRocm91Z2guICovCisg IG1jX25zX2RyYXdfdGV4dF9kZWNvcmF0aW9uIChzLCBmYWNlLCB0ZENvbCwgYnIuc2l6ZS53aWR0 aCwgYnIub3JpZ2luLngpOworICAvKiBEcmF3IHJlbGllZiwgaWYgcmVxdWVzdGVkICovCisgIGlm IChzLT5pbWctPnJlbGllZiB8fCBzLT5obCA9PURSQVdfSU1BR0VfUkFJU0VEIHx8IHMtPmhsID09 RFJBV19JTUFHRV9TVU5LRU4pCisgICAgeworICAgICAgaWYgKHMtPmhsID09IERSQVdfSU1BR0Vf U1VOS0VOIHx8IHMtPmhsID09IERSQVdfSU1BR0VfUkFJU0VEKQorICAgICAgICB7CisgICAgICAg ICAgdGggPSB0b29sX2Jhcl9idXR0b25fcmVsaWVmID49IDAgPworICAgICAgICAgICAgdG9vbF9i YXJfYnV0dG9uX3JlbGllZiA6IERFRkFVTFRfVE9PTF9CQVJfQlVUVE9OX1JFTElFRjsKKyAgICAg ICAgICByYWlzZWRfcCA9IChzLT5obCA9PSBEUkFXX0lNQUdFX1JBSVNFRCk7CisgICAgICAgIH0K KyAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIHRoID0gYWJzIChzLT5pbWct PnJlbGllZik7CisgICAgICAgICAgICByYWlzZWRfcCA9IChzLT5pbWctPnJlbGllZiA+IDApOwor ICAgICAgICAgIH0KKyAgICAgIHIub3JpZ2luLnggPSB4IC0gdGg7CisgICAgICByLm9yaWdpbi55 ID0geSAtIHRoOworICAgICAgci5zaXplLndpZHRoID0gcy0+c2xpY2Uud2lkdGggKyAyKnRoLTE7 CisgICAgICByLnNpemUuaGVpZ2h0ID0gcy0+c2xpY2UuaGVpZ2h0ICsgMip0aC0xOworICAgICAg bnNfZHJhd19yZWxpZWYgKHIsIHRoLCByYWlzZWRfcCwKKyAgICAgICAgICAgICAgICAgICAgICBz LT5zbGljZS55ID09IDAsCisgICAgICAgICAgICAgICAgICAgICAgcy0+c2xpY2UueSArIHMtPnNs aWNlLmhlaWdodCA9PSBzLT5pbWctPmhlaWdodCwKKyAgICAgICAgICAgICAgICAgICAgICBzLT5z bGljZS54ID09IDAsCisgICAgICAgICAgICAgICAgICAgICAgcy0+c2xpY2UueCArIHMtPnNsaWNl LndpZHRoID09IHMtPmltZy0+d2lkdGgsIHMpOworICAgIH0KKyAgLyogSWYgdGhlcmUgaXMgbm8g bWFzaywgdGhlIGJhY2tncm91bmQgd29uJ3QgYmUgc2VlbiwKKyAgICAgc28gZHJhdyBhIHJlY3Rh bmdsZSBvbiB0aGUgaW1hZ2UgZm9yIHRoZSBjdXJzb3IuCisgICAgIERvIHRoaXMgZm9yIGFsbCBp bWFnZXMsIGdldHRpbmcgdHJhbnNwYXJlbmN5IHJpZ2h0IGlzIG5vdCByZWxpYWJsZS4gKi8KKyAg aWYgKHMtPmhsID09IERSQVdfQ1VSU09SKQorICAgIHsKKyAgICAgIGludCB0aGlja25lc3MgPSBh YnMgKHMtPmltZy0+cmVsaWVmKTsKKyAgICAgIGlmICh0aGlja25lc3MgPT0gMCkgdGhpY2tuZXNz ID0gMTsKKyAgICBpZiAoZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBICisgICAgICAgIHx8IGdseXBo X2ZsYXZvciA9PSBNQ19HTFlQSExFU1MpCisgICAgICB7CisgICAgICAgIE5TQ29sb3IgKmJvcmRl cl9jb2xvciA9IFtOU0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6IGxzbC5yZWQKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBncmVl bjogbHNsLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGJsdWU6IGxzbC5ibHVlCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwaGE6IDEuMF07CisgICAgICAgIG5z X2RyYXdfYm94IChiciwgdGhpY2tuZXNzLCBib3JkZXJfY29sb3IsIDEsIDEpOworICAgICAgfQor ICAgICAgZWxzZQorICAgICAgICBuc19kcmF3X2JveCAoYnIsIHRoaWNrbmVzcywgRlJBTUVfQ1VS U09SX0NPTE9SIChzLT5mKSwgMSwgMSk7CisgICAgfQorfQorCitzdGF0aWMgdm9pZAorbWNfbnNf bWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzLCBjaGFy IGZvcmNlX3ApCit7CisgIE5TVFJBQ0UgKCJtY19uc19tYXliZV9kdW1wZ2x5cGhzX2JhY2tncm91 bmQiKTsKKyAgaWYgKCFzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wLyogfHwgcy0+aGwgPT0gRFJBV19N T1VTRV9GQUNFKi8pCisgICAgeworICAgICAgaW50IGJveF9saW5lX3dpZHRoID0gbWF4IChzLT5m YWNlLT5ib3hfbGluZV93aWR0aCwgMCk7CisgICAgICBpZiAoRk9OVF9IRUlHSFQgKHMtPmZvbnQp IDwgcy0+aGVpZ2h0IC0gMiAqIGJveF9saW5lX3dpZHRoCisgICAgICAgICAgLyogV2hlbiB4ZGlz cC5jIGlnbm9yZXMgRk9OVF9IRUlHSFQsIHdlIGNhbm5vdCB0cnVzdCBmb250CisgICAgICAgICAg ICAgZGltZW5zaW9ucywgc2luY2UgdGhlIGFjdHVhbCBnbHlwaHMgbWlnaHQgYmUgbXVjaAorICAg ICAgICAgICAgIHNtYWxsZXIuICBTbyBpbiB0aGF0IGNhc2Ugd2UgYWx3YXlzIGNsZWFyIHRoZSBy ZWN0YW5nbGUKKyAgICAgICAgICAgICB3aXRoIGJhY2tncm91bmQgY29sb3IuICovCisgICAgICAg ICAgfHwgRk9OVF9UT09fSElHSCAocy0+Zm9udCkKKyAgICAgICAgICB8fCBzLT5mb250X25vdF9m b3VuZF9wIHx8IHMtPmV4dGVuZHNfdG9fZW5kX29mX2xpbmVfcCB8fCBmb3JjZV9wKQorICAgICAg ICB7CisgICAgICAgICAgc3RydWN0IGZhY2UgKmZhY2U7CisgICAgICAgICAgaWYgKHMtPmhsID09 IERSQVdfTU9VU0VfRkFDRSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgZmFjZSA9IEZB Q0VfRlJPTV9JRCAocy0+ZiwgTU9VU0VfSExfSU5GTyAocy0+ZiktPm1vdXNlX2ZhY2VfZmFjZV9p ZCk7CisgICAgICAgICAgICAgIGlmICghZmFjZSkKKyAgICAgICAgICAgICAgICBmYWNlID0gRkFD RV9GUk9NX0lEIChzLT5mLCBNT1VTRV9GQUNFX0lEKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgICAgZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+Ziwgcy0+Zmly c3RfZ2x5cGgtPmZhY2VfaWQpOworICAgICAgICAgIGlmICghZmFjZS0+c3RpcHBsZSkKKyAgICAg ICAgICAgIFsoTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKSAhPSAwCisgICAgICAgICAgICAgID8g bnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoZmFjZSksIHMtPmYp CisgICAgICAgICAgICAgIDogRlJBTUVfQkFDS0dST1VORF9DT0xPUiAocy0+ZikpIHNldF07Cisg ICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzdHJ1Y3Qg bnNfZGlzcGxheV9pbmZvICpkcHlpbmZvID0gRlJBTUVfRElTUExBWV9JTkZPIChzLT5mKTsKKyAg ICAgICAgICAgICAgICBbW2RweWluZm8tPmJpdG1hcHNbZmFjZS0+c3RpcHBsZS0xXS5pbWcgc3Rp cHBsZU1hc2tdIHNldF07CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICBpZiAocy0+aGwgIT0g RFJBV19DVVJTT1IpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHMtPnJlY3RhbmdsZV9u dWtlZF9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgTlNSZWN0IHIgPSBOU01ha2VSZWN0IChzLT54 LCBzLT55ICsgYm94X2xpbmVfd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBzLT5iYWNrZ3JvdW5kX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgcy0+aGVpZ2h0LTIqYm94X2xpbmVfd2lkdGgpOworICAgICAgICAgICAgICBOU1JlY3RG aWxsIChyKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9w ID0gMTsKKyAgICAgICAgfQorICAgIH0KK30KKworc3RhdGljIHZvaWQKK21jX25zX2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ZXh0OworICAgICAgZm9yICh3aWR0aCA9IDAsIG5leHQgPSBzLT5uZXh0OworICAg ICAgICAgICBuZXh0ICYmIHdpZHRoIDwgcy0+cmlnaHRfb3Zlcmhhbmc7CisgICAgICAgICAgIHdp ZHRoICs9IG5leHQtPndpZHRoLCBuZXh0ID0gbmV4dC0+bmV4dCkKKyAgICAgICAgaWYgKG5leHQt PmZpcnN0X2dseXBoLT50eXBlICE9IElNQUdFX0dMWVBIKQorICAgICAgICAgIHsKKyAgICAgICAg ICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSAhPSBTVFJFVENIX0dMWVBIKQorICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9y ZWN0IChzLT5uZXh0LCByKTsKKyAgICAgICAgICAgICAgICBpZiAoIW5zX2NsaXBfdG9fcmVjdCAo cy0+ZiwgciwgbikpCisgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAg bWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzLT5uZXh0LCAxKTsKKyAgICAgICAg ICAgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICAgICAgICAgIH0KKyAgICAg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIG1jX25zX2R1bXBnbHlwaHNfc3RyZXRjaCAo cy0+bmV4dCwgbWF0cml4LCByb3csIHdkKTsKKyAgICAgICAgICAgIG5leHQtPm51bV9jbGlwcyA9 IDA7CisgICAgICAgICAgfQorICAgIH0KKyAgaWYgKCFzLT5mb3Jfb3ZlcmxhcHMgJiYgcy0+ZmFj ZS0+Ym94ICE9IEZBQ0VfTk9fQk9YCisgICAgICAmJiAocy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0g Q0hBUl9HTFlQSAorICAgICAgICAgIHx8IHMtPmZpcnN0X2dseXBoLT50eXBlID09IENPTVBPU0lU RV9HTFlQSCkpCisgICAgeworICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0 IChzLCByKTsKKyAgICAgIGlmICghbnNfY2xpcF90b19yZWN0IChzLT5mLCByLCBuKSkKKyAgICAg ICAgcmV0dXJuOworICAgICAgbWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzLCAx KTsKKyAgICAgIG5zX2R1bXBnbHlwaHNfYm94X29yX3JlbGllZiAocyk7CisgICAgICBuc19yZXNl dF9jbGlwcGluZyAocy0+Zik7CisgICAgICBib3hfZHJhd25fcCA9IDE7CisgICAgfQorICBzd2l0 Y2ggKHMtPmZpcnN0X2dseXBoLT50eXBlKQorICAgIHsKKyAgICBjYXNlIElNQUdFX0dMWVBIOgor ICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAgICAgIGlm ICghbnNfY2xpcF90b19yZWN0IChzLT5mLCByLCBuKSkKKyAgICAgICAgcmV0dXJuOworICAgICAg bWNfbnNfZHVtcGdseXBoc19pbWFnZSAocywgclswXSwgbHNsLCBnbHlwaF9mbGF2b3IsIGN1cnNv cl90eXBlLCBhY3RpdmVfcCk7CisgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAg ICBicmVhazsKKyAgICBjYXNlIFNUUkVUQ0hfR0xZUEg6CisgICAgICBtY19uc19kdW1wZ2x5cGhz X3N0cmV0Y2ggKHMsIG1hdHJpeCwgcm93LCB3ZCk7CisgICAgICBicmVhazsKKyAgICBjYXNlIENI QVJfR0xZUEg6CisgICAgY2FzZSBDT01QT1NJVEVfR0xZUEg6CisgICAgICBuID0gbnNfZ2V0X2ds eXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsIHIpOworICAgICAgaWYgKCFuc19jbGlwX3RvX3JlY3Qg KHMtPmYsIHIsIG4pKQorICAgICAgICByZXR1cm47CisgICAgICBpZiAocy0+Zm9yX292ZXJsYXBz CisgICAgICAgICAgfHwgKHMtPmNtcF9mcm9tID4gMAorICAgICAgICAgICAgICAmJiAhIHMtPmZp cnN0X2dseXBoLT51LmNtcC5hdXRvbWF0aWMpKQorICAgICAgICBzLT5iYWNrZ3JvdW5kX2ZpbGxl ZF9wID0gMTsKKyAgICAgICAgZWxzZQorICAgICAgICAgIG1jX25zX21heWJlX2R1bXBnbHlwaHNf YmFja2dyb3VuZCAocywgcy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKTsK KyAgICAgIGludCBmbGFncyA9IChzLT5obCA9PSBEUkFXX0NVUlNPUikKKyAgICAgICAgICAgICAg ICAgICAgPyBOU19EVU1QR0xZUEhfQ1VSU09SCisgICAgICAgICAgICAgICAgICA6IChzLT5obCA9 PSBEUkFXX01PVVNFX0ZBQ0UpCisgICAgICAgICAgICAgICAgICAgID8gTlNfRFVNUEdMWVBIX01P VVNFRkFDRQorICAgICAgICAgICAgICAgICAgOiAocy0+Zm9yX292ZXJsYXBzKQorICAgICAgICAg ICAgICAgICAgICA/IE5TX0RVTVBHTFlQSF9GT1JFR1JPVU5ECisgICAgICAgICAgICAgICAgICA6 IE5TX0RVTVBHTFlQSF9OT1JNQUw7CisgICAgICB1bnNpZ25lZCBsb25nIHNhdmVkX2ZnID0gTlNf RkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKTsKKyAgICAgIGlmIChzLT5obCA9PSBEUkFXX0NVUlNP UiAmJiBjdXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9YKQorICAgICAgICB7CisgICAgICAgICAg dW5zaWduZWQgbG9uZyB0bXAgPSBOU19GQUNFX0JBQ0tHUk9VTkQgKHMtPmZhY2UpOworICAgICAg ICAgIE5TX0ZBQ0VfQkFDS0dST1VORCAocy0+ZmFjZSkgPSBOU19GQUNFX0ZPUkVHUk9VTkQgKHMt PmZhY2UpOworICAgICAgICAgIE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSkgPSB0bXA7Cisg ICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IKKyAgICAgICAg ICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWAorICAgICAgICAgICAgICAg ICAmJiBhY3RpdmVfcCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9s bG93X2FjdGl2ZV9mYWNlX2lkID0KKyAgICAgICAgICAgICAgbG9va3VwX25hbWVkX2ZhY2UgKHMt PncsIHMtPmYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVl KTsKKyAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZS T01fSUQgKHMtPmYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICBOU19GQUNF X0ZPUkVHUk9VTkQgKHMtPmZhY2UpID0gTlNfRkFDRV9GT1JFR1JPVU5EIChob2xsb3dfYWN0aXZl X2ZhY2UpOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmIChzLT5obCA9PSBEUkFXX0NV UlNPUgorICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl90eXBlID09IE1DX0ZSQU1FRF9CT1gK KyAgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkID0KKyAgICAgICAgICAg ICAgICBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ZiwgaW50ZXJuICgiKy1yZWFsLWZha2Ut Y3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICBzdHJ1 Y3QgZmFjZSAqaG9sbG93X2luYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIGhvbGxv d19pbmFjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgTlNfRkFDRV9GT1JFR1JPVU5EIChz LT5mYWNlKSA9IE5TX0ZBQ0VfRk9SRUdST1VORCAoaG9sbG93X2luYWN0aXZlX2ZhY2UpOworICAg ICAgICAgICAgfQorICAgICAgaWYgKHMtPmZpcnN0X2dseXBoLT50eXBlID09IENPTVBPU0lURV9H TFlQSCkKKyAgICAgICAgbnNfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQg KHMpOworICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCB3aXRoX2Jn X3AgPSAoKGZsYWdzID09IE5TX0RVTVBHTFlQSF9OT1JNQUwgJiYgIXMtPmJhY2tncm91bmRfZmls bGVkX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBmbGFncyA9PSBOU19EVU1Q R0xZUEhfTU9VU0VGQUNFKTsKKyAgICAgICAgICAgIGlmICh3aXRoX2JnX3ApCisgICAgICAgICAg ICAgIHMtPmJhY2tncm91bmRfbnVrZWRfcCA9IHRydWU7CisgICAgICAgICAgICBmb250LT5kcml2 ZXItPmRyYXcgKHMsIHMtPmNtcF9mcm9tLCBzLT5uY2hhcnMsIHMtPngsIHMtPnliYXNlLCB3aXRo X2JnX3ApOworICAgICAgICAgIH0KKyAgICAgIE5TQ29sb3IgKmNvbCA9IChOU19GQUNFX0ZPUkVH Uk9VTkQgKHMtPmZhY2UpICE9IDAKKyAgICAgICAgICAgICAgICAgICAgID8gbnNfbG9va3VwX2lu ZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSksIHMtPmYpCisgICAgICAg ICAgICAgICAgICAgICA6IEZSQU1FX0ZPUkVHUk9VTkRfQ09MT1IgKHMtPmYpKTsKKyAgICAgIFtj b2wgc2V0XTsKKyAgICAgIC8qIERyYXc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X0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSkgPSBzYXZlZF9mZzsKKyAgICAgIG5zX3Jlc2V0X2Ns aXBwaW5nIChzLT5mKTsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgR0xZUEhMRVNTX0dMWVBIOgor ICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAgICAgIGlm ICghbnNfY2xpcF90b19yZWN0IChzLT5mLCByLCBuKSkKKyAgICAgICAgcmV0dXJuOworICAgICAg aWYgKHMtPmZvcl9vdmVybGFwcworICAgICAgICAgIHx8IChzLT5jbXBfZnJvbSA+IDAKKyAgICAg ICAgICAgICAgJiYgISBzLT5maXJzdF9nbHlwaC0+dS5jbXAuYXV0b21hdGljKSkKKyAgICAgICAg cy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IDE7CisgICAgICBlbHNlCisgICAgICAgIG1jX25zX21h eWJlX2R1bXBnbHlwaHNfYmFja2dyb3VuZCAocywgcy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ09N UE9TSVRFX0dMWVBIKTsKKyAgICAgIG5zX3Jlc2V0X2NsaXBwaW5nIChzLT5mKTsKKyAgICAgIGJy ZWFrOworICAgIGRlZmF1bHQ6CisgICAgICBlbWFjc19hYm9ydCAoKTsKKyAgICB9CisgIC8qIERy YXcgYm94IGlmIG5vdCBkb25lIGFscmVhZHkuICovCisgIGlmICghcy0+Zm9yX292ZXJsYXBzCisg ICAgICAmJiAhYm94X2RyYXduX3AKKyAgICAgICYmIHMtPmZhY2UtPmJveCAhPSBGQUNFX05PX0JP WCkKKyAgICB7CisgICAgICBuID0gbnNfZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsIHIp OworICAgICAgaWYgKCFuc19jbGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4pKQorICAgICAgICByZXR1 cm47CisgICAgICBuc19kdW1wZ2x5cGhzX2JveF9vcl9yZWxpZWYgKHMpOworICAgICAgbnNfcmVz ZXRfY2xpcHBpbmcgKHMtPmYpOworICAgIH0KKyAgcy0+bnVtX2NsaXBzID0gMDsKK30KKworLyog ZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC8q ID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09CiAKICAgIE5TVFJBQ0UsIFRyYWNlIHN1cHBvcnQuCkBAIC0xMDc5 LDYgKzIwNDgsMTYgQEAgc3RhdGljIE5TUmVjdCBjb25zdHJhaW5fZnJhbWVfcmVjdChOU1JlY3Qg ZnJhbWVSZWN0LCBib29sIGlzRnVsbHNjcmVlbikKICAgIGV4dGVybmFsIChSSUYpIGNhbGw7IHdo b2xlIGZyYW1lLCBjYWxsZWQgYmVmb3JlIGd1aV91cGRhdGVfd2luZG93X2JlZ2luCiAgICAtLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLSAqLwogeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gZjsKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogI2lmZGVmIE5TX0lNUExfQ09DT0EKICAgRW1hY3NWaWV3 ICp2aWV3ID0gRlJBTUVfTlNfVklFVyAoZik7CiAKQEAgLTExMDksNiArMjA4OCwxNiBAQCBzdGF0 aWMgTlNSZWN0IGNvbnN0cmFpbl9mcmFtZV9yZWN0KE5TUmVjdCBmcmFtZVJlY3QsIGJvb2wgaXNG dWxsc2NyZWVuKQogCiAvKiAgIGlmIChmID09IE1PVVNFX0hMX0lORk8gKGYpLT5tb3VzZV9mYWNl X21vdXNlX2ZyYW1lKSAqLwogICBNT1VTRV9ITF9JTkZPIChmKS0+bW91c2VfZmFjZV9kZWZlciA9 IDA7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBOVUxMOworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKworCiB9CiAKIApAQCAtNDc1OSw2ICs1NzQ4LDE3IEBAIGluIGNlcnRhaW4gc2l0dWF0 aW9ucyAocmFwaWQgaW5jb21pbmcgZXZlbnRzKS4KICAgICAgIGJhciA9IFtbRW1hY3NTY3JvbGxl ciBhbGxvY10gaW5pdEZyYW1lOiByIHdpbmRvdzogd2luXTsKICAgICAgIHdzZXRfdmVydGljYWxf c2Nyb2xsX2JhciAod2luZG93LCBtYWtlX21pbnRfcHRyIChiYXIpKTsKICAgICAgIHVwZGF0ZV9w ID0gWUVTOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09S UyAqLworCisgICAgICAvKiBUaGlzIGlzIG9ubHkgZm9yIGRlYnVnZ2luZyBwdXJwb3Nlcy4gKi8K KyAgICAgIFtiYXIgbWNfc2V0X3JlY3RhbmdsZTogcl07CisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKICAgICB9CiAgIGVsc2UKICAgICB7CkBAIC00NzY2LDEyICs1NzY2LDMwIEBAIGlu IGNlcnRhaW4gc2l0dWF0aW9ucyAocmFwaWQgaW5jb21pbmcgZXZlbnRzKS4KICAgICAgIGJhciA9 IFhOU19TQ1JPTExfQkFSICh3aW5kb3ctPnZlcnRpY2FsX3Njcm9sbF9iYXIpOwogICAgICAgb2xk UmVjdCA9IFtiYXIgZnJhbWVdOwogICAgICAgci5zaXplLndpZHRoID0gb2xkUmVjdC5zaXplLndp ZHRoOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAq LworCiAgICAgICBpZiAoRlJBTUVfTElWRV9QIChmKSAmJiAhTlNFcXVhbFJlY3RzIChvbGRSZWN0 LCByKSkKICAgICAgICAgeworICAgICAgICAgIC8qIFRoZSBtYWluIHdpbmRvdyBoYXMgcHJvYmFi bHkgYmVlbiByZXNpemVkLiAgR3JhY2lvdXNseSBkZWxldGUgdGhlCisgICAgICAgICAgb2xkIHNj cm9sbCBiYXIgd2l0aG91dCByZXBhaW50aW5nIGl0cyByZWN0YW5nbGU7IGFuZCwgY3JlYXRlIGEg bmV3CisgICAgICAgICAgc2Nyb2xsIGJhciBlbHNld2hlcmUuKi8KICAgICAgICAgICBpZiAob2xk UmVjdC5vcmlnaW4ueCAhPSByLm9yaWdpbi54KQorICAgICAgICAgICAgewogICAgICAgICAgICAg ICBuc19jbGVhcl9mcmFtZV9hcmVhIChmLCBsZWZ0LCB0b3AsIHdpZHRoLCBoZWlnaHQpOworICAg ICAgICAgICAgICBbYmFyIG1jX2p1ZGdlXTsKKyAgICAgICAgICAgICAgYmFyID0gW1tFbWFjc1Nj cm9sbGVyIGFsbG9jXSBpbml0RnJhbWU6IHIgd2luZG93OiB3aW5dOworICAgICAgICAgICAgICB3 c2V0X3ZlcnRpY2FsX3Njcm9sbF9iYXIgKHdpbmRvdywgbWFrZV9taW50X3B0ciAoYmFyKSk7Cisg ICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCiAgICAgICAgICAgW2JhciBzZXRGcmFtZTog cl07CiAgICAgICAgIH0KKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgIH0KIAog ICBpZiAodXBkYXRlX3ApCkBAIC00OTMxLDkgKzU5NDksNTcgQEAgaW4gY2VydGFpbiBzaXR1YXRp b25zIChyYXBpZCBpbmNvbWluZyBldmVudHMpLgogICAgIHsKICAgICAgIHZpZXcgPSBbc3Vidmll d3Mgb2JqZWN0QXRJbmRleDogaV07CiAgICAgICBpZiAoIVt2aWV3IGlzS2luZE9mQ2xhc3M6IFtF bWFjc1Njcm9sbGVyIGNsYXNzXV0pIGNvbnRpbnVlOwotICAgICAgaWYgKFt2aWV3IGp1ZGdlXSkK KworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwor ICAvKiBgWFNFVFdJTkRPVycgd2lsbCBzb21ldGltZXMgY2F1c2UgRW1hY3MgdG8gY3Jhc2ggd2hl biBydW5uaW5nIHVuZGVyIGdkYiBldmVuCisgIHRob3VnaCAodyAhPSBOVUxMKS4gIFRoZXJlZm9y ZSwgd2UgY2Fubm90IHJlbGlhYmx5IHVzZSBgV0lORE9XX0xJVkVfUCcuICovCisgIHN0cnVjdCB3 aW5kb3cgKncgPSBbdmlldyBtY19nZXRfd2luZG93XTsKKyAgaWYgKHcgIT0gTlVMTAorICAgICAg JiYgTklMUCAody0+Y29udGVudHMpKQorICAgIHsKKyAgICAgIEJPT0wgZGVidWdfcCA9IGZhbHNl OworICAgICAgaWYgKGRlYnVnX3AKKyAgICAgICAgICAvKiBgd2luZG93X2JveCcgY2FsbHMgYHdp bmRvd19ib3hfaGVpZ2h0Jywgd2hpY2ggd2lsbCBjYXVzZSBFbWFjcyB0bworICAgICAgICAgIGNy YXNoIGlmIEZSQU1FUCAody0+ZnJhbWUpIGlzIG5vdCBzYXRpc2ZpZWQuICovCisgICAgICAgICAg JiYgRlJBTUVQICh3LT5mcmFtZSkpCisgICAgICAgIHsKKyAgICAgICAgICBOU1JlY3QgcjAgPSBb dmlldyBtY19nZXRfcmVjdGFuZ2xlXTsKKyAgICAgICAgICBpbnQgeDAgPSBOU01pblggKHIwKTsK KyAgICAgICAgICBpbnQgeTAgPSBOU01pblkgKHIwKTsKKyAgICAgICAgICBpbnQgd2QwID0gTlNX aWR0aCAocjApOworICAgICAgICAgIGludCBoMCA9IE5TSGVpZ2h0IChyMCk7CisgICAgICAgICAg aW50IHdpbmRvd195LCB3aW5kb3dfaGVpZ2h0OworICAgICAgICAgIHdpbmRvd19ib3ggKHcsIEFO WV9BUkVBLCAwLCAmd2luZG93X3ksIDAsICZ3aW5kb3dfaGVpZ2h0KTsKKyAgICAgICAgICBpbnQg dG9wID0gd2luZG93X3k7CisgICAgICAgICAgaW50IGhlaWdodCA9IHdpbmRvd19oZWlnaHQ7Cisg ICAgICAgICAgaW50IHdpZHRoID0gV0lORE9XX0NPTkZJR19TQ1JPTExfQkFSX0NPTFMgKHcpICog RlJBTUVfQ09MVU1OX1dJRFRIIChmKTsKKyAgICAgICAgICBpbnQgbGVmdCA9IFdJTkRPV19TQ1JP TExfQkFSX0FSRUFfWCAodyk7CisgICAgICAgICAgTlNSZWN0IHIxID0gTlNNYWtlUmVjdCAobGVm dCwgdG9wLCB3aWR0aCwgaGVpZ2h0KTsKKyAgICAgICAgICAvKiBUaGUgcGFyZW50IHZpZXcgaXMg ZmxpcHBlZCwgc28gd2UgbmVlZCB0byBmbGlwIHkgdmFsdWUuICovCisgICAgICAgICAgRW1hY3NW aWV3ICpmcmFtZV92aWV3ID0gRlJBTUVfTlNfVklFVyAoZik7CisgICAgICAgICAgTlNSZWN0IHYg PSBbZnJhbWVfdmlldyBmcmFtZV07CisgICAgICAgICAgcjEub3JpZ2luLnkgPSAodi5zaXplLmhl aWdodCAtIHIxLnNpemUuaGVpZ2h0IC0gcjEub3JpZ2luLnkpOworICAgICAgICAgIGludCB4MSA9 IE5TTWluWCAocjEpOworICAgICAgICAgIGludCB5MSA9IE5TTWluWSAocjEpOworICAgICAgICAg IGludCB3ZDEgPSBOU1dpZHRoIChyMSk7CisgICAgICAgICAgaW50IGgxID0gTlNIZWlnaHQgKHIx KTsKKyAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIlcyAtLSBERUFEOlxuXAorICAgICAgICAg IHgwL3gxICglZC8lZCkgfCB5MC95MSAoJWQvJWQpIHwgd2QwL3dkMSAoJWQvJWQpIHwgaDAvaDEg KCVkLyVkKVxuIiwKKyAgICAgICAgICBtY193aW5kb3cgKHcpLCB4MCwgeDEsIHkwLCB5MSwgd2Qw LCB3ZDEsIGgwLCBoMSk7CisgICAgICAgIH0KKyAgICAgIGlmIChbdmlldyBtY19qdWRnZV0pCiAg ICAgICAgIHJlbW92ZWQgPSBZRVM7CiAgICAgfQorICAgIGVsc2UgaWYgKFt2aWV3IGp1ZGdlXSkK KyAgICAgIHJlbW92ZWQgPSBZRVM7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKKyAg ICB9CiAKICAgaWYgKHJlbW92ZWQpCiAgICAgW2V2aWV3IHVwZGF0ZUZyYW1lU2l6ZTogTk9dOwpA QCAtNTA3NCw2ICs2MTQwLDIwIEBAIHN0YXRpYyBMaXNwX09iamVjdCBuc19zdHJpbmdfdG9fbGlz cG1vZCAoY29uc3QgY2hhciAqcykKIGV4dGVybiBmcmFtZV9wYXJtX2hhbmRsZXIgbnNfZnJhbWVf cGFybV9oYW5kbGVyc1tdOwogc3RhdGljIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlIG5zX3Jl ZGlzcGxheV9pbnRlcmZhY2UgPQogeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyog TVVMVElQTEUtQ1VSU09SUyAqLworCisvKiBgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYG5zdGVy bS5tYCBtdXN0IGJlIGluIHRoZSBleGFjdCBzYW1lIG9yZGVyIGFzIHRoZQorYHJlZGlzcGxheV9p bnRlcmZhY2UnIGluIGBkaXNwZXh0ZXJuLmhgISAqLworCisgIG1jX25zX2RyYXdfd2luZG93X2N1 cnNvciwKKyAgbWNfbnNfZHJhd19nbHlwaF9zdHJpbmcsCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKICAgbnNfZnJhbWVfcGFybV9oYW5kbGVycywKICAgZ3VpX3Byb2R1Y2VfZ2x5cGhz LAogICBndWlfd3JpdGVfZ2x5cGhzLApAQCAtODcxMSw2ICs5NzkxLDQ5IEBAIC0gKEJPT0wpY2Fu QmVjb21lTWFpbldpbmRvdwogCiBAaW1wbGVtZW50YXRpb24gRW1hY3NTY3JvbGxlcgogCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCistICh2b2lk KW1jX3NldF9yZWN0YW5nbGU6IChOU1JlY3QpcmVjdAoreworICBtY19yZWN0YW5nbGUgPSByZWN0 OworfQorCistIChOU1JlY3QpbWNfZ2V0X3JlY3RhbmdsZQoreworICByZXR1cm4gbWNfcmVjdGFu Z2xlOworfQorCistIChzdHJ1Y3Qgd2luZG93ICopbWNfZ2V0X3dpbmRvdworeworICByZXR1cm4g d2luZG93OworfQorCistIChib29sKW1jX2p1ZGdlCit7CisgIE5TVFJBQ0UgKCJbRW1hY3NTY3Jv bGxlciBtY19qdWRnZV0iKTsKKyAgYm9vbCByZXQgPSBjb25kZW1uZWQ7CisgIGJsb2NrX2lucHV0 ICgpOworICBpZiAoY29uZGVtbmVkKQorICAgIHsKKyAgICAgIC8qIGVuc3VyZSBvdGhlciBzY3Jv bGxiYXIgdXBkYXRlcyBhZnRlciBkZWxldGlvbiAqLworICAgICAgRW1hY3NWaWV3ICp2aWV3ID0g KEVtYWNzVmlldyAqKUZSQU1FX05TX1ZJRVcgKGZyYW1lKTsKKyAgICAgIGlmICh2aWV3ICE9IG5p bCkKKyAgICAgICAgdmlldy0+c2Nyb2xsYmFyc05lZWRpbmdVcGRhdGUrKzsKKyAgICB9CisgIGlm ICh3aW5kb3cpCisgICAgd3NldF92ZXJ0aWNhbF9zY3JvbGxfYmFyICh3aW5kb3csIFFuaWwpOwor ICB3aW5kb3cgPSAwOworICBbc2VsZiByZW1vdmVGcm9tU3VwZXJ2aWV3V2l0aG91dE5lZWRpbmdE aXNwbGF5XTsKKyAgW3NlbGYgcmVsZWFzZV07CisgIHVuYmxvY2tfaW5wdXQgKCk7CisgIHJldHVy biByZXQ7Cit9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC8qIGZvciByZXBlYXQg YnV0dG9uIHB1c2ggKi8KICNkZWZpbmUgU0NST0xMX0JBUl9GSVJTVF9ERUxBWSAwLjUKICNkZWZp bmUgU0NST0xMX0JBUl9DT05USU5VT1VTX0RFTEFZICgxLjAgLyAxNSkKZGlmZiAtLWdpdCBhL3Ny Yy93MzJ0ZXJtLmMgYi9zcmMvdzMydGVybS5jCmluZGV4IGM2ZTE3NWUuLmNkOTYzOGMgMT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QgY2hhciAqY29sb3JuYW1lKQoreworICBMaXNwX09iamVjdCB0YWlsLCByZXQgPSBRbmls OworICBibG9ja19pbnB1dCAoKTsKKyAgZm9yICh0YWlsID0gVnczMl9jb2xvcl9tYXA7IENPTlNQ ICh0YWlsKTsgdGFpbCA9IFhDRFIgKHRhaWwpKQorICAgIHsKKyAgICAgIHJlZ2lzdGVyIExpc3Bf T2JqZWN0IGVsdCwgdGVtOworICAgICAgZWx0ID0gWENBUiAodGFpbCk7CisgICAgICBpZiAoIUNP TlNQIChlbHQpKSBjb250aW51ZTsKKyAgICAgIHRlbSA9IFhDQVIgKGVsdCk7CisgICAgICBpZiAo bHN0cmNtcGkgKFNTREFUQSAodGVtKSwgY29sb3JuYW1lKSA9PSAwKQorICAgICAgICB7CisgICAg ICAgICAgcmV0ID0gRmNkciAoZWx0KTsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAg ICAgTUNfUVVJVDsKKyAgICB9CisgIHVuYmxvY2tfaW5wdXQgKCk7CisgIHJldHVybiByZXQ7Cit9 CisKK3N0YXRpYyBMaXNwX09iamVjdAorbWNfeF90b193MzJfY29sb3IgKGNvbnN0IGNoYXIgKiBj b2xvcm5hbWUpCit7CisgIHJlZ2lzdGVyIExpc3BfT2JqZWN0IHJldCA9IFFuaWw7CisgIGJsb2Nr X2lucHV0ICgpOworICBpZiAoY29sb3JuYW1lWzBdID09ICcjJykKKyAgICB7CisgICAgICAvKiBD b3VsZCBiZSBhbiBvbGQtc3R5bGUgUkdCIERldmljZSBzcGVjaWZpY2F0aW9uLiAqLworICAgICAg aW50IHNpemUgPSBzdHJsZW4gKGNvbG9ybmFtZSArIDEpOworICAgICAgY2hhciAqY29sb3IgPSBh bGxvY2EgKHNpemUgKyAxKTsKKyAgICAgIHN0cmNweSAoY29sb3IsIGNvbG9ybmFtZSArIDEpOwor ICAgICAgaWYgKHNpemUgPT0gMyB8fCBzaXplID09IDYgfHwgc2l6ZSA9PSA5IHx8IHNpemUgPT0g MTIpCisgICAgICAgIHsKKyAgICAgICAgICBVSU5UIGNvbG9ydmFsOworICAgICAgICAgIGludCBp LCBwb3M7CisgICAgICAgICAgcG9zID0gMDsKKyAgICAgICAgICBzaXplIC89IDM7CisgICAgICAg ICAgY29sb3J2YWwgPSAwOworICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCAzOyBpKyspCisgICAg ICAgICAgICB7CisgICAgICAgICAgICAgIGNoYXIgKmVuZDsKKyAgICAgICAgICAgICAgY2hhciB0 OworICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIHZhbHVlOworICAgICAgICAgICAgICAvKiBU aGUgY2hlY2sgZm9yICd4JyBpbiB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbmFsIHRha2VzIGludG8K KyAgICAgICAgICAgICAgYWNjb3VudCB0aGUgZmFjdCB0aGF0IHN0cnRvbCBhbGxvd3MgYSAiMHgi IGluIGZyb250IG9mCisgICAgICAgICAgICAgIG91ciBudW1iZXJzLCBhbmQgd2UgZG9uJ3QuICov CisgICAgICAgICAgICAgIGlmICghaXN4ZGlnaXQgKGNvbG9yWzBdKSB8fCBjb2xvclsxXSA9PSAn eCcpCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIHQgPSBjb2xvcltzaXpl XTsKKyAgICAgICAgICAgICAgY29sb3Jbc2l6ZV0gPSAnXDAnOworICAgICAgICAgICAgICB2YWx1 ZSA9IHN0cnRvdWwgKGNvbG9yLCAmZW5kLCAxNik7CisgICAgICAgICAgICAgIGNvbG9yW3NpemVd ID0gdDsKKyAgICAgICAgICAgICAgaWYgKGVycm5vID09IEVSQU5HRSB8fCBlbmQgLSBjb2xvciAh PSBzaXplKQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBzd2l0Y2ggKHNp emUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNhc2UgMToKKyAgICAgICAg ICAgICAgICAgIHZhbHVlID0gdmFsdWUgKiAweDEwOworICAgICAgICAgICAgICAgICAgYnJlYWs7 CisgICAgICAgICAgICAgICAgY2FzZSAyOgorICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAg ICAgICAgICAgICAgY2FzZSAzOgorICAgICAgICAgICAgICAgICAgdmFsdWUgLz0gMHgxMDsKKyAg ICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgNDoKKyAgICAgICAg ICAgICAgICAgIHZhbHVlIC89IDB4MTAwOworICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAg ICAgICAgICAgICAgfQorICAgICAgICAgICAgICBjb2xvcnZhbCB8PSAodmFsdWUgPDwgcG9zKTsK KyAgICAgICAgICAgICAgcG9zICs9IDB4ODsKKyAgICAgICAgICAgICAgaWYgKGkgPT0gMikKKyAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAg ICAgICAgICAgICAgICAgWFNFVElOVCAocmV0LCBjb2xvcnZhbCk7CisgICAgICAgICAgICAgICAg ICByZXR1cm4gcmV0OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgY29sb3IgPSBl bmQ7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIGVsc2UgaWYgKHN0cm5pY21w IChjb2xvcm5hbWUsICJyZ2I6IiwgNCkgPT0gMCkKKyAgICB7CisgICAgICBjb25zdCBjaGFyICpj b2xvcjsKKyAgICAgIFVJTlQgY29sb3J2YWw7CisgICAgICBpbnQgaSwgcG9zOworICAgICAgcG9z ID0gMDsKKyAgICAgIGNvbG9ydmFsID0gMDsKKyAgICAgIGNvbG9yID0gY29sb3JuYW1lICsgNDsK KyAgICAgIGZvciAoaSA9IDA7IGkgPCAzOyBpKyspCisgICAgICAgIHsKKyAgICAgICAgICBjaGFy ICplbmQ7CisgICAgICAgICAgdW5zaWduZWQgbG9uZyB2YWx1ZTsKKyAgICAgICAgICAvKiBUaGUg Y2hlY2sgZm9yICd4JyBpbiB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbmFsIHRha2VzIGludG8KKyAg ICAgICAgICAgICBhY2NvdW50IHRoZSBmYWN0IHRoYXQgc3RydG9sIGFsbG93cyBhICIweCIgaW4g ZnJvbnQgb2YKKyAgICAgICAgICAgICBvdXIgbnVtYmVycywgYW5kIHdlIGRvbid0LiAqLworICAg ICAgICAgIGlmICghaXN4ZGlnaXQgKGNvbG9yWzBdKSB8fCBjb2xvclsxXSA9PSAneCcpCisgICAg ICAgICAgICBicmVhazsKKyAgICAgICAgICB2YWx1ZSA9IHN0cnRvdWwgKGNvbG9yLCAmZW5kLCAx Nik7CisgICAgICAgICAgaWYgKGVycm5vID09IEVSQU5HRSkKKyAgICAgICAgICAgIGJyZWFrOwor ICAgICAgICAgIHN3aXRjaCAoZW5kIC0gY29sb3IpCisgICAgICAgICAgICB7CisgICAgICAgICAg ICBjYXNlIDE6CisgICAgICAgICAgICAgIHZhbHVlID0gdmFsdWUgKiAweDEwICsgdmFsdWU7Cisg ICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSAyOgorICAgICAgICAgICAgICBi cmVhazsKKyAgICAgICAgICAgIGNhc2UgMzoKKyAgICAgICAgICAgICAgdmFsdWUgLz0gMHgxMDsK KyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDQ6CisgICAgICAgICAgICAg IHZhbHVlIC89IDB4MTAwOworICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGRlZmF1 bHQ6CisgICAgICAgICAgICAgIHZhbHVlID0gVUxPTkdfTUFYOworICAgICAgICAgICAgfQorICAg ICAgICAgIGlmICh2YWx1ZSA9PSBVTE9OR19NQVgpCisgICAgICAgICAgICBicmVhazsKKyAgICAg ICAgICBjb2xvcnZhbCB8PSAodmFsdWUgPDwgcG9zKTsKKyAgICAgICAgICBwb3MgKz0gMHg4Owor ICAgICAgICAgIGlmIChpID09IDIpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmICgq ZW5kICE9ICdcMCcpCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIHVuYmxv Y2tfaW5wdXQgKCk7CisgICAgICAgICAgICAgIFhTRVRJTlQgKHJldCwgY29sb3J2YWwpOworICAg ICAgICAgICAgICByZXR1cm4gcmV0OworICAgICAgICAgICAgfQorICAgICAgICAgIGlmICgqZW5k ICE9ICcvJykKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIGNvbG9yID0gZW5kICsgMTsK KyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlIGlmIChzdHJuaWNtcCAoY29sb3JuYW1lLCAicmdi aToiLCA1KSA9PSAwKQorICAgICAgeworICAgICAgICAvKiBUaGlzIGlzIGFuIFJHQiBJbnRlbnNp dHkgc3BlY2lmaWNhdGlvbi4gKi8KKyAgICAgICAgY29uc3QgY2hhciAqY29sb3I7CisgICAgICAg IFVJTlQgY29sb3J2YWw7CisgICAgICAgIGludCBpLCBwb3M7CisgICAgICAgIHBvcyA9IDA7Cisg ICAgICAgIGNvbG9ydmFsID0gMDsKKyAgICAgICAgY29sb3IgPSBjb2xvcm5hbWUgKyA1OworICAg ICAgICBmb3IgKGkgPSAwOyBpIDwgMzsgaSsrKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGNo YXIgKmVuZDsKKyAgICAgICAgICAgIGRvdWJsZSB2YWx1ZTsKKyAgICAgICAgICAgIFVJTlQgdmFs OworICAgICAgICAgICAgdmFsdWUgPSBzdHJ0b2QgKGNvbG9yLCAmZW5kKTsKKyAgICAgICAgICAg IGlmIChlcnJubyA9PSBFUkFOR0UpCisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAg aWYgKHZhbHVlIDwgMC4wIHx8IHZhbHVlID4gMS4wKQorICAgICAgICAgICAgICBicmVhazsKKyAg ICAgICAgICAgIHZhbCA9IChVSU5UKSgweDEwMCAqIHZhbHVlKTsKKyAgICAgICAgICAgIC8qIFdl IHVzZWQgMHgxMDAgaW5zdGVhZCBvZiAweEZGIHRvIGdpdmUgYSBjb250aW51b3VzCisgICAgICAg ICAgICAgICByYW5nZSBiZXR3ZWVuIDAuMCBhbmQgMS4wIGluY2x1c2l2ZS4gIFRoZSBuZXh0IHN0 YXRlbWVudAorICAgICAgICAgICAgICAgZml4ZXMgdGhlIDEuMCBjYXNlLiAqLworICAgICAgICAg ICAgaWYgKHZhbCA9PSAweDEwMCkKKyAgICAgICAgICAgICAgdmFsID0gMHhGRjsKKyAgICAgICAg ICAgIGNvbG9ydmFsIHw9ICh2YWwgPDwgcG9zKTsKKyAgICAgICAgICAgIHBvcyArPSAweDg7Cisg ICAgICAgICAgICBpZiAoaSA9PSAyKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg aWYgKCplbmQgIT0gJ1wwJykKKyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAg ICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgICAgICAgWFNFVElOVCAocmV0LCBjb2xv cnZhbCk7CisgICAgICAgICAgICAgICAgcmV0dXJuIHJldDsKKyAgICAgICAgICAgICAgfQorICAg ICAgICAgICAgaWYgKCplbmQgIT0gJy8nKQorICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAg ICAgIGNvbG9yID0gZW5kICsgMTsKKyAgICAgICAgICB9CisgICAgICB9CisgIC8qIEkgYW0gbm90 IGdvaW5nIHRvIGF0dGVtcHQgdG8gaGFuZGxlIGFueSBvZiB0aGUgQ0lFIGNvbG9yIHNjaGVtZXMK KyAgICAgb3IgVGVrSFZDLCBzaW5jZSBJIGRvbid0IGtub3cgdGhlIGFsZ29yaXRobXMgZm9yIGNv bnZlcnNpb24gdG8gUkdCLgorICAgICBJZiB3ZSBmYWlsIHRvIGxvb2t1cCB0aGUgY29sb3IgbmFt ZSBpbiB3MzJfY29sb3JfbWFwLCB0aGVuIGNoZWNrIHRoZQorICAgICBjb2xvcm5hbWUgdG8gc2Vl IGlmIGl0IGNhbiBiZSBjcnVkZWx5IGFwcHJveGltYXRlZDogSWYgdGhlIFggY29sb3IKKyAgICAg ZW5kcyBpbiBhIG51bWJlciAoZS5nLiwgImRhcmtzZWFncmVlbjIiKSwgc3RyaXAgdGhlIG51bWJl ciBhbmQKKyAgICAgcmV0dXJuIHRoZSByZXN1bHQgb2YgbG9va2luZyB1cCB0aGUgYmFzZSBjb2xv ciBuYW1lLiAqLworICByZXQgPSBtY193MzJfY29sb3JfbWFwX2xvb2t1cCAoY29sb3JuYW1lKTsK KyAgaWYgKE5JTFAgKHJldCkpCisgICAgeworICAgICAgaW50IGxlbiA9IHN0cmxlbiAoY29sb3Ju YW1lKTsKKyAgICAgIGlmIChpc2RpZ2l0IChjb2xvcm5hbWVbbGVuIC0gMV0pKQorICAgICAgICB7 CisgICAgICAgICAgY2hhciAqcHRyLCAqYXBwcm94ID0gYWxsb2NhIChsZW4gKyAxKTsKKyAgICAg ICAgICBzdHJjcHkgKGFwcHJveCwgY29sb3JuYW1lKTsKKyAgICAgICAgICBwdHIgPSAmYXBwcm94 W2xlbiAtIDFdOworICAgICAgICAgIHdoaWxlIChwdHIgPiBhcHByb3ggJiYgaXNkaWdpdCAoKnB0 cikpCisgICAgICAgICAgICAqcHRyLS0gPSAnXDAnOworICAgICAgICAgIHJldCA9IG1jX3czMl9j b2xvcl9tYXBfbG9va3VwIChhcHByb3gpOworICAgICAgICB9CisgICAgfQorICB1bmJsb2NrX2lu cHV0ICgpOworICByZXR1cm4gcmV0OworfQorCisvKiBEZWNpZGUgaWYgY29sb3IgbmFtZWQgQ09M T1IgaXMgdmFsaWQgZm9yIHRoZSBkaXNwbGF5IGFzc29jaWF0ZWQgd2l0aAorICAgdGhlIHNlbGVj dGVkIGZyYW1lOyBpZiBzbywgcmV0dXJuIHRoZSByZ2IgdmFsdWVzIGluIENPTE9SX0RFRi4KKyAg IElmIEFMTE9DIGlzIG5vbnplcm8sIGFsbG9jYXRlIGEgbmV3IGNvbG9ybWFwIGNlbGwuICovCitp bnQKK21jX3czMl9kZWZpbmVkX2NvbG9yIChzdHJ1Y3QgZnJhbWUgKmYsIGNvbnN0IGNoYXIgKmNv bG9yLCBtY19YQ29sb3IgKmNvbG9yX2RlZiwgYm9vbCBhbGxvY19wKQoreworICByZWdpc3RlciBM aXNwX09iamVjdCB0ZW07CisgIENPTE9SUkVGIHczMl9jb2xvcl9yZWY7CisgIHRlbSA9IG1jX3hf dG9fdzMyX2NvbG9yIChjb2xvcik7CisgIGlmICghTklMUCAodGVtKSkKKyAgICB7CisgICAgICBp ZiAoZikKKyAgICAgICAgeworICAgICAgICAgIC8qIEFwcGx5IGdhbW1hIGNvcnJlY3Rpb24uICov CisgICAgICAgICAgdzMyX2NvbG9yX3JlZiA9IFhVRklYTlVNX1JBVyAodGVtKTsKKyAgICAgICAg ICBnYW1tYV9jb3JyZWN0IChmLCAmdzMyX2NvbG9yX3JlZik7CisgICAgICAgICAgWFNFVElOVCAo dGVtLCB3MzJfY29sb3JfcmVmKTsKKyAgICAgICAgfQorICAgICAgLyogTWFwIHRoaXMgY29sb3Ig dG8gdGhlIHBhbGV0dGUgaWYgaXQgaXMgZW5hYmxlZC4gKi8KKyAgICAgIGlmICghTklMUCAoVncz Ml9lbmFibGVfcGFsZXR0ZSkpCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgdzMyX3BhbGV0 dGVfZW50cnkgKiBlbnRyeSA9IG9uZV93MzJfZGlzcGxheV9pbmZvLmNvbG9yX2xpc3Q7CisgICAg ICAgICAgc3RydWN0IHczMl9wYWxldHRlX2VudHJ5ICoqIHByZXYgPSAmb25lX3czMl9kaXNwbGF5 X2luZm8uY29sb3JfbGlzdDsKKyAgICAgICAgICAvKiBjaGVjayBpZiBjb2xvciBpcyBhbHJlYWR5 IG1hcHBlZCAqLworICAgICAgICAgIHdoaWxlIChlbnRyeSkKKyAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgaWYgKE1DX1czMl9DT0xPUiAoZW50cnktPmVudHJ5KSA9PSBYVUZJWE5VTV9SQVcg KHRlbSkpCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIHByZXYgPSAmZW50 cnktPm5leHQ7CisgICAgICAgICAgICAgIGVudHJ5ID0gZW50cnktPm5leHQ7CisgICAgICAgICAg ICB9CisgICAgICAgICAgaWYgKGVudHJ5ID09IE5VTEwgJiYgYWxsb2NfcCkKKyAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgLyogbm90IGFscmVhZHkgbWFwcGVkLCBzbyBhZGQgdG8gbGlzdCAq LworICAgICAgICAgICAgICBlbnRyeSA9IHhtYWxsb2MgKHNpemVvZiAoc3RydWN0IHczMl9wYWxl dHRlX2VudHJ5KSk7CisgICAgICAgICAgICAgIE1DX1czMl9TRVRfQ09MT1IgKGVudHJ5LT5lbnRy eSwgWFVGSVhOVU1fUkFXICh0ZW0pKTsKKyAgICAgICAgICAgICAgZW50cnktPm5leHQgPSBOVUxM OworICAgICAgICAgICAgICAqcHJldiA9IGVudHJ5OworICAgICAgICAgICAgICBvbmVfdzMyX2Rp c3BsYXlfaW5mby5udW1fY29sb3JzKys7CisgICAgICAgICAgICAgIC8qIHNldCBmbGFnIHRoYXQg cGFsZXR0ZSBtdXN0IGJlIHJlZ2VuZXJhdGVkICovCisgICAgICAgICAgICAgIG9uZV93MzJfZGlz cGxheV9pbmZvLnJlZ2VuX3BhbGV0dGUgPSBUUlVFOworICAgICAgICAgICAgfQorICAgICAgICB9 CisgICAgICAvKiBFbnN1cmUgQ09MT1JSRUYgdmFsdWUgaXMgc25hcHBlZCB0byBuZWFyZXN0IGNv bG9yIGluIChkZWZhdWx0KQorICAgICAgICAgcGFsZXR0ZSBieSBzaW11bGF0aW5nIHRoZSBQQUxF VFRFUkdCIG1hY3JvLiAgVGhpcyB3b3JrcyB3aGV0aGVyCisgICAgICAgICBvciBub3QgdGhlIGRp c3BsYXkgZGV2aWNlIGhhcyBhIHBhbGV0dGUuICovCisgIC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IDgpIHwgR2V0QlZhbHVlICh0ZW1wLnBpeGVsKSkgLyA2NTUzNS4wOworICAgIH0KKyAgICBl bHNlCisgICAgICB7CisgICAgICAgIGxzbC0+cmVkID0gLTEuMDsKKyAgICAgICAgbHNsLT5ncmVl biA9IC0xLjA7CisgICAgICAgIGxzbC0+Ymx1ZSA9IC0xLjA7CisgICAgICB9Cit9CisKKy8qIERy YXcgc3RyZXRjaCBnbHlwaCBzdHJpbmcgUy4gKi8KK3N0YXRpYyB2b2lkCittY193MzJfZHJhd19z dHJldGNoX2dseXBoX3N0cmluZyAoc3RydWN0IGdseXBoX3N0cmluZyAqcykKK3sKKyAgZWFzc2Vy dCAocy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gU1RSRVRDSF9HTFlQSCk7CisgIGlmIChzLT5obCA9 PSBEUkFXX0NVUlNPUgorICAgICAgJiYgIXhfc3RyZXRjaF9jdXJzb3JfcCkKKyAgICB7CisgICAg ICAvKiBJZiBgeC1zdHJldGNoLWN1cnNvcicgaXMgbmlsLCBkb24ndCBkcmF3IGEgYmxvY2sgY3Vy c29yIGFzIHdpZGUgYXMgdGhlCisgICAgICBzdHJldGNoIGdseXBoLiAqLworICAgICAgaW50IHdp ZHRoLCBiYWNrZ3JvdW5kX3dpZHRoID0gcy0+YmFja2dyb3VuZF93aWR0aDsKKyAgICAgIGludCB4 ID0gcy0+eDsKKyAgICAgIGlmICghcy0+cm93LT5yZXZlcnNlZF9wKQorICAgICAgICB7CisgICAg ICAgICAgaW50IGxlZnRfeCA9IHdpbmRvd19ib3hfbGVmdF9vZmZzZXQgKHMtPncsIFRFWFRfQVJF QSk7CisgICAgICAgICAgaWYgKHggPCBsZWZ0X3gpCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIGJhY2tncm91bmRfd2lkdGggLT0gbGVmdF94IC0geDsKKyAgICAgICAgICAgICAgeCA9IGxl ZnRfeDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICB7 CisgICAgICAgICAgIC8qIEluIFIyTCByb3dzLCBkcmF3IHRoZSBjdXJzb3Igb24gdGhlIHJpZ2h0 IGVkZ2Ugb2YgdGhlCisgICAgICAgICAgICAgIHN0cmV0Y2ggZ2x5cGguICovCisgICAgICAgICAg IGludCByaWdodF94ID0gd2luZG93X2JveF9yaWdodCAocy0+dywgVEVYVF9BUkVBKTsKKyAgICAg ICAgICAgaWYgKHggKyBiYWNrZ3JvdW5kX3dpZHRoID4gcmlnaHRfeCkKKyAgICAgICAgICAgICBi YWNrZ3JvdW5kX3dpZHRoIC09IHggLSByaWdodF94OworICAgICAgICAgICB4ICs9IGJhY2tncm91 bmRfd2lkdGg7CisgICAgICAgICB9CisgICAgICB3aWR0aCA9IG1pbiAoRlJBTUVfQ09MVU1OX1dJ RFRIIChzLT5mKSwgYmFja2dyb3VuZF93aWR0aCk7CisgICAgICBpZiAocy0+cm93LT5yZXZlcnNl ZF9wKQorICAgICAgICB4IC09IHdpZHRoOworICAgICAgLyogRHJhdyBjdXJzb3IuICovCisgICAg ICB3MzJfZHJhd19nbHlwaF9zdHJpbmdfYmdfcmVjdCAocywgeCwgcy0+eSwgd2lkdGgsIHMtPmhl aWdodCk7CisgICAgICAvKiBDbGVhciByZXN0IHVzaW5nIHRoZSBHQyBvZiB0aGUgb3JpZ2luYWwg bm9uLWN1cnNvciBmYWNlLiAqLworICAgICAgaWYgKHdpZHRoIDwgYmFja2dyb3VuZF93aWR0aCkK KyAgICAgICAgeworICAgICAgICAgIEVtYWNzX0dDICpnYyA9IHMtPmZhY2UtPmdjOworICAgICAg ICAgIGludCB5ID0gcy0+eTsKKyAgICAgICAgICBpbnQgdyA9IGJhY2tncm91bmRfd2lkdGggLSB3 aWR0aCwgaCA9IHMtPmhlaWdodDsKKyAgICAgICAgICBSRUNUIHI7CisgICAgICAgICAgSERDIGhk YyA9IHMtPmhkYzsKKyAgICAgICAgICBpZiAoIXMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAgICAgICAg ICAgIHggKz0gd2lkdGg7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHggPSBzLT54 OworICAgICAgICAgIGlmIChzLT5yb3ctPm1vdXNlX2ZhY2VfcAorICAgICAgICAgICAgICAmJiBj dXJzb3JfaW5fbW91c2VfZmFjZV9wIChzLT53KSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgdzMyX3NldF9tb3VzZV9mYWNlX2djIChzKTsKKyAgICAgICAgICAgICAgZ2MgPSBzLT5nYzsK KyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgZ2MgPSBzLT5m YWNlLT5nYzsKKyAgICAgICAgICBnZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgJnIpOwor ICAgICAgICAgIHczMl9zZXRfY2xpcF9yZWN0YW5nbGUgKGhkYywgJnIpOworI2lmIDAgLyogVE9E Tzogc3RpcHBsZSAqLworICAgICAgICAgIGlmIChzLT5mYWNlLT5zdGlwcGxlKQorICAgICAgICAg ICAgeworICAgICAgICAgICAgICAvKiBGaWxsIGJhY2tncm91bmQgd2l0aCBhIHN0aXBwbGUgcGF0 dGVybi4gKi8KKyAgICAgICAgICAgICAgWFNldEZpbGxTdHlsZSAocy0+ZGlzcGxheSwgZ2MsIEZp bGxPcGFxdWVTdGlwcGxlZCk7CisgICAgICAgICAgICAgIFhGaWxsUmVjdGFuZ2xlIChzLT5kaXNw bGF5LCBzLT53aW5kb3csIGdjLCB4LCB5LCB3LCBoKTsKKyAgICAgICAgICAgICAgWFNldEZpbGxT dHlsZSAocy0+ZGlzcGxheSwgZ2MsIEZpbGxTb2xpZCk7CisgICAgICAgICAgICB9CisgICAgICAg ICAgICBlbHNlCisjZW5kaWYKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHczMl9m aWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgZ2MtPmJhY2tncm91bmQsIHgsIHksIHcsIGgpOworICAg ICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZiAoIXMtPmJhY2tncm91 bmRfZmlsbGVkX3ApCisgICAgICB7CisgICAgICAgIGludCBiYWNrZ3JvdW5kX3dpZHRoID0gcy0+ YmFja2dyb3VuZF93aWR0aDsKKyAgICAgICAgaW50IHggPSBzLT54LCBsZWZ0X3ggPSB3aW5kb3df Ym94X2xlZnRfb2Zmc2V0IChzLT53LCBURVhUX0FSRUEpOworICAgICAgICAvKiBEb24ndCBkcmF3 IGludG8gbGVmdCBtYXJnaW4sIGZyaW5nZSBvciBzY3JvbGxiYXIgYXJlYQorICAgICAgICAgICBl eGNlcHQgZm9yIGhlYWRlciBsaW5lIGFuZCBtb2RlIGxpbmUuICovCisgICAgICAgIGlmICh4IDwg bGVmdF94ICYmICFzLT5yb3ctPm1vZGVfbGluZV9wKQorICAgICAgICAgIHsKKyAgICAgICAgICAg IGJhY2tncm91bmRfd2lkdGggLT0gbGVmdF94IC0geDsKKyAgICAgICAgICAgIHggPSBsZWZ0X3g7 CisgICAgICAgICAgfQorICAgICAgICBpZiAoYmFja2dyb3VuZF93aWR0aCA+IDApCisgICAgICAg ICAgdzMyX2RyYXdfZ2x5cGhfc3RyaW5nX2JnX3JlY3QgKHMsIHgsIHMtPnksIGJhY2tncm91bmRf d2lkdGgsIHMtPmhlaWdodCk7CisgICAgICB9CisgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0 cnVlOworfQorCisvKiBTZXQgUy0+Z2MgdG8gYSBzdWl0YWJsZSBHQyBmb3IgZHJhd2luZyBnbHlw aCBzdHJpbmcgUyBpbiBjdXJzb3IKKyAgIGZhY2UuICovCitzdGF0aWMgdm9pZAorbWNfdzMyX3Nl dF9jdXJzb3JfZ2MgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMsIGJvb2wgY3Vyc29yX2djX3ApCit7 CisgIGlmIChjdXJzb3JfZ2NfcCkKKyAgICB7CisgICAgICBzLT5nYy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ICAgIHczMl9zZXRfbW9kZV9saW5l X2ZhY2VfZ2MgKHMpOworICAgICAgICBzLT5zdGlwcGxlZF9wID0gcy0+ZmFjZS0+c3RpcHBsZSAh PSAwOworICAgICAgfQorICAgICAgZWxzZSBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IpCisgICAg ICAgIHsKKyAgICAgICAgICBtY193MzJfc2V0X2N1cnNvcl9nYyAocywgY3Vyc29yX2djX3ApOwor ICAgICAgICAgIHMtPnN0aXBwbGVkX3AgPSBmYWxzZTsKKyAgICAgICAgfQorICAgICAgICBlbHNl IGlmIChzLT5obCA9PSBEUkFXX01PVVNFX0ZBQ0UpCisgICAgICAgICAgeworICAgICAgICAgICAg dzMyX3NldF9tb3VzZV9mYWNlX2djIChzKTsKKyAgICAgICAgICAgIHMtPnN0aXBwbGVkX3AgPSBz LT5mYWNlLT5zdGlwcGxlICE9IDA7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKHMt PmhsID09IERSQVdfSU1BR0VfUkFJU0VECisgICAgICAgICAgICAgICAgICAgfHwgcy0+aGwgPT0g RFJBV19JTUFHRV9TVU5LRU4pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHMtPmdjID0g cy0+ZmFjZS0+Z2M7CisgICAgICAgICAgICAgIHMtPnN0aXBwbGVkX3AgPSBzLT5mYWNlLT5zdGlw cGxlICE9IDA7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAg IGVtYWNzX2Fib3J0ICgpOworICAvKiBHQyBtdXN0IGhhdmUgYmVlbiBzZXQuICovCisgIGVhc3Nl cnQgKHMtPmdjICE9IDApOworfQorCisvKiBEcmF3IGEgaG9sbG93IGJveCBjdXJzb3Igb24gd2lu ZG93IFcgaW4gZ2x5cGggcm93IFJPVy4gKi8KK3N0YXRpYyB2b2lkCittY193MzJfZHJhd19ob2xs b3dfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x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dGEudzMyLT5jdXJzb3JfcGl4ZWw7CisgICAgICAgIHN0cnVjdCBmYWNlICpm YWNlID0gRkFDRV9GUk9NX0lEIChmLCBjdXJzb3JfZ2x5cGgtPmZhY2VfaWQpOworICAgICAgICBI REMgaGRjOworICAgICAgICAvKiBJZiB0aGUgZ2x5cGgncyBiYWNrZ3JvdW5kIGVxdWFscyB0aGUg Y29sb3Igd2Ugbm9ybWFsbHkgZHJhdworICAgICAgICB0aGUgYmFyIGN1cnNvciBpbiwgdGhlIGJh ciBjdXJzb3IgaW4gaXRzIG5vcm1hbCBjb2xvciBpcworICAgICAgICBpbnZpc2libGUuICBVc2Ug dGhlIGdseXBoJ3MgZm9yZWdyb3VuZCBjb2xvciBpbnN0ZWFkIGluIHRoaXMKKyAgICAgICAgY2Fz ZSwgb24gdGhlIGFzc3VtcHRpb24gdGhhdCB0aGUgZ2x5cGgncyBjb2xvcnMgYXJlIGNob3NlbiBz bworICAgICAgICB0aGF0IHRoZSBnbHlwaCBpcyBsZWdpYmxlLiAqLworICAgICAgICBpZiAoZmFj ZS0+YmFja2dyb3VuZCA9PSBjdXJzb3JfY29sb3IKKyAgICAgICAgICAgICYmICFjdXJzb3JfZ2Nf aW52aXNpYmxlX29rYXlfcCkKKyAgICAgICAgICBjdXJzb3JfY29sb3IgPSBmYWNlLT5mb3JlZ3Jv dW5kOworICAgICAgICBpbnQgZGVmYXVsdF9meCA9IFdJTkRPV19URVhUX1RPX0ZSQU1FX1BJWEVM X1ggKHcsIHgpOworICAgICAgICBoZGMgPSBnZXRfZnJhbWVfZGMgKGYpOworICAgICAgICB3MzJf Y2xpcF90b19yb3cgKHcsIHJvdywgVEVYVF9BUkVBLCBoZGMpOworICAgICAgICBpbnQgcnggPSBm eDsKKyAgICAgICAgaW50IHJ5ID0gZnk7CisgICAgICAgIGludCBydyA9IHdkOworICAgICAgICBp bnQgcmggPSBoOworICAgICAgICAvLyAgZnByaW50ZiAoc3RkZXJyLCAiTUNfSEJBUjogIGZ4ICgl ZCkgfCBmeSAoJWQpIHwgd2QgKCVkKSB8IGggKCVkKVxuIiwKKyAgICAgICAgLy8gICAgICAgICAg ICAgICAgICAgcngsIHJ5LCBydywgcmgpOworICAgICAgICB3MzJfZmlsbF9hcmVhIChmLCBoZGMs IGN1cnNvcl9jb2xvciwgcngsIHJ5LCBydywgcmgpOworICAgICAgICB3MzJfc2V0X2NsaXBfcmVj dGFuZ2xlIChoZGMsIE5VTEwpOworICAgICAgICByZWxlYXNlX2ZyYW1lX2RjIChmLCBoZGMpOwor ICAgICAgfQorfQorCisvKiBSSUY6IERyYXcgb3IgY2xlYXIgY3Vyc29yIG9uIHdpbmRvdyBXLiAq Lworc3RhdGljIHZvaWQKK21jX3czMl9kcmF3X3dpbmRvd19jdXJzb3IgKHN0cnVjdCB3aW5kb3cg KncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAor ICAgICAgICAgICAgICAgICAgaW50IHgsIGludCBmeCwgaW50IHksIGludCBmeSwgaW50IGhwb3Ms IGludCB2cG9zLCBpbnQgd2QsIGludCBoLAorICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JH QiBsc2wsIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAg ICBpbnQgY3Vyc29yX3dpZHRoLCBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IsIGJvb2wgb25f cCwgYm9vbCBhY3RpdmVfcCkKK3sKKyAgaWYgKG9uX3ApCisgICAgeworICAgICAgLyogSWYgdGhp cyBpcyB0aGUgYWN0aXZlIGN1cnNvciwgd2UgbmVlZCB0byB0cmFjayBpdCB3aXRoIHRoZQorICAg ICAgc3lzdGVtIGNhcmV0LCBzbyB0aGlyZCBwYXJ0eSBzb2Z0d2FyZSBsaWtlIHNjcmVlbiBtYWdu aWZpZXJzCisgICAgICBhbmQgc3BlZWNoIHN5bnRoZXNpemVyc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JldF9od25kCisgICAgICAgICAgICAgICYmICh3MzJfc3lzdGVtX2NhcmV0 X2hlaWdodCAhPSBoKSkKKyAgICAgICAgICAgIFBvc3RNZXNzYWdlIChod25kLCBXTV9FTUFDU19E RVNUUk9ZX0NBUkVULCAwLCAwKTsKKyAgICAgICAgICB3MzJfc3lzdGVtX2NhcmV0X2hlaWdodCA9 IGg7CisgICAgICAgICAgLyogTW92ZSB0aGUgc3lzdGVtIGNhcmV0LiAqLworICAgICAgICAgIFBv c3RNZXNzYWdlIChod25kLCBXTV9FTUFDU19UUkFDS19DQVJFVCwgMCwgMCk7CisgICAgICAgIH0K KyAgICAgIC8qIFRoZSBmcmluZ2UgYml0bWFwcyBhcmUgcHJlc2VudGx5IGhhbmRsZWQgZWxzZXdo ZXJlLCBidXQgY291bGQgc29tZWRheQorICAgICAgYmUgbWFuYWdlZCAoaW4gcGFydCkgYXQgdGhp cyBzZWN0aW9uIG9mIGNvZGUuICovCisgICAgICBpZiAocm93LT5leGFjdF93aW5kb3dfd2lkdGhf bGluZV9wCisgICAgICAgICAgJiYgKHJvdy0+cmV2ZXJzZWRfcAorICAgICAgICAgICAgID8gKGhw b3MgPCAwKQorICAgICAgICAgICAgIDogKGhwb3MgPj0gcm93LT51c2VkW1RFWFRfQVJFQV0pKSkK KyAgICAgICAgeworICAgICAgICAgIHJvdy0+Y3Vyc29yX2luX2ZyaW5nZV9wID0gdHJ1ZTsKKyAg ICAgICAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXAgKHcsIHJvdywgcm93LT5yZXZlcnNlZF9wLCBj dXJzb3JfdHlwZSk7CisgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgIHN0cnVjdCBmcmFt ZSAqZiA9IFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7CisgIENPTE9SUkVGIG9yaWdpbmFsX2N1 cnNvcl9waXhlbCA9IGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsOworICAvKiB4dGVy bS5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TCwgRlJBTUVfVzMyX1dJTkRPVyAoZiksIG1hc2ssICZnY192YWx1ZXMpOworICAgICAg ICAgIGJsb2NrX2lucHV0ICgpOworICAgICAgICAgIC8qIEZvcmNlIGBtY193MzJfc2V0X2N1cnNv cl9nYycgdG8gdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycuICovCisgICAg ICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IHRydWU7CisgICAgICAgICAgbWNfZHJhd19jdXJzb3Jf Z2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywgbHNsLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBl LCB3ZCwgYWN0aXZlX3AsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53 MzItPmN1cnNvcl9nYyA9IG9yaWdpbmFsX2N1cnNvcl9nYzsKKyAgICAgICAgICB1bmJsb2NrX2lu cHV0ICgpOworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEu dzMyLT5jdXJzb3JfcGl4ZWwnLiAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vy c29yX3BpeGVsID0gY29sb3JfcGl4ZWw7CisgICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1 cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOwor ICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vy c29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKGN1cnNvcl9nbHlwaC0+dHlw ZSA9PSBJTUFHRV9HTFlQSCAmJiBsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNs LmJsdWUgPj0gMCkKKyAgICAgICAgICB7CisgICAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWph Y2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4gKi8KKyAgICAgICAgICAgIGYt Pm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gY29sb3JfcGl4ZWw7CisgICAgICAgICAg ICBtY193MzJfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5 LCBocG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1 cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgICB9CisgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWph Y2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djJyBieSBib3Jyb3dpbmcgdGhlCisgICAg ICAgICAgICAgIGZ1bmN0aW9uYWxpdHkgb2YgYHhfbWFrZV9nYycgaW4gdzMyZm5zLmMuICovCisg ICAgICAgICAgICAgIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICYmIGFj dGl2ZV9wCisgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3MgPT0gcmVn aW9uX2JlZykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBlbnVtIGZhY2Vf aWQgaG9sbG93X2FjdGl2ZV9yZWdpb25fYmVnX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAo dywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWF0LXJlZ2lvbi1wcmUtenYtZmFjZSIp LCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgIHN0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ByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgc3Ry dWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2Fj dGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5mb3JlZ3Jv dW5kID0gaG9sbG93X2FjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICAgICAg ICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmJhY2tncm91 bmQ7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgIGVsc2Ug aWYgKCFhY3RpdmVfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkID0gbG9va3Vw X25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1w cmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZh Y2UgKmhvbGxvd19pbmFjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfaW5hY3Rp dmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5mb3JlZ3Jv dW5kID0gaG9sbG93X2luYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAg ICAgICAgICAgIGdjX3ZhbHVlcy5iYWNrZ3JvdW5kID0gaG9sbG93X2luYWN0aXZlX2ZhY2UtPmJh Y2tncm91bmQ7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGYtPm91 dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djID0gWENyZWF0ZUdDIChOVUxMLCBGUkFNRV9XMzJfV0lO RE9XIChmKSwgbWFzaywgJmdjX3ZhbHVlcyk7CisgICAgICAgICAgICAgIGJsb2NrX2lucHV0ICgp OworICAgICAgICAgICAgICAvKiBGb3JjZSBgbWNfdzMyX3NldF9jdXJzb3JfZ2MnIHRvIHVzZSBg cy0+Zi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MnLiAqLworICAgICAgICAgICAgICBib29s IGN1cnNvcl9nY19wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGgg KHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwg d2QsIGFjdGl2ZV9wLCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgICAgIGYtPm91dHB1dF9kYXRh LnczMi0+Y3Vyc29yX2djID0gb3JpZ2luYWxfY3Vyc29yX2djOworICAgICAgICAgICAgICB1bmJs b2NrX2lucHV0ICgpOworICAgICAgICAgICAgICBtY193MzJfZHJhd19ob2xsb3dfY3Vyc29yICh3 LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICAg ICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBNQ19IT0xMT1dfQk9YOgorICAg IHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUg Pj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0 cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwnLiAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRh LnczMi0+Y3Vyc29yX3BpeGVsID0gY29sb3JfcGl4ZWw7CisgICAgICAgICAgbWNfdzMyX2RyYXdf aG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywg d2QsIGgpOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3Jp Z2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICBt Y193MzJfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBo cG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBNQ19GSUxM RURfQk9YOgorICAgIHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAg JiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhp amFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MnIGJ5IGJvcnJvd2luZyB0aGUKKyAg ICAgICAgICBmdW5jdGlvbmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHczMmZucy5jLiAqLworICAg ICAgICAgIGJsb2NrX2lucHV0ICgpOworICAgICAgICAgIEVtYWNzX0dDIGdjX3ZhbHVlczsKKyAg ICAgICAgICB1bnNpZ25lZCBsb25nIG1hc2sgPSBHQ0ZvcmVncm91bmQgfCBHQ0JhY2tncm91bmQ7 CisgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBGUkFNRV9CQUNLR1JPVU5EX1BJWEVM IChmKTsKKyAgICAgICAgICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IGNvbG9yX3BpeGVsOworICAg ICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djID0gWENyZWF0ZUdDIChOVUxMLCBG UkFNRV9XMzJfV0lORE9XIChmKSwgbWFzaywgJmdjX3ZhbHVlcyk7CisgICAgICAgICAgLyogRm9y Y2UgYG1jX3czMl9zZXRfY3Vyc29yX2djJyB0byB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLnczMi0+ Y3Vyc29yX2djJy4gKi8KKyAgICAgICAgICBib29sIGN1cnNvcl9nY19wID0gdHJ1ZTsKKyAgICAg ICAgICBtY19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4 LCBocG9zLCB2cG9zLCBsc2wsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBo X2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOworICAgICAg ICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djID0gb3JpZ2luYWxfY3Vyc29yX2djOwor ICAgICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAg ICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX3AgPSBmYWxzZTsKKyAgICAgICAg ICAgIG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywgRFJBV19DVVJTT1IsIHgs IGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNsLCBnbHlw aF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgY3Vyc29yX2djX3ApOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOwor ICAgIH0KKyAgICBjYXNlIE1DX0JBUjoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYm IGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAv KiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4g Ki8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3Bp eGVsOworICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSB0cnVlOwor ICAgICAgICAgIG1jX3czMl9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwg eSwgZnksIGhwb3MsIHZwb3MsIHdkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGgsIGN1cnNvcl93aWR0aCwgTUNfQkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7Cisg ICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJz b3JfcGl4ZWw7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAg ICAgIGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSBmYWxzZTsKKyAgICAgICAgICAg IG1jX3czMl9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhw b3MsIHZwb3MsIHdkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaCwgY3Vy c29yX3dpZHRoLCBNQ19CQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAg ICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBNQ19IQkFSOgorICAgIHsKKyAgICAg IGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAg ICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEu dzMyLT5jdXJzb3JfcGl4ZWwnLiAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vy c29yX3BpeGVsID0gY29sb3JfcGl4ZWw7CisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNp YmxlX29rYXlfcCA9IHRydWU7CisgICAgICAgICAgbWNfdzMyX2RyYXdfYmFyX2N1cnNvciAodywg bWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgaCwgY3Vyc29yX3dpZHRoLCBNQ19IQkFSLCBjdXJzb3JfZ2Nf aW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3Jf cGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQor ICAgICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3Ag PSBmYWxzZTsKKyAgICAgICAgICAgIG1jX3czMl9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwg cm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgaCwgY3Vyc29yX3dpZHRoLCBNQ19IQkFSLCBjdXJzb3JfZ2NfaW52aXNp YmxlX29rYXlfcCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGRlZmF1 bHQ6CisgICAgICBlbWFjc19hYm9ydCAoKTsKKyAgfQorICAgIH0KK30KKworLyogRHJhdyBnbHlw aCBzdHJpbmcgUy4gKi8KK3N0YXRpYyB2b2lkCittY193MzJfZHJhd19nbHlwaF9zdHJpbmcgKH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CkKKyAgICAgICAgICB7CisgICAgICAgICAg ICBtY193MzJfc2V0X2dseXBoX3N0cmluZ19nYyAobmV4dCwgY3Vyc29yX2djX3ApOworICAgICAg ICAgICAgdzMyX3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmcgKG5leHQpOworICAgICAgICAgICAg aWYgKG5leHQtPmZpcnN0X2dseXBoLT50eXBlID09IFNUUkVUQ0hfR0xZUEgpCisgICAgICAgICAg ICAgIG1jX3czMl9kcmF3X3N0cmV0Y2hfZ2x5cGhfc3RyaW5nIChuZXh0KTsKKyAgICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICAgIHczMl9kcmF3X2dseXBoX3N0cmluZ19iYWNrZ3JvdW5k IChuZXh0LCB0cnVlKTsKKyAgICAgICAgICAgIG5leHQtPm51bV9jbGlwcyA9IDA7CisgICAgICAg ICAgfQorICAgIH0KKyAgLyogU2V0IHVwIFMtPmdjLCBzZXQgY2xpcHBpbmcgYW5kIGRyYXcgUy4g Ki8KKyAgbWNfdzMyX3NldF9nbHlwaF9zdHJpbmdfZ2MgKHMsIGN1cnNvcl9nY19wKTsKKyAgLyog RHJhdyByZWxpZWYgKGlmIGFueSkgaW4gYWR2YW5jZSBmb3IgY2hhci9jb21wb3NpdGlvbiBzbyB0 aGF0IHRoZQorICAgICBnbHlwaCBzdHJpbmcgY2FuIGJlIGRyYXduIG92ZXIgaXQuICovCisgIGlm ICghcy0+Zm9yX292ZXJsYXBzCisgICAgICAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gK KyAgICAgICYmIChzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAgICAg fHwgcy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKSkKKyAgICB7CisgICAg ICB3MzJfc2V0X2dseXBoX3N0cmluZ19jbGlwcGluZyAocyk7CisgICAgICB3MzJfZHJhd19nbHlw aF9zdHJpbmdfYmFja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0KKyAgaWYgKCFzLT5mb3Jfb3ZlcmxhcHMpCisgICAgeworICAgICAgLyogRHJh dyB1bmRlcmxpbmUuICovCisgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3ApCisgICAgICAg IHsKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9X QVZFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBDT0xPUlJFRiBjb2xvcjsKKyAgICAg ICAgICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAg ICAgICBjb2xvciA9IHMtPmdjLT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgICAgIGNvbG9yID0gcy0+ZmFjZS0+dW5kZXJsaW5lX2NvbG9yOworICAgICAg ICAgICAgICB3MzJfZHJhd191bmRlcndhdmUgKHMsIGNvbG9yKTsKKyAgICAgICAgICAgIH0KKyAg ICAgICAgICBlbHNlIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX0xJ TkUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgdGhpY2tuZXNz LCBwb3NpdGlvbjsKKyAgICAgICAgICAgICAgaW50IHk7CisgICAgICAgICAgICAgIGlmIChzLT5w cmV2ICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV9wCisgICAgICAgICAgICAgICAgICAmJiBz LT5wcmV2LT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgICAgLyogV2UgdXNlIHRoZSBzYW1lIHVuZGVybGlu ZSBzdHlsZSBhcyB0aGUgcHJldmlvdXMgb25lLiAqLworICAgICAgICAgICAgICAgICAgdGhpY2tu ZXNzID0gcy0+cHJldi0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAgICAgICAgICAgICAgIHBv c2l0aW9uID0gcy0+cHJldi0+dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAg IC8qIEdldCB0aGUgdW5kZXJsaW5lIHRoaWNrbmVzcy4gIERlZmF1bHQgaXMgMSBwaXhlbC4gKi8K KyAgICAgICAgICAgICAgICAgIGlmIChzLT5mb250ICYmIHMtPmZvbnQtPnVuZGVybGluZV90aGlj a25lc3MgPiAwKQorICAgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSBzLT5mb250LT51bmRl cmxpbmVfdGhpY2tuZXNzOworICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAg ICAgICAgICAgdGhpY2tuZXNzID0gMTsKKyAgICAgICAgICAgICAgICAgIGlmICh4X3VuZGVybGlu ZV9hdF9kZXNjZW50X2xpbmUpCisgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmhl aWdodCAtIHRoaWNrbmVzcykgLSAocy0+eWJhc2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAg IC8qIEdldCB0aGUgdW5kZXJsaW5lIHBvc2l0aW9uLiAgVGhpcyBpcyB0aGUgcmVjb21tZW5kZWQK KyAgICAgICAgICAgICAgICAgICAgICAgICAgIHZlcnRpY2FsIG9mZnNldCBpbiBwaXhlbHMgZnJv bSB0aGUgYmFzZWxpbmUgdG8gdGhlIHRvcCBvZgorICAgICAgICAgICAgICAgICAgICAgICAgICAg dGhlIHVuZGVybGluZS4gIFRoaXMgaXMgYSBzaWduZWQgdmFsdWUgYWNjb3JkaW5nIHRvIHRoZQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgc3BlY3MsIGFuZCBpdHMgZGVmYXVsdCBpcworICAg ICAgICAgICAgICAgICAgICAgICAgICAgUk9VTkQgKChtYXhpbXVtX2Rlc2NlbnQpIC8gMiksIHdp dGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIFJPVU5EICh4KSA9IGZsb29yICh4ICsgMC41 KSAgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICh4X3VzZV91bmRlcmxpbmVfcG9zaXRp b25fcHJvcGVydGllcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHMtPmZvbnQgJiYg cy0+Zm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uID49IDApCisgICAgICAgICAgICAgICAgICAgICAg ICAgIHBvc2l0aW9uID0gcy0+Zm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAg ICAgICAgICAgICAgZWxzZSBpZiAocy0+Zm9udCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg cG9zaXRpb24gPSAocy0+Zm9udC0+ZGVzY2VudCArIDEpIC8gMjsKKyAgICAgICAgICAgICAgICAg ICAgICB9CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IG1heCAocG9zaXRpb24sIHVuZGVy bGluZV9taW5pbXVtX29mZnNldCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAv KiBDaGVjayB0aGUgc2FuaXR5IG9mIHRoaWNrbmVzcyBhbmQgcG9zaXRpb24uICBXZSBzaG91bGQK KyAgICAgICAgICAgICAgICAgYXZvaWQgZHJhd2luZyB1bmRlcmxpbmUgb3V0IG9mIHRoZSBjdXJy ZW50IGxpbmUgYXJlYS4gKi8KKyAgICAgICAgICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQgPD0g cy0+eWJhc2UgKyBwb3NpdGlvbikKKyAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5oZWln aHQgLSAxKSAtIChzLT55YmFzZSAtIHMtPnkpOworICAgICAgICAgICAgICBpZiAocy0+eSArIHMt PmhlaWdodCA8IHMtPnliYXNlICsgcG9zaXRpb24gKyB0aGlja25lc3MpCisgICAgICAgICAgICAg ICAgdGhpY2tuZXNzID0gKHMtPnkgKyBzLT5oZWlnaHQpIC0gKHMtPnliYXNlICsgcG9zaXRpb24p OworICAgICAgICAgICAgICBzLT51bmRlcmxpbmVfdGhpY2tuZXNzID0gdGhpY2tuZXNzOworICAg ICAgICAgICAgICBzLT51bmRlcmxpbmVfcG9zaXRpb24gPXBvc2l0aW9uOworICAgICAgICAgICAg ICB5ID0gcy0+eWJhc2UgKyBwb3NpdGlvbjsKKyAgICAgICAgICAgICAgaWYgKHMtPmZhY2UtPnVu ZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5m LCBzLT5oZGMsIHMtPmdjLT5mb3JlZ3JvdW5kLCBzLT54LAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHksIHMtPndpZHRoLCAxKTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAg ICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmZhY2UtPnVuZGVybGlu ZV9jb2xvciwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHksIHMtPndp ZHRoLCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgLyogRHJhdyBvdmVybGlu ZS4gKi8KKyAgICAgIGlmIChzLT5mYWNlLT5vdmVybGluZV9wKQorICAgICAgICB7CisgICAgICAg ICAgdW5zaWduZWQgbG9uZyBkeSA9IDAsIGggPSAxOworICAgICAgICAgIGlmIChzLT5mYWNlLT5v dmVybGluZV9jb2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMt PmYsIHMtPmhkYywgcy0+Z2MtPmZvcmVncm91bmQsIHMtPngsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICBzLT55ICsgZHksIHMtPndpZHRoLCBoKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5mYWNlLT5vdmVybGluZV9j b2xvciwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+eSArIGR5LCBzLT53 aWR0aCwgaCk7CisgICAgICAgIH0KKyAgICAgIC8qIERyYXcgc3RyaWtlLXRocm91Z2guICovCisg ICAgICBpZiAocy0+ZmFjZS0+c3RyaWtlX3Rocm91Z2hfcAorICAgICAgICAgICYmICFGT05UX1RF WFRNRVRSSUMgKHMtPmZvbnQpLnRtU3RydWNrT3V0KQorICAgICAgICB7CisgICAgICAgICAgdW5z aWduZWQgbG9uZyBoID0gMTsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIGR5ID0gKHMtPmhlaWdo dCAtIGgpIC8gMjsKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+c3RyaWtlX3Rocm91Z2hfY29sb3Jf ZGVmYXVsdGVkX3ApCisgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMt PmdjLT5mb3JlZ3JvdW5kLCBzLT54LCBzLT55ICsgZHksCisgICAgICAgICAgICAgICAgICAgICAg ICAgICBzLT53aWR0aCwgaCk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHczMl9m aWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+ZmFjZS0+c3RyaWtlX3Rocm91Z2hfY29sb3IsIHMt PngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPnkgKyBkeSwgcy0+d2lkdGgsIGgp OworICAgICAgICB9CisgICAgICAvKiBEcmF3IHJlbGllZiBpZiBub3QgeWV0IGRyYXduLiAqLwor ICAgICAgaWYgKCFyZWxpZWZfZHJhd25fcCAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gp CisgICAgICAgIHczMl9kcmF3X2dseXBoX3N0cmluZ19ib3ggKHMpOworICAgICAgaWYgKHMtPnBy ZXYpCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpwcmV2OworICAg ICAgICAgIGZvciAocHJldiA9IHMtPnByZXY7IHByZXY7IHByZXYgPSBwcmV2LT5wcmV2KQorICAg ICAgICAgICAgaWYgKHByZXYtPmhsICE9IHMtPmhsCisgICAgICAgICAgICAgICAgJiYgcHJldi0+ eCArIHByZXYtPndpZHRoICsgcHJldi0+cmlnaHRfb3ZlcmhhbmcgPiBzLT54KQorICAgICAgICAg ICAgICB7CisgICAgICAgICAgICAgICAgLyogQXMgcHJldiB3YXMgZHJhd24gd2hpbGUgY2xpcHBl ZCB0byBpdHMgb3duIGFyZWEsIHdlCisgICAgICAgICAgICAgICAgICAgbXVzdCBkcmF3IHRoZSBy aWdodF9vdmVyaGFuZyBwYXJ0IHVzaW5nIHMtPmhsIG5vdy4gKi8KKyAgICAgICAgICAgICAgICBl bnVtIGRyYXdfZ2x5cGhzX2ZhY2Ugc2F2ZSA9IHByZXYtPmhsOworICAgICAgICAgICAgICAgIHBy ZXYtPmhsID0gcy0+aGw7CisgICAgICAgICAgICAgICAgbWNfdzMyX3NldF9nbHlwaF9zdHJpbmdf Z2MgKHByZXYsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICAgICAgICB3MzJfc2V0X2dseXBoX3N0 cmluZ19jbGlwcGluZ19leGFjdGx5IChzLCBwcmV2KTsKKyAgICAgICAgICAgICAgICBpZiAocHJl di0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSCkKKyAgICAgICAgICAgICAgICAgIHcz Ml9kcmF3X2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChwcmV2KTsKKyAgICAgICAgICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgICAgICAgICAgdzMyX2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmlu Z19mb3JlZ3JvdW5kIChwcmV2KTsKKyAgICAgICAgICAgICAgICB3MzJfc2V0X2NsaXBfcmVjdGFu Z2xlIChwcmV2LT5oZGMsIE5VTEwpOworICAgICAgICAgICAgICAgIHByZXYtPmhsID0gc2F2ZTsK KyAgICAgICAgICAgICAgICBwcmV2LT5udW1fY2xpcHMgPSAwOworICAgICAgICAgICAgICB9Cisg ICAgICAgIH0KKyAgICAgIGlmIChzLT5uZXh0KQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0 IGdseXBoX3N0cmluZyAqbmV4dDsKKyAgICAgICAgICBmb3IgKG5leHQgPSBzLT5uZXh0OyBuZXh0 OyBuZXh0ID0gbmV4dC0+bmV4dCkKKyAgICAgICAgICAgIGlmIChuZXh0LT5obCAhPSBzLT5obAor ICAgICAgICAgICAgICAgICYmIG5leHQtPnggLSBuZXh0LT5sZWZ0X292ZXJoYW5nIDwgcy0+eCAr IHMtPndpZHRoKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogQXMgbmV4dCB3 aWxsIGJlIGRyYXduIHdoaWxlIGNsaXBwZWQgdG8gaXRzIG93biBhcmVhLAorICAgICAgICAgICAg ICAgICAgIHdlIG11c3QgZHJhdyB0aGUgbGVmdF9vdmVyaGFuZyBwYXJ0IHVzaW5nIHMtPmhsIG5v dy4gKi8KKyAgICAgICAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2Ugc2F2ZSA9IG5leHQt PmhsOworICAgICAgICAgICAgICAgIG5leHQtPmhsID0gcy0+aGw7CisgICAgICAgICAgICAgICAg bWNfdzMyX3NldF9nbHlwaF9zdHJpbmdfZ2MgKG5leHQsIGN1cnNvcl9nY19wKTsKKyAgICAgICAg ICAgICAgICB3MzJfc2V0X2dseXBoX3N0cmluZ19jbGlwcGluZ19leGFjdGx5IChzLCBuZXh0KTsK KyAgICAgICAgICAgICAgICBpZiAobmV4dC0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQ SCkKKyAgICAgICAgICAgICAgICAgIHczMl9kcmF3X2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChu ZXh0KTsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgdzMyX2Ry YXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChuZXh0KTsKKyAgICAgICAgICAg ICAgICB3MzJfc2V0X2NsaXBfcmVjdGFuZ2xlIChuZXh0LT5oZGMsIE5VTEwpOworICAgICAgICAg ICAgICAgIG5leHQtPmhsID0gc2F2ZTsKKyAgICAgICAgICAgICAgICBuZXh0LT5udW1fY2xpcHMg PSAwOworICAgICAgICAgICAgICAgIG5leHQtPmNsaXBfaGVhZCA9IHMtPm5leHQ7CisgICAgICAg ICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgLyogUmVzZXQgY2xpcHBpbmcuICovCisgIHcz Ml9zZXRfY2xpcF9yZWN0YW5nbGUgKHMtPmhkYywgTlVMTCk7CisgIHMtPm51bV9jbGlwcyA9IDA7 Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKworCiAvKiBGcmluZ2UgYml0bWFwcy4gICovCiAKIHN0YXRpYyBpbnQgbWF4X2ZyaW5nZV9i bXAgPSAwOwpAQCAtNTQyLDYgKzE3MDEsMTUgQEAgdzMyX3VwZGF0ZV9iZWdpbiAoc3RydWN0IGZy YW1lICpmKQogICBpZiAoISBGUkFNRV9XMzJfUCAoZikpCiAgICAgcmV0dXJuOwogCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3Vw ZGF0aW5nX2ZyYW1lID0gZjsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBS ZWdlbmVyYXRlIGRpc3BsYXkgcGFsZXR0ZSBiZWZvcmUgZHJhd2luZyBpZiBsaXN0IG9mIHJlcXVl c3RlZAogICAgICBjb2xvcnMgaGFzIGNoYW5nZWQuICovCiAgIGlmIChkaXNwbGF5X2luZm8tPnJl Z2VuX3BhbGV0dGUpCkBAIC02NzQsNiArMTg0MiwxNiBAQCB3MzJfdXBkYXRlX2VuZCAoc3RydWN0 IGZyYW1lICpmKQogCiAgIC8qIE1vdXNlIGhpZ2hsaWdodCBtYXkgYmUgZGlzcGxheWVkIGFnYWlu LiAgKi8KICAgTU9VU0VfSExfSU5GTyAoZiktPm1vdXNlX2ZhY2VfZGVmZXIgPSBmYWxzZTsKKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBm LT5tY191cGRhdGluZ19mcmFtZSA9IE5VTEw7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor CisKIH0KIAogCkBAIC00MDAyLDEzICs1MTgwLDc0IEBAIHczMl9zZXRfdmVydGljYWxfc2Nyb2xs X2JhciAoc3RydWN0IHdpbmRvdyAqdywKIAkgICAgICByZWxlYXNlX2ZyYW1lX2RjIChmLCBoZGMp OwogCSAgICAgIHczMl9jbGVhcl91bmRlcl9pbnRlcm5hbF9ib3JkZXIgKGYpOwogCSAgICB9CisK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWd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G93X3dpbmRv dyAoZiwgaHduZCwgU1dfSElERSk7CisgICAgICAgICAgTW92ZVdpbmRvdyAoaHduZCwgbGVmdCwg dG9wLCB3aWR0aCwgbWF4IChoZWlnaHQsIDEpLCBsZWZ0IDw9IGJhci0+bGVmdCk7CisKKy8qIGVu ZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwogCiAJICBz aS5jYlNpemUgPSBzaXplb2YgKHNpKTsKIAkgIHNpLmZNYXNrID0gU0lGX1JBTkdFOwpAQCAtNDI3 Nyw2ICs1NTE2LDIxIEBAIHczMl9qdWRnZV9zY3JvbGxfYmFycyAoc3RydWN0IGZyYW1lICpmKQog ICAgIHsKICAgICAgIHN0cnVjdCBzY3JvbGxfYmFyICpiID0gWFNDUk9MTF9CQVIgKGJhcik7CiAK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAg ICAgIC8qIGBEZXN0cm95V2luZG93JyB3aXRoaW4gYHhfc2Nyb2xsX2Jhcl9yZW1vdmUnIHJlcGFp bnRzIHRoZSByZWN0YW5nbGUuCisgICAgICBUaGVyZWZvcmUsIHdlIGZpcnN0IHNlbmQgYSBtZXNz YWdlIHRvIGluaGliaXQgcmVwYWludGluZy4gKi8KKyAgICAgIGlmICghV0lORE9XX0xJVkVfUCAo Yi0+d2luZG93KSkKKyAgICAgICAgeworICAgICAgICAgIEhXTkQgaHduZCA9IFNDUk9MTF9CQVJf VzMyX1dJTkRPVyAoYik7CisgICAgICAgICAgU2VuZE1lc3NhZ2UgKGh3bmQsIFdNX1NFVFJFRFJB VywgZmFsc2UsIDApOworICAgICAgICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK ICAgICAgIHczMl9zY3JvbGxfYmFyX3JlbW92ZSAoYik7CiAKICAgICAgIG5leHQgPSBiLT5uZXh0 OwpAQCAtNzA4OCw2ICs4MzQyLDIwIEBAIGV4dGVybiBmcmFtZV9wYXJtX2hhbmRsZXIgdzMyX2Zy YW1lX3Bhcm1faGFuZGxlcnNbXTsKIAogc3RhdGljIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNl IHczMl9yZWRpc3BsYXlfaW50ZXJmYWNlID0KIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyogYHJlZGlzcGxheV9pbnRlcmZhY2UnIGlu IGB3MzJ0ZXJtLmNgIG11c3QgYmUgaW4gdGhlIGV4YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitgcmVk aXNwbGF5X2ludGVyZmFjZScgaW4gYGRpc3BleHRlcm4uaGAhICovCisKKyAgbWNfdzMyX2RyYXdf d2luZG93X2N1cnNvciwKKyAgbWNfdzMyX2RyYXdfZ2x5cGhfc3RyaW5nLAorCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAgIHczMl9mcmFtZV9wYXJtX2hhbmRsZXJzLAogICBndWlfcHJv ZHVjZV9nbHlwaHMsCiAgIGd1aV93cml0ZV9nbHlwaHMsCmRpZmYgLS1naXQgYS9zcmMvd2luZG93 LmggYi9zcmMvd2luZG93LmgKaW5kZXggNmIwZjBlNS4uMTRkZDM4YSAxMDA2NDQKLS0tIGEvc3Jj L3dpbmRvdy5oCisrKyBiL3NyYy93aW5kb3cuaApAQCAtMzI0LDYgKzMyNCwxNDcgQEAgc3RydWN0 IHdpbmRvdwogCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCiAKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIFN1ZmZpeGVzIGZv ciB0aGUgYG1jYCB3aW5kb3cgcG9pbnRlciBwcmVmaXguICovCitzdHJ1Y3QgbXVsdGlwbGVfY3Vy c29ycworeworICAvKiBUaGUgcmVjb3JkZWQgcGl4ZWwgd2lkdGggb2YgdGhlIGxhc3QgbGluZSBu dW1iZXIgZHJhd24gZHVyaW5nIHJlZGlzcGxheSAqLworICBpbnQgbG51bV9waXhlbF93aWR0aDsK K30gbWM7CisKK3N0cnVjdCBtY19tYXRyaXgKK3sKKyAgcHRyZGlmZl90IHZwb3NfYWxsb2NhdGVk OworICBwdHJkaWZmX3QgdnBvc191c2VkOworICBwdHJkaWZmX3QgY3Vyc29yc191c2VkWzRdOwor ICBlbnVtIG1jX2NhY2hlX3R5cGUKKyAgeworICAgIE1DX0NBQ0hFLAorICAgIENIX0NBQ0hFLAor ICAgIEZDX0NBQ0hFLAorICAgIE5PX0NBQ0hFCisgIH0gY2FjaGVfdHlwZTsKKyAgc3RydWN0IG1j X3Zwb3MKKyAgeworICAgIHB0cmRpZmZfdCBjYWNoZV9hbGxvY2F0ZWRbNF07CisgICAgcHRyZGlm Zl90IGNhY2hlX3VzZWRbNF07CisgICAgc3RydWN0IG1jX2NvbnRlbnRzCisgICAgeworICAgICAg Ym9vbF9iZiBzYW1lX3AgOiAxOworICAgICAgc3RydWN0IGdseXBoIGdseXBoOworICAgICAgaW50 IHg7CisgICAgICBpbnQgZng7CisgICAgICBpbnQgeTsKKyAgICAgIGludCBmeTsKKyAgICAgIGlu dCBocG9zOworICAgICAgaW50IHZwb3M7CisgICAgICBpbnQgd2Q7CisgICAgICBpbnQgaDsKKyAg ICAgIGVudW0gbWNfY3Vyc29yX3R5cGUKKyAgICAgIHsKKyAgICAgICAgLyogTk9URTogIFRoZSBm cmluZ2UgYml0bWFwIGZyYW1ld29yayByZWxpZXMgdXBvbiBNQ19OT19GUklOR0VfQklUTUFQCisg ICAgICAgIGhhdmluZyBhIHZhbHVlIG9mIHplcm8gKDApLiAqLworICAgICAgICBNQ19OT19GUklO R0VfQklUTUFQLAorICAgICAgICBNQ19OT19DVVJTT1IsCisgICAgICAgIE1DX1JJR0hUX0ZSSU5H RV9CSVRNQVAsCisgICAgICAgIE1DX0xFRlRfRlJJTkdFX0JJVE1BUCwKKyAgICAgICAgTUNfRlJB TUVEX0JPWCwKKyAgICAgICAgTUNfRklMTEVEX0JPWCwKKyAgICAgICAgTUNfSE9MTE9XX0JPWCwK KyAgICAgICAgTUNfQkFSLAorICAgICAgICBNQ19IQkFSCisgICAgICB9IGN1cnNvcl90eXBlOwor ICAgICAgaW50IGN1cnNvcl93aWR0aDsKKyAgICAgIHN0cnVjdCBtY19SR0IKKyAgICAgIHsKKyAg ICAgICAgZG91YmxlIHJlZDsKKyAgICAgICAgZG91YmxlIGdyZWVuOworICAgICAgICBkb3VibGUg Ymx1ZTsKKyAgICAgIH0gZmcsIGJnOworICAgICAgYm9vbF9iZiBhY3RpdmVfcCA6IDE7CisgICAg ICBlbnVtIG1jX2ZsYXZvcgorICAgICAgeworICAgICAgICBOT19GTEFWT1IsCisgICAgICAgIE1D X0dMWVBILAorICAgICAgICBNQ19HTFlQSExFU1MsCisgICAgICAgIE1DX09WRVJMQVlfQVJST1df QklUTUFQLAorICAgICAgICBNQ19QSUxDUk9XLAorICAgICAgICBNQ19IT0xMT1dfUkVDVEFOR0xF X1JJR0hUX0FSUk9XLAorICAgICAgICBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hU X0FSUk9XLAorICAgICAgICBNQ19IT0xMT1dfUkVDVEFOR0xFLAorICAgICAgICBNQ19WRVJUSUNB TF9CQVJfUklHSFRfQVJST1csCisgICAgICAgIE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdI VF9BUlJPVywKKyAgICAgICAgTUNfVkVSVElDQUxfQkFSLAorICAgICAgICBNQ19SRVZFUlNFRF9W RVJUSUNBTF9CQVIsCisgICAgICAgIE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgIH0g Z2x5cGhfZmxhdm9yOworICAgICAgZW51bSBtY19yb3dfcG9zaXRpb24KKyAgICAgIHsKKyAgICAg ICAgUFJFX1pWLAorICAgICAgICBBVF9aViwKKyAgICAgICAgUE9TVF9aVgorICAgICAgfSByb3df cG9zaXRpb247CisgICAgICBib29sX2JmIGVuYWJsZWRfcCA6IDE7CisgICAgfSAqY2FjaGVbNF07 CisgIH0gKnZwb3M7CisgIC8qIFVzZWQgZWxzZXdoZXJlLiAqLworICBzdHJ1Y3QgbWNfZXNzZW50 aWFscworICB7CisgICAgYm9vbF9iZiBhY3RpdmVfcCA6IDE7CisgICAgc3RydWN0IG1jX1JHQiBj aF9mZ1szXSwgZmNfZmdbM10sIHNwX2ZnOworICAgIGludCBmY194OworICAgIGludCB6djsKKyAg ICBpbnQgenZfYnl0ZTsKKyAgfSBlc3NlbnRpYWxzOworICAvKiBVc2VkIGVsc2V3aGVyZS4gKi8K KyAgZW51bSBtY19lbmdpbmVfdHlwZQorICB7CisgICAgTVVMVElQTEVfQ1VSU09SUywKKyAgICBI T1JJWk9OVEFMX1JVTEVSLAorICAgIFZFUlRJQ0FMX1JVTEVSLAorICAgIEZJTExfQ09MVU1OLAor ICAgIENVUlNPUl9JTkRJQ0FUT1IKKyAgfSBhY3Rpb25fdHlwZTsKKyAgLyogVXNlZCBlbHNld2hl cmUuICovCisgIGVudW0gbWNfcHJlX3Njcm9sbF9jbGVhbl90eXBlCisgIHsKKyAgICBUUllfV0lO RE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfRE9XTiwKKyAgICBUUllfV0lORE9XX1JFVVNJTkdf Q1VSUkVOVF9NQVRSSVhfVVAsCisgICAgVFJZX1dJTkRPV19JRAorICB9IG1jX3ByZV9zY3JvbGxf Y2xlYW5fdHlwZV9fZnJvbV93aGVyZTsKKyAgLyogVXNlZCBlbHNld2hlcmUuICovCisgIGVudW0g bWNfZHJhd19yb3dfdHlwZQorICB7CisgICAgTk9XSEVSRSwKKyAgICBTQ1JJQkVfT05FLAorICAg IFNDUklCRV9UV08sCisgICAgU0NSSUJFX1RIUkVFLAorICAgIFNLSVBQRUQsCisgICAgUE9TVF9D SEFOR0VELAorICAgIFVOQ0hBTkdFRCwKKyAgICBTRVRfQ1VSU09SX09ORSwKKyAgICBTRVRfQ1VS U09SX1RXTworICB9IG1jX2RyYXdfcm93X3R5cGVfX2Zyb21fd2hlcmU7CisgIC8qIFVzZWQgZWxz ZXdoZXJlLiAqLworICBlbnVtIG1jX3JlZHJhd19yb3dfdHlwZQorICB7CisgICAgVVBEQVRFX1dJ TkRPV19fUkVEUkFXX09WRVJMQVBQRURfUk9XUywKKyAgICBHVUlfSU5TRVJUX0dMWVBIUywKKyAg ICBHVUlfRklYX09WRVJMQVBQSU5HX0FSRUEsCisgICAgRFJBV19ST1dfV0lUSF9NT1VTRV9GQUNF LAorICAgIEVYUE9TRV9BUkVBX09ORSwKKyAgICBFWFBPU0VfQVJFQV9UV08sCisgICAgRVhQT1NF X0xJTkUKKyAgfSBtY19yZWRyYXdfcm93X3R5cGVfX2Zyb21fd2hlcmU7Cit9IG1jX21hdHJpeDsK KworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor CisKICAgICAvKiBDdXJzb3IgdHlwZSBvZiBsYXN0IGN1cnNvciBkcmF3biBvbiB0aGUgd2luZG93 LiAgKi8KICAgICBlbnVtIHRleHRfY3Vyc29yX2tpbmRzIHB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CQkJCQlITCwgWCwgTEFTVF9Y KTsJCQlcCisJICAgICAgYnJlYWs7CisKKyNkZWZpbmUgTUNfQlVJTERfR0xZUEhfU1RSSU5HU19Y VyhTVEFSVCwgRU5ELCBIRUFELCBUQUlMLCBITCwgWCwgTEFTVF9YKQlcCisgICAgICAgICAgICBj YXNlIFhXSURHRVRfR0xZUEg6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBcCisgICAgICAgICAgICAgIE1DX0JVSUxEX1hXSURHRVRfR0xZUEhfU1RSSU5HIChTVEFSVCwg RU5ELCBIRUFELCBUQUlMLCAgICAgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBITCwgWCwgTEFTVF9YKTsgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAg IGJyZWFrOworCisjZGVmaW5lIE1DX0JVSUxEX0dMWVBIX1NUUklOR1NfMihTVEFSVCwgRU5ELCBI RUFELCBUQUlMLCBITCwgWCwgTEFTVF9YKQlcCisJICAgIGNhc2UgR0xZUEhMRVNTX0dMWVBIOgkJ CQkJXAorCSAgICAgIE1DX0JVSUxEX0dMWVBITEVTU19HTFlQSF9TVFJJTkcgKFNUQVJULCBFTkQs IEhFQUQsIFRBSUwsCVwKKwkJCQkJICAgIEhMLCBYLCBMQVNUX1gpOwkJXAorCSAgICAgIGJyZWFr OwkJCQkJCQlcCisJCQkJCQkJCQlcCisJICAgIGRlZmF1bHQ6CQkJCQkJCVwKKwkgICAgICBlbWFj c19hYm9ydCAoKTsJCQkJCQlcCisJICAgIH0JCQkJCQkJCVwKKwkJCQkJCQkJCVwKKwkgIGlmIChz KQkJCQkJCQlcCisJICAgIHsJCQkJCQkJCVwKKwkgICAgICBzZXRfZ2x5cGhfc3RyaW5nX2JhY2tn cm91bmRfd2lkdGggKHMsIFNUQVJULCBMQVNUX1gpOwlcCisJICAgICAgKFgpICs9IHMtPndpZHRo OwkJCQkJCVwKKwkgICAgfQkJCQkJCQkJ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eworICAgICAgaWYgKCFDT05TUCAobGlzdCkgfHwgRVEgKFhDQVIgKGxpc3QpLCBlbHQpKQor ICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlmICghQ09O U1AgKGxpc3QpIHx8IEVRIChYQ0FSIChsaXN0KSwgZWx0KSkKKyAgICAgICAgYnJlYWs7CisgICAg ICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KSB8fCBFUSAoWENB UiAobGlzdCksIGVsdCkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3Qp OworICAgIH0KKyAgcmV0dXJuIGxpc3Q7Cit9CisKK0xpc3BfT2JqZWN0CittY19udGggKGludCBu dW0sIExpc3BfT2JqZWN0IGxpc3QpCit7CisgIGZvciAoaW50IGkgPSAwOyBpIDwgbnVtICYmICFO SUxQIChsaXN0KTsgaSsrKQorICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgaWYgKENPTlNQIChs aXN0KSkKKyAgICByZXR1cm4gWENBUiAobGlzdCk7CisgICAgZWxzZQorICAgICAgcmV0dXJuIFFu aWw7Cit9CisKK0xpc3BfT2JqZWN0CittY19hc3NxIChMaXNwX09iamVjdCBrZXksIExpc3BfT2Jq ZWN0IGxpc3QpCit7CisgIHdoaWxlICgxKQorICAgIHsKKyAgICAgIGlmICghQ09OU1AgKGxpc3Qp CisgICAgICAgICAgfHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgRVEg KFhDQVIgKFhDQVIgKGxpc3QpKSwga2V5KSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9 IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09O U1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAgICAgICAmJiBFUSAoWENBUiAoWENBUiAobGlzdCkp LCBrZXkpKSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAg ICBpZiAoIUNPTlNQIChsaXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisg ICAgICAgICAgICAgICYmIEVRIChYQ0FSIChYQ0FSIChsaXN0KSksIGtleSkpKQorICAgICAgICBi cmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICB9CisgIGlmIChDT05TUCAobGlz dCkpCisgICAgcmV0dXJuIFhDQVIgKGxpc3QpOworICAgIGVsc2UKKyAgICAgIHJldHVybiBRbmls OworfQorCitMaXNwX09iamVjdAorbWNfYXNzb2MgKExpc3BfT2JqZWN0IGtleSwgTGlzcF9PYmpl Y3QgbGlzdCkKK3sKKyAgTGlzcF9PYmplY3QgY2FyOworICB3aGlsZSAoMSkKKyAgICB7CisgICAg ICBpZiAoIUNPTlNQIChsaXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisg ICAgICAgICAgICAgICYmIChjYXIgPSBYQ0FSIChYQ0FSIChsaXN0KSksCisgICAgICAgICAgICAg ICAgICBFUSAoY2FyLCBrZXkpIHx8ICFOSUxQIChGZXF1YWwgKGNhciwga2V5KSkpKSkKKyAgICAg ICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNPTlNQIChs aXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAgICYm IChjYXIgPSBYQ0FSIChYQ0FSIChsaXN0KSksCisgICAgICAgICAgICAgICAgICBFUSAoY2FyLCBr ZXkpIHx8ICFOSUxQIChGZXF1YWwgKGNhciwga2V5KSkpKSkKKyAgICAgICAgYnJlYWs7CisgICAg ICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KQorICAgICAgICAg IHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAgICYmIChjYXIgPSBYQ0FSIChY Q0FSIChsaXN0KSksCisgICAgICAgICAgICAgICAgICBFUSAoY2FyLCBrZXkpIHx8ICFOSUxQIChG ZXF1YWwgKGNhciwga2V5KSkpKSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAo bGlzdCk7CisgICAgfQorICBpZiAoQ09OU1AgKGxpc3QpKQorICAgIHJldHVybiBYQ0FSIChsaXN0 KTsKKyAgICBlbHNlCisgICAgICByZXR1cm4gUW5pbDsKK30KKworTGlzcF9PYmplY3QKK21jX3Bs aXN0X2dldCAoTGlzcF9PYmplY3QgcGxpc3QsIExpc3BfT2JqZWN0IHByb3ApCit7CisgIExpc3Bf T2JqZWN0IHRhaWwsIGhhbGZ0YWlsOworICAvKiBoYWxmdGFpbCBpcyB1c2VkIHRvIGRldGVjdCBj aXJjdWxhciBsaXN0cy4gICovCisgIHRhaWwgPSBoYWxmdGFpbCA9IHBsaXN0OworICB3aGlsZSAo Q09OU1AgKHRhaWwpICYmIENPTlNQIChYQ0RSICh0YWlsKSkpCisgICAgeworICAgICAgaWYgKEVR IChwcm9wLCBYQ0FSICh0YWlsKSkpCisgICAgICAgIHJldHVybiBYQ0FSIChYQ0RSICh0YWlsKSk7 CisgICAgICB0YWlsID0gWENEUiAoWENEUiAodGFpbCkpOworICAgICAgaGFsZnRhaWwgPSBYQ0RS IChoYWxmdGFpbCk7CisgICAgICBpZiAoRVEgKHRhaWwsIGhhbGZ0YWlsKSkKKyAgICAgICAgYnJl YWs7CisgICAgfQorICByZXR1cm4gUW5pbDsKK30KKworLyogUkVHSU9OIEJFR0lOOiAgbWNfcmVn aW9uX2xpbWl0ICgxKQorICAgUkVHSU9OIEVORDogIG1jX3JlZ2lvbl9saW1pdCAoMCkgKi8KK3B0 cmRpZmZfdAorbWNfcmVnaW9uX2xpbWl0IChib29sIGJlZ2luX3ApCit7CisgIGlmICghTklMUCAo VnRyYW5zaWVudF9tYXJrX21vZGUpCisgICAgICAmJiBOSUxQIChWbWFya19ldmVuX2lmX2luYWN0 aXZlKQorICAgICAgJiYgTklMUCAoQlZBUiAoY3VycmVudF9idWZmZXIsIG1hcmtfYWN0aXZlKSkp CisgICAgeHNpZ25hbDAgKFFtYXJrX2luYWN0aXZlKTsKKyAgTGlzcF9PYmplY3QgbWFya2VyID0g QlZBUiAoY3VycmVudF9idWZmZXIsIG1hcmspOworICBpbnQgbSA9IChYTUFSS0VSIChtYXJrZXIp LT5idWZmZXIpCisgICAgICAgICAgPyBYTUFSS0VSIChtYXJrZXIpLT5jaGFycG9zCisgICAgICAg ICAgOiAtMTsKKyAgcmV0dXJuIChtID09IC0xKQorICAgICAgICAgICA/IC0xCisgICAgICAgICA6 IChQVCA8IG0pID09IGJlZ2luX3AKKyAgICAgICAgICAgPyBQVAorICAgICAgICAgOiBjbGlwX3Rv X2JvdW5kcyAoQkVHViwgbSwgWlYpOworfQorCisvKiBDaGVjayB0aGUgcHJlc2VuY2Ugb2YgYSBk aXNwbGF5IHByb3BlcnR5IGFuZCBjb21wdXRlIGl0cyB3aWR0aC4KKyAgIElmIGEgcHJvcGVydHkg d2FzIGZvdW5kIGFuZCBpdHMgd2lkdGggd2FzIGZvdW5kIGFzIHdlbGwsIHJldHVybgorICAgaXRz IHdpZHRoICg+PSAwKSBhbmQgc2V0IHRoZSBwb3NpdGlvbiBvZiB0aGUgZW5kIG9mIHRoZSBwcm9w ZXJ0eQorICAgaW4gRU5EUE9TLgorICAgT3RoZXJ3aXNlIGp1c3QgcmV0dXJuIC0xLiAqLworc3Rh dGljIGludAorbWNfY2hlY2tfZGlzcGxheV93aWR0aCAocHRyZGlmZl90IHBvcywgcHRyZGlmZl90 IGNvbCwgcHRyZGlmZl90ICplbmRwb3MpCit7CisgIExpc3BfT2JqZWN0IHZhbCwgb3ZlcmxheTsK KyAgaWYgKENPTlNQICh2YWwgPSBnZXRfY2hhcl9wcm9wZXJ0eV9hbmRfb3ZlcmxheQorICAgICAg ICAgICAgICAobWFrZV9maXhudW0gKHBvcyksIFFkaXNwbGF5LCBRbmlsLCAmb3ZlcmxheSkpCisg ICAgICAmJiBFUSAoUXNwYWNlLCBYQ0FSICh2YWwpKSkKKyAgICB7IC8qIEZJWE1FOiBVc2UgY2Fs Y19waXhlbF93aWR0aF9vcl9oZWlnaHQuICovCisgICAgICBMaXNwX09iamVjdCBwbGlzdCA9IFhD RFIgKHZhbCksIHByb3A7CisgICAgICBpbnQgd2lkdGggPSAtMTsKKyAgICAgIEVNQUNTX0lOVCBh bGlnbl90b19tYXggPSAoY29sIDwgTU9TVF9QT1NJVElWRV9GSVhOVU0gLSBJTlRfTUFYCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IChFTUFDU19JTlQpIElOVF9NQVggKyBjb2wK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTU9TVF9QT1NJVElWRV9GSVhOVU0p OworICAgICAgaWYgKChwcm9wID0gbWNfcGxpc3RfZ2V0IChwbGlzdCwgUUN3aWR0aCksIFJBTkdF RF9GSVhOVU1QICgwLCBwcm9wLCBJTlRfTUFYKSkKKyAgICAgICAgICB8fCAocHJvcCA9IG1jX3Bs aXN0X2dldCAocGxpc3QsIFFDcmVsYXRpdmVfd2lkdGgpLAorICAgICAgICAgICAgICBSQU5HRURf RklYTlVNUCAoMCwgcHJvcCwgSU5UX01BWCkpKQorICAgICAgICB3aWR0aCA9IFhGSVhOVU0gKHBy b3ApOworICAgICAgICBlbHNlIGlmIChGTE9BVFAgKHByb3ApICYmIDAgPD0gWEZMT0FUX0RBVEEg KHByb3ApCisgICAgICAgICAgICAgICAgICYmIFhGTE9BVF9EQVRBIChwcm9wKSA8PSBJTlRfTUFY KQorICAgICAgICAgIHdpZHRoID0gKGludCkoWEZMT0FUX0RBVEEgKHByb3ApICsgMC41KTsKKyAg ICAgICAgICBlbHNlIGlmICgocHJvcCA9IG1jX3BsaXN0X2dldCAocGxpc3QsIFFDYWxpZ25fdG8p LAorICAgICAgICAgICAgICAgICAgICBSQU5HRURfRklYTlVNUCAoY29sLCBwcm9wLCBhbGlnbl90 b19tYXgpKSkKKyAgICAgICAgICAgIHdpZHRoID0gWEZJWE5VTSAocHJvcCkgLSBjb2w7CisgICAg ICAgICAgICAgIGVsc2UgaWYgKEZMT0FUUCAocHJvcCkgJiYgY29sIDw9IFhGTE9BVF9EQVRBIChw cm9wKQorICAgICAgICAgICAgICAgICAgICAgICAmJiAoWEZMT0FUX0RBVEEgKHByb3ApIDw9IGFs aWduX3RvX21heCkpCisgICAgICAgICAgICAgICAgd2lkdGggPSAoaW50KShYRkxPQVRfREFUQSAo cHJvcCkgKyAwLjUpIC0gY29sOworICAgICAgaWYgKHdpZHRoID49IDApCisgICAgICAgIHsKKyAg ICAgICAgICBwdHJkaWZmX3Qgc3RhcnQ7CisgICAgICAgICAgaWYgKE9WRVJMQVlQIChvdmVybGF5 KSkKKyAgICAgICAgICAgICplbmRwb3MgPSBPVkVSTEFZX1BPU0lUSU9OIChPVkVSTEFZX0VORCAo b3ZlcmxheSkpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBnZXRfcHJvcGVydHlf YW5kX3JhbmdlIChwb3MsIFFkaXNwbGF5LCAmdmFsLCAmc3RhcnQsIGVuZHBvcywgUW5pbCk7Cisg ICAgICAgICAgLyogRm9yIDpyZWxhdGl2ZS13aWR0aCwgd2UgbmVlZCB0byBtdWx0aXBseSBieSB0 aGUgY29sdW1uCisgICAgICAgICAgICAgd2lkdGggb2YgdGhlIGNoYXJhY3RlciBhdCBQT1MsIGlm IGl0IGlzIGdyZWF0ZXIgdGhhbiAxLiAqLworICAgICAgICAgIGlmICghTklMUCAobWNfcGxpc3Rf Z2V0IChwbGlzdCwgUUNyZWxhdGl2ZV93aWR0aCkpCisgICAgICAgICAgICAgICYmICFOSUxQIChC VkFSIChjdXJyZW50X2J1ZmZlciwgZW5hYmxlX211bHRpYnl0ZV9jaGFyYWN0ZXJzKSkp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2luLCBzdHJ1Y3QgZmFjZSAqZmFjZSwKKyAgICAgICAg ICAgICAgICAgIExpc3BfT2JqZWN0IHN0cmluZykKK3sKKyAgcHRyZGlmZl90IGNvdW50ID0gU1BF Q1BETF9JTkRFWCAoKTsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3aW4tPmZyYW1lKTsK KyAgTGlzcF9PYmplY3QgcG9zID0gbWFrZV9maXhudW0gKGNoYXJwb3MpOworICBwdHJkaWZmX3Qg dG87CisgIHB0cmRpZmZfdCBwdCA9IFBULCBwdF9ieXRlID0gUFRfQllURTsKKyAgTGlzcF9PYmpl Y3QgcmUsIGZvbnRfb2JqZWN0LCBsZ3N0cmluZzsKKyAgcHRyZGlmZl90IGxlbjsKKyAgcmVjb3Jk X3Vud2luZF9zYXZlX21hdGNoX2RhdGEgKCk7CisgIHJlID0gQVJFRiAocnVsZSwgMCk7CisgIGlm IChOSUxQIChyZSkpCisgICAgbGVuID0gMTsKKyAgZWxzZSBpZiAoISBTVFJJTkdQIChyZSkpCisg ICAgcmV0dXJuIHVuYmluZF90byAoY291bnQsIFFuaWwpOworICBlbHNlIGlmICgobGVuID0gZmFz dF9sb29raW5nX2F0IChyZSwgY2hhcnBvcywgYnl0ZXBvcywgbGltaXQsIC0xLCBzdHJpbmcpKQor ICAgICAgICAgICA+IDApCisgICAgeworICAgICAgaWYgKE5JTFAgKHN0cmluZykpCisgICAgICAg IGxlbiA9IEJZVEVfVE9fQ0hBUiAoYnl0ZXBvcyArIGxlbikgLSBjaGFycG9zOworICAgICAgZWxz ZQorICAgICAgICBsZW4gPSBzdHJpbmdfYnl0ZV90b19jaGFyIChzdHJpbmcsIGJ5dGVwb3MgKyBs ZW4pIC0gY2hhcnBvczsKKyAgICB9CisgIGlmIChsZW4gPD0gMCkKKyAgICByZXR1cm4gdW5iaW5k X3RvIChjb3VudCwgUW5pbCk7CisgIHRvID0gbGltaXQgPSBjaGFycG9zICsgbGVuOworI2lmZGVm IEhBVkVfV0lORE9XX1NZU1RFTQorICBpZiAoRlJBTUVfV0lORE9XX1AgKGYpKQorICAgIHsKKyAg ICAgIGZvbnRfb2JqZWN0ID0gZm9udF9yYW5nZSAoY2hhcnBvcywgYnl0ZXBvcywgJnRvLCB3aW4s IGZhY2UsIHN0cmluZyk7CisgICAgICBpZiAoISBGT05UX09CSkVDVF9QIChmb250X29iamVjdCkK KyAgICAgICAgICB8fCAoISBOSUxQIChyZSkKKyAgICAgICAgICAgICAgJiYgdG8gPCBsaW1pdAor ICAgICAgICAgICAgICAmJiAoZmFzdF9sb29raW5nX2F0IChyZSwgY2hhcnBvcywgYnl0ZXBvcywg dG8sIC0xLCBzdHJpbmcpIDw9IDApKSkKKyAgICAgICAgcmV0dXJuIHVuYmluZF90byAoY291bnQs IFFuaWwpOworICAgIH0KKyAgZWxzZQorI2VuZGlmICAgICAgICAvKiBub3QgSEFWRV9XSU5ET1df U1lTVEVNICovCisgICAgZm9udF9vYmplY3QgPSB3aW4tPmZyYW1lOworICBsZ3N0cmluZyA9IEZj b21wb3NpdGlvbl9nZXRfZ3N0cmluZyAocG9zLCBtYWtlX2ZpeG51bSAodG8pLCBmb250X29iamVj dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmluZyk7CisgIGlm IChOSUxQIChMR1NUUklOR19JRCAobGdzdHJpbmcpKSkKKyAgICB7CisgICAgICAvKiBTYXZlIHBv aW50IGFzIG1hcmtlciBiZWZvcmUgY2FsbGluZyBvdXQgdG8gbGlzcC4gICovCisgICAgICBpZiAo TklMUCAoc3RyaW5nKSkKKyAgICAgICAgcmVjb3JkX3Vud2luZF9wcm90ZWN0IChyZXN0b3JlX3Bv aW50X3Vud2luZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBidWlsZF9tYXJrZXIg KGN1cnJlbnRfYnVmZmVyLCBwdCwgcHRfYnl0ZSkpOworICAgICAgbGdzdHJpbmcgPSBzYWZlX2Nh bGwgKDYsIFZhdX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0cmRpZmZfdCBjaGFycG9zLAorICAgICAgICAgICAgICAgICAgICAg ICAgICBwdHJkaWZmX3QgYnl0ZXBvcywgcHRyZGlmZl90IGVuZHBvcywgc3RydWN0IHdpbmRvdyAq dywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmZhY2UsIExpc3BfT2Jq ZWN0IHN0cmluZykKK3sKKyAgaWYgKGNtcF9pdC0+Y2ggPT0gLTIpCisgICAgeworICAgICAgY29t cG9zaXRpb25fY29tcHV0ZV9zdG9wX3BvcyAoY21wX2l0LCBjaGFycG9zLCBieXRlcG9zLCBlbmRw b3MsIHN0cmluZyk7CisgICAgICBpZiAoY21wX2l0LT5jaCA9PSAtMiB8fCBjbXBfaXQtPnN0b3Bf cG9zICE9IGNoYXJwb3MpCisgICAgICAgIC8qIFRoZSBjdXJyZW50IHBvc2l0aW9uIGlzIG5vdCBj b21wb3NlZC4gICovCisgICAgICAgIHJldHVybiAwOworICAgIH0KKyAgaWYgKGVuZHBvcyA8IDAp CisgICAgZW5kcG9zID0gTklMUCAoc3RyaW5nKSA/IEJFR1YgOiAwOworICBpZiAoY21wX2l0LT5j aCA8IDApCisgICAgeworICAgICAgLyogV2UgYXJlIGxvb2tpbmcgYXQgYSBzdGF0aWMgY29tcG9z aXRpb24uICAqLworICAgICAgcHRyZGlmZl90IHN0YXJ0LCBlbmQ7CisgICAgICBMaXNwX09iamVj dCBwcm9wOworICAgICAgZmluZF9jb21wb3NpdGlvbiAoY2hhcnBvcywgLTEsICZzdGFydCwgJmVu ZCwgJnByb3AsIHN0cmluZyk7CisgICAgICBjbXBfaXQtPmlkID0gZ2V0X2NvbXBvc2l0aW9uX2lk IChjaGFycG9zLCBieXRlcG9zLCBlbmQgLSBzdGFydCwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHByb3AsIHN0cmluZyk7CisgICAgICBpZiAoY21wX2l0LT5pZCA8IDAp CisgICAgICAgIGdvdG8gbm9fY29tcG9zaXRpb247CisgICAgICBjbXBfaXQtPm5jaGFycyA9IGVu ZCAtIHN0YXJ0OworICAgICAgY21wX2l0LT5uZ2x5cGhzID0gY29tcG9zaXRpb25fdGFibGVbY21w X2l0LT5pZF0tPmdseXBoX2xlbjsKKyAgICB9CisgIGVsc2UgaWYgKHcpCisgICAgeworICAgICAg TGlzcF9PYmplY3QgbGdzdHJpbmcgPSBRbmlsOworICAgICAgTGlzcF9PYmplY3QgdmFsLCBlbHQ7 CisgICAgICBwdHJkaWZmX3QgaTsKKyAgICAgIHZhbCA9IENIQVJfVEFCTEVfUkVGIChWY29tcG9z aXRpb25fZnVuY3Rpb25fdGFibGUsIGNtcF9pdC0+Y2gpOworICAgICAgZm9yIChpID0gMDsgaSA8 IGNtcF9pdC0+cnVsZV9pZHg7IGkrKywgdmFsID0gWENEUiAodmFsKSk7CisgICAgICBpZiAoY2hh cnBvcyA8IGVuZHBvcykKKyAgICAgICAgeworICAgICAgICAgIGZvciAoOyBDT05TUCAodmFsKTsg dmFsID0gWENEUiAodmFsKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgZWx0ID0gWENB UiAodmFsKTsKKyAgICAgICAgICAgICAgaWYgKCEgVkVDVE9SUCAoZWx0KSB8fCBBU0laRSAoZWx0 KSAhPSAzCisgICAgICAgICAgICAgICAgICB8fCAhIElOVEVHRVJQIChBUkVGIChlbHQsIDEpKSkK KyAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgaWYgKFhGSVhOQVQgKEFS RUYgKGVsdCwgMSkpICE9IGNtcF9pdC0+bG9va2JhY2spCisgICAgICAgICAgICAgICAgZ290byBu b19jb21wb3NpdGlvbjsKKyAgICAgICAgICAgICAgbGdzdHJpbmcgPSBtY19hdXRvY21wX2NoYXJz IChlbHQsIGNoYXJwb3MsIGJ5dGVwb3MsIGVuZHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICB3LCBmYWNlLCBzdHJpbmcpOworICAgICAgICAgICAgICBpZiAoY29t cG9zaXRpb25fZ3N0cmluZ19wIChsZ3N0cmluZykpCisgICAgICAgICAgICAgICAgYnJlYWs7Cisg ICAgICAgICAgICAgIGxnc3RyaW5nID0gUW5pbDsKKyAgICAgICAgICAgICAgLyogQ29tcG9zaXRp b24gZmFpbGVkIHBlcmhhcHMgYmVjYXVzZSB0aGUgZm9udCBkb2Vzbid0CisgICAgICAgICAgICAg ICAgIHN1cHBvcnQgc3VmZmljaWVudCByYW5nZSBvZiBjaGFyYWN0ZXJzLiAgVHJ5IHRoZQorICAg ICAgICAgICAgICAgICBvdGhlciBjb21wb3NpdGlvbiBydWxlcyBpZiBhbnkuICAqLworICAgICAg ICAgICAgfQorICAgICAgICAgIGNtcF9pdC0+cmV2ZXJzZWRfcCA9IDA7CisgICAgICAgIH0KKyAg ICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgIHB0cmRpZmZfdCBjcG9zID0gY2hhcnBvcywg YnBvcyA9IGJ5dGVwb3M7CisgICAgICAgICAgY21wX2l0LT5yZXZlcnNlZF9wID0gMTsKKyAgICAg ICAgICBlbHQgPSBYQ0FSICh2YWwpOworICAgICAgICAgIGlmIChjbXBfaXQtPmxvb2tiYWNrID4g MCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY3BvcyA9IGNoYXJwb3MgLSBjbXBfaXQt Pmxvb2tiYWNrOworICAgICAgICAgICAgICBpZiAoU1RSSU5HUCAoc3RyaW5nKSkKKyAgICAgICAg ICAgICAgICBicG9zID0gc3RyaW5nX2NoYXJfdG9fYnl0ZSAoc3RyaW5nLCBjcG9zKTsKKyAgICAg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIGJwb3MgPSBDSEFSX1RPX0JZVEUgKGNwb3Mp OworICAgICAgICAgICAgfQorICAgICAgICAgIGxnc3RyaW5nID0gbWNfYXV0b2NtcF9jaGFycyAo ZWx0LCBjcG9zLCBicG9zLCBjaGFycG9zICsgMSwgdywgZmFjZSwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHN0cmluZyk7CisgICAgICAgICAgaWYgKCEgY29tcG9zaXRpb25f Z3N0cmluZ19wIChsZ3N0cmluZykKKyAgICAgICAgICAgICAgfHwgY3BvcyArIExHU1RSSU5HX0NI QVJfTEVOIChsZ3N0cmluZykgLSAxICE9IGNoYXJwb3MpCisgICAgICAgICAgICAvKiBDb21wb3Np dGlvbiBmYWlsZWQgb3IgZGlkbid0IGNvdmVyIHRoZSBjdXJyZW50CisgICAgICAgICAgICAgICBj aGFyYWN0ZXIuICAqLworICAgICAgICAgICAgZ290byBub19jb21wb3NpdGlvbjsKKyAgICAgICAg fQorICAgICAgaWYgKE5JTFAgKGxnc3RyaW5nKSkKKyAgICAgICAgZ290byBub19jb21wb3NpdGlv bjsKKyAgICAgIGlmIChOSUxQIChMR1NUUklOR19JRCAobGdzdHJpbmcpKSkKKyAgICAgICAgbGdz dHJpbmcgPSBjb21wb3NpdGlvbl9nc3RyaW5nX3B1dF9jYWNoZSAobGdzdHJpbmcsIC0xKTsKKyAg ICAgIGNtcF9pdC0+aWQgPSBYRklYTlVNIChMR1NUUklOR19JRCAobGdzdHJpbmcpKTsKKyAgICAg IGZvciAoaSA9IDA7IGkgPCBMR1NUUklOR19HTFlQSF9MRU4gKGxnc3RyaW5nKTsgaSsrKQorICAg ICAgICBpZiAoTklMUCAoTEdTVFJJTkdfR0xZUEggKGxnc3RyaW5nLCBpKSkpCisgICAgICAgICAg YnJlYWs7CisgICAgICBjbXBfaXQtPm5nbHlwaHMgPSBpOworICAgICAgY21wX2l0LT5mcm9tID0g MDsKKyAgICAgIGNtcF9pdC0+dG8gPSBpOworICAgIH0KKyAgZWxzZQorICAgIGdvdG8gbm9fY29t cG9zaXRpb247CisgIHJldHVybiAxOworIG5vX2NvbXBvc2l0aW9uOgorICBpZiAoY2hhcnBvcyA9 PSBlbmRwb3MpCisgICAgcmV0dXJuIDA7CisgIGlmIChj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HNjYW4pOworICAgICAgICAgIGlmIChz Y2FuID49IGVuZCkKKyAgICAgICAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgfQorICAgICAg LyogVGVzdCByZWFjaGluZyB0aGUgZ29hbCBjb2x1bW4uICBXZSBkbyB0aGlzIGFmdGVyIHNraXBw aW5nCisgICBpbnZpc2libGUgY2hhcmFjdGVycywgc28gdGhhdCB3ZSBwdXQgcG9pbnQgYmVmb3Jl IHRoZQorICAgY2hhcmFjdGVyIG9uIHdoaWNoIHRoZSBjdXJzb3Igd2lsbCBhcHBlYXIuICovCisg ICAgICBpZiAoY29sID49IGdvYWwpCisgICAgICAgIGJyZWFrOworICAgICAgcHJldl9jb2wgPSBj b2w7CisgICAgICB7IC8qIENoZWNrIGRpc3BsYXkgcHJvcGVydHkuICovCisgICAgICAgIHB0cmRp ZmZfdCBlbmRwOworICAgICAgICBpbnQgd2lkdGggPSBtY19jaGVja19kaXNwbGF5X3dpZHRoIChz Y2FuLCBjb2wsICZlbmRwKTsKKyAgICAgICAgaWYgKHdpZHRoID49IDApCisgICAgICAgICAgewor ICAgICAgICAgICAgY29sICs9IHdpZHRoOworICAgICAgICAgICAgaWYgKGVuZHAgPiBzY2FuKSAv KiBBdm9pZCBpbmZpbml0ZSBsb29wcyB3aXRoIDAtd2lkdGggb3ZlcmxheXMuICovCisgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICBzY2FuID0gZW5kcDsKKyAgICAgICAgICAgICAgICBz Y2FuX2J5dGUgPSBDSEFSX1RPX0JZVEUgKHNjYW4pOworICAgICAgICAgICAgICAgIGNvbnRpbnVl OworICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgfQorICAgICAgLyogQ2hlY2sg Y29tcG9zaXRpb24gc2VxdWVuY2UuICovCisgICAgICBpZiAoY21wX2l0LmlkID49IDAKKyAgICAg ICAgICB8fCAoc2NhbiA9PSBjbXBfaXQuc3RvcF9wb3MKKyAgICAgICAgICAgICAgJiYgbWNfY29t cG9zaXRpb25fcmVzZWF0X2l0ICgmY21wX2l0LCBzY2FuLCBzY2FuX2J5dGUsIGVuZCwgdywgTlVM TCwgUW5pbCkpKQorICAgICAgICBjb21wb3NpdGlvbl91cGRhdGVfaXQgKCZjbXBfaXQsIHNjYW4s IHNjYW5fYnl0ZSwgUW5pbCk7CisgICAgICBpZiAoY21wX2l0LmlkID49IDApCisgICAgICAgIHsK KyAgICAgICAgICBzY2FuICs9IGNtcF9pdC5uY2hhcnM7CisgICAgICAgICAgc2Nhbl9ieXRlICs9 IGNtcF9pdC5uYnl0ZXM7CisgICAgICAgICAgaWYgKHNjYW4gPD0gZW5kKQorICAgICAgICAgICAg Y29sICs9IGNtcF9pdC53aWR0aDsKKyAgICAgICAgICBpZiAoY21wX2l0LnRvID09IGNtcF9pdC5u Z2x5cGhzKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBjbXBfaXQuaWQgPSAtMTsKKyAg ICAgICAgICAgICAgY29tcG9zaXRpb25fY29tcHV0ZV9zdG9wX3BvcyAoJmNtcF9pdCwgc2Nhbiwg c2Nhbl9ieXRlLCBlbmQsIFFuaWwpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQor ICAgICAgICAgICAgICBjbXBfaXQuZnJvbSA9IGNtcF9pdC50bzsKKyAgICAgICAgICBjb250aW51 ZTsKKyAgICAgICAgfQorICAgICAgYyA9IEZFVENIX0JZVEUgKHNjYW5fYnl0ZSk7CisgICAgICAv KiBTZWUgaWYgdGhlcmUgaXMgYSBkaXNwbGF5IHRhYmxlIGFuZCBpdCByZWxhdGVzIHRvIHRoaXMg Y2hhcmFjdGVyLiAqLworICAgICAgaWYgKGRwICE9IDAKKyAgICAgICAgICAmJiAhIChtdWx0aWJ5 dGUgJiYgTEVBRElOR19DT0RFX1AgKGMpKQorICAgICAgICAgICYmIFZFQ1RPUlAgKERJU1BfQ0hB Ul9WRUNUT1IgKGRwLCBjKSkpCisgICAgICAgIHsKKyAgICAgICAgICBMaXNwX09iamVjdCBjaGFy dmVjOworICAgICAgICAgIHB0cmRpZmZfdCBpLCBuOworICAgICAgICAgIC8qIFRoaXMgY2hhcmFj dGVyIGlzIGRpc3BsYXllZCB1c2luZyBhIHZlY3RvciBvZiBnbHlwaHMuCisgICAgICAgICAgICAg VXBkYXRlIHRoZSBjb2x1bW4vcG9zaXRpb24gYmFzZWQgb24gdGhvc2UgZ2x5cGhzLiAqLworICAg ICAgICAgIGNoYXJ2ZWMgPSBESVNQX0NIQVJfVkVDVE9SIChkcCwgYyk7CisgICAgICAgICAgbiA9 IEFTSVpFIChjaGFydmVjKTsKKyAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgbjsgaSsrKQorICAg ICAgICAgICAgeworICAgICAgICAgICAgICAvKiBUaGlzIHNob3VsZCBiZSBoYW5kbGVkIHRoZSBz YW1lIGFzCisgICAgICAgICAgICAgIG5leHRfZWxlbWVudF9mcm9tX2Rpc3BsYXlfdmVjdG9yIGRv ZXMgaXQuICovCisgICAgICAgICAgICAgIExpc3BfT2JqZWN0IGVudHJ5ID0gQVJFRiAoY2hhcnZl YywgaSk7CisgICAgICAgICAgICAgIGlmIChHTFlQSF9DT0RFX1AgKGVudHJ5KSkKKyAgICAgICAg ICAgICAgICBjID0gR0xZUEhfQ09ERV9DSEFSIChlbnRyeSk7CisgICAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgICBjID0gJyAnOworICAgICAgICAgICAgICBpZiAoYyA9PSAnXG4nKQor ICAgICAgICAgICAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgICAgICAgaWYgKGMgPT0gJ1xy JyAmJiBFUSAoQlZBUiAoY3VycmVudF9idWZmZXIsIHNlbGVjdGl2ZV9kaXNwbGF5KSwgUXQpKQor ICAgICAgICAgICAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgICAgICAgaWYgKGMgPT0gJ1x0 JykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBjb2wgKz0gdGFiX3dpZHRo OworICAgICAgICAgICAgICAgICAgY29sID0gY29sIC8gdGFiX3dpZHRoICogdGFiX3dpZHRoOwor ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAg ICArK2NvbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAg ICAgeworICAgICAgICAgICAgLyogVGhlIGRpc3BsYXkgdGFibGUgZG9lc24ndCBhZmZlY3QgdGhp cyBjaGFyYWN0ZXI7CisgICAgICAgICAgICAgICBpdCBkaXNwbGF5cyBhcyBpdHNlbGYuICovCisg ICAgICAgICAgICBpZiAoYyA9PSAnXG4nKQorICAgICAgICAgICAgICBnb3RvIGVuZGxvb3A7Cisg ICAgICAgICAgICBpZiAoYyA9PSAnXHInICYmIEVRIChCVkFSIChjdXJyZW50X2J1ZmZlciwgc2Vs ZWN0aXZlX2Rpc3BsYXkpLCBRdCkpCisgICAgICAgICAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICAg ICAgICAgIGlmIChjID09ICdcdCcpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBj b2wgKz0gdGFiX3dpZHRoOworICAgICAgICAgICAgICAgIGNvbCA9IGNvbCAvIHRhYl93aWR0aCAq IHRhYl93aWR0aDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlIGlmIChtdWx0 aWJ5dGUgJiYgTEVBRElOR19DT0RFX1AgKGMpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAgIC8qIFN0YXJ0IG9mIG11bHRpLWJ5dGUgZm9ybS4gKi8KKyAgICAgICAgICAgICAg ICAgIHVuc2lnbmVkIGNoYXIgKnB0cjsKKyAgICAgICAgICAgICAgICAgIGludCBieXRlcywgd2lk dGg7CisgICAgICAgICAgICAgICAgICBwdHIgPSBCWVRFX1BPU19BRERSIChzY2FuX2J5dGUpOwor ICAgICAgICAgICAgICAgICAgTUNfTVVMVElCWVRFX0JZVEVTX1dJRFRIIChwdHIsIGRwLCBieXRl cywgd2lkdGgpOworICAgICAgICAgICAgICAgICAgLyogU3VidHJhY3Qgb25lIHRvIGNvbXBlbnNh dGUgZm9yIHRoZSBpbmNyZW1lbnQKKyAgICAgICAgICAgICAgICAgIHRoYXQgaXMgZ29pbmcgdG8g aGFwcGVuIGJlbG93LiAqLworICAgICAgICAgICAgICAgICAgc2Nhbl9ieXRlICs9IGJ5dGVzIC0g MTsKKyAgICAgICAgICAgICAgICAgIGNvbCArPSB3aWR0aDsKKyAgICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICAgICAgZWxzZSBpZiAoY3RsX2Fycm93ICYmIChjIDwgMDQwIHx8IGMgPT0gMDE3 NykpCisgICAgICAgICAgICAgICAgICBjb2wgKz0gMjsKKyAgICAgICAgICAgICAgICAgIGVsc2Ug aWYgKGMgPCAwNDAgfHwgYyA+PSAwMTc3KQorICAgICAgICAgICAgICAgICAgICBjb2wgKz0gNDsK KyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgIGNvbCsrOwor ICAgICAgICAgIH0KKyAgICAgIHNjYW4rKzsKKyAgICAgIHNjYW5fYnl0ZSsrOworICAgIH0KKyBl bmRsb29wOgorICBsYXN0X2tub3duX2NvbHVtbiA9IGNvbDsKKyAgbGFzdF9rbm93bl9jb2x1bW5f cG9pbnQgPSBwdDsKKyAgbGFzdF9rbm93bl9jb2x1bW5fbW9kaWZpZWQgPSBNT0RJRkY7CisgIGlm IChnb2FsY29sKQorICAgICpnb2FsY29sID0gY29sOworICBpZiAoZW5kcG9zKQorICAgICplbmRw b3MgPSBzY2FuOworICBpZiAocHJldmNvbCkKKyAgICAqcHJldmNvbCA9IHByZXZfY29sOworfQor CitwdHJkaWZmX3QKK21jX2N1cnJlbnRfY29sdW1uIChzdHJ1Y3Qgd2luZG93ICp3LCBwdHJkaWZm X3QgcHQpCit7CisgIC8qIGBidWZ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QT1NfQUREUiAoQ0hBUl9UT19CWVRFIChwdCkg LSAxKSArIDE7CisgIC8qIE1ha2UgYSBwb2ludGVyIHRvIHdoZXJlIGNvbnNlY3V0aXZlIGNoYXJz IGxlYXZlIG9mZiwKKyAgICAgZ29pbmcgYmFja3dhcmRzIGZyb20gcG9pbnQuICovCisgIGlmIChw dCA9PSBCRUdWKQorICAgIHN0b3AgPSBwdHI7CisgICAgZWxzZSBpZiAocHQgPD0gR1BUIHx8IEJF R1YgPiBHUFQpCisgICAgICBzdG9wID0gQkVHVl9BRERSOworICAgICAgZWxzZQorICAgICAgICBz dG9wID0gR0FQX0VORF9BRERSOworICBjb2wgPSAwLCB0YWJfc2VlbiA9IDAsIHBvc3RfdGFiID0g MDsKKyAgd2hpbGUgKDEpCisgICAgeworICAgICAgcHRyZGlmZl90IGksIG47CisgICAgICBMaXNw X09iamVjdCBjaGFydmVjOworICAgICAgaWYgKHB0ciA9PSBzdG9wKQorICAgICAgICB7CisgICAg ICAgICAgLyogV2Ugc3RvcHBlZCBlaXRoZXIgZm9yIHRoZSBiZWdpbm5pbmcgb2YgdGhlIGJ1ZmZl cgorICAgICAgICAgICAgIG9yIGZvciB0aGUgZ2FwLiAqLworICAgICAgICAgIGlmIChwdHIgPT0g QkVHVl9BRERSKQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgLyogSXQgd2FzIHRoZSBn YXAuICBKdW1wIGJhY2sgb3ZlciBpdC4gKi8KKyAgICAgICAgICBzdG9wID0gQkVHVl9BRERSOwor ICAgICAgICAgIHB0ciA9IEdQVF9BRERSOworICAgICAgICAgIC8qIENoZWNrIHdoZXRoZXIgdGhh dCBicmluZ3MgdXMgdG8gYmVnaW5uaW5nIG9mIGJ1ZmZlci4gKi8KKyAgICAgICAgICBpZiAoQkVH ViA+PSBHUFQpCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgYyA9ICotLXB0 cjsKKyAgICAgIGlmIChkcCAmJiBWRUNUT1JQIChESVNQX0NIQVJfVkVDVE9SIChkcCwgYykpKQor ICAgICAgICB7CisgICAgICAgICAgY2hhcnZlYyA9IERJU1BfQ0hBUl9WRUNUT1IgKGRwLCBjKTsK KyAgICAgICAgICBuID0gQVNJWkUgKGNoYXJ2ZWMpOworICAgICAgICB9CisgICAgICAgIGVsc2UK KyAgICAgICAgICB7CisgICAgICAgICAgICBjaGFydmVjID0gUW5pbDsKKyAgICAgICAgICAgIG4g PSAxOworICAgICAgICAgIH0KKyAgICAgIGZvciAoaSA9IG4gLSAxOyBpID49IDA7IC0taSkKKyAg ICAgICAgeworICAgICAgICAgIGlmIChWRUNUT1JQIChjaGFydmVjKSkKKyAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgLyogVGhpcyBzaG91bGQgYmUgaGFuZGxlZCB0aGUgc2FtZSBhcworICAg ICAgICAgICBuZXh0X2VsZW1lbnRfZnJvbV9kaXNwbGF5X3ZlY3RvciBkb2VzIGl0LiAqLworICAg ICAgICAgICAgICBMaXNwX09iamVjdCBlbnRyeSA9IEFSRUYgKGNoYXJ2ZWMsIGkpOworICAgICAg ICAgICAgICBpZiAoR0xZUEhfQ09ERV9QIChlbnRyeSkpCisgICAgICAgICAgICAgICAgYyA9IEdM WVBIX0NPREVfQ0hBUiAoZW50cnkpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICAgIGMgPSAnICc7CisgICAgICAgICAgICB9CisgICAgICAgICAgaWYgKGMgPj0gMDQwICYm IGMgPCAwMTc3KQorICAgICAgICAgICAgY29sKys7CisgICAgICAgICAgICBlbHNlIGlmIChjID09 ICdcbicKKyAgICAgICAgICAgICAgICAgICAgIHx8IChjID09ICdccicKKyAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBFUSAoQlZBUiAoY3VycmVudF9idWZmZXIsIHNlbGVjdGl2ZV9kaXNwbGF5 KSwgUXQpKSkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHB0cisrOworICAgICAg ICAgICAgICAgIGdvdG8gc3RhcnRfb2ZfbGluZV9mb3VuZDsKKyAgICAgICAgICAgICAgfQorICAg ICAgICAgICAgICBlbHNlIGlmIChjID09ICdcdCcpCisgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgaWYgKHRhYl9zZWVuKQorICAgICAgICAgICAgICAgICAgICBjb2wgPSAoKGNv bCArIHRhYl93aWR0aCkgLyB0YWJfd2lkdGgpICogdGFiX3dpZHRoOworICAgICAgICAgICAgICAg ICAgcG9zdF90YWIgKz0gY29sOworICAgICAgICAgICAgICAgICAgY29sID0gMDsKKyAgICAgICAg ICAgICAgICAgIHRhYl9zZWVuID0gMTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAg ICAgZWxzZSBpZiAoVkVDVE9SUCAoY2hhcnZlYykpCisgICAgICAgICAgICAgICAgICAvKiBXaXRo IGEgZGlzcGxheSB0YWJsZSBlbnRyeSwgQyBpcyBkaXNwbGF5ZWQgYXMgaXMsIGFuZAorICAgICAg ICAgICAgICAgICAgICAgbm90IGRpc3BsYXllZCBhcyBcTk5OIG9yIGFzIF5OLiAgSWYgQyBpcyBh IHNpbmdsZS1ieXRlCisgICAgICAgICAgICAgICAgICAgICBjaGFyYWN0ZXIsIGl0IHRha2VzIG9u ZSBjb2x1bW4uICBJZiBDIGlzIG11bHRpLWJ5dGUgaW4KKyAgICAgICAgICAgICAgICAgICAgIGEg dW5pYnl0ZSBidWZmZXIsIGl0J3MgdHJhbnNsYXRlZCB0byB1bmlieXRlLCBzbyBpdAorICAgICAg ICAgICAgICAgICAgICAgYWxzbyB0YWtlcyBvbmUgY29sdW1uLiAqLworICAgICAgICAgICAgICAg ICAgKytjb2w7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIGNv bCArPSAoY3RsX2Fycm93ICYmIGMgPCAwMjAwKSA/IDIgOiA0OworICAgICAgICB9CisgICAgfQor IHN0YXJ0X29mX2xpbmVfZm91bmQ6CisgIGlmIC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dzsKKyAgWFNFVFdJTkRPVyAod2luZG93LCB3KTsKKyAgcmV0dXJuIFNTREFUQSAoRnBy aW4xX3RvX3N0cmluZyAod2luZG93LCBRbmlsKSk7Cit9CisKKy8qIFVTQUdFOiAgZnByaW50ZiAo c3RkZXJyLCAiQ0hBUkFDVEVSICglcykiLCBtY19jaGFyX3RvX3N0cmluZyAoZ2x5cGgtPnUuY2gp KTsgKi8KK2NoYXIgKgorbWNfY2hhcl90b19zdHJpbmcgKGludCBhcmcpCit7CisgIExpc3BfT2Jq ZWN0IGNoYXJhY3RlciA9ICgwIDw9IGFyZyAmJiBhcmcgPD0gTUFYX0NIQVIpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IEZjaGFyX3RvX3N0cmluZyAobWFrZV9maXhudW0gKGFyZykpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IFFuaWw7CisgIGNoYXIgKiByZXN1bHQgPSAoIU5J TFAgKGNoYXJhY3RlcikKKyAgICAgICAgICAgICAgICAgICAmJiBhcmcgPT0gOSkKKyAgICAgICAg ICAgICAgICAgICAgPyAiXFx0IgorICAgICAgICAgICAgICAgICAgOiAoIU5JTFAgKGNoYXJhY3Rl cikKKyAgICAgICAgICAgICAgICAgICAgICYmIGFyZyA9PSAxMCkKKyAgICAgICAgICAgICAgICAg ICAgPyAiXFxuIgorICAgICAgICAgICAgICAgICAgOiAoIU5JTFAgKGNoYXJhY3RlcikKKyAgICAg ICAgICAgICAgICAgICAgICYmIGFyZyA9PSAzMikKKyAgICAgICAgICAgICAgICAgICAgPyAiXFxz IgorICAgICAgICAgICAgICAgICAgOiAoIU5JTFAgKGNoYXJhY3RlcikKKyAgICAgICAgICAgICAg ICAgICAgICYmIGFyZyAhPSA5CisgICAgICAgICAgICAgICAgICAgICAmJiBhcmcgIT0gMTAKKyAg ICAgICAgICAgICAgICAgICAgICYmIGFyZyAhPSAzMikKKyAgICAgICAgICAgICAgICAgICAgPyBT U0RBVEEgKGNoYXJhY3RlcikKK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UjogcmV0dXJuICJIT1JJ Wk9OVEFMX1JVTEVSIjsKKyAgICAgIGNhc2UgVkVSVElDQUxfUlVMRVI6IHJldHVybiAiVkVSVElD QUxfUlVMRVIiOworICAgICAgY2FzZSBGSUxMX0NPTFVNTjogcmV0dXJuICJGSUxMX0NPTFVNTiI7 CisgICAgICBjYXNlIENVUlNPUl9JTkRJQ0FUT1I6IHJldHVybiAiQ1VSU09SX0lORElDQVRPUiI7 CisgICAgICBkZWZhdWx0OgorICAgICAgcmV0dXJuICJVTktOT1dOIjsKKyAgICB9Cit9CisKKy8q IFVTQUdFOiAgZnByaW50ZiAoc3RkZXJyLCAiRlJPTV9XSEVSRSAoJXMpIiwgbWNfZHJhd19yb3df dHlwZV90b19zdHJpbmcgKGFyZykpOyAqLworY2hhciAqCittY19kcmF3X3Jvd190eXBlX3RvX3N0 cmluZyAoZW51bSBtY19kcmF3X3Jvd190eXBlIGZyb21fd2hlcmUpCit7CisgIHN3aXRjaCAoZnJv bV93aGVyZSkKKyAgICB7CisgICAgICBjYXNlIE5PV0hFUkU6IHJldHVybiAiTk9XSEVSRSI7Cisg ICAgICBjYXNlIFNDUklCRV9PTkU6IHJldHVybiAiU0NSSUJFX09ORSI7CisgICAgICBjYXNlIFND UklCRV9UV086IHJldHVybiAiU0NSSUJFX1RXTyI7CisgICAgICBjYXNlIFNDUklCRV9USFJFRTog cmV0dXJuICJTQ1JJQkVfVEhSRUUiOworICAgICAgY2FzZSBTS0lQUEVEOiByZXR1cm4gIlNLSVBQ RUQiOworICAgICAgY2FzZSBQT1NUX0NIQU5HRUQ6IHJldHVybiAiUE9TVF9DSEFOR0VEIjsKKyAg ICAgIGNhc2UgVU5DSEFOR0VEOiByZXR1cm4gIlVOQ0hBTkdFRCI7CisgICAgICBjYXNlIFNFVF9D VVJTT1JfT05FOiByZXR1cm4gIlNFVF9DVVJTT1JfT05FIjsKKyAgICAgIGNhc2UgU0VUX0NVUlNP Ul9UV086IHJldHVybiAiU0VUX0NVUlN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gg bWF0cml4KQoreworICBpbnQgdnBvc19hbGxvY2F0ZWQgPSB3LT5tY19tYXRyaXgudnBvc19hbGxv Y2F0ZWQ7CisgIGludCB2cG9zX3VzZWQgPSB3LT5tY19tYXRyaXgudnBvc191c2VkOworICBmcHJp bnRmIChzdGRlcnIsICIlczogIG1hdHJpeC52cG9zX2FsbG9jYXRlZCAoJWQpIHwgbWF0cml4LnZw b3NfdXNlZCAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgIG1jX3dpbmRvdyAodyksIHZwb3Nf YWxsb2NhdGVkLCB2cG9zX3VzZWQpOworICBmb3IgKGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90 eXBlID0gTUNfQ0FDSEU7CisgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICsr Y2FjaGVfdHlwZSkKKyAgICB7CisgICAgICBpbnQgY3Vyc29yc191c2VkID0gdy0+bWNfbWF0cml4 LmN1cnNvcnNfdXNlZFtjYWNoZV90eXBlXTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgbWF0 cml4LmN1cnNvcnNfdXNlZFslc10gKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgbWNf Y2FjaGVfdHlwZV90b19zdHJpbmcgKGNhY2hlX3R5cGUpLCBjdXJzb3JzX3VzZWQpOworICAgIH0K KyAgZm9yIChpbnQgdm50aCA9IDA7CisgICAgICAgdm50aCA8IHctPm1jX21hdHJpeC52cG9zX3Vz ZWQ7CisgICAgICAgKyt2bnRoKQorICAgIHsKKyAgICAgIGZvciAoZW51bSBtY19jYWNoZV90eXBl IGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hF OworICAgICAgICAgICArK2NhY2hlX3R5cGUpCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgY2Fj aGVfYWxsb2NhdGVkID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVkW2Nh Y2hlX3R5cGVdOworICAgICAgICAgIGludCBjYWNoZV91c2VkID0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXTsKKyAgICAgICAgICBmcHJpbnRmIChzdGRlcnIs ICIgICAgdm50aCAoJWQpIHwgY2FjaGVfYWxsb2NhdGVkWyVzXSAoJWQpIHwgY2FjaGVfdXNlZFsl c10gKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHZudGgsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICBtY19jYWNoZV90eXBlX3RvX3N0cmluZyAoY2FjaGVfdHlwZSksCisg ICAgICAgICAgICAgICAgICAgICAgICAgICBjYWNoZV9hbGxvY2F0ZWQsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICBtY19jYWNoZV90eXBlX3RvX3N0cmluZyAoY2FjaGVfdHlwZSksCisgICAg ICAgICAgICAgICAgICAgICAgICAgICBjYWNoZV91c2VkKTsKKyAgICAgICAgfQorICAgIH0KK30K Kwordm9pZAorbWNfc2V0X2xzbF9iZyAoc3RydWN0IHdpbmRvdyAqdywgZW51bSBmYWNlX2lkIGZh Y2VfaWQsIHN0cnVjdCBtY19SR0IgKmxzbCkKK3sKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1F ICh3LT5mcmFtZSk7CisgIHN0cnVjdCBmYWNlICpmYWNlOworICBpZiAoIU5JTFAgKFZmYWNlX3Jl bWFwcGluZ19hbGlzdCkKKyAgICAgICYmIChmYWNlX2lkID09IERFRkFVTFRfRkFDRV9JRCAvKiBR ZGVmYXVsdCAqLworICAgICAgICAgIHx8IGZhY2VfaWQgPT0gTU9ERV9MSU5FX0ZBQ0VfSUQgLyog UW1vZGVfbGluZSAqLworICAgICAgICAgIHx8IGZhY2VfaWQgPT0gTU9ERV9MSU5FX0lOQUNUSVZF X0ZBQ0VfSUQgLyogUW1vZGVfbGluZV9pbmFjdGl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kFD RV9JRCkpIC8qIFFpbnRlcm5hbF9ib3JkZXIgKi8KKyAgICBmYWNlID0gRkFDRV9GUk9NX0lEIChm LCBsb29rdXBfYmFzaWNfZmFjZSAodywgZiwgZmFjZV9pZCkpOworICAgIGVsc2UKKyAgICAgIGZh Y2UgPSBGQUNFX0ZST01fSUQgKGYsIGZhY2VfaWQpOworICBMaXNwX09iamVjdCBjb2xvciA9IChm YWNlICE9IE5VTEwpCisgICAgICAgICAgICAgICAgICAgICAgPyBmYWNlLT5sZmFjZVtMRkFDRV9C QUNLR1JPVU5EX0lOREVYXQorICAgICAgICAgICAgICAgICAgICAgIDogYnVpbGRfc3RyaW5nICgi T3JhbmdlUmVkIik7CisgIG1jX3h3X2NvbG9yX3ZhbHVlcyAodywgY29sb3IsIGxzbCk7Cit9CisK K3ZvaWQKK21jX3NldF9lc3NlbnRpYWxzIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgbWNfZXNz ZW50aWFscyAqZXNzZW50aWFscykKK3sKKyAgaWYgKCFCVUZGRVJQICh3LT5jb250ZW50cykpCisg ICAgcmV0dXJuOworICBpZiAoTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19j b25mKSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3No YWlycykpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zp c2libGUpKSkKKyAgICByZXR1cm47CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJh bWUpOworICBlc3NlbnRpYWxzLT5hY3RpdmVfcCA9ICh3ID09IFhXSU5ET1cgKGYtPnNlbGVjdGVk X3dpbmRvdykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZiA9PSBGUkFNRV9ESVNQTEFZ X0lORk8gKGYpLT5oaWdobGlnaHRfZnJhbWUpOworICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZF UiAody0+Y29udGVudHMpOworICBzdHJ1Y3QgYnVmZmVyICpvbGRfYnVmZmVyID0gTlVMTDsKKyAg cHRyZGlmZl90IG9wb2ludCA9ICh3ID09IFhXSU5ET1cgKHNlbGVjdGVkX3dpbmRvdykpCisgICAg ICAgICAgICAgICAgICAgICA/IFBUCisgICAgICAgICAgICAgICAgICAgICA6IFhGSVhOVU0gKEZt YXJrZXJfcG9zaXRpb24gKHctPnBvaW50bSkpOworICBwdHJkaWZmX3QgY3VycmVudF9jb2wgPSBt Y19jdXJyZW50X2NvbHVtbiAodywgb3BvaW50KTsKKyAgaW50IGZyYW1lX2NoYXJfd2lkdGggPSBG UkFNRV9DT0xVTU5fV0lEVEggKGYpOworICBib29sIGZpbGxfY29sdW1uX3AgPSAhTklMUCAoQlZB UiAoYiwgZmlsbF9jb2x1bW4pKTsKKyAgaW50IGZpbGxfY29sID0gWEZJWE5VTSAoQlZBUiAoYiwg ZmlsbF9jb2x1bW4pKTsKKyAgaW50IGhzY2xfeCA9IHctPmhzY3JvbGwgKiBmcmFtZV9jaGFyX3dp ZHRoOworICBpZiAoYiAhPSBjdXJyZW50X2J1ZmZlcikKKyAgICB7CisgICAgICBvbGRfYnVmZmVy ID0gY3VycmVudF9idWZmZXI7CisgICAgICBzZXRfYnVmZmVyX2ludGVybmFsIChiKTsKKyAgICB9 CisgIGVzc2VudGlhbHMtPnp2ID0gWlY7CisgIGVzc2VudGlhbHMtPnp2X2J5dGUgPSBaVl9CWVRF OworICBlc3NlbnRpYWxzLT5mY194ID0gKGZpbGxfY29sdW1uX3AKKyAgICAgICAgICAgICAgICAg ICAgICAmJiAhTklMUCAoVmRpc3BsYXlfbGluZV9udW1iZXJzKSkKKyAgICAgICAgICAgICAgICAg ICAgICAgPyAoZmlsbF9jb2wgKiBmcmFtZV9jaGFyX3dpZHRoKSArIHctPm1jLmxudW1fcGl4ZWxf d2lkdGggLSBoc2NsX3gKKyAgICAgICAgICAgICAgICAgICAgIDogKGZpbGxfY29sdW1uX3AKKyAg ICAgICAgICAgICAgICAgICAgICAgICYmIE5JTFAgKFZkaXNwbGF5X2xpbmVfbnVtYmVycykpCisg ICAgICAgICAgICAgICAgICAgICAgID8gKGZpbGxfY29sICogZnJhbWVfY2hhcl93aWR0aCkgLSBo c2NsX3gKKyAgICAgICAgICAgICAgICAgICAgIDogMDsKKyAgaWYgKG9sZF9idWZmZXIpCisgICAg c2V0X2J1ZmZlcl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7CisgIGVudW0gZmFjZV9pZCBmaWxsX2Nv bHVtbl9wcmVfenZfZmFjZV9pZCA9CisgICAgKCFlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAgICAm JiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY19pbmFjdGl2ZV93aW5kb3dz KSkKKyAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJz KSkpCisgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCJmYy1pbmFjdGl2 ZS1wcmUtenYtZmFjZSIpLCB0cnVlKQorICAgIDogKCFlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAg ICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX2luYWN0aXZlX3dp bmRvd3MpKQorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNy b3NzaGFpcnMpKQorICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikp CisgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gZXNzZW50aWFscy0+ZmNfeCkKKyAgICAgID8gbG9v a3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoImZjLW9wb2ludC1pbmFjdGl2ZS1wcmUtenYt ZmFjZSIpLCB0cnVlKQorICA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gZmls bF9jb2x1bW5fcG9zdF96dl9mYWNlX2lkID0KKyAgICAoIWVzc2VudGlhbHMtPmFjdGl2ZV9wCisg ICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX2luYWN0aXZlX3dp bmRvd3MpKQorICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3Nz aGFpcnMpKSkKKyAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoImZjLWlu YWN0aXZlLXBvc3QtenYtZmFjZSIpLCB0cnVlKQorICAgIDogKCFlc3NlbnRpYWxzLT5hY3RpdmVf cAorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX2luYWN0 aXZlX3dpbmRvd3MpKQorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIGNyb3NzaGFpcnMpKQorICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9y dWxlcikpCisgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gZXNzZW50aWFscy0+ZmNfeCkKKyAgICAg ID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoImZjLW9wb2ludC1pbmFjdGl2ZS1w b3N0LXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICA6IChlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAgICAg ICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAg ICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgJiYgdy0+ Y3Vyc29yLnggPT0gZXNzZW50aWFscy0+ZmNfeCkKKyAgICAgID8gbG9va3VwX25hbWVkX2ZhY2Ug KHcsIGYsIGludGVybiAoImZjLW9wb2ludC1wb3N0LXp2LWZhY2Ui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Cwgc3Ry dWN0IG1jX2Vzc2VudGlhbHMgZXNzZW50aWFscywKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0 IG1jX1JHQiAqbHNsX2ZnLCBpbnQgcG9zaW50LCBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90 eXBlLAorICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX3Jvd19wb3NpdGlvbiByb3dfcG9zaXRp b24sIGVudW0gbWNfZW5naW5lX3R5cGUgYWN0aW9uX3R5cGUpCit7CisgIHN3aXRjaCAoYWN0aW9u X3R5cGUpCisgIHsKKyAgICBjYXNlIE1VTFRJUExFX0NVUlNPUlM6CisgICAgeworICAgICAgc3Ry dWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgICAgICBwdHJkaWZmX3QgY3VycmVu dF9jb2wgPSBtY19jdXJyZW50X2NvbHVtbiAodywgcG9zaW50KTsKKyAgICAgIHN0cnVjdCBidWZm ZXIgKmIgPSBYQlVGRkVSICh3LT5jb250ZW50cyk7CisgICAgICBib29sIGZpbGxfY29sdW1uX3Ag PSAhTklMUCAoQlZBUiAoYiwgZmlsbF9jb2x1bW4pKTsKKyAgICAgIGludCBmaWxsX2NvbCA9IChm aWxsX2NvbHVtbl9wKQorICAgICAgICAgICAgICAgICAgICAgPyBYRklYTlVNIChCVkFSIChiLCBm aWxsX2NvbHVtbikpCisgICAgICAgICAgICAgICAgICAgICA6IDA7CisgICAgICBlbnVtIGZhY2Vf aWQgZXZlbl9mYWNlX2lkID0KKyAgICAgICAgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAg ICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF9pbmFjdGl2ZV93aW5k b3dzKSkpCisgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistZXZl bi1pbmFjdGl2ZS1wcmUtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICA6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2xvciwgJm9kZF9mb3Jl Z3JvdW5kKTsKKyAgICAgIGVudW0gZmFjZV9pZCBiZXlvbmRfZmlsbF9mYWNlX2lkID0KKyAgICAg ICAgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkpCisgICAgICAgID8gbG9va3Vw X25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcG9zdC1maWxsLWluYWN0aXZlLXByZS16di1m YWNlIiksIHRydWUpCisgICAgICAgIDogbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAo IistcG9zdC1maWxsLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgc3RydWN0IGZhY2UgKmJl eW9uZF9maWxsX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGJleW9uZF9maWxsX2ZhY2VfaWQpOwor ICAgICAgTGlzcF9PYmplY3QgYmV5b25kX2ZpbGxfY29sb3IgPSBiZXlvbmRfZmlsbF9mYWNlLT5s ZmFjZVtMRkFDRV9GT1JFR1JPVU5EX0lOREVYXTsKKyAgICAgIHN0cnVjdCBtY19SR0IgYmV5b25k X2ZpbGxfZm9yZWdyb3VuZDsKKyAgICAgIG1jX3h3X2NvbG9yX3ZhbHVlcyAodywgYmV5b25kX2Zp bGxfY29sb3IsICZiZXlvbmRfZmlsbF9mb3JlZ3JvdW5kKTsKKyAgICAgIC8qIHJlZCAqLworICAg ICAgaWYgKCghZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAmJiBjdXJyZW50X2NvbCAlIDIgIT0g MAorICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gPT0gUFJFX1pWKQorICAgICAgICAgIHx8IChm aWxsX2NvbHVtbl9wCisgICAgICAgICAgICAgICYmIGN1cnJlbnRfY29sICUgMiAhPSAwCisgICAg ICAgICAgICAgICYmIGN1cnJlbnRfY29sIDw9IGZpbGxfY29sCisgICAgICAgICAgICAgICYmIHJv d19wb3NpdGlvbiA9PSBQUkVfWlYpKQorICAgICAgICB7CisgICAgICAgICAgbHNsX2ZnLT5yZWQg PSBvZGRfZm9yZWdyb3VuZC5yZWQ7CisgICAgICAgICAgbHNsX2ZnLT5ncmVlbiA9IG9kZF9mb3Jl Z3JvdW5kLmdyZWVuOworICAgICAgICAgIGxzbF9mZy0+Ymx1ZSA9IG9kZF9mb3JlZ3JvdW5kLmJs dWU7CisgICAgICAgIH0KKyAgICAgICAgLyogeWVsbG93ICovCisgICAgICAgIGVsc2UgaWYgKCgh ZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAgICAgICAgJiYgY3VycmVudF9jb2wgJSAyID09IDAK KyAgICAgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYpCisgICAgICAgICAg ICAgICAgIHx8IChmaWxsX2NvbHVtbl9wCisgICAgICAgICAgICAgICAgICAgICAmJiBjdXJyZW50 X2NvbCAlIDIgPT0gMAorICAgICAgICAgICAgICAgICAgICAgJiYgY3VycmVudF9jb2wgPD0gZmls bF9jb2wKKyAgICAgICAgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYpKQor ICAgICAgICAgIHsKKyAgICAgICAgICAgIGxzbF9mZy0+cmVkID0gZXZlbl9mb3JlZ3JvdW5kLnJl ZDsKKyAgICAgICAgICAgIGxzbF9mZy0+Z3JlZW4gPSBldmVuX2ZvcmVncm91bmQuZ3JlZW47Cisg ICAgICAgICAgICBsc2xfZmctPmJsdWUgPSBldmVuX2ZvcmVncm91bmQuYmx1ZTsKKyAgICAgICAg ICB9CisgICAgICAgICAgLyogZ3JlZW4gKi8KKyAgICAgICAgICBlbHNlIGlmIChmaWxsX2NvbHVt bl9wCisgICAgICAgICAgICAgICAgICAgJiYgY3VycmVudF9jb2wgPiBmaWxsX2NvbAorICAgICAg ICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYpCisgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgIGxzbF9mZy0+cmVkID0gYmV5b25kX2ZpbGxfZm9yZWdyb3VuZC5yZWQ7Cisg ICAgICAgICAgICAgIGxzbF9mZy0+Z3JlZW4gPSBiZXlvbmRfZmlsbF9mb3JlZ3JvdW5kLmdyZWVu OworICAgICAgICAgICAgICBsc2xfZmctPmJsdWUgPSBiZXlvbmRfZmlsbF9mb3JlZ3JvdW5kLmJs dWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmIChyb3dfcG9zaXRpb24gPT0g QVRfWlYpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsc2xfZmctPnJlZCA9IGVz c2VudGlhbHMuc3BfZmcucmVkOworICAgICAgICAgICAgICAgIGxzbF9mZy0+Z3JlZW4gPSBlc3Nl bnRpYWxzLnNwX2ZnLmdyZWVuOworICAgICAgICAgICAgICAgIGxzbF9mZy0+Ymx1ZSA9IGVzc2Vu dGlhbHMuc3BfZmcuYmx1ZTsKKyAgICAgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQor ICAgIGNhc2UgSE9SSVpPTlRBTF9SVUxFUjoKKyAgICB7CisgICAgICBpZiAoZ2x5cGggIT0gTlVM TAorICAgICAgICAgICYmIGdseXBoLT51LmNoID09IDk1CisgICAgICAgICAgJiYgY3Vyc29yX3R5 cGUgPT0gTUNfSEJBUikKKyAgICAgICAgeworICAgICAgICAgIGxzbF9mZy0+cmVkID0gZXNzZW50 aWFscy5zcF9mZy5yZWQ7CisgICAgICAgICAgbHNsX2ZnLT5ncmVlbiA9IGVzc2VudGlhbHMuc3Bf ZmcuZ3JlZW47CisgICAgICAgICAgbHNsX2ZnLT5ibHVlID0gZXNzZW50aWFscy5zcF9mZy5ibHVl OworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBsc2xf ZmctPnJlZCA9IGVzc2VudGlhbHMuY2hf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UZGRVIgKHct PmNvbnRlbnRzKSwgY2hfaW5hY3RpdmVfd2luZG93cykpCisgICAgICAgICAmJiByb3dfcG9zaXRp b24gPT0gUFJFX1pWKQorICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVy biAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1wcmUtenYtZmFjZSIpLCB0cnVlKQorICAg ICAgICA6IChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9 PSBQUkVfWlYpCisgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgi Ky1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpCisgICAgICAgIDogKCFlc3Nl bnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKQorICAgICAgICAgICAmJiByb3dfcG9zaXRp b24gPT0gQVRfWlYpCisgICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRl cm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItaW5hY3RpdmUtYXQtenYtZmFjZSIpLCB0cnVlKQorICAg ICAgICA6IChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9 PSBBVF9aVikKKyAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIr LXJlYWwtZmFrZS1jdXJzb3ItYXQtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICA6IGxvb2t1cF9u YW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItYXQtenYtZmFjZSIp LCB0cnVlKTsKKyAgICAgIHN0cnVjdCBmYWNlICpjdXJ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YgaGxpbmZvLT5tb3VzZV9mYWNlX2JlZ19y b3cgPj0gMAorICAgICAgICAgICYmIGhsaW5mby0+bW91c2VfZmFjZV9lbmRfcm93ID49IDApCisg ICAgICAgIHsKKyAgICAgICAgICBwdHJkaWZmX3Qgcm93X3Zwb3MgPSBNQVRSSVhfUk9XX1ZQT1Mg KHJvdywgdy0+Y3VycmVudF9tYXRyaXgpOworICAgICAgICAgIGlmIChyb3dfdnBvcyA+PSBobGlu Zm8tPm1vdXNlX2ZhY2VfYmVnX3JvdworICAgICAgICAgICAgICAmJiByb3dfdnBvcyA8PSBobGlu Zm8tPm1vdXNlX2ZhY2VfZW5kX3JvdykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY2hl Y2tfbW91c2VfZmFjZSA9IHRydWU7CisgICAgICAgICAgICAgIG1vdXNlX2JlZ19jb2wgPSAocm93 X3Zwb3MgPT0gaGxpbmZvLT5tb3VzZV9mYWNlX2JlZ19yb3cpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IGhsaW5mby0+bW91c2VfZmFjZV9iZWdfY29sCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IDA7CisgICAgICAgICAgICAgIG1vdXNlX2VuZF9jb2wgPSAocm93X3Zw b3MgPT0gaGxpbmZvLT5tb3VzZV9mYWNlX2VuZF9yb3cpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IGhsaW5mby0+bW91c2VfZmFjZV9lbmRfY29sCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IHJvdy0+dXNlZFtURVhUX0FSRUFdOworICAgICAgICAgICAgfQorICAgICAg ICB9CisgICAgICAvKiBDb21wdXRlIG92ZXJoYW5ncyBmb3IgYWxsIGdseXBoIHN0cmluZ3MuICov CisgICAgICBpZiAoRlJBTUVfUklGIChmKS0+Y29tcHV0ZV9nbHlwaF9zdHJpbmdfb3Zlcmhhbmdz KQorICAgICAgICBmb3IgKHMgPSBoZWFkOyBzOyBzID0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ZGUsIGFuZCBJIGRvbid0IGtub3cgaWYgdGhlIHBhdGhvbG9naWNhbCBjYXNlIG9jY3Vy cyBpbgorICAgICAgICAgICAgIHByYWN0aWNlLCBzbyB3ZSdsbCBzdGljayB0byB0aGlzIGZvciBu b3cuICAtLS0gY3lkICAqLworICAgICAgICAgIGlmIChjaGVja19tb3VzZV9mYWNlCisgICAgICAg ICAgICAgICYmIG1vdXNlX2JlZ19jb2wgPCBzdGFydCAmJiBtb3VzZV9lbmRfY29sID4gaSkKKyAg ICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX01PVVNFX0ZBQ0U7CisgICAgICAgICAgICBlbHNl CisgICAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX05PUk1BTF9URVhUOworICAgICAgICAg IGlmIChobCAhPSBvdmVybGFwX2hsKQorICAgICAgICAgICAgY2xpcF9oZWFkID0gaGVhZDsKKyAg ICAgICAgICBqID0gaTsKKyAgICAgICAgICBNQ19CVUlMRF9HTFlQSF9TVFJJTkdTIChqLCBzdGFy dCwgaCwgdCwgb3ZlcmxhcF9obCwgZHVtbXlfeCwgbGFzdF94KTsKKyAgICAgICAgICAvKiBUaGUg YGxlZnRfb3ZlcndyaXR0ZW5gIGJlaGF2aW9yIHRoYXQgZXJhc2VzIHRoZSBmYWtlIGN1cnNvcnMg dHJhY2VzIHRvCisgICAgICAgICAgYGZvbnQtPmRyaXZlci0+ZHJhd2AgaW4gYG5zX2RyYXdfZ2x5 cGhfc3RyaW5nJzsgYW5kLCB0aGUgaGVpZ2h0IG9mIHRoZSByZWN0YW5nbGUKKyAgICAgICAgICBk cmF3biBieSBgbnNfZHVtcGdseXBoc19zdHJldGNoJzsgYW5kLCBgbnNfbWF5YmVfZHVtcGdseXBo c19iYWNrZ3JvdW5kJyB3aGljaAorICAgICAgICAgIGVyYXNlcyB0aGUgYXBwbGljYWJsZSByZWN0 YW5nbGUuICovCisgICAgICAgICAgLyogRVhBTVBMRTogIAlNCisgICAgICAgICA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A9IGxlZnRfb3Zl cndyaXRpbmcgKGhlYWQpOworICAgICAgaWYgKGkgPj0gMCkKKyAgICAgICAgeworICAgICAgICAg IGVudW0gZHJhd19nbHlwaHNfZmFjZSBvdmVybGFwX2hsOworICAgICAgICAgIGlmIChjaGVja19t b3VzZV9mYWNlCisgICAgICAgICAgICAgICYmIG1vdXNlX2JlZ19jb2wgPCBzdGFydCAmJiBtb3Vz ZV9lbmRfY29sID4gaSkKKyAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX01PVVNFX0ZBQ0U7 CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX05PUk1B TF9URVhUOworICAgICAgICAgIGlmIChobCA9PSBvdmVybGFwX2hsIHx8IGNsaXBfaGVhZCA9PSBO VUxMKQorICAgICAgICAgICAgY2xpcF9oZWFkID0gaGVhZDsKKyAgICAgICAgICBNQ19CVUlMRF9H TFlQSF9TVFJJTkdTIChpLCBzdGFydCwgaCwgdCwgb3ZlcmxhcF9obCwgZHVtbXlfeCwgbGFzdF94 KTsKKyAgICAgICAgICBmb3IgKHMgPSBoOyBzOyBzID0gcy0+bmV4dCkKKyAgICAgICAgICAgIHMt PmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVlOworICAgICAgICAgIGNvbXB1dGVfb3Zlcmhhbmdz X2FuZF94ICh0LCBoZWFkLT54LCB0cnVlKTsKKyAgICAgICAgICBwcmVwZW5kX2dseXBoX3N0cmlu Z19saXN0cyAoJmhlYWQsICZ0YWlsLCBoLCB0KTsKKyAgICAgICAgfQorICAgICAgLyogQXBwZW5k IGdseXBocyBzdHJpbmdzIGZvciBnbHlwaHMgZm9sbG93aW5nIHRoZSBsYXN0IGdseXBoCisgICAg ICBzdHJpbmcgdGFpbCB0aGF0IGFyZSBvdmVyd3JpdHRlbiBieSB0YWlsLiAgVGhlIGJhY2tncm91 bmQgb2YKKyAgICAgIHRoZXNlIHN0cmluZ3MgaGFzIHRvIGJlIGRyYXduIGJlY2F1c2UgdGFpbCdz IGZvcmVncm91bmQgZHJhd3MKKyAgICAgIG92ZXIgaXQuICovCisgICAgICBpID0gcmlnaHRfb3Zl cndyaXR0ZW4gKHRhaWwpOworICAgICAgaWYgKGkgPj0gMCkKKyAgICAgICAgeworICAgICAgICAg IGVudW0gZHJhd19nbHlwaHNfZmFjZSBvdmVybGFwX2hsOworICAgICAgICAgIGlmIChjaGVja19t b3VzZV9mYWNlCisgICAgICAgICAgICAgICYmIG1vdXNlX2JlZ19jb2wgPCBpICYmIG1vdXNlX2Vu ZF9jb2wgPiBlbmQpCisgICAgICAgICAgICBvdmVybGFwX2hsID0gRFJBV19NT1VTRV9GQUNFOwor ICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBvdmVybGFwX2hsID0gRFJBV19OT1JNQUxf VEVYVDsKKyAgICAgICAgICBpZiAoaGwgIT0gb3ZlcmxhcF9obCkKKyAgICAgICAgICAgIGNsaXBf dGFpbCA9IHRhaWw7CisgICAgICAgICAgTUNfQlVJTERfR0xZUEhfU1RSSU5HUyAoZW5kLCBpLCBo LCB0LCBvdmVybGFwX2hsLCB4LCBsYXN0X3gpOworICAgICAgICAvKiBUaGUgYHJpZ2h0X292ZXJ3 cml0dGVuYCBiZWhhdmlvciB0aGF0IGVyYXNlcyB0aGUgZmFrZSBjdXJzb3JzIHRyYWNlcyB0bwor ICAgICAgICBgZm9udC0+ZHJpdmVyLT5kcmF3YCBpbiBgbnNfZHJhd19nbHlwaF9zdHJpbmcnOyBh bmQsIHRoZSBoZWlnaHQgb2YgdGhlIHJlY3RhbmdsZQorICAgICAgICBkcmF3biBieSBgbnNfZHVt cGdseXBoc19zdHJldGNoJzsgYW5kLCBgbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kJyB3 aGljaAorICAgICAgICBlcmFzZXMgdGhlIGFwcGxpY2FibGUgcmVjdGFuZ2xlLiAqLworICAgICAg ICAvKiBFWEFNUExFOiAgIkVt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XBwZW5kIGdseXBoIHN0cmlu Z3MgZm9yIGdseXBocyBmb2xsb3dpbmcgdGhlIGxhc3QgZ2x5cGgKKyAgICAgIHN0cmluZyB0YWls IHRoYXQgb3ZlcndyaXRlIHRhaWwuICBUaGUgZm9yZWdyb3VuZCBvZiBzdWNoCisgICAgICBnbHlw aHMgaGFzIHRvIGJlIGRyYXduIGJlY2F1c2UgaXQgd3JpdGVzIGludG8gdGhlIGJhY2tncm91bmQK KyAgICAgIG9mIHRhaWwuICBUaGUgYmFja2dyb3VuZCBtdXN0IG5vdCBiZSBkcmF3biBiZWNhdXNl IGl0IGNvdWxkCisgICAgICBwYWludCBvdmVyIHRoZSBmb3JlZ3JvdW5kIG9mIGZvbGxvd2luZyBn bHlwaHMuICovCisgICAgICBpID0gcmlnaHRfb3ZlcndyaXRpbmcgKHRhaWwpOworICAgICAgaWYg KGkgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBvdmVy bGFwX2hsOworICAgICAgICAgIGlmIChjaGVja19tb3VzZV9mYWNlCisgICAgICAgICAgICAgICYm IG1vdXNlX2JlZ19jb2wgPCBpICYmIG1vdXNlX2VuZF9jb2wgPiBlbmQpCisgICAgICAgICAgICBv dmVybGFwX2hsID0gRFJBV19NT1VTRV9GQUNFOworICAgICAgICAgICAgZWxzZQorICAgICAgICAg ICAgICBvdmVybGFwX2hsID0gRFJBV19OT1JNQUxfVEVYVDsKKyAgICAgICAgICBpZiAoaGwgPT0g b3ZlcmxhcF9obCB8fCBjbGlwX3RhaWwgPT0gTlVMTCkKKyAgICAgICAgICAgIGNsaXBfdGFpbCA9 IHRhaWw7CisgICAgICAgICAgaSsrOyAgICAgIC8qIFdlIG11c3QgaW5jbHVkZSB0aGUgSXRoIGds eXBoLiAqLworICAgICAgICAgIE1DX0JVSUxEX0dMWVBIX1NUUklOR1MgKGVuZCwgaSwgaCwgdCwg b3ZlcmxhcF9obCwgeCwgbGFzdF94KTsKKyAgICAgICAgICBmb3IgKHMgPSBoOyBzOyBzID0gcy0+ bmV4dCkKKyAgICAgICAgICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVlOworICAgICAg ICAgIGNvbXB1dGVfb3ZlcmhhbmdzX2FuZF94IChoLCB0YWlsLT54ICsgdGFpbC0+d2lkdGgsIGZh bHNlKTsKKyAgICAgICAgICBhcHBlbmRfZ2x5cGhfc3RyaW5nX2xpc3RzICgmaGVhZCwgJnRhaWws IGgsIHQpOworICAgICAgICB9CisgICAgICB0YWlsID0gZ2x5cGhfc3RyaW5nX2NvbnRhaW5pbmdf YmFja2dyb3VuZF93aWR0aCAodGFpbCk7CisgICAgICBpZiAoY2xpcF90YWlsKQorICAgICAgICBj bGlwX3RhaWwgPSBnbHlwaF9zdHJpbmdfY29udGFpbmluZ19iYWNrZ3JvdW5kX3dpZHRoIChjbGlw X3RhaWwpOworICAgICAgaWYgKGNsaXBfaGVhZCB8fCBjbGlwX3RhaWwpCisgICAgICAgIGZvciAo cyA9IGhlYWQ7IHM7IHMgPSBzLT5uZXh0KQorICAgICAgICAgIHsKKyAgICAgICAgICAgIHMtPmNs aXBfaGVhZCA9IGNsaXBfaGVhZDsKKyAgICAgICAgICAgIHMtPmNsaXBfdGFpbCA9IGNsaXBfdGFp bDsKKyAgICAgICAgICB9CisgICAgfQorICAvKiBEcmF3IGFsbCBzdHJpbmdzLiAqLworICBmb3Ig KHMgPSBoZWFkOyBzICYmIGRyYXdfcDsgcyA9IHMtPm5leHQpCisgICAgRlJBTUVfUklGIChmKS0+ bWNfc2NyaWJlX3N0cmluZyAocywgbWF0cml4LCByb3csIGxzbCwgZ2x5cGhfZmxhdm9yLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZl X3AsIGN1cnNvcl9nY19wKTsKKyNpZm5kZWYgSEFWRV9OUworICAvKiBXaGVuIGZvY3VzIGEgc29s ZSBmcmFtZS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ds eXBoc19mYWNlIGhsOworICAvKiBObyBjdXJzb3IgZGlzcGxheWVkIG9yIHJvdyBpbnZhbGlkYXRl ZCA9PiBub3RoaW5nIHRvIGRvIG9uIHRoZSBzY3JlZW4uICovCisgIGlmIChjdXJzb3JfdHlwZSA9 PSBNQ19OT19DVVJTT1IpCisgICAgeworICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgIGZwcmlu dGYgKHN0ZGVyciwgIm1jX2VyYXNlX2N1cnNvcjogIHJldHVybiAoJWQpXG4iLCAxKTsKKyAgICAg IHJldHVybjsKKyAgICB9CisgIC8qIFZQT1MgPj0gbWF0cml4LT5ucm93cyBtZWFucyB0aGF0IHdp bmRvdyBoYXMgYmVlbiByZXNpemVkLgorICAgICBEb24ndCBib3RoZXIgdG8gZXJhc2UgdGhlIGN1 cnNvci4gKi8KKyAgaWYgKHZwb3MgPj0gbWF0cml4LT5ucm93cykKKyAgICB7CisgICAgICBpZiAo ZGVidWdfcCkKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZXJhc2VfY3Vyc29yOiAgcmV0 dXJuICglZClcbiIsIDIpOworICAgICAgcmV0dXJuOworICAgIH0KKyAgLyogSWYgcm93IGNvbnRh aW5pbmcgY3Vyc29yIGlzIG1hcmtlZCBpbnZhbGlkLCB0aGVyZSBpcyBub3RoaW5nIHdlCisgICAg IGNhbiBkby4gKi8KKyAgaWYgKCFyb3ctPmVuYWJsZWRfcCkKKyAgICB7CisgICAgICBpZiAoZGVi dWdfcCkKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZXJhc2VfY3Vyc29yOiAgcmV0dXJu ICglZClcbiIsIDMpOworICAgICAgcmV0dXJuOworICAgIH0KKyAgLyogSWYgbGluZSBzcGFjaW5n IGlzID4gMCwgb2xkIGN1cnNvciBtYXkgb25seSBiZSBwYXJ0aWFsbHkgdmlzaWJsZSBpbgorICAg ICB3aW5kb3cgYWZ0ZXIgc3BsaXQtd2luZG93LiAgU28gYW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wCisgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IDApOworICAvKiBFWEFNUExFOiAgQy11IEMt eCA8IGFuZCBkbyBub3RoaW5nLiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMF9wID0gKHctPnN1 c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19o c2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwg PiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gdy0+aHNjcm9s bCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIHNvbWV0aGluZyBlbHNlIGJlc2lk ZXMgaG9yaXpvbnRhbGx5IHNjcm9sbGluZyB0aGUKKyAgICAgICAgICAgICAgIGN1cnJlbnQgbGlu ZSBkaWZmZXJlbnRseS4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jp em9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8x X3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hz Y3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwg PT0gdy0+aHNjcm9sbCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIC4uLgorICAgICAg ICAgICAgICAgQ3VycmVudCBsaW5lIGlzIF9ub3RfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZm ZXJlbnRseS4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzJfcCA9ICghdy0+c3VzcGVuZF9hdXRv X2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9k ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA9PSAwCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgIT0gdy0+aHNjcm9sbCk7CisgIC8q IEVYQU1QTEU6ICAoc2Nyb2xsLWxlZnQgNSk7IGFuZCwgdGhlbiBwcmVzcyB0aGUgbGVmdCBhcnJv dyBrZXkgb25lIHRpbWUuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9u dGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuKi8KKyAgYm9vbCBoc2NsX3RlbXBfcCA9ICghdy0+ c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3Jv bGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTog IEMtdSBDLXggPCBhbmQgZG8gc29tZXRoaW5nIHRoYXQgY2F1c2VzIHRoZSBjdXJyZW50IGxpbmUg dG8gYmUKKyAgICAgICAgICAgICAgIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4K KyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBfaXNfIGhvcml6b250YWxseSBzY3JvbGxlZCBk aWZmZXJlbnRseS4gKi8KKyAgYm9vbCBoc2NsX3Blcm1fcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hz Y3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAg ICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAg ICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5f aHNjcm9sbCAhPSB3LT5oc2Nyb2xsKTsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5m cmFtZSk7CisgIGludCBmcmluZ2VfYml0bWFwID0gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgaW50 IGZhY2VfaWQgPSBERUZBVUxUX0ZBQ0VfSUQ7CisgIGlmICghcmVtb3ZlX3AKKyAgICAgICYmIGds eXBoX2ZsYXZvciA9PSBNQ19PVkVSTEFZX0FSUk9XX0JJVE1BUAorICAgICAgJiYgIWhzY2xfYWxs X3RlbXBfcAorICAgICAgJiYgIWhzY2xfdGVtcF9wCisgICAgICAmJiAhaHNjbF9wZXJtX3AKKyAg ICAgICYmICFoc2NsX2FsbF9wZXJtXzBfcAorICAgICAgJiYgIWhzY2xfYWxsX3Blcm1fMV9wCisg ICAgICAmJiAhaHNjbF9hbGxfcGVybV8yX3ApCisgICAgeworICAgICAgZW51bSBmYWNlX2lkIG92 ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICghYWN0aXZlX3AKKyAgICAgICAgICYmICFO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkK KyAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFy cm93LWluYWN0aXZlLXByZS16di1mYWNl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PmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcCA9IGZhbHNlOworICAgICAgbWNfZHJhd19mcmlu Z2VfYml0bWFwICh3LCByb3csIHRydWUsIGN1cnNvcl90eXBlKTsKKyAgICB9CisgICAgZWxzZSBp ZiAoIXJlbW92ZV9wCisgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yID09IE1DX09WRVJMQVlf QVJST1dfQklUTUFQCisgICAgICAgICAgICAgJiYgKGhzY2xfYWxsX3RlbXBfcAorICAgICAgICAg ICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzBfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX2Fs bF9wZXJtXzFfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzJfcAorICAgICAg ICAgICAgICAgICB8fCBoc2NsX3RlbXBfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX3Blcm1f cCkpCisgICAgICB7CisgICAgICAgIGVudW0gZmFjZV9pZCBvdmVybGF5X2Fycm93X2ZhY2VfaWQg PQorICAgICAgICAgICghYWN0aXZlX3AKKyAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZG RVIgKHctPmNvbnRlbnRzKSwgY2hfaW5hY3RpdmVfd2luZG93cykpKQorICAgICAgICAgID8gbG9v a3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1oc2NsLWluYWN0 aXZlLXByZS16di1mYWNlIiksIHRydWUpCisgICAgICAgICAgOiAoYWN0aXZlX3ApCisgICAgICAg ICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ct aHNjbC1wcmUtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOwor ICAgICAgICBmYWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkK KyAgICAgICAgICAgICAgICAgID8gb3ZlcmxheV9hcnJvd19mYWNlX2lkCisgICAgICAgICAgICAg ICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgaWYgKGhzY2xfYWxsX3Blcm1fMF9wKQor ICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJu ICgiKy1oc2NsLXBlcm0iKSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAgICBlbHNlIGlmIChoc2Ns X2FsbF9wZXJtXzFfcCkKKyAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdl X2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgdHJ1ZSwgZmFsc2UpOworICAgICAg ICAgICAgZWxzZSBpZiAoaHNjbF9hbGxfcGVybV8yX3ApCisgICAgICAgICAgICAgIGZyaW5nZV9i aXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwg ZmFsc2UsIHRydWUpOworICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX3Blcm1fcCkKKyAgICAg ICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVy biAoIistaHNjbC1wZXJtIiksIHRydWUsIHRydWUpOworICAgICAgICAgICAgICAgIGVsc2UgaWYg KGhzY2xfYWxsX3RlbXBfcCkKKyAgICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19n ZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXRlbXAiKSwgZmFsc2UsIGZhbHNl KTsKKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xfdGVtcF9wKQorICAgICAgICAgICAg ICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYX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LWZyaW5nZS1iaXRtYXAtZmFjZScuICovCisgICAgICAgIHJvdy0+bGVmdF9mcmluZ2VfYml0 bWFwID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19OT19GUklOR0VfQklUTUFQOwor ICAgICAgICByb3ctPmxlZnRfZnJpbmdlX2ZhY2VfaWQgPSBmYWNlX2lkOworICAgICAgICByb3ct PmxlZnRfZnJpbmdlX29mZnNldCA9IDA7CisgICAgICAgIHJvdy0+ZnJpbmdlX2JpdG1hcF9wZXJp b2RpY19wID0gZmFsc2U7CisgICAgICAgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcCAodywgcm93LCB0 cnVlLCBjdXJzb3JfdHlwZSk7CisgICAgICB9CisgICAgICBlbHNlIGlmICghcmVtb3ZlX3AKKyAg ICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdI VF9BUlJPVworICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNF RF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgfHwgZ2x5 cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEUKKyAgICAgICAgICAgICAgICAgICB8fCBn bHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAg ICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9B UlJPVworICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9C QVIKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVS VElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJ Q0FMX0JBUl9CQUNLU0xBU0gpKQorICAgICAgICB7CisgICAgICAgICAgTGlzcF9PYmplY3QgYml0 bWFwX2ZsYXZvciA9IChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9B UlJPVykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfaG9sbG93 X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdI VF9BUlJPVykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19y ZXZlcnNlZF9ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xF KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hvbGxvd19y ZWN0YW5nbGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhf Zmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVykKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3cKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1D X1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVykKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IFFtY19yZXZlcnNlZF92ZXJ0aWNhbF9iYXJfcmlnaHRfYXJy b3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9y ID09IE1DX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IFFtY192ZXJ0aWNhbF9iYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19yZXZlcnNlZF92ZXJ0aWNh bF9iYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxh dm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyX2JhY2tzbGFzaAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFFuaWw7CisgICAgICAgICAgZnJpbmdlX2Jp dG1hcCA9IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQKQorICAgICAgICAg ICAgICAgICAgICAgICAgICA/IGxvb2t1cF9mcmluZ2VfYml0bWFwIChiaXRtYXBfZmxhdm9yKQor ICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAg ICAgZmFjZV9pZCA9IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisgICAg ICAgICAgICAgICAgICAgICAmJiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX0hPTExPV19S RUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9m bGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAg ICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JB UikpCisgICAgICAgICAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50 ZXJuICgiKy1yZXZlcnNlZC1iYXItcHJlLXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAg ICAgICAgOiAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAorICAgICAgICAg ICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RB TkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3Ig IT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAg ICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAg ICAgICAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1i YXItcHJlLXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICAgICAgOiBERUZBVUxUX0ZB Q0VfSUQ7CisgICAgICAgICAgcm93LT5jdXJzb3JfaW5fZnJpbmdlX3AgPSBmYWxzZTsKKyAgICAg ICAgICByb3ctPnJpZ2h0X2ZyaW5nZV9iaXRtYXAgPSBmcmluZ2VfYml0bWFwOworICAgICAgICAg IHJvdy0+cmlnaHRfZnJpbmdlX2ZhY2VfaWQgPSBmYWNlX2lkOworICAgICAgICAgIHJvdy0+cmln aHRfZnJpbmdlX29mZnNldCA9IDA7CisgICAgICAgICAgcm93LT5mcmluZ2VfYml0bWFwX3Blcmlv ZGljX3AgPSBmYWxzZTsKKyAgICAgICAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXAgKHcsIHJvdywg ZmFsc2UsIGN1cnNvcl90eXBlKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChnbHlwaF9m bGF2b3IgPT0gTUNfR0xZUEgKKyAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1D X0dMWVBITEVTUykKKyAgICAgICAgICB7CisgICAgICAgICAgICBib29sIG9uX3AgPSB0cnVlOwor ICAgICAgICAgICAgRlJBTUVfUklGIChmKS0+bWNfc2NyaWJlX2N1cnNvciAodywgbWF0cml4LCBy b3csIHgsIGZ4LCB5LCBmeSwgaHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHZwb3MsIHdkLCBoLCBsc2wsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoLCBnbHlwaF9mbGF2 b3IsIG9uX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBh Y3RpdmVfcCk7CisgICAgICAgICAgfQorfQorCisvKiBEdW1wIGNvbnRlbnRzIG9mIGdseXBoIEdM WVBIIHRvIHN0ZGVyci4gIFJPVyBhbmQgQVJFQSBhcmUKKyAgIHRoZSBnbHlwaCByb3cgYW5kIGFy ZWEgd2hlcmUgdGhlIGdseXBoIGNvbWVzIGZyb20uICovCit2b2lkCittY19kdW1wX2dseXBoIChz dHJ1Y3QgZ2x5cGhfcm93ICpyb3csIHN0cnVjdCBnbHlwaCAqZ2x5cGgsIGludCBhcmVhLAorICAg ICAgICAgICAgICAgaW50IHJlbGF0aXZlX3gsIGludCB2cG9zKQoreworICBib29sIGdseXBoX3p2 X3AgPSAoZ2x5cGggLSByb3ctPmdseXBoc1thcmVhXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisg ICAgICAgICAgICAgICAgICAgICAmJiBNQVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpID09IFpW KTsKKyAgaWYgKGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgIHx8IGdseXBoLT50eXBl ID09IEdMWVBITEVTU19HTFlQSCkKKyAgICB7CisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAg ICAgICIgJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNnggJTRkICUxLjFk JTEuMWQgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FS RUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJl YV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgKGdseXBoLT50eXBlID09IENI QVJfR0xZUEgKKyAgICAgICAgID8gJ0MnCisgICAgICAgICA6ICdHJyksCisgICAgICAgIGdseXBo LT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8g J0InCisgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAn UycKKyAgICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICA/ ICcwJworICAgICAgICAgICAgICAgOiAnLScpKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0 aCwKKyAgICAgICAgZ2x5cGgtPnUuY2gsCisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAg ICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVf cCwKKyAgICAgICAgZ2x5cGgtPmhwb3MsIGdseXBoX3p2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAg ICAgbWNfY2hhcl90b19zdHJpbmcgKGdseXBoLT51LmNoKSk7CisgICAgfQorICBlbHNlIGlmIChn bHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVy ciwKKyAgICAgICAgIiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAl NGQgJTEuMWQlMS4xZCAgJTNkICVzICVzXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhz W1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+ dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAnUycsCisgICAg ICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAg ICAgICAgICAgID8gJ0InCisgICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAg ICAgICAgICAgID8gJ1MnCisgICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAg ICAgICAgID8gJzAnCisgICAgICAgICAgOiAnLScpKSksCisgICAgICAgIGdseXBoLT5waXhlbF93 aWR0aCwKKyAgICAgICAgMHUsCisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlw aC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAg ICAgICAgZ2x5cGgtPmhwb3MsIGdseXBoX3p2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgIlxc UyIpOworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgICAg eworICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMg JTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICAlM2QgJXMgJWNcbiIsCisgICAg ICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRb YXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZl X3gsCisgICAgICAgICdJJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZG RVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnQicKKyAgICAgICAgICA6IChTVFJJ TkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICA6IChOSUxQ IChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICA6ICctJykpKSwK KyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAodW5zaWduZWQgaW50KSBnbHlw aC0+dS5pbWdfaWQsCisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVm dF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAg Z2x5cGgtPmhwb3MsIGdseXBoX3p2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgJy4nKTsKKyAg ICB9CisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IENPTVBPU0lURV9HTFlQSCkKKyAgICB7Cisg ICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICIgJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJw RCJkICVjICUzZCAweCUwNngiLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJF QV0sCisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVh XSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAnKycsCisgICAgICAgIGdseXBo LT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAg ID8gJ0InCisgICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAg ID8gJ1MnCisgICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8g JzAnCisgICAgICAgICAgOiAnLScpKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAg ICAgICAgKHVuc2lnbmVkIGludCkgZ2x5cGgtPnUuY21wLmlkKTsKKyAgICAgIGZwcmludGYgKHN0 ZGVyciwgIiAlNGQgJTEuMWQlMS4xZCIsCisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAg ICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVf cCk7CisgICAgICBpZiAoZ2x5cGgtPnUuY21wLmF1dG9tYXRpYykKKyAgICAgICAgZnByaW50ZiAo c3RkZXJyLCAiICAlM2QgJXMgLiBbJWQtJWRdXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAg IGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICAgICAgICAg ICAgICAgICAgZ2x5cGgtPnNsaWNlLmNtcC5mcm9tLCBnbHlwaC0+c2xpY2UuY21wLnRvKTsKKyAg ICAgICAgZWxzZQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJcbiIpOworICAgIH0KKyAgZWxz ZSBpZiAoZ2x5cGgtPnR5cGUgPT0gWFdJREdFVF9HTFlQSCkKKyAgICB7CisjaWZuZGVmIEhBVkVf WFdJREdFVFMKKyAgICAgIGVhc3N1bWUgKGZhbHNlKTsKKyNlbHNlCisgICAgICBmcHJpbnRmIChz dGRlcnIsCisgICAgICAgICIgICU1ZC8lLTVkICU1ZCAlNGMgJTZkICVjICUzZCAweCUwNXggJTRk ICUxLjFkJTEuMWQgICUzZCAlcyAlY1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tU RVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVz ZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ1gnLAorICAgICAg ICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAg ICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAg ICAgICAgPyAnUycKKyAgICAgICAgIDogJy0nKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0 aCwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5l X3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+dS54 d2lkZ2V0LAorICAgICAgICBnbHlwaC0+aHBvcywgZ2x5cGhfenZfcCA/ICJaViIgOiAiLS0iLAor ICAgICAgICAnLicpOworI2VuZGlmCisgICAgfQorfQorCisvKiBEdW1wIHRoZSBjb250ZW50cyBv ZiBnbHlwaCByb3cgYXQgVlBPUyBpbiBNQVRSSVggdG8gc3RkZXJyLgorICAgR0xZUEhTIDAgbWVh bnMgZG9uJ3Qgc2hvdyBnbHlwaCBjb250ZW50cy4KKyAgIEdMWVBIUyAxIG1lYW5zIHNob3cgZ2x5 cGhzIGluIHNob3J0IGZvcm0KKyAgIEdMWVBIUyA+IDEgbWVhbnMgc2hvdyBnbHlwaHMgaW4gbG9u ZyBmb3JtLiAqLwordm9pZAorbWNfZHVtcF9nbHlwaF9yb3cgKHN0cnVjdCBnbHlwaF9yb3cgKnJv dywgaW50IHZwb3MsIGludCBnbHlwaHMpCit7CisgIGludCByZWxhdGl2ZV94ID0gMDsKKyAgaWYg KGdseXBocyAhPSAxKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIlxuRFVNUCBHTFlQ SCBST1dcbiIpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiUm93ICAgICBTdGFydCAgICAgICBF bmQgVXNlZCBvRT48XFxDVFpGZXNtICAgICBYICAgIFkgICAgVyAgICBIICAgIFYgICAgQSAgICBQ XG4iKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIj09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuIik7 CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIlM2QgJTkicEQiZCAlOSJwRCJkICU0ZCAlMS4xZCUx LjFkJTEuMWQlMS4xZFwKKyUxLjFkJTEuMWQlMS4xZCUxLjFkJTEuMWQlMS4xZCUxLjFkJTEuMWQg ICU0ZCAlNGQgJTRkICU0ZCAlNGQgJTRkICU0ZFxuIiwKKyAgICAgICAgIHZwb3MsCisgICAgICAg ICBNQVRSSVhfUk9XX1NUQVJUX0NIQVJQT1MgKHJvdyksCisgICAgICAgICBNQVRSSVhfUk9XX0VO RF9DSEFSUE9TIChyb3cpLAorICAgICAgICAgcm93LT51c2VkW1RFWFRfQVJFQV0sCisgICAgICAg ICByb3ctPmNvbnRhaW5zX292ZXJsYXBwaW5nX2dseXBoc19wLAorICAgICAgICAgcm93LT5lbmFi bGVkX3AsCisgICAgICAgICByb3ctPnRydW5jYXRlZF9vbl9sZWZ0X3AsCisgICAgICAgICByb3ct PnRydW5jYXRlZF9vbl9yaWdodF9wLAorICAgICAgICAgcm93LT5jb250aW51ZWRfcCwKKyAgICAg ICAgIE1BVFJJWF9ST1dfQ09OVElOVUFUSU9OX0xJTkVfUCAocm93KSwKKyAgICAgICAgIE1BVFJJ WF9ST1dfRElTUExBWVNfVEVYVF9QIChyb3cpLAorICAgICAgICAgcm93LT5lbmRzX2F0X3p2X3As CisgICAgICAgICByb3ctPmZpbGxfbGluZV9wLAorICAgICAgICAgcm93LT5lbmRzX2luX21pZGRs ZV9vZl9jaGFyX3AsCisgICAgICAgICByb3ctPnN0YXJ0c19pbl9taWRkbGVfb2ZfY2hhcl9wLAor ICAgICAgICAgcm93LT5tb3VzZV9mYWNlX3AsCisgICAgICAgICByb3ctPngsCisgICAgICAgICBy b3ctPnksCisgICAgICAgICByb3ctPnBpeGVsX3dpZHRoLAorICAgICAgICAgcm93LT5oZWlnaHQs CisgICAgICAgICByb3ctPnZpc2libGVfaGVpZ2h0LAorICAgICAgICAgcm93LT5hc2NlbnQsCisg ICAgICAgICByb3ctPnBoeXNfYXNjZW50KTsKKyAgICAgIC8qIFRoZSBuZXh0IDMgbGluZXMgc2hv dWxkIGFsaWduIHRvICJTdGFydCIgaW4gdGhlIGhlYWRlci4gKi8KKyAgICAgIGZwcmludGYgKHN0 ZGVyciwgIiAgICAlOSJwRCJkICU5InBEImRcdCU1ZFxuIiwgcm93LT5zdGFydC5vdmVybGF5X3N0 cmluZ19pbmRleCwKKyAgICAgICAgIHJvdy0+ZW5kLm92ZXJsYXlfc3RyaW5nX2luZGV4LAorICAg ICAgICAgcm93LT5jb250aW51YXRpb25fbGluZXNfd2lkdGgpOworICAgICAgZnByaW50ZiAoc3Rk ZXJyLCAiICAgICU5InBEImQgJTkicEQiZFxuIiwKKyAgICAgICAgIENIQVJQT1MgKHJvdy0+c3Rh cnQuc3RyaW5nX3BvcyksCisgICAgICAgICBDSEFSUE9TIChyb3ctPmVuZC5zdHJpbmdfcG9zKSk7 CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgICAgJTlkICU5ZFxuIiwgcm93LT5zdGFydC5kcHZl Y19pbmRleCwKKyAgICAgICAgIHJvdy0+ZW5kLmRwdmVjX2luZGV4KTsKKyAgICB9CisgIGlmIChn bHlwaHMgPiAxKQorICAgIHsKKyAgICAgIGZvciAoaW50IGFyZWEgPSBMRUZUX01BUkdJTl9BUkVB OyBhcmVhIDwgTEFTVF9BUkVBOyArK2FyZWEpCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3Qg Z2x5cGggKmdseXBoID0gcm93LT5nbHlwaHNbYXJlYV07CisgICAgICAgICAgc3RydWN0IGdseXBo ICpnbHlwaF9lbmQgPSBnbHlwaCArIHJvdy0+dXNlZFthcmVhXTsKKyAgICAgICAgICAvKiBHbHlw aCBmb3IgYSBsaW5lIGVuZCBpbiB0ZXh0LiAqLworICAgICAgICAgIGlmIChhcmVhID09IFRFWFRf QVJFQSAmJiBnbHlwaCA9PSBnbHlwaF9lbmQgJiYgZ2x5cGgtPmNoYXJwb3MgPiAwKQorICAgICAg ICAgICAgKytnbHlwaF9lbmQ7CisgICAgICAgICAgaWYgKGdseXBoIDwgZ2x5cGhfZW5kKQorICAg ICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiR2x5cGgjL1RvdGFsIFJlbC5YIFQgICAgICAgUG9z IE8gICBXICAgICBDb2RlIEZhY2UgTFIgSFBPUyBaViBDXG4iKTsKKyAgICAgICAgICBmb3IgKDsg Z2x5cGggPCBnbHlwaF9lbmQ7ICsrZ2x5cGgpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAg IG1jX2R1bXBfZ2x5cGggKHJvdywgZ2x5cGgsIGFyZWEsIHJlbGF0aXZlX3gsIHZwb3MpOworICAg ICAgICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAg IH0KKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlIGlmIChnbHlwaHMgPT0gMSkKKyAgICAgIHsK KyAgICAgICAgY2hhciBzW1NIUlRfTUFYICsgNF07CisgICAgICAgIGZvciAoaW50IGFyZWEgPSBM RUZUX01BUkdJTl9BUkVBOyBhcmVhIDwgTEFTVF9BUkVBOyArK2FyZWEpCisgICAgICAgICAgewor ICAgICAgICAgICAgaW50IGk7CisgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgcm93LT51c2Vk W2FyZWFdOyArK2kpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5 cGggKmdseXBoID0gcm93LT5nbHlwaHNbYXJlYV0gKyBpOworICAgICAgICAgICAgICAgIGlmIChp ID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgJiYgYXJlYSA9PSBU RVhUX0FSRUEKKyAgICAgICAgICAgICAgICAgICAgJiYgTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAg ICAgICAgICAgICAgICAgICAgJiYgZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAg ICAgICAgICAgICAmJiBnbHlwaC0+dS5jaCA9PSAnICcpCisgICAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgICAgIHN0cmNweSAoJnNbaV0sICJbXFxuXSIpOworICAgICAgICAgICAg ICAgICAgICBpICs9IDQ7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBl bHNlIGlmIChnbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBnbHlwaC0+dS5jaCA8IDB4ODAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IGdseXBoLT51LmNoID49ICcgJykKKyAgICAgICAgICAgICAgICAgICAgc1tpXSA9IGdseXBoLT51 LmNoOworICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgc1tp XSA9ICcuJzsKKyAgICAgICAgICAgICAgfQor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ZGVyX2xpbmVfaGVpZ2h0ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgICAgICBp bnQgdm9mZnNldCA9IChoZWFkZXJfbGluZV9oZWlnaHQgPiAwCisgICAgICAgICAgICAgICAgICAg ICAmJiB5cG9zID4gMCkKKyAgICAgICAgICAgICAgICAgICAgICA/IHlwb3MgKyAxCisgICAgICAg ICAgICAgICAgICAgICAgOiB5cG9zOworICAgICAgaWYgKHZpc2libGVfcCkKKyAgICAgICAgdnBv cyA9IHZvZmZzZXQ7CisgICAgICAgIGVsc2UKKyAgICAgICAgICB2cG9zID0gMDsKKyAgICB9Cisg ICAgZWxzZQorICAgICAgeworICAgICAgICBDSEVDS19OVU1CRVIgKHJvdyk7CisgICAgICAgIHZw b3MgPSBYRklYTlVNIChyb3cpOworICAgICAgfQorICBpZiAodnBvcyA+PSAwICYmIHZwb3MgPCBt YXRyaXgtPm5yb3dzKQorICAgIG1jX2R1bXBfZ2x5cGhfcm93IChNQVRSSVhfUk9XIChtYXRyaXgs IHZwb3MpLAorICAgICAgICB2cG9zLAorICAgICAgICBUWVBFX1JBTkdFRF9GSVhOVU1QIChpbnQs IGdseXBocykgPyBYRklYTlVNIChnbHlwaHMpIDogMik7CisgIHJldHVybiBRbmlsOworfQorCit2 b2lkCittY19kdW1wX2dseXBoX21hdHJpeCAoc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBp bnQgZ2x5cGhzKQoreworICBpbnQgaTsKKyAgZm9yIChpID0gMDsgaSA8IG1hdHJpeC0+bnJvd3M7 ICsraSkKKyAgICBtY19kdW1wX2dseXBoX3JvdyAoTUFUUklYX1JPVyAobWF0cml4LCBpKSwgaSwg Z2x5cGhzKTsKK30KKworREVGVU4gKCJtYy1kdW1wLWdseXBoLW1hdHJpeCIsIEZtY19kdW1wX2ds eXBoX21hdHJpeCwKKyAgICAgICBTbWNfZHVtcF9nbHlwaF9tYXRyaXgsIDAsIDEsICJwIiwKKyAg ICAgICB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PT09PT09PT09PT09PT09PVxuIik7CisgIG1jX2R1bXBfZ2x5cGhfbWF0 cml4ICh3LT5jdXJyZW50X21hdHJpeCwKKyAgICAgICAgIFRZUEVfUkFOR0VEX0ZJWE5VTVAgKGlu dCwgZ2x5cGhzKSA/IFhGSVhOVU0gKGdseXBocykgOiAwKTsKKyAgcmV0dXJuIFFuaWw7Cit9CisK K2Jvb2wKK21jX3RyYXZlcnNlX2NhY2hlX3AgKHN0cnVjdCBtY19tYXRyaXggbWF0cml4LCBlbnVt IG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgIGludCB2bnRo LCBpbnQgbnRoKQoreworICBpZiAodm50aCA8IG1hdHJpeC52cG9zX3VzZWQKKyAgICAgICYmIG1h dHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVfdHlwZV0gPiAwCisgICAgICAmJiBudGggPCBtYXRyaXgu dnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdKQorICAgIHJldHVybiB0cnVlOworICAg IGVsc2UKKyAgICAgIHJldHVybiBmYWxzZTsKK30KKwordm9pZAorbWNfcmVzZXRfY2FjaGUgKHN0 cnVjdCB3aW5kb3cgKncpCit7CisgIGlmICghQlVGRkVSUCAody0+Y29udGVudHMpKQorICAgIHJl dHVybjsKKyAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOwor ICAgICAgIGNhY2hlX3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICArK2NhY2hlX3R5cGUpCisgICAg eworICAgICAgYm9vbCBidmFyX2FjdGl2ZV9wOworICAgICAgc3dpdGNoIChjYWNoZV90eXBlKQor ICAgICAgICB7CisgICAgICAgICAgY2FzZSBOT19DQUNIRToKKyAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICAgIGNhc2UgTUNfQ0FDSEU6 CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykK KyAgICAgICAgICAgICAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg bWNfY29uZikpKQorICAgICAgICAgICAgICAgIGJ2YXJfYWN0aXZlX3AgPSBmYWxzZTsKKyAgICAg ICAgICAgICAgICBlbHNlIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAg ICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25m KSkpCisgICAgICAgICAgICAgICAgICBidmFyX2FjdGl2ZV9wID0gdHJ1ZTsKKyAgICAgICAgICAg ICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgY2FzZSBDSF9DQUNIRToKKyAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAg ICAgICAgICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hh aXJzKSkpCisgICAgICAgICAgICAgICAgYnZhcl9hY3RpdmVfcCA9IGZhbHNlOworICAgICAgICAg ICAgICAgIGVsc2UgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAg ICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMp KSkKKyAgICAgICAgICAgICAgICAgIGJ2YXJfYWN0aXZlX3AgPSB0cnVlOworICAgICAgICAgICAg ICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBjYXNlIEZDX0NBQ0hFOgorICAgICAg ICAgICAgeworICAgICAgICAgICAgICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAg ICAgICAgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2li bGUpKSkKKyAgICAgICAgICAgICAgICBidmFyX2FjdGl2ZV9wID0gZmFsc2U7CisgICAgICAgICAg ICAgICAgZWxzZSBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkp KQorICAgICAgICAgICAgICAgICAgYnZhcl9hY3RpdmVfcCA9IHRydWU7CisgICAgICAgICAgICAg IGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBpZiAoIWJ2YXJfYWN0aXZl X3ApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBEZWNyZWFzZSB0aGUgc2l6ZSBvZiB0aGUgYXJy YXkgdG8gYSBiYXJlIG1pbmltdW0uICovCisgICAgICAgICAgZm9yIChpbnQgdm50aCA9IDA7IHZu dGggPCB3LT5tY19tYXRyaXgudnBvc191c2VkOyArK3ZudGgpCisgICAgICAgICAgICB7CisgICAg ICAgICAgICAgIGlmICh3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2Fj aGVfdHlwZV0gPiAxKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdID0KKyAgICAgICAgICAgICAgICAg ICAgeG5yZWFsbG9jICh3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXSwg MSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YgKnctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdKTsKKyAgICAgICAgICAgICAgICAgIHctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlX2FsbG9jYXRlZFtjYWNoZV90eXBlXSA9IDE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WNlLmltZy55ID09IGdseXBoLT5zbGljZS5pbWcueQorICAg ICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF0uZ2x5cGguc2xpY2UuaW1nLndpZHRoID09IGdseXBoLT5zbGljZS5pbWcud2lkdGgKKyAgICAg ICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhd LmdseXBoLnNsaWNlLmltZy5oZWlnaHQgPT0gZ2x5cGgtPnNsaWNlLmltZy5oZWlnaHQKKyAgICAg ICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhd LmdseXBoLnNsaWNlLmNtcC5mcm9tID09IGdseXBoLT5zbGljZS5jbXAuZnJvbQorICAgICAgICAg ICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ueCA9 PSB4CisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXS5meCA9PSBmeAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ueSA9PSB5CisgICAgICAgICAgICAgJiYgdy0+bWNf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5meSA9PSBmeQorICAgICAg ICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0u aHBvcyA9PSBocG9zCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXS52cG9zID09IHZwb3MKKyAgICAgICAgICAgICAmJiB3LT5tY19t YXRyaXgudnBvc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T0gYmFja2dyb3VuZC5ibHVlCisgICAg ICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XS5hY3RpdmVfcCA9PSBhY3RpdmVfcAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGhfZmxhdm9yID09IGdseXBoX2ZsYXZv cgorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF0ucm93X3Bvc2l0aW9uID09IHJvd19wb3NpdGlvbgorICAgICAgICAgICAgICYmIHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZW5hYmxlZF9wID09 IHRydWUpOworICAgICAgICB9CisgICAgICBpZiAoIXNhbWVfcCkKKyAgICAgICAgbWNfZHJhd19l cmFzZV9oeWJyaWQgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdk LCBoLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93 aWR0aCwgZm9yZWdyb3VuZCwgYWN0aXZlX3AsIGdseXBoX2ZsYXZvciwgcmVtb3ZlX3ApOworICAg ICAgcmV0dXJuOworICAgIH0KKyAgICBlbHNlIGlmIChkcmF3X3AKKyAgICAgICAgICAgICAmJiAo ZnJvbV93aGVyZSA9PSBTQ1JJQkVfT05FCisgICAgICAgICAgICAgICAgIHx8IGZyb21fd2hlcmUg PT0gU0NSSUJFX1RXTworICAgICAgICAgICAgICAgICB8fCBmcm9tX3doZXJlID09IFNDUklCRV9U SFJFRQorICAgICAgICAgICAgICAgICB8fCBmcm9tX3doZXJlID09IE5PV0hFUkUpKQorICAgICAg eworICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5 LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBhY3RpdmVfcCwgZ2x5cGhfZmxh dm9yLCByZW1vdmVfcCk7CisgICAgICAgIHJldHVybjsKKyAgICAgIH0KKyAgaWYgKGNhY2hlX3R5 cGUgPT0gTk9fQ0FDSEUpCisgICAgcmV0dXJuOworICArK3ctPm1jX21hdHJpeC5jdXJzb3JzX3Vz ZWRbY2FjaGVfdHlwZV07CisgIGlmICh2bnRoID49IHctPm1jX21hdHJpeC52cG9zX3VzZWQpCisg ICAgdy0+bWNfbWF0cml4LnZwb3NfdXNlZCA9IHZudGggKyAxOworICBpZiAody0+bWNfbWF0cml4 LnZwb3NfYWxsb2NhdGVkIDwgdy0+bWNfbWF0cml4LnZwb3NfdXNlZCkKKyAgICB7CisgICAgICBp bnQgb2xkX2FsbG9jID0gdy0+bWNfbWF0cml4LnZwb3NfYWxsb2NhdGVkOworICAgICAgaW50IG5l d19lbHRzID0gdy0+bWNfbWF0cml4LnZwb3NfdXNlZCAtIHctPm1jX21hdHJpeC52cG9zX2FsbG9j YXRlZDsKKyAgICAgIHctPm1jX21hdHJpeC52cG9zID0geHBhbGxvYyAody0+bWNfbWF0cml4LnZw b3MsICZ3LT5tY19tYXRyaXgudnBvc19hbGxvY2F0ZWQsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIG5ld19lbHRzLCBJTlRfTUFYLCBzaXplb2YgKnctPm1jX21hdHJpeC52cG9z KTsKKyAgICAgIG1lbXNldCAody0+bWNfbWF0cml4LnZwb3MgKyBvbGRfYWxsb2MsIDAsCisgICAg ICAgICAgICAgICAody0+bWNfbWF0cml4LnZwb3NfYWxsb2NhdGVkIC0gb2xkX2FsbG9jKSAqIHNp emVvZiAqdy0+bWNfbWF0cml4LnZwb3MpOworICAgIH0KKyAgKyt3LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdOworICBpZiAody0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVfYWxsb2NhdGVkW2NhY2hlX3R5cGVdIDwgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVfdXNlZFtjYWNoZV90eXBlXSkKKyAgICB7CisgICAgICBpbnQgb2xkX2FsbG9jID0gdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVkW2NhY2hlX3R5cGVdOworICAgICAg aW50IG5ld19lbHRzID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90 eXBlXSAtIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX2FsbG9jYXRlZFtjYWNoZV90eXBl XTsKKyAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdID0geHBh bGxvYyAody0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV0sCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZ3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV0sCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19l bHRzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBJTlRfTUFYLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBzaXplb2YgKnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdKTsKKyAgICAgIG1lbX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gcGl4ZWwsIGFu ZCBhbGwgb3RoZXJzIGFyZSBST1ctPlZJU0lCTEVfSEVJR0hULgorICAgICAgIEZJWE1FOiAgQWRk IGNvbmRpdGlvbnMgZm9yIHVzZXItc3BlY2lmaWVkIHRoaWNrbmVzcyBvZiBNQ19CQVIgYW5kCisg ICAgICAgICAgICAgICBNQ19IQkFSIGFzIHRvIGBtYy1yZWFsLWZha2UtY3Vyc29yJy4KKyAgIE1V TFRJUExFX0NVUlNPUlM6ICBXZSBkbyBub3QgdXNlIHRoaXMgZnVuY3Rpb24uCisgICBIT1JJWk9O VEFMX1JVTEVSOiAgV2Ugd2FudCBhIHVuaXZlcnNhbCBGWSBjb29yZGluYXRlIGZvciBhIGxldmVs IHJ1bGVyLgorICAgVkVSVElDQUxfUlVMRVIgYW5kIEZJTExfQ09MVU1OOiAgV2Ugd2FudCBhbiBI IHRoYXQgZW5zdXJlcyBubyBnYXAgYmV0d2VlbiB0aGUKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHByZXZpb3VzL25leHQgbGluZS4gIFRoZSBGWCBjb29yZGluYXRlIGlzIHNl dAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZXdoZXJlOiAgYHctPmN1 cnNvci54YCAvIGBtYy5mY194YC4gKi8KK3ZvaWQKK21jX2dldF9jdXJzb3JfZ2VvbWV0cnkgKHN0 cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwKKyAgICAgICAgICAg ICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgaW50IHgsIGludCAqZngsIGludCB5 LAorICAgICAgICAgICAgICAgICAgICAgICAgaW50ICpmeSwgaW50IGhwb3MsIGludCB2cG9zLCBp bnQgKmgsCisgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNv cl90eXBlLCBpbnQgY3Vyc29yX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgaW50ICp3 ZCkKK3sKKyAgc3RydWN0IGdseXBoICpnbHlwaCA9IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIG1h dHJpeCwgcm93LCBocG9zLCB2cG9zKTsKKyAgaWYgKGdseXBoID09IE5VTEwpCisgICAgcmV0dXJu OworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworICAqZngg PSBXSU5ET1dfVEVYVF9UT19GUkFNRV9QSVhFTF9YICh3LCB4KTsKKyAgKmggPSByb3ctPnZpc2li bGVfaGVpZ2h0OworICAvKiBEb24ndCBsZXQgdGhlIGN1cnNvciBleGNlZWQgdGhlIGRpbWVuc2lv bnMgb2YgdGhlIHJvdywgc28gdGhhdAorICB0aGUgdXBwZXIvbG93ZXIgc2lkZSBvZiB0aGUgYm94 IGFyZW4ndCBjbGlwcGVkLiAgKi8KKyAgaW50IHdfaGVhZGVyX2xpbmVfaGVpZ2h0ID0gV0lORE9X X0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgIGludCB3X3RleHRfYm90dG9tX3kgPSB3aW5kb3df dGV4dF9ib3R0b21feSAodykgLSAqaDsKKyAgaWYgKHkgPCB3X2hlYWRlcl9saW5lX2hlaWdodCkK KyAgICB7CisgICAgICAqaCA9IG1heCAoKmggLSAod19oZWFkZXJfbGluZV9oZWlnaHQgLSB5KSAr IDEsICpoKTsKKyAgICAgIHkgPSB3X2hlYWRlcl9saW5lX2hlaWdodCAtIDE7CisgICAgICAvLyBm cHJpbnRmIChzdGRlcnIsICJDT05ESVRJT04gIyAxXG4iKTsKKyAgICB9CisgICBlbHNlIGlmICh5 ID4gd190ZXh0X2JvdHRvbV95KQorICAgICB7CisgICAgICAgKmggKz0geSAtIHdfdGV4dF9ib3R0 b21feTsKKyAgICAgICB5ID0gd190ZXh0X2JvdHRvbV95OworICAgICAgIC8vIGZwcmludGYgKHN0 ZGVyciwgIkNPTkRJVElPTiAjIDJcbiIpOworICAgICB9CisgICpmeSA9IFdJTkRPV19UT19GUkFN RV9QSVhFTF9ZICh3LCB5KTsKKyAgc3dpdGNoIChjdXJzb3JfdHlwZSkKKyAgICB7CisgICAgICBj YXNlIE1DX0JBUjoKKyAgICAgICAgeworICAgICAgICAgIGlmIChjdXJzb3Jfd2lkdGggPCAxKQor ICAgICAgICAgICAgY3Vyc29yX3dpZHRoID0gbWF4IChGUkFNRV9DVVJTT1JfV0lEVEggKGYpLCAx KTsKKyAgICAgICAgICBpZiAoY3Vyc29yX3dpZHRoIDwgZ2x5cGgtPnBpeGVsX3dpZHRoKQorICAg ICAgICAgICp3ZCA9IGN1cnNvcl93aWR0aDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQor ICAgICAgY2FzZSBNQ19IQkFSOgorICAgICAgICB7CisgICAgICAgICAgaW50IGN1cnNvcl9oZWln aHQgPSAoY3Vyc29yX3dpZHRoIDwgMSkgPyBscmludCAoMC4yNSAqICpoKSA6IGN1cnNvcl93aWR0 aDsKKyAgICAgICAgICBpZiAoY3Vyc29yX2hlaWdodCA+IHJvdy0+aGVpZ2h0KQorICAgICAgICAg ICAgY3Vyc29yX2hlaWdodCA9IHJvdy0+aGVpZ2h0OworICAgICAgICAgIC8qIEN1cnNvciBzbWFs bGVyIHRoYW4gbGluZSBoZWlnaHQsIHNvIG1vdmUgZG93bi4gKi8KKyAgICAgICAgICBpZiAoKmgg PiBjdXJzb3JfaGVpZ2h0KQorICAgICAgICAgICAgKmZ5ICs9ICpoIC0gY3Vyc29yX2hlaWdodDsK KyAgICAgICAgICAqaCA9IGN1cnNvcl9oZWlnaHQ7CisgICAgICAgICAgKndkID0gZ2x5cGgtPnBp eGVsX3dpZHRoOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBjYXNlIE1DX1JJ R0hUX0ZSSU5HRV9CSVRNQVA6CisgICAgICBjYXNlIE1DX0xFRlRfRlJJTkdFX0JJVE1BUDoKKyAg ICAgIGN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CBmY19meCA9IFdJTkRPV19URVhUX1RPX0ZSQU1FX1BJWEVMX1ggKHcsIGVzc2VudGlhbHMuZmNf eCk7CisgIGJvb2wgZ2x5cGhfenZfcCA9IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0g PT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgJiYgTUFUUklYX1JP V19FTkRfQ0hBUlBPUyAocm93KSA9PSBaVik7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAo dy0+ZnJhbWUpOworICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAody0+Y29udGVudHMpOwor ICBpbnQgdGV4dF9hcmVhX3dpZHRoID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsK KyAgc3RydWN0IGdseXBoX3JvdyAqY3Vyc29yX3JvdyA9ICh3LT5jdXJzb3IudnBvcyAhPSAtMSkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPVyAoY3Vyc29yX21h dHJpeCwgdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IE5VTEw7CisgIHN0cnVjdCBnbHlwaCAqY3Vyc29yX2dseXBoID0gKHctPmN1cnNvci52cG9zICE9 IC0xKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfZ2V0X2N1cnNvcl9nbHlw aCAodywgY3Vyc29yX21hdHJpeCwgY3Vyc29yX3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3Iu dnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgIGJvb2wgY3Vy c29yX2F0X2ZyaW5nZV9wID0gKGN1cnNvcl9nbHlwaCA9PSBOVUxMCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIGN1cnNvcl9yb3cgIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0K KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+ZXhhY3Rfd2luZG93 X3dpZHRoX2xpbmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3Iu eCA9PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+ Y3Vyc29yLnggPT0gY3Vyc29yX3Jvdy0+cGl4ZWxfd2lkdGgpOworICBib29sIGN1cnNvcl9iZXlv bmRfZnJpbmdlX3AgPSAoY3Vyc29yX2dseXBoID09IE5VTEwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIGN1cnNvcl9yb3cgIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FS RUFdCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhY3Vyc29yX3Jvdy0+ZXhh Y3Rfd2luZG93X3dpZHRoX2xpbmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgdy0+Y3Vyc29yLnggPj0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA+PSBjdXJzb3Jfcm93LT5waXhlbF93aWR0aCk7Cisg IGludCBmcmFtZV9jaGFyX3dpZHRoID0gRlJBTUVfQ09MVU1OX1dJRFRIIChmKTsKKyAgaW50IHRl bXBfZmFjZV9pZCA9IGdseXBoLT5mYWNlX2lkOworICBzdHJ1Y3QgbWNfUkdCIGJhY2tncm91bmQ7 CisgIG1jX3NldF9sc2xfYmcgKHcsIHRlbXBfZmFjZV9pZCwgJmJhY2tncm91bmQpOworICBib29s IHJlYWxfZmFrZV9jdXJzb3JfcCA9IChvcG9pbnRfeCA9PSByZWxhdGl2ZV94CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF9ocG9zID09IGhwb3MKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgb3BvaW50X3kgPT0gcm93LT55CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIG9wb2ludF92cG9zID09IHZwb3MpOworCisvKiAtLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICBCRUdJTjogIENIQVJfR0xZUEggfCBHTFlQ SExFU1NfR0xZUEggICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICov CisgIGlmIChnbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICB8fCBnbHlwaC0+dHlwZSA9 PSBHTFlQSExFU1NfR0xZUEgpCisgIHsKKyAgICBpZiAobWNfc3RkZXJyX3ApCisgICAgICBmcHJp bnRmIChzdGRlcnIsCisgICAgICAgICJcbiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMg JTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4xZCAgJTNkICVzICVzXG4iLAorICAgICAgICBnbHlwaCAt IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDAp ID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAg ICAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgPyAnQycKKyAgICAgICAgIDog J0cnKSwKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+ b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmpl Y3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVj dCkKKyAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAgICA6ICctJykpKSwKKyAgICAg ICAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICBnbHlwaC0+dS5jaCwKKyAgICAg ICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAg ICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+aHBvcywgZ2x5cGhf enZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAoZ2x5cGgtPnUu Y2gpKTsKKyAgc3dpdGNoIChhY3Rpb25fdHlwZSkKKyAgeworLyogLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t ICovCisvKiAgICAgICAgICAgICAgIE1VTFRJUExFX0NVUlNPUlM6ICBDSEFSX0dMWVBIIHwgR0xZ UEhMRVNTX0dMWVBIICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLwor ICAgIGNhc2UgTVVMVElQTEVfQ1VSU09SUzoKKyAgICB7CisgICAgICBtY19oZWxwZXIgKHcsIG1h dHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAg ICAgICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcm93X3Bvc2l0 aW9uLCBmb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxz LmFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAg ICBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgSE9SSVpPTlRBTF9SVUxFUjogIENI QVJfR0xZUEggfCBHTFlQSExFU1NfR0xZUEggICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tICovCisgICAgY2FzZSBIT1JJWk9OVEFMX1JVTEVSOgorICAgIHsKKyAgICAgIGlm IChyZWxhdGl2ZV94IDwgcm93LT5waXhlbF93aWR0aAorICAgICAgICAgICYmICFyZWFsX2Zha2Vf Y3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxh dGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgs IGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgZm9yZWdyb3VuZCwKKyAg ICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBNQ19HTFlQ SCwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUsIGFj dGlvbl90eXBlKTsKKyAgICAgIGlmIChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0g cm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICYmIHJlbGF0aXZlX3ggPD0geF9saW1pdCkK KyAgICAgICAgeworICAgICAgICAgIGlmIChyZWxhdGl2ZV94IDwgcm93LT5waXhlbF93aWR0aCkK KyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxf d2lkdGg7CisgICAgICAgICAgICAgIGZ4ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAg ICAgIH0KKyAgICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRp dmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgeF9saW1p dCAtIHJlbGF0aXZlX3gsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlv biwKKyAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQsIGJhY2tncm91bmQsIGVzc2VudGlh bHMuYWN0aXZlX3AsIE1DX0dMWVBITEVTUywKKyAgICAgICAgICAgICAgICAgICAgIGRyYXdfcCwg ZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAgICB9CisgICAgICBi cmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAg VkVSVElDQUxfUlVMRVI6ICBDSEFSX0dMWVBIIHwgR0xZUEhMRVNTX0dMWVBIICAgICAgICAgICAg ICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBWRVJUSUNBTF9SVUxF UjoKKyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoY3Vyc29yX2F0 X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT5j b250aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19W RVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmICFyb3ctPmNvbnRpbnVlZF9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJf UklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNv cl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5b25kX2ZyaW5nZV9w CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93LT51 c2VkW1RFWFRfQVJFQV0gIT0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0g PT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgb3BvaW50X3ggPj0gcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogKGdseXBoX3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IE1DX0dMWVBIOworICAgICAgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNB TF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJT RURfVkVSVElD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BlbnVtIG1jX2ZsYXZv ciBnbHlwaF9mbGF2b3IgPSAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+ dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBl c3NlbnRpYWxzLmZjX3ggPj0gcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogKGdseXBoX3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6ICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMp LCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBvcG9pbnRfeSA9PSB5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBvcG9pbnRfdnBvcyA9PSB2cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIHdkID0gMTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0 cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmY19meCwgeSwgZnksIGhwb3MsIHZwb3MsCisg ICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9z aXRpb24sIGZvcmVncm91bmQsCisgICAg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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgIGVsc2UgaWYg KGdseXBoLT50eXBlID09IFNUUkVUQ0hfR0xZUEgpCisgIHsKKyAgICBpZiAobWNfc3RkZXJyX3Ap CisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICJcbiAlNSJwRCJkLyUtNWQgJTVkICVj ICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4xZCAgJTNkICVzICVzXG4iLAorICAg ICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2Vk W2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2 ZV94LAorICAgICAgICAnUycsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVG RkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJTkdQ IChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICAgIDogKE5JTFAg KGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICA/ICcwJworICAgICAgICAgICAgICAgOiAn LScpKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgMHUsCisgICAgICAg IGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAg ICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPmhwb3MsIGdseXBoX3p2 X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgIlxcUyIpOworICBzd2l0Y2ggKGFjdGlvbl90eXBl KQorICB7CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAg ICAgTVVMVElQTEVfQ1VSU09SUzogIFNUUkVUQ0hfR0xZUEggICAgICAgICAgICAgICAgICAgICAq LworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBNVUxUSVBMRV9DVVJTT1JTOgor ICAgIHsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94 LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3Jf dHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAg ICAgICAgIGJhY2tncm91bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3As IGZyb21fd2hlcmUsCisgICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsK KyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAg ICAgICAgICAgICAgICAgICBIT1JJWk9OVEFMX1JVTEVSOiAgU1RSRVRDSF9HTFlQSCAgICAgICAg ICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEhPUkla T05UQUxfUlVMRVI6CisgICAgeworICAgICAgaWYgKHJlbGF0aXZlX3ggPCByb3ctPnBpeGVsX3dp ZHRoCisgICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgbWNfaGVscGVy ICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBv cywKKyAgICAgICAgICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwg cm93X3Bvc2l0aW9uLCBmb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQs IGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUsCisgICAg ICAgICAgICAgICAgICAgY2FjaGVfdHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAgaWYgKGdseXBo IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAg ICAgJiYgcmVsYXRpdmVfeCA8PSB4X2xpbWl0KQorICAgICAgICB7CisgICAgICAgICAgaWYgKHJl bGF0aXZlX3ggPCByb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgcmVsYXRpdmVfeCArPSBn bHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgdGVtcF9mYWNlX2lkID0gKHJvdy0+ZmlsbF9s aW5lX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgPyBnbHlwaC0+ZmFjZV9pZAorICAgICAg ICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAgIHN0cnVjdCBt Y19SR0IgYmFja2dyb3VuZDsKKyAgICAgICAgICBtY19zZXRfbHNsX2JnICh3LCB0ZW1wX2ZhY2Vf aWQsICZiYWNrZ3JvdW5kKTsKKyAgICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBn bHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAg ICAgICAgeF9saW1pdCAtIHJlbGF0aXZlX3gsIGgsIGN1cnNvcl90eXBlLCB4X2xpbWl0IC0gcmVs YXRpdmVfeCwKKyAgICAgICAgICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgZm9yZWdyb3VuZCwg YmFja2dyb3VuZCwgZXNzZW50aWFscy5hY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgIE1D X0dMWVBITEVTUywgZHJhd19wLCBmcm9tX3doZXJlLCBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7 CisgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAq LworLyogICAgICAgICAgICAgICAgICAgICAgICAgIFZFUlRJQ0FMX1JVTEVSOiAgU1RSRVRDSF9H TFlQSCAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAg ICBjYXNlIFZFUlRJQ0FMX1JVTEVSOgorICAgIHsKKyAgICAgIGlmIChyb3ctPmZpbGxfbGluZV9w CisgICAgICAgICAgJiYgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNl ZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiBvcG9pbnRfeCA+IHJlbGF0aXZlX3ggKyBnbHlwaC0+ cGl4ZWxfd2lkdGgpCisgICAgICAgIHRlbXBfZmFjZV9pZCA9IGdseXBoLT5mYWNlX2lkOworICAg ICAgICBlbHNlIGlmICghcm93LT5maWxsX2xpbmVfcAorICAgICAgICAgICAgICAgICAmJiBnbHlw aCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAg ICAgICAgICAgICAmJiBvcG9pbnRfeCA+IHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGgp CisgICAgICAgICAgdGVtcF9mYWNlX2lkID0gREVGQVVMVF9GQUNFX0lEOworICAgICAgc3RydWN0 IG1jX1JHQiBiYWNrZ3JvdW5kOworICAgICAgbWNfc2V0X2xzbF9iZyAodywgdGVtcF9mYWNlX2lk LCAmYmFja2dyb3VuZCk7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoY3Vy c29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg cm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmICFyb3ctPmNvbnRpbnVlZF9wCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmln aHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNB TF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog KGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9X CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5b25kX2Zy aW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jf cm93LT51c2VkW1RFWFRfQVJFQV0gIT0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBITEVTUzsKKyAgICAgIGlmIChn bHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwg Z2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAg ICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAg ICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgIHx8IGds eXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAgIGN1cnNvcl90 eXBlID0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUDsKKyAgICA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+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAn SScsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9i amVjdCkKKyAgICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0 KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3Qp CisgICAgICAgICAgICAgICA/ICcwJworICAgICAgICAgICAgICAgOiAnLScpKSksCisgICAgICAg IGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgKHVuc2lnbmVkIGludCkgZ2x5cGgtPnUuaW1n X2lkLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xp bmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5o cG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7CisgIHN3aXRjaCAo YWN0aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAg ICAgICAgICAgICAgICAgTVVMVElQTEVfQ1VSU09SUzogIElNQUdFX0dMWVBIICAgICAgICAgICAg ICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIE1VTFRJUExF X0NVUlNPUlM6CisgICAgeworICAgICAgY3Vyc29yX3R5cGUgPSBNQ19IT0xMT1dfQk9YOworICAg ICAgbWNfaGV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0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyog ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVORDogIElNQUdFX0dMWVBIICAgICAgICAg ICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKworLyogLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICBCRUdJTjog IENPTVBPU0lURV9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLSAqLworICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgp CisgIHsKKyAgICBpZiAobWNfc3RkZXJyX3ApCisgICAgICB7CisgICAgICAgIGZwcmludGYgKHN0 ZGVyciwKKyAgICAgICAgICAiXG4gJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAw eCUwNngiLAorICAgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAg ICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwK KyAgICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAgICcrJywKKyAgICAgICAgICBnbHlwaC0+ Y2hhcnBvcywKKyAgICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAg PyAnQicKKyAgICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAg ICAgPyAnUycKKyAgICAgICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAg ICAgICAgICAgPyAnMCcKKyAgICAgICAgICAgICAgICAgOiAnLScpKSksCisgICAgICAgICAgZ2x5 cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAgICh1bnNpZ25lZCBpbnQpIGdseXBoLT51LmNtcC5p ZCk7CisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAlNGQgJTEuMWQlMS4xZCIsCisgICAgICAg ICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAg ICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCk7CisgICAgICBpZiAoZ2x5cGgtPnUuY21w LmF1dG9tYXRpYykKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICAlM2QgJXMgLiBbJWQtJWRd XG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8g IlpWIiA6ICItLSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGgtPnNsaWNlLmNtcC5m cm9tLCBnbHlwaC0+c2xpY2UuY21wLnRvKTsKKyAgICAgICAgZWxzZQorICAgICAgICAgIGZwcmlu dGYgKHN0ZGVyciwgIlxuIik7CisgICAgICB9CisgIHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsK Ky8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgIE1VTFRJ UExFX0NVUlNPUlM6ICBDT01QT1NJVEVfR0xZUEggICAgICAgICAgICAgICAgICAgICovCisvKiAt LS0tLS0tLS0tLS0tLS0t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cywgdnBvcywKKyAgICAgICAgICAg ICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcm93X3Bvc2l0aW9uLCBm b3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQsIGVzc2VudGlhbHMuYWN0 aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUsCisgICAgICAgICAgICAgICAgICAg Y2FjaGVfdHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAgaWYgKGdseXBoIC0gcm93LT5nbHlwaHNb VEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYgcmVsYXRpdmVf eCA8PSB4X2xpbWl0KQorICAgICAgICB7CisgICAgICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+ cGl4ZWxfd2lkdGg7CisgICAgICAgICAgd2hpbGUgKHJlbGF0aXZlX3ggPD0geF9saW1pdCkKKyAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5 cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAg ICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcm93X3Bvc2l0aW9uLCBm b3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQsIGVzc2VudGlh bHMuYWN0aXZlX3AsIE1DX0dMWVBITEVTUywgZHJhd19wLAorICAgICAgICAgICAgICAgICAgICAg ICAgIGZyb21fd2hlcmUsIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgICAgICAgICAg cmVsYXRpdmVfeCArPSBmcmFtZV9jaGFyX3dpZHRoOworICAgICAgICAgICAgfQorICAgICAgICB9 CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAg ICAgICAgICAgICAgICAgICAgIFZFUlRJQ0FMX1JVTEVSOiAgQ09NUE9TSVRFX0dMWVBIICAgICAg ICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBWRVJU SUNBTF9SVUxFUjoKKyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAo Y3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmICFyb3ctPmNvbnRpbnVlZF9wCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVIKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25f cmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJU SUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FS Uk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5b25k X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJz b3Jfcm93LT51c2VkW1RFWFRfQVJFQV0gIT0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RF WFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgb3BvaW50X3ggPj0gcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX3p2X3ApCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgaWYgKGdseXBoX2ZsYXZvciA9PSBN Q19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0g TUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhf Zmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICB8fCBnbHlwaF9m bGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1D X1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgY3Vyc29yX3R5cGUgPSBNQ19SSUdIVF9G UklOR0VfQklUTUFQOworICAgICAgd2QgPSAxOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgs IHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIG9wb2ludF9meCwgeSwgZnksIGhwb3MsIHZwb3MsCisg ICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9z aXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIGJhY2tncm91bmQsIGVzc2VudGlh bHMuYWN0aXZlX3AsIGdseXBoX2ZsYXZvciwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAg ICAgICAgICBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9Cisv KiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICBGSUxM X0NPTFVNTjogIENPTVBPU0lURV9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAqLworLyogLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBGSUxMX0NPTFVNTjoKKyAgICB7CisgICAgICBl bnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FS RUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPiByZWxhdGl2ZV94KQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfenZfcCkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogKCFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIG9wb2ludF95ID09IHkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIG9wb2ludF92cG9zID09IHZwb3MpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgd2QgPSAxOworICAgICAgbWNfaGVscGVyICh3 LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZjX2Z4LCB5LCBmeSwgaHB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gICAgICAgICAgICAgIEJFR0lOOiAgWFdJREdFVF9HTFlQSCAgICAg ICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgZWxz ZSBpZiAoZ2x5cGgtPnR5cGUgPT0gWFdJREdFVF9HTFlQSCkKKyAgeworI2lmbmRlZiBIQVZFX1hX SURHRVRTCisgICAgZWFzc3VtZSAoZmFsc2UpOworI2Vsc2UKKyAgICBpZiAobWNfc3RkZXJyX3Ap CisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICJcbiAgJTVkLyUtNWQgJTVkICU0YyAl NmQgJWMgJTNkIDB4JTA1eCAlNGQgJTEuMWQlMS4xZCAgJTNkICVzICVjXG4iLAorICAgICAgICBn bHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2VkW2FyZWFd ID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94LAor ICAgICAgICAnWCcsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAo Z2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJTkdQIChnbHlw aC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICAgIDogJy0nKSksCisgICAg ICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAg IGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9w LAorICAgICAgICBnbHlwaC0+dS54d2lkZ2V0LAorICAgICAgICBnbHlwaC0+aHBvcywgZ2x5cGhf enZfcCA/ICJaViIgO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3JvdW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tn cm91bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBITEVTUywgZHJhd19wLAorICAgICAg ICAgICAgICAgICAgICAgICAgIGZyb21fd2hlcmUsIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsK KyAgICAgICAgICAgICAgcmVsYXRpdmVfeCArPSBmcmFtZV9jaGFyX3dpZHRoOworICAgICAgICAg ICAgfQorICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIFhXSURH RVRfR0xZUEggICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICov CisgICAgY2FzZSBWRVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBn bHlwaF9mbGF2b3IgPSAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPmNvbnRpbnVlZF9wCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25f cmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJU SUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9h dF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93 LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElD QUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IChjdXJzb3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0gIT0gMQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3Ap CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVS VElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaCAt IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3ggPj0gcm93LT5waXhlbF93 aWR0aCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExF U1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX3p2X3ApCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgaWYgKGds eXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBn bHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAg ICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAg ICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgfHwgZ2x5 cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgY3Vyc29yX3R5 cGUgPSBNQ19SSUdIVF9GUklOR0VfQklUTUFQOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgs IHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIG9wb2ludF9meCwgeSwgZnksIGhwb3MsIHZwb3MsCisg ICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9z aXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIGJhY2tncm91bmQsIGVzc2VudGlh bHMuYWN0aXZlX3AsIGdseXBoX2ZsYXZvciwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAg ICAgICAgICBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9Cisv KiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgRklM TF9DT0xVTU46ICBYV0lER0VUX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICAqLworLyogLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBGSUxMX0NPTFVNTjoKKyAgICB7CisgICAgICBl bnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FS RUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPiByZWxhdGl2ZV94KQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfenZfcCkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogKCFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIG9wb2ludF95ID09IHkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIG9wb2ludF92cG9zID09IHZwb3MpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywg Z2x5cGgsIHJlbGF0aXZlX3gsIGZjX2Z4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAg ICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgZm9y ZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgYmFja2dyb3VuZCwgZXNzZW50aWFscy5hY3RpdmVf cCwgZ2x5cGhfZmxhdm9yLCBkcmF3X3AsIGZyb21fd2hlcmUsCisgICAgICAgICAgICAgICAgIGNh Y2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLSAqLworICAgIGNhc2UgQ1VSU09SX0lORElDQVRPUjoKKyAgICB7CisgICAgICBi cmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgfQorICB9CisvKiAtLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVORDog IFhXSURHRVRfR0xZUEggICAgICAgICAgICAgIC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UklYX0JPVFRPTV9U RVhUX1JPVyAobWF0cml4LCB3KTsKKyAgaW50IGJvdHRvbV92cG9zID0gTUFUUklYX1JPV19WUE9T IChib3R0b21fcm93LCBtYXRyaXgpOworICBpZiAodnBvcyA9PSBib3R0b21fdnBvcykKKyAgICBy ZXR1cm47CisgIGlmICghcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgcmV0dXJuOworICBpbnQg aHBvc19zdGFydCA9IHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgaWYgKHRyYWNl X3JlZGlzcGxheV9wKQorICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX2RyYXdfcm93ICglZCk6ICBk cmF3X3AgKCVzKSB8IGhwb3MgKCVkKSB8IGxlbiAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAg ICAgdnBvcywgZHJhd19wID8gInkiIDogIm4iLCBocG9zX3N0YXJ0LCBocG9zX2xlbmd0aCk7Cisg IGludCBvcG9pbnRfZngsIG9wb2ludF9meSwgb3BvaW50X3dkLCBvcG9pbnRfaDsKKyAgaW50IHRl eHRfYXJlYV93aWR0aCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgIGludCBo ZWFkZXJfbGluZV9mb3JtYXQgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgc3Ry dWN0IGdseXBoX3JvdyAqY3Vyc29yX3JvdyA9ICh3LT5jdXJzb3IudnBvcyAhPSAtMSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPVyAoY3Vyc29yX21hdHJpeCwg dy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5VTEw7 CisgIHN0cnVjdCBnbHlwaCAqY3Vyc29yX2dseXBoID0gKHctPmN1cnNvci52cG9zICE9IC0xKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfZ2V0X2N1cnNvcl9nbHlwaCAodywg Y3Vyc29yX21hdHJpeCwgY3Vyc29yX3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcykK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgIGJvb2wgY3Vyc29yX2F0 X2ZyaW5nZV9wID0gKGN1cnNvcl9nbHlwaCA9PSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIGN1cnNvcl9yb3cgIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+ZXhhY3Rfd2luZG93X3dpZHRo X2xpbmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA9PSB0 ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29y LnggPT0gY3Vyc29yX3Jvdy0+cGl4ZWxfd2lkdGgpOworICBib29sIGN1cnNvcl9iZXlvbmRfZnJp bmdlX3AgPSAoY3Vyc29yX2dseXBoID09IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIGN1cnNvcl9yb3cgIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhY3Vyc29yX3Jvdy0+ZXhhY3Rfd2lu ZG93X3dpZHRoX2xpbmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+ Y3Vyc29yLnggPj0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5jdXJzb3IueCA+PSBjdXJzb3Jfcm93LT5waXhlbF93aWR0aCk7CisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgUkVQTEFDRSBUSEUg UkVBTCBDVVJTT1IKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICBlbnVtIGZhY2VfaWQgYmdf ZmFjZV9pZCA9IChjdXJzb3JfZ2x5cGggIT0gTlVMTCkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IGN1cnNvcl9nbHlwaC0+ZmFjZV9pZAorICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogREVGQVVMVF9GQUNFX0lEOworICBzdHJ1Y3QgbWNfUkdCIGN1cnNvcl9iZzsKKyAgbWNfc2V0 X2xzbF9iZyAodywgYmdfZmFjZV9pZCwgJmN1cnNvcl9iZyk7CisgIC8qIEZJWE1FOiAgUHV0IGlu IHNvbWUgY29kZSB0byBkZWZhdWx0IHRvIE1DX0hPTExPV19CT1ggaWYgdGhlIHVzZXIgaGFzCisg IHVud2l0dGluZ2x5IGNvbWUgdXAgd2l0aCBzb21lIHVuYWNjZXB0YWJsZSBmb3JtIG9mIHVucmVj b2duaXplZCBjdXJzb3IgdHlwZS4gKi8KKyAgTGlzcF9PYmplY3QgbGlzcF90eXBlID0gQlZBUiAo YiwgbWNfcmVhbF9mYWtlX2N1cnNvcik7CisgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5 cGUgPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKFhDQVIgKGxpc3BfdHlwZSkpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKGxp c3BfdHlwZSk7CisgIGludCBjdXJzb3Jfd2lkdGggPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAg ICAgICAgICAgICAgICAgICA/IFhGSVhOVU0gKFhDQVIgKFhDRFIgKGxpc3BfdHlwZSkpKQorICAg ICAgICAgICAgICAgICAgICAgOiAtMTsKKyAgc3RydWN0IG1jX1JHQiBjdXJzb3JfZmc7CisgIG1j X2NvbG9yX3BpY2tlciAodywgY3Vyc29yX2dseXBoLCBlc3NlbnRpYWxzLCAmY3Vyc29yX2ZnLCAt MSwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgcm93X3Bvc2l0aW9uLCBDVVJTT1Jf SU5ESUNBVE9SKTsKKyAgYm9vbCBmaWxsX2NvbHVtbl90cnVtcHNfcCA9ICghTklMUCAoQlZBUiAo YiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm ICFOSUxQIChCVkFSIChiLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5jdXJzb3IueCA9PSBlc3NlbnRpYWxzLmZjX3gKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiAhY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgIWN1cnNvcl9iZXlvbmRfZnJpbmdlX3ApOworICAvKiBXZSB1c2UgYSB0 ZXN0IHNpbWlsYXIgdG8gdGhlIHJlYWwgZmFrZSBjdXJzb3Igc28gdGhhdCB0aGUgZnJpbmdlIGJp dG1hcCBpcworICBvbmx5IGRyYXduIG9uY2UgcGVyIHdpbmRvd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5jaGFycG9zID4gMCkKKyAgICAgICAgKytnbHlwaF9lbmQ7CisgICAgICBtY19oZWxwZXIgKHcs IG1hdHJpeCwgcm93LCBnbHlwaF9lbmQgLSAxLCByb3ctPnBpeGVsX3dpZHRoLCAtMSwgdy0+Y3Vy c29yLnksCisgICAgICAgICAgICAgICAgIC0xLCByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEsIHct PmN1cnNvci52cG9zLCAtMSwgLTEsCisgICAgICAgICAgICAgICAgIE1DX1JJR0hUX0ZSSU5HRV9C SVRNQVAsIC0xLCByb3dfcG9zaXRpb24sIGN1cnNvcl9mZywgY3Vyc29yX2JnLAorICAgICAgICAg ICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgZnJvbV93 aGVyZSwgQ0hfQ0FDSEUsCisgICAgICAgICAgICAgICAgIENVUlNPUl9JTkRJQ0FUT1IpOworICAg IH0KKyAgLyogRVhBTVBMRSAoYnVmZmVyLWxvY2FsKTogIChzZXRxIG1jLXJlYWwtZmFrZS1jdXJz b3IgbmlsLyduby8ibm8iKSAqLworICBlbHNlIGlmICghY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAg ICAgICAgICYmIGN1cnNvcl9nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICYmIGN1cnNvcl90eXBl ID09IE1DX05PX0NVUlNPUgorICAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zCisg ICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID49IGhwb3Nfc3RhcnQKKyAgICAgICAgICAgJiYg dy0+Y3Vyc29yLmhwb3MgPCBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGgpCisgICAgeworICAgICAg LyogV2hlbiBhIHVzZXIgaGFzIG5vdCBzcGVjaWZpZWQgYSB2YWx1ZSBmb3IgYG1jLXJlYWwtZmFr ZS1jdXJzb3InLCBvciB0aGUKKyAgICAgIHZhbHVlIGlzIGBub2AgaW4gdGhlIGZvcm0gb2YgYSBz eW1ib2wgb3Igc3RyaW5nLCB0aGVuIHRoZSBkZWZhdWx0IHdlIHVzZQorICAgICAgYW4gTUNfQkFS IGFuZCBhbiBNQ19IQkFSIC0tIGJvdGggaGF2aW5nIGEgY3Vyc29yX3dpZHRoIG9mIDEuICovCisg ICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngs ICZvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg Jm9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQ19CQVIsIDEsICZvcG9pbnRfd2QpOworICAg ICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgY3Vyc29yX2dseXBoLCB3LT5jdXJzb3IueCwg b3BvaW50X2Z4LCB3LT5jdXJzb3IueSwKKyAgICAgICAgICAgICAgICAgb3BvaW50X2Z5LCB3LT5j dXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MsIG9wb2ludF93ZCwgb3BvaW50X2gsCisgICAgICAg ICAgICAgICAgIE1DX0JBUiwgMSwgcm93X3Bvc2l0aW9uLCBjdXJzb3JfZmcsIGN1cnNvcl9iZywg ZXNzZW50aWFscy5hY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgTUNfR0xZUEhMRVNTLCBkcmF3 X3AsIGZyb21fd2hlcmUsIE5JTFAgKEJWQVIgKGIsIG1jX2NvbmYpKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IE1DX0NBQ0hFLCBDVVJTT1JfSU5ESUNBVE9SKTsKKyAgICAgIG1jX2dl dF9jdXJzb3JfZ2VvbWV0cnkgKHcsIG1hdHJpeCwgcm93LCB3LT5jdXJzb3IueCwgJm9wb2ludF9m eCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmb3BvaW50X2Z5 LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MsICZvcG9pbnRfaCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIE1DX0hCQVIsIDEsICZvcG9pbnRfd2QpOworICAgICAgbWNfaGVs cGVyICh3LCBtYXRyaXgsIHJvdywgY3Vyc29yX2dseXBoLCB3LT5jdXJzb3IueCwgb3BvaW50X2Z4 LCB3LT5jdXJzb3IueSwKKyAgICAgICAgICAgICAgICAgb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBv cywgdy0+Y3Vyc29yLnZwb3MsIG9wb2ludF93ZCwgb3BvaW50X2gsCisgICAgICAgICAgICAgICAg IE1DX0hCQVIsIDEsIHJvd19wb3NpdGlvbiwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsIGVzc2VudGlh bHMuYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgIE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hl cmUsIE5JTFAgKEJWQVIgKGIsIG1jX2NvbmYpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IENIX0NBQ0hFCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogTUNfQ0FDSEUsIENVUlNPUl9JTkRJQ0FUT1IpOworICAg IH0KKyAgZWxzZSBpZiAoIWN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAmJiBjdXJzb3Jf Z2x5cGggIT0gTlVMTAorICAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAg ICAgICAgICYmIHctPmN1cnNvci5ocG9zID49IGhwb3Nfc3RhcnQKKyAgICAgICAgICAgJiYgdy0+ Y3Vyc29yLmhwb3MgPCBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGgKKyAgICAgICAgICAgJiYgY3Vy c29yX2dseXBoLT50eXBlICE9IFNUUkVUQ0hfR0xZUEgpCisgICAgeworICAgICAgbWNfZ2V0X2N1 cnNvcl9nZW9tZXRyeSAodywgbWF0cml4LCByb3csIHctPmN1cnNvci54LCAmb3BvaW50X2Z4LCB3 LT5jdXJzb3IueSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZvcG9pbnRfZnksIHct PmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgJm9wb2ludF93ZCk7Cisg ICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1cnNvci54 LCBvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICBvcG9pbnRfZnksIHct PmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgb3BvaW50X3dkLCBvcG9pbnRfaCwKKyAgICAg ICAgICAgICAgICAgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcm93X3Bvc2l0aW9uLCBjdXJz b3JfZmcsIGN1cnNvcl9iZywKKyAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVfcCwg TUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgTklMUCAoQlZB UiAoYiwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAg ICAgICAgOiBNQ19DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgfQorICBlbHNlIGlmICgh Y3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaCAhPSBOVUxMCisg ICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAgICAgJiYgdy0+Y3Vy c29yLmhwb3MgPj0gaHBvc19zdGFydAorICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA8IGhw b3Nfc3RhcnQgKyBocG9zX2xlbmd0aAorICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPnR5cGUg PT0gU1RSRVRDSF9HTFlQSCkKKyAgICB7CisgICAgICAvKiBJZiBhIHVzZXIgaGFzIHNldCBgeC1z dHJldGNoLWN1cnNvcicgdG8gYSBub24tbmlsIHZhbHVlLCBoZS9zaGUgY2hvc2UgdG8KKyAgICAg IGhhdmUgYSBjdXJzb3IgdGhhdCBzcGFucyB0aGUgZW50aXJlIGxlbmd0aCBvZiB0aGUgU1RSRVRD SF9HTFlQSC4gKi8KKyAgICAgIGlmICgheF9zdHJldGNoX2N1cnNvcl9wKQorICAgICAgICB7Cisg ICAgICAgICAgLyogVGhlIE1DX0hCQVIgc2hhbGwgaGF2ZSBhIGBjdXJzb3Jfd2lkdGhgIG9mIDEu ICovCisgICAgICAgICAgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeSAodywgbWF0cml4LCByb3csIHct PmN1cnNvci54LCAmb3BvaW50X2Z4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHctPmN1cnNvci55LCAmb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLCBNQ19IQkFSLCAx LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZvcG9pbnRfd2QpOworICAgICAg ICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngs IG9wb2ludF9meCwKKyAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci55LCBvcG9pbnRfZnks IHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywKKyAgICAgICAgICAgICAgICAgICAgIG9w b2ludF93ZCwgb3BvaW50X2gsIE1DX0hCQVIsIDEsIHJvd19wb3NpdGlvbiwgY3Vyc29yX2ZnLAor ICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX2JnLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBNQ19H TFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICAgICAgTklMUCAoQlZB UiAoYiwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICA/IENIX0NBQ0hFCisgICAgICAg ICAgICAgICAgICAgICA6IE1DX0NBQ0hFLCBDVVJTT1JfSU5ESUNBVE9SKTsKKyAgICAgICAgfQor ICAgICAgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeSAodywgbWF0cml4LCByb3csIHctPmN1cnNvci54 LCAmb3BvaW50X2Z4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLnks ICZvcG9pbnRfZnksIHctPmN1cnNvci5ocG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgdy0+Y3Vyc29yLnZwb3MsICZvcG9pbnRfaCwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsICZvcG9pbnRfd2QpOworICAgICAgbWNfaGVs cGVyICh3LCBtYXRyaXgsIHJvdywgY3Vyc29yX2dseXBoLCB3LT5jdXJzb3IueCwgb3BvaW50X2Z4 LCB3LT5jdXJzb3IueSwKKyAgICAgICAgICAgICAgICAgb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBv cywgdy0+Y3Vyc29yLnZwb3MsIG9wb2ludF93ZCwgb3BvaW50X2gsCisgICAgICAgICAgICAgICAg IGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgY3Vyc29yX2ZnLCBjdXJz b3JfYmcsCisgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBk cmF3X3AsIGZyb21fd2hlcmUsCisgICAgICAgICAgICAgICAgIE5JTFAgKEJWQVIgKGIsIG1jX2Nv bmYpKQorICAgICAgICAgICAgICAgICA/IENIX0NBQ0hFCisgICAgICAgICAgICAgICAgIDogTUNf Q0FDSEUsIENVUlNPUl9JTkRJQ0FUT1IpOworICAgIH0KKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KgorICAgICAgICAgICAgICAgICAgICAgICAgICBEUkFXIEFORCBSRUNPUkQgRkFLRSBDVVJTT1JT CisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAgaWYgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisg ICAgICAmJiBOSUxQIChCVkFSIChiLCBtY19pbmFjdGl2ZV93aW5kb3dzKSkKKyAgICAgICYmIE5J TFAgKEJWQVIgKGIsIGNoX2luYWN0aXZlX3dpbmRvd3MpKQorICAgICAgJiYgTklMUCAoQlZBUiAo YiwgZmNfaW5hY3RpdmVfd2luZG93cykpKQorICAgIHJldHVybjsKKyAgaWYgKGhwb3NfbGVuZ3Ro ID09IDEpCisgICAgeworICAgICAgaWYgKCFOSUxQIChCVkFSIChiLCBtY19jb25mKSkKKyAgICAg ICAgICAmJiAoZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICB8fCAoIWVzc2VudGlh bHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBtY19pbmFj dGl2ZV93aW5kb3dzKSkpKSkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRoZSBzcGFjZSBhcHBl bmRlZCB0byBhIHJvdyBlbmRpbmcgd2l0aCBh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NbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMTsKKyAgICAgICAgICBi b29sIHNraXBfcCA9IChwcmV2aW91c19nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgcHJldmlvdXNfZ2x5cGgtPmNoYXJwb3MgPT0gTUFUUklYX1JPV19FTkRfQ0hBUlBP UyAocm93KSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiBzdGFydC0+Ynl0ZXBvcyAh PSBlc3NlbnRpYWxzLnp2X2J5dGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgID8gdHJ1ZQor ICAgICAgICAgICAgICAgICAgICAgICAgLyogV2hlbiBhIGBidWZmZXItZGlzcGxheS10YWJsZScg ZW50cnkgY29udGFpbnMKKyAgICAgICAgICAgICAgICAgICAgICAgIGEgdmlzaWJsZSB0YWIgY2hh cmFjdGVyICgiwrsiKSwgdGhlIHN1YnNlcXVlbnQKKyAgICAgICAgICAgICAgICAgICAgICAgIFNU UkVUQ0hfR0xZUEggd2lsbCBoYXZlIHRoZSBzYW1lIHN0YXJ0LT5jaGFycG9zCisgICAgICAgICAg ICAgICAgICAgICAgICBhcyB0aGUgYWZvcmVtZW50aW9uZWQgdmlzaWJsZSB0YWIgY2hhcmFjdGVy LiAqLworICAgICAgICAgICAgICAgICAgICAgICAgOiAocHJldmlvdXNfZ2x5cGggIT0gTlVMTAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcHJldmlvdXNfZ2x5cGgtPmNoYXJwb3MgPT0g c3RhcnQtPmNoYXJwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgID8gdHJ1ZQorICAgICAg ICAgICAgICAgICAgICAgICAgOiBmYWxzZTsKKyAgICAgICAgICBpbnQgcG9zaW50ID0gKHJvd19w b3NpdGlvbiA9PSBQT1NUX1pWKQorICAgICAgICAgICAgICAgICAgICAgICAgID8gLTEKKyAgICAg ICAgICAgICAgICAgICAgICAgOiAocm93X3Bvc2l0aW9uID09IEFUX1pWKQorICAgICAgICAgICAg ICAgICAgICAgICAgICA/IGVzc2VudGlhbHMuenYKKyAgICAgICAgICAgICAgICAgICAgICAgOiAo c3RhcnQtPmJ5dGVwb3MgIT0gZXNzZW50aWFscy56dl9ieXRlCisgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbVEVY VF9BUkVBXSAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XX0VORF9D SEFSUE9TIChyb3cpIC0gMQorICAgICAgICAgICAgICAgICAgICAgICA6IChzdGFydC0+Ynl0ZXBv cyA9PSBlc3NlbnRpYWxzLnp2X2J5dGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgc3Rh cnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSkK KyAgICAgICAgICAgICAgICAgICAgICAgICA/IGVzc2VudGlhbHMuenYKKyAgICAgICAgICAgICAg ICAgICAgICAgOiBzdGFydC0+Y2hhcnBvczsKKyAgICAgICAgICBMaXNwX09iamVjdCBzcGVjcyA9 IG1jX2Fzc29jIChtYWtlX2ZpeG51bSAocG9zaW50KSwgQlZBUiAoYiwgbWNfY29uZikpOworICAg ICAgICAgIGlmICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAg ICAgICAgICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAgJiYgIU5J TFAgKHNwZWNzKQorICAgICAgICAgICAgICAmJiByb3ctPnkgPD0gd2luZG93X3RleHRfYm90dG9t X3kgKHcpCisgICAgICAgICAgICAgICYmICFza2lwX3AKKyAgICAgICAgICAgICAgJiYgcm93X3Bv c2l0aW9uICE9IFBPU1RfWlYpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIExpc3BfT2Jq ZWN0IGxpc3BfdHlwZSA9IG1jX250aCAoMSwgc3BlY3MpOworICAgICAgICAgICAgICBlbnVtIG1j X2N1cnNvcl90eXBlIGN1cnNvcl90eXBlID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY19saXNwX3RvX2N1cnNv cl90eXBlIChYQ0FSIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiBtY19saXNwX3RvX2N1cnNvcl90eXBlIChsaXNwX3R5cGUpOwor ICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IChzdGFydC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0hPTExPV19CT1gKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IGN1cnNvcl90eXBlOworICAgICAgICAgICAgICBpbnQgY3Vyc29y X3dpZHRoID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBYRklYTlVNIChYQ0FSIChYQ0RSIChsaXNwX3R5cGUpKSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogLTE7CisgICAgICAgICAgICAgIExpc3BfT2JqZWN0IG1jX2Zv cmVncm91bmQgPSBtY19udGggKDIsIHNwZWNzKTsKKyAgICAgICAgICAgICAgc3RydWN0IG1jX1JH QiBsc2xfZmc7CisgICAgICAgICAgICAgIGlmIChTVFJJTkdQIChtY19mb3JlZ3JvdW5kKSkKKyAg ICAgICAgICAgICAgICBtY194d19jb2xvcl92YWx1ZXMgKHcsIG1jX2ZvcmVncm91bmQsICZsc2xf ZmcpOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKFZFQ1RPUlAgKG1jX2ZvcmVncm91bmQpKQor ICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBsc2xfZmcucmVkID0gWEZM T0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDApKTsKKyAgICAgICAgICAgICAgICAgICAg bHNsX2ZnLmdyZWVuID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDEpKTsKKyAg ICAgICAgICAgICAgICAgICAgbHNsX2ZnLmJsdWUgPSBYRkxPQVRfREFUQSAoQVJFRiAobWNfZm9y ZWdyb3VuZCwgMikpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgZWxz ZSBpZiAoTklMUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAgICAgIG1jX2NvbG9y X3BpY2tlciAodywgc3RhcnQsIGVzc2VudGlhbHMsICZsc2xfZmcsIHBvc2ludCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgcm93X3Bvc2l0aW9uLCBN VUxUSVBMRV9DVVJTT1JTKTsKKyAgICAgICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQ T1MgKHJvdywgbWF0cml4KTsKKyAgICAgICAgICAgICAgaW50IHhfbGltaXQgPSB3aW5kb3dfYm94 X3dpZHRoICh3LCBURVhUX0FSRUEpOworICAgICAgICAgICAgICBtY19lbmdpbmUgKHcsIG1hdHJp eCwgcm93LCBzdGFydCwgVEVYVF9BUkVBLCB4LCB4X2xpbWl0LCByb3ctPnksCisgICAgICAgICAg ICAgICAgICAgICAgICAgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLCB2cG9zLCBjdXJz b3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIGN1cnNvcl9t YXRyaXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAg ICBsc2xfZmcsIE1VTFRJUExFX0NVUlNPUlMsIGRyYXdfcCwgZnJvbV93aGVyZSwgTUNfQ0FDSEUp OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBpZiAoIU5JTFAgKEJWQVIgKGIsIGZj X3Zpc2libGUpKQorICAgICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAg ICAgIHx8ICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgJiYgIU5JTFAg KEJWQVIgKGIsIGZjX2luYWN0aXZlX3dpbmRvd3MpKSkpCisgICAgICAgICAgJiYgZXNzZW50aWFs cy5mY194IDw9IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+ PSB3LT5tYy5sbnVtX3BpeGVsX3dpZHRoKQorICAgICAgICB7CisgICAgICAgICAgaW50IHhfbGlt aXQgPSB4ICsgc3RhcnQtPnBpeGVsX3dpZHRoOworICAgICAgICAgIGJvb2wgcmVhbF9mYWtlX2N1 cnNvcl9wID0gKHctPmN1cnNvci54ID09IGVzc2VudGlhbHMuZmNfeAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci55ID09IHJvdy0+eQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID09IHN0YXJ0IC0g cm93LT5nbHlwaHNbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHctPmN1cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAgIHN0cnVjdCBtY19SR0Ig bHNsX2ZnOworICAgICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywgc3RhcnQsIGVzc2VudGlhbHMs ICZsc2xfZmcsIC0xLCBNQ19CQVIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICByb3dfcG9z aXRpb24sIEZJTExfQ09MVU1OKTsKKyAgICAgICAgICBpZiAoeCArIHN0YXJ0LT5waXhlbF93aWR0 aCA8PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgJiYgKChoZWFkZXJfbGluZV9mb3Jt YXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9y bWF0ID09IDApCisgICAgICAgICAgICAgICYmICgoc3RhcnQgIT0gcm93LT5nbHlwaHNbVEVYVF9B UkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMQorICAgICAgICAgICAgICAgICAgICYmIGVz c2VudGlhbHMuZmNfeCA+PSB4CisgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194 IDwgeCArIHN0YXJ0LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgIHx8IChzdGFydCA9 PSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxCisgICAg ICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID49IHgpKQorICAgICAgICAgICAg ICAmJiByb3ctPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICYm ICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgICAgICBtY19lbmdpbmUgKHcsIG1hdHJpeCwg cm93LCBzdGFydCwgVEVYVF9BUkVBLCB4LCB4X2xpbWl0LCByb3ctPnksCisgICAgICAgICAgICAg ICAgICAgICAgIHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwgdnBvcywgTUNfQkFSLCAx LAorICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCByb3df cG9zaXRpb24sIGxzbF9mZywKKyAgICAgICAgICAgICAgICAgICAgICAgRklMTF9DT0xVTU4sIGRy YXdfcCwgZnJvbV93aGVyZSwgRkNfQ0FDSEUpOworICAgICAgICB9CisgICAgICBpZiAoIU5JTFAg KEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9o b3Jpem9udGFsX3J1bGVyKSkKKyAgICAgICAgICAmJiAoZXNzZW50aWFscy5hY3RpdmVfcAorICAg ICAgICAgICAgICB8fCAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICYm ICFOSUxQIChCVkFSIChiLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkpKQorICAgICAgICAgICYmIHZw b3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgeF9saW1pdCA9 IChzdGFydCA9PSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0g LSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgPyB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAg ICAgICAgICAgICAgICAgIDogeCArIHN0YXJ0LT5waXhlbF93aWR0aDsKKyAgICAgICAgICBzdHJ1 Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICBtY19jb2xvcl9waWNrZXIgKHcsIHN0YXJ0LCBl c3NlbnRpYWxzLCAmbHNsX2ZnLCAtMSwgTUNfSEJBUiwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgIHJvd19wb3NpdGlvbiwgSE9SSVpPTlRBTF9SVUxFUik7CisgICAgICAgICAgLyogUHJlc2Vy dmUgc3VwcG9ydCBmb3IgZGVmYXVsdCBiZWhhdmlvciBzdWNoIHRoYXQgYSB1c2VyIG1heQorICAg ICAgICAgIHNwZWNpZnkgdGhlIGhlaWdodCBvZiBhbiBNQ19IQkFSLCB3aGljaCBiZWdpbnMgaXRz IGpvdXJuZXkKKyAgICAgICAgICBhcyB0aGUgYGN1cnNvcl93aWR0aCcuICBgbWNfZ2V0X2N1cnNv cl9nZW9tZXRyeScgcmVhZGp1c3RzLiAqLworICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4 LCByb3csIHN0YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGltaXQsIHJvdy0+eSwKKyAgICAgICAgICAg ICAgICAgICAgIHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwgdnBvcywgTUNfSEJBUiwg MSwKKyAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIHJvd19w b3NpdGlvbiwgbHNsX2ZnLAorICAgICAgICAgICAgICAgICAgICAgSE9SSVpPTlRBTF9SVUxFUiwg ZHJhd19wLCBmcm9tX3doZXJlLCBDSF9DQUNIRSk7CisgICAgICAgIH0KKyAgICAgIGlmICghTklM UCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNo X3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAmJiAoZXNzZW50aWFscy5hY3RpdmVfcAorICAg ICAgICAgICAgICB8fCAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICYm ICFOSUxQIChCVkFSIChiLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkpKQorICAgICAgICAgICYmICFm aWxsX2NvbHVtbl90cnVtcHNfcCkKKyAgICAgICAgeworICAgICAgICAgIGN1cnNvcl90eXBlID0g KHN0YXJ0LT50eXBlID09IElNQUdFX0dMWVBIKQorICAgICAgICAgICAgICAgICAgICAgICAgPyBN Q19IT0xMT1dfQk9YCisgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0JBUjsKKyAgICAgICAg ICBpbnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAgICAg ICAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3AgPSAody0+Y3Vyc29yLnkgPT0gcm93LT55CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnZwb3MgPT0gdnBv cyk7CisgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgbWNfY29sb3Jf cGlja2VyICh3LCBzdGFydCwgZXNzZW50aWFscywgJmxzbF9mZywgLTEsIGN1cnNvcl90eXBlLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93X3Bvc2l0aW9uLCBWRVJUSUNBTF9SVUxFUik7 CisgICAgICAgICAgaWYgKCgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID4gMCkKKyAg ICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAgICAm JiAoKHN0YXJ0ICE9IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVzZWRbVEVYVF9BUkVB XSAtIDEKKyAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA+PSB4CisgICAgICAgICAg ICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPCB4ICsgc3RhcnQtPnBpeGVsX3dpZHRoKQorICAgICAg ICAgICAgICAgICAgfHwgKHN0YXJ0ID09IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVz ZWRbVEVYVF9BUkVBXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA+ PSB4KSkKKyAgICAgICAgICAgICAgJiYgcm93LT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3 KQorICAgICAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAgICAgbWNf ZW5naW5lICh3LCBtYXRyaXgsIHJvdywgc3RhcnQsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwgcm93 LT55LAorICAgICAgICAgICAgICAgICAgICAgICBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJF QV0sIHZwb3MsIGN1cnNvcl90eXBlLCAxLAorICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jf bWF0cml4LCBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGxzbF9mZywKKyAgICAgICAgICAgICAg ICAgICAgICAgVkVSVElDQUxfUlVMRVIsIGRyYXdfcCwgZnJvbV93aGVyZSwgQ0hfQ0FDSEUpOwor ICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgaW50IHJlbGF0aXZl X3ggPSAwOworICAgICAgICBmb3IgKGludCBhcmVhID0gTEVGVF9NQVJHSU5fQVJFQTsgYXJlYSA8 IExBU1RfQVJFQTsgKythcmVhKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIHN0cnVjdCBnbHlw aCAqZ2x5cGggPSByb3ctPmdseXBoc1thcmVhXTsKKyAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAq Z2x5cGhfZW5kID0gZ2x5cGggKyByb3ctPnVzZWRbYXJlYV07CisgICAgICAgICAgICAvKiBHbHlw aCBmb3IgYSBsaW5lIGVuZCBpbiB0ZXh0LiAqLworICAgICAgICAgICAgaWYgKGFyZWEgPT0gVEVY VF9BUkVBICYmIGdseXBoID09IGdseXBoX2VuZCAmJiBnbHlwaC0+Y2hhcnBvcyA+IDApCisgICAg ICAgICAgICAgICsrZ2x5cGhfZW5kOworICAgICAgICAgICAgZm9yICg7IGdseXBoIDwgZ2x5cGhf ZW5kOyArK2dseXBoKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKHZwb3Mg IT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGggIT0gZ2x5cGhf ZW5kIC0gMQorICAgICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPCByZWxhdGl2 ZV94CisgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54IDwgcmVsYXRpdmVfeAorICAg ICAgICAgICAgICAgICAgICAmJiBOSUxQIChCVkFSIChiLCBtY19jb25mKSkpCisgICAgICAgICAg ICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKGIsIG1jX2Nv bmYpKQorICAgICAgICAgICAgICAgICAgICAmJiAoZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAg ICAgICAgICAgICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIG1jX2luYWN0aXZlX3dpbmRvd3MpKSkp KQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvKiBUaGUgc3BhY2Ug YXBwZW5kZWQgdG8gYSByb3cgZW5kaW5nIHdpdGggYSBuZXcgbGluZSBkb2VzCisgICAgICAgICAg ICAgICAgICAgIG5vdCBoYXZlIGEgYGdseXBoLT5jaGFycG9zYCAoLTEsIDApIHRoYXQgd2UgY2Fu IHVzZSBmb3IgdGhpcworICAgICAgICAgICAgICAgICAgICBwYXJ0aWN1bGFyIGFwcGxpY2F0aW9u LiAgV2hlbiBhIGBidWZmZXItZGlzcGxheS10YWJsZScgZW50cnkKKyAgICAgICAgICAgICAgICAg ICAgYXNzaWducyBhIHZpc2libGUgZ2x5cGggdG8gYSBuZXcgbGluZSwgdGhlcmUgaXMgbm8gcHJv YmxlbQorICAgICAgICAgICAgICAgICAgICBiZWNhdXNlIHRoYXQgZ2x5cGggaGFzIGEgYGdseXBo LT5jaGFycG9zJyB0aGF0IHdlIGNhbiB1c2UuCisgICAgICAgICAgICAgICAgICAgIFdoZW4gbm8g dmlzaWJsZSBFT0wgZ2x5cGggZXhpc3RzLCB3ZSB1c2UgdGhlIGZvbGxvd2luZyB0ZXN0OgorICAg ICAgICAgICAgICAgICAgICB0aGUgYXBwZW5kZWQgc3BhY2UgaGFzIGEgcG9zaXRpb24gdGhhdCBp cyBvbmUgbGVzcyB0aGFuIHRoZQorICAgICAgICAgICAgICAgICAgICBlbmQgb2YgdGhlIG1hdHJp eCByb3cuICovCisgICAgICAgICAgICAgICAgICAgIGludCBocG9zID0gZ2x5cGggLSByb3ctPmds eXBoc1tURVhUX0FSRUFdOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnByZXZp b3VzX2dseXBoID0gKDAgPD0gaHBvcyAtIDEgJiYgaHBvcyAtIDEgPCByb3ctPnVzZWRbVEVYVF9B UkVBXSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIGhwb3MgLSAxCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgICAgICAgICAgICAgICAg ICAgIC8vIHN0cnVjdCBnbHlwaCAqbGFzdF9nbHlwaCA9IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0g KyByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDE7CisgICAgICAgICAgICAgICAgICAgIGJvb2wgc2tp cF9wID0gKHByZXZpb3VzX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgcHJldmlvdXNfZ2x5cGgtPmNoYXJwb3MgPT0gTUFUUklYX1JPV19FTkRfQ0hB UlBPUyAocm93KSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5 cGgtPmJ5dGVwb3MgIT0gZXNzZW50aWFscy56dl9ieXRlKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyB0cnVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg LyogV2hlbiBhIGBidWZmZXItZGlzcGxheS10YWJsZScgZW50cnkgY29udGFpbnMKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBhIHZpc2libGUgdGFiIGNoYXJhY3RlciAoIsK7Iiks IHRoZSBzdWJzZXF1ZW50CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU1RSRVRD SF9HTFlQSCB3aWxsIGhhdmUgdGhlIHNhbWUgZ2x5cGgtPmNoYXJwb3MKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBhcyB0aGUgYWZvcmVtZW50aW9uZWQgdmlzaWJsZSB0YWIgY2hh cmFjdGVyLiAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKHByZXZpb3Vz X2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBw cmV2aW91c19nbHlwaC0+Y2hhcnBvcyA9PSBnbHlwaC0+Y2hhcnBvcykKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gdHJ1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIGludCBwb3NpbnQgPSAocm93X3Bv c2l0aW9uID09IFBPU1RfWlYpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g LTEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKHJvd19wb3NpdGlvbiA9PSBB VF9aVikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZXNzZW50aWFscy56 dgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGgtPmJ5dGVwb3MgIT0g ZXNzZW50aWFscy56dl9ieXRlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW1RFWFRfQVJFQV0g LSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1BVFJJWF9ST1dfRU5E X0NIQVJQT1MgKHJvdykgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChn bHlwaC0+Ynl0ZXBvcyA9PSBlc3NlbnRpYWxzLnp2X2J5dGUKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ct PnVzZWRbVEVYVF9BUkVBXSAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gZXNzZW50aWFscy56dgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBnbHlw aC0+Y2hhcnBvczsKKyAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3Qgc3BlY3MgPSBtY19h c3NvYyAobWFrZV9maXhudW0gKHBvc2ludCksIEJWQVIgKGIsIG1jX2NvbmYpKTsKKyAgICAgICAg ICAgICAgICAgICAgaWYgKCgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID4gMCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChzcGVjcykKKyAgICAgICAgICAgICAgICAgICAg ICAgICYmIHJvdy0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAgICAg ICAgICAgICAgICYmICFza2lwX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvd19wb3Np dGlvbiAhPSBQT1NUX1pWKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg ICAgICAgICAgIExpc3BfT2JqZWN0IGxpc3BfdHlwZSA9IG1jX250aCAoMSwgc3BlY3MpOworICAg ICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSA9IChD T05TUCAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKFhDQVIgKGxpc3Bf dHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOiBtY19saXNwX3RvX2N1cnNvcl90eXBlIChsaXNwX3R5cGUpOworICAgICAgICAg ICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUgPSAoZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfSE9MTE9XX0JPWAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGN1cnNvcl90eXBlOworICAg ICAgICAgICAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aCA9IChDT05TUCAobGlzcF90eXBl KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFhGSVhOVU0g KFhDQVIgKFhDRFIgKGxpc3BfdHlwZSkpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogLTE7CisgICAgICAgICAgICAgICAgICAgICAgICBMaXNwX09iamVjdCBt Y19mb3JlZ3JvdW5kID0gbWNfbnRoICgyLCBzcGVjcyk7CisgICAgICAgICAgICAgICAgICAgICAg ICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChTVFJJ TkdQIChtY19mb3JlZ3JvdW5kKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgbWNfeHdfY29s b3JfdmFsdWVzICh3LCBtY19mb3JlZ3JvdW5kLCAmbHNsX2ZnKTsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgZWxzZSBpZiAoVkVDVE9SUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNsX2ZnLnJl ZCA9IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3JvdW5kLCAwKSk7CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBsc2xfZmcuZ3JlZW4gPSBYRkxPQVRfREFUQSAoQVJFRiAobWNfZm9y ZWdyb3VuZCwgMSkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNsX2ZnLmJsdWUg PSBYRkxPQVRfREFUQSAoQVJFRiAobWNfZm9yZWdyb3VuZCwgMikpOworICAgICAgICAgICAgICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChOSUxQ IChtY19mb3JlZ3JvdW5kKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2NvbG9y X3BpY2tlciAodywgZ2x5cGgsIGVzc2VudGlhbHMsICZsc2xfZmcsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2ludCwgY3Vyc29yX3R5cGUsIHJvd19w b3NpdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg TVVMVElQTEVfQ1VSU09SUyk7CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgdnBvcyA9IE1B VFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAgICAgICAgICAgICAgICAgICAgICAgaW50 IHhfbGltaXQgPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOworICAgICAgICAgICAg ICAgICAgICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIGFyZWEsIHJlbGF0 aXZlX3gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHhfbGltaXQsIHJvdy0+ eSwgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICB2cG9zLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBjdXJzb3JfbWF0 cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLCByb3df cG9zaXRpb24sIGxzbF9mZywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTVVM VElQTEVfQ1VSU09SUywgZHJhd19wLCBmcm9tX3doZXJlLCBNQ19DQUNIRSk7CisgICAgICAgICAg ICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICgh TklMUCAoQlZBUiAoYiwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgICAgICAgICAgICYmIChlc3Nl bnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICB8fCAoIWVzc2VudGlhbHMu YWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwg ZmNfaW5hY3RpdmVfd2luZG93cykpKSkKKyAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFs cy5mY194IDw9IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAmJiBlc3NlbnRp YWxzLmZjX3ggPj0gdy0+bWMubG51bV9waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgICAgaW50IHhfbGltaXQgPSB3aW5kb3dfYm94X3dpZHRoICh3LCBU RVhUX0FSRUEpOworICAgICAgICAgICAgICAgICAgICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9 ICh3LT5jdXJzb3IueCA9PSBlc3NlbnRpYWxzLmZjX3gKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnkgPT0gcm93LT55CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9z ID09IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IudnBvcyA9PSB2cG9zKTsKKyAg ICAgICAgICAgICAgICAgICAgaW50IGhwb3MgPSBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJF QV07CisgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAgICAgICAg ICAgICAgICAgICBtY19jb2xvcl9waWNrZXIgKHcsIGdseXBoLCBlc3NlbnRpYWxzLCAmbHNsX2Zn LCAtMSwgTUNfQkFSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvd19w b3NpdGlvbiwgRklMTF9DT0xVTU4pOworICAgICAgICAgICAgICAgICAgICBpZiAoaHBvcyA+PSBo cG9zX3N0YXJ0CisgICAgICAgICAgICAgICAgICAgICAgICAmJiBocG9zIDwgaHBvc19zdGFydCAr IGhwb3NfbGVuZ3RoCisgICAgICAgICAgICAgICAgICAgICAgICAmJiByZWxhdGl2ZV94ICsgZ2x5 cGgtPnBpeGVsX3dpZHRoIDw9IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAg ICAgJiYgKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAg ICAgICAgICAgICAgJiYgKChnbHlwaCAhPSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSByZWxhdGl2ZV94CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA8IHJlbGF0aXZlX3ggKyBnbHlw aC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKGdseXBoID09 IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50 aWFscy5mY194ID49IHJlbGF0aXZlX3gpKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93 LT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAgICAgICAgICAgICAgICAgICAg JiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgICAgICAgICAgICBtY19lbmdpbmUg KHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgYXJlYSwgcmVsYXRpdmVfeCwgeF9saW1pdCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvdy0+eSwgaHBvcywgdnBvcywgTUNfQkFSLCAx LCBjdXJzb3JfbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50 aWFscywgcm93X3Bvc2l0aW9uLCBsc2xfZmcsIEZJTExfQ09MVU1OLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgZHJhd19wLCBmcm9tX3doZXJlLCBGQ19DQUNIRSk7CisgICAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKCFOSUxQIChCVkFSIChiLCBjcm9zc2hh aXJzKSkKKyAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2hvcml6b250 YWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAmJiAoZXNzZW50aWFscy5hY3RpdmVfcAor ICAgICAgICAgICAgICAgICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2luYWN0aXZlX3dpbmRv d3MpKSkpCisgICAgICAgICAgICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisg ICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gd2lu ZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgICAgICAgICAgaW50IGhw b3MgPSBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICAgICAgICAgICAgICAg IHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAgICAgICAgICAgICAgICAgICBtY19jb2xvcl9waWNr ZXIgKHcsIGdseXBoLCBlc3NlbnRpYWxzLCAmbHNsX2ZnLCAtMSwgTUNfSEJBUiwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb3dfcG9zaXRpb24sIEhPUklaT05UQUxfUlVM RVIpOworICAgICAgICAgICAgICAgICAgICAvKiBQcmVzZXJ2ZSBzdXBwb3J0IGZvciBkZWZhdWx0 IGJlaGF2aW9yIHN1Y2ggdGhhdCBhIHVzZXIgbWF5CisgICAgICAgICAgICAgICAgICAgIHNwZWNp ZnkgdGhlIGhlaWdodCBvZiBhbiBNQ19IQkFSLCB3aGljaCBiZWdpbnMgaXRzIGpvdXJuZXkKKyAg ICAgICAgICAgICAgICAgICAgYXMgdGhlIGBjdXJzb3Jfd2lkdGgnLiAgYG1jX2dldF9jdXJzb3Jf Z2VvbWV0cnknIHJlYWRqdXN0cy4gKi8KKyAgICAgICAgICAgICAgICAgICAgaWYgKGhwb3MgPj0g aHBvc19zdGFydAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA8IGhwb3Nfc3RhcnQg KyBocG9zX2xlbmd0aCkKKyAgICAgICAgICAgICAgICAgICAgICBtY19lbmdpbmUgKHcsIG1hdHJp eCwgcm93LCBnbHlwaCwgYXJlYSwgcmVsYXRpdmVfeCwgeF9saW1pdCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHJvdy0+eSwgaHBvcywgdnBvcywgTUNfSEJBUiwgMSwgY3Vyc29y X21hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMsIHJv d19wb3NpdGlvbiwgbHNsX2ZnLCBIT1JJWk9OVEFMX1JVTEVSLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgZHJhd19wLCBmcm9tX3doZXJlLCBDSF9DQUNIRSk7CisgICAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKCFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJz KSkKKyAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1 bGVyKSkKKyAgICAgICAgICAgICAgICAgICAgJiYgKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAg ICAgICAgICAgICAgICAgICAgIHx8ICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkp KQorICAgICAgICAgICAgICAgICAgICAmJiAhZmlsbF9jb2x1bW5fdHJ1bXBzX3ApCisgICAgICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlID0gKGdseXBoLT50 eXBlID09IElNQUdFX0dMWVBIKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g TUNfSE9MTE9XX0JPWAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfQkFS OworICAgICAgICAgICAgICAgICAgICBpbnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGggKHcs IFRFWFRfQVJFQSk7CisgICAgICAgICAgICAgICAgICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9w ID0gKHctPmN1cnNvci55ID09IHJvdy0+eQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IudnBvcyA9PSB2cG9zKTsKKyAgICAgICAgICAg ICAgICAgICAgaW50IGhwb3MgPSBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAg ICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAgICAgICAgICAgICAgICAg ICBtY19jb2xvcl9waWNrZXIgKHcsIGdseXBoLCBlc3NlbnRpYWxzLCAmbHNsX2ZnLCAtMSwgY3Vy c29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93X3Bvc2l0 aW9uLCBWRVJUSUNBTF9SVUxFUik7CisgICAgICAgICAgICAgICAgICAgIGlmIChocG9zID49IGhw b3Nfc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIGhwb3MgPCBocG9zX3N0YXJ0ICsg aHBvc19sZW5ndGgKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICgoaGVhZGVyX2xpbmVfZm9y bWF0ID4gMCAmJiB2cG9zID4gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBoZWFk ZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICgoZ2x5cGgg IT0gZ2x5cGhfZW5kIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJz b3IueCA+PSByZWxhdGl2ZV94CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1 cnNvci54IDwgcmVsYXRpdmVfeCArIGdseXBoLT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICB8fCAoZ2x5cGggPT0gZ2x5cGhfZW5kIC0gMQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA+PSByZWxhdGl2ZV94KSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICYmIHJvdy0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAg ICAgICAgICAgICAgICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgICAg ICAgICAgICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIGFyZWEsIHJlbGF0 aXZlX3gsIHhfbGltaXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb3ctPnks IGhwb3MsIHZwb3MsIGN1cnNvcl90eXBlLCAxLCBjdXJzb3JfbWF0cml4LAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBsc2xfZmcsIFZF UlRJQ0FMX1JVTEVSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhd19wLCBm cm9tX3doZXJlLCBDSF9DQUNIRSk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAg ICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgIH0KKyAg ICAgICAgICB9CisgICAgICB9CisgIC8vICBjbG9ja190IGNsb2NrX2VuZCA9IGNsb2NrKCk7Cisg IC8vICBkb3VibGUgY3B1X3RpbWVfdXNlZCA9ICgoZG91YmxlKSAoY2xvY2tfZW5kIC0gY2xvY2tf c3RhcnQpKSAvIENMT0NLU19QRVJfU0VDOworICAvLyAgZnByaW50ZiAoc3RkZXJyLCAibWNfZHJh d19yb3cgKCVzKTogIFRJTUUgKCVmKVxuIiwgbWNfd2luZG93ICh3KSwgY3B1X3RpbWVfdXNlZCk7 Cit9CisKK2Jvb2wKK21jX3JlZHJhd19yb3cgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlw aF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAgICAg ZW51bSBnbHlwaF9yb3dfYXJlYSBhcmVhLCBpbnQgc3RhcnRfeCwgaW50IH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gc3RhcnRfaHBv cykKKyAgICB7CisgICAgICAvKiBBZHZhbmNlIHRoZSBvdXRwdXQgY3Vyc29yLiAqLworICAgICAg dy0+b3V0cHV0X2N1cnNvci5ocG9zID0gZW5kX2hwb3M7CisgICAgICB3LT5vdXRwdXRfY3Vyc29y LnggPSB4OworICAgICAgRlJBTUVfUklGIChmKS0+Y2xlYXJfZW5kX29mX2xpbmUgKHcsIHJvdywg VEVYVF9BUkVBLCAtMSk7CisgICAgfQorICAvLyAgY2xvY2tfc3RhcnQgPSBjbG9jaygpOworICBp bnQgdm50aCA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAvKiBTVFJFVENIX0dM WVBIIG1heSBjb250YWluIG1vcmUgdGhhbiBvbmUgZmFrZSBjdXJzb3IgYXQgdGhlIHNhbWUgSFBP Uy4gKi8KKyAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOwor ICAgICAgIGNhY2hlX3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICArK2NhY2hlX3R5cGUpCisgICAg eworICAgICAgZm9yIChpbnQgbnRoID0gMDsKKyAgICAgICAgICAgbWNfdHJhdmVyc2VfY2FjaGVf cCAody0+bWNfbWF0cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGgpOworICAgICAgICAgICArK250 aCkKKyAgICAgICAgeworICAgICAgICAgIGludCB4ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXS54OworICAgICAgICAgIGludCBmeCA9IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZng7CisgICAgICAgICAgaW50IHkg PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLnk7CisgICAg ICAgICAgaW50IGZ5ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXS5meTsKKyAgICAgICAgICBpbnQgaHBvcyA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF0uaHBvczsKKyAgICAgICAgICBpbnQgdnBvcyA9IHctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0udnBvczsKKyAgICAgICAgICBp bnQgd2QgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLndk OworICAgICAgICAgIGludCBoID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXS5oOworICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUg PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmN1cnNvcl90 eXBlOworICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGggPSB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmN1cnNvcl93aWR0aDsKKyAgICAgICAgICBzdHJ1Y3Qg bWNfUkdCIGxzbF9mZyA9IHsucmVkID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXS5mZy5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg LmdyZWVuID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5m Zy5ncmVlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZmcuYmx1ZX07CisgICAg ICAgICAgLy8gIHN0cnVjdCBtY19SR0IgbHNsX2JnID0gey5yZWQgPSB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLnJlZCwKKyAgICAgICAgICAvLyAgICAg ICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXS5iZy5ncmVlbiwKKyAgICAgICAgICAvLyAgICAgICAgICAgICAg ICAgICAgICAgICAgLmJsdWUgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhdLmJnLmJsdWV9OworICAgICAgICAgIGJvb2wgYWN0aXZlX3AgPSB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmFjdGl2ZV9wOworICAgICAgICAg IGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGhfZmxhdm9yOworICAgICAgICAgIGJvb2wgZW5hYmxl ZF9wID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFi bGVkX3A7CisgICAgICAgICAgaWYgKHZwb3MgPT0gdm50aAorICAgICAgICAgICAgICAmJiAoKGhw b3MgPj0gc3RhcnRfaHBvcworICAgICAgICAgICAgICAgICAgICYmIGhwb3MgPCBlbmRfaHBvcykK KyAgICAgICAgICAgICAgICAgIC8qIEEgZmxvYXRpbmcgY3Vyc29yIGJleW9uZCB0aGUgZW5kIG9m IHRoZSBnbHlwaCByb3cuICovCisgICAgICAgICAgICAgICAgICB8fCAoaHBvcyArIDEgPT0gc3Rh cnRfaHBvcworICAgICAgICAgICAgICAgICAgICAgICYmIGhwb3MgKyAxID09IGVuZF9ocG9zKSkK KyAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAg ICBib29sIHJlbW92ZV9wID0gZmFsc2U7CisgICAgICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHli cmlkICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lk dGgsIGxzbF9mZywgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBnbHlwaF9mbGF2b3IsIHJlbW92ZV9wKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAg IH0KKyAgcmV0dXJuIHRydWU7CisgIC8vICBjbG9ja19lbmQgPSBjbG9jaygpOworICAvLyAgZG91 YmxlIHRpbWVfY3Vyc29ycyA9ICgoZG91YmxlKSAoY2xvY2tfZW5kIC0gY2xvY2tfc3RhcnQpKSAv IENMT0NLU19QRVJfU0VDOworICAvLyAgZnByaW50ZiAoc3RkZXJyLCAibWNfcmVkcmF3X3JvdyAo JWQpOiAgaHBvcyAoJWQvJWQpIHwgZ2x5cGhzICglZikgfCBjdXJzb3JzICglZilcbiIsCisgIC8v ICAgICAgICAgICAgICAgICAgIHZwb3MsIHN0YXJ0X2hwb3MsIGVuZF9ocG9zLCB0aW1lX2dseXBo cywgdGltZV9jdXJzb3JzKTsKK30KKwordm9pZAorbWNfZXJhc2Vfcm93IChzdHJ1Y3Qgd2luZG93 ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdykK K3sKKyAgaW50IHZudGggPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgaWYgKHRy YWNlX3JlZGlzcGxheV9wKQorICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX2VyYXNlX3JvdyAoJXMp OiAgdnBvcyAoJWQpXG4iLCBtY193aW5kb3cgKHcpLCB2bnRoKTsKKyAgLy8gIGlmICh0cmFjZV9y ZWRpc3BsYXlfcCkKKyAgLy8gICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZXJhc2VfaGVscGVyICgl cyk6ICBjYWNoZSAoJXMpIHwgdnBvcyAoJWQpXG4iLAorICAvLyAgICAgIG1jX3dpbmRvdyAodyks IG1jX2NhY2hlX3R5cGVfdG9fc3RyaW5nIChjYWNoZV90eXBlKSwgdm50aCk7CisgIGZvciAoZW51 bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICBjYWNoZV90eXBl IDwgTk9fQ0FDSEU7CisgICAgICAgKytjYWNoZV90eXBlKQorICAgIHsKKyAgICAgIGZvciAoaW50 IG50aCA9IDA7CisgICAgICAgICAgIG1jX3RyYXZlcnNlX2NhY2hlX3AgKHctPm1jX21hdHJpeCwg Y2FjaGVfdHlwZSwgdm50aCwgbnRoKTsKKyAgICAgICAgICAgKytudGgpCisgICAgICAgIHsKKyAg ICAgICAgICBpbnQgeCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF0ueDsKKyAgICAgICAgICBpbnQgZnggPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhdLmZ4OworICAgICAgICAgIGludCB5ID0gdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS55OworICAgICAgICAgIGludCBmeSA9IHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZnk7CisgICAgICAg ICAgaW50IGhwb3MgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLmhwb3M7CisgICAgICAgICAgaW50IHZwb3MgPSB3LT5t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W4gPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLmJnLmdyZWVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVl ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5iZy5ibHVl fTsKKyAgICAgICAgICBib29sIGFjdGl2ZV9wID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXS5hY3RpdmVfcDsKKyAgICAgICAgICBlbnVtIG1jX2ZsYXZvciBn bHlwaF9mbGF2b3IgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLmdseXBoX2ZsYXZvcjsKKyAgICAgICAgICBib29sIGVuYWJsZWRfcCA9IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZW5hYmxlZF9wOworICAgICAgICAg IC8qIGBtYXRyaXhfcm93JyBpbiBgZGlzcG5ldy5jYCBjb250YWlucyB0aGUgZm9sbG93aW5nIHRl c3RzLAorICAgICAgICAgIGVhc3NlcnQgKG1hdHJpeCAmJiBtYXRyaXgtPnJvd3MpOworICAgICAg ICAgIGVhc3NlcnQgKHJvdyA+PSAwICYmIHJvdyA8IG1hdHJpeC0+bnJvd3MpOyAqLworICAgICAg ICAgIGJvb2wgYmFyZl9jcmFzaF9vbmUgPSAobWF0cml4ICYmIG1hdHJpeC0+cm93cykgPyBmYWxz ZSA6IHRydWU7CisgICAgICAgICAgaWYgKGJhcmZfY3Jhc2hfb25lKQorICAgICAgICAgICAgY29u dGludWU7CisgICAgICAgICAgYm9vbCBiYXJmX2NyYXNoX3R3byA9ICh2cG9zID49IDAgJiYgdnBv cyA8IG1hdHJpeC0+bnJvd3MpID8gZmFsc2UgOiB0cnVlOworICAgICAgICAgIGlmIChiYXJmX2Ny YXNoX3R3bykKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgIGlmICh2cG9zID09IHZu dGgKKyAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBICisgICAgICAgICAg ICAgICYmIGVuYWJsZWRfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbWNfZXJhc2Vf Y3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgeSwgaHBvcywgdnBvcywgZ2x5cGhfZmxhdm9yLCBj dXJzb3JfdHlwZSwgd2QpOworICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLmVuYWJsZWRfcCA9IGZhbHNlOworICAgICAgICAgICAgICAt LXctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVfdHlwZV07CisgICAgICAgICAgICB9Cisg ICAgICAgICAgICBlbHNlIGlmICh2cG9zID09IHZudGgKKyAgICAgICAgICAgICAgICAgICAgICYm IGVuYWJsZWRfcCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGJvb2wgcmVtb3Zl X3AgPSB0cnVlOworICAgICAgICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCBtYXRy aXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgbHNsX2Jn LCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGhf Zmxhdm9yLCByZW1vdmVfcCk7CisgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFibGVkX3AgPSBmYWxzZTsKKyAgICAgICAgICA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QgbnJvd3Nfc2Ny b2xsZWQsIGVudW0gbWNfcHJlX3Njcm9sbF9jbGVhbl90eXBlIGZyb21fd2hlcmUpCit7CisgIGlm IChNSU5JX1dJTkRPV19QICh3KSkKKyAgICByZXR1cm47CisgIGJvb2wgZ29fb25lX3AgPSAody0+ bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtNQ19DQUNIRV0gPiAwCisgICAgICAgICAgICAgICAgICAg fHwgdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtDSF9DQUNIRV0gPiAwCisgICAgICAgICAgICAg ICAgICAgfHwgdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtGQ19DQUNIRV0gPiAwKTsKKyAgYm9v bCBnb190d29fcCA9IChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICAm JiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAg ICAgICAgICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGZjX3Zpc2libGUpKQorICAgICAgICAgICAgICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJV RkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkpKTsKKyAgaWYgKHRyYWNlX3JlZGlzcGxheV9w KQorICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX3ByZV9zY3JvbGxfY2xlYW4gKCVzKTpcblwKKyAg JXMgfCBnb19vbmVfcCAoJXMpIHwgZ29fdHdvX3AgKCVzKVxuXAorICBzdGFydF92cG9zICglZCkg fCBucm93c19zY3JvbGxlZCAoJWQpXG5cCisgICVzOiAgcnVuLmN1cnJlbnQvZGVzaXJlZF95ICgl ZC8lZCkgfCBydW4uaGVpZ2h0ICglZClcbiIsCisgICAgbWNfd2luZG93ICh3KSwgKGZyb21fd2hl cmUgPT0gVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX0RPV04pCisgICAgICAgICAg ICAgICAgICAgICA/ICJUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfRE9XTiIKKyAg ICAgICAgICAgICAgICAgICA6IChmcm9tX3doZXJlID09IFRSWV9XSU5ET1dfUkVVU0lOR19DVVJS RU5UX01BVFJJWF9VUCkKKyAgICAgICAgICAgICAgICAgICAgID8gIlRSWV9XSU5ET1dfUkVVU0lO R19DVVJSRU5UX01BVFJJWF9VUCIKKyAgICAgICAgICAgICAgICAgICA6IChmcm9tX3doZXJlID09 IFRSWV9XSU5ET1dfSUQpCisgICAgICAgICAgICAgICAgICAgICA/ICJUUllfV0lORE9XX0lEIgor ICAgICAgICAgICAgICAgICAgIDogIlVOS05PV04iLAorICAgIGdvX29uZV9wID8gInllcyIgOiAi bm8iLCBnb190d29fcCA/ICJ5ZXMiIDogIm5vIiwKKyAgICBzdGFydF92cG9zLCBucm93c19zY3Jv bGxlZCwKKyAgICBydW4uY3VycmVudF95IDwgcnVuLmRlc2lyZWRfeSA/ICLihpMiIDogIuKGkSIs CisgICAgcnVuLmN1cnJlbnRfeSwgcnVuLmRlc2lyZWRfeSwgcnVuLmhlaWdodCk7CisgIGlmICgh Z29fb25lX3AgJiYgIWdvX3R3b19wKQorICAgIHJldHVybjsKKyAgYm9vbCB1cGRhdGluZ19mcmFt ZV9wID0gZmFsc2U7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBp ZiAoWEZSQU1FICh3LT5mcmFtZSkgIT0gZi0+bWNfdXBkYXRpbmdfZnJhbWUKKyAgICAgICYmIChn b19vbmVfcCB8fCBnb190d29fcCkpCisgICAgeworICAgICAgdXBkYXRpbmdfZnJhbWVfcCA9IHRy dWU7CisgICAgICB1cGRhdGVfYmVnaW4gKGYpOworICAgIH0KKyAgaWYgKHctPnBoeXNfY3Vyc29y X29uX3AKKyAgICAgICYmIGdvX3R3b19wKQorICAgIGVyYXNlX3BoeXNfY3Vyc29yICh3KTsKKyAg c3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgIGZvciAo aW50IHZudGggPSBzdGFydF92cG9zOworICAgICAgIG1hdHJpeCAhPSBOVUxMCisgICAgICAgJiYg dm50aCA8IG1hdHJpeC0+bnJvd3MKKyAgICAgICAmJiBNQVRSSVhfUk9XIChtYXRyaXgsIHZudGgp LT5lbmFibGVkX3AKKyAgICAgICAmJiBnb19vbmVfcDsKKyAgICAgICArK3ZudGgpCisgICAgewor ICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93ID0gTUFUUklYX1JPVyAobWF0cml4LCB2bnRoKTsK KyAgICAgIG1jX2VyYXNlX3JvdyAodywgbWF0cml4LCByb3cpOworICAgIH0KKyAgaWYgKHVwZGF0 aW5nX2ZyYW1lX3ApCisgICAgdXBkYXRlX2VuZCAoZik7CisgIC8vIG1jX3Jlc2V0X2NhY2hlICh3 KTsKK30KKworREVGVU4gKCJtYy1zdGRlcnIiLCBGbWNfc3RkZXJyLCBTbWNfc3RkZXJyLCAwLCAx LCAiUCIsCisgICAgICAgZG9jOiAvKiBUb2dnbGUgdHJhY2luZyBvZiBtdWx0aXBsZSBmYWtlIGN1 cnNvcnMuCitXaXRoIEFSRywgdHVybiB0cmFjaW5nIG9uIGlmIGFuZCBvbmx5IGlmIEFSRyBpcyBw b3NpdGl2ZS4gKi8pCisgIChMaXNwX09iamVjdCBhcmcpCit7CisgIGlmIChOSUxQIChhcmcpKQor ICAgIG1jX3N0ZGVycl9wID0gIW1jX3N0ZGVycl9wOworICBlbHNlCisgICAgeworICAgICAgYXJn ID0gRnByZWZpeF9udW1lcmljX3ZhbHVlIChhcmcpOworICAgICAgbWNfc3RkZXJyX3AgPSBYRklY TlVNIChhcmcpID4gMDsKKyAgICB9CisgIHJldHVybiBRbmlsOworfQorCisvKiBlbmQgTVVMVElQ TEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogDAogLyoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqCiAJCSAgICAgIFdpbmRvdyBkaXNwbGF5IGRpbWVuc2lvbnMKQEAgLTEzNTExLDYgKzE4 MzU1LDY5IEBAIGhzY3JvbGxfd2luZG93X3RyZWUgKExpc3BfT2JqZWN0IHdpbmRvdykKIAkgICAg ICBlbHNlCiAJCXB0ID0gY2xpcF90b19ib3VuZHMgKEJFR1YsIG1hcmtlcl9wb3NpdGlvbiAody0+ cG9pbnRtKSwgWlYpOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4gTVVM VElQTEUtQ1VSU09SUyAqLworCisvKiAoZ2RiKSBidAorIzAgIHRlcm1pbmF0ZV9kdWVfdG9fc2ln bmFsIChzaWc9NiwgYmFja3RyYWNlX2xpbWl0PTIxNDc0ODM2NDcpIGF0IGVtYWNzLmM6MzU5Cisj MSAgMHgwMDAwMDAwMTAwMWVlOTk2IGluIGRpZSAoCisgICAgbXNnPTB4MTAwMzJmYzg4ICJjaGFy cG9zIDwgMCB8fCAoY2hhcnBvcyA+PSBCVUZfQkVHIChjdXJyZW50X2J1ZmZlcikgJiYgY2hhcnBv cyA8PSBaVikiLCBmaWxlPTB4MTAwMzJlMzJkICJ4ZGlzcC5jIiwgbGluZT03OTUxKSBhdCBhbGxv Yy5jOjcyMTQKKyMyICAweDAwMDAwMDAxMDAwNGQyYWIgaW4gaW5pdF9pdGVyYXRvciAoaXQ9MHg3 ZmZmNWZiZjllODAsIHc9MHgxMWFlNjIxNTAsCisgICAgY2hhcnBvcz03NDMsIGJ5dGVwb3M9NzQz LCByb3c9MHgwLCBiYXNlX2ZhY2Vf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wgYmFyZl9jcmFzaF9vbmUgPSAoY2hhcnBvcyA8IDAK KyAgICAgICAgICAgICAgICAgICAgICAgICB8fCAoY2hhcnBvcyA+PSBCVUZfQkVHIChjdXJyZW50 X2J1ZmZlcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY2hhcnBvcyA8PSBaVikp CisgICAgICAgICAgICAgICAgICAgICAgICA/IGZhbHNlCisgICAgICAgICAgICAgICAgICAgICAg ICA6IHRydWU7CisgIGlmIChiYXJmX2NyYXNoX29uZSkKKyAgICByZXR1cm4gaHNjcm9sbGVkX3A7 CisKKyAgLyogYHJlc2VhdF8xJzogIENIQVJQT1MgKHBvcykgPj0gQkVHViAmJiBDSEFSUE9TIChw b3MpIDw9IFpWICovCisgIGJvb2wgYmFyZl9jcmFzaF90d28gPSAoY2hhcnBvcyA+PSBCRUdWICYm IGNoYXJwb3MgPD0gWlYpCisgICAgICAgICAgICAgICAgICAgICAgICAgPyBmYWxzZQorICAgICAg ICAgICAgICAgICAgICAgICAgIDogdHJ1ZTsKKyAgaWYgKGJhcmZfY3Jhc2hfdHdvKQorICAgIHJl dHVybiBoc2Nyb2xsZWRfcDsKKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKIAkgICAgICAvKiBNb3ZlIGl0ZXJhdG9yIHRvIHB0IHN0YXJ0 aW5nIGF0IGN1cnNvcl9yb3ctPnN0YXJ0IGluCiAJCSBhIGxpbmUgd2l0aCBpbmZpbml0ZSB3aWR0 aC4gICovCiAJICAgICAgaW5pdF90b19yb3dfc3RhcnQgKCZpdCwgdywgY3Vyc29yX3Jvdyk7CkBA IC0xNDM5Nyw5ICsxOTMwNCwyMiBAQCByZWRpc3BsYXlfaW50ZXJuYWwgKHZvaWQpCiAJICAgICAg KnctPmRlc2lyZWRfbWF0cml4LT5tZXRob2QgPSAwOwogCSAgICAgIGRlYnVnX21ldGhvZF9hZGQg KHcsICJvcHRpbWl6YXRpb24gMSIpOwogI2VuZGlmCisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0K KyAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZG RVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgIG1jX3VwZGF0ZV93aW5kb3dfZnJp bmdlcyAodywgZmFsc2UpOworICAgIGVsc2UKIAkgICAgICB1cGRhdGVfd2luZG93X2ZyaW5nZXMg KHcsIGZhbHNlKTsKICNlbmRpZgorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAg ICAgZ290byB1cGRhdGU7CiAJICAgIH0KIAkgIGVsc2UKQEAgLTE3NzkyLDEwICsyMjcxMiwyMiBA QCByZWRpc3BsYXlfd2luZG93IChMaXNwX09iamVjdCB3aW5kb3csIGJvb2wganVzdF90aGlzX29u ZV9wKQogICAgIH0KIAogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQorCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGJvb2wga2VlcF9jdXJy ZW50X3AgPSAoanVzdF90aGlzX29uZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKCF1 c2VkX2N1cnJlbnRfbWF0cml4X3AgJiYgIW92ZXJsYXlfYXJyb3dfc2VlbikKKyAgICAgICAgICAg ICAgICAgICAgICAgICB8fCB3LT5wc2V1ZG9fd2luZG93X3ApOworCisgIGJvb2wgZnJpbmdlc191 cGRhdGVkX3AgPSAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykp KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY191cGRhdGVfd2luZG93X2ZyaW5nZXMg KHcsIGtlZXBfY3VycmVudF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgOiB1cGRhdGVf d2luZG93X2ZyaW5nZXMgKHcsIGtlZXBfY3VycmVudF9wKTsKKwogICBpZiAoRlJBTUVfV0lORE9X X1AgKGYpCi0gICAgICAmJiB1cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIChqdXN0X3RoaXNfb25l X3AKLQkJCQkgICAgfHwgKCF1c2VkX2N1cnJlbnRfbWF0cml4X3AgJiYgIW92ZXJsYXlfYXJyb3df c2VlbikKLQkJCQkgICAgfHwgdy0+cHNldWRvX3dpbmRvd19wKSkpCisgICAgICAmJiBmcmluZ2Vz X3VwZGF0ZWRfcCkKICAgICB7CiAgICAgICB1cGRhdGVfYmVnaW4gKGYpOwogICAgICAgYmxvY2tf aW5wdXQgKCk7CkBAIC0xNzgxMCw2ICsyMjc0Miw5IEBAIHJlZGlzcGxheV93aW5kb3cgKExpc3Bf T2JqZWN0IHdpbmRvdywgYm9vbCBqdXN0X3RoaXNfb25lX3ApCiAgICAgICB1cGRhdGVfZW5kIChm KTsKICAgICB9CiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgaWYgKFdJTkRPV19C T1RUT01fRElWSURFUl9XSURUSCAodykpCiAgICAgZ3VpX2RyYXdfYm90dG9tX2RpdmlkZXIgKHcp OwogI2VuZGlmIC8qIEhBVkVfV0lORE9XX1NZU1RFTSAqLwpAQCAtMTgxMjUsNiArMjMwNjAsMTYg QEAgdHJ5X3dpbmRvd19yZXVzaW5nX2N1cnJlbnRfbWF0cml4IChzdHJ1Y3Qgd2luZG93ICp3KQog CSAgICAgIHVwZGF0ZV9iZWdpbiAoZik7CiAJICAgICAgZ3VpX3VwZGF0ZV93aW5kb3dfYmVnaW4g KHcpOwogCSAgICAgIEZSQU1FX1JJRiAoZiktPmNsZWFyX3dpbmRvd19tb3VzZV9mYWNlICh3KTsK KworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwor ICAgIG1jX3ByZV9zY3JvbGxfY2xlYW4gKHcsIHJ1biwgc3RhcnRfdnBvcywgbnJvd3Nfc2Nyb2xs ZWQsIFRSWV9XSU5ET1dfUkVVU0lOR19DVVJSRU5UX01BVFJJWF9ET1dOKTsKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogCSAgICAgIEZSQU1FX1JJRiAoZiktPnNjcm9sbF9ydW5faG9v ayAodywgJnJ1bik7CiAJICAgICAgZ3VpX3VwZGF0ZV93aW5kb3dfZW5kICh3LCBmYWxzZSwgZmFs c2UpOwogCSAgICAgIHVwZGF0ZV9lbmQgKGYpOwpAQCAtMTgyOTEsNiArMjMyMzYsMTYgQEAgdHJ5 X3dpbmRvd19yZXVzaW5nX2N1cnJlbnRfbWF0cml4IChzdHJ1Y3Qgd2luZG93ICp3KQogCSAgdXBk YXRlX2JlZ2luIChmKTsKIAkgIGd1aV91cGRhdGVfd2luZG93X2JlZ2luICh3KTsKIAkgIEZSQU1F X1JJRiAoZiktPmNsZWFyX3dpbmRvd19tb3VzZV9mYWNlICh3KTsKKworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIG1jX3ByZV9zY3JvbGxf Y2xlYW4gKHcsIHJ1biwgc3RhcnRfdnBvcywgbnJvd3Nfc2Nyb2xsZWQsIFRSWV9XSU5ET1dfUkVV U0lOR19DVVJSRU5UX01BVFJJWF9VUCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK IAkgIEZSQU1FX1JJRiAoZiktPnNjcm9sbF9ydW5faG9vayAodywgJnJ1bik7CiAJICBndWlfdXBk YXRlX3dpbmRvd19lbmQgKHcsIGZhbHNlLCBmYWxzZSk7CiAJICB1cGRhdGVfZW5kIChmKTsKQEAg LTE5MjQ1LDYgKzI0MjAwLDE2IEBAIHRyeV93aW5kb3dfaWQgKHN0cnVjdCB3aW5kb3cgKncpCiAj aWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCiAJICBndWlfdXBkYXRlX3dpbmRvd19iZWdpbiAodyk7 CiAJICBGUkFNRV9SSUYgKGYpLT5jbGVhcl93aW5kb3dfbW91c2VfZmFjZSAodyk7CisKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICBtY19w cmVfc2Nyb2xsX2NsZWFuICh3LCBydW4sIGZpcnN0X3VuY2hhbmdlZF9hdF9lbmRfdnBvcywgZHZw b3MsIFRSWV9XSU5ET1dfSUQpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICBG UkFNRV9SSUYgKGYpLT5zY3JvbGxfcnVuX2hvb2sgKHcsICZydW4pOwogCSAgZ3VpX3VwZGF0ZV93 aW5kb3dfZW5kICh3LCBmYWxzZSwgZmFsc2UpOwogI2VuZGlmCkBAIC0yMTUyOCw2ICsyNjQ5Mywx NyBAQCBtYXliZV9wcm9kdWNlX2xpbmVfbnVtYmVyIChzdHJ1Y3QgaXQgKml0KQogICAgICAgU0VU X1RFWFRfUE9TICh0ZW1faXQucG9zaXRpb24sIC0xLCAtMSk7CiAgICAgICBQUk9EVUNFX0dMWVBI UyAoJnRlbV9pdCk7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1D VVJTT1JTICovCisKKyAgICAgIC8qIFRoaXMgcGVybWl0cyB1cyB0byBpbnNwZWN0IHRoZSBIUE9T IG9mIGxpbmUgbnVtYmVyIGdseXBocyBhbmQgdGhlIHNwYWNlCisgICAgICBwYWRkaW5nIGJlZm9y ZS9hZnRlciB0aGUgbGluZSBudW1iZXJzLiAgV2Ugc2V0IGBnbHlwaC0+aHBvc2AgZWxzZXdoZXJl LiAqLworICAgICAgdGVtX2l0Lmhwb3MgKz0gMTsKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogICAgICAgLyogU3RvcCBwcm9kdWNpbmcgZ2x5cGhzLCBhbmQgcmVmcmFpbiBmcm9tIHBy b2R1Y2luZyB0aGUgbGluZQogCSBudW1iZXIsIGlmIHdlIGRvbid0IGhhdmUgZW5vdWdoIHNwYWNl IG9uIHRoaXMgbGluZS4gICovCiAgICAgICBpZiAodGVtX2l0LmN1cnJlbnRfeCA+PSB3aWR0aF9s aW1pdCkKQEAgLTIxNTM5LDYgKzI2NTE1LDI4IEBAIG1heWJlX3Byb2R1Y2VfbGluZV9udW1iZXIg KHN0cnVjdCBpdCAqaXQpCiAJfQogICAgIH0KIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAo aXQtPnctPmNvbnRlbnRzKTsKKyAgc3RydWN0IGJ1ZmZlciAqb2xkX2J1ZmZlciA9IE5VTEw7Cisg IC8qIE5lZWRlZCBzbyB0aGF0IGJ1ZmZlci1sb2NhbCB2YWx1ZXMgY2FuIGJlIGRldGVybWluZWQ7 IGUuZy4sIHdoZW4gc3dpdGNoaW5nCisgIHRvIHRoZSBtaW5pYnVmZmVyLiAqLworICBpZiAoYiAh PSBjdXJyZW50X2J1ZmZlcikKKyAgICB7CisgICAgICBvbGRfYnVmZmVyID0gY3VycmVudF9idWZm ZXI7CisgICAgICBzZXRfYnVmZmVyX2ludGVybmFsIChiKTsKKyAgICB9CisgIGl0LT53LT5tYy5s bnVtX3BpeGVsX3dpZHRoID0gKCFOSUxQIChWZGlzcGxheV9saW5lX251bWJlcnMpKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gdGVtX2l0LmN1cnJlbnRfeAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogMDsKKyAgaWYgKG9sZF9idWZmZXIpCisgICAgc2V0X2J1ZmZl cl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK ICAgLyogUmVjb3JkIHRoZSB3aWR0aCBpbiBwaXhlbHMgd2UgbmVlZCBmb3IgdGhlIGxpbmUgbnVt YmVyIGRpc3BsYXkuICAqLwogICBpdC0+bG51bV9waXhlbF93aWR0aCA9IHRlbV9pdC5jdXJyZW50 X3g7CiAgIC8qIENvcHkgdGhlIHByb2R1Y2VkIGdseXBocyBpbnRvIElUJ3MgZ2x5cGhfcm93LiAg Ki8KQEAgLTI3MzYwLDYgKzMyMzU4LDE3IEBAIGFwcGVuZF9nbHlwaCAoc3RydWN0IGl0ICppdCkK IAkgICAgZ1sxXSA9ICpnOwogCSAgZ2x5cGggPSBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJlYV07 CiAJfQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAq LworCisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPmJ5dGVwb3Mg PSBJVF9CWVRFUE9TICgqaXQpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAg ICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAgICAgICBnbHlwaC0+ b2JqZWN0ID0gaXQtPm9iamVjdDsKICAgICAgIGlmIChpdC0+cGl4ZWxfd2lkdGggPiAwKQpAQCAt Mjc0NDIsNiArMzI0NTEsMTcgQEAgYXBwZW5kX2NvbXBvc2l0ZV9nbHlwaCAoc3RydWN0IGl0ICpp dCkKIAkgICAgZ1sxXSA9ICpnOwogCSAgZ2x5cGggPSBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbaXQt PmFyZWFdOwogCX0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBoLT5i eXRlcG9zID0gSVRfQllURVBPUyAoKml0KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisK KwogICAgICAgZ2x5cGgtPmNoYXJwb3MgPSBpdC0+Y21wX2l0LmNoYXJwb3M7CiAgICAgICBnbHlw aC0+b2JqZWN0ID0gaXQtPm9iamVjdDsKICAgICAgIGVhc3NlcnQgKGl0LT5waXhlbF93aWR0aCA8 PSBTSFJUX01BWCk7CkBAIC0yNzY1MCw2ICszMjY3MCwxNyBAQCBwcm9kdWNlX2ltYWdlX2dseXBo IChzdHJ1Y3QgaXQgKml0KQogCX0KICAgICAgIGlmIChnbHlwaCA8IGl0LT5nbHlwaF9yb3ctPmds eXBoc1thcmVhICsgMV0pCiAJeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAg Z2x5cGgtPmJ5dGVwb3MgPSBJVF9CWVRFUE9TICgqaXQpOworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKworCiAJICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAJ ICBnbHlwaC0+b2JqZWN0ID0gaXQtPm9iamVjdDsKIAkgIGdseXBoLT5waXhlbF93aWR0aCA9IGNs aXBfdG9fYm91bmRzICgtMSwgaXQtPnBpeGVsX3dpZHRoLCBTSFJUX01BWCk7CkBAIC0yNzc1Myw2 ICszMjc4NCwxNyBAQCBwcm9kdWNlX3h3aWRnZXRfZ2x5cGggKHN0cnVjdCBpdCAqaXQpCiAJfQog ICAgICAgaWYgKGdseXBoIDwgaXQtPmdseXBoX3Jvdy0+Z2x5cGhzW2FyZWEgKyAxXSkKIAl7CisK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAg ICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9IElUX0JZ VEVQT1MgKCppdCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgIGdseXBoLT5j aGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKIAkgIGdseXBoLT5vYmplY3QgPSBpdC0+ b2JqZWN0OwogCSAgZ2x5cGgtPnBpeGVsX3dpZHRoID0gY2xpcF90b19ib3VuZHMgKC0xLCBpdC0+ cGl4ZWxfd2lkdGgsIFNIUlRfTUFYKTsKQEAgLTI3ODM5LDYgKzMyODgxLDE3IEBAIGFwcGVuZF9z dHJldGNoX2dseXBoIChzdHJ1Y3QgaXQgKml0LCBMaXNwX09iamVjdCBvYmplY3QsCiAJICAgIHdp ZHRoIC09IGl0LT5maXJzdF92aXNpYmxlX3ggLSBpdC0+Y3VycmVudF94OwogCSAgZWFzc2VydCAo d2lkdGggPiAwKTsKIAl9CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBnbHlw aC0+Ynl0ZXBvcyA9IElUX0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKICAgICAgIGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKICAg ICAgIGdseXBoLT5vYmplY3QgPSBvYmplY3Q7CiAgICAgICAvKiBGSVhNRTogSXQgd291bGQgYmUg YmV0dGVyIHRvIHVzZSBUWVBFX01BWCBoZXJlLCBidXQKQEAgLTI4MjkzLDYgKzMzMzQ2LDE3IEBA IGFwcGVuZF9nbHlwaGxlc3NfZ2x5cGggKHN0cnVjdCBpdCAqaXQsIGludCBmYWNlX2lkLCBib29s IGZvcl9ub19mb250LCBpbnQgbGVuLAogCSAgICBnWzFdID0gKmc7CiAJICBnbHlwaCA9IGl0LT5n bHlwaF9yb3ctPmdseXBoc1thcmVhXTsKIAl9CisKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7 CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9IElUX0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKICAgICAgIGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBv c2l0aW9uKTsKICAgICAgIGdseXBoLT5vYmplY3QgPSBpdC0+b2JqZWN0OwogICAgICAgZWFzc2Vy dCAoaXQtPnBpeGVsX3dpZHRoIDw9IFNIUlRfTUFYKTsKQEAgLTI5MzQzLDEwICszNDQwNywyMCBA QCBndWlfaW5zZXJ0X2dseXBocyAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAq dXBkYXRlZF9yb3csCiAKICAgLyogV3JpdGUgdGhlIGdseXBocy4gICovCiAgIGhwb3MgPSBzdGFy dCAtIHJvdy0+Z2x5cGhzW3VwZGF0ZWRfYXJlYV07CisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgaWYgKCFtY19yZWRyYXdfcm93ICh3LCB3 LT5jdXJyZW50X21hdHJpeCwgcm93LCB1cGRhdGVkX2FyZWEsIHctPm91dHB1dF9jdXJzb3IueCwK KyAgICAgICAgICAgICAgICAgICAgICBocG9zLCBocG9zICsgbGVuLCBmYWxzZSwgRFJBV19OT1JN QUxfVEVYVCwgR1VJX0lOU0VSVF9HTFlQSFMpKQogICBkcmF3X2dseXBocyAodywgdy0+b3V0cHV0 X2N1cnNvci54LCByb3csIHVwZGF0ZWRfYXJlYSwKIAkgICAgICAgaHBvcywgaHBvcyArIGxlbiwK IAkgICAgICAgRFJBV19OT1JNQUxfVEVYVCwgMCk7CiAKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKICAgLyogQWR2YW5jZSB0aGUgb3V0cHV0IGN1cnNvci4gICovCiAgIHctPm91dHB1dF9j dXJzb3IuaHBvcyArPSBsZW47CiAgIHctPm91dHB1dF9jdXJzb3IueCArPSBzaGlmdF9ieV93aWR0 aDsKQEAgLTI5NzcyLDkgKzM0ODQ2LDE5IEBAIGd1aV9maXhfb3ZlcmxhcHBpbmdfYXJlYSAoc3Ry dWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqcm93LAogCSAgd2hpbGUgKGkgPCByb3ct PnVzZWRbYXJlYV0KIAkJICYmIHJvdy0+Z2x5cGhzW2FyZWFdW2ldLm92ZXJsYXBzX3ZlcnRpY2Fs bHlfcCk7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JT ICovCisKKyAgICAgIGlmICghbWNfcmVkcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgsIHJv dywgYXJlYSwgc3RhcnRfeCwgc3RhcnQsIGksCisgICAgICAgICAgZmFsc2UsIERSQVdfTk9STUFM X1RFWFQsIEdVSV9GSVhfT1ZFUkxBUFBJTkdfQVJFQSkpCiAJICBkcmF3X2dseXBocyAodywgc3Rh cnRfeCwgcm93LCBhcmVhLAogCQkgICAgICAgc3RhcnQsIGksCiAJCSAgICAgICBEUkFXX05PUk1B TF9URVhULCBvdmVybGFwcyk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAl9CiAg ICAgICBlbHNlCiAJewpAQCAtMzAwMjUsMTAgKzM1MTA5LDE3IEBAIGRpc3BsYXlfYW5kX3NldF9j dXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgb24sCiAgIG5ld19jdXJzb3JfdHlwZSA9IGdl dF93aW5kb3dfY3Vyc29yX3R5cGUgKHcsIGdseXBoLAogCQkJCQkgICAgJm5ld19jdXJzb3Jfd2lk dGgsICZhY3RpdmVfY3Vyc29yKTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1V TFRJUExFLUNVUlNPUlMgKi8KKwogICAvKiBJZiBjdXJzb3IgaXMgY3VycmVudGx5IGJlaW5nIHNo b3duIGFuZCB3ZSBkb24ndCB3YW50IGl0IHRvIGJlIG9yCiAgICAgIGl0IGlzIGluIHRoZSB3cm9u ZyBwbGFjZSwgb3IgdGhlIGN1cnNvciB0eXBlIGlzIG5vdCB3aGF0IHdlIHdhbnQsCiAgICAgIGVy YXNlIGl0LiAgKi8KICAgaWYgKHctPnBoeXNfY3Vyc29yX29uX3AKKyAgICAgICYmIE5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAmJiBOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQorICAgICAgJiYgTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkKICAgICAgICYmICghb24KIAkg IHx8IHctPnBoeXNfY3Vyc29yLnggIT0geAogCSAgfHwgdy0+cGh5c19jdXJzb3IueSAhPSB5CkBA IC0zMDA0MSw2ICszNTEzMiw5IEBAIGRpc3BsYXlfYW5kX3NldF9jdXJzb3IgKHN0cnVjdCB3aW5k b3cgKncsIGJvb2wgb24sCiAJICAgICAgJiYgbmV3X2N1cnNvcl93aWR0aCAhPSB3LT5waHlzX2N1 cnNvcl93aWR0aCkpKQogICAgIGVyYXNlX3BoeXNfY3Vyc29yICh3KTsKIAorLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisKKwogICAvKiBEb24ndCBjaGVjayBwaHlzX2N1cnNvcl9vbl9wIGhlcmUg YmVjYXVzZSB0aGF0IGZsYWcgaXMgb25seSBzZXQKICAgICAgdG8gZmFsc2UgaW4gc29tZSBjYXNl cyB3aGVyZSB3ZSBrbm93IHRoYXQgdGhlIGN1cnNvciBoYXMgYmVlbgogICAgICBjb21wbGV0ZWx5 IGVyYXNlZCwgdG8gYXZvaWQgdGhlIGV4dHJhIHdvcmsgb2YgZXJhc2luZyB0aGUgY3Vyc29yCkBA IC0zMDA1OSw5ICszNTE1MywyMCBAQCBkaXNwbGF5X2FuZF9zZXRfY3Vyc29yIChzdHJ1Y3Qgd2lu ZG93ICp3LCBib29sIG9uLAogICAgICAgdy0+cGh5c19jdXJzb3IudnBvcyA9IHZwb3M7CiAgICAg fQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLwor CisgIGlmIChOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQor ICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkK KyAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQog ICBGUkFNRV9SSUYgKGYpLT5kcmF3X3dpbmRvd19jdXJzb3IgKHcsIGdseXBoX3JvdywgeCwgeSwK ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfY3Vyc29yX3R5cGUsIG5l d19jdXJzb3Jfd2lkdGgsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb24s IGFjdGl2ZV9jdXJzb3IpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiB9CiAKIApA QCAtMzAxNTQsNyArMzUyNTksMTggQEAgZHJhd19yb3dfd2l0aF9tb3VzZV9mYWNlIChzdHJ1Y3Qg d2luZG93ICp3LCBpbnQgc3RhcnRfeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAogI2lmZGVmIEhB VkVfV0lORE9XX1NZU1RFTQogICBpZiAoRlJBTUVfV0lORE9XX1AgKFhGUkFNRSAody0+ZnJhbWUp KSkKICAgICB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJT T1JTICovCisKKyAgICAgIGlmICghbWNfcmVkcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgs IHJvdywgVEVYVF9BUkVBLCBzdGFydF94LAorICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFy dF9ocG9zLCBlbmRfaHBvcywgZmFsc2UsIGRyYXcsIERSQVdfUk9XX1dJVEhfTU9VU0VfRkFDRSkp CiAgICAgICBkcmF3X2dseXBocyAodywgc3RhcnRfeCwgcm93LCBURVhUX0FSRUEsIHN0YXJ0X2hw b3MsIGVuZF9ocG9zLCBkcmF3LCAwKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog ICAgICAgcmV0dXJuOwogICAgIH0KICNlbmRpZgpAQCAtMzIyMTQsMTEgKzM3MzMwLDIzIEBAIGV4 cG9zZV9hcmVhIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGNvbnN0 IEVtYWNzX1JlY3RhbmdsZSAqciwKICAgc3RydWN0IGdseXBoICpsYXN0OwogICBpbnQgZmlyc3Rf eCwgc3RhcnRfeCwgeDsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExF LUNVUlNPUlMgKi8KKwogICBpZiAoYXJlYSA9PSBURVhUX0FSRUEgJiYgcm93LT5maWxsX2xpbmVf cCkKKyAgICB7CisgICAgICBpZiAoIW1jX3JlZHJhd19yb3cgKHcsIHctPmN1cnJlbnRfbWF0cml4 LCByb3csIGFyZWEsIDAsIDAsIHJvdy0+dXNlZFthcmVhXSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgZmFsc2UsIERSQVdfTk9STUFMX1RFWFQsIEVYUE9TRV9BUkVBX09ORSkpCiAgICAgLyog SWYgcm93IGV4dGVuZHMgZmFjZSB0byBlbmQgb2YgbGluZSB3cml0ZSB0aGUgd2hvbGUgbGluZS4g ICovCiAgICAgZHJhd19nbHlwaHMgKHcsIDAsIHJvdywgYXJlYSwKIAkJIDAsIHJvdy0+dXNlZFth cmVhXSwKIAkJIERSQVdfTk9STUFMX1RFWFQsIDApOworICAgIH0KKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogICBlbHNlCiAgICAgewogICAgICAgLyogU2V0IFNUQVJUX1ggdG8gdGhl IHdpbmRvdy1yZWxhdGl2ZSBzdGFydCBwb3NpdGlvbiBmb3IgZHJhd2luZyBnbHlwaHMgb2YKQEAg LTMyMjUwLDExICszNzM3OCwyMyBAQCBleHBvc2VfYXJlYSAoc3RydWN0IHdpbmRvdyAqdywgc3Ry dWN0IGdseXBoX3JvdyAqcm93LCBjb25zdCBFbWFjc19SZWN0YW5nbGUgKnIsCiAJICArK2xhc3Q7 CiAJfQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAq LworCiAgICAgICAvKiBSZXBhaW50LiAgKi8KLSAgICAgIGlmIChsYXN0ID4gZmlyc3QpCisgICAg ICAvKiBGbG9hdGluZyBmYWtlIGN1cnNvcnMgd2lsbCBleGlzdCB3aGVuIChsYXN0ID09IGZpcnN0 KS4gKi8KKyAgICAgIGlmICghbWNfcmVkcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgsIHJv dywgYXJlYSwgZmlyc3RfeCAtIHN0YXJ0X3gsCisgICAgICAgICAgICAgICAgICAgICAgICAgIGZp cnN0IC0gcm93LT5nbHlwaHNbYXJlYV0sIGxhc3QgLSByb3ctPmdseXBoc1thcmVhXSwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgZmFsc2UsIERSQVdfTk9STUFMX1RFWFQsIEVYUE9TRV9BUkVB X1RXTykKKyAgICAgICAgICAmJiBsYXN0ID4gZmlyc3QpCiAJZHJhd19nbHlwaHMgKHcsIGZpcnN0 X3ggLSBzdGFydF94LCByb3csIGFyZWEsCiAJCSAgICAgZmlyc3QgLSByb3ctPmdseXBoc1thcmVh XSwgbGFzdCAtIHJvdy0+Z2x5cGhzW2FyZWFdLAogCQkgICAgIERSQVdfTk9STUFMX1RFWFQsIDAp OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgfQogfQogCkBAIC0zMjI2OCwx MCArMzc0MDgsMjIgQEAgZXhwb3NlX2xpbmUgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlw aF9yb3cgKnJvdywgY29uc3QgRW1hY3NfUmVjdGFuZ2xlICpyKQogewogICBlYXNzZXJ0IChyb3ct PmVuYWJsZWRfcCk7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1D VVJTT1JTICovCisKICAgaWYgKHJvdy0+bW9kZV9saW5lX3AgfHwgdy0+cHNldWRvX3dpbmRvd19w KQorICAgIHsKKyAgICAgIGlmICghbWNfcmVkcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgs IHJvdywgVEVYVF9BUkVBLCAwLCAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICByb3ctPnVz ZWRbVEVYVF9BUkVBXSwgZmFsc2UsIERSQVdfTk9STUFMX1RFWFQsIEVYUE9TRV9MSU5FKSkKICAg ICBkcmF3X2dseXBocyAodywgMCwgcm93LCBURVhUX0FSRUEsCiAJCSAwLCByb3ctPnVzZWRbVEVY VF9BUkVBXSwKIAkJIERSQVdfTk9STUFMX1RFWFQsIDApOworICAgIH0KKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisKKwogICBlbHNlCiAgICAgewogICAgICAgaWYgKHJvdy0+dXNlZFtMRUZU X01BUkdJTl9BUkVBXSkKQEAgLTMyODE5LDYgKzM3OTcxLDIyIEBAIGd1aV9pbnRlcnNlY3RfcmVj dGFuZ2xlcyAoY29uc3QgRW1hY3NfUmVjdGFuZ2xlICpyMSwgY29uc3QgRW1hY3NfUmVjdGFuZ2xl ICpyMiwKIHZvaWQKIHN5bXNfb2ZfeGRpc3AgKHZvaWQpCiB7CisKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZGVmc3ViciAoJlNtY19kdW1w X2dseXBoX3Jvdyk7CisKKyAgZGVmc3ViciAoJlNtY19kdW1wX2dseXBoX21hdHJpeCk7CisKKyAg ZGVmc3ViciAoJlNtY19jdXJyZW50X2NvbHVtbik7CisKKyAgZGVmc3ViciAoJlNtY19zdGRlcnIp OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIFZ3aXRoX2VjaG9fYXJlYV9zYXZl X3ZlY3RvciA9IFFuaWw7CiAgIHN0YXRpY3BybyAoJlZ3aXRoX2VjaG9fYXJlYV9zYXZlX3ZlY3Rv cik7CiAKZGlmZiAtLWdpdCBhL3NyYy94dGVybS5jIGIvc3JjL3h0ZXJtLmMKaW5kZXggYzk2YWE3 NC4uN2Y4ZjFhMCAxMDA2NDQKLS0tIGEvc3JjL3h0ZXJtLmMKKysrIGIvc3JjL3h0ZXJtLmMKQEAg LTEzMiw2ICsxMzIsOTA0IEBAIGFsb25nIHdpdGggR05VIEVtYWNzLiAgSWYgbm90LCBzZWUgPG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IFcgaW4gZ2x5cGggcm93IFJPVy4gKi8KK3N0YXRpYyB2b2lkCittY194X2Ry YXdfYmFyX2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0 cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICAgICAgaW50IHgs IGludCBmeCwgaW50IHksIGludCBmeSwgaW50IGhwb3MsIGludCB2cG9zLCBpbnQgd2QsIGludCBo LAorICAgICAgICAgICAgICAgICAgICAgIGludCB3aWR0aCwgZW51bSBtY19jdXJzb3JfdHlwZSBr aW5kLCBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKQoreworICBzdHJ1Y3QgZnJhbWUg KmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgLyogSWYgY3Vyc29yIGlzIG91dCBvZiBib3VuZHMs IGRvbid0IGRyYXcgZ2FyYmFnZS4gIFRoaXMgY2FuIGhhcHBlbgorICAgICBpbiBtaW5pLWJ1ZmZl ciB3aW5kb3dzIHdoZW4gc3dpdGNoaW5nIGJldHdlZW4gZWNobyBhcmVhIGdseXBocworICAgICBh bmQgbWluaS1idWZmZXIuICovCisgIHN0cnVjdCBnbHlwaCAqY3Vyc29yX2dseXBoID0gbWNfZ2V0 X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIGhwb3MsIHZwb3MpOworICBpZiAoY3Vyc29y X2dseXBoID09IE5VTEwpCisgICAgcmV0dXJuOworICAvKiBFeHBlcmltZW50YWwgYXZvaWRhbmNl IG9mIGN1cnNvciBvbiB4d2lkZ2V0LiAqLworICBpZiAoY3Vyc29yX2dseXBoLT50eXBlID09IFhX SURHRVRfR0xZUEgpCisgICAgcmV0dXJuOworICAvKiBJZiBvbiBhbiBpbWFnZSwgZHJhdyBsaWtl IGEgbm9ybWFsIGN1cnNvci4gIFRoYXQncyB1c3VhbGx5IGJldHRlcgorICAgICB2aXNpYmxlIHRo YW4gZ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9IG1pbiAoNjU1MzUs IDY1NTM1ICogbHNsLmJsdWUpOworICAvKiBgeF9hbGxvY19uZWFyZXN0X2NvbG9yJyBzZXRzIHRo ZSBgY29sb3IucGl4ZWxgLiAqLworICB4X2FsbG9jX25lYXJlc3RfY29sb3IgKGYsIGNtYXAsICZj b2xvcik7CisgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgIHsKKyAgICBjYXNlIE1DX05PX0ZSSU5H RV9CSVRNQVA6CisgICAgICBicmVhazsKKyAgICBjYXNlIE1DX05PX0NVUlNPUjoKKyAgICAgIGJy ZWFrOworICAgIGNhc2UgTUNfUklHSFRfRlJJTkdFX0JJVE1BUDoKKyAgICAgIGJyZWFrOworICAg IGNhc2UgTUNfTEVGVF9GUklOR0VfQklUTUFQOgorICAgICAgYnJlYWs7CisgICAgY2FzZSBNQ19G UkFNRURfQk9YOgorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlwaCAqY3Vyc29yX2dseXBoID0gbWNf Z2V0X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIGhwb3MsIHZwb3MpOworICAgICAgaWYg KGN1cnNvcl9nbHlwaCA9PSBOVUxMKQorICAgICAgICByZXR1cm47CisgICAgICBzdHJ1Y3QgYnVm ZmVyICpiID0gWEJVRkZFUiAody0+Y29udGVudHMpOworICAgICAgYm9vbCByZWdpb25fYWN0aXZl X3AgPSAoIU5JTFAgKFZ0cmFuc2llbnRfbWFya19tb2RlKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIG1hcmtfYWN0aXZlKSkpOworICAgICAgcHRyZGlm Zl90IHJlZ2lvbl9iZWcgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IG1jX3JlZ2lvbl9saW1pdCAoMSkg OiAtMTsKKyAgICAgIHB0cmRpZmZfdCByZWdpb25fZW5kID0gKHJlZ2lvbl9hY3RpdmVfcCkgPyBt Y19yZWdpb25fbGltaXQgKDApIDogLTE7Cis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sb3df YWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9E SVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfYWN0aXZlX2Zh Y2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVfWF9E SVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfYWN0aXZlX3Jl Z2lvbl9iZWdfZmFjZS0+Zm9yZWdyb3VuZCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBl bHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9w CisgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3MgPT0gcmVnaW9u X2VuZCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xs b3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBp bnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItYXQtcmVnaW9uLXByZS16di1mYWNlIiksIHRydWUp OworICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRf ZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2VfaWQp OworICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBs b29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16 di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgI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GgtPnR5cGUgPT0gSU1B R0VfR0xZUEggJiYgbHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49 IDApCisgICAgICAgICAgeworICAgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5v dXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwnLiAqLworICAgICAgICAgICAgZi0+b3V0cHV0X2Rh dGEueC0+Y3Vyc29yX3BpeGVsID0gY29sb3IucGl4ZWw7CisgICAgICAgICAgICBtY194X2RyYXdf aG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywg d2QsIGgpOworICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3Jp Z2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2Rh dGEueC0+Y3Vyc29yX2djJyBieSBib3Jyb3dpbmcgdGhlCisgICAgICAgICAgICAgIGZ1bmN0aW9u YWxpdHkgb2YgYHhfbWFrZV9nYycgaW4geGZucy5jLiAqLworICAgICAgICAgICAgICBpZiAocmVn aW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcAorICAgICAgICAgICAg ICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID09IHJlZ2lvbl9iZWcpCisgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVn aW9uX2JlZ19mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVh bC1mYWtlLWN1cnNvci1hdC1yZWdpb24tcHJlLXp2LWZhY2UiKSwgdHJ1Z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91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywg aG9sbG93X2FjdGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAg ICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChhY3RpdmVfcCkKKyAg ICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2Vf aWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVy biAoIistcmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAg ICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01f SUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBY U2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vy c29yX2djLCBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICAg ICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9k YXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9mYWNlLT5iYWNrZ3JvdW5kKTsKKyAgICAg ICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoIWFjdGl2 ZV9wKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAg ICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFj ZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNl IiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93 X2luYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lk KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElT UExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2luYWN0aXZlX2Zh Y2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgICAgICAgICAgICBYU2V0QmFja2dyb3Vu ZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xs b3dfaW5hY3RpdmVfZmFjZS0+YmFja2dyb3VuZCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAgIGJsb2NrX2lucHV0ICgpOworICAgICAgICAgICAgICAvKiBGb3JjZSBg bWNfeF9zZXRfY3Vyc29yX2djJyB0byB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9n YycuICovCisgICAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX3AgPSB0cnVlOworICAgICAgICAg ICAgICBtY19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4 LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNsLCBn bHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgICAgIFhTZXRGb3Jl Z3JvdW5kICh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vdywgeCwgZngsIHks IGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBN Q19GSUxMRURfQk9YOgorICAgIHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVu ID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBm LT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MnIGJ5IGJvcnJvd2luZyB0aGUKKyAgICAgICAgZnVu Y3Rpb25hbGl0eSBvZiBgeF9tYWtlX2djJyBpbiB4Zm5zLmMuICovCisgICAgICAgIHsKKyAgICAg ICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9E SVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBGUkFNRV9CQUNLR1JPVU5E X1BJWEVMIChmKSk7CisgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAo ZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgY29sb3IucGl4ZWwpOworICAgICAgICAg IC8qIEZvcmNlIGBtY194X3NldF9jdXJzb3JfZ2MnIHRvIHVzZSBgcy0+Zi0+b3V0cHV0X2RhdGEu eC0+Y3Vyc29yX2djJy4gKi8KKyAgICAgICAgICBib29sIGN1cnNvcl9nY19wID0gdHJ1ZTsKKyAg ICAgICAgICBtY19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09S LCB4LCBocG9zLCB2cG9zLCBsc2wsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGds eXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOworICAg ICAgICAgIFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0 YS54LT5jdXJzb3JfZ2MsIHhnY3YuZm9yZWdyb3VuZCk7CisgICAgICAgICAgWFNldEJhY2tncm91 bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgeGdj di5iYWNrZ3JvdW5kKTsKKyAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgICB9Cisg ICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBib29sIGN1cnNvcl9nY19wID0g ZmFsc2U7CisgICAgICAgICAgICBtY19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3cs IERSQVdfQ1VSU09SLCB4LCBocG9zLCB2cG9zLCBsc2wsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9wLCBjdXJz b3JfZ2NfcCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNf QkFSOgorICAgIHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYg bHNsLmJsdWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFj ayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsJy4gKi8KKyAgICAgICAgICBmLT5vdXRw dXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBjb2xvci5waXhlbDsKKyAgICAgICAgICBib29sIGN1 cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gdHJ1ZTsKKyAgICAgICAgICBtY194X2RyYXdfYmFy X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgTUNfQkFSLCBj dXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+ Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAg IGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVf b2theV9wID0gZmFsc2U7CisgICAgICAgICAgICBtY194X2RyYXdfYmFyX2N1cnNvciAodywgbWF0 cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgaCwgY3Vyc29yX3dpZHRoLCBNQ19CQVIsIGN1cnNvcl9nY19pbnZp c2libGVfb2theV9wKTsKKyAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2Fz ZSBNQ19IQkFSOgorICAgIHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49 IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5 IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsJy4gKi8KKyAgICAgICAgICBm LT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBjb2xvci5waXhlbDsKKyAgICAgICAgICBi b29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gdHJ1ZTsKKyAgICAgICAgICBtY194X2Ry YXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywg d2QsIGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgTUNf SEJBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIGYtPm91dHB1dF9k YXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQor ICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52 aXNpYmxlX29rYXlfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJzb3Ig KHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl93aWR0aCwgTUNfSEJBUiwgY3Vyc29y X2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0K KyAgICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7CisgIH0KKyAgICAgICAgfQorI2lm ZGVmIEhBVkVfWF9JMThOCisgIGlmICh3ID09IFhXSU5ET1cgKGYtPnNlbGVjdGVkX3dpbmRvdykp CisgICAgaWYgKEZSQU1FX1hJQyAoZikgJiYgKEZSQU1FX1hJQ19TVFlMRSAoZikgJiBYSU1QcmVl ZGl0UG9zaXRpb24pKQorICAgICAgeGljX3NldF9wcmVlZGl0YXJlYSAodywgeCwgeSk7CisjZW5k aWYKKyAgICB9CisgIFhGbHVzaCAoRlJBTUVfWF9ESVNQTEFZIChmKSk7Cit9CisKKy8qIERyYXcg c3RyZXRjaCBnbHlwaCBzdHJpbmcgUy4gKi8KK3N0YXRpYyB2b2lkCittY194X2RyYXdfc3RyZXRj aF9nbHlwaF9zdHJpbmcgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMpCit7CisgIGVhc3NlcnQgKHMt PmZpcnN0X2dseXBoLT50eXBlID09IFNUUkVUQ0hfR0xZUEgpOworICBpZiAocy0+aGwgPT0gRFJB V19DVVJTT1IKKyAgICAgICYmICF4X3N0cmV0Y2hfY3Vyc29yX3ApCisgICAgeworICAgICAgLyog SWYgYHgtc3RyZXRjaC1jdXJzb3InIGlzIG5pbCwgZG9uJ3QgZHJhdyBhIGJsb2NrIGN1cnNvciBh cyB3aWRlIGFzIHRoZQorICAgICAgc3RyZXRjaCBnbHlwaC4gKi8KKyAgICAgIGludCB3aWR0aCwg YmFja2dyb3VuZF93aWR0aCA9IHMtPmJhY2tncm91bmRfd2lkdGg7CisgICAgICBpbnQgeCA9IHMt Png7CisgICAgICBpZiAoIXMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAgICAgICAgeworICAgICAgICAg IGludCBsZWZ0X3ggPSB3aW5kb3dfYm94X2xlZnRfb2Zmc2V0IChzLT53LCBURVhUX0FSRUEpOwor ICAgICAgICAgIGlmICh4IDwgbGVmdF94KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBi YWNrZ3JvdW5kX3dpZHRoIC09IGxlZnRfeCAtIHg7CisgICAgICAgICAgICAgIHggPSBsZWZ0X3g7 CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAg ICAgICAgICAgIC8qIEluIFIyTCByb3dzLCBkcmF3IHRoZSBjdXJzb3Igb24gdGhlIHJpZ2h0IGVk Z2Ugb2YgdGhlCisgICAgICAgICAgICAgICBzdHJldGNoIGdseXBoLiAqLworICAgICAgICAgICAg aW50IHJpZ2h0X3ggPSB3aW5kb3dfYm94X3JpZ2h0IChzLT53LCBURVhUX0FSRUEpOworICAgICAg ICAgICAgaWYgKHggKyBiYWNrZ3JvdW5kX3dpZHRoID4gcmlnaHRfeCkKKyAgICAgICAgICAgICAg YmFja2dyb3VuZF93aWR0aCAtPSB4IC0gcmlnaHRfeDsKKyAgICAgICAgICAgIHggKz0gYmFja2dy b3VuZF93aWR0aDsKKyAgICAgICAgICB9CisgICAgICB3aWR0aCA9IG1pbiAoRlJBTUVfQ09MVU1O X1dJRFRIIChzLT5mKSwgYmFja2dyb3VuZF93aWR0aCk7CisgICAgICBpZiAocy0+cm93LT5yZXZl cnNlZF9wKQorICAgICAgICB4IC09IHdpZHRoOworICAgICAgLyogRHJhdyBjdXJzb3IuICovCisg ICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JnX3JlY3QgKHMsIHgsIHMtPnksIHdpZHRoLCBzLT5o ZWlnaHQpOworICAgICAgLyogQ2xlYXIgcmVzdCB1c2luZyB0aGUgR0Mgb2YgdGhlIG9yaWdpbmFs IG5vbi1jdXJzb3IgZmFjZS4gKi8KKyAgICAgIGlmICh3aWR0aCA8IGJhY2tncm91bmRfd2lkdGgp CisgICAgICAgIHsKKyAgICAgICAgICBpbnQgeSA9IHMtPnk7CisgICAgICAgICAgaW50IHcgPSBi YWNrZ3JvdW5kX3dpZHRoIC0gd2lkdGgsIGggPSBzLT5oZWlnaHQ7CisgICAgICAgICAgWFJlY3Rh bmdsZSByOworICAgICAgICAgIEdDIGdjOworICAgICAgICAgIGlmICghcy0+cm93LT5yZXZlcnNl ZF9wKQorICAgICAgICAgICAgeCArPSB3aWR0aDsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAg ICB4ID0gcy0+eDsKKyAgICAgICAgICBpZiAocy0+cm93LT5tb3VzZV9mYWNlX3AKKyAgICAgICAg ICAgICAgJiYgY3Vyc29yX2luX21vdXNlX2ZhY2VfcCAocy0+dykpCisgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgIHhfc2V0X21vdXNlX2ZhY2VfZ2MgKHMpOworICAgICAgICAgICAgICBnYyA9 IHMtPmdjOworICAgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGdjID0g cy0+ZmFjZS0+Z2M7CisgICAgICAgICAgZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsICZy KTsKKyAgICAgICAgICB4X3NldF9jbGlwX3JlY3RhbmdsZXMgKHMtPmYsIGdjLCAmciwgMSk7Cisg ICAgICAgICAgaWYgKHMtPmZhY2UtPnN0aXBwbGUpCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIC8qIEZpbGwgYmFja2dyb3VuZCB3aXRoIGEgc3RpcHBsZSBwYXR0ZXJuLiAqLworICAgICAg ICAgICAgICBYU2V0RmlsbFN0eWxlIChGUkFNRV9YX0RJU1BMQVkgKHMtPmYpLCBnYywgRmlsbE9w YXF1ZVN0aXBwbGVkKTsKKyAgICAgICAgICAgICAgeF9maWxsX3JlY3RhbmdsZSAocy0+ZiwgZ2Ms IHgsIHksIHcsIGgpOworICAgICAgICAgICAgICBYU2V0RmlsbFN0eWxlIChGUkFNRV9YX0RJU1BM QVkgKHMtPmYpLCBnYywgRmlsbFNvbGlkKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBlbHNl CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIFhHQ1ZhbHVlcyB4Z2N2OworICAgICAgICAg ICAgICBYR2V0R0NWYWx1ZXMgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIGdjLCBHQ0ZvcmVncm91 bmQgfCBHQ0JhY2tncm91bmQsICZ4Z2N2KTsKKyAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQg KEZSQU1FX1hfRElTUExBWSAocy0+ZiksIGdjLCB4Z2N2LmJhY2tncm91bmQpOworICAgICAgICAg ICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChzLT5mLCBnYywgeCwgeSwgdywgaCk7CisgICAgICAgICAg ICAgIFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKHMtPmYpLCBnYywgeGdjdi5mb3Jl Z3JvdW5kKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICB4X3Jlc2V0X2NsaXBfcmVjdGFuZ2xl cyAocy0+ZiwgZ2MpOworICAgICAgICB9CisgICAgfQorICBlbHNlIGlmICghcy0+YmFja2dyb3Vu ZF9maWxsZWRfcCkKKyAgICB7CisgICAgICBpbnQgYmFja2dyb3VuZF93aWR0aCA9IHMtP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YmIHMtPnByZXYtPmhsICE9IHMtPmhsICYmIHMtPmxlZnRf b3ZlcmhhbmcpCisgICAgICAgICAgICAgICAgIHx8IChzLT5uZXh0ICYmIHMtPm5leHQtPmhsICE9 IHMtPmhsICYmIHMtPnJpZ2h0X292ZXJoYW5nKSkpCisgICAgICAvKiBXZSBtdXN0IGNsaXAganVz dCB0aGlzIGdseXBoLiAgbGVmdF9vdmVyaGFuZyBwYXJ0IGhhcyBhbHJlYWR5CisgICAgICAgICBk cmF3biB3aGVuIHMtPnByZXYgd2FzIGRyYXduLCBhbmQgcmlnaHRfb3ZlcmhhbmcgcGFydCB3aWxs IGJlCisgICAgICAgICBkcmF3biBsYXRlciB3aGVuIHMtPm5leHQgaXMgZHJhd24uICovCisgICAg ICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywgcyk7CisgICAgICBlbHNl CisgICAgICAgIHhfc2V0X2dseXBoX3N0cmluZ19jbGlwcGluZyAocyk7CisgIHN3aXRjaCAocy0+ Zmlyc3RfZ2x5cGgtPnR5cGUpCisgICAgeworICAgIGNhc2UgSU1BR0VfR0xZUEg6CisgICAgICB4 X2RyYXdfaW1hZ2VfZ2x5cGhfc3RyaW5nIChzKTsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgWFdJ REdFVF9HTFlQSDoKKyAgICAgIHhfZHJhd194d2lkZ2V0X2dseXBoX3N0cmluZyAocyk7CisgICAg ICBicmVhazsKKyAgICBjYXNlIFNUUkVUQ0hfR0xZUEg6CisgICAgICBtY194X2RyYXdfc3RyZXRj aF9nbHlwaF9zdHJpbmcgKHMpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBDSEFSX0dMWVBIOgor ICAgICAgaWYgKHMtPmZvcl9vdmVybGFwcykKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRf cCA9IHRydWU7CisgICAgICBlbHNlCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dy b3VuZCAocyw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AgICAgICAgICAgICBpZiAo cy0+ZmFjZS0+dW5kZXJsaW5lX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgICAgIHhfZHJhd191 bmRlcndhdmUgKHMpOworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgWEdDVmFsdWVzIHhnY3Y7CisgICAgICAgICAgICAgICAgICBYR2V0R0NW YWx1ZXMgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMtPmdjLCBHQ0ZvcmVncm91bmQsICZ4Z2N2 KTsKKyAgICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKHMt PmYpLCBzLT5nYywgcy0+ZmFjZS0+dW5kZXJsaW5lX2NvbG9yKTsKKyAgICAgICAgICAgICAgICAg IHhfZHJhd191bmRlcndhdmUgKHMpOworICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQg KEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMtPmdjLCB4Z2N2LmZvcmVncm91bmQpOworICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmIChzLT5mYWNlLT51 bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgICB7CisgICAgICAg ICAgICAgIHVuc2lnbmVkIGxvbmcgdGhpY2tuZXNzLCBwb3NpdGlvbjsKKyAgICAgICAgICAgICAg aW50IHk7CisgICAgICAgICAgICAgIGlmIChzLT5wcmV2ICYmIHMtPnByZXYtPmZhY2UtPnVuZGVy bGluZV9wCisgICAgICAgICAgICAgICAgICAmJiBzLT5wcmV2LT5mYWNlLT51bmRlcmxpbmVfdHlw ZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg ICAgLyogV2UgdXNlIHRoZSBzYW1lIHVuZGVybGluZSBzdHlsZSBhcyB0aGUgcHJldmlvdXMgb25l LiAqLworICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+cHJldi0+dW5kZXJsaW5lX3Ro aWNrbmVzczsKKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gcy0+cHJldi0+dW5kZXJsaW5l X3Bvc2l0aW9uOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJsaW5lIHRoaWNr bmVzcy4gIERlZmF1bHQgaXMgMSBwaXhlbC4gKi8KKyAgICAgICAgICAgICAgICAgIGlmIChzLT5m b250ICYmIHMtPmZvbnQtPnVuZGVybGluZV90aGlja25lc3MgPiAwKQorICAgICAgICAgICAgICAg ICAgICB0aGlja25lc3MgPSBzLT5mb250LT51bmRlcmxpbmVfdGhpY2tuZXNzOworICAgICAgICAg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAxOworICAgICAg ICAgICAgICAgICAgaWYgKHhfdW5kZXJsaW5lX2F0X2Rlc2NlbnRfbGluZSkKKyAgICAgICAgICAg ICAgICAgICAgcG9zaXRpb24gPSAocy0+aGVpZ2h0IC0gdGhpY2tuZXNzKSAtIChzLT55YmFzZSAt IHMtPnkpOworICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgICAgICAgLyogR2V0IHRoZSB1bmRlcmxpbmUgcG9zaXRpb24uICBUaGlz IGlzIHRoZSByZWNvbW1lbmRlZAorICAgICAgICAgICAgICAgICAgICAgICAgIHZlcnRpY2FsIG9m ZnNldCBpbiBwaXhlbHMgZnJvbSB0aGUgYmFzZWxpbmUgdG8gdGhlIHRvcCBvZgorICAgICAgICAg ICAgICAgICAgICAgICAgIHRoZSB1bmRlcmxpbmUuICBUaGlzIGlzIGEgc2lnbmVkIHZhbHVlIGFj Y29yZGluZyB0byB0aGUKKyAgICAgICAgICAgICAgICAgICAgICAgICBzcGVjcywgYW5kIGl0cyBk ZWZhdWx0IGlzCisgICAgICAgICAgICAgICAgICAgICAgICAgUk9VTkQgKChtYXhpbXVtIGRlc2Nl bnQpIC8gMiksIHdpdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICBST1VORCh4KSA9IGZsb29y ICh4ICsgMC41KSAgKi8KKyAgICAgICAgICAgICAgICAgICAgICBpZiAoeF91c2VfdW5kZXJsaW5l X3Bvc2l0aW9uX3Byb3BlcnRpZXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcy0+Zm9u dCAmJiBzLT5mb250LT51bmRlcmxpbmVfcG9zaXRpb24gPj0gMCkKKyAgICAgICAgICAgICAgICAg ICAgICAgIHBvc2l0aW9uID0gcy0+Zm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAg ICAgICAgICAgICAgIGVsc2UgaWYgKHMtPmZvbnQpCisgICAgICAgICAgICAgICAgICAgICAgICBw b3NpdGlvbiA9IChzLT5mb250LT5kZXNjZW50ICsgMSkgLyAyOworICAgICAgICAgICAgICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gdW5kZXJsaW5lX21p bmltdW1fb2Zmc2V0OworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBw b3NpdGlvbiA9IG1heCAocG9zaXRpb24sIHVuZGVybGluZV9taW5pbXVtX29mZnNldCk7CisgICAg ICAgICAgICAgICAgfQorICAgICAgICAgICAgICAvKiBDaGVjayB0aGUgc2FuaXR5IG9mIHRoaWNr bmVzcyBhbmQgcG9zaXRpb24uICBXZSBzaG91bGQKKyAgICAgICAgICAgICAgICAgYXZvaWQgZHJh d2luZyB1bmRlcmxpbmUgb3V0IG9mIHRoZSBjdXJyZW50IGxpbmUgYXJlYS4gKi8KKyAgICAgICAg ICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQgPD0gcy0+eWJhc2UgKyBwb3NpdGlvbikKKyAgICAg ICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5oZWlnaHQgLSAxKSAtIChzLT55YmFzZSAtIHMtPnkp OworICAgICAgICAgICAgICBpZiAocy0+eSArIHMtPmhlaWdodCA8IHMtPnliYXNlICsgcG9zaXRp b24gKyB0aGlja25lc3MpCisgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gKHMtPnkgKyBzLT5o ZWlnaHQpIC0gKHMtPnliYXNlICsgcG9zaXRpb24pOworICAgICAgICAgICAgICBzLT51bmRlcmxp bmVfdGhpY2tuZXNzID0gdGhpY2tuZXNzOworICAgICAgICAgICAgICBzLT51bmRlcmxpbmVfcG9z aXRpb24gPSBwb3NpdGlvbjsKKyAgICAgICAgICAgICAgeSA9IHMtPnliYXNlICsgcG9zaXRpb247 CisgICAgICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3ApCisgICAg ICAgICAgICAgICAgeF9maWxsX3JlY3RhbmdsZSAocy0+Ziwgcy0+Z2MsIHMtPngsIHksIHMtPndp ZHRoLCB0aGlja25lc3MpOworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgICAgWEdDVmFsdWVzIHhnY3Y7CisgICAgICAgICAgICAgICAgICBYR2V0 R0NWYWx1ZXMgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMtPmdjLCBHQ0ZvcmVncm91bmQsICZ4 Z2N2KTsKKyAgICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkg KHMtPmYpLCBzLT5nYywgcy0+ZmFjZS0+dW5kZXJsaW5lX2NvbG9yKTsKKyAgICAgICAgICAgICAg ICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCB5LCBzLT53aWR0aCwgdGhp Y2tuZXNzKTsKKyAgICAgICAgICAgICAgICAgI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VnaF9wKQorICAgICAgICB7CisgICAgICAgICAgdW5zaWduZWQgbG9uZyBoID0gMTsKKyAgICAg ICAgICB1bnNpZ25lZCBsb25nIGR5ID0gKHMtPmhlaWdodCAtIGgpIC8gMjsKKyAgICAgICAgICBp ZiAocy0+ZmFjZS0+c3RyaWtlX3Rocm91Z2hfY29sb3JfZGVmYXVsdGVkX3ApCisgICAgICAgICAg ICB4X2ZpbGxfcmVjdGFuZ2xlIChzLT5mLCBzLT5nYywgcy0+eCwgcy0+eSArIGR5LCBzLT53aWR0 aCwgaCk7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBYR0NW YWx1ZXMgeGdjdjsKKyAgICAgICAgICAgICAgWEdldEdDVmFsdWVzIChGUkFNRV9YX0RJU1BMQVkg KHMtPmYpLCBzLT5nYywgR0NGb3JlZ3JvdW5kLCAmeGdjdik7CisgICAgICAgICAgICAgIFhTZXRG b3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKHMtPmYpLCBzLT5nYywgcy0+ZmFjZS0+c3RyaWtl X3Rocm91Z2hfY29sb3IpOworICAgICAgICAgICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChzLT5mLCBz LT5nYywgcy0+eCwgcy0+eSArIGR5LCBzLT53aWR0aCwgaCk7CisgICAgICAgICAgICAgIFhTZXRG b3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKHMtPmYpLCBzLT5nYywgeGdjdi5mb3JlZ3JvdW5k KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgLyogRHJhdyByZWxpZWYgaWYgbm90 IHlldCBkcmF3bi4gKi8KKyAgICAgIGlmICghcmVsaWVmX2RyYXduX3AgJiYgcy0+ZmFjZS0+Ym94 ICE9IEZBQ0VfTk9fQk9YKQorICAgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYm94IChzKTsK KyAgICAgIGlmIChzLT5wcmV2KQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGdseXBoX3N0 cmluZyAqcHJldjsKKyAgICAgICAgICBmb3IgKHByZXYgPSBzLT5wcmV2OyBwcmV2OyBwcmV2ID0g cHJldi0+cHJldikKKyAgICAgICAgICAgIGlmIChwcmV2LT5obCAhPSBzLT5obAorICAgICAgICAg ICAgICAgICYmIHByZXYtPnggKyBwcmV2LT53aWR0aCArIHByZXYtPnJpZ2h0X292ZXJoYW5nID4g cy0+eCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIEFzIHByZXYgd2FzIGRy YXduIHdoaWxlIGNsaXBwZWQgdG8gaXRzIG93biBhcmVhLCB3ZQorICAgICAgICAgICAgICAgICAg IG11c3QgZHJhdyB0aGUgcmlnaHRfb3ZlcmhhbmcgcGFydCB1c2luZyBzLT5obCBub3cuICovCisg ICAgICAgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIHNhdmUgPSBwcmV2LT5obDsKKyAg ICAgICAgICAgICAgICBwcmV2LT5obCA9IHMtPmhsOworICAgICAgICAgICAgICAgIG1jX3hfc2V0 X2dseXBoX3N0cmluZ19nYyAocHJldiwgY3Vyc29yX2djX3ApOworICAgICAgICAgICAgICAgIHhf c2V0X2dseXBoX3N0cmluZ19jbGlwcGluZ19leGFjdGx5IChzLCBwcmV2KTsKKyAgICAgICAgICAg ICAgICBpZiAocHJldi0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSCkKKyAgICAgICAg ICAgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocHJldik7CisgICAgICAg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgeF9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9z dHJpbmdfZm9yZWdyb3VuZCAocHJldik7CisgICAgICAgICAgICAgICAgeF9yZXNldF9jbGlwX3Jl Y3RhbmdsZXMgKHByZXYtPmYsIHByZXYtPmdjKTsKKyAgICAgICAgICAgICAgICBwcmV2LT5obCA9 IHNhdmU7CisgICAgICAgICAgICAgICAgcHJldi0+bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICAg ICAgfQorICAgICAgICB9CisgICAgICBpZiAocy0+bmV4dCkKKyAgICAgICAgeworICAgICAgICAg IHN0cnVjdCBnbHlwaF9zdHJpbmcgKm5leHQ7CisgICAgICAgICAgZm9yIChuZXh0ID0gcy0+bmV4 dDsgbmV4dDsgbmV4dCA9IG5leHQtPm5leHQpCisgICAgICAgICAgICBpZiAobmV4dC0+aGwgIT0g cy0+aGwKKyAgICAgICAgICAgICAgICAmJiBuZXh0LT54IC0gbmV4dC0+bGVmdF9vdmVyaGFuZyA8 IHMtPnggKyBzLT53aWR0aCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIEFz IG5leHQgd2lsbCBiZSBkcmF3biB3aGlsZSBjbGlwcGVkIHRvIGl0cyBvd24gYXJlYSwKKyAgICAg ICAgICAgICAgICAgICB3ZSBtdXN0IGRyYXcgdGhlIGxlZnRfb3ZlcmhhbmcgcGFydCB1c2luZyBz LT5obCBub3cuICovCisgICAgICAgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIHNhdmUg PSBuZXh0LT5obDsKKyAgICAgICAgICAgICAgICBuZXh0LT5obCA9IHMtPmhsOworICAgICAgICAg ICAgICAgIG1jX3hfc2V0X2dseXBoX3N0cmluZ19nYyAobmV4dCwgY3Vyc29yX2djX3ApOworICAg ICAgICAgICAgICAgIHhfc2V0X2dseXBoX3N0cmluZ19jbGlwcGluZ19leGFjdGx5IChzLCBuZXh0 KTsKKyAgICAgICAgICAgICAgICBpZiAobmV4dC0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9H TFlQSCkKKyAgICAgICAgICAgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAo bmV4dCk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgeF9kcmF3X2Nv bXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAobmV4dCk7CisgICAgICAgICAgICAgICAg eF9yZXNldF9jbGlwX3JlY3RhbmdsZXMgKG5leHQtPmYsIG5leHQtPmdjKTsKKyAgICAgICAgICAg ICAgICBuZXh0LT5obCA9IHNhdmU7CisgICAgICAgICAgICAgICAgbmV4dC0+bnVtX2NsaXBzID0g MDsKKyAgICAgICAgICAgICAgICBuZXh0LT5jbGlwX2hlYWQgPSBzLT5uZXh0OworICAgICAgICAg ICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIC8qIFJlc2V0IGNsaXBwaW5nLiAqLworICB4X3Jl c2V0X2NsaXBfcmVjdGFuZ2xlcyAocy0+Ziwgcy0+Z2MpOworICBzLT5udW1fY2xpcHMgPSAwOwor fQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogLyogRGVmYXVsdCB0byB1c2luZyBYSU0gaWYgYXZhaWxhYmxlLiAgKi8KICNpZmRlZiBV U0VfWElNCiBib29sIHVzZV94aW0gPSB0cnVlOwpAQCAtMTEwOSw2ICsyMDA3LDE2IEBAIHN0YXRp YyB2b2lkCiB4X3VwZGF0ZV9iZWdpbiAoc3RydWN0IGZyYW1lICpmKQogewogICAvKiBOb3RoaW5n IHRvIGRvLiAgKi8KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKworICBmLT5tY191cGRhdGluZ19mcmFtZSA9IGY7CisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKIH0KIAogLyogRHJhdyBhIHZlcnRpY2FsIHdpbmRvdyBib3JkZXIgZnJv bSAoeCx5MCkgdG8gKHgseTEpICAqLwpAQCAtMTI1NCw2ICsyMTYyLDE2IEBAIHhfdXBkYXRlX2Vu ZCAoc3RydWN0IGZyYW1lICpmKQogICBYRmx1c2ggKEZSQU1FX1hfRElTUExBWSAoZikpOwogICB1 bmJsb2NrX2lucHV0ICgpOwogI2VuZGlmCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisv KiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBOVUxMOwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiB9CiAKIC8qIFRoaXMgZnVuY3Rpb24gaXMg Y2FsbGVkIGZyb20gdmFyaW91cyBwbGFjZXMgaW4geGRpc3AuYwpAQCAtMTMyMzgsNiArMTQxNTYs MjAgQEAgZXh0ZXJuIGZyYW1lX3Bhcm1faGFuZGxlciB4X2ZyYW1lX3Bhcm1faGFuZGxlcnNbXTsK IAogc3RhdGljIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlIHhfcmVkaXNwbGF5X2ludGVyZmFj ZSA9CiAgIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNP UlMgKi8KKworLyogYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGB4dGVybS5jYCBtdXN0IGJlIGlu IHRoZSBleGFjdCBzYW1lIG9yZGVyIGFzIHRoZQorYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGBk aXNwZXh0ZXJuLmhgISAqLworCisgIG1jX3hfZHJhd193aW5kb3dfY3Vyc29yLAorICBtY194X2Ry YXdfZ2x5cGhfc3RyaW5nLAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgeF9m cmFtZV9wYXJtX2hhbmRsZXJzLAogICAgIGd1aV9wcm9kdWNlX2dseXBocywKICAgICBndWlfd3Jp dGVfZ2x5cGhzLAo= --Multipart_Tue_Jul_16_12:28:01_2019-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs). References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Tue, 23 Jul 2019 06:02:02 +0000 Resent-Message-ID: <handler.22873.B22873.15638616886204 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22873 <at> debbugs.gnu.org,17684 <at> debbugs.gnu.org Cc: eliz@HIDDEN, johnw@HIDDEN, mbork@HIDDEN, rms@HIDDEN, akioburns@HIDDEN Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.15638616886204 (code B ref 22873); Tue, 23 Jul 2019 06:02:02 +0000 Received: (at 22873) by debbugs.gnu.org; 23 Jul 2019 06:01:28 +0000 Received: from localhost ([127.0.0.1]:33883 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1hpnrc-0001bv-8d for submit <at> debbugs.gnu.org; Tue, 23 Jul 2019 02:01:28 -0400 Received: from gateway30.websitewelcome.com ([192.185.145.3]:49315) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1hpnrZ-0001bf-4O for 22873 <at> debbugs.gnu.org; Tue, 23 Jul 2019 02:01:25 -0400 Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway30.websitewelcome.com (Postfix) with ESMTP id A4FA8F1B3 for <22873 <at> debbugs.gnu.org>; Tue, 23 Jul 2019 01:01:24 -0500 (CDT) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id pnrXh4HRn2PzOpnrYhBwPq; Tue, 23 Jul 2019 01:01:24 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=wDaZC0BFsHP2hMpbdDoLNx03WvfLda1+Vp3dBQahUkM=; b=ZKz9WyobF42q/uaOvWiCtbkRbK YPoYzs2i3xeC47YHUaYgCsf9G+moko+1Ayr5U4KSvZN5fct/u04di1r8fDdAYBvkbcuY+YtzALsS/ Gd1CY5oR7eVpbxOVQm1WMHzmY2huV7+yWDz8sNFWgdcxUaehZjqpVqM8aUfWzrOaBCWhukaPhgPX2 jg+YjuNhfUkk/d/mEyRy9AcPphqJcz4v/9WUAn2LOKq+OcsRnUXU7Wj0hZ14/77qIhhNjEq27ukmO bY1Tm5cmcQAcy2yV7rZyN1QrsCJIxAYePH5im6XJkmZY8PtqEo+YCQNvZ0ogGzn6S9Fuy8ppgFRmQ UW7yYOYg==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:54630 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from <esq@HIDDEN>) id 1hpnrU-000tY1-73; Tue, 23 Jul 2019 01:01:23 -0500 Date: Mon, 22 Jul 2019 23:01:19 -0700 Message-ID: <m2wog98f2o.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Mon_Jul_22_23:01:18_2019-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1hpnrU-000tY1-73 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:54630 X-Source-Auth: lawlist X-Email-Count: 7 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> --Multipart_Mon_Jul_22_23:01:18_2019-1 Content-Type: text/plain; charset=US-ASCII VERSION: 022.001 [07/22/2019] CHANGELOG: - `mc_update_window_erase' no longer sets the `same_p` struct member to `false`, as this was undoing all of the work that had previously been done to discover and set `same_p` to `true` in previous loops through the caches of fake cursors. Although this bug may have been somewhat difficult for the naked eye to see, the fix will improve the overall performance in some situations by reducing the need to erase and redraw certain fake cursors. - Miscellaneous tidying-up of code. VIDEOS: w32: https://youtu.be/r3BdJVlsAnQ ns: https://youtu.be/bc1h8jtbXmw x11: https://youtu.be/aCIFhD2Xz5s SCREENSHOTS: https://www.lawlist.com/images/22873_17684_light_dark_backgrounds.png SETUP: Step 1: git clone -b master git://git.sv.gnu.org/emacs.git Step 2: In the new emacs folder, go back to an Emacs version from 07/14/2019: git reset --hard ac57c5093829ee09084c562bbbc1c412179be13d Step 3: From within the new emacs folder created in Step 1, apply the patch: git apply /path/to/the/patch.diff Step 4: ./autogen.sh Step 5: ./configure ... [your custom options] Step 6: make Step 7: make install USAGE: - For a minimal working example of built-in fake cursors, type: M-x mc-test ;;; TURN ON FAKE CURSORS (buffer position, cursor-type, cursor color): (setq mc-conf '((1 "hbar" "magenta") (2 "bar" "purple") (3 "box" "#00FF00") (4 "hollow" "#0000FF") (5 ("hbar" 3) [1.0 0.0 1.0]) (6 ("bar" 3) [0.0 1.0 1.0]) (7 "framed" "OrangeRed")))) ;;; TURN OFF FAKE CURSORS: (setq mc-conf nil) - To try out both the crosshairs feature and the visible fill column indicator feature, type: M-x +-mode - To try out just the visible fill column indicator feature, type: M-x fc-mode - To try out built-in fake cursors with Magnar Sveen's multiple-cursors package, that package must be installed. If the multiple-cursors package is already installed, then just (require 'crosshairs) and `crosshairs.el` will redefine a few of the multiple-cursors functions and set up a few keyboard shortcuts. If the multiple-cursors package by Magnar Sveen is not already installed, then here are two easy ways to install that package: Type: M-x mc-install OR, evaluate the following snippet: (progn (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) (package-refresh-contents) (package-install 'multiple-cursors) (mc/built-in-cursors)) TODO: - When an idle-timer fires and point is at the end of a horizontally scrolled line in a narrow window, the temporary horizontal scroll is canceled. Create a minimal working example and file a bug report. (progn (defun test () (interactive) (let ((ov (make-overlay (point) (1+ (point)) nil t t))) (overlay-put ov 'face '(:foreground "red")))) (global-set-key [f5] 'test) (split-window-horizontally) (switch-to-buffer (get-buffer-create "foo")) (setq bidi-display-reordering nil) (setq-local auto-hscroll-mode 'current-line) (dotimes (i 80) (insert (char-to-string (+ 65 i))))) - `ns_draw_window_cursor' calls `ns_clip_to_rect', which does _not_ take `row->clip` into consideration when drawing cursors with `NSRectFill'. When it comes time to draw glyphs on top of the box/hollow family of cursors, `row->clip` is taken into consideration by `get_glyph_string_clip'. Fake cursors can be drawn even though the glyphs cannot, resulting in hollow/box family of cursors without text. The issue can be reproduced with M-x mc-test. [A temporary workaround is to disable `row->clip` while drawing the glyphs.] https://lists.gnu.org/archive/html/emacs-devel/2019-04/msg00009.html - Deal with left/right overwritten glyphs in the w32 and X ports of Emacs. - There is a bug affecting the recorded `w->mc.lnum_pixel_width` that is observable when not running under gdb, but disappears when running under gdb. While viewing a folded org-mode buffer, the non-gdb instance had a visible line number pixel-width of 44, but Emacs treated it as fluctuating between 44 and 55 as the cursor was moved to the end of line. In the gdb instance, the visible line number pixel width was 55 with no fluctuation under the same conditions as the non-gdb instance. This appears to be a different bug than bug#32177 (current line number shifts one column to the left) because the line number of the current line does not shift left, and changing the bidi settings did not correct the issue. - The current test for `auto_hscroll_mode_p' only looks for `current_line` and all five related tests are based upon that assumption, which may not be true. - Multiple Cursors: If point is in the middle of a composite character, then select a fully composed character so that the fake cursor is visible. - Implement functionality similar to the Lisp multiple-cursors by Magnar Sveen. - Follow up with the Emacs team re bug#32177; i.e., (Current line number shifts one column to the left.) - Follow up with the Emacs team re bug#32060; i.e., Horizontal Scrolling (Current Line): Wrong line gets h-scrolled. - Determine if bug #28936 needs to be fixed and help the Emacs team re same. - Is there any additional meaningful optimization that can be added to the three calls of `mc_pre_scroll_clean'? - There is a bug affecting an older version of Emacs for the NS port that causes partial line flickering when the same characters are grouped together (;;;;;;) and MC_GLYPHLESS cursors are above or below -- having the same background color as the frame; e.g., black on black (used to erase a glyphless cursor). The partial flickering is only noticeable with rapid fire; e.g., holding down the right/left arrow key. When changing the color of the glyphless cursor, the issue is not present. [@lawlist has verified that the X and HPOS coordinates are accurate.] - NOTE: As to `mc_scrolling_window', it would appear that there is no tangible benefit to rotating the current/prospective cache of fake cursors to compare the data before removing the fake cursors. When scrolling the display, only _some_ lines are copied to new locations. Areas that are not overwritten may have fake cursors and those may not necessarily be removed if desired/current matrix glyphs are equal. The test for `GLYPH_EQUAL_P' does not take into consideration the existence of a fake cursor, and the glyph (with a fake cursor) may not be updated as a result thereof. As to lines that are not copied, portions may be updated and fake cursors would be removed thereby. --Multipart_Mon_Jul_22_23:01:18_2019-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="2019_07_22__21_18_46_990.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvY3Jvc3NoYWlycy5lbCBiL2xpc3AvY3Jvc3NoYWlycy5lbApuZXcg ZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi43ODI3NTJmCi0tLSAvZGV2L251bGwKKysr IGIvbGlzcC9jcm9zc2hhaXJzLmVsCkBAIC0wLDAgKzEsMTI4OCBAQAorOzs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Cis7OzsgQkVHSU4gbW9kaWZpY2F0aW9uIG9mIHRoZSBNdWx0aXBsZSBDdXJzb3Jz IGxpYnJhcnkgd3JpdHRlbiBieSAgTWFnbmFyIFN2ZWVuLgorCisoZGVmdmFyIHBhY2thZ2UtYXJj aGl2ZXMpCisKKyhkZWZ2YXIgbWMtLW1heC1jdX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zb3JzLW9yaWdpbmFsCisgICAgICAo c2V0cSBtYy0tbWF4LWN1cnNvcnMtb3JpZ2luYWwgbWMvbWF4LWN1cnNvcnMpKQorICAgICh3aGVu IG1jL21heC1jdXJzb3JzCisgICAgICAodW5sZXNzICg8IChtYy9udW0tY3Vyc29ycykgbWMvbWF4 LWN1cnNvcnMpCisgICAgICAgIChpZiAoeWVzLW9yLW5vLXAgKGZvcm1hdCAiJWQgYWN0aXZlIGN1 cnNvcnMuIENvbnRpbnVlPyAiIChtYy9udW0tY3Vyc29ycykpKQorICAgICAgICAgICAgKHNldHEg bWMvbWF4LWN1cnNvcnMgKHJlYWQtbnVtYmVyICJFbnRlciBhIG5ldywgdGVtcG9yYXJ5IG1heGlt dW06ICIpKQorICAgICAgICAgIChtYy9yZW1vdmUtZmFrZS1jdXJzb3JzKQorICAgICAgICAgIChl cnJvciAiQWJvcnRlZDogdG9vIG1hbnkgY3Vyc29ycyIpKSkpCisgICAgKGxldCAoKG92ZXJsYXkK KyAgICAgICAgICAgIChpZiBtYy91c2UtYnVpbHQtaW4tY3Vyc29ycworICAgICAgICAgICAgICAo bWFrZS1vdmVybGF5IChwb2ludCkgKHBvaW50KSkKKyAgICAgICAgICAgICAgKG1jL21ha2UtY3Vy c29yLW92ZXJsYXktYXQtcG9pbnQpKSkpCisgICAgICAob3ZlcmxheS1wdXQgb3ZlcmxheSAnbWMt aWQgKG9yIGlkIChtYy9jcmVhdGUtY3Vyc29yLWlkKSkpCisgICAgICAob3ZlcmxheS1wdXQgb3Zl cmxheSAndHlwZSAnZmFrZS1jdXJzb3IpCisgICAgICAob3ZlcmxheS1wdXQgb3ZlcmxheSAncHJp b3JpdHkgMTAwKQorICAgICAgKG1jL3N0b3JlLWN1cnJlbnQtc3RhdGUtaW4tb3ZlcmxheSBvdmVy bGF5KQorICAgICAgKHdoZW4gKHVzZS1yZWdpb24tcCkKKyAgICAgICAgKG92ZXJsYXktcHV0IG92 ZXJsYXkgJ3JlZ2lvbi1vdm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WFu ZCBjb21wYXJhYmxlIGJ5IGBlcScuCisgICAgICAgICAgICAgICAgKHNldHEgb3JpZ2luYWwtY29t bWFuZCAoaW50ZXJuIChzeW1ib2wtbmFtZSBvcmlnaW5hbC1jb21tYW5kKSkpCisgICAgICAgICAg ICAgICAgOzsgb3RoZXJ3aXNlIGl0J3MgYSBzeW1ib2wsIGFuZCB3ZSBjYW4gYmUgbW9yZSB0aG9y b3VnaAorICAgICAgICAgICAgICAgIChpZiAoZ2V0IG9yaWdpbmFsLWNvbW1hbmQgJ21jLS11bnN1 cHBvcnRlZCkKKyAgICAgICAgICAgICAgICAgICAgKG1lc3NhZ2UgIiVTIGlzIG5vdCBzdXBwb3J0 ZWQgd2l0aCBtdWx0aXBsZSBjdXJzb3JzJXMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg IG9yaWdpbmFsLWNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdldCBvcmln aW5hbC1jb21tYW5kICdtYy0tdW5zdXBwb3J0ZWQpKQorICAgICAgICAgICAgICAgICAgKHdoZW4g KGFuZCBvcmlnaW5hbC1jb21tYW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChub3Qg KG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy0tZGVmYXVsdC1jbWRzLXRvLXJ1bi1vbmNlKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKG5vdCAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1j L2NtZHMtdG8tcnVuLW9uY2UpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAob3IgbWMv YWx3YXlzLXJ1bi1mb3ItYWxsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVt cSBvcmlnaW5hbC1jb21tYW5kIG1jLS1kZWZhdWx0LWNtZHMtdG8tcnVuLWZvci1hbGwpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jL2Nt ZHMtdG8tcnVuLWZvci1hbGwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWMv cHJvbXB0LWZvci1pbmNsdXNpb24taW4td2hpdGVsaXN0IG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAg ICAgICAgICAgICAgICAgICAgKG1jL2V4ZWN1dGUtY29tbWFuZC1mb3ItYWxsLWZha2UtY3Vyc29y cyBvcmlnaW5hbC1jb21tYW5kKSkpKQorICAgICAgICAgICAgICAod2hlbiBtYy91c2UtYnVpbHQt aW4tY3Vyc29ycworICAgICAgICAgICAgICAgIChzZXRxIG1jLWNvbmYKKyAgICAgICAgICAgICAg ICAgICAgICAgIChtYXBjYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKGxhbWJkYSAoeCkg KGxpc3QgKG92ZXJsYXktc3RhcnQgeCkgImJhciIgbmlsKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgKG1jL2FsbC1mYWtlLWN1cnNvcnMpKSkpKSkpKSkpCisKKyAgKGRlZnVuIG1jL21hcmst bmV4dC1saWtlLXRoaXMtY3ljbGUtZm9yd2FyZCAoKQorICAiTWFya3MgbmV4dCBvY2N1cmVuY2Ug b2Ygd29yZCBsaWtlIHRoaXMgYW5kIGFkdmFuY2VzIGN1cnNvciB0byB0aGlzIG9jY3VycmVuY2Ui CisgIChpbnRlcmFjdGl2ZSkKKyAgICAobWMvbWFyay1uZXh0LWxpa2UtdGhpcyAxKSkKKworICAo ZGVmdW4gbWMvbWFyay1wcmV2aW91cy1saWtlLXRoaXMtY3ljbGUtZm9yd2FyZCAoKQorICAiTWFy a3MgbmV4dCBvY2N1cnJlbmNlIG9mIHdvcmQgbGlrZSB0aGlzIGFuZCBhZHZhbmNlcyBjdXJzb3Ig dG8gdGhpcyBvY2N1cnJlbmNlIgorICAoaW50ZXJhY3RpdmUpCisgICAgKG1jL21hcmstcHJldmlv dXMtbGlrZS10aGlzIDEpKQorCisgIChhZGQtdG8tbGlzdC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G9yJywgd2hpY2ggd29ya3Mgd2VsbCB3aXRoIExTTC4g IGB3MzJ0ZXJtLmMnIHVzZXMKK2BQQUxFVFRFUkdCJyBvciBgUkdCJywgYW5kIHRoZSBjb252ZXJz aW9uIGZyb20gTFNMIGlzIGRvbmUgaW50ZXJuYWxseSBieQorbXVsdGlwbHlpbmcgZWFjaCBlbGVt ZW50IG9mIHRoZSBMU0wgY29sb3IgdmVjdG9yIGJ5IDI1NS4gIGB4dGVybS5jJyB1c2VzCitgeF9t YWtlX3RydWVjb2xvcl9waXhlbCcsIHdoaWNoIHVzZXMgMTYtYml0IFJHQiAtLSB0aGUgY29udmVy c2lvbiBmcm9tIExTTAoraGFwcGVucyBpbnRlcm5hbGx5IGJ5IG11bHRpcGx5aW5nIGVhY2ggZWxl bWVudCBvZiB0aGUgTFNMIGNvbG9yIHZlY3RvciBieSA2NTUzNS4iCisoaW50ZXJhY3RpdmUpCisg IChsZXQgKChidWZmZXIgKGdldC1idWZmZXItY3JlYXRlICIqTUMtVEVTVCoiKSkpCisgICAgKHdp dGgtY3VycmVudC1idWZmZXIgYnVmZmVyCisgICAgICAoZXJhc2UtYnVmZmVyKQorICAgICAgKGlu c2VydCAiVGhpcyBpcyBhIHRlc3QhIikKKyAgICAgIChzZXRxIG1jLWNvbmYgJygoMSAiaGJhciIg Im1hZ2VudGEiKQorICAgICAgICAgICAgICAgICAgICAgICgyICJiYXIiICJwdXJwbGUiKQorICAg ICAgICAgICAgICAgICAgICAgICgzICJib3giICIjMDBGRjAwIikKKyAgICAgICAgICAgICAgICAg ICAgICAoNCAiaG9sbG93IiAiIzAwMDBGRiIpCisgICAgICAgICAgICAgICAgICAgICAgKDUgKCJo YmFyIiAzKSBbMS4wIDAuMCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg2ICgiYmFyIiAz KSBbMC4wIDEuMCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg3ICJmcmFtZWQiICJPcmFu Z2VSZWQiKQorICAgICAgICAgICAgICAgICAgICAgICg4ICJib3giICJncmV5MjUiKQorICAgICAg ICAgICAgICAgICAgICAgICg5ICJib3giICJncmV5NzUiKSkpKQorICAgIChzZWxlY3Qtd2luZG93 IChkaXNwbGF5LWJ1ZmZlciBidWZmZXIpKSkpCisKKyhkZWZ1biArLXRpbWVyLWZuICgpCisiU2lu Y2UgdGhpcyBmaXJlcyBnbG9iYWxseSwgd2UgbXVzdCBjb250cm9sIHdoaWNoIGJ1ZmZlcnMgY3Jv c3NoYWlycyBhcHBlYXIgaW4uIgorICAod2hlbiArLW1vZGUKKyAgICAodW5sZXNzIChvciAobWVt cSBsYXN0LWNvbW1hbmQgKy1wYXJlbnMtZXhjbHVzaW9ucykKKyAgICAgICAgICAgICAgICAobnVs bCArLXBhcmVucy1wKSkKKyAgICAgICgrLXBhcmVucy1mbikpCisgICAgKHdoZW4gKy10aW1lci12 YXIKKyAgICAgIChzZXRxIHRpbWVyLWlkbGUtbGlzdCAoZGVscSArLXRpbWVyLXZhciB0aW1lci1p ZGxlLWxpc3QpKQorICAgICAgKHNldHEgKy10aW1lci12YXIgbmlsKSkpKQorCisoZGVmdW4gKy1k cmF3LWZvcnRod2l0aCAoKQorIkltbWVkaWF0ZWx5IGRlbGV0ZS9kcmF3IG1hdGNoaW5nIHBhcmVu dGhlc2VzLiIKKyAgKCstZHJhdy1jcm9zc2hhaXJzICdmb3JjZSkpCisKKyhkZWZ1biArLWRyYXct Y3Jvc3NoYWlycyAoJm9wdGlvbmFsIGZvcmNlKQorIkltbWVkaWF0ZWx5IGRlbGV0ZSBtYXRjaGlu ZyBwYXJlbnRoZXNlcy4gIElmIEZPUkNFIGlzIG5vbi1uaWwsIHRoZW4gaW1tZWRpYXRlbHkKK2Ry YXcgbWF0Y2hpbmcgcGFyZW50aGVzaXM7IG90aGVyd2lzZSwgZHJhdyB0aGVtIG9uIGFuIGlkbGUt dGllci4iCisgICh3aGVuICstbW9kZQorICAgICh3aGVuICstdGltZXItdmFyCisgICAgICAoc2V0 cSB0aW1lci1pZGxlLWxpc3QgKGRlbHEgKy10aW1lci12YXIgdGltZXItaWRsZS1saXN0KSkKKyAg ICAgIChzZXRxICstdGltZXItdmFyIG5pbCkpCisgICAgKHVubGVzcyAob3IgKG1lbXEgdGhpcy1j b21tYW5kICstcGFyZW5zLWV4Y2x1c2lvbnMpCisgICAgICAgICAgICAgICAgKGFuZCAobnVsbCAr LXBhcmVucy1wKQorICAgICAgICAgICAgICAgICAgICAgKG51bGwgKy1wYXJlbnMtb3ZlcmxheXMt ZXhpc3QtcCkpKQorICAgICAgKCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykpCisgICAgKGlmIGZv cmNlCisgICAgICAocHJvZ24KKyAgICAgICAgKHdoZW4gKy1wYXJlbnMtcAorICAgICAgICAgICgr LXBhcmVucy1mbikpKQorICAgICAgKHNldHEgKy10aW1lci12YXIgKHJ1bi13aXRoLWlkbGUtdGlt ZXIgKy1pZGxlLXRpbWVyLXNlY29uZHMgbmlsICMnKy10aW1lci1mbikpKSkpCisKKyhkZWZ2YXIg ZmMtbW9kZSkKKworOzs7IyMjYXV0b2xvYWQKKyhkZWZpbmUtbWlub3ItbW9kZSArLW1vZGUKKyJN aW5vciBtb2RlIGZvciBkaXNwbGF5aW5nIGEgaG9yaXpvbnRhbCBydWxlci4iCisgIDppbml0LXZh bHVlIG5pbAorICA6bGlnaHRlciAiICsiCisgIDprZXltYXAgbmlsCisgIDpnbG9iYWwgbmlsCisg IDpncm91cCAnKy1tb2RlCisgIChjb25kCisgICAgKCstbW9kZQorICAgICAgOzs7IGArLW1vZGUn IGhhcyB0aGUgYWJpbGl0eSB0byBhbHNvIGRpc3BsYXkgYSBmaWxsIGNvbHVtbiBpbmRpY2F0b3Iu CisgICAgICA7OzsgU2VlIHRoZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicuCisgICAgICAod2hl biBmYy1tb2RlCisgICAgICAgIChmYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgZ2xvYmFs LWVsZG9jLW1vZGUKKyAgICAgICAgICAgICAgICAgKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAgJ2Fu eSkKKyAgICAgICAgICAgICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAg ICAgICAgKGdsb2JhbC1lbGRvYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgaml0LWxvY2st Y29udGV4dC10aW1lcgorICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAn YW55KQorICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQor ICAgICAgICAod2hlbiAodGltZXJwIGppdC1sb2NrLWNvbnRleHQtdGltZXIpCisgICAgICAgICAg KGNhbmNlbC10aW1lciBqaXQtbG9jay1jb250ZXh0LXRpbWVyKSkKKyAgICAgICAgOzsgKHNldHEg aml0LWxvY2stY29udGV4dC10aW1lciAocnVuLXdpdGgtaWRsZS10aW1lciA1LjAgJ3JlcGVhdCAn aml0LWxvY2stY29udGV4dC1mb250aWZ5KSkKKyAgICAgICAgKHNldHEgaml0LWxvY2stY29udGV4 dC10aW1lciBuaWwpKQorICAgICAgKHdoZW4gKGFuZCAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAn YW55KQorICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQor ICAgICAgICAod2hlbiAodGltZXJwIHVuZG8tYXV0by1jdXJyZW50LWJvdW5kYXJ5LXRpbWVyKQor ICAgICAgICAgIChjYW5jZWwtdGltZXIgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIp KQorICAgICAgICAoZnNldCAndW5kby1hdXRvLS11bmRvYWJsZS1jaGFuZ2UKKyAgICAgICAgICAg ICAgKGxhbWJkYSAoKSAoYWRkLXRvLWxpc3QgJ3VuZG8tYXV0by0tdW5kb2FibHktY2hhbmdlZC1i dW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iaWRpLWRpc3BsYXktcmVvcmRlcmluZycgaXMgc2V0 IHRvIGEgbmlsIHZhbHVlLgorICAgICAgOzs7IEhvd2V2ZXIsIG1vc3QgdXNlcnMgd2lsbCBwcm9i YWJseSBub3Qgd2FudCB0aGlzIHBhcnRpY3VsYXIgc2V0dGluZy4KKyAgICAgICh1bmxlc3MgKG51 bGwgYmlkaS1kaXNwbGF5LXJlb3JkZXJpbmcpCisgICAgICAgIChzZXRxIGJpZGktZGlzcGxheS1y ZW9yZGVyaW5nIG5pbCkpCisgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICcrLS1zYXZl ZC1zdGF0ZSkgbmlsKQorICAgICAgKGRvbGlzdCAodmFyICcoYnVmZmVyLWRpc3BsYXktdGFibGUK KyAgICAgICAgICAgICAgICAgICAgIGZyaW5nZS1pbmRpY2F0b3ItYWxpc3QKKyAgICAgICAgICAg ICAgICAgICAgIHRhYi13aWR0aAorICAgICAgICAgICAgICAgICAgICAgbGluZS1tb3ZlLXZpc3Vh bAorICAgICAgICAgICAgICAgICAgICAgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgICAgICAgICAg ICAgIHRydW5jYXRlLXBhcnRpYWwtd2lkdGgtd2luZG93cworICAgICAgICAgICAgICAgICAgICAg d29yZC13cmFwKSkKKyAgICAgICAgKHdoZW4gKGxvY2FsLXZhcmlhYmxlLXAgdmFyKQorICAgICAg ICAgIChwdXNoIChjb25zIHZhciAoc3ltYm9sLXZhbHVlIHZhcikpICstLXNhdmVkLXN0YXRlKSkp CisgICAgICAoc2V0cSBmaWxsLWNvbHVtbiA4MCkKKyAgICAgIChzZXRxIGRpc3BsYXktbGluZS1u dW1iZXJzIHQpCisgICAgICAoc2V0cS1sb2NhbCBhdXRvLWhzY3JvbGwtbW9kZSAnY3VycmVudC1s aW5lKQorICAgICAgKHNldHEtbG9jYWwgaHNjcm9sbC1zdGVwIDUpCisgICAgICAoc2V0cSBidWZm ZXItZGlzcGxheS10YWJsZSArLWJ1ZmZlci1kaXNwbGF5LXRhYmxlKQorICAgICAgKHNldHEgdGFi LXdpZHRoIDQpCisgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICdsaW5lLW1vdmUtdmlz dWFsKSB0KQorICAgICAgKHNldHEgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgKGNvbmQKKyAgICAg ICAgICAoKGxldCAoKGxzdCArLXRydW5jYXRlLWxpbmVzLWRlcml2ZWQtbW9kZXMpCisgICAgICAg ICAgICAgICAgICBtb2RlKQorICAgICAgICAgICAgKGNhdGNoICdmb3VuZAorICAgICAgICAgICAg ICAod2hpbGUgKHNldHEgbW9kZSAocG9wIGxzdCkpCisgICAgICAgICAgICAgICAgKHdoZW4gKGRl cml2ZWQtbW9kZS1wIG1vZGUpCisgICAgICAgICAgICAgICAgICAodGhyb3cgJ2ZvdW5kIHQpKSkp KSkKKyAgICAgICAgICAgKChtZW1xIG1ham9yLW1vZGUgKy10cnVuY2F0ZS1saW5lcy1tYWpvci1t b2RlcykpCisgICAgICAgICAgICh0CisgICAgICAgICAgICAgbmlsKSkpCisgICAgICAoc2V0ICht YWtlLWxvY2FsLXZhcmlhYmxlICd0cnVuY2F0ZS1wYXJ0aWFsLXdpZHRoLXdpbmRvd3MpIG5pbCkK KyAgICAgIChzZXRxIHdvcmQtd3JhcCB0KQorICAgICAgKHNldHEgaW5kaWNhdGUtZW1wdHktbGlu ZXMgdCkKKyAgICAgIChzZXRxIGluZGljYXRlLWJ1ZmZlci1ib3VuZGFyaWVzICdsZWZ0KQorICAg ICAgKHNldHEgZnJpbmdlLWluZGljYXRvci1hbGlzdAorICAgICAgICAgIDs7OyBoc2NsX2FsbF90 ZW1wX3AgfCBoc2NsX3RlbXBfcAorICAgICAgICAnKCgrLWhzY2wtdGVtcCAuICgrLXNpbmdsZS1h bmdsZS1sZWZ0CisgICAgICAgICAgICAgICAgICAgICAgICAgICstZG91YmxlLWFuZ2xlLWxlZnQp KQorICAgICAgICAgIDs7OyBoc2NsX2FsbF9wZXJtXzBfcCB8IGhzY2xfYWxsX3Blcm1fMV9wIHwg aHNjbF9hbGxfcGVybV8yX3AgfCBoc2NsX3Blcm1fcAorICAgICAgICAgICgrLWhzY2wtcGVybSAu ICgrLXNpbmdsZS1hbmdsZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLWRvdWJsZS1h bmdsZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLXRyaXBsZS1hbmdsZS11cAorICAg ICAgICAgICAgICAgICAgICAgICAgICArLXF1YWRydXBsZS1hbmdsZS11cCkpCisgICAgICAgICAg KCstb3ZlcmxheS1hcnJvdyAuICgrLWZyaW5nZS1sZWZ0LWFycm93CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICArLWZyaW5nZS1yaWdodC1hcnJvdykpCisgICAgICAgICAgKHRydW5jYXRp b24gLiAoKy1mcmluZ2UtbGVmdC1hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICstZnJp bmdlLXJpZ2h0LWFycm93KSkKKyAgICAgICAgICAoY29udGludWF0aW9uIC4gKCstZnJpbmdlLWxl ZnQtY3VybHktYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICstYmFja3NsYXNoKSkK KyAgICAgICAgICAob3ZlcmxheS1hcnJvdyAuICstZnJpbmdlLXJpZ2h0LXRyaWFuZ2xlKQorICAg ICAgICAgICh1cCAuICstZnJpbmdlLXVwLWFycm93KQorICAgICAgICAgIChkb3duIC4gKy1mcmlu Z2UtZG93bi1hcnJvdykKKyAgICAgICAgICAodG9wIC4gKy1mcmluZ2UtdG9wLWxlZnQtYW5nbGUp CisgICAgICAgICAgKGJvdHRvbSAuICstZnJpbmdlLWJvdHRvbS1yaWdodC1hbmdsZSkKKyAgICAg ICAgICAodG9wLWJvdHRvbSAuICgrLWZyaW5nZS1sZWZ0LWJyYWNrZXQKKyAgICAgICAgICAgICAg ICAgICAgICAgICArLWZyaW5nZS1yaWdodC1icmFja2V0CisgICAgICAgICAgICAgICAgICAgICAg ICAgKy1mcmluZ2UtdG9wLXJpZ2h0LWFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgKy1m cmluZ2UtdG9wLWxlZnQtYW5nbGUpKQorICAgICAgICAgIChlbXB0eS1saW5lIC4gKy1mcmluZ2Ut ZW1wdHktbGluZSkKKyAgICAgICAgICAodW5rbm93biAuICstZnJpbmdlLXF1ZXN0aW9uLW1hcmsp KSkKKyAgICAgIChzZXRxIGZyaW5nZS1jdXJzb3ItYWxpc3QgJygoYm94IC4gKy1mcmluZ2UtbGVm dC10cmlhbmdsZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaG9sbG93IC4g Ky1ob2xsb3ctcmVjdGFuZ2xlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChi YXIgLiArLXZlcnRpY2FsLWJhcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo aGJhciAuICstZnJpbmdlLWhvcml6b250YWwtYmFyKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIChob2xsb3ctc21hbGwgLiArLWZyaW5nZS1ob2xsb3ctc3F1YXJlKSkpCisgICAg ICAoaWYgKG9yICstZm9ydGh3aXRoCisgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZp eC1hcmcgJyg0KSkpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJh dy1mb3J0aHdpdGggJ2FwcGVuZCAnbG9jYWwpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21t YW5kLWhvb2sgJystZHJhdy1jcm9zc2hhaXJzICdhcHBlbmQgJ2xvY2FsKSkKKyAgICAgICh3aGVu ICstZm9ydGh3aXRoCisgICAgICAgIChhZGQtaG9vayAnd2luZG93LWNvbmZpZ3VyYXRpb24tY2hh bmdlLWhvb2sgJystZHJhdy1mb3J0aHdpdGggbmlsICdsb2NhbCkpCisgICAgICAoYWRkLWhvb2sg J2NoYW5nZS1tYWpvci1tb2RlLWhvb2sgJ3R1cm4tb2ZmLSstbW9kZSBuaWwgJ2xvY2FsKQorICAg ICAgOzs7IE1hdGNoaW5nIHBhcmVudGhlc2VzIGRyYXdpbmcgZm9ydGh3aXRoIGludGVyZmVyZXMg d2l0aCB5YXNuaXBwZXQuCisgICAgICAod2hlbiArLWZvcnRod2l0aAorICAgICAgICAoc2V0cSAr LXBhcmVucy1wIG5pbCkpCisgICAgICAod2hlbiAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55 KQorICAgICAgICAoY29uZAorICAgICAgICAgICgrLWZvcnRod2l0aAorICAgICAgICAgICAgKG1l c3NhZ2UgIlR1cm5lZCBPTiBgKy1tb2RlJyAtLSBEcmF3IG1hdGNoaW5nIHBhcmVudGhlc2VzIGlt bWVkaWF0ZWx5LiIpKQorICAgICAgICAgICgoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkp CisgICAgICAgICAgICA7OzsgTWF0Y2hpbmcgcGFyZW50aGVzZXMgd2lsbCBiZSBkcmF3biBpbW1l ZGlhdGVseS4KKyAgICAgICAgICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScgLS0gT3B0 aW1pemVkIGZvciBkZWJ1Z2dpbmcgcHVycG9zZXMuIikpCisgICAgICAgICAgKHQKKyAgICAgICAg ICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScuIikpKSkpCisgICAgKHQKKyAgICAgIChr aWxsLWxvY2FsLXZhcmlhYmxlICdmaWxsLWNvbHVtbikKKyAgICAgIChraWxsLWxvY2FsLXZhcmlh YmxlICdhdXRvLWhzY3JvbGwtbW9kZSkKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdoc2Ny b2xsLXN0ZXApCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnY3Jvc3NoYWlycykKKyAgICAg IChraWxsLWxvY2FsLXZhcmlhYmxlICdmYy12aXNpYmxlKQorIC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7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7CisKKyhkZWZ1biArLXBhcmVucy1mbiAoKQorICAiRG9jLXN0cmluZy4iCisgIChsZXQqICgo b3BvaW50IChwb2ludCkpCisgICAgICAgICAoZnJvbSAoaWYgKy1wYXJlbnMtZnJvbS1mbgorICAg ICAgICAgICAgICAgICAoZnVuY2FsbCArLXBhcmVucy1mcm9tLWZuKQorICAgICAgICAgICAgICAg ICAocG9pbnQtbWluKSkpCisgICAgICAgICAod2luIChzZWxlY3RlZC13aW5kb3cpKQorICAgICAg ICAgKGkgMCkKKyAgICAgICAgIChwcmVjZWRpbmctY2hhciAocHJlY2VkaW5nLWNoYXIpKQorICAg ICAgICAgKG9jaGFyIChjaGFyLWFmdGVyIG9wb2ludCkpCisgICAgICAgICAocG9zMQorICAgICAg ICAgICAoY29uZAorICAgICAgICAgICAgICgoYW5kIG9jaGFyCisgICAgICAgICAgICAgICAgICAg KG9yIDs7OyAoY2hhci10by1zdHJpbmcgNDApID0+IG9wZW5pbmcgcGFyZW50aGVzaXMKKyAgICAg ICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgNDApCisgICAgICAgICAgICAgICAgICAgICAgIDs7 OyAoY2hhci10by1zdHJpbmcgOTEpID0+IG9wZW5pbmcgc3F1YXJlIGJyYWNrZXQKKyAgICAgICAg ICAgICAgICAgICAgICAgKD0gb2NoYXIgOTEpCisgICAgICAgICAgICAgICAgICAgICAgIDs7OyAo Y2hhci10by1zdHJpbmcgMTIzKSA9PiBvcGVuaW5nIHdhdnkgYnJhY2tldAorICAgICAgICAgICAg ICAgICAgICAgICAoPSBvY2hhciAxMjMpKSkKKyAgICAgICAgICAgICAgICAobWluICgxKyBvcG9p bnQpIChwb2ludC1tYXgpKSkKKyAgICAgICAgICAgICAoKG9yIDs7OyAoY2hhci10by1zdHJpbmcg NDEpID0+IGNsb3NpbmcgcGFyZW50aGVzaXMKKyAgICAgICAgICAgICAgICAgICg9IHByZWNlZGlu Zy1jaGFyIDQxKQorICAgICAgICAgICAgICAgICAgOzs7IChjaGFyLXRvLXN0cmluZyA5MykgPT4g Y2xvc2luZyBzcXVhcmUgYnJhY2tldAorICAgICAgICAgICAgICAgICAgKD0gcHJlY2VkaW5nLWNo YXIgOTMpCisgICAgICAgICAgICAgICAgICA7OzsgKGNoYXItdG8tc3RyaW5nIDEyNSkgPT4gY2xv c2luZyB3YXZ5IGJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICg9IHByZWNlZGluZy1jaGFyIDEy NSkpCisgICAgICAgICAgICAgICAgKG1heCAocG9pbnQtbWluKSAoMS0gb3BvaW50KSkpCisgICAg ICAgICAgICAgKHQKKyAgICAgICAgICAgICAgICBvcG9pbnQpKSkKKyAgICAgICAgIHBvczIKKyAg ICAgICAgIHNlbGVjdGVkLWZhY2UpCisgICAgKHNhdmUtZXhjdXJzaW9uCisgICAgICAoY29uZGl0 aW9uLWNhc2UgbmlsCisgICAgICAgICh3aGlsZSAoc2V0cSBwb3MxIChudGggMSAocGFyc2UtcGFy dGlhbC1zZXhwIGZyb20gcG9zMSkpKQorICAgICAgICAgIChzZXRxIHBvczIgKHNjYW4tc2V4cHMg cG9zMSAxKSkKKyAgICAgICAgICAoaWYgKD0gaSAxMCkKKyAgICAgICAgICAgIChzZXRxIGkgMSkK KyAgICAgICAgICAgIChzZXRxIGkgKDErIGkpKSkKKyAgICAgICAgICAoc2V0cSBzZWxlY3RlZC1m YWNlIChjb25kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDEpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLW9uZS1mYWNlKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSAyKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICcrLXBhcmVucy10d28tZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKCg9IGkgMykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1w YXJlbnMtdGhyZWUtZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkg NCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtZm91ci1mYWNl KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA1KQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1maXZlLWZhY2UpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICgoPSBpIDYpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJystcGFyZW5zLXNpeC1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAoKD0gaSA3KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1z ZXZlbi1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA4KQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1laWdodC1mYWNlKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA5KQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICcrLXBhcmVucy1uaW5lLWZhY2UpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICgoPSBpIDEwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICcrLXBhcmVucy10ZW4tZmFjZSkpKQorICAgICAgICAgIChsZXQgKChvdiAobWFrZS1vdmVybGF5 IHBvczEgKDErIHBvczEpKSkpCisgICAgICAgICAgICAodW5sZXNzICstcGFyZW5zLWluYWN0aXZl LXdpbmRvd3MKKyAgICAgICAgICAgICAgKG92ZXJsYXktcHV0IG92ICd3aW5kb3cgd2luKSkKKyAg ICAgICAgICAgIChvdmVybGF5LXB1dCBvdiAnZmFjZSBzZWxlY3RlZC1mYWNlKSkKKyAgICAgICAg ICAod2hlbiBwb3MyCisgICAgICAgICAgICAobGV0ICgob3YgKG1ha2Utb3ZlcmxheSAoMS0gcG9z MikgcG9zMikpKQorICAgICAgICAgICAgICAodW5sZXNzICstcGFyZW5zLWluYWN0aXZlLXdpbmRv d3MKKyAgICAgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ3dpbmRvdyB3aW4pKQorICAgICAg ICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ2ZhY2Ugc2VsZWN0ZWQtZmFjZSkpKSkKKyAgICAgICAg KGVycm9yIG5pbCkpKQorICAgIChzZXRxICstcGFyZW5zLW92ZXJsYXlzLWV4aXN0LXAgdCkpKQor CisoZGVmdW4gKy1yZW1vdmUtb3ZlcmxheXMgKGJlZyBlbmQgbmFtZSB2YWwpCisiUmVtb3ZlIHRo ZSBvdmVybGF5cyB0aGF0IGFyZSBgZXF1YWwtaW5jbHVkaW5nLXByb3BlcnRpZXNgLgorSW5jbHVk ZXMgYSB1bmlxdWUgc2l0dWF0aW9uIHdoZW4gYW4gb3ZlcmxheSB3aXRoIGFuIGAnYWZ0ZXItc3Ry aW5nYCBwcm9wZXJ0eQoraXMgYXQgdGhlIHZlcnkgZW5kIG9mIGEgbmFycm93ZWQtYnVmZmVyLiIK KyAgKGxldCogKChwb2ludC1tYXggKHBvaW50LW1heCkpCisgICAgICAgICAocG9pbnQtbWluIChw b2ludC1taW4pKQorICAgICAgICAgKG5hcnJvd2VkLXAgKGJ1ZmZlci1uYXJyb3dlZC1wKSkKKyAg ICAgICAgIChiZWcgKGlmIGJlZyBiZWcgcG9pbnQtbWluKSkKKyAgICAgICAgIChlbmQKKyAgICAg ICAgICAgKGNvbmQKKyAgICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAobm90IG5h cnJvd2VkLXApCisgICAgICAgICAgICAgICAgIGVuZCkKKyAgICAgICAgICAgICAgIGVuZCkKKyAg ICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAobm90IG5hcnJvd2VkLXApCisgICAg ICAgICAgICAgICAgIChudWxsIGVuZCkpCisgICAgICAgICAgICAgICBwb2ludC1tYXgpCisgICAg ICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFycm93ZWQtcAorICAgICAgICAgICAg ICAgICBlbmQKKyAgICAgICAgICAgICAgICAgKDwgZW5kIHBvaW50LW1heCkpCisgICAgICAgICAg ICAgICBlbmQpCisgICAgICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFycm93ZWQt cAorICAgICAgICAgICAgICAgICBlbmQKKyAgICAgICAgICAgICAgICAgKD0gZW5kIHBvaW50LW1h eCkpCisgICAgICAgICAgICAgICAoMSsgZW5kKSkKKyAgICAgICAgICAgICAoKGFuZAorICAgICAg ICAgICAgICAgICBuYXJyb3dlZC1wCisgICAgICAgICAgICAgICAgIChudWxsIGVuZCkpCisgICAg ICAgICAgICAgICAoMSsgcG9pbnQtbWF4KSkgKSkKKyAgICAgICAgIChvdmVybGF5cworICAgICAg ICAgICAocHJvZ24KKyAgICAgICAgICAgICAob3ZlcmxheS1yZWNlbnRlciBlbmQpCisgICAgICAg ICAgICAgKG92ZXJsYXlzLWluIGJlZyBlbmQpKSkpCisgICAgKHdoZW4gKGFuZCBiZWcgZW5kIG5h bWUgdmFsKQorICAgICAgKGRvbGlzdCAobyBvdmVybGF5cykKKyAgICAgICAgKGNvbmQKKyAgICAg ICAgICAoKGFuZCAoZXEgbmFtZSAnZmFjZSkKKyAgICAgICAgICAgICAgICAoZXEgKG92ZXJsYXkt Z2V0IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIDs7IEVpdGhlciBwdXNoIHRoaXMgb3Zlcmxh eSBvdXRzaWRlIGJlZy4uLmVuZAorICAgICAgICAgICAgOzsgb3Igc3BsaXQgaXQgdG8gZXhjbHVk ZSBiZWcuLi5lbmQKKyAgICAgICAgICAgIDs7IG9yIGRlbGV0ZSBpdCBlbnRpcmVseSAoaWYgaXQg aXMgY29udGFpbmVkIGluIGJlZy4uLmVuZCkuCisgICAgICAgICAgICAoaWYgKDwgKG92ZXJsYXkt c3RhcnQgbykgYmVnKQorICAgICAgICAgICAgICAgIChpZiAoPiAob3ZlcmxheS1lbmQgbykgZW5k KQorICAgICAgICAgICAgICAocHJvZ24KKyAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IChj b3B5LW92ZXJsYXkgbykKKyAgICAgICAgICAgICAgICAgIChvdmVybGF5LXN0YXJ0IG8pIGJlZykK KyAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVuZCBvKSkpCisg ICAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gKG92ZXJsYXktc3RhcnQgbykgYmVnKSkK KyAgICAgICAgICAgICAgKGlmICg+IChvdmVybGF5LWVuZCBvKSBlbmQpCisgICAgICAgICAgICAg ICAgICAobW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVuZCBvKSkKKyAgICAgICAgICAgICAg ICAoZGVsZXRlLW92ZXJsYXkgbykpKSkKKyAgICAgICAgICAoKGFuZCAobm90IChlcSBuYW1lICdm YWNlKSkKKyAgICAgICAgICAgICAgICAoZXF1YWwtaW5jbHVkaW5nLXByb3BlcnRpZXMgKG92ZXJs YXktZ2V0IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIChkZWxldGUtb3ZlcmxheSBvKSkpKSkp KQorCisoZGVmdW4gKy1kZWxldGUtcGFyZW5zLW92ZXJsYXlzICgpCisgICh3aGVuICstcGFyZW5z LW92ZXJsYXlzLWV4aXN0LXAKKyAgICAoZG9saXN0IChmYWNlICcoKy1wYXJlbnMtb25lLWZhY2UK KyAgICAgICAgICAgICAgICAgICAgKy1wYXJlbnMtdHdvLWZhY2UKKyAgICAgICAgICAgICAgICAg ICAgKy1wYXJlbnMtdGhyZWUtZmFjZQorICAgICAgICAgICAgICAgICAgICArLXBhcmVucy1mb3Vy LWZhY2UKKyAgICAgICAg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bmlsCisgIDpnbG9iYWwgbmlsCisgIDpncm91 cCAnZmMtbW9kZQorICAoY29uZAorICAgIDs7OyBgKy1tb2RlJyBoYXMgdGhlIGFiaWxpdHkgdG8g YWxzbyBkaXNwbGF5IGEgZmlsbCBjb2x1bW4gaW5kaWNhdG9yLgorICAgIDs7OyBTZWUgdGhlIHZh cmlhYmxlIGArLWZpbGwtY29sdW1uJy4KKyAgICAoKGFuZCBmYy1tb2RlICstbW9kZSkKKyAgICAg IChzZXRxIGZjLW1vZGUgbmlsKQorICAgICAgKG1lc3NhZ2UgIlR1cm5lZCBPRkYgYGZjLW1vZGUn ICglcykgLS0gc2VlIHRoZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicuIiAoY3VycmVudC1idWZm ZXIpKSkKKyAgICAoZmMtbW9kZQorICAgICAgKHdoZW4gKGFuZCBnbG9iYWwtZWxkb2MtbW9kZQor ICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAg ICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAoZ2xvYmFs LWVsZG9jLW1vZGUgLTEpKQorICAgICAgKHdoZW4gKGFuZCBqaXQtbG9jay1jb250ZXh0LXRpbWVy CisgICAgICAgICAgICAgICAgIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAg ICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVu ICh0aW1lcnAgaml0LWxvY2stY29udGV4dC10aW1lcikKKyAgICAgICAgICAoY2FuY2VsLXRpbWVy IGppdC1sb2NrLWNvbnRleHQtdGltZXIpKQorICAgICAgICA7OyAoc2V0cSBqaXQtbG9jay1jb250 ZXh0LXRpbWVyIChydW4td2l0aC1pZGxlLXRpbWVyIDUuMCAncmVwZWF0ICdqaXQtbG9jay1jb250 ZXh0LWZvbnRpZnkpKQorICAgICAgICAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIG5pbCkp CisgICAgICAod2hlbiAoYW5kIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAg ICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVu ICh0aW1lcnAgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpCisgICAgICAgICAgKGNh bmNlbC10aW1lciB1bmRvLWF1dG8tY3VycmVudC1ib3VuZGFyeS10aW1lcikpCisgICAgICAgIChm c2V0ICd1bmRvLWF1dG8tLXVuZG9hYmxlLWNoYW5nZQorICAgICAgICAgICAgICAobGFtYmRhICgp IChhZGQtdG8tbGlzdCAndW5kby1hdXRvLS11bmRvYWJseS1jaGFuZ2VkLWJ1ZmZlcnMgKGN1cnJl bnQtYnVmZmVyKSkpKQorICAgICAgICAoZnNldCAndW5kby1hdXRvLWFtYWxnYW1hdGUgJ2lnbm9y ZSkpCisgICAgICAod2hlbiBibGluay1jdXJzb3ItbW9kZQorICAgICAgICAoYmxpbmstY3Vyc29y LW1vZGUgLTEpCisgICAgICAgICh3aGVuIChtZW1xICdibGluay1jdXJzb3ItY2hlY2sgcG9zdC1j b21tYW5kLWhvb2spCisgICAgICAgICAgKHJlbW92ZS1ob29rICdwb3N0LWNvbW1hbmQtaG9vayAn YmxpbmstY3Vyc29yLWNoZWNrKSkpCisgICAgICAoc2V0cSBmYy12aXNpYmxlIHQpCisgICAgICA7 OzsgYGF1dG8tY29tcG9zaXRpb24tbW9kZScgaXMgbmVlZGVkIGZvciBjcm9zc2hhaXJzIHRvIHBy b3Blcmx5IGNhbGN1bGF0ZQorICAgICAgOzs7IGNvb3JkaW5hdGVzIG9mIGNvbXBvc2l0aW9uIGNo YXJhY3RlcnMuICBBdXRvbWF0aWNhbGx5IGJlY29tZXMgcGVybWFuZW50bHkKKyAgICAgIDs7OyBi dWZmZXItbG9jYW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ZSIpKSkK KyAgIkZhY2UgZm9yIGArLXJldmVyc2VkLWJhci1hdC16di1mYWNlJy4iCisgIDpncm91cCAnKy1t b2RlKQorCisoZGVmZmFjZSArLXJldmVyc2VkLWJhci1wb3N0LXp2LWZhY2UKKyAgJygodCAoOmZv cmVncm91bmQgImN5YW40IikpKQorICAiRmFjZSBmb3IgYCstcmV2ZXJzZWQtYmFyLXBvc3QtenYt ZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1ldmVuLXByZS16di1mYWNl CisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBkYXJrKSkK KyAgICAgOmZvcmVncm91bmQgInllbGxvdyIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29s b3JzIDg4KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJjeWFuMSIpCisg ICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDE2KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAg ICAgOmZvcmVncm91bmQgInllbGxvdyIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3Jz IDE2KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJjeWFuMSIpCisgICAg KCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDgpKQorICAgICA6Zm9yZWdyb3VuZCAid2hpdGUi KQorICAgICgoKHR5cGUgdHR5KSAoY2xhc3MgbW9ubykpCisgICAgIDppbnZlcnNlLXZpZGVvIHQp CisgICAgKHQgOmZvcmVncm91bmQgInBpbmsiKSkKKyAgIkZhY2UgZm9yIGArLWV2ZW4tcHJlLXp2 LWZhY2UnLiIKKyAgOmdyb3VwICcrLW1vZGUpCisKKyhkZWZmYWNlICstZXZlbi1pbmFjdGl2ZS1w cmUtenYtZmFjZQorICAnKCgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91 bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICIjZWVlOGFhIikKKyAgICAoKChjbGFzcyBjb2xv cikgKG1pbi1jb2xvcnMgODgpIChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQg ImJsdWUxIikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgMTYpIChiYWNrZ3JvdW5k IGRhcmspKQorICAgICA6Zm9yZWdyb3VuZCAiI2VlZThhYSIpCisgICAgKCgoY2xhc3MgY29sb3Ip IChtaW4tY29sb3JzIDE2KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJi bHVlMSIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDgpKQorICAgICA6Zm9yZWdy b3VuZCAid2hpdGUiKQorICAgICgoKHR5cGUgdHR5KSAoY2xhc3MgbW9ubykpCisgICAgIDppbnZl cnNlLXZpZGVvIHQpCisgICAgKHQgOmZvcmVncm91bmQgInBpbmsiKSkKKyAgIkZhY2UgZm9yIGAr LWV2ZW4taW5hY3RpdmUtcHJlLXp2LWZhY2UnLiIKKyAgOmdyb3VwICcrLW1vZGUpCisKKyhkZWZm YWNlICstZXZlbi1hdC16di1mYWNlCisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4 KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgIkRlZXBQaW5rMSIpCisgICAg KCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAg IDpmb3JlZ3JvdW5kICJEZWVwUGluazEiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9y cyAxNikgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJEZWVwUGluazEiKQor ICAgICgoKGNsYXNzIG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ZW4taW5hY3Rp dmUtYXQtenYtZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1ldmVuLXBv c3QtenYtZmFjZQorICAnKCgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91 bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJEYXJrT2xpdmVHcmVlbjMiKQorICAgICgoKGNs YXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9y ZWdyb3VuZCAiY3lhbjQiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJh Y2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJEYXJrT2xpdmVHcmVlbjMiKQorICAg ICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQpKQorICAg ICA6Zm9yZWdyb3VuZCAiY3lhbjQiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4 KSkKKyAgICAgOmZvcmVncm91bmQgIndoaXRlIikKKyAgICAoKCh0eXBlIHR0eSkgKGNsYXNzIG1v bm8pKQorICAgICA6aW52ZXJzZS12aWRlbyB0KQorICAgICh0IDpmb3JlZ3JvdW5kICJwaW5rIikp CisgICJGYWNlIGZvciBgKy1ldmVuLXBvc3QtenYtZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkK KworKGRlZmZhY2UgKy1ldmVuLWluYWN0aXZlLXBvc3QtenYtZmFjZQorICAnKCgoKGNsYXNzIGNv bG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5k ICJEYXJrT2xpdmVHcmVlbjQiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkg KGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6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WZhY2UnLiIKKyAgOmdyb3Vw ICcrLW1vZGUpCisKKyhkZWZmYWNlICstb2RkLWluYWN0aXZlLXBvc3QtenYtZmFjZQorICAnKCgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpm b3JlZ3JvdW5kICJzaWVubmE0IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgODgp IChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTQiKQorICAgICgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpm b3JlZ3JvdW5kICJzaWVubmE0IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgMTYp IChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTQiKQorICAgICgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4KSkKKyAgICAgOmZvcmVncm91bmQgIndoaXRlIikK KyAgICAoKCh0eXBlIHR0eSkgKGNsYXNzIG1vbm8pKQorICAgICA6aW52ZXJzZS12aWRlbyB0KQor ICAgICh0IDpmb3JlZ3JvdW5kICJwaW5rIikpCisgICJGYWNlIGZvciBgKy1vZGQtaW5hY3RpdmUt cG9zdC16di1mYWNlJy4iCisgIDpncm91cCAnKy1tb2RlKQorCisoZGVmZmFjZSArLXBvc3QtZmls bC1wcmUtenYtZmFjZQorICAnKCgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tn cm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJncmVlbjEiKQorICAgICgoKGNsYXNzIGNv bG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3Vu ZCAiZ3JlZW4xIikKKyAgICAoKCh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vcnMgMTYpIChi YWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgIlBhbGVHcmVlbjMiKQorICAgICgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4KSkKKyAgICAgOmZvcmVncm91bmQgIndoaXRlIikK KyAgICAoKCh0eXBlIHR0eSkgKGNsYXNzIG1vbm8pKQorICAgICA6aW52ZXJzZS12aWRlbyB0KQor ICAgICh0IDpmb3JlZ3JvdW5kICJwaW5rIikpCisgICJGYWNlIGZvciBgKy1wb3N0LWZpbGwtcG9z dC16di1mYWNlJy4iCisgIDpncm91cCAnKy1tb2RlKQorCisoZGVmZmFjZSArLXBvc3QtZmlsbC1p bmFjdGl2ZS1wb3N0LXp2LWZhY2UKKyAgJygoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgODgp IChiYWNrZ3JvdW5kIGRhcmspKQorICAgICA6Zm9yZWdyb3VuZCAiUGFsZUdyZWVuNCIpCisgICAg KCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAg IDpmb3JlZ3JvdW5kICJEYXJrT2xpdmVHcmVlbiIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4t Y29sb3JzIDE2KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgIlBhbGVHcmVl bjQiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGln aHQpKQorICAgICA6Zm9yZWdyb3VuZCAiRGFya09saXZlR3JlZW4iKQorICAgICgoKGNsYXNzIGNv bG9yKSAobWluLWNvbG9ycyA4KSkKKyAgICAgOmZvcmVncm91bmQgIndoaXRlIikKKyAgICAoKCh0 eXBlIHR0eSkgKGNsYXNzIG1vbm8pKQorICAgICA6aW52ZXJzZS12aWRlbyB0KQorICAgICh0IDpm b3JlZ3JvdW5kICJwaW5rIikpCisgICJGYWN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QoreworICBiLT5jaF9ob3Jpem9udGFsX3J1bGVyXyA9IHZhbDsKK30KKwor c3RhdGljIHZvaWQKK2JzZXRfY2hfdmVydGljYWxfcnVsZXIgKHN0cnVjdCBidWZmZXIgKmIsIExp c3BfT2JqZWN0IHZhbCkKK3sKKyAgYi0+Y2hfdmVydGljYWxfcnVsZXJfID0gdmFsOworfQorCitz dGF0aWMgdm9pZAorYnNldF9jaF9pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBM aXNwX09iamVjdCB2YWwpCit7CisgIGItPmNoX2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQor CitzdGF0aWMgdm9pZAorYnNldF9mY192aXNpYmxlIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09i amVjdCB2YWwpCit7CisgIGItPmZjX3Zpc2libGVfID0gdmFsOworfQorCitzdGF0aWMgdm9pZAor YnNldF9mY19pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2 YWwpCit7CisgIGItPmZjX2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQorCisvKiBlbmQgTVVM VElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogc3RhdGljIHZv aWQKIGJzZXRfYWJicmV2X21vZGUgKHN0cnVjdCBidWZmZXIgKmIsIExpc3BfT2JqZWN0IHZhbCkK IHsKQEAgLTUxNDUsNiArNTIwOCwyNCBAQCBpbml0X2J1ZmZlcl9vbmNlICh2b2lkKQogICBic2V0 X2xhc3Rfc2VsZWN0ZWRfd2luZG93ICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBtYWtlX2ZpeG51bSAo MCkpOwogCiAgIGlkeCA9IDE7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqK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GVmYXVs dHMsIFF0KTsKKyAgYnNldF9mY192aXNpYmxlICgmYnVmZmVyX2RlZmF1bHRzLCBRbmlsKTsKKyAg YnNldF9mY19pbmFjdGl2ZV93aW5kb3dzICgmYnVmZmVyX2RlZmF1bHRzLCBRdCk7CisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICAgYnNldF9tb2RlX2xpbmVfZm9ybWF0ICgmYnVmZmVy X2RlZmF1bHRzLCBidWlsZF9wdXJlX2Nfc3RyaW5nICgiJS0iKSk7CiAgIGJzZXRfaGVhZGVyX2xp bmVfZm9ybWF0ICgmYnVmZmVyX2RlZmF1bHRzLCBRbmlsKTsKICAgYnNldF9hYmJyZXZfbW9kZSAo JmJ1ZmZlcl9kZWZhdWx0cywgUW5pbCk7CkBAIC01NDYxLDYgKzU1NjAsNTEgQEAgZGVmdmFyX3Bl cl9idWZmZXIgKHN0cnVjdCBMaXNwX0J1ZmZlcl9PYmpmd2QgKmJvX2Z3ZCwgY29uc3QgY2hhciAq bmFtZXN0cmluZywKIHZvaWQKIHN5bXNfb2ZfYnVmZmVyICh2b2lkKQogeworCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIERFRlNZTSAoUW1j X3JlYWxfZmFrZV9jdXJzb3IsICJtYy1yZWFsLWZha2UtY3Vyc29yIik7CisgIERFRlZBUl9QRVJf QlVGRkVSICgibWMtcmVhbC1mYWtlLWN1cnNvciIsICZCVkFSIChjdXJyZW50X2J1ZmZlciwgbWNf cmVhbF9mYWtlX2N1cnNvciksIFFuaWwsCisgICAgZG9jOiAvKiBBIGJ1ZmVyLWxvY2FsIHZhcmlh YmxlIHRvIHNldCB0aGUgY3Vyc29yIHR5cGUgb2YgdGhlIH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N0aXZlX3dpbmRvdywgImZjLWluYWN0aXZlLXdpbmRvdyIpOwor ICBERUZWQVJfUEVSX0JVRkZFUiAoImZjLWluYWN0aXZlLXdpbmRvd3MiLCAmQlZBUiAoY3VycmVu dF9idWZmZXIsIGZjX2luYWN0aXZlX3dpbmRvd3MpLCBRbmlsLAorICAgIGRvYzogLyogV2hlbiBu b24tbmlsLCBkcmF3IG11bHRpcGxlIGN1cnNvcnMgZmlsbCBjb2x1bW4gaW4gaW5hY3RpdmUgd2lu ZG93cy4gKi8pOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIHN0YXRpY3BybyAo Jmxhc3Rfb3ZlcmxheV9tb2RpZmljYXRpb25faG9va3MpOwogICBsYXN0X292ZXJsYXlfbW9kaWZp Y2F0aW9uX2hvb2tzID0gbWFrZV9uaWxfdmVjdG9yICgxMCk7CiAKZGlmZiAtLWdpdCBhL3NyYy9i dWZmZXIuaCBiL3NyYy9idWZmZXIuaAppbmRleCAyMDgwYTZmLi4xYWRhOTNlIDEwMDY0NAotLS0g YS9zcmMvYnVmZmVyLmgKKysrIGIvc3JjL2J1ZmZlci5oCkBAIC03NDAsNiArNzQwLDQwIEBAIHN0 cnVjdCBidWZmZXIKICAgICAgaW4gdGhlIGRpc3BsYXkgb2YgdGhpcyBidWZmZXIuICAqLwogICBM aXNwX09iamVjdCBleHRyYV9saW5lX3NwYWNpbmdfOwogCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8qIFRoZSBjdXJzb3IgdHlwZSBvZiB0 aGUgcmVhbCBmYWtlIGN1cnNvci4gKi8KKyAgTGlzcF9PYmplY3QgbWNfcmVhbF9mYWtlX2N1cnNv cl87CisKKyAgLyogVGhlIG5hbWUgb2YgbGlzdCB1c2VkIGJ5IG11bHRpcGxlIGN1cnNvcnMgZm9y IG5leHQgcmVkaXNwbGF5LiAqLworICBMaXNwX09iamVjdCBtY19jb25mXzsKKworICAvKiBXaGV0 aGVyIHRvIGRyYXcgbXVsdGlwbGUgY3Vyc29ycyBpbiBpbmFjdGl2ZSB3aW5kb3dzLiAqLworICBM aXNwX09iamVjdCBtY19pbmFjdGl2ZV93aW5kb3dzXzsKKworICAvKiBUaGUgbmFtZSBvZiB0aGUg YnVmZmVyLWxvY2FsIHZhcmlhYmxlLiAqLworICBMaXNwX09iamVjdCBjcm9zc2hhaXJzXzsKKwor ICAvKiBUaGUgbmFtZSBvZiB0aGUgY3Jvc3NoYWlycyBob3Jpem9udGFsIHJ1bGVyLiAqLworICBM aXNwX09iamVjdCBjaF9ob3Jpem9udGFsX3J1bGVyXzsKKworICAvKiBUaGUgbmFtZSBvZiB0aGUg Y3Jvc3NoYWlycyB2ZXJ0aWNhbCBydWxlci4gKi8KKyAgTGlzcF9PYmplY3QgY2hfdmVydGljYWxf cnVsZXJfOworCisgIC8qIFdoZXRoZXIgdG8gZHJhdyBjcm9zc2hhaXJzIGluIGluYWN0aXZlIHdp bmRvd3MuICovCisgIExpc3BfT2JqZWN0IGNoX2luYWN0aXZlX3dpbmRvd3NfOworCisgIC8qIFRo ZSBuYW1lIG9mIHRoZSBidWZmZXItbG9jYWwgdmFyaWFibGUuICovCisgIExpc3BfT2JqZWN0IGZj X3Zpc2libGVfOworCisgIC8qIFdoZXRoZXIgdG8gZHJhdyBtdWx0aXBsZSBjdXJzb3JzIGZpbGwg Y29sdW1uIGluIGluYWN0aXZlIHdpbmRvd3MuICovCisgIExpc3BfT2JqZWN0IGZjX2luYWN0aXZl X3dpbmRvd3NfOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIEN1cnNvciB0 eXBlIHRvIGRpc3BsYXkgaW4gbm9uLXNlbGVjdGVkIHdpbmRvd3MuCiAgICAgIHQgbWVhbnMgdG8g dXNlIGhvbGxvdyBib3ggY3Vyc29yLgogICAgICBTZWUgYGN1cnNvci10eXBlJyBmb3Igb3RoZXIg dmFsdWVzLiAgKi8KQEAgLTc5MSwxNCArODI1LDIxIEBAIHN0cnVjdCBidWZmZXIKICAgICAgYW4g aW5kaXJlY3QgYnVmZmVyIHNpbmNlIGl0IGNvdW50cyBhcyBpdHMgYmFzZSBidWZmZXIuICAqLwog ICBpbnQgd2luZG93X2NvdW50OwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCiAgIC8qIEEgbm9uLXplcm8gdmFsdWUgaW4gc2xvdCBJRFggbWVh bnMgdGhhdCBwZXItYnVmZmVyIHZhcmlhYmxlCiAgICAgIHdpdGggaW5kZXggSURYIGhhcyBhIGxv Y2FsIHZhbHVlIGluIHRoaXMgYnVmZmVyLiAgVGhlIGluZGV4IElEWAogICAgICBmb3IgYSBidWZm ZXItbG9jYWwgdmFyaWFibGUgaXMgc3RvcmVkIGluIHRoYXQgdmFyaWFibGUncyBzbG90CiAgICAg IGluIGJ1ZmZlcl9sb2NhbF9mbGFncyBhcyBhIExpc3AgaW50ZWdlci4gIElmIHRoZSBpbmRleCBp cyAtMSwKICAgICAgdGhpcyBtZWFucyB0aGUgdmFyaWFibGUgaXMgYWx3YXlzIGxvY2FsIGluIGFs bCBidWZmZXJzLiAgKi8KLSNkZWZpbmUgTUFYX1BFUl9CVUZGRVJfVkFSUyA1MAorI2RlZmluZSBN QVhfUEVSX0JVRkZFUl9WQVJTIDYwCiAgIGNoYXIgbG9jYWxfZmxhZ3NbTUFYX1BFUl9CVUZGRVJf VkFSU107CiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogU2V0IHRvIHRoZSBt b2R0aW1lIG9mIHRoZSB2aXNpdGVkIGZpbGUgd2hlbiByZWFkIG9yIHdyaXR0ZW4uCiAgICAgIG1v ZHRpbWUudHZfbnNlYyA9PSBOT05FWElTVEVOVF9NT0RUSU1FX05TRUNTIG1lYW5zCiAgICAgIHZp c2l0ZWQgZmlsZSB3YXMgbm9uZXhpc3RlbnQuICBtb2R0aW1lLnR2X25zZWMgPT0KQEAgLTkwNyw2 ICs5NDgsNjkgQEAgWEJVRkZFUiAoTGlzcF9PYmplY3QgYSkKIC8qIE1vc3QgY29kZSBzaG91bGQg dXNlIHRoZXNlIGZ1bmN0aW9ucyB0byBzZXQgTGlzcCBmaWVsZHMgaW4gc3RydWN0CiAgICBidWZm ZXIuICAoU29tZSBzZXR0ZXJzIHRoYXQgYXJlIHByaXZhdGUgdG8gYSBzaW5nbGUgLmMgZmlsZSBh cmUKICAgIGRlZmluZWQgYXMgc3RhdGljIGluIHRob3NlIGZpbGVzLikgICovCisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKK0lOTElO RSB2b2lkCitic2V0X2Jsdl9tY19yZWFsX2Zha2VfY3Vyc29yIChzdHJ1Y3QgYnVmZmVyICpiLCBM aXNwX09iamVjdCB2YWwpCit7CisgIGItPm1jX3JlYWxfZmFrZV9jdXJzb3JfID0gdmFsOworfQor CitJTkxJTkUgdm9pZAorYnNldF9ibHZfbWNfY29uZiAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9P YmplY3QgdmFsKQoreworICBiLT5tY19jb25mXyA9IHZhbDsKK30KKworSU5MSU5FIHZvaWQKK2Jz ZXRfYmx2X21jX2luYWN0aXZlX3dpbmRvd3MgK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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIElOTElO RSB2b2lkCiBic2V0X2JpZGlfcGFyYWdyYXBoX2RpcmVjdGlvbiAoc3RydWN0IGJ1ZmZlciAqYiwg TGlzcF9PYmplY3QgdmFsKQogewpkaWZmIC0tZ2l0IGEvc3JjL2Rpc3BleHRlcm4uaCBiL3NyYy9k aXNwZXh0ZXJuLmgKaW5kZXggNGU5NDdkYS4uM2MxMTBlMiAxMDA2NDQKLS0tIGEvc3JjL2Rpc3Bl eHRlcm4uaAorKysgYi9zcmMvZGlzcGV4dGVybi5oCkBAIC0xNDUsNiArMTQ1LDEzMSBAQCB0eXBl ZGVmIHZvaWQgKkVtYWNzX0N1cnNvcjsKICNkZWZpbmUgTmF0aXZlUmVjdGFuZ2xlIGludAogI2Vu ZGlmCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJT T1JTICovCisKK2V4dGVybiBib29sIHRyYWNlX3JlZGlzcGxheV9wIEVYVEVSTkFMTFlfVklTSUJM RTsKKworc3RydWN0IGdseXBoOworCitzdHJ1Y3QgZ2x5cGhfcm93OworCitzdHJ1Y3QgZ2x5cGhf bWF0cml4OworCitlbnVtIGRyYXdfZ2x5cGhzX2ZhY2U7CisKK2VudW0gZ2x5cGhfcm93X2FyZWE7 CisKK3N0cnVjdCBtY19tYXRyaXg7CisKK2VudW0gbWNfY2FjaGVfdHlwZTsKKworZW51bSBtY19j dXJzb3JfdHlwZTsKKworZW51bSBtY19mbGF2b3I7CisKK3N0cnVjdCBtY19SR0I7CisKK3N0cnVj dCBtY19lc3NlbnRpYWxzOworCitlbnVtIG1jX2RyYXdfcm93X3R5cGU7CisKK2VudW0gbWNfZW5n aW5lX3R5cGU7CisKK2VudW0gbWNfcm93X3Bvc2l0aW9uOworCitlbnVtIG1jX3JlZHJhd19yb3df dHlwZTsKKworZW51bSBkcmF3X2dseXBoX2FjdGlvbjsKKworZXh0ZXJuIExpc3BfT2JqZWN0IG1j X2xpc3RuIChwdHJkaWZmX3QsIExpc3BfT2JqZWN0LCAuLi4pOworCitleHRlcm4gTGlzcF9PYmpl Y3QgbWNfbnRoIChpbnQsIExpc3BfT2JqZWN0KTsKKworZXh0ZXJuIExpc3BfT2JqZWN0IG1jX2Fz c3EgKExpc3BfT2JqZWN0LCBMaXNwX09iamVjdCk7CisKK2V4dGVybiBlbnVtIG1jX3Jvd19wb3Np dGlvbiBtY19yb3dfcG9zaXRpb24gKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX3JvdyAq LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGds eXBoX3JvdyAqLCBpbnQpOworCitleHRlcm4gcHRyZGlmZl90IG1jX3JlZ2lvbl9saW1pdCAoYm9v bCk7CisKK2V4dGVybiBzdHJ1Y3QgZ2x5cGggKiBtY19nZXRfY3Vyc29yX2dseXBoIChzdHJ1Y3Qg d2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICosIGludCwgaW50KTsKKworZXh0 ZXJuIHZvaWQgbWNfeHdfY29sb3JfdmFsdWVzIChzdHJ1Y3Qgd2luZG93ICosIExpc3BfT2JqZWN0 LCBzdHJ1Y3QgbWNfUkdCICopOworCitleHRlcm4gYm9vbCBtY191cGRhdGVfd2luZG93X2ZyaW5n ZXMgKHN0cnVjdCB3aW5kb3cgKiwgYm9vbCk7CisKK2V4dGVybiBjaGFyICogbWNfd2luZG93IChz dHJ1Y3Qgd2luZG93ICopOworCitleHRlcm4gY2hhciAqIG1jX2NoYXJfdG9fc3RyaW5nIChpbnQp OworCitleHRlcm4gY2hhciAqIG1jX2N1cnNvcl90eXBlX3RvX3N0cmluZyAoZW51bSBtY19jdXJz b3JfdHlwZSk7CisKK2V4dGVybiBjaGFyICogbWNfZmxhdm9yX3RvX3N0cmluZyAoZW51bSBtY19m bGF2b3IpOworCitleHRlcm4gY2hhciAqIG1jX2NhY2hlX3R5cGVfdG9fc3RyaW5nIChlbnVtIG1j X2NhY2hlX3R5cGUpOworCitleHRlcm4gY2hhciAqIG1jX3JlZHJhd19yb3dfdHlwZV90b19zdHJp bmcgKGVudW0gbWNfcmVkcmF3X3Jvd190eXBlKTsKKworZXh0ZXJuIHZvaWQgbWNfY2FjaGVfaW5z cGVjdG9yIChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBtY19tYXRyaXgpOworCitleHRlcm4gYm9v bCBtY190cmF2ZXJzZV9jYWNoZV9wIChzdHJ1Y3QgbWNfbWF0cml4LCBlbnVtIG1jX2NhY2hlX3R5 cGUsIGludCwgaW50KTsKKworZXh0ZXJuIHZvaWQgbWNfZHJhd19mcmluZ2VfYml0bWFwIChzdHJ1 Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwgaW50LAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlKTsKKworZXh0ZXJuIGludCBtY19n ZXRfZnJpbmdlX2JpdG1hcCAoc3RydWN0IHdpbmRvdyAqLCBMaXNwX09iamVjdCwgaW50LCBpbnQp OworCitleHRlcm4gdm9pZCBtY19lbmdpbmUgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBo X21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAgICAgICAgICAgICAgICAgICAgIHN0 cnVjdCBnbHlwaCAqLCBpbnQsIGludCwgaW50LCBpbnQsIGludCwgaW50LAorICAgICAgICAgICAg ICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlLCBpbnQsIHN0cnVjdCBnbHlwaF9tYXRyaXgg KiwKKyAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX2Vzc2VudGlhbHMsIGVudW0gbWNf cm93X3Bvc2l0aW9uLCBzdHJ1Y3QgbWNfUkdCLAorICAgICAgICAgICAgICAgICAgICAgICBlbnVt IG1jX2VuZ2luZV90eXBlLCBib29sLCBlbnVtIG1jX2RyYXdfcm93X3R5cGUsCisgICAgICAgICAg ICAgICAgICAgICAgIGVudW0gbWNfY2FjaGVfdHlwZSk7CisKK2V4dGVybiB2b2lkIG1jX3NldF9l c3NlbnRpYWxzIChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBtY19lc3NlbnRpYWxzICopOworCitl eHRlcm4gdm9pZCBtY19kcmF3X3JvdyAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0 cml4ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1 Y3QgZ2x5cGggKiwgaW50LCBpbnQsIGludCwgc3RydWN0IGdseXBoX21hdHJpeCAqLAorICAgICAg ICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19lc3NlbnRpYWxzLCBlbnVtIG1jX3Jvd19wb3Np dGlvbiwgYm9vbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2RyYXdfcm93X3R5 cGUpOworCitleHRlcm4gYm9vbCBtY19yZWRyYXdfcm93IChzdHJ1Y3Qgd2luZG93ICosIHN0cnVj dCBnbHlwaF9tYXRyaXggKiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgZW51bSBnbHlwaF9yb3dfYXJlYSwgaW50LCBpbnQsIGludCwgYm9vbCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSwgZW51bSBtY19yZWRy YXdfcm93X3R5cGUpOworCitleHRlcm4gdm9pZCBtY19yZXNldF9jYWNoZSAoc3RydWN0IHdpbmRv dyAqKTsKKworZXh0ZXJuIHZvaWQgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHN0cnVjdCB3aW5kb3cg Kiwgc3RydWN0IGdseXBoX21hdHJpeCAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHN0cnVjdCBnbHlwaF9yb3cgKiwgZW51bSBkcmF3X2dseXBoc19mYWNlLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGludCwgaW50LCBpbnQsIHN0cnVjdCBtY19SR0IsIGVu dW0gbWNfZmxhdm9yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNf Y3Vyc29yX3R5cGUsIGludCwgYm9vbCwgYm9vbCk7CisKK2V4dGVybiB2b2lkIG1jX2VyYXNlX2N1 cnNvciAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlw aF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBpbnQsIGludCwgaW50 LCBlbnVtIG1jX2ZsYXZvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19j dXJzb3JfdHlwZSwgaW50KTsKKworZXh0ZXJuIHZvaWQgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHN0 cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICos CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBpbnQsIGludCwgaW50LCBp bnQsIGludCwgaW50LCBpbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51 bSBtY19jdXJzb3JfdHlwZSwgaW50LCBzdHJ1Y3QgbWNfUkdCLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGJvb2wsIGVudW0gbWNfZmxhdm9yLCBib29sKTsKKworZXh0ZXJuIGlu dCBtY19kcmF3X2dseXBocyAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICos IHN0cnVjdCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCwgZW51 bSBnbHlwaF9yb3dfYXJlYSwgcHRyZGlmZl90LCBwdHJkaWZmX3QsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UsIGludCwgaW50LCBzdHJ1Y3QgbWNfUkdC LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19mbGF2b3IsIGVudW0gbWNfY3Vy c29yX3R5cGUsIGludCwgYm9vbCwgYm9vbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGVu dW0gZHJhd19nbHlwaF9hY3Rpb24sIGJvb2wpOworCitleHRlcm4gc3RydWN0IGdseXBoX21hdHJp eCAqIG1jX3NhdmVfZ2x5cGhfbWF0cml4IChzdHJ1Y3QgZ2x5cGhfbWF0cml4ICopOworCitleHRl cm4gdm9pZCBtY19yZXN0b3JlX2dseXBoX21hdHJpeCAoc3RydWN0IGdseXBoX21hdHJpeCAqLCBz dHJ1Y3QgZ2x5cGhfbWF0cml4ICopOworCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogLyogVGV4dCBjdXJzb3IgdHlwZXMuICAqLwogCiBl bnVtIHRleHRfY3Vyc29yX2tpbmRzCkBAIC00MDQsNiArNTI5LDE4IEBAIHN0cnVjdCBnbHlwaF9z bGljZQogCiBzdHJ1Y3QgZ2x5cGgKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBpbnQgcmVsYXRpdmVfeCwgaHBvczsKKworICBwdHJk aWZmX3QgYnl0ZXBvczsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBQb3Np dGlvbiBmcm9tIHdoaWNoIHRoaXMgZ2x5cGggd2FzIGRyYXduLiAgSWYgYG9iamVjdCcgYmVsb3cg aXMgYQogICAgICBMaXNwIHN0cmluZywgdGhpcyBpcyBhbiBpbmRleCBpbnRvIHRoYXQgc3RyaW5n LiAgSWYgaXQgaXMgYQogICAgICBidWZmZXIsIHRoaXMgaXMgYSBwb3NpdGlvbiBpbiB0aGF0IGJ1 ZmZlci4gIEluIGFkZGl0aW9uLCBzb21lCkBAIC0xMjcwLDYgKzE0MDcsMjggQEAgZW51bSBkcmF3 X2dseXBoc19mYWNlCiAKIHN0cnVjdCBnbHlwaF9zdHJpbmcKIHsKKworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIGJvb2xfYmYgbGVmdF9v dmVyd3JpdHRlbl9wIDogMTsKKworICAgIGJvb2xfYmYgcmlnaHRfb3ZlcndyaXR0ZW5fcCA6IDE7 CisKKyAgICBib29sX2JmIHJlY3RhbmdsZV9udWtlZF9wIDogMTsKKworICAgIGJvb2xfYmYgYmFj a2dyb3VuZF9udWtlZF9wIDogMTsKKworICAgIGVudW0gZHJhd19nbHlwaF9hY3Rpb24KKyAgICB7 CisgICAgICBNQ19EUkFXX0dMWVBIX1NUUklORywKKyAgICAgIE1DX0VSQVNFX0dMWVBIX1NUUklO RworICAgIH0gYWN0aW9uX3R5cGU7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAg LyogWC1vcmlnaW4gb2YgdGhlIHN0cmluZy4gICovCiAgIGludCB4OwogCkBAIC0yODM0LDYgKzI5 OTMsMjggQEAgdHlwZWRlZiB2b2lkICgqZnJhbWVfcGFybV9oYW5kbGVyKSAoc3RydWN0IGZyYW1l ICosIExpc3BfT2JqZWN0LCBMaXNwX09iamVjdCk7CiAKIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJm YWNlCiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JT ICovCisKKy8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgbnN0ZXJtLm1gIHwgYHczMnRlcm0u Y2AgfCBgeHRlcm0uY2AgbXVzdCBiZSBpbiB0aGUKK2V4YWN0IHNhbWUgb3JkZXIgYXMgdGhlIGBy ZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgZGlzcGV4dGVybi5oYCEgKi8KKworICAvKiBgbWNfbnNf ZHJhd193aW5kb3dfY3Vyc29yJyB8IGBtY193MzJfZHJhd193aW5kb3dfY3Vyc29yJyB8IGBtY194 X2RyYXdfd2luZG93X2N1cnNvcicgKi8KKyAgdm9pZCAoKm1jX3NjcmliZV9jdXJzb3IpIChzdHJ1 Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsCisgICAgICAgIHN0cnVj dCBnbHlwaF9yb3cgKmdseXBoX3JvdywgaW50IHgsIGludCBmeCwgaW50IHksIGludCBmeSwgaW50 IGhwb3MsCisgICAgICAgIGludCB2cG9zLCBpbnQgd2QsIGludCBoLCBzdHJ1Y3QgbWNfUkdCIGxz bCwgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSwKKyAgICAgICAgaW50IGN1cnNvcl93 aWR0aCwgZW51bSBtY19mb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ioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBi ZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKK3N0cnVjdCBnbHlwaHNfc2tpcHBlZAoreworICBw dHJkaWZmX3QgYWxsb2NhdGVkOworICBwdHJkaWZmX3QgdXNlZDsKKyAgc3RydWN0IHNraXBwZWRf aXRlbXMKKyAgICB7CisgICAgICBpbnQgeDsKKyAgICAgIGludCBocG9zOworICAgICAgYm9vbCBl bmFibGVkX3A7CisgICAgfSAqc2tpcHBlZDsKK30gYXJyYXlfZ2x5cGhzX3NraXBwZWQ7CisKK3N0 cnVjdCBtY19yb3dfZW50cnkKK3sKKyAgaW50IG9sZF91c2VzLCBuZXdfdXNlczsKKyAgaW50IG5l d19saW5lX251bWJlcjsKKyAgcHRyZGlmZl90IGJ1Y2tldDsKKyAgc3RydWN0IGdseXBoX3JvdyAq cm93OworICBzdHJ1Y3QgbWNfcm93X2VudHJ5ICpuZXh0OworfTsKK3N0YXRpYyBzdHJ1Y3QgbWNf cm93X2VudHJ5ICptY19yb3dfZW50cnlfcG9vbDsKK3N0YXRpYyBwdHJkaWZmX3QgbWNfcm93X2Vu dHJ5X3Bvb2xfc2l6ZTsKK3N0YXRpYyBwdHJkaWZmX3QgbWNfcm93X2VudHJ5X2lkeDsKK3N0YXRp YyBzdHJ1Y3QgbWNfcm93X2VudHJ5ICoqbWNfcm93X3RhYmxlOworc3RhdGljIHB0cmRpZmZfdCBt Y19yb3dfdGFibGVfc2l6ZTsKK3N0YXRpYyBzdHJ1Y3QgbWNfcm93X2VudHJ5ICoqbWNfb2xkX2xp bmVzLCAqKm1jX25ld19saW5lczsKK3N0YXRpYyBwdHJkaWZmX3QgbWNfb2xkX2xpbmVzX3NpemUs IG1jX25ld19saW5lc19zaXplOworc3RhdGljIHN0cnVjdCBydW4gKm1jX3J1bl9wb29sOworc3Rh dGljIHB0cmRpZmZfdCBtY19yd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SAmJiAhcm93X2VxdWFsX3AgKGVu dHJ5LT5yb3csIHJvdywgMSkpCisgICAgZW50cnkgPSBlbnRyeS0+bmV4dDsKKyAgaWYgKGVudHJ5 ID09IE5VTEwpCisgICAgeworICAgICAgZW50cnkgPSBtY19yb3dfZW50cnlfcG9vbCArIG1jX3Jv d19lbnRyeV9pZHgrKzsKKyAgICAgIGVudHJ5LT5yb3cgPSByb3c7CisgICAgICBlbnRyeS0+b2xk X3VzZXMgPSBlbnRyeS0+bmV3X3VzZXMgPSAwOworICAgICAgZW50cnktPm5ld19saW5lX251bWJl ciA9IDA7CisgICAgICBlbnRyeS0+YnVja2V0ID0gaTsKKyAgICAgIGVudHJ5LT5uZXh0ID0gbWNf cm93X3RhYmxlW2ldOworICAgICAgbWNfcm93X3RhYmxlW2ldID0gZW50cnk7CisgICAgfQorICBy ZXR1cm4gZW50cnk7Cit9CisKKy8qIFJldmVyc2UgdGhlIGNvbnRlbnRzIG9mIHJvd3MgaW4gTUFU UklYIGJldHdlZW4gU1RBUlQgYW5kIEVORC4gIFRoZQorICAgY29udGVudHMgb2YgdGhlIHJvdyBh dCBFTkQgLSAxIGVuZCB1cCBhdCBTVEFSVCwgRU5EIC0gMiBhdCBTVEFSVCArCisgICAxIGV0Yy4g IFRoaXMgaXMgcGFydCBvZiB0aGUgaW1wbGVtZW50YXRpb24gb2Ygcm90YXRlX21hdHJpeCAoc2Vl CisgICBiZWxvdykuICovCitzdGF0aWMgdm9pZAorbWNfcmV2ZXJzZV92cG9zIChzdHJ1Y3QgbWNf bWF0cml4IG1hdHJpeCwgaW50IHN0YXJ0LCBpbnQgZW5kKQoreworICBpbnQgaSwgajsKKyAgZm9y IChpID0gc3RhcnQsIGogPSBlbmQgLSAxOyBpIDwgajsgKytpLCAtLWopCisgICAgeworICAgICAg LyogTm9uLUlTTyBIUC9VWCBjb21waWxlciBkb2Vzbid0IGxpa2UgYXV0byBzdHJ1Y3QgaW5pdGlh bGl6YXRpb24uICovCisgICAgICBz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f QVJFQV0sIG5ieXRlcyk7CisgICAgICB0by0+dXNlZFtURVhUX0FSRUFdID0gZnJvbS0+dXNlZFtU RVhUX0FSRUFdOworICAgICAgdG8tPmhhc2ggPSBmcm9tLT5oYXNoOworICAgICAgdG8tPnggPSBm cm9tLT54OworICAgICAgdG8tPnkgPSBmcm9tLT55OworICAgICAgdG8tPnBpeGVsX3dpZHRoID0g ZnJvbS0+cGl4ZWxfd2lkdGg7CisgICAgICB0by0+YXNjZW50ID0gZnJvbS0+YXNjZW50OworICAg ICAgdG8tPmhlaWdodCA9IGZyb20tPmhlaWdodDsKKyAgICAgIHRvLT5waHlzX2FzY2VudCA9IGZy b20tPnBoeXNfYXNjZW50OworICAgICAgdG8tPnBoeXNfaGVpZ2h0ID0gZnJvbS0+cGh5c19oZWln aHQ7CisgICAgICB0by0+dmlzaWJsZV9oZWlnaHQgPSBmcm9tLT52aXNpYmxlX2hlaWdodDsKKyAg ICAgIHRvLT5leHRyYV9saW5lX3NwYWNpbmcgPSBmcm9tLT5leHRyYV9saW5lX3NwYWNpbmc7Cisg ICAgICB0by0+c3RhcnQgPSBmcm9tLT5zdGFydDsKKyAgICAgIHRvLT5lbmQgPSBmcm9tLT5lbmQ7 CisgICAgICB0by0+bWlucG9zID0gZnJvbS0+bWlucG9zOworICAgICAgdG8tPm1heHBvcyA9IGZy b20tPm1heHBvczsKKyAgICAgIHRvLT5vdmVybGF5X2Fycm93X2JpdG1hcCA9IGZyb20tPm92ZXJs YXlfYXJyb3dfYml0bWFwOworICAgICAgdG8tPmxlZnRfdXNlcl9mcmluZ2VfYml0bWFwID0gZnJv bS0+bGVmdF91c2VyX2ZyaW5nZV9iaXRtYXA7CisgICAgICB0by0+cmlnaHRfdXNlcl9mcmluZ2Vf Yml0bWFwID0gZnJvbS0+cmlnaHRfdXNlcl9mcmluZ2VfYml0bWFwOworICAgICAgdG8tPmxlZnRf ZnJpbmdlX2JpdG1hcCA9IGZyb20tPmxlZnRfZnJpbmdlX2JpdG1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ZG93X3RleHRfYm90dG9tX3kgKHcpOworICBwdHJk aWZmX3QgaTsKKyAgaW50IGosIGZpcnN0X29sZCwgZmlyc3RfbmV3LCBsYXN0X29sZCwgbGFzdF9u ZXc7CisgIGludCBucnVucywgcnVuX2lkeDsKKyAgcHRyZGlmZl90IG47CisgIHN0cnVjdCBtY19y b3dfZW50cnkgKmVudHJ5OworICAvLyBzdHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFjZSAqcmlmID0g RlJBTUVfUklGIChYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpKTsKKyAgLyogU2tpcCBvdmVyIHJv d3MgZXF1YWwgYXQgdGhlIHN0YXJ0LiAqLworICBmb3IgKGkgPSBoZWFkZXJfbGluZV9wOyBpIDwg Y3VycmVudF9tYXRyaXgtPm5yb3dzIC0gMTsgKytpKQorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlw aF9yb3cgKmQgPSBNQVRSSVhfUk9XIChkZXNpcmVkX21hdHJpeCwgaSk7CisgICAgICBzdHJ1Y3Qg Z2x5cGhfcm93ICpjID0gTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIGkpOworICAgICAgaWYg KGMtPmVuYWJsZWRfcAorICAgICAgICAgICYmIGQtPmVuYWJsZWRfcAorICAgICAgICAgICYmICFk LT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcAorICAgICAgICAgICYmIGMtPnkgPT0gZC0+eQorICAg ICAgICAgICYmIE1BVFJJWF9ST1dfQk9UVE9NX1kgKGMpIDw9IHliCisgICAgICAgICAgJiYgTUFU UklYX1JPV19CT1RUT01fWSAoZCkgPD0geWIKKyAgICAgICAgICAmJiByb3dfZXF1YWxfcCAoYywg ZCwgMSkpCisgICAgICAgIHsKKyAgICAgICAgICBhc3NpZ25fcm93IChjLCBkKTsKKyAgICAgICAg ICBkLT5lbmFibGVkX3AgPSBmYWxzZTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAg ICAgYnJlYWs7CisgICAgfQ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CB0byB0aGUg aW5kZXggKyAxIG9mIHRoZSByb3cgdGhhdCByZWFjaGVzIHRoZSBib3R0b20KKyAgICAgYm91bmRh cnkgaW4gdGhlIGN1cnJlbnQgbWF0cml4LiAgV2UgZG9uJ3QgbG9vayBhdCB0aGUgZW5hYmxlZAor ICAgICBmbGFnIGhlcmUgYmVjYXVzZSB3ZSBwbGFuIHRvIHJldXNlIHBhcnQgb2YgdGhlIGRpc3Bs YXkgZXZlbiBpZgorICAgICBvdGhlciBwYXJ0cyBhcmUgZGlzYWJsZWQuICovCisgIGkgPSBmaXJz dF9vbGQgKyAxOworICB3aGlsZSAoaSA8IGN1cnJlbnRfbWF0cml4LT5ucm93cyAtIDEpCisgICAg eworICAgICAgaW50IGJvdHRvbSA9IE1BVFJJWF9ST1dfQk9UVE9NX1kgKE1BVFJJWF9ST1cgKGN1 cnJlbnRfbWF0cml4LCBpKSk7CisgICAgICBpZiAoYm90dG9tIDw9IHliKQorICAgICAgICArK2k7 CisgICAgICBpZiAoYm90dG9tID49IHliKQorICAgICAgICBicmVhazsKKyAgICB9CisgIGxhc3Rf b2xkID0gaTsKKyAgLyogU2tpcCBvdmVyIHJvd3MgZXF1YWwgYXQgdGhlIGJvdHRvbS4gKi8KKyAg aSA9IGxhc3RfbmV3OworICBqID0gbGFzdF9vbGQ7CisgIHdoaWxlIChpIC0gMSA+IGZpcnN0X25l dworICAgICAgICAgJiYgaiAtIDEgPiBmaXJzdF9vbGQKKyAgICAgICAgICYmIE1BVFJJWF9ST1df RU5BQkxFRF9QIChjdXJyZW50X21hdHJpeCwgaiAtIDEpCisgICAgICAgICAmJiAoTUFUUklYX1JP VyAoY3VycmVudF9tYXRyaXgsIGogLSAxKS0+eQorICAgICAgICAgICAgID09IE1BVFJJWF9ST1cg KGRlc2lyZWRfbWF0cml4LCBpIC0gMSktPnkpCisgICAgICAgICAmJiAhTUFUUklYX1JPVyAoZGVz aXJlZF9tYXRyaXgsIGkgLSAxKS0+cmVkcmF3X2Zya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1F X0xJTUlUID09IDExKTsKKyAgICBlbnVtIHsgbmV4dF9hbG1vc3RfcHJpbWVfaW5jcmVtZW50X21h eCA9IDEwIH07CisgICAgcHRyZGlmZl90IHJvd190YWJsZV9tYXggPQorICAgICAgKG1pbiAoUFRS RElGRl9NQVgsIFNJWkVfTUFYKSAvICgzICogc2l6ZW9mICptY19yb3dfdGFibGUpCisgICAgICAg LSBuZXh0X2FsbW9zdF9wcmltZV9pbmNyZW1lbnRfbWF4KTsKKyAgICBwdHJkaWZmX3QgY3VycmVu dF9ucm93c19tYXggPSByb3dfdGFibGVfbWF4IC0gZGVzaXJlZF9tYXRyaXgtPm5yb3dzOworICAg IGlmIChjdXJyZW50X25yb3dzX21heCA8IGN1cnJlbnRfbWF0cml4LT5ucm93cykKKyAgICAgIG1l bW9yeV9mdWxsIChTSVpFX01BWCk7CisgIH0KKyAgLyogUmVhbGxvY2F0ZSB2ZWN0b3JzLCB0YWJs ZXMgZXRjLiBpZiBuZWNlc3NhcnkuICovCisgIGlmIChjdXJyZW50X21hdHJpeC0+bnJvd3MgPiBt Y19vbGRfbGluZXNfc2l6ZSkKKyAgICBtY19vbGRfbGluZXMgPSB4cGFsbG9jIChtY19vbGRfbGlu ZXMsICZtY19vbGRfbGluZXNfc2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50 X21hdHJpeC0+bnJvd3MgLSBtY19vbGRfbGluZXNfc2l6ZSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICBJTlRfTUFYLCBzaXplb2YgKm1jX29sZF9saW5lcyk7CisgIGlmIChkZXNpcmVkX21hdHJp eC0+bnJvd3MgPiBtY19uZXdfbGluZXNfc2l6ZSkKKyAgICBtY19uZXdfbGluZXMgPSB4cGFsbG9j IChtY19uZXdfbGluZXMsICZtY19uZXdfbGluZXNfc2l6ZSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICBkZXNpcmVkX21hdHJpeC0+bnJvd3MgLSBtY19uZXdfbGluZXNfc2l6ZSwKKyAgICAgICAg ICAgICAgICAgICAgICAgICBJTlRfTUFYLCBzaXplb2YgKm1jX25ld19saW5lcyk7CisgIG4gPSBk ZXNpcmVkX21hdHJpeC0+bnJvd3M7CisgIG4gKz0gY3VycmVudF9tYXRyaXgtPm5yb3dzOworICBp ZiAobWNfcm93X3RhYmxlX3NpemUgPCAzICogbikKKyAgICB7CisgICAgICBwdHJkaWZmX3Qgc2l6 ZSA9IG5leHRfYWxtb3N0X3ByaW1lICgzICogbik7CisgICAgICBtY19yb3dfdGFibGUgPSB4bnJl YWxsb2MgKG1jX3Jvd190YWJsZSwgc2l6ZSwgc2l6ZW9mICptY19yb3dfdGFibGUpOworICAgICAg bWNfcm93X3RhYmxlX3NpemUgPSBzaXplOworICAgICAgbWVtc2V0IChtY19yb3dfdGFibGUsIDAs IHNpemUgKiBzaXplb2YgKm1jX3Jvd190YWJsZSk7CisgICAgfQorICBpZiAobiA+IG1jX3Jvd19l bnRyeV9wb29sX3NpemUpCisgICAgbWNfcm93X2VudHJ5X3Bvb2wgPSB4cGFsbG9jIChtY19yb3df ZW50cnlfcG9vbCwgJm1jX3Jvd19lbnRyeV9wb29sX3NpemUsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBuIC0gbWNfcm93X2VudHJ5X3Bvb2xfc2l6ZSwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIC0xLCBzaXplb2YgKm1jX3Jvd19lbnRyeV9wb29sKTsKKyAgaWYgKGRlc2ly ZWRfbWF0cml4LT5ucm93cyA+IG1jX3J1bnNfc2l6ZSkKKyAgICB7CisgICAgICBtY19ydW5zID0g eG5yZWFsbG9jIChtY19ydW5zLCBkZXNpcmVkX21hdHJpeC0+bnJvd3MsIHNpemVvZiAqbWNfcnVu cyk7CisgICAgICBtY19ydW5fcG9vbCA9IHhucmVhbGxvYyAobWNfcnVuX3Bvb2wsIGRlc2lyZWRf bWF0cml4LT5ucm93cywgc2l6ZW9mICptY19ydW5fcG9vbCk7CisgICAgICBtY19ydW5zX3NpemUg PSBkZXNpcmVkX21hdHJpeC0+bnJvd3M7CisgICAgfQorICBucnVucyA9IHJ1bl9pZHggPSAwOwor ICBtY19yb3dfZW50cnlfaWR4ID0gMDsKKyAgLyogQWRkIHJvd3MgZnJvbSB0aGUgY3VycmVudCBh bmQgZGVzaXJlZCBtYXRyaXggdG8gdGhlIGhhc2ggdGFibGUKKyAgICAgcm93X2hhc2hfdGFibGUg dG8gYmUgYWJsZSB0byBmaW5kIGVxdWFsIG9uZXMgcXVpY2tseS4gKi8KKyAgZm9yIChpID0gZmly c3Rfb2xkOyBpIDwgbGFzdF9vbGQ7ICsraSkKKyAgICB7CisgICAgICBpZiAoTUFUUklYX1JPV19F TkFCTEVEX1AgKGN1cnJlbnRfbWF0cml4LCBpKSkKKyAgICAgICAgeworICAgICAgICAgIGVudHJ5 ID0gbWNfYWRkX3Jvd19lbnRyeSAoTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIGkpKTsKKyAg ICAgICAgICBtY19vbGRfbGluZXNbaV0gPSBlbnRyeTsKKyAgICAgICAgICArK2VudHJ5LT5vbGRf dXNlczsKKyAgICAgICAgfQorICAgICAgZWxzZQorICAgICAgICBtY19vbGRfbGluZXNbaV0gPSBO VUxMOworICAgIH0KKyAgZm9yIChpID0gZmlyc3RfbmV3OyBpIDwgbGFzdF9uZXc7ICsraSkKKyAg ICB7CisgICAgICBlYXNzZXJ0IChNQVRSSVhfUk9XX0VOQUJMRURfUCAoZGVzaXJlZF9tYXRyaXgs IGkpKTsKKyAgICAgIGVudHJ5ID0gbWNfYWRkX3Jvd19lbnRyeSAoTUFUUklYX1JPVyAoZGVzaXJl ZF9tYXRyaXgsIGkpKTsKKyAgICAgICsrZW50cnktPm5ld191c2VzOworICAgICAgZW50cnktPm5l d19saW5lX251bWJlciA9IGk7CisgICAgICBtY19uZXdfbGluZXNbaV0gPSBlbnRyeTsKKyAgICB9 CisgIC8qIElkZW50aWZ5IG1vdmVzIGJhc2VkIG9uIGxpbmVzIHRoYXQgYXJlIHVuaXF1ZSBhbmQg ZXF1YWwKKyAgICAgaW4gYm90aCBtYXRyaWNlcy4gKi8KKyAgZm9yIChpID0gZmlyc3Rfb2xkOyBp IDwgbGFzdF9vbGQ7KQorICAgIGlmIChtY19vbGRfbGluZXNbaV0KKyAgICAgICAgJiYgbWNfb2xk X2xpbmVzW2ldLT5vbGRfdXNlcyA9PSAxCisgICAgICAgICYmIG1jX29sZF9saW5lc1tpXS0+bmV3 X3VzZXMgPT0gMSkKKyAgICAgIHsKKyAgICAgICAgaW50IHAsIHE7CisgICAgICAgIGludCBuZXdf bGluZSA9IG1jX29sZF9saW5lc1tpXS0+bmV3X2xpbmVfbnVtYmVyOworICAgICAgICBzdHJ1Y3Qg cnVuICpydW4gPSBtY19ydW5fcG9vbCArIHJ1bl9pZHgrKzsKKyAgICAgICAgLyogUmVjb3JkIG1v dmUuICovCisgICAgICAgIHJ1bi0+Y3VycmVudF92cG9zID0gaTsKKyAgICAgICAgcnVuLT5jdXJy ZW50X3kgPSBNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSktPnk7CisgICAgICAgIHJ1bi0+ ZGVzaXJlZF92cG9zID0gbmV3X2xpbmU7CisgICAgICAgIHJ1bi0+ZGVzaXJlZF95ID0gTUFUUklY X1JPVyAoZGVzaXJlZF9tYXRyaXgsIG5ld19saW5lKS0+eTsKKyAgICAgICAgcnVuLT5ucm93cyA9 IDE7CisgICAgICAgIHJ1bi0+aGVpZ2h0ID0gTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIGkp LT5oZWlnaHQ7CisgICAgICAgIC8qIEV4dGVuZCBiYWNrd2FyZC4gKi8KKyAgICAgICAgcCA9IGkg LSAxOworICAgICAgICBxID0gbmV3X2xpbmUgLSAxOworICAgICAgICB3aGlsZSAocCA+IGZpcnN0 X29sZAorICAgICAgICAgICAgICAgJiYgcSA+IGZpcnN0X25ldworICAgICAgICAgICAgICAgJiYg bWNfb2xkX2xpbmVzW3BdID09IG1jX25ld19saW5lc1txXSkKKyAgICAgICAgICB7CisgICAgICAg ICAgICBpbnQgaCA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCBwKS0+aGVpZ2h0OworICAg ICAgICAgICAgLS1ydW4tPmN1cnJlbnRfdnBvczsKKyAgICAgICAgICAgIC0tcnVuLT5kZXNpcmVk X3Zwb3M7CisgICAgICAgICAgICArK3J1bi0+bnJvd3M7CisgICAgICAgICAgICBydW4tPmhlaWdo dCArPSBoOworICAgICAgICAgICAgcnVuLT5kZXNpcmVkX3kgLT0gaDsKKyAgICAgICAgICAgIHJ1 bi0+Y3VycmVudF95IC09IGg7CisgICAgICAgICAgICAtLXAsIC0tcTsKKyAgICAgICAgICB9Cisg ICAgICAgIC8qIEV4dGVuZCBmb3J3YXJkLiAqLworICAgICAgICBwID0gaSArIDE7CisgICAgICAg IHEgPSBuZXdfbGluZSArIDE7CisgICAgICAgIHdoaWxlIChwIDwgbGFzdF9vbGQKKyAgICAgICAg ICAgICAgICYmIHEgPCBsYXN0X25ldworICAgICAgICAgICAgICAgJiYgbWNfb2xkX2xpbmVzW3Bd ID09IG1jX25ld19saW5lc1txXSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpbnQgaCA9IE1B VFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCBwKS0+aGVpZ2h0OworICAgICAgICAgICAgKytydW4t Pm5yb3dzOworICAgICAgICAgICAgcnVuLT5oZWlnaHQgKz0gaDsKKyAgICAgICAgICAgICsrcCwg KytxOworICAgICAgICAgIH0KKyAgICAgICAgLyogSW5zZXJ0IHJ1biBpbnRvIGxpc3Qgb2YgYWxs IHJ1bnMuICBPcmRlciBydW5zIGJ5IGNvcGllZAorICAgICAgICAgICBwaXhlbCBsaW5lcy4gIE5v dGUgdGhhdCB3ZSByZWNvcmQgcnVucyB0aGF0IGRvbid0IGhhdmUgdG8KKyAgICAgICAgICAgYmUg Y29waWVkIGJlY2F1c2UgdGhleSBhcmUgYWxyZWFkeSBpbiBwbGFjZS4gIFRoaXMgaXMgZG9uZQor ICAgICAgICAgICBiZWNhdXNlIHdlIGNhbiBhdm9pZCBjYWxsaW5nIHVwZGF0ZV93aW5kb3dfbGlu ZSBpbiB0aGlzCisgICAgICAgICAgIGNhc2UuICovCisgICAgICAgIGZvciAocCA9IDA7IHAgPCBu cnVucyAmJiBtY19ydW5zW3BdLT5oZWlnaHQgPiBydW4tPmhlaWdodDsgKytwKQorICAgICAgICAg IDsKKyAgICAgICAgZm9yIChxID0gbnJ1bnM7IHEgPiBwOyAtLXEpCisgICAgICAgICAgbWNfcnVu c1txXSA9IG1jX3J1bnNbcSAtIDFdOworICAgICAgICBtY19ydW5zW3BdID0gcnVuOworICAgICAg ICArK25ydW5zOworICAgICAgICBpICs9IHJ1bi0+bnJvd3M7CisgICAgICB9CisgICAgICBlbHNl CisgICAgICAgICsraTsKKyAgLyogRG8gdGhlIG1vdmVzLiAgRG8gaXQgaW4gYSB3YXkgdGhhdCB3 ZSBkb24ndCBvdmVyd3JpdGUgc29tZXRoaW5nCisgICAgIHdlIHdhbnQgdG8gY29weSBsYXRlciBv bi4gIFRoaXMgaXMgbm90IHNvbHZhYmxlIGluIGdlbmVyYWwKKyAgICAgYmVjYXVzZSB0aGVyZSBp cyBvbmx5IG9uZSBkaXNwbGF5IGFuZCB3ZSBkb24ndCBoYXZlIGEgd2F5IHRvCisgICAgIGV4Y2hh bmdlIGFyZWFzIG9uIHRoaXMgZGlzcGxheS4gIEV4YW1wbGU6CisgICAgICAgICAgKy0tLS0tLS0t LS0tKyAgICAgICArLS0tLS0tLS0tLS0rCisgICAgICAgICAgfCAgICAgQSAgICAgfCAgICAgICB8 ICAgICBCICAgICB8CisgICAgICAgICAgKy0tLS0tLS0tLS0tKyAgLS0+ICArLS0tLS0tLS0tLS0r CisgICAgICAgICAgfCAgICAgQiAgICAgfCAgICAgICB8ICAgICBBICAgICB8CisgICAgICAgICAg Ky0tLS0tLS0tLS0tKyAgICAgICArLS0tLS0tLS0tLS0rCisgICAgIEluc3RlYWQsIHByZWZlciBi aWdnZXIgbW92ZXMsIGFuZCBpbnZhbGlkYXRlIG1vdmVzIHRoYXQgd291bGQKKyAgICAgY29weSBm cm9tIHdoZXJlIHdlIGNvcGllZCB0by4gKi8KKyAgZm9yIChpID0gMDsgaSA8IG5ydW5zOyArK2kp CisgICAgaWYgKG1jX3J1bnNbaV0tPm5yb3dzID4gMCkKKyAgICAgIHsKKyAgICAgICAgc3RydWN0 IHJ1biAqciA9IG1jX3J1bnNbaV07CisgICAgICAgIGlmIChyLT5jdXJyZW50X3kgIT0gci0+ZGVz aXJlZF95KQorICAgICAgICAgIHsKKyAgICAgICAgICAgIC8vICBmcHJpbnRmIChzdGRlcnIsICIl czogIHItPmN1cnJlbnQvZGVzaXJlZF92cG9zICglZC8lZCkgfCByLT5jdXJyZW50L2Rlc2lyZWRf eSAoJWQvJWQpXG4iLAorICAgICAgICAgICAgLy8gICAgICAgICAgIHItPmN1cnJlbnRfeSA8IHIt PmRlc2lyZWRfeSA/ICLihpMiIDogIuKGkSIsCisgICAgICAgICAgICAvLyAgICAgICAgICAgci0+ Y3VycmVudF92cG9zLCByLT5kZXNpcmVkX3Zwb3MsIHItPmN1cnJlbnRfeSwgci0+ZGVzaXJlZF95 KTsKKyAgICAgICAgICAgIC8vICByaWYtPmNsZWFyX3dpbmRvd19tb3VzZV9mYWNlICh3KTsKKyAg ICAgICAgICAgIC8vICByaWYtPnNjcm9sbF9ydW5faG9vayAodywgcik7CisgICAgICAgICAgfQor ICAgICAgICAvKiBUcnVuY2F0ZSBydW5zIHRoYXQgY29weSB0byB3aGVyZSB3ZSBjb3BpZWQgdG8s IGFuZAorICAgICAgICAgICBpbnZhbGlkYXRlIHJ1bnMgdGhhdCBjb3B5IGZyb20gd2hlcmUgd2Ug Y29waWVkIHRvLiAqLworICAgICAgICBmb3IgKGogPSBucnVucyAtIDE7IGogPiBpOyAtLWopCisg ICAgICAgICAgeworICAgICAgICAgICAgc3RydWN0IHJ1biAqcCA9IG1jX3J1bnNbal07CisgICAg ICAgICAgICBib29sIHRydW5jYXRlZF9wID0gMDsKKyAgICAgICAgICAgIGlmIChwLT5ucm93cyA+ IDAKKyAgICAgICAgICAgICAgICAmJiBwLT5kZXNpcmVkX3kgPCByLT5kZXNpcmVkX3kgKyByLT5o ZWlnaHQKKyAgICAgICAgICAgICAgICAmJiBwLT5kZXNpcmVkX3kgKyBwLT5oZWlnaHQgPiByLT5k ZXNpcmVkX3kpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAocC0+ZGVzaXJl ZF95IDwgci0+ZGVzaXJlZF95KQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg ICAgICBwLT5ucm93cyA9IHItPmRlc2lyZWRfdnBvcyAtIHAtPmRlc2lyZWRfdnBvczsKKyAgICAg ICAgICAgICAgICAgICAgcC0+aGVpZ2h0ID0gci0+ZGVzaXJlZF95IC0gcC0+ZGVzaXJlZF95Owor ICAgICAgICAgICAgICAgICAgICB0cnVuY2F0ZWRfcCA9IDE7CisgICAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgICBpbnQgbnJvd3NfY29waWVkID0gKHItPmRlc2lyZWRfdnBvcyArIHItPm5yb3dzCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBwLT5kZXNpcmVkX3Zwb3Mp OworICAgICAgICAgICAgICAgICAgICBpZiAocC0+bnJvd3MgPD0gbnJvd3NfY29waWVkKQorICAg ICAgICAgICAgICAgICAgICAgIHAtPm5yb3dzID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICBl bHNlCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAg IGludCBoZWlnaHRfY29waWVkID0gKHItPmRlc2lyZWRfeSArIHItPmhlaWdodAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIHAtPmRlc2lyZWRfeSk7Cisg ICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmN1cnJlbnRfdnBvcyArPSBucm93c19jb3BpZWQ7 CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmRlc2lyZWRfdnBvcyArPSBucm93c19jb3Bp ZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPm5yb3dzIC09IG5yb3dzX2NvcGllZDsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgcC0+Y3VycmVudF95ICs9IGhlaWdodF9jb3BpZWQ7 CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmRlc2lyZWRfeSArPSBoZWlnaHRfY29waWVk OworICAgICAgICAgICAgICAgICAgICAgICAgICBwLT5oZWlnaHQgLT0gaGVpZ2h0X2NvcGllZDsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ1bmNhdGVkX3AgPSAxOworICAgICAgICAgICAg ICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICB9CisgICAg ICAgICAgICBpZiAoci0+Y3VycmVudF95ICE9IHItPmRlc2lyZWRfeQorICAgICAgICAgICAgICAg IC8qIFRoZSBjb25kaXRpb24gYmVsb3cgaXMgZXF1aXZhbGVudCB0bworICAgICAgICAgICAgICAg ICAgICgocC0+Y3VycmVudF95ID49IHItPmRlc2lyZWRfeQorICAgICAgICAgICAgICAgICAgICAg JiYgcC0+Y3VycmVudF95IDwgci0+ZGVzaXJlZF95ICsgci0+aGVpZ2h0KQorICAgICAgICAgICAg ICAgICAgICB8fCAocC0+Y3VycmVudF95ICsgcC0+aGVpZ2h0ID4gci0+ZGVzaXJlZF95CisgICAg ICAgICAgICAgICAgICAgICAgICAmJiAocC0+Y3VycmVudF95ICsgcC0+aGVpZ2h0CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPD0gci0+ZGVzaXJlZF95ICsgci0+aGVpZ2h0KSkpCisgICAg ICAgICAgICAgICAgICAgYmVjYXVzZSB3ZSBoYXZlIDAgPCBwLT5oZWlnaHQgPD0gci0+aGVpZ2h0 LiAqLworICAgICAgICAgICAgICAgICYmIHAtPmN1cnJlbnRfeSA8IHItPmRlc2lyZWRfeSArIHIt PmhlaWdodAorICAgICAgICAgICAgICAgICYmIHAtPmN1cnJlbnRfeSArIHAtPmhlaWdodCA+IHIt PmRlc2lyZWRfeSkKKyAgICAgICAgICAgICAgcC0+bnJvd3MgPSAwOworICAgICAgICAgICAgLyog UmVvcmRlciBydW5zIGJ5IGNvcGllZCBwaXhlbCBsaW5lcyBpZiB0cnVuY2F0ZWQuICovCisgICAg ICAgICAgICBpZiAodHJ1bmNhdGVkX3AgJiYgcC0+bnJvd3MgPiAwKQorICAgICAgICAgICAgICB7 CisgICAgICAgICAgICAgICAgaW50IGsgPSBucnVucyAtIDE7CisgICAgICAgICAgICAgICAgd2hp bGUgKG1jX3J1bnNba10tPm5yb3dzID09IDAgfHwgbWNfcnVuc1trXS0+aGVpZ2h0IDwgcC0+aGVp Z2h0KQorICAgICAgICAgICAgICAgICAgay0tOworICAgICAgICAgICAgICAgIG1lbW1vdmUgKG1j X3J1bnMgKyBqLCBtY19ydW5zICsgaiArIDEsIChrIC0gaikgKiBzaXplb2YgKCptY19ydW5zKSk7 CisgICAgICAgICAgICAgICAgbWNfcnVuc1trXSA9IHA7CisgICAgICAgICAgICAgIH0KKyAgICAg ICAgICB9CisgICAgICAgIC8qIEFzc2lnbiBtYXRyaXggcm93cy4gKi8KKyAgICAgICAgZm9yIChq ID0gMDsgaiA8IHItPm5yb3dzOyArK2opCisgICAgICAgICAgeworICAgICAgICAgICAgc3RydWN0 IGdseXBoX3JvdyAqZnJvbSwgKnRvOworICAgICAgICAgICAgYm9vbCB0b19vdmVybGFwcGVkX3A7 CisgICAgICAgICAgICB0byA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCByLT5kZXNpcmVk X3Zwb3MgKyBqKTsKKyAgICAgICAgICAgIGZyb20gPSBNQVRSSVhfUk9XIChkZXNpcmVkX21hdHJp eCwgci0+ZGVzaXJlZF92cG9zICsgaik7CisgICAgICAgICAgICB0b19vdmVybGFwcGVkX3AgPSB0 by0+b3ZlcmxhcHBlZF9wOworICAgICAgICAgICAgZnJvbS0+cmVkcmF3X2ZyaW5nZV9iaXRtYXBz X3AgPSBmcm9tLT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3A7CisgICAgICAgICAgICBhc3NpZ25f cm93ICh0bywgZnJvbSk7CisgICAgICAgICAgICAvKiBUaGUgYWJvdmUgYGFzc2lnbl9yb3cnIGFj dHVhbGx5IGRvZXMgc3dhcCwgc28gaWYgd2UgaGFkCisgICAgICAgICAgICAgICBhbiBvdmVybGFw IGluIHRoZSBjb3B5IGRlc3RpbmF0aW9uIG9mIHR3byBydW5zLCB0aGVuCisgICAgICAgICAgICAg ICB0aGUgc2Vjb25kIHJ1biB3b3VsZCBhc3NpZ24gYSBwcmV2aW91c2x5IGRpc2FibGVkIGJvZ3Vz CisgICAgICAgICAgICAgICByb3cuICBCdXQgdGhhbmtzIHRvIHRoZSB0cnVuY2F0aW9uIGNvZGUg aW4gdGhlCisgICAgICAgICAgICAgICBwcmVjZWRpbmcgZm9yLWxvb3AsIHdlIG5vIGxvbmdlciBo YXZlIHN1Y2ggYW4gb3ZlcmxhcCwKKyAgICAgICAgICAgICAgIGFuZCB0aHVzIHRoZSBhc3NpZ25l ZCByb3cgc2hvdWxkIGFsd2F5cyBiZSBlbmFibGVkLiAqLworICAgICAgICAgICAgZWFzc2VydCAo dG8tPmVuYWJsZWRfcCk7CisgICAgICAgICAgICBmcm9tLT5lbmFibGVkX3AgPSBmYWxzZTsKKyAg ICAgICAgICAgIHRvLT5vdmVybGFwcGVkX3AgPSB0b19vdmVybGFwcGVkX3A7CisgICAgICAgICAg fQorICAgICAgfQorICAvKiBDbGVhciB0aGUgaGFzaCB0YWJs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mUKKyAgdGhlIHNhbWUg aW4gYm90aCBtYXRyaWNlcyBpZiB3ZSBqdW1wZWQgdG8gYHNldF9jdXJzb3I6YCB3aXRoaW4gYHVw ZGF0ZV93aW5kb3cnCisgIGFuZCBgbWNfdXBkYXRlX3dpbmRvd19kcnlydW4nLiAqLworICBpbnQg cHJldl9tYXRyaXhfcm93X3N0YXJ0X2J5dGVwb3MgPSAodnBvcyAhPSAwKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1BVFJJWF9ST1dfU1RBUlRfQllURVBPUyAoY3Vy cmVudF9yb3cgLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IC0x OworICBpbnQgcHJldl9tYXRyaXhfcm93X2VuZF9ieXRlcG9zID0gKHZwb3MgIT0gMCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPV19FTkRfQllURVBPUyAo Y3VycmVudF9yb3cgLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAt MTsKKyAgaW50IG1hdHJpeF9yb3dfc3RhcnRfYnl0ZXBvcyA9IE1BVFJJWF9ST1dfU1RBUlRfQllU RVBPUyAoZGVzaXJlZF9yb3cpOworICBpbnQgbWF0cml4X3Jvd19lbmRfYnl0ZXBvcyA9IE1BVFJJ WF9ST1dfRU5EX0JZVEVQT1MgKGRlc2lyZWRfcm93KTsKKyAgLyogVGhlIGZpcnN0IGNvbmRpdGlv biB0ZXN0cyBmb3IgYSBzb2xpdGFyeSByb3cgY29udGFpbmluZyBaViwgcHJlY2VkZWQgYnkgYQor ICByb3cgY29udGFpbmluZyBhIHBlbnVsdGltYXRlIGdseXBoIHdpdGggYSBjaGFycG9zIG9mIFpW IC0gMSBmb2xsb3dlZCBieSBhbiBlbmQKKyAgb2Ygcm93IHNwYWNlIGdseXBoIHdpdGggYSBjaGFy cG9zIG9mIDAuICBUaGUgb3RoZXIgY29uZGl0aW9ucyB0ZXN0IGZvciBhbiBlbXB0eQorICBidWZm ZXIgKG5vdCBuYXJyb3dlZCksIG9yIGFuIGVtcHR5IG5hcnJvd2VkIGJ1ZmZlci4gKi8KKyAgYm9v bCByb3dfYXRfenZfcCA9ICgodnBvcyAhPSAwCisgICAgICAgICAgICAgICAgICAgICAgICYmIChj dXJyZW50X3JvdyAtIDEpLT51c2VkW1RFWFRfQVJFQV0gPiAwCisgICAgICAgICAgICAgICAgICAg ICAgICYmIHByZXZfbWF0cml4X3Jvd19zdGFydF9ieXRlcG9zICE9IHByZXZfbWF0cml4X3Jvd19l bmRfYnl0ZXBvcworICAgICAgICAgICAgICAgICAgICAgICAmJiAhKGN1cnJlbnRfcm93IC0gMSkt PmVuZHNfYXRfenZfcAorICAgICAgICAgICAgICAgICAgICAgICAmJiBtYXRyaXhfcm93X3N0YXJ0 X2J5dGVwb3MgPT0gbWF0cml4X3Jvd19lbmRfYnl0ZXBvcworICAgICAgICAgICAgICAgICAgICAg ICAmJiBkZXNpcmVkX3Jvdy0+ZW5kc19hdF96dl9wKQorICAgICAgICAgICAgICAgICAgICAgIHx8 ICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA9PSAxKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgfHwgKGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwICYmIHZwb3MgPT0gMCkpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIGJ1ZmZlcl9uYXJyb3dlZF9wCisgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIGJvYl9yZXNwZWN0X25hcnJvdyA9PSBlb2JfcmVzcGVjdF9uYXJy b3cpCisgICAgICAgICAgICAgICAgICAgICAgfHwgKCgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAm JiB2cG9zID09IDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAoaGVhZGVyX2xpbmVf Zm9ybWF0ID09IDAgJiYgdnBvcyA9PSAwKS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AgdnBv cyAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgIG1jX3dpbmRvdyAodyksIHZwb3MpOwor ICAvKiBJbmFzbXVjaCBhcyB3ZSBwcm9jZXNzIHRoZSBjdXJzb3Igcm93IGJlZm9yZSBhbGwgb3Ro ZXIgcm93cywgd2UgY2FuIHJlbHkKKyAgdXBvbiB0aGUgcHJldmlvdXMgYGRlc2lyZWRfcm93YCB0 byBiZSBhY2N1cmF0ZS4gKi8KKyAgZW51bSBtY19yb3dfcG9zaXRpb24gcm93X3Bvc2l0aW9uID0g IG1jX3Jvd19wb3NpdGlvbiAodywgdnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGRlc2lyZWRf cm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogY3VycmVudF9yb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGRlc2lyZWRfcm93LCB2cG9zKTsKKyAgLyogSWYgcm93cyBh cmUgYXQgZGlmZmVyZW50IFggb3IgWSwgb3Igcm93cyBoYXZlIGRpZmZlcmVudCBoZWlnaHQsCisg ICAgIG9yIHRoZSBjdXJyZW50IHJvdyBpcyBtYXJrZWQgaW52YWxpZCwgd3JpdGUgdGhlIGVudGly ZSBsaW5lLiAqLworICBpZiAoIWN1cnJlbnRfcm93LT5lbmFibGVkX3AKKyAgICAgIHx8IGRlc2ly ZWRfcm93LT55ICE9IGN1cnJlbnRfcm93LT55CisgICAgICB8fCBkZXNpcmVkX3Jvdy0+YXNjZW50 ICE9IGN1cnJlbnRfcm93LT5hc2NlbnQKKyAgICAgIHx8IGRlc2lyZWRfcm93LT5waHlzX2FzY2Vu dCAhPSBjdXJyZW50X3Jvdy0+cGh5c19hc2NlbnQKKyAgICAgIHx8IGRlc2lyZWR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AgZ2x5cGgsIHNvIHRoYXQgdGhlIGZhY2UgZXh0ZW5z aW9uIGFjdHVhbGx5IHRha2VzIHBsYWNlLiAqLworICAgICAgICBpZiAoTUFUUklYX1JPV19FWFRF TkRTX0ZBQ0VfUCAoZGVzaXJlZF9yb3cpCisgICAgICAgICAgICAmJiAoZGVzaXJlZF9zdG9wX3Bv cyA8IGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAgICB8fCAoZGVz aXJlZF9zdG9wX3BvcyA9PSBjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAg ICAgICAgICAgICYmICFNQVRSSVhfUk9XX0VYVEVORFNfRkFDRV9QIChjdXJyZW50X3JvdykpKSkK KyAgICAgICAgICAtLWRlc2lyZWRfc3RvcF9wb3M7CisgICAgICAgIHN0b3AgPSBtaW4gKGN1cnJl bnRfcm93LT51c2VkW1RFWFRfQVJFQV0sIGRlc2lyZWRfc3RvcF9wb3MpOworICAgICAgICBpID0g MDsKKyAgICAgICAgeCA9IGRlc2lyZWRfcm93LT54OworICAgICAgICBpbnQgY2xlYXJfdG9feCA9 IDA7CisKKyAgICAgICAgLyogTG9vcCBvdmVyIGdseXBocyB0aGF0IGN1cnJlbnQgYW5kIGRlc2ly ZWQgcm93IG1heSBoYXZlIGluIGNvbW1vbi4gKi8KKyAgICAgICAgd2hpbGUgKGkgPCBzdG9wKQor ICAgICAgICAgIHsKKyAgICAgICAgICAgIGFycmF5X2dseXBoc19za2lwcGVkLnVzZWQgPSAwOwor ICAgICAgICAgICAgYm9vbCBjYW5fc2tpcF9wID0gIWFib3J0X3NraXBwaW5nOworICAgICAgICAg ICAgLyogU2tpcCBvdmVyIGdseXBocyB0aGF0IGJvdGggcm93cyBoYXZlIGluIGNvbW1vbi4gIFRo ZXNlIGRvbid0IGhhdmUKKyAgICAgICAgICAgIHRvIGJlIHdyaXR0ZW4uICBXZSBjYW4ndCBza2lw IGlmIHRoZSBsYXN0IGN1cnJlbnQgZ2x5cGggb3ZlcmxhcHMgdGhlCisgICAgICAgICAgICBnbHlw aCB0byBpdHMgcmlnaHQuICBGb3IgZXhhbXBsZSwgY29uc2lkZXIgYSBjdXJyZW50IHJvdyBvZiBg aWYnIHdpdGgKKyAgICAgICAgICAgIHRoZSBgZicgaW4gQ291cmllciBib2xkIHNvIHRoYXQgaXQg b3ZlcmxhcHMgdGhlIGAgJyB0byBpdHMgcmlnaHQuCisgICAgICAgICAgICBJZiB0aGUgZGVzaXJl ZCByb3cgaXMgYCAnLCB3ZSB3b3VsZCBza2lwIG92ZXIgdGhlIHNwYWNlIGFmdGVyIHRoZQorICAg ICAgICAgICAgYGlmJyBhbmQgdGhlcmUgd291bGQgcmVtYWluIGEgcGl4ZWwgZnJvbSB0aGUgYGYn IG9uIHRoZSBzY3JlZW4uICovCisgICAgICAgICAgICBpZiAob3ZlcmxhcHBpbmdfZ2x5cGhzX3Ag JiYgaSA+IDApCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGgg KmdseXBoID0gJmN1cnJlbnRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXVtpIC0gMV07CisgICAgICAg ICAgICAgICAgaW50IGxlZnQsIHJpZ2h0OworICAgICAgICAgICAgICAgIHJpZi0+Z2V0X2dseXBo X292ZXJoYW5ncyAoZ2x5cGgsIFhGUkFNRSAody0+ZnJhbWUpLCAmbGVmdCwgJnJpZ2h0KTsKKyAg ICAgICAgICAgICAgICBjYW5fc2tpcF9wID0gKHJpZ2h0ID09IDAgJiYgIWFib3J0X3NraXBwaW5n KTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKGNhbl9za2lwX3ApCisgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICBpbnQgc3RhcnRfaHBvcyA9IGk7CisgICAgICAgICAg ICAgICAgd2hpbGUgKGkgPCBzdG9wCisgICAgICAgICAgICAgICAgICAgICAgICYmIEdMWVBIX0VR VUFMX1AgKGRlc2lyZWRfZ2x5cGgsIGN1cnJlbnRfZ2x5cGgpKQorICAgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgICArK2FycmF5X2dseXBoc19za2lwcGVkLnVzZWQ7CisgICAg ICAgICAgICAgICAgICAgIGlmIChhcnJheV9nbHlwaHNfc2tpcHBlZC5hbGxvY2F0ZWQgPCBhcnJh eV9nbHlwaHNfc2tpcHBlZC51c2VkKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAgICAgICAgIGludCBvbGRfYWxsb2MgPSBhcnJheV9nbHlwaHNfc2tpcHBlZC5hbGxv Y2F0ZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgbmV3X2VsdHMgPSBhcnJheV9nbHlw aHNfc2tpcHBlZC51c2VkIC0gYXJyYXlfZ2x5cGhzX3NraXBwZWQuYWxsb2NhdGVkOworICAgICAg ICAgICAgICAgICAgICAgICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZCA9CisgICAgICAg ICAgICAgICAgICAgICAgICAgIHhwYWxsb2MgKGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWQs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZhcnJheV9nbHlwaHNfc2tpcHBl ZC5hbGxvY2F0ZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19lbHRz LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJTlRfTUFYLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YgKmFycmF5X2dseXBoc19za2lwcGVkLnNr aXBwZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgbWVtc2V0IChhcnJheV9nbHlwaHNfc2tp cHBlZC5za2lwcGVkICsgb2xkX2FsbG9jLCAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgKGFycmF5X2dseXBoc19za2lwcGVkLmFsbG9jYXRlZCAtIG9sZF9hbGxvYykKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBzaXplb2YgKmFycmF5X2dseXBoc19za2lw cGVkLnNraXBwZWQpOworICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAg ICAgaW50IG50aCA9IGFycmF5X2dseXBoc19za2lwcGVkLnVzZWQgLSAxOworICAgICAgICAgICAg ICAgICAgICBhcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVkW250aF0ueCA9IHg7CisgICAgICAg ICAgICAgICAgICAgIGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbbnRoXS5ocG9zID0gaTsK KyAgICAgICAgICAgICAgICAgICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZFtudGhdLmVu YWJsZWRfcCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIHggKz0gZGVzaXJlZF9nbHlwaC0+ cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgICAgICAgICsrZGVzaXJlZF9nbHlwaCwgKytjdXJy ZW50X2dseXBoLCArK2k7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLyog Q29uc2lkZXIgdGhlIGNhc2UgdGhhdCB0aGUgY3VycmVudCByb3cgY29udGFpbnMgInh4eCBwcHAg Z2dnIiBpbgorICAgICAgICAgICAgICAgIGl0YWxpYyBDb3VyaWVyIGZvbnQsIGFuZCB0aGUgZGVz aXJlZCByb3cgaXMgInh4eCBnZ2ciLiAgVGhlIGNoYXJhY3RlciBgcCcKKyAgICAgICAgICAgICAg ICBoYXMgbGJlYXJpbmcsIGBnJyBoYXMgbm90LiAgVGhlIGxvb3AgYWJvdmUgd2lsbCBzdG9wIGlu IGZyb250IG9mIHRoZQorICAgICAgICAgICAgICAgIGZpcnN0IGBwJyBpbiB0aGUgY3VycmVudCBy b3cuICBJZiB3ZSB3b3VsZCBzdGFydCB3cml0aW5nIGdseXBocyB0aGVyZSwgd2UKKyAgICAgICAg ICAgICAgICB3b3VsZG4ndCBlcmFzZSB0aGUgbGJlYXJpbmcgb2YgdGhlIGBwJy4gIFRoZSByZXN0 IG9mIHRoZSBsYmVhcmluZyBwcm9ibGVtCisgICAgICAgICAgICAgICAgaXMgdGhlbiB0YWtlbiBj YXJlIG9mIGJ5IGRyYXdfZ2x5cGhzLiAqLworICAgICAgICAgICAgICAgIGlmIChvdmVybGFwcGlu Z19nbHlwaHNfcAorICAgICAgICAgICAgICAgICAgICAmJiBpID4gMAorICAgICAgICAgICAgICAg ICAgICAmJiBpIDwgY3VycmVudF9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAg ICAgICAmJiAoY3VycmVudF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAhPSBkZXNpcmVkX3Jvdy0+dXNl ZFtURVhUX0FSRUFdKSkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAg aW50IGxlZnQsIHJpZ2h0OworICAgICAgICAgICAgICAgICAgICByaWYtPmdldF9nbHlwaF9vdmVy aGFuZ3MgKGN1cnJlbnRfZ2x5cGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgWEZSQU1F ICh3LT5mcmFtZSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmxlZnQsICZyaWdodCk7 CisgICAgICAgICAgICAgICAgICAgIHdoaWxlIChsZWZ0ID4gMCAmJiBpID4gMCkKKyAgICAgICAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAtLWksIC0tZGVzaXJlZF9n bHlwaCwgLS1jdXJyZW50X2dseXBoOworICAgICAgICAgICAgICAgICAgICAgICAgeCAtPSBkZXNp cmVkX2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxlZnQgLT0g ZGVzaXJlZF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAg ICAgICAgICAgICAgICAgICAvKiBBYm9ydCB0aGUgc2tpcHBpbmcgYWxnb3JpdGhtIGlmIHdlIGVu ZCB1cCBiZWZvcmUKKyAgICAgICAgICAgICAgICAgICAgICAgb3VyIHN0YXJ0aW5nIHBvaW50LCB0 byBhdm9pZCBsb29waW5nIChidWcjMTA3MCkuCisgICAgICAgICAgICAgICAgICAgICAgIFRoaXMg Y2FuIGhhcHBlbiB3aGVuIHRoZSBsYmVhcmluZyBpcyBsYXJnZXIgdGhhbgorICAgICAgICAgICAg ICAgICAgICAgICB0aGUgcGl4ZWwgd2lkdGguICovCisgICAgICAgICAgICAgICAgICAgIGFib3J0 X3NraXBwaW5nID0gKGkgPCBzdGFydF9ocG9zKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAg ICAgICAgICAgfQorICAgICAgICAgICAgLyogVHJ5IHRvIGF2b2lkIHdyaXRpbmcgdGhlIGVudGly ZSByZXN0IG9mIHRoZSBkZXNpcmVkIHJvdworICAgICAgICAgICAgICAgYnkgbG9va2luZyBmb3Ig YSByZXN5bmMgcG9pbnQuICBUaGlzIG1haW5seSBwcmV2ZW50cworICAgICAgICAgICAgICAgbW9k ZSBsaW5lIGZsaWNrZXJpbmcgaW4gdGhlIGNhc2UgdGhlIG1vZGUgbGluZSBpcyBpbgorICAgICAg ICAgICAgICAgZml4ZWQtcGl0Y2ggZm9udCwgd2hpY2ggaXQgdXN1YWxseSB3aWxsIGJlLiAqLwor ICAgICAgICAgICAgaWYgKGkgPCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdKQorICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgaW50IHN0YXJ0X3ggPSB4LCBzdGFydF9ocG9zID0g aTsKKyAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnN0YXJ0ID0gZGVzaXJlZF9nbHlwaDsK KyAgICAgICAgICAgICAgICBpbnQgY3VycmVudF94ID0geDsKKyAgICAgICAgICAgICAgICBib29s IHNraXBfZmlyc3RfcCA9ICFjYW5fc2tpcF9wOworICAgICAgICAgICAgICAgIC8qIEZpbmQgdGhl IG5leHQgZ2x5cGggdGhhdCdzIGVxdWFsIGFnYWluLiAqLworICAgICAgICAgICAgICAgIHdoaWxl IChpIDwgc3RvcAorICAgICAgICAgICAgICAgICAgICAgICAmJiAoc2tpcF9maXJzdF9wCisgICAg ICAgICAgICAgICAgICAgICAgICAgICB8fCAhR0xZUEhfRVFVQUxfUCAoZGVzaXJlZF9nbHlwaCwg Y3VycmVudF9nbHlwaCkpCisgICAgICAgICAgICAgICAgICAgICAgICYmIHggPT0gY3VycmVudF94 KQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB4ICs9IGRlc2lyZWRf Z2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICAgICAgICBjdXJyZW50X3ggKz0gY3Vy cmVudF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgICAgICAgICsrZGVzaXJlZF9n bHlwaCwgKytjdXJyZW50X2dseXBoLCArK2k7CisgICAgICAgICAgICAgICAgICAgIHNraXBfZmly c3RfcCA9IDA7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZm9yIChpbnQg ZWx0ID0gMDsKKyAgICAgICAgICAgICAgICAgICAgIGVsdCA8IGFycmF5X2dseXBoc19za2lwcGVk LnVzZWQ7CisgICAgICAgICAgICAgICAgICAgICArK2VsdCkKKyAgICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgICAgaW50IHggPSBhcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVk W2VsdF0ueDsKKyAgICAgICAgICAgICAgICAgICAgaW50IGhwb3MgPSBhcnJheV9nbHlwaHNfc2tp cHBlZC5za2lwcGVkW2VsdF0uaHBvczsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBo ICp0YXJnZXRfZ2x5cGggPQorICAgICAgICAgICAgICAgICAgICAgIG1jX2dldF9jdXJzb3JfZ2x5 cGggKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgaHBvcywgdnBvcyk7CisgICAgICAg ICAgICAgICAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICAgICAgICAgICAgICAgIGZwcmludGYg KHN0ZGVyciwgIlNLSVBQRUQ6ICB2cG9zICglZCkgfCBjaGFyICglZC8lcykgfCB4OiAoJWQpIHwg aHBvcyAoJWQvJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg dnBvcywgdGFyZ2V0X2dseXBoLT51LmNoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgbWNfY2hhcl90b19zdHJpbmcgKHRhcmdldF9nbHlwaC0+dS5jaCksCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4LCBocG9zLCB1cGRhdGVkX3Jvdy0+dXNl ZFtURVhUX0FSRUFdIC0gMSk7CisgICAgICAgICAgICAgICAgICAgIG1jX2RyYXdfcm93ICh3LCBk ZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHRhcmdldF9nbHlwaCwgeCwgMSwgdnBvcywKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMs IHJvd19wb3NpdGlvbiwgZHJhd19wLCBTS0lQUEVEKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgICBpZiAoaSA9PSBzdGFydF9ocG9zIHx8IHggIT0gY3VycmVudF94KQorICAg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpID0gc3RhcnRfaHBvczsKKyAg ICAgICAgICAgICAgICAgICAgeCA9IHN0YXJ0X3g7CisgICAgICAgICAgICAgICAgICAgIGRlc2ly ZWRfZ2x5cGggPSBzdGFydDsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgb3V0cHV0X2N1cnNvcl90byAodywgdnBvcywgc3Rh cnRfaHBvcywgZGVzaXJlZF9yb3ctPnksIHN0YXJ0X3gpOworICAgICAgICAgICAgICAgIC8qIFJl LWRyYXcgYSBwb3J0aW9uIG9mIHRoZSByb3cuICovCisgICAgICAgICAgICAgICAgaWYgKGRlYnVn X3ApCisgICAgICAgICAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJSRURSQVcgU0VHTUVOVDpc blwKKyAgICAgICAgICAgICAgICAgICAgdnBvcyAoJWQpIHwgY2hhciAoJWQvJXMpIHwgeDogKCVk KSB8IGhwb3MgKCVkLyVkKSB8IGxlbmd0aCAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICB2 cG9zLCBzdGFydC0+dS5jaCwgbWNfY2hhcl90b19zdHJpbmcgKHN0YXJ0LT51LmNoKSwKKyAgICAg ICAgICAgICAgICAgICAgc3RhcnRfeCwgc3RhcnRfaHBvcywgdXBkYXRlZF9yb3ctPnVzZWRbVEVY VF9BUkVBXSAtIDEsIGkgLSBzdGFydF9ocG9zKTsKKyAgICAgICAgICAgICAgICBibG9ja19pbnB1 dCAoKTsKKyAgICAgICAgICAgICAgICBpbnQgbGVuID0gaSAtIHN0YXJ0X2hwb3M7CisgICAgICAg ICAgICAgICAgaW50IGhwb3MgPSBzdGFydCAtIHVwZGF0ZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVB XTsKKyAgICAgICAgICAgICAgICB3LT5vdXRwdXRfY3Vyc29yLnggPQorICAgICAgICAgICAgICAg ICAgbWNfZHJhd19nbHlwaHMgKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3Jvdywgdy0+b3V0 cHV0X2N1cnNvci54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRFWFRfQVJF QSwgaHBvcywgaHBvcyArIGxlbiwgRFJBV19OT1JNQUxfVEVYVCwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAwLCB2cG9zLCBsc2wsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUs IHdkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZl X3AsIGN1cnNvcl9nY19wLCBNQ19EUkFXX0dMWVBIX1NUUklORywKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBkcmF3X3ApOworICAgICAgICAgICAgICAgIHctPm91dHB1dF9jdXJz b3IuaHBvcyArPSBsZW47CisgICAgICAgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAg ICAgICAgICAgICBtY19kcmF3X3JvdyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCBz dGFydCwgc3RhcnRfeCwgaSAtIHN0YXJ0X2hwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHZwb3MsIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgZHJhd19w LCBTQ1JJQkVfVFdPKTsKKyAgICAgICAgICAgICAgICBjaGFuZ2VkX3AgPSAxOworICAgICAgICAg ICAgICB9CisgICAgICAgICAgfQorCisgICAgICAgIC8qIFdyaXRlIHRoZSByZXN0LiAqLworICAg ICAgICBpZiAoaSA8IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgICAgewor ICAgICAgICAgICAgb3V0cHV0X2N1cnNvcl90byAodywgdnBvcywgaSwgZGVzaXJlZF9yb3ctPnks IHgpOworICAgICAgICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgICAgICAgIGZwcmludGYgKHN0 ZGVyciwgIkRSQVcgUkVNQUlOREVSIE9GIFRIRSBST1c6XG5cCisgICAgICAgICAgICAgICAgdnBv cyAoJWQpIHwgY2hhciAoJWQvJXMpIHwgeDogKCVkKSB8IGhwb3MgKCVkLyVkKSB8IGxlbmd0aCAo JWQpXG4iLAorICAgICAgICAgICAgICAgIHZwb3MsIGRlc2lyZWRfZ2x5cGgtPnUuY2gsIG1jX2No YXJfdG9fc3RyaW5nIChkZXNpcmVkX2dseXBoLT51LmNoKSwKKyAgICAgICAgICAgICAgICB4LCBp LCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSwgZGVzaXJlZF9yb3ctPnVzZWRbVEVY VF9BUkVBXSAtIGkpOworICAgICAgICAgICAgYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgICBp bnQgbGVuID0gZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIGk7CisgICAgICAgICAgICBp bnQgaHBvcyA9IGRlc2lyZWRfZ2x5cGggLSB1cGRhdGVkX3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV07 CisgICAgICAgICAgICB3LT5vdXRwdXRfY3Vyc29yLnggPQorICAgICAgICAgICAgICBtY19kcmF3 X2dseXBocyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB3LT5vdXRwdXRfY3Vyc29y LngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBURVhUX0FSRUEsIGhwb3MsIGhwb3Mg KyBsZW4sIERSQVdfTk9STUFMX1RFWFQsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICB2cG9zLCBsc2wsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVfcCwgY3Vyc29yX2djX3AsIE1DX0RS QVdfR0xZUEhfU1RSSU5HLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhd19wKTsK KyAgICAgICAgICAgIHctPm91dHB1dF9jdXJzb3IuaHBvcyArPSBsZW47CisgICAgICAgICAgICB1 bmJsb2NrX2lucHV0ICgpOworICAgICAgICAgICAgLyogRklYTUU6ICBBbHRob3VnaCB3ZSBuZWVk IHRvIHVwZGF0ZSB0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hlIHByZXZpb3VzIGNoYW5nZSByZW1haW5lZCB0 aGUgc2FtZS4gIGBpYCBhbmQgYHhgIHdlcmUKKyAgICAgICAgICBpbmNyZW1lbnRlZCB0byB0aGUg ZW5kIG9mIHRoZSBnbHlwaCByb3cuICBpID09IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0K KyAgICAgICAgICBUaGUgYHctPm91dHB1dF9jdXJzb3IueC95L2hwb3MvdnBvc2AgaXMgYXQgdGhl IGVuZCBvZiB0aGUgcHJldmlvdXMgY2hhbmdlLgorICAgICAgICAgIFdoZW4gdGhpcyBzaXR1YXRp b24gZXhpc3RzLCB0aGUgZGlzdGFuY2UgYmV0d2VlbiB0aGUgZW5kIG9mIHRoZSBnbHlwaCByb3cg YW5kCisgICAgICAgICAgdGhlIHJpZ2h0IGVkZ2Ugb2YgdGhlIHdpbmRvdyB3aWxsIF9ub3RfIGJl IGNsZWFyZWQuICBUaGVyZWZvcmUsIGl0IGlzIG9rYXkgdG8KKyAgICAgICAgICBkcmF3IHRoZSBm bG9hdGluZyBnbHlwaHMgZm9yIHRoZSBob3Jpem9udGFsL3ZlcnRpY2FsIHJ1bGVycyBoZXJlLiAq LworICAgICAgICAgIGVsc2UgaWYgKGNoYW5nZWRfcAorICAgICAgICAgICAgICAgICAgICYmIHct Pm91dHB1dF9jdXJzb3IuaHBvcyAhPSB1cGRhdGVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdKQorICAg ICAgICAgICAgeworICAgICAgICAgICAgICBpbnQgeCA9IHctPm91dHB1dF9jdXJzb3IueDsKKyAg ICAgICAgICAgICAgaW50IGhwb3MgPSB3LT5vdXRwdXRfY3Vyc29yLmhwb3M7CisgICAgICAgICAg ICAgIHN0cnVjdCBnbHlwaCAqc3RhcnQgPSBtY19nZXRfY3Vyc29yX2dseXBoICh3LCBkZXNpcmVk X21hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHVwZGF0ZWRfcm93LCBocG9zLCB2cG9zKTsKKyAgICAgICAgICAgICAgaWYgKHct Pm91dHB1dF9jdXJzb3IueCA9PSB1cGRhdGVkX3Jvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAg ICAgICAgeCAtPSBzdGFydC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgIGlmIChkZWJ1Z19w KQorICAgICAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIlBPU1QtQ0hBTkdFRDogIHZwb3Mg KCVkKSB8IHggKCVkKSB8IGhwb3MgKCVkLyVkKSB8IGNoYXIgKCVkLyVzKVxuIiwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHZwb3MsIHgsIGhwb3MsIHVwZGF0ZWRfcm93LT51c2Vk W1RFWFRfQVJFQV0gLSAxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQt PnUuY2gsIG1jX2NoYXJfdG9fc3RyaW5nIChzdGFydC0+dS5jaCkpOworICAgICAgICAgICAgICBt Y19kcmF3X3JvdyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCBzdGFydCwgeCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSBo cG9zLCB2cG9zLCBjdXJzb3JfbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNz ZW50aWFscywgcm93X3Bvc2l0aW9uLCBkcmF3X3AsIFBPU1RfQ0hBTkdFRCk7CisgICAgICAgICAg ICB9CisgICAgICAgICAgICAvKiBUaGVyZSB3ZXJlIG5vIGNoYW5nZXMgYW5kIGkgPT0gZGVzaXJl ZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAqLworICAgICAgICAgICAgZWxzZSBpZiAoIWNoYW5nZWRf cCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChkZWJ1Z19wKQorICAgICAg ICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiVU5DSEFOR0VEIC0tIFdSSVRFIEVOVElSRSBM SU5FOiAgdnBvcyAoJWQpIHwgcm93LT51c2VkICglZClcbiIsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHZwb3MsIHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKTsK KyAgICAgICAgICAgICAgICBtY19kcmF3X3JvdyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRf cm93LCBkZXNpcmVkX3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGRlc2lyZWRfcm93LT54LCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdLCB2 cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBlc3NlbnRp YWxzLCByb3dfcG9zaXRpb24sIGRyYXdfcCwgVU5DSEFOR0VEKTsKKyAgICAgICAgICAgICAgfQor CisgICAgICAgIC8qIE1heWJlIGNsZWFyIHRvIGVuZCBvZiBsaW5lLiAqLworICAgICAgICBpZiAo TUFUUklYX1JPV19FWFRFTkRTX0ZBQ0VfUCAoZGVzaXJlZF9yb3cpKQorICAgICAgICAgIHsKKyAg ICAgICAgICAgIC8qIElmIG5ldyByb3cgZXh0ZW5kcyB0byB0aGUgZW5kIG9mIHRoZSB0ZXh0IGFy ZWEsIG5vdGhpbmcKKyAgICAgICAgICAgICAgIGhhcyB0byBiZSBjbGVhcmVkLCBpZiBhbmQgb25s eSBpZiB3ZSBkaWQgYSB3cml0ZV9nbHlwaHMKKyAgICAgICAgICAgICAgIGFib3ZlLiAgVGhpcyBp cyBtYWRlIHN1cmUgYnkgc2V0dGluZyBkZXNpcmVkX3N0b3BfcG9zCisgICAgICAgICAgICAgICBh cHByb3ByaWF0ZWx5IGFib3ZlLiAqLworICAgICAgICAgICAgZWFzc2VydCAoaSA8IGRlc2lyZWRf cm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICAgIHx8ICgoZGVzaXJlZF9y b3ctPnVzZWRbVEVYVF9BUkVBXSA9PSBjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdKQorICAg ICAgICAgICAgICAgICAgICAgICAgICYmIE1BVFJJWF9ST1dfRVhURU5EU19GQUNFX1AgKGN1cnJl bnRfcm93KSkpOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmIChNQVRSSVhfUk9XX0VY VEVORFNfRkFDRV9QIChjdXJyZW50X3JvdykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAg IC8qIElmIG9sZCByb3cgZXh0ZW5kcyB0byB0aGUgZW5kIG9mIHRoZSB0ZXh0IGFyZWEsIGNsZWFy LiAqLworICAgICAgICAgICAgICBpZiAoaSA+PSBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFd KQorICAgICAgICAgICAgICAgIG91dHB1dF9jdXJzb3JfdG8gKHcsIHZwb3MsIGksIGRlc2lyZWRf cm93LT55LCBkZXNpcmVkX3Jvdy0+cGl4ZWxfd2lkdGgpOworICAgICAgICAgICAgICBpZiAoZHJh d19wKQorICAgICAgICAgICAgICAgIHJpZi0+Y2xlYXJfZW5kX29mX2xpbmUgKHcsIHVwZGF0ZWRf cm93LCBURVhUX0FSRUEsIC0xKTsKKyAgICAgICAgICAgICAgY2xlYXJfdG9feCA9IC0xOworICAg ICAgICAgICAgICBjaGFuZ2VkX3AgPSAxOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxz ZSBpZiAoZGVzaXJlZF9yb3ctPnBpeGVsX3dpZHRoIDwgY3VycmVudF9yb3ctPnBpeGVsX3dpZHRo KQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogT3RoZXJ3aXNlIGNsZWFyIHRv IHRoZSBlbmQgb2YgdGhlIG9sZCByb3cuICBFdmVyeXRoaW5nCisgICAgICAgICAgICAgICAgICAg YWZ0ZXIgdGhhdCBwb3NpdGlvbiBzaG91bGQgYmUgY2xlYXIgYWxyZWFkeS4gKi8KKyAgICAgICAg ICAgICAgICBpbnQgeGxpbTsKKyAgICAgICAgICAgICAgICBpZiAoaSA+PSBkZXNpcmVkX3Jvdy0+ dXNlZFtURVhUX0FSRUFdKQorICAgICAgICAgICAgICAgICAgb3V0cHV0X2N1cnNvcl90byAodywg dnBvcywgaSwgZGVzaXJlZF9yb3ctPnksIGRlc2lyZWRfcm93LT5waXhlbF93aWR0aCk7CisgICAg ICAgICAgICAgICAgLyogSWYgY3Vyc29yIGlzIGRpc3BsYXllZCBhdCB0aGUgZW5kIG9mIHRoZSBs aW5lLCBtYWtlIHN1cmUKKyAgICAgICAgICAgICAgICAgICBpdCdzIGNsZWFyZWQuICBOb3dhZGF5 cyB3ZSBkb24ndCBoYXZlIGEgcGh5c19jdXJzb3JfZ2x5cGgKKyAgICAgICAgICAgICAgICAgICB3 aXRoIHdoaWNoIHRvIGVyYXNlIHRoZSBjdXJzb3IgKGJlY2F1c2UgdGhpcyBtZXRob2QKKyAgICAg ICAgICAgICAgICAgICBkb2Vzbid0IHdvcmsgd2l0aCBsYmVhcmluZy9yYmVhcmluZyksIHNvIHdl IG11c3QgZG8gaXQgdGhpcyB3YXkuICovCisgICAgICAgICAgICAgICAgaWYgKHZwb3MgPT0gdy0+ cGh5c19jdXJzb3IudnBvcworICAgICAgICAgICAgICAgICAgICAmJiAoZGVzaXJlZF9yb3ctPnJl dmVyc2VkX3AKKyAgICAgICAgICAgICAgICAgICAgICAgID8gKHctPnBoeXNfY3Vyc29yLmhwb3Mg PCAwKQorICAgICAgICAgICAgICAgICAgICAgICAgOiAody0+cGh5c19jdXJzb3IuaHBvcyA+PSBk ZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdKSkpCisgICAgICAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgICAgIHctPnBoeXNfY3Vyc29yX29uX3AgPSAwOworICAgICAgICAgICAgICAg ICAgICB4bGltID0gLTE7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBl bHNlCisgICAgICAgICAgICAgICAgICAgIHhsaW0gPSBjdXJyZW50X3Jvdy0+cGl4ZWxfd2lkdGg7 CisgICAgICAgICAgICAgICAgaWYgKGRyYXdfcCkKKyAgICAgICAgICAgICAgICAgIHJpZi0+Y2xl YXJfZW5kX29mX2xpbmUgKHcsIHVwZGF0ZWRfcm93LCBURVhUX0FSRUEsIHhsaW0pOworICAgICAg ICAgICAgICAgIGNsZWFyX3RvX3ggPSB4bGltOworICAgICAgICAgICAgICAgIGNoYW5nZWRfcCA9 IDE7CisgICAgICAgICAgICAgIH0KKworICAgICAgICBpZiAoY2hhbmdlZF9wCisgICAgICAgICAg ICAmJiBjbGVhcl90b194ICE9IDApCisgICAgICAgICAgeworICAgICAgICAgICAgaW50IHRleHRf YXJlYV93aWR0aCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAgICAgICAg ICBzdHJ1Y3QgbWNfUkdCIGRlYnVnX2ZnID0gey5yZWQgPSAwLjg2NywgLmdyZWVuID0gMC44Njcs IC5ibHVlID0gMC44Njd9OworICAgICAgICAgICAgc3RydWN0IGdseXBoICp0YXJnZXRfZ2x5cGgg PQorICAgICAgICAgICAgICB1cGRhdGVkX3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyB1cGRhdGVk X3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gMTsKKyAgICAgICAgICAgIC8qIGBtY19lbmdpbmUnIG9u bHkgZHJhd3MgYW4gTUNfR0xZUEggd2hlbiB4IDwgdXBkYXRlZF9yb3ctPnBpeGVsX3dpZHRoLgor ICAgICAgICAgICAgVGhlIGN1cnJlbnQgZGVzaWduIGluaGliaXRzIGRyYXdpbmcgb3ZlciBhbiBl eGlzdGluZyBnbHlwaCBhdCB0aGUgZW5kIG9mIGEKKyAgICAgICAgICAgIHdvcmQtd3JhcHBlZCBs aW5lLiAgU2FpZCBnbHlwaCByZWNlaXZlcyBhIGZha2UgY3Vyc29yIGluIGVpdGhlciBvbmUgb2Yg dGhlCisgICAgICAgICAgICBwcmV2aW91cyBzZWN0aW9ucyBhYm92ZSwgYW5kIHNob3VsZCBub3Qg YmUgb3ZlcndyaXR0ZW4gd2l0aCBhbm90aGVyIG9uZS4KKyAgICAgICAgICAgIFRoaXMgZGVzaWdu IGlzIG5lZWRlZCBiZWNhdXNlIGEgd29yZC13cmFwcGVkIGxpbmUgZG9lcyBub3QgcmVjZWl2ZSBh biBleHRyYQorICAgICAgICAgICAgc3BhY2UgbGlrZSBub24td29yZC13cmFwcGVkIGxpbmVzIGRv LiAqLworICAgICAgICAgICAgaW50IHggPSB1cGRhdGVkX3Jvdy0+cGl4ZWxfd2lkdGg7CisgICAg ICAgICAgICBpbnQgaHBvcyA9IHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxOworICAg ICAgICAgICAgaW50IHhfbGltaXQgPSAoY2xlYXJfdG9feCA9PSAtMSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgPyB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAg OiBjbGVhcl90b194OworICAgICAgICAgICAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKHct PmNvbnRlbnRzKTsKKyAgICAgICAgICAgIGJvb2wgZmlsbF9jb2x1bW5fdHJ1bXBzX3AgPSAoIU5J TFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGZjX3Zpc2libGUpKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA9PSBlc3Nl bnRpYWxzLmZjX3gpOworICAgICAgICAgICAgaWYgKHRyYWNlX3JlZGlzcGxheV9wKQorICAgICAg ICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJtY191cGRhdGVfdGV4dF9hcmVhIChmbG9hdGluZyk6 ICB2cG9zICglZCkgfCB4X2xpbWl0ICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgdnBvcywgeF9saW1pdCk7CisgICAgICAgICAgICBpZiAoQlVGRkVSUCAody0+Y29udGVu dHMpCisgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGZjX3Zpc2libGUpKQorICAg ICAgICAgICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAg IHx8ICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5J TFAgKEJWQVIgKGIsIGZjX2luYWN0aXZlX3dpbmRvd3MpKSkpCisgICAgICAgICAgICAgICAgJiYg eCA8IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+ PSB4CisgICAgICAgICAgICAgICAgJiYgdGFyZ2V0X2dseXBoICE9IE5VTEwKKyAgICAgICAgICAg ICAgICAmJiBkcmF3X3ApCisgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgZGVzaXJlZF9tYXRy aXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRfZ2x5cGgsIFRFWFRfQVJFQSwKKyAgICAgICAgICAgICAg ICAgICAgICAgICB4LCB4X2xpbWl0LCB1cGRhdGVkX3Jvdy0+eSwgaHBvcywgdnBvcywgTUNfQkFS LCAxLAorICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMs IHJvd19wb3NpdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBkZWJ1Z19wID8gZGVidWdf ZmcgOiBlc3NlbnRpYWxzLmZjX2ZnW3Jvd19wb3NpdGlvbl0sCisgICAgICAgICAgICAgICAgICAg ICAgICAgRklMTF9DT0xVTU4sIGRyYXdfcCwgTk9XSEVSRSwgTk9fQ0FDSEUpOworICAgICAgICAg ICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICYmICFOSUxQIChC VkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwg Y2hfaG9yaXpvbnRhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgJiYgKGVzc2VudGlhbHMuYWN0 aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAg ICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfaW5hY3RpdmVfd2luZG93 cykpKSkKKyAgICAgICAgICAgICAgICAmJiB4IDwgdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAg ICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAgICAgICAgICAgICYmIHRhcmdl dF9nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICAgICAgJiYgZHJhd19wKQorICAgICAgICAgICAg ICBtY19lbmdpbmUgKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBo LCBURVhUX0FSRUEsCisgICAgICAgICAgICAgICAgICAgICAgICAgeCwgeF9saW1pdCwgdXBkYXRl ZF9yb3ctPnksIGhwb3MsIHZwb3MsIE1DX0hCQVIsIDEsCisgICAgICAgICAgICAgICAgICAgICAg ICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLAorICAgICAgICAgICAg ICAgICAgICAgICAgIGRlYnVnX3AgPyBkZWJ1Z19mZyA6IGVzc2VudGlhbHMuY2hfZmdbcm93X3Bv c2l0aW9uXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBIT1JJWk9OVEFMX1JVTEVSLCBkcmF3 X3AsIE5PV0hFUkUsIE5PX0NBQ0hFKTsKKyAgICAgICAgICAgIGlmIChCVUZGRVJQICh3LT5jb250 ZW50cykKKyAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisg ICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAg ICAgICAgICAgICAgICAmJiAoZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAg ICB8fCAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICFO SUxQIChCVkFSIChiLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkpKQorICAgICAgICAgICAgICAgICYm ICFmaWxsX2NvbHVtbl90cnVtcHNfcAorICAgICAgICAgICAgICAgICYmIHggPCB0ZXh0X2FyZWFf d2lkdGgKKyAgICAgICAgICAgICAgICAmJiB2cG9zICE9IHctPmN1cnNvci52cG9zCisgICAgICAg ICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0geAorICAgICAgICAgICAgICAgICYmIHRhcmdldF9n bHlwaCAhPSBOVUxMCisgICAgICAgICAgICAgICAgJiYgZHJhd19wKQorICAgICAgICAgICAgICBt Y19lbmdpbmUgKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBoLCBU RVhUX0FSRUEsCisgICAgICAgICAgICAgICAgICAgICAgICAgeCwgeF9saW1pdCwgdXBkYXRlZF9y b3ctPnksIGhwb3MsIHZwb3MsIE1DX0JBUiwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBj dXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sCisgICAgICAgICAgICAgICAg ICAgICAgICAgZGVidWdfcCA/IGRlYnVnX2ZnIDogZXNzZW50aWFscy5jaF9mZ1tyb3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X3AgPSBmYWxzZTsKKyAgYm9v bCBnb19vbmVfcCA9IChvbGRfbWF0cml4LmN1cnNvcnNfdXNlZFtNQ19DQUNIRV0gPiAwCisgICAg ICAgICAgICAgICAgICAgfHwgb2xkX21hdHJpeC5jdXJzb3JzX3VzZWRbQ0hfQ0FDSEVdID4gMAor ICAgICAgICAgICAgICAgICAgIHx8IG9sZF9tYXRyaXguY3Vyc29yc191c2VkW0ZDX0NBQ0hFXSA+ IDApOworICBib29sIGdvX3R3b19wID0gKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAg ICAgICAgICAgICYmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hh aXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgICAgICAgICAgICAgIHx8ICFOSUxQ IChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkpOworICBib29sIHVwZGF0 aW5nX2ZyYW1lX3AgPSBmYWxzZTsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFt ZSk7CisgIGlmIChYRlJBTUUgKHctPmZyYW1lKSAhPSBmLT5tY191cGRhdGluZ19mcmFtZQorICAg ICAgJiYgKGdvX29uZV9wIHx8IGdvX3R3b19wKSkKKyAgICB7CisgICAgICB1cGRhdGluZ19mcmFt ZV9wID0gdHJ1ZTsKKyAgICAgIHVwZGF0ZV9iZWdpbiAoZik7CisgICAgfQorICBpZiAody0+cGh5 c19jdXJzb3Jfb25fcAorICAgICAgJiYgZ29fdHdvX3ApCisgICAgZXJhc2VfcGh5c19jdXJzb3Ig KHcpOworICBmb3IgKGludCB2bnRoID0gMDsKKyAgICAgICBnb19vbmVfcAorICAgICAgICYmIHZu dGggPCB3LT5tY19tYXRyaXgudnBvc191c2VkOworICAgICAgICsrdm50aCkKKyAgICB7CisgICAg ICBmb3IgKGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7CisgICAgICAg ICAgIGNhY2hlX3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICAgICAgKytjYWNoZV90eXBlKQorICAg ICAgICBmb3IgKGludCBudGhfMCA9IDA7CisgICAgICAgICAgICAgbWNfdHJhdmVyc2VfY2FjaGVf cCAob2xkX21hdHJpeCwgY2FjaGVfdHlwZSwgdm50aCwgbnRoXzApOworICAgICAgICAgICAgICsr bnRoXzApCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBzYW1lX3AgPSBmYWxzZTsKKyAg ICAgICAgICAgIGZvciAoaW50IHdfbnRoID0gMDsgd19udGggPCB3LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdOyArK3dfbnRoKQorICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgc2FtZV9wIHw9IChvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzBdLmdseXBoLnR5cGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBo LnR5cGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICgob2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5ieXRlcG9zCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW3dfbnRoXS5nbHlwaC5ieXRlcG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHx8IChvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLnJv d19wb3NpdGlvbiA9PSBBVF9aVgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0ucm93X3Bv c2l0aW9uID09IEFUX1pWKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLnJvd19wb3NpdGlvbiA9 PSBQT1NUX1pWCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5yb3dfcG9zaXRpb24gPT0g UE9TVF9aVikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAoKG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGguY2hhcnBvcworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVt3X250aF0uZ2x5cGguY2hhcnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICB8fCAob2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8w XS5yb3dfcG9zaXRpb24gPT0gQVRfWlYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLnJv d19wb3NpdGlvbiA9PSBBVF9aVikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAo b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5yb3dfcG9zaXRp b24gPT0gUE9TVF9aVgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0ucm93X3Bvc2l0aW9u ID09IFBPU1RfWlYpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC51LnZhbAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVt3X250aF0uZ2x5cGgudS52YWwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGguZmFj ZV9pZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGguZmFjZV9pZAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF8wXS5nbHlwaC5wYWRkaW5nX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnBh ZGRpbmdfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5sZWZ0X2JveF9saW5lX3AKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bd19udGhdLmdseXBoLmxlZnRfYm94X2xpbmVfcAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8wXS5nbHlwaC5yaWdodF9ib3hfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlw aC5yaWdodF9ib3hfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnZvZmZzZXQKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnZvZmZzZXQKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0u Z2x5cGgucGl4ZWxfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnBpeGVsX3dp ZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnNsaWNlLmltZy54CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5pbWcueAorICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5z bGljZS5pbWcueQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGguc2xpY2UuaW1nLnkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMF0uZ2x5cGguc2xpY2UuaW1nLndpZHRoCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W3dfbnRoXS5nbHlwaC5zbGljZS5pbWcud2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGgu c2xpY2UuaW1nLmhlaWdodAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGguc2xpY2UuaW1n LmhlaWdodAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5zbGljZS5jbXAuZnJvbQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVt3X250aF0uZ2x5cGguc2xpY2UuY21wLmZyb20KKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhf MF0ueAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0ueAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5meAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVt3X250aF0uZngKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0ueQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVt3X250aF0ueQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5meQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVt3X250aF0uZnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uaHBvcworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVt3X250aF0uaHBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS52cG9zCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W3dfbnRoXS52cG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLndkCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3df bnRoXS53ZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5oCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5o CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzBdLmN1cnNvcl90eXBlCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRo XS5jdXJzb3JfdHlwZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5jdXJzb3Jfd2lkdGgKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bd19udGhdLmN1cnNvcl93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5mZy5yZWQK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmZnLnJlZAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5mZy5n cmVlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZmcuZ3JlZW4KKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhf MF0uZmcuYmx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZmcuYmx1ZQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF8wXS5iZy5yZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmJnLnJlZAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS5iZy5ncmVlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uYmcuZ3JlZW4KKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMF0uYmcuYmx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9 PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uYmcuYmx1 ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8wXS5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0u YWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGhfZmxhdm9yCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3dfbnRoXS5nbHlwaF9mbGF2b3IKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9s ZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZW5hYmxlZF9wCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5lbmFibGVkX3ApOworICAgICAgICAgICAgICAgIC8qIEZv cmNlIHRoZSBmcmluZ2UgYml0bWFwcyB0byBhbHdheXMgYmUgcmVzZXQvcmVkcmF3bi4gKi8KKyAg ICAgICAgICAgICAgICBpZiAob2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF8wXS5jdXJzb3JfdHlwZQorICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5jdXJzb3JfdHlwZQorICAgICAg ICAgICAgICAgICAgICAmJiAob2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF8wXS5jdXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAg ICAgICAgICAgICAgIHx8IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhfMF0uY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUCkpCisgICAgICAgICAg ICAgICAgICBzYW1lX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBpZiAoc2FtZV9wKQorICAg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZiAoZGVidWdfcCkKKyAgICAg ICAgICAgICAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJISVQgKCVzKTogIHZwb3MgKCVkKSB8 IGhwb3MgKCVkKSB8IGNoYXIgKCVzKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIChjYWNoZV90eXBlID09IE1DX0NBQ0hFKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/ICJNQyIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogKGNhY2hlX3R5cGUgPT0gQ0hfQ0FDSEUpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gIkNIIgorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiAoY2FjaGVfdHlwZSA9PSBGQ19DQUNIRSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyAiRkMiCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6ICJOTyIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0udnBv cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5ocG9zLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgbWNfY2hhcl90b19zdHJpbmcgKHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC51LmNoKSk7CisgICAgICAg ICAgICAgICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3df bnRoXS5zYW1lX3AgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGRlYnVnX3ApCisgICAgICAg ICAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIk1JU1MgKCVzKTogIHZwb3MgKCVkKSB8IGhw b3MgKCVkIHYuICVkKSB8IGNoYXIgKCVzIHYuICVzKSB8IGNhY2hlX3VzZWQgKCVkIHYuICVkKVxu IiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY2FjaGVfdHlwZSA9PSBN Q19DQUNIRSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gIk1DIgor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGNhY2hlX3R5cGUgPT0gQ0hf Q0FDSEUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICJDSCIKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjYWNoZV90eXBlID09IEZDX0NB Q0hFKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAiRkMiCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiTk8iLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW3dfbnRoXS52cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uaHBvcywKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uaHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAob2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC51LmNoKSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAody0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnUuY2gpLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2Nh Y2hlX3R5cGVdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV0pOworICAgICAgICAgICAgICB9 CisgICAgICAgICAgICBpZiAoIXNhbWVfcCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgIC8qIGBtYXRyaXhfcm93JyBpbiBgZGlzcG5ldy5jYCBjb250YWlucyB0aGUgZm9sbG93aW5n IHRlc3RzLAorICAgICAgICAgICAgICAgIGVhc3NlcnQgKG1hdHJpeCAmJiBtYXRyaXgtPnJvd3Mp OworICAgICAgICAgICAgICAgIGVhc3NlcnQgKHJvdyA+PSAwICYmIHJvdyA8IG1hdHJpeC0+bnJv d3MpOyAqLworICAgICAgICAgICAgICAgIGJvb2wgYmFyZl9jcmFzaF9vbmUgPSAody0+Y3VycmVu dF9tYXRyaXggJiYgdy0+Y3VycmVudF9tYXRyaXgtPnJvd3MpID8gZmFsc2UgOiB0cnVlOworICAg ICAgICAgICAgICAgIGlmIChiYXJmX2NyYXNoX29uZSkKKyAgICAgICAgICAgICAgICAgIGNvbnRp bnVlOworICAgICAgICAgICAgICAgIGJvb2wgYmFyZl9jcmFzaF90d28gPSAodm50aCA+PSAwICYm IHZudGggPCB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3MpID8gZmFsc2UgOiB0cnVlOworICAgICAg ICAgICAgICAgIGlmIChiYXJmX2NyYXNoX3R3bykKKyAgICAgICAgICAgICAgICAgIGNvbnRpbnVl OworICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnZudGhfcm93ID0gTUFUUklYX1JP VyAody0+Y3VycmVudF9tYXRyaXgsIHZudGgpOworICAgICAgICAgICAgICAgIGludCB4XzAgPSBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLng7CisgICAgICAg ICAgICAgICAgaW50IGZ4XzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXzBdLmZ4OworICAgICAgICAgICAgICAgIGludCB5XzAgPSBvbGRfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLnk7CisgICAgICAgICAgICAgICAgaW50IGZ5 XzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZ5Owor ICAgICAgICAgICAgICAgIGludCB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F8w XS5mZy5ibHVlfTsKKyAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9iZ18wID0gey5y ZWQgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmJnLnJl ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IG9s ZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uYmcuZ3JlZW4sCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uYmcuYmx1ZX07CisgICAgICAg ICAgICAgICAgYm9vbCBhY3RpdmVfcF8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8wXS5hY3RpdmVfcDsKKyAgICAgICAgICAgICAgICBlbnVtIG1jX2ZsYXZv ciBnbHlwaF9mbGF2b3JfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMF0uZ2x5cGhfZmxhdm9yOworICAgICAgICAgICAgICAgIGJvb2wgZW5hYmxlZF9wXzAg PSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmVuYWJsZWRf cDsKKyAgICAgICAgICAgICAgICBpZiAodnBvc18wID09IHZudGgKKyAgICAgICAgICAgICAgICAg ICAgJiYgZ2x5cGhfZmxhdm9yXzAgPT0gTUNfR0xZUEgKKyAgICAgICAgICAgICAgICAgICAgJiYg ZW5hYmxlZF9wXzAKKyAgICAgICAgICAgICAgICAgICAgJiYgdm50aF9yb3ctPmVuYWJsZWRfcCkK KyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbWNfZXJhc2VfY3Vyc29y ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgdm50aF9yb3csIHhfMCwgeV8wLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGhwb3NfMCwgdnBvc18wLCBnbHlwaF9mbGF2b3JfMCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZV8wLCB3ZF8w KTsKKyAgICAgICAgICAgICAgICAgICAgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8wXS5lbmFibGVkX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgLS1v bGRfbWF0cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90eXBlXTsKKyAgICAgICAgICAgICAgICAgICAg LyogSWYgd2UgaW5hZHZlcnRlbnRseSBlcmFzZWQgYW5vdGhlciBmYWtlIGN1cnNvciBhdCB0aGUg c2FtZQorICAgICAgICAgICAgICAgICAgICBIUE9TIHRoYXQgaXMgc3RpbGwgZW5hYmxlZF9wIGlu IHRoZSBgb2xkX21hdHJpeGAsIHRoZW4gcmVkcmF3IGl0LiAqLworICAgICAgICAgICAgICAgICAg ICBmb3IgKGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7CisgICAgICAg ICAgICAgICAgICAgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICAgICAgICAg ICAgICAgICAgICsrY2FjaGVfdHlwZSkKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAg ICAgICAgICAgICAgICAgICBmb3IgKGludCBudGhfMSA9IDA7CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIG1jX3RyYXZlcnNlX2NhY2hlX3AgKG9sZF9tYXRyaXgsIGNhY2hlX3R5cGUsIHZu dGgsIG50aF8xKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKytudGhfMSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB4 XzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLng7Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZ4XzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmZ4OworICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGludCB5XzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XzFdLnk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZ5XzEgPSBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmZ5OworICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGludCBocG9zXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzFdLmhwb3M7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHZw b3NfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0udnBv czsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgd2RfMSA9IG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0ud2Q7CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgaW50IGhfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMV0uaDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90 eXBlIGN1cnNvcl90eXBlXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXzFdLmN1cnNvcl90eXBlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBj dXJzb3Jfd2lkdGhfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhfMV0uY3Vyc29yX3dpZHRoOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBt Y19SR0IgbHNsX2ZnXzEgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMV0uZmcucmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF8xXS5mZy5ncmVlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0gb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5mZy5ibHVlfTsKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAvLyAgc3RydWN0IG1jX1JHQiBsc2xfYmdfMSA9IHsucmVkID0gb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5iZy5yZWQsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gb2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5iZy5ncmVlbiwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgICAu Ymx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uYmcu Ymx1ZX07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBhY3RpdmVfcF8xID0gb2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5hY3RpdmVfcDsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3JfMSA9 IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZ2x5cGhfZmxh dm9yOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgZW5hYmxlZF9wXzEgPSBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmVuYWJsZWRfcDsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGdvX3BfMSA9IChocG9zXzAgPT0gaHBvc18x CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9w XzEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZ29fcF8xKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgYm9vbCByZW1vdmVfcF8xID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg bWNfZHJhd19lcmFzZV9oeWJyaWQgKHcsIHctPmN1cnJlbnRfbWF0cml4LCB2bnRoX3JvdywgeF8x LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmeF8x LCB5XzEsIGZ5XzEsIGhwb3NfMSwgdnBvc18xLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICB3ZF8xLCBoXzEsIGN1cnNvcl90eXBlXzEsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aF8x LCBsc2xfZmdfMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgYWN0aXZlX3BfMSwgZ2x5cGhfZmxhdm9yXzEsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZV9wXzEpOworICAgICAgICAgICAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgICAgICAgZWxzZSBpZiAodnBvc18wID09IHZudGgKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIGVuYWJsZWRfcF8wCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiB2bnRoX3Jvdy0+ZW5hYmxlZF9wKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAg ICAgICAgICAgICAgICAgYm9vbCByZW1vdmVfcF8wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAg ICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgdy0+Y3VycmVudF9tYXRyaXgsIHZudGhfcm93 LCB4XzAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ4XzAs IHlfMCwgZnlfMCwgaHBvc18wLCB2cG9zXzAsIHdkXzAsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGhfMCwgY3Vyc29yX3R5cGVfMCwgY3Vyc29yX3dpZHRoXzAs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxzbF9iZ18wLCBh Y3RpdmVfcF8wLCBnbHlwaF9mbGF2b3JfMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgcmVtb3ZlX3BfMCk7CisgICAgICAgICAgICAgICAgICAgICAgb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5lbmFibGVkX3AgPSBmYWxz ZTsKKyAgICAgICAgICAgICAgICAgICAgICAtLW9sZF9tYXRyaXguY3Vyc29yc191c2VkW2NhY2hl X3R5cGVdOworICAgICAgICAgICAgICAgICAgICAgIC8qIElmIHdlIGluYWR2ZXJ0ZW50bHkgZXJh c2VkIGFub3RoZXIgZmFrZSBjdXJzb3IgYXQgdGhlIHNhbWUKKyAgICAgICAgICAgICAgICAgICAg ICBIUE9TIHRoYXQgaXMgc3RpbGwgZW5hYmxlZF9wIGluIHRoZSBgb2xkX21hdHJpeGAsIHRoZW4g cmVkcmF3IGl0LiAqLworICAgICAgICAgICAgICAgICAgICAgIGZvciAoZW51bSBtY19jYWNoZV90 eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGNh Y2hlX3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICsrY2FjaGVf dHlwZSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgZm9yIChpbnQgbnRoXzIgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1j X3RyYXZlcnNlX2NhY2hlX3AgKG9sZF9tYXRyaXgsIGNhY2hlX3R5cGUsIHZudGgsIG50aF8yKTsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArK250aF8yKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB4XzIgPSBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLng7CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBpbnQgZnhfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMl0uZng7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBpbnQgeV8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8y XS55OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZ5XzIgPSBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmZ5OworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgaW50IGhwb3NfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMl0uaHBvczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlu dCB2cG9zXzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJd LnZwb3M7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgd2RfMiA9IG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0ud2Q7CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBpbnQgaF8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8yXS5oOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBt Y19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZV8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF8yXS5jdXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGludCBjdXJzb3Jfd2lkdGhfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMl0uY3Vyc29yX3dpZHRoOworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmdfMiA9IHsucmVkID0gb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5mZy5yZWQsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uZmcuZ3JlZW4sCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0gb2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5mZy5ibHVlfTsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBzdHJ1Y3QgbWNfUkdCIGxzbF9iZ18yID0g ey5yZWQgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmJn LnJlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAg ICAgICAgICAgIC5ncmVlbiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMl0uYmcuZ3JlZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMl0uYmcuYmx1ZX07CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBib29sIGFjdGl2ZV9wXzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXzJdLmFjdGl2ZV9wOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51 bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yXzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXzJdLmdseXBoX2ZsYXZvcjsKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGJvb2wgZW5hYmxlZF9wXzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzJdLmVuYWJsZWRfcDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGJvb2wgZ29fcF8yID0gKGhwb3NfMCA9PSBocG9zXzIKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIGZ4XzAgPD0gZnhfMgorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZnhfMCArIHdkXzAgPiBmeF8yICsgd2RfMgor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9w XzIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFnb19wXzIpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgYm9vbCByZW1vdmVfcF8yID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgdy0+Y3VycmVudF9tYXRyaXgsIHZudGhf cm93LCB4XzIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgZnhfMiwgeV8yLCBmeV8yLCBocG9zXzIsIHZwb3NfMiwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ZF8yLCBoXzIsIGN1cnNvcl90eXBl XzIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg Y3Vyc29yX3dpZHRoXzIsIGxzbF9mZ18yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGFjdGl2ZV9wXzIsIGdseXBoX2ZsYXZvcl8yLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZV9wXzIp OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9 CisgICAgfQorICBpZiAodXBkYXRpbmdfZnJhbWVfcCkKKyAgICB1cGRhdGVfZW5kIChmKTsKK30K Kwordm9pZAorbWNfdXBkYXRlX3dpbmRvd19kcnlydW4gKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wg Zm9yY2VfcCwgc3RydWN0IG1jX2Vzc2VudGlhbHMgZXNzZW50aWFscykKK3sKKyAgaWYgKCFCVUZG RVJQICh3LT5jb250ZW50cykpCisgICAgcmV0dXJuOworCisgIGlmICh3LT5tY19tYXRyaXguY3Vy c29yc191c2VkW01DX0NBQ0hFXSA9PSAwCisgICAgICAmJiB3LT5tY19tYXRyaXguY3Vyc29yc191 c2VkW0NIX0NBQ0hFXSA9PSAwCisgICAgICAmJiB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0ZD X0NBQ0hFXSA9PSAwCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IG1jX2NvbmYpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBj cm9zc2hhaXJzKSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg ZmNfdmlzaWJsZSkpKQorICAgIHJldHVybjsKKworICAvLyBjbG9ja190IGNsb2NrX3N0YXJ0ID0g Y2xvY2soKTsKKworICBib29sIGRyYXdfcCA9IGZhbHNlOworCisgIHN0cnV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b3JjZV9wIHx8ICFpbnB1dF9wZW5kaW5nIHx8ICFOSUxQIChkb19tb3VzZV90cmFja2luZykpCisg ICAgeworICAgICAgc3RydWN0IGdseXBoX3JvdyAqaGVhZGVyX2xpbmVfcm93OworICAgICAgYm9v bCBjaGFuZ2VkX3AgPSAwOworICAgICAgYm9vbCBtb3VzZV9mYWNlX292ZXJ3cml0dGVuX3AgPSAw OworICAgICAgaW50IG5fdXBkYXRlZCA9IDA7CisgICAgICAvLyAgc3RydWN0IHJlZGlzcGxheV9p bnRlcmZhY2UgKnJpZiA9IEZSQU1FX1JJRiAoWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKSk7Cisg ICAgICAvLyAgcmlmLT51cGRhdGVfd2luZG93X2JlZ2luX2hvb2sgKHcpOworICAgICAgaW50IHli ID0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpOworICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93 ID0gTUFUUklYX1JPVyAoZGVzaXJlZF9tYXRyaXgsIDApOworICAgICAgc3RydWN0IGdseXBoX3Jv dyAqZW5kID0gTUFUUklYX01PREVfTElORV9ST1cgKGRlc2lyZWRfbWF0cml4KTsKKworICAgICAg LyogVGFrZSBub3RlIG9mIHRoZSBoZWFkZXIgbGluZSwgaWYgdGhlcmUgaXMgb25lLiAgV2Ugd2ls bAorICAgICAgICAgdXBkYXRlIGl0IGJlbG93LCBhZnRlciB1cGRhdGluZyBhbGwgb2YgdGhlIHdp bmRvdydzIGxpbmVzLiAqLworICAgICAgaWYgKHJvdy0+bW9kZV9saW5lX3ApCisgICAgICAgIHsK KyAgICAgICAgICBoZWFkZXJfbGluZV9yb3cgPSByb3c7CisgICAgICAgICAgKytyb3c7CisgICAg ICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIGhlYWRlcl9saW5lX3JvdyA9IE5VTEw7CisK KyAgICAgIC8qIFVwZGF0ZSB0aGUgbW9kZSBsaW5lLCBpZiBuZWNlc3NhcnkuICovCisgICAgICBz dHJ1Y3QgZ2x5cGhfcm93ICptb2RlX2xpbmVfcm93ID0gTUFUUklYX01PREVfTElORV9ST1cgKGRl c2lyZWRfbWF0cml4KTsKKyAgICAgIGlmIChtb2RlX2xpbmVfcm93LT5tb2RlX2xpbmVfcCAmJiBt b2RlX2xpbmVfcm93LT5lbmFibGVkX3ApCisgICAgICAgIHsKKyAgICAgICAgICBtb2RlX2xpbmVf cm93LT55ID0geWIgKyBXSU5ET1dfU0NST0xMX0JBUl9BUkVBX0hFSUdIVCAodyk7CisgICAgICAg ICAgdXBkYXRlX3dpbmRvd19saW5lICh3LCBNQVRSSVhfUk9XX1ZQT1MgKG1vZGVfbGluZV9yb3cs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2ly ZWRfbWF0cml4KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZtb3VzZV9mYWNlX292 ZXJ3cml0dGVuX3ApOworICAgICAgICB9CisKKyAgICAgIC8qIEZpbmQgZmlyc3QgZW5hYmxlZCBy b3cuICBPcHRpbWl6YXRpb25zIGluIHJlZGlzcGxheV9pbnRlcm5hbAorICAgICAgICAgbWF5IGxl YWQgdG8gYW4gdXBkYXRlIHdpdGggb25seSBvbmUgcm93IGVuYWJsZWQuICBUaGVyZSBtYXkKKyAg ICAgICAgIGJlIGFsc28gY29tcGxldGVseSBlbXB0eSBtYXRyaWNlcy4gKi8KKyAgICAgIHdoaWxl IChyb3cgPCBlbmQgJiYgIXJvdy0+ZW5hYmxlZF9wKQorICAgICAgICArK3JvdzsKKworICAgICAg LyogVHJ5IHJldXNpbmcgcGFydCBvZiB0aGUgZGlzcGxheSBieSBjb3B5aW5nLiAqLworICAgICAg aWYgKHJvdyA8IGVuZCAmJiAhdy0+ZGVzaXJlZF9tYXRyaXgtPm5vX3Njcm9sbGluZ19wKQorICAg ICAgICB7CisgICAgICAgICAgaW50IHJjID0gbWNfc2Nyb2xsaW5nX3dpbmRvdyAodywgaGVhZGVy X2xpbmVfcm93ICE9IE5VTEwpOworICAgICAgICAgIGlmIChyYyA8IDApCisgICAgICAgICAgICB7 CisgICAgICAgICAgICAgIC8qIEFsbCByb3dzIHdlcmUgZm91bmQgdG8gYmUgZXF1YWwuICovCisg ICAgICAgICAgICAgIHBhdXNlZF9wID0gMDsKKyAgICAgICAgICAgICAgZ290byBzZXRfY3Vyc29y OworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAocmMgPiAwKQorICAgICAgICAg ICAgICB7CisgICAgICAgICAgICAgICAgLyogV2UndmUgc2Nyb2xsZWQgdGhlIGRpc3BsYXkuICov CisgICAgICAgICAgICAgICAgZm9yY2VfcCA9IDE7CisgICAgICAgICAgICAgICAgY2hhbmdlZF9w ID0gMTsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAvKiBQcm9jZXNzIHRoZSBj dXJzb3Igcm93IGF0IHRoZSBvdXRzZXQgaWYgaXQgaXMgd2l0aGluIGBkZXNpcmVkX21hdHJpeGAu CisgICAgICBXaGVuIHByb2Nlc3NpbmcgYWxsIG90aGVyIHJvd3MsIHdlIHdpbGwgcXVlcnkgdGhl IGB3LT5jdXJyZW50X21hdHJpeGAgZm9yIGRhdGEKKyAgICAgIHJlbGF0aW5nIHRvIHRoZSBjdXJz b3Igcm93LiAgYG1ha2VfY3VycmVudGAgKHdpdGhpbiBgdXBkYXRlX3dpbmRvd19saW5lJykKKyAg ICAgIHVwZGF0ZXMgdGhlIGB3LT5jdXJyZW50X21hdHJpeGAgZm9yIHRoZSBhcHBsaWNhYmxlIHJv dy4gIEluIGRvaW5nIHNvLCBob3dldmVyLAorICAgICAgdGhlIGFwcGxpY2FibGUgcm93IGluIHRo ZSBkZXNpcmVkIG1hdHJpeCBpcyBhbHRlcmVkIHN1Y2ggdGhhdCB3ZSBjYW4gbm8gbG9uZ2VyCisg ICAgICByZWx5IHVwb24gdGhlIGFjY3VyYWN5IG9mIGBST1ctPnVzZWRbVEVYVF9BUkVBXWAuICBU aGVyZWZvcmUsIHdlIG11c3Qgbm93IHJlbHkKKyAgICAgIGV4Y2x1c2l2ZWx5IHVwb24gYHctPmN1 cnJlbnRfbWF0cml4JyBmb3IgY3Vyc29yIHJvdyBiYXNlZCBkZWNpc2lvbnMuICovCisgICAgICBm b3IgKHN0cnVjdCBnbHlwaF9yb3cgKm1jX3JvdyA9IHJvdzsKKyAgICAgICAgICAgbWNfcm93IDwg ZW5kICYmIChmb3JjZV9wIHx8ICFpbnB1dF9wZW5kaW5nKTsKKyAgICAgICAgICAgKyttY19yb3cp CisgICAgICAgIHsKKyAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAobWNfcm93 LCB3LT5kZXNpcmVkX21hdHJpeCk7CisgICAgICAgICAgaWYgKG1jX3Jvdy0+ZW5hYmxlZF9wCisg ICAgICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXggPSB3LT5kZXNpcmVkX21hdHJpeDsKKyAgICAgICAg ICAgICAgaWYgKCFmb3JjZV9wICYmICsrbl91cGRhdGVkICUgcHJlZW1wdF9jb3VudCA9PSAwKQor ICAgICAgICAgICAgICAgIGRldGVjdF9pbnB1dF9wZW5kaW5nX2lnbm9yZV9zcXVlZXphYmxlcyAo KTsKKyAgICAgICAgICAgICAgY2hhbmdlZF9wIHw9IG1jX3VwZGF0ZV93aW5kb3dfbGluZSAodywg dnBvcywgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgZHJh d19wKTsKKyAgICAgICAgICAgICAgaWYgKE1BVFJJWF9ST1dfQk9UVE9NX1kgKHJvdykgPj0geWIp CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IHZwb3MgKyAxOyBpIDwgdy0+Y3VycmVudF9t YXRyaXgtPm5yb3dzIC0gMTsgKytpKQorICAgICAgICAgICAgICAgICAgU0VUX01BVFJJWF9ST1df RU5BQkxFRF9QICh3LT5jdXJyZW50X21hdHJpeCwgaSwgZmFsc2UpOworICAgICAgICAgICAgICBi cmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgY3Vyc29yX21hdHJpeCA9IHct PmN1cnJlbnRfbWF0cml4OworICAgICAgLyogVXBkYXRlIHRoZSByZXN0IG9mIHRoZSBsaW5lcy4g Ki8KKyAgICAgIGZvciAoOyByb3cgPCBlbmQgJiYgKGZvcmNlX3AgfHwgIWlucHV0X3BlbmRpbmcp OyArK3JvdykKKyAgICAgICAgLyogc2Nyb2xsaW5nX3dpbmRvdyByZXNldHMgdGhlIGVuYWJsZWRf cCBmbGFnIG9mIHRoZSByb3dzIGl0IHJldXNlcyBmcm9tCisgICAgICAgIGN1cnJlbnRfbWF0cml4 LiAqLworICAgICAgICBpZiAocm93LT5lbmFibGVkX3ApCisgICAgICAgICAgeworICAgICAgICAg ICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgdy0+ZGVzaXJlZF9tYXRyaXgpOwor ICAgICAgICAgICAgLyogSWYgdGhlIGBjdXJzb3Jfcm93YCBpcyB3aXRoaW4gdGhlIGBkZXNpcmVk X21hdHJpeGAsIHRoZW4gaXQgd2FzCisgICAgICAgICAgICBwcm9jZXNzZWQgaGVyZWluYWJvdmUg YW5kIHNob3VsZCBiZSBza2lwcGVkIGF0IHRoaXMgdGltZS4gKi8KKyAgICAgICAgICAgIGlmICh2 cG9zID09IHctPmN1cnNvci52cG9zKQorICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAg ICBpbnQgaTsKKyAgICAgICAgICAgIC8qIFdlJ2xsIGhhdmUgdG8gcGxheSBhIGxpdHRsZSBiaXQg d2l0aCB3aGVuIHRvCisgICAgICAgICAgICAgICBkZXRlY3RfaW5wdXRfcGVuZGluZy4gIElmIGl0 J3MgZG9uZSB0b28gb2Z0ZW4sCisgICAgICAgICAgICAgICBzY3JvbGxpbmcgbGFyZ2Ugd2luZG93 cyB3aXRoIHJlcGVhdGVkIHNjcm9sbC11cAorICAgICAgICAgICAgICAgY29tbWFuZHMgd2lsbCB0 b28gcXVpY2tseSBwYXVzZSByZWRpc3BsYXkuICovCisgICAgICAgICAgICBpZiAoIWZvcmNlX3Ag JiYgKytuX3VwZGF0ZWQgJSBwcmVlbXB0X2NvdW50ID09IDApCisgICAgICAgICAgICAgIGRldGVj dF9pbnB1dF9wZW5kaW5nX2lnbm9yZV9zcXVlZXphYmxlcyAoKTsKKyAgICAgICAgICAgIGNoYW5n ZWRfcCB8PSBtY191cGRhdGVfd2luZG93X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3 cml0dGVuX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCBkcmF3X3ApOworICAgICAgICAgICAgLyogTWFy ayBhbGwgcm93cyBiZWxvdyB0aGUgbGFzdCB2aXNpYmxlIG9uZSBpbiB0aGUgY3VycmVudAorICAg ICAgICAgICAgICAgbWF0cml4IGFzIGludmFsaWQuICBUaGlzIGlzIG5lY2Vzc2FyeSBiZWNhdXNl IG9mCisgICAgICAgICAgICAgICB2YXJpYWJsZSBsaW5lIGhlaWdodHMuICBDb25zaWRlciB0aGUg Y2FzZSBvZiB0aHJlZQorICAgICAgICAgICAgICAgc3VjY2Vzc2l2ZSByZWRpc3BsYXlzLCB3aGVy ZSB0aGUgZmlyc3QgZGlzcGxheXMgNQorICAgICAgICAgICAgICAgbGluZXMsIHRoZSBzZWNvbmQg MyBsaW5lcywgYW5kIHRoZSB0aGlyZCA1IGxpbmVzIGFnYWluLgorICAgICAgICAgICAgICAgSWYg dGhlIHNlY29uZCByZWRpc3BsY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ICAgICAg YHJvd2Agd2FzIGFkdmFuY2VkIHRvIHRoZSBmaXJzdCBgcm93LT5lbmFibGVkX3BgLiAqLworICAg ICAgZm9yIChzdHJ1Y3QgZ2x5cGhfcm93ICpkZXNpcmVkX3JvdyA9IE1BVFJJWF9ST1cgKHctPmRl c2lyZWRfbWF0cml4LCAwKTsKKyAgICAgICAgICAgZGVzaXJlZF9yb3cgPCBlbmQKKyAgICAgICAg ICAgJiYgKGZvcmNlX3AgfHwgIWlucHV0X3BlbmRpbmcpCisgICAgICAgICAgIC8qIFczMiBFbWFj cyBjcmFzaGVzIG9uIHN0YXJ0dXAgd2l0aG91dCBhIEJVRkZFUlAgY2hlY2suICovCisgICAgICAg ICAgICYmIEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAmJiAoIU5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAgICAgICB8fCAhTklM UCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAg ICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKSk7 CisgICAgICAgICAgICsrZGVzaXJlZF9yb3cpCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgdnBv cyA9IE1BVFJJWF9ST1dfVlBPUyAoZGVzaXJlZF9yb3csIHctPmRlc2lyZWRfbWF0cml4KTsKKyAg ICAgICAgICBpZiAoZGVzaXJlZF9yb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgICAgIGNvbnRpbnVl OworICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKmN1cnJlbnRfcm93ID0gTUFUUklYX1JPVyAo dy0+Y3VycmVudF9tYXRyaXgsIHZwb3MpOworICAgICAgICAgIGVudW0gbWNfcm93X3Bvc2l0aW9u IHJvd19wb3NpdGlvbiA9IG1jX3Jvd19wb3NpdGlvbiAodywgY3VycmVudF9yb3csIGN1cnJlbnRf cm93LCB2cG9zKTsKKyAgICAgICAgICBpZiAoY3VycmVudF9yb3ctPmVuYWJsZWRfcCkKKyAgICAg ICAgICAgIG1jX2RyYXdfcm93ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgY3VycmVudF9yb3csIGN1 cnJlbnRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBj dXJyZW50X3Jvdy0+eCwgY3VycmVudF9yb3ctPnVzZWRbVEVYVF9BUkVBXSwgdnBvcywKKyAgICAg ICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCByb3dfcG9zaXRp b24sIGRyYXdfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBTRVRfQ1VSU09SX09ORSk7Cisg ICAgICAgIH0KKworICAgICAgbWNfcmVzdG9yZV9nbHlwaF9tYXRyaXggKHNhdmVkX2Rlc2lyZWQs IHctPmRlc2lyZWRfbWF0cml4KTsKKyAgICAgIG1jX3Jlc3RvcmVfZ2x5cGhfbWF0cml4IChzYXZl ZF9jdXJyZW50LCB3LT5jdXJyZW50X21hdHJpeCk7CisKKyAgICAgIG1jX3VwZGF0ZV93aW5kb3df ZXJhc2UgKHcsIG9sZF9tYXRyaXgpOworCisgICAgICBtY194ZnJlZV9jYWNoZV9tYXRyaXggKHcs ICZvbGRfbWF0cml4KTsKKworICAgIH0KKyAgLy8gY2xvY2tfdCBjbG9ja19lbmQgPSBjbG9jaygp OworICAvLyBkb3VibGUgY3B1X3RpbWVfdXNlZCA9ICgoZG91YmxlKSAoY2xvY2tfZW5kIC0gY2xv Y2tfc3RhcnQpKSAvIENMT0NLU19QRVJfU0VDOworICAvLyBmcHJpbnRmIChzdGRlcnIsICJtY19z Y3JvbGxpbmdfd2luZG93ICglcyk6ICBUSU1FICglZilcbiIsIG1jX3dpbmRvdyAodyksIGNwdV90 aW1lX3VzZWQpOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisKKwogLyogU3RydWN0dXJlIHRvIHBhc3MgZGltZW5zaW9ucyBhcm91bmQu ICBVc2VkIGZvciBjaGFyYWN0ZXIgYm91bmRpbmcKICAgIGJveGVzLCBnbHlwaCBtYXRyaXggZGlt ZW5zaW9ucyBhbmQgYWxpa2UuICAqLwogCkBAIC0yMjQxLDYgKzQwNjQsMTYgQEAgZnJlZV93aW5k b3dfbWF0cmljZXMgKHN0cnVjdCB3aW5kb3cgKncpCiAJICBmcmVlX2dseXBoX21hdHJpeCAody0+ Y3VycmVudF9tYXRyaXgpOwogCSAgZnJlZV9nbHlwaF9tYXRyaXggKHctPmRlc2lyZWRfbWF0cml4 KTsKIAkgIHctPmN1cnJlbnRfbWF0cml4ID0gdy0+ZGVzaXJlZF9tYXRyaXggPSBOVUxMOworCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIG1j X3hmcmVlX2NhY2hlX21hdHJpeCAodywgJnctPm1jX21hdHJpeCk7CisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKIAl9CiAKICAgICAgIC8qIE5leHQgd2luZG93IG9uIHNhbWUgbGV2ZWwu ICAqLwpAQCAtMzM4Nyw2ICs1MjIwLDI2IEBAIGNoZWNrX2N1cnJlbnRfbWF0cml4X2ZsYWdzIChz dHJ1Y3Qgd2luZG93ICp3KQogc3RhdGljIGJvb2wKIHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5k b3cgKncsIGJvb2wgZm9yY2VfcCkKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBpZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAgZnBy aW50ZiAoc3RkZXJyLCAidXBkYXRlX3dpbmRvdyAoJXMpXG4iLCBtY193aW5kb3cgKHcpKTsKKwor ICBzdHJ1Y3QgbWNfZXNzZW50aWFscyBlc3NlbnRpYWxzOworICBtY19zZXRfZXNzZW50aWFscyAo dywgJmVzc2VudGlhbHMpOworCisgIG1jX3VwZGF0ZV93aW5kb3dfZHJ5cnVuICh3LCBmb3JjZV9w LCBlc3NlbnRpYWxzKTsKKworICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICpjdXJzb3JfbWF0cml4ID0g TlVMTDsKKworICBib29sIGRyYXdfcCA9IHRydWU7CisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKICAgc3RydWN0IGdseXBoX21hdHJpeCAqZGVzaXJlZF9tYXRyaXggPSB3LT5kZXNpcmVk X21hdHJpeDsKICAgYm9vbCBwYXVzZWRfcDsKICAgaW50IHByZWVtcHRfY291bnQgPSBjbGlwX3Rv X2JvdW5kcyAoMSwgYmF1ZF9yYXRlIC8gMjQwMCArIDEsIElOVF9NQVgpOwpAQCAtMzQ2NCw2ICs1 MzE3LDQ3IEBAIHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkK IAkgICAgfQogCX0KIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKworICAvKiBQcm9jZXNzIHRoZSBjdXJzb3Igc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p cmVkX21hdHJpeDsKKyAgICAgICAgICBpZiAoIWZvcmNlX3AgJiYgKytuX3VwZGF0ZWQgJSBwcmVl bXB0X2NvdW50ID09IDApCisgICAgICAgICAgICBkZXRlY3RfaW5wdXRfcGVuZGluZ19pZ25vcmVf c3F1ZWV6YWJsZXMgKCk7CisgICAgICAgICAgY2hhbmdlZF9wIHw9IChCVUZGRVJQICh3LT5jb250 ZW50cykKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICghTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAh TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICB8fCAhIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgZmNfdmlzaWJsZSkpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgPyBtY191cGRhdGVfd2lu ZG93X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3cml0dGVuX3AsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBlc3Nl bnRpYWxzLCBkcmF3X3ApCisgICAgICAgICAgICAgICAgICAgICAgIDogdXBkYXRlX3dpbmRvd19s aW5lICh3LCB2cG9zLCAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wKTsKKyAgICAgICAgICBpZiAo TUFUUklYX1JPV19CT1RUT01fWSAocm93KSA+PSB5YikKKyAgICAgICAgICAgIGZvciAoaW50IGkg PSB2cG9zICsgMTsgaSA8IHctPmN1cnJlbnRfbWF0cml4LT5ucm93cyAtIDE7ICsraSkKKyAgICAg ICAgICAgICAgU0VUX01BVFJJWF9ST1dfRU5BQkxFRF9QICh3LT5jdXJyZW50X21hdHJpeCwgaSwg ZmFsc2UpOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorCisgIGN1cnNvcl9t YXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisK KwogICAgICAgLyogVXBkYXRlIHRoZSByZXN0IG9mIHRoZSBsaW5lcy4gICovCiAgICAgICBmb3Ig KDsgcm93IDwgZW5kICYmIChmb3JjZV9wIHx8ICFpbnB1dF9wZW5kaW5nKTsgKytyb3cpCiAJLyog c2Nyb2xsaW5nX3dpbmRvdyByZXNldHMgdGhlIGVuYWJsZWRfcCBmbGFnIG9mIHRoZSByb3dzIGl0 CkBAIC0zNDcxLDYgKzUzNjUsMTkgQEAgdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywg Ym9vbCBmb3JjZV9wKQogCWlmIChyb3ctPmVuYWJsZWRfcCkKIAkgIHsKIAkgICAgaW50IHZwb3Mg PSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgZGVzaXJlZF9tYXRyaXgpOworCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICAgICAgLyogSWYg dGhlIGBjdXJzb3Jfcm93YCBpcyB3aXRoaW4gdGhlIGBkZXNpcmVkX21hdHJpeGAsIHRoZW4gaXQg d2FzCisgICAgICAgICAgcHJvY2Vzc2VkIGhlcmVpbmFib3ZlIGFuZCBzaG91bGQgYmUgc2tpcHBl ZCBhdCB0aGlzIHRpbWUuICovCisgICAgICAgICAgaWYgKHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3Mp CisgICAgICAgICAgY29udGludWU7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkg ICAgaW50IGk7CiAKIAkgICAgLyogV2UnbGwgaGF2ZSB0byBwbGF5IGEgbGl0dGxlIGJpdCB3aXRo IHdoZW4gdG8KQEAgLTM0NzksOCArNTM4NiwyMSBAQCB1cGRhdGVfd2luZG93IChzdHJ1Y3Qgd2lu ZG93ICp3LCBib29sIGZvcmNlX3ApCiAJICAgICAgIGNvbW1hbmRzIHdpbGwgdG9vIHF1aWNrbHkg cGF1c2UgcmVkaXNwbGF5LiAgKi8KIAkgICAgaWYgKCFmb3JjZV9wICYmICsrbl91cGRhdGVkICUg cHJlZW1wdF9jb3VudCA9PSAwKQogCSAgICAgIGRldGVjdF9pbnB1dF9wZW5kaW5nX2lnbm9yZV9z cXVlZXphYmxlcyAoKTsKLQkgICAgY2hhbmdlZF9wIHw9IHVwZGF0ZV93aW5kb3dfbGluZSAodywg dnBvcywKLQkJCQkJICAgICAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wKTsKKworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgICAgIGNo YW5nZWRfcCB8PSAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgICAg ICAmJiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRl bnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgISBOSUxQ IChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKSkpCisgICAgICAgICAg ICAgICAgICAgICAgID8gbWNfdXBkYXRlX3dpbmRvd19saW5lICh3LCB2cG9zLCAmbW91c2VfZmFj ZV9vdmVyd3JpdHRlbl9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgZHJhd19wKQorICAgICAgICAgICAg ICAgICAgICAgICA6IHVwZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywgJm1vdXNlX2ZhY2Vfb3Zl cndyaXR0ZW5fcCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCiAKIAkgICAgLyogTWFy ayBhbGwgcm93cyBiZWxvdyB0aGUgbGFzdCB2aXNpYmxlIG9uZSBpbiB0aGUgY3VycmVudAogCSAg ICAgICBtYXRyaXggYXMgaW52YWxpZC4gIFRoaXMgaXMgbmVjZXNzYXJ5IGJlY2F1c2Ugb2YKQEAg LTM1MDEsNiArNTQyMSw0MSBAQCB1cGRhdGVfd2luZG93IChzdHJ1Y3Qgd2luZG93ICp3LCBib29s IGZvcmNlX3ApCiAKICAgICBzZXRfY3Vyc29yOgogCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8qIElmIHdlIGp1bXBlZCBoZXJlIGZyb20g YHNldF9jdXJzb3JgLCB0aGVuIHNldCB0aGUgYGN1cnNvcl9tYXRyaXhgLiAqLworICBpZiAoY3Vy c29yX21hdHJpeCA9PSBOVUxMKQorICAgIGN1cnNvcl9tYXRyaXggPSB3LT5jdXJyZW50X21hdHJp eDsKKworICAvKiBSZXNldCBgcm93YCB0byAwIHNvIHRoYXQgZmFrZSBjdXJzb3JzIGNhbiBiZSBk cmF3biBvbiByb3dzIHByZWNlZGluZyB0aGUKKyAgZmlyc3QgYHJ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2l0aW9uICh3LCBjdXJyZW50X3JvdywgY3VycmVudF9yb3csIHZwb3MpOwor ICAgICAgaWYgKGN1cnJlbnRfcm93LT5lbmFibGVkX3ApCisgICAgICAgIG1jX2RyYXdfcm93ICh3 LCB3LT5jdXJyZW50X21hdHJpeCwgY3VycmVudF9yb3csIGN1cnJlbnRfcm93LT5nbHlwaHNbVEVY VF9BUkVBXSwKKyAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRfcm93LT54LCBjdXJyZW50X3Jv dy0+dXNlZFtURVhUX0FSRUFdLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21h dHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBkcmF3X3AsIFNFVF9DVVJTT1JfVFdPKTsK KyAgICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIC8qIFVwZGF0ZSB0 aGUgaGVhZGVyIGxpbmUgYWZ0ZXIgc2Nyb2xsaW5nIGJlY2F1c2UgYSBuZXcgaGVhZGVyCiAJIGxp bmUgd291bGQgb3RoZXJ3aXNlIG92ZXJ3cml0ZSBsaW5lcyBhdCB0aGUgdG9wIG9mIHRoZSB3aW5k b3cKIAkgdGhhdCBjYW4gYmUgc2Nyb2xsZWQuICAqLwpAQCAtMzUxNiw3ICs1NDcxLDQ5IEBAIHVw ZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkKICNpZmRlZiBIQVZF X1dJTkRPV19TWVNURU0KIAkgIGlmIChjaGFuZ2VkX3AgJiYgcmlmLT5maXhfb3ZlcmxhcHBpbmdf YXJlYSkKIAkgICAgewotCSAgICAgIHJlZHJhd19vdmVybGFwcGVkX3Jvd3MgKHcsIHliKTsKKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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m93X2FyZWEgYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFy ZWEgPCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgb3V0 cHV0X2N1cnNvcl90byAodywgaSwgMCwgcm93LT55LCBhcmVhID09IFRFWFRfQVJFQSA/IHJvdy0+ eCA6IDApOworICAgICAgICAgICAgICBpZiAoIW1jX3JlZHJhd19yb3cgKHcsIHctPmN1cnJlbnRf bWF0cml4LCByb3csIGFyZWEsIHJvdy0+eCwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICByb3ctPnVzZWRbYXJlYV0sIHRydWUsIERSQVdfTk9STUFMX1RFWFQsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgVVBEQVRFX1dJTkRPV19fUkVEUkFXX09WRVJMQVBQ RURfUk9XUykKKyAgICAgICAgICAgICAgICAgICYmIHJvdy0+dXNlZFthcmVhXSkKKyAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICBGUkFNRV9SSUYgKGYpLT53cml0ZV9nbHlwaHMg KHcsIHJvdywgcm93LT5nbHlwaHNbYXJlYV0sIGFyZWEsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHJvdy0+dXNlZFthcmVhXSk7CisgICAgICAgICAgICAg ICAgICBGUkFNRV9SSUYgKGYpLT5jbGVhcl9lbmRfb2ZfbGluZSAodywgcm93LCBhcmVhLCAtMSk7 CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgIHJvdy0+b3Zlcmxh cHBlZF9wID0gMDsKKyAgICAgICAgfQorICAgICAgaWYgKE1BVFJJWF9ST1dfQk9UVE9NX1kgKHJv dykgPj0geWIpCisgICAgICAgIGJyZWFrOworICAgIH0KKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogCSAgICAgIHJlZHJhd19vdmVybGFwcGluZ19yb3dzICh3LCB5Yik7CiAJICAgIH0K ICNlbmRpZgpAQCAtMzUzNiw4ICs1NTMzLDIwIEBAIHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5k b3cgKncsIGJvb2wgZm9yY2VfcCkKICNlbmRpZgogCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVN CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK KyAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZG RVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgIG1jX3VwZGF0ZV93aW5kb3dfZnJp bmdlcyAodywgMCk7CisgICAgZWxzZQogICAgICAgdXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCAw KTsKIAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgLyogRW5kIHRoZSB1cGRh dGUgb2Ygd2luZG93IFcuICBEb24ndCBzZXQgdGhlIGN1cnNvciBpZiB3ZQogICAgICAgICAgcGF1 c2VkIHVwZGF0aW5nIHRoZSBkaXNwbGF5IGJlY2F1c2UgaW4gdGhpcyBjYXNlLAogICAgICAgICAg c2V0X3dpbmRvd19jdXJzb3JfYWZ0ZXJfdXBkYXRlIGhhc24ndCBiZWVuIGNhbGxlZCwgYW5kCmRp ZmYgLS1naXQgYS9zcmMvZnJhbWUuaCBiL3NyYy9mcmFtZS5oCmluZGV4IGZhNDVhMzIuLjUzYWQx MzEgMTAwNjQ0Ci0tLSBhL3NyYy9mcmFtZS5oCisrKyBiL3NyYy9mcmFtZS5oCkBAIC0yMDUsNiAr MjA1LDE2IEBAIHN0cnVjdCBmcmFtZQogICBMaXNwX09iamVjdCB0b29sX2Jhcl9pdGVtczsKICAg LyogdG9vbF9iYXJfaXRlbXMgc2hvdWxkIGJlIHRoZSBsYXN0IExpc3BfT2JqZWN0IG1lbWJlci4g ICovCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKyAgLyogTm9uLW5pbCB3aGVuIHRoZSBmcmFtZSBpcyBpbiB0aGUgcHJvY2VzcyBvZiBiZWlu ZyB1cGRhdGVkLiAqLworICBzdHJ1Y3QgZnJhbWUgKm1jX3VwZGF0aW5nX2ZyYW1lOworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIENhY2hlIG9mIHJlYWxpemVkIGZhY2VzLiAg Ki8KICAgc3RydWN0IGZhY2VfY2FjaGUgKmZhY2VfY2FjaGU7CiAKZGlmZiAtLWdpdCBhL3NyYy9m cmluZ2UuYyBiL3NyYy9mcmluZ2UuYwppbmRleCBkMGQ1OTkyLi4xMGFhMTAwIDEwMDY0NAotLS0g YS9zcmMvZnJpbmdlLmMKKysrIGIvc3JjL2ZyaW5nZS5jCkBAIC00MzcsNiArNDM3LDQ2MCBAQCBz dGF0aWMgdW5zaWduZWQgc2hvcnQgZW1wdHlfbGluZV9iaXRzW10gPSB7CiAjZGVmaW5lIFNUQU5E QVJEX0JJVE1BUF9IRUlHSFQoYml0cykgKHNpemVvZiAoYml0cykvQllURVNfUEVSX0JJVE1BUF9S T1cpCiAjZGVmaW5lIEZSQklUUyhiaXRzKSAgYml0cywgU1RBTkRBUkRfQklUTUFQX0hFSUdIVCAo Yml0cykKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqK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Hg4MH07 CisKKy8qIDI1CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4u Lnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi54eC4uLnh4 IgorICAgICAgIi4ueHguLnh4IgorICAgICAgIi4uLnh4Lnh4IgorICAgICAgInh4eHh4eHh4Igor ICAgICAgInh4eHh4eHh4IgorICAgICAgIi4uLnh4Lnh4IgorICAgICAgIi4ueHguLnh4IgorICAg ICAgIi54eC4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAg Ii4uLi4uLnh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcmV2ZXJzZWRfdmVydGlj YWxfYmFyX3JpZ2h0X2Fycm93X2JpdHNbXSA9eworICAweDMsIDB4MywgMHgzLCAweDYzLCAweDMz LCAweDFiLCAweGZmLCAweGZmLCAweDFiLCAweDMzLCAweDYzLCAweDMsIDB4MywgMHgzfTsKKwor LyogMjYKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHh4eHh4eHgi CisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4ueHguLngiCisg ICAgICAieC4uLnh4LngiCisgICAgICAieC4uLi54eHgiCisgICAgICAieC54eHh4eHgiCisgICAg ICAieC54eHh4eHgiCisgICAgICAieC4uLi54eHgiCisgICAgICAieC4uLnh4LngiCisgICAgICAi eC4ueHguLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieHh4 eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19ob2xsb3dfcmVjdGFuZ2xlX3Jp Z2h0X2Fycm93X2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweDk5LCAweDhkLCAweDg3 LCAweGJmLAorICAweGJmLCAweDg3LCAweDhkLCAweDk5LCAweDgxLCAweDgxLCAweGZmfTsKKwor LyogMjcKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHh4eHh4eHgi CisgICAgICAieC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieC54eC4ueHgiCisg ICAgICAieC4ueHgueHgiCisgICAgICAieC4uLnh4eHgiCisgICAgICAieHh4eHh4eHgiCisgICAg ICAieHh4eHh4eHgiCisgICAgICAieC4uLnh4eHgiCisgICAgICAieC4ueHgueHgiCisgICAgICAi eC54eC4ueHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieHh4 eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19yZXZlcnNlZF9ob2xsb3dfcmVj dGFuZ2xlX3JpZ2h0X2Fycm93X2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweGIxLCAw eDk5LCAweDhkLCAweGZmLAorICAweGZmLCAweDhkLCAweDk5LCAweGIxLCAweDgxLCAweDgxLCAw eGZmfTsKKworLyogMjgKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAi eHh4eHh4eHgiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4u Li4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4u LngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngi CisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisg ICAgICAieHh4eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19ob2xsb3dfcmVj dGFuZ2xlX2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAw eDgxLAorICAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweGZmfTsKKworLyog MjkKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC4uLi4uLi4iCisg ICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAg ICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAi eC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4u Li4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4u Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY192ZXJ0aWNhbF9iYXJfYml0c1tdID17 CisgIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsCisgIDB4ODAsIDB4 ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODB9OworCisvKiAzMAorICAgICgrLWZyaW5n ZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIK KyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAg ICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAg ICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIu Li4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIpCisqLworc3RhdGlj IHVuc2lnbmVkIHNob3J0IG1jX3JldmVyc2VkX3ZlcnRpY2FsX2Jhcl9iaXRzW10gPXsKKyAgMHgz LCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4Mywg MHgzLCAweDN9OworCisvKiAzMQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAg ICAgICJ4eC4uLi4uLiIKKyAgICAgICJ4eC4uLi4uLiIKKyAgICAgICIgeHguLi4uLiIKKyAgICAg ICIueHguLi4uLiIKKyAgICAgICIuLnh4Li4uLiIKKyAgICAgICIuLnh4Li4uLiIKKyAgICAgICIu Li54eC4uLiIKKyAgICAgICIuLi54eC4uLiIKKyAgICAgICIuLi4ueHguLiIKKyAgICAgICIuLi4u eHguLiIKKyAgICAgICIuLi4uLnh4LiIKKyAgICAgICIuLi4uLnh4LiIKKyAgICAgICIuLi4uLi54 eCIKKyAgICAgICIuLi4uLi54eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX2JhY2tz bGFzaF9iaXRzW10gPXsKKyAgMHhjMCwgMHhjMCwgMHhlMCwgMHg2MCwgMHgzMCwgMHgzMCwgMHgx OCwgMHgxOCwgMHhjLCAweGMsIDB4NiwgMHg2LCAweDMsIDB4M307CisKKy8qIDMyCisgICAgKCst ZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Li4uLi4uIgorICAgICAgInh4Li4u Li4uIgorICAgICAgInh4eC4uLi4uIgorICAgICAgInh4eC4uLi4uIgorICAgICAgIngueHguLi4u IgorICAgICAgIngueHguLi4uIgorICAgICAgInguLnh4Li4uIgorICAgICAgInguLnh4Li4uIgor ICAgICAgInguLi54eC4uIgorICAgICAgInguLi54eC4uIgorICAgICAgInguLi4ueHguIgorICAg ICAgInguLi4ueHguIgorICAgICAgInguLi4uLnh4IgorICAgICAgInguLi4uLnh4IikKKyovCitz dGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdmVydGljYWxfYmFyX2JhY2tzbGFzaF9iaXRzW10gPXsK KyAgMHhjMCwgMHhjMCwgMHhlMCwgMHhlMCwgMHhiMCwgMHhiMCwgMHg5OCwKKyAgMHg5OCwgMHg4 YywgMHg4YywgMHg4NiwgMHg4NiwgMHg4MywgMHg4M307CisKKy8qIDMzCisgICAgKCstZnJpbmdl LWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi54eHh4eHguIgorICAgICAgInh4eHgueC4uIgor ICAgICAgInh4eHgueC4uIgorICAgICAgInh4eHgueC4uIgorICAgICAgIi54eHgueC4uIgorICAg ICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAg Ii4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIikKKyovCitzdGF0 aWMgdW5zaWduZWQgc2hvcnQgbWNfcGlsY3Jvd19iaXRzW10gPXsKKyAgMHg3ZSwgMHhmNCwgMHhm NCwgMHhmNCwgMHg3NCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNH07CisKKy8q IDM0CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4ueHh4eC4uIgor ICAgICAgIi54eHh4eHguIgorICAgICAgInguLnh4Li54IgorICAgICAgInguLnh4Li54IgorICAg ICAgInh4eHh4eHh4IgorICAgICAgInh4Li4uLnh4IgorICAgICAgInh4eC4ueHh4IgorICAgICAg Ii54eHh4eHguIgorICAgICAgIi4ueHh4eC4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQg bWNfc21pbGV5X2ZhY2VfYml0c1tdID17CisgIDB4M2MsIDB4N2UsIDB4OTksIDB4OTksIDB4ZmYs IDB4YzMsIDB4ZTcsIDB4N2UsIDB4M2N9OworCisvKiAzNQorICAgICgrLWZyaW5nZS1oZWxwZXIt aGV4YWRlY2ltYWwKKyAgICAgICIuLnguLi4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIu Li4ueC4uLiIKKyAgICAgICIuLi4uLnguLiIKKyAgICAgICIuLi4ueC4uLiIKKyAgICAgICIuLi54 Li4uLiIKKyAgICAgICIuLnguLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3Np bmdsZV9hbmdsZV9yaWdodF9iaXRzW10gPXsKKyAgMHgyMCwgMHgxMCwgMHg4LCAweDQsIDB4OCwg MHgxMCwgMHgyMH07CisKKy8qIDM2CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAor ICAgICAgIi4uLi4ueC4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4uLnguLi4uIgorICAg ICAgIi4ueC4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAg Ii4uLi4ueC4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX2xl ZnRfYml0c1tdID17CisgIDB4NCwgMHg4LCAweDEwLCAweDIwLCAweDEwLCAweDgsIDB4NH07CisK Ky8qIDM3CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Lnh4Li4u IgorICAgICAgIi54eC54eC4uIgorICAgICAgIi4ueHgueHguIgorICAgICAgIi4uLnh4Lnh4Igor ICAgICAgIi4ueHgueHguIgorICAgICAgIi54eC54eC4uIgorICAgICAgInh4Lnh4Li4uIikKKyov CitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xlX3JpZ2h0X2JpdHNbXSA9ewor ICAweGQ4LCAweDZjLCAweDM2LCAweDFiLCAweDM2LCAweDZjLCAweGQ4fTsKKworLyogMzgKKyAg ICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4ueHgueHgiCisgICAgICAi Li54eC54eC4iCisgICAgICAiLnh4Lnh4Li4iCisgICAgICAieHgueHguLi4iCisgICAgICAiLnh4 Lnh4Li4iCisgICAgICAiLi54eC54eC4iCisgICAgICAiLi4ueHgueHgiKQorKi8KK3N0YXRpYyB1 bnNpZ25lZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfbGVmdF9iaXRzW10gPXsKKyAgMHgxYiwgMHgz NiwgMHg2YywgMHhkOCwgMHg2YywgMHgzNiwgMHgxYn07CisKKy8qIDM5CisgICAgKCstZnJpbmdl LWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIngueC54Li4uIgorICAgICAgIi54LngueC4uIgor ICAgICAgIi4ueC54LnguIgorICAgICAgIi4uLngueC54IgorICAgICAgIi4ueC54LnguIgorICAg ICAgIi54LngueC4uIgorICAgICAgIngueC54Li4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hv cnQgbWNfdHJpcGxlX2FuZ2xlX3JpZ2h0X2JpdHNbXSA9eworICAweGE4LCAweDU0LCAweDJhLCAw eDE1LCAweDJhLCAweDU0LCAweGE4fTsKKworLyogNDAKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhl eGFkZWNpbWFsCisgICAgICAiLi4ueC54LngiCisgICAgICAiLi54LngueC4iCisgICAgICAiLngu eC54Li4iCisgICAgICAieC54LnguLi4iCisgICAgICAiLngueC54Li4iCisgICAgICAiLi54Lngu eC4iCisgICAgICAiLi4ueC54LngiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190cmlw bGVfYW5nbGVfbGVmdF9iaXRzW10gPXsKKyAgMHgxNSwgMHgyYSwgMHg1NCwgMHhhOCwgMHg1NCwg MHgyYSwgMHgxNX07CisKKy8qIDQxCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAor ICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAg ICAgIi4uLi4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAg Ii54Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4u Li4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIikKKyovCitzdGF0aWMg dW5zaWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDAwLCAweDAw LCAweDAwLCAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDgyLCAweDAwLCAweDAwLCAweDAwLCAw eDAwfTsKKworLyogNDIKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAi Li4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4u Li4uLi4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54Lngu Li4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4i CisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25l ZCBzaG9ydCBtY19zaW5nbGVfYW5nbGVfZG93bl9iaXRzW10gPXsKKyAgMHgwMCwgMHgwMCwgMHgw MCwgMHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHgxMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMH07 CisKKy8qIDQzCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4u Li4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLnguLi4u IgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgor ICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAg ICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIikKKyovCitz dGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDAw LCAweDAwLCAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDgyLCAw eDAwLCAweDAwLCAweDAwfTsKKworLyogNDQKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNp bWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4i CisgICAgICAieC4uLi4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisg ICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAg ICAiLi4ueC4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAi Li4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfZG93 bl9iaXRzW10gPXsKKyAgMHgwMCwgMHgwMCwgMHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHg5Miwg MHg0NCwgMHgyOCwgMHgxMCwgMHgwMCwgMHgwMCwgMHgwMH07CisKKy8qIDQ1CisgICAgKCstZnJp bmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLnguLi4u IgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgor ICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAg ICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAgICAg Ii4uLi4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdHJpcGxlX2FuZ2xlX3Vw X2JpdHNbXSA9eworICAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAw eDkyLCAweDI4LCAweDQ0LCAweDgyLCAweDAwfTsKKworLyogNDYKKyAgICAoKy1mcmluZ2UtaGVs cGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAieC4uLi4ueC4iCisgICAg ICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAi LnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLngu Li54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLi4u Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19xdWFkcnVwbGVfYW5nbGVfZG93bl9i aXRzW10gPXsKKyAgMHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHg5 MiwgMHg0NCwgMHgyOCwgMHgxMCwgMHgwMH07CisKKy8qIDQ3CisgICAgKCstZnJpbmdlLWhlbHBl ci1oZXhhZGVjaW1hbAorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAg Ii54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54 Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4u eC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4u IgorICAgICAgInguLi4uLnguIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcXVhZHJ1 cGxlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAw eDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDgyfTsKKworLyogNDgK KyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC4uLi4ueC4iCisgICAg ICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAi LnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLngu Li54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54 Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLi4ueC4uLi4iKQorKi8KK3N0YXRpYyB1bnNp Z25lZCBzaG9ydCBtY190cmlwbGVfYW5nbGVfZG93bl9iaXRzW10gPXsKKyAgMHg4MiwgMHg0NCwg MHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgy OCwgMHgxMH07CisKIC8qIE5PVEU6ICBUaGUgb3JkZXIgb2YgdGhlc2UgYml0bWFwcyBtdXN0IG1h dGNoIHRoZSBzZXF1ZW5jZQogICAgdXNlZCBpbiBmcmluZ2UuZWwgdG8gZGVmaW5lIHRoZSBjb3Jy ZXNwb25kaW5nIHN5bWJvbHMuICAqLwogCkBAIC00NjYsOCArOTIwLDEwNzIgQEAgc3RhdGljIHN0 cnVjdCBmcmluZ2VfYml0bWFwIHN0YW5kYXJkX2JpdG1hcHNbXSA9CiAgIHsgRlJCSVRTICh2ZXJ0 aWNhbF9iYXJfYml0cyksICAgICAgIDgsIDAsIEFMSUdOX0JJVE1BUF9DRU5URVIsIDAgfSwKICAg eyBGUkJJVFMgKGhvcml6b250YWxfYmFyX2JpdHMpLCAgICAgOCwgMCwgQUxJR05fQklUTUFQX0JP VFRPTSwgMCB9LAogICB7IEZSQklUUyAoZW1wdHlfbGluZV9iaXRzKSwgICAgICAgICA4LCAzLCBB TElHTl9CSVRNQVBfVE9QLCAgICAwIH0sCisKKyAgLy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QIChjbWFwKSkKKyAgICB7CisgICAgICBibTEgPSBtY19hc3Nx IChiaXRtYXAsIGNtYXApOworICAgICAgaWYgKENPTlNQIChibTEpKQorICB7CisgICAgaWYgKChi bTEgPSBYQ0RSIChibTEpKSwgTklMUCAoYm0xKSkKKyAgICAgIHJldHVybiBNQ19OT19GUklOR0Vf QklUTUFQOworICAgIGlmIChDT05TUCAoYm0xKSkKKyAgICAgIHsKKyAgICAgICAgbG4xID0gWEZJ WE5VTSAoRmxlbmd0aCAoYm0xKSk7CisgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgICAgICAg eworICAgICAgICAgICAgaWYgKGxuMSA+IGl4MikKKyAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMSk7CisgICAgICAgICAgICAgICAgaWYgKCFFUSAo Ym0sIFF0KSkKKyAgICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICAgIH0K KyAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAg ICBpZiAobG4xID4gaXgxKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGJt ID0gbWNfbnRoIChpeDEsIGJtMSk7CisgICAgICAgICAgICAgICAgICBpZiAoIUVRIChibSwgUXQp KQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5kOworICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgIH0KKyAgICAgIH0KKyAgICBlbHNlIGlmICgoYm0gPSBibTEsICFFUSAoYm0sIFF0 KSkpCisgICAgICBnb3RvIGZvdW5kOworICB9CisgICAgfQorICBpZiAoIUVRIChjbWFwLCBCVkFS ICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkKKyAgICAgICYmICFO SUxQIChCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkpCisg ICAgeworICAgICAgYm0yID0gbWNfYXNzcSAoYml0bWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRz LCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSk7CisgICAgICBpZiAoQ09OU1AgKGJtMikpCisgICAg ICAgIHsKKyAgICAgICAgICBpZiAoKGJtMiA9IFhDRFIgKGJtMikpLCAhTklMUCAoYm0yKSkKKyAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKENPTlNQIChibTIpKQorICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgIGxuMiA9IFhGSVhOVU0gKEZsZW5ndGggKGJtMikpOwor ICAgICAgICAgICAgICAgICAgaWYgKHBhcnRpYWxfcCkKKyAgICAgICAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgICAgICAgIGlmIChsbjIgPiBpeDIpCisgICAgICAgICAgICAgICAgICAg ICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMik7 CisgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0K KyAgICAgICAgfQorICAgIH0KKyAgaWYgKGxuMSA+IGl4MSkKKyAgICB7CisgICAgICBibSA9IG1j X250aCAoaXgxLCBibTEpOworICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAgZ290byBm b3VuZDsKKyAgICB9CisgIGlmIChsbjIgPiBpeDEpCisgICAgeworICAgICAgYm0gPSBtY19udGgg KGl4MSwgYm0yKTsKKyAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgIGdvdG8gZm91bmQ7 CisgICAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICB9CisgICAgZWxzZSBpZiAo KGJtID0gYm0yLCBOSUxQIChibSkpKQorICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7 CisgIGZvdW5kOgorICByZXR1cm4gbG9va3VwX2ZyaW5nZV9iaXRtYXAgKGJtKTsKK30KKworc3Rh dGljIGludAorbWNfZ2V0X2xvZ2ljYWxfY3Vyc29yX2JpdG1hcCAoc3RydWN0IHdpbmRvdyAqdywg TGlzcF9PYmplY3QgY3Vyc29yKQoreworICBMaXNwX09iamVjdCBjbWFwLCBibSA9IFFuaWw7Cisg IGlmICgoY21hcCA9IEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZnJpbmdlX2N1cnNvcl9h bGlzdCkpLCAhTklMUCAoY21hcCkpCisgICAgeworICAgICAgYm0gPSBtY19hc3NxIChjdXJzb3Is IGNtYXApOworICAgICAgaWYgKENPTlNQIChibSkpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAo KGJtID0gWENEUiAoYm0pKSwgTklMUCAoYm0pKQorICAgICAgICAgICAgcmV0dXJuIE1DX05PX0ZS SU5HRV9CSVRNQVA7CisgICAgICAgICAgcmV0dXJuIGxvb2t1cF9mcmluZ2VfYml0bWFwIChibSk7 CisgICAgICAgIH0KKyAgICB9CisgIGlmIChFUSAoY21hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0 cywgZnJpbmdlX2N1cnNvcl9hbGlzdCkpKQorICAgIHJldHVybiBNQ19OT19GUklOR0VfQklUTUFQ OworICBibSA9IG1jX2Fzc3EgKGN1cnNvciwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdl X2N1cnNvcl9hbGlzdCkpOworICBpZiAoIUNPTlNQIChibSkgfHwgKChibSA9IFhDRFIgKGJtKSks IE5JTFAgKGJtKSkpCisgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgIHJldHVybiBs b29rdXBfZnJpbmdl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OSUxQIChjbWFwKSkKKyAgICB7CisgICAg ICBibTEgPSBtY19hc3NxIChiaXRtYXAsIGNtYXApOworICAgICAgaWYgKENPTlNQIChibTEpKQor ICAgICAgICB7CisgICAgICAgICAgaWYgKChibTEgPSBYQ0RSIChibTEpKSwgTklMUCAoYm0xKSkK KyAgICAgICAgICAgIHJldHVybiBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgIGlmIChD T05TUCAoYm0xKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbG4xID0gWEZJWE5VTSAo Rmxlbmd0aCAoYm0xKSk7CisgICAgICAgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgaWYgKGxuMSA+IGl4MikKKyAgICAgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMSk7Cisg ICAgICAgICAgICAgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAgICAgICAgICAg ICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAg ICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgICBpZiAobG4xID4gaXgxKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgICAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMSk7CisgICAgICAgICAgICAg ICAgICAgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICBn b3RvIGZvdW5kOworICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKChibSA9IGJtMSwgIUVRIChibSwg UXQpKSkKKyAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgfQorICAgIH0KKyAgaWYg KCFFUSAoY21hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRvcl9hbGlz dCkpCisgICAgICAmJiAhTklMUCAoQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGlj YXRvcl9hbGlzdCkpKQorICAgIHsKKyAgICAgIGJtMiA9IG1jX2Fzc3EgKGJpdG1hcCwgQlZBUiAo JmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpOworICAgICAgaWYgKENP TlNQIChibTIpKQorICAgICAgICB7CisgICAgICAgICAgaWYgKChibTIgPSBYQ0RSIChibTIpKSwg IU5JTFAgKGJtMikpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmIChDT05TUCAoYm0y KSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBsbjIgPSBYRklYTlVNIChG bGVuZ3RoIChibTIpKTsKKyAgICAgICAgICAgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgICAg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBpZiAobG4yID4gaXgyKQorICAg ICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICBibSA9IG1j X250aCAoaXgyLCBibTIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIUVRIChibSwg UXQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAg ICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIGlmIChsbjEgPiBpeDEpCisgICAg eworICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0xKTsKKyAgICAgIGlmICghRVEgKGJtLCBRdCkp CisgICAgICAgIGdvdG8gZm91bmQ7CisgICAgfQorICBpZiAobG4yID4gaXgxKQorICAgIHsKKyAg ICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMik7CisgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAg ICAgICBnb3RvIGZvdW5kOworICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAg fQorICAgIGVsc2UgaWYgKChibSA9IGJtMiwgTklMUCAoYm0pKSkKKyAgICAgIHJldHVybiBNQ19O T19GUklOR0VfQklUTUFQOworICBmb3VuZDoKKyAgcmV0dXJuIGxvb2t1cF9mcmluZ2VfYml0bWFw IChibSk7Cit9CisKKy8qIFJlY2FsY3VsYXRlIHRoZSBiaXRtYXBzIHRvIHNob3cgaW4gdGhlIGZy aW5nZXMgb2Ygd2luZG93IFcuCisgICBPbmx5IG1hcmsgcm93cyB3aXRoIG1vZGlmaWVkIGJpdG1h cHMgZm9yIHVwZGF0ZSBpbiByZWRyYXdfZnJpbmdlX2JpdG1hcHNfcC4KKyAgIElmIEtFRVBfQ1VS UkVOVF9QIGlzIDAsIHVwZGF0ZSBjdXJyZW50X21hdHJpeCB0b28uICovCitib29sCittY191cGRh dGVfd2luZG93X2ZyaW5nZXMgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wga2VlcF9jdXJyZW50X3Ap Cit7CisgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgKmN1ciA9IDA7CisgIGludCB5YiA9IHdpbmRv d190ZXh0X2JvdHRvbV95ICh3KTsKKyAgaW50IHJuLCBucm93cyA9IHctPmN1cnJlbnRfbWF0cml4 LT5ucm93czsKKyAgaW50IHk7CisgIGJvb2wgcmVkcmF3X3AgPSAwOworICBMaXNwX09iamVjdCBi b3VuZGFyeV90b3AgPSBRbmlsLCBib3VuZGFyeV9ib3QgPSBRbmlsOworICBMaXNwX09iamVjdCBh cnJvd190b3AgPSBRbmlsLCBhcnJvd19ib3QgPSBRbmlsOworICBMaXNwX09iamVjdCBlbXB0eV9w b3M7C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UCAoWENBUiAoaW5kKSkpCisgICAgICAg IHsKKyAgICAgICAgICBMaXNwX09iamVjdCBwb3M7CisgICAgICAgICAgaWYgKHBvcyA9IG1jX2Fz c3EgKFF0LCBpbmQpLCAhTklMUCAocG9zKSkKKyAgICAgICAgICAgIGJvdW5kYXJ5X3RvcCA9IGJv dW5kYXJ5X2JvdCA9IGFycm93X3RvcCA9IGFycm93X2JvdCA9IFhDRFIgKHBvcyk7CisgICAgICAg ICAgaWYgKHBvcyA9IG1jX2Fzc3EgKFF0b3AsIGluZCksICFOSUxQIChwb3MpKQorICAgICAgICAg ICAgYm91bmRhcnlfdG9wID0gWENEUiAocG9zKTsKKyAgICAgICAgICBpZiAocG9zID0gbWNfYXNz cSAoUWJvdHRvbSwgaW5kKSwgIU5JTFAgKHBvcykpCisgICAgICAgICAgICBib3VuZGFyeV9ib3Qg PSBYQ0RSIChwb3MpOworICAgICAgICAgIGlmIChwb3MgPSBtY19hc3NxIChRdXAsIGluZCksICFO SUxQIChwb3MpKQorICAgICAgICAgICAgYXJyb3dfdG9wID0gWENEUiAocG9zKTsKKyAgICAgICAg ICBpZiAocG9zID0gbWNfYXNzcSAoUWRvd24sIGluZCksICFOSUxQIChwb3MpKQorICAgICAgICAg ICAgYXJyb3dfYm90ID0gWENEUiAocG9zKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAg ICAgICAgLyogQW55dGhpbmcgZWxzZSBtZWFucyBib3VuZGFyeSBvbiBsZWZ0IGFuZCBubyBhcnJv d3MuICAqLworICAgICAgICAgIGJvdW5kYXJ5X3RvcCA9IGJvdW5kYXJ5X2JvdCA9IFFsZWZ0Owor ICAgIH0KKyAgdG9wX2luZF9ybiA9IGJvdF9pbmRfcm4gPSAtMTsKKyAgaWYgKCFOSUxQIChpbmQp KQorICAgIHsKKyAgICAgIGZvciAoeSA9IHctPnZzY3JvbGwsIHJuID0gMDsKKyAgICAgICAgICAg eSA8IHliICYmIHJuIDwgbnJvd3M7CisgICAgICAgICAgIHkgKz0gcm93LT5oZWlnaHQsICsrcm4p CisgICAgICAgIHsKKyAgICAgICAgICByb3cgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHJu OworICAgICAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgICAgICAgICByb3cgPSB3LT5j dXJyZW50X21hdHJpeC0+cm93cyArIHJuOworICAgICAgICAgIHJvdy0+aW5kaWNhdGVfYm9iX3Ag PSByb3ctPmluZGljYXRlX3RvcF9saW5lX3AgPSAwOworICAgICAgICAgIHJvdy0+aW5kaWNhdGVf ZW9iX3AgPSByb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3AgPSAwOworICAgICAgICAgIGlmICgh cm93LT5tb2RlX2xpbmVfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKHRvcF9p bmRfcm4gPCAwICYmIHJvdy0+dmlzaWJsZV9oZWlnaHQgPiAwKQorICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgIGlmIChNQVRSSVhfUk9XX1NUQVJUX0NIQVJQT1MgKHJvdykgPD0g QlVGX0JFR1YgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSkKKyAgICAgICAgICAgICAgICAgICAgICAm JiAhTUFUUklYX1JPV19QQVJUSUFMTFlfVklTSUJMRV9BVF9UT1BfUCAodywgcm93KSkKKyAgICAg ICAgICAgICAgICAgICAgcm93LT5pbmRpY2F0ZV9ib2JfcCA9ICFOSUxQIChib3VuZGFyeV90b3Ap OworICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgcm93LT5p bmRpY2F0ZV90b3BfbGluZV9wID0gIU5JTFAgKGFycm93X3RvcCk7CisgICAgICAgICAgICAgICAg ICB0b3BfaW5kX3JuID0gcm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBpZiAo Ym90X2luZF9ybiA8IDApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgaWYg KE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgPj0gQlVGX1pWIChYQlVGRkVSICh3LT5jb250 ZW50cykpCisgICAgICAgICAgICAgICAgICAgICAgJiYgIU1BVFJJWF9ST1dfUEFSVElBTExZX1ZJ U0lCTEVfQVRfQk9UVE9NX1AgKHcsIHJvdykpCisgICAgICAgICAgICAgICAgICAgIHJvdy0+aW5k aWNhdGVfZW9iX3AgPSAhTklMUCAoYm91bmRhcnlfYm90KSwgYm90X2luZF9ybiA9IHJuOworICAg ICAgICAgICAgICAgICAgICBlbHNlIGlmICh5ICsgcm93LT5oZWlnaHQgPj0geWIpCisgICAgICAg ICAgICAgICAgICAgICAgcm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wID0gIU5JTFAgKGFycm93 X2JvdCksIGJvdF9pbmRfcm4gPSBybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9 CisgICAgICAgIH0KKyAgICB9CisgIGVtcHR5X3BvcyA9IEJWQVIgKFhCVUZGRVIgKHctPmNvbnRl bnRzKSwgaW5kaWNhdGVfZW1wdHlfbGluZXMpOworICBpZiAoIU5JTFAgKGVtcHR5X3BvcykgJiYg IUVRIChlbXB0eV9wb3MsIFFyaWdodCkpCisgICAgZW1wdHlfcG9zID0gV0lORE9XX0xFRlRfRlJJ TkdFX1dJRFRIICh3KSA9PSAwID8gUXJpZ2h0IDogUWxlZnQ7CisgIGZvciAoeSA9IDA7IHkgPCBN QVhfQklUTUFQX0NBQ0hFOyB5KyspCisgICAgYml0bWFwX2NhY2hlW3ldID0gLTE7CisjZGVmaW5l IE1DX0xFRlRfRlJJTkdFKGNhY2hlLCB3aGljaCwgcGFydGlhbF9wKQkJCVwKKyAgKGJpdG1hcF9j YWNoZVtjYWNoZSo0K3BhcnRpYWxfcF0gPj0gMAkJCQlcCisgICA/IGJpdG1hcF9jYWNoZVtjYWNo ZSo0K3BhcnRpYWxfcF0JCQkJXAorICAgOiAoYml0bWFwX2NhY2hlW2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EgKGJvdW5kYXJ5X3RvcCwgUWxlZnQpKQorICAgICAgICAgICAgYm4gPSAoKHJv dy0+aW5kaWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5kYXJ5X2JvdCwgUWxlZnQpKQorICAgICAgICAg ICAgICAgICAgPyBNQ19MRUZUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20sIHJvdy0+ZW5kc19hdF96 dl9wKQorICAgICAgICAgICAgICAgICAgOiBNQ19MRUZUX0ZSSU5HRSAoMiwgUXRvcCwgMCkpOwor ICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBibiA9ICgocm93LT5pbmRpY2F0ZV9lb2Jf cCAmJiBFUSAoYm91bmRhcnlfYm90LCBRcmlnaHQpKQorICAgICAgICAgICAgICAgICAgICA/IE1D X1JJR0hUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKQorICAgICAg ICAgICAgICAgICAgICA6IE1DX1JJR0hUX0ZSSU5HRSAoMiwgUXRvcCwgMCkpOworICAgICAgICB9 CisgICAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcCkKKyAgICAgICAgICB7 CisgICAgICAgICAgICBpZiAoRVEgKGFycm93X3RvcCwgUWxlZnQpKQorICAgICAgICAgICAgICBi biA9IE1DX0xFRlRfRlJJTkdFICg2LCBRdXAsIDApOworICAgICAgICAgICAgICBlbHNlCisgICAg ICAgICAgICAgICAgYm4gPSBNQ19SSUdIVF9GUklOR0UgKDYsIFF1cCwgMCk7CisgICAgICAgICAg fQorICAgICAgaWYgKGJuICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgIHsKKyAgICAg ICAgICBzdHJ1Y3QgZnJpbmdlX2JpdG1hcCAqZmIgPSBnZXRfZnJpbmdlX2JpdG1hcF9kYXRhIChi bik7CisgICAgICAgICAgaWYgKGZiLT5hbGlnbiA9PSBBTElHTl9CSVRNQVBfVE9QICYmIGZiLT5w ZXJpb2QgPT0gMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3Jv dyAqcm93MTsKKyAgICAgICAgICAgICAgaW50IHRvcF9pbmRfbWF4X3k7CisgICAgICAgICAgICAg IHRvcF9pbmRfbWluX3kgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgICAgICAg ICAgICAgdG9wX2luZF9tYXhfeSA9IHRvcF9pbmRfbWluX3kgKyBmYi0+aGVpZ2h0OworICAgICAg ICAgICAgICBpZiAodG9wX2luZF9tYXhfeSA+IHliKQorICAgICAgICAgICAgICAgIHRvcF9pbmRf bWF4X3kgPSB5YjsKKyAgICAgICAgICAgICAgZm9yICh5ID0gcm93LT55ICsgcm93LT5oZWlnaHQs IHJuID0gdG9wX2luZF9ybiArIDE7CisgICAgICAgICAgICAgICAgICAgeSA8IHRvcF9pbmRfbWF4 X3kgJiYgcm4gPCBucm93czsKKyAgICAgICAgICAgICAgICAgICB5ICs9IHJvdzEtPmhlaWdodCwg cm4rKykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBpZiAoYm90X2luZF9y biA+PSAwICYmIHJuID49IGJvdF9pbmRfcm4pCisgICAgICAgICAgICAgICAgICAgIGJyZWFrOwor ICAgICAgICAgICAgICAgICAgcm93MSA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgcm47Cisg ICAgICAgICAgICAgICAgICBpZiAoIXJvdzEtPmVuYWJsZWRfcCkKKyAgICAgICAgICAgICAgICAg ICAgcm93MSA9IHctPmN1cnJlbnRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgICAgICAg ICByb3cxLT5pbmRpY2F0ZV9ib2JfcCA9IHJvdy0+aW5kaWNhdGVfYm9iX3A7CisgICAgICAgICAg ICAgICAgICByb3cxLT5pbmRpY2F0ZV90b3BfbGluZV9wID0gcm93LT5pbmRpY2F0ZV90b3BfbGlu ZV9wOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0K KyAgaWYgKGJvdF9pbmRfcm4gPj0gMCkKKyAgICB7CisgICAgICBpbnQgYm4gPSBNQ19OT19GUklO R0VfQklUTUFQOworICAgICAgcm93ID0gdy0+ZGVzaXJlZF9tYXRyaXgtPnJvd3MgKyBib3RfaW5k X3JuOworICAgICAgaWYgKCFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgcm93ID0gdy0+Y3VycmVu dF9tYXRyaXgtPnJvd3MgKyBib3RfaW5kX3JuOworICAgICAgYm90X3Jvd19lbmRzX2F0X3p2X3Ag PSByb3ctPmVuZHNfYXRfenZfcDsKKyAgICAgIGlmIChyb3ctPmluZGljYXRlX2VvYl9wKQorICAg ICAgICB7CisgICAgICAgICAgaWYgKEVRIChib3VuZGFyeV9ib3QsIFFsZWZ0KSkKKyAgICAgICAg ICAgIGJuID0gTUNfTEVGVF9GUklOR0UgKDMsIFFib3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKTsK KyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgYm4gPSBNQ19SSUdIVF9GUklOR0UgKDMs IFFib3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlm IChyb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3ApCisgICAgICAgICAgeworICAgICAgICAgICAg aWYgKEVRIChhcnJvd19ib3QsIFFsZWZ0KSkKKyAgICAgICAgICAgICAgYm4gPSBNQ19MRUZUX0ZS SU5HRSAoNywgUWRvd24sIDApOworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAg Ym4gPSBNQ19SSUdIVF9GUklOR0UgKDcsIFFkb3duLCAwKTsKKyAgICAgICAgICB9CisgICAgICBp ZiAoYm4gIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVj dCBmcmluZ2VfYml0bWFwICpmYiA9IGdldF9mcmluZ2VfYml0bWFwX2RhdGEgKGJuKTsKKyAgICAg ICAgICBpZiAoZmItPmFsaWduID09IEFMSUdOX0JJVE1BUF9CT1RUT00gJiYgZmItPnBlcmlvZCA9 PSAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cx OworICAgICAgICAgICAgICBpbnQgYm90X2luZF9taW5feTsKKyAgICAgICAgICAgICAgYm90X2lu ZF9tYXhfeSA9IHJvdy0+eSArIHJvdy0+dmlzaWJsZV9oZWlnaHQ7CisgICAgICAgICAgICAgIGJv dF9pbmRfbWluX3kgPSBib3RfaW5kX21heF95IC0gZmItPmhlaWdodDsKKyAgICAgICAgICAgICAg aWYgKGJvdF9pbmRfbWluX3kgPCBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KSkKKyAgICAg ICAgICAgICAgICBib3RfaW5kX21pbl95ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7 CisgICAgICAgICAgICAgIGZvciAoeSA9IHJvdy0+eSwgcm4gPSBib3RfaW5kX3JuIC0gMTsKKyAg ICAgICAgICAgICAgICAgICB5ID49IGJvdF9pbmRfbWluX3kgJiYgcm4gPj0gMDsKKyAgICAgICAg ICAgICAgICAgICB5IC09IHJvdzEtPmhlaWdodCwgcm4tLSkKKyAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgICBpZiAodG9wX2luZF9ybiA+PSAwICYmIHJuIDw9IHRvcF9pbmRfcm4p CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgcm93MSA9IHct PmRlc2lyZWRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgICAgICAgICBpZiAoIXJvdzEt PmVuYWJsZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgcm93MSA9IHctPmN1cnJlbnRfbWF0cml4 LT5yb3dzICsgcm47CisgICAgICAgICAgICAgICAgICByb3cxLT5pbmRpY2F0ZV9lb2JfcCA9IHJv dy0+aW5kaWNhdGVfZW9iX3A7CisgICAgICAgICAgICAgICAgICByb3cxLT5pbmRpY2F0ZV9ib3R0 b21fbGluZV9wID0gcm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wOworICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgYm9vbCBhdXRvX2hzY3JvbGxf bW9kZV9wID0gRVEgKEZidWZmZXJfbG9jYWxfdmFsdWUgKFFhdXRvX2hzY3JvbGxfbW9kZSwgdy0+ Y29udGVudHMpLCBRY3VycmVudF9saW5lKTsKKyAgLyogRVhBTVBMRTogIChzY3JvbGwtbGVmdCA1 KSAqLworICBib29sIGhzY2xfYWxsX3RlbXBfcCA9ICh3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAor ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IDApOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8 IGFuZCBkbyBub3RoaW5nLiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMF9wID0gKHctPnN1c3Bl bmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Ny b2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAw CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gdy0+aHNjcm9sbCk7 CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIHNvbWV0aGluZyBlbHNlIGJlc2lkZXMg aG9yaXpvbnRhbGx5IHNjcm9sbGluZyB0aGUKKyAgICAgICAgICAgICAgIGN1cnJlbnQgbGluZSBk aWZmZXJlbnRseS4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9u dGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8xX3Ag PSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHct PmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3Jv bGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0g dy0+aHNjcm9sbCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIC4uLgorICAgICAgICAg ICAgICAgQ3VycmVudCBsaW5lIGlzIF9ub3RfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJl bnRseS4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzJfcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hz Y3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9w CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA9PSAwCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgIT0gdy0+aHNjcm9sbCk7CisgIC8qIEVY QU1QTEU6ICAoc2Nyb2xsLWxlZnQgNSk7IGFuZCwgdGhlbiBwcmVzcyB0aGUgbGVmdCBhcnJvdyBr ZXkgb25lIHRpbWUuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFs bHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuKi8KKyAgYm9vbCBoc2NsX3RlbXBfcCA9ICghdy0+c3Vz cGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxf bW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAg ICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMt dSBDLXggPCBhbmQgZG8gc29tZXRoaW5nIHRoYXQgY2F1c2VzIHRoZSBjdXJyZW50IGxpbmUgdG8g YmUKKyAgICAgICAgICAgICAgIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4KKyAg ICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBfaXNfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZm ZXJlbnRseS4gKi8KKyAgYm9vbCBoc2NsX3Blcm1fcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3Jv bGwKKyAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAg ICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAm JiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNj cm9sbCAhPSB3LT5oc2Nyb2xsKTsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFt ZSk7CisgIGZvciAoeSA9IHctPnZzY3JvbGwsIHJuID0gMDsKKyAgICAgICB5IDwgeWIgJiYgcm4g PCBucm93czsKKyAgICAgICB5ICs9IHJvdy0+aGVpZ2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XS5lbmFibGVkX3A7CisgICAgICBpZiAoKHZwb3MgPT0gdm50aF9kbSB8fCB2cG9zID09IHZudGhf Y20pCisgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yID09IE1DX09WRVJMQVlfQVJST1dfQklUTUFQ CisgICAgICAgICAgJiYgIWhzY2xfYWxsX3RlbXBfcAorICAgICAgICAgICYmICFoc2NsX3RlbXBf cAorICAgICAgICAgICYmICFoc2NsX3Blcm1fcAorICAgICAgICAgICYmICFoc2NsX2FsbF9wZXJt XzBfcAorICAgICAgICAgICYmICFoc2NsX2FsbF9wZXJtXzFfcAorICAgICAgICAgICYmICFoc2Ns X2FsbF9wZXJtXzJfcAorICAgICAgICAgICYmIGVuYWJsZWRfcCkKKyAgICAgICAgeworICAgICAg ICAgIGludCBmcmluZ2VfYml0bWFwID0gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICBl bnVtIGZhY2VfaWQgb3ZlcmxheV9hcnJvd19mYWNlX2lkID0KKyAgICAgICAgICAgICghYWN0aXZl X3AKKyAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBj aF9pbmFjdGl2ZV93aW5kb3dzKSkpCisgICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3 LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ctaW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwgdHJ1 ZSkKKyAgICAgICAgICAgIDogKGFjdGl2ZV9wKQorICAgICAgICAgICAgICA/IGxvb2t1cF9uYW1l ZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ctcHJlLXp2LWZhY2UiKSwgdHJ1 ZSkKKyAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAgIG1jX2xlZnRfZnJp bmdlX2ZhY2VfaWQgPSAoY3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBvdmVybGF5X2Fycm93X2ZhY2VfaWQK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOwor ICAgICAgICAgIGlmICh3LT5oc2Nyb2xsICE9IDApCisgICAgICAgICAgICBmcmluZ2VfYml0bWFw ID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistb3ZlcmxheS1hcnJvdyIpLCBm YWxzZSwgdHJ1ZSk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGZyaW5nZV9iaXRt YXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1vdmVybGF5LWFycm93Iiks IHRydWUsIHRydWUpOworICAgICAgICAgIG1jX2xlZnRfZnJpbmdlX2JpdG1hcCA9IChjdXJzb3Jf dHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAo KHZwb3MgPT0gdm50aF9kbSB8fCB2cG9zID09IHZudGhfY20pCisgICAgICAgICAgICAgICAgICYm IGdseXBoX2ZsYXZvciA9PSBNQ19PVkVSTEFZX0FSUk9XX0JJVE1BUAorICAgICAgICAgICAgICAg ICAmJiAoaHNjbF9hbGxfdGVtcF9wCisgICAgICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9w ZXJtXzBfcAorICAgICAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8xX3AKKyAgICAg ICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxsX3Blcm1fMl9wCisgICAgICAgICAgICAgICAgICAg ICB8fCBoc2NsX3RlbXBfcAorICAgICAgICAgICAgICAgICAgICAgfHwgaHNjbF9wZXJtX3ApCisg ICAgICAgICAgICAgICAgICYmIGVuYWJsZWRfcCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBp bnQgZnJpbmdlX2JpdG1hcCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgICAgICBlbnVt IGZhY2VfaWQgb3ZlcmxheV9hcnJvd19mYWNlX2lkID0KKyAgICAgICAgICAgICAgKCFhY3RpdmVf cAorICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg Y2hfaW5hY3RpdmVfd2luZG93cykpKQorICAgICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNl ICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ctaHNjbC1pbmFjdGl2ZS1wcmUtenYtZmFj ZSIpLCB0cnVlKQorICAgICAgICAgICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAgICAgICAgICA/ IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ctaHNjbC1w cmUtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAg ICAgICAgICAgIG1jX2xlZnRfZnJpbmdlX2ZhY2VfaWQgPSAoY3Vyc29yX3R5cGUgPT0gTUNfTEVG VF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IG92ZXJsYXlfYXJyb3dfZmFjZV9pZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICAgIGlmIChoc2NsX2FsbF9wZXJtXzBf cCkKKyAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3 LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCBmYWxzZSwgZmFsc2UpOworICAgICAgICAgICAgICBl bHNlIGlmIChoc2NsX2FsbF9wZXJtXzFfcCkKKyAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFw ID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIHRydWUs IGZhbHNlKTsKKyAgICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX2FsbF9wZXJtXzJfcCkKKyAg ICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywg aW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgZmFsc2UsIHRydWUpOworICAgICAgICAgICAgICAgICAg ZWxzZSBpZiAoaHNjbF9wZXJtX3ApCisgICAgICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAg PSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgdHJ1ZSwg dHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xfYWxsX3RlbXBfcCkKKyAg ICAgICAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAg KHcsIGludGVybiAoIistaHNjbC10ZW1wIiksIGZhbHNlLCBmYWxzZSk7CisgICAgICAgICAgICAg ICAgICAgICAgZWxzZSBpZiAoaHNjbF90ZW1wX3ApCisgICAgICAgICAgICAgICAgICAgICAgICBm cmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC10 ZW1wIiksIHRydWUsIGZhbHNlKTsKKyAgICAgICAgICAgIG1jX2xlZnRfZnJpbmdlX2JpdG1hcCA9 IChjdXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBmcmluZ2VfYml0bWFwCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgIH0KKyAg ICAgICAgICBlbHNlIGlmICgodnBvcyA9PSB2bnRoX2RtIHx8IHZwb3MgPT0gdm50aF9jbSkKKyAg ICAgICAgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xF X1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0g TUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAg ICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEUKKyAgICAgICAg ICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRf QVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZF UlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8 IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAg IHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIKKyAgICAgICAgICAg ICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNI KQorICAgICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgICB7CisgICAg ICAgICAgICAgIExpc3BfT2JqZWN0IGJpdG1hcF9mbGF2b3IgPSAoZ2x5cGhfZmxhdm9yID09IE1D X0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0g TUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVykKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfaG9sbG93X3JlY3Rh bmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEUpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hvbGxvd19yZWN0YW5nbGUKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9 PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jhcl9yaWdodF9hcnJvdworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1D X1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVykKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxfYmFyX3JpZ2h0 X2Fycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlw aF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXIKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJU SUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g UW1jX3JldmVyc2VkX3ZlcnRpY2FsX2JhcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRp Y2FsX2Jhcl9iYWNrc2xhc2gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogUW5pbDsKKyAgICAgICAgICAgICAgbWNfcmlnaHRfZnJpbmdlX2JpdG1hcCA9IChjdXJz b3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gbG9va3VwX2ZyaW5nZV9iaXRtYXAgKGJpdG1hcF9mbGF2b3Ip CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19OT19GUklOR0Vf QklUTUFQOworICAgICAgICAgICAgICBtY19yaWdodF9mcmluZ2VfZmFjZV9pZCA9CisgICAgICAg ICAgICAgICAgKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAg ICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVgorICAgICAgICAgICAgICAgICAmJiAo Z2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cK KyAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJU SUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZv ciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpKQorICAgICAgICAgICAgICAgICAgPyBsb29r dXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZXZlcnNlZC1iYXItcHJlLXp2LWZhY2Ui KSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklO R0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IEFUX1pWCisg ICAgICAgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1df UkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2Zs YXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAg ICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikp CisgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIr LXJldmVyc2VkLWJhci1hdC16di1mYWNlIiksIHRydWUpCisgICAgICAgICAgICAgICAgOiAoY3Vy c29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAgICYm IHJvd19wb3NpdGlvbiA9PSBQT1NUX1pWCisgICAgICAgICAgICAgICAgICAgJiYgKGdseXBoX2Zs YXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAg ICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9C QVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09 IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikpCisgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9u YW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJldmVyc2VkLWJhci1wb3N0LXp2LWZhY2UiKSwg dHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0Vf QklUTUFQCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVgorICAg ICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVD VEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9 IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAg ICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAgICAg ICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLWJhci1wcmUtenYt ZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICAgIDogKGN1cnNvcl90eXBlID09IE1DX1JJR0hU X0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gPT0gQVRf WlYKKyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfSE9M TE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2Zs YXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAg ICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAg ICAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1iYXIt YXQtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICAgIDogKGN1cnNvcl90eXBlID09IE1D X1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRpb24g PT0gUE9TVF9aVgorICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZF UlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgJiYg Z2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAg ICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9C QVIpCisgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4g KCIrLWJhci1wb3N0LXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IERFRkFVTFRf RkFDRV9JRDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKCFyb3ctPmVuYWJs ZWRfcCkKKyAgICAgICAgcm93ID0gY3VyOworICAgICAgbGVmdF9mYWNlX2lkID0gcmlnaHRfZmFj ZV9pZCA9IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgIGxlZnRfb2Zmc2V0ID0gcmlnaHRfb2Zmc2V0 ID0gMDsKKy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lmICh0b3BfaW5kX21pbl95ID49IDAp CisgICAgICAgICAgICBsZWZ0X29mZnNldCA9IHRvcF9pbmRfbWluX3kgLSByb3ctPnk7CisgICAg ICAgIH0KKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5kYXJ5 X2JvdCwgUWxlZnQpKQorICAgICAgICB7CisgICAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdF ICgzLCBRYm90dG9tLCBib3Rfcm93X2VuZHNfYXRfenZfcCk7CisgICAgICAgICAgaWYgKGJvdF9p bmRfbWF4X3kgPj0gMCkKKyAgICAgICAgICAgIGxlZnRfb2Zmc2V0ID0gYm90X2luZF9tYXhfeSAt IChyb3ctPnkgKyByb3ctPnZpc2libGVfaGVpZ2h0KTsKKyAgICAgICAgfQorICAgICAgZWxzZSBp ZiAoKCFyb3ctPnJldmVyc2VkX3AgJiYgTUFUUklYX1JPV19DT05USU5VQVRJT05fTElORV9QIChy b3cpKQorICAgICAgICAgICAgICAgfHwgKHJvdy0+cmV2ZXJzZWRfcCAmJiByb3ctPmNvbnRpbnVl ZF9wKSkKKyAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdFICg0LCBRY29udGludWF0aW9uLCAw KTsKKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfZW1wdHlfbGluZV9wICYmIEVRIChlbXB0 eV9wb3MsIFFsZWZ0KSkKKyAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdFICg1LCBRZW1wdHlf bGluZSwgMCk7CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX3RvcF9saW5lX3AgJiYgRVEg KGFycm93X3RvcCwgUWxlZnQpKQorICAgICAgICB7CisgICAgICAgICAgbGVmdCA9IE1DX0xFRlRf RlJJTkdFICg2LCBRdXAsIDApOworICAgICAgICAgIGlmICh0b3BfaW5kX21pbl95ID49IDApCisg ICAgICAgICAgICBsZWZ0X29mZnNldCA9IHRvcF9pbmRfbWluX3kgLSByb3ctPnk7CisgICAgICAg IH0KKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCAmJiBFUSAoYXJy b3dfYm90LCBRbGVmdCkpCisgICAgICAgIHsKKyAgICAgICAgICBsZWZ0ID0gTUNfTEVGVF9GUklO R0UgKDcsIFFkb3duLCAwKTsKKyAgICAgICAgICBpZiAoYm90X2luZF9tYXhfeSA+PSAwKQorICAg ICAgICAgICAgbGVmdF9vZmZzZXQgPSBib3RfaW5kX21heF95IC0gKHJvdy0+eSArIHJvdy0+dmlz aWJsZV9oZWlnaHQpOworICAgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIGxlZnQgPSBNQ19O T19GUklOR0VfQklUTUFQOworICAgICAgLyogRGVjaWRlIHdoaWNoIGJpdG1hcCB0byBkcmF3IGlu IHRoZSByaWdodCBmcmluZ2UuICAqLworICAgICAgaWYgKFdJTkRPV19SSUdIVF9GUklOR0VfV0lE VEggKHcpID09IDApCisgICAgICAgIHJpZ2h0ID0gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAg IGVsc2UgaWYgKHJvdy0+cmlnaHRfdXNlcl9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9C SVRNQVApCisgICAgICAgIHsKKyAgICAgICAgICByaWdodCA9IHJvdy0+cmlnaHRfdXNlcl9mcmlu Z2VfYml0bWFwOworICAgICAgICAgIHJpZ2h0X2ZhY2VfaWQgPSByb3ctPnJpZ2h0X3VzZXJfZnJp bmdlX2ZhY2VfaWQ7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKCghcm93LT5yZXZlcnNlZF9w ICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICB8fCAocm93LT5y ZXZlcnNlZF9wICYmIHJvdy0+dHJ1bmNhdGVkX29uX2xlZnRfcCkpCisgICAgICAgIHJpZ2h0ID0g TUNfUklHSFRfRlJJTkdFICgwLCBRdHJ1bmNhdGlvbiwgMCk7CisgICAgICBlbHNlIGlmIChyb3ct PmluZGljYXRlX2JvYl9wICYmIEVRIChib3VuZGFyeV90b3AsIFFyaWdodCkpCisgICAgICAgIHsK KyAgICAgICAgICByaWdodCA9ICgocm93LT5pbmRpY2F0ZV9lb2JfcCAmJiBFUSAoYm91bmRhcnlf Ym90LCBRcmlnaHQpKQorICAgICAgICAgICAgID8gTUNfUklHSFRfRlJJTkdFICgxLCBRdG9wX2Jv dHRvbSwgdG9wX3Jvd19lbmRzX2F0X3p2X3ApCisgICAgICAgICAgICAgOiBNQ19SSUdIVF9GUklO R0UgKDIsIFF0b3AsIDApKTsKKyAgICAgICAgICBpZiAodG9wX2luZF9taW5feSA+PSAwKQorICAg ICAgICAgICAgcmlnaHRfb2Zmc2V0ID0gdG9wX2luZF9taW5feSAtIHJvdy0+eTsKKyAgICAgICAg fQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9lb2JfcCAmJiBFUSAoYm91bmRhcnlfYm90 LCBRcmlnaHQpKQorICAgICAgICB7CisgICAgICAgICAgcmlnaHQgPSBNQ19SSUdIVF9GUklOR0Ug KDMsIFFib3R0b20sIGJvdF9yb3dfZW5kc19hdF96dl9wKTsKKyAgICAgICAgICBpZiAoYm90X2lu ZF9tYXhfeSA+PSAwKQorICAgICAgICAgICAgcmlnaHRfb2Zmc2V0ID0gYm90X2luZF9tYXhfeSAt IChyb3ctPnkgKyByb3ctPnZpc2libGVfaGVpZ2h0KTsKKyAgICAgICAgfQorICAgICAgZWxzZSBp ZiAoKCFyb3ctPnJldmVyc2VkX3AgJiYgcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgICAg IHx8IChyb3ctPnJldmVyc2VkX3AgJiYgTUFUUklYX1JPV19DT05USU5VQVRJT05fTElORV9QIChy b3cpKSkKKyAgICAgICAgcmlnaHQgPSBNQ19SSUdIVF9GUklOR0UgKDQsIFFjb250aW51YXRpb24s IDApOworICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV90b3BfbGluZV9wICYmIEVRIChhcnJv d190b3AsIFFyaWdodCkpCisgICAgICAgIHsKKyAgICAgICAgICByaWdodCA9IE1DX1JJR0hUX0ZS SU5HRSAoNiwgUXVwLCAwKTsKKyAgICAgICAgICBpZiAodG9wX2luZF9taW5feSA+PSAwKQorICAg ICAgICAgICAgcmlnaHRfb2Zmc2V0ID0gdG9wX2luZF9taW5feSAtIHJvdy0+eTsKKyAgICAgICAg fQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wICYmIEVRIChhcnJv d19ib3QsIFFyaWdodCkpCisgICAgICAgIHsKKyAgICAgICAgICByaWdodCA9IE1DX1JJR0hUX0ZS SU5HRSAoNywgUWRvd24sIDApOworICAgICAgICAgIGlmIChib3RfaW5kX21heF95ID49IDApCisg ICAgICAgICAgICByaWdodF9vZmZzZXQgPSBib3RfaW5kX21heF95IC0gKHJvdy0+eSArIHJvdy0+ dmlzaWJsZV9oZWlnaHQpOworICAgICAgICB9CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRl X2VtcHR5X2xpbmVfcCAmJiBFUSAoZW1wdHlfcG9zLCBRcmlnaHQpKQorICAgICAgICByaWdodCA9 IE1DX1JJR0hUX0ZSSU5HRSAoNSwgUWVtcHR5X2xpbmUsIDApOworICAgICAgZWxzZQorICAgICAg ICByaWdodCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICBwZXJpb2RpY19wID0gKGdldF9m cmluZ2VfYml0bWFwX2RhdGEgKGxlZnQpLT5wZXJpb2QgIT0gMAorICAgICAgICAgICAgICAgICAg ICB8fCBnZXRfZnJpbmdlX2JpdG1hcF9kYXRhIChyaWdodCktPnBlcmlvZCAhPSAwKTsKKyAgICAg IGlmIChyb3ctPnkgIT0gY3VyLT55CisgICAgICAgICAgfHwgcm93LT52aXNpYmxlX2hlaWdodCAh PSBjdXItPnZpc2libGVfaGVpZ2h0CisgICAgICAgICAgfHwgcm93LT5lbmRzX2F0X3p2X3AgIT0g Y3VyLT5lbmRzX2F0X3p2X3AKKyAgICAgICAgICB8fCBsZWZ0ICE9IGN1ci0+bGVmdF9mcmluZ2Vf Yml0bWFwCisgICAgICAgICAgfHwgcmlnaHQgIT0gY3VyLT5yaWdodF9mcmluZ2VfYml0bWFwCisg ICAgICAgICAgfHwgbGVmdF9mYWNlX2lkICE9IGN1ci0+bGVmdF9mcmluZ2VfZmFjZV9pZAorICAg ICAgICAgIHx8IHJpZ2h0X2ZhY2VfaWQgIT0gY3VyLT5yaWdodF9mcmluZ2VfZmFjZV9pZAorICAg ICAgICAgIHx8IGxlZnRfb2Zmc2V0ICE9IGN1ci0+bGVmdF9mcmluZ2Vfb2Zmc2V0CisgICAgICAg ICAgfHwgcmlnaHRfb2Zmc2V0ICE9IGN1ci0+cmlnaHRfZnJpbmdlX29mZnNldAorICAgICAgICAg IHx8IHBlcmlvZGljX3AgIT0gY3VyLT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3AKKyAgICAgICAg ICB8fCBjdXItPnJlZHJhd19mcmluZ2VfYml0bWFwc19wKQorICAgICAgICB7CisgICAgICAgICAg cmVkcmF3X3AgPSAxLCByb3ctPnJlZHJhd19mcmluZ2VfYml0bWFwc19wID0gMTsKKyAgICAgICAg ICBpZiAoIWtlZXBfY3VycmVudF9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBjdXIt PnJlZHJhd19mcmluZ2VfYml0bWFwc19wID0gMTsKKyAgICAgICAgICAgICAgaWYgKG1jX2xlZnRf ZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICB8 fCBtY19yaWdodF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAg ICAgICAgICAgY3VyLT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3AgPSBmYWxzZTsKKyAgICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPmZyaW5nZV9iaXRtYXBfcGVyaW9k aWNfcCA9IHBlcmlvZGljX3A7CisgICAgICAgICAgICAgIGlmIChtY19sZWZ0X2ZyaW5nZV9iaXRt YXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICBjdXItPmxlZnRfZnJp bmdlX2JpdG1hcCA9IG1jX2xlZnRfZnJpbmdlX2JpdG1hcDsKKyAgICAgICAgICAgICAgICBlbHNl CisgICAgICAgICAgICAgICAgICBjdXItPmxlZnRfZnJpbmdlX2JpdG1hcCA9IGxlZnQ7CisgICAg ICAgICAgICAgIGlmIChtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1B UCkKKyAgICAgICAgICAgICAgICBjdXItPmxlZnRfZnJpbmdlX2ZhY2VfaWQgPSBtY19sZWZ0X2Zy aW5nZV9mYWNlX2lkOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIGN1 ci0+bGVmdF9mcmluZ2VfZmFjZV9pZCA9IGxlZnRfZmFjZV9pZDsKKyAgICAgICAgICAgICAgaWYg KG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICAg ICAgICAgIGN1ci0+bGVmdF9mcmluZ2Vfb2Zmc2V0ID0gMDsKKyAgICAgICAgICAgICAgICBlbHNl CisgICAgICAgICAgICAgICAgICBjdXItPmxlZnRfZnJpbmdlX29mZnNldCA9IGxlZnRfb2Zmc2V0 OworICAgICAgICAgICAgICBpZiAobWNfcmlnaHRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklO R0VfQklUTUFQKQorICAgICAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX2JpdG1hcCA9IG1j X3JpZ2h0X2ZyaW5nZV9iaXRtYXA7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICAgICAgY3VyLT5yaWdodF9mcmluZ2VfYml0bWFwID0gcmlnaHQ7CisgICAgICAgICAgICAgIGlm IChtY19yaWdodF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAg ICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2VfZmFjZV9pZCA9IG1jX3JpZ2h0X2ZyaW5nZV9mYWNl X2lkOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIGN1ci0+cmlnaHRf ZnJpbmdlX2ZhY2VfaWQgPSByaWdodF9mYWNlX2lkOworICAgICAgICAgICAgICBpZiAobWNfcmln aHRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAg IGN1ci0+cmlnaHRfZnJpbmdlX29mZnNldCA9IDA7CisgICAgICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2Vfb2Zmc2V0ID0gcmlnaHRfb2Zmc2V0Owor ICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBpZiAocm93LT5vdmVybGF5X2Fycm93X2Jp dG1hcCA8IDApCisgICAgICAgIHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAgPSBtY19nZXRfbG9n aWNhbF9mcmluZ2VfYml0bWFwICh3LCBRb3ZlcmxheV9hcnJvdywgMCwgMCk7CisgICAgICBpZiAo cm93LT5vdmVybGF5X2Fycm93X2JpdG1hcCAhPSBjdXItPm92ZXJsYXlfYXJyb3dfYml0bWFwKQor ICAgICAgICB7CisgICAgICAgICAgcmVkcmF3X3AgPSAxLCByb3ctPnJlZHJhd19mcmluZ2VfYml0 bWFwc19wID0gMTsKKyAgICAgICAgICBpZiAoIWtlZXBfY3VycmVudF9wKQorICAgICAgICAgICAg eworICAgICAgICAgICAgICBjdXItPnJlZHJhd19mcmluZ2VfYml0bWFwc19w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3NpdGlvbiBhdCB3aGljaCB0aGUgYml0bWFwIGhhcyB0 byBiZQorICAgZHJhd24uCisgICBMRUZUX1AgaXMgMSBmb3IgbGVmdCBmcmluZ2UsIDAgZm9yIHJp Z2h0IGZyaW5nZS4KKyovCitzdGF0aWMgdm9pZAorbWNfZHJhd19mcmluZ2VfYml0bWFwXzEgKHN0 cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgaW50IGxlZnRfcCwgaW50IG92 ZXJsYXksIGludCB3aGljaCkKK3sKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1df RlJBTUUgKHcpKTsKKyAgc3RydWN0IGRyYXdfZnJpbmdlX2JpdG1hcF9wYXJhbXMgcDsKKyAgc3Ry dWN0IGZyaW5nZV9iaXRtYXAgKmZiOworICBpbnQgcGVyaW9kOworICBpbnQgZmFjZV9pZCA9IERF RkFVTFRfRkFDRV9JRDsKKyAgaW50IG9mZnNldCwgaGVhZGVyX2xpbmVfaGVpZ2h0OworICBwLm92 ZXJsYXlfcCA9IChvdmVybGF5ICYgMSkgPT0gMTsKKyAgcC5jdXJzb3JfcCA9IChvdmVybGF5ICYg MikgPT0gMjsKKyAgaWYgKHdoaWNoICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgeworICAg ICAgb2Zmc2V0ID0gMDsKKyAgICB9CisgICAgZWxzZSBpZiAobGVmdF9wKQorICAgICAgeworICAg ICAgICB3aGljaCA9IHJvdy0+bGVmdF9mcmluZ2VfYml0bWFwOworICAgICAgICBmYWNlX2lkID0g cm93LT5sZWZ0X2ZyaW5nZV9mYWNlX2lkOworICAgICAgICBvZmZzZXQgPSByb3ctPmxlZnRfZnJp bmdlX29mZnNldDsKKyAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgIHdo aWNoID0gcm93LT5yaWdodF9mcmluZ2VfYml0bWFwOworICAgICAgICAgIGZhY2VfaWQgPSByb3ct PnJpZ2h0X2ZyaW5nZV9mYWNlX2lkOworICAgICAgICAgIG9mZnNldCA9IHJvdy0+cmlnaHRfZnJp bmdlX29mZnNldDsKKyAgICAgICAgfQorICBpZiAoZmFjZV9pZCA9PSBERUZBVUxUX0ZBQ0VfSUQp CisgICAgeworICAgICAgTGlzcF9PYmplY3QgZmFjZSA9IGZyaW5nZV9mYWNlc1t3aGljaF07Cisg ICAgICBmYWNlX2lkID0gTklMUCAoZmFjZSkgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgUWZy aW5nZSwgZmFsc2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBsb29rdXBfZGVyaXZl ZF9mYWNlICh3LCBmLCBmYWNlLCBGUklOR0VfRkFDRV9JRCwgMCk7CisgICAgICBpZiAoZmFjZV9p ZCA8IDApCisgICAgICAgIGZhY2VfaWQgPSBGUklOR0VfRkFDRV9JRDsKKyAgICB9CisgIGZiID0g Z2V0X2ZyaW5nZV9iaXRtYXBfZGF0YSAod2hpY2gpOworICBwZXJpb2QgPSBmYi0+cGVyaW9kOwor ICAvKiBDb252ZXJ0IHJvdyB0byBmcmFtZSBjb29yZGluYXRlcy4gICovCisgIHAueSA9IFdJTkRP V19UT19GUkFNRV9QSVhFTF9ZICh3LCByb3ctPnkpICsgb2Zmc2V0OworICBwLndoaWNoID0gd2hp Y2g7CisgIHAuYml0cyA9IGZiLT5iaXRzOworICBwLndkID0gZmItPndpZHRoOworICBwLmggPSBm Yi0+aGVpZ2h0OworICBwLmRoID0gKHBlcmlvZCA+IDAgPyAocC55ICUgcGVyaW9kKSA6IDApOwor ICBwLmggLT0gcC5kaDsKKyAgLyogQWRqdXN0IHkgdG8gdGhlIG9mZnNldCBpbiB0aGUgcm93IHRv IHN0YXJ0IGRyYXdpbmcgdGhlIGJpdG1hcC4gICovCisgIHN3aXRjaCAoZmItPmFsaWduKQorICAg IHsKKyAgICBjYXNlIEFMSUdOX0JJVE1BUF9DRU5URVI6CisgICAgICBwLnkgKz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ICAgICAgPyBMRUZUX01BUkdJTl9BUkVBCisgICAgICAgICAg IDogVEVYVF9BUkVBKSk7CisgICAgICBpZiAocC53ZCA+IHdkKQorICAgICAgICBwLndkID0gd2Q7 CisgICAgICBwLnggPSB4IC0gcC53ZCAtICh3ZCAtIHAud2QpIC8gMjsKKyAgICAgIGlmIChwLndk IDwgd2QgfHwgcC55ID4gcC5ieSB8fCBwLnkgKyBwLmggPCBwLmJ5ICsgcC5ueSkKKyAgICAgICAg eworICAgICAgICAgIC8qIElmIFcgaGFzIGEgdmVydGljYWwgYm9yZGVyIHRvIGl0cyBsZWZ0LCBk b24ndCBkcmF3IG92ZXIgaXQuICAqLworICAgICAgICAgIHdkIC09ICgoIVdJTkRPV19MRUZUTU9T VF9QICh3KQorICAgICAgICAgICAgLyogVGhpcyBjb3VsZCBiZSB3cm9uZyB3aGVuIHdlIGFsbG93 IHdpbmRvdyBsb2NhbAorICAgICAgICAgICAgICAgcmlnaHQgZGl2aWRlcnMgLSBidXQgdGhlIHdp bmRvdyBvbiB0aGUgbGVmdCBpcyBoYXJkCisgICAgICAgICAgICAgICB0byBnZXQuICAqLworICAg ICAgICAgICAgJiYgIUZSQU1FX1JJR0hUX0RJVklERVJfV0lEVEggKGYpCisgICAgICAgICAgICAm JiAhV0lORE9XX0hBU19WRVJUSUNBTF9TQ1JPTExfQkFSICh3KQorICAgICAgICAgICAgLyogQnV0 IGRvbid0IHJlZHVjZSB0aGUgZnJpbmdlIHdpZHRoIGlmIHRoZSB3aW5kb3cKKyAgICAgICAgICAg ICAgIGhhcyBhIGxlZnQgbWFyZ2luLCBiZWNhdXNlIHRoYXQgbWVhbnMgd2UgYXJlIG5vdAorICAg ICAgICAgICAgICAgaW4gZGFuZ2VyIG9mIGRyYXdpbmcgb3ZlciB0aGUgdmVydGljYWwgYm9yZGVy LAorICAgICAgICAgICAgICAgYW5kIE9UT0ggbGVhdmluZyBvdXQgdGhhdCBvbmUgcGl4ZWwgbGVh dmVzIGJlaGluZAorICAgICAgICAgICAgICAgdHJhY2VzIG9mIHRoZSBjdXJzb3IsIGlmIGl0IHdh cyBpbiBjb2x1bW4gemVybworICAgICAgICAgICAgICAgYmVmb3JlIGRyYXdpbmcgbm9uLWVtcHR5 IG1hcmdpbiBhcmVhLiAgKi8KKyAgICAgICAgICAgICYmIHctPmxlZnRfbWFyZ2luX2NvbHMgPT0g MCkKKyAgICAgICAgICAgPyAxIDogMCk7CisgICAgICAgICAgcC5ieCA9IHggLSB3ZDsKKyAgICAg ICAgICBwLm54ID0gd2Q7CisgICAgICAgIH0KKyAgICB9CisgIGVsc2UKKyAgICB7CisgICAgICBp bnQgeCA9IHdpbmRvd19ib3hfcmlnaHQgKHcsCisgICAgICAgIChXSU5ET1dfSEFTX0ZSSU5HRVNf T1VUU0lERV9NQVJHSU5TICh3KQorICAgICAgICAgPyBSSUdIVF9NQVJHSU5fQVJFQQorICAgICAg ICAgOiBURVhUX0FSRUEpKTsKKyAgICAgIGludCB3ZCA9IFdJTkRPV19SSUdIVF9GUklOR0VfV0lE VEggKHcpOworICAgICAgaWYgKHAud2QgPiB3ZCkKKyAgICAgICAgcC53ZCA9IHdkOworICAgICAg cC54ID0geCArICh3ZCAtIHAud2QpIC8gMjsKKyAgICAgIC8qIENsZWFyIHJpZ2h0IGZyaW5nZSBp ZiBubyBiaXRtYXAgdG8gZHJhdyBvZiBpZiBiaXRtYXAgZG9lc24ndCBmaWxsCisgICB0aGUgZnJp bmdlLiAgKi8KKyAgICAgIGlmIChwLndkIDwgd2QgfHwgcC55ID4gcC5ieSB8fCBwLnkgKyBwLmgg PCBwLmJ5ICsgcC5ueSkKKyAgICAgICAgeworICAgICAgICAgIHAuYnggPSB4OworICAgICAgICAg IHAubnggPSB3ZDsKKyAgICAgICAgfQorICAgIH0KKyAgaWYgKHAueCA+PSBXSU5ET1dfQk9YX0xF RlRfRURHRV9YICh3KQorICAgICAgJiYgKHAueCArIHAud2QpIDw9IFdJTkRPV19CT1hfTEVGVF9F REdFX1ggKHcpICsgV0lORE9XX1BJWEVMX1dJRFRIICh3KSkKKyAgICBGUkFNRV9SSUYgKGYpLT5k cmF3X2ZyaW5nZV9iaXRtYXAgKHcsIHJvdywgJnApOworfQorCit2b2lkCittY19kcmF3X2ZyaW5n ZV9iaXRtYXAgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgaW50IGxl ZnRfcCwgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSkKK3sKKyAgaW50IG92ZXJsYXkg PSAwOworICBpZiAobGVmdF9wID09IHJvdy0+cmV2ZXJzZWRfcCAmJiByb3ctPmN1cnNvcl9pbl9m cmluZ2VfcCkKKyAgICB7CisgICAgICBMaXNwX09iamVjdCBjdXJzb3IgPSBRbmlsOworICAgICAg c3dpdGNoIChjdXJzb3JfdHlwZSkKKyAgICAgICAgeworICAgICAgICBjYXNlIE1DX0ZSQU1FRF9C T1g6CisgICAgICAgICAgaWYgKHJvdy0+dmlzaWJsZV9oZWlnaHQgPj0gU1RBTkRBUkRfQklUTUFQ X0hFSUdIVCAoaG9sbG93X3JlY3RhbmdsZV9iaXRzKSkKKyAgICAgICAgICAgIGN1cnNvciA9IFFo b2xsb3c7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgY3Vyc29yID0gUWhvbGxvd19zbWFs bDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19IT0xMT1dfQk9YOgorICAgICAg ICAgIGlmIChyb3ctPnZpc2libGVfaGVpZ2h0ID49IFNUQU5EQVJEX0JJVE1BUF9IRUlHSFQgKGhv bGxvd19yZWN0YW5nbGVfYml0cykpCisgICAgICAgICAgICBjdXJzb3IgPSBRaG9sbG93OworICAg ICAgICAgIGVsc2UKKyAgICAgICAgICAgIGN1cnNvciA9IFFob2xsb3dfc21hbGw7CisgICAgICAg ICAgYnJlYWs7CisgICAgICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAgICAgICAgICBjdXJzb3Ig PSBRYm94OworICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1DX0JBUjoKKyAgICAgICAg ICBjdXJzb3IgPSBRYmFyOworICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1DX0hCQVI6 CisgICAgICAgICAgY3Vyc29yID0gUWhiYXI7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNh c2UgTUNfTk9fRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgY2FzZSBNQ19OT19DVVJTT1I6CisgICAg ICAgIGNhc2UgTUNfUklHSFRfRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgY2FzZSBNQ19MRUZUX0ZS SU5HRV9CSVRNQVA6CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgdy0+cGh5c19jdXJzb3Jf b25fcCA9IDA7CisgICAgICAgICAgcm93LT5jdXJzb3JfaW5fZnJpbmdlX3AgPSAwOworICAgICAg ICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBpZiAoIU5JTFAgKGN1cnNvcikpCisgICAgICAg IHsKKyAgICAgICAgICBpbnQgYm0gPSBtY19nZXRfbG9naWNhbF9jdXJzb3JfYml0bWFwICh3LCBj dXJzb3IpOworICAgICAgICAgIGlmIChibSAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXBfMSAodywgcm93LCBs ZWZ0X3AsIDIsIGJtKTsKKyAgICAgICAgICAgICAgb3ZlcmxheSA9IEVRIChjdXJzb3IsIFFib3gp ID8gMyA6IDE7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIG1jX2RyYXdfZnJp bmdlX2JpdG1hcF8xICh3LCByb3csIGxlZnRfcCwgb3ZlcmxheSwgTUNfTk9fRlJJTkdFX0JJVE1B UCk7CisgIGlmIChsZWZ0X3AgJiYgcm93LT5vdmVybGF5X2Fycm93X2JpdG1hcCAhPSBNQ19OT19G UklOR0VfQklUTUFQKQorICAgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcF8xICh3LCByb3csIDEsIDEs IHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXApOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09S UyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogI2RlZmluZSBOT19GUklOR0VfQklU TUFQIDAKICNkZWZpbmUgVU5ERUZfRlJJTkdFX0JJVE1BUCAxCiAjZGVmaW5lIE1BWF9TVEFOREFS RF9GUklOR0VfQklUTUFQUyBBUlJBWUVMVFMgKHN0YW5kYXJkX2JpdG1hcHMpCkBAIC0xNjk5LDYg KzMyMTcsMTY4IEBAIFJldHVybiBuaWwgaWYgUE9TIGlzIG5vdCB2aXNpYmxlIGluIFdJTkRPVy4g ICovKQogdm9pZAogc3ltc19vZl9mcmluZ2UgKHZvaWQpCiB7CisKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogKGdldCAnZW1w dHktbGluZSAnZnJpbmdlKSA9PiAyMyA9PiB0aGUgbGFzdCBzdGFuZGFyZC1iaXRtYXAgYmVmb3Jl IHRoaXMgb25lLgorICBTZWUgYGZyaW5nZS5lbGAuICovCisKKyAgLyogMjQgKi8KKyAgREVGU1lN IChRbWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93LCAiKy12ZXJ0aWNhbC1iYXItcmlnaHQtYXJy b3ciKTsKKyAgVmZyaW5nZV9iaXRtYXBzID0gRmNvbnMgKFFtY192ZXJ0aWNhbF9iYXJfcmlnaHRf YXJyb3csIFZmcmluZ2VfYml0bWFwcyk7CisgIEZwdXQgKFFtY192ZXJ0aWNhbF9iYXJfc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ZlcmxheV9hcnJvdywgIm92ZXJsYXktYXJyb3ciKTsKZGlm ZiAtLWdpdCBhL3NyYy9uc3Rlcm0uaCBiL3NyYy9uc3Rlcm0uaAppbmRleCA5NzczZWIzLi5lMzRh MTE2IDEwMDY0NAotLS0gYS9zcmMvbnN0ZXJtLmgKKysrIGIvc3JjL25zdGVybS5oCkBAIC02NjMs NiArNjYzLDE2IEBAIHR5cGVkZWYgaWQgaW5zdGFuY2V0eXBlOwogCiBAaW50ZXJmYWNlIEVtYWNz U2Nyb2xsZXIgOiBOU1Njcm9sbGVyCiAgIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIE5TUmVjdCBtY19yZWN0YW5nbGU7CisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKICAgIHN0cnVjdCB3aW5kb3cgKndpbmRvdzsKICAg IHN0cnVjdCBmcmFtZSAqZnJhbWU7CiAgICBOU1Jlc3BvbmRlciAqcHJldlJlc3BvbmRlcjsKQEAg LTY4Myw2ICs2OTMsMTggQEAgdHlwZWRlZiBpZCBpbnN0YW5jZXR5cGU7CiAgICBpbnQgZW1fd2hv bGU7CiAgICB9CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJT T1JTICovCisKKy0gKHZvaWQpbWNfc2V0X3JlY3RhbmdsZTogKE5TUmVjdClyZWN0OworLSAoTlNS ZWN0KW1jX2dldF9yZWN0YW5nbGU7CistIChzdHJ1Y3Qgd2luZG93ICopbWNfZ2V0X3dpbmRvdzsK Ky0gKGJvb2wpbWNfanVkZ2U7CisKK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GUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOworICAgICAg IGNhY2hlX3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICArK2NhY2hlX3R5cGUpCisgICAgeworICAg ICAgZm9yIChpbnQgbnRoID0gMDsKKyAgICAgICAgICAgcworICAgICAgICAgICAmJiBtY190cmF2 ZXJzZV9jYWNoZV9wIChzLT53LT5tY19tYXRyaXgsIGNhY2hlX3R5cGUsIHZudGgsIG50aCk7Cisg ICAgICAgICAgICsrbnRoKQorICAgICAgICB7CisgICAgICAgICAgLy8gIGludCB4ID0gcy0+dy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS54OworICAgICAgICAg IGludCBmeCA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF0uZng7CisgICAgICAgICAgLy8gIGludCB5ID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXS55OworICAgICAgICAgIGludCBmeSA9IHMtPnctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZnk7CisgICAgICAgICAgaW50 IGhwb3MgPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhd Lmhwb3M7CisgICAgICAgICAgaW50IHZwb3MgPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLnZwb3M7CisgICAgICAgICAgaW50IHdkID0gcy0+dy0+bWNf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS53ZDsKKyAgICAgICAgICBp bnQgaCA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0u aDsKKyAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlID0gcy0+dy0+bWNf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5jdXJzb3JfdHlwZTsKKyAg ICAgICAgICAvLyAgaW50IGN1cnNvcl93aWR0aCA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF0uY3Vyc29yX3dpZHRoOworICAgICAgICAgIHN0cnVjdCBt Y19SR0IgbHNsX2ZnID0gey5yZWQgPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhdLmZnLnJlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAuZ3JlZW4gPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLmZnLmdyZWVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0g cy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5mZy5ibHVl fTsKKyAgICAgICAgICAvLyAgc3RydWN0IG1jX1JHQiBsc2xfYmcgPSB7LnJlZCA9IHMtPnctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmcucmVkLAorICAgICAg ICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSBzLT53LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLmdyZWVuLAorICAgICAgICAgIC8v ICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IHMtPnctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmcuYmx1ZX07CisgICAgICAgICAgYm9vbCBhY3Rp dmVfcCA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0u YWN0aXZlX3A7CisgICAgICAgICAgLy8gIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IHMt PnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGhfZmxh dm9yOworICAgICAgICAgIGJvb2wgZW5hYmxlZF9wID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFibGVkX3A7CisgICAgICAgICAgYm9vbCBnb19w ID0gKHZwb3MgPT0gdm50aAorICAgICAgICAgICAgICAgICAgICAgICAmJiBocG9zID09IGN1cnNv cl9nbHlwaC0+aHBvcworICAgICAgICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApOworICAg ICAgICAgIGlmICghZ29fcCkKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgIE5TUmVj dCByOworICAgICAgICAgIHIub3JpZ2luLnggPSBmeDsKKyAgICAgICAgICByLm9yaWdpbi55ID0g Znk7CisgICAgICAgICAgci5zaXplLmhlaWdodCA9IGg7CisgICAgICAgICAgci5zaXplLndpZHRo ID0gd2Q7CisgICAgICAgICAgW1tOU0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6IGxzbF9m Zy5yZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBncmVlbjogbHNsX2Zn LmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJsdWU6IGxzbF9m Zy5ibHVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwaGE6IDEuMF0g c2V0XTsKKyAgICAgIGlmIChjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YKQorICAgICAgICB7 CisgICAgICAgICAgc3RydWN0IGJ1Z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KGhvbGxv d19hY3RpdmVfcmVnaW9uX2JlZ19mYWNlKSwgcy0+Zik7CisgICAgICAgICAgICAgIGhvbGxvd19j b2xvciA9IGhvbGxvd19hY3RpdmVfcmVnaW9uX2JlZ19jb2xvcjsKKyAgICAgICAgICAgIH0KKyAg ICAgICAgICAgIGVsc2UgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAg JiYgYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+Y2hhcnBv cyA9PSByZWdpb25fZW5kKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZW51bSBm YWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2VuZF9mYWNlX2lkID0gbG9va3VwX25hbWVkX2Zh Y2UgKHMtPncsIHMtPmYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1hdC1yZWdpb24tcHJl LXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19h Y3RpdmVfcmVnaW9uX2VuZF9mYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBob2xsb3dfYWN0aXZl X3JlZ2lvbl9lbmRfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgTlNDb2xvciAqaG9sbG93X2Fj dGl2ZV9yZWdpb25fZW5kX2NvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0Vf QkFDS0dST1VORCAoaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2UpLCBzLT5mKTsKKyAgICAg ICAgICAgICAgICBob2xsb3dfY29sb3IgPSBob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfY29sb3I7 CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZSBpZiAocmVnaW9uX2FjdGl2ZV9w CisgICAgICAgICAgICAgICAgICAgICAgICYmIGFjdGl2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ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOworICAg ICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9G Uk9NX0lEIChzLT5mLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAg ICBOU0NvbG9yICpob2xsb3dfYWN0aXZlX2NvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3Ig KE5TX0ZBQ0VfQkFDS0dST1VORCAoaG9sbG93X2FjdGl2ZV9mYWNlKSwgcy0+Zik7CisgICAgICAg ICAgICAgICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19hY3RpdmVfY29sb3I7CisgICAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmICghYWN0aXZlX3ApCisgICAg ICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9s bG93X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ZiwgaW50 ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpOwor ICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9 IEZBQ0VfRlJPTV9JRCAocy0+ZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAg ICAgICAgICAgICAgIE5TQ29sb3IgKmhvbGxvd19pbmFjdGl2ZV9jb2xvciA9IG5zX2xvb2t1cF9p bmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGhvbGxvd19pbmFjdGl2ZV9mYWNlKSwg cy0+Zik7CisgICAgICAgICAgICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2luYWN0 aXZlX2NvbG9yOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxz ZSBpZiAoZmFjZSAmJiBOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpID09IG5zX2luZGV4X2NvbG9y IChGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpLCBzLT5mKSkKKyAgICAgICAgICB7CisgICAgICAg ICAgICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoZmFjZSks IHMtPmYpIHNldF07CisgICAgICAgICAgICBob2xsb3dfY29sb3IgPSBGUkFNRV9DVVJTT1JfQ09M T1IgKHMtPmYpOworICAgICAgICAgIH0KKyAgICAgICAgICBzd2l0Y2ggKGN1cnNvcl90eXBlKQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICBjYXNlIE1DX05PX0ZSSU5HRV9CSVRNQVA6Cisg ICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgTUNfTk9fQ1VSU09SOgor ICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX1JJR0hUX0ZSSU5H RV9CSVRNQVA6CisgICAgICAgICAgICAgIGNhc2UgTUNfTEVGVF9GUklOR0VfQklUTUFQOgorICAg ICAgICAgICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAgICAgICAgICAgICAgTlNSZWN0Rmls bCAocik7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgTUNfRlJB TUVEX0JPWDoKKyAgICAgICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAgICAg ICBbaG9sbG93X2NvbG9yIHNldF07CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAoTlNJbnNl dFJlY3QgKHIsIDEsIDEpKTsKKyAgICAgICAgICAgICAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChz LT5mKSBzZXRdOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1D X0hPTExPV19CT1g6CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAg ICAgICAgW2hvbGxvd19jb2xvciBzZXRdOworICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKE5T SW5zZXRSZWN0IChyLCAxLCAxKSk7CisgICAgICAgICAgICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xP UiAocy0+Zikgc2V0XTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2Fz ZSBNQ19IQkFSOgorICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAg ICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX0JBUjoKKyAgICAgICAgICAgICAgICBO U1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAg ICAgICAgICAvKiBJZiBhIGdseXBoIGV4aXN0cyAocy0+Y2hhcjJiICE9IE5VTEwpLCB0aGVuIGRy YXcgdGhlIGdseXBoIG9uIHRvcCBvZiB0aGUKKyAgICAgICAgICBuZXdseSBkcmF3biByZWN0YW5n bGUgdGhhdCB3YXMgY3JlYXRlZCBoZXJlaW5hYm92ZS4gIFRvIHRoZSBleHRlbnQgdGhhdCB3ZQor ICAgICAgICAgIHdhbnQgdG8gZG91YmxlLWltcHJpbnQgZ2x5cGhzIHRvIG1ha2UgdGhlbSBhcHBl YXIgdG8gYmUgc2VtaS1ib2xkLCBpdCBjYW4KKyAgICAgICAgICBiZSBkb25lIGhlcmUgZm9yIGFs bCBjdXJzb3IgdHlwZXMuICBUaGUgYm94LXN0eWxlIGN1cnNvcnMgYXJlIGltcHJpbnRlZAorICAg ICAgICAgIHdpdGggZ2x5cGhzIG9ubHkgb25lICgxKSB0aW1lLiAgVGhlIHNlbWktYm9sZCBhcHBl YXJhbmNlIGlzIGhlbHBmdWwgd2hlbgorICAgICAgICAgIGRlYnVnZ2luZyB0byBzZWUgdGhhdCB0 aGUgY29vcmRpbmF0ZXMgYXJlIGNvcnJlY3QuICovCisgICAgICAgICAgaWYgKHMtPmNoYXIyYiAh PSBOVUxMCisgICAgICAgICAgICAgICYmIChjdXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9YCisg ICAgICAgICAgICAgICAgICB8fCBjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YCisgICAgICAg ICAgICAgICAgICB8fCBjdXJzb3JfdHlwZSA9PSBNQ19IT0xMT1dfQk9YKSkKKyAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgQk9PTCBpc0NvbXBvc2l0ZSA9IHMtPmZpcnN0X2dseXBoLT50eXBl ID09IENPTVBPU0lURV9HTFlQSDsKKyAgICAgICAgICAgICAgaWYgKGlzQ29tcG9zaXRlKQorICAg ICAgICAgICAgICAgIG5zX2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChz KTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgICAgIHN0cnVjdCBmb250ICpmb250ID0gcy0+ZmFjZS0+Zm9udDsKKyAgICAgICAgICAg ICAgICAgICAgaWYgKCFmb250KQorICAgICAgICAgICAgICAgICAgICAgIGZvbnQgPSBGUkFNRV9G T05UIChzLT5mKTsKKyAgICAgICAgICAgICAgICAgICAgYm9vbCB3aXRoX2JnX3AgPSBmYWxzZTsK KyAgICAgICAgICAgICAgICAgICAgZm9udC0+ZHJpdmVyLT5kcmF3IChzLCBzLT5jbXBfZnJvbSwg cy0+bmNoYXJzLCBzLT54LCBzLT55YmFzZSwgd2l0aF9iZ19wKTsKKyAgICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgLy8gIGNsb2NrX3QgY2xvY2tf ZW5kID0gY2xvY2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gorICAgICBOU0NvbG9yICpteV9jb2xvciA9 IFtOU0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6IDEuMAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JlZW46IDEuMAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJsdWU6IDEuMAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwaGE6IDEuMF07 CisgIC0gIEFMVEVSTkFUSVZFIEVYQU1QTEU6CisgICAgIGVudW0gZmFjZV9pZCBkZWJ1Z2dpbmdf ZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlIChzLT53LCBzLT5mLCBpbnRlcm4gKCIrLWRlYnVn Z2luZy1mYWNlIiksIHRydWUpOworICAgICBzdHJ1Y3QgZmFjZSAqZGVidWdnaW5nX2ZhY2UgPSBG QUNFX0ZST01fSUQgKHMtPmYsIGRlYnVnZ2luZ19mYWNlX2lkKTsKKyAgICAgTlNDb2xvciAqY29s b3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChkZWJ1Z2dp bmdfZmFjZSksIHMtPmYpOworICAgICBbY29sb3Igc2V0XTsgKi8KKyAgaWYgKGdseXBoX2ZsYXZv ciA9PSBNQ19HTFlQSAorICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBITEVTUykKKyAg ICBbW05TQ29sb3IgY29sb3JXaXRoQ2FsaWJyYXRlZFJlZDogbHNsLnJlZAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGdyZWVuOiBsc2wuZ3JlZW4KKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgYmx1ZTogbHNsLmJsdWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBhbHBoYTogMS4wXSBzZXRdOworICAgIGVsc2U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bG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoaG9sbG93X2FjdGl2 ZV9yZWdpb25fYmVnX2ZhY2UpLCBmKTsKKyAgICAgICAgICBob2xsb3dfY29sb3IgPSBob2xsb3df YWN0aXZlX3JlZ2lvbl9iZWdfY29sb3I7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAocmVn aW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9wCisgICAgICAgICAgICAg ICAgICYmIGN1cnNvcl9nbHlwaC0+Y2hhcnBvcyA9PSByZWdpb25fZW5kKQorICAgICAgICAgIHsK KyAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZV9p ZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3It YXQtcmVnaW9uLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgc3RydWN0IGZhY2Ug KmhvbGxvd19hY3RpdmVfcmVnaW9uX2VuZF9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3df YWN0aXZlX3JlZ2lvbl9lbmRfZmFjZV9pZCk7CisgICAgICAgICAgICBOU0NvbG9yICpob2xsb3df YWN0aXZlX3JlZ2lvbl9lbmRfY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFD RV9CQUNLR1JPVU5EIChob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZSksIGYpOworICAgICAg ICAgICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2NvbG9yOworICAg ICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAg ICAgICAgICAmJiBhY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICYmI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ZV9jb2xvcjsKKyAgICAgICAg ICAgICAgICB9CisgICAgfQorICAgIGVsc2UgaWYgKGZhY2UgJiYgTlNfRkFDRV9CQUNLR1JPVU5E IChmYWNlKSA9PSBuc19pbmRleF9jb2xvciAoRlJBTUVfQ1VSU09SX0NPTE9SIChmKSwgZikpCisg ICAgICB7CisgICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JP VU5EIChmYWNlKSwgZikgc2V0XTsKKyAgICAgICAgaG9sbG93X2NvbG9yID0gRlJBTUVfQ1VSU09S X0NPTE9SIChmKTsKKyAgICAgIH0KKyNpZmRlZiBOU19JTVBMX0NPQ09BCisgIE5TRGlzYWJsZVNj cmVlblVwZGF0ZXMgKCk7CisjZW5kaWYKKyAgc3dpdGNoIChjdXJzb3JfdHlwZSkKKyAgICB7Cisg ICAgICBjYXNlIE1DX05PX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGJyZWFrOworICAgICAgY2Fz ZSBNQ19OT19DVVJTT1I6CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19SSUdIVF9GUklO R0VfQklUTUFQOgorICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfTEVGVF9GUklOR0VfQklU TUFQOgorICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAgICAgICAg TlNSZWN0RmlsbCAocik7CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19GUkFNRURfQk9Y OgorICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgW2hvbGxvd19jb2xvciBzZXRdOwor ICAgICAgICBOU1JlY3RGaWxsIChOU0luc2V0UmVjdCAociwgMSwgMSkpOworICAgICAgICBbRlJB TUVfQ1VSU09SX0NPTE9SIChmKSBzZXRdOworICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNf SE9MTE9XX0JPWDoKKyAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgIFtob2xsb3dfY29s b3Igc2V0XTsKKyAgICAgICAgTlNSZWN0RmlsbCAoTlNJbnNldFJlY3QgKHIsIDEsIDEpKTsKKyAg ICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAoZikgc2V0XTsKKyAgICAgICAgYnJlYWs7CisgICAg ICBjYXNlIE1DX0hCQVI6CisgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICBicmVhazsK KyAgICAgIGNhc2UgTUNfQkFSOgorICAgICAgICBzID0gcjsKKyAgICAgICAgLyogQGxhd2xpc3Qg aXMgZm9jdXNpbmcgdGhlIGluaXRpYWwgZGV2ZWxvcG1lbnQgb2YgZmVhdHVyZSByZXF1ZXN0cwor ICAgICAgICAjMTc2ODQgYW5kICMyMjg3MyBvbiBMMlIgbGFuZ3VhZ2VzLiAqLworICAgICAgICBp ZiAoZ2x5cGhfZmxhdm9yICE9IE1DX0dMWVBICisgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3Ig IT0gTUNfR0xZUEhMRVNTKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIC8qIElmIHRoZSBjaGFy YWN0ZXIgdW5kZXIgY3Vyc29yIGlzIFIyTCwgZHJhdyB0aGUgYmFyIGN1cnNvcgorICAgICAgICAg ICAgICAgb24gdGhlIHJpZ2h0IG9mIGl0cyBnbHlwaCwgcmF0aGVyIHRoYW4gb24gdGhlIGxlZnQu ICovCisgICAgICAgICAgICBpZiAoKGN1cnNvcl9nbHlwaC0+cmVzb2x2ZWRfbGV2ZWwgJiAxKSAh PSAwKQorICAgICAgICAgICAgICBzLm9yaWdpbi54ICs9IGN1cnNvcl9nbHlwaC0+cGl4ZWxfd2lk dGggLSBzLnNpemUud2lkdGg7CisgICAgICAgICAgfQorICAgICAgICBOU1JlY3RGaWxsIChzKTsK KyAgICAgICAgYnJlYWs7CisgICAgfQorICBuc19yZXNldF9jbGlwcGluZyAoZik7CisgIC8qIGRy YXcgdGhlIGNoYXJhY3RlciB1bmRlciB0aGUgY3Vyc29yICovCisgIGlmIChnbHlwaF9mbGF2b3Ig IT0gTUNfR0xZUEhMRVNTCisgICAgICAmJiAoY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWAor ICAgICAgICAgIHx8IGN1cnNvcl90eXBlID09IE1DX0ZJTExFRF9CT1gKKyAgICAgICAgICB8fCBj dXJzb3JfdHlwZSA9PSBNQ19IT0xMT1dfQk9YCisgICAgICAgICAgfHwgKGRlYnVnX3AKKyAgICAg ICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gTUNfSEJBUikKKyAgICAgICAgICB8fCAoZGVidWdf cAorICAgICAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19CQVIpKSkKKyAgICB7CisgICAg ICAvKiBgY3Vyc29yX2djX3BgIGlzIHVzZWQgb25seSBieSBgdzMydGVybS5jYCBhbmQgYHh0ZXJt LmMnLiAqLworICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IGZhbHNlOworICAgICAgY29uc3QgRW1h Y3NfUmVjdGFuZ2xlICpzYXZlZF9jbGlwID0gTlVMTDsKKyAgICAgIGlmIChyb3ctPmNsaXAgIT0g TlVMTCkKKyAgICAgICAgeworICAgICAgICAgIHNhdmVkX2NsaXAgPSByb3ctPmNsaXA7CisgICAg ICAgICAgcm93LT5jbGlwID0gTlVMTDsKKyAgICAgICAgfQorICAgICAgbWNfZHJhd19jdXJzb3Jf Z2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywgbHNsLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdk LCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOworICAgICAgaWYgKHNhdmVkX2NsaXAgIT0gTlVMTCkK KyAgICAgICAgcm93LT5jbGlwID0gc2F2ZWRfY2xpcDsKKyAgICB9CisjaWZkZWYgTlNfSU1QTF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GVsc2UgaWYgKHMtPmZhY2UtPnVuZGVybGlu ZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBOU1Jl Y3QgcjsKKyAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgdGhpY2tuZXNzLCBwb3NpdGlvbjsKKyAg ICAgICAgICAgIC8qIElmIHRoZSBwcmV2IHdhcyB1bmRlcmxpbmVkLCBtYXRjaCBpdHMgYXBwZWFy YW5jZS4gKi8KKyAgICAgICAgICAgIGlmIChzLT5wcmV2ICYmIHMtPnByZXYtPmZhY2UtPnVuZGVy bGluZV9wCisgICAgICAgICAgICAgICAgJiYgcy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUg PT0gRkFDRV9VTkRFUl9MSU5FCisgICAgICAgICAgICAgICAgJiYgcy0+cHJldi0+dW5kZXJsaW5l X3RoaWNrbmVzcyA+IDApCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB0aGlja25l c3MgPSBzLT5wcmV2LT51bmRlcmxpbmVfdGhpY2tuZXNzOworICAgICAgICAgICAgICAgIHBvc2l0 aW9uID0gcy0+cHJldi0+dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICB9CisgICAg ICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBzdHJ1 Y3QgZm9udCAqZm9udDsKKyAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZGVzY2VudDsK KyAgICAgICAgICAgICAgICAgIGZvbnQ9cy0+Zm9udDsKKyAgICAgICAgICAgICAgICAgIGRlc2Nl bnQgPSBzLT55ICsgcy0+aGVpZ2h0IC0gcy0+eWJhc2U7CisgICAgICAgICAgICAgICAgICAvKiBV c2UgdW5kZXJsaW5lIHRoaWNrbmVzcyBvZiBmb250LCBkZWZhdWx0aW5nIHRvIDEuICovCisgICAg ICAgICAgICAgICAgICB0aGlja25lc3MgPSAoZm9udCAmJiBmb250LT51bmRlcmxpbmVfdGhpY2tu ZXNzID4gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZm9udC0+dW5kZXJsaW5l X3RoaWNrbmVzcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAxOworICAgICAgICAg ICAgICAgICAgLyogRGV0ZXJtaW5lIHRoZSBvZmZzZXQgb2YgdW5kZXJsaW5pbmcgZnJvbSB0aGUg YmFzZWxpbmUuICovCisgICAgICAgICAgICAgICAgICBpZiAoeF91bmRlcmxpbmVfYXRfZGVzY2Vu dF9saW5lKQorICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IGRlc2NlbnQgLSB0aGlja25l c3M7CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHhfdXNlX3VuZGVybGluZV9wb3NpdGlv bl9wcm9wZXJ0aWVzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGZvbnQgJiYgZm9u dC0+dW5kZXJsaW5lX3Bvc2l0aW9uID49IDApCisgICAgICAgICAgICAgICAgICAgICAgcG9zaXRp b24gPSBmb250LT51bmRlcmxpbmVfcG9zaXRpb247CisgICAgICAgICAgICAgICAgICAgICAgZWxz ZSBpZiAoZm9udCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gbHJvdW5kIChm b250LT5kZXNjZW50IC8gMik7CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAg ICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0Owor ICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBtYXggKHBvc2l0aW9uLCB1bmRlcmxpbmVfbWlu aW11bV9vZmZzZXQpOworICAgICAgICAgICAgICAgICAgLyogRW5zdXJlIHVuZGVybGluaW5nIGlz IG5vdCBjcm9wcGVkLiAqLworICAgICAgICAgICAgICAgICAgaWYgKGRlc2NlbnQgPD0gcG9zaXRp b24pCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlv biA9IGRlc2NlbnQgLSAxOworICAgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IDE7Cisg ICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoZGVzY2Vu dCA8IHBvc2l0aW9uICsgdGhpY2tuZXNzKQorICAgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVz cyA9IDE7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgcy0+dW5kZXJsaW5lX3RoaWNr bmVzcyA9IHRoaWNrbmVzczsKKyAgICAgICAgICAgIHMtPnVuZGVybGluZV9wb3NpdGlvbiA9IHBv c2l0aW9uOworICAgICAgICAgICAgciA9IE5TTWFrZVJlY3QgKHgsIHMtPnliYXNlICsgcG9zaXRp b24sIHdpZHRoLCB0aGlja25lc3MpOworICAgICAgICAgICAgaWYgKGZhY2UtPnVuZGVybGluZV9k ZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsKKyAgICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoZmFjZS0+ dW5kZXJsaW5lX2NvbG9yLCBzLT5mKSBzZXRdOworICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7 CisgICAgICAgICAgfQorICAgIH0KKyAgLyogRG8gb3ZlcmxpbmUuIFdlIGZvbGxvdyBvdGhlciB0 ZXJtcyBpbiB1c2luZyBhIHRoaWNrbmVzcyBvZiAxCisgICAgIGFuZCBpZ25vcmluZyBvdmVybGlu ZV9tYXJnaW4uICovCisgIGlmIChmYWNlLT5vdmVybGluZV9wKQorICAgIHsKKyAgICAgIE5TUmVj dCByOworICAgICAgciA9IE5TTWFrZVJlY3QgKHgsIHMtPnksIHdpZHRoLCAxKTsKKyAgICAgIGlm IChmYWNlLT5vdmVybGluZV9jb2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgW2RlZmF1bHRDb2wg c2V0XTsKKyAgICAgICAgZWxzZQorICAgICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAo ZmFjZS0+b3ZlcmxpbmVfY29sb3IsIHMtPmYpIHNldF07CisgICAgICBOU1JlY3RGaWxsIChyKTsK KyAgICB9CisgIC8qIERvIHN0cmlrZS10aHJvdWdoLiAgV2UgZm9sbG93IG90aGVyIHRlcm1zIGZv ciB0aGlja25lc3MgYW5kCisgICAgIHZlcnRpY2FsIHBvc2l0aW9uLiovCisgIGlmIChmYWNlLT5z dHJpa2VfdGhyb3VnaF9wKQorICAgIHsKKyAgICAgIE5TUmVjdCByOworICAgICAgdW5zaWduZWQg bG9uZyBkeTsKKyAgICAgIGR5ID0gbHJpbnQgKChzLT5oZWlnaHQgLSAxKSAvIDIpOworICAgICAg ciA9IE5TTWFrZVJlY3QgKHgsIHMtPnkgKyBkeSwgd2lkdGgsIDEpOworICAgICAgaWYgKGZhY2Ut PnN0cmlrZV90aHJvdWdoX2NvbG9yX2RlZmF1bHRlZF9wKQorICAgICAgICBbZGVmYXVsdENvbCBz ZXRdOworICAgICAgICBlbHNlCisgICAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChm YWNlLT5zdHJpa2VfdGhyb3VnaF9jb2xvciwgcy0+Zikgc2V0XTsKKyAgICAgIE5TUmVjdEZpbGwg KHIpOworICAgIH0KK30KKworc3RhdGljIHZvaWQKK21jX25zX2R1bXBnbHlwaHNfc3RyZXRjaCAo c3RydWN0IGdseXBoX3N0cmluZyAqcywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LAorICAg ICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCB3ZCkKK3sK KyAgTlNSZWN0IHJbMl07CisgIGludCBuLCBpOworICBzdHJ1Y3QgZmFjZSAqZmFjZTsKKyAgTlND b2xvciAqZmdDb2wsICpiZ0NvbDsKKyAgaWYgKCFzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wKQorICAg IHsKKyAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgcik7CisgICAg ICAqciA9IE5TTWFrZVJlY3QgKHMtPngsIHMtPnksIHMtPmJhY2tncm91bmRfd2lkdGgsIHMtPmhl aWdodCk7CisgICAgICBpZiAoIW5zX2NsaXBfdG9fcmVjdCAocy0+ZiwgciwgbikpCisgICAgICAg IHJldHVybjsKKyAgICAgIGlmIChzLT5obCA9PSBEUkFXX01PVVNFX0ZBQ0UpCisgICAgICAgIHsK KyAgICAgICAgICBmYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBNT1VTRV9ITF9JTkZPIChzLT5m KS0+bW91c2VfZmFjZV9mYWNlX2lkKTsKKyAgICAgICAgICBpZiAoIWZhY2UpCisgICAgICAgICAg ICBmYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBNT1VTRV9GQUNFX0lEKTsKKyAgICAgICAgfQor ICAgICAgICBlbHNlCisgICAgICAgICBmYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBzLT5maXJz dF9nbHlwaC0+ZmFjZV9pZCk7CisgICAgICBiZ0NvbCA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9y IChOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpLCBzLT5mKTsKKyAgICAgIGZnQ29sID0gbnNfbG9v a3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoZmFjZSksIHMtPmYpOworICAg ICAgZm9yIChpID0gMDsgaSA8IG47ICsraSkKKyAgICAgICAgeworICAgICAgICAgIGlmICghcy0+ cm93LT5mdWxsX3dpZHRoX3ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGludCBvdmVy cnVuLCBsZWZ0b3ZlcnJ1bjsKKyAgICAgICAgICAgICAgLyogdHJ1bmNhdGUgdG8gYXZvaWQgb3Zl cndyaXRpbmcgZnJpbmdlIGFuZC9vciBzY3JvbGxiYXIgKi8KKyAgICAgICAgICAgICAgb3ZlcnJ1 biA9IG1heCAoMCwgKHMtPnggKyBzLT5iYWNrZ3JvdW5kX3dpZHRoKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgLSAoV0lORE9XX0JPWF9SSUdIVF9FREdFX1ggKHMtPncpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAtIFdJTkRPV19SSUdIVF9GUklOR0VfV0lEVEggKHMt PncpKSk7CisgICAgICAgICAgICAgICAgICAgIHJbaV0uc2l6ZS53aWR0aCAtPSBvdmVycnVuOwor ICAgICAgICAgICAgICAvKiB0cnVuY2F0ZSB0byBhdm9pZCBvdmVyd3JpdGluZyB0byBsZWZ0IG9m IHRoZSB3aW5kb3cgYm94ICovCisgICAgICAgICAgICAgIGxlZnRvdmVycnVuID0gKFdJTkRPV19C T1hfTEVGVF9FREdFX1ggKHMtPncpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgV0lO RE9XX0xFRlRfRlJJTkdFX1dJRFRIIChzLT53KSkgLSBzLT54OworICAgICAgICAgICAgICBpZiAo bGVmdG92ZXJydW4gPiAwKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIHJb aV0ub3JpZ2luLnggKz0gbGVmdG92ZXJydW47CisgICAgICAgICAgICAgICAgICByW2ldLnNpemUu d2lkdGggLT0gbGVmdG92ZXJydW47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAv KiBYWFg6IFRyeSB0byB3b3JrIGJldHdlZW4gcHJvYmxlbSB3aGVyZSBhIHN0cmV0Y2ggZ2x5cGgg b24KKyAgICAgICAgICAgICAgICAgYSBwYXJ0aWFsbHktdmlzaWJsZSBib3R0b20gcm93IHdpbGwg Y2xlYXIgcGFydCBvZiB0aGUKKyAgICAgICAgICAgICAgICAgbW9kZWxpbmUsIGFuZCBhbm90aGVy IHdoZXJlIGxpc3QtYnVmZmVycyBoZWFkZXJzIGFuZCBzaW1pbGFyCisgICAgICAgICAgICAgICAg IHJvd3MgZXJyb25lb3VzbHkgaGF2ZSB2aXNpYmxlX2hlaWdodCBzZXQgdG8gMC4gIE5vdCBzdXJl CisgICAgICAgICAgICAgICAgIHdoZXJlIHRoaXMgaXMgY29taW5nIGZyb20gYXMgb3RoZXIgdGVy bXMgc2VlbSBub3QgdG8gc2hvdy4gKi8KKyAgICAgICAgICAgICAgcltpXS5zaXplLmhlaWdodCA9 IG1pbiAocy0+aGVpZ2h0LCBzLT5yb3ctPnZpc2libGVfaGVpZ2h0KTsKKyAgICAgICAgICAgIH0K KyAgICAgICAgICBbYmdDb2wgc2V0XTsKKyAgICAgICAgICAvKiBOT1RFOiB1bmRlciBOUyB0aGlz IGlzIE5PVCB1c2VkIHRvIGRyYXcgY3Vyc29ycywgYnV0IHdlIG11c3QgYXZvaWQKKyAgICAgICAg ICAgICBvdmVyd3JpdGluZyBjdXJzb3IgKHVzdWFsbHkgd2hlbiBjdXJzb3Igb24gYSB0YWIpICov CisgICAgICAgICAgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SKQorICAgICAgICAgICAgeworICAg ICAgICAgICAgICAvKiBGSVhNRTogIERvIHdlIHN0aWxsIG5lZWQgdG8gcHJldmVudCB0aGlzIHNl Y3Rpb24gb2YgY29kZSBmcm9tCisgICAgICAgICAgICAgIGVyYXNpbmcgdGhlIGZha2UgTUNfSEJB UiB0aGF0IGV4dGVuZHMgdGhlIGVudGlyZSBsZW5ndGggb2YgdGhlCisgICAgICAgICAgICAgIFNU UkVUQ0hfR0xZUEg/ICBUaGlzIG1heSBoYXZlIGJlZW4gZG9uZSBwcmlvciB0byB0aGUgZml4IHJl bGF0aW5nCisgICAgICAgICAgICAgIHRvIGxlZnQvcmlnaHQgb3ZlcndyaXR0ZW4gZ2x5cGhzLiAq LworICAgICAgICAgICAgICByW2ldLnNpemUuaGVpZ2h0IC09IDE7CisgICAgICAgICAgICAgIC8v ICBlbnVtIGZhY2VfaWQgZGVidWdnaW5nX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+ dywgcy0+ZiwgaW50ZXJuICgiKy1kZWJ1Z2dpbmctZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAg ICAgLy8gIHN0cnVjdCBmYWNlICpkZWJ1Z2dpbmdfZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+Ziwg ZGVidWdnaW5nX2ZhY2VfaWQpOworICAgICAgICAgICAgICAvLyAgTlNDb2xvciAqY29sb3IgPSBu c19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChkZWJ1Z2dpbmdfZmFj ZSksIHMtPmYpOworICAgICAgICAgICAgICAvLyAgW2NvbG9yIHNldF07CisgICAgICAgICAgICAg IENHRmxvYXQgeCA9IHJbaV0ub3JpZ2luLng7CisgICAgICAgICAgICAgIENHRmxvYXQgd2lkdGgg PSB3ZDsKKyAgICAgICAgICAgICAgcltpXS5zaXplLndpZHRoIC09IHdpZHRoOworICAgICAgICAg ICAgICByW2ldLm9yaWdpbi54ICs9IHdpZHRoOworICAgICAgICAgICAgICBOU1JlY3RGaWxsIChy W2ldKTsKKyAgICAgICAgICAgICAgLyogRHJhdyBvdmVybGluaW5nLCBldGMuIG9uIHRoZSBjdXJz b3IuICovCisgICAgICAgICAgICAgIGlmIChzLT53LT5waHlzX2N1cnNvcl90eXBlID09IE1DX0ZJ TExFRF9CT1gpCisgICAgICAgICAgICAgICAgbWNfbnNfZHJhd190ZXh0X2RlY29yYXRpb24gKHMs IGZhY2UsIGJnQ29sLCB3aWR0aCwgeCk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAg ICAgICAgICAgbWNfbnNfZHJhd190ZXh0X2RlY29yYXRpb24gKHMsIGZhY2UsIGZnQ29sLCB3aWR0 aCwgeCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAv LyAgaW50IHJ4ID0gcltpXS5vcmlnaW4ueDsKKyAgLy8gIGludCByeSA9IHJbaV0ub3JpZ2luLnk7 CisgIC8vICBpbnQgcncgPSByW2ldLnNpemUud2lkdGg7CisgIC8vICBpbnQgcmggPSByW2ldLnNp emUuaGVpZ2h0OworICAvLyAgZnByaW50ZiAoc3RkZXJyLCAibWNfbnNfZHVtcGdseXBoc19zdHJl dGNoOiAgdnBvcyAoJWQpIHwgcnggKCVkKSB8IHJ5ICglZCkgfCBydyAoJWQpIHwgcmggKCVkKVxu IiwKKyAgLy8gICAgICAgICAgICAgICAgICAgcy0+Zmlyc3RfZ2x5cGgtPnZwb3MsIHJ4LCByeSwg cncsIHJoKTsKKyAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocltpXSk7CisgICAgICAgICAgICB9 CisgICAgICAgICAgLyogRHJhdyBvdmVybGluaW5nLCBldGMuIG9uIHRoZSBzdHJldGNoIGdseXBo IChvciB0aGUgcGFydAorICAgICAgICAgICAgIG9mIHRoZSBzdHJldGNoIGdseXBoIGFmdGVyIHRo ZSBjdXJzb3IpLiAqLworICAgICAgICAgIG1jX25zX2RyYXdfdGV4dF9kZWNvcmF0aW9uIChzLCBm YWNlLCBmZ0NvbCwgcltpXS5zaXplLndpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICByW2ldLm9yaWdpbi54KTsKKyAgICAgICAgfQorICAgICAgaWYgKChzLT5sZWZ0 X292ZXJ3cml0dGVuX3AgfHwgcy0+cmlnaHRfb3ZlcndyaXR0ZW5fcCkKKyAgICAgICAgICAmJiAo cy0+YWN0aW9uX3R5cGUgPT0gTUNfRFJBV19HTFlQSF9TVFJJTkd8fCBzLT5hY3Rpb25fdHlwZSA9 PSBNQ19FUkFTRV9HTFlQSF9TVFJJTkcpKQorICAgICAgICBtY19uc19kcmF3X292ZXJ3cml0dGVu IChzLCBtYXRyaXgsIHJvdywgcy0+Z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ICAgICAgICAgICAgICAgcy0+c2xpY2Uud2lkdGgs IHMtPnNsaWNlLmhlaWdodCk7CisgICAgICBbaW1nIGRyYXdJblJlY3Q6IGRyCisgICAgICAgICAg ICAgZnJvbVJlY3Q6IGlyCisgICAgICAgICAgICAgb3BlcmF0aW9uOiBOU0NvbXBvc2l0ZVNvdXJj ZU92ZXIKKyAgICAgICAgICAgICAgZnJhY3Rpb246IDEuMAorICAgICAgICAgICByZXNwZWN0Rmxp cHBlZDogWUVTCisgICAgICAgICAgICAgICAgaGludHM6IG5pbF07CisjZWxzZQorICAgICAgW2lt ZyBjb21wb3NpdGVUb1BvaW50OiBOU01ha2VQb2ludCAoeCwgeSArIHMtPnNsaWNlLmhlaWdodCkK KyAgICAgICAgICAgICAgICAgIG9wZXJhdGlvbjogTlNDb21wb3NpdGVTb3VyY2VPdmVyXTsKKyNl bmRpZgorICAgIH0KKyAgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SKQorICAgIHsKKyAgICAgIFtG UkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpIHNldF07CisgICAgICBpZiAocy0+dy0+cGh5c19jdXJz b3JfdHlwZSA9PSBNQ19GSUxMRURfQk9YKQorICAgICAgICB0ZENvbCA9IG5zX2xvb2t1cF9pbmRl eGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpLCBzLT5mKTsKKyAgICAgICAgZWxz ZQorICAgICAgICAgIC8qIEN1cnJlbnRseSBvbiBOUyBpbWctPm1hc2sgaXMgYWx3YXlzIDAuIFNp bmNlCisgICAgICAgICAgICAgZ2V0X3dpbmRvd19jdXJzb3JfdHlwZSBzcGVjaWZpZXMgYSBob2xs b3cgYm94IGN1cnNvciB3aGVuIG9uCisgICAgICAgICAgICAgYSBub24tbWFza2VkIGltYWdlIHdl IG5ldmVyIHJlYWNoIHRoaXMgY2xhdXNlLiBCdXQgd2UgcHV0IGl0CisgICAgICAgICAgICAgaW4g aW4gYW50aWNpcGF0aW9uIG9mIGJldHRlciBzdXBwb3J0IGZvciBpbWFnZSBtYXNrcyBvbiBOUy4g Ki8KKyAgICAgICAgICB0ZENvbCA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZP UkVHUk9VTkQgKGZhY2UpLCBzLT5mKTsKKyAgICB9CisgICAgZWxzZQorICAgICAgdGRDb2wgPSBu c19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChmYWNlKSwgcy0+Zik7 CisgIC8qIERyYXcgdW5kZXJsaW5lLCBvdmVybGluZSwgc3RyaWtlLXRocm91Z2guICovCisgIG1j X25zX2RyYXdfdGV4dF9kZWNvcmF0aW9uIChzLCBmYWNlLCB0ZENvbCwgYnIuc2l6ZS53aWR0aCwg YnIub3JpZ2luLngpOworICAvKiBEcmF3IHJlbGllZiwgaWYgcmVxdWVzdGVkICovCisgIGlmIChz LT5pbWctPnJlbGllZiB8fCBzLT5obCA9PURSQVdfSU1BR0VfUkFJU0VEIHx8IHMtPmhsID09RFJB V19JTUFHRV9TVU5LRU4pCisgICAgeworICAgICAgaWYgKHMtPmhsID09IERSQVdfSU1BR0VfU1VO S0VOIHx8IHMtPmhsID09IERSQVdfSU1BR0VfUkFJU0VEKQorICAgICAgICB7CisgICAgICAgICAg dGggPSB0b29sX2Jhcl9idXR0b25fcmVsaWVmID49IDAgPworICAgICAgICAgICAgdG9vbF9iYXJf YnV0dG9uX3JlbGllZiA6IERFRkFVTFRfVE9PTF9CQVJfQlVUVE9OX1JFTElFRjsKKyAgICAgICAg ICByYWlzZWRfcCA9IChzLT5obCA9PSBEUkFXX0lNQUdFX1JBSVNFRCk7CisgICAgICAgIH0KKyAg ICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIHRoID0gYWJzIChzLT5pbWctPnJl bGllZik7CisgICAgICAgICAgICByYWlzZWRfcCA9IChzLT5pbWctPnJlbGllZiA+IDApOworICAg ICAgICAgIH0KKyAgICAgIHIub3JpZ2luLnggPSB4IC0gdGg7CisgICAgICByLm9yaWdpbi55ID0g eSAtIHRoOworICAgICAgci5zaXplLndpZHRoID0gcy0+c2xpY2Uud2lkdGggKyAyKnRoLTE7Cisg ICAgICByLnNpemUuaGVpZ2h0ID0gcy0+c2xpY2UuaGVpZ2h0ICsgMip0aC0xOworICAgICAgbnNf ZHJhd19yZWxpZWYgKHIsIHRoLCByYWlzZWRfcCwKKyAgICAgICAgICAgICAgICAgICAgICBzLT5z bGljZS55ID09IDAsCisgICAgICAgICAgICAgICAgICAgICAgcy0+c2xpY2UueSArIHMtPnNsaWNl LmhlaWdodCA9PSBzLT5pbWctPmhlaWdodCwKKyAgICAgICAgICAgICAgICAgICAgICBzLT5zbGlj ZS54ID09IDAsCisgICAgICAgICAgICAgICAgICAgICAgcy0+c2xpY2UueCArIHMtPnNsaWNlLndp ZHRoID09IHMtPmltZy0+d2lkdGgsIHMpOworICAgIH0KKyAgLyogSWYgdGhlcmUgaXMgbm8gbWFz aywgdGhlIGJhY2tncm91bmQgd29uJ3QgYmUgc2VlbiwKKyAgICAgc28gZHJhdyBhIHJlY3Rhbmds ZSBvbiB0aGUgaW1hZ2UgZm9yIHRoZSBjdXJzb3IuCisgICAgIERvIHRoaXMgZm9yIGFsbCBpbWFn ZXMsIGdldHRpbmcgdHJhbnNwYXJlbmN5IHJpZ2h0IGlzIG5vdCByZWxpYWJsZS4gKi8KKyAgaWYg KHMtPmhsID09IERSQVdfQ1VSU09SKQorICAgIHsKKyAgICAgIGludCB0aGlja25lc3MgPSBhYnMg KHMtPmltZy0+cmVsaWVmKTsKKyAgICAgIGlmICh0aGlja25lc3MgPT0gMCkgdGhpY2tuZXNzID0g MTsKKyAgICBpZiAoZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBICisgICAgICAgIHx8IGdseXBoX2Zs YXZvciA9PSBNQ19HTFlQSExFU1MpCisgICAgICB7CisgICAgICAgIE5TQ29sb3IgKmJvcmRlcl9j b2xvciA9IFtOU0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6IGxzbC5yZWQKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBncmVlbjog bHNsLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGJsdWU6IGxzbC5ibHVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwaGE6IDEuMF07CisgICAgICAgIG5zX2Ry YXdfYm94IChiciwgdGhpY2tuZXNzLCBib3JkZXJfY29sb3IsIDEsIDEpOworICAgICAgfQorICAg ICAgZWxzZQorICAgICAgICBuc19kcmF3X2JveCAoYnIsIHRoaWNrbmVzcywgRlJBTUVfQ1VSU09S X0NPTE9SIChzLT5mKSwgMSwgMSk7CisgICAgfQorfQorCitzdGF0aWMgdm9pZAorbWNfbnNfbWF5 YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzLCBjaGFyIGZv cmNlX3ApCit7CisgIE5TVFJBQ0UgKCJtY19uc19tYXliZV9kdW1wZ2x5cGhzX2JhY2tncm91bmQi KTsKKyAgaWYgKCFzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wLyogfHwgcy0+aGwgPT0gRFJBV19NT1VT RV9GQUNFKi8pCisgICAgeworICAgICAgaW50IGJveF9saW5lX3dpZHRoID0gbWF4IChzLT5mYWNl LT5ib3hfbGluZV93aWR0aCwgMCk7CisgICAgICBpZiAoRk9OVF9IRUlHSFQgKHMtPmZvbnQpIDwg cy0+aGVpZ2h0IC0gMiAqIGJveF9saW5lX3dpZHRoCisgICAgICAgICAgLyogV2hlbiB4ZGlzcC5j IGlnbm9yZXMgRk9OVF9IRUlHSFQsIHdlIGNhbm5vdCB0cnVzdCBmb250CisgICAgICAgICAgICAg ZGltZW5zaW9ucywgc2luY2UgdGhlIGFjdHVhbCBnbHlwaHMgbWlnaHQgYmUgbXVjaAorICAgICAg ICAgICAgIHNtYWxsZXIuICBTbyBpbiB0aGF0IGNhc2Ugd2UgYWx3YXlzIGNsZWFyIHRoZSByZWN0 YW5nbGUKKyAgICAgICAgICAgICB3aXRoIGJhY2tncm91bmQgY29sb3IuICovCisgICAgICAgICAg fHwgRk9OVF9UT09fSElHSCAocy0+Zm9udCkKKyAgICAgICAgICB8fCBzLT5mb250X25vdF9mb3Vu ZF9wIHx8IHMtPmV4dGVuZHNfdG9fZW5kX29mX2xpbmVfcCB8fCBmb3JjZV9wKQorICAgICAgICB7 CisgICAgICAgICAgc3RydWN0IGZhY2UgKmZhY2U7CisgICAgICAgICAgaWYgKHMtPmhsID09IERS QVdfTU9VU0VfRkFDRSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgZmFjZSA9IEZBQ0Vf RlJPTV9JRCAocy0+ZiwgTU9VU0VfSExfSU5GTyAocy0+ZiktPm1vdXNlX2ZhY2VfZmFjZV9pZCk7 CisgICAgICAgICAgICAgIGlmICghZmFjZSkKKyAgICAgICAgICAgICAgICBmYWNlID0gRkFDRV9G Uk9NX0lEIChzLT5mLCBNT1VTRV9GQUNFX0lEKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgICAgZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+Ziwgcy0+Zmlyc3Rf Z2x5cGgtPmZhY2VfaWQpOworICAgICAgICAgIGlmICghZmFjZS0+c3RpcHBsZSkKKyAgICAgICAg ICAgIFsoTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKSAhPSAwCisgICAgICAgICAgICAgID8gbnNf bG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoZmFjZSksIHMtPmYpCisg ICAgICAgICAgICAgIDogRlJBTUVfQkFDS0dST1VORF9DT0xPUiAocy0+ZikpIHNldF07CisgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzdHJ1Y3QgbnNf ZGlzcGxheV9pbmZvICpkcHlpbmZvID0gRlJBTUVfRElTUExBWV9JTkZPIChzLT5mKTsKKyAgICAg ICAgICAgICAgICBbW2RweWluZm8tPmJpdG1hcHNbZmFjZS0+c3RpcHBsZS0xXS5pbWcgc3RpcHBs ZU1hc2tdIHNldF07CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICBpZiAocy0+aGwgIT0gRFJB V19DVVJTT1IpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHMtPnJlY3RhbmdsZV9udWtl ZF9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgTlNSZWN0IHIgPSBOU01ha2VSZWN0IChzLT54LCBz LT55ICsgYm94X2xpbmVfd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBzLT5iYWNrZ3JvdW5kX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgcy0+aGVpZ2h0LTIqYm94X2xpbmVfd2lkdGgpOworICAgICAgICAgICAgICBOU1JlY3RGaWxs IChyKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wID0g MTsKKyAgICAgICAgfQorICAgIH0KK30KKworc3RhdGljIHZvaWQKK21jX25zX2RyYXdfZ2x5cGhf c3RyaW5nIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRy aXgsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1 Y3QgbWNfUkdCIGxzbCwgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yLAorICAgICAgICAgICAg ICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUsCisgIC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HlwaC0+dHlwZSAhPSBTVFJFVENIX0dMWVBIKQorICAgICAgICAg ICAgICB7CisgICAgICAgICAgICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0 IChzLT5uZXh0LCByKTsKKyAgICAgICAgICAgICAgICBpZiAoIW5zX2NsaXBfdG9fcmVjdCAocy0+ ZiwgciwgbikpCisgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgbWNf bnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzLT5uZXh0LCAxKTsKKyAgICAgICAgICAg ICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgICAgZWxzZQorICAgICAgICAgICAgICAgIG1jX25zX2R1bXBnbHlwaHNfc3RyZXRjaCAocy0+ bmV4dCwgbWF0cml4LCByb3csIHdkKTsKKyAgICAgICAgICAgIG5leHQtPm51bV9jbGlwcyA9IDA7 CisgICAgICAgICAgfQorICAgIH0KKyAgaWYgKCFzLT5mb3Jfb3ZlcmxhcHMgJiYgcy0+ZmFjZS0+ Ym94ICE9IEZBQ0VfTk9fQk9YCisgICAgICAmJiAocy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hB Ul9HTFlQSAorICAgICAgICAgIHx8IHMtPmZpcnN0X2dseXBoLT50eXBlID09IENPTVBPU0lURV9H TFlQSCkpCisgICAgeworICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChz LCByKTsKKyAgICAgIGlmICghbnNfY2xpcF90b19yZWN0IChzLT5mLCByLCBuKSkKKyAgICAgICAg cmV0dXJuOworICAgICAgbWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzLCAxKTsK KyAgICAgIG5zX2R1bXBnbHlwaHNfYm94X29yX3JlbGllZiAocyk7CisgICAgICBuc19yZXNldF9j bGlwcGluZyAocy0+Zik7CisgICAgICBib3hfZHJhd25fcCA9IDE7CisgICAgfQorICBzd2l0Y2gg KHMtPmZpcnN0X2dseXBoLT50eXBlKQorICAgIHsKKyAgICBjYXNlIElNQUdFX0dMWVBIOgorICAg ICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAgICAgIGlmICgh bnNfY2xpcF90b19yZWN0IChzLT5mLCByLCBuKSkKKyAgICAgICAgcmV0dXJuOworICAgICAgbWNf bnNfZHVtcGdseXBoc19pbWFnZSAocywgclswXSwgbHNsLCBnbHlwaF9mbGF2b3IsIGN1cnNvcl90 eXBlLCBhY3RpdmVfcCk7CisgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICBi cmVhazsKKyAgICBjYXNlIFNUUkVUQ0hfR0xZUEg6CisgICAgICBtY19uc19kdW1wZ2x5cGhzX3N0 cmV0Y2ggKHMsIG1hdHJpeCwgcm93LCB3ZCk7CisgICAgICBicmVhazsKKyAgICBjYXNlIENIQVJf R0xZUEg6CisgICAgY2FzZSBDT01QT1NJVEVfR0xZUEg6CisgICAgICBuID0gbnNfZ2V0X2dseXBo X3N0cmluZ19jbGlwX3JlY3QgKHMsIHIpOworICAgICAgaWYgKCFuc19jbGlwX3RvX3JlY3QgKHMt PmYsIHIsIG4pKQorICAgICAgICByZXR1cm47CisgICAgICBpZiAocy0+Zm9yX292ZXJsYXBzCisg ICAgICAgICAgfHwgKHMtPmNtcF9mcm9tID4gMAorICAgICAgICAgICAgICAmJiAhIHMtPmZpcnN0 X2dseXBoLT51LmNtcC5hdXRvbWF0aWMpKQorICAgICAgICBzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9w ID0gMTsKKyAgICAgICAgZWxzZQorICAgICAgICAgIG1jX25zX21heWJlX2R1bXBnbHlwaHNfYmFj a2dyb3VuZCAocywgcy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKTsKKyAg ICAgIGludCBmbGFncyA9IChzLT5obCA9PSBEUkFXX0NVUlNPUikKKyAgICAgICAgICAgICAgICAg ICAgPyBOU19EVU1QR0xZUEhfQ1VSU09SCisgICAgICAgICAgICAgICAgICA6IChzLT5obCA9PSBE UkFXX01PVVNFX0ZBQ0UpCisgICAgICAgICAgICAgICAgICAgID8gTlNfRFVNUEdMWVBIX01PVVNF RkFDRQorICAgICAgICAgICAgICAgICAgOiAocy0+Zm9yX292ZXJsYXBzKQorICAgICAgICAgICAg ICAgICAgICA/IE5TX0RVTVBHTFlQSF9GT1JFR1JPVU5ECisgICAgICAgICAgICAgICAgICA6IE5T X0RVTVBHTFlQSF9OT1JNQUw7CisgICAgICB1bnNpZ25lZCBsb25nIHNhdmVkX2ZnID0gTlNfRkFD RV9GT1JFR1JPVU5EIChzLT5mYWNlKTsKKyAgICAgIGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUiAm JiBjdXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9YKQorICAgICAgICB7CisgICAgICAgICAgdW5z aWduZWQgbG9uZyB0bXAgPSBOU19GQUNFX0JBQ0tHUk9VTkQgKHMtPmZhY2UpOworICAgICAgICAg IE5TX0ZBQ0VfQkFDS0dST1VORCAocy0+ZmFjZSkgPSBOU19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZh Y2UpOworICAgICAgICAgIE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSkgPSB0bXA7CisgICAg ICAgIH0KKyAgICAgICAgZWxzZSBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IKKyAgICAgICAgICAg ICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWAorICAgICAgICAgICAgICAgICAm JiBhY3RpdmVfcCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93 X2FjdGl2ZV9mYWNlX2lkID0KKyAgICAgICAgICAgICAgbG9va3VwX25hbWVkX2ZhY2UgKHMtPncs IHMtPmYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsK KyAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01f SUQgKHMtPmYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICBOU19GQUNFX0ZP UkVHUk9VTkQgKHMtPmZhY2UpID0gTlNfRkFDRV9GT1JFR1JPVU5EIChob2xsb3dfYWN0aXZlX2Zh Y2UpOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmIChzLT5obCA9PSBEUkFXX0NVUlNP UgorICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl90eXBlID09IE1DX0ZSQU1FRF9CT1gKKyAg ICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkID0KKyAgICAgICAgICAgICAg ICBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vy c29yLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICBzdHJ1Y3Qg ZmFjZSAqaG9sbG93X2luYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIGhvbGxvd19p bmFjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5m YWNlKSA9IE5TX0ZBQ0VfRk9SRUdST1VORCAoaG9sbG93X2luYWN0aXZlX2ZhY2UpOworICAgICAg ICAgICAgfQorICAgICAgaWYgKHMtPmZpcnN0X2dseXBoLT50eXBlID09IENPTVBPU0lURV9HTFlQ SCkKKyAgICAgICAgbnNfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHMp OworICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCB3aXRoX2JnX3Ag PSAoKGZsYWdzID09IE5TX0RVTVBHTFlQSF9OT1JNQUwgJiYgIXMtPmJhY2tncm91bmRfZmlsbGVk X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBmbGFncyA9PSBOU19EVU1QR0xZ UEhfTU9VU0VGQUNFKTsKKyAgICAgICAgICAgIGlmICh3aXRoX2JnX3ApCisgICAgICAgICAgICAg IHMtPmJhY2tncm91bmRfbnVrZWRfcCA9IHRydWU7CisgICAgICAgICAgICBmb250LT5kcml2ZXIt PmRyYXcgKHMsIHMtPmNtcF9mcm9tLCBzLT5uY2hhcnMsIHMtPngsIHMtPnliYXNlLCB3aXRoX2Jn X3ApOworICAgICAgICAgIH0KKyAgICAgIE5TQ29sb3IgKmNvbCA9IChOU19GQUNFX0ZPUkVHUk9V TkQgKHMtPmZhY2UpICE9IDAKKyAgICAgICAgICAgICAgICAgICAgID8gbnNfbG9va3VwX2luZGV4 ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSksIHMtPmYpCisgICAgICAgICAg ICAgICAgICAgICA6IEZSQU1FX0ZPUkVHUk9VTkRfQ09MT1IgKHMtPmYpKTsKKyAgICAgIFtjb2wg c2V0XTsKKyAgICAgIC8qIERyYXcgdW5kZXJsaW5lLCBvdmVybGluZSwgc3RyaWtlLXRocm91Z2gu ICovCisgICAgICBtY19uc19kcmF3X3RleHRfZGVjb3JhdGlvbiAocywgcy0+ZmFjZSwgY29sLCBz LT53aWR0aCwgcy0+eCk7CisgICAgICBpZiAocy0+Zmlyc3RfZ2x5cGgtPnR5cGUgIT0gQ09NUE9T SVRFX0dMWVBICisgICAgICAgICAgJiYgKHMtPmxlZnRfb3ZlcndyaXR0ZW5fcCB8fCBzLT5yaWdo dF9vdmVyd3JpdHRlbl9wKQorICAgICAgICAgICYm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vcl9vdmVybGFwcworICAgICAgICAgIHx8IChzLT5jbXBfZnJvbSA+IDAKKyAgICAgICAg ICAgICAgJiYgISBzLT5maXJzdF9nbHlwaC0+dS5jbXAuYXV0b21hdGljKSkKKyAgICAgICAgcy0+ YmFja2dyb3VuZF9maWxsZWRfcCA9IDE7CisgICAgICBlbHNlCisgICAgICAgIG1jX25zX21heWJl X2R1bXBnbHlwaHNfYmFja2dyb3VuZCAocywgcy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ09NUE9T SVRFX0dMWVBIKTsKKyAgICAgIG5zX3Jlc2V0X2NsaXBwaW5nIChzLT5mKTsKKyAgICAgIGJyZWFr OworICAgIGRlZmF1bHQ6CisgICAgICBlbWFjc19hYm9ydCAoKTsKKyAgICB9CisgIC8qIERyYXcg Ym94IGlmIG5vdCBkb25lIGFscmVhZHkuICovCisgIGlmICghcy0+Zm9yX292ZXJsYXBzCisgICAg ICAmJiAhYm94X2RyYXduX3AKKyAgICAgICYmIHMtPmZhY2UtPmJveCAhPSBGQUNFX05PX0JPWCkK KyAgICB7CisgICAgICBuID0gbnNfZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsIHIpOwor ICAgICAgaWYgKCFuc19jbGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4pKQorICAgICAgICByZXR1cm47 CisgICAgICBuc19kdW1wZ2x5cGhzX2JveF9vcl9yZWxpZWYgKHMpOworICAgICAgbnNfcmVzZXRf Y2xpcHBpbmcgKHMtPmYpOworICAgIH0KKyAgcy0+bnVtX2NsaXBzID0gMDsKK30KKworLyogZW5k IE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC8qID09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09CiAKICAgIE5TVFJBQ0UsIFRyYWNlIHN1cHBvcnQuCkBAIC0xMDc5LDYg KzIwNDgsMTYgQEAgc3RhdGljIE5TUmVjdCBjb25zdHJhaW5fZnJhbWVfcmVjdChOU1JlY3QgZnJh bWVSZWN0LCBib29sIGlzRnVsbHNjcmVlbikKICAgIGV4dGVybmFsIChSSUYpIGNhbGw7IHdob2xl IGZyYW1lLCBjYWxsZWQgYmVmb3JlIGd1aV91cGRhdGVfd2luZG93X2JlZ2luCiAgICAtLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLSAqLwogeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQ TEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gZjsKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogI2lmZGVmIE5TX0lNUExfQ09DT0EKICAgRW1hY3NWaWV3ICp2 aWV3ID0gRlJBTUVfTlNfVklFVyAoZik7CiAKQEAgLTExMDksNiArMjA4OCwxNiBAQCBzdGF0aWMg TlNSZWN0IGNvbnN0cmFpbl9mcmFtZV9yZWN0KE5TUmVjdCBmcmFtZVJlY3QsIGJvb2wgaXNGdWxs c2NyZWVuKQogCiAvKiAgIGlmIChmID09IE1PVVNFX0hMX0lORk8gKGYpLT5tb3VzZV9mYWNlX21v dXNlX2ZyYW1lKSAqLwogICBNT1VTRV9ITF9JTkZPIChmKS0+bW91c2VfZmFjZV9kZWZlciA9IDA7 CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK KyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBOVUxMOworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKworCiB9CiAKIApAQCAtNDc1OSw2ICs1NzQ4LDE3IEBAIGluIGNlcnRhaW4gc2l0dWF0aW9u cyAocmFwaWQgaW5jb21pbmcgZXZlbnRzKS4KICAgICAgIGJhciA9IFtbRW1hY3NTY3JvbGxlciBh bGxvY10gaW5pdEZyYW1lOiByIHdpbmRvdzogd2luXTsKICAgICAgIHdzZXRfdmVydGljYWxfc2Ny b2xsX2JhciAod2luZG93LCBtYWtlX21pbnRfcHRyIChiYXIpKTsKICAgICAgIHVwZGF0ZV9wID0g WUVTOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAq LworCisgICAgICAvKiBUaGlzIGlzIG9ubHkgZm9yIGRlYnVnZ2luZyBwdXJwb3Nlcy4gKi8KKyAg ICAgIFtiYXIgbWNfc2V0X3JlY3RhbmdsZTogcl07CisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKICAgICB9CiAgIGVsc2UKICAgICB7CkBAIC00NzY2LDEyICs1NzY2LDMwIEBAIGluIGNl cnRhaW4gc2l0dWF0aW9ucyAocmFwaWQgaW5jb21pbmcgZXZlbnRzKS4KICAgICAgIGJhciA9IFhO U19TQ1JPTExfQkFSICh3aW5kb3ctPnZlcnRpY2FsX3Njcm9sbF9iYXIpOwogICAgICAgb2xkUmVj dCA9IFtiYXIgZnJhbWVdOwogICAgICAgci5zaXplLndpZHRoID0gb2xkUmVjdC5zaXplLndpZHRo OworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLwor CiAgICAgICBpZiAoRlJBTUVfTElWRV9QIChmKSAmJiAhTlNFcXVhbFJlY3RzIChvbGRSZWN0LCBy KSkKICAgICAgICAgeworICAgICAgICAgIC8qIFRoZSBtYWluIHdpbmRvdyBoYXMgcHJvYmFibHkg YmVlbiByZXNpemVkLiAgR3JhY2lvdXNseSBkZWxldGUgdGhlCisgICAgICAgICAgb2xkIHNjcm9s bCBiYXIgd2l0aG91dCByZXBhaW50aW5nIGl0cyByZWN0YW5nbGU7IGFuZCwgY3JlYXRlIGEgbmV3 CisgICAgICAgICAgc2Nyb2xsIGJhciBlbHNld2hlcmUuKi8KICAgICAgICAgICBpZiAob2xkUmVj dC5vcmlnaW4ueCAhPSByLm9yaWdpbi54KQorICAgICAgICAgICAgewogICAgICAgICAgICAgICBu c19jbGVhcl9mcmFtZV9hcmVhIChmLCBsZWZ0LCB0b3AsIHdpZHRoLCBoZWlnaHQpOworICAgICAg ICAgICAgICBbYmFyIG1jX2p1ZGdlXTsKKyAgICAgICAgICAgICAgYmFyID0gW1tFbWFjc1Njcm9s bGVyIGFsbG9jXSBpbml0RnJhbWU6IHIgd2luZG93OiB3aW5dOworICAgICAgICAgICAgICB3c2V0 X3ZlcnRpY2FsX3Njcm9sbF9iYXIgKHdpbmRvdywgbWFrZV9taW50X3B0ciAoYmFyKSk7CisgICAg ICAgICAgICB9CisgICAgICAgICAgICBlbHNlCiAgICAgICAgICAgW2JhciBzZXRGcmFtZTogcl07 CiAgICAgICAgIH0KKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgIH0KIAogICBp ZiAodXBkYXRlX3ApCkBAIC00OTMxLDkgKzU5NDksNTcgQEAgaW4gY2VydGFpbiBzaXR1YXRpb25z IChyYXBpZCBpbmNvbWluZyBldmVudHMpLgogICAgIHsKICAgICAgIHZpZXcgPSBbc3Vidmlld3Mg b2JqZWN0QXRJbmRleDogaV07CiAgICAgICBpZiAoIVt2aWV3IGlzS2luZE9mQ2xhc3M6IFtFbWFj c1Njcm9sbGVyIGNsYXNzXV0pIGNvbnRpbnVlOwotICAgICAgaWYgKFt2aWV3IGp1ZGdlXSkKKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAv KiBgWFNFVFdJTkRPVycgd2lsbCBzb21ldGltZXMgY2F1c2UgRW1hY3MgdG8gY3Jhc2ggd2hlbiBy dW5uaW5nIHVuZGVyIGdkYiBldmVuCisgIHRob3VnaCAodyAhPSBOVUxMKS4gIFRoZXJlZm9yZSwg d2UgY2Fubm90IHJlbGlhYmx5IHVzZSBgV0lORE9XX0xJVkVfUCcuICovCisgIHN0cnVjdCB3aW5k b3cgKncgPSBbdmlldyBtY19nZXRfd2luZG93XTsKKyAgaWYgKHcgIT0gTlVMTAorICAgICAgJiYg TklMUCAody0+Y29udGVudHMpKQorICAgIHsKKyAgICAgIEJPT0wgZGVidWdfcCA9IGZhbHNlOwor ICAgICAgaWYgKGRlYnVnX3AKKyAgICAgICAgICAvKiBgd2luZG93X2JveCcgY2FsbHMgYHdpbmRv d19ib3hfaGVpZ2h0Jywgd2hpY2ggd2lsbCBjYXVzZSBFbWFjcyB0bworICAgICAgICAgIGNyYXNo IGlmIEZSQU1FUCAody0+ZnJhbWUpIGlzIG5vdCBzYXRpc2ZpZWQuICovCisgICAgICAgICAgJiYg RlJBTUVQICh3LT5mcmFtZSkpCisgICAgICAgIHsKKyAgICAgICAgICBOU1JlY3QgcjAgPSBbdmll dyBtY19nZXRfcmVjdGFuZ2xlXTsKKyAgICAgICAgICBpbnQgeDAgPSBOU01pblggKHIwKTsKKyAg ICAgICAgICBpbnQgeTAgPSBOU01pblkgKHIwKTsKKyAgICAgICAgICBpbnQgd2QwID0gTlNXaWR0 aCAocjApOworICAgICAgICAgIGludCBoMCA9IE5TSGVpZ2h0IChyMCk7CisgICAgICAgICAgaW50 IHdpbmRvd195LCB3aW5kb3dfaGVpZ2h0OworICAgICAgICAgIHdpbmRvd19ib3ggKHcsIEFOWV9B UkVBLCAwLCAmd2luZG93X3ksIDAsICZ3aW5kb3dfaGVpZ2h0KTsKKyAgICAgICAgICBpbnQgdG9w ID0gd2luZG93X3k7CisgICAgICAgICAgaW50IGhlaWdodCA9IHdpbmRvd19oZWlnaHQ7CisgICAg ICAgICAgaW50IHdpZHRoID0gV0lORE9XX0NPTkZJR19TQ1JPTExfQkFSX0NPTFMgKHcpICogRlJB TUVfQ09MVU1OX1dJRFRIIChmKTsKKyAgICAgICAgICBpbnQgbGVmdCA9IFdJTkRPV19TQ1JPTExf QkFSX0FSRUFfWCAodyk7CisgICAgICAgICAgTlNSZWN0IHIxID0gTlNNYWtlUmVjdCAobGVmdCwg dG9wLCB3aWR0aCwgaGVpZ2h0KTsKKyAgICAgICAgICAvKiBUaGUgcGFyZW50IHZpZXcgaXMgZmxp cHBlZCwgc28gd2UgbmVlZCB0byBmbGlwIHkgdmFsdWUuICovCisgICAgICAgICAgRW1hY3NWaWV3 ICpmcmFtZV92aWV3ID0gRlJBTUVfTlNfVklFVyAoZik7CisgICAgICAgICAgTlNSZWN0IHYgPSBb ZnJhbWVfdmlldyBmcmFtZV07CisgICAgICAgICAgcjEub3JpZ2luLnkgPSAodi5zaXplLmhlaWdo dCAtIHIxLnNpemUuaGVpZ2h0IC0gcjEub3JpZ2luLnkpOworICAgICAgICAgIGludCB4MSA9IE5T TWluWCAocjEpOworICAgICAgICAgIGludCB5MSA9IE5TTWluWSAocjEpOworICAgICAgICAgIGlu dCB3ZDEgPSBOU1dpZHRoIChyMSk7CisgICAgICAgICAgaW50IGgxID0gTlNIZWlnaHQgKHIxKTsK KyAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIlcyAtLSBERUFEOlxuXAorICAgICAgICAgIHgw L3gxICglZC8lZCkgfCB5MC95MSAoJWQvJWQpIHwgd2QwL3dkMSAoJWQvJWQpIHwgaDAvaDEgKCVk LyVkKVxuIiwKKyAgICAgICAgICBtY193aW5kb3cgKHcpLCB4MCwgeDEsIHkwLCB5MSwgd2QwLCB3 ZDEsIGgwLCBoMSk7CisgICAgICAgIH0KKyAgICAgIGlmIChbdmlldyBtY19qdWRnZV0pCiAgICAg ICAgIHJlbW92ZWQgPSBZRVM7CiAgICAgfQorICAgIGVsc2UgaWYgKFt2aWV3IGp1ZGdlXSkKKyAg ICAgIHJlbW92ZWQgPSBZRVM7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKKyAgICB9 CiAKICAgaWYgKHJlbW92ZWQpCiAgICAgW2V2aWV3IHVwZGF0ZUZyYW1lU2l6ZTogTk9dOwpAQCAt NTA3NCw2ICs2MTQwLDIwIEBAIHN0YXRpYyBMaXNwX09iamVjdCBuc19zdHJpbmdfdG9fbGlzcG1v ZCAoY29uc3QgY2hhciAqcykKIGV4dGVybiBmcmFtZV9wYXJtX2hhbmRsZXIgbnNfZnJhbWVfcGFy bV9oYW5kbGVyc1tdOwogc3RhdGljIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlIG5zX3JlZGlz cGxheV9pbnRlcmZhY2UgPQogeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCisvKiBgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYG5zdGVybS5t YCBtdXN0IGJlIGluIHRoZSBleGFjdCBzYW1lIG9yZGVyIGFzIHRoZQorYHJlZGlzcGxheV9pbnRl cmZhY2UnIGluIGBkaXNwZXh0ZXJuLmhgISAqLworCisgIG1jX25zX2RyYXdfd2luZG93X2N1cnNv ciwKKyAgbWNfbnNfZHJhd19nbHlwaF9zdHJpbmcsCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKICAgbnNfZnJhbWVfcGFybV9oYW5kbGVycywKICAgZ3VpX3Byb2R1Y2VfZ2x5cGhzLAog ICBndWlfd3JpdGVfZ2x5cGhzLApAQCAtODcxMSw2ICs5NzkxLDQ5IEBAIC0gKEJPT0wpY2FuQmVj b21lTWFpbldpbmRvdwogCiBAaW1wbGVtZW50YXRpb24gRW1hY3NTY3JvbGxlcgogCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCistICh2b2lkKW1j X3NldF9yZWN0YW5nbGU6IChOU1JlY3QpcmVjdAoreworICBtY19yZWN0YW5nbGUgPSByZWN0Owor fQorCistIChOU1JlY3QpbWNfZ2V0X3JlY3RhbmdsZQoreworICByZXR1cm4gbWNfcmVjdGFuZ2xl OworfQorCistIChzdHJ1Y3Qgd2luZG93ICopbWNfZ2V0X3dpbmRvdworeworICByZXR1cm4gd2lu ZG93OworfQorCistIChib29sKW1jX2p1ZGdlCit7CisgIE5TVFJBQ0UgKCJbRW1hY3NTY3JvbGxl ciBtY19qdWRnZV0iKTsKKyAgYm9vbCByZXQgPSBjb25kZW1uZWQ7CisgIGJsb2NrX2lucHV0ICgp OworICBpZiAoY29uZGVtbmVkKQorICAgIHsKKyAgICAgIC8qIGVuc3VyZSBvdGhlciBzY3JvbGxi YXIgdXBkYXRlcyBhZnRlciBkZWxldGlvbiAqLworICAgICAgRW1hY3NWaWV3ICp2aWV3ID0gKEVt YWNzVmlldyAqKUZSQU1FX05TX1ZJRVcgKGZyYW1lKTsKKyAgICAgIGlmICh2aWV3ICE9IG5pbCkK KyAgICAgICAgdmlldy0+c2Nyb2xsYmFyc05lZWRpbmdVcGRhdGUrKzsKKyAgICB9CisgIGlmICh3 aW5kb3cpCisgICAgd3NldF92ZXJ0aWNhbF9zY3JvbGxfYmFyICh3aW5kb3csIFFuaWwpOworICB3 aW5kb3cgPSAwOworICBbc2VsZiByZW1vdmVGcm9tU3VwZXJ2aWV3V2l0aG91dE5lZWRpbmdEaXNw bGF5XTsKKyAgW3NlbGYgcmVsZWFzZV07CisgIHVuYmxvY2tfaW5wdXQgKCk7CisgIHJldHVybiBy ZXQ7Cit9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC8qIGZvciByZXBlYXQgYnV0 dG9uIHB1c2ggKi8KICNkZWZpbmUgU0NST0xMX0JBUl9GSVJTVF9ERUxBWSAwLjUKICNkZWZpbmUg U0NST0xMX0JBUl9DT05USU5VT1VTX0RFTEFZICgxLjAgLyAxNSkKZGlmZiAtLWdpdCBhL3NyYy93 MzJ0ZXJtLmMgYi9zcmMvdzMydGVybS5jCmluZGV4IGM2ZTE3NWUuLmNkOTYzOGMgMTAwNjQ0Ci0t LSBhL3NyYy93MzJ0ZXJtLmMKKysrIGIvc3JjL3czMnRlcm0uYwpAQCAtNjIsNiArNjIsMTE2NSBA QCBhbG9uZyB3aXRoIEdOVSBFbWFjcy4gIElmIG5vdCwgc2VlIDxodHRwczovL3d3dy5nbnUub3Jn L2xpY2Vuc2VzLz4uICAqLwogI2luY2x1ZGUgImJpdG1hcHMvZ3JheS54Ym0iCiAjZW5kaWYKIAwK KworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioq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WYWx1ZSAoY29sb3IpOyBcCisg ICAgICBwZS5wZUZsYWdzID0gMDsgXAorICAgIH0gd2hpbGUgKDApCisKK3ZvaWQKK21jX3Byb2Nl c3NfcXVpdF9mbGFnICh2b2lkKQoreworICBMaXNwX09iamVjdCBmbGFnID0gVnF1aXRfZmxhZzsK KyAgVnF1aXRfZmxhZyA9IFFuaWw7CisgIGlmIChFUSAoZmxhZywgUWtpbGxfZW1hY3MpKQorICAg IEZraWxsX2VtYWNzIChRbmlsKTsKKyAgaWYgKEVRIChWdGhyb3dfb25faW5wdXQsIGZsYWcpKQor ICAgIEZ0aHJvdyAoVnRocm93X29uX2lucHV0LCBRdCk7CisgIEZzaWduYWwgKFFxdWl0LCBRbmls KTsKK30KKworI2RlZmluZSBNQ19RVUlUCQkJCQkJXAorICBkbyB7CQkJCQkJCVwKKyAgICBpZiAo IU5JTFAgKFZxdWl0X2ZsYWcpICYmIE5JTFAgKFZpbmhpYml0X3F1aXQpKQlcCisgICAgICBtY19w cm9jZXNzX3F1aXRfZmxhZyAoKTsJCQkJXAorICAgIGVsc2UgaWYgKHBlbmRpbmdfc2lnbmFscykJ CQkJXAorICAgICAgcHJvY2Vzc19wZW5kaW5nX3NpZ25hbHMgKCk7CQkJXAorICB9IHdoaWxlIChm YWxzZSkKKworc3RhdGljIExpc3BfT2JqZWN0CittY193MzJfY29sb3JfbWFwX2xvb2t1cCAoY29u c3QgY2hhciAqY29sb3JuYW1lKQoreworICBMaXNwX09iamVjdCB0YWlsLCByZXQgPSBRbmlsOwor ICBibG9ja19pbnB1dCAoKTsKKyAgZm9yICh0YWlsID0gVnczMl9jb2xvcl9tYXA7IENPTlNQICh0 YWlsKTsgdGFpbCA9IFhDRFIgKHRhaWwpKQorICAgIHsKKyAgICAgIHJlZ2lzdGVyIExpc3BfT2Jq ZWN0IGVsdCwgdGVtOworICAgICAgZWx0ID0gWENBUiAodGFpbCk7CisgICAgICBpZiAoIUNPTlNQ IChlbHQpKSBjb250aW51ZTsKKyAgICAgIHRlbSA9IFhDQVIgKGVsdCk7CisgICAgICBpZiAobHN0 cmNtcGkgKFNTREFUQSAodGVtKSwgY29sb3JuYW1lKSA9PSAwKQorICAgICAgICB7CisgICAgICAg ICAgcmV0ID0gRmNkciAoZWx0KTsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAg TUNfUVVJVDsKKyAgICB9CisgIHVuYmxvY2tfaW5wdXQgKCk7CisgIHJldHVybiByZXQ7Cit9CisK K3N0YXRpYyBMaXNwX09iamVjdAorbWNfeF90b193MzJfY29sb3IgKGNvbnN0IGNoYXIgKiBjb2xv cm5hbWUpCit7CisgIHJlZ2lzdGVyIExpc3BfT2JqZWN0IHJldCA9IFFuaWw7CisgIGJsb2NrX2lu cHV0ICgpOworICBpZiAoY29sb3JuYW1lWzBdID09ICcjJykKKyAgICB7CisgICAgICAvKiBDb3Vs ZCBiZSBhbiBvbGQtc3R5bGUgUkdCIERldmljZSBzcGVjaWZpY2F0aW9uLiAqLworICAgICAgaW50 IHNpemUgPSBzdHJsZW4gKGNvbG9ybmFtZSArIDEpOworICAgICAgY2hhciAqY29sb3IgPSBhbGxv Y2EgKHNpemUgKyAxKTsKKyAgICAgIHN0cmNweSAoY29sb3IsIGNvbG9ybmFtZSArIDEpOworICAg ICAgaWYgKHNpemUgPT0gMyB8fCBzaXplID09IDYgfHwgc2l6ZSA9PSA5IHx8IHNpemUgPT0gMTIp CisgICAgICAgIHsKKyAgICAgICAgICBVSU5UIGNvbG9ydmFsOworICAgICAgICAgIGludCBpLCBw b3M7CisgICAgICAgICAgcG9zID0gMDsKKyAgICAgICAgICBzaXplIC89IDM7CisgICAgICAgICAg Y29sb3J2YWwgPSAwOworICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCAzOyBpKyspCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIGNoYXIgKmVuZDsKKyAgICAgICAgICAgICAgY2hhciB0Owor ICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIHZhbHVlOworICAgICAgICAgICAgICAvKiBUaGUg Y2hlY2sgZm9yICd4JyBpbiB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbmFsIHRha2VzIGludG8KKyAg ICAgICAgICAgICAgYWNjb3VudCB0aGUgZmFjdCB0aGF0IHN0cnRvbCBhbGxvd3MgYSAiMHgiIGlu IGZyb250IG9mCisgICAgICAgICAgICAgIG91ciBudW1iZXJzLCBhbmQgd2UgZG9uJ3QuICovCisg ICAgICAgICAgICAgIGlmICghaXN4ZGlnaXQgKGNvbG9yWzBdKSB8fCBjb2xvclsxXSA9PSAneCcp CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIHQgPSBjb2xvcltzaXplXTsK KyAgICAgICAgICAgICAgY29sb3Jbc2l6ZV0gPSAnXDAnOworICAgICAgICAgICAgICB2YWx1ZSA9 IHN0cnRvdWwgKGNvbG9yLCAmZW5kLCAxNik7CisgICAgICAgICAgICAgIGNvbG9yW3NpemVdID0g dDsKKyAgICAgICAgICAgICAgaWYgKGVycm5vID09IEVSQU5HRSB8fCBlbmQgLSBjb2xvciAhPSBz aXplKQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBzd2l0Y2ggKHNpemUp CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNhc2UgMToKKyAgICAgICAgICAg ICAgICAgIHZhbHVlID0gdmFsdWUgKiAweDEwOworICAgICAgICAgICAgICAgICAgYnJlYWs7Cisg ICAgICAgICAgICAgICAgY2FzZSAyOgorICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAg ICAgICAgICAgY2FzZSAzOgorICAgICAgICAgICAgICAgICAgdmFsdWUgLz0gMHgxMDsKKyAgICAg ICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgNDoKKyAgICAgICAgICAg ICAgICAgIHZhbHVlIC89IDB4MTAwOworICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAg ICAgICAgICAgfQorICAgICAgICAgICAgICBjb2xvcnZhbCB8PSAodmFsdWUgPDwgcG9zKTsKKyAg ICAgICAgICAgICAgcG9zICs9IDB4ODsKKyAgICAgICAgICAgICAgaWYgKGkgPT0gMikKKyAgICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAg ICAgICAgICAgICAgWFNFVElOVCAocmV0LCBjb2xvcnZhbCk7CisgICAgICAgICAgICAgICAgICBy ZXR1cm4gcmV0OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgY29sb3IgPSBlbmQ7 CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIGVsc2UgaWYgKHN0cm5pY21wIChj b2xvcm5hbWUsICJyZ2I6IiwgNCkgPT0gMCkKKyAgICB7CisgICAgICBjb25zdCBjaGFyICpjb2xv cjsKKyAgICAgIFVJTlQgY29sb3J2YWw7CisgICAgICBpbnQgaSwgcG9zOworICAgICAgcG9zID0g MDsKKyAgICAgIGNvbG9ydmFsID0gMDsKKyAgICAgIGNvbG9yID0gY29sb3JuYW1lICsgNDsKKyAg ICAgIGZvciAoaSA9IDA7IGkgPCAzOyBpKyspCisgICAgICAgIHsKKyAgICAgICAgICBjaGFyICpl bmQ7CisgICAgICAgICAgdW5zaWduZWQgbG9uZyB2YWx1ZTsKKyAgICAgICAgICAvKiBUaGUgY2hl Y2sgZm9yICd4JyBpbiB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbmFsIHRha2VzIGludG8KKyAgICAg ICAgICAgICBhY2NvdW50IHRoZSBmYWN0IHRoYXQgc3RydG9sIGFsbG93cyBhICIweCIgaW4gZnJv bnQgb2YKKyAgICAgICAgICAgICBvdXIgbnVtYmVycywgYW5kIHdlIGRvbid0LiAqLworICAgICAg ICAgIGlmICghaXN4ZGlnaXQgKGNvbG9yWzBdKSB8fCBjb2xvclsxXSA9PSAneCcpCisgICAgICAg ICAgICBicmVhazsKKyAgICAgICAgICB2YWx1ZSA9IHN0cnRvdWwgKGNvbG9yLCAmZW5kLCAxNik7 CisgICAgICAgICAgaWYgKGVycm5vID09IEVSQU5HRSkKKyAgICAgICAgICAgIGJyZWFrOworICAg ICAgICAgIHN3aXRjaCAoZW5kIC0gY29sb3IpCisgICAgICAgICAgICB7CisgICAgICAgICAgICBj YXNlIDE6CisgICAgICAgICAgICAgIHZhbHVlID0gdmFsdWUgKiAweDEwICsgdmFsdWU7CisgICAg ICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSAyOgorICAgICAgICAgICAgICBicmVh azsKKyAgICAgICAgICAgIGNhc2UgMzoKKyAgICAgICAgICAgICAgdmFsdWUgLz0gMHgxMDsKKyAg ICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDQ6CisgICAgICAgICAgICAgIHZh bHVlIC89IDB4MTAwOworICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGRlZmF1bHQ6 CisgICAgICAgICAgICAgIHZhbHVlID0gVUxPTkdfTUFYOworICAgICAgICAgICAgfQorICAgICAg ICAgIGlmICh2YWx1ZSA9PSBVTE9OR19NQVgpCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAg ICBjb2xvcnZhbCB8PSAodmFsdWUgPDwgcG9zKTsKKyAgICAgICAgICBwb3MgKz0gMHg4OworICAg ICAgICAgIGlmIChpID09IDIpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmICgqZW5k ICE9ICdcMCcpCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIHVuYmxvY2tf aW5wdXQgKCk7CisgICAgICAgICAgICAgIFhTRVRJTlQgKHJldCwgY29sb3J2YWwpOworICAgICAg ICAgICAgICByZXR1cm4gcmV0OworICAgICAgICAgICAgfQorICAgICAgICAgIGlmICgqZW5kICE9 ICcvJykKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIGNvbG9yID0gZW5kICsgMTsKKyAg ICAgICAgfQorICAgIH0KKyAgICBlbHNlIGlmIChzdHJuaWNtcCAoY29sb3JuYW1lLCAicmdiaToi LCA1KSA9PSAwKQorICAgICAgeworICAgICAgICAvKiBUaGlzIGlzIGFuIFJHQiBJbnRlbnNpdHkg c3BlY2lmaWNhdGlvbi4gKi8KKyAgICAgICAgY29uc3QgY2hhciAqY29sb3I7CisgICAgICAgIFVJ TlQgY29sb3J2YWw7CisgICAgICAgIGludCBpLCBwb3M7CisgICAgICAgIHBvcyA9IDA7CisgICAg ICAgIGNvbG9ydmFsID0gMDsKKyAgICAgICAgY29sb3IgPSBjb2xvcm5hbWUgKyA1OworICAgICAg ICBmb3IgKGkgPSAwOyBpIDwgMzsgaSsrKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGNoYXIg KmVuZDsKKyAgICAgICAgICAgIGRvdWJsZSB2YWx1ZTsKKyAgICAgICAgICAgIFVJTlQgdmFsOwor ICAgICAgICAgICAgdmFsdWUgPSBzdHJ0b2QgKGNvbG9yLCAmZW5kKTsKKyAgICAgICAgICAgIGlm IChlcnJubyA9PSBFUkFOR0UpCisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgaWYg KHZhbHVlIDwgMC4wIHx8IHZhbHVlID4gMS4wKQorICAgICAgICAgICAgICBicmVhazsKKyAgICAg ICAgICAgIHZhbCA9IChVSU5UKSgweDEwMCAqIHZhbHVlKTsKKyAgICAgICAgICAgIC8qIFdlIHVz ZWQgMHgxMDAgaW5zdGVhZCBvZiAweEZGIHRvIGdpdmUgYSBjb250aW51b3VzCisgICAgICAgICAg ICAgICByYW5nZSBiZXR3ZWVuIDAuMCBhbmQgMS4wIGluY2x1c2l2ZS4gIFRoZSBuZXh0IHN0YXRl bWVudAorICAgICAgICAgICAgICAgZml4ZXMgdGhlIDEuMCBjYXNlLiAqLworICAgICAgICAgICAg aWYgKHZhbCA9PSAweDEwMCkKKyAgICAgICAgICAgICAgdmFsID0gMHhGRjsKKyAgICAgICAgICAg IGNvbG9ydmFsIHw9ICh2YWwgPDwgcG9zKTsKKyAgICAgICAgICAgIHBvcyArPSAweDg7CisgICAg ICAgICAgICBpZiAoaSA9PSAyKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYg KCplbmQgIT0gJ1wwJykKKyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAg IHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgICAgICAgWFNFVElOVCAocmV0LCBjb2xvcnZh bCk7CisgICAgICAgICAgICAgICAgcmV0dXJuIHJldDsKKyAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgaWYgKCplbmQgIT0gJy8nKQorICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAg IGNvbG9yID0gZW5kICsgMTsKKyAgICAgICAgICB9CisgICAgICB9CisgIC8qIEkgYW0gbm90IGdv aW5nIHRvIGF0dGVtcHQgdG8gaGFuZGxlIGFueSBvZiB0aGUgQ0lFIGNvbG9yIHNjaGVtZXMKKyAg ICAgb3IgVGVrSFZDLCBzaW5jZSBJIGRvbid0IGtub3cgdGhlIGFsZ29yaXRobXMgZm9yIGNvbnZl cnNpb24gdG8gUkdCLgorICAgICBJZiB3ZSBmYWlsIHRvIGxvb2t1cCB0aGUgY29sb3IgbmFtZSBp biB3MzJfY29sb3JfbWFwLCB0aGVuIGNoZWNrIHRoZQorICAgICBjb2xvcm5hbWUgdG8gc2VlIGlm IGl0IGNhbiBiZSBjcnVkZWx5IGFwcHJveGltYXRlZDogSWYgdGhlIFggY29sb3IKKyAgICAgZW5k cyBpbiBhIG51bWJlciAoZS5nLiwgImRhcmtzZWFncmVlbjIiKSwgc3RyaXAgdGhlIG51bWJlciBh bmQKKyAgICAgcmV0dXJuIHRoZSByZXN1bHQgb2YgbG9va2luZyB1cCB0aGUgYmFzZSBjb2xvciBu YW1lLiAqLworICByZXQgPSBtY193MzJfY29sb3JfbWFwX2xvb2t1cCAoY29sb3JuYW1lKTsKKyAg aWYgKE5JTFAgKHJldCkpCisgICAgeworICAgICAgaW50IGxlbiA9IHN0cmxlbiAoY29sb3JuYW1l KTsKKyAgICAgIGlmIChpc2RpZ2l0IChjb2xvcm5hbWVbbGVuIC0gMV0pKQorICAgICAgICB7Cisg ICAgICAgICAgY2hhciAqcHRyLCAqYXBwcm94ID0gYWxsb2NhIChsZW4gKyAxKTsKKyAgICAgICAg ICBzdHJjcHkgKGFwcHJveCwgY29sb3JuYW1lKTsKKyAgICAgICAgICBwdHIgPSAmYXBwcm94W2xl biAtIDFdOworICAgICAgICAgIHdoaWxlIChwdHIgPiBhcHByb3ggJiYgaXNkaWdpdCAoKnB0cikp CisgICAgICAgICAgICAqcHRyLS0gPSAnXDAnOworICAgICAgICAgIHJldCA9IG1jX3czMl9jb2xv cl9tYXBfbG9va3VwIChhcHByb3gpOworICAgICAgICB9CisgICAgfQorICB1bmJsb2NrX2lucHV0 ICgpOworICByZXR1cm4gcmV0OworfQorCisvKiBEZWNpZGUgaWYgY29sb3IgbmFtZWQgQ09MT1Ig aXMgdmFsaWQgZm9yIHRoZSBkaXNwbGF5IGFzc29jaWF0ZWQgd2l0aAorICAgdGhlIHNlbGVjdGVk IGZyYW1lOyBpZiBzbywgcmV0dXJuIHRoZSByZ2IgdmFsdWVzIGluIENPTE9SX0RFRi4KKyAgIElm IEFMTE9DIGlzIG5vbnplcm8sIGFsbG9jYXRlIGEgbmV3IGNvbG9ybWFwIGNlbGwuICovCitpbnQK K21jX3czMl9kZWZpbmVkX2NvbG9yIChzdHJ1Y3QgZnJhbWUgKmYsIGNvbnN0IGNoYXIgKmNvbG9y LCBtY19YQ29sb3IgKmNvbG9yX2RlZiwgYm9vbCBhbGxvY19wKQoreworICByZWdpc3RlciBMaXNw X09iamVjdCB0ZW07CisgIENPTE9SUkVGIHczMl9jb2xvcl9yZWY7CisgIHRlbSA9IG1jX3hfdG9f dzMyX2NvbG9yIChjb2xvcik7CisgIGlmICghTklMUCAodGVtKSkKKyAgICB7CisgICAgICBpZiAo ZikKKyAgICAgICAgeworICAgICAgICAgIC8qIEFwcGx5IGdhbW1hIGNvcnJlY3Rpb24uICovCisg ICAgICAgICAgdzMyX2NvbG9yX3JlZiA9IFhVRklYTlVNX1JBVyAodGVtKTsKKyAgICAgICAgICBn YW1tYV9jb3JyZWN0IChmLCAmdzMyX2NvbG9yX3JlZik7CisgICAgICAgICAgWFNFVElOVCAodGVt LCB3MzJfY29sb3JfcmVmKTsKKyAgICAgICAgfQorICAgICAgLyogTWFwIHRoaXMgY29sb3IgdG8g dGhlIHBhbGV0dGUgaWYgaXQgaXMgZW5hYmxlZC4gKi8KKyAgICAgIGlmICghTklMUCAoVnczMl9l bmFibGVfcGFsZXR0ZSkpCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgdzMyX3BhbGV0dGVf ZW50cnkgKiBlbnRyeSA9IG9uZV93MzJfZGlzcGxheV9pbmZvLmNvbG9yX2xpc3Q7CisgICAgICAg ICAgc3RydWN0IHczMl9wYWxldHRlX2VudHJ5ICoqIHByZXYgPSAmb25lX3czMl9kaXNwbGF5X2lu Zm8uY29sb3JfbGlzdDsKKyAgICAgICAgICAvKiBjaGVjayBpZiBjb2xvciBpcyBhbHJlYWR5IG1h cHBlZCAqLworICAgICAgICAgIHdoaWxlIChlbnRyeSkKKyAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgaWYgKE1DX1czMl9DT0xPUiAoZW50cnktPmVudHJ5KSA9PSBYVUZJWE5VTV9SQVcgKHRl bSkpCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIHByZXYgPSAmZW50cnkt Pm5leHQ7CisgICAgICAgICAgICAgIGVudHJ5ID0gZW50cnktPm5leHQ7CisgICAgICAgICAgICB9 CisgICAgICAgICAgaWYgKGVudHJ5ID09IE5VTEwgJiYgYWxsb2NfcCkKKyAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgLyogbm90IGFscmVhZHkgbWFwcGVkLCBzbyBhZGQgdG8gbGlzdCAqLwor ICAgICAgICAgICAgICBlbnRyeSA9IHhtYWxsb2MgKHNpemVvZiAoc3RydWN0IHczMl9wYWxldHRl X2VudHJ5KSk7CisgICAgICAgICAgICAgIE1DX1czMl9TRVRfQ09MT1IgKGVudHJ5LT5lbnRyeSwg WFVGSVhOVU1fUkFXICh0ZW0pKTsKKyAgICAgICAgICAgICAgZW50cnktPm5leHQgPSBOVUxMOwor ICAgICAgICAgICAgICAqcHJldiA9IGVudHJ5OworICAgICAgICAgICAgICBvbmVfdzMyX2Rpc3Bs YXlfaW5mby5udW1fY29sb3JzKys7CisgICAgICAgICAgICAgIC8qIHNldCBmbGFnIHRoYXQgcGFs ZXR0ZSBtdXN0IGJlIHJlZ2VuZXJhdGVkICovCisgICAgICAgICAgICAgIG9uZV93MzJfZGlzcGxh eV9pbmZvLnJlZ2VuX3BhbGV0dGUgPSBUUlVFOworICAgICAgICAgICAgfQorICAgICAgICB9Cisg ICAgICAvKiBFbnN1cmUgQ09MT1JSRUYgdmFsdWUgaXMgc25hcHBlZCB0byBuZWFyZXN0IGNvbG9y IGluIChkZWZhdWx0KQorICAgICAgICAgcGFsZXR0ZSBieSBzaW11bGF0aW5nIHRoZSBQQUxFVFRF UkdCIG1hY3JvLiAgVGhpcyB3b3JrcyB3aGV0aGVyCisgICAgICAgICBvciBub3QgdGhlIGRpc3Bs YXkgZGV2aWNlIGhhcyBhIHBhbGV0dGUuICovCisgICAgICB3MzJfY29sb3JfcmVmID0gWFVGSVhO VU1fUkFXICh0ZW0pIHwgMHgyMDAwMDAwOworICAgICAgY29sb3JfZGVmLT5waXhlbCA9IHczMl9j b2xvcl9yZWY7CisgICAgICBjb2xvcl9kZWYtPnJlZCA9IEdldFJWYWx1ZSAodzMyX2NvbG9yX3Jl ZikgKiAyNTY7CisgICAgICBjb2xvcl9kZWYtPmdyZWVuID0gR2V0R1ZhbHVlICh3MzJfY29sb3Jf cmVmKSAqIDI1NjsKKyAgICAgIGNvbG9yX2RlZi0+Ymx1ZSA9IEdld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yAoc3RydWN0IGdseXBoX3N0cmluZyAqcykKK3sKKyAgZWFzc2VydCAo cy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gU1RSRVRDSF9HTFlQSCk7CisgIGlmIChzLT5obCA9PSBE UkFXX0NVUlNPUgorICAgICAgJiYgIXhfc3RyZXRjaF9jdXJzb3JfcCkKKyAgICB7CisgICAgICAv KiBJZiBgeC1zdHJldGNoLWN1cnNvcicgaXMgbmlsLCBkb24ndCBkcmF3IGEgYmxvY2sgY3Vyc29y IGFzIHdpZGUgYXMgdGhlCisgICAgICBzdHJldGNoIGdseXBoLiAqLworICAgICAgaW50IHdpZHRo LCBiYWNrZ3JvdW5kX3dpZHRoID0gcy0+YmFja2dyb3VuZF93aWR0aDsKKyAgICAgIGludCB4ID0g cy0+eDsKKyAgICAgIGlmICghcy0+cm93LT5yZXZlcnNlZF9wKQorICAgICAgICB7CisgICAgICAg ICAgaW50IGxlZnRfeCA9IHdpbmRvd19ib3hfbGVmdF9vZmZzZXQgKHMtPncsIFRFWFRfQVJFQSk7 CisgICAgICAgICAgaWYgKHggPCBsZWZ0X3gpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAg IGJhY2tncm91bmRfd2lkdGggLT0gbGVmdF94IC0geDsKKyAgICAgICAgICAgICAgeCA9IGxlZnRf eDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICB7Cisg ICAgICAgICAgIC8qIEluIFIyTCByb3dzLCBkcmF3IHRoZSBjdXJzb3Igb24gdGhlIHJpZ2h0IGVk Z2Ugb2YgdGhlCisgICAgICAgICAgICAgIHN0cmV0Y2ggZ2x5cGguICovCisgICAgICAgICAgIGlu dCByaWdodF94ID0gd2luZG93X2JveF9yaWdodCAocy0+dywgVEVYVF9BUkVBKTsKKyAgICAgICAg ICAgaWYgKHggKyBiYWNrZ3JvdW5kX3dpZHRoID4gcmlnaHRfeCkKKyAgICAgICAgICAgICBiYWNr Z3JvdW5kX3dpZHRoIC09IHggLSByaWdodF94OworICAgICAgICAgICB4ICs9IGJhY2tncm91bmRf d2lkdGg7CisgICAgICAgICB9CisgICAgICB3aWR0aCA9IG1pbiAoRlJBTUVfQ09MVU1OX1dJRFRI IChzLT5mKSwgYmFja2dyb3VuZF93aWR0aCk7CisgICAgICBpZiAocy0+cm93LT5yZXZlcnNlZF9w KQorICAgICAgICB4IC09IHdpZHRoOworICAgICAgLyogRHJhdyBjdXJzb3IuICovCisgICAgICB3 MzJfZHJhd19nbHlwaF9zdHJpbmdfYmdfcmVjdCAocywgeCwgcy0+eSwgd2lkdGgsIHMtPmhlaWdo dCk7CisgICAgICAvKiBDbGVhciByZXN0IHVzaW5nIHRoZSBHQyBvZiB0aGUgb3JpZ2luYWwgbm9u LWN1cnNvciBmYWNlLiAqLworICAgICAgaWYgKHdpZHRoIDwgYmFja2dyb3VuZF93aWR0aCkKKyAg ICAgICAgeworICAgICAgICAgIEVtYWNzX0dDICpnYyA9IHMtPmZhY2UtPmdjOworICAgICAgICAg IGludCB5ID0gcy0+eTsKKyAgICAgICAgICBpbnQgdyA9IGJhY2tncm91bmRfd2lkdGggLSB3aWR0 aCwgaCA9IHMtPmhlaWdodDsKKyAgICAgICAgICBSRUNUIHI7CisgICAgICAgICAgSERDIGhkYyA9 IHMtPmhkYzsKKyAgICAgICAgICBpZiAoIXMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAgICAgICAgICAg IHggKz0gd2lkdGg7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHggPSBzLT54Owor ICAgICAgICAgIGlmIChzLT5yb3ctPm1vdXNlX2ZhY2VfcAorICAgICAgICAgICAgICAmJiBjdXJz b3JfaW5fbW91c2VfZmFjZV9wIChzLT53KSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg dzMyX3NldF9tb3VzZV9mYWNlX2djIChzKTsKKyAgICAgICAgICAgICAgZ2MgPSBzLT5nYzsKKyAg ICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgZ2MgPSBzLT5mYWNl LT5nYzsKKyAgICAgICAgICBnZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgJnIpOworICAg ICAgICAgIHczMl9zZXRfY2xpcF9yZWN0YW5nbGUgKGhkYywgJnIpOworI2lmIDAgLyogVE9ETzog c3RpcHBsZSAqLworICAgICAgICAgIGlmIChzLT5mYWNlLT5zdGlwcGxlKQorICAgICAgICAgICAg eworICAgICAgICAgICAgICAvKiBGaWxsIGJhY2tncm91bmQgd2l0aCBhIHN0aXBwbGUgcGF0dGVy bi4gKi8KKyAgICAgICAgICAgICAgWFNldEZpbGxTdHlsZSAocy0+ZGlzcGxheSwgZ2MsIEZpbGxP cGFxdWVTdGlwcGxlZCk7CisgICAgICAgICAgICAgIFhGaWxsUmVjdGFuZ2xlIChzLT5kaXNwbGF5 LCBzLT53aW5kb3csIGdjLCB4LCB5LCB3LCBoKTsKKyAgICAgICAgICAgICAgWFNldEZpbGxTdHls ZSAocy0+ZGlzcGxheSwgZ2MsIEZpbGxTb2xpZCk7CisgICAgICAgICAgICB9CisgICAgICAgICAg ICBlbHNlCisjZW5kaWYKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHczMl9maWxs X2FyZWEgKHMtPmYsIHMtPmhkYywgZ2MtPmJhY2tncm91bmQsIHgsIHksIHcsIGgpOworICAgICAg ICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZiAoIXMtPmJhY2tncm91bmRf ZmlsbGVkX3ApCisgICAgICB7CisgICAgICAgIGludCBiYWNrZ3JvdW5kX3dpZHRoID0gcy0+YmFj a2dyb3VuZF93aWR0aDsKKyAgICAgICAgaW50IHggPSBzLT54LCBsZWZ0X3ggPSB3aW5kb3dfYm94 X2xlZnRfb2Zmc2V0IChzLT53LCBURVhUX0FSRUEpOworICAgICAgICAvKiBEb24ndCBkcmF3IGlu dG8gbGVmdCBtYXJnaW4sIGZyaW5nZSBvciBzY3JvbGxiYXIgYXJlYQorICAgICAgICAgICBleGNl cHQgZm9yIGhlYWRlciBsaW5lIGFuZCBtb2RlIGxpbmUuICovCisgICAgICAgIGlmICh4IDwgbGVm dF94ICYmICFzLT5yb3ctPm1vZGVfbGluZV9wKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGJh Y2tncm91bmRfd2lkdGggLT0gbGVmdF94IC0geDsKKyAgICAgICAgICAgIHggPSBsZWZ0X3g7Cisg ICAgICAgICAgfQorICAgICAgICBpZiAoYmFja2dyb3VuZF93aWR0aCA+IDApCisgICAgICAgICAg dzMyX2RyYXdfZ2x5cGhfc3RyaW5nX2JnX3JlY3QgKHMsIHgsIHMtPnksIGJhY2tncm91bmRfd2lk dGgsIHMtPmhlaWdodCk7CisgICAgICB9CisgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVl OworfQorCisvKiBTZXQgUy0+Z2MgdG8gYSBzdWl0YWJsZSBHQyBmb3IgZHJhd2luZyBnbHlwaCBz dHJpbmcgUyBpbiBjdXJzb3IKKyAgIGZhY2UuICovCitzdGF0aWMgdm9pZAorbWNfdzMyX3NldF9j dXJzb3JfZ2MgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMsIGJvb2wgY3Vyc29yX2djX3ApCit7Cisg IGlmIChjdXJzb3JfZ2NfcCkKKyAgICB7CisgICAgICBzLT5nYyA9IHMtPmYtPm91dHB1dF9kYXRh LnczMi0+Y3Vyc29yX2djOworICAgICAgcmV0dXJuOworICAgIH0KKyAgaWYgKHMtPmZvbnQgPT0g RlJBTUVfRk9OVCAocy0+ZikKKyAgICAgICYmIHMtPmZhY2UtPmJhY2tncm91bmQgPT0gRlJBTUVf QkFDS0dST1VORF9QSVhFTCAocy0+ZikKKyAgICAgICYmIHMtPmZhY2UtPmZvcmVncm91bmQgPT0g RlJBTUVfRk9SRUdST1VORF9QSVhFTCAocy0+ZikKKyAgICAgIC8qIFNvbWV0aW1lcyB3ZSBhcmUg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EUkFXX01PVVNFX0ZBQ0UpCisgICAgICAgICAgeworICAgICAgICAgICAgdzMy X3NldF9tb3VzZV9mYWNlX2djIChzKTsKKyAgICAgICAgICAgIHMtPnN0aXBwbGVkX3AgPSBzLT5m YWNlLT5zdGlwcGxlICE9IDA7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKHMtPmhs ID09IERSQVdfSU1BR0VfUkFJU0VECisgICAgICAgICAgICAgICAgICAgfHwgcy0+aGwgPT0gRFJB V19JTUFHRV9TVU5LRU4pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHMtPmdjID0gcy0+ ZmFjZS0+Z2M7CisgICAgICAgICAgICAgIHMtPnN0aXBwbGVkX3AgPSBzLT5mYWNlLT5zdGlwcGxl ICE9IDA7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGVt YWNzX2Fib3J0ICgpOworICAvKiBHQyBtdXN0IGhhdmUgYmVlbiBzZXQuICovCisgIGVhc3NlcnQg KHMtPmdjICE9IDApOworfQorCisvKiBEcmF3IGEgaG9sbG93IGJveCBjdXJzb3Igb24gd2luZG93 IFcgaW4gZ2x5cGggcm93IFJPVy4gKi8KK3N0YXRpYyB2b2lkCittY193MzJfZHJhd19ob2xsb3df Y3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCB4LCBp bnQgZngsIGludCB5LCBpbnQgZnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaHBv cywgaW50IHZwb3MsIGludCB3ZCwgaW50IGgpCit7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFN RSAoV0lORE9XX0ZSQU1FICh3KSk7CisgIEhEQyBoZGM7CisgIFJFQ1QgcmVjdDsKKyAgSEJSVVNI IGhiID0gQ3JlYXR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pbnZpc2libGUuICBVc2UgdGhl IGdseXBoJ3MgZm9yZWdyb3VuZCBjb2xvciBpbnN0ZWFkIGluIHRoaXMKKyAgICAgICAgY2FzZSwg b24gdGhlIGFzc3VtcHRpb24gdGhhdCB0aGUgZ2x5cGgncyBjb2xvcnMgYXJlIGNob3NlbiBzbwor ICAgICAgICB0aGF0IHRoZSBnbHlwaCBpcyBsZWdpYmxlLiAqLworICAgICAgICBpZiAoZmFjZS0+ YmFja2dyb3VuZCA9PSBjdXJzb3JfY29sb3IKKyAgICAgICAgICAgICYmICFjdXJzb3JfZ2NfaW52 aXNpYmxlX29rYXlfcCkKKyAgICAgICAgICBjdXJzb3JfY29sb3IgPSBmYWNlLT5mb3JlZ3JvdW5k OworICAgICAgICBpbnQgZGVmYXVsdF9meCA9IFdJTkRPV19URVhUX1RPX0ZSQU1FX1BJWEVMX1gg KHcsIHgpOworICAgICAgICBoZGMgPSBnZXRfZnJhbWVfZGMgKGYpOworICAgICAgICB3MzJfY2xp cF90b19yb3cgKHcsIHJvdywgVEVYVF9BUkVBLCBoZGMpOworICAgICAgICBpbnQgcnggPSBmeDsK KyAgICAgICAgaW50IHJ5ID0gZnk7CisgICAgICAgIGludCBydyA9IHdkOworICAgICAgICBpbnQg cmggPSBoOworICAgICAgICAvLyAgZnByaW50ZiAoc3RkZXJyLCAiTUNfSEJBUjogIGZ4ICglZCkg fCBmeSAoJWQpIHwgd2QgKCVkKSB8IGggKCVkKVxuIiwKKyAgICAgICAgLy8gICAgICAgICAgICAg ICAgICAgcngsIHJ5LCBydywgcmgpOworICAgICAgICB3MzJfZmlsbF9hcmVhIChmLCBoZGMsIGN1 cnNvcl9jb2xvciwgcngsIHJ5LCBydywgcmgpOworICAgICAgICB3MzJfc2V0X2NsaXBfcmVjdGFu Z2xlIChoZGMsIE5VTEwpOworICAgICAgICByZWxlYXNlX2ZyYW1lX2RjIChmLCBoZGMpOworICAg ICAgfQorfQorCisvKiBSSUY6IERyYXcgb3IgY2xlYXIgY3Vyc29yIG9uIHdpbmRvdyBXLiAqLwor c3RhdGljIHZvaWQKK21jX3czMl9kcmF3X3dpbmRvd19jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncs IHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAg ICAgICAgICAgICAgICAgaW50IHgsIGludCBmeCwgaW50IHksIGludCBmeSwgaW50IGhwb3MsIGlu dCB2cG9zLCBpbnQgd2QsIGludCBoLAorICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBs c2wsIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICBp bnQgY3Vyc29yX3dpZHRoLCBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IsIGJvb2wgb25fcCwg Ym9vbCBhY3RpdmVfcCkKK3sKKyAgaWYgKG9uX3ApCisgICAgeworICAgICAgLyogSWYgdGhpcyBp cyB0aGUgYWN0aXZlIGN1cnNvciwgd2UgbmVlZCB0byB0cmFjayBpdCB3aXRoIHRoZQorICAgICAg c3lzdGVtIGNhcmV0LCBzbyB0aGlyZCBwYXJ0eSBzb2Z0d2FyZSBsaWtlIHNjcmVlbiBtYWduaWZp ZXJzCisgICAgICBhbmQgc3BlZWNoIHN5bnRoZXNpemVycyBjYW4gZm9sbG93IHRoZSBjdXJzb3Iu ICovCisgICAgICBpZiAoYWN0aXZlX3ApCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZnJh bWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworICAgICAgICAgIEhXTkQgaHduZCA9 IEZSQU1FX1czMl9XSU5ET1cgKGYpOworICAgICAgICAgIHczMl9zeXN0ZW1fY2FyZXRfeAorICAg ICAgICAgICAgPSBXSU5ET1dfVEVYVF9UT19GUkFNRV9QSVhFTF9YICh3LCB4KTsKKyAgICAgICAg ICAvKiBGSVhNRTogIFdoYXQgc2hvdWxkIHdlIHVzZSBpbnN0ZWFkIG9mIGB3LT5waHlzX2N1cnNv cl9hc2NlbnQnPyAqLworICAgICAgICAgIHczMl9zeXN0ZW1fY2FyZXRfeQorICAgICAgICAgICAg PSAoV0lORE9XX1RPX0ZSQU1FX1BJWEVMX1kgKHcsIHkpCisgICAgICAgICAgICAgICArIHJvdy0+ YXNjZW50IC0gdy0+cGh5c19jdXJzb3JfYXNjZW50KTsKKyAgICAgICAgICB3MzJfc3lzdGVtX2Nh cmV0X3dpbmRvdyA9IHc7CisgICAgICAgICAgdzMyX3N5c3RlbV9jYXJldF9oZHJfaGVpZ2h0ID0g V0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgICAgICAgICAgdzMyX3N5c3RlbV9jYXJl dF9tb2RlX2hlaWdodCA9IFdJTkRPV19NT0RFX0xJTkVfSEVJR0hUICh3KTsKKyAgICAgICAgICBQ b3N0TWVzc2FnZSAoaHduZCwgV01fSU1FX1NUQVJUQ09NUE9TSVRJT04sIDAsIDApOworICAgICAg ICAgIC8qIElmIHRoZSBzaXplIG9mIHRoZSBhY3RpdmUgY3Vyc29yIGNoYW5nZWQsIGRlc3Ryb3kg dGhlIG9sZAorICAgICAgICAgICAgIHN5c3RlbSBjYXJldC4gKi8KKyAgICAgICAgICBpZiAodzMy X3N5c3RlbV9jYXJldF9od25kCisgICAgICAgICAgICAgICYmICh3MzJfc3lzdGVtX2NhcmV0X2hl aWdodCAhPSBoKSkKKyAgICAgICAgICAgIFBvc3RNZXNzYWdlIChod25kLCBXTV9FTUFDU19ERVNU Uk9ZX0NBUkVULCAwLCAwKTsKKyAgICAgICAgICB3MzJfc3lzdGVtX2NhcmV0X2hlaWdodCA9IGg7 CisgICAgICAgICAgLyogTW92ZSB0aGUgc3lzdGVtIGNhcmV0LiAqLworICAgICAgICAgIFBvc3RN ZXNzYWdlIChod25kLCBXTV9FTUFDU19UUkFDS19DQVJFVCwgMCwgMCk7CisgICAgICAgIH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Z3JvdW5k OworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoIWFjdGl2 ZV9wKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgZW51bSBm YWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYs IGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1wcmUtenYtZmFjZSIpLCB0cnVl KTsKKyAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2luYWN0aXZlX2Zh Y2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAg ICAgICAgICAgICAgICBnY192YWx1ZXMuZm9yZWdyb3VuZCA9IGhvbGxvd19pbmFjdGl2ZV9mYWNl LT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5iYWNrZ3JvdW5k ID0gaG9sbG93X2luYWN0aXZlX2ZhY2UtPmJhY2tncm91bmQ7CisgICAgICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYyA9IFhDcmVhdGVHQyAo TlVMTCwgRlJBTUVfVzMyX1dJTkRPVyAoZiksIG1hc2ssICZnY192YWx1ZXMpOworICAgICAgICAg IGJsb2NrX2lucHV0ICgpOworICAgICAgICAgIC8qIEZvcmNlIGBtY193MzJfc2V0X2N1cnNvcl9n YycgdG8gdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycuICovCisgICAgICAg ICAgYm9vbCBjdXJzb3JfZ2NfcCA9IHRydWU7CisgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5 cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBv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FjZSAq aG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2Vf aWQpOworICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0 aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgICBnY192YWx1ZXMuYmFja2dy b3VuZCA9IGhvbGxvd19hY3RpdmVfcmVnaW9uX2JlZ19mYWNlLT5mb3JlZ3JvdW5kOworICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAg ICAgICAgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAg ICAgICYmIGN1cnNvcl9nbHlwaC0+Y2hhcnBvcyA9PSByZWdpb25fZW5kKQorICAgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9y ZWdpb25fZW5kX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1y ZWFsLWZha2UtY3Vyc29yLWF0LXJlZ2lvbi1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAg ICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfcmVnaW9uX2VuZF9mYWNlID0g RkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZV9pZCk7CisgICAg ICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29r dXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1m YWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3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Gl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVy biAoIistcmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAg ICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lE IChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICAgIGdjX3Zh bHVlcy5mb3JlZ3JvdW5kID0gaG9sbG93X2FjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kOworICAgICAg ICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5iYWNrZ3JvdW5kID0gaG9sbG93X2FjdGl2ZV9yZWdp b25fYmV0d2Vlbl9mYWNlLT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICAgICAgICB9CisgICAg ICAgICAgICAgICAgICAgIGVsc2UgaWYgKGFjdGl2ZV9wKQorICAgICAgICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2Zh Y2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vy c29yLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0 IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2FjdGl2 ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5mb3JlZ3JvdW5k ID0gaG9sbG93X2FjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICAgICAgICAg ICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmJhY2tncm91bmQ7 CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYg KCFhY3RpdmVfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25h bWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1wcmUt enYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2Ug KmhvbGxvd19pbmFjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfaW5hY3RpdmVf ZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5mb3JlZ3JvdW5k ID0gaG9sbG93X2luYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgICAg ICAgICAgIGdjX3ZhbHVlcy5iYWNrZ3JvdW5kID0gaG9sbG93X2luYWN0aXZlX2ZhY2UtPmJhY2tn cm91bmQ7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGYtPm91dHB1 dF9kYXRhLnczMi0+Y3Vyc29yX2djID0gWENyZWF0ZUdDIChOVUxMLCBGUkFNRV9XMzJfV0lORE9X IChmKSwgbWFzaywgJmdjX3ZhbHVlcyk7CisgICAgICAgICAgICAgIGJsb2NrX2lucHV0ICgpOwor ICAgICAgICAgICAgICAvKiBGb3JjZSBgbWNfdzMyX3NldF9jdXJzb3JfZ2MnIHRvIHVzZSBgcy0+ Zi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MnLiAqLworICAgICAgICAgICAgICBib29sIGN1 cnNvcl9nY19wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcs IG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2Qs IGFjdGl2ZV9wLCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgICAgIGYtPm91dHB1dF9kYXRhLncz Mi0+Y3Vyc29yX2djID0gb3JpZ2luYWxfY3Vyc29yX2djOworICAgICAgICAgICAgICB1bmJsb2Nr X2lucHV0ICgpOworICAgICAgICAgICAgICBtY193MzJfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBt YXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICAgICAg ICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBNQ19IT0xMT1dfQk9YOgorICAgIHsK KyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0g MCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0 X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwnLiAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLncz Mi0+Y3Vyc29yX3BpeGVsID0gY29sb3JfcGl4ZWw7CisgICAgICAgICAgbWNfdzMyX2RyYXdfaG9s bG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2Qs IGgpOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2lu YWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICBtY193 MzJfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBtYXRyaXgs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sc2wsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoX2Zs YXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOworICAgICAgICAg IGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djID0gb3JpZ2luYWxfY3Vyc29yX2djOworICAg ICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAg ICAgIHsKKyAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX3AgPSBmYWxzZTsKKyAgICAgICAgICAg IG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywgRFJBV19DVVJTT1IsIHgsIGhw b3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNsLCBnbHlwaF9m bGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgY3Vyc29yX2djX3ApOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAg IH0KKyAgICBjYXNlIE1DX0JBUjoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxz bC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBU ZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4gKi8K KyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVs OworICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSB0cnVlOworICAg ICAgICAgIG1jX3czMl9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwg ZnksIGhwb3MsIHZwb3MsIHdkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGgs IGN1cnNvcl93aWR0aCwgTUNfQkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAg ICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3Jf cGl4ZWw7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAg IGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSBmYWxzZTsKKyAgICAgICAgICAgIG1j X3czMl9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3Ms IHZwb3MsIHdkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaCwgY3Vyc29y X3dpZHRoLCBNQ19CQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICB9 CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBNQ19IQkFSOgorICAgIHsKKyAgICAgIGlm IChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICAg ICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMy LT5jdXJzb3JfcGl4ZWwnLiAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29y X3BpeGVsID0gY29sb3JfcGl4ZWw7CisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxl X29rYXlfcCA9IHRydWU7CisgICAgICAgICAgbWNfdzMyX2RyYXdfYmFyX2N1cnNvciAodywgbWF0 cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgaCwgY3Vyc29yX3dpZHRoLCBNQ19IQkFSLCBjdXJzb3JfZ2NfaW52 aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4 ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAg ICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSBm YWxzZTsKKyAgICAgICAgICAgIG1jX3czMl9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93 LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgaCwgY3Vyc29yX3dpZHRoLCBNQ19IQkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxl X29rYXlfcCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGRlZmF1bHQ6 CisgICAgICBlbWFjc19hYm9ydCAoKTsKKyAgfQorICAgIH0KK30KKworLyogRHJhdyBnbHlwaCBz dHJpbmcgUy4gKi8KK3N0YXRpYyB2b2lkCittY193MzJfZHJhd19nbHlwaF9zdHJpbmcgKHN0cnVj dCBnbHlwaF9zdHJpbmcgKnMsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGds eXBoX3JvdyAqcm93LAorICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxz bCwgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yLAorICAgICAgICAgICAgICAgICAgICAgICAg ICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlLCBpbnQgY3Vyc29yX3dpZHRoLAorICAg ICAgICAgICAgICAgICAgICAgICAgICBib29sIGFjdGl2ZV9wLCBib29sIGN1cnNvcl9nY19wKQor eworICBib29sIHJlbGllZl9kcmF3bl9wID0gMDsKKyAgLyogSWYgUyBkcmF3cyBpbnRvIHRoZSBi YWNrZ3JvdW5kIG9mIGl0cyBzdWNjZXNzb3IsIGRyYXcgdGhlCisgICAgIGJhY2tncm91bmQgb2Yg dGhlIHN1Y2Nlc3NvciBmaXJzdCBzbyB0aGF0IFMgY2FuIGRyYXcgaW50byBpdC4KKyAgICAgVGhp cyBtYWtlcyBTLT5uZXh0IHVzZSBYRHJhd1N0cmluZyBpbnN0ZWFkIG9mIFhEcmF3SW1hZ2VTdHJp bmcuICovCisgIGlmIChzLT5uZXh0ICYmIHMtPnJpZ2h0X292ZXJoYW5nICYmICFzLT5mb3Jfb3Zl cmxhcHMpCisgICAgeworICAgICAgaW50IHdpZHRoOworICAgICAgc3RydWN0IGdseXBoX3N0cmlu ZyAqbmV4dDsKKyAgICAgIGZvciAod2lkdGggPSAwLCBuZXh0ID0gcy0+bmV4dDsKKyAgICAgICAg ICAgbmV4dCAmJiB3aWR0aCA8IHMtPnJpZ2h0X292ZXJoYW5nOworICAgICAgICAgICB3aWR0aCAr PSBuZXh0LT53aWR0aCwgbmV4dCA9IG5leHQtPm5leHQpCisgICAgICAgIGlmIChuZXh0LT5maXJz dF9nbHlwaC0+dHlwZSAhPSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBt Y193MzJfc2V0X2dseXBoX3N0cmluZ19nYyAobmV4dCwgY3Vyc29yX2djX3ApOworICAgICAgICAg ICAgdzMyX3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmcgKG5leHQpOworICAgICAgICAgICAgaWYg KG5leHQtPmZpcnN0X2dseXBoLT50eXBlID09IFNUUkVUQ0hfR0xZUEgpCisgICAgICAgICAgICAg IG1jX3czMl9kcmF3X3N0cmV0Y2hfZ2x5cGhfc3RyaW5nIChuZXh0KTsKKyAgICAgICAgICAgICAg ZWxzZQorICAgICAgICAgICAgICAgIHczMl9kcmF3X2d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R0xZUEg6CisgICAgICBpZiAocy0+Zm9yX292ZXJs YXBzIHx8IChzLT5jbXBfZnJvbSA+IDAKKyAgICAgICAgICAmJiAhIHMtPmZpcnN0X2dseXBoLT51 LmNtcC5hdXRvbWF0aWMpKQorICAgICAgICBzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wID0gdHJ1ZTsK KyAgICAgIGVsc2UKKyAgICAgICAgdzMyX2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKHMs IHRydWUpOworICAgICAgdzMyX2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5k IChzKTsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgR0xZUEhMRVNTX0dMWVBIOgorICAgICAgaWYg KHMtPmZvcl9vdmVybGFwcykKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7 CisgICAgICBlbHNlCisgICAgICAgIHczMl9kcmF3X2dseXBoX3N0cmluZ19iYWNrZ3JvdW5kIChz LCBmYWxzZSk7CisgICAgICB3MzJfZHJhd19nbHlwaGxlc3NfZ2x5cGhfc3RyaW5nX2ZvcmVncm91 bmQgKHMpOworICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgp OworICAgIH0KKyAgaWYgKCFzLT5mb3Jfb3ZlcmxhcHMpCisgICAgeworICAgICAgLyogRHJhdyB1 bmRlcmxpbmUuICovCisgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3ApCisgICAgICAgIHsK KyAgICAgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9XQVZF KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBDT0xPUlJFRiBjb2xvcjsKKyAgICAgICAg ICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAg ICBjb2xvciA9IHMtPmdjLT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgICAgICAgIGNvbG9yID0gcy0+ZmFjZS0+dW5kZXJsaW5lX2NvbG9yOworICAgICAgICAg ICAgICB3MzJfZHJhd191bmRlcndhdmUgKHMsIGNvbG9yKTsKKyAgICAgICAgICAgIH0KKyAgICAg ICAgICBlbHNlIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX0xJTkUp CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgdGhpY2tuZXNzLCBw b3NpdGlvbjsKKyAgICAgICAgICAgICAgaW50IHk7CisgICAgICAgICAgICAgIGlmIChzLT5wcmV2 ICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV9wCisgICAgICAgICAgICAgICAgICAmJiBzLT5w cmV2LT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgLyogV2UgdXNlIHRoZSBzYW1lIHVuZGVybGluZSBz dHlsZSBhcyB0aGUgcHJldmlvdXMgb25lLiAqLworICAgICAgICAgICAgICAgICAgdGhpY2tuZXNz ID0gcy0+cHJldi0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAgICAgICAgICAgICAgIHBvc2l0 aW9uID0gcy0+cHJldi0+dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIC8q IEdldCB0aGUgdW5kZXJsaW5lIHRoaWNrbmVzcy4gIERlZmF1bHQgaXMgMSBwaXhlbC4gKi8KKyAg ICAgICAgICAgICAgICAgIGlmIChzLT5mb250ICYmIHMtPmZvbnQtPnVuZGVybGluZV90aGlja25l c3MgPiAwKQorICAgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSBzLT5mb250LT51bmRlcmxp bmVfdGhpY2tuZXNzOworICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAg ICAgICAgdGhpY2tuZXNzID0gMTsKKyAgICAgICAgICAgICAgICAgIGlmICh4X3VuZGVybGluZV9h dF9kZXNjZW50X2xpbmUpCisgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmhlaWdo dCAtIHRoaWNrbmVzcykgLSAocy0+eWJhc2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgICAgICAg ZWxzZQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8q IEdldCB0aGUgdW5kZXJsaW5lIHBvc2l0aW9uLiAgVGhpcyBpcyB0aGUgcmVjb21tZW5kZWQKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgIHZlcnRpY2FsIG9mZnNldCBpbiBwaXhlbHMgZnJvbSB0 aGUgYmFzZWxpbmUgdG8gdGhlIHRvcCBvZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhl IHVuZGVybGluZS4gIFRoaXMgaXMgYSBzaWduZWQgdmFsdWUgYWNjb3JkaW5nIHRvIHRoZQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgc3BlY3MsIGFuZCBpdHMgZGVmYXVsdCBpcworICAgICAg ICAgICAgICAgICAgICAgICAgICAgUk9VTkQgKChtYXhpbXVtX2Rlc2NlbnQpIC8gMiksIHdpdGgK KyAgICAgICAgICAgICAgICAgICAgICAgICAgIFJPVU5EICh4KSA9IGZsb29yICh4ICsgMC41KSAg Ki8KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICh4X3VzZV91bmRlcmxpbmVfcG9zaXRpb25f cHJvcGVydGllcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHMtPmZvbnQgJiYgcy0+ Zm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uID49IDApCisgICAgICAgICAgICAgICAgICAgICAgICAg IHBvc2l0aW9uID0gcy0+Zm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICAg ICAgICAgICAgZWxzZSBpZiAocy0+Zm9udCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcG9z aXRpb24gPSAocy0+Zm9udC0+ZGVzY2VudCArIDEpIC8gMjsKKyAgICAgICAgICAgICAgICAgICAg ICB9CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IG1heCAocG9zaXRpb24sIHVuZGVybGlu ZV9taW5pbXVtX29mZnNldCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAvKiBD aGVjayB0aGUgc2FuaXR5IG9mIHRoaWNrbmVzcyBhbmQgcG9zaXRpb24uICBXZSBzaG91bGQKKyAg ICAgICAgICAgICAgICAgYXZvaWQgZHJhd2luZyB1bmRlcmxpbmUgb3V0IG9mIHRoZSBjdXJyZW50 IGxpbmUgYXJlYS4gKi8KKyAgICAgICAgICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQgPD0gcy0+ eWJhc2UgKyBwb3NpdGlvbikKKyAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5oZWlnaHQg LSAxKSAtIChzLT55YmFzZSAtIHMtPnkpOworICAgICAgICAgICAgICBpZiAocy0+eSArIHMtPmhl aWdodCA8IHMtPnliYXNlICsgcG9zaXRpb24gKyB0aGlja25lc3MpCisgICAgICAgICAgICAgICAg dGhpY2tuZXNzID0gKHMtPnkgKyBzLT5oZWlnaHQpIC0gKHMtPnliYXNlICsgcG9zaXRpb24pOwor ICAgICAgICAgICAgICBzLT51bmRlcmxpbmVfdGhpY2tuZXNzID0gdGhpY2tuZXNzOworICAgICAg ICAgICAgICBzLT51bmRlcmxpbmVfcG9zaXRpb24gPXBvc2l0aW9uOworICAgICAgICAgICAgICB5 ID0gcy0+eWJhc2UgKyBwb3NpdGlvbjsKKyAgICAgICAgICAgICAgaWYgKHMtPmZhY2UtPnVuZGVy bGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBz LT5oZGMsIHMtPmdjLT5mb3JlZ3JvdW5kLCBzLT54LAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHksIHMtPndpZHRoLCAxKTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAg ICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmZhY2UtPnVuZGVybGluZV9j b2xvciwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHksIHMtPndpZHRo LCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgLyogRHJhdyBvdmVybGluZS4g Ki8KKyAgICAgIGlmIChzLT5mYWNlLT5vdmVybGluZV9wKQorICAgICAgICB7CisgICAgICAgICAg dW5zaWduZWQgbG9uZyBkeSA9IDAsIGggPSAxOworICAgICAgICAgIGlmIChzLT5mYWNlLT5vdmVy bGluZV9jb2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMtPmYs IHMtPmhkYywgcy0+Z2MtPmZvcmVncm91bmQsIHMtPngsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICBzLT55ICsgZHksIHMtPndpZHRoLCBoKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5mYWNlLT5vdmVybGluZV9jb2xv ciwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+eSArIGR5LCBzLT53aWR0 aCwgaCk7CisgICAgICAgIH0KKyAgICAgIC8qIERyYXcgc3RyaWtlLXRocm91Z2guICovCisgICAg ICBpZiAocy0+ZmFjZS0+c3RyaWtlX3Rocm91Z2hfcAorICAgICAgICAgICYmICFGT05UX1RFWFRN RVRSSUMgKHMtPmZvbnQpLnRtU3RydWNrT3V0KQorICAgICAgICB7CisgICAgICAgICAgdW5zaWdu ZWQgbG9uZyBoID0gMTsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIGR5ID0gKHMtPmhlaWdodCAt IGgpIC8gMjsKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+c3RyaWtlX3Rocm91Z2hfY29sb3JfZGVm YXVsdGVkX3ApCisgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmdj LT5mb3JlZ3JvdW5kLCBzLT54LCBzLT55ICsgZHksCisgICAgICAgICAgICAgICAgICAgICAgICAg ICBzLT53aWR0aCwgaCk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHczMl9maWxs X2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+ZmFjZS0+c3RyaWtlX3Rocm91Z2hfY29sb3IsIHMtPngs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPnkgKyBkeSwgcy0+d2lkdGgsIGgpOwor ICAgICAgICB9CisgICAgICAvKiBEcmF3IHJlbGllZiBpZiBub3QgeWV0IGRyYXduLiAqLworICAg ICAgaWYgKCFyZWxpZWZfZHJhd25fcCAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gpCisg ICAgICAgIHczMl9kcmF3X2dseXBoX3N0cmluZ19ib3ggKHMpOworICAgICAgaWYgKHMtPnByZXYp CisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpwcmV2OworICAgICAg ICAgIGZvciAocHJldiA9IHMtPnByZXY7IHByZXY7IHByZXYgPSBwcmV2LT5wcmV2KQorICAgICAg ICAgICAgaWYgKHByZXYtPmhsICE9IHMtPmhsCisgICAgICAgICAgICAgICAgJiYgcHJldi0+eCAr IHByZXYtPndpZHRoICsgcHJldi0+cmlnaHRfb3ZlcmhhbmcgPiBzLT54KQorICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgLyogQXMgcHJldiB3YXMgZHJhd24gd2hpbGUgY2xpcHBlZCB0 byBpdHMgb3duIGFyZWEsIHdlCisgICAgICAgICAgICAgICAgICAgbXVzdCBkcmF3IHRoZSByaWdo dF9vdmVyaGFuZyBwYXJ0IHVzaW5nIHMtPmhsIG5vdy4gKi8KKyAgICAgICAgICAgICAgICBlbnVt IGRyYXdfZ2x5cGhzX2ZhY2Ugc2F2ZSA9IHByZXYtPmhsOworICAgICAgICAgICAgICAgIHByZXYt PmhsID0gcy0+aGw7CisgICAgICAgICAgICAgICAgbWNfdzMyX3NldF9nbHlwaF9zdHJpbmdfZ2Mg KHByZXYsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICAgICAgICB3MzJfc2V0X2dseXBoX3N0cmlu Z19jbGlwcGluZ19leGFjdGx5IChzLCBwcmV2KTsKKyAgICAgICAgICAgICAgICBpZiAocHJldi0+ Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSCkKKyAgICAgICAgICAgICAgICAgIHczMl9k cmF3X2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChwcmV2KTsKKyAgICAgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICAgICAgdzMyX2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19m b3JlZ3JvdW5kIChwcmV2KTsKKyAgICAgICAgICAgICAgICB3MzJfc2V0X2NsaXBfcmVjdGFuZ2xl IChwcmV2LT5oZGMsIE5VTEwpOworICAgICAgICAgICAgICAgIHByZXYtPmhsID0gc2F2ZTsKKyAg ICAgICAgICAgICAgICBwcmV2LT5udW1fY2xpcHMgPSAwOworICAgICAgICAgICAgICB9CisgICAg ICAgIH0KKyAgICAgIGlmIChzLT5uZXh0KQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGds eXBoX3N0cmluZyAqbmV4dDsKKyAgICAgICAgICBmb3IgKG5leHQgPSBzLT5uZXh0OyBuZXh0OyBu ZXh0ID0gbmV4dC0+bmV4dCkKKyAgICAgICAgICAgIGlmIChuZXh0LT5obCAhPSBzLT5obAorICAg ICAgICAgICAgICAgICYmIG5leHQtPnggLSBuZXh0LT5sZWZ0X292ZXJoYW5nIDwgcy0+eCArIHMt PndpZHRoKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogQXMgbmV4dCB3aWxs IGJlIGRyYXduIHdoaWxlIGNsaXBwZWQgdG8gaXRzIG93biBhcmVhLAorICAgICAgICAgICAgICAg ICAgIHdlIG11c3QgZHJhdyB0aGUgbGVmdF9vdmVyaGFuZyBwYXJ0IHVzaW5nIHMtPmhsIG5vdy4g Ki8KKyAgICAgICAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2Ugc2F2ZSA9IG5leHQtPmhs OworICAgICAgICAgICAgICAgIG5leHQtPmhsID0gcy0+aGw7CisgICAgICAgICAgICAgICAgbWNf dzMyX3NldF9nbHlwaF9zdHJpbmdfZ2MgKG5leHQsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICAg ICAgICB3MzJfc2V0X2dseXBoX3N0cmluZ19jbGlwcGluZ19leGFjdGx5IChzLCBuZXh0KTsKKyAg ICAgICAgICAgICAgICBpZiAobmV4dC0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSCkK KyAgICAgICAgICAgICAgICAgIHczMl9kcmF3X2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChuZXh0 KTsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgdzMyX2RyYXdf Y29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChuZXh0KTsKKyAgICAgICAgICAgICAg ICB3MzJfc2V0X2NsaXBfcmVjdGFuZ2xlIChuZXh0LT5oZGMsIE5VTEwpOworICAgICAgICAgICAg ICAgIG5leHQtPmhsID0gc2F2ZTsKKyAgICAgICAgICAgICAgICBuZXh0LT5udW1fY2xpcHMgPSAw OworICAgICAgICAgICAgICAgIG5leHQtPmNsaXBfaGVhZCA9IHMtPm5leHQ7CisgICAgICAgICAg ICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgLyogUmVzZXQgY2xpcHBpbmcuICovCisgIHczMl9z ZXRfY2xpcF9yZWN0YW5nbGUgKHMtPmhkYywgTlVMTCk7CisgIHMtPm51bV9jbGlwcyA9IDA7Cit9 CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiAvKiBGcmluZ2UgYml0bWFwcy4gICovCiAKIHN0YXRpYyBpbnQgbWF4X2ZyaW5nZV9ibXAg PSAwOwpAQCAtNTQyLDYgKzE3MDEsMTUgQEAgdzMyX3VwZGF0ZV9iZWdpbiAoc3RydWN0IGZyYW1l ICpmKQogICBpZiAoISBGUkFNRV9XMzJfUCAoZikpCiAgICAgcmV0dXJuOwogCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0 aW5nX2ZyYW1lID0gZjsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBSZWdl bmVyYXRlIGRpc3BsYXkgcGFsZXR0ZSBiZWZvcmUgZHJhd2luZyBpZiBsaXN0IG9mIHJlcXVlc3Rl ZAogICAgICBjb2xvcnMgaGFzIGNoYW5nZWQuICovCiAgIGlmIChkaXNwbGF5X2luZm8tPnJlZ2Vu X3BhbGV0dGUpCkBAIC02NzQsNiArMTg0MiwxNiBAQCB3MzJfdXBkYXRlX2VuZCAoc3RydWN0IGZy YW1lICpmKQogCiAgIC8qIE1vdXNlIGhpZ2hsaWdodCBtYXkgYmUgZGlzcGxheWVkIGFnYWluLiAg Ki8KICAgTU9VU0VfSExfSU5GTyAoZiktPm1vdXNlX2ZhY2VfZGVmZXIgPSBmYWxzZTsKKworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5t Y191cGRhdGluZ19mcmFtZSA9IE5VTEw7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK IH0KIAogCkBAIC00MDAyLDEzICs1MTgwLDc0IEBAIHczMl9zZXRfdmVydGljYWxfc2Nyb2xsX2Jh ciAoc3RydWN0IHdpbmRvdyAqdywKIAkgICAgICByZWxlYXNlX2ZyYW1lX2RjIChmLCBoZGMpOwog CSAgICAgIHczMl9jbGVhcl91bmRlcl9pbnRlcm5hbF9ib3JkZXIgKGYpOwogCSAgICB9CisKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisK Ky8qIFJFUEFJTlRJTkcgV0hFTiBSRU1PVklORyBTQ1JPTEwgQkFSOgorCistIFNlcXVlbmNlIG9m IEV2ZW50czoKKworICAuIGByZWRpc3BsYXlfaW50ZXJuYWwnIGNhbGxzIHRoZSBgY29uZGVtbl9z Y3JvbGxfYmFyc19ob29rJywgd2hpY2ggbWFya3MgYWxsCisgICAgc2Nyb2xsIGJhcnMgYXMgY2Fu ZGlkYXRlcyBmb3IgZGVsZXRpb24uCisKKyAgLiBUaGVuIGByZWRpc3BsYXlfaW50ZXJuYWwnIGNh bGxzIGByZWRpc3BsYXlfd2luZG93cycsI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W50IHNvIHRoYXQgdGhlIG5ldyBzY3JvbGwgYmFyCit3aW5kb3cgaXMgdXBk YXRlZC4gKi8KKwogICAgICAgICAgIC8qIE1ha2Ugc3VyZSBzY3JvbGwgYmFyIGlzICJ2aXNpYmxl IiBiZWZvcmUgbW92aW5nLCB0byBlbnN1cmUgdGhlCiAgICAgICAgICAgICAgYXJlYSBvZiB0aGUg cGFyZW50IHdpbmRvdyBub3cgZXhwb3NlZCB3aWxsIGJlIHJlZnJlc2hlZC4gICovCi0gICAgICAg ICAgbXlfc2hvd193aW5kb3cgKGYsIGh3bmQsIFNXX0hJREUpOwotLyoqICAgICAgICAgICBNb3Zl V2luZG93IChod25kLCBsZWZ0LCB0b3AsIHdpZHRoLCBtYXggKGhlaWdodCwgMSksIFRSVUUpOyAq Ki8KLQkgIC8qIFRyeSB0byBub3QgZHJhdyBvdmVyIGNoaWxkIGZyYW1lcy4gICovCi0JICBTZXRX aW5kb3dQb3MgKGh3bmQsIEhXTkRfQk9UVE9NLCBsZWZ0LCB0b3AsIHdpZHRoLCBtYXggKGhlaWdo dCwgMSksCi0gICAgICAgICAgICAgICAgICAgICAgICBTV1BfRlJBTUVDSEFOR0VEKTsKKyAgICAg ICAgICBpZiAobGVmdCA8PSBiYXItPmxlZnQpCisgICAgICAgICAgICBteV9zaG93X3dpbmRvdyAo ZiwgaHduZCwgU1dfSElERSk7CisgICAgICAgICAgTW92ZVdpbmRvdyAoaHduZCwgbGVmdCwgdG9w LCB3aWR0aCwgbWF4IChoZWlnaHQsIDEpLCBsZWZ0IDw9IGJhci0+bGVmdCk7CisKKy8qIGVuZCBN VUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwogCiAJICBzaS5j YlNpemUgPSBzaXplb2YgKHNpKTsKIAkgIHNpLmZNYXNrID0gU0lGX1JBTkdFOwpAQCAtNDI3Nyw2 ICs1NTE2LDIxIEBAIHczMl9qdWRnZV9zY3JvbGxfYmFycyAoc3RydWN0IGZyYW1lICpmKQogICAg IHsKICAgICAgIHN0cnVjdCBzY3JvbGxfYmFyICpiID0gWFNDUk9MTF9CQVIgKGJhcik7CiAKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAg IC8qIGBEZXN0cm95V2luZG93JyB3aXRoaW4gYHhfc2Nyb2xsX2Jhcl9yZW1vdmUnIHJlcGFpbnRz IHRoZSByZWN0YW5nbGUuCisgICAgICBUaGVyZWZvcmUsIHdlIGZpcnN0IHNlbmQgYSBtZXNzYWdl IHRvIGluaGliaXQgcmVwYWludGluZy4gKi8KKyAgICAgIGlmICghV0lORE9XX0xJVkVfUCAoYi0+ d2luZG93KSkKKyAgICAgICAgeworICAgICAgICAgIEhXTkQgaHduZCA9IFNDUk9MTF9CQVJfVzMy X1dJTkRPVyAoYik7CisgICAgICAgICAgU2VuZE1lc3NhZ2UgKGh3bmQsIFdNX1NFVFJFRFJBVywg ZmFsc2UsIDApOworICAgICAgICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAg ICAgIHczMl9zY3JvbGxfYmFyX3JlbW92ZSAoYik7CiAKICAgICAgIG5leHQgPSBiLT5uZXh0OwpA QCAtNzA4OCw2ICs4MzQyLDIwIEBAIGV4dGVybiBmcmFtZV9wYXJtX2hhbmRsZXIgdzMyX2ZyYW1l X3Bhcm1faGFuZGxlcnNbXTsKIAogc3RhdGljIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlIHcz Ml9yZWRpc3BsYXlfaW50ZXJmYWNlID0KIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyogYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGB3 MzJ0ZXJtLmNgIG11c3QgYmUgaW4gdGhlIGV4YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitgcmVkaXNw bGF5X2ludGVyZmFjZScgaW4gYGRpc3BleHRlcm4uaGAhICovCisKKyAgbWNfdzMyX2RyYXdfd2lu ZG93X2N1cnNvciwKKyAgbWNfdzMyX2RyYXdfZ2x5cGhfc3RyaW5nLAorCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKworCiAgIHczMl9mcmFtZV9wYXJtX2hhbmRsZXJzLAogICBndWlfcHJvZHVj ZV9nbHlwaHMsCiAgIGd1aV93cml0ZV9nbHlwaHMsCmRpZmYgLS1naXQgYS9zcmMvd2luZG93Lmgg Yi9zcmMvd2luZG93LmgKaW5kZXggNmIwZjBlNS4uMTRkZDM4YSAxMDA2NDQKLS0tIGEvc3JjL3dp bmRvdy5oCisrKyBiL3NyYy93aW5kb3cuaApAQCAtMzI0LDYgKzMyNCwxNDcgQEAgc3RydWN0IHdp bmRvdwogCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCiAKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIFN1ZmZpeGVzIGZvciB0 aGUgYG1jYCB3aW5kb3cgcG9pbnRlciBwcmVmaXguICovCitzdHJ1Y3QgbXVsdGlwbGVfY3Vyc29y cworeworICAvKiBUaGUgcmVjb3JkZWQgcGl4ZWwgd2lkdGggb2YgdGhlIGxhc3QgbGluZSBudW1i ZXIgZHJhd24gZHVyaW5nIHJlZGlzcGxheSAqLworICBpbnQgbG51bV9waXhlbF93aWR0aDsKK30g bWM7CisKK3N0cnVjdCBtY19tYXRyaXgKK3sKKyAgcHRyZGlmZl90IHZwb3NfYWxsb2NhdGVkOwor ICBwdHJkaWZmX3QgdnBvc191c2VkOworICBwdHJkaWZmX3QgY3Vyc29yc191c2VkWzRdOworICBl bnVtIG1jX2NhY2hlX3R5cGUKKyAgeworICAgIE1DX0NBQ0hFLAorICAgIENIX0NBQ0hFLAorICAg IEZDX0NBQ0hFLAorICAgIE5PX0NBQ0hFCisgIH0gY2FjaGVfdHlwZTsKKyAgc3RydWN0IG1jX3Zw b3MKKyAgeworICAgIHB0cmRpZmZfdCBjYWNoZV9hbGxvY2F0ZWRbNF07CisgICAgcHRyZGlmZl90 IGNhY2hlX3VzZWRbNF07CisgICAgc3RydWN0IG1jX2NvbnRlbnRzCisgICAgeworICAgICAgYm9v bF9iZiBzYW1lX3AgOiAxOworICAgICAgc3RydWN0IGdseXBoIGdseXBoOworICAgICAgaW50IHg7 CisgICAgICBpbnQgZng7CisgICAgICBpbnQgeTsKKyAgICAgIGludCBmeTsKKyAgICAgIGludCBo cG9zOworICAgICAgaW50IHZwb3M7CisgICAgICBpbnQgd2Q7CisgICAgICBpbnQgaDsKKyAgICAg IGVudW0gbWNfY3Vyc29yX3R5cGUKKyAgICAgIHsKKyAgICAgICAgLyogTk9URTogIFRoZSBmcmlu Z2UgYml0bWFwIGZyYW1ld29yayByZWxpZXMgdXBvbiBNQ19OT19GUklOR0VfQklUTUFQCisgICAg ICAgIGhhdmluZyBhIHZhbHVlIG9mIHplcm8gKDApLiAqLworICAgICAgICBNQ19OT19GUklOR0Vf QklUTUFQLAorICAgICAgICBNQ19OT19DVVJTT1IsCisgICAgICAgIE1DX1JJR0hUX0ZSSU5HRV9C SVRNQVAsCisgICAgICAgIE1DX0xFRlRfRlJJTkdFX0JJVE1BUCwKKyAgICAgICAgTUNfRlJBTUVE X0JPWCwKKyAgICAgICAgTUNfRklMTEVEX0JPWCwKKyAgICAgICAgTUNfSE9MTE9XX0JPWCwKKyAg ICAgICAgTUNfQkFSLAorICAgICAgICBNQ19IQkFSCisgICAgICB9IGN1cnNvcl90eXBlOworICAg ICAgaW50IGN1cnNvcl93aWR0aDsKKyAgICAgIHN0cnVjdCBtY19SR0IKKyAgICAgIHsKKyAgICAg ICAgZG91YmxlIHJlZDsKKyAgICAgICAgZG91YmxlIGdyZWVuOworICAgICAgICBkb3VibGUgYmx1 ZTsKKyAgICAgIH0gZmcsIGJnOworICAgICAgYm9vbF9iZiBhY3RpdmVfcCA6IDE7CisgICAgICBl bnVtIG1jX2ZsYXZvcgorICAgICAgeworICAgICAgICBOT19GTEFWT1IsCisgICAgICAgIE1DX0dM WVBILAorICAgICAgICBNQ19HTFlQSExFU1MsCisgICAgICAgIE1DX09WRVJMQVlfQVJST1dfQklU TUFQLAorICAgICAgICBNQ19QSUxDUk9XLAorICAgICAgICBNQ19IT0xMT1dfUkVDVEFOR0xFX1JJ R0hUX0FSUk9XLAorICAgICAgICBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FS Uk9XLAorICAgICAgICBNQ19IT0xMT1dfUkVDVEFOR0xFLAorICAgICAgICBNQ19WRVJUSUNBTF9C QVJfUklHSFRfQVJST1csCisgICAgICAgIE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9B UlJPVywKKyAgICAgICAgTUNfVkVSVElDQUxfQkFSLAorICAgICAgICBNQ19SRVZFUlNFRF9WRVJU SUNBTF9CQVIsCisgICAgICAgIE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgIH0gZ2x5 cGhfZmxhdm9yOworICAgICAgZW51bSBtY19yb3dfcG9zaXRpb24KKyAgICAgIHsKKyAgICAgICAg UFJFX1pWLAorICAgICAgICBBVF9aViwKKyAgICAgICAgUE9TVF9aVgorICAgICAgfSByb3dfcG9z aXRpb247CisgICAgICBib29sX2JmIGVuYWJsZWRfcCA6IDE7CisgICAgfSAqY2FjaGVbNF07Cisg IH0gKnZwb3M7CisgIC8qIFVzZWQgZWxzZXdoZXJlLiAqLworICBzdHJ1Y3QgbWNfZXNzZW50aWFs cworICB7CisgICAgYm9vbF9iZiBhY3RpdmVfcCA6IDE7CisgICAgc3RydWN0IG1jX1JHQiBjaF9m Z1szXSwgZmNfZmdbM10sIHNwX2ZnOworICAgIGludCBmY194OworICAgIGludCB6djsKKyAgICBp bnQgenZfYnl0ZTsKKyAgfSBlc3NlbnRpYWxzOworICAvKiBVc2VkIGVsc2V3aGVyZS4gKi8KKyAg ZW51bSBtY19lbmdpbmVfdHlwZQorICB7CisgICAgTVVMVElQTEVfQ1VSU09SUywKKyAgICBIT1JJ Wk9OVEFMX1JVTEVSLAorICAgIFZFUlRJQ0FMX1JVTEVSLAorICAgIEZJTExfQ09MVU1OLAorICAg IENVUlNPUl9JTkRJQ0FUT1IKKyAgfSBhY3Rpb25fdHlwZTsKKyAgLyogVXNlZCBlbHNld2hlcmUu ICovCisgIGVudW0gbWNfcHJlX3Njcm9sbF9jbGVhbl90eXBlCisgIHsKKyAgICBUUllfV0lORE9X X1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfRE9XTiwKKyAgICBUUllfV0lORE9XX1JFVVNJTkdfQ1VS UkVOVF9NQVRSSVhfVVAsCisgICAgVFJZX1dJTkRPV19JRAorICB9IG1jX3ByZV9zY3JvbGxfY2xl YW5fdHlwZV9fZnJvbV93aGVyZTsKKyAgLyogVXNlZCBlbHNld2hlcmUuICovCisgIGVudW0gbWNf ZHJhd19yb3dfdHlwZQorICB7CisgICAgTk9XSEVSRSwKKyAgICBTQ1JJQkVfT05FLAorICAgIFND UklCRV9UV08sCisgICAgU0NSSUJFX1RIUkVFLAorICAgIFNLSVBQRUQsCisgICAgUE9TVF9DSEFO R0VELAorICAgIFVOQ0hBTkdFRCwKKyAgICBTRVRfQ1VSU09SX09OR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KKworTGlzcF9PYmplY3Qgc3RyaW5nID0gRnBy aW4xX3RvX3N0cmluZyAoaV9zdG9yZSwgUW5pbCk7CitjaGFyICpjaGFyX3N0cmluZyA9IFNTREFU QSAoc3RyaW5nKTsKK2ZwcmludGYgKHN0ZGVyciwgImlfc3RvcmU6ICAlc1xuIiwgY2hhcl9zdHJp bmcpOworCitjaGFyICp3X2NvbnRlbnRzID0gKEJVRkZFUlAgKHctPmNvbnRlbnRzKSAmJiBTVFJJ TkdQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG5hbWUpKSkKKyAgICAgICAgICAgICAg ICAgICA/IFNTREFUQSAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBuYW1lKSkKKyAgICAg ICAgICAgICAgICAgICA6ICJuaWwiOworZnByaW50ZiAoc3RkZXJyLCAiXG5CdWZmZXIgKCVzKVxu Iiwgd19jb250ZW50cyk7CisKK3N0cnVjdCBmYWNlICpmYWNlID0gLi4uCitMaXNwX09iamVjdCBm b3JlZ3JvdW5kID0gZmFjZS0+bGZhY2VbTEZBQ0VfRk9SRUdST1VORF9JTkRFWF07CitMaXNwX09i amVjdCBiYWNrZ3JvdW5kID0gZmFjZS0+bGZhY2VbTEZBQ0VfQkFDS0dST1VORF9JTkRFWF07Citm cHJpbnRmIChzdGRlcnIsICJcbmZvcmVncm91bmQgKCVzKSB8IGJhY2tncm91bmQgKCVzKVxuIiwK KyAgICAgICAgICAgICAgICAgKCFOSUxQIChmb3JlZ3JvdW5kKSA/IFNTREFUQSAoZm9yZWdyb3Vu ZCkgOiAiTklMUCIpLAorICAgICAgICAgICAgICAgICAoIU5JTFAgKGJhY2tncm91bmQpID8gU1NE QVRBIChiYWNrZ3JvdW5kKSA6ICJOSUxQIikpOworCitmcHJpbnRmIChzdGRlcnIsICJNeSBsaXNw IG9iamVjdDogICVzXG4iLCBTU0RBVEEgKEZjaGFyX3RvX3N0cmluZyAobWFrZV9maXhudW0gKDEw MSkpKSk7CisKK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TsJCVwK KwkgICAgICBicmVhazsJCQkJCQkJXAorCQkJCQkJCQkJXAorCSAgICBjYXNlIElNQUdFX0dMWVBI OgkJCQkJCVwKKwkgICAgICBNQ19CVUlMRF9JTUFHRV9HTFlQSF9TVFJJTkcgKFNUQVJULCBFTkQs IEhFQUQsIFRBSUwsCQlcCisJCQkJCUhMLCBYLCBMQVNUX1gpOwkJCVwKKwkgICAgICBicmVhazsK KworI2RlZmluZSBNQ19CVUlMRF9HTFlQSF9TVFJJTkdTX1hXKFNUQVJULCBFTkQsIEhFQUQsIFRB SUwsIEhMLCBYLCBMQVNUX1gpCVwKKyAgICAgICAgICAgIGNhc2UgWFdJREdFVF9HTFlQSDogICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgTUNf QlVJTERfWFdJREdFVF9HTFlQSF9TVFJJTkcgKFNUQVJULCBFTkQsIEhFQUQsIFRBSUwsICAgICAg IFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhMLCBYLCBMQVNU X1gpOyAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgYnJlYWs7CisKKyNkZWZpbmUgTUNf QlVJTERfR0xZUEhfU1RSSU5HU18yKFNUQVJULCBFTkQsIEhFQUQsIFRBSUwsIEhMLCBYLCBMQVNU X1gpCVwKKwkgICAgY2FzZSBHTFlQSExFU1NfR0xZUEg6CQkJCQlcCisJICAgICAgTUNfQlVJTERf R0xZUEhMRVNTX0dMWVBIX1NUUklORyAoU1RBUlQsIEVORCwgSEVBRCwgVEFJTCwJXAorCQkJCQkg ICAgSEwsIFgsIExBU1RfWCk7CQlcCisJICAgICAgYnJlYWs7CQkJCQkJCVwKKwkJCQkJCQkJCVwK KwkgICAgZGVmYXVsdDoJCQkJCQkJXAorCSAgICAgIGVtYWNzX2Fib3J0ICgpOwkJCQkJCVwKKwkg ICAgfQkJCQkJCQkJXAorCQkJCQkJCQkJXAorCSAgaWY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ZWxlbTsKKyAgICB9CisgIHZhX2VuZCAoYXApOworICBy ZXR1cm4gdmFsOworfQorCitMaXNwX09iamVjdAorbWNfbWVtcSAoTGlzcF9PYmplY3QgZWx0LCBM aXNwX09iamVjdCBsaXN0KQoreworICB3aGlsZSAoMSkKKyAgICB7CisgICAgICBpZiAoIUNPTlNQ IChsaXN0KSB8fCBFUSAoWENBUiAobGlzdCksIGVsdCkpCisgICAgICAgIGJyZWFrOworICAgICAg bGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkgfHwgRVEgKFhDQVIg KGxpc3QpLCBlbHQpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsK KyAgICAgIGlmICghQ09OU1AgKGxpc3QpIHx8IEVRIChYQ0FSIChsaXN0KSwgZWx0KSkKKyAgICAg ICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgfQorICByZXR1cm4gbGlz dDsKK30KKworTGlzcF9PYmplY3QKK21jX250aCAoaW50IG51bSwgTGlzcF9PYmplY3QgbGlzdCkK K3sKKyAgZm9yIChpbnQgaSA9IDA7IGkgPCBudW0gJiYgIU5JTFAgKGxpc3QpOyBpKyspCisgICAg bGlzdCA9IFhDRFIgKGxpc3QpOworICBpZiAoQ09OU1AgKGxpc3QpKQorICAgIHJldHVybiBYQ0FS IChsaXN0KTsKKyAgICBlbHNlCisgICAgICByZXR1cm4gUW5pbDsKK30KKworTGlzcF9PYmplY3QK K21jX2Fzc3EgKExpc3BfT2JqZWN0IGtleSwgTGlzcF9PYmplY3QgbGlzdCkKK3sKKyAgd2hpbGUg KDEpCisgICAgeworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1Ag KFhDQVIgKGxpc3QpKQorICAgICAgICAgICAgICAmJiBFUSAoWENBUiAoWENBUiAobGlzdCkpLCBr ZXkpKSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBp ZiAoIUNPTlNQIChsaXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAg ICAgICAgICAgICYmIEVRIChYQ0FSIChYQ0FSIChsaXN0KSksIGtleSkpKQorICAgICAgICBicmVh azsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisg ICAgICAgICAgfHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgRVEgKFhD QVIgKFhDQVIgKGxpc3QpKSwga2V5KSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhD RFIgKGxpc3QpOworICAgIH0KKyAgaWYgKENPTlNQIChsaXN0KSkKKyAgICByZXR1cm4gWENBUiAo bGlzdCk7CisgICAgZWxzZQorICAgICAgcmV0dXJuIFFuaWw7Cit9CisKK0xpc3BfT2JqZWN0Citt Y19hc3NvYyAoTGlzcF9PYmplY3Qga2V5LCBMaXNwX09iamVjdCBsaXN0KQoreworICBMaXNwX09i amVjdCBjYXI7CisgIHdoaWxlICgxKQorICAgIHsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisg ICAgICAgICAgfHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgKGNhciA9 IFhDQVIgKFhDQVIgKGxpc3QpKSwKKyAgICAgICAgICAgICAgICAgIEVRIChjYXIsIGtleSkgfHwg IU5JTFAgKEZlcXVhbCAoY2FyLCBrZXkpKSkpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3Qg PSBYQ0RSIChsaXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAgfHwgKENP TlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgKGNhciA9IFhDQVIgKFhDQVIgKGxp c3QpKSwKKyAgICAgICAgICAgICAgICAgIEVRICh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mlsOworfQorCisvKiBSRUdJT04gQkVHSU46ICBtY19yZWdpb25fbGltaXQgKDEpCisgICBSRUdJ T04gRU5EOiAgbWNfcmVnaW9uX2xpbWl0ICgwKSAqLworcHRyZGlmZl90CittY19yZWdpb25fbGlt aXQgKGJvb2wgYmVnaW5fcCkKK3sKKyAgaWYgKCFOSUxQIChWdHJhbnNpZW50X21hcmtfbW9kZSkK KyAgICAgICYmIE5JTFAgKFZtYXJrX2V2ZW5faWZfaW5hY3RpdmUpCisgICAgICAmJiBOSUxQIChC VkFSIChjdXJyZW50X2J1ZmZlciwgbWFya19hY3RpdmUpKSkKKyAgICB4c2lnbmFsMCAoUW1hcmtf aW5hY3RpdmUpOworICBMaXNwX09iamVjdCBtYXJrZXIgPSBCVkFSIChjdXJyZW50X2J1ZmZlciwg bWFyayk7CisgIGludCBtID0gKFhNQVJLRVIgKG1hcmtlciktPmJ1ZmZlcikKKyAgICAgICAgICA/ IFhNQVJLRVIgKG1hcmtlciktPmNoYXJwb3MKKyAgICAgICAgICA6IC0xOworICByZXR1cm4gKG0g PT0gLTEpCisgICAgICAgICAgID8gLTEKKyAgICAgICAgIDogKFBUIDwgbSkgPT0gYmVnaW5fcAor ICAgICAgICAgICA/IFBUCisgICAgICAgICA6IGNsaXBfdG9fYm91bmRzIChCRUdWLCBtLCBaVik7 Cit9CisKKy8qIENoZWNrIHRoZSBwcmVzZW5jZSBvZiBhIGRpc3BsYXkgcHJvcGVydHkgYW5kIGNv bXB1dGUgaXRzIHdpZHRoLgorICAgSWYgYSBwcm9wZXJ0eSB3YXMgZm91bmQgYW5kIGl0cyB3aWR0 aCB3YXMgZm91bmQgYXMgd2VsbCwgcmV0dXJuCisgICBpdHMgd2lkdGggKD49IDApIGFuZCBzZXQg dGhlIHBvc2l0aW9uIG9mIHRoZSBlbmQgb2YgdGhlIHByb3BlcnR5CisgICBpbiBFTkRQT1MuCisg ICBPdGhlcndpc2UganVzdCByZXR1cm4gLTEuICovCitzdGF0aWMgaW50CittY19jaGVja19kaXNw bGF5X3dpZHRoIChwdHJkaWZmX3QgcG9zLCBwdHJkaWZmX3QgY29sLCBwdHJkaWZmX3QgKmVuZHBv cykKK3sKKyAgTGlzcF9PYmplY3QgdmFsLCBvdmVybGF5OworICBpZiAoQ09OU1AgKHZhbCA9IGdl dF9jaGFyX3Byb3BlcnR5X2FuZF9vdmVybGF5CisgICAgICAgICAgICAgIChtYWtlX2ZpeG51bSAo cG9zKSwgUWRpc3BsYXksIFFuaWwsICZvdmVybGF5KSkKKyAgICAgICYmIEVRIChRc3BhY2UsIFhD QVIgKHZhbCkpKQorICAgIHsgLyogRklYTUU6IFVzZSBjYWxjX3BpeGVsX3dpZHRoX29yX2hlaWdo dC4gKi8KKyAgICAgIExpc3BfT2JqZWN0IHBsaXN0ID0gWENEUiAodmFsKSwgcHJvcDsKKyAgICAg IGludCB3aWR0aCA9IC0xOworICAgICAgRU1BQ1NfSU5UIGFsaWduX3RvX21heCA9IChjb2wgPCBN T1NUX1BPU0lUSVZFX0ZJWE5VTSAtIElOVF9NQVgKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gKEVNQUNTX0lOVCkgSU5UX01BWCArIGNvbAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiBNT1NUX1BPU0lUSVZFX0ZJWE5VTSk7CisgICAgICBpZiAoKHByb3AgPSBt Y19wbGlzdF9nZXQgKHBsaXN0LCBRQ3dpZHRoKSwgUkFOR0VEX0ZJWE5VTVAgKDAsIHByb3AsIElO VF9NQVgpKQorICAgICAgICAgIHx8IChwcm9wID0gbWNfcGxpc3RfZ2V0IChwbGlzdCwgUUNyZWxh dGl2ZV93aWR0aCksCisgICAgICAgICAgICAgIFJBTkdFRF9GSVhOVU1QICgwLCBwcm9wLCBJTlRf TUFYKSkpCisgICAgICAgIHdpZHRoID0gWEZJWE5VTSAocHJvcCk7CisgICAgICAgIGVsc2UgaWYg KEZMT0FUUCAocHJvcCkgJiYgMCA8PSBYRkxPQVRfREFUQSAocHJvcCkKKyAgICAgICAgICAgICAg ICAgJiYgWEZMT0FUX0RBVEEgKHByb3ApIDw9IElOVF9NQVgpCisgICAgICAgICAgd2lkdGggPSAo aW50KShYRkxPQVRfREFUQSAocHJvcCkgKyAwLjUpOworICAgICAgICAgIGVsc2UgaWYgKChwcm9w ID0gbWNfcGxpc3RfZ2V0IChwbGlzdCwgUUNhbGlnbl90byksCisgICAgICAgICAgICAgICAgICAg IFJBTkdFRF9GSVhOVU1QIChjb2wsIHByb3AsIGFsaWduX3RvX21heCkpKQorICAgICAgICAgICAg d2lkdGggPSBYRklYTlVNIChwcm9wKSAtIGNvbDsKKyAgICAgICAgICAgICAgZWxzZSBpZiAoRkxP QVRQIChwcm9wKSAmJiBjb2wgPD0gWEZMT0FUX0RBVEEgKHByb3ApCisgICAgICAgICAgICAgICAg ICAgICAgICYmIChYRkxPQVRfREFUQSAocHJvcCkgPD0gYWxpZ25fdG9fbWF4KSkKKyAgICAgICAg ICAgICAgICB3aWR0aCA9IChpbnQpKFhGTE9BVF9EQVRBIChwcm9wKSArIDAuNSkgLSBjb2w7Cisg ICAgICBpZiAod2lkdGggPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIHB0cmRpZmZfdCBzdGFy dDsKKyAgICAgICAgICBpZiAoT1ZFUkxBWVAgKG92ZXJsYXkpKQorICAgICAgICAgICAgKmVuZHBv cyA9IE9WRVJMQVlfUE9TSVRJT04gKE9WRVJMQVlfRU5EIChvdmVybGF5KSk7CisgICAgICAgICAg ICBlbHNlCisgICAgICAgICAgICAgIGdldF9wcm9wZXJ0eV9hbmRfcmFuZ2UgKHBvcywgUWRpc3Bs YXksICZ2YWwsICZzdGFydCwgZW5kcG9zLCBRbmlsKTsKKyAgICAgICAgICAvKiBGb3IgOnJlbGF0 aXZlLXdpZHRoLCB3ZSBuZWVkIHRvIG11bHRpcGx5IGJ5IHRoZSBjb2x1bW4KKyAgICAgICAgICAg ICB3aWR0aCBvZiB0aGUgY2h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oYXJwb3M7CisgICAgICBlbHNlCisgICAgICAgIGxlbiA9IHN0cmlu Z19ieXRlX3RvX2NoYXIgKHN0cmluZywgYnl0ZXBvcyArIGxlbikgLSBjaGFycG9zOworICAgIH0K KyAgaWYgKGxlbiA8PSAwKQorICAgIHJldHVybiB1bmJpbmRfdG8gKGNvdW50LCBRbmlsKTsKKyAg dG8gPSBsaW1pdCA9IGNoYXJwb3MgKyBsZW47CisjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCisg IGlmIChGUkFNRV9XSU5ET1dfUCAoZikpCisgICAgeworICAgICAgZm9udF9vYmplY3QgPSBmb250 X3JhbmdlIChjaGFycG9zLCBieXRlcG9zLCAmdG8sIHdpbiwgZmFjZSwgc3RyaW5nKTsKKyAgICAg IGlmICghIEZPTlRfT0JKRUNUX1AgKGZvbnRfb2JqZWN0KQorICAgICAgICAgIHx8ICghIE5JTFAg KHJlKQorICAgICAgICAgICAgICAmJiB0byA8IGxpbWl0CisgICAgICAgICAgICAgICYmIChmYXN0 X2xvb2tpbmdfYXQgKHJlLCBjaGFycG9zLCBieXRlcG9zLCB0bywgLTEsIHN0cmluZykgPD0gMCkp KQorICAgICAgICByZXR1cm4gdW5iaW5kX3RvIChjb3VudCwgUW5pbCk7CisgICAgfQorICBlbHNl CisjZW5kaWYgICAgICAgIC8qIG5vdCBIQVZFX1dJTkRPV19TWVNURU0gKi8KKyAgICBmb250X29i amVjdCA9IHdpbi0+ZnJhbWU7CisgIGxnc3RyaW5nID0gRmNvbXBvc2l0aW9uX2dldF9nc3RyaW5n IChwb3MsIG1ha2VfZml4bnVtICh0byksIGZvbnRfb2JqZWN0LAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgc3RyaW5nKTsKKyAgaWYgKE5JTFAgKExHU1RSSU5HX0lEIChs Z3N0cmluZykpKQorICAgIHsKKyAgICAgIC8qIFNhdmUgcG9pbnQgYXMgbWFya2VyIGJlZm9yZSBj YWxsaW5nIG91dCB0by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ycG9zLCAtMSwgJnN0YXJ0LCAmZW5kLCAmcHJvcCwgc3RyaW5nKTsKKyAg ICAgIGNtcF9pdC0+aWQgPSBnZXRfY29tcG9zaXRpb25faWQgKGNoYXJwb3MsIGJ5dGVwb3MsIGVu ZCAtIHN0YXJ0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvcCwg c3RyaW5nKTsKKyAgICAgIGlmIChjbXBfaXQtPmlkIDwgMCkKKyAgICAgICAgZ290byBub19jb21w b3NpdGlvbjsKKyAgICAgIGNtcF9pdC0+bmNoYXJzID0gZW5kIC0gc3RhcnQ7CisgICAgICBjbXBf aXQtPm5nbHlwaHMgPSBjb21wb3NpdGlvbl90YWJsZVtjbXBfaXQtPmlkXS0+Z2x5cGhfbGVuOwor ICAgIH0KKyAgZWxzZSBpZiAodykKKyAgICB7CisgICAgICBMaXNwX09iamVjdCBsZ3N0cmluZyA9 IFFuaWw7CisgICAgICBMaXNwX09iamVjdCB2YWwsIGVsdDsKKyAgICAgIHB0cmRpZmZfdCBpOwor ICAgICAgdmFsID0gQ0hBUl9UQUJMRV9SRUYgKFZjb21wb3NpdGlvbl9mdW5jdGlvbl90YWJsZSwg Y21wX2l0LT5jaCk7CisgICAgICBmb3IgKGkgPSAwOyBpIDwgY21wX2l0LT5ydWxlX2lkeDsgaSsr LCB2YWwgPSBYQ0RSICh2YWwpKTsKKyAgICAgIGlmIChjaGFycG9zIDwgZW5kcG9zKQorICAgICAg ICB7CisgICAgICAgICAgZm9yICg7IENPTlNQICh2YWwpOyB2YWwgPSBYQ0RSICh2YWwpKQorICAg ICAgICAgICAgeworICAgICAgICAgICAgICBlbHQgPSBYQ0FSICh2YWwpOworICAgICAgICAgICAg ICBpZiAoISBWRUNUT1JQIChlbHQpIHx8IEFTSVpFIChlbHQpICE9IDMKKyAgICAgICAgICAgICAg ICAgIHx8ICEgSU5URUdFUlAgKEFSRUYgKGVsdCwgMSkpKQorICAgICAgICAgICAgICAgIGNvbnRp bnVlOworICAgICAgICAgICAgICBpZiAoWEZJWE5BVCAoQVJFRiAoZWx0LCAxKSkgIT0gY21wX2l0 LT5sb29rYmFjaykKKyAgICAgICAgICAgICAgICBnb3RvIG5vX2NvbXBvc2l0aW9uOworICAgICAg ICAgICAgICBsZ3N0cmluZyA9IG1jX2F1dG9jbXBfY2hhcnMgKGVsdCwgY2hhcnBvcywgYnl0ZXBv cywgZW5kcG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcsIGZh Y2UsIHN0cmluZyk7CisgICAgICAgICAgICAgIGlmIChjb21wb3NpdGlvbl9nc3RyaW5nX3AgKGxn c3RyaW5nKSkKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgbGdzdHJpbmcg PSBRbmlsOworICAgICAgICAgICAgICAvKiBDb21wb3NpdGlvbiBmYWlsZWQgcGVyaGFwcyBiZWNh dXNlIHRoZSBmb250IGRvZXNuJ3QKKyAgICAgICAgICAgICAgICAgc3VwcG9ydCBzdWZmaWNpZW50 IHJhbmdlIG9mIGNoYXJhY3RlcnMuICBUcnkgdGhlCisgICAgICAgICAgICAgICAgIG90aGVyIGNv bXBvc2l0aW9uIHJ1bGVzIGlmIGFueS4gICovCisgICAgICAgICAgICB9CisgICAgICAgICAgY21w X2l0LT5yZXZlcnNlZF9wID0gMDsKKyAgICAgICAgfQorICAgICAgZWxzZQorICAgICAgICB7Cisg ICAgICAgICAgcHRyZGlmZl90IGNwb3MgPSBjaGFycG9zLCBicG9zID0gYnl0ZXBvczsKKyAgICAg ICAgICBjbXBfaXQtPnJldmVyc2VkX3AgPSAxOworICAgICAgICAgIGVsdCA9IFhDQVIgKHZhbCk7 CisgICAgICAgICAgaWYgKGNtcF9pdC0+bG9va2JhY2sgPiAwKQorICAgICAgICAgICAgeworICAg ICAgICAgICAgICBjcG9zID0gY2hhcnBvcyAtIGNtcF9pdC0+bG9va2JhY2s7CisgICAgICAgICAg ICAgIGlmIChTVFJJTkdQIChzdHJpbmcpKQorICAgICAgICAgICAgICAgIGJwb3MgPSBzdHJpbmdf Y2hhcl90b19ieXRlIChzdHJpbmcsIGNwb3MpOworICAgICAgICAgICAgICBlbHNlCisgICAgICAg ICAgICAgICAgYnBvcyA9IENIQVJfVE9fQllURSAoY3Bvcyk7CisgICAgICAgICAgICB9CisgICAg ICAgICAgbGdzdHJpbmcgPSBtY19hdXRvY21wX2NoYXJzIChlbHQsIGNwb3MsIGJwb3MsIGNoYXJw b3MgKyAxLCB3LCBmYWNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3Ry aW5nKTsKKyAgICAgICAgICBpZiAoISBjb21wb3NpdGlvbl9nc3RyaW5nX3AgKGxnc3RyaW5nKQor ICAgICAgICAgICAgICB8fCBjcG9zICsgTEdTVFJJTkdfQ0hBUl9MRU4gKGxnc3RyaW5nKSAtIDEg IT0gY2hhcnBvcykKKyAgICAgICAgICAgIC8qIENvbXBvc2l0aW9uIGZhaWxlZCBvciBkaWRuJ3Qg Y292ZXIgdGhlIGN1cnJlbnQKKyAgICAgICAgICAgICAgIGNoYXJhY3Rlci4gICovCisgICAgICAg ICAgICBnb3RvIG5vX2NvbXBvc2l0aW9uOworICAgICAgICB9CisgICAgICBpZiAoTklMUCAobGdz dHJpbmcpKQorICAgICAgICBnb3RvIG5vX2NvbXBvc2l0aW9uOworICAgICAgaWYgKE5JTFAgKExH U1RSSU5HX0lEIChsZ3N0cmluZykpKQorICAgICAgICBsZ3N0cmluZyA9IGNvbXBvc2l0aW9uX2dz dHJpbmdfcHV0X2NhY2hlIChsZ3N0cmluZywgLTEpOworICAgICAgY21wX2l0LT5pZCA9IFhGSVhO VU0gKExHU1RSSU5HX0lEIChsZ3N0cmluZykpOworICAgICAgZm9yIChpID0gMDsgaSA8IExHU1RS SU5HX0dMWVBIX0xFTiAobGdzdHJpbmcpOyBpKyspCisgICAgICAgIGlmIChOSUxQIChMR1NUUklO R19HTFlQSCAobGdzdHJpbmcsIGkpKSkKKyAgICAgICAgICBicmVhazsKKyAgICAgIGNtcF9pdC0+ bmdseXBocyA9IGk7CisgICAgICBjbXBfaXQtPmZyb20gPSAwOworICAgICAgY21wX2l0LT50byA9 IGk7CisgICAgfQorICBlbHNlCisgICAgZ290byBub19jb21wb3NpdGlvbjsKKyAgcmV0dXJuIDE7 Cisgbm9fY29tcG9zaXRpb246CisgIGlmIChjaGFycG9zID09IGVuZHBvcykKKyAgICByZXR1cm4g MDsKKyAgaWYgKGNoYXJwb3MgPCBlbmRwb3MpCisgICAgeworICAgICAgY2hhcnBvcysrOworICAg ICAgaWYgKE5JTFAgKHN0cmluZykpCisgICAgICAgIElOQ19QT1MgKGJ5dGVwb3MpOworICAgICAg ZWxzZQorICAgICAgICBieXRlcG9zICs9IEJZVEVTX0JZX0NIQVJfSEVBRCAoKihTREFUQSAoc3Ry aW5nKSArIGJ5dGVwb3MpKTsKKyAgICB9CisgIGVsc2UKKyAgICB7CisgICAgICBjaGFycG9zLS07 CisgICAgICAvKiBCWVRFUE9TIGlzIGNhbGN1bGF0ZWQgaW4gY29tcG9zaXRpb25fY29tcHV0ZV9z dG9wX3BvcyAqLworICAgICAgYnl0ZXBvcyA9IC0xOworICAgIH0KKyAgaWYgKGNtcF9pdC0+cmV2 ZXJzZWRfcCkKKyAgICBlbmRwb3MgPSAtMTsKKyAgY29tcG9zaXRpb25fY29tcHV0ZV9zdG9wX3Bv cyAoY21wX2l0LCBjaGFycG9zLCBieXRlcG9zLCBlbmRwb3MsIHN0cmluZyk7CisgIHJldHVybiAw OworfQorCisvKiBTY2FubmluZyBmcm9tIHRoZSBiZWdpbm5pbmcgb2YgdGhlIGN1cnJlbnQgbGlu ZSwgc3RvcCBhdCB0aGUgYnVmZmVyCisgICBwb3NpdGlvbiBFTkRQT1Mgb3IgYXQgdGhlIGNvbHVt biBHT0FMQ09MIG9yIGF0IHRoZSBlbmQgb2YgbGluZSwgd2hpY2hldmVyCisgICBjb21lcyBmaXJz dC4K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RvIHRoZSBuZXh0IHBsYWNlCisgICAgICAgICAgICAgd2hlcmUgd2Ug bWlnaHQgbmVlZCB0byBza2lwIG1vcmUgaW52aXNpYmxlIHRleHQuICovCisgICAgICAgICAgc2Nh biA9IHNraXBfaW52aXNpYmxlIChzY2FuLCAmbmV4dF9ib3VuZGFyeSwgZW5kLCBRbmlsKTsKKyAg ICAgICAgICBpZiAoc2NhbiAhPSBvbGRfc2NhbikKKyAgICAgICAgICAgIHNjYW5fYnl0ZSA9IENI QVJfVE9fQllURSAoc2Nhbik7CisgICAgICAgICAgaWYgKHNjYW4gPj0gZW5kKQorICAgICAgICAg ICAgZ290byBlbmRsb29wOworICAgICAgICB9CisgICAgICAvKiBUZXN0IHJlYWNoaW5nIHRoZSBn b2FsIGNvbHVtbi4gIFdlIGRvIHRoaXMgYWZ0ZXIgc2tpcHBpbmcKKyAgIGludmlzaWJsZSBjaGFy YWN0ZXJzLCBzbyB0aGF0IHdlIHB1dCBwb2ludCBiZWZvcmUgdGhlCisgICBjaGFyYWN0ZXIgb24g d2hpY2ggdGhlIGN1cnNvciB3aWxsIGFwcGVhci4gKi8KKyAgICAgIGlmIChjb2wgPj0gZ29hbCkK KyAgICAgICAgYnJlYWs7CisgICAgICBwcmV2X2NvbCA9IGNvbDsKKyAgICAgIHsgLyogQ2hlY2sg ZGlzcGxheSBwcm9wZXJ0eS4gKi8KKyAgICAgICAgcHRyZGlmZl90IGVuZHA7CisgICAgICAgIGlu dCB3aWR0aCA9IG1jX2NoZWNrX2Rpc3BsYXlfd2lkdGggKHNjYW4sIGNvbCwgJmVuZHApOworICAg ICAgICBpZiAod2lkdGggPj0gMCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBjb2wgKz0gd2lk dGg7CisgICAgICAgICAgICBpZiAoZW5kcCA+IHNjYW4pIC8qIEF2b2lkIGluZmluaXRlIGxvb3Bz IHdpdGggMC13aWR0aCBvdmVybGF5cy4gKi8KKyAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgIHNjYW4gPSBlbmRwOworICAgICAgICAgICAgICAgIHNjYW5fYnl0ZSA9IENIQVJfVE9fQllU RSAoc2Nhbik7CisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgIH0KKyAg ICAgICAgICB9CisgICAgICB9CisgICAgICAvKiBDaGVjayBjb21wb3NpdGlvbiBzZXF1ZW5jZS4g Ki8KKyAgICAgIGlmIChjbXBfaXQuaWQgPj0gMAorICAgICAgICAgIHx8IChzY2FuID09IGNtcF9p dC5zdG9wX3BvcworICAgICAgICAgICAgICAmJiBtY19jb21wb3NpdGlvbl9yZXNlYXRfaXQgKCZj bXBfaXQsIHNjYW4sIHNjYW5fYnl0ZSwgZW5kLCB3LCBOVUxMLCBRbmlsKSkpCisgICAgICAgIGNv bXBvc2l0aW9uX3VwZGF0ZV9pdCAoJmNtcF9pdCwgc2Nhbiwgc2Nhbl9ieXRlLCBRbmlsKTsKKyAg ICAgIGlmIChjbXBfaXQuaWQgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIHNjYW4gKz0gY21w X2l0Lm5jaGFyczsKKyAgICAgICAgICBzY2FuX2J5dGUgKz0gY21wX2l0Lm5ieXRlczsKKyAgICAg ICAgICBpZiAoc2NhbiA8PSBlbmQpCisgICAgICAgICAgICBjb2wgKz0gY21wX2l0LndpZHRoOwor ICAgICAgICAgIGlmIChjbXBfaXQudG8gPT0gY21wX2l0Lm5nbHlwaHMpCisgICAgICAgICAgICB7 CisgICAgICAgICAgICAgIGNtcF9pdC5pZCA9IC0xOworICAgICAgICAgICAgICBjb21wb3NpdGlv bl9jb21wdXRlX3N0b3BfcG9zICgmY21wX2l0LCBzY2FuLCBzY2FuX2J5dGUsIGVuZCwgUW5pbCk7 CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGNtcF9pdC5m cm9tID0gY21wX2l0LnRvOworICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICB9CisgICAgICBj ID0gRkVUQ0hfQllURSAoc2Nhbl9ieXRlKTsKKyAgICAgIC8qIFNlZSBpZiB0aGVyZSBpcyBhIGRp c3BsYXkgdGFibGUgYW5kIGl0IHJlbGF0ZXMgdG8gdGhpcyBjaGFyYWN0ZXIuICovCisgICAgICBp ZiAoZHAgIT0gMAorICAgICAgICAgICYmICEgKG11bHRpYnl0ZSAmJiBMRUFESU5HX0NPREVfUCAo YykpCisgICAgICAgICAgJiYgVkVDVE9SUCAoRElTUF9DSEFSX1ZFQ1RPUiAoZHAsIGMpKSkKKyAg ICAgICAgeworICAgICAgICAgIExpc3BfT2JqZWN0IGNoYXJ2ZWM7CisgICAgICAgICAgcHRyZGlm Zl90IGksIG47CisgICAgICAgICAgLyogVGhpcyBjaGFyYWN0ZXIgaXMgZGlzcGxheWVkIHVzaW5n IGEgdmVjdG9yIG9mIGdseXBocy4KKyAgICAgICAgICAgICBVcGRhdGUgdGhlIGNvbHVtbi9wb3Np dGlvbiBiYXNlZCBvbiB0aG9zZSBnbHlwaHMuICovCisgICAgICAgICAgY2hhcnZlYyA9IERJU1Bf Q0hBUl9WRUNUT1IgKGRwLCBjKTsKKyAgICAgICAgICBuID0gQVNJWkUgKGNoYXJ2ZWMpOworICAg ICAgICAgIGZvciAoaSA9IDA7IGkgPCBuOyBpKyspCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIC8qIFRoaXMgc2hvdWxkIGJlIGhhbmRsZWQgdGhlIHNhbWUgYXMKKyAgICAgICAgICAgICAg bmV4dF9lbGVtZW50X2Zyb21fZGlzcGxheV92ZWN0b3IgZG9lcyBpdC4gKi8KKyAgICAgICAgICAg ICAgTGlzcF9PYmplY3QgZW50cnkgPSBBUkVGIChjaGFydmVjLCBpKTsKKyAgICAgICAgICAgICAg aWYgKEdMWVBIX0NPREVfUCAoZW50cnkpKQorICAgICAgICAgICAgICAgIGMgPSBHTFlQSF9DT0RF X0NIQVIgKGVudHJ5KTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIGMgPSAn ICc7CisgICAgICAgICAgICAgIGlmIChjID09ICdcbicpCisgICAgICAgICAgICAgICAgZ290byBl bmRsb29wOworICAgICAgICAgICAgICBpZiAoYyA9PSAnXHInICYmIEVRIChCVkFSIChjdXJyZW50 X2J1ZmZlciwgc2VsZWN0aXZlX2Rpc3BsYXkpLCBRdCkpCisgICAgICAgICAgICAgICAgZ290byBl bmRsb29wOworICAgICAgICAgICAgICBpZiAoYyA9PSAnXHQnKQorICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgIGNvbCArPSB0YWJfd2lkdGg7CisgICAgICAgICAgICAgICAgICBj b2wgPSBjb2wgLyB0YWJfd2lkdGggKiB0YWJfd2lkdGg7CisgICAgICAgICAgICAgICAgfQorICAg ICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICsrY29sOworICAgICAgICAgICAg fQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICAvKiBU aGUgZGlzcGxheSB0YWJsZSBkb2Vzbid0IGFmZmVjdCB0aGlzIGNoYXJhY3RlcjsKKyAgICAgICAg ICAgICAgIGl0IGRpc3BsYXlzIGFzIGl0c2VsZi4gKi8KKyAgICAgICAgICAgIGlmIChjID09ICdc bicpCisgICAgICAgICAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgICAgIGlmIChjID09ICdc cicgJiYgRVEgKEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBzZWxlY3RpdmVfZGlzcGxheSksIFF0KSkK KyAgICAgICAgICAgICAgZ290byBlbmRsb29wOworICAgICAgICAgICAgaWYgKGMgPT0gJ1x0JykK KyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNvbCArPSB0YWJfd2lkdGg7CisgICAg ICAgICAgICAgICAgY29sID0gY29sIC8gdGFiX3dpZHRoICogdGFiX3dpZHRoOworICAgICAgICAg ICAgICB9CisgICAgICAgICAgICAgIGVsc2UgaWYgKG11bHRpYnl0ZSAmJiBMRUFESU5HX0NPREVf UCAoYykpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgLyogU3RhcnQgb2Yg bXVsdGktYnl0ZSBmb3JtLiAqLworICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhciAqcHRy OworICAgICAgICAgICAgICAgICAgaW50IGJ5dGVzLCB3aWR0aDsKKyAgICAgICAgICAgICAgICAg IHB0ciA9IEJZVEVfUE9TX0FERFIgKHNjYW5fYnl0ZSk7CisgICAgICAgICAgICAgICAgICBNQ19N VUxUSUJZVEVfQllURVNfV0lEVEggKHB0ciwgZHAsIGJ5dGVzLCB3aWR0aCk7CisgICAgICAgICAg ICAgICAgICAvKiBTdWJ0cmFjdCBvbmUgdG8gY29tcGVuc2F0ZSBmb3IgdGhlIGluY3JlbWVudAor ICAgICAgICAgICAgICAgICAgdGhhdCBpcyBnb2luZyB0byBoYXBwZW4gYmVsb3cuICovCisgICAg ICAgICAgICAgICAgICBzY2FuX2J5dGUgKz0gYnl0ZXMgLSAxOworICAgICAgICAgICAgICAgICAg Y29sICs9IHdpZHRoOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlm IChjdGxfYXJyb3cgJiYgKGMgPCAwNDAgfHwgYyA9PSAwMTc3KSkKKyAgICAgICAgICAgICAgICAg IGNvbCArPSAyOworICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoYyA8IDA0MCB8fCBjID49IDAx NzcpCisgICAgICAgICAgICAgICAgICAgIGNvbCArPSA0OworICAgICAgICAgICAgICAgICAgICBl bHNlCisgICAgICAgICAgICAgICAgICAgICAgY29sKys7CisgICAgICAgICAgfQorICAgICAgc2Nh bisrOworICAgICAgc2Nhbl9ieXRlKys7CisgICAgfQorIGVuZGxvb3A6CisgIGxhc3Rfa25vd25f Y29sdW1uID0gY29sOworICBsYXN0X2tub3duX2NvbHVtbl9wb2ludCA9IHB0OworICBsYXN0X2tu b3duX2NvbHVtbl9tb2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47CisgIHB0cmRpZmZfdCBw b3N0X3RhYjsKKyAgaW50IGM7CisgIGludCB0YWJfd2lkdGggPSBTQU5FX1RBQl9XSURUSCAoY3Vy cmVudF9idWZmZXIpOworICBib29sIGN0bF9hcnJvdyA9ICFOSUxQIChCVkFSIChjdXJyZW50X2J1 ZmZlciwgY3RsX2Fycm93KSk7CisgIHN0cnVjdCBMaXNwX0NoYXJfVGFibGUgKmRwID0gYnVmZmVy X2Rpc3BsYXlfdGFibGUgKCk7CisgIGlmIChwdCA9PSBsYXN0X2tub3duX2NvbHVtbl9wb2ludAor ICAgICAgJiYgTU9ESUZGID09IGxhc3Rfa25vd25fY29sdW1uX21vZGlmaWVkKQorICAgIHsKKyAg ICAgIGlmIChvbGRfYnVmZmVyKQorICAgICAgICBzZXRfYnVmZmVyX2ludGVybmFsIChvbGRfYnVm ZmVyKTsKKyAgICAgIHJldHVybiBsYXN0X2tub3duX2NvbHVtbjsKKyAgICB9CisgIC8qIElmIHRo ZSBidWZmZXIgaGFzIG92ZXJsYXlzLCB0ZXh0IHByb3BlcnRpZXMsCisgICAgIG9yIG11bHRpYnl0 ZSBjaGFyYWN0ZXJzLCB1c2UgYSBtb3JlIGdlbmVyYWwgYWxnb3JpdGhtLiAqLworICBpZiAoYnVm ZmVyX2ludGVydmFscyAoY3VycmVudF9idWZmZXIpCisgICAgICB8fCBidWZmZXJfaGFzX292ZXJs YXlzICgpCisgICAgICB8fCBaICE9IFpfQllURSkKKyAgICB7CisgICAgICBFTUFDU19JTlQgY29s ID0gTU9TVF9QT1NJVElWRV9GSVhOVU07CisgICAgICBtY19zY2FuX2Zvcl9jb2x1bW4gKCZwdCwg JmNvbCwgTlVMTCwgcHQpOworICAgICAgeworICAgICAgICBpZiAob2xkX2J1ZmZlcikKKyAgICAg ICAgICBzZXRfYnVmZmVyX2ludGVybmFsIChvbGRfYnVmZmVyKTsKKyAgICAgICAgcmV0dXJuIGNv bDsKKyAgICAgIH0KKyAgICB9CisgIC8qIFNjYW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 LiAqLworICAgICAgICAgIHN0b3AgPSBCRUdWX0FERFI7CisgICAgICAgICAgcHRyID0gR1BUX0FE RFI7CisgICAgICAgICAgLyogQ2hlY2sgd2hldGhlciB0aGF0IGJyaW5ncyB1cyB0byBiZWdpbm5p bmcgb2YgYnVmZmVyLiAqLworICAgICAgICAgIGlmIChCRUdWID49IEdQVCkKKyAgICAgICAgICAg IGJyZWFrOworICAgICAgICB9CisgICAgICBjID0gKi0tcHRyOworICAgICAgaWYgKGRwICYmIFZF Q1RPUlAgKERJU1BfQ0hBUl9WRUNUT1IgKGRwLCBjKSkpCisgICAgICAgIHsKKyAgICAgICAgICBj aGFydmVjID0gRElTUF9DSEFSX1ZFQ1RPUiAoZHAsIGMpOworICAgICAgICAgIG4gPSBBU0laRSAo Y2hhcnZlYyk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAg ICAgIGNoYXJ2ZWMgPSBRbmlsOworICAgICAgICAgICAgbiA9IDE7CisgICAgICAgICAgfQorICAg ICAgZm9yIChpID0gbiAtIDE7IGkgPj0gMDsgLS1pKQorICAgICAgICB7CisgICAgICAgICAgaWYg KFZFQ1RPUlAgKGNoYXJ2ZWMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBUaGlz IHNob3VsZCBiZSBoYW5kbGVkIHRoZSBzYW1lIGFzCisgICAgICAgICAgIG5leHRfZWxlbWVudF9m cm9tX2Rpc3BsYXlfdmVjdG9yIGRvZXMgaXQuICovCisgICAgICAgICAgICAgIExpc3BfT2JqZWN0 IGVudHJ5ID0gQVJFRiAoY2hhcnZlYywgaSk7CisgICAgICAgICAgICAgIGlmIChHTFlQSF9DT0RF X1AgKGVudHJ5KSkKKyAgICAgICAgICAgICAgICBjID0gR0xZUEhfQ09ERV9DSEFSIChlbnRyeSk7 CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgYyA9ICcgJzsKKyAgICAg ICAgICAgIH0KKyAgICAgICAgICBpZiAoYyA+PSAwNDAgJiYgYyA8IDAxNzcpCisgICAgICAgICAg ICBjb2wrKzsKKyAgICAgICAgICAgIGVsc2UgaWYgKGMgPT0gJ1xuJworICAgICAgICAgICAgICAg ICAgICAgfHwgKGMgPT0gJ1xyJworICAgICAgICAgICAgICAgICAgICAgICAgICYmIEVRIChCVkFS IChjdXJyZW50X2J1ZmZlciwgc2VsZWN0aXZlX2Rpc3BsYXkpLCBRdCkpKQorICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgcHRyKys7CisgICAgICAgICAgICAgICAgZ290byBzdGFydF9v Zl9saW5lX2ZvdW5kOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UgaWYgKGMg PT0gJ1x0JykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBpZiAodGFiX3Nl ZW4pCisgICAgICAgICAgICAgICAgICAgIGNvbCA9ICgoY29sICsgdGFiX3dpZHRoKSAvIHRhYl93 aWR0aCkgKiB0YWJfd2lkdGg7CisgICAgICAgICAgICAgICAgICBwb3N0X3RhYiArPSBjb2w7Cisg ICAgICAgICAgICAgICAgICBjb2wgPSAwOworICAgICAgICAgICAgICAgICAgdGFiX3NlZW4gPSAx OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlmIChWRUNUT1JQIChj aGFydmVjKSkKKyAgICAgICAgICAgICAgICAgIC8qIFdpdGggYSBkaXNwbGF5IHRhYmxlIGVudHJ5 LCBDIGlzIGRpc3BsYXllZCBhcyBpcywgYW5kCisgICAgICAgICAgICAgICAgICAgICBub3QgZGlz cGxheWVkIGFzIFxOTk4gb3IgYXMgXk4uICBJZiBDIGlzIGEgc2luZ2xlLWJ5dGUKKyAgICAgICAg ICAgICAgICAgICAgIGNoYXJhY3RlciwgaXQgdGFrZXMgb25lIGNvbHVtbi4gIElmIEMgaXMgbXVs dGktYnl0ZSBpbgorICAgICAgICAgICAgICAgICAgICAgYSB1bmlie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nVjdCBmcmFtZSAqZikKK3sKKyAgTGlzcF9PYmplY3Qg ZnJhbWU7CisgIFhTRVRGUkFNRSAoZnJhbWUsIGYpOworICByZXR1cm4gU1NEQVRBIChGcHJpbjFf dG9fc3RyaW5nIChmcmFtZSwgUW5pbCkpOworfQorCisvKiBVU0FHRTogIGZwcmludGYgKHN0ZGVy ciwgIldJTkRPVyAoJXMpIiwgbWNfd2luZG93ICh3KSk7ICovCitjaGFyICoKK21jX3dpbmRvdyAo c3RydWN0IHdpbmRvdyAqdykKK3sKKyAgTGlzcF9PYmplY3Qgd2luZG93OworICBYU0VUV0lORE9X ICh3aW5kb3csIHcpOworICByZXR1cm4gU1NEQVRBIChGcHJpbjFfdG9fc3RyaW5nICh3aW5kb3cs IFFuaWwpKTsKK30KKworLyogVVNBR0U6ICBmcHJpbnRmIChzdGRlcnIsICJDSEFSQUNURVIgKCVz KSIsIG1jX2NoYXJfdG9fc3RyaW5nIChnbHlwaC0+dS5jaCkpOyAqLworY2hhciAqCittY19jaGFy X3RvX3N0cmluZyAoaW50IGFyZykKK3sKKyAgTGlzcF9PYmplY3QgY2hhcmFjdGVyID0gKDAgPD0g YXJnICYmIGFyZyA8PSBNQVhfQ0hBUikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgID8gRmNo YXJfdG9fc3RyaW5nIChtYWtlX2ZpeG51bSAoYXJnKSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogUW5pbDsKKyAgY2hhciAqIHJlc3VsdCA9ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAg ICAgICAgICAgICAgICYmIGFyZyA9PSA5KQorICAgICAgICAgICAgICAgICAgICA/ICJcXHQiCisg ICAgICAgICAgICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAg ICAgJiYgYXJnID09IDEwKQorICAgICAgICAgICAgICAgICAgICA/ICJcXG4iCisgICAgICAgICAg ICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJn ID09IDMyKQorICAgICAgICAgICAgICAgICAgICA/ICJcXHMiCisgICAgICAgICAgICAgICAgICA6 ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnICE9IDkKKyAg ICAgICAgICAgICAgICAgICAgICYmIGFyZyAhPSAxMAorICAgICAgICAgICAgICAgICAgICAgJiYg YXJnICE9IDMyKQorICAgICAgICAgICAgICAgICAgICA/IFNTREFUQSAoY2hhcmFjdGVyKQorICAg ICAgICAgICAgICAgICAgOiAiXFw/IjsKKyAgcmV0dXJuIHJlc3VsdDsKK30KKworaW50CittY19s aXNwX3RvX2N1cnNvcl90eXBlIChMaXNwX09iamVjdCBhcmcpCit7CisgIGNoYXIgKnN0cjsKKyAg aWYgKFhUWVBFIChhcmcpID09IExpc3BfU3RyaW5nKQorICAgIHN0ciA9IFNTREFUQSAoYXJnKTsK KyAgICBlbHNlIGlmIChYVFlQRSAoYXJnKSA9PSBMaXNwX1N5bWJvbCkKKyAgICAgIHN0ciA9IFNT REFUQSAoU1lNQk9MX05BTUUgKGFyZykpOworICAgICAgZWxzZSByZXR1cm4gLTE7CisgIGlmICgh c3RyY21wIChzdHIsICJubyIpKQorICAgIHJldHVybiBNQ19OT19DVVJTT1I7CisgIGlmICghc3Ry Y21wIChzdHIsICJtYy1sZWZ0LWZyaW5nZS1iaXRtYXAiKSkKKyAgICByZXR1cm4gTUNfTEVGVF9G UklOR0VfQklUTUFQOworICBpZiAoIXN0cmNtcCAoc3RyLCAibWMtcmlnaHQtZnJpbmdlLWJpdG1h cCIpKQorICAgIHJldHVybiBNQ19SSUdIVF9GUklOR0VfQklUTUFQOworICBpZiAoIXN0cmNtcCAo c3RyLCAiYm94IikpCisgICAgcmV0dXJuIE1DX0ZJTExFRF9CT1g7CisgIGlmICghc3RyY21wIChz dHIsICJmcmFtZWQiKSkKKyAgICByZXR1cm4gTUNfRlJBTUVEX0JPWDsKKyAgaWY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JuICJFWFBPU0VfQVJFQV9UV08iOworICAgICAgY2FzZSBF WFBPU0VfTElORTogcmV0dXJuICJFWFBPU0VfTElORSI7CisgICAgICBkZWZhdWx0OgorICAgICAg cmV0dXJuICJVTktOT1dOIjsKKyAgICB9Cit9CisKK3ZvaWQKK21jX2NhY2hlX2luc3BlY3RvciAo c3RydWN0IHdpbmRvdyAqdywgc3RydWN0IG1jX21hdHJpeCBtYXRyaXgpCit7CisgIGludCB2cG9z X2FsbG9jYXRlZCA9IHctPm1jX21hdHJpeC52cG9zX2FsbG9jYXRlZDsKKyAgaW50IHZwb3NfdXNl ZCA9IHctPm1jX21hdHJpeC52cG9zX3VzZWQ7CisgIGZwcmludGYgKHN0ZGVyciwgIiVzOiAgbWF0 cml4LnZwb3NfYWxsb2NhdGVkICglZCkgfCBtYXRyaXgudnBvc191c2VkICglZClcbiIsCisgICAg ICAgICAgICAgICAgICAgbWNfd2luZG93ICh3KSwgdnBvc19hbGxvY2F0ZWQsIHZwb3NfdXNlZCk7 CisgIGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAg ICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7CisgICAgICAgKytjYWNoZV90eXBlKQorICAgIHsKKyAg ICAgIGludCBjdXJzb3JzX3VzZWQgPSB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5 cGVdOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICBtYXRyaXguY3Vyc29yc191c2VkWyVzXSAo JWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgICBtY19jYWNoZV90eXBlX3RvX3N0cmluZyAo Y2FjaGVfdHlwZSksIGN1cnNvcnNfdXNlZCk7CisgICAgfQorICBmb3IgKGludCB2bnRoID0gMDsK KyAgICAgICB2bnRoIDwgdy0+bWNfbWF0cml4LnZwb3NfdXNlZDsKKyAgICAgICArK3ZudGgpCisg ICAgeworICAgICAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hF OworICAgICAgICAgICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7CisgICAgICAgICAgICsrY2FjaGVf dHlwZSkKKyAgICAgICAgeworICAgICAgICAgIGludCBjYWNoZV9hbGxvY2F0ZWQgPSB3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV07CisgICAgICAgICAg aW50IGNhY2hlX3VzZWQgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hl X3R5cGVdOworICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgICB2bnRoICglZCkgfCBjYWNo ZV9hbGxvY2F0ZWRbJXNdICglZCkgfCBjYWNoZV91c2VkWyVzXSAoJWQpXG4iLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgdm50aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2Nh Y2hlX3R5cGVfdG9fc3RyaW5nIChjYWNoZV90eXBlKSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgIGNhY2hlX2FsbG9jYXRlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2NhY2hl X3R5cGVfdG9fc3RyaW5nIChjYWNoZV90eXBlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg IGNhY2hlX3VzZWQpOworICAgICAgICB9CisgICAgfQorfQorCit2b2lkCittY19zZXRfbHNsX2Jn IChzdHJ1Y3Qgd2luZG93ICp3LCBlbnVtIGZhY2VfaWQgZmFjZV9pZCwgc3RydWN0IG1jX1JHQiAq bHNsKQoreworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgc3RydWN0 IGZhY2UgKmZhY2U7CisgIGlmICghTklMUCAoVmZhY2VfcmVtYXBwaW5nX2FsaXN0KQorICAgICAg JiYgKGZhY2VfaWQg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udGlhbHMtPmZjX3gg PSAoZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChWZGlzcGxh eV9saW5lX251bWJlcnMpKQorICAgICAgICAgICAgICAgICAgICAgICA/IChmaWxsX2NvbCAqIGZy YW1lX2NoYXJfd2lkdGgpICsgdy0+bWMubG51bV9waXhlbF93aWR0aCAtIGhzY2xfeAorICAgICAg ICAgICAgICAgICAgICAgOiAoZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAgICAgICAgICAgICAg JiYgTklMUCAoVmRpc3BsYXlfbGluZV9udW1iZXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAg PyAoZmlsbF9jb2wgKiBmcmFtZV9jaGFyX3dpZHRoKSAtIGhzY2xfeAorICAgICAgICAgICAgICAg ICAgICAgOiAwOworICBpZiAob2xkX2J1ZmZlcikKKyAgICBzZXRfYnVmZmVyX2ludGVybmFsIChv bGRfYnVmZmVyKTsKKyAgZW51bSBmYWNlX2lkIGZpbGxfY29sdW1uX3ByZV96dl9mYWNlX2lkID0K KyAgICAoIWVzc2VudGlhbHMtPmFjdGl2ZV9wCisgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGZjX2luYWN0aXZlX3dpbmRvd3MpKQorICAgICAmJiBOSUxQIChCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICAgID8gbG9va3VwX25h bWVkX2ZhY2UgKHcsIGYsIGludGVybiAoImZjLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUp CisgICAgOiAoIWVzc2VudGlhbHMtPmFjdGl2ZV9wCisgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhC VUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfaW5hY3RpdmVfd2luZG93cykpCisgICAgICAgJiYgIU5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICA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3RpdmVfd2luZG93cykpCisgICAgICYm IE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgICAg PyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiZmMtaW5hY3RpdmUtYXQtenYtZmFj ZSIpLCB0cnVlKQorICAgIDogKCFlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAgICAgICYmICFOSUxQ IChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX2luYWN0aXZlX3dpbmRvd3MpKQorICAg ICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQor ICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgJiYg dy0+Y3Vyc29yLnggPT0gZXNzZW50aWFscy0+ZmNfeCkKKyAgICAgID8gbG9va3VwX25hbWVkX2Zh Y2UgKHcsIGYsIGludGVybiAoImZjLW9wb2ludC1pbmFjdGl2ZS1hdC16di1mYWNlIiksIHRydWUp CisgICAgOiAoZXNzZW50aWFscy0+YWN0aXZlX3AKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJV RkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAmJiAhTklMUCAoQlZBUiAo YiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICYmIHctPmN1cnNvci54ID09IGVzc2VudGlh bHMtPmZjX3gpCisgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCJmYy1v cG9pbnQtYXQtenYtZmFjZSIpLCB0cnVlKQorICAgIDogKCFlc3NlbnRpYWxzLT5hY3RpdmVfcAor ICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX2luYWN0aXZl X3dpbmRvd3MpKQorICAgICAgICYmICFOSUxQI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lbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIs IGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAmJiB3LT5jdXJzb3IueCA9PSBlc3NlbnRpYWxz LT5mY194KQorICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiZmMtb3Bv aW50LXBvc3QtenYtZmFjZSIpLCB0cnVlKQorICAgIDogKCFlc3NlbnRpYWxzLT5hY3RpdmVfcAor ICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX2luYWN0aXZl X3dpbmRvd3MpKQorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGNyb3NzaGFpcnMpKQorICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxl cikpCisgICAgICAgJiYgdy0+Y3Vyc29yLnggIT0gZXNzZW50aWFscy0+ZmNfeCkKKyAgICAgID8g bG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoImZjLWluYWN0aXZlLXBvc3QtenYtZmFj ZSIpLCB0cnVlKQorICAgIDogKGVzc2VudGlhbHMtPmFjdGl2ZV9wCisgICAgICAgJiYgIU5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgJiYgIU5J TFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAmJiB3LT5jdXJzb3IueCAh PSBlc3NlbnRpYWxzLT5mY194KQorICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50 ZXJuICgiZmMtcG9zdC16di1mYWNlIiksIHRydWUpCisgICAgOiBsb29rdXBfbmFtZWRfZmFjZSAo dywgZiwgaW50ZXJuICgiZmMtcG9zdC16di1mYWNlIiksIHRydWUpOworICBzdHJ1Y3QgZm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ogcmVkICovCisgICAgICBpZiAoKCFmaWxsX2NvbHVtbl9w CisgICAgICAgICAgICYmIGN1cnJlbnRfY29sICUgMiAhPSAwCisgICAgICAgICAgICYmIHJvd19w b3NpdGlvbiA9PSBQUkVfWlYpCisgICAgICAgICAgfHwgKGZpbGxfY29sdW1uX3AKKyAgICAgICAg ICAgICAgJiYgY3VycmVudF9jb2wgJSAyICE9IDAKKyAgICAgICAgICAgICAgJiYgY3VycmVudF9j b2wgPD0gZmlsbF9jb2wKKyAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVikp CisgICAgICAgIHsKKyAgICAgICAgICBsc2xfZmctPnJlZCA9IG9kZF9mb3JlZ3JvdW5kLnJlZDsK KyAgICAgICAgICBsc2xfZmctPmdyZWVuID0gb2RkX2ZvcmVncm91bmQuZ3JlZW47CisgICAgICAg ICAgbHNsX2ZnLT5ibHVlID0gb2RkX2ZvcmVncm91bmQuYmx1ZTsKKyAgICAgICAgfQorICAgICAg ICAvKiB5ZWxsb3cgKi8KKyAgICAgICAgZWxzZSBpZiAoKCFmaWxsX2NvbHVtbl9wCisgICAgICAg ICAgICAgICAgICAmJiBjdXJyZW50X2NvbCAlIDIgPT0gMAorICAgICAgICAgICAgICAgICAgJiYg cm93X3Bvc2l0aW9uID09IFBSRV9aVikKKyAgICAgICAgICAgICAgICAgfHwgKGZpbGxfY29sdW1u X3AKKyAgICAgICAgICAgICAgICAgICAgICYmIGN1cnJlbnRfY29sICUgMiA9PSAwCisgICAgICAg ICAgICAgICAgICAgICAmJiBjdXJyZW50X2NvbCA8PSBmaWxsX2NvbAorICAgICAgICAgICAgICAg ICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVikpCisgICAgICAgICAgeworICAgICAgICAg ICAgbHNsX2ZnLT5yZWQgPSBldmVuX2ZvcmVncm91bmQucmVkOworICAgICAgICAgICAgbHNsX2Zn LT5ncmVlbiA9IGV2ZW5fZm9yZWdyb3VuZC5ncmVlbjsKKyAgICAgICAgICAgIGxzbF9mZy0+Ymx1 ZSA9IGV2ZW5fZm9yZWdyb3VuZC5ibHVlOworICAgICAgICAgIH0KKyAgICAgICAgICAvKiBncmVl biAqLworICAgICAgICAgIGVsc2UgaWYgKGZpbGxfY29sdW1uX3AKKyAgICAgICAgICAgICAgICAg ICAmJiBjdXJyZW50X2NvbCA+IGZpbGxfY29sCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bv c2l0aW9uID09IFBSRV9aVikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbHNsX2ZnLT5y ZWQgPSBiZXlvbmRfZmlsbF9mb3JlZ3JvdW5kLnJlZDsKKyAgICAgICAgICAgICAgbHNsX2ZnLT5n cmVlbiA9IGJleW9uZF9maWxsX2ZvcmVncm91bmQuZ3JlZW47CisgICAgICAgICAgICAgIGxzbF9m Zy0+Ymx1ZSA9IGJleW9uZF9maWxsX2ZvcmVncm91bmQuYmx1ZTsKKyAgICAgICAgICAgIH0KKyAg ICAgICAgICAgIGVsc2UgaWYgKHJvd19wb3NpdGlvbiA9PSBBVF9aVikKKyAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgIGxzbF9mZy0+cmVkID0gZXNzZW50aWFscy5zcF9mZy5yZWQ7Cisg ICAgICAgICAgICAgICAgbHNsX2ZnLT5ncmVlbiA9IGVzc2VudGlhbHMuc3BfZmcuZ3JlZW47Cisg ICAgICAgICAgICAgICAgbHNsX2ZnLT5ibHVlID0gZXNzZW50aWFscy5zcF9mZy5ibHVlOworICAg ICAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBIT1JJWk9OVEFMX1JV TEVSOgorICAgIHsKKyAgICAgIGlmIChnbHlwaCAhPSBOVUxMCisgICAgICAgICAgJiYgZ2x5cGgt PnUuY2ggPT0gOTUKKyAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19IQkFSKQorICAgICAg ICB7CisgICAgICAgICAgbHNsX2ZnLT5yZ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b25dLmJsdWU7 CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBDVVJTT1JfSU5ESUNBVE9SOgorICAgIHsK KyAgICAgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICAgICAgZW51bSBm YWNlX2lkIGN1cnNvcl9mYWNlX2lkID0KKyAgICAgICAgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisg ICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF9pbmFjdGl2 ZV93aW5kb3dzKSkKKyAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYpCisgICAgICAg ICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29y LWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpCisgICAgICAgIDogKGVzc2VudGlhbHMuYWN0 aXZlX3AKKyAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVikKKyAgICAgICAgICA/ IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItcHJl LXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgOiAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAg ICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaW5hY3RpdmVf d2luZG93cykpCisgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBBVF9aVikKKyAgICAgICAg ICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNv ci1pbmFjdGl2ZS1hdC16di1mYWNlIiksIHRydWUpCisgICAgICAgIDogKGVzc2VudGlhbHMuYWN0 aXZlX3AKKyAgICAgICAgICAgJiYgcm93X3Bvc2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fbW91c2VfZmFjZSA9IGZhbHNlOworICAgICAgaW50IGR1bW15X3gg PSAwOworICAgICAgLyogSWYgbW91c2UgaGlnaGxpZ2h0aW5nIGlzIG9uLCB3ZSBtYXkgbmVlZCB0 byBkcmF3IGFkamFjZW50CisgICBnbHlwaHMgdXNpbmcgbW91c2UtZmFjZSBoaWdobGlnaHRpbmcu ICovCisgICAgICBpZiAoYXJlYSA9PSBURVhUX0FSRUEgJiYgcm93LT5tb3VzZV9mYWNlX3AKKyAg ICAgICAgICAmJiBobGluZm8tPm1vdXNlX2ZhY2VfYmVnX3JvdyA+PSAwCisgICAgICAgICAgJiYg aGxpbmZvLT5tb3VzZV9mYWNlX2VuZF9yb3cgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIHB0 cmRpZmZfdCByb3dfdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCB3LT5jdXJyZW50X21hdHJp eCk7CisgICAgICAgICAgaWYgKHJvd192cG9zID49IGhsaW5mby0+bW91c2VfZmFjZV9iZWdfcm93 CisgICAgICAgICAgICAgICYmIHJvd192cG9zIDw9IGhsaW5mby0+bW91c2VfZmFjZV9lbmRfcm93 KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBjaGVja19tb3VzZV9mYWNlID0gdHJ1ZTsK KyAgICAgICAgICAgICAgbW91c2VfYmVnX2NvbCA9IChyb3dfdnBvcyA9PSBobGluZm8tPm1vdXNl X2ZhY2VfYmVnX3JvdykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gaGxpbmZvLT5t b3VzZV9mYWNlX2JlZ19jb2wKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogMDsKKyAg ICAgICAgICAgICAgbW91c2VfZW5kX2NvbCA9IChyb3dfdnBvcyA9PSBobGluZm8tPm1vdXNlX2Zh Y2VfZW5kX3JvdykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gaGxpbmZvLT5tb3Vz ZV9mYWNlX2VuZF9jb2wKKyA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gICAgZm9yIChzID0gaDsgczsgcyA9IHMtPm5l eHQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHMtPmxlZnRfb3ZlcndyaXR0ZW5fcCA9 IHRydWU7CisgICAgICAgICAgICAgIHMtPmFjdGlvbl90eXBlID0gYWN0aW9uX3R5cGU7CisgICAg ICAgICAgICAgIGxlbmd0aCArPSBzLT5maXJzdF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAg ICAgICB9CisgICAgICAgICAgcmVsYXRpdmVfeCA9IHN0YXJ0X3ggLSBsZW5ndGg7CisgICAgICAg ICAgZm9yIChzID0gaDsgczsgcyA9IHMtPm5leHQpCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIHMtPmZpcnN0X2dseXBoLT5yZWxhdGl2ZV94ID0gcmVsYXRpdmVfeDsKKyAgICAgICAgICAg ICAgcmVsYXRpdmVfeCArPSBzLT5maXJzdF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAg ICB9CisgICAgICAgICAgc3RhcnQgPSBpOworICAgICAgICAgIGNvbXB1dGVfb3ZlcmhhbmdzX2Fu ZF94ICh0LCBoZWFkLT54LCB0cnVlKTsKKyAgICAgICAgICBwcmVwZW5kX2dseXBoX3N0cmluZ19s aXN0cyAoJmhlYWQsICZ0YWlsLCBoLCB0KTsKKyAgICAgICAgICBpZiAoY2xpcF9oZWFkID09IE5V TEwpCisgICAgICAgICAgICBjbGlwX2hlYWQgPSBoZWFkOworICAgICAgICB9CisgICAgICAvKiBQ cmVwZW5kIGdseXBoIHN0cmluZ3MgZm9yIGdseXBocyBpbiBmcm9udCBvZiB0aGUgZmlyc3QgZ2x5 cGgKKyAgICAgIHN0cmluZyB0aGF0IG92ZXJ3cml0ZSB0aGF0IGdseXBoIHN0cmluZyBiZWNhdXNl IG9mIHRoZWlyCisgICAgICByaWdodCBvdmVyaGFuZy4gIEZvciB0aGVzZSBzdHJpbmdzLCBvbmx5 IHRoZSBmb3JlZ3JvdW5kIG11c3QKKyAgICAgIGJlIGRyYXduLCBiZWNhdXNlIGl0IGRyYXdzIG92 ZXIgdGhlIGdseXBoIHN0cmluZyBhdCBgaGVhZCcuCisgICAgICBUaGUgYmFja2dyb3VuZCBtdXN0 IG5vdCBiZSBkcmF3biBiZWNhdXNlIHRoaXMgd291bGQgb3ZlcndyaXRlCisgICAgICByaWdodCBv dmVyaGFuZ3Mgb2YgcHJlY2VkaW5nIGdseXBocyBmb3Igd2hpY2ggbm8gZ2x5cGgKKyAgICAgIHN0 cmluZ3MgZXhpc3QuICovCisgICAgICBpID0gbGVmdF9vdmVyd3JpdGluZyAoaGVhZCk7CisgICAg ICBpZiAoaSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNl IG92ZXJsYXBfaGw7CisgICAgICAgICAgaWYgKGNoZWNrX21vdXNlX2ZhY2UKKyAgICAgICAgICAg ICAgJiYgbW91c2VfYmVnX2NvbCA8IHN0YXJ0ICYmIG1vdXNlX2VuZF9jb2wgPiBpKQorICAgICAg ICAgICAgb3ZlcmxhcF9obCA9IERSQVdfTU9VU0VfRkFDRTsKKyAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgb3ZlcmxhcF9obCA9IERSQVdfTk9STUFMX1RFWFQ7CisgICAgICAgICAgaWYg KGhsID09IG92ZXJsYXBfaGwgfHwgY2xpcF9oZWFkID09IE5VTEwpCisgICAgICAgICAgICBjbGlw X2hlYWQgPSBoZWFkOworICAgICAgICAgIE1DX0JVSUxEX0dMWVBIX1NUUklOR1MgKGksIHN0YXJ0 LCBoLCB0LCBvdmVybGFwX2hsLCBkdW1teV94LCBsYXN0X3gpOworICAgICAgICAgIGZvciAocyA9 IGg7IHM7IHMgPSBzLT5uZXh0KQorICAgICAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9 IHRydWU7CisgICAgICAgICAgY29tcHV0ZV9vdmVyaGFuZ3NfYW5kX3ggKHQsIGhlYWQtP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k b24ndCBoYXZlIGBlbmQgPSBpOycgaGVyZS4gKi8KKyAgICAgICAgICBjb21wdXRlX292ZXJoYW5n c19hbmRfeCAoaCwgdGFpbC0+eCArIHRhaWwtPndpZHRoLCBmYWxzZSk7CisgICAgICAgICAgYXBw ZW5kX2dseXBoX3N0cmluZ19saXN0cyAoJmhlYWQsICZ0YWlsLCBoLCB0KTsKKyAgICAgICAgICBp ZiAoY2xpcF90YWlsID09IE5VTEwpCisgICAgICAgICAgICBjbGlwX3RhaWwgPSB0YWlsOworICAg ICAgICB9CisgICAgICAvKiBBcHBlbmQgZ2x5cGggc3RyaW5ncyBmb3IgZ2x5cGhzIGZvbGxvd2lu ZyB0aGUgbGFzdCBnbHlwaAorICAgICAgc3RyaW5nIHRhaWwgdGhhdCBvdmVyd3JpdGUgdGFpbC4g IFRoZSBmb3JlZ3JvdW5kIG9mIHN1Y2gKKyAgICAgIGdseXBocyBoYXMgdG8gYmUgZHJhd24gYmVj YXVzZSBpdCB3cml0ZXMgaW50byB0aGUgYmFja2dyb3VuZAorICAgICAgb2YgdGFpbC4gIFRoZSBi YWNrZ3JvdW5kIG11c3Qgbm90IGJlIGRyYXduIGJlY2F1c2UgaXQgY291bGQKKyAgICAgIHBhaW50 IG92ZXIgdGhlIGZvcmVncm91bmQgb2YgZm9sbG93aW5nIGdseXBocy4gKi8KKyAgICAgIGkgPSBy aWdodF9vdmVyd3JpdGluZyAodGFpbCk7CisgICAgICBpZiAoaSA+PSAwKQorICAgICAgICB7Cisg ICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIG92ZXJsYXBfaGw7CisgICAgICAgICAgaWYg KGNoZWNrX21vdXNlX2ZhY2UKKyAgICAgICAgICAgICAgJiYgbW91c2VfYmVnX2NvbCA8IGkgJiYg bW91c2VfZW5kX2NvbCA+IGVuZCkKKyAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX01PVVNF X0ZBQ0U7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFX X05PUk1BTF9URVhUOworICAgICAgICAgIGlmIChobCA9PSBvdmVybGFwX2hsIHx8IGNsaXBfdGFp bCA9PSBOVUxMKQorICAgICAgICAgICAgY2xpcF90YWlsID0gdGFpbDsKKyAgICAgICAgICBpKys7 ICAgICAgLyogV2UgbXVzdCBpbmNsdWRlIHRoZSBJdGggZ2x5cGguICovCisgICAgICAgICAgTUNf QlVJTERfR0xZUEhfU1RSSU5HUyAoZW5kLCBpLCBoLCB0LCBvdmVybGFwX2hsLCB4LCBsYXN0X3gp OworICAgICAgICAgIGZvciAocyA9IGg7IHM7IHMgPSBzLT5uZXh0KQorICAgICAgICAgICAgcy0+ YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICAgICAgY29tcHV0ZV9vdmVyaGFuZ3Nf YW5kX3ggKGgsIHRhaWwtPnggKyB0YWlsLT53aWR0aCwgZmFsc2UpOworICAgICAgICAgIGFwcGVu ZF9nbHlwaF9zdHJpbmdfbGlzdHMgKCZoZWFkLCAmdGFpbCwgaCwgdCk7CisgICAgICAgIH0KKyAg ICAgIHRhaWwgPSBnbHlwaF9zdHJpbmdfY29udGFpbmluZ19iYWNrZ3JvdW5kX3dpZHRoICh0YWls KTsKKyAgICAgIGlmIChjbGlwX3RhaWwpCisgICAgICAgIGNsaXBfdGFpbCA9IGdseXBoX3N0cmlu Z19jb250YWluaW5nX2JhY2tncm91bmRfd2lkdGggKGNsaXBfdGFpbCk7CisgICAgICBpZiAoY2xp cF9oZWFkIHx8IGNsaXBfdGFpbCkKKyAgICAgICAgZm9yIChzID0gaGVhZDsgczsgcyA9IHMtPm5l eHQpCisgICAgICAgICAgeworICAgICAgICAgICAgcy0+Y2xpcF9oZWFkID0gY2xpcF9oZWFkOwor ICAgICAgICAgICAgcy0+Y2xpcF90YWlsID0gY2xpcF90YWlsOworICAgICAgICAgIH0KKyAgICB9 CisgIC8qIERyYXcgYWxsIHN0cmluZ3MuICovC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v dy0+ZW5hYmxlZF9wKQorICAgIHsKKyAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICBmcHJpbnRm IChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6ICByZXR1cm4gKCVkKVxuIiwgMyk7CisgICAgICBy ZXR1cm47CisgICAgfQorICAvKiBJZiBsaW5lIHNwYWNpbmcgaXMgPiAwLCBvbGQgY3Vyc29yIG1h eSBvbmx5IGJlIHBhcnRpYWxseSB2aXNpYmxlIGluCisgICAgIHdpbmRvdyBhZnRlciBzcGxpdC13 aW5kb3cuICBTbyBhZGp1c3QgdmlzaWJsZSBoZWlnaHQuICovCisgIHJvdy0+dmlzaWJsZV9oZWln aHQgPSBtaW4gKHJvdy0+dmlzaWJsZV9oZWlnaHQsCisgICAgICAgICAgICB3aW5kb3dfdGV4dF9i b3R0b21feSAodykgLSByb3ctPnkpOworICAvKiBJZiByb3cgaXMgY29tcGxldGVseSBpbnZpc2li bGUsIGRvbid0IGF0dGVtcHQgdG8gZGVsZXRlIGEgY3Vyc29yIHdoaWNoCisgICAgIGlzbid0IHRo ZXJlLiAgVGhpcyBjYW4gaGFwcGVuIGlmIGN1cnNvciBpcyBhdCB0b3Agb2YgYSB3aW5kb3csIGFu ZAorICAgICB3ZSBzd2l0Y2ggdG8gYSBidWZmZXIgd2l0aCBhIGhlYWRlciBsaW5lIGluIHRoYXQg d2luZG93LiAqLworICBpZiAocm93LT52aXNpYmxlX2hlaWdodCA8PSAwKQorICAgIHsKKyAgICAg IGlmIChkZWJ1Z19wKQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6 ICByZXR1cm4gKCVkKVxuIiwgNCk7CisgICAgICByZXR1cm47CisgICAgfQorICAvKiBJZiBjdXJz b3IgaXMgaW4gdGhlIGZyaW5nZSwgZXJhc2UgYnkgZHJhd2luZyBhY3R1YWwgYml0bWFwIHRoZXJl LiAqLworICBpZiAocm93LT5jdXJzb3JfaW5fZnJpbmdlX3A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AgICBpbnQgdGVtcF94ID0geDsKKyAgICAg IGludCBoZWFkZXJfbGluZV9oZWlnaHQgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsK KyAgICAgIGN1cnNvcl9nbHlwaCA9IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93 LCBocG9zLCB2cG9zKTsKKyAgICAgIGlmIChjdXJzb3JfZ2x5cGggPT0gTlVMTCkKKyAgICAgICAg eworICAgICAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAi bWNfZXJhc2VfY3Vyc29yOiAgcmV0dXJuICglZClcbiIsIDcpOworICAgICAgICAgIHJldHVybjsK KyAgICAgICAgfQorICAgICAgaW50IHRlbXBfd2QgPSBjdXJzb3JfZ2x5cGgtPnBpeGVsX3dpZHRo OworICAgICAgaWYgKHRlbXBfeCA8IDApCisgICAgICAgIHsKKyAgICAgICAgICB0ZW1wX3dkICs9 IHRlbXBfeDsKKyAgICAgICAgICB0ZW1wX3ggPSAwOworICAgICAgICB9CisgICAgICB0ZW1wX3dk ID0gbWluICh3ZCwgd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKSAtIHRlbXBfeCk7Cisg ICAgICBpbnQgZnkgPSBXSU5ET1dfVE9fRlJBTUVfUElYRUxfWSAodywgbWF4IChoZWFkZXJfbGlu ZV9oZWlnaHQsIHJvdy0+eSkpOworICAgICAgaW50IGZ4ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVf UElYRUxfWCAodywgdGVtcF94KTsKKyAgICAgIGlmICh0ZW1wX3dkID4gMCkKKyAgICAgICAgRlJB TUVfUklGIChmKS0+Y2xlYXJfZnJhbWVfYXJlYSAoZiwgZngsIGZ5LCB0ZW1wX3dkLCByb3ctPnZp c2libGVfaGVpZ2h0KTsKKyAgICB9CisgIC8qIEVyYXNlIHRoZSBjdXJzb3IgYnkgcmVkcmF3aW5n IHRoZSBjaGFyYWN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jcm9sbF9tb2RlLCB3LT5jb250ZW50cyksIFFjdXJyZW50 X2xpbmUpOworICAvKiBFWEFNUExFOiAgKHNjcm9sbC1sZWZ0IDUpICovCisgIGJvb2wgaHNjbF9h bGxfdGVtcF9wID0gKHctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hz Y3JvbGwgPT0gMCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIG5vdGhpbmcuICov CisgIGJvb2wgaHNjbF9hbGxfcGVybV8wX3AgPSAody0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSB3LT5oc2Nyb2xsKTsKKyAgLyogRVhBTVBMRTogIEMt dSBDLXggPCBhbmQgZG8gc29tZXRoaW5nIGVsc2UgYmVzaWRlcyBob3Jpem9udGFsbHkgc2Nyb2xs aW5nIHRoZQorICAgICAgICAgICAgICAgY3VycmVudCBsaW5lIGRpZmZlcmVudGx5LgorICAgICAg ICAgICAgICAgQ3VycmVudCBsaW5lIGlzIF9ub3RfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZm ZXJlbnRseS4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzFfcCA9ICghdy0+c3VzcGVuZF9hdXRv X2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9k ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSB3LT5oc2Nyb2xsKTsKKyAgLyog RVhBTVBMRTogIEMtdSBDLXggPCBhbmQgLi4uCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUg aXMgX25vdF8gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhz Y2xfYWxsX3Blcm1fMl9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID09IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5taW5faHNjcm9sbCAhPSB3LT5oc2Nyb2xsKTsKKyAgLyogRVhBTVBMRTogIChzY3JvbGwtbGVm dCA1KTsgYW5kLCB0aGVuIHByZXNzIHRoZSBsZWZ0IGFycm93IGtleSBvbmUgdGltZS4KKyAgICAg ICAgICAgICAgIEN1cnJlbnQgbGluZSBfaXNfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJl bnRseS4qLworICBib29sIGhzY2xfdGVtcF9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAor ICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICYmIHct Pm1pbl9oc2Nyb2xsID09IDApOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBzb21l dGhpbmcgdGhhdCBjYXVzZXMgdGhlIGN1cnJlbnQgbGluZSB0byBiZQorICAgICAgICAgICAgICAg aG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LgorICAgICAgICAgICAgICAgQ3VycmVu dCBsaW5lIF9pc18gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29s IGhzY2xfcGVybV9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAg ICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4g MAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhzY3JvbGwp OworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgaW50IGZyaW5nZV9i aXRtYXAgPSBNQ19OT19GUklOR0VfQklUTUFQOworICBpbnQgZmFjZV9pZCA9IERFRkFVTFRfRkFD RV9JRDsKKyAgaWYgKCFyZW1vdmVfcAorICAgICAgJiYgZ2x5cGhfZmxhdm9yID09IE1DX09WRVJM QVlfQVJST1dfQklUTUFQCisgICAgICAmJiAhaHNjbF9hbGxfdGVtcF9wCisgICAgICAmJiAhaHNj bF90ZW1wX3AKKyAgICAgICYmICFoc2NsX3Blcm1fcAorICAgICAgJiYgIWhzY2xfYWxsX3Blcm1f MF9wCisgICAgICAmJiAhaHNjbF9hbGxfcGVybV8xX3AKKyAgICAgICYmICFoc2NsX2FsbF9wZXJt XzJfcCkKKyAgICB7CisgICAgICBlbnVtIGZhY2Vf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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGZyaW5nZV9i aXRtYXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19OT19GUklOR0VfQklU TUFQOworICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gZmFjZV9pZDsKKyAgICAgIHJv dy0+bGVmdF9mcmluZ2Vfb2Zmc2V0ID0gMDsKKyAgICAgIHJvdy0+ZnJpbmdlX2JpdG1hcF9wZXJp b2RpY19wID0gZmFsc2U7CisgICAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXAgKHcsIHJvdywgdHJ1 ZSwgY3Vyc29yX3R5cGUpOworICAgIH0KKyAgICBlbHNlIGlmICghcmVtb3ZlX3AKKyAgICAgICAg ICAgICAmJiBnbHlwaF9mbGF2b3IgPT0gTUNfT1ZFUkxBWV9BUlJPV19CSVRNQVAKKyAgICAgICAg ICAgICAmJiAoaHNjbF9hbGxfdGVtcF9wCisgICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxsX3Bl cm1fMF9wCisgICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxsX3Blcm1fMV9wCisgICAgICAgICAg ICAgICAgIHx8IGhzY2xfYWxsX3Blcm1fMl9wCisgICAgICAgICAgICAgICAgIHx8IGhzY2xfdGVt cF9wCisgICAgICAgICAgICAgICAgIHx8IGhzY2xfcGVybV9wKSkKKyAgICAgIHsKKyAgICAgICAg ZW51bSBmYWNlX2lkIG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICAgKCFhY3RpdmVf cAorICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF9p bmFjdGl2ZV93aW5kb3dzKSkpCisgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwg aW50ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtaW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwgdHJ1 ZSkKKyAgICAgICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2Zh Y2UgKHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1oc2NsLXByZS16di1mYWNlIiksIHRy dWUpCisgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgIGZhY2VfaWQgPSAoY3Vy c29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgPyBv dmVybGF5X2Fycm93X2ZhY2VfaWQKKyAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lE OworICAgICAgICBpZiAoaHNjbF9hbGxfcGVybV8wX3ApCisgICAgICAgICAgZnJpbmdlX2JpdG1h cCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCBmYWxz ZSwgZmFsc2UpOworICAgICAgICAgIGVsc2UgaWYgKGhzY2xfYWxsX3Blcm1fMV9wKQorICAgICAg ICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIr LWhzY2wtcGVybSIpLCB0cnVlLCBmYWxzZSk7CisgICAgICAgICAgICBlbHNlIGlmIChoc2NsX2Fs bF9wZXJtXzJfcCkKKyAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2Vf Yml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCBmYWxzZSwgdHJ1ZSk7CisgICAgICAg ICAgICAgIGVsc2UgaWYgKGhzY2xfcGVybV9wKQorICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRt YXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgdHJ1 ZSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoaHN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WVz c2FnZXMKKyAgICAgICAgdG8gc2VlIHRoYXQgYHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXBgIHNh dGlzZmllcyB0aGUgZmlyc3QgY29uZGl0aW9uCisgICAgICAgIG9mICh3aGljaCAhPSBOT19GUklO R0VfQklUTUFQKS4gIEF0IHRoaXMgdGltZSwgQGxhd2xpc3QgcHJlZmVycyBub3QgdG8KKyAgICAg ICAgcmVseSB1cG9uIGEgTGlzcCBzZXR0aW5nIHVzaW5nIGBzZXQtZnJpbmdlLWJpdG1hcC1mYWNl Jy4gKi8KKyAgICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0g TUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBmcmluZ2VfYml0bWFwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgIHJvdy0+bGVmdF9mcmlu Z2VfZmFjZV9pZCA9IGZhY2VfaWQ7CisgICAgICAgIHJvdy0+bGVmdF9mcmluZ2Vfb2Zmc2V0ID0g MDsKKyAgICAgICAgcm93LT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3AgPSBmYWxzZTsKKyAgICAg ICAgbWNfZHJhd19mcmluZ2VfYml0bWFwICh3LCByb3csIHRydWUsIGN1cnNvcl90eXBlKTsKKyAg ICAgIH0KKyAgICAgIGVsc2UgaWYgKCFyZW1vdmVfcAorICAgICAgICAgICAgICAgJiYgKGdseXBo X2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAg ICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklH SFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9X X1JFQ1RBTkdMRQorICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJU SUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3Ig PT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAg ICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAg IHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIKKyAgICAgICAgICAg ICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSCkpCisg ICAgICAgIHsKKyAgICAgICAgICBMaXNwX09iamVjdCBiaXRtYXBfZmxhdm9yID0gKGdseXBoX2Zs YXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9 PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX2hvbGxvd19yZWN0YW5n bGVfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAo Z2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEUpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBRbWNfaG9sbG93X3JlY3RhbmdsZQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxf QkFSX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gUW1jX3ZlcnRpY2FsX2Jhcl9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFS X1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g UW1jX3JldmVyc2VkX3ZlcnRpY2FsX2Jhcl9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jh cgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3Ig PT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX3ZlcnRpY2FsX2JhcgorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFS X0JBQ0tTTEFTSCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFt Y192ZXJ0aWNhbF9iYXJfYmFja3NsYXNoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogUW5pbDsKKyAgICAgICAgICBmcmluZ2VfYml0bWFwID0gKGN1cnNvcl90eXBlID09 IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAgID8gbG9v a3VwX2ZyaW5nZV9iaXRtYXAgKGJpdG1hcF9mbGF2b3IpCisgICAgICAgICAgICAgICAgICAgICAg ICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICBmYWNlX2lkID0gKGN1cnNvcl90 eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgICAgICYmIChn bHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVwor ICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9W RVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlw aF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKSkKKyAgICAgICAgICAgICAgICAg ICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJldmVyc2VkLWJhci1w cmUtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9 PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBo X2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAg ICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNB TF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9y ICE9IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgICAgICA/IGxv b2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLWJhci1wcmUtenYtZmFjZSIpLCB0cnVl KQorICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICByb3ct PmN1cnNvcl9pbl9mcmluZ2VfcCA9IGZhbHNlOworICAgICAgICAgIHJvdy0+cmlnaHRfZnJpbmdl X2JpdG1hcCA9IGZyaW5nZV9iaXRtYXA7CisgICAgICAgICAgcm93LT5yaWdodF9mcmluZ2VfZmFj ZV9pZCA9IGZhY2VfaWQ7CisgICAgICAgICAgcm93LT5yaWdodF9mcmluZ2Vfb2Zmc2V0ID0gMDsK KyAgICAgICAgICByb3ctPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcCA9IGZhbHNlOworICAgICAg ICAgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcCAodywgcm93LCBmYWxzZSwgY3Vyc29yX3R5cGUpOwor ICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSAorICAg ICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEhMRVNTKQorICAgICAgICAg IHsKKyAgICAgICAgICAgIGJvb2wgb25fcCA9IHRydWU7CisgICAgICAgICAgICBGUkFNRV9SSUYg KGYpLT5tY19zY3JpYmVfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9z LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdnBvcywgd2Qs IGgsIGxzbCwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIGdseXBoX2ZsYXZvciwgb25fcCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2ZV9wKTsKKyAgICAgICAgICB9 Cit9CisKK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KyAgICAgICAgIDogKFNUUklO R1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgOiAoTklM UCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAgICA6 ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICBnbHlwaC0+dS5j aCwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5l X3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+aHBv cywgZ2x5cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAo Z2x5cGgtPnUuY2gpKTsKKyAgICB9CisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IFNUUkVUQ0hf R0xZUEgpCisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBEImQv JS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICAlM2QgJXMg JXNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAg KChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAg ICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdTJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisg ICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnQicKKyAgICAg ICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAg ICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnMCcKKyAgICAgICAg ICA6ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAwdSwKKyAg ICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisg ICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+aHBvcywgZ2x5 cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAiXFxTIik7CisgICAgfQorICBlbHNlIGlm IChnbHlwaC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkKKyAgICB7CisgICAgICBmcHJpbnRmIChzdGRl cnIsCisgICAgICAgICIgJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNngg JTRkICUxLjFkJTEuMWQgICUzZCAlcyAlY1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBo c1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ct PnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ0knLAorICAg ICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisg ICAgICAgICAgICA/ICdCJworICAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisg ICAgICAgICAgICA/ICdTJworICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAg ICAgICAgICA/ICcwJworICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxf d2lkdGgsCisgICAgICAgICh1bnNpZ25lZCBpbnQpIGdseXBoLT51LmltZ19pZCwKKyAgICAgICAg Z2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAg IGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+aHBvcywgZ2x5cGhfenZf cCA/ICJaViIgOiAiLS0iLAorICAgICAgICAnLicpOworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgt PnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwK KyAgICAgICAgIiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCIsCisg ICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVz ZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0 aXZlX3gsCisgICAgICAgICcrJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChC VUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnQicKKyAgICAgICAgICA6IChT VFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICA6IChO SUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICA6ICctJykp KSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAodW5zaWduZWQgaW50KSBn bHlwaC0+dS5jbXAuaWQpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICU0ZCAlMS4xZCUxLjFk IiwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5l X3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wKTsKKyAgICAgIGlmIChnbHlwaC0+ dS5jbXAuYXV0b21hdGljKQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIgICUzZCAlcyAuIFsl ZC0lZF1cbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGgtPmhwb3MsIGdseXBoX3p2 X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaC0+c2xpY2Uu Y21wLmZyb20sIGdseXBoLT5zbGljZS5jbXAudG8pOworICAgICAgICBlbHNlCisgICAgICAgIGZw cmludGYgKHN0ZGVyciwgIlxuIik7CisgICAgfQorICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBY V0lER0VUX0dMWVBIKQorICAgIHsKKyNpZm5kZWYgSEFWRV9YV0lER0VUUworICAgICAgZWFzc3Vt ZSAoZmFsc2UpOworI2Vsc2UKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIiAgJTVk LyUtNWQgJTVkICU0YyAlNmQgJWMgJTNkIDB4JTA1eCAlNGQgJTEuMWQlMS4xZCAgJTNkICVzICVj XG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgo cm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAg ICByZWxhdGl2ZV94LAorICAgICAgICAnWCcsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAg ICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgPyAnQicKKyAgICAgICAg IDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAg OiAnLScpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICBnbHlwaC0+ZmFj ZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJp Z2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT51Lnh3aWRnZXQsCisgICAgICAgIGdseXBo LT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7CisjZW5kaWYK KyAgICB9Cit9CisKKy8qIER1bXAgdGhlIGNvbnRlbnRzIG9mIGdseXBoIHJvdyBhdCBWUE9TIGlu IE1BVFJJWCB0byBzdGRlcnIuCisgICBHTFlQSFMgMCBtZWFucyBkb24ndCBzaG93IGdseXBoIGNv bnRlbnRzLgorICAgR0xZUEhTIDEgbWVhbnMgc2hvdyBnbHlwaHMgaW4gc2hvcnQgZm9ybQorICAg R0xZUEhTID4gMSBtZWFucyBzaG93IGdseXBocyBpbiBsb25nIGZvcm0uICovCit2b2lkCittY19k dW1wX2dseXBoX3JvdyAoc3RydWN0IGdseXBoX3JvdyAqcm93LCBpbnQgdnBvcywgaW50IGdseXBo cykKK3sKKyAgaW50IHJlbGF0aXZlX3ggPSAwOworICBpZiAoZ2x5cGhzICE9IDEpCisgICAgewor ICAgICAgZnByaW50ZiAoc3RkZXJyLCAiXG5EVU1QIEdMWVBIIFJPV1xuIik7CisgICAgICBmcHJp bnRmIChzdGRlcnIsICJSb3cgICAgIFN0YXJ0ICAgICAgIEVuZCBVc2VkIG9FPjxcXENUWkZlc20g ICAgIFggICAgWSAgICBXICAgIEggICAgViAgICBBICAgIFBcbiIpOworICAgICAgZnByaW50ZiAo c3RkZXJyLCAiPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4iKTsKKyAgICAgIGZwcmludGYgKHN0ZGVy ciwgIiUzZCAlOSJwRCJkICU5InBEImQgJTRkICUxLjFkJTEuMWQlMS4xZCUxLjFkXAorJTEuMWQl MS4xZCUxLjFkJTEuMWQlMS4xZCUxLjFkJTEuMWQlMS4xZCAgJTRkICU0ZCAlNGQgJTRkICU0ZCAl NGQgJTRkXG4iLAorICAgICAgICAgdnBvcywKKyAgICAgICAgIE1BVFJJWF9ST1dfU1RBUlRfQ0hB UlBPUyAocm93KSwKKyAgICAgICAgIE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdyksCisgICAg ICAgICByb3ctPnVzZWRbVEVYVF9BUkVBXSwKKyAgICAgICAgIHJvdy0+Y29udGFpbnNfb3Zlcmxh cHBpbmdfZ2x5cGhzX3AsCisgICAgICAgICByb3ctPmVuYWJsZWRfcCwKKyAgICAgICAgIHJvdy0+ dHJ1bmNhdGVkX29uX2xlZnRfcCwKKyAgICAgICAgIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3As CisgICAgICAgICByb3ctPmNvbnRpbnVlZF9wLAorICAgICAgICAgTUFUUklYX1JPV19DT05USU5V QVRJT05fTElORV9QIChyb3cpLAorICAgICAgICAgTUFUUklYX1JPV19ESVNQTEFZU19URVhUX1Ag KHJvdyksCisgICAgICAgICByb3ctPmVuZHNfYXRfenZfcCwKKyAgICAgICAgIHJvdy0+ZmlsbF9s aW5lX3AsCisgICAgICAgICByb3ctPmVuZHNfaW5fbWlkZGxlX29mX2NoYXJfcCwKKyAgICAgICAg IHJvdy0+c3RhcnRzX2luX21pZGRsZV9vZl9jaGFyX3AsCisgICAgICAgICByb3ctPm1vdXNlX2Zh Y2VfcCwKKyAgICAgICAgIHJvdy0+eCwKKyAgICAgICAgIHJvdy0+eSwKKyAgICAgICAgIHJvdy0+ cGl4ZWxfd2lkdGgsCisgICAgICAgICByb3ctPmhlaWdodCwKKyAgICAgICAgIHJvdy0+dmlzaWJs ZV9oZWlnaHQsCisgICAgICAgICByb3ctPmFzY2VudCwKKyAgICAgICAgIHJvdy0+cGh5c19hc2Nl bnQpOworICAgICAgLyogVGhlIG5leHQgMyBsaW5lcyBzaG91bGQgYWxpZ24gdG8gIlN0YXJ0IiBp biB0aGUgaGVhZGVyLiAqLworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICAgICU5InBEImQgJTki cEQiZFx0JTVkXG4iLCByb3ctPnN0YXJ0Lm92ZXJsYXlfc3RyaW5nX2luZGV4LAorICAgICAgICAg cm93LT5lbmQub3ZlcmxheV9zdHJpbmdfaW5kZXgsCisgICAgICAgICByb3ctPmNvbnRpbnVhdGlv bl9saW5lc193aWR0aCk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgICAgJTkicEQiZCAlOSJw RCJkXG4iLAorICAgICAgICAgQ0hBUlBPUyAocm93LT5zdGFydC5zdHJpbmdfcG9zKSwKKyAgICAg ICAgIENIQVJQT1MgKHJvdy0+ZW5kLnN0cmluZ19wb3MpKTsKKyAgICAgIGZwcmludGYgKHN0ZGVy ciwgIiAgICAlOWQgJTlkXG4iLCByb3ctPnN0YXJ0LmRwdmVjX2luZGV4LAorICAgICAgICAgcm93 LT5lbmQuZHB2ZWNfaW5kZXgpOworICAgIH0KKyAgaWYgKGdseXBocyA+IDEpCisgICAgeworICAg ICAgZm9yIChpbnQgYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFyZWEgPCBMQVNUX0FSRUE7ICsr YXJlYSkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSByb3ctPmds eXBoc1thcmVhXTsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoX2VuZCA9IGdseXBoICsg cm93LT51c2VkW2FyZWFdOworICAgICAgICAgIC8qIEdseXBoIGZvciBhIGxpbmUgZW5kIGluIHRl eHQuICovCisgICAgICAgICAgaWYgKGFyZWEgPT0gVEVYVF9BUkVBICYmIGdseXBoID09IGdseXBo X2VuZCAmJiBnbHlwaC0+Y2hhcnBvcyA+IDApCisgICAgICAgICAgICArK2dseXBoX2VuZDsKKyAg ICAgICAgICBpZiAoZ2x5cGggPCBnbHlwaF9lbmQpCisgICAgICAgICAgICBmcHJpbnRmIChzdGRl cnIsICJHbHlwaCMvVG90YWwgUmVsLlggVCAgICAgICBQb3MgTyAgIFcgICAgIENvZGUgRmFjZSBM UiBIUE9TIFpWIENcbiIpOworICAgICAgICAgIGZvciAoOyBnbHlwaCA8IGdseXBoX2VuZDsgKytn bHlwaCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbWNfZHVtcF9nbHlwaCAocm93LCBn bHlwaCwgYXJlYSwgcmVsYXRpdmVfeCwgdnBvcyk7CisgICAgICAgICAgICAgIHJlbGF0aXZlX3gg Kz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQor ICAgIGVsc2UgaWYgKGdseXBocyA9PSAxKQorICAgICAgeworICAgICAgICBjaGFyIHNbU0hSVF9N QVggKyA0XTsKKyAgICAgICAgZm9yIChpbnQgYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFyZWEg PCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpbnQgaTsKKyAg ICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCByb3ctPnVzZWRbYXJlYV07ICsraSkKKyAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSByb3ctPmdseXBo c1thcmVhXSArIGk7CisgICAgICAgICAgICAgICAgaWYgKGkgPT0gcm93LT51c2VkW2FyZWFdIC0g MQorICAgICAgICAgICAgICAgICAgICAmJiBhcmVhID09IFRFWFRfQVJFQQorICAgICAgICAgICAg ICAgICAgICAmJiBOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgICAgICAgICAmJiBn bHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT51 LmNoID09ICcgJykKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc3Ry Y3B5ICgmc1tpXSwgIltcXG5dIik7CisgICAgICAgICAgICAgICAgICAgIGkgKz0gNDsKKyAgICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGdseXBoLT50eXBlID09 IENIQVJfR0xZUEgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT51LmNoIDwg MHg4MAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGgtPnUuY2ggPj0gJyAnKQor ICAgICAgICAgICAgICAgICAgICBzW2ldID0gZ2x5cGgtPnUuY2g7CisgICAgICAgICAgICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICBzW2ldID0gJy4nOworICAgICAgICAgICAg ICB9CisgICAgICAgICAgICBzW2ldID0gJ1wwJzsKKyAgICAgICAgICAgIGZwcmludGYgKHN0ZGVy ciwgIiUzZDogKCVkKSAnJXMnXG4iLCB2cG9zLCByb3ctPmVuYWJsZWRfcCwgcyk7CisgICAgICAg ICAgfQorICAgICAgfQorfQorCitERUZVTiAoIm1jLWR1bXAtZ2x5cGgtcm93IiwgRm1jX2R1bXBf Z2x5cGhfcm93LCBTbWNfZHVtcF9nbHlwaF9yb3csIDEsIDIsICJQIiwKKyAgICAgICBkb2M6IC8q IER1bXAgZ2x5cGggcm93IFJPVyB0byBzdGRlcnIuCitJbnRlcmFjdGl2ZWx5LCBST1cgaXMgdGhl IHByZWZpeCBudW1lcmljIGFyZ3VtZW50IGFuZCBkZWZhdWx0cyB0bwordGhlIHJvdyB3aGljaCBk aXNwbGF5cyBwb2ludC4KK09wdGlvbmFsIGFyZ3VtZW50IEdMWVBIUyAwIG1lYW5zIGRvbid0IGR1 bXAgZ2x5cGhzLgorR0xZUEhTIDEgbWVhbnMgZHVtcCBnbHlwaHMgaW4gc2hvcnQgZm9ybS4KK0dM WVBIUyA+IDEgb3Igb21pdHRlZCBtZWFucyBkdW1wIGdseXBocyBpbiBsb25nIGZvcm0uICAqLykK KyAgKExpc3BfT2JqZWN0IHJvdywgTGlzcF9PYmplY3QgZ2x5cGhzKQoreworICBzdHJ1Y3Qgd2lu ZG93ICp3ID0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93KTsKKyAgc3RydWN0IGdseXBoX21hdHJp eCAqbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgIEVNQUNTX0lOVCB2cG9zOworICBpZiAo TklMUCAocm93KSkKKyAgICB7CisgICAgICBpbnQgZDEsIGQyLCBkMywgZDQsIGQ1LCB5cG9zOwor ICAgICAgYm9vbCB2aXNpYmxlX3AgPSBwb3NfdmlzaWJsZV9wICh3LCBQVCwgJmQxLCAmZDIsICZk MywgJmQ0LCAmZDUsICZ5cG9zKTsKKyAgICAgIGludCBoZWFkZXJfbGluZV9oZWlnaHQgPSBXSU5E T1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgICAgIGludCB2b2Zmc2V0ID0gKGhlYWRlcl9s aW5lX2hlaWdodCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICYmIHlwb3MgPiAwKQorICAgICAg ICAgICAgICAgICAgICAgID8geXBvcyArIDEKKyAgICAgICAgICAgICAgICAgICAgICA6IHlwb3M7 CisgICAgICBpZiAodmlzaWJsZV9wKQorICAgICAgICB2cG9zID0gdm9mZnNldDsKKyAgICAgICAg ZWxzZQorICAgICAgICAgIHZwb3MgPSAwOworICAgIH0KKyAgICBlbHNlCisgICAgICB7CisgICAg ICAgIENIRUNLX05VTUJFUiAocm93KTsKKyAgICAgICAgdnBvcyA9IFhGSVhOVU0gKHJvdyk7Cisg ICAgICB9CisgIGlmICh2cG9zID49IDAgJiYgdnBvcyA8IG1hdHJpeC0+bnJvd3MpCisgICAgbWNf ZHVtcF9nbHlwaF9yb3cgKE1BVFJJWF9ST1cgKG1hdHJpeCwgdnBvcyksCisgICAgICAgIHZwb3Ms CisgICAgICAgIFRZUEVfUkFOR0VEX0ZJWE5VTVAgKGludCwgZ2x5cGhzKSA/IFhGSVhOVU0gKGds eXBocykgOiAyKTsKKyAgcmV0dXJuIFFuaWw7Cit9CisKK3ZvaWQKK21jX2R1bXBfZ2x5cGhfbWF0 cml4IChzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXg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GX0JFR1YgKGJ1ZmZlciksIEJVRl9aViAoYnVmZmVyKSk7CisgIGZwcmludGYgKHN0ZGVyciwg IkN1cnNvciB4ID0gJWQsIHkgPSAlZCwgaHBvcyA9ICVkLCB2cG9zID0gJWRcbiIsCisgICAgIHct PmN1cnNvci54LCB3LT5jdXJzb3IueSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zKTsK KyAgZnByaW50ZiAoc3RkZXJyLCAiPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09XG4iKTsKKyAgbWNfZHVtcF9nbHlwaF9tYXRyaXggKHctPmN1cnJlbnRfbWF0cml4 LAorICAgICAgICAgVFlQRV9SQU5HRURfRklYTlVNUCAoaW50LCBnbHlwaHMpID8gWEZJWE5VTSAo Z2x5cGhzKSA6IDApOworICByZXR1cm4gUW5pbDsKK30KKworYm9vbAorbWNfdHJhdmVyc2VfY2Fj aGVfcCAoc3RydWN0IG1jX21hdHJpeCBtYXRyaXgsIGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90 eXBlLAorICAgICAgICAgICAgICAgICAgICAgaW50IHZudGgsIGludCBudGgpCit7CisgIGlmICh2 bnRoIDwgbWF0cml4LnZwb3NfdXNlZAorICAgICAgJiYgbWF0cml4LmN1cnNvcnNfdXNlZFtjYWNo ZV90eXBlXSA+IDAKKyAgICAgICYmIG50aCA8IG1hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRb Y2FjaGVfdHlwZV0pCisgICAgcmV0dXJuIHRydWU7CisgICAgZWxzZQorICAgICAgcmV0dXJuIGZh bHNlOworfQorCit2b2lkCittY19yZXNldF9jYWNoZSAoc3RydWN0IHdpbmRvdyAqdykKK3sKKyAg aWYgKCFCVUZGRVJQICh3LT5jb250ZW50cykpCisgICAgcmV0dXJuOworICBmb3IgKGVudW0gbWNf Y2FjaGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7CisgICAgICAgY2FjaGVfdHlwZSA8IE5P X0NBQ0hFOworICAgICAgICsrY2FjaGVfdHlwZSkKKyAgICB7CisgICAgICBib29sIGJ2YXJfYWN0 aXZlX3A7CisgICAgICBzd2l0Y2ggKGNhY2hlX3R5cGUpCisgICAgICAgIHsKKyAgICAgICAgICBj YXNlIE5PX0NBQ0hFOgorICAgICAgICAgICAgeworICAgICAgICAgICAgICByZXR1cm47CisgICAg ICAgICAgICB9CisgICAgICAgICAgY2FzZSBNQ19DQUNIRToKKyAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgJiYg TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkpCisgICAgICAgICAg ICAgICAgYnZhcl9hY3RpdmVfcCA9IGZhbHNlOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKEJV RkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkKKyAgICAgICAgICAgICAgICAg IGJ2YXJfYWN0aXZlX3AgPSB0cnVlOworICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAg IH0KKyAgICAgICAgICBjYXNlIENIX0NBQ0hFOgorICAgICAgICAgICAgeworICAgICAgICAgICAg ICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAmJiBOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICAgICAgICAgICAg ICBidmFyX2FjdGl2ZV9wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoQlVGRkVS UCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgICAgICAgICAgICAgICAg YnZhcl9hY3RpdmVfcCA9IHRydWU7CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAg fQorICAgICAgICAgIGNhc2UgRkNfQ0FDSEU6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAg IGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICYmIE5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpKQorICAgICAgICAgICAgICAg IGJ2YXJfYWN0aXZlX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBlbHNlIGlmIChCVUZGRVJQ ICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpCisgICAgICAgICAgICAgICAgICBi dmFyX2FjdGl2ZV9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9 CisgICAgICAgIH0KKyAgICAgIGlmICghYnZhcl9hY3RpdmVfcCkKKyAgICAgICAgeworICAgICAg ICAgIC8qIERlY3JlYXNlIHRoZSBzaXplIG9mIHRoZSBhcnJheSB0byBhIGJhcmUgbWluaW11bS4g Ki8KKyAgICAgICAgICBmb3IgKGludCB2bnRoID0gMDsgdm50aCA8IHctPm1jX21hdHJpeC52cG9z X3VzZWQ7ICsrdm50aCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKHctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlX2FsbG9jYXRlZFtjYWNoZV90eXBlXSA+IDEpCisgICAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV0gPQorICAgICAgICAgICAgICAgICAgICB4bnJlYWxsb2MgKHctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdLCAxLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHNpemVvZiAqdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV0pOworICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVf YWxsb2NhdGVkW2NhY2hlX3R5cGVdID0gMTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAg ICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV0gPSAwOwor ICAgICAgICAgICAgfQorICAgICAgICAgIHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVf dHlwZV0gPSAwOworICAgICAgICB9CisgICAgICAgIC8vICBBbHRob3VnaCBpdCB3b3VsZCBub3Qg YmUgdmVyeSBlZmZpY2llbnQsIGl0IGlzIHBvc3NpYmxlIHRvIHNldAorICAgICAgICAvLyAgdGhl IF91c2VkXyBlbGVtZW50cyBvZiB0aGUgYXJyYXkgdG8gemVyby4gIEluIHN1Y2ggYSBjYXNlLCB0 aGUKKyAgICAgICAgLy8gIC4uLl9lbHRzLmFsbG9jYXRlZFtjYWNoZV90eXBlXSB3b3VsZCByZW1h aW4gdGhlIHNhbWUuCisgICAgICAgIC8vICBtZW1zZXQgKHctPm1jX21hdHJpeC52cG9zW0BdLmNh Y2hlW2NhY2hlX3R5cGVdLCAwLCB3LT5tY19tYXRyaXgudnBvc1tAXS5jYWNoZV91c2VkW2NhY2hl X3R5cGVdCisgICAgICAgIC8vICAgICAgICAgICogKHNpemVvZiAqdy0+bWNfbWF0cml4LnZwb3Nb QF0uY2FjaGVbY2FjaGVfdHlwZV0pKTsKKyAgICAgICAgLy8gIEF0IHRoaXMgdGltZSwgd2UgYXJl IGluc3RlYWQgbGVhdmluZyB0aGUgYXJyYXkgYXMtaXMgd2l0aCB0aGUKKyAgICAgICAgLy8gIHVu ZGVyc3RhbmRpbmcgdGhhdCBpdCB3aWxsIGNvbnRhaW4gb3V0ZGF0ZWQgZGF0YSAoYWthIGdhcmJh Z2UpLgorICAgICAgICAvLyAgVXNpbmcgdGhlIGNvdW50ZXIgYHctPm1jX21hdHJpeC52cG9zW0Bd LmNhY2hlX3VzZWRbY2FjaGVfdHlwZV1gLCB3ZSB0cmFjayBjdXJyZW50IGRhdGEuCisgICAgICAg IGVsc2UgaWYgKGJ2YXJfYWN0aXZlX3ApCisgICAgICAgICAgeworICAgICAgICAgICAgZm9yIChp bnQgdm50aCA9IDA7IHZudGggPCB3LT5tY19tYXRyaXgudnBvc191c2VkOyArK3ZudGgpCisgICAg ICAgICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV0g PSAwOworICAgICAgICAgICAgdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90eXBlXSA9 IDA7CisgICAgICAgICAgfQorICAgIH0KK30KKworc3RhdGljIHZvaWQKK21jX2hlbHBlciAoc3Ry dWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhf cm93ICpyb3csCisgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGgsIGludCB4LCBpbnQgZngs IGludCB5LCBpbnQgZnksIGludCBocG9zLCBpbnQgdnBvcywKKyAgICAgICAgICAgaW50IHdkLCBp bnQgaCwgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSwgaW50IGN1cnNvcl93aWR0aCwK KyAgICAgICAgICAgZW51bSBtY19yb3dfcG9zaXRpb24gcm93X3Bvc2l0aW9uLCBzdHJ1Y3QgbWNf UkdCIGZvcmVncm91bmQsCisgICAgICAgICAgIHN0cnVjdCBtY19SR0IgYmFja2dyb3VuZCwgYm9v bCBhY3RpdmVfcC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Nvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vy c29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBhY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCByZW1vdmVfcCk7 CisgICAgICByZXR1cm47CisgICAgfQorICAgIGVsc2UgaWYgKGRyYXdfcAorICAgICAgICAgICAg ICYmIChmcm9tX3doZXJlID09IFNDUklCRV9PTkUKKyAgICAgICAgICAgICAgICAgfHwgZnJvbV93 aGVyZSA9PSBTQ1JJQkVfVFdPCisgICAgICAgICAgICAgICAgIHx8IGZyb21fd2hlcmUgPT0gU0NS SUJFX1RIUkVFCisgICAgICAgICAgICAgICAgIHx8IGZyb21fd2hlcmUgPT0gTk9XSEVSRSkpCisg ICAgICB7CisgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCBtYXRyaXgsIHJvdywgeCwg ZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGFjdGl2ZV9wLCBnbHlw aF9mbGF2b3IsIHJlbW92ZV9wKTsKKyAgICAgICAgcmV0dXJuOworICAgICAgfQorICBpZiAoY2Fj aGVfdHlwZSA9PSBOT19DQUNIRSkKKyAgICByZXR1cm47CisgICsrdy0+bWNfbWF0cml4LmN1cnNv cnNfdXNlZFtjYWNoZV90eXBlXTsKKyAgaWYgKHZudGggPj0gdy0+bWNfbWF0cml4LnZwb3NfdXNl ZCkKKyAgICB3LT5tY19tYXRyaXgudnBvc191c2VkID0gdm50aCArIDE7CisgIGlmICh3LT5tY19t YXRyaXgudnBvc19hbGxvY2F0ZWQgPCB3LT5tY19tYXRyaXgudnBvc191c2VkKQorICAgIHsKKyAg ICAgIGludCBvbGRfYWxsb2MgPSB3LT5tY19tYXRyaXgudnBvc19hbGxvY2F0ZWQ7CisgICAgICBp bnQgbmV3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RoXS5jYWNoZVtjYWNoZV90eXBlXSwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX2FsbG9jYXRlZFtjYWNoZV90eXBlXSwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg bmV3X2VsdHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIElOVF9NQVgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiAqdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV0pOworICAgICAgbWVtc2V0ICh3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXSArIG9sZF9hbGxvYywgMCwKKyAgICAgICAgICAgICAgICh3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV0gLSBvbGRfYWxs b2MpCisgICAgICAgICAgICAgICAgICogc2l6ZW9mICp3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXSk7CisgICAgfQorICBpbnQgbnRoID0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXSAtIDE7CisgIHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uc2FtZV9wID0gZmFsc2U7CisgIHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGgudHlwZSA9IGdseXBoLT50 eXBlOworICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZ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lIEZYIGNvb3JkaW5hdGUg aXMgc2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNld2hlcmU6ICBg dy0+Y3Vyc29yLnhgIC8gYG1jLmZjX3hgLiAqLwordm9pZAorbWNfZ2V0X2N1cnNvcl9nZW9tZXRy eSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LAorICAgICAg ICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93LCBpbnQgeCwgaW50ICpmeCwg aW50IHksCisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgKmZ5LCBpbnQgaHBvcywgaW50IHZw b3MsIGludCAqaCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUg Y3Vyc29yX3R5cGUsIGludCBjdXJzb3Jfd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICBp bnQgKndkKQoreworICBzdHJ1Y3QgZ2x5cGggKmdseXBoID0gbWNfZ2V0X2N1cnNvcl9nbHlwaCAo dywgbWF0cml4LCByb3csIGhwb3MsIHZwb3MpOworICBpZiAoZ2x5cGggPT0gTlVMTCkKKyAgICBy ZXR1cm47CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7Cisg ICpmeCA9IFdJTkRPV19URVhUX1RPX0ZSQU1FX1BJWEVMX1ggKHcsIHgpOworICAqaCA9IHJvdy0+ dmlzaWJsZV9oZWlnaHQ7CisgIC8qIERvbid0IGxldCB0aGUgY3Vyc29yIGV4Y2VlZCB0aGUgZGlt ZW5zaW9ucyBvZiB0aGUgcm93LCBzbyB0aGF0CisgIHRoZSB1cHBlci9sb3dlciBzaWRlIG9mIHRo ZSBib3ggYXJlbid0IGNsaXBwZWQuICAqLworICBpbnQgd19oZWFkZXJfbGluZV9oZWlnaHQgPSBX SU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgaW50IHdfdGV4dF9ib3R0b21feSA9IHdp bmRvd190ZXh0X2JvdHRvbV95ICh3KSAtICpoOworICBpZiAoeSA8IHdfaGVhZGVyX2xpbmVfaGVp Z2h0KQorICAgIHsKKyAgICAgICpoID0gbWF4ICgqaCAtICh3X2hlYWRlcl9saW5lX2hlaWdodCAt IHkpICsgMSwgKmgpOworICAgICAgeSA9IHdfaGVhZGVyX2xpbmVfaGVpZ2h0IC0gMTsKKyAgICAg IC8vIGZwcmludGYgKHN0ZGVyciwgIkNPTkRJVElPTiAjIDFcbiIpOworICAgIH0KKyAgIGVsc2Ug aWYgKHkgPiB3X3RleHRfYm90dG9tX3kpCisgICAgIHsKKyAgICAgICAqaCArPSB5IC0gd190ZXh0 X2JvdHRvbV95OworICAgICAgIHkgPSB3X3RleHRfYm90dG9tX3k7CisgICAgICAgLy8gZnByaW50 ZiAoc3RkZXJyLCAiQ09ORElUSU9OICMgMlxuIik7CisgICAgIH0KKyAgKmZ5ID0gV0lORE9XX1RP X0ZSQU1FX1BJWEVMX1kgKHcsIHkpOworICBzd2l0Y2ggKGN1cnNvcl90eXBlKQorICAgIHsKKyAg ICAgIGNhc2UgTUNfQkFSOgorICAgICAgICB7CisgICAgICAgICAgaWYgKGN1cnNvcl93aWR0aCA8 IDEpCisgICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSBtYXggKEZSQU1FX0NVUlNPUl9XSURUSCAo ZiksIDEpOworICAgICAgICAgIGlmIChjdXJzb3Jfd2lkdGggPCBnbHlwaC0+cGl4ZWxfd2lkdGgp CisgICAgICAgICAgKndkID0gY3Vyc29yX3dpZHRoOworICAgICAgICAgIGJyZWFrOworICAgICAg ICB9CisgICAgICBjYXNlIE1DX0hCQVI6CisgICAgICAgIHsKKyAgICAgICAgICBpbnQgY3Vyc29y X2hlaWdodCA9IChjdXJzb3Jfd2lkdGggPCAxKSA/IGxyaW50ICgwLjI1ICogKmgpIDogY3Vyc29y X3dpZHRoOworICAgICAgICAg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KQor ICAgICAgICAgICAgPyBtaW4gKEZSQU1FX0NPTFVNTl9XSURUSCAoZiksIGdseXBoLT5waXhlbF93 aWR0aCkKKyAgICAgICAgICAgIDogZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgIH0KKy8qCisgICAg ICBmcHJpbnRmIChzdGRlcnIsICJjdXJzb3Jfd2lkdGg6ICglZCkgfCB4ICglZCkgfCAqZnggKCVk KSB8IHkgKCVkKSB8ICpmeSAoJWQpLCAqd2QgKCVkKSB8ICpoICglZClcbiIsCisgICAgICAgICAg ICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgeCwgKmZ4LCB5LCAqZnksICp3ZCwgKmgpOworKi8K K30KKwordm9pZAorbWNfZW5naW5lIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0 cml4ICptYXRyaXgsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKKyAgICAgICAgICAgc3RydWN0IGds eXBoICpnbHlwaCwgaW50IGFyZWEsIGludCByZWxhdGl2ZV94LCBpbnQgeF9saW1pdCwgaW50IHks CisgICAgICAgICAgIGludCBocG9zLCBpbnQgdnBvcywgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJz b3JfdHlwZSwgaW50IGN1cnNvcl93aWR0aCwKKyAgICAgICAgICAgc3RydWN0IGdseXBoX21hdHJp eCAqY3Vyc29yX21hdHJpeCwgc3RydWN0IG1jX2Vzc2VudGlhbHMgZXNzZW50aWFscywKKyAgICAg ICAgICAgZW51bSBtY19yb3dfcG9zaXRpb24gcm93X3Bvc2l0aW9uLCBzdHJ1Y3QgbWNfUkdCIGZv cmVncm91bmQsCisgICAgICAgICAgIGVudW0gbWNfZW5naW5lX3R5cGUgYWN0aW9uX3R5cGUsIGJv b2wgZHJhd19wLAorICAgICAgICAgICBlbnVtIG1jX2RyYXdfcm93X3R5cGUgZnJvbV93aGVyZSwg ZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUpCit7CisgIGludCBvcG9pbnRfeCA9IHctPmN1 cnNvci54OworICBpbnQgb3BvaW50X3kgPSB3LT5jdXJzb3IueTsKKyAgaW50IG9wb2ludF9ocG9z ID0gdy0+Y3Vyc29yLmhwb3M7CisgIGludCBvcG9pbnRfdnBvcyA9IHctPmN1cnNvci52cG9zOwor ICBpbnQgZngsIGZ5LCBoLCB3ZDsKKyAgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeSAodywgbWF0cml4 LCByb3csIHJlbGF0aXZlX3gsICZmeCwgeSwgJmZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAmaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgJndkKTsKKyAgaW50 IG9wb2ludF9meCA9IFdJTkRPV19URVhUX1RPX0ZSQU1FX1BJWEVMX1ggKHcsIG9wb2ludF94KTsK KyAgaW50IGZjX2Z4ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgZXNzZW50aWFs cy5mY194KTsKKyAgYm9vbCBnbHlwaF96dl9wID0gKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9B UkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAmJiBNQVRS SVhfUk9XX0VORF9DSEFSUE9TIChyb3cpID09IFpWKTsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZS QU1FICh3LT5mcmFtZSk7CisgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSICh3LT5jb250ZW50 cyk7CisgIGludCB0ZXh0X2FyZWFfd2lkdGggPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FS RUEpOworICBzdHJ1Y3QgZ2x5cGhfcm93ICpjdXJzb3Jfcm93ID0gKHctPmN1cnNvci52cG9zICE9 IC0xKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XIChjdXJz b3JfbWF0cml4LCB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogTlVMTDsKKyAgc3RydWN0IGdseXBoICpjdXJzb3JfZ2x5cGggPSAody0+Y3Vyc29yLnZw b3MgIT0gLTEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY19nZXRfY3Vyc29y X2dseXBoICh3LCBjdXJzb3JfbWF0cml4LCBjdXJzb3Jfcm93LAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLmhwb3MsIHctPmN1 cnNvci52cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTlVMTDsKKyAgYm9v bCBjdXJzb3JfYXRfZnJpbmdlX3AgPSAoY3Vyc29yX2dseXBoID09IE5VTEwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3JvdyAhPSBOVUxMCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID09IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9B UkVBXQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93LT5leGFjdF93 aW5kb3dfd2lkdGhfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1 cnNvci54ID09IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiB3LT5jdXJzb3IueCA9PSBjdXJzb3Jfcm93LT5waXhlbF93aWR0aCk7CisgIGJvb2wgY3Vyc29y X2JleW9uZF9mcmluZ2VfcCA9IChjdXJzb3JfZ2x5cGggPT0gTlVMTAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3JvdyAhPSBOVUxMCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBjdXJzb3Jfcm93LT51c2VkW1RF WFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFjdXJzb3Jfcm93 LT5leGFjdF93aW5kb3dfd2lkdGhfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5jdXJzb3IueCA+PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IGN1cnNvcl9yb3ctPnBpeGVsX3dpZHRo KTsKKyAgaW50IGZyYW1lX2NoYXJfd2lkdGggPSBGUkFNRV9DT0xVTU5fV0lEVEggKGYpOworICBp bnQgdGVtcF9mYWNlX2lkID0gZ2x5cGgtPmZhY2VfaWQ7CisgIHN0cnVjdCBtY19SR0IgYmFja2dy b3VuZDsKKyAgbWNfc2V0X2xzbF9iZyAodywgdGVtcF9mYWNlX2lkLCAmYmFja2dyb3VuZCk7Cisg IGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKG9wb2ludF94ID09IHJlbGF0aXZlX3gKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X2hwb3MgPT0gaHBvcworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeSA9PSByb3ctPnkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgb3BvaW50X3Zwb3MgPT0gdnBvcyk7CisKKy8qIC0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgIEJFR0lOOiAgQ0hBUl9HTFlQSCB8 IEdMWVBITEVTU19HTFlQSCAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KKyAgaWYgKGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgIHx8IGdseXBoLT50 eXBlID09IEdMWVBITEVTU19HTFlQSCkKKyAgeworICAgIGlmIChtY19zdGRlcnJfcCkKKyAgICAg IGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQi ZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICAlM2QgJXMgJXNcbiIsCisgICAgICAgIGds eXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0g PT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisg ICAgICAgIChnbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAgICA/ICdDJworICAgICAg ICAgOiAnRycpLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGds eXBoLT5vYmplY3QpCisgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgt Pm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+ b2JqZWN0KQorICAgICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAor ICAgICAgICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIGdseXBoLT51LmNoLAor ICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwK KyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9zLCBn bHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgIG1jX2N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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEhPUklaT05UQUxfUlVMRVI6CisgICAgeworICAg ICAgaWYgKHJlbGF0aXZlX3ggPCByb3ctPnBpeGVsX3dpZHRoCisgICAgICAgICAgJiYgIXJlYWxf ZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgs IHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICB3 ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcm93X3Bvc2l0aW9uLCBmb3JlZ3JvdW5k LAorICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1D X0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUsCisgICAgICAgICAgICAgICAgICAgY2FjaGVfdHlw ZSwgYWN0aW9uX3R5cGUpOworICAgICAgaWYgKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVB XSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYgcmVsYXRpdmVfeCA8PSB4X2xp bWl0KQorICAgICAgICB7CisgICAgICAgICAgaWYgKHJlbGF0aXZlX3ggPCByb3ctPnBpeGVsX3dp ZHRoKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5w aXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgZnggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAg ICAgICAgICAgfQorICAgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCBy ZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICB4 X2xpbWl0IC0gcmVsYXRpdmVfeCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcm93X3Bv c2l0aW9uLAorICAgICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwgZXNz ZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEhMRVNTLAorICAgICAgICAgICAgICAgICAgICAgZHJh d19wLCBmcm9tX3doZXJlLCBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICAgIH0KKyAg ICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAg ICAgICBWRVJUSUNBTF9SVUxFUjogIENIQVJfR0xZUEggfCBHTFlQSExFU1NfR0xZUEggICAgICAg ICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIFZFUlRJQ0FM X1JVTEVSOgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChjdXJz b3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBy b3ctPmNvbnRpbnVlZF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgIXJvdy0+Y29udGludWVkX3AKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdo dF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FM X0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAo Y3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJp bmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9y b3ctPnVzZWRbVEVYVF9BUkVBXSAhPSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9B UkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBvcG9pbnRfeCA+PSByb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfenZfcCkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogTUNfR0xZUEg7CisgICAgICBpZiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZF UlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19S RVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2 b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgIHx8IGdseXBoX2ZsYXZv ciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVW RVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICBjdXJzb3JfdHlwZSA9IE1DX1JJR0hUX0ZSSU5H RV9CSVRNQVA7CisgICAgICB3ZCA9IDE7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93 LCBnbHlwaCwgcmVsYXRpdmVfeCwgb3BvaW50X2Z4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAg ICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlv biwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgYmFja2dyb3VuZCwgZXNzZW50aWFscy5h Y3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCBkcmF3X3AsIGZyb21fd2hlcmUsCisgICAgICAgICAgICAg ICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICBGSUxMX0NPTFVNTjogIENIQVJf R0xZUEggfCBHTFlQSExFU1NfR0xZUEggICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0gKi8KKyAgICBjYXNlIEZJTExfQ09MVU1OOgorICAgIHsKKyAgICAgIGVudW0gbWNf Zmxhdm9yIGdseXBoX2ZsYXZvciA9IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0g cm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIGVzc2VudGlhbHMuZmNfeCA+PSByb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfenZfcCkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogKCFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIG9wb2ludF95ID09IHkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIG9wb2ludF92cG9zID09IHZwb3MpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgd2QgPSAxOworICAgICAgbWNfaGVscGVyICh3 LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZjX2Z4LCB5LCBmeSwgaHBvcywgdnBv cywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJv d19wb3NpdGlvbiwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgYmFja2dyb3VuZCwgZXNz ZW50aWFscy5hY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCBkcmF3X3AsIGZyb21fd2hlcmUsCisgICAg ICAgICAgICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGJyZWFrOworICAg IH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgQ1VSU09SX0lORElDQVRPUjoK KyAgICB7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAg fQorICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAg ICAgRU5EOiAgQ0hBUl9HTFlQSCB8IEdMWVBITEVTU19HTFlQSCAgICAgICAgICAgICAgICAgICAq LworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLwor LyogICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJFR0lOOiAgU1RSRVRDSF9HTFlQSCAgICAg ICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgZWxz ZSBpZiAoZ2x5cGgtPnR5cGUgPT0gU1RSRVRDSF9HTFlQSCkKKyAgeworICAgIGlmIChtY19zdGRl cnJfcCkKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIlxuICU1InBEImQvJS01ZCAl NWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICAlM2QgJXMgJXNcbiIs CisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ct PnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJl bGF0aXZlX3gsCisgICAgICAgICdTJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAg IChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNU UklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgOiAo TklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAg ICA6ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAwdSwKKyAg ICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisg ICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+aHBvcywgZ2x5 cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAiXFxTIik7CisgIHN3aXRjaCAoYWN0aW9u X3R5cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAg ICAgICAgICBNVUxUSVBMRV9DVVJTT1JTOiAgU1RSRVRDSF9HTFlQSCAgICAgICAgICAgICAgICAg ICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIE1VTFRJUExFX0NVUlNP UlM6CisgICAgeworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0 aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1 cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgZm9yZWdyb3VuZCwKKyAgICAg ICAgICAgICAgICAgYmFja2dyb3VuZCwgZXNzZW50aWFscy5hY3RpdmVfcCw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Dw9IHhfbGltaXQpCisgICAgICAgIHsKKyAgICAgICAgICBp ZiAocmVsYXRpdmVfeCA8IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICByZWxhdGl2ZV94 ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICB0ZW1wX2ZhY2VfaWQgPSAocm93LT5m aWxsX2xpbmVfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICA/IGdseXBoLT5mYWNlX2lkCisg ICAgICAgICAgICAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgc3Ry dWN0IG1jX1JHQiBiYWNrZ3JvdW5kOworICAgICAgICAgIG1jX3NldF9sc2xfYmcgKHcsIHRlbXBf ZmFjZV9pZCwgJmJhY2tncm91bmQpOworICAgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCBy b3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAg ICAgICAgICAgICB4X2xpbWl0IC0gcmVsYXRpdmVfeCwgaCwgY3Vyc29yX3R5cGUsIHhfbGltaXQg LSByZWxhdGl2ZV94LAorICAgICAgICAgICAgICAgICAgICAgcm93X3Bvc2l0aW9uLCBmb3JlZ3Jv dW5kLCBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAg ICAgTUNfR0xZUEhMRVNTLCBkcmF3X3AsIGZyb21fd2hlcmUsIGNhY2hlX3R5cGUsIGFjdGlvbl90 eXBlKTsKKyAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgVkVSVElDQUxfUlVMRVI6ICBTVFJF VENIX0dMWV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ICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+Y29udGludWVkX3AKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUgorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9v bl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZF UlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRf QVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlv bmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1 cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXSAhPSAxCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRV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ICAgICAgICAgICAgIEJFR0lOOiAgSU1BR0VfR0xZUEggICAgICAgICAgICAgICAgICAg ICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICBlbHNlIGlmIChnbHlwaC0+ dHlwZSA9PSBJTUFHRV9HTFlQSCkKKyAgeworICAgIGlmIChtY19zdGRlcnJfcCkKKyAgICAgIGZw cmludGYgKHN0ZGVyciwKKyAgICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAl YyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICAlM2QgJXMgJWNcbiIsCisgICAgICAgIGdseXBo IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0g MCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAg ICAgICdJJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlw aC0+b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5v YmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9i amVjdCkKKyAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAgICA6ICctJykpKSwKKyAg ICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAodW5zaWduZWQgaW50KSBnbHlwaC0+ dS5pbWdfaWQsCisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9i b3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5 cGg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6ICBJTUFHRV9HTFlQSCAgICAgICAgICAgICAg ICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBIT1JJWk9OVEFM X1JVTEVSOgorICAgIHsKKyAgICAgIGN1cnNvcl90eXBlID0gTUNfSE9MTE9XX0JPWDsKKyAgICAg IGlmICghcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwg cm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAg ICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24s IGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZCwgZXNzZW50aWFscy5h Y3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAg ICBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgVkVSVElDQUxf UlVMRVI6ICBJTUFHRV9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tICovCisgICAgY2FzZSBWRVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAgICBjdXJz b3JfdHlwZSA9I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0tLS0tICovCisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IENPTVBPU0lURV9H TFlQSCkKKyAgeworICAgIGlmIChtY19zdGRlcnJfcCkKKyAgICAgIHsKKyAgICAgICAgZnByaW50 ZiAoc3RkZXJyLAorICAgICAgICAgICJcbiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMg JTNkIDB4JTA2eCIsCisgICAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAor ICAgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAt IDEpLAorICAgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICAgJysnLAorICAgICAgICAgIGds eXBoLT5jaGFycG9zLAorICAgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAg ICAgICA/ICdCJworICAgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAg ICAgICAgICA/ICdTJworICAgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAg ICAgICAgICAgICAgICA/ICcwJworICAgICAgICAgICAgICAgICA6ICctJykpKSwKKyAgICAgICAg ICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgICAgKHVuc2lnbmVkIGludCkgZ2x5cGgtPnUu Y21wLmlkKTsKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICU0ZCAlMS4xZCUxLjFkIiwKKyAg ICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9w LAorICAgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wKTsKKyAgICAgIGlmIChnbHlwaC0+ dS5jbXAuYXV0b21hdGljKQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIgICUzZCAlcyAuIFsl ZC0lZF1cbiIsCisgICAgICAgICAgICAgICAgICAgICAg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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAg ICAgICAgICAgICAgICBIT1JJWk9OVEFMX1JVTEVSOiAgQ09NUE9TSVRFX0dMWVBIICAgICAgICAg ICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBIT1JJWk9O VEFMX1JVTEVSOgorICAgIHsKKyAgICAgIGlmIChyZWxhdGl2ZV94IDw9IHhfbGltaXQKKyAgICAg ICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJp eCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAg ICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRp b24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZCwgZXNzZW50aWFs cy5hY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAg ICAgICBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICBpZiAoZ2x5cGggLSByb3ctPmds eXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiByZWxh dGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAgIHsKKyAgICAgICAgICByZWxhdGl2ZV94ICs9IGds eXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICB3aGlsZSAocmVsYXRpdmVfeCA8PSB4X2xpbWl0 KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93 LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAg ICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRp b24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZCwgZXNz ZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEhMRVNTLCBkcmF3X3AsCisgICAgICAgICAgICAgICAg ICAgICAgICAgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAgICAg ICAgICByZWxhdGl2ZV94ICs9IGZyYW1lX2NoYXJfd2lkdGg7CisgICAgICAgICAgICB9CisgICAg ICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyog ICAgICAgICAgICAgICAgICAgICAgICAgVkVSVElDQUxfUlVMRVI6ICBDT01QT1NJVEVfR0xZUEgg ICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNl IFZFUlRJQ0FMX1JVTEVSOgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZv ciA9IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiByb3ctPmNvbnRpbnVlZF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+Y29udGludWVkX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUgor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9w CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRl ZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1D X1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklH SFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9i ZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXSAhPSAxCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoIC0gcm93LT5nbHlw aHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeCA+PSByb3ctPnBpeGVsX3dpZHRoKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfenZfcCkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogTUNfR0xZUEg7CisgICAgICBpZiAoZ2x5cGhfZmxhdm9y ID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZv ciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBn bHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgIHx8IGds eXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3Ig PT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICBjdXJzb3JfdHlwZSA9IE1DX1JJ R0hUX0ZSSU5HRV9CSVRNQVA7CisgICAgICB3ZCA9IDE7CisgICAgICBtY19oZWxwZXIgKHcsIG1h dHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgb3BvaW50X2Z4LCB5LCBmeSwgaHBvcywgdnBv cywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJv d19wb3NpdGlvbiwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgYmFja2dyb3VuZCwgZXNz ZW50aWFscy5hY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCBkcmF3X3AsIGZyb21fd2hlcmUsCisgICAg ICAgICAgICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGJyZWFrOworICAg IH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAg IEZJTExfQ09MVU1OOiAgQ09NUE9TSVRFX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICovCisv KiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEZJTExfQ09MVU1OOgorICAgIHsKKyAg ICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RF WFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+IHJlbGF0aXZlX3gpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF96dl9wKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAoIU5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgb3BvaW50X3kgPT0geQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgb3BvaW50X3Zwb3MgPT0gdnBvcykKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogTUNfR0xZUEg7CisgICAgICB3ZCA9IDE7CisgICAgICBtY19oZWxw ZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZmNfZngsIHksIGZ5LCBocG9z LCB2cG9zLAorICAgICAgICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0 aCwgcm93X3Bvc2l0aW9uLCBmb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5k LCBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgZnJvbV93aGVyZSwK KyAgICAgICAgICAgICAgICAgY2FjaGVfdHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAgYnJlYWs7 CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBDVVJTT1JfSU5ESUNB VE9SOgorICAgIHsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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b YXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZl X3gsCisgICAgICAgICdYJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZG RVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNUUklOR1Ag KGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgOiAnLScpKSwK KyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAg ICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9s aW5lX3AsCisgICAgICAgIGdseXBoLT51Lnh3aWRnZXQsCisgICAgICAgIGdseXBoLT5ocG9zLCBn bHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7CisjZW5kaWYKKyAgc3dpdGNo IChhY3Rpb25fdHlwZSkKKyAgeworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAg ICAgICAgICAgICAgICAgIE1VTFRJUExFX0NVUlNPUlM6ICBYV0lER0VUX0dMWVBIICAgICAgICAg ICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgTVVMVElQ TEVfQ1VSU09SUzoKKyAgICB7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlw aCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICB3 ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcm93X3Bvc2l0aW9uLCBmb3JlZ3JvdW5k LAorICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBNQ19H TFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICBjYWNoZV90eXBlLCBh Y3Rpb25fdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0g Ki8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgSE9SSVpPTlRBTF9SVUxFUjogIFhXSURHRVRf R0xZUEggICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisg ICAgY2FzZSBIT1JJWk9OVEFMX1JVTEVSOgorICAgIHsKKyAgICAgIGlmIChyZWxhdGl2ZV94IDw9 IHhfbGltaXQKKyAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICBtY19o ZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9z LCB2cG9zLAorICAgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dp ZHRoLCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgICAgYmFja2dy b3VuZCwgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwK KyAgICAgICAgICAgICAgICAgICBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICBpZiAo Z2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAg ICAgICAgICAmJiByZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAgIHsKKyAgICAgICAgICBy ZWxhdGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICB3aGlsZSAocmVsYXRp dmVfeCA8PSB4X2xpbWl0KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19oZWxwZXIg KHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9z LAorICAgICAgICAgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dp ZHRoLCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgICAgICAgICAg YmFja2dyb3VuZCwgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEhMRVNTLCBkcmF3X3AsCisg ICAgICAgICAgICAgICAgICAgICAgICAgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwgYWN0aW9uX3R5 cGUpOworICAgICAgICAgICAgICByZWxhdGl2ZV94ICs9IGZyYW1lX2NoYXJfd2lkdGg7CisgICAg ICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgIFZFUlRJQ0FMX1JVTEVSOiAg WFdJREdFVF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KKyAgICBjYXNlIFZFUlRJQ0FMX1JVTEVSOgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxh dm9yIGdseXBoX2ZsYXZvciA9IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiByb3ctPmNvbnRpbnVlZF9wKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+Y29udGludWVkX3AK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRl ZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1D X1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vy c29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRf cCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9W RVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXSAhPSAxCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmln aHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNF RF9WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGds eXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeCA+PSByb3ctPnBp eGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dM WVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfenZf cCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfR0xZUEg7CisgICAgICBp ZiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAg IHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cK KyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAor ICAgICAgICAgIHx8IGdseXBoX2ZsYXZ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ICAgICAg ICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+IHJlbGF0aXZlX3gpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF96dl9wKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAoIU5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgb3BvaW50X3kgPT0geQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgb3BvaW50X3Zwb3MgPT0gdnBvcykKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogTUNfR0xZUEg7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwg cm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZmNfZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAg ICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcm93X3Bvc2l0aW9u LCBmb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFj dGl2ZV9wLCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAg ICAgY2FjaGVfdHlwZSwgYWN0aW9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Z5LCBvcG9pbnRfd2QsIG9wb2ludF9oOworICBp bnQgdGV4dF9hcmVhX3dpZHRoID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAg aW50IGhlYWRlcl9saW5lX2Zvcm1hdCA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOwor ICBzdHJ1Y3QgZ2x5cGhfcm93ICpjdXJzb3Jfcm93ID0gKHctPmN1cnNvci52cG9zICE9IC0xKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XIChjdXJzb3JfbWF0 cml4LCB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog TlVMTDsKKyAgc3RydWN0IGdseXBoICpjdXJzb3JfZ2x5cGggPSAody0+Y3Vyc29yLnZwb3MgIT0g LTEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY19nZXRfY3Vyc29yX2dseXBo ICh3LCBjdXJzb3JfbWF0cml4LCBjdXJzb3Jfcm93LAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52 cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTlVMTDsKKyAgYm9vbCBjdXJz b3JfYXRfZnJpbmdlX3AgPSAoY3Vyc29yX2dseXBoID09IE5VTEwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgY3Vyc29yX3JvdyAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHctPmN1cnNvci5ocG9zID09IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93LT5leGFjdF93aW5kb3df d2lkdGhfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54 ID09IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5j dXJzb3IueCA9PSBjdXJzb3Jfcm93LT5waXhlbF93aWR0aCk7CisgIGJvb2wgY3Vyc29yX2JleW9u ZF9mcmluZ2VfcCA9IChjdXJzb3JfZ2x5cGggPT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgY3Vyc29yX3JvdyAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJF QV0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFjdXJzb3Jfcm93LT5leGFj dF93aW5kb3dfd2lkdGhfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiB3LT5jdXJzb3IueCA+PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIHctPmN1cnNvci54ID49IGN1cnNvcl9yb3ctPnBpeGVsX3dpZHRoKTsKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICBSRVBMQUNF IFRIRSBSRUFMIENVUlNPUgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisgIGVudW0gZmFjZV9p ZCBiZ19mYWNlX2lkID0gKGN1cnNvcl9nbHlwaCAhPSBOVUxMKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gY3Vyc29yX2dseXBoLT5mYWNlX2lkCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgIHN0cnVjdCBtY19SR0IgY3Vyc29yX2JnOworICBt Y19zZXRfbHNsX2JnICh3LCBiZ19mYWNlX2lkLCAmY3Vyc29yX2JnKTsKKyAgLyogRklYTUU6ICBQ dXQgaW4gc29tZSBjb2RlIHRvIGRlZmF1bHQgdG8gTUNfSE9MTE9XX0JPWCBpZiB0aGUgdXNlciBo YXMKKyAgdW53aXR0aW5nbHkgY29tZSB1cCB3aXRoIHNvbWUgdW5hY2NlcHRhYmxlIGZvcm0gb2Yg dW5yZWNvZ25pemVkIGN1cnNvciB0eXBlLiAqLworICBMaXNwX09iamVjdCBsaXNwX3R5cGUgPSBC VkFSIChiLCBtY19yZWFsX2Zha2VfY3Vyc29yKTsKKyAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJz b3JfdHlwZSA9IChDT05TUCAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoWENBUiAobGlzcF90eXBlKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogbWNfbGlzcF90b19jdXJzb3JfdHlw ZSAobGlzcF90eXBlKTsKKyAgaW50IGN1cnNvcl93aWR0aCA9IChDT05TUCAobGlzcF90eXBlKSkK KyAgICAgICAgICAgICAgICAgICAgID8gWEZJWE5VTSAoWENBUiAoWENEUiAobGlzcF90eXBlKSkp CisgICAgICAgICAgICAgICAgICAgICA6IC0xOworICBzdHJ1Y3QgbWNfUkdCIGN1cnNvcl9mZzsK KyAgbWNfY29sb3JfcGlja2VyICh3LCBjdXJzb3JfZ2x5cGgsIGVzc2VudGlhbHMsICZjdXJzb3Jf ZmcsIC0xLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICByb3dfcG9zaXRpb24sIENV UlNPUl9JTkRJQ0FUT1IpOworICBib29sIGZpbGxfY29sdW1uX3RydW1wc19wID0gKCFOSUxQIChC VkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgIU5JTFAgKEJWQVIgKGIsIGZjX3Zpc2libGUpKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIHctPmN1cnNvci54ID09IGVzc2VudGlhbHMuZmNfeAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmICFjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiAhY3Vyc29yX2JleW9uZF9mcmluZ2VfcCk7CisgIC8qIFdlIHVz ZSBhIHRlc3Qgc2ltaWxhciB0byB0aGUgcmVhbCBmYWtlIGN1cnNvciBzbyB0aGF0IHRoZSBmcmlu Z2UgYml0bWFwIGlzCisgIG9ubHkgZHJhd24gb25jZSBwZXIgd2luZG93LiAqLworICBpZiAodnBv cyA9PSB3LT5jdXJzb3IudnBvcworICAgICAgJiYgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoID09 IHJvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWly cykpCisgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfaG9yaXpvbnRhbF9ydWxlcikpKQorICAg IHsKKyAgICAgIC8qIGZyaW5nZSBiaXRtYXBzIHVzZSBmYWNlX2lkIHRvIHNldCB0aGUgZm9yZWdy b3VuZCBjb2xvci4gIFRoZSBvdmVybGF5LWFycm93CisgICAgICBpcyBwcmVzZW50bHkgdGhlIG9u bHkgc2l0dWF0aW9uIHdoZXJlIHRoZSBgZXNzZW50aWFscy5hY3RpdmVfcGAgYW5kIGBtaW5pbWFs X3BgIGFyZQorICAgICAgdXNlZCB0byBkZXRlcm1pbmUgdGhlIGFwcGxpY2FibGUgZmFjZV9pZC4g Ki8KKyAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnID0gey5yZWQgPSAtMS4wLAorICAgICAgICAg ICAgICAgICAgICAgICAg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dXJzb3IudnBvcywgb3BvaW50X3dkLCBvcG9pbnRfaCwKKyAg ICAgICAgICAgICAgICAgTUNfQkFSLCAxLCByb3dfcG9zaXRpb24sIGN1cnNvcl9mZywgY3Vyc29y X2JnLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICBNQ19HTFlQSExFU1Ms IGRyYXdfcCwgZnJvbV93aGVyZSwgTklMUCAoQlZBUiAoYiwgbWNfY29uZikpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBDSF9DQUNIRQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogTUNfQ0FDSEUsIENVUlNPUl9JTkRJQ0FUT1IpOworICAgICAg bWNfZ2V0X2N1cnNvcl9nZW9tZXRyeSAodywgbWF0cml4LCByb3csIHctPmN1cnNvci54LCAmb3Bv aW50X2Z4LCB3LT5jdXJzb3IueSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZvcG9p bnRfZnksIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgTUNfSEJBUiwgMSwgJm9wb2ludF93ZCk7CisgICAgICBt Y19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1cnNvci54LCBvcG9p bnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICBvcG9pbnRfZnksIHctPmN1cnNv ci5ocG9zLCB3LT5jdXJzb3IudnBvcywgb3BvaW50X3dkLCBvcG9pbnRfaCwKKyAgICAgICAgICAg ICAgICAgTUNfSEJBUiwgMSwgcm93X3Bvc2l0aW9uLCBjdXJzb3JfZmcsIGN1cnNvcl9iZywgZXNz ZW50aWFscy5hY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgTUNfR0xZUEgsIGRyYXdfcCwgZnJv bV93aGVyZSwgTklMUCAoQlZBUiAoYiwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7 CisgICAgfQorICBlbHNlIGlmICghY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICYmIGN1 cnNvcl9nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MK KyAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPj0gaHBvc19zdGFydAorICAgICAgICAgICAm JiB3LT5jdXJzb3IuaHBvcyA8IGhwb3Nfc3RhcnQgKyBocG9zX2xlbmd0aAorICAgICAgICAgICAm JiBjdXJzb3JfZ2x5cGgtPnR5cGUgIT0gU1RSRVRDSF9HTFlQSCkKKyAgICB7CisgICAgICBtY19n ZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRf ZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF9m eSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCAmb3BvaW50X3dk KTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vy c29yLngsIG9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAgICAgICAgIG9wb2ludF9m eSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9oLAor ICAgICAgICAgICAgICAgICBjdXJzb3J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sIHJv dywgdy0+Y3Vyc29yLngsICZvcG9pbnRfZngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgdy0+Y3Vyc29yLnksICZvcG9pbnRfZnksIHctPmN1cnNvci5ocG9zLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsIE1DX0hC QVIsIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF93ZCk7Cisg ICAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgY3Vyc29yX2dseXBoLCB3LT5jdXJz b3IueCwgb3BvaW50X2Z4LAorICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLnksIG9wb2lu dF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLAorICAgICAgICAgICAgICAgICAg ICAgb3BvaW50X3dkLCBvcG9pbnRfaCwgTUNfSEJBUiwgMSwgcm93X3Bvc2l0aW9uLCBjdXJzb3Jf ZmcsCisgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfYmcsIGVzc2VudGlhbHMuYWN0aXZlX3As IE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUsCisgICAgICAgICAgICAgICAgICAgICBOSUxQ IChCVkFSIChiLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAg ICAgICAgICAgICAgICAgICAgIDogTUNfQ0FDSEUsIENVUlNPUl9JTkRJQ0FUT1IpOworICAgICAg ICB9CisgICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vy c29yLngsICZvcG9pbnRfZngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5jdXJz b3IueSwgJm9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLCBjdXJzb3JfdHlwZSwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgJm9wb2ludF93ZCk7CisgICAgICBt Y19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1cnNvci54LCBvcG9p bnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICBvcG9pbnRfZnksIHctPmN1cnNv ci5ocG9zLCB3LT5jdXJzb3IudnBvcywgb3BvaW50X3dkLCBvcG9pbnRfaCwKKyAgICAgICAgICAg ICAgICAgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcm93X3Bvc2l0aW9uLCBjdXJzb3JfZmcs IGN1cnNvcl9iZywKKyAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZ UEgsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgTklMUCAoQlZBUiAoYiwg bWNfY29uZikpCisgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAgICAgICAg OiBNQ19DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgfQorLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgIERSQVcgQU5EIFJFQ09SRCBGQUtFIENV UlNPUlMKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICBpZiAoIWVzc2VudGlhbHMuYWN0aXZl X3AKKyAgICAgICYmIE5JTFAgKEJWQVIgKGIsIG1jX2luYWN0aXZlX3dpbmRvd3MpKQorICAgICAg JiYgTklMUCAoQlZBUiAoYiwgY2hfaW5hY3RpdmVfd2luZG93cykpCisgICAgICAmJiBOSUxQIChC VkFSIChiLCBmY19pbmFjdGl2ZV93aW5kb3dzKSkpCisgICAgcmV0dXJuOworICBpZiAoaHBvc19s ZW5ndGggPT0gMSkKKyAgICB7CisgICAgICBpZiAoIU5JTFAgKEJWQVIgKGIsIG1jX2NvbmYpKQor ICAgICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgIHx8ICghZXNz ZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIG1j X2luYWN0aXZlX3dpbmRvd3MpKSkpKQorICAgICAgICB7CisgICAgICAgICAgLyogVGhlIHNwYWNl IGFwcGVuZGVkIHRvIGEgcm93IGVuZGluZyB3aXRoIGEgbmV3IGxpbmUKKyAgICAgICAgICBkb2Vz IG5vdCBoYXZlIGEgYGdseXBoLT5jaGFycG9zYCAoLTEsIDApIHRoYXQgd2UgY2FuCisgICAgICAg ICAgdXNlIGZvciB0aGlzIHBhcnRpY3VsYXIgYXBwbGljYXRpb24uICBXaGVuIHRoZXJlIGlzIGEK KyAgICAgICAgICBgYnVmZmVyLWRpc3BsYXktdGFibGUnIGVudHJ5IHRoYXQgYXNzaWducyBhIHZp c2libGUKKyAgICAgICAgICBnbHlwaCB0byBhIG5ldyBsaW5lLCB0aGVyZSBpcyBubyBwcm9ibGVt IGJlY2F1c2UgdGhhdAorICAgICAgICAgIGdseXBoIGhhcyBhIGBnbHlwaC0+Y2hhcnBvcycgdGhh dCB3ZSBjYW4gdXNlLiAgV2hlbgorICAgICAgICAgIG5vIHZpc2libGUgRU9MIGdseXBoIGV4aXN0 cywgd2UgdXNlIHRoZSBmb2xsb3dpbmcKKyAgICAgICAgICB0ZXN0OiAgdGhlIGFwcGVuZGVkIHNw YWNlIGhhcyBhIHBvc2l0aW9uIHRoYXQgaXMgb25lCisgICAgICAgICAgbGVzcyB0aGFuIHRoZSBl bmQgb2YgdGhlIG1hdHJpeCByb3cuICovCisgICAgICAgICAgaW50IGhwb3MgPSBzdGFydCAtIHJv dy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICAgICAgc3RydWN0IGdseXBoICpwcmV2aW91c19n bHlwaCA9ICgwIDw9IGhwb3MgLSAxICYmIGhwb3MgLSAxIDwgcm93LT51c2VkW1RFWFRfQVJFQV0p CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gcm93LT5nbHlwaHNb VEVYVF9BUkVBXSArIGhwb3MgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogTlVMTDsKKyAgICAgICAgICAvLyBzdHJ1Y3QgZ2x5cGggKmxhc3RfZ2x5cGggPSBy b3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxOworICAgICAg ICAgIGJvb2wgc2tpcF9wID0gKHByZXZpb3VzX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBwcmV2aW91c19nbHlwaC0+Y2hhcnBvcyA9PSBNQVRSSVhfUk9XX0VORF9D SEFSUE9TIChyb3cpIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICYmIHN0YXJ0LT5ieXRl cG9zICE9IGVzc2VudGlhbHMuenZfYnl0ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgPyB0 cnVlCisgICAgICAgICAgICAgICAgICAgICAgICAvKiBXaGVuIGEgYGJ1ZmZlci1kaXNwbGF5LXRh YmxlJyBlbnRyeSBjb250YWlucworICAgICAgICAgICAgICAgICAgICAgICAgYSB2aXNpYmxlIHRh YiBjaGFyYWN0ZXIgKCLCuyIpLCB0aGUgc3Vic2VxdWVudAorICAgICAgICAgICAgICAgICAgICAg ICAgU1RSRVRDSF9HTFlQSCB3aWxsIGhhdmUgdGhlIHNhbWUgc3RhcnQtPmNoYXJwb3MKKyAgICAg ICAgICAgICAgICAgICAgICAgIGFzIHRoZSBhZm9yZW1lbnRpb25lZCB2aXNpYmxlIHRhYiBjaGFy YWN0ZXIuICovCisgICAgICAgICAgICAgICAgICAgICAgICA6IChwcmV2aW91c19nbHlwaCAhPSBO VUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBwcmV2aW91c19nbHlwaC0+Y2hhcnBv cyA9PSBzdGFydC0+Y2hhcnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgPyB0cnVlCisg ICAgICAgICAgICAgICAgICAgICAgICA6IGZhbHNlOworICAgICAgICAgIGludCBwb3NpbnQgPSAo cm93X3Bvc2l0aW9uID09IFBPU1RfWlYpCisgICAgICAgICAgICAgICAgICAgICAgICAgPyAtMQor ICAgICAgICAgICAgICAgICAgICAgICA6IChyb3dfcG9zaXRpb24gPT0gQVRfWlYpCisgICAgICAg ICAgICAgICAgICAgICAgICAgID8gZXNzZW50aWFscy56dgorICAgICAgICAgICAgICAgICAgICAg ICA6IChzdGFydC0+Ynl0ZXBvcyAhPSBlc3NlbnRpYWxzLnp2X2J5dGUKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNl ZFtURVhUX0FSRUFdIC0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICA/IE1BVFJJWF9ST1df RU5EX0NIQVJQT1MgKHJvdykgLSAxCisgICAgICAgICAgICAgICAgICAgICAgIDogKHN0YXJ0LT5i eXRlcG9zID09IGVzc2VudGlhbHMuenZfYnl0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW1RFWFRfQVJFQV0g LSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgID8gZXNzZW50aWFscy56dgorICAgICAgICAg ICAgICAgICAgICAgICA6IHN0YXJ0LT5jaGFycG9zOworICAgICAgICAgIExpc3BfT2JqZWN0IHNw ZWNzID0gbWNfYXNzb2MgKG1ha2VfZml4bnVtIChwb3NpbnQpLCBCVkFSIChiLCBtY19jb25mKSk7 CisgICAgICAgICAgaWYgKCgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID4gMCkKKyAg ICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAgICAm JiAhTklMUCAoc3BlY3MpCisgICAgICAgICAgICAgICYmIHJvdy0+eSA8PSB3aW5kb3dfdGV4dF9i b3R0b21feSAodykKKyAgICAgICAgICAgICAgJiYgIXNraXBfcAorICAgICAgICAgICAgICAmJiBy b3dfcG9zaXRpb24gIT0gUE9TVF9aVikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgTGlz cF9PYmplY3QgbGlzcF90eXBlID0gbWNfbnRoICgxLCBzcGVjcyk7CisgICAgICAgICAgICAgIGVu dW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUgPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IG1jX2xpc3BfdG9f Y3Vyc29yX3R5cGUgKFhDQVIgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKGxpc3BfdHlw ZSk7CisgICAgICAgICAgICAgIGN1cnNvcl90eXBlID0gKHN0YXJ0LT50eXBlID09IElNQUdFX0dM WVBIKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfSE9MTE9XX0JPWAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogY3Vyc29yX3R5cGU7CisgICAgICAgICAgICAgIGludCBj dXJzb3Jfd2lkdGggPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IFhGSVhOVU0gKFhDQVIgKFhDRFIgKGxpc3BfdHlwZSkpKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiAtMTsKKyAgICAgICAgICAgICAgTGlzcF9PYmplY3Qg bWNfZm9yZWdyb3VuZCA9IG1jX250aCAoMiwgc3BlY3MpOworICAgICAgICAgICAgICBzdHJ1Y3Qg bWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICAgICAgaWYgKFNUUklOR1AgKG1jX2ZvcmVncm91bmQp KQorICAgICAgICAgICAgICAgIG1jX3h3X2NvbG9yX3ZhbHVlcyAodywgbWNfZm9yZWdyb3VuZCwg JmxzbF9mZyk7CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoVkVDVE9SUCAobWNfZm9yZWdyb3Vu ZCkpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGxzbF9mZy5yZWQg PSBYRkxPQVRfREFUQSAoQVJFRiAobWNfZm9yZWdyb3VuZCwgMCkpOworICAgICAgICAgICAgICAg ICAgICBsc2xfZmcuZ3JlZW4gPSBYRkxPQVRfREFUQSAoQVJFRiAobWNfZm9yZWdyb3VuZCwgMSkp OworICAgICAgICAgICAgICAgICAgICBsc2xfZmcuYmx1ZSA9IFhGTE9BVF9EQVRBIChBUkVGICht Y19mb3JlZ3JvdW5kLCAyKSk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAg ICBlbHNlIGlmIChOSUxQIChtY19mb3JlZ3JvdW5kKSkKKyAgICAgICAgICAgICAgICAgICAgbWNf Y29sb3JfcGlja2VyICh3LCBzdGFydCwgZXNzZW50aWFscywgJmxzbF9mZywgcG9zaW50LAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCByb3dfcG9zaXRp b24sIE1VTFRJUExFX0NVUlNPUlMpOworICAgICAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9S T1dfVlBPUyAocm93LCBtYXRyaXgpOworICAgICAgICAgICAgICBpbnQgeF9saW1pdCA9IHdpbmRv d19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywg bWF0cml4LCByb3csIHN0YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGltaXQsIHJvdy0+eSwKKyAgICAg ICAgICAgICAgICAgICAgICAgICBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sIHZwb3Ms IGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgY3Vy c29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLAorICAgICAgICAgICAgICAgICAg ICAgICAgIGxzbF9mZywgTVVMVElQTEVfQ1VSU09SUywgZHJhd19wLCBmcm9tX3doZXJlLCBNQ19D QUNIRSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGlmICghTklMUCAoQlZBUiAo YiwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgJiYgKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAg ICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAmJiAh TklMUCAoQlZBUiAoYiwgZmNfaW5hY3RpdmVfd2luZG93cykpKSkKKyAgICAgICAgICAmJiBlc3Nl bnRpYWxzLmZjX3ggPD0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgJiYgZXNzZW50aWFscy5m Y194ID49IHctPm1jLmxudW1fcGl4ZWxfd2lkdGgpCisgICAgICAgIHsKKyAgICAgICAgICBpbnQg eF9saW1pdCA9IHggKyBzdGFydC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgYm9vbCByZWFsX2Zh a2VfY3Vyc29yX3AgPSAody0+Y3Vyc29yLnggPT0gZXNzZW50aWFscy5mY194CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnkgPT0gcm93LT55CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gc3Rh cnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgdy0+Y3Vyc29yLnZwb3MgPT0gdnBvcyk7CisgICAgICAgICAgc3RydWN0IG1j X1JHQiBsc2xfZmc7CisgICAgICAgICAgbWNfY29sb3JfcGlja2VyICh3LCBzdGFydCwgZXNzZW50 aWFscywgJmxzbF9mZywgLTEsIE1DX0JBUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHJv d19wb3NpdGlvbiwgRklMTF9DT0xVTU4pOworICAgICAgICAgIGlmICh4ICsgc3RhcnQtPnBpeGVs X3dpZHRoIDw9IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAmJiAoKGhlYWRlcl9saW5l X2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICAgICB8fCBoZWFkZXJfbGlu ZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAgJiYgKChzdGFydCAhPSByb3ctPmdseXBoc1tU RVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxCisgICAgICAgICAgICAgICAgICAg JiYgZXNzZW50aWFscy5mY194ID49IHgKKyAgICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxz LmZjX3ggPCB4ICsgc3RhcnQtPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgfHwgKHN0 YXJ0ID09IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEK KyAgICAgICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPj0geCkpCisgICAgICAg ICAgICAgICYmIHJvdy0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAg ICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0 cml4LCByb3csIHN0YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGltaXQsIHJvdy0+eSwKKyAgICAgICAg ICAgICAgICAgICAgICAgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLCB2cG9zLCBNQ19C QVIsIDEsCisgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMs IHJvd19wb3NpdGlvbiwgbHNsX2ZnLAorICAgICAgICAgICAgICAgICAgICAgICBGSUxMX0NPTFVN TiwgZHJhd19wLCBmcm9tX3doZXJlLCBGQ19DQUNIRSk7CisgICAgICAgIH0KKyAgICAgIGlmICgh TklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIs IGNoX2hvcml6b250YWxfcnVsZXIpKQorICAgICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9w CisgICAgICAgICAgICAgIHx8ICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAg ICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkpCisgICAgICAgICAg JiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgeworICAgICAgICAgIGludCB4X2xp bWl0ID0gKHN0YXJ0ID09IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVzZWRbVEVYVF9B UkVBXSAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICA/IHRleHRfYXJlYV93aWR0aAorICAg ICAgICAgICAgICAgICAgICAgICAgOiB4ICsgc3RhcnQtPnBpeGVsX3dpZHRoOworICAgICAgICAg IHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAgICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywgc3Rh cnQsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0xLCBNQ19IQkFSLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgcm93X3Bvc2l0aW9uLCBIT1JJWk9OVEFMX1JVTEVSKTsKKyAgICAgICAgICAvKiBQ cmVzZXJ2ZSBzdXBwb3J0IGZvciBkZWZhdWx0IGJlaGF2aW9yIHN1Y2ggdGhhdCBhIHVzZXIgbWF5 CisgICAgICAgICAgc3BlY2lmeSB0aGUgaGVpZ2h0IG9mIGFuIE1DX0hCQVIsIHdoaWNoIGJlZ2lu cyBpdHMgam91cm5leQorICAgICAgICAgIGFzIHRoZSBgY3Vyc29yX3dpZHRoJy4gIGBtY19nZXRf Y3Vyc29yX2dlb21ldHJ5JyByZWFkanVzdHMuICovCisgICAgICAgICAgbWNfZW5naW5lICh3LCBt YXRyaXgsIHJvdywgc3RhcnQsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwgcm93LT55LAorICAgICAg ICAgICAgICAgICAgICAgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLCB2cG9zLCBNQ19I QkFSLCAxLAorICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywg cm93X3Bvc2l0aW9uLCBsc2xfZmcsCisgICAgICAgICAgICAgICAgICAgICBIT1JJWk9OVEFMX1JV TEVSLCBkcmF3X3AsIGZyb21fd2hlcmUsIENIX0NBQ0hFKTsKKyAgICAgICAgfQorICAgICAgaWYg KCFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAmJiAhTklMUCAoQlZBUiAo YiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9w CisgICAgICAgICAgICAgIHx8ICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAg ICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkpCisgICAgICAgICAg JiYgIWZpbGxfY29sdW1uX3RydW1wc19wKQorICAgICAgICB7CisgICAgICAgICAgY3Vyc29yX3R5 cGUgPSAoc3RhcnQtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgICAgICAgICAgICAgICAgICAgICAg ICA/IE1DX0hPTExPV19CT1gKKyAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfQkFSOworICAg ICAgICAgIGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAg ICAgICAgICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9ICh3LT5jdXJzb3IueSA9PSByb3ctPnkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IudnBvcyA9 PSB2cG9zKTsKKyAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICBtY19j b2xvcl9waWNrZXIgKHcsIHN0YXJ0LCBlc3NlbnRpYWxzLCAmbHNsX2ZnLCAtMSwgY3Vyc29yX3R5 cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICByb3dfcG9zaXRpb24sIFZFUlRJQ0FMX1JV TEVSKTsKKyAgICAgICAgICBpZiAoKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAw KQorICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAg ICAgICYmICgoc3RhcnQgIT0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhU X0FSRUFdIC0gMQorICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHgKKyAgICAg ICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA8IHggKyBzdGFydC0+cGl4ZWxfd2lkdGgpCisg ICAgICAgICAgICAgICAgICB8fCAoc3RhcnQgPT0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJv dy0+dXNlZFtURVhUX0FSRUFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNv ci54ID49IHgpKQorICAgICAgICAgICAgICAmJiByb3ctPnkgPD0gd2luZG93X3RleHRfYm90dG9t X3kgKHcpCisgICAgICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgICAg ICBtY19lbmdpbmUgKHcsIG1hdHJpeCwgcm93LCBzdGFydCwgVEVYVF9BUkVBLCB4LCB4X2xpbWl0 LCByb3ctPnksCisgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVY VF9BUkVBXSwgdnBvcywgY3Vyc29yX3R5cGUsIDEsCisgICAgICAgICAgICAgICAgICAgICAgIGN1 cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgbHNsX2ZnLAorICAgICAgICAg ICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUiwgZHJhd19wLCBmcm9tX3doZXJlLCBDSF9DQUNI RSk7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgICAgeworICAgICAgICBpbnQgcmVs YXRpdmVfeCA9IDA7CisgICAgICAgIGZvciAoaW50IGFyZWEgPSBMRUZUX01BUkdJTl9BUkVBOyBh cmVhIDwgTEFTVF9BUkVBOyArK2FyZWEpCisgICAgICAgICAgeworICAgICAgICAgICAgc3RydWN0 IGdseXBoICpnbHlwaCA9IHJvdy0+Z2x5cGhzW2FyZWFdOworICAgICAgICAgICAgc3RydWN0IGds eXBoICpnbHlwaF9lbmQgPSBnbHlwaCArIHJvdy0+dXNlZFthcmVhXTsKKyAgICAgICAgICAgIC8q IEdseXBoIGZvciBhIGxpbmUgZW5kIGluIHRleHQuICovCisgICAgICAgICAgICBpZiAoYXJlYSA9 PSBURVhUX0FSRUEgJiYgZ2x5cGggPT0gZ2x5cGhfZW5kICYmIGdseXBoLT5jaGFycG9zID4gMCkK KyAgICAgICAgICAgICAgKytnbHlwaF9lbmQ7CisgICAgICAgICAgICBmb3IgKDsgZ2x5cGggPCBn bHlwaF9lbmQ7ICsrZ2x5cGgpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAo dnBvcyAhPSB3LT5jdXJzb3IudnBvcworICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaCAhPSBn bHlwaF9lbmQgLSAxCisgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA8IHJl bGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPCByZWxhdGl2ZV94 CisgICAgICAgICAgICAgICAgICAgICYmIE5JTFAgKEJWQVIgKGIsIG1jX2NvbmYpKSkKKyAgICAg ICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGlmICghTklMUCAoQlZBUiAoYiwg bWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisg ICAgICAgICAgICAgICAgICAgICAgICB8fCAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgbWNfaW5hY3RpdmVfd2luZG93 cykpKSkpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8qIFRoZSBz cGFjZSBhcHBlbmRlZCB0byBhIHJvdyBlbmRpbmcgd2l0aCBhIG5ldyBsaW5lIGRvZXMKKyAgICAg ICAgICAgICAgICAgICAgbm90IGhhdmUgYSBgZ2x5cGgtPmNoYXJwb3NgICgtMSwgMCkgdGhhdCB3 ZSBjYW4gdXNlIGZvciB0aGlzCisgICAgICAgICAgICAgICAgICAgIHBhcnRpY3VsYXIgYXBwbGlj YXRpb24uICBXaGVuIGEgYGJ1ZmZlci1kaXNwbGF5LXRhYmxlJyBlbnRyeQorICAgICAgICAgICAg ICAgICAgICBhc3NpZ25zIGEgdmlzaWJsZSBnbHlwaCB0byBhIG5ldyBsaW5lLCB0aGVyZSBpcyBu byBwcm9ibGVtCisgICAgICAgICAgICAgICAgICAgIGJlY2F1c2UgdGhhdCBnbHlwaCBoYXMgYSBg Z2x5cGgtPmNoYXJwb3MnIHRoYXQgd2UgY2FuIHVzZS4KKyAgICAgICAgICAgICAgICAgICAgV2hl biBubyB2aXNpYmxlIEVPTCBnbHlwaCBleGlzdHMsIHdlIHVzZSB0aGUgZm9sbG93aW5nIHRlc3Q6 CisgICAgICAgICAgICAgICAgICAgIHRoZSBhcHBlbmRlZCBzcGFjZSBoYXMgYSBwb3NpdGlvbiB0 aGF0IGlzIG9uZSBsZXNzIHRoYW4gdGhlCisgICAgICAgICAgICAgICAgICAgIGVuZCBvZiB0aGUg bWF0cml4IHJvdy4gKi8KKyAgICAgICAgICAgICAgICAgICAgaW50IGhwb3MgPSBnbHlwaCAtIHJv dy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAq cHJldmlvdXNfZ2x5cGggPSAoMCA8PSBocG9zIC0gMSAmJiBocG9zIC0gMSA8IHJvdy0+dXNlZFtU RVhUX0FSRUFdKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgaHBvcyAtIDEKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTlVMTDsKKyAgICAgICAgICAg ICAgICAgICAgLy8gc3RydWN0IGdseXBoICpsYXN0X2dseXBoID0gcm93LT5nbHlwaHNbVEVYVF9B UkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMTsKKyAgICAgICAgICAgICAgICAgICAgYm9v bCBza2lwX3AgPSAocHJldmlvdXNfZ2x5cGggIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBwcmV2aW91c19nbHlwaC0+Y2hhcnBvcyA9PSBNQVRSSVhfUk9XX0VO RF9DSEFSUE9TIChyb3cpIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBnbHlwaC0+Ynl0ZXBvcyAhPSBlc3NlbnRpYWxzLnp2X2J5dGUpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IHRydWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAvKiBXaGVuIGEgYGJ1ZmZlci1kaXNwbGF5LXRhYmxlJyBlbnRyeSBjb250YWlucworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGEgdmlzaWJsZSB0YWIgY2hhcmFjdGVyICgi wrsiKSwgdGhlIHN1YnNlcXVlbnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBT VFJFVENIX0dMWVBIIHdpbGwgaGF2ZSB0aGUgc2FtZSBnbHlwaC0+Y2hhcnBvcworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGFzIHRoZSBhZm9yZW1lbnRpb25lZCB2aXNpYmxlIHRh YiBjaGFyYWN0ZXIuICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAocHJl dmlvdXNfZ2x5cGggIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIHByZXZpb3VzX2dseXBoLT5jaGFycG9zID09IGdseXBoLT5jaGFycG9zKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyB0cnVlCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgaW50IHBvc2ludCA9IChy b3dfcG9zaXRpb24gPT0gUE9TVF9aVikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyAtMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAocm93X3Bvc2l0aW9u ID09IEFUX1pWKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBlc3NlbnRp YWxzLnp2CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaC0+Ynl0ZXBv cyAhPSBlc3NlbnRpYWxzLnp2X2J5dGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbVEVYVF9B UkVBXSAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JP V19FTkRfQ0hBUlBPUyAocm93KSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogKGdseXBoLT5ieXRlcG9zID09IGVzc2VudGlhbHMuenZfYnl0ZQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09 IHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBlc3NlbnRpYWxzLnp2CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IGdseXBoLT5jaGFycG9zOworICAgICAgICAgICAgICAgICAgICBMaXNwX09iamVjdCBzcGVjcyA9 IG1jX2Fzc29jIChtYWtlX2ZpeG51bSAocG9zaW50KSwgQlZBUiAoYiwgbWNfY29uZikpOworICAg ICAgICAgICAgICAgICAgICBpZiAoKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAw KQorICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQor ICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKHNwZWNzKQorICAgICAgICAgICAgICAg ICAgICAgICAgJiYgcm93LT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAgICAg ICAgICAgICAgICAgICAgJiYgIXNraXBfcAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93 X3Bvc2l0aW9uICE9IFBPU1RfWlYpCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgICAgICAgTGlzcF9PYmplY3QgbGlzcF90eXBlID0gbWNfbnRoICgxLCBzcGVjcyk7 CisgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBl ID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoWENBUiAo bGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKGxpc3BfdHlwZSk7CisgICAg ICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IChnbHlwaC0+dHlwZSA9PSBJTUFHRV9H TFlQSCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19IT0xMT1df Qk9YCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogY3Vyc29yX3R5cGU7 CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY3Vyc29yX3dpZHRoID0gKENPTlNQIChsaXNw X3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gWEZJ WE5VTSAoWENBUiAoWENEUiAobGlzcF90eXBlKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiAtMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIExpc3BfT2Jq ZWN0IG1jX2ZvcmVncm91bmQgPSBtY19udGggKDIsIHNwZWNzKTsKKyAgICAgICAgICAgICAgICAg ICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAgICAgICAgICAgICAgICAgICAgICAgaWYg KFNUUklOR1AgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICBtY194 d19jb2xvcl92YWx1ZXMgKHcsIG1jX2ZvcmVncm91bmQsICZsc2xfZmcpOworICAgICAgICAgICAg ICAgICAgICAgICAgICBlbHNlIGlmIChWRUNUT1JQIChtY19mb3JlZ3JvdW5kKSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsc2xf ZmcucmVkID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDApKTsKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGxzbF9mZy5ncmVlbiA9IFhGTE9BVF9EQVRBIChBUkVGICht Y19mb3JlZ3JvdW5kLCAxKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsc2xfZmcu Ymx1ZSA9IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3JvdW5kLCAyKSk7CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYg KE5JTFAgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWNf Y29sb3JfcGlja2VyICh3LCBnbHlwaCwgZXNzZW50aWFscywgJmxzbF9mZywKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaW50LCBjdXJzb3JfdHlwZSwg cm93X3Bvc2l0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBNVUxUSVBMRV9DVVJTT1JTKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCB2cG9z ID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgICAgICAgICAgICAgICAgICAgICAg ICBpbnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAgICAg ICAgICAgICAgICAgICAgICBtY19lbmdpbmUgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgYXJlYSwg cmVsYXRpdmVfeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeF9saW1pdCwg cm93LT55LCBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHZwb3MsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGN1cnNv cl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMs IHJvd19wb3NpdGlvbiwgbHNsX2ZnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBNVUxUSVBMRV9DVVJTT1JTLCBkcmF3X3AsIGZyb21fd2hlcmUsIE1DX0NBQ0hFKTsKKyAgICAg ICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAg aWYgKCFOSUxQIChCVkFSIChiLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAgICAgICAgICAgJiYg KGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8ICghZXNzZW50 aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFS IChiLCBmY19pbmFjdGl2ZV93aW5kb3dzKSkpKQorICAgICAgICAgICAgICAgICAgICAmJiBlc3Nl bnRpYWxzLmZjX3ggPD0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICYmIGVz c2VudGlhbHMuZmNfeCA+PSB3LT5tYy5sbnVtX3BpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgICBpbnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGgg KHcsIFRFWFRfQVJFQSk7CisgICAgICAgICAgICAgICAgICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNv cl9wID0gKHctPmN1cnNvci54ID09IGVzc2VudGlhbHMuZmNfeAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueSA9PSByb3ctPnkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29y Lmhwb3MgPT0gZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci52cG9zID09IHZwb3Mp OworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5nbHlwaHNbVEVY VF9BUkVBXTsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAg ICAgICAgICAgICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywgZ2x5cGgsIGVzc2VudGlhbHMsICZs c2xfZmcsIC0xLCBNQ19CQVIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg cm93X3Bvc2l0aW9uLCBGSUxMX0NPTFVNTik7CisgICAgICAgICAgICAgICAgICAgIGlmIChocG9z ID49IGhwb3Nfc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIGhwb3MgPCBocG9zX3N0 YXJ0ICsgaHBvc19sZW5ndGgKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIHJlbGF0aXZlX3gg KyBnbHlwaC0+cGl4ZWxfd2lkdGggPD0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAg ICAgICAgICAmJiAoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAg ICAgICAgICAgICAgICAgICAmJiAoKGdseXBoICE9IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID49IHJlbGF0aXZlX3gKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194IDwgcmVsYXRpdmVfeCAr IGdseXBoLT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAoZ2x5 cGggPT0gZ2x5cGhfZW5kIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBl c3NlbnRpYWxzLmZjX3ggPj0gcmVsYXRpdmVfeCkpCisgICAgICAgICAgICAgICAgICAgICAgICAm JiByb3ctPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICAgICAg ICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAgICAgICAgICAgICAgIG1jX2Vu Z2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4X2xpbWl0LAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT55LCBocG9zLCB2cG9zLCBNQ19C QVIsIDEsIGN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBl c3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGxzbF9mZywgRklMTF9DT0xVTU4sCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBkcmF3X3AsIGZyb21fd2hlcmUsIEZDX0NBQ0hFKTsKKyAg ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKGIsIGNy b3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfaG9y aXpvbnRhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2 ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICB8fCAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfaW5hY3RpdmVf d2luZG93cykpKSkKKyAgICAgICAgICAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBv cykKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaW50IHhfbGltaXQg PSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOworICAgICAgICAgICAgICAgICAgICBp bnQgaHBvcyA9IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICAgICAg ICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgICAgICAgICAgIG1jX2NvbG9y X3BpY2tlciAodywgZ2x5cGgsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0xLCBNQ19IQkFSLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgSE9SSVpPTlRB TF9SVUxFUik7CisgICAgICAgICAgICAgICAgICAgIC8qIFByZXNlcnZlIHN1cHBvcnQgZm9yIGRl ZmF1bHQgYmVoYXZpb3Igc3VjaCB0aGF0IGEgdXNlciBtYXkKKyAgICAgICAgICAgICAgICAgICAg c3BlY2lmeSB0aGUgaGVpZ2h0IG9mIGFuIE1DX0hCQVIsIHdoaWNoIGJlZ2lucyBpdHMgam91cm5l eQorICAgICAgICAgICAgICAgICAgICBhcyB0aGUgYGN1cnNvcl93aWR0aCcuICBgbWNfZ2V0X2N1 cnNvcl9nZW9tZXRyeScgcmVhZGp1c3RzLiAqLworICAgICAgICAgICAgICAgICAgICBpZiAoaHBv cyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICAgICAgICAgICAgICAmJiBocG9zIDwgaHBvc19z dGFydCArIGhwb3NfbGVuZ3RoKQorICAgICAgICAgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywg bWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4X2xpbWl0LAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgcm93LT55LCBocG9zLCB2cG9zLCBNQ19IQkFSLCAxLCBj dXJzb3JfbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFs cywgcm93X3Bvc2l0aW9uLCBsc2xfZmcsIEhPUklaT05UQUxfUlVMRVIsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBkcmF3X3AsIGZyb21fd2hlcmUsIENIX0NBQ0hFKTsKKyAgICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKGIsIGNyb3Nz aGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGlj YWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAmJiAoZXNzZW50aWFscy5hY3RpdmVfcAor ICAgICAgICAgICAgICAgICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2luYWN0aXZlX3dpbmRv d3MpKSkpCisgICAgICAgICAgICAgICAgICAgICYmICFmaWxsX2NvbHVtbl90cnVtcHNfcCkKKyAg ICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUgPSAoZ2x5 cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBNQ19IT0xMT1dfQk9YCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBN Q19CQVI7CisgICAgICAgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0 aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgICAgICAgICAgYm9vbCByZWFsX2Zha2VfY3Vy c29yX3AgPSAody0+Y3Vyc29yLnkgPT0gcm93LT55CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci52cG9zID09IHZwb3MpOworICAgICAg ICAgICAgICAgICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsK KyAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgICAg ICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywgZ2x5cGgsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0x LCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb3df cG9zaXRpb24sIFZFUlRJQ0FMX1JVTEVSKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGhwb3Mg Pj0gaHBvc19zdGFydAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA8IGhwb3Nfc3Rh cnQgKyBocG9zX2xlbmd0aAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKChoZWFkZXJfbGlu ZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8 IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKChn bHlwaCAhPSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHct PmN1cnNvci54ID49IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg dy0+Y3Vyc29yLnggPCByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHx8IChnbHlwaCA9PSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHJlbGF0aXZlX3gpKQorICAg ICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3 KQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAg ICAgICAgICAgICAgICAgICBtY19lbmdpbmUgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgYXJlYSwg cmVsYXRpdmVfeCwgeF9saW1pdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJv dy0+eSwgaHBvcywgdnBvcywgY3Vyc29yX3R5cGUsIDEsIGN1cnNvcl9tYXRyaXgsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGxzbF9m ZywgVkVSVElDQUxfUlVMRVIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3 X3AsIGZyb21fd2hlcmUsIENIX0NBQ0hFKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAg fQorICAgICAgICAgIH0KKyAgICAgIH0KKyAgLy8gIGNsb2NrX3QgY2xvY2tfZW5kID0gY2xvY2so KTsKKyAgLy8gIGRvdWJsZSBjcHVfdGltZV91c2VkID0gKChkb3VibGUpIChjbG9ja19lbmQgLSBj bG9ja19zdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7CisgIC8vICBmcHJpbnRmIChzdGRlcnIsICJt Y19kcmF3X3JvdyAoJXMpOiAgVElNRSAoJWYpXG4iLCBtY193aW5kb3cgKHcpLCBjcHVfdGltZV91 c2VkKTsKK30KKworYm9vbAorbWNfcmVkcmF3X3JvdyAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0 IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAg ICAgICBlbnVtIGdseXBoX3Jvd19hcmVhIGFyZWEsIGludCBzdGFydF94LCBpbnQgc3RhcnRfaHBv cywgaW50IGVuZF9ocG9zLAorICAgICAgICAgICAgICAgYm9vbCBjbGVhcl9lb2xfcCwgZW51bSBk cmF3X2dseXBoc19mYWNlIGhsLAorICAgICAgICAgICAgICAgZW51bSBtY19yZWRyYXdfcm93X3R5 cGUgZnJvbV93aGVyZSkKK3sKKyAgYm9vbCBnb19wID0gKCh3LT5tY19tYXRyaXguY3Vyc29yc191 c2VkW01DX0NBQ0hFXSA+IDAKKyAgICAgICAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29y c191c2VkW0NIX0NBQ0hFXSA+IDAKKyAgICAgICAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vy c29yc191c2VkW0ZDX0NBQ0hFXSA+IDApCisgICAgICAgICAgICAgICAmJiBhcmVhID09IFRFWFRf QVJFQQorICAgICAgICAgICAgICAgJiYgcm93LT51c2VkW2FyZWFdKTsKKyAgaWYgKCFnb19wKQor ICAgIHJldHVybiBmYWxzZTsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJB TUUgKHcpKTsKKyAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAg aWYgKHRyYWNlX3JlZGlzcGxheV9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IGNhY2hlX3R5cGUsIHZudGgsIG50aCk7CisgICAgICAgICAg ICsrbnRoKQorICAgICAgICB7CisgICAgICAgICAgaW50IHggPSB3LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLng7CisgICAgICAgICAgaW50IGZ4ID0gdy0+bWNf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5meDsKKyAgICAgICAgICBp bnQgeSA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ueTsK KyAgICAgICAgICBpbnQgZnkgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhdLmZ5OworICAgICAgICAgIGludCBocG9zID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5ocG9zOworICAgICAgICAgIGludCB2cG9zID0gdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS52cG9zOworICAgICAg ICAgIGludCB3ZCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF0ud2Q7CisgICAgICAgICAgaW50IGggPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhdLmg7CisgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3Jf dHlwZSA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uY3Vy c29yX3R5cGU7CisgICAgICAgICAgaW50IGN1cnNvcl93aWR0aCA9IHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uY3Vyc29yX3dpZHRoOworICAgICAgICAgIHN0 cnVjdCBtY19SR0IgbHNsX2ZnID0gey5yZWQgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhdLmZnLnJlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAuZ3JlZW4gPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLmZnLmdyZWVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5mZy5ibHVlfTsK KyAgICAgICAgICAvLyAgc3RydWN0IG1jX1JHQiBsc2xfYmcgPSB7LnJlZCA9IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmcucmVkLAorICAgICAgICAgIC8v ICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLmdyZWVuLAorICAgICAgICAgIC8vICAgICAgICAg ICAgICAgICAgICAgICAgICAuYmx1ZSA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF0uYmcuYmx1ZX07CisgICAgICAgICAgYm9vbCBhY3RpdmVfcCA9IHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYWN0aXZlX3A7CisgICAg ICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5nbHlwaF9mbGF2b3I7CisgICAgICAgICAgYm9vbCBl bmFibGVkX3AgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhd LmVuYWJsZWRfcDsKKyAgICAgICAgICBpZiAodnBvcyA9PSB2bnRoCisgICAgICAgICAgICAgICYm ICgoaHBvcyA+PSBzdGFydF9ocG9zCisgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA8IGVuZF9o cG9zKQorICAgICAgICAgICAgICAgICAgLyogQSBmbG9hdGluZyBjdXJzb3IgYmV5b25kIHRoZSBl bmQgb2YgdGhlIGdseXBoIHJvdy4gKi8KKyAgICAgICAgICAgICAgICAgIHx8IChocG9zICsgMSA9 PSBzdGFydF9ocG9zCisgICAgICAgICAgICAgICAgICAgICAgJiYgaHBvcyArIDEgPT0gZW5kX2hw b3MpKQorICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgICB7CisgICAgICAg ICAgICAgIGJvb2wgcmVtb3ZlX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgbWNfZHJhd19lcmFz ZV9oeWJyaWQgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBo LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUsIGN1cnNv cl93aWR0aCwgbHNsX2ZnLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGdseXBoX2ZsYXZvciwgcmVtb3ZlX3ApOworICAgICAgICAgICAgfQorICAgICAgICB9 CisgICAgfQorICByZXR1cm4gdHJ1ZTsKKyAgLy8gIGNsb2NrX2VuZCA9IGNsb2NrKCk7CisgIC8v ICBkb3VibGUgdGltZV9jdXJzb3JzID0gKChkb3VibGUpIChjbG9ja19lbmQgLSBjbG9ja19zdGFy dCkpIC8gQ0xPQ0tTX1BFUl9TRUM7CisgIC8vICBmcHJpbnRmIChzdGRlcnIsICJtY19yZWRyYXdf cm93ICglZCk6ICBocG9zICglZC8lZCkgfCBnbHlwaHMgKCVmKSB8IGN1cnNvcnMgKCVmKVxuIiwK KyAgLy8gICAgICAgICAgICAgICAgICAgdnBvcywgc3RhcnRfaHBvcywgZW5kX2hwb3MsIHRpbWVf Z2x5cGhzLCB0aW1lX2N1cnNvcnMpOworfQorCit2b2lkCittY19lcmFzZV9yb3cgKHN0cnVjdCB3 aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAq cm93KQoreworICBpbnQgdm50aCA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICBp ZiAodHJhY2VfcmVkaXNwbGF5X3ApCisgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZXJhc2Vfcm93 ICglcyk6ICB2cG9zICglZClcbiIsIG1jX3dpbmRvdyAodyksIHZudGgpOworICAvLyAgaWYgKHRy YWNlX3JlZGlzcGxheV9wKQorICAvLyAgICBmcHJpbnRmIChzdGRlcnIsICJtY19lcmFzZV9oZWxw ZXIgKCVzKTogIGNhY2hlICglcykgfCB2cG9zICglZClcbiIsCisgIC8vICAgICAgbWNfd2luZG93 ICh3KSwgbWNfY2FjaGVfdHlwZV90b19zdHJpbmcgKGNhY2hlX3R5cGUpLCB2bnRoKTsKKyAgZm9y IChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOworICAgICAgIGNhY2hl X3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICArK2NhY2hlX3R5cGUpCisgICAgeworICAgICAgZm9y IChpbnQgbnRoID0gMDsKKyAgICAgICAgICAgbWNfdHJhdmVyc2VfY2FjaGVfcCAody0+bWNfbWF0 cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGgpOworICAgICAgICAgICArK250aCkKKyAgICAgICAg eworICAgICAgICAgIGludCB4ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXS54OworICAgICAgICAgIGludCBmeCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZng7CisgICAgICAgICAgaW50IHkgPSB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLnk7CisgICAgICAgICAgaW50IGZ5 ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5meTsKKyAg ICAgICAgICBpbnQgaHBvcyA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF0uaHBvczsKKyAgICAgICAgICBpbnQgdnBvcyA9IHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0udnBvczsKKyAgICAgICAgICBpbnQgd2QgPSB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLndkOworICAgICAgICAg IGludCBoID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5o OworICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUgPSB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmN1cnNvcl90eXBlOworICAgICAg ICAgIGludCBjdXJzb3Jfd2lkdGggPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhdLmN1cnNvcl93aWR0aDsKKyAgICAgICAgICAvLyAgc3RydWN0IG1jX1JHQiBs c2xfZmcgPSB7LnJlZCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF0uZmcucmVkLAorICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3Jl ZW4gPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZnLmdy ZWVuLAorICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZmcuYmx1ZX07CisgICAg ICAgICAgc3RydWN0IG1jX1JHQiBsc2xfYmcgPSB7LnJlZCA9IHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmcucmVkLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIC5ncmVlbiA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF0uYmcuZ3JlZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg LmJsdWUgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJn LmJsdWV9OworICAgICAgICAgIGJvb2wgYWN0aXZlX3AgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmFjdGl2ZV9wOworICAgICAgICAgIGVudW0gbWNfZmxh dm9yIGdseXBoX2ZsYXZvciA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF0uZ2x5cGhfZmxhdm9yOworICAgICAgICAgIGJvb2wgZW5hYmxlZF9wID0gdy0+bWNf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFibGVkX3A7CisgICAg ICAgICAgLyogYG1hdHJpeF9yb3cnIGluIGBkaXNwbmV3LmNgIGNvbnRhaW5zIHRoZSBmb2xsb3dp bmcgdGVzdHMsCisgICAgICAgICAgZWFzc2VydCAobWF0cml4ICYmIG1hdHJpeC0+cm93cyk7Cisg ICAgICAgICAgZWFzc2VydCAocm93ID49IDAgJiYgcm93IDwgbWF0cml4LT5ucm93cyk7ICovCisg ICAgICAgICAgYm9vbCBiYXJmX2NyYXNoX29uZSA9IChtYXRyaXggJiYgbWF0cml4LT5yb3dzKSA/ IGZhbHNlIDogdHJ1ZTsKKyAgICAgICAgICBpZiAoYmFyZl9jcmFzaF9vbmUpCisgICAgICAgICAg ICBjb250aW51ZTsKKyAgICAgICAgICBib29sIGJhcmZfY3Jhc2hfdHdvID0gKHZwb3MgPj0gMCAm JiB2cG9zIDwgbWF0cml4LT5ucm93cykgPyBmYWxzZSA6IHRydWU7CisgICAgICAgICAgaWYgKGJh cmZfY3Jhc2hfdHdvKQorICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgaWYgKHZwb3Mg PT0gdm50aAorICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEgKKyAgICAg ICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19l cmFzZV9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCB5LCBocG9zLCB2cG9zLCBnbHlwaF9mbGF2 b3IsIGN1cnNvcl90eXBlLCB3ZCk7CisgICAgICAgICAgICAgIHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZW5hYmxlZF9wID0gZmFsc2U7CisgICAgICAgICAg ICAgIC0tdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90eXBlXTsKKyAgICAgICAgICAg IH0KKyAgICAgICAgICAgIGVsc2UgaWYgKHZwb3MgPT0gdm50aAorICAgICAgICAgICAgICAgICAg ICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgYm9vbCBy ZW1vdmVfcCA9IHRydWU7CisgICAgICAgICAgICAgICAgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHcs IG1hdHJpeCwgcm93LCB4LCBmeCwg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PSAyNzAKKyAgfCAgICAgICAgICAgICB8ICAgIFtUb3AgcGFydCBvZiB0aGUgbG93 ZXIgcmVjdGFuZ2xlIGdldHMgY29waWVkIHRvIGxvd2VyIHJ1bi5kZXNpcmVkX3kuXQorICB8ICAg ICAgICAgICAgIHwKKyAgKy0tLS0tLS0tLS0tLS0rIDw9IGl0Lmxhc3RfdmlzaWJsZV95ID09IDEw ODAgKi8KK3ZvaWQKK21jX3ByZV9zY3JvbGxfY2xlYW4gKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVj dCBydW4gcnVuLCBpbnQgc3RhcnRfdnBvcywKKyAgICAgICAgICAgICAgICAgICAgIGludCBucm93 c19zY3JvbGxlZCwgZW51bSBtY19wcmVfc2Nyb2xsX2NsZWFuX3R5cGUgZnJvbV93aGVyZSkKK3sK KyAgaWYgKE1JTklfV0lORE9XX1AgKHcpKQorICAgIHJldHVybjsKKyAgYm9vbCBnb19vbmVfcCA9 ICh3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW01DX0NBQ0hFXSA+IDAKKyAgICAgICAgICAgICAg ICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0NIX0NBQ0hFXSA+IDAKKyAgICAgICAg ICAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0ZDX0NBQ0hFXSA+IDApOwor ICBib29sIGdvX3R3b19wID0gKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAg ICAgICYmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkK KyAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRl bnRzKSwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkpOworICBpZiAodHJhY2VfcmVkaXNw bGF5X3ApCisgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfcHJlX3Njcm9sbF9jbGVhbiAoJXMpOlxu XAorICAlcyB8IGdvX29uZV9wICglcykgfCBnb190d29fcCAoJXMpXG5cCisgIHN0YXJ0X3Zwb3Mg KCVkKSB8IG5yb3dzX3Njcm9sbGVkICglZClcblwKKyAgJXM6ICBydW4uY3VycmVudC9kZXNpcmVk X3kgKCVkLyVkKSB8IHJ1bi5oZWlnaHQgKCVkKVxuIiwKKyAgICBtY193aW5kb3cgKHcpLCAoZnJv bV93aGVyZSA9PSBUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfRE9XTikKKyAgICAg ICAgICAgICAgICAgICAgID8gIlRSWV9XSU5ET1dfUkVVU0lOR19DVVJSRU5UX01BVFJJWF9ET1dO IgorICAgICAgICAgICAgICAgICAgIDogKGZyb21fd2hlcmUgPT0gVFJZX1dJTkRPV19SRVVTSU5H X0NVUlJFTlRfTUFUUklYX1VQKQorICAgICAgICAgICAgICAgICAgICAgPyAiVFJZX1dJTkRPV19S RVVTSU5HX0NVUlJFTlRfTUFUUklYX1VQIgorICAgICAgICAgICAgICAgICAgIDogKGZyb21fd2hl cmUgPT0gVFJZX1dJTkRPV19JRCkKKyAgICAgICAgICAgICAgICAgICAgID8gIlRSWV9XSU5ET1df SUQiCisgICAgICAgICAgICAgICAgICAgOiAiVU5LTk9XTiIsCisgICAgZ29fb25lX3AgPyAieWVz IiA6ICJubyIsIGdvX3R3b19wID8gInllcyIgOiAibm8iLAorICAgIHN0YXJ0X3Zwb3MsIG5yb3dz X3Njcm9sbGVkLAorICAgIHJ1bi5jdXJyZW50X3kgPCBydW4uZGVzaXJlZF95ID8gIuKGkyIgOiAi 4oaRIiwKKyAgICBydW4uY3VycmVudF95LCBydW4uZGVzaXJlZF95LCBydW4uaGVpZ2h0KTsKKyAg aWYgKCFnb19vbmVfcCAmJiAhZ29fdHdvX3ApCisgICAgcmV0dXJuO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ggQVJHLCB0dXJuIHRyYWNpbmcgb24gaWYgYW5kIG9ubHkgaWYgQVJH IGlzIHBvc2l0aXZlLiAqLykKKyAgKExpc3BfT2JqZWN0IGFyZykKK3sKKyAgaWYgKE5JTFAgKGFy ZykpCisgICAgbWNfc3RkZXJyX3AgPSAhbWNfc3RkZXJyX3A7CisgIGVsc2UKKyAgICB7CisgICAg ICBhcmcgPSBGcHJlZml4X251bWVyaWNfdmFsdWUgKGFyZyk7CisgICAgICBtY19zdGRlcnJfcCA9 IFhGSVhOVU0gKGFyZykgPiAwOworICAgIH0KKyAgcmV0dXJuIFFuaWw7Cit9CisKKy8qIGVuZCBN VUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAMCiAvKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioKIAkJICAgICAgV2luZG93IGRpc3BsYXkgZGltZW5zaW9ucwpAQCAtMTM1MTEs NiArMTgzNDcsNjkgQEAgaHNjcm9sbF93aW5kb3dfdHJlZSAoTGlzcF9PYmplY3Qgd2luZG93KQog CSAgICAgIGVsc2UKIAkJcHQgPSBjbGlwX3RvX2JvdW5kcyAoQkVHViwgbWFya2VyX3Bvc2l0aW9u ICh3LT5wb2ludG0pLCBaVik7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdp biBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIChnZGIpIGJ0CisjMCAgdGVybWluYXRlX2R1ZV90 b19zaWduYWwgKHNpZz02LCBiYWNrdHJhY2VfbGltaXQ9MjE0NzQ4MzY0NykgYXQgZW1hY3MuYzoz NTkKKyMxICAweDAwMDAwMDAxMDAxZWU5OTYgaW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QgeGRpc3AuYzoxODU0NgorKi8KKworICAvKiBgaW5pdF9pdGVyYXRvcic6 ICBlYXNzZXJ0IChjaGFycG9zIDwgMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8 fCAoY2hhcnBvcyA+PSBCVUZfQkVHIChjdXJyZW50X2J1ZmZlcikKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIGNoYXJwb3MgPD0gWlYpKTsgKi8KKworICBzdHJ1Y3QgZGlz cGxheV9wb3MgKnBvcyA9ICZjdXJzb3Jfcm93LT5zdGFydDsKKyAgcHRyZGlmZl90IGNoYXJwb3Mg PSBDSEFSUE9TIChwb3MtPnBvcyk7CisKKyAgYm9vbCBiYXJmX2NyYXNoX29uZSA9IChjaGFycG9z IDwgMAorICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChjaGFycG9zID49IEJVRl9CRUcgKGN1 cnJlbnRfYnVmZmVyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjaGFycG9zIDw9 IFpWKSkKKyAgICAgICAgICAgICAgICAgICAgICAgID8gZmFsc2UKKyAgICAgICAgICAgICAgICAg ICAgICAgIDogdHJ1ZTsKKyAgaWYgKGJhcmZfY3Jhc2hfb25lKQorICAgIHJldHVybiBoc2Nyb2xs ZWRfcDsKKworICAvKiBgcmVzZWF0XzEnOiAgQ0hBUlBPUyAocG9zKSA+PSBCRUdWICYmIENIQVJQ T1MgKHBvcykgPD0gWlYgKi8KKyAgYm9vbCBiYXJmX2NyYXNoX3R3byA9IChjaGFycG9zID49IEJF R1YgJiYgY2hhcnBvcyA8PSBaVikKKyAgICAgICAgICAgICAgICAgICAgICAgICA/IGZhbHNlCisg ICAgICAgICAgICAgICAgICAgICAgICAgOiB0cnVlOworICBpZiAoYmFyZl9jcmFzaF90d28pCisg ICAgcmV0dXJuIGhzY3JvbGxlZF9wOworCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogCSAgICAgIC8qIE1vdmUgaXRlcmF0b3IgdG8gcHQg c3RhcnRpbmcgYXQgY3Vyc29yX3Jvdy0+c3RhcnQgaW4KIAkJIGEgbGluZSB3aXRoIGluZmluaXRl IHdpZHRoLiAgKi8KIAkgICAgICBpbml0X3RvX3Jvd19zdGFydCAoJml0LCB3LCBjdXJzb3Jfcm93 KTsKQEAgLTE0Mzk3LDkgKzE5Mjk2LDIyIEBAIHJlZGlzcGxheV9pbnRlcm5hbCAodm9pZCkKIAkg ICAgICAqdy0+ZGVzaXJlZF9tYXRyaXgtPm1ldGhvZCA9IDA7CiAJICAgICAgZGVidWdfbWV0aG9k X2FkZCAodywgIm9wdGltaXphdGlvbiAxIik7CiAjZW5kaWYKKworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogI2lmZGVmIEhBVkVfV0lORE9XX1NZ U1RFTQorICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAmJiAhTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisgICAgbWNfdXBkYXRlX3dpbmRv d19mcmluZ2VzICh3LCBmYWxzZSk7CisgICAgZWxzZQogCSAgICAgIHVwZGF0ZV93aW5kb3dfZnJp bmdlcyAodywgZmFsc2UpOwogI2VuZGlmCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK IAkgICAgICBnb3RvIHVwZGF0ZTsKIAkgICAgfQogCSAgZWxzZQpAQCAtMTc3OTIsMTAgKzIyNzA0 LDIyIEBAIHJlZGlzcGxheV93aW5kb3cgKExpc3BfT2JqZWN0IHdpbmRvdywgYm9vbCBqdXN0X3Ro aXNfb25lX3ApCiAgICAgfQogCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgYm9vbCBrZWVw X2N1cnJlbnRfcCA9IChqdXN0X3RoaXNfb25lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICB8 fCAoIXVzZWRfY3VycmVudF9tYXRyaXhfcCAmJiAhb3ZlcmxheV9hcnJvd19zZWVuKQorICAgICAg ICAgICAgICAgICAgICAgICAgIHx8IHctPnBzZXVkb193aW5kb3dfcCk7CisKKyAgYm9vbCBmcmlu Z2VzX3VwZGF0ZWRfcCA9IChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hh aXJzKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICA/IG1jX3VwZGF0ZV93aW5kb3dfZnJp bmdlcyAodywga2VlcF9jdXJyZW50X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICA6IHVw ZGF0ZV93aW5kb3dfZnJpbmdlcyAodywga2VlcF9jdXJyZW50X3ApOworCiAgIGlmIChGUkFNRV9X SU5ET1dfUCAoZikKLSAgICAgICYmIHVwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgKGp1c3RfdGhp c19vbmVfcAotCQkJCSAgICB8fCAoIXVzZWRfY3VycmVudF9tYXRyaXhfcCAmJiAhb3ZlcmxheV9h cnJvd19zZWVuKQotCQkJCSAgICB8fCB3LT5wc2V1ZG9fd2luZG93X3ApKSkKKyAgICAgICYmIGZy aW5nZXNfdXBkYXRlZF9wKQogICAgIHsKICAgICAgIHVwZGF0ZV9iZWdpbiAoZik7CiAgICAgICBi bG9ja19pbnB1dCAoKTsKQEAgLTE3ODEwLDYgKzIyNzM0LDkgQEAgcmVkaXNwbGF5X3dpbmRvdyAo TGlzcF9PYmplY3Qgd2luZG93LCBib29sIGp1c3RfdGhpc19vbmVfcCkKICAgICAgIHVwZGF0ZV9l bmQgKGYpOwogICAgIH0KIAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBpZiAoV0lO RE9XX0JPVFRPTV9ESVZJREVSX1dJRFRIICh3KSkKICAgICBndWlfZHJhd19ib3R0b21fZGl2aWRl ciAodyk7CiAjZW5kaWYgLyogSEFWRV9XSU5ET1dfU1lTVEVNICovCkBAIC0xODEyNSw2ICsyMzA1 MiwxNiBAQCB0cnlfd2luZG93X3JldXNpbmdfY3VycmVudF9tYXRyaXggKHN0cnVjdCB3aW5kb3cg KncpCiAJICAgICAgdXBkYXRlX2JlZ2luIChmKTsKIAkgICAgICBndWlfdXBkYXRlX3dpbmRvd19i ZWdpbiAodyk7CiAJICAgICAgRlJBTUVfUklGIChmKS0+Y2xlYXJfd2luZG93X21vdXNlX2ZhY2Ug KHcpOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAq LworCisgICAgbWNfcHJlX3Njcm9sbF9jbGVhbiAodywgcnVuLCBzdGFydF92cG9zLCBucm93c19z Y3JvbGxlZCwgVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX0RPV04pOworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAJICAgICAgRlJBTUVfUklGIChmKS0+c2Nyb2xsX3J1 bl9ob29rICh3LCAmcnVuKTsKIAkgICAgICBndWlfdXBkYXRlX3dpbmRvd19lbmQgKHcsIGZhbHNl LCBmYWxzZSk7CiAJICAgICAgdXBkYXRlX2VuZCAoZik7CkBAIC0xODI5MSw2ICsyMzIyOCwxNiBA QCB0cnlfd2luZG93X3JldXNpbmdfY3VycmVudF9tYXRyaXggKHN0cnVjdCB3aW5kb3cgKncpCiAJ ICB1cGRhdGVfYmVnaW4gKGYpOwogCSAgZ3VpX3VwZGF0ZV93aW5kb3dfYmVnaW4gKHcpOwogCSAg RlJBTUVfUklGIChmKS0+Y2xlYXJfd2luZG93X21vdXNlX2ZhY2UgKHcpOworCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgbWNfcHJlX3Nj cm9sbF9jbGVhbiAodywgcnVuLCBzdGFydF92cG9zLCBucm93c19zY3JvbGxlZCwgVFJZX1dJTkRP V19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX1VQKTsKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogCSAgRlJBTUVfUklGIChmKS0+c2Nyb2xsX3J1bl9ob29rICh3LCAmcnVuKTsKIAkgIGd1 aV91cGRhdGVfd2luZG93X2VuZCAodywgZmFsc2UsIGZhbHNlKTsKIAkgIHVwZGF0ZV9lbmQgKGYp OwpAQCAtMTkyNDUsNiArMjQxOTIsMTYgQEAgdHJ5X3dpbmRvd19pZCAoc3RydWN0IHdpbmRvdyAq dykKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KIAkgIGd1aV91cGRhdGVfd2luZG93X2JlZ2lu ICh3KTsKIAkgIEZSQU1FX1JJRiAoZiktPmNsZWFyX3dpbmRvd19tb3VzZV9mYWNlICh3KTsKKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAg IG1jX3ByZV9zY3JvbGxfY2xlYW4gKHcsIHJ1biwgZmlyc3RfdW5jaGFuZ2VkX2F0X2VuZF92cG9z LCBkdnBvcywgVFJZX1dJTkRPV19JRCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK IAkgIEZSQU1FX1JJRiAoZiktPnNjcm9sbF9ydW5faG9vayAodywgJnJ1bik7CiAJICBndWlfdXBk YXRlX3dpbmRvd19lbmQgKHcsIGZhbHNlLCBmYWxzZSk7CiAjZW5kaWYKQEAgLTIxNTI4LDYgKzI2 NDg1LDE3IEBAIG1heWJlX3Byb2R1Y2VfbGluZV9udW1iZXIgKHN0cnVjdCBpdCAqaXQpCiAgICAg ICBTRVRfVEVYVF9QT1MgKHRlbV9pdC5wb3NpdGlvbiwgLTEsIC0xKTsKICAgICAgIFBST0RVQ0Vf R0xZUEhTICgmdGVtX2l0KTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJ UExFLUNVUlNPUlMgKi8KKworICAgICAgLyogVGhpcyBwZXJtaXRzIHVzIHRvIGluc3BlY3QgdGhl IEhQT1Mgb2YgbGluZSBudW1iZXIgZ2x5cGhzIGFuZCB0aGUgc3BhY2UKKyAgICAgIHBhZGRpbmcg YmVmb3JlL2FmdGVyIHRoZSBsaW5lIG51bWJlcnMuICBXZSBzZXQgYGdseXBoLT5ocG9zYCBlbHNl d2hlcmUuICovCisgICAgICB0ZW1faXQuaHBvcyArPSAxOworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKworCiAgICAgICAvKiBTdG9wIHByb2R1Y2luZyBnbHlwaHMsIGFuZCByZWZyYWluIGZy b20gcHJvZHVjaW5nIHRoZSBsaW5lCiAJIG51bWJlciwgaWYgd2UgZG9uJ3QgaGF2ZSBlbm91Z2gg c3BhY2Ugb24gdGhpcyBsaW5lLiAgKi8KICAgICAgIGlmICh0ZW1faXQuY3VycmVudF94ID49IHdp ZHRoX2xpbWl0KQpAQCAtMjE1MzksNiArMjY1MDcsMjggQEAgbWF5YmVfcHJvZHVjZV9saW5lX251 bWJlciAoc3RydWN0IGl0ICppdCkKIAl9CiAgICAgfQogCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVG RkVSIChpdC0+dy0+Y29udGVudHMpOworICBzdHJ1Y3QgYnVmZmVyICpvbGRfYnVmZmVyID0gTlVM TDsKKyAgLyogTmVlZGVkIHNvIHRoYXQgYnVmZmVyLWxvY2FsIHZhbHVlcyBjYW4gYmUgZGV0ZXJt aW5lZDsgZS5nLiwgd2hlbiBzd2l0Y2hpbmcKKyAgdG8gdGhlIG1pbmlidWZmZXIuICovCisgIGlm IChiICE9IGN1cnJlbnRfYnVmZmVyKQorICAgIHsKKyAgICAgIG9sZF9idWZmZXIgPSBjdXJyZW50 X2J1ZmZlcjsKKyAgICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKGIpOworICAgIH0KKyAgaXQtPnct Pm1jLmxudW1fcGl4ZWxfd2lkdGggPSAoIU5JTFAgKFZkaXNwbGF5X2xpbmVfbnVtYmVycykpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyB0ZW1faXQuY3VycmVudF94CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiAwOworICBpZiAob2xkX2J1ZmZlcikKKyAgICBzZXRf YnVmZmVyX2ludGVybmFsIChvbGRfYnVmZmVyKTsKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogICAvKiBSZWNvcmQgdGhlIHdpZHRoIGluIHBpeGVscyB3ZSBuZWVkIGZvciB0aGUgbGlu ZSBudW1iZXIgZGlzcGxheS4gICovCiAgIGl0LT5sbnVtX3BpeGVsX3dpZHRoID0gdGVtX2l0LmN1 cnJlbnRfeDsKICAgLyogQ29weSB0aGUgcHJvZHVjZWQgZ2x5cGhzIGludG8gSVQncyBnbHlwaF9y b3cuICAqLwpAQCAtMjczNjAsNiArMzIzNTAsMTcgQEAgYXBwZW5kX2dseXBoIChzdHJ1Y3QgaXQg Kml0KQogCSAgICBnWzFdID0gKmc7CiAJICBnbHlwaCA9IGl0LT5nbHlwaF9yb3ctPmdseXBoc1th cmVhXTsKIAl9CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJT T1JTICovCisKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBnbHlwaC0+Ynl0 ZXBvcyA9IElUX0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK ICAgICAgIGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKICAgICAgIGds eXBoLT5vYmplY3QgPSBpdC0+b2JqZWN0OwogICAgICAgaWYgKGl0LT5waXhlbF93aWR0aCA+IDAp CkBAIC0yNzQ0Miw2ICszMjQ0MywxNyBAQCBhcHBlbmRfY29tcG9zaXRlX2dseXBoIChzdHJ1Y3Qg aXQgKml0KQogCSAgICBnWzFdID0gKmc7CiAJICBnbHlwaCA9IGl0LT5nbHlwaF9yb3ctPmdseXBo c1tpdC0+YXJlYV07CiAJfQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQ TEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5 cGgtPmJ5dGVwb3MgPSBJVF9CWVRFUE9TICgqaXQpOworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKworCiAgICAgICBnbHlwaC0+Y2hhcnBvcyA9IGl0LT5jbXBfaXQuY2hhcnBvczsKICAgICAg IGdseXBoLT5vYmplY3QgPSBpdC0+b2JqZWN0OwogICAgICAgZWFzc2VydCAoaXQtPnBpeGVsX3dp ZHRoIDw9IFNIUlRfTUFYKTsKQEAgLTI3NjUwLDYgKzMyNjYyLDE3IEBAIHByb2R1Y2VfaW1hZ2Vf Z2x5cGggKHN0cnVjdCBpdCAqaXQpCiAJfQogICAgICAgaWYgKGdseXBoIDwgaXQtPmdseXBoX3Jv dy0+Z2x5cGhzW2FyZWEgKyAxXSkKIAl7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisv KiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7Cisg ICAgICBnbHlwaC0+Ynl0ZXBvcyA9IElUX0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKIAkgIGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9u KTsKIAkgIGdseXBoLT5vYmplY3QgPSBpdC0+b2JqZWN0OwogCSAgZ2x5cGgtPnBpeGVsX3dpZHRo ID0gY2xpcF90b19ib3VuZHMgKC0xLCBpdC0+cGl4ZWxfd2lkdGgsIFNIUlRfTUFYKTsKQEAgLTI3 NzUzLDYgKzMyNzc2LDE3IEBAIHByb2R1Y2VfeHdpZGdldF9nbHlwaCAoc3RydWN0IGl0ICppdCkK IAl9CiAgICAgICBpZiAoZ2x5cGggPCBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJlYSArIDFdKQog CXsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8K KworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBoLT5ieXRlcG9zID0g SVRfQllURVBPUyAoKml0KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgZ2x5 cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9zaXRpb24pOwogCSAgZ2x5cGgtPm9iamVjdCA9 IGl0LT5vYmplY3Q7CiAJICBnbHlwaC0+cGl4ZWxfd2lkdGggPSBjbGlwX3RvX2JvdW5kcyAoLTEs IGl0LT5waXhlbF93aWR0aCwgU0hSVF9NQVgpOwpAQCAtMjc4MzksNiArMzI4NzMsMTcgQEAgYXBw ZW5kX3N0cmV0Y2hfZ2x5cGggKHN0cnVjdCBpdCAqaXQsIExpc3BfT2JqZWN0IG9iamVjdCwKIAkg ICAgd2lkdGggLT0gaXQtPmZpcnN0X3Zpc2libGVfeCAtIGl0LT5jdXJyZW50X3g7CiAJICBlYXNz ZXJ0ICh3aWR0aCA+IDApOwogCX0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1V TFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAg IGdseXBoLT5ieXRlcG9zID0gSVRfQllURVBPUyAoKml0KTsKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogICAgICAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9zaXRpb24p OwogICAgICAgZ2x5cGgtPm9iamVjdCA9IG9iamVjdDsKICAgICAgIC8qIEZJWE1FOiBJdCB3b3Vs ZCBiZSBiZXR0ZXIgdG8gdXNlIFRZUEVfTUFYIGhlcmUsIGJ1dApAQCAtMjgyOTMsNiArMzMzMzgs MTcgQEAgYXBwZW5kX2dseXBobGVzc19nbHlwaCAoc3RydWN0IGl0ICppdCwgaW50IGZhY2VfaWQs IGJvb2wgZm9yX25vX2ZvbnQsIGludCBsZW4sCiAJICAgIGdbMV0gPSAqZzsKIAkgIGdseXBoID0g aXQtPmdseXBoX3Jvdy0+Z2x5cGhzW2FyZWFdOwogCX0KKworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+ aHBvczsKKyAgICAgIGdseXBoLT5ieXRlcG9zID0gSVRfQllURVBPUyAoKml0KTsKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogICAgICAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChp dC0+cG9zaXRpb24pOwogICAgICAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAgICAgICBl YXNzZXJ0IChpdC0+cGl4ZWxfd2lkdGggPD0gU0hSVF9NQVgpOwpAQCAtMjkzNDMsMTAgKzM0Mzk5 LDIwIEBAIGd1aV9pbnNlcnRfZ2x5cGhzIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhf cm93ICp1cGRhdGVkX3JvdywKIAogICAvKiBXcml0ZSB0aGUgZ2x5cGhzLiAgKi8KICAgaHBvcyA9 IHN0YXJ0IC0gcm93LT5nbHlwaHNbdXBkYXRlZF9hcmVhXTsKKworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBpZiAoIW1jX3JlZHJhd19yb3cg KHcsIHctPmN1cnJlbnRfbWF0cml4LCByb3csIHVwZGF0ZWRfYXJlYSwgdy0+b3V0cHV0X2N1cnNv ci54LAorICAgICAgICAgICAgICAgICAgICAgIGhwb3MsIGhwb3MgKyBsZW4sIGZhbHNlLCBEUkFX X05PUk1BTF9URVhULCBHVUlfSU5TRVJUX0dMWVBIUykpCiAgIGRyYXdfZ2x5cGhzICh3LCB3LT5v dXRwdXRfY3Vyc29yLngsIHJvdywgdXBkYXRlZF9hcmVhLAogCSAgICAgICBocG9zLCBocG9zICsg bGVuLAogCSAgICAgICBEUkFXX05PUk1BTF9URVhULCAwKTsKIAorLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogICAvKiBBZHZhbmNlIHRoZSBvdXRwdXQgY3Vyc29yLiAgKi8KICAgdy0+b3V0 cHV0X2N1cnNvci5ocG9zICs9IGxlbjsKICAgdy0+b3V0cHV0X2N1cnNvci54ICs9IHNoaWZ0X2J5 X3dpZHRoOwpAQCAtMjk3NzIsOSArMzQ4MzgsMTkgQEAgZ3VpX2ZpeF9vdmVybGFwcGluZ19hcmVh IChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCiAJICB3aGlsZSAoaSA8 IHJvdy0+dXNlZFthcmVhXQogCQkgJiYgcm93LT5nbHlwaHNbYXJlYV1baV0ub3ZlcmxhcHNfdmVy dGljYWxseV9wKTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKworICAgICAgaWYgKCFtY19yZWRyYXdfcm93ICh3LCB3LT5jdXJyZW50X21hdHJp eCwgcm93LCBhcmVhLCBzdGFydF94LCBzdGFydCwgaSwKKyAgICAgICAgICBmYWxzZSwgRFJBV19O T1JNQUxfVEVYVCwgR1VJX0ZJWF9PVkVSTEFQUElOR19BUkVBKSkKIAkgIGRyYXdfZ2x5cGhzICh3 LCBzdGFydF94LCByb3csIGFyZWEsCiAJCSAgICAgICBzdGFydCwgaSwKIAkJICAgICAgIERSQVdf Tk9STUFMX1RFWFQsIG92ZXJsYXBzKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog CX0KICAgICAgIGVsc2UKIAl7CkBAIC0zMDAyNSwxMCArMzUxMDEsMTcgQEAgZGlzcGxheV9hbmRf c2V0X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBvbiwKICAgbmV3X2N1cnNvcl90eXBl ID0gZ2V0X3dpbmRvd19jdXJzb3JfdHlwZSAodywgZ2x5cGgsCiAJCQkJCSAgICAmbmV3X2N1cnNv cl93aWR0aCwgJmFjdGl2ZV9jdXJzb3IpOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUtQ1VSU09SUyAqLworCiAgIC8qIElmIGN1cnNvciBpcyBjdXJyZW50bHkgYmVp bmcgc2hvd24gYW5kIHdlIGRvbid0IHdhbnQgaXQgdG8gYmUgb3IKICAgICAgaXQgaXMgaW4gdGhl IHdyb25nIHBsYWNlLCBvciB0aGUgY3Vyc29yIHR5cGUgaXMgbm90IHdoYXQgd2Ugd2FudCwKICAg ICAgZXJhc2UgaXQuICAqLwogICBpZiAody0+cGh5c19jdXJzb3Jfb25fcAorICAgICAgJiYgTklM UCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICYmIE5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpCisgICAgICAmJiBO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQogICAgICAgJiYgKCFv bgogCSAgfHwgdy0+cGh5c19jdXJzb3IueCAhPSB4CiAJICB8fCB3LT5waHlzX2N1cnNvci55ICE9 IHkKQEAgLTMwMDQxLDYgKzM1MTI0LDkgQEAgZGlzcGxheV9hbmRfc2V0X2N1cnNvciAoc3RydWN0 IHdpbmRvdyAqdywgYm9vbCBvbiwKIAkgICAgICAmJiBuZXdfY3Vyc29yX3dpZHRoICE9IHctPnBo eXNfY3Vyc29yX3dpZHRoKSkpCiAgICAgZXJhc2VfcGh5c19jdXJzb3IgKHcpOwogCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKworCiAgIC8qIERvbid0IGNoZWNrIHBoeXNfY3Vyc29yX29uX3Ag aGVyZSBiZWNhdXNlIHRoYXQgZmxhZyBpcyBvbmx5IHNldAogICAgICB0byBmYWxzZSBpbiBzb21l IGNhc2VzIHdoZXJlIHdlIGtub3cgdGhhdCB0aGUgY3Vyc29yIGhhcyBiZWVuCiAgICAgIGNvbXBs ZXRlbHkgZXJhc2VkLCB0byBhdm9pZCB0aGUgZXh0cmEgd29yayBvZiBlcmFzaW5nIHRoZSBjdXJz b3IKQEAgLTMwMDU5LDkgKzM1MTQ1LDIwIEBAIGRpc3BsYXlfYW5kX3NldF9jdXJzb3IgKHN0cnVj dCB3aW5kb3cgKncsIGJvb2wgb24sCiAgICAgICB3LT5waHlzX2N1cnNvci52cG9zID0gdnBvczsK ICAgICB9CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JT ICovCisKKyAgaWYgKE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWly cykpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2li bGUpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25m KSkpCiAgIEZSQU1FX1JJRiAoZiktPmRyYXdfd2luZG93X2N1cnNvciAodywgZ2x5cGhfcm93LCB4 LCB5LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19jdXJzb3JfdHlw ZSwgbmV3X2N1cnNvcl93aWR0aCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBvbiwgYWN0aXZlX2N1cnNvcik7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIH0K IAogCkBAIC0zMDE1NCw3ICszNTI1MSwxOCBAQCBkcmF3X3Jvd193aXRoX21vdXNlX2ZhY2UgKHN0 cnVjdCB3aW5kb3cgKncsIGludCBzdGFydF94LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCiAjaWZk ZWYgSEFWRV9XSU5ET1dfU1lTVEVNCiAgIGlmIChGUkFNRV9XSU5ET1dfUCAoWEZSQU1FICh3LT5m cmFtZSkpKQogICAgIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExF LUNVUlNPUlMgKi8KKworICAgICAgaWYgKCFtY19yZWRyYXdfcm93ICh3LCB3LT5jdXJyZW50X21h dHJpeCwgcm93LCBURVhUX0FSRUEsIHN0YXJ0X3gsCisgICAgICAgICAgICAgICAgICAgICAgICAg IHN0YXJ0X2hwb3MsIGVuZF9ocG9zLCBmYWxzZSwgZHJhdywgRFJBV19ST1dfV0lUSF9NT1VTRV9G QUNFKSkKICAgICAgIGRyYXdfZ2x5cGhzICh3LCBzdGFydF94LCByb3csIFRFWFRfQVJFQSwgc3Rh cnRfaHBvcywgZW5kX2hwb3MsIGRyYXcsIDApOworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiAgICAgICByZXR1cm47CiAgICAgfQogI2VuZGlmCkBAIC0zMjIxNCwxMSArMzczMjIsMjMg QEAgZXhwb3NlX2FyZWEgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywg Y29uc3QgRW1hY3NfUmVjdGFuZ2xlICpyLAogICBzdHJ1Y3QgZ2x5cGggKmxhc3Q7CiAgIGludCBm aXJzdF94LCBzdGFydF94LCB4OwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCiAgIGlmIChhcmVhID09IFRFWFRfQVJFQSAmJiByb3ctPmZpbGxf bGluZV9wKQorICAgIHsKKyAgICAgIGlmICghbWNfcmVkcmF3X3JvdyAodywgdy0+Y3VycmVudF9t YXRyaXgsIHJvdywgYXJlYSwgMCwgMCwgcm93LT51c2VkW2FyZWFdLAorICAgICAgICAgICAgICAg ICAgICAgICAgICBmYWxzZSwgRFJBV19OT1JNQUxfVEVYVCwgRVhQT1NFX0FSRUFfT05FKSkKICAg ICAvKiBJZiByb3cgZXh0ZW5kcyBmYWNlIHRvIGVuZCBvZiBsaW5lIHdyaXRlIHRoZSB3aG9sZSBs aW5lLiAgKi8KICAgICBkcmF3X2dseXBocyAodywgMCwgcm93LCBhcmVhLAogCQkgMCwgcm93LT51 c2VkW2FyZWFdLAogCQkgRFJBV19OT1JNQUxfVEVYVCwgMCk7CisgICAgfQorCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAgIGVsc2UKICAgICB7CiAgICAgICAvKiBTZXQgU1RBUlRfWCB0 byB0aGUgd2luZG93LXJlbGF0aXZlIHN0YXJ0IHBvc2l0aW9uIGZvciBkcmF3aW5nIGdseXBocyBv ZgpAQCAtMzIyNTAsMTEgKzM3MzcwLDIzIEBAIGV4cG9zZV9hcmVhIChzdHJ1Y3Qgd2luZG93ICp3 LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGNvbnN0IEVtYWNzX1JlY3RhbmdsZSAqciwKIAkgICsr bGFzdDsKIAl9CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJT T1JTICovCisKICAgICAgIC8qIFJlcGFpbnQuICAqLwotICAgICAgaWYgKGxhc3QgPiBmaXJzdCkK KyAgICAgIC8qIEZsb2F0aW5nIGZha2UgY3Vyc29ycyB3aWxsIGV4aXN0IHdoZW4gKGxhc3QgPT0g Zmlyc3QpLiAqLworICAgICAgaWYgKCFtY19yZWRyYXdfcm93ICh3LCB3LT5jdXJyZW50X21hdHJp eCwgcm93LCBhcmVhLCBmaXJzdF94IC0gc3RhcnRfeCwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgZmlyc3QgLSByb3ctPmdseXBoc1thcmVhXSwgbGFzdCAtIHJvdy0+Z2x5cGhzW2FyZWFdLAor ICAgICAgICAgICAgICAgICAgICAgICAgICBmYWxzZSwgRFJBV19OT1JNQUxfVEVYVCwgRVhQT1NF X0FSRUFfVFdPKQorICAgICAgICAgICYmIGxhc3QgPiBmaXJzdCkKIAlkcmF3X2dseXBocyAodywg Zmlyc3RfeCAtIHN0YXJ0X3gsIHJvdywgYXJlYSwKIAkJICAgICBmaXJzdCAtIHJvdy0+Z2x5cGhz W2FyZWFdLCBsYXN0IC0gcm93LT5nbHlwaHNbYXJlYV0sCiAJCSAgICAgRFJBV19OT1JNQUxfVEVY VCwgMCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICB9CiB9CiAKQEAgLTMy MjY4LDEwICszNzQwMCwyMiBAQCBleHBvc2VfbGluZSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0 IGdseXBoX3JvdyAqcm93LCBjb25zdCBFbWFjc19SZWN0YW5nbGUgKnIpCiB7CiAgIGVhc3NlcnQg KHJvdy0+ZW5hYmxlZF9wKTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJ UExFLUNVUlNPUlMgKi8KKwogICBpZiAocm93LT5tb2RlX2xpbmVfcCB8fCB3LT5wc2V1ZG9fd2lu ZG93X3ApCisgICAgeworICAgICAgaWYgKCFtY19yZWRyYXdfcm93ICh3LCB3LT5jdXJyZW50X21h dHJpeCwgcm93LCBURVhUX0FSRUEsIDAsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHJv dy0+dXNlZFtURVhUX0FSRUFdLCBmYWxzZSwgRFJBV19OT1JNQUxfVEVYVCwgRVhQT1NFX0xJTkUp KQogICAgIGRyYXdfZ2x5cGhzICh3LCAwLCByb3csIFRFWFRfQVJFQSwKIAkJIDAsIHJvdy0+dXNl ZFtURVhUX0FSRUFdLAogCQkgRFJBV19OT1JNQUxfVEVYVCwgMCk7CisgICAgfQorCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKworCiAgIGVsc2UKICAgICB7CiAgICAgICBpZiAocm93LT51c2Vk W0xFRlRfTUFSR0lOX0FSRUFdKQpAQCAtMzI4MTksNiArMzc5NjMsMjIgQEAgZ3VpX2ludGVyc2Vj dF9yZWN0YW5nbGVzIChjb25zdCBFbWFjc19SZWN0YW5nbGUgKnIxLCBjb25zdCBFbWFjc19SZWN0 YW5nbGUgKnIyLAogdm9pZAogc3ltc19vZl94ZGlzcCAodm9pZCkKIHsKKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBkZWZzdWJyICgmU21j X2R1bXBfZ2x5cGhfcm93KTsKKworICBkZWZzdWJyICgmU21jX2R1bXBfZ2x5cGhfbWF0cml4KTsK KworICBkZWZzdWJyICgmU21jX2N1cnJlbnRfY29sdW1uKTsKKworICBkZWZzdWJyICgmU21jX3N0 ZGVycik7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgVndpdGhfZWNob19hcmVh X3NhdmVfdmVjdG9yID0gUW5pbDsKICAgc3RhdGljcHJvICgmVndpdGhfZWNob19hcmVhX3NhdmVf dmVjdG9yKTsKIApkaWZmIC0tZ2l0IGEvc3JjL3h0ZXJtLmMgYi9zcmMveHRlcm0uYwppbmRleCBj OTZhYTc0Li43ZjhmMWEwIDEwMDY0NAotLS0gYS9zcmMveHRlcm0uYworKysgYi9zcmMveHRlcm0u YwpAQCAtMTMyLDYgKzEzMiw5MDQgQEAgYWxvbmcgd2l0aCBHTlUgRW1hY3MuICBJZiBub3QsIHNl ZSA8aHR0cHM6Ly93d3cuZ251Lm9yZy9saWNlbnNlcy8+LiAgKi8KICNpbmNsdWRlIDxYMTEvWEtC bGliLmg+CiAjZW5kaWYKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1V TFRJUExFLUNVUlNPUlMgKi8KKworI2lmZGVmIEdMWVBIX0RFQlVHCitzdGF0aWMgdm9pZCB4X2No ZWNrX2ZvbnQgKHN0cnVjdCBmcmFtZSAqLCBzdHJ1Y3QgZm9udCAqKTsKKyNlbmRpZgorCitzdGF0 aWMgdm9pZCB4X3NldF9tb2RlX2xpbmVfZmFjZV9nYyAoc3RydWN0IGdseXBoX3N0cmluZyAqKTsK Kworc3RhdGljIHZvaWQgeF9zZXRfbW91c2VfZmFjZV9nYyAoc3RydWN0IGdseXBoX3N0cmluZyAq KTsKKworc3RhdGljIHZvaWQgeF9jbGlwX3RvX3JvdyAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3Qg Z2x5cGhfcm93ICosIGVudW0gZ2x5cGhfcm93X2FyZWEsIEdDKTsKKworc3RhdGljIHZvaWQgeF9k cmF3X3JlY3RhbmdsZSAoc3RydWN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ICAgICYmICFjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCkKKyAgICAgICAgeGdjdi5iYWNrZ3Jv dW5kID0geGdjdi5mb3JlZ3JvdW5kID0gZmFjZS0+Zm9yZWdyb3VuZDsKKyAgICAgIGVsc2UKKyAg ICAgICAgeGdjdi5iYWNrZ3JvdW5kID0geGdjdi5mb3JlZ3JvdW5kID0gZi0+b3V0cHV0X2RhdGEu eC0+Y3Vyc29yX3BpeGVsOworICAgICAgeGdjdi5ncmFwaGljc19leHBvc3VyZXMgPSBGYWxzZTsK KyAgICAgIGlmIChnYykKKyAgICAgICAgWENoYW5nZUdDIChkcHksIGdjLCBtYXNrLCAmeGdjdik7 CisgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICBnYyA9IFhDcmVhdGVHQyAoZHB5LCB3 aW5kb3csIG1hc2ssICZ4Z2N2KTsKKyAgICAgICAgICBGUkFNRV9ESVNQTEFZX0lORk8gKGYpLT5z Y3JhdGNoX2N1cnNvcl9nYyA9IGdjOworICAgICAgICB9CisgICAgICB4X2NsaXBfdG9fcm93ICh3 LCByb3csIFRFWFRfQVJFQSwgZ2MpOworICAgICAgeF9maWxsX3JlY3RhbmdsZSAoZiwgZ2MsIGZ4 LCBmeSwgd2QsIGgpOworICAgICAgeF9yZXNldF9jbGlwX3JlY3RhbmdsZXMgKGYsIGdjKTsKKyAg ICB9Cit9CisKKy8qIFJJRjogRHJhdyBjdXJzb3Igb24gd2luZG93IFcuICovCitzdGF0aWMgdm9p ZAorbWNfeF9kcmF3X3dpbmRvd19jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlw aF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAgICAg ICAgICAgICAgIGludCB4LCBpbnQgZngsIGludCB5LCBpbnQgZnksIGludCBocG9zLCBpbnQgdnBv cywgaW50IHdkLAorICAgICAgICAgICAgICAgICAgICAgICAgIGludCBoLCBzdHJ1Y3QgbWNfUkdC IGxzbCwgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAg ICAgICAgICBpbnQgY3Vyc29yX3dpZHRoLCBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IsIGJv b2wgb25fcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGFjdGl2ZV9wKQoreworICBz dHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworICAvKiBUaGUgZnJp bmdlIGJpdG1hcHMgYXJlIHByZXNlbnRseSBoYW5kbGVkIGVsc2V3aGVyZSwgYnV0IGNvdWxkIHNv bWVkYXkKKyAgYmUgbWFuYWdlZCAoaW4gcGFydCkgYXQgdGhpcyBzZWN0aW9uIG9mIGNvZGUuICov CisgIGlmIChvbl9wKQorICAgIHsKKyAgICAgIGlmIChyb3ctPmV4YWN0X3dpbmRvd193aWR0aF9s aW5lX3AKKyAgICAgICAgICAmJiAocm93LT5yZXZlcnNlZF9wCisgICAgICAgICAgICAgID8gKGhw b3MgPCAwKQorICAgICAgICAgICAgICA6IChocG9zID49IHJvdy0+dXNlZFtURVhUX0FSRUFdKSkp CisgICAgICAgIHsKKyAgICAgICAgICByb3ctPmN1cnNvcl9pbl9mcmluZ2VfcCA9IHRydWU7Cisg ICAgICAgICAgbWNfZHJhd19mcmluZ2VfYml0bWFwICh3LCByb3csIHJvdy0+cmV2ZXJzZWRfcCwg Y3Vyc29yX3R5cGUpOworICAgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIHsKKyAgQ29sb3Jt YXAgY21hcCA9IEZSQU1FX1hfQ09MT1JNQVAgKGYpOworICB1bnNpZ25lZCBsb25nIG9yaWdpbmFs X2N1cnNvcl9waXhlbCA9IGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbDsKKyAgLyogeHRl cm0uYy94dGVybS5oIHVzZSBHQzsgd2h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BvcywgdnBvcyk7CisgICAg ICBpZiAoY3Vyc29yX2dseXBoID09IE5VTEwpCisgICAgICAgIHJldHVybjsKKyAgICAgIHN0cnVj dCBidWZmZXIgKmIgPSBYQlVGRkVSICh3LT5jb250ZW50cyk7CisgICAgICBib29sIHJlZ2lvbl9h Y3RpdmVfcCA9ICghTklMUCAoVnRyYW5zaWVudF9tYXJrX21vZGUpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgbWFya19hY3RpdmUpKSk7CisgICAgICBw dHJkaWZmX3QgcmVnaW9uX2JlZyA9IChyZWdpb25fYWN0aXZlX3ApID8gbWNfcmVnaW9uX2xpbWl0 ICgxKSA6IC0xOworICAgICAgcHRyZGlmZl90IHJlZ2lvbl9lbmQgPSAocmVnaW9uX2FjdGl2ZV9w KSA/IG1jX3JlZ2lvbl9saW1pdCAoMCkgOiAtMTsKKyAgICAgIGlmIChjdXJzb3JfZ2x5cGgtPnR5 cGUgIT0gSU1BR0VfR0xZUEggJiYgbHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxz bC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sg YGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYycgYnkgYm9ycm93aW5nIHRoZQorICAgICAgICAg IGZ1bmN0aW9uYWxpdHkgb2YgYHhfbWFrZV9nYycgaW4geGZucy5jLiAqLworICAgICAgICAgIGlm IChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgJiYgYWN0aXZlX3AKKyAgICAgICAgICAg ICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID09IHJlZ2lvbl9iZWcpCisgICAgICAgICAgICB7 CisgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZWdfZmFj ZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlIC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LngtPmN1cnNvcl9nYywgaG9sbG93X2Fj dGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICB7 CisgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQg PSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXBy ZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9s bG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQp OworICAgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChm KSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVn cm91bmQpOworICAgICAgICAgICAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQ TEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfYWN0aXZlX2ZhY2Ut PmJhY2tncm91bmQpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgZWxz ZSBpZiAoIWFjdGl2ZV9wKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVk X2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1wcmUtenYt ZmFjZSIpLCB0cnVlKTsKKyAgICAgIC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fZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2Fj dGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1F X1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2 ZV9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQg KEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93 X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2UtPmJhY2tncm91bmQpOworICAgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgICAgICAgZWxzZSBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID4gcmVnaW9uX2JlZworICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zIDwgcmVnaW9uX2VuZCkKKyAgICAgICAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3df YWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwg aW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluLXJlZ2lvbi1wcmUtenYtZmFjZSIpLCB0cnVl KTsKKyAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9yZWdp b25fYmV0d2Vlbl9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9i ZXR3ZWVuX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xs b3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1y ZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAg ICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhv bGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91 bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9s bG93X2FjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgICAgICBYU2V0 QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29y X2djLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2UtPmZvcmVncm91bmQpOworICAg ICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGFjdGl2ZV9w KQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVudW0g ZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwg aW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAg ICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFjZSA9IEZBQ0Vf RlJPTV9JRCAoZiwgaG9sbG93X2FjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAg ICAgIFh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3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgICAgYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgICAgIC8qIEZv cmNlIGBtY194X3NldF9jdXJzb3JfZ2MnIHRvIHVzZSBgcy0+Zi0+b3V0cHV0X2RhdGEueC0+Y3Vy c29yX2djJy4gKi8KKyAgICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IHRydWU7CisgICAg ICAgICAgICAgIG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywgRFJBV19DVVJT T1IsIHgsIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBs c2wsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICAgICAgWFNl dEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNv cl9nYywgeGdjdi5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZS QU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgeGdjdi5iYWNr Z3JvdW5kKTsKKyAgICAgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAg LyogRHJhdyB0aGUgZnJhbWUgYXJvdW5kIHRoZSBib3guICovCisgICAgICAgICAgICAgIG1jX3hf ZHJhd19ob2xsb3dfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2 cG9zLCB3ZCwgaCk7CisgICAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2Fz ZSBNQ19IT0xMT1dfQk9YOgorICAgIHs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N1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3As IGN1cnNvcl9nY19wKTsKKyAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2Fz ZSBNQ19CQVI6CisgICAgeworICAgICAgaWYgKGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3JlZW4gPj0g MCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkg aGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwnLiAqLworICAgICAgICAgIGYt Pm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IGNvbG9yLnBpeGVsOworICAgICAgICAgIGJv b2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSB0cnVlOworICAgICAgICAgIG1jX3hfZHJh d19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3 ZCwgaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoLCBNQ19C QVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0 YS54LT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgIH0KKyAg ICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlz aWJsZV9va2F5X3AgPSBmYWxzZTsKKyAgICAgICAgICAgIG1jX3hfZHJhd19iYXJfY3Vyc29yICh3 LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0JBUiwgY3Vyc29yX2dj X2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAg ICBjYXNlIE1DX0hCQVI6CisgICAgeworICAgICAgaWYgKGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3Jl ZW4gPj0gMCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9y YXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwnLiAqLworICAgICAg ICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IGNvbG9yLnBpeGVsOworICAgICAg ICAgIGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSB0cnVlOworICAgICAgICAgIG1j X3hfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2 cG9zLCB3ZCwgaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRo LCBNQ19IQkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgZi0+b3V0 cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAg ICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBib29sIGN1cnNvcl9n Y19pbnZpc2libGVfb2theV9wID0gZmFsc2U7CisgICAgICAgICAgICBtY194X2RyYXdfYmFyX2N1 cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaCwgY3Vyc29yX3dpZHRoLCBNQ19IQkFSLCBj dXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7Cisg ICAgfQorICAgIGRlZ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CisgICAgICAgICAg ICAgIGJhY2tncm91bmRfd2lkdGggLT0gbGVmdF94IC0geDsKKyAgICAgICAgICAgICAgeCA9IGxl ZnRfeDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAg eworICAgICAgICAgICAgLyogSW4gUjJMIHJvd3MsIGRyYXcgdGhlIGN1cnNvciBvbiB0aGUgcmln aHQgZWRnZSBvZiB0aGUKKyAgICAgICAgICAgICAgIHN0cmV0Y2ggZ2x5cGguICovCisgICAgICAg ICAgICBpbnQgcmlnaHRfeCA9IHdpbmRvd19ib3hfcmlnaHQgKHMtPncsIFRFWFRfQVJFQSk7Cisg ICAgICAgICAgICBpZiAoeCArIGJhY2tncm91bmRfd2lkdGggPiByaWdodF94KQorICAgICAgICAg ICAgICBiYWNrZ3JvdW5kX3dpZHRoIC09IHggLSByaWdodF94OworICAgICAgICAgICAgeCArPSBi YWNrZ3JvdW5kX3dpZHRoOworICAgICAgICAgIH0KKyAgICAgIHdpZHRoID0gbWluIChGUkFNRV9D T0xVTU5fV0lEVEggKHMtPmYpLCBiYWNrZ3JvdW5kX3dpZHRoKTsKKyAgICAgIGlmIChzLT5yb3ct PnJldmVyc2VkX3ApCisgICAgICAgIHggLT0gd2lkdGg7CisgICAgICAvKiBEcmF3IGN1cnNvci4g Ki8KKyAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmdfcmVjdCAocywgeCwgcy0+eSwgd2lkdGgs IHMtPmhlaWdodCk7CisgICAgICAvKiBDbGVhciByZXN0IHVzaW5nIHRoZSBHQyBvZiB0aGUgb3Jp Z2luYWwgbm9uLWN1cnNvciBmYWNlLiAqLworICAgICAgaWYgKHdpZHRoIDwgYmFja2dyb3VuZF93 aWR0aCkKKyAgICAgICAgeworICAgICAgICAgIGludCB5ID0gcy0+eTsKKyAgICAgICAgICBpbnQg dyA9IGJhY2tncm91bmRfd2lkdGggLSB3aWR0aCwgaCA9IHMtPmhlaWdodDsKKyAgICAgICAgICBY UmVjdGFuZ2xlIHI7CisgICAgICAgICAgR0MgZ2M7CisgICAgICAgICAgaWYgKCFzLT5yb3ctPnJl dmVyc2VkX3ApCisgICAgICAgICAgICB4ICs9IHdpZHRoOworICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgIHggPSBzLT54OworICAgICAgICAgIGlmIChzLT5yb3ctPm1vdXNlX2ZhY2VfcAorICAg ICAgICAgICAgICAmJiBjdXJzb3JfaW5fbW91c2VfZmFjZV9wIChzLT53KSkKKyAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgeF9zZXRfbW91c2VfZmFjZV9nYyAocyk7CisgICAgICAgICAgICAg IGdjID0gcy0+Z2M7CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAg Z2MgPSBzLT5mYWNlLT5nYzsKKyAgICAgICAgICBnZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAo cywgJnIpOworICAgICAgICAgIHhfc2V0X2NsaXBfcmVjdGFuZ2xlcyAocy0+ZiwgZ2MsICZyLCAx KTsKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+c3RpcHBsZSkKKyAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgLyogRmlsbCBiYWNrZ3JvdW5kIHdpdGggYSBzdGlwcGxlIHBhdHRlcm4uICovCisg ICAgICAgICAgICAgIFhTZXRGaWxsU3R5bGUgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIGdjLCBG aWxsT3BhcXVlU3RpcHBsZWQpOworICAgICAgICAgICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChzLT5m LCBnYywgeCwgeSwgdywgaCk7CisgICAgICAgICAgICAgIFhTZXRGaWxsU3R5bGUgKEZSQU1FX1hf RElTUExBWSAocy0+ZiksIGdjLCBGaWxsU29saWQpOworICAgICAgICAgICAgfQorICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgWEdDVmFsdWVzIHhnY3Y7CisgICAg ICAgICAgICAgIFhHZXRHQ1ZhbHVlcyAoRlJBTUVfWF9ESVNQTEFZIChzLT5mKSwgZ2MsIEdDRm9y ZWdyb3VuZCB8IEdDQmFja2dyb3VuZCwgJnhnY3YpOworICAgICAgICAgICAgICBYU2V0Rm9yZWdy b3VuZCAoRlJBTUVfWF9ESVNQTEFZIChzLT5mKSwgZ2MsIHhnY3YuYmFja2dyb3VuZCk7CisgICAg ICAgICAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIGdjLCB4LCB5LCB3LCBoKTsKKyAgICAg ICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIGdjLCB4Z2N2 LmZvcmVncm91bmQpOworICAgICAgICAgICAgfQorICAgICAgICAgIHhfcmVzZXRfY2xpcF9yZWN0 YW5nbGVzIChzLT5mLCBnYyk7CisgICAgICAgIH0KKyAgICB9CisgIGVsc2UgaWYgKCFzLT5iYWNr Z3JvdW5kX2ZpbGxlZF9wKQorICAgIHsKKyAgICAgIGludCBiYWNrZ3JvdW5kX3dpZHRoID0gcy0+ YmFja2dyb3VuZF93aWR0aDsKKyAgICAgIGludCB4ID0gcy0+eCwgbGVmdF94ID0gd2luZG93X2Jv eF9sZWZ0X29mZnNldCAocy0+dywgVEVYVF9BUkVBKTsKKyAgICAgIC8qIERvbid0IGRyYXcgaW50 byBsZWZ0IG1hcmdpbiwgZnJpbmdlIG9yIHNjcm9sbGJhciBhcmVhCisgICAgICAgICBleGNlcHQg Zm9yIGhlYWRlciBsaW5lIGFuZCBtb2RlIGxpbmUuICovCisgICAgICBpZiAoeCA8IGxlZnRfeCAm JiAhcy0+cm93LT5tb2RlX2xpbmVfcCkKKyAgICAgICAgeworICAgICAgICAgIGJhY2tncm91bmRf d2lkdGggLT0gbGVmdF94IC0geDsKKyAgICAgICAgICB4ID0gbGVmdF94OworICAgICAgICB9Cisg ICAgICBpZiAoYmFja2dyb3VuZF93aWR0aCA+IDApCisgIC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CisgICAgICBicmVhazsKKyAgICBj YXNlIEdMWVBITEVTU19HTFlQSDoKKyAgICAgIGlmIChzLT5mb3Jfb3ZlcmxhcHMpCisgICAgICAg IHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVlOworICAgICAgZWxzZQorICAgICAgICB4X2Ry YXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKHMsIHRydWUpOworICAgICAgeF9kcmF3X2dseXBo bGVzc19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAgICBicmVhazsKKyAgICBkZWZh dWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7CisgICAgfQorICBpZiAoIXMtPmZvcl9vdmVybGFw cykKKyAgICB7CisgICAgICAvKiBEcmF3IHVuZGVybGluZS4gKi8KKyAgICAgIGlmIChzLT5mYWNl LT51bmRlcmxpbmVfcCkKKyAgICAgICAgeworICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxp bmVfdHlwZSA9PSBGQUNFX1VOREVSX1dBVkUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAg IGlmIChzLT5mYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICAgICAgeF9k cmF3X3VuZGVyd2F2ZSAocyk7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7 CisgICAgICAgICAgICAgICAgICBYR0NWYWx1ZXMgeGdjdjsKKyAgICAgICAgICAgICAgICAgIFhH ZXRHQ1ZhbHVlcyAoRlJBTUVfWF9ESVNQTEFZIChzLT5mKSwgcy0+Z2MsIEdDRm9yZWdyb3VuZCwg JnhnY3YpOworICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExB WSAocy0+ZiksIHMtPmdjLCBzLT5mYWNlLT51bmRlcmxpbmVfY29sb3IpOworICAgICAgICAgICAg ICAgICAgeF9kcmF3X3VuZGVyd2F2ZSAocyk7CisgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdy b3VuZCAoRlJBTUVfWF9ESVNQTEFZIChzLT5mKSwgcy0+Z2MsIHhnY3YuZm9yZWdyb3VuZCk7Cisg ICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKHMtPmZh Y2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgdW5zaWduZWQgbG9uZyB0aGlja25lc3MsIHBvc2l0aW9uOworICAgICAgICAg ICAgICBpbnQgeTsKKyAgICAgICAgICAgICAgaWYgKHMtPnByZXYgJiYgcy0+cHJldi0+ZmFjZS0+ dW5kZXJsaW5lX3AKKyAgICAgICAgICAgICAgICAgICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGlu ZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgICAvKiBXZSB1c2UgdGhlIHNhbWUgdW5kZXJsaW5lIHN0eWxlIGFzIHRoZSBwcmV2aW91 cyBvbmUuICovCisgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSBzLT5wcmV2LT51bmRlcmxp bmVfdGhpY2tuZXNzOworICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBzLT5wcmV2LT51bmRl cmxpbmVfcG9zaXRpb247CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlCisg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgLyogR2V0IHRoZSB1bmRlcmxpbmUg dGhpY2tuZXNzLiAgRGVmYXVsdCBpcyAxIHBpeGVsLiAqLworICAgICAgICAgICAgICAgICAgaWYg KHMtPmZvbnQgJiYgcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzcyA+IDApCisgICAgICAgICAg ICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPmZvbnQtPnVuZGVybGluZV90aGlja25lc3M7CisgICAg ICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IDE7Cisg ICAgICAgICAgICAgICAgICBpZiAoeF91bmRlcmxpbmVfYXRfZGVzY2VudF9saW5lKQorICAgICAg ICAgICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5oZWlnaHQgLSB0aGlja25lc3MpIC0gKHMtPnli YXNlIC0gcy0+eSk7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVybGluZSBwb3NpdGlvbi4g IFRoaXMgaXMgdGhlIHJlY29tbWVuZGVkCisgICAgICAgICAgICAgICAgICAgICAgICAgdmVydGlj YWwgb2Zmc2V0IGluIHBpeGVscyBmcm9tIHRoZSBiYXNlbGluZSB0byB0aGUgdG9wIG9mCisgICAg ICAgICAgICAgICAgICAgICAgICAgdGhlIHVuZGVybGluZS4gIFRoaXMgaXMgYSBzaWduZWQgdmFs dWUgYWNjb3JkaW5nIHRvIHRoZQorICAgICAgICAgICAgICAgICAgICAgICAgIHNwZWNzLCBhbmQg aXRzIGRlZmF1bHQgaXMKKyAgICAgICAgICAgICAgICAgICAgICAgICBST1VORCAoKG1heGltdW0g ZGVzY2VudCkgLyAyKSwgd2l0aAorICAgICAgICAgICAgICAgICAgICAgICAgIFJPVU5EKHgpID0g Zmxvb3IgKHggKyAwLjUpICAqLworICAgICAgICAgICAgICAgICAgICAgIGlmICh4X3VzZV91bmRl cmxpbmVfcG9zaXRpb25fcHJvcGVydGllcworICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBz LT5mb250ICYmIHMtPmZvbnQtPnVuZGVybGluZV9wb3NpdGlvbiA+PSAwKQorICAgICAgICAgICAg ICAgICAgICAgICAgcG9zaXRpb24gPSBzLT5mb250LT51bmRlcmxpbmVfcG9zaXRpb247CisgICAg ICAgICAgICAgICAgICAgICAgZWxzZSBpZiAocy0+Zm9udCkKKyAgICAgICAgICAgICAgICAgICAg ICAgIHBvc2l0aW9uID0gKHMtPmZvbnQtPmRlc2NlbnQgKyAxKSAvIDI7CisgICAgICAgICAgICAg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSB1bmRlcmxp bmVfbWluaW11bV9vZmZzZXQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAg ICAgIHBvc2l0aW9uID0gbWF4IChwb3NpdGlvbiwgdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0KTsK KyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIC8qIENoZWNrIHRoZSBzYW5pdHkgb2Yg dGhpY2tuZXNzIGFuZCBwb3NpdGlvbi4gIFdlIHNob3VsZAorICAgICAgICAgICAgICAgICBhdm9p ZCBkcmF3aW5nIHVuZGVybGluZSBvdXQgb2YgdGhlIGN1cnJlbnQgbGluZSBhcmVhLiAqLworICAg ICAgICAgICAgICBpZiAocy0+eSArIHMtPmhlaWdodCA8PSBzLT55YmFzZSArIHBvc2l0aW9uKQor ICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmhlaWdodCAtIDEpIC0gKHMtPnliYXNlIC0g cy0+eSk7CisgICAgICAgICAgICAgIGlmIChzLT55ICsgcy0+aGVpZ2h0IDwgcy0+eWJhc2UgKyBw b3NpdGlvbiArIHRoaWNrbmVzcykKKyAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAocy0+eSAr IHMtPmhlaWdodCkgLSAocy0+eWJhc2UgKyBwb3NpdGlvbik7CisgICAgICAgICAgICAgIHMtPnVu ZGVybGluZV90aGlja25lc3MgPSB0aGlja25lc3M7CisgICAgICAgICAgICAgIHMtPnVuZGVybGlu ZV9wb3NpdGlvbiA9IHBvc2l0aW9uOworICAgICAgICAgICAgICB5ID0gcy0+eWJhc2UgKyBwb3Np dGlvbjsKKyAgICAgICAgICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkK KyAgICAgICAgICAgICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChzLT5mLCBzLT5nYywgcy0+eCwgeSwg cy0+d2lkdGgsIHRoaWNrbmVzcyk7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgICBYR0NWYWx1ZXMgeGdjdjsKKyAgICAgICAgICAgICAgICAg IFhHZXRHQ1ZhbHVlcyAoRlJBTUVfWF9ESVNQTEFZIChzLT5mKSwgcy0+Z2MsIEdDRm9yZWdyb3Vu ZCwgJnhnY3YpOworICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElT UExBWSAocy0+ZiksIHMtPmdjLCBzLT5mYWNlLT51bmRlcmxpbmVfY29sb3IpOworICAgICAgICAg ICAgICAgICAgeF9maWxsX3JlY3RhbmdsZSAocy0+Ziwgcy0+Z2MsIHMtPngsIHksIHMtPndpZHRo LCB0aGlja25lc3MpOworICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hf RElTUExBWSAocy0+ZiksIHMtPmdjLCB4Z2N2LmZvcmVncm91bmQpOworICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgLyogRHJhdyBvdmVybGluZS4gKi8K KyAgICAgIGlmIChzLT5mYWNlLT5vdmVybGluZV9wKQorICAgICAgICB7CisgICAgICAgICAgdW5z aWduZWQgbG9uZyBkeSA9IDAsIGggPSAxOworICAgICAgICAgIGlmIChzLT5mYWNlLT5vdmVybGlu ZV9jb2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYs IHMtPmdjLCBzLT54LCBzLT55ICsgZHksIHMtPndpZHRoLCBoKTsKKyAgICAgICAgICBlbHNlCisg ICAgICAgICAgICB7CisgICAgICAgICAgICAgIFhHQ1ZhbHVlcyB4Z2N2OworICAgICAgICAgICAg ICBYR2V0R0NWYWx1ZXMgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMtPmdjLCBHQ0ZvcmVncm91 bmQsICZ4Z2N2KTsKKyAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExB WSAocy0+ZiksIHMtPmdjLCBzLT5mYWNlLT5vdmVybGluZV9jb2xvcik7CisgICAgICAgICAgICAg IHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCBzLT55ICsgZHksIHMtPndpZHRo LCBoKTsKKyAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAocy0+ ZiksIHMtPmdjLCB4Z2N2LmZvcmVncm91bmQpOworICAgICAgICAgICAgfQorICAgICAgICB9Cisg ICAgICAvKiBEcmF3IHN0cmlrZS10aHJvdWdoLiAqLworICAgICAgaWYgKHMtPmZhY2UtPnN0cmlr ZV90aHJvdWdoX3ApCisgICAgICAgIHsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIGggPSAxOwor ICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZHkgPSAocy0+aGVpZ2h0IC0gaCkgLyAyOworICAgICAg ICAgIGlmIChzLT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9jb2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAg ICAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCBzLT55ICsgZHksIHMt PndpZHRoLCBoKTsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAg IFhHQ1ZhbHVlcyB4Z2N2OworICAgICAgICAgICAgICBYR2V0R0NWYWx1ZXMgKEZSQU1FX1hfRElT UExBWSAocy0+ZiksIHMtPmdjLCBHQ0ZvcmVncm91bmQsICZ4Z2N2KTsKKyAgICAgICAgICAgICAg WFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMtPmdjLCBzLT5mYWNlLT5z dHJpa2VfdGhyb3VnaF9jb2xvcik7CisgICAgICAgICAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMt PmYsIHMtPmdjLCBzLT54LCBzLT55ICsgZHksIHMtPndpZHRoLCBoKTsKKyAgICAgICAgICAgICAg WFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMtPmdjLCB4Z2N2LmZvcmVn cm91bmQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAvKiBEcmF3IHJlbGllZiBp ZiBub3QgeWV0IGRyYXduLiAqLworICAgICAgaWYgKCFyZWxpZWZfZHJhd25fcCAmJiBzLT5mYWNl LT5ib3ggIT0gRkFDRV9OT19CT1gpCisgICAgICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19ib3gg KHMpOworICAgICAgaWYgKHMtPnByZXYpCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5 cGhfc3RyaW5nICpwcmV2OworICAgICAgICAgIGZvciAocHJldiA9IHMtPnByZXY7IHByZXY7IHBy ZXYgPSBwcmV2LT5wcmV2KQorICAgICAgICAgICAgaWYgKHByZXYtPmhsICE9IHMtPmhsCisgICAg ICAgICAgICAgICAgJiYgcHJldi0+eCArIHByZXYtPndpZHRoICsgcHJldi0+cmlnaHRfb3Zlcmhh bmcgPiBzLT54KQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogQXMgcHJldiB3 YXMgZHJhd24gd2hpbGUgY2xpcHBlZCB0byBpdHMgb3duIGFyZWEsIHdlCisgICAgICAgICAgICAg ICAgICAgbXVzdCBkcmF3IHRoZSByaWdodF9vdmVyaGFuZyBwYXJ0IHVzaW5nIHMtPmhsIG5vdy4g Ki8KKyAgICAgICAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2Ugc2F2ZSA9IHByZXYtPmhs OworICAgICAgICAgICAgICAgIHByZXYtPmhsID0gcy0+aGw7CisgICAgICAgICAgICAgICAgbWNf eF9zZXRfZ2x5cGhfc3RyaW5nX2djIChwcmV2LCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgICAg ICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nX2V4YWN0bHkgKHMsIHByZXYpOworICAgICAg ICAgICAgICAgIGlmIChwcmV2LT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBIKQorICAg ICAgICAgICAgICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChwcmV2KTsKKyAg ICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICB4X2RyYXdfY29tcG9zaXRlX2ds eXBoX3N0cmluZ19mb3JlZ3JvdW5kIChwcmV2KTsKKyAgICAgICAgICAgICAgICB4X3Jlc2V0X2Ns aXBfcmVjdGFuZ2xlcyAocHJldi0+ZiwgcHJldi0+Z2MpOworICAgICAgICAgICAgICAgIHByZXYt PmhsID0gc2F2ZTsKKyAgICAgICAgICAgICAgICBwcmV2LT5udW1fY2xpcHMgPSAwOworICAgICAg ICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGlmIChzLT5uZXh0KQorICAgICAgICB7CisgICAg ICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAqbmV4dDsKKyAgICAgICAgICBmb3IgKG5leHQgPSBz LT5uZXh0OyBuZXh0OyBuZXh0ID0gbmV4dC0+bmV4dCkKKyAgICAgICAgICAgIGlmIChuZXh0LT5o bCAhPSBzLT5obAorICAgICAgICAgICAgICAgICYmIG5leHQtPnggLSBuZXh0LT5sZWZ0X292ZXJo YW5nIDwgcy0+eCArIHMtPndpZHRoKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg LyogQXMgbmV4dCB3aWxsIGJlIGRyYXduIHdoaWxlIGNsaXBwZWQgdG8gaXRzIG93biBhcmVhLAor ICAgICAgICAgICAgICAgICAgIHdlIG11c3QgZHJhdyB0aGUgbGVmdF9vdmVyaGFuZyBwYXJ0IHVz aW5nIHMtPmhsIG5vdy4gKi8KKyAgICAgICAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2Ug c2F2ZSA9IG5leHQtPmhsOworICAgICAgICAgICAgICAgIG5leHQtPmhsID0gcy0+aGw7CisgICAg ICAgICAgICAgICAgbWNfeF9zZXRfZ2x5cGhfc3RyaW5nX2djIChuZXh0LCBjdXJzb3JfZ2NfcCk7 CisgICAgICAgICAgICAgICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nX2V4YWN0bHkgKHMs IG5leHQpOworICAgICAgICAgICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSA9PSBD SEFSX0dMWVBIKQorICAgICAgICAgICAgICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19mb3JlZ3Jv dW5kIChuZXh0KTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICB4X2Ry YXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChuZXh0KTsKKyAgICAgICAgICAg ICAgICB4X3Jlc2V0X2NsaXBfcmVjdGFuZ2xlcyAobmV4dC0+ZiwgbmV4dC0+Z2MpOworICAgICAg ICAgICAgICAgIG5leHQtPmhsID0gc2F2ZTsKKyAgICAgICAgICAgICAgICBuZXh0LT5udW1fY2xp cHMgPSAwOworICAgICAgICAgICAgICAgIG5leHQtPmNsaXBfaGVhZCA9IHMtPm5leHQ7CisgICAg ICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgLyogUmVzZXQgY2xpcHBpbmcuICovCisg IHhfcmVzZXRfY2xpcF9yZWN0YW5nbGVzIChzLT5mLCBzLT5nYyk7CisgIHMtPm51bV9jbGlwcyA9 IDA7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKworCiAvKiBEZWZhdWx0IHRvIHVzaW5nIFhJTSBpZiBhdmFpbGFibGUuICAqLwogI2lm ZGVmIFVTRV9YSU0KIGJvb2wgdXNlX3hpbSA9IHRydWU7CkBAIC0xMTA5LDYgKzIwMDcsMTYgQEAg c3RhdGljIHZvaWQKIHhfdXBkYXRlX2JlZ2luIChzdHJ1Y3QgZnJhbWUgKmYpCiB7CiAgIC8qIE5v dGhpbmcgdG8gZG8uICAqLworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQ TEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gZjsKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogfQogCiAvKiBEcmF3IGEgdmVydGljYWwgd2luZG93IGJvcmRl ciBmcm9tICh4LHkwKSB0byAoeCx5MSkgICovCkBAIC0xMjU0LDYgKzIxNjIsMTYgQEAgeF91cGRh dGVfZW5kIChzdHJ1Y3QgZnJhbWUgKmYpCiAgIFhGbHVzaCAoRlJBTUVfWF9ESVNQTEFZIChmKSk7 CiAgIHVuYmxvY2tfaW5wdXQgKCk7CiAjZW5kaWYKKworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGluZ19mcmFtZSA9IE5V TEw7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIH0KIAogLyogVGhpcyBmdW5jdGlv biBpcyBjYWxsZWQgZnJvbSB2YXJpb3VzIHBsYWNlcyBpbiB4ZGlzcC5jCkBAIC0xMzIzOCw2ICsx NDE1NiwyMCBAQCBleHRlcm4gZnJhbWVfcGFybV9oYW5kbGVyIHhfZnJhbWVfcGFybV9oYW5kbGVy c1tdOwogCiBzdGF0aWMgc3RydWN0IHJlZGlzcGxheV9pbnRlcmZhY2UgeF9yZWRpc3BsYXlfaW50 ZXJmYWNlID0KICAgeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUt Q1VSU09SUyAqLworCisvKiBgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYHh0ZXJtLmNgIG11c3Qg YmUgaW4gdGhlIGV4YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitgcmVkaXNwbGF5X2ludGVyZmFjZScg aW4gYGRpc3BleHRlcm4uaGAhICovCisKKyAgbWNfeF9kcmF3X3dpbmRvd19jdXJzb3IsCisgIG1j X3hfZHJhd19nbHlwaF9zdHJpbmcsCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAg ICB4X2ZyYW1lX3Bhcm1faGFuZGxlcnMsCiAgICAgZ3VpX3Byb2R1Y2VfZ2x5cGhzLAogICAgIGd1 aV93cml0ZV9nbHlwaHMsCg== --Multipart_Mon_Jul_22_23:01:18_2019-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs). References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Wed, 31 Jul 2019 19:40:02 +0000 Resent-Message-ID: <handler.22873.B22873.15646019955659 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22873 <at> debbugs.gnu.org,17684 <at> debbugs.gnu.org Cc: eliz@HIDDEN, johnw@HIDDEN, mbork@HIDDEN, rms@HIDDEN, akioburns@HIDDEN Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.15646019955659 (code B ref 22873); Wed, 31 Jul 2019 19:40:02 +0000 Received: (at 22873) by debbugs.gnu.org; 31 Jul 2019 19:39:55 +0000 Received: from localhost ([127.0.0.1]:53123 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1hsuS3-0001TD-Ku for submit <at> debbugs.gnu.org; Wed, 31 Jul 2019 15:39:55 -0400 Received: from gateway36.websitewelcome.com ([192.185.185.36]:48430) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1hsuS0-0001Sy-6p for 22873 <at> debbugs.gnu.org; Wed, 31 Jul 2019 15:39:52 -0400 Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway36.websitewelcome.com (Postfix) with ESMTP id D77B7400CA1CA for <22873 <at> debbugs.gnu.org>; Wed, 31 Jul 2019 14:04:04 -0500 (CDT) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id suRzhvTRLdnCesuRzhOTKx; Wed, 31 Jul 2019 14:39:51 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=kxbL7es3MJ84u8iD7aQbh+W0q5lAgZl4kOtJpvB6ccY=; b=LZSK4QxHKhl9Ah3Lkel1s9qyqA dWrO4wiKQ3hw7S7W7vX/xMG44eHbESotWhqqgZKKr6Wk77TD1f+3NV/9RPcfTH8bUIYUO9ORdhXQD B1N8qfV/UV1rfiREGtvBnUyLSPM6eAFWY0cCWyhKgdi+h2W3cpTUkrzHKe8gY5BWfw23r163CBqh8 sPOWolR7N/tQ263baqDAnCeP+z3VaG2P8mzlO/RK84bDpNiZuqNsvtULvPFmYk1gWbVn9soOMXaCl 6FFpsLSjOMowvK23m6eLpUjgLTRcU+kQLq1By9sOetotnjn5qNUNr3mzmniJSc8MaCuQwJFIaI8UY 4NLLEZBg==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:52173 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from <esq@HIDDEN>) id 1hsuRv-001oKw-33; Wed, 31 Jul 2019 14:39:50 -0500 Date: Wed, 31 Jul 2019 12:39:46 -0700 Message-ID: <m2ftmmhu2l.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Wed_Jul_31_12:39:45_2019-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1hsuRv-001oKw-33 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:52173 X-Source-Auth: lawlist X-Email-Count: 7 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> --Multipart_Wed_Jul_31_12:39:45_2019-1 Content-Type: text/plain; charset=US-ASCII VERSION: 022.002 [07/31/2019] CHANGELOG: - Replaced optional debugging messages to STDERR with the variable `mc_stderr_p' instead of using `trace_redisplay_p'. - `mc_update_window_erase' no longer excludes left/right fringe bitmaps from the `same_p` determination. `mc_helper' now contains exceptions for the left/right fringe bitmap indicators, ensuring they are reset even if they are `same_p`. - Added a NOTES section to this introductory commentary, including, a summary explaining generally the purpose of the dryrun in `update_window'. - Removed `mc_rotate_matrix' and `mc_reverse_vpos'. - Miscellaneous tidying-up of code. VIDEOS: w32: https://youtu.be/r3BdJVlsAnQ ns: https://youtu.be/bc1h8jtbXmw x11: https://youtu.be/aCIFhD2Xz5s SCREENSHOTS: https://www.lawlist.com/images/22873_17684_light_dark_backgrounds.png SETUP: Step 1: git clone -b master git://git.sv.gnu.org/emacs.git Step 2: In the new emacs folder, go back to an Emacs version from 07/14/2019: git reset --hard ac57c5093829ee09084c562bbbc1c412179be13d Step 3: From within the new emacs folder created in Step 1, apply the patch: git apply /path/to/the/patch.diff Step 4: ./autogen.sh Step 5: ./configure ... [your custom options] Step 6: make Step 7: make install USAGE: - For a minimal working example of built-in fake cursors, type: M-x mc-test ;;; TURN ON FAKE CURSORS (buffer position, cursor-type, cursor color): (setq mc-conf '((1 "hbar" "magenta") (2 "bar" "purple") (3 "box" "#00FF00") (4 "hollow" "#0000FF") (5 ("hbar" 3) [1.0 0.0 1.0]) (6 ("bar" 3) [0.0 1.0 1.0]) (7 "framed" "OrangeRed")))) ;;; TURN OFF FAKE CURSORS: (setq mc-conf nil) - To try out both the crosshairs feature and the visible fill column indicator feature, type: M-x +-mode - To try out just the visible fill column indicator feature, type: M-x fc-mode - To try out built-in fake cursors with Magnar Sveen's multiple-cursors package, that package must be installed. If the multiple-cursors package is already installed, then just (require 'crosshairs) and `crosshairs.el` will redefine a few of the multiple-cursors functions and set up a few keyboard shortcuts. If the multiple-cursors package by Magnar Sveen is not already installed, then here are two easy ways to install that package: Type: M-x mc-install OR, evaluate the following snippet: (progn (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) (package-refresh-contents) (package-install 'multiple-cursors) (mc/built-in-cursors)) TODO: - When an idle-timer fires and point is at the end of a horizontally scrolled line in a narrow window, the temporary horizontal scroll is canceled. Create a minimal working example and file a bug report. (progn (defun test () (interactive) (let ((ov (make-overlay (point) (1+ (point)) nil t t))) (overlay-put ov 'face '(:foreground "red")))) (global-set-key [f5] 'test) (split-window-horizontally) (switch-to-buffer (get-buffer-create "foo")) (setq bidi-display-reordering nil) (setq-local auto-hscroll-mode 'current-line) (dotimes (i 80) (insert (char-to-string (+ 65 i))))) - `ns_draw_window_cursor' calls `ns_clip_to_rect', which does _not_ take `row->clip` into consideration when drawing cursors with `NSRectFill'. When it comes time to draw glyphs on top of the box/hollow family of cursors, `row->clip` is taken into consideration by `get_glyph_string_clip'. Fake cursors can be drawn even though the glyphs cannot, resulting in hollow/box family of cursors without text. The issue can be reproduced with M-x mc-test. [A temporary workaround is to disable `row->clip` while drawing the glyphs.] https://lists.gnu.org/archive/html/emacs-devel/2019-04/msg00009.html - Deal with left/right overwritten glyphs in the w32 and X ports of Emacs. - There is a bug affecting the recorded `w->mc.lnum_pixel_width` that is observable when not running under gdb, but disappears when running under gdb. While viewing a folded org-mode buffer, the non-gdb instance had a visible line number pixel-width of 44, but Emacs treated it as fluctuating between 44 and 55 as the cursor was moved to the end of line. In the gdb instance, the visible line number pixel width was 55 with no fluctuation under the same conditions as the non-gdb instance. This appears to be a different bug than bug#32177 (current line number shifts one column to the left) because the line number of the current line does not shift left, and changing the bidi settings did not correct the issue. - The current test for `auto_hscroll_mode_p' only looks for `current_line` and all five related tests are based upon that assumption, which may not be true. - Multiple Cursors: If point is in the middle of a composite character, then select a fully composed character so that the fake cursor is visible. - Implement functionality similar to the Lisp multiple-cursors by Magnar Sveen. - Follow up with the Emacs team re bug#32177; i.e., (Current line number shifts one column to the left.) - Follow up with the Emacs team re bug#32060; i.e., Horizontal Scrolling (Current Line): Wrong line gets h-scrolled. - Determine if bug #28936 needs to be fixed and help the Emacs team re same. - Is there any additional meaningful optimization that can be added to the three calls of `mc_pre_scroll_clean'? - There is a bug affecting an older version of Emacs for the NS port that causes partial line flickering when the same characters are grouped together (;;;;;;) and MC_GLYPHLESS cursors are above or below -- having the same background color as the frame; e.g., black on black (used to erase a glyphless cursor). The partial flickering is only noticeable with rapid fire; e.g., holding down the right/left arrow key. When changing the color of the glyphless cursor, the issue is not present. [@lawlist has verified that the X and HPOS coordinates are accurate.] NOTES: - Our journey begins at the outset of `update_window' when `mc_update_window_dryrun' performs a `!draw_p` simulation to create a new cache of fake cursors that are stored in the `w->mc_matrix`. The cache from the previous redisplay is copied to a temporary `mc_matrix` under the name of `old_matrix`. At the tail end of `mc_update_window_dryrun', `mc_update_window_erase' compares the new `w->mc_matrix` with the `old_matrix` to determine which fake cursors are the same -- setting the `same_p` boolean struct member accordingly for each applicable fake cursor within the `w->mc_matrix`. All fake cursors in the `old_matrix` that are `!same_p` get erased at this juncture. [Fn 1.] After the dryrun is complete, `update_window' does the real thing -- `draw_p`. As to the `from_where` situations of SKIPPED, POST_CHANGED, UNCHANGED, and SET_CURSOR_TWO, `mc_helper' compares the incoming tentative fake cursor with the `w->mc_matrix` to see if it has previously been marked as `same_p` -- if it is `!same_p`, then the fake cursor is drawn and we `return`. Fake cursors that have a `cursor_type` of MC_LEFT_FRINGE_BITMAP or MC_RIGHT_FRINGE_BITMAP are always reset even if they are `same_p`. As to the `from_where` situations of SCRIBE_ONE, SCRIBE_TWO, SCRIBE_THREE, and NOWHERE, `mc_helper' always causes fake cursors to be drawn (because new glyphs were written to the glass, or the area to the right of the display line was cleared) and we `return`. . Fn. 1: Even though writing new glyphs to the glass (SCRIBE_ONE, SCRIBE_TWO, and SCRIBE_THREE) would erase fake cursors within those boundaries, it is still necessary to erase `!same_p` fake cursors prior thereto. This is because `scrolling_window' occurs before new glyphs are written and `rif->scroll_run_hook' may copy one or more rows to other areas of the glass. It is not worth the effort to programmatically track both the _copied_ fake cursors and the _original_ fake cursors from the previous redisplay cycle, whose glyphs may remain where they are in the current redisplay cycle because they satisfy the `GLYPH_EQUAL_P' test. - As to `mc_scrolling_window', it would appear that there is no tangible benefit to rotating the current/prospective cache of fake cursors to compare the data before removing the fake cursors. When scrolling the display, only _some_ lines are copied to new locations. Areas that are not overwritten may have fake cursors and those may not necessarily be removed if desired/current matrix glyphs are equal. The test for `GLYPH_EQUAL_P' does not take into consideration the existence of a fake cursor, and the glyph (with a fake cursor) may not be updated as a result thereof. As to lines that are not copied, portions may be updated and fake cursors would be removed thereby. `mc_rotate_matrix' and `mc_reverse_vpos' were removed with patch v. 022.002. --Multipart_Wed_Jul_31_12:39:45_2019-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="2019_07_31__12_36_32_978.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvY3Jvc3NoYWlycy5lbCBiL2x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ICh1bmxlc3MgbWMtLWV4ZWN1dGluZy1jb21t YW5kLWZvci1mYWtlLWN1cnNvcgorICAgICAgKGlmIChlcSAxIChtYy9udW0tY3Vyc29ycykpIDs7 IG5vIGZha2UgY3Vyc29ycz8gZGlzYWJsZSBtYy1tb2RlCisgICAgICAgICAgKG11bHRpcGxlLWN1 cnNvcnMtbW9kZSAwKQorICAgICAgICAod2hlbiB0aGlzLW9yaWdpbmFsLWNvbW1hbmQKKyAgICAg ICAgICAobGV0ICgob3JpZ2luYWwtY29tbWFuZCAob3IgbWMtLXRoaXMtY29tbWFuZAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29tbWFuZC1yZW1hcHBpbmcgdGhpcy1v cmlnaW5hbC1jb21tYW5kKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0 aGlzLW9yaWdpbmFsLWNvbW1hbmQpKSkKKyAgICAgICAgICAgIDs7IHNraXAga2V5Ym9hcmQgbWFj cm9zLCBzaW5jZSB0aGV5IHdpbGwgZ2VuZXJhdGUgYWN0dWFsIGNvbW1hbmRzIHRoYXQgYXJlCisg ICAgICAgICAgICA7OyBhbHNvIHJ1biBpbiB0aGUgY29tbWFuZCBsb29wIC0gd2UnbGwgaGFuZGxl IHRob3NlIGxhdGVyIGluc3RlYWQuCisgICAgICAgICAgICAod2hlbiAoZnVuY3Rpb25wIG9yaWdp bmFsLWNvbW1hbmQpCisgICAgICAgICAgICAgIDs7IGlmIGl0J3MgYSBsYW1iZGEsIHdlIGNhbid0 IGtub3cgaWYgaXQncyBzdXBwb3J0ZWQgb3Igbm90CisgICAgICAgICAgICAgIDs7IC0gc28gZ28g YWhlYWQgYW5kIGFzc3VtZSBpdCdzIG9rLCBiZWNhdXNlIHdlJ3JlIGp1c3Qgb3B0aW1pc3RpYyBs aWtlIHRoYXQKKyAgICAgICAgICAgICAgKGlmIChvciAobm90IChzeW1ib2xwIG9yaWdpbmFsLWNv bW1hbmQpKQorICAgICAgICAgICAgICAgICAgICAgIDs7IGxhbWJkYSByZWdpc3RlcmVkIGJ5IHNt YXJ0cmVwCisgICAgICAgICAgICAgICAgICAgICAgKHN0cmluZy1wcmVmaXgtcCAiKCIgKHN5bWJv bC1uYW1lIG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAgICAgICAgICAgICAgICAgIChtYy9leGVjdXRl LWNvbW1hbmQtZm9yLWFsbC1mYWtlLWN1cnNvcnMgb3JpZ2luYWwtY29tbWFuZCkKKyAgICAgICAg ICAgICAgICA7OyBzbWFydHJlcCBgaW50ZXJuJ3MgY29tbWFuZHMgaW50byBvd24gb2JhcnJheSB0 byBoZWxwCisgICAgICAgICAgICAgICAgOzsgYGRlc2NyaWJlLWJpbmRpbmdzJy4gIFNvLCBsZXQn cyByZS1gaW50ZXJuJyBoZXJlIHRvCisgICAgICAgICAgICAgICAgOzsgbWFrZSB0aGUgY29tbWFu ZCBjb21wYXJhYmxlIGJ5IGBlcScuCisgICAgICAgICAgICAgICAgKHNldHEgb3JpZ2luYWwtY29t bWFuZCAoaW50ZXJuIChzeW1ib2wtbmFtZSBvcmlnaW5hbC1jb21tYW5kKSkpCisgICAgICAgICAg ICAgICAgOzsgb3RoZXJ3aXNlIGl0J3MgYSBzeW1ib2wsIGFuZCB3ZSBjYW4gYmUgbW9yZSB0aG9y b3VnaAorICAgICAgICAgICAgICAgIChpZiAoZ2V0IG9yaWdpbmFsLWNvbW1hbmQgJ21jLS11bnN1 cHBvcnRlZCkKKyAgICAgICAgICAgICAgICAgICAgKG1lc3NhZ2UgIiVTIGlzIG5vdCBzdXBwb3J0 ZWQgd2l0aCBtdWx0aXBsZSBjdXJzb3JzJXMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg IG9yaWdpbmFsLWNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdldCBvcmln aW5hbC1jb21tYW5kICdtYy0tdW5zdXBwb3J0ZWQpKQorICAgICAgICAgICAgICAgICAgKHdoZW4g KGFuZCBvcmlnaW5hbC1jb21tYW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChub3Qg KG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy0tZGVmYXVsdC1jbWRzLXRvLXJ1bi1vbmNlKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKG5vdCAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1j L2NtZHMtdG8tcnVuLW9uY2UpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAob3IgbWMv YWx3YXlzLXJ1bi1mb3ItYWxsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVt cSBvcmlnaW5hbC1jb21tYW5kIG1jLS1kZWZhdWx0LWNtZHMtdG8tcnVuLWZvci1hbGwpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jL2Nt ZHMtdG8tcnVuLWZvci1hbGwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWMv cHJvbXB0LWZvci1pbmNsdXNpb24taW4td2hpdGVsaXN0IG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAg ICAgICAgICAgICAgICAgICAgKG1jL2V4ZWN1dGUtY29tbWFuZC1mb3ItYWxsLWZha2UtY3Vyc29y cyBvcmlnaW5hbC1jb21tYW5kKSkpKQorICAgICAgICAgICAgICAod2hlbiBtYy91c2UtYnVpbHQt aW4tY3Vyc29ycworICAgICAgICAgICAgICAgIChzZXRxIG1jLWNvbmYKKyAgICAgICAgICAgICAg ICAgICAgICAgIChtYXBjYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKGxhbWJkYSAoeCkg KGxpc3QgKG92ZXJsYXktc3RhcnQgeCkgImJhciIgbmlsKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgKG1jL2FsbC1mYWtlLWN1cnNvcnMpKSkpKSkpKSkpCisKKyAgKGRlZnVuIG1jL21hcmst bmV4dC1saW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idWZmZXIgYnVmZmVyCisgICAgICAoZXJhc2UtYnVmZmVyKQorICAgICAgKGlu c2VydCAiVGhpcyBpcyBhIHRlc3QhIikKKyAgICAgIChzZXRxIG1jLWNvbmYgJygoMSAiaGJhciIg Im1hZ2VudGEiKQorICAgICAgICAgICAgICAgICAgICAgICgyICJiYXIiICJwdXJwbGUiKQorICAg ICAgICAgICAgICAgICAgICAgICgzICJib3giICIjMDBGRjAwIikKKyAgICAgICAgICAgICAgICAg ICAgICAoNCAiaG9sbG93IiAiIzAwMDBGRiIpCisgICAgICAgICAgICAgICAgICAgICAgKDUgKCJo YmFyIiAzKSBbMS4wIDAuMCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg2ICgiYmFyIiAz KSBbMC4wIDEuMCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg3ICJmcmFtZWQiICJPcmFu Z2VSZWQiKQorICAgICAgICAgICAgICAgICAgICAgICg4ICJib3giICJncmV5MjUiKQorICAgICAg ICAgICAgICAgICAgICAgICg5ICJib3giICJncmV5NzUiKSkpKQorICAgIChzZWxlY3Qtd2luZG93 IChkaXNwbGF5LWJ1ZmZlciBidWZmZXIpKSkpCisKKyhkZWZ1biArLXRpbWVyLWZuICgpCisiU2lu Y2UgdGhpcyBmaXJlcyBnbG9iYWxseSwgd2UgbXVzdCBjb250cm9sIHdoaWNoIGJ1ZmZlcnMgY3Jv c3NoYWlycyBhcHBlYXIgaW4uIgorICAod2hlbiArLW1vZGUKKyAgICAodW5sZXNzIChvciAobWVt cSBsYXN0LWNvbW1hbmQgKy1wYXJlbnMtZXhjbHVzaW9ucykKKyAgICAgICAgICAgICAgICAobnVs bCArLXBhcmVucy1wKSkKKyAgICAgICgrLXBhcmVucy1mbikpCisgICAgKHdoZW4gKy10aW1lci12 YXIKKyAgICAgIChzZXRxIHRpbWVyLWlkbGUtbGlzdCAoZGVscSArLXRpbWVyLXZhciB0aW1lci1p ZGxlLWxpc3QpKQorICAgICAgKHNldHEgKy10aW1lci12YXIgbmlsKSkpKQorCisoZGVmdW4gKy1k cmF3LWZvcnRod2l0aCAoKQorIkltbWVkaWF0ZWx5IGRlbGV0ZS9kcmF3IG1hdGNoaW5nIHBhcmVu dGhlc2VzLiIKKyAgKCstZHJhdy1jcm9zc2hhaXJzICdmb3JjZSkpCisKKyhkZWZ1biArLWRyYXct Y3Jvc3NoYWlycyAoJm9wdGlvbmFsIGZvcmNlKQorIkltbWVkaWF0ZWx5IGRlbGV0ZSBtYXRjaGlu ZyBwYXJlbnRoZXNlcy4gIElmIEZPUkNFIGlzIG5vbi1uaWwsIHRoZW4gaW1tZWRpYXRlbHkKK2Ry YXcgbWF0Y2hpbmcgcGFyZW50aGVzaXM7IG90aGVyd2lzZSwgZHJhdyB0aGVtIG9uIGFuIGlkbGUt dGllci4iCisgICh3aGVuICstbW9kZQorICAgICh3aGVuICstdGltZXItdmFyCisgICAgICAoc2V0 cSB0aW1lci1pZGxlLWxpc3QgKGRlbHEgKy10aW1lci12YXIgdGltZXItaWRsZS1saXN0KSkKKyAg ICAgIChzZXRxICstdGltZXItdmFyIG5pbCkpCisgICAgKHVubGVzcyAob3IgKG1lbXEgdGhpcy1j b21tYW5kICstcGFyZW5zLWV4Y2x1c2lvbnMpCisgICAgICAgICAgICAgICAgKGFuZCAobnVsbCAr LXBhcmVucy1wKQorICAgICAgICAgICAgICAgICAgICAgKG51bGwgKy1wYXJlbnMtb3ZlcmxheXMt ZXhpc3QtcCkpKQorICAgICAgKCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykpCisgICAgKGlmIGZv cmNlCisgICAgICAocHJvZ24KKyAgICAgICAgKHdoZW4gKy1wYXJlbnMtcAorICAgICAgICAgICgr LXBhcmVucy1mbikpKQorICAgICAgKHNldHEgKy10aW1lci12YXIgKHJ1bi13aXRoLWlkbGUtdGlt ZXIgKy1pZGxlLXRpbWVyLXNlY29uZHMgbmlsICMnKy10aW1lci1mbikpKSkpCisKKyhkZWZ2YXIg ZmMtbW9kZSkKKworOzs7IyMjYXV0b2xvYWQKKyhkZWZpbmUtbWlub3ItbW9kZSArLW1vZGUKKyJN aW5vciBtb2RlIGZvciBkaXNwbGF5aW5nIGEgaG9yaXpvbnRhbCBydWxlci4iCisgIDppbml0LXZh bHVlIG5pbAorICA6bGlnaHRlciAiICsiCisgIDprZXltYXAgbmlsCisgIDpnbG9iYWwgbmlsCisg IDpncm91cCAnKy1tb2RlCisgIChjb25kCisgICAgKCstbW9kZQorICAgICAgOzs7IGArLW1vZGUn IGhhcyB0aGUgYWJpbGl0eSB0byBhbHNvIGRpc3BsYXkgYSBmaWxsIGNvbHVtbiBpbmRpY2F0b3Iu CisgICAgICA7OzsgU2VlIHRoZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicuCisgICAgICAod2hl biBmYy1tb2RlCisgICAgICAgIChmYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgZ2xvYmFs LWVsZG9jLW1vZGUKKyAgICAgICAgICAgICAgICAgKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAgJ2Fu eSkKKyAgICAgICAgICAgICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAg ICAgICAgKGdsb2JhbC1lbGRvYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgaml0LWxvY2st Y29udGV4dC10aW1lcgorICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAn YW55KQorICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQor ICAgICAgICAod2hlbiAodGltZXJwIGppdC1sb2NrLWNvbnRleHQtdGltZXIpCisgICAgICAgICAg KGNhbmNlbC10aW1lciBqaXQtbG9jay1jb250ZXh0LXRpbWVyKSkKKyAgICAgICAgOzsgKHNldHEg aml0LWxvY2stY29udGV4dC10aW1lciAocnVuLXdpdGgtaWRsZS10aW1lciA1LjAgJ3JlcGVhdCAn aml0LWxvY2stY29udGV4dC1mb250aWZ5KSkKKyAgICAgICAgKHNldHEgaml0LWxvY2stY29udGV4 dC10aW1lciBuaWwpKQorICAgICAgKHdoZW4gKGFuZCAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAn YW55KQorICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQor ICAgICAgICAod2hlbiAodGltZXJwIHVuZG8tYXV0by1jdXJyZW50LWJvdW5kYXJ5LXRpbWVyKQor ICAgICAgICAgIChjYW5jZWwtdGltZXIgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIp KQorICAgICAgICAoZnNldCAndW5kby1hdXRvLS11bmRvYWJsZS1jaGFuZ2UKKyAgICAgICAgICAg ICAgKGxhbWJkYSAoKSAoYWRkLXRvLWxpc3QgJ3VuZG8tYXV0by0tdW5kb2FibHktY2hhbmdlZC1i dWZmZXJzIChjdXJyZW50LWJ1ZmZlcikpKSkKKyAgICAgICAgKGZzZXQgJ3VuZG8tYXV0by1hbWFs Z2FtYXRlICdpZ25vcmUpKQorICAgICAgKHdoZW4gYmxpbmstY3Vyc29yLW1vZGUKKyAgICAgICAg KGJsaW5rLWN1cnNvci1tb2RlIC0xKQorICAgICAgICAod2hlbiAobWVtcSAnYmxpbmstY3Vyc29y LWNoZWNrIHBvc3QtY29tbWFuZC1ob29rKQorICAgICAgICAgIChyZW1vdmUtaG9vayAncG9zdC1j b21tYW5kLWhvb2sgJ2JsaW5rLWN1cnNvci1jaGVjaykpKQorICAgICAgKHNldHEgY3Jvc3NoYWly cyB0KQorICAgICAgKHdoZW4gKy1maWxsLWNvbHVtbgorICAgICAgICAoc2V0cSBmYy12aXNpYmxl IHQpKQorICAgICAgOzs7IGBhdXRvLWNvbXBvc2l0aW9uLW1vZGUnIGlzIG5lZWRlZCBmb3IgY3Jv c3NoYWlycyB0byBwcm9wZXJseSBjYWxjdWxhdGUKKyAgICAgIDs7OyBjb29yZGluYXRlcyBvZiBj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1bmNhdGUtbGluZXMKKyAgICAgICAgICAgICAgICAg ICAgIHRydW5jYXRlLXBhcnRpYWwtd2lkdGgtd2luZG93cworICAgICAgICAgICAgICAgICAgICAg d29yZC13cmFwKSkKKyAgICAgICAgKHdoZW4gKGxvY2FsLXZhcmlhYmxlLXAgdmFyKQorICAgICAg ICAgIChwdXNoIChjb25zIHZhciAoc3ltYm9sLXZhbHVlIHZhcikpICstLXNhdmVkLXN0YXRlKSkp CisgICAgICAoc2V0cSBmaWxsLWNvbHVtbiA4MCkKKyAgICAgIChzZXRxIGRpc3BsYXktbGluZS1u dW1iZXJzIHQpCisgICAgICAoc2V0cS1sb2NhbCBhdXRvLWhzY3JvbGwtbW9kZSAnY3VycmVudC1s aW5lKQorICAgICAgKHNldHEtbG9jYWwgaHNjcm9sbC1zdGVwIDUpCisgICAgICAoc2V0cSBidWZm ZXItZGlzcGxheS10YWJsZSArLWJ1ZmZlci1kaXNwbGF5LXRhYmxlKQorICAgICAgKHNldHEgdGFi LXdpZHRoIDQpCisgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICdsaW5lLW1vdmUtdmlz dWFsKSB0KQorICAgICAgKHNldHEgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgKGNvbmQKKyAgICAg ICAgICAoKGxldCAoKGxzdCArLXRydW5jYXRlLWxpbmVzLWRlcml2ZWQtbW9kZXMpCisgICAgICAg ICAgICAgICAgICBtb2RlKQorICAgICAgICAgICAgKGNhdGNoICdmb3VuZAorICAgICAgICAgICAg ICAod2hpbGUgKHNldHEgbW9kZSAocG9wIGxzdCkpCisgICAgICAgICAgICAgICAgKHdoZW4gKGRl cml2ZWQtbW9kZS1wIG1vZGUpCisgICAgICAgICAgICAgICAgICAodGhyb3cgJ2ZvdW5kIHQpKSkp KSkKKyAgICAgICAgICAgKChtZW1xIG1ham9yLW1vZGUgKy10cnVuY2F0ZS1saW5lcy1tYWpvci1t b2RlcykpCisgICAgICAgICAgICh0CisgICAgICAgICAgICAgbmlsKSkpCisgICAgICAoc2V0ICht YWtlLWxvY2FsLXZhcmlhYmxlICd0cnVuY2F0ZS1wYXJ0aWFsLXdpZHRoLXdpbmRvd3MpIG5pbCkK KyAgICAgIChzZXRxIHdvcmQtd3JhcCB0KQorICAgICAgKHNldHEgaW5kaWNhdGUtZW1wdHktbGlu ZXMgdCkKKyAgICAgIChzZXRxIGluZGljYXRlLWJ1ZmZlci1ib3VuZGFyaWVzICdsZWZ0KQorICAg ICAgKHNldHEgZnJpbmdlLWluZGljYXRvci1hbGlzdAorICAgICAgICAgIDs7OyBoc2NsX2FsbF90 ZW1wX3AgfCBoc2NsX3RlbXBfcAorICAgICAgICAnKCgrLWhzY2wtdGVtcCAuICgrLXNpbmdsZS1h bmdsZS1sZWZ0CisgICAgICAgICAgICAgICAgICAgICAgICAgICstZG91YmxlLWFuZ2xlLWxlZnQp KQorICAgICAgICAgIDs7OyBoc2NsX2FsbF9wZXJtXzBfcCB8IGhzY2xfYWxsX3Blcm1fMV9wIHwg aHNjbF9hbGxfcGVybV8yX3AgfCBoc2NsX3Blcm1fcAorICAgICAgICAgICgrLWhzY2wtcGVybSAu ICgrLXNpbmdsZS1hbmdsZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLWRvdWJsZS1h bmdsZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLXRyaXBsZS1hbmdsZS11cAorICAg ICAgICAgICAgICAgICAgICAgICAgICArLXF1YWRydXBsZS1hbmdsZS11cCkpCisgICAgICAgICAg KCstb3ZlcmxheS1hcnJvdyAuICgrLWZyaW5nZS1sZWZ0LWFycm93CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICArLWZyaW5nZS1yaWdodC1hcnJvdykpCisgICAgICAgICAgKHRydW5jYXRp b24gLiAoKy1mcmluZ2UtbGVmdC1hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICstZnJp bmdlLXJpZ2h0LWFycm93KSkKKyAgICAgICAgICAoY29udGludWF0aW9uIC4gKCstZnJpbmdlLWxl ZnQtY3VybHktYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICstYmFja3NsYXNoKSkK KyAgICAgICAgICAob3ZlcmxheS1hcnJvdyAuICstZnJpbmdlLXJpZ2h0LXRyaWFuZ2xlKQorICAg ICAgICAgICh1cCAuICstZnJpbmdlLXVwLWFycm93KQorICAgICAgICAgIChkb3duIC4gKy1mcmlu Z2UtZG93bi1hcnJvdykKKyAgICAgICAgICAodG9wIC4gKy1mcmluZ2UtdG9wLWxlZnQtYW5nbGUp CisgICAgICAgICAgKGJvdHRvbSAuICstZnJpbmdlLWJvdHRvbS1yaWdodC1hbmdsZSkKKyAgICAg ICAgICAodG9wLWJvdHRvbSAuICgrLWZyaW5nZS1sZWZ0LWJyYWNrZXQKKyAgICAgICAgICAgICAg ICAgICAgICAgICArLWZyaW5nZS1yaWdodC1icmFja2V0CisgICAgICAgICAgICAgICAgICAgICAg ICAgKy1mcmluZ2UtdG9wLXJpZ2h0LWFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgKy1m cmluZ2UtdG9wLWxlZnQtYW5nbGUpKQorICAgICAgICAgIChlbXB0eS1saW5lIC4gKy1mcmluZ2Ut ZW1wdHktbGluZSkKKyAgICAgICAgICAodW5rbm93biAuICstZnJpbmdlLXF1ZXN0aW9uLW1hcmsp KSkKKyAgICAgIChzZXRxIGZyaW5nZS1jdXJzb3ItYWxpc3QgJygoYm94IC4gKy1mcmluZ2UtbGVm dC10cmlhbmdsZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaG9sbG93IC4g Ky1ob2xsb3ctcmVjdGFuZ2xlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChi YXIgLiArLXZlcnRpY2FsLWJhcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo aGJhciAuICstZnJpbmdlLWhvcml6b250YWwtYmFyKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIChob2xsb3ctc21hbGwgLiArLWZyaW5nZS1ob2xsb3ctc3F1YXJlKSkpCisgICAg ICAoaWYgKG9yICstZm9ydGh3aXRoCisgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZp eC1hcmcgJyg0KSkpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJh dy1mb3J0aHdpdGggJ2FwcGVuZCAnbG9jYWwpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21t YW5kLWhvb2sgJystZHJhdy1jcm9zc2hhaXJzICdhcHBlbmQgJ2xvY2FsKSkKKyAgICAgICh3aGVu ICstZm9ydGh3aXRoCisgICAgICAgIChhZGQtaG9vayAnd2luZG93LWNvbmZpZ3VyYXRpb24tY2hh bmdlLWhvb2sgJystZHJhdy1mb3J0aHdpdGggbmlsICdsb2NhbCkpCisgICAgICAoYWRkLWhvb2sg J2NoYW5nZS1tYWpvci1tb2RlLWhvb2sgJ3R1cm4tb2ZmLSstbW9kZSBuaWwgJ2xvY2FsKQorICAg ICAgOzs7IE1hdGNoaW5nIHBhcmVudGhlc2VzIGRyYXdpbmcgZm9ydGh3aXRoIGludGVyZmVyZXMg d2l0aCB5YXNuaXBwZXQuCisgICAgICAod2hlbiArLWZvcnRod2l0aAorICAgICAgICAoc2V0cSAr LXBhcmVucy1wIG5pbCkpCisgICAgICAod2hlbiAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55 KQorICAgICAgICAoY29uZAorICAgICAgICAgICgrLWZvcnRod2l0aAorICAgICAgICAgICAgKG1l c3NhZ2UgIlR1cm5lZCBPTiBgKy1tb2RlJyAtLSBEcmF3IG1hdGNoaW5nIHBhcmVudGhlc2VzIGlt bWVkaWF0ZWx5LiIpKQorICAgICAgICAgICgoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkp CisgICAgICAgICAgICA7OzsgTWF0Y2hpbmcgcGFyZW50aGVzZXMgd2lsbCBiZSBkcmF3biBpbW1l ZGlhdGVseS4KKyAgICAgICAgICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScgLS0gT3B0 aW1pemVkIGZvciBkZWJ1Z2dpbmcgcHVycG9zZXMuIikpCisgICAgICAgICAgKHQKKyAgICAgICAg ICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScuIikpKSkpCisgICAgKHQKKyAgICAgIChr aWxsLWxvY2FsLXZhcmlhYmxlICdmaWxsLWNvbHVtbikKKyAgICAgIChraWxsLWxvY2FsLXZhcmlh YmxlICdhdXRvLWhzY3JvbGwtbW9kZSkKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdoc2Ny b2xsLXN0ZXApCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnY3Jvc3NoYWlycykKKyAgICAg IChraWxsLWxvY2FsLXZhcmlhYmxlICdmYy12aXNpYmxlKQorICAgICAgKGtpbGwtbG9jYWwtdmFy aWFibGUgJ2Rpc3BsYXktbGluZS1udW1iZXJzKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUg J2Rpc3BsYXktbGluZS1udW1iZXJzLXdpZHRoKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUg J21jLWNvbmYpCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnYnVmZmVyLWRpc3BsYXktdGFi bGUpCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAndGFiLXdpZHRoKQorICAgICAgKGtpbGwt bG9jYWwtdmFyaWFibGUgJ2xpbmUtbW92ZS12aXN1YWwpCisgICAgICAoa2lsbC1sb2NhbC12YXJp YWJsZSAndHJ1bmNhdGUtbGluZXMpCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAndHJ1bmNh dGUtcGFydGlhbC13aWR0aC13aW5kb3dzKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJ3dv cmQtd3JhcCkKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdpbmRpY2F0ZS1lbXB0eS1saW5l cykKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdpbmRpY2F0ZS1idWZmZXItYm91bmRhcmll cykKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdmcmluZ2UtaW5kaWNhdG9yLWFsaXN0KQor ICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJ2ZyaW5nZS1jdXJzb3ItYWxpc3QpCisgICAgICAo a2lsbC1sb2NhbC12YXJpYWJsZSAnKy1mb3J0aHdpdGgpCisgICAgICAoZG9saXN0IChzYXZlZCAr LS1zYXZlZC1zdGF0ZSkKKyAgICAgICAgKHNldCAobWFrZS1sb2NhbC12YXJpYWJsZSAoY2FyIHNh dmVkKSkgKGNkciBzYXZlZCkpKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJystLXNhdmVk LXN0YXRlKQorICAgICAgKCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykKKyAgICAgICh3aGVuICht ZW1xICcrLWRyYXctZm9ydGh3aXRoIHBvc3QtY29tbWFuZC1ob29rKQorICAgICAgICAocmVtb3Zl LWhvb2sgJ3Bvc3QtY29tbWFuZC1ob29rICcrLWRyYXctZm9ydGh3aXRoICdsb2NhbCkpCisgICAg ICAod2hlbiAobWVtcSAnKy1kcmF3LWNyb3NzaGFpcnMgcG9zdC1jb21tYW5kLWhvb2spCisgICAg ICAgIChyZW1vdmUtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJhdy1jcm9zc2hhaXJzICds b2NhbCkpCisgICAgICAod2hlbiAobWVtcSAnKy1kcmF3LWZvcnRod2l0aCB3aW5kb3ctY29uZmln dXJhdGlvbi1jaGFuZ2UtaG9vaykKKyAgICAgICAgKHJlbW92ZS1ob29rICd3aW5kb3ctY29uZmln dXJhdGlvbi1jaGFuZ2UtaG9vayAnKy1kcmF3LWZvcnRod2l0aCAnbG9jYWwpKQorICAgICAgKHJl bW92ZS1ob29rICdjaGFuZ2UtbWFqb3ItbW9kZS1ob29rICd0dXJuLW9mZi0rLW1vZGUgJ2xvY2Fs KQorICAgICAgKHdoZW4gKy10aW1lci12YXIKKyAgICAgICAgKHNldHEgdGltZXItaWRsZS1saXN0 IChkZWxxICstdGltZXItdmFyIHRpbWVyLWlkbGUtbGlzdCkpCisgICAgICAgIChzZXRxICstdGlt ZXItdmFyIG5pbCkpCisgICAgICAod2hlbiAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQor ICAgICAgICAobWVzc2FnZSAiVHVybmVkIE9GRiBgKy1tb2RlJy4iKSkpKSkKKworKGRlZnVuIHR1 cm4tb2ZmLSstbW9kZSAoKQorICAoKy1tb2RlIC0xKSkKKworOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7CisKKyhkZWZ1biArLXBhcmVucy1mbiAoKQorICAiRG9jLXN0cmluZy4iCisgIChsZXQqICgo b3BvaW50IChwb2ludCkpCisgICAgICAgICAoZnJvbSAoaWYgKy1wYXJlbnMtZnJvbS1mbgorICAg ICAgICAgICAgICAgICAoZnVuY2FsbCArLXBhcmVucy1mcm9tLWZuKQorICAgICAgICAgICAgICAg ICAocG9pbnQtbWluKSkpCisgICAgICAgICAod2luIChzZWxlY3RlZC13aW5kb3cpKQorICAgICAg ICAgKGkgMCkKKyAgICAgICAgIChwcmVjZWRpbmctY2hhciAocHJlY2VkaW5nLWNoYXIpKQorICAg ICAgICAgKG9jaGFyIChjaGFyLWFmdGVyIG9wb2ludCkpCisgICAgICAgICAocG9zMQorICAgICAg ICAgICAoY29uZAorICAgICAgICAgICAgICgoYW5kIG9jaGFyCisgICAgICAgICAgICAgICAgICAg KG9yIDs7OyAoY2hhci10by1zdHJpbmcgNDApID0+IG9wZW5pbmcgcGFyZW50aGVzaXMKKyAgICAg ICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgNDApCisgICAgICAgICAgICAgICAgICAgICAgIDs7 OyAoY2hhci10by1zdHJpbmcgOTEpID0+IG9wZW5pbmcgc3F1YXJlIGJyYWNrZXQKKyAgICAgICAg ICAgICAgICAgICAgICAgKD0gb2NoYXIgOTEpCisgICAgICAgICAgICAgICAgICAgICAgIDs7OyAo Y2hhci10by1zdHJpbmcgMTIzKSA9PiBvcGVuaW5nIHdhdnkgYnJhY2tldAorICAgICAgICAgICAg ICAgICAgICAgICAoPSBvY2hhciAxMjMpKSkKKyAgICAgICAgICAgICAgICAobWluICgxKyBvcG9p bnQpIChwb2ludC1tYXgpKSkKKyAgICAgICAgICAgICAoKG9yIDs7OyAoY2hhci10by1zdHJpbmcg NDEpID0+IGNsb3NpbmcgcGFyZW50aGVzaXMKKyAgICAgICAgICAgICAgICAgICg9IHByZWNlZGlu Zy1jaGFyIDQxKQorICAgICAgICAgICAgICAgICAgOzs7IChjaGFyLXRvLXN0cmluZyA5MykgPT4g Y2xvc2luZyBzcXVhcmUgYnJhY2tldAorICAgICAgICAgICAgICAgICAgKD0gcHJlY2VkaW5nLWNo YXIgOTMpCisgICAgICAgICAgICAgICAgICA7OzsgKGNoYXItdG8tc3RyaW5nIDEyNSkgPT4gY2xv c2luZyB3YXZ5IGJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICg9IHByZWNlZGluZy1jaGFyIDEy NSkpCisgICAgICAgICAgICAgICAgKG1heCAocG9pbnQtbWluKSAoMS0gb3BvaW50KSkpCisgICAg ICAgICAgICAgKHQKKyAgICAgICAgICAgICAgICBvcG9pbnQpKSkKKyAgICAgICAgIHBvczIKKyAg ICAgICAgIHNlbGVjdGVkLWZhY2UpCisgICAgKHNhdmUtZXhjdXJzaW9uCisgICAgICAoY29uZGl0 aW9uLWNhc2UgbmlsCisgICAgICAgICh3aGlsZSAoc2V0cSBwb3MxIChudGggMSAocGFyc2UtcGFy dGlhbC1zZXhwIGZyb20gcG9zMSkpKQorICAgICAgICAgIChzZXRxIHBvczIgKHNjYW4tc2V4cHMg cG9zMSAxKSkKKyAgICAgICAgICAoaWYgKD0gaSAxMCkKKyAgICAgICAgICAgIChzZXRxIGkgMSkK KyAgICAgICAgICAgIChzZXRxIGkgKDErIGkpKSkKKyAgICAgICAgICAoc2V0cSBzZWxlY3RlZC1m YWNlIChjb25kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDEpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLW9uZS1mYWNlKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSAyKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICcrLXBhcmVucy10d28tZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKCg9IGkgMykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1w YXJlbnMtdGhyZWUtZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkg NCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtZm91ci1mYWNl KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA1KQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1maXZlLWZhY2UpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICgoPSBpIDYpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJystcGFyZW5zLXNpeC1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAoKD0gaSA3KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1z ZXZlbi1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA4KQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1laWdodC1mYWNlKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA5KQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICcrLXBhcmVucy1uaW5lLWZhY2UpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICgoPSBpIDEwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICcrLXBhcmVucy10ZW4tZmFjZSkpKQorICAgICAgICAgIChsZXQgKChvdiAobWFrZS1vdmVybGF5 IHBvczEgKDErIHBvczEpKSkpCisgICAgICAgICAgICAodW5sZXNzICstcGFyZW5zLWluYWN0aXZl LXdpbmRvd3MKKyAgICAgICAgICAgICAgKG92ZXJsYXktcHV0IG92ICd3aW5kb3cgd2luKSkKKyAg ICAgICAgICAgIChvdmVybGF5LXB1dCBvdiAnZmFjZSBzZWxlY3RlZC1mYWNlKSkKKyAgICAgICAg ICAod2hlbiBwb3MyCisgICAgICAgICAgICAobGV0ICgob3YgKG1ha2Utb3ZlcmxheSAoMS0gcG9z MikgcG9zMikpKQorICAgICAgICAgICAgICAodW5sZXNzICstcGFyZW5zLWluYWN0aXZlLXdpbmRv d3MKKyAgICAgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ3dpbmRvdyB3aW4pKQorICAgICAg ICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ2ZhY2Ugc2VsZWN0ZWQtZmFjZSkpKSkKKyAgICAgICAg KGVycm9yIG5pbCkpKQorICAgIChzZXRxICstcGFyZW5zLW92ZXJsYXlzLWV4aXN0LXAgdCkpKQor CisoZGVmdW4gKy1yZW1vdmUtb3ZlcmxheXMgKGJlZyBlbmQgbmFtZSB2YWwpCisiUmVtb3ZlIHRo ZSBvdmVybGF5cyB0aGF0IGFyZSBgZXF1YWwtaW5jbHVkaW5nLXByb3BlcnRpZXNgLgorSW5jbHVk ZXMgYSB1bmlxdWUgc2l0dWF0aW9uIHdoZW4gYW4gb3ZlcmxheSB3aXRoIGFuIGAnYWZ0ZXItc3Ry aW5nYCBwcm9wZXJ0eQoraXMgYXQgdGhlIHZlcnkgZW5kIG9mIGEgbmFycm93ZWQtYnVmZmVyLiIK KyAgKGxldCogKChwb2ludC1tYXggKHBvaW50LW1heCkpCisgICAgICAgICAocG9pbnQtbWluIChw b2ludC1taW4pKQorICAgICAgICAgKG5hcnJvd2VkLXAgKGJ1ZmZlci1uYXJyb3dlZC1wKSkKKyAg ICAgICAgIChiZWcgKGlmIGJlZyBiZWcgcG9pbnQtbWluKSkKKyAgICAgICAgIChlbmQKKyAgICAg ICAgICAgKGNvbmQKKyAgICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAobm90IG5h cnJvd2VkLXApCisgICAgICAgICAgICAgICAgIGVuZCkKKyAgICAgICAgICAgICAgIGVuZCkKKyAg ICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAobm90IG5hcnJvd2VkLXApCisgICAg ICAgICAgICAgICAgIChudWxsIGVuZCkpCisgICAgICAgICAgICAgICBwb2ludC1tYXgpCisgICAg ICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFycm93ZWQtcAorICAgICAgICAgICAg ICAgICBlbmQKKyAgICAgICAgICAgICAgICAgKDwgZW5kIHBvaW50LW1heCkpCisgICAgICAgICAg ICAgICBlbmQpCisgICAgICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFycm93ZWQt cAorICAgICAgICAgICAgICAgICBlbmQKKyAgICAgICAgICAgICAgICAgKD0gZW5kIHBvaW50LW1h eCkpCisgICAgICAgICAgICAgICAoMSsgZW5kKSkKKyAgICAgICAgICAgICAoKGFuZAorICAgICAg ICAgICAgICAgICBuYXJyb3dlZC1wCisgICAgICAgICAgICAgICAgIChudWxsIGVuZCkpCisgICAg ICAgICAgICAgICAoMSsgcG9pbnQtbWF4KSkgKSkKKyAgICAgICAgIChvdmVybGF5cworICAgICAg ICAgICAocHJvZ24KKyAgICAgICAgICAgICAob3ZlcmxheS1yZWNlbnRlciBlbmQpCisgICAgICAg ICAgICAgKG92ZXJsYXlzLWluIGJlZyBlbmQpKSkpCisgICAgKHdoZW4gKGFuZCBiZWcgZW5kIG5h bWUgdmFsKQorICAgICAgKGRvbGlzdCAobyBvdmVybGF5cykKKyAgICAgICAgKGNvbmQKKyAgICAg ICAgICAoKGFuZCAoZXEgbmFtZSAnZmFjZSkKKyAgICAgICAgICAgICAgICAoZXEgKG92ZXJsYXkt Z2V0IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIDs7IEVpdGhlciBwdXNoIHRoaXMgb3Zlcmxh eSBvdXRzaWRlIGJlZy4uLmVuZAorICAgICAgICAgICAgOzsgb3Igc3BsaXQgaXQgdG8gZXhjbHVk ZSBiZWcuLi5lbmQKKyAgICAgICAgICAgIDs7IG9yIGRlbGV0ZSBpdCBlbnRpcmVseSAoaWYgaXQg aXMgY29udGFpbmVkIGluIGJlZy4uLmVuZCkuCisgICAgICAgICAgICAoaWYgKDwgKG92ZXJsYXkt c3RhcnQgbykgYmVnKQorICAgICAgICAgICAgICAgIChpZiAoPiAob3ZlcmxheS1lbmQgbykgZW5k KQorICAgICAgICAgICAgICAocHJvZ24KKyAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IChj b3B5LW92ZXJsYXkgbykKKyAgICAgICAgICAgICAgICAgIChvdmVybGF5LXN0YXJ0IG8pIGJlZykK KyAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVuZCBvKSkpCisg ICAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gKG92ZXJsYXktc3RhcnQgbykgYmVnKSkK KyAgICAgICAgICAgICAgKGlmICg+IChvdmVybGF5LWVuZCBvKSBlbmQpCisgICAgICAgICAgICAg ICAgICAobW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVuZCBvKSkKKyAgICAgICAgICAgICAg ICAoZGVsZXRlLW92ZXJsYXkgbykpKSkK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aXgtYXJnICcoNCkpKQorICAgICAgICAoZ2xvYmFs LWVsZG9jLW1vZGUgLTEpKQorICAgICAgKHdoZW4gKGFuZCBqaXQtbG9jay1jb250ZXh0LXRpbWVy CisgICAgICAgICAgICAgICAgIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAg ICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVu ICh0aW1lcnAgaml0LWxvY2stY29udGV4dC10aW1lcikKKyAgICAgICAgICAoY2FuY2VsLXRpbWVy IGppdC1sb2NrLWNvbnRleHQtdGltZXIpKQorICAgICAgICA7OyAoc2V0cSBqaXQtbG9jay1jb250 ZXh0LXRpbWVyIChydW4td2l0aC1pZGxlLXRpbWVyIDUuMCAncmVwZWF0ICdqaXQtbG9jay1jb250 ZXh0LWZvbnRpZnkpKQorICAgICAgICAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIG5pbCkp CisgICAgICAod2hlbiAoYW5kIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAg ICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVu ICh0aW1lcnAgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpCisgICAgICAgICAgKGNh bmNlbC10aW1lciB1bmRvLWF1dG8tY3VycmVudC1ib3VuZGFyeS10aW1lcikpCisgICAgICAgIChm c2V0ICd1bmRvLWF1dG8tLXVuZG9hYmxlLWNoYW5nZQorICAgICAgICAgICAgICAobGFtYmRhICgp IChhZGQtdG8tbGlzdCAndW5kby1hdXRvLS11bmRvYWJseS1jaGFuZ2VkLWJ1ZmZlcnMgKGN1cnJl bnQtYnVmZmVyKSkpKQorICAgICAgICAoZnNldCAndW5kby1hdXRvLWFtYWxnYW1hdGUgJ2lnbm9y ZSkpCisgICAgICAod2hlbiBibGluay1jdXJzb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isgICJGYWNlIGZvciBgKy1iYXItYXQtenYtZmFjZScuIgorICA6Z3Jv dXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1iYXItcG9zdC16di1mYWNlCisgICcoKHQgKDpmb3Jl Z3JvdW5kICJtYWdlbnRhNCIpKSkKKyAgIkZhY2UgZm9yIGArLWJhci1wb3N0LXp2LWZhY2UnLiIK KyAgOmdyb3VwICcrLW1vZGUpCisKKyhkZWZmYWNlICstcmV2ZXJzZWQtYmFyLXByZS16di1mYWNl CisgICcoKHQgKDpmb3JlZ3JvdW5kICJjeWFuMSIpKSkKKyAgIkZhY2UgZm9yIGArLXJldmVyc2Vk LWJhci1wcmUtenYtZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1yZXZl cnNlZC1iYXItYXQtenYtZmFjZQorICAnKCh0ICg6Zm9yZWdyb3VuZCAiY2hhcnRyZXVzZSIpKSkK KyAgIkZhY2UgZm9yIGArLXJldmVyc2VkLWJhci1hdC16di1mYWNlJy4iCisgIDpncm91cCAnKy1t b2RlKQorCisoZGVmZmFjZSArLXJldmVyc2VkLWJhci1wb3N0LXp2LWZhY2UKKyAgJygodCAoOmZv cmVncm91bmQgImN5YW40IikpKQorICAiRmFjZSBmb3IgYCstcmV2ZXJzZWQtYmFyLXBvc3QtenYt ZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1ldmVuLXByZS16di1mYWNl CisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBkYXJrKSkK KyAgICAgOmZvcmVncm91bmQgInllbGxvdyIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29s b3JzIDg4KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJjeWFuMSIpCisg ICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDE2KSAoYmFja2dyb3VuZCBkYXJrKSkKK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QgInBpbmsiKSkKKyAgIkZhY2UgZm9yIGAr LWV2ZW4taW5hY3RpdmUtcHJlLXp2LWZhY2UnLiIKKyAgOmdyb3VwICcrLW1vZGUpCisKKyhkZWZm YWNlICstZXZlbi1hdC16di1mYWNlCisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4 KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgIkRlZXBQaW5rMSIpCisgICAg KCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAg IDpmb3JlZ3JvdW5kICJEZWVwUGluazEiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9y cyAxNikgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJEZWVwUGluazEiKQor ICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQpKQor ICAgICA6Zm9yZWdyb3VuZCAiRGVlcFBpbmsxIikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1j b2xvcnMgOCkpCisgICAgIDpmb3JlZ3JvdW5kICJ3aGl0ZSIpCisgICAgKCgodHlwZSB0dHkpIChj bGFzcyBtb25vKSkKKyAgICAgOmludmVyc2UtdmlkZW8gdCkKKyAgICAodCA6Zm9yZWdyb3VuZCAi cGluayIpKQorICAiRmFjZSBmb3IgYCstZXZlbi1hdC16di1mYWNlJy4iCisgIDpncm91cCAnKy1t b2RlKQorCisoZGVmZmFjZSArLWV2ZW4taW5hY3RpdmUtYXQtenYtZmFjZQorICAnKCgoKGNsYXNz IGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3Jv dW5kICJEZWVwUGluazQiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJh Y2tncm91bmQgbGln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ICAgICA6Zm9yZWdyb3VuZCAiRGFya1NhbG1vbiIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4t Y29sb3JzIDE2KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTEi KQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQp KQorICAgICA6Zm9yZWdyb3VuZCAiRGFya1NhbG1vbiIpCisgICAgKCgoY2xhc3MgY29sb3IpICht aW4tY29sb3JzIDgpKQorICAgICA6Zm9yZWdyb3VuZCAid2hpdGUiKQorICAgICgoKHR5cGUgdHR5 KSAoY2xhc3MgbW9ubykpCisgICAgIDppbnZlcnNlLXZpZGVvIHQpCisgICAgKHQgOmZvcmVncm91 bmQgInBpbmsiKSkKKyAgIkZhY2UgZm9yIGArLW9kZC1wb3N0LXp2LWZhY2UnLiIKKyAgOmdyb3Vw ICcrLW1vZGUpCisKKyhkZWZmYWNlICstb2RkLWluYWN0aXZlLXBvc3QtenYtZmFjZQorICAnKCgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpm b3JlZ3JvdW5kICJzaWVubmE0IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgODgp IChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTQiKQorICAgICgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpm b3JlZ3JvdW5kICJzaWVubmE0IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgMTYp IChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTQiKQorICAgICgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4KSkKKyAgICAgO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uZCBsaWdodCkpCisgICAg IDpmb3JlZ3JvdW5kICJEYXJrT2xpdmVHcmVlbiIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4t Y29sb3JzIDE2KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgIlBhbGVHcmVl bjQiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGln aHQpKQorICAgICA6Zm9yZWdyb3VuZCAiRGFya09saXZlR3JlZW4iKQorICAgICgoKGNsYXNzIGNv bG9yKSAobWluLWNvbG9ycyA4KSkKKyAgICAgOmZvcmVncm91bmQgIndoaXRlIikKKyAgICAoKCh0 eXBlIHR0eSkgKGNsYXNzIG1vbm8pKQorICAgICA6aW52ZXJzZS12aWRlbyB0KQorICAgICh0IDpm b3JlZ3JvdW5kICJwaW5rIikpCisgICJGYWNlIGZvciBgKy1wb3N0LWZpbGwtaW5hY3RpdmUtcG9z dC16di1mYWNlJy4iCisgIDpncm91cCAnKy1tb2RlKQorCisoZGVmZmFjZSBmYy1wcmUtenYtZmFj ZQorICAnKCgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykp CisgICAgIDpmb3JlZ3JvdW5kICJncmV5MTUiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNv bG9ycyA4OCkgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3VuZCAiZ3JleTE1IikK KyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgMTYpIChiYWNrZ3JvdW5kIGRhcmspKQor ICAgICA6Zm9yZWdyb3VuZCAiZ3JleTE1IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xv cnMgMTYpIChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgImdyZXkxNSIpCisg ICAgKCgoY2xhc3MgY29sb3IpICh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kKKyAgICAgOmZvcmVncm91bmQgInllbGxvdyIpCisgICAg KCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDE2KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAg IDpmb3JlZ3JvdW5kICJ5ZWxsb3ciKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4 KSkKKyAgICAgOmZvcmVncm91bmQgIndoaXRlIikKKyAgICAoKCh0eXBlIHR0eSkgKGNsYXNzIG1v bm8pKQorICAgICA6aW52ZXJzZS12aWRlbyB0KQorICAgICh0IDpmb3JlZ3JvdW5kICJwaW5rIikp CisgICJGYWNlIGZvciBgZmMtaW5hY3RpdmUtYXQtenYtZmFjZScgaW4gdGhlIGluYWN0aXZlIHdp bmRvdy4iCisgIDpncm91cCAnKy1tb2RlKQorCisoZGVmZmFjZSBmYy1wb3N0LXp2LWZhY2UKKyAg JygoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgODgpIChiYWNrZ3JvdW5kIGRhcmspKQorICAg ICA6Zm9yZWdyb3VuZCAiZ3JheTQwIikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMg ODgpIChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgImdyZXk1NSIpCisgICAg KCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDE2KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAg OmZvcmVncm91bmQgImdyYXk0MCIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDE2 KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJncmV5NTUiKQorICAgICgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4KSkKKyAgICAgOmZvcmVncm91bmQgIndoaXRlIikK KyAgICAoKCh0eXBlIHR0eSkgKGNsYXNzIG1vbm8pKQorICAgICA6aW52ZXJzZS12aWRlbyB0KQor ICA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jX2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQorCisvKiBlbmQgTVVM VElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogc3RhdGljIHZv aWQKIGJzZXRfYWJicmV2X21vZGUgKHN0cnVjdCBidWZmZXIgKmIsIExpc3BfT2JqZWN0IHZhbCkK IHsKQEAgLTUxNDUsNiArNTIwOCwyNCBAQCBpbml0X2J1ZmZlcl9vbmNlICh2b2lkKQogICBic2V0 X2xhc3Rfc2VsZWN0ZWRfd2luZG93ICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBtYWtlX2ZpeG51bSAo MCkpOwogCiAgIGlkeCA9IDE7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKyAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxfZmxh Z3MsIG1jX3JlYWxfZmFrZV9jdXJzb3IpLCBpZHgpOyArK2lkeDsKKyAgWFNFVEZBU1RJTlQgKEJW QVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIG1jX2NvbmYpLCBpZHgpOyArK2lkeDsKKyAgWFNFVEZB U1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIG1jX2luYWN0aXZlX3dpbmRvd3MpLCBp ZHgpOyArK2lkeDsKKyAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIGNy b3NzaGFpcnMpLCBpZHgpOyArK2lkeDsKKyAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9j YWxfZmxhZ3MsIGNoX2hvcml6b250YWxfcnVsZXIpLCBpZHgpOyArK2lkeDsKKyAgWFNFVE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ZCwgY29uc3QgY2hhciAq bmFtZXN0cmluZywKIHZvaWQKIHN5bXNfb2ZfYnVmZmVyICh2b2lkKQogeworCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIERFRlNZTSAoUW1j X3JlYWxfZmFrZV9jdXJzb3IsICJtYy1yZWFsLWZha2UtY3Vyc29yIik7CisgIERFRlZBUl9QRVJf QlVGRkVSICgibWMtcmVhbC1mYWtlLWN1cnNvciIsICZCVkFSIChjdXJyZW50X2J1ZmZlciwgbWNf cmVhbF9mYWtlX2N1cnNvciksIFFuaWwsCisgICAgZG9jOiAvKiBBIGJ1ZmVyLWxvY2FsIHZhcmlh YmxlIHRvIHNldCB0aGUgY3Vyc29yIHR5cGUgb2YgdGhlIHJlYWwgZmFrZSBjdXJzb3IuICovKTsK KworICBERUZTWU0gKFFtY19jb25mLCAibWMtY29uZiIpOworICBERUZWQVJfUEVSX0JVRkZFUiAo Im1jLWNvbmYiLCAmQlZBUiAoY3VycmVudF9idWZmZXIsIG1jX2NvbmYpLCBRbmlsLAorICAgIGRv YzogLyogQSBidWZlci1sb2NhbCB2YXJpYWJsZSB0byBzdG9yZSB0aGUgdmFsdWUgb2YgdGhlIG11 bHRpcGxlIGN1cnNvcnMgdG8gYmUgZGlzcGxheWVkCitkdXJpbmcgdGhlIG5leHQgcmVkaXNwbGF5 LiAqLyk7CisKKyAgREVGU1lNIChRbWNfaW5hY3RpdmVfd2luZG93cywgIm1jLWluYWN0aXZlLXdp bmRvd3MiKTsKKyAgREVGVkFSX1BFUl9CVUZGRVIgKCJtYy1pbmFjdGl2ZS13aW5kb3dzIiwgJkJW QVIgKGN1cnJlbnRfYnVmZmVyLCBtY19pbmFjdGl2ZV93aW5kb3dzKSwgUW5pbCwKKyAgICBkb2M6 IC8qIFdoZW4gbm9uLW5pbCwgZHJhdy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AppbmRleCAyMDgwYTZmLi4xYWRhOTNlIDEwMDY0NAotLS0g YS9zcmMvYnVmZmVyLmgKKysrIGIvc3JjL2J1ZmZlci5oCkBAIC03NDAsNiArNzQwLDQwIEBAIHN0 cnVjdCBidWZmZXIKICAgICAgaW4gdGhlIGRpc3BsYXkgb2YgdGhpcyBidWZmZXIuICAqLwogICBM aXNwX09iamVjdCBleHRyYV9saW5lX3NwYWNpbmdfOwogCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8qIFRoZSBjdXJzb3IgdHlwZSBvZiB0 aGUgcmVhbCBmYWtlIGN1cnNvci4gKi8KKyAgTGlzcF9PYmplY3QgbWNfcmVhbF9mYWtlX2N1cnNv cl87CisKKyAgLyogVGhlIG5hbWUgb2YgbGlzdCB1c2VkIGJ5IG11bHRpcGxlIGN1cnNvcnMgZm9y IG5leHQgcmVkaXNwbGF5LiAqLworICBMaXNwX09iamVjdCBtY19jb25mXzsKKworICAvKiBXaGV0 aGVyIHRvIGRyYXcgbXVsdGlwbGUgY3Vyc29ycyBpbiBpbmFjdGl2ZSB3aW5kb3dzLiAqLworICBM aXNwX09iamVjdCBtY19pbmFjdGl2ZV93aW5kb3dzXzsKKworICAvKiBUaGUgbmFtZSBvZiB0aGUg YnVmZmVyLWxvY2FsIHZhcmlhYmxlLiAqLworICBMaXNwX09iamVjdCBjcm9zc2hhaXJzXzsKKwor ICAvKiBUaGUgbmFtZSBvZiB0aGUgY3Jvc3NoYWlycyBob3Jpem9udGFsIHJ1bGVyLiAqLworICBM aXNwX09iamVjdCBjaF9ob3Jpem9udGFsX3J1bGVyXzsKKworICAvKiBUaGUgbmFtZSBvZiB0aGUg Y3Jvc3NoYWlycyB2ZXJ0aWNhbCBydWxlci4gKi8KKyAgTGlzcF9PYmplY3QgY2hfdmVydGljYWxf cnVsZXJfOworCisgIC8qIFdoZXRoZXIgdG8gZHJhdyBjcm9zc2hhaXJzIGluIGluYWN0aXZlIHdp bmRvd3MuICovCisgIExpc3BfT2JqZWN0IGNoX2luYWN0aXZlX3dpbmRvd3NfOworCisgIC8qIFRo ZSBuYW1lIG9mIHRoZSBidWZmZXItbG9jYWwgdmFyaWFibGUuICovCisgIExpc3BfT2JqZWN0IGZj X3Zpc2libGVfOworCisgIC8qIFdoZXRoZXIgdG8gZHJhdyBtdWx0aXBsZSBjdXJzb3JzIGZpbGwg Y29sdW1uIGluIGluYWN0aXZlIHdpbmRvd3MuICovCisgIExpc3BfT2JqZWN0IGZjX2luYWN0aXZl X3dpbmRvd3NfOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIEN1cnNvciB0 eXBlIHRvIGRpc3BsYXkgaW4gbm9uLXNlbGVjdGVkIHdpbmRvd3MuCiAgICAgIHQgbWVhbnMgdG8g dXNlIGhvbGxvdyBib3ggY3Vyc29yLgogICAgICBTZWUgYGN1cnNvci10eXBlJyBmb3Igb3RoZXIg dmFsdWVzLiAgKi8KQEAgLTc5MSwxNCArODI1LDIxIEBAIHN0cnVjdCBidWZmZXIKICAgICAgYW4g aW5kaXJlY3QgYnVmZmVyIHNpbmNlIGl0IGNvdW50cyBhcyBpdHMgYmFzZSBidWZmZXIuICAqLwog ICBpbnQgd2luZG93X2NvdW50OwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCiAgIC8qIEEgbm9uLXplcm8gdmFsdWUgaW4gc2xvdCBJRFggbWVh bnMgdGhhdCBwZXItYnVmZmVyIHZhcmlhYmxlCiAgICAgIHdpdGggaW5kZXggSURYIGhhcyBhIGxv Y2FsI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HRob3NlIGZpbGVzLikgICovCisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKK0lOTElO RSB2b2lkCitic2V0X2Jsdl9tY19yZWFsX2Zha2VfY3Vyc29yIChzdHJ1Y3QgYnVmZmVyICpiLCBM aXNwX09iamVjdCB2YWwpCit7CisgIGItPm1jX3JlYWxfZmFrZV9jdXJzb3JfID0gdmFsOworfQor CitJTkxJTkUgdm9pZAorYnNldF9ibHZfbWNfY29uZiAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9P YmplY3QgdmFsKQoreworICBiLT5tY19jb25mXyA9IHZhbDsKK30KKworSU5MSU5FIHZvaWQKK2Jz ZXRfYmx2X21jX2luYWN0aXZlX3dpbmRvd3MgKHN0cnVjdCBidWZmZXIgKmIsIExpc3BfT2JqZWN0 IHZhbCkKK3sKKyAgYi0+bWNfaW5hY3RpdmVfd2luZG93c18gPSB2YWw7Cit9CisKK0lOTElORSB2 b2lkCitic2V0X2Jsdl9jcm9zc2hhaXJzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2 YWwpCit7CisgIGItPmNyb3NzaGFpcnNfID0gdmFsOworfQorCitJTkxJTkUgdm9pZAorYnNldF9i bHZfY2hfaG9yaXpvbnRhbF9ydWxlciAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFs KQoreworICBiLT5jaF9ob3Jpem9udGFsX3J1bGVyXyA9IHZhbDsKK30KKworSU5MSU5FIHZvaWQK K2JzZXRfYmx2X2NoX3ZlcnRpY2FsX3J1bGVyIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVj dCB2YWwpCit7CisgIGItPmNoX3ZlcnRpY2FsX3J1bGVyXyA9IHZhbDsKK30KKworSU5MSU5FIHZv aWQKK2JzZXRfYmx2X2NoX2luYWN0aXZlX3dpbmRvd3MgKHN0cnVjdCBidWZmZXIgKmIsIExpc3Bf T2JqZWN0IHZhbCkKK3sKKyAgYi0+Y2hfaW5hY3RpdmVfd2luZG93c18gPSB2YWw7Cit9CisKK0lO TElORSB2b2lkCitic2V0X2Jsdl9mY192aXNpYmxlIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09i amVjdCB2YWwpCit7CisgIGItPmZjX3Zpc2libGVfID0gdmFsOworfQorCitJTkxJTkUgdm9pZAor YnNldF9ibHZfZmNfaW5hY3RpdmVfd2luZG93cyAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmpl Y3QgdmFsKQoreworICBiLT5mY19pbmFjdGl2ZV93aW5kb3dzXyA9IHZhbDsKK30KKworLyogZW5k IE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIElOTElO RSB2b2lkCiBic2V0X2JpZGlfcGFyYWdyYXBoX2RpcmVjdGlvbiAoc3RydWN0IGJ1ZmZlciAqYiwg TGlzcF9PYmplY3QgdmFsKQogewpkaWZmIC0tZ2l0IGEvc3JjL2Rpc3BleHRlcm4uaCBiL3NyYy9k aXNwZXh0ZXJuLmgKaW5kZXggNGU5NDdkYS4uODZhZGVhMyAxMDA2NDQKLS0tIGEvc3JjL2Rpc3Bl eHRlcm4uaAorKysgYi9zcmMvZGlzcGV4dGVybi5oCkBAIC0xNDUsNiArMTQ1LDEzMSBAQCB0eXBl ZGVmIHZvaWQgKkVtYWNzX0N1cnNvcjsKICNkZWZpbmUgTmF0aXZlUmVjdGFuZ2xlIGludAogI2Vu ZGlmCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJT T1JT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N0cnVjdCBnbHlwaF9yb3cgKiwgaW50LAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlKTsKKworZXh0ZXJuIGludCBtY19nZXRfZnJp bmdlX2JpdG1hcCAoc3RydWN0IHdpbmRvdyAqLCBMaXNwX09iamVjdCwgaW50LCBpbnQpOworCitl eHRlcm4gdm9pZCBtY19lbmdpbmUgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJp eCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBn bHlwaCAqLCBpbnQsIGludCwgaW50LCBpbnQsIGludCwgaW50LAorICAgICAgICAgICAgICAgICAg ICAgICBlbnVtIG1jX2N1cnNvcl90eXBlLCBpbnQsIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwKKyAg ICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX2Vzc2VudGlhbHMsIGVudW0gbWNfcm93X3Bv c2l0aW9uLCBzdHJ1Y3QgbWNfUkdCLAorICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2Vu Z2luZV90eXBlLCBib29sLCBlbnVtIG1jX2RyYXdfcm93X3R5cGUsCisgICAgICAgICAgICAgICAg ICAgICAgIGVudW0gbWNfY2FjaGVfdHlwZSk7CisKK2V4dGVybiB2b2lkIG1jX3NldF9lc3NlbnRp YWxzIChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBtY19lc3NlbnRpYWxzICopOworCitleHRlcm4g dm9pZCBtY19kcmF3X3JvdyAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICos IHN0cnVjdCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5 cGggKiwgaW50LCBpbnQsIGludCwgc3RydWN0IGdseXBoX21hdHJpeCAqLAorICAgICAgICAgICAg ICAgICAgICAgICAgIHN0cnVjdCBtY19lc3NlbnRpYWxzLCBlbnVtIG1jX3Jvd19wb3NpdGlvbiwg Ym9vbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2RyYXdfcm93X3R5cGUpOwor CitleHRlcm4gYm9vbCBtY19yZWRyYXdfcm93IChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlw aF9tYXRyaXggKiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgZW51bSBnbHlwaF9yb3dfYXJlYSwgaW50LCBpbnQsIGludCwgYm9vbCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSwgZW51bSBtY19yZWRyYXdfcm93 X3R5cGUpOworCitleHRlcm4gdm9pZCBtY19yZXNldF9jYWNoZSAoc3RydWN0IHdpbmRvdyAqKTsK KworZXh0ZXJuIHZvaWQgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHN0cnVjdCB3aW5kb3cgKiwgc3Ry dWN0IGdseXBoX21hdHJpeCAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0 cnVjdCBnbHlwaF9yb3cgKiwgZW51bSBkcmF3X2dseXBoc19mYWNlLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGludCwgaW50LCBpbnQsIHN0cnVjdCBtY19SR0IsIGVudW0gbWNf Zmxhdm9yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29y X3R5cGUsIGludCwgYm9vbCwgYm9vbCk7CisKK2V4dGVybiB2b2lkIG1jX2VyYXNlX2N1cnNvciAo c3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlwaF9yb3cg KiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBpbnQsIGludCwgaW50LCBlbnVt IG1jX2ZsYXZvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3Jf dHlwZSwgaW50KTsKKworZXh0ZXJuIHZvaWQgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHN0cnVjdCB3 aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBpbnQsIGludCwgaW50LCBpbnQsIGlu dCwgaW50LCBpbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19j dXJzb3JfdHlwZSwgaW50LCBzdHJ1Y3QgbWNfUkdCLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGJvb2wsIGVudW0gbWNfZmxhdm9yLCBib29sKTsKKworZXh0ZXJuIGludCBtY19k cmF3X2dseXBocyAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVj dCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCwgZW51bSBnbHlw aF9yb3dfYXJlYSwgcHRyZGlmZl90LCBwdHJkaWZmX3QsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UsIGludCwgaW50LCBzdHJ1Y3QgbWNfUkdCLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19mbGF2b3IsIGVudW0gbWNfY3Vyc29yX3R5 cGUsIGludCwgYm9vbCwgYm9vbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gZHJh d19nbHlwaF9hY3Rpb24sIGJvb2wpOworCitleHRlcm4gc3RydWN0IGdseXBoX21hdHJpeCAqIG1j X3NhdmVfZ2x5cGhfbWF0cml4IChzdHJ1Y3QgZ2x5cGhfbWF0cml4ICopOworCitleHRlcm4gdm9p ZCBtY19yZXN0b3JlX2dseXBoX21hdHJpeCAoc3RydWN0IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3Qg Z2x5cGhfbWF0cml4ICopOworCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogLyogVGV4dCBjdXJzb3IgdHlwZXMuICAqLwogCiBlbnVtIHRl eHRfY3Vyc29yX2tpbmRzCkBAIC00MDQsNiArNTI5LDE4IEBAIHN0cnVjdCBnbHlwaF9zbGljZQog CiBzdHJ1Y3QgZ2x5cGgKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJ UExFLUNVUlNPUlMgKi8KKworICBpbnQgcmVsYXRpdmVfeCwgaHBvczsKKworICBwdHJkaWZmX3Qg Ynl0ZXBvczsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBQb3NpdGlvbiBm cm9tIHdoaWNoIHRoaXMgZ2x5cGggd2FzIGRyYXduLiAgSWYgYG9iamVjdCcgYmVsb3cgaXMgYQog ICAgICBMaXNwIHN0cmluZywgdGhpcyBpcyBhbiBpbmRleCBpbnRvIHRoYXQgc3RyaW5nLiAgSWYg aXQgaXMgYQogICAgICBidWZmZXIsIHRoaXMgaXMgYSBwb3NpdGlvbiBpbiB0aGF0IGJ1ZmZlci4g IEluIGFkZGl0aW9uLCBzb21lCkBAIC0xMjcwLDYgKzE0MDcsMjggQEAgZW51bSBkcmF3X2dseXBo c19mYWNlCiAKIHN0cnVjdCBnbHlwaF9zdHJpbmcKIHsKKworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIGJvb2xfYmYgbGVmdF9vdmVyd3Jp dHRlbl9wIDogMTsKKworICAgIGJvb2xfYmYgcmlnaHRfb3ZlcndyaXR0ZW5fcCA6IDE7CisKKyAg ICBib29sX2JmIHJlY3RhbmdsZV9udWtlZF9wIDogMTsKKworICAgIGJvb2xfYmYgYmFja2dyb3Vu ZF9udWtlZF9wIDogMTsKKworICAgIGVudW0gZHJhd19nbHlwaF9hY3Rpb24KKyAgICB7CisgICAg ICBNQ19EUkFXX0dMWVBIX1NUUklORywKKyAgICAgIE1DX0VSQVNFX0dMWVBIX1NUUklORworICAg IH0gYWN0aW9uX3R5cGU7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogWC1v cmlnaW4gb2YgdGhlIHN0cmluZy4gICovCiAgIGludCB4OwogCkBAIC0yODM0LDYgKzI5OTMsMjgg QEAgdHlwZWRlZiB2b2lkICgqZnJhbWVfcGFybV9oYW5kbGVyKSAoc3RydWN0IGZyYW1lICosIExp c3BfT2JqZWN0LCBMaXNwX09iamVjdCk7CiAKIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlCiB7 CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK Ky8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgbnN0ZXJtLm1gIHwgYHczMnRlcm0uY2AgfCBg eHRlcm0uY2AgbXVzdCBiZSBpbiB0aGUKK2V4YWN0IHNhbWUgb3JkZXIgYXMgdGhlIGByZWRpc3Bs YXlfaW50ZXJmYWNlJyBpbiBgZGlzcGV4dG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ioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIEhhbmRsZXJzIGZvciBzZXR0aW5nIGZy YW1lIHBhcmFtZXRlcnMuICAqLwogICBmcmFtZV9wYXJtX2hhbmRsZXIgKmZyYW1lX3Bhcm1faGFu ZGxlcnM7CiAKZGlmZiAtLWdpdCBhL3NyYy9kaXNwbmV3LmMgYi9zcmMvZGlzcG5ldy5jCmluZGV4 IDAxMzFiNjMuLmZkMDUwOGIgMTAwNjQ0Ci0tLSBhL3NyYy9kaXNwbmV3LmMKKysrIGIvc3JjL2Rp c3BuZXcuYwpAQCAtNTYsNiArNTYsMTc3OCBAQCBhbG9uZyB3aXRoIEdOVSBFbWFjcy4gIElmIG5v dCwgc2VlIDxodHRwczovL3d3dy5nbnUub3JnL2xpY2Vuc2VzLz4uICAqLwogI2luY2x1ZGUgIncz Mi5oIgogI2VuZGlmCiAMCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBN VUxUSVBMRS1DVVJTT1JTICovCisKK3N0cnVjdCBnbHlwaHNfc2tpcHBlZAoreworICBwdHJkaWZm X3QgYWxsb2NhdGVkOworICBwdHJkaWZmX3QgdXNlZDsKKyAgc3RydWN0IHNraXBwZWRfaXRlbXMK KyAgICB7CisgICAgICBpbnQgeDsKKyAgICAgIGludCBocG9zOworICAgICAgYm9vbCBlbmFibGVk X3A7CisgICAgfSAqc2tpcHBlZDsKK30gYXJyYXlfZ2x5cGhzX3NraXBwZWQ7CisKK3N0cnVjdCBt Y19yb3dfZW50cnkKK3sKKyAgaW50IG9sZF91c2VzLCBuZXdfdXNlczsKKyAgaW50IG5ld19saW5l X251bWJlcjsKKyAgcHRyZGlmZl90IGJ1Y2tldDsKKyAgc3RydWN0IGdseXBoX3JvdyAqcm93Owor ICBzdHJ1Y3QgbWNfcm93X2VudHJ5ICpuZXh0OworfTsKK3N0YX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x5cGhfcm93ICos IHN0cnVjdCBnbHlwaF9yb3cgKik7CisKK3N0YXRpYyBib29sCittY192ZXJpZnlfcm93X2hhc2gg KHN0cnVjdCBnbHlwaF9yb3cgKnJvdykKK3sKKyAgcmV0dXJuIHJvdy0+aGFzaCA9PSByb3dfaGFz aCAocm93KTsKK30KKworc3RhdGljIHN0cnVjdCBtY19yb3dfZW50cnkgKgorbWNfYWRkX3Jvd19l bnRyeSAoc3RydWN0IGdseXBoX3JvdyAqcm93KQoreworICBzdHJ1Y3QgbWNfcm93X2VudHJ5ICpl bnRyeTsKKyAgcHRyZGlmZl90IGkgPSByb3ctPmhhc2ggJSBtY19yb3dfdGFibGVfc2l6ZTsKKyAg ZW50cnkgPSBtY19yb3dfdGFibGVbaV07CisgIGVhc3NlcnQgKGVudHJ5IHx8IG1jX3ZlcmlmeV9y b3dfaGFzaCAocm93KSk7CisgIHdoaWxlIChlbnRyeSAmJiAhcm93X2VxdWFsX3AgKGVudHJ5LT5y b3csIHJvdywgMSkpCisgICAgZW50cnkgPSBlbnRyeS0+bmV4dDsKKyAgaWYgKGVudHJ5ID09IE5V TEwpCisgICAgeworICAgICAgZW50cnkgPSBtY19yb3dfZW50cnlfcG9vbCArIG1jX3Jvd19lbnRy eV9pZHgrKzsKKyAgICAgIGVudHJ5LT5yb3cgPSByb3c7CisgICAgICBlbnRyeS0+b2xkX3VzZXMg PSBlbnRyeS0+bmV3X3VzZXMgPSAwOworICAgICAgZW50cnktPm5ld19saW5lX251bWJlciA9IDA7 CisgICAgICBlbnRyeS0+YnVja2V0ID0gaTsKKyAgICAgIGVudHJ5LT5uZXh0ID0gbWNfcm93X3Rh YmxlW2ldOworICAgICAgbWNfcm93X3RhYmxlW2ldID0gZW50cnk7CisgICAgfQorICByZXR1cm4g ZW50cnk7Cit9CisKK3N0cnVjdCBtY19tYXRyaXgKK21jX3NhdmVfY2FjaGVfbWF0cml4IChzdHJ1 Y3QgbWNfbWF0cml4IG1hdHJpeCkKK3sKKyA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d3MgKyBp OworICAgICAgc3RydWN0IGdseXBoX3JvdyAqdG8gPSBzYXZlZC0+cm93cyArIGk7CisgICAgICBw dHJkaWZmX3QgbmJ5dGVzID0gZnJvbS0+dXNlZFtURVhUX0FSRUFdICogc2l6ZW9mIChzdHJ1Y3Qg Z2x5cGgpOworICAgICAgdG8tPmdseXBoc1tURVhUX0FSRUFdID0geG1hbGxvYyAobmJ5dGVzKTsK KyAgICAgIG1lbWNweSAodG8tPmdseXBoc1tURVhUX0FSRUFdLCBmcm9tLT5nbHlwaHNbVEVYVF9B UkVBXSwgbmJ5dGVzKTsKKyAgICAgIHRvLT51c2VkW1RFWFRfQVJFQV0gPSBmcm9tLT51c2VkW1RF WFRfQVJFQV07CisgICAgICB0by0+aGFzaCA9IGZyb20tPmhhc2g7CisgICAgICB0by0+eCA9IGZy b20tPng7CisgICAgICB0by0+eSA9IGZyb20tPnk7CisgICAgICB0by0+cGl4ZWxfd2lkdGggPSBm cm9tLT5waXhlbF93aWR0aDsKKyAgICAgIHRvLT5hc2NlbnQgPSBmcm9tLT5hc2NlbnQ7CisgICAg ICB0by0+aGVpZ2h0ID0gZnJvbS0+aGVpZ2h0OworICAgICAgdG8tPnBoeXNfYXNjZW50ID0gZnJv bS0+cGh5c19hc2NlbnQ7CisgICAgICB0by0+cGh5c19oZWlnaHQgPSBmcm9tLT5waHlzX2hlaWdo dDsKKyAgICAgIHRvLT52aXNpYmxlX2hlaWdodCA9IGZyb20tPnZpc2libGVfaGVpZ2h0OworICAg ICAgdG8tPmV4dHJhX2xpbmVfc3BhY2luZyA9IGZyb20tPmV4dHJhX2xpbmVfc3BhY2luZzsKKyAg ICAgIHRvLT5zdGFydCA9IGZyb20tPnN0YXJ0OworICAgICAgdG8tPmVuZCA9IGZyb20tPmVuZDsK KyAgICAgIHRvLT5taW5wb3MgPSBmcm9tLT5taW5wb3M7CisgICAgICB0by0+bWF4cG9zID0gZnJv bS0+bWF4cG9zOworICAgICAgdG8tPm92ZXJsYXlfY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XR1cm4gMDsKKyAgICAgIGJvdHRvbSA9IE1BVFJJWF9ST1dfQk9U VE9NX1kgKE1BVFJJWF9ST1cgKGRlc2lyZWRfbWF0cml4LCBpKSk7CisgICAgICBpZiAoYm90dG9t IDw9IHliKQorICAgICAgICArK2k7CisgICAgICBpZiAoYm90dG9tID49IHliKQorICAgICAgICBi cmVhazsKKyAgICB9CisgIGxhc3RfbmV3ID0gaTsKKyAgLyogU2V0IGxhc3Rfb2xkIHRvIHRoZSBp bmRleCArIDEgb2YgdGhlIHJvdyB0aGF0IHJlYWNoZXMgdGhlIGJvdHRvbQorICAgICBib3VuZGFy eSBpbiB0aGUgY3VycmVudCBtYXRyaXguICBXZSBkb24ndCBsb29rIGF0IHRoZSBlbmFibGVkCisg ICAgIGZsYWcgaGVyZSBiZWNhdXNlIHdlIHBsYW4gdG8gcmV1c2UgcGFydCBvZiB0aGUgZGlzcGxh eSBldmVuIGlmCisgICAgIG90aGVyIHBhcnRzIGFyZSBkaXNhYmxlZC4gKi8KKyAgaSA9IGZpcnN0 X29sZCArIDE7CisgIHdoaWxlIChpIDwgY3VycmVudF9tYXRyaXgtPm5yb3dzIC0gMSkKKyAgICB7 CisgICAgICBpbnQgYm90dG9tID0gTUFUUklYX1JPV19CT1RUT01fWSAoTUFUUklYX1JPVyAoY3Vy cmVudF9tYXRyaXgsIGkpKTsKKyAgICAgIGlmIChib3R0b20gPD0geWIpCisgICAgICAgICsraTsK KyAgICAgIGlmIChib3R0b20gPj0geWIpCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgbGFzdF9v bGQgPSBpOworICAvKiBTa2lwIG92ZXIgcm93cyBlcXVhbCBhdCB0aGUgYm90dG9tLiAqLworICBp ID0gbGFzdF9uZXc7CisgIGogPSBsYXN0X29sZDsKKyAgd2hpbGUgKGkgLSAxID4gZmlyc3RfbmV3 CisgICAgICAgICAmJiBqIC0gMSA+IGZpcnN0X29sZAorICAgICAgICAgJiYgTUFUUklYX1JPV19F TkFCTEVEX1A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VQgLSAxLiAgSWYgTkVYVF9BTE1PU1RfUFJJ TUVfTElNSVQgd2VyZQorICAgICAxMywgdGhlbiBuZXh0X2FsbW9zdF9wcmltZV9pbmNyZW1lbnRf bWF4IHdvdWxkIGJlIDE0LCBlLmcuLAorICAgICBiZWNhdXNlIG5leHRfYWxtb3N0X3ByaW1lICgx MTMpIHdvdWxkIGJlIDEyNy4gKi8KKyAgeworICAgIHZlcmlmeSAoTkVYVF9BTE1PU1RfUFJJTUVf TElNSVQgPT0gMTEpOworICAgIGVudW0geyBuZXh0X2FsbW9zdF9wcmltZV9pbmNyZW1lbnRfbWF4 ID0gMTAgfTsKKyAgICBwdHJkaWZmX3Qgcm93X3RhYmxlX21heCA9CisgICAgICAobWluIChQVFJE SUZGX01BWCwgU0laRV9NQVgpIC8gKDMgKiBzaXplb2YgKm1jX3Jvd190YWJsZSkKKyAgICAgICAt IG5leHRfYWxtb3N0X3ByaW1lX2luY3JlbWVudF9tYXgpOworICAgIHB0cmRpZmZfdCBjdXJyZW50 X25yb3dzX21heCA9IHJvd190YWJsZV9tYXggLSBkZXNpcmVkX21hdHJpeC0+bnJvd3M7CisgICAg aWYgKGN1cnJlbnRfbnJvd3NfbWF4IDwgY3VycmVudF9tYXRyaXgtPm5yb3dzKQorICAgICAgbWVt b3J5X2Z1bGwgKFNJWkVfTUFYKTsKKyAgfQorICAvKiBSZWFsbG9jYXRlIHZlY3RvcnMsIHRhYmxl cyBldGMuIGlmIG5lY2Vzc2FyeS4gKi8KKyAgaWYgKGN1cnJlbnRfbWF0cml4LT5ucm93cyA+IG1j X29sZF9saW5lc19zaXplKQorICAgIG1jX29sZF9saW5lcyA9IHhwYWxsb2MgKG1jX29sZF9saW5l cywgJm1jX29sZF9saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRf bWF0cml4LT5ucm93cyAtIG1jX29sZF9saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAg ICAgIElOVF9NQVgsIHNpemVvZiAqbWNfb2xkX2xpbmVzKTsKKyAgaWYgKGRlc2lyZWRfbWF0cml4 LT5ucm93cyA+IG1jX25ld19saW5lc19zaXplKQorICAgIG1jX25ld19saW5lcyA9IHhwYWxsb2Mg KG1jX25ld19saW5lcywgJm1jX25ld19saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAg ICAgIGRlc2lyZWRfbWF0cml4LT5ucm93cyAtIG1jX25ld19saW5lc19zaXplLAorICAgICAgICAg ICAgICAgICAgICAgICAgIElOVF9NQVgsIHNpemVvZiAqbWNfbmV3X2xpbmVzKTsKKyAgbiA9IGRl c2lyZWRfbWF0cml4LT5ucm93czsKKyAgbiArPSBjdXJyZW50X21hdHJpeC0+bnJvd3M7CisgIGlm IChtY19yb3dfdGFibGVfc2l6ZSA8IDMgKiBuKQorICAgIHsKKyAgICAgIHB0cmRpZmZfdCBzaXpl ID0gbmV4dF9hbG1vc3RfcHJpbWUgKDMgKiBuKTsKKyAgICAgIG1jX3Jvd190YWJsZSA9IHhucmVh bGxvYyAobWNfcm93X3RhYmxlLCBzaXplLCBzaXplb2YgKm1jX3Jvd190YWJsZSk7CisgICAgICBt Y19yb3dfdGFibGVfc2l6ZSA9IHNpemU7CisgICAgICBtZW1zZXQgKG1jX3Jvd190YWJsZSwgMCwg c2l6ZSAqIHNpemVvZiAqbWNfcm93X3RhYmxlKTsKKyAgICB9CisgIGlmIChuID4gbWNfcm93X2Vu dHJ5X3Bvb2xfc2l6ZSkKKyAgICBtY19yb3dfZW50cnlfcG9vbCA9IHhwYWxsb2MgKG1jX3Jvd19l bnRyeV9wb29sLCAmbWNfcm93X2VudHJ5X3Bvb2xfc2l6ZSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIG4gLSBtY19yb3dfZW50cnlfcG9vbF9zaXplLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgLTEsIHNpemVvZiAqbWNfcm93X2VudHJ5X3Bvb2wpOworICBpZiAoZGVzaXJl ZF9tYXRyaXgtPm5yb3dzID4gbWNfcnVuc19zaXplKQorICAgIHsKKyAgICAgIG1jX3J1bnMgPSB4 bnJlYWxsb2MgKG1jX3J1bnMsIGRlc2lyZWRfbWF0cml4LT5ucm93cywgc2l6ZW9mICptY19ydW5z KTsKKyAgICAgIG1jX3J1bl9wb29sID0geG5yZWFsbG9jIChtY19ydW5fcG9vbCwgZGVzaXJlZF9t YXRyaXgtPm5yb3dzLCBzaXplb2YgKm1jX3J1bl9wb29sKTsKKyAgICAgIG1jX3J1bnNfc2l6ZSA9 IGRlc2lyZWRfbWF0cml4LT5ucm93czsKKyAgICB9CisgIG5ydW5zID0gcnVuX2lkeCA9IDA7Cisg IG1jX3Jvd19lbnRyeV9pZHggPSAwOworICAvKiBBZGQgcm93cyBmcm9tIHRoZSBjdXJyZW50IGFu ZCBkZXNpcmVkIG1hdHJpeCB0byB0aGUgaGFzaCB0YWJsZQorICAgICByb3dfaGFzaF90YWJsZSB0 byBiZSBhYmxlIHRvIGZpbmQgZXF1YWwgb25lcyBxdWlja2x5LiAqLworICBmb3IgKGkgPSBmaXJz dF9vbGQ7IGkgPCBsYXN0X29sZDsgKytpKQorICAgIHsKKyAgICAgIGlmIChNQVRSSVhfUk9XX0VO QUJMRURfUCAoY3VycmVudF9tYXRyaXgsIGkpKQorICAgICAgICB7CisgICAgICAgICAgZW50cnkg PSBtY19hZGRfcm93X2VudHJ5IChNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSkpOworICAg ICAgICAgIG1jX29sZF9saW5lc1tpXSA9IGVudHJ5OworICAgICAgICAgICsrZW50cnktPm9sZF91 c2VzOworICAgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIG1jX29sZF9saW5lc1tpXSA9IE5V TEw7CisgICAgfQorICBmb3IgKGkgPSBmaXJzdF9uZXc7IGkgPCBsYXN0X25ldzsgKytpKQorICAg IHsKKyAgICAgIGVhc3NlcnQgKE1BVFJJWF9ST1dfRU5BQkxFRF9QIChkZXNpcmVkX21hdHJpeCwg aSkpOworICAgICAgZW50cnkgPSBtY19hZGRfcm93X2VudHJ5IChNQVRSSVhfUk9XIChkZXNpcmVk X21hdHJpeCwgaSkpOworICAgICAgKytlbnRyeS0+bmV3X3VzZXM7CisgICAgICBlbnRyeS0+bmV3 X2xpbmVfbnVtYmVyID0gaTsKKyAgICAgIG1jX25ld19saW5lc1tpXSA9IGVudHJ5OworICAgIH0K KyAgLyogSWRlbnRpZnkgbW92ZXMgYmFzZWQgb24gbGluZXMgdGhhdCBhcmUgdW5pcXVlIGFuZCBl cXVhbAorICAgICBpbiBib3RoIG1hdHJpY2VzLiAqLworICBmb3IgKGkgPSBmaXJzdF9vbGQ7IGkg PCBsYXN0X29sZDspCisgICAgaWYgKG1jX29sZF9saW5lc1tpXQorICAgICAgICAmJiBtY19vbGRf bGluZXNbaV0tPm9sZF91c2VzID09IDEKKyAgICAgICAgJiYgbWNfb2xkX2xpbmVzW2ldLT5uZXdf dXNlcyA9PSAxKQorICAgICAgeworICAgICAgICBpbnQgcCwgcTsKKyAgICAgICAgaW50IG5ld19s aW5lID0gbWNfb2xkX2xpbmVzW2ldLT5uZXdfbGluZV9udW1iZXI7CisgICAgICAgIHN0cnVjdCBy dW4gKnJ1biA9IG1jX3J1bl9wb29sICsgcnVuX2lkeCsrOworICAgICAgICAvKiBSZWNvcmQgbW92 ZS4gKi8KKyAgICAgICAgcnVuLT5jdXJyZW50X3Zwb3MgPSBpOworICAgICAgICBydW4tPmN1cnJl bnRfeSA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCBpKS0+eTsKKyAgICAgICAgcnVuLT5k ZXNpcmVkX3Zwb3MgPSBuZXdfbGluZTsKKyAgICAgICAgcnVuLT5kZXNpcmVkX3kgPSBNQVRSSVhf Uk9XIChkZXNpcmVkX21hdHJpeCwgbmV3X2xpbmUpLT55OworICAgICAgICBydW4tPm5yb3dzID0g MTsKKyAgICAgICAgcnVuLT5oZWlnaHQgPSBNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSkt PmhlaWdodDsKKyAgICAgICAgLyogRXh0ZW5kIGJhY2t3YXJkLiAqLworICAgICAgICBwID0gaSAt IDE7CisgICAgICAgIHEgPSBuZXdfbGluZSAtIDE7CisgICAgICAgIHdoaWxlIChwID4gZmlyc3Rf b2xkCisgICAgICAgICAgICAgICAmJiBxID4gZmlyc3RfbmV3CisgICAgICAgICAgICAgICAmJiBt Y19vbGRfbGluZXNbcF0gPT0gbWNfbmV3X2xpbmVzW3FdKQorICAgICAgICAgIHsKKyAgICAgICAg ICAgIGludCBoID0gTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIHApLT5oZWlnaHQ7CisgICAg ICAgICAgICAtLXJ1bi0+Y3VycmVudF92cG9zOworICAgICAgICAgICAgLS1ydW4tPmRlc2lyZWRf dnBvczsKKyAgICAgICAgICAgICsrcnVuLT5ucm93czsKKyAgICAgICAgICAgIHJ1bi0+aGVpZ2h0 ICs9IGg7CisgICAgICAgICAgICBydW4tPmRlc2lyZWRfeSAtPSBoOworICAgICAgICAgICAgcnVu LT5jdXJyZW50X3kgLT0gaDsKKyAgICAgICAgICAgIC0tcCwgLS1xOworICAgICAgICAgIH0KKyAg ICAgICAgLyogRXh0ZW5kIGZvcndhcmQuICovCisgICAgICAgIHAgPSBpICsgMTsKKyAgICAgICAg cSA9IG5ld19saW5lICsgMTsKKyAgICAgICAgd2hpbGUgKHAgPCBsYXN0X29sZAorICAgICAgICAg ICAgICAgJiYgcSA8IGxhc3RfbmV3CisgICAgICAgICAgICAgICAmJiBtY19vbGRfbGluZXNbcF0g PT0gbWNfbmV3X2xpbmVzW3FdKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGludCBoID0gTUFU UklYX1JPVyAoY3VycmVudF9tYXRyaXgsIHApLT5oZWlnaHQ7CisgICAgICAgICAgICArK3J1bi0+ bnJvd3M7CisgICAgICAgICAgICBydW4tPmhlaWdodCArPSBoOworICAgICAgICAgICAgKytwLCAr K3E7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gICAgICAgICArLS0tLS0tLS0t LS0rICAgICAgICstLS0tLS0tLS0tLSsKKyAgICAgICAgICB8ICAgICBBICAgICB8ICAgICAgIHwg ICAgIEIgICAgIHwKKyAgICAgICAgICArLS0tLS0tLS0tLS0rICAtLT4gICstLS0tLS0tLS0tLSsK KyAgICAgICAgICB8ICAgICBCICAgICB8ICAgICAgIHwgICAgIEEgICAgIHwKKyAgICAgICAgICAr LS0tLS0tLS0tLS0rICAgICAgICstLS0tLS0tLS0tLSsKKyAgICAgSW5zdGVhZCwgcHJlZmVyIGJp Z2dlciBtb3ZlcywgYW5kIGludmFsaWRhdGUgbW92ZXMgdGhhdCB3b3VsZAorICAgICBjb3B5IGZy b20gd2hlcmUgd2UgY29waWVkIHRvLiAqLworICBmb3IgKGkgPSAwOyBpIDwgbnJ1bnM7ICsraSkK KyAgICBpZiAobWNfcnVuc1tpXS0+bnJvd3MgPiAwKQorICAgICAgeworICAgICAgICBzdHJ1Y3Qg cnVuICpyID0gbWNfcnVuc1tpXTsKKyAgICAgICAgaWYgKHItPmN1cnJlbnRfeSAhPSByLT5kZXNp cmVkX3kpCisgICAgICAgICAgeworICAgICAgICAgICAgLy8gIGZwcmludGYgKHN0ZGVyciwgIiVz OiAgci0+Y3VycmVudC9kZXNpcmVkX3Zwb3MgKCVkLyVkKSB8IHItPmN1cnJlbnQvZGVzaXJlZF95 ICglZC8lZClcbiIsCisgICAgICAgICAgICAvLyAgICAgICAgICAgci0+Y3VycmVudF95IDwgci0+ ZGVzaXJlZF95ID8gIuKGkyIgOiAi4oaRIiwKKyAgICAgICAgICAgIC8vICAgICAgICAgICByLT5j dXJyZW50X3Zwb3MsIHItPmRlc2lyZWRfdnBvcywgci0+Y3VycmVudF95LCByLT5kZXNpcmVkX3kp OworICAgICAgICAgICAgLy8gIHJpZi0+Y2xlYXJfd2luZG93X21vdXNlX2ZhY2UgKHcpOworICAg ICAgICAgICAgLy8gIHJpZi0+c2Nyb2xsX3J1bl9ob29rICh3LCByKTsKKyAgICAgICAgICB9Cisg ICAgICAgIC8qIFRydW5jYXRlIHJ1bnMgdGhhdCBjb3B5IHRvIHdoZXJlIHdlIGNvcGllZCB0bywg YW5kCisgICAgICAgICAgIGludmFsaWRhdGUgcnVucyB0aGF0IGNvcHkgZnJvbSB3aGVyZSB3ZSBj b3BpZWQgdG8uICovCisgICAgICAgIGZvciAoaiA9IG5ydW5zIC0gMTsgaiA+IGk7IC0taikKKyAg ICAgICAgICB7CisgICAgICAgICAgICBzdHJ1Y3QgcnVuICpwID0gbWNfcnVuc1tqXTsKKyAgICAg ICAgICAgIGJvb2wgdHJ1bmNhdGVkX3AgPSAwOworICAgICAgICAgICAgaWYgKHAtPm5yb3dzID4g MAorICAgICAgICAgICAgICAgICYmIHAtPmRlc2lyZWRfeSA8IHItPmRlc2lyZWRfeSArIHItPmhl aWdodAorICAgICAgICAgICAgICAgICYmIHAtPmRlc2lyZWRfeSArIHAtPmhlaWdodCA+IHItPmRl c2lyZWRfeSkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChwLT5kZXNpcmVk X3kgPCByLT5kZXNpcmVkX3kpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICAgIHAtPm5yb3dzID0gci0+ZGVzaXJlZF92cG9zIC0gcC0+ZGVzaXJlZF92cG9zOworICAgICAg ICAgICAgICAgICAgICBwLT5oZWlnaHQgPSByLT5kZXNpcmVkX3kgLSBwLT5kZXNpcmVkX3k7Cisg ICAgICAgICAgICAgICAgICAgIHRydW5jYXRlZF9wID0gMTsKKyAgICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAg ICAgICAgIGludCBucm93c19jb3BpZWQgPSAoci0+ZGVzaXJlZF92cG9zICsgci0+bnJvd3MKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIHAtPmRlc2lyZWRfdnBvcyk7 CisgICAgICAgICAgICAgICAgICAgIGlmIChwLT5ucm93cyA8PSBucm93c19jb3BpZWQpCisgICAg ICAgICAgICAgICAgICAgICAgcC0+bnJvd3MgPSAwOworICAgICAgICAgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAg aW50IGhlaWdodF9jb3BpZWQgPSAoci0+ZGVzaXJlZF95ICsgci0+aGVpZ2h0CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gcC0+ZGVzaXJlZF95KTsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgcC0+Y3VycmVudF92cG9zICs9IG5yb3dzX2NvcGllZDsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgcC0+ZGVzaXJlZF92cG9zICs9IG5yb3dzX2NvcGll ZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcC0+bnJvd3MgLT0gbnJvd3NfY29waWVkOwor ICAgICAgICAgICAgICAgICAgICAgICAgICBwLT5jdXJyZW50X3kgKz0gaGVpZ2h0X2NvcGllZDsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgcC0+ZGVzaXJlZF95ICs9IGhlaWdodF9jb3BpZWQ7 CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmhlaWdodCAtPSBoZWlnaHRfY29waWVkOwor ICAgICAgICAgICAgICAgICAgICAgICAgICB0cnVuY2F0ZWRfcCA9IDE7CisgICAgICAgICAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIH0KKyAgICAg ICAgICAgIGlmIChyLT5jdXJyZW50X3kgIT0gci0+ZGVzaXJlZF95CisgICAgICAgICAgICAgICAg LyogVGhlIGNvbmRpdGlvbiBiZWxvdyBpcyBlcXVpdmFsZW50IHRvCisgICAgICAgICAgICAgICAg ICAgKChwLT5jdXJyZW50X3kgPj0gci0+ZGVzaXJlZF95CisgICAgICAgICAgICAgICAgICAgICAm JiBwLT5jdXJyZW50X3kgPCByLT5kZXNpcmVkX3kgKyByLT5oZWlnaHQpCisgICAgICAgICAgICAg ICAgICAgIHx8IChwLT5jdXJyZW50X3kgKyBwLT5oZWlnaHQgPiByLT5kZXNpcmVkX3kKKyAgICAg ICAgICAgICAgICAgICAgICAgICYmIChwLT5jdXJyZW50X3kgKyBwLT5oZWlnaHQKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICA8PSByLT5kZXNpcmVkX3kgKyByLT5oZWlnaHQpKSkKKyAgICAg ICAgICAgICAgICAgICBiZWNhdXNlIHdlIGhhdmUgMCA8IHAtPmhlaWdodCA8PSByLT5oZWlnaHQu ICovCisgICAgICAgICAgICAgICAgJiYgcC0+Y3VycmVudF95IDwgci0+ZGVzaXJlZF95ICsgci0+ aGVpZ2h0CisgICAgICAgICAgICAgICAgJiYgcC0+Y3VycmVudF95ICsgcC0+aGVpZ2h0ID4gci0+ ZGVzaXJlZF95KQorICAgICAgICAgICAgICBwLT5ucm93cyA9IDA7CisgICAgICAgICAgICAvKiBS ZW9yZGVyIHJ1bnMgYnkgY29waWVkIHBpeGVsIGxpbmVzIGlmIHRydW5jYXRlZC4gKi8KKyAgICAg ICAgICAgIGlmICh0cnVuY2F0ZWRfcCAmJiBwLT5ucm93cyA+IDApCisgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICBpbnQgayA9IG5ydW5zIC0gMTsKKyAgICAgICAgICAgICAgICB3aGls ZSAobWNfcnVuc1trXS0+bnJvd3MgPT0gMCB8fCBtY19ydW5zW2tdLT5oZWlnaHQgPCBwLT5oZWln aHQpCisgICAgICAgICAgICAgICAgICBrLS07CisgICAgICAgICAgICAgICAgbWVtbW92ZSAobWNf cnVucyArIGosIG1jX3J1bnMgKyBqICsgMSwgKGsgLSBqKSAqIHNpemVvZiAoKm1jX3J1bnMpKTsK KyAgICAgICAgICAgICAgICBtY19ydW5zW2tdID0gcDsKKyAgICAgICAgICAgICAgfQorICAgICAg ICAgIH0KKyAgICAgICAgLyogQXNzaWduIG1hdHJpeCByb3dzLiAqLworICAgICAgICBmb3IgKGog PSAwOyBqIDwgci0+bnJvd3M7ICsraikKKyAgICAgICAgICB7CisgICAgICAgICAgICBzdHJ1Y3Qg Z2x5cGhfcm93ICpmcm9tLCAqdG87CisgICAgICAgICAgICBib29sIHRvX292ZXJsYXBwZWRfcDsK KyAgICAgICAgICAgIHRvID0gTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIHItPmRlc2lyZWRf dnBvcyArIGopOworICAgICAgICAgICAgZnJvbSA9IE1BVFJJWF9ST1cgKGRlc2lyZWRfbWF0cml4 LCByLT5kZXNpcmVkX3Zwb3MgKyBqKTsKKyAgICAgICAgICAgIHRvX292ZXJsYXBwZWRfcCA9IHRv LT5vdmVybGFwcGVkX3A7CisgICAgICAgICAgICBmcm9tLT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNf cCA9IGZyb20tPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcDsKKyAgICAgICAgICAgIGFzc2lnbl9y b3cgKHRvLCBmcm9tKTsKKyAgICAgICAgICAgIC8qIFRoZSBhYm92ZSBgYXNzaWduX3JvdycgYWN0 dWFsbHkgZG9lcyBzd2FwLCBzbyBpZiB3ZSBoYWQKKyAgICAgICAgICAgICAgIGFuIG92ZXJsYXAg aW4gdGhlIGNvcHkgZGVzdGluYXRpb24gb2YgdHdvIHJ1bnMsIHRoZW4KKyAgICAgICAgICAgICAg IHRoZSBzZWNvbmQgcnVuIHdvdWxkIGFzc2lnbiBhIHByZXZpb3VzbHkgZGlzYWJsZWQgYm9ndXMK KyAgICAgICAgICAgICAgIHJvdy4gIEJ1dCB0aGFua3MgdG8gdGhlIHRydW5jYXRpb24gY29kZSBp biB0aGUKKyAgICAgICAgICAgICAgIHByZWNlZGluZyBmb3ItbG9vcCwgd2Ugbm8gbG9uZ2VyIGhh dmUgc3VjaCBhbiBvdmVybGFwLAorICAgICAgICAgICAgICAgY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ZSBkZXNpcmVkIG1hdHJpeCAtLSB0aGlzIGlzIGFjY2VwdGFibGUgYmVjYXVzZQorICB0 aGUgcG9pbnRlcnMgYmV0d2VlbiBkZXNpcmVkL2N1cnJlbnQgcm93IG1hdHJpY2VzIGhhdmUgbm90 IHlldCBiZWVuIHN3YXBwZWQgYnkKKyAgYG1ha2VfY3VycmVudCcgaW4gYHVwZGF0ZV93aW5kb3df bGluZScsIG9yIGJlY2F1c2UgdGhlIHByZXZpb3VzIHJvdyB3b3VsZCBiZQorICB0aGUgc2FtZSBp biBib3RoIG1hdHJpY2VzIGlmIHdlIGp1bXBlZCB0byBgc2V0X2N1cnNvcjpgIHdpdGhpbiBgdXBk YXRlX3dpbmRvdycKKyAgYW5kIGBtY191cGRhdGVfd2luZG93X2RyeXJ1bicuICovCisgIGludCBw cmV2X21hdHJpeF9yb3dfc3RhcnRfYnl0ZXBvcyA9ICh2cG9zICE9IDApCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPV19TVEFSVF9CWVRFUE9TIChjdXJy ZW50X3JvdyAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogLTE7 CisgIGludCBwcmV2X21hdHJpeF9yb3dfZW5kX2J5dGVwb3MgPSAodnBvcyAhPSAwKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XX0VORF9CWVRFUE9TIChj dXJyZW50X3JvdyAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IC0x OworICBpbnQgbWF0cml4X3Jvd19zdGFydF9ieXRlcG9zID0gTUFUUklYX1JPV19TVEFSVF9CWVRF UE9TIChkZXNpcmVkX3Jvdyk7CisgIGludCBtYXRyaXhfcm93X2VuZF9ieXRlcG9zID0gTUFUUklY X1JPV19FTkRfQllURVBPUyAoZGVzaXJlZF9yb3cpOworICAvKiBUaGUgZmlyc3QgY29uZGl0aW9u IHRlc3RzIGZvciBhIHNvbGl0YXJ5IHJvdyBjb250YWluaW5nIFpWLCBwcmVjZWRlZCBieSBhCisg IHJvdyBjb250YWluaW5nIGEgcGVudWx0aW1hdGUgZ2x5cGggd2l0aCBhIGNoYXJwb3Mgb2YgWlYg LSAxIGZvbGxvd2VkIGJ5IGFuIGVuZAorICBvZiByb3cgc3BhY2UgZ2x5cGggd2l0aCBhIGNoYXJw b3Mgb2YgMC4gIFRoZSBvdGhlciBjb25kaXRpb25zIHRlc3QgZm9yIGFuIGVtcHR5CisgIGJ1ZmZl ciAobm90IG5hcnJvd2VkKSwgb3IgYW4gZW1wdHkgbmFycm93ZWQgYnVmZmVyLiAqLworICBib29s IHJvd19hdF96dl9wID0gKCh2cG9zICE9IDAKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgKGN1 cnJlbnRfcm93IC0gMSktPnVzZWRbVEVYVF9BUkVBXSA+IDAKKyAgICAgICAgICAgICAgICAgICAg ICAgJiYgcHJldl9tYXRyaXhfcm93X3N0YXJ0X2J5dGVwb3MgIT0gcHJldl9tYXRyaXhfcm93X2Vu ZF9ieXRlcG9zCisgICAgICAgICAgICAgICAgICAgICAgICYmICEoY3VycmVudF9yb3cgLSAxKS0+ ZW5kc19hdF96dl9wCisgICAgICAgICAgICAgICAgICAgICAgICYmIG1hdHJpeF9yb3dfc3RhcnRf Ynl0ZXBvcyA9PSBtYXRyaXhfcm93X2VuZF9ieXRlcG9zCisgICAgICAgICAgICAgICAgICAgICAg ICYmIGRlc2lyZWRfcm93LT5lbmRzX2F0X3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgfHwg KCgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID09IDEpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICB8fCAoaGVhZGVyX2xpbmVfZm9ybWF0ID09IDAgJiYgdnBvcyA9PSAwKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgYnVmZmVyX25hcnJvd2VkX3AKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgYm9iX3Jlc3BlY3RfbmFycm93ID09IGVvYl9yZXNwZWN0X25hcnJv dykKKyAgICAgICAgICAgICAgICAgICAgICB8fCAoKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYm IHZwb3MgPT0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChoZWFkZXJfbGluZV9m b3JtYXQgPT0gMCAmJiB2cG9zID09IDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBi b2JfZGlzcmVnYXJkX25hcnJvdyA9PSBlb2JfZGlzcmVnYXJkX25hcnJvdykpOworICAvKiBJZiBs aW5lLW51bWJlcnMgYXJlIGFjdGl2ZSwgdGhlbiBzcGFjZSBnbHlwaCBwYWRkaW5nIGVxdWFsIHRv IGl0cyB3aWR0aAorICBjb3VudGVkIGluIEhQT1MgYXJlIGZvbGxvd2VkIGJ5IGEgc2luZ2xlIHJv dyBlbmQgc3BhY2UgZ2x5cGguICBMaW5lIG51bWJlcgorICBwYWRkaW5nIHNwYWNlIGdseXBocyBo YXZlIGEgY2hhcnBvcyBvZiAtMSwgd2hlcmVhcyB0aGUgZW5kIG9mIHJvdyBzcGFjZSBnbHlwaAor ICBoYXMgYSBjaGFycG9zIG9mIDAuICBJZiBsaW5lIG51bWJlcnMgYXJlIGluYWN0aXZlLCB0aGVu IHRoZSByb3cgd2lsbCBjb250YWluCisgIGEgc29saXRhcnkgc3BhY2UgZ2x5cGggd2l0aCBhIGNo YXJwb3Mgb2YgLTEuICovCisgIGJvb2wgcm93X2JleW9uZF96dl9wID0gKG1hdHJpeF9yb3dfc3Rh cnRfYnl0ZXBvcyA9PSBtYXRyaXhfcm93X2VuZF9ieXRlcG9zCisgICAgICAgICAgICAgICAgICAg ICAgICAgICYmICFyb3dfYXRfenZfcCk7CisgIHJldHVybiAocm93X2F0X3p2X3ApCisgICAgICAg ICAgID8gQVRfWlYKKyAgICAgICAgIDogKHJvd19iZ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nQgd2QgPSAtMTsKKyAgYm9vbCBjdXJzb3JfZ2NfcCA9IGZhbHNlOworICBzdHJ1Y3QgZ2x5cGhf bWF0cml4ICpkZXNpcmVkX21hdHJpeCA9IHctPmRlc2lyZWRfbWF0cml4OworICBpZiAoZGVidWdf cCkKKyAgICBmcHJpbnRmIChzdGRlcnIsICJtY191cGRhdGVfdGV4dF9hcmVhICglcyk6ICB2cG9z ICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgbWNfd2luZG93ICh3KSwgdnBvcyk7Cisg IC8qIEluYXNtdWNoIGFzIHdlIHByb2Nlc3MgdGhlIGN1cnNvciByb3cgYmVmb3JlIGFsbCBvdGhl ciByb3dzLCB3ZSBjYW4gcmVseQorICB1cG9uIHRoZSBwcmV2aW91cyBgZGVzaXJlZF9yb3dgIHRv IGJlIGFjY3VyYXRlLiAqLworICBlbnVtIG1jX3Jvd19wb3NpdGlvbiByb3dfcG9zaXRpb24gPSAg bWNfcm93X3Bvc2l0aW9uICh3LCB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZGVzaXJlZF9y b3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiBjdXJyZW50X3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgZGVzaXJlZF9yb3csIHZwb3MpOworICAvKiBJZiByb3dzIGFy ZSBhdCBkaWZmZXJlbnQgWCBvciBZLCBvciByb3dzIGhhdmUgZGlmZmVyZW50IGhlaWdodCwKKyAg ICAgb3IgdGhlIGN1cnJlbnQgcm93IGlzIG1hcmtlZCBpbnZhbGlkLCB3cml0ZSB0aGUgZW50aXJl IGxpbmUuICovCisgIGlmICghY3VycmVudF9yb3ctPmVuYWJsZWRfcAorICAgICAgfHwgZGVzaXJl ZF9yb3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GhlIHRleHQgYXJlYSBlbmQsIGFuZCB1bmxlc3MgdGhlCisgICAgICAgIGN1cnJl bnQgcm93IGFsc28gZG9lcyBzbyBhdCB0aGUgc2FtZSBwb3NpdGlvbiwgbWFrZSBzdXJlIHdlIHdy aXRlIGF0IGxlYXN0IG9uZQorICAgICAgICBnbHlwaCwgc28gdGhhdCB0aGUgZmFjZSBleHRlbnNp b24gYWN0dWFsbHkgdGFrZXMgcGxhY2UuICovCisgICAgICAgIGlmIChNQVRSSVhfUk9XX0VYVEVO RFNfRkFDRV9QIChkZXNpcmVkX3JvdykKKyAgICAgICAgICAgICYmIChkZXNpcmVkX3N0b3BfcG9z IDwgY3VycmVudF9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgIHx8IChkZXNp cmVkX3N0b3BfcG9zID09IGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAg ICAgICAgICAgJiYgIU1BVFJJWF9ST1dfRVhURU5EU19GQUNFX1AgKGN1cnJlbnRfcm93KSkpKQor ICAgICAgICAgIC0tZGVzaXJlZF9zdG9wX3BvczsKKyAgICAgICAgc3RvcCA9IG1pbiAoY3VycmVu dF9yb3ctPnVzZWRbVEVYVF9BUkVBXSwgZGVzaXJlZF9zdG9wX3Bvcyk7CisgICAgICAgIGkgPSAw OworICAgICAgICB4ID0gZGVzaXJlZF9yb3ctPng7CisgICAgICAgIGludCBjbGVhcl90b194ID0g MDsKKworICAgICAgICAvKiBMb29wIG92ZXIgZ2x5cGhzIHRoYXQgY3VycmVudCBhbmQgZGVzaXJl ZCByb3cgbWF5IGhhdmUgaW4gY29tbW9uLiAqLworICAgICAgICB3aGlsZSAoaSA8IHN0b3ApCisg ICAgICAgICAgeworICAgICAgICAgICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZCA9IDA7Cisg ICAgICAgICAgICBib29sIGNhbl9za2lwX3AgPSAhYWJvcnRfc2tpcHBpbmc7CisgICAgICAgICAg ICAvKiBTa2lwIG92ZXIgZ2x5cGhzIHRoYXQgYm90aCByb3dzIGhhdmUgaW4gY29tbW9uLiAgVGhl c2UgZG9uJ3QgaGF2ZQorICAgICAgICAgICAgdG8gYmUgd3JpdHRlbi4gIFdlIGNhbid0IHNraXAg aWYgdGhlIGxhc3QgY3VycmVudCBnbHlwaCBvdmVybGFwcyB0aGUKKyAgICAgICAgICAgIGdseXBo IHRvIGl0cyByaWdodC4gIEZvciBleGFtcGxlLCBjb25zaWRlciBhIGN1cnJlbnQgcm93IG9mIGBp Zicgd2l0aAorICAgICAgICAgICAgdGhlIGBmJyBpbiBDb3VyaWVyIGJvbGQgc28gdGhhdCBpdCBv dmVybGFwcyB0aGUgYCAnIHRvIGl0cyByaWdodC4KKyAgICAgICAgICAgIElmIHRoZSBkZXNpcmVk IHJvdyBpcyBgICcsIHdlIHdvdWxkIHNraXAgb3ZlciB0aGUgc3BhY2UgYWZ0ZXIgdGhlCisgICAg ICAgICAgICBgaWYnIGFuZCB0aGVyZSB3b3VsZCByZW1haW4gYSBwaXhlbCBmcm9tIHRoZSBgZicg b24gdGhlIHNjcmVlbi4gKi8KKyAgICAgICAgICAgIGlmIChvdmVybGFwcGluZ19nbHlwaHNfcCAm JiBpID4gMCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAq Z2x5cGggPSAmY3VycmVudF9yb3ctPmdseXBoc1tURVhUX0FSRUFdW2kgLSAxXTsKKyAgICAgICAg ICAgICAgICBpbnQgbGVmdCwgcmlnaHQ7CisgICAgICAgICAgICAgICAgcmlmLT5nZXRfZ2x5cGhf b3ZlcmhhbmdzIChnbHlwaCwgWEZSQU1FICh3LT5mcmFtZSksICZsZWZ0LCAmcmlnaHQpOworICAg ICAgICAgICAgICAgIGNhbl9za2lwX3AgPSAocmlnaHQgPT0gMCAmJiAhYWJvcnRfc2tpcHBpbmcp OworICAgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoY2FuX3NraXBfcCkKKyAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgIGludCBzdGFydF9ocG9zID0gaTsKKyAgICAgICAgICAg ICAgICB3aGlsZSAoaSA8IHN0b3AKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgR0xZUEhfRVFV QUxfUCAoZGVzaXJlZF9nbHlwaCwgY3VycmVudF9nbHlwaCkpCisgICAgICAgICAgICAgICAgICB7 CisgICAgICAgICAgICAgICAgICAgICsrYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZDsKKyAgICAg ICAgICAgICAgICAgICAgaWYgKGFycmF5X2dseXBoc19za2lwcGVkLmFsbG9jYXRlZCA8IGFycmF5 X2dseXBoc19za2lwcGVkLnVzZWQpCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgICAgICAgaW50IG9sZF9hbGxvYyA9IGFycmF5X2dseXBoc19za2lwcGVkLmFsbG9j YXRlZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBuZXdfZWx0cyA9IGFycmF5X2dseXBo c19za2lwcGVkLnVzZWQgLSBhcnJheV9nbHlwaHNfc2tpcHBlZC5hbGxvY2F0ZWQ7CisgICAgICAg ICAgICAgICAgICAgICAgICBhcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVkID0KKyAgICAgICAg ICAgICAgICAgICAgICAgICAgeHBhbGxvYyAoYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmFycmF5X2dseXBoc19za2lwcGVk LmFsbG9jYXRlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2VsdHMs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElOVF9NQVgsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiAqYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tp cHBlZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBtZW1zZXQgKGFycmF5X2dseXBoc19za2lw cGVkLnNraXBwZWQgKyBvbGRfYWxsb2MsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAoYXJyYXlfZ2x5cGhzX3NraXBwZWQuYWxsb2NhdGVkIC0gb2xkX2FsbG9jKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHNpemVvZiAqYXJyYXlfZ2x5cGhzX3NraXBw ZWQuc2tpcHBlZCk7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAg ICBpbnQgbnRoID0gYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZCAtIDE7CisgICAgICAgICAgICAg ICAgICAgIGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbbnRoXS54ID0geDsKKyAgICAgICAg ICAgICAgICAgICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZFtudGhdLmhwb3MgPSBpOwor ICAgICAgICAgICAgICAgICAgICBhcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVkW250aF0uZW5h YmxlZF9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgeCArPSBkZXNpcmVkX2dseXBoLT5w aXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgKytkZXNpcmVkX2dseXBoLCArK2N1cnJl bnRfZ2x5cGgsICsraTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvKiBD b25zaWRlciB0aGUgY2FzZSB0aGF0IHRoZSBjdXJyZW50IHJvdyBjb250YWlucyAieHh4IHBwcCBn Z2ciIGluCisgICAgICAgICAgICAgICAgaXRhbGljIENvdXJpZXIgZm9udCwgYW5kIHRoZSBkZXNp cmVkIHJvdyBpcyAieHh4IGdnZyIuICBUaGUgY2hhcmFjdGVyIGBwJworICAgICAgICAgICAgICAg IGhhcyBsYmVhcmluZywgYGcnIGhhcyBub3QuICBUaGUgbG9vcCBhYm92ZSB3aWxsIHN0b3AgaW4g ZnJvbnQgb2YgdGhlCisgICAgICAgICAgICAgICAgZmlyc3QgYHAnIGluIHRoZSBjdXJyZW50IHJv dy4gIElmIHdlIHdvdWxkIHN0YXJ0IHdyaXRpbmcgZ2x5cGhzIHRoZXJlLCB3ZQorICAgICAgICAg ICAgICAgIHdvdWxkbid0IGVyYXNlIHRoZSBsYmVhcmluZyBvZiB0aGUgYHAnLiAgVGhlIHJlc3Qg b2YgdGhlIGxiZWFyaW5nIHByb2JsZW0KKyAgICAgICAgICAgICAgICBpcyB0aGVuIHRha2VuIGNh cmUgb2YgYnkgZHJhd19nbHlwaHMuICovCisgICAgICAgICAgICAgICAgaWYgKG92ZXJsYXBwaW5n X2dseXBoc19wCisgICAgICAgICAgICAgICAgICAgICYmIGkgPiAwCisgICAgICAgICAgICAgICAg ICAgICYmIGkgPCBjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAgICAg ICAgICYmIChjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdICE9IGRlc2lyZWRfcm93LT51c2Vk W1RFWFRfQVJFQV0pKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBp bnQgbGVmdCwgcmlnaHQ7CisgICAgICAgICAgICAgICAgICAgIHJpZi0+Z2V0X2dseXBoX292ZXJo YW5ncyAoY3VycmVudF9nbHlwaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBYRlJBTUUg KHctPmZyYW1lKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmbGVmdCwgJnJpZ2h0KTsK KyAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGxlZnQgPiAwICYmIGkgPiAwKQorICAgICAgICAg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC0taSwgLS1kZXNpcmVkX2ds eXBoLCAtLWN1cnJlbnRfZ2x5cGg7CisgICAgICAgICAgICAgICAgICAgICAgICB4IC09IGRlc2ly ZWRfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICAgICAgICAgICAgbGVmdCAtPSBk ZXNpcmVkX2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAg ICAgICAgICAgICAgICAgIC8qIEFib3J0IHRoZSBza2lwcGluZyBhbGdvcml0aG0gaWYgd2UgZW5k IHVwIGJlZm9yZQorICAgICAgICAgICAgICAgICAgICAgICBvdXIgc3RhcnRpbmcgcG9pbnQsIHRv IGF2b2lkIGxvb3BpbmcgKGJ1ZyMxMDcwKS4KKyAgICAgICAgICAgICAgICAgICAgICAgVGhpcyBj YW4gaGFwcGVuIHdoZW4gdGhlIGxiZWFyaW5nIGlzIGxhcmdlciB0aGFuCisgICAgICAgICAgICAg ICAgICAgICAgIHRoZSBwaXhlbCB3aWR0aC4gKi8KKyAgICAgICAgICAgICAgICAgICAgYWJvcnRf c2tpcHBpbmcgPSAoaSA8IHN0YXJ0X2hwb3MpOworICAgICAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAvKiBUcnkgdG8gYXZvaWQgd3JpdGluZyB0aGUgZW50aXJl IHJlc3Qgb2YgdGhlIGRlc2lyZWQgcm93CisgICAgICAgICAgICAgICBieSBsb29raW5nIGZvciBh IHJlc3luYyBwb2ludC4gIFRoaXMgbWFpbmx5IHByZXZlbnRzCisgICAgICAgICAgICAgICBtb2Rl IGxpbmUgZmxpY2tlcmluZyBpbiB0aGUgY2FzZSB0aGUgbW9kZSBsaW5lIGlzIGluCisgICAgICAg ICAgICAgICBmaXhlZC1waXRjaCBmb250LCB3aGljaCBpdCB1c3VhbGx5IHdpbGwgYmUuICovCisg ICAgICAgICAgICBpZiAoaSA8IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICBpbnQgc3RhcnRfeCA9IHgsIHN0YXJ0X2hwb3MgPSBp OworICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqc3RhcnQgPSBkZXNpcmVkX2dseXBoOwor ICAgICAgICAgICAgICAgIGludCBjdXJyZW50X3ggPSB4OworICAgICAgICAgICAgICAgIGJvb2wg c2tpcF9maXJzdF9wID0gIWNhbl9za2lwX3A7CisgICAgICAgICAgICAgICAgLyogRmluZCB0aGUg bmV4dCBnbHlwaCB0aGF0J3MgZXF1YWwgYWdhaW4uICovCisgICAgICAgICAgICAgICAgd2hpbGUg KGkgPCBzdG9wCisgICAgICAgICAgICAgICAgICAgICAgICYmIChza2lwX2ZpcnN0X3AKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgIHx8ICFHTFlQSF9FUVVBTF9QIChkZXNpcmVkX2dseXBoLCBj dXJyZW50X2dseXBoKSkKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgeCA9PSBjdXJyZW50X3gp CisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHggKz0gZGVzaXJlZF9n bHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRfeCArPSBjdXJy ZW50X2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgKytkZXNpcmVkX2ds eXBoLCArK2N1cnJlbnRfZ2x5cGgsICsraTsKKyAgICAgICAgICAgICAgICAgICAgc2tpcF9maXJz dF9wID0gMDsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBmb3IgKGludCBl bHQgPSAwOworICAgICAgICAgICAgICAgICAgICAgZWx0IDwgYXJyYXlfZ2x5cGhzX3NraXBwZWQu dXNlZDsKKyAgICAgICAgICAgICAgICAgICAgICsrZWx0KQorICAgICAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgICAgICBpbnQgeCA9IGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRb ZWx0XS54OworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGFycmF5X2dseXBoc19za2lw cGVkLnNraXBwZWRbZWx0XS5ocG9zOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGgg KnRhcmdldF9nbHlwaCA9CisgICAgICAgICAgICAgICAgICAgICAgbWNfZ2V0X2N1cnNvcl9nbHlw aCAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCBocG9zLCB2cG9zKTsKKyAgICAgICAg ICAgICAgICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgICAgICAgICAgICAgICAgZnByaW50ZiAo c3RkZXJyLCAiU0tJUFBFRDogIHZwb3MgKCVkKSB8IGNoYXIgKCVkLyVzKSB8IHg6ICglZCkgfCBo cG9zICglZC8lZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2 cG9zLCB0YXJnZXRfZ2x5cGgtPnUuY2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAodGFyZ2V0X2dseXBoLT51LmNoKSwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHgsIGhwb3MsIHVwZGF0ZWRfcm93LT51c2Vk W1RFWFRfQVJFQV0gLSAxKTsKKyAgICAgICAgICAgICAgICAgICAgbWNfZHJhd19yb3cgKHcsIGRl c2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBoLCB4LCAxLCB2cG9zLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywg cm93X3Bvc2l0aW9uLCBkcmF3X3AsIFNLSVBQRUQpOworICAgICAgICAgICAgICAgICAgfQorICAg ICAgICAgICAgICAgIGlmIChpID09IHN0YXJ0X2hwb3MgfHwgeCAhPSBjdXJyZW50X3gpCisgICAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGkgPSBzdGFydF9ocG9zOworICAg ICAgICAgICAgICAgICAgICB4ID0gc3RhcnRfeDsKKyAgICAgICAgICAgICAgICAgICAgZGVzaXJl ZF9nbHlwaCA9IHN0YXJ0OworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgICAgICBvdXRwdXRfY3Vyc29yX3RvICh3LCB2cG9zLCBzdGFy dF9ocG9zLCBkZXNpcmVkX3Jvdy0+eSwgc3RhcnRfeCk7CisgICAgICAgICAgICAgICAgLyogUmUt ZHJhdyBhIHBvcnRpb24gb2YgdGhlIHJvdy4gKi8KKyAgICAgICAgICAgICAgICBpZiAoZGVidWdf cCkKKyAgICAgICAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIlJFRFJBVyBTRUdNRU5UOlxu XAorICAgICAgICAgICAgICAgICAgICB2cG9zICglZCkgfCBjaGFyICglZC8lcykgfCB4OiAoJWQp IHwgaHBvcyAoJWQvJWQpIHwgbGVuZ3RoICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgIHZw b3MsIHN0YXJ0LT51LmNoLCBtY19jaGFyX3RvX3N0cmluZyAoc3RhcnQtPnUuY2gpLAorICAgICAg ICAgICAgICAgICAgICBzdGFydF94LCBzdGFydF9ocG9zLCB1cGRhdGVkX3Jvdy0+dXNlZFtURVhU X0FSRUFdIC0gMSwgaSAtIHN0YXJ0X2hwb3MpOworICAgICAgICAgICAgICAgIGJsb2NrX2lucHV0 ICgpOworICAgICAgICAgICAgICAgIGludCBsZW4gPSBpIC0gc3RhcnRfaHBvczsKKyAgICAgICAg ICAgICAgICBpbnQgaHBvcyA9IHN0YXJ0IC0gdXBkYXRlZF9yb3ctPmdseXBoc1tURVhUX0FSRUFd OworICAgICAgICAgICAgICAgIHctPm91dHB1dF9jdXJzb3IueCA9CisgICAgICAgICAgICAgICAg ICBtY19kcmF3X2dseXBocyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB3LT5vdXRw dXRfY3Vyc29yLngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVEVYVF9BUkVB LCBocG9zLCBocG9zICsgbGVuLCBEUkFXX05PUk1BTF9URVhULAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDAsIHZwb3MsIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwg d2QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVf cCwgY3Vyc29yX2djX3AsIE1DX0RSQVdfR0xZUEhfU1RSSU5HLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGRyYXdfcCk7CisgICAgICAgICAgICAgICAgdy0+b3V0cHV0X2N1cnNv ci5ocG9zICs9IGxlbjsKKyAgICAgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAg ICAgICAgICAgIG1jX2RyYXdfcm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHN0 YXJ0LCBzdGFydF94LCBpIC0gc3RhcnRfaHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgdnBvcywgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBkcmF3X3As IFNDUklCRV9UV08pOworICAgICAgICAgICAgICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAgICAg ICAgIH0KKyAgICAgICAgICB9CisKKyAgICAgICAgLyogV3JpdGUgdGhlIHJlc3QuICovCisgICAg ICAgIGlmIChpIDwgZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgICAgICB7Cisg ICAgICAgICAgICBvdXRwdXRfY3Vyc29yX3RvICh3LCB2cG9zLCBpLCBkZXNpcmVkX3Jvdy0+eSwg eCk7CisgICAgICAgICAgICBpZiAoZGVidWdfcCkKKyAgICAgICAgICAgICAgZnByaW50ZiAoc3Rk ZXJyLCAiRFJBVyBSRU1BSU5ERVIgT0YgVEhFIFJPVzpcblwKKyAgICAgICAgICAgICAgICB2cG9z ICglZCkgfCBjaGFyICglZC8lcykgfCB4OiAoJWQpIHwgaHBvcyAoJWQvJWQpIHwgbGVuZ3RoICgl ZClcbiIsCisgICAgICAgICAgICAgICAgdnBvcywgZGVzaXJlZF9nbHlwaC0+dS5jaCwgbWNfY2hh cl90b19zdHJpbmcgKGRlc2lyZWRfZ2x5cGgtPnUuY2gpLAorICAgICAgICAgICAgICAgIHgsIGks IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxLCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhU X0FSRUFdIC0gaSk7CisgICAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgIGlu dCBsZW4gPSBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gaTsKKyAgICAgICAgICAgIGlu dCBocG9zID0gZGVzaXJlZF9nbHlwaCAtIHVwZGF0ZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsK KyAgICAgICAgICAgIHctPm91dHB1dF9jdXJzb3IueCA9CisgICAgICAgICAgICAgIG1jX2RyYXdf Z2x5cGhzICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHctPm91dHB1dF9jdXJzb3Iu eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRFWFRfQVJFQSwgaHBvcywgaHBvcyAr IGxlbiwgRFJBV19OT1JNQUxfVEVYVCwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHZwb3MsIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBjdXJzb3JfZ2NfcCwgTUNfRFJB V19HTFlQSF9TVFJJTkcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcm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hbHMsIHJvd19wb3NpdGlvbiwgZHJhd19wLCBTQ1JJ QkVfVEhSRUUpOworICAgICAgICAgICAgY2hhbmdlZF9wID0gMTsKKyAgICAgICAgICB9CisgICAg ICAgICAgLyogRXZlcnl0aGluZyBhZnRlciB0aGUgcHJldmlvdXMgY2hhbmdlIHJlbWFpbmVkIHRo ZSBzYW1lLiAgYGlgIGFuZCBgeGAgd2VyZQorICAgICAgICAgIGluY3JlbWVudGVkIHRvIHRoZSBl bmQgb2YgdGhlIGdseXBoIHJvdy4gIGkgPT0gZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXQor ICAgICAgICAgIFRoZSBgdy0+b3V0cHV0X2N1cnNvci54L3kvaHBvcy92cG9zYCBpcyBhdCB0aGUg ZW5kIG9mIHRoZSBwcmV2aW91cyBjaGFuZ2UuCisgICAgICAgICAgV2hlbiB0aGlzIHNpdHVhdGlv biBleGlzdHMsIHRoZSBkaXN0YW5jZSBiZXR3ZWVuIHRoZSBlbmQgb2YgdGhlIGdseXBoIHJvdyBh bmQKKyAgICAgICAgICB0aGUgcmlnaHQgZWRnZSBvZiB0aGUgd2luZG93IHdpbGwgX25vdF8gYmUg Y2xlYXJlZC4gIFRoZXJlZm9yZSwgaXQgaXMgb2theSB0bworICAgICAgICAgIGRyYXcgdGhlIGZs b2F0aW5nIGdseXBocyBmb3IgdGhlIGhvcml6b250YWwvdmVydGljYWwgcnVsZXJzIGhlcmUuICov CisgICAgICAgICAgZWxzZSBpZiAoY2hhbmdlZF9wCisgICAgICAgICAgICAgICAgICAgJiYgdy0+ b3V0cHV0X2N1cnNvci5ocG9zICE9IHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAg ICAgICAgICB7CisgICAgICAgICAgICAgIGludCB4ID0gdy0+b3V0cHV0X2N1cnNvci54OworICAg ICAgICAgICAgICBpbnQgaHBvcyA9IHctPm91dHB1dF9jdXJzb3IuaHBvczsKKyAgICAgICAgICAg ICAgc3RydWN0IGdseXBoICpzdGFydCA9IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIGRlc2lyZWRf bWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgdXBkYXRlZF9yb3csIGhwb3MsIHZwb3MpOworICAgICAgICAgICAgICBpZiAody0+ b3V0cHV0X2N1cnNvci54ID09IHVwZGF0ZWRfcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAg ICAgICB4IC09IHN0YXJ0LT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgaWYgKGRlYnVnX3Ap CisgICAgICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiUE9TVC1DSEFOR0VEOiAgdnBvcyAo JWQpIHwgeCAoJWQpIHwgaHBvcyAoJWQvJWQpIHwgY2hhciAoJWQvJXMpXG4iLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgdnBvcywgeCwgaHBvcywgdXBkYXRlZF9yb3ctPnVzZWRb VEVYVF9BUkVBXSAtIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydC0+ dS5jaCwgbWNfY2hhcl90b19zdHJpbmcgKHN0YXJ0LT51LmNoKSk7CisgICAgICAgICAgICAgIG1j X2RyYXdfcm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHN0YXJ0LCB4LAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIGhw b3MsIHZwb3MsIGN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBlc3Nl bnRpYWxzLCByb3dfcG9zaXRpb24sIGRyYXdfcCwgUE9TVF9DSEFOR0VEKTsKKyAgICAgICAgICAg IH0KKyAgICAgICAgICAgIC8qIFRoZXJlIHdlcmUgbm8gY2hhbmdlcyBhbmQgaSA9PSBkZXNpcmVk X3Jvdy0+dXNlZFtURVhUX0FSRUFdICovCisgICAgICAgICAgICBlbHNlIGlmICghY2hhbmdlZF9w KQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAg ICAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJVTkNIQU5HRUQgLS0gV1JJVEUgRU5USVJFIExJ TkU6ICB2cG9zICglZCkgfCByb3ctPnVzZWQgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgdnBvcywgdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpOwor ICAgICAgICAgICAgICAgIG1jX2RyYXdfcm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9y b3csIGRlc2lyZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgZGVzaXJlZF9yb3ctPngsIGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0sIHZw b3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlh bHMsIHJvd19wb3NpdGlvbiwgZHJhd19wLCBVTkNIQU5HRUQpOworICAgICAgICAgICAgICB9CisK KyAgICAgICAgLyogTWF5YmUgY2xlYXIgdG8gZW5kIG9mIGxpbmUuICovCisgICAgICAgIGlmIChN QVRSSVhfUk9XX0VYVEVORFNfRkFDRV9QIChkZXNpcmVkX3JvdykpCisgICAgICAgICAgeworICAg ICAgICAgICAgLyogSWYgbmV3IHJvdyBleHRlbmRzIHRvIHRoZSBlbmQgb2YgdGhlIHRleHQgYXJl YSwgbm90aGluZworICAgICAgICAgICAgICAgaGFzIHRvIGJlIGNsZWFyZWQsIGlmIGFuZCBvbmx5 IGlmIHdlIGRpZCBhIHdyaXRlX2dseXBocworICAgICAgICAgICAgICAgYWJvdmUuICBUaGlzIGlz IG1hZGUgc3VyZSBieSBzZXR0aW5nIGRlc2lyZWRfc3RvcF9wb3MKKyAgICAgICAgICAgICAgIGFw cHJvcHJpYXRlbHkgYWJvdmUuICovCisgICAgICAgICAgICBlYXNzZXJ0IChpIDwgZGVzaXJlZF9y b3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAgICAgfHwgKChkZXNpcmVkX3Jv dy0+dXNlZFtURVhUX0FSRUFdID09IGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgTUFUUklYX1JPV19FWFRFTkRTX0ZBQ0VfUCAoY3VycmVu dF9yb3cpKSk7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKE1BVFJJWF9ST1dfRVhU RU5EU19GQUNFX1AgKGN1cnJlbnRfcm93KSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg LyogSWYgb2xkIHJvdyBleHRlbmRzIHRvIHRoZSBlbmQgb2YgdGhlIHRleHQgYXJlYSwgY2xlYXIu ICovCisgICAgICAgICAgICAgIGlmIChpID49IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0p CisgICAgICAgICAgICAgICAgb3V0cHV0X2N1cnNvcl90byAodywgdnBvcywgaSwgZGVzaXJlZF9y b3ctPnksIGRlc2lyZWRfcm93LT5waXhlbF93aWR0aCk7CisgICAgICAgICAgICAgIGlmIChkcmF3 X3ApCisgICAgICAgICAgICAgICAgcmlmLT5jbGVhcl9lbmRfb2ZfbGluZSAodywgdXBkYXRlZF9y b3csIFRFWFRfQVJFQSwgLTEpOworICAgICAgICAgICAgICBjbGVhcl90b194ID0gLTE7CisgICAg ICAgICAgICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNl IGlmIChkZXNpcmVkX3Jvdy0+cGl4ZWxfd2lkdGggPCBjdXJyZW50X3Jvdy0+cGl4ZWxfd2lkdGgp CisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBPdGhlcndpc2UgY2xlYXIgdG8g dGhlIGVuZCBvZiB0aGUgb2xkIHJvdy4gIEV2ZXJ5dGhpbmcKKyAgICAgICAgICAgICAgICAgICBh ZnRlciB0aGF0IHBvc2l0aW9uIHNob3VsZCBiZSBjbGVhciBhbHJlYWR5LiAqLworICAgICAgICAg ICAgICAgIGludCB4bGltOworICAgICAgICAgICAgICAgIGlmIChpID49IGRlc2lyZWRfcm93LT51 c2VkW1RFWFRfQVJFQV0pCisgICAgICAgICAgICAgICAgICBvdXRwdXRfY3Vyc29yX3RvICh3LCB2 cG9zLCBpLCBkZXNpcmVkX3Jvdy0+eSwgZGVzaXJlZF9yb3ctPnBpeGVsX3dpZHRoKTsKKyAgICAg ICAgICAgICAgICAvKiBJZiBjdXJzb3IgaXMgZGlzcGxheWVkIGF0IHRoZSBlbmQgb2YgdGhlIGxp bmUsIG1ha2Ugc3VyZQorICAgICAgICAgICAgICAgICAgIGl0J3MgY2xlYXJlZC4gIE5vd2FkYXlz IHdlIGRvbid0IGhhdmUgYSBwaHlzX2N1cnNvcl9nbHlwaAorICAgICAgICAgICAgICAgICAgIHdp dGggd2hpY2ggdG8gZXJhc2UgdGhlIGN1cnNvciAoYmVjYXVzZSB0aGlzIG1ldGhvZAorICAgICAg ICAgICAgICAgICAgIGRvZXNuJ3Qgd29yayB3aXRoIGxiZWFyaW5nL3JiZWFyaW5nKSwgc28gd2Ug bXVzdCBkbyBpdCB0aGlzIHdheS4gKi8KKyAgICAgICAgICAgICAgICBpZiAodnBvcyA9PSB3LT5w aHlzX2N1cnNvci52cG9zCisgICAgICAgICAgICAgICAgICAgICYmIChkZXNpcmVkX3Jvdy0+cmV2 ZXJzZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAgPyAody0+cGh5c19jdXJzb3IuaHBvcyA8 IDApCisgICAgICAgICAgICAgICAgICAgICAgICA6ICh3LT5waHlzX2N1cnNvci5ocG9zID49IGRl c2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pKSkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgICAgdy0+cGh5c19jdXJzb3Jfb25fcCA9IDA7CisgICAgICAgICAgICAgICAg ICAgIHhsaW0gPSAtMTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICAgICAgeGxpbSA9IGN1cnJlbnRfcm93LT5waXhlbF93aWR0aDsK KyAgICAgICAgICAgICAgICBpZiAoZHJhd19wKQorICAgICAgICAgICAgICAgICAgcmlmLT5jbGVh cl9lbmRfb2ZfbGluZSAodywgdXBkYXRlZF9yb3csIFRFWFRfQVJFQSwgeGxpbSk7CisgICAgICAg ICAgICAgICAgY2xlYXJfdG9feCA9IHhsaW07CisgICAgICAgICAgICAgICAgY2hhbmdlZF9wID0g MTsKKyAgICAgICAgICAgICAgfQorCisgICAgICAgIGlmIChjaGFuZ2VkX3AKKyAgICAgICAgICAg ICYmIGNsZWFyX3RvX3ggIT0gMCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpbnQgdGV4dF9h cmVhX3dpZHRoID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAg IHN0cnVjdCBtY19SR0IgZGVidWdfZmcgPSB7LnJlZCA9IDAuODY3LCAuZ3JlZW4gPSAwLjg2Nywg LmJsdWUgPSAwLjg2N307CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnRhcmdldF9nbHlwaCA9 CisgICAgICAgICAgICAgIHVwZGF0ZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHVwZGF0ZWRf cm93LT51c2VkW1RFWFRfQVJFQV0gLSAxOworICAgICAgICAgICAgLyogYG1jX2VuZ2luZScgb25s eSBkcmF3cyBhbiBNQ19HTFlQSCB3aGVuIHggPCB1cGRhdGVkX3Jvdy0+cGl4ZWxfd2lkdGguCisg ICAgICAgICAgICBUaGUgY3VycmVudCBkZXNpZ24gaW5oaWJpdHMgZHJhd2luZyBvdmVyIGFuIGV4 aXN0aW5nIGdseXBoIGF0IHRoZSBlbmQgb2YgYQorICAgICAgICAgICAgd29yZC13cmFwcGVkIGxp bmUuICBTYWlkIGdseXBoIHJlY2VpdmVzIGEgZmFrZSBjdXJzb3IgaW4gZWl0aGVyIG9uZSBvZiB0 aGUKKyAgICAgICAgICAgIHByZXZpb3VzIHNlY3Rpb25zIGFib3ZlLCBhbmQgc2hvdWxkIG5vdCBi ZSBvdmVyd3JpdHRlbiB3aXRoIGFub3RoZXIgb25lLgorICAgICAgICAgICAgVGhpcyBkZXNpZ24g aXMgbmVlZGVkIGJlY2F1c2UgYSB3b3JkLXdyYXBwZWQgbGluZSBkb2VzIG5vdCByZWNlaXZlIGFu IGV4dHJhCisgICAgICAgICAgICBzcGFjZSBsaWtlIG5vbi13b3JkLXdyYXBwZWQgbGluZXMgZG8u ICovCisgICAgICAgICAgICBpbnQgeCA9IHVwZGF0ZWRfcm93LT5waXhlbF93aWR0aDsKKyAgICAg ICAgICAgIGludCBocG9zID0gdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDE7CisgICAg ICAgICAgICBpbnQgeF9saW1pdCA9IChjbGVhcl90b194ID09IC0xKQorICAgICAgICAgICAgICAg ICAgICAgICAgICA/IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICA6 IGNsZWFyX3RvX3g7CisgICAgICAgICAgICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAody0+ Y29udGVudHMpOworICAgICAgICAgICAgYm9vbCBmaWxsX2NvbHVtbl90cnVtcHNfcCA9ICghTklM UCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgZmNfdmlzaWJsZSkpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID09IGVzc2Vu dGlhbHMuZmNfeCk7CisgICAgICAgICAgICBpZiAobWNfc3RkZXJyX3ApCisgICAgICAgICAgICAg IGZwcmludGYgKHN0ZGVyciwgIm1jX3VwZGF0ZV90ZXh0X2FyZWEgKGZsb2F0aW5nKTogIHZwb3Mg KCVkKSB8IHhfbGltaXQgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2 cG9zLCB4X2xpbWl0KTsKKyAgICAgICAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAg ICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgZmNfdmlzaWJsZSkpCisgICAgICAgICAg ICAgICAgJiYgKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgfHwgKCFl c3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZB UiAoYiwgZmNfaW5hY3RpdmVfd2luZG93cykpKSkKKyAgICAgICAgICAgICAgICAmJiB4IDwgdGV4 dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID49IHgKKyAg ICAgICAgICAgICAgICAmJiB0YXJnZXRfZ2x5cGggIT0gTlVMTAorICAgICAgICAgICAgICAgICYm IGRyYXdfcCkKKyAgICAgICAgICAgICAgbWNfZW5naW5lICh3LCBkZXNpcmVkX21hdHJpeCwgdXBk YXRlZF9yb3csIHRhcmdldF9nbHlwaCwgVEVYVF9BUkVBLAorICAgICAgICAgICAgICAgICAgICAg ICAgIHgsIHhfbGltaXQsIHVwZGF0ZWRfcm93LT55LCBocG9zLCB2cG9zLCBNQ19CQVIsIDEsCisg ICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bv c2l0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgIGRlYnVnX3AgPyBkZWJ1Z19mZyA6IGVz c2VudGlhbHMuZmNfZmdbcm93X3Bvc2l0aW9uXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBG SUxMX0NPTFVNTiwgZHJhd19wLCBOT1dIRVJFLCBOT19DQUNIRSk7CisgICAgICAgICAgICBpZiAo QlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIs IGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9ob3Jp em9udGFsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAmJiAoZXNzZW50aWFscy5hY3RpdmVfcAor ICAgICAgICAgICAgICAgICAgICB8fCAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAg ICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkpKQor ICAgICAgICAgICAgICAgICYmIHggPCB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAm JiB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICAgICAgJiYgdGFyZ2V0X2dseXBo ICE9IE5VTEwKKyAgICAgICAgICAgICAgICAmJiBkcmF3X3ApCisgICAgICAgICAgICAgIG1jX2Vu Z2luZSAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRfZ2x5cGgsIFRFWFRf QVJFQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICB4LCB4X2xpbWl0LCB1cGRhdGVkX3Jvdy0+ eSwgaHBvcywgdnBvcywgTUNfSEJBUiwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBjdXJz b3JfbWF0cml4LCBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sCisgICAgICAgICAgICAgICAgICAg ICAgICAgZGVidWdfcCA/IGRlYnVnX2ZnIDogZXNzZW50aWFscy5jaF9mZ1tyb3dfcG9zaXRpb25d LAorICAgICAgICAgICAgICAgICAgICAgICAgIEhPUklaT05UQUxfUlVMRVIsIGRyYXdfcCwgTk9X SEVSRSwgTk9fQ0FDSEUpOworICAgICAgICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQor ICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAg ICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAg ICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgIHx8ICgh ZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJW QVIgKGIsIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkpCisgICAgICAgICAgICAgICAgJiYgIWZpbGxf Y29sdW1uX3RydW1wc19wCisgICAgICAgICAgICAgICAgJiYgeCA8IHRleHRfYXJlYV93aWR0aAor ICAgICAgICAgICAgICAgICYmIHZwb3MgIT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAgICAgICAg ICAmJiB3LT5jdXJzb3IueCA+PSB4CisgICAgICAgICAgICAgICAgJiYgdGFyZ2V0X2dseXBoICE9 IE5VTEwKKyAgICAgICAgICAgICAgICAmJiBkcmF3X3ApCisgICAgICAgICAgICAgIG1jX2VuZ2lu ZSAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRfZ2x5cGgsIFRFWFRfQVJF QSwKKyAgICAgICAgICAgICAgICAgICAgICAgICB4LCB4X2xpbWl0LCB1cGRhdGVkX3Jvdy0+eSwg aHBvcywgdnBvcywgTUNfQkFSLCAxLAorICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9t YXRyaXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwKKyAgICAgICAg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jYW4gcG90ZW50aWFsbHkgZHJhdyBvdmVyIHRoZSBi b3JkZXIuICovCisgICAgICAgICAgY3VycmVudF9yb3ctPnJlZHJhd19mcmluZ2VfYml0bWFwc19w ID0gMTsKKyAgICAgICAgfQorICAgICAgYm9vbCB1cGRhdGVkX3AgPSBtY191cGRhdGVfdGV4dF9h cmVhICh3LCBkZXNpcmVkX3JvdywgdnBvcywgY3Vyc29yX21hdHJpeCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscywgZHJhd19wKTsKKyAgICAg IC8qIFVwZGF0ZSB0aGUgZGlzcGxheSBvZiB0aGUgdGV4dCBhcmVhLiAqLworICAgICAgaWYgKHVw ZGF0ZWRfcCkKKyAgICAgICAgeworICAgICAgICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAgICAg aWYgKGN1cnJlbnRfcm93LT5tb3VzZV9mYWNlX3ApCisgICAgICAgICAgICAqbW91c2VfZmFjZV9v dmVyd3JpdHRlbl9wID0gMTsKKyAgICAgICAgfQorICAgICAgLyogVXBkYXRlIGRpc3BsYXkgb2Yg dGhlIHJpZ2h0IG1hcmdpbiBhcmVhLCBpZiB0aGVyZSBpcyBvbmUuICovCisgICAgICBpZiAoIWRl c2lyZWRfcm93LT5mdWxsX3dpZHRoX3AgJiYgdy0+cmlnaHRfbWFyZ2luX2NvbHMgPiAwKQorICAg ICAgICB7CisgICAgICAgICAgY2hhbmdlZF9wID0gMTsKKyAgICAgICAgICB1cGRhdGVfbWFyZ2lu YWxfYXJlYSAodywgZGVzaXJlZF9yb3csIFJJR0hUX01BUkdJTl9BUkVBLCB2cG9zKTsKKyAgICAg ICAgfQorICAgICAgLyogRHJhdyB0cnVuY2F0aW9uIG1hcmtzIGV0Yy4gKi8KKyAgICAgIGlmICgh Y3VycmVudF9yb3ctPmVuYWJsZWRfcAorICAgICAgICAgIHx8IGRlc2lyZWRfcm93LT55ICE9IGN1 cnJlbnRfcm93LT55Cisg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y3QgbWNfbWF0 cml4IG9sZF9tYXRyaXgpCit7CisgIGJvb2wgZGVidWdfcCA9IGZhbHNlOworICBib29sIGdvX29u ZV9wID0gKG9sZF9tYXRyaXguY3Vyc29yc191c2VkW01DX0NBQ0hFXSA+IDAKKyAgICAgICAgICAg ICAgICAgICB8fCBvbGRfbWF0cml4LmN1cnNvcnNfdXNlZFtDSF9DQUNIRV0gPiAwCisgICAgICAg ICAgICAgICAgICAgfHwgb2xkX21hdHJpeC5jdXJzb3JzX3VzZWRbRkNfQ0FDSEVdID4gMCk7Cisg IGJvb2wgZ29fdHdvX3AgPSAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAg ICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQor ICAgICAgICAgICAgICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKSk7CisgIGJvb2wgdXBkYXRpbmdfZnJh bWVfcCA9IGZhbHNlOworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAg aWYgKFhGUkFNRSAody0+ZnJhbWUpICE9IGYtPm1jX3VwZGF0aW5nX2ZyYW1lCisgICAgICAmJiAo Z29fb25lX3AgfHwgZ29fdHdvX3ApKQorICAgIHsKKyAgICAgIHVwZGF0aW5nX2ZyYW1lX3AgPSB0 cnVlOworICAgICAgdXBkYXRlX2JlZ2luIChmKTsKKyAgICB9CisgIGlmICh3LT5waHlzX2N1cnNv cl9vbl9wCisgICAgICAmJiBnb190d29fcCkKKyAgICBlcmFzZV9waHlzX2N1cnNvciAodyk7Cisg IGZvciAoaW50IHZudGggPSAwOworICAgICAgIGdvX29uZV9wCisgICAgICAgJiYgdm50aCA8IHct Pm1jX21hdHJpeC52cG9zX3VzZWQ7CisgICAgICAgKyt2bnRoKQorICAgIHsKKyAgICAgIGZvciAo ZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICAgICAgY2Fj aGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICAgICArK2NhY2hlX3R5cGUpCisgICAgICAgIGZv ciAoaW50IG50aF8wID0gMDsKKyAgICAgICAgICAgICBtY190cmF2ZXJzZV9jYWNoZV9wIChvbGRf bWF0cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGhfMCk7CisgICAgICAgICAgICAgKytudGhfMCkK KyAgICAgICAgICB7CisgICAgICAgICAgICBib29sIHNhbWVfcCA9IGZhbHNlOworICAgICAgICAg ICAgZm9yIChpbnQgd19udGggPSAwOyB3X250aCA8IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlX3VzZWRbY2FjaGVfdHlwZV07ICsrd19udGgpCisgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICBzYW1lX3AgfD0gKG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMF0uZ2x5cGgudHlwZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgudHlwZQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgKChvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLmJ5dGVwb3MKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b d19udGhdLmdseXBoLmJ5dGVwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwg KG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0ucm93X3Bvc2l0 aW9uID09IEFUX1pWCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5yb3dfcG9zaXRpb24g PT0gQVRfWlYpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0ucm93X3Bvc2l0aW9uID09IFBPU1Rf WlYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLnJvd19wb3NpdGlvbiA9PSBQT1NUX1pW KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICgob2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5jaGFycG9zCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3dfbnRoXS5nbHlwaC5jaGFycG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHx8IChvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLnJvd19w b3NpdGlvbiA9PSBBVF9aVgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0ucm93X3Bvc2l0 aW9uID09IEFUX1pWKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLnJvd19wb3NpdGlvbiA9PSBQ T1NUX1pWCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5yb3dfcG9zaXRpb24gPT0gUE9T VF9aVikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnUudmFsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W3dfbnRoXS5nbHlwaC51LnZhbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5mYWNlX2lkCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5mYWNlX2lkCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBd LmdseXBoLnBhZGRpbmdfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgucGFkZGluZ19w CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLmxlZnRfYm94X2xpbmVfcAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVt3X250aF0uZ2x5cGgubGVmdF9ib3hfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmds eXBoLnJpZ2h0X2JveF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnJpZ2h0 X2JveF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGgudm9mZnNldAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVt3X250aF0uZ2x5cGgudm9mZnNldAorICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5w aXhlbF93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgucGl4ZWxfd2lkdGgKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMF0uZ2x5cGguc2xpY2UuaW1nLngKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19u dGhdLmdseXBoLnNsaWNlLmltZy54CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnNsaWNlLmlt Zy55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5pbWcueQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS5nbHlwaC5zbGljZS5pbWcud2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhd LmdseXBoLnNsaWNlLmltZy53aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5zbGljZS5p bWcuaGVpZ2h0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5pbWcuaGVpZ2h0 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnNsaWNlLmNtcC5mcm9tCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5jbXAuZnJvbQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS54Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3dfbnRoXS54CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZ4CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3dfbnRoXS5meAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS55CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3dfbnRoXS55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZ5CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3df bnRoXS5meQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5ocG9zCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRo XS5ocG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLnZwb3MKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhd LnZwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0ud2QKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLndk CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzBdLmgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmgKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMF0uY3Vyc29yX3R5cGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmN1cnNv cl90eXBlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmN1cnNvcl93aWR0aAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVt3X250aF0uY3Vyc29yX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZnLnJlZAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVt3X250aF0uZmcucmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZnLmdyZWVuCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5mZy5ncmVlbgorICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5mZy5i bHVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5mZy5ibHVlCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBd LmJnLnJlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uYmcucmVkCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XzBdLmJnLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5iZy5ncmVlbgorICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS5iZy5ibHVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5iZy5ibHVlCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzBdLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09 IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5hY3RpdmVf cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaF9mbGF2b3IKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19u dGhdLmdseXBoX2ZsYXZvcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5lbmFibGVkX3AKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bd19udGhdLmVuYWJsZWRfcCk7CisgICAgICAgICAgICAgICAgaWYgKHNhbWVfcCkK KyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGRlYnVnX3ApCisg ICAgICAgICAgICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiSElUICglcyk6ICB2cG9zICgl ZCkgfCBocG9zICglZCkgfCBjaGFyICglcylcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAoY2FjaGVfdHlwZSA9PSBNQ19DQUNIRSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyAiTUMiCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IChjYWNoZV90eXBlID09IENIX0NBQ0hFKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/ICJDSCIKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogKGNhY2hlX3R5cGUgPT0gRkNfQ0FDSEUpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gIkZDIgorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiAiTk8iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhd LnZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uaHBvcywKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nICh3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgudS5jaCkpOworICAg ICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVt3X250aF0uc2FtZV9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAg ICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmIChkZWJ1Z19wKQorICAg ICAgICAgICAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJNSVNTICglcyk6ICB2cG9zICglZCkg fCBocG9zICglZCB2LiAlZCkgfCBjaGFyICglcyB2LiAlcykgfCBjYWNoZV91c2VkICglZCB2LiAl ZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNhY2hlX3R5cGUg PT0gTUNfQ0FDSEUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICJN QyIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjYWNoZV90eXBlID09 IENIX0NBQ0hFKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAiQ0gi CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY2FjaGVfdHlwZSA9PSBG Q19DQUNIRSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gIkZDIgor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogIk5PIiwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVt3X250aF0udnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmhwb3Ms CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmhwb3MsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgbWNfY2hhcl90b19zdHJpbmcgKG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGgudS5jaCksCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgbWNfY2hhcl90b19zdHJpbmcgKHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC51LmNoKSwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNl ZFtjYWNoZV90eXBlXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdKTsKKyAgICAgICAgICAg ICAgfQorICAgICAgICAgICAgaWYgKCFzYW1lX3ApCisgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAvKiBgbWF0cml4X3JvdycgaW4gYGRpc3BuZXcuY2AgY29udGFpbnMgdGhlIGZvbGxv d2luZyB0ZXN0cywKKyAgICAgICAgICAgICAgICBlYXNzZXJ0IChtYXRyaXggJiYgbWF0cml4LT5y b3dzKTsKKyAgICAgICAgICAgICAgICBlYXNzZXJ0IChyb3cgPj0gMCAmJiByb3cgPCBtYXRyaXgt Pm5yb3dzKTsgKi8KKyAgICAgICAgICAgICAgICBib29sIGJhcmZfY3Jhc2hfb25lID0gKHctPmN1 cnJlbnRfbWF0cml4ICYmIHctPmN1cnJlbnRfbWF0cml4LT5yb3dzKSA/IGZhbHNlIDogdHJ1ZTsK KyAgICAgICAgICAgICAgICBpZiAoYmFyZl9jcmFzaF9vbmUpCisgICAgICAgICAgICAgICAgICBj b250aW51ZTsKKyAgICAgICAgICAgICAgICBib29sIGJhcmZfY3Jhc2hfdHdvID0gKHZudGggPj0g MCAmJiB2bnRoIDwgdy0+Y3VycmVudF9tYXRyaXgtPm5yb3dzKSA/IGZhbHNlIDogdHJ1ZTsKKyAg ICAgICAgICAgICAgICBpZiAoYmFyZl9jcmFzaF90d28pCisgICAgICAgICAgICAgICAgICBjb250 aW51ZTsKKyAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICp2bnRoX3JvdyA9IE1BVFJJ WF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB2bnRoKTsKKyAgICAgICAgICAgICAgICBpbnQgeF8w ID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS54OworICAg ICAgICAgICAgICAgIGludCBmeF8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8wXS5meDsKKyAgICAgICAgICAgICAgICBpbnQgeV8wID0gb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS55OworICAgICAgICAgICAgICAgIGlu dCBmeV8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5m eTsKKyAgICAgICAgICAgICAgICBpbnQgaHBvc18wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8wXS5ocG9zOworICAgICAgICAgICAgICAgIGludCB2cG9zXzAg PSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLnZwb3M7Cisg ICAgICAgICAgICAgICAgaW50IHdkXzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzBdLndkOworICAgICAgICAgICAgICAgIGludCBoXzAgPSBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmg7CisgICAgICAgICAgICAgICAg ZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZV8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5jdXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAgICBp bnQgY3Vyc29yX3dpZHRoXzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXzBdLmN1cnNvcl93aWR0aDsKKyAgICAgICAgICAgICAgICAvLyAgc3RydWN0IG1jX1JH QiBsc2xfZmdfMCA9IHsucmVkID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS5mZy5yZWQsCisgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAg ICAgICAgICAgLmdyZWVuID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF8wXS5mZy5ncmVlbiwKKyAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAuYmx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhfMF0uZmcuYmx1ZX07CisgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfYmdfMCA9 IHsucmVkID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5i Zy5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4g PSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmJnLmdyZWVu LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmJnLmJsdWV9OworICAg ICAgICAgICAgICAgIGJvb2wgYWN0aXZlX3BfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMF0uYWN0aXZlX3A7CisgICAgICAgICAgICAgICAgZW51bSBtY19m bGF2b3IgZ2x5cGhfZmxhdm9yXzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXzBdLmdseXBoX2ZsYXZvcjsKKyAgICAgICAgICAgICAgICBib29sIGVuYWJsZWRf cF8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5lbmFi bGVkX3A7CisgICAgICAgICAgICAgICAgaWYgKHZwb3NfMCA9PSB2bnRoCisgICAgICAgICAgICAg ICAgICAgICYmIGdseXBoX2ZsYXZvcl8wID09IE1DX0dMWVBICisgICAgICAgICAgICAgICAgICAg ICYmIGVuYWJsZWRfcF8wCisgICAgICAgICAgICAgICAgICAgICYmIHZudGhfcm93LT5lbmFibGVk X3ApCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIG1jX2VyYXNlX2N1 cnNvciAodywgdy0+Y3VycmVudF9tYXRyaXgsIHZudGhfcm93LCB4XzAsIHlfMCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBocG9zXzAsIHZwb3NfMCwgZ2x5cGhfZmxhdm9y XzAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGVfMCwg d2RfMCk7CisgICAgICAgICAgICAgICAgICAgIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMF0uZW5hYmxlZF9wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAg IC0tb2xkX21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVfdHlwZV07CisgICAgICAgICAgICAgICAg ICAgIC8qIElmIHdlIGluYWR2ZXJ0ZW50bHkgZXJhc2VkIGFub3RoZXIgZmFrZSBjdXJzb3IgYXQg dGhlIHNhbWUKKyAgICAgICAgICAgICAgICAgICAgSFBPUyB0aGF0IGlzIHN0aWxsIGVuYWJsZWRf cCBpbiB0aGUgYG9sZF9tYXRyaXhgLCB0aGVuIHJlZHJhdyBpdC4gKi8KKyAgICAgICAgICAgICAg ICAgICAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOworICAg ICAgICAgICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICAgICAg ICAgICAgICAgICAgICArK2NhY2hlX3R5cGUpCisgICAgICAgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgbnRoXzEgPSAwOworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBtY190cmF2ZXJzZV9jYWNoZV9wIChvbGRfbWF0cml4LCBjYWNoZV90eXBl LCB2bnRoLCBudGhfMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsrbnRoXzEpCisg ICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBp bnQgeF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS54 OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmeF8xID0gb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5meDsKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICBpbnQgeV8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF8xXS55OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmeV8xID0gb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5meTsKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICBpbnQgaHBvc18xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF8xXS5ocG9zOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlu dCB2cG9zXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFd LnZwb3M7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHdkXzEgPSBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLndkOworICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGludCBoXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXzFdLmg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJz b3JfdHlwZSBjdXJzb3JfdHlwZV8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8xXS5jdXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBp bnQgY3Vyc29yX3dpZHRoXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXzFdLmN1cnNvcl93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1 Y3QgbWNfUkdCIGxzbF9mZ18xID0gey5yZWQgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXzFdLmZnLnJlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZmcuZ3JlZW4sCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZmcuYmx1ZX07CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgLy8gIHN0cnVjdCBtY19SR0IgbHNsX2JnXzEgPSB7LnJlZCA9IG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uYmcucmVkLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9 IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uYmcuZ3JlZW4s CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAg ICAgLmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFd LmJnLmJsdWV9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgYWN0aXZlX3BfMSA9 IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uYWN0aXZlX3A7 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9y XzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmdseXBo X2ZsYXZvcjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGVuYWJsZWRfcF8xID0g b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5lbmFibGVkX3A7 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBnb19wXzEgPSAoaHBvc18wID09IGhw b3NfMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGVuYWJs ZWRfcF8xKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWdvX3BfMSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGJvb2wgcmVtb3ZlX3BfMSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAg ICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCB3LT5jdXJyZW50X21hdHJpeCwgdm50aF9yb3cs IHhfMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ZnhfMSwgeV8xLCBmeV8xLCBocG9zXzEsIHZwb3NfMSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgd2RfMSwgaF8xLCBjdXJzb3JfdHlwZV8xLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lk dGhfMSwgbHNsX2ZnXzEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGFjdGl2ZV9wXzEsIGdseXBoX2ZsYXZvcl8xLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVfcF8xKTsKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHZwb3NfMCA9PSB2bnRoCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3BfMAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgdm50aF9yb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgICAgIGJvb2wgcmVtb3ZlX3BfMCA9IHRydWU7CisgICAgICAgICAgICAg ICAgICAgICAgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHcsIHctPmN1cnJlbnRfbWF0cml4LCB2bnRo X3JvdywgeF8wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBm eF8wLCB5XzAsIGZ5XzAsIGhwb3NfMCwgdnBvc18wLCB3ZF8wLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBoXzAsIGN1cnNvcl90eXBlXzAsIGN1cnNvcl93aWR0 aF8wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsc2xfYmdf MCwgYWN0aXZlX3BfMCwgZ2x5cGhfZmxhdm9yXzAsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHJlbW92ZV9wXzApOworICAgICAgICAgICAgICAgICAgICAgIG9s ZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZW5hYmxlZF9wID0g ZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgLS1vbGRfbWF0cml4LmN1cnNvcnNfdXNlZFtj YWNoZV90eXBlXTsKKyAgICAgICAgICAgICAgICAgICAgICAvKiBJZiB3ZSBpbmFkdmVydGVudGx5 IGVyYXNlZCBhbm90aGVyIGZha2UgY3Vyc29yIGF0IHRoZSBzYW1lCisgICAgICAgICAgICAgICAg ICAgICAgSFBPUyB0aGF0IGlzIHN0aWxsIGVuYWJsZWRfcCBpbiB0aGUgYG9sZF9tYXRyaXhgLCB0 aGVuIHJlZHJhdyBpdC4gKi8KKyAgICAgICAgICAgICAgICAgICAgICBmb3IgKGVudW0gbWNfY2Fj aGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7CisgICAgICAgICAgICAgICAgICAgICAgICAg ICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICArK2Nh Y2hlX3R5cGUpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAg ICAgICAgIGZvciAoaW50IG50aF8yID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBtY190cmF2ZXJzZV9jYWNoZV9wIChvbGRfbWF0cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGhf Mik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKytudGhfMikKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgeF8y ID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS54OworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZ4XzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmZ4OworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgaW50IHlfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhfMl0ueTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmeV8yID0gb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5meTsKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGludCBocG9zXzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzJdLmhwb3M7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBpbnQgdnBvc18yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8yXS52cG9zOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHdkXzIgPSBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLndkOworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgaW50IGhfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMl0uaDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVu dW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGVfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMl0uY3Vyc29yX3R5cGU7CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBpbnQgY3Vyc29yX3dpZHRoXzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzJdLmN1cnNvcl93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnXzIgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uZmcucmVkLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmZnLmdyZWVuLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9 IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uZmcuYmx1ZX07 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgc3RydWN0IG1jX1JHQiBsc2xfYmdf MiA9IHsucmVkID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8y XS5iZy5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAuZ3JlZW4gPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXzJdLmJnLmdyZWVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8g ICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmJnLmJsdWV9OworICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgYm9vbCBhY3RpdmVfcF8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8yXS5hY3RpdmVfcDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvcl8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8yXS5nbHlwaF9mbGF2b3I7CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBib29sIGVuYWJsZWRfcF8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF8yXS5lbmFibGVkX3A7CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBib29sIGdvX3BfMiA9IChocG9zXzAgPT0gaHBvc18yCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBmeF8wIDw9IGZ4XzIKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGZ4XzAgKyB3ZF8wID4gZnhfMiArIHdk XzIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGVuYWJs ZWRfcF8yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZ29fcF8yKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGJvb2wgcmVtb3ZlX3BfMiA9IGZhbHNlOworICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHcsIHctPmN1cnJlbnRfbWF0cml4LCB2 bnRoX3JvdywgeF8yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGZ4XzIsIHlfMiwgZnlfMiwgaHBvc18yLCB2cG9zXzIsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2RfMiwgaF8yLCBjdXJzb3Jf dHlwZV8yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGN1cnNvcl93aWR0aF8yLCBsc2xfZmdfMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVfcF8yLCBnbHlwaF9mbGF2b3JfMiwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVf cF8yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAg ICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgfQorICAgIH0KKyAgaWYgKHVwZGF0aW5nX2ZyYW1lX3ApCisgICAgdXBkYXRlX2VuZCAoZik7 Cit9CisKK3ZvaWQKK21jX3VwZGF0ZV93aW5kb3dfZHJ5cnVuIChzdHJ1Y3Qgd2luZG93ICp3LCBi b29sIGZvcmNlX3AsIHN0cnVjdCBtY19lc3NlbnRpYWxzIGVzc2VudGlhbHMpCit7CisgIGlmICgh QlVGRkVSUCAody0+Y29udGVudHMpKQorICAgIHJldHVybjsKKworICBpZiAody0+bWNfbWF0cml4 LmN1c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gIHN0cnVjdCBnbHlw aF9yb3cgKmVuZCA9IE1BVFJJWF9NT0RFX0xJTkVfUk9XIChkZXNpcmVkX21hdHJpeCk7CisKKyAg ICAgIC8qIFRha2Ugbm90ZSBvZiB0aGUgaGVhZGVyIGxpbmUsIGlmIHRoZXJlIGlzIG9uZS4gIFdl IHdpbGwKKyAgICAgICAgIHVwZGF0ZSBpdCBiZWxvdywgYWZ0ZXIgdXBkYXRpbmcgYWxsIG9mIHRo ZSB3aW5kb3cncyBsaW5lcy4gKi8KKyAgICAgIGlmIChyb3ctPm1vZGVfbGluZV9wKQorICAgICAg ICB7CisgICAgICAgICAgaGVhZGVyX2xpbmVfcm93ID0gcm93OworICAgICAgICAgICsrcm93Owor ICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICBoZWFkZXJfbGluZV9yb3cgPSBOVUxM OworCisgICAgICAvKiBVcGRhdGUgdGhlIG1vZGUgbGluZSwgaWYgbmVjZXNzYXJ5LiAqLworICAg ICAgc3RydWN0IGdseXBoX3JvdyAqbW9kZV9saW5lX3JvdyA9IE1BVFJJWF9NT0RFX0xJTkVfUk9X IChkZXNpcmVkX21hdHJpeCk7CisgICAgICBpZiAobW9kZV9saW5lX3Jvdy0+bW9kZV9saW5lX3Ag JiYgbW9kZV9saW5lX3Jvdy0+ZW5hYmxlZF9wKQorICAgICAgICB7CisgICAgICAgICAgbW9kZV9s aW5lX3Jvdy0+eSA9IHliICsgV0lORE9XX1NDUk9MTF9CQVJfQVJFQV9IRUlHSFQgKHcpOworICAg ICAgICAgIHVwZGF0ZV93aW5kb3dfbGluZSAodywgTUFUUklYX1JPV19WUE9TIChtb2RlX2xpbmVf cm93LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBk ZXNpcmVkX21hdHJpeCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmbW91c2VfZmFj ZV9vdmVyd3JpdHRlbl9wKTsKKyAgICAgICAgfQorCisgICAgICAvKiBGaW5kIGZpcnN0IGVuYWJs ZWQgcm93LiAgT3B0aW1pemF0aW9ucyBpbiByZWRpc3BsYXlfaW50ZXJuYWwKKyAgICAgICAgIG1h eSBsZWFkIHRvIGFuIHVwZGF0ZSB3aXRoIG9ubHkgb25lIHJvdyBlbmFibGVkLiAgVGhlcmUgbWF5 CisgICAgICAgICBiZSBhbHNvIGNvbXBsZXRlbHkgZW1wdHkgbWF0cmljZXMuICovCisgICAgICB3 aGlsZSAocm93IDwgZW5kICYmICFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgKytyb3c7CisKKyAg ICAgIC8qIFRyeSByZXVzaW5nIHBhcnQgb2YgdGhlIGRpc3BsYXkgYnkgY29weWluZy4gKi8KKyAg ICAgIGlmIChyb3cgPCBlbmQgJiYgIXctPmRlc2lyZWRfbWF0cml4LT5ub19zY3JvbGxpbmdfcCkK KyAgICAgICAgeworICAgICAgICAgIGludCByYyA9IG1jX3Njcm9sbGluZ193aW5kb3cgKHcsIGhl YWRlcl9saW5lX3JvdyAhPSBOVUxMKTsKKyAgICAgICAgICBpZiAocmMgPCAwKQorICAgICAgICAg ICAgeworICAgICAgICAgICAgICAvKiBBbGwgcm93cyB3ZXJlIGZvdW5kIHRvIGJlIGVxdWFsLiAq LworICAgICAgICAgICAgICBwYXVzZWRfcCA9IDA7CisgICAgICAgICAgICAgIGdvdG8gc2V0X2N1 cnNvcjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKHJjID4gMCkKKyAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIFdlJ3ZlIHNjcm9sbGVkIHRoZSBkaXNwbGF5 LiAqLworICAgICAgICAgICAgICAgIGZvcmNlX3AgPSAxOworICAgICAgICAgICAgICAgIGNoYW5n ZWRfcCA9IDE7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgLyogUHJvY2VzcyB0 aGUgY3Vyc29yIHJvdyBhdCB0aGUgb3V0c2V0I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AgICAgICAgICAgICBjdXJzb3JfbWF0cml4ID0gdy0+ZGVzaXJlZF9tYXRyaXg7CisgICAg ICAgICAgICAgIGlmICghZm9yY2VfcCAmJiArK25fdXBkYXRlZCAlIHByZWVtcHRfY291bnQgPT0g MCkKKyAgICAgICAgICAgICAgICBkZXRlY3RfaW5wdXRfcGVuZGluZ19pZ25vcmVfc3F1ZWV6YWJs ZXMgKCk7CisgICAgICAgICAgICAgIGNoYW5nZWRfcCB8PSBtY191cGRhdGVfd2luZG93X2xpbmUg KHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3cml0dGVuX3AsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMs IGRyYXdfcCk7CisgICAgICAgICAgICAgIGlmIChNQVRSSVhfUk9XX0JPVFRPTV9ZIChyb3cpID49 IHliKQorICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSB2cG9zICsgMTsgaSA8IHctPmN1cnJl bnRfbWF0cml4LT5ucm93cyAtIDE7ICsraSkKKyAgICAgICAgICAgICAgICAgIFNFVF9NQVRSSVhf Uk9XX0VOQUJMRURfUCAody0+Y3VycmVudF9tYXRyaXgsIGksIGZhbHNlKTsKKyAgICAgICAgICAg ICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGN1cnNvcl9tYXRyaXgg PSB3LT5jdXJyZW50X21hdHJpeDsKKyAgICAgIC8qIFVwZGF0ZSB0aGUgcmVzdCBvZiB0aGUgbGlu ZXMuICovCisgICAgICBmb3IgKDsgcm93IDwgZW5kICYmIChmb3JjZV9wIHx8ICFpbnB1dF9wZW5k aW5nKTsgKytyb3cpCisgICAgICAgIC8qIHNjcm9sbGluZ193aW5kb3cgcmVzZXRzIHRoZSBlbmFi bGVkX3AgZmxhZyBvZiB0aGUgcm93cyBpdCByZXVzZXMgZnJvbQorICAgICAgICBjdXJyZW50X21h dHJpeC4gKi8KKyAgICAgICAgaWYgKHJvdy0+ZW5hYmxlZF9wKQorICAgICAgICAgIHsKKyAgICAg ICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIHctPmRlc2lyZWRfbWF0cml4 KTsKKyAgICAgICAgICAgIC8qIElmIHRoZSBgY3Vyc29yX3Jvd2AgaXMgd2l0aGluIHRoZSBgZGVz aXJlZF9tYXRyaXhgLCB0aGVuIGl0IHdhcworICAgICAgICAgICAgcHJvY2Vzc2VkIGhlcmVpbmFi b3ZlIGFuZCBzaG91bGQgYmUgc2tpcHBlZCBhdCB0aGlzIHRpbWUuICovCisgICAgICAgICAgICBp ZiAodnBvcyA9PSB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAg ICAgICAgaW50IGk7CisgICAgICAgICAgICAvKiBXZSdsbCBoYXZlIHRvIHBsYXkgYSBsaXR0bGUg Yml0IHdpdGggd2hlbiB0bworICAgICAgICAgICAgICAgZGV0ZWN0X2lucHV0X3BlbmRpbmcuICBJ ZiBpdCdzIGRvbmUgdG9vIG9mdGVuLAorICAgICAgICAgICAgICAgc2Nyb2xsaW5nIGxhcmdlIHdp bmRvd3Mgd2l0aCByZXBlYXRlZCBzY3JvbGwtdXAKKyAgICAgICAgICAgICAgIGNvbW1hbmRzIHdp bGwgdG9vIHF1aWNrbHkgcGF1c2UgcmVkaXNwbGF5LiAqLworICAgICAgICAgICAgaWYgKCFmb3Jj ZV9wICYmICsrbl91cGRhdGVkICUgcHJlZW1wdF9jb3VudCA9PSAwKQorICAgICAgICAgICAgICBk ZXRlY3RfaW5wdXRfcGVuZGluZ19pZ25vcmVfc3F1ZWV6YWJsZXMgKCk7CisgICAgICAgICAgICBj aGFuZ2VkX3AgfD0gbWNfdXBkYXRlX3dpbmRvd19saW5lICh3LCB2cG9zLCAmbW91c2VfZmFjZV9v dmVyd3JpdHRlbl9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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ml4LCBpLCBmYWxzZSk7CisgICAgICAgICAgfQorICAgICAgLyogV2Fz IGRpc3BsYXkgcHJlZW1wdGVkPyAqLworICAgICAgcGF1c2VkX3AgPSByb3cgPCBlbmQ7CisgICAg ICBzZXRfY3Vyc29yOgorICAgICAgLyogSWYgd2UganVtcGVkIGhlcmUgZnJvbSBgc2V0X2N1cnNv cmAsIHRoZW4gc2V0IHRoZSBgY3Vyc29yX21hdHJpeGAuICovCisgICAgICBpZiAoY3Vyc29yX21h dHJpeCA9PSBOVUxMKQorICAgICAgICBjdXJzb3JfbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7 CisgICAgICAvKiBSZXNldCBgcm93YCB0byAwIHNvIHRoYXQgZmFrZSBjdXJzb3JzIGNhbiBiZSBk cmF3biBvbiByb3dzIHByZWNlZGluZyB0aGUKKyAgICAgIGZpcnN0IGByb3ctPmVuYWJsZWRfcGAu ICBKdXN0IHByaW9yIHRvIHRoZSBjYWxsIHRvIGBzY3JvbGxpbmdfd2luZG93JyBhYm92ZSwKKyAg ICAgIGByb3dgIHdhcyBhZHZhbmNlZCB0byB0aGUgZmlyc3QgYHJvdy0+ZW5hYmxlZF9wYC4gKi8K KyAgICAgIGZvciAoc3RydWN0IGdseXBoX3JvdyAqZGVzaXJlZF9yb3cgPSBNQVRSSVhfUk9XICh3 LT5kZXNpcmVkX21hdHJpeCwgMCk7CisgICAgICAgICAgIGRlc2lyZWRfcm93IDwgZW5kCisgICAg ICAgICAgICYmIChmb3JjZV9wIHx8ICFpbnB1dF9wZW5kaW5nKQorICAgICAgICAgICAvKiBXMzIg RW1hY3MgY3Jhc2hlcyBvbiBzdGFydHVwIHdpdGhvdXQgYSBCVUZGRVJQIGNoZWNrLiAqLworICAg ICAgICAgICAmJiBCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgJiYgKCFOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAgICAgICAgICAgfHwg IU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAg ICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxl KSkpOworICAgICAgICAgICArK2Rlc2lyZWRfcm93KQorICAgICAgICB7CisgICAgICAgICAgaW50 IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKGRlc2lyZWRfcm93LCB3LT5kZXNpcmVkX21hdHJpeCk7 CisgICAgICAgICAgaWYgKGRlc2lyZWRfcm93LT5lbmFibGVkX3ApCisgICAgICAgICAgICBjb250 aW51ZTsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpjdXJyZW50X3JvdyA9IE1BVFJJWF9S T1cgKHctPmN1cnJlbnRfbWF0cml4LCB2cG9zKTsKKyAgICAgICAgICBlbnVtIG1jX3Jvd19wb3Np dGlvbiByb3dfcG9zaXRpb24gPSBtY19yb3dfcG9zaXRpb24gKHcsIGN1cnJlbnRfcm93LCBjdXJy ZW50X3JvdywgdnBvcyk7CisgICAgICAgICAgaWYgKGN1cnJlbnRfcm93LT5lbmFibGVkX3ApCisg ICAgICAgICAgICBtY19kcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgsIGN1cnJlbnRfcm93 LCBjdXJyZW50X3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgICAgICAgICAgICAg ICAgY3VycmVudF9yb3ctPngsIGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0sIHZwb3MsCisg ICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bv c2l0aW9uLCBkcmF3X3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgU0VUX0NVUlNPUl9PTkUp OworICAgICAgICB9CisKKyAgICAgIG1jX3Jlc3RvcmVfZ2x5cGhfbWF0cml4IChzY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21hdHJpeCA9IHctPmRlc2lyZWRfbWF0cml4ID0gTlVMTDsK KworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwor ICBtY194ZnJlZV9jYWNoZV9tYXRyaXggKHcsICZ3LT5tY19tYXRyaXgpOworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAJfQogCiAgICAgICAvKiBOZXh0IHdpbmRvdyBvbiBzYW1lIGxl dmVsLiAgKi8KQEAgLTMzODcsNiArNTE2OSwyNiBAQCBjaGVja19jdXJyZW50X21hdHJpeF9mbGFn cyAoc3RydWN0IHdpbmRvdyAqdykKIHN0YXRpYyBib29sCiB1cGRhdGVfd2luZG93IChzdHJ1Y3Qg d2luZG93ICp3LCBib29sIGZvcmNlX3ApCiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgaWYgKG1jX3N0ZGVycl9wKQorICAgIGZwcmlu dGYgKHN0ZGVyciwgInVwZGF0ZV93aW5kb3cgKCVzKVxuIiwgbWNfd2luZG93ICh3KSk7CisKKyAg c3RydWN0IG1jX2Vzc2VudGlhbHMgZXNzZW50aWFsczsKKyAgbWNfc2V0X2Vzc2VudGlhbHMgKHcs ICZlc3NlbnRpYWxzKTsKKworICBtY191cGRhdGVfd2luZG93X2RyeXJ1biAodywgZm9yY2VfcCwg ZXNzZW50aWFscyk7CisKKyAgc3RydWN0IGdseXBoX21hdHJpeCAqY3Vyc29yX21hdHJpeCA9IE5V TEw7CisKKyAgYm9vbCBkcmF3X3AgPSB0cnVlOworCisvKiAqKioqKioqKioqKio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GUgYWNjdXJhY3kgb2YgYFJPVy0+dXNlZFtURVhUX0FS RUFdYC4gIFRoZXJlZm9yZSwgd2UgbXVzdCBub3cgcmVseQorICBleGNsdXNpdmVseSB1cG9uIGB3 LT5jdXJyZW50X21hdHJpeCcgZm9yIGN1cnNvciByb3cgYmFzZWQgZGVjaXNpb25zLiAqLworICBm b3IgKHN0cnVjdCBnbHlwaF9yb3cgKm1jX3JvdyA9IHJvdzsKKyAgICAgICBtY19yb3cgPCBlbmQg JiYgKGZvcmNlX3AgfHwgIWlucHV0X3BlbmRpbmcpOworICAgICAgICsrbWNfcm93KQorICAgIHsK KyAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChtY19yb3csIGRlc2lyZWRfbWF0cml4 KTsKKyAgICAgIGlmIChtY19yb3ctPmVuYWJsZWRfcAorICAgICAgICAgICYmIHZwb3MgPT0gdy0+ Y3Vyc29yLnZwb3MpCisgICAgICAgIHsKKyAgICAgICAgICBjdXJzb3JfbWF0cml4ID0gZGVzaXJl ZF9tYXRyaXg7CisgICAgICAgICAgaWYgKCFmb3JjZV9wICYmICsrbl91cGRhdGVkICUgcHJlZW1w dF9jb3VudCA9PSAwKQorICAgICAgICAgICAgZGV0ZWN0X2lucHV0X3BlbmRpbmdfaWdub3JlX3Nx dWVlemFibGVzICgpOworICAgICAgICAgIGNoYW5nZWRfcCB8PSAoQlVGRkVSUCAody0+Y29udGVu dHMpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgfHwgISBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGZjX3Zpc2libGUpKSkpCisgICAgICAgICAgICAgICAgICAgICAgID8gbWNfdXBkYXRlX3dpbmRv d19saW5lICh3LCB2cG9zLCAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50 aWFscywgZHJhd19wKQorICAgICAgICAgICAgICAgICAgICAgICA6IHVwZGF0ZV93aW5kb3dfbGlu ZSAodywgdnBvcywgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCk7CisgICAgICAgICAgaWYgKE1B VFJJWF9ST1dfQk9UVE9NX1kgKHJvdykgPj0geWIpCisgICAgICAgICAgICBmb3IgKGludCBpID0g dnBvcyArIDE7IGkgPCB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAgICAg ICAgICAgIFNFVF9NQVRSSVhfUk9XX0VOQUJMRURfUCAody0+Y3VycmVudF9tYXRyaXgsIGksIGZh bHNlKTsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKworICBjdXJzb3JfbWF0 cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK ICAgICAgIC8qIFVwZGF0ZSB0aGUgcmVzdCBvZiB0aGUgbGluZXMuICAqLwogICAgICAgZm9yICg7 IHJvdyA8IGVuZCAmJiAoZm9yY2VfcCB8fCAhaW5wdXRfcGVuZGluZyk7ICsrcm93KQogCS8qIHNj cm9sbGluZ193aW5kb3cgcmVzZXRzIHRoZSBlbmFibGVkX3AgZmxhZyBvZiB0aGUgcm93cyBpdApA QCAtMzQ3MSw2ICs1MzE0LDE5IEBAIHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5kb3cgKncsIGJv b2wgZm9yY2VfcCkKIAlpZiAocm93LT5lbmFibGVkX3ApCiAJICB7CiAJICAgIGludCB2cG9zID0g TUFUUklYX1JPV19WUE9TIChyb3csIGRlc2lyZWRfbWF0cml4KTsKKworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgICAgIC8qIElmIHRo ZSBgY3Vyc29yX3Jvd2AgaXMgd2l0aGluIHRoZSBgZGVzaXJlZF9tYXRyaXhgLCB0aGVuIGl0IHdh cworICAgICAgICAgIHByb2Nlc3NlZCBoZXJlaW5hYm92ZSBhbmQgc2hvdWxkIGJlIHNraXBwZWQg YXQgdGhpcyB0aW1lLiAqLworICAgICAgICAgIGlmICh2cG9zID09IHctPmN1cnNvci52cG9zKQor ICAgICAgICAgIGNvbnRpbnVlOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAg IGludCBpOwogCiAJICAgIC8qIFdlJ2xsIGhhdmUgdG8gcGxheSBhIGxpdHRsZSBiaXQgd2l0aCB3 aGVuIHRvCkBAIC0zNDc5LDggKzUzMzUsMjEgQEAgdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRv dyAqdywgYm9vbCBmb3JjZV9wKQogCSAgICAgICBjb21tYW5kcyB3aWxsIHRvbyBxdWlja2x5IHBh dXNlIHJlZGlzcGxheS4gICovCiAJICAgIGlmICghZm9yY2VfcCAmJiArK25fdXBkYXRlZCAlIHBy ZWVtcHRfY291bnQgPT0gMCkKIAkgICAgICBkZXRlY3RfaW5wdXRfcGVuZGluZ19pZ25vcmVfc3F1 ZWV6YWJsZXMgKCk7Ci0JICAgIGNoYW5nZWRfcCB8PSB1cGRhdGVfd2luZG93X2xpbmUgKHcsIHZw b3MsCi0JCQkJCSAgICAgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCk7CisKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgICAgICBjaGFu Z2VkX3AgfD0gKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICAgICAg JiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICEgTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpKQorICAgICAgICAgICAg ICAgICAgICAgICA/IG1jX3VwZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywgJm1vdXNlX2ZhY2Vf b3ZlcndyaXR0ZW5fcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIGRyYXdfcCkKKyAgICAgICAgICAgICAg ICAgICAgICAgOiB1cGRhdGVfd2luZG93X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3 cml0dGVuX3ApOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwogCiAJICAgIC8qIE1hcmsg YWxsIHJvd3MgYmVsb3cgdGhlIGxhc3QgdmlzaWJsZSBvbmUgaW4gdGhlIGN1cnJlbnQKIAkgICAg ICAgbWF0cml4IGFzIGludmFsaWQuICBUaGlzIGlzIG5lY2Vzc2FyeSBiZWNhdXNlIG9mCkBAIC0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hCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikp CisgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3Nz aGFpcnMpKQorICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMp LCBmY192aXNpYmxlKSkpOworICAgICAgICsrZGVzaXJlZF9yb3cpCisgICAgeworICAgICAgaW50 IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKGRlc2lyZWRfcm93LCBkZXNpcmVkX21hdHJpeCk7Cisg ICAgICBpZiAoZGVzaXJlZF9yb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgY29udGludWU7CisgICAg ICBzdHJ1Y3QgZ2x5cGhfcm93ICpjdXJyZW50X3JvdyA9IE1BVFJJWF9ST1cgKHctPmN1cnJlbnRf bWF0cml4LCB2cG9zKTsKKyAgICAgIGVudW0gbWNfcm93X3Bvc2l0aW9uIHJvd19wb3NpdGlvbiA9 IG1jX3Jvd19wb3NpdGlvbiAodywgY3VycmVudF9yb3csIGN1cnJlbnRfcm93LCB2cG9zKTsKKyAg ICAgIGlmIChjdXJyZW50X3Jvdy0+ZW5hYmxlZF9wKQorICAgICAgICBtY19kcmF3X3JvdyAodywg dy0+Y3VycmVudF9tYXRyaXgsIGN1cnJlbnRfcm93LCBjdXJyZW50X3Jvdy0+Z2x5cGhzW1RFWFRf QVJFQV0sCisgICAgICAgICAgICAgICAgICAgICBjdXJyZW50X3Jvdy0+eCwgY3VycmVudF9yb3ct PnVzZWRbVEVYVF9BUkVBXSwgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRy aXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgZHJhd19wLCBTRVRfQ1VSU09SX1RXTyk7Cisg ICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKio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cmxhcHBlZF9wIGluIGRl c2lyZWQgcm93cyBpcyAwLCBzbyBhZnRlciByb3cgYXNzaWdubWVudAorb3ZlcmxhcHBlZF9wIGlu IGN1cnJlbnQgcm93cyBpcyAwLiAqLworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRP V19GUkFNRSAodykpOworICBmb3IgKGludCBpID0gMDsgaSA8IHctPmN1cnJlbnRfbWF0cml4LT5u cm93czsgKytpKQorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdyA9IHctPmN1cnJl bnRfbWF0cml4LT5yb3dzICsgaTsKKyAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgICAg IGJyZWFrOworICAgICAgICBlbHNlIGlmIChyb3ctPm1vZGVfbGluZV9wKQorICAgICAgICAgIGNv bnRpbnVlOworICAgICAgaWYgKHJvdy0+b3ZlcmxhcHBlZF9wKQorICAgICAgICB7CisgICAgICAg ICAgZm9yIChlbnVtIGdseXBoX3Jvd19hcmVhIGFyZWEgPSBMRUZUX01BUkdJTl9BUkVBOyBhcmVh IDwgTEFTVF9BUkVBOyArK2FyZWEpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIG91dHB1 dF9jdXJzb3JfdG8gKHcsIGksIDAsIHJvdy0+eSwgYXJlYSA9PSBURVhUX0FSRUEgPyByb3ctPngg OiAwKTsKKyAgICAgICAgICAgICAgaWYgKCFtY19yZWRyYXdfcm93ICh3LCB3LT5jdXJyZW50X21h dHJpeCwgcm93LCBhcmVhLCByb3ctPngsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgcm93LT51c2VkW2FyZWFdLCB0cnVlLCBEUkFXX05PUk1BTF9URVhULAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIFVQREFURV9XSU5ET1dfX1JFRFJBV19PVkVSTEFQUEVE X1JPV1MpCisgICAgICAgICAgICAgICAgICAmJiByb3ctPnVzZWRbYXJlYV0pCisgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgRlJBTUVfUklGIChmKS0+d3JpdGVfZ2x5cGhzICh3 LCByb3csIHJvdy0+Z2x5cGhzW2FyZWFdLCBhcmVhLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICByb3ctPnVzZWRbYXJlYV0pOworICAgICAgICAgICAgICAg ICAgRlJBTUVfUklGIChmKS0+Y2xlYXJfZW5kX29mX2xpbmUgKHcsIHJvdywgYXJlYSwgLTEpOwor ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICByb3ctPm92ZXJsYXBw ZWRfcCA9IDA7CisgICAgICAgIH0KKyAgICAgIGlmIChNQVRSSVhfUk9XX0JPVFRPTV9ZIChyb3cp ID49IHliKQorICAgICAgICBicmVhazsKKyAgICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKIAkgICAgICByZWRyYXdfb3ZlcmxhcHBpbmdfcm93cyAodywgeWIpOwogCSAgICB9CiAj ZW5kaWYKQEAgLTM1MzYsOCArNTQ4MiwyMCBAQCB1cGRhdGVfd2luZG93IChzdHJ1Y3Qgd2luZG93 ICp3LCBib29sIGZvcmNlX3ApCiAjZW5kaWYKIAogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQor CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisg IGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICBtY191cGRhdGVfd2luZG93X2ZyaW5n ZXMgKHcsIDApOworICAgIGVsc2UKICAgICAgIHVwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgMCk7 CiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIC8qIEVuZCB0aGUgdXBkYXRl IG9mIHdpbmRvdyBXLiAgRG9uJ3Qgc2V0IHRoZSBjdXJzb3IgaWYgd2UKICAgICAgICAgIHBhdXNl ZCB1cGRhdGluZyB0aGUgZGlzcGxheSBiZWNhdXNlIGluIHRoaXMgY2FzZSwKICAgICAgICAgIHNl dF93aW5kb3dfY3Vyc29yX2FmdGVyX3VwZGF0ZSBoYXNuJ3QgYmVlbiBjYWxsZWQsIGFuZApkaWZm IC0tZ2l0IGEvc3JjL2ZyYW1lLmggYi9zcmMvZnJhbWUuaAppbmRleCBmYTQ1YTMyLi41M2FkMTMx IDEwMDY0NAotLS0gYS9zcmMvZnJhbWUuaAorKysgYi9zcmMvZnJhbWUuaApAQCAtMjA1LDYgKzIw NSwxNiBAQCBzdHJ1Y3QgZnJhbWUKICAgTGlzcF9PYmplY3QgdG9vbF9iYXJfaXRlbXM7CiAgIC8q IHRvb2xfYmFyX2l0ZW1zIHNob3VsZCBiZSB0aGUgbGFzdCBMaXNwX09iamVjdCBtZW1iZXIuICAq LwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLwor CisgIC8qIE5vbi1uaWwgd2hlbiB0aGUgZnJhbWUgaXMgaW4gdGhlIHByb2Nlc3Mgb2YgYmVpbmcg dXBkYXRlZC4gKi8KKyAgc3RydWN0IGZyYW1lICptY191cGRhdGluZ19mcmFtZTsKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogICA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Li4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4ueHgu Li4iCisgICAgICAieC4uLnh4Li4iCisgICAgICAieC4uLi54eC4iCisgICAgICAieC54eHh4eHgi CisgICAgICAieC54eHh4eHgiCisgICAgICAieC4uLi54eC4iCisgICAgICAieC4uLnh4Li4iCisg ICAgICAieC4ueHguLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAg ICAieC4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY192ZXJ0aWNhbF9iYXJf cmlnaHRfYXJyb3dfYml0c1tdID17CisgIDB4ODAsIDB4ODAsIDB4ODAsIDB4OTgsIDB4OGMsIDB4 ODYsIDB4YmYsCisgIDB4YmYsIDB4ODYsIDB4OGMsIDB4OTgsIDB4ODAsIDB4ODAsIDB4ODB9Owor CisvKiAyNQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi54 eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIueHguLi54eCIK KyAgICAgICIuLnh4Li54eCIKKyAgICAgICIuLi54eC54eCIKKyAgICAgICJ4eHh4eHh4eCIKKyAg ICAgICJ4eHh4eHh4eCIKKyAgICAgICIuLi54eC54eCIKKyAgICAgICIuLnh4Li54eCIKKyAgICAg ICIueHguLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIu Li4uLi54eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3JldmVyc2VkX3ZlcnRpY2Fs X2Jhcl9yaWdodF9hcnJvd19iaXRzW10gPXsKKyAgMHgzLCAweDMsIDB4MywgMHg2MywgMHgzMywg MHgxYiwgMHhmZiwgMHhmZiwgMHgxYiwgMHgzMywgMHg2MywgMHgzLCAweDMsIDB4M307CisKKy8q IDI2CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4eHh4eHh4Igor ICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLnh4Li54IgorICAg ICAgInguLi54eC54IgorICAgICAgInguLi4ueHh4IgorICAgICAgIngueHh4eHh4IgorICAgICAg IngueHh4eHh4IgorICAgICAgInguLi4ueHh4IgorICAgICAgInguLi54eC54IgorICAgICAgIngu Lnh4Li54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInh4eHh4 eHh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfaG9sbG93X3JlY3RhbmdsZV9yaWdo dF9hcnJvd19iaXRzW10gPXsKKyAgMHhmZiwgMHg4MSwgMHg4MSwgMHg5OSwgMHg4ZCwgMHg4Nywg MHhiZiwKKyAgMHhiZiwgMHg4NywgMHg4ZCwgMHg5OSwgMHg4MSwgMHg4MSwgMHhmZn07CisKKy8q IDI3CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4eHh4eHh4Igor ICAgICAgInguLi4uLnh4IgorICAgICAgInguLi4uLnh4IgorICAgICAgIngueHguLnh4IgorICAg ICAgInguLnh4Lnh4IgorICAgICAgInguLi54eHh4IgorICAgICAgInh4eHh4eHh4IgorICAgICAg Inh4eHh4eHh4IgorICAgICAgInguLi54eHh4IgorICAgICAgInguLnh4Lnh4IgorICAgICAgIngu eHguLnh4IgorICAgICAgInguLi4uLnh4IgorICAgICAgInguLi4uLnh4IgorICAgICAgInh4eHh4 eHh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcmV2ZXJzZWRfaG9sbG93X3JlY3Rh bmdsZV9yaWdodF9hcnJvd19iaXRzW10gPXsKKyAgMHhmZiwgMHg4MSwgMHg4MSwgMHhiMSwgMHg5 OSwgMHg4ZCwgMHhmZiwKKyAgMHhmZiwgMHg4ZCwgMHg5OSwgMHhiMSwgMHg4MSwgMHg4MSwgMHhm Zn07CisKKy8qIDI4CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4 eHh4eHh4IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4u Li54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54 IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54Igor ICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAg ICAgInh4eHh4eHh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfaG9sbG93X3JlY3Rh bmdsZV9iaXRzW10gPXsKKyAgMHhmZiwgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwgMHg4 MSwKKyAgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwgMHhmZn07CisKKy8qIDI5 CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInguLi4uLi4uIgorICAg ICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAg InguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgIngu Li4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4u Li4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4u IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdmVydGljYWxfYmFyX2JpdHNbXSA9ewor ICAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwLAorICAweDgwLCAweDgw LCAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwfTsKKworLyogMzAKKyAgICAoKy1mcmluZ2Ut aGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisg ICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAg ICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAi Li4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4u Li4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiKQorKi8KK3N0YXRpYyB1 bnNpZ25lZCBzaG9ydCBtY19yZXZlcnNlZF92ZXJ0aWNhbF9iYXJfYml0c1tdID17CisgIDB4Mywg MHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4 MywgMHgzfTsKKworLyogMzEKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAg ICAieHguLi4uLi4iCisgICAgICAieHguLi4uLi4iCisgICAgICAiIHh4Li4uLi4iCisgICAgICAi Lnh4Li4uLi4iCisgICAgICAiLi54eC4uLi4iCisgICAgICAiLi54eC4uLi4iCisgICAgICAiLi4u eHguLi4iCisgICAgICAiLi4ueHguLi4iCisgICAgICAiLi4uLnh4Li4iCisgICAgICAiLi4uLnh4 Li4iCisgICAgICAiLi4uLi54eC4iCisgICAgICAiLi4uLi54eC4iCisgICAgICAiLi4uLi4ueHgi CisgICAgICAiLi4uLi4ueHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19iYWNrc2xh c2hfYml0c1tdID17CisgIDB4YzAsIDB4YzAsIDB4ZTAsIDB4NjAsIDB4MzAsIDB4MzAsIDB4MTgs IDB4MTgsIDB4YywgMHhjLCAweDYsIDB4NiwgM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AorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLnh4eHguLiIKKyAg ICAgICIueHh4eHh4LiIKKyAgICAgICJ4Li54eC4ueCIKKyAgICAgICJ4Li54eC4ueCIKKyAgICAg ICJ4eHh4eHh4eCIKKyAgICAgICJ4eC4uLi54eCIKKyAgICAgICJ4eHguLnh4eCIKKyAgICAgICIu eHh4eHh4LiIKKyAgICAgICIuLnh4eHguLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1j X3NtaWxleV9mYWNlX2JpdHNbXSA9eworICAweDNjLCAweDdlLCAweDk5LCAweDk5LCAweGZmLCAw eGMzLCAweGU3LCAweDdlLCAweDNjfTsKKworLyogMzUKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhl eGFkZWNpbWFsCisgICAgICAiLi54Li4uLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4u LnguLi4iCisgICAgICAiLi4uLi54Li4iCisgICAgICAiLi4uLnguLi4iCisgICAgICAiLi4ueC4u Li4iCisgICAgICAiLi54Li4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zaW5n bGVfYW5nbGVfcmlnaHRfYml0c1tdID17CisgIDB4MjAsIDB4MTAsIDB4OCwgMHg0LCAweDgsIDB4 MTAsIDB4MjB9OworCisvKiAzNgorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAg ICAgICIuLi4uLnguLiIKKyAgICAgICIuLi4ueC4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAg ICIuLnguLi4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLi4ueC4uLiIKKyAgICAgICIu Li4uLnguLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3NpbmdsZV9hbmdsZV9sZWZ0 X2JpdHNbXSA9eworICAweDQsIDB4OCwgMHgxMCwgMHgyMCwgMHgxMCwgMHg4LCAweDR9OworCisv KiAzNworICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICJ4eC54eC4uLiIK KyAgICAgICIueHgueHguLiIKKyAgICAgICIuLnh4Lnh4LiIKKyAgICAgICIuLi54eC54eCIKKyAg ICAgICIuLnh4Lnh4LiIKKyAgICAgICIueHgueHguLiIKKyAgICAgICJ4eC54eC4uLiIpCisqLwor c3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX2RvdWJsZV9hbmdsZV9yaWdodF9iaXRzW10gPXsKKyAg MHhkOCwgMHg2YywgMHgzNiwgMHgxYiwgMHgzNiwgMHg2YywgMHhkOH07CisKKy8qIDM4CisgICAg KCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLnh4Lnh4IgorICAgICAgIi4u eHgueHguIgorICAgICAgIi54eC54eC4uIgorICAgICAgInh4Lnh4Li4uIgorICAgICAgIi54eC54 eC4uIgorICAgICAgIi4ueHgueHguIgorICAgICAgIi4uLnh4Lnh4IikKKyovCitzdGF0aWMgdW5z aWduZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xlX2xlZnRfYml0c1tdID17CisgIDB4MWIsIDB4MzYs IDB4NmMsIDB4ZDgsIDB4NmMsIDB4MzYsIDB4MWJ9OworCisvKiAzOQorICAgICgrLWZyaW5nZS1o ZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICJ4LngueC4uLiIKKyAgICAgICIueC54LnguLiIKKyAg ICAgICIuLngueC54LiIKKyAgICAgICIuLi54LngueCIKKyAgICAgICIuLngueC54LiIKKyAgICAg ICIueC54LnguLiIKKyAgICAgICJ4LngueC4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0 IG1jX3RyaXBsZV9hbmdsZV9yaWdodF9iaXRzW10gPXsKKyAgMHhhOCwgMHg1NCwgMHgyYSwgMHgx NSwgMHgyYSwgMHg1NCwgMHhhOH07CisKKy8qIDQwCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhh ZGVjaW1hbAorICAgICAgIi4uLngueC54IgorICAgICAgIi4ueC54LnguIgorICAgICAgIi54Lngu eC4uIgorICAgICAgIngueC54Li4uIgorICAgICAgIi54LngueC4uIgorICAgICAgIi4ueC54Lngu IgorICAgICAgIi4uLngueC54IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdHJpcGxl X2FuZ2xlX2xlZnRfYml0c1tdID17CisgIDB4MTUsIDB4MmEsIDB4NTQsIDB4YTgsIDB4NTQsIDB4 MmEsIDB4MTV9OworCisvKiA0MQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAg ICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAg ICIuLi4uLi4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIu eC4uLnguLiIKKyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4u Li4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIpCisqLworc3RhdGljIHVu c2lnbmVkIHNob3J0IG1jX3NpbmdsZV9hbmdsZV91cF9iaXRzW10gPXsKKyAgMHgwMCwgMHgwMCwg MHgwMCwgMHgwMCwgMHgxMCwgMHgyOCwgMHg0NCwgMHg4MiwgMHgwMCwgMHgwMCwgMHgwMCwgMHgw MH07CisKKy8qIDQyCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4u Li4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4u Li4uIgorICAgICAgInguLi4uLnguIgorICAgICAgIi54Li4ueC4uIgorICAgICAgIi4ueC54Li4u IgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgor ICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQg c2hvcnQgbWNfc2luZ2xlX2FuZ2xlX2Rvd25fYml0c1tdID17CisgIDB4MDAsIDB4MDAsIDB4MDAs IDB4MDAsIDB4ODIsIDB4NDQsIDB4MjgsIDB4MTAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9Owor CisvKiA0MworICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4u LiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi54Li4uLiIK KyAgICAgICIuLngueC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4Li54Li54LiIKKyAg ICAgICIuLngueC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4Li4uLi54LiIKKyAgICAg ICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIpCisqLworc3Rh dGljIHVuc2lnbmVkIHNob3J0IG1jX2RvdWJsZV9hbmdsZV91cF9iaXRzW10gPXsKKyAgMHgwMCwg MHgwMCwgMHgwMCwgMHgxMCwgMHgyOCwgMHg0NCwgMHg5MiwgMHgyOCwgMHg0NCwgMHg4MiwgMHgw MCwgMHgwMCwgMHgwMH07CisKKy8qIDQ0CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1h bAorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgor ICAgICAgInguLi4uLnguIgorICAgICAgIi54Li4ueC4uIgorICAgICAgIi4ueC54Li4uIgorICAg ICAgInguLnguLnguIgorICAgICAgIi54Li4ueC4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAg Ii4uLnguLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4u Li4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xlX2Rvd25f Yml0c1tdID17CisgIDB4MDAsIDB4MDAsIDB4MDAsIDB4ODIsIDB4NDQsIDB4MjgsIDB4OTIsIDB4 NDQsIDB4MjgsIDB4MTAsIDB4MDAsIDB4MDAsIDB4MDB9OworCisvKiA0NQorICAgICgrLWZyaW5n ZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi54Li4uLiIK KyAgICAgICIuLngueC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4Li54Li54LiIKKyAg ICAgICIuLngueC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAg ICIuLngueC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIu Li4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3RyaXBsZV9hbmdsZV91cF9i aXRzW10gPXsKKyAgMHgwMCwgMHgxMCwgMHgyOCwgMHg0NCwgMHg5MiwgMHgyOCwgMHg0NCwgMHg5 MiwgMHgyOCwgMHg0NCwgMHg4MiwgMHgwMH07CisKKy8qIDQ2CisgICAgKCstZnJpbmdlLWhlbHBl ci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4uLi4uIgorICAgICAgInguLi4uLnguIgorICAgICAg Ii54Li4ueC4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi54 Li4ueC4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi54Li4u eC4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4uLi4uLi4u IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcXVhZHJ1cGxlX2FuZ2xlX2Rvd25fYml0 c1tdID17CisgIDB4MDAsIDB4ODIsIDB4NDQsIDB4MjgsIDB4OTIsIDB4NDQsIDB4MjgsIDB4OTIs IDB4NDQsIDB4MjgsIDB4MTAsIDB4MDB9OworCisvKiA0NworICAgICgrLWZyaW5nZS1oZWxwZXIt aGV4YWRlY2ltYWwKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIu eC4uLnguLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIueC4u LnguLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIueC4uLngu LiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIueC4uLnguLiIK KyAgICAgICJ4Li4uLi54LiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3F1YWRydXBs ZV9hbmdsZV91cF9iaXRzW10gPXsKKyAgMHgxMCwgMHgyOCwgMHg0NCwgMHg5MiwgMHgyOCwgMHg0 NCwgMHg5MiwgMHgyOCwgMHg0NCwgMHg5MiwgMHgyOCwgMHg0NCwgMHg4Mn07CisKKy8qIDQ4Cisg ICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInguLi4uLnguIgorICAgICAg Ii54Li4ueC4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi54 Li4ueC4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi54Li4u eC4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi54Li4ueC4u IgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi4uLnguLi4uIikKKyovCitzdGF0aWMgdW5zaWdu ZWQgc2hvcnQgbWNfdHJpcGxlX2FuZ2xlX2Rvd25fYml0c1tdID17CisgIDB4ODIsIDB4NDQsIDB4 MjgsIDB4OT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HZh bHVlLgorICAgICBJZiBwYXJ0aWFsLCBsb29rdXAgcGFydGlhbCBiaXRtYXAgaW4gZGVmYXVsdCB2 YWx1ZSBpZiBub3QgZm91bmQgaGVyZS4KKyAgICAgSWYgbm90IHBhcnRpYWwsIG9yIG5vIHBhcnRp YWwgc3BlYyBpcyBwcmVzZW50LCB1c2Ugbm9uLXBhcnRpYWwgYml0bWFwLiAqLworaW50CittY19n ZXRfZnJpbmdlX2JpdG1hcCAoc3RydWN0IHdpbmRvdyAqdywgTGlzcF9PYmplY3QgYml0bWFwLCBp bnQgcmlnaHRfcCwgaW50IHBhcnRpYWxfcCkKK3sKKyAgTGlzcF9PYmplY3QgY21hcCwgYm0xID0g UW5pbCwgYm0yID0gUW5pbCwgYm07CisgIEVNQUNTX0lOVCBsbjEgPSAwLCBsbjIgPSAwOworICBp bnQgaXgxID0gcmlnaHRfcDsKKyAgaW50IGl4MiA9IGl4MSArIChwYXJ0aWFsX3AgPyAyIDogMCk7 CisgIGlmICgoY21hcCA9IEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZnJpbmdlX2luZGlj YXRvcl9hbGlzdCkpLCAhTklMUCAoY21hcCkpCisgICAgeworICAgICAgYm0xID0gbWNfYXNzcSAo Yml0bWFwLCBjbWFwKTsKKyAgICAgIGlmIChDT05TUCAoYm0xKSkKKyAgeworICAgIGlmICgoYm0x ID0gWENEUiAoYm0xKSksIE5JTFAgKGJtMSkpCisgICAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJ VE1BUDsKKyAgICBpZiAoQ09OU1AgKGJtMSkpCisgICAgICB7CisgICAgICAgIGxuMSA9IFhGSVhO VU0gKEZsZW5ndGggKGJtMSkpOworICAgICAgICBpZiAocGFydGlhbF9wKQorICAgICAgICAgIHsK KyAgICAgICAgICAgIGlmIChsbjEgPiBpeDIpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICBibSA9IG1jX250aCAoaXgyLCBibTEpOworICAgICAgICAgICAgICAgIGlmICghRVEgKGJt LCBRdCkpCisgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5kOworICAgICAgICAgICAgICB9Cisg ICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg aWYgKGxuMSA+IGl4MSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBibSA9 IG1jX250aCAoaXgxLCBibTEpOworICAgICAgICAgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkK KyAgICAgICAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgICAgICAgICB9CisgICAg ICAgICAgICB9CisgICAgICB9CisgICAgZWxzZSBpZiAoKGJtID0gYm0xLCAhRVEgKGJtLCBRdCkp KQorICAgICAgZ290byBmb3VuZDsKKyAgfQorICAgIH0KKyAgaWYgKCFFUSAoY21hcCwgQlZBUiAo JmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpCisgICAgICAmJiAhTklM UCAoQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpKQorICAg IHsKKyAgICAgIGJtMiA9IG1jX2Fzc3EgKGJpdG1hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywg ZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpOworICAgICAgaWYgKENPTlNQIChibTIpKQorICAgICAg ICB7CisgICAgICAgICAgaWYgKChibTIgPSBYQ0RSIChibTIpKSwgIU5JTFAgKGJtMikpCisgICAg ICAgICAgICB7CisgICAgICAgICAgICAgIGlmIChDT05TUCAoYm0yKSkKKyAgICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgICBsbjIgPSBYRklYTlVNIChGbGVuZ3RoIChibTIpKTsKKyAg ICAgICAgICAgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAgICAgICBpZiAobG4yID4gaXgyKQorICAgICAgICAgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICBibSA9IG1jX250aCAoaXgyLCBibTIpOwor ICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9Cisg ICAgICAgIH0KKyAgICB9CisgIGlmIChsbjEgPiBpeDEpCisgICAgeworICAgICAgYm0gPSBtY19u dGggKGl4MSwgYm0xKTsKKyAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgIGdvdG8gZm91 bmQ7CisgICAgfQorICBpZiAobG4yID4gaXgxKQorICAgIHsKKyAgICAgIGJtID0gbWNfbnRoIChp eDEsIGJtMik7CisgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgICBnb3RvIGZvdW5kOwor ICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgfQorICAgIGVsc2UgaWYgKChi bSA9IGJtMiwgTklMUCAoYm0pKSkKKyAgICAgIHJldHVybiBNQ19OT19GUklOR0VfQklUTUFQOwor ICBmb3VuZDoKKyAgcmV0dXJuIGxvb2t1cF9mcmluZ2VfYml0bWFwIChibSk7Cit9CisKK3N0YXRp YyBpbnQKK21jX2dldF9sb2dpY2FsX2N1cnNvcl9iaXRtYXAgKHN0cnVjdCB3aW5kb3cgKncsIExp c3BfT2JqZWN0IGN1cnNvcikKK3sKKyAgTGlzcF9PYmplY3QgY21hcCwgYm0gPSBRbmlsOworICBp ZiAoKGNtYXAgPSBCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZyaW5nZV9jdXJzb3JfYWxp c3QpKSwgIU5JTFAgKGNtYXApKQorICAgIHsKKyAgIC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FsaXN0LgorICAgICBFbGVtZW50cyBhcmU6CisgIEJJVE1BUCAgICAtLSB1c2UgZm9y IGFsbAorICAoTCBSKSAgICAtLSB1c2UgZm9yIGxlZnQgcmlnaHQgKHdoZXRoZXIgcGFydGlhbCBv ciBub3QpCisgIChMIFIgUEwgUFIpICAtLSB1c2UgZm9yIGxlZnQgcmlnaHQgcGFydGlhbC1sZWZ0 IHBhcnRpYWwtcmlnaHQKKyAgSWYgYW55IHZhbHVlIGluIGxvY2FsIGJpbmRpbmcgaXMgbm90IHBy ZXNlbnQgb3IgdCwgdXNlIGdsb2JhbCB2YWx1ZS4KKyAgICAgSWYgcGFydGlhbCwgbG9va3VwIHBh cnRpYWwgYml0bWFwIGluIGRlZmF1bHQgdmFsdWUgaWYgbm90IGZvdW5kIGhlcmUuCisgICAgIElm IG5vdCBwYXJ0aWFsLCBvciBubyBwYXJ0aWFsIHNwZWMgaXMgcHJlc2VudCwgdXNlIG5vbi1wYXJ0 aWFsIGJpdG1hcC4gICovCisgIGlmICgoY21hcCA9IEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpLCAhTklMUCAoY21hcCkpCisgICAgeworICAgICAg Ym0xID0gbWNfYXNzcSAoYml0bWFwLCBjbWFwKTsKKyAgICAgIGlmIChDT05TUCAoYm0xKSkKKyAg ICAgICAgeworICAgICAgICAgIGlmICgoYm0xID0gWENEUiAoYm0xKSksIE5JTFAgKGJtMSkpCisg ICAgICAgICAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICBpZiAoQ09O U1AgKGJtMSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGxuMSA9IFhGSVhOVU0gKEZs ZW5ndGggKGJtMSkpOworICAgICAgICAgICAgICBpZiAocGFydGlhbF9wKQorICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgIGlmIChsbjEgPiBpeDIpCisgICAgICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBibSA9IG1jX250aCAoaXgyLCBibTEpOworICAg ICAgICAgICAgICAgICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAgICAgICAgICAg ICAgICBnb3RvIGZvdW5kOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICAgICAgaWYgKGxuMSA+IGl4MSkKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAg ICAgICAgICAgICAgICAgICBibSA9IG1jX250aCAoaXgxLCBibTEpOworICAgICAgICAgICAgICAg ICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZ290 byBmb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmICgoYm0gPSBibTEsICFFUSAoYm0sIFF0 KSkpCisgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgIH0KKyAgICB9CisgIGlmICgh RVEgKGNtYXAsIEJWQVIgKCZidWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3Qp KQorICAgICAgJiYgIU5JTFAgKEJWQVIgKCZidWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9pbmRpY2F0 b3JfYWxpc3QpKSkKKyAgICB7CisgICAgICBibTIgPSBtY19hc3NxIChiaXRtYXAsIEJWQVIgKCZi dWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKTsKKyAgICAgIGlmIChDT05T UCAoYm0yKSkKKyAgICAgICAgeworICAgICAgICAgIGlmICgoYm0yID0gWENEUiAoYm0yKSksICFO SUxQIChibTIpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAoQ09OU1AgKGJtMikp CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgbG4yID0gWEZJWE5VTSAoRmxl bmd0aCAoYm0yKSk7CisgICAgICAgICAgICAgICAgICBpZiAocGFydGlhbF9wKQorICAgICAgICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgaWYgKGxuMiA+IGl4MikKKyAgICAg ICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgYm0gPSBtY19u dGggKGl4MiwgYm0yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0 KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5kOworICAgICAgICAgICAg ICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQor ICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICBpZiAobG4xID4gaXgxKQorICAgIHsK KyAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMSk7CisgICAgICBpZiAoIUVRIChibSwgUXQpKQor ICAgICAgICBnb3RvIGZvdW5kOworICAgIH0KKyAgaWYgKGxuMiA+IGl4MSkKKyAgICB7CisgICAg ICBibSA9IG1jX250aCAoaXgxLCBibTIpOworICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAg ICAgZ290byBmb3VuZDsKKyAgICAgIHJldHVybiBNQ19OT19GUklOR0VfQklUTUFQOworICAgIH0K KyAgICBlbHNlIGlmICgoYm0gPSBibTIsIE5JTFAgKGJtKSkpCisgICAgICByZXR1cm4gTUNfTk9f RlJJTkdFX0JJVE1BUDsKKyAgZm91bmQ6CisgIHJldHVybiBsb29rdXBfZnJpbmdlX2JpdG1hcCAo Ym0pOworfQorCisvKiBSZWNhbGN1bGF0ZSB0aGUgYml0bWFwcyB0byBzaG93IGluIHRoZSBmcmlu Z2VzIG9mIHdpbmRvdyBXLgorICAgT25seSBtYXJrIHJvd3Mgd2l0aCBtb2RpZmllZCBiaXRtYXBz IGZvciB1cGRhdGUgaW4gcmVkcmF3X2ZyaW5nZV9iaXRtYXBzX3AuCisgICBJZiBLRUVQX0NVUlJF TlRfUCBpcyAwLCB1cGRhdGUgY3VycmVudF9tYXRyaXggdG9vLiAqLworYm9vbAorbWNfdXBkYXRl X3dpbmRvd19mcmluZ2VzIChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGtlZXBfY3VycmVudF9wKQor eworICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csICpjdXIgPSAwOworICBpbnQgeWIgPSB3aW5kb3df dGV4dF9ib3R0b21feSAodyk7CisgIGludCBybiwgbnJvd3MgPSB3LT5jdXJyZW50X21hdHJpeC0+ bnJvd3M7CisgIGludCB5OworICBib29sIHJlZHJhd19wID0gMDsKKyAgTGlzcF9PYmplY3QgYm91 bmRhcnlfdG9wID0gUW5pbCwgYm91bmRhcnlfYm90ID0gUW5pbDsKKyAgTGlzcF9PYmplY3QgYXJy b3dfdG9wID0gUW5pbCwgYXJyb3dfYm90ID0gUW5pbDsKKyAgTGlzcF9PYmplY3QgZW1wdHlfcG9z OworICBMaXNwX09iamVjdCBpbmQgPSBRbmlsOworI2RlZmluZSBNQVhfQklUTUFQX0NBQ0hFICg4 KjQpCisgIGludCBiaXRtYXBfY2FjaGVbTUFYX0JJVE1BUF9DQUNIRV07CisgIGludCB0b3BfaW5k X3JuLCBib3RfaW5kX3JuOworICBpbnQgdG9wX2luZF9taW5feSwgYm90X2luZF9tYXhfeTsKKyAg LyogdG9wX2luZF9ybiBpcyBzZXQgdG8gYSBub25uZWdhdGl2ZSB2YWx1ZSB3aGVuZXZlcgorICAg ICByb3ctPmluZGljYXRlX2JvYl9wIGlzIHNldCwgc28gaXQncyBPSyB0aGF0IHRvcF9yb3dfZW5k c19hdF96dl9wCisgICAgIGlzIG5vdCBpbml0aWFsaXplZCBoZXJlLiAgU2ltaWxhcmx5IGZvciBi b3RfaW5kX3JuLAorICAgICByb3ctPmluZGljYXRlX2VvYl9wIGFuZCBib3Rfcm93X2VuZHNfYXRf enZfcC4gICovCisgIGludCB0b3Bfcm93X2VuZHNfYXRfenZfcCBNQ19JRl9MSU5UICg9IDApLCBi b3Rfcm93X2VuZHNfYXRfenZfcCBNQ19JRl9MSU5UICg9IDApOworICBpZiAody0+cHNldWRvX3dp bmRvd19wKQorICAgIHJldHVybiAwOworICBpZiAoIU1JTklfV0lORE9XX1AgKHcpCisgICAgICAm JiAoaW5kID0gQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBpbmRpY2F0ZV9idWZmZXJfYm91 bmRhcmllcyksICFOSUxQIChpbmQpKSkKKyAgICB7CisgICAgICBpZiAoRVEgKGluZCwgUWxlZnQp IHx8IEVRIChpbmQsIFFyaWdodCkpCisgICAgICAgIGJvdW5kYXJ5X3RvcCA9IGJvdW5kYXJ5X2Jv dCA9IGFycm93X3RvcCA9IGFycm93X2JvdCA9IGluZDsKKyAgICAgICAgZWxzZSBpZiAoQ09OU1Ag KGluZCkKKyAgICAgICAgICAgICAgICAgJiYgQ09OU1AgKFhDQVIgKGluZCkpKQorICAgICAgICB7 CisgICAgICAgICAgTGlzcF9PYmplY3QgcG9zOworICAgICAgICAgIGlmIChwb3MgPSBtY19hc3Nx IChRdCwgaW5kKSwgIU5JTFAgKHBvcykpCisgICAgICAgICAgICBib3VuZGFyeV90b3AgPSBib3Vu ZGFyeV9ib3QgPSBhcnJvd190b3AgPSBhcnJvd19ib3QgPSBYQ0RSIChwb3MpOworICAgICAgICAg IGlmIChwb3MgPSBtY19hc3NxIChRdG9wLCBpbmQpLCAhTklMUCAocG9zKSkKKyAgICAgICAgICAg IGJvdW5kYXJ5X3RvcCA9IFhDRFIgKHBvcyk7CisgICAgICAgICAgaWYgKHBvcyA9IG1jX2Fzc3Eg KFFib3R0b20sIGluZCksICFOSUxQIChwb3MpKQorICAgICAgICAgICAgYm91bmRhcnlfYm90ID0g WENEUiAocG9zKTsKKyAgICAgICAgICBpZiAocG9zID0gbWNfYXNzcSAoUXVwLCBpbmQpLCAhTklM UCAocG9zKSkKKyAgICAgICAgICAgIGFycm93X3RvcCA9IFhDRFIgKHBvcyk7CisgICAgICAgICAg aWYgKHBvcyA9IG1jX2Fzc3EgKFFkb3duLCBpbmQpLCAhTklMUCAocG9zKSkKKyAgICAgICAgICAg IGFycm93X2JvdCA9IFhDRFIgKHBvcyk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAg ICAgIC8qIEFueXRoaW5nIGVsc2UgbWVhbnMgYm91bmRhcnkgb24gbGVmdCBhbmQgbm8gYXJyb3dz LiAgKi8KKyAgICAgICAgICBib3VuZGFyeV90b3AgPSBib3VuZGFyeV9ib3QgPSBRbGVmdDsKKyAg ICB9CisgIHRvcF9pbmRfcm4gPSBib3RfaW5kX3JuID0gLTE7CisgIGlmICghTklMUCAoaW5kKSkK KyAgICB7CisgICAgICBmb3IgKHkgPSB3LT52c2Nyb2xsLCBybiA9IDA7CisgICAgICAgICAgIHkg PCB5YiAmJiBybiA8IG5yb3dzOworICAgICAgICAgICB5ICs9IHJvdy0+aGVpZ2h0LCArK3JuKQor ICAgICAgICB7CisgICAgICAgICAgcm93ID0gdy0+ZGVzaXJlZF9tYXRyaXgtPnJvd3MgKyBybjsK KyAgICAgICAgICBpZiAoIXJvdy0+ZW5hYmxlZF9wKQorICAgICAgICAgICAgcm93ID0gdy0+Y3Vy cmVudF9tYXRyaXgtPnJvd3MgKyBybjsKKyAgICAgICAgICByb3ctPmluZGljYXRlX2JvYl9wID0g cm93LT5pbmRpY2F0ZV90b3BfbGluZV9wID0gMDsKKyAgICAgICAgICByb3ctPmluZGljYXRlX2Vv Yl9wID0gcm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wID0gMDsKKyAgICAgICAgICBpZiAoIXJv dy0+bW9kZV9saW5lX3ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmICh0b3BfaW5k X3JuIDwgMCAmJiByb3ctPnZpc2libGVfaGVpZ2h0ID4gMCkKKyAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgICBpZiAoTUFUUklYX1JPV19TVEFSVF9DSEFSUE9TIChyb3cpIDw9IEJV Rl9CRUdWIChYQlVGRkVSICh3LT5jb250ZW50cykpCisgICAgICAgICAgICAgICAgICAgICAgJiYg IU1BVFJJWF9ST1dfUEFSVElBTExZX1ZJU0lCTEVfQVRfVE9QX1AgKHcsIHJvdykpCisgICAgICAg ICAgICAgICAgICAgIHJvdy0+aW5kaWNhdGVfYm9iX3AgPSAhTklMUCAoYm91bmRhcnlfdG9wKTsK KyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgIHJvdy0+aW5k aWNhdGVfdG9wX2xpbmVfcCA9ICFOSUxQIChhcnJvd190b3ApOworICAgICAgICAgICAgICAgICAg dG9wX2luZF9ybiA9IHJuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgaWYgKGJv dF9pbmRfcm4gPCAwKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGlmIChN QVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpID49IEJVRl9aViAoWEJVRkZFUiAody0+Y29udGVu dHMpKQorICAgICAgICAgICAgICAgICAgICAgICYmICFNQVRSSVhfUk9XX1BBUlRJQUxMWV9WSVNJ QkxFX0FUX0JPVFRPTV9QICh3LCByb3cpKQorICAgICAgICAgICAgICAgICAgICByb3ctPmluZGlj YXRlX2VvYl9wID0gIU5JTFAgKGJvdW5kYXJ5X2JvdCksIGJvdF9pbmRfcm4gPSBybjsKKyAgICAg ICAgICAgICAgICAgICAgZWxzZSBpZiAoeSArIHJvdy0+aGVpZ2h0ID49IHliKQorICAgICAgICAg ICAgICAgICAgICAgIHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCA9ICFOSUxQIChhcnJvd19i b3QpLCBib3RfaW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hcnRpYWxfcCkpKQorICAvKiBFeHRlbmQgdG9w LWFsaWduZWQgdG9wIGluZGljYXRvciAob3IgYm90dG9tLWFsaWduZWQgYm90dG9tCisgICAgIGlu ZGljYXRvcikgdG8gYWRqYWNlbnQgcm93cyBpZiBpdCBkb2Vzbid0IGZpdCBpbiBvbmUgcm93LiAg Ki8KKyAgdG9wX2luZF9taW5feSA9IGJvdF9pbmRfbWF4X3kgPSAtMTsKKyAgaWYgKHRvcF9pbmRf cm4gPj0gMCkKKyAgICB7CisgICAgICBpbnQgYm4gPSBNQ19OT19GUklOR0VfQklUTUFQOworICAg ICAgcm93ID0gdy0+ZGVzaXJlZF9tYXRyaXgtPnJvd3MgKyB0b3BfaW5kX3JuOworICAgICAgaWYg KCFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgcm93ID0gdy0+Y3VycmVudF9tYXRyaXgtPnJvd3Mg KyB0b3BfaW5kX3JuOworICAgICAgdG9wX3Jvd19lbmRzX2F0X3p2X3AgPSByb3ctPmVuZHNfYXRf enZfcDsKKyAgICAgIGlmIChyb3ctPmluZGljYXRlX2JvYl9wKQorICAgICAgICB7CisgICAgICAg ICAgaWYgKEVRIChib3VuZGFyeV90b3AsIFFsZWZ0KSkKKyAgICAgICAgICAgIGJuID0gKChyb3ct PmluZGljYXRlX2VvYl9wICYmIEVRIChib3VuZGFyeV9ib3QsIFFsZWZ0KSkKKyAgICAgICAgICAg ICAgICAgID8gTUNfTEVGVF9GUklOR0UgKDEsIFF0b3BfYm90dG9tLCByb3ctPmVuZHNfYXRfenZf cCkKKyAgICAgICAgICAgICAgICAgIDogTUNfTEVGVF9GUklOR0UgKDIsIFF0b3AsIDApKTsKKyAg ICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgYm4gPSAoKHJvdy0+aW5kaWNhdGVfZW9iX3Ag JiYgRVEgKGJvdW5kYXJ5X2JvdCwgUXJpZ2h0KSkKKyAgICAgICAgICAgICAgICAgICAgPyBNQ19S SUdIVF9GUklOR0UgKDEsIFF0b3BfYm90dG9tLCByb3ctPmVuZHNfYXRfenZfcCkKKyAgICAgICAg ICAgICAgICAgICAgOiBNQ19SSUdIVF9GUklOR0UgKDIsIFF0b3AsIDApKTsKKyAgICAgICAgfQor ICAgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX3RvcF9saW5lX3ApCisgICAgICAgICAgewor ICAgICAgICAgICAgaWYgKEVRIChhcnJvd190b3AsIFFsZWZ0KSkKKyAgICAgICAgICAgICAgYm4g PSBNQ19MRUZUX0ZSSU5HRSAoNiwgUXVwLCAwKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICAgIGJuID0gTUNfUklHSFRfRlJJTkdFICg2LCBRdXAsIDApOworICAgICAgICAgIH0K KyAgICAgIGlmIChibiAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICB7CisgICAgICAg ICAgc3RydWN0IGZyaW5nZV9iaXRtYXAgKmZiID0gZ2V0X2ZyaW5nZV9iaXRtYXBfZGF0YSAoYm4p OworICAgICAgICAgIGlmIChmYi0+YWxpZ24gPT0gQUxJR05fQklUTUFQX1RPUCAmJiBmYi0+cGVy aW9kID09IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cg KnJvdzE7CisgICAgICAgICAgICAgIGludCB0b3BfaW5kX21heF95OworICAgICAgICAgICAgICB0 b3BfaW5kX21pbl95ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgICAgICAgICAg ICAgIHRvcF9pbmRfbWF4X3kgPSB0b3BfaW5kX21pbl95ICsgZmItPmhlaWdodDsKKyAgICAgICAg ICAgICAgaWYgKHRvcF9pbmRfbWF4X3kgPiB5YikKKyAgICAgICAgICAgICAgICB0b3BfaW5kX21h eF95ID0geWI7CisgICAgICAgICAgICAgIGZvciAoeSA9IHJvdy0+eSArIHJvdy0+aGVpZ2h0LCBy biA9IHRvcF9pbmRfcm4gKyAxOworICAgICAgICAgICAgICAgICAgIHkgPCB0b3BfaW5kX21heF95 ICYmIHJuIDwgbnJvd3M7CisgICAgICAgICAgICAgICAgICAgeSArPSByb3cxLT5oZWlnaHQsIHJu KyspCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgaWYgKGJvdF9pbmRfcm4g Pj0gMCAmJiBybiA+PSBib3RfaW5kX3JuKQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAg ICAgICAgICAgICAgICAgIHJvdzEgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHJuOworICAg ICAgICAgICAgICAgICAgaWYgKCFyb3cxLT5lbmFibGVkX3ApCisgICAgICAgICAgICAgICAgICAg IHJvdzEgPSB3LT5jdXJyZW50X21hdHJpeC0+cm93cyArIHJuOworICAgICAgICAgICAgICAgICAg cm93MS0+aW5kaWNhdGVfYm9iX3AgPSByb3ctPmluZGljYXRlX2JvYl9wOworICAgICAgICAgICAg ICAgICAgcm93MS0+aW5kaWNhdGVfdG9wX2xpbmVfcCA9IHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVf cDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9Cisg IGlmIChib3RfaW5kX3JuID49IDApCisgICAgeworICAgICAgaW50IGJuID0gTUNfTk9fRlJJTkdF X0JJVE1BUDsKKyAgICAgIHJvdyA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgYm90X2luZF9y bjsKKyAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgICAgIHJvdyA9IHctPmN1cnJlbnRf bWF0cml4LT5yb3dzICsgYm90X2luZF9ybjsKKyAgICAgIGJvdF9yb3dfZW5kc19hdF96dl9wID0g cm93LT5lbmRzX2F0X3p2X3A7CisgICAgICBpZiAocm93LT5pbmRpY2F0ZV9lb2JfcCkKKyAgICAg ICAgeworICAgICAgICAgIGlmIChFUSAoYm91bmRhcnlfYm90LCBRbGVmdCkpCisgICAgICAgICAg ICBibiA9IE1DX0xFRlRfRlJJTkdFICgzLCBRYm90dG9tLCByb3ctPmVuZHNfYXRfenZfcCk7Cisg ICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGJuID0gTUNfUklHSFRfRlJJTkdFICgzLCBR Ym90dG9tLCByb3ctPmVuZHNfYXRfenZfcCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAo cm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGlm IChFUSAoYXJyb3dfYm90LCBRbGVmdCkpCisgICAgICAgICAgICAgIGJuID0gTUNfTEVGVF9GUklO R0UgKDcsIFFkb3duLCAwKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIGJu ID0gTUNfUklHSFRfRlJJTkdFICg3LCBRZG93biwgMCk7CisgICAgICAgICAgfQorICAgICAgaWYg KGJuICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3Qg ZnJpbmdlX2JpdG1hcCAqZmIgPSBnZXRfZnJpbmdlX2JpdG1hcF9kYXRhIChibik7CisgICAgICAg ICAgaWYgKGZiLT5hbGlnbiA9PSBBTElHTl9CSVRNQVBfQk9UVE9NICYmIGZiLT5wZXJpb2QgPT0g MCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93MTsK KyAgICAgICAgICAgICAgaW50IGJvdF9pbmRfbWluX3k7CisgICAgICAgICAgICAgIGJvdF9pbmRf bWF4X3kgPSByb3ctPnkgKyByb3ctPnZpc2libGVfaGVpZ2h0OworICAgICAgICAgICAgICBib3Rf aW5kX21pbl95ID0gYm90X2luZF9tYXhfeSAtIGZiLT5oZWlnaHQ7CisgICAgICAgICAgICAgIGlm IChib3RfaW5kX21pbl95IDwgV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodykpCisgICAgICAg ICAgICAgICAgYm90X2luZF9taW5feSA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOwor ICAgICAgICAgICAgICBmb3IgKHkgPSByb3ctPnksIHJuID0gYm90X2luZF9ybiAtIDE7CisgICAg ICAgICAgICAgICAgICAgeSA+PSBib3RfaW5kX21pbl95ICYmIHJuID49IDA7CisgICAgICAgICAg ICAgICAgICAgeSAtPSByb3cxLT5oZWlnaHQsIHJuLS0pCisgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgaWYgKHRvcF9pbmRfcm4gPj0gMCAmJiBybiA8PSB0b3BfaW5kX3JuKQor ICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgIHJvdzEgPSB3LT5k ZXNpcmVkX21hdHJpeC0+cm93cyArIHJuOworICAgICAgICAgICAgICAgICAgaWYgKCFyb3cxLT5l bmFibGVkX3ApCisgICAgICAgICAgICAgICAgICAgIHJvdzEgPSB3LT5jdXJyZW50X21hdHJpeC0+ cm93cyArIHJuOworICAgICAgICAgICAgICAgICAgcm93MS0+aW5kaWNhdGVfZW9iX3AgPSByb3ct PmluZGljYXRlX2VvYl9wOworICAgICAgICAgICAgICAgICAgcm93MS0+aW5kaWNhdGVfYm90dG9t X2xpbmVfcCA9IHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcDsKKyAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIGJvb2wgYXV0b19oc2Nyb2xsX21v ZGVfcCA9IEVRIChGYnVmZmVyX2xvY2FsX3ZhbHVlIChRYXV0b19oc2Nyb2xsX21vZGUsIHctPmNv bnRlbnRzKSwgUWN1cnJlbnRfbGluZSk7CisgIC8qIEVYQU1QTEU6ICAoc2Nyb2xsLWxlZnQgNSkg Ki8KKyAgYm9vbCBoc2NsX2FsbF90ZW1wX3AgPSAody0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBh bmQgZG8gbm90aGluZy4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzBfcCA9ICh3LT5zdXNwZW5k X2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9s bF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhzY3JvbGwpOwor ICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBzb21ldGhpbmcgZWxzZSBiZXNpZGVzIGhv cml6b250YWxseSBzY3JvbGxpbmcgdGhlCisgICAgICAgICAgICAgICBjdXJyZW50IGxpbmUgZGlm ZmVyZW50bHkuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgaXMgX25vdF8gaG9yaXpvbnRh bGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMV9wID0g KCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5o c2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xs ID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHct PmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCAuLi4KKyAgICAgICAgICAg ICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50 bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8yX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Ny b2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPT0gMAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhzY3JvbGwpOworICAvKiBFWEFN UExFOiAgKHNjcm9sbC1sZWZ0IDUpOyBhbmQsIHRoZW4gcHJlc3MgdGhlIGxlZnQgYXJyb3cga2V5 IG9uZSB0aW1lLgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIF9pc18gaG9yaXpvbnRhbGx5 IHNjcm9sbGVkIGRpZmZlcmVudGx5LiovCisgIGJvb2wgaHNjbF90ZW1wX3AgPSAoIXctPnN1c3Bl bmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21v ZGVfcAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gMCk7CisgIC8qIEVYQU1QTEU6ICBDLXUg Qy14IDwgYW5kIGRvIHNvbWV0aGluZyB0aGF0IGNhdXNlcyB0aGUgY3VycmVudCBsaW5lIHRvIGJl CisgICAgICAgICAgICAgICBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuCisgICAg ICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVy ZW50bHkuICovCisgIGJvb2wgaHNjbF9wZXJtX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xs CisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAg ICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYg dy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3Jv bGwgIT0gdy0+aHNjcm9sbCk7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUp OworICBmb3IgKHkgPSB3LT52c2Nyb2xsLCBybiA9IDA7CisgICAgICAgeSA8IHliICYmIHJuIDwg bnJvd3M7CisgICAgICAgeSArPSByb3ctPmhlaWdodCwgcm4rKykKKyAgICB7CisgIGludCBsZWZ0 LCByaWdodDsKKyAgdW5zaWduZWQgbGVmdF9mYWNlX2lkLCByaWdodF9mYWNlX2lkOworICBpbnQg bGVmdF9vZmZzZXQsIHJpZ2h0X29mZnNldDsKKyAgYm9vbCBwZXJpb2RpY19wOworICByb3cgPSB3 LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHJuOworICBjdXIgPSB3LT5jdXJyZW50X21hdHJpeC0+ cm93cyArIHJuOworICBpbnQgdm50aF9kbSA9IE1BVFJJWF9ST1dfVlBPUyAody0+ZGVzaXJlZF9t YXRyaXgtPnJvd3MgKyBybiwgdy0+ZGVzaXJlZF9tYXRyaXgpOworICBpbnQgdm50aF9jbSA9IE1B VFJJWF9ST1dfVlBPUyAody0+Y3VycmVudF9tYXRyaXgtPnJvd3MgKyBybiwgdy0+Y3VycmVudF9t YXRyaXgpOworICBlbnVtIG1jX3Jvd19wb3NpdGlvbiByb3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JsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICAgICAoIWFjdGl2ZV9w CisgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hf aW5hY3RpdmVfd2luZG93cykpKQorICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywg ZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUp CisgICAgICAgICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRf ZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LXByZS16di1mYWNlIiksIHRydWUp CisgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICBtY19sZWZ0X2ZyaW5n ZV9mYWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gb3ZlcmxheV9hcnJvd19mYWNlX2lkCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAg ICAgICAgICBpZiAody0+aHNjcm9sbCAhPSAwKQorICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9 IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ciKSwgZmFs c2UsIHRydWUpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBmcmluZ2VfYml0bWFw ID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistb3ZlcmxheS1hcnJvdyIpLCB0 cnVlLCB0cnVlKTsKKyAgICAgICAgICBtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5 cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IGZyaW5nZV9iaXRtYXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKCh2 cG9zID09IHZudGhfZG0gfHwgdnBvcyA9PSB2bnRoX2NtKQorICAgICAgICAgICAgICAgICAmJiBn bHlwaF9mbGF2b3IgPT0gTUNfT1ZFUkxBWV9BUlJPV19CSVRNQVAKKyAgICAgICAgICAgICAgICAg JiYgKGhzY2xfYWxsX3RlbXBfcAorICAgICAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVy bV8wX3AKKyAgICAgICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxsX3Blcm1fMV9wCisgICAgICAg ICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzJfcAorICAgICAgICAgICAgICAgICAgICAg fHwgaHNjbF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgICAgIHx8IGhzY2xfcGVybV9wKQorICAg ICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgeworICAgICAgICAgICAgaW50 IGZyaW5nZV9iaXRtYXAgPSBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgICAgZW51bSBm YWNlX2lkIG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICAgICAgICghYWN0aXZlX3AK KyAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNo X2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAo dywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtaW5hY3RpdmUtcHJlLXp2LWZhY2Ui KSwgdHJ1ZSkKKyAgICAgICAgICAgICAgOiAoYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgPyBs b29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtcHJl LXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAg ICAgICAgICBtY19sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRf RlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBv dmVybGF5X2Fycm93X2ZhY2VfaWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgICBpZiAoaHNjbF9hbGxfcGVybV8wX3Ap CisgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywg aW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAgICAgICAgZWxz ZSBpZiAoaHNjbF9hbGxfcGVybV8xX3ApCisgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9 IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCB0cnVlLCBm YWxzZSk7CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF9hbGxfcGVybV8yX3ApCisgICAg ICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGlu dGVybiAoIistaHNjbC1wZXJtIiksIGZhbHNlLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgIGVs c2UgaWYgKGhzY2xfcGVybV9wKQorICAgICAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0g bWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIHRydWUsIHRy dWUpOworICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX2FsbF90ZW1wX3ApCisgICAg ICAgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3 LCBpbnRlcm4gKCIrLWhzY2wtdGVtcCIpLCBmYWxzZSwgZmFsc2UpOworICAgICAgICAgICAgICAg ICAgICAgIGVsc2UgaWYgKGhzY2xfdGVtcF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgZnJp bmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtdGVt cCIpLCB0cnVlLCBmYWxzZSk7CisgICAgICAgICAgICBtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgPSAo Y3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICB9CisgICAg ICAgICAgZWxzZSBpZiAoKHZwb3MgPT0gdm50aF9kbSB8fCB2cG9zID09IHZudGhfY20pCisgICAg ICAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRV9S SUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1D X1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAg ICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFCisgICAgICAgICAg ICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FS Uk9XCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJT RURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBn bHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAgICB8 fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAg ICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSCkK KyAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBMaXNwX09iamVjdCBiaXRtYXBfZmxhdm9yID0gKGdseXBoX2ZsYXZvciA9PSBNQ19I T0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBRbWNfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1D X1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX2hvbGxvd19yZWN0YW5n bGVfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xlCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0g TUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3cKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19S RVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX3ZlcnRpY2FsX2Jhcl9yaWdodF9h cnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhf Zmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElD QUxfQkFSKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFt Y19yZXZlcnNlZF92ZXJ0aWNhbF9iYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNh bF9iYXJfYmFja3NsYXNoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IFFuaWw7CisgICAgICAgICAgICAgIG1jX3JpZ2h0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29y X3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IGxvb2t1cF9mcmluZ2VfYml0bWFwIChiaXRtYXBfZmxhdm9yKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJ VE1BUDsKKyAgICAgICAgICAgICAgbWNfcmlnaHRfZnJpbmdlX2ZhY2VfaWQgPQorICAgICAgICAg ICAgICAgIChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisgICAgICAgICAg ICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYKKyAgICAgICAgICAgICAgICAgJiYgKGds eXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisg ICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElD QUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3Ig PT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKSkKKyAgICAgICAgICAgICAgICAgID8gbG9va3Vw X25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmV2ZXJzZWQtYmFyLXByZS16di1mYWNlIiks IHRydWUpCisgICAgICAgICAgICAgICAgOiAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdF X0JJVE1BUAorICAgICAgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBBVF9aVgorICAg ICAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JF Q1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2 b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAg ICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpKQor ICAgICAgICAgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1y ZXZlcnNlZC1iYXItYXQtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICAgIDogKGN1cnNv cl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgICAmJiBy b3dfcG9zaXRpb24gPT0gUE9TVF9aVgorICAgICAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2 b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAg ICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFS X1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBN Q19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpKQorICAgICAgICAgICAgICAgICAgPyBsb29rdXBfbmFt ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZXZlcnNlZC1iYXItcG9zdC16di1mYWNlIiksIHRy dWUpCisgICAgICAgICAgICAgICAgOiAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJ VE1BUAorICAgICAgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYKKyAgICAg ICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RB TkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBN Q19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAm JiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAg ICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1iYXItcHJlLXp2LWZh Y2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9G UklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IEFUX1pW CisgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX0hPTExP V19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2 b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAg ICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAg ICAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistYmFyLWF0 LXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBNQ19S SUdIVF9GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09 IFBPU1RfWlYKKyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJT RURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICYmIGds eXBoX2ZsYXZvciAhPSBNQ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KHJvdy0+ cmV2ZXJzZWRfcCAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKSkKKyAgICAgICAgbGVmdCA9 IE1DX0xFRlRfRlJJTkdFICgwLCBRdHJ1bmNhdGlvbiwgMCk7CisgICAgICBlbHNlIGlmIChyb3ct PmluZGljYXRlX2JvYl9wICYmIEVRIChib3VuZGFyeV90b3AsIFFsZWZ0KSkKKyAgICAgICAgewor ICAgICAgICAgIGxlZnQgPSAoKHJvdy0+aW5kaWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5kYXJ5X2Jv dCwgUWxlZnQpKQorICAgICAgICAgICAgICAgICA/IE1DX0xFRlRfRlJJTkdFICgxLCBRdG9wX2Jv dHRvbSwgdG9wX3Jvd19lbmRzX2F0X3p2X3ApCisgICAgICAgICAgICAgICAgIDogTUNfTEVGVF9G UklOR0UgKDIsIFF0b3AsIDApKTsKKyAgICAgICAgICBpZiAodG9wX2luZF9taW5feSA+PSAwKQor ICAgICAgICAgICAgbGVmdF9vZmZzZXQgPSB0b3BfaW5kX21pbl95IC0gcm93LT55OworICAgICAg ICB9CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2VvYl9wICYmIEVRIChib3VuZGFyeV9i b3QsIFFsZWZ0KSkKKyAgICAgICAgeworICAgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAo MywgUWJvdHRvbSwgYm90X3Jvd19lbmRzX2F0X3p2X3ApOworICAgICAgICAgIGlmIChib3RfaW5k X21heF95ID49IDApCisgICAgICAgICAgICBsZWZ0X29mZnNldCA9IGJvdF9pbmRfbWF4X3kgLSAo cm93LT55ICsgcm93LT52aXNpYmxlX2hlaWdodCk7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYg KCghcm93LT5yZXZlcnNlZF9wICYmIE1BVFJJWF9ST1dfQ09OVElOVUFUSU9OX0xJTkVfUCAocm93 KSkKKyAgICAgICAgICAgICAgIHx8IChyb3ctPnJldmVyc2VkX3AgJiYgcm93LT5jb250aW51ZWRf cCkpCisgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAoNCwgUWNvbnRpbnVhdGlvbiwgMCk7 CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2VtcHR5X2xpbmVfcCAmJiBFUSAoZW1wdHlf cG9zLCBRbGVmdCkpCisgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAoNSwgUWVtcHR5X2xp bmUsIDApOworICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV90b3BfbGluZV9wICYmIEVRIChh cnJvd190b3AsIFFsZWZ0KSkKKyAgICAgICAgeworICAgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZS SU5HRSAoNiwgUXVwLCAwKTsKKyAgICAgICAgICBpZiAodG9wX2luZF9taW5feSA+PSAwKQorICAg ICAgICAgICAgbGVmdF9vZmZzZXQgPSB0b3BfaW5kX21pbl95IC0gcm93LT55OworICAgICAgICB9 CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3AgJiYgRVEgKGFycm93 X2JvdCwgUWxlZnQpKQorICAgICAgICB7CisgICAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdF ICg3LCBRZG93biwgMCk7CisgICAgICAgICAgaWYgKGJvdF9pbmRfbWF4X3kgPj0gMCkKKyAgICAg ICAgICAgIGxlZnRfb2Zmc2V0ID0gYm90X2luZF9tYXhfeSAtIChyb3ctPnkgKyByb3ctPnZpc2li bGVfaGVpZ2h0KTsKKyAgICAgICAgfQorICAgICAgZWxzZQorICAgICAgICBsZWZ0ID0gTUNfTk9f RlJJTkdFX0JJVE1BUDsKKyAgICAgIC8qIERlY2lkZSB3aGljaCBiaXRtYXAgdG8gZHJhdyBpbiB0 aGUgcmlnaHQgZnJpbmdlLiAgKi8KKyAgICAgIGlmIChXSU5ET1dfUklHSFRfRlJJTkdFX1dJRFRI ICh3KSA9PSAwKQorICAgICAgICByaWdodC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Cwg UXJpZ2h0KSkKKyAgICAgICAgeworICAgICAgICAgIHJpZ2h0ID0gTUNfUklHSFRfRlJJTkdFICgz LCBRYm90dG9tLCBib3Rfcm93X2VuZHNfYXRfenZfcCk7CisgICAgICAgICAgaWYgKGJvdF9pbmRf bWF4X3kgPj0gMCkKKyAgICAgICAgICAgIHJpZ2h0X29mZnNldCA9IGJvdF9pbmRfbWF4X3kgLSAo cm93LT55ICsgcm93LT52aXNpYmxlX2hlaWdodCk7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYg KCghcm93LT5yZXZlcnNlZF9wICYmIHJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAgICB8 fCAocm93LT5yZXZlcnNlZF9wICYmIE1BVFJJWF9ST1dfQ09OVElOVUFUSU9OX0xJTkVfUCAocm93 KSkpCisgICAgICAgIHJpZ2h0ID0gTUNfUklHSFRfRlJJTkdFICg0LCBRY29udGludWF0aW9uLCAw KTsKKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcCAmJiBFUSAoYXJyb3df dG9wLCBRcmlnaHQpKQorICAgICAgICB7CisgICAgICAgICAgcmlnaHQgPSBNQ19SSUdIVF9GUklO R0UgKDYsIFF1cCwgMCk7CisgICAgICAgICAgaWYgKHRvcF9pbmRfbWluX3kgPj0gMCkKKyAgICAg ICAgICAgIHJpZ2h0X29mZnNldCA9IHRvcF9pbmRfbWluX3kgLSByb3ctPnk7CisgICAgICAgIH0K KyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCAmJiBFUSAoYXJyb3df Ym90LCBRcmlnaHQpKQorICAgICAgICB7CisgICAgICAgICAgcmlnaHQgPSBNQ19SSUdIVF9GUklO R0UgKDcsIFFkb3duLCAwKTsKKyAgICAgICAgICBpZiAoYm90X2luZF9tYXhfeSA+PSAwKQorICAg ICAgICAgICAgcmlnaHRfb2Zmc2V0ID0gYm90X2luZF9tYXhfeSAtIChy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Y19wICE9IGN1ci0+ZnJpbmdlX2JpdG1hcF9wZXJpb2RpY19wCisgICAgICAgICAg fHwgY3VyLT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcCkKKyAgICAgICAgeworICAgICAgICAgIHJl ZHJhd19wID0gMSwgcm93LT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcCA9IDE7CisgICAgICAgICAg aWYgKCFrZWVwX2N1cnJlbnRfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY3VyLT5y ZWRyYXdfZnJpbmdlX2JpdG1hcHNfcCA9IDE7CisgICAgICAgICAgICAgIGlmIChtY19sZWZ0X2Zy aW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAgfHwg bWNfcmlnaHRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICAg ICAgICAgIGN1ci0+ZnJpbmdlX2JpdG1hcF9wZXJpb2RpY19wID0gZmFsc2U7CisgICAgICAgICAg ICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgY3VyLT5mcmluZ2VfYml0bWFwX3BlcmlvZGlj X3AgPSBwZXJpb2RpY19wOworICAgICAgICAgICAgICBpZiAobWNfbGVmdF9mcmluZ2VfYml0bWFw ICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgY3VyLT5sZWZ0X2ZyaW5n ZV9iaXRtYXAgPSBtY19sZWZ0X2ZyaW5nZV9iaXRtYXA7CisgICAgICAgICAgICAgICAgZWxzZQor ICAgICAgICAgICAgICAgICAgY3VyLT5sZWZ0X2ZyaW5nZV9iaXRtYXAgPSBsZWZ0OworICAgICAg ICAgICAgICBpZiAobWNfbGVmdF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVAp CisgICAgICAgICAgICAgICAgY3VyLT5sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gbWNfbGV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PSAwOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX29mZnNldCA9IHJpZ2h0X29mZnNldDsKKyAg ICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKHJvdy0+b3ZlcmxheV9hcnJvd19iaXRt YXAgPCAwKQorICAgICAgICByb3ctPm92ZXJsYXlfYXJyb3dfYml0bWFwID0gbWNfZ2V0X2xvZ2lj YWxfZnJpbmdlX2JpdG1hcCAodywgUW92ZXJsYXlfYXJyb3csIDAsIDApOworICAgICAgaWYgKHJv dy0+b3ZlcmxheV9hcnJvd19iaXRtYXAgIT0gY3VyLT5vdmVybGF5X2Fycm93X2JpdG1hcCkKKyAg ICAgICAgeworICAgICAgICAgIHJlZHJhd19wID0gMSwgcm93LT5yZWRyYXdfZnJpbmdlX2JpdG1h cHNfcCA9IDE7CisgICAgICAgICAgaWYgKCFrZWVwX2N1cnJlbnRfcCkKKyAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgY3VyLT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcCA9IDE7CisgICAgICAg ICAgICAgIGN1ci0+b3ZlcmxheV9hcnJvd19iaXRtYXAgPSByb3ctPm92ZXJsYXlfYXJyb3dfYml0 bWFwOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBpZiAobWNfbGVmdF9mcmluZ2Vf Yml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICB8fCBtY19yaWdodF9mcmlu Z2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgIHJvdy0+ZnJpbmdlX2Jp dG1hcF9wZXJpb2RpY19wID0gZmFsc2U7CisgICAgICAgIGVsc2UKKyAgICAgICAgICByb3ctPmZy aW5nZV9iaXRtYXBfcGVyaW9kaWNfcCA9IHBlcmlvZGljX3A7CisgICAgICBpZiAobWNfbGVmdF9m cmluZ2VfYml0bWFwIC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8KKyAg ICAgIHJldHVybjsKKyAgICB9CisgIHByZXBhcmVfZmFjZV9mb3JfZGlzcGxheSAoZiwgcC5mYWNl KTsKKyAgLyogQ2xlYXIgbGVmdCBmcmluZ2UgaWYgbm8gYml0bWFwIHRvIGRyYXcgb3IgaWYgYml0 bWFwIGRvZXNuJ3QgZmlsbAorICAgICB0aGUgZnJpbmdlLiAgKi8KKyAgcC5ieCA9IC0xOworICBo ZWFkZXJfbGluZV9oZWlnaHQgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgcC5i eSA9IFdJTkRPV19UT19GUkFNRV9QSVhFTF9ZICh3LCBtYXggKGhlYWRlcl9saW5lX2hlaWdodCwg cm93LT55KSk7CisgIHAubnkgPSByb3ctPnZpc2libGVfaGVpZ2h0OworICBpZiAobGVmdF9wKQor ICAgIHsKKyAgICAgIGludCB3ZCA9IFdJTkRPV19MRUZUX0ZSSU5HRV9XSURUSCAodyk7CisgICAg ICBpbnQgeCA9IHdpbmRvd19ib3hfbGVmdCAodywgKFdJTkRPV19IQVNfRlJJTkdFU19PVVRTSURF X01BUkdJTlMgKHcpCisgICAgICAgICAgID8gTEVGVF9NQVJHSU5fQVJFQQorICAgICAgICAgICA6 IFRFWFRfQVJFQSkpOworICAgICAgaWYgKHAud2QgPiB3ZCkKKyAgICAgICAgcC53ZCA9IHdkOwor ICAgICAgcC54ID0geCAtIHAud2QgLSAod2QgLSBwLndkKSAvIDI7CisgICAgICBpZiAocC53ZCA8 IHdkIHx8IHAueSA+IHAuYnkgfHwgcC55ICsgcC5oIDwgcC5ieSArIHAubnkpCisgICAgICAgIHsK KyAgICAgICAgICAvKiBJZiBXIGhhcyBhIHZlcnRpY2FsIGJvcmRlciB0byBpdHMgbGVmdCwgZG9u J3QgZHJhdyBvdmVyIGl0LiAgKi8KKyAgICAgICAgICB3ZCAtPSAoKCFXSU5ET1dfTEVGVE1PU1Rf UCAodykKKyAgICAgICAgICAgIC8qIFRoaXMgY291bGQgYmUgd3Jvbmcgd2hlbiB3ZSBhbGxvdyB3 aW5kb3cgbG9jYWwKKyAgICAgICAgICAgICAgIHJpZ2h0IGRpdmlkZXJzIC0gYnV0IHRoZSB3aW5k b3cgb24gdGhlIGxlZnQgaXMgaGFyZAorICAgICAgICAgICAgICAgdG8gZ2V0LiAgKi8KKyAgICAg ICAgICAgICYmICFGUkFNRV9SSUdIVF9ESVZJREVSX1dJRFRIIChmKQorICAgICAgICAgICAgJiYg IVdJTkRPV19IQVNfVkVSVElDQUxfU0NST0xMX0JBUiAodykKKyAgICAgICAgICAgIC8qIEJ1dCBk b24ndCByZWR1Y2UgdGhlIGZyaW5nZSB3aWR0aCBpZiB0aGUgd2luZG93CisgICAgICAgICAgICAg ICBoYXMgYSBsZWZ0IG1hcmdpbiwgYmVjYXVzZSB0aGF0IG1lYW5zIHdlIGFyZSBub3QKKyAgICAg ICAgICAgICAgIGluIGRhbmdlciBvZiBkcmF3aW5nIG92ZXIgdGhlIHZlcnRpY2FsIGJvcmRlciwK KyAgICAgICAgICAgICAgIGFuZCBPVE9IIGxlYXZpbmcgb3V0IHRoYXQgb25lIHBpeGVsIGxlYXZl cyBiZWhpbmQKKyAgICAgICAgICAgICAgIHRyYWNlcyBvZiB0aGUgY3Vyc29yLCBpZiBpdCB3YXMg aW4gY29sdW1uIHplcm8KKyAgICAgICAgICAgICAgIGJlZm9yZSBkcmF3aW5nIG5vbi1lbXB0eSBt YXJnaW4gYXJlYS4gICovCisgICAgICAgICAgICAmJiB3LT5sZWZ0X21hcmdpbl9jb2xzID09IDAp CisgICAgICAgICAgID8gMSA6IDApOworICAgICAgICAgIHAuYnggPSB4IC0gd2Q7CisgICAgICAg ICAgcC5ueCA9IHdkOworICAgICAgICB9CisgICAgfQorICBlbHNlCisgICAgeworICAgICAgaW50 IHggPSB3aW5kb3dfYm94X3JpZ2h0ICh3LAorICAgICAgICAoV0lORE9XX0hBU19GUklOR0VTX09V VFNJREVfTUFSR0lOUyAodykKKyAgICAgICAgID8gUklHSFRfTUFSR0lOX0FSRUEKKyAgICAgICAg IDogVEVYVF9BUkVBKSk7CisgICAgICBpbnQgd2QgPSBXSU5ET1dfUklHSFRfRlJJTkdFX1dJRFRI ICh3KTsKKyAgICAgIGlmIChwLndkID4gd2QpCisgICAgICAgIHAud2QgPSB3ZDsKKyAgICAgIHAu eCA9IHggKyAod2QgLSBwLndkKSAvIDI7CisgICAgICAvKiBDbGVhciByaWdodCBmcmluZ2UgaWYg bm8gYml0bWFwIHRvIGRyYXcgb2YgaWYgYml0bWFwIGRvZXNuJ3QgZmlsbAorICAgdGhlIGZyaW5n ZS4gICovCisgICAgICBpZiAocC53ZCA8IHdkIHx8IHAueSA+IHAuYnkgfHwgcC55ICsgcC5oIDwg cC5ieSArIHAubnkpCisgICAgICAgIHsKKyAgICAgICAgICBwLmJ4ID0geDsKKyAgICAgICAgICBw Lm54ID0gd2Q7CisgICAgICAgIH0KKyAgICB9CisgIGlmIChwLnggPj0gV0lORE9XX0JPWF9MRUZU X0VER0VfWCAodykKKyAgICAgICYmIChwLnggKyBwLndkKSA8PSBXSU5ET1dfQk9YX0xFRlRfRURH RV9YICh3KSArIFdJTkRPV19QSVhFTF9XSURUSCAodykpCisgICAgRlJBTUVfUklGIChmKS0+ZHJh d19mcmluZ2VfYml0bWFwICh3LCByb3csICZwKTsKK30KKwordm9pZAorbWNfZHJhd19mcmluZ2Vf Yml0bWFwIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCBsZWZ0 X3AsIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUpCit7CisgIGludCBvdmVybGF5ID0g MDsKKyAgaWYgKGxlZnRfcCA9PSByb3ctPnJldmVyc2VkX3AgJiYgcm93LT5jdXJzb3JfaW5fZnJp bmdlX3ApCisgICAgeworICAgICAgTGlzcF9PYmplY3QgY3Vyc29yID0gUW5pbDsKKyAgICAgIHN3 aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgICAgIHsKKyAgICAgICAgY2FzZSBNQ19GUkFNRURfQk9Y OgorICAgICAgICAgIGlmIChyb3ctPnZpc2libGVfaGVpZ2h0ID49IFNUQU5EQVJEX0JJVE1BUF9I RUlHSFQgKGhvbGxvd19yZWN0YW5nbGVfYml0cykpCisgICAgICAgICAgICBjdXJzb3IgPSBRaG9s bG93OworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGN1cnNvciA9IFFob2xsb3dfc21hbGw7 CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTUNfSE9MTE9XX0JPWDoKKyAgICAgICAg ICBpZiAocm93LT52aXNpYmxlX2hlaWdodCA+PSBTVEFOREFSRF9CSVRNQVBfSEVJR0hUIChob2xs b3dfcmVjdGFuZ2xlX2JpdHMpKQorICAgICAgICAgICAgY3Vyc29yID0gUWhvbGxvdzsKKyAgICAg ICAgICBlbHNlCisgICAgICAgICAgICBjdXJzb3IgPSBRaG9sbG93X3NtYWxsOworICAgICAgICAg IGJyZWFrOworICAgICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAgICAgICAgY3Vyc29yID0g UWJveDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19CQVI6CisgICAgICAgICAg Y3Vyc29yID0gUWJhcjsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19IQkFSOgor ICAgICAgICAgIGN1cnNvciA9IFFoYmFyOworICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNl IE1DX05PX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGNhc2UgTUNfTk9fQ1VSU09SOgorICAgICAg ICBjYXNlIE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGNhc2UgTUNfTEVGVF9GUklO R0VfQklUTUFQOgorICAgICAgICBkZWZhdWx0OgorICAgICAgICAgIHctPnBoeXNfY3Vyc29yX29u X3AgPSAwOworICAgICAgICAgIHJvdy0+Y3Vyc29yX2luX2ZyaW5nZV9wID0gMDsKKyAgICAgICAg ICBicmVhazsKKyAgICAgICAgfQorICAgICAgaWYgKCFOSUxQIChjdXJzb3IpKQorICAgICAgICB7 CisgICAgICAgICAgaW50IGJtID0gbWNfZ2V0X2xvZ2ljYWxfY3Vyc29yX2JpdG1hcCAodywgY3Vy c29yKTsKKyAgICAgICAgICBpZiAoYm0gIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgbWNfZHJhd19mcmluZ2VfYml0bWFwXzEgKHcsIHJvdywgbGVm dF9wLCAyLCBibSk7CisgICAgICAgICAgICAgIG92ZXJsYXkgPSBFUSAoY3Vyc29yLCBRYm94KSA/ IDMgOiAxOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICBtY19kcmF3X2ZyaW5n ZV9iaXRtYXBfMSAodywgcm93LCBsZWZ0X3AsIG92ZXJsYXksIE1DX05PX0ZSSU5HRV9CSVRNQVAp OworICBpZiAobGVmdF9wICYmIHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAgIT0gTUNfTk9fRlJJ TkdFX0JJVE1BUCkKKyAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXBfMSAodywgcm93LCAxLCAxLCBy b3ctPm92ZXJsYXlfYXJyb3dfYml0bWFwKTsKK30KKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMg Ki8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICNkZWZpbmUgTk9fRlJJTkdFX0JJVE1B UCAwCiAjZGVmaW5lIFVOREVGX0ZSSU5HRV9CSVRNQVAgMQogI2RlZmluZSBNQVhfU1RBTkRBUkRf RlJJTkdFX0JJVE1BUFMgQVJSQVlFTFRTIChzdGFuZGFyZF9iaXRtYXBzKQpAQCAtMTY5OSw2ICsz MjE3LDE2OCBAQ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1cGxlX2FuZ2xlX2Rvd24sICIrLXF1YWRy dXBsZS1hbmdsZS1kb3duIik7CisgIFZmcmluZ2VfYml0bWFwcyA9IEZjb25zIChRbWNfcXVhZHJ1 cGxlX2FuZ2xlX2Rvd24sIFZmcmluZ2VfYml0bWFwcyk7CisgIEZwdXQgKFFtY19xdWFkcnVwbGVf YW5nbGVfZG93biwgUWZyaW5nZSwgbWFrZV9maXhudW0gKDQ4KSk7CisgIC8qIChnZXQgJystcXVh ZHJ1cGxlLWFuZ2xlLWRvd24gJ2ZyaW5nZSkgPT4gNDggKi8KKworLyogZW5kIE1VTFRJUExFLUNV UlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgREVGU1lNIChRdHJ1bmNh dGlvbiwgInRydW5jYXRpb24iKTsKICAgREVGU1lNIChRY29udGludWF0aW9uLCAiY29udGludWF0 aW9uIik7CiAgIERFRlNZTSAoUW92ZXJsYXlfYXJyb3csICJvdmVybGF5LWFycm93Iik7CmRpZmYg LS1naXQgYS9zcmMvbnN0ZXJtLmggYi9zcmMvbnN0ZXJtLmgKaW5kZXggOTc3M2ViMy4uZTM0YTEx NiAxMDA2NDQKLS0tIGEvc3JjL25zdGVybS5oCisrKyBiL3NyYy9uc3Rlcm0uaApAQCAtNjYzLDYg KzY2MywxNiBAQCB0eXBlZGVmIGlkIGluc3RhbmNldHlwZTsKIAogQGludGVyZmFjZSBFbWFjc1Nj cm9sbGVyIDogTlNTY3JvbGxlcgogICB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisv KiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICBOU1JlY3QgbWNfcmVjdGFuZ2xlOworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAgICBzdHJ1Y3Qgd2luZG93ICp3aW5kb3c7CiAgICBz dHJ1Y3QgZnJhbWUgKmZyYW1lOwogICAgTlNSZXNwb25kZXIgKnByZXZSZXNwb25kZXI7CkBAIC02 ODMsNiArNjkzLDE4IEBAIHR5cGVkZWYgaWQgaW5zdGFuY2V0eXBlOwogICAgaW50IGVtX3dob2xl OwogICAgfQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09S UyAqLworCistICh2b2lkKW1jX3NldF9yZWN0YW5nbGU6IChOU1JlY3QpcmVjdDsKKy0gKE5TUmVj dCltY19nZXRfcmVjdGFuZ2xlOworLSAoc3RydWN0IHdpbmRvdyAqKW1jX2dldF93aW5kb3c7Cist IChib29sKW1jX2p1ZGdlOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAtIChpbnN0 YW5jZXR5cGUpIGluaXRGcmFtZTogKE5TUmVjdCApciB3aW5kb3c6IChMaXNwX09iamVjdCl3aW47 CiAtICh2b2lkKXNldEZyYW1lOiAoTlNSZWN0KXI7CiAKZGlmZiAtLWdpdCBhL3NyYy9uc3Rlcm0u bSBiL3NyYy9uc3Rlcm0ubQppbmRleCAwMjMzMTgyLi5iNzA4ZTk0IDEwMDY0NAotLS0gYS9zcmMv bnN0ZXJtLm0KKysrIGIvc3JjL25zdGVybS5tCkBAIC03Niw2ICs3Niw5NzUgQEAgVXBkYXRlZCBi eSBDaHJpc3RpYW4gTGltcGFjaCAoY2hyaXNAbmljZS5jaCkKIHN0YXRpYyBFbWFjc01lbnUgKm1h aW5NZW51OwogI2VuZGlmCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqK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ST1VORF9DT0xPUiAocy0+ Zik7CisgIHN0cnVjdCBmYWNlICpmYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBERUZBVUxUX0ZB Q0VfSUQpOworICBpbnQgdm50aCA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAv KiBTVFJFVENIX0dMWVBIIG1heSBjb250YWluIG1vcmUgdGhhbiBvbmUgZmFrZSBjdXJzb3IgYXQg dGhlIHNhbWUgSFBPUy4KKyAgTk9URTogIEEgZmFrZSBjdXJzb3IgZnJvbSBvbmUgY2FjaGUgbWF5 IG92ZXJ3cml0ZSBhIGZha2UgY3Vyc29yIGZyb20gYW5vdGhlcgorICBjYWNoZSAtLSB0aHVzLCB3 ZSBtdXN0IGNoZWNrIHRoZW0gYWxsIGZvciBvdmVyd3JpdHRlbiBmYWtlIGN1cnNvcnMuICovCisg IGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICBj YWNoZV90eXBlIDwgTk9fQ0FDSEU7CisgICAgICAgKytjYWNoZV90eXBlKQorICAgIHsKKyAgICAg IGZvciAoaW50IG50aCA9IDA7CisgICAgICAgICAgIHMKKyAgICAgICAgICAgJiYgbWNfdHJhdmVy c2VfY2FjaGVfcCAocy0+dy0+bWNfbWF0cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGgpOworICAg ICAgICAgICArK250aCkKKyAgICAgICAgeworICAgICAgICAgIC8vICBpbnQgeCA9IHMtPnctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ueDsKKyAgICAgICAgICBp bnQgZnggPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhd LmZ4OworICAgICAgICAgIC8vICBpbnQgeSA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF0ueTsKKyAgICAgICAgICBpbnQgZnkgPSBzLT53LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZ5OworICAgICAgICAgIGludCBo cG9zID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5o cG9zOworICAgICAgICAgIGludCB2cG9zID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXS52cG9zOworICAgICAgICAgIGludCB3ZCA9IHMtPnctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ud2Q7CisgICAgICAgICAgaW50 IGggPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmg7 CisgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSA9IHMtPnctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uY3Vyc29yX3R5cGU7CisgICAg ICAgICAgLy8gIGludCBjdXJzb3Jfd2lkdGggPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLmN1cnNvcl93aWR0aDsKKyAgICAgICAgICBzdHJ1Y3QgbWNf UkdCIGxzbF9mZyA9IHsucmVkID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXS5mZy5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg LmdyZWVuID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XS5mZy5ncmVlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IHMt PnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZmcuYmx1ZX07 CisgICAgICAgICAgLy8gIHN0cnVjdCBtY19SR0IgbHNsX2JnID0gey5yZWQgPSBzLT53LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLnJlZCwKKyAgICAgICAg ICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gcy0+dy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5iZy5ncmVlbiwKKyAgICAgICAgICAvLyAg ICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLmJsdWV9OworICAgICAgICAgIGJvb2wgYWN0aXZl X3AgPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmFj dGl2ZV9wOworICAgICAgICAgIC8vICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSBzLT53 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoX2ZsYXZv cjsKKyAgICAgICAgICBib29sIGVuYWJsZWRfcCA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZW5hYmxlZF9wOworICAgICAgICAgIGJvb2wgZ29fcCA9 ICh2cG9zID09IHZudGgKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA9PSBjdXJzb3Jf Z2x5cGgtPmhwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKTsKKyAgICAg ICAgICBpZiAoIWdvX3ApCisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICBOU1JlY3Qg cjsKKyAgICAgICAgICByLm9yaWdpbi54ID0gZng7CisgICAgICAgICAgci5vcmlnaW4ueSA9IGZ5 OworICAgICAgICAgIHIuc2l6ZS5oZWlnaHQgPSBoOworICAgICAgICAgIHIuc2l6ZS53aWR0aCA9 IHdkOworICAgICAgICAgIFtbTlNDb2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiBsc2xfZmcu cmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JlZW46IGxzbF9mZy5n cmVlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBibHVlOiBsc2xfZmcu Ymx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscGhhOiAxLjBdIHNl dF07CisgICAgICBpZiAoY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWCkKKyAgICAgICAgewor ICAgICAgICAgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSIChzLT53LT5jb250ZW50cyk7Cisg ICAgICAgICAgYm9vbCByZWdpb25fYWN0aXZlX3AgPSAoIU5JTFAgKFZ0cmFuc2llbnRfbWFya19t b2RlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChi LCBtYXJrX2FjdGl2ZSkpKTsKKyAgICAgICAgICBwdHJkaWZmX3QgcmVnaW9uX2JlZyA9IChyZWdp b25fYWN0aXZlX3ApID8gbWNfcmVnaW9uX2xpbWl0ICgxKSA6IC0xOworICAgICAgICAgIHB0cmRp ZmZfdCByZWdpb25fZW5kID0gKHJlZ2lvbl9hY3RpdmVfcCkgPyBtY19yZWdpb25fbGltaXQgKDAp IDogLTE7CisgICAgICAgICAgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAmJiBh Y3RpdmVfcAorICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3MgPT0gcmVnaW9u X2JlZykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19h Y3RpdmVfcmVnaW9uX2JlZ19mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMtPmYs IGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1hdC1yZWdpb24tcHJlLXp2LWZhY2UiKSwgdHJ1 ZSk7CisgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZWdf ZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgaG9sbG93X2FjdGl2ZV9yZWdpb25fYmVnX2ZhY2Vf aWQpOworICAgICAgICAgICAgICBOU0NvbG9yICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZWdfY29s b3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChob2xsb3df YWN0aXZlX3JlZ2lvbl9iZWdfZmFjZSksIHMtPmYpOworICAgICAgICAgICAgICBob2xsb3dfY29s b3IgPSBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZWdfY29sb3I7CisgICAgICAgICAgICB9CisgICAg ICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICYm IGFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3Mg PT0gcmVnaW9uX2VuZCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGVudW0gZmFj ZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNl IChzLT53LCBzLT5mLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItYXQtcmVnaW9uLXByZS16 di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgIHN0cnVjdCBmYW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AgICAgICAgICAgICAgIE5TQ29sb3IgKmhvbGxvd19hY3RpdmVfcmVn aW9uX2JldHdlZW5fY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JF R1JPVU5EIChob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2UpLCBzLT5mKTsKKyAgICAg ICAgICAgICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5f Y29sb3I7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYgKGFjdGl2 ZV9wKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2Vf aWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMtPmYs IGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAg ICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFjZSA9IEZBQ0VfRlJP TV9JRCAocy0+ZiwgaG9sbG93X2FjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAg TlNDb2xvciAqaG9sbG93X2FjdGl2ZV9jb2xvciA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChO U19GQUNFX0JBQ0tHUk9VTkQgKGhvbGxvd19hY3RpdmVfZmFjZSksIHMtPmYpOworICAgICAgICAg ICAgICAgICAgICBob2xsb3dfY29sb3IgPSBob2xsb3dfYWN0aXZlX2NvbG9yOworICAgICAgICAg ICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoIWFjdGl2ZV9wKQorICAgICAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxv d19pbmFjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMtPmYsIGludGVy biAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAg ICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2luYWN0aXZlX2ZhY2UgPSBG QUNFX0ZST01fSUQgKHMtPmYsIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAg ICAgICAgICAgICBOU0NvbG9yICpob2xsb3dfaW5hY3RpdmVfY29sb3IgPSBuc19sb29rdXBfaW5k ZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5EIChob2xsb3dfaW5hY3RpdmVfZmFjZSksIHMt PmYpOworICAgICAgICAgICAgICAgICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19pbmFjdGl2 ZV9jb2xvcjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2Ug aWYgKGZhY2UgJiYgTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKSA9PSBuc19pbmRleF9jb2xvciAo RlJBTUVfQ1VSU09SX0NPTE9SIChzLT5mKSwgcy0+ZikpCisgICAgICAgICAgeworICAgICAgICAg ICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQgKGZhY2UpLCBz LT5mKSBzZXRdOworICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gRlJBTUVfQ1VSU09SX0NPTE9S IChzLT5mKTsKKyAgICAgICAgICB9CisgICAgICAgICAgc3dpdGNoIChjdXJzb3JfdHlwZSkKKyAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY2FzZSBNQ19OT19GUklOR0VfQklUTUFQOgorICAg ICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX05PX0NVUlNPUjoKKyAg ICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSBNQ19SSUdIVF9GUklOR0Vf QklUTUFQOgorICAgICAgICAgICAgICBjYXNlIE1DX0xFRlRfRlJJTkdFX0JJVE1BUDoKKyAgICAg ICAgICAgICAgY2FzZSBNQ19GSUxMRURfQk9YOgorICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwg KHIpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX0ZSQU1F RF9CT1g6CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAgICAgICAg W2hvbGxvd19jb2xvciBzZXRdOworICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKE5TSW5zZXRS ZWN0IChyLCAxLCAxKSk7CisgICAgICAgICAgICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAocy0+ Zikgc2V0XTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSBNQ19I T0xMT1dfQk9YOgorICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAg ICAgIFtob2xsb3dfY29sb3Igc2V0XTsKKyAgICAgICAgICAgICAgICBOU1JlY3RGaWxsIChOU0lu c2V0UmVjdCAociwgMSwgMSkpOworICAgICAgICAgICAgICAgIFtGUkFNRV9DVVJTT1JfQ09MT1Ig KHMtPmYpIHNldF07CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2Ug TUNfSEJBUjoKKyAgICAgICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAgICAg ICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSBNQ19CQVI6CisgICAgICAgICAgICAgICAgTlNS ZWN0RmlsbCAocik7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAg ICAgICAgLyogSWYgYSBnbHlwaCBleGlzdHMgKHMtPmNoYXIyY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ICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgICBzdHJ1Y3QgZm9udCAqZm9udCA9IHMtPmZhY2UtPmZvbnQ7CisgICAgICAgICAgICAg ICAgICAgIGlmICghZm9udCkKKyAgICAgICAgICAgICAgICAgICAgICBmb250ID0gRlJBTUVfRk9O VCAocy0+Zik7CisgICAgICAgICAgICAgICAgICAgIGJvb2wgd2l0aF9iZ19wID0gZmFsc2U7Cisg ICAgICAgICAgICAgICAgICAgIGZvbnQtPmRyaXZlci0+ZHJhdyAocywgcy0+Y21wX2Zyb20sIHMt Pm5jaGFycywgcy0+eCwgcy0+eWJhc2UsIHdpdGhfYmdfcCk7CisgICAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIC8vICBjbG9ja190IGNsb2NrX2Vu ZCA9IGNsb2NrKCk7CisgIC8vICBkb3VibGUgY3B1X3RpbWVfdXNlZCA9ICgoZG91YmxlKSAoY2xv Y2tfZW5kIC0gY2xvY2tfc3RhcnQpKSAvIENMT0NLU19QRVJfU0VDOworICAvLyAgZnByaW50ZiAo c3RkZXJyLCAibnNfZHJhd19vdmVyd3JpdHRlbiAoJWQpOiAgVElNRSAoJWYpXG4iLCB2cG9zLCBj cHVfdGltZV91c2VkKTsKK30KKworc3RhdGljIHZvaWQKK21jX25zX2RyYXdfd2luZG93X2N1cnNv ciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3Qg Z2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICBpbnQgeCwgaW50IGZ4LCBpbnQgeSwg aW50IGZ5LCBpbnQgaHBvcywgaW50IHZwb3MsIGludCB3ZCwgaW50IGgsCisgICAgICAgICAgICAg ICAgICBzdHJ1Y3QgbWNfUkdCIGxzbCwgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSwK Ky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XTsKKyAgICAgTGlzcF9PYmplY3QgYmFja2dyb3VuZCA9IGZhY2UtPmxmYWNl W0xGQUNFX0JBQ0tHUk9VTkRfSU5ERVhdOworICAgICBmcHJpbnRmIChzdGRlcnIsICJcbmZvcmVn cm91bmQgKCVzKSB8IGJhY2tncm91bmQgKCVzKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAo IU5JTFAgKGZvcmVncm91bmQpID8gU1NEQVRBIChmb3JlZ3JvdW5kKSA6ICJOSUxQIiksCisgICAg ICAgICAgICAgICAgICAgICAgKCFOSUxQIChiYWNrZ3JvdW5kKSA/IFNTREFUQSAoYmFja2dyb3Vu ZCkgOiAiTklMUCIpKTsKKyAgLSAgRVhBTVBMRSBPRiBIT1cgVE8gQ1JFQVRFIEEgQ09MT1IgV0lU SCBSR0IvTFNMIGZsb2F0IHZhbHVlczoKKyAgICAgTlNDb2xvciAqbXlfY29sb3IgPSBbTlNDb2xv ciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiAxLjAKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGdyZWVuOiAxLjAKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBibHVlOiAxLjAKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscGhhOiAxLjBdOworICAtICBB TFRFUk5BVElWRSBFWEFNUExFOgorICAgICBlbnVtIGZhY2VfaWQgZGVidWdnaW5nX2ZhY2VfaWQg PSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ZiwgaW50ZXJuICgiKy1kZWJ1Z2dpbmctZmFj ZSIpLCB0cnVlKTsKKyAgICAgc3RydWN0IGZhY2UgKmRlYnVnZ2luZ19mYWNlID0gRkFDRV9GUk9N X0lEIChzLT5mLCBkZWJ1Z2dpbmdfZmFjZV9pZCk7CisgICAgIE5TQ29sb3IgKmNvbG9yID0gbnNf bG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoZGVidWdnaW5nX2ZhY2Up LCBzLT5mKTsKKyAgICAgW2NvbG9yIHNldF07ICovCisgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNf R0xZUEgKKyAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSExFU1MpCisgICAgW1tOU0Nv bG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6IGxzbC5yZWQKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBncmVlbjogbHNsLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGJsdWU6IGxzbC5ibHVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwaGE6 IDEuMF0gc2V0XTsKKyAgICBlbHNlCisgICAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChmKSBzZXRd OworICBpZiAoY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWCkKKyAgICB7CisgICAgICBzdHJ1 Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAody0+Y29udGVudHMpOworICAgICAgYm9vbCByZWdpb25f YWN0aXZlX3AgPSAoIU5JTFAgKFZ0cmFuc2llbnRfbWFya19tb2RlKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIG1hcmtfYWN0aXZlKSkpOworICAgICAg cHRyZGlmZl90IHJlZ2lvbl9iZWcgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IG1jX3JlZ2lvbl9saW1p dCAoMSkgOiAtMTsKKyAgICAgIHB0cmRpZmZfdCByZWdpb25fZW5kID0gKHJlZ2lvbl9hY3RpdmVf cCkgPyBtY19yZWdpb25fbGltaXQgKDApIDogLTE7CisgICAgICBpZiAocmVnaW9uX2FjdGl2ZV9w CisgICAgICAgICAgJiYgYWN0aXZlX3AKKyAgICAgICAgICAmJiBjdXJ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va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9S RUdST1VORCAoaG9sbG93X2FjdGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNlKSwgZik7CisgICAgICAg ICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fY29sb3I7 CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmIChhY3RpdmVfcCkKKyAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2Vf aWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29y LXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xs b3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7 CisgICAgICAgICAgICAgICAgTlNDb2xvciAqaG9sbG93X2FjdGl2ZV9jb2xvciA9IG5zX2xvb2t1 cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGhvbGxvd19hY3RpdmVfZmFjZSks IGYpOworICAgICAgICAgICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19hY3RpdmVfY29sb3I7 CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgLyogVGhlIHJlZ2lvbiBpcyBfbm90XyB2 aXNpYmxlIGluIHRoZSBpbmFjdGl2ZSB3aW5kb3cgYmVjYXVzZSB0aGUgb3ZlcmxheSB3aW5kb3cg cHJvcGVydHkgaXMgdXNlZC4gKi8KKyAgICAgICAgICAgICAgZWxzZSBpZiAoIWFjdGl2ZV9wKQor ICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3df aW5hY3RpdmVfZmFjZ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lJJTkdFX0JJVE1B UDoKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1DX0xFRlRfRlJJTkdFX0JJVE1BUDoKKyAg ICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAgICAgIE5TUmVjdEZp bGwgKHIpOworICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfRlJBTUVEX0JPWDoKKyAgICAg ICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgIFtob2xsb3dfY29sb3Igc2V0XTsKKyAgICAgICAg TlNSZWN0RmlsbCAoTlNJbnNldFJlY3QgKHIsIDEsIDEpKTsKKyAgICAgICAgW0ZSQU1FX0NVUlNP Ul9DT0xPUiAoZikgc2V0XTsKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1DX0hPTExPV19C T1g6CisgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICBbaG9sbG93X2NvbG9yIHNldF07 CisgICAgICAgIE5TUmVjdEZpbGwgKE5TSW5zZXRSZWN0IChyLCAxLCAxKSk7CisgICAgICAgIFtG UkFNRV9DVVJTT1JfQ09MT1IgKGYpIHNldF07CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBN Q19IQkFSOgorICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgYnJlYWs7CisgICAgICBj YXNlIE1DX0JBUjoKKyAgICAgICAgcyA9IHI7CisgICAgICAgIC8qIEBsYXdsaXN0IGlzIGZvY3Vz aW5nIHRoZSBpbml0aWFsIGRldmVsb3BtZW50IG9mIGZlYXR1cmUgcmVxdWVzdHMKKyAgICAgICAg IzE3Njg0IGFuZCAjMjI4NzMgb24gTDJSIGxhbmd1YWdlcy4gKi8KKyAgICAgICAgaWYgKGdseXBo X2ZsYXZvciAhPSBNQ19HTFlQSAorICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX0dM WVBITEVTUykKKyAgICAgICAgICB7CisgICAgICAgICAgICAv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HMtPmZvcl9vdmVybGFwcykKKyAg ICByZXR1cm47CisgIC8qIERvIHVuZGVybGluZS4gKi8KKyAgaWYgKGZhY2UtPnVuZGVybGluZV9w KQorICAgIHsKKyAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVS X1dBVkUpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoZmFjZS0+dW5kZXJsaW5lX2RlZmF1bHRl ZF9wKQorICAgICAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsKKyAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChmYWNlLT51bmRlcmxpbmVfY29s b3IsIHMtPmYpIHNldF07CisgICAgICAgICAgbnNfZHJhd191bmRlcndhdmUgKHMsIHdpZHRoLCB4 KTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9 PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgeworICAgICAgICAgICAgTlNSZWN0IHI7Cisg ICAgICAgICAgICB1bnNpZ25lZCBsb25nIHRoaWNrbmVzcywgcG9zaXRpb247CisgICAgICAgICAg ICAvKiBJZiB0aGUgcHJldiB3YXMgdW5kZXJsaW5lZCwgbWF0Y2ggaXRzIGFwcGVhcmFuY2UuICov CisgICAgICAgICAgICBpZiAocy0+cHJldiAmJiBzLT5wcmV2LT5mYWNlLT51bmRlcmxpbmVfcAor ICAgICAgICAgICAgICAgICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0Vf VU5ERVJfTElORQorICAgICAgICAgICAgICAgICYmIHMtPnByZXYtPnVuZGVybGluZV90aGlja25l c3MgPiAwKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+ cHJldi0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMt PnByZXYtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgc3RydWN0IGZvbnQg KmZvbnQ7CisgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIGRlc2NlbnQ7CisgICAgICAg ICAgICAgICAgICBmb250PXMtPmZvbnQ7CisgICAgICAgICAgICAgICAgICBkZXNjZW50ID0gcy0+ eSArIHMtPmhlaWdodCAtIHMtPnliYXNlOworICAgICAgICAgICAgICAgICAgLyogVXNlIHVuZGVy bGluZSB0aGlja25lc3Mgb2YgZm9udCwgZGVmYXVsdGluZyB0byAxLiAqLworICAgICAgICAgICAg ICAgICAgdGhpY2tuZXNzID0gKGZvbnQgJiYgZm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzcyA+IDAp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGZvbnQtPnVuZGVybGluZV90aGlja25l c3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogMTsKKyAgICAgICAgICAgICAgICAg IC8qIERldGVybWluZSB0aGUgb2Zmc2V0IG9mIHVuZGVybGluaW5nIGZyb20gdGhlIGJhc2VsaW5l LiAqLworICAgICAgICAgICAgICAgICAgaWYgKHhfdW5kZXJsaW5lX2F0X2Rlc2NlbnRfbGluZSkK KyAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBkZXNjZW50IC0gdGhpY2tuZXNzOworICAg ICAgICAgICAgICAgICAgICBlbHNlIGlmICh4X3VzZV91bmRlcmxpbmVfcG9zaXRpb25fcHJvcGVy dGllcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBmb250ICYmIGZvbnQtPnVuZGVy bGluZV9wb3NpdGlvbiA+PSAwKQorICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gZm9u dC0+dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGZv bnQpCisgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IGxyb3VuZCAoZm9udC0+ZGVz Y2VudCAvIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAg ICAgICAgICAgICBwb3NpdGlvbiA9IHVuZGVybGluZV9taW5pbXVtX29mZnNldDsKKyAgICAgICAg ICAgICAgICAgIHBvc2l0aW9uID0gbWF4IChwb3NpdGlvbiwgdW5kZXJsaW5lX21pbmltdW1fb2Zm c2V0KTsKKyAgICAgICAgICAgICAgICAgIC8qIEVuc3VyZSB1bmRlcmxpbmluZyBpcyBub3QgY3Jv cHBlZC4gKi8KKyAgICAgICAgICAgICAgICAgIGlmIChkZXNjZW50IDw9IHBvc2l0aW9uKQorICAg ICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBkZXNj ZW50IC0gMTsKKyAgICAgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAxOworICAgICAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGRlc2NlbnQgPCBwb3Np dGlvbiArIHRoaWNrbmVzcykKKyAgICAgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAxOwor ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHMtPnVuZGVybGluZV90aGlja25lc3MgPSB0 aGlja25lc3M7CisgICAgICAgICAgICBzLT51bmRlcmxpbmVfcG9zaXRpb24gPSBwb3NpdGlvbjsK KyAgICAgICAgICAgIHIgPSBOU01ha2VSZWN0ICh4LCBzLT55YmFzZSArIHBvc2l0aW9uLCB3aWR0 aCwgdGhpY2tuZXNzKTsKKyAgICAgICAgICAgIGlmIChmYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVk X3ApCisgICAgICAgICAgICAgIFtkZWZhdWx0Q29sIHNldF07CisgICAgICAgICAgICAgIG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KKyAgICAgICAg ZWxzZQorICAgICAgICAgZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+Ziwgcy0+Zmlyc3RfZ2x5cGgt PmZhY2VfaWQpOworICAgICAgYmdDb2wgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFD RV9CQUNLR1JPVU5EIChmYWNlKSwgcy0+Zik7CisgICAgICBmZ0NvbCA9IG5zX2xvb2t1cF9pbmRl eGVkX2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQgKGZhY2UpLCBzLT5mKTsKKyAgICAgIGZvciAo aSA9IDA7IGkgPCBuOyArK2kpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoIXMtPnJvdy0+ZnVs bF93aWR0aF9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpbnQgb3ZlcnJ1biwgbGVm dG92ZXJydW47CisgICAgICAgICAgICAgIC8qIHRydW5jYXRlIHRvIGF2b2lkIG92ZXJ3cml0aW5n IGZyaW5nZSBhbmQvb3Igc2Nyb2xsYmFyICovCisgICAgICAgICAgICAgIG92ZXJydW4gPSBtYXgg KDAsIChzLT54ICsgcy0+YmFja2dyb3VuZF93aWR0aCkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIC0gKFdJTkRPV19CT1hfUklHSFRfRURHRV9YIChzLT53KQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgLSBXSU5ET1dfUklHSFRfRlJJTkdFX1dJRFRIIChzLT53KSkpOwor ICAgICAgICAgICAgICAgICAgICByW2ldLnNpemUud2lkdGggLT0gb3ZlcnJ1bjsKKyAgICAgICAg ICAgICAgLyogdHJ1bmNhdGUgdG8gYXZvaWQgb3ZlcndyaXRpbmcgdG8gbGVmdCBvZiB0aGUgd2lu ZG93IGJveCAqLworICAgICAgICAgICAgICBsZWZ0b3ZlcnJ1biA9IChXSU5ET1dfQk9YX0xFRlRf RURHRV9YIChzLT53KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIFdJTkRPV19MRUZU X0ZSSU5HRV9XSURUSCAocy0+dykpIC0gcy0+eDsKKyAgICAgICAgICAgICAgaWYgKGxlZnRvdmVy cnVuID4gMCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICByW2ldLm9yaWdp bi54ICs9IGxlZnRvdmVycnVuOworICAgICAgICAgICAgICAgICAgcltpXS5zaXplLndpZHRoIC09 IGxlZnRvdmVycnVuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgLyogWFhYOiBU cnkgdG8gd29yayBiZXR3ZWVuIHByb2JsZW0gd2hlcmUgYSBzdHJldGNoIGdseXBoIG9uCisgICAg ICAgICAgICAgICAgIGEgcGFydGlhbGx5LXZpc2libGUgYm90dG9tIHJvdyB3aWxsIGNsZWFyIHBh cnQgb2YgdGhlCisgICAgICAgICAgICAgICAgIG1vZGVsaW5lLCBhbmQgYW5vdGhlciB3aGVyZSBs aXN0LWJ1ZmZlcnMgaGVhZGVycyBhbmQgc2ltaWxhcgorICAgICAgICAgICAgICAgICByb3dzIGVy cm9uZW91c2x5IGhhdmUgdmlzaWJsZV9oZWlnaHQgc2V0IHRvIDAuICBOb3Qgc3VyZQorICAgICAg ICAgICAgICAgICB3aGVyZSB0aGlzIGlzIGNvbWluZyBmcm9tIGFzIG90aGVyIHRlcm1zIHNlZW0g bm90IHRvIHNob3cuICovCisgICAgICAgICAgICAgIHJbaV0uc2l6ZS5oZWlnaHQgPSBtaW4gKHMt PmhlaWdodCwgcy0+cm93LT52aXNpYmxlX2hlaWdodCk7CisgICAgICAgICAgICB9CisgICAgICAg ICAgW2JnQ29sIHNldF07CisgICAgICAgICAgLyogTk9URTogdW5kZXIgTlMgdGhpcyBpcyBOT1Qg dXNlZCB0byBkcmF3IGN1cnNvcnMsIGJ1dCB3ZSBtdXN0IGF2b2lkCisgICAgICAgICAgICAgb3Zl cndyaXRpbmcgY3Vyc29yICh1c3VhbGx5IHdoZW4gY3Vyc29yIG9uIGEgdGFi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53aWR0aCAtPSB3aWR0aDsKKyAgICAgICAgICAgICAgcltp XS5vcmlnaW4ueCArPSB3aWR0aDsKKyAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocltpXSk7Cisg ICAgICAgICAgICAgIC8qIERyYXcgb3ZlcmxpbmluZywgZXRjLiBvbiB0aGUgY3Vyc29yLiAqLwor ICAgICAgICAgICAgICBpZiAocy0+dy0+cGh5c19jdXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9Y KQorICAgICAgICAgICAgICAgIG1jX25zX2RyYXdfdGV4dF9kZWNvcmF0aW9uIChzLCBmYWNlLCBi Z0NvbCwgd2lkdGgsIHgpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAg IG1jX25zX2RyYXdfdGV4dF9kZWNvcmF0aW9uIChzLCBmYWNlLCBmZ0NvbCwgd2lkdGgsIHgpOwor ICAgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgLy8gIGludCBy eCA9IHJbaV0ub3JpZ2luLng7CisgIC8vICBpbnQgcnkgPSByW2ldLm9yaWdpbi55OworICAvLyAg aW50IHJ3ID0gcltpXS5zaXplLndpZHRoOworICAvLyAgaW50IHJoID0gcltpXS5zaXplLmhlaWdo dDsKKyAgLy8gIGZwcmludGYgKHN0ZGVyciwgIm1jX25zX2R1bXBnbHlwaHNfc3RyZXRjaDogIHZw b3MgKCVkKSB8IHJ4ICglZCkgfCByeSAoJWQpIHwgcncgKCVkKSB8IHJoICglZClcbiIsCisgIC8v ICAgICAgICAgICAgICAgICAgIHMtPmZpcnN0X2dseXBoLT52cG9zLCByeCwgcnksIHJ3LCByaCk7 CisgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHJbaV0pOworICAgICAgICAgICAgfQorICAgICAg ICAgIC8qIERyYXcgb3ZlcmxpbmluZywgZXRjLiBvbiB0aGUgc3RyZXRjaCBnbHlwaCAob3IgdGhl IHBhcnQKKyAgICAgICAgICAgICBvZ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gICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSAxOwor ICAgIH0KKyAgICBlbHNlCisgICAgICBiciA9IE5TTWFrZVJlY3QgKHgsIHksIHMtPnNsaWNlLndp ZHRoLCBzLT5zbGljZS5oZWlnaHQpOworICBOU1JlY3RGaWxsIChicik7CisgIC8qIERyYXcgdGhl IGltYWdlLi4gZG8gd2UgbmVlZCB0byBkcmF3IHBsYWNlaG9sZGVyIGlmIGltZyA9PW5pbD8gKi8K KyAgaWYgKGltZyAhPSBuaWwpCisgICAgeworI2lmZGVmIE5TX0lNUExfQ09DT0EKKyAgICAgIE5T UmVjdCBkciA9IE5TTWFrZVJlY3QgKHgsIHksIHMtPnNsaWNlLndpZHRoLCBzLT5zbGljZS5oZWln aHQpOworICAgICAgTlNSZWN0IGlyID0gTlNNYWtlUmVjdCAocy0+c2xpY2UueCwgcy0+c2xpY2Uu eSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLndpZHRoLCBzLT5zbGlj ZS5oZWlnaHQpOworICAgICAgW2ltZyBkcmF3SW5SZWN0OiBkcgorICAgICAgICAgICAgIGZyb21S ZWN0OiBpcgorICAgICAgICAgICAgIG9wZXJhdGlvbjogTlNDb21wb3NpdGVTb3VyY2VPdmVyCisg ICAgICAgICAgICAgIGZyYWN0aW9uOiAxLjAKKyAgICAgICAgICAgcmVzcGVjdEZsaXBwZWQ6IFlF UworICAgICAgICAgICAgICAgIGhpbnRzOiBuaWxdOworI2Vsc2UKKyAgICAgIFtpbWcgY29tcG9z aXRlVG9Qb2ludDogTlNNYWtlUG9pbnQgKHgsIHkgKyBzLT5zbGljZS5oZWlnaHQpCisgICAgICAg ICAgICAgICAgICBvcGVyYXRpb246IE5TQ29tcG9zaXRlU291cmNlT3Zlcl07CisjZW5kaWYKKyAg ICB9CisgIGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUikKKyAgICB7CisgICAgICBbRlJBTUVfQ1VS U09SX0NPTE9SIChzLT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LT5obCA9PURSQVdfSU1BR0Vf U1VOS0VOKQorICAgIHsKKyAgICAgIGlmIChzLT5obCA9PSBEUkFXX0lNQUdFX1NVTktFTiB8fCBz LT5obCA9PSBEUkFXX0lNQUdFX1JBSVNFRCkKKyAgICAgICAgeworICAgICAgICAgIHRoID0gdG9v bF9iYXJfYnV0dG9uX3JlbGllZiA+PSAwID8KKyAgICAgICAgICAgIHRvb2xfYmFyX2J1dHRvbl9y ZWxpZWYgOiBERUZBVUxUX1RPT0xfQkFSX0JVVFRPTl9SRUxJRUY7CisgICAgICAgICAgcmFpc2Vk X3AgPSAocy0+aGwgPT0gRFJBV19JTUFHRV9SQUlTRUQpOworICAgICAgICB9CisgICAgICAgIGVs c2UKKyAgICAgICAgICB7CisgICAgICAgICAgICB0aCA9IGFicyAocy0+aW1nLT5yZWxpZWYpOwor ICAgICAgICAgICAgcmFpc2VkX3AgPSAocy0+aW1nLT5yZWxpZWYgPiAwKTsKKyAgICAgICAgICB9 CisgICAgICByLm9yaWdpbi54ID0geCAtIHRoOworICAgICAgci5vcmlnaW4ueSA9IHkgLSB0aDsK KyAgICAgIHIuc2l6ZS53aWR0aCA9IHMtPnNsaWNlLndpZHRoICsgMip0aC0xOworICAgICAgci5z aXplLmhlaWdodCA9IHMtPnNsaWNlLmhlaWdodCArIDIqdGgtMTsKKyAgICAgIG5zX2RyYXdfcmVs aWVmIChyLCB0aCwgcmFpc2VkX3AsCisgICAgICAgICAgICAgICAgICAgICAgcy0+c2xpY2UueSA9 PSAwLAorICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLnkgKyBzLT5zbGljZS5oZWlnaHQg PT0gcy0+aW1nLT5oZWlnaHQsCisgICAgICAgICAgICAgICAgICAgICAgcy0+c2xpY2UueCA9PSAw LAorICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLnggKyBzLT5zbGljZS53aWR0aCA9PSBz LT5pbWctPndpZHRoLCBzKTsKKyAgICB9CisgIC8qIElmIHRoZXJlIGlzIG5vIG1hc2ssIHRoZSBi YWNrZ3JvdW5kIHdvbid0IGJlIHNlZW4sCisgICAgIHNvIGRyYXcgYSByZWN0YW5nbGUgb24gdGhl IGltYWdlIGZvciB0aGUgY3Vyc29yLgorICAgICBEbyB0aGlzIGZvciBhbGwgaW1hZ2VzLCBnZXR0 aW5nIHRyYW5zcGFyZW5jeSByaWdodCBpcyBub3QgcmVsaWFibGUuICovCisgIGlmIChzLT5obCA9 PSBEUkFXX0NVUlNPUikKKyAgICB7CisgICAgICBpbnQgdGhpY2tuZXNzID0gYWJzIChzLT5pbWct PnJlbGllZik7CisgICAgICBpZiAodGhpY2tuZXNzID09IDApIHRoaWNrbmVzcyA9IDE7CisgICAg aWYgKGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSAorICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0g TUNfR0xZUEhMRVNTKQorICAgICAgeworICAgICAgICBOU0NvbG9yICpib3JkZXJfY29sb3IgPSBb TlNDb2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiBsc2wucmVkCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JlZW46IGxzbC5ncmVl bgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBibHVlOiBsc2wuYmx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGFscGhhOiAxLjBdOworICAgICAgICBuc19kcmF3X2JveCAo YnIsIHRoaWNrbmVzcywgYm9yZGVyX2NvbG9yLCAxLCAxKTsKKyAgICAgIH0KKyAgICAgIGVsc2UK KyAgICAgICAgbnNfZHJhd19ib3ggKGJyLCB0aGlja25lc3MsIEZSQU1FX0NVUlNPUl9DT0xPUiAo cy0+ZiksIDEsIDEpOworICAgIH0KK30KKworc3RhdGljIHZvaWQKK21jX25zX21heWJlX2R1bXBn bHlwaHNfYmFja2dyb3VuZCAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgY2hhciBmb3JjZV9wKQor eworICBOU1RSQUNFICgibWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIik7CisgIGlm ICghcy0+YmFja2dyb3VuZF9maWxsZWRfcC8qIHx8IHMtPmhsID09IERSQVdfTU9VU0VfRkFDRSov KQorICAgIHsKKyAgICAgIGludCBib3hfbGluZV93aWR0aCA9IG1heCAocy0+ZmFjZS0+Ym94X2xp bmVfd2lkdGgsIDApOworICAgICAgaWYgKEZPTlRfSEVJR0hUIChzLT5mb250KSA8IHMtPmhlaWdo dCAtIDIgKiBib3hfbGluZV93aWR0aAorICAgICAgICAgIC8qIFdoZW4geGRpc3AuYyBpZ25vcmVz IEZPTlRfSEVJR0hULCB3ZSBjYW5ub3QgdHJ1c3QgZm9udAorICAgICAgICAgICAgIGRpbWVuc2lv bnMsIHNpbmNlIHRoZSBhY3R1YWwgZ2x5cGhzIG1pZ2h0IGJlIG11Y2gKKyAgICAgICAgICAgICBz bWFsbGVyLiAgU28gaW4gdGhhdCBjYXNlIHdlIGFsd2F5cyBjbGVhciB0aGUgcmVjdGFuZ2xlCisg ICAgICAgICAgICAgd2l0aCBiYWNrZ3JvdW5kIGNvbG9yLiAqLworICAgICAgICAgIHx8IEZPTlRf VE9PX0hJR0ggKHMtPmZvbnQpCisgICAgICAgICAgfHwgcy0+Zm9udF9ub3RfZm91bmRfcCB8fCBz LT5leHRlbmRzX3RvX2VuZF9vZl9saW5lX3AgfHwgZm9yY2VfcCkKKyAgICAgICAgeworICAgICAg ICAgIHN0cnVjdCBmYWNlICpmYWNlOworICAgICAgICAgIGlmIChzLT5obCA9PSBEUkFXX01PVVNF X0ZBQ0UpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQg KHMtPmYsIE1PVVNFX0hMX0lORk8gKHMtPmYpLT5tb3VzZV9mYWNlX2ZhY2VfaWQpOworICAgICAg ICAgICAgICBpZiAoIWZhY2UpCisgICAgICAgICAgICAgICAgZmFjZSA9IEZBQ0VfRlJPTV9JRCAo cy0+ZiwgTU9VU0VfRkFDRV9JRCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisg ICAgICAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIHMtPmZpcnN0X2dseXBoLT5m YWNlX2lkKTsKKyAgICAgICAgICBpZiAoIWZhY2UtPnN0aXBwbGUpCisgICAgICAgICAgICBbKE5T X0ZBQ0VfQkFDS0dST1VORCAoZmFjZSkgIT0gMAorICAgICAgICAgICAgICA/IG5zX2xvb2t1cF9p bmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpLCBzLT5mKQorICAgICAgICAg ICAgICA6IEZSQU1FX0JBQ0tHUk9VTkRfQ09MT1IgKHMtPmYpKSBzZXRdOworICAgICAgICAgICAg ZWxzZQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RydWN0IG5zX2Rpc3BsYXlf aW5mbyAqZHB5aW5mbyA9IEZSQU1FX0RJU1BMQVlfSU5GTyAocy0+Zik7CisgICAgICAgICAgICAg ICAgW1tkcHlpbmZvLT5iaXRtYXBzW2ZhY2UtPnN0aXBwbGUtMV0uaW1nIHN0aXBwbGVNYXNrXSBz ZXRdOworICAgICAgICAgICAgICB9CisgICAgICAgICAgaWYgKHMtPmhsICE9IERSQVdfQ1VSU09S KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzLT5yZWN0YW5nbGVfbnVrZWRfcCA9IHRy dWU7CisgICAgICAgICAgICAgIE5TUmVjdCByID0gTlNNYWtlUmVjdCAocy0+eCwgcy0+eSArIGJv eF9saW5lX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+YmFj a2dyb3VuZF93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPmhl aWdodC0yKmJveF9saW5lX3dpZHRoKTsKKyAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7Cisg ICAgICAgICAgICB9CisgICAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IDE7CisgICAg ICAgIH0KKyAgICB9Cit9CisKK3N0YXRpYyB2b2lkCittY19uc19kcmF3X2dseXBoX3N0cmluZyAo c3RydWN0IGdseXBoX3N0cmluZyAqcywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1 Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JH QiBsc2wsIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciwKKyAgICAgICAgICAgICAgICAgICAg ICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAg ICAgICAgIGludCB3ZCwgYm9vbCBhY3RpdmVfcCwgYm9vbCBjdXJzb3JfZ2NfcCkKKy8qIC0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tCisgICAgICBFeHRlcm5hbCAoUklGKTogTWFpbiBkcmF3LXRleHQgY2FsbC4K KyAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCit7CisgIE5TUmVjdCByWzJdOworICBpbnQgbjsKKyAg Y2hhciBib3hfZHJhd25fcCA9IDA7CisgIHN0cnVjdCBmb250ICpmb250ID0gcy0+ZmFjZS0+Zm9u dDsKKyAgaWYgKCFmb250KQorICAgIGZvbnQgPSBGUkFNRV9GT05UIChzLT5mKTsKKyAgTlNUUkFD RV9XSEVOIChOU1RSQUNFX0dST1VQX0dMWVBIUywgIm1jX25zX2RyYXdfZ2x5cGhfc3RyaW5nIik7 CisgIGlmIChzLT5uZXh0ICYmIHMtPnJpZ2h0X292ZXJoYW5nICYmICFzLT5mb3Jfb3ZlcmxhcHMp CisgICAgeworICAgICAgaW50IHdpZHRoOworICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAqbmV4 dDsKKyAgICAgIGZvciAod2lkdGggPSAwLCBuZXh0ID0gcy0+bmV4dDsKKyAgICAgICAgICAgbmV4 dCAmJiB3aWR0aCA8IHMtPnJpZ2h0X292ZXJoYW5nOworICAgICAgICAgICB3aWR0aCArPSBuZXh0 LT53aWR0aCwgbmV4dCA9IG5leHQtPm5leHQpCisgICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlw aC0+dHlwZSAhPSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpZiAobmV4 dC0+Zmlyc3RfZ2x5cGgtPnR5cGUgIT0gU1RSRVRDSF9HTFlQSCkKKyAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocy0+bmV4 dCwgcik7CisgICAgICAgICAgICAgICAgaWYgKCFuc19jbGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4p KQorICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIG1jX25zX21heWJl X2R1bXBnbHlwaHNfYmFja2dyb3VuZCAocy0+bmV4dCwgMSk7CisgICAgICAgICAgICAgICAgbnNf cmVzZXRfY2xpcHBpbmcgKHMtPmYpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICBtY19uc19kdW1wZ2x5cGhzX3N0cmV0Y2ggKHMtPm5leHQsIG1h dHJpeCwgcm93LCB3ZCk7CisgICAgICAgICAgICBuZXh0LT5udW1fY2xpcHMgPSAwOworICAgICAg ICAgIH0KKyAgICB9CisgIGlmICghcy0+Zm9yX292ZXJsYXBzICYmIHMtPmZhY2UtPmJveCAhPSBG QUNFX05PX0JPWAorICAgICAgJiYgKHMtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgK KyAgICAgICAgICB8fCBzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpKQor ICAgIHsKKyAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgcik7Cisg ICAgICBpZiAoIW5zX2NsaXBfdG9fcmVjdCAocy0+ZiwgciwgbikpCisgICAgICAgIHJldHVybjsK KyAgICAgIG1jX25zX21heWJlX2R1bXBnbHlwaHNfYmFja2dyb3VuZCAocywgMSk7CisgICAgICBu c19kdW1wZ2x5cGhzX2JveF9vcl9yZWxpZWYgKHMpOworICAgICAgbnNfcmVzZXRfY2xpcHBpbmcg KHMtPmYpOworICAgICAgYm94X2RyYXduX3AgPSAxOworICAgIH0KKyAgc3dpdGNoIChzLT5maXJz dF9nbHlwaC0+dHlwZSkKKyAgICB7CisgICAgY2FzZSBJTUFHRV9HTFlQSDoKKyAgICAgIG4gPSBu c19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgcik7CisgICAgICBpZiAoIW5zX2NsaXBf dG9fcmVjdCAocy0+ZiwgciwgbikpCisgICAgICAgIHJldHVybjsKKyAgICAgIG1jX25zX2R1bXBn bHlwaHNfaW1hZ2UgKHMsIHJbMF0sIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgYWN0 aXZlX3ApOworICAgICAgbnNfcmVzZXRfY2xpcHBpbmcgKHMtPmYpOworICAgICAgYnJlYWs7Cisg ICAgY2FzZSBTVFJFVENIX0dMWVBIOgorICAgICAgbWNfbnNfZHVtcGdseXBoc19zdHJldGNoIChz LCBtYXRyaXgsIHJvdywgd2QpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBDSEFSX0dMWVBIOgor ICAgIGNhc2UgQ09NUE9TSVRFX0dMWVBIOgorICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdf Y2xpcF9yZWN0IChzLCByKTsKKyAgICAgIGlmICghbnNfY2xpcF90b19yZWN0IChzLT5mLCByLCBu KSkKKyAgICAgICAgcmV0dXJuOworICAgICAgaWYgKHMtPmZvcl9vdmVybGFwcworICAgICAgICAg IHx8IChzLT5jbXBfZnJvbSA+IDAKKyAgICAgICAgICAgICAgJiYgISBzLT5maXJzdF9nbHlwaC0+ dS5jbXAuYXV0b21hdGljKSkKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IDE7Cisg ICAgICAgIGVsc2UKKyAgICAgICAgICBtY19uc19tYXliZV9kdW1wZ2x5cGhzX2JhY2tncm91bmQg KHMsIHMtPmZpcnN0X2dseXBoLT50eXBlID09IENPTVBPU0lURV9HTFlQSCk7CisgICAgICBpbnQg ZmxhZ3MgPSAocy0+aGwgPT0gRFJBV19DVVJTT1IpCisgICAgICAgICAgICAgICAgICAgID8gTlNf RFVNUEdMWVBIX0NVUlNPUgorICAgICAgICAgICAgICAgICAgOiAocy0+aGwgPT0gRFJBV19NT1VT RV9GQUNFKQorICAgICAgICAgICAgICAgICAgICA/IE5TX0RVTVBHTFlQSF9NT1VTRUZBQ0UKKyAg ICAgICAgICAgICAgICAgIDogKHMtPmZvcl9vdmVybGFwcykKKyAgICAgICAgICAgICAgICAgICAg PyBOU19EVU1QR0xZUEhfRk9SRUdST1VORAorICAgICAgICAgICAgICAgICAgOiBOU19EVU1QR0xZ UEhfTk9STUFMOworICAgICAgdW5zaWduZWQgbG9uZyBzYXZlZF9mZyA9IE5TX0ZBQ0VfRk9SRUdS T1VORCAocy0+ZmFjZSk7CisgICAgICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IgJiYgY3Vyc29y X3R5cGUgPT0gTUNfRklMTEVEX0JPWCkKKyAgICAgICAgeworICAgICAgICAgIHVuc2lnbmVkIGxv bmcgdG1wID0gTlNfRkFDRV9CQUNLR1JPVU5EIChzLT5mYWNlKTsKKyAgICAgICAgICBOU19GQUNF X0JBQ0tHUk9VTkQgKHMtPmZhY2UpID0gTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKTsKKyAg ICAgICAgICBOU19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2UpID0gdG1wOworICAgICAgICB9Cisg ICAgICAgIGVsc2UgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SCisgICAgICAgICAgICAgICAgICYm IGN1cnNvcl90eXBlID09IE1DX0ZSQU1FRF9CT1gKKyAgICAgICAgICAgICAgICAgJiYgYWN0aXZl X3ApCisgICAgICAgICAgeworICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVf ZmFjZV9pZCA9CisgICAgICAgICAgICAgIGxvb2t1cF9uYW1lZF9mYWNlIChzLT53LCBzLT5mLCBp bnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAg ICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChzLT5m LCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgTlNfRkFDRV9GT1JFR1JPVU5E IChzLT5mYWNlKSA9IE5TX0ZBQ0VfRk9SRUdST1VORCAoaG9sbG93X2FjdGl2ZV9mYWNlKTsKKyAg ICAgICAgICB9CisgICAgICAgICAgZWxzZSBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IKKyAgICAg ICAgICAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YCisgICAgICAgICAg ICAgICAgICAgJiYgYWN0aXZlX3ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGVudW0g ZmFjZV9pZCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCA9CisgICAgICAgICAgICAgICAgbG9va3Vw X25hbWVkX2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFj dGl2ZS1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhv bGxvd19pbmFjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBob2xsb3dfaW5hY3RpdmVf ZmFjZV9pZCk7CisgICAgICAgICAgICAgIE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSkgPSBO U19GQUNFX0ZPUkVHUk9VTkQgKGhvbGxvd19pbmFjdGl2ZV9mYWNlKTsKKyAgICAgICAgICAgIH0K KyAgICAgIGlmIChzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpCisgICAg ICAgIG5zX2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAgICAg ICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgd2l0aF9iZ19wID0gKChmbGFn cyA9PSBOU19EVU1QR0xZUEhfTk9STUFMICYmICFzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgZmxhZ3MgPT0gTlNfRFVNUEdMWVBIX01PVVNF RkFDRSk7CisgICAgICAgICAgICBpZiAod2l0aF9iZ19wKQorICAgICAgICAgICAgICBzLT5iYWNr Z3JvdW5kX251a2VkX3AgPSB0cnVlOworICAgICAgICAgICAgZm9udC0+ZHJpdmVyLT5kcmF3IChz LCBzLT5jbXBfZnJvbSwgcy0+bmNoYXJzLCBzLT54LCBzLT55YmFzZSwgd2l0aF9iZ19wKTsKKyAg ICAgICAgICB9CisgICAgICBOU0NvbG9yICpjb2wgPSAoTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5m YWNlKSAhPSAwCisgICAgICAgICAgICAgICAgICAgICA/IG5zX2xvb2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Rk9SRUdST1VORCAocy0+ZmFjZSkgPSB0bXA7CisgICAgICAgIH0K KyAgICAgICAgZWxzZSBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IKKyAgICAgICAgICAgICAgICAg JiYgY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWCkKKyAgICAgICAgICBOU19GQUNFX0ZPUkVH Uk9VTkQgKHMtPmZhY2UpID0gc2F2ZWRfZmc7CisgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+ Zik7CisgICAgICBicmVhazsKKyAgICBjYXNlIEdMWVBITEVTU19HTFlQSDoKKyAgICAgIG4gPSBu c19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgcik7CisgICAgICBpZiAoIW5zX2NsaXBf dG9fcmVjdCAocy0+ZiwgciwgbikpCisgICAgICAgIHJldHVybjsKKyAgICAgIGlmIChzLT5mb3Jf b3ZlcmxhcHMKKyAgICAgICAgICB8fCAocy0+Y21wX2Zyb20gPiAwCisgICAgICAgICAgICAgICYm ICEgcy0+Zmlyc3RfZ2x5cGgtPnUuY21wLmF1dG9tYXRpYykpCisgICAgICAgIHMtPmJhY2tncm91 bmRfZmlsbGVkX3AgPSAxOworICAgICAgZWxzZQorICAgICAgICBtY19uc19tYXliZV9kdW1wZ2x5 cGhzX2JhY2tncm91bmQgKHMsIHMtPmZpcnN0X2dseXBoLT50eXBlID09IENPTVBPU0lURV9HTFlQ SCk7CisgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICBicmVhazsKKyAgICBk ZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7CisgICAgfQorICAvKiBEcmF3IGJveCBpZiBu b3QgZG9uZSBhbHJlYWR5LiAqLworICBpZiAoIXMtPmZvcl9vdmVybGFwcworICAgICAgJiYgIWJv eF9kcmF3bl9wCisgICAgICAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gpCisgICAgewor ICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAgICAgIGlm ICghbnNfY2xpcF90b19yZWN0IChzLT5mLCByLCBuKSkKKyAgICAgICAgcmV0dXJuOworICAgICAg bnNfZHVtcGdseXBoc19ib3hfb3JfcmVsaWVmIChzKTsKKyAgICAgIG5zX3Jlc2V0X2NsaXBwaW5n IChzLT5mKTsKKyAgICB9CisgIHMtPm51bV9jbGlwcyA9IDA7Cit9CisKKy8qIGVuZCBNVUxUSVBM RS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiA9PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PQogCiAgICBOU1RSQUNFLCBUcmFjZSBzdXBwb3J0LgpAQCAtMTA3OSw2ICsyMDQ4LDE2 IEBAIHN0YXRpYyBOU1JlY3QgY29uc3RyYWluX2ZyYW1lX3JlY3QoTlNSZWN0IGZyYW1lUmVjdCwg Ym9vbCBpc0Z1bGxzY3JlZW4pCiAgICBleHRlcm5hbCAoUklGKSBjYWxsOyB3aG9sZSBmcmFtZSwg Y2FsbGVkIGJlZm9yZSBndWlfdXBkYXRlX3dpbmRvd19iZWdpbgogICAgLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNP UlMgKi8KKworICBmLT5tY191cGRhdGluZ19mcmFtZSA9IGY7CisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworCisKICNpZmRlZiBOU19JTVBMX0NPQ09BCiAgIEVtYWNzVmlldyAqdmlldyA9IEZS QU1FX05TX1ZJRVcgKGYpOwogCkBAIC0xMTA5LDYgKzIwODgsMTYgQEAgc3RhdGljIE5TUmVjdCBj b25zdHJhaW5fZnJhbWVfcmVjdChOU1JlY3QgZnJhbWVSZWN0LCBib29sIGlzRnVsbHNjcmVlbikK IAogLyogICBpZiAoZiA9PSBNT1VTRV9ITF9JTkZPIChmKS0+bW91c2VfZmFjZV9tb3VzZV9mcmFt ZSkgKi8KICAgTU9VU0VfSExfSU5GTyAoZiktPm1vdXNlX2ZhY2VfZGVmZXIgPSAwOworCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1j X3VwZGF0aW5nX2ZyYW1lID0gTlVMTDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog fQogCiAKQEAgLTQ3NTksNiArNTc0OCwxNyBAQCBpbiBjZXJ0YWluIHNpdHVhdGlvbnMgKHJhcGlk IGluY29taW5nIGV2ZW50cykuCiAgICAgICBiYXIgPSBbW0VtYWNzU2Nyb2xsZXIgYWxsb2NdIGlu aXRGcmFtZTogciB3aW5kb3c6IHdpbl07CiAgICAgICB3c2V0X3ZlcnRpY2FsX3Njcm9sbF9iYXIg KHdpbmRvdywgbWFrZV9taW50X3B0ciAoYmFyKSk7CiAgICAgICB1cGRhdGVfcCA9IFlFUzsKKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAg ICAgLyogVGhpcyBpcyBvbmx5IGZvciBkZWJ1Z2dpbmcgcHVycG9zZXMuICovCisgICAgICBbYmFy IG1jX3NldF9yZWN0YW5nbGU6IHJdOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAg ICAgfQogICBlbHNlCiAgICAgewpAQCAtNDc2NiwxMiArNTc2NiwzMCBAQCBpbiBjZXJ0YWluIHNp dHVhdGlvbnMgKHJhcGlkIGluY29taW5nIGV2ZW50cykuCiAgICAgICBiYXIgPSBYTlNfU0NST0xM X0JBUiAod2luZG93LT52ZXJ0aWNhbF9zY3JvbGxfYmFyKTsKICAgICAgIG9sZFJlY3QgPSBbYmFy IGZyYW1lXTsKICAgICAgIHIuc2l6ZS53aWR0aCA9IG9sZFJlY3Quc2l6ZS53aWR0aDsKKworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogICAgICAg aWYgKEZSQU1FX0xJVkVfUCAoZikgJiYgIU5TRXF1YWxSZWN0cyAob2xkUmVjdCwgcikpCiAgICAg ICAgIHsKKyAgICAgICAgICAvKiBUaGUgbWFpbiB3aW5kb3cgaGFzIHByb2JhYmx5IGJlZW4gcmVz aXplZC4gIEdyYWNpb3VzbHkgZGVsZXRlIHRoZQorICAgICAgICAgIG9sZCBzY3JvbGwgYmFyIHdp dGhvdXQgcmVwYWludGluZyBpdHMgcmVjdGFuZ2xlOyBhbmQsIGNyZWF0ZSBhIG5ldworICAgICAg ICAgIHNjcm9sbCBiYXIgZWxzZXdoZXJlLiovCiAgICAgICAgICAgaWYgKG9sZFJlY3Qub3JpZ2lu LnggIT0gci5vcmlnaW4ueCkKKyAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgbnNfY2xlYXJf ZnJhbWVfYXJlYSAoZiwgbGVmdCwgdG9wLCB3aWR0aCwgaGVpZ2h0KTsKKyAgICAgICAgICAgICAg W2JhciBtY19qdWRnZV07CisgICAgICAgICAgICAgIGJhciA9IFtbRW1hY3NTY3JvbGxlciBhbGxv Y10gaW5pdEZyYW1lOiByIHdpbmRvdzogd2luXTsKKyAgICAgICAgICAgICAgd3NldF92ZXJ0aWNh bF9zY3JvbGxfYmFyICh3aW5kb3csIG1ha2VfbWludF9wdHIgKGJhcikpOworICAgICAgICAgICAg fQorICAgICAgICAgICAgZWxzZQogICAgICAgICAgIFtiYXIgc2V0RnJhbWU6IHJdOwogICAgICAg ICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICB9CiAKICAgaWYgKHVwZGF0 ZV9wKQpAQCAtNDkzMSw5ICs1OTQ5LDU3IEBAIGluIGNlcnRhaW4gc2l0dWF0aW9ucyAocmFwaWQg aW5jb21pbmcgZXZlbnRzKS4KICAgICB7CiAgICAgICB2aWV3ID0gW3N1YnZpZXdzIG9iamVjdEF0 SW5kZXg6IGldOwogICAgICAgaWYgKCFbdmlldyBpc0tpbmRPZkNsYXNzOiBbRW1hY3NTY3JvbGxl ciBjbGFzc11dKSBjb250aW51ZTsKLSAgICAgIGlmIChbdmlldyBqdWRnZV0pCisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogYFhTRVRX SU5ET1cnIHdpbGwgc29tZXRpbWVzIGNhdXNlIEVtYWNzIHRvIGNyYXNoIHdoZW4gcnVubmluZyB1 bmRlciBnZGIgZXZlbgorICB0aG91Z2ggKHcgIT0gTlVMTCkuICBUaGVyZWZvcmUsIHdlIGNhbm5v dCByZWxpYWJseSB1c2UgYFdJTkRPV19MSVZFX1AnLiAqLworICBzdHJ1Y3Qgd2luZG93ICp3ID0g W3ZpZXcgbWNfZ2V0X3dpbmRvd107CisgIGlmICh3ICE9IE5VTEwKKyAgICAgICYmIE5JTFAgKHct PmNvbnRlbnRzKSkKKyAgICB7CisgICAgICBCT09MIGRlYnVnX3AgPSBmYWxzZTsKKyAgICAgIGlm IChkZWJ1Z19wCisgICAgICAgICAgLyogYHdpbmRvd19ib3gnIGNhbGxzIGB3aW5kb3dfYm94X2hl aWdodCcsIHdoaWNoIHdpbGwgY2F1c2UgRW1hY3MgdG8KKyAgICAgICAgICBjcmFzaCBpZiBGUkFN RVAgKHctPmZyYW1lKSBpcyBub3Qgc2F0aXNmaWVkLiAqLworICAgICAgICAgICYmIEZSQU1FUCAo dy0+ZnJhbWUpKQorICAgICAgICB7CisgICAgICAgICAgTlNSZWN0IHIwID0gW3ZpZXcgbWNfZ2V0 X3JlY3RhbmdsZV07CisgICAgICAgICAgaW50IHgwID0gTlNNaW5YIChyMCk7CisgICAgICAgICAg aW50IHkwID0gTlNNaW5ZIChyMCk7CisgICAgICAgICAgaW50IHdkMCA9IE5TV2lkdGggKHIwKTsK KyAgICAgICAgICBpbnQgaDAgPSBOU0hlaWdodCAocjApOworICAgICAgICAgIGludCB3aW5kb3df eSwgd2luZG93X2hlaWdodDsKKyAgICAgICAgICB3aW5kb3dfYm94ICh3LCBBTllfQVJFQSwgMCwg JndpbmRvd195LCAwLCAmd2luZG93X2hlaWdodCk7CisgICAgICAgICAgaW50IHRvcCA9IHdpbmRv d195OworICAgICAgICAgIGludCBoZWlnaHQgPSB3aW5kb3dfaGVpZ2h0OworICAgICAgICAgIGlu dCB3aWR0aCA9IFdJTkRPV19DT05GSUdfU0NST0xMX0JBUl9DT0xTICh3KSAqIEZSQU1FX0NPTFVN Tl9XSURUSCAoZik7CisgICAgICAgICAgaW50IGxlZnQgPSBXSU5ET1dfU0NST0xMX0JBUl9BUkVB X1ggKHcpOworICAgICAgICAgIE5TUmVjdCByMSA9IE5TTWFrZVJlY3QgKGxlZnQsIHRvcCwgd2lk dGgsIGhlaWdodCk7CisgICAgICAgICAgLyogVGhlIHBhcmVudCB2aWV3IGlzIGZsaXBwZWQsIHNv IHdlIG5lZWQgdG8gZmxpcCB5IHZhbHVlLiAqLworICAgICAgICAgIEVtYWNzVmlldyAqZnJhbWVf dmlldyA9IEZSQU1FX05TX1ZJRVcgKGYpOworICAgICAgICAgIE5TUmVjdCB2ID0gW2ZyYW1lX3Zp ZXcgZnJhbWVdOworICAgICAgICAgIHIxLm9yaWdpbi55ID0gKHYuc2l6ZS5oZWlnaHQgLSByMS5z aXplLmhlaWdodCAtIHIxLm9yaWdpbi55KTsKKyAgICAgICAgICBpbnQgeDEgPSBOU01pblggKHIx KTsKKyAgICAgICAgICBpbnQgeTEgPSBOU01pblkgKHIxKTsKKyAgICAgICAgICBpbnQgd2QxID0g TlNXaWR0aCAocjEpOworICAgICAgICAgIGludCBoMSA9IE5TSGVpZ2h0IChyMSk7CisgICAgICAg ICAgZnByaW50ZiAoc3RkZXJyLCAiJXMgLS0gREVBRDpcblwKKyAgICAgICAgICB4MC94MSAoJWQv JWQpIHwgeTAveTEgKCVkLyVkKSB8IHdkMC93ZDEgKCVkLyVkKSB8IGgwL2gxICglZC8lZClcbiIs CisgICAgICAgICAgbWNfd2luZG93ICh3KSwgeDAsIHgxLCB5MCwgeTEsIHdkMCwgd2QxLCBoMCwg aDEpOworICAgICAgICB9CisgICAgICBpZiAoW3ZpZXcgbWNfanVkZ2VdKQogICAgICAgICByZW1v dmVkID0gWUVTOwogICAgIH0KKyAgICBlbHNlIGlmIChbdmlldyBqdWRnZV0pCisgICAgICByZW1v dmVkID0gWUVTOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCisgICAgfQogCiAgIGlm IChyZW1vdmVkKQogICAgIFtldmlldyB1cGRhdGVGcmFtZVNpemU6IE5PXTsKQEAgLTUwNzQsNiAr NjE0MCwyMCBAQCBzdGF0aWMgTGlzcF9PYmplY3QgbnNfc3RyaW5nX3RvX2xpc3Btb2QgKGNvbnN0 IGNoYXIgKnMpCiBleHRlcm4gZnJhbWVfcGFybV9oYW5kbGVyIG5zX2ZyYW1lX3Bhcm1faGFuZGxl cnNbXTsKIHN0YXRpYyBzdHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFjZSBuc19yZWRpc3BsYXlfaW50 ZXJmYWNlID0KIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKworLyogYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGBuc3Rlcm0ubWAgbXVzdCBi ZSBpbiB0aGUgZXhhY3Qgc2FtZSBvcmRlciBhcyB0aGUKK2ByZWRpc3BsYXlfaW50ZXJmYWNlJyBp biBgZGlzcGV4dGVybi5oYCEgKi8KKworICBtY19uc19kcmF3X3dpbmRvd19jdXJzb3IsCisgIG1j X25zX2RyYXdfZ2x5cGhfc3RyaW5nLAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAg IG5zX2ZyYW1lX3Bhcm1faGFuZGxlcnMsCiAgIGd1aV9wcm9kdWNlX2dseXBocywKICAgZ3VpX3dy aXRlX2dseXBocywKQEAgLTg3MTEsNiArOTc5MSw0OSBAQCAtIChCT09MKWNhbkJlY29tZU1haW5X aW5kb3cKIAogQGltcGxlbWVudGF0aW9uIEVtYWNzU2Nyb2xsZXIKIAorCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLSAodm9pZCltY19zZXRfcmVj dGFuZ2xlOiAoTlNSZWN0KXJlY3QKK3sKKyAgbWNfcmVjdGFuZ2xlID0gcmVjdDsKK30KKworLSAo TlNSZWN0KW1jX2dldF9yZWN0YW5nbGUKK3sKKyAgcmV0dXJuIG1jX3JlY3RhbmdsZTsKK30KKwor LSAoc3RydWN0IHdpbmRvdyAqKW1jX2dldF93aW5kb3cKK3sKKyAgcmV0dXJuIHdpbmRvdzsKK30K KworLSAoYm9vbCltY19qdWRnZQoreworICBOU1RSQUNFICgiW0VtYWNzU2Nyb2xsZXIgbWNfanVk Z2VdIik7CisgIGJvb2wgcmV0ID0gY29uZGVtbmVkOworICBibG9ja19pbnB1dCAoKTsKKyAgaWYg KGNvbmRlbW5lZCkKKyAgICB7CisgICAgICAvKiBlbnN1cmUgb3RoZXIgc2Nyb2xsYmFyIHVwZGF0 ZXMgYWZ0ZXIgZGVsZXRpb24gKi8KKyAgICAgIEVtYWNzVmlldyAqdmlldyA9IChFbWFjc1ZpZXcg KilGUkFNRV9OU19WSUVXIChmcmFtZSk7CisgICAgICBpZiAodmlldyAhPSBuaWwpCisgICAgICAg IHZpZXctPnNjcm9sbGJhcnNOZWVkaW5nVXBkYXRlKys7CisgICAgfQorICBpZiAod2luZG93KQor ICAgIHdzZXRfdmVydGljYWxfc2Nyb2xsX2JhciAod2luZG93LCBRbmlsKTsKKyAgd2luZG93ID0g MDsKKyAgW3NlbGYgcmVtb3ZlRnJvbVN1cGVydmlld1dpdGhvdXROZWVkaW5nRGlzcGxheV07Cisg IFtzZWxmIHJlbGVhc2VdOworICB1bmJsb2NrX2lucHV0ICgpOworICByZXR1cm4gcmV0OworfQor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBmb3IgcmVwZWF0IGJ1dHRvbiBwdXNo ICovCi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KCk7CQkJCVwKKyAgICBlbHNlIGlmIChwZW5kaW5nX3NpZ25hbHMpCQkJCVwKKyAg ICAgIHByb2Nlc3NfcGVuZGluZ19zaWduYWxzICgpOwkJCVwKKyAgfSB3aGlsZSAoZmFsc2UpCisK K3N0YXRpYyBMaXNwX09iamVjdAorbWNfdzMyX2NvbG9yX21hcF9sb29rdXAgKGNvbnN0IGNoYXIg KmNvbG9ybmFtZSkKK3sKKyAgTGlzcF9PYmplY3QgdGFpbCwgcmV0ID0gUW5pbDsKKyAgYmxvY2tf aW5wdXQgKCk7CisgIGZvciAodGFpbCA9IFZ3MzJfY29sb3JfbWFwOyBDT05TUCAodGFpbCk7IHRh aWwgPSBYQ0RSICh0YWlsKSkKKyAgICB7CisgICAgICByZWdpc3RlciBMaXNwX09iamVjdCBlbHQs IHRlbTsKKyAgICAgIGVsdCA9IFhDQVIgKHRhaWwpOworICAgICAgaWYgKCFDT05TUCAoZWx0KSkg Y29udGludWU7CisgICAgICB0ZW0gPSBYQ0FSIChlbHQpOworICAgICAgaWYgKGxzdHJjbXBpIChT U0RBVEEgKHRlbSksIGNvbG9ybmFtZSkgPT0gMCkKKyAgICAgICAgeworICAgICAgICAgIHJldCA9 IEZjZHIgKGVsdCk7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIE1DX1FVSVQ7 CisgICAgfQorICB1bmJsb2NrX2lucHV0ICgpOworICByZXR1cm4gcmV0OworfQorCitzdGF0aWMg TGlzcF9PYmplY3QKK21jX3hfdG9fdzMyX2NvbG9yIChjb25zdCBjaGFyICogY29sb3JuYW1lKQor eworICByZWdpc3RlciBMaXNwX09iamVjdCByZXQgPSBRbmlsOworICBibG9ja19pbnB1dCAoKTsK KyAgaWYgKGNvbG9ybmFtZVswXSA9PSAnIycpCisgICAgeworICAgICAgLyogQ291bGQgYmUgYW4g b2xkLXN0eWxlIFJHQiBEZXZpY2Ugc3BlY2lmaWNhdGlvbi4gKi8KKyAgICAgIGludCBzaXplID0g c3RybGVuIChjb2xvcm5hbWUgKyAxKTsKKyAgICAgIGNoYXIgKmNvbG9yID0gYWxsb2NhIChzaXpl ICsgMSk7CisgICAgICBzdHJjcHkgKGNvbG9yLCBjb2xvcm5hbWUgKyAxKTsKKyAgICAgIGlmIChz aXplID09IDMgfHwgc2l6ZSA9PSA2IHx8IHNpemUgPT0gOSB8fCBzaXplID09IDEyKQorICAgICAg ICB7CisgICAgICAgICAgVUlOVCBjb2xvcnZhbDsKKyAgICAgICAgICBpbnQgaSwgcG9zOworICAg ICAgICAgIHBvcyA9IDA7CisgICAgICAgICAgc2l6ZSAvPSAzOworICAgICAgICAgIGNvbG9ydmFs ID0gMDsKKyAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMzsgaSsrKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICBjaGFyICplbmQ7CisgICAgICAgICAgICAgIGNoYXIgdDsKKyAgICAgICAg ICAgICAgdW5zaWduZWQgbG9uZyB2YWx1ZTsKKyAgICAgICAgICAgICAgLyogVGhlIGNoZWNrIGZv ciAneCcgaW4gdGhlIGZvbGxvd2luZyBjb25kaXRpb25hbCB0YWtlcyBpbnRvCisgICAgICAgICAg ICAgIGFjY291bnQgdGhlIGZhY3QgdGhhdCBzdHJ0b2wgYWxsb3dzIGEgIjB4IiBpbiBmcm9udCBv ZgorICAgICAgICAgICAgICBvdXIgbnVtYmVycywgYW5kIHdlIGRvbid0LiAqLworICAgICAgICAg ICAgICBpZiAoIWlzeGRpZ2l0IChjb2xvclswXSkgfHwgY29sb3JbMV0gPT0gJ3gnKQorICAgICAg ICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICB0ID0gY29sb3Jbc2l6ZV07CisgICAgICAg ICAgICAgIGNvbG9yW3NpemVdID0gJ1wwJzsKKyAgICAgICAgICAgICAgdmFsdWUgPSBzdHJ0b3Vs IChjb2xvciwgJmVuZCwgMTYpOworICAgICAgICAgICAgICBjb2xvcltzaXplXSA9IHQ7CisgICAg ICAgICAgICAgIGlmIChlcnJubyA9PSBFUkFOR0UgfHwgZW5kIC0gY29sb3IgIT0gc2l6ZSkKKyAg ICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgc3dpdGNoIChzaXplKQorICAgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjYXNlIDE6CisgICAgICAgICAgICAgICAgICB2 YWx1ZSA9IHZhbHVlICogMHgxMDsKKyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAg ICAgICAgIGNhc2UgMjoKKyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAg IGNhc2UgMzoKKyAgICAgICAgICAgICAgICAgIHZhbHVlIC89IDB4MTA7CisgICAgICAgICAgICAg ICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIDQ6CisgICAgICAgICAgICAgICAgICB2 YWx1ZSAvPSAweDEwMDsKKyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgICAgY29sb3J2YWwgfD0gKHZhbHVlIDw8IHBvcyk7CisgICAgICAgICAg ICAgIHBvcyArPSAweDg7CisgICAgICAgICAgICAgIGlmIChpID09IDIpCisgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAg ICAgIFhTRVRJTlQgKHJldCwgY29sb3J2YWwpOworICAgICAgICAgICAgICAgICAgcmV0dXJuIHJl dDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGNvbG9yID0gZW5kOworICAgICAg ICAgICAgfQorICAgICAgICB9CisgICAgfQorICBlbHNlIGlmIChzdHJuaWNtcCAoY29sb3JuYW1l LCAicmdiOiIsIDQpID09IDApCisgICAgeworICAgICAgY29uc3QgY2hhciAqY29sb3I7CisgICAg ICBVSU5UIGNvbG9ydmFsOworICAgICAgaW50IGksIHBvczsKKyAgICAgIHBvcyA9IDA7CisgICAg ICBjb2xvcnZhbCA9IDA7CisgICAgICBjb2xvciA9IGNvbG9ybmFtZSArIDQ7CisgICAgICBmb3Ig KGkgPSAwOyBpIDwgMzsgaSsrKQorICAgICAgICB7CisgICAgICAgICAgY2hhciAqZW5kOworICAg ICAgICAgIHVuc2lnbmVkIGxvbmcgdmFsdWU7CisgICAgICAgICAgLyogVGhlIGNoZWNrIGZvciAn eCcgaW4gdGhlIGZvbGxvd2luZyBjb25kaXRpb25hbCB0YWtlcyBpbnRvCisgICAgICAgICAgICAg YWNjb3VudCB0aGUgZmFjdCB0aGF0IHN0cnRvbCBhbGxvd3MgYSAiMHgiIGluIGZyb250IG9mCisg ICAgICAgICAgICAgb3VyIG51bWJlcnMsIGFuZCB3ZSBkb24ndC4gKi8KKyAgICAgICAgICBpZiAo IWlzeGRpZ2l0IChjb2xvclswXSkgfHwgY29sb3JbMV0gPT0gJ3gnKQorICAgICAgICAgICAgYnJl YWs7CisgICAgICAgICAgdmFsdWUgPSBzdHJ0b3VsIChjb2xvciwgJmVuZCwgMTYpOworICAgICAg ICAgIGlmIChlcnJubyA9PSBFUkFOR0UpCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBz d2l0Y2ggKGVuZCAtIGNvbG9yKQorICAgICAgICAgICAgeworICAgICAgICAgICAgY2FzZSAxOgor ICAgICAgICAgICAgICB2YWx1ZSA9IHZhbHVlICogMHgxMCArIHZhbHVlOworICAgICAgICAgICAg ICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgMjoKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAg ICAgICAgICBjYXNlIDM6CisgICAgICAgICAgICAgIHZhbHVlIC89IDB4MTA7CisgICAgICAgICAg ICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSA0OgorICAgICAgICAgICAgICB2YWx1ZSAvPSAw eDEwMDsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAg ICAgICAgICB2YWx1ZSA9IFVMT05HX01BWDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBpZiAo dmFsdWUgPT0gVUxPTkdfTUFYKQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgY29sb3J2 YWwgfD0gKHZhbHVlIDw8IHBvcyk7CisgICAgICAgICAgcG9zICs9IDB4ODsKKyAgICAgICAgICBp ZiAoaSA9PSAyKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAoKmVuZCAhPSAnXDAn KQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgp OworICAgICAgICAgICAgICBYU0VUSU5UIChyZXQsIGNvbG9ydmFsKTsKKyAgICAgICAgICAgICAg cmV0dXJuIHJldDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBpZiAoKmVuZCAhPSAnLycpCisg ICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBjb2xvciA9IGVuZCArIDE7CisgICAgICAgIH0K KyAgICB9CisgICAgZWxzZSBpZiAoc3RybmljbXAgKGNvbG9ybmFtZSwgInJnYmk6IiwgNSkgPT0g MCkKKyAgICAgIHsKKyAgICAgICAgLyogVGhpcyBpcyBhbiBSR0IgSW50ZW5zaXR5IHNwZWNpZmlj YXRpb24uICovCisgICAgICAgIGNvbnN0IGNoYXIgKmNvbG9yOworICAgICAgICBVSU5UIGNvbG9y dmFsOworICAgICAgICBpbnQgaSwgcG9zOworICAgICAgICBwb3MgPSAwOworICAgICAgICBjb2xv cnZhbCA9IDA7CisgICAgICAgIGNvbG9yID0gY29sb3JuYW1lICsgNTsKKyAgICAgICAgZm9yIChp ID0gMDsgaSA8IDM7IGkrKykKKyAgICAgICAgICB7CisgICAgICAgICAgICBjaGFyICplbmQ7Cisg ICAgICAgICAgICBkb3VibGUgdmFsdWU7CisgICAgICAgICAgICBVSU5UIHZhbDsKKyAgICAgICAg ICAgIHZhbHVlID0gc3RydG9kIChjb2xvciwgJmVuZCk7CisgICAgICAgICAgICBpZiAoZXJybm8g PT0gRVJBTkdFKQorICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGlmICh2YWx1ZSA8 IDAuMCB8fCB2YWx1ZSA+IDEuMCkKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB2 YWwgPSAoVUlOVCkoMHgxMDAgKiB2YWx1ZSk7CisgICAgICAgICAgICAvKiBXZSB1c2VkIDB4MTAw IGluc3RlYWQgb2YgMHhGRiB0byBnaXZlIGEgY29udGludW91cworICAgICAgICAgICAgICAgcmFu Z2UgYmV0d2VlbiAwLjAgYW5kIDEuMCBpbmNsdXNpdmUuICBUaGUgbmV4dCBzdGF0ZW1lbnQKKyAg ICAgICAgICAgICAgIGZpeGVzIHRoZSAxLjAgY2FzZS4gKi8KKyAgICAgICAgICAgIGlmICh2YWwg PT0gMHgxMDApCisgICAgICAgICAgICAgIHZhbCA9IDB4RkY7CisgICAgICAgICAgICBjb2xvcnZh bCB8PSAodmFsIDw8IHBvcyk7CisgICAgICAgICAgICBwb3MgKz0gMHg4OworICAgICAgICAgICAg aWYgKGkgPT0gMikKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmICgqZW5kICE9 ICdcMCcpCisgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB1bmJsb2Nr X2lucHV0ICgpOworICAgICAgICAgICAgICAgIFhTRVRJTlQgKHJldCwgY29sb3J2YWwpOworICAg ICAgICAgICAgICAgIHJldHVybiByZXQ7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlm ICgqZW5kICE9ICcvJykKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjb2xvciA9 IGVuZCArIDE7CisgICAgICAgICAgfQorICAgICAgfQorICAvKiBJIGFtIG5vdCBnb2luZyB0byBh dHRlbXB0IHRvIGhhbmRsZSBhbnkgb2YgdGhlIENJRSBjb2xvciBzY2hlbWVzCisgICAgIG9yIFRl a0hWQywgc2luY2UgSSBkb24ndCBrb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m9uZV93MzJfZGlzcGxheV9pbmZvLmNvbG9y X2xpc3Q7CisgICAgICAgICAgLyogY2hlY2sgaWYgY29sb3IgaXMgYWxyZWFkeSBtYXBwZWQgKi8K KyAgICAgICAgICB3aGlsZSAoZW50cnkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlm IChNQ19XMzJfQ09MT1IgKGVudHJ5LT5lbnRyeSkgPT0gWFVGSVhOVU1fUkFXICh0ZW0pKQorICAg ICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBwcmV2ID0gJmVudHJ5LT5uZXh0Owor ICAgICAgICAgICAgICBlbnRyeSA9IGVudHJ5LT5uZXh0OworICAgICAgICAgICAgfQorICAgICAg ICAgIGlmIChlbnRyeSA9PSBOVUxMICYmIGFsbG9jX3ApCisgICAgICAgICAgICB7CisgICAgICAg ICAgICAgIC8qIG5vdCBhbHJlYWR5IG1hcHBlZCwgc28gYWRkIHRvIGxpc3QgKi8KKyAgICAgICAg ICAgICAgZW50cnkgPSB4bWFsbG9jIChzaXplb2YgKHN0cnVjdCB3MzJfcGFsZXR0ZV9lbnRyeSkp OworICAgICAgICAgICAgICBNQ19XMzJfU0VUX0NPTE9SIChlbnRyeS0+ZW50cnksIFhVRklYTlVN X1JBVyAodGVtKSk7CisgICAgICAgICAgICAgIGVudHJ5LT5uZXh0ID0gTlVMTDsKKyAgICAgICAg ICAgICAgKnByZXYgPSBlbnRyeTsKKyAgICAgICAgICAgICAgb25lX3czMl9kaXNwbGF5X2luZm8u bnVtX2NvbG9ycysrOworICAgICAgICAgICAgICAvKiBzZXQgZmxhZyB0aGF0IHBhbGV0dGUgbXVz dCBiZSByZWdlbmVyYXRlZCAqLworICAgICAgICAgICAgICBvbmVfdzMyX2Rpc3BsYXlfaW5mby5y ZWdlbl9wYWxldHRlID0gVFJVRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgLyog RW5zdXJlIENPTE9SUkVGIHZhbHVlIGlzIHNuYXBwZWQg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zmc2V0IChzLT53LCBURVhUX0FSRUEpOworICAgICAg ICAgIGlmICh4IDwgbGVmdF94KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBiYWNrZ3Jv dW5kX3dpZHRoIC09IGxlZnRfeCAtIHg7CisgICAgICAgICAgICAgIHggPSBsZWZ0X3g7CisgICAg ICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAg ICAvKiBJbiBSMkwgcm93cywgZHJhdyB0aGUgY3Vyc29yIG9uIHRoZSByaWdodCBlZGdlIG9mIHRo ZQorICAgICAgICAgICAgICBzdHJldGNoIGdseXBoLiAqLworICAgICAgICAgICBpbnQgcmlnaHRf eCA9IHdpbmRvd19ib3hfcmlnaHQgKHMtPncsIFRFWFRfQVJFQSk7CisgICAgICAgICAgIGlmICh4 ICsgYmFja2dyb3VuZF93aWR0aCA+IHJpZ2h0X3gpCisgICAgICAgICAgICAgYmFja2dyb3VuZF93 aWR0aCAtPSB4IC0gcmlnaHRfeDsKKyAgICAgICAgICAgeCArPSBiYWNrZ3JvdW5kX3dpZHRoOwor ICAgICAgICAgfQorICAgICAgd2lkdGggPSBtaW4gKEZSQU1FX0NPTFVNTl9XSURUSCAocy0+Ziks IGJhY2tncm91bmRfd2lkdGgpOworICAgICAgaWYgKHMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAgICAg ICAgeCAtPSB3aWR0aDsKKyAgICAgIC8qIERyYXcgY3Vyc29yLiAqLworICAgICAgdzMyX2RyYXdf Z2x5cGhfc3RyaW5nX2JnX3JlY3QgKHMsIHgsIHMtPnksIHdpZHRoLCBzLT5oZWlnaHQpOworICAg ICAgLyogQ2xlYXIgcmVzdCB1c2luZyB0aGUgR0Mgb2YgdGhlIG9yaWdpbmFsIG5vbi1jdXJzb3Ig ZmFjZS4gKi8KKyAgICAgIGlmICh3aWR0aCA8IGJhY2tncm91bmRfd2lkdGgpCisgICAgICAgIHsK KyAgICAgICAgICBFbWFjc19HQyAqZ2MgPSBzLT5mYWNlLT5nYzsKKyAgICAgICAgICBpbnQgeSA9 IHMtPnk7CisgICAgICAgICAgaW50IHcgPSBiYWNrZ3JvdW5kX3dpZHRoIC0gd2lkdGgsIGggPSBz LT5oZWlnaHQ7CisgICAgICAgICAgUkVDVCByOworICAgICAgICAgIEhEQyBoZGMgPSBzLT5oZGM7 CisgICAgICAgICAgaWYgKCFzLT5yb3ctPnJldmVyc2VkX3ApCisgICAgICAgICAgICB4ICs9IHdp ZHRoOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICB4ID0gcy0+eDsKKyAgICAgICAg ICBpZiAocy0+cm93LT5tb3VzZV9mYWNlX3AKKyAgICAgICAgICAgICAgJiYgY3Vyc29yX2luX21v dXNlX2ZhY2VfcCAocy0+dykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHczMl9zZXRf bW91c2VfZmFjZV9nYyAocyk7CisgICAgICAgICAgICAgIGdjID0gcy0+Z2M7CisgICAgICAgICAg ICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGdjID0gcy0+ZmFjZS0+Z2M7Cisg ICAgICAgICAgZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsICZyKTsKKyAgICAgICAgICB3 MzJfc2V0X2NsaXBfcmVjdGFuZ2xlIChoZGMsICZyKTsKKyNpZiAwIC8qIFRPRE86IHN0aXBwbGUg Ki8KKyAgICAgICAgICBpZiAocy0+ZmFjZS0+c3RpcHBsZSkKKyAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgLyogRmlsbCBiYWNrZ3JvdW5kIHdpdGggYSBzdGlwcGxlIHBhdHRlcm4uICovCisg ICAgICAgICAgICAgIFhTZXRGaWxsU3R5bGUgKHMtPmRpc3BsYXksIGdjLCBGaWxsT3BhcXVlU3Rp cHBsZWQpOworICAgICAgICAgICAgICBYRmlsbFJlY3RhbmdsZSAocy0+ZGlzcGxheSwgcy0+d2lu ZG93LCBnYywgeCwgeSwgdywgaCk7CisgICAgICAgICAgICAgIFhTZXRGaWxsU3R5bGUgKHMtPmRp c3BsYXksIGdjLCBGaWxsU29saWQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQor I2VuZGlmCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChz LT5mLCBzLT5oZGMsIGdjLT5iYWNrZ3JvdW5kLCB4LCB5LCB3LCBoKTsKKyAgICAgICAgICAgICAg fQorICAgICAgICB9CisgICAgfQorICAgIGVsc2UgaWYgKCFzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9w KQorICAgICAgeworICAgICAgICBpbnQgYmFja2dyb3VuZF93aWR0aCA9IHMtPmJhY2tncm91bmRf d2lkdGg7CisgICAgICAgIGludCB4ID0gcy0+eCwgbGVmdF94ID0gd2luZG93X2JveF9sZWZ0X29m ZnNldCAocy0+dywgVEVYVF9BUkVBKTsKKyAgICAgICAgLyogRG9uJ3QgZHJhdyBpbnRvIGxlZnQg bWFyZ2luLCBmcmluZ2Ugb3Igc2Nyb2xsYmFyIGFyZWEKKyAgICAgICAgICAgZXhjZXB0IGZvciBo ZWFkZXIgbGluZSBhbmQgbW9kZSBsaW5lLiAqLworICAgICAgICBpZiAoeCA8IGxlZnRfeCAmJiAh cy0+cm93LT5tb2RlX2xpbmVfcCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBiYWNrZ3JvdW5k X3dpZHRoIC09IGxlZnRfeCAtIHg7CisgICAgICAgICAgICB4ID0gbGVmdF94OworICAgICAgICAg IH0KKyAgICAgICAgaWYgKGJhY2tncm91bmRfd2lkdGggPiAwKQorICAgICAgICAgIHczMl9kcmF3 X2dseXBoX3N0cmluZ19iZ19yZWN0IChzLCB4LCBzLT55LCBiYWNrZ3JvdW5kX3dpZHRoLCBzLT5o ZWlnaHQpOworICAgICAgfQorICBzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wID0gdHJ1ZTsKK30KKwor LyogU2V0IFMtPm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Y2UpOworICBpZiAocy0+aGwgPT0gRFJBV19OT1JNQUxfVEVYVCkKKyAgICB7 CisgICAgICBzLT5nYyA9IHMtPmZhY2UtPmdjOworICAgICAgcy0+c3RpcHBsZWRfcCA9IHMtPmZh Y2UtPnN0aXBwbGUgIT0gMDsKKyAgICB9CisgICAgZWxzZSBpZiAocy0+aGwgPT0gRFJBV19JTlZF UlNFX1ZJREVPKQorICAgICAgeworICAgICAgICB3MzJfc2V0X21vZGVfbGluZV9mYWNlX2djIChz KTsKKyAgICAgICAgcy0+c3RpcHBsZWRfcCA9IHMtPmZhY2UtPnN0aXBwbGUgIT0gMDsKKyAgICAg IH0KKyAgICAgIGVsc2UgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SKQorICAgICAgICB7CisgICAg ICAgICAgbWNfdzMyX3NldF9jdXJzb3JfZ2MgKHMsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICBz LT5zdGlwcGxlZF9wID0gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAocy0+aGwg PT0gRFJBV19NT1VTRV9GQUNFKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIHczMl9zZXRfbW91 c2VfZmFjZV9nYyAocyk7CisgICAgICAgICAgICBzLT5zdGlwcGxlZF9wID0gcy0+ZmFjZS0+c3Rp cHBsZSAhPSAwOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmIChzLT5obCA9PSBEUkFX X0lNQUdFX1JBSVNFRAorICAgICAgICAgICAgICAgICAgIHx8IHMtPmhsID09IERSQVdfSU1BR0Vf U1VOS0VOKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzLT5nYyA9IHMtPmZhY2UtPmdj OworICAgICAgICAgICAgICBzLT5zdGlwcGxlZF9wID0gcy0+ZmFjZS0+c3RpcHBsZSAhPSAwOwor ICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBlbWFjc19hYm9y dCAoKTsKKyAgLyogR0MgbXVzdCBoYXZlIGJlZW4gc2V0LiAqLworICBlYXNzZXJ0IChzLT5nYyAh PSAwKTsKK30KKworLyogRHJhdyBhIGhvbGxvdyBib3ggY3Vyc29yIG9uIHdpbmRvdyBXIGluIGds eXBoIHJvdyBST1cuICovCitzdGF0aWMgdm9pZAorbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAo c3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93LCBpbnQgeCwgaW50IGZ4LCBp bnQgeSwgaW50IGZ5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGhwb3MsIGludCB2 cG9zLCBpbnQgd2QsIGludCBoKQoreworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRP V19GUkFNRSAodykpOworICBIREMgaGRjOworICBSRUNUIHJlY3Q7CisgIEhCUlVTSCBoYiA9IENy ZWF0ZVNvbGlkQnJ1c2ggKGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsKTsKKyAgLyog R2V0IHRoZSBnbHlwaCB0aGUgY3Vyc29yIGlzIG9uLiAgSWYgd2UgY2FuJ3QgdGVsbCBiZWNhdXNl CisgICAgIHRoZSBjdXJyZW50IG1hdHJpeCBpcyBpbnZhbGlkIG9yIHN1Y2gsIGdpdmUgdXAuICov CisgIHN0cnVjdCBnbHlwaCAqY3Vyc29yX2dseXBoID0gbWNfZ2V0X2N1cnNvcl9nbHlwaCAodywg bWF0cml4LCByb3csIGhwb3MsIHZwb3MpOworICBpZiAoY3Vyc29yX2dseXBoID09IE5VTEwpCisg ICAgeworICAgICAgRGVsZXRlT2JqZWN0IChoYik7CisgICAgICByZXR1cm47CisgICAgfQorICBp bnQgcmwgPSBmeDsKKyAgaW50IHJ0ID0gZnk7CisgIGludCByciA9IHJsICsgd2Q7CisgIGludCBy YiA9IHJ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gICAgICAgaGRjID0gZ2V0X2ZyYW1lX2RjIChmKTsKKyAgICAgICAgdzMyX2NsaXBfdG9fcm93 ICh3LCByb3csIFRFWFRfQVJFQSwgaGRjKTsKKyAgICAgICAgaW50IHJ4ID0gZng7CisgICAgICAg IGludCByeSA9IGZ5OworICAgICAgICBpbnQgcncgPSB3ZDsKKyAgICAgICAgaW50IHJoID0gaDsK KyAgICAgICAgLy8gIGZwcmludGYgKHN0ZGVyciwgIk1DX0hCQVI6ICBmeCAoJWQpIHwgZnkgKCVk KSB8IHdkICglZCkgfCBoICglZClcbiIsCisgICAgICAgIC8vICAgICAgICAgICAgICAgICAgIHJ4 LCByeSwgcncsIHJoKTsKKyAgICAgICAgdzMyX2ZpbGxfYXJlYSAoZiwgaGRjLCBjdXJzb3JfY29s b3IsIHJ4LCByeSwgcncsIHJoKTsKKyAgICAgICAgdzMyX3NldF9jbGlwX3JlY3RhbmdsZSAoaGRj LCBOVUxMKTsKKyAgICAgICAgcmVsZWFzZV9mcmFtZV9kYyAoZiwgaGRjKTsKKyAgICAgIH0KK30K KworLyogUklGOiBEcmF3IG9yIGNsZWFyIGN1cnNvciBvbiB3aW5kb3cgVy4gKi8KK3N0YXRpYyB2 b2lkCittY193MzJfZHJhd193aW5kb3dfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3Qg Z2x5cGhfbWF0cml4ICptYXRyaXgsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKKyAgICAgICAgICAg ICAgICAgIGludCB4LCBpbnQgZngsIGludCB5LCBpbnQgZnksIGludCBocG9zLCBpbnQgdnBvcywg aW50IHdkLCBpbnQgaCwKKyAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsLCBlbnVt IG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgaW50IGN1cnNv cl93aWR0aCwgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yLCBib29sIG9uX3AsIGJvb2wgYWN0 aXZlX3ApCit7CisgIGlmIChvbl9wKQorICAgIHsKKyAgICAgIC8qIElmIHRoaXMgaXMgdGhlIGFj dGl2ZSBjdXJzb3IsIHdlIG5lZWQgdG8gdHJhY2sgaXQgd2l0aCB0aGUKKyAgICAgIHN5c3RlbSBj YXJldCwgc28gdGhpcmQgcGFydHkgc29mdHdhcmUgbGlrZSBzY3JlZW4gbWFnbmlmaWVycworICAg ICAgYW5kIHNwZWVjaCBzeW50aGVzaXplcnMgY2FuIGZvbGxvdyB0aGUgY3Vyc29yLiAqLworICAg ICAgaWYgKGFjdGl2ZV9wKQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGZyYW1lICpmID0g WEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAgICAgICAgICBIV05EIGh3bmQgPSBGUkFNRV9X MzJfV0lORE9XIChmKTsKKyAgICAgICAgICB3MzJfc3lzdGVtX2NhcmV0X3gKKyAgICAgICAgICAg ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgeCk7CisgICAgICAgICAgLyogRklY TUU6ICBXaGF0IHNob3VsZCB3ZSB1c2UgaW5zdGVhZCBvZiBgdy0+cGh5c19jdXJzb3JfYXNjZW50 Jz8gKi8KKyAgICAgICAgICB3MzJfc3lzdGVtX2NhcmV0X3kKKyAgICAgICAgICAgID0gKFdJTkRP V19UT19GUkFNRV9QSVhFTF9ZICh3LCB5KQorICAgICAgICAgICAgICAgKyByb3ctPmFzY2VudCAt IHctPnBoeXNfY3Vyc29yX2FzY2VudCk7CisgICAgICAgICAgdzMyX3N5c3RlbV9jYXJldF93aW5k b3cgPSB3OworICAgICAgICAgIHczMl9zeXN0ZW1fY2FyZXRfaGRyX2hlaWdodCA9IFdJTkRPV19I RUFERVJfTElORV9IRUlHSFQgKHcpOworICAgICAgICAgIHczMl9zeXN0ZW1fY2FyZXRfbW9kZV9o ZWlnaHQgPSBXSU5ET1dfTU9ERV9MSU5FX0hFSUdIVCAodyk7CisgICAgICAgICAgUG9zdE1lc3Nh Z2UgKGh3bmQsIFdNX0lNRV9TVEFSVENPTVBPU0lUSU9OLCAwLCAwKTsKKyAgICAgICAgICAvKiBJ ZiB0aGUgc2l6ZSBvZiB0aGUgYWN0aXZlIGN1cnNvciBjaGFuZ2VkLCBkZXN0cm95IHRoZSBvbGQK KyAgICAgICAgICAgICBzeXN0ZW0gY2FyZXQuICovCisgICAgICAgICAgaWYgKHczMl9zeXN0ZW1f Y2FyZXRfaHduZAorICAgICAgICAgICAgICAmJiAodzMyX3N5c3RlbV9jYXJldF9oZWlnaHQgIT0g aCkpCisgICAgICAgICAgICBQb3N0TWVzc2FnZSAoaHduZCwgV01fRU1BQ1NfREVTVFJPWV9DQVJF VCwgMCwgMCk7CisgICAgICAgICAgdzMyX3N5c3RlbV9jYXJldF9oZWlnaHQgPSBoOworICAgICAg ICAgIC8qIE1vdmUgdGhlIHN5c3RlbSBjYXJldC4gKi8KKyAgICAgICAgICBQb3N0TWVzc2FnZSAo aHduZCwgV01fRU1BQ1NfVFJBQ0tfQ0FSRVQsIDAsIDApOworICAgICAgICB9CisgICAgICAvKiBU aGUgZnJpbmdlIGJpdG1hcHMgYXJlIHByZXNlbnRseSBoYW5kbGVkIGVsc2V3aGVyZSwgYnV0IGNv dWxkIHNvbWVkYXkKKyAgICAgIGJlIG1hbmFnZWQgKGluIHBhcnQpIGF0IHRoaXMgc2VjdGlvbiBv ZiBjb2RlLiAqLworICAgICAgaWYgKHJvdy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVfcAorICAg ICAgICAgICYmIChyb3ctPnJldmVyc2VkX3AKKyAgICAgICAgICAgICA/IChocG9zIDwgMCkKKyAg ICAgICAgICAgICA6IChocG9zID49IHJvdy0+dXNlZFtURVhUX0FSRUFdKSkpCisgICAgICAgIHsK KyAgICAgICAgICByb3ctPmN1cnNvcl9pbl9mcmluZ2VfcCA9IHRydWU7CisgICAgICAgICAgbWNf ZHJhd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IChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAg ICAgICAgICAgICYmIGFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5 cGgtPmNoYXJwb3MgPT0gcmVnaW9uX2VuZCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZV9pZCA9IGxvb2t1 cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItYXQtcmVnaW9u LXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xs b3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2FjdGl2 ZV9yZWdpb25fZW5kX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xs b3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1y ZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgIHN0 cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19h Y3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBo b2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgZ2NfdmFsdWVz LmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZS0+YmFja2dyb3VuZDsK KyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AK KyAgICAg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l9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIG1h dHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAgICAgICAgICBm LT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsK KyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChjdXJzb3JfZ2x5cGgtPnR5cGUgPT0gSU1BR0Vf R0xZUEggJiYgbHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDAp CisgICAgICAgICAgeworICAgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRw dXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcuICovCisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0 YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAgICAgbWNfdzMyX2Ry YXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBv cywgd2QsIGgpOworICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwg PSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRw dXRfZGF0YS53MzItPmN1cnNvcl9nYycgYnkgYm9ycm93aW5nIHRoZQorICAgICAgICAgICAgICBm dW5jdGlvbmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHczMmZucy5jLiAqLworICAgICAgICAgICAg ICBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcAorICAg ICAgICAgICAgICAgICAgJiYgY3Vyc29yX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Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICAgICAgICBlbHNlIGlmIChhY3RpdmVfcCkKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0g bG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1wcmUt enYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpo b2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9p ZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBnY192YWx1ZXMuZm9yZWdyb3VuZCA9IGhvbGxv d19hY3RpdmVfZmFjZS0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGdjX3Zh bHVlcy5iYWNrZ3JvdW5kID0gaG9sbG93X2FjdGl2ZV9mYWNlLT5iYWNrZ3JvdW5kOworICAgICAg ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICghYWN0aXZl X3ApCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAg IGVudW0gZmFjZV9pZCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNl ICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItaW5hY3RpdmUtcHJlLXp2LWZhY2Ui KSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3df aW5hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQp OworICAgICAgICAgICAgICAgICAgICAgICAgICBnY192YWx1ZXMuZm9yZWdyb3VuZCA9IGhvbGxv d19pbmFjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICAgICAgICAgICAgICBn Y192YWx1ZXMuYmFja2dyb3VuZCA9IGhvbGxvd19pbmFjdGl2ZV9mYWNlLT5iYWNrZ3JvdW5kOwor ICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53 MzItPmN1cnNvcl9nYyA9IFhDcmVhdGVHQyAoTlVMTCwgRlJBTUVfVzMyX1dJTkRPVyAoZiksIG1h c2ssICZnY192YWx1ZXMpOworICAgICAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAg ICAgICAgLyogRm9yY2UgYG1jX3czMl9zZXRfY3Vyc29yX2djJyB0byB1c2UgYHMtPmYtPm91dHB1 dF9kYXRhLnczMi0+Y3Vyc29yX2djJy4gKi8KKyAgICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2Nf cCA9IHRydWU7CisgICAgICAgICAgICAgIG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgs IHJvdywgRFJBV19DVVJTT1IsIHgsIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBsc2wsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVf cCwgY3Vyc29yX2djX3ApOworICAgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNv cl9nYyA9IG9yaWdpbmFsX2N1cnNvcl9nYzsKKyAgICAgICAgICAgICAgdW5ibG9ja19pbnB1dCAo KTsKKyAgICAgICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCBy b3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgICAgfQorICAg ICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfSE9MTE9XX0JPWDoKKyAgICB7CisgICAgICBp ZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAg ICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLncz Mi0+Y3Vyc29yX3BpeGVsJy4gKi8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNv cl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAgIG1jX3czMl9kcmF3X2hvbGxvd19jdXJz b3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAg ICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNv cl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgbWNfdzMyX2RyYXdf aG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywg d2QsIGgpOworICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAg ICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVl ID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91 dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djJyBieSBib3Jyb3dpbmcgdGhlCisgICAgICAgICAgZnVu Y3Rpb25hbGl0eSBvZiBgeF9tYWtlX2djJyBpbiB3MzJmbnMuYy4gKi8KKyAgICAgICAgICBibG9j a19pbnB1dCAoKTsKKyAgICAgICAgICBFbWFjc19HQyBnY192YWx1ZXM7CisgICAgICAgICAgdW5z aWduZWQgbG9uZyBtYXNrID0gR0NGb3JlZ3JvdW5kIHwgR0NCYWNrZ3JvdW5kOworICAgICAgICAg IGdjX3ZhbHVlcy5mb3JlZ3JvdW5kID0gRlJBTUVfQkFDS0dST1VORF9QSVhFTCAoZik7CisgICAg ICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBjb2xvcl9waXhlbDsKKyAgICAgICAgICBmLT5v dXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYyA9IFhDcmVhdGVHQyAoTlVMTCwgRlJBTUVfVzMyX1dJ TkRPVyAoZiksIG1hc2ssICZnY192YWx1ZXMpOworICAgICAgICAgIC8qIEZvcmNlIGBtY193MzJf c2V0X2N1cnNvcl9nYycgdG8gdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycu ICovCisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IHRydWU7CisgICAgICAgICAgbWNfZHJh d19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBv cywgbHNsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaF9mbGF2b3IsIGN1 cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICBmLT5vdXRw dXRfZGF0YS53MzItPmN1cnNvcl9nYyA9IG9yaWdpbmFsX2N1cnNvcl9nYzsKKyAgICAgICAgICB1 bmJsb2NrX2lucHV0ICgpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7Cisg ICAgICAgICAgICBib29sIGN1cnNvcl9nY19wID0gZmFsc2U7CisgICAgICAgICAgICBtY19kcmF3 X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4LCBocG9zLCB2cG9z LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxzbCwgZ2x5cGhfZmxhdm9yLCBj dXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAg Y2FzZSBNQ19CQVI6CisgICAgeworICAgICAgaWYgKGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3JlZW4g Pj0gMCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJp bHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcuICovCisgICAgICAg ICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBjb2xvcl9waXhlbDsKKyAgICAg ICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gdHJ1ZTsKKyAgICAgICAgICBt Y193MzJfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9z LCB2cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jf d2lkdGgsIE1DX0JBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIGYt Pm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOwor ICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBib29sIGN1 cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7CisgICAgICAgICAgICBtY193MzJfZHJh d19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3 ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl93aWR0aCwg TUNfQkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgfQorICAgICAg YnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfSEJBUjoKKyAgICB7CisgICAgICBpZiAobHNsLnJl ZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAg ICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29y X3BpeGVsJy4gKi8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9 IGNvbG9yX3BpeGVsOworICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3Ag PSB0cnVlOworICAgICAgICAgIG1jX3czMl9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93 LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGgsIGN1cnNvcl93aWR0aCwgTUNfSEJBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9v a2F5X3ApOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3Jp Z2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7 CisgICAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7Cisg ICAgICAgICAgICBtY193MzJfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngs IHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGgsIGN1cnNvcl93aWR0aCwgTUNfSEJBUiwgY3Vyc29yX2djX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GVkX3AgPSB0cnVlOworICAgICAg ZWxzZQorICAgICAgICB3MzJfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgZmFsc2Up OworICAgICAgdzMyX2RyYXdfZ2x5cGhsZXNzX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsK KyAgICAgIGJyZWFrOworICAgIGRlZmF1bHQ6CisgICAgICBlbWFjc19hYm9ydCAoKTsKKyAgICB9 CisgIGlmICghcy0+Zm9yX292ZXJsYXBzKQorICAgIHsKKyAgICAgIC8qIERyYXcgdW5kZXJsaW5l LiAqLworICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9wKQorICAgICAgICB7CisgICAgICAg ICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfV0FWRSkKKyAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgQ09MT1JSRUYgY29sb3I7CisgICAgICAgICAgICAgIGlm IChzLT5mYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICAgICAgY29sb3Ig PSBzLT5nYy0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAg ICAgICBjb2xvciA9IHMtPmZhY2UtPnVuZGVybGluZV9jb2xvcjsKKyAgICAgICAgICAgICAgdzMy X2RyYXdfdW5kZXJ3YXZlIChzLCBjb2xvcik7CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxz ZSBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIHRoaWNrbmVzcywgcG9zaXRpb247 CisgICAgICAgICAgICAgIGludCB5OworICAgICAgICAgICAgICBpZiAocy0+cHJldiAmJiBzLT5w cmV2LT5mYWNlLT51bmRlcmxpbmVfcAorICAgICAgICAgICAgICAgICAgJiYgcy0+cHJldi0+ZmFj ZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgIC8qIFdlIHVzZSB0aGUgc2FtZSB1bmRlcmxpbmUgc3R5bGUgYXMg dGhlIHByZXZpb3VzIG9uZS4gKi8KKyAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPnBy ZXYtPnVuZGVybGluZV90aGlja25lc3M7CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMt PnByZXYtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhl IHVuZGVybGluZSB0aGlja25lc3MuICBEZWZhdWx0IGlzIDEgcGl4ZWwuICovCisgICAgICAgICAg ICAgICAgICBpZiAocy0+Zm9udCAmJiBzLT5mb250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4gMCkK KyAgICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNr bmVzczsKKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgIHRo aWNrbmVzcyA9IDE7CisgICAgICAgICAgICAgICAgICBpZiAoeF91bmRlcmxpbmVfYXRfZGVzY2Vu dF9saW5lKQorICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5oZWlnaHQgLSB0aGlj a25lc3MpIC0gKHMtPnliYXNlIC0gcy0+eSk7CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhl IHVuZGVybGluZSBwb3NpdGlvbi4gIFRoaXMgaXMgdGhlIHJlY29tbWVuZGVkCisgICAgICAgICAg ICAgICAgICAgICAgICAgICB2ZXJ0aWNhbCBvZmZzZXQgaW4gcGl4ZWxzIGZyb20gdGhlIGJhc2Vs aW5lIHRvIHRoZSB0b3Agb2YKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSB1bmRlcmxp bmUuICBUaGlzIGlzIGEgc2lnbmVkIHZhbHVlIGFjY29yZGluZyB0byB0aGUKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgIHNwZWNzLCBhbmQgaXRzIGRlZmF1bHQgaXMKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgIFJPVU5EICgobWF4aW11bV9kZXNjZW50KSAvIDIpLCB3aXRoCisgICAgICAg ICAgICAgICAgICAgICAgICAgICBST1VORCAoeCkgPSBmbG9vciAoeCArIDAuNSkgICovCisgICAg ICAgICAgICAgICAgICAgICAgICBpZiAoeF91c2VfdW5kZXJsaW5lX3Bvc2l0aW9uX3Byb3BlcnRp ZXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBzLT5mb250ICYmIHMtPmZvbnQtPnVu ZGVybGluZV9wb3NpdGlvbiA+PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlv biA9IHMtPmZvbnQtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgICAgICAgICAg IGVsc2UgaWYgKHMtPmZvbnQpCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0g KHMtPmZvbnQtPmRlc2NlbnQgKyAxKSAvIDI7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAg ICAgICAgICAgICAgICAgcG9zaXRpb24gPSBtYXggKHBvc2l0aW9uLCB1bmRlcmxpbmVfbWluaW11 bV9vZmZzZXQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgLyogQ2hlY2sgdGhl IHNhbml0eSBvZiB0aGlja25lc3MgYW5kIHBvc2l0aW9uLiAgV2Ugc2hvdWxkCisgICAgICAgICAg ICAgICAgIGF2b2lkIGRyYXdpbmcgdW5kZXJsaW5lIG91dCBvZiB0aGUgY3VycmVudCBsaW5lIGFy ZWEuICovCisgICAgICAgICAgICAgIGlmIChzLT55ICsgcy0+aGVpZ2h0IDw9IHMtPnliYXNlICsg cG9zaXRpb24pCisgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+aGVpZ2h0IC0gMSkgLSAo cy0+eWJhc2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQgPCBz LT55YmFzZSArIHBvc2l0aW9uICsgdGhpY2tuZXNzKQorICAgICAgICAgICAgICAgIHRoaWNrbmVz cyA9IChzLT55ICsgcy0+aGVpZ2h0KSAtIChzLT55YmFzZSArIHBvc2l0aW9uKTsKKyAgICAgICAg ICAgICAgcy0+dW5kZXJsaW5lX3RoaWNrbmVzcyA9IHRoaWNrbmVzczsKKyAgICAgICAgICAgICAg cy0+dW5kZXJsaW5lX3Bvc2l0aW9uID1wb3NpdGlvbjsKKyAgICAgICAgICAgICAgeSA9IHMtPnli YXNlICsgcG9zaXRpb247CisgICAgICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfZGVm YXVsdGVkX3ApCisgICAgICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBz LT5nYy0+Zm9yZWdyb3VuZCwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5 LCBzLT53aWR0aCwgMSk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAg dzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5mYWNlLT51bmRlcmxpbmVfY29sb3IsIHMt PngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5LCBzLT53aWR0aCwgMSk7Cisg ICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIC8qIERyYXcgb3ZlcmxpbmUuICovCisgICAg ICBpZiAocy0+ZmFjZS0+b3ZlcmxpbmVfcCkKKyAgICAgICAgeworICAgICAgICAgIHVuc2lnbmVk IGxvbmcgZHkgPSAwLCBoID0gMTsKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+b3ZlcmxpbmVfY29s b3JfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMs IHMtPmdjLT5mb3JlZ3JvdW5kLCBzLT54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+ eSArIGR5LCBzLT53aWR0aCwgaCk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHcz Ml9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+ZmFjZS0+b3ZlcmxpbmVfY29sb3IsIHMtPngs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPnkgKyBkeSwgcy0+d2lkdGgsIGgpOwor ICAgICAgICB9CisgICAgICAvKiBEcmF3IHN0cmlrZS10aHJvdWdoLiAqLworICAgICAgaWYgKHMt PmZhY2UtPnN0cmlrZV90aHJvdWdoX3AKKyAgICAgICAgICAmJiAhRk9OVF9URVhUTUVUUklDIChz LT5mb250KS50bVN0cnVja091dCkKKyAgICAgICAgeworICAgICAgICAgIHVuc2lnbmVkIGxvbmcg aCA9IDE7CisgICAgICAgICAgdW5zaWduZWQgbG9uZyBkeSA9IChzLT5oZWlnaHQgLSBoKSAvIDI7 CisgICAgICAgICAgaWYgKHMtPmZhY2UtPnN0cmlrZV90aHJvdWdoX2NvbG9yX2RlZmF1bHRlZF9w KQorICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5nYy0+Zm9yZWdy b3VuZCwgcy0+eCwgcy0+eSArIGR5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+d2lk dGgsIGgpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChz LT5mLCBzLT5oZGMsIHMtPmZhY2UtPnN0cmlrZV90aHJvdWdoX2NvbG9yLCBzLT54LAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBzLT55ICsgZHksIHMtPndpZHRoLCBoKTsKKyAgICAgICAg fQorICAgICAgLyogRHJhdyByZWxpZWYgaWYgbm90IHlldCBkcmF3bi4gKi8KKyAgICAgIGlmICgh cmVsaWVmX2RyYXduX3AgJiYgcy0+ZmFjZS0+Ym94ICE9IEZBQ0VfTk9fQk9YKQorICAgICAgICB3 MzJfZHJhd19nbHlwaF9zdHJpbmdfYm94IChzKTsKKyAgICAgIGlmIChzLT5wcmV2KQorICAgICAg ICB7CisgICAgICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAqcHJldjsKKyAgICAgICAgICBmb3Ig KHByZXYgPSBzLT5wcmV2OyBwcmV2OyBwcmV2ID0gcHJldi0+cHJldikKKyAgICAgICAgICAgIGlm IChwcmV2LT5obCAhPSBzLT5obAorICAgICAgICAgICAgICAgICYmIHByZXYtPnggKyBwcmV2LT53 aWR0aCArIHByZXYtPnJpZ2h0X292ZXJoYW5nID4gcy0+eCkKKyAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgIC8qIEFzIHByZXYgd2FzIGRyYXduIHdoaWxlIGNsaXBwZWQgdG8gaXRzIG93 biBhcmVhLCB3ZQorICAgICAgICAgICAgICAgICAgIG11c3QgZHJhdyB0aGUgcmlnaHRfb3Zlcmhh bmcgcGFydCB1c2luZyBzLT5obCBub3cuICovCisgICAgICAgICAgICAgICAgZW51bSBkcmF3X2ds eXBoc19mYWNlIHNhdmUgPSBwcmV2LT5obDsKKyAgICAgICAgICAgICAgICBwcmV2LT5obCA9IHMt PmhsOworICAgICAgICAgICAgICAgIG1jX3czMl9zZXRfZ2x5cGhfc3RyaW5nX2djIChwcmV2LCBj dXJzb3JfZ2NfcCk7CisgICAgICAgICAgICAgICAgdzMyX3NldF9nbHlwaF9zdHJpbmdfY2xpcHBp bmdfZXhhY3RseSAocywgcHJldik7CisgICAgICAgICAgICAgICAgaWYgKHByZXYtPmZpcnN0X2ds eXBoLT50eXBlID09IENIQVJfR0xZUEgpCisgICAgICAgICAgICAgICAgICB3MzJfZHJhd19nbHlw aF9zdHJpbmdfZm9yZWdyb3VuZCAocHJldik7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAg ICAgICAgICAgICAgICAgIHczMl9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3Vu ZCAocHJldik7CisgICAgICAgICAgICAgICAgdzMyX3NldF9jbGlwX3JlY3RhbmdsZSAocHJldi0+ aGRjLCBOVUxMKTsKKyAgICAgICAgICAgICAgICBwcmV2LT5obCA9IHNhdmU7CisgICAgICAgICAg ICAgICAgcHJldi0+bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9Cisg ICAgICBpZiAocy0+bmV4dCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBnbHlwaF9zdHJp bmcgKm5leHQ7CisgICAgICAgICAgZm9yIChuZXh0ID0gcy0+bmV4dDsgbmV4dDsgbmV4dCA9IG5l eHQtPm5leHQpCisgICAgICAgICAgICBpZiAobmV4dC0+aGwgIT0gcy0+aGwKKyAgICAgICAgICAg ICAgICAmJiBuZXh0LT54IC0gbmV4dC0+bGVmdF9vdmVyaGFuZyA8IHMtPnggKyBzLT53aWR0aCkK KyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIEFzIG5leHQgd2lsbCBiZSBkcmF3 biB3aGlsZSBjbGlwcGVkIHRvIGl0cyBvd24gYXJlYSwKKyAgICAgICAgICAgICAgICAgICB3ZSBt dXN0IGRyYXcgdGhlIGxlZnRfb3ZlcmhhbmcgcGFydCB1c2luZyBzLT5obCBub3cuICovCisgICAg ICAgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIHNhdmUgPSBuZXh0LT5obDsKKyAgICAg ICAgICAgICAgICBuZXh0LT5obCA9IHMtPmhsOworICAgICAgICAgICAgICAgIG1jX3czMl9zZXRf Z2x5cGhfc3RyaW5nX2djIChuZXh0LCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgICAgICAgdzMy X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywgbmV4dCk7CisgICAgICAgICAg ICAgICAgaWYgKG5leHQtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgpCisgICAgICAg ICAgICAgICAgICB3MzJfZHJhd19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAobmV4dCk7CisgICAg ICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHczMl9kcmF3X2NvbXBvc2l0 ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAobmV4dCk7CisgICAgICAgICAgICAgICAgdzMyX3Nl dF9jbGlwX3JlY3RhbmdsZSAobmV4dC0+aGRjLCBOVUxMKTsKKyAgICAgICAgICAgICAgICBuZXh0 LT5obCA9IHNhdmU7CisgICAgICAgICAgICAgICAgbmV4dC0+bnVtX2NsaXBzID0gMDsKKyAgICAg ICAgICAgICAgICBuZXh0LT5jbGlwX2hlYWQgPSBzLT5uZXh0OworICAgICAgICAgICAgICB9Cisg ICAgICAgIH0KKyAgICB9CisgIC8qIFJlc2V0IGNsaXBwaW5nLiAqLworICB3MzJfc2V0X2NsaXBf cmVjdGFuZ2xlIChzLT5oZGMsIE5VTEwpOworICBzLT5udW1fY2xpcHMgPSAwOworfQorCisvKiBl bmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogLyog RnJpbmdlIGJpdG1hcHMuICAqLwogCiBzdGF0aWMgaW50IG1heF9mcmluZ2VfYm1wID0gMDsKQEAg LTU0Miw2ICsxNzAxLDE1IEBAIHczMl91cGRhdGVfYmVnaW4gKHN0cnVjdCBmcmFtZSAqZikKICAg aWYgKCEgRlJBTUVfVzMyX1AgKGYpKQogICAgIHJldHVybjsKIAorCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGluZ19mcmFt ZSA9IGY7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogUmVnZW5lcmF0ZSBk aXNwbGF5IHBhbGV0dGUgYmVmb3JlIGRyYXdpbmcgaWYgbGlzdCBvZiByZXF1ZXN0ZWQKICAgICAg Y29sb3JzIGhhcyBjaGFuZ2VkLiAqLwogICBpZiAoZGlzcGxheV9pbmZvLT5yZWdlbl9wYWxldHRl KQpAQCAtNjc0LDYgKzE4NDIsMTYgQEAgdzMyX3VwZGF0ZV9lbmQgKHN0cnVjdCBmcmFtZSAqZikK IAogICAvKiBNb3VzZSBoaWdobGlnaHQgbWF5IGJlIGRpc3BsYXllZCBhZ2Fpbi4gICovCiAgIE1P VVNFX0hMX0lORk8gKGYpLT5tb3VzZV9mYWNlX2RlZmVyID0gZmFsc2U7CisKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRp bmdfZnJhbWUgPSBOVUxMOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiB9CiAKIApA QCAtNDAwMiwxMyArNTE4MCw3NCBAQCB3MzJfc2V0X3ZlcnRpY2FsX3Njcm9sbF9iYXIgKHN0cnVj dCB3aW5kb3cgKncsCiAJIC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U2V0V2luZG93UG9z IChod25kLCBIV05EX0JPVFRPTSwgbGVmdCwgdG9wLCB3aWR0aCwgbWF4IChoZWlnaHQsIDEpLAot ICAgICAgICAgICAgICAgICAgICAgICAgU1dQX0ZSQU1FQ0hBTkdFRCk7CisgICAgICAgICAgaWYg KGxlZnQgPD0gYmFyLT5sZWZ0KQorICAgICAgICAgICAgbXlfc2hvd193aW5kb3cgKGYsIGh3bmQs IFNXX0hJREUpOworICAgICAgICAgIE1vdmVXaW5kb3cgKGh3bmQsIGxlZnQsIHRvcCwgd2lkdGgs IG1heCAoaGVpZ2h0LCAxKSwgbGVmdCA8PSBiYXItPmxlZnQpOworCisvKiBlbmQgTVVMVElQTEUt Q1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKIAogCSAgc2kuY2JTaXplID0g c2l6ZW9mIChzaSk7CiAJICBzaS5mTWFzayA9IFNJRl9SQU5HRTsKQEAgLTQyNzcsNiArNTUxNiwy MSBAQCB3MzJfanVkZ2Vfc2Nyb2xsX2JhcnMgKHN0cnVjdCBmcmFtZSAqZikKICAgICB7CiAgICAg ICBzdHJ1Y3Qgc2Nyb2xsX2JhciAqYiA9IFhTQ1JPTExfQkFSIChiYXIpOwogCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICAvKiBgRGVz dHJveVdpbmRvdycgd2l0aGluIGB4X3Njcm9sbF9iYXJfcmVtb3ZlJyByZXBhaW50cyB0aGUgcmVj dGFuZ2xlLgorICAgICAgVGhlcmVmb3JlLCB3ZSBmaXJzdCBzZW5kIGEgbWVzc2FnZSB0byBpbmhp Yml0IHJlcGFpbnRpbmcuICovCisgICAgICBpZiAoIVdJTkRPV19MSVZFX1AgKGItPndpbmRvdykp CisgICAgICAgIHsKKyAgICAgICAgICBIV05EIGh3bmQgPSBTQ1JPTExfQkFSX1czMl9XSU5ET1cg KGIpOworICAgICAgICAgIFNlbmRNZXNzYWdlIChod25kLCBXTV9TRVRSRURSQVcsIGZhbHNlLCAw KTsKKyAgICAgICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICB3MzJf c2Nyb2xsX2Jhcl9yZW1vdmUgKGIpOwogCiAgICAgICBuZXh0ID0gYi0+bmV4dDsKQEAgLTcwODgs NiArODM0MiwyMCBAQCBleHRlcm4gZnJhbWVfcGFybV9oYW5kbGVyIHczMl9mcmFtZV9wYXJtX2hh bmRsZXJzW107CiAKIHN0YXRpYyBzdHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFjZSB3MzJfcmVkaXNw bGF5X2ludGVyZmFjZSA9CiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgdzMydGVybS5j YCBtdXN0IGJlIGluIHRoZSBleGFjdCBzYW1lIG9yZGVyIGFzIHRoZQorYHJlZGlzcGxheV9pbnRl cmZhY2UnIGluIGBkaXNwZXh0ZXJuLmhgISAqLworCisgIG1jX3czMl9kcmF3X3dpbmRvd19jdXJz b3IsCisgIG1jX3czMl9kcmF3X2dseXBoX3N0cmluZywKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogICB3MzJfZnJhbWVfcGFybV9oYW5kbGVycywKICAgZ3VpX3Byb2R1Y2VfZ2x5cGhz LAogICBndWlfd3JpdGVfZ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vb2xfYmYgc2Ft ZV9wIDogMTsKKyAgICAgIHN0cnVjdCBnbHlwaCBnbHlwaDsKKyAgICAgIGludCB4OworICAgICAg aW50IGZ4OworICAgICAgaW50IHk7CisgICAgICBpbnQgZnk7CisgICAgICBpbnQgaHBvczsKKyAg ICAgIGludCB2cG9zOworICAgICAgaW50IHdkOworICAgICAgaW50IGg7CisgICAgICBlbnVtIG1j X2N1cnNvcl90eXBlCisgICAgICB7CisgICAgICAgIC8qIE5PVEU6ICBUaGUgZnJpbmdlIGJpdG1h cCBmcmFtZXdvcmsgcmVsaWVzIHVwb24gTUNfTk9fRlJJTkdFX0JJVE1BUAorICAgICAgICBoYXZp bmcgYSB2YWx1ZSBvZiB6ZXJvICgwKS4gKi8KKyAgICAgICAgTUNfTk9fRlJJTkdFX0JJVE1BUCwK KyAgICAgICAgTUNfTk9fQ1VSU09SLAorICAgICAgICBNQ19SSUdIVF9GUklOR0VfQklUTUFQLAor ICAgICAgICBNQ19MRUZUX0ZSSU5HRV9CSVRNQVAsCisgICAgICAgIE1DX0ZSQU1FRF9CT1gsCisg ICAgICAgIE1DX0ZJTExFRF9CT1gsCisgICAgICAgIE1DX0hPTExPV19CT1gsCisgICAgICAgIE1D X0JBUiwKKyAgICAgICAgTUNfSEJBUgorICAgICAgfSBjdXJzb3JfdHlwZTsKKyAgICAgIGludCBj dXJzb3Jfd2lkdGg7CisgICAgICBzdHJ1Y3QgbWNfUkdCCisgICAgICB7CisgICAgICAgIGRvdWJs ZSByZWQ7CisgICAgICAgIGRvdWJsZSBncmVlbjsKKyAgICAgICAgZG91YmxlIGJsdWU7CisgICAg ICB9IGZnLCBiZzsKKyAgICAgIGJvb2xfYmYgYWN0aXZlX3AgOiAxOworICAgICAgZW51bSBtY19m bGF2b3IKKyAgICAgIHsKKyAgICAgICAgTk9fRkxBVk9SLAorICAgICAgICBNQ19HTFlQSCwKKyAg ICAgICAgTUNfR0xZUEhMRVNTLAorICAgICAgICBNQ19PVkVSTEFZX0FSU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KKy8qIGVuZCBN VUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgLyog Q3Vyc29yIHR5cGUgb2YgbGFzdCBjdXJzb3IgZHJhd24gb24gdGhlIHdpbmRvdy4gICovCiAgICAg ZW51bSB0ZXh0X2N1cnNvcl9raW5kcyBwaHlzX2N1cnNvcl90eXBlOwogCmRpZmYgLS1naXQgYS9z cmMveGRpc3AuYyBiL3NyYy94ZGlzcC5jCmluZGV4IDUwZjY0NDMuLmNlZWJiYzYgMTAwNjQ0Ci0t LSBhL3NyYy94ZGlzcC5jCisrKyBiL3NyYy94ZGlzcC5jCkBAIC05NjIsNiArOTYyLDQ4ODEgQEAg c3RhdGljIHZvaWQgc2hvd19tb3VzZV9mYWNlIChNb3VzZV9ITEluZm8gKiwgZW51bSBkcmF3X2ds eXBoc19mYWNlKTsKIHN0YXRpYyBib29sIGNvb3Jkc19pbl9tb3VzZV9mYWNlX3AgKHN0cnVjdCB3 aW5kb3cgKiwgaW50LCBpbnQpOwogCiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogYmVn aW4gTVVMVElQTEUtQ1VSU09SUyAqLworCisvKiBNVUxUSVBMRS1DVVJTT1JTOiAgRW1hY3MgQnVn ICMyMjg3MyAoZmVhdHVyZSByZXF1ZXN0KQorCisgIENST1NTSEFJUlM6ICBFbWFjcyBCdWcgIzE3 Njg0IChmZWF0dXJlIHJlcXVlc3QpCisKKworVkVSU0lPTjogMDIyLjAwMiBbMDcvMzEvMjAxOV0K KworCitDSEFOR0VMT0c6CisKKy0gUmVwbGFjZWQgb3B0aW9uYWwgZGVidWdnaW5nIG1lc3NhZ2Vz IHRvIFNUREVSUiB3aXRoIHRoZSB2YXJpYWJsZSBgb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rZV9taW50X3B0cgorCityb3ctPmdseXBoc1tURVhUX0FSRUFdW2hwb3NdLnBpeGVs X3dpZHRoCisKK3ctPmN1cnJlbnRfbWF0cml4LT5yb3dzWzJdLT5nbHlwaHNbVEVYVF9BUkVBXVto cG9zXS5waXhlbF93aWR0aAorCit3LT5jdXJyZW50X21hdHJpeC0+cm93c1syXS5lbmFibGVkX3AK Kwordy0+Y3VycmVudF9tYXRyaXgtPnJvd3NbMl0udXNlZFtURVhUX0FSRUFdCisKK1JBTkdFRF9J TlRFR0VSUCA9PiBSQU5HRURfRklYTlVNUAorCitUWVBFX1JBTkdFRF9JTlRFR0VSUCA9PiBUWVBF X1JBTkdFRF9GSVhOVU1QCisKK21ha2VfbnVtYmVyID0+IG1ha2VfZml4bnVtCisKK1hJTlQgPT4g WEZJWE5VTQorCitYRkFTVElOVCA9PiBYRklYTkFUCisKK3N0cnVjdCBmcmFtZSAqZiA9IFhGUkFN RSAody0+ZnJhbWUpOworICBPUgorc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJB TUUgKHcpKTsKKworTGlzcF9PYmplY3Qgc3RyaW5nID0gRnByaW4xX3RvX3N0cmluZyAoaV9zdG9y ZSwgUW5pbCk7CitjaGFyICpjaGFyX3N0cmluZyA9IFNTREFUQSAoc3RyaW5nKTsKK2ZwcmludGYg KHN0ZGVyciwgImlfc3RvcmU6ICAlc1xuIiwgY2hhcl9zdHJpbmcpOworCitjaGFyICp3X2NvbnRl bnRzID0gKEJVRkZFUlAgKHctPmNvbnRlbnRzKSAmJiBTVFJJTkdQIChCVkFSIChYQlVGRkVSICh3 LT5jb250ZW50cyksIG5hbWUpKSkKKyAgICAgICAgICAgICAgICAgICA/IFNTREFUQSAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBuYW1lKSkKKyAgICAgICAgICAgICAgICAgICA6ICJuaWwi OworZnByaW50ZiAoc3RkZXJyLCAiXG5CdWZmZXIgKCVzKVxuIiwgd19jb250Z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spCisg ICAgcC0+Y29udGVudHNbaV0gPSBRbmlsOworICByZXR1cm4gbWFrZV9saXNwX3B0ciAocCwgTGlz cF9WZWN0b3JsaWtlKTsKK30KKworTGlzcF9PYmplY3QKK21jX2xpc3RuIChwdHJkaWZmX3QgY291 bnQsIExpc3BfT2JqZWN0IGFyZywgLi4uKQoreworICBlYXNzdW1lICgwIDwgY291bnQpOworICBM aXNwX09iamVjdCB2YWwgPSBGY29ucyAoYXJnLCBRbmlsKTsKKyAgTGlzcF9PYmplY3QgdGFpbCA9 IHZhbDsKKyAgdmFfbGlzdCBhcDsKKyAgdmFfc3RhcnQgKGFwLCBhcmcpOworICBmb3IgKHB0cmRp ZmZfdCBpID0gMTsgaSA8IGNvdW50OyBpKyspCisgICAgeworICAgICAgTGlzcF9PYmplY3QgZWxl bSA9IEZjb25zICh2YV9hcmcgKGFwLCBMaXNwX09iamVjdCksIFFuaWwpOworICAgICAgWFNFVENE UiAodGFpbCwgZWxlbSk7CisgICAgICB0YWlsID0gZWxlbTsKKyAgICB9CisgIHZhX2VuZCAoYXAp OworICByZXR1cm4gdmFsOworfQorCitMaXNwX09iamVjdAorbWNfbWVtcSAoTGlzcF9PYmplY3Qg ZWx0LCBMaXNwX09iamVjdCBsaXN0KQoreworICB3aGlsZSAoMSkKKyAgICB7CisgICAgICBpZiAo IUNPTlNQIChsaXN0KSB8fCBFUSAoWENBUiAobGlzdCksIGVsdCkpCisgICAgICAgIGJyZWFrOwor ICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkgfHwgRVEg KFhDQVIgKGxpc3QpLCBlbHQpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChs aXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpIHx8IEVRIChYQ0FSIChsaXN0KSwgZWx0KSkK KyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgfQorICByZXR1 cm4gbGlzdDsKK30KKworTGlzcF9PYmplY3QKK21jX250aCAoaW50IG51bSwgTGlzcF9PYmplY3Qg bGlzdCkKK3sKKyAgZm9yIChpbnQgaSA9IDA7IGkgPCBudW0gJiYgIU5JTFAgKGxpc3QpOyBpKysp CisgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICBpZiAoQ09OU1AgKGxpc3QpKQorICAgIHJldHVy biBYQ0FSIChsaXN0KTsKKyAgICBlbHNlCisgICAgICByZXR1cm4gUW5pbDsKK30KKworTGlzcF9P YmplY3QKK21jX2Fzc3EgKExpc3BfT2JqZWN0IGtleSwgTGlzcF9PYmplY3QgbGlzdCkKK3sKKyAg d2hpbGUgKDEpCisgICAgeworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAo Q09OU1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAgICAgICAmJiBFUSAoWENBUiAoWENBUiAobGlz dCkpLCBrZXkpKSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7Cisg ICAgICBpZiAoIUNPTlNQIChsaXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkp CisgICAgICAgICAgICAgICYmIEVRIChYQ0FSIChYQ0FSIChsaXN0KSksIGtleSkpKQorICAgICAg ICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxp c3QpCisgICAgICAgICAgfHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYg RVEgKFhDQVIgKFhDQVIgKGxpc3QpKSwga2V5KSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlz dCA9IFhDRFIgKGxpc3QpOworICAgIH0KKyAgaWYgKENPTlNQIChsaXN0KSkKKyAgICByZXR1cm4g WENBUiAobGlzdCk7CisgICAgZWxzZQorICAgICAgcmV0dXJuIFFuaWw7Cit9CisKK0xpc3BfT2Jq ZWN0CittY19hc3NvYyAoTGlzcF9PYmplY3Qga2V5LCBMaXNwX09iamVjdCBsaXN0KQoreworICBM aXNwX09iamVjdCBjYXI7CisgIHdoaWxlICgxKQorICAgIHsKKyAgICAgIGlmICghQ09OU1AgKGxp c3QpCisgICAgICAgICAgfHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYg KGNhciA9IFhDQVIgKFhDQVIgKGxpc3QpKSwKKyAgICAgICAgICAgICAgICAgIEVRIChjYXIsIGtl eSkgfHwgIU5JTFAgKEZlcXVhbCAoY2FyLCBrZXkpKSkpKQorICAgICAgICBicmVhazsKKyAgICAg IGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAg fHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgKGNhciA9IFhDQVIgKFhD QVIgKGxpc3QpKSwKKyAgICAgICAgICAgICAgICAgIEVRIChjYXIsIGtleSkgfHwgIU5JTFAgKEZl cXVhbCAoY2FyLCBrZXkpKSkpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChs aXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAgfHwgKENPTlNQIChYQ0FS IChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgKGNhciA9IFhDQVIgKFhDQVIgKGxpc3QpKSwKKyAg ICAgICAgICAgICAgICAgIEVRIChjYXIsIGtleSkgfHwgIU5JTFAgKEZlcXVhbCAoY2FyLCBrZXkp KSkpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICB9Cisg IGlmIChDT05TUCAobGlzdCkpCisgICAgcmV0dXJuIFhDQVIgKGxpc3QpOworICAgIGVsc2UKKyAg ICAgIHJldHVybiBRbmlsOworfQorCitMaXNwX09iamVjdAorbWNfcGxpc3RfZ2V0IChMaXNwX09i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mNoYXJwb3MKKyAgICAgICAgICA6IC0xOworICByZXR1 cm4gKG0gPT0gLTEpCisgICAgICAgICAgID8gLTEKKyAgICAgICAgIDogKFBUIDwgbSkgPT0gYmVn aW5fcAorICAgICAgICAgICA/IFBUCisgICAgICAgICA6IGNsaXBfdG9fYm91bmRzIChCRUdWLCBt LCBaVik7Cit9CisKKy8qIENoZWNrIHRoZSBwcmVzZW5jZSBvZiBhIGRpc3BsYXkgcHJvcGVydHkg YW5kIGNvbXB1dGUgaXRzIHdpZHRoLgorICAgSWYgYSBwcm9wZXJ0eSB3YXMgZm91bmQgYW5kIGl0 cyB3aWR0aCB3YXMgZm91bmQgYXMgd2VsbCwgcmV0dXJuCisgICBpdHMgd2lkdGggKD49IDApIGFu ZCBzZXQgdGhlIHBvc2l0aW9uIG9mIHRoZSBlbmQgb2YgdGhlIHByb3BlcnR5CisgICBpbiBFTkRQ T1MuCisgICBPdGhlcndpc2UganVzdCByZXR1cm4gLTEuICovCitzdGF0aWMgaW50CittY19jaGVj a19kaXNwbGF5X3dpZHRoIChwdHJkaWZmX3QgcG9zLCBwdHJkaWZmX3QgY29sLCBwdHJkaWZmX3Qg KmVuZHBvcykKK3sKKyAgTGlzcF9PYmplY3QgdmFsLCBvdmVybGF5OworICBpZiAoQ09OU1AgKHZh bCA9IGdldF9jaGFyX3Byb3BlcnR5X2FuZF9vdmVybGF5CisgICAgICAgICAgICAgIChtYWtlX2Zp eG51bSAocG9zKSwgUWRpc3BsYXksIFFuaWwsICZvdmVybGF5KSkKKyAgICAgICYmIEVRIChRc3Bh Y2UsIFhDQVIgKHZhbCkpKQorICAgIHsgLyogRklYTUU6IFVzZSBjYWxjX3BpeGVsX3dpZHRoX29y X2hlaWdodC4gKi8KKyAgICAgIExpc3BfT2JqZWN0IHBsaXN0ID0gWENEUiAodmFsKSwgcHJvcDsK KyAgICAgIGludCB3aWR0aCA9IC0xOworICAgICAgRU1BQ1NfSU5UIGFsaWduX3RvX21heCA9IChj b2wgPCBNT1NUX1BPU0lUSVZFX0ZJWE5VTSAtIElOVF9NQVgKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gKEVNQUNTX0lOVCkgSU5UX01BWCArIGNvbAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiBNT1NUX1BPU0lUSVZFX0ZJWE5VTSk7CisgICAgICBpZiAoKHBy b3AgPSBtY19wbGlzdF9nZXQgKHBsaXN0LCBRQ3dpZHRoKSwgUkFOR0VEX0ZJWE5VTVAgKDAsIHBy b3AsIElOVF9NQVgpKQorICAgICAgICAgIHx8IChwcm9wID0gbWNfcGxpc3RfZ2V0IChwbGlzdCwg UUNyZWxhdGl2ZV93aWR0aCksCisgICAgICAgICAgICAgIFJBTkdFRF9GSVhOVU1QICgwLCBwcm9w LCBJTlRfTUFYKSkpCisgICAgICAgIHdpZHRoID0gWEZJWE5VTSAocHJvcCk7CisgICAgICAgIGVs c2UgaWYgKEZMT0FUUCAocHJvcCkgJiYgMCA8PSBYRkxPQVRfREFUQSAocHJvcCkKKyAgICAgICAg ICAgICAgICAgJiYgWEZMT0FUX0RBVEEgKHByb3ApIDw9IElOVF9NQVgpCisgICAgICAgICAgd2lk dGggPSAoaW50KShYRkxPQVRfREFUQSAocHJvcCkgKyAwLjUpOworICAgICAgICAgIGVsc2UgaWYg KChwcm9wID0gbWNfcGxpc3RfZ2V0IChwbGlzdCwgUUNhbGlnbl90byksCisgICAgICAgICAgICAg ICAgICAgIFJBTkdFRF9GSVhOVU1QIChjb2wsIHByb3AsIGFsaWduX3RvX21heCkpKQorICAgICAg ICAgICAgd2lkdGggPSBYRklYTlVNIChwcm9wKSAtIGNvbDsKKyAgICAgICAgICAgICAgZWxzZSBp ZiAoRkxPQVRQIChwcm9wKSAmJiBjb2wgPD0gWEZMT0FUX0RBVEEgKHByb3ApCisgICAgICAgICAg ICAgICAgICAgICAgICYmIChYRkxPQVRfREFUQSAocHJvcCkgPD0gYWxpZ25fdG9fbWF4KSkKKyAg ICAgICAgICAgICAgICB3aWR0aCA9IChpbnQpKFhGTE9BVF9EQVRBIChwcm9wKSArIDAuNSkgLSBj b2w7CisgICAgICBpZiAod2lkdGggPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIHB0cmRpZmZf dCBzdGFydDsKKyAgICAgICAgICBpZiAoT1ZFUkxBWVAgKG92ZXJsYXkpKQorICAgICAgICAgICAg KmVuZHBvcyA9IE9WRVJMQVlfUE9TSVRJT04gKE9WRVJMQVlfRU5EIChvdmVybGF5KSk7CisgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGdldF9wcm9wZXJ0eV9hbmRfcmFuZ2UgKHBvcywg UWRpc3BsYXksICZ2YWwsICZzdGFydCwgZW5kcG9zLCBRbmlsKTsKKyAgICAgICAgICAvKiBGb3Ig OnJlbGF0aXZlLXdpZHRoLCB3ZSBuZWVkIHRvIG11bHRpcGx5IGJ5IHRoZSBjb2x1bW4KKyAgICAg ICAgICAgICB3aWR0aCBvZiB0aGUgY2hhcmFjdGVyIGF0IFBPUywgaWYgaXQgaXMgZ3JlYXRlciB0 aGFuIDEuICovCisgICAgICAgICAgaWYgKCFOSUxQIChtY19wbGlzdF9nZXQgKHBsaXN0LCBRQ3Jl bGF0aXZlX3dpZHRoKSkKKyAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGN1cnJlbnRfYnVm ZmVyLCBlbmFibGVfbXVsdGlieXRlX2NoYXJhY3RlcnMpKSkKKyAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgaW50IGIsIHdkOworICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyICpwID0gQllU RV9QT1NfQUREUiAoQ0hBUl9UT19CWVRFIChwb3MpKTsKKyAgICAgICAgICAgICAgTUNfTVVMVElC WVRFX0JZVEVTX1dJRFRIIChwLCBidWZmZXJfZGlzcGxheV90YWJsZSAoKSwgYiwgd2QpOworICAg ICAgICAgICAgICB3aWR0aCAqPSB3ZDsKKyAgICAgICAgICAgIH0KK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IHB0ID0gUFQsIHB0X2J5dGUgPSBQVF9CWVRFOworICBMaXNwX09iamVjdCByZSwgZm9udF9vYmpl Y3QsIGxnc3RyaW5nOworICBwdHJkaWZmX3QgbGVuOworICByZWNvcmRfdW53aW5kX3NhdmVfbWF0 Y2hfZGF0YSAoKTsKKyAgcmUgPSBBUkVGIChydWxlLCAwKTsKKyAgaWYgKE5JTFAgKHJlKSkKKyAg ICBsZW4gPSAxOworICBlbHNlIGlmICghIFNUUklOR1AgKHJlKSkKKyAgICByZXR1cm4gdW5iaW5k X3RvIChjb3VudCwgUW5pbCk7CisgIGVsc2UgaWYgKChsZW4gPSBmYXN0X2xvb2tpbmdfYXQgKHJl LCBjaGFycG9zLCBieXRlcG9zLCBsaW1pdCwgLTEsIHN0cmluZykpCisgICAgICAgICAgID4gMCkK KyAgICB7CisgICAgICBpZiAoTklMUCAoc3RyaW5nKSkKKyAgICAgICAgbGVuID0gQllURV9UT19D SEFSIChieXRlcG9zICsgbGVuKSAtIGNoYXJwb3M7CisgICAgICBlbHNlCisgICAgICAgIGxlbiA9 IHN0cmluZ19ieXRlX3RvX2NoYXIgKHN0cmluZywgYnl0ZXBvcyArIGxlbikgLSBjaGFycG9zOwor ICAgIH0KKyAgaWYgKGxlbiA8PSAwKQorICAgIHJldHVybiB1bmJpbmRfdG8gKGNvdW50LCBRbmls KTsKKyAgdG8gPSBsaW1pdCA9IGNoYXJwb3MgKyBsZW47CisjaWZkZWYgSEFWRV9XSU5ET1dfU1lT VEVNCisgIGlmIChGUkFNRV9XSU5ET1dfUCAoZikpCisgICAgeworICAgICAgZm9udF9vYmplY3Qg PSBmb250X3JhbmdlIChjaGFycG9zLCBieXRlcG9zLCAmdG8sIHdpbiwgZmFjZSwgc3RyaW5nKTsK KyAgICAgIGlmICghIEZPTlRfT0JKRUNUX1AgKGZvbnRfb2JqZWN0KQorICAgICAgICAgIHx8ICgh IE5JTFAgKHJlKQorICAgICAgICAgICAgICAmJiB0byA8IGxpbWl0CisgICAgICAgICAgICAgICYm IChmYXN0X2xvb2tpbmdfYXQgKHJlLCBjaGFycG9zLCBieXRlcG9zLCB0bywgLTEsIHN0cmluZykg PD0gMCkpKQorICAgICAgICByZXR1cm4gdW5iaW5kX3RvIChjb3VudCwgUW5pbCk7CisgICAgfQor ICBlbHNlCisjZW5kaWYgICAgICAgIC8qIG5vdCBIQVZFX1dJTkRPV19TWVNURU0gKi8KKyAgICBm b250X29iamVjdCA9IHdpbi0+ZnJhbWU7CisgIGxnc3RyaW5nID0gRmNvbXBvc2l0aW9uX2dldF9n c3RyaW5nIChwb3MsIG1ha2VfZml4bnVtICh0byksIGZvbnRfb2JqZWN0LAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyaW5nKTsKKyAgaWYgKE5JTFAgKExHU1RSSU5H X0lEIChsZ3N0cmluZykpKQorICAgIHsKKyAgICAgIC8qIFNhdmUgcG9pbnQgYXMgbWFya2VyIGJl Zm9yZSBjYWxsaW5nIG91dCB0byBsaXNwLiAgKi8KKyAgICAgIGlmIChOSUxQIChzdHJpbmcpKQor ICAgICAgICByZWNvcmRfdW53aW5kX3Byb3RlY3QgKHJlc3RvcmVfcG9pbnRfdW53aW5kLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkX21hcmtlciAoY3VycmVudF9idWZmZXIs IHB0LCBwdF9ieXRlKSk7CisgICAgICBsZ3N0cmluZyA9IHNhZmVfY2FsbCAoNiwgVmF1dG9fY29t cG9zaXRpb25fZnVuY3Rpb24sIEFSRUYgKHJ1bGUsIDIpLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHBvcywgbWFrZV9maXhudW0gKHRvKSwgZm9udF9vYmplY3QsIHN0cmluZyk7CisgICAg fQorICByZXR1cm4gdW5iaW5kX3RvIChjb3VudCwgbGdzdHJpbmcpOworfQorCisvKiBDaGVjayBp ZiB0aGUgY2hhcmFjdGVyIGF0IENIQVJQT1MgKGFuZCBCWVRFUE9TKSB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2YWwsIGVsdDsKKyAgICAgIHB0cmRpZmZf dCBpOworICAgICAgdmFsID0gQ0hBUl9UQUJMRV9SRUYgKFZjb21wb3NpdGlvbl9mdW5jdGlvbl90 YWJsZSwgY21wX2l0LT5jaCk7CisgICAgICBmb3IgKGkgPSAwOyBpIDwgY21wX2l0LT5ydWxlX2lk eDsgaSsrLCB2YWwgPSBYQ0RSICh2YWwpKTsKKyAgICAgIGlmIChjaGFycG9zIDwgZW5kcG9zKQor ICAgICAgICB7CisgICAgICAgICAgZm9yICg7IENPTlNQICh2YWwpOyB2YWwgPSBYQ0RSICh2YWwp KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBlbHQgPSBYQ0FSICh2YWwpOworICAgICAg ICAgICAgICBpZiAoISBWRUNUT1JQIChlbHQpIHx8IEFTSVpFIChlbHQpICE9IDMKKyAgICAgICAg ICAgICAgICAgIHx8ICEgSU5URUdFUlAgKEFSRUYgKGVsdCwgMSkpKQorICAgICAgICAgICAgICAg IGNvbnRpbnVlOworICAgICAgICAgICAgICBpZiAoWEZJWE5BVCAoQVJFRiAoZWx0LCAxKSkgIT0g Y21wX2l0LT5sb29rYmFjaykKKyAgICAgICAgICAgICAgICBnb3RvIG5vX2NvbXBvc2l0aW9uOwor ICAgICAgICAgICAgICBsZ3N0cmluZyA9IG1jX2F1dG9jbXBfY2hhcnMgKGVsdCwgY2hhcnBvcywg Ynl0ZXBvcywgZW5kcG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHcsIGZhY2UsIHN0cmluZyk7CisgICAgICAgICAgICAgIGlmIChjb21wb3NpdGlvbl9nc3RyaW5n X3AgKGxnc3RyaW5nKSkKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgbGdz dHJpbmcgPSBRbmlsOworICAgICAgICAgICAgICAvKiBDb21wb3NpdGlvbiBmYWlsZWQgcGVyaGFw cyBiZWNhdXNlIHRoZSBmb250IGRvZXNuJ3QKKyAgICAgICAgICAgICAgICAgc3VwcG9ydCBzdWZm aWNpZW50IHJhbmdlIG9mIGNoYXJhY3RlcnMuICBUcnkgdGhlCisgICAgICAgICAgICAgICAgIG90 aGVyIGNvbXBvc2l0aW9uIHJ1bGVzIGlmIGFueS4gICovCisgICAgICAgICAgICB9CisgICAgICAg ICAgY21wX2l0LT5yZXZlcnNlZF9wID0gMDsKKyAgICAgICAgfQorICAgICAgZWxzZQorICAgICAg ICB7CisgICAgICAgICAgcHRyZGlmZl90IGNwb3MgPSBjaGFycG9zLCBicG9zID0gYnl0ZXBvczsK KyAgICAgICAgICBjbXBfaXQtPnJldmVyc2VkX3AgPSAxOworICAgICAgICAgIGVsdCA9IFhDQVIg KHZhbCk7CisgICAgICAgICAgaWYgKGNtcF9pdC0+bG9va2JhY2sgPiAwKQorICAgICAgICAgICAg eworICAgICAgICAgICAgICBjcG9zID0gY2hhcnBvcyAtIGNtcF9pdC0+bG9va2JhY2s7CisgICAg ICAgICAgICAgIGlmIChTVFJJTkdQIChzdHJpbmcpKQorICAgICAgICAgICAgICAgIGJwb3MgPSBz dHJpbmdfY2hhcl90b19ieXRlIChzdHJpbmcsIGNwb3MpOworICAgICAgICAgICAgICBlbHNlCisg ICAgICAgICAgICAgICAgYnBvcyA9IENIQVJfVE9fQllURSAoY3Bvcyk7CisgICAgICAgICAgICB9 CisgICAgICAgICAgbGdzdHJpbmcgPSBtY19hdXRvY21wX2NoYXJzIChlbHQsIGNwb3MsIGJwb3Ms IGNoYXJwb3MgKyAxLCB3LCBmYWNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgc3RyaW5nKTsKKyAgICAgICAgICBpZiAoISBjb21wb3NpdGlvbl9nc3RyaW5nX3AgKGxnc3Ry aW5nKQorICAgICAgICAgICAgICB8fCBjcG9zICsgTEdTVFJJTkdfQ0hBUl9MRU4gKGxnc3RyaW5n KSAtIDEgIT0gY2hhcnBvcykKKyAgICAgICAgICAgIC8qIENvbXBvc2l0aW9uIGZhaWxlZCBvciBk aWRuJ3QgY292ZXIgdGhlIGN1cnJlbnQKKyAgICAgICAgICAgICAgIGNoYXJhY3Rlci4gICovCisg ICAgICAgICAgICBnb3RvIG5vX2NvbXBvc2l0aW9uOworICAgICAgICB9CisgICAgICBpZiAoTklM UCAobGdzdHJpbmcpKQorICAgICAgICBnb3RvIG5vX2NvbXBvc2l0aW9uOworICAgICAgaWYgKE5J TFAgKExHU1RSSU5HX0lEIChsZ3N0cmluZykpKQorICAgICAgICBsZ3N0cmluZyA9IGNvbXBvc2l0 aW9uX2dzdHJpbmdfcHV0X2NhY2hlIChsZ3N0cmluZywgLTEpOworICAgICAgY21wX2l0LT5pZCA9 IFhGSVhOVU0gKExHU1RSSU5HX0lEIChsZ3N0cmluZykpOworICAgICAgZm9yIChpID0gMDsgaSA8 IExHU1RSSU5HX0dMWVBIX0xFTiAobGdzdHJpbmcpOyBpKyspCisgICAgICAgIGlmIChOSUxQIChM R1NUUklOR19HTFlQSCAobGdzdHJpbmcsIGkpKSkKKyAgICAgICAgICBicmVhazsKKyAgICAgIGNt cF9pdC0+bmdseXBocyA9IGk7CisgICAgICBjbXBfaXQtPmZyb20gPSAwOworICAgICAgY21wX2l0 LT50byA9IGk7CisgICAgfQorICBlbHNlCisgICAgZ290byBub19jb21wb3NpdGlvbjsKKyAgcmV0 dXJuIDE7Cisgbm9fY29tcG9zaXRpb246CisgIGlmIChjaGFycG9zID09IGVuZHBvcykKKyAgICBy ZXR1cm4gMDsKKyAgaWYgKGNoYXJwb3MgPCBlbmRwb3MpCisgICAgeworICAgICAgY2hhcnBvcysr OworICAgICAgaWYgKE5JTFAgKHN0cmluZykpCisgICAgICAgIElOQ19QT1MgKGJ5dGVwb3MpOwor ICAgICAgZWxzZQorICAgICAgICBieXRlcG9zICs9IEJZVEVTX0JZX0NIQVJfSEVBRCAoKihTREFU QSAoc3RyaW5nKSArIGJ5dGVwb3MpKTsKKyAgICB9CisgIGVsc2UKKyAgICB7CisgICAgICBjaGFy c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jaGFyYWN0 ZXIgb24gd2hpY2ggdGhlIGN1cnNvciB3aWxsIGFwcGVhci4gKi8KKyAgICAgIGlmIChjb2wgPj0g Z29hbCkKKyAgICAgICAgYnJlYWs7CisgICAgICBwcmV2X2NvbCA9IGNvbDsKKyAgICAgIHsgLyog Q2hlY2sgZGlzcGxheSBwcm9wZXJ0eS4gKi8KKyAgICAgICAgcHRyZGlmZl90IGVuZHA7CisgICAg ICAgIGludCB3aWR0aCA9IG1jX2NoZWNrX2Rpc3BsYXlfd2lkdGggKHNjYW4sIGNvbCwgJmVuZHAp OworICAgICAgICBpZiAod2lkdGggPj0gMCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBjb2wg Kz0gd2lkdGg7CisgICAgICAgICAgICBpZiAoZW5kcCA+IHNjYW4pIC8qIEF2b2lkIGluZmluaXRl IGxvb3BzIHdpdGggMC13aWR0aCBvdmVybGF5cy4gKi8KKyAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgIHNjYW4gPSBlbmRwOworICAgICAgICAgICAgICAgIHNjYW5fYnl0ZSA9IENIQVJf VE9fQllURSAoc2Nhbik7CisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAg IH0KKyAgICAgICAgICB9CisgICAgICB9CisgICAgICAvKiBDaGVjayBjb21wb3NpdGlvbiBzZXF1 ZW5jZS4gKi8KKyAgICAgIGlmIChjbXBfaXQuaWQgPj0gMAorICAgICAgICAgIHx8IChzY2FuID09 IGNtcF9pdC5zdG9wX3BvcworICAgICAgICAgICAgICAmJiBtY19jb21wb3NpdGlvbl9yZXNlYXRf aXQgKCZjbXBfaXQsIHNjYW4sIHNjYW5fYnl0ZSwgZW5kLCB3LCBOVUxMLCBRbmlsKSkpCisgICAg ICAgIGNvbXBvc2l0aW9uX3VwZGF0ZV9pdCAoJmNtcF9pdCwgc2Nhbiwgc2Nhbl9ieXRlLCBRbmls KTsKKyAgICAgIGlmIChjbXBfaXQuaWQgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIHNjYW4g Kz0gY21wX2l0Lm5jaGFyczsKKyAgICAgICAgICBzY2FuX2J5dGUgKz0gY21wX2l0Lm5ieXRlczsK KyAgICAgICAgICBpZiAoc2NhbiA8PSBlbmQpCisgICAgICAgICAgICBjb2wgKz0gY21wX2l0Lndp ZHRoOworICAgICAgICAgIGlmIChjbXBfaXQudG8gPT0gY21wX2l0Lm5nbHlwaHMpCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIGNtcF9pdC5pZCA9IC0xOworICAgICAgICAgICAgICBjb21w b3NpdGlvbl9jb21wdXRlX3N0b3BfcG9zICgmY21wX2l0LCBzY2FuLCBzY2FuX2J5dGUsIGVuZCwg UW5pbCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGNt cF9pdC5mcm9tID0gY21wX2l0LnRvOworICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICB9Cisg ICAgICBjID0gRkVUQ0hfQllURSAoc2Nhbl9ieXRlKTsKKyAgICAgIC8qIFNlZSBpZiB0aGVyZSBp cyBhIGRpc3BsYXkgdGFibGUgYW5kIGl0IHJlbGF0ZXMgdG8gdGhpcyBjaGFyYWN0ZXIuICovCisg ICAgICBpZiAoZHAgIT0gMAorICAgICAgICAgICYmICEgKG11bHRpYnl0ZSAmJiBMRUFESU5HX0NP REVfUCAoYykpCisgICAgICAgICAgJiYgVkVDVE9SUCAoRElTUF9DSEFSX1ZFQ1RPUiAoZHAsIGMp KSkKKyAgICAgICAgeworICAgICAgICAgIExpc3BfT2JqZWN0IGNoYXJ2ZWM7CisgICAgICAgICAg cHRyZGlmZl90IGksIG47CisgICAgICAgICAgLyogVGhpcyBjaGFyYWN0ZXIgaXMgZGlzcGxheWVk IHVzaW5nIGEgdmVjdG9yIG9mIGdseXBocy4KKyAgICAgICAgICAgICBVcGRhdGUgdGhlIGNvbHVt bi9wb3NpdGlvbiBiYXNlZCBvbiB0aG9zZSBnbHlwaHMuICovCisgICAgICAgICAgY2hhcnZlYyA9 IERJU1BfQ0hBUl9WRUNUT1IgKGRwLCBjKTsKKyAgICAgICAgICBuID0gQVNJWkUgKGNoYXJ2ZWMp OworICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBuOyBpKyspCisgICAgICAgICAgICB7CisgICAg ICAgICAgICAgIC8qIFRoaXMgc2hvdWxkIGJlIGhhbmRsZWQgdGhlIHNhbWUgYXMKKyAgICAgICAg ICAgICAgbmV4dF9lbGVtZW50X2Zyb21fZGlzcGxheV92ZWN0b3IgZG9lcyBpdC4gKi8KKyAgICAg ICAgICAgICAgTGlzcF9PYmplY3QgZW50cnkgPSBBUkVGIChjaGFydmVjLCBpKTsKKyAgICAgICAg ICAgICAgaWYgKEdMWVBIX0NPREVfUCAoZW50cnkpKQorICAgICAgICAgICAgICAgIGMgPSBHTFlQ SF9DT0RFX0NIQVIgKGVudHJ5KTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAg IGMgPSAnICc7CisgICAgICAgICAgICAgIGlmIChjID09ICdcbicpCisgICAgICAgICAgICAgICAg Z290byBlbmRsb29wOworICAgICAgICAgICAgICBpZiAoYyA9PSAnXHInICYmIEVRIChCVkFSIChj dXJyZW50X2J1ZmZlciwgc2VsZWN0aXZlX2Rpc3BsYXkpLCBRdCkpCisgICAgICAgICAgICAgICAg Z290byBlbmRsb29wOworICAgICAgICAgICAgICBpZiAoYyA9PSAnXHQnKQorICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgIGNvbCArPSB0YWJfd2lkdGg7CisgICAgICAgICAgICAg ICAgICBjb2wgPSBjb2wgLyB0YWJfd2lkdGggKiB0YWJfd2lkdGg7CisgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICsrY29sOworICAgICAg ICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAg ICAvKiBUaGUgZGlzcGxheSB0YWJsZSBkb2Vzbid0IGFmZmVjdCB0aGlzIGNoYXJhY3RlcjsKKyAg ICAgICAgICAgICAgIGl0IGRpc3BsYXlzIGFzIGl0c2VsZi4gKi8KKyAgICAgICAgICAgIGlmIChj ID09ICdcbicpCisgICAgICAgICAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgICAgIGlmIChj ID09ICdccicgJiYgRVEgKEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBzZWxlY3RpdmVfZGlzcGxheSks IFF0KSkKKyAgICAgICAgICAgICAgZ290byBlbmRsb29wOworICAgICAgICAgICAgaWYgKGMgPT0g J1x0JykKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGNvbCArPSB0YWJfd2lkdGg7 CisgICAgICAgICAgICAgICAgY29sID0gY29sIC8gdGFiX3dpZHRoICogdGFiX3dpZHRoOworICAg ICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UgaWYgKG11bHRpYnl0ZSAmJiBMRUFESU5H X0NPREVfUCAoYykpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgLyogU3Rh cnQgb2YgbXVsdGktYnl0ZSBmb3JtLiAqLworICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hh ciAqcHRyOworICAgICAgICAgICAgICAgICAgaW50IGJ5dGVzLCB3aWR0aDsKKyAgICAgICAgICAg ICAgICAgIHB0ciA9IEJZVEVfUE9TX0FERFIgKHNjYW5fYnl0ZSk7CisgICAgICAgICAgICAgICAg ICBNQ19NVUxUSUJZVEVfQllURVNfV0lEVEggKHB0ciwgZHAsIGJ5dGVzLCB3aWR0aCk7CisgICAg ICAgICAgICAgICAgICAvKiBTdWJ0cmFjdCBvbmUgdG8gY29tcGVuc2F0ZSBmb3IgdGhlIGluY3Jl bWVudAorICAgICAgICAgICAgICAgICAgdGhhdCBpcyBnb2luZyB0byBoYXBwZW4gYmVsb3cuICov CisgICAgICAgICAgICAgICAgICBzY2FuX2J5dGUgKz0gYnl0ZXMgLSAxOworICAgICAgICAgICAg ICAgICAgY29sICs9IHdpZHRoOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBl bHNlIGlmIChjdGxfYXJyb3cgJiYgKGMgPCAwNDAgfHwgYyA9PSAwMTc3KSkKKyAgICAgICAgICAg ICAgICAgIGNvbCArPSAyOworICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoYyA8IDA0MCB8fCBj ID49IDAxNzcpCisgICAgICAgICAgICAgICAgICAgIGNvbCArPSA0OworICAgICAgICAgICAgICAg ICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgY29sKys7CisgICAgICAgICAgfQorICAg ICAgc2NhbisrOworICAgICAgc2Nhbl9ieXRlKys7CisgICAgfQorIGVuZGxvb3A6CisgIGxhc3Rf a25vd25fY29sdW1uID0gY29sOworICBsYXN0X2tub3duX2NvbHVtbl9wb2ludCA9IHB0OworICBs YXN0X2tub3duX2NvbHVtbl9tb2RpZmllZCA9IE1PRElGRjsKKyAgaWYgKGdvYWxjb2wpCisgICAg KmdvYWxjb2wgPSBjb2w7CisgIGlmIChlbmRwb3MpCisgICAgKmVuZHBvcyA9IHNjYW47CisgIGlm IChwcmV2Y29sKQorICAgICpwcmV2Y29sID0gcHJldl9jb2w7Cit9CisKK3B0cmRpZmZfdAorbWNf Y3VycmVudF9jb2x1bW4gKHN0cnVjdCB3aW5kb3cgKncsIHB0cmRpZmZfdCBwdCkKK3sKKyAgLyog YGJ1Zl9jaGFycG9zX3RvX2J5dGVwb3MnOiAgZWFzc2VydCAoQlVGX0JFRyAoYikgPD0gY2hhcnBv cyAmJiBjaGFycG9zIDw9IEJVRl9aIChiKSk7ICovCisgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVG RkVSICh3LT5jb250ZW50cyk7CisgIHN0cnVjdCBidWZmZXIgKm9sZF9idWZmZXIgPSBOVUxMOwor ICBpZiAoYiAhPSBjdXJyZW50X2J1ZmZlcikKKyAgICB7CisgICAgICB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VCkKKyAgICAg IHN0b3AgPSBCRUdWX0FERFI7CisgICAgICBlbHNlCisgICAgICAgIHN0b3AgPSBHQVBfRU5EX0FE RFI7CisgIGNvbCA9IDAsIHRhYl9zZWVuID0gMCwgcG9zdF90YWIgPSAwOworICB3aGlsZSAoMSkK KyAgICB7CisgICAgICBwdHJkaWZmX3QgaSwgbjsKKyAgICAgIExpc3BfT2JqZWN0IGNoYXJ2ZWM7 CisgICAgICBpZiAocHRyID09IHN0b3ApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBXZSBzdG9w cGVkIGVpdGhlciBmb3IgdGhlIGJlZ2lubmluZyBvZiB0aGUgYnVmZmVyCisgICAgICAgICAgICAg b3IgZm9yIHRoZSBnYXAuICovCisgICAgICAgICAgaWYgKHB0ciA9PSBCRUdWX0FERFIpCisgICAg ICAgICAgICBicmVhazsKKyAgICAgICAgICAvKiBJdCB3YXMgdGhlIGdhcC4gIEp1bXAgYmFjayBv dmVyIGl0LiAqLworICAgICAgICAgIHN0b3AgPSBCRUdWX0FERFI7CisgICAgICAgICAgcHRyID0g R1BUX0FERFI7CisgICAgICAgICAgLyogQ2hlY2sgd2hldGhlciB0aGF0IGJyaW5ncyB1cyB0byBi ZWdpbm5pbmcgb2YgYnVmZmVyLiAqLworICAgICAgICAgIGlmIChCRUdWID49IEdQVCkKKyAgICAg ICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBjID0gKi0tcHRyOworICAgICAgaWYgKGRw ICYmIFZFQ1RPUlAgKERJU1BfQ0hBUl9WRUNUT1IgKGRwLCBjKSkpCisgICAgICAgIHsKKyAgICAg ICAgICBjaGFydmVjID0gRElTUF9DSEFSX1ZFQ1RPUiAoZHAsIGMpOworICAgICAgICAgIG4gPSBB U0laRSAoY2hhcnZlYyk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAg ICAgICAgICAgIGNoYXJ2ZWMgPSBRbmlsOworICAgICAgICAgICAgbiA9IDE7CisgICAgICAgICAg fQorICAgICAgZm9yIChpID0gbiAtIDE7IGkgPj0gMDsgLS1pKQorICAgICAgICB7CisgICAgICAg ICAgaWYgKFZFQ1RPUlAgKGNoYXJ2ZWMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAv KiBUaGlzIHNob3VsZCBiZSBoYW5kbGVkIHRoZSBzYW1lIGFzCisgICAgICAgICAgIG5leHRfZWxl bWVudF9mcm9tX2Rpc3BsYXlfdmVjdG9yIGRvZXMgaXQuICovCisgICAgICAgICAgICAgIExpc3Bf T2JqZWN0IGVudHJ5ID0gQVJFRiAoY2hhcnZlYywgaSk7CisgICAgICAgICAgICAgIGlmIChHTFlQ SF9DT0RFX1AgKGVudHJ5KSkKKyAgICAgICAgICAgICAgICBjID0gR0xZUEhfQ09ERV9DSEFSIChl bnRyeSk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgYyA9ICcgJzsK KyAgICAgICAgICAgIH0KKyAgICAgICAgICBpZiAoYyA+PSAwNDAgJiYgYyA8IDAxNzcpCisgICAg ICAgICAgICBjb2wrKzsKKyAgICAgICAgICAgIGVsc2UgaWYgKGMgPT0gJ1xuJworICAgICAgICAg ICAgICAgICAgICAgfHwgKGMgPT0gJ1xyJworICAgICAgICAgICAgICAgICAgICAgICAgICYmIEVR IChCVkFSIChjdXJyZW50X2J1ZmZlciwgc2VsZWN0aXZlX2Rpc3BsYXkpLCBRdCkpKQorICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgcHRyKys7CisgICAgICAgICAgICAgICAgZ290byBz dGFydF9vZl9saW5lX2ZvdW5kOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2Ug aWYgKGMgPT0gJ1x0JykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBpZiAo dGFiX3NlZW4pCisgICAgICAgICAgICAgICAgICAgIGNvbCA9ICgoY29sICsgdGFiX3dpZHRoKSAv IHRhYl93aWR0aCkgKiB0YWJfd2lkdGg7CisgICAgICAgICAgICAgICAgICBwb3N0X3RhYiArPSBj b2w7CisgICAgICAgICAgICAgICAgICBjb2wgPSAwOworICAgICAgICAgICAgICAgICAgdGFiX3Nl ZW4gPSAxOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlmIChWRUNU T1JQIChjaGFydmVjKSkKKyAgICAgICAgICAgICAgICAgIC8qIFdpdGggYSBkaXNwbGF5IHRhYmxl IGVudHJ5LCBDIGlzIGRpc3BsYXllZCBhcyBpcywgYW5kCisgICAgICAgICAgICAgICAgICAgICBu b3QgZGlzcGxheWVkIGFzIFxOTk4gb3IgYXMgXk4uICBJZiBDIGlzIGEgc2luZ2xlLWJ5dGUKKyAg ICAgICAgICAgICAgICAgICAgIGNoYXJhY3RlciwgaXQgdGFrZXMgb25lIGNvbHVtbi4gIElmIEMg aXMgbXVsdGktYnl0ZSBpbgorICAgICAgICAgICAgICAgICAgICAgYSB1bmlieXRlIGJ1ZmZlciwg aXQncyB0cmFuc2xhdGVkIHRvIHVuaWJ5dGUsIHNvIGl0CisgICAgICAgICAgICAgICAgICAgICBh bHNvIHRha2VzIG9uZSBjb2x1bW4uICovCisgICAgICAgICAgICAgICAgICArK2NvbDsKKyAgICAg ICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgY29sICs9IChjdGxfYXJyb3cg JiYgYyA8IDAyMDApID8gMiA6IDQ7CisgICAgICAgIH0KKyAgICB9Cisgc3RhcnRfb2ZfbGluZV9m b3VuZDoKKyAgaWYgKHRhYl9zZWVuKQorICAgIHsKKyAgICAgIGNvbCA9ICgoY29sICsgdGFiX3dp ZHRoKSAvIHRhYl93aWR0aCkgKiB0YWJfd2lkdGg7CisgICAgICBjb2wgKz0gcG9zdF90YWI7Cisg ICAgfQorICBsYXN0X2tub3duX2NvbHVtbiA9IGNvbDsKKyAgbGFzdF9rbm93bl9jb2x1bW5fcG9p bnQgPSBwdDsKKyAgbGFzdF9rbm93bl9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X3RvX3N0cmluZyAoaW50IGFyZykKK3sKKyAgTGlzcF9PYmplY3QgY2hhcmFjdGVyID0g KDAgPD0gYXJnICYmIGFyZyA8PSBNQVhfQ0hBUikKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gRmNoYXJfdG9fc3RyaW5nIChtYWtlX2ZpeG51bSAoYXJnKSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogUW5pbDsKKyAgY2hhciAqIHJlc3VsdCA9ICghTklMUCAoY2hhcmFjdGVyKQor ICAgICAgICAgICAgICAgICAgICYmIGFyZyA9PSA5KQorICAgICAgICAgICAgICAgICAgICA/ICJc XHQiCisgICAgICAgICAgICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAg ICAgICAgICAgJiYgYXJnID09IDEwKQorICAgICAgICAgICAgICAgICAgICA/ICJcXG4iCisgICAg ICAgICAgICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICAg JiYgYXJnID09IDMyKQorICAgICAgICAgICAgICAgICAgICA/ICJcXHMiCisgICAgICAgICAgICAg ICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnICE9 IDkKKyAgICAgICAgICAgICAgICAgICAgICYmIGFyZyAhPSAxMAorICAgICAgICAgICAgICAgICAg ICAgJiYgYXJnICE9IDMyKQorICAgICAgICAgICAgICAgICAgICA/IFNTREFUQSAoY2hhcmFjdGVy KQorICAgICAgICAgICAgICAgICAgOiAiXFw/IjsKKyAgcmV0dXJuIHJlc3VsdDsKK30KKworaW50 CittY19saXNwX3RvX2N1cnNvcl90eXBlIChMaXNwX09iamVjdCBhcmcpCit7CisgIGNoYXIgKnN0 cjsKKyAgaWYgKFhUWVBFIChhcmcpID09IExpc3BfU3RyaW5nKQorICAgIHN0ciA9IFNTREFUQSAo YXJnKTsKKyAgICBlbHNlIGlmIChYVFlQRSAoYXJnKSA9PSBMaXNwX1N5bWJvbCkKKyAgICAgIHN0 ciA9IFNTREFUQSAoU1lNQk9MX05BTUUgKGFyZykpOworICAgICAgZWxzZSByZXR1cm4gLTE7Cisg IGlmICghc3RyY21wIChzdHIsICJubyIpKQorICAgIHJldHVybiBNQ19OT19DVVJTT1I7CisgIGlm ICghc3RyY21wIChzdHIsICJtYy1sZWZ0LWZyaW5nZS1iaXRtYXAiKSkKKyAgICByZXR1cm4gTUNf TEVGVF9GUklOR0VfQklUTUFQOworICBpZiAoIXN0cmNtcCAoc3RyLCAibWMtcmlnaHQtZnJpbmdl LWJpdG1hcCIpKQorICAgIHJldHVybiBNQ19SSUdIVF9GUklOR0VfQklUTUFQOworICBpZiAoIXN0 cmNtcCAoc3RyLCAiYm94IikpCisgICAgcmV0dXJuIE1DX0ZJTExFRF9CT1g7CisgIGlmICghc3Ry Y21wIChzdHIsICJmcmFtZWQiKSkKKyAgICByZXR1cm4gTUNfRlJBTUVEX0JPWDsKKyAgaWYgKCFz dHJjbXAgKHN0ciwgImhvbGxvdyIpKQorICAgIHJldHVybiBNQ19IT0xMT1dfQk9YOworICBpZiAo IXN0cmNtcCAoc3RyLCAiYmFyIikpCisgICAgcmV0dXJuIE1DX0JBUjsKKyAgaWYgKCFzdHJjbXAg KHN0ciwgImhiYXIiKSkKKyAgICByZXR1cm4gTUNfSEJBUjsKKyAgcmV0dXJuIC0xOworfQorCisv KiBVU0FHRTogIGZwcmludGYgKHN0ZGVyciwgIkNVUlNPUiBUWVBFICglcykiLCBtY19jdXJzb3Jf dHlwZV90b19zdHJpbmcgKGFyZykpOyAqLworY2hhciAqCittY19jdXJzb3JfdHlwZV90b19zdHJp bmcgKGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUpCit7CisgIHN3aXRjaCAoY3Vyc29y X3R5cGUpCisgICAgeworICAgICAgY2FzZSBNQ19GSUxMRURfQk9YOiByZXR1cm4gIk1DX0ZJTExF RF9CT1giOworICAgICAgY2FzZSBNQ19GUkFNR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ZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsK KyAgICAgICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7CisgICAgICAgKytjYWNoZV90eXBlKQorICAg IHsKKyAgICAgIGludCBjdXJzb3JzX3VzZWQgPSB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW2Nh Y2hlX3R5cGVdOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICBtYXRyaXguY3Vyc29yc191c2Vk WyVzXSAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgICBtY19jYWNoZV90eXBlX3RvX3N0 cmluZyAoY2FjaGVfdHlwZSksIGN1cnNvcnNfdXNlZCk7CisgICAgfQorICBmb3IgKGludCB2bnRo ID0gMDsKKyAgICAgICB2bnRoIDwgdy0+bWNfbWF0cml4LnZwb3NfdXNlZDsKKyAgICAgICArK3Zu dGgpCisgICAgeworICAgICAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1D X0NBQ0hFOworICAgICAgICAgICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7CisgICAgICAgICAgICsr Y2FjaGVfdHlwZSkKKyAgICAgICAgeworICAgICAgICAgIGludCBjYWNoZV9hbGxvY2F0ZWQgPSB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV07CisgICAg ICAgICAgaW50IGNhY2hlX3VzZWQgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2Vk W2NhY2hlX3R5cGVdOworICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgICB2bnRoICglZCkg fCBjYWNoZV9hbGxvY2F0ZWRbJXNdICglZCkgfCBjYWNoZV91c2VkWyVzXSAoJWQpXG4iLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgdm50aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg IG1jX2NhY2hlX3R5cGVfdG9fc3RyaW5nIChjYWNoZV90eXBlKSwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgIGNhY2hlX2FsbG9jYXRlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG1j X2NhY2hlX3R5cGVfdG9fc3RyaW5nIChjYWNoZV90eXBlKSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgIGNhY2hlX3VzZWQpOworICAgICAgICB9CisgICAgfQorfQorCit2b2lkCittY19zZXRf bHNsX2JnIChzdHJ1Y3Qgd2luZG93ICp3LCBlbnVtIGZhY2VfaWQgZmFjZV9pZCwgc3RydWN0IG1j X1JHQiAqbHNsKQoreworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAg c3RydWN0IGZhY2UgKmZhY2U7CisgIGlmICghTklMUCAoVmZhY2VfcmVtYXBwaW5nX2FsaXN0KQor ICAgICAgJiYgKGZhY2VfaWQgPT0gREVGQVVMVF9GQUNFX0lEIC8qIFFkZWZhdWx0ICovCisgICAg ICAgICAgfHwgZmFjZV9pZCA9PSBNT0RFX0xJTkVfRkFDRV9JRCAvKiBRbW9kZV9saW5lICovCisg ICAgICAgICAgfHwgZmFjZV9pZCA9PSBNT0RFX0xJTkVfSU5BQ1RJVkVfRkFDRV9JRCAvKiBRbW9k ZV9saW5lX2luYWN0aXZlICovCisgICAgICAgICAgfHwgZmFjZV9pZCA9PSBIRUFERVJfTElORV9G QUNFX0lEIC8qIFFoZWFkZXJfbGluZSAqLworICAgICAgICAgIHx8IGZhY2VfaWQgPT0gVE9PTF9C QVJfRkFDRV9JRCAvKiBRdG9vbF9iYXIgKi8KKyAgICAgICAgICB8fCBmYWNlX2lkID09IEZSSU5H RV9GQUNFX0lEIC8qIFFmcmluZ2UgKi8KKyAgICAgICAgICB8fCBmYWNlX2lkID09IFNDUk9MTF9C QVJfRkFDRV9JRCAvKiBRc2Nyb2xsX2JhciAqLworICAgICAgICAgIHx8IGZhY2Vf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29sdW1u ICh3LCBvcG9pbnQpOworICBpbnQgZnJhbWVfY2hhcl93aWR0aCA9IEZSQU1FX0NPTFVNTl9XSURU SCAoZik7CisgIGJvb2wgZmlsbF9jb2x1bW5fcCA9ICFOSUxQIChCVkFSIChiLCBmaWxsX2NvbHVt bikpOworICBpbnQgZmlsbF9jb2wgPSBYRklYTlVNIChCVkFSIChiLCBmaWxsX2NvbHVtbikpOwor ICBpbnQgaHNjbF94ID0gdy0+aHNjcm9sbCAqIGZyYW1lX2NoYXJfd2lkdGg7CisgIGlmIChiICE9 IGN1cnJlbnRfYnVmZmVyKQorICAgIHsKKyAgICAgIG9sZF9idWZmZXIgPSBjdXJyZW50X2J1ZmZl cjsKKyAgICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKGIpOworICAgIH0KKyAgZXNzZW50aWFscy0+ enYgPSBaVjsKKyAgZXNzZW50aWFscy0+enZfYnl0ZSA9IFpWX0JZVEU7CisgIGVzc2VudGlhbHMt PmZjX3ggPSAoZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChW ZGlzcGxheV9saW5lX251bWJlcnMpKQorICAgICAgICAgICAgICAgICAgICAgICA/IChmaWxsX2Nv bCAqIGZyYW1lX2NoYXJfd2lkdGgpICsgdy0+bWMubG51bV9waXhlbF93aWR0aCAtIGhzY2xfeAor ICAgICAgICAgICAgICAgICAgICAgOiAoZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAgICAgICAg ICAgICAgJiYgTklMUCAoVmRpc3BsYXlfbGluZV9udW1iZXJzKSkKKyAgICAgICAgICAgICAgICAg ICAgICAgPyAoZmlsbF9jb2wgKiBmcmFtZV9jaGFyX3dpZHRoKSAtIGhzY2xfeAorICAgICAgICAg ICAgICAgICAgICAgOiAwOworICBpZiAob2xkX2J1ZmZlcikKKyAgICBzZXRfYnVmZmVyX2ludGVy bmFsIChvbGRfYnVmZmVyKTsKKyAgZW51bSBmYWNlX2lkIGZpbGxfY29sdW1uX3ByZV96dl9mYWNl X2lkID0KKyAgICAoIWVzc2VudGlhbHMtPmFjdGl2ZV9wCisgICAgICYmICFOSUxQIChCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIGZjX2luYWN0aXZlX3dpbmRvd3MpKQorICAgICAmJiBOSUxQ IChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICAgID8gbG9v a3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoImZjLWluYWN0aXZlLXByZS16di1mYWNlIiks IHRydWUpCisgICAgOiAoIWVzc2VudGlhbHMtPmFjdGl2ZV9wCisgICAgICAgJiYgIU5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfaW5hY3RpdmVfd2luZG93cykpCisgICAgICAg JiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAg ICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAmJiB3LT5j dXJzb3IueCA9PSBlc3NlbnRpYWxzLT5mY194KQorICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAo dywgZiwgaW50ZXJuICgiZmMtb3BvaW50LWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpCisg ICAgOiAoZXNzZW50aWFscy0+YWN0aXZlX3AKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwg Y2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICYmIHctPmN1cnNvci54ID09IGVzc2VudGlhbHMt PmZjX3gpCisgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCJmYy1vcG9p bnQtcHJlLXp2LWZhY2UiKSwgdHJ1ZSkKKyA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sIGludGVybiAoImZjLW9wb2ludC1pbmFjdGl2ZS1hdC16di1mYWNlIiks IHRydWUpCisgICAgOiAoZXNzZW50aWFscy0+YWN0aXZlX3AKKyAgICAgICAmJiAhTklMUCAoQlZB UiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAmJiAhTklMUCAo QlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICYmIHctPmN1cnNvci54ID09IGVz c2VudGlhbHMtPmZjX3gpCisgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4g KCJmYy1vcG9pbnQtYXQtenYtZmFjZSIpLCB0cnVlKQorICAgIDogKCFlc3NlbnRpYWxzLT5hY3Rp dmVfcAorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX2lu YWN0aXZlX3dpbmRvd3MpKQorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNh bF9ydWxlcikpCisgICAgICAgJiYgdy0+Y3Vyc29yLnggIT0gZXNzZW50aWFscy0+ZmNfeCkKKyAg ICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoImZjLWluYWN0aXZlLWF0LXp2 LWZhY2UiKSwgdHJ1ZSkKKyAgICA6IChlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAgICAgICYmICFO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICYm ICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgJiYgdy0+Y3Vyc29y LnggIT0gZXNzZW50aWFscy0+ZmNfeCkKKyAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYs IGludGV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KKyAgc3dpdGNoIChhY3Rpb25fdHlwZSkKKyAgeworICAg IGNhc2UgTVVMVElQTEVfQ1VSU09SUzoKKyAgICB7CisgICAgICBzdHJ1Y3QgZnJhbWUgKmYgPSBY RlJBTUUgKHctPmZyYW1lKTsKKyAgICAgIHB0cmRpZmZfdCBjdXJyZW50X2NvbCA9IG1jX2N1cnJl bnRfY29sdW1uICh3LCBwb3NpbnQpOworICAgICAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIg KHctPmNvbnRlbnRzKTsKKyAgICAgIGJvb2wgZmlsbF9jb2x1bW5fcCA9ICFOSUxQIChCVkFSIChi LCBmaWxsX2NvbHVtbikpOworICAgICAgaW50IGZpbGxfY29sID0gKGZpbGxfY29sdW1uX3ApCisg ICAgICAgICAgICAgICAgICAgICA/IFhGSVhOVU0gKEJWQVIgKGIsIGZpbGxfY29sdW1uKSkKKyAg ICAgICAgICAgICAgICAgICAgIDogMDsKKyAgICAgIGVudW0gZmFjZV9pZCBldmVuX2ZhY2VfaWQg PQorICAgICAgICAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICYmICFOSUxQIChCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAg PyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1ldmVuLWluYWN0aXZlLXByZS16 di1mYWNlIiksIHRydWUpCisgICAgICAgIDogbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVy biAoIistZXZlbi1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgIHN0cnVjdCBmYWNlICpldmVu X2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGV2ZW5fZmFjZV9pZCk7CisgICAgICBMaXNwX09iamVj dCBldmVuX2NvbG9yID0gZXZlbl9mYWNlLT5sZmFjZVtMRkFDRV9GT1JFR1JPVU5EX0lOREVYXTsK KyAgICAgI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AgfQor ICAgICAgICAvKiB5ZWxsb3cgKi8KKyAgICAgICAgZWxzZSBpZiAoKCFmaWxsX2NvbHVtbl9wCisg ICAgICAgICAgICAgICAgICAmJiBjdXJyZW50X2NvbCAlIDIgPT0gMAorICAgICAgICAgICAgICAg ICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVikKKyAgICAgICAgICAgICAgICAgfHwgKGZpbGxf Y29sdW1uX3AKKyAgICAgICAgICAgICAgICAgICAgICYmIGN1cnJlbnRfY29sICUgMiA9PSAwCisg ICAgICAgICAgICAgICAgICAgICAmJiBjdXJyZW50X2NvbCA8PSBmaWxsX2NvbAorICAgICAgICAg ICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVikpCisgICAgICAgICAgeworICAg ICAgICAgICAgbHNsX2ZnLT5yZWQgPSBldmVuX2ZvcmVncm91bmQucmVkOworICAgICAgICAgICAg bHNsX2ZnLT5ncmVlbiA9IGV2ZW5fZm9yZWdyb3VuZC5ncmVlbjsKKyAgICAgICAgICAgIGxzbF9m Zy0+Ymx1ZSA9IGV2ZW5fZm9yZWdyb3VuZC5ibHVlOworICAgICAgICAgIH0KKyAgICAgICAgICAv KiBncmVlbiAqLworICAgICAgICAgIGVsc2UgaWYgKGZpbGxfY29sdW1uX3AKKyAgICAgICAgICAg ICAgICAgICAmJiBjdXJyZW50X2NvbCA+IGZpbGxfY29sCisgICAgICAgICAgICAgICAgICAgJiYg cm93X3Bvc2l0aW9uID09IFBSRV9aVikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbHNs X2ZnLT5yZWQgPSBiZXlvbmRfZmlsbF9mb3JlZ3JvdW5kLnJlZDsKKyAgICAgICAgICAgICAgbHNs X2ZnLT5ncmVlbiA9IGJleW9uZF9maWxsX2ZvcmVncm91bmQuZ3JlZW47CisgICAgICAgICAgICAg IGxzbF9mZy0+Ymx1ZSA9IGJleW9uZF9maWxsX2ZvcmVncm91bmQuYmx1ZTsKKyAgICAgICAgICAg IH0KKyAgICAgICAgICAgIGVsc2UgaWYgKHJvd19wb3NpdGlvbiA9PSBBVF9aVikKKyAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgIGxzbF9mZy0+cmVkID0gZXNzZW50aWFscy5zcF9mZy5y ZWQ7CisgICAgICAgICAgICAgICAgbHNsX2ZnLT5ncmVlbiA9IGVzc2VudGlhbHMuc3BfZmcuZ3Jl ZW47CisgICAgICAgICAgICAgICAgbHNsX2ZnLT5ibHVlID0gZXNzZW50aWFscy5zcF9mZy5ibHVl OworICAgICAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBIT1JJWk9O VEFMX1JVTEVSOgorICAgIHsKKyAgICAgIGlmIChnbHlwaCAhPSBOVUxMCisgICAgICAgICAgJiYg Z2x5cGgtPnUuY2ggPT0gOTUKKyAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19IQkFSKQor ICAgICAgICB7CisgICAgICAgICAgbHNsX2ZnLT5yZWQgPSBlc3NlbnRpYWxzLnNwX2ZnLnJlZDsK KyAgICAgICAgICBsc2xfZmctPmdyZWVuID0gZXNzZW50aWFscy5zcF9mZy5ncmVlbjsKKyAgICAg ICAgICBsc2xfZmctPmJsdWUgPSBlc3NlbnRpYWxzLnNwX2ZnLmJsdWU7CisgICAgICAgIH0KKyAg ICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGxzbF9mZy0+cmVkID0gZXNzZW50 aWFscy5jaF9mZ1tyb3dfcG9zaXRpb25dLnJlZDsKKyAgICAgICAgICAgIGxzbF9mZy0+Z3JlZW4g PSBlc3NlbnRpYWxzLmNoX2ZnW3Jvd19wb3NpdGlvbl0uZ3JlZW47CisgICAgICAgICAgICBsc2xf ZmctPmJsdWUgPSBlc3NlbnRpYWxzLmNoX2ZnW3Jvd19wb3NpdGlvbl0uYmx1ZTsKKyAgICAgICAg ICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBWR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gICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVikKKyAgICAg ICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJz b3ItcHJlLXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgOiAoIWVzc2VudGlhbHMuYWN0aXZlX3AK KyAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaW5h Y3RpdmVfd2luZG93cykpCisgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBBVF9aVikKKyAg ICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtl LWN1cnNvci1pbmFjdGl2ZS1hdC16di1mYWNlIiksIHRydWUpCisgICAgICAgIDogKGVzc2VudGlh bHMuYWN0aXZlX3AKKyAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IEFUX1pWKQorICAgICAg ICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNv ci1hdC16di1mYWNlIiksIHRydWUpCisgICAgICAgIDogbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYs IGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1hdC16di1mYWNlIiksIHRydWUpOworICAgICAg c3RydWN0IGZhY2UgKmN1cnNvcl9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBjdXJzb3JfZmFjZV9p ZCk7CisgICAgICBMaXNwX09iamVjdCBjdXJzb3JfY29sb3IgPSBjdXJzb3JfZmFjZS0+bGZhY2Vb TEZBQ0VfRk9SRUdST1VORF9JTkRFWF07CisgICAgICBtY194d19jb2xvcl92YWx1ZXMgKHcsIGN1 cnNvcl9jb2xvciwgbHNsX2ZnKTsKKyAgICAgIGJyZWFrOworICAgIH0KKyAgfQorfQorCisvKiBE cmF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dfcm93 CisgICAgICAgICAgICAgICYmIHJvd192cG9zIDw9IGhsaW5mby0+bW91c2VfZmFjZV9lbmRfcm93 KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBjaGVja19tb3VzZV9mYWNlID0gdHJ1ZTsK KyAgICAgICAgICAgICAgbW91c2VfYmVnX2NvbCA9IChyb3dfdnBvcyA9PSBobGluZm8tPm1vdXNl X2ZhY2VfYmVnX3JvdykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gaGxpbmZvLT5t b3VzZV9mYWNlX2JlZ19jb2wKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogMDsKKyAg ICAgICAgICAgICAgbW91c2VfZW5kX2NvbCA9IChyb3dfdnBvcyA9PSBobGluZm8tPm1vdXNlX2Zh Y2VfZW5kX3JvdykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gaGxpbmZvLT5tb3Vz ZV9mYWNlX2VuZF9jb2wKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogcm93LT51c2Vk W1RFWFRfQVJFQV07CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIC8qIENvbXB1dGUg b3ZlcmhhbmdzIGZvciBhbGwgZ2x5cGggc3RyaW5ncy4gKi8KKyAgICAgIGlmIChGUkFNRV9SSUYg KGYpLT5jb21wdXRlX2dseXBoX3N0cmluZ19vdmVyaGFuZ3MpCisgICAgICAgIGZvciAocyA9IGhl YWQ7IHM7IHMgPSBzLT5uZXh0KQorICAgICAgICAgIEZSQU1FX1JJRiAoZiktPmNvbXB1dGVfZ2x5 cGhfc3RyaW5nX292ZXJoYW5ncyAocyk7CisgICAgICAvKiBQcmVwZW5kIGdseXBoIHN0cmluZ3Mg Zm9yIGdseXBocyBpbiBmcm9udCBvZiB0aGUgZmlyc3QgZ2x5cGgKKyAgICAgIHN0cmluZyB0aGF0 IGFyZSBvdmVyd3JpdHRlbiBiZWNhdXNlIG9mIHRoZSBmaXJzdCBnbHlwaAor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CBieSB3aWRlICJNIiwgZm9sbG93ZWQg YnkgYSBzcGFjZSBhdCB0aGUgZW5kIG9mIHRoZSBnbHlwaCByb3cKKyAgICAgICAgICAod2hpY2gg aGFzIG5vIGJ1ZmZlciBwb3NpdGlvbikuICBXaGVuIHBsYWNpbmcgYSBmYWtlIGN1cnNvciBvbiB0 aGUgIk0iLAorICAgICAgICAgIGhsID09IERSQVdfQ1VSU09SIGFuZCB0aGUgU1RSRVRDSF9HTFlQ SCBpcyBgbGVmdF9vdmVyd3JpdHRlbmAuICBEcmF3aW5nCisgICAgICAgICAgbm9ybWFsIHRleHQg ZHVyaW5nIGB1cGRhdGVfd2luZG93JyAoRFJBV19OT1JNQUxfVEVYVCkgY2FuIGFsc28gZXJhc2Ug ZmFrZQorICAgICAgICAgIGN1cnNvcnMgdGhhdCBhcmUgYGxlZnRfb3ZlcndyaXR0ZW4nLiAqLwor ICAgICAgICAgIGxlbmd0aCA9IDA7CisgICAgICAgICAgZm9yIChzID0gaDsgczsgcyA9IHMtPm5l eHQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHMtPmxlZnRfb3ZlcndyaXR0ZW5fcCA9 IHRydWU7CisgICAgICAgICAgICAgIHMtPmFjdGlvbl90eXBlID0gYWN0aW9uX3R5cGU7CisgICAg ICAgICAgICAgIGxlbmd0aCArPSBzLT5maXJzdF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAg ICAgICB9CisgICAgICAgICAgcmVsYXRpdmVfeCA9IHN0YXJ0X3ggLSBsZW5ndGg7CisgICAgICAg ICAgZm9yIChzID0gaDsgczsgcyA9IHMtPm5leHQpCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIHMtPmZpcnN0X2dseXBoLT5yZWxhdGl2ZV94ID0gcmVsYXRpdmVfeDsKKyAgICAgICAgICAg ICAgcmVsYXRpdmVfeCArPSBzLT5maXJzdF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAg ICB9CisgICAgICAgICAg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b2wgPiBpKQorICAgICAg ICAgICAgb3ZlcmxhcF9obCA9IERSQVdfTU9VU0VfRkFDRTsKKyAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgb3ZlcmxhcF9obCA9IERSQVdfTk9STUFMX1RFWFQ7CisgICAgICAgICAgaWYg KGhsID09IG92ZXJsYXBfaGwgfHwgY2xpcF9oZWFkID09IE5VTEwpCisgICAgICAgICAgICBjbGlw X2hlYWQgPSBoZWFkOworICAgICAgICAgIE1DX0JVSUxEX0dMWVBIX1NUUklOR1MgKGksIHN0YXJ0 LCBoLCB0LCBvdmVybGFwX2hsLCBkdW1teV94LCBsYXN0X3gpOworICAgICAgICAgIGZvciAocyA9 IGg7IHM7IHMgPSBzLT5uZXh0KQorICAgICAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9 IHRydWU7CisgICAgICAgICAgY29tcHV0ZV9vdmVyaGFuZ3NfYW5kX3ggKHQsIGhlYWQtPngsIHRy dWUpOworICAgICAgICAgIHByZXBlbmRfZ2x5cGhfc3RyaW5nX2xpc3RzICgmaGVhZCwgJnRhaWws IGgsIHQpOworICAgICAgICB9CisgICAgICAvKiBBcHBlbmQgZ2x5cGhzIHN0cmluZ3MgZm9yIGds eXBocyBmb2xsb3dpbmcgdGhlIGxhc3QgZ2x5cGgKKyAgICAgIHN0cmluZyB0YWlsIHRoYXQgYXJl IG92ZXJ3cml0dGVuIGJ5IHRhaWwuICBUaGUgYmFja2dyb3VuZCBvZgorICAgICAgdGhlc2Ugc3Ry aW5ncyBoYXMgdG8gYmUgZHJhd24gYmVjYXVzZSB0YWlsJ3MgZm9yZWdyb3VuZCBkcmF3cworICAg ICAgb3ZlciBpdC4gKi8KKyAgICAgIGkgPSByaWdodF9vdmVyd3JpdHRlbiAodGFpbCk7CisgICAg ICBpZiAoaSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNl IG92ZXJsYXBfaGw7CisgICAgICAgICAga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mFja2dyb3VuZAorICAgICAgb2YgdGFpbC4gIFRoZSBi YWNrZ3JvdW5kIG11c3Qgbm90IGJlIGRyYXduIGJlY2F1c2UgaXQgY291bGQKKyAgICAgIHBhaW50 IG92ZXIgdGhlIGZvcmVncm91bmQgb2YgZm9sbG93aW5nIGdseXBocy4gKi8KKyAgICAgIGkgPSBy aWdodF9vdmVyd3JpdGluZyAodGFpbCk7CisgICAgICBpZiAoaSA+PSAwKQorICAgICAgICB7Cisg ICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIG92ZXJsYXBfaGw7CisgICAgICAgICAgaWYg KGNoZWNrX21vdXNlX2ZhY2UKKyAgICAgICAgICAgICAgJiYgbW91c2VfYmVnX2NvbCA8IGkgJiYg bW91c2VfZW5kX2NvbCA+IGVuZCkKKyAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX01PVVNF X0ZBQ0U7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFX X05PUk1BTF9URVhUOworICAgICAgICAgIGlmIChobCA9PSBvdmVybGFwX2hsIHx8IGNsaXBfdGFp bCA9PSBOVUxMKQorICAgICAgICAgICAgY2xpcF90YWlsID0gdGFpbDsKKyAgICAgICAgICBpKys7 ICAgICAgLyogV2UgbXVzdCBpbmNsdWRlIHRoZSBJdGggZ2x5cGguICovCisgICAgICAgICAgTUNf QlVJTERfR0xZUEhfU1RSSU5HUyAoZW5kLCBpLCBoLCB0LCBvdmVybGFwX2hsLCB4LCBsYXN0X3gp OworICAgICAgICAgIGZvciAocyA9IGg7IHM7IHMgPSBzLT5uZXh0KQorICAgICAgICAgICAgcy0+ YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICAgICAgY29tcHV0ZV9vdmVyaGFuZ3Nf YW5kX3ggKGgsIHRhaWwtPnggKyB0YWlsLT53aWR0aCwgZmFsc2UpOworICAgICAgICAgIGFwcGVu ZF9nbHlwaF9zdHJpbmdfbGlzdHMgKCZoZWFkLCAmdGFpbCwgaCwgdCk7CisgICAgICAgIH0KKyAg ICAgIHRhaWwgPSBnbHlwaF9zdHJpbmdfY29udGFpbmluZ19iYWNrZ3JvdW5kX3dpZHRoICh0YWls KTsKKyAgICAgIGlmIChjbGlwX3RhaWwpCisgICAgICAgIGNsaXBfdGFpbCA9IGdseXBoX3N0cmlu Z19jb250YWluaW5nX2JhY2tncm91bmRfd2lkdGggKGNsaXBfdGFpbCk7CisgICAgICBpZiAoY2xp cF9oZWFkIHx8IGNsaXBfdGFpbCkKKyAgICAgICAgZm9yIChzID0gaGVhZDsgczsgcyA9IHMtPm5l eHQpCisgICAgICAgICAgeworICAgICAgICAgICAgcy0+Y2xpcF9oZWFkID0gY2xpcF9oZWFkOwor ICAgICAgICAgICAgcy0+Y2xpcF90YWlsID0gY2xpcF90YWlsOworICAgICAgICAgIH0KKyAgICB9 CisgIC8qIERyYXcgYWxsIHN0cmluZ3MuICovCisgIGZvciAocyA9IGhlYWQ7IHMgJiYgZHJhd19w OyBzID0gcy0+bmV4dCkKKyAgICBGUkFNRV9SSUYgKGYpLT5tY19zY3JpYmVfc3RyaW5nIChzLCBt YXRyaXgsIHJvdywgbHNsLCBnbHlwaF9mbGF2b3IsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOworI2lm bmRlZiBIQVZFX05TCisgIC8qIFdoZW4gZm9jdXMgYSBzb2xlIGZyYW1lIGFuZCBtb3ZlIGhvcml6 b250YWxseSwgdGhpcyBjbGVhcnMgb25fcAorICAgICBjYXVzaW5nIGEgZmFpbHVyZSB0byBlcmFz ZSBwcmV2IGN1cnNvciBwb3NpdGlvbi4gKi8KKyAgaWYgKGFyZWEgPT0gVEVYVF9BUkVBCisgICAg ICAmJiAhcm93LT5mdWxsX3dpZHRoX3AKKyAgICAgIC8qIFdoZW4gZHJhd2luZyBvdmVybGF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cm4geF9yZWFjaGVkOworfQorCisvKiBEcmF3IHRoZSBjdXJz b3IgZ2x5cGggb2Ygd2luZG93IFcgaW4gZ2x5cGggcm93IFJPVy4gIFNlZSB0aGUKKyAgIGNvbW1l bnQgb2YgZHJhd19nbHlwaHMgZm9yIHRoZSBtZWFuaW5nIG9mIEhMLiAqLwordm9pZAorbWNfZHJh d19jdXJzb3JfZ2x5cGggKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1h dHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAgICAgICAgICAgIGVudW0g ZHJhd19nbHlwaHNfZmFjZSBobCwgaW50IHgsIGludCBocG9zLCBpbnQgdnBvcywKKyAgICAgICAg ICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbCwgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxh dm9yLAorICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5 cGUsIGludCB3ZCwgYm9vbCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICBib29sIGN1 cnNvcl9nY19wKQoreworICAvLyAgc3RydWN0IGdseXBoICpjdXJzb3JfZ2x5cGggPSBtY19nZXRf Y3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywgaHBvcywgdnBvcyk7CisgIC8vICBmcHJpbnRm IChzdGRlcnIsICJtY19kcmF3X2N1cnNvcl9nbHlwaDogIGNoICglZCkgfCB4ICglZCksIGhwb3Mg KCVkKSwgdnBvcyglZCksIGhsICglZClcbiIsCisgIC8vICAgICAgICAgICAgICAgICAgICBjdXJz b3JfZ2x5cGgtPnUuY2gsIHgsIGhwb3MsIHZwb3MsIGhsKTsKKyAgYmxvY2tfaW5wdXQgKCk7Cisg IGJvb2wgZHJhd19wID0gdHJ1ZTsKKyAgbWNfZHJhd19nbHlwaHMgKHcsIG1hdHJpeCwgcm93LCB4 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CAibWNfZXJhc2Vf Y3Vyc29yOiAgcmV0dXJuICglZClcbiIsIDEpOworICAgICAgcmV0dXJuOworICAgIH0KKyAgLyog VlBPUyA+PSBtYXRyaXgtPm5yb3dzIG1lYW5zIHRoYXQgd2luZG93IGhhcyBiZWVuIHJlc2l6ZWQu CisgICAgIERvbid0IGJvdGhlciB0byBlcmFzZSB0aGUgY3Vyc29yLiAqLworICBpZiAodnBvcyA+ PSBtYXRyaXgtPm5yb3dzKQorICAgIHsKKyAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICBmcHJp bnRmIChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6ICByZXR1cm4gKCVkKVxuIiwgMik7CisgICAg ICByZXR1cm47CisgICAgfQorICAvKiBJZiByb3cgY29udGFpbmluZyBjdXJzb3IgaXMgbWFya2Vk IGludmFsaWQsIHRoZXJlIGlzIG5vdGhpbmcgd2UKKyAgICAgY2FuIGRvLiAqLworICBpZiAoIXJv dy0+ZW5hYmxlZF9wKQorICAgIHsKKyAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICBmcHJpbnRm IChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6ICByZXR1cm4gKCVkKVxuIiwgMyk7CisgICAgICBy ZXR1cm47CisgICAgfQorICAvKiBJZiBsaW5lIHNwYWNpbmcgaXMgPiAwLCBvbGQgY3Vyc29yIG1h eSBvbmx5IGJlIHBhcnRpYWxseSB2aXNpYmxlIGluCisgICAgIHdpbmRvdyBhZnRlciBzcGxpdC13 aW5kb3cuICBTbyBhZGp1c3QgdmlzaWJsZSBoZWlnaHQuICovCisgIHJvdy0+dmlzaWJsZV9oZWln aHQgPSBtaW4gKHJvdy0+dmlzaWJsZV9oZWlnaHQsCisgICAgICAgICAgICB3aW5kb3dfdGV4dF9i b3R0b21feSAodykgLSByb3ctPnkpOworICAvKiBJZiByb3cgaXMgY29tcGxldGVseSBpbnZpc2li bGUsIGRvbid0IGF0dGVtcHQgdG8gZGVsZXRlIGEgY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QorICAgICAgLyogRG9uJ3QgcmVkcmF3IHRo ZSBjdXJzb3IncyBzcG90IGluIG1vdXNlIGZhY2UgaWYgaXQgaXMgYXQgdGhlCisgICAgICBlbmQg b2YgYSBsaW5lIChvbiBhIG5ld2xpbmUpLiAgVGhlIGN1cnNvciBhcHBlYXJzIHRoZXJlLCBidXQK KyAgICAgIG1vdXNlIGhpZ2hsaWdodGluZyBkb2VzIG5vdC4gKi8KKyAgICAgICYmIHJvdy0+dXNl ZFtURVhUX0FSRUFdID4gaHBvcyAmJiBocG9zID49IDApCisgICAgbW91c2VfZmFjZV9oZXJlX3Ag PSB0cnVlOworICAvKiBNYXliZSBjbGVhciB0aGUgZGlzcGxheSB1bmRlciB0aGUgY3Vyc29yLiAq LworICBpZiAoY3Vyc29yX3R5cGUgPT0gTUNfSE9MTE9XX0JPWAorICAgICAgfHwgY3Vyc29yX3R5 cGUgPT0gTUNfRlJBTUVEX0JPWCkKKyAgICB7CisgICAgICBpbnQgdGVtcF94ID0geDsKKyAgICAg IGludCBoZWFkZXJfbGluZV9oZWlnaHQgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsK KyAgICAgIGN1cnNvcl9nbHlwaCA9IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93 LCBocG9zLCB2cG9zKTsKKyAgICAgIGlmIChjdXJzb3JfZ2x5cGggPT0gTlVMTCkKKyAgICAgICAg eworICAgICAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAi bWNfZXJhc2VfY3Vyc29yOiAgcmV0dXJuICglZClcbiIsIDcpOworICAgICAgICAgIHJldHVybjsK KyAgICAgICAgfQorICAgICAgaW50IHRlbXBfd2QgPSBjdXJzb3JfZ2x5cGgtPnBpeGVsX3dpZHRo OworICAgICAgaWYgKHRlbXBfeCA8IDApCisgICAgICAgIHsKKyAgICAgICAgICB0ZW1wX3dkICs9 IHRlbXBfeDsKKy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0IChyb3cgPj0gMCAmJiByb3cgPCBtYXRyaXgtPm5yb3dz KTsgKi8KKyAgYm9vbCBiYXJmX2NyYXNoX29uZSA9IChtYXRyaXggJiYgbWF0cml4LT5yb3dzKSA/ IGZhbHNlIDogdHJ1ZTsKKyAgaWYgKGJhcmZfY3Jhc2hfb25lKQorICAgIHJldHVybjsKKyAgYm9v bCBiYXJmX2NyYXNoX3R3byA9ICh2cG9zID49IDAgJiYgdnBvcyA8IG1hdHJpeC0+bnJvd3MpID8g ZmFsc2UgOiB0cnVlOworICBpZiAoYmFyZl9jcmFzaF90d28pCisgICAgcmV0dXJuOworICBpZiAo eCA8IDAKKyAgICAgIHx8IHkgPCAwCisgICAgICB8fCBocG9zIDwgMAorICAgICAgfHwgdnBvcyA8 IDApCisgICAgcmV0dXJuOworICBib29sIGF1dG9faHNjcm9sbF9tb2RlX3AgPSBFUSAoRmJ1ZmZl cl9sb2NhbF92YWx1ZSAoUWF1dG9faHNjcm9sbF9tb2RlLCB3LT5jb250ZW50cyksIFFjdXJyZW50 X2xpbmUpOworICAvKiBFWEFNUExFOiAgKHNjcm9sbC1sZWZ0IDUpICovCisgIGJvb2wgaHNjbF9h bGxfdGVtcF9wID0gKHctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hz Y3JvbGwgPT0gMCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIG5vdGhpbmcuICov CisgIGJvb2wgaHNjbF9hbGxfcGVybV8wX3AgPSAody0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSB3LT5oc2Nyb2xsKTsKKyAgLyogRVhBTVBMRTogIEMt dSBDLXggPCBhbmQgZG8gc29tZXRoaW5nIGVsc2UgYmVzaWRlcyBob3Jpem9udGFsbHkgc2Nyb2xs aW5nIHRoZQorICAgICAgICAgICAgICAgY3VycmVudCBsaW5lIGRpZmZlcmVudGx5LgorICAgICAg ICAgICAgICAgQ3VycmVudCBsaW5lIGlzIF9ub3RfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZm ZXJlbnRseS4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzFfcCA9ICghdy0+c3VzcGVuZF9hdXRv X2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9k ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSB3LT5oc2Nyb2xsKTsKKyAgLyog RVhBTVBMRTogIEMtdSBDLXggPCBhbmQgLi4uCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUg aXMgX25vdF8gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhz Y2xfYWxsX3Blcm1fMl9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID09IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5taW5faHNjcm9sbCAhPSB3LT5oc2Nyb2xsKTsKKyAgLyogRVhBTVBMRTogIChzY3JvbGwtbGVm dCA1KTsgYW5kLCB0aGVuIHByZXNzIHRoZSBsZWZ0IGFycm93IGtleSBvbmUgdGltZS4KKyAgICAg ICAgICAgICAgIEN1cnJlbnQgbGluZSBfaXNfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJl bnRseS4qLworICBib29sIGhzY2xfdGVtcF9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAor ICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICYmIHct Pm1pbl9oc2Nyb2xsID09IDApOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBzb21l dGhpbmcgdGhhdCBjYXVzZXMgdGhlIGN1cnJlbnQgbGluZSB0byBiZQorICAgICAgICAgICAgICAg aG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LgorICAgICAgICAgICAgICAgQ3VycmVu dCBsaW5lIF9pc18gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29s IGhzY2xfcGVybV9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAg ICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4g MAorICAgICAgICAgICAgICAgICAgICAgIC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2xfYWxsX3Bl cm1fMF9wCisgICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxsX3Blcm1fMV9wCisgICAgICAgICAg ICAgICAgIHx8IGhzY2xfYWxsX3Blcm1fMl9wCisgICAgICAgICAgICAgICAgIHx8IGhzY2xfdGVt cF9wCisgICAgICAgICAgICAgICAgIHx8IGhzY2xfcGVybV9wKSkKKyAgICAgIHsKKyAgICAgICAg ZW51bSBmYWNlX2lkIG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICAgKCFhY3RpdmVf cAorICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF9p bmFjdGl2ZV93aW5kb3dzKSkpCisgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwg aW50ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtaW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwgdHJ1 ZSkKKyAgICAgICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAgICAgID8gbG9va3VwX25hbWVkX2Zh Y2UgKHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1oc2NsLXByZS16di1mYWNlIiksIHRy dWUpCisgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgIGZhY2VfaWQgPSAoY3Vy c29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgPyBv dmVybGF5X2Fycm93X2ZhY2VfaWQKKyAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lE OworICAgICAgICBpZiAoaHNjbF9hbGxfcGVybV8wX3ApCisgICAgICAgICAgZnJpbmdlX2JpdG1h cCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCBmYWxz ZSwgZmFsc2UpOworICAgICAgICAgIGVsc2UgaWYgKGhzY2xfYWxsX3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SBNQ19IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9 PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX2hvbGxvd19yZWN0YW5n bGVfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAo Z2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEUpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBRbWNfaG9sbG93X3JlY3RhbmdsZQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxf QkFSX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gUW1jX3ZlcnRpY2FsX2Jhcl9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFS X1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g UW1jX3JldmVyc2VkX3ZlcnRpY2FsX2Jhcl9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jh cgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3Ig PT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX3ZlcnRpY2FsX2JhcgorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFS X0JBQ0tTTEFTSCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFt Y192ZXJ0aWNhbF9iYXJfYmFja3NsYXNoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogUW5pbDsKKyAgICAgICAgICBmcmluZ2VfYml0bWFwID0gKGN1cnNvcl90eXBlID09 IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAgID8gbG9v a3VwX2ZyaW5nZV9iaXRtYXAgKGJpdG1hcF9mbGF2b3IpCisgICAgICAgICAgICAgICAgICAgICAg ICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICBmYWNlX2lkID0gKGN1cnNvcl90 eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgICAgICYmIChn bHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVwor ICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9W RVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlw aF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKSkKKyAgICAgICAgICAgICAgICAg ICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJldmVyc2VkLWJhci1w cmUtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9 PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBo X2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAg ICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNB TF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9y ICE9IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgICAgICA/IGxv b2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLWJhci1wcmUtenYtZmFjZSIpLCB0cnVl KQorICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICByb3ct PmN1cnNvcl9pbl9mcmluZ2VfcCA9IGZhbHNlOworICAgICAgICAgIHJvdy0+cmlnaHRfZnJpbmdl X2JpdG1hcCA9IGZyaW5nZV9iaXRtYXA7CisgICAgICAgICAgcm93LT5yaWdodF9mcmluZ2VfZmFj ZV9pZCA9IGZhY2VfaWQ7CisgICAgICAgICAgcm93LT5yaWdodF9mcmluZ2Vfb2Zmc2V0ID0gMDsK KyAgICAgICAgICByb3ctPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcCA9IGZhbHNlOworICAgICAg ICAgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcCAodywgcm93LCBmYWxzZSwgY3Vyc29yX3R5cGUpOwor ICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSAorICAg ICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEhMRVNTKQorICAgICAgICAg IHsKKyAgICAgICAgICAgIGJvb2wgb25fcCA9IHRydWU7CisgICAgICAgICAgICBGUkFNRV9SSUYg KGYpLT5tY19zY3JpYmVfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9z LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdnBvcywgd2Qs IGgsIGxzbCwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIGdseXBoX2ZsYXZvciwgb25fcCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2ZV9wKTsKKyAgICAgICAgICB9 Cit9CisKKy8qIER1bXAgY29udGVudHMgb2YgZ2x5cGggR0xZUEggdG8gc3RkZXJyLiAgUk9XIGFu ZCBBUkVBIGFyZQorICAgdGhlIGdseXBoIHJvdyBhbmQgYXJlYSB3aGVyZSB0aGUgZ2x5cGggY29t ZXMgZnJvbS4gKi8KK3ZvaWQKK21jX2R1bXBfZ2x5cGggKHN0cnVjdCBnbHlwaF9yb3cgKnJvdywg c3RydWN0IGdseXBoICpnbHlwaCwgaW50IGFyZWEsCisgICAgICAgICAgICAgICBpbnQgcmVsYXRp dmVfeCwgaW50IHZwb3MpCit7CisgIGJvb2wgZ2x5cGhfenZfcCA9IChnbHlwaCAtIHJvdy0+Z2x5 cGhzW2FyZWFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICYm IE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgPT0gWlYpOworICBpZiAoZ2x5cGgtPnR5cGUg PT0gQ0hBUl9HTFlQSAorICAgICAgfHwgZ2x5cGgtPnR5cGUgPT0gR0xZUEhMRVNTX0dMWVBIKQor ICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIiAlNSJwRCJkLyUtNWQgJTVk ICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4xZCAgJTNkICVzICVzXG4iLAor ICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51 c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxh dGl2ZV94LAorICAgICAgICAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgPyAn QycKKyAgICAgICAgIDogJ0cnKSwKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChC VUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNUUklO R1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgOiAoTklM UCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAgICA6 ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICBnbHlwaC0+dS5j aCwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5l X3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+aHBv cywgZ2x5cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAo Z2x5cGgtPnUuY2gpKTsKKyAgICB9CisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IFNUUkVUQ0hf R0xZUEgpCisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBEImQv JS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICAlM2QgJXMg JXNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAg KChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAg ICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdTJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisg ICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnQicKKyAgICAg ICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAg ICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnMCcKKyAgICAgICAg ICA6ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAwdSwKKyAg ICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisg ICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+aHBvcywgZ2x5 cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAiXFxTIik7CisgICAgfQorICBlbHNlIGlm IChnbHlwaC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkKKyAgICB7CisgICAgICBmcHJpbnRmIChzdGRl cnIsCisgICAgICAgICIgJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNngg JTRkICUxLjFkJTEuMWQgICUzZCAlcyAlY1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBo c1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ct PnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ0knLAorICAg ICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisg ICAgICAgICAgICA/ICdCJworICAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisg ICAgICAgICAgICA/ICdTJworICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAg ICAgICAgICA/ICcwJworICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxf d2lkdGgsCisgICAgICAgICh1bnNpZ25lZCBpbnQpIGdseXBoLT51LmltZ19pZCwKKyAgICAgICAg Z2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAg IGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+aHBvcywgZ2x5cGhfenZf cCA/ICJaViIgOiAiLS0iLAorICAgICAgICAnLicpOworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgt PnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwK KyAgICAgICAgIiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCIsCisg ICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVz ZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0 aXZlX3gsCisgICAgICAgICcrJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChC VUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnQicKKyAgICAgICAgICA6IChT VFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICA6IChO SUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICA6ICctJykp KSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAodW5zaWduZWQgaW50KSBn bHlwaC0+dS5jbXAuaWQpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICU0ZCAlMS4xZCUxLjFk IiwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5l X3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wKTsKKyAgICAgIGlmIChnbHlwaC0+ dS5jbXAuYXV0b21hdGljKQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIgICUzZCAlcyAuIFsl ZC0lZF1cbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGgtPmhwb3MsIGdseXBoX3p2 X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaC0+c2xpY2Uu Y21wLmZyb20sIGdseXBoLT5zbGljZS5jbXAudG8pOworICAgICAgICBlbHNlCisgICAgICAgIGZw cmludGYgKHN0ZGVyciwgIlxuIik7CisgICAgfQorICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBY V0lER0VUX0dMWVBIKQorICAgIHsKKyNpZm5kZWYgSEFWRV9YV0lER0VUUworICAgICAgZWFzc3Vt ZSAoZmFsc2UpOworI2Vsc2UKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIiAgJTVk LyUtNWQgJTVkICU0YyAlNmQgJWMgJTNkIDB4JTA1eCAlNGQgJTEuMWQlMS4xZCAgJTNkICVzICVj XG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgo cm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAg ICByZWxhdGl2ZV94LAorICAgICAgICAnWCcsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAg ICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgPyAnQicKKyAgICAgICAg IDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAg OiAnLScpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICBnbHlwaC0+ZmFj ZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJp Z2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT51Lnh3aWRnZXQsCisgICAgICAgIGdseXBo LT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7CisjZW5kaWYK KyAgICB9Cit9CisKKy8qIER1bXAgdGhlIGNvbnRlbnRzIG9mIGdseXBoIHJvdyBhdCBWUE9TIGlu IE1BVFJJWCB0byBzdGRlcnIuCisgICBHTFlQSFMgMCBtZWFucyBkb24ndCBzaG93IGdseXBoIGNv bnRlbnRzLgorICAgR0xZUEhTIDEgbWVhbnMgc2hvdyBnbHlwaHMgaW4gc2hvcnQgZm9ybQorICAg R0xZUEhTID4gMSBtZWFucyBzaG93IGdseXBocyBpbiBsb25nIGZvcm0uICovCit2b2lkCittY19k dW1wX2dseXBoX3JvdyAoc3RydWN0IGdseXBoX3JvdyAqcm93LCBpbnQgdnBvcywgaW50IGdseXBo cykKK3sKKyAgaW50IHJlbGF0aXZlX3ggPSAwOworICBpZiAoZ2x5cGhzICE9IDEpCisgICAgewor ICAgICAgZnByaW50ZiAoc3RkZXJyLCAiXG5EVU1QIEdMWVBIIFJPV1xuIik7CisgICAgICBmcHJp bnRmIChzdGRlcnIsICJSb3cgICAgIFN0YXJ0ICAgICAgIEVuZCBVc2VkIG9FPjxcXENUWkZlc20g ICAgIFggICAgWSAgICBXICAgIEggICAgViAgICBBICAgIFBcbiIpOworICAgICAgZnByaW50ZiAo c3RkZXJyLCAiPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4iKTsKKyAgICAgIGZwcmludGYgKHN0ZGVy ciwgIiUzZCAlOSJwRCJkICU5InBEImQgJTRkICUxLjFkJTEuMWQlMS4xZCUxLjFkXAorJTEuMWQl MS4xZCUxLjFkJTEuMWQlMS4xZCUxLjFkJTEuMWQlMS4xZCAgJTRkICU0ZCAlNGQgJTRkICU0ZCAl NGQgJTRkXG4iLAorICAgICAgICAgdnBvcywKKyAgICAgICAgIE1BVFJJWF9ST1dfU1RBUlRfQ0hB UlBPUyAocm93KSwKKyAgICAgICAgIE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdyksCisgICAg ICAgICByb3ctPnVzZWRbVEVYVF9BUkVBXSwKKyAgICAgICAgIHJvdy0+Y29udGFpbnNfb3Zlcmxh cHBpbmdfZ2x5cGhzX3AsCisgICAgICAgICByb3ctPmVuYWJsZWRfcCwKKyAgICAgICAgIHJvdy0+ dHJ1bmNhdGVkX29uX2xlZnRfcCwKKyAgICAgICAgIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3As CisgICAgICAgICByb3ctPmNvbnRpbnVlZF9wLAorICAgICAgICAgTUFUUklYX1JPV19DT05USU5V QVRJT05fTElORV9QIChyb3cpLAorICAgICAgICAgTUFUUklYX1JPV19ESVNQTEFZU19URVhUX1Ag KHJvdyksCisgICAgICAgICByb3ctPmVuZHNfYXRfenZfcCwKKyAgICAgICAgIHJvdy0+ZmlsbF9s aW5lX3AsCisgICAgICAgICByb3ctPmVuZHNfaW5fbWlkZGxlX29mX2NoYXJfcCwKKyAgICAgICAg IHJvdy0+c3RhcnRzX2luX21pZGRsZV9vZl9jaGFyX3AsCisgICAgICAgICByb3ctPm1vdXNlX2Zh Y2VfcCwKKyAgICAgICAgIHJvdy0+eCwKKyAgICAgICAgIHJvdy0+eSwKKyAgICAgICAgIHJvdy0+ cGl4ZWxfd2lkdGgsCisgICAgICAgICByb3ctPmhlaWdodCwKKyAgICAgICAgIHJvdy0+dmlzaWJs ZV9oZWlnaHQsCisgICAgICAgICByb3ctPmFzY2VudCwKKyAgICAgICAgIHJvdy0+cGh5c19hc2Nl bnQpOworICAgICAgLyogVGhlIG5leHQgMyBsaW5lcyBzaG91bGQgYWxpZ24gdG8gIlN0YXJ0IiBp biB0aGUgaGVhZGVyLiAqLworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICAgICU5InBEImQgJTki cEQiZFx0JTVkXG4iLCByb3ctPnN0YXJ0Lm92ZXJsYXlfc3RyaW5nX2luZGV4LAorICAgICAgICAg cm93LT5lbmQub3ZlcmxheV9zdHJpbmdfaW5kZXgsCisgICAgICAgICByb3ctPmNvbnRpbnVhdGlv bl9saW5lc193aWR0aCk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgICAgJTkicEQiZCAlOSJw RCJkXG4iLAorICAgICAgICAgQ0hBUlBPUyAocm93LT5zdGFydC5zdHJpbmdfcG9zKSwKKyAgICAg ICAgIENIQVJQT1MgKHJvdy0+ZW5kLnN0cmluZ19wb3MpKTsKKyAgICAgIGZwcmludGYgKHN0ZGVy ciwgIiAgICAlOWQgJTlkXG4iLCByb3ctPnN0YXJ0LmRwdmVjX2luZGV4LAorICAgICAgICAgcm93 LT5lbmQuZHB2ZWNfaW5kZXgpOworICAgIH0KKyAgaWYgKGdseXBocyA+IDEpCisgICAgeworICAg ICAgZm9yIChpbnQgYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFyZWEgPCBMQVNUX0FSRUE7ICsr YXJlYSkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSByb3ctPmds eXBoc1thcmVhXTsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoX2VuZCA9IGdseXBoICsg cm93LT51c2VkW2FyZWFdOworICAgICAgICAgIC8qIEdseXBoIGZvciBhIGxpbmUgZW5kIGluIHRl eHQuICovCisgICAgICAgICAgaWYgKGFyZWEgPT0gVEVYVF9BUkVBICYmIGdseXBoID09IGdseXBo X2VuZCAmJiBnbHlwaC0+Y2hhcnBvcyA+IDApCisgICAgICAgICAgICArK2dseXBoX2VuZDsKKyAg ICAgICAgICBpZiAoZ2x5cGggPCBnbHlwaF9lbmQpCisgICAgICAgICAgICBmcHJpbnRmIChzdGRl cnIsICJHbHlwaCMvVG90YWwgUmVsLlggVCAgICAgICBQb3MgTyAgIFcgICAgIENvZGUgRmFjZSBM UiBIUE9TIFpWIENcbiIpOworICAgICAgICAgIGZvciAoOyBnbHlwaCA8IGdseXBoX2VuZDsgKytn bHlwaCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbWNfZHVtcF9nbHlwaCAocm93LCBn bHlwaCwgYXJlYSwgcmVsYXRpdmVfeCwgdnBvcyk7CisgICAgICAgICAgICAgIHJlbGF0aXZlX3gg Kz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQor ICAgIGVsc2UgaWYgKGdseXBocyA9PSAxKQorICAgICAgeworICAgICAgICBjaGFyIHNbU0hSVF9N QVggKyA0XTsKKyAgICAgICAgZm9yIChpbnQgYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFyZWEg PCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpbnQgaTsKKyAg ICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCByb3ctPnVzZWRbYXJlYV07ICsraSkKKyAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSByb3ctPmdseXBo c1thcmVhXSArIGk7CisgICAgICAgICAgICAgICAgaWYgKGkgPT0gcm93LT51c2VkW2FyZWFdIC0g MQorICAgICAgICAgICAgICAgICAgICAmJiBhcmVhID09IFRFWFRfQVJFQQorICAgICAgICAgICAg ICAgICAgICAmJiBOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgICAgICAgICAmJiBn bHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT51 LmNoID09ICcgJykKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc3Ry Y3B5ICgmc1tpXSwgIltcXG5dIik7CisgICAgICAgICAgICAgICAgICAgIGkgKz0gNDsKKyAgICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGdseXBoLT50eXBlID09 IENIQVJfR0xZUEgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT51LmNoIDwg MHg4MAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGgtPnUuY2ggPj0gJyAnKQor ICAgICAgICAgICAgICAgICAgICBzW2ldID0gZ2x5cGgtPnUuY2g7CisgICAgICAgICAgICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICBzW2ldID0gJy4nOworICAgICAgICAgICAg ICB9CisgICAgICAgICAgICBzW2ldID0gJ1wwJzsKKyAgICAgICAgICAgIGZwcmludGYgKHN0ZGVy ciwgIiUzZDogKCVkKSAnJXMnXG4iLCB2cG9zLCByb3ctPmVuYWJsZWRfcCwgcyk7CisgICAgICAg ICAgfQorICAgICAgfQorfQorCitERUZVTiAoIm1jLWR1bXAtZ2x5cGgtcm93IiwgRm1jX2R1bXBf Z2x5cGhfcm93LCBTbWNfZHVtcF9nbHlwaF9yb3csIDEsIDIsICJQIiwKKyAgICAgICBkb2M6IC8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bWNfY2FjaGVfdHlwZSBjYWNoZV90 eXBlLAorICAgICAgICAgICAgICAgICAgICAgaW50IHZudGgsIGludCBudGgpCit7CisgIGlmICh2 bnRoIDwgbWF0cml4LnZwb3NfdXNlZAorICAgICAgJiYgbWF0cml4LmN1cnNvcnNfdXNlZFtjYWNo ZV90eXBlXSA+IDAKKyAgICAgICYmIG50aCA8IG1hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRb Y2FjaGVfdHlwZV0pCisgICAgcmV0dXJuIHRydWU7CisgICAgZWxzZQorICAgICAgcmV0dXJuIGZh bHNlOworfQorCit2b2lkCittY19yZXNldF9jYWNoZSAoc3RydWN0IHdpbmRvdyAqdykKK3sKKyAg aWYgKCFCVUZGRVJQICh3LT5jb250ZW50cykpCisgICAgcmV0dXJuOworICBmb3IgKGVudW0gbWNf Y2FjaGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7CisgICAgICAgY2FjaGVfdHlwZSA8IE5P X0NBQ0hFOworICAgICAgICsrY2FjaGVfdHlwZSkKKyAgICB7CisgICAgICBib29sIGJ2YXJfYWN0 aXZlX3A7CisgICAgICBzd2l0Y2ggKGNhY2hlX3R5cGUpCisgICAgICAgIHsKKyAgICAgICAgICBj YXNlIE5PX0NBQ0hFOgorICAgICAgICAgICAgeworICAgICAgICAgICAgICByZXR1cm47CisgICAg ICAgICAgICB9CisgICAgICAgICAgY2FzZSBNQ19DQUNIRToKKyAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgJiYg TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkpCisgICAgICAgICAg ICAgICAgYnZhcl9hY3RpdmVfcCA9IGZhbHNlOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKEJV RkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkKKyAgICAgICAgICAgICAgICAg IGJ2YXJfYWN0aXZlX3AgPSB0cnVlOworICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAg IH0KKyAgICAgICAgICBjYXNlIENIX0NBQ0hFOgorICAgICAgICAgICAgeworICAgICAgICAgICAg ICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAmJiBOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICAgICAgICAgICAg ICBidmFyX2FjdGl2ZV9wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoQlVGRkVS UCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgICAgICAgICAgICAgICAg YnZhcl9hY3RpdmVfcCA9IHRydWU7CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAg fQorICAgICAgICAgIGNhc2UgRkNfQ0FDSEU6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAg IGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICYmIE5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpKQorICAgICAgICAgICAgICAg IGJ2YXJfYWN0aXZlX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBlbHNlIGlmIChCVUZGRVJQ ICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpCisgICAgICAgICAgICAgICAgICBi dmFyX2FjdGl2ZV9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9 CisgICAgICAgIH0KKyAgICAgIGlmICghYnZhcl9hY3RpdmVfcCkKKyAgICAgICAgeworICAgICAg ICAgIC8qIERlY3JlYXNlIHRoZSBzaXplIG9mIHRoZSBhcnJheSB0byBhIGJhcmUgbWluaW11bS4g Ki8KKyAgICAgICAgICBmb3IgKGludCB2bnRoID0gMDsgdm50aCA8IHctPm1jX21hdHJpeC52cG9z X3VzZWQ7ICsrdm50aCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKHctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlX2FsbG9jYXRlZFtjYWNoZV90eXBlXSA+IDEpCisgICAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV0gPQorICAgICAgICAgICAgICAgICAgICB4bnJlYWxsb2MgKHctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdLCAxLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHNpemVvZiAqdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV0pOworICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVf YWxsb2NhdGVkW2NhY2hlX3R5cGVdID0gMTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAg ICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV0gPSAwOwor ICAgICAgICAgICAgfQorICAgICAgICAgIHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVf dHlwZV0gPSAwOworICAgICAgICB9CisgICAgICAgIC8vICBBbHRob3VnaCBpdCB3b3VsZCBub3Qg YmUgdmVyeSBlZmZpY2llbnQsIGl0IGlzIHBvc3NpYm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A7CisgICAgICAgICAgfQorICAgIH0KK30KKworc3RhdGljIHZvaWQKK21jX2hlbHBlciAoc3Ry dWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhf cm93ICpyb3csCisgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGgsIGludCB4LCBpbnQgZngs IGludCB5LCBpbnQgZnksIGludCBocG9zLCBpbnQgdnBvcywKKyAgICAgICAgICAgaW50IHdkLCBp bnQgaCwgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSwgaW50IGN1cnNvcl93aWR0aCwK KyAgICAgICAgICAgZW51bSBtY19yb3dfcG9zaXRpb24gcm93X3Bvc2l0aW9uLCBzdHJ1Y3QgbWNf UkdCIGZvcmVncm91bmQsCisgICAgICAgICAgIHN0cnVjdCBtY19SR0IgYmFja2dyb3VuZCwgYm9v bCBhY3RpdmVfcCwgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yLAorICAgICAgICAgICBib29s IGRyYXdfcCwgZW51bSBtY19kcmF3X3Jvd190eXBlIGZyb21fd2hlcmUsCisgICAgICAgICAgIGVu dW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlLCBlbnVtIG1jX2VuZ2luZV90eXBlIGFjdGlvbl90 eXBlKQoreworICBpbnQgdm50aCA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICBp ZiAobWNfc3RkZXJyX3AKKyAgICAgICYmIGRyYXdfcCkKKyAgICB7CisgICAgICBpbnQgY2hhcnBv cyA9IGdseXBoLT5jaGFycG9zOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiXG5tY19oZWxwZXIg KCVzKTogIGZyb21fd2hlcmUgKCVzKVxuXAorICBhY3Rpb25fdHlwZSAoJXMpIHwgZmxhdm9yICgl cykgfCBjaGFycG9zICglZClcblwKKyAgY2hhciAoJXMpIHwgeCAoJWQpIHwgZnggK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0NVUlNPUl9UV08pKQorICAgIHsKKyAgICAgIGJvb2wgc2FtZV9wID0gZmFsc2U7 CisgICAgICBmb3IgKGludCBudGggPSAwOyBudGggPCB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZV91c2VkW2NhY2hlX3R5cGVdOyArK250aCkKKyAgICAgICAgeworICAgICAgICAgIHNhbWVf cCB8PQorICAgICAgICAgICAgKHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF0uc2FtZV9wID09IHRydWUKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLnR5cGUgPT0gZ2x5cGgtPnR5cGUK KyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLmdseXBoLmJ5dGVwb3MgPT0gZ2x5cGgtPmJ5dGVwb3MKKyAgICAgICAgICAgICAmJiB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLmNoYXJw b3MgPT0gZ2x5cGgtPmNoYXJwb3MKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLnUudmFsID09IGdseXBoLT51LnZhbAor ICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF0uZ2x5cGguZmFjZV9pZCA9PSBnbHlwaC0+ZmFjZV9pZAorICAgICAgICAgICAgICYmIHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGgucGFkZGlu Z19wID09IGdseXBoLT5wYWRkaW5nX3AKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgud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odAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGguc2xpY2UuY21wLmZyb20g PT0gZ2x5cGgtPnNsaWNlLmNtcC5mcm9tCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS54ID09IHgKKyAgICAgICAgICAgICAmJiB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZ4ID09IGZ4Cisg ICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXS55ID09IHkKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhdLmZ5ID09IGZ5CisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5ocG9zID09IGhwb3MKKyAgICAgICAg ICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLnZw b3MgPT0gdnBvcworICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF0ud2QgPT0gd2QKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmggPT0gaAorICAgICAgICAgICAgICYm IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uY3Vyc29yX3R5 cGUgPT0gY3Vyc29yX3R5cGUKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNo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jaGVbY2FjaGVfdHlwZV1bbnRoXS5yb3dfcG9zaXRpb24g PT0gcm93X3Bvc2l0aW9uCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFibGVkX3AgPT0gdHJ1ZSk7CisgICAgICAgIH0KKyAg ICAgIC8qIEluIGEgc2l0dWF0aW9uIHdoZXJlIHRoZXJlIGFyZSBubyBjaGFuZ2VzIChlLmcuLCBD LWcpLCB3ZSBzdGlsbCBuZWVkIHRvCisgICAgICByZXNldCB0aGUgbGVmdC9yaWdodCBmcmluZ2Ug Yml0bWFwIGluZGljYXRvcnMuICovCisgICAgICBpZiAoIXNhbWVfcAorICAgICAgICAgIHx8IGN1 cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUAorICAgICAgICAgIHx8IGN1cnNvcl90 eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgIG1jX2RyYXdfZXJhc2VfaHli cmlkICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwgY3Vy c29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIGZv cmVncm91bmQsIGFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIHJlbW92ZV9wKTsKKyAgICAgIHJldHVy bjsKKyAgICB9CisgICAgZWxzZSBpZiAoZHJhd19wCisgICAgICAgICAgICAgJiYgKGZyb21fd2hl cmUgPT0gU0NSSUJFX09ORQorICAgICAgICAgICAgICAgICB8fCBmcm9tX3doZXJlID09IFNDUklC RV9UV08KKyAgICAgICAgICAgICAgICAgfHwgZnJvbV93aGVyZSA9PSBTQ1JJQkVfVEhSRUUKKyAg ICAgICAgICAgICAgICAgfHwgZnJvbV93aGVyZSA9PSBOT1dIRVJFKSkKKyAgICAgIHsKKyAgICAg ICAgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhw b3MsIHZwb3MsIHdkLCBoLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYWN0aXZlX3AsIGdseXBoX2ZsYXZvciwgcmVt b3ZlX3ApOworICAgICAgICByZXR1cm47CisgICAgICB9CisgIGlmIChjYWNoZV90eXBlID09IE5P X0NBQ0hFKQorICAgIHJldHVybjsKKyAgKyt3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW2NhY2hl X3R5cGVdOworICBpZiAodm50aCA+PSB3LT5tY19tYXRyaXgudnBvc191c2VkKQorICAgIHctPm1j X21hdHJpeC52cG9zX3VzZWQgPSB2bnRoICsgMTsKKyAgaWYgKHctPm1jX21hdHJpeC52cG9zX2Fs bG9jYXRlZCA8IHctPm1jX21hdHJpeC52cG9zX3VzZWQpCisgICAgeworICAgICAgaW50IG9sZF9h bGxvYyA9IHctPm1jX21hdHJpeC52cG9zX2FsbG9jYXRlZDsKKyAgICAgIGludCBuZXdfZWx0cyA9 IHctPm1jX21hdHJpeC52cG9zX3VzZWQgLSB3LT5tY19tYXRyaXgudnBvc19hbGxvY2F0ZWQ7Cisg ICAgICB3LT5tY19tYXRyaXgudnBvcyA9IHhwYWxsb2MgKHctPm1jX21hdHJpeC52cG9zLCAmdy0+ bWNfbWF0cml4LnZwb3NfYWxsb2NhdGVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBuZXdfZWx0cywgSU5UX01BWCwgc2l6ZW9mICp3LT5tY19tYXRyaXgudnBvcyk7CisgICAg ICBtZW1zZXQgKHctPm1jX21hdHJpeC52cG9zICsgb2xkX2FsbG9jLCAwLAorICAgICAgICAgICAg ICAgKHctPm1jX21hdHJpeC52cG9zX2FsbG9jYXRlZCAtIG9sZF9hbGxvYykgKiBzaXplb2YgKnct Pm1jX21hdHJpeC52cG9zKTsKKyAgICB9CisgICsrdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVfdXNlZFtjYWNoZV90eXBlXTsKKyAgaWYgKHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl X2FsbG9jYXRlZFtjYWNoZV90eXBlXSA8IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3Vz ZWRbY2FjaGVfdHlwZV0pCisgICAgeworICAgICAgaW50IG9sZF9hbGxvYyA9IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlX2FsbG9jYXRlZFtjYWNoZV90eXBlXTsKKyAgICAgIGludCBuZXdf ZWx0cyA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV0gLSB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV07CisgICAg ICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXSA9IHhwYWxsb2MgKHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmdy0+bWNfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVkW2NhY2hlX3R5cGVdLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfZWx0cywKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg SU5UX01BWCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgc2l6ZW9mICp3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYW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aCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCAqd2QpCit7Cisg IHN0cnVjdCBnbHlwaCAqZ2x5cGggPSBtY19nZXRfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJv dywgaHBvcywgdnBvcyk7CisgIGlmIChnbHlwaCA9PSBOVUxMKQorICAgIHJldHVybjsKKyAgc3Ry dWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAgKmZ4ID0gV0lORE9X X1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgeCk7CisgICpoID0gcm93LT52aXNpYmxlX2hlaWdo dDsKKyAgLyogRG9uJ3QgbGV0IHRoZSBjdXJzb3IgZXhjZWVkIHRoZSBkaW1lbnNpb25zIG9mIHRo ZSByb3csIHNvIHRoYXQKKyAgdGhlIHVwcGVyL2xvd2VyIHNpZGUgb2YgdGhlIGJveCBhcmVuJ3Qg Y2xpcHBlZC4gICovCisgIGludCB3X2hlYWRlcl9saW5lX2hlaWdodCA9IFdJTkRPV19IRUFERVJf TElORV9IRUlHSFQgKHcpOworICBpbnQgd190ZXh0X2JvdHRvbV95ID0gd2luZG93X3RleHRfYm90 dG9tX3kgKHcpIC0gKmg7CisgIGlmICh5IDwgd19oZWFkZXJfbGluZV9oZWlnaHQpCisgICAgewor ICAgICAgKmggPSBtYXggKCpoIC0gKHdfaGVhZGVyX2xpbmVfaGVpZ2h0IC0geSkgKyAxLCAqaCk7 CisgICAgICB5ID0gd19oZWFkZXJfbGluZV9oZWlnaHQgLSAxOworICAgICAgLy8gZnByaW50ZiAo c3RkZXJyLCAiQ09ORElUSU9OICMgMVxuIik7CisgICAgfQorICAgZWxzZSBpZiAoeSA+IHdfdGV4 dF9ib3R0b21feSkKKyAgICAgeworICAgICAgICpoICs9IHkgLSB3X3RleHRfYm90dG9tX3k7Cisg ICAgICAgeSA9IHdfdGV4dF9ib3R0b21feTsKKyAgICAgICAvLyBmcHJpbnRmIChzdGRlcnIsICJD T05ESVRJT04gIyAyXG4iKTsKKyAgICAgfQorICAqZnkgPSBXSU5ET1dfVE9fRlJBTUVfUElYRUxf WSAodywgeSk7CisgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgeworICAgICAgY2FzZSBNQ19C QVI6CisgICAgICAgIHsKKyAgICAgICAgICBpZiAoY3Vyc29yX3dpZHRoIDwgMSkKKyAgICAgICAg ICAgIGN1cnNvcl93aWR0aCA9IG1heCAoRlJBTUVfQ1VSU09SX1dJRFRIIChmKSwgMSk7CisgICAg ICAgICAgaWYgKGN1cnNvcl93aWR0aCA8IGdseXBoLT5waXhlbF93aWR0aCkKKyAgICAgICAgICAq d2QgPSBjdXJzb3Jfd2lkdGg7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGNh c2UgTUNfSEJBUjoKKyAgICAgICAgeworICAgICAgICAgIGludCBjdXJzb3JfaGVpZ2h0ID0gKGN1 cnNvcl93aWR0aCA8IDEpID8gbHJpbnQgKDAuMjUgKiAqaCkgOiBjdXJzb3Jfd2lkdGg7CisgICAg ICAgICAgaWYgKGN1cnNvcl9oZWlnaHQgPiByb3ctPmhlaWdodCkKKyAgICAgICAgICAgIGN1cnNv cl9oZWlnaHQgPSByb3ctPmhlaWdodDsKKyAgICAgICAgICAvKiBDdXJzb3Igc21hbGxlciB0aGFu IGxpbmUgaGVpZ2h0LCBzbyBtb3ZlIGRvd24uICovCisgICAgICAgICAgaWYgKCpoID4gY3Vyc29y X2hlaWdodCkKKyAgICAgICAgICAgICpmeSArPSAqaCAtIGN1cnNvcl9oZWlnaHQ7CisgICAgICAg ICAgKmggPSBjdXJzb3JfaGVpZ2h0OworICAgICAgICAgICp3ZCA9IGdseXBoLT5waXhlbF93aWR0 aDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgY2FzZSBNQ19SSUdIVF9GUklO R0VfQklUTUFQOgorICAgICAgY2FzZSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVA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b3BvaW50X3gpOworICBpbnQgZmNfZngg PSBXSU5ET1dfVEVYVF9UT19GUkFNRV9QSVhFTF9YICh3LCBlc3NlbnRpYWxzLmZjX3gpOworICBi b29sIGdseXBoX3p2X3AgPSAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+ dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICYmIE1BVFJJWF9ST1dfRU5EX0NI QVJQT1MgKHJvdykgPT0gWlYpOworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1l KTsKKyAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKHctPmNvbnRlbnRzKTsKKyAgaW50IHRl eHRfYXJlYV93aWR0aCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgIHN0cnVj dCBnbHlwaF9yb3cgKmN1cnNvcl9yb3cgPSAody0+Y3Vyc29yLnZwb3MgIT0gLTEpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1BVFJJWF9ST1cgKGN1cnNvcl9tYXRyaXgsIHct PmN1cnNvci52cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOVUxMOwor ICBzdHJ1Y3QgZ2x5cGggKmN1cnNvcl9nbHlwaCA9ICh3LT5jdXJzb3IudnBvcyAhPSAtMSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIGN1 cnNvcl9tYXRyaXgsIGN1cnNvcl9yb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOVUxMOworICBib29sIGN1cnNvcl9hdF9m cmluZ2VfcCA9IChjdXJzb3JfZ2x5cGggPT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBjdXJzb3Jfcm93ICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgdy0+Y3Vyc29yLmhwb3MgPT0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3ctPmV4YWN0X3dpbmRvd193aWR0aF9s aW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gdGV4 dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54 ID09IGN1cnNvcl9yb3ctPnBpeGVsX3dpZHRoKTsKKyAgYm9vbCBjdXJzb3JfYmV5b25kX2ZyaW5n ZV9wID0gKGN1cnNvcl9nbHlwaCA9PSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBjdXJzb3Jfcm93ICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHctPmN1cnNvci5ocG9zID09IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIWN1cnNvcl9yb3ctPmV4YWN0X3dpbmRv d193aWR0aF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1 cnNvci54ID49IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgdy0+Y3Vyc29yLnggPj0gY3Vyc29yX3Jvdy0+cGl4ZWxfd2lkdGgpOworICBpbnQgZnJh bWVfY2hhcl93aWR0aCA9IEZSQU1FX0NPTFVNTl9XSURUSCAoZik7CisgIGludCB0ZW1wX2ZhY2Vf aWQgPSBnbHlwaC0+ZmFjZV9pZDsKKyAgc3RydW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WRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgKGdseXBo LT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgICAgID8gJ0MnCisgICAgICAgICA6ICdHJyksCisg ICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkK KyAgICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAg ICAgICAgICAgPyAnUycKKyAgICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAg ICAgICAgICAgICA/ICcwJworICAgICAgICAgICAgICAgOiAnLScpKSksCisgICAgICAgICAgICAg IGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgZ2x5cGgtPnUuY2gsCisgICAgICAgIGdseXBo LT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlw aC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPmhwb3MsIGdseXBoX3p2X3AgPyAi WlYiIDogIi0tIiwKKyAgICAgICAgbWNfY2hhcl90b19zdHJpbmcgKGdseXBoLT51LmNoKSk7Cisg IHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyog ICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTOiAgQ0hBUl9HTFlQSCB8IEdMWVBITEVTU19H TFlQSCAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNl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9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAg ICAgICAgICAgYmFja2dyb3VuZCwgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdf cCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgICBjYWNoZV90eXBlLCBhY3Rpb25fdHlw ZSk7CisgICAgICBpZiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNl ZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiByZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAg IHsKKyAgICAgICAgICBpZiAocmVsYXRpdmVfeCA8IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOwor ICAgICAgICAgICAgICBmeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICB9Cisg ICAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4 LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgIHhfbGltaXQgLSByZWxh dGl2ZV94LCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sCisgICAg ICAgICAgICAgICAgICAgICBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2 ZV9wLCBNQ19HTFlQSExFU1MsCisgICAgICAgICAgICAgICAgICAgICBkcmF3X3AsIGZyb21fd2hl cmUsIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgICAgfQorICAgICAgYnJlYWs7Cisg ICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgIFZFUlRJQ0FM X1JVTEVSOiAgQ0hBUl9HTFlQSCB8IEdMWVBITEVTU19HTFlQSCAgICAgICAgICAgICAgICAgKi8K Ky8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgVkVSVElDQUxfUlVMRVI6CisgICAg eworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1cnNvcl9hdF9mcmluZ2Vf cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+Y29udGludWVk X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxf QkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vy c29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FS Uk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5b25k X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ct PnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+dXNlZFtURVhU X0FSRUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFy b3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+ dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IG9wb2ludF94ID49IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IChnbHlwaF96dl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiBNQ19HTFlQSDsKKyAgICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJ R0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x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0tLS0tLSAqLwor ICAgIGNhc2UgRklMTF9DT0xVTU46CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhf Zmxhdm9yID0gKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJl YV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFs cy5mY194ID49IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IChnbHlwaF96dl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAo IU5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfdmVy dGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg b3BvaW50X3kgPT0geQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg b3BvaW50X3Zwb3MgPT0gdnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog TUNfR0xZUEg7CisgICAgICB3ZCA9IDE7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93 LCBnbHlwaCwgcmVsYXRpdmVfeCwgZmNfZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAg ICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsI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gICAgICAg ICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICBlbHNlIGlmIChnbHlwaC0+ dHlwZSA9PSBTVFJFVENIX0dMWVBIKQorICB7CisgICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAg ZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiXG4gJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJk ICVjICUzZCAweCUwNnggJTRkICUxLjFkJTEuMWQgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5 cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9 PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAg ICAgICAgJ1MnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGds eXBoLT5vYmplY3QpCisgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgt Pm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+ b2JqZWN0KQorICAgICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAor ICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIDB1LAorICAgICAgICBnbHlwaC0+ ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgt PnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpW IiA6ICItLSIsCisgICAgICAgICJcXFMiKTsKKyAgc3dpd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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBIT1JJWk9OVEFMX1JV TEVSOgorICAgIHsKKyAgICAgIGlmIChyZWxhdGl2ZV94IDwgcm93LT5waXhlbF93aWR0aAorICAg ICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgbWF0 cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAg ICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3Np dGlvbiwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRp YWxzLmFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAg ICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGlmIChnbHlwaCAtIHJvdy0+ Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICYmIHJl bGF0aXZlX3ggPD0geF9saW1pdCkKKyAgICAgICAgeworICAgICAgICAgIGlmIChyZWxhdGl2ZV94 IDwgcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBp eGVsX3dpZHRoOworICAgICAgICAgIHRlbXBfZmFjZV9pZCA9IChyb3ctPmZpbGxfbGluZV9wKQor ICAgICAgICAgICAgICAgICAgICAgICAgID8gZ2x5cGgtPmZhY2VfaWQKKyAgICAgICAgICAgICAg ICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGJh Y2tncm91bmQ7CisgICAgICAgICAgbWNfc2V0X2xzbF9iZyAodywgdGVtcF9mYWNlX2lkLCAmYmFj a2dyb3VuZCk7CisgICAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJl bGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgIHhf bGltaXQgLSByZWxhdGl2ZV94LCBoLCBjdXJzb3JfdHlwZSwgeF9saW1pdCAtIHJlbGF0aXZlX3gs CisgICAgICAgICAgICAgICAgICAgICByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsIGJhY2tncm91 bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICBNQ19HTFlQSExF U1MsIGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAg ICB9CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAg ICAgICAgICAgICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIFNUUkVUQ0hfR0xZUEggICAg ICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBW RVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAgICBpZiAocm93LT5maWxsX2xpbmVfcAorICAgICAg ICAgICYmIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0g LSAxCisgICAgICAgICAgJiYgb3BvaW50X3ggPiByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dp ZHRoKQorICAgICAgICB0ZW1wX2ZhY2VfaWQgPSBnbHlwaC0+ZmFjZV9pZDsKKyAgICAgICAgZWxz ZSBpZiAoIXJvdy0+ZmlsbF9saW5lX3AKKyAgICAgICAgICAgICAgICAgJiYgZ2x5cGggLSByb3ct PmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAg ICAgJiYgb3BvaW50X3ggPiByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoKQorICAgICAg ICAgIHRlbXBfZmFjZV9pZCA9IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgIHN0cnVjdCBtY19SR0Ig YmFja2dyb3VuZDsKKyAgICAgIG1jX3NldF9sc2xfYmcgKHcsIHRlbXBfZmFjZV9pZCwgJmJhY2tn cm91bmQpOworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1cnNvcl9hdF9m cmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+Y29u dGludWVkX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVS VElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX1JJ R0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3Jf YmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+dXNl ZFtURVhUX0FSRUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSExFU1M7CisgICAgICBpZiAoZ2x5cGhfZmxh dm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2Zs YXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8 fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgIHx8 IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2 b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICBjdXJzb3JfdHlwZSA9IE1D X1JJR0hUX0ZSSU5HRV9CSVRNQVA7CisgICAgICB3ZCA9IDE7CisgICAgICBtY19oZWxwZXIgKHcs IG1hdHJpeCwgcm93LCBnbHlwaCwgb3BvaW50X3gsIG9wb2ludF9meCwgeSwgZnksIGhwb3MsIHZw b3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBy b3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIGJhY2tncm91bmQsIGVz c2VudGlhbHMuYWN0aXZlX3AsIGdseXBoX2ZsYXZvciwgZHJhd19wLCBmcm9tX3doZXJlLAorICAg ICAgICAgICAgICAgICBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICBicmVhazsKKyAg ICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAg ICAgRklMTF9DT0xVTU46ICBTVFJFVENIX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICAqLwor LyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBGSUxMX0NPTFVNTjoKKyAgICB7Cisg ICAgICBpZiAocm93LT5maWxsX2xpbmVfcAorICAgICAgICAgICYmIGdseXBoIC0gcm93LT5nbHlw aHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYgZXNzZW50 aWFscy5mY194ID4gcmVsYXRpdmVfeCArIGdseXBoLT5waXhlbF93aWR0aCkKKyAgICA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1I6CisgICAgeworICAgICAgYnJlYWs7CisgICAg fQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgIH0KKyAgfQorLyogLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFTkQ6ICBTVFJFVENIX0dM WVBIICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAq LworCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgQkVHSU46ICBJTUFHRV9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwor LyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IElNQUdF X0dMWVBIKQorICB7CisgICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAgZnByaW50ZiAoc3RkZXJy LAorICAgICAgICAiXG4gJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNngg JTRkICUxLjFkJTEuMWQgICUzZCAlcyAlY1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBo c1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ct PnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ0knLAorICAg ICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisg ICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAg ICAgICAgID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAg ICAgICAgICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+ cGl4ZWxfd2lkdGgsCisgICAgICAgICh1bnNpZ25lZCBpbnQpIGdseXBoLT51LmltZ19pZCwKKyAg ICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisg ICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+aHBvcywgZ2x5 cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAnLicpOworICBzd2l0Y2ggKGFjdGlvbl90 eXBlKQorICB7CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAg ICAgICAgIE1VTFRJUExFX0NVUlNPUlM6ICBJTUFHRV9HTFlQSCAgICAgICAgICAgICAgICAgICAg ICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBNVUxUSVBMRV9DVVJTT1JT OgorICAgIHsKKyAgICAgIGN1cnNvcl90eXBlID0gTUNfSE9MTE9XX0JPWDsKKyAgICAgIG1jX2hl bHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3Ms IHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRo LCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIGJhY2tncm91bmQs IGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUsCisgICAg ICAgICAgICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGJyZWFrOworICAg IH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAg SE9SSVpPTlRBTF9SVUxFUjogIElNQUdFX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICovCisv KiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEhPUklaT05UQUxfUlVMRVI6CisgICAg eworICAgICAgY3Vyc29yX3R5cGUgPSBNQ19IT0xMT1dfQk9YOworICAgICAgaWYgKCFyZWFsX2Zh a2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCBy ZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2Qs IGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdG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tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBFTkQ6ICBJTUFHRV9HTFlQSCAgICAgICAgICAgICAgICAg ICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisKKy8qIC0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgQkVHSU46ICBDT01QT1NJ VEVfR0xZUEggICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKQorICB7Cisg ICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAgeworICAgICAgICBmcHJpbnRmIChzdGRlcnIsCisg ICAgICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4IiwK KyAgICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgKChy b3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAg ICAgcmVsYXRpdmVfeCwKKyAgICAgICAgICAnKycsCisgICAgICAgICAgZ2x5cGgtPmNoYXJwb3Ms CisgICAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgID8gJ0InCisg ICAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgID8gJ1Mn CisgICAgICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICAg ID8gJzAnCisgICAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICAgIGdseXBoLT5waXhl bF93aWR0aCwKKyAgICAgICAgICAodW5zaWduZWQgaW50KSBnbHlwaC0+dS5jbXAuaWQpOworICAg ICAgICBmcHJpbnRmIChzdGRlcnIsICIgJTRkICUxLjFkJTEuMWQiLAorICAgICAgICAgIGdseXBo LT5mYWNlX2lkLAorICAgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgICAg Z2x5cGgtPnJpZ2h0X2JveF9saW5lX3ApOworICAgICAgaWYgKGdseXBoLT51LmNtcC5hdXRvbWF0 aWMpCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgJTNkICVzIC4gWyVkLSVkXVxuIiwKKyAg ICAgICAgICAgICAgICAgICAgICAgICBnbHlwaC0+aHBvcywgZ2x5cGhfenZfcCA/ICJaViIgOiAi LS0iLAorICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoLT5zbGljZS5jbXAuZnJvbSwgZ2x5 cGgtPnNsaWNlLmNtcC50byk7CisgICAgICAgIGVsc2UKKyAgICAgICAgICBmcHJpbnRmIChzdGRl cnIsICJcbiIpOworICAgICAgfQorICBzd2l0Y2ggKGFjdGlvbl90eXBlKQorICB7CisvKiAtLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJT T1JTOiAgQ09NUE9TSVRFX0dMWVBIICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tICovCisgICAgY2FzZSBNVUxUSVBMRV9DVVJTT1JTOgorICAgIHsKKyAgICAgIG1j X2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhw b3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dp ZHRoLCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIGJhY2tncm91 bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUsCisg ICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGJyZWFrOwor ICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAg IEhPUklaT05UQUxfUlVMRVI6ICBDT01QT1NJVEVfR0xZUEggICAgICAgICAgICAgICAgICAgICov CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEhPUklaT05UQUxfUlVMRVI6Cisg ICAgeworICAgICAgaWYgKHJlbGF0aXZlX3ggPD0geF9saW1pdAorICAgICAgICAgICYmICFyZWFs X2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBo LCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAg d2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgZm9yZWdyb3Vu ZCwKKyAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBN Q19HTFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICAgIGNhY2hlX3R5 cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGlmIChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJF QV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICYmIHJlbGF0aXZlX3ggPD0geF9s aW1pdCkKKyAgICAgICAgeworICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dp ZHRoOworICAgICAgICAgIHdoaWxlIChyZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAgICAg ICB7CisgICAgICAgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxh dGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAg d2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgZm9yZWdyb3Vu ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2 ZV9wLCBNQ19HTFlQSExFU1MsIGRyYXdfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBmcm9t X3doZXJlLCBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICAgICAgICAgIHJlbGF0aXZl X3ggKz0gZnJhbWVfY2hhcl93aWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAg YnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAg ICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIENPTVBPU0lURV9HTFlQSCAgICAgICAgICAgICAg ICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgVkVSVElDQUxfUlVM RVI6CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1cnNvcl9h dF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+ Y29udGludWVkX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNf VkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3Ap CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFS X1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJz b3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2Vf cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+ dXNlZFtURVhUX0FSRUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFd ID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIG9wb2ludF94ID49IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IChnbHlwaF96dl9wKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIGlmIChnbHlwaF9mb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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLSAqLworICAgIGNhc2UgRklMTF9DT0xVTU46CisgICAgeworICAgICAgZW51bSBtY19m bGF2b3IgZ2x5cGhfZmxhdm9yID0gKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSBy b3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgZXNzZW50aWFscy5mY194ID4gcmVsYXRpdmVfeCkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogKGdseXBoX3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6ICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBj aF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBvcG9pbnRfeSA9PSB5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBvcG9pbnRfdnBvcyA9PSB2cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBNQ19HTFlQSDsKKyAgICAgIHdkID0gMTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4 LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmY19meCwgeSwgZnksIGhwb3MsIHZwb3M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jogIFhXSURHRVRfR0xZUEggICAgICAgICAgICAg ICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgIGVsc2UgaWYgKGds eXBoLT50eXBlID09IFhXSURHRVRfR0xZUEgpCisgIHsKKyNpZm5kZWYgSEFWRV9YV0lER0VUUwor ICAgIGVhc3N1bWUgKGZhbHNlKTsKKyNlbHNlCisgICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAg ZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiXG4gICU1ZC8lLTVkICU1ZCAlNGMgJTZkICVjICUz ZCAweCUwNXggJTRkICUxLjFkJTEuMWQgICUzZCAlcyAlY1xuIiwKKyAgICAgICAgZ2x5cGggLSBy b3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/ IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAg J1gnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5v YmplY3QpCisgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVj dCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6ICctJykpLAorICAgICAgICBnbHlw aC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+ bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAg ICAgZ2x5cGgtPnUueHdpZGdldCwKKyAgICAgICAgZ2x5cGgtPmhwb3MsIGdseXBoX3p2X3AgPyAi WlYiIDogIi0tIiwKKyAgICAgICAgJy4nKTsKKyNlbmRpZgorICBzd2l0Y2ggKGFjdGlvbl90eXBl KQorICB7CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAg ICAgTVVMVElQTEVfQ1VSU09SUzogIFhXSURHRVRfR0xZUEggICAgICAgICAgICAgICAgICAgICAq LworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBNVUxUSVBMRV9DVVJTT1JTOgor ICAgIHsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94 LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3Jf dHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAg ICAgICAgIGJhY2tncm91bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3As IGZyb21fd2hlcmUsCisgICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsK KyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAg ICAgICAgICAgICAgICAgICBIT1JJWk9OVEFMX1JVTEVSOiAgWFdJREdFVF9HTFlQSCAgICAgICAg ICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEhPUkla T05UQUxfUlVMRVI6CisgICAgeworICAgICAgaWYgKHJlbGF0aXZlX3ggPD0geF9saW1pdAorICAg ICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgbWF0 cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAg ICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3Np dGlvbiwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRp YWxzLmFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAg ICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGlmIChnbHlwaCAtIHJvdy0+ Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICYmIHJl bGF0aXZlX3ggPD0geF9saW1pdCkKKyAgICAgICAgeworICAgICAgICAgIHJlbGF0aXZlX3ggKz0g Z2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgIHdoaWxlIChyZWxhdGl2ZV94IDw9IHhfbGlt aXQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCBy b3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAg ICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3Np dGlvbiwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBl c3NlbnRpYWxzLmFjdGl2ZV9wLCBNQ19HTFlQSExFU1MsIGRyYXdfcCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICBmcm9tX3doZXJlLCBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICAg ICAgICAgIHJlbGF0aXZlX3ggKz0gZnJhbWVfY2hhcl93aWR0aDsKKyAgICAgICAgICAgIH0KKyAg ICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisv KiAgICAgICAgICAgICAgICAgICAgICAgICAgVkVSVElDQUxfUlVMRVI6ICBYV0lER0VUX0dMWVBI ICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNh c2UgVkVSVElDQUxfUlVMRVI6CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxh dm9yID0gKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3Ap CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFS CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdl X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNh dGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g TUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IChjdXJzb3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9S SUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29y X2JleW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JB UgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGggLSByb3ctPmds eXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF94ID49IHJvdy0+cGl4ZWxfd2lkdGgpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF96dl9wKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIGlmIChnbHlwaF9mbGF2 b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxh dm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8 IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgfHwg Z2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgIHx8IGdseXBoX2ZsYXZv ciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAgIGN1cnNvcl90eXBlID0gTUNf UklHSFRfRlJJTkdFX0JJVE1BUDsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGds eXBoLCByZWxhdGl2ZV94LCBvcG9pbnRfZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAg ICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcm93X3Bvc2l0aW9uLCBm b3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2 ZV9wLCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAg Y2FjaGVfdHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgIEZJTExfQ09MVU1O OiAgWFdJREdFVF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLSAqLworICAgIGNhc2UgRklMTF9DT0xVTU46CisgICAgeworICAgICAgZW51bSBtY19m bGF2b3IgZ2x5cGhfZmxhdm9yID0gKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSBy b3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgZXNzZW50aWFscy5mY194ID4gcmVsYXRpdmVfeCkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogKGdseXBoX3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6ICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBj aF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBvcG9pbnRfeSA9PSB5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBvcG9pbnRfdnBvcyA9PSB2cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBNQ19HTFlQSDsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCBy ZWxhdGl2ZV94LCBmY19meCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdk LCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQs CisgICAgICAgICAgICAgICAgIGJhY2tncm91bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsIGdseXBo X2ZsYXZvciwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICBjYWNoZV90eXBl LCBhY3Rpb25fdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KKyAgICBjYXNlIENVUlNPUl9JTkRJQ0FUT1I6CisgICAgeworICAgICAgYnJlYWs7Cisg ICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgIH0KKyAgfQorLyogLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFTkQ6ICBYV0lER0VU X0dMWVBIICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0t LS0t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JJWF9ST1dfVlBPUyAoYm90dG9t X3JvdywgbWF0cml4KTsKKyAgaWYgKHZwb3MgPT0gYm90dG9tX3Zwb3MpCisgICAgcmV0dXJuOwor ICBpZiAoIXJvdy0+dXNlZFtURVhUX0FSRUFdKQorICAgIHJldHVybjsKKyAgaW50IGhwb3Nfc3Rh cnQgPSBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgIGlmIChtY19zdGRlcnJfcCkK KyAgICBmcHJpbnRmIChzdGRlcnIsICJtY19kcmF3X3JvdyAoJWQpOiAgZHJhd19wICglcykgfCBo cG9zICglZCkgfCBsZW4gKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgIHZwb3MsIGRyYXdf cCA/ICJ5IiA6ICJuIiwgaHBvc19zdGFydCwgaHBvc19sZW5ndGgpOworICBpbnQgb3BvaW50X2Z4 LCBvcG9pbnRfZnksIG9wb2ludF93ZCwgb3BvaW50X2g7CisgIGludCB0ZXh0X2FyZWFfd2lkdGgg PSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOworICBpbnQgaGVhZGVyX2xpbmVfZm9y bWF0ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgIHN0cnVjdCBnbHlwaF9yb3cg KmN1cnNvcl9yb3cgPSAody0+Y3Vyc29yLnZwb3MgIT0gLTEpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IE1BVFJJWF9ST1cgKGN1cnNvcl9tYXRyaXgsIHctPmN1cnNvci52cG9z KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOVUxMOworICBzdHJ1Y3QgZ2x5 cGggKmN1cnNvcl9nbHlwaCA9ICh3LT5jdXJzb3IudnBvcyAhPSAtMSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIGN1cnNvcl9tYXRyaXgs IGN1cnNvcl9yb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiBOVUxMOworICBib29sIGN1cnNvcl9hdF9mcmluZ2VfcCA9IChj dXJzb3JfZ2x5cGggPT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJz b3Jfcm93ICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29y Lmhwb3MgPT0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIGN1cnNvcl9yb3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5lX3AKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gdGV4dF9hcmVhX3dpZHRo CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID09IGN1cnNvcl9y b3ctPnBpeGVsX3dpZHRoKTsKKyAgYm9vbCBjdXJzb3JfYmV5b25kX2ZyaW5nZV9wID0gKGN1cnNv cl9nbHlwaCA9PSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJz b3Jfcm93ICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1 cnNvci5ocG9zID09IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgIWN1cnNvcl9yb3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5l X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHRl eHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vy c29yLnggPj0gY3Vyc29yX3Jvdy0+cGl4ZWxfd2lkdGgpOworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqCisgICAgICAgICAgICAgICAgICAgICAgICAgIFJFUExBQ0UgVEhFIFJFQUwgQ1VSU09SCisq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKyAgZW51bSBmYWNlX2lkIGJnX2ZhY2VfaWQgPSAoY3Vy c29yX2dseXBoICE9IE5VTEwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBjdXJzb3Jf Z2x5cGgtPmZhY2VfaWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFD RV9JRDsKKyAgc3RydWN0IG1jX1JHQiBjdXJzb3JfYmc7CisgIG1jX3NldF9sc2xfYmcgKHcsIGJn X2ZhY2VfaWQsICZjdXJzb3JfYmcpOworICAvKiBGSVhNRTogIFB1dCBpbiBzb21lIGNvZGUgdG8g ZGVmYXVsdCB0byBNQ19IT0xMT1dfQk9YIGlmIHRoZSB1c2VyIGhhcworICB1bndpdHRpbmdseSBj b21lIHVwIHdpdGggc29tZSB1bmFjY2VwdGFibGUgZm9ybSBvZiB1bnJlY29nbml6ZWQgY3Vyc29y IHR5cGUuICovCisgIExpc3BfT2JqZWN0IGxpc3BfdHlwZSA9IEJWQVIgKGIsIG1jX3JlYWxfZmFr ZV9jdXJzb3IpOworICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlID0gKENPTlNQIChs aXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY19saXNw X3RvX2N1cnNvcl90eXBlIChYQ0FSIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiBtY19saXNwX3RvX2N1cnNvcl90eXBlIChsaXNwX3R5cGUpOworICBp bnQgY3Vyc29yX3dpZHRoID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAg ICAgPyBYRklYTlVNIChYQ0FSIChYQ0RSIChsaXNwX3R5cGUpKSkKKyAgICAgICAgICAgICAgICAg ICAgIDogLTE7CisgIHN0cnVjdCBtY19SR0IgY3Vyc29yX2ZnOworICBtY19jb2xvcl9waWNrZXIg KHcsIGN1cnNvcl9nbHlwaCwgZXNzZW50aWFscywgJmN1cnNvcl9mZywgLTEsIGN1cnNvcl90eXBl LAorICAgICAgICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgQ1VSU09SX0lORElDQVRPUik7Cisg IGJvb2wgZmlsbF9jb2x1bW5fdHJ1bXBzX3AgPSAoIU5JTFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2Fs X3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAo YiwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vy c29yLnggPT0gZXNzZW50aWFscy5mY194CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgIWN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm ICFjdXJzb3JfYmV5b25kX2ZyaW5nZV9wKTsKKyAgLyogV2UgdXNlIGEgdGVzdCBzaW1pbGFyIHRv IHRoZSByZWFsIGZha2UgY3Vyc29yIHNvIHRoYXQgdGhlIGZyaW5nZSBiaXRtYXAgaXMKKyAgb25s eSBkcmF3biBvbmNlIHBlciB3aW5kb3cuICovCisgIGlmICh2cG9zID09IHctPmN1cnNvci52cG9z CisgICAgICAmJiBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGggPT0gcm93LT51c2VkW1RFWFRfQVJF QV0KKyAgICAg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U09SX0lORElDQVRPUik7 CisgICAgfQorICBpZiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAmJiB2cG9zID09IHctPmN1 cnNvci52cG9zCisgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAm JiB3LT5jdXJzb3IuaHBvcyA9PSBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGgKKyAgICAgICYmICFO SUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9o b3Jpem9udGFsX3J1bGVyKSkpCisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxh dm9yID0gTUNfSE9MTE9XX1JFQ1RBTkdMRTsKKyAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSBy b3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgc3RydWN0IGdseXBoICpnbHlwaF9lbmQgPSBn bHlwaCArIHJvdy0+dXNlZFtURVhUX0FSRUFdOworICAgICAgLyogR2x5cGggZm9yIGEgbGluZSBl bmQgaW4gdGV4dC4gKi8KKyAgICAgIGlmIChnbHlwaCA9PSBnbHlwaF9lbmQgJiYgZ2x5cGgtPmNo YXJwb3MgPiAwKQorICAgICAgICArK2dseXBoX2VuZDsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0 cml4LCByb3csIGdseXBoX2VuZCAtIDEsIHctPmN1cnNvci54LCAtMSwgdy0+Y3Vyc29yLnksIC0x LAorICAgICAgICAgICAgICAgICB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MsIC0xLCAt MSwgTUNfUklHSFRfRlJJTkdFX0JJVE1BUCwKKyAgICAgICAgICAgICAgICAgLTEsIHJvd19wb3Np dGlvbiwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsIGVzc2VudGlhbHMuYWN0aXZlX3AsCisgICAgICAg ICAgICAgICAgIGdseXBoX2ZsYXZvciwgZHJhd19wLCBmcm9tX3doZXJlLCBDSF9DQUNIRSwgQ1VS U09SX0lORElDQVRPUik7CisgICAgfQorICAvKiBDdXJzb3IgaXMgYmV5b25kIHRoZSByaWdodCBm cmluZ2U7IGUuZy4sIHdoZW4gcmlnaHQgaG9yaXpvbnRhbCBzY3JvbGxpbmcuICovCisgIGVsc2Ug aWYgKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJz b3IudnBvcworICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA+PSBocG9zX3N0YXJ0CisgICAg ICAgICAgICYmIChocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGgpID09IHJvdy0+dXNlZFtURVhUX0FS RUFdCisgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAg ICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2hvcml6b250YWxfcnVsZXIpKSkKKyAgICB7CisgICAg ICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFO R0xFX1JJR0hUX0FSUk9XOworICAgICAgc3RydWN0IGdseXBoICpnbHlwaCA9IHJvdy0+Z2x5cGhz W1RFWFRfQVJFQV07CisgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoX2VuZCA9IGdseXBoICsgcm93 LT51c2VkW1RFWFRfQVJFQV07CisgICAgICAvKiBHbHlwaCBmb3IgYSBsaW5lIGVuZCBpbiB0ZXh0 LiAqLworICAgICAgaWYgKGdseXBoID09IGdseXBoX2VuZCAmJiBnbHlwaC0+Y2hhcnBvcyA+IDAp CisgICAgICAgICsrZ2x5cGhfZW5kOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywg Z2x5cGhfZW5kIC0gMSwgcm93LT5waXhlbF93aWR0aCwgLTEsIHctPmN1cnNvci55LAorICAgICAg ICAgICA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93aWR0aCBvZiAxLiAqLworICAgICAgbWNfZ2V0X2N1 cnNvcl9nZW9tZXRyeSAodywgbWF0cml4LCByb3csIHctPmN1cnNvci54LCAmb3BvaW50X2Z4LCB3 LT5jdXJzb3IueSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZvcG9pbnRfZnksIHct PmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgTUNfQkFSLCAxLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAo dywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+ Y3Vyc29yLnksCisgICAgICAgICAgICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHct PmN1cnNvci52cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9oLAorICAgICAgICAgICAgICAgICBNQ19C QVIsIDEsIHJvd19wb3NpdGlvbiwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsIGVzc2VudGlhbHMuYWN0 aXZlX3AsCisgICAgICAgICAgICAgICAgIE1DX0dMWVBITEVTUywgZHJhd19wLCBmcm9tX3doZXJl LCBOSUxQIChCVkFSIChiLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IENIX0NBQ0hFCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiBNQ19DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgICBtY19nZXRfY3Vyc29yX2dlb21l dHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRfZngsIHctPmN1cnNvci55 LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF9meSwgdy0+Y3Vyc29yLmhw b3MsIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBNQ19IQkFSLCAxLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4 LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vyc29yLnks CisgICAgICAgICAgICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52 cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9oLAorICAgICAgICAgICAgICAgICBNQ19IQkFSLCAxLCBy b3dfcG9zaXRpb24sIGN1cnNvcl9mZywgY3Vyc29yX2JnLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLAor ICAgICAgICAgICAgICAgICBNQ19HTFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLCBOSUxQIChCVkFS IChiLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBDSF9DQUNIRQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IE1DX0NBQ0hFLCBDVVJTT1JfSU5ESUNBVE9SKTsKKyAgICB9CisgIGVsc2UgaWYg KCFjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoICE9IE5VTEwK KyAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAgICAgICAmJiB3LT5j dXJzb3IuaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zIDwg aHBvc19zdGFydCArIGhwb3NfbGVuZ3RoCisgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+dHlw ZSAhPSBTVFJFVENIX0dMWVBIKQorICAgIHsKKyAgICAgIG1jX2dldF9jdXJzb3JfZ2VvbWV0cnkg KHcsIG1hdHJpeCwgcm93LCB3LT5jdXJzb3IueCwgJm9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywg dy0+Y3Vyc29yLnZwb3MsICZvcG9pbnRfaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsICZvcG9pbnRfd2QpOworICAgICAgbWNfaGVscGVy ICh3LCBtYXRyaXgsIHJvdywgY3Vyc29yX2dseXBoLCB3LT5jdXJzb3IueCwgb3BvaW50X2Z4LCB3 LT5jdXJzb3IueSwKKyAgICAgICAgICAgICAgICAgb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywg dy0+Y3Vyc29yLnZwb3MsIG9wb2ludF93ZCwgb3BvaW50X2gsCisgICAgICAgICAgICAgICAgIGN1 cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgY3Vyc29yX2ZnLCBjdXJzb3Jf YmcsCisgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3 X3AsIGZyb21fd2hlcmUsCisgICAgICAgICAgICAgICAgIE5JTFAgKEJWQVIgKGIsIG1jX2NvbmYp KQorICAgICAgICAgICAgICAgICA/IENIX0NBQ0hFCisgICAgICAgICAgICAgICAgIDogTUNfQ0FD SEUsIENVUlNPUl9JTkRJQ0FUT1IpOworICAgIH0KKyAgZWxzZSBpZiAoIWN1cnNvcl9hdF9mcmlu Z2VfcAorICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGggIT0gTlVMTAorICAgICAgICAgICAmJiB2 cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID49IGhw b3Nfc3RhcnQKKyAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPCBocG9zX3N0YXJ0ICsgaHBv c19sZW5ndGgKKyAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT50eXBlID09IFNUUkVUQ0hfR0xZ UEgpCisgICAgeworICAgICAgLyogSWYgYSB1c2VyIGhhcyBzZXQgYHgtc3RyZXRjaC1jdXJzb3In IHRvIGEgbm9uLW5pbCB2YWx1ZSwgaGUvc2hlIGNob3NlIHRvCisgICAgICBoYXZlIGEgY3Vyc29y IHRoYXQgc3BhbnMgdGhlIGVudGlyZSBsZW5ndGggb2YgdGhlIFNUUkVUQ0hfR0xZUEguICovCisg ICAgICBpZiAoIXhfc3RyZXRjaF9jdXJzb3JfcCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRo ZSBNQ19IQkFSIHNoYWxsIGhhdmUgYSBgY3Vyc29yX3dpZHRoYCBvZiAxLiAqLworICAgICAgICAg IG1jX2dldF9jdXJzb3JfZ2VvbWV0cnkgKHcsIG1hdHJpeCwgcm93LCB3LT5jdXJzb3IueCwgJm9w b2ludF9meCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5jdXJzb3IueSwg Jm9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgdy0+Y3Vyc29yLnZwb3MsICZvcG9pbnRfaCwgTUNfSEJBUiwgMSwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmb3BvaW50X3dkKTsKKyAgICAgICAgICBtY19oZWxwZXIg KHcsIG1hdHJpeCwgcm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1cnNvci54LCBvcG9pbnRfZngsCisg ICAgICAgICAgICAgICAgICAgICB3LT5jdXJzb3IueSwgb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBv cywgdy0+Y3Vyc29yLnZwb3MsCisgICAgICAgICAgICAgICAgICAgICBvcG9pbnRfd2QsIG9wb2lu dF9oLCBNQ19IQkFSLCAxLCByb3dfcG9zaXRpb24sIGN1cnNvcl9mZywKKyAgICAgICAgICAgICAg ICAgICAgIGN1cnNvcl9iZywgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwg ZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgICAgIE5JTFAgKEJWQVIgKGIsIG1jX2NvbmYp KQorICAgICAgICAgICAgICAgICAgICAgPyBDSF9DQUNIRQorICAgICAgICAgICAgICAgICAgICAg OiBNQ19DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgICAgIH0KKyAgICAgIG1jX2dldF9j dXJzb3JfZ2VvbWV0cnkgKHcsIG1hdHJpeCwgcm93LCB3LT5jdXJzb3IueCwgJm9wb2ludF9meCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci55LCAmb3BvaW50X2Z5LCB3 LT5jdXJzb3IuaHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci52 cG9zLCAmb3BvaW50X2gsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgY3Vyc29yX3dpZHRoLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4 LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vyc29yLnks CisgICAgICAgICAgICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52 cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9oLAorICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwg Y3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGN1cnNvcl9mZywgY3Vyc29yX2JnLAorICAgICAg ICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLCBmcm9tX3do ZXJlLAorICAgICAgICAgICAgICAgICBOSUxQIChCVkFSIChiLCBtY19jb25mKSkKKyAgICAgICAg ICAgICAgICAgPyBDSF9DQUNIRQorICAgICAgICAgICAgICAgICA6IE1DX0NBQ0hFLCBDVVJTT1Jf SU5ESUNBVE9SKTsKKyAgICB9CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgRFJBVyBBTkQgUkVDT1JEIEZBS0UgQ1VSU09SUworKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisgIGlmICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgJiYgTklMUCAo QlZBUiAoYiwgbWNfaW5hY3RpdmVfd2luZG93cykpCisgICAgICAmJiBOSUxQIChCVkFSIChiLCBj aF9pbmFjdGl2ZV93aW5kb3dzKSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKGIsIGZjX2luYWN0aXZl X3dpbmRvd3MpKSkKKyAgICByZXR1cm47CisgIGlmIChocG9zX2xlbmd0aCA9PSAxKQorICAgIHsK KyAgICAgIGlmICghTklMUCAoQlZBUiAoYiwgbWNfY29uZikpCisgICAgICAgICAgJiYgKGVzc2Vu dGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisg ICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgbWNfaW5hY3RpdmVfd2luZG93cykp KSkpCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUaGUgc3BhY2UgYXBwZW5kZWQgdG8gYSByb3cg ZW5kaW5nIHdpdGggYSBuZXcgbGluZQorICAgICAgICAgIGRvZXMgbm90IGhhdmUgYSBgZ2x5cGgt PmNoYXJwb3NgICgtMSwgMCkgdGhhdCB3ZSBjYW4KKyAgICAgICAgICB1c2UgZm9yIHRoaXMgcGFy dGljdWxhciBhcHBsaWNhdGlvbi4gIFdoZW4gdGhlcmUgaXMgYQorICAgICAgICAgIGBidWZmZXIt ZGlzcGxheS10YWJsZScgZW50cnkgdGhhdCBhc3NpZ25zIGEgdmlzaWJsZQorICAgICAgICAgIGds eXBoIHRvIGEgbmV3IGxpbmUsIHRoZXJlIGlzIG5vIHByb2JsZW0gYmVjYXVzZSB0aGF0CisgICAg ICAgICAgZ2x5cGggaGFzIGEgYGdseXBoLT5jaGFycG9zJyB0aGF0IHdlIGNhbiB1c2UuICBXaGVu CisgICAgICAgICAgbm8gdmlzaWJsZSBFT0wgZ2x5cGggZXhpc3RzLCB3ZSB1c2UgdGhlIGZvbGxv d2luZworICAgICAgICAgIHRlc3Q6ICB0aGUgYXBwZW5kZWQgc3BhY2UgaGFzIGEgcG9zaXRpb24g dGhhdCBpcyBvbmUKKyAgICAgICAgICBsZXNzIHRoYW4gdGhlIGVuZCBvZiB0aGUgbWF0cml4IHJv dy4gKi8KKyAgICAgICAgICBpbnQgaHBvcyA9IHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVB XTsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnByZXZpb3VzX2dseXBoID0gKDAgPD0gaHBvcyAt IDEgJiYgaHBvcyAtIDEgPCByb3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgaHBvcyAt IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOVUxMOworICAg ICAgICAgIC8vIHN0cnVjdCBnbHlwaCAqbGFzdF9nbHlwaCA9IHJvdy0+Z2x5cGhzW1RFWFRfQVJF QV0gKyByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDE7CisgICAgICAgICAgYm9vbCBza2lwX3AgPSAo cHJldmlvdXNfZ2x5cGggIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICYmIHByZXZp b3VzX2dseXBoLT5jaGFycG9zID09IE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgLSAxCisg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgc3RhcnQtPmJ5dGVwb3MgIT0gZXNzZW50aWFscy56 dl9ieXRlKQorICAgICAgICAgICAgICAgICAgICAgICAgICA/IHRydWUKKyAgICAgICAgICAgICAg ICAgICAgICAgIC8qIFdoZW4gYSBgYnVmZmVyLWRpc3BsYXktdGFibGUnIGVudHJ5IGNvbnRhaW5z CisgICAgICAgICAgICAgICAgICAgICAgICBhIHZpc2libGUgdGFiIGNoYXJhY3RlciAoIsK7Iiks IHRoZSBzdWJzZXF1ZW50CisgICAgICAgICAgICAgICAgICAgICAgICBTVFJFVENIX0dMWVBIIHdp bGwgaGF2ZSB0aGUgc2FtZSBzdGFydC0+Y2hhcnBvcworICAgICAgICAgICAgICAgICAgICAgICAg YXMgdGhlIGFmb3JlbWVudGlvbmVkIHZpc2libGUgdGFiIGNoYXJhY3Rlci4gKi8KKyAgICAgICAg ICAgICAgICAgICAgICAgIDogKHByZXZpb3VzX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHByZXZpb3VzX2dseXBoLT5jaGFycG9zID09IHN0YXJ0LT5jaGFycG9z KQorICAgICAgICAgICAgICAgICAgICAgICAgICA/IHRydWUKKyAgICAgICAgICAgICAgICAgICAg ICAgIDogZmFsc2U7CisgICAgICAgICAgaW50IHBvc2ludCA9IChyb3dfcG9zaXRpb24gPT0gUE9T VF9aVikKKyAgICAgICAgICAgICAgICAgICAgICAgICA/IC0xCisgICAgICAgICAgICAgICAgICAg ICAgIDogKHJvd19wb3NpdGlvbiA9PSBBVF9aVikKKyAgICAgICAgICAgICAgICAgICAgICAgICAg PyBlc3NlbnRpYWxzLnp2CisgICAgICAgICAgICAgICAgICAgICAgIDogKHN0YXJ0LT5ieXRlcG9z ICE9IGVzc2VudGlhbHMuenZfYnl0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBzdGFy dCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKQor ICAgICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSAt IDEKKyAgICAgICAgICAgICAgICAgICAgICAgOiAoc3RhcnQtPmJ5dGVwb3MgPT0gZXNzZW50aWFs cy56dl9ieXRlCisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHN0YXJ0IC0gcm93LT5nbHlw aHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpCisgICAgICAgICAgICAg ICAgICAgICAgICAgPyBlc3NlbnRpYWxzLnp2CisgICAgICAgICAgICAgICAgICAgICAgIDogc3Rh cnQtPmNoYXJwb3M7CisgICAgICAgICAgTGlzcF9PYmplY3Qgc3BlY3MgPSBtY19hc3NvYyAobWFr ZV9maXhudW0gKHBvc2ludCksIEJWQVIgKGIsIG1jX2NvbmYpKTsKKyAgICAgICAgICBpZiAoKCho ZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgfHwgaGVh ZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAgICYmICFOSUxQIChzcGVjcykKKyAg ICAgICAgICAgICAgJiYgcm93LT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAg ICAgICAgICAmJiAhc2tpcF9wCisgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiAhPSBQT1NU X1pWKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBMaXNwX09iamVjdCBsaXNwX3R5cGUg PSBtY19udGggKDEsIHNwZWNzKTsKKyAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBj dXJzb3JfdHlwZSA9IChDT05TUCAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoWENBUiAo bGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogbWNfbGlzcF90b19jdXJzb3JfdHlwZSAobGlzcF90eXBlKTsKKyAgICAgICAgICAgICAg Y3Vyc29yX3R5cGUgPSAoc3RhcnQtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBNQ19IT0xMT1dfQk9YCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBjdXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aCA9IChDT05T UCAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gWEZJWE5V TSAoWENBUiAoWENEUiAobGlzcF90eXBlKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IC0xOworICAgICAgICAgICAgICBMaXNwX09iamVjdCBtY19mb3JlZ3JvdW5kID0gbWNf bnRoICgyLCBzcGVjcyk7CisgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAg ICAgICAgICAgICBpZiAoU1RSSU5HUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAg bWNfeHdfY29sb3JfdmFsdWVzICh3LCBtY19mb3JlZ3JvdW5kLCAmbHNsX2ZnKTsKKyAgICAgICAg ICAgICAgICBlbHNlIGlmIChWRUNUT1JQIChtY19mb3JlZ3JvdW5kKSkKKyAgICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbHNsX2ZnLnJlZCA9IFhGTE9BVF9EQVRBIChBUkVG IChtY19mb3JlZ3JvdW5kLCAwKSk7CisgICAgICAgICAgICAgICAgICAgIGxzbF9mZy5ncmVlbiA9 IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3JvdW5kLCAxKSk7CisgICAgICAgICAgICAgICAg ICAgIGxzbF9mZy5ibHVlID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDIpKTsK KyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKE5JTFAgKG1j X2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgICAgICBtY19jb2xvcl9waWNrZXIgKHcsIHN0 YXJ0LCBlc3NlbnRpYWxzLCAmbHNsX2ZnLCBwb3NpbnQsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUsIHJvd19wb3NpdGlvbiwgTVVMVElQTEVfQ1VSU09S Uyk7CisgICAgICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJp eCk7CisgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0aCAodywgVEVY VF9BUkVBKTsKKyAgICAgICAgICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgc3RhcnQs IFRFWFRfQVJFQSwgeCwgeF9saW1pdCwgcm93LT55LAorICAgICAgICAgICAgICAgICAgICAgICAg IHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwgdnBvcywgY3Vyc29yX3R5cGUsCisgICAg ICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoLCBjdXJzb3JfbWF0cml4LCBlc3NlbnRp YWxzLCByb3dfcG9zaXRpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgbHNsX2ZnLCBNVUxU SVBMRV9DVVJTT1JTLCBkcmF3X3AsIGZyb21fd2hlcmUsIE1DX0NBQ0hFKTsKKyAgICAgICAgICAg IH0KKyAgICAgICAgfQorICAgICAgaWYgKCFOSUxQIChCVkFSIChiLCBmY192aXNpYmxlKSkKKyAg ICAgICAgICAmJiAoZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICB8fCAoIWVzc2Vu dGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBmY19p bmFjdGl2ZV93aW5kb3dzKSkpKQorICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA8PSB0ZXh0 X2FyZWFfd2lkdGgKKyAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPj0gdy0+bWMubG51bV9w aXhlbF93aWR0aCkKKyAgICAgICAgeworICAgICAgICAgIGludCB4X2xpbWl0ID0geCArIHN0YXJ0 LT5waXhlbF93aWR0aDsKKyAgICAgICAgICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9ICh3LT5j dXJzb3IueCA9PSBlc3NlbnRpYWxzLmZjX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiB3LT5jdXJzb3IueSA9PSByb3ctPnkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBzdGFydCAtIHJvdy0+Z2x5cGhzW1RF WFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJz b3IudnBvcyA9PSB2cG9zKTsKKyAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAg ICAgICBtY19jb2xvcl9waWNrZXIgKHcsIHN0YXJ0LCBlc3NlbnRpYWxzLCAmbHNsX2ZnLCAtMSwg TUNfQkFSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93X3Bvc2l0aW9uLCBGSUxMX0NP TFVNTik7CisgICAgICAgICAgaWYgKHggKyBzdGFydC0+cGl4ZWxfd2lkdGggPD0gdGV4dF9hcmVh X3dpZHRoCisgICAgICAgICAgICAgICYmICgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9z ID4gMCkKKyAgICAgICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAg ICAgICAgICAgICAmJiAoKHN0YXJ0ICE9IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVz ZWRbVEVYVF9BUkVBXSAtIDEKKyAgICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3gg Pj0geAorICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA8IHggKyBzdGFydC0+ cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICB8fCAoc3RhcnQgPT0gcm93LT5nbHlwaHNb VEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMQorICAgICAgICAgICAgICAgICAg ICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSB4KSkKKyAgICAgICAgICAgICAgJiYgcm93LT55IDw9 IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1 cnNvcl9wKQorICAgICAgICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgc3RhcnQsIFRF WFRfQVJFQSwgeCwgeF9saW1pdCwgcm93LT55LAorICAgICAgICAgICAgICAgICAgICAgICBzdGFy dCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sIHZwb3MsIE1DX0JBUiwgMSwKKyAgICAgICAgICAg ICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBsc2xf ZmcsCisgICAgICAgICAgICAgICAgICAgICAgIEZJTExfQ09MVU1OLCBkcmF3X3AsIGZyb21fd2hl cmUsIEZDX0NBQ0hFKTsKKyAgICAgICAgfQorICAgICAgaWYgKCFOSUxQIChCVkFSIChiLCBjcm9z c2hhaXJzKSkKKyAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfaG9yaXpvbnRhbF9ydWxl cikpCisgICAgICAgICAgJiYgKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgfHwg KCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAo YiwgY2hfaW5hY3RpdmVfd2luZG93cykpKSkKKyAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNv ci52cG9zKQorICAgICAgICB7CisgICAgICAgICAgaW50IHhfbGltaXQgPSAoc3RhcnQgPT0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSkKKyAgICAgICAg ICAgICAgICAgICAgICAgID8gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAg ICA6IHggKyBzdGFydC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xf Zmc7CisgICAgICAgICAgbWNfY29sb3JfcGlja2VyICh3LCBzdGFydCwgZXNzZW50aWFscywgJmxz bF9mZywgLTEsIE1DX0hCQVIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICByb3dfcG9zaXRp b24sIEhPUklaT05UQUxfUlVMRVIpOworICAgICAgICAgIC8qIFByZXNlcnZlIHN1cHBvcnQgZm9y IGRlZmF1bHQgYmVoYXZpb3Igc3VjaCB0aGF0IGEgdXNlciBtYXkKKyAgICAgICAgICBzcGVjaWZ5 IHRoZSBoZWlnaHQgb2YgYW4gTUNfSEJBUiwgd2hpY2ggYmVnaW5zIGl0cyBqb3VybmV5CisgICAg ICAgICAgYXMgdGhlIGBjdXJzb3Jfd2lkdGgnLiAgYG1jX2dldF9jdXJzb3JfZ2VvbWV0cnknIHJl YWRqdXN0cy4gKi8KKyAgICAgICAgICBtY19lbmdpbmUgKHcsIG1hdHJpeCwgcm93LCBzdGFydCwg VEVYVF9BUkVBLCB4LCB4X2xpbWl0LCByb3ctPnksCisgICAgICAgICAgICAgICAgICAgICBzdGFy dCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sIHZwb3MsIE1DX0hCQVIsIDEsCisgICAgICAgICAg ICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGxzbF9m ZywKKyAgICAgICAgICAgICAgICAgICAgIEhPUklaT05UQUxfUlVMRVIsIGRyYXdfcCwgZnJvbV93 aGVyZSwgQ0hfQ0FDSEUpOworICAgICAgICB9CisgICAgICBpZiAoIU5JTFAgKEJWQVIgKGIsIGNy b3NzaGFpcnMpKQorICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxl cikpCisgICAgICAgICAgJiYgKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgfHwg KCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAo YiwgY2hfaW5hY3RpdmVfd2luZG93cykpKSkKKyAgICAgICAgICAmJiAhZmlsbF9jb2x1bW5fdHJ1 bXBzX3ApCisgICAgICAgIHsKKyAgICAgICAgICBjdXJzb3JfdHlwZSA9IChzdGFydC0+dHlwZSA9 PSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfSE9MTE9XX0JPWAor ICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19CQVI7CisgICAgICAgICAgaW50IHhfbGltaXQg PSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOworICAgICAgICAgIGJvb2wgcmVhbF9m YWtlX2N1cnNvcl9wID0gKHctPmN1cnNvci55ID09IHJvdy0+eQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAg IHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAgICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywgc3Rh cnQsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0xLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgVkVSVElDQUxfUlVMRVIpOworICAgICAgICAgIGlm ICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICB8 fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAgJiYgKChzdGFydCAhPSBy b3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxCisgICAgICAg ICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0geAorICAgICAgICAgICAgICAgICAgICYmIHct PmN1cnNvci54IDwgeCArIHN0YXJ0LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgIHx8 IChzdGFydCA9PSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0g LSAxCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0geCkpCisgICAgICAg ICAgICAgICYmIHJvdy0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAg ICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0 cml4LCByb3csIHN0YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGltaXQsIHJvdy0+eSwKKyAgICAgICAg ICAgICAgICAgICAgICAgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLCB2cG9zLCBjdXJz b3JfdHlwZSwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50 aWFscywgcm93X3Bvc2l0aW9uLCBsc2xfZmcsCisgICAgICAgICAgICAgICAgICAgICAgIFZFUlRJ Q0FMX1JVTEVSLCBkcmF3X3AsIGZyb21fd2hlcmUsIENIX0NBQ0hFKTsKKyAgICAgICAgfQorICAg IH0KKyAgICBlbHNlCisgICAgICB7CisgICAgICAgIGludCByZWxhdGl2ZV94ID0gMDsKKyAgICAg ICAgZm9yIChpbnQgYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFyZWEgPCBMQVNUX0FSRUE7ICsr YXJlYSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoID0gcm93 LT5nbHlwaHNbYXJlYV07CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoX2VuZCA9IGds eXBoICsgcm93LT51c2VkW2FyZWFdOworICAgICAgICAgICAgLyogR2x5cGggZm9yIGEgbGluZSBl bmQgaW4gdGV4dC4gKi8KKyAgICAgICAgICAgIGlmIChhcmVhID09IFRFWFRfQVJFQSAmJiBnbHlw aCA9PSBnbHlwaF9lbmQgJiYgZ2x5cGgtPmNoYXJwb3MgPiAwKQorICAgICAgICAgICAgICArK2ds eXBoX2VuZDsKKyAgICAgICAgICAgIGZvciAoOyBnbHlwaCA8IGdseXBoX2VuZDsgKytnbHlwaCkK KyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmICh2cG9zICE9IHctPmN1cnNvci52 cG9zCisgICAgICAgICAgICAgICAgICAgICYmIGdseXBoICE9IGdseXBoX2VuZCAtIDEKKyAgICAg ICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194IDwgcmVsYXRpdmVfeAorICAgICAgICAg ICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA8IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAg ICAgJiYgTklMUCAoQlZBUiAoYiwgbWNfY29uZikpKQorICAgICAgICAgICAgICAgICAgYnJlYWs7 CisgICAgICAgICAgICAgICAgaWYgKCFOSUxQIChCVkFSIChiLCBtY19jb25mKSkKKyAgICAgICAg ICAgICAgICAgICAgJiYgKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAg ICAgIHx8ICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmICFOSUxQIChCVkFSIChiLCBtY19pbmFjdGl2ZV93aW5kb3dzKSkpKSkKKyAgICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLyogVGhlIHNwYWNlIGFwcGVuZGVkIHRvIGEg cm93IGVuZGluZyB3aXRoIGEgbmV3IGxpbmUgZG9lcworICAgICAgICAgICAgICAgICAgICBub3Qg aGF2ZSBhIGBnbHlwaC0+Y2hhcnBvc2AgKC0xLCAwKSB0aGF0IHdlIGNhbiB1c2UgZm9yIHRoaXMK KyAgICAgICAgICAgICAgICAgICAgcGFydGljdWxhciBhcHBsaWNhdGlvbi4gIFdoZW4gYSBgYnVm ZmVyLWRpc3BsYXktdGFibGUnIGVudHJ5CisgICAgICAgICAgICAgICAgICAgIGFzc2lnbnMgYSB2 aXNpYmxlIGdseXBoIHRvIGEgbmV3IGxpbmUsIHRoZXJlIGlzIG5vIHByb2JsZW0KKyAgICAgICAg ICAgICAgICAgICAgYmVjYXVzZSB0aGF0IGdseXBoIGhhcyBhIGBnbHlwaC0+Y2hhcnBvcycgdGhh dCB3ZSBjYW4gdXNlLgorICAgICAgICAgICAgICAgICAgICBXaGVuIG5vIHZpc2libGUgRU9MIGds eXBoIGV4aXN0cywgd2UgdXNlIHRoZSBmb2xsb3dpbmcgdGVzdDoKKyAgICAgICAgICAgICAgICAg ICAgdGhlIGFwcGVuZGVkIHNwYWNlIGhhcyBhIHBvc2l0aW9uIHRoYXQgaXMgb25lIGxlc3MgdGhh biB0aGUKKyAgICAgICAgICAgICAgICAgICAgZW5kIG9mIHRoZSBtYXRyaXggcm93LiAqLworICAg ICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVB XTsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoICpwcmV2aW91c19nbHlwaCA9ICgw IDw9IGhwb3MgLSAxICYmIGhwb3MgLSAxIDwgcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IHJvdy0+Z2x5cGhz W1RFWFRfQVJFQV0gKyBocG9zIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiBOVUxMOworICAgICAgICAgICAgICAgICAgICAvLyBzdHJ1Y3Qg Z2x5cGggKmxhc3RfZ2x5cGggPSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RF WFRfQVJFQV0gLSAxOworICAgICAgICAgICAgICAgICAgICBib29sIHNraXBfcCA9IChwcmV2aW91 c19nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHBy ZXZpb3VzX2dseXBoLT5jaGFycG9zID09IE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgLSAx CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT5ieXRlcG9zICE9 IGVzc2VudGlhbHMuenZfYnl0ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gdHJ1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFdoZW4gYSBgYnVm ZmVyLWRpc3BsYXktdGFibGUnIGVudHJ5IGNvbnRhaW5zCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgYSB2aXNpYmxlIHRhYiBjaGFyYWN0ZXIgKCLCuyIpLCB0aGUgc3Vic2VxdWVu dAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNUUkVUQ0hfR0xZUEggd2lsbCBo YXZlIHRoZSBzYW1lIGdseXBoLT5jaGFycG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgYXMgdGhlIGFmb3JlbWVudGlvbmVkIHZpc2libGUgdGFiIGNoYXJhY3Rlci4gKi8KKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChwcmV2aW91c19nbHlwaCAhPSBOVUxM CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcHJldmlvdXNfZ2x5cGgt PmNoYXJwb3MgPT0gZ2x5cGgtPmNoYXJwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IHRydWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGZhbHNl OworICAgICAgICAgICAgICAgICAgICBpbnQgcG9zaW50ID0gKHJvd19wb3NpdGlvbiA9PSBQT1NU X1pWKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IC0xCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IChyb3dfcG9zaXRpb24gPT0gQVRfWlYpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGVzc2VudGlhbHMuenYKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoLT5ieXRlcG9zICE9IGVzc2VudGlhbHMuenZf Ynl0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGggLSByb3ct PmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cp IC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGgtPmJ5dGVwb3Mg PT0gZXNzZW50aWFscy56dl9ieXRlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW1RFWFRfQVJF QV0gLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGVzc2VudGlhbHMu enYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogZ2x5cGgtPmNoYXJwb3M7Cisg ICAgICAgICAgICAgICAgICAgIExpc3BfT2JqZWN0IHNwZWNzID0gbWNfYXNzb2MgKG1ha2VfZml4 bnVtIChwb3NpbnQpLCBCVkFSIChiLCBtY19jb25mKSk7CisgICAgICAgICAgICAgICAgICAgIGlm ICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICAg ICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAgICAgICAg ICAgICAmJiAhTklMUCAoc3BlY3MpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnkg PD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAh c2tpcF9wCisgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gIT0gUE9TVF9a VikKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBMaXNw X09iamVjdCBsaXNwX3R5cGUgPSBtY19udGggKDEsIHNwZWNzKTsKKyAgICAgICAgICAgICAgICAg ICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUgPSAoQ09OU1AgKGxpc3BfdHlw ZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBtY19saXNwX3RvX2N1cnNvcl90eXBlIChYQ0FSIChsaXNwX3R5cGUpKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogbWNf bGlzcF90b19jdXJzb3JfdHlwZSAobGlzcF90eXBlKTsKKyAgICAgICAgICAgICAgICAgICAgICAg IGN1cnNvcl90eXBlID0gKGdseXBoLT50eXBlID09IElNQUdFX0dMWVBIKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0hPTExPV19CT1gKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiBjdXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAgICAg ICAgICAgIGludCBjdXJzb3Jfd2lkdGggPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBYRklYTlVNIChYQ0FSIChYQ0RSIChs aXNwX3R5cGUpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IC0xOworICAgICAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3QgbWNfZm9yZWdyb3VuZCA9 IG1jX250aCAoMiwgc3BlY3MpOworICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JH QiBsc2xfZmc7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoU1RSSU5HUCAobWNfZm9yZWdy b3VuZCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX3h3X2NvbG9yX3ZhbHVlcyAodywg bWNfZm9yZWdyb3VuZCwgJmxzbF9mZyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Ug aWYgKFZFQ1RPUlAgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxzbF9mZy5yZWQgPSBYRkxPQVRfREFU QSAoQVJFRiAobWNfZm9yZWdyb3VuZCwgMCkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgbHNsX2ZnLmdyZWVuID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDEpKTsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxzbF9mZy5ibHVlID0gWEZMT0FUX0RBVEEg KEFSRUYgKG1jX2ZvcmVncm91bmQsIDIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoTklMUCAobWNfZm9yZWdyb3Vu ZCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtY19jb2xvcl9waWNrZXIgKHcsIGds eXBoLCBlc3NlbnRpYWxzLCAmbHNsX2ZnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBwb3NpbnQsIGN1cnNvcl90eXBlLCByb3dfcG9zaXRpb24sCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1VTFRJUExFX0NVUlNP UlMpOworICAgICAgICAgICAgICAgICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1Mg KHJvdywgbWF0cml4KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gd2lu ZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1j X2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4X2xpbWl0LCByb3ctPnksIGdseXBoIC0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg dnBvcywgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgY3Vyc29yX21hdHJpeCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBsc2xf ZmcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1VTFRJUExFX0NVUlNPUlMs IGRyYXdfcCwgZnJvbV93aGVyZSwgTUNfQ0FDSEUpOworICAgICAgICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKGIs IGZjX3Zpc2libGUpKQorICAgICAgICAgICAgICAgICAgICAmJiAoZXNzZW50aWFscy5hY3RpdmVf cAorICAgICAgICAgICAgICAgICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGZjX2luYWN0aXZlX3dp bmRvd3MpKSkpCisgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA8PSB0ZXh0 X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID49IHct Pm1jLmxudW1fcGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAg ICAgICAgIGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAg ICAgICAgICAgICAgICAgICAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3AgPSAody0+Y3Vyc29yLngg PT0gZXNzZW50aWFscy5mY194CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIHctPmN1cnNvci55ID09IHJvdy0+eQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBnbHlwaCAtIHJv dy0+Z2x5cGhzW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnZwb3MgPT0gdnBvcyk7CisgICAgICAgICAgICAgICAg ICAgIGludCBocG9zID0gZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAg ICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICAgICAgICAgICAgbWNf Y29sb3JfcGlja2VyICh3LCBnbHlwaCwgZXNzZW50aWFscywgJmxzbF9mZywgLTEsIE1DX0JBUiwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb3dfcG9zaXRpb24sIEZJTExf Q09MVU1OKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGhwb3MgPj0gaHBvc19zdGFydAorICAg ICAgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA8IGhwb3Nfc3RhcnQgKyBocG9zX2xlbmd0aAor ICAgICAgICAgICAgICAgICAgICAgICAgJiYgcmVsYXRpdmVfeCArIGdseXBoLT5waXhlbF93aWR0 aCA8PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICgoaGVhZGVy X2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID4gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICYm ICgoZ2x5cGggIT0gZ2x5cGhfZW5kIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBlc3NlbnRpYWxzLmZjX3ggPj0gcmVsYXRpdmVfeAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPCByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRo KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChnbHlwaCA9PSBnbHlwaF9lbmQgLSAx CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSBy ZWxhdGl2ZV94KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+eSA8PSB3aW5kb3df dGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICFyZWFsX2Zha2Vf Y3Vyc29yX3ApCisgICAgICAgICAgICAgICAgICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJv dywgZ2x5cGgsIGFyZWEsIHJlbGF0aXZlX3gsIHhfbGltaXQsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICByb3ctPnksIGhwb3MsIHZwb3MsIE1DX0JBUiwgMSwgY3Vyc29yX21hdHJp eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMsIHJvd19wb3Np dGlvbiwgbHNsX2ZnLCBGSUxMX0NPTFVNTiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGRyYXdfcCwgZnJvbV93aGVyZSwgRkNfQ0FDSEUpOworICAgICAgICAgICAgICAgICAgfQor ICAgICAgICAgICAgICAgIGlmICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAg ICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9ob3Jpem9udGFsX3J1bGVyKSkKKyAg ICAgICAgICAgICAgICAgICAgJiYgKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgIHx8ICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkpKQorICAgICAg ICAgICAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zKQorICAgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgICBpbnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGgg KHcsIFRFWFRfQVJFQSk7CisgICAgICAgICAgICAgICAgICAgIGludCBocG9zID0gZ2x5cGggLSBy b3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdC IGxzbF9mZzsKKyAgICAgICAgICAgICAgICAgICAgbWNfY29sb3JfcGlja2VyICh3LCBnbHlwaCwg ZXNzZW50aWFscywgJmxzbF9mZywgLTEsIE1DX0hCQVIsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgcm93X3Bvc2l0aW9uLCBIT1JJWk9OVEFMX1JVTEVSKTsKKyAgICAgICAg ICAgICAgICAgICAgLyogUHJlc2VydmUgc3VwcG9ydCBmb3IgZGVmYXVsdCBiZWhhdmlvciBzdWNo IHRoYXQgYSB1c2VyIG1heQorICAgICAgICAgICAgICAgICAgICBzcGVjaWZ5IHRoZSBoZWlnaHQg b2YgYW4gTUNfSEJBUiwgd2hpY2ggYmVnaW5zIGl0cyBqb3VybmV5CisgICAgICAgICAgICAgICAg ICAgIGFzIHRoZSBgY3Vyc29yX3dpZHRoJy4gIGBtY19nZXRfY3Vyc29yX2dlb21ldHJ5JyByZWFk anVzdHMuICovCisgICAgICAgICAgICAgICAgICAgIGlmIChocG9zID49IGhwb3Nfc3RhcnQKKyAg ICAgICAgICAgICAgICAgICAgICAgICYmIGhwb3MgPCBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGgp CisgICAgICAgICAgICAgICAgICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgs IGFyZWEsIHJlbGF0aXZlX3gsIHhfbGltaXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICByb3ctPnksIGhwb3MsIHZwb3MsIE1DX0hCQVIsIDEsIGN1cnNvcl9tYXRyaXgsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGxz bF9mZywgSE9SSVpPTlRBTF9SVUxFUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGRyYXdfcCwgZnJvbV93aGVyZSwgQ0hfQ0FDSEUpOworICAgICAgICAgICAgICAgICAgfQorICAg ICAgICAgICAgICAgIGlmICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAg ICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAg ICAgICAgICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAg ICAgICB8fCAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfaW5hY3RpdmVfd2luZG93cykpKSkKKyAgICAgICAgICAg ICAgICAgICAgJiYgIWZpbGxfY29sdW1uX3RydW1wc19wKQorICAgICAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IChnbHlwaC0+dHlwZSA9PSBJTUFHRV9H TFlQSCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0hPTExPV19CT1gK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0JBUjsKKyAgICAgICAgICAg ICAgICAgICAgaW50IHhfbGltaXQgPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOwor ICAgICAgICAgICAgICAgICAgICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9ICh3LT5jdXJzb3Iu eSA9PSByb3ctPnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgdy0+Y3Vyc29yLnZwb3MgPT0gdnBvcyk7CisgICAgICAgICAgICAgICAgICAgIGludCBo cG9zID0gZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgICAgICAgICAg ICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICAgICAgICAgICAgbWNfY29sb3JfcGlj a2VyICh3LCBnbHlwaCwgZXNzZW50aWFscywgJmxzbF9mZywgLTEsIGN1cnNvcl90eXBlLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgVkVSVElDQUxf UlVMRVIpOworICAgICAgICAgICAgICAgICAgICBpZiAoaHBvcyA+PSBocG9zX3N0YXJ0CisgICAg ICAgICAgICAgICAgICAgICAgICAmJiBocG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoCisg ICAgICAgICAgICAgICAgICAgICAgICAmJiAoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBv cyA+IDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0 ID09IDApCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoKGdseXBoICE9IGdseXBoX2VuZCAt IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0gcmVsYXRp dmVfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA8IHJlbGF0 aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg fHwgKGdseXBoID09IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgdy0+Y3Vyc29yLnggPj0gcmVsYXRpdmVfeCkpCisgICAgICAgICAgICAgICAgICAgICAg ICAmJiByb3ctPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICAg ICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAgICAgICAgICAgICAgIG1j X2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4X2xpbWl0 LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT55LCBocG9zLCB2cG9zLCBj dXJzb3JfdHlwZSwgMSwgY3Vyc29yX21hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgbHNsX2ZnLCBWRVJUSUNBTF9SVUxFUiwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdfcCwgZnJvbV93aGVyZSwgQ0hf Q0FDSEUpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJlbGF0aXZlX3gg Kz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAg ICAgfQorICAvLyAgY2xvY2tfdCBjbG9ja19lbmQgPSBjbG9jaygpOworICAvLyAgZG91YmxlIGNw dV90aW1lX3VzZWQgPSAoKGRvdWJsZSkgKGNsb2NrX2VuZCAtIGNsb2NrX3N0YXJ0KSkgLyBDTE9D S1NfUEVSX1NFQzsKKyAgLy8gIGZwcmludGYgKHN0ZGVyciwgIm1jX2RyYXdfcm93ICglcyk6ICBU SU1FICglZilcbiIsIG1jX3dpbmRvdyAodyksIGNwdV90aW1lX3VzZWQpOworfQorCitib29sCitt Y19yZWRyYXdfcm93IChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRy aXgsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKKyAgICAgICAgICAgICAgIGVudW0gZ2x5cGhfcm93 X2FyZWEgYXJlYSwgaW50IHN0YXJ0X3gsIGludCBzdGFydF9ocG9zLCBpbnQgZW5kX2hwb3MsCisg ICAgICAgICAgICAgICBib29sIGNsZWFyX2VvbF9wLCBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UgaGws CisgICAgICAgICAgICAgICBlbnVtIG1jX3JlZHJhd19yb3dfdHlwZSBmcm9tX3doZXJlKQorewor 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yAgICAgIEZSQU1F X1JJRiAoZiktPmNsZWFyX2VuZF9vZl9saW5lICh3LCByb3csIFRFWFRfQVJFQSwgLTEpOworICAg IH0KKyAgLy8gIGNsb2NrX3N0YXJ0ID0gY2xvY2soKTsKKyAgaW50IHZudGggPSBNQVRSSVhfUk9X X1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgLyogU1RSRVRDSF9HTFlQSCBtYXkgY29udGFpbiBtb3Jl IHRoYW4gb25lIGZha2UgY3Vyc29yIGF0IHRoZSBzYW1lIEhQT1MuICovCisgIGZvciAoZW51bSBt Y19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICBjYWNoZV90eXBlIDwg Tk9fQ0FDSEU7CisgICAgICAgKytjYWNoZV90eXBlKQorICAgIHsKKyAgICAgIGZvciAoaW50IG50 aCA9IDA7CisgICAgICAgICAgIG1jX3RyYXZlcnNlX2NhY2hlX3AgKHctPm1jX21hdHJpeCwgY2Fj aGVfdHlwZSwgdm50aCwgbnRoKTsKKyAgICAgICAgICAgKytudGgpCisgICAgICAgIHsKKyAgICAg ICAgICBpbnQgeCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF0ueDsKKyAgICAgICAgICBpbnQgZnggPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhdLmZ4OworICAgICAgICAgIGludCB5ID0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS55OworICAgICAgICAgIGludCBmeSA9IHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZnk7CisgICAgICAgICAg aW50IGhwb3MgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhd Lmhwb3M7CisgICAgICAgICAgaW50IHZwb3MgPSB3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iA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0u YmcuZ3JlZW4sCisgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5iZy5ibHVlfTsK KyAgICAgICAgICBib29sIGFjdGl2ZV9wID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXS5hY3RpdmVfcDsKKyAgICAgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlw aF9mbGF2b3IgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhd LmdseXBoX2ZsYXZvcjsKKyAgICAgICAgICBib29sIGVuYWJsZWRfcCA9IHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZW5hYmxlZF9wOworICAgICAgICAgIGlm ICh2cG9zID09IHZudGgKKyAgICAgICAgICAgICAgJiYgKChocG9zID49IHN0YXJ0X2hwb3MKKyAg ICAgICAgICAgICAgICAgICAmJiBocG9zIDwgZW5kX2hwb3MpCisgICAgICAgICAgICAgICAgICAv KiBBIGZsb2F0aW5nIGN1cnNvciBiZXlvbmQgdGhlIGVuZCBvZiB0aGUgZ2x5cGggcm93LiAqLwor ICAgICAgICAgICAgICAgICAgfHwgKGhwb3MgKyAxID09IHN0YXJ0X2hwb3MKKyAgICAgICAgICAg ICAgICAgICAgICAmJiBocG9zICsgMSA9PSBlbmRfaHBvcykpCisgICAgICAgICAgICAgICYmIGVu YWJsZWRfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgYm9vbCByZW1vdmVfcCA9IGZh bHNlOworICAgICAgICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgbWF0cml4LCByb3cs IHgs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gKCVzKSB8IHZwb3MgKCVkKVxuIiwK KyAgLy8gICAgICBtY193aW5kb3cgKHcpLCBtY19jYWNoZV90eXBlX3RvX3N0cmluZyAoY2FjaGVf dHlwZSksIHZudGgpOworICBmb3IgKGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlID0gTUNf Q0FDSEU7CisgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICsrY2FjaGVfdHlw ZSkKKyAgICB7CisgICAgICBmb3IgKGludCBudGggPSAwOworICAgICAgICAgICBtY190cmF2ZXJz ZV9jYWNoZV9wICh3LT5tY19tYXRyaXgsIGNhY2hlX3R5cGUsIHZudGgsIG50aCk7CisgICAgICAg ICAgICsrbnRoKQorICAgICAgICB7CisgICAgICAgICAgaW50IHggPSB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLng7CisgICAgICAgICAgaW50IGZ4ID0gdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5meDsKKyAgICAgICAg ICBpbnQgeSA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0u eTsKKyAgICAgICAgICBpbnQgZnkgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhdLmZ5OworICAgICAgICAgIGludCBocG9zID0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5ocG9zOworICAgICAgICAgIGludCB2cG9zID0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS52cG9zOworICAg ICAgICAgIGludCB3ZCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF0ud2Q7CisgICAgICAgICAgaW50IGggPSB3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X3R5cGVdW250aF0uYmcuYmx1ZX07CisgICAgICAgICAgYm9vbCBhY3RpdmVfcCA9IHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYWN0aXZlX3A7Cisg ICAgICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5nbHlwaF9mbGF2b3I7CisgICAgICAgICAgYm9v bCBlbmFibGVkX3AgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLmVuYWJsZWRfcDsKKyAgICAgICAgICAvKiBgbWF0cml4X3JvdycgaW4gYGRpc3BuZXcuY2Ag Y29udGFpbnMgdGhlIGZvbGxvd2luZyB0ZXN0cywKKyAgICAgICAgICBlYXNzZXJ0IChtYXRyaXgg JiYgbWF0cml4LT5yb3dzKTsKKyAgICAgICAgICBlYXNzZXJ0IChyb3cgPj0gMCAmJiByb3cgPCBt YXRyaXgtPm5yb3dzKTsgKi8KKyAgICAgICAgICBib29sIGJhcmZfY3Jhc2hfb25lID0gKG1hdHJp eCAmJiBtYXRyaXgtPnJvd3MpID8gZmFsc2UgOiB0cnVlOworICAgICAgICAgIGlmIChiYXJmX2Ny YXNoX29uZSkKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgIGJvb2wgYmFyZl9jcmFz aF90d28gPSAodnBvcyA+PSAwICYmIHZwb3MgPCBtYXRyaXgtPm5yb3dzKSA/IGZhbHNlIDogdHJ1 ZTsKKyAgICAgICAgICBpZiAoYmFyZl9jcmFzaF90d28pCisgICAgICAgICAgICBjb250aW51ZTsK KyAgICAgICAgICBpZiAodnBvcyA9PSB2bnRoCisgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZv ciA9PSBNQ19HTFlQSAorICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgICB7 CisgICAgICAgICAgICAgIG1jX2VyYXNlX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIHksIGhw b3MsIHZwb3MsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkKTsKKyAgICAgICAgICAgICAg dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFibGVkX3Ag PSBmYWxzZTsKKyAgICAgICAgICAgICAgLS13LT5tY19tYXRyaXguY3Vyc29yc191c2VkW2NhY2hl X3R5cGVdOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAodnBvcyA9PSB2bnRo CisgICAgICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICBib29sIHJlbW92ZV9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICBtY19k cmF3X2VyYXNlX2h5YnJpZCAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBv cywgd2QsIGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90 eXBlLCBjdXJzb3Jfd2lkdGgsIGxzbF9iZywgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgcmVtb3ZlX3ApOworICAgICAgICAgICAg ICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZW5hYmxl ZF9wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgLS13LT5tY19tYXRyaXguY3Vyc29yc191c2Vk W2NhY2hlX3R5cGVdOworICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIHctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV0gPSAwOworICAgIH0KK30KKwor LyogR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uLmhlaWdodCA9PSAxMDgwIC0gNTQwID09IDU0MAorICB8 ICAgICAgICAgICAgIHwgICAgW1RoZSBlbnRpcmUgYm90dG9tIHJlY3RhbmdsZSBnZXRzIGNvcGll ZCB0byB1cHBlciBydW4uZGVzaXJlZF95Ll0KKyAgfCAgICAgICAgICAgICB8CisgICstLS0tLS0t LS0tLS0tKyA8PSBydW4uY3VycmVudF95ID09IDU0MAorICB8ICAgICAgICAgICAgIHwKKyAgfCAg ICAgICAgICAgICB8IDw9IHJ1bi5kZXNpcmVkX3kgPT0gODEwIFtkb3duICjihpMpXSA9PSBydW4u Y3VycmVudF95ID4gcnVuLmRlc2lyZWRfeQorICB8ICAgICAgICAgICAgIHwgICAgcnVuLmhlaWdo dCA9IGl0Lmxhc3RfdmlzaWJsZV95IC0gcnVuLmRlc2lyZWRfeQorICB8ICAgICAgICAgICAgIHwg ICAgcnVuLmhlaWdodCA9PSAxMDgwIC0gODEwID09IDI3MAorICB8ICAgICAgICAgICAgIHwgICAg W1RvcCBwYXJ0IG9mIHRoZSBsb3dlciByZWN0YW5nbGUgZ2V0cyBjb3BpZWQgdG8gbG93ZXIgcnVu LmRlc2lyZWRfeS5dCisgIHwgICAgICAgICAgICAgfAorICArLS0tLS0tLS0tLS0tLSsgPD0gaXQu bGFzdF92aXNpYmxlX3kgPT0gMTA4MCAqLwordm9pZAorbWNfcHJlX3Njcm9sbF9jbGVhbiAoc3Ry dWN0IHdpbmRvdyAqdywgc3RydWN0IHJ1biBydW4sIGludCBzdGFydF92cG9zLAorICAgICAgICAg ICAgICAgICAgICAgaW50IG5yb3dzX3Njcm9sbGVkLCBlbnVtIG1jX3ByZV9zY3JvbGxfY2xlYW5f dHlwZSBmcm9tX3doZXJlKQoreworICBpZiAoTUlOSV9XSU5ET1dfUCAodykpCisgICAgcmV0dXJu OworICBib29sIGdvX29uZV9wID0gKHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbTUNfQ0FDSEVd ID4gMAorICAgICAgICAgICAgICAgICAgIHx8IHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbQ0hf Q0FDSEVdID4gMAorICAgICAgICAgICAgICAgICAgIHx8IHctPm1jX21hdHJpeC5jdXJzb3JzX3Vz ZWRbRkNfQ0FDSEVdID4gMCk7CisgIGJvb2wgZ29fdHdvX3AgPSAoQlVGRkVSUCAody0+Y29udGVu dHMpCisgICAgICAgICAgICAgICAgICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICB8fCAhTklMUCAoQlZB UiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAgICAgICAg ICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKSk7 CisgIGlmIChtY19zdGRlcnJfcCkKKyAgICBmcHJpbnRmIChzdGRlcnIsICJtY19wcmVfc2Nyb2xs X2NsZWFuICglcyk6XG5cCisgICVzIHwgZ29fb25lX3AgKCVzKSB8IGdvX3R3b19wICglcylcblwK KyAgc3RhcnRfdnBvcyAoJWQpIHwgbnJvd3Nfc2Nyb2xsZWQgKCVkKVxuXAorICAlczogIHJ1bi5j dXJyZW50L2Rlc2lyZWRfeSAoJWQvJWQpIHwgcnVuLmhlaWdodCAoJWQpXG4iLAorICAgIG1jX3dp bmRvdyAodyksIChmcm9tX3doZXJlID09IFRSWV9XSU5ET1dfUkVVU0lOR19DVVJSRU5UX01BVFJJ WF9ET1dOKQorICAgICAgICAgICAgICAgICAgICAgPyAiVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJF TlRfTUFUUklYX0RPV04iCisgICAgICAgICAgICAgICAgICAgOiAoZnJvbV93aGVyZSA9PSBUUllf V0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfVVApCisgICAgICAgICAgICAgICAgICAgICA/ ICJUUllfV0lOR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gICAgJiYgTUFUUklY X1JPVyAobWF0cml4LCB2bnRoKS0+ZW5hYmxlZF9wCisgICAgICAgJiYgZ29fb25lX3A7CisgICAg ICAgKyt2bnRoKQorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdyA9IE1BVFJJWF9S T1cgKG1hdHJpeCwgdm50aCk7CisgICAgICBtY19lcmFzZV9yb3cgKHcsIG1hdHJpeCwgcm93KTsK KyAgICB9CisgIGlmICh1cGRhdGluZ19mcmFtZV9wKQorICAgIHVwZGF0ZV9lbmQgKGYpOworICAv LyBtY19yZXNldF9jYWNoZSAodyk7Cit9CisKK0RFRlVOICgibWMtc3RkZXJyIiwgRm1jX3N0ZGVy ciwgU21jX3N0ZGVyciwgMCwgMSwgIlAiLAorICAgICAgIGRvYzogLyogVG9nZ2xlIHRyYWNpbmcg b2YgbXVsdGlwbGUgZmFrZSBjdXJzb3JzLgorV2l0aCBBUkcsIHR1cm4gdHJhY2luZyBvbiBpZiBh bmQgb25seSBpZiBBUkcgaXMgcG9zaXRpdmUuICovKQorICAoTGlzcF9PYmplY3QgYXJnKQorewor ICBpZiAoTklMUCAoYXJnKSkKKyAgICBtY19zdGRlcnJfcCA9ICFtY19zdGRlcnJfcDsKKyAgZWxz ZQorICAgIHsKKyAgICAgIGFyZyA9IEZwcmVmaXhfbnVtZXJpY192YWx1ZSAoYXJnKTsKKyAgICAg IG1jX3N0ZGVycl9wID0gWEZJWE5VTSAoYXJnKSA+IDA7CisgICAgfQorICByZXR1cm4gUW5pbDsK K30KKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKIAwKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKgogCQkgICAgICBXaW5kb3cgZGlzcGxhe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ICAgICAgICAgICAgICAgICAgPyBmYWxzZQorICAg ICAgICAgICAgICAgICAgICAgICAgOiB0cnVlOworICBpZiAoYmFyZl9jcmFzaF9vbmUpCisgICAg cmV0dXJuIGhzY3JvbGxlZF9wOworCisgIC8qIGByZXNlYXRfMSc6ICBDSEFSUE9TIChwb3MpID49 IEJFR1YgJiYgQ0hBUlBPUyAocG9zKSA8PSBaViAqLworICBib29sIGJhcmZfY3Jhc2hfdHdvID0g KGNoYXJwb3MgPj0gQkVHViAmJiBjaGFycG9zIDw9IFpWKQorICAgICAgICAgICAgICAgICAgICAg ICAgID8gZmFsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICA6IHRydWU7CisgIGlmIChiYXJm X2NyYXNoX3R3bykKKyAgICByZXR1cm4gaHNjcm9sbGVkX3A7CisKKy8qIGVuZCBNVUxUSVBMRS1D VVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAgICAgLyogTW92ZSBp dGVyYXRvciB0byBwdCBzdGFydGluZyBhdCBjdXJzb3Jfcm93LT5zdGFydCBpbgogCQkgYSBsaW5l IHdpdGggaW5maW5pdGUgd2lkdGguICAqLwogCSAgICAgIGluaXRfdG9fcm93X3N0YXJ0ICgmaXQs IHcsIGN1cnNvcl9yb3cpOwpAQCAtMTQzOTcsOSArMTkzMzUsMjIgQEAgcmVkaXNwbGF5X2ludGVy bmFsICh2b2lkKQogCSAgICAgICp3LT5kZXNpcmVkX21hdHJpeC0+bWV0aG9kID0gMDsKIAkgICAg ICBkZWJ1Z19tZXRob2RfYWRkICh3LCAib3B0aW1pemF0aW9uIDEiKTsKICNlbmRpZgorCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCiAjaWZkZWYg SEFWRV9XSU5ET1dfU1lTVEVNCisgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICYm ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICBt Y191cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIGZhbHNlKTsKKyAgICBlbHNlCiAJICAgICAgdXBk YXRlX3dpbmRvd19mcmluZ2VzICh3LCBmYWxzZSk7CiAjZW5kaWYKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogCSAgICAgIGdvdG8gdXBkYXRlOwogCSAgICB9CiAJICBlbHNlCkBAIC0x Nzc5MiwxMCArMjI3NDMsMjIgQEAgcmVkaXNwbGF5X3dpbmRvdyAoTGlzcF9PYmplY3Qgd2luZG93 LCBib29sIGp1c3RfdGhpc19vbmVfcCkKICAgICB9CiAKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNU RU0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8K KworICBib29sIGtlZXBfY3VycmVudF9wID0gKGp1c3RfdGhpc19vbmVfcAorICAgICAgICAgICAg ICAgICAgICAgICAgIHx8ICghdXNlZF9jdXJyZW50X21hdHJpeF9wICYmICFvdmVybGF5X2Fycm93 X3NlZW4pCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgdy0+cHNldWRvX3dpbmRvd19wKTsK KworICBib29sIGZyaW5nZXNfdXBkYXRlZF9wID0gKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfdXBk YXRlX3dpbmRvd19mcmluZ2VzICh3LCBrZWVwX2N1cnJlbnRfcCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogdXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCBrZWVwX2N1cnJlbnRfcCk7CisK ICAgaWYgKEZSQU1FX1dJTkRPV19QIChmKQotICAgICAgJiYgdXBkYXRlX3dpbmRvd19mcmluZ2Vz ICh3LCAoanVzdF90aGlzX29uZV9wCi0JCQkJICAgIHx8ICghdXNlZF9jdXJyZW50X21hdHJpeF9w ICYmICFvdmVybGF5X2Fycm93X3NlZW4pCi0JCQkJICAgIHx8IHctPnBzZXVkb193aW5kb3dfcCkp KQorICAgICAgJiYgZnJpbmdlc191cGRhdGVkX3ApCiAgICAgewogICAgICAgdXBkYXRlX2JlZ2lu IChmKTsKICAgICAgIGJsb2NrX2lucHV0ICgpOwpAQCAtMTc4MTAsNiArMjI3NzMsOSBAQCByZWRp c3BsYXlfd2luZG93IChMaXNwX09iamVjdCB3aW5kb3csIGJvb2wganVzdF90aGlzX29uZV9wKQog ICAgICAgdXBkYXRlX2VuZCAoZik7CiAgICAgfQogCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiAgIGlmIChXSU5ET1dfQk9UVE9NX0RJVklERVJfV0lEVEggKHcpKQogICAgIGd1aV9kcmF3 X2JvdHRvbV9kaXZpZGVyICh3KTsKICNlbmRpZiAvKiBIQVZFX1dJTkRPV19TWVNURU0gKi8KQEAg LTE4MTI1LDYgKzIzMDkxLDE2IEBAIHRyeV93aW5kb3dfcmV1c2luZ19jdXJyZW50X21hdHJpeCAo c3RydWN0IHdpbmRvdyAqdykKIAkgICAgICB1cGRhdGVfYmVnaW4gKGYpOwogCSAgICAgIGd1aV91 cGRhdGVfd2luZG93X2JlZ2luICh3KTsKIAkgICAgICBGUkFNRV9SSUYgKGYpLT5jbGVhcl93aW5k b3dfbW91c2VfZmFjZSAodyk7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKyAgICBtY19wcmVfc2Nyb2xsX2NsZWFuICh3LCBydW4sIHN0YXJ0 X3Zwb3MsIG5yb3dzX3Njcm9sbGVkLCBUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhf RE9XTik7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgICAgICBGUkFNRV9SSUYg KGYpLT5zY3JvbGxfcnVuX2hvb2sgKHcsICZydW4pOwogCSAgICAgIGd1aV91cGRhdGVfd2luZG93 X2VuZCAodywgZmFsc2UsIGZhbHNlKTsKIAkgICAgICB1cGRhdGVfZW5kIChmKTsKQEAgLTE4Mjkx LDYgKzIzMjY3LDE2IEBAIHRyeV93aW5kb3dfcmV1c2luZ19jdXJyZW50X21hdHJpeCAoc3RydWN0 IHdpbmRvdyAqdykKIAkgIHVwZGF0ZV9iZWdpbiAoZik7CiAJICBndWlfdXBkYXRlX3dpbmRvd19i ZWdpbiAodyk7CiAJICBGUkFNRV9SSUYgKGYpLT5jbGVhcl93aW5kb3dfbW91c2VfZmFjZSAodyk7 CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK KyAgICBtY19wcmVfc2Nyb2xsX2NsZWFuICh3LCBydW4sIHN0YXJ0X3Zwb3MsIG5yb3dzX3Njcm9s bGVkLCBUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfVVApOworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAJICBGUkFNRV9SSUYgKGYpLT5zY3JvbGxfcnVuX2hvb2sgKHcs ICZydW4pOwogCSAgZ3VpX3VwZGF0ZV93aW5kb3dfZW5kICh3LCBmYWxzZSwgZmFsc2UpOwogCSAg dXBkYXRlX2VuZCAoZik7CkBAIC0xOTI0NSw2ICsyNDIzMSwxNiBAQCB0cnlfd2luZG93X2lkIChz dHJ1Y3Qgd2luZG93ICp3KQogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQogCSAgZ3VpX3VwZGF0 ZV93aW5kb3dfYmVnaW4gKHcpOwogCSAgRlJBTUVfUklGIChmKS0+Y2xlYXJfd2luZG93X21vdXNl X2ZhY2UgKHcpOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VS U09SUyAqLworCisgICAgbWNfcHJlX3Njcm9sbF9jbGVhbiAodywgcnVuLCBmaXJzdF91bmNoYW5n ZWRfYXRfZW5kX3Zwb3MsIGR2cG9zLCBUUllfV0lORE9XX0lEKTsKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogCSAgRlJBTUVfUklGIChmKS0+c2Nyb2xsX3J1bl9ob29rICh3LCAmcnVu KTsKIAkgIGd1aV91cGRhdGVfd2luZG93X2VuZCAodywgZmFsc2UsIGZhbHNlKTsKICNlbmRpZgpA QCAtMjE1MjgsNiArMjY1MjQsMTcgQEAgbWF5YmVfcHJvZHVjZV9saW5lX251bWJlciAoc3RydWN0 IGl0ICppdCkKICAgICAgIFNFVF9URVhUX1BPUyAodGVtX2l0LnBvc2l0aW9uLCAtMSwgLTEpOwog ICAgICAgUFJPRFVDRV9HTFlQSFMgKCZ0ZW1faXQpOwogCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICAvKiBUaGlzIHBlcm1pdHMgdXMg dG8gaW5zcGVjdCB0aGUgSFBPUyBvZiBsaW5lIG51bWJlciBnbHlwaHMgYW5kIHRoZSBzcGFjZQor ICAgICAgcGFkZGluZyBiZWZvcmUvYWZ0ZXIgdGhlIGxpbmUgbnVtYmVycy4gIFdlIHNldCBgZ2x5 cGgtPmhwb3NgIGVsc2V3aGVyZS4gKi8KKyAgICAgIHRlbV9pdC5ocG9zICs9IDE7CisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIC8qIFN0b3AgcHJvZHVjaW5nIGdseXBocywg YW5kIHJlZnJhaW4gZnJvbSBwcm9kdWNpbmcgdGhlIGxpbmUKIAkgbnVtYmVyLCBpZiB3ZSBkb24n dCBoYXZlIGVub3VnaCBzcGFjZSBvbiB0aGlzIGxpbmUuICAqLwogICAgICAgaWYgKHRlbV9pdC5j dXJyZW50X3ggPj0gd2lkdGhfbGltaXQpCkBAIC0yMTUzOSw2ICsyNjU0NiwyOCBAQCBtYXliZV9w cm9kdWNlX2xpbmVfbnVtYmVyIChzdHJ1Y3QgaXQgKml0KQogCX0KICAgICB9CiAKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgc3RydWN0IGJ1 ZmZlciAqYiA9IFhCVUZGRVIgKGl0LT53LT5jb250ZW50cyk7CisgIHN0cnVjdCBidWZmZXIgKm9s ZF9idWZmZXIgPSBOVUxMOworICAvKiBOZWVkZWQgc28gdGhhdCBidWZmZXItbG9jYWwgdmFsdWVz IGNhbiBiZSBkZXRlcm1pbmVkOyBlLmcuLCB3aGVuIHN3aXRjaGluZworICB0byB0aGUgbWluaWJ1 ZmZlci4gKi8KKyAgaWYgKGIgIT0gY3VycmVudF9idWZmZXIpCisgICAgeworICAgICAgb2xkX2J1 ZmZlciA9IGN1cnJlbnRfYnVmZmVyOworICAgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAoYik7Cisg ICAgfQorICBpdC0+dy0+bWMubG51bV9waXhlbF93aWR0aCA9ICghTklMUCAoVmRpc3BsYXlfbGlu ZV9udW1iZXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IHRlbV9pdC5jdXJy ZW50X3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IDA7CisgIGlmIChvbGRfYnVm ZmVyKQorICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAgIC8qIFJlY29yZCB0aGUgd2lkdGggaW4gcGl4ZWxzIHdlIG5l ZWQgZm9yIHRoZSBsaW5lIG51bWJlciBkaXNwbGF5LiAgKi8KICAgaXQtPmxudW1fcGl4ZWxfd2lk dGggPSB0ZW1faXQuY3VycmVudF94OwogICAvKiBDb3B5IHRoZSBwcm9kdWNlZCBnbHlwaHMgaW50 byBJVCdzIGdseXBoX3Jvdy4gICovCkBAIC0yNzM2MCw2ICszMjM4OSwxNyBAQCBhcHBlbmRfZ2x5 cGggKHN0cnVjdCBpdCAqaXQpCiAJICAgIGdbMV0gPSAqZzsKIAkgIGdseXBoID0gaXQtPmdseXBo X3Jvdy0+Z2x5cGhzW2FyZWFdOwogCX0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAg ICAgIGdseXBoLT5ieXRlcG9zID0gSVRfQllURVBPUyAoKml0KTsKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogICAgICAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9zaXRp b24pOwogICAgICAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAgICAgICBpZiAoaXQtPnBp eGVsX3dpZHRoID4gMCkKQEAgLTI3NDQyLDYgKzMyNDgyLDE3IEBAIGFwcGVuZF9jb21wb3NpdGVf Z2x5cGggKHN0cnVjdCBpdCAqaXQpCiAJICAgIGdbMV0gPSAqZzsKIAkgIGdseXBoID0gaXQtPmds eXBoX3Jvdy0+Z2x5cGhzW2l0LT5hcmVhXTsKIAl9CisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhw b3M7CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9IElUX0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgICAgIGdseXBoLT5jaGFycG9zID0gaXQtPmNtcF9pdC5j aGFycG9zOwogICAgICAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAgICAgICBlYXNzZXJ0 IChpdC0+cGl4ZWxfd2lkdGggPD0gU0hSVF9NQVgpOwpAQCAtMjc2NTAsNiArMzI3MDEsMTcgQEAg cHJvZHVjZV9pbWFnZV9nbHlwaCAoc3RydWN0IGl0ICppdCkKIAl9CiAgICAgICBpZiAoZ2x5cGgg PCBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJlYSArIDFdKQogCXsKKworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPmhwb3Mg PSBpdC0+aHBvczsKKyAgICAgIGdseXBoLT5ieXRlcG9zID0gSVRfQllURVBPUyAoKml0KTsKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9T IChpdC0+cG9zaXRpb24pOwogCSAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAJICBnbHlw aC0+cGl4ZWxfd2lkdGggPSBjbGlwX3RvX2JvdW5kcyAoLTEsIGl0LT5waXhlbF93aWR0aCwgU0hS VF9NQVgpOwpAQCAtMjc3NTMsNiArMzI4MTUsMTcgQEAgcHJvZHVjZV94d2lkZ2V0X2dseXBoIChz dHJ1Y3QgaXQgKml0KQogCX0KICAgICAgIGlmIChnbHlwaCA8IGl0LT5nbHlwaF9yb3ctPmdseXBo c1thcmVhICsgMV0pCiAJeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQ TEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5 cGgtPmJ5dGVwb3MgPSBJVF9CWVRFUE9TICgqaXQpOworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKworCiAJICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAJICBn bHlwaC0+b2JqZWN0ID0gaXQtPm9iamVjdDsKIAkgIGdseXBoLT5waXhlbF93aWR0aCA9IGNsaXBf dG9fYm91bmRzICgtMSwgaXQtPnBpeGVsX3dpZHRoLCBTSFJUX01BWCk7CkBAIC0yNzgzOSw2ICsz MjkxMiwxNyBAQCBhcHBlbmRfc3RyZXRjaF9nbHlwaCAoc3RydWN0IGl0ICppdCwgTGlzcF9PYmpl Y3Qgb2JqZWN0LAogCSAgICB3aWR0aCAtPSBpdC0+Zmlyc3RfdmlzaWJsZV94IC0gaXQtPmN1cnJl bnRfeDsKIAkgIGVhc3NlcnQgKHdpZHRoID4gMCk7CiAJfQorCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+aHBvcyA9IGl0 LT5ocG9zOworICAgICAgZ2x5cGgtPmJ5dGVwb3MgPSBJVF9CWVRFUE9TICgqaXQpOworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1Mg KGl0LT5wb3NpdGlvbik7CiAgICAgICBnbHlwaC0+b2JqZWN0ID0gb2JqZWN0OwogICAgICAgLyog RklYTUU6IEl0IHdvdWxkIGJlIGJldHRlciB0byB1c2UgVFlQRV9NQVggaGVyZSwgYnV0CkBAIC0y ODI5Myw2ICszMzM3NywxNyBAQCBhcHBlbmRfZ2x5cGhsZXNzX2dseXBoIChzdHJ1Y3QgaXQgKml0 LCBpbnQgZmFjZV9pZCwgYm9vbCBmb3Jfbm9fZm9udCwgaW50IGxlbiwKIAkgICAgZ1sxXSA9ICpn OwogCSAgZ2x5cGggPSBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJlYV07CiAJfQorCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlw aC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPmJ5dGVwb3MgPSBJVF9CWVRFUE9TICgq aXQpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICBnbHlwaC0+Y2hhcnBv cyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAgICAgICBnbHlwaC0+b2JqZWN0ID0gaXQtPm9i amVjdDsKICAgICAgIGVhc3NlcnQgKGl0LT5waXhlbF93aWR0aCA8PSBTSFJUX01BWCk7CkBAIC0y OTM0MywxMCArMzQ0MzgsMjAgQEAgZ3VpX2luc2VydF9nbHlwaHMgKHN0cnVjdCB3aW5kb3cgKncs IHN0cnVjdCBnbHlwaF9yb3cgKnVwZGF0ZWRfcm93LAogCiAgIC8qIFdyaXRlIHRoZSBnbHlwaHMu ICAqLwogICBocG9zID0gc3RhcnQgLSByb3ctPmdseXBoc1t1cGRhdGVkX2FyZWFdOworCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlmICgh bWNfcmVkcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgsIHJvdywgdXBkYXRlZF9hcmVhLCB3 LT5vdXRwdXRfY3Vyc29yLngsCisgICAgICAgICAgICAgICAgICAgICAgaHBvcywgaHBvcyArIGxl biwgZmFsc2UsIERSQVdfTk9STUFMX1RFWFQsIEdVSV9JTlNFUlRfR0xZUEhTKSkKICAgZHJhd19n bHlwaHMgKHcsIHctPm91dHB1dF9jdXJzb3IueCwgcm93LCB1cGRhdGVkX2FyZWEsCiAJICAgICAg IGhwb3MsIGhwb3MgKyBsZW4sCiAJICAgICAgIERSQVdfTk9STUFMX1RFWFQsIDApOwogCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIEFkdmFuY2UgdGhlIG91dHB1dCBjdXJzb3Iu ICAqLwogICB3LT5vdXRwdXRfY3Vyc29yLmhwb3MgKz0gbGVuOwogICB3LT5vdXRwdXRfY3Vyc29y LnggKz0gc2hpZnRfYnlfd2lkdGg7CkBAIC0yOTc3Miw5ICszNDg3NywxOSBAQCBndWlfZml4X292 ZXJsYXBwaW5nX2FyZWEgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywK IAkgIHdoaWxlIChpIDwgcm93LT51c2VkW2FyZWFdCiAJCSAmJiByb3ctPmdseXBoc1thcmVhXVtp XS5vdmVybGFwc192ZXJ0aWNhbGx5X3ApOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBpZiAoIW1jX3JlZHJhd19yb3cgKHcsIHct PmN1cnJlbnRfbWF0cml4LCByb3csIGFyZWEsIHN0YXJ0X3gsIHN0YXJ0LCBpLAorICAgICAgICAg IGZhbHNlLCBEUkFXX05PUk1BTF9URVhULCBHVUlfRklYX09WRVJMQVBQSU5HX0FSRUEpKQogCSAg ZHJhd19nbHlwaHMgKHcsIHN0YXJ0X3gsIHJvdywgYXJlYSwKIAkJICAgICAgIHN0YXJ0LCBpLAog CQkgICAgICAgRFJBV19OT1JNQUxfVEVYVCwgb3ZlcmxhcHMpOworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKworCiAJfQogICAgICAgZWxzZQogCXsKQEAgLTMwMDI1LDEwICszNTE0MCwxNyBA QCBkaXNwbGF5X2FuZF9zZXRfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIG9uLAogICBu ZXdfY3Vyc29yX3R5cGUgPSBnZXRfd2luZG93X2N1cnNvcl90eXBlICh3LCBnbHlwaCwKIAkJCQkJ ICAgICZuZXdfY3Vyc29yX3dpZHRoLCAmYWN0aXZlX2N1cnNvcik7CiAKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgLyogSWYgY3Vyc29yIGlz IGN1cnJlbnRseSBiZWluZyBzaG93biBhbmQgd2UgZG9uJ3Qgd2FudCBpdCB0byBiZSBvcgogICAg ICBpdCBpcyBpbiB0aGUgd3JvbmcgcGxhY2UsIG9yIHRoZSBjdXJzb3IgdHlwZSBpcyBub3Qgd2hh dCB3ZSB3YW50LAogICAgICBlcmFzZSBpdC4gICovCiAgIGlmICh3LT5waHlzX2N1cnNvcl9vbl9w CisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMp KQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxl KSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikp CiAgICAgICAmJiAoIW9uCiAJICB8fCB3LT5waHlzX2N1cnNvci54ICE9IHgKIAkgIHx8IHctPnBo eXNfY3Vyc29yLnkgIT0geQpAQCAtMzAwNDEsNiArMzUxNjMsOSBAQCBkaXNwbGF5X2FuZF9zZXRf Y3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIG9uLAogCSAgICAgICYmIG5ld19jdXJzb3Jf d2lkdGggIT0gdy0+cGh5c19jdXJzb3Jfd2lkdGgpKSkKICAgICBlcmFzZV9waHlzX2N1cnNvciAo dyk7CiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogRG9uJ3QgY2hlY2sgcGh5 c19jdXJzb3Jfb25fcCBoZXJlIGJlY2F1c2UgdGhhdCBmbGFnIGlzIG9ubHkgc2V0CiAgICAgIHRv IGZhbHNlIGluIHNvbWUgY2FzZXMgd2hlcmUgd2Uga25vdyB0aGF0IHRoZSBjdXJzb3IgaGFzIGJl ZW4KICAgICAgY29tcGxldGVseSBlcmFzZWQsIHRvIGF2b2lkIHRoZSBleHRyYSB3b3JrIG9mIGVy YXNpbmcgdGhlIGN1cnNvcgpAQCAtMzAwNTksOSArMzUxODQsMjAgQEAgZGlzcGxheV9hbmRfc2V0 X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBvbiwKICAgICAgIHctPnBoeXNfY3Vyc29y LnZwb3MgPSB2cG9zOwogICAgIH0KIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1V TFRJUExFLUNVUlNPUlMgKi8KKworICBpZiAoTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRl bnRzKSwgZmNfdmlzaWJsZSkpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIG1jX2NvbmYpKSkKICAgRlJBTUVfUklGIChmKS0+ZHJhd193aW5kb3dfY3Vyc29yICh3 LCBnbHlwaF9yb3csIHgsIHksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg bmV3X2N1cnNvcl90eXBlLCBuZXdfY3Vyc29yX3dpZHRoLAogICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIG9uLCBhY3RpdmVfY3Vyc29yKTsKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogfQogCiAKQEAgLTMwMTU0LDcgKzM1MjkwLDE4IEBAIGRyYXdfcm93X3dpdGhf bW91c2VfZmFjZSAoc3RydWN0IHdpbmRvdyAqdywgaW50IHN0YXJ0X3gsIHN0cnVjdCBnbHlwaF9y b3cgKnJvdywKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KICAgaWYgKEZSQU1FX1dJTkRPV19Q IChYRlJBTUUgKHctPmZyYW1lKSkpCiAgICAgeworCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBpZiAoIW1jX3JlZHJhd19yb3cgKHcs IHctPmN1cnJlbnRfbWF0cml4LCByb3csIFRFWFRfQVJFQSwgc3RhcnRfeCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgc3RhcnRfaHBvcywgZW5kX2hwb3MsIGZhbHNlLCBkcmF3LCBEUkFXX1JP V19XSVRIX01PVVNFX0ZBQ0UpKQogICAgICAgZHJhd19nbHlwaHMgKHcsIHN0YXJ0X3gsIHJvdywg VEVYVF9BUkVBLCBzdGFydF9ocG9zLCBlbmRfaHBvcywgZHJhdywgMCk7CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKICAgICAgIHJldHVybjsKICAgICB9CiAjZW5kaWYKQEAgLTMyMjE0 LDExICszNzM2MSwyMyBAQCBleHBvc2VfYXJlYSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGds eXBoX3JvdyAqcm93LCBjb25zdCBFbWFjc19SZWN0YW5nbGUgKnIsCiAgIHN0cnVjdCBnbHlwaCAq bGFzdDsKICAgaW50IGZpcnN0X3gsIHN0YXJ0X3gsIHg7CiAKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgaWYgKGFyZWEgPT0gVEVYVF9BUkVB ICYmIHJvdy0+ZmlsbF9saW5lX3ApCisgICAgeworICAgICAgaWYgKCFtY19yZWRyYXdfcm93ICh3 LCB3LT5jdXJyZW50X21hdHJpeCwgcm93LCBhcmVhLCAwLCAwLCByb3ctPnVzZWRbYXJlYV0sCisg ICAgICAgICAgICAgICAgICAgICAgICAgIGZhbHNlLCBEUkFXX05PUk1BTF9URVhULCBFWFBPU0Vf QVJFQV9PTkUpKQogICAgIC8qIElmIHJvdyBleHRlbmRzIGZhY2UgdG8gZW5kIG9mIGxpbmUgd3Jp dGUgdGhlIHdob2xlIGxpbmUuICAqLwogICAgIGRyYXdfZ2x5cGhzICh3LCAwLCByb3csIGFyZWEs CiAJCSAwLCByb3ctPnVzZWRbYXJlYV0sCiAJCSBEUkFXX05PUk1BTF9URVhULCAwKTsKKyAgICB9 CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgZWxzZQogICAgIHsKICAgICAgIC8q IFNldCBTVEFSVF9YIHRvIHRoZSB3aW5kb3ctcmVsYXRpdmUgc3RhcnQgcG9zaXRpb24gZm9yIGRy YXdpbmcgZ2x5cGhzIG9mCkBAIC0zMjI1MCwxMSArMzc0MDksMjMgQEAgZXhwb3NlX2FyZWEgKHN0 cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgY29uc3QgRW1hY3NfUmVjdGFu Z2xlICpyLAogCSAgKytsYXN0OwogCX0KIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFLUNVUlNPUlMgKi8KKwogICAgICAgLyogUmVwYWludC4gICovCi0gICAgICBpZiAo bGFzdCA+IGZpcnN0KQorICAgICAgLyogRmxvYXRpbmcgZmFrZSBjdXJzb3JzIHdpbGwgZXhpc3Qg d2hlbiAobGFzdCA9PSBmaXJzdCkuICovCisgICAgICBpZiAoIW1jX3JlZHJhd19yb3cgKHcsIHct PmN1cnJlbnRfbWF0cml4LCByb3csIGFyZWEsIGZpcnN0X3ggLSBzdGFydF94LAorICAgICAgICAg ICAgICAgICAgICAgICAgICBmaXJzdCAtIHJvdy0+Z2x5cGhzW2FyZWFdLCBsYXN0IC0gcm93LT5n bHlwaHNbYXJlYV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgIGZhbHNlLCBEUkFXX05PUk1B TF9URVhULCBFWFBPU0VfQVJFQV9UV08pCisgICAgICAgICAgJiYgbGFzdCA+IGZpcnN0KQogCWRy YXdfZ2x5cGhzICh3LCBmaXJzdF94IC0gc3RhcnRfeCwgcm93LCBhcmVhLAogCQkgICAgIGZpcnN0 IC0gcm93LT5nbHlwaHNbYXJlYV0sIGxhc3QgLSByb3ctPmdseXBoc1thcmVhXSwKIAkJICAgICBE UkFXX05PUk1BTF9URVhULCAwKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAg IH0KIH0KIApAQCAtMzIyNjgsMTAgKzM3NDM5LDIyIEBAIGV4cG9zZV9saW5lIChzdHJ1Y3Qgd2lu ZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGNvbnN0IEVtYWNzX1JlY3RhbmdsZSAqcikK IHsKICAgZWFzc2VydCAocm93LT5lbmFibGVkX3ApOwogCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCiAgIGlmIChyb3ctPm1vZGVfbGluZV9wIHx8 IHctPnBzZXVkb193aW5kb3dfcCkKKyAgICB7CisgICAgICBpZiAoIW1jX3JlZHJhd19yb3cgKHcs IHctPmN1cnJlbnRfbWF0cml4LCByb3csIFRFWFRfQVJFQSwgMCwgMCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgcm93LT51c2VkW1RFWFRfQVJFQV0sIGZhbHNlLCBEUkFXX05PUk1BTF9URVhU LCBFWFBPU0VfTElORSkpCiAgICAgZHJhd19nbHlwaHMgKHcsIDAsIHJvdywgVEVYVF9BUkVBLAog CQkgMCwgcm93LT51c2VkW1RFWFRfQVJFQV0sCiAJCSBEUkFXX05PUk1BTF9URVhULCAwKTsKKyAg ICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgZWxzZQogICAgIHsKICAgICAg IGlmIChyb3ctPnVzZWRbTEVGVF9NQVJHSU5fQVJFQV0pCkBAIC0zMjgxOSw2ICszODAwMiwyMiBA QCBndWlfaW50ZXJzZWN0X3JlY3RhbmdsZXMgKGNvbnN0IEVtYWNzX1JlY3RhbmdsZSAqcjEsIGNv bnN0IEVtYWNzX1JlY3RhbmdsZSAqcjIsCiB2b2lkCiBzeW1zX29mX3hkaXNwICh2b2lkKQogewor CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisg IGRlZnN1YnIgKCZTbWNfZHVtcF9nbHlwaF9yb3cpOworCisgIGRlZnN1YnIgKCZTbWNfZHVtcF9n bHlwaF9tYXRyaXgpOworCisgIGRlZnN1YnIgKCZTbWNfY3VycmVudF9jb2x1bW4pOworCisgIGRl ZnN1YnIgKCZTbWNfc3RkZXJyKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBW d2l0aF9lY2hvX2FyZWFfc2F2ZV92ZWN0b3IgPSBRbmlsOwogICBzdGF0aWNwcm8gKCZWd2l0aF9l Y2hvX2FyZWFfc2F2ZV92ZWN0b3IpOwogCmRpZmYgLS1naXQgYS9zcmMveHRlcm0uYyBiL3NyYy94 dGVybS5jCmluZGV4IGM5NmFhNzQuLjdmOGYxYTAgMTAwNjQ0Ci0tLSBhL3NyYy94dGVybS5jCisr KyBiL3NyYy94dGVybS5jCkBAIC0xMzIsNiArMTMyLDkwNCBAQCBhbG9uZyB3aXRoIEdOVSBFbWFj cy4gIElmIG5vdCwgc2VlIDxodHRwczovL3d3dy5nbnUub3JnL2xpY2Vuc2VzLz4uICAqLwogI2lu Y2x1ZGUgPFgxMS9YS0JsaWIuaD4KICNlbmRpZgogCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCisjaWZkZWYgR0xZUEhfREVCV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aGwgPT0gRFJBV19JTlZFUlNFX1ZJREVP KQorICAgIHsKKyAgICAgIHhfc2V0X21vZGVfbGluZV9mYWNlX2djIChzKTsKKyAgICAgIHMtPnN0 aXBwbGVkX3AgPSBzLT5mYWNlLT5zdGlwcGxlICE9IDA7CisgICAgfQorICBlbHNlIGlmIChzLT5o bCA9PSBEUkFXX0NVUlNPUikKKyAgICB7CisgICAgICBtY194X3NldF9jdXJzb3JfZ2MgKHMsIGN1 cnNvcl9nY19wKTsKKyAgICAgIHMtPnN0aXBwbGVkX3AgPSBmYWxzZTsKKyAgICB9CisgIGVsc2Ug aWYgKHMtPmhsID09IERSQVdfTU9VU0VfRkFDRSkKKyAgICB7CisgICAgICB4X3NldF9tb3VzZV9m YWNlX2djIChzKTsKKyAgICAgIHMtPnN0aXBwbGVkX3AgPSBzLT5mYWNlLT5zdGlwcGxlICE9IDA7 CisgICAgfQorICBlbHNlIGlmIChzLT5obCA9PSBEUkFXX0lNQUdFX1JBSVNFRAorICAgICAgICAg ICB8fCBzLT5obCA9PSBEUkFXX0lNQUdFX1NVTktFTikKKyAgICB7CisgICAgICBzLT5nYyA9IHMt PmZhY2UtPmdjOworICAgICAgcy0+c3RpcHBsZWRfcCA9IHMtPmZhY2UtPnN0aXBwbGUgIT0gMDsK KyAgICB9CisgIGVsc2UKKyAgICBlbWFjc19hYm9ydCAoKTsKKyAgLyogR0MgbXVzdCBoYXZlIGJl ZW4gc2V0LiAqLworICBlYXNzZXJ0IChzLT5nYyAhPSAwKTsKK30KKworLyogRHJhdyBhIGhvbGxv dyBib3ggY3Vyc29yIG9uIHdpbmRvdyBXIGluIGdseXBoIHJvdyBST1cuICovCitzdGF0aWMgdm9p ZAorbWNfeF9kcmF3X2hvbGxvd19jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlw aF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAgICAg ICAgICAgICAgIGlud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jlc2V0X2NsaXBfcmVjdGFuZ2xl cyAoZiwgZ2MpOworICAgIH0KK30KKworLyogUklGOiBEcmF3IGN1cnNvciBvbiB3aW5kb3cgVy4g Ki8KK3N0YXRpYyB2b2lkCittY194X2RyYXdfd2luZG93X2N1cnNvciAoc3RydWN0IHdpbmRvdyAq dywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisg ICAgICAgICAgICAgICAgICAgICAgICAgaW50IHgsIGludCBmeCwgaW50IHksIGludCBmeSwgaW50 IGhwb3MsIGludCB2cG9zLCBpbnQgd2QsCisgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGgs IHN0cnVjdCBtY19SR0IgbHNsLCBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlLAorICAg ICAgICAgICAgICAgICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGgsIGVudW0gbWNfZmxhdm9yIGds eXBoX2ZsYXZvciwgYm9vbCBvbl9wLAorICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgYWN0 aXZlX3ApCit7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7 CisgIC8qIFRoZSBmcmluZ2UgYml0bWFwcyBhcmUgcHJlc2VudGx5IGhhbmRsZWQgZWxzZXdoZXJl LCBidXQgY291bGQgc29tZWRheQorICBiZSBtYW5hZ2VkIChpbiBwYXJ0KSBhdCB0aGlzIHNlY3Rp b24gb2YgY29kZS4gKi8KKyAgaWYgKG9uX3ApCisgICAgeworICAgICAgaWYgKHJvdy0+ZXhhY3Rf d2luZG93X3dpZHRoX2xpbmVfcAorICAgICAgICAgICYmIChyb3ctPnJldmVyc2VkX3AKKyAgICAg ICAgICAgICAgPyAoaHBvcyA8IDApCisgICAgICAgICAgICAgIDogKGhwb3MgPj0gcm93LT51c2Vk W1RFWFRfQVJFQV0pKSkKKyAgICAgICAgeworICAgICA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kgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19hY3RpdmVfZmFj ZS0+Zm9yZWdyb3VuZCk7CisgICAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hf RElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9y ZWdpb25fZW5kX2ZhY2UtPmJhY2tncm91bmQpOworICAgICAgICAgICAgICB9CisgICAgICAgICAg ICAgIGVsc2UgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAmJiBh Y3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3Mg PiByZWdpb25fYmVnCisgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+Y2hh cnBvcyA8IHJlZ2lvbl9lbmQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg ZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZV9pZCA9IGxvb2t1 cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItaW4tcmVnaW9u LXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhv bGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93 X2FjdGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgIGVudW0g ZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwg aW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHR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FNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxv d19hY3RpdmVfZmFjZS0+YmFja2dyb3VuZCk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgICAgICBlbHNlIGlmICghYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQg PSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWlu YWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgIHN0cnVj dCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2lu YWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChG UkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19p bmFjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgICAgICBYU2V0QmFj a2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2dj LCBob2xsb3dfaW5hY3RpdmVfZmFjZS0+YmFja2dyb3VuZCk7CisgICAgICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAvKiBGb3JjZSBgbWNfeF9z ZXRfY3Vyc29yX2djJyB0byB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYycuICov CisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IHRydWU7CisgICAgICAgICAg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BgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsJy4gKi8KKyAgICAg ICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IGNvbG9yLnBpeGVsOworICAg ICAgICAgICAgbWNfeF9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwg eSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAgICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngt PmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgICB9CisgICAg ICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBUZW1wb3JhcmlseSBo aWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYycgYnkgYm9ycm93aW5nIHRoZQorICAg ICAgICAgICAgICBmdW5jdGlvbmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHhmbnMuYy4gKi8KKyAg ICAgICAgICAgICAgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgJiYgYWN0 aXZlX3AKKyAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+Y2hhcnBvcyA9PSByZWdp b25fYmVnKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9p ZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZWdfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3 LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItYXQtcmVnaW9uLXByZS16di1mYWNlIiks IHRydWUpOworICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfcmVn aW9uX2JlZ19mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZWdf ZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9m YWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1 cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNl ICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFj ZV9pZCk7CisgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZ IChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfYWN0aXZlX2ZhY2UtPmZv cmVncm91bmQpOworICAgICAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElT UExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9yZWdp b25fYmVnX2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAg ICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAm JiBhY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+Y2hh cnBvcyA9PSByZWdpb25fZW5kKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg ICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2VfaWQgPSBsb29r dXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWF0LXJlZ2lv bi1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2Ug KmhvbGxvd19hY3RpdmVfcmVnaW9uX2VuZF9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3df YWN0aXZlX3JlZ2lvbl9lbmRfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgIGVudW0gZmFj ZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50 ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAg ICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lE IChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICBYU2V0Rm9y ZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2dj LCBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgICAgICBY U2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vy c29yX2djLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZS0+YmFja2dyb3VuZCk7CisgICAg ICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZl X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9wCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3MgPiByZWdpb25fYmVnCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3MgPCByZWdpb25f ZW5kKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgIC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xz ZSBpZiAoYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg ICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1l ZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItcHJlLXp2LWZhY2UiKSwg dHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2 ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAg ICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYt Pm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5k KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIFhTZXRCYWNrZ3JvdW5kIChGUkFNRV9YX0RJU1BM QVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19hY3RpdmVfZmFjZS0+ YmFja2dyb3VuZCk7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAg ICAgIGVsc2UgaWYgKCFhY3RpdmVfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lk ID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1p bmFjdGl2ZS1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAg c3RydWN0IGZhY2UgKmhvbGxvd19pbmFjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xs b3dfaW5hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgIFhTZXRGb3Jl Z3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2Ms IGhvbGxvd19pbmFjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRh LngtPmN1cnNvcl9nYywgaG9sbG93X2luYWN0aXZlX2ZhY2UtPmJhY2tncm91bmQpOworICAgICAg ICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAg ICAgICAgICAgLyogRm9yY2UgYG1jX3hfc2V0X2N1cnNvcl9nYycgdG8gdXNlIGBzLT5mLT5vdXRw dXRfZGF0YS54LT5jdXJzb3JfZ2MnLiAqLworICAgICAgICAgICAgICBib29sIGN1cnNvcl9nY19w ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwg cm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9w LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX2djX3ApOworICAg ICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0 X2RhdGEueC0+Y3Vyc29yX2djLCB4Z2N2LmZvcmVncm91bmQpOworICAgICAgICAgICAgICBYU2V0 QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29y X2djLCB4Z2N2LmJhY2tncm91bmQpOworICAgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOwor ICAgICAgICAgICAgICAvKiBEcmF3IHRoZSBmcmFtZSBhcm91bmQgdGhlIGJveC4gKi8KKyAgICAg ICAgICAgICAgbWNfeF9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwg eSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAgICAgICAgICAgIH0KKyAgICAgIGJyZWFrOwor ICAgIH0KKyAgICBjYXNlIE1DX0hPTExPV19CT1g6CisgICAgeworICAgICAgaWYgKGxzbC5yZWQg Pj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAgICB7CisgICAg ICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4 ZWwnLiAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IGNvbG9y LnBpeGVsOworICAgICAgICAgIG1jX3hfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBtYXRyaXgsIHJv dywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICAgICAgZi0+b3V0cHV0 X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9 CisgICAgICAgIGVsc2UKKyAgICAgICAgICBtY194X2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0 cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgYnJlYWs7 CisgICAgfQorICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAgICB7CisgICAgICBpZiAobHNsLnJl ZCA+PSAwICYmIGxzb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XRwdXRfZGF0 YS54LT5jdXJzb3JfZ2MsIHhnY3YuYmFja2dyb3VuZCk7CisgICAgICAgICAgdW5ibG9ja19pbnB1 dCAoKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAg Ym9vbCBjdXJzb3JfZ2NfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5 cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywgbHNsLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUs IHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOwor ICAgIH0KKyAgICBjYXNlIE1DX0JBUjoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYm IGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAv KiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCcuICov CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gY29sb3IucGl4ZWw7 CisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IHRydWU7CisgICAg ICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnks IGhwb3MsIHZwb3MsIHdkLCBoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJz b3Jfd2lkdGgsIE1DX0JBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAg IGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsK KyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBj dXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNfeF9kcmF3 X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdk LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl93aWR0aCwgTUNf QkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgfQorICAgICAgYnJl YWs7CisgICAgfQorICAgIGNhc2UgTUNfSEJBUjoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+ PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAg ICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhl bCcuICovCisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gY29sb3Iu cGl4ZWw7CisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IHRydWU7 CisgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwg eSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBjdXJzb3Jfd2lkdGgsIE1DX0hCQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAg ICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3Jf cGl4ZWw7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAg IGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSBmYWxzZTsKKyAgICAgICAgICAgIG1j X3hfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2 cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lk dGgsIE1DX0hCQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICB9Cisg ICAgICBicmVhazsKKyAgICB9CisgICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOwor ICB9CisgICAgICAgIH0KKyNpZmRlZiBIQVZFX1hfSTE4TgorICBpZiAodyA9PSBYV0lORE9XIChm LT5zZWxlY3RlZF93aW5kb3cpKQorICAgIGlmIChGUkFNRV9YSUMgKGYpICYmIChGUkFNRV9YSUNf U1RZTEUgKGYpICYgWElNUHJlZWRpdFBvc2l0aW9uKSkKKyAgICAgIHhpY19zZXRfcHJlZWRpdGFy ZWEgKHcsIHgsIHkpOworI2VuZGlmCisgICAgfQorICBYRmx1c2ggKEZSQU1FX1hfRElTUExBWSAo ZikpOworfQorCisvKiBEcmF3IHN0cmV0Y2ggZ2x5cGggc3RyaW5nIFMuICovCitzdGF0aWMgdm9p ZAorbWNfeF9kcmF3X3N0cmV0Y2hfZ2x5cGhfc3RyaW5nIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpz KQoreworICBlYXNzZXJ0IChzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKTsK KyAgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SCisgICAgICAmJiAheF9zdHJldGNoX2N1cnNvcl9w KQorICAgIHsKKyAgICAgIC8qIElmIGB4LXN0cmV0Y2gtY3Vyc29yJyBpcyBuaWwsIGRvbid0IGRy YXcgYSBibG9jayBjdXJzb3IgYXMgd2lkZSBhcyB0aGUKKyAgICAgIHN0cmV0Y2ggZ2x5cGguICov CisgICAgICBpbnQgd2lkdGgsIGJhY2tncm91bmRfd2lkdGggPSBzLT5iYWNrZ3JvdW5kX3dpZHRo OworICAgICAgaW50IHggPSBzLT54OworICAgICAgaWYgKCFzLT5yb3ctPnJldmVyc2VkX3ApCisg ICAgICAgIHsKKyAgICAgICAgICBpbnQgbGVmdF94ID0gd2luZG93X2JveF9sZWZ0X29mZnNldCAo cy0+dywgVEVYVF9BUkVBKTsKKyAgICAgICAgICBpZiAoeCA8IGxlZnRfeCkKKyAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgYmFja2dyb3VuZF93aWR0aCAtPSBsZWZ0X3ggLSB4OworICAgICAg ICAgICAgICB4ID0gbGVmdF94OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVs c2UKKyAgICAgICAgICB7CisgICAgICAgICAgICAvKiBJbiBSMkwgcm93cywgZHJhdyB0aGUgY3Vy c29yIG9uIHRoZSByaWdodCBlZGdlIG9mIHRoZQorICAgICAgICAgICAgICAgc3RyZXRjaCBnbHlw aC4gKi8KKyAgICAgICAgICAgIGludCByaWdodF94ID0gd2luZG93X2JveF9yaWdodCAocy0+dywg VEVYVF9BUkVBKTsKKyAgICAgICAgICAgIGlmICh4ICsgYmFja2dyb3VuZF93aWR0aCA+IHJpZ2h0 X3gpCisgICAgICAgICAgICAgIGJhY2tncm91bmRfd2lkdGggLT0geCAtIHJpZ2h0X3g7CisgICAg ICAgICAgICB4ICs9IGJhY2tncm91bmRfd2lkdGg7CisgICAgICAgICAgfQorICAgICAgd2lkdGgg PSBtaW4gKEZSQU1FX0NPTFVNTl9XSURUSCAocy0+ZiksIGJhY2tncm91bmRfd2lkdGgpOworICAg ICAgaWYgKHMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAgICAgICAgeCAtPSB3aWR0aDsKKyAgICAgIC8q IERyYXcgY3Vyc29yLiAqLworICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19iZ19yZWN0IChzLCB4 LCBzLT55LCB3aWR0aCwgcy0+aGVpZ2h0KTsKKyAgICAgIC8qIENsZWFyIHJlc3QgdXNpbmcgdGhl IEdDIG9mIHRoZSBvcmlnaW5hbCBub24tY3Vyc29yIGZhY2UuICovCisgICAgICBpZiAod2lkdGgg PCBiYWNrZ3JvdW5kX3dpZHRoKQorICAgICAgICB7CisgICAgICAgICAgaW50IHkgPSBzLT55Owor ICAgICAgICAgIGludCB3ID0gYmFja2dyb3VuZF93aWR0aCAtIHdpZHRoLCBoID0gcy0+aGVpZ2h0 OworICAgICAgICAgIFhSZWN0YW5nbGUgcjsKKyAgICAgICAgICBHQyBnYzsKKyAgICAgICAgICBp ZiAoIXMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAgICAgICAgICAgIHggKz0gd2lkdGg7CisgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgeCA9IHMtPng7CisgICAgICAgICAgaWYgKHMtPnJvdy0+bW91 c2VfZmFjZV9wCisgICAgICAgICAgICAgICYmIGN1cnNvcl9pbl9tb3VzZV9mYWNlX3AgKHMtPncp KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICB4X3NldF9tb3VzZV9mYWNlX2djIChzKTsK KyAgICAgICAgICAgICAgZ2MgPSBzLT5nYzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBlbHNl CisgICAgICAgICAgICBnYyA9IHMtPmZhY2UtPmdjOworICAgICAgICAgIGdldF9nbHlwaF9zdHJp bmdfY2xpcF9yZWN0IChzLCAmcik7CisgICAgICAgICAgeF9zZXRfY2xpcF9yZWN0YW5nbGVzIChz LT5mLCBnYywgJnIsIDEpOworICAgICAgICAgIGlmIChzLT5mYWNlLT5zdGlwcGxlKQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICAvKiBGaWxsIGJhY2tncm91bmQgd2l0aCBhIHN0aXBwbGUg cGF0dGVybi4gKi8KKyAgICAgICAgICAgICAgWFNldEZpbGx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ZXNzb3JzLCBkcmF3IHRoZQorICAgICBi YWNrZ3JvdW5kIG9mIHRoZSBzdWNjZXNzb3JzIGZpcnN0IHNvIHRoYXQgUyBjYW4gZHJhdyBpbnRv IGl0LgorICAgICBUaGlzIG1ha2VzIFMtPm5leHQgdXNlIFhEcmF3U3RyaW5nIGluc3RlYWQgb2Yg WERyYXdJbWFnZVN0cmluZy4gKi8KKyAgaWYgKHMtPm5leHQgJiYgcy0+cmlnaHRfb3Zlcmhhbmcg JiYgIXMtPmZvcl9vdmVybGFwcykKKyAgICB7CisgICAgICBpbnQgd2lkdGg7CisgICAgICBzdHJ1 Y3QgZ2x5cGhfc3RyaW5nICpuZXh0OworICAgICAgZm9yICh3aWR0aCA9IDAsIG5leHQgPSBzLT5u ZXh0OworICAgICAgICAgICBuZXh0ICYmIHdpZHRoIDwgcy0+cmlnaHRfb3Zlcmhhbmc7CisgICAg ICAgICAgIHdpZHRoICs9IG5leHQtPndpZHRoLCBuZXh0ID0gbmV4dC0+bmV4dCkKKyAgICAgICAg aWYgKG5leHQtPmZpcnN0X2dseXBoLT50eXBlICE9IElNQUdFX0dMWVBIKQorICAgICAgICAgIHsK KyAgICAgICAgICAgIG1jX3hfc2V0X2dseXBoX3N0cmluZ19nYyAobmV4dCwgY3Vyc29yX2djX3Ap OworICAgICAgICAgICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nIChuZXh0KTsKKyAgICAg ICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKQorICAg ICAgICAgICAgICBtY194X2RyYXdfc3RyZXRjaF9nbHlwaF9zdHJpbmcgKG5leHQpOworICAgICAg ICAgICAgZWxzZQorICAgICAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQg KG5leHQsIHRydWUpOworICAgICAgICAgICAgbmV4dC0+bnVtX2NsaXBzID0gMDsKKyAgICAgICAg ICB9CisgICAgfQorICAvKiBTZXQgdXAgUy0+Z2MsIHNldCBjbGlwcGluZyBhbmQgZHJhdyBTLiAq LworICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKHMsIGN1cnNvcl9nY19wKTsKKyAgLyogRHJh dyByZWxpZWYgKGlmIGFueSkgaW4gYWR2YW5jZSBmb3IgY2hhci9jb21wb3NpdGlvbiBzbyB0aGF0 IHRoZQorICAgICBnbHlwaCBzdHJpbmcgY2FuIGJlIGRyYXduIG92ZXIgaXQuICovCisgIGlmICgh cy0+Zm9yX292ZXJsYXBzCisgICAgICAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gKKyAg ICAgICYmIChzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAgICAgfHwg cy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKSkKKyAgICB7CisgICAgICB4 X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmcgKHMpOworICAgICAgeF9kcmF3X2dseXBoX3N0cmlu Z19iYWNrZ3JvdW5kIChzLCB0cnVlKTsKKyAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYm94IChz KTsKKyAgICAgIHhfc2V0X2dseXBoX3N0cmluZ19jbGlwcGluZyAocyk7CisgICAgICByZWxpZWZf ZHJhd25fcCA9IHRydWU7CisgICAgfQorICAgIGVsc2UgaWYgKCFzLT5jbGlwX2hlYWQgLyogZHJh d19nbHlwaHMgZGlkbid0IHNwZWNpZnkgYSBjbGlwIG1hc2suICovCisgICAgICAgICAgICAgJiYg IXMtPmNsaXBfdGFpbAorICAgICAgICAgICAgICYmICgocy0+cHJldiAmJiBzLT5wcmV2LT5obCAh PSBzLT5obCAmJiBzLT5sZWZ0X292ZXJoYW5nKQorICAgICAgICAgICAgICAgICB8fCAocy0+bmV4 dCAmJiBzLT5uZXh0LT5obCAhPSBzLT5obCAmJiBzLT5yaWdodF9vdmVyaGFuZykpKQorICAg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hcHMgfHwgKHMtPmNtcF9mcm9tID4gMAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgISBzLT5maXJzdF9nbHlwaC0+dS5jbXAuYXV0 b21hdGljKSkKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICBl bHNlCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgdHJ1ZSk7Cisg ICAgICB4X2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAgICAg IGJyZWFrOworICAgIGNhc2UgR0xZUEhMRVNTX0dMWVBIOgorICAgICAgaWYgKHMtPmZvcl9vdmVy bGFwcykKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICBlbHNl CisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgdHJ1ZSk7CisgICAg ICB4X2RyYXdfZ2x5cGhsZXNzX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAgICAgIGJy ZWFrOworICAgIGRlZmF1bHQ6CisgICAgICBlbWFjc19hYm9ydCAoKTsKKyAgICB9CisgIGlmICgh cy0+Zm9yX292ZXJsYXBzKQorICAgIHsKKyAgICAgIC8qIERyYXcgdW5kZXJsaW5lLiAqLworICAg ICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9wKQorICAgICAgICB7CisgICAgICAgICAgaWYgKHMt PmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfV0FWRSkKKyAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAg ICAgICAgICAgICB4X2RyYXdfdW5kZXJ3YXZlIChzKTsKKyAgICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIFhHQ1ZhbHVlcyB4Z2N2OworICAgICAg ICAgICAgICAgICAgWEdldEdDVmFsdWVzIChGUkFNRV9YX0RJU1BMQVkgKHMtPmYpLCBzLT5nYywg R0NGb3JlZ3JvdW5kLCAmeGdjdik7CisgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAo RlJBTUVfWF9ESVNQTEFZIChzLT5mKSwgcy0+Z2MsIHMtPmZhY2UtPnVuZGVybGluZV9jb2xvcik7 CisgICAgICAgICAgICAgICAgICB4X2RyYXdfdW5kZXJ3YXZlIChzKTsKKyAgICAgICAgICAgICAg ICAgIFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKHMtPmYpLCBzLT5nYywgeGdjdi5m b3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAg ZWxzZSBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAg ICAgICAgICAgeworICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIHRoaWNrbmVzcywgcG9zaXRp b247CisgICAgICAgICAgICAgIGludCB5OworICAgICAgICAgICAgICBpZiAocy0+cHJldiAmJiBz LT5wcmV2LT5mYWNlLT51bmRlcmxpbmVfcAorICAgICAgICAgICAgICAgICAgJiYgcy0+cHJldi0+ ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgIC8qIFdlIHVzZSB0aGUgc2FtZSB1bmRlcmxpbmUgc3R5bGUg YXMgdGhlIHByZXZpb3VzIG9uZS4gKi8KKyAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMt PnByZXYtPnVuZGVybGluZV90aGlja25lc3M7CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9 IHMtPnByZXYtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBHZXQg dGhlIHVuZGVybGluZSB0aGlja25lc3MuICBEZWZhdWx0IGlzIDEgcGl4ZWwuICovCisgICAgICAg ICAgICAgICAgICBpZiAocy0+Zm9udCAmJiBzLT5mb250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4g MCkKKyAgICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+Zm9udC0+dW5kZXJsaW5lX3Ro aWNrbmVzczsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgdGhp Y2tuZXNzID0gMTsKKyAgICAgICAgICAgICAgICAgIGlmICh4X3VuZGVybGluZV9hdF9kZXNjZW50 X2xpbmUpCisgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmhlaWdodCAtIHRoaWNr bmVzcykgLSAocy0+eWJhc2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJs aW5lIHBvc2l0aW9uLiAgVGhpcyBpcyB0aGUgcmVjb21tZW5kZWQKKyAgICAgICAgICAgICAgICAg ICAgICAgICB2ZXJ0aWNhbCBvZmZzZXQgaW4gcGl4ZWxzIGZyb20gdGhlIGJhc2VsaW5lIHRvIHRo ZSB0b3Agb2YKKyAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgdW5kZXJsaW5lLiAgVGhpcyBp cyBhIHNpZ25lZCB2YWx1ZSBhY2NvcmRpbmcgdG8gdGhlCisgICAgICAgICAgICAgICAgICAgICAg ICAgc3BlY3MsIGFuZCBpdHMgZGVmYXVsdCBpcworICAgICAgICAgICAgICAgICAgICAgICAgIFJP VU5EICgobWF4aW11bSBkZXNjZW50KSAvIDIpLCB3aXRoCisgICAgICAgICAgICAgICAgICAgICAg ICAgUk9VTkQoeCkgPSBmbG9vciAoeCArIDAuNSkgICovCisgICAgICAgICAgICAgICAgICAgICAg aWYgKHhfdXNlX3VuZGVybGluZV9wb3NpdGlvbl9wcm9wZXJ0aWVzCisgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIHMtPmZvbnQgJiYgcy0+Zm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uID49IDAp CisgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPmZvbnQtPnVuZGVybGluZV9w b3NpdGlvbjsKKyAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChzLT5mb250KQorICAgICAg ICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+Zm9udC0+ZGVzY2VudCArIDEpIC8gMjsK KyAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICBwb3Np dGlvbiA9IHVuZGVybGluZV9taW5pbXVtX29mZnNldDsKKyAgICAgICAgICAgICAgICAgICAgfQor ICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBtYXggKHBvc2l0aW9uLCB1bmRlcmxpbmVfbWlu aW11bV9vZmZzZXQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgLyogQ2hlY2sg dGhlIHNhbml0eSBvZiB0aGlja25lc3MgYW5kIHBvc2l0aW9uLiAgV2Ugc2hvdWxkCisgICAgICAg ICAgICAgICAgIGF2b2lkIGRyYXdpbmcgdW5kZXJsaW5lIG91dCBvZiB0aGUgY3VycmVudCBsaW5l IGFyZWEuICovCisgICAgICAgICAgICAgIGlmIChzLT55ICsgcy0+aGVpZ2h0IDw9IHMtPnliYXNl ICsgcG9zaXRpb24pCisgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+aGVpZ2h0IC0gMSkg LSAocy0+eWJhc2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQg PCBzLT55YmFzZSArIHBvc2l0aW9uICsgdGhpY2tuZXNzKQorICAgICAgICAgICAgICAgIHRoaWNr bmVzcyA9IChzLT55ICsgcy0+aGVpZ2h0KSAtIChzLT55YmFzZSArIHBvc2l0aW9uKTsKKyAgICAg ICAgICAgICAgcy0+dW5kZXJsaW5lX3RoaWNrbmVzcyA9IHRoaWNrbmVzczsKKyAgICAgICAgICAg ICAgcy0+dW5kZXJsaW5lX3Bvc2l0aW9uID0gcG9zaXRpb247CisgICAgICAgICAgICAgIHkgPSBz LT55YmFzZSArIHBvc2l0aW9uOworICAgICAgICAgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5l X2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMt PmdjLCBzLT54LCB5LCBzLT53aWR0aCwgdGhpY2tuZXNzKTsKKyAgICAgICAgICAgICAgZWxzZQor ICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIFhHQ1ZhbHVlcyB4Z2N2OworICAg ICAgICAgICAgICAgICAgWEdldEdDVmFsdWVzIChGUkFNRV9YX0RJU1BMQVkgKHMtPmYpLCBzLT5n YywgR0NGb3JlZ3JvdW5kLCAmeGdjdik7CisgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3Vu ZCAoRlJBTUVfWF9ESVNQTEFZIChzLT5mKSwgcy0+Z2MsIHMtPmZhY2UtPnVuZGVybGluZV9jb2xv cik7CisgICAgICAgICAgICAgICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChzLT5mLCBzLT5nYywgcy0+ eCwgeSwgcy0+d2lkdGgsIHRoaWNrbmVzcyk7CisgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdy b3VuZCAoRlJBTUVfWF9ESVNQTEFZIChzLT5mKSwgcy0+Z2MsIHhnY3YuZm9yZWdyb3VuZCk7Cisg ICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICA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ICAgICBpZiAocHJldi0+aGwg IT0gcy0+aGwKKyAgICAgICAgICAgICAgICAmJiBwcmV2LT54ICsgcHJldi0+d2lkdGggKyBwcmV2 LT5yaWdodF9vdmVyaGFuZyA+IHMtPngpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg ICAvKiBBcyBwcmV2IHdhcyBkcmF3biB3aGlsZSBjbGlwcGVkIHRvIGl0cyBvd24gYXJlYSwgd2UK KyAgICAgICAgICAgICAgICAgICBtdXN0IGRyYXcgdGhlIHJpZ2h0X292ZXJoYW5nIHBhcnQgdXNp bmcgcy0+aGwgbm93LiAqLworICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBz YXZlID0gcHJldi0+aGw7CisgICAgICAgICAgICAgICAgcHJldi0+aGwgPSBzLT5obDsKKyAgICAg ICAgICAgICAgICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKHByZXYsIGN1cnNvcl9nY19wKTsK KyAgICAgICAgICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywg cHJldik7CisgICAgICAgICAgICAgICAgaWYgKHByZXYtPmZpcnN0X2dseXBoLT50eXBlID09IENI QVJfR0xZUEgpCisgICAgICAgICAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVncm91 bmQgKHByZXYpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIHhfZHJh d19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHByZXYpOworICAgICAgICAgICAg ICAgIHhfcmVzZXRfY2xpcF9yZWN0YW5nbGVzIChwcmV2LT5mLCBwcmV2LT5nYyk7CisgICAgICAg ICAgICAgICAgcHJldi0+aGwgPSBzYXZlOworICAgICAgICAgICAgICAgIHByZXYtPm51bV9jbGlw cyA9IDA7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKHMtPm5leHQpCisg ICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpuZXh0OworICAgICAgICAg IGZvciAobmV4dCA9IHMtPm5leHQ7IG5leHQ7IG5leHQgPSBuZXh0LT5uZXh0KQorICAgICAgICAg ICAgaWYgKG5leHQtPmhsICE9IHMtPmhsCisgICAgICAgICAgICAgICAgJiYgbmV4dC0+eCAtIG5l eHQtPmxlZnRfb3ZlcmhhbmcgPCBzLT54ICsgcy0+d2lkdGgpCisgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAvKiBBcyBuZXh0IHdpbGwgYmUgZHJhd24gd2hpbGUgY2xpcHBlZCB0byBp dHMgb3duIGFyZWEsCisgICAgICAgICAgICAgICAgICAgd2UgbXVzdCBkcmF3IHRoZSBsZWZ0X292 ZXJoYW5nIHBhcnQgdXNpbmcgcy0+aGwgbm93LiAqLworICAgICAgICAgICAgICAgIGVudW0gZHJh d19nbHlwaHNfZmFjZSBzYXZlID0gbmV4dC0+aGw7CisgICAgICAgICAgICAgICAgbmV4dC0+aGwg PSBzLT5obDsKKyAgICAgICAgICAgICAgICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKG5leHQs IGN1cnNvcl9nY19wKTsKKyAgICAgICAgICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBp bmdfZXhhY3RseSAocywgbmV4dCk7CisgICAgICAgICAgICAgICAgaWYgKG5leHQtPmZpcnN0X2ds eXBoLT50eXBlID09IENIQVJfR0xZUEgpCisgICAgICAgICAgICAgICAgICB4X2RyYXdfZ2x5cGhf c3RyaW5nX2ZvcmVncm91bmQgKG5leHQpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgICAgICAgIHhfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5leHQp OworICAgICAgICAgICAgICAgIHhfcmVzZXRfY2xpcF9yZWN0YW5nbGVzIChuZXh0LT5mLCBuZXh0 LT5nYyk7CisgICAgICAgICAgICAgICAgbmV4dC0+aGwgPSBzYXZlOworICAgICAgICAgICAgICAg IG5leHQtPm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgICAgICAgbmV4dC0+Y2xpcF9oZWFkID0g cy0+bmV4dDsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAvKiBSZXNldCBj bGlwcGluZy4gKi8KKyAgeF9yZXNldF9jbGlwX3JlY3RhbmdsZXMgKHMtPmYsIHMtPmdjKTsKKyAg cy0+bnVtX2NsaXBzID0gMDsKK30KKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKIC8qIERlZmF1bHQgdG8gdXNpbmcgWElNIGlmIGF2YWls YWJsZS4gICovCiAjaWZkZWYgVVNFX1hJTQogYm9vbCB1c2VfeGltID0gdHJ1ZTsKQEAgLTExMDks NiArMjAwNywxNiBAQCBzdGF0aWMgdm9pZAogeF91cGRhdGVfYmVnaW4gKHN0cnVjdCBmcmFtZSAq ZikKIHsKICAgLyogTm90aGluZyB0byBkby4gICovCisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBm OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiB9CiAKIC8qIERyYXcgYSB2ZXJ0aWNh bCB3aW5kb3cgYm9yZGVyIGZyb20gKHgseTApIHRvICh4LHkxKSAgKi8KQEAgLTEyNTQsNiArMjE2 MiwxNiBAQCB4X3VwZGF0ZV9lbmQgKHN0cnVjdCBmcmFtZSAqZikKICAgWEZsdXNoIChGUkFNRV9Y X0RJU1BMQVkgKGYpKTsKICAgdW5ibG9ja19pbnB1dCAoKTsKICNlbmRpZgorCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0 aW5nX2ZyYW1lID0gTlVMTDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAv KiBUaGlzIGZ1bmN0aW9uIGlzIGNhbGxlZCBmcm9tIHZhcmlvdXMgcGxhY2VzIGluIHhkaXNwLmMK QEAgLTEzMjM4LDYgKzE0MTU2LDIwIEBAIGV4dGVybiBmcmFtZV9wYXJtX2hhbmRsZXIgeF9mcmFt ZV9wYXJtX2hhbmRsZXJzW107CiAKIHN0YXRpYyBzdHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFjZSB4 X3JlZGlzcGxheV9pbnRlcmZhY2UgPQogICB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBg eHRlcm0uY2AgbXVzdCBiZSBpbiB0aGUgZXhhY3Qgc2FtZSBvcmRlciBhcyB0aGUKK2ByZWRpc3Bs YXlfaW50ZXJmYWNlJyBpbiBgZGlzcGV4dGVybi5oYCEgKi8KKworICBtY194X2RyYXdfd2luZG93 X2N1cnNvciwKKyAgbWNfeF9kcmF3X2dseXBoX3N0cmluZywKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogICAgIHhfZnJhbWVfcGFybV9oYW5kbGVycywKICAgICBndWlfcHJvZHVjZV9n bHlwaHMsCiAgICAgZ3VpX3dyaXRlX2dseXBocywK --Multipart_Wed_Jul_31_12:39:45_2019-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs). References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 23 Aug 2019 05:21:02 +0000 Resent-Message-ID: <handler.22873.B22873.156653760312585 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22873 <at> debbugs.gnu.org,17684 <at> debbugs.gnu.org Cc: eliz@HIDDEN, johnw@HIDDEN, mbork@HIDDEN, rms@HIDDEN, akioburns@HIDDEN Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.156653760312585 (code B ref 22873); Fri, 23 Aug 2019 05:21:02 +0000 Received: (at 22873) by debbugs.gnu.org; 23 Aug 2019 05:20:03 +0000 Received: from localhost ([127.0.0.1]:38875 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1i11zW-0003Gl-71 for submit <at> debbugs.gnu.org; Fri, 23 Aug 2019 01:20:02 -0400 Received: from gateway20.websitewelcome.com ([192.185.59.4]:46383) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1i11zU-0003GL-2A for 22873 <at> debbugs.gnu.org; Fri, 23 Aug 2019 01:20:00 -0400 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway20.websitewelcome.com (Postfix) with ESMTP id D0613400CC520 for <22873 <at> debbugs.gnu.org>; Thu, 22 Aug 2019 23:15:15 -0500 (CDT) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id 11zSiI32v4FKp11zSiNIzm; Fri, 23 Aug 2019 00:19:59 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Fu+hq/EkQRNAItBwkmQ6cqUG8FsPsUKMdGIEmQwNV5A=; b=Ynb2Cs30gNsHGNEo5zztrjh92Y yN/W0at/74Fde+8y0QE4Eo7VMfym66+w/YLSmYZsiS95CEdMzf1J1bSGfrimohm7xcPtpev3QW5SL TjpMfx29ySwKwMvLp9Pm0aEPC9ZC59ur7niABMBxjbGed5QplJe+1tDhv7WSySQqdccTlOcodYWfY PNP2Ycrhje8G3yArL2C1Deu9wx0r7QK0OYPMkEghqdlQ3SAjDuFdoFDC1w34Tao/zlUjHuu95fruf VUswWN0jOfyx75hZE9fO/CNa/PLHncYFLQ5YmyyAowzMGmJgrGtQUJvU/D+xMY3ATfpYucdAIzmoq MudK1qDQ==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:51997 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from <esq@HIDDEN>) id 1i11zO-000PJP-Sy; Fri, 23 Aug 2019 00:19:58 -0500 Date: Thu, 22 Aug 2019 22:19:54 -0700 Message-ID: <m21rxc5uh1.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Thu_Aug_22_22:19:53_2019-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1i11zO-000PJP-Sy X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:51997 X-Source-Auth: lawlist X-Email-Count: 8 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> --Multipart_Thu_Aug_22_22:19:53_2019-1 Content-Type: text/plain; charset=US-ASCII VERSION: 022.003 [08/22/2019] CHANGELOG: - Fixed a bug preventing the visible fill column indicator from displaying on continuation lines when a partially visible glyph is straddling the window body width limit (aka text_area_width). - Fringe bitmap faces are now handled with `lookup_derived_face' instead of `lookup_named_face' so that the background color of the fringe will be taken into consideration (if it is different than the default background face). - `mc_draw_erase_hybrid': No need to call `mc_draw_fringe_bitmap' -- setting the rows with the necessary fringe bitmap data ensures `draw_row_fringe_bitmaps' will handle everything when needed. - `mc_update_window_erase': Fixed a couple of warnings during the build of Emacs relating to `fprintf' arguments not matching the expected %d\int format. - Revisions to the NOTES section of this commentary. - Miscellaneous tidying-up of code. VIDEOS: w32: https://youtu.be/r3BdJVlsAnQ ns: https://youtu.be/bc1h8jtbXmw x11: https://youtu.be/aCIFhD2Xz5s SCREENSHOTS: https://www.lawlist.com/images/22873_17684_light_dark_backgrounds.png SETUP: Step 1: git clone -b master git://git.sv.gnu.org/emacs.git Step 2: In the new emacs folder, go back to an Emacs version from 07/14/2019: git reset --hard ac57c5093829ee09084c562bbbc1c412179be13d Step 3: From within the new emacs folder created in Step 1, apply the patch: git apply /path/to/the/patch.diff Step 4: ./autogen.sh Step 5: ./configure ... [your custom options] Step 6: make Step 7: make install USAGE: - For a minimal working example of built-in fake cursors, type: M-x mc-test ;;; TURN ON FAKE CURSORS (buffer position, cursor-type, cursor color): (setq mc-conf '((1 "hbar" "magenta") (2 "bar" "purple") (3 "box" "#00FF00") (4 "hollow" "#0000FF") (5 ("hbar" 3) [1.0 0.0 1.0]) (6 ("bar" 3) [0.0 1.0 1.0]) (7 "framed" "OrangeRed"))) ;;; TURN OFF FAKE CURSORS: (setq mc-conf nil) - To try out both the crosshairs feature and the visible fill column indicator feature, type: M-x +-mode - To try out just the visible fill column indicator feature, type: M-x fc-mode - To try out built-in fake cursors with Magnar Sveen's multiple-cursors package, that package must be installed. If the multiple-cursors package is already installed, then just (require 'crosshairs) and `crosshairs.el` will redefine a few of the multiple-cursors functions and set up a few keyboard shortcuts. If the multiple-cursors package by Magnar Sveen is not already installed, then here are two easy ways to install that package: Type: M-x mc-install OR, evaluate the following snippet: (progn (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) (package-refresh-contents) (package-install 'multiple-cursors) (mc/built-in-cursors)) NOTES: - Our journey begins at the outset of `update_window' when `mc_update_window_dryrun' performs a `!draw_p` simulation to create a new cache of fake cursors that are stored in the `w->mc_matrix`. The cache of fake cursors from the previous redisplay is copied to a temporary `mc_matrix` under the name of `old_matrix`. `mc_update_text_area' (used for `!draw_p` / `draw_p` situations) calls `mc_draw_glyphs' (writes glyphs to the glass) followed by `mc_draw_row' (writes fake cursors to the glass immediately thereafter). At the tail end of `mc_update_window_dryrun', `mc_update_window_erase' compares the new `w->mc_matrix` with the `old_matrix` to determine which fake cursors are the same -- setting the `same_p` boolean struct member accordingly for each applicable fake cursor within the `w->mc_matrix`. All fake cursors in the `old_matrix` that are `!same_p` get erased at this juncture. [Fn 1.] After the dryrun is complete, `update_window' does the real thing -- `draw_p`. As to the `from_where` situations of SKIPPED, POST_CHANGED, UNCHANGED, and SET_CURSOR_TWO, `mc_helper' compares the incoming tentative fake cursor with the `w->mc_matrix` to see if it has previously been marked as `same_p` -- if it is `!same_p`, then the fake cursor is drawn and we `return`. Fake cursors that have a `cursor_type` of MC_LEFT_FRINGE_BITMAP or MC_RIGHT_FRINGE_BITMAP are always reset even if they are `same_p`. As to the `from_where` situations of SCRIBE_ONE, SCRIBE_TWO, SCRIBE_THREE, and NOWHERE, `mc_helper' always causes fake cursors to be drawn (because new glyphs were written to the glass, or the area to the right of the display line was cleared) and we `return`. . Fn. 1: Even though writing new glyphs to the glass (SCRIBE_ONE, SCRIBE_TWO, and SCRIBE_THREE) would erase fake cursors within those boundaries, it is still necessary to erase `!same_p` fake cursors prior thereto. This is because `scrolling_window' occurs before new glyphs are written and `rif->scroll_run_hook' may copy one or more rows to other areas of the glass. It is not worth the effort to programmatically track both the _copied_ fake cursors and the _original_ fake cursors from the previous redisplay cycle, whose glyphs may remain where they are in the current redisplay cycle because they satisfy the `GLYPH_EQUAL_P' test. - The rest of our journey takes place wherever `draw_glyphs' would ordinarily be called, excluding `update_text_area'. If features 17684/22873 are active, `mc_redraw_row' calls `mc_draw_glyphs' (writes glyphs to the glass) and fake cursors are written to the glass immediately thereafter (if the coordinates coincide with prerecorded data in the `w->mc_matrix`). The functions containing the aforementioned calls are: . `gui_insert_glyphs' . `gui_fix_overlapping_area' . `draw_row_with_mouse_face' . `expose_area' . `expose_line' . `redraw_overlapped_rows' [which has been incorporated into `update_window'] - As to `mc_scrolling_window', it would appear that there is no tangible benefit to rotating the current/prospective cache of fake cursors to compare the data before removing the fake cursors. When scrolling the display, only _some_ lines are copied to new locations. Areas that are not overwritten may have fake cursors and those may not necessarily be removed if desired/current matrix glyphs are equal. The test for `GLYPH_EQUAL_P' does not take into consideration the existence of a fake cursor, and the glyph (with a fake cursor) may not be updated as a result thereof. As to lines that are not copied, portions may be updated and fake cursors would be removed thereby. `mc_rotate_matrix' and `mc_reverse_vpos' were removed with patch v. 022.002. - NS: As of 09/28/2018 (7946445962372c4255180af45cb7c857f1b0b5fa), the NS port no longer does anything useful during `update_window' except mark dirty rectangles. All drawing is now done when the MacOS calls `drawRect', which in turn calls `expose_frame'. TODO: - When an idle-timer fires and point is at the end of a horizontally scrolled line in a narrow window, the temporary horizontal scroll is canceled. Create a minimal working example and file a bug report. (progn (defun test () (interactive) (let ((ov (make-overlay (point) (1+ (point)) nil t t))) (overlay-put ov 'face '(:foreground "red")))) (global-set-key [f5] 'test) (split-window-horizontally) (switch-to-buffer (get-buffer-create "foo")) (setq bidi-display-reordering nil) (setq-local auto-hscroll-mode 'current-line) (dotimes (i 80) (insert (char-to-string (+ 65 i))))) - `ns_draw_window_cursor' calls `ns_clip_to_rect', which does _not_ take `row->clip` into consideration when drawing cursors with `NSRectFill'. When it comes time to draw glyphs on top of the box/hollow family of cursors, `row->clip` is taken into consideration by `get_glyph_string_clip'. Fake cursors can be drawn even though the glyphs cannot, resulting in hollow/box family of cursors without text. The issue can be reproduced with M-x mc-test. [A temporary workaround is to disable `row->clip` while drawing the glyphs.] https://lists.gnu.org/archive/html/emacs-devel/2019-04/msg00009.html - Deal with left/right overwritten glyphs in the w32 and X ports of Emacs. - There is a bug affecting the recorded `w->mc.lnum_pixel_width` that is observable when not running under gdb, but disappears when running under gdb. While viewing a folded org-mode buffer, the non-gdb instance had a visible line number pixel-width of 44, but Emacs treated it as fluctuating between 44 and 55 as the cursor was moved to the end of line. In the gdb instance, the visible line number pixel width was 55 with no fluctuation under the same conditions as the non-gdb instance. This appears to be a different bug than bug#32177 (current line number shifts one column to the left) because the line number of the current line does not shift left, and changing the bidi settings did not correct the issue. - The current test for `auto_hscroll_mode_p' only looks for `current_line` and all five related tests are based upon that assumption, which may not be true. - Multiple Cursors: If point is in the middle of a composite character, then select a fully composed character so that the fake cursor is visible. - Implement functionality similar to the Lisp multiple-cursors by Magnar Sveen. - Follow up with the Emacs team re bug#32177; i.e., (Current line number shifts one column to the left.) - Follow up with the Emacs team re bug#32060; i.e., Horizontal Scrolling (Current Line): Wrong line gets h-scrolled. - Determine if bug #28936 needs to be fixed and help the Emacs team re same. - Is there any additional meaningful optimization that can be added to the three calls of `mc_pre_scroll_clean'? - There is a bug affecting an older version of Emacs for the NS port that causes partial line flickering when the same characters are grouped together (;;;;;;) and MC_GLYPHLESS cursors are above or below -- having the same background color as the frame; e.g., black on black (used to erase a glyphless cursor). The partial flickering is only noticeable with rapid fire; e.g., holding down the right/left arrow key. When changing the color of the glyphless cursor, the issue is not present. [@lawlist has verified that the X and HPOS coordinates are accurate.] --Multipart_Thu_Aug_22_22:19:53_2019-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="2019_08_22__20_16_49_786.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvY3Jvc3NoYWlycy5lbCBiL2xpc3AvY3Jvc3NoYWlycy5lbApuZXcg ZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi43ODI3NTJmCi0tLSAvZGV2L251bGwKKysr IGIvbGlzcC9jcm9zc2hhaXJzLmVsCkBAIC0wLDAgKzEsMTI4OCBAQAorOzs7Ozs7Ozs7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LWN1 cnNvcnMtbW9kZSAwKQorICAgICAgICAod2hlbiB0aGlzLW9yaWdpbmFsLWNvbW1hbmQKKyAgICAg ICAgICAobGV0ICgob3JpZ2luYWwtY29tbWFuZCAob3IgbWMtLXRoaXMtY29tbWFuZAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29tbWFuZC1yZW1hcHBpbmcgdGhpcy1v cmlnaW5hbC1jb21tYW5kKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0 aGlzLW9yaWdpbmFsLWNvbW1hbmQpKSkKKyAgICAgICAgICAgIDs7IHNraXAga2V5Ym9hcmQgbWFj cm9zLCBzaW5jZSB0aGV5IHdpbGwgZ2VuZXJhdGUgYWN0dWFsIGNvbW1hbmRzIHRoYXQgYXJlCisg ICAgICAgICAgICA7OyBhbHNvIHJ1biBpbiB0aGUgY29tbWFuZCBsb29wIC0gd2UnbGwgaGFuZGxl IHRob3NlIGxhdGVyIGluc3RlYWQuCisgICAgICAgICAgICAod2hlbiAoZnVuY3Rpb25wIG9yaWdp bmFsLWNvbW1hbmQpCisgICAgICAgICAgICAgIDs7IGlmIGl0J3MgYSBsYW1iZGEsIHdlIGNhbid0 IGtub3cgaWYgaXQncyBzdXBwb3J0ZWQgb3Igbm90CisgICAgICAgICAgICAgIDs7IC0gc28gZ28g YWhlYWQgYW5kIGFzc3VtZSBpdCdzIG9rLCBiZWNhdXNlIHdlJ3JlIGp1c3Qgb3B0aW1pc3RpYyBs aWtlIHRoYXQKKyAgICAgICAgICAgICAgKGlmIChvciAobm90IChzeW1ib2xwIG9yaWdpbmFsLWNv bW1hbmQpKQorICAgICAgICAgICAgICAgICAgICAgIDs7IGxhbWJkYSByZWdpc3RlcmVkIGJ5IHNt YXJ0cmVwCisgICAgICAgICAgICAgICAgICAgICAgKHN0cmluZy1wcmVmaXgtcCAiKCIgKHN5bWJv bC1uYW1lIG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAgICAgICAgICAgICAgICAgIChtYy9leGVjdXRl LWNvbW1hbmQtZm9yLWFsbC1mYWtlLWN1cnNvcnMgb3JpZ2luYWwtY29tbWFuZCkKKyAgICAgICAg ICAgICAgICA7OyBzbWFydHJlcCBgaW50ZXJuJ3MgY29tbWFuZHMgaW50byBvd24gb2JhcnJheSB0 byBoZWxwCisgICAgICAgICAgICAgICAgOzsgYGRlc2NyaWJlLWJpbmRpbmdzJy4gIFNvLCBsZXQn cyByZS1gaW50ZXJuJyBoZXJlIHRvCisgICAgICAgICAgICAgICAgOzsgbWFrZSB0aGUgY29tbWFu ZCBjb21wYXJhYmxlIGJ5IGBlcScuCisgICAgICAgICAgICAgICAgKHNldHEgb3JpZ2luYWwtY29t bWFuZCAoaW50ZXJuIChzeW1ib2wtbmFtZSBvcmlnaW5hbC1jb21tYW5kKSkpCisgICAgICAgICAg ICAgICAgOzsgb3RoZXJ3aXNlIGl0J3MgYSBzeW1ib2wsIGFuZCB3ZSBjYW4gYmUgbW9yZSB0aG9y b3VnaAorICAgICAgICAgICAgICAgIChpZiAoZ2V0IG9yaWdpbmFsLWNvbW1hbmQgJ21jLS11bnN1 cHBvcnRlZCkKKyAgICAgICAgICAgICAgICAgICAgKG1lc3NhZ2UgIiVTIGlzIG5vdCBzdXBwb3J0 ZWQgd2l0aCBtdWx0aXBsZSBjdXJzb3JzJXMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg IG9yaWdpbmFsLWNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdldCBvcmln aW5hbC1jb21tYW5kICdtYy0tdW5zdXBwb3J0ZWQpKQorICAgICAgICAgICAgICAgICAgKHdoZW4g KGFuZCBvcmlnaW5hbC1jb21tYW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChub3Qg KG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy0tZGVmYXVsdC1jbWRzLXRvLXJ1bi1vbmNlKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKG5vdCAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1j L2NtZHMtdG8tcnVuLW9uY2UpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAob3IgbWMv YWx3YXlzLXJ1bi1mb3ItYWxsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVt cSBvcmlnaW5hbC1jb21tYW5kIG1jLS1kZWZhdWx0LWNtZHMtdG8tcnVuLWZvci1hbGwpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jL2Nt ZHMtdG8tcnVuLWZvci1hbGwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWMv cHJvbXB0LWZvci1pbmNsdXNpb24taW4td2hpdGVsaXN0IG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAg ICAgICAgICAgICAgICAgICAgKG1jL2V4ZWN1dGUtY29tbWFuZC1mb3ItYWxsLWZha2UtY3Vyc29y cyBvcmlnaW5hbC1jb21tYW5kKSkpKQorICAgICAgICAgICAgICAod2hlbiBtYy91c2UtYnVpbHQt aW4tY3Vyc29ycworICAgICAgICAgICAgICAgIChzZXRxIG1jLWNvbmYKKyAgICAgICAgICAgICAg ICAgICAgICAgIChtYXBjYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKGxhbWJkYSAoeCkg KGxpc3QgKG92ZXJsYXktc3RhcnQgeCkgImJhciIgbmlsKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgKG1jL2FsbC1mYWtlLWN1cnNvcnMpKSkpKSkpKSkpCisKKyAgKGRlZnVuIG1jL21hcmst bmV4dC1saWtlLXRoaXMtY3ljbGUtZm9yd2FyZCAoKQorICAiTWFya3MgbmV4dCBvY2N1cmVuY2Ug b2Ygd29yZCBsaWtlIHRoaXMgYW5kIGFkdmFuY2VzIGN1cnNvciB0byB0aGlzIG9jY3VycmVuY2Ui CisgIChpbnRlcmFjdGl2ZSkKKyAgICAobW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iICJwdXJwbGUiKQorICAg ICAgICAgICAgICAgICAgICAgICgzICJib3giICIjMDBGRjAwIikKKyAgICAgICAgICAgICAgICAg ICAgICAoNCAiaG9sbG93IiAiIzAwMDBGRiIpCisgICAgICAgICAgICAgICAgICAgICAgKDUgKCJo YmFyIiAzKSBbMS4wIDAuMCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg2ICgiYmFyIiAz KSBbMC4wIDEuMCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg3ICJmcmFtZWQiICJPcmFu Z2VSZWQiKQorICAgICAgICAgICAgICAgICAgICAgICg4ICJib3giICJncmV5MjUiKQorICAgICAg ICAgICAgICAgICAgICAgICg5ICJib3giICJncmV5NzUiKSkpKQorICAgIChzZWxlY3Qtd2luZG93 IChkaXNwbGF5LWJ1ZmZlciBidWZmZXIpKSkpCisKKyhkZWZ1biArLXRpbWVyLWZuICgpCisiU2lu Y2UgdGhpcyBmaXJlcyBnbG9iYWxseSwgd2UgbXVzdCBjb250cm9sIHdoaWNoIGJ1ZmZlcnMgY3Jv c3NoYWlycyBhcHBlYXIgaW4uIgorICAod2hlbiArLW1vZGUKKyAgICAodW5sZXNzIChvciAobWVt cSBsYXN0LWNvbW1hbmQgKy1wYXJlbnMtZXhjbHVzaW9ucykKKyAgICAgICAgICAgICAgICAobnVs bCArLXBhcmVucy1wKSkKKyAgICAgICgrLXBhcmVucy1mbikpCisgICAgKHdoZW4gKy10aW1lci12 YXIKKyAgICAgIChzZXRxIHRpbWVyLWlkbGUtbGlzdCAoZGVscSArLXRpbWVyLXZhciB0aW1lci1p ZGxlLWxpc3QpKQorICAgICAgKHNldHEgKy10aW1lci12YXIgbmlsKSkpKQorCisoZGVmdW4gKy1k cmF3LWZvcnRod2l0aCAoKQorIkltbWVkaWF0ZWx5IGRlbGV0ZS9kcmF3IG1hdGNoaW5nIHBhcmVu dGhlc2VzLiIKKyAgKCstZHJhdy1jcm9zc2hhaXJzICdmb3JjZSkpCisKKyhkZWZ1biArLWRyYXct Y3Jvc3NoYWlycyAoJm9wdGlvbmFsIGZvcmNlKQorIkltbWVkaWF0ZWx5IGRlbGV0ZSBtYXRjaGlu ZyBwYXJlbnRoZXNlcy4gIElmIEZPUkNFIGlzIG5vbi1uaWwsIHRoZW4gaW1tZWRpYXRlbHkKK2Ry YXcgbWF0Y2hpbmcgcGFyZW50aGVzaXM7IG90aGVyd2lzZSwgZHJhdyB0aGVtIG9uIGFuIGlkbGUt dGllci4iCisgICh3aGVuICstbW9kZQorICAgICh3aGVuICstdGltZXItdmFyCisgICAgICAoc2V0 cSB0aW1lci1pZGxlLWxpc3QgKGRlbHEgKy10aW1lci12YXIgdGltZXItaWRsZS1saXN0KSkKKyAg ICAgIChzZXRxICstdGltZXItdmFyIG5pbCkpCisgICAgKHVubGVzcyAob3IgKG1lbXEgdGhpcy1j b21tYW5kICstcGFyZW5zLWV4Y2x1c2lvbnMpCisgICAgICAgICAgICAgICAgKGFuZCAobnVsbCAr LXBhcmVucy1wKQorICAgICAgICAgICAgICAgICAgICAgKG51bGwgKy1wYXJlbnMtb3ZlcmxheXMt ZXhpc3QtcCkpKQorICAgICAgKCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykpCisgICAgKGlmIGZv cmNlCisgICAgICAocHJvZ24KKyAgICAgICAgKHdoZW4gKy1wYXJlbnMtcAorICAgICAgICAgICgr LXBhcmVucy1mbikpKQorICAgICAgKHNldHEgKy10aW1lci12YXIgKHJ1bi13aXRoLWlkbGUtdGlt ZXIgKy1pZGxlLXRpbWVyLXNlY29uZHMgbmlsICMnKy10aW1lci1mbikpKSkpCisKKyhkZWZ2YXIg ZmMtbW9kZSkKKworOzs7IyMjYXV0b2xvYWQKKyhkZWZpbmUtbWlub3ItbW9kZSArLW1vZGUKKyJN aW5vciBtb2RlIGZvciBkaXNwbGF5aW5nIGEgaG9yaXpvbnRhbCBydWxlci4iCisgIDppbml0LXZh bHVlIG5pbAorICA6bGlnaHRlciAiICsiCisgIDprZXltYXAgbmlsCisgIDpnbG9iYWwgbmlsCisg IDpncm91cCAnKy1tb2RlCisgIChjb25kCisgICAgKCstbW9kZQorICAgICAgOzs7IGArLW1vZGUn IGhhcyB0aGUgYWJpbGl0eSB0byBhbHNvIGRpc3BsYXkgYSBmaWxsIGNvbHVtbiBpbmRpY2F0b3Iu CisgICAgICA7OzsgU2VlIHRoZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicuCisgICAgICAod2hl biBmYy1tb2RlCisgICAgICAgIChmYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgZ2xvYmFs LWVsZG9jLW1vZGUKKyAgICAgICAgICAgICAgICAgKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAgJ2Fu eSkKKyAgICAgICAgICAgICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAg ICAgICAgKGdsb2JhbC1lbGRvYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgaml0LWxvY2st Y29udGV4dC10aW1lcgorICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAn YW55KQorICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQor ICAgICAgICAod2hlbiAodGltZXJwIGppdC1sb2NrLWNvbnRleHQtdGltZXIpCisgICAgICAgICAg KGNhbmNlbC10aW1lciBqaXQtbG9jay1jb250ZXh0LXRpbWVyKSkKKyAgICAgICAgOzsgKHNldHEg aml0LWxvY2stY29udGV4dC10aW1lciAocnVuLXdpdGgtaWRsZS10aW1lciA1LjAgJ3JlcGVhdCAn aml0LWxvY2stY29udGV4dC1mb250aWZ5KSkKKyAgICAgICAgKHNldHEgaml0LWxvY2stY29udGV4 dC10aW1lciBuaWwpKQorICAgICAgKHdoZW4gKGFuZCAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAn YW55KQorICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQor ICAgICAgICAod2hlbiAodGltZXJwIHVuZG8tYXV0by1jdXJyZW50LWJvdW5kYXJ5LXRpbWVyKQor ICAgICAgICAgIChjYW5jZWwtdGltZXIgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIp KQorICAgICAgICAoZnNldCAndW5kby1hdXRvLS11bmRvYWJsZS1jaGFuZ2UKKyAgICAgICAgICAg ICAgKGxhbWJkYSAoKSAoYWRkLXRvLWxpc3QgJ3VuZG8tYXV0by0tdW5kb2FibHktY2hhbmdlZC1i dWZmZXJzIChjdXJyZW50LWJ1ZmZlcikpKSkKKyAgICAgICAgKGZzZXQgJ3VuZG8tYXV0by1hbWFs Z2FtYXRlICdpZ25vcmUpKQorICAgICAgKHdoZW4gYmxpbmstY3Vyc29yLW1vZGUKKyAgICAgICAg KGJsaW5rLWN1cnNvci1tb2RlIC0xKQorICAgICAgICAod2hlbiAobWVtcSAnYmxpbmstY3Vyc29y LWNoZWNrIHBvc3QtY29tbWFuZC1ob29rKQorICAgICAgICAgIChyZW1vdmUtaG9vayAncG9zdC1j b21tYW5kLWhvb2sgJ2JsaW5rLWN1cnNvci1jaGVjaykpKQorICAgICAgKHNldHEgY3Jvc3NoYWly cyB0KQorICAgICAgKHdoZW4gKy1maWxsLWNvbHVtbgorICAgICAgICAoc2V0cSBmYy12aXNpYmxl IHQpKQorICAgICAgOzs7IGBhdXRvLWNvbXBvc2l0aW9uLW1vZGUnIGlzIG5lZWRlZCBmb3IgY3Jv c3NoYWlycyB0byBwcm9wZXJseSBjYWxjdWxhdGUKKyAgICAgIDs7OyBjb29yZGluYXRlcyBvZiBj b21wb3NpdGlvbiBjaGFyYWN0ZXJzLiAgQXV0b21hdGljYWxseSBiZWNvbWVzIHBlcm1hbmVudGx5 CisgICAgICA7OzsgYnVmZmVyLWxvY2FsIHdoZW4gc2V0LgorICAgICAgKHVubGVzcyBhdXRvLWNv bXBvc2l0aW9uLW1vZGUKKyAgICAg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ICAgIChwdXNoIChjb25zIHZhciAoc3ltYm9sLXZhbHVlIHZhcikpICstLXNhdmVkLXN0YXRlKSkp CisgICAgICAoc2V0cSBmaWxsLWNvbHVtbiA4MCkKKyAgICAgIChzZXRxIGRpc3BsYXktbGluZS1u dW1iZXJzIHQpCisgICAgICAoc2V0cS1sb2NhbCBhdXRvLWhzY3JvbGwtbW9kZSAnY3VycmVudC1s aW5lKQorICAgICAgKHNldHEtbG9jYWwgaHNjcm9sbC1zdGVwIDUpCisgICAgICAoc2V0cSBidWZm ZXItZGlzcGxheS10YWJsZSArLWJ1ZmZlci1kaXNwbGF5LXRhYmxlKQorICAgICAgKHNldHEgdGFi LXdpZHRoIDQpCisgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICdsaW5lLW1vdmUtdmlz dWFsKSB0KQorICAgICAgKHNldHEgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgKGNvbmQKKyAgICAg ICAgICAoKGxldCAoKGxzdCArLXRydW5jYXRlLWxpbmVzLWRlcml2ZWQtbW9kZXMpCisgICAgICAg ICAgICAgICAgICBtb2RlKQorICAgICAgICAgICAgKGNhdGNoICdmb3VuZAorICAgICAgICAgICAg ICAod2hpbGUgKHNldHEgbW9kZSAocG9wIGxzdCkpCisgICAgICAgICAgICAgICAgKHdoZW4gKGRl cml2ZWQtbW9kZS1wIG1vZGUpCisgICAgICAgICAgICAgICAgICAodGhyb3cgJ2ZvdW5kIHQpKSkp KSkKKyAgICAgICAgICAgKChtZW1xIG1ham9yLW1vZGUgKy10cnVuY2F0ZS1saW5lcy1tYWpvci1t b2RlcykpCisgICAgICAgICAgICh0CisgICAgICAgICAgICAgbmlsKSkpCisgICAgICAoc2V0ICht YWtlLWxvY2FsLXZhcmlhYmxlICd0cnVuY2F0ZS1wYXJ0aWFsLXdpZHRoLXdpbmRvd3MpIG5pbCkK KyAgICAgIChzZXRxIHdvcmQtd3JhcCB0KQorICAgICAgKHNldHEgaW5kaWNhdGUtZW1wdHktbGlu ZXMgdCkKKyAgICAgIChzZXRxIGluZGljYXRlLWJ1ZmZlci1ib3VuZGFyaWVzICdsZWZ0KQorICAg ICAgKHNldHEgZnJpbmdlLWluZGljYXRvci1hbGlzdAorICAgICAgICAgIDs7OyBoc2NsX2FsbF90 ZW1wX3AgfCBoc2NsX3RlbXBfcAorICAgICAgICAnKCgrLWhzY2wtdGVtcCAuICgrLXNpbmdsZS1h bmdsZS1sZWZ0CisgICAgICAgICAgICAgICAgICAgICAgICAgICstZG91YmxlLWFuZ2xlLWxlZnQp KQorICAgICAgICAgIDs7OyBoc2NsX2FsbF9wZXJtXzBfcCB8IGhzY2xfYWxsX3Blcm1fMV9wIHwg aHNjbF9hbGxfcGVybV8yX3AgfCBoc2NsX3Blcm1fcAorICAgICAgICAgICgrLWhzY2wtcGVybSAu ICgrLXNpbmdsZS1hbmdsZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLWRvdWJsZS1h bmdsZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLXRyaXBsZS1hbmdsZS11cAorICAg ICAgICAgICAgICAgICAgICAgICAgICArLXF1YWRydXBsZS1hbmdsZS11cCkpCisgICAgICAgICAg KCstb3ZlcmxheS1hcnJvdyAuICgrLWZyaW5nZS1sZWZ0LWFycm93CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICArLWZyaW5nZS1yaWdodC1hcnJvdykpCisgICAgICAgICAgKHRydW5jYXRp b24gLiAoKy1mcmluZ2UtbGVmdC1hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICstZnJp bmdlLXJpZ2h0LWFycm93KSkKKyAgICAgICAgICAoY29udGludWF0aW9uIC4gKCstZnJpbmdlLWxl ZnQtY3VybHktYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICstYmFja3NsYXNoKSkK KyAgICAgICAgICAob3ZlcmxheS1hcnJvdyAuICstZnJpbmdlLXJpZ2h0LXRyaWFuZ2xlKQorICAg ICAgICAgICh1cCAuICstZnJpbmdlLXVwLWFycm93KQorICAgICAgICAgIChkb3duIC4gKy1mcmlu Z2UtZG93bi1hcnJvdykKKyAgICAgICAgICAodG9wIC4gKy1mcmluZ2UtdG9wLWxlZnQtYW5nbGUp CisgICAgICAgICAgKGJvdHRvbSAuICstZnJpbmdlLWJvdHRvbS1yaWdodC1hbmdsZSkKKyAgICAg ICAgICAodG9wLWJvdHRvbSAuICgrLWZyaW5nZS1sZWZ0LWJyYWNrZXQKKyAgICAgICAgICAgICAg ICAgICAgICAgICArLWZyaW5nZS1yaWdodC1icmFja2V0CisgICAgICAgICAgICAgICAgICAgICAg ICAgKy1mcmluZ2UtdG9wLXJpZ2h0LWFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgKy1m cmluZ2UtdG9wLWxlZnQtYW5nbGUpKQorICAgICAgICAgIChlbXB0eS1saW5lIC4gKy1mcmluZ2Ut ZW1wdHktbGluZSkKKyAgICAgICAgICAodW5rbm93biAuICstZnJpbmdlLXF1ZXN0aW9uLW1hcmsp KSkKKyAgICAgIChzZXRxIGZyaW5nZS1jdXJzb3ItYWxpc3QgJygoYm94IC4gKy1mcmluZ2UtbGVm dC10cmlhbmdsZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaG9sbG93IC4g Ky1ob2xsb3ctcmVjdGFuZ2xlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChi YXIgLiArLXZlcnRpY2FsLWJhcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo aGJhciAuICstZnJpbmdlLWhvcml6b250YWwtYmFyKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIChob2xsb3ctc21hbGwgLiArLWZyaW5nZS1ob2xsb3ctc3F1YXJlKSkpCisgICAg ICAoaWYgKG9yICstZm9ydGh3aXRoCisgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZp eC1hcmcgJyg0KSkpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJh dy1mb3J0aHdpdGggJ2FwcGVuZCAnbG9jYWwpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21t YW5kLWhvb2sgJystZHJhdy1jcm9zc2hhaXJzICdhcHBlbmQgJ2xvY2FsKSkKKyAgICAgICh3aGVu ICstZm9ydGh3aXRoCisgICAgICAgIChhZGQtaG9vayAnd2luZG93LWNvbmZpZ3VyYXRpb24tY2hh bmdlLWhvb2sgJystZHJhdy1mb3J0aHdpdGggbmlsICdsb2NhbCkpCisgICAgICAoYWRkLWhvb2sg J2NoYW5nZS1tYWpvci1tb2RlLWhvb2sgJ3R1cm4tb2ZmLSstbW9kZSBuaWwgJ2xvY2FsKQorICAg ICAgOzs7IE1hdGNoaW5nIHBhcmVudGhlc2VzIGRyYXdpbmcgZm9ydGh3aXRoIGludGVyZmVyZXMg d2l0aCB5YXNuaXBwZXQuCisgICAgICAod2hlbiArLWZvcnRod2l0aAorICAgICAgICAoc2V0cSAr LXBhcmVucy1wIG5pbCkpCisgICAgICAod2hlbiAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55 KQorICAgICAgICAoY29uZAorICAgICAgICAgICgrLWZvcnRod2l0aAorICAgICAgICAgICAgKG1l c3NhZ2UgIlR1cm5lZCBPTiBgKy1tb2RlJyAtLSBEcmF3IG1hdGNoaW5nIHBhcmVudGhlc2VzIGlt bWVkaWF0ZWx5LiIpKQorICAgICAgICAgICgoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkp CisgICAgICAgICAgICA7OzsgTWF0Y2hpbmcgcGFyZW50aGVzZXMgd2lsbCBiZSBkcmF3biBpbW1l ZGlhdGVseS4KKyAgICAgICAgICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScgLS0gT3B0 aW1pemVkIGZvciBkZWJ1Z2dpbmcgcHVycG9zZXMuIikpCisgICAgICAgICAgKHQKKyAgICAgICAg ICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScuIikpKSkpCisgICAgKHQKKyAgICAgIChr aWxsLWxvY2FsLXZhcmlhYmxlICdmaWxsLWNvbHVtbikKKyAgICAgIChraWxsLWxvY2FsLXZhcmlh YmxlICdhdXRvLWhzY3JvbGwtbW9kZSkKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdoc2Ny b2xsLXN0ZXApCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnY3Jvc3NoYWlycykKKyAgICAg IChraWxsLWxvY2FsLXZhcmlhYmxlICdmYy12aXNpYmxlKQorICAgICAgKGtpbGwtbG9jYWwtdmFy aWFibGUgJ2Rpc3BsYXktbGluZS1udW1iZXJzKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUg J2Rpc3BsYXktbGluZS1udW1iZXJzLXdpZHRoKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUg J21jLWNvbmYpCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnYnVmZmVyLWRpc3BsYXktdGFi bGUpCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAndGFiLXdpZHRoKQorICAgICAgKGtpbGwt bG9jYWwtdmFyaWFibGUgJ2xpbmUtbW92ZS12aXN1YWwpCisgICAgICAoa2lsbC1sb2NhbC12YXJp YWJsZSAndHJ1bmNhdGUtbGluZXMpCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAndHJ1bmNh dGUtcGFydGlhbC13aWR0aC13aW5kb3dzKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJ3dv cmQtd3JhcCkKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdpbmRpY2F0ZS1lbXB0eS1saW5l cykKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdpbmRpY2F0ZS1idWZmZXItYm91bmRhcmll cykKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdmcmluZ2UtaW5kaWNhdG9yLWFsaXN0KQor ICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJ2ZyaW5nZS1jdXJzb3ItYWxpc3QpCisgICAgICAo a2lsbC1sb2NhbC12YXJpYWJsZSAnKy1mb3J0aHdpdGgpCisgICAgICAoZG9saXN0IChzYXZlZCAr LS1zYXZlZC1zdGF0ZSkKKyAgICAgICAgKHNldCAobWFrZS1sb2NhbC12YXJpYWJsZSAoY2FyIHNh dmVkKSkgKGNkciBzYXZlZCkpKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJystLXNhdmVk LXN0YXRlKQorICAgICAgKCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykKKyAgICAgICh3aGVuICht ZW1xICcrLWRyYXctZm9ydGh3aXRoIHBvc3QtY29tbWFuZC1ob29rKQorICAgICAgICAocmVtb3Zl LWhvb2sgJ3Bvc3QtY29tbWFuZC1ob29rICcrLWRyYXctZm9ydGh3aXRoICdsb2NhbCkpCisgICAg ICAod2hlbiAobWVtcSAnKy1kcmF3LWNyb3NzaGFpcnMgcG9zdC1jb21tYW5kLWhvb2spCisgICAg ICAgIChyZW1vdmUtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJhdy1jcm9zc2hhaXJzICds b2NhbCkpCisgICAgICAod2hlbiAobWVtcSAnKy1kcmF3LWZvcnRod2l0aCB3aW5kb3ctY29uZmln dXJhdGlvbi1jaGFuZ2UtaG9vaykKKyAgICAgICAgKHJlbW92ZS1ob29rICd3aW5kb3ctY29uZmln dXJhdGlvbi1jaGFuZ2UtaG9vayAnKy1kcmF3LWZvcnRod2l0aCAnbG9jYWwpKQorICAgICAgKHJl bW92ZS1ob29rICdjaGFuZ2UtbWFqb3ItbW9kZS1ob29rICd0dXJuLW9mZi0rLW1vZGUgJ2xvY2Fs KQorICAgICAgKHdoZW4gKy10aW1lci12YXIKKyAgICAgICAgKHNldHEgdGltZXItaWRsZS1saXN0 IChkZWxxICstdGltZXItdmFyIHRpbWVyLWlkbGUtbGlzdCkpCisgICAgICAgIChzZXRxICstdGlt ZXItdmFyIG5pbCkpCisgICAgICAod2hlbiAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQor ICAgICAgICAobWVzc2FnZSAiVHVybmVkIE9GRiBgKy1tb2RlJy4iKSkpKSkKKworKGRlZnVuIHR1 cm4tb2ZmLSstbW9kZSAoKQorICAoKy1tb2RlIC0xKSkKKworOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7CisKKyhkZWZ1biArLXBhcmVucy1mbiAoKQorICAiRG9jLXN0cmluZy4iCisgIChsZXQqICgo b3BvaW50IChwb2ludCkpCisgICAgICAgICAoZnJvbSAoaWYgKy1wYXJlbnMtZnJvbS1mbgorICAg ICAgICAgICAgICAgICAoZnVuY2FsbCArLXBhcmVucy1mcm9tLWZuKQorICAgICAgICAgICAgICAg ICAocG9pbnQtbWluKSkpCisgICAgICAgICAod2luIChzZWxlY3RlZC13aW5kb3cpKQorICAgICAg ICAgKGkgMCkKKyAgICAgICAgIChwcmVjZWRpbmctY2hhciAocHJlY2VkaW5nLWNoYXIpKQorICAg ICAgICAgKG9jaGFyIChjaGFyLWFmdGVyIG9wb2ludCkpCisgICAgICAgICAocG9zMQorICAgICAg ICAgICAoY29uZAorICAgICAgICAgICAgICgoYW5kIG9jaGFyCisgICAgICAgICAgICAgICAgICAg KG9yIDs7OyAoY2hhci10by1zdHJpbmcgNDApID0+IG9wZW5pbmcgcGFyZW50aGVzaXMKKyAgICAg ICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgNDApCisgICAgICAgICAgICAgICAgICAgICAgIDs7 OyAoY2hhci10by1zdHJpbmcgOTEpID0+IG9wZW5pbmcgc3F1YXJlIGJyYWNrZXQKKyAgICAgICAg ICAgICAgICAgICAgICAgKD0gb2NoYXIgOTEpCisgICAgICAgICAgICAgICAgICAgICAgIDs7OyAo Y2hhci10by1zdHJpbmcgMTIzKSA9PiBvcGVuaW5nIHdhdnkgYnJhY2tldAorICAgICAgICAgICAg ICAgICAgICAgICAoPSBvY2hhciAxMjMpKSkKKyAgICAgICAgICAgICAgICAobWluICgxKyBvcG9p bnQpIChwb2ludC1tYXgpKSkKKyAgICAgICAgICAgICAoKG9yIDs7OyAoY2hhci10by1zdHJpbmcg NDEpID0+IGNsb3NpbmcgcGFyZW50aGVzaXMKKyAgICAgICAgICAgICAgICAgICg9IHByZWNlZGlu Zy1jaGFyIDQxKQorICAgICAgICAgICAgICAgICAgOzs7IChjaGFyLXRvLXN0cmluZyA5MykgPT4g Y2xvc2luZyBzcXVhcmUgYnJhY2tldAorICAgICAgICAgICAgICAgICAgKD0gcHJlY2VkaW5nLWNo YXIgOTMpCisgICAgICAgICAgICAgICAgICA7OzsgKGNoYXItdG8tc3RyaW5nIDEyNSkgPT4gY2xv c2luZyB3YXZ5IGJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICg9IHByZWNlZGluZy1jaGFyIDEy NSkpCisgICAgICAgICAgICAgICAgKG1heCAocG9pbnQtbWluKSAoMS0gb3BvaW50KSkpCisgICAg ICAgICAgICAgKHQKKyAgICAgICAgICAgICAgICBvcG9pbnQpKSkKKyAgICAgICAgIHBvczIKKyAg ICAgICAgIHNlbGVjdGVkLWZhY2UpCisgICAgKHNhdmUtZXhjdXJzaW9uCisgICAgICAoY29uZGl0 aW9uLWNhc2UgbmlsCisgICAgICAgICh3aGlsZSAoc2V0cSBwb3MxIChudGggMSAocGFyc2UtcGFy dGlhbC1zZXhwIGZyb20gcG9zMSkpKQorICAgICAgICAgIChzZXRxIHBvczIgKHNjYW4tc2V4cHMg cG9zMSAxKSkKKyAgICAgICAgICAoaWYgKD0gaSAxMCkKKyAgICAgICAgICAgIChzZXRxIGkgMSkK KyAgICAgICAgICAgIChzZXRxIGkgKDErIGkpKSkKKyAgICAgICAgICAoc2V0cSBzZWxlY3RlZC1m YWNlIChjb25kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDEpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLW9uZS1mYWNlKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSAyKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICcrLXBhcmVucy10d28tZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKCg9IGkgMykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1w YXJlbnMtdGhyZWUtZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkg NCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtZm91ci1mYWNl KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA1KQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1maXZlLWZhY2UpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICgoPSBpIDYpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJystcGFyZW5zLXNpeC1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAoKD0gaSA3KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1z ZXZlbi1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA4KQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1laWdodC1mYWNlKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA5KQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICcrLXBhcmVucy1uaW5lLWZhY2UpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICgoPSBpIDEwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICcrLXBhcmVucy10ZW4tZmFjZSkpKQorICAgICAgICAgIChsZXQgKChvdiAobWFrZS1vdmVybGF5 IHBvczEgKDErIHBvczEpKSkpCisgICAgICAgICAgICAodW5sZXNzICstcGFyZW5zLWluYWN0aXZl LXdpbmRvd3MKKyAgICAgICAgICAgICAgKG92ZXJsYXktcHV0IG92ICd3aW5kb3cgd2luKSkKKyAg ICAgICAgICAgIChvdmVybGF5LXB1dCBvdiAnZmFjZSBzZWxlY3RlZC1mYWNlKSkKKyAgICAgICAg ICAod2hlbiBwb3MyCisgICAgICAgICAgICAobGV0ICgob3YgKG1ha2Utb3ZlcmxheSAoMS0gcG9z MikgcG9zMikpKQorICAgICAgICAgICAgICAodW5sZXNzICstcGFyZW5zLWluYWN0aXZlLXdpbmRv d3MKKyAgICAgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ3dpbmRvdyB3aW4pKQorICAgICAg ICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ2ZhY2Ugc2VsZWN0ZWQtZmFjZSkpKSkKKyAgICAgICAg KGVycm9yIG5pbCkpKQorICAgIChzZXRxICstcGFyZW5zLW92ZXJsYXlzLWV4aXN0LXAgdCkpKQor CisoZGVmdW4gKy1yZW1vdmUtb3ZlcmxheXMgKGJlZyBlbmQgbmFtZSB2YWwpCisiUmVtb3ZlIHRo ZSBvdmVybGF5cyB0aGF0IGFyZSBgZXF1YWwtaW5jbHVkaW5nLXByb3BlcnRpZXNgLgorSW5jbHVk ZXMgYSB1bmlxdWUgc2l0dWF0aW9uIHdoZW4gYW4gb3ZlcmxheSB3aXRoIGFuIGAnYWZ0ZXItc3Ry aW5nYCBwcm9wZXJ0eQoraXMgYXQgdGhlIHZlcnkgZW5kIG9mIGEgbmFycm93ZWQtYnVmZmVyLiIK KyAgKGxldCogKChwb2ludC1tYXggKHBvaW50LW1heCkpCisgICAgICAgICAocG9pbnQtbWluIChw b2ludC1taW4pKQorICAgICAgICAgKG5hcnJvd2VkLXAgKGJ1ZmZlci1uYXJyb3dlZC1wKSkKKyAg ICAgICAgIChiZWcgKGlmIGJlZyBiZWcgcG9pbnQtbWluKSkKKyAgICAgICAgIChlbmQKKyAgICAg ICAgICAgKGNvbmQKKyAgICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAobm90IG5h cnJvd2VkLXApCisgICAgICAgICAgICAgICAgIGVuZCkKKyAgICAgICAgICAgICAgIGVuZCkKKyAg ICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAobm90IG5hcnJvd2VkLXApCisgICAg ICAgICAgICAgICAgIChudWxsIGVuZCkpCisgICAgICAgICAgICAgICBwb2ludC1tYXgpCisgICAg ICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFycm93ZWQtcAorICAgICAgICAgICAg ICAgICBlbmQKKyAgICAgICAgICAgICAgICAgKDwgZW5kIHBvaW50LW1heCkpCisgICAgICAgICAg ICAgICBlbmQpCisgICAgICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFycm93ZWQt cAorICAgICAgICAgICAgICAgICBlbmQKKyAgICAgICAgICAgICAgICAgKD0gZW5kIHBvaW50LW1h eCkpCisgICAgICAgICAgICAgICAoMSsgZW5kKSkKKyAgICAgICAgICAgICAoKGFuZAorICAgICAg ICAgICAgICAgICBuYXJyb3dlZC1wCisgICAgICAgICAgICAgICAgIChudWxsIGVuZCkpCisgICAg ICAgICAgICAgICAoMSsgcG9pbnQtbWF4KSkgKSkKKyAgICAgICAgIChvdmVybGF5cworICAgICAg ICAgICAocHJvZ24KKyAgICAgICAgICAgICAob3ZlcmxheS1yZWNlbnRlciBlbmQpCisgICAgICAg ICAgICAgKG92ZXJsYXlzLWluIGJlZyBlbmQpKSkpCisgICAgKHdoZW4gKGFuZCBiZWcgZW5kIG5h bWUgdmFsKQorICAgICAgKGRvbGlzdCAobyBvdmVybGF5cykKKyAgICAgICAgKGNvbmQKKyAgICAg ICAgICAoKGFuZCAoZXEgbmFtZSAnZmFjZSkKKyAgICAgICAgICAgICAgICAoZXEgKG92ZXJsYXkt Z2V0IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIDs7IEVpdGhlciBwdXNoIHRoaXMgb3Zlcmxh eSBvdXRzaWRlIGJlZy4uLmVuZAorICAgICAgICAgICAgOzsgb3Igc3BsaXQgaXQgdG8gZXhjbHVk ZSBiZWcuLi5lbmQKKyAgICAgICAgICAgIDs7IG9yIGRlbGV0ZSBpdCBlbnRpcmVseSAoaWYgaXQg aXMgY29udGFpbmVkIGluIGJlZy4uLmVuZCkuCisgICAgICAgICAgICAoaWYgKDwgKG92ZXJsYXkt c3RhcnQgbykgYmVnKQorICAgICAgICAgICAgICAgIChpZiAoPiAob3ZlcmxheS1lbmQgbykgZW5k KQorICAgICAgICAgICAgICAocHJvZ24KKyAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IChj b3B5LW92ZXJsYXkgbykKKyAgICAgICAgICAgICAgICAgIChvdmVybGF5LXN0YXJ0IG8pIGJlZykK KyAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVuZCBvKSkpCisg ICAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gKG92ZXJsYXktc3RhcnQgbykgYmVnKSkK KyAgICAgICAgICAgICAgKGlmICg+IChvdmVybGF5LWVuZCBvKSBlbmQpCisgICAgICAgICAgICAg ICAgICAobW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVuZCBvKSkKKyAgICAgICAgICAgICAg ICAoZGVsZXRlLW92ZXJsYXkgbykpKSkKKyAgICAgICAgICAoKGFuZCAobm90IChlcSBuYW1lICdm YWNlKSkKKyAgICAgICAgICAgICAgICAoZXF1YWwtaW5jbHVkaW5nLXByb3BlcnRpZXMgKG92ZXJs YXktZ2V0IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIChkZWxldGUtb3ZlcmxheSB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SkKKworKGRlZnZhciBmYy10aW1lci12YXIgbmlsCisiVGltZXIgdXNl ZCB0byBoaWdobGlnaHQgY3VycmVudCBjb2x1bW4gd2hlbmV2ZXIgRW1hY3MgaXMgaWRsZS4iKQor Cis7OzsjIyNhdXRvbG9hZAorKGRlZmluZS1taW5vci1tb2RlIGZjLW1vZGUKKyJNaW5vciBtb2Rl IGZvciBkaXNwbGF5aW5nIGEgdmlzdWFsIGZpbGwgY29sdW1uLiIKKyAgOmluaXQtdmFsdWUgbmls CisgIDpsaWdodGVyICIgRkMiCisgIDprZXltYXAgbmlsCisgIDpnbG9iYWwgbmlsCisgIDpncm91 cCAnZmMtbW9kZQorICAoY29uZAorICAgIDs7OyBgKy1tb2RlJyBoYXMgdGhlIGFiaWxpdHkgdG8g YWxzbyBkaXNwbGF5IGEgZmlsbCBjb2x1bW4gaW5kaWNhdG9yLgorICAgIDs7OyBTZWUgdGhlIHZh cmlhYmxlIGArLWZpbGwtY29sdW1uJy4KKyAgICAoKGFuZCBmYy1tb2RlICstbW9kZSkKKyAgICAg IChzZXRxIGZjLW1vZGUgbmlsKQorICAgICAgKG1lc3NhZ2UgIlR1cm5lZCBPRkYgYGZjLW1vZGUn ICglcykgLS0gc2VlIHRoZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicuIiAoY3VycmVudC1idWZm ZXIpKSkKKyAgICAoZmMtbW9kZQorICAgICAgKHdoZW4gKGFuZCBnbG9iYWwtZWxkb2MtbW9kZQor ICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAg ICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAoZ2xvYmFs LWVsZG9jLW1vZGUgLTEpKQorICAgICAgKHdoZW4gKGFuZCBqaXQtbG9jay1jb250ZXh0LXRpbWVy CisgICAgICAgICAgICAgICAgIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAg ICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVu ICh0aW1lcnAgaml0LWxvY2stY29udGV4dC10aW1lcikKKyAgICAgICAgICAoY2FuY2VsLXRpbWVy IGppdC1sb2NrLWNvbnRleHQtdGltZXIpKQorICAgICAgICA7OyAoc2V0cSBqaXQtbG9jay1jb250 ZXh0LXRpbWVyIChydW4td2l0aC1pZGxlLXRpbWVyIDUuMCAncmVwZWF0ICdqaXQtbG9jay1jb250 ZXh0LWZvbnRpZnkpKQorICAgICAgICAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIG5pbCkp CisgICAgICAod2hlbiAoYW5kIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAg ICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVu ICh0aW1lcnAgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpCisgICAgICAgICAgKGNh bmNlbC10aW1lciB1bmRvLWF1dG8tY3VycmVudC1ib3VuZGFyeS10aW1lcikpCisgICAgICAgIChm c2V0ICd1bmRvLWF1dG8tLXVuZG9hYmxlLWNoYW5nZQorICAgICAgICAgICAgICAobGFtYmRhICgp IChhZGQtdG8tbGlzdCAndW5kby1hdXRvLS11bmRvYWJseS1jaGFuZ2VkLWJ1ZmZlcnMgKGN1cnJl bnQtYnVmZmVyKSkpKQorICAgICAgICAoZnNldCAndW5kby1hdXRvLWFtYWxnYW1hdGUgJ2lnbm9y ZSkpCisgICAgICAod2hlbiBibGluay1jdXJzb3ItbW9kZQorICAgICAgICAoYmxpbmstY3Vyc29y LW1vZGUgLTEpCisgICAgICAgICh3aGVuIChtZW1xICdibGluay1jdXJzb3ItY2hlY2sgcG9zdC1j b21tYW5kLWhvb2spCisgICAgICAgICAgKHJlbW92ZS1ob29rICdwb3N0LWNvbW1hbmQtaG9vayAn Y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1wb3N0LXp2LWZhY2UnLiIK KyAgOmdyb3VwICcrLW1vZGUpCisKKyhkZWZmYWNlICstcmV2ZXJzZWQtYmFyLXByZS16di1mYWNl CisgICcoKHQgKDpmb3JlZ3JvdW5kICJjeWFuMSIpKSkKKyAgIkZhY2UgZm9yIGArLXJldmVyc2Vk LWJhci1wcmUtenYtZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1yZXZl cnNlZC1iYXItYXQtenYtZmFjZQorICAnKCh0ICg6Zm9yZWdyb3VuZCAiY2hhcnRyZXVzZSIpKSkK KyAgIkZhY2UgZm9yIGArLXJldmVyc2VkLWJhci1hdC16di1mYWNlJy4iCisgIDpncm91cCAnKy1t b2RlKQorCisoZGVmZmFjZSArLXJldmVyc2VkLWJhci1wb3N0LXp2LWZhY2UKKyAgJygodCAoOmZv cmVncm91bmQgImN5YW40IikpKQorICAiRmFjZSBmb3IgYCstcmV2ZXJzZWQtYmFyLXBvc3QtenYt ZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1ldmVuLXByZS16di1mYWNl CisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBkYXJrKSkK KyAgICAgOmZvcmVncm91bmQgInllbGxvdyIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29s b3JzIDg4KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJjeWFuMSIpCisg ICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDE2KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAg ICAgOmZvcmVncm91bmQgInllbGxvdyIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3Jz IDE2KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJjeWFuMSIpCisgICAg KCgoY2xhc3MgY29sb3IpIChtaW4tY29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zIDg4 KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgIkRlZXBQaW5rMSIpCisgICAg KCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAg IDpmb3JlZ3JvdW5kICJEZWVwUGluazEiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9y cyAxNikgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJEZWVwUGluazEiKQor ICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQpKQor ICAgICA6Zm9yZWdyb3VuZCAiRGVlcFBpbmsxIikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1j b2xvcnMgOCkpCisgICAgIDpmb3JlZ3JvdW5kICJ3aGl0ZSIpCisgICAgKCgodHlwZSB0dHkpIChj bGFzcyBtb25vKSkKKyAgICAgOmludmVyc2UtdmlkZW8gdCkKKyAgICAodCA6Zm9yZWdyb3VuZCAi cGluayIpKQorICAiRmFjZSBmb3IgYCstZXZlbi1hdC16di1mYWNlJy4iCisgIDpncm91cCAnKy1t b2RlKQorCisoZGVmZmFjZSArLWV2ZW4taW5hY3RpdmUtYXQtenYtZmFjZQorICAnKCgoKGNsYXNz IGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3Jv dW5kICJEZWVwUGluazQiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJh Y2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3VuZCAiRGVlcFBpbms0IikKKyAgICAoKChj bGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgMTYpIChiYWNrZ3JvdW5kIGRhcmspKQorICAgICA6Zm9y ZWdyb3VuZCAiRGVlcFBpbms0IikKKyAgICAoKChjbGFzcy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obWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQp KQorICAgICA6Zm9yZWdyb3VuZCAiRGFya1NhbG1vbiIpCisgICAgKCgoY2xhc3MgY29sb3IpICht aW4tY29sb3JzIDgpKQorICAgICA6Zm9yZWdyb3VuZCAid2hpdGUiKQorICAgICgoKHR5cGUgdHR5 KSAoY2xhc3MgbW9ubykpCisgICAgIDppbnZlcnNlLXZpZGVvIHQpCisgICAgKHQgOmZvcmVncm91 bmQgInBpbmsiKSkKKyAgIkZhY2UgZm9yIGArLW9kZC1wb3N0LXp2LWZhY2UnLiIKKyAgOmdyb3Vw ICcrLW1vZGUpCisKKyhkZWZmYWNlICstb2RkLWluYWN0aXZlLXBvc3QtenYtZmFjZQorICAnKCgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpm b3JlZ3JvdW5kICJzaWVubmE0IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgODgp IChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTQiKQorICAgICgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpm b3JlZ3JvdW5kICJzaWVubmE0IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgMTYp IChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTQiKQorICAgICgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4KSkKKyAgICAgOmZvcmVncm91bmQgIndoaXRlIikK KyAgICAoKCh0eXBlIHR0eSkgKGNsYXNzIG1vbm8pKQorICAgICA6aW52ZXJzZS12aWRlbyB0KQor ICAgICh0IDpmb3JlZ3JvdW5kICJwaW5rIikpCisgICJGYWNlIGZvciBgKy1vZGQtaW5hY3RpdmUt cG9zd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ICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGln aHQpKQorICAgICA6Zm9yZWdyb3VuZCAiRGFya09saXZlR3JlZW4iKQorICAgICgoKGNsYXNzIGNv bG9yKSAobWluLWNvbG9ycyA4KSkKKyAgICAgOmZvcmVncm91bmQgIndoaXRlIikKKyAgICAoKCh0 eXBlIHR0eSkgKGNsYXNzIG1vbm8pKQorICAgICA6aW52ZXJzZS12aWRlbyB0KQorICAgICh0IDpm b3JlZ3JvdW5kICJwaW5rIikpCisgICJGYWNlIGZvciBgKy1wb3N0LWZpbGwtaW5hY3RpdmUtcG9z dC16di1mYWNlJy4iCisgIDpncm91cCAnKy1tb2RlKQorCisoZGVmZmFjZSBmYy1wcmUtenYtZmFj ZQorICAnKCgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykp CisgICAgIDpmb3JlZ3JvdW5kICJncmV5MTUiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNv bG9ycyA4OCkgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3VuZCAiZ3JleTE1IikK KyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgMTYpIChiYWNrZ3JvdW5kIGRhcmspKQor ICAgICA6Zm9yZWdyb3VuZCAiZ3JleTE1IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xv cnMgMTYpIChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgImdyZXkxNSIpCisg ICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDgpKQorICAgICA6Zm9yZWdyb3VuZCAid2hp dGUiKQorICAgICgoKHR5cGUgdHR5KSAoY2xhc3MgbW9ubykpCisgICAgIDppbnZlcnNlLXZpZGVv IHQpCisgICAgKHQgOmZvcmVncm91bmQgInBpbmsiKSkKKyAgIkZhY2UgZm9y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lciAqYiwgTGlzcF9PYmplY3QgdmFsKQoreworICBiLT5tY19pbmFjdGl2ZV93aW5kb3dzXyA9 IHZhbDsKK30KKworc3RhdGljIHZvaWQKK2JzZXRfY3Jvc3NoYWlycyAoc3RydWN0IGJ1ZmZlciAq YiwgTGlzcF9PYmplY3QgdmFsKQoreworICBiLT5jcm9zc2hhaXJzXyA9IHZhbDsKK30KKworc3Rh dGljIHZvaWQKK2JzZXRfY2hfaG9yaXpvbnRhbF9ydWxlciAoc3RydWN0IGJ1ZmZlciAqYiwgTGlz cF9PYmplY3QgdmFsKQoreworICBiLT5jaF9ob3Jpem9udGFsX3J1bGVyXyA9IHZhbDsKK30KKwor c3RhdGljIHZvaWQKK2JzZXRfY2hfdmVydGljYWxfcnVsZXIgKHN0cnVjdCBidWZmZXIgKmIsIExp c3BfT2JqZWN0IHZhbCkKK3sKKyAgYi0+Y2hfdmVydGljYWxfcnVsZXJfID0gdmFsOworfQorCitz dGF0aWMgdm9pZAorYnNldF9jaF9pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBM aXNwX09iamVjdCB2YWwpCit7CisgIGItPmNoX2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQor CitzdGF0aWMgdm9pZAorYnNldF9mY192aXNpYmxlIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09i amVjdCB2YWwpCit7CisgIGItPmZjX3Zpc2libGVfID0gdmFsOworfQorCitzdGF0aWMgdm9pZAor YnNldF9mY19pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2 YWwpCit7CisgIGItPmZjX2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQorCisvKiBlbmQgTVVM VElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogc3RhdGljIHZv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gIGJzZXRfbWNfaW5h Y3RpdmVfd2luZG93cyAoJmJ1ZmZlcl9kZWZhdWx0cywgUXQpOworICBic2V0X2Nyb3NzaGFpcnMg KCZidWZmZXJfZGVmYXVsdHMsIFFuaWwpOworICBic2V0X2NoX2hvcml6b250YWxfcnVsZXIgKCZi dWZmZXJfZGVmYXVsdHMsIFF0KTsKKyAgYnNldF9jaF92ZXJ0aWNhbF9ydWxlciAoJmJ1ZmZlcl9k ZWZhdWx0cywgUXQpOworICBic2V0X2NoX2luYWN0aXZlX3dpbmRvd3MgKCZidWZmZXJfZGVmYXVs dHMsIFF0KTsKKyAgYnNldF9mY192aXNpYmxlICgmYnVmZmVyX2RlZmF1bHRzLCBRbmlsKTsKKyAg YnNldF9mY19pbmFjdGl2ZV93aW5kb3dzICgmYnVmZmVyX2RlZmF1bHRzLCBRdCk7CisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICAgYnNldF9tb2RlX2xpbmVfZm9ybWF0ICgmYnVmZmVy X2RlZmF1bHRzLCBidWlsZF9wdXJlX2Nfc3RyaW5nICgiJS0iKSk7CiAgIGJzZXRfaGVhZGVyX2xp bmVfZm9ybWF0ICgmYnVmZmVyX2RlZmF1bHRzLCBRbmlsKTsKICAgYnNldF9hYmJyZXZfbW9kZSAo JmJ1ZmZlcl9kZWZhdWx0cywgUW5pbCk7CkBAIC01NDYxLDYgKzU1NjAsNTEgQEAgZGVmdmFyX3Bl cl9idWZmZXIgKHN0cnVjdCBMaXNwX0J1ZmZlcl9PYmpmd2QgKmJvX2Z3ZCwgY29uc3QgY2hhciAq bmFtZXN0cmluZywKIHZvaWQKIHN5bXNfb2ZfYnVmZmVyICh2b2lkKQogeworCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMV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BidWZmZXIuICAqLwogICBM aXNwX09iamVjdCBleHRyYV9saW5lX3NwYWNpbmdfOwogCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8qIFRoZSBjdXJzb3IgdHlwZSBvZiB0 aGUgcmVhbCBmYWtlIGN1cnNvci4gKi8KKyAgTGlzcF9PYmplY3QgbWNfcmVhbF9mYWtlX2N1cnNv cl87CisKKyAgLyogVGhlIG5hbWUgb2YgbGlzdCB1c2VkIGJ5IG11bHRpcGxlIGN1cnNvcnMgZm9y IG5leHQgcmVkaXNwbGF5LiAqLworICBMaXNwX09iamVjdCBtY19jb25mXzsKKworICAvKiBXaGV0 aGVyIHRvIGRyYXcgbXVsdGlwbGUgY3Vyc29ycyBpbiBpbmFjdGl2ZSB3aW5kb3dzLiAqLworICBM aXNwX09iamVjdCBtY19pbmFjdGl2ZV93aW5kb3dzXzsKKworICAvKiBUaGUgbmFtZSBvZiB0aGUg YnVmZmVyLWxvY2FsIHZhcmlhYmxlLiAqLworICBMaXNwX09iamVjdCBjcm9zc2hhaXJzXzsKKwor ICAvKiBUaGUgbmFtZSBvZiB0aGUgY3Jvc3NoYWlycyBob3Jpem9udGFsIHJ1bGVyLiAqLworICBM aXNwX09iamVjdCBjaF9ob3Jpem9udGFsX3J1bGVyXzsKKworICAvKiBUaGUgbmFtZSBvZiB0aGUg Y3Jvc3NoYWlycyB2ZXJ0aWNhbCBydWxlci4gKi8KKyAgTGlzcF9PYmplY3QgY2hfdmVydGljYWxf cnVsZXJfOworCisgIC8qIFdoZXRoZXIgdG8gZHJhdyBjcm9zc2hhaXJzIGluIGluYWN0aXZlIHdp bmRvd3MuICovCisgIExpc3BfT2JqZWN0IGNoX2luYWN0aXZlX3dpbmRvd3NfOworCisgIC8qIFRo ZSBuYW1lIG9mIHRoZSBidWZmZXItbG9jYWwgdmFyaWFibGUuICovCisgIExpc3BfT2JqZWN0IGZj X3Zpc2libGVfOworCisgIC8qIFdoZXRoZXIgdG8gZHJhdyBtdWx0aXBsZSBjdXJzb3JzIGZpbGwg Y29sdW1uIGluIGluYWN0aXZlIHdpbmRvd3MuICovCisgIExpc3BfT2JqZWN0IGZjX2luYWN0aXZl X3dpbmRvd3NfOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIEN1cnNvciB0 eXBlIHRvIGRpc3BsYXkgaW4gbm9uLXNlbGVjdGVkIHdpbmRvd3MuCiAgICAgIHQgbWVhbnMgdG8g dXNlIGhvbGxvdyBib3ggY3Vyc29yLgogICAgICBTZWUgYGN1cnNvci10eXBlJyBmb3Igb3RoZXIg dmFsdWVzLiAgKi8KQEAgLTc5MSwxNCArODI1LDIxIEBAIHN0cnVjdCBidWZmZXIKICAgICAgYW4g aW5kaXJlY3QgYnVmZmVyIHNpbmNlIGl0IGNvdW50cyBhcyBpdHMgYmFzZSBidWZmZXIuICAqLwog ICBpbnQgd2luZG93X2NvdW50OwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCiAgIC8qIEEgbm9uLXplcm8gdmFsdWUgaW4gc2xvdCBJRFggbWVh bnMgdGhhdCBwZXItYnVmZmVyIHZhcmlhYmxlCiAgICAgIHdpdGggaW5kZXggSURYIGhhcyBhIGxv Y2FsIHZhbHVlIGluIHRoaXMgYnVmZmVyLiAgVGhlIGluZGV4IElEWAogICAgICBmb3IgYSBidWZm ZXItbG9jYWwgdmFyaWFibGUgaXMgc3RvcmVkIGluIHRoYXQgdmFyaWFibGUncyBzbG90CiAgICAg IGluIGJ1ZmZlcl9sb2NhbF9mbGFncyBhcyBhIExpc3AgaW50ZWdlci4gIElmIHRoZSBpbmRleCBp cyAtMSwKICAgICAgdGhpcyBtZWFucyB0aGUgdmFyaWFibGUgaXMgYWx3YXlzIGxvY2FsIGluIGFs bCBidWZmZXJzLiAgKi8KLSNkZWZpbmUgTUFYX1BFUl9CVUZGRVJfVkFSUyA1MAorI2RlZmluZSBN QVhfUEVSX0JVRkZFUl9WQVJTIDYwCiAgIGNoYXIgbG9jYWxfZmxhZ3NbTUFYX1BFUl9CVUZGRVJf VkFSU107CiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogU2V0IHRvIHRoZSBt b2R0aW1lIG9mIHRoZSB2aXNpdGVkIGZpbGUgd2hlbiByZWFkIG9yIHdyaXR0ZW4uCiAgICAgIG1v ZHRpbWUudHZfbnNlYyA9PSBOT05FWElTVEVOVF9NT0RUSU1FX05TRUNTIG1lYW5zCiAgICAgIHZp c2l0ZWQgZmlsZSB3YXMgbm9uZXhpc3RlbnQuICBtb2R0aW1lLnR2X25zZWMgPT0KQEAgLTkwNyw2 ICs5NDgsNjkgQEAgWEJVRkZFUiAoTGlzcF9PYmplY3QgYSkKIC8qIE1vc3QgY29kZSBzaG91bGQg dXNlIHRoZXNlIGZ1bmN0aW9ucyB0byBzZXQgTGlzcCBmaWVsZHMgaW4gc3RydWN0CiAgICBidWZm ZXIuICAoU29tZSBzZXR0ZXJzIHRoYXQgYXJlIHByaXZhdGUgdG8gYSBzaW5nbGUgLmMgZmlsZSBh cmUKICAgIGRlZmluZWQgYXMgc3RhdGljIGluIHRob3NlIGZpbGVzLikgICovCisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKK0lOTElO RSB2b2lkCitic2V0X2J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1Y3QgYnVmZmVyICpiLCBMaXNwX09i amVjdCB2YWwpCit7CisgIGItPmZjX3Zpc2libGVfID0gdmFsOworfQorCitJTkxJTkUgdm9pZAor YnNldF9ibHZfZmNfaW5hY3RpdmVfd2luZG93cyAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmpl Y3QgdmFsKQoreworICBiLT5mY19pbmFjdGl2ZV93aW5kb3dzXyA9IHZhbDsKK30KKworLyogZW5k IE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIElOTElO RSB2b2lkCiBic2V0X2JpZGlfcGFyYWdyYXBoX2RpcmVjdGlvbiAoc3RydWN0IGJ1ZmZlciAqYiwg TGlzcF9PYmplY3QgdmFsKQogewpkaWZmIC0tZ2l0IGEvc3JjL2Rpc3BleHRlcm4uaCBiL3NyYy9k aXNwZXh0ZXJuLmgKaW5kZXggNGU5NDdkYS4uODZhZGVhMyAxMDA2NDQKLS0tIGEvc3JjL2Rpc3Bl eHRlcm4uaAorKysgYi9zcmMvZGlzcGV4dGVybi5oCkBAIC0xNDUsNiArMTQ1LDEzMSBAQCB0eXBl ZGVmIHZvaWQgKkVtYWNzX0N1cnNvcjsKICNkZWZpbmUgTmF0aXZlUmVjdGFuZ2xlIGludAogI2Vu ZGlmCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJT T1JTICovCisKK2V4dGVybiBib29sIG1jX3N0ZGVycl9wIEVYVEVSTkFMTFlfVklTSUJMRTsKKwor c3RydWN0IGdseXBoOworCitzdHJ1Y3QgZ2x5cGhfcm93OworCitzdHJ1Y3QgZ2x5cGhfbWF0cml4 OworCitlbnVtIGRyYXdfZ2x5cGhzX2ZhY2U7CisKK2VudW0gZ2x5cGhfcm93X2FyZWE7CisKK3N0 cnVjdCBtY19tYXRyaXg7CisKK2VudW0gbWNfY2FjaGVfdHlwZTsKKworZW51bSBtY19jdXJzb3Jf dHlwZTsKKworZW51bSBtY19mbGF2b3I7CisKK3N0cnVjdCBtY19SR0I7CisKK3N0cnVjdCBtY19l c3NlbnRpYWxzOworCitlbnVtIG1jX2RyYXdfcm93X3R5cGU7CisKK2VudW0gbWNfZW5naW5lX3R5 cGU7CisKK2VudW0gbWNfcm93X3Bvc2l0aW9uOworCitlbnVtIG1jX3JlZHJhd19yb3dfdHlwZTsK KworZW51bSBkcmF3X2dseXBoX2FjdGlvbjsKKworZXh0ZXJuIExpc3BfT2JqZWN0IG1jX2xpc3Ru IChwdHJkaWZmX3QsIExpc3BfT2JqZWN0LCAuLi4pOworCitleHRlcm4gTGlzcF9PYmplY3QgbWNf bnRoIChpbnQsIExpc3BfT2JqZWN0KTsKKworZXh0ZXJuIExpc3BfT2JqZWN0IG1jX2Fzc3EgKExp c3BfT2JqZWN0LCBMaXNwX09iamVjdCk7CisKK2V4dGVybiBlbnVtIG1jX3Jvd19wb3NpdGlvbiBt Y19yb3dfcG9zaXRpb24gKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3Jv dyAqLCBpbnQpOworCitleHRlcm4gcHRyZGlmZl90IG1jX3JlZ2lvbl9saW1pdCAoYm9vbCk7CisK K2V4dGVybiBzdHJ1Y3QgZ2x5cGggKiBtY19nZXRfY3Vyc29yX2dseXBoIChzdHJ1Y3Qgd2luZG93 ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICosIGludCwgaW50KTsKKworZXh0ZXJuIHZv aWQgbWNf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iamVjdCwgaW50LCBpbnQpOworCitl eHRlcm4gdm9pZCBtY19lbmdpbmUgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJp eCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBn bHlwaCAqLCBpbnQsIGludCwgaW50LCBpbnQsIGludCwgaW50LAorICAgICAgICAgICAgICAgICAg ICAgICBlbnVtIG1jX2N1cnNvcl90eXBlLCBpbnQsIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwKKyAg ICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX2Vzc2VudGlhbHMsIGVudW0gbWNfcm93X3Bv c2l0aW9uLCBzdHJ1Y3QgbWNfUkdCLAorICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2Vu Z2luZV90eXBlLCBib29sLCBlbnVtIG1jX2RyYXdfcm93X3R5cGUsCisgICAgICAgICAgICAgICAg ICAgICAgIGVudW0gbWNfY2FjaGVfdHlwZSk7CisKK2V4dGVybiB2b2lkIG1jX3NldF9lc3NlbnRp YWxzIChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBtY19lc3NlbnRpYWxzICopOworCitleHRlcm4g dm9pZCBtY19kcmF3X3JvdyAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICos IHN0cnVjdCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5 cGggKiwgaW50LCBpbnQsIGludCwgc3RydWN0IGdseXBoX21hdHJpeCAqLAorICAgICAgICAgICAg ICAgICAgICAgICAgIHN0cnVjdCBtY19lc3NlbnRpYWxzLCBlbnVtIG1jX3Jvd19wb3NpdGlvbiwg Ym9vbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2RyYXdfcm93X3R5cGUpOwor CitleHRlcm4gYm9vbCBtY19yZWRyYXdfcm93IChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlw aF9tYXRyaXggKiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgZW51bSBnbHlwaF9yb3dfYXJlYSwgaW50LCBpbnQsIGludCwgYm9vbCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSwgZW51bSBtY19yZWRyYXdfcm93 X3R5cGUpOworCitleHRlcm4gdm9pZCBtY19yZXNldF9jYWNoZSAoc3RydWN0IHdpbmRvdyAqKTsK KworZXh0ZXJuIHZvaWQgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHN0cnVjdCB3aW5kb3cgKiwgc3Ry dWN0IGdseXBoX21hdHJpeCAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0 cnVjdCBnbHlwaF9yb3cgKiwgZW51bSBkcmF3X2dseXBoc19mYWNlLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGludCwgaW50LCBpbnQsIHN0cnVjdCBtY19SR0IsIGVudW0gbWNf Zmxhdm9yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29y X3R5cGUsIGludCwgYm9vbCwgYm9vbCk7CisKK2V4dGVybiB2b2lkIG1jX2VyYXNlX2N1cnNvciAo c3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlwaF9yb3cg KiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBpbnQsIGludCwgaW50LCBlbnVt IG1jX2ZsYXZvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3Jf dHlwZSwgaW50KTsKKworZXh0ZXJuIHZvaWQgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHN0cnVjdCB3 aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBpbnQsIGludCwgaW50LCBpbnQsIGlu dCwgaW50LCBpbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19j dXJzb3JfdHlwZSwgaW50LCBzdHJ1Y3QgbWNfUkdCLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGJvb2wsIGVudW0gbWNfZmxhdm9yLCBib29sKTsKKworZXh0ZXJuIGludCBtY19k cmF3X2dseXBocyAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVj dCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCwgZW51bSBnbHlw aF9yb3dfYXJlYSwgcHRyZGlmZl90LCBwdHJkaWZmX3QsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UsIGludCwgaW50LCBzdHJ1Y3QgbWNfUkdCLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19mbGF2b3IsIGVudW0gbWNfY3Vyc29yX3R5 cGUsIGludCwgYm9vbCwgYm9vbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gZHJh d19nbHlwaF9hY3Rpb24sIGJvb2wpOworCitleHRlcm4gc3RydWN0IGdseXBoX21hdHJpeCAqIG1j X3NhdmVfZ2x5cGhfbWF0cml4IChzdHJ1Y3QgZ2x5cGhfbWF0cml4ICopOworCitleHRlcm4gdm9p ZCBtY19yZXN0b3JlX2dseXBoX21hdHJpeCAoc3RydWN0IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3Qg Z2x5cGhfbWF0cml4ICopOworCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogLyogVGV4dCBjdXJzb3IgdHlwZXMuICAqLwogCiBlbnVtIHRl eHRfY3Vyc29yX2tpbmRzCkBAIC00MDQsNiArNTI5LDE4IEBAIHN0cnVjdCBnbHlwaF9zbGljZQog CiBzdHJ1Y3QgZ2x5cGgKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJ UExFLUNVUlNPUlMgKi8KKworICBpbnQgcmVsYXRpdmVfeCwgaHBvczsKKworICBwdHJkaWZmX3Qg Ynl0ZXBvczsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBQb3NpdGlvbiBm cm9tIHdoaWNoIHRoaXMgZ2x5cGggd2FzIGRyYXduLiAgSWYgYG9iamVjdCcgYmVsb3cgaXMgYQog ICAgICBMaXNwIHN0cmluZywgdGhpcyBpcyBhbiBpbmRleCBpbnRvIHRoYXQgc3RyaW5nLiAgSWYg aXQgaXMgYQogICAgICBidWZmZXIsIHRoaXMgaXMgYSBwb3NpdGlvbiBpbiB0aGF0IGJ1ZmZlci4g IEluIGFkZGl0aW9uLCBzb21lCkBAIC0xMjcwLDYgKzE0MDcsMjggQEAgZW51bSBkcmF3X2dseXBo c19mYWNlCiAKIHN0cnVjdCBnbHlwaF9zdHJpbmcKIHsKKworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIGJvb2xfYmYgbGVmdF9vdmVyd3Jp dHRlbl9wIDogMTsKKworICAgIGJvb2xfYmYgcmlnaHRfb3ZlcndyaXR0ZW5fcCA6IDE7CisKKyAg ICBib29sX2JmIHJlY3RhbmdsZV9udWtlZF9wIDogMTsKKworICAgIGJvb2xfYmYgYmFja2dyb3Vu ZF9udWtlZF9wIDogMTsKKworICAgIGVudW0gZHJhd19nbHlwaF9hY3Rpb24KKyAgICB7CisgICAg ICBNQ19EUkFXX0dMWVBIX1NUUklORywKKyAgICAgIE1DX0VSQVNFX0dMWVBIX1NUUklORworICAg IH0gYWN0aW9uX3R5cGU7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogWC1v cmlnaW4gb2YgdGhlIHN0cmluZy4gICovCiAgIGludCB4OwogCkBAIC0yODM0LDYgKzI5OTMsMjgg QEAgdHlwZWRlZiB2b2lkICgqZnJhbWVfcGFybV9oYW5kbGVyKSAoc3RydWN0IGZyYW1lICosIExp c3BfT2JqZWN0LCBMaXNwX09iamVjdCk7CiAKIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlCiB7 CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK Ky8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgbnN0ZXJtLm1gIHwgYHczMnRlcm0uY2AgfCBg eHRlcm0uY2AgbXVzdCBiZSBpbiB0aGUKK2V4YWN0IHNhbWUgb3JkZXIgYXMgdGhlIGByZWRpc3Bs YXlfaW50ZXJmYWNlJyBpbiBgZGlzcGV4dGVybi5oYCEgKi8KKworICAvKiBgbWNfbnNfZHJhd193 aW5kb3dfY3Vyc29yJyB8IGBtY193MzJfZHJhd193aW5kb3dfY3Vyc29yJyB8IGBtY194X2RyYXdf d2luZG93X2N1cnNvcicgKi8KKyAgdm9pZCAoKm1jX3NjcmliZV9jdXJzb3IpIChzdHJ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K2kpCisgICAgeworICAgICAgc3RydWN0IGdseXBoX3JvdyAqZnJvbSA9IHNh dmVkLT5yb3dzICsgaTsKKyAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnRvID0gbWF0cml4LT5yb3dz ICsgaTsKKyAgICAgIHB0cmRpZmZfdCBuYnl0ZXMgPSBmcm9tLT51c2VkW1RFWFRfQVJFQV0gKiBz aXplb2YgKHN0cnVjdCBnbHlwaCk7CisgICAgICBtZW1jcHkgKHRvLT5nbHlwaHNbVEVYVF9BUkVB XSwgZnJvbS0+Z2x5cGhzW1RFWFRfQVJFQV0sIG5ieXRlcyk7CisgICAgICB0by0+dXNlZFtURVhU X0FSRUFdID0gZnJvbS0+dXNlZFtURVhUX0FSRUFdOworICAgICAgdG8tPmhhc2ggPSBmcm9tLT5o YXNoOworICAgICAgdG8tPnggPSBmcm9tLT54OworICAgICAgdG8tPnkgPSBmcm9tLT55OworICAg ICAgdG8tPnBpeGVsX3dpZHRoID0gZnJvbS0+cGl4ZWxfd2lkdGg7CisgICAgICB0by0+YXNjZW50 ID0gZnJvbS0+YXNjZW50OworICAgICAgdG8tPmhlaWdodCA9IGZyb20tPmhlaWdodDsKKyAgICAg IHRvLT5waHlzX2FzY2VudCA9IGZyb20tPnBoeXNfYXNjZW50OworICAgICAgdG8tPnBoeXNfaGVp Z2h0ID0gZnJvbS0+cGh5c19oZWlnaHQ7CisgICAgICB0by0+dmlzaWJsZV9oZWlnaHQgPSBmcm9t LT52aXNpYmxlX2hlaWdodDsKKyAgICAgIHRvLT5leHRyYV9saW5lX3NwYWNpbmcgPSBmcm9tLT5l eHRyYV9saW5lX3NwYWNpbmc7CisgICAgICB0by0+c3RhcnQgPSBmcm9tLT5zdGFydDsKKyAgICAg IHRvLT5lbmQgPSBmcm9tLT5lbmQ7CisgICAgICB0by0+bWlucG9zID0gZnJvbS0+bWlucG9zOwor ICAgICAgdG8tPm1heHBvcyA9IGZyb20tPm1heHBvczsKKyAgICAgIHRvLT5vdmVybGF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4ICpjdXJyZW50X21hdHJpeCA9IHctPmN1cnJl bnRfbWF0cml4OworICBpbnQgeWIgPSB3aW5kb3dfdGV4dF9ib3R0b21feSAodyk7CisgIHB0cmRp ZmZfdCBpOworICBpbnQgaiwgZmlyc3Rfb2xkLCBmaXJzdF9uZXcsIGxhc3Rfb2xkLCBsYXN0X25l dzsKKyAgaW50IG5ydW5zLCBydW5faWR4OworICBwdHJkaWZmX3QgbjsKKyAgc3RydWN0IG1jX3Jv d19lbnRyeSAqZW50cnk7CisgIC8vIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlICpyaWYgPSBG UkFNRV9SSUYgKFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSkpOworICAvKiBTa2lwIG92ZXIgcm93 cyBlcXVhbCBhdCB0aGUgc3RhcnQuICovCisgIGZvciAoaSA9IGhlYWRlcl9saW5lX3A7IGkgPCBj dXJyZW50X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAgeworICAgICAgc3RydWN0IGdseXBo X3JvdyAqZCA9IE1BVFJJWF9ST1cgKGRlc2lyZWRfbWF0cml4LCBpKTsKKyAgICAgIHN0cnVjdCBn bHlwaF9yb3cgKmMgPSBNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSk7CisgICAgICBpZiAo Yy0+ZW5hYmxlZF9wCisgICAgICAgICAgJiYgZC0+ZW5hYmxlZF9wCisgICAgICAgICAgJiYgIWQt PnJlZHJhd19mcmluZ2VfYml0bWFwc19wCisgICAgICAgICAgJiYgYy0+eSA9PSBkLT55CisgICAg ICAgICAgJiYgTUFUUklYX1JPV19CT1RUT01fWSAoYykgPD0geWIKKyAgICAgICAgICAmJiBNQVRS SVhfUk9XX0JPVFRPTV9ZIChkKSA8PSB5YgorICAgICAgICAgICYmIHJvd19lcXVhbF9wIChjLCBk LCAxKSkKKyAgICAgICAgeworICAgICAgICAgIGFzc2lnbl9yb3cgKGMsIGQpOworICAgICAgICAg IGQtPmVuYWJsZWRfc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QorICAgICAgICBi cmVhazsKKyAgICB9CisgIGxhc3RfbmV3ID0gaTsKKyAgLyogU2V0IGxhc3Rfb2xkIHRvIHRoZSBp bmRleCArIDEgb2YgdGhlIHJvdyB0aGF0IHJlYWNoZXMgdGhlIGJvdHRvbQorICAgICBib3VuZGFy eSBpbiB0aGUgY3VycmVudCBtYXRyaXguICBXZSBkb24ndCBsb29rIGF0IHRoZSBlbmFibGVkCisg ICAgIGZsYWcgaGVyZSBiZWNhdXNlIHdlIHBsYW4gdG8gcmV1c2UgcGFydCBvZiB0aGUgZGlzcGxh eSBldmVuIGlmCisgICAgIG90aGVyIHBhcnRzIGFyZSBkaXNhYmxlZC4gKi8KKyAgaSA9IGZpcnN0 X29sZCArIDE7CisgIHdoaWxlIChpIDwgY3VycmVudF9tYXRyaXgtPm5yb3dzIC0gMSkKKyAgICB7 CisgICAgICBpbnQgYm90dG9tID0gTUFUUklYX1JPV19CT1RUT01fWSAoTUFUUklYX1JPVyAoY3Vy cmVudF9tYXRyaXgsIGkpKTsKKyAgICAgIGlmIChib3R0b20gPD0geWIpCisgICAgICAgICsraTsK KyAgICAgIGlmIChib3R0b20gPj0geWIpCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgbGFzdF9v bGQgPSBpOworICAvKiBTa2lwIG92ZXIgcm93cyBlcXVhbCBhdCB0aGUgYm90dG9tLiAqLworICBp ID0gbGFzdF9uZXc7CisgIGogPSBsYXN0X29sZDsKKyAgd2hpbGUgKGkgLSAxID4gZmlyc3RfbmV3 CisgICAgICAgICAmJiBqIC0gMSA+IGZpcnN0X29sZAorICAgICAgICAgJiYgTUFUUklYX1JPV19F TkFCTEVEX1AgKGN1cnJlbnRfbWF0cml4LCBqIC0gMSkKKyAgICAgICAgICYmIChNQVRSSVhfUk9X IChjdXJyZW50X21hdHJpeCwgaiAtIDEpLT55CisgICAgICAgICAgICAgPT0gTUFUUklYX1JPVyAo ZGVzaXJlZF9tYXRyaXgsIGkgLSAxKS0+eSkKKyAgICA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ByaW1lICgx MTMpIHdvdWxkIGJlIDEyNy4gKi8KKyAgeworICAgIHZlcmlmeSAoTkVYVF9BTE1PU1RfUFJJTUVf TElNSVQgPT0gMTEpOworICAgIGVudW0geyBuZXh0X2FsbW9zdF9wcmltZV9pbmNyZW1lbnRfbWF4 ID0gMTAgfTsKKyAgICBwdHJkaWZmX3Qgcm93X3RhYmxlX21heCA9CisgICAgICAobWluIChQVFJE SUZGX01BWCwgU0laRV9NQVgpIC8gKDMgKiBzaXplb2YgKm1jX3Jvd190YWJsZSkKKyAgICAgICAt IG5leHRfYWxtb3N0X3ByaW1lX2luY3JlbWVudF9tYXgpOworICAgIHB0cmRpZmZfdCBjdXJyZW50 X25yb3dzX21heCA9IHJvd190YWJsZV9tYXggLSBkZXNpcmVkX21hdHJpeC0+bnJvd3M7CisgICAg aWYgKGN1cnJlbnRfbnJvd3NfbWF4IDwgY3VycmVudF9tYXRyaXgtPm5yb3dzKQorICAgICAgbWVt b3J5X2Z1bGwgKFNJWkVfTUFYKTsKKyAgfQorICAvKiBSZWFsbG9jYXRlIHZlY3RvcnMsIHRhYmxl cyBldGMuIGlmIG5lY2Vzc2FyeS4gKi8KKyAgaWYgKGN1cnJlbnRfbWF0cml4LT5ucm93cyA+IG1j X29sZF9saW5lc19zaXplKQorICAgIG1jX29sZF9saW5lcyA9IHhwYWxsb2MgKG1jX29sZF9saW5l cywgJm1jX29sZF9saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRf bWF0cml4LT5ucm93cyAtIG1jX29sZF9saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAg ICAgIElOVF9NQVgsIHNpemVvZiAqbWNfb2xkX2xpbmVzKTsKKyAgaWYgKGRlc2lyZWRfbWF0cml4 LT5ucm93cyA+IG1jX25ld19saW5lc19zaXplKQorICAgIG1jX25ld19saW5lcyA9IHhwYWxsb2Mg KG1jX25ld19saW5lcywgJm1jX25ld19saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAg ICAgIGRlc2lyZWRfbWF0cml4LT5ucm93cyAtIG1jX25ld19saW5lc19zaXplLAorICAgICAgICAg ICAgICAgICAgICAgICAgIElOVF9NQVgsIHNpemVvZiAqbWNfbmV3X2xpbmVzKTsKKyAgbiA9IGRl c2lyZWRfbWF0cml4LT5ucm93czsKKyAgbiArPSBjdXJyZW50X21hdHJpeC0+bnJvd3M7CisgIGlm IChtY19yb3dfdGFibGVfc2l6ZSA8IDMgKiBuKQorICAgIHsKKyAgICAgIHB0cmRpZmZfdCBzaXpl ID0gbmV4dF9hbG1vc3RfcHJpbWUgKDMgKiBuKTsKKyAgICAgIG1jX3Jvd190YWJsZSA9IHhucmVh bGxvYyAobWNfcm93X3RhYmxlLCBzaXplLCBzaXplb2YgKm1jX3Jvd190YWJsZSk7CisgICAgICBt Y19yb3dfdGFibGVfc2l6ZSA9IHNpemU7CisgICAgICBtZW1zZXQgKG1jX3Jvd190YWJsZSwgMCwg c2l6ZSAqIHNpemVvZiAqbWNfcm93X3RhYmxlKTsKKyAgICB9CisgIGlmIChuID4gbWNfcm93X2Vu dHJ5X3Bvb2xfc2l6ZSkKKyAgICBtY19yb3dfZW50cnlfcG9vbCA9IHhwYWxsb2MgKG1jX3Jvd19l bnRyeV9wb29sLCAmbWNfcm93X2VudHJ5X3Bvb2xfc2l6ZSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIG4gLSBtY19yb3dfZW50cnlfcG9vbF9zaXplLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgLTEsIHNpemVvZiAqbWNfcm93X2VudHJ5X3Bvb2wpOworICBpZiAoZGVzaXJl ZF9tYXRyaXgtPm5yb3dzID4gbWNfcnVuc19zaXplKQorICAgIHsKKyAgICAgIG1jX3J1bnMgPSB4 bnJlYWxsb2MgKG1jX3J1bnMsIGRlc2lyZWRfbWF0cml4LT5ucm93cywgc2l6ZW9mICptY19ydW5z KTsKKyAgICAgIG1jX3J1bl9wb29sID0geG5yZWFsbG9jIChtY19ydW5fcG9vbCwgZGVzaXJlZF9t YXRyaXgtPm5yb3dzLCBzaXplb2YgKm1jX3J1bl9wb29sKTsKKyAgICAgIG1jX3J1bnNfc2l6ZSA9 IGRlc2lyZWRfbWF0cml4LT5ucm93czsKKyAgICB9CisgIG5ydW5zID0gcnVuX2lkeCA9IDA7Cisg IG1jX3Jvd19lbnRyeV9pZHggPSAwOworICAvKiBBZGQgcm93cyBmcm9tIHRoZSBjdXJyZW50IGFu ZCBkZXNpcmVkIG1hdHJpeCB0byB0aGUgaGFzaCB0YWJsZQorICAgICByb3dfaGFzaF90YWJsZSB0 byBiZSBhYmxlIHRvIGZpbmQgZXF1YWwgb25lcyBxdWlja2x5LiAqLworICBmb3IgKGkgPSBmaXJz dF9vbGQ7IGkgPCBsYXN0X29sZDsgKytpKQorICAgIHsKKyAgICAgIGlmIChNQVRSSVhfUk9XX0VO QUJMRURfUCAoY3VycmVudF9tYXRyaXgsIGkpKQorICAgICAgICB7CisgICAgICAgICAgZW50cnkg PSBtY19hZGRfcm93X2VudHJ5IChNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSkpOworICAg ICAgICAgIG1jX29sZF9saW5lc1tpXSA9IGVudHJ5OworICAgICAgICAgICsrZW50cnktPm9sZF91 c2VzOworICAgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIG1jX29sZF9saW5lc1tpXSA9IE5V TEw7CisgICAgfQorICBmb3IgKGkgPSBmaXJzdF9uZXc7IGkgPCBsYXN0X25ldzsgKytpKQorICAg IHsKKyAgICAgIGVhc3NlcnQgKE1BVFJJWF9ST1dfRU5BQkxFRF9QIChkZXNpcmVkX21hdHJpeCwg aSkpOworICAgICAgZW50cnkgPSBtY19hZGRfcm93X2VudHJ5IChNQVRSSVhfUk9XIChkZXNpcmVk X21hdHJpeCwgaSkpOworICAgICAgKytlbnRyeS0+bmV3X3VzZXM7CisgICAgICBlbnRyeS0+bmV3 X2xpbmVfbnVtYmVyID0gaTsKKyAgICAgIG1jX25ld19saW5lc1tpXSA9IGVudHJ5OworICAgIH0K KyAgLyogSWRlbnRpZnkgbW92ZXMgYmFzZWQgb24gbGluZXMgdGhhdCBhcmUgdW5pcXVlIGFuZCBl cXVhbAorICAgICBpbiBib3RoIG1hdHJpY2VzLiAqLworICBmb3IgKGkgPSBmaXJzdF9vbGQ7IGkg PCBsYXN0X29sZDspCisgICAgaWYgKG1jX29sZF9saW5lc1tpXQorICAgICAgICAmJiBtY19vbGRf bGluZXNbaV0tPm9sZF91c2VzID09IDEKKyAgICAgICAgJiYgbWNfb2xkX2xpbmVzW2ldLT5uZXdf dXNlcyA9PSAxKQorICAgICAgeworICAgICAgICBpbnQgcCwgcTsKKyAgICAgICAgaW50IG5ld19s aW5lID0gbWNfb2xkX2xpbmVzW2ldLT5uZXdfbGluZV9udW1iZXI7CisgICAgICAgIHN0cnVjdCBy dW4gKnJ1biA9IG1jX3J1bl9wb29sICsgcnVuX2lkeCsrOworICAgICAgICAvKiBSZWNvcmQgbW92 ZS4gKi8KKyAgICAgICAgcnVuLT5jdXJyZW50X3Zwb3MgPSBpOworICAgICAgICBydW4tPmN1cnJl bnRfeSA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCBpKS0+eTsKKyAgICAgICAgcnVuLT5k ZXNpcmVkX3Zwb3MgPSBuZXdfbGluZTsKKyAgICAgICAgcnVuLT5kZXNpcmVkX3kgPSBNQVRSSVhf Uk9XIChkZXNpcmVkX21hdHJpeCwgbmV3X2xpbmUpLT55OworICAgICAgICBydW4tPm5yb3dzID0g MTsKKyAgICAgICAgcnVuLT5oZWlnaHQgPSBNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSkt PmhlaWdodDsKKyAgICAgICAgLyogRXh0ZW5kIGJhY2t3YXJkLiAqLworICAgICAgICBwID0gaSAt IDE7CisgICAgICAgIHEgPSBuZXdfbGluZSAtIDE7CisgICAgICAgIHdoaWxlIChwID4gZmlyc3Rf b2xkCisgICAgICAgICAgICAgICAmJiBxID4gZmlyc3RfbmV3CisgICAgICAgICAgICAgICAmJiBt Y19vbGRfbGluZXNbcF0gPT0gbWNfbmV3X2xpbmVzW3FdKQorICAgICAgICAgIHsKKyAgICAgICAg ICAgIGludCBoID0gTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIHApLT5oZWlnaHQ7CisgICAg ICAgICAgICAtLXJ1bi0+Y3VycmVudF92cG9zOworICAgICAgICAgICAgLS1ydW4tPmRlc2lyZWRf dnBvczsKKyAgICAgICAgICAgICsrcnVuLT5ucm93czsKKyAgICAgICAgICAgIHJ1bi0+aGVpZ2h0 ICs9IGg7CisgICAgICAgICAgICBydW4tPmRlc2lyZWRfeSAtPSBoOworICAgICAgICAgICAgcnVu LT5jdXJyZW50X3kgLT0gaDsKKyAgICAgICAgICAgIC0tcCwgLS1xOworICAgICAgICAgIH0KKyAg ICAgICAgLyogRXh0ZW5kIGZvcndhcmQuICovCisgICAgICAgIHAgPSBpICsgMTsKKyAgICAgICAg cSA9IG5ld19saW5lICsgMTsKKyAgICAgICAgd2hpbGUgKHAgPCBsYXN0X29sZAorICAgICAgICAg ICAgICAgJiYgcSA8IGxhc3RfbmV3CisgICAgICAgICAgICAgICAmJiBtY19vbGRfbGluZXNbcF0g PT0gbWNfbmV3X2xpbmVzW3FdKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGludCBoID0gTUFU UklYX1JPVyAoY3VycmVudF9tYXRyaXgsIHApLT5oZWlnaHQ7CisgICAgICAgICAgICArK3J1bi0+ bnJvd3M7CisgICAgICAgICAgICBydW4tPmhlaWdodCArPSBoOworICAgICAgICAgICAgKytwLCAr K3E7CisgICAgICAgICAgfQorICAgICAgICAvKiBJbnNlcnQgcnVuIGludG8gbGlzdCBvZiBhbGwg cnVucy4gIE9yZGVyIHJ1bnMgYnkgY29waWVkCisgICAgICAgICAgIHBpeGVsIGxpbmVzLiAgTm90 ZSB0aGF0IHdlIHJlY29yZCBydW5zIHRoYXQgZG9uJ3QgaGF2ZSB0bworICAgICAgICAgICBiZSBj b3BpZWQgYmVjYXVzZSB0aGV5IGFyZSBhbHJlYWR5IGluIHBsYWNlLiAgVGhpcyBpcyBkb25lCisg ICAgICAgICAgIGJlY2F1c2Ugd2UgY2FuIGF2b2lkIGNhbGxpbmcgdXBkYXRlX3dpbmRvd19saW5l IGluIHRoaXMKKyAgICAgICAgICAgY2FzZS4gKi8KKyAgICAgICAgZm9yIChwID0gMDsgcCA8IG5y dW5zICYmIG1jX3J1bnNbcF0tPmhlaWdodCA+IHJ1bi0+aGVpZ2h0OyArK3ApCisgICAgICAgICAg OworICAgICAgICBmb3IgKHEgPSBucnVuczsgcSA+IHA7IC0tcSkKKyAgICAgICAgICBtY19ydW5z W3FdID0gbWNfcnVuc1txIC0gMV07CisgICAgICAgIG1jX3J1bnNbcF0gPSBydW47CisgICAgICAg ICsrbnJ1bnM7CisgICAgICAgIGkgKz0gcnVuLT5ucm93czsKKyAgICAgIH0KKyAgICAgIGVsc2UK KyAgICAgICAgKytpOworICAvKiBEbyB0aGUgbW92ZXMuICBEbyBpdCBpbiBhIHdheSB0aGF0IHdl IGRvbid0IG92ZXJ3cml0ZSBzb21ldGhpbmcKKyAgICAgd2Ugd2FudCB0byBjb3B5IGxhdGVyIG9u LiAgVGhpcyBpcyBub3Qgc29sdmFibGUgaW4gZ2VuZXJhbAorICAgICBiZWNhdXNlIHRoZXJlIGlz IG9ubHkgb25lIGRpc3BsYXkgYW5kIHdlIGRvbid0IGhhdmUgYSB3YXkgdG8KKyAgICAgZXhjaGFu Z2UgYXJlYXMgb24gdGhpcyBkaXNwbGF5LiAgRXhhbXBsZToKKyAgICAgICAgICArLS0tLS0tLS0t LS0rICAgICAgICstLS0tLS0tLS0tLSsKKyAgICAgICAgICB8ICAgICBBICAgICB8ICAgICAgIHwg ICAgIEIgICAgIHwKKyAgICAgICAgICArLS0tLS0tLS0tLS0rICAtLT4gICstLS0tLS0tLS0tLSsK KyAgICAgICAgICB8ICAgICBCICAgICB8ICAgICAgIHwgICAgIEEgICAgIHwKKyAgICAgICAgICAr LS0tLS0tLS0tLS0rICAgICAgICstLS0tLS0tLS0tLSsKKyAgICAgSW5zdGVhZCwgcHJlZmVyIGJp Z2dlciBtb3ZlcywgYW5kIGludmFsaWRhdGUgbW92ZXMgdGhhdCB3b3VsZAorICAgICBjb3B5IGZy b20gd2hlcmUgd2UgY29waWVkIHRvLiAqLworICBmb3IgKGkgPSAwOyBpIDwgbnJ1bnM7ICsraSkK KyAgICBpZiAobWNfcnVuc1tpXS0+bnJvd3MgPiAwKQorICAgICAgeworICAgICAgICBzdHJ1Y3Qg cnVuICpyID0gbWNfcnVuc1tpXTsKKyAgICAgICAgaWYgKHItPmN1cnJlbnRfeSAhPSByLT5kZXNp cmVkX3kpCisgICAgICAgICAgeworICAgICAgICAgICAgLy8gIGZwcmludGYgKHN0ZGVyciwgIiVz OiAgci0+Y3VycmVudC9kZXNpcmVkX3Zwb3MgKCVkLyVkKSB8IHItPmN1cnJlbnQvZGVzaXJlZF95 ICglZC8lZClcbiIsCisgICAgICAgICAgICAvLyAgICAgICAgICAgci0+Y3VycmVudF95IDwgci0+ ZGVzaXJlZF95ID8gIuKGkyIgOiAi4oaRIiwKKyAgICAgICAgICAgIC8vICAgICAgICAgICByLT5j dXJyZW50X3Zwb3MsIHItPmRlc2lyZWRfdnBvcywgci0+Y3VycmVudF95LCByLT5kZXNpcmVkX3kp OworICAgICAgICAgICAgLy8gIHJpZi0+Y2xlYXJfd2luZG93X21vdXNlX2ZhY2UgKHcpOworICAg ICAgICAgICAgLy8gIHJpZi0+c2Nyb2xsX3J1bl9ob29rICh3LCByKTsKKyAgICAgICAgICB9Cisg ICAgICAgIC8qIFRydW5jYXRlIHJ1bnMgdGhhdCBjb3B5IHRvIHdoZXJlIHdlIGNvcGllZCB0bywg YW5kCisgICAgICAgICAgIGludmFsaWRhdGUgcnVucyB0aGF0IGNvcHkgZnJvbSB3aGVyZSB3ZSBj b3BpZWQgdG8uICovCisgICAgICAgIGZvciAoaiA9IG5ydW5zIC0gMTsgaiA+IGk7IC0taikKKyAg ICAgICAgICB7CisgICAgICAgICAgICBzdHJ1Y3QgcnVuICpwID0gbWNfcnVuc1tqXTsKKyAgICAg ICAgICAgIGJvb2wgdHJ1bmNhdGVkX3AgPSAwOworICAgICAgICAgICAgaWYgKHAtPm5yb3dzID4g MAorICAgICAgICAgICAgICAgICYmIHAtPmRlc2lyZWRfeSA8IHItPmRlc2lyZWRfeSArIHItPmhl aWdodAorICAgICAgICAgICAgICAgICYmIHAtPmRlc2lyZWRfeSArIHAtPmhlaWdodCA+IHItPmRl c2lyZWRfeSkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChwLT5kZXNpcmVk X3kgPCByLT5kZXNpcmVkX3kpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICAgIHAtPm5yb3dzID0gci0+ZGVzaXJlZF92cG9zIC0gcC0+ZGVzaXJlZF92cG9zOworICAgICAg ICAgICAgICAgICAgICBwLT5oZWlnaHQgPSByLT5kZXNpcmVkX3kgLSBwLT5kZXNpcmVkX3k7Cisg ICAgICAgICAgICAgICAgICAgIHRydW5jYXRlZF9wID0gMTsKKyAgICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAg ICAgICAgIGludCBucm93c19jb3BpZWQgPSAoci0+ZGVzaXJlZF92cG9zICsgci0+bnJvd3MKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIHAtPmRlc2lyZWRfdnBvcyk7 CisgICAgICAgICAgICAgICAgICAgIGlmIChwLT5ucm93cyA8PSBucm93c19jb3BpZWQpCisgICAg ICAgICAgICAgICAgICAgICAgcC0+bnJvd3MgPSAwOworICAgICAgICAgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAg aW50IGhlaWdodF9jb3BpZWQgPSAoci0+ZGVzaXJlZF95ICsgci0+aGVpZ2h0CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gcC0+ZGVzaXJlZF95KTsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgcC0+Y3VycmVudF92cG9zICs9IG5yb3dzX2NvcGllZDsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgcC0+ZGVzaXJlZF92cG9zICs9IG5yb3dzX2NvcGll ZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcC0+bnJvd3MgLT0gbnJvd3NfY29waWVkOwor ICAgICAgICAgICAgICAgICAgICAgICAgICBwLT5jdXJyZW50X3kgKz0gaGVpZ2h0X2NvcGllZDsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgcC0+ZGVzaXJlZF95ICs9IGhlaWdodF9jb3BpZWQ7 CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmhlaWdodCAtPSBoZWlnaHRfY29waWVkOwor ICAgICAgICAgICAgICAgICAgICAgICAgICB0cnVuY2F0ZWRfcCA9IDE7CisgICAgICAgICAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIH0KKyAgICAg ICAgICAgIGlmIChyLT5jdXJyZW50X3kgIT0gci0+ZGVzaXJlZF95CisgICAgICAgICAgICAgICAg LyogVGhlIGNvbmRpdGlvbiBiZWxvdyBpcyBlcXVpdmFsZW50IHRvCisgICAgICAgICAgICAgICAg ICAgKChwLT5jdXJyZW50X3kgPj0gci0+ZGVzaXJlZF95CisgICAgICAgICAgICAgICAgICAgICAm JiBwLT5jdXJyZW50X3kgPCByLT5kZXNpcmVkX3kgKyByLT5oZWlnaHQpCisgICAgICAgICAgICAg ICAgICAgIHx8IChwLT5jdXJyZW50X3kgKyBwLT5oZWlnaHQgPiByLT5kZXNpcmVkX3kKKyAgICAg ICAgICAgICAgICAgICAgICAgICYmIChwLT5jdXJyZW50X3kgKyBwLT5oZWlnaHQKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICA8PSByLT5kZXNpcmVkX3kgKyByLT5oZWlnaHQpKSkKKyAgICAg ICAgICAgICAgICAgICBiZWNhdXNlIHdlIGhhdmUgMCA8IHAtPmhlaWdodCA8PSByLT5oZWlnaHQu ICovCisgICAgICAgICAgICAgICAgJiYgcC0+Y3VycmVudF95IDwgci0+ZGVzaXJlZF95ICsgci0+ aGVpZ2h0CisgICAgICAgICAgICAgICAgJiYgcC0+Y3VycmVudF95ICsgcC0+aGVpZ2h0ID4gci0+ ZGVzaXJlZF95KQorICAgICAgICAgICAgICBwLT5ucm93cyA9IDA7CisgICAgICAgICAgICAvKiBS ZW9yZGVyIHJ1bnMgYnkgY29waWVkIHBpeGVsIGxpbmVzIGlmIHRydW5jYXRlZC4gKi8KKyAgICAg ICAgICAgIGlmICh0cnVuY2F0ZWRfcCAmJiBwLT5ucm93cyA+IDApCisgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICBpbnQgayA9IG5ydW5zIC0gMTsKKyAgICAgICAgICAgICAgICB3aGls ZSAobWNfcnVuc1trXS0+bnJvd3MgPT0gMCB8fCBtY19ydW5zW2tdLT5oZWlnaHQgPCBwLT5oZWln aHQpCisgICAgICAgICAgICAgICAgICBrLS07CisgICAgICAgICAgICAgICAgbWVtbW92ZSAobWNf cnVucyArIGosIG1jX3J1bnMgKyBqICsgMSwgKGsgLSBqKSAqIHNpemVvZiAoKm1jX3J1bnMpKTsK KyAgICAgICAgICAgICAgICBtY19ydW5zW2tdID0gcDsKKyAgICAgICAgICAgICAgfQorICAgICAg ICAgIH0KKyAgICAgICAgLyogQXNzaWduIG1hdHJpeCByb3dzLiAqLworICAgICAgICBmb3IgKGog PSAwOyBqIDwgci0+bnJvd3M7ICsraikKKyAgICAgICAgICB7CisgICAgICAgICAgICBzdHJ1Y3Qg Z2x5cGhfcm93ICpmcm9tLCAqdG87CisgICAgICA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yAgYG1ha2VfY3VycmVudCcgaW4gYHVwZGF0ZV93aW5kb3df bGluZScsIG9yIGJlY2F1c2UgdGhlIHByZXZpb3VzIHJvdyB3b3VsZCBiZQorICB0aGUgc2FtZSBp biBib3RoIG1hdHJpY2VzIGlmIHdlIGp1bXBlZCB0byBgc2V0X2N1cnNvcjpgIHdpdGhpbiBgdXBk YXRlX3dpbmRvdycKKyAgYW5kIGBtY191cGRhdGVfd2luZG93X2RyeXJ1bicuICovCisgIGludCBw cmV2X21hdHJpeF9yb3dfc3RhcnRfYnl0ZXBvcyA9ICh2cG9zICE9IDApCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPV19TVEFSVF9CWVRFUE9TIChjdXJy ZW50X3JvdyAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogLTE7 CisgIGludCBwcmV2X21hdHJpeF9yb3dfZW5kX2J5dGVwb3MgPSAodnBvcyAhPSAwKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XX0VORF9CWVRFUE9TIChj dXJyZW50X3JvdyAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IC0x OworICBpbnQgbWF0cml4X3Jvd19zdGFydF9ieXRlcG9zID0gTUFUUklYX1JPV19TVEFSVF9CWVRF UE9TIChkZXNpcmVkX3Jvdyk7CisgIGludCBtYXRyaXhfcm93X2VuZF9ieXRlcG9zID0gTUFUUklY X1JPV19FTkRfQllURVBPUyAoZGVzaXJlZF9yb3cpOworICAvKiBUaGUgZmlyc3QgY29uZGl0aW9u IHRlc3RzIGZvciBhIHNvbGl0YXJ5IHJvdyBjb250YWluaW5nIFpWLCBwcmVjZWRlZCBieSBhCisg IHJvdyBjb250YWluaW5nIGEgcGVudWx0aW1hdGUgZ2x5cGggd2l0aCBhIGNoYXJwb3Mgb2YgWlYg LSAxIGZvbGxvd2VkIGJ5IGFuIGVuZAorICBvZiByb3cgc3BhY2UgZ2x5cGggd2l0aCBhIGNoYXJw b3Mgb2YgMC4gIFRoZSBvdGhlciBjb25kaXRpb25zIHRlc3QgZm9yIGFuIGVtcHR5CisgIGJ1ZmZl ciAobm90IG5hcnJvd2VkKSwgb3IgYW4gZW1wdHkgbmFycm93ZWQgYnVmZmVyLiAqLworICBib29s IHJvd19hdF96dl9wID0gKCh2cG9zICE9IDAKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgKGN1 cnJlbnRfcm93IC0gMSktPnVzZWRbVEVYVF9BUkVBXSA+IDAKKyAgICAgICAgICAgICAgICAgICAg ICAgJiYgcHJldl9tYXRyaXhfcm93X3N0YXJ0X2J5dGVwb3MgIT0gcHJldl9tYXRyaXhfcm93X2Vu ZF9ieXRlcG9zCisgICAgICAgICAgICAgICAgICAgICAgICYmICEoY3VycmVudF9yb3cgLSAxKS0+ ZW5kc19hdF96dl9wCisgICAgICAgICAgICAgICAgICAgICAgICYmIG1hdHJpeF9yb3dfc3RhcnRf Ynl0ZXBvcyA9PSBtYXRyaXhfcm93X2VuZF9ieXRlcG9zCisgICAgICAgICAgICAgICAgICAgICAg ICYmIGRlc2lyZWRfcm93LT5lbmRzX2F0X3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgfHwg KCgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID09IDEpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICB8fCAoaGVhZGVyX2xpbmVfZm9ybWF0ID09IDAgJiYgdnBvcyA9PSAwKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgYnVmZmVyX25hcnJvd2VkX3AKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgYm9iX3Jlc3BlY3RfbmFycm93ID09IGVvYl9yZXNwZWN0X25hcnJv dykKKyAgICAgICAgICAgICAgICAgICAgICB8fCAoKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYm IHZwb3MgPT0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChoZWFkZXJfbGluZV9m b3JtYXQgPT0gMCAmJiB2cG9zID09IDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBi b2JfZGlzcmVnYXJkX25hcnJvdyA9PSBlb2JfZGlzcmVnYXJkX25hcnJvdykpOworICAvKiBJZiBs aW5lLW51bWJlcnMgYXJlIGFjdGl2ZSwgdGhlbiBzcGFjZSBnbHlwaCBwYWRkaW5nIGVxdWFsIHRv IGl0cyB3aWR0aAorICBjb3VudGVkIGluIEhQT1MgYXJlIGZvbGxvd2VkIGJ5IGEgc2luZ2xlIHJv dyBlbmQgc3BhY2UgZ2x5cGguICBMaW5lIG51bWJlcgorICBwYWRkaW5nIHNwYWNlIGdseXBocyBo YXZlIGEgY2hhcnBvcyBvZiAtMSwgd2hlcmVhcyB0aGUgZW5kIG9mIHJvdyBzcGFjZSBnbHlwaAor ICBoYXMgYSBjaGFycG9zIG9mIDAuICBJZiBsaW5lIG51bWJlcnMgYXJlIGluYWN0aXZlLCB0aGVu IHRoZSByb3cgd2lsbCBjb250YWluCisgIGEgc29saXRhcnkgc3BhY2UgZ2x5cGggd2l0aCBhIGNo YXJwb3Mgb2YgLTEuICovCisgIGJvb2wgcm93X2JleW9uZF96dl9wID0gKG1hdHJpeF9yb3dfc3Rh cnRfYnl0ZXBvcyA9PSBtYXRyaXhfcm93X2VuZF9ieXRlcG9zCisgICAgICAgICAgICAgICAgICAg ICAgICAgICYmICFyb3dfYXRfenZfcCk7CisgIHJldHVybiAocm93X2F0X3p2X3ApCisgICAgICAg ICAgID8gQVRfWlYKKyAgICAgICAgIDogKHJvd19iZXlvbmRfenZfcCkKKyAgICAgICAgICAgPyBQ T1NUX1pWCisgICAgICAgICA6IFBSRV9aVjsKK30KKworLyogVXBkYXRlIHRoZSBkaXNwbGF5IG9m IHRoZSB0ZXh0IGFyZWEgb2Ygcm93IFZQT1MgaW4gd2luZG93IFcuCisgICBWYWx1ZSBpcyB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lcnIsICJtY191cGRhdGVfdGV4dF9hcmVhICglcyk6ICB2cG9z ICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgbWNfd2luZG93ICh3KSwgdnBvcyk7Cisg IC8qIEluYXNtdWNoIGFzIHdlIHByb2Nlc3MgdGhlIGN1cnNvciByb3cgYmVmb3JlIGFsbCBvdGhl ciByb3dzLCB3ZSBjYW4gcmVseQorICB1cG9uIHRoZSBwcmV2aW91cyBgZGVzaXJlZF9yb3dgIHRv IGJlIGFjY3VyYXRlLiAqLworICBlbnVtIG1jX3Jvd19wb3NpdGlvbiByb3dfcG9zaXRpb24gPSAg bWNfcm93X3Bvc2l0aW9uICh3LCB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZGVzaXJlZF9y b3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiBjdXJyZW50X3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgZGVzaXJlZF9yb3csIHZwb3MpOworICAvKiBJZiByb3dzIGFy ZSBhdCBkaWZmZXJlbnQgWCBvciBZLCBvciByb3dzIGhhdmUgZGlmZmVyZW50IGhlaWdodCwKKyAg ICAgb3IgdGhlIGN1cnJlbnQgcm93IGlzIG1hcmtlZCBpbnZhbGlkLCB3cml0ZSB0aGUgZW50aXJl IGxpbmUuICovCisgIGlmICghY3VycmVudF9yb3ctPmVuYWJsZWRfcAorICAgICAgfHwgZGVzaXJl ZF9yb3ctPnkgIT0gY3VycmVudF9yb3ctPnkKKyAgICAgIHx8IGRlc2lyZWRfcm93LT5hc2NlbnQg IT0gY3VycmVudF9yb3ctPmFzY2VudAorICAgICAgfHwgZGVzaXJlZF9yb3ctPnBoeXNfYXNjZW50 ICE9IGN1cnJlbnRfcm93LT5waHlzX2FzY2V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EUgRU5USVJF IFJPVzpcblwKKyAgICAgICAgICB2cG9zICglZCkgfCBjaGFyICglZC8lcykgfCBzdGFydF94OiAo JWQpIHwgc3RhcnRfaHBvcyAoJWQvJWQpXG4iLAorICAgICAgICAgIHZwb3MsIGRlc2lyZWRfcm93 LT5nbHlwaHNbVEVYVF9BUkVBXS0+dS5jaCwKKyAgICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAo ZGVzaXJlZF9yb3ctPmdseXBoc1tURVhUX0FSRUFdLT51LmNoKSwKKyAgICAgICAgICBkZXNpcmVk X3Jvdy0+eCwgMCwgZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpOworICAgICAgaWYg KGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgIHsKKyAgICAgICAgICBibG9j a19pbnB1dCAoKTsKKyAgICAgICAgICBpbnQgbGVuID0gZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9B UkVBXTsKKyAgICAgICAgICBpbnQgaHBvcyA9IGRlc2lyZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVB XSAtIHVwZGF0ZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICB3LT5vdXRwdXRf Y3Vyc29yLnggPQorICAgICAgICAgICAgbWNfZHJhd19nbHlwaHMgKHcsIGRlc2lyZWRfbWF0cml4 LCB1cGRhdGVkX3Jvdywgdy0+b3V0cHV0X2N1cnNvci54LAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgIFRFWFRfQVJFQSwgaHBvcywgaHBvcyArIGxlbiwgRFJBV19OT1JNQUxfVEVYVCwgMCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCBsc2wsIGdseXBoX2ZsYXZvciwgY3Vy c29yX3R5cGUsIHdkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0 aXZlX3AsIGN1cnNvcl9nY19wLCBNQ19EUkFXX0dM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aCwgc28gdGhhdCB0aGUgZmFjZSBleHRlbnNp b24gYWN0dWFsbHkgdGFrZXMgcGxhY2UuICovCisgICAgICAgIGlmIChNQVRSSVhfUk9XX0VYVEVO RFNfRkFDRV9QIChkZXNpcmVkX3JvdykKKyAgICAgICAgICAgICYmIChkZXNpcmVkX3N0b3BfcG9z IDwgY3VycmVudF9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgIHx8IChkZXNp cmVkX3N0b3BfcG9zID09IGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAg ICAgICAgICAgJiYgIU1BVFJJWF9ST1dfRVhURU5EU19GQUNFX1AgKGN1cnJlbnRfcm93KSkpKQor ICAgICAgICAgIC0tZGVzaXJlZF9zdG9wX3BvczsKKyAgICAgICAgc3RvcCA9IG1pbiAoY3VycmVu dF9yb3ctPnVzZWRbVEVYVF9BUkVBXSwgZGVzaXJlZF9zdG9wX3Bvcyk7CisgICAgICAgIGkgPSAw OworICAgICAgICB4ID0gZGVzaXJlZF9yb3ctPng7CisgICAgICAgIGludCBjbGVhcl90b194ID0g MDsKKworICAgICAgICAvKiBMb29wIG92ZXIgZ2x5cGhzIHRoYXQgY3VycmVudCBhbmQgZGVzaXJl ZCByb3cgbWF5IGhhdmUgaW4gY29tbW9uLiAqLworICAgICAgICB3aGlsZSAoaSA8IHN0b3ApCisg ICAgICAgICAgeworICAgICAgICAgICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZCA9IDA7Cisg ICAgICAgICAgICBib29sIGNhbl9za2lwX3AgPSAhYWJvcnRfc2tpcHBpbmc7CisgICAgICAgICAg ICAvKiBTa2lwIG92ZXIgZ2x5cGhzIHRoYXQgYm90aCByb3dzIGhhdmUgaW4gY29tbW9uLiAgVGhl c2UgZG9uJ3QgaGF2ZQorICAgICAgICAgICAgdG8gYmUgd3JpdHRlbi4gIFdlIGNhbid0IHNraXAg aWYgdGhlIGxhc3QgY3VycmVudCBnbHlwaCBvdmVybGFwcyB0aGUKKyAgICAgICAgICAgIGdseXBo IHRvIGl0cyByaWdodC4gIEZvciBleGFtcGxlLCBjb25zaWRlciBhIGN1cnJlbnQgcm93IG9mIGBp Zicgd2l0aAorICAgICAgICAgICAgdGhlIGBmJyBpbiBDb3VyaWVyIGJvbGQgc28gdGhhdCBpdCBv dmVybGFwcyB0aGUgYCAnIHRvIGl0cyByaWdodC4KKyAgICAgICAgICAgIElmIHRoZSBkZXNpcmVk IHJvdyBpcyBgICcsIHdlIHdvdWxkIHNraXAgb3ZlciB0aGUgc3BhY2UgYWZ0ZXIgdGhlCisgICAg ICAgICAgICBgaWYnIGFuZCB0aGVyZSB3b3VsZCByZW1haW4gYSBwaXhlbCBmcm9tIHRoZSBgZicg b24gdGhlIHNjcmVlbi4gKi8KKyAgICAgICAgICAgIGlmIChvdmVybGFwcGluZ19nbHlwaHNfcCAm JiBpID4gMCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAq Z2x5cGggPSAmY3VycmVudF9yb3ctPmdseXBoc1tURVhUX0FSRUFdW2kgLSAxXTsKKyAgICAgICAg ICAgICAgICBpbnQgbGVmdCwgcmlnaHQ7CisgICAgICAgICAgICAgICAgcmlmLT5nZXRfZ2x5cGhf b3ZlcmhhbmdzIChnbHlwaCwgWEZSQU1FICh3LT5mcmFtZSksICZsZWZ0LCAmcmlnaHQpOworICAg ICAgICAgICAgICAgIGNhbl9za2lwX3AgPSAocmlnaHQgPT0gMCAmJiAhYWJvcnRfc2tpcHBpbmcp OworICAgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoY2FuX3NraXBfcCkKKyAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgIGludCBzdGFydF9ocG9zID0gaTsKKyAgICAgICAgICAg ICAgICB3aGlsZSAoaSA8IHN0b3AKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgR0xZUEhfRVFV QUxfUCAoZGVzaXJlZF9nbHlwaCwgY3VycmVudF9nbHlwaCkpCisgICAgICAgICAgICAgICAgICB7 CisgICAgICAgICAgICAgICAgICAgICsrYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZDsKKyAgICAg ICAgICAgICAgICAgICAgaWYgKGFycmF5X2dseXBoc19za2lwcGVkLmFsbG9jYXRlZCA8IGFycmF5 X2dseXBoc19za2lwcGVkLnVzZWQpCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgICAgICAgaW50IG9sZF9hbGxvYyA9IGFycmF5X2dseXBoc19za2lwcGVkLmFsbG9j YXRlZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBuZXdfZWx0cyA9IGFycmF5X2dseXBo c19za2lwcGVkLnVzZWQgLSBhcnJheV9nbHlwaHNfc2tpcHBlZC5hbGxvY2F0ZWQ7CisgICAgICAg ICAgICAgICAgICAgICAgICBhcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVkID0KKyAgICAgICAg ICAgICAgICAgICAgICAgICAgeHBhbGxvYyAoYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmFycmF5X2dseXBoc19za2lwcGVk LmFsbG9jYXRlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2VsdHMs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElOVF9NQVgsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiAqYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tp cHBlZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBtZW1zZXQgKGFycmF5X2dseXBoc19za2lw cGVkLnNraXBwZWQgKyBvbGRfYWxsb2MsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAoYXJyYXlfZ2x5cGhzX3NraXBwZWQuYWxsb2NhdGVkIC0gb2xkX2FsbG9jKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHNpemVvZiAqYXJyYXlfZ2x5cGhzX3NraXBw ZWQuc2tpcHBlZCk7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAg ICBpbnQgbnRoID0gYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZCAtIDE7CisgICAgICAgICAgICAg ICAgICAgIGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbbnRoXS54ID0geDsKKyAgICAgICAg ICAgICAgICAgICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZFtudGhdLmhwb3MgPSBpOwor ICAgICAgICAgICAgICAgICAgICBhcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVkW250aF0uZW5h YmxlZF9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgeCArPSBkZXNpcmVkX2dseXBoLT5w aXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgKytkZXNpcmVkX2dseXBoLCArK2N1cnJl bnRfZ2x5cGgsICsraTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvKiBD b25zaWRlciB0aGUgY2FzZSB0aGF0IHRoZSBjdXJyZW50IHJvdyBjb250YWlucyAieHh4IHBwcCBn Z2ciIGluCisgICAgICAgICAgICAgICAgaXRhbGljIENvdXJpZXIgZm9udCwgYW5kIHRoZSBkZXNp cmVkIHJvdyBpcyAieHh4IGdnZyIuICBUaGUgY2hhcmFjdGVyIGBwJworICAgICAgICAgICAgICAg IGhhcyBsYmVhcmluZywgYGcnIGhhcyBub3QuICBUaGUgbG9vcCBhYm92ZSB3aWxsIHN0b3AgaW4g ZnJvbnQgb2YgdGhlCisgICAgICAgICAgICAgICAgZmlyc3QgYHAnIGluIHRoZSBjdXJyZW50IHJv dy4gIElmIHdlIHdvdWxkIHN0YXJ0IHdyaXRpbmcgZ2x5cGhzIHRoZXJlLCB3ZQorICAgICAgICAg ICAgICAgIHdvdWxkbid0IGVyYXNlIHRoZSBsYmVhcmluZyBvZiB0aGUgYHAnLiAgVGhlIHJlc3Qg b2YgdGhlIGxiZWFyaW5nIHByb2JsZW0KKyAgICAgICAgICAgICAgICBpcyB0aGVuIHRha2VuIGNh cmUgb2YgYnkgZHJhd19nbHlwaHMuICovCisgICAgICAgICAgICAgICAgaWYgKG92ZXJsYXBwaW5n X2dseXBoc19wCisgICAgICAgICAgICAgICAgICAgICYmIGkgPiAwCisgICAgICAgICAgICAgICAg ICAgICYmIGkgPCBjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAgICAg ICAgICYmIChjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdICE9IGRlc2lyZWRfcm93LT51c2Vk W1RFWFRfQVJFQV0pKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBp bnQgbGVmdCwgcmlnaHQ7CisgICAgICAgICAgICAgICAgICAgIHJpZi0+Z2V0X2dseXBoX292ZXJo YW5ncyAoY3VycmVudF9nbHlwaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBYRlJBTUUg KHctPmZyYW1lKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmbGVmdCwgJnJpZ2h0KTsK KyAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGxlZnQgPiAwICYmIGkgPiAwKQorICAgICAgICAg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC0taSwgLS1kZXNpcmVkX2ds eXBoLCAtLWN1cnJlbnRfZ2x5cGg7CisgICAgICAgICAgICAgICAgICAgICAgICB4IC09IGRlc2ly ZWRfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICAgICAgICAgICAgbGVmdCAtPSBk ZXNpcmVkX2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAg ICAgICAgICAgICAgICAgIC8qIEFib3J0IHRoZSBza2lwcGluZyBhbGdvcml0aG0gaWYgd2UgZW5k IHVwIGJlZm9yZQorICAgICAgICAgICAgICAgICAgICAgICBvdXIgc3RhcnRpbmcgcG9pbnQsIHRv IGF2b2lkIGxvb3BpbmcgKGJ1ZyMxMDcwKS4KKyAgICAgICAgICAgICAgICAgICAgICAgVGhpcyBj YW4gaGFwcGVuIHdoZW4gdGhlIGxiZWFyaW5nIGlzIGxhcmdlciB0aGFuCisgICAgICAgICAgICAg ICAgICAgICAgIHRoZSBwaXhlbCB3aWR0aC4gKi8KKyAgICAgICAgICAgICAgICAgICAgYWJvcnRf c2tpcHBpbmcgPSAoaSA8IHN0YXJ0X2hwb3MpOworICAgICAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAvKiBUcnkgdG8gYXZvaWQgd3JpdGluZyB0aGUgZW50aXJl IHJlc3Qgb2YgdGhlIGRlc2lyZWQgcm93CisgICAgICAgICAgICAgICBieSBsb29raW5nIGZvciBh IHJlc3luYyBwb2ludC4gIFRoaXMgbWFpbmx5IHByZXZlbnRzCisgICAgICAgICAgICAgICBtb2Rl IGxpbmUgZmxpY2tlcmluZyBpbiB0aGUgY2FzZSB0aGUgbW9kZSBsaW5lIGlzIGluCisgICAgICAg ICAgICAgICBmaXhlZC1waXRjaCBmb250LCB3aGljaCBpdCB1c3VhbGx5IHdpbGwgYmUuICovCisg ICAgICAgICAgICBpZiAoaSA8IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICBpbnQgc3RhcnRfeCA9IHgsIHN0YXJ0X2hwb3MgPSBp OworICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqc3RhcnQgPSBkZXNpcmVkX2dseXBoOwor ICAgICAgICAgICAgICAgIGludCBjdXJyZW50X3ggPSB4OworICAgICAgICAgICAgICAgIGJvb2wg c2tpcF9maXJzdF9wID0gIWNhbl9za2lwX3A7CisgICAgICAgICAgICAgICAgLyogRmluZCB0aGUg bmV4dCBnbHlwaCB0aGF0J3MgZXF1YWwgYWdhaW4uICovCisgICAgICAgICAgICAgICAgd2hpbGUg KGkgPCBzdG9wCisgICAgICAgICAgICAgICAgICAgICAgICYmIChza2lwX2ZpcnN0X3AKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgIHx8ICFHTFlQSF9FUVVBTF9QIChkZXNpcmVkX2dseXBoLCBj dXJyZW50X2dseXBoKSkKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgeCA9PSBjdXJyZW50X3gp CisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHggKz0gZGVzaXJlZF9n bHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRfeCArPSBjdXJy ZW50X2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgKytkZXNpcmVkX2ds eXBoLCArK2N1cnJlbnRfZ2x5cGgsICsraTsKKyAgICAgICAgICAgICAgICAgICAgc2tpcF9maXJz dF9wID0gMDsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBmb3IgKGludCBl bHQgPSAwOworICAgICAgICAgICAgICAgICAgICAgZWx0IDwgYXJyYXlfZ2x5cGhzX3NraXBwZWQu dXNlZDsKKyAgICAgICAgICAgICAgICAgICAgICsrZWx0KQorICAgICAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgICAgICBpbnQgeCA9IGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRb ZWx0XS54OworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGFycmF5X2dseXBoc19za2lw cGVkLnNraXBwZWRbZWx0XS5ocG9zOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGgg KnRhcmdldF9nbHlwaCA9CisgICAgICAgICAgICAgICAgICAgICAgbWNfZ2V0X2N1cnNvcl9nbHlw aCAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCBocG9zLCB2cG9zKTsKKyAgICAgICAg ICAgICAgICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgICAgICAgICAgICAgICAgZnByaW50ZiAo c3RkZXJyLCAiU0tJUFBFRDogIHZwb3MgKCVkKSB8IGNoYXIgKCVkLyVzKSB8IHg6ICglZCkgfCBo cG9zICglZC8lZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2 cG9zLCB0YXJnZXRfZ2x5cGgtPnUuY2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAodGFyZ2V0X2dseXBoLT51LmNoKSwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHgsIGhwb3MsIHVwZGF0ZWRfcm93LT51c2Vk W1RFWFRfQVJFQV0gLSAxKTsKKyAgICAgICAgICAgICAgICAgICAgbWNfZHJhd19yb3cgKHcsIGRl c2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBoLCB4LCAxLCB2cG9zLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywg cm93X3Bvc2l0aW9uLCBkcmF3X3AsIFNLSVBQRUQpOworICAgICAgICAgICAgICAgICAgfQorICAg ICAgICAgICAgICAgIGlmIChpID09IHN0YXJ0X2hwb3MgfHwgeCAhPSBjdXJyZW50X3gpCisgICAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGkgPSBzdGFydF9ocG9zOworICAg ICAgICAgICAgICAgICAgICB4ID0gc3RhcnRfeDsKKyAgICAgICAgICAgICAgICAgICAgZGVzaXJl ZF9nbHlwaCA9IHN0YXJ0OworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgICAgICBvdXRwdXRfY3Vyc29yX3RvICh3LCB2cG9zLCBzdGFy dF9ocG9zLCBkZXNpcmVkX3Jvdy0+eSwgc3RhcnRfeCk7CisgICAgICAgICAgICAgICAgLyogUmUt ZHJhdyBhIHBvcnRpb24gb2YgdGhlIHJvdy4gKi8KKyAgICAgICAgICAgICAgICBpZiAoZGVidWdf cCkKKyAgICAgICAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIlJFRFJBVyBTRUdNRU5UOlxu XAorICAgICAgICAgICAgICAgICAgICB2cG9zICglZCkgfCBjaGFyICglZC8lcykgfCB4OiAoJWQp IHwgaHBvcyAoJWQvJWQpIHwgbGVuZ3RoICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgIHZw b3MsIHN0YXJ0LT51LmNoLCBtY19jaGFyX3RvX3N0cmluZyAoc3RhcnQtPnUuY2gpLAorICAgICAg ICAgICAgICAgICAgICBzdGFydF94LCBzdGFydF9ocG9zLCB1cGRhdGVkX3Jvdy0+dXNlZFtURVhU X0FSRUFdIC0gMSwgaSAtIHN0YXJ0X2hwb3MpOworICAgICAgICAgICAgICAgIGJsb2NrX2lucHV0 ICgpOworICAgICAgICAgICAgICAgIGludCBsZW4gPSBpIC0gc3RhcnRfaHBvczsKKyAgICAgICAg ICAgICAgICBpbnQgaHBvcyA9IHN0YXJ0IC0gdXBkYXRlZF9yb3ctPmdseXBoc1tURVhUX0FSRUFd OworICAgICAgICAgICAgICAgIHctPm91dHB1dF9jdXJzb3IueCA9CisgICAgICAgICAgICAgICAg ICBtY19kcmF3X2dseXBocyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB3LT5vdXRw dXRfY3Vyc29yLngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVEVYVF9BUkVB LCBocG9zLCBocG9zICsgbGVuLCBEUkFXX05PUk1BTF9URVhULAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDAsIHZwb3MsIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwg d2QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVf cCwgY3Vyc29yX2djX3AsIE1DX0RSQVdfR0xZUEhfU1RSSU5HLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGRyYXdfcCk7CisgICAgICAgICAgICAgICAgdy0+b3V0cHV0X2N1cnNv ci5ocG9zICs9IGxlbjsKKyAgICAgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAg ICAgICAgICAgIG1jX2RyYXdfcm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHN0 YXJ0LCBzdGFydF94LCBpIC0gc3RhcnRfaHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgdnBvcywgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBkcmF3X3As IFNDUklCRV9UV08pOworICAgICAgICAgICAgICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAgICAg ICAgIH0KKyAgICAgICAgICB9CisKKyAgICAgICAgLyogV3JpdGUgdGhlIHJlc3QuICovCisgICAg ICAgIGlmIChpIDwgZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgICAgICB7Cisg ICAgICAgICAgICBvdXRwdXRfY3Vyc29yX3RvICh3LCB2cG9zLCBpLCBkZXNpcmVkX3Jvdy0+eSwg eCk7CisgICAgICAgICAgICBpZiAoZGVidWdfcCkKKyAgICAgICAgICAgICAgZnByaW50ZiAoc3Rk ZXJyLCAiRFJBVyBSRU1BSU5ERVIgT0YgVEhFIFJPVzpcblwKKyAgICAgICAgICAgICAgICB2cG9z ICglZCkgfCBjaGFyICglZC8lcykgfCB4OiAoJWQpIHwgaHBvcyAoJWQvJWQpIHwgbGVuZ3RoICgl ZClcbiIsCisgICAgICAgICAgICAgICAgdnBvcywgZGVzaXJlZF9nbHlwaC0+dS5jaCwgbWNfY2hh cl90b19zdHJpbmcgKGRlc2lyZWRfZ2x5cGgtPnUuY2gpLAorICAgICAgICAgICAgICAgIHgsIGks IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxLCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhU X0FSRUFdIC0gaSk7CisgICAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgIGlu dCBsZW4gPSBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gaTsKKyAgICAgICAgICAgIGlu dCBocG9zID0gZGVzaXJlZF9nbHlwaCAtIHVwZGF0ZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsK KyAgICAgICAgICAgIHctPm91dHB1dF9jdXJzb3IueCA9CisgICAgICAgICAgICAgIG1jX2RyYXdf Z2x5cGhzICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHctPm91dHB1dF9jdXJzb3Iu eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRFWFRfQVJFQSwgaHBvcywgaHBvcyAr IGxlbiwgRFJBV19OT1JNQUxfVEVYVCwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHZwb3MsIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBjdXJzb3JfZ2NfcCwgTUNfRFJB V19HTFlQSF9TVFJJTkcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3X3ApOwor ICAgICAgICAgICAgdy0+b3V0cHV0X2N1cnNvci5ocG9zICs9IGxlbjsKKyAgICAgICAgICAgIHVu YmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgICAvKiBGSVhNRTogIEFsdGhvdWdoIHdlIG5lZWQg dG8gdXBkYXRlIHRoZSBjYW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mVkIHRo ZSBzYW1lLiAgYGlgIGFuZCBgeGAgd2VyZQorICAgICAgICAgIGluY3JlbWVudGVkIHRvIHRoZSBl bmQgb2YgdGhlIGdseXBoIHJvdy4gIGkgPT0gZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXQor ICAgICAgICAgIFRoZSBgdy0+b3V0cHV0X2N1cnNvci54L3kvaHBvcy92cG9zYCBpcyBhdCB0aGUg ZW5kIG9mIHRoZSBwcmV2aW91cyBjaGFuZ2UuCisgICAgICAgICAgV2hlbiB0aGlzIHNpdHVhdGlv biBleGlzdHMsIHRoZSBkaXN0YW5jZSBiZXR3ZWVuIHRoZSBlbmQgb2YgdGhlIGdseXBoIHJvdyBh bmQKKyAgICAgICAgICB0aGUgcmlnaHQgZWRnZSBvZiB0aGUgd2luZG93IHdpbGwgX25vdF8gYmUg Y2xlYXJlZC4gIFRoZXJlZm9yZSwgaXQgaXMgb2theSB0bworICAgICAgICAgIGRyYXcgdGhlIGZs b2F0aW5nIGdseXBocyBmb3IgdGhlIGhvcml6b250YWwvdmVydGljYWwgcnVsZXJzIGhlcmUuICov CisgICAgICAgICAgZWxzZSBpZiAoY2hhbmdlZF9wCisgICAgICAgICAgICAgICAgICAgJiYgdy0+ b3V0cHV0X2N1cnNvci5ocG9zICE9IHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAg ICAgICAgICB7CisgICAgICAgICAgICAgIGludCB4ID0gdy0+b3V0cHV0X2N1cnNvci54OworICAg ICAgICAgICAgICBpbnQgaHBvcyA9IHctPm91dHB1dF9jdXJzb3IuaHBvczsKKyAgICAgICAgICAg ICAgc3RydWN0IGdseXBoICpzdGFydCA9IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIGRlc2lyZWRf bWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgdXBkYXRlZF9yb3csIGhwb3MsIHZwb3MpOworICAgICAgICAgICAgICBpZiAody0+ b3V0cHV0X2N1cnNvci54ID09IHVwZGF0ZWRfcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAg ICAgICB4IC09IHN0YXJ0LT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgaWYgKGRlYnVnX3Ap CisgICAgICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiUE9TVC1DSEFOR0VEOiAgdnBvcyAo JWQpIHwgeCAoJWQpIHwgaHBvcyAoJWQvJWQpIHwgY2hhciAoJWQvJXMpXG4iLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgdnBvcywgeCwgaHBvcywgdXBkYXRlZF9yb3ctPnVzZWRb VEVYVF9BUkVBXSAtIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydC0+ dS5jaCwgbWNfY2hhcl90b19zdHJpbmcgKHN0YXJ0LT51LmNoKSk7CisgICAgICAgICAgICAgIG1j X2RyYXdfcm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHN0YXJ0LCB4LAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIGhw b3MsIHZwb3MsIGN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBlc3Nl bnRpYWxzLCByb3dfcG9zaXRpb24sIGRyYXdfcCwgUE9TVF9DSEFOR0VEKTsKKyAgICAgICAgICAg IH0KKyAgICAgICAgICAgIC8qIFRoZXJlIHdlcmUgbm8gY2hhbmdlcyBhbmQgaSA9PSBkZXNpcmVk X3Jvdy0+dXNlZFtURVhUX0FSRUFdICovCisgICAgICAgICAgICBlbHNlIGlmICghY2hhbmdlZF9w KQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAg ICAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJVTkNIQU5HRUQgLS0gV1JJVEUgRU5USVJFIExJ TkU6ICB2cG9zICglZCkgfCByb3ctPnVzZWQgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgdnBvcywgdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpOwor ICAgICAgICAgICAgICAgIG1jX2RyYXdfcm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9y b3csIGRlc2lyZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgZGVzaXJlZF9yb3ctPngsIGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0sIHZw b3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlh bHMsIHJvd19wb3NpdGlvbiwgZHJhd19wLCBVTkNIQU5HRUQpOworICAgICAgICAgICAgICB9CisK KyAgICAgICAgLyogTWF5YmUgY2xlYXIgdG8gZW5kIG9mIGxpbmUuICovCisgICAgICAgIGlmIChN QVRSSVhfUk9XX0VYVEVORFNfRkFDRV9QIChkZXNpcmVkX3JvdykpCisgICAgICAgICAgeworICAg ICAgICAgICAgLyogSWYgbmV3IHJvdyBleHRlbmRzIHRvIHRoZSBlbmQgb2YgdGhlIHRleHQgYXJl YSwgbm90aGluZworICAgICAgICAgICAgICAgaGFzIHRvIGJlIGNsZWFyZWQsIGlmIGFuZCBvbmx5 IGlmIHdlIGRpZCBhIHdyaXRlX2dseXBocworICAgICAgICAgICAgICAgYWJvdmUuICBUaGlzIGlz IG1hZGUgc3VyZSBieSBzZXR0aW5nIGRlc2lyZWRfc3RvcF9wb3MKKyAgICAgICAgICAgICAgIGFw cHJvcHJpYXRlbHkgYWJvdmUuICovCisgICAgICAgICAgICBlYXNzZXJ0IChpIDwgZGVzaXJlZF9y b3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAgICAgfHwgKChkZXNpcmVkX3Jv dy0+dXNlZFtURVhUX0FSRUFdID09IGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgTUFUUklYX1JPV19FWFRFTkRTX0ZBQ0VfUCAoY3VycmVu dF9yb3cpKSk7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKE1BVFJJWF9ST1dfRVhU RU5EU19GQUNFX1AgKGN1cnJlbnRfcm93KSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg LyogSWYgb2xkIHJvdyBleHRlbmRzIHRvIHRoZSBlbmQgb2YgdGhlIHRleHQgYXJlYSwgY2xlYXIu ICovCisgICAgICAgICAgICAgIGlmIChpID49IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0p CisgICAgICAgICAgICAgICAgb3V0cHV0X2N1cnNvcl90byAodywgdnBvcywgaSwgZGVzaXJlZF9y b3ctPnksIGRlc2lyZWRfcm93LT5waXhlbF93aWR0aCk7CisgICAgICAgICAgICAgIGlmIChkcmF3 X3ApCisgICAgICAgICAgICAgICAgcmlmLT5jbGVhcl9lbmRfb2ZfbGluZSAodywgdXBkYXRlZF9y b3csIFRFWFRfQVJFQSwgLTEpOworICAgICAgICAgICAgICBjbGVhcl90b194ID0gLTE7CisgICAg ICAgICAgICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNl IGlmIChkZXNpcmVkX3Jvdy0+cGl4ZWxfd2lkdGggPCBjdXJyZW50X3Jvdy0+cGl4ZWxfd2lkdGgp CisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBPdGhlcndpc2UgY2xlYXIgdG8g dGhlIGVuZCBvZiB0aGUgb2xkIHJvdy4gIEV2ZXJ5dGhpbmcKKyAgICAgICAgICAgICAgICAgICBh ZnRlciB0aGF0IHBvc2l0aW9uIHNob3VsZCBiZSBjbGVhciBhbHJlYWR5LiAqLworICAgICAgICAg ICAgICAgIGludCB4bGltOworICAgICAgICAgICAgICAgIGlmIChpID49IGRlc2lyZWRfcm93LT51 c2VkW1RFWFRfQVJFQV0pCisgICAgICAgICAgICAgICAgICBvdXRwdXRfY3Vyc29yX3RvICh3LCB2 cG9zLCBpLCBkZXNpcmVkX3Jvdy0+eSwgZGVzaXJlZF9yb3ctPnBpeGVsX3dpZHRoKTsKKyAgICAg ICAgICAgICAgICAvKiBJZiBjdXJzb3IgaXMgZGlzcGxheWVkIGF0IHRoZSBlbmQgb2YgdGhlIGxp bmUsIG1ha2Ugc3VyZQorICAgICAgICAgICAgICAgICAgIGl0J3MgY2xlYXJlZC4gIE5vd2FkYXlz IHdlIGRvbid0IGhhdmUgYSBwaHlzX2N1cnNvcl9nbHlwaAorICAgICAgICAgICAgICAgICAgIHdp dGggd2hpY2ggdG8gZXJhc2UgdGhlIGN1cnNvciAoYmVjYXVzZSB0aGlzIG1ldGhvZAorICAgICAg ICAgICAgICAgICAgIGRvZXNuJ3Qgd29yayB3aXRoIGxiZWFyaW5nL3JiZWFyaW5nKSwgc28gd2Ug bXVzdCBkbyBpdCB0aGlzIHdheS4gKi8KKyAgICAgICAgICAgICAgICBpZiAodnBvcyA9PSB3LT5w aHlzX2N1cnNvci52cG9zCisgICAgICAgICAgICAgICAgICAgICYmIChkZXNpcmVkX3Jvdy0+cmV2 ZXJzZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAgPyAody0+cGh5c19jdXJzb3IuaHBvcyA8 IDApCisgICAgICAgICAgICAgICAgICAgICAgICA6ICh3LT5waHlzX2N1cnNvci5ocG9zID49IGRl c2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pKSkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgICAgdy0+cGh5c19jdXJzb3Jfb25fcCA9IDA7CisgICAgICAgICAgICAgICAg ICAgIHhsaW0gPSAtMTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICAgICAgeGxpbSA9IGN1cnJlbnRfcm93LT5waXhlbF93aWR0aDsK KyAgICAgICAgICAgICAgICBpZiAoZHJhd19wKQorICAgICAgICAgICAgICAgICAgcmlmLT5jbGVh cl9lbmRfb2ZfbGluZSAodywgdXBkYXRlZF9yb3csIFRFWFRfQVJFQSwgeGxpbSk7CisgICAgICAg ICAgICAgICAgY2xlYXJfdG9feCA9IHhsaW07CisgICAgICAgICAgICAgICAgY2hhbmdlZF9wID0g MTsKKyAgICAgICAgICAgICAgfQorCisgICAgICAgIGlmIChjaGFuZ2VkX3AKKyAgICAgICAgICAg ICYmIGNsZWFyX3RvX3ggIT0gMCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpbnQgdGV4dF9h cmVhX3dpZHRoID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAg IHN0cnVjdCBtY19SR0IgZGVidWdfZmcgPSB7LnJlZCA9IDAuODY3LCAuZ3JlZW4gPSAwLjg2Nywg LmJsdWUgPSAwLjg2N307CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnRhcmdldF9nbHlwaCA9 CisgICAgICAgICAgICAgIHVwZGF0ZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHVwZGF0ZWRf cm93LT51c2VkW1RFWFRfQVJFQV0gLSAxOworICAgICAgICAgICAgLyogYG1jX2VuZ2luZScgb25s eSBkcmF3cyBhbiBNQ19HTFlQSCB3aGVuIHggPCB1cGRhdGVkX3Jvdy0+cGl4ZWxfd2lkdGguCisg ICAgICAgICAgICBUaGUgY3VycmVudCBkZXNpZ24gaW5oaWJpdHMgZHJhd2luZyBvdmVyIGFuIGV4 aXN0aW5nIGdseXBoIGF0IHRoZSBlbmQgb2YgYQorICAgICAgICAgICAgd29yZC13cmFwcGVkIGxp bmUuICBTYWlkIGdseXBoIHJlY2VpdmVzIGEgZmFrZSBjdXJzb3IgaW4gZWl0aGVyIG9uZSBvZiB0 aGUKKyAgICAgICAgICAgIHByZXZpb3VzIHNlY3Rpb25zIGFib3ZlLCBhbmQgc2hvdWxkIG5vdCBi ZSBvdmVyd3JpdHRlbiB3aXRoIGFub3RoZXIgb25lLgorICAgICAgICAgICAgVGhpcyBkZXNpZ24g aXMgbmVlZGVkIGJlY2F1c2UgYSB3b3JkLXdyYXBwZWQgbGluZSBkb2VzIG5vdCByZWNlaXZlIGFu IGV4dHJhCisgICAgICAgICAgICBzcGFjZSBsaWtlIG5vbi13b3JkLXdyYXBwZWQgbGluZXMgZG8u ICovCisgICAgICAgICAgICBpbnQgeCA9IHVwZGF0ZWRfcm93LT5waXhlbF93aWR0aDsKKyAgICAg ICAgICAgIGludCBocG9zID0gdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDE7CisgICAg ICAgICAgICBpbnQgeF9saW1pdCA9IChjbGVhcl90b194ID09IC0xKQorICAgICAgICAgICAgICAg ICAgICAgICAgICA/IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICA6 IGNsZWFyX3RvX3g7CisgICAgICAgICAgICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAody0+ Y29udGVudHMpOworICAgICAgICAgICAgYm9vbCBmaWxsX2NvbHVtbl90cnVtcHNfcCA9ICghTklM UCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgZmNfdmlzaWJsZSkpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID09IGVzc2Vu dGlhbHMuZmNfeCk7CisgICAgICAgICAgICBpZiAobWNfc3RkZXJyX3ApCisgICAgICAgICAgICAg IGZwcmludGYgKHN0ZGVyciwgIm1jX3VwZGF0ZV90ZXh0X2FyZWEgKGZsb2F0aW5nKTogIHZwb3Mg KCVkKSB8IHhfbGltaXQgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2 cG9zLCB4X2xpbWl0KTsKKyAgICAgICAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAg ICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgZmNfdmlzaWJsZSkpCisgICAgICAgICAg ICAgICAgJiYgKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgfHwgKCFl c3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZB UiAoYiwgZmNfaW5hY3RpdmVfd2luZG93cykpKSkKKyAgICAgICAgICAgICAgICAmJiB4IDwgdGV4 dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID49IHgKKyAg ICAgICAgICAgICAgICAmJiB0YXJnZXRfZ2x5cGggIT0gTlVMTAorICAgICAgICAgICAgICAgICYm IGRyYXdfcCkKKyAgICAgICAgICAgICAgbWNfZW5naW5lICh3LCBkZXNpcmVkX21hdHJpeCwgdXBk YXRlZF9yb3csIHRhcmdldF9nbHlwaCwgVEVYVF9BUkVBLAorICAgICAgICAgICAgICAgICAgICAg ICAgIHgsIHhfbGltaXQsIHVwZGF0ZWRfcm93LT55LCBocG9zLCB2cG9zLCBNQ19CQVIsIDEsCisg ICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bv c2l0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgIGRlYnVnX3AgPyBkZWJ1Z19mZyA6IGVz c2VudGlhbHMuZmNfZmdbcm93X3Bvc2l0aW9uXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBG SUxMX0NPTFVNTiwgZHJhd19wLCBOT1dIRVJFLCBOT19DQUNIRSk7CisgICAgICAgICAgICBpZiAo QlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIs IGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9ob3Jp em9udGFsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAmJiAoZXNzZW50aWFscy5hY3RpdmVfcAor ICAgICAgICAgICAgICAgICAgICB8fCAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAg ICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkpKQor ICAgICAgICAgICAgICAgICYmIHggPCB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAm JiB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICAgICAgJiYgdGFyZ2V0X2dseXBo ICE9IE5VTEwKKyAgICAgICAgICAgICAgICAmJiBkcmF3X3ApCisgICAgICAgICAgICAgIG1jX2Vu Z2luZSAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRfZ2x5cGgsIFRFWFRf QVJFQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICB4LCB4X2xpbWl0LCB1cGRhdGVkX3Jvdy0+ eSwgaHBvcywgdnBvcywgTUNfSEJBUiwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBjdXJz b3JfbWF0cml4LCBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sCisgICAgICAgICAgICAgICAgICAg ICAgICAgZGVidWdfcCA/IGRlYnVnX2ZnIDogZXNzZW50aWFscy5jaF9mZ1tyb3dfcG9zaXRpb25d LAorICAgICAgICAgICAgICAgICAgICAgICAgIEhPUklaT05UQUxfUlVMRVIsIGRyYXdfcCwgTk9X SEVSRSwgTk9fQ0FDSEUpOworICAgICAgICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQor ICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAg ICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAg ICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgIHx8ICgh ZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJW QVIgKGIsIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkpCisgICAgICAgICAgICAgICAgJiYgIWZpbGxf Y29sdW1uX3RydW1wc19wCisgICAgICAgICAgICAgICAgJiYgeCA8IHRleHRfYXJlYV93aWR0aAor ICAgICAgICAgICAgICAgICYmIHZwb3MgIT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAgICAgICAg ICAmJiB3LT5jdXJzb3IueCA+PSB4CisgICAgICAgICAgICAgICAgJiYgdGFyZ2V0X2dseXBoICE9 IE5VTEwKKyAgICAgICAgICAgICAgICAmJiBkcmF3X3ApCisgICAgICAgICAgICAgIG1jX2VuZ2lu ZSAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRfZ2x5cGgsIFRFWFRfQVJF QSwKKyAgICAgICAgICAgICAgICAgICAgICAgICB4LCB4X2xpbWl0LCB1cGRhdGVkX3Jvdy0+eSwg aHBvcywgdnBvcywgTUNfQkFSLCAxLAorICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9t YXRyaXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAg ICBkZWJ1Z19wID8gZGVidWdfZmcgOiBlc3NlbnRpYWxzLmNoX2ZnW3Jvd19wb3NpdGlvbl0sCisg ICAgICAgICAgICAgICAgICAgICAgICAgVkVSVElDQUxfUlVMRVIsIGRyYXdfcCwgTk9XSEVSRSwg Tk9fQ0FDS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4dF9h cmVhICh3LCBkZXNpcmVkX3JvdywgdnBvcywgY3Vyc29yX21hdHJpeCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscywgZHJhd19wKTsKKyAgICAg IC8qIFVwZGF0ZSB0aGUgZGlzcGxheSBvZiB0aGUgdGV4dCBhcmVhLiAqLworICAgICAgaWYgKHVw ZGF0ZWRfcCkKKyAgICAgICAgeworICAgICAgICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAgICAg aWYgKGN1cnJlbnRfcm93LT5tb3VzZV9mYWNlX3ApCisgICAgICAgICAgICAqbW91c2VfZmFjZV9v dmVyd3JpdHRlbl9wID0gMTsKKyAgICAgICAgfQorICAgICAgLyogVXBkYXRlIGRpc3BsYXkgb2Yg dGhlIHJpZ2h0IG1hcmdpbiBhcmVhLCBpZiB0aGVyZSBpcyBvbmUuICovCisgICAgICBpZiAoIWRl c2lyZWRfcm93LT5mdWxsX3dpZHRoX3AgJiYgdy0+cmlnaHRfbWFyZ2luX2NvbHMgPiAwKQorICAg ICAgICB7CisgICAgICAgICAgY2hhbmdlZF9wID0gMTsKKyAgICAgICAgICB1cGRhdGVfbWFyZ2lu YWxfYXJlYSAodywgZGVzaXJlZF9yb3csIFJJR0hUX01BUkdJTl9BUkVBLCB2cG9zKTsKKyAgICAg ICAgfQorICAgICAgLyogRHJhdyB0cnVuY2F0aW9uIG1hcmtzIGV0Yy4gKi8KKyAgICAgIGlmICgh Y3VycmVudF9yb3ctPmVuYWJsZWRfcAorICAgICAgICAgIHx8IGRlc2lyZWRfcm93LT55ICE9IGN1 cnJlbnRfcm93LT55CisgICAgICAgICAgfHwgZGVzaXJlZF9yb3ctPnZpc2libGVfaGVpZ2h0ICE9 IGN1cnJlbnRfcm93LT52aXNpYmxlX2hlaWdodAorICAgICAgICAgIHx8IGRlc2lyZWRfcm93LT5j dXJzb3JfaW5fZnJpbmdlX3AgIT0gY3VycmVudF9yb3ctPmN1cnNvcl9pbl9mcmluZ2VfcAorICAg ICAgICAgIHx8IGRlc2lyZWRfcm93LT5vdmVybGF5X2Fycm93X2JpdG1hcCAhPSBjdXJyZW50X3Jv dy0+b3ZlcmxheV9hcnJvd19iaXRtYXAKKyAgICAgICAgICB8fCBjdXJyZW50X3Jvdy0+cmVkcmF3 X2ZyaW5nZV9iaXRtYXBzX3AKKyAgICAgICAgICB8fCBkZXNpcmVkX3Jvdy0+bW9kZV9saW5lX3Ag IT0gY3VycmVudF9yb3ctPm1vZGVfbGluZV9wCisgICAgICAgICAgfHwgZGVzaXJlZF9yb3ctPmV4 YWN0X3dpbmRvd193aWR0aF9saW5lX3AgIT0gY3VycmVudF9yb3ctPmV4YWN0X3dpbmRvd193aWR0 aF9saW5lX3AKKyAgICAgICAgICB8fCAoTUFUUklYX1JPV19DT05USU5VQVRJT05fTElORV9QIChk ZXNpcmVkX3JvdykKKyAgICAgICAgICAgICAgIT0gTUFUUklYX1JPV19DT05USU5VQVRJT05fTElO RV9QIChjdXJyZW50X3JvdykpKQorICAgICAgICByaWYtPmFmdGVyX3VwZGF0ZV93aW5kb3dfbGlu ZV9ob29rICh3LCBkZXNpcmVkX3Jvdyk7CisgICAgfQorICAvKiBVcGRhdGUgY3VycmVudF9yb3cg ZnJvbSBkZXNpcmVkX3Jvdy4gKi8KKyAgbWFrZV9jdXJyZW50ICh3LT5kZXNpcmVkX21hdHJpeCwg dy0+Y3VycmVudF9tYXRyaXgsIHZwb3MpOworICByZXR1cm4gY2hhbmdlZF9wOworfQorCit2b2lk CittY191cGRhdGVfd2luZG93X2VyYXNlIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgbWNfbWF0 cml4IG9sZF9tYXRyaXgpCit7CisgIGJvb2wgZGVidWdfcCA9IGZhbHNlOworICBib29sIGdvX29u ZV9wID0gKG9sZF9tYXRyaXguY3Vyc29yc191c2VkW01DX0NBQ0hFXSA+IDAKKyAgICAgICAgICAg ICAgICAgICB8fCBvbGRfbWF0cml4LmN1cnNvcnNfdXNlZFtDSF9DQUNIRV0gPiAwCisgICAgICAg ICAgICAgICAgICAgfHwgb2xkX21hdHJpeC5jdXJzb3JzX3VzZWRbRkNfQ0FDSEVdID4gMCk7Cisg IGJvb2wgZ29fdHdvX3AgPSAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAg ICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQor ICAgICAgICAgICAgICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKSk7CisgIGJvb2wgdXBkYXRpbmdfZnJh bWVfcCA9IGZhbHNlOworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAg aWYgKFhGUkFNRSAody0+ZnJhbWUpICE9IGYtPm1jX3VwZGF0aW5nX2ZyYW1lCisgICAgICAmJiAo Z29fb25lX3AgfHwgZ29fdHdvX3ApKQorICAgIHsKKyAgICAgIHVwZGF0aW5nX2ZyYW1lX3AgPSB0 cnVlOworICAgICAgdXBkYXRlX2JlZ2luIChmKTsKKyAgICB9CisgIGlmICh3LT5waHlzX2N1cnNv cl9vbl9wCisgICAgICAmJiBnb190d29fcCkKKyAgICBlcmFzZV9waHlzX2N1cnNvciAodyk7Cisg IGZvciAoaW50IHZudGggPSAwOworICAgICAgIGdvX29uZV9wCisgICAgICAgJiYgdm50aCA8IHct Pm1jX21hdHJpeC52cG9zX3VzZWQ7CisgICAgICAgKyt2bnRoKQorICAgIHsKKyAgICAgIGZvciAo ZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICAgICAgY2Fj aGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICAgICArK2NhY2hlX3R5cGUpCisgICAgICAgIGZv ciAoaW50IG50aF8wID0gMDsKKyAgICAgICAgICAgICBtY190cmF2ZXJzZV9jYWNoZV9wIChvbGRf bWF0cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGhfMCk7CisgICAgICAgICAgICAgKytudGhfMCkK KyAgICAgICAgICB7CisgICAgICAgICAgICBib29sIHNhbWVfcCA9IGZhbHNlOworICAgICAgICAg ICAgZm9yIChpbnQgd19udGggPSAwOyB3X250aCA8IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlX3VzZWRbY2FjaGVfdHlwZV07ICsrd19udGgpCisgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICBzYW1lX3AgfD0gKG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMF0uZ2x5cGgudHlwZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgudHlwZQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgKChvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLmJ5dGVwb3MKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b d19udGhdLmdseXBoLmJ5dGVwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwg KG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0ucm93X3Bvc2l0 aW9uID09IEFUX1pWCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5yb3dfcG9zaXRpb24g PT0gQVRfWlYpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0ucm93X3Bvc2l0aW9uID09IFBPU1Rf WlYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLnJvd19wb3NpdGlvbiA9PSBQT1NUX1pW KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICgob2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5jaGFycG9zCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3dfbnRoXS5nbHlwaC5jaGFycG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHx8IChvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLnJvd19w b3NpdGlvbiA9PSBBVF9aVgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0ucm93X3Bvc2l0 aW9uID09IEFUX1pWKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLnJvd19wb3NpdGlvbiA9PSBQ T1NUX1pWCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5yb3dfcG9zaXRpb24gPT0gUE9T VF9aVikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnUudmFsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W3dfbnRoXS5nbHlwaC51LnZhbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5mYWNlX2lkCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5mYWNlX2lkCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBd LmdseXBoLnBhZGRpbmdfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgucGFkZGluZ19w CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLmxlZnRfYm94X2xpbmVfcAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVt3X250aF0uZ2x5cGgubGVmdF9ib3hfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmds eXBoLnJpZ2h0X2JveF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnJpZ2h0 X2JveF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGgudm9mZnNldAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVt3X250aF0uZ2x5cGgudm9mZnNldAorICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5w aXhlbF93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgucGl4ZWxfd2lkdGgKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMF0uZ2x5cGguc2xpY2UuaW1nLngKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19u dGhdLmdseXBoLnNsaWNlLmltZy54CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnNsaWNlLmlt Zy55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5pbWcueQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS5nbHlwaC5zbGljZS5pbWcud2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhd LmdseXBoLnNsaWNlLmltZy53aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5zbGljZS5p bWcuaGVpZ2h0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5pbWcuaGVpZ2h0 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnNsaWNlLmNtcC5mcm9tCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5jbXAuZnJvbQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS54Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3dfbnRoXS54CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZ4CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3dfbnRoXS5meAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS55CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3dfbnRoXS55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZ5CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3df bnRoXS5meQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5ocG9zCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRo XS5ocG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLnZwb3MKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhd LnZwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0ud2QKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLndk CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzBdLmgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmgKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMF0uY3Vyc29yX3R5cGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmN1cnNv cl90eXBlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmN1cnNvcl93aWR0aAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVt3X250aF0uY3Vyc29yX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZnLnJlZAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVt3X250aF0uZmcucmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZnLmdyZWVuCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5mZy5ncmVlbgorICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5mZy5i bHVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5mZy5ibHVlCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBd LmJnLnJlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uYmcucmVkCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XzBdLmJnLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5iZy5ncmVlbgorICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS5iZy5ibHVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5iZy5ibHVlCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzBdLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09 IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5hY3RpdmVf cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaF9mbGF2b3IKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19u dGhdLmdseXBoX2ZsYXZvcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5lbmFibGVkX3AKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bd19udGhdLmVuYWJsZWRfcCk7CisgICAgICAgICAgICAgICAgaWYgKHNhbWVfcCkK KyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGRlYnVnX3ApCisg ICAgICAgICAgICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiSElUICglcyk6ICB2cG9zICgl ZCkgfCBocG9zICglZCkgfCBjaGFyICglcylcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAoY2FjaGVfdHlwZSA9PSBNQ19DQUNIRSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyAiTUMiCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IChjYWNoZV90eXBlID09IENIX0NBQ0hFKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/ICJDSCIKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogKGNhY2hlX3R5cGUgPT0gRkNfQ0FDSEUpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gIkZDIgorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiAiTk8iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhd LnZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uaHBvcywKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nICh3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgudS5jaCkpOworICAg ICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVt3X250aF0uc2FtZV9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAg ICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmIChkZWJ1Z19wKQorICAg ICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgaW50IG9sZF9jYWNoZV91 c2VkID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV07CisgICAg ICAgICAgICAgICAgICAgICAgaW50IG5ld19jYWNoZV91c2VkID0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXTsKKyAgICAgICAgICAgICAgICAgICAgICBmcHJp bnRmIChzdGRlcnIsICJNSVNTICglcyk6ICB2cG9zICglZCkgfCBocG9zICglZCB2LiAlZCkgfCBj aGFyICglcyB2LiAlcykgfCBjYWNoZV91c2VkICglZCB2LiAlZClcbiIsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAoY2FjaGVfdHlwZSA9PSBNQ19DQUNIRSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAiTUMiCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjYWNoZV90eXBlID09IENIX0NBQ0hFKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICJDSCIKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGNhY2hlX3R5cGUgPT0gRkNfQ0FDSEUpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gIkZDIgorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiTk8iLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bd19udGhdLnZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmhwb3MsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uaHBvcywKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nIChvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnUuY2gpLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgbWNfY2hhcl90b19zdHJpbmcgKHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC51LmNoKSwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9sZF9jYWNoZV91c2VkLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2NhY2hlX3VzZWQpOworICAgICAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICghc2FtZV9wKQor ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogYG1hdHJpeF9yb3cnIGluIGBkaXNw bmV3LmNgIGNvbnRhaW5zIHRoZSBmb2xsb3dpbmcgdGVzdHMsCisgICAgICAgICAgICAgICAgZWFz c2VydCAobWF0cml4ICYmIG1hdHJpeC0+cm93cyk7CisgICAgICAgICAgICAgICAgZWFzc2VydCAo cm93ID49IDAgJiYgcm93IDwgbWF0cml4LT5ucm93cyk7ICovCisgICAgICAgICAgICAgICAgYm9v bCBiYXJmX2NyYXNoX29uZSA9ICh3LT5jdXJyZW50X21hdHJpeCAmJiB3LT5jdXJyZW50X21hdHJp eC0+cm93cykgPyBmYWxzZSA6IHRydWU7CisgICAgICAgICAgICAgICAgaWYgKGJhcmZfY3Jhc2hf b25lKQorICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgYm9vbCBi YXJmX2NyYXNoX3R3byA9ICh2bnRoID49IDAgJiYgdm50aCA8IHctPmN1cnJlbnRfbWF0cml4LT5u cm93cykgPyBmYWxzZSA6IHRydWU7CisgICAgICAgICAgICAgICAgaWYgKGJhcmZfY3Jhc2hfdHdv KQorICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgc3RydWN0IGds eXBoX3JvdyAqdm50aF9yb3cgPSBNQVRSSVhfUk9XICh3LT5jdXJyZW50X21hdHJpeCwgdm50aCk7 CisgICAgICAgICAgICAgICAgaW50IHhfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMF0ueDsKKyAgICAgICAgICAgICAgICBpbnQgZnhfMCA9IG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZng7CisgICAgICAgICAgICAg ICAgaW50IHlfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhf MF0ueTsKKyAgICAgICAgICAgICAgICBpbnQgZnlfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZnk7CisgICAgICAgICAgICAgICAgaW50IGhwb3NfMCA9 IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uaHBvczsKKyAg ICAgICAgICAgICAgICBpbnQgdnBvc18wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8wXS52cG9zOworICAgICAgICAgICAgICAgIGludCB3ZF8wID0gb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS53ZDsKKyAgICAgICAgICAg ICAgICBpbnQgaF8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8wXS5oOworICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGVf MCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uY3Vyc29y X3R5cGU7CisgICAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aF8wID0gb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5jdXJzb3Jfd2lkdGg7CisgICAgICAg ICAgICAgICAgLy8gIHN0cnVjdCBtY19SR0IgbHNsX2ZnXzAgPSB7LnJlZCA9IG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZmcucmVkLAorICAgICAgICAgICAg ICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZmcuZ3JlZW4sCisgICAgICAgICAgICAg ICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZnLmJsdWV9OworICAgICAgICAgICAgICAg IHN0cnVjdCBtY19SR0IgbHNsX2JnXzAgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMF0uYmcucmVkLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgLmdyZWVuID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8wXS5iZy5ncmVlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIC5ibHVlID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS5iZy5ibHVlfTsKKyAgICAgICAgICAgICAgICBib29sIGFjdGl2ZV9wXzAgPSBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmFjdGl2ZV9wOwor ICAgICAgICAgICAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvcl8wID0gb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaF9mbGF2b3I7CisgICAg ICAgICAgICAgICAgYm9vbCBlbmFibGVkX3BfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMF0uZW5hYmxlZF9wOworICAgICAgICAgICAgICAgIGlmICh2cG9z XzAgPT0gdm50aAorICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3JfMCA9PSBNQ19H TFlQSAorICAgICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3BfMAorICAgICAgICAgICAgICAg ICAgICAmJiB2bnRoX3Jvdy0+ZW5hYmxlZF9wKQorICAgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgICBtY19lcmFzZV9jdXJzb3IgKHcsIHctPmN1cnJlbnRfbWF0cml4LCB2bnRo X3JvdywgeF8wLCB5XzAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaHBv c18wLCB2cG9zXzAsIGdseXBoX2ZsYXZvcl8wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGN1cnNvcl90eXBlXzAsIHdkXzApOworICAgICAgICAgICAgICAgICAgICBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmVuYWJsZWRfcCA9IGZh bHNlOworICAgICAgICAgICAgICAgICAgICAtLW9sZF9tYXRyaXguY3Vyc29yc191c2VkW2NhY2hl X3R5cGVdOworICAgICAgICAgICAgICAgICAgICAvKiBJZiB3ZSBpbmFkdmVydGVudGx5IGVyYXNl ZCBhbm90aGVyIGZha2UgY3Vyc29yIGF0IHRoZSBzYW1lCisgICAgICAgICAgICAgICAgICAgIEhQ T1MgdGhhdCBpcyBzdGlsbCBlbmFibGVkX3AgaW4gdGhlIGBvbGRfbWF0cml4YCwgdGhlbiByZWRy YXcgaXQuICovCisgICAgICAgICAgICAgICAgICAgIGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNh Y2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICBjYWNoZV90eXBl IDwgTk9fQ0FDSEU7CisgICAgICAgICAgICAgICAgICAgICAgICAgKytjYWNoZV90eXBlKQorICAg ICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IG50 aF8xID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWNfdHJhdmVyc2VfY2FjaGVf cCAob2xkX21hdHJpeCwgY2FjaGVfdHlwZSwgdm50aCwgbnRoXzEpOworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICArK250aF8xKQorICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgaW50IHhfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMV0ueDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBp bnQgZnhfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0u Zng7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHlfMSA9IG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0ueTsKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICBpbnQgZnlfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMV0uZnk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGhwb3NfMSA9IG9s ZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uaHBvczsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICBpbnQgdnBvc18xID0gb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS52cG9zOworICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGludCB3ZF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8xXS53ZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaF8xID0gb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5oOworICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGVfMSA9IG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uY3Vyc29yX3R5cGU7CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aF8xID0gb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5jdXJzb3Jfd2lkdGg7CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmdfMSA9IHsucmVkID0gb2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5mZy5yZWQsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4g PSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmZnLmdyZWVu LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg LmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmZn LmJsdWV9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBzdHJ1Y3QgbWNfUkdCIGxz bF9iZ18xID0gey5yZWQgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXzFdLmJnLnJlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAuZ3JlZW4gPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzFdLmJnLmdyZWVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8v ICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0gb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5iZy5ibHVlfTsKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICBib29sIGFjdGl2ZV9wXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzFdLmFjdGl2ZV9wOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVu dW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvcl8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF8xXS5nbHlwaF9mbGF2b3I7CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgYm9vbCBlbmFibGVkX3BfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMV0uZW5hYmxlZF9wOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJv b2wgZ29fcF8xID0gKGhwb3NfMCA9PSBocG9zXzEKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3BfMSk7CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgaWYgKCFnb19wXzEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51 ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIHJlbW92ZV9wXzEgPSBmYWxzZTsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgdy0+ Y3VycmVudF9tYXRyaXgsIHZudGhfcm93LCB4XzEsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGZ4XzEsIHlfMSwgZnlfMSwgaHBvc18xLCB2cG9zXzEs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdkXzEs IGhfMSwgY3Vyc29yX3R5cGVfMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoXzEsIGxzbF9mZ18xLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVfcF8xLCBnbHlwaF9mbGF2 b3JfMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg cmVtb3ZlX3BfMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlm ICh2cG9zXzAgPT0gdm50aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9w XzAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHZudGhfcm93LT5lbmFibGVkX3ApCisg ICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBib29sIHJlbW92ZV9w XzAgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3 LCB3LT5jdXJyZW50X21hdHJpeCwgdm50aF9yb3csIHhfMCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgZnhfMCwgeV8wLCBmeV8wLCBocG9zXzAsIHZwb3NfMCwg d2RfMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaF8wLCBj dXJzb3JfdHlwZV8wLCBjdXJzb3Jfd2lkdGhfMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgbHNsX2JnXzAsIGFjdGl2ZV9wXzAsIGdseXBoX2ZsYXZvcl8wLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVfcF8wKTsK KyAgICAgICAgICAgICAgICAgICAgICBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXzBdLmVuYWJsZWRfcCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgIC0t b2xkX21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVfdHlwZV07CisgICAgICAgICAgICAgICAgICAg ICAgLyogSWYgd2UgaW5hZHZlcnRlbnRseSBlcmFzZWQgYW5vdGhlciBmYWtlIGN1cnNvciBhdCB0 aGUgc2FtZQorICAgICAgICAgICAgICAgICAgICAgIEhQT1MgdGhhdCBpcyBzdGlsbCBlbmFibGVk X3AgaW4gdGhlIGBvbGRfbWF0cml4YCwgdGhlbiByZWRyYXcgaXQuICovCisgICAgICAgICAgICAg ICAgICAgICAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAg ICAgICAgICAgICAgICAgICAgICAgKytjYWNoZV90eXBlKQorICAgICAgICAgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBudGhfMiA9IDA7CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgbWNfdHJhdmVyc2VfY2FjaGVfcCAob2xkX21hdHJp eCwgY2FjaGVfdHlwZSwgdm50aCwgbnRoXzIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICsrbnRoXzIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgaW50IHhfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMl0ueDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBm eF8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5meDsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB5XzIgPSBvbGRfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLnk7CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBpbnQgZnlfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMl0uZnk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaHBvc18yID0g b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5ocG9zOworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHZwb3NfMiA9IG9sZF9tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0udnBvczsKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGludCB3ZF8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8yXS53ZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBoXzIgPSBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmg7CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlXzIg PSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmN1cnNvcl90 eXBlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aF8yID0g b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5jdXJzb3Jfd2lk dGg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZ18y ID0gey5yZWQgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJd LmZnLnJlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgLmdyZWVuID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF8yXS5mZy5ncmVlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgLmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzJdLmZnLmJsdWV9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg Ly8gIHN0cnVjdCBtY19SR0IgbHNsX2JnXzIgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uYmcucmVkLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5iZy5ncmVlbiwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVl ID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5iZy5ibHVl fTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgYWN0aXZlX3BfMiA9IG9sZF9t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uYWN0aXZlX3A7CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3JfMiA9 IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uZ2x5cGhfZmxh dm9yOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBlbmFibGVkX3BfMiA9IG9s ZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uZW5hYmxlZF9wOwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBnb19wXzIgPSAoaHBvc18wID09IGhw b3NfMgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZnhf MCA8PSBmeF8yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBmeF8wICsgd2RfMCA+IGZ4XzIgKyB3ZF8yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3BfMik7CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBpZiAoIWdvX3BfMikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29u dGludWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIHJlbW92ZV9wXzIgPSBm YWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlk ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgdm50aF9yb3csIHhfMiwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmeF8yLCB5XzIsIGZ5XzIsIGhwb3Nf MiwgdnBvc18yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHdkXzIsIGhfMiwgY3Vyc29yX3R5cGVfMiwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGhfMiwgbHNsX2ZnXzIsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0aXZl X3BfMiwgZ2x5cGhfZmxhdm9yXzIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgcmVtb3ZlX3BfMik7CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICB9CisgIGlmICh1cGRhdGluZ19mcmFt ZV9wKQorICAgIHVwZGF0ZV9lbmQgKGYpOworfQorCit2b2lkCittY191cGRhdGVfd2luZG93X2Ry eXJ1biAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wLCBzdHJ1Y3QgbWNfZXNzZW50aWFs cyBlc3NlbnRpYWxzKQoreworICBpZiAoIUJVRkZFUlAgKHctPmNvbnRlbnRzKSkKKyAgICByZXR1 cm47CisKKyAgaWYgKHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbTUNfQ0FDSE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93ICplbmQgPSBNQVRSSVhfTU9ERV9MSU5FX1JP VyAoZGVzaXJlZF9tYXRyaXgpOworCisgICAgICAvKiBUYWtlIG5vdGUgb2YgdGhlIGhlYWRlciBs aW5lLCBpZiB0aGVyZSBpcyBvbmUuICBXZSB3aWxsCisgICAgICAgICB1cGRhdGUgaXQgYmVsb3cs IGFmdGVyIHVwZGF0aW5nIGFsbCBvZiB0aGUgd2luZG93J3MgbGluZXMuICovCisgICAgICBpZiAo cm93LT5tb2RlX2xpbmVfcCkKKyAgICAgICAgeworICAgICAgICAgIGhlYWRlcl9saW5lX3JvdyA9 IHJvdzsKKyAgICAgICAgICArK3JvdzsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAg ICAgaGVhZGVyX2xpbmVfcm93ID0gTlVMTDsKKworICAgICAgLyogVXBkYXRlIHRoZSBtb2RlIGxp bmUsIGlmIG5lY2Vzc2FyeS4gKi8KKyAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKm1vZGVfbGluZV9y b3cgPSBNQVRSSVhfTU9ERV9MSU5FX1JPVyAoZGVzaXJlZF9tYXRyaXgpOworICAgICAgaWYgKG1v ZGVfbGluZV9yb3ctPm1vZGVfbGluZV9wICYmIG1vZGVfbGluZV9yb3ctPmVuYWJsZWRfcCkKKyAg ICAgICAgeworICAgICAgICAgIG1vZGVfbGluZV9yb3ctPnkgPSB5YiArIFdJTkRPV19TQ1JPTExf QkFSX0FSRUFfSEVJR0hUICh3KTsKKyAgICAgICAgICB1cGRhdGVfd2luZG93X2xpbmUgKHcsIE1B VFJJWF9ST1dfVlBPUyAobW9kZV9saW5lX3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgZGVzaXJlZF9tYXRyaXgpLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCk7CisgICAgICAgIH0KKwor ICAgICAgLyogRmluZCBmaXJzdCBlbmFibGVkIHJvdy4gIE9wdGltaXphdGlvbnMgaW4gcmVkaXNw bGF5X2ludGVybmFsCisgICAgICAgICBtYXkgbGVhZCB0byBhbiB1cGRhdGUgd2l0aCBvbmx5IG9u ZSByb3cgZW5hYmxlZC4gIFRoZXJlIG1heQorICAgICAgICAgYmUgYWxzbyBjb21wbGV0ZWx5IGVt cHR5IG1hdHJpY2VzLiAqLworICAgICAgd2hpbGUgKHJvdyA8IGVuZCAmJiAhcm93LT5lbmFibGVk X3ApCisgICAgICAgICsrcm93OworCisgICAgICAvKiBUcnkgcmV1c2luZyBwYXJ0IG9mIHRoZSBk aXNwbGF5IGJ5IGNvcHlpbmcuICovCisgICAgICBpZiAocm93IDwgZW5kICYmICF3LT5kZXNpcmVk X21hdHJpeC0+bm9fc2Nyb2xsaW5nX3ApCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgcmMgPSBt Y19zY3JvbGxpbmdfd2luZG93ICh3LCBoZWFkZXJfbGluZV9yb3cgIT0gTlVMTCk7CisgICAgICAg ICAgaWYgKHJjIDwgMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogQWxsIHJvd3Mg d2VyZSBmb3VuZCB0byBiZSBlcXVhbC4gKi8KKyAgICAgICAgICAgICAgcGF1c2VkX3AgPSAwOwor ICAgICAgICAgICAgICBnb3RvIHNldF9jdXJzb3I7CisgICAgICAgICAgICB9CisgICAgICAgICAg ICBlbHNlIGlmIChyYyA+IDApCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBX ZSd2ZSBzY3JvbGxlZCB0aGUgZGlzcGxheS4gKi8KKyAgICAgICAgICAgICAgICBmb3JjZV9wID0g MTsKKyAgICAgICAgICAgICAgICBjaGFuZ2VkX3AgPSAxOworICAgICAgICAgICAgICB9CisgICAg ICAgIH0KKyAgICAgIC8qIFByb2Nlc3MgdGhlIGN1cnNvciByb3cgYXQgdGhlIG91dHNldCBpZiBp dCBpcyB3aXRoaW4gYGRlc2lyZWRfbWF0cml4YC4KKyAgICAgIFdoZW4gcHJvY2Vzc2luZyBhbGwg b3RoZXIgcm93cywgd2Ugd2lsbCBxdWVyeSB0aGUgYHctPmN1cnJlbnRfbWF0cml4YCBmb3IgZGF0 YQorICAgICAgcmVsYXRpbmcgdG8gdGhlIGN1cnNvciByb3cuICBgbWFrZV9jdXJyZW50YCAod2l0 aGluIGB1cGRhdGVfd2luZG93X2xpbmUnKQorICAgICAgdXBkYXRlcyB0aGUgYHctPmN1cnJlbnRf bWF0cml4YCBmb3IgdGhlIGFwcGxpY2FibGUgcm93LiAgSW4gZG9pbmcgc28sIGhvd2V2ZXIsCisg ICAgICB0aGUgYXBwbGljYWJsZSByb3cgaW4gdGhlIGRlc2lyZWQgbWF0cml4IGlzIGFsdGVyZWQg c3VjaCB0aGF0IHdlIGNhbiBubyBsb25nZXIKKyAgICAgIHJlbHkgdXBvbiB0aGUgYWNjdXJhY3kg b2YgYFJPVy0+dXNlZFtURVhUX0FSRUFdYC4gIFRoZXJlZm9yZSwgd2UgbXVzdCBub3cgcmVseQor ICAgICAgZXhjbHVzaXZlbHkgdXBvbiBgdy0+Y3VycmVudF9tYXRyaXgnIGZvciBjdXJzb3Igcm93 IGJhc2VkIGRlY2lzaW9ucy4gKi8KKyAgICAgIGZvciAoc3RydWN0IGdseXBoX3JvdyAqbWNfcm93 ID0gcm93OworICAgICAgICAgICBtY19yb3cgPCBlbmQgJiYgKGZvcmNlX3AgfHwgIWlucHV0X3Bl bmRpbmcpOworICAgICAgICAgICArK21jX3JvdykKKyAgICAgICAgeworICAgICAgICAgIGludCB2 cG9zID0gTUFUUklYX1JPV19WUE9TIChtY19yb3csIHctPmRlc2lyZWRfbWF0cml4KTsKKyAgICAg ICAgICBpZiAobWNfcm93LT5lbmFibGVkX3AKKyAgICAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5j dXJzb3IudnBvcykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCA9 IHctPmRlc2lyZWRfbWF0cml4OworICAgICAgICAgICAgICBpZiAoIWZvcmNlX3AgJiYgKytuX3Vw ZGF0ZWQgJSBwcmVlbXB0X2NvdW50ID09IDApCisgICAgICAgICAgICAgICAgZGV0ZWN0X2lucHV0 X3BlbmRpbmdfaWdub3JlX3NxdWVlemFibGVzICgpOworICAgICAgICAgICAgICBjaGFuZ2VkX3Ag fD0gbWNfdXBkYXRlX3dpbmRvd19saW5lICh3LCB2cG9zLCAmbW91c2VfZmFjZV9vdmVyd3JpdHRl bl9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBj dXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCBkcmF3X3ApOworICAgICAgICAgICAgICBpZiAoTUFU UklYX1JPV19CT1RUT01fWSAocm93KSA+PSB5YikKKyAgICAgICAgICAgICAgICBmb3IgKGludCBp ID0gdnBvcyArIDE7IGkgPCB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAg ICAgICAgICAgICAgICBTRVRfTUFUUklYX1JPV19FTkFCTEVEX1AgKHctPmN1cnJlbnRfbWF0cml4 LCBpLCBmYWxzZSk7CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAg ICB9CisgICAgICBjdXJzb3JfbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgICAgICAvKiBV cGRhdGUgdGhlIHJlc3Qgb2YgdGhlIGxpbmVzLiAqLworICAgICAgZm9yICg7IHJvdyA8IGVuZCAm JiAoZm9yY2VfcCB8fCAhaW5wdXRfcGVuZGluZyk7ICsrcm93KQorICAgICAgICAvKiBzY3JvbGxp bmdfd2luZG93IHJlc2V0cyB0aGUgZW5hYmxlZF9wIGZsYWcgb2YgdGhlIHJvd3MgaXQgcmV1c2Vz IGZyb20KKyAgICAgICAgY3VycmVudF9tYXRyaXguICovCisgICAgICAgIGlmIChyb3ctPmVuYWJs ZWRfcCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBP UyAocm93LCB3LT5kZXNpcmVkX21hdHJpeCk7CisgICAgICAgICAgICAvKiBJZiB0aGUgYGN1cnNv cl9yb3dgIGlzIHdpdGhpbiB0aGUgYGRlc2lyZWRfbWF0cml4YCwgdGhlbiBpdCB3YXMKKyAgICAg ICAgICAgIHByb2Nlc3NlZCBoZXJlaW5hYm92ZSBhbmQgc2hvdWxkIGJlIHNraXBwZWQgYXQgdGhp cyB0aW1lLiAqLworICAgICAgICAgICAgaWYgKHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAg ICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgIGludCBpOworICAgICAgICAgICAgLyogV2Un bGwgaGF2ZSB0byBwbGF5IGEgbGl0dGxlIGJpdCB3aXRoIHdoZW4gdG8KKyAgICAgICAgICAgICAg IGRldGVjdF9pbnB1dF9wZW5kaW5nLiAgSWYgaXQncyBkb25lIHRvbyBvZnRlbiwKKyAgICAgICAg ICAgICAgIHNjcm9sbGluZyBsYXJnZSB3aW5kb3dzIHdpdGggcmVwZWF0ZWQgc2Nyb2xsLXVwCisg ICAgICAgICAgICAgICBjb21tYW5kcyB3aWxsIHRvbyBxdWlja2x5IHBhdXNlIHJlZGlzcGxheS4g Ki8KKyAgICAgICAgICAgIGlmICghZm9yY2VfcCAmJiArK25fdXBkYXRlZCAlIHByZWVtcHRfY291 bnQgPT0gMCkKKyAgICAgICAgICAgICAgZGV0ZWN0X2lucHV0X3BlbmRpbmdfaWdub3JlX3NxdWVl emFibGVzICgpOworICAgICAgICAgICAgY2hhbmdlZF9wIHw9IG1jX3VwZGF0ZV93aW5kb3dfbGlu ZSAodywgdnBvcywgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMs IGRyYXdfcCk7CisgICAgICAgICAgICAvKiBNYXJrIGFsbCByb3dzIGJlbG93IHRoZSBsYXN0IHZp c2libGUgb25lIGluIHRoZSBjdXJyZW50CisgICAgICAgICAgICAgICBtYXRyaXggYXMgaW52YWxp ZC4gIFRoaXMgaXMgbmVjZXNzYXJ5IGJlY2F1c2Ugb2YKKyAgICAgICAgICAgICAgIHZhcmlhYmxl IGxpbmUgaGVpZ2h0cy4gIENvbnNpZGVyIHRoZSBjYXNlIG9mIHRocmVlCisgICAgICAgICAgICAg ICBzdWNjZXNzaXZlIHJlZGlzcGxheXMsIHdoZXJlIHRoZSBmaXJzdCBkaXNwbGF5cyA1CisgICAg ICAgICAgICAgICBsaW5lcywgdGhlIHNlY29uZCAzIGxpbmVzLCBhbmQgdGhlIHRoaXJkIDUgbGlu ZXMgYWdhaW4uCisgICAgICAgICAgICAgICBJZiB0aGUgc2Vjb25kIHJlZGlzcGxheSB3b3VsZG4n dCBtYXJrIHJvd3MgaW4gdGhlCisgICAgICAgICAgICAgICBjdXJyZW50IG1hdHJpeCBpbnZhbGlk LCB0aGUgdGhpcmQgcmVkaXNwbGF5IG1pZ2h0IGJlCisgICAgICAgICAgICAgICB0ZW1wdGVkIHRv IG9wdGltaXplIHJlZGlzcGxheSBiYXNlZCBvbiBsaW5lcyBkaXNwbGF5ZWQKKyAgICAgICAgICAg ICAgIGluIHRoZSBmaXJzdCByZWRpc3BsYXkuICovCisgICAgICAgICAgICBpZiAoTUFUUklYX1JP V19CT1RUT01fWSAocm93KSA+PSB5YikKKyAgICAgICAgICAgICAgZm9yIChpID0gdnBvcyArIDE7 IGkgPCB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAgICAgICAgICAgICAg U0VUX01BVFJJWF9ST1dfRU5BQkxFRF9QICh3LT5jdXJyZW50X21hdHJpeCwgaSwgZmFsc2UpOwor ICAgICAgICAgIH0KKyAgICAgIC8qIFdhcyBkaXNwbGF5IHByZWVtcHRlZD8gKi8KKyAgICAgIHBh dXNlZF9wID0gcm93IDwgZW5kOworICAgICAgc2V0X2N1cnNvcjoKKyAgICAgIC8qIElmIHdlIGp1 bXBlZCBoZXJlIGZyb20gYHNldF9jdXJzb3JgLCB0aGVuIHNldCB0aGUgYGN1cnNvcl9tYXRyaXhg LiAqLworICAgICAgaWYgKGN1cnNvcl9tYXRyaXggPT0gTlVMTCkKKyAgICAgICAgY3Vyc29yX21h dHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworICAgICAgLyogUmVzZXQgYHJvd2AgdG8gMCBzbyB0 aGF0IGZha2UgY3Vyc29ycyBjYW4gYmUgZHJhd24gb24gcm93cyBwcmVjZWRpbmcgdGhlCisgICAg ICBmaXJzdCBgcm93LT5lbmFibGVkX3BgLiAgSnVzdCBwcmlvciB0byB0aGUgY2FsbCB0byBgc2Ny b2xsaW5nX3dpbmRvdycgYWJvdmUsCisgICAgICBgcm93YCB3YXMgYWR2YW5jZWQgdG8gdGhlIGZp cnN0IGByb3ctPmVuYWJsZWRfcGAuICovCisgICAgICBmb3IgKHN0cnVjdCBnbHlwaF9yb3cgKmRl c2lyZWRfcm93ID0gTUFUUklYX1JPVyAody0+ZGVzaXJlZF9tYXRyaXgsIDApOworICAgICAgICAg ICBkZXNpcmVkX3JvdyA8IGVuZAorICAgICAgICAgICAmJiAoZm9yY2VfcCB8fCAhaW5wdXRfcGVu ZGluZykKKyAgICAgICAgICAgLyogVzMyIEVtYWNzIGNyYXNoZXMgb24gc3RhcnR1cCB3aXRob3V0 IGEgQlVGRkVSUCBjaGVjay4gKi8KKyAgICAgICAgICAgJiYgQlVGRkVSUCAody0+Y29udGVudHMp CisgICAgICAgICAgICYmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19j b25mKSkKKyAgICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIg KHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpKTsKKyAgICAgICAgICAgKytkZXNpcmVkX3JvdykK KyAgICAgICAgeworICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChkZXNpcmVk X3Jvdywgdy0+ZGVzaXJlZF9tYXRyaXgpOworICAgICAgICAgIGlmIChkZXNpcmVkX3Jvdy0+ZW5h YmxlZF9wKQorICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgc3RydWN0IGdseXBoX3Jv dyAqY3VycmVudF9yb3cgPSBNQVRSSVhfUk9XICh3LT5jdXJyZW50X21hdHJpeCwgdnBvcyk7Cisg ICAgICAgICAgZW51bSBtY19yb3dfcG9zaXRpb24gcm93X3Bvc2l0aW9uID0gbWNfcm93X3Bvc2l0 aW9uICh3LCBjdXJyZW50X3JvdywgY3VycmVudF9yb3csIHZwb3MpOworICAgICAgICAgIGlmIChj dXJyZW50X3Jvdy0+ZW5hYmxlZF9wKQorICAgICAgICAgICAgbWNfZHJhd19yb3cgKHcsIHctPmN1 cnJlbnRfbWF0cml4LCBjdXJyZW50X3JvdywgY3VycmVudF9yb3ctPmdseXBoc1tURVhUX0FSRUFd LAorICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRfcm93LT54LCBjdXJyZW50X3Jvdy0+ dXNlZFtURVhUX0FSRUFdLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9t YXRyaXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgZHJhd19wLAorICAgICAgICAgICAgICAg ICAgICAgICAgIFNFVF9DVVJTT1JfT05FKTsKKyAgICAgICAgfQorCisgICAgICBtY19yZXN0b3Jl X2dseXBoX21hdHJpeCAoc2F2ZWRfZGVzaXJlZCwgdy0+ZGVzaXJlZF9tYXRyaXgpOworICAgICAg bWNfcmVzdG9yZV9nbHlwaF9tYXRyaXggKHNhdmVkX2N1cnJlbnQsIHctPmN1cnJlbnRfbWF0cml4 KTsKKworICAgICAgbWNfdXBkYXRlX3dpbmRvd19lcmFzZSAodywgb2xkX21hdHJpeCk7CisKKyAg ICAgIG1jX3hmcmVlX2NhY2hlX21hdHJpeCAodywgJm9sZF9tYXRyaXgpOworCisgICAgfQorICAv LyBjbG9ja190IGNsb2NrX2VuZCA9IGNsb2NrKCk7CisgIC8vIGRvdWJsZSBjcHVfdGltZV91c2Vk ID0gKChkb3VibGUpIChjbG9ja19lbmQgLSBjbG9ja19zdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7 CisgIC8vIGZwcmludGYgKHN0ZGVyciwgIm1jX3Njcm9sbGluZ193aW5kb3cgKCVzKTogIFRJTUUg KCVmKVxuIiwgbWNfd2luZG93ICh3KSwgY3B1X3RpbWVfdXNlZCk7Cit9CisKKy8qIGVuZCBNVUxU SVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBTdHJ1Y3R1 cmUgdG8gcGFzcyBkaW1lbnNpb25zIGFyb3VuZC4gIFVzZWQgZm9yIGNoYXJhY3RlciBib3VuZGlu ZwogICAgYm94ZXMsIGdseXBoIG1hdHJpeCBkaW1lbnNpb25zIGFuZCBhbGlrZS4gICovCiAKQEAg LTIyNDEsNiArNDAxNywxNiBAQCBmcmVlX3dpbmRvd19tYXRyaWNlcyAoc3RydWN0IHdpbmRvdyAq dykKIAkgIGZyZWVfZ2x5cGhfbWF0cml4ICh3LT5jdXJyZW50X21hdHJpeCk7CiAJICBmcmVlX2ds eXBoX21hdHJpeCAody0+ZGVzaXJlZF9tYXRyaXgpOwogCSAgdy0+Y3VycmVudF9tYXRyaXggPSB3 LT5kZXNpcmVkX21hdHJpeCA9IE5VTEw7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisv KiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgbWNfeGZyZWVfY2FjaGVfbWF0cml4ICh3LCAmdy0+ bWNfbWF0cml4KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCX0KIAogICAgICAg LyogTmV4dCB3aW5kb3cgb24gc2FtZSBsZXZlbC4gICovCkBAIC0zMzg3LDYgKzUxNzMsMjYgQEAg Y2hlY2tfY3VycmVudF9tYXRyaXhfZmxhZ3MgKHN0cnVjdCB3aW5kb3cgKncpCiBzdGF0aWMgYm9v bAogdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wKQogeworCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlm IChtY19zdGRlcnJfcCkKKyAgICBmcHJpbnRmIChzdGRlcnIsICJ1cGRhdGVfd2luZG93ICglcylc biIsIG1jX3dpbmRvdyAodykpOworCisgIHN0cnVjdCBtY19lc3NlbnRpYWxzIGVzc2VudGlhbHM7 CisgIG1jX3NldF9lc3NlbnRpYWxzICh3LCAmZXNzZW50aWFscyk7CisKKyAgbWNfdXBkYXRlX3dp bmRvd19kcnlydW4gKHcsIGZvcmNlX3AsIGVzc2VudGlhbHMpOworCisgIHN0cnVjdCBnbHlwaF9t YXRyaXggKmN1cnNvcl9tYXRyaXggPSBOVUxMOworCisgIGJvb2wgZHJhd19wID0gdHJ1ZTsKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBzdHJ1Y3QgZ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hjbHVzaXZlbHkgdXBvbiBgdy0+Y3VycmVudF9tYXRyaXgnIGZvciBjdXJzb3Igcm93 IGJhc2VkIGRlY2lzaW9ucy4gKi8KKyAgZm9yIChzdHJ1Y3QgZ2x5cGhfcm93ICptY19yb3cgPSBy b3c7CisgICAgICAgbWNfcm93IDwgZW5kICYmIChmb3JjZV9wIHx8ICFpbnB1dF9wZW5kaW5nKTsK KyAgICAgICArK21jX3JvdykKKyAgICB7CisgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBP UyAobWNfcm93LCBkZXNpcmVkX21hdHJpeCk7CisgICAgICBpZiAobWNfcm93LT5lbmFibGVkX3AK KyAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zKQorICAgICAgICB7CisgICAgICAg ICAgY3Vyc29yX21hdHJpeCA9IGRlc2lyZWRfbWF0cml4OworICAgICAgICAgIGlmICghZm9yY2Vf cCAmJiArK25fdXBkYXRlZCAlIHByZWVtcHRfY291bnQgPT0gMCkKKyAgICAgICAgICAgIGRldGVj dF9pbnB1dF9wZW5kaW5nX2lnbm9yZV9zcXVlZXphYmxlcyAoKTsKKyAgICAgICAgICBjaGFuZ2Vk X3AgfD0gKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYg KCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICEgTklMUCAoQlZB UiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpKQorICAgICAgICAgICAgICAg ICAgICAgICA/IG1jX3VwZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywgJm1vdXNlX2ZhY2Vfb3Zl cndyaXR0ZW5fcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIGRyYXdfcCkKKyAgICAgICAgICAgICAgICAg ICAgICAgOiB1cGRhdGVfd2luZG93X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3cml0 dGVuX3ApOworICAgICAgICAgIGlmIChNQVRSSVhfUk9XX0JPVFRPTV9ZIChyb3cpID49IHliKQor ICAgICAgICAgICAgZm9yIChpbnQgaSA9IHZwb3MgKyAxOyBpIDwgdy0+Y3VycmVudF9tYXRyaXgt Pm5yb3dzIC0gMTsgKytpKQorICAgICAgICAgICAgICBTRVRfTUFUUklYX1JPV19FTkFCTEVEX1Ag KHctPmN1cnJlbnRfbWF0cml4LCBpLCBmYWxzZSk7CisgICAgICAgICAgYnJlYWs7CisgICAgICAg IH0KKyAgICB9CisKKyAgY3Vyc29yX21hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICAvKiBVcGRhdGUgdGhlIHJlc3Qgb2YgdGhl IGxpbmVzLiAgKi8KICAgICAgIGZvciAoOyByb3cgPCBlbmQgJiYgKGZvcmNlX3AgfHwgIWlucHV0 X3BlbmRpbmcpOyArK3JvdykKIAkvKiBzY3JvbGxpbmdfd2luZG93IHJlc2V0cyB0aGUgZW5hYmxl ZF9wIGZsYWcgb2YgdGhlIHJvd3MgaXQKQEAgLTM0NzEsNiArNTMxOCwxOSBAQCB1cGRhdGVfd2lu ZG93IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3ApCiAJaWYgKHJvdy0+ZW5hYmxlZF9w KQogCSAgewogCSAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBkZXNpcmVkX21h dHJpeCk7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JT ICovCisKKyAgICAgICAgICAvKiBJZiB0aGUgYGN1cnNvcl9yb3dgIGlzIHdpdGhpbiB0aGUgYGRl c2lyZWRfbWF0cml4YCwgdGhlbiBpdCB3YXMKKyAgICAgICAgICBwcm9jZXNzZWQgaGVyZWluYWJv dmUgYW5kIHNob3VsZCBiZSBza2lwcGVkIGF0IHRoaXMgdGltZS4gKi8KKyAgICAgICAgICBpZiAo dnBvcyA9PSB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICBjb250aW51ZTsKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogCSAgICBpbnQgaTsKIAogCSAgICAvKiBXZSdsbCBoYXZlIHRv IHBsYXkgYSBsaXR0bGUgYml0IHdpdGggd2hlbiB0bwpAQCAtMzQ3OSw4ICs1MzM5LDIxIEBAIHVw ZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkKIAkgICAgICAgY29t bWFuZHMgd2lsbCB0b28gcXVpY2tseSBwYXVzZSByZWRpc3BsYXkuICAqLwogCSAgICBpZiAoIWZv cmNlX3AgJiYgKytuX3VwZGF0ZWQgJSBwcmVlbXB0X2NvdW50ID09IDApCiAJICAgICAgZGV0ZWN0 X2lucHV0X3BlbmRpbmdfaWdub3JlX3NxdWVlemFibGVzICgpOwotCSAgICBjaGFuZ2VkX3AgfD0g dXBkYXRlX3dpbmRvd19saW5lICh3LCB2cG9zLAotCQkJCQkgICAgICZtb3VzZV9mYWNlX292ZXJ3 cml0dGVuX3ApOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VS U09SUyAqLworCisgICAgICAgICAgY2hhbmdlZF9wIHw9IChCVUZGRVJQICh3LT5jb250ZW50cykK KyAgICAgICAgICAgICAgICAgICAgICAgICYmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAhTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICB8fCAhIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNf dmlzaWJsZSkpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgPyBtY191cGRhdGVfd2luZG93X2xp bmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3cml0dGVuX3AsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxz LCBkcmF3X3ApCisgICAgICAgICAgICAgICAgICAgICAgIDogdXBkYXRlX3dpbmRvd19saW5lICh3 LCB2cG9zLCAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wKTsKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKIAogCSAgICAvKiBNYXJrIGFsbCByb3dzIGJlbG93IHRoZSBsYXN0IHZpc2libGUg b25lIGluIHRoZSBjdXJyZW50CiAJICAgICAgIG1hdHJpeCBhcyBpbnZhbGlkLiAgVGhpcyBpcyBu ZWNlc3NhcnkgYmVjYXVzZSBvZgpAQCAtMzUwMSw2ICs1Mzc0LDQxIEBAIHVwZGF0ZV93aW5kb3cg KHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkKIAogICAgIHNldF9jdXJzb3I6CiAKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyog SWYgd2UganVtcGVkIGhlcmUgZnJvbSBgc2V0X2N1cnNvcmAsIHRoZW4gc2V0IHRoZSBgY3Vyc29y X21hdHJpeGAuICovCisgIGlmIChjdXJzb3JfbWF0cml4ID09IE5VTEwpCisgICAgY3Vyc29yX21h dHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworCisgIC8qIFJlc2V0IGByb3dgIHRvIDAgc28gdGhh dCBmYWtlIGN1cnNvcnMgY2FuIGJlIGRyYXduIG9uIHJvd3MgcHJlY2VkaW5nIHRoZQorICBmaXJz dCBgcm93LT5lbmFibGVkX3BgLiAgSnVzdCBwcmlvciB0byB0aGUgY2FsbCB0byBgc2Nyb2xsaW5n X3dpbmRvdycgYWJvdmUsCisgIGByb3dgIHdhcyBhZHZhbmNlZCB0byB0aGUgZmlyc3QgYHJvdy0+ ZW5hYmxlZF9wYC4gKi8KKyAgZm9yIChzdHJ1Y3QgZ2x5cGhfcm93ICpkZXNpcmVkX3JvdyA9IE1B VFJJWF9ST1cgKGRlc2lyZWRfbWF0cml4LCAwKTsKKyAgICAgICBkZXNpcmVkX3JvdyA8IGVuZAor ICAgICAgICYmIChmb3JjZV9wIHx8ICFpbnB1dF9wZW5kaW5nKQorICAgICAgIC8qIFczMiBFbWFj cyBjcmFzaGVzIG9uIHN0YXJ0dXAgd2l0aG91dCBhIEJVRkZFUlAgY2hlY2suICovCisgICAgICAg JiYgQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJV RkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgfHwgIU5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpKTsKKyAgICAgICArK2Rlc2ly ZWRfcm93KQorICAgIHsKKyAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChkZXNpcmVk X3JvdywgZGVzaXJlZF9tYXRyaXgpOworICAgICAgaWYgKGRlc2lyZWRfcm93LT5lbmFibGVkX3Ap CisgICAgICAgIGNvbnRpbnVlOworICAgICAgc3RydWN0IGdseXBoX3JvdyAqY3VycmVudF9yb3cg PSBNQVRSSVhfUk9XICh3LT5jdXJyZW50X21hdHJpeCwgdnBvcyk7CisgICAgICBlbnVtIG1jX3Jv d19wb3NpdGlvbiByb3dfcG9zaXRpb24gPSBtY19yb3dfcG9zaXRpb24gKHcsIGN1cnJlbnRfcm93 LCBjdXJyZW50X3JvdywgdnBvcyk7CisgICAgICBpZiAoY3VycmVudF9yb3ctPmVuYWJsZWRfcCkK KyAgICAgICAgbWNfZHJhd19yb3cgKHcsIHctPmN1cnJlbnRfbWF0cml4LCBjdXJyZW50X3Jvdywg Y3VycmVudF9yb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAgICAgICAgICAgICAgY3Vy cmVudF9yb3ctPngsIGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0sIHZwb3MsCisgICAgICAg ICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGRy YXdfcCwgU0VUX0NVUlNPUl9UV08pOworICAgIH0KKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogICAgICAgLyogVXBkYXRlIHRoZSBoZWFkZXIgbGluZSBhZnRlciBzY3JvbGxpbmcgYmVj YXVzZSBhIG5ldyBoZWFkZXIKIAkgbGluZSB3b3VsZCB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IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAgZm9yIChpbnQgaSA9IDA7 IGkgPCB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3M7ICsraSkKKyAgICB7CisgICAgICBzdHJ1Y3Qg Z2x5cGhfcm93ICpyb3cgPSB3LT5jdXJyZW50X21hdHJpeC0+cm93cyArIGk7CisgICAgICBpZiAo IXJvdy0+ZW5hYmxlZF9wKQorICAgICAgICBicmVhazsKKyAgICAgICAgZWxzZSBpZiAocm93LT5t b2RlX2xpbmVfcCkKKyAgICAgICAgICBjb250aW51ZTsKKyAgICAgIGlmIChyb3ctPm92ZXJsYXBw ZWRfcCkKKyAgICAgICAgeworICAgICAgICAgIGZvciAoZW51bSBnbHlwaF9yb3dfYXJlYSBhcmVh ID0gTEVGVF9NQVJHSU5fQVJFQTsgYXJlYSA8IExBU1RfQVJFQTsgKythcmVhKQorICAgICAgICAg ICAgeworICAgICAgICAgICAgICBvdXRwdXRfY3Vyc29yX3RvICh3LCBpLCAwLCByb3ctPnksIGFy ZWEgPT0gVEVYVF9BUkVBID8gcm93LT54IDogMCk7CisgICAgICAgICAgICAgIGlmICghbWNfcmVk cmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgsIHJvdywgYXJlYSwgcm93LT54LCAwLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvdy0+dXNlZFthcmVhXSwgdHJ1ZSwgRFJB V19OT1JNQUxfVEVYVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBVUERBVEVf V0lORE9XX19SRURSQVdfT1ZFUkxBUFBFRF9ST1dTKQorICAgICAgICAgICAgICAgICAgJiYgcm93 LT51c2VkW2FyZWFdKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIEZSQU1F X1JJRiAoZiktPndyaXRlX2dseXBocyAodywgcm93LCByb3ctPmdseXBoc1thcmVhXSwgYXJlYSwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT51c2Vk W2FyZWFdKTsKKyAgICAgICAgICAgICAgICAgIEZSQU1FX1JJRiAoZiktPmNsZWFyX2VuZF9vZl9s aW5lICh3LCByb3csIGFyZWEsIC0xKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9 CisgICAgICAgICAgcm93LT5vdmVybGFwcGVkX3AgPSAwOworICAgICAgICB9CisgICAgICBpZiAo TUFUUklYX1JPV19CT1RUT01fWSAocm93KSA+PSB5YikKKyAgICAgICAgYnJlYWs7CisgICAgfQor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAgICAgcmVkcmF3X292ZXJsYXBwaW5n X3Jvd3MgKHcsIHliKTsKIAkgICAgfQogI2VuZGlmCkBAIC0zNTM2LDggKzU0ODYsMjAgQEAgdXBk YXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wKQogI2VuZGlmCiAKICNp ZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAg ICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisg ICAgbWNfdXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCAwKTsKKyAgICBlbHNlCiAgICAgICB1cGRh dGVfd2luZG93X2ZyaW5nZXMgKHcsIDApOwogCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogK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aW5nZS5jIGIvc3JjL2ZyaW5nZS5jCmluZGV4IGQwZDU5 OTIuLjI1MmVkYWMgMTAwNjQ0Ci0tLSBhL3NyYy9mcmluZ2UuYworKysgYi9zcmMvZnJpbmdlLmMK QEAgLTQzNyw4ICs0MzcsNDYyIEBAIHN0YXRpYyB1bnNpZ25lZCBzaG9ydCBlbXB0eV9saW5lX2Jp dHNbXSA9IHsKICNkZWZpbmUgU1RBTkRBUkRfQklUTUFQX0hFSUdIVChiaXRzKSAoc2l6ZW9mIChi aXRzKS9CWVRFU19QRVJfQklUTUFQX1JPVykKICNkZWZpbmUgRlJCSVRTKGJpdHMpICBiaXRzLCBT VEFOREFSRF9CSVRNQVBfSEVJR0hUIChiaXRzKQogCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCisvKiBgKy1mcmluZ2UtaGVscGVyLWRl Y2ltYWwnIGRlZmluZWQgaW4gYGNyb3NzaGFpcnMuZWxgICovCisKKy8qIFRPRE86ICBDb25zaWRl ciBhZGRpbmcgdGhlIGZvbGxvd2luZyBmcmluZ2UgYml0bWFwczoKKyAgKGRlZmluZS1mcmluZ2Ut Yml0bWFwICdicmVha3BvaW50ICJceDNjXHg3ZVx4ZmZceGZmXHhmZlx4ZmZceDdlXHgzYyIpCisg IChkZWZpbmUtZnJpbmdlLWJpdG1hcCAnaG9sbG93LXJpZ2h0LXRyaWFuZ2xlICJceGUwXHg5MFx4 ODhceDg0XHg4NFx4ODhceDkwXHhlMCIpICovCisKKy8qIDI0CisgICAgKCstZnJpbmdlLWhlbHBl ci1oZXhhZGVjaW1hbAorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAg InguLi4uLi4uIgorICAgICAgInguLnh4Li4uIgorICAgICAgInguLi54eC4uIgorICAgICAgIngu Li4ueHguIgorICAgICAgIngueHh4eHh4IgorICAgICAgIngueHh4eHh4IgorICAgICAgInguLi4u eHguIgorICAgICAgInguLi54eC4uIgorICAgICAgInguLnh4Li4uIgorICAgICAgInguLi4uLi4u IgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIikKKyovCitzdGF0aWMgdW5zaWdu ZWQgc2hvcnQgbWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93X2JpdHNbXSA9eworICAweDgwLCAw eDgwLCAweDgwLCAweDk4LCAweDhjLCAweDg2LCAweGJmLAorICAweGJmLCAweDg2LCAweDhjLCAw eDk4LCAweDgwLCAweDgwLCAweDgwfTsKKworLyogMjUKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhl eGFkZWNpbWFsCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4u Li4ueHgiCisgICAgICAiLnh4Li4ueHgiCisgICAgICAiLi54eC4ueHgiCisgICAgICAiLi4ueHgu eHgiCisgICAgICAieHh4eHh4eHgiCisgICAgICAieHh4eHh4eHgiCisgICAgICAiLi4ueHgueHgi CisgICAgICAiLi54eC4ueHgiCisgICAgICAiLnh4Li4ueHgiCisgICAgICAiLi4uLi4ueHgiCisg ICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBz aG9ydCBtY19yZXZlcnNlZF92ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3dfYml0c1tdID17CisgIDB4 MywgMHgzLCAweDMsIDB4NjMsIDB4MzMsIDB4MWIsIDB4ZmYsIDB4ZmYsIDB4MWIsIDB4MzMsIDB4 NjMsIDB4MywgMHgzLCAweDN9OworCisvKiAyNgorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRl Y2ltYWwKKyAgICAgICJ4eHh4eHh4eCIKKyAgICAgICJ4Li4uLi4ueCIKKyAgICAgICJ4Li4uLi4u eCIKKyAgICAgICJ4Li54eC4ueCIK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MHg4MCwgMHg4MCwgMHg4MCwgMHg4MCwg MHg4MCwgMHg4MCwKKyAgMHg4MCwgMHg4MCwgMHg4MCwgMHg4MCwgMHg4MCwgMHg4MCwgMHg4MH07 CisKKy8qIDMwCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4u Lnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4 IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4Igor ICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAg ICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAg Ii4uLi4uLnh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcmV2ZXJzZWRfdmVydGlj YWxfYmFyX2JpdHNbXSA9eworICAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4 MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4M307CisKKy8qIDMxCisgICAgKCstZnJpbmdl LWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Li4uLi4uIgorICAgICAgInh4Li4uLi4uIgor ICAgICAgIiB4eC4uLi4uIgorICAgICAgIi54eC4uLi4uIgorICAgICAgIi4ueHguLi4uIgorICAg ICAgIi4ueHguLi4uIgorICAgICAgIi4uLnh4Li4uIgorICAgICAgIi4uLnh4Li4uIgorICAgICAg Ii4uLi54eC4uIgorICAgICAgIi4uLi54eC4uIgorICAgICAgIi4uLi4ueHguIgorICAgICAgIi4u Li4ueHguIgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IikKKyovCitzdGF0aWMg dW5zaWduZWQgc2hvcnQgbWNfYmFja3NsYXNoX2JpdHNbXSA9eworICAweGMwLCAweGMwLCAweGUw LCAweDYwLCAweDMwLCAweDMwLCAweDE4LCAweDE4LCAweGMsIDB4YywgMHg2LCAweDYsIDB4Mywg MHgzfTsKKworLyogMzIKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAi eHguLi4uLi4iCisgICAgICAieHguLi4uLi4iCisgICAgICAieHh4Li4uLi4iCisgICAgICAieHh4 Li4uLi4iCisgICAgICAieC54eC4uLi4iCisgICAgICAieC54eC4uLi4iCisgICAgICAieC4ueHgu Li4iCisgICAgICAieC4ueHguLi4iCisgICAgICAieC4uLnh4Li4iCisgICAgICAieC4uLnh4Li4i CisgICAgICAieC4uLi54eC4iCisgICAgICAieC4uLi54eC4iCisgICAgICAieC4uLi4ueHgiCisg ICAgICAieC4uLi4ueHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY192ZXJ0aWNhbF9i YXJfYmFja3NsYXNoX2JpdHNbXSA9eworICAweGMwLCAweGMwLCAweGUwLCAweGUwLCAweGIwLCAw eGIwLCAweDk4LAorICAweDk4LCAweDhjLCAweDhjLCAweDg2LCAweDg2LCAweDgzLCAweDgzfTsK KworLyogMzMKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLnh4eHh4 eC4iCisgICAgICAieHh4eC54Li4iCisgICAgICAieHh4eC54Li4iCisgICAgICAieHh4eC54Li4i CisgICAgICAiLnh4eC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4iCisg ICAgICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAg ICAiLi4ueC54Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19waWxjcm93X2JpdHNb XSA9eworICAweDdlLCAweGY0LCAweGY0LCAweGY0LCAweDc0LCAweDE0LCAweDE0LCAweDE0LCAw eDE0LCAweDE0LCAweDE0fTsKKworLyogMzQKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNp bWFsCisgICAgICAiLi54eHh4Li4iCisgICAgICAiLnh4eHh4eC4iCisgICAgICAieC4ueHguLngi CisgICAgICAieC4ueHguLngiCisgICAgICAieHh4eHh4eHgiCisgICAgICAieHguLi4ueHgiCisg ICAgICAieHh4Li54eHgiCisgICAgICAiLnh4eHh4eC4iCisgICAgICAiLi54eHh4Li4iKQorKi8K K3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zbWlsZXlfZmFjZV9iaXRzW10gPXsKKyAgMHgzYywg MHg3ZSwgMHg5OSwgMHg5OSwgMHhmZiwgMHhjMywgMHhlNywgMHg3ZSwgMHgzY307CisKKy8qIDM1 CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4ueC4uLi4uIgorICAg ICAgIi4uLnguLi4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4uLi4ueC4uIgorICAgICAg Ii4uLi54Li4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC4uLi4uIikKKyovCitzdGF0 aWMgdW5zaWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX3JpZ2h0X2JpdHNbXSA9eworICAweDIw LCAweDEwLCAweDgsIDB4NCwgMHg4LCAweDEwLCAweDIwfTsKKworLyogMzYKKyAgICAoKy1mcmlu Z2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi54Li4iCisgICAgICAiLi4uLnguLi4i CisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54Li4uLi4iCisgICAgICAiLi4ueC4uLi4iCisg ICAgICAiLi4uLnguLi4iCisgICAgICAiLi4uLi54Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBz aG9ydCBtY19zaW5nbGVfYW5nbGVfbGVmdF9iaXRzW10gPXsKKyAgMHg0LCAweDgsIDB4MTAsIDB4 MjAsIDB4MTAsIDB4OCwgMHg0fTsKKworLyogMzcKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFk ZWNpbWFsCisgICAgICAieHgueHguLi4iCisgICAgICAiLnh4Lnh4Li4iCisgICAgICAiLi54eC54 eC4iCisgICAgICAiLi4ueHgueHgiCisgICAgICAiLi54eC54eC4iCisgICAgICAiLnh4Lnh4Li4i CisgICAgICAieHgueHguLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19kb3VibGVf YW5nbGVfcmlnaHRfYml0c1tdID17CisgIDB4ZDgsIDB4NmMsIDB4MzYsIDB4MWIsIDB4MzYsIDB4 NmMsIDB4ZDh9OworCisvKiAzOAorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAg ICAgICIuLi54eC54eCIKKyAgICAgICIuLnh4Lnh4LiIKKyAgICAgICIueHgueHguLiIKKyAgICAg ICJ4eC54eC4uLiIKKyAgICAgICIueHgueHguLiIKKyAgICAgICIuLnh4Lnh4LiIKKyAgICAgICIu Li54eC54eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX2RvdWJsZV9hbmdsZV9sZWZ0 X2JpdHNbXSA9eworICAweDFiLCAweDM2LCAweDZjLCAweGQ4LCAweDZjLCAweDM2LCAweDFifTsK KworLyogMzkKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC54Lngu Li4iCisgICAgICAiLngueC54Li4iCisgICAgICAiLi54LngueC4iCisgICAgICAiLi4ueC54Lngi CisgICAgICAiLi54LngueC4iCisgICAgICAiLngueC54Li4iCisgICAgICAieC54LnguLi4iKQor Ki8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190cmlwbGVfYW5nbGVfcmlnaHRfYml0c1tdID17 CisgIDB4YTgsIDB4NTQsIDB4MmEsIDB4MTUsIDB4MmEsIDB4NTQsIDB4YTh9OworCisvKiA0MAor ICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi54LngueCIKKyAgICAg ICIuLngueC54LiIKKyAgICAgICIueC54LnguLiIKKyAgICAgICJ4LngueC4uLiIKKyAgICAgICIu eC54LnguLiIKKyAgICAgICIuLngueC54LiIKKyAgICAgICIuLi54LngueCIpCisqLworc3RhdGlj IHVuc2lnbmVkIHNob3J0IG1jX3RyaXBsZV9hbmdsZV9sZWZ0X2JpdHNbXSA9eworICAweDE1LCAw eDJhLCAweDU0LCAweGE4LCAweDU0LCAweDJhLCAweDE1fTsKKworLyogNDEKKyAgICAoKy1mcmlu Z2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4i CisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4ueC4uLi4iCisg ICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4uLi4ueC4iCisgICAg ICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAi Li4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zaW5nbGVfYW5nbGVfdXBf Yml0c1tdID17CisgIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MTAsIDB4MjgsIDB4NDQsIDB4 ODIsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9OworCisvKiA0MgorICAgICgrLWZyaW5nZS1oZWxw ZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAg ICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIu eC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLi4u Li4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4u LiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3NpbmdsZV9hbmdsZV9kb3duX2JpdHNb XSA9eworICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDgyLCAweDQ0LCAweDI4LCAweDEwLCAw eDAwLCAweDAwLCAweDAwLCAweDAwfTsKKworLyogNDMKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhl eGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4u Li4uLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54 Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4i CisgICAgICAieC4uLi4ueC4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisg ICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19kb3VibGVfYW5n bGVfdXBfYml0c1tdID17CisgIDB4MDAsIDB4MDAsIDB4MDAsIDB4MTAsIDB4MjgsIDB4NDQsIDB4 OTIsIDB4MjgsIDB4NDQsIDB4ODIsIDB4MDAsIDB4MDAsIDB4MDB9OworCisvKiA0NAorICAgICgr LWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4u Li4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIueC4uLngu LiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIK KyAgICAgICIuLngueC4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAg ICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNo b3J0IG1jX2RvdWJsZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAweDAwLCAweDAwLCAweDAwLCAw eDgyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDEwLCAweDAwLCAweDAwLCAweDAw fTsKKworLyogNDUKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4u Li4uLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54 Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4i CisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisg ICAgICAieC4uLi4ueC4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBz aG9ydCBtY190cmlwbGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4MDAsIDB4MTAsIDB4MjgsIDB4 NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4ODIsIDB4MDB9OworCisv KiA0NgorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4uLiIK KyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAg ICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAg ICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIu Li54Li4uLiIKKyAgICAgICIuLi4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1j X3F1YWRydXBsZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAweDAwLCAweDgyLCAweDQ0LCAweDI4 LCAweDkyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDEwLCAweDAwfTsKKworLyog NDcKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4ueC4uLi4iCisg ICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAg ICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAi Li54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54 LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4uLi4ueC4iKQorKi8KK3N0YXRpYyB1 bnNpZ25lZCBzaG9ydCBtY19xdWFkcnVwbGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4MTAsIDB4 MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4OTIsIDB4Mjgs IDB4NDQsIDB4ODJ9OworCisvKiA0OAorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwK KyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAg ICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAg ICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICJ4 Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIuLi54 Li4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3RyaXBsZV9hbmdsZV9kb3duX2Jp dHNbXSA9eworICAweDgyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0 LCAweDI4LCA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eworICAgICAgICAgICAgaWYgKGxuMSA+IGl4MikKKyAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMSk7Cisg ICAgICAgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAgICAgICAgICAgIGdvdG8g Zm91bmQ7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgeworICAgICAgICAgICAgICBpZiAobG4xID4gaXgxKQorICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMSk7CisgICAgICAgICAg ICAgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5k OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgIH0KKyAgICBlbHNlIGlm ICgoYm0gPSBibTEsICFFUSAoYm0sIFF0KSkpCisgICAgICBnb3RvIGZvdW5kOworICB9CisgICAg fQorICBpZiAoIUVRIChjbWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNh dG9yX2FsaXN0KSkKKyAgICAgICYmICFOSUxQIChCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmlu Z2VfaW5kaWNhdG9yX2FsaXN0KSkpCisgICAgeworICAgICAgYm0yID0gbWNfYXNzcSAoYml0bWFw LCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSk7CisgICAg ICBpZiAoQ09OU1AgKGJtMikpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoKGJtMiA9IFhDRFIg KGJtMikpLCAhTklMUCAoYm0yKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKENP TlNQIChibTIpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGxuMiA9IFhG SVhOVU0gKEZsZW5ndGggKGJtMikpOworICAgICAgICAgICAgICAgICAgaWYgKHBhcnRpYWxfcCkK KyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGlmIChsbjIgPiBp eDIpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAg IGJtID0gbWNfbnRoIChpeDIsIGJtMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgh RVEgKGJtLCBRdCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAg ICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgaWYgKGxuMSA+IGl4 MSkKKyAgICB7CisgICAgICBibSA9IG1jX250aCAoaXgxLCBibTEpOworICAgICAgaWYgKCFFUSAo Ym0sIFF0KSkKKyAgICAgICAgZ290byBmb3VuZDsKKyAgICB9CisgIGlmIChsbjIgPiBpeDEpCisg ICAgeworICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0yKTsKKyAgICAgIGlmICghRVEgKGJtLCBR dCkpCisgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1B UDsKKyAgICB9CisgICAgZWxzZSBpZiAoKGJtID0gYm0yLCBOSUxQIChibSkpKQorICAgICAgcmV0 dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgIGZvdW5kOgorICByZXR1cm4gbG9va3VwX2ZyaW5n ZV9iaXRtYXAgKGJtKTsKK30KKworc3RhdGljIGludAorbWNfZ2V0X2xvZ2ljYWxfY3Vyc29yX2Jp dG1hcCAoc3RydWN0IHdpbmRvdyAqdywgTGlzcF9PYmplY3QgY3Vyc29yKQoreworICBMaXNwX09i amVjdCBjbWFwLCBibSA9IFFuaWw7CisgIGlmICgoY21hcCA9IEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgZnJpbmdlX2N1cnNvcl9hbGlzdCkpLCAhTklMUCAoY21hcCkpCisgICAgeworICAg ICAgYm0gPSBtY19hc3NxIChjdXJzb3IsIGNtYXApOworICAgICAgaWYgKENPTlNQIChibSkpCisg ICAgICAgIHsKKyAgICAgICAgICBpZiAoKGJtID0gWENEUiAoYm0pKSwgTklMUCAoYm0pKQorICAg ICAgICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgICAgcmV0dXJuIGxv b2t1cF9mcmluZ2VfYml0bWFwIChibSk7CisgICAgICAgIH0KKyAgICB9CisgIGlmIChFUSAoY21h cCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2N1cnNvcl9hbGlzdCkpKQorICAgIHJl dHVybiBNQ19OT19GUklOR0VfQklUTUFQOworICBibSA9IG1jX2Fzc3EgKGN1cnNvciwgQlZBUiAo JmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2N1cnNvcl9hbGlzdCkpOworICBpZiAoIUNPTlNQIChi bSkgfHwgKChibSA9IFhDRFIgKGJtKSksIE5JTFAgKGJtKSkpCisgICAgcmV0dXJuIE1DX05PX0ZS SU5HRV9CSVRNQVA7CisgIHJldHVybiBsb29rdXBfZnJpbmdlX2JpdG1hcCAoYm0pOworfQorCitz dGF0aWMgaW50CittY19nZXRfbG9naWNhbF9mcmluZ2VfYml0bWFwIChzdHJ1Y3Qgd2luZG93ICp3 LCBMaXNwX09iamVjdCBiaXRtYXAsIGludCByaWdodF9wLCBpbnQgcGFydGlhbF9wKQoreworICBM aXNwX09iamVjdCBjbWFwLCBibTEgPSBRbmlsLCBibTIgPSBRbmlsLCBibTsKKyAgRU1BQ1NfSU5U IGxuMSA9IDAsIGxuMiA9IDA7CisgIGludCBpeDEgPSByaWdodF9wOworICBpbnQgaXgyID0gaXgx ICsgKHBhcnRpYW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KTsKKyAgICAgICAgICAgICAgaWYg KHBhcnRpYWxfcCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBpZiAobG4x ID4gaXgyKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgYm0g PSBtY19udGggKGl4MiwgYm0xKTsKKyAgICAgICAgICAgICAgICAgICAgICBpZiAoIUVRIChibSwg UXQpKQorICAgICAgICAgICAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmIChsbjEgPiBpeDEpCisgICAgICAg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgYm0gPSBtY19udGggKGl4 MSwgYm0xKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAg ICAgICAgICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBp ZiAoKGJtID0gYm0xLCAhRVEgKGJtLCBRdCkpKQorICAgICAgICAgICAgICBnb3RvIGZvdW5kOwor ICAgICAgICB9CisgICAgfQorICBpZiAoIUVRIChjbWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRz LCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkKKyAgICAgICYmICFOSUxQIChCVkFSICgmYnVmZmVy X2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkpCisgICAgeworICAgICAgYm0yID0g bWNfYXNzcSAoYml0bWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9y X2FsaXN0KSk7CisgICAgICBpZiAoQ09OU1AgKGJtMikpCisgICAgICAgIHsKKyAgICAgICAgICBp ZiAoKGJtMiA9IFhDRFIgKGJtMikpLCAhTklMUCAoYm0yKSkKKyAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgaWYgKENPTlNQIChibTIpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICAgIGxuMiA9IFhGSVhOVU0gKEZsZW5ndGggKGJtMikpOworICAgICAgICAgICAgICAgICAg aWYgKHBhcnRpYWxfcCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg ICAgIGlmIChsbjIgPiBpeDIpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgICAgICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMik7CisgICAgICAgICAgICAgICAg ICAgICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg Z290byBmb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAg ICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0K KyAgaWYgKGxuMSA+IGl4MSkKKyAgICB7CisgICAgICBibSA9IG1jX250aCAoaXgxLCBibTEpOwor ICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAgZ290byBmb3VuZDsKKyAgICB9CisgIGlm IChsbjIgPiBpeDEpCisgICAgeworICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0yKTsKKyAgICAg IGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICByZXR1cm4gTUNf Tk9fRlJJTkdFX0JJVE1BUDsKKyAgICB9CisgICAgZWxzZSBpZiAoKGJtID0gYm0yLCBOSUxQIChi bSkpKQorICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgIGZvdW5kOgorICByZXR1 cm4gbG9va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mV2ZXIKKyAgICAgcm93LT5pbmRpY2F0ZV9ib2JfcCBpcyBzZXQsIHNv IGl0J3MgT0sgdGhhdCB0b3Bfcm93X2VuZHNfYXRfenZfcAorICAgICBpcyBub3QgaW5pdGlhbGl6 ZWQgaGVyZS4gIFNpbWlsYXJseSBmb3IgYm90X2luZF9ybiwKKyAgICAgcm93LT5pbmRpY2F0ZV9l b2JfcCBhbmQgYm90X3Jvd19lbmRzX2F0X3p2X3AuICovCisgIGludCB0b3Bfcm93X2VuZHNfYXRf enZfcCBNQ19JRl9MSU5UICg9IDApLCBib3Rfcm93X2VuZHNfYXRfenZfcCBNQ19JRl9MSU5UICg9 IDApOworICBpZiAody0+cHNldWRvX3dpbmRvd19wKQorICAgIHJldHVybiAwOworICBpZiAoIU1J TklfV0lORE9XX1AgKHcpCisgICAgICAmJiAoaW5kID0gQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBpbmRpY2F0ZV9idWZmZXJfYm91bmRhcmllcyksICFOSUxQIChpbmQpKSkKKyAgICB7Cisg ICAgICBpZiAoRVEgKGluZCwgUWxlZnQpIHx8IEVRIChpbmQsIFFyaWdodCkpCisgICAgICAgIGJv dW5kYXJ5X3RvcCA9IGJvdW5kYXJ5X2JvdCA9IGFycm93X3RvcCA9IGFycm93X2JvdCA9IGluZDsK KyAgICAgICAgZWxzZSBpZiAoQ09OU1AgKGluZCkKKyAgICAgICAgICAgICAgICAgJiYgQ09OU1Ag KFhDQVIgKGluZCkpKQorICAgICAgICB7CisgICAgICAgICAgTGlzcF9PYmplY3QgcG9zOworICAg ICAgICAgIGlmIChwb3MgPSBtY19hc3NxIChRdCwgaW5kKSwgIU5JTFAgKHBvcykpCisgICAgICAg ICAgICBib3VuZGFyeV90b3AgPSBib3VuZGFyeV9ib3QgPSBhcnJvd190b3AgPSBhcnJvd19ib3Qg PSBYQ0RSIChwb3MpOworICAgICAgICAgIGlmIChwb3MgPSBtY19hc3NxIChRdG9wLCBpbmQpLCAh TklMUCAocG9zKSkKKyAgICAgICAgICAgIGJvdW5kYXJ5X3RvcCA9IFhDRFIgKHBvcyk7CisgICAg ICAgICAgaWYgKHBvcyA9IG1jX2Fzc3EgKFFib3R0b20sIGluZCksICFOSUxQIChwb3MpKQorICAg ICAgICAgICAgYm91bmRhcnlfYm90ID0gWENEUiAocG9zKTsKKyAgICAgICAgICBpZiAocG9zID0g bWNfYXNzcSAoUXVwLCBpbmQpLCAhTklMUCAocG9zKSkKKyAgICAgICAgICAgIGFycm93X3RvcCA9 IFhDRFIgKHBvcyk7CisgICAgICAgICAgaWYgKHBvcyA9IG1jX2Fzc3EgKFFkb3duLCBpbmQpLCAh TklMUCAocG9zKSkKKyAgICAgICAgICAgIGFycm93X2JvdCA9IFhDRFIgKHBvcyk7CisgICAgICAg IH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIC8qIEFueXRoaW5nIGVsc2UgbWVhbnMgYm91bmRh cnkgb24gbGVmdCBhbmQgbm8gYXJyb3dzLiAqLworICAgICAgICAgIGJvdW5kYXJ5X3RvcCA9IGJv dW5kYXJ5X2JvdCA9IFFsZWZ0OworICAgIH0KKyAgdG9wX2luZF9ybiA9IGJvdF9pbmRfcm4gPSAt MTsKKyAgaWYgKCFOSUxQIChpbmQpKQorICAgIHsKKyAgICAgIGZvciAoeSA9IHctPnZzY3JvbGws IHJuID0gMDsKKyAgICAgICAgICAgeSA8IHliICYmIHJuIDwgbnJvd3M7CisgICAgICAgICAgIHkg Kz0gcm93LT5oZWlnaHQsICsrcm4pCisgICAgICAgIHsKKyAgICAgICAgICByb3cgPSB3LT5kZXNp cmVkX21hdHJpeC0+cm93cyArIHJuOworICAgICAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisg ICAgICAgICAgICByb3cgPSB3LT5jdXJyZW50X21hdHJpeC0+cm93cyArIHJuOworICAgICAgICAg IHJvdy0+aW5kaWNhdGVfYm9iX3AgPSByb3ctPmluZGljYXRlX3RvcF9saW5lX3AgPSAwOworICAg ICAgICAgIHJvdy0+aW5kaWNhdGVfZW9iX3AgPSByb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3Ag PSAwOworICAgICAgICAgIGlmICghcm93LT5tb2RlX2xpbmVfcCkKKyAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgaWYgKHRvcF9pbmRfcm4gPCAwICYmIHJvdy0+dmlzaWJsZV9oZWlnaHQgPiAw KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGlmIChNQVRSSVhfUk9XX1NU QVJUX0NIQVJQT1MgKHJvdykgPD0gQlVGX0JFR1YgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSkKKyAg ICAgICAgICAgICAgICAgICAgICAmJiAhTUFUUklYX1JPV19QQVJUSUFMTFlfVklTSUJMRV9BVF9U T1BfUCAodywgcm93KSkKKyAgICAgICAgICAgICAgICAgICAgcm93LT5pbmRpY2F0ZV9ib2JfcCA9 ICFOSUxQIChib3VuZGFyeV90b3ApOworICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAg ICAgICAgICAgICAgICAgcm93LT5pbmRpY2F0ZV90b3BfbGluZV9wID0gIU5JTFAgKGFycm93X3Rv cCk7CisgICAgICAgICAgICAgICAgICB0b3BfaW5kX3JuID0gcm47CisgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgICBpZiAoYm90X2luZF9ybiA8IDApCisgICAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgICAgaWYgKE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgPj0gQlVG X1pWIChYQlVGRkVSICh3LT5jb250ZW50cykpCisgICAgICAgICAgICAgICAgICAgICAgJiYgIU1B VFJJWF9ST1dfUEFSVElBTExZX1ZJU0lCTEVfQVRfQk9UVE9NX1AgKHcsIHJvdykpCisgICAgICAg ICAgICAgICAgICAgIHJvdy0+aW5kaWNhdGVfZW9iX3AgPSAhTklMUCAoYm91bmRhcnlfYm90KSwg Ym90X2luZF9ybiA9IHJuOworICAgICA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GVbY2FjaGUqNCsyK3BhcnRp YWxfcF0JCQkJXAorICAgOiAoYml0bWFwX2NhY2hlW2NhY2hlKjQrMitwYXJ0aWFsX3BdID0JCQlc CisgICAgICBtY19nZXRfbG9naWNhbF9mcmluZ2VfYml0bWFwICh3LCB3aGljaCwgMSwgcGFydGlh bF9wKSkpCisgIC8qIEV4dGVuZCB0b3AtYWxpZ25lZCB0b3AgaW5kaWNhdG9yIChvciBib3R0b20t YWxpZ25lZCBib3R0b20KKyAgICAgaW5kaWNhdG9yKSB0byBhZGphY2VudCByb3dzIGlmIGl0IGRv ZXNuJ3QgZml0IGluIG9uZSByb3cuICovCisgIHRvcF9pbmRfbWluX3kgPSBib3RfaW5kX21heF95 ID0gLTE7CisgIGlmICh0b3BfaW5kX3JuID49IDApCisgICAgeworICAgICAgaW50IGJuID0gTUNf Tk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgIHJvdyA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsg dG9wX2luZF9ybjsKKyAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgICAgIHJvdyA9IHct PmN1cnJlbnRfbWF0cml4LT5yb3dzICsgdG9wX2luZF9ybjsKKyAgICAgIHRvcF9yb3dfZW5kc19h dF96dl9wID0gcm93LT5lbmRzX2F0X3p2X3A7CisgICAgICBpZiAocm93LT5pbmRpY2F0ZV9ib2Jf cCkKKyAgICAgICAgeworICAgICAgICAgIGlmIChFUSAoYm91bmRhcnlfdG9wLCBRbGVmdCkpCisg ICAgICAgICAgICBibiA9ICgocm93LT5pbmRpY2F0ZV9lb2JfcCAmJiBFUSAoYm91bmRhcnlfYm90 LCBRbGVmdCkpCisgICAgICAgICAgICAgICAgICA/IE1DX0xFRlRfRlJJTkdFICgxLCBRdG9wX2Jv dHRvbSwgcm93LT5lbmRzX2F0X3p2X3ApCisgICAgICAgICAgICAgICAgICA6IE1DX0xFRlRfRlJJ TkdFICgyLCBRdG9wLCAwKSk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGJuID0g KChyb3ctPmluZGljYXRlX2VvYl9wICYmIEVRIChib3VuZGFyeV9ib3QsIFFyaWdodCkpCisgICAg ICAgICAgICAgICAgICAgID8gTUNfUklHSFRfRlJJTkdFICgxLCBRdG9wX2JvdHRvbSwgcm93LT5l bmRzX2F0X3p2X3ApCisgICAgICAgICAgICAgICAgICAgIDogTUNfUklHSFRfRlJJTkdFICgyLCBR dG9wLCAwKSk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV90b3Bf bGluZV9wKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChFUSAoYXJyb3dfdG9wLCBRbGVm dCkpCisgICAgICAgICAgICAgIGJuID0gTUNfTEVGVF9GUklOR0UgKDYsIFF1cCwgMCk7CisgICAg ICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBibiA9IE1DX1JJR0hUX0ZSSU5HRSAoNiwg UXVwLCAwKTsKKyAgICAgICAgICB9CisgICAgICBpZiAoYm4gIT0gTUNfTk9fRlJJTkdFX0JJVE1B UCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBmcmluZ2VfYml0bWFwICpmYiA9IGdldF9m cmluZ2VfYml0bWFwX2RhdGEgKGJuKTsKKyAgICAgICAgICBpZiAoZmItPmFsaWduID09IEFMSUdO X0JJVE1BUF9UT1AgJiYgZmItPnBlcmlvZCA9PSAwKQorICAgICAgICAgICAgeworICAgICAgICAg ICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cxOworICAgICAgICAgICAgICBpbnQgdG9wX2luZF9t YXhfeTsKKyAgICAgICAgICAgICAgdG9wX2luZF9taW5feSA9IFdJTkRPV19IRUFERVJfTElORV9I RUlHSFQgKHcpOworICAgICAgICAgICAgICB0b3BfaW5kX21heF95ID0gdG9wX2luZF9taW5feSAr IGZiLT5oZWlnaHQ7CisgICAgICAgICAgICAgIGlmICh0b3BfaW5kX21heF95ID4geWIpCisgICAg ICAgICAgICAgICAgdG9wX2luZF9tYXhfeSA9IHliOworICAgICAgICAgICAgICBmb3IgKHkgPSBy b3ctPnkgKyByb3ctPmhlaWdodCwgcm4gPSB0b3BfaW5kX3JuICsgMTsKKyAgICAgICAgICAgICAg ICAgICB5IDwgdG9wX2luZF9tYXhfeSAmJiBybiA8IG5yb3dzOworICAgICAgICAgICAgICAgICAg IHkgKz0gcm93MS0+aGVpZ2h0LCBybisrKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICAgIGlmIChib3RfaW5kX3JuID49IDAgJiYgcm4gPj0gYm90X2luZF9ybikKKyAgICAgICAg ICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICByb3cxID0gdy0+ZGVzaXJlZF9t YXRyaXgtPnJvd3MgKyBybjsKKyAgICAgICAgICAgICAgICAgIGlmICghcm93MS0+ZW5hYmxlZF9w KQorICAgICAgICAgICAgICAgICAgICByb3cxID0gdy0+Y3VycmVudF9tYXRyaXgtPnJvd3MgKyBy bjsKKyAgICAgICAgICAgICAgICAgIHJvdzEtPmluZGljYXRlX2JvYl9wID0gcm93LT5pbmRpY2F0 ZV9ib2JfcDsKKyAgICAgICAgICAgICAgICAgIHJvdzEtPmluZGljYXRlX3RvcF9saW5lX3AgPSBy b3ctPmluZGljYXRlX3RvcF9saW5lX3A7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg fQorICAgICAgICB9CisgICAgfQorICBpZiAoYm90X2luZF9ybiA+PSAwKQorICAgIHsKKyAgICAg IGludCBibiA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICByb3cgPSB3LT5kZXNpcmVkX21h dHJpeC0+cm93cyArIGJvdF9pbmRfcm47CisgICAgICBpZiAoIXJvdy0+ZW5hYmxlZF9wKQorICAg ICAgICByb3cgPSB3LT5jdXJyZW50X21hdHJpeC0+cm93cyArIGJvdF9pbmRfcm47CisgICAgICBi b3Rfcm93X2VuZHNfYXRfenZfcCA9IHJvdy0+ZW5kc19hdF96dl9wOworICAgICAgaWYgKHJvdy0+ aW5kaWNhdGVfZW9iX3ApCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoRVEgKGJvdW5kYXJ5X2Jv dCwgUWxlZnQpKQorICAgICAgICAgICAgYm4gPSBNQ19MRUZUX0ZSSU5HRSAoMywgUWJvdHRvbSwg cm93LT5lbmRzX2F0X3p2X3ApOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBibiA9 IE1DX1JJR0hUX0ZSSU5HRSAoMywgUWJvdHRvbSwgcm93LT5lbmRzX2F0X3p2X3ApOworICAgICAg ICB9CisgICAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCkKKyAgICAg ICAgICB7CisgICAgICAgICAgICBpZiAoRVEgKGFycm93X2JvdCwgUWxlZnQpKQorICAgICAgICAg ICAgICBibiA9IE1DX0xFRlRfRlJJTkdFICg3LCBRZG93biwgMCk7CisgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICBibiA9IE1DX1JJR0hUX0ZSSU5HRSAoNywgUWRvd24sIDApOwor ICAgICAgICAgIH0KKyAgICAgIGlmIChibiAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAg ICB7CisgICAgICAgICAgc3RydWN0IGZyaW5nZV9iaXRtYXAgKmZiID0gZ2V0X2ZyaW5nZV9iaXRt YXBfZGF0YSAoYm4pOworICAgICAgICAgIGlmIChmYi0+YWxpZ24gPT0gQUxJR05fQklUTUFQX0JP VFRPTSAmJiBmYi0+cGVyaW9kID09IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHN0 cnVjdCBnbHlwaF9yb3cgKnJvdzE7CisgICAgICAgICAgICAgIGludCBib3RfaW5kX21pbl95Owor ICAgICAgICAgICAgICBib3RfaW5kX21heF95ID0gcm93LT55ICsgcm93LT52aXNpYmxlX2hlaWdo dDsKKyAgICAgICAgICAgICAgYm90X2luZF9taW5feSA9IGJvdF9pbmRfbWF4X3kgLSBmYi0+aGVp Z2h0OworICAgICAgICAgICAgICBpZiAoYm90X2luZF9taW5feSA8IFdJTkRPV19IRUFERVJfTElO RV9IRUlHSFQgKHcpKQorICAgICAgICAgICAgICAgIGJvdF9pbmRfbWluX3kgPSBXSU5ET1dfSEVB REVSX0xJTkVfSEVJR0hUICh3KTsKKyAgICAgICAgICAgICAgZm9yICh5ID0gcm93LT55LCBybiA9 IGJvdF9pbmRfcm4gLSAxOworICAgICAgICAgICAgICAgICAgIHkgPj0gYm90X2luZF9taW5feSAm JiBybiA+PSAwOworICAgICAgICAgICAgICAgICAgIHkgLT0gcm93MS0+aGVpZ2h0LCBybi0tKQor ICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGlmICh0b3BfaW5kX3JuID49IDAg JiYgcm4gPD0gdG9wX2luZF9ybikKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAg ICAgICAgICAgICByb3cxID0gdy0+ZGVzaXJlZF9tYXRyaXgtPnJvd3MgKyBybjsKKyAgICAgICAg ICAgICAgICAgIGlmICghcm93MS0+ZW5hYmxlZF9wKQorICAgICAgICAgICAgICAgICAgICByb3cx ID0gdy0+Y3VycmVudF9tYXRyaXgtPnJvd3MgKyBybjsKKyAgICAgICAgICAgICAgICAgIHJvdzEt PmluZGljYXRlX2VvYl9wID0gcm93LT5pbmRpY2F0ZV9lb2JfcDsKKyAgICAgICAgICAgICAgICAg IHJvdzEtPmluZGljYXRlX2JvdHRvbV9saW5lX3AgPSByb3ctPmluZGljYXRlX2JvdHRvbV9saW5l X3A7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQor ICBib29sIGF1dG9faHNjcm9sbF9tb2RlX3AgPSBFUSAoRmJ1ZmZlcl9sb2NhbF92YWx1ZSAoUWF1 dG9faHNjcm9sbF9tb2RlLCB3LT5jb250ZW50cyksIFFjdXJyZW50X2xpbmUpOworICAvKiBFWEFN UExFOiAgKHNjcm9sbC1sZWZ0IDUpICovCisgIGJvb2wgaHNjbF9hbGxfdGVtcF9wID0gKHctPnN1 c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNj cm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAK KyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gMCk7CisgIC8q IEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIG5vdGhpbmcuICovCisgIGJvb2wgaHNjbF9hbGxf cGVybV8wX3AgPSAody0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5t aW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNj cm9sbCA9PSB3LT5oc2Nyb2xsKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBhbmQgZG8gc29t ZXRoaW5nIGVsc2UgYmVzaWRlcyBob3Jpem9udGFsbHkgc2Nyb2xsaW5nIHRoZQorICAgICAgICAg ICAgICAgY3VycmVudCBsaW5lIGRpZmZlcmVudGx5LgorICAgICAgICAgICAgICAgQ3VycmVudCBs aW5lIGlzIF9ub3RfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4gKi8KKyAgYm9v bCBoc2NsX2FsbF9wZXJtXzFfcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiB3LT5taW5faHNjcm9sbCA9PSB3LT5oc2Nyb2xsKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXgg PCBhbmQgLi4uCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgaXMgX25vdF8gaG9yaXpvbnRh bGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMl9wID0g KCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5o c2Nyb2xsID09IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9s bCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCAhPSB3 LT5oc2Nyb2xsKTsKKyAgLyogRVhBTVBMRTogIChzY3JvbGwtbGVmdCA1KTsgYW5kLCB0aGVuIHBy ZXNzIHRoZSBsZWZ0IGFycm93IGtleSBvbmUgdGltZS4KKyAgICAgICAgICAgICAgIEN1cnJlbnQg bGluZSBfaXNfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4qLworICBib29sIGhz Y2xfdGVtcF9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAg ICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5o c2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IDAp OworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBzb21ldGhpbmcgdGhhdCBjYXVzZXMg dGhlIGN1cnJlbnQgbGluZSB0byBiZQorICAgICAgICAgICAgICAgaG9yaXpvbnRhbGx5IHNjcm9s bGVkIGRpZmZlcmVudGx5LgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIF9pc18gaG9yaXpv bnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfcGVybV9wID0gKCF3 LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNj cm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAg ICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAg ICAgICAgICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhzY3JvbGwpOworICBzdHJ1Y3QgZnJhbWUg KmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgZm9yICh5ID0gdy0+dnNjcm9sbCwgcm4gPSAwOwor ICAgICAgIHkgPCB5YiAmJiBybiA8IG5yb3dzOworICAgICAgIHkgKz0gcm93LT5oZWlnaHQsIHJu KyspCisgICAgeworICBpbnQgbGVmdCwgcmlnaHQ7CisgIHVuc2lnbmVkIGxlZnRfZmFjZV9pZCwg cmlnaHRfZmFjZV9pZDsKKyAgaW50IGxlZnRfb2Zmc2V0LCByaWdodF9vZmZzZXQ7CisgIGJvb2wg cGVyaW9kaWNfcDsKKyAgcm93ID0gdy0+ZGVzaXJlZF9tYXRyaXgtPnJvd3MgKyBybjsKKyAgY3Vy ID0gdy0+Y3VycmVudF9tYXRyaXgtPnJvd3MgKyBybjsKKyAgaW50IHZudGhfZG0gPSBNQVRSSVhf Uk9XX1ZQT1MgKHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgcm4sIHctPmRlc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xfYWxsX3Blcm1fMl9wCisgICAgICAgICAgJiYgZW5hYmxlZF9w KQorICAgICAgICB7CisgICAgICAgICAgaW50IGZyaW5nZV9iaXRtYXAgPSBNQ19OT19GUklOR0Vf QklUTUFQOworICAgICAgICAgIGVudW0gZmFjZV9pZCBvdmVybGF5X2Fycm93X2ZhY2VfaWQgPQor ICAgICAgICAgICAgKCFhY3RpdmVfcAorICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVG RkVSICh3LT5jb250ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgICAgID8g bG9va3VwX2Rlcml2ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWluYWN0 aXZlLXByZS16di1mYWNlIiksIEZSSU5HRV9GQUNFX0lELCB0cnVlKQorICAgICAgICAgICAgOiAo YWN0aXZlX3ApCisgICAgICAgICAgICAgID8gbG9va3VwX2Rlcml2ZWRfZmFjZSAodywgZiwgaW50 ZXJuICgiKy1vdmVybGF5LWFycm93LXByZS16di1mYWNlIiksIEZSSU5HRV9GQUNFX0lELCB0cnVl KQorICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgbWNfbGVmdF9mcmlu Z2VfZmFjZV9pZCA9IChjdXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IG92ZXJsYXlfYXJyb3dfZmFjZV9pZAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7Cisg ICAgICAgICAgaWYgKHctPmhzY3JvbGwgIT0gMCkKKyAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAg PSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1vdmVybGF5LWFycm93IiksIGZh bHNlLCB0cnVlKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgZnJpbmdlX2JpdG1h cCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ciKSwg dHJ1ZSwgdHJ1ZSk7CisgICAgICAgICAgbWNfbGVmdF9mcmluZ2VfYml0bWFwID0gKGN1cnNvcl90 eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBmcmluZ2VfYml0bWFwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmICgo dnBvcyA9PSB2bnRoX2RtIHx8IHZwb3MgPT0gdm50aF9jbSkKKyAgICAgICAgICAgICAgICAgJiYg Z2x5cGhfZmxhdm9yID09IE1DX09WRVJMQVlfQVJST1dfQklUTUFQCisgICAgICAgICAgICAgICAg ICYmIChoc2NsX2FsbF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxsX3Bl cm1fMF9wCisgICAgICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzFfcAorICAgICAg ICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8yX3AKKyAgICAgICAgICAgICAgICAgICAg IHx8IGhzY2xfdGVtcF9wCisgICAgICAgICAgICAgICAgICAgICB8fCBoc2NsX3Blcm1fcCkKKyAg ICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGlu dCBmcmluZ2VfYml0bWFwID0gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICAgIGVudW0g ZmFjZV9pZCBvdmVybGF5X2Fycm93X2ZhY2VfaWQgPQorICAgICAgICAgICAgICAoIWFjdGl2ZV9w CisgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBj aF9pbmFjdGl2ZV93aW5kb3dzKSkpCisgICAgICAgICAgICAgID8gbG9va3VwX2Rlcml2ZWRfZmFj ZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtaW5hY3RpdmUtcHJlLXp2LWZh Y2UiKSwgRlJJTkdFX0ZBQ0VfSUQsIHRydWUpCisgICAgICAgICAgICAgIDogKGFjdGl2ZV9wKQor ICAgICAgICAgICAgICAgID8gbG9va3VwX2Rlcml2ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1v dmVybGF5LWFycm93LWhzY2wtcHJlLXp2LWZhY2UiKSwgRlJJTkdFX0ZBQ0VfSUQsIHRydWUpCisg ICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAgICAgbWNfbGVmdF9mcmlu Z2VfZmFjZV9pZCA9IChjdXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gb3ZlcmxheV9hcnJvd19mYWNlX2lk CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lE OworICAgICAgICAgICAgaWYgKGhzY2xfYWxsX3Blcm1fMF9wKQorICAgICAgICAgICAgICBmcmlu Z2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC1wZXJt IiksIGZhbHNlLCBmYWxzZSk7CisgICAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xfYWxsX3Blcm1f MV9wKQorICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1h cCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgdHJ1ZSwgZmFsc2UpOworICAgICAgICAgICAg ICAgIGVsc2UgaWYgKGhzY2xfYWxsX3Blcm1fMl9wKQorICAgICAgICAgICAgICAgICAgZnJpbmdl X2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIp LCBmYWxzZSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX3Blcm1fcCkK KyAgICAgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFw ICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCB0cnVlLCB0cnVlKTsKKyAgICAgICAgICAgICAg ICAgICAgZWxzZSBpZiAoaHNjbF9hbGxfdGVtcF9wKQorICAgICAgICAgICAgICAgICAgICAgIGZy aW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXRl bXAiKSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChoc2Ns X3RlbXBfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRf ZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXRlbXAiKSwgdHJ1ZSwgZmFsc2UpOwor ICAgICAgICAgICAgbWNfbGVmdF9mcmluZ2VfYml0bWFwID0gKGN1cnNvcl90eXBlID09IE1DX0xF RlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IGZyaW5nZV9iaXRtYXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1D X05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKCh2cG9z ID09IHZudGhfZG0gfHwgdnBvcyA9PSB2bnRoX2NtKQorICAgICAgICAgICAgICAgICAgICAmJiAo Z2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAg ICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVD VEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2 b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRQorICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5 cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAg ICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdI VF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZF UlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1D X1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhf Zmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gpCisgICAgICAgICAgICAgICAgICAg ICYmIGVuYWJsZWRfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgTGlzcF9PYmplY3Qg Yml0bWFwX2ZsYXZvciA9IChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdI VF9BUlJPVykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1j X2hvbGxvd19yZWN0YW5nbGVfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVD VEFOR0xFX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IFFtY19yZXZlcnNlZF9ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0g TUNfSE9MTE9XX1JFQ1RBTkdMRSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBRbWNfaG9sbG93X3JlY3RhbmdsZQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdI VF9BUlJPVykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBR bWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFS X1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IFFtY19yZXZlcnNlZF92ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNB TF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1j X3ZlcnRpY2FsX2JhcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxf YmFyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9m bGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSCkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyX2JhY2tzbGFzaAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBRbmlsOworICAgICAgICAg ICAgICBtY19yaWdodF9mcmluZ2VfYml0bWFwID0gKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZS SU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBs b29rdXBfZnJpbmdlX2JpdG1hcCAoYml0bWFwX2ZsYXZvcikKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgICAgICAg IG1jX3JpZ2h0X2ZyaW5nZV9mYWNlX2lkID0KKyAgICAgICAgICAgICAgICAoY3Vyc29yX3R5cGUg PT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRp b24gPT0gUFJFX1pWCisgICAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfUkVW RVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAg fHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVwor ICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJ Q0FMX0JBUikpCisgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9kZXJpdmVkX2ZhY2UgKHcsIGYs IGludGVybiAoIistcmV2ZXJzZWQtYmFyLXByZS16di1mYWNlIiksIEZSSU5HRV9GQUNFX0lELCB0 cnVlKQorICAgICAgICAgICAgICAgIDogKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9C SVRNQVAKKyAgICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gPT0gQVRfWlYKKyAgICAg ICAgICAgICAgICAgICAmJiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNU QU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9y ID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAg ICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKSkKKyAg ICAgICAgICAgICAgICAgID8gbG9va3VwX2Rlcml2ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1y ZXZlcnNlZC1iYXItYXQtenYtZmFjZSIpLCBGUklOR0VfRkFDRV9JRCwgdHJ1ZSkKKyAgICAgICAg ICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisgICAgICAg ICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBPU1RfWlYKKyAgICAgICAgICAgICAgICAg ICAmJiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRf QVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVS U0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICB8fCBn bHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKSkKKyAgICAgICAgICAgICAg ICAgID8gbG9va3VwX2Rlcml2ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZXZlcnNlZC1iYXIt cG9zdC16di1mYWNlIiksIEZSSU5HRV9GQUNFX0lELCB0cnVlKQorICAgICAgICAgICAgICAgIDog KGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAg ICAmJiByb3dfcG9zaXRpb24gPT0gUFJFX1pWCisgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhf Zmxhdm9yICE9IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAg ICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFS X1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JF VkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgID8gbG9va3VwX2Rlcml2ZWRf ZmFjZSAodywgZiwgaW50ZXJuICgiKy1iYXItcHJlLXp2LWZhY2UiKSwgRlJJTkdFX0ZBQ0VfSUQs IHRydWUpCisgICAgICAgICAgICAgICAgOiAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdF X0JJVE1BUAorICAgICAgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBBVF9aVgorICAg ICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVD VEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9 IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAg ICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAgICAg ICAgICAgICA/IGxvb2t1cF9kZXJpdmVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistYmFyLWF0LXp2 LWZhY2UiKSwgRlJJTkdFX0ZBQ0VfSUQsIHRydWUpCisgICAgICAgICAgICAgICAgOiAoY3Vyc29y X3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAgICYmIHJv d19wb3NpdGlvbiA9PSBQT1NUX1pWCisgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9y ICE9IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAg ICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hU X0FSUk9XCisgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VE X1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgID8gbG9va3VwX2Rlcml2ZWRfZmFjZSAo dywgZiwgaW50ZXJuICgiKy1iYXItcG9zdC16di1mYWNlIiksIEZSSU5HRV9GQUNFX0lELCB0cnVl KQorICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAgICAgfQorICAg ICAgICB9CisgICAgICBpZiAoIXJvdy0+ZW5hYmxlZF9wKQorICAgICAgICByb3cgPSBjdXI7Cisg ICAgICBsZWZ0X2ZhY2VfaWQgPSByaWdodF9mYWNlX2lkID0gREVGQVVMVF9GQUNFX0lEOworICAg ICAgbGVmdF9vZmZzZXQgPSByaWdodF9vZmZzZXQgPSAwOworICAgICAgcGVyaW9kaWNfcCA9IDA7 CisgICAgICAvKiBEZWNpZGUgd2hpY2ggYml0bWFwIHRvIGRyYXcgaW4gdGhlIGxlZnQgZnJpbmdl LiAqLworICAgICAgaWYgKFdJ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yb3ctPmlu ZGljYXRlX2VvYl9wICYmIEVRIChib3VuZGFyeV9ib3QsIFFsZWZ0KSkKKyAgICAgICAgeworICAg ICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAoMywgUWJvdHRvbSwgYm90X3Jvd19lbmRzX2F0 X3p2X3ApOworICAgICAgICAgIGlmIChib3RfaW5kX21heF95ID49IDApCisgICAgICAgICAgICBs ZWZ0X29mZnNldCA9IGJvdF9pbmRfbWF4X3kgLSAocm93LT55ICsgcm93LT52aXNpYmxlX2hlaWdo dCk7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKCghcm93LT5yZXZlcnNlZF9wICYmIE1BVFJJ WF9ST1dfQ09OVElOVUFUSU9OX0xJTkVfUCAocm93KSkKKyAgICAgICAgICAgICAgIHx8IChyb3ct PnJldmVyc2VkX3AgJiYgcm93LT5jb250aW51ZWRfcCkpCisgICAgICAgIGxlZnQgPSBNQ19MRUZU X0ZSSU5HRSAoNCwgUWNvbnRpbnVhdGlvbiwgMCk7CisgICAgICBlbHNlIGlmIChyb3ctPmluZGlj YXRlX2VtcHR5X2xpbmVfcCAmJiBFUSAoZW1wdHlfcG9zLCBRbGVmdCkpCisgICAgICAgIGxlZnQg PSBNQ19MRUZUX0ZSSU5HRSAoNSwgUWVtcHR5X2xpbmUsIDApOworICAgICAgZWxzZSBpZiAocm93 LT5pbmRpY2F0ZV90b3BfbGluZV9wICYmIEVRIChhcnJvd190b3AsIFFsZWZ0KSkKKyAgICAgICAg eworICAgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAoNiwgUXVwLCAwKTsKKyAgICAgICAg ICBpZiAodG9wX2luZF9taW5feSA+PSAwKQorICAgICAgICAgICAgbGVmdF9vZmZzZXQgPSB0b3Bf aW5kX21pbl95IC0gcm93LT55OworICAgICAgICB9CisgICAgICBlbHNlIGlmIChyb3ctPmluZGlj YXRlX2JvdHRvbV9saW5lX3AgJiYgRVEgKGFycm93X2JvdCwgUWx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WdodCkpCisgICAgICAgIHsKKyAgICAgICAgICByaWdodCA9ICgocm93LT5pbmRp Y2F0ZV9lb2JfcCAmJiBFUSAoYm91bmRhcnlfYm90LCBRcmlnaHQpKQorICAgICAgICAgICAgID8g TUNfUklHSFRfRlJJTkdFICgxLCBRdG9wX2JvdHRvbSwgdG9wX3Jvd19lbmRzX2F0X3p2X3ApCisg ICAgICAgICAgICAgOiBNQ19SSUdIVF9GUklOR0UgKDIsIFF0b3AsIDApKTsKKyAgICAgICAgICBp ZiAodG9wX2luZF9taW5feSA+PSAwKQorICAgICAgICAgICAgcmlnaHRfb2Zmc2V0ID0gdG9wX2lu ZF9taW5feSAtIHJvdy0+eTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0 ZV9lb2JfcCAmJiBFUSAoYm91bmRhcnlfYm90LCBRcmlnaHQpKQorICAgICAgICB7CisgICAgICAg ICAgcmlnaHQgPSBNQ19SSUdIVF9GUklOR0UgKDMsIFFib3R0b20sIGJvdF9yb3dfZW5kc19hdF96 dl9wKTsKKyAgICAgICAgICBpZiAoYm90X2luZF9tYXhfeSA+PSAwKQorICAgICAgICAgICAgcmln aHRfb2Zmc2V0ID0gYm90X2luZF9tYXhfeSAtIChyb3ctPnkgKyByb3ctPnZpc2libGVfaGVpZ2h0 KTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAoKCFyb3ctPnJldmVyc2VkX3AgJiYgcm93LT5j b250aW51ZWRfcCkKKyAgICAgICAgICAgICAgIHx8IChyb3ctPnJldmVyc2VkX3AgJiYgTUFUUklY X1JPV19DT05USU5VQVRJT05fTElORV9QIChyb3cpKSkKKyAgICAgICAgcmlnaHQgPSBNQ19SSUdI VF9GUklOR0UgKDQsIFFjb250aW51YXRpb24sIDApOworICAgICAgZWxzZSBpZiAocm93LT5pbmRp Y2F0ZV90b3BfbGluZV9wICYmIEVRIChhcnJvd190b3AsIFFyaWdodCkpCisgICAgICAgIHsKKyAg ICAgICAgICByaWdodCA9IE1DX1JJR0hUX0ZSSU5HRSAoNiwgUXVwLCAwKTsKKyAgICAgICAgICBp ZiAodG9wX2luZF9taW5feSA+PSAwKQorICAgICAgICAgICAgcmlnaHRfb2Zmc2V0ID0gdG9wX2lu ZF9taW5feSAtIHJvdy0+eTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0 ZV9ib3R0b21fbGluZV9wICYmIEVRIChhcnJvd19ib3QsIFFyaWdodCkpCisgICAgICAgIHsKKyAg ICAgICAgICByaWdodCA9IE1DX1JJR0hUX0ZSSU5HRSAoNywgUWRvd24sIDApOworICAgICAgICAg IGlmIChib3RfaW5kX21heF95ID49IDApCisgICAgICAgICAgICByaWdodF9vZmZzZXQgPSBib3Rf aW5kX21heF95IC0gKHJvdy0+eSArIHJvdy0+dmlzaWJsZV9oZWlnaHQpOworICAgICAgICB9Cisg ICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2VtcHR5X2xpbmVfcCAmJiBFUSAoZW1wdHlfcG9z LCBRcmlnaHQpKQorICAgICAgICByaWdodCA9IE1DX1JJR0hUX0ZSSU5HRSAoNSwgUWVtcHR5X2xp bmUsIDApOworICAgICAgZWxzZQorICAgICAgICByaWdodCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7 CisgICAgICBwZXJpb2RpY19wID0gKGdldF9mcmluZ2VfYml0bWFwX2RhdGEgKGxlZnQpLT5wZXJp b2QgIT0gMAorICAgICAgICAgICAgICAgICAgICB8fCBnZXRfZnJpbmdlX2JpdG1hcF9kYXRhIChy aWdodCktPnBlcmlvZCAhPSAwKTsKKyAgICAgIGlmIChyb3ctPnkgIT0gY3VyLT55CisgICAgICAg ICAgfHwgcm93LT52aXNpYmxlX2hlaWdodCAhPSBjdXItPnZpc2libGVfaGVpZ2h0CisgICAgICAg ICAgfHwgcm93LT5lbmRzX2F0X3p2X3AgIT0gY3VyLT5lbmRzX2F0X3p2X3AKKyAgICAgICAgICB8 fCBsZWZ0ICE9IGN1ci0+bGVmdF9mcmluZ2VfYml0bWFwCisgICAgICAgICAgfHwgcmlnaHQgIT0g Y3VyLT5yaWdodF9mcmluZ2VfYml0bWFwCisgICAgICAgICAgfHwgbGVmdF9mYWNlX2lkICE9IGN1 ci0+bGVmdF9mcmluZ2VfZmFjZV9pZAorICAgICAgICAgIHx8IHJpZ2h0X2ZhY2VfaWQgIT0gY3Vy LT5yaWdodF9mcmluZ2VfZmFjZV9pZAorICAgICAgICAgIHx8IGxlZnRfb2Zmc2V0ICE9IGN1ci0+ bGVmdF9mcmluZ2Vfb2Zmc2V0CisgICAgICAgICAgfHwgcmlnaHRfb2Zmc2V0ICE9IGN1ci0+cmln aHRfZnJpbmdlX29mZnNldAorICAgICAgICAgIHx8IHBlcmlvZGljX3AgIT0gY3VyLT5mcmluZ2Vf Yml0bWFwX3BlcmlvZGljX3AKKyAgICAgICAgICB8fCBjdXItPnJlZHJhd19mcmluZ2VfYml0bWFw c19wKQorICAgICAgICB7CisgICAgICAgICAgcmVkcmF3X3AgPSAxLCByb3ctPnJlZHJhd19mcmlu Z2VfYml0bWFwc19wID0gMTsKKyAgICAgICAgICBpZiAoIWtlZXBfY3VycmVudF9wKQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICBjdXItPnJlZHJhd19mcmluZ2VfYml0bWFwc19wID0gMTsK KyAgICAgICAgICAgICAgaWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0Vf QklUTUFQCisgICAgICAgICAgICAgICAgICB8fCBtY19yaWdodF9mcmluZ2VfYml0bWFwICE9IE1D X05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgY3VyLT5mcmluZ2VfYml0bWFwX3Bl cmlvZGljX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAg ICBjdXItPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcCA9IHBlcmlvZGljX3A7CisgICAgICAgICAg ICAgIGlmIChtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAg ICAgICAgICAgICAgICBjdXItPmxlZnRfZnJpbmdlX2JpdG1hcCA9IG1jX2xlZnRfZnJpbmdlX2Jp dG1hcDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPmxlZnRf ZnJpbmdlX2JpdG1hcCA9IGxlZnQ7CisgICAgICAgICAgICAgIGlmIChtY19sZWZ0X2ZyaW5nZV9i aXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICBjdXItPmxlZnRf ZnJpbmdlX2ZhY2VfaWQgPSBtY19sZWZ0X2ZyaW5nZV9mYWNlX2lkOworICAgICAgICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgICAgICAgIGN1ci0+bGVmdF9mcmluZ2VfZmFjZV9pZCA9IGxlZnRf ZmFjZV9pZDsKKyAgICAgICAgICAgICAgaWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19O T19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgIGN1ci0+bGVmdF9mcmluZ2Vfb2Zmc2V0 ID0gMDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPmxlZnRf ZnJpbmdlX29mZnNldCA9IGxlZnRfb2Zmc2V0OworICAgICAgICAgICAgICBpZiAobWNfcmlnaHRf ZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgIGN1 ci0+cmlnaHRfZnJpbmdlX2JpdG1hcCA9IG1jX3JpZ2h0X2ZyaW5nZV9iaXRtYXA7CisgICAgICAg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2VfYml0bWFw ID0gcmlnaHQ7CisgICAgICAgICAgICAgIGlmIChtY19yaWdodF9mcmluZ2VfYml0bWFwICE9IE1D X05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2VfZmFj ZV9pZCA9IG1jX3JpZ2h0X2ZyaW5nZV9mYWNlX2lkOworICAgICAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX2ZhY2VfaWQgPSByaWdodF9mYWNlX2lk OworICAgICAgICAgICAgICBpZiAobWNfcmlnaHRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklO R0VfQklUTUFQKQorICAgICAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX29mZnNldCA9IDA7 CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmlu Z2Vfb2Zmc2V0ID0gcmlnaHRfb2Zmc2V0OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAg ICBpZiAocm93LT5vdmVybGF5X2Fycm93X2JpdG1hcCA8IDApCisgICAgICAgIHJvdy0+b3Zlcmxh eV9hcnJvd19iaXRtYXAgPSBtY19nZXRfbG9naWNhbF9mcmluZ2VfYml0bWFwICh3LCBRb3Zlcmxh eV9hcnJvdywgMCwgMCk7CisgICAgICBpZiAocm93LT5vdmVybGF5X2Fycm93X2JpdG1hcCAhPSBj dXItPm92ZXJsYXlfYXJyb3dfYml0bWFwKQorICAgICAgICB7CisgICAgICAgICAgcmVkcmF3X3Ag PSAxLCByb3ctPnJlZHJhd19mcmluZ2VfYml0bWFwc19wID0gMTsKKyAgICAgICAgICBpZiAoIWtl ZXBfY3VycmVudF9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBjdXItPnJlZHJhd19m cmluZ2VfYml0bWFwc19wID0gMTsKKyAgICAgICAgICAgICAgY3VyLT5vdmVybGF5X2Fycm93X2Jp dG1hcCA9IHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXA7CisgICAgICA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9yIHJpZ2h0IGZyaW5nZS4KKyovCitzdGF0aWMgdm9pZAor bWNfZHJhd19mcmluZ2VfYml0bWFwXzEgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9y b3cgKnJvdywgaW50IGxlZnRfcCwgaW50IG92ZXJsYXksIGludCB3aGljaCkKK3sKKyAgc3RydWN0 IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAgc3RydWN0IGRyYXdfZnJp bmdlX2JpdG1hcF9wYXJhbXMgcDsKKyAgc3RydWN0IGZyaW5nZV9iaXRtYXAgKmZiOworICBpbnQg cGVyaW9kOworICBpbnQgZmFjZV9pZCA9IERFRkFVTFRfRkFDRV9JRDsKKyAgaW50IG9mZnNldCwg aGVhZGVyX2xpbmVfaGVpZ2h0OworICBwLm92ZXJsYXlfcCA9IChvdmVybGF5ICYgMSkgPT0gMTsK KyAgcC5jdXJzb3JfcCA9IChvdmVybGF5ICYgMikgPT0gMjsKKyAgaWYgKHdoaWNoICE9IE1DX05P X0ZSSU5HRV9CSVRNQVApCisgICAgeworICAgICAgb2Zmc2V0ID0gMDsKKyAgICB9CisgICAgZWxz ZSBpZiAobGVmdF9wKQorICAgICAgeworICAgICAgICB3aGljaCA9IHJvdy0+bGVmdF9mcmluZ2Vf Yml0bWFwOworICAgICAgICBmYWNlX2lkID0gcm93LT5sZWZ0X2ZyaW5nZV9mYWNlX2lkOworICAg ICAgICBvZmZzZXQgPSByb3ctPmxlZnRfZnJpbmdlX29mZnNldDsKKyAgICAgIH0KKyAgICAgIGVs c2UKKyAgICAgICAgeworICAgICAgICAgIHdoaWNoID0gcm93LT5yaWdodF9mcmluZ2VfYml0bWFw OworICAgICAgICAgIGZhY2VfaWQgPSByb3ctPnJpZ2h0X2ZyaW5nZV9mYWNlX2lkOworICAgICAg ICAgIG9mZnNldCA9IHJvdy0+cmlnaHRfZnJpbmdlX29mZnNldDsKKyAgICAgICAgfQorICBpZiAo ZmFj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ICAgICAgICAgIGJl Zm9yZSBkcmF3aW5nIG5vbi1lbXB0eSBtYXJnaW4gYXJlYS4gKi8KKyAgICAgICAgICAgICYmIHct PmxlZnRfbWFyZ2luX2NvbHMgPT0gMCkKKyAgICAgICAgICAgPyAxIDogMCk7CisgICAgICAgICAg cC5ieCA9IHggLSB3ZDsKKyAgICAgICAgICBwLm54ID0gd2Q7CisgICAgICAgIH0KKyAgICB9Cisg IGVsc2UKKyAgICB7CisgICAgICBpbnQgeCA9IHdpbmRvd19ib3hfcmlnaHQgKHcsCisgICAgICAg IChXSU5ET1dfSEFTX0ZSSU5HRVNfT1VUU0lERV9NQVJHSU5TICh3KQorICAgICAgICAgPyBSSUdI VF9NQVJHSU5fQVJFQQorICAgICAgICAgOiBURVhUX0FSRUEpKTsKKyAgICAgIGludCB3ZCA9IFdJ TkRPV19SSUdIVF9GUklOR0VfV0lEVEggKHcpOworICAgICAgaWYgKHAud2QgPiB3ZCkKKyAgICAg ICAgcC53ZCA9IHdkOworICAgICAgcC54ID0geCArICh3ZCAtIHAud2QpIC8gMjsKKyAgICAgIC8q IENsZWFyIHJpZ2h0IGZyaW5nZSBpZiBubyBiaXRtYXAgdG8gZHJhdyBvZiBpZiBiaXRtYXAgZG9l c24ndCBmaWxsCisgICB0aGUgZnJpbmdlLiAqLworICAgICAgaWYgKHAud2QgPCB3ZCB8fCBwLnkg PiBwLmJ5IHx8IHAueSArIHAuaCA8IHAuYnkgKyBwLm55KQorICAgICAgICB7CisgICAgICAgICAg cC5ieCA9IHg7CisgICAgICAgICAgcC5ueCA9IHdkOworICAgICAgICB9CisgICAgfQorICBpZiAo cC54ID49IFdJTkRPV19CT1hfTEVGVF9FREdFX1ggKHcpCisgICAgICAmJiAocC54ICsgcC53ZCkg PD0gV0lORE9XX0JPWF9MRUZUX0VER0VfWCAodykgKyBXSU5ET1dfUElYRUxfV0lEVEggKHcpKQor ICAgIEZSQU1FX1JJRiAoZiktPmRyYXdfZnJpbmdlX2JpdG1hcCAodywgcm93LCAmcCk7Cit9CisK K3ZvaWQKK21jX2RyYXdfZnJpbmdlX2JpdG1hcCAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGds eXBoX3JvdyAqcm93LCBpbnQgbGVmdF9wLCBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBl KQoreworICBpbnQgb3ZlcmxheSA9IDA7CisgIGlmIChsZWZ0X3AgPT0gcm93LT5yZXZlcnNlZF9w ICYmIHJvdy0+Y3Vyc29yX2luX2ZyaW5nZV9wKQorICAgIHsKKyAgICAgIExpc3BfT2JqZWN0IGN1 cnNvciA9IFFuaWw7CisgICAgICBzd2l0Y2ggKGN1cnNvcl90eXBlKQorICAgICAgICB7CisgICAg ICAgIGNhc2UgTUNfRlJBTUVEX0JPWDoKKyAgICAgICAgICBpZiAocm93LT52aXNpYmxlX2hlaWdo dCA+PSBTVEFOREFSRF9CSVRNQVBfSEVJR0hUIChob2xsb3dfcmVjdGFuZ2xlX2JpdHMpKQorICAg ICAgICAgICAgY3Vyc29yID0gUWhvbGxvdzsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICBj dXJzb3IgPSBRaG9sbG93X3NtYWxsOworICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1D X0hPTExPV19CT1g6CisgICAgICAgICAgaWYgKHJvdy0+dmlzaWJsZV9oZWlnaHQgPj0gU1RBTkRB UkRfQklUTUFQX0hFSUdIVCAoaG9sbG93X3JlY3RhbmdsZV9iaXRzKSkKKyAgICAgICAgICAgIGN1 cnNvciA9IFFob2xsb3c7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgY3Vyc29yID0gUWhv bGxvd19zbWFsbDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19GSUxMRURfQk9Y OgorICAgICAgICAgIGN1cnNvciA9IFFib3g7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNh c2UgTUNfQkFSOgorICAgICAgICAgIGN1cnNvciA9IFFiYXI7CisgICAgICAgICAgYnJlYWs7Cisg ICAgICAgIGNhc2UgTUNfSEJBUjoKKyAgICAgICAgICBjdXJzb3IgPSBRaGJhcjsKKyAgICAgICAg ICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19OT19GUklOR0VfQklUTUFQOgorICAgICAgICBjYXNl IE1DX05PX0NVUlNPUjoKKyAgICAgICAgY2FzZSBNQ19SSUdIVF9GUklOR0VfQklUTUFQOgorICAg ICAgICBjYXNlIE1DX0xFRlRfRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgZGVmYXVsdDoKKyAgICAg ICAgICB3LT5waHlzX2N1cnNvcl9vbl9wID0gMDsKKyAgICAgICAgICByb3ctPmN1cnNvcl9pbl9m cmluZ2VfcCA9IDA7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGlmICghTklM UCAoY3Vyc29yKSkKKyAgICAgICAgeworICAgICAgICAgIGludCBibSA9IG1jX2dldF9sb2dpY2Fs X2N1cnNvcl9iaXRtYXAgKHcsIGN1cnNvcik7CisgICAgICAgICAgaWYgKGJtICE9IE1DX05PX0ZS SU5HRV9CSVRNQVApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIG1jX2RyYXdfZnJpbmdl X2JpdG1hcF8xICh3LCByb3csIGxlZnRfcCwgMiwgYm0pOworICAgICAgICAgICAgICBvdmVybGF5 ID0gRVEgKGN1cnNvciwgUWJveCkgPyAzIDogMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQor ICAgIH0KKyAgbWNfZHJhd19mcmluZ2VfYml0bWFwXzEgKHcsIHJvdywgbGVmdF9wLCBvdmVybGF5 LCBNQ19OT19GUklOR0VfQklUTUFQKTsKKyAgaWYgKGxlZnRfcCAmJiByb3ctPm92ZXJsYXlfYXJy b3dfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgbWNfZHJhd19mcmluZ2VfYml0 bWFwXzEgKHcsIHJvdywgMSwgMSwgcm93LT5vdmVybGF5X2Fycm93X2JpdG1hcCk7Cit9CisKKy8q IGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAj ZGVmaW5lIE5PX0ZSSU5HRV9CSVRNQVAgMAogI2RlZmluZSBVTkRFRl9GUklOR0VfQklUTUFQIDEK ICNkZWZpbmUgTUFYX1NUQU5EQVJEX0ZSSU5HRV9CSVRNQVBTIEFSUkFZRUxUUyAoc3RhbmRhcmRf Yml0bWFwcykKQEAgLTE2OTksNiArMzIxNywxNjggQEAgUmV0dXJuIG5pbCBpZiBQT1MgaXMgbm90 IHZpc2libGUgaW4gV0lORE9XLiAgKi8pCiB2b2lkCiBzeW1zX29mX2ZyaW5nZSAodm9pZCkKIHsK KworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExFLUNVUlNPUlMg Ki8KKworICAvKiAoZ2V0ICdlbXB0eS1saW5lICdmcmluZ2UpID0+IDIzID0+IHRoZSBsYXN0IHN0 YW5kYXJkLWJpdG1hcCBiZWZvcmUgdGhpcyBvbmUuCisgIFNlZSBgZnJpbmdlLmVsYC4gKi8KKwor ICAvKiAyNCAqLworICBERUZTWU0gKFFtY192ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3csICIrLXZl cnRpY2FsLWJhci1yaWdodC1hcnJvdyIpOworICBWZnJpbmdlX2JpdG1hcHMgPSBGY29ucyAoUW1j X3ZlcnRpY2FsX2Jhcl9yaWdodF9hcnJvdywgVmZyaW5nZV9iaXRtYXBzKTsKKyAgRnB1dCAoUW1j X3ZlcnRpY2FsX2Jhcl9yaWdodF9hcnJvdywgUWZyaW5nZSwgbWFrZV9maXhudW0gKDI0KSk7Cisg IC8qIChnZXQgJystdm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NjQ0Ci0tLSBhL3NyYy9uc3Rlcm0uaAorKysgYi9z cmMvbnN0ZXJtLmgKQEAgLTY2Myw2ICs2NjMsMTYgQEAgdHlwZWRlZiBpZCBpbnN0YW5jZXR5cGU7 CiAKIEBpbnRlcmZhY2UgRW1hY3NTY3JvbGxlciA6IE5TU2Nyb2xsZXIKICAgeworCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgTlNSZWN0 IG1jX3JlY3RhbmdsZTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgc3RydWN0 IHdpbmRvdyAqd2luZG93OwogICAgc3RydWN0IGZyYW1lICpmcmFtZTsKICAgIE5TUmVzcG9uZGVy ICpwcmV2UmVzcG9uZGVyOwpAQCAtNjgzLDYgKzY5MywxOCBAQCB0eXBlZGVmIGlkIGluc3RhbmNl dHlwZTsKICAgIGludCBlbV93aG9sZTsKICAgIH0KIAorCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLSAodm9pZCltY19zZXRfcmVjdGFuZ2xlOiAo TlNSZWN0KXJlY3Q7CistIChOU1JlY3QpbWNfZ2V0X3JlY3RhbmdsZTsKKy0gKHN0cnVjdCB3aW5k b3cgKiltY19nZXRfd2luZG93OworLSAoYm9vbCltY19qdWRnZTsKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogLSAoaW5zdGFuY2V0eXBlKSBpbml0RnJhbWU6IChOU1JlY3QgKXIgd2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YmIG1jX3RyYXZlcnNlX2NhY2hlX3AgKHMtPnctPm1jX21hdHJpeCwgY2FjaGVf dHlwZSwgdm50aCwgbnRoKTsKKyAgICAgICAgICAgKytudGgpCisgICAgICAgIHsKKyAgICAgICAg ICAvLyAgaW50IHggPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLng7CisgICAgICAgICAgaW50IGZ4ID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5meDsKKyAgICAgICAgICAvLyAgaW50IHkgPSBzLT53LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLnk7CisgICAgICAgICAg aW50IGZ5ID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XS5meTsKKyAgICAgICAgICBpbnQgaHBvcyA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF0uaHBvczsKKyAgICAgICAgICBpbnQgdnBvcyA9IHMtPnctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0udnBvczsKKyAgICAgICAg ICBpbnQgd2QgPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLndkOworICAgICAgICAgIGludCBoID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXS5oOworICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vy c29yX3R5cGUgPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLmN1cnNvcl90eXBlOworICAgICAgICAgIC8vICBpbnQgY3Vyc29yX3dpZHRo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WNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXS5nbHlwaF9mbGF2b3I7CisgICAgICAgICAgYm9vbCBlbmFibGVkX3AgPSBzLT53 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmVuYWJsZWRfcDsK KyAgICAgICAgICBib29sIGdvX3AgPSAodnBvcyA9PSB2bnRoCisgICAgICAgICAgICAgICAgICAg ICAgICYmIGhwb3MgPT0gY3Vyc29yX2dseXBoLT5ocG9zCisgICAgICAgICAgICAgICAgICAgICAg ICYmIGVuYWJsZWRfcCk7CisgICAgICAgICAgaWYgKCFnb19wKQorICAgICAgICAgICAgY29udGlu dWU7CisgICAgICAgICAgTlNSZWN0IHI7CisgICAgICAgICAgci5vcmlnaW4ueCA9IGZ4OworICAg ICAgICAgIHIub3JpZ2luLnkgPSBmeTsKKyAgICAgICAgICByLnNpemUuaGVpZ2h0ID0gaDsKKyAg ICAgICAgICByLnNpemUud2lkdGggPSB3ZDsKKyAgICAgICAgICBbW05TQ29sb3IgY29sb3JXaXRo Q2FsaWJyYXRlZFJlZDogbHNsX2ZnLnJlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGdyZWVuOiBsc2xfZmcuZ3JlZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgYmx1ZTogbHNsX2ZnLmJsdWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBhbHBoYTogMS4wXSBzZXRdOworICAgICAgaWYgKGN1cnNvcl90eXBlID09IE1DX0ZS QU1FRF9CT1gpCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZF UiAocy0+dy0+Y29udGVudHMpOworICAgICAgICAgIGJvb2wgcmVnaW9uX2FjdGl2ZV9wID0gKCFO SUxQIChWdHJhbnNpZW50X21hcmtfbW9kZSkKKyAgICAgIC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AgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAocmVnaW9uX2FjdGl2ZV9wCisg ICAgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgJiYg Y3Vyc29yX2dseXBoLT5jaGFycG9zID09IHJlZ2lvbl9lbmQpCisgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2Vf aWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ZiwgaW50ZXJuICgiKy1yZWFsLWZha2Ut Y3Vyc29yLWF0LXJlZ2lvbi1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICBz dHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2UgPSBGQUNFX0ZST01fSUQg KHMtPmYsIGhvbGxvd19hY3RpdmVfcmVnaW9uX2VuZF9mYWNlX2lkKTsKKyAgICAgICAgICAgICAg ICBOU0NvbG9yICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfY29sb3IgPSBuc19sb29rdXBfaW5k ZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5EIChob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRf ZmFjZSksIHMtPmYpOworICAgICAgICAgICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19hY3Rp dmVfcmVnaW9uX2VuZF9jb2xvcjsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNl IGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgYWN0aXZlX3AK KyAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID4gcmVnaW9u X2JlZworICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPm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gPSBGQUNFX0ZST01fSUQgKHMtPmYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7 CisgICAgICAgICAgICAgICAgICAgIE5TQ29sb3IgKmhvbGxvd19hY3RpdmVfY29sb3IgPSBuc19s b29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5EIChob2xsb3dfYWN0aXZlX2Zh Y2UpLCBzLT5mKTsKKyAgICAgICAgICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2Fj dGl2ZV9jb2xvcjsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2Ug aWYgKCFhY3RpdmVfcCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg ICAgIGVudW0gZmFjZV9pZCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9m YWNlIChzLT53LCBzLT5mLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItaW5hY3RpdmUtcHJl LXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhv bGxvd19pbmFjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBob2xsb3dfaW5hY3RpdmVf ZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgTlNDb2xvciAqaG9sbG93X2luYWN0aXZl X2NvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoaG9s bG93X2luYWN0aXZlX2ZhY2UpLCBzLT5mKTsKKyAgICAgICAgICAgICAgICAgICAgICBob2xsb3df Y29sb3IgPSBob2xsb3dfaW5hY3RpdmVfY29sb3I7CisgICAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgfQorICAgICAgICBlbHNlIGlmIChmYWNlICYmIE5TX0ZBQ0VfQkFDS0dST1VORCAoZmFj ZSkgPT0gbnNfaW5kZXhfY29sb3IgKEZSQU1FX0NVUlNPUl9DT0xPUiAocy0+ZiksIHMtPmYpKQor ICAgICAgICAgIHsKKyAgICAgICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFD RV9GT1JFR1JPVU5EIChmYWNlKSwgcy0+Zikgc2V0XTsKKyAgICAgICAgICAgIGhvbGxvd19jb2xv ciA9IEZSQU1FX0NVUlNPUl9DT0xPUiAocy0+Zik7CisgICAgICAgICAgfQorICAgICAgICAgIHN3 aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGNhc2UgTUNf Tk9fRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAg Y2FzZSBNQ19OT19DVVJTT1I6CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAg IGNhc2UgTUNfUklHSFRfRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgICAgICAgY2FzZSBNQ19MRUZU X0ZSSU5HRV9CSVRNQVA6CisgICAgICAgICAgICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAgICAg ICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAg ICAgICAgICAgY2FzZSBNQ19GUkFNRURfQk9YOgorICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwg KHIpOworICAgICAgICAgICAgICAgIFtob2xsb3dfY29sb3Igc2V0XTsKKyAgICAgICAgICAgICAg ICBOU1JlY3RGaWxsIChOU0luc2V0UmVjdCAociwgMSwgMSkpOworICAgICAgICAgICAgICAgIFtG UkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpIHNldF07CisgICAgICAgICAgICAgICAgYnJlYWs7Cisg ICAgICAgICAgICAgIGNhc2UgTUNfSE9MTE9XX0JPWDoKKyAgICAgICAgICAgICAgICBOU1JlY3RG aWxsIChyKTsKKyAgICAgICAgICAgICAgICBbaG9sbG93X2NvbG9yIHNldF07CisgICAgICAgICAg ICAgICAgTlNSZWN0RmlsbCAoTlNJbnNldFJlY3QgKHIsIDEsIDEpKTsKKyAgICAgICAgICAgICAg ICBbRlJBTUVfQ1VSU09SX0NPTE9SIChzLT5mKSBzZXRdOworICAgICAgICAgICAgICAgIGJyZWFr OworICAgICAgICAgICAgICBjYXNlIE1DX0hCQVI6CisgICAgICAgICAgICAgICAgTlNSZWN0Rmls bCAocik7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgTUNfQkFS OgorICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAgICAgIGJyZWFr OworICAgICAgICAgICAgfQorICAgICAgICAgIC8qIElmIGEgZ2x5cGggZXhpc3RzIChzLT5jaGFy MmIgIT0gTlVMTCksIHRoZW4gZHJhdyB0aGUgZ2x5cGggb24gdG9wIG9mIHRoZQorICAgICAgICAg IG5ld2x5IGRyYXduIHJlY3RhbmdsZSB0aGF0IHdhcyBjcmVhdGVkIGhlcmVpbmFib3ZlLiAgVG8g dGhlIGV4dGVudCB0aGF0IHdlCisgICAgICAgICAgd2FudCB0byBkb3VibGUtaW1wcmludCBnbHlw aHMgdG8gbWFrZSB0aGVtIGFwcGVhciB0byBiZSBzZW1pLWJvbGQsIGl0IGNhbgorICAgICAgICAg IGJlIGRvbmUgaGVyZSBmb3IgYWxsIGN1cnNvciB0eXBlcy4gIFRoZSBib3gtc3R5bGUgY3Vyc29y cyBhcmUgaW1wcmludGVkCisgICAgICAgICAgd2l0aCBnbHlwaHMgb25seSBvbmUgKDEpIHRpbWUu ICBUaGUgc2VtaS1ib2xkIGFwcGVhcmFuY2UgaXMgaGVscGZ1bCB3aGVuCisgICAgICAgICAgZGVi dWdnaW5nIHRvIHNlZSB0aGF0IHRoZSBjb29yZGluYXRlcyBhcmUgY29ycmVjdC4gKi8KKyAgICAg ICAgICBpZiAocy0+Y2hhcjJiICE9IE5VTEwKKyAgICAgICAgICAgICAgJiYgKGN1cnNvcl90eXBl ID09IE1DX0ZJTExFRF9CT1gKKyAgICAgICAgICAgICAgICAgIHx8IGN1cnNvcl90eXBlID09IE1D X0ZSQU1FRF9CT1gKKyAgICAgICAgICAgICAgICAgIHx8IGN1cnNvcl90eXBlID09IE1DX0hPTExP V19CT1gpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBCT09MIGlzQ29tcG9zaXRlID0g cy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIOworICAgICAgICAgICAgICBp ZiAoaXNDb21wb3NpdGUpCisgICAgICAgICAgICAgICAgbnNfZHJhd19jb21wb3NpdGVfZ2x5cGhf c3RyaW5nX2ZvcmVncm91bmQgKHMpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZvbnQgKmZvbnQgPSBzLT5mYWNl LT5mb250OworICAgICAgICAgICAgICAgICAgICBpZiAoIWZvbnQpCisgICAgICAgICAgICAgICAg ICAgICAgZm9udCA9IEZSQU1FX0ZPTlQgKHMtPmYpOworICAgICAgICAgICAgICAgICAgICBib29s IHdpdGhfYmdfcCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBmb250LT5kcml2ZXItPmRy YXcgKHMsIHMtPmNtcF9mcm9tLCBzLT5uY2hhcnMsIHMtPngsIHMtPnliYXNlLCB3aXRoX2JnX3Ap OworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQor ICAvLyAgY2xvY2tfdCBjbG9ja19lbmQgPSBjbG9jaygpOworICAvLyAgZG91YmxlIGNwdV90aW1l X3VzZWQgPSAoKGRvdWJsZSkgKGNsb2NrX2VuZCAtIGNsb2NrX3N0YXJ0KSkgLyBDTE9DS1NfUEVS X1NFQzsKKyAgLy8gIGZwcmludGYgKHN0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AgICAgZW51bSBmYWNlX2lk IGZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1iYXItcHJlLXp2 LWZhY2UiKSwgdHJ1ZSk7CisgICAgIHN0cnVjdCBmYWNlICpmYWNlID0gRkFDRV9GUk9NX0lEIChm LCBmYWNlX2lkKTsKKyAgICAgTlNDb2xvciAqY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xv ciAoTlNfRkFDRV9GT1JFR1JPVU5EIChmYWNlKSwgZik7CisgIC0gIEVYQU1QTEUgT0YgSE9XIFRP IFBSSU5UIEEgQ09MT1IgVE8gU1RERVJSOgorICAgICBMaXNwX09iamVjdCBmb3JlZ3JvdW5kID0g ZmFjZS0+bGZhY2VbTEZBQ0VfRk9SRUdST1VORF9JTkRFWF07CisgICAgIExpc3BfT2JqZWN0IGJh Y2tncm91bmQgPSBmYWNlLT5sZmFjZVtMRkFDRV9CQUNLR1JPVU5EX0lOREVYXTsKKyAgICAgZnBy aW50ZiAoc3RkZXJyLCAiXG5mb3JlZ3JvdW5kICglcykgfCBiYWNrZ3JvdW5kICglcylcbiIsCisg ICAgICAgICAgICAgICAgICAgICAgKCFOSUxQIChmb3JlZ3JvdW5kKSA/IFNTREFUQSAoZm9yZWdy b3VuZCkgOiAiTklMUCIpLAorICAgICAgICAgICAgICAgICAgICAgICghTklMUCAoYmFja2dyb3Vu ZCkgPyBTU0RBVEEgKGJhY2tncm91bmQpIDogIk5JTFAiKSk7CisgIC0gIEVYQU1QTEUgT0YgSE9X IFRPIENSRUFURSBBIENPTE9SIFdJVEggUkdCL0xTTCBmbG9hdCB2YWx1ZXM6CisgICAgIE5TQ29s b3IgKm15X2NvbG9yID0gW05TQ29sb3IgY29sb3JXaXRoQ2FsaWJyYXRlZFJlZDogMS4wCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBncmVlbjogMS4w CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmx1 ZTogMS4wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBhbHBoYTogMS4wXTsKKyAgLSAgQUxURVJOQVRJVkUgRVhBTVBMRToKKyAgICAgZW51bSBmYWNl X2lkIGRlYnVnZ2luZ19mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMtPmYsIGlu dGVybiAoIistZGVidWdnaW5nLWZhY2UiKSwgdHJ1ZSk7CisgICAgIHN0cnVjdCBmYWNlICpkZWJ1 Z2dpbmdfZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgZGVidWdnaW5nX2ZhY2VfaWQpOworICAg ICBOU0NvbG9yICpjb2xvciA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVH Uk9VTkQgKGRlYnVnZ2luZ19mYWNlKSwgcy0+Zik7CisgICAgIFtjb2xvciBzZXRdOyAqLworICBp ZiAoZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBICisgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNf R0xZUEhMRVNTKQorICAgIFtbTlNDb2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiBsc2wucmVk CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JlZW46IGxzbC5ncmVlbgorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBibHVlOiBsc2wuYmx1ZQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGFscGhhOiAxLjBdIHNldF07CisgICAgZWxzZQorICAgICAgW0ZSQU1F X0NVUlNPUl9DT0xPUiAoZikgc2V0XTsKKyAgaWYgKGN1cnNvcl90eXBlID09IE1DX0ZSQU1FRF9C T1gpCisgICAgeworICAgICAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKHctPmNvbnRlbnRz KTsKKyAgICAgIGJvb2wgc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KKyAgICAgICAgfQorICAgICAg ICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgJiYgYWN0aXZlX3AK KyAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID09IHJlZ2lvbl9lbmQp CisgICAgICAgICAgeworICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVn aW9uX2VuZF9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVh bC1mYWtlLWN1cnNvci1hdC1yZWdpb24tcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAg ICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2UgPSBGQUNFX0ZST01f SUQgKGYsIGhvbGxvd19hY3RpdmVfcmVnaW9uX2VuZF9mYWNlX2lkKTsKKyAgICAgICAgICAgIE5T Q29sb3IgKmhvbGxvd19hY3RpdmVfcmVnaW9uX2VuZF9jb2xvciA9IG5zX2xvb2t1cF9pbmRleGVk X2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGhvbGxvd19hY3RpdmVfcmVnaW9uX2VuZF9mYWNl KSwgZik7CisgICAgICAgICAgICBob2xsb3dfY29sb3IgPSBob2xsb3dfYWN0aXZlX3JlZ2lvbl9l bmRfY29sb3I7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKHJlZ2lvbl9hY3RpdmVf cAorICAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgJiYg Y3Vyc29yX2dseXBoLT5jaGFycG9zID4gcmVnaW9uX2JlZworICAgICAgICAgICAgICAgICAgICYm IGN1cnNvcl9nbHlwaC0+Y2hhcnBvcyA8IHJlZ2lvbl9lbmQpCisgICAgICAgICAgICB7CisgICAg ICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xs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CQUNLR1JPVU5E IChob2xsb3dfYWN0aXZlX2ZhY2UpLCBmKTsKKyAgICAgICAgICAgICAgICBob2xsb3dfY29sb3Ig PSBob2xsb3dfYWN0aXZlX2NvbG9yOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIC8q IFRoZSByZWdpb24gaXMgX25vdF8gdmlzaWJsZSBpbiB0aGUgaW5hY3RpdmUgd2luZG93IGJlY2F1 c2UgdGhlIG92ZXJsYXkgd2luZG93IHByb3BlcnR5IGlzIHVzZWQuICovCisgICAgICAgICAgICAg IGVsc2UgaWYgKCFhY3RpdmVfcCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFj ZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNl IiksIHRydWUpOworICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19pbmFjdGl2 ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCk7CisgICAg ICAgICAgICAgICAgICBOU0NvbG9yICpob2xsb3dfaW5hY3RpdmVfY29sb3IgPSBuc19sb29rdXBf aW5kZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5EIChob2xsb3dfaW5hY3RpdmVfZmFjZSks IGYpOworICAgICAgICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2luYWN0aXZlX2Nv bG9yOworICAgICAgICAgICAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZiAoZmFjZSAmJiBOU19G QUNFX0JBQ0tHUk9VTkQgKGZhY2UpID09IG5zX2luZGV4X2NvbG9yIChGUkFNRV9DVVJTT1JfQ09M T1IgKGYpLCBmKSkKKyAgICAgIHsKKyAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChO U19GQUNFX0ZPUkVHUk9VTkQgKGZhY2UpLCBmKSBzZXRdOworICAgICAgICBob2xsb3dfY29sb3Ig PSBGUkFNRV9DVVJTT1JfQ09MT1IgKGYpOworICAgICAgfQorI2lmZGVmIE5TX0lNUExfQ09DT0EK KyAgTlNEaXNhYmxlU2NyZWVuVXBkYXRlcyAoKTsKKyNlbmRpZgorICBzd2l0Y2ggKGN1cnNvcl90 eXBlKQorICAgIHsKKyAgICAgIGNhc2UgTUNfTk9fRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgYnJl YWs7CisgICAgICBjYXNlIE1DX05PX0NVUlNPUjoKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNl IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19M RUZUX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19GSUxMRURf Qk9YOgorICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNl IE1DX0ZSQU1FRF9CT1g6CisgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICBbaG9sbG93 X2NvbG9yIHNldF07CisgICAgICAgIE5TUmVjdEZpbGwgKE5TSW5zZXRSZWN0IChyLCAxLCAxKSk7 CisgICAgICAgIFtGUkFNRV9DVVJTT1JfQ09MT1IgKGYpIHNldF07CisgICAgICAgIGJyZWFrOwor ICAgICAgY2FzZSBNQ19IT0xMT1dfQk9YOgorICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAg ICAgW2hvbGxvd19jb2xvciBzZXRdOworICAgICAgICBOU1JlY3RGaWxsIChOU0luc2V0UmVjdCAo ciwgMSwgMSkpOworICAgICAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChmKSBzZXRdOworICAgICAg ICBicmVhazsKKyAgICAgIGNhc2UgTUNfSEJBUjoKKyAgICAgICAgTlNSZWN0RmlsbCAocik7Cisg ICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19CQVI6CisgICAgICAgIHMgPSByOworICAgICAg ICAvKiBAbGF3bGlzdCBpcyBmb2N1c2luZyB0aGUgaW5pdGlhbCBkZXZlbG9wbWVudCBvZiBmZWF0 dXJlIHJlcXVlc3RzCisgICAgICAgICMxNzY4NCBhbmQgIzIyODczIG9uIEwyUiBsYW5ndWFnZXMu ICovCisgICAgICAgIGlmIChnbHlwaF9mbGF2b3IgIT0gTUNfR0xZUEgKKyAgICAgICAgICAgICYm IGdseXBoX2ZsYXZvciAhPSBNQ19HTFlQSExFU1MpCisgICAgICAgICAgeworICAgICAgICAgICAg LyogSWYgdGhlIGNoYXJhY3RlciB1bmRlciBjdXJzb3IgaXMgUjJMLCBkcmF3IHRoZSBiYXIgY3Vy c29yCisgICAgICAgICAgICAgICBvbiB0aGUgcmlnaHQgb2YgaXRzIGdseXBoLCByYXRoZXIgdGhh biBvbiB0aGUgbGVmdC4gKi8KKyAgICAgICAgICAgIGlmICgoY3Vyc29yX2dseXBoLT5yZXNvbHZl ZF9sZXZlbCAmIDEpICE9IDApCisgICAgICAgICAgICAgIHMub3JpZ2luLnggKz0gY3Vyc29yX2ds eXBoLT5waXhlbF93aWR0aCAtIHMuc2l6ZS53aWR0aDsKKyAgICAgICAgICB9CisgICAgICAgIE5T UmVjdEZpbGwgKHMpOworICAgICAgICBicmVhazsKKyAgICB9CisgIG5zX3Jlc2V0X2NsaXBwaW5n IChmKTsKKyAgLyogZHJhdyB0aGUgY2hhcmFjdGVyIHVuZGVyIHRoZSBjdXJzb3IgKi8KKyAgaWYg KGdseXBoX2ZsYXZvciAhPSBNQ19HTFlQSExFU1MKKyAgICAgICYmIChjdXJzb3JfdHlwZSA9PSBN Q19GUkFNRURfQk9YCisgICAgICAgICAgfHwgY3Vyc29yX3R5cGUgPT0gTUNfRklMTEVEX0JPWAor ICAgICAgICAgIHx8IGN1cnNvcl90eXBlID09IE1DX0hPTExPV19CT1gKKyAgICAgICAgICB8fCAo ZGVidWdfcAorICAgICAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19IQkFSKQorICAgICAg ICAgIHx8IChkZWJ1Z19wCisgICAgICAgICAgICAgICYmIGN1cnNvcl90eXBlID09IE1DX0JBUikp KQorICAgIHsKKyAgICAgIC8qIGBjdXJzb3JfZ2NfcGAgaXMgdXNlZCBvbmx5IGJ5IGB3MzJ0ZXJt LmNgIGFuZCBgeHRlcm0uYycuICovCisgICAgICBib29sIGN1cnNvcl9nY19wID0gZmFsc2U7Cisg ICAgICBjb25zdCBFbWFjc19SZWN0YW5nbGUgKnNhdmVkX2NsaXAgPSBOVUxMOworICAgICAgaWYg KHJvdy0+Y2xpcCAhPSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgc2F2ZWRfY2xpcCA9IHJv dy0+Y2xpcDsKKyAgICAgICAgICByb3ctPmNsaXAgPSBOVUxMOworICAgICAgICB9CisgICAgICBt Y19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4LCBocG9z LCB2cG9zLCBsc2wsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGhfZmxhdm9yLCBj dXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9wLCBjdXJzb3JfZ2NfcCk7CisgICAgICBpZiAoc2F2ZWRf Y2xpcCAhPSBOVUxMKQorICAgICAgICByb3ctPmNsaXAgPSBzYXZlZF9jbGlwOworICAgIH0KKyNp ZmRlZiBOU19JTVBMX0NPQ09BCisgIE5TRW5hYmxlU2NyZWVuVXBkYXRlcyAoKTsKKyNlbmRpZgor fQorCitzdGF0aWMgdm9pZAorbWNfbnNfZHJhd190ZXh0X2RlY29yYXRpb24gKHN0cnVjdCBnbHlw aF9zdHJpbmcgKnMsIHN0cnVjdCBmYWNlICpmYWNlLAorICAgICAgICAgICAgICAgICAgICAgICAg IE5TQ29sb3IgKm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d2FzIHVuZGVybGluZWQsIG1h dGNoIGl0cyBhcHBlYXJhbmNlLiAqLworICAgICAgICAgICAgaWYgKHMtPnByZXYgJiYgcy0+cHJl di0+ZmFjZS0+dW5kZXJsaW5lX3AKKyAgICAgICAgICAgICAgICAmJiBzLT5wcmV2LT5mYWNlLT51 bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX0xJTkUKKyAgICAgICAgICAgICAgICAmJiBzLT5w cmV2LT51bmRlcmxpbmVfdGhpY2tuZXNzID4gMCkKKyAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgIHRoaWNrbmVzcyA9IHMtPnByZXYtPnVuZGVybGluZV90aGlja25lc3M7CisgICAgICAg ICAgICAgICAgcG9zaXRpb24gPSBzLT5wcmV2LT51bmRlcmxpbmVfcG9zaXRpb247CisgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAgIHN0cnVjdCBmb250ICpmb250OworICAgICAgICAgICAgICAgICAgdW5zaWduZWQg bG9uZyBkZXNjZW50OworICAgICAgICAgICAgICAgICAgZm9udD1zLT5mb250OworICAgICAgICAg ICAgICAgICAgZGVzY2VudCA9IHMtPnkgKyBzLT5oZWlnaHQgLSBzLT55YmFzZTsKKyAgICAgICAg ICAgICAgICAgIC8qIFVzZSB1bmRlcmxpbmUgdGhpY2tuZXNzIG9mIGZvbnQsIGRlZmF1bHRpbmcg dG8gMS4gKi8KKyAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IChmb250ICYmIGZvbnQtPnVu ZGVybGluZV90aGlja25lc3MgPiAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBm b250LT51bmRlcmxpbmVfdGhpY2tuZXNzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IDE7CisgICAgICAgICAgICAgICAgICAvKiBEZXRlcm1pbmUgdGhlIG9mZnNldCBvZiB1bmRlcmxp bmluZyBmcm9tIHRoZSBiYXNlbGluZS4gKi8KKyAgICAgICAgICAgICAgICAgIGlmICh4X3VuZGVy bGluZV9hdF9kZXNjZW50X2xpbmUpCisgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gZGVz Y2VudCAtIHRoaWNrbmVzczsKKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoeF91c2VfdW5k ZXJsaW5lX3Bvc2l0aW9uX3Byb3BlcnRpZXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgZm9udCAmJiBmb250LT51bmRlcmxpbmVfcG9zaXRpb24gPj0gMCkKKyAgICAgICAgICAgICAg ICAgICAgICBwb3NpdGlvbiA9IGZvbnQtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAg ICAgICAgICAgICBlbHNlIGlmIChmb250KQorICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRp b24gPSBscm91bmQgKGZvbnQtPmRlc2NlbnQgLyAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSB1bmRlcmxpbmVfbWlu aW11bV9vZmZzZXQ7CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IG1heCAocG9zaXRpb24s IHVuZGVybGluZV9taW5pbXVtX29mZnNldCk7CisgICAgICAgICAgICAgICAgICAvKiBFbnN1cmUg dW5kZXJsaW5pbmcgaXMgbm90IGNyb3BwZWQuICovCisgICAgICAgICAgICAgICAgICBpZiAoZGVz Y2VudCA8PSBwb3NpdGlvbikKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg ICAgICAgIHBvc2l0aW9uID0gZGVzY2VudCAtIDE7CisgICAgICAgICAgICAgICAgICAgICAgdGhp Y2tuZXNzID0gMTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBl bHNlIGlmIChkZXNjZW50IDwgcG9zaXRpb24gKyB0aGlja25lc3MpCisgICAgICAgICAgICAgICAg ICAgICAgdGhpY2tuZXNzID0gMTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICBzLT51 bmRlcmxpbmVfdGhpY2tuZXNzID0gdGhpY2tuZXNzOworICAgICAgICAgICAgcy0+dW5kZXJsaW5l X3Bvc2l0aW9uID0gcG9zaXRpb247CisgICAgICAgICAgICByID0gTlNNYWtlUmVjdCAoeCwgcy0+ eWJhc2UgKyBwb3NpdGlvbiwgd2lkdGgsIHRoaWNrbmVzcyk7CisgICAgICAgICAgICBpZiAoZmFj ZS0+dW5kZXJsaW5lX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgICBbZGVmYXVsdENvbCBzZXRd OworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgW25zX2xvb2t1cF9pbmRleGVk X2NvbG9yIChmYWNlLT51bmRlcmxpbmVfY29sb3IsIHMtPmYpIHNldF07CisgICAgICAgICAgICBO U1JlY3RGaWxsIChyKTsKKyAgICAgICAgICB9CisgICAgfQorICAvKiBEbyBvdmVybGluZS4gV2Ug Zm9sbG93IG90aGVyIHRlcm1zIGluIHVzaW5nIGEgdGhpY2tuZXNzIG9mIDEKKyAgICAgYW5kIGln bm9yaW5nIG92ZXJsaW5lX21hcmdpbi4gKi8KKyAgaWYgKGZhY2UtPm92ZXJsaW5lX3ApCisgICAg eworICAgICAgTlNSZWN0IHI7CisgICAgICByID0gTlNNYWtlUmVjdCAoeCwgcy0+eSwgd2lkdGgs IDEpOworICAgICAgaWYgKGZhY2UtPm92ZXJsaW5lX2NvbG9yX2RlZmF1bHRlZF9wKQorICAgICAg ICBbZGVmYXVsdENvbCBzZXRdOworICAgICAgICBlbHNlCisgICAgICAgICAgW25zX2xvb2t1cF9p bmRleGVkX2NvbG9yIChmYWNlLT5vdmVybGluZV9jb2xvciwgcy0+Zikgc2V0XTsKKyAgICAgIE5T UmVjdEZpbGwgKHIpOworICAgIH0KKyAgLyogRG8gc3RyaWtlLXRocm91Z2guICBXZSBmb2xsb3cg b3RoZXIgdGVybXMgZm9yIHRoaWNrbmVzcyBhbmQKKyAgICAgdmVydGljYWwgcG9zaXRpb24uKi8K KyAgaWYgKGZhY2UtPnN0cmlrZV90aHJvdWdoX3ApCisgICAgeworICAgICAgTlNSZWN0IHI7Cisg ICAgICB1bnNpZ25lZCBsb25nIGR5OworICAgICAgZHkgPSBscmludCAoKHMtPmhlaWdodCAtIDEp IC8gMik7CisgICAgICByID0gTlNNYWtlUmVjdCAoeCwgcy0+eSArIGR5LCB3aWR0aCwgMSk7Cisg ICAgICBpZiAoZmFjZS0+c3RyaWtlX3Rocm91Z2hfY29sb3JfZGVmYXVsdGVkX3ApCisgICAgICAg IFtkZWZhdWx0Q29sIHNldF07CisgICAgICAgIGVsc2UKKyAgICAgICAgICBbbnNfbG9va3VwX2lu ZGV4ZWRfY29sb3IgKGZhY2UtPnN0cmlrZV90aHJvdWdoX2NvbG9yLCBzLT5mKSBzZXRdOworICAg ICAgTlNSZWN0RmlsbCAocik7CisgICAgfQorfQorCitzdGF0aWMgdm9pZAorbWNfbnNfZHVtcGds eXBoc19zdHJldGNoIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4 ICptYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJv dywgaW50IHdkKQoreworICBOU1JlY3QgclsyXTsKKyAgaW50IG4sIGk7CisgIHN0cnVjdCBmYWNl ICpmYWNlOworICBOU0NvbG9yICpmZ0NvbCwgKmJnQ29sOworICBpZiAoIXMtPmJhY2tncm91bmRf ZmlsbGVkX3ApCisgICAgeworICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0 IChzLCByKTsKKyAgICAgICpyID0gTlNNYWtlUmVjdCAocy0+eCwgcy0+eSwgcy0+YmFja2dyb3Vu ZF93aWR0aCwgcy0+aGVpZ2h0KTsKKyAgICAgIGlmICghbnNfY2xpcF90b19yZWN0IChzLT5mLCBy LCBuKSkKKyAgICAgICAgcmV0dXJuOworICAgICAgaWYgKHMtPmhsID09IERSQVdfTU9VU0VfRkFD RSkKKyAgICAgICAgeworICAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIE1PVVNF X0hMX0lORk8gKHMtPmYpLT5tb3VzZV9mYWNlX2ZhY2VfaWQpOworICAgICAgICAgIGlmICghZmFj ZSkKKyAgICAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIE1PVVNFX0ZBQ0VfSUQp OworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQg KHMtPmYsIHMtPmZpcnN0X2dseXBoLT5mYWNlX2lkKTsKKyAgICAgIGJnQ29sID0gbnNfbG9va3Vw X2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoZmFjZSksIHMtPmYpOworICAgICAg ZmdDb2wgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChmYWNl KSwgcy0+Zik7CisgICAgICBmb3IgKGkgPSAwOyBpIDwgbjsgKytpKQorICAgICAgICB7CisgICAg ICAgICAgaWYgKCFzLT5yb3ctPmZ1bGxfd2lkdGhfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgaW50IG92ZXJydW4sIGxlZnRvdmVycnVuOworICAgICAgICAgICAgICAvKiB0cnVuY2F0 ZSB0byBhdm9pZCBvdmVyd3JpdGluZyBmcmluZ2UgYW5kL29yIHNjcm9sbGJhciAqLworICAgICAg ICAgICAgICBvdmVycnVuID0gbWF4ICgwLCAocy0+eCArIHMtPmJhY2tncm91bmRfd2lkdGgpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIChXSU5ET1dfQk9YX1JJR0hUX0VER0Vf WCAocy0+dykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gV0lORE9XX1JJR0hUX0ZS SU5HRV9XSURUSCAocy0+dykpKTsKKyAgICAgICAgICAgICAgICAgICAgcltpXS5zaXplLndpZHRo IC09IG92ZXJydW47CisgICAgICAgICAgICAgIC8qIHRydW5jYXRlIHRvIGF2b2lkIG92ZXJ3cml0 aW5nIHRvIGxlZnQgb2YgdGhlIHdpbmRvdyBib3ggKi8KKyAgICAgICAgICAgICAgbGVmdG92ZXJy dW4gPSAoV0lORE9XX0JPWF9MRUZUX0VER0VfWCAocy0+dykKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKyBXSU5ET1dfTEVGVF9GUklOR0VfV0lEVEggKHMtPncpKSAtIHMtPng7CisgICAg ICAgICAgICAgIGlmIChsZWZ0b3ZlcnJ1biA+IDApCisgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgcltpXS5vcmlnaW4ueCArPSBsZWZ0b3ZlcnJ1bjsKKyAgICAgICAgICAgICAg ICAgIHJbaV0uc2l6ZS53aWR0aCAtPSBsZWZ0b3ZlcnJ1bjsKKyAgICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICAgIC8qIFhYWDogVHJ5IHRvIHdvcmsgYmV0d2VlbiBwcm9ibGVtIHdoZXJlIGEg c3RyZXRjaCBnbHlwaCBvbgorICAgICAgICAgICAgICAgICBhIHBhcnRpYWxseS12aXNpYmxlIGJv dHRvbSByb3cgd2lsbCBjbGVhciBwYXJ0IG9mIHRoZQorICAgICAgICAgICAgICAgICBtb2RlbGlu ZSwgYW5kIGFub3RoZXIgd2hlcmUgbGlzdC1idWZmZXJzIGhlYWRlcnMgYW5kIHNpbWlsYXIKKyAg ICAgICAgICAgICAgICAgcm93cyBlcnJvbmVvdXNseSBoYXZlIHZpc2libGVfaGVpZ2h0IHNldCB0 byAwLiAgTm90IHN1cmUKKyAgICAgICAgICAgICAgICAgd2hlcmUgdGhpcyBpcyBjb21pbmcgZnJv bSBhcyBvdGhlciB0Z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mYWNlID0gRkFDRV9G Uk9NX0lEIChzLT5mLCBkZWJ1Z2dpbmdfZmFjZV9pZCk7CisgICAgICAgICAgICAgIC8vICBOU0Nv bG9yICpjb2xvciA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQg KGRlYnVnZ2luZ19mYWNlKSwgcy0+Zik7CisgICAgICAgICAgICAgIC8vICBbY29sb3Igc2V0XTsK KyAgICAgICAgICAgICAgQ0dGbG9hdCB4ID0gcltpXS5vcmlnaW4ueDsKKyAgICAgICAgICAgICAg Q0dGbG9hdCB3aWR0aCA9IHdkOworICAgICAgICAgICAgICByW2ldLnNpemUud2lkdGggLT0gd2lk dGg7CisgICAgICAgICAgICAgIHJbaV0ub3JpZ2luLnggKz0gd2lkdGg7CisgICAgICAgICAgICAg IE5TUmVjdEZpbGwgKHJbaV0pOworICAgICAgICAgICAgICAvKiBEcmF3IG92ZXJsaW5pbmcsIGV0 Yy4gb24gdGhlIGN1cnNvci4gKi8KKyAgICAgICAgICAgICAgaWYgKHMtPnctPnBoeXNfY3Vyc29y X3R5cGUgPT0gTUNfRklMTEVEX0JPWCkKKyAgICAgICAgICAgICAgICBtY19uc19kcmF3X3RleHRf ZGVjb3JhdGlvbiAocywgZmFjZSwgYmdDb2wsIHdpZHRoLCB4KTsKKyAgICAgICAgICAgICAgICBl bHNlCisgICAgICAgICAgICAgICAgICBtY19uc19kcmF3X3RleHRfZGVjb3JhdGlvbiAocywgZmFj ZSwgZmdDb2wsIHdpZHRoLCB4KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAg ICAgICAgICB7CisgIC8vICBpbnQgcnggPSByW2ldLm9yaWdpbi54OworICAvLyAgaW50IHJ5ID0g cltpXS5vcmlnaW4ueTsKKyAgLy8gIGludCBydyA9IHJbaV0uc2l6ZS53aWR0aDsKKyAgLy8gIGlu dCByaCA9IHJbaV0uc2l6ZS5oZWlnaHQ7CisgIC8vICBmcHJp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T3ZlcgorICAgICAgICAgICAgICBmcmFjdGlvbjogMS4wCisgICAgICAg ICAgIHJlc3BlY3RGbGlwcGVkOiBZRVMKKyAgICAgICAgICAgICAgICBoaW50czogbmlsXTsKKyNl bHNlCisgICAgICBbaW1nIGNvbXBvc2l0ZVRvUG9pbnQ6IE5TTWFrZVBvaW50ICh4LCB5ICsgcy0+ c2xpY2UuaGVpZ2h0KQorICAgICAgICAgICAgICAgICAgb3BlcmF0aW9uOiBOU0NvbXBvc2l0ZVNv dXJjZU92ZXJdOworI2VuZGlmCisgICAgfQorICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IpCisg ICAgeworICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAocy0+Zikgc2V0XTsKKyAgICAgIGlmIChz LT53LT5waHlzX2N1cnNvcl90eXBlID09IE1DX0ZJTExFRF9CT1gpCisgICAgICAgIHRkQ29sID0g bnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoZmFjZSksIHMtPmYp OworICAgICAgICBlbHNlCisgICAgICAgICAgLyogQ3VycmVudGx5IG9uIE5TIGltZy0+bWFzayBp cyBhbHdheXMgMC4gU2luY2UKKyAgICAgICAgICAgICBnZXRfd2luZG93X2N1cnNvcl90eXBlIHNw ZWNpZmllcyBhIGhvbGxvdyBib3ggY3Vyc29yIHdoZW4gb24KKyAgICAgICAgICAgICBhIG5vbi1t YXNrZWQgaW1hZ2Ugd2UgbmV2ZXIgcmVhY2ggdGhpcyBjbGF1c2UuIEJ1dCB3ZSBwdXQgaXQKKyAg ICAgICAgICAgICBpbiBpbiBhbnRpY2lwYXRpb24gb2YgYmV0dGVyIHN1cHBvcnQgZm9yIGltYWdl IG1hc2tzIG9uIE5TLiAqLworICAgICAgICAgIHRkQ29sID0gbnNfbG9va3VwX2luZGV4ZWRfY29s b3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoZmFjZSksIHMtPmYpOworICAgIH0KKyAgICBlbHNlCisg ICAgICB0ZENvbCA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQg KGZhY2UpLCBzLT5mKTsKKyAgLyogRHJhdyB1bmRlcmxpbmUsIG92ZXJsaW5lLCBzdHJpa2UtdGhy b3VnaC4gKi8KKyAgbWNfbnNfZHJhd190ZXh0X2RlY29yYXRpb24gKHMsIGZhY2UsIHRkQ29sLCBi ci5zaXplLndpZHRoLCBici5vcmlnaW4ueCk7CisgIC8qIERyYXcgcmVsaWVmLCBpZiByZXF1ZXN0 ZWQgKi8KKyAgaWYgKHMtPmltZy0+cmVsaWVmIHx8IHMtPmhsID09RFJBV19JTUFHRV9SQUlTRUQg fHwgcy0+aGwgPT1EUkFXX0lNQUdFX1NVTktFTikKKyAgICB7CisgICAgICBpZiAocy0+aGwgPT0g RFJBV19JTUFHRV9TVU5LRU4gfHwgcy0+aGwgPT0gRFJBV19JTUFHRV9SQUlTRUQpCisgICAgICAg IHsKKyAgICAgICAgICB0aCA9IHRvb2xfYmFyX2J1dHRvbl9yZWxpZWYgPj0gMCA/CisgICAgICAg ICAgICB0b29sX2Jhcl9idXR0b25fcmVsaWVmIDogREVGQVVMVF9UT09MX0JBUl9CVVRUT05fUkVM SUVGOworICAgICAgICAgIHJhaXNlZF9wID0gKHMtPmhsID09IERSQVdfSU1BR0VfUkFJU0VEKTsK KyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgdGggPSBh YnMgKHMtPmltZy0+cmVsaWVmKTsKKyAgICAgICAgICAgIHJhaXNlZF9wID0gKHMtPmltZy0+cmVs aWVmID4gMCk7CisgICAgICAgICAgfQorICAgICAgci5vcmlnaW4ueCA9IHggLSB0aDsKKyAgICAg IHIub3JpZ2luLnkgPSB5IC0gdGg7CisgICAgICByLnNpemUud2lkdGggPSBzLT5zbGljZS53aWR0 aCArIDIqdGgtMTsKKyAgICAgIHIuc2l6ZS5oZWlnaHQgPSBzLT5zbGljZS5oZWlnaHQgKyAyKnRo LTE7CisgICAgICBuc19kcmF3X3JlbGllZiAociwgdGgsIHJhaXNlZF9wLAorICAgICAgICAgICAg ICAgICAgICAgIHMtPnNsaWNlLnkgPT0gMCwKKyAgICAgICAgICAgICAgICAgICAgICBzLT5zbGlj ZS55ICsgcy0+c2xpY2UuaGVpZ2h0ID09IHMtPmltZy0+aGVpZ2h0LAorICAgICAgICAgICAgICAg ICAgICAgIHMtPnNsaWNlLnggPT0gMCwKKyAgICAgICAgICAgICAgICAgICAgICBzLT5zbGljZS54 ICsgcy0+c2xpY2Uud2lkdGggPT0gcy0+aW1nLT53aWR0aCwgcyk7CisgICAgfQorICAvKiBJZiB0 aGVyZSBpcyBubyBtYXNrLCB0aGUgYmFja2dyb3VuZCB3b24ndCBiZSBzZWVuLAorICAgICBzbyBk cmF3IGEgcmVjdGFuZ2xlIG9uIHRoZSBpbWFnZSBmb3IgdGhlIGN1cnNvci4KKyAgICAgRG8gdGhp cyBmb3IgYWxsIGltYWdlcywgZ2V0dGluZyB0cmFuc3BhcmVuY3kgcmlnaHQgaXMgbm90IHJlbGlh YmxlLiAqLworICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IpCisgICAgeworICAgICAgaW50IHRo aWNrbmVzcyA9IGFicyAocy0+aW1nLT5yZWxpZWYpOworICAgICAgaWYgKHRoaWNrbmVzcyA9PSAw KSB0aGlja25lc3MgPSAxOworICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEgKKyAgICAg ICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBITEVTUykKKyAgICAgIHsKKyAgICAgICAgTlND b2xvciAqYm9yZGVyX2NvbG9yID0gW05TQ29sb3IgY29sb3JXaXRoQ2FsaWJyYXRlZFJlZDogbHNs LnJlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGdyZWVuOiBsc2wuZ3JlZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgYmx1ZTogbHNsLmJsdWUKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHBoYTogMS4wXTsK KyAgICAgICAgbnNfZHJhd19ib3ggKGJyLCB0aGlja25lc3MsIGJvcmRlcl9jb2xvciwgMSwgMSk7 CisgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIG5zX2RyYXdfYm94IChiciwgdGhpY2tuZXNz LCBGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpLCAxLCAxKTsKKyAgICB9Cit9CisKK3N0YXRpYyB2 b2lkCittY19uc19tYXliZV9kdW1wZ2x5cGhzX2JhY2tncm91bmQgKHN0cnVjdCBnbHlwaF9zdHJp bmcgKnMsIGNoYXIgZm9yY2VfcCkKK3sKKyAgTlNUUkFDRSAoIm1jX25zX21heWJlX2R1bXBnbHlw aHNfYmFja2dyb3VuZCIpOworICBpZiAoIXMtPmJhY2tncm91bmRfZmlsbGVkX3AvKiB8fCBzLT5o bCA9PSBEUkFXX01PVVNFX0ZBQ0UqLykKKyAgICB7CisgICAgICBpbnQgYm94X2xpbmVfd2lkdGgg PSBtYXggKHMtPmZhY2UtPmJveF9saW5lX3dpZHRoLCAwKTsKKyAgICAgIGlmIChGT05UX0hFSUdI VCAocy0+Zm9udCkgPCBzLT5oZWlnaHQgLSAyICogYm94X2xpbmVfd2lkdGgKKyAgICAgICAgICAv KiBXaGVuIHhkaXNwLmMgaWdub3JlcyBGT05UX0hFSUdIVCwgd2UgY2Fubm90IHRydXN0IGZvbnQK KyAgICAgICAgICAgICBkaW1lbnNpb25zLCBzaW5jZSB0aGUgYWN0dWFsIGdseXBocyBtaWdodCBi ZSBtdWNoCisgICAgICAgICAgICAgc21hbGxlci4gIFNvIGluIHRoYXQgY2FzZSB3ZSBhbHdheXMg Y2xlYXIgdGhlIHJlY3RhbmdsZQorICAgICAgICAgICAgIHdpdGggYmFja2dyb3VuZCBjb2xvci4g Ki8KKyAgICAgICAgICB8fCBGT05UX1RPT19ISUdIIChzLT5mb250KQorICAgICAgICAgIHx8IHMt PmZvbnRfbm90X2ZvdW5kX3AgfHwgcy0+ZXh0ZW5kc190b19lbmRfb2ZfbGluZV9wIHx8IGZvcmNl X3ApCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZmFjZSAqZmFjZTsKKyAgICAgICAgICBp ZiAocy0+aGwgPT0gRFJBV19NT1VTRV9GQUNFKQorICAgICAgICAgICAgeworICAgICAgICAgICAg ICBmYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBNT1VTRV9ITF9JTkZPIChzLT5mKS0+bW91c2Vf ZmFjZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgaWYgKCFmYWNlKQorICAgICAgICAgICAgICAg IGZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIE1PVVNFX0ZBQ0VfSUQpOworICAgICAgICAgICAg fQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBmYWNlID0gRkFDRV9GUk9NX0lEIChz LT5mLCBzLT5maXJzdF9nbHlwaC0+ZmFjZV9pZCk7CisgICAgICAgICAgaWYgKCFmYWNlLT5zdGlw cGxlKQorICAgICAgICAgICAgWyhOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpICE9IDAKKyAgICAg ICAgICAgICAgPyBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5EIChm YWNlKSwgcy0+ZikKKyAgICAgICAgICAgICAgOiBGUkFNRV9CQUNLR1JPVU5EX0NPTE9SIChzLT5m KSkgc2V0XTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgIHN0cnVjdCBuc19kaXNwbGF5X2luZm8gKmRweWluZm8gPSBGUkFNRV9ESVNQTEFZX0lORk8g KHMtPmYpOworICAgICAgICAgICAgICAgIFtbZHB5aW5mby0+Yml0bWFwc1tmYWNlLT5zdGlwcGxl LTFdLmltZyBzdGlwcGxlTWFza10gc2V0XTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIGlm IChzLT5obCAhPSBEUkFXX0NVUlNPUikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgcy0+ cmVjdGFuZ2xlX251a2VkX3AgPSB0cnVlOworICAgICAgICAgICAgICBOU1JlY3QgciA9IE5TTWFr ZVJlY3QgKHMtPngsIHMtPnkgKyBib3hfbGluZV93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHMtPmJhY2tncm91bmRfd2lkdGgsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBzLT5oZWlnaHQtMipib3hfbGluZV93aWR0aCk7CisgICAgICAgICAg ICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAgfQorICAgICAgICAgIHMtPmJhY2tncm91 bmRfZmlsbGVkX3AgPSAxOworICAgICAgICB9CisgICAgfQorfQorCitzdGF0aWMgdm9pZAorbWNf bnNfZHJhd19nbHlwaF9zdHJpbmcgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMsIHN0cnVjdCBnbHlw aF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAgICAg ICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsLCBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3Is CisgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlw ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgd2QsIGJvb2wgYWN0aXZlX3AsIGJvb2wg Y3Vyc29yX2djX3ApCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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b19yZWN0IChzLT5mLCByLCBuKSkKKyAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAg ICAgICAgICAgICBtY19uc19tYXliZV9kdW1wZ2x5cGhzX2JhY2tncm91bmQgKHMtPm5leHQsIDEp OworICAgICAgICAgICAgICAgIG5zX3Jlc2V0X2NsaXBwaW5nIChzLT5mKTsKKyAgICAgICAgICAg ICAgfQorICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgbWNfbnNfZHVtcGdseXBo c19zdHJldGNoIChzLT5uZXh0LCBtYXRyaXgsIHJvdywgd2QpOworICAgICAgICAgICAgbmV4dC0+ bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICB9CisgICAgfQorICBpZiAoIXMtPmZvcl9vdmVybGFw cyAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gKKyAgICAgICYmIChzLT5maXJzdF9nbHlw aC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAgICAgfHwgcy0+Zmlyc3RfZ2x5cGgtPnR5cGUg PT0gQ09NUE9TSVRFX0dMWVBIKSkKKyAgICB7CisgICAgICBuID0gbnNfZ2V0X2dseXBoX3N0cmlu Z19jbGlwX3JlY3QgKHMsIHIpOworICAgICAgaWYgKCFuc19jbGlwX3RvX3JlY3QgKHMtPmYsIHIs IG4pKQorICAgICAgICByZXR1cm47CisgICAgICBtY19uc19tYXliZV9kdW1wZ2x5cGhzX2JhY2tn cm91bmQgKHMsIDEpOworICAgICAgbnNfZHVtcGdseXBoc19ib3hfb3JfcmVsaWVmIChzKTsKKyAg ICAgIG5zX3Jlc2V0X2NsaXBwaW5nIChzLT5mKTsKKyAgICAgIGJveF9kcmF3bl9wID0gMTsKKyAg ICB9CisgIHN3aXRjaCAocy0+Zmlyc3RfZ2x5cGgtPnR5cGUpCisgICAgeworICAgIGNhc2UgSU1B R0VfR0xZUEg6CisgICAgICBuID0gbnNfZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsIHIp OworICAgICAgaWYgKCFuc19jbGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4pKQorICAgICAgICByZXR1 cm47CisgICAgICBtY19uc19kdW1wZ2x5cGhzX2ltYWdlIChzLCByWzBdLCBsc2wsIGdseXBoX2Zs YXZvciwgY3Vyc29yX3R5cGUsIGFjdGl2ZV9wKTsKKyAgICAgIG5zX3Jlc2V0X2NsaXBwaW5nIChz LT5mKTsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgU1RSRVRDSF9HTFlQSDoKKyAgICAgIG1jX25z X2R1bXBnbHlwaHNfc3RyZXRjaCAocywgbWF0cml4LCByb3csIHdkKTsKKyAgICAgIGJyZWFrOwor ICAgIGNhc2UgQ0hBUl9HTFlQSDoKKyAgICBjYXNlIENPTVBPU0lURV9HTFlQSDoKKyAgICAgIG4g PSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgcik7CisgICAgICBpZiAoIW5zX2Ns aXBfdG9fcmVjdCAocy0+ZiwgciwgbikpCisgICAgICAgIHJldHVybjsKKyAgICAgIGlmIChzLT5m b3Jfb3ZlcmxhcHMKKyAgICAgICAgICB8fCAocy0+Y21wX2Zyb20gPiAwCisgICAgICAgICAgICAg ICYmICEgcy0+Zmlyc3RfZ2x5cGgtPnUuY21wLmF1dG9tYXRpYykpCisgICAgICAgIHMtPmJhY2tn cm91bmRfZmlsbGVkX3AgPSAxOworICAgICAgICBlbHNlCisgICAgICAgICAgbWNfbnNfbWF5YmVf ZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzLCBzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDT01QT1NJ VEVfR0xZUEgpOworICAgICAgaW50IGZsYWdzID0gKHMtPmhsID09IERSQVdfQ1VSU09SKQorICAg ICAgICAgICAgICAgICAgICA/IE5TX0RVTVBHTFlQSF9DVVJTT1IKKyAgICAgICAgICAgICAgICAg IDogKHMtPmhsID09IERSQVdfTU9VU0VfRkFDRSkKKyAgICAgICAgICAgICAgICAgICAgPyBOU19E VU1QR0xZUEhfTU9VU0VGQUNFCisgICAgICAgICAgICAgICAgICA6IChzLT5mb3Jfb3ZlcmxhcHMp CisgICAgICAgICAgICAgICAgICAgID8gTlNfRFVNUEdMWVBIX0ZPUkVHUk9VTkQKKyAgICAgICAg ICAgICAgICAgIDogTlNfRFVNUEdMWVBIX05PUk1BTDsKKyAgICAgIHVuc2lnbmVkIGxvbmcgc2F2 ZWRfZmcgPSBOU19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2UpOworICAgICAgaWYgKHMtPmhsID09 IERSQVdfQ1VSU09SICYmIGN1cnNvcl90eXBlID09IE1DX0ZJTExFRF9CT1gpCisgICAgICAgIHsK KyAgICAgICAgICB1bnNpZ25lZCBsb25nIHRtcCA9IE5TX0ZBQ0VfQkFDS0dST1VORCAocy0+ZmFj ZSk7CisgICAgICAgICAgTlNfRkFDRV9CQUNLR1JPVU5EIChzLT5mYWNlKSA9IE5TX0ZBQ0VfRk9S RUdST1VORCAocy0+ZmFjZSk7CisgICAgICAgICAgTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNl KSA9IHRtcDsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChzLT5obCA9PSBEUkFXX0NVUlNP UgorICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YCisgICAg ICAgICAgICAgICAgICYmIGFjdGl2ZV9wKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGVudW0g ZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPQorICAgICAgICAgICAgICBsb29rdXBfbmFt ZWRfZmFjZSAocy0+dywgcy0+ZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1m YWNlIiksIHRydWUpOworICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFj ZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgaG9s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5hY3Rpb25fdHlwZSA9PSBNQ19F UkFTRV9HTFlQSF9TVFJJTkcpKQorICAgICAgICBtY19uc19kcmF3X292ZXJ3cml0dGVuIChzLCBt YXRyaXgsIHJvdywgcy0+Zmlyc3RfZ2x5cGgpOworICAgICAgaWYgKHMtPmhsID09IERSQVdfQ1VS U09SCisgICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gTUNfRklMTEVEX0JPWCkKKyAgICAgICAg eworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgdG1wID0gTlNfRkFDRV9CQUNLR1JPVU5EIChzLT5m YWNlKTsKKyAgICAgICAgICBOU19GQUNFX0JBQ0tHUk9VTkQgKHMtPmZhY2UpID0gTlNfRkFDRV9G T1JFR1JPVU5EIChzLT5mYWNlKTsKKyAgICAgICAgICBOU19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZh Y2UpID0gdG1wOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKHMtPmhsID09IERSQVdfQ1VS U09SCisgICAgICAgICAgICAgICAgICYmIGN1cnNvcl90eXBlID09IE1DX0ZSQU1FRF9CT1gpCisg ICAgICAgICAgTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKSA9IHNhdmVkX2ZnOworICAgICAg bnNfcmVzZXRfY2xpcHBpbmcgKHMtPmYpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBHTFlQSExF U1NfR0xZUEg6CisgICAgICBuID0gbnNfZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsIHIp OworICAgICAgaWYgKCFuc19jbGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4pKQorICAgICAgICByZXR1 cm47CisgICAgICBpZiAocy0+Zm9yX292ZXJsYXBzCisgICAgICAgICAgfHwgKHMtPmNtcF9mcm9t ID4gMAorICAgICAgICAgICAgICAmJiAhIHMtPmZpcnN0X2dseXBoLT51LmNtcC5hdXRvbWF0aWMp KQorICAgICAgICBzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wID0gMTsKKyAgICAgIGVsc2UKKyAgICAg ICAgbWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzLCBzLT5maXJzdF9nbHlwaC0+ dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpOworICAgICAgbnNfcmVzZXRfY2xpcHBpbmcgKHMtPmYp OworICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOworICAg IH0KKyAgLyogRHJhdyBib3ggaWYgbm90IGRvbmUgYWxyZWFkeS4gKi8KKyAgaWYgKCFzLT5mb3Jf b3ZlcmxhcHMKKyAgICAgICYmICFib3hfZHJhd25fcAorICAgICAgJiYgcy0+ZmFjZS0+Ym94ICE9 IEZBQ0VfTk9fQk9YKQorICAgIHsKKyAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBf cmVjdCAocywgcik7CisgICAgICBpZiAoIW5zX2NsaXBfdG9fcmVjdCAocy0+ZiwgciwgbikpCisg ICAgICAgIHJldHVybjsKKyAgICAgIG5zX2R1bXBnbHlwaHNfYm94X29yX3JlbGllZiAocyk7Cisg ICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgfQorICBzLT5udW1fY2xpcHMgPSAw OworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KIAogICAgTlNUUkFDRSwgVHJhY2Ugc3VwcG9y dC4KQEAgLTEwNzksNiArMjA0OCwxNiBAQCBzdGF0aWMgTlNSZWN0IGNvbnN0cmFpbl9mcmFtZV9y ZWN0KE5TUmVjdCBmcmFtZVJlY3QsIGJvb2wgaXNGdWxsc2NyZWVuKQogICAgZXh0ZXJuYWwgKFJJ RikgY2FsbDsgd2hvbGUgZnJhbWUsIGNhbGxlZCBiZWZvcmUgZ3VpX3VwZGF0ZV93aW5kb3dfYmVn aW4KICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCiB7CisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBm OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAjaWZkZWYgTlNfSU1QTF9DT0NPQQog ICBFbWFjc1ZpZXcgKnZpZXcgPSBGUkFNRV9OU19WSUVXIChmKTsKIApAQCAtMTEwOSw2ICsyMDg4 LDE2IEBAIHN0YXRpYyBOU1JlY3QgY29uc3RyYWluX2ZyYW1lX3JlY3QoTlNSZWN0IGZyYW1lUmVj dCwgYm9vbCBpc0Z1bGxzY3JlZW4pCiAKIC8qICAgaWYgKGYgPT0gTU9VU0VfSExfSU5GTyAoZikt Pm1vdXNlX2ZhY2VfbW91c2VfZnJhbWUpICovCiAgIE1PVVNFX0hMX0lORk8gKGYpLT5tb3VzZV9m YWNlX2RlZmVyID0gMDsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExF LUNVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGluZ19mcmFtZSA9IE5VTEw7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKIH0KIAogCkBAIC00NzU5LDYgKzU3NDgsMTcgQEAgaW4gY2Vy dGFpbiBzaXR1YXRpb25zIChyYXBpZCBpbmNvbWluZyBldmVudHMpLgogICAgICAgYmFyID0gW1tF bWFjc1Njcm9sbGVyIGFsbG9jXSBpbml0RnJhbWU6IHIgd2luZG93OiB3aW5dOwogICAgICAgd3Nl dF92ZXJ0aWNhbF9zY3JvbGxfYmFyICh3aW5kb3csIG1ha2VfbWludF9wdHIgKGJhcikpOwogICAg ICAgdXBkYXRlX3AgPSBZRVM7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKyAgICAgIC8qIFRoaXMgaXMgb25seSBmb3IgZGVidWdnaW5nIHB1 cnBvc2VzLiAqLworICAgICAgW2JhciBtY19zZXRfcmVjdGFuZ2xlOiByXTsKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogICAgIH0KICAgZWxzZQogICAgIHsKQEAgLTQ3NjYsMTIgKzU3 NjYsMzAgQEAgaW4gY2VydGFpbiBzaXR1YXRpb25zIChyYXBpZCBpbmNvbWluZyBldmVudHMpLgog ICAgICAgYmFyID0gWE5TX1NDUk9MTF9CQVIgKHdpbmRvdy0+dmVydGljYWxfc2Nyb2xsX2Jhcik7 CiAgICAgICBvbGRSZWN0ID0gW2JhciBmcmFtZV07CiAgICAgICByLnNpemUud2lkdGggPSBvbGRS ZWN0LnNpemUud2lkdGg7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKICAgICAgIGlmIChGUkFNRV9MSVZFX1AgKGYpICYmICFOU0VxdWFsUmVj dHMgKG9sZFJlY3QsIHIpKQogICAgICAgICB7CisgICAgICAgICAgLyogVGhlIG1haW4gd2luZG93 IGhhcyBwcm9iYWJseSBiZWVuIHJlc2l6ZWQuICBHcmFjaW91c2x5IGRlbGV0ZSB0aGUKKyAgICAg ICAgICBvbGQgc2Nyb2xsIGJhciB3aXRob3V0IHJlcGFpbnRpbmcgaXRzIHJlY3RhbmdsZTsgYW5k LCBjcmVhdGUgYSBuZXcKKyAgICAgICAgICBzY3JvbGwgYmFyIGVsc2V3aGVyZS4qLwogICAgICAg ICAgIGlmIChvbGRSZWN0Lm9yaWdpbi54ICE9IHIub3JpZ2luLngpCisgICAgICAgICAgICB7CiAg ICAgICAgICAgICAgIG5zX2NsZWFyX2ZyYW1lX2FyZWEgKGYsIGxlZnQsIHRvcCwgd2lkdGgsIGhl aWdodCk7CisgICAgICAgICAgICAgIFtiYXIgbWNfanVkZ2VdOworICAgICAgICAgICAgICBiYXIg PSBbW0VtYWNzU2Nyb2xsZXIgYWxsb2NdIGluaXRGcmFtZTogciB3aW5kb3c6IHdpbl07CisgICAg ICAgICAgICAgIHdzZXRfdmVydGljYWxfc2Nyb2xsX2JhciAod2luZG93LCBtYWtlX21pbnRfcHRy IChiYXIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKICAgICAgICAgICBbYmFy IHNldEZyYW1lOiByXTsKICAgICAgICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAgICAgfQogCiAgIGlmICh1cGRhdGVfcCkKQEAgLTQ5MzEsOSArNTk0OSw1NyBAQCBpbiBjZXJ0 YWluIHNpdHVhdGlvbnMgKHJhcGlkIGluY29taW5nIGV2ZW50cykuCiAgICAgewogICAgICAgdmll dyA9IFtzdWJ2aWV3cyBvYmplY3RBdEluZGV4OiBpXTsKICAgICAgIGlmICghW3ZpZXcgaXNLaW5k T2ZDbGFzczogW0VtYWNzU2Nyb2xsZXIgY2xhc3NdXSkgY29udGludWU7Ci0gICAgICBpZiAoW3Zp ZXcganVkZ2VdKQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VS U09SUyAqLworCisgIC8qIGBYU0VUV0lORE9XJyB3aWxsIHNvbWV0aW1lcyBjYXVzZSBFbWFjcyB0 byBjcmFzaCB3aGVuIHJ1bm5pbmcgdW5kZXIgZ2RiIGV2ZW4KKyAgdGhvdWdoICh3ICE9IE5VTEwp LiAgVGhlcmVmb3JlLCB3ZSBjYW5ub3QgcmVsaWFibHkgdXNlIGBXSU5ET1dfTElWRV9QJy4gKi8K KyAgc3RydWN0IHdpbmRvdyAqdyA9IFt2aWV3IG1jX2dldF93aW5kb3ddOworICBpZiAodyAhPSBO VUxMCisgICAgICAmJiBOSUxQICh3LT5jb250ZW50cykpCisgICAgeworICAgICAgQk9PTCBkZWJ1 Z19wID0gZmFsc2U7CisgICAgICBpZiAoZGVidWdfcAorICAgICAgICAgIC8qIGB3aW5kb3dfYm94 JyBjYWxscyBgd2luZG93X2JveF9oZWlnaHQnLCB3aGljaCB3aWxsIGNhdXNlIEVtYWNzIHRvCisg ICAgICAgICAgY3Jhc2ggaWYgRlJBTUVQICh3LT5mcmFtZSkgaXMgbm90IHNhdGlzZmllZC4gKi8K KyAgICAgICAgICAmJiBGUkFNRVAgKHctPmZyYW1lKSkKKyAgICAgICAgeworICAgICAgICAgIE5T UmVjdCByMCA9IFt2aWV3IG1jX2dldF9yZWN0YW5nbGVdOworICAgICAgICAgIGludCB4MCA9IE5T TWluWCAocjApOworICAgICAgICAgIGludCB5MCA9IE5TTWluWSAocjApOworICAgICAgICAgIGlu dCB3ZDAgPSBOU1dpZHRoIChyMCk7CisgICAgICAgICAgaW50IGgwID0gTlNIZWlnaHQgKHIwKTsK KyAgICAgICAgICBpbnQgd2luZG93X3ksIHdpbmRvd19oZWlnaHQ7CisgICAgICAgICAgd2luZG93 X2JveCAodywgQU5ZX0FSRUEsIDAsICZ3aW5kb3dfeSwgMCwgJndpbmRvd19oZWlnaHQpOworICAg ICAgICAgIGludCB0b3AgPSB3aW5kb3dfeTsKKyAgICAgICAgICBpbnQgaGVpZ2h0ID0gd2luZG93 X2hlaWdodDsKKyAgICAgICAgICBpbnQgd2lkdGggPSBXSU5ET1dfQ09ORklHX1NDUk9MTF9CQVJf Q09MUyAodykgKiBGUkFNRV9DT0xVTU5fV0lEVEggKGYpOworICAgICAgICAgIGludCBsZWZ0ID0g V0lORE9XX1NDUk9MTF9CQVJfQVJFQV9YICh3KTsKKyAgICAgICAgICBOU1JlY3QgcjEgPSBOU01h a2VSZWN0IChsZWZ0LCB0b3AsIHdpZHRoLCBoZWlnaHQpOworICAgICAgICAgIC8qIFRoZSBwYXJl bnQgdmlldyBpcyBmbGlwcGVkLCBzbyB3ZSBuZWVkIHRvIGZsaXAgeSB2YWx1ZS4gKi8KKyAgICAg ICAgICBFbWFjc1ZpZXcgKmZyYW1lX3ZpZXcgPSBGUkFNRV9OU19WSUVXIChmKTsKKyAgICAgICAg ICBOU1JlY3QgdiA9IFtmcmFtZV92aWV3IGZyYW1lXTsKKyAgICAgICAgICByMS5vcmlnaW4ueSA9 ICh2LnNpemUuaGVpZ2h0IC0gcjEuc2l6ZS5oZWlnaHQgLSByMS5vcmlnaW4ueSk7CisgICAgICAg ICAgaW50IHgxID0gTlNNaW5YIChyMSk7CisgICAgICAgICAgaW50IHkxID0gTlNNaW5ZIChyMSk7 CisgICAgICAgICAgaW50IHdkMSA9IE5TV2lkdGggKHIxKTsKKyAgICAgICAgICBpbnQgaDEgPSBO U0hlaWdodCAocjEpOworICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiVzIC0tIERFQUQ6XG5c CisgICAgICAgICAgeDAveDEgKCVkLyVkKSB8IHkwL3kxICglZC8lZCkgfCB3ZDAvd2QxICglZC8l ZCkgfCBoMC9oMSAoJWQvJWQpXG4iLAorICAgICAgICAgIG1jX3dpbmRvdyAodyksIHgwLCB4MSwg eTAsIHkxLCB3ZDAsIHdkMSwgaDAsIGgxKTsKKyAgICAgICAgfQorICAgICAgaWYgKFt2aWV3IG1j X2p1ZGdlXSkKICAgICAgICAgcmVtb3ZlZCA9IFlFUzsKICAgICB9CisgICAgZWxzZSBpZiAoW3Zp ZXcganVkZ2VdKQorICAgICAgcmVtb3ZlZCA9IFlFUzsKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKworICAgIH0KIAogICBpZiAocmVtb3ZlZCkKICAgICBbZXZpZXcgdXBkYXRlRnJhbWVT aXplOiBOT107CkBAIC01MDc0LDYgKzYxNDAsMjAgQEAgc3RhdGljIExpc3BfT2JqZWN0IG5zX3N0 cmluZ190b19saXNwbW9kIChjb25zdCBjaGFyICpzKQogZXh0ZXJuIGZyYW1lX3Bhcm1faGFuZGxl ciBuc19mcmFtZV9wYXJtX2hhbmRsZXJzW107CiBzdGF0aWMgc3RydWN0IHJlZGlzcGxheV9pbnRl cmZhY2UgbnNfcmVkaXNwbGF5X2ludGVyZmFjZSA9CiB7CisKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRpc3BsYXlfaW50ZXJmYWNl JyBpbiBgbnN0ZXJtLm1gIG11c3QgYmUgaW4gdGhlIGV4YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitg cmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYGRpc3BleHRlcm4uaGAhICovCisKKyAgbWNfbnNfZHJh d193aW5kb3dfY3Vyc29yLAorICBtY19uc19kcmF3X2dseXBoX3N0cmluZywKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogICBuc19mcmFtZV9wYXJtX2hhbmRsZXJzLAogICBndWlfcHJv ZHVjZV9nbHlwaHMsCiAgIGd1aV93cml0ZV9nbHlwaHMsCkBAIC04NzExLDYgKzk3OTEsNDkgQEAg LSAoQk9PTCljYW5CZWNvbWVNYWluV2luZG93CiAKIEBpbXBsZW1lbnRhdGlvbiBFbWFjc1Njcm9s bGVyCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKy0gKHZvaWQpbWNfc2V0X3JlY3RhbmdsZTogKE5TUmVjdClyZWN0Cit7CisgIG1jX3JlY3Rh bmdsZSA9IHJlY3Q7Cit9CisKKy0gKE5TUmVjdCltY19nZXRfcmVjdGFuZ2xlCit7CisgIHJldHVy biBtY19yZWN0YW5nbGU7Cit9CisKKy0gKHN0cnVjdCB3aW5kb3cgKiltY19nZXRfd2luZG93Cit7 CisgIHJldHVybiB3aW5kb3c7Cit9CisKKy0gKGJvb2wpbWNfanVkZ2UKK3sKKyAgTlNUUkFDRSAo IltFbWFjc1Njcm9sbGVyIG1jX2p1ZGdlXSIpOworICBib29sIHJldCA9IGNvbmRlbW5lZDsKKyAg YmxvY2tfaW5wdXQgKCk7CisgIGlmIChjb25kZW1uZWQpCisgICAgeworICAgICAgLyogZW5zdXJl IG90aGVyIHNjcm9sbGJhciB1cGRhdGVzIGFmdGVyIGRlbGV0aW9uICovCisgICAgICBFbWFjc1Zp ZXcgKnZpZXcgPSAoRW1hY3NWaWV3ICopRlJBTUVfTlNfVklFVyAoZnJhbWUpOworICAgICAgaWYg KHZpZXcgIT0gbmlsKQorICAgICAgICB2aWV3LT5zY3JvbGxiYXJzTmVlZGluZ1VwZGF0ZSsrOwor ICAgIH0KKyAgaWYgKHdpbmRvdykKKyAgICB3c2V0X3ZlcnRpY2FsX3Njcm9sbF9iYXIgKHdpbmRv dywgUW5pbCk7CisgIHdpbmRvdyA9IDA7CisgIFtzZWxmIHJlbW92ZUZyb21TdXBlcnZpZXdXaXRo b3V0TmVlZGluZ0Rpc3BsYXldOworICBbc2VsZiByZWxlYXNlXTsKKyAgdW5ibG9ja19pbnB1dCAo KTsKKyAgcmV0dXJuIHJldDsKK30KKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogLyog Zm9yIHJlcGVhdCBidXR0b24gcHVzaCAqLwogI2RlZmluZSBTQ1JPTExfQkFSX0ZJUlNUX0RFTEFZ IDAuNQogI2RlZmluZSBTQ1JPTExfQkFSX0NPTlRJTlVPVVNfREVMQVkgKDEuMCAvIDE1KQpkaWZm IC0tZ2l0IGEvc3JjL3czMnRlcm0uYyBiL3NyYy93MzJ0ZXJtLmMKaW5kZXggYzZlMTc1ZS4uY2Q5 NjM4YyAxMDA2NDQKLS0tIGEvc3JjL3czMnRlcm0uYworKysgYi9zcmMvdzMydGVybS5jCkBAIC02 Miw2ICs2MiwxMTY1IEBAIGFsb25nIHdpdGggR05VIEVtYWNzLiAgSWYgbm90LCBzZWUgPGh0dHBz Oi8vd3d3LmdudS5vcmcvbGljZW5zZXMvPi4gICovCiAjaW5jbHVkZSAiYml0bWFwcy9ncmF5Lnhi bSIKICNlbmRpZgogDAorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4gTVVM VElQTEUtQ1VSU09SUyAqLworCit0eXBlZGVmIHN0cnVjdCB7CisgIHVuc2lnbmVkIGxvbmcgcGl4 ZW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JvY2Vzc19xdWl0X2ZsYWcgKHZvaWQpCit7CisgIExpc3BfT2JqZWN0IGZsYWcg PSBWcXVpdF9mbGFnOworICBWcXVpdF9mbGFnID0gUW5pbDsKKyAgaWYgKEVRIChmbGFnLCBRa2ls bF9lbWFjcykpCisgICAgRmtpbGxfZW1hY3MgKFFuaWwpOworICBpZiAoRVEgKFZ0aHJvd19vbl9p bnB1dCwgZmxhZykpCisgICAgRnRocm93IChWdGhyb3dfb25faW5wdXQsIFF0KTsKKyAgRnNpZ25h bCAoUXF1aXQsIFFuaWwpOworfQorCisjZGVmaW5lIE1DX1FVSVQJCQkJCQlcCisgIGRvIHsJCQkJ CQkJXAorICAgIGlmICghTklMUCAoVnF1aXRfZmxhZykgJiYgTklMUCAoVmluaGliaXRfcXVpdCkp CVwKKyAgICAgIG1jX3Byb2Nlc3NfcXVpdF9mbGFnICgpOwkJCQlcCisgICAgZWxzZSBpZiAocGVu ZGluZ19zaWduYWxzKQkJCQlcCisgICAgICBwcm9jZXNzX3BlbmRpbmdfc2lnbmFscyAoKTsJCQlc CisgIH0gd2hpbGUgKGZhbHNlKQorCitzdGF0aWMgTGlzcF9PYmplY3QKK21jX3czMl9jb2xvcl9t YXBfbG9va3VwIChjb25zdCBjaGFyICpjb2xvcm5hbWUpCit7CisgIExpc3BfT2JqZWN0IHRhaWws IHJldCA9IFFuaWw7CisgIGJsb2NrX2lucHV0ICgpOworICBmb3IgKHRhaWwgPSBWdzMyX2NvbG9y X21hcDsgQ09OU1AgKHRhaWwpOyB0YWlsID0gWENEUiAodGFpbCkpCisgICAgeworICAgICAgcmVn aXN0ZXIgTGlzcF9PYmplY3QgZWx0LCB0ZW07CisgICAgICBlbHQgPSBYQ0FSICh0YWlsKTsKKyAg ICAgIGlmICghQ09OU1AgKGVsdCkpIGNvbnRpbnVlOworICAgICAgdGVtID0gWENBUiAoZWx0KTsK KyAgICAgIGlmIChsc3RyY21waSAoU1NEQVRBICh0ZW0pLCBjb2xvcm5hbWUpID09IDApCisgICAg ICAgIHsKKyAgICAgICAgICByZXQgPSBGY2RyIChlbHQpOworICAgICAgICAgIGJyZWFrOworICAg ICAgICB9CisgICAgICBNQ19RVUlUOworICAgIH0KKyAgdW5ibG9ja19pbnB1dCAoKTsKKyAgcmV0 dXJuIHJldDsKK30KKworc3RhdGljIExpc3BfT2JqZWN0CittY194X3RvX3czMl9jb2xvciAoY29u c3QgY2hhciAqIGNvbG9ybmFtZSkKK3sKKyAgcmVnaXN0ZXIgTGlzcF9PYmplY3QgcmV0ID0gUW5p bDsKKyAgYmxvY2tfaW5wdXQgKCk7CisgIGlmIChjb2xvcm5hbWVbMF0gPT0gJyMnKQorICAgIHsK KyAgICAgIC8qIENvdWxkIGJlIGFuIG9sZC1zdHlsZSBSR0IgRGV2aWNlIHNwZWNpZmljYXRpb24u ICovCisgICAgICBpbnQgc2l6ZSA9IHN0cmxlbiAoY29sb3JuYW1lICsgMSk7CisgICAgICBjaGFy ICpjb2xvciA9IGFsbG9jYSAoc2l6ZSArIDEpOworICAgICAgc3RyY3B5IChjb2xvciwgY29sb3Ju YW1lICsgMSk7CisgICAgICBpZiAoc2l6ZSA9PSAzIHx8IHNpemUgPT0gNiB8fCBzaXplID09IDkg fHwgc2l6ZSA9PSAxMikKKyAgICAgICAgeworICAgICAgICAgIFVJTlQgY29sb3J2YWw7CisgICAg ICAgICAgaW50IGksIHBvczsKKyAgICAgICAgICBwb3MgPSAwOworICAgICAgICAgIHNpemUgLz0g MzsKKyAgICAgICAgICBjb2xvcnZhbCA9IDA7CisgICAgICAgICAgZm9yIChpID0gMDsgaSA8IDM7 IGkrKykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY2hhciAqZW5kOworICAgICAgICAg ICAgICBjaGFyIHQ7CisgICAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgdmFsdWU7CisgICAgICAg ICAgICAgIC8qIFRoZSBjaGVjayBmb3IgJ3gnIGluIHRoZSBmb2xsb3dpbmcgY29uZGl0aW9uYWwg dGFrZXMgaW50bworICAgICAgICAgICAgICBhY2NvdW50IHRoZSBmYWN0IHRoYXQgc3RydG9sIGFs bG93cyBhICIweCIgaW4gZnJvbnQgb2YKKyAgICAgICAgICAgICAgb3VyIG51bWJlcnMsIGFuZCB3 ZSBkb24ndC4gKi8KKyAgICAgICAgICAgICAgaWYgKCFpc3hkaWdpdCAoY29sb3JbMF0pIHx8IGNv bG9yWzFdID09ICd4JykKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgdCA9 IGNvbG9yW3NpemVdOworICAgICAgICAgICAgICBjb2xvcltzaXplXSA9ICdcMCc7CisgICAgICAg ICAgICAgIHZhbHVlID0gc3RydG91bCAoY29sb3IsICZlbmQsIDE2KTsKKyAgICAgICAgICAgICAg Y29sb3Jbc2l6ZV0gPSB0OworICAgICAgICAgICAgICBpZiAoZXJybm8gPT0gRVJBTkdFIHx8IGVu ZCAtIGNvbG9yICE9IHNpemUpCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAg IHN3aXRjaCAoc2l6ZSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY2FzZSAx OgorICAgICAgICAgICAgICAgICAgdmFsdWUgPSB2YWx1ZSAqIDB4MTA7CisgICAgICAgICAgICAg ICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIDI6CisgICAgICAgICAgICAgICAgICBi cmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIDM6CisgICAgICAgICAgICAgICAgICB2YWx1ZSAv PSAweDEwOworICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSA0 OgorICAgICAgICAgICAgICAgICAgdmFsdWUgLz0gMHgxMDA7CisgICAgICAgICAgICAgICAgICBi cmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGNvbG9ydmFsIHw9ICh2YWx1 ZSA8PCBwb3MpOworICAgICAgICAgICAgICBwb3MgKz0gMHg4OworICAgICAgICAgICAgICBpZiAo aSA9PSAyKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIHVuYmxvY2tfaW5w dXQgKCk7CisgICAgICAgICAgICAgICAgICBYU0VUSU5UIChyZXQsIGNvbG9ydmFsKTsKKyAgICAg ICAgICAgICAgICAgIHJldHVybiByZXQ7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICBjb2xvciA9IGVuZDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgZWxzZSBp ZiAoc3RybmljbXAgKGNvbG9ybmFtZSwgInJnYjoiLCA0KSA9PSAwKQorICAgIHsKKyAgICAgIGNv bnN0IGNoYXIgKmNvbG9yOworICAgICAgVUlOVCBjb2xvcnZhbDsKKyAgICAgIGludCBpLCBwb3M7 CisgICAgICBwb3MgPSAwOworICAgICAgY29sb3J2YWwgPSAwOworICAgICAgY29sb3IgPSBjb2xv cm5hbWUgKyA0OworICAgICAgZm9yIChpID0gMDsgaSA8IDM7IGkrKykKKyAgICAgICAgeworICAg ICAgICAgIGNoYXIgKmVuZDsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIHZhbHVlOworICAgICAg ICAgIC8qIFRoZSBjaGVjayBmb3IgJ3gnIGluIHRoZSBmb2xsb3dpbmcgY29uZGl0aW9uYWwgdGFr ZXMgaW50bworICAgICAgICAgICAgIGFjY291bnQgdGhlIGZhY3QgdGhhdCBzdHJ0b2wgYWxsb3dz IGEgIjB4IiBpbiBmcm9udCBvZgorICAgICAgICAgICAgIG91ciBudW1iZXJzLCBhbmQgd2UgZG9u J3QuICovCisgICAgICAgICAgaWYgKCFpc3hkaWdpdCAoY29sb3JbMF0pIHx8IGNvbG9yWzFdID09 ICd4JykKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIHZhbHVlID0gc3RydG91bCAoY29s b3IsICZlbmQsIDE2KTsKKyAgICAgICAgICBpZiAoZXJybm8gPT0gRVJBTkdFKQorICAgICAgICAg ICAgYnJlYWs7CisgICAgICAgICAgc3dpdGNoIChlbmQgLSBjb2xvcikKKyAgICAgICAgICAgIHsK KyAgICAgICAgICAgIGNhc2UgMToKKyAgICAgICAgICAgICAgdmFsdWUgPSB2YWx1ZSAqIDB4MTAg KyB2YWx1ZTsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDI6CisgICAg ICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSAzOgorICAgICAgICAgICAgICB2YWx1 ZSAvPSAweDEwOworICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgNDoKKyAg ICAgICAgICAgICAgdmFsdWUgLz0gMHgxMDA7CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAg ICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgdmFsdWUgPSBVTE9OR19NQVg7CisgICAgICAg ICAgICB9CisgICAgICAgICAgaWYgKHZhbHVlID09IFVMT05HX01BWCkKKyAgICAgICAgICAgIGJy ZWFrOworICAgICAgICAgIGNvbG9ydmFsIHw9ICh2YWx1ZSA8PCBwb3MpOworICAgICAgICAgIHBv cyArPSAweDg7CisgICAgICAgICAgaWYgKGkgPT0gMikKKyAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgaWYgKCplbmQgIT0gJ1wwJykKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAg ICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgWFNFVElOVCAocmV0LCBjb2xv cnZhbCk7CisgICAgICAgICAgICAgIHJldHVybiByZXQ7CisgICAgICAgICAgICB9CisgICAgICAg ICAgaWYgKCplbmQgIT0gJy8nKQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgY29sb3Ig PSBlbmQgKyAxOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UgaWYgKHN0cm5pY21wIChjb2xv cm5hbWUsICJyZ2JpOiIsIDUpID09IDApCisgICAgICB7CisgICAgICAgIC8qIFRoaXMgaXMgYW4g UkdCIEludGVuc2l0eSBzcGVjaWZpY2F0aW9uLiAqLworICAgICAgICBjb25zdCBjaGFyICpjb2xv cjsKKyAgICAgICAgVUlOVCBjb2xvcnZhbDsKKyAgICAgICAgaW50IGksIHBvczsKKyAgICAgICAg cG9zID0gMDsKKyAgICAgICAgY29sb3J2YWwgPSAwOworICAgICAgICBjb2xvciA9IGNvbG9ybmFt ZSArIDU7CisgICAgICAgIGZvciAoaSA9IDA7IGkgPCAzOyBpKyspCisgICAgICAgICAgeworICAg ICAgICAgICAgY2hhciAqZW5kOworICAgICAgICAgICAgZG91YmxlIHZhbHVlOworICAgICAgICAg ICAgVUlOVCB2YWw7CisgICAgICAgICAgICB2YWx1ZSA9IHN0cnRvZCAoY29sb3IsICZlbmQpOwor ICAgICAgICAgICAgaWYgKGVycm5vID09IEVSQU5HRSkKKyAgICAgICAgICAgICAgYnJlYWs7Cisg ICAgICAgICAgICBpZiAodmFsdWUgPCAwLjAgfHwgdmFsdWUgPiAxLjApCisgICAgICAgICAgICAg IGJyZWFrOworICAgICAgICAgICAgdmFsID0gKFVJTlQpKDB4MTAwICogdmFsdWUpOworICAgICAg ICAgICAgLyogV2UgdXNlZCAweDEwMCBpbnN0ZWFkIG9mIDB4RkYgdG8gZ2l2ZSBhIGNvbnRpbnVv dXMKKyAgICAgICAgICAgICAgIHJhbmdlIGJldHdlZW4gMC4wIGFuZCAxLjAgaW5jbHVzaXZlLiAg VGhlIG5leHQgc3RhdGVtZW50CisgICAgICAgICAgICAgICBmaXhlcyB0aGUgMS4wIGNhc2UuICov CisgICAgICAgICAgICBpZiAodmFsID09IDB4MTAwKQorICAgICAgICAgICAgICB2YWwgPSAweEZG OworICAgICAgICAgICAgY29sb3J2YWwgfD0gKHZhbCA8PCBwb3MpOworICAgICAgICAgICAgcG9z ICs9IDB4ODsKKyAgICAgICAgICAgIGlmIChpID09IDIpCisgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICBpZiAoKmVuZCAhPSAnXDAnKQorICAgICAgICAgICAgICAgICAgYnJlYWs7Cisg ICAgICAgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgICBYU0VUSU5U IChyZXQsIGNvbG9ydmFsKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gcmV0OworICAgICAgICAg ICAgICB9CisgICAgICAgICAgICBpZiAoKmVuZCAhPSAnLycpCisgICAgICAgICAgICAgIGJyZWFr OworICAgICAgICAgICAgY29sb3IgPSBlbmQgKyAxOworICAgICAgICAgIH0KKyAgICAgIH0KKyAg LyogSSBhbSBub3QgZ29pbmcgdG8gYXR0ZW1wdCB0byBoYW5kbGUgYW55IG9mIHRoZSBDSUUgY29s b3Igc2NoZW1lcworICAgICBvciBUZWtIVkMsIHNpbmNlIEkgZG9uJ3Qga25vdyB0aGUgYWxnb3Jp dGhtcyBmb3IgY29udmVyc2lvbiB0byBSR0IuCisgICAgIElmIHdlIGZhaWwgdG8gbG9va3VwIHRo ZSBjb2xvciBuYW1lIGluIHczMl9jb2xvcl9tYXAsIHRoZW4gY2hlY2sgdGhlCisgICAgIGNvbG9y bmFtZSB0byBzZWUgaWYgaXQgY2FuIGJlIGNydWRlbHkgYXBwcm94aW1hdGVkOiBJZiB0aGUgWCBj b2xvcgorICAgICBlbmRzIGluIGEgbnVtYmVyIChlLmcuLCAiZGFya3NlYWdyZWVuMiIpLCBzdHJp cCB0aGUgbnVtYmVyIGFuZAorICAgICByZXR1cm4gdGhlIHJlc3VsdCBvZiBsb29raW5nIHVwIHRo ZSBiYXNlIGNvbG9yIG5hbWUuICovCisgIHJldCA9IG1jX3czMl9jb2xvcl9tYXBfbG9va3VwIChj b2xvcm5hbWUpOworICBpZiAoTklMUCAocmV0KSkKKyAgICB7CisgICAgICBpbnQgbGVuID0gc3Ry bGVuIChjb2xvcm5hbWUpOworICAgICAgaWYgKGlzZGlnaXQgKGNvbG9ybmFtZVtsZW4gLSAxXSkp Cisg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gWFVGSVhOVU1fUkFXICh0ZW0p OworICAgICAgICAgIGdhbW1hX2NvcnJlY3QgKGYsICZ3MzJfY29sb3JfcmVmKTsKKyAgICAgICAg ICBYU0VUSU5UICh0ZW0sIHczMl9jb2xvcl9yZWYpOworICAgICAgICB9CisgICAgICAvKiBNYXAg dGhpcyBjb2xvciB0byB0aGUgcGFsZXR0ZSBpZiBpdCBpcyBlbmFibGVkLiAqLworICAgICAgaWYg KCFOSUxQIChWdzMyX2VuYWJsZV9wYWxldHRlKSkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVj dCB3MzJfcGFsZXR0ZV9lbnRyeSAqIGVudHJ5ID0gb25lX3czMl9kaXNwbGF5X2luZm8uY29sb3Jf bGlzdDsKKyAgICAgICAgICBzdHJ1Y3QgdzMyX3BhbGV0dGVfZW50cnkgKiogcHJldiA9ICZvbmVf dzMyX2Rpc3BsYXlfaW5mby5jb2xvcl9saXN0OworICAgICAgICAgIC8qIGNoZWNrIGlmIGNvbG9y IGlzIGFscmVhZHkgbWFwcGVkICovCisgICAgICAgICAgd2hpbGUgKGVudHJ5KQorICAgICAgICAg ICAgeworICAgICAgICAgICAgICBpZiAoTUNfVzMyX0NPTE9SIChlbnRyeS0+ZW50cnkpID09IFhV RklYTlVNX1JBVyAodGVtKSkKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAg cHJldiA9ICZlbnRyeS0+bmV4dDsKKyAgICAgICAgICAgICAgZW50cnkgPSBlbnRyeS0+bmV4dDsK KyAgICAgICAgICAgIH0KKyAgICAgICAgICBpZiAoZW50cnkgPT0gTlVMTCAmJiBhbGxvY19wKQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBub3QgYWxyZWFkeSBtYXBwZWQsIHNvIGFk ZCB0byBsaXN0ICovCisgICAgICAgICAgICAgIGVudHJ5ID0geG1hbGxvYyAoc2l6ZW9mIChzdHJ1 Y3QgdzMyX3BhbGV0dGVfZW50cnkpKTsKKyAgICAgICAgICA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lwZSA9PSBTVFJFVENIX0dMWVBIKTsKKyAg aWYgKHMtPmhsID09IERSQVdfQ1VSU09SCisgICAgICAmJiAheF9zdHJldGNoX2N1cnNvcl9wKQor ICAgIHsKKyAgICAgIC8qIElmIGB4LXN0cmV0Y2gtY3Vyc29yJyBpcyBuaWwsIGRvbid0IGRyYXcg YSBibG9jayBjdXJzb3IgYXMgd2lkZSBhcyB0aGUKKyAgICAgIHN0cmV0Y2ggZ2x5cGguICovCisg ICAgICBpbnQgd2lkdGgsIGJhY2tncm91bmRfd2lkdGggPSBzLT5iYWNrZ3JvdW5kX3dpZHRoOwor ICAgICAgaW50IHggPSBzLT54OworICAgICAgaWYgKCFzLT5yb3ctPnJldmVyc2VkX3ApCisgICAg ICAgIHsKKyAgICAgICAgICBpbnQgbGVmdF94ID0gd2luZG93X2JveF9sZWZ0X29mZnNldCAocy0+ dywgVEVYVF9BUkVBKTsKKyAgICAgICAgICBpZiAoeCA8IGxlZnRfeCkKKyAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgYmFja2dyb3VuZF93aWR0aCAtPSBsZWZ0X3ggLSB4OworICAgICAgICAg ICAgICB4ID0gbGVmdF94OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UK KyAgICAgICAgIHsKKyAgICAgICAgICAgLyogSW4gUjJMIHJvd3MsIGRyYXcgdGhlIGN1cnNvciBv biB0aGUgcmlnaHQgZWRnZSBvZiB0aGUKKyAgICAgICAgICAgICAgc3RyZXRjaCBnbHlwaC4gKi8K KyAgICAgICAgICAgaW50IHJpZ2h0X3ggPSB3aW5kb3dfYm94X3JpZ2h0IChzLT53LCBURVhUX0FS RUEpOworICAgICAgICAgICBpZiAoeCArIGJhY2tncm91bmRfd2lkdGggPiByaWdodF94KQorICAg ICAgICAgICAgIGJhY2tncm91bmRfd2lkdGggLT0geCAtIHJpZ2h0X3g7CisgICAgICAgICAgIHgg Kz0gYmFja2dyb3VuZF93aWR0aDsKKyAgICAgICAgIH0KKyAgICAgIHdpZHRoID0gbWluIChGUkFN RV9DT0xVTU5fV0lEVEggKHMtPmYpLCBiYWNrZ3JvdW5kX3dpZHRoKTsKKyAgICAgIGlmIChzLT5y b3ctPnJldmVyc2VkX3ApCisgICAgICAgIHggLT0gd2lkdGg7CisgICAgICAvKiBEcmF3IGN1cnNv ci4gKi8KKyAgICAgIHczMl9kcmF3X2dseXBoX3N0cmluZ19iZ19yZWN0IChzLCB4LCBzLT55LCB3 aWR0aCwgcy0+aGVpZ2h0KTsKKyAgICAgIC8qIENsZWFyIHJlc3QgdXNpbmcgdGhlIEdDIG9mIHRo ZSBvcmlnaW5hbCBub24tY3Vyc29yIGZhY2UuICovCisgICAgICBpZiAod2lkdGggPCBiYWNrZ3Jv dW5kX3dpZHRoKQorICAgICAgICB7CisgICAgICAgICAgRW1hY3NfR0MgKmdjID0gcy0+ZmFjZS0+ Z2M7CisgICAgICAgICAgaW50IHkgPSBzLT55OworICAgICAgICAgIGludCB3ID0gYmFja2dyb3Vu ZF93aWR0aCAtIHdpZHRoLCBoID0gcy0+aGVpZ2h0OworICAgICAgICAgIFJFQ1QgcjsKKyAgICAg ICAgICBIREMgaGRjID0gcy0+aGRjOworICAgICAgICAgIGlmICghcy0+cm93LT5yZXZlcnNlZF9w KQorICAgICAgICAgICAgeCArPSB3aWR0aDsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgeCA9IHMtPng7CisgICAgICAgICAgaWYgKHMtPnJvdy0+bW91c2VfZmFjZV9wCisgICAgICAg ICAgICAgICYmIGN1cnNvcl9pbl9tb3VzZV9mYWNlX3AgKHMtPncpKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICB3MzJfc2V0X21vdXNlX2ZhY2VfZ2MgKHMpOworICAgICAgICAgICAgICBn YyA9IHMtPmdjOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICBnYyA9IHMtPmZhY2UtPmdjOworICAgICAgICAgIGdldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0 IChzLCAmcik7CisgICAgICAgICAgdzMyX3NldF9jbGlwX3JlY3RhbmdsZSAoaGRjLCAmcik7Cisj aWYgMCAvKiBUT0RPOiBzdGlwcGxlICovCisgICAgICAgICAgaWYgKHMtPmZhY2UtPnN0aXBwbGUp CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIC8qIEZpbGwgYmFja2dyb3VuZCB3aXRoIGEg c3RpcHBsZSBwYXR0ZXJuLiAqLworICAgICAgICAgICAgICBYU2V0RmlsbFN0eWxlIChzLT5kaXNw bGF5LCBnYywgRmlsbE9wYXF1ZVN0aXBwbGVkKTsKKyAgICAgICAgICAgICAgWEZpbGxSZWN0YW5n bGUgKHMtPmRpc3BsYXksIHMtPndpbmRvdywgZ2MsIHgsIHksIHcsIGgpOworICAgICAgICAgICAg ICBYU2V0RmlsbFN0eWxlIChzLT5kaXNwbGF5LCBnYywgRmlsbFNvbGlkKTsKKyAgICAgICAgICAg IH0KKyAgICAgICAgICAgIGVsc2UKKyNlbmRpZgorICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBnYy0+YmFja2dyb3VuZCwgeCwgeSwg dywgaCk7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlIGlmICgh cy0+YmFja2dyb3VuZF9maWxsZWRfcCkKKyAgICAgIHsKKyAgICAgICAgaW50IGJhY2tncm91bmRf d2lkdGggPSBzLT5iYWNrZ3JvdW5kX3dpZHRoOworICAgICAgICBpbnQgeCA9IHMtPngsIGxlZnRf eCA9IHdpbmRvd19ib3hfbGVmdF9vZmZzZXQgKHMtPncsIFRFWFRfQVJFQSk7CisgICAgICAgIC8q IERvbid0IGRyYXcgaW50byBsZWZ0IG1hcmdpbiwgZnJpbmdlIG9yIHNjcm9sbGJhciBhcmVhCisg ICAgICAgICAgIGV4Y2VwdCBmb3IgaGVhZGV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GF0YS53MzIt PmN1cnNvcl9waXhlbCk7CisgIC8qIEdldCB0aGUgZ2x5cGggdGhlIGN1cnNvciBpcyBvbi4gIElm IHdlIGNhbid0IHRlbGwgYmVjYXVzZQorICAgICB0aGUgY3VycmVudCBtYXRyaXggaXMgaW52YWxp ZCBvciBzdWNoLCBnaXZlIHVwLiAqLworICBzdHJ1Y3QgZ2x5cGggKmN1cnNvcl9nbHlwaCA9IG1j X2dldF9jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBocG9zLCB2cG9zKTsKKyAgaWYgKGN1 cnNvcl9nbHlwaCA9PSBOVUxMKQorICAgIHsKKyAgICAgIERlbGV0ZU9iamVjdCAoaGIpOworICAg ICAgcmV0dXJuOworICAgIH0KKyAgaW50IHJsID0gZng7CisgIGludCBydCA9IGZ5OworICBpbnQg cnIgPSBybCArIHdkOworICBpbnQgcmIgPSBydCArIGg7CisgIC8vICBmcHJpbnRmIChzdGRlcnIs ICJNQ19IT0xMT1dfQk9YOiAgcmwgKCVkKSB8IHJ0ICglZCkgfCByciAoJWQpIHwgcmIgKCVkKVxu IiwKKyAgLy8gICAgICAgICAgICAgICAgICAgcmwsIHJ0LCByciwgcmIpOworICByZWN0LmxlZnQg PSBybDsKKyAgcmVjdC50b3AgPSBydDsKKyAgcmVjdC5yaWdodCA9IHJyOworICByZWN0LmJvdHRv bSA9IHJiOworICBoZGMgPSBnZXRfZnJhbWVfZGMgKGYpOworICAvKiBTZXQgY2xpcHBpbmcsIGRy YXcgdGhlIHJlY3RhbmdsZSwgYW5kIHJlc2V0IGNsaXBwaW5nIGFnYWluLiAqLworICB3MzJfY2xp cF90b19yb3cgKHcsIHJvdywgVEVYVF9BUkVBLCBoZGMpOworICBGcmFtZVJlY3QgKGhkYywgJnJl Y3QsIGhiKTsKKyAgRGVsZXRlT2JqZWN0IChoYik7CisgIHczMl9zZXRfY2xpcF9yZWN0YW5nbGUg KGhkYywgTlVMTCk7CisgIHJlbGVhc2VfZnJhbW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B0aGUgZ2x5cGgncyBmb3JlZ3JvdW5kIGNvbG9yIGluc3RlYWQgaW4gdGhpcwor ICAgICAgICBjYXNlLCBvbiB0aGUgYXNzdW1wdGlvbiB0aGF0IHRoZSBnbHlwaCdzIGNvbG9ycyBh cmUgY2hvc2VuIHNvCisgICAgICAgIHRoYXQgdGhlIGdseXBoIGlzIGxlZ2libGUuICovCisgICAg ICAgIGlmIChmYWNlLT5iYWNrZ3JvdW5kID09IGN1cnNvcl9jb2xvcgorICAgICAgICAgICAgJiYg IWN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKQorICAgICAgICAgIGN1cnNvcl9jb2xvciA9IGZh Y2UtPmZvcmVncm91bmQ7CisgICAgICAgIGludCBkZWZhdWx0X2Z4ID0gV0lORE9XX1RFWFRfVE9f RlJBTUVfUElYRUxfWCAodywgeCk7CisgICAgICAgIGhkYyA9IGdldF9mcmFtZV9kYyAoZik7Cisg ICAgICAgIHczMl9jbGlwX3RvX3JvdyAodywgcm93LCBURVhUX0FSRUEsIGhkYyk7CisgICAgICAg IGludCByeCA9IGZ4OworICAgICAgICBpbnQgcnkgPSBmeTsKKyAgICAgICAgaW50IHJ3ID0gd2Q7 CisgICAgICAgIGludCByaCA9IGg7CisgICAgICAgIC8vICBmcHJpbnRmIChzdGRlcnIsICJNQ19I QkFSOiAgZnggKCVkKSB8IGZ5ICglZCkgfCB3ZCAoJWQpIHwgaCAoJWQpXG4iLAorICAgICAgICAv LyAgICAgICAgICAgICAgICAgICByeCwgcnksIHJ3LCByaCk7CisgICAgICAgIHczMl9maWxsX2Fy ZWEgKGYsIGhkYywgY3Vyc29yX2NvbG9yLCByeCwgcnksIHJ3LCByaCk7CisgICAgICAgIHczMl9z ZXRfY2xpcF9yZWN0YW5nbGUgKGhkYywgTlVMTCk7CisgICAgICAgIHJlbGVhc2VfZnJhbWVfZGMg KGYsIGhkYyk7CisgICAgICB9Cit9CisKKy8qIFJJRjogRHJhdyBvciBjbGVhciBjdXJzb3Igb24g d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h Y2UtPmJhY2tncm91bmQ7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBl bHNlIGlmICghYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg ICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFt ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLXByZS16 di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xs b3dfaW5hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2luYWN0aXZlX2ZhY2Vf aWQpOworICAgICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5mb3JlZ3JvdW5kID0gaG9sbG93 X2luYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgICAgICAgZ2NfdmFs dWVzLmJhY2tncm91bmQgPSBob2xsb3dfaW5hY3RpdmVfZmFjZS0+YmFja2dyb3VuZDsKKyAgICAg ICAgICAgICAgICAgICAgfQorICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2dj ID0gWENyZWF0ZUdDIChOVUxMLCBGUkFNRV9XMzJfV0lORE9XIChmKSwgbWFzaywgJmdjX3ZhbHVl cyk7CisgICAgICAgICAgYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgLyogRm9yY2UgYG1jX3cz Ml9zZXRfY3Vyc29yX2djJyB0byB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2dj Jy4gKi8KKyAgICAgICAgICBib29sIGN1cnNvcl9nY19wID0gdHJ1ZTsKKyAgICAgICAgICBtY19k cmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4LC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MsIHdkLCBoKTsKKyAgICAgICAgICAgIGYtPm91dHB1dF9k YXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICAg IH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIC8qIFRlbXBv cmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MnIGJ5IGJvcnJvd2lu ZyB0aGUKKyAgICAgICAgICAgICAgZnVuY3Rpb25hbGl0eSBvZiBgeF9tYWtlX2djJyBpbiB3MzJm bnMuYy4gKi8KKyAgICAgICAgICAgICAgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAg ICAgICAgJiYgYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+Y2hh cnBvcyA9PSByZWdpb25fYmVnKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAg IGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZWdfZmFjZV9pZCA9IGxvb2t1cF9u YW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItYXQtcmVnaW9uLXBy ZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxv d19hY3RpdmVfcmVnaW9uX2JlZ19mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZl X3JlZ2lvbl9iZWdfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9s bG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIist cmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAg IHN0cnV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ICAgICAgICAgICAgIHN0cnVjdCBm YWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVf ZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5mb3JlZ3JvdW5kID0gaG9s bG93X2FjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICAgICAgICBnY192YWx1 ZXMuYmFja2dyb3VuZCA9IGhvbGxvd19hY3RpdmVfcmVnaW9uX2VuZF9mYWNlLT5iYWNrZ3JvdW5k OworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgZWxzZSBpZiAocmVnaW9u X2FjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID4gcmVnaW9uX2Jl ZworICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zIDwg cmVnaW9uX2VuZCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAg IGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2VfaWQgPSBsb29r dXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluLXJlZ2lv bi1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFj ZSAqaG9sbG93X2FjdGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBo b2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAg ICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFj ZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUp OworICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2Ug PSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAg ICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVn cm91bmQ7CisgICAgICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xs b3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoYWN0aXZlX3ApCisgICAgICAg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhv bGxvd19hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIr LXJlYWwtZmFrZS1jdXJzb3ItcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAg ICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChm LCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICAgICAgZ2NfdmFs dWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAg ICAgICAgICAgICAgICAgICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IGhvbGxvd19hY3RpdmVfZmFj ZS0+YmFja2dyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAg ICAgICAgZWxzZSBpZiAoIWFjdGl2ZV9wKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0aXZlX2ZhY2Vf aWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29y LWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAg ICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2luYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhv bGxvd19pbmFjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZ2NfdmFs dWVzLmZvcmVncm91bmQgPSBob2xsb3dfaW5hY3RpdmVfZmFjZS0+Zm9yZWdyb3VuZDsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfaW5hY3Rp dmVfZmFjZS0+YmFja2dyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MgPSBYQ3JlYXRlR0MgKE5VTEwsIEZS QU1FX1czMl9XSU5ET1cgKGYpLCBtYXNrLCAmZ2NfdmFsdWVzKTsKKyAgICAgICAgICAgICAgYmxv Y2tfaW5wdXQgKCk7CisgICAgICAgICAgICAgIC8qIEZvcmNlIGBtY193MzJfc2V0X2N1cnNvcl9n YycgdG8gdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycuICovCisgICAgICAg ICAgICAgIGJvb2wgY3Vyc29yX2djX3AgPSB0cnVlOworICAgICAgICAgICAgICBtY19kcmF3X2N1 cnNvcl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B V19DVVJTT1IsIHgsIGhwb3MsIHZwb3MsIGxzbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9wLCBjdXJzb3JfZ2Nf cCk7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MgPSBvcmlnaW5hbF9j dXJzb3JfZ2M7CisgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgfQorICAgICAg ICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IGZhbHNl OworICAgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFX X0NVUlNPUiwgeCwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBsc2wsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgfQorICAg ICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfQkFSOgorICAgIHsKKyAgICAgIGlmIChsc2wu cmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAgewor ICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJz b3JfcGl4ZWwnLiAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVs ID0gY29sb3JfcGl4ZWw7CisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlf cCA9IHRydWU7CisgICAgICAgICAgbWNfdzMyX2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCBy b3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgaCwgY3Vyc29yX3dpZHRoLCBNQ19CQVIsIGN1cnNvcl9nY19pbnZpc2libGVf b2theV9wKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9y aWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAg eworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IGZhbHNlOwor ICAgICAgICAgICAgbWNfdzMyX2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4 LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0JBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3Ap OworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0hCQVI6Cisg ICAgeworICAgICAgaWYgKGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wuYmx1 ZSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5v dXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcuICovCisgICAgICAgICAgZi0+b3V0cHV0X2Rh dGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBjb2xvcl9waXhlbDsKKyAgICAgICAgICBib29sIGN1cnNv cl9nY19pbnZpc2libGVfb2theV9wID0gdHJ1ZTsKKyAgICAgICAgICBtY193MzJfZHJhd19iYXJf Y3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0hCQVIs IGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53 MzItPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAg ICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNp YmxlX29rYXlfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNfdzMyX2RyYXdfYmFyX2N1cnNvciAo dywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0hCQVIsIGN1cnNv cl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9 CisgICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOworICB9CisgICAgfQorfQorCisv KiBEcmF3IGdseXBoIHN0cmluZyBTLiAqLworc3RhdGljIHZvaWQKK21jX3czMl9kcmF3X2dseXBo X3N0cmluZyAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0 cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgIHN0 cnVjdCBtY19SR0IgbHNsLCBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IsCisgICAgICAgICAg ICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUsIGludCBjdXJz b3Jfd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgYWN0aXZlX3As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gICAgICAgICAgICAgICAgdzMyX2RyYXdfZ2x5cGhfc3RyaW5n X2JhY2tncm91bmQgKG5leHQsIHRydWUpOworICAgICAgICAgICAgbmV4dC0+bnVtX2NsaXBzID0g MDsKKyAgICAgICAgICB9CisgICAgfQorICAvKiBTZXQgdXAgUy0+Z2MsIHNldCBjbGlwcGluZyBh bmQgZHJhdyBTLiAqLworICBtY193MzJfc2V0X2dseXBoX3N0cmluZ19nYyAocywgY3Vyc29yX2dj X3ApOworICAvKiBEcmF3IHJlbGllZiAoaWYgYW55KSBpbiBhZHZhbmNlIGZvciBjaGFyL2NvbXBv c2l0aW9uIHNvIHRoYXQgdGhlCisgICAgIGdseXBoIHN0cmluZyBjYW4gYmUgZHJhd24gb3ZlciBp dC4gKi8KKyAgaWYgKCFzLT5mb3Jfb3ZlcmxhcHMKKyAgICAgICYmIHMtPmZhY2UtPmJveCAhPSBG QUNFX05PX0JPWAorICAgICAgJiYgKHMtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgK KyAgICAgICAgICB8fCBzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpKQor ICAgIHsKKyAgICAgIHczMl9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nIChzKTsKKyAgICAgIHcz Ml9kcmF3X2dseXBoX3N0cmluZ19iYWNrZ3JvdW5kIChzLCB0cnVlKTsKKyAgICAgIHczMl9kcmF3 X2dseXBoX3N0cmluZ19ib3ggKHMpOworICAgICAgdzMyX3NldF9nbHlwaF9zdHJpbmdfY2xpcHBp bmcgKHMpOworICAgICAgcmVsaWVmX2RyYXduX3AgPSAxOworICAgIH0KKyAgZWxzZSBpZiAoIXMt PmNsaXBfaGVhZCAvKiBkcmF3X2dseXBocyBkaWRuJ3Qgc3BlY2lmeSBhIGNsaXAgbWFzay4gKi8K KyAgICAgICAgICAgJiYgIXMtPmNsaXBfdGFpbAorICAgICAgICAgICAmJiAoKHMtPnByZXYgJiYg cy0+cHJldi0+aGwgIT0gcy0+aGwgJiYgcy0+bGVmdF9vdmVyaGFuZykKKyAgICAgICAgICAgICAg IHx8IChzLT5uZXh0ICYmIHMtPm5leHQtPmhsICE9IHMtPmhsICYmIHMtPnJpZ2h0X292ZXJoYW5n KSkpCisgICAgLyogV2UgbXVzdCBjbGlwIGp1c3QgdGhpcyBnbHlwaC4gIGxlZnRfb3Zlcmhhbmcg cGFydCBoYXMgYWxyZWFkeQorICAgICAgIGRyYXduIHdoZW4gcy0+cHJldiB3YXMgZHJhd24sIGFu ZCByaWdodF9vdmVyaGFuZyBwYXJ0IHdpbGwgYmUKKyAgICAgICBkcmF3biBsYXRlciB3aGVuIHMt Pm5leHQgaXMgZHJhd24uICovCisgICAgdzMyX3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhh Y3RseSAocywgcyk7CisgIGVsc2UKKyAgICB3MzJfc2V0X2dseXBoX3N0cmluZ19jbGlwcGluZyAo cyk7CisgIHN3aXRjaCAocy0+Zmlyc3RfZ2x5cGgtPnR5cGUpCisgICAgeworICAgIGNhc2UgSU1B R0VfR0xZUEg6CisgICAgICB3MzJfZHJhd19pbWFnZV9nbHlwaF9zdHJpbmcgKHMpOworICAgICAg YnJlYWs7CisgICAgY2FzZSBTVFJFVENIX0dMWVBIOgorICAgICAgbWNfdzMyX2RyYXdfc3RyZXRj aF9nbHlwaF9zdHJpbmcgKHMpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBDSEFSX0dMWVBIOgor ICAgICAgaWYgKHMtPmZvcl9vdmVybGFwcykKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRf cCA9IHRydWU7CisgICAgICBlbHNlCisgICAgICAgIHczMl9kcmF3X2dseXBoX3N0cmluZ19iYWNr Z3JvdW5kIChzLCBmYWxzZSk7CisgICAgICB3MzJfZHJhd19nbHlwaF9zdHJpbmdfZm9yZWdyb3Vu ZCAocyk7CisgICAgICBicmVhazsKKyAgICBjYXNlIENPTVBPU0lURV9HTFlQSDoKKyAgICAgIGlm IChzLT5mb3Jfb3ZlcmxhcHMgfHwgKHMtPmNtcF9mcm9tID4gMAorICAgICAgICAgICYmICEgcy0+ Zmlyc3RfZ2x5cGgtPnUuY21wLmF1dG9tYXRpYykpCisgICAgICAgIHMtPmJhY2tncm91bmRfZmls bGVkX3AgPSB0cnVlOworICAgICAgZWxzZQorICAgICAgICB3MzJfZHJhd19nbHlwaF9zdHJpbmdf YmFja2dyb3VuZCAocywgdHJ1ZSk7CisgICAgICB3MzJfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3Ry aW5nX2ZvcmVncm91bmQgKHMpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBHTFlQSExFU1NfR0xZ UEg6CisgICAgICBpZiAocy0+Zm9yX292ZXJsYXBzKQorICAgICAgICBzLT5iYWNrZ3JvdW5kX2Zp bGxlZF9wID0gdHJ1ZTsKKyAgICAgIGVsc2UKKyAgICAgICAgdzMyX2RyYXdfZ2x5cGhfc3RyaW5n X2JhY2tncm91bmQgKHMsIGZhbHNlKTsKKyAgICAgIHczMl9kcmF3X2dseXBobGVzc19nbHlwaF9z dHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAgICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAg ZW1hY3NfYWJvcnQgKCk7CisgICAgfQorICBpZiAoIXMtPmZvcl9vdmVybGFwcykKKyAgICB7Cisg ICAgICAvKiBEcmF3IHVuZGVybGluZS4gKi8KKyAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVf cCkKKyAgICAgICAgeworICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBG QUNFX1VOREVSX1dBVkUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIENPTE9SUkVGIGNv bG9yOworICAgICAgICAgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX2RlZmF1bHRlZF9wKQor ICAgICAgICAgICAgICAgIGNvbG9yID0gcy0+Z2MtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICAgICAgY29sb3IgPSBzLT5mYWNlLT51bmRlcmxpbmVfY29s b3I7CisgICAgICAgICAgICAgIHczMl9kcmF3X3VuZGVyd2F2ZSAocywgY29sb3IpOworICAgICAg ICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZB Q0VfVU5ERVJfTElORSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgdW5zaWduZWQgbG9u ZyB0aGlja25lc3MsIHBvc2l0aW9uOworICAgICAgICAgICAgICBpbnQgeTsKKyAgICAgICAgICAg ICAgaWYgKHMtPnByZXYgJiYgcy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3AKKyAgICAgICAgICAg ICAgICAgICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElO RSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBXZSB1c2UgdGhlIHNh bWUgdW5kZXJsaW5lIHN0eWxlIGFzIHRoZSBwcmV2aW91cyBvbmUuICovCisgICAgICAgICAgICAg ICAgICB0aGlja25lc3MgPSBzLT5wcmV2LT51bmRlcmxpbmVfdGhpY2tuZXNzOworICAgICAgICAg ICAgICAgICAgcG9zaXRpb24gPSBzLT5wcmV2LT51bmRlcmxpbmVfcG9zaXRpb247CisgICAgICAg ICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgLyogR2V0IHRoZSB1bmRlcmxpbmUgdGhpY2tuZXNzLiAgRGVmYXVsdCBpcyAx IHBpeGVsLiAqLworICAgICAgICAgICAgICAgICAgaWYgKHMtPmZvbnQgJiYgcy0+Zm9udC0+dW5k ZXJsaW5lX3RoaWNrbmVzcyA+IDApCisgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMt PmZvbnQtPnVuZGVybGluZV90aGlja25lc3M7CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAxOworICAgICAgICAgICAgICAgICAgaWYg KHhfdW5kZXJsaW5lX2F0X2Rlc2NlbnRfbGluZSkKKyAgICAgICAgICAgICAgICAgICAgcG9zaXRp b24gPSAocy0+aGVpZ2h0IC0gdGhpY2tuZXNzKSAtIChzLT55YmFzZSAtIHMtPnkpOworICAgICAg ICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgICAgICAgLyogR2V0IHRoZSB1bmRlcmxpbmUgcG9zaXRpb24uICBUaGlzIGlzIHRoZSBy ZWNvbW1lbmRlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgdmVydGljYWwgb2Zmc2V0IGlu IHBpeGVscyBmcm9tIHRoZSBiYXNlbGluZSB0byB0aGUgdG9wIG9mCisgICAgICAgICAgICAgICAg ICAgICAgICAgICB0aGUgdW5kZXJsaW5lLiAgVGhpcyBpcyBhIHNpZ25lZCB2YWx1ZSBhY2NvcmRp bmcgdG8gdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgICBzcGVjcywgYW5kIGl0cyBkZWZh dWx0IGlzCisgICAgICAgICAgICAgICAgICAgICAgICAgICBST1VORCAoKG1heGltdW1fZGVzY2Vu dCkgLyAyKSwgd2l0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgUk9VTkQgKHgpID0gZmxv b3IgKHggKyAwLjUpICAqLworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHhfdXNlX3VuZGVy bGluZV9wb3NpdGlvbl9wcm9wZXJ0aWVzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg cy0+Zm9udCAmJiBzLT5mb250LT51bmRlcmxpbmVfcG9zaXRpb24gPj0gMCkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgcG9zaXRpb24gPSBzLT5mb250LT51bmRlcmxpbmVfcG9zaXRpb247Cisg ICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChzLT5mb250KQorICAgICAgICAgICAgICAg ICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5mb250LT5kZXNjZW50ICsgMSkgLyAyOworICAgICAg ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gbWF4IChwb3Np dGlvbiwgdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0KTsKKyAgICAgICAgICAgICAgICB9CisgICAg ICAgICAgICAgIC8qIENoZWNrIHRoZSBzYW5pdHkgb2YgdGhpY2tuZXNzIGFuZCBwb3NpdGlvbi4g IFdlIHNob3VsZAorICAgICAgICAgICAgICAgICBhdm9pZCBkcmF3aW5nIHVuZGVybGluZSBvdXQg b2YgdGhlIGN1cnJlbnQgbGluZSBhcmVhLiAqLworICAgICAgICAgICAgICBpZiAocy0+eSArIHMt PmhlaWdodCA8PSBzLT55YmFzZSArIHBvc2l0aW9uKQorICAgICAgICAgICAgICAgIHBvc2l0aW9u ID0gKHMtPmhlaWdodCAtIDEpIC0gKHMtPnliYXNlIC0gcy0+eSk7CisgICAgICAgICAgICAgIGlm IChzLT55ICsgcy0+aGVpZ2h0IDwgcy0+eWJhc2UgKyBwb3NpdGlvbiArIHRoaWNrbmVzcykKKyAg ICAgICAgICAgICAgICB0aGlja25lc3MgPSAocy0+eSArIHMtPmhlaWdodCkgLSAocy0+eWJhc2Ug KyBwb3NpdGlvbik7CisgICAgICAgICAgICAgIHMtPnVuZGVybGluZV90aGlja25lc3MgPSB0aGlj a25lc3M7CisgICAgICAgICAgICAgIHMtPnVuZGVybGluZV9wb3NpdGlvbiA9cG9zaXRpb247Cisg ICAgICAgICAgICAgIHkgPSBzLT55YmFzZSArIHBvc2l0aW9uOworICAgICAgICAgICAgICBpZiAo cy0+ZmFjZS0+dW5kZXJsaW5lX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgICAgIHczMl9maWxs X2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+Z2MtPmZvcmVncm91bmQsIHMtPngsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgeSwgcy0+d2lkdGgsIDEpOworICAgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+ZmFj ZS0+dW5kZXJsaW5lX2NvbG9yLCBzLT54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgeSwgcy0+d2lkdGgsIDEpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAvKiBE cmF3IG92ZXJsaW5lLiAqLworICAgICAgaWYgKHMtPmZhY2UtPm92ZXJsaW5lX3ApCisgICAgICAg IHsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIGR5ID0gMCwgaCA9IDE7CisgICAgICAgICAgaWYg KHMtPmZhY2UtPm92ZXJsaW5lX2NvbG9yX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgdzMyX2Zp bGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5nYy0+Zm9yZWdyb3VuZCwgcy0+eCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgIHMtPnkgKyBkeSwgcy0+d2lkdGgsIGgpOworICAgICAgICAgICAg ZWxzZQorICAgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmZhY2Ut Pm92ZXJsaW5lX2NvbG9yLCBzLT54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzLT55 ICsgZHksIHMtPndpZHRoLCBoKTsKKyAgICAgICAgfQorICAgICAgLyogRHJhdyBzdHJpa2UtdGhy b3VnaC4gKi8KKyAgICAgIGlmIChzLT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9wCisgICAgICAgICAg JiYgIUZPTlRfVEVYVE1FVFJJQyAocy0+Zm9udCkudG1TdHJ1Y2tPdXQpCisgICAgICAgIHsKKyAg ICAgICAgICB1bnNpZ25lZCBsb25nIGggPSAxOworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZHkg PSAocy0+aGVpZ2h0IC0gaCkgLyAyOworICAgICAgICAgIGlmIChzLT5mYWNlLT5zdHJpa2VfdGhy b3VnaF9jb2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMtPmYs IHMtPmhkYywgcy0+Z2MtPmZvcmVncm91bmQsIHMtPngsIHMtPnkgKyBkeSwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgIHMtPndpZHRoLCBoKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5mYWNlLT5zdHJpa2VfdGhyb3Vn aF9jb2xvciwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+eSArIGR5LCBz LT53aWR0aCwgaCk7CisgICAgICAgIH0KKyAgICAgIC8qIERyYXcgcmVsaWVmIGlmIG5vdCB5ZXQg ZHJhd24uICovCisgICAgICBpZiAoIXJlbGllZl9kcmF3bl9wICYmIHMtPmZhY2UtPmJveCAhPSBG QUNFX05PX0JPWCkKKyAgICAgICAgdzMyX2RyYXdfZ2x5cGhfc3RyaW5nX2JveCAocyk7CisgICAg ICBpZiAocy0+cHJldikKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBnbHlwaF9zdHJpbmcg KnByZXY7CisgICAgICAgICAgZm9yIChwcmV2ID0gcy0+cHJldjsgcHJldjsgcHJldiA9IHByZXYt PnByZXYpCisgICAgICAgICAgICBpZiAocHJldi0+aGwgIT0gcy0+aGwKKyAgICAgICAgICAgICAg ICAmJiBwcmV2LT54ICsgcHJldi0+d2lkdGggKyBwcmV2LT5yaWdodF9vdmVyaGFuZyA+IHMtPngp CisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBBcyBwcmV2IHdhcyBkcmF3biB3 aGlsZSBjbGlwcGVkIHRvIGl0cyBvd24gYXJlYSwgd2UKKyAgICAgICAgICAgICAgICAgICBtdXN0 IGRyYXcgdGhlIHJpZ2h0X292ZXJoYW5nIHBhcnQgdXNpbmcgcy0+aGwgbm93LiAqLworICAgICAg ICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBzYXZlID0gcHJldi0+aGw7CisgICAgICAg ICAgICAgICAgcHJldi0+aGwgPSBzLT5obDsKKyAgICAgICAgICAgICAgICBtY193MzJfc2V0X2ds eXBoX3N0cmluZ19nYyAocHJldiwgY3Vyc29yX2djX3ApOworICAgICAgICAgICAgICAgIHczMl9z ZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nX2V4YWN0bHkgKHMsIHByZXYpOworICAgICAgICAgICAg ICAgIGlmIChwcmV2LT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBIKQorICAgICAgICAg ICAgICAgICAgdzMyX2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHByZXYpOworICAgICAg ICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB3MzJfZHJhd19jb21wb3NpdGVf Z2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHByZXYpOworICAgICAgICAgICAgICAgIHczMl9zZXRf Y2xpcF9yZWN0YW5nbGUgKHByZXYtPmhkYywgTlVMTCk7CisgICAgICAgICAgICAgICAgcHJldi0+ aGwgPSBzYXZlOworICAgICAgICAgICAgICAgIHByZXYtPm51bV9jbGlwcyA9IDA7CisgICAgICAg ICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKHMtPm5leHQpCisgICAgICAgIHsKKyAgICAg ICAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpuZXh0OworICAgICAgICAgIGZvciAobmV4dCA9IHMt Pm5leHQ7IG5leHQ7IG5leHQgPSBuZXh0LT5uZXh0KQorICAgICAgICAgICAgaWYgKG5leHQtPmhs ICE9IHMtPmhsCisgICAgICAgICAgICAgICAgJiYgbmV4dC0+eCAtIG5leHQtPmxlZnRfb3Zlcmhh bmcgPCBzLT54ICsgcy0+d2lkdGgpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAv KiBBcyBuZXh0IHdpbGwgYmUgZHJhd24gd2hpbGUgY2xpcHBlZCB0byBpdHMgb3duIGFyZWEsCisg ICAgICAgICAgICAgICAgICAgd2UgbXVzdCBkcmF3IHRoZSBsZWZ0X292ZXJoYW5nIHBhcnQgdXNp bmcgcy0+aGwgbm93LiAqLworICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBz YXZlID0gbmV4dC0+aGw7CisgICAgICAgICAgICAgICAgbmV4dC0+aGwgPSBzLT5obDsKKyAgICAg ICAgICAgICAgICBtY193MzJfc2V0X2dseXBoX3N0cmluZ19nYyAobmV4dCwgY3Vyc29yX2djX3Ap OworICAgICAgICAgICAgICAgIHczMl9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nX2V4YWN0bHkg KHMsIG5leHQpOworICAgICAgICAgICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSA9 PSBDSEFSX0dMWVBIKQorICAgICAgICAgICAgICAgICAgdzMyX2RyYXdfZ2x5cGhfc3RyaW5nX2Zv cmVncm91bmQgKG5leHQpOworICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAg ICAgICB3MzJfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5leHQpOwor ICAgICAgICAgICAgICAgIHczMl9zZXRfY2xpcF9yZWN0YW5nbGUgKG5leHQtPmhkYywgTlVMTCk7 CisgICAgICAgICAgICAgICAgbmV4dC0+aGwgPSBzYXZlOworICAgICAgICAgICAgICAgIG5leHQt Pm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgICAgICAgbmV4dC0+Y2xpcF9oZWFkID0gcy0+bmV4 dDsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAvKiBSZXNldCBjbGlwcGlu Zy4gKi8KKyAgdzMyX3NldF9jbGlwX3JlY3RhbmdsZSAocy0+aGRjLCBOVUxMKTsKKyAgcy0+bnVt X2NsaXBzID0gMDsKK30KKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKIC8qIEZyaW5nZSBiaXRtYXBzLiAgKi8KIAogc3RhdGljIGludCBt YXhfZnJpbmdlX2JtcCA9IDA7CkBAIC01NDIsNiArMTcwMSwxNSBAQCB3MzJfdXBkYXRlX2JlZ2lu IChzdHJ1Y3QgZnJhbWUgKmYpCiAgIGlmICghIEZSQU1FX1czMl9QIChmKSkKICAgICByZXR1cm47 CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK KyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBmOworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiAgIC8qIFJlZ2VuZXJhdGUgZGlzcGxheSBwYWxldHRlIGJlZm9yZSBkcmF3aW5nIGlmIGxp c3Qgb2YgcmVxdWVzdGVkCiAgICAgIGNvbG9ycyBoYXMgY2hhbmdlZC4gKi8KICAgaWYgKGRpc3Bs YXlfaW5mby0+cmVnZW5fcGFsZXR0ZSkKQEAgLTY3NCw2ICsxODQyLDE2IEBAIHczMl91cGRhdGVf ZW5kIChzdHJ1Y3QgZnJhbWUgKmYpCiAKICAgLyogTW91c2UgaGlnaGxpZ2h0IG1heSBiZSBkaXNw bGF5ZWQgYWdhaW4uICAqLwogICBNT1VTRV9ITF9JTkZPIChmKS0+bW91c2VfZmFjZV9kZWZlciA9 IGZhbHNlOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09S UyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gTlVMTDsKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogfQogCiAKQEAgLTQwMDIsMTMgKzUxODAsNzQgQEAgdzMyX3NldF92ZXJ0 aWNhbF9zY3JvbGxfYmFyIChzdHJ1Y3Qgd2luZG93ICp3LAogCSAgICAgIHJlbGVhc2VfZnJhbWVf ZGMgKGYsIGhkYyk7CiAJICAgICAgdzMyX2NsZWFyX3VuZGVyX2ludGVybmFsX2JvcmRlciAoZik7 CiAJICAgIH0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExF LUNVUlNPUlMgKi8KKworLyogUkVQQUlOVElORyBXSEVOIFJFTU9WSU5HIFNDUk9MTCBCQVI6CisK Ky0gU2VxdWVuY2Ugb2YgRXZlbnRzOgorCisgIC4gYHJlZGlzcGxheV9pbnRlcm5hbCcgY2FsbHMg dGhlIGBjb25kZW1uX3Njcm9sbF9iYXJzX2hvb2snLCB3aGljaCBtYXJrcyBhbGwKKyAgICBzY3Jv bGwgYmFycyBhcyBjYW5kaWRhdGVzIGZvciBkZWxldGlvbi4KKworICAuIFRoZW4gYHJlZGlzcGxh eV9pbnRlcm5hbCcgY2FsbHMgYHJlZGlzcGxheV93aW5kb3dzJywgd2hpY2ggd2Fsa3MgdGhlCisg ICAgd2luZ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3Qg ZnJhbWUgKmYpCiAgICAgewogICAgICAgc3RydWN0IHNjcm9sbF9iYXIgKmIgPSBYU0NST0xMX0JB UiAoYmFyKTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNP UlMgKi8KKworICAgICAgLyogYERlc3Ryb3lXaW5kb3cnIHdpdGhpbiBgeF9zY3JvbGxfYmFyX3Jl bW92ZScgcmVwYWludHMgdGhlIHJlY3RhbmdsZS4KKyAgICAgIFRoZXJlZm9yZSwgd2UgZmlyc3Qg c2VuZCBhIG1lc3NhZ2UgdG8gaW5oaWJpdCByZXBhaW50aW5nLiAqLworICAgICAgaWYgKCFXSU5E T1dfTElWRV9QIChiLT53aW5kb3cpKQorICAgICAgICB7CisgICAgICAgICAgSFdORCBod25kID0g U0NST0xMX0JBUl9XMzJfV0lORE9XIChiKTsKKyAgICAgICAgICBTZW5kTWVzc2FnZSAoaHduZCwg V01fU0VUUkVEUkFXLCBmYWxzZSwgMCk7CisgICAgICAgIH0KKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogICAgICAgdzMyX3Njcm9sbF9iYXJfcmVtb3ZlIChiKTsKIAogICAgICAgbmV4 dCA9IGItPm5leHQ7CkBAIC03MDg4LDYgKzgzNDIsMjAgQEAgZXh0ZXJuIGZyYW1lX3Bhcm1faGFu ZGxlciB3MzJfZnJhbWVfcGFybV9oYW5kbGVyc1tdOwogCiBzdGF0aWMgc3RydWN0IHJlZGlzcGxh eV9pbnRlcmZhY2UgdzMyX3JlZGlzcGxheV9pbnRlcmZhY2UgPQogeworCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisvKiBgcmVkaXNwbGF5X2lu dGVyZmFjZScgaW4gYHczMnRlcm0uY2AgbXVzdCBiZSBpbiB0aGUgZXhhY3Qgc2FtZSBvcmRlciBh cyB0aGUKK2ByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgZGlzcGV4dGVybi5oYCEgKi8KKworICBt Y193MzJfZHJhd193aW5kb3dfY3Vyc29yLAorICBtY193MzJfZHJhd19nbHlwaF9zdHJpbmcsCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgdzMyX2ZyYW1lX3Bhcm1faGFuZGxlcnMs CiAgIGd1aV9wcm9kdWNlX2dseXBocywKICAgZ3VpX3dyaXRlX2dseXBocywKZGlmZiAtLWdpdCBh L3NyYy93aW5kb3cuaCBiL3NyYy93aW5kb3cuaAppbmRleCA2YjBmMGU1Li4xNGRkMzhhIDEwMDY0 NAotLS0gYS9zcmMvd2luZG93LmgKKysrIGIvc3JjL3dpbmRvdy5oCkBAIC0zMjQsNiArMzI0LDE0 NyBAQCBzdHJ1Y3Qgd2luZG93CiAKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KIAorCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyog U3VmZml4ZXMgZm9yIHRoZSBgbWNgIHdpbmRvdyBwb2ludGVyIHByZWZpeC4gKi8KK3N0cnVjdCBt dWx0aXBsZV9jdXJzb3JzCit7CisgIC8qIFRoZSByZWNvcmRlZCBwaXhlbCB3aWR0aCBvZiB0aGUg bGFzdCBsaW5lIG51bWJlciBkcmF3biBkdXJpbmcgcmVkaXNwbGF5ICovCisgIGludCBsbnVtX3Bp eGVsX3dpZHRoOworfSBtYzsKKworc3RydWN0IG1jX21hdHJpeAoreworICBwdHJkaWZmX3QgdnBv c19hbGxvY2F0ZWQ7CisgIHB0cmRpZmZfdCB2cG9zX3VzZWQ7CisgIHB0cmRpZmZfdCBjdXJzb3Jz X3VzZWRbNF07CisgIGVudW0gbWNfY2FjaGVfdHlwZQorICB7CisgICAgTUNfQ0FDSEUsCisgICAg Q0hfQ0FDSEUsCisgICAgRkNfQ0FDSEUsCisgICAgTk9fQ0FDSEUKKyAgfSBjYWNoZV90eXBlOwor ICBzdHJ1Y3QgbWNfdnBvcworICB7CisgICAgcHRyZGlmZl90IGNhY2hlX2FsbG9jYXRlZFs0XTsK KyAgICBwdHJkaWZmX3QgY2FjaGVfdXNlZFs0XTsKKyAgICBzdHJ1Y3QgbWNfY29udGVudHMKKyAg ICB7CisgICAgICBib29sX2JmIHNhbWVfcCA6IDE7CisgICAgICBzdHJ1Y3QgZ2x5cGggZ2x5cGg7 CisgICAgICBpbnQgeDsKKyAgICAgIGludCBmeDsKKyAgICAgIGludCB5OworICAgICAgaW50IGZ5 OworICAgICAgaW50IGhwb3M7CisgICAgICBpbnQgdnBvczsKKyAgICAgIGludCB3ZDsKKyAgICAg IGludCBoOworICAgICAgZW51bSBtY19jdXJzb3JfdHlwZQorICAgICAgeworICAgICAgICAvKiBO T1RFOiAgVGhlIGZyaW5nZSBiaXRtYXAgZnJhbWV3b3JrIHJlbGllcyB1cG9uIE1DX05PX0ZSSU5H RV9CSVRNQVAKKyAgICAgICAgaGF2aW5nIGEgdmFsdWUgb2YgemVybyAoMCkuICovCisgICAgICAg IE1DX05PX0ZSSU5HRV9CSVRNQVAsCisgICAgICAgIE1DX05PX0NVUlNPUiwKKyAgICAgICAgTUNf UklHSFRfRlJJTkdFX0JJVE1BUCwKKyAgICAgICAgTUNfTEVGVF9GUklOR0VfQklUTUFQLAorICAg ICAgICBNQ19GUkFNRURfQk9YLAorICAgICAgICBNQ19GSUxMRURfQk9YLAorICAgICAgICBNQ19I T0xMT1dfQk9YLAorICAgICAgICBNQ19CQVIsCisgICAgICAgIE1DX0hCQVIKKyAgICAgIH0gY3Vy c29yX3R5cGU7CisgICAgICBpbnQgY3Vyc29yX3dpZHRoOworICAgICAgc3RydWN0IG1jX1JHQgor ICAgICAgeworICAgICAgICBkb3VibGUgcmVkOworICAgICAgICBkb3VibGUgZ3JlZW47CisgICAg ICAgIGRvdWJsZSBibHVlOworICAgICAgfSBmZywgYmc7CisgICAgICBib29sX2JmIGFjdGl2ZV9w IDogMTsKKyAgICAgIGVudW0gbWNfZmxhdm9yCisgICAgICB7CisgICAgICAgIE5PX0ZMQVZPUiwK KyAgICAgICAgTUNfR0xZUEgsCisgICAgICAgIE1DX0dMWVBITEVTUywKKyAgICAgICAgTUNfT1ZF UkxBWV9BUlJPV19CSVRNQVAsCisgICAgICAgIE1DX1BJTENST1csCisgICAgICAgIE1DX0hPTExP V19SRUNUQU5HTEVfUklHSFRfQVJST1csCisgICAgICAgIE1DX1JFVkVSU0VEX0hPTExPV19SRUNU QU5HTEVfUklHSFRfQVJST1csCisgICAgICAgIE1DX0hPTExPV19SRUNUQU5HTEUsCisgICAgICAg IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVywKKyAgICAgICAgTUNfUkVWRVJTRURfVkVSVElD QUxfQkFSX1JJR0hUX0FSUk9XLAorICAgICAgICBNQ19WRVJUSUNBTF9CQVIsCisgICAgICAgIE1D X1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUiwKKyAgICAgICAgTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFT SAorICAgICAgfSBnbHlwaF9mbGF2b3I7CisgICAgICBlbnVtIG1jX3Jvd19wb3NpdGlvbgorICAg ICAgeworICAgICAgICBQUkVfWlYsCisgICAgICAgIEFUX1pWLAorICAgICAgICBQT1NUX1pWCisg ICAgICB9IHJvd19wb3NpdGlvbjsKKyAgICAgIGJvb2xfYmYgZW5hYmxlZF9wIDogMTsKKyAgICB9 ICpjYWNoZVs0XTsKKyAgfSAqdnBvczsKKyAgLyogVXNlZCBlbHNld2hlcmUuICovCisgIHN0cnVj dCBtY19lc3NlbnRpYWxzCisgIHsKKyAgICBib29sX2JmIGFjdGl2ZV9wIDogMTsKKyAgICBzdHJ1 Y3QgbWNfUkdCIGNoX2ZnWzNdLCBmY19mZ1szXSwgc3BfZmc7CisgICAgaW50IGZjX3g7CisgICAg aW50IHp2OworICAgIGludCB6dl9ieXRlOworICB9IGVzc2VudGlhbHM7CisgIC8qIFVzZWQgZWxz ZXdoZXJlLiAqLworICBlbnVtIG1jX2VuZ2luZV90eXBlCisgIHsKKyAgICBNVUxUSVBMRV9DVVJT T1JTLAorICAgIEhPUklaT05UQUxfUlVMRVIsCisgICAgVkVSVElDQUxfUlVMRVIsCisgICAgRklM TF9DT0xVTU4sCisgICAgQ1VSU09SX0lORElDQVRPUgorICB9IGFjdGlvbl90eXBlOworICAvKiBV c2VkIGVsc2V3aGVyZS4gKi8KKyAgZW51bSBtY19wcmVfc2Nyb2xsX2NsZWFuX3R5cGUKKyAgewor ICAgIFRSWV9XSU5ET1dfUkVVU0lOR19DVVJSRU5UX01BVFJJWF9ET1dOLAorICAgIFRSWV9XSU5E T1dfUkVVU0lOR19DVVJSRU5UX01BVFJJWF9VUCwKKyAgICBUUllfV0lORE9XX0lECisgIH0gbWNf cHJlX3Njcm9sbF9jbGVhbl90eXBlX19mcm9tX3doZXJlOworICAvKiBVc2VkIGVsc2V3aGVyZS4g Ki8KKyAgZW51bSBtY19kcmF3X3Jvd190eXBlCisgIHsKKyAgICBOT1dIRVJFLAorICAgIFNDUklC RV9PTkUsCisgICAgU0NSSUJFX1RXTywKKyAgICBTQ1JJQkVfVEhSRUUsCisgICAgU0tJUFBFRCwK KyAgICBQT1NUX0NIQU5HRUQsCisgICAgVU5DSEFOR0VELAorICAgIFNFVF9DVVJTT1JfT05FLAor ICAgIFNFVF9DVVJTT1JfVFdPCisgIH0gbWNfZHJhd19yb3dfdHlwZV9fZnJvbV93aGVyZTsKKyAg LyogVXNlZCBlbHNld2hlcmUuICovCisgIGVudW0gbWNfcmVkcmF3X3Jvd190eXBlCisgIHsKKyAg ICBVUERBVEVfV0lORE9XX19SRURSQVdfT1ZFUkxBUFBFRF9ST1dTLAorICAgIEdVSV9JTlNFUlRf R0xZUEhTLAorICAgIEdVSV9GSVhfT1ZFUkxBUFBJTkdfQVJFQSwKKyAgICBEUkFXX1JPV19XSVRI X01PVVNFX0ZBQ0UsCisgICAgRVhQT1NFX0FSRUFfT05FLAorICAgIEVYUE9TRV9BUkVBX1RXTywK KyAgICBFWFBPU0VfTElORQorICB9IG1jX3JlZHJhd19yb3dfdHlwZV9fZnJvbV93aGVyZTsKK30g bWNfbWF0cml4OworCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogICAgIC8qIEN1cnNvciB0eXBlIG9mIGxhc3QgY3Vyc29yIGRyYXduIG9u IHRoZSB3aW5kb3cuICAqLwogICAgIGVudW0gdGV4dF9jdXJzb3Jfa2luZHMgcGh5c19jdXJzb3Jf dHlwZTsKIApkaWZmIC0tZ2l0IGEvc3JjL3hkaXNwLmMgYi9zcmMveGRpc3AuYwppbmRleCA1MGY2 NDQzLi4zNGQwOTlmIDEwMDY0NAotLS0gYS9zcmMveGRpc3AuYworKysgYi9zcmMveGRpc3AuYwpA QCAtOTYyLDYgKzk2Miw0ODkwIEBAIHN0YXRpYyB2b2lkIHNob3dfbW91c2VfZmFjZSAoTW91c2Vf SExJbmZvICosIGVudW0gZHJhd19nbHlwaHNfZmFjZSk7CiBzdGF0aWMgYm9vbCBjb29yZHNfaW5f bW91c2VfZmFjZV9wIChzdHJ1Y3Qgd2luZG93ICosIGludCwgaW50KTsKIAogCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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bmcgKiosIHN0cnVjdCBnbHlw aF9zdHJpbmcgKiosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5 cGhfc3RyaW5nICopOworc3RhdGljIHZvaWQgcHJlcGVuZF9nbHlwaF9zdHJpbmdfbGlzdHMgKHN0 cnVjdCBnbHlwaF9zdHJpbmcgKiosIHN0cnVjdCBnbHlwaF9zdHJpbmcgKiosCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAqLCBzdHJ1 Y3QgZ2x5cGhfc3RyaW5nICopOworc3RhdGljIHZvaWQgYXBwZW5kX2dseXBoX3N0cmluZ19saXN0 cyAoc3RydWN0IGdseXBoX3N0cmluZyAqKiwgc3RydWN0IGdseXBoX3N0cmluZyAqKiwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9zdHJpbmcgKiwg c3RydWN0IGdseXBoX3N0cmluZyAqKTsKK3N0YXRpYyB2b2lkIGluaXRfZ2x5cGhfc3RyaW5nIChz dHJ1Y3QgZ2x5cGhfc3RyaW5nICosIE1DX09QVElPTkFMX0hEQyAoaGRjKSB1bnNpZ25lZCAqLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGds eXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gZ2x5cGhfcm93 X2FyZWEsIGludCwgZW51bSBkcmF3X2dseXBoc19mYWNlKTsKK3N0YXRpYyB2b2lkIGNvbXB1dGVf b3ZlcmhhbmdzX2FuZF94IChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICosIGludCwgYm9vbCk7CitzdGF0 aWMgc3RydWN0IGdseXBoX3N0cmluZyAqIGdseXBoX3N0cmluZ19jb250YWluaW5nX2JhY2tncm91 bmRfd2lkdGggKHN0cnVjdCBnbHlwaF9zd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ChwdHJkaWZmX3QgaSA9 IDA7IGkgPCBsZW5ndGg7IGkrKykKKyAgICBwLT5jb250ZW50c1tpXSA9IFFuaWw7CisgIHJldHVy biBtYWtlX2xpc3BfcHRyIChwLCBMaXNwX1ZlY3Rvcmxpa2UpOworfQorCitMaXNwX09iamVjdAor bWNfbGlzdG4gKHB0cmRpZmZfdCBjb3VudCwgTGlzcF9PYmplY3QgYXJnLCAuLi4pCit7CisgIGVh c3N1bWUgKDAgPCBjb3VudCk7CisgIExpc3BfT2JqZWN0IHZhbCA9IEZjb25zIChhcmcsIFFuaWwp OworICBMaXNwX09iamVjdCB0YWlsID0gdmFsOworICB2YV9saXN0IGFwOworICB2YV9zdGFydCAo YXAsIGFyZyk7CisgIGZvciAocHRyZGlmZl90IGkgPSAxOyBpIDwgY291bnQ7IGkrKykKKyAgICB7 CisgICAgICBMaXNwX09iamVjdCBlbGVtID0gRmNvbnMgKHZhX2FyZyAoYXAsIExpc3BfT2JqZWN0 KSwgUW5pbCk7CisgICAgICBYU0VUQ0RSICh0YWlsLCBlbGVtKTsKKyAgICAgIHRhaWwgPSBlbGVt OworICAgIH0KKyAgdmFfZW5kIChhcCk7CisgIHJldHVybiB2YWw7Cit9CisKK0xpc3BfT2JqZWN0 CittY19tZW1xIChMaXNwX09iamVjdCBlbHQsIExpc3BfT2JqZWN0IGxpc3QpCit7CisgIHdoaWxl ICgxKQorICAgIHsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpIHx8IEVRIChYQ0FSIChsaXN0KSwg ZWx0KSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBp ZiAoIUNPTlNQIChsaXN0KSB8fCBFUSAoWENBUiAobGlzdCksIGVsdCkpCisgICAgICAgIGJyZWFr OworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkgfHwg RVEgKFhDQVIgKGxpc3QpLCBlbHQpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RS IChsaXN0KTsKKyAgICB9CisgIHJldHVybiBsaXN0OworfQorCitMaXNwX09iamVjdAorbWNfbnRo IChpbnQgbnVtLCBMaXNwX09iamVjdCBsaXN0KQoreworICBmb3IgKGludCBpID0gMDsgaSA8IG51 bSAmJiAhTklMUCAobGlzdCk7IGkrKykKKyAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgIGlmIChD T05TUCAobGlzdCkpCisgICAgcmV0dXJuIFhDQVIgKGxpc3QpOworICAgIGVsc2UKKyAgICAgIHJl dHVybiBRbmlsOworfQorCitMaXNwX09iamVjdAorbWNfYXNzcSAoTGlzcF9PYmplY3Qga2V5LCBM aXNwX09iamVjdCBsaXN0KQoreworICB3aGlsZSAoMSkKKyAgICB7CisgICAgICBpZiAoIUNPTlNQ IChsaXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAg ICYmIEVRIChYQ0FSIChYQ0FSIChsaXN0KSksIGtleSkpKQorICAgICAgICBicmVhazsKKyAgICAg IGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAg fHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgRVEgKFhDQVIgKFhDQVIg KGxpc3QpKSwga2V5KSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3Qp OworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxp c3QpKQorICAgICAgICAgICAgICAmJiBFUSAoWENBUiAoWENBUiAobGlzdCkpLCBrZXkpKSkKKyAg ICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgfQorICBpZiAoQ09O U1AgKGxpc3QpKQorICAgIHJldHVybiBYQ0FSIChsaXN0KTsKKyAgICBlbHNlCisgICAgICByZXR1 cm4gUW5pbDsKK30KKworTGlzcF9PYmplY3QKK21jX2Fzc29jIChMaXNwX09iamVjdCBrZXksIExp c3BfT2JqZWN0IGxpc3QpCit7CisgIExpc3BfT2JqZWN0IGNhcjsKKyAgd2hpbGUgKDEpCisgICAg eworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxp c3QpKQorICAgICAgICAgICAgICAmJiAoY2FyID0gWENBUiAoWENBUiAobGlzdCkpLAorICAgICAg ICAgICAgICAgICAgRVEgKGNhciwga2V5KSB8fCAhTklMUCAoRmVxdWFsIChjYXIsIGtleSkpKSkp CisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFD T05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAg ICAgICAmJiAoY2FyID0gWENBUiAoWENBUiAobGlzdCkpLAorICAgICAgICAgICAgICAgICAgRVEg KGNhciwga2V5KSB8fCAhTklMUCAoRmVxdWFsIChjYXIsIGtleSkpKSkpCisgICAgICAgIGJyZWFr OworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAg ICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAgICAgICAmJiAoY2FyID0g WENBUiAoWENBUiAobGlzdCkpLAorICAgICAgICAgICAgICAgICAgRVEgKGNhciwga2V5KSB8fCAh TklMUCAoRmVxdWFsIChjYXIsIGtleSkpKSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9 IFhDRFIgKGxpc3QpOworICAgIH0KKyAgaWYgKENPTlNQIChsaXN0KSkKKyAgICByZXR1cm4gWENB UiAobGlzdCk7CisgICAgZWxzZQorICAgICAgcmV0dXJuIFFuaWw7Cit9CisKK0xpc3BfT2JqZWN0 CittY19wbGlzdF9n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G9fbWF4ID0gKGNvbCA8IE1PU1RfUE9TSVRJVkVfRklYTlVNIC0gSU5UX01B WAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAoRU1BQ1NfSU5UKSBJTlRfTUFY ICsgY29sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1PU1RfUE9TSVRJVkVf RklYTlVNKTsKKyAgICAgIGlmICgocHJvcCA9IG1jX3BsaXN0X2dldCAocGxpc3QsIFFDd2lkdGgp LCBSQU5HRURfRklYTlVNUCAoMCwgcHJvcCwgSU5UX01BWCkpCisgICAgICAgICAgfHwgKHByb3Ag PSBtY19wbGlzdF9nZXQgKHBsaXN0LCBRQ3JlbGF0aXZlX3dpZHRoKSwKKyAgICAgICAgICAgICAg UkFOR0VEX0ZJWE5VTVAgKDAsIHByb3AsIElOVF9NQVgpKSkKKyAgICAgICAgd2lkdGggPSBYRklY TlVNIChwcm9wKTsKKyAgICAgICAgZWxzZSBpZiAoRkxPQVRQIChwcm9wKSAmJiAwIDw9IFhGTE9B VF9EQVRBIChwcm9wKQorICAgICAgICAgICAgICAgICAmJiBYRkxPQVRfREFUQSAocHJvcCkgPD0g SU5UX01BWCkKKyAgICAgICAgICB3aWR0aCA9IChpbnQpKFhGTE9BVF9EQVRBIChwcm9wKSArIDAu NSk7CisgICAgICAgICAgZWxzZSBpZiAoKHByb3AgPSBtY19wbGlzdF9nZXQgKHBsaXN0LCBRQ2Fs aWduX3RvKSwKKyAgICAgICAgICAgICAgICAgICAgUkFOR0VEX0ZJWE5VTVAgKGNvbCwgcHJvcCwg YWxpZ25fdG9fbWF4KSkpCisgICAgICAgICAgICB3aWR0aCA9IFhGSVhOVU0gKHByb3ApIC0gY29s OworICAgICAgICAgICAgICBlbHNlIGlmIChGTE9BVFAgKHByb3ApICYmIGNvbCA8PSBYRkxPQVRf REFUQSAocHJvcCkKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgKFhGTE9BVF9EQVRBIChwcm9w KSA8PSBhbGlnbl90b19tYXgpKQorICAgICAgICAgICAgICAgIHdpZHRoID0gKGludCkoWEZMT0FU X0RBVEEgKHByb3ApICsgMC41KSAtIGNvbDsKKyAgICAgIGlmICh3aWR0aCA+PSAwKQorICAgICAg ICB7CisgICAgICAgICAgcHRyZGlmZl90IHN0YXJ0OworICAgICAgICAgIGlmIChPVkVSTEFZUCAo b3ZlcmxheSkpCisgICAgICAgICAgICAqZW5kcG9zID0gT1ZFUkxBWV9QT1NJVElPTiAoT1ZFUkxB WV9FTkQgKG92ZXJsYXkpKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgZ2V0X3By b3BlcnR5X2FuZF9yYW5nZSAocG9zLCBRZGlzcGxheSwgJnZhbCwgJnN0YXJ0LCBlbmRwb3MsIFFu aWwpOworICAgICAgICAgIC8qIEZvciA6cmVsYXRpdmUtd2lkdGgsIHdlIG5lZWQgdG8gbXVsdGlw bHkgYnkgdGhlIGNvbHVtbgorICAgICAgICAgICAgIHdpZHRoIG9mIHRoZSBjaGFyYWN0ZXIgYXQg UE9TLCBpZiBpdCBpcyBncmVhdGVyIHRoYW4gMS4gKi8KKyAgICAgICAgICBpZiAoIU5JTFAgKG1j X3BsaXN0X2dldCAocGxpc3QsIFFDcmVsYXRpdmVfd2lkdGgpKQorICAgICAgICAgICAgICAmJiAh TklMUCAoQlZBUiAoY3VycmVudF9idWZmZXIsIGVuYWJsZV9tdWx0aWJ5dGVfY2hhcmFjdGVycykp KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpbnQgYiwgd2Q7CisgICAgICAgICAgICAg IHVuc2lnbmVkIGNoYXIgKnAgPSBCWVRFX1BPU19BRERSIChDSEFSX1RPX0JZVEUgKHBvcykpOwor ICAgICAgICAgICAgICBNQ19NVUxUSUJZVEVfQllURVNfV0lEVEggKHAsIGJ1ZmZlcl9kaXNwbGF5 X3RhYmxlICgpLCBiLCB3ZCk7CisgICAgICAgICAgICAgIHdpZHRoICo9IHdkOworICAgICA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wgcHRfYnl0ZSA9IFBUX0JZVEU7CisgIExp c3BfT2JqZWN0IHJlLCBmb250X29iamVjdCwgbGdzdHJpbmc7CisgIHB0cmRpZmZfdCBsZW47Cisg IHJlY29yZF91bndpbmRfc2F2ZV9tYXRjaF9kYXRhICgpOworICByZSA9IEFSRUYgKHJ1bGUsIDAp OworICBpZiAoTklMUCAocmUpKQorICAgIGxlbiA9IDE7CisgIGVsc2UgaWYgKCEgU1RSSU5HUCAo cmUpKQorICAgIHJldHVybiB1bmJpbmRfdG8gKGNvdW50LCBRbmlsKTsKKyAgZWxzZSBpZiAoKGxl biA9IGZhc3RfbG9va2luZ19hdCAocmUsIGNoYXJwb3MsIGJ5dGVwb3MsIGxpbWl0LCAtMSwgc3Ry aW5nKSkKKyAgICAgICAgICAgPiAwKQorICAgIHsKKyAgICAgIGlmIChOSUxQIChzdHJpbmcpKQor ICAgICAgICBsZW4gPSBCWVRFX1RPX0NIQVIgKGJ5dGVwb3MgKyBsZW4pIC0gY2hhcnBvczsKKyAg ICAgIGVsc2UKKyAgICAgICAgbGVuID0gc3RyaW5nX2J5dGVfdG9fY2hhciAoc3RyaW5nLCBieXRl cG9zICsgbGVuKSAtIGNoYXJwb3M7CisgICAgfQorICBpZiAobGVuIDw9IDApCisgICAgcmV0dXJu IHVuYmluZF90byAoY291bnQsIFFuaWwpOworICB0byA9IGxpbWl0ID0gY2hhcnBvcyArIGxlbjsK KyNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KKyAgaWYgKEZSQU1FX1dJTkRPV19QIChmKSkKKyAg ICB7CisgICAgICBmb250X29iamVjdCA9IGZvbnRfcmFuZ2UgKGNoYXJwb3MsIGJ5dGVwb3MsICZ0 bywgd2luLCBmYWNlLCBzdHJpbmcpOworICAgICAgaWYgKCEgRk9OVF9PQkpFQ1RfUCAoZm9udF9v YmplY3QpCisgICAgICAgICAgfHwgKCEgTklMUCAocmUpCisgICAgICAgICAgICAgICYmIHRvIDwg bGltaXQKKyAgICAgICAgICAgICAgJiYgKGZhc3RfbG9va2luZ19hdCAocmUsIGNoYXJwb3MsIGJ5 dGVwb3MsIHRvLCAtMSwgc3RyaW5nKSA8PSAwKSkpCisgICAgICAgIHJldHVybiB1bmJpbmRfdG8g KGNvdW50LCBRbmlsKTsKKyAgICB9CisgIGVsc2UKKyNlbmRpZiAgICAgICAgLyogbm90IEhBVkVf V0lORE9XX1NZU1RFTSAqLworICAgIGZvbnRfb2JqZWN0ID0gd2luLT5mcmFtZTsKKyAgbGdzdHJp bmcgPSBGY29tcG9zaXRpb25fZ2V0X2dzdHJpbmcgKHBvcywgbWFrZV9maXhudW0gKHRvKSwgZm9u dF9vYmplY3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJpbmcp OworICBpZiAoTklMUCAoTEdTVFJJTkdfSUQgKGxnc3RyaW5nKSkpCisgICAgeworICAgICAgLyog U2F2ZSBwb2ludCBhcyBtYXJrZXIgYmVmb3JlIGNhbGxpbmcgb3V0IHRvIGxpc3AuICAqLworICAg ICAgaWYgKE5JTFAgKHN0cmluZykpCisgICAgICAgIHJlY29yZF91bndpbmRfcHJvdGVjdCAocmVz dG9yZV9wb2ludF91bndpbmQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRf bWFya2VyIChjdXJyZW50X2J1ZmZlciwgcHQsIHB0X2J5dGUpKTsKKyAgICAgIGxnc3RyaW5nID0g c2FmZV9jYWxsICg2LCBWYXV0b19jb21wb3NpdGlvbl9mdW5jdGlvbiwgQVJFRiAocnVsZSwgMiks CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zLCBtYWtlX2ZpeG51bSAodG8pLCBmb250 X29iamVjdCwgc3RyaW5nKTsKKyAgICB9CisgIHJldHVybiB1bmJpbmRfdG8gKGNvdW50LCBsZ3N0 cmluZyk7Cit9CisKKy8qIENoZWNrIGlmIHRoZSBjaGFyYWN0ZXIgYXQgQ0hBUlBPUyAoYW5kIEJZ VEVQT1M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3MgKGNtcF9pdCwgY2hhcnBvcywgYnl0ZXBv cywgZW5kcG9zLCBzdHJpbmcpOworICAgICAgaWYgKGNtcF9pdC0+Y2ggPT0gLTIgfHwgY21wX2l0 LT5zdG9wX3BvcyAhPSBjaGFycG9zKQorICAgICAgICAvKiBUaGUgY3VycmVudCBwb3NpdGlvbiBp cyBub3QgY29tcG9zZWQuICAqLworICAgICAgICByZXR1cm4gMDsKKyAgICB9CisgIGlmIChlbmRw b3MgPCAwKQorICAgIGVuZHBvcyA9IE5JTFAgKHN0cmluZykgPyBCRUdWIDogMDsKKyAgaWYgKGNt cF9pdC0+Y2ggPCAwKQorICAgIHsKKyAgICAgIC8qIFdlIGFyZSBsb29raW5nIGF0IGEgc3RhdGlj IGNvbXBvc2l0aW9uLiAgKi8KKyAgICAgIHB0cmRpZmZfdCBzdGFydCwgZW5kOworICAgICAgTGlz cF9PYmplY3QgcHJvcDsKKyAgICAgIGZpbmRfY29tcG9zaXRpb24gKGNoYXJwb3MsIC0xLCAmc3Rh cnQsICZlbmQsICZwcm9wLCBzdHJpbmcpOworICAgICAgY21wX2l0LT5pZCA9IGdldF9jb21wb3Np dGlvbl9pZCAoY2hhcnBvcywgYnl0ZXBvcywgZW5kIC0gc3RhcnQsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBwcm9wLCBzdHJpbmcpOworICAgICAgaWYgKGNtcF9pdC0+ aWQgPCAwKQorICAgICAgICBnb3RvIG5vX2NvbXBvc2l0aW9uOworICAgICAgY21wX2l0LT5uY2hh cnMgPSBlbmQgLSBzdGFydDsKKyAgICAgIGNtcF9pdC0+bmdseXBocyA9IGNvbXBvc2l0aW9uX3Rh YmxlW2NtcF9pdC0+aWRdLT5nbHlwaF9sZW47CisgICAgfQorICBlbHNlIGlmICh3KQorICAgIHsK KyAgICAgIExpc3BfT2JqZWN0IGxnc3RyaW5nID0gUW5pbDsKKyAgICAgIExpc3BfT2JqZWN0IHZh bCwgZWx0OworICAgICAgcHRyZGlmZl90IGk7CisgICAgICB2YWwgPSBDSEFSX1RBQkxFX1JFRiAo VmNvbXBvc2l0aW9uX2Z1bmN0aW9uX3RhYmxlLCBjbXBfaXQtPmNoKTsKKyAgICAgIGZvciAoaSA9 IDA7IGkgPCBjbXBfaXQtPnJ1bGVfaWR4OyBpKyssIHZhbCA9IFhDRFIgKHZhbCkpOworICAgICAg aWYgKGNoYXJwb3MgPCBlbmRwb3MpCisgICAgICAgIHsKKyAgICAgICAgICBmb3IgKDsgQ09OU1Ag KHZhbCk7IHZhbCA9IFhDRFIgKHZhbCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGVs dCA9IFhDQVIgKHZhbCk7CisgICAgICAgICAgICAgIGlmICghIFZFQ1RPUlAgKGVsdCkgfHwgQVNJ WkUgKGVsdCkgIT0gMworICAgICAgICAgICAgICAgICAgfHwgISBJTlRFR0VSUCAoQVJFRiAoZWx0 LCAxKSkpCisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgIGlmIChYRklY TkFUIChBUkVGIChlbHQsIDEpKSAhPSBjbXBfaXQtPmxvb2tiYWNrKQorICAgICAgICAgICAgICAg IGdvdG8gbm9fY29tcG9zaXRpb247CisgICAgICAgICAgICAgIGxnc3RyaW5nID0gbWNfYXV0b2Nt cF9jaGFycyAoZWx0LCBjaGFycG9zLCBieXRlcG9zLCBlbmRwb3MsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgdywgZmFjZSwgc3RyaW5nKTsKKyAgICAgICAgICAgICAg aWYgKGNvbXBvc2l0aW9uX2dzdHJpbmdfcCAobGdzdHJpbmcpKQorICAgICAgICAgICAgICAgIGJy ZWFrOworICAgICAgICAgICAgICBsZ3N0cmluZyA9IFFuaWw7CisgICAgICAgICAgICAgIC8qIENv bXBvc2l0aW9uIGZhaWxlZCBwZXJoYXBzIGJlY2F1c2UgdGhlIGZvbnQgZG9lc24ndAorICAgICAg ICAgICAgICAgICBzdXBwb3J0IHN1ZmZpY2llbnQgcmFuZ2Ugb2YgY2hhcmFjdGVycy4gIFRyeSB0 aGUKKyAgICAgICAgICAgICAgICAgb3RoZXIgY29tcG9zaXRpb24gcnVsZXMgaWYgYW55LiAgKi8K KyAgICAgICAgICAgIH0KKyAgICAgICAgICBjbXBfaXQtPnJldmVyc2VkX3AgPSAwOworICAgICAg ICB9CisgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICBwdHJkaWZmX3QgY3BvcyA9IGNo YXJwb3MsIGJwb3MgPSBieXRlcG9zOworICAgICAgICAgIGNtcF9pdC0+cmV2ZXJzZWRfcCA9IDE7 CisgICAgICAgICAgZWx0ID0gWENBUiAodmFsKTsKKyAgICAgICAgICBpZiAoY21wX2l0LT5sb29r YmFjayA+IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGNwb3MgPSBjaGFycG9zIC0g Y21wX2l0LT5sb29rYmFjazsKKyAgICAgICAgICAgICAgaWYgKFNUUklOR1AgKHN0cmluZykpCisg ICAgICAgICAgICAgICAgYnBvcyA9IHN0cmluZ19jaGFyX3RvX2J5dGUgKHN0cmluZywgY3Bvcyk7 CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBicG9zID0gQ0hBUl9UT19CWVRF IChjcG9zKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBsZ3N0cmluZyA9IG1jX2F1dG9jbXBf Y2hhcnMgKGVsdCwgY3BvcywgYnBvcywgY2hhcnBvcyArIDEsIHcsIGZhY2UsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJpbmcpOworICAgICAgICAgIGlmICghIGNvbXBv c2l0aW9uX2dzdHJpbmdfcCAobGdzdHJpbmcpCisgICAgICAgICAgICAgIHx8IGNwb3MgKyBMR1NU UklOR19DSEFSX0xFTiAobGdzdHJpbmcpIC0gMSAhPSBjaGFycG9zKQorICAgICAgICAgICAgLyog Q29tcG9zaXRpb24gZmFpbGVkIG9yIGRpZG4ndCBjb3ZlciB0aGUgY3VycmVudAorICAgICAgICAg ICAgICAgY2hhcmFjdGVyLiAgKi8KKyAgICAgICAgICAgIGdvdG8gbm9fY29tcG9zaXRpb247Cisg ICAgICAgIH0KKyAgICAgIGlmIChOSUxQIChsZ3N0cmluZykpCisgICAgICAgIGdvdG8gbm9fY29t cG9zaXRpb247CisgICAgICBpZiAoTklMUCAoTEdTVFJJTkdfSUQgKGxnc3RyaW5nKSkpCisgICAg ICAgIGxnc3RyaW5nID0gY29tcG9zaXRpb25fZ3N0cmluZ19wdXRfY2FjaGUgKGxnc3RyaW5nLCAt MSk7CisgICAgICBjbXBfaXQtPmlkID0gWEZJWE5VTSAoTEdTVFJJTkdfSUQgKGxnc3RyaW5nKSk7 CisgICAgICBmb3IgKGkgPSAwOyBpIDwgTEdTVFJJTkdfR0xZUEhfTEVOIChsZ3N0cmluZyk7IGkr KykKKyAgICAgICAgaWYgKE5JTFAgKExHU1RSSU5HX0dMWVBIIChsZ3N0cmluZywgaSkpKQorICAg ICAgICAgIGJyZWFrOworICAgICAgY21wX2l0LT5uZ2x5cGhzID0gaTsKKyAgICAgIGNtcF9pdC0+ ZnJvbSA9IDA7CisgICAgICBjbXBfaXQtPnRvID0gaTsKKyAgICB9CisgIGVsc2UKKyAgICBnb3Rv IG5vX2NvbXBvc2l0aW9uOworICByZXR1cm4gMTsKKyBub19jb21wb3NpdGlvbjoKKyAgaWYgKGNo YXJwb3MgPT0gZW5kcG9zKQorICAgIHJldHVybiAwOworICBpZiAoY2hhcnBvcyA8IGVuZHBvcykK KyAgICB7CisgICAgICBjaGFycG9zKys7CisgICAgICBpZiAoTklMUCAoc3RyaW5nKSkKKyAgICAg ICAgSU5DX1BPUyAoYnl0ZXBvcyk7CisgICAgICBlbHNlCisgICAgICAgIGJ5dGVwb3MgKz0gQllU RVNfQllfQ0hBUl9IRUFEICgqKFNEQVRBIChzdHJpbmcpICsgYnl0ZXBvcykpOworICAgIH0KKyAg ZWxzZQorICAg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KKyAgIGNoYXJhY3RlciBvbiB3aGljaCB0aGUgY3Vyc29yIHdpbGwgYXBwZWFy LiAqLworICAgICAgaWYgKGNvbCA+PSBnb2FsKQorICAgICAgICBicmVhazsKKyAgICAgIHByZXZf Y29sID0gY29sOworICAgICAgeyAvKiBDaGVjayBkaXNwbGF5IHByb3BlcnR5LiAqLworICAgICAg ICBwdHJkaWZmX3QgZW5kcDsKKyAgICAgICAgaW50IHdpZHRoID0gbWNfY2hlY2tfZGlzcGxheV93 aWR0aCAoc2NhbiwgY29sLCAmZW5kcCk7CisgICAgICAgIGlmICh3aWR0aCA+PSAwKQorICAgICAg ICAgIHsKKyAgICAgICAgICAgIGNvbCArPSB3aWR0aDsKKyAgICAgICAgICAgIGlmIChlbmRwID4g c2NhbikgLyogQXZvaWQgaW5maW5pdGUgbG9vcHMgd2l0aCAwLXdpZHRoIG92ZXJsYXlzLiAqLwor ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc2NhbiA9IGVuZHA7CisgICAgICAgICAg ICAgICAgc2Nhbl9ieXRlID0gQ0hBUl9UT19CWVRFIChzY2FuKTsKKyAgICAgICAgICAgICAgICBj b250aW51ZTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIC8q IENoZWNrIGNvbXBvc2l0aW9uIHNlcXVlbmNlLiAqLworICAgICAgaWYgKGNtcF9pdC5pZCA+PSAw CisgICAgICAgICAgfHwgKHNjYW4gPT0gY21wX2l0LnN0b3BfcG9zCisgICAgICAgICAgICAgICYm IG1jX2NvbXBvc2l0aW9uX3Jlc2VhdF9pdCAoJmNtcF9pdCwgc2Nhbiwgc2Nhbl9ieXRlLCBlbmQs IHcsIE5VTEwsIFFuaWwpKSkKKyAgICAgICAgY29tcG9zaXRpb25fdXBkYXRlX2l0ICgmY21wX2l0 LCBzY2FuLCBzY2FuX2J5dGUsIFFuaWwpOworICAgICAgaWYgKGNtcF9pdC5pZCA+PSAwKQorICAg ICAgICB7CisgICAgICAgICAgc2NhbiArPSBjbXBfaXQubmNoYXJzOworICAgICAgICAgIHNjYW5f Ynl0ZSArPSBjbXBfaXQubmJ5dGVzOworICAgICAgICAgIGlmIChzY2FuIDw9IGVuZCkKKyAgICAg ICAgICAgIGNvbCArPSBjbXBfaXQud2lkdGg7CisgICAgICAgICAgaWYgKGNtcF9pdC50byA9PSBj bXBfaXQubmdseXBocykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY21wX2l0LmlkID0g LTE7CisgICAgICAgICAgICAgIGNvbXBvc2l0aW9uX2NvbXB1dGVfc3RvcF9wb3MgKCZjbXBfaXQs IHNjYW4sIHNjYW5fYnl0ZSwgZW5kLCBRbmlsKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgICAgY21wX2l0LmZyb20gPSBjbXBfaXQudG87CisgICAgICAgICAg Y29udGludWU7CisgICAgICAgIH0KKyAgICAgIGMgPSBGRVRDSF9CWVRFIChzY2FuX2J5dGUpOwor ICAgICAgLyogU2VlIGlmIHRoZXJlIGlzIGEgZGlzcGxheSB0YWJsZSBhbmQgaXQgcmVsYXRlcyB0 byB0aGlzIGNoYXJhY3Rlci4gKi8KKyAgICAgIGlmIChkcCAhPSAwCisgICAgICAgICAgJiYgISAo bXVsdGlieXRlICYmIExFQURJTkdfQ09ERV9QIChjKSkKKyAgICAgICAgICAmJiBWRUNUT1JQIChE SVNQX0NIQVJfVkVDVE9SIChkcCwgYykpKQorICAgICAgICB7CisgICAgICAgICAgTGlzcF9PYmpl Y3QgY2hhcnZlYzsKKyAgICAgICAgICBwdHJkaWZmX3QgaSwgbjsKKyAgICAgICAgICAvKiBUaGlz IGNoYXJhY3RlciBpcyBkaXNwbGF5ZWQgdXNpbmcgYSB2ZWN0b3Igb2YgZ2x5cGhzLgorICAgICAg ICAgICAgIFVwZGF0ZSB0aGUgY29sdW1uL3Bvc2l0aW9uIGJhc2VkIG9uIHRob3NlIGdseXBocy4g Ki8KKyAgICAgICAgICBjaGFydmVjID0gRElTUF9DSEFSX1ZFQ1RPUiAoZHAsIGMpOworICAgICAg ICAgIG4gPSBBU0laRSAoY2hhcnZlYyk7CisgICAgICAgICAgZm9yIChpID0gMDsgaSA8IG47IGkr KykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogVGhpcyBzaG91bGQgYmUgaGFuZGxl ZCB0aGUgc2FtZSBhcworICAgICAgICAgICAgICBuZXh0X2VsZW1lbnRfZnJvbV9kaXNwbGF5X3Zl Y3RvciBkb2VzIGl0LiAqLworICAgICAgICAgICAgICBMaXNwX09iamVjdCBlbnRyeSA9IEFSRUYg KGNoYXJ2ZWMsIGkpOworICAgICAgICAgICAgICBpZiAoR0xZUEhfQ09ERV9QIChlbnRyeSkpCisg ICAgICAgICAgICAgICAgYyA9IEdMWVBIX0NPREVfQ0hBUiAoZW50cnkpOworICAgICAgICAgICAg ICBlbHNlCisgICAgICAgICAgICAgICAgYyA9ICcgJzsKKyAgICAgICAgICAgICAgaWYgKGMgPT0g J1xuJykKKyAgICAgICAgICAgICAgICBnb3RvIGVuZGxvb3A7CisgICAgICAgICAgICAgIGlmIChj ID09ICdccicgJiYgRVEgKEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBzZWxlY3RpdmVfZGlzcGxheSks IFF0KSkKKyAgICAgICAgICAgICAgICBnb3RvIGVuZGxvb3A7CisgICAgICAgICAgICAgIGlmIChj ID09ICdcdCcpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgY29sICs9IHRh Yl93aWR0aDsKKyAgICAgICAgICAgICAgICAgIGNvbCA9IGNvbCAvIHRhYl93aWR0aCAqIHRhYl93 aWR0aDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAg ICAgICAgICAgKytjb2w7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZQor ICAgICAgICAgIHsKKyAgICAgICAgICAgIC8qIFRoZSBkaXNwbGF5IHRhYmxlIGRvZXNuJ3QgYWZm ZWN0IHRoaXMgY2hhcmFjdGVyOworICAgICAgICAgICAgICAgaXQgZGlzcGxheXMgYXMgaXRzZWxm LiAqLworICAgICAgICAgICAgaWYgKGMgPT0gJ1xuJykKKyAgICAgICAgICAgICAgZ290byBlbmRs b29wOworICAgICAgICAgICAgaWYgKGMgPT0gJ1xyJyAmJiBFUSAoQlZBUiAoY3VycmVudF9idWZm ZXIsIHNlbGVjdGl2ZV9kaXNwbGF5KSwgUXQpKQorICAgICAgICAgICAgICBnb3RvIGVuZGxvb3A7 CisgICAgICAgICAgICBpZiAoYyA9PSAnXHQnKQorICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgY29sICs9IHRhYl93aWR0aDsKKyAgICAgICAgICAgICAgICBjb2wgPSBjb2wgLyB0YWJf d2lkdGggKiB0YWJfd2lkdGg7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZSBp ZiAobXVsdGlieXRlICYmIExFQURJTkdfQ09ERV9QIChjKSkKKyAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgICAvKiBTdGFydCBvZiBtdWx0aS1ieXRlIGZvcm0uICovCisgICAgICAg ICAgICAgICAgICB1bnNpZ25lZCBjaGFyICpwdHI7CisgICAgICAgICAgICAgICAgICBpbnQgYnl0 ZXMsIHdpZHRoOworICAgICAgICAgICAgICAgICAgcHRyID0gQllURV9QT1NfQUREUiAoc2Nhbl9i eXRlKTsKKyAgICAgICAgICAgICAgICAgIE1DX01VTFRJQllURV9CWVRFU19XSURUSCAocHRyLCBk cCwgYnl0ZXMsIHdpZHRoKTsKKyAgICAgICAgICAgICAgICAgIC8qIFN1YnRyYWN0IG9uZSB0byBj b21wZW5zYXRlIGZvciB0aGUgaW5jcmVtZW50CisgICAgICAgICAgICAgICAgICB0aGF0IGlzIGdv aW5nIHRvIGhhcHBlbiBiZWxvdy4gKi8KKyAgICAgICAgICAgICAgICAgIHNjYW5fYnl0ZSArPSBi eXRlcyAtIDE7CisgICAgICAgICAgICAgICAgICBjb2wgKz0gd2lkdGg7CisgICAgICAgICAgICAg ICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYgKGN0bF9hcnJvdyAmJiAoYyA8IDA0MCB8fCBj ID09IDAxNzcpKQorICAgICAgICAgICAgICAgICAgY29sICs9IDI7CisgICAgICAgICAgICAgICAg ICBlbHNlIGlmIChjIDwgMDQwIHx8IGMgPj0gMDE3NykKKyAgICAgICAgICAgICAgICAgICAgY29s ICs9IDQ7CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICBj b2wrKzsKKyAgICAgICAgICB9CisgICAgICBzY2FuKys7CisgICAgICBzY2FuX2J5dGUrKzsKKyAg ICB9CisgZW5kbG9vcDoKKyAgbGFzdF9rbm93bl9jb2x1bW4gPSBjb2w7CisgIGxhc3Rfa25vd25f Y29sdW1uX3BvaW50ID0gcHQ7CisgIGxhc3Rfa25vd25fY29sdW1uX21vZGlmaWVkID0gTU9ESUZG OworICBpZiAoZ29hbGNvbCkKKyAgICAqZ29hbGNvbCA9IGNvbDsKKyAgaWYgKGVuZHBvcykKKyAg ICAqZW5kcG9zID0gc2NhbjsKKyAgaWYgKHByZXZjb2wpCisgICAgKnByZXZjb2wgPSBwcmV2X2Nv bDsKK30KKworcHRyZGlmZl90CittY19jdXJyZW50X2NvbHVtbiAoc3RydWN0IHdpbmRvdyAqdywg cHRyZGlmZl90IHB0KQoreworICAvKiBgYnVmX2NoYXJwb3NfdG9fYnl0ZXBvcyc6ICBlYXNzZXJ0 IChCVUZfQkVHIChiKSA8PSBjaGFycG9zICYmIGNoYXJwb3MgPD0gQlVGX1ogKGIpKTsgKi8KKyAg c3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKHctPmNvbnRlbnRzKTsKKyAgc3RydWN0IGJ1ZmZl ciAqb2xkX2J1ZmZlciA9IE5VTEw7CisgIGlmIChiICE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zdG9wID0gcHRyOworICAgIGVsc2UgaWYgKHB0IDw9IEdQ VCB8fCBCRUdWID4gR1BUKQorICAgICAgc3RvcCA9IEJFR1ZfQUREUjsKKyAgICAgIGVsc2UKKyAg ICAgICAgc3RvcCA9IEdBUF9FTkRfQUREUjsKKyAgY29sID0gMCwgdGFiX3NlZW4gPSAwLCBwb3N0 X3RhYiA9IDA7CisgIHdoaWxlICgxKQorICAgIHsKKyAgICAgIHB0cmRpZmZfdCBpLCBuOworICAg ICAgTGlzcF9PYmplY3QgY2hhcnZlYzsKKyAgICAgIGlmIChwdHIgPT0gc3RvcCkKKyAgICAgICAg eworICAgICAgICAgIC8qIFdlIHN0b3BwZWQgZWl0aGVyIGZvciB0aGUgYmVnaW5uaW5nIG9mIHRo ZSBidWZmZXIKKyAgICAgICAgICAgICBvciBmb3IgdGhlIGdhcC4gKi8KKyAgICAgICAgICBpZiAo cHRyID09IEJFR1ZfQUREUikKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIC8qIEl0IHdh cyB0aGUgZ2FwLiAgSnVtcCBiYWNrIG92ZXIgaXQuICovCisgICAgICAgICAgc3RvcCA9IEJFR1Zf QUREUjsKKyAgICAgICAgICBwdHIgPSBHUFRfQUREUjsKKyAgICAgICAgICAvKiBDaGVjayB3aGV0 aGVyIHRoYXQgYnJpbmdzIHVzIHRvIGJlZ2lubmluZyBvZiBidWZmZXIuICovCisgICAgICAgICAg aWYgKEJFR1YgPj0gR1BUKQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGMg PSAqLS1wdHI7CisgICAgICBpZiAoZHAgJiYgVkVDVE9SUCAoRElTUF9DSEFSX1ZFQ1RPUiAoZHAs IGMpKSkKKyAgICAgICAgeworICAgICAgICAgIGNoYXJ2ZWMgPSBESVNQX0NIQVJfVkVDVE9SIChk cCwgYyk7CisgICAgICAgICAgbiA9IEFTSVpFIChjaGFydmVjKTsKKyAgICAgICAgfQorICAgICAg ICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgY2hhcnZlYyA9IFFuaWw7CisgICAgICAg ICAgICBuID0gMTsKKyAgICAgICAgICB9CisgICAgICBmb3IgKGkgPSBuIC0gMTsgaSA+PSAwOyAt LWkpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoVkVDVE9SUCAoY2hhcnZlYykpCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIC8qIFRoaXMgc2hvdWxkIGJlIGhhbmRsZWQgdGhlIHNhbWUg YXMKKyAgICAgICAgICAgbmV4dF9lbGVtZW50X2Zyb21fZGlzcGxheV92ZWN0b3IgZG9lcyBpdC4g Ki8KKyAgICAgICAgICAgICAgTGlzcF9PYmplY3QgZW50cnkgPSBBUkVGIChjaGFydmVjLCBpKTsK KyAgICAgICAgICAgICAgaWYgKEdMWVBIX0NPREVfUCAoZW50cnkpKQorICAgICAgICAgICAgICAg IGMgPSBHTFlQSF9DT0RFX0NIQVIgKGVudHJ5KTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAg ICAgICAgICAgICAgICBjID0gJyAnOworICAgICAgICAgICAgfQorICAgICAgICAgIGlmIChjID49 IDA0MCAmJiBjIDwgMDE3NykKKyAgICAgICAgICAgIGNvbCsrOworICAgICAgICAgICAgZWxzZSBp ZiAoYyA9PSAnXG4nCisgICAgICAgICAgICAgICAgICAgICB8fCAoYyA9PSAnXHInCisgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgRVEgKEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBzZWxlY3RpdmVf ZGlzcGxheSksIFF0KSkpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwdHIrKzsK KyAgICAgICAgICAgICAgICBnb3RvIHN0YXJ0X29mX2xpbmVfZm91bmQ7CisgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgICAgZWxzZSBpZiAoYyA9PSAnXHQnKQorICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgIGlmICh0YWJfc2VlbikKKyAgICAgICAgICAgICAgICAgICAgY29s ID0gKChjb2wgKyB0YWJfd2lkdGgpIC8gdGFiX3dpZHRoKSAqIHRhYl93aWR0aDsKKyAgICAgICAg ICAgICAgICAgIHBvc3RfdGFiICs9IGNvbDsKKyAgICAgICAgICAgICAgICAgIGNvbCA9IDA7Cisg ICAgICAgICAgICAgICAgICB0YWJfc2VlbiA9IDE7CisgICAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgICAgIGVsc2UgaWYgKFZFQ1RPUlAgKGNoYXJ2ZWMpKQorICAgICAgICAgICAgICAgICAg LyogV2l0aCBhIGRpc3BsYXkgdGFibGUgZW50cnksIEMgaXMgZGlzcGxheWVkIGFzIGlzLCBhbmQK KyAgICAgICAgICAgICAgICAgICAgIG5vdCBkaXNwbGF5ZWQgYXMgXE5OTiBvciBhcyBeTi4gIElm IEMgaXMgYSBzaW5nbGUtYnl0ZQorICAgICAgICAgICAgICAgICAgICAgY2hhcmFjdGVyLCBpdCB0 YWtlcyBvbmUgY29sdW1uLiAgSWYgQyBpcyBtdWx0aS1ieXRlIGluCisgICAgICAgICAgICAgICAg ICAgICBhIHVuaWJ5dGUgYnVmZmVyLCBpdCdzIHRyYW5zbGF0ZWQgdG8gdW5pYnl0ZSwgc28gaXQK KyAgICAgICAgICAgICAgICAgICAgIGFsc28gdGFrZXMgb25lIGNvbHVtbi4gKi8KKyAgICAgICAg ICAgICAgICAgICsrY29sOworICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAg ICAgICBjb2wgKz0gKGN0bF9hcnJvdyAmJiBjIDwgMDIwMCkgPyAyIDogNDsKKyAgICAgICAgfQor ICAgIH0KKyBzdGFydF9vZl9saW5lX2ZvdW5kOgorICBpZiAodGFiX3NlZW4pCisgICAgeworICAg ICAgY29sID0gKChjb2wgKyB0YWJfd2lkdGgpIC8gdGFiX3dpZHRoKSAqIHRhYl93aWR0aDsKKyAg ICAgIGNvbCArPSBwb3N0X3RhYjsKKyAgICB9CisgIGx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B3aGVuIGBzZWxlY3Rp dmUtZGlzcGxheScgaXMgdC4KK1RleHQgdGhhdCBoYXMgYW4gaW52aXNpYmxlIHByb3BlcnR5IGlz IGNvbnNpZGVyZWQgYXMgaGF2aW5nIHdpZHRoIDAsIHVubGVzcworYGJ1ZmZlci1pbnZpc2liaWxp dHktc3BlYycgc3BlY2lmaWVzIHRoYXQgaXQgaXMgcmVwbGFjZWQgYnkgYW4gZWxsaXBzaXMuICAq LykKKyAgKExpc3BfT2JqZWN0IHdpbmRvdywgTGlzcF9PYmplY3QgcHQpCit7CisgIHN0cnVjdCB3 aW5kb3cgKncgPSBkZWNvZGVfbGl2ZV93aW5kb3cgKHdpbmRvdyk7CisgIExpc3BfT2JqZWN0IHRl bXA7CisgIFhTRVRGQVNUSU5UICh0ZW1wLCBtY19jdXJyZW50X2NvbHVtbiAodywgWEZJWE5VTSAo cHQpKSk7CisgIHJldHVybiB0ZW1wOworfQorCisvKiBVU0FHRTogIGZwcmludGYgKHN0ZGVyciwg IkZSQU1FICglcykiLCBtY19mcmFtZSAoZikpOyAqLworY2hhciAqCittY19mcmFtZSAoc3RydWN0 IGZyYW1lICpmKQoreworICBMaXNwX09iamVjdCBmcmFtZTsKKyAgWFNFVEZSQU1FIChmcmFtZSwg Zik7CisgIHJldHVybiBTU0RBVEEgKEZwcmluMV90b19zdHJpbmcgKGZyYW1lLCBRbmlsKSk7Cit9 CisKKy8qIFVTQUdFOiAgZnByaW50ZiAoc3RkZXJyLCAiV0lORE9XICglcykiLCBtY193aW5kb3cg KHcpKTsgKi8KK2NoYXIgKgorbWNfd2luZG93IChzdHJ1Y3Qgd2luZG93ICp3KQoreworICBMaXNw X09iamVjdCB3aW5kb3c7CisgIFhTRVRXSU5ET1cgKHdpbmRvdywgdyk7CisgIHJldHVybiBTU0RB VEEgKEZwcmluMV90b19zdHJpbmcgKHdpbmRvdywgUW5pbCkpOworfQorCisvKiBVU0FHRTogIGZw cmludGYgKHN0ZGVyciwgIkNIQVJBQ1RFUiAoJXMpIiwgbWNfY2hhcl90b19zdHJpbmcgKGdseXBo LT51LmNoKSk7ICovCitjaGFyICoKK21jX2NoYXJfdG9fc3RyaW5nIChpbnQgYXJnKQoreworICBM aXNwX09iamVjdCBjaGFyYWN0ZXIgPSAoMCA8PSBhcmcgJiYgYXJnIDw9IE1BWF9DSEFSKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBGY2hhcl90b19zdHJpbmcgKG1ha2VfZml4bnVtIChh cmcpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBRbmlsOworICBjaGFyICogcmVzdWx0 ID0gKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAgICAgICAgJiYgYXJnID09IDkpCisg ICAgICAgICAgICAgICAgICAgID8gIlxcdCIKKyAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChj aGFyYWN0ZXIpCisgICAgICAgICAgICAgICAgICAgICAmJiBhcmcgPT0gMTApCisgICAgICAgICAg ICAgICAgICAgID8gIlxcbiIKKyAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIp CisgICAgICAgICAgICAgICAgICAgICAmJiBhcmcgPT0gMzIpCisgICAgICAgICAgICAgICAgICAg ID8gIlxccyIKKyAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAg ICAgICAgICAgICAgICAmJiBhcmcgIT0gOQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnICE9 IDEwCisgICAgICAgICAgICAgICAgICAgICAmJiBhcmcgIT0gMzIpCisgICAgICAgICAgICAgICAg ICAgID8gU1NEQVRBIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAgICAgICA6ICJcXD8iOworICBy ZXR1cm4gcmVzdWx0OworfQorCitpbnQKK21jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKExpc3BfT2Jq ZWN0IGFyZykKK3sKKyAgY2hhciAqc3RyOworICBpZiAoWFRZUEUgKGFyZykgPT0gTGlzcF9TdHJp bmcpCisgICAgc3RyID0gU1NEQVRBIChhcmcpOworICAgIGVsc2UgaWYgKFhUWVBFIChhcmcpID09 IExpc3BfU3ltYm9sKQorICAgICAgc3RyID0gU1NEQVRBIChTWU1CT0xfTkFNRSAoYXJnKSk7Cisg ICAgICBlbHNlIHJldHVybiAtMTsKKyAgaWYgKCFzdHJjbXAgKHN0ciwgIm5vIikpCisgICAgcmV0 dXJuIE1DX05PX0NVUlNPUjsKKyAgaWYgKCFzdHJjbXAgKHN0ciwgIm1jLWxlZnQtZnJpbmdlLWJp dG1hcCIpKQorICAgIHJldHVybiBNQ19MRUZUX0ZSSU5HRV9CSVRNQVA7CisgIGlmICghc3RyY21w IChzdHIsICJtYy1yaWdodC1mcmluZ2UtYml0bWFwIikpCisgICAgcmV0dXJuIE1DX1JJR0hUX0ZS SU5HRV9CSVRNQVA7CisgIGlmICghc3RyY21wIChzdHIsICJib3giKSkKKyAgICByZXR1cm4gTUNf RklMTEVEX0JPWDsKKyAgaWYgKCFzdHJjbXAgKHN0ciwgImZyYW1lZCIpKQorICAgIHJldHVybiBN Q19GUkFNRURfQk9YOworICBpZiAoIXN0cmNtcCAoc3RyLCAiaG9sbG93IikpCisgICAgcmV0dXJu IE1DX0hPTExPV19CT1g7CisgIGlmICghc3RyY21wIChzdHIsICJiYXIiKSkKKyAgICByZXR1cm4g TUNfQkFSOworICBpZiAoIXN0cmNtcCAoc3RyLCAiaGJhciIpKQorICAgIHJldHVybiBNQ19IQkFS OworICByZXR1cm4gLTE7Cit9CisKKy8qIFVTQUdFOiAgZnByaW50ZiAoc3RkZXJyLCAiQ1VSU09S IFRZUEUgKCVzKSIsIG1jX2N1cnNvcl90eXBlX3RvX3N0cmluZyAoYXJnKSk7ICovCitjaGFyICoK K21jX2N1cnNvcl90eXBlX3RvX3N0cmluZyAoZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlw ZSkKK3sKKyAgc3dpdGNoIChjdXJzb3JfdHlwZSkKKyAgICB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TkRJ Q0FUT1IiOworICAgICAgZGVmYXVsdDoKKyAgICAgIHJldHVybiAiVU5LTk9XTiI7CisgICAgfQor fQorCisvKiBVU0FHRTogIGZwcmludGYgKHN0ZGVyciwgIkZST01fV0hFUkUgKCVzKSIsIG1jX2Ry YXdfcm93X3R5cGVfdG9fc3RyaW5nIChhcmcpKTsgKi8KK2NoYXIgKgorbWNfZHJhd19yb3dfdHlw ZV90b19zdHJpbmcgKGVudW0gbWNfZHJhd19yb3dfdHlwZSBmcm9tX3doZXJlKQoreworICBzd2l0 Y2ggKGZyb21fd2hlcmUpCisgICAgeworICAgICAgY2FzZSBOT1dIRVJFOiByZXR1cm4gIk5PV0hF UkUiOworICAgICAgY2FzZSBTQ1JJQkVfT05FOiByZXR1cm4gIlNDUklCRV9PTkUiOworICAgICAg Y2FzZSBTQ1JJQkVfVFdPOiByZXR1cm4gIlNDUklCRV9UV08iOworICAgICAgY2FzZSBTQ1JJQkVf VEhSRUU6IHJldHVybiAiU0NSSUJFX1RIUkVFIjsKKyAgICAgIGNhc2UgU0tJUFBFRDogcmV0dXJu ICJTS0lQUEVEIjsKKyAgICAgIGNhc2UgUE9TVF9DSEFOR0VEOiByZXR1cm4gIlBPU1RfQ0hBTkdF RCI7CisgICAgICBjYXNlIFVOQ0hBTkdFRDogcmV0dXJuICJVTkNIQU5HRUQiOworICAgICAgY2Fz ZSBTRVRfQ1VSU09SX09ORTogcmV0dXJuICJTRVRfQ1VSU09SX09ORSI7CisgICAgICBjYXNlIFNF VF9DVVJTT1JfVFdPOiByZXR1cm4gIlNFVF9DVVJTT1JfVFdPIjsKKyAgICAgIGRlZmF1bHQ6Cisg ICAgICByZXR1cm4gIlVOS05PV04iOworICAgIH0KK30KKworLyogVVNBR0U6ICBmcHJpbnRmIChz dGRlcnIsICJGUk9NX1dIRVJFICglcykiLCBtY19kcmF3X3Jvd190eXBlX3RvX3N0cmluZyAoYXJn KSk7ICovCitjaGFyICoKK21jX3JlZHJhd19yb3dfdHlwZ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8IG1h dHJpeC52cG9zX3VzZWQgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICBtY193aW5kb3cgKHcp LCB2cG9zX2FsbG9jYXRlZCwgdnBvc191c2VkKTsKKyAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUg Y2FjaGVfdHlwZSA9IE1DX0NBQ0hFOworICAgICAgIGNhY2hlX3R5cGUgPCBOT19DQUNIRTsKKyAg ICAgICArK2NhY2hlX3R5cGUpCisgICAgeworICAgICAgaW50IGN1cnNvcnNfdXNlZCA9IHctPm1j X21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVfdHlwZV07CisgICAgICBmcHJpbnRmIChzdGRlcnIs ICIgIG1hdHJpeC5jdXJzb3JzX3VzZWRbJXNdICglZClcbiIsCisgICAgICAgICAgICAgICAgICAg ICAgIG1jX2NhY2hlX3R5cGVfdG9fc3RyaW5nIChjYWNoZV90eXBlKSwgY3Vyc29yc191c2VkKTsK KyAgICB9CisgIGZvciAoaW50IHZudGggPSAwOworICAgICAgIHZudGggPCB3LT5tY19tYXRyaXgu dnBvc191c2VkOworICAgICAgICsrdm50aCkKKyAgICB7CisgICAgICBmb3IgKGVudW0gbWNfY2Fj aGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7CisgICAgICAgICAgIGNhY2hlX3R5cGUgPCBO T19DQUNIRTsKKyAgICAgICAgICAgKytjYWNoZV90eXBlKQorICAgICAgICB7CisgICAgICAgICAg aW50IGNhY2hlX2FsbG9jYXRlZCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX2FsbG9j YXRlZFtjYWNoZV90eXBlXTsKKyAgICAgICAgICBpbnQgY2FjaGVfdXNlZCA9IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV07CisgICAgICAgICAgZnByaW50ZiAo c3RkZXJyLCAiICAgIHZudGggKCVkKSB8IGNhY2hlX2FsbG9jYXRlZFslc10gKCVkKSB8IGNhY2hl X3VzZWRbJXNdICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB2bnRoLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgbWNfY2FjaGVfdHlwZV90b19zdHJpbmcgKGNhY2hlX3R5 cGUpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FjaGVfYWxsb2NhdGVkLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgbWNfY2FjaGVfdHlwZV90b19zdHJpbmcgKGNhY2hlX3R5cGUp LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FjaGVfdXNlZCk7CisgICAgICAgIH0KKyAg ICB9Cit9CisKK3ZvaWQKK21jX3NldF9sc2xfYmcgKHN0cnVjdCB3aW5kb3cgKncsIGVudW0gZmFj ZV9pZCBmYWNlX2lkLCBzdHJ1Y3QgbWNfUkdCICpsc2wpCit7CisgIHN0cnVjdCBmcmFtZSAqZiA9 IFhGUkFNRSAody0+ZnJhbWUpOworICBzdHJ1Y3QgZmFjZSAqZmFjZTsKKyAgaWYgKCFOSUxQIChW ZmFjZV9yZW1hcHBpbmdfYWxpc3QpCisgICAgICAmJiAoZmFjZV9pZCA9PSBERUZBVUxUX0ZBQ0Vf SUQgLyogUWRlZmF1bHQgKi8KKyAgICAgICAgICB8fCBmYWNlX2lkID09IE1PREVfTElORV9GQUNF X0lEIC8qIFFtb2RlX2xpbmUgKi8KKyAgICAgICAgICB8fCBmYWNlX2lkID09IE1PREVfTElORV9J TkFDVElWRV9GQUNFX0lEIC8qIFFtb2RlX2xpbmVfaW5hY3RpdmUgKi8KKyAgICAgICAgICB8fCBm YWNlX2lkID09IEhFQURFUl9MSU5FX0ZBQ0VfSUQgLyogUWhlYWRlcl9saW5lICovCisgICAgICAg ICAgfHwgZmFjZV9pZCA9PSBUT09MX0JBUl9GQUNFX0lEIC8qIFF0b29sX2JhciAqLworICAgICAg ICAgIHx8IGZhY2VfaWQgPT0gRlJJTkdFX0ZBQ0VfSUQgLyog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ZmFjZSAhPSBOVUxMKQorICAgICAgICAgICAgICAgICAgICAgID8gZmFjZS0+bGZhY2Vb TEZBQ0VfQkFDS0dST1VORF9JTkRFWF0KKyAgICAgICAgICAgICAgICAgICAgICA6IGJ1aWxkX3N0 cmluZyAoIk9yYW5nZVJlZCIpOworICBtY194d19jb2xvcl92YWx1ZXMgKHcsIGNvbG9yLCBsc2wp OworfQorCit2b2lkCittY19zZXRfZXNzZW50aWFscyAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0 IG1jX2Vzc2VudGlhbHMgKmVzc2VudGlhbHMpCit7CisgIGlmICghQlVGRkVSUCAody0+Y29udGVu dHMpKQorICAgIHJldHVybjsKKyAgaWYgKE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgbWNfY29uZikpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGNyb3NzaGFpcnMpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMp LCBmY192aXNpYmxlKSkpCisgICAgcmV0dXJuOworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUg KHctPmZyYW1lKTsKKyAgZXNzZW50aWFscy0+YWN0aXZlX3AgPSAodyA9PSBYV0lORE9XIChmLT5z ZWxlY3RlZF93aW5kb3cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGYgPT0gRlJBTUVf RElTUExBWV9JTkZPIChmKS0+aGlnaGxpZ2h0X2ZyYW1lKTsKKyAgc3RydWN0IGJ1ZmZlciAqYiA9 IFhCVUZGRVIgKHctPmNvbnRlbnRzKTsKKyAgc3RydWN0IGJ1ZmZlciAqb2xkX2J1ZmZlciA9IE5V TEw7CisgIHB0cmRpZmZfdCBvcG9pbnQgPSAodyA9PSBYV0lORE9XIChzZWxlY3RlZF93aW5kb3cp KQorICAgICAgICAgICAgICAgICAgICAgPyBQVAorICAgICAgICAgICAgICAgICAgICAgOiBYRklY TlVNIChGbWFya2VyX3Bvc2l0aW9uICh3LT5wb2ludG0pKTsKKyAgcHRyZGlmZl90IGN1cnJlbnRf Y29sID0gbWNfY3VycmVudF9jb2x1bW4gKHcsIG9wb2ludCk7CisgIGludCBmcmFtZV9jaGFyX3dp ZHRoID0gRlJBTUVfQ09MVU1OX1dJRFRIIChmKTsKKyAgYm9vbCBmaWxsX2NvbHVtbl9wID0gIU5J TFAgKEJWQVIgKGIsIGZpbGxfY29sdW1uKSk7CisgIGludCBmaWxsX2NvbCA9IFhGSVhOVU0gKEJW QVIgKGIsIGZpbGxfY29sdW1uKSk7CisgIGludCBoc2NsX3ggPSB3LT5oc2Nyb2xsICogZnJhbWVf Y2hhcl93aWR0aDsKKyAgaWYgKGIgIT0gY3VycmVudF9idWZmZXIpCisgICAgeworICAgICAgb2xk X2J1ZmZlciA9IGN1cnJlbnRfYnVmZmVyOworICAgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAoYik7 CisgICAgfQorICBlc3NlbnRpYWxzLT56diA9IFpWOworICBlc3NlbnRpYWxzLT56dl9ieXRlID0g WlZfQllURTsKKyAgZXNzZW50aWFscy0+ZmNfeCA9IChmaWxsX2NvbHVtbl9wCisgICAgICAgICAg ICAgICAgICAgICAgJiYgIU5JTFAgKFZkaXNwbGF5X2xpbmVfbnVtYmVycykpCisgICAgICAgICAg ICAgICAgICAgICAgID8gKGZpbGxfY29sICogZnJhbWVfY2hhcl93aWR0aCkgKyB3LT5tYy5sbnVt X3BpeGVsX3dpZHRoIC0gaHNjbF94CisgICAgICAgICAgICAgICAgICAgICA6IChmaWxsX2NvbHVt bl9wCisgICAgICAgICAgICAgICAgICAgICAgICAmJiBOSUxQIChWZGlzcGxheV9saW5lX251bWJl cnMpKQorICAgICAgICAgICAgICAgICAgICAgICA/IChmaWxsX2NvbCAqIGZyYW1lX2NoYXJfd2lk dGgpIC0gaHNjbF94CisgICAgICAgICAgICAgICAgICAgICA6IDA7CisgIGlmIChvbGRfYnVmZmV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KyAgICAgID8gbG9va3VwX25hbWVkX2ZhY2Ug KHcsIGYsIGludGVybiAoImZjLW9wb2ludC1wcmUtenYtZmFjZSIpLCB0cnVlKQorICAgIDogKCFl c3NlbnRpYWxzLT5hY3RpdmVfcAorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIGZjX2luYWN0aXZlX3dpbmRvd3MpKQorICAgICAgICYmICFOSUxQIChCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICYmICFOSUxQIChCVkFS IChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgJiYgdy0+Y3Vyc29yLnggIT0gZXNzZW50 aWFscy0+ZmNfeCkKKyAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoImZj LWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpCisgICAgOiAoZXNzZW50aWFscy0+YWN0aXZl X3AKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hh aXJzKSkKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAg ICAgICYmIHctPmN1cnNvci54ICE9IGVzc2VudGlhbHMtPmZjX3gpCisgICAgICA/IGxvb2t1cF9u YW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCJmYy1wcmUtenYtZmFjZSIpLCB0cnVlKQorICAgIDog bG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoImZjLXByZS16di1mYWNlIiksIHRydWUp OworICBzdHJ1Y3QgZmFjZSAqZmlsbF9jb2x1bW5fcHJlX3p2X2ZhY2UgPSBGQUNFX0ZST01fSUQg KGYsIGZpbGxfY29sdW1uX3ByZV96dl9mYWNlX2lkKTsKKyAgTGlzcF9PYmplY3QgZmlsbF9jb2x1 bW5fcHJlX3p2X2NvbG9yID0gZm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29sb3IgPSBldmVuX2ZhY2UtPmxmYWNlW0xG QUNFX0ZPUkVHUk9VTkRfSU5ERVhdOworICAgICAgc3RydWN0IG1jX1JHQiBldmVuX2ZvcmVncm91 bmQ7CisgICAgICBtY194d19jb2xvcl92YWx1ZXMgKHcsIGV2ZW5fY29sb3IsICZldmVuX2ZvcmVn cm91bmQpOworICAgICAgZW51bSBmYWNlX2lkIG9kZF9mYWNlX2lkID0KKyAgICAgICAgKCFlc3Nl bnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkpCisgICAgICAgID8gbG9va3VwX25hbWVkX2Zh Y2UgKHcsIGYsIGludGVybiAoIistb2RkLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpCisg ICAgICAgIDogbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb2RkLXByZS16di1m YWNlIiksIHRydWUpOworICAgICAgc3RydWN0IGZhY2UgKm9kZF9mYWNlID0gRkFDRV9GUk9NX0lE IChmLCBvZGRfZmFjZV9pZCk7CisgICAgICBMaXNwX09iamVjdCBvZGRfY29sb3IgPSBvZGRfZmFj ZS0+bGZhY2VbTEZBQ0VfRk9SRUdST1VORF9JTkRFWF07CisgICAgICBzdHJ1Y3QgbWNfUkdCIG9k ZF9mb3JlZ3JvdW5kOworICAgICAgbWNfeHdfY29sb3JfdmFsdWVzICh3LCBvZGRfY29sb3IsICZv ZGRfZm9yZWdyb3VuZCk7CisgICAgICBlbnVtIGZhY2VfaWQgYmV5b25kX2ZpbGxfZmFjZV9pZCA9 CisgICAgICAgICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgJiYgIU5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaW5hY3RpdmVfd2luZG93cykpKQorICAgICAgICA/ IGxvb2t1cF9uYW1lZF9mY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GRfZm9yZWdy b3VuZC5ibHVlOworICAgICAgICB9CisgICAgICAgIC8qIHllbGxvdyAqLworICAgICAgICBlbHNl IGlmICgoIWZpbGxfY29sdW1uX3AKKyAgICAgICAgICAgICAgICAgICYmIGN1cnJlbnRfY29sICUg MiA9PSAwCisgICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gPT0gUFJFX1pWKQorICAg ICAgICAgICAgICAgICB8fCAoZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAgICAgICAgICAgJiYg Y3VycmVudF9jb2wgJSAyID09IDAKKyAgICAgICAgICAgICAgICAgICAgICYmIGN1cnJlbnRfY29s IDw9IGZpbGxfY29sCisgICAgICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gPT0gUFJF X1pWKSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBsc2xfZmctPnJlZCA9IGV2ZW5fZm9yZWdy b3VuZC5yZWQ7CisgICAgICAgICAgICBsc2xfZmctPmdyZWVuID0gZXZlbl9mb3JlZ3JvdW5kLmdy ZWVuOworICAgICAgICAgICAgbHNsX2ZnLT5ibHVlID0gZXZlbl9mb3JlZ3JvdW5kLmJsdWU7Cisg ICAgICAgICAgfQorICAgICAgICAgIC8qIGdyZWVuICovCisgICAgICAgICAgZWxzZSBpZiAoZmls bF9jb2x1bW5fcAorICAgICAgICAgICAgICAgICAgICYmIGN1cnJlbnRfY29sID4gZmlsbF9jb2wK KyAgICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gPT0gUFJFX1pWKQorICAgICAgICAg ICAgeworICAgICAgICAgICAgICBsc2xfZmctPnJlZCA9IGJleW9uZF9maWxsX2ZvcmVncm91bmQu cmVkOworICAgICAgICAgICAgICBsc2xfZmctPmdyZWVuID0gYmV5b25kX2ZpbGxfZm9yZWdyb3Vu ZC5ncmVlbjsKKyAgICAgICAgICAgICAgbHNsX2ZnLT5ibHVlID0gYmV5b25kX2ZpbGxfZm9yZWdy b3VuZC5ibHVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAocm93X3Bvc2l0 aW9uID09IEFUX1pWKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbHNsX2ZnLT5y ZWQgPSBlc3NlbnRpYWxzLnNwX2ZnLnJlZDsKKyAgICAgICAgICAgICAgICBsc2xfZmctPmdyZWVu ID0gZXNzZW50aWFscy5zcF9mZy5ncmVlbjsKKyAgICAgICAgICAgICAgICBsc2xfZmctPmJsdWUg PSBlc3NlbnRpYWxzLnNwX2ZnLmJsdWU7CisgICAgICAgICAgICAgIH0KKyAgICAgIGJyZWFrOwor ICAgIH0KKyAgICBjYXNlIEhPUklaT05UQUxfUlVMRVI6CisgICAgeworICAgICAgaWYgKGdseXBo ICE9IE5VTEwKKyAgICAgICAgICAmJiBnbHlwaC0+dS5jaCA9PSA5NQorICAgICAgICAgICYmIGN1 cnNvcl90eXBlID09IE1DX0hCQVIpCisgICAgICAgIHsKKyAgICAgICAgICBsc2xfZmctPnJlZCA9 IGVzc2VudGlhbHMuc3BfZmcucmVkOworICAgICAgICAgIGxzbF9mZy0+Z3JlZW4gPSBlc3NlbnRp YWxzLnNwX2ZnLmdyZWVuOworICAgICAgICAgIGxzbF9mZy0+Ymx1ZSA9IGVzc2VudGlhbHMuc3Bf ZmcuYmx1ZTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAg ICAgbHNsX2ZnLT5yZWQgPSBlc3NlbnRpYWxzLmNoX2ZnW3Jvd19wb3NpdGlvbl0ucmVkOworICAg ICAgICAgICAgbHNsX2ZnLT5ncmVlbiA9IGVzc2VudGlhbHMuY2hfZmdbcm93X3Bvc2l0aW9uXS5n cmVlbjsKKyAgICAgICAgICAgIGxzbF9mZy0+Ymx1ZSA9IGVzc2VudGlhbHMuY2hfZmdbcm93X3Bv c2l0aW9uXS5ibHVlOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNl IFZF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ZQorICAgICAgeF9yZWFjaGVkID0geDsKKyAgLyogSWYgdGhl cmUgYXJlIGFueSBnbHlwaHMgd2l0aCBsYmVhcmluZyA8IDAgb3IgcmJlYXJpbmcgPiB3aWR0aCBp bgorICAgICB0aGUgcm93LCByZWRyYXcgc29tZSBnbHlwaHMgaW4gZnJvbnQgb3IgZm9sbG93aW5n IHRoZSBnbHlwaAorICAgICBzdHJpbmdzIGJ1aWx0IGFib3ZlLiAqLworICBpZiAoaGVhZCAmJiAh b3ZlcmxhcHMgJiYgcm93LT5jb250YWluc19vdmVybGFwcGluZ19nbHlwaHNfcCkKKyAgICB7Cisg ICAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpoLCAqdDsKKyAgICAgIE1vdXNlX0hMSW5mbyAqaGxp bmZvID0gTU9VU0VfSExfSU5GTyAoZik7CisgICAgICBpbnQgbW91c2VfYmVnX2NvbCBVTklOSVQs IG1vdXNlX2VuZF9jb2wgVU5JTklUOworICAgICAgYm9vbCBjaGVja19tb3VzZV9mYWNlID0gZmFs c2U7CisgICAgICBpbnQgZHVtbXlfeCA9IDA7CisgICAgICAvKiBJZiBtb3VzZSBoaWdobGlnaHRp bmcgaXMgb24sIHdlIG1heSBuZWVkIHRvIGRyYXcgYWRqYWNlbnQKKyAgIGdseXBocyB1c2luZyBt b3VzZS1mYWNlIGhpZ2hsaWdodGluZy4gKi8KKyAgICAgIGlmIChhcmVhID09IFRFWFRfQVJFQSAm JiByb3ctPm1vdXNlX2ZhY2VfcAorICAgICAgICAgICYmIGhsaW5mby0+bW91c2VfZmFjZV9iZWdf cm93ID49IDAKKyAgICAgICAgICAmJiBobGluZm8tPm1vdXNlX2ZhY2VfZW5kX3JvdyA+PSAwKQor ICAgICAgICB7CisgICAgICAgICAgcHRyZGlmZl90IHJvd192cG9zID0gTUFUUklYX1JPV19WUE9T IChyb3csIHctPmN1cnJlbnRfbWF0cml4KTsKKyAgICAgICAgICBpZiAocm93X3Zwb3MgPj0gaGxp bmZvLT5tb3VzZV9mYWNlX2JlZ19yb3cKKyAgICAgICAgICAgICAgJiYgcm93X3Zwb3MgPD0gaGxp bmZvLT5tb3VzZV9mYWNlX2VuZF9yb3cpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGNo ZWNrX21vdXNlX2ZhY2UgPSB0cnVlOworICAgICAgICAgICAgICBtb3VzZV9iZWdfY29sID0gKHJv d192cG9zID09IGhsaW5mby0+bW91c2VfZmFjZV9iZWdfcm93KQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBobGluZm8tPm1vdXNlX2ZhY2VfYmVnX2NvbAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAwOworICAgICAgICAgICAgICBtb3VzZV9lbmRfY29sID0gKHJvd192 cG9zID09IGhsaW5mby0+bW91c2VfZmFjZV9lbmRfcm93KQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBobGluZm8tPm1vdXNlX2ZhY2VfZW5kX2NvbAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiByb3ctPnVzZWRbVEVYVF9BUkVBXTsKKyAgICAgICAgICAgIH0KKyAgICAg ICAgfQorICAgICAgLyogQ29tcHV0ZSBvdmVyaGFuZ3MgZm9yIGFsbCBnbHlwaCBzdHJpbmdzLiAq LworICAgICAgaWYgKEZSQU1FX1JJRiAoZiktPmNvbXB1dGVfZ2x5cGhfc3RyaW5nX292ZXJoYW5n cykKKyAgICAgICAgZm9yIChzID0gaGVhZDsgczsgcyA9IHMtPm5leHQpCisgICAgICAgICAgRlJB TUVfUklGIChmKS0+Y29tcHV0ZV9nbHlwaF9zdHJpbmdfb3ZlcmhhbmdzIChzKTsKKyAgICAgIC8q IFByZXBlbmQgZ2x5cGggc3RyaW5ncyBmb3IgZ2x5cGhzIGluIGZyb250IG9mIHRoZSBmaXJzdCBn bHlwaAorICAgICAgc3RyaW5nIHRoYXQgYXJlIG92ZXJ3cml0dGVuIGJlY2F1c2Ugb2YgdGhlIGZp cnN0IG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GlmIChkZWJ1Z19wKQorICAgICAgICBmcHJp bnRmIChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6ICByZXR1cm4gKCVkKVxuIiwgMSk7CisgICAg ICByZXR1cm47CisgICAgfQorICAvKiBWUE9TID49IG1hdHJpeC0+bnJvd3MgbWVhbnMgdGhhdCB3 aW5kb3cgaGFzIGJlZW4gcmVzaXplZC4KKyAgICAgRG9uJ3QgYm90aGVyIHRvIGVyYXNlIHRoZSBj dXJzb3IuICovCisgIGlmICh2cG9zID49IG1hdHJpeC0+bnJvd3MpCisgICAgeworICAgICAgaWYg KGRlYnVnX3ApCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX2VyYXNlX2N1cnNvcjogIHJl dHVybiAoJWQpXG4iLCAyKTsKKyAgICAgIHJldHVybjsKKyAgICB9CisgIC8qIElmIHJvdyBjb250 YWluaW5nIGN1cnNvciBpcyBtYXJrZWQgaW52YWxpZCwgdGhlcmUgaXMgbm90aGluZyB3ZQorICAg ICBjYW4gZG8uICovCisgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgeworICAgICAgaWYgKGRl YnVnX3ApCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX2VyYXNlX2N1cnNvcjogIHJldHVy biAoJWQpXG4iLCAzKTsKKyAgICAgIHJldHVybjsKKyAgICB9CisgIC8qIElmIGxpbmUgc3BhY2lu ZyBpcyA+IDAsIG9sZCBjdXJzb3IgbWF5IG9ubHkgYmUgcGFydGlhbGx5IHZpc2libGUgaW4KKyAg ICAgd2luZG93IGFmdGVyIHNwbGl0LXdpbmRvdy4gIFNvIGFkanVzdCB2aXNpYmxlIGhlaWdodC4g Ki8KKyAgcm93LT52aXNpYmxlX2hlaWdodCA9IG1pbiAocm93LT52aXNpYmxlX2hlaWdodCwKKyAg ICAgICAgICAgIHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KSAtIHJvdy0+eSk7CisgIC8qIElmIHJv dyBpcyBjb21wbGV0ZWx5I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p bmRvdykKKyAgICAgICYmIGNvb3Jkc19pbl9tb3VzZV9mYWNlX3AgKHcsIGhwb3MsIHZwb3MpCisg ICAgICAvKiBEb24ndCByZWRyYXcgdGhlIGN1cnNvcidzIHNwb3QgaW4gbW91c2UgZmFjZSBpZiBp dCBpcyBhdCB0aGUKKyAgICAgIGVuZCBvZiBhIGxpbmUgKG9uIGEgbmV3bGluZSkuICBUaGUgY3Vy c29yIGFwcGVhcnMgdGhlcmUsIGJ1dAorICAgICAgbW91c2UgaGlnaGxpZ2h0aW5nIGRvZXMgbm90 LiAqLworICAgICAgJiYgcm93LT51c2VkW1RFWFRfQVJFQV0gPiBocG9zICYmIGhwb3MgPj0gMCkK KyAgICBtb3VzZV9mYWNlX2hlcmVfcCA9IHRydWU7CisgIC8qIE1heWJlIGNsZWFyIHRoZSBkaXNw bGF5IHVuZGVyIHRoZSBjdXJzb3IuICovCisgIGlmIChjdXJzb3JfdHlwZSA9PSBNQ19IT0xMT1df Qk9YCisgICAgICB8fCBjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YKQorICAgIHsKKyAgICAg IGludCB0ZW1wX3ggPSB4OworICAgICAgaW50IGhlYWRlcl9saW5lX2hlaWdodCA9IFdJTkRPV19I RUFERVJfTElORV9IRUlHSFQgKHcpOworICAgICAgY3Vyc29yX2dseXBoID0gbWNfZ2V0X2N1cnNv cl9nbHlwaCAodywgbWF0cml4LCByb3csIGhwb3MsIHZwb3MpOworICAgICAgaWYgKGN1cnNvcl9n bHlwaCA9PSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAg ICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6ICByZXR1cm4gKCVkKVxuIiwg Nyk7CisgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICBpbnQgdGVtcF93ZCA9IGN1 cnNvcl9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICBpZiAodGV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Y2ggKCVkKSB8IHggKCVkKSwgaHBvcyAoJWQpLCB2cG9zKCVkKSwgaGwgKCVkKVxuIiwK KyAgLy8gICAgICAgICAgICAgICAgICAgIGN1cnNvcl9nbHlwaC0+dS5jaCwgeCwgaHBvcywgdnBv cywgaGwpOworICBibG9ja19pbnB1dCAoKTsKKyAgYm9vbCBkcmF3X3AgPSB0cnVlOworICBtY19k cmF3X2dseXBocyAodywgbWF0cml4LCByb3csIHgsIFRFWFRfQVJFQSwgaHBvcywgaHBvcyArIDEs IGhsLCAwLAorICAgICAgICAgICAgICAgICAgdnBvcywgbHNsLCBnbHlwaF9mbGF2b3IsIGN1cnNv cl90eXBlLCB3ZCwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICBjdXJzb3JfZ2NfcCwgTUNf RVJBU0VfR0xZUEhfU1RSSU5HLCBkcmF3X3ApOworICB1bmJsb2NrX2lucHV0ICgpOworICAvKiBX aGVuIHdlIGVyYXNlIHRoZSBjdXJzb3IsIGFuZCBST1cgaXMgb3ZlcmxhcHBlZCBieSBvdGhlciBy b3dzLCBtYWtlCisgIHN1cmUgdGhhdCB0aGVzZSBvdmVybGFwcGluZyBwYXJ0cyBvZiBvdGhlciBy b3dzIGFyZSByZWRyYXduLiAqLworICBpZiAoaGwgPT0gRFJBV19OT1JNQUxfVEVYVCAmJiByb3ct Pm92ZXJsYXBwZWRfcCkKKyAgICB7CisgICAgICBpZiAocm93ID4gbWF0cml4LT5yb3dzCisgICAg ICAgICAgJiYgTUFUUklYX1JPV19PVkVSTEFQU19TVUNDX1AgKHJvdyAtIDEpKQorICAgICAgICBn dWlfZml4X292ZXJsYXBwaW5nX2FyZWEgKHcsIHJvdyAtIDEsIFRFWFRfQVJFQSwgT1ZFUkxBUFNf RVJBU0VEX0NVUlNPUik7CisgICAgICBpZiAoTUFUUklYX1JPV19CT1RUT01fWSAocm93KSA8IHdp bmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAgICAgICYmIE1BVFJJWF9ST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MteCA8IGFu ZCBkbyBub3RoaW5nLiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMF9wID0gKHctPnN1c3BlbmRf YXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xs X21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gdy0+aHNjcm9sbCk7Cisg IC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIHNvbWV0aGluZyBlbHNlIGJlc2lkZXMgaG9y aXpvbnRhbGx5IHNjcm9sbGluZyB0aGUKKyAgICAgICAgICAgICAgIGN1cnJlbnQgbGluZSBkaWZm ZXJlbnRseS4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFs bHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8xX3AgPSAo IXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg YXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhz Y3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwg PiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gdy0+ aHNjcm9sbCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIC4uLgorICAgICAgICAgICAg ICAgQ3VycmVudCBsaW5lIGlzIF9ub3RfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRs eS4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzJfcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3Jv bGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA9PSAwCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgIT0gdy0+aHNjcm9sbCk7CisgIC8qIEVYQU1Q TEU6ICAoc2Nyb2xsLWxlZnQgNSk7IGFuZCwgdGhlbiBwcmVzcyB0aGUgbGVmdCBhcnJvdyBrZXkg b25lIHRpbWUuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkg c2Nyb2xsZWQgZGlmZmVyZW50bHkuKi8KKyAgYm9vbCBoc2NsX3RlbXBfcCA9ICghdy0+c3VzcGVu ZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9k ZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMtdSBD LXggPCBhbmQgZG8gc29tZXRoaW5nIHRoYXQgY2F1c2VzIHRoZSBjdXJyZW50IGxpbmUgdG8gYmUK KyAgICAgICAgICAgICAgIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4KKyAgICAg ICAgICAgICAgIEN1cnJlbnQgbGluZSBfaXNfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJl bnRseS4gKi8KKyAgYm9vbCBoc2NsX3Blcm1fcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3JvbGwK KyAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9s bCAhPSB3LT5oc2Nyb2xsKTsKKyAgaW50IGZyaW5nZV9iaXRtYXAgPSBNQ19OT19GUklOR0VfQklU TUFQOworICBpbnQgZmFjZV9pZCA9IERFRkFVTFRfRkFDRV9JRDsKKyAgaWYgKCFyZW1vdmVfcAor ICAgICAgJiYgZ2x5cGhfZmxhdm9yID09IE1DX09WRVJMQVlfQVJST1dfQklUTUFQCisgICAgICAm JiAhaHNjbF9hbGxfdGVtcF9wCisgICAgICAmJiAhaHNjbF90ZW1wX3AKKyAgICAgICYmICFoc2Ns X3Blcm1fcAorICAgICAgJiYgIWhzY2xfYWxsX3Blcm1fMF9wCisgICAgICAmJiAhaHNjbF9hbGxf cGVybV8xX3AKKyAgICAgICYmICFoc2NsX2FsbF9wZXJtXzJfcCkKKyAgICB7CisgICAgICBlbnVt IGZhY2VfaWQgb3ZlcmxheV9hcnJvd19mYWNlX2lkID0KKyAgICAgICAgKCFhY3RpdmVfcAorICAg ICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaW5hY3RpdmVf d2luZG93cykpKQorICAgICAgICA/IGxvb2t1cF9kZXJpdmVkX2ZhY2UgKHcsIGYsIGludGVybiAo Iistb3ZlcmxheS1hcnJvdy1pbmFjdGl2ZS1wcmUtenYtZmFjZSIpLCBGUklOR0VfRkFDRV9JRCwg dHJ1ZSkKKyAgICAgICAgOiAoYWN0aXZlX3ApCisgICAgICAgICAgPyBsb29rdXBfZGVyaXZlZF9m YWNlICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ctcHJlLXp2LWZhY2UiKSwgRlJJTkdF X0ZBQ0VfSUQsIHRydWUpCisgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgZmFjZV9p ZCA9IChjdXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAg ICAgPyBvdmVybGF5X2Fycm93X2ZhY2VfaWQKKyAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFD RV9JRDsKKyAgICAgIGlmICh3LT5oc2Nyb2xsICE9IDApCisgICAgICAgIGZyaW5nZV9iaXRtYXAg PSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1vdmVybGF5LWFycm93IiksIGZh bHNlLCB0cnVlKTsKKyAgICAgICAgZWxzZQorICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19n ZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1vdmVybGF5LWFycm93IiksIHRydWUsIHRy dWUpOworICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0gTUNf TEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGZy aW5nZV9iaXRtYXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19OT19GUklO R0VfQklUTUFQOworICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gZmFjZV9pZDsKKyAg ICAgIHJvdy0+bGVmdF9mcmluZ2Vfb2Zmc2V0ID0gMDsKKyAgICAgIHJvdy0+ZnJpbmdlX2JpdG1h cF9wZXJpb2RpY19wID0gZmFsc2U7CisgICAgfQorICAgIGVsc2UgaWYgKCFyZW1vdmVfcAorICAg ICAgICAgICAgICYmIGdseXBoX2ZsYXZvciA9PSBNQ19PVkVSTEFZX0FSUk9XX0JJVE1BUAorICAg ICAgICAgICAgICYmIChoc2NsX2FsbF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF9h bGxfcGVybV8wX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8xX3AKKyAgICAg ICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8yX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNj bF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF9wZXJtX3ApKQorICAgICAgeworICAg ICAgICBlbnVtIGZhY2VfaWQgb3ZlcmxheV9hcnJvd19mYWNlX2lkID0KKyAgICAgICAgICAoIWFj dGl2ZV9wCisgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgICA/IGxvb2t1cF9kZXJpdmVkX2ZhY2Ug KHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1oc2NsLWluYWN0aXZlLXByZS16di1mYWNl IiksIEZSSU5HRV9GQUNFX0lELCB0cnVlKQorICAgICAgICAgIDogKGFjdGl2ZV9wKQorICAgICAg ICAgICAgPyBsb29rdXBfZGVyaXZlZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJy b3ctaHNjbC1wcmUtenYtZmFjZSIpLCBGUklOR0VfRkFDRV9JRCwgdHJ1ZSkKKyAgICAgICAgICA6 IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgZmFjZV9pZCA9IChjdXJzb3JfdHlwZSA9PSBNQ19M RUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICA/IG92ZXJsYXlfYXJyb3dfZmFj ZV9pZAorICAgICAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgIGlmICho c2NsX2FsbF9wZXJtXzBfcCkKKyAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5n ZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIGZhbHNlLCBmYWxzZSk7CisgICAg ICAgICAgZWxzZSBpZiAoaHNjbF9hbGxfcGVybV8xX3ApCisgICAgICAgICAgICBmcmluZ2VfYml0 bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIHRy dWUsIGZhbHNlKTsKKyAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xfYWxsX3Blcm1fMl9wKQorICAg ICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVy biAoIistaHNjbC1wZXJtIiksIGZhbHNlLCB0cnVlKTsKKyAgICAgICAgICAgICAgZWxzZSBpZiAo aHNjbF9wZXJtX3ApCisgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmlu Z2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCB0cnVlLCB0cnVlKTsKKyAgICAg ICAgICAgICAgICBlbHNlIGlmIChoc2NsX2FsbF90ZW1wX3ApCisgICAgICAgICAgICAgICAgICBm cmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC10 ZW1wIiksIGZhbHNlLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX3Rl bXBfcCkKKyAgICAgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2Vf Yml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtdGVtcCIpLCB0cnVlLCBmYWxzZSk7CisgICAgICAg IHJvdy0+bGVmdF9mcmluZ2VfYml0bWFwID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdF X0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGZyaW5nZV9iaXRt YXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRN QVA7CisgICAgICAgIHJvdy0+bGVmdF9mcmluZ2VfZmFjZV9pZCA9IGZhY2VfaWQ7CisgICAgICAg IHJvdy0+bGVmdF9mcmluZ2Vfb2Zmc2V0ID0gMDsKKyAgICAgICAgcm93LT5mcmluZ2VfYml0bWFw X3BlcmlvZGljX3AgPSBmYWxzZTsKKyAgICAgIH0KKyAgICAgIGVsc2UgaWYgKCFyZW1vdmVfcAor ICAgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFX1JJ R0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVS U0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICB8fCBn bHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRQorICAgICAgICAgICAgICAgICAgIHx8 IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAg ICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hU X0FSUk9XCisgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FM X0JBUgorICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9W RVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVS VElDQUxfQkFSX0JBQ0tTTEFTSCkpCisgICAgICAgIHsKKyAgICAgICAgICBMaXNwX09iamVjdCBi aXRtYXBfZmxhdm9yID0gKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFX1JJR0hU X0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xs b3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJ R0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1j X3JldmVyc2VkX2hvbGxvd19yZWN0YW5nbGVfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5H TEUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfaG9sbG93 X3JlY3RhbmdsZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlw aF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jhcl9yaWdodF9hcnJvdwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0g TUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX3ZlcnRpY2FsX2Jhcl9yaWdodF9h cnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2 b3IgPT0gTUNfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gUW1jX3ZlcnRpY2FsX2JhcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX3ZlcnRp Y2FsX2JhcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9m bGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSCkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXJfYmFja3NsYXNoCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogUW5pbDsKKyAgICAgICAgICBmcmluZ2Vf Yml0bWFwID0gKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVApCisgICAgICAg ICAgICAgICAgICAgICAgICAgID8gbG9va3VwX2ZyaW5nZV9iaXRtYXAgKGJpdG1hcF9mbGF2b3Ip CisgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAg ICAgICBmYWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAg ICAgICAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9X X1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBo X2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAg ICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxf QkFSKSkKKyAgICAgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9kZXJpdmVkX2ZhY2UgKHcsIGYs IGludGVybiAoIistcmV2ZXJzZWQtYmFyLXByZS16di1mYWNlIiksIEZSSU5HRV9GQUNFX0lELCB0 cnVlKQorICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklO R0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19S RVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAg ICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJS T1cKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VE X1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9kZXJpdmVkX2Zh Y2UgKHcsIGYsIGludGVybiAoIistYmFyLXByZS16di1mYWNlIiksIEZSSU5HRV9GQUNFX0lELCB0 cnVlKQorICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICBy b3ctPmN1cnNvcl9pbl9mcmluZ2VfcCA9IGZhbHNlOworICAgICAgICAgIHJvdy0+cmlnaHRfZnJp bmdlX2JpdG1hcCA9IGZyaW5nZV9iaXRtYXA7CisgICAgICAgICAgcm93LT5yaWdodF9mcmluZ2Vf ZmFjZV9pZCA9IGZhY2VfaWQ7CisgICAgICAgICAgcm93LT5yaWdodF9mcmluZ2Vfb2Zmc2V0ID0g MDsKKyAgICAgICAgICByb3ctPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcCA9IGZhbHNlOworICAg ICAgICB9CisgICAgICAgIGVsc2UgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSAorICAgICAg ICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEhMRVNTKQorICAgICAgICAgIHsK KyAgICAgICAgICAgIGJvb2wgb25fcCA9IHRydWU7CisgICAgICAgICAgICBGUkFNRV9SSUYgKGYp LT5tY19zY3JpYmVfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdnBvcywgd2QsIGgs IGxzbCwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBjdXJzb3Jfd2lkdGgsIGdseXBoX2ZsYXZvciwgb25fcCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2ZV9wKTsKKyAgICAgICAgICB9Cit9 CisKKy8qIER1bXAgY29udGVudHMgb2YgZ2x5cGggR0xZUEggdG8gc3RkZXJyLiAgUk9XIGFuZCBB UkVBIGFyZQorICAgdGhlIGdseXBoIHJvdyBhbmQgYXJlYSB3aGVyZSB0aGUgZ2x5cGggY29tZXMg ZnJvbS4gKi8KK3ZvaWQKK21jX2R1bXBfZ2x5cGggKHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgc3Ry dWN0IGdseXBoICpnbHlwaCwgaW50IGFyZWEsCisgICAgICAgICAgICAgICBpbnQgcmVsYXRpdmVf eCwgaW50IHZwb3MpCit7CisgIGJvb2wgZ2x5cGhfenZfcCA9IChnbHlwaCAtIHJvdy0+Z2x5cGhz W2FyZWFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICYmIE1B VFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgPT0gWlYpOworICBpZiAoZ2x5cGgtPnR5cGUgPT0g Q0hBUl9HTFlQSAorICAgICAgfHwgZ2x5cGgtPnR5cGUgPT0gR0xZUEhMRVNTX0dMWVBIKQorICAg IHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIiAlNSJwRCJkLyUtNWQgJTVkICVj ICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4xZCAgJTNkICVzICVzXG4iLAorICAg ICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2Vk W2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2 ZV94LAorICAgICAgICAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgPyAnQycK KyAgICAgICAgIDogJ0cnKSwKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZG RVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNUUklOR1Ag KGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgOiAoTklMUCAo Z2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAgICA6ICct JykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICBnbHlwaC0+dS5jaCwK KyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3As CisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+aHBvcywg Z2x5cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAoZ2x5 cGgtPnUuY2gpKTsKKyAgICB9CisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IFNUUkVUQ0hfR0xZ UEgpCisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBEImQvJS01 ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICAlM2QgJXMgJXNc biIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChy b3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAg IHJlbGF0aXZlX3gsCisgICAgICAgICdTJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAg ICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnQicKKyAgICAgICAg ICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAg ICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICA6 ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAwdSwKKyAgICAg ICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAg ICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+aHBvcywgZ2x5cGhf enZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAiXFxTIik7CisgICAgfQorICBlbHNlIGlmIChn bHlwaC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkKKyAgICB7CisgICAgICBmcHJpbnRmIChzdGRlcnIs CisgICAgICAgICIgJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNnggJTRk ICUxLjFkJTEuMWQgICUzZCAlcyAlY1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tU RVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVz ZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ0knLAorICAgICAg ICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAg ICAgICAgICA/ICdCJworICAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAg ICAgICAgICA/ICdTJworICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICAgICA/ICcwJworICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lk dGgsCisgICAgICAgICh1bnNpZ25lZCBpbnQpIGdseXBoLT51LmltZ19pZCwKKyAgICAgICAgZ2x5 cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGds eXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+aHBvcywgZ2x5cGhfenZfcCA/ ICJaViIgOiAiLS0iLAorICAgICAgICAnLicpOworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5 cGUgPT0gQ09NUE9TSVRFX0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAg ICAgICAgIiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCIsCisgICAg ICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRb YXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZl X3gsCisgICAgICAgICcrJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZG RVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnQicKKyAgICAgICAgICA6IChTVFJJ TkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICA6IChOSUxQ IChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICA6ICctJykpKSwK KyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAodW5zaWduZWQgaW50KSBnbHlw aC0+dS5jbXAuaWQpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICU0ZCAlMS4xZCUxLjFkIiwK KyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3As CisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wKTsKKyAgICAgIGlmIChnbHlwaC0+dS5j bXAuYXV0b21hdGljKQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIgICUzZCAlcyAuIFslZC0l ZF1cbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGgtPmhwb3MsIGdseXBoX3p2X3Ag PyAiWlYiIDogIi0tIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaC0+c2xpY2UuY21w LmZyb20sIGdseXBoLT5zbGljZS5jbXAudG8pOworICAgICAgICBlbHNlCisgICAgICAgIGZwcmlu dGYgKHN0ZGVyciwgIlxuIik7CisgICAgfQorICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBYV0lE R0VUX0dMWVBIKQorICAgIHsKKyNpZm5kZWYgSEFWRV9YV0lER0VUUworICAgICAgZWFzc3VtZSAo ZmFsc2UpOworI2Vsc2UKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIiAgJTVkLyUt NWQgJTVkICU0YyAlNmQgJWMgJTNkIDB4JTA1eCAlNGQgJTEuMWQlMS4xZCAgJTNkICVzICVjXG4i LAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93 LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICBy ZWxhdGl2ZV94LAorICAgICAgICAnWCcsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAg ICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgPyAnQicKKyAgICAgICAgIDog KFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgOiAn LScpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICBnbHlwaC0+ZmFjZV9p ZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0 X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT51Lnh3aWRnZXQsCisgICAgICAgIGdseXBoLT5o cG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7CisjZW5kaWYKKyAg ICB9Cit9CisKKy8qIER1bXAgdGhlIGNvbnRlbnRzIG9mIGdseXBoIHJvdyBhdCBWUE9TIGluIE1B VFJJWCB0byBzdGRlcnIuCisgICBHTFlQSFMgMCBtZWFucyBkb24ndCBzaG93IGdseXBoIGNvbnRl bnRzLgorICAgR0xZUEhTIDEgbWVhbnMgc2hvdyBnbHlwaHMgaW4gc2hvcnQgZm9ybQorICAgR0xZ UEhTID4gMSBtZWFucyBzaG93IGdseXBocyBpbiBsb25nIGZvcm0uICovCit2b2lkCittY19kdW1w X2dseXBoX3JvdyAoc3RydWN0IGdseXBoX3JvdyAqcm93LCBpbnQgdnBvcywgaW50IGdseXBocykK K3sKKyAgaW50IHJlbGF0aXZlX3ggPSAwOworICBpZiAoZ2x5cGhzICE9IDEpCisgICAgeworICAg ICAgZnByaW50ZiAoc3RkZXJyLCAiXG5EVU1QIEdMWVBIIFJPV1xuIik7CisgICAgICBmcHJpbnRm IChzdGRlcnIsICJSb3cgICAgIFN0YXJ0ICAgICAgIEVuZCBVc2VkIG9FPjxcXENUWkZlc20gICAg IFggICAgWSAgICBXICAgIEggICAgViAgICBBICAgIFBcbiIpOworICAgICAgZnByaW50ZiAoc3Rk ZXJyLCAiPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4iKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwg IiUzZCAlOSJwRCJkICU5InBEImQgJTRkICUxLjFkJTEuMWQlMS4xZCUxLjFkXAorJTEuMWQlMS4x ZCUxLjFkJTEuMWQlMS4xZCUxLjFkJTEuMWQlMS4xZCAgJTRkICU0ZCAlNGQgJTRkICU0ZCAlNGQg JTRkXG4iLAorICAgICAgICAgdnBvcywKKyAgICAgICAgIE1BVFJJWF9ST1dfU1RBUlRfQ0hBUlBP UyAocm93KSwKKyAgICAgICAgIE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdyksCisgICAgICAg ICByb3ctPnVzZWRbVEVYVF9BUkVBXSwKKyAgICAgICAgIHJvdy0+Y29udGFpbnNfb3ZlcmxhcHBp bmdfZ2x5cGhzX3AsCisgICAgICAgICByb3ctPmVuYWJsZWRfcCwKKyAgICAgICAgIHJvdy0+dHJ1 bmNhdGVkX29uX2xlZnRfcCwKKyAgICAgICAgIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3AsCisg ICAgICAgICByb3ctPmNvbnRpbnVlZF9wLAorICAgICAgICAgTUFUUklYX1JPV19DT05USU5VQVRJ T05fTElORV9QIChyb3cpLAorICAgICAgICAgTUFUUklYX1JPV19ESVNQTEFZU19URVhUX1AgKHJv dyksCisgICAgICAgICByb3ctPmVuZHNfYXRfenZfcCwKKyAgICAgICAgIHJvdy0+ZmlsbF9saW5l X3AsCisgICAgICAgICByb3ctPmVuZHNfaW5fbWlkZGxlX29mX2NoYXJfcCwKKyAgICAgICAgIHJv dy0+c3RhcnRzX2luX21pZGRsZV9vZl9jaGFyX3AsCisgICAgICAgICByb3ctPm1vdXNlX2ZhY2Vf cCwKKyAgICAgICAgIHJvdy0+eCwKKyAgICAgICAgIHJvdy0+eSwKKyAgICAgICAgIHJvdy0+cGl4 ZWxfd2lkdGgsCisgICAgICAgICByb3ctPmhlaWdodCwKKyAgICAgICAgIHJvdy0+dmlzaWJsZV9o ZWlnaHQsCisgICAgICAgICByb3ctPmFzY2VudCwKKyAgICAgICAgIHJvdy0+cGh5c19hc2NlbnQp OworICAgICAgLyogVGhlIG5leHQgMyBsaW5lcyBzaG91bGQgYWxpZ24gdG8gIlN0YXJ0IiBpbiB0 aGUgaGVhZGVyLiAqLworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICAgICU5InBEImQgJTkicEQi ZFx0JTVkXG4iLCByb3ctPnN0YXJ0Lm92ZXJsYXlfc3RyaW5nX2luZGV4LAorICAgICAgICAgcm93 LT5lbmQub3ZlcmxheV9zdHJpbmdfaW5kZXgsCisgICAgICAgICByb3ctPmNvbnRpbnVhdGlvbl9s aW5lc193aWR0aCk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgICAgJTkicEQiZCAlOSJwRCJk XG4iLAorICAgICAgICAgQ0hBUlBPUyAocm93LT5zdGFydC5zdHJpbmdfcG9zKSwKKyAgICAgICAg IENIQVJQT1MgKHJvdy0+ZW5kLnN0cmluZ19wb3MpKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwg IiAgICAlOWQgJTlkXG4iLCByb3ctPnN0YXJ0LmRwdmVjX2luZGV4LAorICAgICAgICAgcm93LT5l bmQuZHB2ZWNfaW5kZXgpOworICAgIH0KKyAgaWYgKGdseXBocyA+IDEpCisgICAgeworICAgICAg Zm9yIChpbnQgYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFyZWEgPCBMQVNUX0FSRUE7ICsrYXJl YSkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSByb3ctPmdseXBo c1thcmVhXTsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoX2VuZCA9IGdseXBoICsgcm93 LT51c2VkW2FyZWFdOworICAgICAgICAgIC8qIEdseXBoIGZvciBhIGxpbmUgZW5kIGluIHRleHQu ICovCisgICAgICAgICAgaWYgKGFyZWEgPT0gVEVYVF9BUkVBICYmIGdseXBoID09IGdseXBoX2Vu ZCAmJiBnbHlwaC0+Y2hhcnBvcyA+IDApCisgICAgICAgICAgICArK2dseXBoX2VuZDsKKyAgICAg ICAgICBpZiAoZ2x5cGggPCBnbHlwaF9lbmQpCisgICAgICAgICAgICBmcHJpbnRmIChzdGRlcnIs ICJHbHlwaCMvVG90YWwgUmVsLlggVCAgICAgICBQb3MgTyAgIFcgICAgIENvZGUgRmFjZSBMUiBI UE9TIFpWIENcbiIpOworICAgICAgICAgIGZvciAoOyBnbHlwaCA8IGdseXBoX2VuZDsgKytnbHlw aCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbWNfZHVtcF9nbHlwaCAocm93LCBnbHlw aCwgYXJlYSwgcmVsYXRpdmVfeCwgdnBvcyk7CisgICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0g Z2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAg IGVsc2UgaWYgKGdseXBocyA9PSAxKQorICAgICAgeworICAgICAgICBjaGFyIHNbU0hSVF9NQVgg KyA0XTsKKyAgICAgICAgZm9yIChpbnQgYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFyZWEgPCBM QVNUX0FSRUE7ICsrYXJlYSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpbnQgaTsKKyAgICAg ICAgICAgIGZvciAoaSA9IDA7IGkgPCByb3ctPnVzZWRbYXJlYV07ICsraSkKKyAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSByb3ctPmdseXBoc1th cmVhXSArIGk7CisgICAgICAgICAgICAgICAgaWYgKGkgPT0gcm93LT51c2VkW2FyZWFdIC0gMQor ICAgICAgICAgICAgICAgICAgICAmJiBhcmVhID09IFRFWFRfQVJFQQorICAgICAgICAgICAgICAg ICAgICAmJiBOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgICAgICAgICAmJiBnbHlw aC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT51LmNo ID09ICcgJykKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc3RyY3B5 ICgmc1tpXSwgIltcXG5dIik7CisgICAgICAgICAgICAgICAgICAgIGkgKz0gNDsKKyAgICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IENI QVJfR0xZUEgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT51LmNoIDwgMHg4 MAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGgtPnUuY2ggPj0gJyAnKQorICAg ICAgICAgICAgICAgICAgICBzW2ldID0gZ2x5cGgtPnUuY2g7CisgICAgICAgICAgICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICBzW2ldID0gJy4nOworICAgICAgICAgICAgICB9 CisgICAgICAgICAgICBzW2ldID0gJ1wwJzsKKyAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwg IiUzZDogKCVkKSAnJXMnXG4iLCB2cG9zLCByb3ctPmVuYWJsZWRfcCwgcyk7CisgICAgICAgICAg fQorICAgICAgfQorfQorCitERUZVTiAoIm1jLWR1bXAtZ2x5cGgtcm93IiwgRm1jX2R1bXBfZ2x5 cGhfcm93LCBTbWNfZHVtcF9nbHlwaF9yb3csIDEsIDIsICJQIiwKKyAgICAgICBkb2M6IC8qIER1 bXAgZ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lwZSBjYWNoZV90eXBl LAorICAgICAgICAgICAgICAgICAgICAgaW50IHZudGgsIGludCBudGgpCit7CisgIGlmICh2bnRo IDwgbWF0cml4LnZwb3NfdXNlZAorICAgICAgJiYgbWF0cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90 eXBlXSA+IDAKKyAgICAgICYmIG50aCA8IG1hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2Fj aGVfdHlwZV0pCisgICAgcmV0dXJuIHRydWU7CisgICAgZWxzZQorICAgICAgcmV0dXJuIGZhbHNl OworfQorCit2b2lkCittY19yZXNldF9jYWNoZSAoc3RydWN0IHdpbmRvdyAqdykKK3sKKyAgaWYg KCFCVUZGRVJQICh3LT5jb250ZW50cykpCisgICAgcmV0dXJuOworICBmb3IgKGVudW0gbWNfY2Fj aGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7CisgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NB Q0hFOworICAgICAgICsrY2FjaGVfdHlwZSkKKyAgICB7CisgICAgICBib29sIGJ2YXJfYWN0aXZl X3A7CisgICAgICBzd2l0Y2ggKGNhY2hlX3R5cGUpCisgICAgICAgIHsKKyAgICAgICAgICBjYXNl IE5PX0NBQ0hFOgorICAgICAgICAgICAgeworICAgICAgICAgICAgICByZXR1cm47CisgICAgICAg ICAgICB9CisgICAgICAgICAgY2FzZSBNQ19DQUNIRToKKyAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgJiYgTklM UCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkpCisgICAgICAgICAgICAg ICAgYnZhcl9hY3RpdmVfcCA9IGZhbHNlOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKEJVRkZF UlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkKKyAgICAgICAgICAgICAgICAgIGJ2 YXJfYWN0aXZlX3AgPSB0cnVlOworICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0K KyAgICAgICAgICBjYXNlIENIX0NBQ0hFOgorICAgICAgICAgICAgeworICAgICAgICAgICAgICBp ZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAmJiBOSUxQIChCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICAgICAgICAgICAgICBi dmFyX2FjdGl2ZV9wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoQlVGRkVSUCAo dy0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhC VUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgICAgICAgICAgICAgICAgYnZh cl9hY3RpdmVfcCA9IHRydWU7CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQor ICAgICAgICAgIGNhc2UgRkNfQ0FDSEU6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlm IChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICYmIE5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpKQorICAgICAgICAgICAgICAgIGJ2 YXJfYWN0aXZlX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBlbHNlIGlmIChCVUZGRVJQICh3 LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJV RkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpCisgICAgICAgICAgICAgICAgICBidmFy X2FjdGl2ZV9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9Cisg ICAgICAgIH0KKyAgICAgIGlmICghYnZhcl9hY3RpdmVfcCkKKyAgICAgICAgeworICAgICAgICAg IC8qIERlY3JlYXNlIHRoZSBzaXplIG9mIHRoZSBhcnJheSB0byBhIGJhcmUgbWluaW11bS4gKi8K KyAgICAgICAgICBmb3IgKGludCB2bnRoID0gMDsgdm50aCA8IHctPm1jX21hdHJpeC52cG9zX3Vz ZWQ7ICsrdm50aCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlX2FsbG9jYXRlZFtjYWNoZV90eXBlXSA+IDEpCisgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV0gPQorICAgICAgICAgICAgICAgICAgICB4bnJlYWxsb2MgKHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdLCAxLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHNpemVvZiAqdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV0pOworICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfYWxs b2NhdGVkW2NhY2hlX3R5cGVdID0gMTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAg IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV0gPSAwOworICAg ICAgICAgICAgfQorICAgICAgICAgIHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVfdHlw ZV0gPSAwOworICAgICAgICB9CisgICAgICAgIC8vICBBbHRob3VnaCBpdCB3b3VsZCBub3QgYmUg dmVyeSBlZmZpY2llbnQsIGl0IGlzIHBvc3NpYmxlIHRvIHNldAorICA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QorICAgIH0KK30KKworc3RhdGljIHZvaWQKK21jX2hlbHBlciAoc3RydWN0 IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93 ICpyb3csCisgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGgsIGludCB4LCBpbnQgZngsIGlu dCB5LCBpbnQgZnksIGludCBocG9zLCBpbnQgdnBvcywKKyAgICAgICAgICAgaW50IHdkLCBpbnQg aCwgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSwgaW50IGN1cnNvcl93aWR0aCwKKyAg ICAgICAgICAgZW51bSBtY19yb3dfcG9zaXRpb24gcm93X3Bvc2l0aW9uLCBzdHJ1Y3QgbWNfUkdC IGZvcmVncm91bmQsCisgICAgICAgICAgIHN0cnVjdCBtY19SR0IgYmFja2dyb3VuZCwgYm9vbCBh Y3RpdmVfcCwgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yLAorICAgICAgICAgICBib29sIGRy YXdfcCwgZW51bSBtY19kcmF3X3Jvd190eXBlIGZyb21fd2hlcmUsCisgICAgICAgICAgIGVudW0g bWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlLCBlbnVtIG1jX2VuZ2luZV90eXBlIGFjdGlvbl90eXBl KQoreworICBpbnQgdm50aCA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICBpZiAo bWNfc3RkZXJyX3AKKyAgICAgICYmIGRyYXdfcCkKKyAgICB7CisgICAgICBpbnQgY2hhcnBvcyA9 IGdseXBoLT5jaGFycG9zOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiXG5tY19oZWxwZXIgKCVz KTogIGZyb21fd2hlcmUgKCVzKVxuXAorICBhY3Rpb25fdHlwZSAoJXMpIHwgZmxhdm9yICglcykg fCBjaGFycG9zICglZClcblwKKyAgY2hhciAoJXMpIHwgeCAoJWQpIHwgZnggKCVkKSB8IHkgKC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KQorICAgIHsKKyAgICAgIGJvb2wgc2FtZV9wID0gZmFsc2U7Cisg ICAgICBmb3IgKGludCBudGggPSAwOyBudGggPCB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZV91c2VkW2NhY2hlX3R5cGVdOyArK250aCkKKyAgICAgICAgeworICAgICAgICAgIHNhbWVfcCB8 PQorICAgICAgICAgICAgKHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF0uc2FtZV9wID09IHRydWUKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLnR5cGUgPT0gZ2x5cGgtPnR5cGUKKyAg ICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLmdseXBoLmJ5dGVwb3MgPT0gZ2x5cGgtPmJ5dGVwb3MKKyAgICAgICAgICAgICAmJiB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLmNoYXJwb3Mg PT0gZ2x5cGgtPmNoYXJwb3MKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLnUudmFsID09IGdseXBoLT51LnZhbAorICAg ICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF0uZ2x5cGguZmFjZV9pZCA9PSBnbHlwaC0+ZmFjZV9pZAorICAgICAgICAgICAgICYmIHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGgucGFkZGluZ19w ID09IGdseXBoLT5wYWRkaW5nX3AKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2 b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AorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGguc2xpY2UuY21wLmZyb20gPT0g Z2x5cGgtPnNsaWNlLmNtcC5mcm9tCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS54ID09IHgKKyAgICAgICAgICAgICAmJiB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZ4ID09IGZ4CisgICAg ICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XS55ID09IHkKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhdLmZ5ID09IGZ5CisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5ocG9zID09IGhwb3MKKyAgICAgICAgICAg ICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLnZwb3Mg PT0gdnBvcworICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF0ud2QgPT0gd2QKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmggPT0gaAorICAgICAgICAgICAgICYmIHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uY3Vyc29yX3R5cGUg PT0gY3Vyc29yX3R5cGUKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZ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Y2FjaGVfdHlwZV1bbnRoXS5yb3dfcG9zaXRpb24gPT0g cm93X3Bvc2l0aW9uCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFibGVkX3AgPT0gdHJ1ZSk7CisgICAgICAgIH0KKyAgICAg IC8qIEluIGEgc2l0dWF0aW9uIHdoZXJlIHRoZXJlIGFyZSBubyBjaGFuZ2VzIChlLmcuLCBDLWcp LCB3ZSBzdGlsbCBuZWVkIHRvCisgICAgICByZXNldCB0aGUgbGVmdC9yaWdodCBmcmluZ2UgYml0 bWFwIGluZGljYXRvcnMuICovCisgICAgICBpZiAoIXNhbWVfcAorICAgICAgICAgIHx8IGN1cnNv cl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUAorICAgICAgICAgIHx8IGN1cnNvcl90eXBl ID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlk ICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwgY3Vyc29y X3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIGZvcmVn cm91bmQsIGFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIHJlbW92ZV9wKTsKKyAgICAgIHJldHVybjsK KyAgICB9CisgICAgZWxzZSBpZiAoZHJhd19wCisgICAgICAgICAgICAgJiYgKGZyb21fd2hlcmUg PT0gU0NSSUJFX09ORQorICAgICAgICAgICAgICAgICB8fCBmcm9tX3doZXJlID09IFNDUklCRV9U V08KKyAgICAgICAgICAgICAgICAgfHwgZnJvbV93aGVyZSA9PSBTQ1JJQkVfVEhSRUUKKyAgICAg ICAgICAgICAgICAgfHwgZnJvbV93aGVyZSA9PSBOT1dIRVJFKSkKKyAgICAgIHsKKyAgICAgICAg bWNfZHJhd19lcmFzZV9oeWJyaWQgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3Ms IHZwb3MsIHdkLCBoLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYWN0aXZlX3AsIGdseXBoX2ZsYXZvciwgcmVtb3Zl X3ApOworICAgICAgICByZXR1cm47CisgICAgICB9CisgIGlmIChjYWNoZV90eXBlID09IE5PX0NB Q0hFKQorICAgIHJldHVybjsKKyAgKyt3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5 cGVdOworICBpZiAodm50aCA+PSB3LT5tY19tYXRyaXgudnBvc191c2VkKQorICAgIHctPm1jX21h dHJpeC52cG9zX3VzZWQgPSB2bnRoICsgMTsKKyAgaWYgKHctPm1jX21hdHJpeC52cG9zX2FsbG9j YXRlZCA8IHctPm1jX21hdHJpeC52cG9zX3VzZWQpCisgICAgeworICAgICAgaW50IG9sZF9hbGxv YyA9IHctPm1jX21hdHJpeC52cG9zX2FsbG9jYXRlZDsKKyAgICAgIGludCBuZXdfZWx0cyA9IHct Pm1jX21hdHJpeC52cG9zX3VzZWQgLSB3LT5tY19tYXRyaXgudnBvc19hbGxvY2F0ZWQ7CisgICAg ICB3LT5tY19tYXRyaXgudnBvcyA9IHhwYWxsb2MgKHctPm1jX21hdHJpeC52cG9zLCAmdy0+bWNf bWF0cml4LnZwb3NfYWxsb2NhdGVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBuZXdfZWx0cywgSU5UX01BWCwgc2l6ZW9mICp3LT5tY19tYXRyaXgudnBvcyk7CisgICAgICBt ZW1zZXQgKHctPm1jX21hdHJpeC52cG9zICsgb2xkX2FsbG9jLCAwLAorICAgICAgICAgICAgICAg KHctPm1jX21hdHJpeC52cG9zX2FsbG9jYXRlZCAtIG9sZF9hbGxvYykgKiBzaXplb2YgKnctPm1j X21hdHJpeC52cG9zKTsKKyAgICB9CisgICsrdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVf dXNlZFtjYWNoZV90eXBlXTsKKyAgaWYgKHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX2Fs bG9jYXRlZFtjYWNoZV90eXBlXSA8IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRb Y2FjaGVfdHlwZV0pCisgICAgeworICAgICAgaW50IG9sZF9hbGxvYyA9IHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlX2FsbG9jYXRlZFtjYWNoZV90eXBlXTsKKyAgICAgIGludCBuZXdfZWx0 cyA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV0gLSB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV07CisgICAgICB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXSA9IHhwYWxsb2MgKHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVkW2NhY2hlX3R5cGVdLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfZWx0cywKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSU5U X01BWCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgc2l6ZW9mICp3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XSk7C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cyBhcmUgUk9XLT5WSVNJQkxFX0hFSUdIVC4KKyAgICAgICBGSVhNRTogIEFkZCBjb25kaXRpb25z IGZvciB1c2VyLXNwZWNpZmllZCB0aGlja25lc3Mgb2YgTUNfQkFSIGFuZAorICAgICAgICAgICAg ICAgTUNfSEJBUiBhcyB0byBgbWMtcmVhbC1mYWtlLWN1cnNvcicuCisgICBNVUxUSVBMRV9DVVJT T1JTOiAgV2UgZG8gbm90IHVzZSB0aGlzIGZ1bmN0aW9uLgorICAgSE9SSVpPTlRBTF9SVUxFUjog IFdlIHdhbnQgYSB1bml2ZXJzYWwgRlkgY29vcmRpbmF0ZSBmb3IgYSBsZXZlbCBydWxlci4KKyAg IFZFUlRJQ0FMX1JVTEVSIGFuZCBGSUxMX0NPTFVNTjogIFdlIHdhbnQgYW4gSCB0aGF0IGVuc3Vy ZXMgbm8gZ2FwIGJldHdlZW4gdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBwcmV2aW91cy9uZXh0IGxpbmUuICBUaGUgRlggY29vcmRpbmF0ZSBpcyBzZXQKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V3aGVyZTogIGB3LT5jdXJzb3IueGAgLyBg bWMuZmNfeGAuICovCit2b2lkCittY19nZXRfY3Vyc29yX2dlb21ldHJ5IChzdHJ1Y3Qgd2luZG93 ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAg ICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCB4LCBpbnQgKmZ4LCBpbnQgeSwKKyAgICAgICAg ICAgICAgICAgICAgICAgIGludCAqZnksIGludCBocG9zLCBpbnQgdnBvcywgaW50ICpoLAorICAg ICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSwgaW50 IGN1cnNvcl93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCAqd2QpCit7CisgIHN0 cnVjdCBnbHlwaCAqZ2x5cGggPSBtY19nZXRfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywg aHBvcywgdnBvcyk7CisgIGlmIChnbHlwaCA9PSBOVUxMKQorICAgIHJldHVybjsKKyAgc3RydWN0 IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAgKmZ4ID0gV0lORE9XX1RF WFRfVE9fRlJBTUVfUElYRUxfWCAodywgeCk7CisgICpoID0gcm93LT52aXNpYmxlX2hlaWdodDsK KyAgLyogRG9uJ3QgbGV0IHRoZSBjdXJzb3IgZXhjZWVkIHRoZSBkaW1lbnNpb25zIG9mIHRoZSBy b3csIHNvIHRoYXQKKyAgdGhlIHVwcGVyL2xvd2VyIHNpZGUgb2YgdGhlIGJveCBhcmVuJ3QgY2xp cHBlZC4gICovCisgIGludCB3X2hlYWRlcl9saW5lX2hlaWdodCA9IFdJTkRPV19IRUFERVJfTElO RV9IRUlHSFQgKHcpOworICBpbnQgd190ZXh0X2JvdHRvbV95ID0gd2luZG93X3RleHRfYm90dG9t X3kgKHcpIC0gKmg7CisgIGlmICh5IDwgd19oZWFkZXJfbGluZV9oZWlnaHQpCisgICAgeworICAg ICAgKmggPSBtYXggKCpoIC0gKHdfaGVhZGVyX2xpbmVfaGVpZ2h0IC0geSkgKyAxLCAqaCk7Cisg ICAgICB5ID0gd19oZWFkZXJfbGluZV9oZWlnaHQgLSAxOworICAgICAgLy8gZnByaW50ZiAoc3Rk ZXJyLCAiQ09ORElUSU9OICMgMVxuIik7CisgICAgfQorICAgZWxzZSBpZiAoeSA+IHdfdGV4dF9i b3R0b21feSkKKyAgICAgeworICAgICAgICpoICs9IHkgLSB3X3RleHRfYm90dG9tX3k7CisgICAg ICAgeSA9IHdfdGV4dF9ib3R0b21feTsKKyAgICAgICAvLyBmcHJpbnRmIChzdGRlcnIsICJDT05E SVRJT04gIyAyXG4iKTsKKyAgICAgfQorICAqZnkgPSBXSU5ET1dfVE9fRlJBTUVfUElYRUxfWSAo dywgeSk7CisgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgeworICAgICAgY2FzZSBNQ19CQVI6 CisgICAgICAgIHsKKyAgICAgICAgICBpZiAoY3Vyc29yX3dpZHRoIDwgMSkKKyAgICAgICAgICAg IGN1cnNvcl93aWR0aCA9IG1heCAoRlJBTUVfQ1VSU09SX1dJRFRIIChmKSwgMSk7CisgICAgICAg ICAgaWYgKGN1cnNvcl93aWR0aCA8IGdseXBoLT5waXhlbF93aWR0aCkKKyAgICAgICAgICAqd2Qg PSBjdXJzb3Jfd2lkdGg7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGNhc2Ug TUNfSEJBUjoKKyAgICAgICAgeworICAgICAgICAgIGludCBjdXJzb3JfaGVpZ2h0ID0gKGN1cnNv cl93aWR0aCA8IDEpID8gbHJpbnQgKDAuMjUgKiAqaCkgOiBjdXJzb3Jfd2lkdGg7CisgICAgICAg ICAgaWYgKGN1cnNvcl9oZWlnaHQgPiByb3ctPmhlaWdodCkKKyAgICAgICAgICAgIGN1cnNvcl9o ZWlnaHQgPSByb3ctPmhlaWdodDsKKyAgICAgICAgICAvKiBDdXJzb3Igc21hbGxlciB0aGFuIGxp bmUgaGVpZ2h0LCBzbyBtb3ZlIGRvd24uICovCisgICAgICAgICAgaWYgKCpoID4gY3Vyc29yX2hl aWdodCkKKyAgICAgICAgICAgICpmeSArPSAqaCAtIGN1cnNvcl9oZWlnaHQ7CisgICAgICAgICAg KmggPSBjdXJzb3JfaGVpZ2h0OworICAgICAgICAgICp3ZCA9IGdseXBoLT5waXhlbF93aWR0aDsK KyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgY2FzZSBNQ19SSUdIVF9GUklOR0Vf QklUTUFQOgorICAgICAgY2FzZSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVA6CisgICAgICBjYXNlIE1D X05PX0ZSSU5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X SU5ET1dfVEVYVF9UT19GUkFNRV9QSVhFTF9YICh3LCBlc3NlbnRpYWxzLmZjX3gpOworICBib29s IGdseXBoX3p2X3AgPSAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNl ZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICYmIE1BVFJJWF9ST1dfRU5EX0NIQVJQ T1MgKHJvdykgPT0gWlYpOworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsK KyAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKHctPmNvbnRlbnRzKTsKKyAgaW50IHRleHRf YXJlYV93aWR0aCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgIHN0cnVjdCBn bHlwaF9yb3cgKmN1cnNvcl9yb3cgPSAody0+Y3Vyc29yLnZwb3MgIT0gLTEpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IE1BVFJJWF9ST1cgKGN1cnNvcl9tYXRyaXgsIHctPmN1 cnNvci52cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOVUxMOworICBz dHJ1Y3QgZ2x5cGggKmN1cnNvcl9nbHlwaCA9ICh3LT5jdXJzb3IudnBvcyAhPSAtMSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIGN1cnNv cl9tYXRyaXgsIGN1cnNvcl9yb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOVUxMOworICBib29sIGN1cnNvcl9hdF9mcmlu Z2VfcCA9IChjdXJzb3JfZ2x5cGggPT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBjdXJzb3Jfcm93ICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg dy0+Y3Vyc29yLmhwb3MgPT0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5l X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gdGV4dF9h cmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID09 IGN1cnNvcl9yb3ctPnBpeGVsX3dpZHRoKTsKKyAgYm9vbCBjdXJzb3JfYmV5b25kX2ZyaW5nZV9w ID0gKGN1cnNvcl9nbHlwaCA9PSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBjdXJzb3Jfcm93ICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIHctPmN1cnNvci5ocG9zID09IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIWN1cnNvcl9yb3ctPmV4YWN0X3dpbmRvd193 aWR0aF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNv ci54ID49IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgdy0+Y3Vyc29yLnggPj0gY3Vyc29yX3Jvdy0+cGl4ZWxfd2lkdGgpOworICBpbnQgZnJhbWVf Y2hhcl93aWR0aCA9IEZSQU1FX0NPTFVNTl9XSURUSCAoZik7CisgIGludCB0ZW1wX2ZhY2VfaWQg PSBnbHlwaC0+ZmFjZV9pZDsKKyAgc3RydWN0IG1jX1JHQiBiYWNrZ3JvdW5kOworICBtY19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RpdmVfeCwKKyAgICAgICAgKGdseXBoLT50 eXBlID09IENIQVJfR0xZUEgKKyAgICAgICAgID8gJ0MnCisgICAgICAgICA6ICdHJyksCisgICAg ICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAg ICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAg ICAgICAgPyAnUycKKyAgICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICAgICAgICA/ICcwJworICAgICAgICAgICAgICAgOiAnLScpKSksCisgICAgICAgICAgICAgIGds eXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgZ2x5cGgtPnUuY2gsCisgICAgICAgIGdseXBoLT5m YWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+ cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPmhwb3MsIGdseXBoX3p2X3AgPyAiWlYi IDogIi0tIiwKKyAgICAgICAgbWNfY2hhcl90b19zdHJpbmcgKGdseXBoLT51LmNoKSk7CisgIHN3 aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAg ICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTOiAgQ0hBUl9HTFlQSCB8IEdMWVBITEVTU19HTFlQ SCAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIE1V TFRJUExFX0NVUlNPUlM6CisgICAgewor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gICAgICAg ICAgICAgYmFja2dyb3VuZCwgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwg ZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgICBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7 CisgICAgICBpZiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFth cmVhXSAtIDEKKyAgICAgICAgICAmJiByZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAgIHsK KyAgICAgICAgICBpZiAocmVsYXRpdmVfeCA8IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAg ICB7CisgICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAg ICAgICAgICAgICBmeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICB9CisgICAg ICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5 LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgIHhfbGltaXQgLSByZWxhdGl2 ZV94LCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sCisgICAgICAg ICAgICAgICAgICAgICBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2ZV9w LCBNQ19HTFlQSExFU1MsCisgICAgICAgICAgICAgICAgICAgICBkcmF3X3AsIGZyb21fd2hlcmUs IGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAg fQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgIFZFUlRJQ0FMX1JV TEVSOiAgQ0hBUl9HTFlQSCB8IEdMWVBITEVTU19HTFlQSCAgICAgICAgICAgICAgICAgKi8KKy8q IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgVkVSVElDQUxfUlVMRVI6CisgICAgewor ICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1cnNvcl9hdF9mcmluZ2VfcAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+Y29udGludWVkX3Ap CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFS X0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29y X2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAh cm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9X CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5b25kX2Zy aW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRy dW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FS RUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ct PnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNl ZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9w b2ludF94ID49IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IChnbHlwaF96dl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBN Q19HTFlQSDsKKyAgICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hU X0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZF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gICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxh dm9yID0gKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0g LSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5m Y194ID49IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IChnbHlwaF96dl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoIU5J TFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfdmVydGlj YWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3Bv aW50X3kgPT0geQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3Bv aW50X3Zwb3MgPT0gdnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNf R0xZUEg7CisgICAgICB3ZCA9IDE7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBn bHlwaCwgcmVsYXRpdmVfeCwgZmNfZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAg ICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcm93X3Bvc2l0aW9uLCBmb3J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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICBlbHNlIGlmIChnbHlwaC0+dHlw ZSA9PSBTVFJFVENIX0dMWVBIKQorICB7CisgICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAgZnBy aW50ZiAoc3RkZXJyLAorICAgICAgICAiXG4gJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVj ICUzZCAweCUwNnggJTRkICUxLjFkJTEuMWQgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5cGgg LSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAw KSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAg ICAgJ1MnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBo LT5vYmplY3QpCisgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9i amVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2Jq ZWN0KQorICAgICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAg ICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIDB1LAorICAgICAgICBnbHlwaC0+ZmFj ZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJp Z2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6 ICItLSIsCisgICAgICAgICJcXFMiKTsKKyAgc3dpdGNoIChhY3Rpb25fdHlwZSkKKyAgeworLyog LS0tLS0tLS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Y2FzZSBIT1JJWk9OVEFMX1JVTEVS OgorICAgIHsKKyAgICAgIGlmIChyZWxhdGl2ZV94IDwgcm93LT5waXhlbF93aWR0aAorICAgICAg ICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4 LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAg ICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlv biwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxz LmFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAg ICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGlmIChnbHlwaCAtIHJvdy0+Z2x5 cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICYmIHJlbGF0 aXZlX3ggPD0geF9saW1pdCkKKyAgICAgICAgeworICAgICAgICAgIGlmIChyZWxhdGl2ZV94IDwg cm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVs X3dpZHRoOworICAgICAgICAgIHRlbXBfZmFjZV9pZCA9IChyb3ctPmZpbGxfbGluZV9wKQorICAg ICAgICAgICAgICAgICAgICAgICAgID8gZ2x5cGgtPmZhY2VfaWQKKyAgICAgICAgICAgICAgICAg ICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGJhY2tn cm91bmQ7CisgICAgICAgICAgbWNfc2V0X2xzbF9iZyAodywgdGVtcF9mYWNlX2lkLCAmYmFja2dy b3VuZCk7CisgICAgICAgICAgbWNfaGVsc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oIXJvdy0+ZmlsbF9saW5lX3AKKyAgICAgICAgICAgICAgICAgJiYgZ2x5cGggLSByb3ctPmds eXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAg JiYgb3BvaW50X3ggPiByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoKQorICAgICAgICAg IHRlbXBfZmFjZV9pZCA9IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgIHN0cnVjdCBtY19SR0IgYmFj a2dyb3VuZDsKKyAgICAgIG1jX3NldF9sc2xfYmcgKHcsIHRlbXBfZmFjZV9pZCwgJmJhY2tncm91 bmQpOworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1cnNvcl9hdF9mcmlu Z2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+Y29udGlu dWVkX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElD QUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAo Y3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX1JJR0hU X0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5 b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBy b3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+dXNlZFtU RVhUX0FSRUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm ICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSExFU1M7CisgICAgICBpZiAoZ2x5cGhfZmxhdm9y ID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZv ciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBn bHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgIHx8IGds eXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3Ig PT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICBjdXJzb3JfdHlwZSA9IE1DX1JJ R0hUX0ZSSU5HRV9CSVRNQVA7CisgICAgICB3ZCA9IDE7CisgICAgICBtY19oZWxwZXIgKHcsIG1h dHJpeCwgcm93LCBnbHlwaCwgb3BvaW50X3gsIG9wb2ludF9meCwgeSwgZnksIGhwb3MsIHZwb3Ms CisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3df cG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIGJhY2tncm91bmQsIGVzc2Vu dGlhbHMuYWN0aXZlX3AsIGdseXBoX2ZsYXZvciwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAg ICAgICAgICAgICBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9 CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAg RklMTF9DT0xVTU46ICBTVFJFVENIX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICAqLworLyog LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBGSUxMX0NPTFVNTjoKKyAgICB7CisgICAg ICBpZiAocm93LT5maWxsX2xpbmVfcAorICAgICAgICAgICYmIGdseXBoIC0gcm93LT5nbHlwaHNb VEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYgZXNzZW50aWFs cy5mY194ID4gcmVsYXRpdmVfeCArIGdseXBoLT5waXhlbF93aWR0aCkKKyAgICAgICAgdGVtcF9m YWNlX2lkID0gZ2x5cGgtPmZhY2VfaWQ7CisgICAgICAgIGVsc2UgaWYgKCFyb3ctPmZpbGxfbGlu ZV9wCisgICAgICAgICAgICAgICAgICYmIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9 PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNf eCA+IHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgdGVtcF9mYWNl X2lkID0gREVGQVVMVF9GQUNFX0lEOworICAgICAgc3RydWN0IG1jX1JHQiBiYWNrZ3JvdW5kOwor ICAgICAgbWNfc2V0X2xzbF9iZyAodywgdGVtcF9mYWNlX2lkLCAmYmFja2dyb3VuZCk7CisgICAg ICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSBNQ19HTFlQSExFU1M7CisgICAgICB3ZCA9 IDE7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgZXNzZW50aWFscy5m Y194LCBmY19meCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBj dXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAg ICAgICAgICAgICAgIGJhY2tncm91bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsIGdseXBoX2ZsYXZv ciwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICBjYWNoZV90eXBlLCBhY3Rp b25fdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8K KyAgICBjYXNlIENVUlNPUl9JTkRJQ0FUT1I6CisgICAgeworICAgICAgYnJlYWs7CisgICAgfQor LyogLS0tLS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SAwKSA/IDAgOiByb3ctPnVz ZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ0knLAorICAgICAg ICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAg ICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAg ICAgID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAg ICAgICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4 ZWxfd2lkdGgsCisgICAgICAgICh1bnNpZ25lZCBpbnQpIGdseXBoLT51LmltZ19pZCwKKyAgICAg ICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAg ICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+aHBvcywgZ2x5cGhf enZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAnLicpOworICBzd2l0Y2ggKGFjdGlvbl90eXBl KQorICB7CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAg ICAgIE1VTFRJUExFX0NVUlNPUlM6ICBJTUFHRV9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAq LworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBNVUxUSVBMRV9DVVJTT1JTOgor ICAgIHsKKyAgICAgIGN1cnNvcl90eXBlID0gTUNfSE9MTE9XX0JPWDsKKyAgICAgIG1jX2hlbHBl ciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZw b3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBy b3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIGJhY2tncm91bmQsIGVz c2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUsCisgICAgICAg ICAgICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0K Ky8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgSE9S SVpPTlRBTF9SVUxFUjogIElNQUdFX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICovCisvKiAt LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEhPUklaT05UQUxfUlVMRVI6CisgICAgewor ICAgICAgY3Vyc29yX3R5cGUgPSBNQ19IT0xMT1dfQk9YOworICAgICAgaWYgKCFyZWFsX2Zha2Vf Y3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxh dGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgs IGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgZm9yZWdyb3VuZCwKKyAg ICAgICAgICAgICA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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBFTkQ6ICBJTUFHRV9HTFlQSCAgICAgICAgICAgICAgICAgICAg ICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisKKy8qIC0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgQkVHSU46ICBDT01QT1NJVEVf R0xZUEggICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0g Ki8KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKQorICB7CisgICAg aWYgKG1jX3N0ZGVycl9wKQorICAgICAgeworICAgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAg ICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4IiwKKyAg ICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgKChyb3ct PnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgICAg cmVsYXRpdmVfeCwKKyAgICAgICAgICAnKycsCisgICAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisg ICAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgID8gJ0InCisgICAg ICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgID8gJ1MnCisg ICAgICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICAgID8g JzAnCisgICAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICAgIGdseXBoLT5waXhlbF93 aWR0aCwKKyAgICAgICAgICAodW5zaWduZWQgaW50KSBnbHlwaC0+dS5jbXAuaWQpOworICAgICAg ICBmcHJpbnRmIChzdGRlcnIsICIgJTRkICUxLjFkJTEuMWQiLAorICAgICAgICAgIGdseXBoLT5m YWNlX2lkLAorICAgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgICAgZ2x5 cGgtPnJpZ2h0X2JveF9saW5lX3ApOworICAgICAgaWYgKGdseXBoLT51LmNtcC5hdXRvbWF0aWMp CisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgJTNkICVzIC4gWyVkLSVkXVxuIiwKKyAgICAg ICAgICAgICAgICAgICAgICAgICBnbHlwaC0+aHBvcywgZ2x5cGhfenZfcCA/ICJaViIgOiAiLS0i LAorICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoLT5zbGljZS5jbXAuZnJvbSwgZ2x5cGgt PnNsaWNlLmNtcC50byk7CisgICAgICAgIGVsc2UKKyAgICAgICAgICBmcHJpbnRmIChzdGRlcnIs ICJcbiIpOworICAgICAgfQorICBzd2l0Y2ggKGFjdGlvbl90eXBlKQorICB7CisvKiAtLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JT OiAgQ09NUE9TSVRFX0dMWVBIICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tICovCisgICAgY2FzZSBNVUxUSVBMRV9DVVJTT1JTOgorICAgIHsKKyAgICAgIG1jX2hl bHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3Ms IHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRo LCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIGJhY2tncm91bmQs IGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUsCisgICAg ICAgICAgICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGJyZWFrOworICAg IH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgIEhP UklaT05UQUxfUlVMRVI6ICBDT01QT1NJVEVfR0xZUEggICAgICAgICAgICAgICAgICAgICovCisv KiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEhPUklaT05UQUxfUlVMRVI6CisgICAg eworICAgICAgaWYgKHJlbGF0aXZlX3ggPD0geF9saW1pdAorICAgICAgICAgICYmICFyZWFsX2Zh a2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCBy ZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2Qs IGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgZm9yZWdyb3VuZCwK KyAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBNQ19H TFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUs IGFjdGlvbl90eXBlKTsKKyAgICAgIGlmIChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0g PT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICYmIHJlbGF0aXZlX3ggPD0geF9saW1p dCkKKyAgICAgICAgeworICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRo OworICAgICAgICAgIHdoaWxlIChyZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAgICAgICB7 CisgICAgICAgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2 ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgd2Qs IGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgZm9yZWdyb3VuZCwK KyAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2ZV9w LCBNQ19HTFlQSExFU1MsIGRyYXdfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBmcm9tX3do ZXJlLCBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICAgICAgICAgIHJlbGF0aXZlX3gg Kz0gZnJhbWVfY2hhcl93aWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgYnJl YWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAg ICAgICAgICBWRVJUSUNBTF9SVUxFUjogIENPTVBPU0lURV9HTFlQSCAgICAgICAgICAgICAgICAg ICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgVkVSVElDQUxfUlVMRVI6 CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1cnNvcl9hdF9m cmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+Y29u dGludWVkX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVS VElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX1JJ R0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3Jf YmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+dXNl ZFtURVhUX0FSRUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09 IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIG9wb2ludF94ID49IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IChnbHlwaF96dl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxf QkFSX1JJR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0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLSAqLworICAgIGNhc2UgRklMTF9DT0xVTU46CisgICAgeworICAgICAgZW51bSBtY19mbGF2 b3IgZ2x5cGhfZmxhdm9yID0gKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ct PnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg ZXNzZW50aWFscy5mY194ID4gcmVsYXRpdmVfeCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogKGdseXBoX3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 ICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF92 ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvcG9pbnRfeSA9PSB5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvcG9pbnRfdnBvcyA9PSB2cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiBNQ19HTFlQSDsKKyAgICAgIHdkID0gMTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCBy b3csIGdseXBoLCByZWxhdGl2ZV94LCBmY19meCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAg ICAgICAgICAgIHdkLCBoLCBjdXJzb3Jf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gICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgIGVsc2UgaWYgKGdseXBo LT50eXBlID09IFhXSURHRVRfR0xZUEgpCisgIHsKKyNpZm5kZWYgSEFWRV9YV0lER0VUUworICAg IGVhc3N1bWUgKGZhbHNlKTsKKyNlbHNlCisgICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAgZnBy aW50ZiAoc3RkZXJyLAorICAgICAgICAiXG4gICU1ZC8lLTVkICU1ZCAlNGMgJTZkICVjICUzZCAw eCUwNXggJTRkICUxLjFkJTEuMWQgICUzZCAlcyAlY1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ct PmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAg OiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ1gn LAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmpl Y3QpCisgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkK KyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6ICctJykpLAorICAgICAgICBnbHlwaC0+ cGl4ZWxfd2lkdGgsCisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVm dF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAg Z2x5cGgtPnUueHdpZGdldCwKKyAgICAgICAgZ2x5cGgtPmhwb3MsIGdseXBoX3p2X3AgPyAiWlYi IDogIi0tIiwKKyAgICAgICAgJy4nKTsKKyNlbmRpZgorICBzd2l0Y2ggKGFjdGlvbl90eXBlKQor ICB7CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAg TVVMVElQTEVfQ1VSU09SUzogIFhXSURHRVRfR0xZUEggICAgICAgICAgICAgICAgICAgICAqLwor LyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBNVUxUSVBMRV9DVVJTT1JTOgorICAg IHsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBm eCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlw ZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAg ICAgIGJhY2tncm91bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGZy b21fd2hlcmUsCisgICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAg ICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAg ICAgICAgICAgICAgICBIT1JJWk9OVEFMX1JVTEVSOiAgWFdJREdFVF9HTFlQSCAgICAgICAgICAg ICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEhPUklaT05U QUxfUlVMRVI6CisgICAgeworICAgICAgaWYgKHJlbGF0aXZlX3ggPD0geF9saW1pdAorICAgICAg ICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4 LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAg ICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlv biwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxz LmFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAg ICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGlmIChnbHlwaCAtIHJvdy0+Z2x5 cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICYmIHJlbGF0 aXZlX3ggPD0geF9saW1pdCkKKyAgICAgICAgeworICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5 cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgIHdoaWxlIChyZWxhdGl2ZV94IDw9IHhfbGltaXQp CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3cs IGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAg ICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlv biwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3Nl bnRpYWxzLmFjdGl2ZV9wLCBNQ19HTFlQSExFU1MsIGRyYXdfcCwKKyAgICAgICAgICAgICAgICAg ICAgICAgICBmcm9tX3doZXJlLCBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICAgICAg ICAgIHJlbGF0aXZlX3ggKz0gZnJhbWVfY2hhcl93aWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAg ICAgfQorICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAg ICAgICAgICAgICAgICAgICAgICAgICAgVkVSVElDQUxfUlVMRVI6ICBYV0lER0VUX0dMWVBIICAg ICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2Ug VkVSVElDQUxfUlVMRVI6CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9y ID0gKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVk X29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNf VkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IChjdXJzb3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdI VF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2Jl eW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg Y3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBo c1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF94ID49IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF96dl9wKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIGlmIChnbHlwaF9mbGF2b3Ig PT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9y ID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGds eXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgfHwgZ2x5 cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9 PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAgIGN1cnNvcl90eXBlID0gTUNfUklH SFRfRlJJTkdFX0JJVE1BUDsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBo LCByZWxhdGl2ZV94LCBvcG9pbnRfZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAg ICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcm93X3Bvc2l0aW9uLCBmb3Jl Z3JvdW5kLAorICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2ZV9w LCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgY2Fj aGVfdHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgIEZJTExfQ09MVU1OOiAg WFdJREdFVF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLSAqLworICAgIGNhc2UgRklMTF9DT0xVTU46CisgICAgeworICAgICAgZW51bSBtY19mbGF2 b3IgZ2x5cGhfZmxhdm9yID0gKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ct PnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg ZXNzZW50aWFscy5mY194ID4gcmVsYXRpdmVfeCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogKGdseXBoX3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 ICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF92 ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvcG9pbnRfeSA9PSB5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvcG9pbnRfdnBvcyA9PSB2cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiBNQ19HTFlQSDsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxh dGl2ZV94LCBmY19meCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBo LCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisg ICAgICAgICAgICAgICAgIGJhY2tncm91bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsIGdseXBoX2Zs YXZvciwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICBjYWNoZV90eXBlLCBh Y3Rpb25fdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0g Ki8KKyAgICBjYXNlIENVUlNPUl9JTkRJQ0FUT1I6CisgICAgeworICAgICAgYnJlYWs7CisgICAg fQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgIH0KKyAgfQorLyogLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFTkQ6ICBYV0lER0VUX0dM WVBIICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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3Jv dywgbWF0cml4KTsKKyAgaWYgKHZwb3MgPT0gYm90dG9tX3Zwb3MpCisgICAgcmV0dXJuOworICBp ZiAoIXJvdy0+dXNlZFtURVhUX0FSRUFdKQorICAgIHJldHVybjsKKyAgaW50IGhwb3Nfc3RhcnQg PSBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgIGlmIChtY19zdGRlcnJfcCkKKyAg ICBmcHJpbnRmIChzdGRlcnIsICJtY19kcmF3X3JvdyAoJWQpOiAgZHJhd19wICglcykgfCBocG9z ICglZCkgfCBsZW4gKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgIHZwb3MsIGRyYXdfcCA/ ICJ5IiA6ICJuIiwgaHBvc19zdGFydCwgaHBvc19sZW5ndGgpOworICBpbnQgb3BvaW50X2Z4LCBv cG9pbnRfZnksIG9wb2ludF93ZCwgb3BvaW50X2g7CisgIGludCB0ZXh0X2FyZWFfd2lkdGggPSB3 aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOworICBpbnQgaGVhZGVyX2xpbmVfZm9ybWF0 ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgIHN0cnVjdCBnbHlwaF9yb3cgKmN1 cnNvcl9yb3cgPSAody0+Y3Vyc29yLnZwb3MgIT0gLTEpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IE1BVFJJWF9ST1cgKGN1cnNvcl9tYXRyaXgsIHctPmN1cnNvci52cG9zKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOVUxMOworICBzdHJ1Y3QgZ2x5cGgg KmN1cnNvcl9nbHlwaCA9ICh3LT5jdXJzb3IudnBvcyAhPSAtMSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIGN1cnNvcl9tYXRyaXgsIGN1 cnNvcl9yb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiBOVUxMOworICBib29sIGN1cnNvcl9hdF9mcmluZ2VfcCA9IChjdXJz b3JfZ2x5cGggPT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jf cm93ICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhw b3MgPT0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIGN1cnNvcl9yb3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5lX3AKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gdGV4dF9hcmVhX3dpZHRoCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID09IGN1cnNvcl9yb3ct PnBpeGVsX3dpZHRoKTsKKyAgYm9vbCBjdXJzb3JfYmV5b25kX2ZyaW5nZV9wID0gKGN1cnNvcl9n bHlwaCA9PSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jf cm93ICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNv ci5ocG9zID09IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgIWN1cnNvcl9yb3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5lX3AK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHRleHRf YXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29y LnggPj0gY3Vyc29yX3Jvdy0+cGl4ZWxfd2lkdGgpOworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq CisgICAgICAgICAgICAgICAgICAgICAgICAgIFJFUExBQ0UgVEhFIFJFQUwgQ1VSU09SCisqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKyAgZW51bSBmYWNlX2lkIGJnX2ZhY2VfaWQgPSAoY3Vyc29y X2dseXBoICE9IE5VTEwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBjdXJzb3JfZ2x5 cGgtPmZhY2VfaWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9J RDsKKyAgc3RydWN0IG1jX1JHQiBjdXJzb3JfYmc7CisgIG1jX3NldF9sc2xfYmcgKHcsIGJnX2Zh Y2VfaWQsICZjdXJzb3JfYmcpOworICAvKiBGSVhNRTogIFB1dCBpbiBzb21lIGNvZGUgdG8gZGVm YXVsdCB0byBNQ19IT0xMT1dfQk9YIGlmIHRoZSB1c2VyIGhhcworICB1bndpdHRpbmdseSBjb21l IHVwIHdpdGggc29tZSB1bmFjY2VwdGFibGUgZm9ybSBvZiB1bnJlY29nbml6ZWQgY3Vyc29yIHR5 cGUuICovCisgIExpc3BfT2JqZWN0IGxpc3BfdHlwZSA9IEJWQVIgKGIsIG1jX3JlYWxfZmFrZV9j dXJzb3IpOworICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlID0gKENPTlNQIChsaXNw X3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY19saXNwX3Rv X2N1cnNvcl90eXBlIChYQ0FSIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiBtY19saXNwX3RvX2N1cnNvcl90eXBlIChsaXNwX3R5cGUpOworICBpbnQg Y3Vyc29yX3dpZHRoID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAg PyBYRklYTlVNIChYQ0FSIChYQ0RSIChsaXNwX3R5cGUpKSkKKyAgICAgICAgICAgICAgICAgICAg IDogLTE7CisgIHN0cnVjdCBtY19SR0IgY3Vyc29yX2ZnOworICBtY19jb2xvcl9waWNrZXIgKHcs IGN1cnNvcl9nbHlwaCwgZXNzZW50aWFscywgJmN1cnNvcl9mZywgLTEsIGN1cnNvcl90eXBlLAor ICAgICAgICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgQ1VSU09SX0lORElDQVRPUik7CisgIGJv b2wgZmlsbF9jb2x1bW5fdHJ1bXBzX3AgPSAoIU5JTFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1 bGVyKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwg ZmNfdmlzaWJsZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29y LnggPT0gZXNzZW50aWFscy5mY194CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg IWN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFj dXJzb3JfYmV5b25kX2ZyaW5nZV9wKTsKKyAgLyogV2UgdXNlIGEgdGVzdCBzaW1pbGFyIHRvIHRo ZSByZWFsIGZha2UgY3Vyc29yIHNvIHRoYXQgdGhlIGZyaW5nZSBiaXRtYXAgaXMKKyAgb25seSBk cmF3biBvbmNlIHBlciB3aW5kb3cuICovCisgIGlmICh2cG9zID09IHctPmN1cnNvci52cG9zCisg ICAgICAmJiBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGggPT0gcm93LT51c2VkW1RFWFRfQVJFQV0K KyAgICAgICYmICFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICYmICFOSUxQIChC VkFSIChiLCBjaF9ob3Jpem9udGFsX3J1bGVyKSkpCisgICAgeworICAgICAgLyogZnJpbmdlIGJp dG1hcHMgdXNlIGZhY2VfaWQgdG8gc2V0IHRoZSBmb3JlZ3JvdW5kIGNvbG9yLiAgVGhlIG92ZXJs YXktYXJyb3cKKyAgICAgIGlzIHByZXNlbnRseSB0aGUgb25seSBzaXR1YXRpb24gd2hlcmUgdGhl IGBlc3NlbnRpYWxzLmFjdGl2ZV9wYCBhbmQgYG1pbmltYWxfcGAgYXJlCisgICAgICB1c2VkIHRv IGRldGVybWluZSB0aGUgYXBwbGljYWJsZSBmYWNlX2lkLiAqLworICAgICAgc3RydWN0IG1jX1JH QiBsc2xfZmcgPSB7LnJlZCA9IC0xLjAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAu Z3JlZW4gPSAtMS4wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSAtMS4w fTsKKyAgICAgIC8qIFdlIHVzZSB0aGUgZmlyc3QgZ2x5cGggaW4gdGhlIHJvdywgd2l0aCBhbiBY IGFuZCBIUE9TIG9mIHplcm8uICovCisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBy b3ctPmdseXBoc1tURVhUX0FSRUFdLCAwLCAtMSwgdy0+Y3Vyc29yLnksIC0xLAorICAgICAgICAg ICAgICAgICAwLCB3LT5jdXJzb3IudnBvcywgLTEsIC0xLCBNQ19MRUZUX0ZSSU5HRV9CSVRNQVAs IC0xLCByb3dfcG9zaXRpb24sCisgICAgICAgICAgICAgICAgIGxzbF9mZywgY3Vyc29yX2JnLCBl c3NlbnRpYWxzLmFjdGl2ZV9wLCBNQ19PVkVSTEFZX0FSUk9XX0JJVE1BUCwKKyAgICAgICAgICAg ICAgICAgZHJhd19wLCBmcm9tX3doZXJlLCBDSF9DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7Cisg ICAgfQorICBpZiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAmJiB2cG9zID09IHctPmN1cnNv ci52cG9zCisgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAmJiB3 LT5jdXJzb3IuaHBvcyA9PSBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGgKKyAgICAgICYmICFOSUxQ IChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9ob3Jp em9udGFsX3J1bGVyKSkpCisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9y ID0gTUNfSE9MTE9XX1JFQ1RBTkdMRTsKKyAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSByb3ct PmdseXBoc1tURVhUX0FSRUFdOworICAgICAgc3RydWN0IGdseXBoICpnbHlwaF9lbmQgPSBnbHlw aCArIHJvdy0+dXNlZFtURVhUX0FSRUFdOworICAgICAgLyogR2x5cGggZm9yIGEgbGluZSBlbmQg aW4gdGV4dC4gKi8KKyAgICAgIGlmIChnbHlwaCA9PSBnbHlwaF9lbmQgJiYgZ2x5cGgtPmNoYXJw b3MgPiAwKQorICAgICAgICArK2dseXBoX2VuZDsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4 LCByb3csIGdseXBoX2VuZCAtIDEsIHctPmN1cnNvci54LCAtMSwgdy0+Y3Vyc29yLnksIC0xLAor ICAgICAgICAgICAgICAgICB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MsIC0xLCAtMSwg TUNfUklHSFRfRlJJTkdFX0JJVE1BUCwKKyAgICAgICAgICAgICAgICAgLTEsIHJvd19wb3NpdGlv biwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsIGVzc2VudGlhbHMuYWN0aXZlX3AsCisgICAgICAgICAg ICAgICAgIGdseXBoX2ZsYXZvciwgZHJhd19wLCBmcm9tX3doZXJlLCBDSF9DQUNIRSwgQ1VSU09S X0lORElDQVRPUik7CisgICAgfQorICAvKiBDdXJzb3IgaXMgYmV5b25kIHRoZSByaWdodCBmcmlu Z2U7IGUuZy4sIHdoZW4gcmlnaHQgaG9yaXpvbnRhbCBzY3JvbGxpbmcuICovCisgIGVsc2UgaWYg KGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3Iu dnBvcworICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAg ICAgICYmIChocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGgpID09IHJvdy0+dXNlZFtURVhUX0FSRUFd CisgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAg JiYgIU5JTFAgKEJWQVIgKGIsIGNoX2hvcml6b250YWxfcnVsZXIpKSkKKyAgICB7CisgICAgICBl bnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xF X1JJR0hUX0FSUk9XOworICAgICAgc3RydWN0IGdseXBoICpnbHlwaCA9IHJvdy0+Z2x5cGhzW1RF WFRfQVJFQV07CisgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoX2VuZCA9IGdseXBoICsgcm93LT51 c2VkW1RFWFRfQVJFQV07CisgICAgICAvKiBHbHlwaCBmb3IgYSBsaW5lIGVuZCBpbiB0ZXh0LiAq LworICAgICAgaWYgKGdseXBoID09IGdseXBoX2VuZCAmJiBnbHlwaC0+Y2hhcnBvcyA+IDApCisg ICAgICAgICsrZ2x5cGhfZW5kOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5 cGhfZW5kIC0gMSwgcm93LT5waXhlbF93aWR0aCwgLTEsIHctPmN1cnNvci55LAorICAgICAgICAg ICAgICAgICAtMSwgcm93LT51c2VkW1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NfZ2V0X2N1cnNv cl9nZW9tZXRyeSAodywgbWF0cml4LCByb3csIHctPmN1cnNvci54LCAmb3BvaW50X2Z4LCB3LT5j dXJzb3IueSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZvcG9pbnRfZnksIHctPmN1 cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgTUNfQkFSLCAxLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywg bWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vy c29yLnksCisgICAgICAgICAgICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1 cnNvci52cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9oLAorICAgICAgICAgICAgICAgICBNQ19CQVIs IDEsIHJvd19wb3NpdGlvbiwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsIGVzc2VudGlhbHMuYWN0aXZl X3AsCisgICAgICAgICAgICAgICAgIE1DX0dMWVBITEVTUywgZHJhd19wLCBmcm9tX3doZXJlLCBO SUxQIChCVkFSIChiLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfQ0FDSEUsIENVUlNPUl9JTkRJQ0FUT1IpOwor ICAgICAgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeSAodywgbWF0cml4LCByb3csIHctPmN1cnNvci54 LCAmb3BvaW50X2Z4LCB3LT5jdXJzb3IueSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICZvcG9pbnRfZnksIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUNfSEJBUiwgMSwgJm9wb2ludF93ZCk7Cisg ICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1cnNvci54 LCBvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICBvcG9pbnRfZnksIHct PmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgb3BvaW50X3dkLCBvcG9pbnRfaCwKKyAgICAg ICAgICAgICAgICAgTUNfSEJBUiwgMSwgcm93X3Bvc2l0aW9uLCBjdXJzb3JfZmcsIGN1cnNvcl9i ZywgZXNzZW50aWFscy5hY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgTUNfR0xZUEgsIGRyYXdf cCwgZnJvbV93aGVyZSwgTklMUCAoQlZBUiAoYiwgbWNfY29uZikpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19DQUNIRSwgQ1VSU09SX0lORElD QVRPUik7CisgICAgfQorICBlbHNlIGlmICghY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAg ICYmIGN1cnNvcl9nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29y LnZwb3MKKyAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPj0gaHBvc19zdGFydAorICAgICAg ICAgICAmJiB3LT5jdXJzb3IuaHBvcyA8IGhwb3Nfc3RhcnQgKyBocG9zX2xlbmd0aAorICAgICAg ICAgICAmJiBjdXJzb3JfZ2x5cGgtPnR5cGUgIT0gU1RSRVRDSF9HTFlQSCkKKyAgICB7CisgICAg ICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZv cG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9w b2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCAmb3Bv aW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwg dy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAgICAgICAgIG9w b2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCBvcG9pbnRfd2QsIG9wb2lu dF9oLAorICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9z aXRpb24sIGN1cnNvcl9mZywgY3Vyc29yX2JnLAorICAgICAgICAgICAgICAgICBlc3NlbnRpYWxz LmFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAg ICBOSUxQIChCVkFSIChiLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgPyBDSF9DQUNIRQor ICAgICAgICAgICAgICAgICA6IE1DX0NBQ0hFLCBDVVJTT1JfSU5ESUNBVE9SKTsKKyAgICB9Cisg IGVsc2UgaWYgKCFjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgJiYgY3Vyc29yX2dseXBo ICE9IE5VTEwKKyAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAgICAg ICAmJiB3LT5jdXJzb3IuaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICYmIHctPmN1cnNv ci5ocG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoCisgICAgICAgICAgICYmIGN1cnNvcl9n bHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKQorICAgIHsKKyAgICAgIC8qIElmIGEgdXNlciBo YXMgc2V0IGB4LXN0cmV0Y2gtY3Vyc29yJyB0byBhIG5vbi1uaWwgdmFsdWUsIGhlL3NoZSBjaG9z ZSB0bworICAgICAgaGF2ZSBhIGN1cnNvciB0aGF0IHNwYW5zIHRoZSBlbnRpcmUgbGVuZ3RoIG9m IHRoZSBTVFJFVENIX0dMWVBILiAqLworICAgICAgaWYgKCF4X3N0cmV0Y2hfY3Vyc29yX3ApCisg ICAgICAgIHsKKyAgICAgICAgICAvKiBUaGUgTUNfSEJBUiBzaGFsbCBoYXZlIGEgYGN1cnNvcl93 aWR0aGAgb2YgMS4gKi8KKyAgICAgICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRy aXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRfZngsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgdy0+Y3Vyc29yLnksICZvcG9pbnRfZnksIHctPmN1cnNvci5ocG9zLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gs IE1DX0hCQVIsIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF93 ZCk7CisgICAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgY3Vyc29yX2dseXBoLCB3 LT5jdXJzb3IueCwgb3BvaW50X2Z4LAorICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLnks IG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLAorICAgICAgICAgICAg ICAgICAgICAgb3BvaW50X3dkLCBvcG9pbnRfaCwgTUNfSEJBUiwgMSwgcm93X3Bvc2l0aW9uLCBj dXJzb3JfZmcsCisgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfYmcsIGVzc2VudGlhbHMuYWN0 aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUsCisgICAgICAgICAgICAgICAgICAg ICBOSUxQIChCVkFSIChiLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgID8gQ0hfQ0FD SEUKKyAgICAgICAgICAgICAgICAgICAgIDogTUNfQ0FDSEUsIENVUlNPUl9JTkRJQ0FUT1IpOwor ICAgICAgICB9CisgICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywg dy0+Y3Vyc29yLngsICZvcG9pbnRfZngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3 LT5jdXJzb3IueSwgJm9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLCBjdXJzb3JfdHlwZSwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgJm9wb2ludF93ZCk7Cisg ICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1cnNvci54 LCBvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICBvcG9pbnRfZnksIHct PmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgb3BvaW50X3dkLCBvcG9pbnRfaCwKKyAgICAg ICAgICAgICAgICAgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcm93X3Bvc2l0aW9uLCBjdXJz b3JfZmcsIGN1cnNvcl9iZywKKyAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVfcCwg TUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgTklMUCAoQlZB UiAoYiwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAg ICAgICAgOiBNQ19DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgfQorLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICAgIERSQVcgQU5EIFJFQ09SRCBG QUtFIENVUlNPUlMKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICBpZiAoIWVzc2VudGlhbHMu YWN0aXZlX3AKKyAgICAgICYmIE5JTFAgKEJWQVIgKGIsIG1jX2luYWN0aXZlX3dpbmRvd3MpKQor ICAgICAgJiYgTklMUCAoQlZBUiAoYiwgY2hfaW5hY3RpdmVfd2luZG93cykpCisgICAgICAmJiBO SUxQIChCVkFSIChiLCBmY19pbmFjdGl2ZV93aW5kb3dzKSkpCisgICAgcmV0dXJuOworICBpZiAo aHBvc19sZW5ndGggPT0gMSkKKyAgICB7CisgICAgICBpZiAoIU5JTFAgKEJWQVIgKGIsIG1jX2Nv bmYpKQorICAgICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgIHx8 ICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIg KGIsIG1jX2luYWN0aXZlX3dpbmRvd3MpKSkpKQorICAgICAgICB7CisgICAgICAgICAgLyogVGhl IHNwYWNlIGFwcGVuZGVkIHRvIGEgcm93IGVuZGluZyB3aXRoIGEgbmV3IGxpbmUKKyAgICAgICAg ICBkb2VzIG5vdCBoYXZlIGEgYGdseXBoLT5jaGFycG9zYCAoLTEsIDApIHRoYXQgd2UgY2FuCisg ICAgICAgICAgdXNlIGZvciB0aGlzIHBhcnRpY3VsYXIgYXBwbGljYXRpb24uICBXaGVuIHRoZXJl IGlzIGEKKyAgICAgICAgICBgYnVmZmVyLWRpc3BsYXktdGFibGUnIGVudHJ5IHRoYXQgYXNzaWdu cyBhIHZpc2libGUKKyAgICAgICAgICBnbHlwaCB0byBhIG5ldyBsaW5lLCB0aGVyZSBpcyBubyBw cm9ibGVtIGJlY2F1c2UgdGhhdAorICAgICAgICAgIGdseXBoIGhhcyBhIGBnbHlwaC0+Y2hhcnBv cycgdGhhdCB3ZSBjYW4gdXNlLiAgV2hlbgorICAgICAgICAgIG5vIHZpc2libGUgRU9MIGdseXBo IGV4aXN0cywgd2UgdXNlIHRoZSBmb2xsb3dpbmcKKyAgICAgICAgICB0ZXN0OiAgdGhlIGFwcGVu ZGVkIHNwYWNlIGhhcyBhIHBvc2l0aW9uIHRoYXQgaXMgb25lCisgICAgICAgICAgbGVzcyB0aGFu IHRoZSBlbmQgb2YgdGhlIG1hdHJpeCByb3cuICovCisgICAgICAgICAgaW50IGhwb3MgPSBzdGFy dCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICAgICAgc3RydWN0IGdseXBoICpwcmV2 aW91c19nbHlwaCA9ICgwIDw9IGhwb3MgLSAxICYmIGhwb3MgLSAxIDwgcm93LT51c2VkW1RFWFRf QVJFQV0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gcm93LT5n bHlwaHNbVEVYVF9BUkVBXSArIGhwb3MgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogTlVMTDsKKyAgICAgICAgICAvLyBzdHJ1Y3QgZ2x5cGggKmxhc3RfZ2x5 cGggPSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxOwor ICAgICAgICAgIGJvb2wgc2tpcF9wID0gKHByZXZpb3VzX2dseXBoICE9IE5VTEwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBwcmV2aW91c19nbHlwaC0+Y2hhcnBvcyA9PSBNQVRSSVhfUk9X X0VORF9DSEFSUE9TIChyb3cpIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICYmIHN0YXJ0 LT5ieXRlcG9zICE9IGVzc2VudGlhbHMuenZfYnl0ZSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgPyB0cnVlCisgICAgICAgICAgICAgICAgICAgICAgICAvKiBXaGVuIGEgYGJ1ZmZlci1kaXNw bGF5LXRhYmxlJyBlbnRyeSBjb250YWlucworICAgICAgICAgICAgICAgICAgICAgICAgYSB2aXNp YmxlIHRhYiBjaGFyYWN0ZXIgKCLCuyIpLCB0aGUgc3Vic2VxdWVudAorICAgICAgICAgICAgICAg ICAgICAgICAgU1RSRVRDSF9HTFlQSCB3aWxsIGhhdmUgdGhlIHNhbWUgc3RhcnQtPmNoYXJwb3MK KyAgICAgICAgICAgICAgICAgICAgICAgIGFzIHRoZSBhZm9yZW1lbnRpb25lZCB2aXNpYmxlIHRh YiBjaGFyYWN0ZXIuICovCisgICAgICAgICAgICAgICAgICAgICAgICA6IChwcmV2aW91c19nbHlw aCAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBwcmV2aW91c19nbHlwaC0+ Y2hhcnBvcyA9PSBzdGFydC0+Y2hhcnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgPyB0 cnVlCisgICAgICAgICAgICAgICAgICAgICAgICA6IGZhbHNlOworICAgICAgICAgIGludCBwb3Np bnQgPSAocm93X3Bvc2l0aW9uID09IFBPU1RfWlYpCisgICAgICAgICAgICAgICAgICAgICAgICAg PyAtMQorICAgICAgICAgICAgICAgICAgICAgICA6IChyb3dfcG9zaXRpb24gPT0gQVRfWlYpCisg ICAgICAgICAgICAgICAgICAgICAgICAgID8gZXNzZW50aWFscy56dgorICAgICAgICAgICAgICAg ICAgICAgICA6IChzdGFydC0+Ynl0ZXBvcyAhPSBlc3NlbnRpYWxzLnp2X2J5dGUKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJv dy0+dXNlZFtURVhUX0FSRUFdIC0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICA/IE1BVFJJ WF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgLSAxCisgICAgICAgICAgICAgICAgICAgICAgIDogKHN0 YXJ0LT5ieXRlcG9zID09IGVzc2VudGlhbHMuenZfYnl0ZQorICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW1RFWFRf QVJFQV0gLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgID8gZXNzZW50aWFscy56dgorICAg ICAgICAgICAgICAgICAgICAgICA6IHN0YXJ0LT5jaGFycG9zOworICAgICAgICAgIExpc3BfT2Jq ZWN0IHNwZWNzID0gbWNfYXNzb2MgKG1ha2VfZml4bnVtIChwb3NpbnQpLCBCVkFSIChiLCBtY19j b25mKSk7CisgICAgICAgICAgaWYgKCgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID4g MCkKKyAgICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAg ICAgICAmJiAhTklMUCAoc3BlY3MpCisgICAgICAgICAgICAgICYmIHJvdy0+eSA8PSB3aW5kb3df dGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAgICAgJiYgIXNraXBfcAorICAgICAgICAgICAg ICAmJiByb3dfcG9zaXRpb24gIT0gUE9TVF9aVikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgTGlzcF9PYmplY3QgbGlzcF90eXBlID0gbWNfbnRoICgxLCBzcGVjcyk7CisgICAgICAgICAg ICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUgPSAoQ09OU1AgKGxpc3BfdHlwZSkp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IG1jX2xp c3BfdG9fY3Vyc29yX3R5cGUgKFhDQVIgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKGxp c3BfdHlwZSk7CisgICAgICAgICAgICAgIGN1cnNvcl90eXBlID0gKHN0YXJ0LT50eXBlID09IElN QUdFX0dMWVBIKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfSE9MTE9XX0JPWAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogY3Vyc29yX3R5cGU7CisgICAgICAgICAgICAg IGludCBjdXJzb3Jfd2lkdGggPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IFhGSVhOVU0gKFhDQVIgKFhDRFIgKGxpc3BfdHlwZSkpKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAtMTsKKyAgICAgICAgICAgICAgTGlzcF9P YmplY3QgbWNfZm9yZWdyb3VuZCA9IG1jX250aCAoMiwgc3BlY3MpOworICAgICAgICAgICAgICBz dHJ1Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICAgICAgaWYgKFNUUklOR1AgKG1jX2ZvcmVn cm91bmQpKQorICAgICAgICAgICAgICAgIG1jX3h3X2NvbG9yX3ZhbHVlcyAodywgbWNfZm9yZWdy b3VuZCwgJmxzbF9mZyk7CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoVkVDVE9SUCAobWNfZm9y ZWdyb3VuZCkpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGxzbF9m Zy5yZWQgPSBYRkxPQVRfREFUQSAoQVJFRiAobWNfZm9yZWdyb3VuZCwgMCkpOworICAgICAgICAg ICAgICAgICAgICBsc2xfZmcuZ3JlZW4gPSBYRkxPQVRfREFUQSAoQVJFRiAobWNfZm9yZWdyb3Vu ZCwgMSkpOworICAgICAgICAgICAgICAgICAgICBsc2xfZmcuYmx1ZSA9IFhGTE9BVF9EQVRBIChB UkVGIChtY19mb3JlZ3JvdW5kLCAyKSk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAg ICAgICAgICBlbHNlIGlmIChOSUxQIChtY19mb3JlZ3JvdW5kKSkKKyAgICAgICAgICAgICAgICAg ICAgbWNfY29sb3JfcGlja2VyICh3LCBzdGFydCwgZXNzZW50aWFscywgJmxzbF9mZywgcG9zaW50 LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCByb3df cG9zaXRpb24sIE1VTFRJUExFX0NVUlNPUlMpOworICAgICAgICAgICAgICBpbnQgdnBvcyA9IE1B VFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAgICAgICAgICAgICBpbnQgeF9saW1pdCA9 IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAgICAgICAgICAgIG1jX2VuZ2lu ZSAodywgbWF0cml4LCByb3csIHN0YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGltaXQsIHJvdy0+eSwK KyAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0s IHZwb3MsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0 aCwgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLAorICAgICAgICAgICAg ICAgICAgICAgICAgIGxzbF9mZywgTVVMVElQTEVfQ1VSU09SUywgZHJhd19wLCBmcm9tX3doZXJl LCBNQ19DQUNIRSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGlmICghTklMUCAo QlZBUiAoYiwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgJiYgKGVzc2VudGlhbHMuYWN0aXZlX3AK KyAgICAgICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAg ICAmJiAhTklMUCAoQlZBUiAoYiwgZmNfaW5hY3RpdmVfd2luZG93cykpKSkKKyAgICAgICAgICAv LyAmJiBlc3NlbnRpYWxzLmZjX3ggPD0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgJiYgZXNz ZW50aWFscy5mY194IDwgdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgJiYgZXNzZW50aWFscy5m Y194ID49IHctPm1jLmxudW1fcGl4ZWxfd2lkdGgpCisgICAgICAgIHsKKyAgICAgICAgICBpbnQg eF9saW1pdCA9IHggKyBzdGFydC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgYm9vbCByZWFsX2Zh a2VfY3Vyc29yX3AgPSAody0+Y3Vyc29yLnggPT0gZXNzZW50aWFscy5mY194CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnkgPT0gcm93LT55CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gc3Rh cnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgdy0+Y3Vyc29yLnZwb3MgPT0gdnBvcyk7CisgICAgICAgICAgc3RydWN0IG1j X1JHQiBsc2xfZmc7CisgICAgICAgICAgbWNfY29sb3JfcGlja2VyICh3LCBzdGFydCwgZXNzZW50 aWFscywgJmxzbF9mZywgLTEsIE1DX0JBUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHJv d19wb3NpdGlvbiwgRklMTF9DT0xVTU4pOworICAgICAgICAgIGlmICh4IDwgdGV4dF9hcmVhX3dp ZHRoCisgICAgICAgICAgICAgIC8vIHggKyBzdGFydC0+cGl4ZWxfd2lkdGggPD0gdGV4dF9hcmVh X3dpZHRoCisgICAgICAgICAgICAgICYmICgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9z ID4gMCkKKyAgICAgICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAg ICAgICAgICAgICAmJiAoKHN0YXJ0ICE9IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVz ZWRbVEVYVF9BUkVBXSAtIDEKKyAgICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3gg Pj0geAorICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA8IHggKyBzdGFydC0+ cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICB8fCAoc3RhcnQgPT0gcm93LT5nbHlwaHNb VEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMQorICAgICAgICAgICAgICAgICAg ICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSB4KSkKKyAgICAgICAgICAgICAgJiYgcm93LT55IDw9 IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1 cnNvcl9wKQorICAgICAgICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgc3RhcnQsIFRF WFRfQVJFQSwgeCwgeF9saW1pdCwgcm93LT55LAorICAgICAgICAgICAgICAgICAgICAgICBzdGFy dCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sIHZwb3MsIE1DX0JBUiwgMSwKKyAgICAgICAgICAg ICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBsc2xf ZmcsCisgICAgICAgICAgICAgICAgICAgICAgIEZJTExfQ09MVU1OLCBkcmF3X3AsIGZyb21fd2hl cmUsIEZDX0NBQ0hFKTsKKyAgICAgICAgfQorICAgICAgaWYgKCFOSUxQIChCVkFSIChiLCBjcm9z c2hhaXJzKSkKKyAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfaG9yaXpvbnRhbF9ydWxl cikpCisgICAgICAgICAgJiYgKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgfHwg KCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAo YiwgY2hfaW5hY3RpdmVfd2luZG93cykpKSkKKyAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNv ci52cG9zKQorICAgICAgICB7CisgICAgICAgICAgaW50IHhfbGltaXQgPSAoc3RhcnQgPT0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSkKKyAgICAgICAg ICAgICAgICAgICAgICAgID8gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAg ICA6IHggKyBzdGFydC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xf Zmc7CisgICAgICAgICAgbWNfY29sb3JfcGlja2VyICh3LCBzdGFydCwgZXNzZW50aWFscywgJmxz bF9mZywgLTEsIE1DX0hCQVIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICByb3dfcG9zaXRp b24sIEhPUklaT05UQUxfUlVMRVIpOworICAgICAgICAgIC8qIFByZXNlcnZlIHN1cHBvcnQgZm9y IGRlZmF1bHQgYmVoYXZpb3Igc3VjaCB0aGF0IGEgdXNlciBtYXkKKyAgICAgICAgICBzcGVjaWZ5 IHRoZSBoZWlnaHQgb2YgYW4gTUNfSEJBUiwgd2hpY2ggYmVnaW5zIGl0cyBqb3VybmV5CisgICAg ICAgICAgYXMgdGhlIGBjdXJzb3Jfd2lkdGgnLiAgYG1jX2dldF9jdXJzb3JfZ2VvbWV0cnknIHJl YWRqdXN0cy4gKi8KKyAgICAgICAgICBtY19lbmdpbmUgKHcsIG1hdHJpeCwgcm93LCBzdGFydCwg VEVYVF9BUkVBLCB4LCB4X2xpbWl0LCByb3ctPnksCisgICAgICAgICAgICAgICAgICAgICBzdGFy dCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sIHZwb3MsIE1DX0hCQVIsIDEsCisgICAgICAgICAg ICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGxzbF9m ZywKKyAgICAgICAgICAgICAgICAgICAgIEhPUklaT05UQUxfUlVMRVIsIGRyYXdfcCwgZnJvbV93 aGVyZSwgQ0hfQ0FDSEUpOworICAgICAgICB9CisgICAgICBpZiAoIU5JTFAgKEJWQVIgKGIsIGNy b3NzaGFpcnMpKQorICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxl cikpCisgICAgICAgICAgJiYgKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgfHwg KCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAo YiwgY2hfaW5hY3RpdmVfd2luZG93cykpKSkKKyAgICAgICAgICAmJiAhZmlsbF9jb2x1bW5fdHJ1 bXBzX3ApCisgICAgICAgIHsKKyAgICAgICAgICBjdXJzb3JfdHlwZSA9IChzdGFydC0+dHlwZSA9 PSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfSE9MTE9XX0JPWAor ICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19CQVI7CisgICAgICAgICAgaW50IHhfbGltaXQg PSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOworICAgICAgICAgIGJvb2wgcmVhbF9m YWtlX2N1cnNvcl9wID0gKHctPmN1cnNvci55ID09IHJvdy0+eQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAg IHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAgICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywgc3Rh cnQsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0xLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgVkVSVElDQUxfUlVMRVIpOworICAgICAgICAgIGlm ICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICB8 fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAgJiYgKChzdGFydCAhPSBy b3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxCisgICAgICAg ICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0geAorICAgICAgICAgICAgICAgICAgICYmIHct PmN1cnNvci54IDwgeCArIHN0YXJ0LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgIHx8 IChzdGFydCA9PSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0g LSAxCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0geCkpCisgICAgICAg ICAgICAgICYmIHJvdy0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAg ICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0 cml4LCByb3csIHN0YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGltaXQsIHJvdy0+eSwKKyAgICAgICAg ICAgICAgICAgICAgICAgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLCB2cG9zLCBjdXJz b3JfdHlwZSwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50 aWFscywgcm93X3Bvc2l0aW9uLCBsc2xfZmcsCisgICAgICAgICAgICAgICAgICAgICAgIFZFUlRJ Q0FMX1JVTEVSLCBkcmF3X3AsIGZyb21fd2hlcmUsIENIX0NBQ0hFKTsKKyAgICAgICAgfQorICAg IH0KKyAgICBlbHNlCisgICAgICB7CisgICAgICAgIGludCByZWxhdGl2ZV94ID0gMDsKKyAgICAg ICAgZm9yIChpbnQgYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFyZWEgPCBMQVNUX0FSRUE7ICsr YXJlYSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoID0gcm93 LT5nbHlwaHNbYXJlYV07CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoX2VuZCA9IGds eXBoICsgcm93LT51c2VkW2FyZWFdOworICAgICAgICAgICAgLyogR2x5cGggZm9yIGEgbGluZSBl bmQgaW4gdGV4dC4gKi8KKyAgICAgICAgICAgIGlmIChhcmVhID09IFRFWFRfQVJFQSAmJiBnbHlw aCA9PSBnbHlwaF9lbmQgJiYgZ2x5cGgtPmNoYXJwb3MgPiAwKQorICAgICAgICAgICAgICArK2ds eXBoX2VuZDsKKyAgICAgICAgICAgIGZvciAoOyBnbHlwaCA8IGdseXBoX2VuZDsgKytnbHlwaCkK KyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmICh2cG9zICE9IHctPmN1cnNvci52 cG9zCisgICAgICAgICAgICAgICAgICAgICYmIGdseXBoICE9IGdseXBoX2VuZCAtIDEKKyAgICAg ICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194IDwgcmVsYXRpdmVfeAorICAgICAgICAg ICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA8IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAg ICAgJiYgTklMUCAoQlZBUiAoYiwgbWNfY29uZikpKQorICAgICAgICAgICAgICAgICAgYnJlYWs7 CisgICAgICAgICAgICAgICAgaWYgKCFOSUxQIChCVkFSIChiLCBtY19jb25mKSkKKyAgICAgICAg ICAgICAgICAgICAgJiYgKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAg ICAgIHx8ICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmICFOSUxQIChCVkFSIChiLCBtY19pbmFjdGl2ZV93aW5kb3dzKSkpKSkKKyAgICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLyogVGhlIHNwYWNlIGFwcGVuZGVkIHRvIGEg cm93IGVuZGluZyB3aXRoIGEgbmV3IGxpbmUgZG9lcworICAgICAgICAgICAgICAgICAgICBub3Qg aGF2ZSBhIGBnbHlwaC0+Y2hhcnBvc2AgKC0xLCAwKSB0aGF0IHdlIGNhbiB1c2UgZm9yIHRoaXMK KyAgICAgICAgICAgICAgICAgICAgcGFydGljdWxhciBhcHBsaWNhdGlvbi4gIFdoZW4gYSBgYnVm ZmVyLWRpc3BsYXktdGFibGUnIGVudHJ5CisgICAgICAgICAgICAgICAgICAgIGFzc2lnbnMgYSB2 aXNpYmxlIGdseXBoIHRvIGEgbmV3IGxpbmUsIHRoZXJlIGlzIG5vIHByb2JsZW0KKyAgICAgICAg ICAgICAgICAgICAgYmVjYXVzZSB0aGF0IGdseXBoIGhhcyBhIGBnbHlwaC0+Y2hhcnBvcycgdGhh dCB3ZSBjYW4gdXNlLgorICAgICAgICAgICAgICAgICAgICBXaGVuIG5vIHZpc2libGUgRU9MIGds eXBoIGV4aXN0cywgd2UgdXNlIHRoZSBmb2xsb3dpbmcgdGVzdDoKKyAgICAgICAgICAgICAgICAg ICAgdGhlIGFwcGVuZGVkIHNwYWNlIGhhcyBhIHBvc2l0aW9uIHRoYXQgaXMgb25lIGxlc3MgdGhh biB0aGUKKyAgICAgICAgICAgICAgICAgICAgZW5kIG9mIHRoZSBtYXRyaXggcm93LiAqLworICAg ICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVB XTsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoICpwcmV2aW91c19nbHlwaCA9ICgw IDw9IGhwb3MgLSAxICYmIGhwb3MgLSAxIDwgcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IHJvdy0+Z2x5cGhz W1RFWFRfQVJFQV0gKyBocG9zIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiBOVUxMOworICAgICAgICAgICAgICAgICAgICAvLyBzdHJ1Y3Qg Z2x5cGggKmxhc3RfZ2x5cGggPSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RF WFRfQVJFQV0gLSAxOworICAgICAgICAgICAgICAgICAgICBib29sIHNraXBfcCA9IChwcmV2aW91 c19nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHBy ZXZpb3VzX2dseXBoLT5jaGFycG9zID09IE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgLSAx CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT5ieXRlcG9zICE9 IGVzc2VudGlhbHMuenZfYnl0ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gdHJ1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFdoZW4gYSBgYnVm ZmVyLWRpc3BsYXktdGFibGUnIGVudHJ5IGNvbnRhaW5zCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgYSB2aXNpYmxlIHRhYiBjaGFyYWN0ZXIgKCLCuyIpLCB0aGUgc3Vic2VxdWVu dAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNUUkVUQ0hfR0xZUEggd2lsbCBo YXZlIHRoZSBzYW1lIGdseXBoLT5jaGFycG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgYXMgdGhlIGFmb3JlbWVudGlvbmVkIHZpc2libGUgdGFiIGNoYXJhY3Rlci4gKi8KKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChwcmV2aW91c19nbHlwaCAhPSBOVUxM CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcHJldmlvdXNfZ2x5cGgt PmNoYXJwb3MgPT0gZ2x5cGgtPmNoYXJwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IHRydWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGZhbHNl OworICAgICAgICAgICAgICAgICAgICBpbnQgcG9zaW50ID0gKHJvd19wb3NpdGlvbiA9PSBQT1NU X1pWKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IC0xCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IChyb3dfcG9zaXRpb24gPT0gQVRfWlYpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGVzc2VudGlhbHMuenYKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoLT5ieXRlcG9zICE9IGVzc2VudGlhbHMuenZf Ynl0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGggLSByb3ct PmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cp IC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGgtPmJ5dGVwb3Mg PT0gZXNzZW50aWFscy56dl9ieXRlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW1RFWFRfQVJF QV0gLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGVzc2VudGlhbHMu enYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogZ2x5cGgtPmNoYXJwb3M7Cisg ICAgICAgICAgICAgICAgICAgIExpc3BfT2JqZWN0IHNwZWNzID0gbWNfYXNzb2MgKG1ha2VfZml4 bnVtIChwb3NpbnQpLCBCVkFSIChiLCBtY19jb25mKSk7CisgICAgICAgICAgICAgICAgICAgIGlm ICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICAg ICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAgICAgICAg ICAgICAmJiAhTklMUCAoc3BlY3MpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnkg PD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAh c2tpcF9wCisgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gIT0gUE9TVF9a VikKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBMaXNw X09iamVjdCBsaXNwX3R5cGUgPSBtY19udGggKDEsIHNwZWNzKTsKKyAgICAgICAgICAgICAgICAg ICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUgPSAoQ09OU1AgKGxpc3BfdHlw ZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBtY19saXNwX3RvX2N1cnNvcl90eXBlIChYQ0FSIChsaXNwX3R5cGUpKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogbWNf bGlzcF90b19jdXJzb3JfdHlwZSAobGlzcF90eXBlKTsKKyAgICAgICAgICAgICAgICAgICAgICAg IGN1cnNvcl90eXBlID0gKGdseXBoLT50eXBlID09IElNQUdFX0dMWVBIKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0hPTExPV19CT1gKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiBjdXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAgICAg ICAgICAgIGludCBjdXJzb3Jfd2lkdGggPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBYRklYTlVNIChYQ0FSIChYQ0RSIChs aXNwX3R5cGUpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IC0xOworICAgICAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3QgbWNfZm9yZWdyb3VuZCA9 IG1jX250aCAoMiwgc3BlY3MpOworICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JH QiBsc2xfZmc7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoU1RSSU5HUCAobWNfZm9yZWdy b3VuZCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX3h3X2NvbG9yX3ZhbHVlcyAodywg bWNfZm9yZWdyb3VuZCwgJmxzbF9mZyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Ug aWYgKFZFQ1RPUlAgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxzbF9mZy5yZWQgPSBYRkxPQVRfREFU QSAoQVJFRiAobWNfZm9yZWdyb3VuZCwgMCkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgbHNsX2ZnLmdyZWVuID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDEpKTsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxzbF9mZy5ibHVlID0gWEZMT0FUX0RBVEEg KEFSRUYgKG1jX2ZvcmVncm91bmQsIDIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoTklMUCAobWNfZm9yZWdyb3Vu ZCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtY19jb2xvcl9waWNrZXIgKHcsIGds eXBoLCBlc3NlbnRpYWxzLCAmbHNsX2ZnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBwb3NpbnQsIGN1cnNvcl90eXBlLCByb3dfcG9zaXRpb24sCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1VTFRJUExFX0NVUlNP UlMpOworICAgICAgICAgICAgICAgICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1Mg KHJvdywgbWF0cml4KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gd2lu ZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1j X2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4X2xpbWl0LCByb3ctPnksIGdseXBoIC0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg dnBvcywgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgY3Vyc29yX21hdHJpeCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBsc2xf ZmcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1VTFRJUExFX0NVUlNPUlMs IGRyYXdfcCwgZnJvbV93aGVyZSwgTUNfQ0FDSEUpOworICAgICAgICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKGIs IGZjX3Zpc2libGUpKQorICAgICAgICAgICAgICAgICAgICAmJiAoZXNzZW50aWFscy5hY3RpdmVf cAorICAgICAgICAgICAgICAgICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGZjX2luYWN0aXZlX3dp bmRvd3MpKSkpCisgICAgICAgICAgICAgICAgICAgIC8vICYmIGVzc2VudGlhbHMuZmNfeCA8PSB0 ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194IDwg dGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+ PSB3LT5tYy5sbnVtX3BpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgICBpbnQgeF9saW1pdCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7 CisgICAgICAgICAgICAgICAgICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKHctPmN1cnNv ci54ID09IGVzc2VudGlhbHMuZmNfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueSA9PSByb3ctPnkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gZ2x5cGgg LSByb3ctPmdseXBoc1tURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAgICAg ICAgICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAg ICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgICAgICAgICAg IG1jX2NvbG9yX3BpY2tlciAodywgZ2x5cGgsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0xLCBNQ19C QVIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93X3Bvc2l0aW9uLCBG SUxMX0NPTFVNTik7CisgICAgICAgICAgICAgICAgICAgIGlmIChocG9zID49IGhwb3Nfc3RhcnQK KyAgICAgICAgICAgICAgICAgICAgICAgICYmIGhwb3MgPCBocG9zX3N0YXJ0ICsgaHBvc19sZW5n dGgKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vICYmIHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4 ZWxfd2lkdGggPD0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAmJiBy ZWxhdGl2ZV94IDwgdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAo KGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAgICAgICAg ICAgICAmJiAoKGdseXBoICE9IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgZXNzZW50aWFscy5mY194ID49IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194IDwgcmVsYXRpdmVfeCArIGdseXBoLT5waXhl bF93aWR0aCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAoZ2x5cGggPT0gZ2x5cGhf ZW5kIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZj X3ggPj0gcmVsYXRpdmVfeCkpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnkgPD0g d2luZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcmVh bF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0 cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4X2xpbWl0LAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgcm93LT55LCBocG9zLCB2cG9zLCBNQ19CQVIsIDEsIGN1cnNv cl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLCBy b3dfcG9zaXRpb24sIGxzbF9mZywgRklMTF9DT0xVTU4sCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBkcmF3X3AsIGZyb21fd2hlcmUsIEZDX0NBQ0hFKTsKKyAgICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKQor ICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfaG9yaXpvbnRhbF9ydWxl cikpCisgICAgICAgICAgICAgICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAg ICAgICAgICAgICAgICAgICB8fCAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfaW5hY3RpdmVfd2luZG93cykpKSkK KyAgICAgICAgICAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcykKKyAgICAgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaW50IHhfbGltaXQgPSB3aW5kb3dfYm94 X3dpZHRoICh3LCBURVhUX0FSRUEpOworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGds eXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0 IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgICAgICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywg Z2x5cGgsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0xLCBNQ19IQkFSLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgSE9SSVpPTlRBTF9SVUxFUik7Cisg ICAgICAgICAgICAgICAgICAgIC8qIFByZXNlcnZlIHN1cHBvcnQgZm9yIGRlZmF1bHQgYmVoYXZp b3Igc3VjaCB0aGF0IGEgdXNlciBtYXkKKyAgICAgICAgICAgICAgICAgICAgc3BlY2lmeSB0aGUg aGVpZ2h0IG9mIGFuIE1DX0hCQVIsIHdoaWNoIGJlZ2lucyBpdHMgam91cm5leQorICAgICAgICAg ICAgICAgICAgICBhcyB0aGUgYGN1cnNvcl93aWR0aCcuICBgbWNfZ2V0X2N1cnNvcl9nZW9tZXRy eScgcmVhZGp1c3RzLiAqLworICAgICAgICAgICAgICAgICAgICBpZiAoaHBvcyA+PSBocG9zX3N0 YXJ0CisgICAgICAgICAgICAgICAgICAgICAgICAmJiBocG9zIDwgaHBvc19zdGFydCArIGhwb3Nf bGVuZ3RoKQorICAgICAgICAgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3cs IGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4X2xpbWl0LAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgcm93LT55LCBocG9zLCB2cG9zLCBNQ19IQkFSLCAxLCBjdXJzb3JfbWF0cml4 LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscywgcm93X3Bvc2l0 aW9uLCBsc2xfZmcsIEhPUklaT05UQUxfUlVMRVIsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBkcmF3X3AsIGZyb21fd2hlcmUsIENIX0NBQ0hFKTsKKyAgICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAg ICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQor ICAgICAgICAgICAgICAgICAgICAmJiAoZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAg ICAgICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkpCisgICAg ICAgICAgICAgICAgICAgICYmICFmaWxsX2NvbHVtbl90cnVtcHNfcCkKKyAgICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUgPSAoZ2x5cGgtPnR5cGUgPT0g SU1BR0VfR0xZUEgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19IT0xM T1dfQk9YCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19CQVI7CisgICAg ICAgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9B UkVBKTsKKyAgICAgICAgICAgICAgICAgICAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3AgPSAody0+ Y3Vyc29yLnkgPT0gcm93LT55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIHctPmN1cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAgICAgICAgICAg ICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICAg ICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgICAgICAgICAgIG1jX2Nv bG9yX3BpY2tlciAodywgZ2x5cGgsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0xLCBjdXJzb3JfdHlw ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb3dfcG9zaXRpb24sIFZF UlRJQ0FMX1JVTEVSKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGhwb3MgPj0gaHBvc19zdGFy dAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA8IGhwb3Nfc3RhcnQgKyBocG9zX2xl bmd0aAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKChoZWFkZXJfbGluZV9mb3JtYXQgPiAw ICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5l X2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKChnbHlwaCAhPSBnbHlw aF9lbmQgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49 IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLngg PCByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHx8IChnbHlwaCA9PSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHJlbGF0aXZlX3gpKQorICAgICAgICAgICAgICAg ICAgICAgICAgJiYgcm93LT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAgICAg ICAgICAgICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgICAgICAg ICAgICBtY19lbmdpbmUgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgYXJlYSwgcmVsYXRpdmVfeCwg eF9saW1pdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvdy0+eSwgaHBvcywg dnBvcywgY3Vyc29yX3R5cGUsIDEsIGN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGxzbF9mZywgVkVSVElDQUxf UlVMRVIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3X3AsIGZyb21fd2hl cmUsIENIX0NBQ0hFKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZWxh dGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAg IH0KKyAgICAgIH0KKyAgLy8gIGNsb2NrX3QgY2xvY2tfZW5kID0gY2xvY2soKTsKKyAgLy8gIGRv dWJsZSBjcHVfdGltZV91c2VkID0gKChkb3VibGUpIChjbG9ja19lbmQgLSBjbG9ja19zdGFydCkp IC8gQ0xPQ0tTX1BFUl9TRUM7CisgIC8vICBmcHJpbnRmIChzdGRlcnIsICJtY19kcmF3X3JvdyAo JXMpOiAgVElNRSAoJWYpXG4iLCBtY193aW5kb3cgKHcpLCBjcHVfdGltZV91c2VkKTsKK30KKwor Ym9vbAorbWNfcmVkcmF3X3JvdyAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJp eCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICBlbnVtIGds eXBoX3Jvd19hcmVhIGFyZWEsIGludCBzdGFydF94LCBpbnQgc3RhcnRfaHBvcywgaW50IGVuZF9o cG9zLAorICAgICAgICAgICAgICAgYm9vbCBjbGVhcl9lb2xfcCwgZW51bSBkcmF3X2dseXBoc19m YWNlIGhsLAorICAgICAgICAgICAgICAgZW51bSBtY19yZWRyYXdfcm93X3R5cGUgZnJvbV93aGVy ZSkKK3sKKyAgYm9vbCBnb19wID0gKCh3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW01DX0NBQ0hF XSA+IDAKKyAgICAgICAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0NIX0NB Q0hFXSA+IDAKKyAgICAgICAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0ZD X0NBQ0hFXSA+IDApCisgICAgICAgICAgICAgICAmJiBhcmVhID09IFRFWFRfQVJFQQorICAgICAg ICAgICAgICAgJiYgcm93LT51c2VkW2FyZWFdKTsKKyAgaWYgKCFnb19wKQorICAgIHJldHVybiBm YWxzZTsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAg aW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgaWYgKG1jX3N0ZGVy cl9wKQorICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX3JlZHJhd19yb3cgKCVkKTogICVzXG5cCisg IHN0YXJ0X3ggKCVkKSB8IHN0YXJ0X2hwb3MgKCVkKSB8IGVuZF9ocG9zICglZClcbiIsCisgIHZw b3MsIG1jX3JlZHJhd19yb3dfdHlwZV90b19zdHJpbmcgKGZyb21fd2hlcmUpLCBzdGFydF94LCBz dGFydF9ocG9zLCBlbmRfaHBvcyk7CisgIHN0cnVjdCBtY19SR0IgbHNsID0gey5yZWQgPSAtMS4w LCAuZ3JlZW4gPSAtMS4wLCAuYmx1ZSA9IC0xLjB9OworICBl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hcl9lb2xfcAorICAgICAgJiYgZW5kX2hwb3MgPiBzdGFydF9ocG9zKQorICAgIHsKKyAg ICAgIC8qIEFkdmFuY2UgdGhlIG91dHB1dCBjdXJzb3IuICovCisgICAgICB3LT5vdXRwdXRfY3Vy c29yLmhwb3MgPSBlbmRfaHBvczsKKyAgICAgIHctPm91dHB1dF9jdXJzb3IueCA9IHg7CisgICAg ICBGUkFNRV9SSUYgKGYpLT5jbGVhcl9lbmRfb2ZfbGluZSAodywgcm93LCBURVhUX0FSRUEsIC0x KTsKKyAgICB9CisgIC8vICBjbG9ja19zdGFydCA9IGNsb2NrKCk7CisgIGludCB2bnRoID0gTUFU UklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgIC8qIFNUUkVUQ0hfR0xZUEggbWF5IGNvbnRh aW4gbW9yZSB0aGFuIG9uZSBmYWtlIGN1cnNvciBhdCB0aGUgc2FtZSBIUE9TLiAqLworICBmb3Ig KGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7CisgICAgICAgY2FjaGVf dHlwZSA8IE5PX0NBQ0hFOworICAgICAgICsrY2FjaGVfdHlwZSkKKyAgICB7CisgICAgICBmb3Ig KGludCBudGggPSAwOworICAgICAgICAgICBtY190cmF2ZXJzZV9jYWNoZV9wICh3LT5tY19tYXRy aXgsIGNhY2hlX3R5cGUsIHZudGgsIG50aCk7CisgICAgICAgICAgICsrbnRoKQorICAgICAgICB7 CisgICAgICAgICAgaW50IHggPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhdLng7CisgICAgICAgICAgaW50IGZ4ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5meDsKKyAgICAgICAgICBpbnQgeSA9IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ueTsKKyAgICAgICAgICBpbnQgZnkg PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZ5OworICAg ICAgICAgIGludCBocG9zID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXS5ocG9zOworICAgICAgICAgIGludCB2cG9zID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS52cG9zOworICAgICAgICAgIGludCB3ZCA9IHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ud2Q7CisgICAgICAgICAg aW50IGggPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmg7 CisgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSA9IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uY3Vyc29yX3R5cGU7CisgICAgICAg ICAgaW50IGN1cnNvcl93aWR0aCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF0uY3Vyc29yX3dpZHRoOworICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2Zn ID0gey5yZWQgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhd LmZnLnJlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZnLmdyZWVuLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5mZy5ibHVlfTsKKyAgICAgICAgICAvLyAgc3Ry dWN0IG1jX1JHQiBsc2xfYmcgPSB7LnJlZCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF0uYmcucmVkLAorICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAg ICAgICAgICAuZ3JlZW4gPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLmJnLmdyZWVuLAorICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAu Ymx1ZSA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmcu Ymx1ZX07CisgICAgICAgICAgYm9vbCBhY3RpdmVfcCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYWN0aXZlX3A7CisgICAgICAgICAgZW51bSBtY19mbGF2 b3IgZ2x5cGhfZmxhdm9yID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXS5nbHlwaF9mbGF2b3I7CisgICAgICAgICAgYm9vbCBlbmFibGVkX3AgPSB3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmVuYWJsZWRfcDsKKyAgICAg ICAgICBpZiAodnBvcyA9PSB2bnRoCisgICAgICAgICAgICAgICYmICgoaHBvcyA+PSBzdGFydF9o cG9zCisgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA8IGVuZF9ocG9zKQorICAgICAgICAgICAg ICAgICAgLyogQSBmbG9hdGluZyBjdXJzb3IgYmV5b25kIHRoZSBlbmQgb2YgdGhlIGdseXBoIHJv dy4gKi8KKyAgICAgICAgICAgICAgICAgIHx8IChocG9zICsgMSA9PSBzdGFydF9ocG9zCisgICAg ICAgICAgICAgICAgICAgICAgJiYgaHBvcyArIDEgPT0gZW5kX2hwb3MpKQorICAgICAgICAgICAg ICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGJvb2wgcmVtb3Zl X3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHcsIG1hdHJp eCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgbHNsX2ZnLCBh Y3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZv ciwgcmVtb3ZlX3ApOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICByZXR1cm4g dHJ1ZTsKKyAgLy8gIGNsb2NrX2VuZCA9IGNsb2NrKCk7CisgIC8vICBkb3VibGUgdGltZV9jdXJz b3JzID0gKChkb3VibGUpIChjbG9ja19lbmQgLSBjbG9ja19zdGFydCkpIC8gQ0xPQ0tTX1BFUl9T RUM7CisgIC8vICBmcHJpbnRmIChzdGRlcnIsICJtY19yZWRyYXdfcm93ICglZCk6ICBocG9zICgl ZC8lZCkgfCBnbHlwaHMgKCVmKSB8IGN1cnNvcnMgKCVmKVxuIiwKKyAgLy8gICAgICAgICAgICAg ICAgICAgdnBvcywgc3RhcnRfaHBvcywgZW5kX2hwb3MsIHRpbWVfZ2x5cGhzLCB0aW1lX2N1cnNv cnMpOworfQorCit2b2lkCittY19lcmFzZV9yb3cgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBn bHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93KQoreworICBpbnQgdm50 aCA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICBpZiAobWNfc3RkZXJyX3ApCisg ICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZXJhc2Vfcm93ICglcyk6ICB2cG9zICglZClcbiIsIG1j X3dpbmRvdyAodyksIHZudGgpOworICAvLyAgaWYgKG1jX3N0ZGVycl9wKQorICAvLyAgICBmcHJp bnRmIChzdGRlcnIsICJtY19lcmFzZV9oZWxwZXIgKCVzKTogIGNhY2hlICglcykgfCB2cG9zICgl ZClcbiIsCisgIC8vICAgICAgbWNfd2luZG93ICh3KSwgbWNfY2FjaGVfdHlwZV90b19zdHJpbmcg KGNhY2hlX3R5cGUpLCB2bnRoKTsKKyAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlw ZSA9IE1DX0NBQ0hFOworICAgICAgIGNhY2hlX3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICArK2Nh Y2hlX3R5cGUpCisgICAgeworICAgICAgZm9yIChpbnQgbnRoID0gMDsKKyAgICAgICAgICAgbWNf dHJhdmVyc2VfY2FjaGVfcCAody0+bWNfbWF0cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGgpOwor ICAgICAgICAgICArK250aCkKKyAgICAgICAgeworICAgICAgICAgIGludCB4ID0gdy0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS54OworICAgICAgICAgIGludCBm eCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZng7Cisg ICAgICAgICAgaW50IHkgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLnk7CisgICAgICAgICAgaW50IGZ5ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXS5meTsKKyAgICAgICAgICBpbnQgaHBvcyA9IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uaHBvczsKKyAgICAgICAgICBpbnQg dnBvcyA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0udnBv czsKKyAgICAgICAgICBpbnQgd2QgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhdLndkOworICAgICAgICAgIGludCBoID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5oOworICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5 cGUgY3Vyc29yX3R5cGUgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLmN1cnNvcl90eXBlOworICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGggPSB3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmN1cnNvcl93aWR0aDsKKyAg ICAgICAgICAvLyAgc3RydWN0IG1jX1JHQiBsc2xfZmcgPSB7LnJlZCA9IHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZmcucmVkLAorICAgICAgICAgIC8vICAg ICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLmZnLmdyZWVuLAorICAgICAgICAgIC8vICAgICAgICAgICAg ICAgICAgICAgICAgICAuYmx1ZSA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF0uZmcuYmx1ZX07CisgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfYmcgPSB7 LnJlZCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmcu cmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IHctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmcuZ3JlZW4sCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLmJsdWV9OworICAgICAgICAgIGJvb2wgYWN0aXZl X3AgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmFjdGl2 ZV9wOworICAgICAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGhfZmxhdm9yOworICAgICAg ICAgIGJvb2wgZW5hYmxlZF9wID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXS5lbmFibGVkX3A7CisgICAgICAgICAgLyogYG1hdHJpeF9yb3cnIGluIGBkaXNw bmV3LmNgIGNvbnRhaW5zIHRoZSBmb2xsb3dpbmcgdGVzdHMsCisgICAgICAgICAgZWFzc2VydCAo bWF0cml4ICYmIG1hdHJpeC0+cm93cyk7CisgICAgICAgICAgZWFzc2VydCAocm93ID49IDAgJiYg cm93IDwgbWF0cml4LT5ucm93cyk7ICovCisgICAgICAgICAgYm9vbCBiYXJmX2NyYXNoX29uZSA9 IChtYXRyaXggJiYgbWF0cml4LT5yb3dzKSA/IGZhbHNlIDogdHJ1ZTsKKyAgICAgICAgICBpZiAo YmFyZl9jcmFzaF9vbmUpCisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICBib29sIGJh cmZfY3Jhc2hfdHdvID0gKHZwb3MgPj0gMCAmJiB2cG9zIDwgbWF0cml4LT5ucm93cykgPyBmYWxz ZSA6IHRydWU7CisgICAgICAgICAgaWYgKGJhcmZfY3Jhc2hfdHdvKQorICAgICAgICAgICAgY29u dGludWU7CisgICAgICAgICAgaWYgKHZwb3MgPT0gdm50aAorICAgICAgICAgICAgICAmJiBnbHlw aF9mbGF2b3IgPT0gTUNfR0xZUEgKKyAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICBtY19lcmFzZV9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4 LCB5LCBocG9zLCB2cG9zLCBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCk7CisgICAgICAg ICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZW5h YmxlZF9wID0gZmFsc2U7CisgICAgICAgICAgICAgIC0tdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNl ZFtjYWNoZV90eXBlXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKHZwb3Mg PT0gdm50aAorICAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgYm9vbCByZW1vdmVfcCA9IHRydWU7CisgICAgICAgICAgICAg ICAgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhw b3MsIHZwb3MsIHdkLCBoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBj dXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBsc2xfYmcsIGFjdGl2ZV9wLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaF9mbGF2b3IsIHJlbW92ZV9wKTsKKyAgICAg ICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhd LmVuYWJsZWRfcCA9IGZhbHNlOworICAgICAgICAgICAgICAgIC0tdy0+bWNfbWF0cml4Lm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ucm93c19zY3JvbGxlZCwgZW51bSBtY19wcmVfc2Nyb2xs X2NsZWFuX3R5cGUgZnJvbV93aGVyZSkKK3sKKyAgaWYgKE1JTklfV0lORE9XX1AgKHcpKQorICAg IHJldHVybjsKKyAgYm9vbCBnb19vbmVfcCA9ICh3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW01D X0NBQ0hFXSA+IDAKKyAgICAgICAgICAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191 c2VkW0NIX0NBQ0hFXSA+IDAKKyAgICAgICAgICAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vy c29yc191c2VkW0ZDX0NBQ0hFXSA+IDApOworICBib29sIGdvX3R3b19wID0gKEJVRkZFUlAgKHct PmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICYmICghTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpCisgICAgICAgICAg ICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2Nv bmYpKSkpOworICBpZiAobWNfc3RkZXJyX3ApCisgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfcHJl X3Njcm9sbF9jbGVhbiAoJXMpOlxuXAorICAlcyB8IGdvX29uZV9wICglcykgfCBnb190d29fcCAo JXMpXG5cCisgIHN0YXJ0X3Zwb3MgKCVkKSB8IG5yb3dzX3Njcm9sbGVkICglZClcblwKKyAgJXM6 ICBydW4uY3VycmVudC9kZXNpcmVkX3kgKCVkLyVkKSB8IHJ1bi5oZWlnaHQgKCVkKVxuIiwKKyAg ICBtY193aW5kb3cgKHcpLCAoZnJvbV93aGVyZSA9PSBUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVO VF9NQVRSSVhfRE9XTikKKyAgICAgICAgICAgICAgICAgICAgID8gIlRSWV9XSU5ET1dfUkVVU0lO R19DVVJSRU5UX01BVFJJWF9ET1dOIgorICAgICAgICAgICAgICAgICAgIDogKGZyb21fd2hlcmUg PT0gVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX1VQKQorICAgICAgICAgICAgICAg ICAgICAgPyAiVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX1VQIgorICAgICAgICAg ICAgICAgICAgIDogKGZyb21fd2hlcmUgPT0gVFJZX1dJTkRPV19JRCkKKyAgICAgICAgICAgICAg ICAgICAgID8gIlRSWV9XSU5ET1dfSUQiCisgICAgICAgICAgICAgICAgICAgOiAiVU5LTk9XTiIs CisgICAgZ29fb25lX3AgPyAieWVzIiA6ICJubyIsIGdvX3R3b19wID8gInllcyIgOiAibm8iLAor ICAgIHN0YXJ0X3Zwb3MsIG5yb3dzX3Njcm9sbGVkLAorICAgIHJ1bi5jdXJyZW50X3kgPCBydW4u ZGVzaXJlZF95ID8gIuKGkyIgOiAi4oaRIiwKKyAgICBydW4uY3VycmVudF95LCBydW4uZGVzaXJl ZF95LCBydW4uaGVpZ2h0KTsKKyAgaWYgKCFnb19vbmVfcCAmJiAhZ29fdHdvX3ApCisgICAgcmV0 dXJuOworICBib29sIHVwZGF0aW5nX2ZyYW1lX3AgPSBmYWxzZTsKKyAgc3RydWN0IGZyYW1lICpm ID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIGlmIChYRlJBTUUgKHctPmZyYW1lKSAhPSBmLT5tY191 cGRhdGluZ19mcmFtZQorICAgICAgJiYgKGdvX29uZV9wIHx8IGdvX3R3b19wKSkKKyAgICB7Cisg ICAgICB1cGRhdGluZ19mcmFtZV9wID0gdHJ1ZTsKKyAgICAgIHVwZGF0ZV9iZWdpbiAoZik7Cisg ICAgfQorICBpZiAody0+cGh5c19jdXJzb3Jfb25fcAorICAgICAgJiYgZ29fdHdvX3ApCisgICAg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RS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKworCiAMCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKIAkJICAgICAgV2luZG93IGRpc3BsYXkg ZGltZW5zaW9ucwpAQCAtMTM1MTEsNiArMTgzOTUsNjkgQEAgaHNjcm9sbF93aW5kb3dfdHJlZSAo TGlzcF9PYmplY3Qgd2luZG93KQogCSAgICAgIGVsc2UKIAkJcHQgPSBjbGlwX3RvX2JvdW5kcyAo QkVHViwgbWFya2VyX3Bvc2l0aW9uICh3LT5wb2ludG0pLCBaVik7CiAKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIChnZGIpIGJ0 CisjMCAgdGVybWluYXRlX2R1ZV90b19zaWduYWwgKHNpZz02LCBiYWNrdHJhY2VfbGltaXQ9MjE0 NzQ4MzY0NykgYXQgZW1hY3MuYzozNTkKKyMxICAweDAwMDAwMDAxMDAxZWU5OTYgaW4gZGllICgK KyAgICBtc2c9MHgxMDAzMmZjODggImNoYXJwb3MgPCAwIHx8IChjaGFycG9zID49IEJVRl9CRUcg KGN1cnJlbnRfYnVmZmVyKSAmJiBjaGFycG9zIDw9IFpWKSIsIGZpbGU9MHgxMDAzMmUzMmQgInhk aXNwLmMiLCBsaW5lPTc5NTEpIGF0IGFsbG9jLmM6NzIxNAorIzIgIDB4MDAwMDAwMDEwMDA0ZDJh YiBpbiBpbml0X2l0ZXJhdG9yIChpdD0weDdmZmY1ZmJmOWU4MCwgdz0weDExYWU2MjE1MCwKKyAg ICBjaGFycG9zPTc0MywgYnl0ZXBvcz03NDMsIHJvdz0weDA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tPnBvcyk7CisKKyAgYm9vbCBiYXJm X2NyYXNoX29uZSA9IChjaGFycG9zIDwgMAorICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChj aGFycG9zID49IEJVRl9CRUcgKGN1cnJlbnRfYnVmZmVyKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBjaGFycG9zIDw9IFpWKSkKKyAgICAgICAgICAgICAgICAgICAgICAgID8gZmFs c2UKKyAgICAgICAgICAgICAgICAgICAgICAgIDogdHJ1ZTsKKyAgaWYgKGJhcmZfY3Jhc2hfb25l KQorICAgIHJldHVybiBoc2Nyb2xsZWRfcDsKKworICAvKiBgcmVzZWF0XzEnOiAgQ0hBUlBPUyAo cG9zKSA+PSBCRUdWICYmIENIQVJQT1MgKHBvcykgPD0gWlYgKi8KKyAgYm9vbCBiYXJmX2NyYXNo X3R3byA9IChjaGFycG9zID49IEJFR1YgJiYgY2hhcnBvcyA8PSBaVikKKyAgICAgICAgICAgICAg ICAgICAgICAgICA/IGZhbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgOiB0cnVlOworICBp ZiAoYmFyZl9jcmFzaF90d28pCisgICAgcmV0dXJuIGhzY3JvbGxlZF9wOworCisvKiBlbmQgTVVM VElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgICAgIC8q IE1vdmUgaXRlcmF0b3IgdG8gcHQgc3RhcnRpbmcgYXQgY3Vyc29yX3Jvdy0+c3RhcnQgaW4KIAkJ IGEgbGluZSB3aXRoIGluZmluaXRlIHdpZHRoLiAgKi8KIAkgICAgICBpbml0X3RvX3Jvd19zdGFy dCAoJml0LCB3LCBjdXJzb3Jfcm93KTsKQEAgLTE0Mzk3LDkgKzE5MzQ0LDIyIEBAIHJlZGlzcGxh eV9pbnRlcm5hbCAodm9pZCkKIAkgICAgICAqdy0+ZGVzaXJlZF9tYXRyaXgtPm1ldGhvZCA9IDA7 CiAJICAgICAgZGVidWdfbWV0aG9kX2FkZCAodywgIm9wdGltaXphdGlvbiAxIik7CiAjZW5kaWYK KworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwog I2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQorICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisg ICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkp CisgICAgbWNfdXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCBmYWxzZSk7CisgICAgZWxzZQogCSAg ICAgIHVwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgZmFsc2UpOwogI2VuZGlmCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKIAkgICAgICBnb3RvIHVwZGF0ZTsKIAkgICAgfQogCSAgZWxz ZQpAQCAtMTc3OTIsMTAgKzIyNzUyLDIyIEBAIHJlZGlzcGxheV93aW5kb3cgKExpc3BfT2JqZWN0 IHdpbmRvdywgYm9vbCBqdXN0X3RoaXNfb25lX3ApCiAgICAgfQogCiAjaWZkZWYgSEFWRV9XSU5E T1dfU1lTVEVNCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJT T1JTICovCisKKyAgYm9vbCBrZWVwX2N1cnJlbnRfcCA9IChqdXN0X3RoaXNfb25lX3AKKyAgICAg ICAgICAgICAgICAgICAgICAgICB8fCAoIXVzZWRfY3VycmVudF9tYXRyaXhfcCAmJiAhb3Zlcmxh eV9hcnJvd19zZWVuKQorICAgICAgICAgICAgICAgICAgICAgICAgIHx8IHctPnBzZXVkb193aW5k b3dfcCk7CisKKyAgYm9vbCBmcmluZ2VzX3VwZGF0ZWRfcCA9IChCVUZGRVJQICh3LT5jb250ZW50 cykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IG1jX3VwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywga2VlcF9jdXJyZW50X3ApCisgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IHVwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywga2VlcF9jdXJyZW50 X3ApOworCiAgIGlmIChGUkFNRV9XSU5ET1dfUCAoZikKLSAgICAgICYmIHVwZGF0ZV93aW5kb3df ZnJpbmdlcyAodywgKGp1c3RfdGhpc19vbmVfcAotCQkJCSAgICB8fCAoIXVzZWRfY3VycmVudF9t YXRyaXhfcCAmJiAhb3ZlcmxheV9hcnJvd19zZWVuKQotCQkJCSAgICB8fCB3LT5wc2V1ZG9fd2lu ZG93X3ApKSkKKyAgICAgICYmIGZyaW5nZXNfdXBkYXRlZF9wKQogICAgIHsKICAgICAgIHVwZGF0 ZV9iZWdpbiAoZik7CiAgICAgICBibG9ja19pbnB1dCAoKTsKQEAgLTE3ODEwLDYgKzIyNzgyLDkg QEAgcmVkaXNwbGF5X3dpbmRvdyAoTGlzcF9PYmplY3Qgd2luZG93LCBib29sIGp1c3RfdGhpc19v bmVfcCkKICAgICAgIHVwZGF0ZV9lbmQgKGYpOwogICAgIH0KIAorLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogICBpZiAoV0lORE9XX0JPVFRPTV9ESVZJREVSX1dJRFRIICh3KSkKICAgICBn dWlfZHJhd19ib3R0b21fZGl2aWRlciAodyk7CiAjZW5kaWYgLyogSEFWRV9XSU5ET1dfU1lTVEVN ICovCkBAIC0xODEyNSw2ICsyMzEwMCwxNiBAQCB0cnlfd2luZG93X3JldXNpbmdfY3VycmVudF9t YXRyaXggKHN0cnVjdCB3aW5kb3cgKncpCiAJICAgICAgdXBkYXRlX2JlZ2luIChmKTsKIAkgICAg ICBndWlfdXBkYXRlX3dpbmRvd19iZWdpbiAodyk7CiAJICAgICAgRlJBTUVfUklGIChmKS0+Y2xl YXJfd2luZG93X21vdXNlX2ZhY2UgKHcpOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgbWNfcHJlX3Njcm9sbF9jbGVhbiAodywgcnVu LCBzdGFydF92cG9zLCBucm93c19zY3JvbGxlZCwgVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRf TUFUUklYX0RPV04pOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAgICAgRlJB TUVfUklGIChmKS0+c2Nyb2xsX3J1bl9ob29rICh3LCAmcnVuKTsKIAkgICAgICBndWlfdXBkYXRl X3dpbmRvd19lbmQgKHcsIGZhbHNlLCBmYWxzZSk7CiAJICAgICAgdXBkYXRlX2VuZCAoZik7CkBA IC0xODI5MSw2ICsyMzI3NiwxNiBAQCB0cnlfd2luZG93X3JldXNpbmdfY3VycmVudF9tYXRyaXgg KHN0cnVjdCB3aW5kb3cgKncpCiAJICB1cGRhdGVfYmVnaW4gKGYpOwogCSAgZ3VpX3VwZGF0ZV93 aW5kb3dfYmVnaW4gKHcpOwogCSAgRlJBTUVfUklGIChmKS0+Y2xlYXJfd2luZG93X21vdXNlX2Zh Y2UgKHcpOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09S UyAqLworCisgICAgbWNfcHJlX3Njcm9sbF9jbGVhbiAodywgcnVuLCBzdGFydF92cG9zLCBucm93 c19zY3JvbGxlZCwgVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX1VQKTsKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogCSAgRlJBTUVfUklGIChmKS0+c2Nyb2xsX3J1bl9o b29rICh3LCAmcnVuKTsKIAkgIGd1aV91cGRhdGVfd2luZG93X2VuZCAodywgZmFsc2UsIGZhbHNl KTsKIAkgIHVwZGF0ZV9lbmQgKGYpOwpAQCAtMTkyNDUsNiArMjQyNDAsMTYgQEAgdHJ5X3dpbmRv d19pZCAoc3RydWN0IHdpbmRvdyAqdykKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KIAkgIGd1 aV91cGRhdGVfd2luZG93X2JlZ2luICh3KTsKIAkgIEZSQU1FX1JJRiAoZiktPmNsZWFyX3dpbmRv d19tb3VzZV9mYWNlICh3KTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJ UExFLUNVUlNPUlMgKi8KKworICAgIG1jX3ByZV9zY3JvbGxfY2xlYW4gKHcsIHJ1biwgZmlyc3Rf dW5jaGFuZ2VkX2F0X2VuZF92cG9zLCBkdnBvcywgVFJZX1dJTkRPV19JRCk7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKIAkgIEZSQU1FX1JJRiAoZiktPnNjcm9sbF9ydW5faG9vayAo dywgJnJ1bik7CiAJICBndWlfdXBkYXRlX3dpbmRvd19lbmQgKHcsIGZhbHNlLCBmYWxzZSk7CiAj ZW5kaWYKQEAgLTIxNTI4LDYgKzI2NTMzLDE3IEBAIG1heWJlX3Byb2R1Y2VfbGluZV9udW1iZXIg KHN0cnVjdCBpdCAqaXQpCiAgICAgICBTRVRfVEVYVF9QT1MgKHRlbV9pdC5wb3NpdGlvbiwgLTEs IC0xKTsKICAgICAgIFBST0RVQ0VfR0xZUEhTICgmdGVtX2l0KTsKIAorCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgLyogVGhpcyBwZXJt aXRzIHVzIHRvIGluc3BlY3QgdGhlIEhQT1Mgb2YgbGluZSBudW1iZXIgZ2x5cGhzIGFuZCB0aGUg c3BhY2UKKyAgICAgIHBhZGRpbmcgYmVmb3JlL2FmdGVyIHRoZSBsaW5lIG51bWJlcnMuICBXZSBz ZXQgYGdseXBoLT5ocG9zYCBlbHNld2hlcmUuICovCisgICAgICB0ZW1faXQuaHBvcyArPSAxOwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICAvKiBTdG9wIHByb2R1Y2luZyBn bHlwaHMsIGFuZCByZWZyYWluIGZyb20gcHJvZHVjaW5nIHRoZSBsaW5lCiAJIG51bWJlciwgaWYg d2UgZG9uJ3QgaGF2ZSBlbm91Z2ggc3BhY2Ugb24gdGhpcyBsaW5lLiAgKi8KICAgICAgIGlmICh0 ZW1faXQuY3VycmVudF94ID49IHdpZHRoX2xpbWl0KQpAQCAtMjE1MzksNiArMjY1NTUsMjggQEAg bWF5YmVfcHJvZHVjZV9saW5lX251bWJlciAoc3RydWN0IGl0ICppdCkKIAl9CiAgICAgfQogCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIHN0 cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSIChpdC0+dy0+Y29udGVudHMpOworICBzdHJ1Y3QgYnVm ZmVyICpvbGRfYnVmZmVyID0gTlVMTDsKKyAgLyogTmVlZGVkIHNvIHRoYXQgYnVmZmVyLWxvY2Fs IHZhbHVlcyBjYW4gYmUgZGV0ZXJtaW5lZDsgZS5nLiwgd2hlbiBzd2l0Y2hpbmcKKyAgdG8gdGhl IG1pbmlidWZmZXIuICovCisgIGlmIChiICE9IGN1cnJlbnRfYnVmZmVyKQorICAgIHsKKyAgICAg IG9sZF9idWZmZXIgPSBjdXJyZW50X2J1ZmZlcjsKKyAgICAgIHNldF9idWZmZXJfaW50ZXJuYWwg KGIpOworICAgIH0KKyAgaXQtPnctPm1jLmxudW1fcGl4ZWxfd2lkdGggPSAoIU5JTFAgKFZkaXNw bGF5X2xpbmVfbnVtYmVycykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyB0ZW1f aXQuY3VycmVudF94CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAwOworICBpZiAo b2xkX2J1ZmZlcikKKyAgICBzZXRfYnVmZmVyX2ludGVybmFsIChvbGRfYnVmZmVyKTsKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBSZWNvcmQgdGhlIHdpZHRoIGluIHBpeGVs cyB3ZSBuZWVkIGZvciB0aGUgbGluZSBudW1iZXIgZGlzcGxheS4gICovCiAgIGl0LT5sbnVtX3Bp eGVsX3dpZHRoID0gdGVtX2l0LmN1cnJlbnRfeDsKICAgLyogQ29weSB0aGUgcHJvZHVjZWQgZ2x5 cGhzIGludG8gSVQncyBnbHlwaF9yb3cuICAqLwpAQCAtMjczNjAsNiArMzIzOTgsMTcgQEAgYXBw ZW5kX2dseXBoIChzdHJ1Y3QgaXQgKml0KQogCSAgICBnWzFdID0gKmc7CiAJICBnbHlwaCA9IGl0 LT5nbHlwaF9yb3ctPmdseXBoc1thcmVhXTsKIAl9CisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhw b3M7CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9IElUX0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgICAgIGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQt PnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5vYmplY3QgPSBpdC0+b2JqZWN0OwogICAgICAgaWYg KGl0LT5waXhlbF93aWR0aCA+IDApCkBAIC0yNzQ0Miw2ICszMjQ5MSwxNyBAQCBhcHBlbmRfY29t cG9zaXRlX2dseXBoIChzdHJ1Y3QgaXQgKml0KQogCSAgICBnWzFdID0gKmc7CiAJICBnbHlwaCA9 IGl0LT5nbHlwaF9yb3ctPmdseXBoc1tpdC0+YXJlYV07CiAJfQorCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+aHBvcyA9 IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPmJ5dGVwb3MgPSBJVF9CWVRFUE9TICgqaXQpOworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICBnbHlwaC0+Y2hhcnBvcyA9IGl0LT5j bXBfaXQuY2hhcnBvczsKICAgICAgIGdseXBoLT5vYmplY3QgPSBpdC0+b2JqZWN0OwogICAgICAg ZWFzc2VydCAoaXQtPnBpeGVsX3dpZHRoIDw9IFNIUlRfTUFYKTsKQEAgLTI3NjUwLDYgKzMyNzEw LDE3IEBAIHByb2R1Y2VfaW1hZ2VfZ2x5cGggKHN0cnVjdCBpdCAqaXQpCiAJfQogICAgICAgaWYg KGdseXBoIDwgaXQtPmdseXBoX3Jvdy0+Z2x5cGhzW2FyZWEgKyAxXSkKIAl7CisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGdseXBo LT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9IElUX0JZVEVQT1MgKCpp dCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgIGdseXBoLT5jaGFycG9zID0g Q0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKIAkgIGdseXBoLT5vYmplY3QgPSBpdC0+b2JqZWN0Owog CSAgZ2x5cGgtPnBpeGVsX3dpZHRoID0gY2xpcF90b19ib3VuZHMgKC0xLCBpdC0+cGl4ZWxfd2lk dGgsIFNIUlRfTUFYKTsKQEAgLTI3NzUzLDYgKzMyODI0LDE3IEBAIHByb2R1Y2VfeHdpZGdldF9n bHlwaCAoc3RydWN0IGl0ICppdCkKIAl9CiAgICAgICBpZiAoZ2x5cGggPCBpdC0+Z2x5cGhfcm93 LT5nbHlwaHNbYXJlYSArIDFdKQogCXsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAg ICAgIGdseXBoLT5ieXRlcG9zID0gSVRfQllURVBPUyAoKml0KTsKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogCSAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9zaXRpb24p OwogCSAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAJICBnbHlwaC0+cGl4ZWxfd2lkdGgg PSBjbGlwX3RvX2JvdW5kcyAoLTEsIGl0LT5waXhlbF93aWR0aCwgU0hSVF9NQVgpOwpAQCAtMjc4 MzksNiArMzI5MjEsMTcgQEAgYXBwZW5kX3N0cmV0Y2hfZ2x5cGggKHN0cnVjdCBpdCAqaXQsIExp c3BfT2JqZWN0IG9iamVjdCwKIAkgICAgd2lkdGggLT0gaXQtPmZpcnN0X3Zpc2libGVfeCAtIGl0 LT5jdXJyZW50X3g7CiAJICBlYXNzZXJ0ICh3aWR0aCA+IDApOwogCX0KKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPmhw b3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBoLT5ieXRlcG9zID0gSVRfQllURVBPUyAoKml0KTsK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgZ2x5cGgtPmNoYXJwb3MgPSBD SEFSUE9TIChpdC0+cG9zaXRpb24pOwogICAgICAgZ2x5cGgtPm9iamVjdCA9IG9iamVjdDsKICAg ICAgIC8qIEZJWE1FOiBJdCB3b3VsZCBiZSBiZXR0ZXIgdG8gdXNlIFRZUEVfTUFYIGhlcmUsIGJ1 dApAQCAtMjgyOTMsNiArMzMzODYsMTcgQEAgYXBwZW5kX2dseXBobGVzc19nbHlwaCAoc3RydWN0 IGl0ICppdCwgaW50IGZhY2VfaWQsIGJvb2wgZm9yX25vX2ZvbnQsIGludCBsZW4sCiAJICAgIGdb MV0gPSAqZzsKIAkgIGdseXBoID0gaXQtPmdseXBoX3Jvdy0+Z2x5cGhzW2FyZWFdOwogCX0KKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAg ICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBoLT5ieXRlcG9zID0gSVRfQllU RVBPUyAoKml0KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgZ2x5cGgt PmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9zaXRpb24pOwogICAgICAgZ2x5cGgtPm9iamVjdCA9 IGl0LT5vYmplY3Q7CiAgICAgICBlYXNzZXJ0IChpdC0+cGl4ZWxfd2lkdGggPD0gU0hSVF9NQVgp OwpAQCAtMjkzNDMsMTAgKzM0NDQ3LDIwIEBAIGd1aV9pbnNlcnRfZ2x5cGhzIChzdHJ1Y3Qgd2lu ZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICp1cGRhdGVkX3JvdywKIAogICAvKiBXcml0ZSB0aGUg Z2x5cGhzLiAgKi8KICAgaHBvcyA9IHN0YXJ0IC0gcm93LT5nbHlwaHNbdXBkYXRlZF9hcmVhXTsK KworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwor ICBpZiAoIW1jX3JlZHJhd19yb3cgKHcsIHctPmN1cnJlbnRfbWF0cml4LCByb3csIHVwZGF0ZWRf YXJlYSwgdy0+b3V0cHV0X2N1cnNvci54LAorICAgICAgICAgICAgICAgICAgICAgIGhwb3MsIGhw b3MgKyBsZW4sIGZhbHNlLCBEUkFXX05PUk1BTF9URVhULCBHVUlfSU5TRVJUX0dMWVBIUykpCiAg IGRyYXdfZ2x5cGhzICh3LCB3LT5vdXRwdXRfY3Vyc29yLngsIHJvdywgdXBkYXRlZF9hcmVhLAog CSAgICAgICBocG9zLCBocG9zICsgbGVuLAogCSAgICAgICBEUkFXX05PUk1BTF9URVhULCAwKTsK IAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBBZHZhbmNlIHRoZSBvdXRwdXQg Y3Vyc29yLiAgKi8KICAgdy0+b3V0cHV0X2N1cnNvci5ocG9zICs9IGxlbjsKICAgdy0+b3V0cHV0 X2N1cnNvci54ICs9IHNoaWZ0X2J5X3dpZHRoOwpAQCAtMjk3NzIsOSArMzQ4ODYsMTkgQEAgZ3Vp X2ZpeF9vdmVybGFwcGluZ19hcmVhIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93 ICpyb3csCiAJICB3aGlsZSAoaSA8IHJvdy0+dXNlZFthcmVhXQogCQkgJiYgcm93LT5nbHlwaHNb YXJlYV1baV0ub3ZlcmxhcHNfdmVydGljYWxseV9wKTsKIAorCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgaWYgKCFtY19yZWRyYXdfcm93 ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgcm93LCBhcmVhLCBzdGFydF94LCBzdGFydCwgaSwKKyAg ICAgICAgICBmYWxzZSwgRFJBV19OT1JNQUxfVEVYVCwgR1VJX0ZJWF9PVkVSTEFQUElOR19BUkVB KSkKIAkgIGRyYXdfZ2x5cGhzICh3LCBzdGFydF94LCByb3csIGFyZWEsCiAJCSAgICAgICBzdGFy dCwgaSwKIAkJICAgICAgIERSQVdfTk9STUFMX1RFWFQsIG92ZXJsYXBzKTsKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogCX0KICAgICAgIGVsc2UKIAl7CkBAIC0zMDAyNSwxMCArMzUx NDksMTcgQEAgZGlzcGxheV9hbmRfc2V0X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBv biwKICAgbmV3X2N1cnNvcl90eXBlID0gZ2V0X3dpbmRvd19jdXJzb3JfdHlwZSAodywgZ2x5cGgs CiAJCQkJCSAgICAmbmV3X2N1cnNvcl93aWR0aCwgJmFjdGl2ZV9jdXJzb3IpOwogCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCiAgIC8qIElmIGN1 cnNvciBpcyBjdXJyZW50bHkgYmVpbmcgc2hvd24gYW5kIHdlIGRvbid0IHdhbnQgaXQgdG8gYmUg b3IKICAgICAgaXQgaXMgaW4gdGhlIHdyb25nIHBsYWNlLCBvciB0aGUgY3Vyc29yIHR5cGUgaXMg bm90IHdoYXQgd2Ugd2FudCwKICAgICAgZXJhc2UgaXQuICAqLwogICBpZiAody0+cGh5c19jdXJz b3Jfb25fcAorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9z c2hhaXJzKSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNf dmlzaWJsZSkpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1j X2NvbmYpKQogICAgICAgJiYgKCFvbgogCSAgfHwgdy0+cGh5c19jdXJzb3IueCAhPSB4CiAJICB8 fCB3LT5waHlzX2N1cnNvci55ICE9IHkKQEAgLTMwMDQxLDYgKzM1MTcyLDkgQEAgZGlzcGxheV9h bmRfc2V0X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBvbiwKIAkgICAgICAmJiBuZXdf Y3Vyc29yX3dpZHRoICE9IHctPnBoeXNfY3Vyc29yX3dpZHRoKSkpCiAgICAgZXJhc2VfcGh5c19j dXJzb3IgKHcpOwogCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIERvbid0IGNo ZWNrIHBoeXNfY3Vyc29yX29uX3AgaGVyZSBiZWNhdXNlIHRoYXQgZmxhZyBpcyBvbmx5IHNldAog ICAgICB0byBmYWxzZSBpbiBzb21lIGNhc2VzIHdoZXJlIHdlIGtub3cgdGhhdCB0aGUgY3Vyc29y IGhhcyBiZWVuCiAgICAgIGNvbXBsZXRlbHkgZXJhc2VkLCB0byBhdm9pZCB0aGUgZXh0cmEgd29y ayBvZiBlcmFzaW5nIHRoZSBjdXJzb3IKQEAgLTMwMDU5LDkgKzM1MTkzLDIwIEBAIGRpc3BsYXlf YW5kX3NldF9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgb24sCiAgICAgICB3LT5waHlz X2N1cnNvci52cG9zID0gdnBvczsKICAgICB9CiAKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgaWYgKE5JTFAgKEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3 LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBtY19jb25mKSkpCiAgIEZSQU1FX1JJRiAoZiktPmRyYXdfd2luZG93X2N1 cnNvciAodywgZ2x5cGhfcm93LCB4LCB5LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIG5ld19jdXJzb3JfdHlwZSwgbmV3X2N1cnNvcl93aWR0aCwKICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBvbiwgYWN0aXZlX2N1cnNvcik7CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKIH0KIAogCkBAIC0zMDE1NCw3ICszNTI5OSwxOCBAQCBkcmF3X3Jv d193aXRoX21vdXNlX2ZhY2UgKHN0cnVjdCB3aW5kb3cgKncsIGludCBzdGFydF94LCBzdHJ1Y3Qg Z2x5cGhfcm93ICpyb3csCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCiAgIGlmIChGUkFNRV9X SU5ET1dfUCAoWEZSQU1FICh3LT5mcmFtZSkpKQogICAgIHsKKworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgaWYgKCFtY19yZWRyYXdf cm93ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgcm93LCBURVhUX0FSRUEsIHN0YXJ0X3gsCisgICAg ICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0X2hwb3MsIGVuZF9ocG9zLCBmYWxzZSwgZHJhdywg RFJBV19ST1dfV0lUSF9NT1VTRV9GQUNFKSkKICAgICAgIGRyYXdfZ2x5cGhzICh3LCBzdGFydF94 LCByb3csIFRFWFRfQVJFQSwgc3RhcnRfaHBvcywgZW5kX2hwb3MsIGRyYXcsIDApOworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICByZXR1cm47CiAgICAgfQogI2VuZGlmCkBA IC0zMjIxNCwxMSArMzczNzAsMjMgQEAgZXhwb3NlX2FyZWEgKHN0cnVjdCB3aW5kb3cgKncsIHN0 cnVjdCBnbHlwaF9yb3cgKnJvdywgY29uc3QgRW1hY3NfUmVjdGFuZ2xlICpyLAogICBzdHJ1Y3Qg Z2x5cGggKmxhc3Q7CiAgIGludCBmaXJzdF94LCBzdGFydF94LCB4OwogCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCiAgIGlmIChhcmVhID09IFRF WFRfQVJFQSAmJiByb3ctPmZpbGxfbGluZV9wKQorICAgIHsKKyAgICAgIGlmICghbWNfcmVkcmF3 X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgsIHJvdywgYXJlYSwgMCwgMCwgcm93LT51c2VkW2Fy ZWFdLAorICAgICAgICAgICAgICAgICAgICAgICAgICBmYWxzZSwgRFJBV19OT1JNQUxfVEVYVCwg RVhQT1NFX0FSRUFfT05FKSkKICAgICAvKiBJZiByb3cgZXh0ZW5kcyBmYWNlIHRvIGVuZCBvZiBs aW5lIHdyaXRlIHRoZSB3aG9sZSBsaW5lLiAgKi8KICAgICBkcmF3X2dseXBocyAodywgMCwgcm93 LCBhcmVhLAogCQkgMCwgcm93LT51c2VkW2FyZWFdLAogCQkgRFJBV19OT1JNQUxfVEVYVCwgMCk7 CisgICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIGVsc2UKICAgICB7CiAg ICAgICAvKiBTZXQgU1RBUlRfWCB0byB0aGUgd2luZG93LXJlbGF0aXZlIHN0YXJ0IHBvc2l0aW9u IGZvciBkcmF3aW5nIGdseXBocyBvZgpAQCAtMzIyNTAsMTEgKzM3NDE4LDIzIEBAIGV4cG9zZV9h cmVhIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGNvbnN0IEVtYWNz X1JlY3RhbmdsZSAqciwKIAkgICsrbGFzdDsKIAl9CiAKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgICAgIC8qIFJlcGFpbnQuICAqLwotICAg ICAgaWYgKGxhc3QgPiBmaXJzdCkKKyAgICAgIC8qIEZsb2F0aW5nIGZha2UgY3Vyc29ycyB3aWxs IGV4aXN0IHdoZW4gKGxhc3QgPT0gZmlyc3QpLiAqLworICAgICAgaWYgKCFtY19yZWRyYXdfcm93 ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgcm93LCBhcmVhLCBmaXJzdF94IC0gc3RhcnRfeCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgZmlyc3QgLSByb3ctPmdseXBoc1thcmVhXSwgbGFzdCAt IHJvdy0+Z2x5cGhzW2FyZWFdLAorICAgICAgICAgICAgICAgICAgICAgICAgICBmYWxzZSwgRFJB V19OT1JNQUxfVEVYVCwgRVhQT1NFX0FSRUFfVFdPKQorICAgICAgICAgICYmIGxhc3QgPiBmaXJz dCkKIAlkcmF3X2dseXBocyAodywgZmlyc3RfeCAtIHN0YXJ0X3gsIHJvdywgYXJlYSwKIAkJICAg ICBmaXJzdCAtIHJvdy0+Z2x5cGhzW2FyZWFdLCBsYXN0IC0gcm93LT5nbHlwaHNbYXJlYV0sCiAJ CSAgICAgRFJBV19OT1JNQUxfVEVYVCwgMCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor CisKICAgICB9CiB9CiAKQEAgLTMyMjY4LDEwICszNzQ0OCwyMiBAQCBleHBvc2VfbGluZSAoc3Ry dWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqcm93LCBjb25zdCBFbWFjc19SZWN0YW5n bGUgKnIpCiB7CiAgIGVhc3NlcnQgKHJvdy0+ZW5hYmxlZF9wKTsKIAorCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogICBpZiAocm93LT5tb2RlX2xp bmVfcCB8fCB3LT5wc2V1ZG9fd2luZG93X3ApCisgICAgeworICAgICAgaWYgKCFtY19yZWRyYXdf cm93ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgcm93LCBURVhUX0FSRUEsIDAsIDAsCisgICAgICAg ICAgICAgICAgICAgICAgICAgIHJvdy0+dXNlZFtURVhUX0FSRUFdLCBmYWxzZSwgRFJBV19OT1JN QUxfVEVYVCwgRVhQT1NFX0xJTkUpKQogICAgIGRyYXdfZ2x5cGhzICh3LCAwLCByb3csIFRFWFRf QVJFQSwKIAkJIDAsIHJvdy0+dXNlZFtURVhUX0FSRUFdLAogCQkgRFJBV19OT1JNQUxfVEVYVCwg MCk7CisgICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIGVsc2UKICAgICB7 CiAgICAgICBpZiAocm93LT51c2VkW0xFRlRfTUFSR0lOX0FSRUFdKQpAQCAtMzI4MTksNiArMzgw MTEsMjIgQEAgZ3VpX2ludGVyc2VjdF9yZWN0YW5nbGVzIChjb25zdCBFbWFjc19SZWN0YW5nbGUg KnIxLCBjb25zdCBFbWFjc19SZWN0YW5nbGUgKnIyLAogdm9pZAogc3ltc19vZl94ZGlzcCAodm9p ZCkKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMg Ki8KKworICBkZWZzdWJyICgmU21jX2R1bXBfZ2x5cGhfcm93KTsKKworICBkZWZzdWJyICgmU21j X2R1bXBfZ2x5cGhfbWF0cml4KTsKKworICBkZWZzdWJyICgmU21jX2N1cnJlbnRfY29sdW1uKTsK KworICBkZWZzdWJyICgmU21jX3N0ZGVycik7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor CisKICAgVndpdGhfZWNob19hcmVhX3NhdmVfdmVjdG9yID0gUW5pbDsKICAgc3RhdGljcHJvICgm VndpdGhfZWNob19hcmVhX3NhdmVfdmVjdG9yKTsKIApkaWZmIC0tZ2l0IGEvc3JjL3h0ZXJtLmMg Yi9zcmMveHRlcm0uYwppbmRleCBjOTZhYTc0Li43ZjhmMWEwIDEwMDY0NAotLS0gYS9zcmMveHRl cm0uYworKysgYi9zcmMveHRlcm0uYwpAQCAtMTMyLDYgKzEzMiw5MDQgQEAgYWxvbmcgd2l0aCBH TlUgRW1hY3M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BlbHNlCisgICAgICAgIHsKKyAgICAgICAgICBn YyA9IFhDcmVhdGVHQyAoZHB5LCB3aW5kb3csIG1hc2ssICZ4Z2N2KTsKKyAgICAgICAgICBGUkFN RV9ESVNQTEFZX0lORk8gKGYpLT5zY3JhdGNoX2N1cnNvcl9nYyA9IGdjOworICAgICAgICB9Cisg ICAgICB4X2NsaXBfdG9fcm93ICh3LCByb3csIFRFWFRfQVJFQSwgZ2MpOworICAgICAgeF9maWxs X3JlY3RhbmdsZSAoZiwgZ2MsIGZ4LCBmeSwgd2QsIGgpOworICAgICAgeF9yZXNldF9jbGlwX3Jl Y3RhbmdsZXMgKGYsIGdjKTsKKyAgICB9Cit9CisKKy8qIFJJRjogRHJhdyBjdXJzb3Igb24gd2lu ZG93IFcuICovCitzdGF0aWMgdm9pZAorbWNfeF9kcmF3X3dpbmRvd19jdXJzb3IgKHN0cnVjdCB3 aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAq cm93LAorICAgICAgICAgICAgICAgICAgICAgICAgIGludCB4LCBpbnQgZngsIGludCB5LCBpbnQg ZnksIGludCBocG9zLCBpbnQgdnBvcywgaW50IHdkLAorICAgICAgICAgICAgICAgICAgICAgICAg IGludCBoLCBzdHJ1Y3QgbWNfUkdCIGxzbCwgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlw ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY3Vyc29yX3dpZHRoLCBlbnVtIG1jX2Zs YXZvciBnbHlwaF9mbGF2b3IsIGJvb2wgb25fcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBi b29sIGFjdGl2ZV9wKQoreworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFN RSAodykpOworICAvKiBUaGUgZnJpbmdlIGJpdG1hcHMgYXJlIHByZXNlbnRseSBoYW5kbGVkIGVs c2V3aGVyZSwgYnV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1MzUsIDY1NTM1ICogbHNs LnJlZCk7CisgIGNvbG9yLmdyZWVuID0gbWluICg2NTUzNSwgNjU1MzUgKiBsc2wuZ3JlZW4pOwor ICBjb2xvci5ibHVlID0gbWluICg2NTUzNSwgNjU1MzUgKiBsc2wuYmx1ZSk7CisgIC8qIGB4X2Fs bG9jX25lYXJlc3RfY29sb3InIHNldHMgdGhlIGBjb2xvci5waXhlbGAuICovCisgIHhfYWxsb2Nf bmVhcmVzdF9jb2xvciAoZiwgY21hcCwgJmNvbG9yKTsKKyAgc3dpdGNoIChjdXJzb3JfdHlwZSkK KyAgeworICAgIGNhc2UgTUNfTk9fRlJJTkdFX0JJVE1BUDoKKyAgICAgIGJyZWFrOworICAgIGNh c2UgTUNfTk9fQ1VSU09SOgorICAgICAgYnJlYWs7CisgICAgY2FzZSBNQ19SSUdIVF9GUklOR0Vf QklUTUFQOgorICAgICAgYnJlYWs7CisgICAgY2FzZSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVA6Cisg ICAgICBicmVhazsKKyAgICBjYXNlIE1DX0ZSQU1FRF9CT1g6CisgICAgeworICAgICAgc3RydWN0 IGdseXBoICpjdXJzb3JfZ2x5cGggPSBtY19nZXRfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJv dywgaHBvcywgdnBvcyk7CisgICAgICBpZiAoY3Vyc29yX2dseXBoID09IE5VTEwpCisgICAgICAg IHJldHVybjsKKyAgICAgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSICh3LT5jb250ZW50cyk7 CisgICAgICBib29sIHJlZ2lvbl9hY3RpdmVfcCA9ICghTklMUCAoVnRyYW5zaWVudF9tYXJrX21v ZGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgbWFy a19hY3RpdmUpKSk7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2JlZyA9IChyZWdpb25fYWN0aXZl X3ApID8gbWNfcmVnaW9uX2xpbWl0ICgx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gICAgICAgICAgIHN0cnVjdCBm YWNlICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYs IGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZV9pZCk7CisgICAgICAgICAgICAgICAg ICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2Ug KHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsK KyAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNF X0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICBY U2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vy c29yX2djLCBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICAg ICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngt PmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNlLT5mb3JlZ3JvdW5k KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoYWN0aXZlX3Ap CisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBo b2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgi Ky1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAg ICAgICBzdHJ1Y3QgZmFjZSAqaG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3V0cHV0X2RhdGEueC0+Y3Vyc29yX3Bp eGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYg KGN1cnNvcl9nbHlwaC0+dHlwZSA9PSBJTUFHRV9HTFlQSCAmJiBsc2wucmVkID49IDAgJiYgbHNs LmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAgICB7CisgICAgICAgICAgICAv KiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCcuICov CisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBjb2xvci5waXhl bDsKKyAgICAgICAgICAgIG1jX3hfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywg eCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICAgICAgICBmLT5vdXRwdXRf ZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgICAg fQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogVGVtcG9y YXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MnIGJ5IGJvcnJvd2luZyB0 aGUKKyAgICAgICAgICAgICAgZnVuY3Rpb25hbGl0eSBvZiBgeF9tYWtlX2djJyBpbiB4Zm5zLmMu ICovCisgICAgICAgICAgICAgIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAg ICYmIGFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3Mg PT0gcmVnaW9uX2JlZykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBlbnVt IGZhY2VfaWQgaG9sbG93X2Fj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gICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgZWxzZSBpZiAocmVnaW9u X2FjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID4gcmVnaW9uX2Jl ZworICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zIDwg cmVnaW9uX2VuZCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAg IGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2VfaWQgPSBsb29r dXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluLXJlZ2lv bi1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFj ZSAqaG9sbG93X2FjdGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBo b2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAg ICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFj ZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUp OworICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2Ug PSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAg ICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9k YXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAg ICAgICAgICAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+ b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2Zh Y2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAg ICAgIGVsc2UgaWYgKGFjdGl2ZV9wKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29r dXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1m YWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxv d19hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2FjdGl2ZV9mYWNlX2lkKTsK KyAgICAgICAgICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkg KGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19hY3RpdmVfZmFjZS0+Zm9y ZWdyb3VuZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVf WF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfYWN0aXZl X2ZhY2UtPmJhY2tncm91bmQpOworICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAg ICAgICAgICAgICBlbHNlIGlmICghYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICA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wsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBh Y3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9nY19w KTsKKyAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYt Pm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgeGdjdi5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAg ICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngt PmN1cnNvcl9nYywgeGdjdi5iYWNrZ3JvdW5kKTsKKyAgICAgICAgICAgICAgdW5ibG9ja19pbnB1 dCAoKTsKKyAgICAgICAgICAgICAgLyogRHJhdyB0aGUgZnJhbWUgYXJvdW5kIHRoZSBib3guICov CisgICAgICAgICAgICAgIG1jX3hfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywg eCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICAgICAgICB9CisgICAgICBi cmVhazsKKyAgICB9CisgICAgY2FzZSBNQ19IT0xMT1dfQk9YOgorICAgIHsKKyAgICAgIGlmIChs c2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAg eworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vy c29yX3BpeGVsJy4gKi8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwg PSBjb2xvci5waXhlbDsKKyAgICAgICAgICBtY194X2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0 cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgIGYt Pm91dHB1dF9kYXRhLngtPmN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GxzbCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsIGFj dGl2ZV9wLCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hf RElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgeGdjdi5mb3JlZ3JvdW5k KTsKKyAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0 cHV0X2RhdGEueC0+Y3Vyc29yX2djLCB4Z2N2LmJhY2tncm91bmQpOworICAgICAgICAgIHVuYmxv Y2tfaW5wdXQgKCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAg ICAgICAgIGJvb2wgY3Vyc29yX2djX3AgPSBmYWxzZTsKKyAgICAgICAgICAgIG1jX2RyYXdfY3Vy c29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywgRFJBV19DVVJTT1IsIHgsIGhwb3MsIHZwb3MsIGxz bCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaF9mbGF2b3IsIGN1cnNv cl90eXBlLCB3ZCwgYWN0aXZlX3AsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICB9CisgICAgICBi cmVhazsKKyAgICB9CisgICAgY2FzZSBNQ19CQVI6CisgICAgeworICAgICAgaWYgKGxzbC5yZWQg Pj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAgICB7CisgICAg ICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4 ZWwnLiAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IGNvbG9y LnBpeGVsOworICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSB0cnVl OworICAgICAgICAgIG1jX3hfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngs IHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgY3Vyc29yX3dpZHRoLCBNQ19CQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAg ICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3Jf cGl4ZWw7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAg IGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSBmYWxzZTsKKyAgICAgICAgICAgIG1j X3hfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2 cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lk dGgsIE1DX0JBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIH0KKyAg ICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0hCQVI6CisgICAgeworICAgICAgaWYgKGxz bC5yZWQgPj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAgICB7 CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJz b3JfcGl4ZWwnLiAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9 IGNvbG9yLnBpeGVsOworICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3Ag PSB0cnVlOworICAgICAgICAgIG1jX3hfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywg eCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgY3Vyc29yX3dpZHRoLCBNQ19IQkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlf cCk7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxf Y3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAg ICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7CisgICAgICAg ICAgICBtY194X2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwg aHBvcywgdnBvcywgd2QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaCwgY3Vy c29yX3dpZHRoLCBNQ19IQkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAg ICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGRlZmF1bHQ6CisgICAgICBlbWFjc19hYm9y dCAoKTsKKyAgfQorICAgICAgICB9CisjaWZkZWYgSEFWRV9YX0kxOE4KKyAgaWYgKHcgPT0gWFdJ TkRPVyAoZi0+c2VsZWN0ZWRfd2luZG93KSkKKyAgICBpZiAoRlJBTUVfWElDIChmKSAmJiAoRlJB TUVfWElDX1NUWUxFIChmKSAmIFhJTVByZWVkaXRQb3NpdGlvbikpCisgICAgICB4aWNfc2V0X3By ZWVkaXRhcmVhICh3LCB4LCB5KTsKKyNlbmRpZgorICAgIH0KKyAgWEZsdXNoIChGUkFNRV9YX0RJ U1BMQVkgKGYpKTsKK30KKworLyogRHJhdyBzdHJldGNoIGdseXBoIHN0cmluZyBTLiAqLworc3Rh dGljIHZvaWQKK21jX3hfZHJhd19zdHJldGNoX2dseXBoX3N0cmluZyAoc3RydWN0IGdseXBoX3N0 cmluZyAqcykKK3sKKyAgZWFzc2VydCAocy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gU1RSRVRDSF9H TFlQSCk7CisgIGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUgorICAgICAgJiYgIXhfc3RyZXRjaF9j dXJzb3JfcCkKKyAgICB7CisgICAgICAvKiBJZiBgeC1zdHJldGNoLWN1cnNvcicgaXMgbmlsLCBk b24ndCBkcmF3IGEgYmxvY2sgY3Vyc29yIGFzIHdpZGUgYXMgdGhlCisgICAgICBzdHJldGNoIGds eXBoLiAqLworICAgICAgaW50IHdpZHRoLCBiYWNrZ3JvdW5kX3dpZHRoID0gcy0+YmFja2dyb3Vu ZF93aWR0aDsKKyAgICAgIGludCB4ID0gcy0+eDsKKyAgICAgIGlmICghcy0+cm93LT5yZXZlcnNl ZF9wKQorICAgICAgICB7CisgICAgICAgICAgaW50IGxlZnRfeCA9IHdpbmRvd19ib3hfbGVmdF9v ZmZzZXQgKHMtPncsIFRFWFRfQVJFQSk7CisgICAgICAgICAgaWYgKHggPCBsZWZ0X3gpCisgICAg ICAgICAgICB7CisgICAgICAgICAgICAgIGJhY2tncm91bmRfd2lkdGggLT0gbGVmdF94IC0geDsK KyAgICAgICAgICAgICAgeCA9IGxlZnRfeDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAg ICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgLyogSW4gUjJMIHJvd3MsIGRyYXcg dGhlIGN1cnNvciBvbiB0aGUgcmlnaHQgZWRnZSBvZiB0aGUKKyAgICAgICAgICAgICAgIHN0cmV0 Y2ggZ2x5cGguICovCisgICAgICAgICAgICBpbnQgcmlnaHRfeCA9IHdpbmRvd19ib3hfcmlnaHQg KHMtPncsIFRFWFRfQVJFQSk7CisgICAgICAgICAgICBpZiAoeCArIGJhY2tncm91bmRfd2lkdGgg PiByaWdodF94KQorICAgICAgICAgICAgICBiYWNrZ3JvdW5kX3dpZHRoIC09IHggLSByaWdodF94 OworICAgICAgICAgICAgeCArPSBiYWNrZ3JvdW5kX3dpZHRoOworICAgICAgICAgIH0KKyAgICAg IHdpZHRoID0gbWluIChGUkFNRV9DT0xVTU5fV0lEVEggKHMtPmYpLCBiYWNrZ3JvdW5kX3dpZHRo KTsKKyAgICAgIGlmIChzLT5yb3ctPnJldmVyc2VkX3ApCisgICAgICAgIHggLT0gd2lkdGg7Cisg ICAgICAvKiBEcmF3IGN1cnNvci4gKi8KKyAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmdfcmVj dCAocywgeCwgcy0+eSwgd2lkdGgsIHMtPmhlaWdodCk7CisgICAgICAvKiBDbGVhciByZXN0IHVz aW5nIHRoZSBHQyBvZiB0aGUgb3JpZ2luYWwgbm9uLWN1cnNvciBmYWNlLiAqLworICAgICAgaWYg KHdpZHRoIDwgYmFja2dyb3VuZF93aWR0aCkKKyAgICAgICAgeworICAgICAgICAgIGludCB5ID0g cy0+eTsKKyAgICAgICAgICBpbnQgdyA9IGJhY2tncm91bmRfd2lkdGggLSB3aWR0aCwgaCA9IHMt PmhlaWdodDsKKyAgICAgICAgICBYUmVjdGFuZ2xlIHI7CisgICAgICAgICAgR0MgZ2M7CisgICAg ICAgICAgaWYgKCFzLT5yb3ctPnJldmVyc2VkX3ApCisgICAgICAgICAgICB4ICs9IHdpZHRoOwor ICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHggPSBzLT54OworICAgICAgICAgIGlmIChzLT5y b3ctPm1vdXNlX2ZhY2VfcAorICAgICAgICAgICAgICAmJiBjdXJzb3JfaW5fbW91c2VfZmFjZV9w IChzLT53KSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgeF9zZXRfbW91c2VfZmFjZV9n YyAocyk7CisgICAgICAgICAgICAgIGdjID0gcy0+Z2M7CisgICAgICAgICAgICB9CisgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgZ2MgPSBzLT5mYWNlLT5nYzsKKyAgICAgICAgICBnZXRfZ2x5 cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgJnIpOworICAgICAgICAgIHhfc2V0X2NsaXBfcmVjdGFu Z2xlcyAocy0+ZiwgZ2MsICZyLCAxKTsKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+c3RpcHBsZSkK KyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogRmlsbCBiYWNrZ3JvdW5kIHdpdGggYSBz dGlwcGxlIHBhdHRlcm4uICovCisgICAgICAgICAgICAgIFhTZXRGaWxsU3R5bGUgKEZSQU1FX1hf RElTUExBWSAocy0+ZiksIGdjLCBGaWxsT3BhcXVlU3RpcHBsZWQpOworICAgICAgICAgICAgICB4 X2ZpbGxfcmVjdGFuZ2xlIChzLT5mLCBnYywgeCwgeSwgdywgaCk7CisgICAgICAgICAgICAgIFhT ZXRGaWxsU3R5bGUgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIGdjLCBGaWxsU29saWQpOworICAg ICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg WEdDVmFsdWVzIHhnY3Y7CisgICAgICAgICAgICAgIFhHZXRHQ1ZhbHVlcyAoRlJBTUVfWF9ESVNQ TEFZIChzLT5mKSwgZ2MsIEdDRm9yZWdyb3VuZCB8IEdDQmFja2dyb3VuZCwgJnhnY3YpOworICAg ICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChzLT5mKSwgZ2MsIHhn Y3YuYmFja2dyb3VuZCk7CisgICAgICAgICAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIGdj LCB4LCB5LCB3LCBoKTsKKyAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElT UExBWSAocy0+ZiksIGdjLCB4Z2N2LmZvcmVncm91bmQpOworICAgICAgICAgICAgfQorICAgICAg ICAgIHhfcmVzZXRfY2xpcF9yZWN0YW5nbGVzIChzLT5mLCBnYyk7CisgICAgICAgIH0KKyAgICB9 CisgIGVsc2UgaWYgKCFzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wKQorICAgIHsKKyAgICAgIGludCBi YWNrZ3JvdW5kX3dpZHRoID0gcy0+YmFja2dyb3VuZF93aWR0aDsKKyAgICAgIGludCB4ID0gcy0+ eCwgbGVmdF94ID0gd2luZG93X2JveF9sZWZ0X29mZnNldCAocy0+dywgVEVYVF9BUkVBKTsKKyAg ICAgIC8qIERvbid0IGRyYXcgaW50byBsZWZ0IG1hcmdpbiwgZnJpbmdlIG9yIHNjcm9sbGJhciBh cmVhCisgICAgICAgICBleGNlcHQgZm9yIGhlYWRlciBsaW5lIGFuZCBtb2RlIGxpbmUuICovCisg ICAgICBpZiAoeCA8IGxlZnRfeCAmJiAhcy0+cm93LT5tb2RlX2xpbmVfcCkKKyAgICAgICAgewor ICAgICAgICAgIGJhY2tncm91bmRfd2lkdGggLT0gbGVmdF94IC0geDsKKyAgICAgICAgICB4ID0g bGVmdF94OworICAgICAgICB9CisgICAgICBpZiAoYmFja2dyb3VuZF93aWR0aCA+IDApCisgICAg ICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmdfcmVjdCAocywgeCwgcy0+eSwgYmFja2dyb3VuZF93 aWR0aCwgcy0+aGVpZ2h0KTsKKyAgICB9CisgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVl OworfQorCisvKiBEcmF3IGdseXBoIHN0cmluZyBTLiAqLworc3RhdGljIHZvaWQKK21jX3hfZHJh d19nbHlwaF9zdHJpbmcgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMsIHN0cnVjdCBnbHlwaF9tYXRy aXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAgICAgICAgICAg ICAgc3RydWN0IG1jX1JHQiBsc2wsIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciwKKyAgICAg ICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUsIGludCBj dXJzb3Jfd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICBib29sIGFjdGl2ZV9wLCBib29s IGN1cnNvcl9nY19wKQoreworICBib29sIHJlbGllZl9kcmF3bl9wID0gZmFsc2U7CisgIC8qIElm IFMgZHJhd3MgaW50byB0aGUgYmFja2dyb3VuZCBvZiBpdHMgc3VjY2Vzc29ycywgZHJhdyB0aGUK KyAgICAgYmFja2dyb3VuZCBvZiB0aGUgc3VjY2Vzc29ycyBmaXJzdCBzbyB0aGF0IFMgY2FuIGRy YXcgaW50byBpdC4KKyAgICAgVGhpcyBtYWtlcyBTLT5uZXh0IHVzZSBYRHJhd1N0cmluZyBpbnN0 ZWFkIG9mIFhEcmF3SW1hZ2VTdHJpbmcuICovCisgIGlmIChzLT5uZXh0ICYmIHMtPnJpZ2h0X292 ZXJoYW5nICYmICFzLT5mb3Jfb3ZlcmxhcHMpCisgICAgeworICAgICAgaW50IHdpZHRoOworICAg ICAgc3RydWN0IGdseXBoX3N0cmluZyAqbmV4dDsKKyAgICAgIGZvciAod2lkdGggPSAwLCBuZXh0 ID0gcy0+bmV4dDsKKyAgICAgICAgICAgbmV4dCAmJiB3aWR0aCA8IHMtPnJpZ2h0X292ZXJoYW5n OworICAgICAgICAgICB3aWR0aCArPSBuZXh0LT53aWR0aCwgbmV4dCA9IG5leHQtPm5leHQpCisg ICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSAhPSBJTUFHRV9HTFlQSCkKKyAgICAg ICAgICB7CisgICAgICAgICAgICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKG5leHQsIGN1cnNv cl9nY19wKTsKKyAgICAgICAgICAgIHhfc2V0X2dseXBoX3N0cmluZ19jbGlwcGluZyAobmV4dCk7 CisgICAgICAgICAgICBpZiAobmV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h azsKKyAgICBjYXNlIENIQVJfR0xZUEg6CisgICAgICBpZiAocy0+Zm9yX292ZXJsYXBzKQorICAg ICAgICBzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wID0gdHJ1ZTsKKyAgICAgIGVsc2UKKyAgICAgICAg eF9kcmF3X2dseXBoX3N0cmluZ19iYWNrZ3JvdW5kIChzLCBmYWxzZSk7CisgICAgICB4X2RyYXdf Z2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHMpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBDT01Q T1NJVEVfR0xZUEg6CisgICAgICBpZiAocy0+Zm9yX292ZXJsYXBzIHx8IChzLT5jbXBfZnJvbSA+ IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICEgcy0+Zmlyc3RfZ2x5cGgtPnUu Y21wLmF1dG9tYXRpYykpCisgICAgICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVlOwor ICAgICAgZWxzZQorICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKHMsIHRy dWUpOworICAgICAgeF9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7 CisgICAgICBicmVhazsKKyAgICBjYXNlIEdMWVBITEVTU19HTFlQSDoKKyAgICAgIGlmIChzLT5m b3Jfb3ZlcmxhcHMpCisgICAgICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVlOworICAg ICAgZWxzZQorICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKHMsIHRydWUp OworICAgICAgeF9kcmF3X2dseXBobGVzc19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7Cisg ICAgICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7CisgICAgfQor ICBpZiAoIXMtPmZvcl9vdmVybGFwcykKKyAgICB7CisgICAgICAvKiBEcmF3IHVuZGVybGluZS4g Ki8KKyAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfcCkKKyAgICAgICAgeworICAgICAgICAg IGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX1dBVkUpCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3Ap CisgICAgICAgICAgICAgICAgeF9kcmF3X3VuZGVyd2F2ZSAocyk7CisgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBYR0NWYWx1ZXMgeGdjdjsK KyAgICAgICAgICAgICAgICAgIFhHZXRHQ1ZhbHVlcyAoRlJBTUVfWF9ESVNQTEFZIChzLT5mKSwg cy0+Z2MsIEdDRm9yZWdyb3VuZCwgJnhnY3YpOworICAgICAgICAgICAgICAgICAgWFNldEZvcmVn cm91bmQgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMtPmdjLCBzLT5mYWNlLT51bmRlcmxpbmVf Y29sb3IpOworICAgICAgICAgICAgICAgICAgeF9kcmF3X3VuZGVyd2F2ZSAocyk7CisgICAgICAg ICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChzLT5mKSwgcy0+Z2Ms IHhnY3YuZm9yZWdyb3VuZCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAg ICAgICAgIGVsc2UgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElO RSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgdW5zaWduZWQgbG9uZyB0aGlja25lc3Ms IHBvc2l0aW9uOworICAgICAgICAgICAgICBpbnQgeTsKKyAgICAgICAgICAgICAgaWYgKHMtPnBy ZXYgJiYgcy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3AKKyAgICAgICAgICAgICAgICAgICYmIHMt PnByZXYtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBXZSB1c2UgdGhlIHNhbWUgdW5kZXJsaW5l IHN0eWxlIGFzIHRoZSBwcmV2aW91cyBvbmUuICovCisgICAgICAgICAgICAgICAgICB0aGlja25l c3MgPSBzLT5wcmV2LT51bmRlcmxpbmVfdGhpY2tuZXNzOworICAgICAgICAgICAgICAgICAgcG9z aXRpb24gPSBzLT5wcmV2LT51bmRlcmxpbmVfcG9zaXRpb247CisgICAgICAgICAgICAgICAgfQor ICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg LyogR2V0IHRoZSB1bmRlcmxpbmUgdGhpY2tuZXNzLiAgRGVmYXVsdCBpcyAxIHBpeGVsLiAqLwor ICAgICAgICAgICAgICAgICAgaWYgKHMtPmZvbnQgJiYgcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNr bmVzcyA+IDApCisgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPmZvbnQtPnVuZGVy bGluZV90aGlja25lc3M7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAg ICAgIHRoaWNrbmVzcyA9IDE7CisgICAgICAgICAgICAgICAgICBpZiAoeF91bmRlcmxpbmVfYXRf ZGVzY2VudF9saW5lKQorICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5oZWlnaHQg LSB0aGlja25lc3MpIC0gKHMtPnliYXNlIC0gcy0+eSk7CisgICAgICAgICAgICAgICAgICBlbHNl CisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhl IHVuZGVybGluZSBwb3NpdGlvbi4gIFRoaXMgaXMgdGhlIHJlY29tbWVuZGVkCisgICAgICAgICAg ICAgICAgICAgICAgICAgdmVydGljYWwgb2Zmc2V0IGluIHBpeGVscyBmcm9tIHRoZSBiYXNlbGlu ZSB0byB0aGUgdG9wIG9mCisgICAgICAgICAgICAgICAgICAgICAgICAgdGhlIHVuZGVybGluZS4g IFRoaXMgaXMgYSBzaWduZWQgdmFsdWUgYWNjb3JkaW5nIHRvIHRoZQorICAgICAgICAgICAgICAg ICAgICAgICAgIHNwZWNzLCBhbmQgaXRzIGRlZmF1bHQgaXMKKyAgICAgICAgICAgICAgICAgICAg ICAgICBST1VORCAoKG1heGltdW0gZGVzY2VudCkgLyAyKSwgd2l0aAorICAgICAgICAgICAgICAg ICAgICAgICAgIFJPVU5EKHgpID0gZmxvb3IgKHggKyAwLjUpICAqLworICAgICAgICAgICAgICAg ICAgICAgIGlmICh4X3VzZV91bmRlcmxpbmVfcG9zaXRpb25fcHJvcGVydGllcworICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBzLT5mb250ICYmIHMtPmZvbnQtPnVuZGVybGluZV9wb3NpdGlv biA+PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBzLT5mb250LT51bmRl cmxpbmVfcG9zaXRpb247CisgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAocy0+Zm9udCkK KyAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmZvbnQtPmRlc2NlbnQgKyAx KSAvIDI7CisgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAg ICAgcG9zaXRpb24gPSB1bmRlcmxpbmVfbWluaW11bV9vZmZzZXQ7CisgICAgICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gbWF4IChwb3NpdGlvbiwgdW5kZXJs aW5lX21pbmltdW1fb2Zmc2V0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIC8q IENoZWNrIHRoZSBzYW5pdHkgb2YgdGhpY2tuZXNzIGFuZCBwb3NpdGlvbi4gIFdlIHNob3VsZAor ICAgICAgICAgICAgICAgICBhdm9pZCBkcmF3aW5nIHVuZGVybGluZSBvdXQgb2YgdGhlIGN1cnJl bnQgbGluZSBhcmVhLiAqLworICAgICAgICAgICAgICBpZiAocy0+eSArIHMtPmhlaWdodCA8PSBz LT55YmFzZSArIHBvc2l0aW9uKQorICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmhlaWdo dCAtIDEpIC0gKHMtPnliYXNlIC0gcy0+eSk7CisgICAgICAgICAgICAgIGlmIChzLT55ICsgcy0+ aGVpZ2h0IDwgcy0+eWJhc2UgKyBwb3NpdGlvbiArIHRoaWNrbmVzcykKKyAgICAgICAgICAgICAg ICB0aGlja25lc3MgPSAocy0+eSArIHMtPmhlaWdodCkgLSAocy0+eWJhc2UgKyBwb3NpdGlvbik7 CisgICAgICAgICAgICAgIHMtPnVuZGVybGluZV90aGlja25lc3MgPSB0aGlja25lc3M7CisgICAg ICAgICAgICAgIHMtPnVuZGVybGluZV9wb3NpdGlvbiA9IHBvc2l0aW9uOworICAgICAgICAgICAg ICB5ID0gcy0+eWJhc2UgKyBwb3NpdGlvbjsKKyAgICAgICAgICAgICAgaWYgKHMtPmZhY2UtPnVu ZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChz LT5mLCBzLT5nYywgcy0+eCwgeSwgcy0+d2lkdGgsIHRoaWNrbmVzcyk7CisgICAgICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBYR0NWYWx1ZXMgeGdj djsKKyAgICAgICAgICAgICAgICAgIFhHZXRHQ1ZhbHVlcyAoRlJBTUVfWF9ESVNQTEFZIChzLT5m KSwgcy0+Z2MsIEdDRm9yZWdyb3VuZCwgJnhnY3YpOworICAgICAgICAgICAgICAgICAgWFNldEZv cmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMtPmdjLCBzLT5mYWNlLT51bmRlcmxp bmVfY29sb3IpOworICAgICAgICAgICAgICAgICAgeF9maWxsX3JlY3RhbmdsZSAocy0+Ziwgcy0+ Z2MsIHMtPngsIHksIHMtPndpZHRoLCB0aGlja25lc3MpOworICAgICAgICAgICAgICAgICAgWFNl dEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMtPmdjLCB4Z2N2LmZvcmVncm91 bmQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAg LyogRHJhdyBvdmVybGluZS4gKi8KKyAgICAgIGlmIChzLT5mYWNlLT5vdmVybGluZV9wKQorICAg ICAgICB7CisgICAgICAgICAgdW5zaWduZWQgbG9uZyBkeSA9IDAsIGggPSAxOworICAgICAgICAg IGlmIChzLT5mYWNlLT5vdmVybGluZV9jb2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgIHhf ZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCBzLT55ICsgZHksIHMtPndpZHRoLCBo KTsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIFhHQ1ZhbHVl cyB4Z2N2OworICAgICAgICAgICAgICBYR2V0R0NWYWx1ZXMgKEZSQU1FX1hfRElTUExBWSAocy0+ ZiksIHMtPmdjLCBHQ0ZvcmVncm91bmQsICZ4Z2N2KTsKKyAgICAgICAgICAgICAgWFNldEZvcmVn cm91bmQgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMtPmdjLCBzLT5mYWNlLT5vdmVybGluZV9j b2xvcik7CisgICAgICAgICAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54 LCBzLT55ICsgZHksIHMtPndpZHRoLCBoKTsKKyAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQg KEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMtPmdjLCB4Z2N2LmZvcmVncm91bmQpOworICAgICAg ICAgICAgfQorICAgICAgICB9CisgICAgICAvKiBEcmF3IHN0cmlrZS10aHJvdWdoLiAqLworICAg ICAgaWYgKHMtPmZhY2UtPnN0cmlrZV90aHJvdWdoX3ApCisgICAgICAgIHsKKyAgICAgICAgICB1 bnNpZ25lZCBsb25nIGggPSAxOworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZHkgPSAocy0+aGVp Z2h0IC0gaCkgLyAyOworICAgICAgICAgIGlmIChzLT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9jb2xv cl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdj LCBzLT54LCBzLT55ICsgZHksIHMtPndpZHRoLCBoKTsKKyAgICAgICAgICBlbHNlCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIFhHQ1ZhbHVlcyB4Z2N2OworICAgICAgICAgICAgICBYR2V0 R0NWYWx1ZXMgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMtPmdjLCBHQ0ZvcmVncm91bmQsICZ4 Z2N2KTsKKyAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAocy0+ ZiksIHMtPmdjLCBzLT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9jb2xvcik7CisgICAgICAgICAgICAg IHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCBzLT55ICsgZHksIHMtPndpZHRo LCBoKTsKKyAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAocy0+ ZiksIHMtPmdjLCB4Z2N2LmZvcmVncm91bmQpOworICAgICAgICAgICAgfQorICAgICAgICB9Cisg ICAgICAvKiBEcmF3IHJlbGllZiBpZiBub3QgeWV0IGRyYXduLiAqLworICAgICAgaWYgKCFyZWxp ZWZfZHJhd25fcCAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gpCisgICAgICAgICAgeF9k cmF3X2dseXBoX3N0cmluZ19ib3ggKHMpOworICAgICAgaWYgKHMtPnByZXYpCisgICAgICAgIHsK KyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpwcmV2OworICAgICAgICAgIGZvciAocHJl diA9IHMtPnByZXY7IHByZXY7IHByZXYgPSBwcmV2LT5wcmV2KQorICAgICAgICAgICAgaWYgKHBy ZXYtPmhsICE9IHMtPmhsCisgICAgICAgICAgICAgICAgJiYgcHJldi0+eCArIHByZXYtPndpZHRo ICsgcHJldi0+cmlnaHRfb3ZlcmhhbmcgPiBzLT54KQorICAgICAgICAgICAgICB7CisgICAgICAg ICAgICAgICAgLyogQXMgcHJldiB3YXMgZHJhd24gd2hpbGUgY2xpcHBlZCB0byBpdHMgb3duIGFy ZWEsIHdlCisgICAgICAgICAgICAgICAgICAgbXVzdCBkcmF3IHRoZSByaWdodF9vdmVyaGFuZyBw YXJ0IHVzaW5nIHMtPmhsIG5vdy4gKi8KKyAgICAgICAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhz X2ZhY2Ugc2F2ZSA9IHByZXYtPmhsOworICAgICAgICAgICAgICAgIHByZXYtPmhsID0gcy0+aGw7 CisgICAgICAgICAgICAgICAgbWNfeF9zZXRfZ2x5cGhfc3RyaW5nX2djIChwcmV2LCBjdXJzb3Jf Z2NfcCk7CisgICAgICAgICAgICAgICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nX2V4YWN0 bHkgKHMsIHByZXYpOworICAgICAgICAgICAgICAgIGlmIChwcmV2LT5maXJzdF9nbHlwaC0+dHlw ZSA9PSBDSEFSX0dMWVBIKQorICAgICAgICAgICAgICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19m b3JlZ3JvdW5kIChwcmV2KTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAg ICB4X2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChwcmV2KTsKKyAgICAg ICAgICAgICAgICB4X3Jlc2V0X2NsaXBfcmVjdGFuZ2xlcyAocHJldi0+ZiwgcHJldi0+Z2MpOwor ICAgICAgICAgICAgICAgIHByZXYtPmhsID0gc2F2ZTsKKyAgICAgICAgICAgICAgICBwcmV2LT5u dW1fY2xpcHMgPSAwOworICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGlmIChzLT5u ZXh0KQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAqbmV4dDsKKyAg ICAgICAgICBmb3IgKG5leHQgPSBzLT5uZXh0OyBuZXh0OyBuZXh0ID0gbmV4dC0+bmV4dCkKKyAg ICAgICAgICAgIGlmIChuZXh0LT5obCAhPSBzLT5obAorICAgICAgICAgICAgICAgICYmIG5leHQt PnggLSBuZXh0LT5sZWZ0X292ZXJoYW5nIDwgcy0+eCArIHMtPndpZHRoKQorICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgLyogQXMgbmV4dCB3aWxsIGJlIGRyYXduIHdoaWxlIGNsaXBw ZWQgdG8gaXRzIG93biBhcmVhLAorICAgICAgICAgICAgICAgICAgIHdlIG11c3QgZHJhdyB0aGUg bGVmdF9vdmVyaGFuZyBwYXJ0IHVzaW5nIHMtPmhsIG5vdy4gKi8KKyAgICAgICAgICAgICAgICBl bnVtIGRyYXdfZ2x5cGhzX2ZhY2Ugc2F2ZSA9IG5leHQtPmhsOworICAgICAgICAgICAgICAgIG5l eHQtPmhsID0gcy0+aGw7CisgICAgICAgICAgICAgICAgbWNfeF9zZXRfZ2x5cGhfc3RyaW5nX2dj IChuZXh0LCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgICAgICAgeF9zZXRfZ2x5cGhfc3RyaW5n X2NsaXBwaW5nX2V4YWN0bHkgKHMsIG5leHQpOworICAgICAgICAgICAgICAgIGlmIChuZXh0LT5m aXJzdF9nbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBIKQorICAgICAgICAgICAgICAgICAgeF9kcmF3 X2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChuZXh0KTsKKyAgICAgICAgICAgICAgICBlbHNlCisg ICAgICAgICAgICAgICAgICB4X2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5k IChuZXh0KTsKKyAgICAgICAgICAgICAgICB4X3Jlc2V0X2NsaXBfcmVjdGFuZ2xlcyAobmV4dC0+ ZiwgbmV4dC0+Z2MpOworICAgICAgICAgICAgICAgIG5leHQtPmhsID0gc2F2ZTsKKyAgICAgICAg ICAgICAgICBuZXh0LT5udW1fY2xpcHMgPSAwOworICAgICAgICAgICAgICAgIG5leHQtPmNsaXBf aGVhZCA9IHMtPm5leHQ7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgLyog UmVzZXQgY2xpcHBpbmcuICovCisgIHhfcmVzZXRfY2xpcF9yZWN0YW5nbGVzIChzLT5mLCBzLT5n Yyk7CisgIHMtPm51bV9jbGlwcyA9IDA7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICov CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBEZWZhdWx0IHRvIHVzaW5nIFhJTSBp ZiBhdmFpbGFibGUuICAqLwogI2lmZGVmIFVTRV9YSU0KIGJvb2wgdXNlX3hpbSA9IHRydWU7CkBA IC0xMTA5LDYgKzIwMDcsMTYgQEAgc3RhdGljIHZvaWQKIHhfdXBkYXRlX2JlZ2luIChzdHJ1Y3Qg ZnJhbWUgKmYpCiB7CiAgIC8qIE5vdGhpbmcgdG8gZG8uICAqLworCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2Zy YW1lID0gZjsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAvKiBEcmF3IGEg dmVydGljYWwgd2luZG93IGJvcmRlciBmcm9tICh4LHkwKSB0byAoeCx5MSkgICovCkBAIC0xMjU0 LDYgKzIxNjIsMTYgQEAgeF91cGRhdGVfZW5kIChzdHJ1Y3QgZnJhbWUgKmYpCiAgIFhGbHVzaCAo RlJBTUVfWF9ESVNQTEFZIChmKSk7CiAgIHVuYmxvY2tfaW5wdXQgKCk7CiAjZW5kaWYKKworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5t Y191cGRhdGluZ19mcmFtZSA9IE5VTEw7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK IH0KIAogLyogVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgZnJvbSB2YXJpb3VzIHBsYWNlcyBpbiB4 ZGlzcC5jCkBAIC0xMzIzOCw2ICsxNDE1NiwyMCBAQCBleHRlcm4gZnJhbWVfcGFybV9oYW5kbGVy IHhfZnJhbWVfcGFybV9oYW5kbGVyc1tdOwogCiBzdGF0aWMgc3RydWN0IHJlZGlzcGxheV9pbnRl cmZhY2UgeF9yZWRpc3BsYXlfaW50ZXJmYWNlID0KICAgeworCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisvKiBgcmVkaXNwbGF5X2ludGVyZmFj ZScgaW4gYHh0ZXJtLmNgIG11c3QgYmUgaW4gdGhlIGV4YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitg cmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYGRpc3BleHRlcm4uaGAhICovCisKKyAgbWNfeF9kcmF3 X3dpbmRvd19jdXJzb3IsCisgIG1jX3hfZHJhd19nbHlwaF9zdHJpbmcsCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKICAgICB4X2ZyYW1lX3Bhcm1faGFuZGxlcnMsCiAgICAgZ3VpX3By b2R1Y2VfZ2x5cGhzLAogICAgIGd1aV93cml0ZV9nbHlwaHMsCg== --Multipart_Thu_Aug_22_22:19:53_2019-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs / fill-column). References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Thu, 17 Oct 2019 21:09:02 +0000 Resent-Message-ID: <handler.22873.B22873.15713464978097 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22873 <at> debbugs.gnu.org,17684 <at> debbugs.gnu.org Cc: eliz@HIDDEN, johnw@HIDDEN, mbork@HIDDEN, rms@HIDDEN, akioburns@HIDDEN Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.15713464978097 (code B ref 22873); Thu, 17 Oct 2019 21:09:02 +0000 Received: (at 22873) by debbugs.gnu.org; 17 Oct 2019 21:08:17 +0000 Received: from localhost ([127.0.0.1]:49026 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1iLD0K-00026X-RP for submit <at> debbugs.gnu.org; Thu, 17 Oct 2019 17:08:16 -0400 Received: from gateway23.websitewelcome.com ([192.185.49.184]:23024) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1iLD0J-00026P-4V for 22873 <at> debbugs.gnu.org; Thu, 17 Oct 2019 17:08:15 -0400 Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway23.websitewelcome.com (Postfix) with ESMTP id B39623BA3C for <22873 <at> debbugs.gnu.org>; Thu, 17 Oct 2019 16:08:14 -0500 (CDT) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id LD0Hitp9FPUvSLD0HiQodZ; Thu, 17 Oct 2019 16:08:14 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=UzFSKs/OikRZULaPfZ1jYqSboVJl9VUoPk9Ssk8nb60=; b=ZSvj0/PLVr2DtsRmWWeM64ZF9u K61N6EYx5Qxd8TPT/UfS9Q0JJNO6KEToN72Ipvj6dMtbb82/JNe5A4aAeRL1mV6fr/mPiB0JrsoA+ RY2iw70s2dzKCdkG2PNK28fcRkDSvOEaOzGMtTakaxe8R94khWxqlvvqm3DfMqROWPE1/IWy50zAg vXtZWwPVv0dXe7dIy9iWeKlaOKxdZAA4YRTx1C1BmDI6rXH8nVeAyRhjOC4gNtiAkCB8ggKWH9tVS N65A21SINAe+A5qxr0vDsQF6jg/NqcCqVx6aqj6BA2LSgKeDEzXNlxAF0I5OmLES8v71N5WSnxeOV v+OcYZ7Q==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:53337 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from <esq@HIDDEN>) id 1iLD0D-002orx-En; Thu, 17 Oct 2019 16:08:12 -0500 Date: Thu, 17 Oct 2019 14:08:08 -0700 Message-ID: <m236frozbb.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Thu_Oct_17_14:08:08_2019-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1iLD0D-002orx-En X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:53337 X-Source-Auth: lawlist X-Email-Count: 7 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> --Multipart_Thu_Oct_17_14:08:08_2019-1 Content-Type: text/plain; charset=US-ASCII VERSION: 022.004 [10/17/2019] CHANGELOG: - HORIZONTAL_RULER: Fixed a bug in `mc_engine' when a STRETCH_GLYPH is the last glyph of the display line and the floating horizontal ruler needs to extend all the way to the window edge. [The `fx` coordinate needed to be advanced.] - Fixed a bug that occasionally erased the real fake cursor and sometimes the characters to the left/right thereof when overlapping exists. This was due to `display_and_set_cursor' being called when one or more of the fake cursor caches was still populated, even though the relevant buffer-local variables were nil. [A check has been added to ascertain whether any of the caches are populated.] - Miscellaneous tidying-up of code. VIDEOS: w32: https://youtu.be/r3BdJVlsAnQ ns: https://youtu.be/bc1h8jtbXmw x11: https://youtu.be/aCIFhD2Xz5s SCREENSHOTS: https://www.lawlist.com/images/22873_17684_light_dark_backgrounds.png SETUP: Step 1: git clone -b master git://git.sv.gnu.org/emacs.git Step 2: In the new emacs folder, go back to an Emacs version from 07/14/2019: git reset --hard ac57c5093829ee09084c562bbbc1c412179be13d Step 3: From within the new emacs folder created in Step 1, apply the patch: git apply /path/to/the/patch.diff Step 4: ./autogen.sh Step 5: ./configure ... [your custom options] Step 6: make Step 7: make install USAGE: - For a minimal working example of built-in fake cursors, type: M-x mc-test ;;; TURN ON FAKE CURSORS (buffer position, cursor-type, cursor color): (setq mc-conf '((1 "hbar" "magenta") (2 "bar" "purple") (3 "box" "#00FF00") (4 "hollow" "#0000FF") (5 ("hbar" 3) [1.0 0.0 1.0]) (6 ("bar" 3) [0.0 1.0 1.0]) (7 "framed" "OrangeRed"))) ;;; TURN OFF FAKE CURSORS: (setq mc-conf nil) - To try out both the crosshairs feature and the visible fill column indicator feature, type: M-x +-mode - To try out just the visible fill column indicator feature, type: M-x fc-mode - To try out built-in fake cursors with Magnar Sveen's multiple-cursors package, that package must be installed. If the multiple-cursors package is already installed, then just (require 'crosshairs) and `crosshairs.el` will redefine a few of the multiple-cursors functions and set up a few keyboard shortcuts. If the multiple-cursors package by Magnar Sveen is not already installed, then here are two easy ways to install that package: Type: M-x mc-install OR, evaluate the following snippet: (progn (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) (package-refresh-contents) (package-install 'multiple-cursors) (mc/built-in-cursors)) NOTES: - Our journey begins at the outset of `update_window' when `mc_update_window_dryrun' performs a `!draw_p` simulation to create a new cache of fake cursors that are stored in the `w->mc_matrix`. The cache of fake cursors from the previous redisplay is copied to a temporary `mc_matrix` under the name of `old_matrix`. `mc_update_text_area' (used for `!draw_p` / `draw_p` situations) calls `mc_draw_glyphs' (writes glyphs to the glass) followed by `mc_draw_row' (writes fake cursors to the glass immediately thereafter). At the tail end of `mc_update_window_dryrun', `mc_update_window_erase' compares the new `w->mc_matrix` with the `old_matrix` to determine which fake cursors are the same -- setting the `same_p` boolean struct member accordingly for each applicable fake cursor within the `w->mc_matrix`. All fake cursors in the `old_matrix` that are `!same_p` get erased at this juncture. [Fn 1.] After the dryrun is complete, `update_window' does the real thing -- `draw_p`. As to the `from_where` situations of SKIPPED, POST_CHANGED, UNCHANGED, and SET_CURSOR_TWO, `mc_helper' compares the incoming tentative fake cursor with the `w->mc_matrix` to see if it has previously been marked as `same_p` -- if it is `!same_p`, then the fake cursor is drawn and we `return`. Fake cursors that have a `cursor_type` of MC_LEFT_FRINGE_BITMAP or MC_RIGHT_FRINGE_BITMAP are always reset even if they are `same_p`. As to the `from_where` situations of SCRIBE_ONE, SCRIBE_TWO, SCRIBE_THREE, and NOWHERE, `mc_helper' always causes fake cursors to be drawn (because new glyphs were written to the glass, or the area to the right of the display line was cleared) and we `return`. . Fn. 1: Even though writing new glyphs to the glass (SCRIBE_ONE, SCRIBE_TWO, and SCRIBE_THREE) would erase fake cursors within those boundaries, it is still necessary to erase `!same_p` fake cursors prior thereto. This is because `scrolling_window' occurs before new glyphs are written and `rif->scroll_run_hook' may copy one or more rows to other areas of the glass. It is not worth the effort to programmatically track both the _copied_ fake cursors and the _original_ fake cursors from the previous redisplay cycle, whose glyphs may remain where they are in the current redisplay cycle because they satisfy the `GLYPH_EQUAL_P' test. - The rest of our journey takes place wherever `draw_glyphs' would ordinarily be called, excluding `update_text_area'. If features 17684/22873 are active, `mc_redraw_row' calls `mc_draw_glyphs' (writes glyphs to the glass) and fake cursors are written to the glass immediately thereafter (if the coordinates coincide with prerecorded data in the `w->mc_matrix`). The functions containing the aforementioned calls are: . `gui_insert_glyphs' . `gui_fix_overlapping_area' . `draw_row_with_mouse_face' . `expose_area' . `expose_line' . `redraw_overlapped_rows' [which has been incorporated into `update_window'] - As to `mc_scrolling_window', it would appear that there is no tangible benefit to rotating the current/prospective cache of fake cursors to compare the data before removing the fake cursors. When scrolling the display, only _some_ lines are copied to new locations. Areas that are not overwritten may have fake cursors and those may not necessarily be removed if desired/current matrix glyphs are equal. The test for `GLYPH_EQUAL_P' does not take into consideration the existence of a fake cursor, and the glyph (with a fake cursor) may not be updated as a result thereof. As to lines that are not copied, portions may be updated and fake cursors would be removed thereby. `mc_rotate_matrix' and `mc_reverse_vpos' were removed with patch v. 022.002. - NS: As of 09/28/2018 (7946445962372c4255180af45cb7c857f1b0b5fa), the NS port no longer does anything useful during `update_window' except mark dirty rectangles. All drawing is now done when the MacOS calls `drawRect', which in turn calls `expose_frame'. TODO: - When an idle-timer fires and point is at the end of a horizontally scrolled line in a narrow window, the temporary horizontal scroll is canceled. Create a minimal working example and file a bug report. (progn (defun test () (interactive) (let ((ov (make-overlay (point) (1+ (point)) nil t t))) (overlay-put ov 'face '(:foreground "red")))) (global-set-key [f5] 'test) (split-window-horizontally) (switch-to-buffer (get-buffer-create "foo")) (setq bidi-display-reordering nil) (setq-local auto-hscroll-mode 'current-line) (dotimes (i 80) (insert (char-to-string (+ 65 i))))) - `ns_draw_window_cursor' calls `ns_clip_to_rect', which does _not_ take `row->clip` into consideration when drawing cursors with `NSRectFill'. When it comes time to draw glyphs on top of the box/hollow family of cursors, `row->clip` is taken into consideration by `get_glyph_string_clip'. Fake cursors can be drawn even though the glyphs cannot, resulting in hollow/box family of cursors without text. The issue can be reproduced with M-x mc-test. [A temporary workaround is to disable `row->clip` while drawing the glyphs.] https://lists.gnu.org/archive/html/emacs-devel/2019-04/msg00009.html - Deal with left/right overwritten glyphs in the w32 and X ports of Emacs. - There is a bug affecting the recorded `w->mc.lnum_pixel_width` that is observable when not running under gdb, but disappears when running under gdb. While viewing a folded org-mode buffer, the non-gdb instance had a visible line number pixel-width of 44, but Emacs treated it as fluctuating between 44 and 55 as the cursor was moved to the end of line. In the gdb instance, the visible line number pixel width was 55 with no fluctuation under the same conditions as the non-gdb instance. This appears to be a different bug than bug#32177 (current line number shifts one column to the left) because the line number of the current line does not shift left, and changing the bidi settings did not correct the issue. - The current test for `auto_hscroll_mode_p' only looks for `current_line` and all five related tests are based upon that assumption, which may not be true. - Multiple Cursors: If point is in the middle of a composite character, then select a fully composed character so that the fake cursor is visible. - Implement functionality similar to the Lisp multiple-cursors by Magnar Sveen. - Follow up with the Emacs team re bug#32177; i.e., (Current line number shifts one column to the left.) - Follow up with the Emacs team re bug#32060; i.e., Horizontal Scrolling (Current Line): Wrong line gets h-scrolled. - Determine if bug #28936 needs to be fixed and help the Emacs team re same. - Is there any additional meaningful optimization that can be added to the three calls of `mc_pre_scroll_clean'? - There is a bug affecting an older version of Emacs for the NS port that causes partial line flickering when the same characters are grouped together (;;;;;;) and MC_GLYPHLESS cursors are above or below -- having the same background color as the frame; e.g., black on black (used to erase a glyphless cursor). The partial flickering is only noticeable with rapid fire; e.g., holding down the right/left arrow key. When changing the color of the glyphless cursor, the issue is not present. [@lawlist has verified that the X and HPOS coordinates are accurate.] --Multipart_Thu_Oct_17_14:08:08_2019-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="2019_10_17__13_42_27_237.diff" Content-Transfer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vciwgdG8gaW5mb3JtIGFi b3V0IHRoZSBsYWNrIG9mIHN1cHBvcnQuIgorICAgICh1bmxlc3MgbWMtLWV4ZWN1dGluZy1jb21t YW5kLWZvci1mYWtlLWN1cnNvcgorICAgICAgKGlmIChlcSAxIChtYy9udW0tY3Vyc29ycykpIDs7 IG5vIGZha2UgY3Vyc29ycz8gZGlzYWJsZSBtYy1tb2RlCisgICAgICAgICAgKG11bHRpcGxlLWN1 cnNvcnMtbW9kZSAwKQorICAgICAgICAod2hlbiB0aGlzLW9yaWdpbmFsLWNvbW1hbmQKKyAgICAg ICAgICAobGV0ICgob3JpZ2luYWwtY29tbWFuZCAob3IgbWMtLXRoaXMtY29tbWFuZAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29tbWFuZC1yZW1hcHBpbmcgdGhpcy1v cmlnaW5hbC1jb21tYW5kKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0 aGlzLW9yaWdpbmFsLWNvbW1hbmQpKSkKKyAgICAgICAgICAgIDs7IHNraXAga2V5Ym9hcmQgbWFj cm9zLCBzaW5jZSB0aGV5IHdpbGwgZ2VuZXJhdGUgYWN0dWFsIGNvbW1hbmRzIHRoYXQgYXJlCisg ICAgICAgICAgICA7OyBhbHNvIHJ1biBpbiB0aGUgY29tbWFuZCBsb29wIC0gd2UnbGwgaGFuZGxl IHRob3NlIGxhdGVyIGluc3RlYWQuCisgICAgICAgICAgICAod2hlbiAoZnVuY3Rpb25wIG9yaWdp bmFsLWNvbW1hbmQpCisgICAgICAgICAgICAgIDs7IGlmIGl0J3MgYSBsYW1iZGEsIHdlIGNhbid0 IGtub3cgaWYgaXQncyBzdXBwb3J0ZWQgb3Igbm90CisgICAgICAgICAgICAgIDs7IC0gc28gZ28g YWhlYWQgYW5kIGFzc3VtZSBpdCdzIG9rLCBiZWNhdXNlIHdlJ3JlIGp1c3Qgb3B0aW1pc3RpYyBs aWtlIHRoYXQKKyAgICAgICAgICAgICAgKGlmIChvciAobm90IChzeW1ib2xwIG9yaWdpbmFsLWNv bW1hbmQpKQorICAgICAgICAgICAgICAgICAgICAgIDs7IGxhbWJkYSByZWdpc3RlcmVkIGJ5IHNt YXJ0cmVwCisgICAgICAgICAgICAgICAgICAgICAgKHN0cmluZy1wcmVmaXgtcCAiKCIgKHN5bWJv bC1uYW1lIG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAgICAgICAgICAgICAgICAgIChtYy9leGVjdXRl LWNvbW1hbmQtZm9yLWFsbC1mYWtlLWN1cnNvcnMgb3JpZ2luYWwtY29tbWFuZCkKKyAgICAgICAg ICAgICAgICA7OyBzbWFydHJlcCBgaW50ZXJuJ3MgY29tbWFuZHMgaW50byBvd24gb2JhcnJheSB0 byBoZWxwCisgICAgICAgICAgICAgICAgOzsgYGRlc2NyaWJlLWJpbmRpbmdzJy4gIFNvLCBsZXQn cyByZS1gaW50ZXJuJyBoZXJlIHRvCisgICAgICAgICAgICAgICAgOzsgbWFrZSB0aGUgY29tbWFu ZCBjb21wYXJhYmxlIGJ5IGBlcScuCisgICAgICAgICAgICAgICAgKHNldHEgb3JpZ2luYWwtY29t bWFuZCAoaW50ZXJuIChzeW1ib2wtbmFtZSBvcmlnaW5hbC1jb21tYW5kKSkpCisgICAgICAgICAg ICAgICAgOzsgb3RoZXJ3aXNlIGl0J3MgYSBzeW1ib2wsIGFuZCB3ZSBjYW4gYmUgbW9yZSB0aG9y b3VnaAorICAgICAgICAgICAgICAgIChpZiAoZ2V0IG9yaWdpbmFsLWNvbW1hbmQgJ21jLS11bnN1 cHBvcnRlZCkKKyAgICAgICAgICAgICAgICAgICAgKG1lc3NhZ2UgIiVTIGlzIG5vdCBzdXBwb3J0 ZWQgd2l0aCBtdWx0aXBsZSBjdXJzb3JzJXMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg IG9yaWdpbmFsLWNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdldCBvcmln aW5hbC1jb21tYW5kICdtYy0tdW5zdXBwb3J0ZWQpKQorICAgICAgICAgICAgICAgICAgKHdoZW4g KGFuZCBvcmlnaW5hbC1jb21tYW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChub3Qg KG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy0tZGVmYXVsdC1jbWRzLXRvLXJ1bi1vbmNlKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKG5vdCAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1j L2NtZHMtdG8tcnVuLW9uY2UpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAob3IgbWMv YWx3YXlzLXJ1bi1mb3ItYWxsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVt cSBvcmlnaW5hbC1jb21tYW5kIG1jLS1kZWZhdWx0LWNtZHMtdG8tcnVuLWZvci1hbGwpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jL2Nt ZHMtdG8tcnVuLWZvci1hbGwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWMv cHJvbXB0LWZvci1pbmNsdXNpb24taW4td2hpdGVsaXN0IG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAg ICAgICAgICAgICAgICAgICAgKG1jL2V4ZWN1dGUtY29tbWFuZC1mb3ItYWxsLWZha2UtY3Vyc29y cyBvcmlnaW5hbC1jb21tYW5kKSkpKQorICAgICAgICAgICAgICAod2hlbiBtYy91c2UtYnVpbHQt aW4tY3Vyc29ycworICAgICAgICAgICAgICAgIChzZXRxIG1jLWNvbmYKKyAgICAgICAgICAgICAg ICAgICAgICAgIChtYXBjYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKGxhbWJkYSAoeCkg KGxpc3QgKG92ZXJsYXktc3RhcnQgeCkgImJhciIgbmlsKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgKG1jL2FsbC1mYWtl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QhIikKKyAgICAgIChzZXRxIG1jLWNvbmYgJygoMSAiaGJhciIgIm1hZ2Vu dGEiKQorICAgICAgICAgICAgICAgICAgICAgICgyICJiYXIiICJwdXJwbGUiKQorICAgICAgICAg ICAgICAgICAgICAgICgzICJib3giICIjMDBGRjAwIikKKyAgICAgICAgICAgICAgICAgICAgICAo NCAiaG9sbG93IiAiIzAwMDBGRiIpCisgICAgICAgICAgICAgICAgICAgICAgKDUgKCJoYmFyIiAz KSBbMS4wIDAuMCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg2ICgiYmFyIiAzKSBbMC4w IDEuMCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg3ICJmcmFtZWQiICJPcmFuZ2VSZWQi KQorICAgICAgICAgICAgICAgICAgICAgICg4ICJib3giICJncmV5MjUiKQorICAgICAgICAgICAg ICAgICAgICAgICg5ICJib3giICJncmV5NzUiKSkpKQorICAgIChzZWxlY3Qtd2luZG93IChkaXNw bGF5LWJ1ZmZlciBidWZmZXIpKSkpCisKKyhkZWZ1biArLXRpbWVyLWZuICgpCisiU2luY2UgdGhp cyBmaXJlcyBnbG9iYWxseSwgd2UgbXVzdCBjb250cm9sIHdoaWNoIGJ1ZmZlcnMgY3Jvc3NoYWly cyBhcHBlYXIgaW4uIgorICAod2hlbiArLW1vZGUKKyAgICAodW5sZXNzIChvciAobWVtcSBsYXN0 LWNvbW1hbmQgKy1wYXJlbnMtZXhjbHVzaW9ucykKKyAgICAgICAgICAgICAgICAobnVsbCArLXBh cmVucy1wKSkKKyAgICAgICgrLXBhcmVucy1mbikpCisgICAgKHdoZW4gKy10aW1lci12YXIKKyAg ICAgIChzZXRxIHRpbWVyLWlkbGUtbGlzdCAoZGVscSArLXRpbWVyLXZhciB0aW1lci1pZGxlLWxp c3QpKQorICAgICAgKHNldHEgKy10aW1lci12YXIgbmlsKSkpKQorCisoZGVmdW4gKy1kcmF3LWZv cnRod2l0aCAoKQorIkltbWVkaWF0ZWx5IGRlbGV0ZS9kcmF3IG1hdGNoaW5nIHBhcmVudGhlc2Vz LiIKKyAgKCstZHJhdy1jcm9zc2hhaXJzICdmb3JjZSkpCisKKyhkZWZ1biArLWRyYXctY3Jvc3No YWlycyAoJm9wdGlvbmFsIGZvcmNlKQorIkltbWVkaWF0ZWx5IGRlbGV0ZSBtYXRjaGluZyBwYXJl bnRoZXNlcy4gIElmIEZPUkNFIGlzIG5vbi1uaWwsIHRoZW4gaW1tZWRpYXRlbHkKK2RyYXcgbWF0 Y2hpbmcgcGFyZW50aGVzaXM7IG90aGVyd2lzZSwgZHJhdyB0aGVtIG9uIGFuIGlkbGUtdGllci4i CisgICh3aGVuICstbW9kZQorICAgICh3aGVuICstdGltZXItdmFyCisgICAgICAoc2V0cSB0aW1l ci1pZGxlLWxpc3QgKGRlbHEgKy10aW1lci12YXIgdGltZXItaWRsZS1saXN0KSkKKyAgICAgIChz ZXRxICstdGltZXItdmFyIG5pbCkpCisgICAgKHVubGVzcyAob3IgKG1lbXEgdGhpcy1jb21tYW5k ICstcGFyZW5zLWV4Y2x1c2lvbnMpCisgICAgICAgICAgICAgICAgKGFuZCAobnVsbCArLXBhcmVu cy1wKQorICAgICAgICAgICAgICAgICAgICAgKG51bGwgKy1wYXJlbnMtb3ZlcmxheXMtZXhpc3Qt cCkpKQorICAgICAgKCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykpCisgICAgKGlmIGZvcmNlCisg ICAgICAocHJvZ24KKyAgICAgICAgKHdoZW4gKy1wYXJlbnMtcAorICAgICAgICAgICgrLXBhcmVu cy1mbikpKQorICAgICAgKHNldHEgKy10aW1lci12YXIgKHJ1bi13aXRoLWlkbGUtdGltZXIgKy1p ZGxlLXRpbWVyLXNlY29uZHMgbmlsICMnKy10aW1lci1mbikpKSkpCisKKyhkZWZ2YXIgZmMtbW9k ZSkKKworOzs7IyMjYXV0b2xvYWQKKyhkZWZpbmUtbWlub3ItbW9kZSArLW1vZGUKKyJNaW5vciBt b2RlIGZvciBkaXNwbGF5aW5nIGEgaG9yaXpvbnRhbCBydWxlci4iCisgIDppbml0LXZhbHVlIG5p bAorICA6bGlnaHRlciAiICsiCisgIDprZXltYXAgbmlsCisgIDpnbG9iYWwgbmlsCisgIDpncm91 cCAnKy1tb2RlCisgIChjb25kCisgICAgKCstbW9kZQorICAgICAgOzs7IGArLW1vZGUnIGhhcyB0 aGUgYWJpbGl0eSB0byBhbHNvIGRpc3BsYXkgYSBmaWxsIGNvbHVtbiBpbmRpY2F0b3IuCisgICAg ICA7OzsgU2VlIHRoZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicuCisgICAgICAod2hlbiBmYy1t b2RlCisgICAgICAgIChmYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgZ2xvYmFsLWVsZG9j LW1vZGUKKyAgICAgICAgICAgICAgICAgKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAgJ2FueSkKKyAg ICAgICAgICAgICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAgICAgICAg KGdsb2JhbC1lbGRvYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgaml0LWxvY2stY29udGV4 dC10aW1lcgorICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQor ICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAg ICAod2hlbiAodGltZXJwIGppdC1sb2NrLWNvbnRleHQtdGltZXIpCisgICAgICAgICAgKGNhbmNl bC10aW1lciBqaXQtbG9jay1jb250ZXh0LXRpbWVyKSkKKyAgICAgICAgOzsgKHNldHEgaml0LWxv Y2stY29udGV4dC10aW1lciAocnVuLXdpdGgtaWRsZS10aW1lciA1LjAgJ3JlcGVhdCAnaml0LWxv Y2stY29udGV4dC1mb250aWZ5KSkKKyAgICAgICAgKHNldHEgaml0LWxvY2stY29udGV4dC10aW1l ciBuaWwpKQorICAgICAgKHdoZW4gKGFuZCAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQor ICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAg ICAod2hlbiAodGltZXJwIHVuZG8tYXV0by1jdXJyZW50LWJvdW5kYXJ5LXRpbWVyKQorICAgICAg ICAgIChjYW5jZWwtdGltZXIgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpKQorICAg ICAgICAoZnNldCAndW5kby1hdXRvLS11bmRvYWJsZS1jaGFuZ2UKKyAgICAgICAgICAgICAgKGxh bWJkYSAoKSAoYWRkLXRvLWxpc3QgJ3VuZG8tYXV0by0tdW5kb2FibHktY2hhbmdlZC1idWZmZXJz IChjdXJyZW50LWJ1ZmZlcikpKSkKKyAgICAgICAgKGZzZXQgJ3VuZG8tYXV0by1hbWFsZ2FtYXRl ICdpZ25vcmUpKQorICAgICAgKHdoZW4gYmxpbmstY3Vyc29yLW1vZGUKKyAgICAgICAgKGJsaW5r LWN1cnNvci1tb2RlIC0xKQorICAgICAgICAod2hlbiAobWVtcSAnYmxpbmstY3Vyc29yLWNoZWNr IHBvc3QtY29tbWFuZC1ob29rKQorICAgICAgICAgIChyZW1vdmUtaG9vayAncG9zdC1jb21tYW5k LWhvb2sgJ2JsaW5rLWN1cnNvci1jaGVjaykpKQorICAgICAgKHNldHEgY3Jvc3NoYWlycyB0KQor ICAgICAgKHdoZW4gKy1maWxsLWNvbHVtbgorICAgICAgICAoc2V0cSBmYy12aXNpYmxlIHQpKQor ICAgICAgOzs7IGBhdXRvLWNvbXBvc2l0aW9uLW1vZGUnIGlzIG5lZWRlZCBmb3IgY3Jvc3NoYWly cyB0byBwcm9wZXJseSBjYWxjdWxhdGUKKyAgICAgIDs7OyBjb29yZGluYXRlcyBvZiBjb21wb3Np dGlvbiBjaGFyYWN0ZXJzLiAgQXV0b21hdGljYWxseSBiZWNvbWVzIHBlcm1hbmVudGx5CisgIC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G93cworICAgICAgICAgICAgICAgICAgICAgd29yZC13 cmFwKSkKKyAgICAgICAgKHdoZW4gKGxvY2FsLXZhcmlhYmxlLXAgdmFyKQorICAgICAgICAgIChw dXNoIChjb25zIHZhciAoc3ltYm9sLXZhbHVlIHZhcikpICstLXNhdmVkLXN0YXRlKSkpCisgICAg ICAoc2V0cSBmaWxsLWNvbHVtbiA4MCkKKyAgICAgIChzZXRxIGRpc3BsYXktbGluZS1udW1iZXJz IHQpCisgICAgICAoc2V0cS1sb2NhbCBhdXRvLWhzY3JvbGwtbW9kZSAnY3VycmVudC1saW5lKQor ICAgICAgKHNldHEtbG9jYWwgaHNjcm9sbC1zdGVwIDUpCisgICAgICAoc2V0cSBidWZmZXItZGlz cGxheS10YWJsZSArLWJ1ZmZlci1kaXNwbGF5LXRhYmxlKQorICAgICAgKHNldHEgdGFiLXdpZHRo IDQpCisgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICdsaW5lLW1vdmUtdmlzdWFsKSB0 KQorICAgICAgKHNldHEgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgKGNvbmQKKyAgICAgICAgICAo KGxldCAoKGxzdCArLXRydW5jYXRlLWxpbmVzLWRlcml2ZWQtbW9kZXMpCisgICAgICAgICAgICAg ICAgICBtb2RlKQorICAgICAgICAgICAgKGNhdGNoICdmb3VuZAorICAgICAgICAgICAgICAod2hp bGUgKHNldHEgbW9kZSAocG9wIGxzdCkpCisgICAgICAgICAgICAgICAgKHdoZW4gKGRlcml2ZWQt bW9kZS1wIG1vZGUpCisgICAgICAgICAgICAgICAgICAodGhyb3cgJ2ZvdW5kIHQpKSkpKSkKKyAg ICAgICAgICAgKChtZW1xIG1ham9yLW1vZGUgKy10cnVuY2F0ZS1saW5lcy1tYWpvci1tb2Rlcykp CisgICAgICAgICAgICh0CisgICAgICAgICAgICAgbmlsKSkpCisgICAgICAoc2V0IChtYWtlLWxv Y2FsLXZhcmlhYmxlICd0cnVuY2F0ZS1wYXJ0aWFsLXdpZHRoLXdpbmRvd3MpIG5pbCkKKyAgICAg IChzZXRxIHdvcmQtd3JhcCB0KQorICAgICAgKHNldHEgaW5kaWNhdGUtZW1wdHktbGluZXMgdCkK KyAgICAgIChzZXRxIGluZGljYXRlLWJ1ZmZlci1ib3VuZGFyaWVzICdsZWZ0KQorICAgICAgKHNl dHEgZnJpbmdlLWluZGljYXRvci1hbGlzdAorICAgICAgICAgIDs7OyBoc2NsX2FsbF90ZW1wX3Ag fCBoc2NsX3RlbXBfcAorICAgICAgICAnKCgrLWhzY2wtdGVtcCAuICgrLXNpbmdsZS1hbmdsZS1s ZWZ0CisgICAgICAgICAgICAgICAgICAgICAgICAgICstZG91YmxlLWFuZ2xlLWxlZnQpKQorICAg ICAgICAgIDs7OyBoc2NsX2FsbF9wZXJtXzBfcCB8IGhzY2xfYWxsX3Blcm1fMV9wIHwgaHNjbF9h bGxfcGVybV8yX3AgfCBoc2NsX3Blcm1fcAorICAgICAgICAgICgrLWhzY2wtcGVybSAuICgrLXNp bmdsZS1hbmdsZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLWRvdWJsZS1hbmdsZS11 cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLXRyaXBsZS1hbmdsZS11cAorICAgICAgICAg ICAgICAgICAgICAgICAgICArLXF1YWRydXBsZS1hbmdsZS11cCkpCisgICAgICAgICAgKCstb3Zl cmxheS1hcnJvdyAuICgrLWZyaW5nZS1sZWZ0LWFycm93CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICArLWZyaW5nZS1yaWdodC1hcnJvdykpCisgICAgICAgICAgKHRydW5jYXRpb24gLiAo Ky1mcmluZ2UtbGVmdC1hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICstZnJpbmdlLXJp Z2h0LWFycm93KSkKKyAgICAgICAgICAoY29udGludWF0aW9uIC4gKCstZnJpbmdlLWxlZnQtY3Vy bHktYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICstYmFja3NsYXNoKSkKKyAgICAg ICAgICAob3ZlcmxheS1hcnJvdyAuICstZnJpbmdlLXJpZ2h0LXRyaWFuZ2xlKQorICAgICAgICAg ICh1cCAuICstZnJpbmdlLXVwLWFycm93KQorICAgICAgICAgIChkb3duIC4gKy1mcmluZ2UtZG93 bi1hcnJvdykKKyAgICAgICAgICAodG9wIC4gKy1mcmluZ2UtdG9wLWxlZnQtYW5nbGUpCisgICAg ICAgICAgKGJvdHRvbSAuICstZnJpbmdlLWJvdHRvbS1yaWdodC1hbmdsZSkKKyAgICAgICAgICAo dG9wLWJvdHRvbSAuICgrLWZyaW5nZS1sZWZ0LWJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAg ICAgICArLWZyaW5nZS1yaWdodC1icmFja2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgKy1m cmluZ2UtdG9wLXJpZ2h0LWFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgKy1mcmluZ2Ut dG9wLWxlZnQtYW5nbGUpKQorICAgICAgICAgIChlbXB0eS1saW5lIC4gKy1mcmluZ2UtZW1wdHkt bGluZSkKKyAgICAgICAgICAodW5rbm93biAuICstZnJpbmdlLXF1ZXN0aW9uLW1hcmspKSkKKyAg ICAgIChzZXRxIGZyaW5nZS1jdXJzb3ItYWxpc3QgJygoYm94IC4gKy1mcmluZ2UtbGVmdC10cmlh bmdsZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaG9sbG93IC4gKy1ob2xs b3ctcmVjdGFuZ2xlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChiYXIgLiAr LXZlcnRpY2FsLWJhcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaGJhciAu ICstZnJpbmdlLWhvcml6b250YWwtYmFyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIChob2xsb3ctc21hbGwgLiArLWZyaW5nZS1ob2xsb3ctc3F1YXJlKSkpCisgICAgICAoaWYg KG9yICstZm9ydGh3aXRoCisgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcg Jyg0KSkpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJhdy1mb3J0 aHdpdGggJ2FwcGVuZCAnbG9jYWwpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhv b2sgJystZHJhdy1jcm9zc2hhaXJzICdhcHBlbmQgJ2xvY2FsKSkKKyAgICAgICh3aGVuICstZm9y dGh3aXRoCisgICAgICAgIChhZGQtaG9vayAnd2luZG93LWNvbmZpZ3VyYXRpb24tY2hhbmdlLWhv b2sgJystZHJhdy1mb3J0aHdpdGggbmlsICdsb2NhbCkpCisgICAgICAoYWRkLWhvb2sgJ2NoYW5n ZS1tYWpvci1tb2RlLWhvb2sgJ3R1cm4tb2ZmLSstbW9kZSBuaWwgJ2xvY2FsKQorICAgICAgOzs7 IE1hdGNoaW5nIHBhcmVudGhlc2VzIGRyYXdpbmcgZm9ydGh3aXRoIGludGVyZmVyZXMgd2l0aCB5 YXNuaXBwZXQuCisgICAgICAod2hlbiArLWZvcnRod2l0aAorICAgICAgICAoc2V0cSArLXBhcmVu cy1wIG5pbCkpCisgICAgICAod2hlbiAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAg ICAgICAoY29uZAorICAgICAgICAgICgrLWZvcnRod2l0aAorICAgICAgICAgICAgKG1lc3NhZ2Ug IlR1cm5lZCBPTiBgKy1tb2RlJyAtLSBEcmF3IG1hdGNoaW5nIHBhcmVudGhlc2VzIGltbWVkaWF0 ZWx5LiIpKQorICAgICAgICAgICgoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpCisgICAg ICAgICAgICA7OzsgTWF0Y2hpbmcgcGFyZW50aGVzZXMgd2lsbCBiZSBkcmF3biBpbW1lZGlhdGVs eS4KKyAgICAgICAgICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZ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lhYmxlICdpbmRpY2F0ZS1idWZmZXItYm91bmRhcmllcykKKyAg ICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdmcmluZ2UtaW5kaWNhdG9yLWFsaXN0KQorICAgICAg KGtpbGwtbG9jYWwtdmFyaWFibGUgJ2ZyaW5nZS1jdXJzb3ItYWxpc3QpCisgICAgICAoa2lsbC1s b2NhbC12YXJpYWJsZSAnKy1mb3J0aHdpdGgpCisgICAgICAoZG9saXN0IChzYXZlZCArLS1zYXZl ZC1zdGF0ZSkKKyAgICAgICAgKHNldCAobWFrZS1sb2NhbC12YXJpYWJsZSAoY2FyIHNhdmVkKSkg KGNkciBzYXZlZCkpKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJystLXNhdmVkLXN0YXRl KQorICAgICAgKCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykKKyAgICAgICh3aGVuIChtZW1xICcr LWRyYXctZm9ydGh3aXRoIHBvc3QtY29tbWFuZC1ob29rKQorICAgICAgICAocmVtb3ZlLWhvb2sg J3Bvc3QtY29tbWFuZC1ob29rICcrLWRyYXctZm9ydGh3aXRoICdsb2NhbCkpCisgICAgICAod2hl biAobWVtcSAnKy1kcmF3LWNyb3NzaGFpcnMgcG9zdC1jb21tYW5kLWhvb2spCisgICAgICAgIChy ZW1vdmUtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJhdy1jcm9zc2hhaXJzICdsb2NhbCkp CisgICAgICAod2hlbiAobWVtcSAnKy1kcmF3LWZvcnRod2l0aCB3aW5kb3ctY29uZmlndXJhdGlv bi1jaGFuZ2UtaG9vaykKKyAgICAgICAgKHJlbW92ZS1ob29rICd3aW5kb3ctY29uZmlndXJhdGlv bi1jaGFuZ2UtaG9vayAnKy1kcmF3LWZvcnRod2l0aCAnbG9jYWwpKQorICAgICAgKHJlbW92ZS1o b29rICdjaGFuZ2UtbWFqb3ItbW9kZS1ob29rICd0dXJuLW9mZi0rLW1vZGUgJ2xvY2FsKQorICAg ICAgKHdoZW4gKy10aW1lci12YXIKKyAgICAgICAgKHNldHEgdGltZXItaWRsZS1saXN0IChkZWxx ICstdGltZXItdmFyIHRpbWVyLWlkbGUtbGlzdCkpCisgICAgICAgIChzZXRxICstdGltZXItdmFy IG5pbCkpCisgICAgICAod2hlbiAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAg ICAobWVzc2FnZSAiVHVybmVkIE9GRiBgKy1tb2RlJy4iKSkpKSkKKworKGRlZnVuIHR1cm4tb2Zm LSstbW9kZSAoKQorICAoKy1tb2RlIC0xKSkKKworOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7CisK KyhkZWZ1biArLXBhcmVucy1mbiAoKQorICAiRG9jLXN0cmluZy4iCisgIChsZXQqICgob3BvaW50 IChwb2ludCkpCisgICAgICAgICAoZnJvbSAoaWYgKy1wYXJlbnMtZnJvbS1mbgorICAgICAgICAg ICAgICAgICAoZnVuY2FsbCArLXBhcmVucy1mcm9tLWZuKQorICAgICAgICAgICAgICAgICAocG9p bnQtbWluKSkpCisgICAgICAgICAod2luIChzZWxlY3RlZC13aW5kb3cpKQorICAgICAgICAgKGkg MCkKKyAgICAgICAgIChwcmVjZWRpbmctY2hhciAocHJlY2VkaW5nLWNoYXIpKQorICAgICAgICAg KG9jaGFyIChjaGFyLWFmdGVyIG9wb2ludCkpCisgICAgICAgICAocG9zMQorICAgICAgICAgICAo Y29uZAorICAgICAgICAgICAgICgoYW5kIG9jaGFyCisgICAgICAgICAgICAgICAgICAgKG9yIDs7 OyAoY2hhci10by1zdHJpbmcgNDApID0+IG9wZW5pbmcgcGFyZW50aGVzaXMKKyAgICAgICAgICAg ICAgICAgICAgICAgKD0gb2NoYXIgNDApCisgICAgICAgICAgICAgICAgICAgICAgIDs7OyAoY2hh ci10by1zdHJpbmcgOTEpID0+IG9wZW5pbmcgc3F1YXJlIGJyYWNrZXQKKyAgICAgICAgICAgICAg ICAgICAgICAgKD0gb2NoYXIgOTEpCisgICAgICAgICAgICAgICAgICAgICAgIDs7OyAoY2hhci10 by1zdHJpbmcgMTIzKSA9PiBvcGVuaW5nIHdhdnkgYnJhY2tldAorICAgICAgICAgICAgICAgICAg ICAgICAoPSBvY2hhciAxMjMpKSkKKyAgICAgICAgICAgICAgICAobWluICgxKyBvcG9pbnQpIChw b2ludC1tYXgpKSkKKyAgICAgICAgICAgICAoKG9yIDs7OyAoY2hhci10by1zdHJpbmcgNDEpID0+ IGNsb3NpbmcgcGFyZW50aGVzaXMKKyAgICAgICAgICAgICAgICAgICg9IHByZWNlZGluZy1jaGFy IDQxKQorICAgICAgICAgICAgICAgICAgOzs7IChjaGFyLXRvLXN0cmluZyA5MykgPT4gY2xvc2lu ZyBzcXVhcmUgYnJhY2tldAorICAgICAgICAgICAgICAgICAgKD0gcHJlY2VkaW5nLWNoYXIgOTMp CisgICAgICAgICAgICAgICAgICA7OzsgKGNoYXItdG8tc3RyaW5nIDEyNSkgPT4gY2xvc2luZyB3 YXZ5IGJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICg9IHByZWNlZGluZy1jaGFyIDEyNSkpCisg ICAgICAgICAgICAgICAgKG1heCAocG9pbnQtbWluKSAoMS0gb3BvaW50KSkpCisgICAgICAgICAg ICAgKHQKKyAgICAgICAgICAgICAgICBvcG9pbnQpKSkKKyAgICAgICAgIHBvczIKKyAgICAgICAg IHNlbGVjdGVkLWZhY2UpCisgICAgKHNhdmUtZXhjdXJzaW9uCisgICAgICAoY29uZGl0aW9uLWNh c2UgbmlsCisgICAgICAgICh3aGlsZSAoc2V0cSBwb3MxIChudGggMSAocGFyc2UtcGFydGlhbC1z ZXhwIGZyb20gcG9zMSkpKQorICAgICAgICAgIChzZXRxIHBvczIgKHNjYW4tc2V4cHMgcG9zMSAx KSkKKyAgICAgICAgICAoaWYgKD0gaSAxMCkKKyAgICAgICAgICAgIChzZXRxIGkgMSkKKyAgICAg ICAgICAgIChzZXRxIGkgKDErIGkpKSkKKyAgICAgICAgICAoc2V0cSBzZWxlY3RlZC1mYWNlIChj b25kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDEpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLW9uZS1mYWNlKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAoKD0gaSAyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICcrLXBhcmVucy10d28tZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgKCg9IGkgMykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMt dGhyZWUtZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgNCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtZm91ci1mYWNlKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA1KQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICcrLXBhcmVucy1maXZlLWZhY2UpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICgoPSBpIDYpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JystcGFyZW5zLXNpeC1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0g aSA3KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1zZXZlbi1m YWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA4KQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1laWdodC1mYWNlKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA5KQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICcrLXBhcmVucy1uaW5lLWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICgoPSBpIDEwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBh cmVucy10ZW4tZmFjZSkpKQorICAgICAgICAgIChsZXQgKChvdiAobWFrZS1vdmVybGF5IHBvczEg KDErIHBvczEpKSkpCisgICAgICAgICAgICAodW5sZXNzICstcGFyZW5zLWluYWN0aXZlLXdpbmRv d3MKKyAgICAgICAgICAgICAgKG92ZXJsYXktcHV0IG92ICd3aW5kb3cgd2luKSkKKyAgICAgICAg ICAgIChvdmVybGF5LXB1dCBvdiAnZmFjZSBzZWxlY3RlZC1mYWNlKSkKKyAgICAgICAgICAod2hl biBwb3MyCisgICAgICAgICAgICAobGV0ICgob3YgKG1ha2Utb3ZlcmxheSAoMS0gcG9zMikgcG9z MikpKQorICAgICAgICAgICAgICAodW5sZXNzICstcGFyZW5zLWluYWN0aXZlLXdpbmRvd3MKKyAg ICAgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ3dpbmRvdyB3aW4pKQorICAgICAgICAgICAg ICAob3ZlcmxheS1wdXQgb3YgJ2ZhY2Ugc2VsZWN0ZWQtZmFjZSkpKSkKKyAgICAgICAgKGVycm9y IG5pbCkpKQorICAgIChzZXRxICstcGFyZW5zLW92ZXJsYXlzLWV4aXN0LXAgdCkpKQorCisoZGVm dW4gKy1yZW1vdmUtb3ZlcmxheXMgKGJlZyBlbmQgbmFtZSB2YWwpCisiUmVtb3ZlIHRoZSBvdmVy bGF5cyB0aGF0IGFyZSBgZXF1YWwtaW5jbHVkaW5nLXByb3BlcnRpZXNgLgorSW5jbHVkZXMgYSB1 bmlxdWUgc2l0dWF0aW9uIHdoZW4gYW4gb3ZlcmxheSB3aXRoIGFuIGAnYWZ0ZXItc3RyaW5nYCBw cm9wZXJ0eQoraXMgYXQgdGhlIHZlcnkgZW5kIG9mIGEgbmFycm93ZWQtYnVmZmVyLiIKKyAgKGxl dCogKChwb2ludC1tYXggKHBvaW50LW1heCkpCisgICAgICAgICAocG9pbnQtbWluIChwb2ludC1t aW4pKQorICAgICAgICAgKG5hcnJvd2VkLXAgKGJ1ZmZlci1uYXJyb3dlZC1wKSkKKyAgICAgICAg IChiZWcgKGlmIGJlZyBiZWcgcG9pbnQtbWluKSkKKyAgICAgICAgIChlbmQKKyAgICAgICAgICAg KGNvbmQKKyAgICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAobm90IG5hcnJvd2Vk LXApCisgICAgICAgICAgICAgICAgIGVuZCkKKyAgICAgICAgICAgICAgIGVuZCkKKyAgICAgICAg ICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAobm90IG5hcnJvd2VkLXApCisgICAgICAgICAg ICAgICAgIChudWxsIGVuZCkpCisgICAgICAgICAgICAgICBwb2ludC1tYXgpCisgICAgICAgICAg ICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFycm93ZWQtcAorICAgICAgICAgICAgICAgICBl bmQKKyAgICAgICAgICAgICAgICAgKDwgZW5kIHBvaW50LW1heCkpCisgICAgICAgICAgICAgICBl bmQpCisgICAgICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFycm93ZWQtcAorICAg ICAgICAgICAgICAgICBlbmQKKyAgICAgICAgICAgICAgICAgKD0gZW5kIHBvaW50LW1heCkpCisg ICAgICAgICAgICAgICAoMSsgZW5kKSkKKyAgICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAg ICAgICBuYXJyb3dlZC1wCisgICAgICAgICAgICAgICAgIChudWxsIGVuZCkpCisgICAgICAgICAg ICAgICAoMSsgcG9pbnQtbWF4KSkgKSkKKyAgICAgICAgIChvdmVybGF5cworICAgICAgICAgICAo cHJvZ24KKyAgICAgICAgICAgICAob3ZlcmxheS1yZWNlbnRlciBlbmQpCisgICAgICAgICAgICAg KG92ZXJsYXlzLWluIGJlZyBlbmQpKSkpCisgICAgKHdoZW4gKGFuZCBiZWcgZW5kIG5hbWUgdmFs KQorICAgICAgKGRvbGlzdCAobyBvdmVybGF5cykKKyAgICAgICAgKGNvbmQKKyAgICAgICAgICAo KGFuZCAoZXEgbmFtZSAnZmFjZSkKKyAgICAgICAgICAgICAgICAoZXEgKG92ZXJsYXktZ2V0IG8g bmFtZSkgdmFsKSkKKyAgICAgICAgICAgIDs7IEVpdGhlciBwdXNoIHRoaXMgb3ZlcmxheSBvdXRz aWRlIGJlZy4uLmVuZAorICAgICAgICAgICAgOzsgb3Igc3BsaXQgaXQgdG8gZXhjbHVkZSBiZWcu Li5lbmQKKyAgICAgICAgICAgIDs7IG9yIGRlbGV0ZSBpdCBlbnRpcmVseSAoaWYgaXQgaXMgY29u dGFpbmVkIGluIGJlZy4uLmVuZCkuCisgICAgICAgICAgICAoaWYgKDwgKG92ZXJsYXktc3RhcnQg bykgYmVnKQorICAgICAgICAgICAgICAgIChpZiAoPiAob3ZlcmxheS1lbmQgbykgZW5kKQorICAg ICAgICAgICAgICAocHJvZ24KKyAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IChjb3B5LW92 ZXJsYXkgbykKKyAgICAgICAgICAgICAgICAgIChvdmVybGF5LXN0YXJ0IG8pIGJlZykKKyAgICAg ICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVuZCBvKSkpCisgICAgICAg ICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gKG92ZXJsYXktc3RhcnQgbykgYmVnKSkKKyAgICAg ICAgICAgICAgKGlmICg+IChvdmVybGF5LWVuZCBvKSBlbmQpCisgICAgICAgICAgICAgICAgICAo bW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVuZCBvKSkKKyAgICAgICAgICAgICAgICAoZGVs ZXRlLW92ZXJsYXkgbykpKSkKKyAgICAgICAgICAoKGFuZCAobm90IChlcSBuYW1lICdmYWNlKSkK KyAgICAgICAgICAgICAgICAoZXF1YWwta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jb250ZXh0LXRpbWVyCisgICAg ICAgICAgICAgICAgIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAg ICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVuICh0aW1l cnAgaml0LWxvY2stY29udGV4dC10aW1lcikKKyAgICAgICAgICAoY2FuY2VsLXRpbWVyIGppdC1s b2NrLWNvbnRleHQtdGltZXIpKQorICAgICAgICA7OyAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRp bWVyIChydW4td2l0aC1pZGxlLXRpbWVyIDUuMCAncmVwZWF0ICdqaXQtbG9jay1jb250ZXh0LWZv bnRpZnkpKQorICAgICAgICAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIG5pbCkpCisgICAg ICAod2hlbiAoYW5kIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAg ICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVuICh0aW1l cnAgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpCisgICAgICAgICAgKGNhbmNlbC10 aW1lciB1bmRvLWF1dG8tY3VycmVudC1ib3VuZGFyeS10aW1lcikpCisgICAgICAgIChmc2V0ICd1 bmRvLWF1dG8tLXVuZG9hYmxlLWNoYW5nZQorICAgICAgICAgICAgICAobGFtYmRhICgpIChhZGQt dG8tbGlzdCAndW5kby1hdXRvLS11bmRvYWJseS1jaGFuZ2VkLWJ1ZmZlcnMgKGN1cnJlbnQtYnVm ZmVyKSkpKQorICAgICAgICAoZnNldCAndW5kby1hdXRvLWFtYWxnYW1hdGUgJ2lnbm9yZSkpCisg ICAgICAod2hlbiBibGluay1jdXJzb3ItbW9kZQorICAgICAgICAoYmxpbmstY3Vyc29yLW1vZGUg LTEpCisgICAgICAgICh3aGVuIChtZW1xICdibGluay1jdXJzb3ItY2hlY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gJyst bW9kZSkKKworKGRlZmZhY2UgKy1iYXItcG9zdC16di1mYWNlCisgICcoKHQgKDpmb3JlZ3JvdW5k ICJtYWdlbnRhNCIpKSkKKyAgIkZhY2UgZm9yIGArLWJhci1wb3N0LXp2LWZhY2UnLiIKKyAgOmdy b3VwICcrLW1vZGUpCisKKyhkZWZmYWNlICstcmV2ZXJzZWQtYmFyLXByZS16di1mYWNlCisgICco KHQgKDpmb3JlZ3JvdW5kICJjeWFuMSIpKSkKKyAgIkZhY2UgZm9yIGArLXJldmVyc2VkLWJhci1w cmUtenYtZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1yZXZlcnNlZC1i YXItYXQtenYtZmFjZQorICAnKCh0ICg6Zm9yZWdyb3VuZCAiY2hhcnRyZXVzZSIpKSkKKyAgIkZh Y2UgZm9yIGArLXJldmVyc2VkLWJhci1hdC16di1mYWNlJy4iCisgIDpncm91cCAnKy1tb2RlKQor CisoZGVmZmFjZSArLXJldmVyc2VkLWJhci1wb3N0LXp2LWZhY2UKKyAgJygodCAoOmZvcmVncm91 bmQgImN5YW40IikpKQorICAiRmFjZSBmb3IgYCstcmV2ZXJzZWQtYmFyLXBvc3QtenYtZmFjZScu IgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1ldmVuLXByZS16di1mYWNlCisgICco KCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAg OmZvcmVncm91bmQgInllbGxvdyIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4 KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJjeWFuMSIpCisgICAgKCgo Y2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDE2KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZv cmVncm91bmQgInllbGxvdyIpCisgICAgKCgoY2xhc3MgY29sb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cHJlLXp2LWZhY2UnLiIKKyAgOmdyb3VwICcrLW1vZGUpCisKKyhkZWZmYWNlICst ZXZlbi1hdC16di1mYWNlCisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFj a2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgIkRlZXBQaW5rMSIpCisgICAgKCgoY2xh c3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3Jl Z3JvdW5kICJEZWVwUGluazEiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikg KGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJEZWVwUGluazEiKQorICAgICgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6 Zm9yZWdyb3VuZCAiRGVlcFBpbmsxIikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMg OCkpCisgICAgIDpmb3JlZ3JvdW5kICJ3aGl0ZSIpCisgICAgKCgodHlwZSB0dHkpIChjbGFzcyBt b25vKSkKKyAgICAgOmludmVyc2UtdmlkZW8gdCkKKyAgICAodCA6Zm9yZWdyb3VuZCAicGluayIp KQorICAiRmFjZSBmb3IgYCstZXZlbi1hdC16di1mYWNlJy4iCisgIDpncm91cCAnKy1tb2RlKQor CisoZGVmZmFjZSArLWV2ZW4taW5hY3RpdmUtYXQtenYtZmFjZQorICAnKCgoKGNsYXNzIGNvbG9y KSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJE ZWVwUGluazQiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91 bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3VuZCAiRGVlcFBpbms0IikKKyAgICAoKCh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n cm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJyZWQxIikKKyAgICAoKChjbGFzcyBjb2xv cikgKG1pbi1jb2xvcnMgODgpIChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQg InJlZDEiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQg ZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJyZWQxIikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1p bi1jb2xvcnMgMTYpIChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgInJlZDEi KQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4KSkKKyAgICAgOmZvcmVncm91bmQg IndoaXRlIikKKyAgICAoKCh0eXBlIHR0eSkgKGNsYXNzIG1vbm8pKQorICAgICA6aW52ZXJzZS12 aWRlbyB0KQorICAgICh0IDpmb3JlZ3JvdW5kICJwaW5rIikpCisgICJGYWNlIGZvciBgKy1vZGQt cHJlLXp2LWZhY2UnLiIKKyAgOmdyb3VwICcrLW1vZGUpCisKKyhkZWZmYWNlICstb2RkLWluYWN0 aXZlLXByZS16di1mYWNlCisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFj a2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgIiNmZjYzNDciKQorICAgICgoKGNsYXNz IGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdy b3VuZCAiI2ZmNjM0NyIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDE2KSAoYmFj a2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgIiNmZjYzNDciKQorICAgICgoKGNsYXNz IGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbG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MgY29sb3IpIChtaW4tY29sb3Jz IDE2KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTEiKQorICAg ICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQpKQorICAg ICA6Zm9yZWdyb3VuZCAiRGFya1NhbG1vbiIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29s b3JzIDgpKQorICAgICA6Zm9yZWdyb3VuZCAid2hpdGUiKQorICAgICgoKHR5cGUgdHR5KSAoY2xh c3MgbW9ubykpCisgICAgIDppbnZlcnNlLXZpZGVvIHQpCisgICAgKHQgOmZvcmVncm91bmQgInBp bmsiKSkKKyAgIkZhY2UgZm9yIGArLW9kZC1wb3N0LXp2LWZhY2UnLiIKKyAgOmdyb3VwICcrLW1v ZGUpCisKKyhkZWZmYWNlICstb2RkLWluYWN0aXZlLXBvc3QtenYtZmFjZQorICAnKCgoKGNsYXNz IGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3Jv dW5kICJzaWVubmE0IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgODgpIChiYWNr Z3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTQiKQorICAgICgoKGNsYXNz IGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3Jv dW5kICJzaWVubmE0IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgMTYpIChiYWNr Z3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTQiKQorICAgICgoKGNsYXNz IGNvbG9yKSAobWluLWNvbG9ycyA4KSkKKyAgICAgOmZvcmVncm91bmQgIndoaXRlIikKKyAgICAo KCh0eXBlIHR0eSkgKGNsYX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ZC VkFSIChjdXJyZW50X2J1ZmZlciwgY2hfaW5hY3RpdmVfd2luZG93cyksIFFuaWwsCisgICAgZG9j OiAvKiBXaGVuIG5vbi1uaWwsIGRyYXcgY3Jvc3NoYWlycyBpbiBpbmFjdGl2ZSB3aW5kb3dzLiAq Lyk7CisKKyAgREVGU1lNIChRZmNfdmlzaWJsZSwgImZjLXZpc2libGUiKTsKKyAgREVGVkFSX1BF Ul9CVUZGRVIgKCJmYy12aXNpYmxlIiwgJkJWQVIgKGN1cnJlbnRfYnVmZmVyLCBmY192aXNpYmxl KSwgUW5pbCwKKyAgICBkb2M6IC8qIEEgYnVmZXItbG9jYWwgdmFyaWFibGUgdG8gdHVybiBvbi9v ZmYgdGhlIG11bHRpcGxlIGN1cnNvcnMgZmlsbCBjb2x1bW4uICovKTsKKworICBERUZTWU0gKFFm Y192aXNpYmxlX2luYWN0aXZlX3dpbmRvdywgImZjLWluYWN0aXZlLXdpbmRvdyIpOworICBERUZW QVJfUEVSX0JVRkZFUiAoImZjLWluYWN0aXZlLXdpbmRvd3MiLCAmQlZBUiAoY3VycmVudF9idWZm ZXIsIGZjX2luYWN0aXZlX3dpbmRvd3MpLCBRbmlsLAorICAgIGRvYzogLyogV2hlbiBub24tbmls LCBkcmF3IG11bHRpcGxlIGN1cnNvcnMgZmlsbCBjb2x1bW4gaW4gaW5hY3RpdmUgd2luZG93cy4g Ki8pOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIHN0YXRpY3BybyAoJmxhc3Rf b3ZlcmxheV9tb2RpZmljYXRpb25faG9va3MpOwogICBsYXN0X292ZXJsYXlfbW9kaWZpY2F0aW9u X2hvb2tzID0gbWFrZV9uaWxfdmVjdG9yICgxMCk7CiAKZGlmZiAtLWdpdCBhL3NyYy9idWZmZXIu aCBiL3NyYy9idWZmZXIuaAppbmRleCAyMDgwYTZmLi4xYWRhOTNlIDEwMDY0NAotLS0gYS9zcmMv YnVmZmVyLmgKKysrIGIvc3JjL2J1ZmZlci5oCkBAIC03NDAsNiArNzQwLDQwIEBAIHN0cnVjdCBi dWZmZXIKICAgICAgaW4gdGhlIGRpc3BsYXkgb2YgdGhpcyBidWZmZXIuICAqLwogICBMaXNwX09i amVjdCBleHRyYV9saW5lX3NwYWNpbmdfOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8qIFRoZSBjdXJzb3IgdHlwZSBvZiB0aGUgcmVh bCBmYWtlIGN1cnNvci4gKi8KKyAgTGlzcF9PYmplY3QgbWNfcmVhbF9mYWtlX2N1cnNvcl87CisK KyAgLyogVGhlIG5hbWUgb2YgbGlzdCB1c2VkIGJ5IG11bHRpcGxlIGN1cnNvcnMgZm9yIG5leHQg cmVkaXNwbGF5LiAqLworICBMaXNwX09iamVjdCBtY19jb25mXzsKKworICAvKiBXaGV0aGVyIHRv IGRyYXcgbXVsdGlwbGUgY3Vyc29ycyBpbiBpbmFjdGl2ZSB3aW5kb3dzLiAqLworICBMaXNwX09i amVjdCBtY19pbmFjdGl2ZV93aW5kb3dzXzsKKworICAvKiBUaGUgbmFtZSBvZiB0aGUgYnVmZmVy LWxvY2FsIHZhcmlhYmxlLiAqLworICBMaXNwX09iamVjdCBjcm9zc2hhaXJzXzsKKworICAvKiBU aGUgbmFtZSBvZiB0aGUgY3Jvc3NoYWlycyBob3Jpem9udGFsIHJ1bGVyLiAqLworICBMaXNwX09i amVjdCBjaF9ob3Jpem9udGFsX3J1bGVyXzsKKworICAvKiBUaGUgbmFtZSBvZiB0aGUgY3Jvc3No YWlycyB2ZXJ0aWNhbCBydWxlci4gKi8KKyAgTGlzcF9PYmplY3QgY2hfdmVydGljYWxfcnVsZXJf OworCisgIC8qIFdoZXRoZXIgdG8gZHJhdyBjcm9zc2hhaXJzIGluIGluYWN0aXZlIHdpbmRvd3Mu ICovCisgIExpc3BfT2JqZWN0IGNoX2luYWN0aXZlX3dpbmRvd3NfOworCisgIC8qIFRoZSBuYW1l IG9mIHRoZSBidWZmZXItbG9jYWwgdmFyaWFibGUuICovCisgIExpc3BfT2JqZWN0IGZjX3Zpc2li bGVfOworCisgIC8qIFdoZXRoZXIgdG8gZHJhdyBtdWx0aXBsZSBjdXJzb3JzIGZpbGwgY29sdW1u IGluIGluYWN0aXZlIHdpbmRvd3MuICovCisgIExpc3BfT2JqZWN0IGZjX2luYWN0aXZlX3dpbmRv d3NfOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIEN1cnNvciB0eXBlIHRv IGRpc3BsYXkgaW4gbm9uLXNlbGVjdGVkIHdpbmRvd3MuCiAgICAgIHQgbWVhbnMgdG8gdXNlIGhv bGxvdyBib3ggY3Vyc29yLgogICAgICBTZWUgYGN1cnNvci10eXBlJyBmb3Igb3RoZXIgdmFsdWVz LiAgKi8KQEAgLTc5MSwxNCArODI1LDIxIEBAIHN0cnVjdCBidWZmZXIKICAgICAgYW4gaW5kaXJl Y3QgYnVmZmVyIHNpbmNlIGl0IGNvdW50cyBhcyBpdHMgYmFzZSBidWZmZXIuICAqLwogICBpbnQg d2luZG93X2NvdW50OwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUt Q1VSU09SUyAqLworCiAgIC8qIEEgbm9uLXplcm8gdmFsdWUgaW4gc2xvdCBJRFggbWVhbnMgdGhh dCBwZXItYnVmZmVyIHZhcmlhYmxlCiAgICAgIHdpdGggaW5kZXggSURYIGhhcyBhIGxvY2FsIHZh bHVlIGluIHRoaXMgYnVmZmVyLiAgV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ioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKK0lOTElORSB2b2lk Citic2V0X2Jsdl9tY19yZWFsX2Zha2VfY3Vyc29yIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09i amVjdCB2YWwpCit7CisgIGItPm1jX3JlYWxfZmFrZV9jdXJzb3JfID0gdmFsOworfQorCitJTkxJ TkUgdm9pZAorYnNldF9ibHZfbWNfY29uZiAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3Qg dmFsKQoreworICBiLT5tY19jb25mXyA9IHZhbDsKK30KKworSU5MSU5FIHZvaWQKK2JzZXRfYmx2 X21jX2luYWN0aXZlX3dpbmRvd3MgKHN0cnVjdCBidWZmZXIgKmIsIExpc3BfT2JqZWN0IHZhbCkK K3sKKyAgYi0+bWNfaW5hY3RpdmVfd2luZG93c18gPSB2YWw7Cit9CisKK0lOTElORSB2b2lkCiti c2V0X2Jsdl9jcm9zc2hhaXJzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7 CisgIGItPmNyb3NzaGFpcnNfID0gdmFsOworfQorCitJTkxJTkUgdm9pZAorYnNldF9ibHZfY2hf aG9yaXpvbnRhbF9ydWxlciAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFsKQorewor ICBiLT5jaF9ob3Jpem9udGFsX3J1bGVyXyA9IHZhbDsKK30KKworSU5MSU5FIHZvaWQKK2JzZXRf Ymx2X2NoX3ZlcnRpY2FsX3J1bGVyIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwp Cit7CisgIGItPmNoX3ZlcnRpY2FsX3J1bGVyXyA9IHZhbDsKK30KKworSU5MSU5FIHZvaWQKK2Jz ZXRfYmx2X2NoX2luYWN0aXZlX3dpbmRvd3MgKHN0cnVjdCBidWZmZXIgKmIsIExpc3BfT2JqZWN0 IHZhbCkKK3sKKyAgYi0+Y2hfaW5hY3RpdmVfd2luZG93c18gPSB2YWw7Cit9CisKK0lOTElORSB2 b2lkCitic2V0X2Jsdl9mY192aXNpYmxlIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2 YWwpCit7CisgIGItPmZjX3Zpc2libGVfID0gdmFsOworfQorCitJTkxJTkUgdm9pZAorYnNldF9i bHZfZmNfaW5hY3RpdmVfd2luZG93cyAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFs KQoreworICBiLT5mY19pbmFjdGl2ZV93aW5kb3dzXyA9IHZhbDsKK30KKworLyogZW5kIE1VTFRJ UExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIElOTElORSB2b2lk CiBic2V0X2JpZGlfcGFyYWdyYXBoX2RpcmVjdGlvbiAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9P YmplY3QgdmFsKQogewpkaWZmIC0tZ2l0IGEvc3JjL2Rpc3BleHRlcm4uaCBiL3NyYy9kaXNwZXh0 ZXJuLmgKaW5kZXggNGU5NDdkYS4uODZhZGVhMyAxMDA2NDQKLS0tIGEvc3JjL2Rpc3BleHRlcm4u aAorKysgYi9zcmMvZGlzcGV4dGVybi5oCkBAIC0xNDUsNiArMTQ1LDEzMSBAQCB0eXBlZGVmIHZv aWQgKkVtYWNzX0N1cnNvcjsKICNkZWZpbmUgTmF0aXZlUmVjdGFuZ2xlIGludAogI2VuZGlmCiAK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICov CisKK2V4dGVybiBib29sIG1jX3N0Z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AgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBlbnVtIG1jX2N1cnNvcl90eXBlKTsKKworZXh0ZXJuIGludCBtY19nZXRfZnJpbmdlX2Jp dG1hcCAoc3RydWN0IHdpbmRvdyAqLCBMaXNwX09iamVjdCwgaW50LCBpbnQpOworCitleHRlcm4g dm9pZCBtY19lbmdpbmUgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLCBz dHJ1Y3QgZ2x5cGhfcm93ICosCisgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAq LCBpbnQsIGludCwgaW50LCBpbnQsIGludCwgaW50LAorICAgICAgICAgICAgICAgICAgICAgICBl bnVtIG1jX2N1cnNvcl90eXBlLCBpbnQsIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwKKyAgICAgICAg ICAgICAgICAgICAgICAgc3RydWN0IG1jX2Vzc2VudGlhbHMsIGVudW0gbWNfcm93X3Bvc2l0aW9u LCBzdHJ1Y3QgbWNfUkdCLAorICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2VuZ2luZV90 eXBlLCBib29sLCBlbnVtIG1jX2RyYXdfcm93X3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAg IGVudW0gbWNfY2FjaGVfdHlwZSk7CisKK2V4dGVybiB2b2lkIG1jX3NldF9lc3NlbnRpYWxzIChz dHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBtY19lc3NlbnRpYWxzICopOworCitleHRlcm4gdm9pZCBt Y19kcmF3X3JvdyAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVj dCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKiwg aW50LCBpbnQsIGludCwgc3RydWN0IGdseXBoX21hdHJpeCAqLAorICAgICAgICAgICAgICAgICAg ICAgICAgIHN0cnVjdCBtY19lc3NlbnRpYWxzLCBlbnVtIG1jX3Jvd19wb3NpdGlvbiwgYm9vbCwK KyAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2RyYXdfcm93X3R5cGUpOworCitleHRl cm4gYm9vbCBtY19yZWRyYXdfcm93IChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRy aXggKiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51 bSBnbHlwaF9yb3dfYXJlYSwgaW50LCBpbnQsIGludCwgYm9vbCwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSwgZW51bSBtY19yZWRyYXdfcm93X3R5cGUp OworCitleHRlcm4gdm9pZCBtY19yZXNldF9jYWNoZSAoc3RydWN0IHdpbmRvdyAqKTsKKworZXh0 ZXJuIHZvaWQgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGds eXBoX21hdHJpeCAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBn bHlwaF9yb3cgKiwgZW51bSBkcmF3X2dseXBoc19mYWNlLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGludCwgaW50LCBpbnQsIHN0cnVjdCBtY19SR0IsIGVudW0gbWNfZmxhdm9y LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUs IGludCwgYm9vbCwgYm9vbCk7CisKK2V4dGVybiB2b2lkIG1jX2VyYXNlX2N1cnNvciAoc3RydWN0 IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBpbnQsIGludCwgaW50LCBlbnVtIG1jX2Zs YXZvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSwg aW50KTsKKworZXh0ZXJuIHZvaWQgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHN0cnVjdCB3aW5kb3cg Kiwgc3RydWN0IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBpbnQsIGludCwgaW50LCBpbnQsIGludCwgaW50 LCBpbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3Jf dHlwZSwgaW50LCBzdHJ1Y3QgbWNfUkdCLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGJvb2wsIGVudW0gbWNfZmxhdm9yLCBib29sKTsKKworZXh0ZXJuIGludCBtY19kcmF3X2ds eXBocyAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlw aF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCwgZW51bSBnbHlwaF9yb3df YXJlYSwgcHRyZGlmZl90LCBwdHJkaWZmX3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBl bnVtIGRyYXdfZ2x5cGhzX2ZhY2UsIGludCwgaW50LCBzdHJ1Y3QgbWNfUkdCLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgZW51bSBtY19mbGF2b3IsIGVudW0gbWNfY3Vyc29yX3R5cGUsIGlu dCwgYm9vbCwgYm9vbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlw aF9hY3Rpb24sIGJvb2wpOworCitleHRlcm4gc3RydWN0IGdseXBoX21hdHJpeCAqIG1jX3NhdmVf Z2x5cGhfbWF0cml4IChzdHJ1Y3QgZ2x5cGhfbWF0cml4ICopOworCitleHRlcm4gdm9pZCBtY19y ZXN0b3JlX2dseXBoX21hdHJpeCAoc3RydWN0IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhf bWF0cml4ICopOworCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogLyogVGV4dCBjdXJzb3IgdHlwZXMuICAqLwogCiBlbnVtIHRleHRfY3Vy c29yX2tpbmRzCkBAIC00MDQsNiArNTI5LDE4IEBAIHN0cnVjdCBnbHlwaF9zbGljZQogCiBzdHJ1 Y3QgZ2x5cGgKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKworICBpbnQgcmVsYXRpdmVfeCwgaHBvczsKKworICBwdHJkaWZmX3QgYnl0ZXBv czsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBQb3NpdGlvbiBmcm9tIHdo aWNoIHRoaXMgZ2x5cGggd2FzIGRyYXduLiAgSWYgYG9iamVjdCcgYmVsb3cgaXMgYQogICAgICBM aXNwIHN0cmluZywgdGhpcyBpcyBhbiBpbmRleCBpbnRvIHRoYXQgc3RyaW5nLiAgSWYgaXQgaXMg YQogICAgICBidWZmZXIsIHRoaXMgaXMgYSBwb3NpdGlvbiBpbiB0aGF0IGJ1ZmZlci4gIEluIGFk ZGl0aW9uLCBzb21lCkBAIC0xMjcwLDYgKzE0MDcsMjggQEAgZW51bSBkcmF3X2dseXBoc19mYWNl CiAKIHN0cnVjdCBnbHlwaF9zdHJpbmcKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIGJvb2xfYmYgbGVmdF9vdmVyd3JpdHRlbl9w IDogMTsKKworICAgIGJvb2xfYmYgcmlnaHRfb3ZlcndyaXR0ZW5fcCA6IDE7CisKKyAgICBib29s X2JmIHJlY3RhbmdsZV9udWtlZF9wIDogMTsKKworICAgIGJvb2xfYmYgYmFja2dyb3VuZF9udWtl ZF9wIDogMTsKKworICAgIGVudW0gZHJhd19nbHlwaF9hY3Rpb24KKyAgICB7CisgICAgICBNQ19E UkFXX0dMWVBIX1NUUklORywKKyAgICAgIE1DX0VSQVNFX0dMWVBIX1NUUklORworICAgIH0gYWN0 aW9uX3R5cGU7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogWC1vcmlnaW4g b2YgdGhlIHN0cmluZy4gICovCiAgIGludCB4OwogCkBAIC0yODM0LDYgKzI5OTMsMjggQEAgdHlw ZWRlZiB2b2lkICgqZnJhbWVfcGFybV9oYW5kbGVyKSAoc3RydWN0IGZyYW1lICosIExpc3BfT2Jq ZWN0LCBMaXNwX09iamVjdCk7CiAKIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlCiB7CisKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIGBy ZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgbnN0ZXJtLm1gIHwgYHczMnRlcm0uY2AgfCBgeHRlcm0u Y2AgbXVzdCBiZSBpbiB0aGUKK2V4YWN0IHNhbWUgb3JkZXIgYXMgdGhlIGByZWRpc3BsYXlfaW50 ZXJmYWNlJyBpbiBgZGlzcGV4dGVybi5oYCEgKi8KKworICAvKiBgbWNfbnNfZHJhd193aW5kb3df Y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ib29sCittY192ZXJpZnlfcm93X2hhc2ggKHN0cnVj dCBnbHlwaF9yb3cgKnJvdykKK3sKKyAgcmV0dXJuIHJvdy0+aGFzaCA9PSByb3dfaGFzaCAocm93 KTsKK30KKworc3RhdGljIHN0cnVjdCBtY19yb3dfZW50cnkgKgorbWNfYWRkX3Jvd19lbnRyeSAo c3RydWN0IGdseXBoX3JvdyAqcm93KQoreworICBzdHJ1Y3QgbWNfcm93X2VudHJ5ICplbnRyeTsK KyAgcHRyZGlmZl90IGkgPSByb3ctPmhhc2ggJSBtY19yb3dfdGFibGVfc2l6ZTsKKyAgZW50cnkg PSBtY19yb3dfdGFibGVbaV07CisgIGVhc3NlcnQgKGVudHJ5IHx8IG1jX3ZlcmlmeV9yb3dfaGFz aCAocm93KSk7CisgIHdoaWxlIChlbnRyeSAmJiAhcm93X2VxdWFsX3AgKGVudHJ5LT5yb3csIHJv dywgMSkpCisgICAgZW50cnkgPSBlbnRyeS0+bmV4dDsKKyAgaWYgKGVudHJ5ID09IE5VTEwpCisg ICAgeworICAgICAgZW50cnkgPSBtY19yb3dfZW50cnlfcG9vbCArIG1jX3Jvd19lbnRyeV9pZHgr KzsKKyAgICAgIGVudHJ5LT5yb3cgPSByb3c7CisgICAgICBlbnRyeS0+b2xkX3VzZXMgPSBlbnRy eS0+bmV3X3VzZXMgPSAwOworICAgICAgZW50cnktPm5ld19saW5lX251bWJlciA9IDA7CisgICAg ICBlbnRyeS0+YnVja2V0ID0gaTsKKyAgICAgIGVudHJ5LT5uZXh0ID0gbWNfcm93X3RhYmxlW2ld OworICAgICAgbWNfcm93X3RhYmxlW2ldID0gZW50cnk7CisgICAgfQorICByZXR1cm4gZW50cnk7 Cit9CisKK3N0cnVjdCBtY19tYXRyaXgKK21jX3NhdmVfY2FjaGVfbWF0cml4IChzdHJ1Y3QgbWNf bWF0cml4IG1hdHJpeCkKK3sKKyAgc3RydWN0IG1jX21hdHJpeCBzYXZlZDsKKyAgc2F2ZWQudnBv c19hbGxvY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c2lyZWRfbWF0cml4LCBpKSk7CisgICAgICBpZiAoYm90dG9tIDw9IHli KQorICAgICAgICArK2k7CisgICAgICBpZiAoYm90dG9tID49IHliKQorICAgICAgICBicmVhazsK KyAgICB9CisgIGxhc3RfbmV3ID0gaTsKKyAgLyogU2V0IGxhc3Rfb2xkIHRvIHRoZSBpbmRleCAr IDEgb2YgdGhlIHJvdyB0aGF0IHJlYWNoZXMgdGhlIGJvdHRvbQorICAgICBib3VuZGFyeSBpbiB0 aGUgY3VycmVudCBtYXRyaXguICBXZSBkb24ndCBsb29rIGF0IHRoZSBlbmFibGVkCisgICAgIGZs YWcgaGVyZSBiZWNhdXNlIHdlIHBsYW4gdG8gcmV1c2UgcGFydCBvZiB0aGUgZGlzcGxheSBldmVu IGlmCisgICAgIG90aGVyIHBhcnRzIGFyZSBkaXNhYmxlZC4gKi8KKyAgaSA9IGZpcnN0X29sZCAr IDE7CisgIHdoaWxlIChpIDwgY3VycmVudF9tYXRyaXgtPm5yb3dzIC0gMSkKKyAgICB7CisgICAg ICBpbnQgYm90dG9tID0gTUFUUklYX1JPV19CT1RUT01fWSAoTUFUUklYX1JPVyAoY3VycmVudF9t YXRyaXgsIGkpKTsKKyAgICAgIGlmIChib3R0b20gPD0geWIpCisgICAgICAgICsraTsKKyAgICAg IGlmIChib3R0b20gPj0geWIpCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgbGFzdF9vbGQgPSBp OworICAvKiBTa2lwIG92ZXIgcm93cyBlcXVhbCBhdCB0aGUgYm90dG9tLiAqLworICBpID0gbGFz dF9uZXc7CisgIGogPSBsYXN0X29sZDsKKyAgd2hpbGUgKGkgLSAxID4gZmlyc3RfbmV3CisgICAg ICAgICAmJiBqIC0gMSA+IGZpcnN0X29sZAorICAgICAgICAgJiYgTUFUUklYX1JPV19FTkFCTEVE X1AgKGN1cnJlbnRfbWF0cml4LCBqIC0gMSkKKyAgICAgICAgICYmIChNQVRSSVhfUk9XIChjdXJy ZW50X21hdHJpeCwg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bW9zdF9wcmltZV9pbmNyZW1lbnRfbWF4IHdv dWxkIGJlIDE0LCBlLmcuLAorICAgICBiZWNhdXNlIG5leHRfYWxtb3N0X3ByaW1lICgxMTMpIHdv dWxkIGJlIDEyNy4gKi8KKyAgeworICAgIHZlcmlmeSAoTkVYVF9BTE1PU1RfUFJJTUVfTElNSVQg PT0gMTEpOworICAgIGVudW0geyBuZXh0X2FsbW9zdF9wcmltZV9pbmNyZW1lbnRfbWF4ID0gMTAg fTsKKyAgICBwdHJkaWZmX3Qgcm93X3RhYmxlX21heCA9CisgICAgICAobWluIChQVFJESUZGX01B WCwgU0laRV9NQVgpIC8gKDMgKiBzaXplb2YgKm1jX3Jvd190YWJsZSkKKyAgICAgICAtIG5leHRf YWxtb3N0X3ByaW1lX2luY3JlbWVudF9tYXgpOworICAgIHB0cmRpZmZfdCBjdXJyZW50X25yb3dz X21heCA9IHJvd190YWJsZV9tYXggLSBkZXNpcmVkX21hdHJpeC0+bnJvd3M7CisgICAgaWYgKGN1 cnJlbnRfbnJvd3NfbWF4IDwgY3VycmVudF9tYXRyaXgtPm5yb3dzKQorICAgICAgbWVtb3J5X2Z1 bGwgKFNJWkVfTUFYKTsKKyAgfQorICAvKiBSZWFsbG9jYXRlIHZlY3RvcnMsIHRhYmxlcyBldGMu IGlmIG5lY2Vzc2FyeS4gKi8KKyAgaWYgKGN1cnJlbnRfbWF0cml4LT5ucm93cyA+IG1jX29sZF9s aW5lc19zaXplKQorICAgIG1jX29sZF9saW5lcyA9IHhwYWxsb2MgKG1jX29sZF9saW5lcywgJm1j X29sZF9saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRfbWF0cml4 LT5ucm93cyAtIG1jX29sZF9saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgIElO VF9NQVgsIHNpemVvZiAqbWNfb2xkX2xpbmVzKTsKKyAgaWYgKGRlc2lyZWRfbWF0cml4LT5ucm93 cyA+IG1jX25ld19saW5lc19zaXplKQorICAgIG1jX25ld19saW5lcyA9IHhwYWxsb2MgKG1jX25l d19saW5lcywgJm1jX25ld19saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgIGRl c2lyZWRfbWF0cml4LT5ucm93cyAtIG1jX25ld19saW5lc19zaXplLAorICAgICAgICAgICAgICAg ICAgICAgICAgIElOVF9NQVgsIHNpemVvZiAqbWNfbmV3X2xpbmVzKTsKKyAgbiA9IGRlc2lyZWRf bWF0cml4LT5ucm93czsKKyAgbiArPSBjdXJyZW50X21hdHJpeC0+bnJvd3M7CisgIGlmIChtY19y b3dfdGFibGVfc2l6ZSA8IDMgKiBuKQorICAgIHsKKyAgICAgIHB0cmRpZmZfdCBzaXplID0gbmV4 dF9hbG1vc3RfcHJpbWUgKDMgKiBuKTsKKyAgICAgIG1jX3Jvd190YWJsZSA9IHhucmVhbGxvYyAo bWNfcm93X3RhYmxlLCBzaXplLCBzaXplb2YgKm1jX3Jvd190YWJsZSk7CisgICAgICBtY19yb3df dGFibGVfc2l6ZSA9IHNpemU7CisgICAgICBtZW1zZXQgKG1jX3Jvd190YWJsZSwgMCwgc2l6ZSAq IHNpemVvZiAqbWNfcm93X3RhYmxlKTsKKyAgICB9CisgIGlmIChuID4gbWNfcm93X2VudHJ5X3Bv b2xfc2l6ZSkKKyAgICBtY19yb3dfZW50cnlfcG9vbCA9IHhwYWxsb2MgKG1jX3Jvd19lbnRyeV9w b29sLCAmbWNfcm93X2VudHJ5X3Bvb2xfc2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIG4gLSBtY19yb3dfZW50cnlfcG9vbF9zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgLTEsIHNpemVvZiAqbWNfcm93X2VudHJ5X3Bvb2wpOworICBpZiAoZGVzaXJlZF9tYXRy aXgtPm5yb3dzID4gbWNfcnVuc19zaXplKQorICAgIHsKKyAgICAgIG1jX3J1bnMgPSB4bnJlYWxs b2MgKG1jX3J1bnMsIGRlc2lyZWRfbWF0cml4LT5ucm93cywgc2l6ZW9mICptY19ydW5zKTsKKyAg ICAgIG1jX3J1bl9wb29sID0geG5yZWFsbG9jIChtY19ydW5fcG9vbCwgZGVzaXJlZF9tYXRyaXgt Pm5yb3dzLCBzaXplb2YgKm1jX3J1bl9wb29sKTsKKyAgICAgIG1jX3J1bnNfc2l6ZSA9IGRlc2ly ZWRfbWF0cml4LT5ucm93czsKKyAgICB9CisgIG5ydW5zID0gcnVuX2lkeCA9IDA7CisgIG1jX3Jv d19lbnRyeV9pZHggPSAwOworICAvKiBBZGQgcm93cyBmcm9tIHRoZSBjdXJyZW50IGFuZCBkZXNp cmVkIG1hdHJpeCB0byB0aGUgaGFzaCB0YWJsZQorICAgICByb3dfaGFzaF90YWJsZSB0byBiZSBh YmxlIHRvIGZpbmQgZXF1YWwgb25lcyBxdWlja2x5LiAqLworICBmb3IgKGkgPSBmaXJzdF9vbGQ7 IGkgPCBsYXN0X29sZDsgKytpKQorICAgIHsKKyAgICAgIGlmIChNQVRSSVhfUk9XX0VOQUJMRURf UCAoY3VycmVudF9tYXRyaXgsIGkpKQorICAgICAgICB7CisgICAgICAgICAgZW50cnkgPSBtY19h ZGRfcm93X2VudHJ5IChNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSkpOworICAgICAgICAg IG1jX29sZF9saW5lc1tpXSA9IGVudHJ5OworICAgICAgICAgICsrZW50cnktPm9sZF91c2VzOwor ICAgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIG1jX29sZF9saW5lc1tpXSA9IE5VTEw7Cisg ICAgfQorICBmb3IgKGkgPSBmaXJzdF9uZXc7IGkgPCBsYXN0X25ldzsgKytpKQorICAgIHsKKyAg ICAgIGVhc3NlcnQgKE1BVFJJWF9ST1dfRU5BQkxFRF9QIChkZXNpcmVkX21hdHJpeCwgaSkpOwor ICAgICAgZW50cnkgPSBtY19hZGRfcm93X2VudHJ5IChNQVRSSVhfUk9XIChkZXNpcmVkX21hdHJp eCwgaSkpOworICAgICAgKytlbnRyeS0+bmV3X3VzZXM7CisgICAgICBlbnRyeS0+bmV3X2xpbmVf bnVtYmVyID0gaTsKKyAgICAgIG1jX25ld19saW5lc1tpXSA9IGVudHJ5OworICAgIH0KKyAgLyog SWRlbnRpZnkgbW92ZXMgYmFzZWQgb24gbGluZXMgdGhhdCBhcmUgdW5pcXVlIGFuZCBlcXVhbAor ICAgICBpbiBib3RoIG1hdHJpY2VzLiAqLworICBmb3IgKGkgPSBmaXJzdF9vbGQ7IGkgPCBsYXN0 X29sZDspCisgICAgaWYgKG1jX29sZF9saW5lc1tpXQorICAgICAgICAmJiBtY19vbGRfbGluZXNb aV0tPm9sZF91c2VzID09IDEKKyAgICAgICAgJiYgbWNfb2xkX2xpbmVzW2ldLT5uZXdfdXNlcyA9 PSAxKQorICAgICAgeworICAgICAgICBpbnQgcCwgcTsKKyAgICAgICAgaW50IG5ld19saW5lID0g bWNfb2xkX2xpbmVzW2ldLT5uZXdfbGluZV9udW1iZXI7CisgICAgICAgIHN0cnVjdCBydW4gKnJ1 biA9IG1jX3J1bl9wb29sICsgcnVuX2lkeCsrOworICAgICAgICAvKiBSZWNvcmQgbW92ZS4gKi8K KyAgICAgICAgcnVuLT5jdXJyZW50X3Zwb3MgPSBpOworICAgICAgICBydW4tPmN1cnJlbnRfeSA9 IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCBpKS0+eTsKKyAgICAgICAgcnVuLT5kZXNpcmVk X3Zwb3MgPSBuZXdfbGluZTsKKyAgICAgICAgcnVuLT5kZXNpcmVkX3kgPSBNQVRSSVhfUk9XIChk ZXNpcmVkX21hdHJpeCwgbmV3X2xpbmUpLT55OworICAgICAgICBydW4tPm5yb3dzID0gMTsKKyAg ICAgICAgcnVuLT5oZWlnaHQgPSBNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSktPmhlaWdo dDsKKyAgICAgICAgLyogRXh0ZW5kIGJhY2t3YXJkLiAqLworICAgICAgICBwID0gaSAtIDE7Cisg ICAgICAgIHEgPSBuZXdfbGluZSAtIDE7CisgICAgICAgIHdoaWxlIChwID4gZmlyc3Rfb2xkCisg ICAgICAgICAgICAgICAmJiBxID4gZmlyc3RfbmV3CisgICAgICAgICAgICAgICAmJiBtY19vbGRf bGluZXNbcF0gPT0gbWNfbmV3X2xpbmVzW3FdKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGlu dCBoID0gTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIHApLT5oZWlnaHQ7CisgICAgICAgICAg ICAtLXJ1bi0+Y3VycmVudF92cG9zOworICAgICAgICAgICAgLS1ydW4tPmRlc2lyZWRfdnBvczsK KyAgICAgICAgICAgICsrcnVuLT5ucm93czsKKyAgICAgICAgICAgIHJ1bi0+aGVpZ2h0ICs9IGg7 CisgICAgICAgICAgICBydW4tPmRlc2lyZWRfeSAtPSBoOworICAgICAgICAgICAgcnVuLT5jdXJy ZW50X3kgLT0gaDsKKyAgICAgICAgICAgIC0tcCwgLS1xOworICAgICAgICAgIH0KKyAgICAgICAg LyogRXh0ZW5kIGZvcndhcmQuICovCisgICAgICAgIHAgPSBpICsgMTsKKyAgICAgICAgcSA9IG5l d19saW5lICsgMTsKKyAgICAgICAgd2hpbGUgKHAgPCBsYXN0X29sZAorICAgICAgICAgICAgICAg JiYgcSA8IGxhc3RfbmV3CisgICAgICAgICAgICAgICAmJiBtY19vbGRfbGluZXNbcF0gPT0gbWNf bmV3X2xpbmVzW3FdKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGludCBoID0gTUFUUklYX1JP VyAoY3VycmVudF9tYXRyaXgsIHApLT5oZWlnaHQ7CisgICAgICAgICAgICArK3J1bi0+bnJvd3M7 CisgICAgICAgICAgICBydW4tPmhlaWdodCArPSBoOworICAgICAgICAgICAgKytwLCArK3E7Cisg ICAgICAgICAgfQorICAgICAgICAvKiBJbnNlcnQgcnVuIGludG8gbGlzdCBvZiBhbGwgcnVucy4g IE9yZGVy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B8ICAgICAgIHwgICAgIEIg ICAgIHwKKyAgICAgICAgICArLS0tLS0tLS0tLS0rICAtLT4gICstLS0tLS0tLS0tLSsKKyAgICAg ICAgICB8ICAgICBCICAgICB8ICAgICAgIHwgICAgIEEgICAgIHwKKyAgICAgICAgICArLS0tLS0t LS0tLS0rICAgICAgICstLS0tLS0tLS0tLSsKKyAgICAgSW5zdGVhZCwgcHJlZmVyIGJpZ2dlciBt b3ZlcywgYW5kIGludmFsaWRhdGUgbW92ZXMgdGhhdCB3b3VsZAorICAgICBjb3B5IGZyb20gd2hl cmUgd2UgY29waWVkIHRvLiAqLworICBmb3IgKGkgPSAwOyBpIDwgbnJ1bnM7ICsraSkKKyAgICBp ZiAobWNfcnVuc1tpXS0+bnJvd3MgPiAwKQorICAgICAgeworICAgICAgICBzdHJ1Y3QgcnVuICpy ID0gbWNfcnVuc1tpXTsKKyAgICAgICAgaWYgKHItPmN1cnJlbnRfeSAhPSByLT5kZXNpcmVkX3kp CisgICAgICAgICAgeworICAgICAgICAgICAgLy8gIGZwcmludGYgKHN0ZGVyciwgIiVzOiAgci0+ Y3VycmVudC9kZXNpcmVkX3Zwb3MgKCVkLyVkKSB8IHItPmN1cnJlbnQvZGVzaXJlZF95ICglZC8l ZClcbiIsCisgICAgICAgICAgICAvLyAgICAgICAgICAgci0+Y3VycmVudF95IDwgci0+ZGVzaXJl ZF95ID8gIuKGkyIgOiAi4oaRIiwKKyAgICAgICAgICAgIC8vICAgICAgICAgICByLT5jdXJyZW50 X3Zwb3MsIHItPmRlc2lyZWRfdnBvcywgci0+Y3VycmVudF95LCByLT5kZXNpcmVkX3kpOworICAg ICAgICAgICAgLy8gIHJpZi0+Y2xlYXJfd2luZG93X21vdXNlX2ZhY2UgKHcpOworICAgICAgICAg ICAgLy8gIHJpZi0+c2Nyb2xsX3J1bl9ob29rICh3LCByKTsKKyAgICAgICAgICB9CisgICAgICAg IC8qIFRydW5jYXRlIHJ1bnMgdGhhdCBjb3B5IHRvIHdoZXJlIHdlIGNvcGllZCB0bywgYW5kCisg ICAgICAgICAgIGludmFsaWRhdGUgcnVucyB0aGF0IGNvcHkgZnJvbSB3aGVyZSB3ZSBjb3BpZWQg dG8uICovCisgICAgICAgIGZvciAoaiA9IG5ydW5zIC0gMTsgaiA+IGk7IC0taikKKyAgICAgICAg ICB7CisgICAgICAgICAgICBzdHJ1Y3QgcnVuICpwID0gbWNfcnVuc1tqXTsKKyAgICAgICAgICAg IGJvb2wgdHJ1bmNhdGVkX3AgPSAwOworICAgICAgICAgICAgaWYgKHAtPm5yb3dzID4gMAorICAg ICAgICAgICAgICAgICYmIHAtPmRlc2lyZWRfeSA8IHItPmRlc2lyZWRfeSArIHItPmhlaWdodAor ICAgICAgICAgICAgICAgICYmIHAtPmRlc2lyZWRfeSArIHAtPmhlaWdodCA+IHItPmRlc2lyZWRf eSkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChwLT5kZXNpcmVkX3kgPCBy LT5kZXNpcmVkX3kpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHAt Pm5yb3dzID0gci0+ZGVzaXJlZF92cG9zIC0gcC0+ZGVzaXJlZF92cG9zOworICAgICAgICAgICAg ICAgICAgICBwLT5oZWlnaHQgPSByLT5kZXNpcmVkX3kgLSBwLT5kZXNpcmVkX3k7CisgICAgICAg ICAgICAgICAgICAgIHRydW5jYXRlZF9wID0gMTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAg ICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAg IGludCBucm93c19jb3BpZWQgPSAoci0+ZGVzaXJlZF92cG9zICsgci0+bnJvd3MKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIHAtPmRlc2lyZWRfdnBvcyk7CisgICAg ICAgICAgICAgICAgICAgIGlmIChwLT5ucm93cyA8PSBucm93c19jb3BpZWQpCisgICAgICAgICAg ICAgICAgICAgICAgcC0+bnJvd3MgPSAwOworICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGhl aWdodF9jb3BpZWQgPSAoci0+ZGVzaXJlZF95ICsgci0+aGVpZ2h0CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gcC0+ZGVzaXJlZF95KTsKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgcC0+Y3VycmVudF92cG9zICs9IG5yb3dzX2NvcGllZDsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgcC0+ZGVzaXJlZF92cG9zICs9IG5yb3dzX2NvcGllZDsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgcC0+bnJvd3MgLT0gbnJvd3NfY29waWVkOworICAgICAg ICAgICAgICAgICAgICAgICAgICBwLT5jdXJyZW50X3kgKz0gaGVpZ2h0X2NvcGllZDsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgcC0+ZGVzaXJlZF95ICs9IGhlaWdodF9jb3BpZWQ7CisgICAg ICAgICAgICAgICAgICAgICAgICAgIHAtPmhlaWdodCAtPSBoZWlnaHRfY29waWVkOworICAgICAg ICAgICAgICAgICAgICAgICAgICB0cnVuY2F0ZWRfcCA9IDE7CisgICAgICAgICAgICAgICAgICAg ICAgICB9CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAg IGlmIChyLT5jdXJyZW50X3kgIT0gci0+ZGVzaXJlZF95CisgICAgICAgICAgICAgICAgLyogVGhl IGNvbmRpdGlvbiBiZWxvdyBpcyBlcXVpdmFsZW50IHRvCisgICAgICAgICAgICAgICAgICAgKChw LT5jdXJyZW50X3kgPj0gci0+ZGVzaXJlZF95CisgICAgICAgICAgICAgICAgICAgICAmJiBwLT5j dXJyZW50X3kgPCByLT5kZXNpcmVkX3kgKyByLT5oZWlnaHQpCisgICAgICAgICAgICAgICAgICAg IHx8IChwLT5jdXJyZW50X3kgKyBwLT5oZWlnaHQgPiByLT5kZXNpcmVkX3kKKyAgICAgICAgICAg ICAgICAgICAgICAgICYmIChwLT5jdXJyZW50X3kgKyBwLT5oZWlnaHQKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICA8PSByLT5kZXNpcmVkX3kgKyByLT5oZWlnaHQpKSkKKyAgICAgICAgICAg ICAgICAgICBiZWNhdXNlIHdlIGhhdmUgMCA8IHAtPmhlaWdodCA8PSByLT5oZWlnaHQuICovCisg ICAgICAgICAgICAgICAgJiYgcC0+Y3VycmVudF95IDwgci0+ZGVzaXJlZF95ICsgci0+aGVpZ2h0 CisgICAgICAgICAgICAgICAgJiYgcC0+Y3VycmVudF95ICsgcC0+aGVpZ2h0ID4gci0+ZGVzaXJl ZF95KQorICAgICAgICAgICAgICBwLT5ucm93cyA9IDA7CisgICAgICAgICAgICAvKiBSZW9yZGVy IHJ1bnMgYnkgY29waWVkIHBpeGVsIGxpbmVzIGlmIHRydW5jYXRlZC4gKi8KKyAgICAgICAgICAg IGlmICh0cnVuY2F0ZWRfcCAmJiBwLT5ucm93cyA+IDApCisgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICBpbnQgayA9IG5ydW5zIC0gMTsKKyAgICAgICAgICAgICAgICB3aGlsZSAobWNf cnVuc1trXS0+bnJvd3MgPT0gMCB8fCBtY19ydW5zW2tdLT5oZWlnaHQgPCBwLT5oZWlnaHQpCisg ICAgICAgICAgICAgICAgICBrLS07CisgICAgICAgICAgICAgICAgbWVtbW92ZSAobWNfcnVucyAr IGosIG1jX3J1bnMgKyBqICsgMSwgKGsgLSBqKSAqIHNpemVvZiAoKm1jX3J1bnMpKTsKKyAgICAg ICAgICAgICAgICBtY19ydW5zW2tdID0gcDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0K KyAgICAgICAgLyogQXNzaWduIG1hdHJpeCByb3dzLiAqLworICAgICAgICBmb3IgKGogPSA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QorICB0aGUgcG9p bnRlcnMgYmV0d2VlbiBkZXNpcmVkL2N1cnJlbnQgcm93IG1hdHJpY2VzIGhhdmUgbm90IHlldCBi ZWVuIHN3YXBwZWQgYnkKKyAgYG1ha2VfY3VycmVudCcgaW4gYHVwZGF0ZV93aW5kb3dfbGluZScs IG9yIGJlY2F1c2UgdGhlIHByZXZpb3VzIHJvdyB3b3VsZCBiZQorICB0aGUgc2FtZSBpbiBib3Ro IG1hdHJpY2VzIGlmIHdlIGp1bXBlZCB0byBgc2V0X2N1cnNvcjpgIHdpdGhpbiBgdXBkYXRlX3dp bmRvdycKKyAgYW5kIGBtY191cGRhdGVfd2luZG93X2RyeXJ1bicuICovCisgIGludCBwcmV2X21h dHJpeF9yb3dfc3RhcnRfYnl0ZXBvcyA9ICh2cG9zICE9IDApCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPV19TVEFSVF9CWVRFUE9TIChjdXJyZW50X3Jv dyAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogLTE7CisgIGlu dCBwcmV2X21hdHJpeF9yb3dfZW5kX2J5dGVwb3MgPSAodnBvcyAhPSAwKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XX0VORF9CWVRFUE9TIChjdXJyZW50 X3JvdyAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IC0xOworICBp bnQgbWF0cml4X3Jvd19zdGFydF9ieXRlcG9zID0gTUFUUklYX1JPV19TVEFSVF9CWVRFUE9TIChk ZXNpcmVkX3Jvdyk7CisgIGludCBtYXRyaXhfcm93X2VuZF9ieXRlcG9zID0gTUFUUklYX1JPV19F TkRfQllURVBPUyAoZGVzaXJlZF9yb3cpOworICAvKiBUaGUgZmlyc3QgY29uZGl0aW9uIHRlc3Rz IGZvciBhIHNvbGl0YXJ5IHJvdyBjb250YWluaW5nIFpWLCBwcmVjZWRlZCBieSBhCisgIHJvdyBj b250YWluaW5nIGEgcGVudWx0aW1hdGUgZ2x5cGggd2l0aCBhIGNoYXJwb3Mgb2YgWlYgLSAxIGZv bGxvd2VkIGJ5IGFuIGVuZAorICBvZiByb3cgc3BhY2UgZ2x5cGggd2l0aCBhIGNoYXJwb3Mgb2Yg MC4gIFRoZSBvdGhlciBjb25kaXRpb25zIHRlc3QgZm9yIGFuIGVtcHR5CisgIGJ1ZmZlciAobm90 IG5hcnJvd2VkKSwgb3IgYW4gZW1wdHkgbmFycm93ZWQgYnVmZmVyLiAqLworICBib29sIHJvd19h dF96dl9wID0gKCh2cG9zICE9IDAKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgKGN1cnJlbnRf cm93IC0gMSktPnVzZWRbVEVYVF9BUkVBXSA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgJiYg cHJldl9tYXRyaXhfcm93X3N0YXJ0X2J5dGVwb3MgIT0gcHJldl9tYXRyaXhfcm93X2VuZF9ieXRl cG9zCisgICAgICAgICAgICAgICAgICAgICAgICYmICEoY3VycmVudF9yb3cgLSAxKS0+ZW5kc19h dF96dl9wCisgICAgICAgICAgICAgICAgICAgICAgICYmIG1hdHJpeF9yb3dfc3RhcnRfYnl0ZXBv cyA9PSBtYXRyaXhfcm93X2VuZF9ieXRlcG9zCisgICAgICAgICAgICAgICAgICAgICAgICYmIGRl c2lyZWRfcm93LT5lbmRzX2F0X3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgfHwgKCgoaGVh ZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID09IDEpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICB8fCAoaGVhZGVyX2xpbmVfZm9ybWF0ID09IDAgJiYgdnBvcyA9PSAwKSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgYnVmZmVyX25hcnJvd2VkX3AKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgYm9iX3Jlc3BlY3RfbmFycm93ID09IGVvYl9yZXNwZWN0X25hcnJvdykKKyAg ICAgICAgICAgICAgICAgICAgICB8fCAoKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3Mg PT0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChoZWFkZXJfbGluZV9mb3JtYXQg PT0gMCAmJiB2cG9zID09IDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBib2JfZGlz cmVnYXJkX25hcnJvdyA9PSBlb2JfZGlzcmVnYXJkX25hcnJvdykpOworICAvKiBJZiBsaW5lLW51 bWJlcnMgYXJlIGFjdGl2ZSwgdGhlbiBzcGFjZSBnbHlwaCBwYWRkaW5nIGVxdWFsIHRvIGl0cyB3 aWR0aAorICBjb3VudGVkIGluIEhQT1MgYXJlIGZvbGxvd2VkIGJ5IGEgc2luZ2xlIHJvdyBlbmQg c3BhY2UgZ2x5cGguICBMaW5lIG51bWJlcgorICBwYWRkaW5nIHNwYWNlIGdseXBocyBoYXZlIGEg Y2hhcnBvcyBvZiAtMSwgd2hlcmVhcyB0aGUgZW5kIG9mIHJvdyBzcGFjZSBnbHlwaAorICBoYXMg YSBjaGFycG9zIG9mIDAuICBJZiBsaW5lIG51bWJlcnMgYXJlIGluYWN0aXZlLCB0aGVuIHRoZSBy b3cgd2lsbCBjb250YWluCisgIGEgc29saXRhcnkgc3BhY2UgZ2x5cGggd2l0aCBhIGNoYXJwb3Mg b2YgLTEuICovCisgIGJvb2wgcm93X2JleW9uZF96dl9wID0gKG1hdHJpeF9yb3dfc3RhcnRfYnl0 ZXBvcyA9PSBtYXRyaXhfcm93X2VuZF9ieXRlcG9zCisgICAgICAgICAgICAgICAgICAgICAgICAg ICYmICFyb3dfYXRfenZfcCk7CisgIHJldHVybiAocm93X2F0X3p2X3ApCisgICAgICAgICAgID8g QVRfWlYKKyAgICAgICAgIDogKHJvd19iZXlvbmRfenZfcCkKKyAgICAgICAgICAgPyBQT1NUX1pW CisgICAgICAgICA6IFBSR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1Y3QgZ2x5cGhfbWF0cml4 ICpkZXNpcmVkX21hdHJpeCA9IHctPmRlc2lyZWRfbWF0cml4OworICBpZiAoZGVidWdfcCkKKyAg ICBmcHJpbnRmIChzdGRlcnIsICJtY191cGRhdGVfdGV4dF9hcmVhICglcyk6ICB2cG9zICglZClc biIsCisgICAgICAgICAgICAgICAgICAgICAgbWNfd2luZG93ICh3KSwgdnBvcyk7CisgIC8qIElu YXNtdWNoIGFzIHdlIHByb2Nlc3MgdGhlIGN1cnNvciByb3cgYmVmb3JlIGFsbCBvdGhlciByb3dz LCB3ZSBjYW4gcmVseQorICB1cG9uIHRoZSBwcmV2aW91cyBgZGVzaXJlZF9yb3dgIHRvIGJlIGFj Y3VyYXRlLiAqLworICBlbnVtIG1jX3Jvd19wb3NpdGlvbiByb3dfcG9zaXRpb24gPSAgbWNfcm93 X3Bvc2l0aW9uICh3LCB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZGVzaXJlZF9yb3cKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiBjdXJyZW50X3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgZGVzaXJlZF9yb3csIHZwb3MpOworICAvKiBJZiByb3dzIGFyZSBhdCBk aWZmZXJlbnQgWCBvciBZLCBvciByb3dzIGhhdmUgZGlmZmVyZW50IGhlaWdodCwKKyAgICAgb3Ig dGhlIGN1cnJlbnQgcm93IGlzIG1hcmtlZCBpbnZhbGlkLCB3cml0ZSB0aGUgZW50aXJlIGxpbmUu ICovCisgIGlmICghY3VycmVudF9yb3ctPmVuYWJsZWRfcAorICAgICAgfHwgZGVzaXJlZF9yb3ct PnkgIT0gY3VycmVudF9yb3ctPnkKKyAgICAgIHx8IGRlc2lyZWRfcm93LT5hc2N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bnQgcm93 IGFsc28gZG9lcyBzbyBhdCB0aGUgc2FtZSBwb3NpdGlvbiwgbWFrZSBzdXJlIHdlIHdyaXRlIGF0 IGxlYXN0IG9uZQorICAgICAgICBnbHlwaCwgc28gdGhhdCB0aGUgZmFjZSBleHRlbnNpb24gYWN0 dWFsbHkgdGFrZXMgcGxhY2UuICovCisgICAgICAgIGlmIChNQVRSSVhfUk9XX0VYVEVORFNfRkFD RV9QIChkZXNpcmVkX3JvdykKKyAgICAgICAgICAgICYmIChkZXNpcmVkX3N0b3BfcG9zIDwgY3Vy cmVudF9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgIHx8IChkZXNpcmVkX3N0 b3BfcG9zID09IGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAgICAg ICAgJiYgIU1BVFJJWF9ST1dfRVhURU5EU19GQUNFX1AgKGN1cnJlbnRfcm93KSkpKQorICAgICAg ICAgIC0tZGVzaXJlZF9zdG9wX3BvczsKKyAgICAgICAgc3RvcCA9IG1pbiAoY3VycmVudF9yb3ct PnVzZWRbVEVYVF9BUkVBXSwgZGVzaXJlZF9zdG9wX3Bvcyk7CisgICAgICAgIGkgPSAwOworICAg ICAgICB4ID0gZGVzaXJlZF9yb3ctPng7CisgICAgICAgIGludCBjbGVhcl90b194ID0gMDsKKwor ICAgICAgICAvKiBMb29wIG92ZXIgZ2x5cGhzIHRoYXQgY3VycmVudCBhbmQgZGVzaXJlZCByb3cg bWF5IGhhdmUgaW4gY29tbW9uLiAqLworICAgICAgICB3aGlsZSAoaSA8IHN0b3ApCisgICAgICAg ICAgeworICAgICAgICAgICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZCA9IDA7CisgICAgICAg ICAgICBib29sIGNhbl9za2lwX3AgPSAhYWJvcnRfc2tpcHBpbmc7CisgICAgICAgICAgICAvKiBT a2lwIG92ZXIgZ2x5cGhzIHRoYXQgYm90aCByb3dzIGhhdmUgaW4gY29tbW9uLiAgVGhlc2UgZG9u J3QgaGF2ZQorICAgICAgICAgICAgdG8gYmUgd3JpdHRlbi4gIFdlIGNhbid0IHNraXAgaWYgdGhl IGxhc3QgY3VycmVudCBnbHlwaCBvdmVybGFwcyB0aGUKKyAgICAgICAgICAgIGdseXBoIHRvIGl0 cyByaWdodC4gIEZvciBleGFtcGxlLCBjb25zaWRlciBhIGN1cnJlbnQgcm93IG9mIGBpZicgd2l0 aAorICAgICAgICAgICAgdGhlIGBmJyBpbiBDb3VyaWVyIGJvbGQgc28gdGhhdCBpdCBvdmVybGFw cyB0aGUgYCAnIHRvIGl0cyByaWdodC4KKyAgICAgICAgICAgIElmIHRoZSBkZXNpcmVkIHJvdyBp cyBgICcsIHdlIHdvdWxkIHNraXAgb3ZlciB0aGUgc3BhY2UgYWZ0ZXIgdGhlCisgICAgICAgICAg ICBgaWYnIGFuZCB0aGVyZSB3b3VsZCByZW1haW4gYSBwaXhlbCBmcm9tIHRoZSBgZicgb24gdGhl IHNjcmVlbi4gKi8KKyAgICAgICAgICAgIGlmIChvdmVybGFwcGluZ19nbHlwaHNfcCAmJiBpID4g MCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGgg PSAmY3VycmVudF9yb3ctPmdseXBoc1tURVhUX0FSRUFdW2kgLSAxXTsKKyAgICAgICAgICAgICAg ICBpbnQgbGVmdCwgcmlnaHQ7CisgICAgICAgICAgICAgICAgcmlmLT5nZXRfZ2x5cGhfb3Zlcmhh bmdzIChnbHlwaCwgWEZSQU1FICh3LT5mcmFtZSksICZsZWZ0LCAmcmlnaHQpOworICAgICAgICAg ICAgICAgIGNhbl9za2lwX3AgPSAocmlnaHQgPT0gMCAmJiAhYWJvcnRfc2tpcHBpbmcpOworICAg ICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoY2FuX3NraXBfcCkKKyAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgIGludCBzdGFydF9ocG9zID0gaTsKKyAgICAgICAgICAgICAgICB3 aGlsZSAoaSA8IHN0b3AKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgR0xZUEhfRVFVQUxfUCAo ZGVzaXJlZF9nbHlwaCwgY3VycmVudF9nbHlwaCkpCisgICAgICAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgICAgICsrYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZDsKKyAgICAgICAgICAg ICAgICAgICAgaWYgKGFycmF5X2dseXBoc19za2lwcGVkLmFsbG9jYXRlZCA8IGFycmF5X2dseXBo c19za2lwcGVkLnVzZWQpCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg ICAgICAgICAgaW50IG9sZF9hbGxvYyA9IGFycmF5X2dseXBoc19za2lwcGVkLmFsbG9jYXRlZDsK KyAgICAgICAgICAgICAgICAgICAgICAgIGludCBuZXdfZWx0cyA9IGFycmF5X2dseXBoc19za2lw cGVkLnVzZWQgLSBhcnJheV9nbHlwaHNfc2tpcHBlZC5hbGxvY2F0ZWQ7CisgICAgICAgICAgICAg ICAgICAgICAgICBhcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVkID0KKyAgICAgICAgICAgICAg ICAgICAgICAgICAgeHBhbGxvYyAoYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmFycmF5X2dseXBoc19za2lwcGVkLmFsbG9j YXRlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2VsdHMsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElOVF9NQVgsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHNpemVvZiAqYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZCk7 CisgICAgICAgICAgICAgICAgICAgICAgICBtZW1zZXQgKGFycmF5X2dseXBoc19za2lwcGVkLnNr aXBwZWQgKyBvbGRfYWxsb2MsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo YXJyYXlfZ2x5cGhzX3NraXBwZWQuYWxsb2NhdGVkIC0gb2xkX2FsbG9jKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAqIHNpemVvZiAqYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tp cHBlZCk7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpbnQg bnRoID0gYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZCAtIDE7CisgICAgICAgICAgICAgICAgICAg IGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbbnRoXS54ID0geDsKKyAgICAgICAgICAgICAg ICAgICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZFtudGhdLmhwb3MgPSBpOworICAgICAg ICAgICAgICAgICAgICBhcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVkW250aF0uZW5hYmxlZF9w ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgeCArPSBkZXNpcmVkX2dseXBoLT5waXhlbF93 aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgKytkZXNpcmVkX2dseXBoLCArK2N1cnJlbnRfZ2x5 cGgsICsraTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvKiBDb25zaWRl ciB0aGUgY2FzZSB0aGF0IHRoZSBjdXJyZW50IHJvdyBjb250YWlucyAieHh4IHBwcCBnZ2ciIGlu CisgICAgICAgICAgICAgICAgaXRhbGljIENvdXJpZXIgZm9udCwgYW5kIHRoZSBkZXNpcmVkIHJv dyBpcyAieHh4IGdnZyIuICBUaGUgY2hhcmFjdGVyIGBwJworICAgICAgICAgICAgICAgIGhhcyBs YmVhcmluZywgYGcnIGhhcyBub3QuICBUaGUgbG9vcCBhYm92ZSB3aWxsIHN0b3AgaW4gZnJvbnQg b2YgdGhlCisgICAgICAgICAgICAgICAgZmlyc3QgYHAnIGluIHRoZSBjdXJyZW50IHJvdy4gIElm IHdlIHdvdWxkIHN0YXJ0IHdyaXRpbmcgZ2x5cGhzIHRoZXJlLCB3ZQorICAgICAgICAgICAgICAg IHdvdWxkbid0IGVyYXNlIHRoZSBsYmVhcmluZyBvZiB0aGUgYHAnLiAgVGhlIHJlc3Qgb2YgdGhl IGxiZWFyaW5nIHByb2JsZW0KKyAgICAgICAgICAgICAgICBpcyB0aGVuIHRha2VuIGNhcmUgb2Yg YnkgZHJhd19nbHlwaHMuICovCisgICAgICAgICAgICAgICAgaWYgKG92ZXJsYXBwaW5nX2dseXBo c19wCisgICAgICAgICAgICAgICAgICAgICYmIGkgPiAwCisgICAgICAgICAgICAgICAgICAgICYm IGkgPCBjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAgICYm IChjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdICE9IGRlc2lyZWRfcm93LT51c2VkW1RFWFRf QVJFQV0pKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpbnQgbGVm dCwgcmlnaHQ7CisgICAgICAgICAgICAgICAgICAgIHJpZi0+Z2V0X2dseXBoX292ZXJoYW5ncyAo Y3VycmVudF9nbHlwaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBYRlJBTUUgKHctPmZy YW1lKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmbGVmdCwgJnJpZ2h0KTsKKyAgICAg ICAgICAgICAgICAgICAgd2hpbGUgKGxlZnQgPiAwICYmIGkgPiAwKQorICAgICAgICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC0taSwgLS1kZXNpcmVkX2dseXBoLCAt LWN1cnJlbnRfZ2x5cGg7CisgICAgICAgICAgICAgICAgICAgICAgICB4IC09IGRlc2lyZWRfZ2x5 cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICAgICAgICAgICAgbGVmdCAtPSBkZXNpcmVk X2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAg ICAgICAgICAgIC8qIEFib3J0IHRoZSBza2lwcGluZyBhbGdvcml0aG0gaWYgd2UgZW5kIHVwIGJl Zm9yZQorICAgICAgICAgICAgICAgICAgICAgICBvdXIgc3RhcnRpbmcgcG9pbnQsIHRvIGF2b2lk IGxvb3BpbmcgKGJ1ZyMxMDcwKS4KKyAgICAgICAgICAgICAgICAgICAgICAgVGhpcyBjYW4gaGFw cGVuIHdoZW4gdGhlIGxiZWFyaW5nIGlzIGxhcmdlciB0aGFuCisgICAgICAgICAgICAgICAgICAg ICAgIHRoZSBwaXhlbCB3aWR0aC4gKi8KKyAgICAgICAgICAgICAgICAgICAgYWJvcnRfc2tpcHBp bmcgPSAoaSA8IHN0YXJ0X2hwb3MpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICB9CisgICAgICAgICAgICAvKiBUcnkgdG8gYXZvaWQgd3JpdGluZyB0aGUgZW50aXJlIHJlc3Qg b2YgdGhlIGRlc2lyZWQgcm93CisgICAgICAgICAgICAgICBieSBsb29raW5nIGZvciBhIHJlc3lu YyBwb2ludC4gIFRoaXMgbWFpbmx5IHByZXZlbnRzCisgICAgICAgICAgICAgICBtb2RlIGxpbmUg ZmxpY2tlcmluZyBpbiB0aGUgY2FzZSB0aGUgbW9kZSBsaW5lIGlzIGluCisgICAgICAgICAgICAg ICBmaXhlZC1waXRjaCBmb250LCB3aGljaCBpdCB1c3VhbGx5IHdpbGwgYmUuICovCisgICAgICAg ICAgICBpZiAoaSA8IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICBpbnQgc3RhcnRfeCA9IHgsIHN0YXJ0X2hwb3MgPSBpOworICAg ICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqc3RhcnQgPSBkZXNpcmVkX2dseXBoOworICAgICAg ICAgICAgICAgIGludCBjdXJyZW50X3ggPSB4OworICAgICAgICAgICAgICAgIGJvb2wgc2tpcF9m aXJzdF9wID0gIWNhbl9za2lwX3A7CisgICAgICAgICAgICAgICAgLyogRmluZCB0aGUgbmV4dCBn bHlwaCB0aGF0J3MgZXF1YWwgYWdhaW4uICovCisgICAgICAgICAgICAgICAgd2hpbGUgKGkgPCBz dG9wCisgICAgICAgICAgICAgICAgICAgICAgICYmIChza2lwX2ZpcnN0X3AKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgIHx8ICFHTFlQSF9FUVVBTF9QIChkZXNpcmVkX2dseXBoLCBjdXJyZW50 X2dseXBoKSkKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgeCA9PSBjdXJyZW50X3gpCisgICAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHggKz0gZGVzaXJlZF9nbHlwaC0+ cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRfeCArPSBjdXJyZW50X2ds eXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgKytkZXNpcmVkX2dseXBoLCAr K2N1cnJlbnRfZ2x5cGgsICsraTsKKyAgICAgICAgICAgICAgICAgICAgc2tpcF9maXJzdF9wID0g MDsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBmb3IgKGludCBlbHQgPSAw OworICAgICAgICAgICAgICAgICAgICAgZWx0IDwgYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZDsK KyAgICAgICAgICAgICAgICAgICAgICsrZWx0KQorICAgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgICBpbnQgeCA9IGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbZWx0XS54 OworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGFycmF5X2dseXBoc19za2lwcGVkLnNr aXBwZWRbZWx0XS5ocG9zOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnRhcmdl dF9nbHlwaCA9CisgICAgICAgICAgICAgICAgICAgICAgbWNfZ2V0X2N1cnNvcl9nbHlwaCAodywg ZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCBocG9zLCB2cG9zKTsKKyAgICAgICAgICAgICAg ICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgICAgICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJy LCAiU0tJUFBFRDogIHZwb3MgKCVkKSB8IGNoYXIgKCVkLyVzKSB8IHg6ICglZCkgfCBocG9zICgl ZC8lZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCB0 YXJnZXRfZ2x5cGgtPnUuY2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBtY19jaGFyX3RvX3N0cmluZyAodGFyZ2V0X2dseXBoLT51LmNoKSwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHgsIGhwb3MsIHVwZGF0ZWRfcm93LT51c2VkW1RFWFRf QVJFQV0gLSAxKTsKKyAgICAgICAgICAgICAgICAgICAgbWNfZHJhd19yb3cgKHcsIGRlc2lyZWRf bWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBoLCB4LCAxLCB2cG9zLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bv c2l0aW9uLCBkcmF3X3AsIFNLSVBQRUQpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgICAgIGlmIChpID09IHN0YXJ0X2hwb3MgfHwgeCAhPSBjdXJyZW50X3gpCisgICAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGkgPSBzdGFydF9ocG9zOworICAgICAgICAg ICAgICAgICAgICB4ID0gc3RhcnRfeDsKKyAgICAgICAgICAgICAgICAgICAgZGVzaXJlZF9nbHlw aCA9IHN0YXJ0OworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgICAgICBvdXRwdXRfY3Vyc29yX3RvICh3LCB2cG9zLCBzdGFydF9ocG9z LCBkZXNpcmVkX3Jvdy0+eSwgc3RhcnRfeCk7CisgICAgICAgICAgICAgICAgLyogUmUtZHJhdyBh IHBvcnRpb24gb2YgdGhlIHJvdy4gKi8KKyAgICAgICAgICAgICAgICBpZiAoZGVidWdfcCkKKyAg ICAgICAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIlJFRFJBVyBTRUdNRU5UOlxuXAorICAg ICAgICAgICAgICAgICAgICB2cG9zICglZCkgfCBjaGFyICglZC8lcykgfCB4OiAoJWQpIHwgaHBv cyAoJWQvJWQpIHwgbGVuZ3RoICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgIHZwb3MsIHN0 YXJ0LT51LmNoLCBtY19jaGFyX3RvX3N0cmluZyAoc3RhcnQtPnUuY2gpLAorICAgICAgICAgICAg ICAgICAgICBzdGFydF94LCBzdGFydF9ocG9zLCB1cGRhdGVkX3Jvdy0+dXNlZFtURVhUX0FSRUFd IC0gMSwgaSAtIHN0YXJ0X2hwb3MpOworICAgICAgICAgICAgICAgIGJsb2NrX2lucHV0ICgpOwor ICAgICAgICAgICAgICAgIGludCBsZW4gPSBpIC0gc3RhcnRfaHBvczsKKyAgICAgICAgICAgICAg ICBpbnQgaHBvcyA9IHN0YXJ0IC0gdXBkYXRlZF9yb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAg ICAgICAgICAgICAgIHctPm91dHB1dF9jdXJzb3IueCA9CisgICAgICAgICAgICAgICAgICBtY19k cmF3X2dseXBocyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB3LT5vdXRwdXRfY3Vy c29yLngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVEVYVF9BUkVBLCBocG9z LCBocG9zICsgbGVuLCBEUkFXX05PUk1BTF9URVhULAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDAsIHZwb3MsIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVfcCwgY3Vy c29yX2djX3AsIE1DX0RSQVdfR0xZUEhfU1RSSU5HLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGRyYXdfcCk7CisgICAgICAgICAgICAgICAgdy0+b3V0cHV0X2N1cnNvci5ocG9z ICs9IGxlbjsKKyAgICAgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgICAgICAg ICAgIG1jX2RyYXdfcm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHN0YXJ0LCBz dGFydF94LCBpIC0gc3RhcnRfaHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdnBv cywgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBkcmF3X3AsIFNDUklC RV9UV08pOworICAgICAgICAgICAgICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAgICAgICAgIH0K KyAgICAgICAgICB9CisKKyAgICAgICAgLyogV3JpdGUgdGhlIHJlc3QuICovCisgICAgICAgIGlm IChpIDwgZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgICAgICB7CisgICAgICAg ICAgICBvdXRwdXRfY3Vyc29yX3RvICh3LCB2cG9zLCBpLCBkZXNpcmVkX3Jvdy0+eSwgeCk7Cisg ICAgICAgICAgICBpZiAoZGVidWdfcCkKKyAgICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAi RFJBVyBSRU1BSU5ERVIgT0YgVEhFIFJPVzpcblwKKyAgICAgICAgICAgICAgICB2cG9zICglZCkg fCBjaGFyICglZC8lcykgfCB4OiAoJWQpIHwgaHBvcyAoJWQvJWQpIHwgbGVuZ3RoICglZClcbiIs CisgICAgICAgICAgICAgICAgdnBvcywgZGVzaXJlZF9nbHlwaC0+dS5jaCwgbWNfY2hhcl90b19z dHJpbmcgKGRlc2lyZWRfZ2x5cGgtPnUuY2gpLAorICAgICAgICAgICAgICAgIHgsIGksIGRlc2ly ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxLCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFd IC0gaSk7CisgICAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgIGludCBsZW4g PSBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gaTsKKyAgICAgICAgICAgIGludCBocG9z ID0gZGVzaXJlZF9nbHlwaCAtIHVwZGF0ZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAg ICAgICAgIHctPm91dHB1dF9jdXJzb3IueCA9CisgICAgICAgICAgICAgIG1jX2RyYXdfZ2x5cGhz ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHctPm91dHB1dF9jdXJzb3IueCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRFWFRfQVJFQSwgaHBvcywgaHBvcyArIGxlbiwg RFJBV19OT1JNQUxfVEVYVCwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZwb3Ms IGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBjdXJzb3JfZ2NfcCwgTUNfRFJBV19HTFlQ SF9TVFJJTkcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3X3ApOworICAgICAg ICAgICAgdy0+b3V0cHV0X2N1cnNvci5ocG9zICs9IGxl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ICAgICAgICAgICAgY2hhbmdlZF9wID0gMTsKKyAgICAgICAgICB9CisgICAgICAgICAg LyogRXZlcnl0aGluZyBhZnRlciB0aGUgcHJldmlvdXMgY2hhbmdlIHJlbWFpbmVkIHRoZSBzYW1l LiAgYGlgIGFuZCBgeGAgd2VyZQorICAgICAgICAgIGluY3JlbWVudGVkIHRvIHRoZSBlbmQgb2Yg dGhlIGdseXBoIHJvdy4gIGkgPT0gZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAg ICAgIFRoZSBgdy0+b3V0cHV0X2N1cnNvci54L3kvaHBvcy92cG9zYCBpcyBhdCB0aGUgZW5kIG9m IHRoZSBwcmV2aW91cyBjaGFuZ2UuCisgICAgICAgICAgV2hlbiB0aGlzIHNpdHVhdGlvbiBleGlz dHMsIHRoZSBkaXN0YW5jZSBiZXR3ZWVuIHRoZSBlbmQgb2YgdGhlIGdseXBoIHJvdyBhbmQKKyAg ICAgICAgICB0aGUgcmlnaHQgZWRnZSBvZiB0aGUgd2luZG93IHdpbGwgX25vdF8gYmUgY2xlYXJl ZC4gIFRoZXJlZm9yZSwgaXQgaXMgb2theSB0bworICAgICAgICAgIGRyYXcgdGhlIGZsb2F0aW5n IGdseXBocyBmb3IgdGhlIGhvcml6b250YWwvdmVydGljYWwgcnVsZXJzIGhlcmUuICovCisgICAg ICAgICAgZWxzZSBpZiAoY2hhbmdlZF9wCisgICAgICAgICAgICAgICAgICAgJiYgdy0+b3V0cHV0 X2N1cnNvci5ocG9zICE9IHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgICAg ICB7CisgICAgICAgICAgICAgIGludCB4ID0gdy0+b3V0cHV0X2N1cnNvci54OworICAgICAgICAg ICAgICBpbnQgaHBvcyA9IHctPm91dHB1dF9jdXJzb3IuaHBvczsKKyAgICAgICAgICAgICAgc3Ry dWN0IGdseXBoICpzdGFydCA9IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIGRlc2lyZWRfbWF0cml4 LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgdXBkYXRlZF9yb3csIGhwb3MsIHZwb3MpOworICAgICAgICAgICAgICBpZiAody0+b3V0cHV0 X2N1cnNvci54ID09IHVwZGF0ZWRfcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICB4 IC09IHN0YXJ0LT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgaWYgKGRlYnVnX3ApCisgICAg ICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiUE9TVC1DSEFOR0VEOiAgdnBvcyAoJWQpIHwg eCAoJWQpIHwgaHBvcyAoJWQvJWQpIHwgY2hhciAoJWQvJXMpXG4iLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgdnBvcywgeCwgaHBvcywgdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9B UkVBXSAtIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydC0+dS5jaCwg bWNfY2hhcl90b19zdHJpbmcgKHN0YXJ0LT51LmNoKSk7CisgICAgICAgICAgICAgIG1jX2RyYXdf cm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHN0YXJ0LCB4LAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIGhwb3MsIHZw b3MsIGN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBlc3NlbnRpYWxz LCByb3dfcG9zaXRpb24sIGRyYXdfcCwgUE9TVF9DSEFOR0VEKTsKKyAgICAgICAgICAgIH0KKyAg ICAgICAgICAgIC8qIFRoZXJlIHdlcmUgbm8gY2hhbmdlcyBhbmQgaSA9PSBkZXNpcmVkX3Jvdy0+ dXNlZFtURVhUX0FSRUFdICovCisgICAgICAgICAgICBlbHNlIGlmICghY2hhbmdlZF9wKQorICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgICAgICAg ICAgICBmcHJpbnRmIChzdGRlcnIsICJVTkNIQU5HRUQgLS0gV1JJVEUgRU5USVJFIExJTkU6ICB2 cG9zICglZCkgfCByb3ctPnVzZWQgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgdnBvcywgdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpOworICAgICAg ICAgICAgICAgIG1jX2RyYXdfcm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIGRl c2lyZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgZGVzaXJlZF9yb3ctPngsIGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0sIHZwb3MsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIHJv d19wb3NpdGlvbiwgZHJhd19wLCBVTkNIQU5HRUQpOworICAgICAgICAgICAgICB9CisKKyAgICAg ICAgLyogTWF5YmUgY2xlYXIgdG8gZW5kIG9mIGxpbmUuICovCisgICAgICAgIGlmIChNQVRSSVhf Uk9XX0VYVEVORFNfRkFDRV9QIChkZXNpcmVkX3JvdykpCisgICAgICAgICAgeworICAgICAgICAg ICAgLyogSWYgbmV3IHJvdyBleHRlbmRzIHRvIHRoZSBlbmQgb2YgdGhlIHRleHQgYXJlYSwgbm90 aGluZworICAgICAgICAgICAgICAgaGFzIHRvIGJlIGNsZWFyZWQsIGlmIGFuZCBvbmx5IGlmIHdl IGRpZCBhIHdyaXRlX2dseXBocworICAgICAgICAgICAgICAgYWJvdmUuICBUaGlzIGlzIG1hZGUg c3VyZSBieSBzZXR0aW5nIGRlc2lyZWRfc3RvcF9wb3MKKyAgICAgICAgICAgICAgIGFwcHJvcHJp YXRlbHkgYWJvdmUuICovCisgICAgICAgICAgICBlYXNzZXJ0IChpIDwgZGVzaXJlZF9yb3ctPnVz ZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAgICAgfHwgKChkZXNpcmVkX3Jvdy0+dXNl ZFtURVhUX0FSRUFdID09IGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgTUFUUklYX1JPV19FWFRFTkRTX0ZBQ0VfUCAoY3VycmVudF9yb3cp KSk7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKE1BVFJJWF9ST1dfRVhURU5EU19G QUNFX1AgKGN1cnJlbnRfcm93KSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogSWYg b2xkIHJvdyBleHRlbmRzIHRvIHRoZSBlbmQgb2YgdGhlIHRleHQgYXJlYSwgY2xlYXIuICovCisg ICAgICAgICAgICAgIGlmIChpID49IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAg ICAgICAgICAgICAgb3V0cHV0X2N1cnNvcl90byAodywgdnBvcywgaSwgZGVzaXJlZF9yb3ctPnks IGRlc2lyZWRfcm93LT5waXhlbF93aWR0aCk7CisgICAgICAgICAgICAgIGlmIChkcmF3X3ApCisg ICAgICAgICAgICAgICAgcmlmLT5jbGVhcl9lbmRfb2ZfbGluZSAodywgdXBkYXRlZF9yb3csIFRF WFRfQVJFQSwgLTEpOworICAgICAgICAgICAgICBjbGVhcl90b194ID0gLTE7CisgICAgICAgICAg ICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmIChk ZXNpcmVkX3Jvdy0+cGl4ZWxfd2lkdGggPCBjdXJyZW50X3Jvdy0+cGl4ZWxfd2lkdGgpCisgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBPdGhlcndpc2UgY2xlYXIgdG8gdGhlIGVu ZCBvZiB0aGUgb2xkIHJvdy4gIEV2ZXJ5dGhpbmcKKyAgICAgICAgICAgICAgICAgICBhZnRlciB0 aGF0IHBvc2l0aW9uIHNob3VsZCBiZSBjbGVhciBhbHJlYWR5LiAqLworICAgICAgICAgICAgICAg IGludCB4bGltOworICAgICAgICAgICAgICAgIGlmIChpID49IGRlc2lyZWRfcm93LT51c2VkW1RF WFRfQVJFQV0pCisgICAgICAgICAgICAgICAgICBvdXRwdXRfY3Vyc29yX3RvICh3LCB2cG9zLCBp LCBkZXNpcmVkX3Jvdy0+eSwgZGVzaXJlZF9yb3ctPnBpeGVsX3dpZHRoKTsKKyAgICAgICAgICAg ICAgICAvKiBJZiBjdXJzb3IgaXMgZGlzcGxheWVkIGF0IHRoZSBlbmQgb2YgdGhlIGxpbmUsIG1h a2Ugc3VyZQorICAgICAgICAgICAgICAgICAgIGl0J3MgY2xlYXJlZC4gIE5vd2FkYXlzIHdlIGRv bid0IGhhdmUgYSBwaHlzX2N1cnNvcl9nbHlwaAorICAgICAgICAgICAgICAgICAgIHdpdGggd2hp Y2ggdG8gZXJhc2UgdGhlIGN1cnNvciAoYmVjYXVzZSB0aGlzIG1ldGhvZAorICAgICAgICAgICAg ICAgICAgIGRvZXNuJ3Qgd29yayB3aXRoIGxiZWFyaW5nL3JiZWFyaW5nKSwgc28gd2UgbXVzdCBk byBpdCB0aGlzIHdheS4gKi8KKyAgICAgICAgICAgICAgICBpZiAodnBvcyA9PSB3LT5waHlzX2N1 cnNvci52cG9zCisgICAgICAgICAgICAgICAgICAgICYmIChkZXNpcmVkX3Jvdy0+cmV2ZXJzZWRf cAorICAgICAgICAgICAgICAgICAgICAgICAgPyAody0+cGh5c19jdXJzb3IuaHBvcyA8IDApCisg ICAgICAgICAgICAgICAgICAgICAgICA6ICh3LT5waHlzX2N1cnNvci5ocG9zID49IGRlc2lyZWRf cm93LT51c2VkW1RFWFRfQVJFQV0pKSkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICAgICAgdy0+cGh5c19jdXJzb3Jfb25fcCA9IDA7CisgICAgICAgICAgICAgICAgICAgIHhs aW0gPSAtMTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgICAgICAgeGxpbSA9IGN1cnJlbnRfcm93LT5waXhlbF93aWR0aDsKKyAgICAg ICAgICAgICAgICBpZiAoZHJhd19wKQorICAgICAgICAgICAgICAgICAgcmlmLT5jbGVhcl9lbmRf b2ZfbGluZSAodywgdXBkYXRlZF9yb3csIFRFWFRfQVJFQSwgeGxpbSk7CisgICAgICAgICAgICAg ICAgY2xlYXJfdG9feCA9IHhsaW07CisgICAgICAgICAgICAgICAgY2hhbmdlZF9wID0gMTsKKyAg ICAgICAgICAgICAgfQorCisgICAgICAgIGlmIChjaGFuZ2VkX3AKKyAgICAgICAgICAgICYmIGNs ZWFyX3RvX3ggIT0gMCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpbnQgdGV4dF9hcmVhX3dp ZHRoID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgIHN0cnVj dCBtY19SR0IgZGVidWdfZmcgPSB7LnJlZCA9IDAuODY3LCAuZ3JlZW4gPSAwLjg2NywgLmJsdWUg PSAwLjg2N307CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnRhcmdldF9nbHlwaCA9CisgICAg ICAgICAgICAgIHVwZGF0ZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHVwZGF0ZWRfcm93LT51 c2VkW1RFWFRfQVJFQV0gLSAxOworICAgICAgICAgICAgLyogYG1jX2VuZ2luZScgb25seSBkcmF3 cyBhbiBNQ19HTFlQSCB3aGVuIHggPCB1cGRhdGVkX3Jvdy0+cGl4ZWxfd2lkdGguCisgICAgICAg ICAgICBUaGUgY3VycmVudCBkZXNpZ24gaW5oaWJpdHMgZHJhd2luZyBvdmVyIGFuIGV4aXN0aW5n IGdseXBoIGF0IHRoZSBlbmQgb2YgYQorICAgICAgICAgICAgd29yZC13cmFwcGVkIGxpbmUuICBT YWlkIGdseXBoIHJlY2VpdmVzIGEgZmFrZSBjdXJzb3IgaW4gZWl0aGVyIG9uZSBvZiB0aGUKKyAg ICAgICAgICAgIHByZXZpb3VzIHNlY3Rpb25zIGFib3ZlLCBhbmQgc2hvdWxkIG5vdCBiZSBvdmVy d3JpdHRlbiB3aXRoIGFub3RoZXIgb25lLgorICAgICAgICAgICAgVGhpcyBkZXNpZ24gaXMgbmVl ZGVkIGJlY2F1c2UgYSB3b3JkLXdyYXBwZWQgbGluZSBkb2VzIG5vdCByZWNlaXZlIGFuIGV4dHJh CisgICAgICAgICAgICBzcGFjZSBsaWtlIG5vbi13b3JkLXdyYXBwZWQgbGluZXMgZG8uICovCisg ICAgICAgICAgICBpbnQgeCA9IHVwZGF0ZWRfcm93LT5waXhlbF93aWR0aDsKKyAgICAgICAgICAg IGludCBocG9zID0gdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDE7CisgICAgICAgICAg ICBpbnQgeF9saW1pdCA9IChjbGVhcl90b194ID09IC0xKQorICAgICAgICAgICAgICAgICAgICAg ICAgICA/IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICA6IGNsZWFy X3RvX3g7CisgICAgICAgICAgICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAody0+Y29udGVu dHMpOworICAgICAgICAgICAgYm9vbCBmaWxsX2NvbHVtbl90cnVtcHNfcCA9ICghTklMUCAoQlZB UiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID09IGVzc2VudGlhbHMu ZmNfeCk7CisgICAgICAgICAgICBpZiAobWNfc3RkZXJyX3ApCisgICAgICAgICAgICAgIGZwcmlu dGYgKHN0ZGVyciwgIm1jX3VwZGF0ZV90ZXh0X2FyZWEgKGZsb2F0aW5nKTogIHZwb3MgKCVkKSB8 IHhfbGltaXQgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCB4 X2xpbWl0KTsKKyAgICAgICAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAg ICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgICAgICAg JiYgKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgfHwgKCFlc3NlbnRp YWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwg ZmNfaW5hY3RpdmVfd2luZG93cykpKSkKKyAgICAgICAgICAgICAgICAmJiB4IDwgdGV4dF9hcmVh X3dpZHRoCisgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID49IHgKKyAgICAgICAg ICAgICAgICAmJiB0YXJnZXRfZ2x5cGggIT0gTlVMTAorICAgICAgICAgICAgICAgICYmIGRyYXdf cCkKKyAgICAgICAgICAgICAgbWNfZW5naW5lICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9y b3csIHRhcmdldF9nbHlwaCwgVEVYVF9BUkVBLAorICAgICAgICAgICAgICAgICAgICAgICAgIHgs IHhfbGltaXQsIHVwZGF0ZWRfcm93LT55LCBocG9zLCB2cG9zLCBNQ19CQVIsIDEsCisgICAgICAg ICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9u LAorICAgICAgICAgICAgICAgICAgICAgICAgIGRlYnVnX3AgPyBkZWJ1Z19mZyA6IGVzc2VudGlh bHMuZmNfZmdbcm93X3Bvc2l0aW9uXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBGSUxMX0NP TFVNTiwgZHJhd19wLCBOT1dIRVJFLCBOT19DQUNIRSk7CisgICAgICAgICAgICBpZiAoQlVGRkVS UCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNyb3Nz aGFpcnMpKQorICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9ob3Jpem9udGFs X3J1bGVyKSkKKyAgICAgICAgICAgICAgICAmJiAoZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAg ICAgICAgICAgICAgICB8fCAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAg ICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkpKQorICAgICAg ICAgICAgICAgICYmIHggPCB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAmJiB2cG9z ID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICAgICAgJiYgdGFyZ2V0X2dseXBoICE9IE5V TEwKKyAgICAgICAgICAgICAgICAmJiBkcmF3X3ApCisgICAgICAgICAgICAgIG1jX2VuZ2luZSAo dywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRfZ2x5cGgsIFRFWFRfQVJFQSwK KyAgICAgICAgICAgICAgICAgICAgICAgICB4LCB4X2xpbWl0LCB1cGRhdGVkX3Jvdy0+eSwgaHBv cywgdnBvcywgTUNfSEJBUiwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0 cml4LCBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAg ZGVidWdfcCA/IGRlYnVnX2ZnIDogZXNzZW50aWFscy5jaF9mZ1tyb3dfcG9zaXRpb25dLAorICAg ICAgICAgICAgICAgICAgICAgICAgIEhPUklaT05UQUxfUlVMRVIsIGRyYXdfcCwgTk9XSEVSRSwg Tk9fQ0FDSEUpOworICAgICAgICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAg ICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAg ICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAg ICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgIHx8ICghZXNzZW50 aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIs IGNoX2luYWN0aXZlX3dpbmRvd3MpKSkpCisgICAgICAgICAgICAgICAgJiYgIWZpbGxfY29sdW1u X3RydW1wc19wCisgICAgICAgICAgICAgICAgJiYgeCA8IHRleHRfYXJlYV93aWR0aAorICAgICAg ICAgICAgICAgICYmIHZwb3MgIT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAgICAgICAgICAmJiB3 LT5jdXJzb3IueCA+PSB4CisgICAgICAgICAgICAgICAgJiYgdGFyZ2V0X2dseXBoICE9IE5VTEwK KyAgICAgICAgICAgICAgICAmJiBkcmF3X3ApCisgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywg ZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRfZ2x5cGgsIFRFWFRfQVJFQSwKKyAg ICAgICAgICAgICAgICAgICAgICAgICB4LCB4X2xpbWl0LCB1cGRhdGVkX3Jvdy0+eSwgaHBvcywg dnBvcywgTUNfQkFSLCAxLAorICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgs IGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBkZWJ1 Z19wID8gZGVidWdfZmcgOiBlc3Nlb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ovCisgICAgICAgICAgY3VycmVudF9yb3ctPnJlZHJhd19mcmluZ2VfYml0bWFwc19wID0gMTsK KyAgICAgICAgfQorICAgICAgYm9vbCB1cGRhdGVkX3AgPSBtY191cGRhdGVfdGV4dF9hcmVhICh3 LCBkZXNpcmVkX3JvdywgdnBvcywgY3Vyc29yX21hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscywgZHJhd19wKTsKKyAgICAgIC8qIFVw ZGF0ZSB0aGUgZGlzcGxheSBvZiB0aGUgdGV4dCBhcmVhLiAqLworICAgICAgaWYgKHVwZGF0ZWRf cCkKKyAgICAgICAgeworICAgICAgICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAgICAgaWYgKGN1 cnJlbnRfcm93LT5tb3VzZV9mYWNlX3ApCisgICAgICAgICAgICAqbW91c2VfZmFjZV9vdmVyd3Jp dHRlbl9wID0gMTsKKyAgICAgICAgfQorICAgICAgLyogVXBkYXRlIGRpc3BsYXkgb2YgdGhlIHJp Z2h0IG1hcmdpbiBhcmVhLCBpZiB0aGVyZSBpcyBvbmUuICovCisgICAgICBpZiAoIWRlc2lyZWRf cm93LT5mdWxsX3dpZHRoX3AgJiYgdy0+cmlnaHRfbWFyZ2luX2NvbHMgPiAwKQorICAgICAgICB7 CisgICAgICAgICAgY2hhbmdlZF9wID0gMTsKKyAgICAgICAgICB1cGRhdGVfbWFyZ2luYWxfYXJl YSAodywgZGVzaXJlZF9yb3csIFJJR0hUX01BUkdJTl9BUkVBLCB2cG9zKTsKKyAgICAgICAgfQor ICAgICAgLyogRHJhdyB0cnVuY2F0aW9uIG1hcmtzIGV0Yy4gKi8KKyAgICAgIGlmICghY3VycmVu dF9yb3ctPmVuYWJsZWRfcAorICAgICAgICAgIHx8IGRlc2lyZWRfcm93LT55ICE9IGN1cnJlbnRf cm93LT55CisgICAgICAgICAgfHwgZGVzaXJlZF9yb3ctPnZpc2libGVfaGVpZ2h0ICE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cCA9IGZhbHNlOworICBib29sIGdvX29uZV9wID0g KG9sZF9tYXRyaXguY3Vyc29yc191c2VkW01DX0NBQ0hFXSA+IDAKKyAgICAgICAgICAgICAgICAg ICB8fCBvbGRfbWF0cml4LmN1cnNvcnNfdXNlZFtDSF9DQUNIRV0gPiAwCisgICAgICAgICAgICAg ICAgICAgfHwgb2xkX21hdHJpeC5jdXJzb3JzX3VzZWRbRkNfQ0FDSEVdID4gMCk7CisgIGJvb2wg Z29fdHdvX3AgPSAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgJiYg KCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAg ICAgICAgICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBm Y192aXNpYmxlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZG RVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKSk7CisgIGJvb2wgdXBkYXRpbmdfZnJhbWVfcCA9 IGZhbHNlOworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgaWYgKFhG UkFNRSAody0+ZnJhbWUpICE9IGYtPm1jX3VwZGF0aW5nX2ZyYW1lCisgICAgICAmJiAoZ29fb25l X3AgfHwgZ29fdHdvX3ApKQorICAgIHsKKyAgICAgIHVwZGF0aW5nX2ZyYW1lX3AgPSB0cnVlOwor ICAgICAgdXBkYXRlX2JlZ2luIChmKTsKKyAgICB9CisgIGlmICh3LT5waHlzX2N1cnNvcl9vbl9w CisgICAgICAmJiBnb190d29fcCkKKyAgICBlcmFzZV9waHlzX2N1cnNvciAodyk7CisgIGZvciAo aW50IHZudGggPSAwOworICAgICAgIGdvX29uZV9wCisgICAgICAgJiYgdm50aCA8IHctPm1jX21h dHJpeC52cG9zX3VzZWQ7CisgICAgICAgKyt2bnRoKQorICAgIHsKKyAgICAgIGZvciAoZW51bSBt Y19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICAgICAgY2FjaGVfdHlw ZSA8IE5PX0NBQ0hFOworICAgICAgICAgICArK2NhY2hlX3R5cGUpCisgICAgICAgIGZvciAoaW50 IG50aF8wID0gMDsKKyAgICAgICAgICAgICBtY190cmF2ZXJzZV9jYWNoZV9wIChvbGRfbWF0cml4 LCBjYWNoZV90eXBlLCB2bnRoLCBudGhfMCk7CisgICAgICAgICAgICAgKytudGhfMCkKKyAgICAg ICAgICB7CisgICAgICAgICAgICBib29sIHNhbWVfcCA9IGZhbHNlOworICAgICAgICAgICAgZm9y IChpbnQgd19udGggPSAwOyB3X250aCA8IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3Vz ZWRbY2FjaGVfdHlwZV07ICsrd19udGgpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg ICBzYW1lX3AgfD0gKG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhf MF0uZ2x5cGgudHlwZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgudHlwZQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgKChvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzBdLmdseXBoLmJ5dGVwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhd LmdseXBoLmJ5dGVwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKG9sZF9t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0ucm93X3Bvc2l0aW9uID09 IEFUX1pWCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5yb3dfcG9zaXRpb24gPT0gQVRf WlYpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKG9sZF9tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0ucm93X3Bvc2l0aW9uID09IFBPU1RfWlYKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLnJvd19wb3NpdGlvbiA9PSBQT1NUX1pWKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmICgob2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5jaGFycG9zCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3df bnRoXS5nbHlwaC5jaGFycG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLnJvd19wb3NpdGlv biA9PSBBVF9aVgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0ucm93X3Bvc2l0aW9uID09 IEFUX1pWKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLnJvd19wb3NpdGlvbiA9PSBQT1NUX1pW CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5yb3dfcG9zaXRpb24gPT0gUE9TVF9aVikp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnUudmFsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRo XS5nbHlwaC51LnZhbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5mYWNlX2lkCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5mYWNlX2lkCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBo LnBhZGRpbmdfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgucGFkZGluZ19wCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzBdLmdseXBoLmxlZnRfYm94X2xpbmVfcAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3 X250aF0uZ2x5cGgubGVmdF9ib3hfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnJp Z2h0X2JveF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnJpZ2h0X2JveF9s aW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGgudm9mZnNldAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVt3X250aF0uZ2x5cGgudm9mZnNldAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5waXhlbF93 aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgucGl4ZWxfd2lkdGgKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMF0uZ2x5cGguc2xpY2UuaW1nLngKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmds eXBoLnNsaWNlLmltZy54CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnNsaWNlLmltZy55Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5pbWcueQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8wXS5nbHlwaC5zbGljZS5pbWcud2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBo LnNsaWNlLmltZy53aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5zbGljZS5pbWcuaGVp Z2h0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5pbWcuaGVpZ2h0CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzBdLmdseXBoLnNsaWNlLmNtcC5mcm9tCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3df bnRoXS5nbHlwaC5zbGljZS5jbXAuZnJvbQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS54CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3dfbnRoXS54CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZ4CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3dfbnRoXS5meAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS55CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3df bnRoXS55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZ5CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5m eQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8wXS5ocG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5ocG9z CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzBdLnZwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLnZwb3MK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMF0ud2QKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLndkCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzBdLmgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmgKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMF0uY3Vyc29yX3R5cGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmN1cnNvcl90eXBl CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzBdLmN1cnNvcl93aWR0aAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250 aF0uY3Vyc29yX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZnLnJlZAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVt3X250aF0uZmcucmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZnLmdyZWVuCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3dfbnRoXS5mZy5ncmVlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5mZy5ibHVlCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5mZy5ibHVlCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmJnLnJl ZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uYmcucmVkCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmJn LmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5iZy5ncmVlbgorICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8wXS5iZy5ibHVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5iZy5ibHVlCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXzBdLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5hY3RpdmVfcAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8wXS5nbHlwaF9mbGF2b3IKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmds eXBoX2ZsYXZvcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5lbmFibGVkX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bd19udGhdLmVuYWJsZWRfcCk7CisgICAgICAgICAgICAgICAgaWYgKHNhbWVfcCkKKyAgICAg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAg ICAgICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiSElUICglcyk6ICB2cG9zICglZCkgfCBo cG9zICglZCkgfCBjaGFyICglcylcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAoY2FjaGVfdHlwZSA9PSBNQ19DQUNIRSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyAiTUMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IChjYWNoZV90eXBlID09IENIX0NBQ0hFKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/ICJDSCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogKGNhY2hlX3R5cGUgPT0gRkNfQ0FDSEUpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gIkZDIgorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiAiTk8iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLnZwb3Ms CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uaHBvcywKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nICh3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgudS5jaCkpOworICAgICAgICAg ICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250 aF0uc2FtZV9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmIChkZWJ1Z19wKQorICAgICAgICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgaW50IG9sZF9jYWNoZV91c2VkID0g b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV07CisgICAgICAgICAg ICAgICAgICAgICAgaW50IG5ld19jYWNoZV91c2VkID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVfdXNlZFtjYWNoZV90eXBlXTsKKyAgICAgICAgICAgICAgICAgICAgICBmcHJpbnRmIChz dGRlcnIsICJNSVNTICglcyk6ICB2cG9zICglZCkgfCBocG9zICglZCB2LiAlZCkgfCBjaGFyICgl cyB2LiAlcykgfCBjYWNoZV91c2VkICglZCB2LiAlZClcbiIsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAoY2FjaGVfdHlwZSA9PSBNQ19DQUNIRSkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAiTUMiCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IChjYWNoZV90eXBlID09IENIX0NBQ0hFKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICJDSCIKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogKGNhY2hlX3R5cGUgPT0gRkNfQ0FDSEUpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gIkZDIgorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiAiTk8iLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b d19udGhdLnZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmhwb3MsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVt3X250aF0uaHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nIChvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnUuY2gpLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgbWNfY2hhcl90b19zdHJpbmcgKHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC51LmNoKSwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIG9sZF9jYWNoZV91c2VkLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2NhY2hlX3VzZWQpOworICAgICAgICAgICAgICAg ICAgICB9CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICghc2FtZV9wKQorICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogYG1hdHJpeF9yb3cnIGluIGBkaXNwbmV3LmNg IGNvbnRhaW5zIHRoZSBmb2xsb3dpbmcgdGVzdHMsCisgICAgICAgICAgICAgICAgZWFzc2VydCAo bWF0cml4ICYmIG1hdHJpeC0+cm93cyk7CisgICAgICAgICAgICAgICAgZWFzc2VydCAocm93ID49 IDAgJiYgcm93IDwgbWF0cml4LT5ucm93cyk7ICovCisgICAgICAgICAgICAgICAgYm9vbCBiYXJm X2NyYXNoX29uZSA9ICh3LT5jdXJyZW50X21hdHJpeCAmJiB3LT5jdXJyZW50X21hdHJpeC0+cm93 cykgPyBmYWxzZSA6IHRydWU7CisgICAgICAgICAgICAgICAgaWYgKGJhcmZfY3Jhc2hfb25lKQor ICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgYm9vbCBiYXJmX2Ny YXNoX3R3byA9ICh2bnRoID49IDAgJiYgdm50aCA8IHctPmN1cnJlbnRfbWF0cml4LT5ucm93cykg PyBmYWxzZSA6IHRydWU7CisgICAgICAgICAgICAgICAgaWYgKGJhcmZfY3Jhc2hfdHdvKQorICAg ICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3Jv dyAqdm50aF9yb3cgPSBNQVRSSVhfUk9XICh3LT5jdXJyZW50X21hdHJpeCwgdm50aCk7CisgICAg ICAgICAgICAgICAgaW50IHhfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMF0ueDsKKyAgICAgICAgICAgICAgICBpbnQgZnhfMCA9IG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZng7CisgICAgICAgICAgICAgICAgaW50 IHlfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0ueTsK KyAgICAgICAgICAgICAgICBpbnQgZnlfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMF0uZnk7CisgICAgICAgICAgICAgICAgaW50IGhwb3NfMCA9IG9sZF9t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uaHBvczsKKyAgICAgICAg ICAgICAgICBpbnQgdnBvc18wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS52cG9zOworICAgICAgICAgICAgICAgIGludCB3ZF8wID0gb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS53ZDsKKyAgICAgICAgICAgICAgICBp bnQgaF8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5o OworICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGVfMCA9IG9s ZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uY3Vyc29yX3R5cGU7 CisgICAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aF8wID0gb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5jdXJzb3Jfd2lkdGg7CisgICAgICAgICAgICAg ICAgLy8gIHN0cnVjdCBtY19SR0IgbHNsX2ZnXzAgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZmcucmVkLAorICAgICAgICAgICAgICAgIC8v ICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZmcuZ3JlZW4sCisgICAgICAgICAgICAgICAgLy8g ICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZnLmJsdWV9OworICAgICAgICAgICAgICAgIHN0cnVj dCBtY19SR0IgbHNsX2JnXzAgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMF0uYmcucmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgLmdyZWVuID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS5iZy5ncmVlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIC5ibHVlID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8wXS5iZy5ibHVlfTsKKyAgICAgICAgICAgICAgICBib29sIGFjdGl2ZV9wXzAgPSBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmFjdGl2ZV9wOworICAgICAg ICAgICAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvcl8wID0gb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaF9mbGF2b3I7CisgICAgICAgICAg ICAgICAgYm9vbCBlbmFibGVkX3BfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMF0uZW5hYmxlZF9wOworICAgICAgICAgICAgICAgIGlmICh2cG9zXzAgPT0g dm50aAorICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3JfMCA9PSBNQ19HTFlQSAor ICAgICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3BfMAorICAgICAgICAgICAgICAgICAgICAm JiB2bnRoX3Jvdy0+ZW5hYmxlZF9wKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgICBtY19lcmFzZV9jdXJzb3IgKHcsIHctPmN1cnJlbnRfbWF0cml4LCB2bnRoX3Jvdywg eF8wLCB5XzAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaHBvc18wLCB2 cG9zXzAsIGdseXBoX2ZsYXZvcl8wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGN1cnNvcl90eXBlXzAsIHdkXzApOworICAgICAgICAgICAgICAgICAgICBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmVuYWJsZWRfcCA9IGZhbHNlOwor ICAgICAgICAgICAgICAgICAgICAtLW9sZF9tYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5cGVd OworICAgICAgICAgICAgICAgICAgICAvKiBJZiB3ZSBpbmFkdmVydGVudGx5IGVyYXNlZCBhbm90 aGVyIGZha2UgY3Vyc29yIGF0IHRoZSBzYW1lCisgICAgICAgICAgICAgICAgICAgIEhQT1MgdGhh dCBpcyBzdGlsbCBlbmFibGVkX3AgaW4gdGhlIGBvbGRfbWF0cml4YCwgdGhlbiByZWRyYXcgaXQu ICovCisgICAgICAgICAgICAgICAgICAgIGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5 cGUgPSBNQ19DQUNIRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICBjYWNoZV90eXBlIDwgTk9f Q0FDSEU7CisgICAgICAgICAgICAgICAgICAgICAgICAgKytjYWNoZV90eXBlKQorICAgICAgICAg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IG50aF8xID0g MDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWNfdHJhdmVyc2VfY2FjaGVfcCAob2xk X21hdHJpeCwgY2FjaGVfdHlwZSwgdm50aCwgbnRoXzEpOworICAgICAgICAgICAgICAgICAgICAg ICAgICAgICArK250aF8xKQorICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgaW50IHhfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMV0ueDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZnhf MSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZng7Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHlfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0ueTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICBpbnQgZnlfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhf MV0uZnk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGhwb3NfMSA9IG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uaHBvczsKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICBpbnQgdnBvc18xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF8xXS52cG9zOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlu dCB3ZF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS53 ZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaF8xID0gb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5oOworICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGVfMSA9IG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uY3Vyc29yX3R5cGU7CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aF8xID0gb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5jdXJzb3Jfd2lkdGg7CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmdfMSA9IHsucmVkID0gb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5mZy5yZWQsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmZnLmdyZWVuLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUg PSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmZnLmJsdWV9 OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBzdHJ1Y3QgbWNfUkdCIGxzbF9iZ18x ID0gey5yZWQgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFd LmJnLnJlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAuZ3JlZW4gPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXzFdLmJnLmdyZWVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF8xXS5iZy5ibHVlfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICBib29sIGFjdGl2ZV9wXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXzFdLmFjdGl2ZV9wOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNf Zmxhdm9yIGdseXBoX2ZsYXZvcl8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8xXS5nbHlwaF9mbGF2b3I7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg Ym9vbCBlbmFibGVkX3BfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMV0uZW5hYmxlZF9wOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgZ29f cF8xID0gKGhwb3NfMCA9PSBocG9zXzEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBlbmFibGVkX3BfMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg aWYgKCFnb19wXzEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIHJlbW92ZV9wXzEgPSBmYWxzZTsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgdy0+Y3VycmVu dF9tYXRyaXgsIHZudGhfcm93LCB4XzEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGZ4XzEsIHlfMSwgZnlfMSwgaHBvc18xLCB2cG9zXzEsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdkXzEsIGhfMSwg Y3Vyc29yX3R5cGVfMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgY3Vyc29yX3dpZHRoXzEsIGxzbF9mZ18xLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVfcF8xLCBnbHlwaF9mbGF2b3JfMSwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3Zl X3BfMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAg ICB9CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmICh2cG9z XzAgPT0gdm50aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wXzAKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHZudGhfcm93LT5lbmFibGVkX3ApCisgICAgICAg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBib29sIHJlbW92ZV9wXzAgPSB0 cnVlOworICAgICAgICAgICAgICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCB3LT5j dXJyZW50X21hdHJpeCwgdm50aF9yb3csIHhfMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgZnhfMCwgeV8wLCBmeV8wLCBocG9zXzAsIHZwb3NfMCwgd2RfMCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaF8wLCBjdXJzb3Jf dHlwZV8wLCBjdXJzb3Jfd2lkdGhfMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgbHNsX2JnXzAsIGFjdGl2ZV9wXzAsIGdseXBoX2ZsYXZvcl8wLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVfcF8wKTsKKyAgICAg ICAgICAgICAgICAgICAgICBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXzBdLmVuYWJsZWRfcCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgIC0tb2xkX21h dHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVfdHlwZV07CisgICAgICAgICAgICAgICAgICAgICAgLyog SWYgd2UgaW5hZHZlcnRlbnRseSBlcmFzZWQgYW5vdGhlciBmYWtlIGN1cnNvciBhdCB0aGUgc2Ft ZQorICAgICAgICAgICAgICAgICAgICAgIEhQT1MgdGhhdCBpcyBzdGlsbCBlbmFibGVkX3AgaW4g dGhlIGBvbGRfbWF0cml4YCwgdGhlbiByZWRyYXcgaXQuICovCisgICAgICAgICAgICAgICAgICAg ICAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOworICAgICAg ICAgICAgICAgICAgICAgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICAgICAg ICAgICAgICAgICAgICAgKytjYWNoZV90eXBlKQorICAgICAgICAgICAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBudGhfMiA9IDA7CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgbWNfdHJhdmVyc2VfY2FjaGVfcCAob2xkX21hdHJpeCwgY2Fj aGVfdHlwZSwgdm50aCwgbnRoXzIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsr bnRoXzIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgaW50IHhfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMl0ueDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmeF8yID0g b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5meDsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGludCB5XzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLnk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBpbnQgZnlfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhf Ml0uZnk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaHBvc18yID0gb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5ocG9zOworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgaW50IHZwb3NfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMl0udnBvczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGludCB3ZF8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8yXS53ZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBoXzIgPSBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmg7CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlXzIgPSBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmN1cnNvcl90eXBlOwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aF8yID0gb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5jdXJzb3Jfd2lkdGg7Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZ18yID0gey5y ZWQgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmZnLnJl ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgLmdyZWVuID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8y XS5mZy5ncmVlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgLmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXzJdLmZnLmJsdWV9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIHN0 cnVjdCBtY19SR0IgbHNsX2JnXzIgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMl0uYmcucmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5iZy5ncmVlbiwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0gb2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5iZy5ibHVlfTsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgYWN0aXZlX3BfMiA9IG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uYWN0aXZlX3A7CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3JfMiA9IG9sZF9t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uZ2x5cGhfZmxhdm9yOwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBlbmFibGVkX3BfMiA9IG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uZW5hYmxlZF9wOworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBnb19wXzIgPSAoaHBvc18wID09IGhwb3NfMgor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZnhfMCA8PSBm eF8yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBmeF8w ICsgd2RfMCA+IGZ4XzIgKyB3ZF8yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBlbmFibGVkX3BfMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBpZiAoIWdvX3BfMikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIHJlbW92ZV9wXzIgPSBmYWxzZTsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCB3 LT5jdXJyZW50X21hdHJpeCwgdm50aF9yb3csIHhfMiwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmeF8yLCB5XzIsIGZ5XzIsIGhwb3NfMiwgdnBv c18yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHdkXzIsIGhfMiwgY3Vyc29yX3R5cGVfMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGhfMiwgbHNsX2ZnXzIsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0aXZlX3BfMiwg Z2x5cGhfZmxhdm9yXzIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgcmVtb3ZlX3BfMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQor ICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICB9CisgIGlmICh1cGRhdGluZ19mcmFtZV9wKQor ICAgIHVwZGF0ZV9lbmQgKGYpOworfQorCit2b2lkCittY191cGRhdGVfd2luZG93X2RyeXJ1biAo c3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wLCBzdHJ1Y3QgbWNf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V4dF9ib3R0b21feSAodyk7CisgICAg ICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cgPSBNQVRSSVhfUk9XIChkZXNpcmVkX21hdHJpeCwgMCk7 CisgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICplbmQgPSBNQVRSSVhfTU9ERV9MSU5FX1JPVyAoZGVz aXJlZF9tYXRyaXgpOworCisgICAgICAvKiBUYWtlIG5vdGUgb2YgdGhlIGhlYWRlciBsaW5lLCBp ZiB0aGVyZSBpcyBvbmUuICBXZSB3aWxsCisgICAgICAgICB1cGRhdGUgaXQgYmVsb3csIGFmdGVy IHVwZGF0aW5nIGFsbCBvZiB0aGUgd2luZG93J3MgbGluZXMuICovCisgICAgICBpZiAocm93LT5t b2RlX2xpbmVfcCkKKyAgICAgICAgeworICAgICAgICAgIGhlYWRlcl9saW5lX3JvdyA9IHJvdzsK KyAgICAgICAgICArK3JvdzsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgaGVh ZGVyX2xpbmVfcm93ID0gTlVMTDsKKworICAgICAgLyogVXBkYXRlIHRoZSBtb2RlIGxpbmUsIGlm IG5lY2Vzc2FyeS4gKi8KKyAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKm1vZGVfbGluZV9yb3cgPSBN QVRSSVhfTU9ERV9MSU5FX1JPVyAoZGVzaXJlZF9tYXRyaXgpOworICAgICAgaWYgKG1vZGVfbGlu ZV9yb3ctPm1vZGVfbGluZV9wICYmIG1vZGVfbGluZV9yb3ctPmVuYWJsZWRfcCkKKyAgICAgICAg eworICAgICAgICAgIG1vZGVfbGluZV9yb3ctPnkgPSB5YiArIFdJTkRPV19TQ1JPTExfQkFSX0FS RUFfSEVJR0hUICh3KTsKKyAgICAgICAgICB1cGRhdGVfd2luZG93X2xpbmUgKHcsIE1BVFJJWF9S T1dfVlBPUyAobW9kZV9saW5lX3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgZGVzaXJlZF9tYXRyaXgpLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCk7CisgICAgICAgIH0KKworICAgICAg LyogRmluZCBmaXJzdCBlbmFibGVkIHJvdy4gIE9wdGltaXphdGlvbnMgaW4gcmVkaXNwbGF5X2lu dGVybmFsCisgICAgICAgICBtYXkgbGVhZCB0byBhbiB1cGRhdGUgd2l0aCBvbmx5IG9uZSByb3cg ZW5hYmxlZC4gIFRoZXJlIG1heQorICAgICAgICAgYmUgYWxzbyBjb21wbGV0ZWx5IGVtcHR5IG1h dHJpY2VzLiAqLworICAgICAgd2hpbGUgKHJvdyA8IGVuZCAmJiAhcm93LT5lbmFibGVkX3ApCisg ICAgICAgICsrcm93OworCisgICAgICAvKiBUcnkgcmV1c2luZyBwYXJ0IG9mIHRoZSBkaXNwbGF5 IGJ5IGNvcHlpbmcuICovCisgICAgICBpZiAocm93IDwgZW5kICYmICF3LT5kZXNpcmVkX21hdHJp eC0+bm9fc2Nyb2xsaW5nX3ApCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgcmMgPSBtY19zY3Jv bGxpbmdfd2luZG93ICh3LCBoZWFkZXJfbGluZV9yb3cgIT0gTlVMTCk7CisgICAgICAgICAgaWYg KHJjIDwgMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogQWxsIHJvd3Mgd2VyZSBm b3VuZCB0byBiZSBlcXVhbC4gKi8KKyAgICAgICAgICAgICAgcGF1c2VkX3AgPSAwOworICAgICAg ICAgICAgICBnb3RvIHNldF9jdXJzb3I7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNl IGlmIChyYyA+IDApCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBXZSd2ZSBz Y3JvbGxlZCB0aGUgZGlzcGxheS4gKi8KKyAgICAgICAgICAgICAgICBmb3JjZV9wID0gMTsKKyAg ICAgICAgICAgICAgICBjaGFu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gICBp ZiAobWNfcm93LT5lbmFibGVkX3AKKyAgICAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3Iu dnBvcykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCA9IHctPmRl c2lyZWRfbWF0cml4OworICAgICAgICAgICAgICBpZiAoIWZvcmNlX3AgJiYgKytuX3VwZGF0ZWQg JSBwcmVlbXB0X2NvdW50ID09IDApCisgICAgICAgICAgICAgICAgZGV0ZWN0X2lucHV0X3BlbmRp bmdfaWdub3JlX3NxdWVlemFibGVzICgpOworICAgICAgICAgICAgICBjaGFuZ2VkX3AgfD0gbWNf dXBkYXRlX3dpbmRvd19saW5lICh3LCB2cG9zLCAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jf bWF0cml4LCBlc3NlbnRpYWxzLCBkcmF3X3ApOworICAgICAgICAgICAgICBpZiAoTUFUUklYX1JP V19CT1RUT01fWSAocm93KSA+PSB5YikKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gdnBv cyArIDE7IGkgPCB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAgICAgICAg ICAgICAgICBTRVRfTUFUUklYX1JPV19FTkFCTEVEX1AgKHctPmN1cnJlbnRfbWF0cml4LCBpLCBm YWxzZSk7CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9Cisg ICAgICBjdXJzb3JfbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgICAgICAvKiBVcGRhdGUg dGhlIHJlc3Qgb2YgdGhlIGxpbmVzLiAqLworICAgICAgZm9yICg7IHJvdyA8IGVuZCAmJiAoZm9y Y2VfcCB8fCAhaW5wdXRfcGVuZGluZyk7ICsrcm93KQorICAgICAgICAvKiBzY3JvbGxpbmdfd2lu ZG93IHJlc2V0cyB0aGUgZW5hYmxlZF9wIGZsYWcgb2YgdGhlIHJvd3MgaXQgcmV1c2VzIGZyb20K KyAgICAgICAgY3VycmVudF9tYXRyaXguICovCisgICAgICAgIGlmIChyb3ctPmVuYWJsZWRfcCkK KyAgICAgICAgICB7CisgICAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93 LCB3LT5kZXNpcmVkX21hdHJpeCk7CisgICAgICAgICAgICAvKiBJZiB0aGUgYGN1cnNvcl9yb3dg IGlzIHdpdGhpbiB0aGUgYGRlc2lyZWRfbWF0cml4YCwgdGhlbiBpdCB3YXMKKyAgICAgICAgICAg IHByb2Nlc3NlZCBoZXJlaW5hYm92ZSBhbmQgc2hvdWxkIGJlIHNraXBwZWQgYXQgdGhpcyB0aW1l LiAqLworICAgICAgICAgICAgaWYgKHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAg ICBjb250aW51ZTsKKyAgICAgICAgICAgIGludCBpOworICAgICAgICAgICAgLyogV2UnbGwgaGF2 ZSB0byBwbGF5IGEgbGl0dGxlIGJpdCB3aXRoIHdoZW4gdG8KKyAgICAgICAgICAgICAgIGRldGVj dF9pbnB1dF9wZW5kaW5nLiAgSWYgaXQncyBkb25lIHRvbyBvZnRlbiwKKyAgICAgICAgICAgICAg IHNjcm9sbGluZyBsYXJnZSB3aW5kb3dzIHdpdGggcmVwZWF0ZWQgc2Nyb2xsLXVwCisgICAgICAg ICAgICAgICBjb21tYW5kcyB3aWxsIHRvbyBxdWlja2x5IHBhdXNlIHJlZGlzcGxheS4gKi8KKyAg ICAgICAgICAgIGlmICghZm9yY2VfcCAmJiArK25fdXBkYXRlZCAlIHByZWVtcHRfY291bnQgPT0g MCkKKyAgICAgICAgICAgICAgZGV0ZWN0X2lucHV0X3BlbmRpbmdfaWdub3JlX3NxdWVlemFibGVz ICgpOworICAgICAgICAgICAgY2hhbmdlZF9wIHw9IG1jX3VwZGF0ZV93aW5kb3dfbGluZSAodywg dnBvcywgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIGRyYXdf cCk7CisgICAgICAgICAgICAvKiBNYXJrIGFsbCByb3dzIGJlbG93IHRoZSBsYXN0IHZpc2libGUg b25lIGluIHRoZSBjdXJyZW50CisgICAgICAgICAgICAgICBtYXRyaXggYXMgaW52YWxpZC4gIFRo aXMgaXMgbmVjZXNzYXJ5IGJlY2F1c2Ugb2YKKyAgICAgICAgICAgICAgIHZhcmlhYmxlIGxpbmUg aGVpZ2h0cy4gIENvbnNpZGVyIHRoZSBjYXNlIG9mIHRocmVlCisgICAgICAgICAgICAgICBzdWNj ZXNzaXZlIHJlZGlzcGxheXMsIHdoZXJlIHRoZSBmaXJzdCBkaXNwbGF5cyA1CisgICAgICAgICAg ICAgICBsaW5lcywgdGhlIHNlY29uZCAzIGxpbmVzLCBhbmQgdGhlIHRoaXJkIDUgbGluZXMgYWdh aW4uCisgICAgICAgICAgICAgICBJZiB0aGUgc2Vjb25kIHJlZGlzcGxheSB3b3VsZG4ndCBtYXJr IHJvd3MgaW4gdGhlCisgICAgICAgICAgICAgICBjdXJyZW50IG1hdHJpeCBpbnZhbGlkLCB0aGUg dGhpcmQgcmVkaXNwbGF5IG1pZ2h0IGJlCisgICAgICAgICAgICAgICB0ZW1wdGVkIHRvIG9wdGlt aXplIHJlZGlzcGxheSBiYXNlZCBvbiBsaW5lcyBkaXNwbGF5ZWQKKyAgICAgICAgICAgICAgIGlu IHRoZSBmaXJzdCByZWRpc3BsYXkuICovCisgICAgICAgICAgICBpZiAoTUFUUklYX1JPV19CT1RU T01fWSAocm93KSA+PSB5YikKKyAgICAgICAgICAgICAgZm9yIChpID0gdnBvcyArIDE7IGkgPCB3 LT5jdXJyZW50X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAgICAgICAgICAgICAgU0VUX01B VFJJWF9ST1dfRU5BQkxFRF9QICh3LT5jdXJyZW50X21hdHJpeCwgaSwgZmFsc2UpOworICAgICAg ICAgIH0KKyAgICAgIC8qIFdhcyBkaXNwbGF5IHByZWVtcHRlZD8gKi8KKyAgICAgIHBhdXNlZF9w ID0gcm93IDwgZW5kOworICAgICAgc2V0X2N1cnNvcjoKKyAgICAgIC8qIElmIHdlIGp1bXBlZCBo ZXJlIGZyb20gYHNldF9jdXJzb3JgLCB0aGVuIHNldCB0aGUgYGN1cnNvcl9tYXRyaXhgLiAqLwor ICAgICAgaWYgKGN1cnNvcl9tYXRyaXggPT0gTlVMTCkKKyAgICAgICAgY3Vyc29yX21hdHJpeCA9 IHctPmN1cnJlbnRfbWF0cml4OworICAgICAgLyogUmVzZXQgYHJvd2AgdG8gMCBzbyB0aGF0IGZh a2UgY3Vyc29ycyBjYW4gYmUgZHJhd24gb24gcm93cyBwcmVjZWRpbmcgdGhlCisgICAgICBmaXJz dCBgcm93LT5lbmFibGVkX3BgLiAgSnVzdCBwcmlvciB0byB0aGUgY2FsbCB0byBgc2Nyb2xsaW5n X3dpbmRvdycgYWJvdmUsCisgICAgICBgcm93YCB3YXMgYWR2YW5jZWQgdG8gdGhlIGZpcnN0IGBy b3ctPmVuYWJsZWRfcGAuICovCisgICAgICBmb3IgKHN0cnVjdCBnbHlwaF9yb3cgKmRlc2lyZWRf cm93ID0gTUFUUklYX1JPVyAody0+ZGVzaXJlZF9tYXRyaXgsIDApOworICAgICAgICAgICBkZXNp cmVkX3JvdyA8IGVuZAorICAgICAgICAgICAmJiAoZm9yY2VfcCB8fCAhaW5wdXRfcGVuZGluZykK KyAgICAgICAgICAgLyogVzMyIEVtYWNzIGNyYXNoZXMgb24gc3RhcnR1cCB3aXRob3V0IGEgQlVG RkVSUCBjaGVjay4gKi8KKyAgICAgICAgICAgJiYgQlVGRkVSUCAody0+Y29udGVudHMpCisgICAg ICAgICAgICYmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkK KyAgICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNy b3NzaGFpcnMpKQorICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgZmNfdmlzaWJsZSkpKTsKKyAgICAgICAgICAgKytkZXNpcmVkX3JvdykKKyAgICAg ICAgeworICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChkZXNpcmVkX3Jvdywg dy0+ZGVzaXJlZF9tYXRyaXgpOworICAgICAgICAgIGlmIChkZXNpcmVkX3Jvdy0+ZW5hYmxlZF9w KQorICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqY3Vy cmVudF9yb3cgPSBNQVRSSVhfUk9XICh3LT5jdXJyZW50X21hdHJpeCwgdnBvcyk7CisgICAgICAg ICAgZW51bSBtY19yb3dfcG9zaXRpb24gcm93X3Bvc2l0aW9uID0gbWNfcm93X3Bvc2l0aW9uICh3 LCBjdXJyZW50X3JvdywgY3VycmVudF9yb3csIHZwb3MpOworICAgICAgICAgIGlmIChjdXJyZW50 X3Jvdy0+ZW5hYmxlZF9wKQorICAgICAgICAgICAgbWNfZHJhd19yb3cgKHcsIHctPmN1cnJlbnRf bWF0cml4LCBjdXJyZW50X3JvdywgY3VycmVudF9yb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAg ICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRfcm93LT54LCBjdXJyZW50X3Jvdy0+dXNlZFtU RVhUX0FSRUFdLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgs IGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgZHJhd19wLAorICAgICAgICAgICAgICAgICAgICAg ICAgIFNFVF9DVVJTT1JfT05FKTsKKyAgICAgICAgfQorCisgICAgICBtY19yZXN0b3JlX2dseXBo X21hdHJpeCAoc2F2ZWRfZGVzaXJlZCwgdy0+ZGVzaXJlZF9tYXRyaXgpOworICAgICAgbWNfcmVz dG9yZV9nbHlwaF9tYXRyaXggKHNhdmVkX2N1cnJlbnQsIHctPmN1cnJlbnRfbWF0cml4KTsKKwor ICAgICAgbWNfdXBkYXRlX3dpbmRvd19lcmFzZSAodywgb2xkX21hdHJpeCk7CisKKyAgICAgIG1j X3hmcmVlX2NhY2hlX21hdHJpeCAodywgJm9sZF9tYXRyaXgpOworCisgICAgfQorICAvLyBjbG9j a190IGNsb2NrX2VuZCA9IGNsb2NrKCk7CisgIC8vIGRvdWJsZSBjcHVfdGltZV91c2VkID0gKChk b3VibGUpIChjbG9ja19lbmQgLSBjbG9ja19zdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7CisgIC8v IGZwcmludGYgKHN0ZGVyciwgIm1jX3Njcm9sbGluZ193aW5kb3cgKCVzKTogIFRJTUUgKCVmKVxu IiwgbWNfd2luZG93ICh3KSwgY3B1X3RpbWVfdXNlZCk7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1D VVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBTdHJ1Y3R1cmUgdG8g cGFzcyBkaW1lbnNpb25zIGFyb3VuZC4gIFVzZWQgZm9yIGNoYXJhY3RlciBib3VuZGluZwogICAg Ym94ZXMsIGdseXBoIG1hdHJpeCBkaW1lbnNpb25zIGFuZCBhbGlrZS4gICovCiAKQEAgLTIyNDEs NiArNDAxNywxNiBAQCBmcmVlX3dpbmRvd19tYXRyaWNlcyAoc3RydWN0IHdpbmRvdyAqdykKIAkg IGZyZWVfZ2x5cGhfbWF0cml4ICh3LT5jdXJyZW50X21hdHJpeCk7CiAJICBmcmVlX2dseXBoX21h dHJpeCAody0+ZGVzaXJlZF9tYXRyaXgpOwogCSAgdy0+Y3VycmVudF9tYXRyaXggPSB3LT5kZXNp cmVkX21hdHJpeCA9IE5VTEw7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKyAgbWNfeGZyZWVfY2FjaGVfbWF0cml4ICh3LCAmdy0+bWNfbWF0 cml4KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCX0KIAogICAgICAgLyogTmV4 dCB3aW5kb3cgb24gc2FtZSBsZXZlbC4gICovCkBAIC0zMzg3LDYgKzUxNzMsMjYgQEAgY2hlY2tf Y3VycmVudF9tYXRyaXhfZmxhZ3MgKHN0cnVjdCB3aW5kb3cgKncpCiBzdGF0aWMgYm9vbAogdXBk YXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wKQogeworCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlmIChtY19z dGRlcnJfcCkKKyAgICBmcHJpbnRmIChzdGRlcnIsICJ1cGRhdGVfd2luZG93ICglcylcbiIsIG1j X3dpbmRvdyAodykpOworCisgIHN0cnVjdCBtY19lc3NlbnRpYWxzIGVzc2VudGlhbHM7CisgIG1j X3NldF9lc3NlbnRpYWxzICh3LCAmZXNzZW50aWFscyk7CisKKyAgbWNfdXBkYXRlX3dpbmRvd19k cnlydW4gKHcsIGZvcmNlX3AsIGVzc2VudGlhbHMpOworCisgIHN0cnVjdCBnbHlwaF9tYXRyaXgg KmN1cnNvcl9tYXRyaXggPSBOVUxMOworCisgIGJvb2wgZHJhd19wID0gdHJ1ZTsKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICpkZXNpcmVkX21h dHJpeCA9IHctPmRlc2lyZWRfbWF0cml4OwogICBib29sIHBhdXNlZF9wOwogICBpbnQgcHJlZW1w dF9jb3VudCA9IGNsaXBfdG9fYm91bmRzICgxLCBiYXVkX3JhdGUgLyAyNDAwICsgMSwgSU5UX01B WCk7CkBAIC0zNDY0LDYgKzUyNzAsNDggQEAgdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAq dywgYm9vbCBmb3JjZV9wKQogCSAgICB9CiAJfQogCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAg LyogUHJvY2VzcyB0aGUgY3Vyc29yIHJvdyBhdCB0aGUgb3V0c2V0IGlmIGl0IGlzIHdpdGhpbiBg ZGVzaXJlZF9tYXRyaXhgLgorICBXaGVuIHByb2Nlc3NpbmcgYWxsIG90aGVyIHJvd3MsIHdlIHdp bGwgcXVlcnkgdGhlIGB3LT5jdXJyZW50X21hdHJpeGAgZm9yIGRhdGEKKyAgcmVsYXRpbmcgdG8g dGhlIGN1cnNvciByb3cuICBgbWFrZV9jdXJyZW50YCAod2l0aGluIGB1cGRhdGVfd2luZG93X2xp bmUnKQorICB1cGRhdGVzIHRoZSBgdy0+Y3VycmVudF9tYXRyaXhgIGZvciB0aGUgYXBwbGljYWJs ZSByb3cuICBJbiBkb2luZyBzbywgaG93ZXZlciwKKyAgdGhlIGFwcGxpY2FibGUgcm93IGluIHRo ZSBkZXNpcmVkIG1hdHJpeCBpcyBhbHRlcmVkIHN1Y2ggdGhhdCB3ZSBjYW4gbm8gbG9uZ2VyCisg IHJlbHkgdXBvbiB0aGUgYWNjdXJhY3kgb2YgYFJPVy0+dXNlZFtURVhUX0FSRUFdYC4gIFRoZXJl Zm9yZSwgd2UgbXVzdCBub3cgcmVseQorICBleGNsdXNpdmVseSB1cG9uIGB3LT5jdXJyZW50X21h dHJpeCcgZm9yIGN1cnNvciByb3cgYmFzZWQgZGVjaXNpb25zLiAqLworICBmb3IgKHN0cnVjdCBn bHlwaF9yb3cgKm1jX3JvdyA9IHJvdzsKKyAgICAgICBtY19yb3cgPCBlbmQgJiYgKGZvcmNlX3Ag fHwgIWlucHV0X3BlbmRpbmcpOworICAgICAgICsrbWNfcm93KQorICAgIHsKKyAgICAgIGludCB2 cG9zID0gTUFUUklYX1JPV19WUE9TIChtY19yb3csIGRlc2lyZWRfbWF0cml4KTsKKyAgICAgIGlm IChtY19yb3ctPmVuYWJsZWRfcAorICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3Mp CisgICAgICAgIHsKKyAgICAgICAgICBjdXJzb3JfbWF0cml4ID0gZGVzaXJlZF9tYXRyaXg7Cisg ICAgICAgICAgaWYgKCFmb3JjZV9wICYmICsrbl91cGRhdGVkICUgcHJlZW1wdF9jb3VudCA9PSAw KQorICAgICAgICAgICAgZGV0ZWN0X2lucHV0X3BlbmRpbmdfaWdub3JlX3NxdWVlemFibGVzICgp OworICAgICAgICAgIGNoYW5nZWRfcCB8PSAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAg ICAgICAgICAgICAgICAgICAmJiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg bWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhC VUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgfHwgISBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUp KSkpCisgICAgICAgICAgICAgICAgICAgICAgID8gbWNfdXBkYXRlX3dpbmRvd19saW5lICh3LCB2 cG9zLCAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgZHJhd19w KQorICAgICAgICAgICAgICAgICAgICAgICA6IHVwZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywg Jm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCk7CisgICAgICAgICAgaWYgKE1BVFJJWF9ST1dfQk9U VE9NX1kgKHJvdykgPj0geWIpCisgICAgICAgICAgICBmb3IgKGludCBpID0gdnBvcyArIDE7IGkg PCB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAgICAgICAgICAgIFNFVF9N QVRSSVhfUk9XX0VOQUJMRURfUCAody0+Y3VycmVudF9tYXRyaXgsIGksIGZhbHNlKTsKKyAgICAg ICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKworICBjdXJzb3JfbWF0cml4ID0gdy0+Y3Vy cmVudF9tYXRyaXg7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIC8qIFVw ZGF0ZSB0aGUgcmVzdCBvZiB0aGUgbGluZXMuICAqLwogICAgICAgZm9yICg7IHJvdyA8IGVuZCAm JiAoZm9yY2VfcCB8fCAhaW5wdXRfcGVuZGluZyk7ICsrcm93KQogCS8qIHNjcm9sbGluZ193aW5k b3cgcmVzZXRzIHRoZSBlbmFibGVkX3AgZmxhZyBvZiB0aGUgcm93cyBpdApAQCAtMzQ3MSw2ICs1 MzE5LDE5IEBAIHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkK IAlpZiAocm93LT5lbmFibGVkX3ApCiAJICB7CiAJICAgIGludCB2cG9zID0gTUFUUklYX1JPV19W UE9TIChyb3csIGRlc2lyZWRfbWF0cml4KTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgICAgIC8qIElmIHRoZSBgY3Vyc29yX3Jv d2AgaXMgd2l0aGluIHRoZSBgZGVzaXJlZF9tYXRyaXhgLCB0aGVuIGl0IHdhcworICAgICAgICAg IHByb2Nlc3NlZCBoZXJlaW5hYm92ZSBhbmQgc2hvdWxkIGJlIHNraXBwZWQgYXQgdGhpcyB0aW1l LiAqLworICAgICAgICAgIGlmICh2cG9zID09IHctPmN1cnNvci52cG9zKQorICAgICAgICAgIGNv bnRpbnVlOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAgIGludCBpOwogCiAJ ICAgIC8qIFdlJ2xsIGhhdmUgdG8gcGxheSBhIGxpdHRsZSBiaXQgd2l0aCB3aGVuIHRvCkBAIC0z NDc5LDggKzUzNDAsMjEgQEAgdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBm b3JjZV9wKQogCSAgICAgICBjb21tYW5kcyB3aWxsIHRvbyBxdWlja2x5IHBhdXNlIHJlZGlzcGxh eS4gICovCiAJICAgIGlmICghZm9yY2VfcCAmJiArK25fdXBkYXRlZCAlIHByZWVtcHRfY291bnQg PT0gMCkKIAkgICAgICBkZXRlY3RfaW5wdXRfcGVuZGluZ19pZ25vcmVfc3F1ZWV6YWJsZXMgKCk7 Ci0JICAgIGNoYW5nZWRfcCB8PSB1cGRhdGVfd2luZG93X2xpbmUgKHcsIHZwb3MsCi0JCQkJCSAg ICAgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCk7CisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgICAgICBjaGFuZ2VkX3AgfD0gKEJV RkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKCFOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFp cnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICEgTklMUCAoQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpKQorICAgICAgICAgICAgICAgICAgICAgICA/ IG1jX3VwZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5f cCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNv cl9tYXRyaXgsIGVzc2VudGlhbHMsIGRyYXdfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgOiB1 cGRhdGVfd2luZG93X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3cml0dGVuX3ApOwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKwogCiAJICAgIC8qIE1hcmsgYWxsIHJvd3MgYmVs b3cgdGhlIGxhc3QgdmlzaWJsZS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3V0IGEgQlVGRkVS UCBjaGVjay4gKi8KKyAgICAgICAmJiBCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAmJiAo IU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAg IHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAg ICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxl KSkpOworICAgICAgICsrZGVzaXJlZF9yb3cpCisgICAgeworICAgICAgaW50IHZwb3MgPSBNQVRS SVhfUk9XX1ZQT1MgKGRlc2lyZWRfcm93LCBkZXNpcmVkX21hdHJpeCk7CisgICAgICBpZiAoZGVz aXJlZF9yb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgY29udGludWU7CisgICAgICBzdHJ1Y3QgZ2x5 cGhfcm93ICpjdXJyZW50X3JvdyA9IE1BVFJJWF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB2cG9z KTsKKyAgICAgIGVudW0gbWNfcm93X3Bvc2l0aW9uIHJvd19wb3NpdGlvbiA9IG1jX3Jvd19wb3Np dGlvbiAodywgY3VycmVudF9yb3csIGN1cnJlbnRfcm93LCB2cG9zKTsKKyAgICAgIGlmIChjdXJy ZW50X3Jvdy0+ZW5hYmxlZF9wKQorICAgICAgICBtY19kcmF3X3JvdyAodywgdy0+Y3VycmVudF9t YXRyaXgsIGN1cnJlbnRfcm93LCBjdXJyZW50X3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAg ICAgICAgICAgICAgICAgICBjdXJyZW50X3Jvdy0+eCwgY3VycmVudF9yb3ctPnVzZWRbVEVYVF9B UkVBXSwgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlh bHMsIHJvd19wb3NpdGlvbiwgZHJhd19wLCBTRVRfQ1VSU09SX1RXTyk7CisgICAgfQorCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICAvKiBVcGRhdGUgdGhlIGhlYWRlciBsaW5l IGFmdGVyIHNjcm9sbGluZyBiZWNhdXNlIGEgbmV3IGhlYWRlcgogCSBsaW5lIHdvdWxkIG90aGVy d2lzZSBvdmVyd3JpdGUgbGluZXMgYXQgdGhlIHRvcCBvZiB0aGUgd2luZG93CiAJIHRoYXQgY2Fu IGJlIHNjcm9sbGVkLiAgKi8KQEAgLTM1MTYsNyArNTQyNSw0OSBAQCB1cGRhdGVfd2luZG93IChz dHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3ApCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVN CiAJICBpZiAoY2hhbmdlZF9wICYmIHJpZi0+Zml4X292ZXJsYXBwaW5nX2FyZWEpCiAJICAgIHsK LQkgICAgICByZWRyYXdfb3ZlcmxhcHBlZF9yb3dzICh3LCB5Yik7CisKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRyYXdfb3Zlcmxh cHBlZF9yb3dzJzogIFJlZHJhdyBsaW5lcyBmcm9tIHRoZSBjdXJyZW50IG1hdHJpeCBvZiB3aW5k b3cgVwordGhhdCBhcmUgb3ZlcmxhcHBlZCBieSBvdGhlciByb3dzLiAgWUIgaXMgYm90dG9tLW1v c3QgeS1wb3NpdGlvbiBpbiBXLiAgSWYgcm93cworb3ZlcmxhcHBpbmcgb3RoZXJzIGhhdmUgYmVl biBjaGFuZ2VkLCB0aGUgcm93cyBiZWluZyBvdmVybGFwcGVkIGhhdmUgdG8gYmUKK3JlZHJhd24u ICBUaGlzIHdvbid0IGRyYXcgbGluZXMgdGhhdCBoYXZlIGFscmVhZHkgYmVlbiBkcmF3biBpbiB1 cGRhdGVfd2luZG93CitsaW5lIGJlY2F1c2Ugb3ZlcmxhcHBlZF9wIGluIGRlc2lyZWQgcm93cyBp cyAwLCBzbyBhZnRlciByb3cgYXNzaWdubWVudAorb3ZlcmxhcHBlZF9wIGluIGN1cnJlbnQgcm93 cyBpcyAwLiAqLworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykp OworICBmb3IgKGludCBpID0gMDsgaSA8IHctPmN1cnJlbnRfbWF0cml4LT5ucm93czsgKytpKQor ICAgIHsKKyAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdyA9IHctPmN1cnJlbnRfbWF0cml4LT5y b3dzICsgaTsKKyAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgICAgIGJyZWFrOworICAg ICAgICBlbHNlIGlmIChyb3ctPm1vZGVfbGluZV9wKQorICAgICAgICAgIGNvbnRpbnVlOworICAg ICAgaWYgKHJvdy0+b3ZlcmxhcHBlZF9wKQorICAgICAgICB7CisgICAgICAgICAgZm9yIChlbnVt IGdseXBoX3Jvd19hcmVhIGFyZWEgPSBMRUZUX01BUkdJTl9BUkVBOyBhcmVhIDwgTEFTVF9BUkVB OyArK2FyZWEpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIG91dHB1dF9jdXJzb3JfdG8g KHcsIGksIDAsIHJvdy0+eSwgYXJlYSA9PSBURVhUX0FSRUEgPyByb3ctPnggOiAwKTsKKyAgICAg ICAgICAgICAgaWYgKCFtY19yZWRyYXdfcm93ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgcm93LCBh cmVhLCByb3ctPngsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT51 c2VkW2FyZWFdLCB0cnVlLCBEUkFXX05PUk1BTF9URVhULAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIFVQREFURV9XSU5ET1dfX1JFRFJBV19PVkVSTEFQUEVEX1JPV1MpCisgICAg ICAgICAgICAgICAgICAmJiByb3ctPnVzZWRbYXJlYV0pCisgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgRlJBTUVfUklGIChmKS0+d3JpdGVfZ2x5cGhzICh3LCByb3csIHJvdy0+ Z2x5cGhzW2FyZWFdLCBhcmVhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICByb3ctPnVzZWRbYXJlYV0pOworICAgICAgICAgICAgICAgICAgRlJBTUVfUklG IChmKS0+Y2xlYXJfZW5kX29mX2xpbmUgKHcsIHJvdywgYXJlYSwgLTEpOworICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICByb3ctPm92ZXJsYXBwZWRfcCA9IDA7Cisg ICAgICAgIH0KKyAgICAgIGlmIChNQVRSSVhfUk9XX0JPVFRPTV9ZIChyb3cpID49IHliKQorICAg ICAgICBicmVhazsKKyAgICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgICAg ICByZWRyYXdfb3ZlcmxhcHBpbmdfcm93cyAodywgeWIpOwogCSAgICB9CiAjZW5kaWYKQEAgLTM1 MzYsOCArNTQ4NywyMCBAQCB1cGRhdGVfd2luZG93IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGZv cmNlX3ApCiAjZW5kaWYKIAogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQorCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlmIChCVUZGRVJQ ICh3LT5jb250ZW50cykKKyAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIGNyb3NzaGFpcnMpKSkKKyAgICBtY191cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIDApOwor ICAgIGVsc2UKICAgICAgIHVwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgMCk7CiAKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgICAgIC8qIEVuZCB0aGUgdXBkYXRlIG9mIHdpbmRvdyBX LiAgRG9uJ3Qgc2V0IHRoZSBjdXJzb3IgaWYgd2UKICAgICAgICAgIHBhdXNlZCB1cGRhdGluZyB0 aGUgZGlzcGxheSBiZWNhdXNlIGluIHRoaXMgY2FzZSwKICAgICAgICAgIHNldF93aW5kb3dfY3Vy c29yX2FmdGVyX3VwZGF0ZSBoYXNuJ3QgYmVlbiBjYWxsZWQsIGFuZApkaWZmIC0tZ2l0IGEvc3Jj L2ZyYW1lLmggYi9zcmMvZnJhbWUuaAppbmRleCBmYTQ1YTMyLi41M2FkMTMxIDEwMDY0NAotLS0g YS9zcmMvZnJhbWUuaAorKysgYi9zcmMvZnJhbWUuaApAQCAtMjA1LDYgKzIwNSwxNiBAQCBzdHJ1 Y3QgZnJhbWUKICAgTGlzcF9PYmplY3QgdG9vbF9iYXJfaXRlbXM7CiAgIC8qIHRvb2xfYmFyX2l0 ZW1zIHNob3VsZCBiZSB0aGUgbGFzdCBMaXNwX09iamVjdCBtZW1iZXIuICAqLwogCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8qIE5vbi1u aWwgd2hlbiB0aGUgZnJhbWUgaXMgaW4gdGhlIHByb2Nlc3Mgb2YgYmVpbmcgdXBkYXRlZC4gKi8K KyAgc3RydWN0IGZyYW1lICptY191cGRhdGluZ19mcmFtZTsKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogICAvKiBDYWNoZSBvZiByZWFsaXplZCBmYWNlcy4gICovCiAgIHN0cnVjdCBm YWNlX2NhY2hlICpmYWNlX2NhY2hlOwogCmRpZmYgLS1naXQgYS9zcmMvZnJpbmdlLmMgYi9zcmMv ZnJpbmdlLmMKaW5kZXggZDBkNTk5Mi4uMjUyZWRhYyAxMDA2NDQKLS0tIGEvc3JjL2ZyaW5nZS5j CisrKyBiL3NyYy9mcmluZ2UuYwpAQCAtNDM3LDggKzQzNyw0NjIgQEAgc3RhdGljIHVuc2lnbmVk IHNob3J0IGVtcHR5X2xpbmVfYml0c1tdID0gewogI2RlZmluZSBTVEFOREFSRF9CSVRNQVBfSEVJ R0hUKGJpdHMpIChzaXplb2YgKGJpdHMpL0JZVEVTX1BFUl9CSVRNQVBfUk9XKQogI2RlZmluZSBG UkJJVFMoYml0cykgIGJpdHMsIFNUQU5EQVJEX0JJVE1BUF9IRUlHSFQgKGJpdHMpCiAKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8q IGArLWZyaW5nZS1oZWxwZXItZGVjaW1hbCcgZGVmaW5lZCBpbiBgY3Jvc3NoYWlycy5lbGAgKi8K KworLyogVE9ETzogIENvbnNpZGVyIGFkZGluZyB0aGUgZm9sbG93aW5nIGZyaW5nZSBiaXRtYXBz OgorICAoZGVmaW5lLWZyaW5nZS1iaXRtYXAgJ2JyZWFrcG9pbnQgIlx4M2NceDdlXHhmZlx4ZmZc eGZmXHhmZlx4N2VceDNjIikKKyAgKGRlZmluZS1mcmluZ2UtYml0bWFwICdob2xsb3ctcmlnaHQt dHJpYW5nbGUgIlx4ZTBceDkwXHg4OFx4ODRceDg0XHg4OFx4OTBceGUwIikgKi8KKworLyogMjQK KyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC4uLi4uLi4iCisgICAg ICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4ueHguLi4iCisgICAgICAi eC4uLnh4Li4iCisgICAgICAieC4uLi54eC4iCisgICAgICAieC54eHh4eHgiCisgICAgICAieC54 eHh4eHgiCisgICAgICAieC4uLi54eC4iCisgICAgICAieC4uLnh4Li4iCisgICAgICAieC4ueHgu Li4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4i KQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY192ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3df Yml0c1tdID17CisgIDB4ODAsIDB4ODAsIDB4ODAsIDB4OTgsIDB4OGMsIDB4ODYsIDB4YmYsCisg IDB4YmYsIDB4ODYsIDB4OGMsIDB4OTgsIDB4ODAsIDB4ODAsIDB4ODB9OworCisvKiAyNQorICAg ICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIu Li4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIueHguLi54eCIKKyAgICAgICIuLnh4 Li54eCIKKyAgICAgICIuLi54eC54eCIKKyAgICAgICJ4eHh4eHh4eCIKKyAgICAgICJ4eHh4eHh4 eCIKKyAgICAgICIuLi54eC54eCIKKyAgICAgICIuLnh4Li54eCIKKyAgICAgICIueHguLi54eCIK KyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIpCisq Lworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3JldmVyc2VkX3ZlcnRpY2FsX2Jhcl9yaWdodF9h cnJvd19iaXRzW10gPXsKKyAgMHgzLCAweDMsIDB4MywgMHg2MywgMHgzMywgMHgxYiwgMHhmZiwg MHhmZiwgMHgxYiwgMHgzMywgMHg2MywgMHgzLCAweDMsIDB4M307CisKKy8qIDI2CisgICAgKCst ZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4eHh4eHh4IgorICAgICAgInguLi4u Li54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLnh4Li54IgorICAgICAgInguLi54eC54 IgorICAgICAgInguLi4ueHh4IgorICAgICAgIngueHh4eHh4IgorICAgICAgIngueHh4eHh4Igor ICAgICAgInguLi4ueHh4IgorICAgICAgInguLi54eC54IgorICAgICAgInguLnh4Li54IgorICAg ICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInh4eHh4eHh4IikKKyovCitz dGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvd19iaXRz W10gPXsKKyAgMHhmZiwgMHg4MSwgMHg4MSwgMHg5OSwgMHg4ZCwgMHg4NywgMHhiZiwKKyAgMHhi ZiwgMHg4NywgMHg4ZCwgMHg5OSwgMHg4MSwgMHg4MSwgMHhmZn07CisKKy8qIDI3CisgICAgKCst ZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4eHh4eHh4IgorICAgICAgInguLi4u Lnh4IgorICAgICAgInguLi4uLnh4IgorICAgICAgIngueHguLnh4IgorICAgICAgInguLnh4Lnh4 IgorICAgICAgInguLi54eHh4IgorICAgICAgInh4eHh4eHh4IgorICAgICAgInh4eHh4eHh4Igor ICAgICAgInguLi54eHh4IgorICAgICAgInguLnh4Lnh4IgorICAgICAgIngueHguLnh4IgorICAg ICAgInguLi4uLnh4IgorICAgICAgInguLi4uLnh4IgorICAgICAgInh4eHh4eHh4IikKKyovCitz dGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcmV2ZXJzZWRfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9h cnJvd19iaXRzW10gPXsKKyAgMHhmZiwgMHg4MSwgMHg4MSwgMHhiMSwgMHg5OSwgMHg4ZCwgMHhm ZiwKKyAgMHhmZiwgMHg4ZCwgMHg5OSwgMHhiMSwgMHg4MSwgMHg4MSwgMHhmZn07CisKKy8qIDI4 CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4eHh4eHh4IgorICAg ICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAg InguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgIngu Li4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4u Li54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInh4eHh4eHh4 IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfaG9sbG93X3JlY3RhbmdsZV9iaXRzW10g PXsKKyAgMHhmZiwgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwKKyAgMHg4MSwg MHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwgMHhmZn07CisKKy8qIDI5CisgICAgKCstZnJp bmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4u IgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgor ICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAg ICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAg InguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIikKKyovCitzdGF0 aWMgdW5zaWduZWQgc2hvcnQgbWNfdmVydGljYWxfYmFyX2JpdHNbXSA9eworICAweDgwLCAweDgw LCAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwLAorICAweDgwLCAweDgwLCAweDgwLCAweDgw LCAweDgwLCAweDgwLCAweDgwfTsKKworLyogMzAKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFk ZWNpbWFsCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4u eHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgi CisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisg ICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAg ICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9y dCBtY19yZXZlcnNlZF92ZXJ0aWNhbF9iYXJfYml0c1tdID17CisgIDB4MywgMHgzLCAweDMsIDB4 MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzfTsKKwor LyogMzEKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHguLi4uLi4i CisgICAgICAieHguLi4uLi4iCisgICAgICAiIHh4Li4uLi4iCisgICAgICAiLnh4Li4uLi4iCisg ICAgICAiLi54eC4uLi4iCisgICAgICAiLi54eC4uLi4iCisgICAgICAiLi4ueHguLi4iCisgICAg ICAiLi4ueHguLi4iCisgICAgICAiLi4uLnh4Li4iCisgICAgICAiLi4uLnh4Li4iCisgICAgICAi Li4uLi54eC4iCisgICAgICAiLi4uLi54eC4iCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4u Li4ueHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19iYWNrc2xhc2hfYml0c1tdID17 CisgIDB4YzAsID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DB4ZjQsIDB4ZjQsIDB4NzQs IDB4MTQsIDB4MTQsIDB4MTQsIDB4MTQsIDB4MTQsIDB4MTR9OworCisvKiAzNAorICAgICgrLWZy aW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLnh4eHguLiIKKyAgICAgICIueHh4eHh4 LiIKKyAgICAgICJ4Li54eC4ueCIKKyAgICAgICJ4Li54eC4ueCIKKyAgICAgICJ4eHh4eHh4eCIK KyAgICAgICJ4eC4uLi54eCIKKyAgICAgICJ4eHguLnh4eCIKKyAgICAgICIueHh4eHh4LiIKKyAg ICAgICIuLnh4eHguLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3NtaWxleV9mYWNl X2JpdHNbXSA9eworICAweDNjLCAweDdlLCAweDk5LCAweDk5LCAweGZmLCAweGMzLCAweGU3LCAw eDdlLCAweDNjfTsKKworLyogMzUKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisg ICAgICAiLi54Li4uLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLnguLi4iCisgICAg ICAiLi4uLi54Li4iCisgICAgICAiLi4uLnguLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAi Li54Li4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zaW5nbGVfYW5nbGVfcmln aHRfYml0c1tdID17CisgIDB4MjAsIDB4MTAsIDB4OCwgMHg0LCAweDgsIDB4MTAsIDB4MjB9Owor CisvKiAzNgorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLngu LiIKKyAgICAgICIuLi4ueC4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLnguLi4uLiIK KyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLi4ueC4uLiIKKyAgICAgICIuLi4uLnguLiIpCisq Lworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3NpbmdsZV9hbmdsZV9sZWZ0X2JpdHNbXSA9ewor ICAweDQsIDB4OCwgMHgxMCwgMHgyMCwgMHgxMCwgMHg4LCAweDR9OworCisvKiAzNworICAgICgr LWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICJ4eC54eC4uLiIKKyAgICAgICIueHgu eHguLiIKKyAgICAgICIuLnh4Lnh4LiIKKyAgICAgICIuLi54eC54eCIKKyAgICAgICIuLnh4Lnh4 LiIKKyAgICAgICIueHgueHguLiIKKyAgICAgICJ4eC54eC4uLiIpCisqLworc3RhdGljIHVuc2ln bmVkIHNob3J0IG1jX2RvdWJsZV9hbmdsZV9yaWdodF9iaXRzW10gPXsKKyAgMHhkOCwgMHg2Yywg MHgzNiwgMHgxYiwgMHgzNiwgMHg2YywgMHhkOH07CisKKy8qIDM4CisgICAgKCstZnJpbmdlLWhl bHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLnh4Lnh4IgorICAgICAgIi4ueHgueHguIgorICAg ICAgIi54eC54eC4uIgorICAgICAgInh4Lnh4Li4uIgorICAgICAgIi54eC54eC4uIgorICAgICAg Ii4ueHgueHguIgorICAgICAgIi4uLnh4Lnh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQg bWNfZG91YmxlX2FuZ2xlX2xlZnRfYml0c1tdID17CisgIDB4MWIsIDB4MzYsIDB4NmMsIDB4ZDgs IDB4NmMsIDB4MzYsIDB4MWJ9OworCisvKiAzOQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRl Y2ltYWwKKyAgICAgICJ4LngueC4uLiIKKyAgICAgICIueC54LnguLiIKKyAgICAgICIuLngueC54 LiIKKyAgICAgICIuLi54LngueCIKKyAgICAgICIuLngueC54LiIKKyAgICAgICIueC54LnguLiIK KyAgICAgICJ4LngueC4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3RyaXBsZV9h bmdsZV9yaWdodF9iaXRzW10gPXsKKyAgMHhhOCwgMHg1NCwgMHgyYSwgMHgxNSwgMHgyYSwgMHg1 NCwgMHhhOH07CisKKy8qIDQwCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAg ICAgIi4uLngueC54IgorICAgICAgIi4ueC54LnguIgorICAgICAgIi54LngueC4uIgorICAgICAg IngueC54Li4uIgorICAgICAgIi54LngueC4uIgorICAgICAgIi4ueC54LnguIgorICAgICAgIi4u LngueC54IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdHJpcGxlX2FuZ2xlX2xlZnRf Yml0c1tdID17CisgIDB4MTUsIDB4MmEsIDB4NTQsIDB4YTgsIDB4NTQsIDB4MmEsIDB4MTV9Owor CisvKiA0MQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4u LiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIK KyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAg ICAgICJ4Li4uLi54LiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAg ICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0 IG1jX3NpbmdsZV9hbmdsZV91cF9iaXRzW10gPXsKKyAgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwg MHgxMCwgMHgyOCwgMHg0NCwgMHg4MiwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMH07CisKKy8qIDQy CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4uLi4uIgorICAg ICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAg InguLi4uLnguIgorICAgICAgIi54Li4ueC4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi4u LnguLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4u Li4uIgorICAgICAgIi4uLi4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc2lu Z2xlX2FuZ2xlX2Rvd25fYml0c1tdID17CisgIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4ODIs IDB4NDQsIDB4MjgsIDB4MTAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9OworCisvKiA0MworICAg ICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIu Li4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLngu eC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIuLngueC4u LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIuLi4uLi4uLiIK KyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVk IHNob3J0IG1jX2RvdWJsZV9hbmdsZV91cF9iaXRzW10gPXsKKyAgMHgwMCwgMHgwMCwgMHgwMCwg MHgxMCwgMHgyOCwgMHg0NCwgMHg5MiwgMHgyOCwgMHg0NCwgMHg4MiwgMHgwMCwgMHgwMCwgMHgw MH07CisKKy8qIDQ0CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4u Li4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgInguLi4u LnguIgorICAgICAgIi54Li4ueC4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgInguLnguLngu IgorICAgICAgIi54Li4ueC4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi4uLnguLi4uIgor ICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIikKKyov CitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xlX2Rvd25fYml0c1tdID17Cisg IDB4MDAsIDB4MDAsIDB4MDAsIDB4ODIsIDB4NDQsIDB4MjgsIDB4OTIsIDB4NDQsIDB4MjgsIDB4 MTAsIDB4MDAsIDB4MDAsIDB4MDB9OworCisvKiA0NQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4 YWRlY2ltYWwKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLngu eC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIuLngueC4u LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIuLngueC4uLiIK KyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIuLi4uLi4uLiIpCisq Lworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3RyaXBsZV9hbmdsZV91cF9iaXRzW10gPXsKKyAg MHgwMCwgMHgxMCwgMHgyOCwgMHg0NCwgMHg5MiwgMHgyOCwgMHg0NCwgMHg5MiwgMHgyOCwgMHg0 NCwgMHg4MiwgMHgwMH07CisKKy8qIDQ2CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1h bAorICAgICAgIi4uLi4uLi4uIgorICAgICAgInguLi4uLnguIgorICAgICAgIi54Li4ueC4uIgor ICAgICAgIi4ueC54Li4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi54Li4ueC4uIgorICAg ICAgIi4ueC54Li4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi54Li4ueC4uIgorICAgICAg Ii4ueC54Li4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4uLi4uLi4uIikKKyovCitzdGF0 aWMgdW5zaWduZWQgc2hvcnQgbWNfcXVhZHJ1cGxlX2FuZ2xlX2Rvd25fYml0c1tdID17CisgIDB4 MDAsIDB4ODIsIDB4NDQsIDB4MjgsIDB4OTIsIDB4NDQsIDB4MjgsIDB4OTIsIDB4NDQsIDB4Mjgs IDB4MTAsIDB4MDB9OworCisvKiA0NworICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwK KyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAg ICAgICJ4Li54Li54LiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAgICAg ICJ4Li54Li54LiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4 Li54Li54LiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4Li4u Li54LiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3F1YWRydXBsZV9hbmdsZV91cF9i aXRzW10gPXsKKyAgMHgxMCwgMHgyOCwgMHg0NCwgMHg5MiwgMHgyOCwgMHg0NCwgMHg5MiwgMHgy OCwgMHg0NCwgMHg5MiwgMHgyOCwgMHg0NCwgMHg4Mn07CisKKy8qIDQ4CisgICAgKCstZnJpbmdl LWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInguLi4uLnguIgorICAgICAgIi54Li4ueC4uIgor ICAgICAgIi4ueC54Li4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi54Li4ueC4uIgorICAg ICAgIi4ueC54Li4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi54Li4ueC4uIgorICAgICAg Ii4ueC54Li4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi54Li4ueC4uIgorICAgICAgIi4u eC54Li4uIgorICAgICAgIi4uLnguLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hv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gICAg aWYgKENPTlNQIChibTEpKQorICAgICAgeworICAgICAgICBsbjEgPSBYRklYTlVNIChGbGVuZ3Ro IChibTEpKTsKKyAgICAgICAgaWYgKHBhcnRpYWxfcCkKKyAgICAgICAgICB7CisgICAgICAgICAg ICBpZiAobG4xID4gaXgyKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgYm0gPSBt Y19udGggKGl4MiwgYm0xKTsKKyAgICAgICAgICAgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAg ICAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0K KyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmIChsbjEgPiBp eDEpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgYm0gPSBtY19udGggKGl4 MSwgYm0xKTsKKyAgICAgICAgICAgICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAg ICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQor ICAgICAgfQorICAgIGVsc2UgaWYgKChibSA9IGJtMSwgIUVRIChibSwgUXQpKSkKKyAgICAgIGdv dG8gZm91bmQ7CisgIH0KKyAgICB9CisgIGlmICghRVEgKGNtYXAsIEJWQVIgKCZidWZmZXJfZGVm YXVsdHMsIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKQorICAgICAgJiYgIU5JTFAgKEJWQVIgKCZi dWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKSkKKyAgICB7CisgICAgICBi bTIgPSBtY19hc3NxIChiaXRtYXAsIEJWQVIgKCZidWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9pbmRp Y2F0b3JfYWxpc3QpKTsKKyAgICAgIGlmIChDT05TUCAoYm0yKSkKKyAgICAgICAgeworICAgICAg ICAgIGlmICgoYm0yID0gWENEUiAoYm0yKSksICFOSUxQIChibTIpKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICBpZiAoQ09OU1AgKGJtMikpCisgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgbG4yID0gWEZJWE5VTSAoRmxlbmd0aCAoYm0yKSk7CisgICAgICAgICAgICAg ICAgICBpZiAocGFydGlhbF9wKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAg ICAgICAgICAgaWYgKGxuMiA+IGl4MikKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgYm0gPSBtY19udGggKGl4MiwgYm0yKTsKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICBnb3RvIGZvdW5kOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9Cisg ICAgfQorICBpZiAobG4xID4gaXgxKQorICAgIHsKKyAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJt MSk7CisgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgICBnb3RvIGZvdW5kOworICAgIH0K KyAgaWYgKGxuMiA+IGl4MSkKKyAgICB7CisgICAgICBibSA9IG1jX250aCAoaXgxLCBibTIpOwor ICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAgZ290byBmb3VuZDsKKyAgICAgIHJldHVy biBNQ19OT19GUklOR0VfQklUTUFQOworICAgIH0KKyAgICBlbHNlIGlmICgoYm0gPSBibTIsIE5J TFAgKGJtKSkpCisgICAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgZm91bmQ6Cisg IHJldHVybiBsb29rdXBfZnJpbmdlX2JpdG1hcCAoYm0pOworfQorCitzdGF0aWMgaW50CittY19n ZXRfbG9naWNhbF9jdXJ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ZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICBpZiAoQ09OU1AgKGJtMSkpCisg ICAgICAgICAgICB7CisgICAgICAgICAgICAgIGxuMSA9IFhGSVhOVU0gKEZsZW5ndGggKGJtMSkp OworICAgICAgICAgICAgICBpZiAocGFydGlhbF9wKQorICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgIGlmIChsbjEgPiBpeDIpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgICAgICBibSA9IG1jX250aCAoaXgyLCBibTEpOworICAgICAgICAgICAgICAg ICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAgICAgICAgICAgICAgICBnb3RvIGZv dW5kOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYg KGxuMSA+IGl4MSkKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAg ICAgICBibSA9IG1jX250aCAoaXgxLCBibTEpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYg KCFFUSAoYm0sIFF0KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAg ICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9 CisgICAgICAgICAgICBlbHNlIGlmICgoYm0gPSBibTEsICFFUSAoYm0sIFF0KSkpCisgICAgICAg ICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgIH0KKyAgICB9CisgIGlmICghRVEgKGNtYXAsIEJW QVIgKCZidWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKQorICAgICAgJiYg IU5JTFAgKEJWQVIgKCZidWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKSkK KyAgICB7CisgICAgICBibTIgPSBtY19hc3NxIChiaXRtYXAsIEJWQVIgKCZidWZmZXJfZGVmYXVs dHMsIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKTsKKyAgICAgIGlmIChDT05TUCAoYm0yKSkKKyAg ICAgICAgeworICAgICAgICAgIGlmICgoYm0yID0gWENEUiAoYm0yKSksICFOSUxQIChibTIpKQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAoQ09OU1AgKGJtMikpCisgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgbG4yID0gWEZJWE5VTSAoRmxlbmd0aCAoYm0yKSk7 CisgICAgICAgICAgICAgICAgICBpZiAocGFydGlhbF9wKQorICAgICAgICAgICAgICAgICAgICB7 CisgICAgICAgICAgICAgICAgICAgICAgaWYgKGxuMiA+IGl4MikKKyAgICAgICAgICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgYm0gPSBtY19udGggKGl4MiwgYm0y KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5kOworICAgICAgICAgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg fQorICAgICAgICB9CisgICAgfQorICBpZiAobG4xID4gaXgxKQorICAgIHsKKyAgICAgIGJtID0g bWNfbnRoIChpeDEsIGJtMSk7CisgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgICBnb3Rv IGZvdW5kOworICAgIH0KKyAgaWYgKGxuMiA+IGl4MSkKKyAgICB7CisgICAgICBibSA9IG1jX250 aCAoaXgxLCBibTIpOworICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAgZ290byBmb3Vu ZDsKKyAgICAgIHJldHVybiBNQ19OT19GUklOR0VfQklUTUFQOworICAg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ZF9taW5feSwgYm90X2luZF9tYXhfeTsKKyAgLyogdG9wX2luZF9y biBpcyBzZXQgdG8gYSBub25uZWdhdGl2ZSB2YWx1ZSB3aGVuZXZlcgorICAgICByb3ctPmluZGlj YXRlX2JvYl9wIGlzIHNldCwgc28gaXQncyBPSyB0aGF0IHRvcF9yb3dfZW5kc19hdF96dl9wCisg ICAgIGlzIG5vdCBpbml0aWFsaXplZCBoZXJlLiAgU2ltaWxhcmx5IGZvciBib3RfaW5kX3JuLAor ICAgICByb3ctPmluZGljYXRlX2VvYl9wIGFuZCBib3Rfcm93X2VuZHNfYXRfenZfcC4gKi8KKyAg aW50IHRvcF9yb3dfZW5kc19hdF96dl9wIE1DX0lGX0xJTlQgKD0gMCksIGJvdF9yb3dfZW5kc19h dF96dl9wIE1DX0lGX0xJTlQgKD0gMCk7CisgIGlmICh3LT5wc2V1ZG9fd2luZG93X3ApCisgICAg cmV0dXJuIDA7CisgIGlmICghTUlOSV9XSU5ET1dfUCAodykKKyAgICAgICYmIChpbmQgPSBCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIGluZGljYXRlX2J1ZmZlcl9ib3VuZGFyaWVzKSwgIU5J TFAgKGluZCkpKQorICAgIHsKKyAgICAgIGlmIChFUSAoaW5kLCBRbGVmdCkgfHwgRVEgKGluZCwg UXJpZ2h0KSkKKyAgICAgICAgYm91bmRhcnlfdG9wID0gYm91bmRhcnlfYm90ID0gYXJyb3dfdG9w ID0gYXJyb3dfYm90ID0gaW5kOworICAgICAgICBlbHNlIGlmIChDT05TUCAoaW5kKQorICAgICAg ICAgICAgICAgICAmJiBDT05TUCAoWENBUiAoaW5kKSkpCisgICAgICAgIHsKKyAgICAgICAgICBM aXNwX09iamVjdCBwb3M7CisgICAgICAgICAgaWYgKHBvcyA9IG1jX2Fzc3EgKFF0LCBpbmQpLCAh TklMUCAocG9zKSkKKyAgICAgICAgICAgIGJvdW5kYXJ5X3RvcCA9IGJvdW5kYXJ5X2JvdCA9IGFy cm93X3RvcCA9IGFycm93X2JvdCA9IFhDRFIgKHBvcyk7CisgICAgICAgICAgaWYgKHBvcyA9IG1j X2Fzc3EgKFF0b3AsIGluZCksICFOSUxQIChwb3MpKQorICAgICAgICAgICAgYm91bmRhcnlfdG9w ID0gWENEUiAocG9zKTsKKyAgICAgICAgICBpZiAocG9zID0gbWNfYXNzcSAoUWJvdHRvbSwgaW5k KSwgIU5JTFAgKHBvcykpCisgICAgICAgICAgICBib3VuZGFyeV9ib3QgPSBYQ0RSIChwb3MpOwor ICAgICAgICAgIGlmIChwb3MgPSBtY19hc3NxIChRdXAsIGluZCksICFOSUxQIChwb3MpKQorICAg ICAgICAgICAgYXJyb3dfdG9wID0gWENEUiAocG9zKTsKKyAgICAgICAgICBpZiAocG9zID0gbWNf YXNzcSAoUWRvd24sIGluZCksICFOSUxQIChwb3MpKQorICAgICAgICAgICAgYXJyb3dfYm90ID0g WENEUiAocG9zKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgLyogQW55dGhp bmcgZWxzZSBtZWFucyBib3VuZGFyeSBvbiBsZWZ0IGFuZCBubyBhcnJvd3MuICovCisgICAgICAg ICAgYm91bmRhcnlfdG9wID0gYm91bmRhcnlfYm90ID0gUWxlZnQ7CisgICAgfQorICB0b3BfaW5k X3JuID0gYm90X2luZF9ybiA9IC0xOworICBpZiAoIU5JTFAgKGluZCkpCisgICAgeworICAgICAg Zm9yICh5ID0gdy0+dnNjcm9sbCwgcm4gPSAwOworICAgICAgICAgICB5IDwgeWIgJiYgcm4gPCBu cm93czsKKyAgICAgICAgICAgeSArPSByb3ctPmhlaWdodCwgKytybikKKyAgICAgICAgeworICAg ICAgICAgIHJvdyA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgaWYg KCFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgICAgIHJvdyA9IHctPmN1cnJlbnRfbWF0cml4LT5y b3dzICsgcm47CisgICAgICAgICAgcm93LT5pbmRpY2F0ZV9ib2JfcCA9IHJvdy0+aW5kaWNhdGVf dG9wX2xpbmVfcCA9IDA7CisgICAgICAgICAgcm93LT5pbmRpY2F0ZV9lb2JfcCA9IHJvdy0+aW5k aWNhdGVfYm90dG9tX2xpbmVfcCA9IDA7CisgICAgICAgICAgaWYgKCFyb3ctPm1vZGVfbGluZV9w KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAodG9wX2luZF9ybiA8IDAgJiYgcm93 LT52aXNpYmxlX2hlaWdodCA+IDApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg ICAgaWYgKE1BVFJJWF9ST1dfU1RBUlRfQ0hBUlBPUyAocm93KSA8PSBCVUZfQkVHViAoWEJVRkZF UiAody0+Y29udGVudHMpKQorICAgICAgICAgICAgICAgICAgICAgICYmICFNQVRSSVhfUk9XX1BB UlRJQUxMWV9WSVNJQkxFX0FUX1RPUF9QICh3LCByb3cpKQorICAgICAgICAgICAgICAgICAgICBy b3ctPmluZGljYXRlX2JvYl9wID0gIU5JTFAgKGJvdW5kYXJ5X3RvcCk7CisgICAgICAgICAgICAg ICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICByb3ctPmluZGljYXRlX3RvcF9saW5l X3AgPSAhTklMUCAoYXJyb3dfdG9wKTsKKyAgICAgICAgICAgICAgICAgIHRvcF9pbmRfcm4gPSBy bjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGlmIChib3RfaW5kX3JuIDwgMCkK KyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBpZiAoTUFUUklYX1JPV19FTkRf Q0hBUlBPUyAocm93KSA+PSBCVUZfWlYgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSkKKyAgICAgICAg ICAgICAgICAgICAgICAmJiAhTUFUUklYX1JPV19QQVJUSUFMTFlfVklTSUJMRV9BVF9CT1RUT01f UCAodywgcm93KSkKKyAgICAgICAgICAgICAgICAgICAgcm93LT5pbmRp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3ctPmVuZHNfYXRfenZfcCkKKyAgICAgICAgICAg ICAgICAgIDogTUNfTEVGVF9GUklOR0UgKDIsIFF0b3AsIDApKTsKKyAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgYm4gPSAoKHJvdy0+aW5kaWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5kYXJ5 X2JvdCwgUXJpZ2h0KSkKKyAgICAgICAgICAgICAgICAgICAgPyBNQ19SSUdIVF9GUklOR0UgKDEs IFF0b3BfYm90dG9tLCByb3ctPmVuZHNfYXRfenZfcCkKKyAgICAgICAgICAgICAgICAgICAgOiBN Q19SSUdIVF9GUklOR0UgKDIsIFF0b3AsIDApKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlm IChyb3ctPmluZGljYXRlX3RvcF9saW5lX3ApCisgICAgICAgICAgeworICAgICAgICAgICAgaWYg KEVRIChhcnJvd190b3AsIFFsZWZ0KSkKKyAgICAgICAgICAgICAgYm4gPSBNQ19MRUZUX0ZSSU5H RSAoNiwgUXVwLCAwKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIGJuID0g TUNfUklHSFRfRlJJTkdFICg2LCBRdXAsIDApOworICAgICAgICAgIH0KKyAgICAgIGlmIChibiAh PSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGZyaW5n ZV9iaXRtYXAgKmZiID0gZ2V0X2ZyaW5nZV9iaXRtYXBfZGF0YSAoYm4pOworICAgICAgICAgIGlm IChmYi0+YWxpZ24gPT0gQUxJR05fQklUTUFQX1RPUCAmJiBmYi0+cGVyaW9kID09IDApCisgICAg ICAgICAgICB7CisgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdzE7CisgICAgICAg ICAgICAgIGludCB0b3BfaW5kX21heF95OworICAgICAgICAgICAgICB0b3BfaW5kX21pbl95ID0g V0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgICAgICAgICAgICAgIHRvcF9pbmRfbWF4 X3kgPSB0b3BfaW5kX21pbl95ICsgZmItPmhlaWdodDsKKyAgICAgICAgICAgICAgaWYgKHRvcF9p bmRfbWF4X3kgPiB5YikKKyAgICAgICAgICAgICAgICB0b3BfaW5kX21heF95ID0geWI7CisgICAg ICAgICAgICAgIGZvciAoeSA9IHJvdy0+eSArIHJvdy0+aGVpZ2h0LCBybiA9IHRvcF9pbmRfcm4g KyAxOworICAgICAgICAgICAgICAgICAgIHkgPCB0b3BfaW5kX21heF95ICYmIHJuIDwgbnJvd3M7 CisgICAgICAgICAgICAgICAgICAgeSArPSByb3cxLT5oZWlnaHQsIHJuKyspCisgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgaWYgKGJvdF9pbmRfcm4gPj0gMCAmJiBybiA+PSBi b3RfaW5kX3JuKQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAg IHJvdzEgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHJuOworICAgICAgICAgICAgICAgICAg aWYgKCFyb3cxLT5lbmFibGVkX3ApCisgICAgICAgICAgICAgICAgICAgIHJvdzEgPSB3LT5jdXJy ZW50X21hdHJpeC0+cm93cyArIHJuOworICAgICAgICAgICAgICAgICAgcm93MS0+aW5kaWNhdGVf Ym9iX3AgPSByb3ctPmluZGljYXRlX2JvYl9wOworICAgICAgICAgICAgICAgICAgcm93MS0+aW5k aWNhdGVfdG9wX2xpbmVfcCA9IHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcDsKKyAgICAgICAgICAg ICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIGlmIChib3RfaW5kX3Ju ID49IDApCisgICAgeworICAgICAgaW50IGJuID0gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAg IHJvdyA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgYm90X2luZF9ybjsKKyAgICAgIGlmICgh cm93LT5lbmFibGVkX3ApCisgICAgICAgIHJvdyA9IHctPmN1cnJlbnRfbWF0cml4LT5yb3dzICsg Ym90X2luZF9ybjsKKyAgICAgIGJvdF9yb3dfZW5kc19hdF96dl9wID0gcm93LT5lbmRzX2F0X3p2 X3A7CisgICAgICBpZiAocm93LT5pbmRpY2F0ZV9lb2JfcCkKKyAgICAgICAgeworICAgICAgICAg IGlmIChFUSAoYm91bmRhcnlfYm90LCBRbGVmdCkpCisgICAgICAgICAgICBibiA9IE1DX0xFRlRf RlJJTkdFICgzLCBRYm90dG9tLCByb3ctPmVuZHNfYXRfenZfcCk7CisgICAgICAgICAgICBlbHNl CisgICAgICAgICAgICAgIGJuID0gTUNfUklHSFRfRlJJTkdFICgzLCBRYm90dG9tLCByb3ctPmVu ZHNfYXRfenZfcCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9i b3R0b21fbGluZV9wKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChFUSAoYXJyb3dfYm90 LCBRbGVmdCkpCisgICAgICAgICAgICAgIGJuID0gTUNfTEVGVF9GUklOR0UgKDcsIFFkb3duLCAw KTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIGJuID0gTUNfUklHSFRfRlJJ TkdFICg3LCBRZG93biwgMCk7CisgICAgICAgICAgfQorICAgICAgaWYgKGJuICE9IE1DX05PX0ZS SU5HRV9CSVRNQVApCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZnJpbmdlX2JpdG1hcCAq ZmIgPSBnZXRfZnJpbmdlX2JpdG1hcF9kYXRhIChibik7CisgICAgICAgICAgaWYgKGZiLT5hbGln biA9PSBBTElHTl9CSVRNQVBfQk9UVE9NICYmIGZiLT5wZXJpb2QgPT0gMCkKKyAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93MTsKKyAgICAgICAgICAgICAg aW50IGJvdF9pbmRfbWluX3k7CisgICAgICAgICAgICAgIGJvdF9pbmRfbWF4X3kgPSByb3ctPnkg KyByb3ctPnZpc2libGVfaGVpZ2h0OworICAgICAgICAgICAgICBib3RfaW5kX21pbl95ID0gYm90 X2luZF9tYXhfeSAtIGZiLT5oZWlnaHQ7CisgICAgICAgICAgICAgIGlmIChib3RfaW5kX21pbl95 IDwgV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodykpCisgICAgICAgICAgICAgICAgYm90X2lu ZF9taW5feSA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICAgICAgICAgICAgICBm b3IgKHkgPSByb3ctPnksIHJuID0gYm90X2luZF9ybiAtIDE7CisgICAgICAgICAgICAgICAgICAg eSA+PSBib3RfaW5kX21pbl95ICYmIHJuID49IDA7CisgICAgICAgICAgICAgICAgICAgeSAtPSBy b3cxLT5oZWlnaHQsIHJuLS0pCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg aWYgKHRvcF9pbmRfcm4gPj0gMCAmJiBybiA8PSB0b3BfaW5kX3JuKQorICAgICAgICAgICAgICAg ICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgIHJvdzEgPSB3LT5kZXNpcmVkX21hdHJpeC0+ cm93cyArIHJuOworICAgICAgICAgICAgICAgICAgaWYgKCFyb3cxLT5lbmFibGVkX3ApCisgICAg ICAgICAgICAgICAgICAgIHJvdzEgPSB3LT5jdXJyZW50X21hdHJpeC0+cm93cyArIHJuOworICAg ICAgICAgICAgICAgICAgcm93MS0+aW5kaWNhdGVfZW9iX3AgPSByb3ctPmluZGljYXRlX2VvYl9w OworICAgICAgICAgICAgICAgICAgcm93MS0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCA9IHJvdy0+ aW5kaWNhdGVfYm90dG9tX2xpbmVfcDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9 CisgICAgICAgIH0KKyAgICB9CisgIGJvb2wgYXV0b19oc2Nyb2xsX21vZGVfcCA9IEVRIChGYnVm ZmVyX2xvY2FsX3ZhbHVlIChRYXV0b19oc2Nyb2xsX21vZGUsIHctPmNvbnRlbnRzKSwgUWN1cnJl bnRfbGluZSk7CisgIC8qIEVYQU1QTEU6ICAoc2Nyb2xsLWxlZnQgNSkgKi8KKyAgYm9vbCBoc2Ns X2FsbF90ZW1wX3AgPSAody0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5f aHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBhbmQgZG8gbm90aGluZy4g Ki8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzBfcCA9ICh3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAg Qy11IEMteCA8IGFuZCBkbyBzb21ldGhpbmcgZWxzZSBiZXNpZGVzIGhvcml6b250YWxseSBzY3Jv bGxpbmcgdGhlCisgICAgICAgICAgICAgICBjdXJyZW50IGxpbmUgZGlmZmVyZW50bHkuCisgICAg ICAgICAgICAgICBDdXJyZW50IGxpbmUgaXMgX25vdF8gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRp ZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMV9wID0gKCF3LT5zdXNwZW5kX2F1 dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9t b2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhzY3JvbGwpOworICAv KiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCAuLi4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGlu ZSBpcyBfbm90XyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wg aHNjbF9hbGxfcGVybV8yX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPT0gMAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IHctPm1pbl9oc2Nyb2xsICE9IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgKHNjcm9sbC1s ZWZ0IDUpOyBhbmQsIHRoZW4gcHJlc3MgdGhlIGxlZnQgYXJyb3cga2V5IG9uZSB0aW1lLgorICAg ICAgICAgICAgICAgQ3VycmVudCBsaW5lIF9pc18gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZl cmVudGx5LiovCisgIGJvb2wgaHNjbF90ZW1wX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xs CisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAg ICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYg dy0+bWluX2hzY3JvbGwgPT0gMCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIHNv bWV0aGluZyB0aGF0IGNhdXNlcyB0aGUgY3VycmVudCBsaW5lIHRvIGJlCisgICAgICAgICAgICAg ICBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuCisgICAgICAgICAgICAgICBDdXJy ZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJv b2wgaHNjbF9wZXJtX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAg ICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICYm IHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwg PiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgIT0gdy0+aHNjcm9s bCk7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBmb3IgKHkgPSB3 LT52c2Nyb2xsLCBybiA9IDA7CisgICAgICAgeSA8IHliICYmIHJuIDwgbnJvd3M7CisgICAgICAg eSArPSByb3ctPmhlaWdodCwgcm4rKykKKyAgICB7CisgIGludCBsZWZ0LCByaWdodDsKKyAgdW5z aWduZWQgbGVmdF9mYWNlX2lkLCByaWdodF9mYWNlX2lkOworICBpbnQgbGVmdF9vZmZzZXQsIHJp Z2h0X29mZnNldDsKKyAgYm9vbCBwZXJpb2RpY19wOworICByb3cgPSB3LT5kZXNpcmVkX21hdHJp eC0+cm93cyArIHJuOworICBjdXIgPSB3LT5jdXJyZW50X21hdHJpeC0+cm93cyArIHJuOworICBp bnQgdm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fcGVybV8wX3AKKyAgICAgICAgICAm JiAhaHNjbF9hbGxfcGVybV8xX3AKKyAgICAgICAgICAmJiAhaHNjbF9hbGxfcGVybV8yX3AKKyAg ICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgZnJpbmdlX2Jp dG1hcCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgICAgZW51bSBmYWNlX2lkIG92ZXJs YXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICAgICAoIWFjdGl2ZV9wCisgICAgICAgICAgICAg JiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaW5hY3RpdmVfd2luZG93 cykpKQorICAgICAgICAgICAgPyBsb29rdXBfZGVyaXZlZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIr LW92ZXJsYXktYXJyb3ctaW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwgRlJJTkdFX0ZBQ0VfSUQsIHRy dWUpCisgICAgICAgICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAgICAgICAgPyBsb29rdXBfZGVy aXZlZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ctcHJlLXp2LWZhY2UiKSwg RlJJTkdFX0ZBQ0VfSUQsIHRydWUpCisgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAg ICAgICAgICBtY19sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRf RlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gb3Zl cmxheV9hcnJvd19mYWNlX2lkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICBpZiAody0+aHNjcm9sbCAhPSAwKQorICAgICAg ICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIr LW92ZXJsYXktYXJyb3ciKSwgZmFsc2UsIHRydWUpOworICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAo Iistb3ZlcmxheS1hcnJvdyIpLCB0cnVlLCB0cnVlKTsKKyAgICAgICAgICBtY19sZWZ0X2ZyaW5n ZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGZyaW5nZV9iaXRtYXAKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICB9 CisgICAgICAgIGVsc2UgaWYgKCh2cG9zID09IHZudGhfZG0gfHwgdnBvcyA9PSB2bnRoX2NtKQor ICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgPT0gTUNfT1ZFUkxBWV9BUlJPV19CSVRN QVAKKyAgICAgICAgICAgICAgICAgJiYgKGhzY2xfYWxsX3RlbXBfcAorICAgICAgICAgICAgICAg ICAgICAgfHwgaHNjbF9hbGxfcGVybV8wX3AKKyAgICAgICAgICAgICAgICAgICAgIHx8IGhzY2xf YWxsX3Blcm1fMV9wCisgICAgICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzJfcAor ICAgICAgICAgICAgICAgICAgICAgfHwgaHNjbF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgICAg IHx8IGhzY2xfcGVybV9wKQorICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAg ICAgeworICAgICAgICAgICAgaW50IGZyaW5nZV9iaXRtYXAgPSBNQ19OT19GUklOR0VfQklUTUFQ OworICAgICAgICAgICAgZW51bSBmYWNlX2lkIG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAg ICAgICAgICAgICghYWN0aXZlX3AKKyAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVG RkVSICh3LT5jb250ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgICAgICAg PyBsb29rdXBfZGVyaXZlZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ctaHNj bC1pbmFjdGl2ZS1wcmUtenYtZmFjZSIpLCBGUklOR0VfRkFDRV9JRCwgdHJ1ZSkKKyAgICAgICAg ICAgICAgOiAoYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgPyBsb29rdXBfZGVyaXZlZF9mYWNl ICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ctaHNjbC1wcmUtenYtZmFjZSIpLCBGUklO R0VfRkFDRV9JRCwgdHJ1ZSkKKyAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAg ICAgICAgICBtY19sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRf RlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBv dmVybGF5X2Fycm93X2ZhY2VfaWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgICBpZiAoaHNjbF9hbGxfcGVybV8wX3Ap CisgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywg aW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAgICAgICAgZWxz ZSBpZiAoaHNjbF9hbGxfcGVybV8xX3ApCisgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9 IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCB0cnVlLCBm YWxzZSk7CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF9hbGxfcGVybV8yX3ApCisgICAg ICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGlu dGVybiAoIistaHNjbC1wZXJtIiksIGZhbHNlLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgIGVs c2UgaWYgKGhzY2xfcGVybV9wKQorICAgICAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0g bWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIHRydWUsIHRy dWUpOworICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX2FsbF90ZW1wX3ApCisgICAg ICAgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3 LCBpbnRlcm4gKCIrLWhzY2wtdGVtcCIpLCBmYWxzZSwgZmFsc2UpOworICAgICAgICAgICAgICAg ICAgICAgIGVsc2UgaWYgKGhzY2xfdGVtcF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgZnJp bmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtdGVt cCIpLCB0cnVlLCBmYWxzZSk7CisgICAgICAgICAgICBtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgPSAo Y3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICB9CisgICAg ICAgICAgZWxzZSBpZiAoKHZwb3MgPT0gdm50aF9kbSB8fCB2cG9zID09IHZudGhfY20pCisgICAg ICAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRV9S SUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1D X1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAg ICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFCisgICAgICAgICAg ICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FS Uk9XCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJT RURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBn bHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAgICB8 fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAg ICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSCkK KyAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBMaXNwX09iamVjdCBiaXRtYXBfZmxhdm9yID0gKGdseXBoX2ZsYXZvciA9PSBNQ19I T0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBRbWNfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1D X1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX2hvbGxvd19yZWN0YW5n bGVfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xlCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0g TUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3cKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19S RVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX3ZlcnRpY2FsX2Jhcl9yaWdodF9h cnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhf Zmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElD QUxfQkFSKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFt Y19yZXZlcnNlZF92ZXJ0aWNhbF9iYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNh bF9iYXJfYmFja3NsYXNoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IFFuaWw7CisgICAgICAgICAgICAgIG1jX3JpZ2h0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29y X3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IGxvb2t1cF9mcmluZ2VfYml0bWFwIChiaXRtYXBfZmxhdm9yKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJ VE1BUDsKKyAgICAgICAgICAgICAgbWNfcmlnaHRfZnJpbmdlX2ZhY2VfaWQgPQorICAgICAgICAg ICAgICAgIChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisgICAgICAgICAg ICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYKKyAgICAgICAgICAgICAgICAgJiYgKGds eXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisg ICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElD QUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3Ig PT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKSkKKyAgICAgICAgICAgICAgICAgID8gbG9va3Vw X2Rlcml2ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZXZlcnNlZC1iYXItcHJlLXp2LWZhY2Ui KSwgRlJJTkdFX0ZBQ0VfSUQsIHRydWUpCisgICAgICAgICAgICAgICAgOiAoY3Vyc29yX3R5cGUg PT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAgICYmIHJvd19wb3Np dGlvbiA9PSBBVF9aVgorICAgICAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNf UkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAg ICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FS Uk9XCisgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNF RF9WRVJUSUNBTF9CQVIpKQorICAgICAgICAgICAgICAgICAgPyBsb29rdXBfZGVyaXZlZF9mYWNl ICh3LCBmLCBpbnRlcm4gKCIrLXJldmVyc2VkLWJhci1hdC16di1mYWNlIiksIEZSSU5HRV9GQUNF X0lELCB0cnVlKQorICAgICAgICAgICAgICAgIDogKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZS SU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gPT0gUE9TVF9a VgorICAgICAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9M TE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlw aF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAg ICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9C QVIpKQorICAgICAgICAgICAgICAgICAgPyBsb29rdXBfZGVyaXZlZF9mYWNlICh3LCBmLCBpbnRl cm4gKCIrLXJldmVyc2VkLWJhci1wb3N0LXp2LWZhY2UiKSwgRlJJTkdFX0ZBQ0VfSUQsIHRydWUp CisgICAgICAgICAgICAgICAgOiAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1B UAorICAgICAgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYKKyAgICAgICAg ICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdM RV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19S RVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAmJiBn bHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAg ICAgPyBsb29rdXBfZGVyaXZlZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLWJhci1wcmUtenYtZmFj ZSIpLCBGUklOR0VfRkFDRV9JRCwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlw ZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bv c2l0aW9uID09IEFUX1pWCisgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1D X1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAg ICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9X CisgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX1ZFUlRJ Q0FMX0JBUikKKyAgICAgICAgICAgICAgICAgID8gbG9va3VwX2Rlcml2ZWRfZmFjZSAodywgZiwg aW50ZXJuICgiKy1iYXItYXQtenYtZmFjZSIpLCBGUklOR0VfRkFDRV9JRCwgdHJ1ZSkKKyAgICAg ICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisgICAg ICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBPU1RfWlYKKyAgICAgICAgICAgICAg ICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdI VF9BUlJPVworICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNF RF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9m bGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAgICAgPyBs b29rdXBfZGVyaXZlZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLWJhci1wb3N0LXp2LWZhY2UiKSwg RlJJTkdFX0ZBQ0VfSUQsIHRydWUpCisgICAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7 CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisg ICAgICAgIHJvdyA9IGN1cjsKKyAgICAgIGxlZnRfZmFjZV9pZCA9IHJpZ2h0X2ZhY2VfaWQgPSBE RUZBVUxUX0ZBQ0VfSUQ7CisgICAgICBsZWZ0X29mZnNldCA9IHJpZ2h0X29mZnNldCA9IDA7Cisg ICAgICBwZXJpb2RpY19wID0gMDsKKyAgICAgIC8qIER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ICBsZWZ0X29mZnNldCA9IHRvcF9pbmRfbWluX3kgLSByb3ctPnk7CisgICAgICAgIH0KKyAg ICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5kYXJ5X2JvdCwgUWxl ZnQpKQorICAgICAgICB7CisgICAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdFICgzLCBRYm90 dG9tLCBib3Rfcm93X2VuZHNfYXRfenZfcCk7CisgICAgICAgICAgaWYgKGJvdF9pbmRfbWF4X3kg Pj0gMCkKKyAgICAgICAgICAgIGxlZnRfb2Zmc2V0ID0gYm90X2luZF9tYXhfeSAtIChyb3ctPnkg KyByb3ctPnZpc2libGVfaGVpZ2h0KTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAoKCFyb3ct PnJldmVyc2VkX3AgJiYgTUFUUklYX1JPV19DT05USU5VQVRJT05fTElORV9QIChyb3cpKQorICAg ICAgICAgICAgICAgfHwgKHJvdy0+cmV2ZXJzZWRfcCAmJiByb3ctPmNvbnRpbnVlZF9wKSkKKyAg ICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdFICg0LCBRY29udGludWF0aW9uLCAwKTsKKyAgICAg IGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfZW1wdHlfbGluZV9wICYmIEVRIChlbXB0eV9wb3MsIFFs ZWZ0KSkKKyAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdFICg1LCBRZW1wdHlfbGluZSwgMCk7 CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX3RvcF9saW5lX3AgJiYgRVEgKGFycm93X3Rv cCwgUWxlZnQpKQorICAgICAgICB7CisgICAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdFICg2 LCBRdXAsIDApOworICAgICAgICAgIGlmICh0b3BfaW5kX21pbl95ID49IDApCisgICAgICAgICAg ICBsZWZ0X29mZnNldCA9IHRvcF9pbmRfbWluX3kgLSByb3ctPnk7CisgICAgICAgIH0KKyAgICAg IGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCAmJiBFUSAoYXJyb3dfYm90LCBR bGVmdCkpCisgICAgICAgIHsKKyAgICAgICAgICBsZWZ0ID0gTUNfTEVGVF9GUklOR0UgKDcsIFFk b3duLCAwKTsKKyAgICAgICAgICBpZiAoYm90X2luZF9tYXhfeSA+PSAwKQorICAgICAgICAgICAg bGVmdF9vZmZzZXQgPSBib3RfaW5kX21heF95IC0gKHJvdy0+eSArIHJvdy0+dmlzaWJsZV9oZWln aHQpOworICAgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIGxlZnQgPSBNQ19OT19GUklOR0Vf QklUTUFQOworICAgICAgLyogRGVjaWRlIHdoaWNoIGJpdG1hcCB0byBkcmF3IGluIHRoZSByaWdo dCBmcmluZ2UuICovCisgICAgICBpZiAoV0lORE9XX1JJR0hUX0ZSSU5HRV9XSURUSCAodykgPT0g MCkKKyAgICAgICAgcmlnaHQgPSBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgZWxzZSBpZiAo cm93LT5yaWdodF91c2VyX2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAg ICAgICAgeworICAgICAgICAgIHJpZ2h0ID0gcm93LT5yaWdodF91c2VyX2ZyaW5nZV9iaXRtYXA7 CisgICAgICAgICAgcmlnaHRfZmFjZV9pZCA9IHJvdy0+cmlnaHRfdXNlcl9mcmluZ2VfZmFjZV9p ZDsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAoKCFyb3ctPnJldmVyc2VkX3AgJiYgcm93LT50 cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgIHx8IChyb3ctPnJldmVyc2VkX3Ag JiYgcm93LT50cnVuY2F0ZWRfb25fbGVmdF9wKSkKKyAgICAgICAgcmlnaHQgPSBNQ19SSUdIVF9G UklOR0UgKDAsIFF0cnVuY2F0aW9uLCAwKTsKKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVf Ym9iX3AgJiYgRVEgKGJvdW5kYXJ5X3RvcCwgUXJpZ2h0KSkKKyAgICAgICAgeworICAgICAgICAg IHJpZ2h0ID0gKChyb3ctPmluZGljYXRlX2VvYl9wICYmIEVRIChib3VuZGFyeV9ib3QsIFFyaWdo dCkpCisgICAgICAgICAgICAgPyBNQ19SSUdIVF9GUklOR0UgKDEsIFF0b3BfYm90dG9tLCB0b3Bf cm93X2VuZHNfYXRfenZfcCkKKyAgICAgICAgICAgICA6IE1DX1JJR0hUX0ZSSU5HRSAoMiwgUXRv cCwgMCkpOworICAgICAgICAgIGlmICh0b3BfaW5kX21pbl95ID49IDApCisgICAgICAgICAgICBy aWdodF9vZmZzZXQgPSB0b3BfaW5kX21pbl95IC0gcm93LT55OworICAgICAgICB9CisgICAgICBl bHNlIGlmIChyb3ctPmluZGljYXRlX2VvYl9wICYmIEVRIChib3VuZGFyeV9ib3QsIFFyaWdodCkp CisgICAgICAgIHsKKyAgICAgICAgICByaWdodCA9IE1DX1JJR0hUX0ZSSU5HRSAoMywgUWJvdHRv bSwgYm90X3Jvd19lbmRzX2F0X3p2X3ApOworICAgICAgICAgIGlmIChib3RfaW5kX21heF95ID49 IDApCisgICAgICAgICAgICByaWdodF9vZmZzZXQgPSBib3RfaW5kX21heF95IC0gKHJvdy0+eSAr IHJvdy0+dmlzaWJsZV9oZWlnaHQpOworICAgICAgICB9CisgICAgICBlbHNlIGlmICgoIXJvdy0+ cmV2ZXJzZWRfcCAmJiByb3ctPmNvbnRpbnVlZF9wKQorICAgICAgICAgICAgICAgfHwgKHJvdy0+ cmV2ZXJzZWRfcCAmJiBNQVRSSVhfUk9XX0NPTlRJTlVBVElPTl9MSU5FX1AgKHJvdykpKQorICAg ICAgICByaWdodCA9IE1DX1JJR0hUX0ZSSU5HRSAoNCwgUWNvbnRpbnVhdGlvbiwgMCk7CisgICAg ICBlbHNlIGlmIChyb3ctPmluZGljYXRlX3RvcF9saW5lX3AgJiYgRVEgKGFycm93X3RvcCwgUXJp Z2h0KSkKKyAgICAgICAgeworICAgICAgICAgIHJpZ2h0ID0gTUNfUklHSFRfRlJJTkdFICg2LCBR dXAsIDApOworICAgICAgICAgIGlmICh0b3BfaW5kX21pbl95ID49IDApCisgICAgICAgICAgICBy aWdodF9vZmZzZXQgPSB0b3BfaW5kX21pbl95IC0gcm93LT55OworICAgICAgICB9CisgICAgICBl bHNlIGlmIChyb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3AgJiYgRVEgKGFycm93X2JvdCwgUXJp Z2h0KSkKKyAgICAgICAgeworICAgICAgICAgIHJpZ2h0ID0gTUNfUklHSFRfRlJJTkdFICg3LCBR ZG93biwgMCk7CisgICAgICAgICAgaWYgKGJvdF9pbmRfbWF4X3kgPj0gMCkKKyAgICAgICAgICAg IHJpZ2h0X29mZnNldCA9IGJvdF9pbmRfbWF4X3kgLSAocm93LT55ICsgcm93LT52aXNpYmxlX2hl aWdodCk7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfZW1wdHlfbGlu ZV9wICYmIEVRIChlbXB0eV9wb3MsIFFyaWdodCkpCisgICAgICAgIHJpZ2h0ID0gTUNfUklHSFRf RlJJTkdFICg1LCBRZW1wdHlfbGluZSwgMCk7CisgICAgICBlbHNlCisgICAgICAgIHJpZ2h0ID0g TUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgIHBlcmlvZGljX3AgPSAoZ2V0X2ZyaW5nZV9iaXRt YXBfZGF0YSAobGVmdCktPnBlcmlvZCAhPSAwCisgICAgICAgICAgICAgICAgICAgIHx8IGdldF9m cmluZ2VfYml0bWFwX2RhdGEgKHJpZ2h0KS0+cGVyaW9kICE9IDApOworICAgICAgaWYgKHJvdy0+ eSAhPSBjdXItPnkKKyAgICAgICAgICB8fCByb3ctPnZpc2libGVfaGVpZ2h0ICE9IGN1ci0+dmlz aWJsZV9oZWlnaHQ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A9IGZhbHNlOworICAgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICAgIGN1ci0+ZnJpbmdlX2JpdG1hcF9wZXJpb2RpY19wID0gcGVy aW9kaWNfcDsKKyAgICAgICAgICAgICAgaWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19O T19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgIGN1ci0+bGVmdF9mcmluZ2VfYml0bWFw ID0gbWNfbGVmdF9mcmluZ2VfYml0bWFwOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgICAgICAgIGN1ci0+bGVmdF9mcmluZ2VfYml0bWFwID0gbGVmdDsKKyAgICAgICAgICAgICAg aWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAg ICAgICAgICAgIGN1ci0+bGVmdF9mcmluZ2VfZmFjZV9pZCA9IG1jX2xlZnRfZnJpbmdlX2ZhY2Vf aWQ7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgY3VyLT5sZWZ0X2Zy aW5nZV9mYWNlX2lkID0gbGVmdF9mYWNlX2lkOworICAgICAgICAgICAgICBpZiAobWNfbGVmdF9m cmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgY3Vy LT5sZWZ0X2ZyaW5nZV9vZmZzZXQgPSAwOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgICAgICAgIGN1ci0+bGVmdF9mcmluZ2Vfb2Zmc2V0ID0gbGVmdF9vZmZzZXQ7CisgICAgICAg ICAgICAgIGlmIChtY19yaWdodF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVAp CisgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2VfYml0bWFwID0gbWNfcmlnaHRfZnJp bmdlX2JpdG1hcDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXIt PnJpZ2h0X2ZyaW5nZV9iaXRtYXAgPSByaWdodDsKKyAgICAgICAgICAgICAgaWYgKG1jX3JpZ2h0 X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICBj dXItPnJpZ2h0X2ZyaW5nZV9mYWNlX2lkID0gbWNfcmlnaHRfZnJpbmdlX2ZhY2VfaWQ7CisgICAg ICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2VfZmFj ZV9pZCA9IHJpZ2h0X2ZhY2VfaWQ7CisgICAgICAgICAgICAgIGlmIChtY19yaWdodF9mcmluZ2Vf Yml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgY3VyLT5yaWdo dF9mcmluZ2Vfb2Zmc2V0ID0gMDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAg ICAgICBjdXItPnJpZ2h0X2ZyaW5nZV9vZmZzZXQgPSByaWdodF9vZmZzZXQ7CisgICAgICAgICAg ICB9CisgICAgICAgIH0KKyAgICAgIGlmIChyb3ctPm92ZXJsYXlfYXJyb3dfYml0bWFwIDwgMCkK KyAgICAgICAgcm93LT5vdmVybGF5X2Fycm93X2JpdG1hcCA9IG1jX2dldF9sb2dpY2FsX2ZyaW5n ZV9iaXRtYXAgKHcsIFFvdmVybGF5X2Fycm93LCAwLCAwKTsKKyAgICAgIGlmIChyb3ctPm92ZXJs YXlfYXJyb3dfYml0bWFwICE9IGN1ci0+b3ZlcmxheV9hcnJvd19iaXRtYXApCisgICAgICAgIHsK KyAgICAgICAgICByZWRyYXdfcCA9IDEsIHJvdy0+cmVkcmF3X2ZyaW5nZV9iaXRtYXBzX3AgPSAx OworICAgICAgICAgIGlmICgha2VlcF9jdXJyZW50X3ApCisgICAgICAgICAgICB7CisgICAgICAg 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XRjaCAoZmItPmFsaWduKQorICAgIHsKKyAgICBjYXNl IEFMSUdOX0JJVE1BUF9DRU5URVI6CisgICAgICBwLnkgKz0gKHJvdy0+aGVpZ2h0IC0gcC5oKSAv IDI7CisgICAgICBicmVhazsKKyAgICBjYXNlIEFMSUdOX0JJVE1BUF9CT1RUT006CisgICAgICBw LnkgKz0gKHJvdy0+dmlzaWJsZV9oZWlnaHQgLSBwLmgpOworICAgICAgYnJlYWs7CisgICAgY2Fz ZSBBTElHTl9CSVRNQVBfVE9QOgorICAgICAgYnJlYWs7CisgICAgfQorICBwLmZhY2UgPSBGQUNF X0ZST01fSUQgKGYsIGZhY2VfaWQpOworICBpZiAocC5mYWNlID09IE5VTEwpCisgICAgeworICAg ICAgLyogVGhpcyBjb3VsZCBoYXBwZW4gYWZ0ZXIgY2xlYXJpbmcgZmFjZSBjYWNoZS4KKyAgICAg IEJ1dCBpdCBzaG91bGRuJ3QgaGFwcGVuIGFueW1vcmUuICArK2tmcyAqLworICAgICAgcmV0dXJu OworICAgIH0KKyAgcHJlcGFyZV9mYWNlX2Zvcl9kaXNwbGF5IChmLCBwLmZhY2UpOworICAvKiBD bGVhciBsZWZ0IGZyaW5nZSBpZiBubyBiaXRtYXAgdG8gZHJhdyBvciBpZiBiaXRtYXAgZG9lc24n dCBmaWxsCisgICAgIHRoZSBmcmluZ2UuICovCisgIHAuYnggPSAtMTsKKyAgaGVhZGVyX2xpbmVf aGVpZ2h0ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgIHAuYnkgPSBXSU5ET1df VE9fRlJBTUVfUElYRUxfWSAodywgbWF4IChoZWFkZXJfbGluZV9oZWlnaHQsIHJvdy0+eSkpOwor ICBwLm55ID0gcm93LT52aXNpYmxlX2hlaWdodDsKKyAgaWYgKGxlZnRfcCkKKyAgICB7CisgICAg ICBpbnQgd2QgPSBXSU5ET1dfTEVGVF9GUklOR0VfV0lEVEggKHcpOworICAgICAgaW50IHggPSB3 aW5kb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Ym9yZGVyLAorICAgICAgICAgICAg ICAgYW5kIE9UT0ggbGVhdmluZyBvdXQgdGhhdCBvbmUgcGl4ZWwgbGVhdmVzIGJlaGluZAorICAg ICAgICAgICAgICAgdHJhY2VzIG9mIHRoZSBjdXJzb3IsIGlmIGl0IHdhcyBpbiBjb2x1bW4gemVy bworICAgICAgICAgICAgICAgYmVmb3JlIGRyYXdpbmcgbm9uLWVtcHR5IG1hcmdpbiBhcmVhLiAq LworICAgICAgICAgICAgJiYgdy0+bGVmdF9tYXJnaW5fY29scyA9PSAwKQorICAgICAgICAgICA/ IDEgOiAwKTsKKyAgICAgICAgICBwLmJ4ID0geCAtIHdkOworICAgICAgICAgIHAubnggPSB3ZDsK KyAgICAgICAgfQorICAgIH0KKyAgZWxzZQorICAgIHsKKyAgICAgIGludCB4ID0gd2luZG93X2Jv eF9yaWdodCAodywKKyAgICAgICAgKFdJTkRPV19IQVNfRlJJTkdFU19PVVRTSURFX01BUkdJTlMg KHcpCisgICAgICAgICA/IFJJR0hUX01BUkdJTl9BUkVBCisgICAgICAgICA6IFRFWFRfQVJFQSkp OworICAgICAgaW50IHdkID0gV0lORE9XX1JJR0hUX0ZSSU5HRV9XSURUSCAodyk7CisgICAgICBp ZiAocC53ZCA+IHdkKQorICAgICAgICBwLndkID0gd2Q7CisgICAgICBwLnggPSB4ICsgKHdkIC0g cC53ZCkgLyAyOworICAgICAgLyogQ2xlYXIgcmlnaHQgZnJpbmdlIGlmIG5vIGJpdG1hcCB0byBk cmF3IG9mIGlmIGJpdG1hcCBkb2Vzbid0IGZpbGwKKyAgIHRoZSBmcmluZ2UuICovCisgICAgICBp ZiAocC53ZCA8IHdkIHx8IHAueSA+IHAuYnkgfHwgcC55ICsgcC5oIDwgcC5ieSArIHAubnkpCisg ICAgICAgIHsKKyAgICAgICAgICBwLmJ4ID0geDsKKyAgICAgICAgICBwLm54ID0gd2Q7CisgICAg ICAgIH0KKyAgICB9CisgIGlmIChwLnggPj0gV0lORE9XX0JPWF9MRUZUX0VER0VfWCAodykKKyAg ICAgICYmIChwLnggKyBwLndkKSA8PSBXSU5ET1dfQk9YX0xFRlRfRURHRV9YICh3KSArIFdJTkRP V19QSVhFTF9XSURUSCAodykpCisgICAgRlJBTUVfUklGIChmKS0+ZHJhd19mcmluZ2VfYml0bWFw ICh3LCByb3csICZwKTsKK30KKwordm9pZAorbWNfZHJhd19mcmluZ2VfYml0bWFwIChzdHJ1Y3Qg d2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCBsZWZ0X3AsIGVudW0gbWNfY3Vy c29yX3R5cGUgY3Vyc29yX3R5cGUpCit7CisgIGludCBvdmVybGF5ID0gMDsKKyAgaWYgKGxlZnRf cCA9PSByb3ctPnJldmVyc2VkX3AgJiYgcm93LT5jdXJzb3JfaW5fZnJpbmdlX3ApCisgICAgewor ICAgICAgTGlzcF9PYmplY3QgY3Vyc29yID0gUW5pbDsKKyAgICAgIHN3aXRjaCAoY3Vyc29yX3R5 cGUpCisgICAgICAgIHsKKyAgICAgICAgY2FzZSBNQ19GUkFNRURfQk9YOgorICAgICAgICAgIGlm IChyb3ctPnZpc2libGVfaGVpZ2h0ID49IFNUQU5EQVJEX0JJVE1BUF9IRUlHSFQgKGhvbGxvd19y ZWN0YW5nbGVfYml0cykpCisgICAgICAgICAgICBjdXJzb3IgPSBRaG9sbG93OworICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgIGN1cnNvciA9IFFob2xsb3dfc21hbGw7CisgICAgICAgICAgYnJl YWs7CisgICAgICAgIGNhc2UgTUNfSE9MTE9XX0JPWDoKKyAgICAgICAgICBpZiAocm93LT52aXNp YmxlX2hlaWdodCA+PSBTVEFOREFSRF9CSVRNQVBfSEVJR0hUIChob2xsb3dfcmVjdGFuZ2xlX2Jp dHMpKQorICAgICAgICAgICAgY3Vyc29yID0gUWhvbGxvdzsKKyAgICAgICAgICBlbHNlCisgICAg ICAgICAgICBjdXJzb3IgPSBRaG9sbG93X3NtYWxsOworICAgICAgICAgIGJyZWFrOworICAgICAg ICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAgICAgICAgY3Vyc29yID0gUWJveDsKKyAgICAgICAg ICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19CQVI6CisgICAgICAgICAgY3Vyc29yID0gUWJhcjsK KyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19IQkFSOgorICAgICAgICAgIGN1cnNv ciA9IFFoYmFyOworICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1DX05PX0ZSSU5HRV9C SVRNQVA6CisgICAgICAgIGNhc2UgTUNfTk9fQ1VSU09SOgorICAgICAgICBjYXNlIE1DX1JJR0hU X0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGNhc2UgTUNfTEVGVF9GUklOR0VfQklUTUFQOgorICAg ICAgICBkZWZhdWx0OgorICAgICAgICAgIHctPnBoeXNfY3Vyc29yX29uX3AgPSAwOworICAgICAg ICAgIHJvdy0+Y3Vyc29yX2luX2ZyaW5nZV9wID0gMDsKKyAgICAgICAgICBicmVhazsKKyAgICAg ICAgfQorICAgICAgaWYgKCFOSUxQIChjdXJzb3IpKQorICAgICAgICB7CisgICAgICAgICAgaW50 IGJtID0gbWNfZ2V0X2xvZ2ljYWxfY3Vyc29yX2JpdG1hcCAodywgY3Vyc29yKTsKKyAgICAgICAg ICBpZiAoYm0gIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgbWNfZHJhd19mcmluZ2VfYml0bWFwXzEgKHcsIHJvdywgbGVmdF9wLCAyLCBibSk7Cisg ICAgICAgICAgICAgIG92ZXJsYXkgPSBFUSAoY3Vyc29yLCBRYm94KSA/IDMgOiAxOworICAgICAg ICAgICAgfQorICAgICAgICB9CisgICAgfQorICBtY19kcmF3X2ZyaW5nZV9iaXRtYXBfMSAodywg cm93LCBsZWZ0X3AsIG92ZXJsYXksIE1DX05PX0ZSSU5HRV9CSVRNQVApOworICBpZiAobGVmdF9w ICYmIHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAg ICBtY19kcmF3X2ZyaW5nZV9iaXRtYXBfMSAodywgcm93LCAxLCAxLCByb3ctPm92ZXJsYXlfYXJy b3dfYml0bWFwKTsKK30KKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKICNkZWZpbmUgTk9fRlJJTkdFX0JJVE1BUCAwCiAjZGVmaW5lIFVO REVGX0ZSSU5HRV9CSVRNQVAgMQogI2RlZmluZSBNQVhfU1RBTkRBUkRfRlJJTkdFX0JJVE1BUFMg QVJSQVlFTFRTIChzdGFuZGFyZF9iaXRtYXBzKQpAQCAtMTY5OSw2ICszMjE3LDE2OCBAQCBSZXR1 cm4gbmlsIGlmIFBPUyBpcyBub3QgdmlzaWJsZSBpbiBXSU5ET1cuICAqLykKIHZvaWQKIHN5bXNf b2ZfZnJpbmdlICh2b2lkKQogeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogYmVn aW4gTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8qIChnZXQgJ2VtcHR5LWxpbmUgJ2ZyaW5nZSkg PT4gMjMgPT4gdGhlIGxhc3Qgc3RhbmRhcmQtYml0bWFwIGJlZm9yZSB0aGlzIG9uZS4KKyAgU2Vl IGBmcmluZ2UuZWxgLiAqLworCisgIC8qIDI0ICovCisgIERFRlNZTSAoUW1jX3ZlcnRpY2FsX2Jh cl9yaWdodF9hcnJvdywgIistdmVydGljYWwtYmFyLXJpZ2h0LWFycm93Iik7CisgIFZmcmluZ2Vf Yml0bWFwcyA9IEZjb25zIChRb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ml0bWFwcyk7CisgIEZwdXQgKFFtY190cmlwbGVfYW5nbGVfZG93biwgUWZyaW5nZSwg bWFrZV9maXhudW0gKDQ2KSk7CisgIC8qIChnZXQgJystdHJpcGxlLWFuZ2xlLWRvd24gJ2ZyaW5n ZSkgPT4gNDYgKi8KKworICAvKiA0NyAqLworICBERUZTWU0gKFFtY19xdWFkcnVwbGVfYW5nbGVf dXAsICIrLXF1YWRydXBsZS1hbmdsZS11cCIpOworICBWZnJpbmdlX2JpdG1hcHMgPSBGY29ucyAo UW1jX3F1YWRydXBsZV9hbmdsZV91cCwgVmZyaW5nZV9iaXRtYXBzKTsKKyAgRnB1dCAoUW1jX3F1 YWRydXBsZV9hbmdsZV91cCwgUWZyaW5nZSwgbWFrZV9maXhudW0gKDQ3KSk7CisgIC8qIChnZXQg JystcXVhZHJ1cGxlLWFuZ2xlLXVwICdmcmluZ2UpID0+IDQ3ICovCisKKyAgLyogNDggKi8KKyAg REVGU1lNIChRbWNfcXVhZHJ1cGxlX2FuZ2xlX2Rvd24sICIrLXF1YWRydXBsZS1hbmdsZS1kb3du Iik7CisgIFZmcmluZ2VfYml0bWFwcyA9IEZjb25zIChRbWNfcXVhZHJ1cGxlX2FuZ2xlX2Rvd24s IFZmcmluZ2VfYml0bWFwcyk7CisgIEZwdXQgKFFtY19xdWFkcnVwbGVfYW5nbGVfZG93biwgUWZy aW5nZSwgbWFrZV9maXhudW0gKDQ4KSk7CisgIC8qIChnZXQgJystcXVhZHJ1cGxlLWFuZ2xlLWRv d24gJ2ZyaW5nZSkgPT4gNDggKi8KKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICAgREVGU1lNIChRdHJ1bmNhdGlvbiwgInRydW5jYXRp b24iKTsKICAgREVGU1lNIChRY29udGludWF0aW9uLCAiY29udGludWF0aW9uIik7CiAgIERFRlNZ TSAoUW92ZXJsYXlfYXJyb3csICJvdmVybGF5LWFycm93Iik7CmRpZmYgLS1naXQgYS9zcmMvbnN0 ZXJtLmggYi9zcmMvbnN0ZXJtLmgKaW5kZXggOTc3M2ViMy4uZTM0YTExNiAxMDA2NDQKLS0tIGEv c3JjL25zdGVybS5oCisrKyBiL3NyYy9uc3Rlcm0uaApAQCAtNjYzLDYgKzY2MywxNiBAQCB0eXBl ZGVmIGlkIGluc3RhbmNldHlwZTsKIAogQGludGVyZmFjZSBFbWFjc1Njcm9sbGVyIDogTlNTY3Jv bGxlcgogICB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJT T1JTICovCisKKyAgICBOU1JlY3QgbWNfcmVjdGFuZ2xlOworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKworCiAgICBzdHJ1Y3Qgd2luZG93ICp3aW5kb3c7CiAgICBzdHJ1Y3QgZnJhbWUgKmZy YW1lOwogICAgTlNSZXNwb25kZXIgKnByZXZSZXNwb25kZXI7CkBAIC02ODMsNiArNjkzLDE4IEBA IHR5cGVkZWYgaWQgaW5zdGFuY2V0eXBlOwogICAgaW50IGVtX3dob2xlOwogICAgfQogCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCistICh2b2lk KW1jX3NldF9yZWN0YW5nbGU6IChOU1JlY3QpcmVjdDsKKy0gKE5TUmVjdCltY19nZXRfcmVjdGFu Z2xlOworLSAoc3RydWN0IHdpbmRvdyAqKW1jX2dldF93aW5kb3c7CistIChib29sKW1jX2p1ZGdl OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAtIChpbnN0YW5jZXR5cGUpIGluaXRG cmFtZTogKE5TUmVjdCApciB3aW5kb3c6IChMaXNwX09iamVjdCl3aW47CiAtICh2b2lkKXNldEZy YW1lOiAoTlNSZWN0KXI7CiAKZGlmZiAtLWdpdCBhL3NyYy9uc3Rlcm0ubSBiL3NyYy9uc3Rlcm0u bQppbmRleCAwMjMzMTgyLi5iNzA4ZTk0IDEwMDY0NAotLS0gYS9zcmMvbnN0ZXJtLm0KKysrIGIv c3JjL25zdGVybS5tCkBAIC03Niw2ICs3Niw5NzUgQEAgVXBkYXRlZCBieSBDaHJpc3RpYW4gTGlt cGFjaCAoY2hyaXNAbmljZS5jaCkKIHN0YXRpYyBFbWFjc01lbnUgKm1haW5NZW51OwogI2VuZGlm CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JT ICovCisKK3N0YXRpYyBCT09MIG5zX2NsaXBfdG9fcmVjdCAoc3RydWN0IGZyYW1lICosIE5TUmVj dCAqLCBpbnQpOworCitzdGF0aWMgdm9pZCBuc19yZXNldF9jbGlwcGluZyAoc3RydWN0IGZyYW1l ICopOworCitzdGF0aWMgdm9pZCBuc19kdW1wZ2x5cGhzX2JveF9vcl9yZWxpZWYgKHN0cnVjdCBn bHlwaF9zdHJpbmcgKik7CisKK3N0YXRpYyB2b2lkIG5zX2RyYXdfY29tcG9zaXRlX2dseXBoX3N0 cmluZ19mb3JlZ3JvdW5kIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICopOworCitzdGF0aWMgaW50IG5z X2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICosIE5hdGl2 ZV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ZV90eXBlIDwgTk9f Q0FDSEU7CisgICAgICAgKytjYWNoZV90eXBlKQorICAgIHsKKyAgICAgIGZvciAoaW50IG50aCA9 IDA7CisgICAgICAgICAgIHMKKyAgICAgICAgICAgJiYgbWNfdHJhdmVyc2VfY2FjaGVfcCAocy0+ dy0+bWNfbWF0cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGgpOworICAgICAgICAgICArK250aCkK KyAgICAgICAgeworICAgICAgICAgIC8vICBpbnQgeCA9IHMtPnctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ueDsKKyAgICAgICAgICBpbnQgZnggPSBzLT53LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZ4OworICAgICAgICAg IC8vICBpbnQgeSA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF0ueTsKKyAgICAgICAgICBpbnQgZnkgPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLmZ5OworICAgICAgICAgIGludCBocG9zID0gcy0+dy0+bWNf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5ocG9zOworICAgICAgICAg IGludCB2cG9zID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXS52cG9zOworICAgICAgICAgIGludCB3ZCA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF0ud2Q7CisgICAgICAgICAgaW50IGggPSBzLT53LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmg7CisgICAgICAgICAgZW51 bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF0uY3Vyc29yX3R5cGU7CisgICAgICAgICAgLy8gIGludCBj dXJzb3Jfd2lkdGggPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLmN1cnNvcl93aWR0aDsKKyAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZyA9IHsu cmVkID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5m Zy5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gcy0+dy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5mZy5ncmVlbiwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IHMtPnctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZmcuYmx1ZX07CisgICAgICAgICAgLy8g IHN0cnVjdCBtY19SR0IgbHNsX2JnID0gey5yZWQgPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLnJlZCwKKyAgICAgICAgICAvLyAgICAgICAgICAg ICAgICAgICAgICAgICAgLmdyZWVuID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXS5iZy5ncmVlbiwKKyAgICAgICAgICAvLyAgICAgICAgICAgICAgICAg ICAgICAgICAgLmJsdWUgPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhdLmJnLmJsdWV9OworICAgICAgICAgIGJvb2wgYWN0aXZlX3AgPSBzLT53LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmFjdGl2ZV9wOworICAgICAg ICAgIC8vICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSBzLT53LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoX2ZsYXZvcjsKKyAgICAgICAgICBi b29sIGVuYWJsZWRfcCA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF0uZW5hYmxlZF9wOworICAgICAgICAgIGJvb2wgZ29fcCA9ICh2cG9zID09IHZudGgK KyAgICAgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA9PSBjdXJzb3JfZ2x5cGgtPmhwb3MKKyAg ICAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKTsKKyAgICAgICAgICBpZiAoIWdvX3Ap CisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICBOU1JlY3QgcjsKKyAgICAgICAgICBy Lm9yaWdpbi54ID0gZng7CisgICAgICAgICAgci5vcmlnaW4ueSA9IGZ5OworICAgICAgICAgIHIu c2l6ZS5oZWlnaHQgPSBoOworICAgICAgICAgIHIuc2l6ZS53aWR0aCA9IHdkOworICAgICAgICAg IFtbTlNDb2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiBsc2xfZmcucmVkCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JlZW46IGxzbF9mZy5ncmVlbgorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBibHVlOiBsc2xfZmcuYmx1ZQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscGhhOiAxLjBdIHNldF07CisgICAgICBpZiAo Y3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVj dCBidWZmZXIgKmIgPSBYQlVGRkVSIChzLT53LT5jb250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ZSksIHMtPmYpOworICAgICAgICAgICAgICBob2xsb3dfY29sb3IgPSBob2xsb3dfYWN0 aXZlX3JlZ2lvbl9iZWdfY29sb3I7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlm IChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9wCisgICAg ICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3MgPT0gcmVnaW9uX2VuZCkK KyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0 aXZlX3JlZ2lvbl9lbmRfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlIChzLT53LCBzLT5mLCBp bnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItYXQtcmVnaW9uLXByZS16di1mYWNlIiksIHRydWUp OworICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRf ZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2Vf aWQpOworICAgICAgICAgICAgICAgIE5TQ29sb3IgKmhvbGxvd19hY3RpdmVfcmVnaW9uX2VuZF9j b2xvciA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGhvbGxv d19hY3RpdmVfcmVnaW9uX2VuZF9mYWNlKSwgcy0+Zik7CisgICAgICAgICAgICAgICAgaG9sbG93 X2NvbG9yID0gaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2NvbG9yOworICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAgIGVsc2UgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAg ICAgICAgICAmJiBhY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5 cGgtPmNoYXJwb3MgPiByZWdpb25fYmVnCisgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNv cl9nbHlwaC0+Y2hhcnBvcyA8IHJlZ2lvbl9lbmQpCisgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFj ZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlIChzLT53LCBzLT5mLCBpbnRlcm4gKCIrLXJlYWwtZmFr ZS1jdXJzb3ItaW4tcmVnaW9uLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAg ICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZSA9IEZBQ0Vf RlJPTV9JRCAocy0+ZiwgaG9sbG93X2FjdGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNlX2lkKTsKKyAg ICAgICAgICAgICAgICAgIE5TQ29sb3IgKmhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fY29s b3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChob2xsb3df YWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2UpLCBzLT5mKTsKKyAgICAgICAgICAgICAgICAgIGhv bGxvd19jb2xvciA9IGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fY29sb3I7CisgICAgICAg ICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYgKGFjdGl2ZV9wKQorICAgICAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2 ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAoIistcmVh bC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAg c3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgaG9s bG93X2FjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAgTlNDb2xvciAqaG9sbG93 X2FjdGl2ZV9jb2xvciA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9V TkQgKGhvbGxvd19hY3RpdmVfZmFjZSksIHMtPmYpOworICAgICAgICAgICAgICAgICAgICBob2xs b3dfY29sb3IgPSBob2xsb3dfYWN0aXZlX2NvbG9yOworICAgICAgICAgICAgICAgICAgfQorICAg ICAgICAgICAgICAgICAgZWxzZSBpZiAoIWFjdGl2ZV9wKQorICAgICAgICAgICAgICAgICAgICB7 CisgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNl X2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAoIistcmVhbC1mYWtl LWN1cnNvci1pbmFjdGl2ZS1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAg ICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2luYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKHMt PmYsIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAgICBOU0Nv bG9yICpob2xsb3dfaW5hY3RpdmVfY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNf RkFDRV9CQUNLR1JPVU5EIChob2xsb3dfaW5hY3RpdmVfZmFjZSksIHMtPmYpOworICAgICAgICAg ICAgICAgICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19pbmFjdGl2ZV9jb2xvcjsKKyAgICAg ICAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKGZhY2UgJiYgTlNf RkFDRV9CQUNLR1JPVU5EIChmYWNlKSA9PSBuc19pbmRleF9jb2xvciAoRlJBTUVfQ1VSU09SX0NP TE9SIChzLT5mKSwgcy0+ZikpCisgICAgICAgICAgeworICAgICAgICAgICAgW25zX2xvb2t1cF9p bmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQgKGZhY2UpLCBzLT5mKSBzZXRdOworICAg ICAgICAgICAgaG9sbG93X2NvbG9yID0gRlJBTUVfQ1VSU09SX0NPTE9SIChzLT5mKTsKKyAgICAg ICAgICB9CisgICAgICAgICAgc3dpdGNoIChjdXJzb3JfdHlwZSkKKyAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgY2FzZSBNQ19OT19GUklOR0VfQklUTUFQOgorICAgICAgICAgICAgICAgIGJy ZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX05PX0NVUlNPUjoKKyAgICAgICAgICAgICAgICBi cmVhazsKKyAgICAgICAgICAgICAgY2FzZSBNQ19SSUdIVF9GUklOR0VfQklUTUFQOgorICAgICAg ICAgICAgICBjYXNlIE1DX0xFRlRfRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgICAgICAgY2FzZSBN Q19GSUxMRURfQk9YOgorICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAg ICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX0ZSQU1FRF9CT1g6CisgICAgICAg ICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAgICAgICAgW2hvbGxvd19jb2xvciBz ZXRdOworICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKE5TSW5zZXRSZWN0IChyLCAxLCAxKSk7 CisgICAgICAgICAgICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAocy0+Zikgc2V0XTsKKyAgICAg ICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSBNQ19IT0xMT1dfQk9YOgorICAg ICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAgICAgIFtob2xsb3dfY29s b3Igc2V0XTsKKyAgICAgICAgICAgICAgICBOU1JlY3RGaWxsIChOU0luc2V0UmVjdCAociwgMSwg MSkpOworICAgICAgICAgICAgICAgIFtGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpIHNldF07Cisg ICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgTUNfSEJBUjoKKyAgICAg ICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAg ICAgICAgICAgY2FzZSBNQ19CQVI6CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7Cisg ICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgLyogSWYgYSBn bHlwaCBleGlzdHMgKHMtPmNoYXIyYiAhPSBOVUxMKSwgdGhlbiBkcmF3IHRoZSBnbHlwaCBvbiB0 b3Agb2YgdGhlCisgICAgICAgICAgbmV3bHkgZHJhd24gcmVjdGFuZ2xlIHRoYXQgd2FzIGNyZWF0 ZWQgaGVyZWluYWJvdmUuICBUbyB0aGUgZXh0ZW50IHRoYXQgd2UKKyAgICAgICAgICB3YW50IHRv IGRvdWJsZS1pbXByaW50IGdseXBocyB0byBtYWtlIHRoZW0gYXBwZWFyIHRvIGJlIHNlbWktYm9s ZCwgaXQgY2FuCisgICAgICAgICAgYmUgZG9uZSBoZXJlIGZvciBhbGwgY3Vyc29yIHR5cGVzLiAg VGhlIGJveC1zdHlsZSBjdXJzb3JzIGFyZSBpbXByaW50ZWQKKyAgICAgICAgICB3aXRoIGdseXBo cyBvbmx5IG9uZSAoMSkgdGltZS4gIFRoZSBzZW1pLWJvbGQgYXBwZWFyYW5jZSBpcyBoZWxwZnVs IHdoZW4KKyAgICAgICAgICBkZWJ1Z2dpbmcgdG8gc2VlIHRoYXQgdGhlIGNvb3JkaW5hdGVzIGFy ZSBjb3JyZWN0LiAqLworICAgICAgICAgIGlmIChzLT5jaGFyMmIgIT0gTlVMTAorICAgICAgICAg ICAgICAmJiAoY3Vyc29yX3R5cGUgPT0gTUNfRklMTEVEX0JPWAorICAgICAgICAgICAgICAgICAg fHwgY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWAorICAgICAgICAgICAgICAgICAgfHwgY3Vy c29yX3R5cGUgPT0gTUNfSE9MTE9XX0JPWCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAg IEJPT0wgaXNDb21wb3NpdGUgPSBzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZ UEg7CisgICAgICAgICAgICAgIGlmIChpc0NvbXBvc2l0ZSkKKyAgICAgICAgICAgICAgICBuc19k cmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAgICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qg Zm9udCAqZm9udCA9IHMtPmZhY2UtPmZvbnQ7CisgICAgICAgICAgICAgICAgICAgIGlmICghZm9u dCkKKyAgICAgICAgICAgICAgICAgICAgICBmb250ID0gRlJBTUVfRk9OVCAocy0+Zik7CisgICAg ICAgICAgICAgICAgICAgIGJvb2wgd2l0aF9iZ19wID0gZmFsc2U7CisgICAgICAgICAgICAgICAg ICAgIGZvbnQtPmRyaXZlci0+ZHJhdyAocywgcy0+Y21wX2Zyb20sIHMtPm5jaGFycywgcy0+eCwg cy0+eWJhc2UsIHdpdGhfYmdfcCk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9 CisgICAgICAgIH0KKyAgICB9CisgIC8vICBjbG9ja190IGNsb2NrX2VuZCA9IGNsb2NrKCk7Cisg IC8vICBkb3VibGUgY3B1X3RpbWVfdXNlZCA9ICgoZG91YmxlKSAoY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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGdyZWVuOiAxLjAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBibHVlOiAxLjAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGFscGhhOiAxLjBdOworICAtICBBTFRFUk5BVElWRSBFWEFN UExFOgorICAgICBlbnVtIGZhY2VfaWQgZGVidWdnaW5nX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRf ZmFjZSAocy0+dywgcy0+ZiwgaW50ZXJuICgiKy1kZWJ1Z2dpbmctZmFjZSIpLCB0cnVlKTsKKyAg ICAgc3RydWN0IGZhY2UgKmRlYnVnZ2luZ19mYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBkZWJ1 Z2dpbmdfZmFjZV9pZCk7CisgICAgIE5TQ29sb3IgKmNvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRf Y29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoZGVidWdnaW5nX2ZhY2UpLCBzLT5mKTsKKyAgICAg W2NvbG9yIHNldF07ICovCisgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEgKKyAgICAgIHx8 IGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSExFU1MpCisgICAgW1tOU0NvbG9yIGNvbG9yV2l0aENh bGlicmF0ZWRSZWQ6IGxzbC5yZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBncmVl bjogbHNsLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJsdWU6IGxzbC5i bHVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwaGE6IDEuMF0gc2V0XTsKKyAg ICBlbHNlCisgICAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChmKSBzZXRdOworICBpZiAoY3Vyc29y X3R5cGUgPT0gTUNfRlJBTUVEX0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TX0ZBQ0VfQkFDS0dST1VORCAoZmFjZSkgPT0gbnNfaW5kZXhfY29s b3IgKEZSQU1FX0NVUlNPUl9DT0xPUiAoZiksIGYpKQorICAgICAgeworICAgICAgICBbbnNfbG9v a3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoZmFjZSksIGYpIHNldF07Cisg ICAgICAgIGhvbGxvd19jb2xvciA9IEZSQU1FX0NVUlNPUl9DT0xPUiAoZik7CisgICAgICB9Cisj aWZkZWYgTlNfSU1QTF9DT0NPQQorICBOU0Rpc2FibGVTY3JlZW5VcGRhdGVzICgpOworI2VuZGlm CisgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgeworICAgICAgY2FzZSBNQ19OT19GUklOR0Vf QklUTUFQOgorICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfTk9fQ1VSU09SOgorICAgICAg ICBicmVhazsKKyAgICAgIGNhc2UgTUNfUklHSFRfRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgYnJl YWs7CisgICAgICBjYXNlIE1DX0xFRlRfRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgYnJlYWs7Cisg ICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAg ICBicmVhazsKKyAgICAgIGNhc2UgTUNfRlJBTUVEX0JPWDoKKyAgICAgICAgTlNSZWN0RmlsbCAo cik7CisgICAgICAgIFtob2xsb3dfY29sb3Igc2V0XTsKKyAgICAgICAgTlNSZWN0RmlsbCAoTlNJ bnNldFJlY3QgKHIsIDEsIDEpKTsKKyAgICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAoZikgc2V0 XTsKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1DX0hPTExPV19CT1g6CisgICAgICAgIE5T UmVjdEZpbGwgKHIpOworICAgICAgICBbaG9sbG93X2NvbG9yIHNldF07CisgICAgICAgIE5TUmVj dEZpbGwgKE5TSW5zZXRSZWN0IChyLCAxLCAxKSk7CisgICAgICAgIFtGUkFNRV9DVVJTT1JfQ09M T1IgKGYpIHNldF07CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19IQkFSOgorICAgICAg ICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1DX0JBUjoKKyAg ICAgICAgcyA9IHI7CisgICAgICAgIC8qIEBsYXdsaXN0IGlzIGZvY3VzaW5nIHRoZSBpbml0aWFs IGRldmVsb3BtZW50IG9mIGZlYXR1cmUgcmVxdWVzdHMKKyAgICAgICAgIzE3Njg0IGFuZCAjMjI4 NzMgb24gTDJSIGxhbmd1YWdlcy4gKi8KKyAgICAgICAgaWYgKGdseXBoX2ZsYXZvciAhPSBNQ19H TFlQSAorICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX0dMWVBITEVTUykKKyAgICAg ICAgICB7CisgICAgICAgICAgICAvKiBJZiB0aGUgY2hhcmFjdGVyIHVuZGVyIGN1cnNvciBpcyBS MkwsIGRyYXcgdGhlIGJhciBjdXJzb3IKKyAgICAgICAgICAgICAgIG9uIHRoZSByaWdodCBvZiBp dHMgZ2x5cGgsIHJhdGhlciB0aGFuIG9uIHRoZSBsZWZ0LiAqLworICAgICAgICAgICAgaWYgKChj dXJzb3JfZ2x5cGgtPnJlc29sdmVkX2xldmVsICYgMSkgIT0gMCkKKyAgICAgICAgICAgICAgcy5v cmlnaW4ueCArPSBjdXJzb3JfZ2x5cGgtPnBpeGVsX3dpZHRoIC0gcy5zaXplLndpZHRoOworICAg ICAgICAgIH0KKyAgICAgICAgTlNSZWN0RmlsbCAocyk7CisgICAgICAgIGJyZWFrOworICAgIH0K KyAgbnNfcmVzZXRfY2xpcHBpbmcgKGYpOworICAvKiBkcmF3IHRoZSBjaGFyYWN0ZXIgdW5kZXIg dGhlIGN1cnNvciAqLworICBpZiAoZ2x5cGhfZmxhdm9yICE9IE1DX0dMWVBITEVTUworICAgICAg JiYgKGN1cnNvcl90eXBlID09IE1DX0ZSQU1FRF9CT1gKKyAgICAgICAgICB8fCBjdXJzb3JfdHlw ZSA9PSBNQ19GSUxMRURfQk9YCisgICAgICAgICAgfHwgY3Vyc29yX3R5cGUgPT0gTUNfSE9MTE9X X0JPWAorICAgICAgICAgIHx8IChkZWJ1Z19wCisgICAgICAgICAgICAgICYmIGN1cnNvcl90eXBl ID09IE1DX0hCQVIpCisgICAgICAgICAgfHwgKGRlYnVnX3AKKyAgICAgICAgICAgICAgJiYgY3Vy c29yX3R5cGUgPT0gTUNfQkFSKSkpCisgICAgeworICAgICAgLyogYGN1cnNvcl9nY19wYCBpcyB1 c2VkIG9ubHkgYnkgYHczMnRlcm0uY2AgYW5kIGB4dGVybS5jJy4gKi8KKyAgICAgIGJvb2wgY3Vy c29yX2djX3AgPSBmYWxzZTsKKyAgICAgIGNvbnN0IEVtYWNzX1JlY3RhbmdsZSAqc2F2ZWRfY2xp cCA9IE5VTEw7CisgICAgICBpZiAocm93LT5jbGlwICE9IE5VTEwpCisgICAgICAgIHsKKyAgICAg ICAgICBzYXZlZF9jbGlwID0gcm93LT5jbGlwOworICAgICAgICAgIHJvdy0+Y2xpcCA9IE5VTEw7 CisgICAgICAgIH0KKyAgICAgIG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywg RFJBV19DVVJTT1IsIHgsIGhwb3MsIHZwb3MsIGxzbCwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsIGN1cnNvcl9nY19w KTsKKyAgICAgIGlmIChzYXZlZF9jbGlwICE9IE5VTEwpCisgICAgICAgIHJvdy0+Y2xpcCA9IHNh dmVkX2NsaXA7CisgICAgfQorI2lmZGVmIE5TX0lNUExfQ09DT0EKKyAgTlNFbmFibGVTY3JlZW5V cGRhdGVzICgpOworI2VuZGlmCit9CisK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xJ TkUpCisgICAgICAgICAgeworICAgICAgICAgICAgTlNSZWN0IHI7CisgICAgICAgICAgICB1bnNp Z25lZCBsb25nIHRoaWNrbmVzcywgcG9zaXRpb247CisgICAgICAgICAgICAvKiBJZiB0aGUgcHJl diB3YXMgdW5kZXJsaW5lZCwgbWF0Y2ggaXRzIGFwcGVhcmFuY2UuICovCisgICAgICAgICAgICBp ZiAocy0+cHJldiAmJiBzLT5wcmV2LT5mYWNlLT51bmRlcmxpbmVfcAorICAgICAgICAgICAgICAg ICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORQorICAg ICAgICAgICAgICAgICYmIHMtPnByZXYtPnVuZGVybGluZV90aGlja25lc3MgPiAwKQorICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+cHJldi0+dW5kZXJsaW5l X3RoaWNrbmVzczsKKyAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPnByZXYtPnVuZGVybGlu ZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlCisgICAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgICAgc3RydWN0IGZvbnQgKmZvbnQ7CisgICAgICAg ICAgICAgICAgICB1bnNpZ25lZCBsb25nIGRlc2NlbnQ7CisgICAgICAgICAgICAgICAgICBmb250 PXMtPmZvbnQ7CisgICAgICAgICAgICAgICAgICBkZXNjZW50ID0gcy0+eSArIHMtPmhlaWdodCAt IHMtPnliYXNlOworICAgICAgICAgICAgICAgICAgLyogVXNlIHVuZGVybGluZSB0aGlja25lc3Mg b2YgZm9udCwgZGVmYXVsdGluZyB0byAxLiAqLworICAgICAgICAgICAgICAgICAgdGhpY2tuZXNz ID0gKGZvbnQgJiYgZm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzcyA+IDApCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IGZvbnQtPnVuZGVybGluZV90aGlja25lc3MKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogMTsKKyAgICAgICAgICAgICAgICAgIC8qIERldGVybWluZSB0 aGUgb2Zmc2V0IG9mIHVuZGVybGluaW5nIGZyb20gdGhlIGJhc2VsaW5lLiAqLworICAgICAgICAg ICAgICAgICAgaWYgKHhfdW5kZXJsaW5lX2F0X2Rlc2NlbnRfbGluZSkKKyAgICAgICAgICAgICAg ICAgICAgcG9zaXRpb24gPSBkZXNjZW50IC0gdGhpY2tuZXNzOworICAgICAgICAgICAgICAgICAg ICBlbHNlIGlmICh4X3VzZV91bmRlcmxpbmVfcG9zaXRpb25fcHJvcGVydGllcworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBmb250ICYmIGZvbnQtPnVuZGVybGluZV9wb3NpdGlvbiA+ PSAwKQorICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gZm9udC0+dW5kZXJsaW5lX3Bv c2l0aW9uOworICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGZvbnQpCisgICAgICAgICAg ICAgICAgICAgICAgICBwb3NpdGlvbiA9IGxyb3VuZCAoZm9udC0+ZGVzY2VudCAvIDIpOworICAg ICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICBwb3Np dGlvbiA9IHVuZGVybGluZV9taW5pbXVtX29mZnNldDsKKyAgICAgICAgICAgICAgICAgIHBvc2l0 aW9uID0gbWF4IChwb3NpdGlvbiwgdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0KTsKKyAgICAgICAg ICAgICAgICAgIC8qIEVuc3VyZSB1bmRlcmxpbmluZyBpcyBub3QgY3JvcHBlZC4gKi8KKyAgICAg ICAgICAgICAgICAgIGlmIChkZXNjZW50IDw9IHBvc2l0aW9uKQorICAgICAgICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBkZXNjZW50IC0gMTsKKyAgICAg ICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAxOworICAgICAgICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGRlc2NlbnQgPCBwb3NpdGlvbiArIHRoaWNrbmVz cykKKyAgICAgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAxOworICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgIHMtPnVuZGVybGluZV90aGlja25lc3MgPSB0aGlja25lc3M7CisgICAg ICAgICAgICBzLT51bmRlcmxpbmVfcG9zaXRpb24gPSBwb3NpdGlvbjsKKyAgICAgICAgICAgIHIg PSBOU01ha2VSZWN0ICh4LCBzLT55YmFzZSArIHBvc2l0aW9uLCB3aWR0aCwgdGhpY2tuZXNzKTsK KyAgICAgICAgICAgIGlmIChmYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3ApCisgICAgICAgICAg ICAgIFtkZWZhdWx0Q29sIHNldF07CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAg ICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKGZhY2UtPnVuZGVybGluZV9jb2xvciwgcy0+Zikg c2V0XTsKKyAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgIH0KKyAgICB9Cisg IC8qIERvIG92ZXJsaW5lLiBXZSBmb2xsb3cgb3RoZXIgdGVybXMgaW4gdXNpbmcgYSB0aGlja25l c3Mgb2YgMQorICAgICBhbmQgaWdub3Jpbmcgb3ZlcmxpbmVfbWFyZ2luLiAqLworICBpZiAoZmFj ZS0+b3ZlcmxpbmVfcCkKKyAgICB7CisgICAgICBOU1JlY3QgcjsKKyAgICAgIHIgPSBOU01ha2VS ZWN0ICh4LCBzLT55LCB3aWR0aCwgMSk7CisgICAgICBpZiAoZmFjZS0+b3ZlcmxpbmVfY29sb3Jf ZGVmYXVsdGVkX3ApCisgICAgICAgIFtkZWZhdWx0Q29sIHNldF07CisgICAgICAgIGVsc2UKKyAg IC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ig c2Nyb2xsYmFyICovCisgICAgICAgICAgICAgIG92ZXJydW4gPSBtYXggKDAsIChzLT54ICsgcy0+ YmFja2dyb3VuZF93aWR0aCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gKFdJ TkRPV19CT1hfUklHSFRfRURHRV9YIChzLT53KQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgLSBXSU5ET1dfUklHSFRfRlJJTkdFX1dJRFRIIChzLT53KSkpOworICAgICAgICAgICAgICAg ICAgICByW2ldLnNpemUud2lkdGggLT0gb3ZlcnJ1bjsKKyAgICAgICAgICAgICAgLyogdHJ1bmNh dGUgdG8gYXZvaWQgb3ZlcndyaXRpbmcgdG8gbGVmdCBvZiB0aGUgd2luZG93IGJveCAqLworICAg ICAgICAgICAgICBsZWZ0b3ZlcnJ1biA9IChXSU5ET1dfQk9YX0xFRlRfRURHRV9YIChzLT53KQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIFdJTkRPV19MRUZUX0ZSSU5HRV9XSURUSCAo cy0+dykpIC0gcy0+eDsKKyAgICAgICAgICAgICAgaWYgKGxlZnRvdmVycnVuID4gMCkKKyAgICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICByW2ldLm9yaWdpbi54ICs9IGxlZnRvdmVy cnVuOworICAgICAgICAgICAgICAgICAgcltpXS5zaXplLndpZHRoIC09IGxlZnRvdmVycnVuOwor ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgLyogWFhYOiBUcnkgdG8gd29yayBiZXR3 ZWVuIHByb2JsZW0gd2hlcmUgYSBzdHJldGNoIGdseXBoIG9uCisgICAgICAgICAgICAgICAgIGEg cGFydGlhbGx5LXZpc2libGUgYm90dG9tIHJvdyB3aWxsIGNsZWFyIHBhcnQgb2YgdGhlCisgICAg ICAgICAgICAgICAgIG1vZGVsaW5lLCBhbmQgYW5vdGhlciB3aGVyZSBsaXN0LWJ1ZmZlcnMgaGVh ZGVycyBhbmQgc2ltaWxhcgorICAgICAgICAgICAgICAgICByb3dzIGVycm9uZW91c2x5IGhhdmUg dmlzaWJsZV9oZWlnaHQgc2V0IHRvIDAuICBOb3Qgc3VyZQorICAgICAgICAgICAgICAgICB3aGVy ZSB0aGlzIGlzIGNvbWluZyBmcm9tIGFzIG90aGVyIHRlcm1zIHNlZW0gbm90IHRvIHNob3cuICov CisgICAgICAgICAgICAgIHJbaV0uc2l6ZS5oZWlnaHQgPSBtaW4gKHMtPmhlaWdodCwgcy0+cm93 LT52aXNpYmxlX2hlaWdodCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgW2JnQ29sIHNldF07 CisgICAgICAgICAgLyogTk9URTogdW5kZXIgTlMgdGhpcyBpcyBOT1QgdXNlZCB0byBkcmF3IGN1 cnNvcnMsIGJ1dCB3ZSBtdXN0IGF2b2lkCisgICAgICAgICAgICAgb3ZlcndyaXRpbmcgY3Vyc29y ICh1c3VhbGx5IHdoZW4gY3Vyc29yIG9uIGEgdGFiKSAqLworICAgICAgICAgIGlmIChzLT5obCA9 PSBEUkFXX0NVUlNPUikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogRklYTUU6ICBE byB3ZSBzdGlsbCBuZWVkIHRvIHByZXZlbnQgdGhpcyBzZWN0aW9uIG9mIGNvZGUgZnJvbQorICAg ICAgICAgICAgICBlcmFzaW5nIHRoZSBmYWtlIE1DX0hCQVIgdGhhdCBleHRlbmRzIHRoZSBlbnRp cmUgbGVuZ3RoIG9mIHRoZQorICAgICAgICAgICAgICBTVFJFVENIX0dMWVBIPyAgVGhpcyBtYXkg aGF2ZSBiZWVuIGRvbmUgcHJpb3IgdG8gdGhlIGZpeCByZWxhdGluZworICAgICAgICAgICAgICB0 byBsZWZ0L3JpZ2h0IG92ZXJ3cml0dGVuIGdseXBocy4gKi8KKyAgICAgICAgICAgICAgcltpXS5z aXplLmhlaWdodCAtPSAxOworICAgICAgICAgICAgICAvLyAgZW51bSBmYWNlX2lkIGRlYnVnZ2lu Z19mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAoIistZGVi dWdnaW5nLWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgIC8vICBzdHJ1Y3QgZmFjZSAqZGVi dWdnaW5nX2ZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIGRlYnVnZ2luZ19mYWNlX2lkKTsKKyAg ICAgICAgICAgICAgLy8gIE5TQ29sb3IgKmNvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3Ig KE5TX0ZBQ0VfRk9SRUdST1VORCAoZGVidWdnaW5nX2ZhY2UpLCBzLT5mKTsKKyAgICAgICAgICAg ICAgLy8gIFtjb2xvciBzZXRdOworICAgICAgICAgICAgICBDR0Zsb2F0IHggPSByW2ldLm9yaWdp bi54OworICAgICAgICAgICAgICBDR0Zsb2F0IHdpZHRoID0gd2Q7CisgICAgICAgICAgICAgIHJb aV0uc2l6ZS53aWR0aCAtPSB3aWR0aDsKKyAgICAgICAgICAgICAgcltpXS5vcmlnaW4ueCArPSB3 aWR0aDsKKyAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocltpXSk7CisgICAgICAgICAgICAgIC8q IERyYXcgb3ZlcmxpbmluZywgZXRjLiBvbiB0aGUgY3Vyc29yLiAqLworICAgICAgICAgICAgICBp ZiAocy0+dy0+cGh5c19jdXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9YKQorICAgICAgICAgICAg ICAgIG1jX25zX2RyYXdfdGV4dF9kZWNvcmF0aW9uIChzLCBmYWNlLCBiZ0NvbCwgd2lkdGgsIHgp OworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIG1jX25zX2RyYXdfdGV4 dF9kZWNvcmF0aW9uIChzLCBmYWNlLCBmZ0NvbCwgd2lkdGgsIHgpOworICAgICAgICAgICAgfQor ICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgLy8gIGludCByeCA9IHJbaV0ub3JpZ2lu Lng7CisgIC8vICBpbnQgcnkgPSByW2ldLm9yaWdpbi55OworICAvLyAgaW50IHJ3ID0gcltpXS5z aXplLndpZHRoOworICAvLyAgaW50IHJoID0gcltpXS5zaXplLmhlaWdodDsKKyAgLy8gIGZwcmlu dGYgKHN0ZGVyciwgIm1jX25zX2R1bXBnbHlwaHNfc3RyZXRjaDogIHZwb3MgKCVkKSB8IHJ4ICgl ZCkgfCByeSAoJWQpIHwgcncgKCVkKSB8IHJoICglZClcbiIsCisgIC8vICAgICAgICAgICAgICAg ICAgIHMtPmZpcnN0X2dseXBoLT52cG9zLCByeCwgcnksIHJ3LCByaCk7CisgICAgICAgICAgICAg IE5TUmVjdEZpbGwgKHJbaV0pOworICAgICAgICAgICAgfQorICAgICAgICAgIC8qIERyYXcgb3Zl cmxpbmluZywgZXRjLiBvbiB0aGUgc3RyZXRjaCBnbHlwaCAob3IgdGhlIHBhcnQKKyAgICAgICAg ICAgICBvZiB0aGUgc3RyZXRjaCBnbHlwaCBhZnRlciB0aGUgY3Vyc29yKS4gKi8KKyAgICAgICAg ICBtY19uc19kcmF3X3RleHRfZGVjb3JhdGlvbiAocywgZmFjZSwgZmdDb2wsIHJbaV0uc2l6ZS53 aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcltpXS5vcmlnaW4u eCk7CisgICAgICAgIH0KKyAgICAgIGlmICgocy0+bGVmdF9vdmVyd3JpdHRlbl9wIHx8IHMtPnJp Z2h0X292ZXJ3cml0dGVuX3ApCisgICAgICAgICAgJiYgKHMtPmFjdGlvbl90eXBlID09IE1DX0RS QVdfR0xZUEhfU1RSSU5HfHwgcy0+YWN0aW9uX3R5cGUgPT0gTUNfRVJBU0VfR0xZUEhfU1RSSU5H KSkKKyAgICAgICAgbWNfbnNfZHJhd19vdmVyd3JpdHRlbiAocywgbWF0cml4LCByb3csIHMtPmZp cnN0X2dseXBoKTsKKyAgICAgIG5zX3Jlc2V0X2N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zLT5zbGljZS5oZWlnaHQpOworICAg ICAgW2ltZyBkcmF3SW5SZWN0OiBkcgorICAgICAgICAgICAgIGZyb21SZWN0OiBpcgorICAgICAg ICAgICAgIG9wZXJhdGlvbjogTlNDb21wb3NpdGVTb3VyY2VPdmVyCisgICAgICAgICAgICAgIGZy YWN0aW9uOiAxLjAKKyAgICAgICAgICAgcmVzcGVjdEZsaXBwZWQ6IFlFUworICAgICAgICAgICAg ICAgIGhpbnRzOiBuaWxdOworI2Vsc2UKKyAgICAgIFtpbWcgY29tcG9zaXRlVG9Qb2ludDogTlNN YWtlUG9pbnQgKHgsIHkgKyBzLT5zbGljZS5oZWlnaHQpCisgICAgICAgICAgICAgICAgICBvcGVy YXRpb246IE5TQ29tcG9zaXRlU291cmNlT3Zlcl07CisjZW5kaWYKKyAgICB9CisgIGlmIChzLT5o bCA9PSBEUkFXX0NVUlNPUikKKyAgICB7CisgICAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChzLT5m KSBzZXRdOworICAgICAgaWYgKHMtPnctPnBoeXNfY3Vyc29yX3R5cGUgPT0gTUNfRklMTEVEX0JP WCkKKyAgICAgICAgdGRDb2wgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNL R1JPVU5EIChmYWNlKSwgcy0+Zik7CisgICAgICAgIGVsc2UKKyAgICAgICAgICAvKiBDdXJyZW50 bHkgb24gTlMgaW1nLT5tYXNrIGlzIGFsd2F5cyAwLiBTaW5jZQorICAgICAgICAgICAgIGdldF93 aW5kb3dfY3Vyc29yX3R5cGUgc3BlY2lmaWVzIGEgaG9sbG93IGJveCBjdXJzb3Igd2hlbiBvbgor ICAgICAgICAgICAgIGEgbm9uLW1hc2tlZCBpbWFnZSB3ZSBuZXZlciByZWFjaCB0aGlzIGNsYXVz ZS4gQnV0IHdlIHB1dCBpdAorICAgICAgICAgICAgIGluIGluIGFudGljaXBhdGlvbiBvZiBiZXR0 ZXIgc3VwcG9ydCBmb3IgaW1hZ2UgbWFza3Mgb24gTlMuICovCisgICAgICAgICAgdGRDb2wgPSBu c19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChmYWNlKSwgcy0+Zik7 CisgICAgfQorICAgIGVsc2UKKyAgICAgIHRkQ29sID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3Ig KE5TX0ZBQ0VfRk9SRUdST1VORCAoZmFjZSksIHMtPmYpOworICAvKiBEcmF3IHVuZGVybGluZSwg b3ZlcmxpbmUsIHN0cmlrZS10aHJvdWdoLiAqLworICBtY19uc19kcmF3X3RleHRfZGVjb3JhdGlv biAocywgZmFjZSwgdGRDb2wsIGJyLnNpemUud2lkdGgsIGJyLm9yaWdpbi54KTsKKyAgLyogRHJh dyByZWxpZWYsIGlmIHJlcXVlc3RlZCAqLworICBpZiAocy0+aW1nLT5yZWxpZWYgfHwgcy0+aGwg PT1EUkFXX0lNQUdFX1JBSVNFRCB8fCBzLT5obCA9PURSQVdfSU1BR0VfU1VOS0VOKQorICAgIHsK KyAgICAgIGlmIChzLT5obCA9PSBEUkFXX0lNQUdFX1NVTktFTiB8fCBzLT5obCA9PSBEUkFXX0lN QUdFX1JBSVNFRCkKKyAgICAgICAgeworICAgICAgICAgIHRoID0gdG9vbF9iYXJfYnV0dG9uX3Jl bGllZiA+PSAwID8KKyAgICAgICAgICAgIHRvb2xfYmFyX2J1dHRvbl9yZWxpZWYgOiBERUZBVUxU X1RPT0xfQkFSX0JVVFRPTl9SRUxJRUY7CisgICAgICAgICAgcmFpc2VkX3AgPSAocy0+aGwgPT0g RFJBV19JTUFHRV9SQUlTRUQpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7 CisgICAgICAgICAgICB0aCA9IGFicyAocy0+aW1nLT5yZWxpZWYpOworICAgICAgICAgICAgcmFp c2VkX3AgPSAocy0+aW1nLT5yZWxpZWYgPiAwKTsKKyAgICAgICAgICB9CisgICAgICByLm9yaWdp bi54ID0geCAtIHRoOworICAgICAgci5vcmlnaW4ueSA9IHkgLSB0aDsKKyAgICAgIHIuc2l6ZS53 aWR0aCA9IHMtPnNsaWNlLndpZHRoICsgMip0aC0xOworICAgICAgci5zaXplLmhlaWdodCA9IHMt PnNsaWNlLmhlaWdodCArIDIqdGgtMTsKKyAgICAgIG5zX2RyYXdfcmVsaWVmIChyLCB0aCwgcmFp c2VkX3AsCisgICAgICAgICAgICAgICAgICAgICAgcy0+c2xpY2UueSA9PSAwLAorICAgICAgICAg ICAgICAgICAgICAgIHMtPnNsaWNlLnkgKyBzLT5zbGljZS5oZWlnaHQgPT0gcy0+aW1nLT5oZWln aHQsCisgICAgICAgICAgICAgICAgICAgICAgcy0+c2xpY2UueCA9PSAwLAorICAgICAgICAgICAg ICAgICAgICAgIHMtPnNsaWNlLnggKyBzLT5zbGljZS53aWR0aCA9PSBzLT5pbWctPndpZHRoLCBz KTsKKyAgICB9CisgIC8qIElmIHRoZXJlIGlzIG5vIG1hc2ssIHRoZSBiYWNrZ3JvdW5kIHdvbid0 IGJlIHNlZW4sCisgICAgIHNvIGRyYXcgYSByZWN0YW5nbGUgb24gdGhlIGltYWdlIGZvciB0aGUg Y3Vyc29yLgorICAgICBEbyB0aGlzIGZvciBhbGwgaW1hZ2VzLCBnZXR0aW5nIHRyYW5zcGFyZW5j eSByaWdodCBpcyBub3QgcmVsaWFibGUuICovCisgIGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUikK KyAgICB7CisgICAgICBpbnQgdGhpY2tuZXNzID0gYWJzIChzLT5pbWctPnJlbGllZik7CisgICAg ICBpZiAodGhpY2tuZXNzID09IDApIHRoaWNrbmVzcyA9IDE7CisgICAgaWYgKGdseXBoX2ZsYXZv ciA9PSBNQ19HTFlQSAorICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEhMRVNTKQor ICAgICAgeworICAgICAgICBOU0NvbG9yICpib3JkZXJfY29sb3IgPSBbTlNDb2xvciBjb2xvcldp dGhDYWxpYnJhdGVkUmVkOiBsc2wucmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JlZW46IGxzbC5ncmVlbgorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBibHVlOiBsc2wu Ymx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGFscGhhOiAxLjBdOworICAgICAgICBuc19kcmF3X2JveCAoYnIsIHRoaWNrbmVzcywg Ym9yZGVyX2NvbG9yLCAxLCAxKTsKKyAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgICAgbnNfZHJh d19ib3ggKGJyLCB0aGlja25lc3MsIEZSQU1FX0NVUlNPUl9DT0xPUiAocy0+ZiksIDEsIDEpOwor ICAgIH0KK30KKworc3RhdGljIHZvaWQKK21jX25zX21heWJlX2R1bXBnbHlwaHNfYmFja2dyb3Vu ZCAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgY2hhciBmb3JjZV9wKQoreworICBOU1RSQUNFICgi bWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIik7CisgIGlmICghcy0+YmFja2dyb3Vu ZF9maWxsZWRfcC8qIHx8IHMtPmhsID09IERSQVdfTU9VU0VfRkFDRSovKQorICAgIHsKKyAgICAg IGludCBib3hfbGluZV93aWR0aCA9IG1heCAocy0+ZmFjZS0+Ym94X2xpbmVfd2lkdGgsIDApOwor ICAgICAgaWYgKEZPTlRfSEVJR0hUIChzLT5mb250KSA8IHMtPmhlaWdodCAtIDIgKiBib3hfbGlu ZV93aWR0aAorICAgICAgICAgIC8qIFdoZW4geGRpc3AuYyBpZ25vcmVzIEZPTlRfSEVJR0hULCB3 ZSBjYW5ub3QgdHJ1c3QgZm9udAorICAgICAgICAgICAgIGRpbWVuc2lvbnMsIHNpbmNlIHRoZSBh Y3R1YWwgZ2x5cGhzIG1pZ2h0IGJlIG11Y2gKKyAgICAgICAgICAgICBzbWFsbGVyLiAgU28gaW4g dGhhdCBjYXNlIHdlIGFsd2F5cyBjbGVhciB0aGUgcmVjdGFuZ2xlCisgICAgICAgICAgICAgd2l0 aCBiYWNrZ3JvdW5kIGNvbG9yLiAqLworICAgICAgICAgIHx8IEZPTlRfVE9PX0hJR0ggKHMtPmZv bnQpCisgICAgICAgICAgfHwgcy0+Zm9udF9ub3RfZm91bmRfcCB8fCBzLT5leHRlbmRzX3RvX2Vu ZF9vZl9saW5lX3AgfHwgZm9yY2VfcCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBmYWNl ICpmYWNlOworICAgICAgICAgIGlmIChzLT5obCA9PSBEUkFXX01PVVNFX0ZBQ0UpCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIE1PVVNFX0hM X0lORk8gKHMtPmYpLT5tb3VzZV9mYWNlX2ZhY2VfaWQpOworICAgICAgICAgICAgICBpZiAoIWZh Y2UpCisgICAgICAgICAgICAgICAgZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgTU9VU0VfRkFD RV9JRCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGZh Y2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIHMtPmZpcnN0X2dseXBoLT5mYWNlX2lkKTsKKyAgICAg ICAgICBpZiAoIWZhY2UtPnN0aXBwbGUpCisgICAgICAgICAgICBbKE5TX0ZBQ0VfQkFDS0dST1VO RCAoZmFjZSkgIT0gMAorICAgICAgICAgICAgICA/IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChO U19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpLCBzLT5mKQorICAgICAgICAgICAgICA6IEZSQU1FX0JB Q0tHUk9VTkRfQ09MT1IgKHMtPmYpKSBzZXRdOworICAgICAgICAgICAgZWxzZQorICAgICAgICAg ICAgICB7CisgICAgICAgICAgICAgICAgc3RydWN0IG5zX2Rpc3BsYXlfaW5mbyAqZHB5aW5mbyA9 IEZSQU1FX0RJU1BMQVlfSU5GTyAocy0+Zik7CisgICAgICAgICAgICAgICAgW1tkcHlpbmZvLT5i aXRtYXBzW2ZhY2UtPnN0aXBwbGUtMV0uaW1nIHN0aXBwbGVNYXNrXSBzZXRdOworICAgICAgICAg ICAgICB9CisgICAgICAgICAgaWYgKHMtPmhsICE9IERSQVdfQ1VSU09SKQorICAgICAgICAgICAg eworICAgICAgICAgICAgICBzLT5yZWN0YW5nbGVfbnVrZWRfcCA9IHRydWU7CisgICAgICAgICAg ICAgIE5TUmVjdCByID0gTlNNYWtlUmVjdCAocy0+eCwgcy0+eSArIGJveF9saW5lX3dpZHRoLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+YmFja2dyb3VuZF93aWR0aCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPmhlaWdodC0yKmJveF9saW5l X3dpZHRoKTsKKyAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAgICB9Cisg ICAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IDE7CisgICAgICAgIH0KKyAgICB9Cit9 CisKK3N0YXRpYyB2b2lkCittY19uc19kcmF3X2dseXBoX3N0cmluZyAoc3RydWN0IGdseXBoX3N0 cmluZyAqcywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpy b3csCisgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2wsIGVudW0gbWNf Zmxhdm9yIGdseXBoX2ZsYXZvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1 cnNvcl90eXBlIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgIGludCB3ZCwg Ym9vbCBhY3Rp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ICAgICAgeworICAgICAgICAgICAgICAg IG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocy0+bmV4dCwgcik7CisgICAgICAg ICAgICAgICAgaWYgKCFuc19jbGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4pKQorICAgICAgICAgICAg ICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIG1jX25zX21heWJlX2R1bXBnbHlwaHNfYmFj a2dyb3VuZCAocy0+bmV4dCwgMSk7CisgICAgICAgICAgICAgICAgbnNfcmVzZXRfY2xpcHBpbmcg KHMtPmYpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICBtY19uc19kdW1wZ2x5cGhzX3N0cmV0Y2ggKHMtPm5leHQsIG1hdHJpeCwgcm93LCB3ZCk7 CisgICAgICAgICAgICBuZXh0LT5udW1fY2xpcHMgPSAwOworICAgICAgICAgIH0KKyAgICB9Cisg IGlmICghcy0+Zm9yX292ZXJsYXBzICYmIHMtPmZhY2UtPmJveCAhPSBGQUNFX05PX0JPWAorICAg ICAgJiYgKHMtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgICAgICB8fCBz LT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpKQorICAgIHsKKyAgICAgIG4g PSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgcik7CisgICAgICBpZiAoIW5zX2Ns aXBfdG9fcmVjdCAocy0+ZiwgciwgbikpCisgICAgICAgIHJldHVybjsKKyAgICAgIG1jX25zX21h eWJlX2R1bXBnbHlwaHNfYmFja2dyb3VuZCAocywgMSk7CisgICAgICBuc19kdW1wZ2x5cGhzX2Jv eF9vcl9yZWxpZWYgKHMpOworICAgICAgbnNfcmVzZXRfY2xpcHBpbmcgKHMtPmYpOworICAgICAg Ym94X2RyYXduX3AgPSAxOworICAgIH0KKyAgc3dpdGNoIChzLT5maXJzdF9nbHlwaC0+dHlwZSkK KyAgICB7CisgICAgY2FzZSBJTUFHRV9HTFlQSDoKKyAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3Ry aW5nX2NsaXBfcmVjdCAocywgcik7CisgICAgICBpZiAoIW5zX2NsaXBfdG9fcmVjdCAocy0+Ziwg ciwgbikpCisgICAgICAgIHJldHVybjsKKyAgICAgIG1jX25zX2R1bXBnbHlwaHNfaW1hZ2UgKHMs IHJbMF0sIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgYWN0aXZlX3ApOworICAgICAg bnNfcmVzZXRfY2xpcHBpbmcgKHMtPmYpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBTVFJFVENI X0dMWVBIOgorICAgICAgbWNfbnNfZHVtcGdseXBoc19zdHJldGNoIChzLCBtYXRyaXgsIHJvdywg d2QpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBDSEFSX0dMWVBIOgorICAgIGNhc2UgQ09NUE9T SVRFX0dMWVBIOgorICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCBy KTsKKyAgICAgIGlmICghbnNfY2xpcF90b19yZWN0IChzLT5mLCByLCBuKSkKKyAgICAgICAgcmV0 dXJuOworICAgICAgaWYgKHMtPmZvcl9vdmVybGFwcworICAgICAgICAgIHx8IChzLT5jbXBfZnJv bSA+IDAKKyAgICAgICAgICAgICAgJiYgISBzLT5maXJzdF9nbHlwaC0+dS5jbXAuYXV0b21hdGlj KSkKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IDE7CisgICAgICAgIGVsc2UKKyAg ICAgICAgICBtY19uc19tYXliZV9kdW1wZ2x5cGhzX2JhY2tncm91bmQgKHMsIHMtPmZpcnN0X2ds eXBoLT50eXBlID09IENPTVBPU0lURV9HTFlQSCk7CisgICAgICBpbnQgZmxhZ3MgPSAocy0+aGwg PT0gRFJBV19DVVJTT1IpCisgICAgICAgICAgICAgICAgICAgID8gTlNfRFVNUEdMWVBIX0NVUlNP UgorICAgICAgICAgICAgICAgICAgOiAocy0+aGwgPT0gRFJBV19NT1VTRV9GQUNFKQorICAgICAg ICAgICAgICAgICAgICA/IE5TX0RVTVBHTFlQSF9NT1VTRUZBQ0UKKyAgICAgICAgICAgICAgICAg IDogKHMtPmZvcl9vdmVybGFwcykKKyAgICAgICAgICAgICAgICAgICAgPyBOU19EVU1QR0xZUEhf Rk9SRUdST1VORAorICAgICAgICAgICAgICAgICAgOiBOU19EVU1QR0xZUEhfTk9STUFMOworICAg ICAgdW5zaWduZWQgbG9uZyBzYXZlZF9mZyA9IE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSk7 CisgICAgICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IgJiYgY3Vyc29yX3R5cGUgPT0gTUNfRklM TEVEX0JPWCkKKyAgICAgICAgeworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgdG1wID0gTlNfRkFD RV9CQUNLR1JPVU5EIChzLT5mYWNlKTsKKyAgICAgICAgICBOU19GQUNFX0JBQ0tHUk9VTkQgKHMt PmZhY2UpID0gTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKTsKKyAgICAgICAgICBOU19GQUNF X0ZPUkVHUk9VTkQgKHMtPmZhY2UpID0gdG1wOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYg KHMtPmhsID09IERSQVdfQ1VSU09SCisgICAgICAgICAgICAgICAgICYmIGN1cnNvcl90eXBlID09 IE1DX0ZSQU1FRF9CT1gKKyAgICAgICAgICAgICAgICAgJiYgYWN0aXZlX3ApCisgICAgICAgICAg eworICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfZmFjZV9pZCA9CisgICAg ICAgICAgICAgIGxvb2t1cF9uYW1lZF9mYWNlIChzLT53LCBzLT5mLCBpbnRlcm4gKCIrLXJlYWwt ZmFrZS1jdXJzb3ItcHJlLXp2LWZhY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Ag ICAgIHsKKyAgICAgICAgICAgIGJvb2wgd2l0aF9iZ19wID0gKChmbGFncyA9PSBOU19EVU1QR0xZ UEhfTk9STUFMICYmICFzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgfHwgZmxhZ3MgPT0gTlNfRFVNUEdMWVBIX01PVVNFRkFDRSk7CisgICAgICAg ICAgICBpZiAod2l0aF9iZ19wKQorICAgICAgICAgICAgICBzLT5iYWNrZ3JvdW5kX251a2VkX3Ag PSB0cnVlOworICAgICAgICAgICAgZm9udC0+ZHJpdmVyLT5kcmF3IChzLCBzLT5jbXBfZnJvbSwg cy0+bmNoYXJzLCBzLT54LCBzLT55YmFzZSwgd2l0aF9iZ19wKTsKKyAgICAgICAgICB9CisgICAg ICBOU0NvbG9yICpjb2wgPSAoTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKSAhPSAwCisgICAg ICAgICAgICAgICAgICAgICA/IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVH Uk9VTkQgKHMtPmZhY2UpLCBzLT5mKQorICAgICAgICAgICAgICAgICAgICAgOiBGUkFNRV9GT1JF R1JPVU5EX0NPTE9SIChzLT5mKSk7CisgICAgICBbY29sIHNldF07CisgICAgICAvKiBEcmF3IHVu ZGVybGluZSwgb3ZlcmxpbmUsIHN0cmlrZS10aHJvdWdoLiAqLworICAgICAgbWNfbnNfZHJhd190 ZXh0X2RlY29yYXRpb24gKHMsIHMtPmZhY2UsIGNvbCwgcy0+d2lkdGgsIHMtPngpOworICAgICAg aWYgKHMtPmZpcnN0X2dseXBoLT50eXBlICE9IENPTVBPU0lURV9HTFlQSAorICAgICAgICAgICYm IChzLT5sZWZ0X292ZXJ3cml0dGVuX3AgfHwgcy0+cmlnaHRfb3ZlcndyaXR0ZW5fcCkKKyAgICAg ICAgICAmJiAocy0+YmFja2dyb3VuZF9udWtlZF9wIHx8IHMtPnJlY3R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b20gPiAwCisgICAgICAgICAgICAgICYmICEgcy0+Zmlyc3RfZ2x5 cGgtPnUuY21wLmF1dG9tYXRpYykpCisgICAgICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSAx OworICAgICAgZWxzZQorICAgICAgICBtY19uc19tYXliZV9kdW1wZ2x5cGhzX2JhY2tncm91bmQg KHMsIHMtPmZpcnN0X2dseXBoLT50eXBlID09IENPTVBPU0lURV9HTFlQSCk7CisgICAgICBuc19y ZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAg ZW1hY3NfYWJvcnQgKCk7CisgICAgfQorICAvKiBEcmF3IGJveCBpZiBub3QgZG9uZSBhbHJlYWR5 LiAqLworICBpZiAoIXMtPmZvcl9vdmVybGFwcworICAgICAgJiYgIWJveF9kcmF3bl9wCisgICAg ICAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gpCisgICAgeworICAgICAgbiA9IG5zX2dl dF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAgICAgIGlmICghbnNfY2xpcF90b19y ZWN0IChzLT5mLCByLCBuKSkKKyAgICAgICAgcmV0dXJuOworICAgICAgbnNfZHVtcGdseXBoc19i b3hfb3JfcmVsaWVmIChzKTsKKyAgICAgIG5zX3Jlc2V0X2NsaXBwaW5nIChzLT5mKTsKKyAgICB9 CisgIHMtPm51bV9jbGlwcyA9IDA7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiA9PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQogCiAgICBO U1RSQUNFLCBUcmFjZSBzdXBwb3J0LgpAQCAtMTA3OSw2ICsyMDQ4LDE2IEBAIHN0YXRpYyBOU1Jl Y3QgY29uc3RyYWluX2ZyYW1lX3JlY3QoTlNSZWN0IGZyYW1lUmVjdCwgYm9vbCBpc0Z1bGxzY3Jl ZW4pCiAgICBleHRlcm5hbCAoUklGKSBjYWxsOyB3aG9sZSBmcmFtZSwgY2FsbGVkIGJlZm9yZSBn dWlfdXBkYXRlX3dpbmRvd19iZWdpbgogICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KIHsKKworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5t Y191cGRhdGluZ19mcmFtZSA9IGY7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICNp ZmRlZiBOU19JTVBMX0NPQ09BCiAgIEVtYWNzVmlldyAqdmlldyA9IEZSQU1FX05TX1ZJRVcgKGYp OwogCkBAIC0xMTA5LDYgKzIwODgsMTYgQEAgc3RhdGljIE5TUmVjdCBjb25zdHJhaW5fZnJhbWVf cmVjdChOU1JlY3QgZnJhbWVSZWN0LCBib29sIGlzRnVsbHNjcmVlbikKIAogLyogICBpZiAoZiA9 PSBNT1VTRV9ITF9JTkZPIChmKS0+bW91c2VfZmFjZV9tb3VzZV9mcmFtZSkgKi8KICAgTU9VU0Vf SExfSU5GTyAoZiktPm1vdXNlX2ZhY2VfZGVmZXIgPSAwOworCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1l ID0gTlVMTDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAKQEAgLTQ3NTks NiArNTc0OCwxNyBAQCBpbiBjZXJ0YWluIHNpdHVhdGlvbnMgKHJhcGlkIGluY29taW5nIGV2ZW50 cykuCiAgICAgICBiYXIgPSBbW0VtYWNzU2Nyb2xsZXIgYWxsb2NdIGluaXRGcmFtZTogciB3aW5k b3c6IHdpbl07CiAgICAgICB3c2V0X3ZlcnRpY2FsX3Njcm9sbF9iYXIgKHdpbmRvdywgbWFrZV9t aW50X3B0ciAoYmFyKSk7CiAgICAgICB1cGRhdGVfcCA9IFlFUzsKKworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgLyogVGhpcyBpcyBv bmx5IGZvciBkZWJ1Z2dpbmcgcHVycG9zZXMuICovCisgICAgICBbYmFyIG1jX3NldF9yZWN0YW5n bGU6IHJdOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgfQogICBlbHNlCiAg ICAgewpAQCAtNDc2NiwxMiArNTc2NiwzMCBAQCBpbiBjZXJ0YWluIHNpdHVhdGlvbnMgKHJhcGlk IGluY29taW5nIGV2ZW50cykuCiAgICAgICBiYXIgPSBYTlNfU0NST0xMX0JBUiAod2luZG93LT52 ZXJ0aWNhbF9zY3JvbGxfYmFyKTsKICAgICAgIG9sZFJlY3QgPSBbYmFyIGZyYW1lXTsKICAgICAg IHIuc2l6ZS53aWR0aCA9IG9sZFJlY3Quc2l6ZS53aWR0aDsKKworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogICAgICAgaWYgKEZSQU1FX0xJVkVf UCAoZikgJiYgIU5TRXF1YWxSZWN0cyAob2xkUmVjdCwgcikpCiAgICAgICAgIHsKKyAgICAgICAg ICAvKiBUaGUgbWFpbiB3aW5kb3cgaGFzIHByb2JhYmx5IGJlZW4gcmVzaXplZC4gIEdyYWNpb3Vz bHkgZGVsZXRlIHRoZQorICAgICAgICAgIG9sZCBzY3JvbGwgYmFyIHdpdGhvdXQgcmVwYWludGlu ZyBpdHMgcmVjdGFuZ2xlOyBhbmQsIGNyZWF0ZSBhIG5ldworICAgICAgICAgIHNjcm9sbCBiYXIg ZWxzZXdoZXJlLiovCiAgICAgICAgICAgaWYgKG9sZFJlY3Qub3JpZ2luLnggIT0gci5vcmlnaW4u eCkKKyAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgbnNfY2xlYXJfZnJhbWVfYXJlYSAoZiwg bGVmdCwgdG9wLCB3aWR0aCwgaGVpZ2h0KTsKKyAgICAgICAgICAgICAgW2JhciBtY19qdWRnZV07 CisgICAgICAgICAgICAgIGJhciA9IFtbRW1hY3NTY3JvbGxlciBhbGxvY10gaW5pdEZyYW1lOiBy IHdpbmRvdzogd2luXTsKKyAgICAgICAgICAgICAgd3NldF92ZXJ0aWNhbF9zY3JvbGxfYmFyICh3 aW5kb3csIG1ha2VfbWludF9wdHIgKGJhcikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAg ZWxzZQogICAgICAgICAgIFtiYXIgc2V0RnJhbWU6IHJdOwogICAgICAgICB9CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgICB9CiAKICAgaWYgKHVwZGF0ZV9wKQpAQCAtNDkzMSw5 ICs1OTQ5LDU3IEBAIGluIGNlcnRhaW4gc2l0dWF0aW9ucyAocmFwaWQgaW5jb21pbmcgZXZlbnRz KS4KICAgICB7CiAgICAgICB2aWV3ID0gW3N1YnZpZXdzIG9iamVjdEF0SW5kZXg6IGldOwogICAg ICAgaWYgKCFbdmlldyBpc0tpbmRPZkNsYXNzOiBbRW1hY3NTY3JvbGxlciBjbGFzc11dKSBjb250 aW51ZTsKLSAgICAgIGlmIChbdmlldyBqdWRnZV0pCisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogYFhTRVRXSU5ET1cnIHdpbGwgc29t ZXRpbWVzIGNhdXNlIEVtYWNzIHRvIGNyYXNoIHdoZW4gcnVubmluZyB1bmRlciBnZGIgZXZlbgor ICB0aG91Z2ggKHcgIT0gTlVMTCkuICBUaGVyZWZvcmUsIHdlIGNhbm5vdCByZWxpYWJseSB1c2Ug YFdJTkRPV19MSVZFX1AnLiAqLworICBzdHJ1Y3Qgd2luZG93ICp3ID0gW3ZpZXcgbWNfZ2V0X3dp bmRvd107CisgIGlmICh3ICE9IE5VTEwKKyAgICAgICYmIE5JTFAgKHctPmNvbnRlbnRzKSkKKyAg ICB7CisgICAgICBCT09MIGRlYnVnX3AgPSBmYWxzZTsKKyAgICAgIGlmIChkZWJ1Z19wCisgICAg ICAgICAgLyogYHdpbmRvd19ib3gnIGNhbGxzIGB3aW5kb3dfYm94X2hlaWdodCcsIHdoaWNoIHdp bGwgY2F1c2UgRW1hY3MgdG8KKyAgICAgICAgICBjcmFzaCBpZiBGUkFNRVAgKHctPmZyYW1lKSBp cyBub3Qgc2F0aXNmaWVkLiAqLworICAgICAgICAgICYmIEZSQU1FUCAody0+ZnJhbWUpKQorICAg ICAgICB7CisgICAgICAgICAgTlNSZWN0IHIwID0gW3ZpZXcgbWNfZ2V0X3JlY3RhbmdsZV07Cisg ICAgICAgICAgaW50IHgwID0gTlNNaW5YIChyMCk7CisgICAgICAgICAgaW50IHkwID0gTlNNaW5Z IChyMCk7CisgICAgICAgICAgaW50IHdkMCA9IE5TV2lkdGggKHIwKTsKKyAgICAgICAgICBpbnQg aDAgPSBOU0hlaWdodCAocjApOworICAgICAgICAgIGludCB3aW5kb3dfeSwgd2luZG93X2hlaWdo dDsKKyAgICAgICAgICB3aW5kb3dfYm94ICh3LCBBTllfQVJFQSwgMCwgJndpbmRvd195LCAwLCAm d2luZG93X2hlaWdodCk7CisgICAgICAgICAgaW50IHRvcCA9IHdpbmRvd195OworICAgICAgICAg IGludCBoZWlnaHQgPSB3aW5kb3dfaGVpZ2h0OworICAgICAgICAgIGludCB3aWR0aCA9IFdJTkRP V19DT05GSUdfU0NST0xMX0JBUl9DT0xTICh3KSAqIEZSQU1FX0NPTFVNTl9XSURUSCAoZik7Cisg ICAgICAgICAgaW50IGxlZnQgPSBXSU5ET1dfU0NST0xMX0JBUl9BUkVBX1ggKHcpOworICAgICAg ICAgIE5TUmVjdCByMSA9IE5TTWFrZVJlY3QgKGxlZnQsIHRvcCwgd2lkdGgsIGhlaWdodCk7Cisg ICAgICAgICAgLyogVGhlIHBhcmVudCB2aWV3IGlzIGZsaXBwZWQsIHNvIHdlIG5lZWQgdG8gZmxp cCB5IHZhbHVlLiAqLworICAgICAgICAgIEVtYWNzVmlldyAqZnJhbWVfdmlldyA9IEZSQU1FX05T X1ZJRVcgKGYpOworICAgICAgICAgIE5TUmVjdCB2ID0gW2ZyYW1lX3ZpZXcgZnJhbWVdOworICAg ICAgICAgIHIxLm9yaWdpbi55ID0gKHYuc2l6ZS5oZWlnaHQgLSByMS5zaXplLmhlaWdodCAtIHIx Lm9yaWdpbi55KTsKKyAgICAgICAgICBpbnQgeDEgPSBOU01pblggKHIxKTsKKyAgICAgICAgICBp bnQgeTEgPSBOU01pblkgKHIxKTsKKyAgICAgICAgICBpbnQgd2QxID0gTlNXaWR0aCAocjEpOwor ICAgICAgICAgIGludCBoMSA9IE5TSGVpZ2h0IChyMSk7CisgICAgICAgICAgZnByaW50ZiAoc3Rk ZXJyLCAiJXMgLS0gREVBRDpcblwKKyAgICAgICAgICB4MC94MSAoJWQvJWQpIHwgeTAveTEgKCVk LyVkKSB8IHdkMC93ZDEgKCVkLyVkKSB8IGgwL2gxICglZC8lZClcbiIsCisgICAgICAgICAgbWNf d2luZG93ICh3KSwgeDAsIHgxLCB5MCwgeTEsIHdkMCwgd2QxLCBoMCwgaDEpOworICAgICAgICB9 CisgICAgICBpZiAoW3ZpZXcgbWNfanVkZ2VdKQogICAgICAgICByZW1vdmVkID0gWUVTOwogICAg IH0KKyAgICBlbHNlIGlmIChbdmlldyBqdWRnZV0pCisgICAgICByZW1vdmVkID0gWUVTOworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCisgICAgfQogCiAgIGlmIChyZW1vdmVkKQogICAg IFtldmlldyB1cGRhdGVGcmFtZVNpemU6IE5PXTsKQEAgLTUwNzQsNiArNjE0MCwyMCBAQCBzdGF0 aWMgTGlzcF9PYmplY3QgbnNfc3RyaW5nX3RvX2xpc3Btb2QgKGNvbnN0IGNoYXIgKnMpCiBleHRl cm4gZnJhbWVfcGFybV9oYW5kbGVyIG5zX2ZyYW1lX3Bhcm1faGFuZGxlcnNbXTsKIHN0YXRpYyBz dHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFjZSBuc19yZWRpc3BsYXlfaW50ZXJmYWNlID0KIHsKKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyog YHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGBuc3Rlcm0ubWAgbXVzdCBiZSBpbiB0aGUgZXhhY3Qg c2FtZSBvcmRlciBhcyB0aGUKK2ByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgZGlzcGV4dGVybi5o YCEgKi8KKworICBtY19uc19kcmF3X3dpbmRvd19jdXJzb3IsCisgIG1jX25zX2RyYXdfZ2x5cGhf c3RyaW5nLAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIG5zX2ZyYW1lX3Bhcm1f aGFuZGxlcnMsCiAgIGd1aV9wcm9kdWNlX2dseXBocywKICAgZ3VpX3dyaXRlX2dseXBocywKQEAg LTg3MTEsNiArOTc5MSw0OSBAQCAtIChCT09MKWNhbkJlY29tZU1haW5XaW5kb3cKIAogQGltcGxl bWVudGF0aW9uIEVtYWNzU2Nyb2xsZXIKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFLUNVUlNPUlMgKi8KKworLSAodm9pZCltY19zZXRfcmVjdGFuZ2xlOiAoTlNSZWN0 KXJlY3QKK3sKKyAgbWNfcmVjdGFuZ2xlID0gcmVjdDsKK30KKworLSAoTlNSZWN0KW1jX2dldF9y ZWN0YW5nbGUKK3sKKyAgcmV0dXJuIG1jX3JlY3RhbmdsZTsKK30KKworLSAoc3RydWN0IHdpbmRv dyAqKW1jX2dldF93aW5kb3cKK3sKKyAgcmV0dXJuIHdpbmRvdzsKK30KKworLSAoYm9vbCltY19q dWRnZQoreworICBOU1RSQUNFICgiW0VtYWNzU2Nyb2xsZXIgbWNfanVkZ2VdIik7CisgIGJvb2wg cmV0ID0gY29uZGVtbmVkOworICBibG9ja19pbnB1dCAoKTsKKyAgaWYgKGNvbmRlbW5lZCkKKyAg ICB7CisgICAgICAvKiBlbnN1cmUgb3RoZXIgc2Nyb2xsYmFyIHVwZGF0ZXMgYWZ0ZXIgZGVsZXRp b24gKi8KKyAgICAgIEVtYWNzVmlldyAqdmlldyA9IChFbWFjc1ZpZXcgKilGUkFNRV9OU19WSUVX IChmcmFtZSk7CisgICAgICBpZiAodmlldyAhPSBuaWwpCisgICAgICAgIHZpZXctPnNjcm9sbGJh cnNOZWVkaW5nVXBkYXRlKys7CisgICAgfQorICBpZiAod2luZG93KQorICAgIHdzZXRfdmVydGlj YWxfc2Nyb2xsX2JhciAod2luZG93LCBRbmlsKTsKKyAgd2luZG93ID0gMDsKKyAgW3NlbGYgcmVt b3ZlRnJvbVN1cGVydmlld1dpdGhvdXROZWVkaW5nRGlzcGxheV07CisgIFtzZWxmIHJlbGVhc2Vd OworICB1bmJsb2NrX2lucHV0ICgpOworICByZXR1cm4gcmV0OworfQorCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKworCiAvKiBmb3IgcmVwZWF0IGJ1dHRvbiBwdXNoICovCiAjZGVmaW5lIFND Uk9MTF9CQVJfRklSU1RfREVMQVkgMC41CiAjZGVmaW5lIFNDUk9MTF9CQVJfQ09OVElOVU9VU19E RUxBWSAoMS4wIC8gMTUpCmRpZmYgLS1naXQgYS9zcmMvdzMydGVybS5jIGIvc3JjL3czMnRlcm0u YwppbmRleCBjNmUxNzVlLi5jZDk2MzhjIDEwMDY0NAotLS0gYS9zcmMvdzMydGVybS5jCisrKyBi L3NyYy93MzJ0ZXJtLmMKQEAgLTYyLDYgKzYyLDExNjUgQEAgYWxvbmcgd2l0aCBHTlUgRW1hY3Mu ICBJZiBub3QsIHNlZSA8aHR0cHM6Ly93d3cuZ251Lm9yZy9saWNlbnNlcy8+LiAgKi8KICNpbmNs dWRlICJiaXRtYXBzL2dyYXkueGJtIgogI2VuZGlmCiAMCisKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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oZWx0KSkgY29udGludWU7CisgICAg ICB0ZW0gPSBYQ0FSIChlbHQpOworICAgICAgaWYgKGxzdHJjbXBpIChTU0RBVEEgKHRlbSksIGNv bG9ybmFtZSkgPT0gMCkKKyAgICAgICAgeworICAgICAgICAgIHJldCA9IEZjZHIgKGVsdCk7Cisg ICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIE1DX1FVSVQ7CisgICAgfQorICB1bmJs b2NrX2lucHV0ICgpOworICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgTGlzcF9PYmplY3QKK21j X3hfdG9fdzMyX2NvbG9yIChjb25zdCBjaGFyICogY29sb3JuYW1lKQoreworICByZWdpc3RlciBM aXNwX09iamVjdCByZXQgPSBRbmlsOworICBibG9ja19pbnB1dCAoKTsKKyAgaWYgKGNvbG9ybmFt ZVswXSA9PSAnIycpCisgICAgeworICAgICAgLyogQ291bGQgYmUgYW4gb2xkLXN0eWxlIFJHQiBE ZXZpY2Ugc3BlY2lmaWNhdGlvbi4gKi8KKyAgICAgIGludCBzaXplID0gc3RybGVuIChjb2xvcm5h bWUgKyAxKTsKKyAgICAgIGNoYXIgKmNvbG9yID0gYWxsb2NhIChzaXplICsgMSk7CisgICAgICBz dHJjcHkgKGNvbG9yLCBjb2xvcm5hbWUgKyAxKTsKKyAgICAgIGlmIChzaXplID09IDMgfHwgc2l6 ZSA9PSA2IHx8IHNpemUgPT0gOSB8fCBzaXplID09IDEyKQorICAgICAgICB7CisgICAgICAgICAg VUlOVCBjb2xvcnZhbDsKKyAgICAgICAgICBpbnQgaSwgcG9zOworICAgICAgICAgIHBvcyA9IDA7 CisgICAgICAgICAgc2l6ZSAvPSAzOworICAgICAgICAgIGNvbG9ydmFsID0gMDsKKyAgICAgICAg ICBmb3IgKGkgPSAwOyBpIDwgMzsgaSsrKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBj aGFyICplbmQ7CisgICAgICAgICAgICAgIGNoYXIgdDsKKyAgICAgICAgICAgICAgdW5zaWduZWQg bG9uZyB2YWx1ZTsKKyAgICAgICAgICAgICAgLyogVGhlIGNoZWNrIGZvciAneCcgaW4gdGhlIGZv bGxvd2luZyBjb25kaXRpb25hbCB0YWtlcyBpbnRvCisgICAgICAgICAgICAgIGFjY291bnQgdGhl IGZhY3QgdGhhdCBzdHJ0b2wgYWxsb3dzIGEgIjB4IiBpbiBmcm9udCBvZgorICAgICAgICAgICAg ICBvdXIgbnVtYmVycywgYW5kIHdlIGRvbid0LiAqLworICAgICAgICAgICAgICBpZiAoIWlzeGRp Z2l0IChjb2xvclswXSkgfHwgY29sb3JbMV0gPT0gJ3gnKQorICAgICAgICAgICAgICAgIGJyZWFr OworICAgICAgICAgICAgICB0ID0gY29sb3Jbc2l6ZV07CisgICAgICAgICAgICAgIGNvbG9yW3Np emVdID0gJ1wwJzsKKyAgICAgICAgICAgICAgdmFsdWUgPSBzdHJ0b3VsIChjb2xvciwgJmVuZCwg MTYpOworICAgICAgICAgICAgICBjb2xvcltzaXplXSA9IHQ7CisgICAgICAgICAgICAgIGlmIChl cnJubyA9PSBFUkFOR0UgfHwgZW5kIC0gY29sb3IgIT0gc2l6ZSkKKyAgICAgICAgICAgICAgICBi cmVhazsKKyAgICAgICAgICAgICAgc3dpdGNoIChzaXplKQorICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICBjYXNlIDE6CisgICAgICAgICAgICAgICAgICB2YWx1ZSA9IHZhbHVlICog MHgxMDsKKyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgMjoK KyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgMzoKKyAgICAg ICAgICAgICAgICAgIHZhbHVlIC89IDB4MTA7CisgICAgICAgICAgICAgICAgICBicmVhazsKKyAg ICAgICAgICAgICAgICBjYXNlIDQ6CisgICAgICAgICAgICAgICAgICB2YWx1ZSAvPSAweDEwMDsK KyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAg ICAgY29sb3J2YWwgfD0gKHZhbHVlIDw8IHBvcyk7CisgICAgICAgICAgICAgIHBvcyArPSAweDg7 CisgICAgICAgICAgICAgIGlmIChpID09IDIpCisgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgICAgIFhTRVRJTlQgKHJl dCwgY29sb3J2YWwpOworICAgICAgICAgICAgICAgICAgcmV0dXJuIHJldDsKKyAgICAgICAgICAg ICAgICB9CisgICAgICAgICAgICAgIGNvbG9yID0gZW5kOworICAgICAgICAgICAgfQorICAgICAg ICB9CisgICAgfQorICBlbHNlIGlmIChzdHJuaWNtcCAoY29sb3JuYW1lLCAicmdiOiIsIDQpID09 IDApCisgICAgeworICAgICAgY29uc3QgY2hhciAqY29sb3I7CisgICAgICBVSU5UIGNvbG9ydmFs OworICAgICAgaW50IGksIHBvczsKKyAgICAgIHBvcyA9IDA7CisgICAgICBjb2xvcnZhbCA9IDA7 CisgICAgICBjb2xvciA9IGNvbG9ybmFtZSArIDQ7CisgICAgICBmb3IgKGkgPSAwOyBpIDwgMzsg aSsrKQorICAgICAgICB7CisgICAgICAgICAgY2hhciAqZW5kOworICAgICAgICAgIHVuc2lnbmVk IGxvbmcgdmFsdWU7CisgICAgICAgICAgLyogVGhlIGNoZWNrIGZvciAneCcgaW4gdGhlIGZvbGxv d2luZyBjb25kaXRpb25hbCB0YWtlcyBpbnRvCisgICAgICAgICAgICAgYWNjb3VudCB0aGUgZmFj dCB0aGF0IHN0cnRvbCBhbGxvd3MgYSAiMHgiIGluIGZyb250IG9mCisgICAgICAgICAgICAgb3Vy IG51bWJlcnMsIGFuZCB3ZSBkb24ndC4gKi8KKyAgICAgICAgICBpZiAoIWlzeGRpZ2l0IChjb2xv clswXSkgfHwgY29sb3JbMV0gPT0gJ3gnKQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAg dmFsdWUgPSBzdHJ0b3VsIChjb2xvciwgJmVuZCwgMTYpOworICAgICAgICAgIGlmIChlcnJubyA9 PSBFUkFOR0UpCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBzd2l0Y2ggKGVuZCAtIGNv bG9yKQorICAgICAgICAgICAgeworICAgICAgICAgICAgY2FzZSAxOgorICAgICAgICAgICAgICB2 YWx1ZSA9IHZhbHVlICogMHgxMCArIHZhbHVlOworICAgICAgICAgICAgICBicmVhazsKKyAgICAg ICAgICAgIGNhc2UgMjoKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDM6 CisgICAgICAgICAgICAgIHZhbHVlIC89IDB4MTA7CisgICAgICAgICAgICAgIGJyZWFrOworICAg ICAgICAgICAgY2FzZSA0OgorICAgICAgICAgICAgICB2YWx1ZSAvPSAweDEwMDsKKyAgICAgICAg ICAgICAgYnJlYWs7CisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICB2YWx1ZSA9 IFVMT05HX01BWDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBpZiAodmFsdWUgPT0gVUxPTkdf TUFYKQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgY29sb3J2YWwgfD0gKHZhbHVlIDw8 IHBvcyk7CisgICAgICAgICAgcG9zICs9IDB4ODsKKyAgICAgICAgICBpZiAoaSA9PSAyKQorICAg ICAgICAgICAgeworICAgICAgICAgICAgICBpZiAoKmVuZCAhPSAnXDAnKQorICAgICAgICAgICAg ICAgIGJyZWFrOworICAgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgICAgICAg ICBYU0VUSU5UIChyZXQsIGNvbG9ydmFsKTsKKyAgICAgICAgICAgICAgcmV0dXJuIHJldDsKKyAg ICAgICAgICAgIH0KKyAgICAgICAgICBpZiAoKmVuZCAhPSAnLycpCisgICAgICAgICAgICBicmVh azsKKyAgICAgICAgICBjb2xvciA9IGVuZCArIDE7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxz ZSBpZiAoc3RybmljbXAgKGNvbG9ybmFtZSwgInJnYmk6IiwgNSkgPT0gMCkKKyAgICAgIHsKKyAg ICAgICAgLyogVGhpcyBpcyBhbiBSR0IgSW50ZW5zaXR5IHNwZWNpZmljYXRpb24uICovCisgICAg ICAgIGNvbnN0IGNoYXIgKmNvbG9yOworICAgICAgICBVSU5UIGNvbG9ydmFsOworICAgICAgICBp bnQgaSwgcG9zOworICAgICAgICBwb3MgPSAwOworICAgICAgICBjb2xvcnZhbCA9IDA7CisgICAg ICAgIGNvbG9yID0gY29sb3JuYW1lICsgNTsKKyAgICAgICAgZm9yIChpID0gMDsgaSA8IDM7IGkr KykKKyAgICAgICAgICB7CisgICAgICAgICAgICBjaGFyICplbmQ7CisgICAgICAgICAgICBkb3Vi bGUgdmFsdWU7CisgICAgICAgICAgICBVSU5UIHZhbDsKKyAgICAgICAgICAgIHZhbHVlID0gc3Ry dG9kIChjb2xvciwgJmVuZCk7CisgICAgICAgICAgICBpZiAoZXJybm8gPT0gRVJBTkdFKQorICAg ICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGlmICh2YWx1ZSA8IDAuMCB8fCB2YWx1ZSA+ IDEuMCkKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB2YWwgPSAoVUlOVCkoMHgx MDAgKiB2YWx1ZSk7CisgICAgICAgICAgICAvKiBXZSB1c2VkIDB4MTAwIGluc3RlYWQgb2YgMHhG RiB0byBnaXZlIGEgY29udGludW91cworICAgICAgICAgICAgICAgcmFuZ2UgYmV0d2VlbiAwLjAg YW5kIDEuMCBpbmNsdXNpdmUuICBUaGUgbmV4dCBzdGF0ZW1lbnQKKyAgICAgICAgICAgICAgIGZp eGVzIHRoZSAxLjAgY2FzZS4gKi8KKyAgICAgICAgICAgIGlmICh2YWwgPT0gMHgxMDApCisgICAg ICAgICAgICAgIHZhbCA9IDB4RkY7CisgICAgICAgICAgICBjb2xvcnZhbCB8PSAodmFsIDw8IHBv cyk7CisgICAgICAgICAgICBwb3MgKz0gMHg4OworICAgICAgICAgICAgaWYgKGkgPT0gMikKKyAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmICgqZW5kICE9ICdcMCcpCisgICAgICAg ICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAg ICAgICAgICAgICAgIFhTRVRJTlQgKHJldCwgY29sb3J2YWwpOworICAgICAgICAgICAgICAgIHJl dHVybiByZXQ7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICgqZW5kICE9ICcvJykK KyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjb2xvciA9IGVuZCArIDE7CisgICAg ICAgICAgfQorICAgICAgfQorICAvKiBJIGFtIG5vdCBnb2luZyB0byBhdHRlbXB0IHRvIGhhbmRs ZSBhbnkgb2YgdGhlIENJRSBjb2xvciBzY2hlbWVzCisgICAgIG9yIFRla0hWQywgc2luY2UgSSBk b24ndCBrbm93IHRoZSBhbGdvcml0aG1zIGZvciBjb252ZXJzaW9uIHRvIFJHQi4KKyAgICAgSWYg d2UgZmFpbCB0byBsb29rdXAgdGhlIGNvbG9yIG5hbWUgaW4gdzMyX2NvbG9yX21hcCwgdGhlbiBj aGVjayB0aGUKKyAgICAgY29sb3JuYW1lIHRvIHNlZSBpZiBpdCBjYW4gYmUgY3J1ZGVseSBhcHBy b3hpbWF0ZWQ6IElmIHRoZSBYIGNvbG9yCisgICAgIGVuZHMgaW4gYSBudW1iZXIgKGUuZy4sICJk YXJrc2VhZ3JlZW4yIiksIHN0cmlwIHRoZSBudW1iZXIgYW5kCisgICAgIHJldHVybiB0aGUgcmVz dWx0IG9mIGxvb2tpbmcgdXAgdGhlIGJhc2UgY29sb3IgbmFtZS4gKi8KKyAgcmV0ID0gbWNfdzMy X2NvbG9yX21hcF9sb29rdXAgKGNvbG9ybmFtZSk7CisgIGlmIChOSUxQIChyZXQpKQorICAgIHsK KyAgICAgIGludCBsZW4gPSBzdHJsZW4gKGNvbG9ybmFtZSk7CisgICAgICBpZiAoaXNkaWdpdCAo Y29sb3JuYW1lW2xlbiAtIDFdKSkKKyAgICAgICAgeworICAgICAgICAgIGNoYXIgKnB0ciwgKmFw cHJveCA9IGFsbG9jYSAobGVuICsgMSk7CisgICAgICAgICAgc3RyY3B5IChhcHByb3gsIGNvbG9y bmFtZSk7CisgICAgICAgICAgcHRyID0gJmFwcHJveFtsZW4gLSAxXTsKKyAgICAgICAgICB3aGls ZSAocHRyID4gYXBwcm94ICYmIGlzZGlnaXQgKCpwdHIpKQorICAgICAgICAgICAgKnB0ci0tID0g J1wwJzsKKyAgICAgICAgICByZXQgPSBtY193MzJfY29sb3JfbWFwX2xvb2t1cCAoYXBwcm94KTsK KyAgICAgICAgfQorICAgIH0KKyAgdW5ibG9ja19pbnB1dCAoKTsKKyAgcmV0dXJuIHJldDsKK30K KworLyogRGVjaWRlIGlmIGNvbG9yIG5hbWVkIENPTE9SIGlzIHZhbGlkIGZvciB0aGUgZGlzcGxh eSBhc3NvY2lhdGVkIHdpdGgKKyAgIHRoZSBzZWxlY3RlZCBmcmFtZTsgaWYgc28sIHJldHVybiB0 aGUgcmdiIHZhbHVlcyBpbiBDT0xPUl9ERUYuCisgICBJZiBBTExPQyBpcyBub256ZXJvLCBhbGxv Y2F0ZSBhIG5ldyBjb2xvcm1hcCBjZWxsLiAqLworaW50CittY193MzJfZGVmaW5lZF9jb2xvciAo c3RydWN0IGZyYW1lICpmLCBjb25zdCBjaGFyICpjb2xvciwgbWNfWENvbG9yICpjb2xvcl9kZWYs IGJvb2wgYWxsb2NfcCkKK3sKKyAgcmVnaXN0ZXIgTGlzcF9PYmplY3QgdGVtOworICBDT0xPUlJF RiB3MzJfY29sb3JfcmVmOworICB0ZW0gPSBtY194X3RvX3czMl9jb2xvciAoY29sb3IpOworICBp ZiAoIU5JTFAgKHRlbSkpCisgICAgeworICAgICAgaWYgKGYpCisgICAgICAgIHsKKyAgICAgICAg ICAvKiBBcHBseSBnYW1tYSBjb3JyZWN0aW9uLiAqLworICAgICAgICAgIHczMl9jb2xvcl9yZWYg PSBYVUZJWE5VTV9SQVcgKHRlbSk7CisgICAgICAgICAgZ2FtbWFfY29ycmVjdCAoZiwgJnczMl9j b2xvcl9yZWYpOworICAgICAgICAgIFhTRVRJTlQgKHRlbSwgdzMyX2NvbG9yX3JlZik7CisgICAg ICAgIH0KKyAgICAgIC8qIE1hcCB0aGlzIGNvbG9yIHRvIHRoZSBwYWxldHRlIGlmIGl0IGlzIGVu YWJsZWQuICovCisgICAgICBpZiAoIU5JTFAgKFZ3MzJfZW5hYmxlX3BhbGV0dGUpKQorICAgICAg ICB7CisgICAgICAgICAgc3RydWN0IHczMl9wYWxldHRlX2VudHJ5ICogZW50cnkgPSBvbmVfdzMy X2Rpc3BsYXlfaW5mby5jb2xvcl9saXN0OworICAgICAgICAgIHN0cnVjdCB3MzJfcGFsZXR0ZV9l bnRyeSAqKiBwcmV2ID0gJm9uZV93MzJfZGlzcGxheV9pbmZvLmNvbG9yX2xpc3Q7CisgICAgICAg ICAgLyogY2hlY2sgaWYgY29sb3IgaXMgYWxyZWFkeSBtYXBwZWQgKi8KKyAgICAgICAgICB3aGls ZSAoZW50cnkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmIChNQ19XMzJfQ09MT1Ig KGVudHJ5LT5lbnRyeSkgPT0gWFVGSVhOVU1fUkFXICh0ZW0pKQorICAgICAgICAgICAgICAgIGJy ZWFrOworICAgICAgICAgICAgICBwcmV2ID0gJmVudHJ5LT5uZXh0OworICAgICAgICAgICAgICBl bnRyeSA9IGVudHJ5LT5uZXh0OworICAgICAgICAgICAgfQorICAgICAgICAgIGlmIChlbnRyeSA9 PSBOVUxMICYmIGFsbG9jX3ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIC8qIG5vdCBh bHJlYWR5IG1hcHBlZCwgc28gYWRkIHRvIGxpc3QgKi8KKyAgICAgICAgICAgICAgZW50cnkgPSB4 bWFsbG9jIChzaXplb2YgKHN0cnVjdCB3MzJfcGFsZXR0ZV9lbnRyeSkpOworICAgICAgICAgICAg ICBNQ19XMzJfU0VUX0NPTE9SIChlbnRyeS0+ZW50cnksIFhVRklYTlVNX1JBVyAodGVtKSk7Cisg ICAgICAgICAgICAgIGVudHJ5LT5uZXh0ID0gTlVMTDsKKyAgICAgICAgICAgICAgKnByZXYgPSBl bnRyeTsKKyAgICAgICAgICAgICAgb25lX3czMl9kaXNwbGF5X2luZm8ubnVtX2NvbG9ycysrOwor ICAgICAgICAgICAgICAvKiBzZXQgZmxhZyB0aGF0IHBhbGV0dGUgbXVzdCBiZSByZWdlbmVyYXRl ZCAqLworICAgICAgICAgICAgICBvbmVfdzMyX2Rpc3BsYXlfaW5mby5yZWdlbl9wYWxldHRlID0g VFJVRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgLyogRW5zdXJlIENPTE9SUkVG IHZhbHVlIGlzIHNuYXBwZWQgdG8gbmVhcmVzdCBjb2xvciBpbiAoZGVmYXVsdCkKKyAgICAgICAg IHBhbGV0dGUgYnkgc2ltdWxhdGluZyB0aGUgUEFMRVRURVJHQiBtYWNyby4gIFRoaXMgd29ya3Mg d2hldGhlcgorICAgICAgICAgb3Igbm90IHRoZSBkaXNwbGF5IGRldmljZSBoYXMgYSBwYWxldHRl LiAqLworICAgICAgdzMyX2NvbG9yX3JlZiA9IFhVRklYTlVNX1JBVyAodGVtKSB8IDB4MjAwMDAw MDsKKyAgICAgIGNvbG9yX2RlZi0+cGl4ZWwgPSB3MzJfY29sb3JfcmVmOworICAgICAgY29sb3Jf ZGVmLT5yZWQgPSBHZXRSVmFsdWUgKHczMl9jb2xvcl9yZWYpICogMjU2OworICAgICAgY29sb3Jf ZGVmLT5ncmVlbiA9IEdldEdWYWx1ZSAodzMyX2NvbG9yX3JlZikgKiAyNTY7CisgICAgICBjb2xv cl9kZWYtPmJsdWUgPSBH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XRjaF9nbHlwaF9zdHJpbmcgKHN0cnVj dCBnbHlwaF9zdHJpbmcgKnMpCit7CisgIGVhc3NlcnQgKHMtPmZpcnN0X2dseXBoLT50eXBlID09 IFNUUkVUQ0hfR0xZUEgpOworICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IKKyAgICAgICYmICF4 X3N0cmV0Y2hfY3Vyc29yX3ApCisgICAgeworICAgICAgLyogSWYgYHgtc3RyZXRjaC1jdXJzb3In IGlzIG5pbCwgZG9uJ3QgZHJhdyBhIGJsb2NrIGN1cnNvciBhcyB3aWRlIGFzIHRoZQorICAgICAg c3RyZXRjaCBnbHlwaC4gKi8KKyAgICAgIGludCB3aWR0aCwgYmFja2dyb3VuZF93aWR0aCA9IHMt PmJhY2tncm91bmRfd2lkdGg7CisgICAgICBpbnQgeCA9IHMtPng7CisgICAgICBpZiAoIXMtPnJv dy0+cmV2ZXJzZWRfcCkKKyAgICAgICAgeworICAgICAgICAgIGludCBsZWZ0X3ggPSB3aW5kb3df Ym94X2xlZnRfb2Zmc2V0IChzLT53LCBURVhUX0FSRUEpOworICAgICAgICAgIGlmICh4IDwgbGVm dF94KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBiYWNrZ3JvdW5kX3dpZHRoIC09IGxl ZnRfeCAtIHg7CisgICAgICAgICAgICAgIHggPSBsZWZ0X3g7CisgICAgICAgICAgICB9CisgICAg ICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAvKiBJbiBSMkwgcm93 cywgZHJhdyB0aGUgY3Vyc29yIG9uIHRoZSByaWdodCBlZGdlIG9mIHRoZQorICAgICAgICAgICAg ICBzdHJldGNoIGdseXBoLiAqLworICAgICAgICAgICBpbnQgcmlnaHRfeCA9IHdpbmRvd19ib3hf cmlnaHQgKHMtPncsIFRFWFRfQVJFQSk7CisgICAgICAgICAgIGlmICh4ICsgYmFja2dyb3VuZF93 aWR0aCA+IHJpZ2h0X3gpCisgICAgICAgICAgICAgYmFja2dyb3VuZF93aWR0aCAtPSB4IC0gcmln aHRfeDsKKyAgICAgICAgICAgeCArPSBiYWNrZ3JvdW5kX3dpZHRoOworICAgICAgICAgfQorICAg ICAgd2lkdGggPSBtaW4gKEZSQU1FX0NPTFVNTl9XSURUSCAocy0+ZiksIGJhY2tncm91bmRfd2lk dGgpOworICAgICAgaWYgKHMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAgICAgICAgeCAtPSB3aWR0aDsK KyAgICAgIC8qIERyYXcgY3Vyc29yLiAqLworICAgICAgdzMyX2RyYXdfZ2x5cGhfc3RyaW5nX2Jn X3JlY3QgKHMsIHgsIHMtPnksIHdpZHRoLCBzLT5oZWlnaHQpOworICAgICAgLyogQ2xlYXIgcmVz dCB1c2luZyB0aGUgR0Mgb2YgdGhlIG9yaWdpbmFsIG5vbi1jdXJzb3IgZmFjZS4gKi8KKyAgICAg IGlmICh3aWR0aCA8IGJhY2tncm91bmRfd2lkdGgpCisgICAgICAgIHsKKyAgICAgICAgICBFbWFj c19HQyAqZ2MgPSBzLT5mYWNlLT5nYzsKKyAgICAgICAgICBpbnQgeSA9IHMtPnk7CisgICAgICAg ICAgaW50IHcgPSBiYWNrZ3JvdW5kX3dpZHRoIC0gd2lkdGgsIGggPSBzLT5oZWlnaHQ7CisgICAg ICAgICAgUkVDVCByOworICAgICAgICAgIEhEQyBoZGMgPSBzLT5oZGM7CisgICAgICAgICAgaWYg KCFzLT5yb3ctPnJldmVyc2VkX3ApCisgICAgICAgICAgICB4ICs9IHdpZHRoOworICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICB4ID0gcy0+eDsKKyAgICAgICAgICBpZiAocy0+cm93LT5t b3VzZV9mYWNlX3AKKyAgICAgICAgICAgICAgJiYgY3Vyc29yX2luX21vdXNlX2ZhY2VfcCAocy0+ dykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHczMl9zZXRfbW91c2VfZmFjZV9nYyAo cyk7CisgICAgICAgICAgICAgIGdjID0gcy0+Z2M7CisgICAgICAgICAgICB9CisgICAgICAgICAg ICBlbHNlCisgICAgICAgICAgICAgIGdjID0gcy0+ZmFjZS0+Z2M7CisgICAgICAgICAgZ2V0X2ds eXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsICZyKTsKKyAgICAgICAgICB3MzJfc2V0X2NsaXBfcmVj dGFuZ2xlIChoZGMsICZyKTsKKyNpZiAwIC8qIFRPRE86IHN0aXBwbGUgKi8KKyAgICAgICAgICBp ZiAocy0+ZmFjZS0+c3RpcHBsZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogRmls bCBiYWNrZ3JvdW5kIHdpdGggYSBzdGlwcGxlIHBhdHRlcm4uICovCisgICAgICAgICAgICAgIFhT ZXRGaWxsU3R5bGUgKHMtPmRpc3BsYXksIGdjLCBGaWxsT3BhcXVlU3RpcHBsZWQpOworICAgICAg ICAgICAgICBYRmlsbFJlY3RhbmdsZSAocy0+ZGlzcGxheSwgcy0+d2luZG93LCBnYywgeCwgeSwg dywgaCk7CisgICAgICAgICAgICAgIFhTZXRGaWxsU3R5bGUgKHMtPmRpc3BsYXksIGdjLCBGaWxs U29saWQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorI2VuZGlmCisgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIGdj LT5iYWNrZ3JvdW5kLCB4LCB5LCB3LCBoKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9Cisg ICAgfQorICAgIGVsc2UgaWYgKCFzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wKQorICAgICAgeworICAg ICAgICBpbnQgYmFja2dyb3VuZF93aWR0aCA9IHMtPmJhY2tncm91bmRfd2lkdGg7CisgICAgICAg IGludCB4ID0gcy0+eCwgbGVmdF94ID0gd2luZG93X2JveF9sZWZ0X29mZnNldCAocy0+dywgVEVY VF9BUkVBKTsKKyAgICAgICAgLyogRG9uJ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AgIH0KKyAgICAgICAgZWxzZSBpZiAocy0+aGwgPT0gRFJBV19NT1VTRV9G QUNFKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIHczMl9zZXRfbW91c2VfZmFjZV9nYyAocyk7 CisgICAgICAgICAgICBzLT5zdGlwcGxlZF9wID0gcy0+ZmFjZS0+c3RpcHBsZSAhPSAwOworICAg ICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmIChzLT5obCA9PSBEUkFXX0lNQUdFX1JBSVNFRAor ICAgICAgICAgICAgICAgICAgIHx8IHMtPmhsID09IERSQVdfSU1BR0VfU1VOS0VOKQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICBzLT5nYyA9IHMtPmZhY2UtPmdjOworICAgICAgICAgICAg ICBzLT5zdGlwcGxlZF9wID0gcy0+ZmFjZS0+c3RpcHBsZSAhPSAwOworICAgICAgICAgICAgfQor ICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBlbWFjc19hYm9ydCAoKTsKKyAgLyogR0Mg bXVzdCBoYXZlIGJlZW4gc2V0LiAqLworICBlYXNzZXJ0IChzLT5nYyAhPSAwKTsKK30KKworLyog RHJhdyBhIGhvbGxvdyBib3ggY3Vyc29yIG9uIHdpbmRvdyBXIGluIGdseXBoIHJvdyBST1cuICov CitzdGF0aWMgdm9pZAorbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAoc3RydWN0IHdpbmRvdyAq dywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgc3RydWN0IGdseXBoX3JvdyAqcm93LCBpbnQgeCwgaW50IGZ4LCBpbnQgeSwgaW50IGZ5LAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGhwb3MsIGludCB2cG9zLCBpbnQgd2QsIGlu dCBoKQoreworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOwor ICBIREMgaGRjOworICBSRUNUIHJlY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yAgICAg ICAgcmVsZWFzZV9mcmFtZV9kYyAoZiwgaGRjKTsKKyAgICAgIH0KK30KKworLyogUklGOiBEcmF3 IG9yIGNsZWFyIGN1cnNvciBvbiB3aW5kb3cgVy4gKi8KK3N0YXRpYyB2b2lkCittY193MzJfZHJh d193aW5kb3dfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICpt YXRyaXgsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKKyAgICAgICAgICAgICAgICAgIGludCB4LCBp bnQgZngsIGludCB5LCBpbnQgZnksIGludCBocG9zLCBpbnQgdnBvcywgaW50IHdkLCBpbnQgaCwK KyAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsLCBlbnVtIG1jX2N1cnNvcl90eXBl IGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aCwgZW51bSBt Y19mbGF2b3IgZ2x5cGhfZmxhdm9yLCBib29sIG9uX3AsIGJvb2wgYWN0aXZlX3ApCit7CisgIGlm IChvbl9wKQorICAgIHsKKyAgICAgIC8qIElmIHRoaXMgaXMgdGhlIGFjdGl2ZSBjdXJzb3IsIHdl IG5lZWQgdG8gdHJhY2sgaXQgd2l0aCB0aGUKKyAgICAgIHN5c3RlbSBjYXJldCwgc28gdGhpcmQg cGFydHkgc29mdHdhcmUgbGlrZSBzY3JlZW4gbWFnbmlmaWVycworICAgICAgYW5kIHNwZWVjaCBz eW50aGVzaXplcnMgY2FuIGZvbGxvdyB0aGUgY3Vyc29yLiAqLworICAgICAgaWYgKGFjdGl2ZV9w KQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1df RlJBTUUgKHcpKTsKKyAgICAgICAgICBIV05EIGh3bmQgPSBGUkFNRV9XMzJfV0lORE9XIChmKTsK KyAgICAgICAgICB3MzJfc3lzdGVtX2NhcmV0X3gKKyAgICAgICAgICAgID0gV0lORE9XX1RFWFRf VE9fRlJBTUVfUElYRUxfWCAodywgeCk7CisgICAgICAgICAgLyogRklYTUU6ICBXaGF0IHNob3Vs ZCB3ZSB1c2UgaW5zdGVhZCBvZiBgdy0+cGh5c19jdXJzb3JfYXNjZW50Jz8gKi8KKyAgICAgICAg ICB3MzJfc3lzdGVtX2NhcmV0X3kKKyAgICAgICAgICAgID0gKFdJTkRPV19UT19GUkFNRV9QSVhF TF9ZICh3LCB5KQorICAgICAgICAgICAgICAgKyByb3ctPmFzY2VudCAtIHctPnBoeXNfY3Vyc29y X2FzY2VudCk7CisgICAgICAgICAgdzMyX3N5c3RlbV9jYXJldF93aW5kb3cgPSB3OworICAgICAg ICAgIHczMl9zeXN0ZW1fY2FyZXRfaGRyX2hlaWdodCA9IFdJTkRPV19IRUFERVJfTElORV9IRUlH SFQgKHcpOworICAgICAgICAgIHczMl9zeXN0ZW1fY2FyZXRfbW9kZV9oZWlnaHQgPSBXSU5ET1df TU9ERV9MSU5FX0hFSUdIVCAodyk7CisgICAgICAgICAgUG9zdE1lc3NhZ2UgKGh3bmQsIFdNX0lN RV9TVEFSVENPTVBPU0lUSU9OLCAwLCAwKTsKKyAgICAgICAgICAvKiBJZiB0aGUgc2l6ZSBvZiB0 aGUgYWN0aXZlIGN1cnNvciBjaGFuZ2VkLCBkZXN0cm95IHRoZSBvbGQKKyAgICAgICAgICAgICBz eXN0ZW0gY2FyZXQuICovCisgICAgICAgICAgaWYgKHczMl9zeXN0ZW1fY2FyZXRfaHduZAorICAg ICAgICAgICAgICAmJiAodzMyX3N5c3RlbV9jYXJldF9oZWlnaHQgIT0gaCkpCisgICAgICAgICAg ICBQb3N0TWVzc2FnZSAoaHduZCwgV01fRU1BQ1NfREVTVFJPWV9DQVJFVCwgMCwgMCk7CisgICAg ICAgICAgdzMyX3N5c3RlbV9jYXJldF9oZWlnaHQgPSBoOworICAgICAgICAgIC8qIE1vdmUgdGhl IHN5c3RlbSBjYXJldC4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AgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2Vf aWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29y LXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xs b3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7 CisgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2Zh Y2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBo b2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZS0+YmFja2dyb3VuZDsKKyAgICAgICAgICAgICAg fQorICAgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgJiYgYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2ds eXBoLT5jaGFycG9zID4gcmVnaW9uX2JlZworICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJz b3JfZ2x5cGgtPmNoYXJwb3MgPCByZWdpb25fZW5kKQorICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2Zh Y2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vy c29yLWluLXJlZ2lvbi1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgIHN0 cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2UgPSBGQUNFX0Z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ICAgICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNv ciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAg ICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJz b3JfcGl4ZWw7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1 cnNvcl9nYycgYnkgYm9ycm93aW5nIHRoZQorICAgICAgICAgICAgICBmdW5jdGlvbmFsaXR5IG9m IGB4X21ha2VfZ2MnIGluIHczMmZucy5jLiAqLworICAgICAgICAgICAgICBpZiAocmVnaW9uX2Fj dGl2ZV9wCisgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcAorICAgICAgICAgICAgICAgICAg JiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID09IHJlZ2lvbl9iZWcpCisgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2Jl Z19mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtl LWN1cnNvci1hdC1yZWdpb24tcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAg ICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9yZWdpb25fYmVnX2ZhY2UgPSBGQUNFX0ZST01f SUQgKGYsIGhvbGxvd19hY3RpdmVfcmVnaW9uX2JlZ19mYWNlX2lkKTsKKyAgICAgICAgICAgICAg ICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFj ZSAodywgZiwg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X2ZhY2UgKHcsIGYsIGlu dGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAg ICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9J RCAoZiwgaG9sbG93X2FjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAgZ2NfdmFs dWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAg ICAgICAgICAgICAgIGdjX3ZhbHVlcy5iYWNrZ3JvdW5kID0gaG9sbG93X2FjdGl2ZV9yZWdpb25f ZW5kX2ZhY2UtPmJhY2tncm91bmQ7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAg ICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIGFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgt PmNoYXJwb3MgPiByZWdpb25fYmVnCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJz b3JfZ2x5cGgtPmNoYXJwb3MgPCByZWdpb25fZW5kKQorICAgICAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2Jl dHdlZW5fZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwt ZmFrZS1jdXJzb3ItaW4tcmVnaW9uLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAg ICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2Ug PSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZV9pZCk7 CisgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfZmFjZV9p ZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3It cHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2Ug KmhvbGxvd19hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2FjdGl2ZV9mYWNl X2lkKTsKKyAgICAgICAgICAgICAgICAgICAgICBnY192YWx1ZXMuZm9yZWdyb3VuZCA9IGhvbGxv d19hY3RpdmVfZmFjZS0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICBnY192YWx1 ZXMuYmFja2dyb3VuZCA9IGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZS0+Zm9yZWdy b3VuZDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlIGlm IChhY3RpdmVfcCkKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAg ICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2Zh Y2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVl KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2Zh Y2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAg ICAgICAgICAgICAgICBnY192YWx1ZXMuZm9yZWdyb3VuZCA9IGhvbGxvd19hY3RpdmVfZmFjZS0+ Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5iYWNrZ3JvdW5k ID0gaG9sbG93X2FjdGl2ZV9mYWNlLT5iYWNrZ3JvdW5kOworICAgICAgICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICghYWN0aXZlX3ApCisgICAgICAgICAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBo b2xsb3dfaW5hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4g KCIrLXJlYWwtZmFrZS1jdXJzb3ItaW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAg ICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9 IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAg ICAgICAgICAgICAgICBnY192YWx1ZXMuZm9yZWdyb3VuZCA9IGhvbGxvd19pbmFjdGl2ZV9mYWNl LT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICAgICAgICAgICAgICBnY192YWx1ZXMuYmFja2dy b3VuZCA9IGhvbGxvd19pbmFjdGl2ZV9mYWNlLT5iYWNrZ3JvdW5kOworICAgICAgICAgICAgICAg ICAgICAgICAgfQorICAgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYyA9 IFhDcmVhdGVHQyAoTlVMTCwgRlJBTUVfVzMyX1dJTkRPVyAoZiksIG1hc2ssICZnY192YWx1ZXMp OworICAgICAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgLyogRm9yY2Ug YG1jX3czMl9zZXRfY3Vyc29yX2djJyB0byB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLnczMi0+Y3Vy c29yX2djJy4gKi8KKyAgICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IHRydWU7CisgICAg ICAgICAgICAgIG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywgRFJBV19DVVJT T1IsIHgsIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBs c2wsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3Ap OworICAgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYyA9IG9yaWdpbmFs X2N1cnNvcl9nYzsKKyAgICAgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAg ICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBm eSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAg fQorICAgIGNhc2UgTUNfSE9MTE9XX0JPWDoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAw ICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAg ICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVs Jy4gKi8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9y X3BpeGVsOworICAgICAgICAgIG1jX3czMl9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwg cm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAgICAgICAgICBmLT5vdXRw dXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAg ICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAo dywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAg YnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAgICB7CisgICAgICBpZiAo bHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAg IHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+ Y3Vyc29yX2djJyBieSBib3Jyb3dpbmcgdGhlCisgICAgICAgICAgZnVuY3Rpb25hbGl0eSBvZiBg eF9tYWtlX2djJyBpbiB3MzJmbnMuYy4gKi8KKyAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAg ICAgICAgICBFbWFjc19HQyBnY192YWx1ZXM7CisgICAgICAgICAgdW5zaWduZWQgbG9uZyBtYXNr ID0gR0NGb3JlZ3JvdW5kIHwgR0NCYWNrZ3JvdW5kOworICAgICAgICAgIGdjX3ZhbHVlcy5mb3Jl Z3JvdW5kID0gRlJBTUVfQkFDS0dST1VORF9QSVhFTCAoZik7CisgICAgICAgICAgZ2NfdmFsdWVz LmJhY2tncm91bmQgPSBjb2xvcl9waXhlbDsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzIt PmN1cnNvcl9nYyA9IFhDcmVhdGVHQyAoTlVMTCwgRlJBTUVfVzMyX1dJTkRPVyAoZiksIG1hc2ss ICZnY192YWx1ZXMpOworICAgICAgICAgIC8qIEZvcmNlIGBtY193MzJfc2V0X2N1cnNvcl9nYycg dG8gdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycuICovCisgICAgICAgICAg Ym9vbCBjdXJzb3JfZ2NfcCA9IHRydWU7CisgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGgg KHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywgbHNsLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwg YWN0aXZlX3AsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1 cnNvcl9nYyA9IG9yaWdpbmFsX2N1cnNvcl9nYzsKKyAgICAgICAgICB1bmJsb2NrX2lucHV0ICgp OworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBib29s IGN1cnNvcl9nY19wID0gZmFsc2U7CisgICAgICAgICAgICBtY19kcmF3X2N1cnNvcl9nbHlwaCAo dywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4LCBocG9zLCB2cG9zLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2Qs IGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9nY19w KTsKKyAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBNQ19CQVI6Cisg ICAgeworICAgICAgaWYgKGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wuYmx1 ZSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5v dXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcuICovCisgICAgICAgICAgZi0+b3V0cHV0X2Rh dGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBjb2xvcl9waXhlbDsKKyAgICAgICAgICBib29sIGN1cnNv cl9nY19pbnZpc2libGVfb2theV9wID0gdHJ1ZTsKKyAgICAgICAgICBtY193MzJfZHJhd19iYXJf Y3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0JBUiwg Y3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLncz Mi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAg ICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2li bGVfb2theV9wID0gZmFsc2U7CisgICAgICAgICAgICBtY193MzJfZHJhd19iYXJfY3Vyc29yICh3 LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl93aWR0aCwgTUNfQkFSLCBjdXJzb3Jf Z2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQor ICAgIGNhc2UgTUNfSEJBUjoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5n cmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1w b3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4gKi8KKyAg ICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOwor ICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSB0cnVlOworICAgICAg ICAgIG1jX3czMl9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnks IGhwb3MsIHZwb3MsIHdkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGgsIGN1 cnNvcl93aWR0aCwgTUNfSEJBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAg ICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3Bp eGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBi b29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7CisgICAgICAgICAgICBtY193 MzJfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2 cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl93 aWR0aCwgTUNfSEJBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIH0K KyAgICAgIGJyZWFrOworICAgIH0KKyAgICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7 CisgIH0KKyAgICB9Cit9CisKKy8qIERyYXcgZ2x5cGggc3RyaW5nIFMuICovCitzdGF0aWMgdm9p ZAorbWNfdzMyX2RyYXdfZ2x5cGhfc3RyaW5nIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzLCBzdHJ1 Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2wsIGVudW0gbWNfZmxhdm9yIGdseXBo X2ZsYXZvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBj dXJzb3JfdHlwZSwgaW50IGN1cnNv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dHJldGNoX2ds eXBoX3N0cmluZyAobmV4dCk7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB3 MzJfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAobmV4dCwgdHJ1ZSk7CisgICAgICAgICAg ICBuZXh0LT5udW1fY2xpcHMgPSAwOworICAgICAgICAgIH0KKyAgICB9CisgIC8qIFNldCB1cCBT LT5nYywgc2V0IGNsaXBwaW5nIGFuZCBkcmF3IFMuICovCisgIG1jX3czMl9zZXRfZ2x5cGhfc3Ry aW5nX2djIChzLCBjdXJzb3JfZ2NfcCk7CisgIC8qIERyYXcgcmVsaWVmIChpZiBhbnkpIGluIGFk dmFuY2UgZm9yIGNoYXIvY29tcG9zaXRpb24gc28gdGhhdCB0aGUKKyAgICAgZ2x5cGggc3RyaW5n IGNhbiBiZSBkcmF3biBvdmVyIGl0LiAqLworICBpZiAoIXMtPmZvcl9vdmVybGFwcworICAgICAg JiYgcy0+ZmFjZS0+Ym94ICE9IEZBQ0VfTk9fQk9YCisgICAgICAmJiAocy0+Zmlyc3RfZ2x5cGgt PnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgIHx8IHMtPmZpcnN0X2dseXBoLT50eXBlID09 IENPTVBPU0lURV9HTFlQSCkpCisgICAgeworICAgICAgdzMyX3NldF9nbHlwaF9zdHJpbmdfY2xp cHBpbmcgKHMpOworICAgICAgdzMyX2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKHMsIHRy dWUpOworICAgICAgdzMyX2RyYXdfZ2x5cGhfc3RyaW5nX2JveCAocyk7CisgICAgICB3MzJfc2V0 X2dseXBoX3N0cmluZ19jbGlwcGluZyAocyk7CisgICAgICByZWxpZWZfZHJhd25fcCA9IDE7Cisg ICAgfQorICBlbHNlIGlmICghcy0+Y2xpcF9oZWFkIC8qIGRyYXdfZ2x5cGhzIGRpZG4ndCBzcGVj aWZ5IGEgY2xpcCBtYXNrLiAqLworICAgICAg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2ds eXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgQ09NUE9T SVRFX0dMWVBIOgorICAgICAgaWYgKHMtPmZvcl9vdmVybGFwcyB8fCAocy0+Y21wX2Zyb20gPiAw CisgICAgICAgICAgJiYgISBzLT5maXJzdF9nbHlwaC0+dS5jbXAuYXV0b21hdGljKSkKKyAgICAg ICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICBlbHNlCisgICAgICAgIHcz Ml9kcmF3X2dseXBoX3N0cmluZ19iYWNrZ3JvdW5kIChzLCB0cnVlKTsKKyAgICAgIHczMl9kcmF3 X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAgICBicmVhazsKKyAg ICBjYXNlIEdMWVBITEVTU19HTFlQSDoKKyAgICAgIGlmIChzLT5mb3Jfb3ZlcmxhcHMpCisgICAg ICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVlOworICAgICAgZWxzZQorICAgICAgICB3 MzJfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgZmFsc2UpOworICAgICAgdzMyX2Ry YXdfZ2x5cGhsZXNzX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAgICAgIGJyZWFrOwor ICAgIGRlZmF1bHQ6CisgICAgICBlbWFjc19hYm9ydCAoKTsKKyAgICB9CisgIGlmICghcy0+Zm9y X292ZXJsYXBzKQorICAgIHsKKyAgICAgIC8qIERyYXcgdW5kZXJsaW5lLiAqLworICAgICAgaWYg KHMtPmZhY2UtPnVuZGVybGluZV9wKQorICAgICAgICB7CisgICAgICAgICAgaWYgKHMtPmZhY2Ut PnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfV0FWRSkKKyAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgQ09MT1JSRUYgY29sb3I7CisgICAgICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRl cmxpbmVfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICAgICAgY29sb3IgPSBzLT5nYy0+Zm9yZWdy b3VuZDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjb2xvciA9IHMt PmZhY2UtPnVuZGVybGluZV9jb2xvcjsKKyAgICAgICAgICAgICAgdzMyX2RyYXdfdW5kZXJ3YXZl IChzLCBjb2xvcik7CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxzZSBpZiAocy0+ZmFjZS0+ dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICB1bnNpZ25lZCBsb25nIHRoaWNrbmVzcywgcG9zaXRpb247CisgICAgICAgICAgICAg IGludCB5OworICAgICAgICAgICAgICBpZiAocy0+cHJldiAmJiBzLT5wcmV2LT5mYWNlLT51bmRl cmxpbmVfcAorICAgICAgICAgICAgICAgICAgJiYgcy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3R5 cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg ICAgIC8qIFdlIHVzZSB0aGUgc2FtZSB1bmRlcmxpbmUgc3R5bGUgYXMgdGhlIHByZXZpb3VzIG9u ZS4gKi8KKyAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPnByZXYtPnVuZGVybGluZV90 aGlja25lc3M7CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPnByZXYtPnVuZGVybGlu ZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVybGluZSB0aGlj a25lc3MuICBEZWZhdWx0IGlzIDEgcGl4ZWwuICovCisgICAgICAgICAgICAgICAgICBpZiAocy0+ Zm9udCAmJiBzLT5mb250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4gMCkKKyAgICAgICAgICAgICAg ICAgICAgdGhpY2tuZXNzID0gcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAgICAg ICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IDE7Cisg ICAgICAgICAgICAgICAgICBpZiAoeF91bmRlcmxpbmVfYXRfZGVzY2VudF9saW5lKQorICAgICAg ICAgICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5oZWlnaHQgLSB0aGlja25lc3MpIC0gKHMtPnli YXNlIC0gcy0+eSk7CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAg ICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVybGluZSBwb3Np dGlvbi4gIFRoaXMgaXMgdGhlIHJlY29tbWVuZGVkCisgICAgICAgICAgICAgICAgICAgICAgICAg ICB2ZXJ0aWNhbCBvZmZzZXQgaW4gcGl4ZWxzIGZyb20gdGhlIGJhc2VsaW5lIHRvIHRoZSB0b3Ag b2YKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSB1bmRlcmxpbmUuICBUaGlzIGlzIGEg c2lnbmVkIHZhbHVlIGFjY29yZGluZyB0byB0aGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAg IHNwZWNzLCBhbmQgaXRzIGRlZmF1bHQgaXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIFJP VU5EICgobWF4aW11bV9kZXNjZW50KSAvIDIpLCB3aXRoCisgICAgICAgICAgICAgICAgICAgICAg ICAgICBST1VORCAoeCkgPSBmbG9vciAoeCArIDAuNSkgICovCisgICAgICAgICAgICAgICAgICAg ICAgICBpZiAoeF91c2VfdW5kZXJsaW5lX3Bvc2l0aW9uX3Byb3BlcnRpZXMKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBzLT5mb250ICYmIHMtPmZvbnQtPnVuZGVybGluZV9wb3NpdGlv biA+PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPmZvbnQtPnVu ZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHMtPmZv bnQpCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmZvbnQtPmRlc2Nl bnQgKyAxKSAvIDI7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAg cG9zaXRpb24gPSBtYXggKHBvc2l0aW9uLCB1bmRlcmxpbmVfbWluaW11bV9vZmZzZXQpOworICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgLyogQ2hlY2sgdGhlIHNhbml0eSBvZiB0aGlj a25lc3MgYW5kIHBvc2l0aW9uLiAgV2Ugc2hvdWxkCisgICAgICAgICAgICAgICAgIGF2b2lkIGRy YXdpbmcgdW5kZXJsaW5lIG91dCBvZiB0aGUgY3VycmVudCBsaW5lIGFyZWEuICovCisgICAgICAg ICAgICAgIGlmIChzLT55ICsgcy0+aGVpZ2h0IDw9IHMtPnliYXNlICsgcG9zaXRpb24pCisgICAg ICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+aGVpZ2h0IC0gMSkgLSAocy0+eWJhc2UgLSBzLT55 KTsKKyAgICAgICAgICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQgPCBzLT55YmFzZSArIHBvc2l0 aW9uICsgdGhpY2tuZXNzKQorICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IChzLT55ICsgcy0+ aGVpZ2h0KSAtIChzLT55YmFzZSArIHBvc2l0aW9uKTsKKyAgICAgICAgICAgICAgcy0+dW5kZXJs aW5lX3RoaWNrbmVzcyA9IHRoaWNrbmVzczsKKyAgICAgICAgICAgICAgcy0+dW5kZXJsaW5lX3Bv c2l0aW9uID1wb3NpdGlvbjsKKyAgICAgICAgICAgICAgeSA9IHMtPnliYXNlICsgcG9zaXRpb247 CisgICAgICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3ApCisgICAg ICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5nYy0+Zm9yZWdyb3Vu ZCwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5LCBzLT53aWR0aCwgMSk7 CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAo cy0+Ziwgcy0+aGRjLCBzLT5mYWNlLT51bmRlcmxpbmVfY29sb3IsIHMtPngsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICB5LCBzLT53aWR0aCwgMSk7CisgICAgICAgICAgICB9Cisg ICAgICAgIH0KKyAgICAgIC8qIERyYXcgb3ZlcmxpbmUuICovCisgICAgICBpZiAocy0+ZmFjZS0+ b3ZlcmxpbmVfcCkKKyAgICAgICAgeworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZHkgPSAwLCBo ID0gMTsKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+b3ZlcmxpbmVfY29sb3JfZGVmYXVsdGVkX3Ap CisgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmdjLT5mb3JlZ3Jv dW5kLCBzLT54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+eSArIGR5LCBzLT53aWR0 aCwgaCk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMt PmYsIHMtPmhkYywgcy0+ZmFjZS0+b3ZlcmxpbmVfY29sb3IsIHMtPngsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHMtPnkgKyBkeSwgcy0+d2lkdGgsIGgpOworICAgICAgICB9CisgICAg ICAvKiBEcmF3IHN0cmlrZS10aHJvdWdoLiAqLworICAgICAgaWYgKHMtPmZhY2UtPnN0cmlrZV90 aHJvdWdoX3AKKyAgICAgICAgICAmJiAhRk9OVF9URVhUTUVUUklDIChzLT5mb250KS50bVN0cnVj a091dCkKKyAgICAgICAgeworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgaCA9IDE7CisgICAgICAg ICAgdW5zaWduZWQgbG9uZyBkeSA9IChzLT5oZWlnaHQgLSBoKSAvIDI7CisgICAgICAgICAgaWYg KHMtPmZhY2UtPnN0cmlrZV90aHJvdWdoX2NvbG9yX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAg dzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5nYy0+Zm9yZWdyb3VuZCwgcy0+eCwgcy0+ eSArIGR5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+d2lkdGgsIGgpOworICAgICAg ICAgICAgZWxzZQorICAgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMt PmZhY2UtPnN0cmlrZV90aHJvdWdoX2NvbG9yLCBzLT54LAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBzLT55ICsgZHksIHMtPndpZHRoLCBoKTsKKyAgICAgICAgfQorICAgICAgLyogRHJh dyByZWxpZWYgaWYgbm90IHlldCBkcmF3bi4gKi8KKyAgICAgIGlmICghcmVsaWVmX2RyYXduX3Ag JiYgcy0+ZmFjZS0+Ym94ICE9IEZBQ0VfTk9fQk9YKQorICAgICAgICB3MzJfZHJhd19nbHlwaF9z dHJpbmdfYm94IChzKTsKKyAgICAgIGlmIChzLT5wcmV2KQorICAgICAgICB7CisgICAgICAgICAg c3RydWN0IGdseXBoX3N0cmluZyAqcHJldjsKKyAgICAgICAgICBmb3IgKHByZXYgPSBzLT5wcmV2 OyBwcmV2OyBwcmV2ID0gcHJldi0+cHJldikKKyAgICAgICAgICAgIGlmIChwcmV2LT5obCAhPSBz LT5obAorICAgICAgICAgICAgICAgICYmIHByZXYtPnggKyBwcmV2LT53aWR0aCArIHByZXYtPnJp Z2h0X292ZXJoYW5nID4gcy0+eCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8q IEFzIHByZXYgd2FzIGRyYXduIHdoaWxlIGNsaXBwZWQgdG8gaXRzIG93biBhcmVhLCB3ZQorICAg ICAgICAgICAgICAgICAgIG11c3QgZHJhdyB0aGUgcmlnaHRfb3ZlcmhhbmcgcGFydCB1c2luZyBz LT5obCBub3cuICovCisgICAgICAgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIHNhdmUg PSBwcmV2LT5obDsKKyAgICAgICAgICAgICAgICBwcmV2LT5obCA9IHMtPmhsOworICAgICAgICAg ICAgICAgIG1jX3czMl9zZXRfZ2x5cGhfc3RyaW5nX2djIChwcmV2LCBjdXJzb3JfZ2NfcCk7Cisg ICAgICAgICAgICAgICAgdzMyX3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywg cHJldik7CisgICAgICAgICAgICAgICAgaWYgKHByZXYtPmZpcnN0X2dseXBoLT50eXBlID09IENI QVJfR0xZUEgpCisgICAgICAgICAgICAgICAgICB3MzJfZHJhd19nbHlwaF9zdHJpbmdfZm9yZWdy b3VuZCAocHJldik7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAg IHczMl9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocHJldik7CisgICAg ICAgICAgICAgICAgdzMyX3NldF9jbGlwX3JlY3RhbmdsZSAocHJldi0+aGRjLCBOVUxMKTsKKyAg ICAgICAgICAgICAgICBwcmV2LT5obCA9IHNhdmU7CisgICAgICAgICAgICAgICAgcHJldi0+bnVt X2NsaXBzID0gMDsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBpZiAocy0+bmV4 dCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBnbHlwaF9zdHJpbmcgKm5leHQ7CisgICAg ICAgICAgZm9yIChuZXh0ID0gcy0+bmV4dDsgbmV4dDsgbmV4dCA9IG5leHQtPm5leHQpCisgICAg ICAgICAgICBpZiAobmV4dC0+aGwgIT0gcy0+aGwKKyAgICAgICAgICAgICAgICAmJiBuZXh0LT54 IC0gbmV4dC0+bGVmdF9vdmVyaGFuZyA8IHMtPnggKyBzLT53aWR0aCkKKyAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgIC8qIEFzIG5leHQgd2lsbCBiZSBkcmF3biB3aGlsZSBjbGlwcGVk IHRvIGl0cyBvd24gYXJlYSwKKyAgICAgICAgICAgICAgICAgICB3ZSBtdXN0IGRyYXcgdGhlIGxl ZnRfb3ZlcmhhbmcgcGFydCB1c2luZyBzLT5obCBub3cuICovCisgICAgICAgICAgICAgICAgZW51 bSBkcmF3X2dseXBoc19mYWNlIHNhdmUgPSBuZXh0LT5obDsKKyAgICAgICAgICAgICAgICBuZXh0 LT5obCA9IHMtPmhsOworICAgICAgICAgICAgICAgIG1jX3czMl9zZXRfZ2x5cGhfc3RyaW5nX2dj IChuZXh0LCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgICAgICAgdzMyX3NldF9nbHlwaF9zdHJp bmdfY2xpcHBpbmdfZXhhY3RseSAocywgbmV4dCk7CisgICAgICAgICAgICAgICAgaWYgKG5leHQt PmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgpCisgICAgICAgICAgICAgICAgICB3MzJf ZHJhd19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAobmV4dCk7CisgICAgICAgICAgICAgICAgICBl bHNlCisgICAgICAgICAgICAgICAgICAgIHczMl9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdf Zm9yZWdyb3VuZCAobmV4dCk7CisgICAgICAgICAgICAgICAgdzMyX3NldF9jbGlwX3JlY3Rhbmds ZSAobmV4dC0+aGRjLCBOVUxMKTsKKyAgICAgICAgICAgICAgICBuZXh0LT5obCA9IHNhdmU7Cisg ICAgICAgICAgICAgICAgbmV4dC0+bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICAgICAgICBuZXh0 LT5jbGlwX2hlYWQgPSBzLT5uZXh0OworICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9 CisgIC8qIFJlc2V0IGNsaXBwaW5nLiAqLworICB3MzJfc2V0X2NsaXBfcmVjdGFuZ2xlIChzLT5o ZGMsIE5VTEwpOworICBzLT5udW1fY2xpcHMgPSAwOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VS U09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogLyogRnJpbmdlIGJpdG1hcHMu ICAqLwogCiBzdGF0aWMgaW50IG1heF9mcmluZ2VfYm1wID0gMDsKQEAgLTU0Miw2ICsxNzAxLDE1 IEBAIHczMl91cGRhdGVfYmVnaW4gKHN0cnVjdCBmcmFtZSAqZikKICAgaWYgKCEgRlJBTUVfVzMy X1AgKGYpKQogICAgIHJldHVybjsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1V TFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGluZ19mcmFtZSA9IGY7CisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICAgLyogUmVnZW5lcmF0ZSBkaXNwbGF5IHBhbGV0dGUg YmVmb3JlIGRyYXdpbmcgaWYgbGlzdCBvZiByZXF1ZXN0ZWQKICAgICAgY29sb3JzIGhhcyBjaGFu Z2VkLiAqLwogICBpZiAoZGlzcGxheV9pbmZvLT5yZWdlbl9wYWxldHRlKQpAQCAtNjc0LDYgKzE4 NDIsMTYgQEAgdzMyX3VwZGF0ZV9lbmQgKHN0cnVjdCBmcmFtZSAqZikKIAogICAvKiBNb3VzZSBo aWdobGlnaHQgbWF5IGJlIGRpc3BsYXllZCBhZ2Fpbi4gICovCiAgIE1PVVNFX0hMX0lORk8gKGYp LT5tb3VzZV9mYWNlX2RlZmVyID0gZmFsc2U7CisKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBOVUxM OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiB9CiAKIApAQCAtNDAwMiwxMyArNTE4 MCw3NCBAQCB3MzJfc2V0X3ZlcnRpY2FsX3Njcm9sbF9iYXIgKHN0cnVjdCB3aW5kb3cgKncsCiAJ ICAgICAgcmVsZWFzZV9mcmFtZV9kYyAoZiwgaGRjKTsKIAkgICAgICB3MzJfY2xlYXJfdW5kZXJf aW50ZXJuYWxfYm9yZGVyIChmKTsKIAkgICAgfQorCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCisvKiBSRVBBSU5USU5HIFdIRU4gUkVN T1ZJTkcgU0NST0xMIEJBUjoKKworLSBTZXF1ZW5jZSBvZiBFdmVudHM6CisKKyAgLiBgcmVkaXNw bGF5X2ludGVybmFsJyBjYWxscyB0aGUgYGNvbmRlbW5fc2Nyb2xsX2JhcnNfaG9vaycsIHdoaWNo IG1hcmtzIGFsbAorICAgIHNjcm9sbCBiYXJzIGFzIGNhbmRpZGF0ZXMgZm9yIGRlbGV0aW9uLgor CisgIC4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aGVuIGEgdXNlcgor c2hyaW5rcyB0aGUgd2lkdGggb2YgYSB3aW5kb3csIHdlIHdhbnQgdG8gcmVwYWludCBzbyB0aGF0 IHRoZSBuZXcgc2Nyb2xsIGJhcgord2luZG93IGlzIHVwZGF0ZWQuICovCisKICAgICAgICAgICAv KiBNYWtlIHN1cmUgc2Nyb2xsIGJhciBpcyAidmlzaWJsZSIgYmVmb3JlIG1vdmluZywgdG8gZW5z dXJlIHRoZQogICAgICAgICAgICAgIGFyZWEgb2YgdGhlIHBhcmVudCB3aW5kb3cgbm93IGV4cG9z ZWQgd2lsbCBiZSByZWZyZXNoZWQuICAqLwotICAgICAgICAgIG15X3Nob3dfd2luZG93IChmLCBo d25kLCBTV19ISURFKTsKLS8qKiAgICAgICAgICAgTW92ZVdpbmRvdyAoaHduZCwgbGVmdCwgdG9w LCB3aWR0aCwgbWF4IChoZWlnaHQsIDEpLCBUUlVFKTsgKiovCi0JICAvKiBUcnkgdG8gbm90IGRy YXcgb3ZlciBjaGlsZCBmcmFtZXMuICAqLwotCSAgU2V0V2luZG93UG9zIChod25kLCBIV05EX0JP VFRPTSwgbGVmdCwgdG9wLCB3aWR0aCwgbWF4IChoZWlnaHQsIDEpLAotICAgICAgICAgICAgICAg ICAgICAgICAgU1dQX0ZSQU1FQ0hBTkdFRCk7CisgICAgICAgICAgaWYgKGxlZnQgPD0gYmFyLT5s ZWZ0KQorICAgICAgICAgICAgbXlfc2hvd193aW5kb3cgKGYsIGh3bmQsIFNXX0hJREUpOworICAg ICAgICAgIE1vdmVXaW5kb3cgKGh3bmQsIGxlZnQsIHRvcCwgd2lkdGgsIG1heCAoaGVpZ2h0LCAx KSwgbGVmdCA8PSBiYXItPmxlZnQpOworCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKIAogCSAgc2kuY2JTaXplID0gc2l6ZW9mIChzaSk7CiAJ ICBzaS5mTWFzayA9IFNJRl9SQU5HRTsKQEAgLTQyNzcsNiArNTUxNiwyMSBAQCB3MzJfanVkZ2Vf c2Nyb2xsX2JhcnMgKHN0cnVjdCBmcmFtZSAqZikKICAgICB7CiAgICAgICBzdHJ1Y3Qgc2Nyb2xs X2JhciAqYiA9IFhTQ1JPTExfQkFSIChiYXIpOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICAvKiBgRGVzdHJveVdpbmRvdycgd2l0 aGluIGB4X3Njcm9sbF9iYXJfcmVtb3ZlJyByZXBhaW50cyB0aGUgcmVjdGFuZ2xlLgorICAgICAg VGhlcmVmb3JlLCB3ZSBmaXJzdCBzZW5kIGEgbWVzc2FnZSB0byBpbmhpYml0IHJlcGFpbnRpbmcu ICovCisgICAgICBpZiAoIVdJTkRPV19MSVZFX1AgKGItPndpbmRvdykpCisgICAgICAgIHsKKyAg ICAgICAgICBIV05EIGh3bmQgPSBTQ1JPTExfQkFSX1czMl9XSU5ET1cgKGIpOworICAgICAgICAg IFNlbmRNZXNzYWdlIChod25kLCBXTV9TRVRSRURSQVcsIGZhbHNlLCAwKTsKKyAgICAgICAgfQor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICB3MzJfc2Nyb2xsX2Jhcl9yZW1v dmUgKGIpOwogCiAgICAgICBuZXh0ID0gYi0+bmV4dDsKQEAgLTcwODgsNiArODM0MiwyMCBAQCBl eHRlcm4gZnJhbWVfcGFybV9oYW5kbGVyIHczMl9mcmFtZV9wYXJtX2hhbmRsZXJzW107CiAKIHN0 YXRpYyBzdHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFjZSB3MzJfcmVkaXNwbGF5X2ludGVyZmFjZSA9 CiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKy8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgdzMydGVybS5jYCBtdXN0IGJlIGluIHRo ZSBleGFjdCBzYW1lIG9yZGVyIGFzIHRoZQorYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGBkaXNw ZXh0ZXJuLmhgISAqLworCisgIG1jX3czMl9kcmF3X3dpbmRvd19jdXJzb3IsCisgIG1jX3czMl9k cmF3X2dseXBoX3N0cmluZywKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICB3MzJf ZnJhbWVfcGFybV9oYW5kbGVycywKICAgZ3VpX3Byb2R1Y2VfZ2x5cGhzLAogICBndWlfd3JpdGVf Z2x5cGhzLApkaWZmIC0tZ2l0IGEvc3JjL3dpbmRvdy5oIGIvc3JjL3dpbmRvdy5oCmluZGV4IDZi MGYwZTUuLjE0ZGQzOGEgMTAwNjQ0Ci0tLSBhL3NyYy93aW5kb3cuaAorKysgYi9zcmMvd2luZG93 LmgKQEAgLTMyNCw2ICszMjQsMTQ3IEBAIHN0cnVjdCB3aW5kb3cKIAogI2lmZGVmIEhBVkVfV0lO RE9XX1NZU1RFTQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4gTVVMVElQ TEUtQ1VSU09SUyAqLworCisvKiBTdWZmaXhlcyBmb3IgdGhlIGBtY2Agd2luZG93IHBvaW50ZXIg cHJlZml4LiAqLworc3RydWN0IG11bHRpcGxlX2N1cnNvcnMKK3sKKyAgLyog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IVF9GUklOR0VfQklUTUFQLAorICAgICAgICBNQ19MRUZU X0ZSSU5HRV9CSVRNQVAsCisgICAgICAgIE1DX0ZSQU1FRF9CT1gsCisgICAgICAgIE1DX0ZJTExF RF9CT1gsCisgICAgICAgIE1DX0hPTExPV19CT1gsCisgICAgICAgIE1DX0JBUiwKKyAgICAgICAg TUNfSEJBUgorICAgICAgfSBjdXJzb3JfdHlwZTsKKyAgICAgIGludCBjdXJzb3Jfd2lkdGg7Cisg ICAgICBzdHJ1Y3QgbWNfUkdCCisgICAgICB7CisgICAgICAgIGRvdWJsZSByZWQ7CisgICAgICAg IGRvdWJsZSBncmVlbjsKKyAgICAgICAgZG91YmxlIGJsdWU7CisgICAgICB9IGZnLCBiZzsKKyAg ICAgIGJvb2xfYmYgYWN0aXZlX3AgOiAxOworICAgICAgZW51bSBtY19mbGF2b3IKKyAgICAgIHsK KyAgICAgICAgTk9fRkxBVk9SLAorICAgICAgICBNQ19HTFlQSCwKKyAgICAgICAgTUNfR0xZUEhM RVNTLAorICAgICAgICBNQ19PVkVSTEFZX0FSUk9XX0JJVE1BUCwKKyAgICAgICAgTUNfUElMQ1JP VywKKyAgICAgICAgTUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVywKKyAgICAgICAgTUNf UkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVywKKyAgICAgICAgTUNfSE9MTE9X X1JFQ1RBTkdMRSwKKyAgICAgICAgTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XLAorICAgICAg ICBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1csCisgICAgICAgIE1DX1ZFUlRJ Q0FMX0JBUiwKKyAgICAgICAgTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSLAorICAgICAgICBNQ19W RVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICB9IGdseXBoX2ZsYXZvcjsKKyAgICAgIGVudW0g bWNfcm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wIDQ6ICAu L2F1dG9nZW4uc2gKKworU3RlcCA1OiAgLi9jb25maWd1cmUgLi4uIFt5b3VyIGN1c3RvbSBvcHRp b25zXQorCitTdGVwIDY6ICBtYWtlCisKK1N0ZXAgNzogIG1ha2UgaW5zdGFsbAorCisKK1VTQUdF OgorCistIEZvciBhIG1pbmltYWwgd29ya2luZyBleGFtcGxlIG9mIGJ1aWx0LWluIGZha2UgY3Vy c29ycywgdHlwZTogIE0teCBtYy10ZXN0CisKKyAgOzs7IFRVUk4gT04gRkFLRSBDVVJTT1JTIChi dWZmZXIgcG9zaXRpb24sIGN1cnNvci10eXBlLCBjdXJzb3IgY29sb3IpOgorCisgIChzZXRxIG1j LWNvbmYgJygoMSAiaGJhciIgIm1hZ2VudGEiKQorICAgICAgICAgICAgICAgICAgKDIgImJhciIg InB1cnBsZSIpCisgICAgICAgICAgICAgICAgICAoMyAiYm94IiAiIzAwRkYwMCIpCisgICAgICAg ICAgICAgICAgICAoNCAiaG9sbG93IiAiIzAwMDBGRiIpCisgICAgICAgICAgICAgICAgICAoNSAo ImhiYXIiIDMpIFsxLjAgMC4wIDEuMF0pCisgICAgICAgICAgICAgICAgICAoNiAoImJhciIgMykg WzAuMCAxLjAgMS4wXSkKKyAgICAgICAgICAgICAgICAgICg3ICJmcmFtZWQiICJPcmFuZ2VSZWQi KSkpCisKKyAgOzs7IFRVUk4gT0ZGIEZBS0UgQ1VSU09SUzoKKworICAoc2V0cSBtYy1jb25mIG5p bCkKKworLSBUbyB0cnkgb3V0IGJvdGggdGhlIGNyb3NzaGFpcnMgZmVhdHVyZSBhbmQgdGhlIHZp c2libGUgZmlsbCBjb2x1bW4gaW5kaWNhdG9yCisgIGZlYXR1cmUsIHR5cGU6ICBNLXggKy1tb2Rl CisKKy0gVG8gdHJ5IG91dCBqdXN0IHRoZSB2aXNpYmxlIGZpbGwgY29sdW1uIGluZGljYXRvciBm ZWF0dXJlLCB0eXBlOiAgTS14IGZjLW1vZGUKKworLSBUbyB0c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iAo bGlzdCksIGVsdCkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOwor ICAgIH0KKyAgcmV0dXJuIGxpc3Q7Cit9CisKK0xpc3BfT2JqZWN0CittY19udGggKGludCBudW0s IExpc3BfT2JqZWN0IGxpc3QpCit7CisgIGZvciAoaW50IGkgPSAwOyBpIDwgbnVtICYmICFOSUxQ IChsaXN0KTsgaSsrKQorICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgaWYgKENPTlNQIChsaXN0 KSkKKyAgICByZXR1cm4gWENBUiAobGlzdCk7CisgICAgZWxzZQorICAgICAgcmV0dXJuIFFuaWw7 Cit9CisKK0xpc3BfT2JqZWN0CittY19hc3NxIChMaXNwX09iamVjdCBrZXksIExpc3BfT2JqZWN0 IGxpc3QpCit7CisgIHdoaWxlICgxKQorICAgIHsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisg ICAgICAgICAgfHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgRVEgKFhD QVIgKFhDQVIgKGxpc3QpKSwga2V5KSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhD RFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1Ag KFhDQVIgKGxpc3QpKQorICAgICAgICAgICAgICAmJiBFUSAoWENBUiAoWENBUiAobGlzdCkpLCBr ZXkpKSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBp ZiAoIUNPTlNQIChsaXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAg ICAgICAgICAgICYmIEVRIChYQ0FSIChYQ0FSIChsaXN0KSksIGtleSkpKQorICAgICAgICBicmVh azsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICB9CisgIGlmIChDT05TUCAobGlzdCkp CisgICAgcmV0dXJuIFhDQVIgKGxpc3QpOworICAgIGVsc2UKKyAgICAgIHJldHVybiBRbmlsOwor fQorCitMaXNwX09iamVjdAorbWNfYXNzb2MgKExpc3BfT2JqZWN0IGtleSwgTGlzcF9PYmplY3Qg bGlzdCkKK3sKKyAgTGlzcF9PYmplY3QgY2FyOworICB3aGlsZSAoMSkKKyAgICB7CisgICAgICBp ZiAoIUNPTlNQIChsaXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAg ICAgICAgICAgICYmIChjYXIgPSBYQ0FSIChYQ0FSIChsaXN0KSksCisgICAgICAgICAgICAgICAg ICBFUSAoY2FyLCBrZXkpIHx8ICFOSUxQIChGZXF1YWwgKGNhciwga2V5KSkpKSkKKyAgICAgICAg YnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNPTlNQIChsaXN0 KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAgICYmIChj YXIgPSBYQ0FSIChYQ0FSIChsaXN0KSksCisgICAgICAgICAgICAgICAgICBFUSAoY2FyLCBrZXkp IHx8ICFOSUxQIChGZXF1YWwgKGNhciwga2V5KSkpKSkKKyAgICAgICAgYnJlYWs7CisgICAgICBs aXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KQorICAgICAgICAgIHx8 IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAgICYmIChjYXIgPSBYQ0FSIChYQ0FS IChsaXN0KSksCisgICAgICAgICAgICAgICAgICBFUSAoY2FyLCBrZXkpIHx8ICFOSUxQIChGZXF1 YWwgKGNhciwga2V5KSkpKSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlz dCk7CisgICAgfQorICBpZiAoQ09OU1AgKGxpc3QpKQorICAgIHJldHVybiBYQ0FSIChsaXN0KTsK KyAgICBlbHNlCisgICAgICByZXR1cm4gUW5pbDsKK30KKworTGlzcF9PYmplY3QKK21jX3BsaXN0 X2dldCAoTGlzcF9PYmplY3QgcGxpc3QsIExpc3BfT2JqZWN0IHByb3ApCit7CisgIExpc3BfT2Jq ZWN0IHRhaWwsIGhhbGZ0YWlsOworICAvKiBoYWxmdGFpbCBpcyB1c2VkIHRvIGRldGVjdCBjaXJj dWxhciBsaXN0cy4gICovCisgIHRhaWwgPSBoYWxmdGFpbCA9IHBsaXN0OworICB3aGlsZSAoQ09O U1AgKHRhaWwpICYmIENPTlNQIChYQ0RSICh0YWlsKSkpCisgICAgeworICAgICAgaWYgKEVRIChw cm9wLCBYQ0FSICh0YWlsKSkpCisgICAgICAgIHJldHVybiBYQ0FSIChYQ0RSICh0YWlsKSk7Cisg ICAgICB0YWlsID0gWENEUiAoWENEUiAodGFpbCkpOworICAgICAgaGFsZnRhaWwgPSBYQ0RSICho YWxmdGFpbCk7CisgICAgICBpZiAoRVEgKHRhaWwsIGhhbGZ0YWlsKSkKKyAgICAgICAgYnJlYWs7 CisgICAgfQorICByZXR1cm4gUW5pbDsKK30KKworLyogUkVHSU9OIEJFR0lOOiAgbWNfcmVnaW9u X2xpbWl0ICgxKQorICAgUkVHSU9OIEVORDogIG1jX3JlZ2lvbl9saW1pdCAoMCkgKi8KK3B0cmRp ZmZfdAorbWNfcmVnaW9uX2xpbWl0IChib29sIGJlZ2luX3ApCit7CisgIGlmICghTklMUCAoVnRy YW5zaWVudF9tYXJrX21vZGUpCisgICAgICAmJiBOSUxQIChWbWFya19ldmVuX2lmX2luYWN0aXZl KQorICAgICAgJiYgTklMUCAoQlZBUiAoY3VycmVudF9idWZmZXIsIG1hcmtfYWN0aXZlKSkpCisg ICAgeHNpZ25hbDAgKFFtYXJrX2luYWN0aXZlKTsKKyAgTGlzcF9PYmplY3QgbWFya2VyID0gQlZB UiAoY3VycmVudF9idWZmZXIsIG1hcmspOworICBpbnQgbSA9IChYTUFSS0VSIChtYXJrZXIpLT5i dWZmZXIpCisgICAgICAgICAgPyBYTUFSS0VSIChtYXJrZXIpLT5jaGFycG9zCisgICAgICAgICAg OiAtMTsKKyAgcmV0dXJuIChtID09IC0xKQorICAgICAgICAgICA/IC0xCisgICAgICAgICA6IChQ VCA8IG0pID09IGJlZ2luX3AKKyAgICAgICAgICAgPyBQVAorICAgICAgICAgOiBjbGlwX3RvX2Jv dW5kcyAoQkVHViwgbSwgWlYpOworfQorCisvKiBDaGVjayB0aGUgcHJlc2VuY2Ugb2YgYSBkaXNw bGF5IHByb3BlcnR5IGFuZCBjb21wdXRlIGl0cyB3aWR0aC4KKyAgIElmIGEgcHJvcGVydHkgd2Fz IGZvdW5kIGFuZCBpdHMgd2lkdGggd2FzIGZvdW5kIGFzIHdlbGwsIHJldHVybgorICAgaXRzIHdp ZHRoICg+PSAwKSBhbmQgc2V0IHRoZSBwb3NpdGlvbiBvZiB0aGUgZW5kIG9mIHRoZSBwcm9wZXJ0 eQorICAgaW4gRU5EUE9TLgorICAgT3RoZXJ3aXNlIGp1c3QgcmV0dXJuIC0xLiAqLworc3RhdGlj IGludAorbWNfY2hlY2tfZGlzcGxheV93aWR0aCAocHRyZGlmZl90IHBvcywgcHRyZGlmZl90IGNv bCwgcHRyZGlmZl90ICplbmRwb3MpCit7CisgIExpc3BfT2JqZWN0IHZhbCwgb3ZlcmxheTsKKyAg aWYgKENPTlNQICh2YWwgPSBnZXRfY2hhcl9wcm9wZXJ0eV9hbmRfb3ZlcmxheQorICAgICAgICAg ICAgICAobWFrZV9maXhudW0gKHBvcyksIFFkaXNwbGF5LCBRbmlsLCAmb3ZlcmxheSkpCisgICAg ICAmJiBFUSAoUXNwYWNlLCBYQ0FSICh2YWwpKSkKKyAgICB7IC8qIEZJWE1FOiBVc2UgY2FsY19w aXhlbF93aWR0aF9vcl9oZWlnaHQuICovCisgICAgICBMaXNwX09iamVjdCBwbGlzdCA9IFhDRFIg KHZhbCksIHByb3A7CisgICAgICBpbnQgd2lkdGggPSAtMTsKKyAgICAgIEVNQUNTX0lOVCBhbGln bl90b19tYXggPSAoY29sIDwgTU9TVF9QT1NJVElWRV9GSVhOVU0gLSBJTlRfTUFYCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IChFTUFDU19JTlQpIElOVF9NQVggKyBjb2wKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTU9TVF9QT1NJVElWRV9GSVhOVU0pOwor ICAgICAgaWYgKChwcm9wID0gbWNfcGxpc3RfZ2V0IChwbGlzdCwgUUN3aWR0aCksIFJBTkdFRF9G SVhOVU1QICgwLCBwcm9wLCBJTlRfTUFYKSkKKyAgICAgICAgICB8fCAocHJvcCA9IG1jX3BsaXN0 X2dldCAocGxpc3QsIFFDcmVsYXRpdmVfd2lkdGgpLAorICAgICAgICAgICAgICBSQU5HRURfRklY TlVNUCAoMCwgcHJvcCwgSU5UX01BWCkpKQorICAgICAgICB3aWR0aCA9IFhGSVhOVU0gKHByb3Ap OworICAgICAgICBlbHNlIGlmIChGTE9BVFAgKHByb3ApICYmIDAgPD0gWEZMT0FUX0RBVEEgKHBy b3ApCisgICAgICAgICAgICAgICAgICYmIFhGTE9BVF9EQVRBIChwcm9wKSA8PSBJTlRfTUFYKQor ICAgICAgICAgIHdpZHRoID0gKGludCkoWEZMT0FUX0RBVEEgKHByb3ApICsgMC41KTsKKyAgICAg ICAgICBlbHNlIGlmICgocHJvcCA9IG1jX3BsaXN0X2dldCAocGxpc3QsIFFDYWxpZ25fdG8pLAor ICAgICAgICAgICAgICAgICAgICBSQU5HRURfRklYTlVNUCAoY29sLCBwcm9wLCBhbGlnbl90b19t YXgpKSkKKyAgICAgICAgICAgIHdpZHRoID0gWEZJWE5VTSAocHJvcCkgLSBjb2w7CisgICAgICAg ICAgICAgIGVsc2UgaWYgKEZMT0FUUCAocHJvcCkgJiYgY29sIDw9IFhGTE9BVF9EQVRBIChwcm9w KQorICAgICAgICAgICAgICAgICAgICAgICAmJiAoWEZMT0FUX0RBVEEgKHByb3ApIDw9IGFsaWdu X3RvX21heCkpCisgICAgICAgICAgICAgICAgd2lkdGggPSAoaW50KShYRkxPQVRfREFUQSAocHJv cCkgKyAwLjUpIC0gY29sOworICAgICAgaWYgKHdpZHRoID49IDApCisgICAgICAgIHsKKyAgICAg ICAgICBwdHJkaWZmX3Qgc3RhcnQ7CisgICAgICAgICAgaWYgKE9WRVJMQVlQIChvdmVybGF5KSkK KyAgICAgICAgICAgICplbmRwb3MgPSBPVkVSTEFZX1BPU0lUSU9OIChPVkVSTEFZX0VORCAob3Zl cmxheSkpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBnZXRfcHJvcGVydHlfYW5k X3JhbmdlIChwb3MsIFFkaXNwbGF5LCAmdmFsLCAmc3RhcnQsIGVuZHBvcywgUW5pbCk7CisgICAg ICAgICAgLyogRm9yIDpyZWxhdGl2ZS13aWR0aCwgd2UgbmVlZCB0byBtdWx0aXBseSBieSB0aGUg Y29sdW1uCisgICAgICAgICAgICAgd2lkdGggb2YgdGhlIGNoYXJhY3RlciBhdCBQT1MsIGlmIGl0 IGlzIGdyZWF0ZXIgdGhhbiAxLiAqLworICAgICAgICAgIGlmICghTklMUCAobWNfcGxpc3RfZ2V0 IChwbGlzdCwgUUNyZWxhdGl2ZV93aWR0aCkpCisgICAgICAgICAgICAgICYmICFOSUxQIChCVkFS IChjdXJyZW50X2J1ZmZlciwgZW5hYmxlX211bHRpYnl0ZV9jaGFyYWN0ZXJzKSkpCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIGludCBiLCB3ZDsKKyAgICAgICAgICAgICAgdW5zaWduZWQg Y2hhciAqcCA9IEJZVEVfUE9TX0FERFIgKENIQVJfVE9fQllURSAocG9zKSk7CisgICAgICAgICAg ICAgIE1DX01VTFRJQllURV9CWVRFU19XSURUSCAocCwgYnVmZmVyX2Rpc3BsYXlfdGFibGUgKCks IGIsIHdkKTsKKyAgICAgICAgICAgICAgd2lkdGggKj0gd2Q7CisgICAgICAgICAgICB9C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dCBwdCA9IFBULCBwdF9ieXRlID0gUFRfQllURTsKKyAgTGlzcF9PYmplY3Qg cmUsIGZvbnRfb2JqZWN0LCBsZ3N0cmluZzsKKyAgcHRyZGlmZl90IGxlbjsKKyAgcmVjb3JkX3Vu d2luZF9zYXZlX21hdGNoX2RhdGEgKCk7CisgIHJlID0gQVJFRiAocnVsZSwgMCk7CisgIGlmIChO SUxQIChyZSkpCisgICAgbGVuID0gMTsKKyAgZWxzZSBpZiAoISBTVFJJTkdQIChyZSkpCisgICAg cmV0dXJuIHVuYmluZF90byAoY291bnQsIFFuaWwpOworICBlbHNlIGlmICgobGVuID0gZmFzdF9s b29raW5nX2F0IChyZSwgY2hhcnBvcywgYnl0ZXBvcywgbGltaXQsIC0xLCBzdHJpbmcpKQorICAg ICAgICAgICA+IDApCisgICAgeworICAgICAgaWYgKE5JTFAgKHN0cmluZykpCisgICAgICAgIGxl biA9IEJZVEVfVE9fQ0hBUiAoYnl0ZXBvcyArIGxlbikgLSBjaGFycG9zOworICAgICAgZWxzZQor ICAgICAgICBsZW4gPSBzdHJpbmdfYnl0ZV90b19jaGFyIChzdHJpbmcsIGJ5dGVwb3MgKyBsZW4p IC0gY2hhcnBvczsKKyAgICB9CisgIGlmIChsZW4gPD0gMCkKKyAgICByZXR1cm4gdW5iaW5kX3Rv IChjb3VudCwgUW5pbCk7CisgIHRvID0gbGltaXQgPSBjaGFycG9zICsgbGVuOworI2lmZGVmIEhB VkVfV0lORE9XX1NZU1RFTQorICBpZiAoRlJBTUVfV0lORE9XX1AgKGYpKQorICAgIHsKKyAgICAg IGZvbnRfb2JqZWN0ID0gZm9udF9yYW5nZSAoY2hhcnBvcywgYnl0ZXBvcywgJnRvLCB3aW4sIGZh Y2UsIHN0cmluZyk7CisgICAgICBpZiAoISBGT05UX09CSkVDVF9QIChmb250X29iamVjdCkKKyAg ICAgICAgICB8fCAoISBOSUxQIChyZSkKKyAgICAgICAgICAgICAgJiYgdG8gPCBsaW1pdAorICAg ICAgICAgICAgICAmJiAoZmFzdF9sb29raW5nX2F0IChyZSwgY2hhcnBvcywgYnl0ZXBvcywgdG8s IC0xLCBzdHJpbmcpIDw9IDApKSkKKyAgICAgICAgcmV0dXJuIHVuYmluZF90byAoY291bnQsIFFu aWwpOworICAgIH0KKyAgZWxzZQorI2VuZGlmICAgICAgICAvKiBub3QgSEFWRV9XSU5ET1dfU1lT VEVNICovCisgICAgZm9udF9vYmplY3QgPSB3aW4tPmZyYW1lOworICBsZ3N0cmluZyA9IEZjb21w b3NpdGlvbl9nZXRfZ3N0cmluZyAocG9zLCBtYWtlX2ZpeG51bSAodG8pLCBmb250X29iamVjdCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmluZyk7CisgIGlmIChO SUxQIChMR1NUUklOR19JRCAobGdzdHJpbmcpKSkKKyAgICB7CisgICAgICAvKiBTYXZlIHBvaW50 IGFzIG1hcmtlciBiZWZvcmUgY2FsbGluZyBvdXQgdG8gbGlzcC4gICovCisgICAgICBpZiAoTklM UCAoc3RyaW5nKSkKKyAgICAgICAgcmVjb3JkX3Vud2luZF9wcm90ZWN0IChyZXN0b3JlX3BvaW50 X3Vud2luZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBidWlsZF9tYXJrZXIgKGN1 cnJlbnRfYnVmZmVyLCBwdCwgcHRfYnl0ZSkpOworICAgICAgbGdzdHJpbmcgPSBzYWZlX2NhbGwg KDYsIFZhdXRvX2NvbXBvc2l0aW9uX2Z1bmN0aW9uLCBBUkVGIChydWxlLCAyKSwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICBwb3MsIG1ha2VfZml4bnVtICh0byksIGZvbnRfb2JqZWN0LCBz dHJpbmcpOworICAgIH0KKyAgcmV0dXJuIHVuYmluZF90byAoY291bnQsIGxnc3RyaW5nKTsKK30K KworLyogQ2hlY2sgaWYgdGhlIGNoYXJhY3RlciBhdCBDSEFSUE9TIChhbmQgQllURVBPUykgaXMg Y29tcG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G9wX3BvcyAoY21wX2l0LCBjaGFycG9zLCBieXRlcG9zLCBlbmRwb3Ms IHN0cmluZyk7CisgICAgICBpZiAoY21wX2l0LT5jaCA9PSAtMiB8fCBjbXBfaXQtPnN0b3BfcG9z ICE9IGNoYXJwb3MpCisgICAgICAgIC8qIFRoZSBjdXJyZW50IHBvc2l0aW9uIGlzIG5vdCBjb21w b3NlZC4gICovCisgICAgICAgIHJldHVybiAwOworICAgIH0KKyAgaWYgKGVuZHBvcyA8IDApCisg ICAgZW5kcG9zID0gTklMUCAoc3RyaW5nKSA/IEJFR1YgOiAwOworICBpZiAoY21wX2l0LT5jaCA8 IDApCisgICAgeworICAgICAgLyogV2UgYXJlIGxvb2tpbmcgYXQgYSBzdGF0aWMgY29tcG9zaXRp b24uICAqLworICAgICAgcHRyZGlmZl90IHN0YXJ0LCBlbmQ7CisgICAgICBMaXNwX09iamVjdCBw cm9wOworICAgICAgZmluZF9jb21wb3NpdGlvbiAoY2hhcnBvcywgLTEsICZzdGFydCwgJmVuZCwg JnByb3AsIHN0cmluZyk7CisgICAgICBjbXBfaXQtPmlkID0gZ2V0X2NvbXBvc2l0aW9uX2lkIChj aGFycG9zLCBieXRlcG9zLCBlbmQgLSBzdGFydCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHByb3AsIHN0cmluZyk7CisgICAgICBpZiAoY21wX2l0LT5pZCA8IDApCisg ICAgICAgIGdvdG8gbm9fY29tcG9zaXRpb247CisgICAgICBjbXBfaXQtPm5jaGFycyA9IGVuZCAt IHN0YXJ0OworICAgICAgY21wX2l0LT5uZ2x5cGhzID0gY29tcG9zaXRpb25fdGFibGVbY21wX2l0 LT5pZF0tPmdseXBoX2xlbjsKKyAgICB9CisgIGVsc2UgaWYgKHcpCisgICAgeworICAgICAgTGlz cF9PYmplY3QgbGdzdHJpbmcgPSBRbmlsOworICAgICAgTGlzcF9PYmplY3QgdmFsLCBlbHQ7Cisg ICAgICBwdHJkaWZmX3QgaTsKKyAgICAgIHZhbCA9IENIQVJfVEFCTEVfUkVGIChWY29tcG9zaXRp b25fZnVuY3Rpb25fdGFibGUsIGNtcF9pdC0+Y2gpOworICAgICAgZm9yIChpID0gMDsgaSA8IGNt cF9pdC0+cnVsZV9pZHg7IGkrKywgdmFsID0gWENEUiAodmFsKSk7CisgICAgICBpZiAoY2hhcnBv cyA8IGVuZHBvcykKKyAgICAgICAgeworICAgICAgICAgIGZvciAoOyBDT05TUCAodmFsKTsgdmFs ID0gWENEUiAodmFsKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgZWx0ID0gWENBUiAo dmFsKTsKKyAgICAgICAgICAgICAgaWYgKCEgVkVDVE9SUCAoZWx0KSB8fCBBU0laRSAoZWx0KSAh PSAzCisgICAgICAgICAgICAgICAgICB8fCAhIElOVEVHRVJQIChBUkVGIChlbHQsIDEpKSkKKyAg ICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgaWYgKFhGSVhOQVQgKEFSRUYg KGVsdCwgMSkpICE9IGNtcF9pdC0+bG9va2JhY2spCisgICAgICAgICAgICAgICAgZ290byBub19j b21wb3NpdGlvbjsKKyAgICAgICAgICAgICAgbGdzdHJpbmcgPSBtY19hdXRvY21wX2NoYXJzIChl bHQsIGNoYXJwb3MsIGJ5dGVwb3MsIGVuZHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICB3LCBmYWNlLCBzdHJpbmcpOworICAgICAgICAgICAgICBpZiAoY29tcG9z aXRpb25fZ3N0cmluZ19wIChsZ3N0cmluZykpCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAg ICAgICAgICAgIGxnc3RyaW5nID0gUW5pbDsKKyAgICAgICAgICAgICAgLyogQ29tcG9zaXRpb24g ZmFpbGVkIHBlcmhhcHMgYmVjYXVzZSB0aGUgZm9udCBkb2Vzbid0CisgICAgICAgICAgICAgICAg IHN1cHBvcnQgc3VmZmljaWVudCByYW5nZSBvZiBjaGFyYWN0ZXJzLiAgVHJ5IHRoZQorICAgICAg ICAgICAgICAgICBvdGhlciBjb21wb3NpdGlvbiBydWxlcyBpZiBhbnkuICAqLworICAgICAgICAg ICAgfQorICAgICAgICAgIGNtcF9pdC0+cmV2ZXJzZWRfcCA9IDA7CisgICAgICAgIH0KKyAgICAg IGVsc2UKKyAgICAgICAgeworICAgICAgICAgIHB0cmRpZmZfdCBjcG9zID0gY2hhcnBvcywgYnBv cyA9IGJ5dGVwb3M7CisgICAgICAgICAgY21wX2l0LT5yZXZlcnNlZF9wID0gMTsKKyAgICAgICAg ICBlbHQgPSBYQ0FSICh2YWwpOworICAgICAgICAgIGlmIChjbXBfaXQtPmxvb2tiYWNrID4gMCkK KyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY3BvcyA9IGNoYXJwb3MgLSBjbXBfaXQtPmxv b2tiYWNrOworICAgICAgICAgICAgICBpZiAoU1RSSU5HUCAoc3RyaW5nKSkKKyAgICAgICAgICAg ICAgICBicG9zID0gc3RyaW5nX2NoYXJfdG9fYnl0ZSAoc3RyaW5nLCBjcG9zKTsKKyAgICAgICAg ICAgICAgZWxzZQorICAgICAgICAgICAgICAgIGJwb3MgPSBDSEFSX1RPX0JZVEUgKGNwb3MpOwor ICAgICAgICAgICAgfQorICAgICAgICAgIGxnc3RyaW5nID0gbWNfYXV0b2NtcF9jaGFycyAoZWx0 LCBjcG9zLCBicG9zLCBjaGFycG9zICsgMSwgdywgZmFjZSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHN0cmluZyk7CisgICAgICAgICAgaWYgKCEgY29tcG9zaXRpb25fZ3N0 cmluZ19wIChsZ3N0cmluZykKKyAgICAgICAgICAgICAgfHwgY3BvcyArIExHU1RSSU5HX0NIQVJf TEVOIChsZ3N0cmluZykgLSAxICE9IGNoYXJwb3MpCisgICAgICAgICAgICAvKiBDb21wb3NpdGlv biBmYWlsZWQgb3IgZGlkbid0IGNvdmVyIHRoZSBjdXJyZW50CisgICAgICAgICAgICAgICBjaGFy YWN0ZXIuICAqLworICAgICAgICAgICAgZ290byBub19jb21wb3NpdGlvbjsKKyAgICAgICAgfQor ICAgICAgaWYgKE5JTFAgKGxnc3RyaW5nKSkKKyAgICAgICAgZ290byBub19jb21wb3NpdGlvbjsK KyAgICAgIGlmIChOSUxQIChMR1NUUklOR19JRCAobGdzdHJpbmcpKSkKKyAgICAgICAgbGdzdHJp bmcgPSBjb21wb3NpdGlvbl9nc3RyaW5nX3B1dF9jYWNoZSAobGdzdHJpbmcsIC0xKTsKKyAgICAg IGNtcF9pdC0+aWQgPSBYRklYTlVNIChMR1NUUklOR19JRCAobGdzdHJpbmcpKTsKKyAgICAgIGZv ciAoaSA9IDA7IGkgPCBMR1NUUklOR19HTFlQSF9MRU4gKGxnc3RyaW5nKTsgaSsrKQorICAgICAg ICBpZiAoTklMUCAoTEdTVFJJTkdfR0xZUEggKGxnc3RyaW5nLCBpKSkpCisgICAgICAgICAgYnJl YWs7CisgICAgICBjbXBfaXQtPm5nbHlwaHMgPSBpOworICAgICAgY21wX2l0LT5mcm9tID0gMDsK KyAgICAgIGNtcF9pdC0+dG8gPSBpOworICAgIH0KKyAgZWxzZQorICAgIGdvdG8gbm9fY29tcG9z aXRpb247CisgIHJldHVybiAxOworIG5vX2NvbXBvc2l0aW9uOgorICBpZiAoY2hhcnBvcyA9PSBl bmRwb3MpCisgICAgcmV0dXJuIDA7CisgIGlmIChjaGFycG9zIDwgZW5kcG9zKQorICAgIHsKKyAg ICAgIGNoYXJwb3MrKzsKKyAgICAgIGlmIChOSUxQIChzdHJpbmcpKQorICAgICAgICBJTkNfUE9T IChieXRlcG9zKTsKKyAgICAgIGVsc2UKKyAgICAgICAgYnl0ZXBvcyArPSBCWVRFU19CWV9DSEFS X0hFQUQgKCooU0RBVEEgKHN0cmluZykgKyBieXRlcG9zKSk7CisgICAgfQorICBlbHNlCisgICAg eworICAgICAgY2hhcnBvcy0tOworICAgICAgLyogQllURVBP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IHRoZSBjdXJzb3Igd2lsbCBhcHBlYXIuICovCisgICAg ICBpZiAoY29sID49IGdvYWwpCisgICAgICAgIGJyZWFrOworICAgICAgcHJldl9jb2wgPSBjb2w7 CisgICAgICB7IC8qIENoZWNrIGRpc3BsYXkgcHJvcGVydHkuICovCisgICAgICAgIHB0cmRpZmZf dCBlbmRwOworICAgICAgICBpbnQgd2lkdGggPSBtY19jaGVja19kaXNwbGF5X3dpZHRoIChzY2Fu LCBjb2wsICZlbmRwKTsKKyAgICAgICAgaWYgKHdpZHRoID49IDApCisgICAgICAgICAgeworICAg ICAgICAgICAgY29sICs9IHdpZHRoOworICAgICAgICAgICAgaWYgKGVuZHAgPiBzY2FuKSAvKiBB dm9pZCBpbmZpbml0ZSBsb29wcyB3aXRoIDAtd2lkdGggb3ZlcmxheXMuICovCisgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICBzY2FuID0gZW5kcDsKKyAgICAgICAgICAgICAgICBzY2Fu X2J5dGUgPSBDSEFSX1RPX0JZVEUgKHNjYW4pOworICAgICAgICAgICAgICAgIGNvbnRpbnVlOwor ICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgfQorICAgICAgLyogQ2hlY2sgY29t cG9zaXRpb24gc2VxdWVuY2UuICovCisgICAgICBpZiAoY21wX2l0LmlkID49IDAKKyAgICAgICAg ICB8fCAoc2NhbiA9PSBjbXBfaXQuc3RvcF9wb3MKKyAgICAgICAgICAgICAgJiYgbWNfY29tcG9z aXRpb25fcmVzZWF0X2l0ICgmY21wX2l0LCBzY2FuLCBzY2FuX2J5dGUsIGVuZCwgdywgTlVMTCwg UW5pbCkpKQorICAgICAgICBjb21wb3NpdGlvbl91cGRhdGVfaXQgKCZjbXBfaXQsIHNjYW4sIHNj YW5fYnl0ZSwgUW5pbCk7CisgICAgICBpZiAoY21wX2l0LmlkID49IDApCisgICAgICAgIHsKKyAg ICAgICAgICBzY2FuICs9IGNtcF9pdC5uY2hhcnM7CisgICAgICAgICAgc2Nhbl9ieXRlICs9IGNt cF9pdC5uYnl0ZXM7CisgICAgICAgICAgaWYgKHNjYW4gPD0gZW5kKQorICAgICAgICAgICAgY29s ICs9IGNtcF9pdC53aWR0aDsKKyAgICAgICAgICBpZiAoY21wX2l0LnRvID09IGNtcF9pdC5uZ2x5 cGhzKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBjbXBfaXQuaWQgPSAtMTsKKyAgICAg ICAgICAgICAgY29tcG9zaXRpb25fY29tcHV0ZV9zdG9wX3BvcyAoJmNtcF9pdCwgc2Nhbiwgc2Nh bl9ieXRlLCBlbmQsIFFuaWwpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICBjbXBfaXQuZnJvbSA9IGNtcF9pdC50bzsKKyAgICAgICAgICBjb250aW51ZTsK KyAgICAgICAgfQorICAgICAgYyA9IEZFVENIX0JZVEUgKHNjYW5fYnl0ZSk7CisgICAgICAvKiBT ZWUgaWYgdGhlcmUgaXMgYSBkaXNwbGF5IHRhYmxlIGFuZCBpdCByZWxhdGVzIHRvIHRoaXMgY2hh cmFjdGVyLiAqLworICAgICAgaWYgKGRwICE9IDAKKyAgICAgICAgICAmJiAhIChtdWx0aWJ5dGUg JiYgTEVBRElOR19DT0RFX1AgKGMpKQorICAgICAgICAgICYmIFZFQ1RPUlAgKERJU1BfQ0hBUl9W RUNUT1IgKGRwLCBjKSkpCisgICAgICAgIHsKKyAgICAgICAgICBMaXNwX09iamVjdCBjaGFydmVj OworICAgICAgICAgIHB0cmRpZmZfdCBpLCBuOworICAgICAgICAgIC8qIFRoaXMgY2hhcmFjdGVy IGlzIGRpc3BsYXllZCB1c2luZyBhIHZlY3RvciBvZiBnbHlwaHMuCisgICAgICAgICAgICAgVXBk YXRlIHRoZSBjb2x1bW4vcG9zaXRpb24gYmFzZWQgb24gdGhvc2UgZ2x5cGhzLiAqLworICAgICAg ICAgIGNoYXJ2ZWMgPSBESVNQX0NIQVJfVkVDVE9SIChkcCwgYyk7CisgICAgICAgICAgbiA9IEFT SVpFIChjaGFydmVjKTsKKyAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgbjsgaSsrKQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICAvKiBUaGlzIHNob3VsZCBiZSBoYW5kbGVkIHRoZSBzYW1l IGFzCisgICAgICAgICAgICAgIG5leHRfZWxlbWVudF9mcm9tX2Rpc3BsYXlfdmVjdG9yIGRvZXMg aXQuICovCisgICAgICAgICAgICAgIExpc3BfT2JqZWN0IGVudHJ5ID0gQVJFRiAoY2hhcnZlYywg aSk7CisgICAgICAgICAgICAgIGlmIChHTFlQSF9DT0RFX1AgKGVudHJ5KSkKKyAgICAgICAgICAg ICAgICBjID0gR0xZUEhfQ09ERV9DSEFSIChlbnRyeSk7CisgICAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgICBjID0gJyAnOworICAgICAgICAgICAgICBpZiAoYyA9PSAnXG4nKQorICAg ICAgICAgICAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgICAgICAgaWYgKGMgPT0gJ1xyJyAm JiBFUSAoQlZBUiAoY3VycmVudF9idWZmZXIsIHNlbGVjdGl2ZV9kaXNwbGF5KSwgUXQpKQorICAg ICAgICAgICAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgICAgICAgaWYgKGMgPT0gJ1x0JykK KyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBjb2wgKz0gdGFiX3dpZHRoOwor ICAgICAgICAgICAgICAgICAgY29sID0gY29sIC8gdGFiX3dpZHRoICogdGFiX3dpZHRoOworICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAr K2NvbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAg eworICAgICAgICAgICAgLyogVGhlIGRpc3BsYXkgdGFibGUgZG9lc24ndCBhZmZlY3QgdGhpcyBj aGFyYWN0ZXI7CisgICAgICAgICAgICAgICBpdCBkaXNwbGF5cyBhcyBpdHNlbGYuICovCisgICAg ICAgICAgICBpZiAoYyA9PSAnXG4nKQorICAgICAgICAgICAgICBnb3RvIGVuZGxvb3A7CisgICAg ICAgICAgICBpZiAoYyA9PSAnXHInICYmIEVRIChCVkFSIChjdXJyZW50X2J1ZmZlciwgc2VsZWN0 aXZlX2Rpc3BsYXkpLCBRdCkpCisgICAgICAgICAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAg ICAgIGlmIChjID09ICdcdCcpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjb2wg Kz0gdGFiX3dpZHRoOworICAgICAgICAgICAgICAgIGNvbCA9IGNvbCAvIHRhYl93aWR0aCAqIHRh Yl93aWR0aDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlIGlmIChtdWx0aWJ5 dGUgJiYgTEVBRElOR19DT0RFX1AgKGMpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICAgIC8qIFN0YXJ0IG9mIG11bHRpLWJ5dGUgZm9ybS4gKi8KKyAgICAgICAgICAgICAgICAg IHVuc2lnbmVkIGNoYXIgKnB0cjsKKyAgICAgICAgICAgICAgICAgIGludCBieXRlcywgd2lkdGg7 CisgICAgICAgICAgICAgICAgICBwdHIgPSBCWVRFX1BPU19BRERSIChzY2FuX2J5dGUpOworICAg ICAgICAgICAgICAgICAgTUNfTVVMVElCWVRFX0JZVEVTX1dJRFRIIChwdHIsIGRwLCBieXRlcywg d2lkdGgpOworICAgICAgICAgICAgICAgICAgLyogU3VidHJhY3Qgb25lIHRvIGNvbXBlbnNhdGUg Zm9yIHRoZSBpbmNyZW1lbnQKKyAgICAgICAgICAgICAgICAgIHRoYXQgaXMgZ29pbmcgdG8gaGFw cGVuIGJlbG93LiAqLworICAgICAgICAgICAgICAgICAgc2Nhbl9ieXRlICs9IGJ5dGVzIC0gMTsK KyAgICAgICAgICAgICAgICAgIGNvbCArPSB3aWR0aDsKKyAgICAgICAgICAgICAgICB9CisgICAg ICAgICAgICAgICAgZWxzZSBpZiAoY3RsX2Fycm93ICYmIChjIDwgMDQwIHx8IGMgPT0gMDE3Nykp CisgICAgICAgICAgICAgICAgICBjb2wgKz0gMjsKKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYg KGMgPCAwNDAgfHwgYyA+PSAwMTc3KQorICAgICAgICAgICAgICAgICAgICBjb2wgKz0gNDsKKyAg ICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgIGNvbCsrOworICAg ICAgICAgIH0KKyAgICAgIHNjYW4rKzsKKyAgICAgIHNjYW5fYnl0ZSsrOworICAgIH0KKyBlbmRs b29wOgorICBsYXN0X2tub3duX2NvbHVtbiA9IGNvbDsKKyAgbGFzdF9rbm93bl9jb2x1bW5fcG9p bnQgPSBwdDsKKyAgbGFzdF9rbm93bl9jb2x1bW5fbW9kaWZpZWQgPSBNT0RJRkY7CisgIGlmIChn b2FsY29sKQorICAgICpnb2FsY29sID0gY29sOworICBpZiAoZW5kcG9zKQorICAgICplbmRwb3Mg PSBzY2FuOworICBpZiAocHJldmNvbCkKKyAgICAqcHJldmNvbCA9IHByZXZfY29sOworfQorCitw dHJkaWZmX3QKK21jX2N1cnJlbnRfY29sdW1uIChzdHJ1Y3Qgd2luZG93ICp3LCBwdHJkaWZmX3Qg cHQpCit7CisgIC8qIGBidWZfY2hhcnBvc190b19ieXRlcG9zJzogIGVhc3NlcnQgKEJVRl9CRUcg KGIpIDw9IGNoYXJwb3MgJiYgY2hhcnBvcyA8PSBCVUZfWiAoYikpOyAqLworICBzdHJ1Y3QgYnVm ZmVyICpiID0gWEJVRkZFUiAody0+Y29udGVudHMpOworICBzdHJ1Y3QgYnVmZmVyICpvbGRfYnVm ZmVyID0gTlVMTDsKKyAgaWYgKGIgIT0gY3VycmVudF9idWZmZXIpCisgICAgeworICAgICAgb2xk X2J1ZmZlciA9IGN1cnJlbnRfYnVmZmVyOworICAgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAoYik7 CisgICAgfQorICBib29sIGJhcmZfY3Jhc2ggPSAoQlVGX0JFRyAoYikgPD0gcHQgJiYgcHQgPD0g QlVGX1ogKGIpKSA/IGZhbHNlIDogdHJ1ZTsKKyAgaWYgKGJhcmZfY3Jhc2gpCisgICAgeworICAg ICAgaWYgKG9sZF9idWZmZXIpCisgICAgICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZm ZXIpOworICAgICAgcmV0dXJuIDA7CisgICAgfQorICBFTUFDU19JTlQgbGFzdF9rbm93bl9jb2x1 bW5fbW9kaWZpZWQgPSAwOworICBwdHJkaWZmX3QgbGFzdF9rbm93bl9jb2x1bW4gPSAwOworICBw dHJkaWZmX3QgY29sOworICB1bnNpZ25lZCBjaGFyICpwdHIsICpzdG9wOworICBib29sIHRhYl9z ZWVuOworICBwdHJkaWZmX3QgcG9zdF90YWI7CisgIGludCBjOworICBpbnQgdGFiX3dpZHRoID0g U0FORV9UQUJfV0lEVEggKGN1cnJlbnRfYnVmZmVyKTsKKyAgYm9vbCBjdGxfYXJyb3cgPSAhTklM UCAoQlZBUiAoY3VycmVudF9idWZmZXIsIGN0bF9hcnJvdykpOworICBzdHJ1Y3QgTGlzcF9DaGFy X1RhYmxlICpkcCA9IGJ1ZmZlcl9kaXNwbGF5X3RhYmxlICgpOworICBpZiAocHQgPT0gbGFzdF9r bm93bl9jb2x1bW5fcG9pbnQKKyAgICAgICYmIE1PRElGRiA9PSBsYXN0X2tub3duX2NvbHVtbl9t b2RpZmllZCkKKyAgICB7CisgICAgICBpZiAob2xkX2J1ZmZlcikKKyAgICAgICAgc2V0X2J1ZmZl cl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7CisgICAgICByZXR1cm4gbGFzdF9rbm93bl9jb2x1bW47 CisgICAgfQorICAvKiBJZiB0aGUgYnVmZmVyIGhhcyBvdmVybGF5cywgdGV4dCBwc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gQkVHVl9BRERSOworICAgICAgZWxzZQorICAgICAgICBzdG9w ID0gR0FQX0VORF9BRERSOworICBjb2wgPSAwLCB0YWJfc2VlbiA9IDAsIHBvc3RfdGFiID0gMDsK KyAgd2hpbGUgKDEpCisgICAgeworICAgICAgcHRyZGlmZl90IGksIG47CisgICAgICBMaXNwX09i amVjdCBjaGFydmVjOworICAgICAgaWYgKHB0ciA9PSBzdG9wKQorICAgICAgICB7CisgICAgICAg ICAgLyogV2Ugc3RvcHBlZCBlaXRoZXIgZm9yIHRoZSBiZWdpbm5pbmcgb2YgdGhlIGJ1ZmZlcgor ICAgICAgICAgICAgIG9yIGZvciB0aGUgZ2FwLiAqLworICAgICAgICAgIGlmIChwdHIgPT0gQkVH Vl9BRERSKQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgLyogSXQgd2FzIHRoZSBnYXAu ICBKdW1wIGJhY2sgb3ZlciBpdC4gKi8KKyAgICAgICAgICBzdG9wID0gQkVHVl9BRERSOworICAg ICAgICAgIHB0ciA9IEdQVF9BRERSOworICAgICAgICAgIC8qIENoZWNrIHdoZXRoZXIgdGhhdCBi cmluZ3MgdXMgdG8gYmVnaW5uaW5nIG9mIGJ1ZmZlci4gKi8KKyAgICAgICAgICBpZiAoQkVHViA+ PSBHUFQpCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgYyA9ICotLXB0cjsK KyAgICAgIGlmIChkcCAmJiBWRUNUT1JQIChESVNQX0NIQVJfVkVDVE9SIChkcCwgYykpKQorICAg ICAgICB7CisgICAgICAgICAgY2hhcnZlYyA9IERJU1BfQ0hBUl9WRUNUT1IgKGRwLCBjKTsKKyAg ICAgICAgICBuID0gQVNJWkUgKGNoYXJ2ZWMpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAg ICAgICAgICB7CisgICAgICAgICAgICBjaGFydmVjID0gUW5pbDsKKyAgICAgICAgICAgIG4gPSAx OworICAgICAgICAgIH0KKyAgICAgIGZvciAoaSA9IG4gLSAxOyBpID49IDA7IC0taSkKKyAgICAg ICAgeworICAgICAgICAgIGlmIChWRUNUT1JQIChjaGFydmVjKSkKKyAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgLyogVGhpcyBzaG91bGQgYmUgaGFuZGxlZCB0aGUgc2FtZSBhcworICAgICAg ICAgICBuZXh0X2VsZW1lbnRfZnJvbV9kaXNwbGF5X3ZlY3RvciBkb2VzIGl0LiAqLworICAgICAg ICAgICAgICBMaXNwX09iamVjdCBlbnRyeSA9IEFSRUYgKGNoYXJ2ZWMsIGkpOworICAgICAgICAg ICAgICBpZiAoR0xZUEhfQ09ERV9QIChlbnRyeSkpCisgICAgICAgICAgICAgICAgYyA9IEdMWVBI X0NPREVfQ0hBUiAoZW50cnkpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAg ICAgIGMgPSAnICc7CisgICAgICAgICAgICB9CisgICAgICAgICAgaWYgKGMgPj0gMDQwICYmIGMg PCAwMTc3KQorICAgICAgICAgICAgY29sKys7CisgICAgICAgICAgICBlbHNlIGlmIChjID09ICdc bicKKyAgICAgICAgICAgICAgICAgICAgIHx8IChjID09ICdccicKKyAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBFUSAoQlZBUiAoY3VycmVudF9idWZmZXIsIHNlbGVjdGl2ZV9kaXNwbGF5KSwg UXQpKSkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHB0cisrOworICAgICAgICAg ICAgICAgIGdvdG8gc3RhcnRfb2ZfbGluZV9mb3VuZDsKKyAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgICBlbHNlIGlmIChjID09ICdcdCcpCisgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgaWYgKHRhYl9zZWVuKQorICAgICAgICAgICAgICAgICAgICBjb2wgPSAoKGNvbCAr IHRhYl93aWR0aCkgLyB0YWJfd2lkdGgpICogdGFiX3dpZHRoOworICAgICAgICAgICAgICAgICAg cG9zdF90YWIgKz0gY29sOworICAgICAgICAgICAgICAgICAgY29sID0gMDsKKyAgICAgICAgICAg ICAgICAgIHRhYl9zZWVuID0gMTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAg ZWxzZSBpZiAoVkVDVE9SUCAoY2hhcnZlYykpCisgICAgICAgICAgICAgICAgICAvKiBXaXRoIGEg ZGlzcGxheSB0YWJsZSBlbnRyeSwgQyBpcyBkaXNwbGF5ZWQgYXMgaXMsIGFuZAorICAgICAgICAg ICAgICAgICAgICAgbm90IGRpc3BsYXllZCBhcyBcTk5OIG9yIGFzIF5OLiAgSWYgQyBpcyBhIHNp bmdsZS1ieXRlCisgICAgICAgICAgICAgICAgICAgICBjaGFyYWN0ZXIsIGl0IHRha2VzIG9uZSBj b2x1bW4uICBJZiBDIGlzIG11bHRpLWJ5dGUgaW4KKyAgICAgICAgICAgICAgICAgICAgIGEgdW5p Ynl0ZSBidWZmZXIsIGl0J3MgdHJhbnNsYXRlZCB0byB1bmlieXRlLCBzbyBpdAorICAgICAgICAg ICAgICAgICAgICAgYWxzbyB0YWtlcyBvbmUgY29sdW1uLiAqLworICAgICAgICAgICAgICAgICAg Kytjb2w7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIGNvbCAr PSAoY3RsX2Fycm93ICYmIGMgPCAwMjAwKSA/IDIgOiA0OworICAgICAgICB9CisgICAgfQorIHN0 YXJ0X29mX2xpbmVfZm91bmQ6CisgIGlmICh0YWJfc2VlbikKKyAgICB7CisgICAgICBjb2wgPSAo KGNvbCArIHRhYl93aWR0aCkgLyB0YWJfd2lkdGgpICogdGFiX3dpZHRoOworICAgICAgY29sICs9 IHBvc3RfdGFiOworICAgIH0KKyAgbGFzdF9rbm93bl9jb2x1bW4gPSBjb2w7CisgIGxhc3Rfa25v d25fY29sdW1uX3BvaW50ID0gcHQ7CisgIGxhc3Rfa25vd25fY29sdW1uX21vZGlmaWVkID0gTU9E SUZGOworICBpZiAob2xkX2J1ZmZ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cpCit7CisgIExpc3BfT2JqZWN0 IGNoYXJhY3RlciA9ICgwIDw9IGFyZyAmJiBhcmcgPD0gTUFYX0NIQVIpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IEZjaGFyX3RvX3N0cmluZyAobWFrZV9maXhudW0gKGFyZykpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IFFuaWw7CisgIGNoYXIgKiByZXN1bHQgPSAoIU5JTFAg KGNoYXJhY3RlcikKKyAgICAgICAgICAgICAgICAgICAmJiBhcmcgPT0gOSkKKyAgICAgICAgICAg ICAgICAgICAgPyAiXFx0IgorICAgICAgICAgICAgICAgICAgOiAoIU5JTFAgKGNoYXJhY3RlcikK KyAgICAgICAgICAgICAgICAgICAgICYmIGFyZyA9PSAxMCkKKyAgICAgICAgICAgICAgICAgICAg PyAiXFxuIgorICAgICAgICAgICAgICAgICAgOiAoIU5JTFAgKGNoYXJhY3RlcikKKyAgICAgICAg ICAgICAgICAgICAgICYmIGFyZyA9PSAzMikKKyAgICAgICAgICAgICAgICAgICAgPyAiXFxzIgor ICAgICAgICAgICAgICAgICAgOiAoIU5JTFAgKGNoYXJhY3RlcikKKyAgICAgICAgICAgICAgICAg ICAgICYmIGFyZyAhPSA5CisgICAgICAgICAgICAgICAgICAgICAmJiBhcmcgIT0gMTAKKyAgICAg ICAgICAgICAgICAgICAgICYmIGFyZyAhPSAzMikKKyAgICAgICAgICAgICAgICAgICAgPyBTU0RB VEEgKGNoYXJhY3RlcikKKyAgICAgICAgICAgICAgICAgIDogIlxcPyI7CisgIHJldHVybiByZXN1 bHQ7Cit9CisKK2ludAorbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoTGlzcF9PYmplY3QgYXJnKQor eworICBjaGFyICpzdHI7CisgIGlmIChYVFlQRSAoYXJnKSA9PSBMaXNwX1N0cmluZykKKyAgICBz dHIgPSBTU0RBVEEgKGFyZyk7CisgICAgZWxzZSBpZiAoWFRZUEUgKGFyZykgPT0gTGlzcF9TeW1i b2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uICJVTktOT1dOIjsKKyAgICB9Cit9CisKKy8qIFVT QUdFOiAgZnByaW50ZiAoc3RkZXJyLCAiRlJPTV9XSEVSRSAoJXMpIiwgbWNfZHJhd19yb3dfdHlw ZV90b19zdHJpbmcgKGFyZykpOyAqLworY2hhciAqCittY19kcmF3X3Jvd190eXBlX3RvX3N0cmlu ZyAoZW51bSBtY19kcmF3X3Jvd190eXBlIGZyb21fd2hlcmUpCit7CisgIHN3aXRjaCAoZnJvbV93 aGVyZSkKKyAgICB7CisgICAgICBjYXNlIE5PV0hFUkU6IHJldHVybiAiTk9XSEVSRSI7CisgICAg ICBjYXNlIFNDUklCRV9PTkU6IHJldHVybiAiU0NSSUJFX09ORSI7CisgICAgICBjYXNlIFNDUklC RV9UV086IHJldHVybiAiU0NSSUJFX1RXTyI7CisgICAgICBjYXNlIFNDUklCRV9USFJFRTogcmV0 dXJuICJTQ1JJQkVfVEhSRUUiOworICAgICAgY2FzZSBTS0lQUEVEOiByZXR1cm4gIlNLSVBQRUQi OworICAgICAgY2FzZSBQT1NUX0NIQU5HRUQ6IHJldHVybiAiUE9TVF9DSEFOR0VEIjsKKyAgICAg IGNhc2UgVU5DSEFOR0VEOiByZXR1cm4gIlVOQ0hBTkdFRCI7CisgICAgICBjYXNlIFNFVF9DVVJT T1JfT05FOiByZXR1cm4gIlNFVF9DVVJTT1JfT05FIjsKKyAgICAgIGNhc2UgU0VUX0NVUlNPUl9U V086IHJldHVybiAiU0VUX0NVUlNPUl9UV08iOworICAgICAgZGVmYXVsdDoKKyAgICAgIHJldHVy biAiVU5LTk9XTiI7CisgICAgfQorfQorCisvKiBVU0FHRTogIGZwcmludGYgKHN0ZGVyciwgIkZS T01fV0hFUkUgKCVzKSIsIG1jX2RyYXdfcm93X3R5cGVfdG9fc3RyaW5nIChhcmcpKTsgKi8KK2No YXIgKgorbWNfcmVkcmF3X3Jvd190eXBlX3RvX3N0cmluZyAoZW51bSBtY19yZWRyYXdfcm93X3R5 cGUgZnJvbV93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AodyksIHZwb3NfYWxs b2NhdGVkLCB2cG9zX3VzZWQpOworICBmb3IgKGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBl ID0gTUNfQ0FDSEU7CisgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICsrY2Fj aGVfdHlwZSkKKyAgICB7CisgICAgICBpbnQgY3Vyc29yc191c2VkID0gdy0+bWNfbWF0cml4LmN1 cnNvcnNfdXNlZFtjYWNoZV90eXBlXTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgbWF0cml4 LmN1cnNvcnNfdXNlZFslc10gKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgbWNfY2Fj aGVfdHlwZV90b19zdHJpbmcgKGNhY2hlX3R5cGUpLCBjdXJzb3JzX3VzZWQpOworICAgIH0KKyAg Zm9yIChpbnQgdm50aCA9IDA7CisgICAgICAgdm50aCA8IHctPm1jX21hdHJpeC52cG9zX3VzZWQ7 CisgICAgICAgKyt2bnRoKQorICAgIHsKKyAgICAgIGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNh Y2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOwor ICAgICAgICAgICArK2NhY2hlX3R5cGUpCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgY2FjaGVf YWxsb2NhdGVkID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVkW2NhY2hl X3R5cGVdOworICAgICAgICAgIGludCBjYWNoZV91c2VkID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXTsKKyAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIg ICAgdm50aCAoJWQpIHwgY2FjaGVfYWxsb2NhdGVkWyVzXSAoJWQpIHwgY2FjaGVfdXNlZFslc10g KCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHZudGgsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICBtY19jYWNoZV90eXBlX3RvX3N0cmluZyAoY2FjaGVfdHlwZSksCisgICAg ICAgICAgICAgICAgICAgICAgICAgICBjYWNoZV9hbGxvY2F0ZWQsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICBtY19jYWNoZV90eXBlX3RvX3N0cmluZyAoY2FjaGVfdHlwZSksCisgICAgICAg ICAgICAgICAgICAgICAgICAgICBjYWNoZV91c2VkKTsKKyAgICAgICAgfQorICAgIH0KK30KKwor dm9pZAorbWNfc2V0X2xzbF9iZyAoc3RydWN0IHdpbmRvdyAqdywgZW51bSBmYWNlX2lkIGZhY2Vf aWQsIHN0cnVjdCBtY19SR0IgKmxzbCkKK3sKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3 LT5mcmFtZSk7CisgIHN0cnVjdCBmYWNlICpmYWNlOworICBpZiAoIU5JTFAgKFZmYWNlX3JlbWFw cGluZ19hbGlzdCkKKyAgICAgICYmIChmYWNlX2lkID09IERFRkFVTFRfRkFDRV9JRCAvKiBRZGVm YXVsdCAqLworICAgICAgICAgIHx8IGZhY2VfaWQgPT0gTU9ERV9MSU5FX0ZBQ0VfSUQgLyogUW1v ZGVfbGluZSAqLworICAgICAgICAgIHx8IGZhY2VfaWQgPT0gTU9ERV9MSU5FX0lOQUNUSVZFX0ZB Q0VfSUQgLyogUW1vZGVfbGluZV9pbmFjdGl2ZSAqLworICAgICAgICAgIHx8IGZhY2VfaWQgPT0g SEVBREVSX0xJTkVfRkFDRV9JRCAvKiBRaGVhZGVyX2xpbmUgKi8KKyAgICAgICAgICB8fCBmYWNl X2lkID09IFRPT0xfQkFSX0ZBQ0VfSUQgLyogUXRvb2xfYmFyICovCisgICAgICAgICAgfHwgZmFj ZV9pZCA9PSBGUklOR0VfRkFDRV9JRCAvKiBRZnJpbmdlICovCisgICAgICAgICAgfHwgZmFjZV9p ZCA9PSBTQ1JPTExfQ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jZVtMRkFDRV9CQUNL R1JPVU5EX0lOREVYXQorICAgICAgICAgICAgICAgICAgICAgIDogYnVpbGRfc3RyaW5nICgiT3Jh bmdlUmVkIik7CisgIG1jX3h3X2NvbG9yX3ZhbHVlcyAodywgY29sb3IsIGxzbCk7Cit9CisKK3Zv aWQKK21jX3NldF9lc3NlbnRpYWxzIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgbWNfZXNzZW50 aWFscyAqZXNzZW50aWFscykKK3sKKyAgaWYgKCFCVUZGRVJQICh3LT5jb250ZW50cykpCisgICAg cmV0dXJuOworICBpZiAoTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25m KSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWly cykpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2li bGUpKSkKKyAgICByZXR1cm47CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUp OworICBlc3NlbnRpYWxzLT5hY3RpdmVfcCA9ICh3ID09IFhXSU5ET1cgKGYtPnNlbGVjdGVkX3dp bmRvdykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZiA9PSBGUkFNRV9ESVNQTEFZX0lO Rk8gKGYpLT5oaWdobGlnaHRfZnJhbWUpOworICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAo dy0+Y29udGVudHMpOworICBzdHJ1Y3QgYnVmZmVyICpvbGRfYnVmZmVyID0gTlVMTDsKKyAgcHRy ZGlmZl90IG9wb2ludCA9ICh3ID09IFhXSU5ET1cgKHNlbGVjdGVkX3dpbmRvdykpCisgICAgICAg ICAgICAgICAgICAgICA/IFBUCisgICAgICAgICAgICAgICAgICAgICA6IFhGSVhOVU0gKEZtYXJr ZXJfcG9zaXRpb24gKHctPnBvaW50bSkpOworICBwdHJkaWZmX3QgY3VycmVudF9jb2wgPSBtY19j dXJyZW50X2NvbHVtbiAodywgb3BvaW50KTsKKyAgaW50IGZyYW1lX2NoYXJfd2lkdGggPSBGUkFN RV9DT0xVTU5fV0lEVEggKGYpOworICBib29sIGZpbGxfY29sdW1uX3AgPSAhTklMUCAoQlZBUiAo YiwgZmlsbF9jb2x1bW4pKTsKKyAgaW50IGZpbGxfY29sID0gWEZJWE5VTSAoQlZBUiAoYiwgZmls bF9jb2x1bW4pKTsKKyAgaW50IGhzY2xfeCA9IHctPmhzY3JvbGwgKiBmcmFtZV9jaGFyX3dpZHRo OworICBpZiAoYiAhPSBjdXJyZW50X2J1ZmZlcikKKyAgICB7CisgICAgICBvbGRfYnVmZmVyID0g Y3VycmVudF9idWZmZXI7CisgICAgICBzZXRfYnVmZmVyX2ludGVybmFsIChiKTsKKyAgICB9Cisg IGVzc2VudGlhbHMtPnp2ID0gWlY7CisgIGVzc2VudGlhbHMtPnp2X2J5dGUgPSBaVl9CWVRFOwor ICBlc3NlbnRpYWxzLT5mY194ID0gKGZpbGxfY29sdW1uX3AKKyAgICAgICAgICAgICAgICAgICAg ICAmJiAhTklMUCAoVmRpc3BsYXlfbGluZV9udW1iZXJzKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgPyAoZmlsbF9jb2wgKiBmcmFtZV9jaGFyX3dpZHRoKSArIHctPm1jLmxudW1fcGl4ZWxfd2lk dGggLSBoc2NsX3gKKyAgICAgICAgICAgICAgICAgICAgIDogKGZpbGxfY29sdW1uX3AKKyAgICAg ICAgICAgICAgICAgICAgICAgICYmIE5JTFAgKFZkaXNwbGF5X2xpbmVfbnVtYmVycykpCisgICAg ICAgICAgICAgICAgICAgICAgID8gKGZpbGxfY29sICogZnJhbWVfY2hhcl93aWR0aCkgLSBoc2Ns X3gKKyAgICAgICAgICAgICAgICAgICAgIDogMDsKKyAgaWYgKG9sZF9idWZmZXIpCisgICAgc2V0 X2J1ZmZlcl9pbnRlcm5hbCAob2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GVybiAoImZjLWluYWN0 aXZlLXBvc3QtenYtZmFjZSIpLCB0cnVlKQorICAgIDogKCFlc3NlbnRpYWxzLT5hY3RpdmVfcAor ICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX2luYWN0aXZl X3dpbmRvd3MpKQorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGNyb3NzaGFpcnMpKQorICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxl cikpCisgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gZXNzZW50aWFscy0+ZmNfeCkKKyAgICAgID8g bG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoImZjLW9wb2ludC1pbmFjdGl2ZS1wb3N0 LXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICA6IChlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAgICAgICYm ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAg ICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgJiYgdy0+Y3Vy c29yLnggPT0gZXNzZW50aWFscy0+ZmNfeCkKKyAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcs IGYsIGludGVybiAoImZjLW9wb2ludC1wb3N0LXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICA6ICghZXNz ZW50aWFscy0+YWN0aXZlX3AKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBmY19pbmFjdGl2ZV93aW5kb3dzKSkKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJV RkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAmJiAhTklMUCAoQlZBUiAo YiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAg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jaCAoYWN0aW9uX3R5 cGUpCisgIHsKKyAgICBjYXNlIE1VTFRJUExFX0NVUlNPUlM6CisgICAgeworICAgICAgc3RydWN0 IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgICAgICBwdHJkaWZmX3QgY3VycmVudF9j b2wgPSBtY19jdXJyZW50X2NvbHVtbiAodywgcG9zaW50KTsKKyAgICAgIHN0cnVjdCBidWZmZXIg KmIgPSBYQlVGRkVSICh3LT5jb250ZW50cyk7CisgICAgICBib29sIGZpbGxfY29sdW1uX3AgPSAh TklMUCAoQlZBUiAoYiwgZmlsbF9jb2x1bW4pKTsKKyAgICAgIGludCBmaWxsX2NvbCA9IChmaWxs X2NvbHVtbl9wKQorICAgICAgICAgICAgICAgICAgICAgPyBYRklYTlVNIChCVkFSIChiLCBmaWxs X2NvbHVtbikpCisgICAgICAgICAgICAgICAgICAgICA6IDA7CisgICAgICBlbnVtIGZhY2VfaWQg ZXZlbl9mYWNlX2lkID0KKyAgICAgICAgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAm JiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF9pbmFjdGl2ZV93aW5kb3dz KSkpCisgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistZXZlbi1p bmFjdGl2ZS1wcmUtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICA6IGxvb2t1cF9uYW1lZF9mYWNl ICh3LCBmLCBpbnRlcm4gKCIrLWV2ZW4tcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICBzdHJ1 Y3QgZmFjZSAqZXZlbl9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBldmVuX2ZhY2VfaWQpOworICAg ICAgTGlzcF9PYmplY3QgZXZlbl9jb2xvciA9IGV2ZW5fZmFjZS0+bGZhY2VbTEZBQ0VfRk9SRUdS T1VORF9JTkRFWF07CisgICAgICBzdHJ1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LWluYWN0aXZlLXByZS16di1mYWNl IiksIHRydWUpCisgICAgICAgIDogbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIist cG9zdC1maWxsLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgc3RydWN0IGZhY2UgKmJleW9u ZF9maWxsX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGJleW9uZF9maWxsX2ZhY2VfaWQpOworICAg ICAgTGlzcF9PYmplY3QgYmV5b25kX2ZpbGxfY29sb3IgPSBiZXlvbmRfZmlsbF9mYWNlLT5sZmFj ZVtMRkFDRV9GT1JFR1JPVU5EX0lOREVYXTsKKyAgICAgIHN0cnVjdCBtY19SR0IgYmV5b25kX2Zp bGxfZm9yZWdyb3VuZDsKKyAgICAgIG1jX3h3X2NvbG9yX3ZhbHVlcyAodywgYmV5b25kX2ZpbGxf Y29sb3IsICZiZXlvbmRfZmlsbF9mb3JlZ3JvdW5kKTsKKyAgICAgIC8qIHJlZCAqLworICAgICAg aWYgKCghZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAmJiBjdXJyZW50X2NvbCAlIDIgIT0gMAor ICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gPT0gUFJFX1pWKQorICAgICAgICAgIHx8IChmaWxs X2NvbHVtbl9wCisgICAgICAgICAgICAgICYmIGN1cnJlbnRfY29sICUgMiAhPSAwCisgICAgICAg ICAgICAgICYmIGN1cnJlbnRfY29sIDw9IGZpbGxfY29sCisgICAgICAgICAgICAgICYmIHJvd19w b3NpdGlvbiA9PSBQUkVfWlYpKQorICAgICAgICB7CisgICAgICAgICAgbHNsX2ZnLT5yZWQgPSBv ZGRfZm9yZWdyb3VuZC5yZWQ7CisgICAgICAgICAgbHNsX2ZnLT5ncmVlbiA9IG9kZF9mb3JlZ3Jv dW5kLmdyZWVuOworICAgICAgICAgIGxzbF9mZy0+Ymx1ZSA9IG9kZF9mb3JlZ3JvdW5kLmJsdWU7 CisgICAgICAgIH0KKyAgICAgICAgLyogeWVsbG93ICovCisgICAgICAgIGVsc2UgaWYgKCghZmls bF9jb2x1bW5fcAorICAgICAgICAgICAgICAgICAgJiYgY3VycmVudF9jb2wgJSAyID09IDAKKyAg ICAgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYpCisgICAgICAgICAgICAg ICAgIHx8IChmaWxsX2NvbHVtbl9wCisgICAgICAgICAgICAgICAgICAgICAmJiBjdXJyZW50X2Nv bCAlIDIgPT0gMAorICAgICAgICAgICAgICAgICAgICAgJiYgY3VycmVudF9jb2wgPD0gZmlsbF9j b2wKKyAgICAgICAgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYpKQorICAg ICAgICAgIHsKKyAgICAgICAgICAgIGxzbF9mZy0+cmVkID0gZXZlbl9mb3JlZ3JvdW5kLnJlZDsK KyAgICAgICAgICAgIGxzbF9mZy0+Z3JlZW4gPSBldmVuX2ZvcmVncm91bmQuZ3JlZW47CisgICAg ICAgICAgICBsc2xfZmctPmJsdWUgPSBldmVuX2ZvcmVncm91bmQuYmx1ZTsKKyAgICAgICAgICB9 CisgICAgICAgICAgLyogZ3JlZW4gKi8KKyAgICAgICAgICBlbHNlIGlmIChmaWxsX2NvbHVtbl9w CisgICAgICAgICAgICAgICAgICAgJiYgY3VycmVudF9jb2wgPiBmaWxsX2NvbAorICAgICAgICAg ICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYpCisgICAgICAgICAgICB7CisgICAg ICAgICAgICAgIGxzbF9mZy0+cmVkID0gYmV5b25kX2ZpbGxfZm9yZWdyb3VuZC5yZWQ7CisgICAg ICAgICAgICAgIGxzbF9mZy0+Z3JlZW4gPSBiZXlvbmRfZmlsbF9mb3JlZ3JvdW5kLmdyZWVuOwor ICAgICAgICAgICAgICBsc2xfZmctPmJsdWUgPSBiZXlvbmRfZmlsbF9mb3JlZ3JvdW5kLmJsdWU7 CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmIChyb3dfcG9zaXRpb24gPT0gQVRf WlYpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsc2xfZmctPnJlZCA9IGVzc2Vu dGlhbHMuc3BfZmcucmVkOworICAgICAgICAgICAgICAgIGxzbF9mZy0+Z3JlZW4gPSBlc3NlbnRp YWxzLnNwX2ZnLmdyZWVuOworICAgICAgICAgICAgICAgIGxzbF9mZy0+Ymx1ZSA9IGVzc2VudGlh bHMuc3BfZmcuYmx1ZTsKKyAgICAgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAg IGNhc2UgSE9SSVpPTlRBTF9SVUxFUjoKKyAgICB7CisgICAgICBpZiAoZ2x5cGggIT0gTlVMTAor ICAgICAgICAgICYmIGdseXBoLT51LmNoID09IDk1CisgICAgICAgICAgJiYgY3Vyc29yX3R5cGUg PT0gTUNfSEJBUikKKyAgICAgICAgeworICAgICAgICAgIGxzbF9mZy0+cmVkID0gZXNzZW50aWFs cy5zcF9mZy5yZWQ7CisgICAgICAgICAgbHNsX2ZnLT5ncmVlbiA9IGVzc2VudGlhbHMuc3BfZmcu Z3JlZW47CisgICAgICAgICAgbHNsX2ZnLT5ibHVlID0gZXNzZW50aWFscy5zcF9mZy5ibHVlOwor ICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBsc2xfZmct PnJlZCA9IGVzc2VudGlhbHMuY2hfZmdbcm93X3Bvc2l0aW9uXS5yZWQ7CisgICAgICAgICAgICBs c2xfZmctPmdyZWVuID0gZXNzZW50aWFscy5jaF9mZ1tyb3dfcG9zaXRpb25dLmdyZWVuOworICAg ICAgICAgICAgbHNsX2ZnLT5ibHVlID0gZXNzZW50aWFscy5jaF9mZ1tyb3dfcG9zaXRpb25dLmJs dWU7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgVkVSVElDQUxf UlVMRVI6CisgICAgeworICAgICAgbHNsX2ZnL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cmUgYW55 IGdseXBocyB3aXRoIGxiZWFyaW5nIDwgMCBvciByYmVhcmluZyA+IHdpZHRoIGluCisgICAgIHRo ZSByb3csIHJlZHJhdyBzb21lIGdseXBocyBpbiBmcm9udCBvciBmb2xsb3dpbmcgdGhlIGdseXBo CisgICAgIHN0cmluZ3MgYnVpbHQgYWJvdmUuICovCisgIGlmIChoZWFkICYmICFvdmVybGFwcyAm JiByb3ctPmNvbnRhaW5zX292ZXJsYXBwaW5nX2dseXBoc19wKQorICAgIHsKKyAgICAgIHN0cnVj dCBnbHlwaF9zdHJpbmcgKmgsICp0OworICAgICAgTW91c2VfSExJbmZvICpobGluZm8gPSBNT1VT RV9ITF9JTkZPIChmKTsKKyAgICAgIGludCBtb3VzZV9iZWdfY29sIFVOSU5JVCwgbW91c2VfZW5k X2NvbCBVTklOSVQ7CisgICAgICBib29sIGNoZWNrX21vdXNlX2ZhY2UgPSBmYWxzZTsKKyAgICAg IGludCBkdW1teV94ID0gMDsKKyAgICAgIC8qIElmIG1vdXNlIGhpZ2hsaWdodGluZyBpcyBvbiwg d2UgbWF5IG5lZWQgdG8gZHJhdyBhZGphY2VudAorICAgZ2x5cGhzIHVzaW5nIG1vdXNlLWZhY2Ug aGlnaGxpZ2h0aW5nLiAqLworICAgICAgaWYgKGFyZWEgPT0gVEVYVF9BUkVBICYmIHJvdy0+bW91 c2VfZmFjZV9wCisgICAgICAgICAgJiYgaGxpbmZvLT5tb3VzZV9mYWNlX2JlZ19yb3cgPj0gMAor ICAgICAgICAgICYmIGhsaW5mby0+bW91c2VfZmFjZV9lbmRfcm93ID49IDApCisgICAgICAgIHsK KyAgICAgICAgICBwdHJkaWZmX3Qgcm93X3Zwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgdy0+ Y3VycmVudF9tYXRyaXgpOworICAgICAgICAgIGlmIChyb3dfdnBvcyA+PSBobGluZm8tPm1vdXNl X2ZhY2VfYmVnX3JvdworICAgICAgICAgICAgICAmJiByb3dfdnBvcyA8PSBobGluZm8tPm1vdXNl X2ZhY2VfZW5kX3JvdykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY2hlY2tfbW91c2Vf ZmFjZSA9IHRydWU7CisgICAgICAgICAgICAgIG1vdXNlX2JlZ19jb2wgPSAocm93X3Zwb3MgPT0g aGxpbmZvLT5tb3VzZV9mYWNlX2JlZ19yb3cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IGhsaW5mby0+bW91c2VfZmFjZV9iZWdfY29sCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IDA7CisgICAgICAgICAgICAgIG1vdXNlX2VuZF9jb2wgPSAocm93X3Zwb3MgPT0gaGxp bmZvLT5tb3VzZV9mYWNlX2VuZF9yb3cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IGhsaW5mby0+bW91c2VfZmFjZV9lbmRfY29sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IHJvdy0+dXNlZFtURVhUX0FSRUFdOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAg ICAvKiBDb21wdXRlIG92ZXJoYW5ncyBmb3IgYWxsIGdseXBoIHN0cmluZ3MuICovCisgICAgICBp ZiAoRlJBTUVfUklGIChmKS0+Y29tcHV0ZV9nbHlwaF9zdHJpbmdfb3ZlcmhhbmdzKQorICAgICAg ICBmb3IgKHMgPSBoZWFkOyBzOyBzID0gcy0+bmV4dCkKKyAgICAgICAgICBGUkFNRV9SSUYgKGYp LT5jb21wdXRlX2dseXBoX3N0cmluZ19vdmVyaGFuZ3MgKHMpOworICAgICAgLyogUHJlcGVuZCBn bHlwaCBzdHJpbmdzIGZvciBnbHlwaHMgaW4gZnJvbnQgb2YgdGhlIGZpcnN0IGdseXBoCisgICAg ICBzdHJpbmcgdGhhdCBhcmUgb3ZlcndyaXR0ZW4gYmVjYXVzZSBvZiB0aGUgZmlyc3QgZ2x5cGgK KyAgICAgIHN0cmluZydzIGxlZnQgb3ZlcmhhbmcuICBUaGUgYmFja2dyb3VuZCBvZiBhbGwgc3Ry aW5ncworICAgICAgcHJlcGVuZGVkIG11c3QgYmUgZHJhd24gYmVjYXVzZSB0aGUgZmlyc3QgZ2x5 cGggc3RyaW5nCisgICAgICBkcmF3cyBvdmVyIGl0LiAqLworICAgICAgaSA9IGxlZnRfb3Zlcndy aXR0ZW4gKGhlYWQpOworICAgICAgaWYgKGkgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIGVu dW0gZHJhd19nbHlwaHNfZmFjZSBvdmVybGFwX2hsOworICAgICAgICAgIC8qIElmIHRoaXMgcm93 IGNvbnRhaW5zIG1vdXNlIGhpZ2hsaWdodGluZywgYXR0ZW1wdCB0byBkcmF3CisgICAgICAgICAg ICAgdGhlIG92ZXJsYXBwZWQgZ2x5cGhzIHdpdGggdGhlIGNvcnJlY3QgaGlnaGxpZ2h0LiAgVGhp cworICAgICAgICAgICAgIGNvZGUgZmFpbHMgaWYgdGhlIG92ZXJsYXAgZW5jb21wYXNzZXMgbW9y ZSB0aGFuIG9uZSBnbHlwaAorICAgICAgICAgICAgIGFuZCBtb3VzZS1oaWdobGlnaHQgc3BhbnMg b25seSBzb21lIG9mIHRoZXNlIGdseXBocy4KKyAgICAgICAgICAgICBIb3dldmVyLCBtYWtpbmcg aXQgd29yayBwZXJmZWN0bHkgaW52b2x2ZXMgYSBsb3QgbW9yZQorICAgICAgICAgICAgIGNvZGUs IGFuZCBJIGRvbid0IGtub3cgaWYgdGhlIHBhdGhvbG9naWNhbCBjYXNlIG9jY3VycyBpbgorICAg ICAgICAgICAgIHByYWN0aWNlLCBzbyB3ZSdsbCBzdGljayB0byB0aGlzIGZvciBub3cuICAtLS0g Y3lkICAqLworICAgICAgICAgIGlmIChjaGVja19tb3VzZV9mYWNlCisgICAgICAgICAgICAgICYm IG1vdXNlX2JlZ19jb2wgPCBzdGFydCAmJiBtb3VzZV9lbmRfY29sID4gaSkKKyAgICAgICAgICAg IG92ZXJsYXBfaGwgPSBEUk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GUgZ2x5cGggcm93CisgICAg ICAgICAgKHdoaWNoIGhhcyBubyBidWZmZXIgcG9zaXRpb24pLiAgV2hlbiBwbGFjaW5nIGEgZmFr ZSBjdXJzb3Igb24gdGhlICJNIiwKKyAgICAgICAgICBobCA9PSBEUkFXX0NVUlNPUiBhbmQgdGhl IFNUUkVUQ0hfR0xZUEggaXMgYGxlZnRfb3ZlcndyaXR0ZW5gLiAgRHJhd2luZworICAgICAgICAg IG5vcm1hbCB0ZXh0IGR1cmluZyBgdXBkYXRlX3dpbmRvdycgKERSQVdfTk9STUFMX1RFWFQpIGNh biBhbHNvIGVyYXNlIGZha2UKKyAgICAgICAgICBjdXJzb3JzIHRoYXQgYXJlIGBsZWZ0X292ZXJ3 cml0dGVuJy4gKi8KKyAgICAgICAgICBsZW5ndGggPSAwOworICAgICAgICAgIGZvciAocyA9IGg7 IHM7IHMgPSBzLT5uZXh0KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzLT5sZWZ0X292 ZXJ3cml0dGVuX3AgPSB0cnVlOworICAgICAgICAgICAgICBzLT5hY3Rpb25fdHlwZSA9IGFjdGlv bl90eXBlOworICAgICAgICAgICAgICBsZW5ndGggKz0gcy0+Zmlyc3RfZ2x5cGgtPnBpeGVsX3dp ZHRoOworICAgICAgICAgICAgfQorICAgICAgICAgIHJlbGF0aXZlX3ggPSBzdGFydF94IC0gbGVu Z3RoOworICAgICAgICAgIGZvciAocyA9IGg7IHM7IHMgPSBzLT5uZXh0KQorICAgICAgICAgICAg eworICAgICAgICAgICAgICBzLT5maXJzdF9nbHlwaC0+cmVsYXRpdmVfeCA9IHJlbGF0aXZlX3g7 CisgICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0gcy0+Zmlyc3RfZ2x5cGgtPnBpeGVsX3dpZHRo OworICAgICAgICAgICAgfQorICAgICAgICAgIHN0YXJ0ID0gaTsKKyAgICAgICAgICBjb21wdXRl X292ZXJoYW5nc19hbmRfeCAodCwgaGVhZC0+eCwgdHJ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NlCisgICAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX05PUk1BTF9URVhUOwor ICAgICAgICAgIGlmIChobCA9PSBvdmVybGFwX2hsIHx8IGNsaXBfaGVhZCA9PSBOVUxMKQorICAg ICAgICAgICAgY2xpcF9oZWFkID0gaGVhZDsKKyAgICAgICAgICBNQ19CVUlMRF9HTFlQSF9TVFJJ TkdTIChpLCBzdGFydCwgaCwgdCwgb3ZlcmxhcF9obCwgZHVtbXlfeCwgbGFzdF94KTsKKyAgICAg ICAgICBmb3IgKHMgPSBoOyBzOyBzID0gcy0+bmV4dCkKKyAgICAgICAgICAgIHMtPmJhY2tncm91 bmRfZmlsbGVkX3AgPSB0cnVlOworICAgICAgICAgIGNvbXB1dGVfb3ZlcmhhbmdzX2FuZF94ICh0 LCBoZWFkLT54LCB0cnVlKTsKKyAgICAgICAgICBwcmVwZW5kX2dseXBoX3N0cmluZ19saXN0cyAo JmhlYWQsICZ0YWlsLCBoLCB0KTsKKyAgICAgICAgfQorICAgICAgLyogQXBwZW5kIGdseXBocyBz dHJpbmdzIGZvciBnbHlwaHMgZm9sbG93aW5nIHRoZSBsYXN0IGdseXBoCisgICAgICBzdHJpbmcg dGFpbCB0aGF0IGFyZSBvdmVyd3JpdHRlbiBieSB0YWlsLiAgVGhlIGJhY2tncm91bmQgb2YKKyAg ICAgIHRoZXNlIHN0cmluZ3MgaGFzIHRvIGJlIGRyYXduIGJlY2F1c2UgdGFpbCdzIGZvcmVncm91 bmQgZHJhd3MKKyAgICAgIG92ZXIgaXQuICovCisgICAgICBpID0gcmlnaHRfb3ZlcndyaXR0ZW4g KHRhaWwpOworICAgICAgaWYgKGkgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIGVudW0gZHJh d19nbHlwaHNfZmFjZSBvdmVybGFwX2hsOworICAgICAgICAgIGlmIChjaGVja19tb3VzZV9mYWNl CisgICAgICAgICAgICAgICYmIG1vdXNlX2JlZ19jb2wgPCBpICYmIG1vdXNlX2VuZ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hdXNlIGl0IGNvdWxk CisgICAgICBwYWludCBvdmVyIHRoZSBmb3JlZ3JvdW5kIG9mIGZvbGxvd2luZyBnbHlwaHMuICov CisgICAgICBpID0gcmlnaHRfb3ZlcndyaXRpbmcgKHRhaWwpOworICAgICAgaWYgKGkgPj0gMCkK KyAgICAgICAgeworICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBvdmVybGFwX2hsOwor ICAgICAgICAgIGlmIChjaGVja19tb3VzZV9mYWNlCisgICAgICAgICAgICAgICYmIG1vdXNlX2Jl Z19jb2wgPCBpICYmIG1vdXNlX2VuZF9jb2wgPiBlbmQpCisgICAgICAgICAgICBvdmVybGFwX2hs ID0gRFJBV19NT1VTRV9GQUNFOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBvdmVy bGFwX2hsID0gRFJBV19OT1JNQUxfVEVYVDsKKyAgICAgICAgICBpZiAoaGwgPT0gb3ZlcmxhcF9o bCB8fCBjbGlwX3RhaWwgPT0gTlVMTCkKKyAgICAgICAgICAgIGNsaXBfdGFpbCA9IHRhaWw7Cisg ICAgICAgICAgaSsrOyAgICAgIC8qIFdlIG11c3QgaW5jbHVkZSB0aGUgSXRoIGdseXBoLiAqLwor ICAgICAgICAgIE1DX0JVSUxEX0dMWVBIX1NUUklOR1MgKGVuZCwgaSwgaCwgdCwgb3ZlcmxhcF9o bCwgeCwgbGFzdF94KTsKKyAgICAgICAgICBmb3IgKHMgPSBoOyBzOyBzID0gcy0+bmV4dCkKKyAg ICAgICAgICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVlOworICAgICAgICAgIGNvbXB1 dGVfb3ZlcmhhbmdzX2FuZF94IChoLCB0YWlsLT54ICsgdGFpbC0+d2lkdGgsIGZhbHNlKTsKKyAg ICAgICAgICBhcHBlbmRfZ2x5cGhfc3RyaW5nX2xpc3RzICgmaGVhZCwgJnRhaWwsIGgsIHQpOwor ICAgICAgICB9CisgICAgICB0YWlsID0gZ2x5cGhfc3RyaW5nX2NvbnRhaW5pbmdfYmFja2dyb3Vu ZF93aWR0aCAodGFpbCk7CisgICAgICBpZiAoY2xpcF90YWlsKQorICAgICAgICBjbGlwX3RhaWwg PSBnbHlwaF9zdHJpbmdfY29udGFpbmluZ19iYWNrZ3JvdW5kX3dpZHRoIChjbGlwX3RhaWwpOwor ICAgICAgaWYgKGNsaXBfaGVhZCB8fCBjbGlwX3RhaWwpCisgICAgICAgIGZvciAocyA9IGhlYWQ7 IHM7IHMgPSBzLT5uZXh0KQorICAgICAgICAgIHsKKyAgICAgICAgICAgIHMtPmNsaXBfaGVhZCA9 IGNsaXBfaGVhZDsKKyAgICAgICAgICAgIHMtPmNsaXBfdGFpbCA9IGNsaXBfdGFpbDsKKyAgICAg ICAgICB9CisgICAgfQorICAvKiBEcmF3IGFsbCBzdHJpbmdzLiAqLworICBmb3IgKHMgPSBoZWFk OyBzICYmIGRyYXdfcDsgcyA9IHMtPm5leHQpCisgICAgRlJBTUVfUklGIChmKS0+bWNfc2NyaWJl X3N0cmluZyAocywgbWF0cml4LCByb3csIGxzbCwgZ2x5cGhfZmxhdm9yLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsIGN1cnNv cl9nY19wKTsKKyNpZm5kZWYgSEFWRV9OUworICAvKiBXaGVuIGZvY3VzIGEgc29sZSBmcmFtZSBh bmQgbW92ZSBob3Jpem9udGFsbHksIHRoaXMgY2xlYXJzIG9uX3AKKyAgICAgY2F1c2luZyBhIGZh aWx1cmUgdG8gZXJhc2UgcHJldiBjdXJzb3IgcG9zaXRpb24uICovCisgIGlmIChhcmVhID09IFRF WFRfQVJFQQorICAgICAgJiYgIXJvdy0+ZnVsbF93aWR0aF9wCisgICAgICAvKiBXaGVuIGRyYXdp bmcgb3ZlcmxhcHBpbmcgcm93cywgb25seSB0aGUgZ2x5cGggc3RyaW5ncycKKyAgICAgIGZvcmVn cm91bmQga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JldHVybjsK KyAgICB9CisgIC8qIFZQT1MgPj0gbWF0cml4LT5ucm93cyBtZWFucyB0aGF0IHdpbmRvdyBoYXMg YmVlbiByZXNpemVkLgorICAgICBEb24ndCBib3RoZXIgdG8gZXJhc2UgdGhlIGN1cnNvci4gKi8K KyAgaWYgKHZwb3MgPj0gbWF0cml4LT5ucm93cykKKyAgICB7CisgICAgICBpZiAoZGVidWdfcCkK KyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZXJhc2VfY3Vyc29yOiAgcmV0dXJuICglZClc biIsIDIpOworICAgICAgcmV0dXJuOworICAgIH0KKyAgLyogSWYgcm93IGNvbnRhaW5pbmcgY3Vy c29yIGlzIG1hcmtlZCBpbnZhbGlkLCB0aGVyZSBpcyBub3RoaW5nIHdlCisgICAgIGNhbiBkby4g Ki8KKyAgaWYgKCFyb3ctPmVuYWJsZWRfcCkKKyAgICB7CisgICAgICBpZiAoZGVidWdfcCkKKyAg ICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZXJhc2VfY3Vyc29yOiAgcmV0dXJuICglZClcbiIs IDMpOworICAgICAgcmV0dXJuOworICAgIH0KKyAgLyogSWYgbGluZSBzcGFjaW5nIGlzID4gMCwg b2xkIGN1cnNvciBtYXkgb25seSBiZSBwYXJ0aWFsbHkgdmlzaWJsZSBpbgorICAgICB3aW5kb3cg YWZ0ZXIgc3BsaXQtd2luZG93LiAgU28gYWRqdXN0IHZpc2libGUgaGVpZ2h0LiAqLworICByb3ct PnZpc2libGVfaGVpZ2h0ID0gbWluIChyb3ctPnZpc2libGVfaGVpZ2h0LAorICAgICAgICAgICAg d2luZG93X3RleHRfYm90dG9tX3kgKHcpIC0gcm93LT55KTsKKyAgLyogSWYgcm93IGlzIGNvbXBs ZXRlbHkgaW52aXNpYmxlLCBkb24ndCBhdHRlbXB0IHRvIGRlbGV0ZSBhIGN1cnNvciB3aGljaAor ICAgICBpc24ndCB0aGVyZS4gIFRoaXMgY2FuIGhhcHBlbiB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ICYmIG1hdHJpeC0+cm93cyk7CisgIGVhc3NlcnQgKHJvdyA+PSAw ICYmIHJvdyA8IG1hdHJpeC0+bnJvd3MpOyAqLworICBib29sIGJhcmZfY3Jhc2hfb25lID0gKG1h dHJpeCAmJiBtYXRyaXgtPnJvd3MpID8gZmFsc2UgOiB0cnVlOworICBpZiAoYmFyZl9jcmFzaF9v bmUpCisgICAgcmV0dXJuOworICBib29sIGJhcmZfY3Jhc2hfdHdvID0gKHZwb3MgPj0gMCAmJiB2 cG9zIDwgbWF0cml4LT5ucm93cykgPyBmYWxzZSA6IHRydWU7CisgIGlmIChiYXJmX2NyYXNoX3R3 bykKKyAgICByZXR1cm47CisgIGlmICh4IDwgMAorICAgICAgfHwgeSA8IDAKKyAgICAgIHx8IGhw b3MgPCAwCisgICAgICB8fCB2cG9zIDwgMCkKKyAgICByZXR1cm47CisgIHN0cnVjdCBmcmFtZSAq ZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBib29sIGF1dG9faHNjcm9sbF9tb2RlX3AgPSBFUSAo RmJ1ZmZlcl9sb2NhbF92YWx1ZSAoUWF1dG9faHNjcm9sbF9tb2RlLCB3LT5jb250ZW50cyksIFFj dXJyZW50X2xpbmUpOworICAvKiBFWEFNUExFOiAgKHNjcm9sbC1sZWZ0IDUpICovCisgIGJvb2wg aHNjbF9hbGxfdGVtcF9wID0gKHctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+ bWluX2hzY3JvbGwgPT0gMCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIG5vdGhp bmcuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8wX3AgPSAody0+c3VzcGVuZF9hdXRvX2hzY3Jv bGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSB3LT5oc2Nyb2xsKTsKKyAgLyogRVhBTVBM RTogIEMtdSBDLXggPCBhbmQgZG8gc29tZXRoaW5nIGVsc2UgYmVzaWRlcyBob3Jpem9udGFsbHkg c2Nyb2xsaW5nIHRoZQorICAgICAgICAgICAgICAgY3VycmVudCBsaW5lIGRpZmZlcmVudGx5Lgor ICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIGlzIF9ub3RfIGhvcml6b250YWxseSBzY3JvbGxl ZCBkaWZmZXJlbnRseS4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzFfcCA9ICghdy0+c3VzcGVu ZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3Jv bGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSB3LT5oc2Nyb2xsKTsK KyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBhbmQgLi4uCisgICAgICAgICAgICAgICBDdXJyZW50 IGxpbmUgaXMgX25vdF8gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBi b29sIGhzY2xfYWxsX3Blcm1fMl9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID09IDAKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiB3LT5taW5faHNjcm9sbCAhPSB3LT5oc2Nyb2xsKTsKKyAgLyogRVhBTVBMRTogIChzY3Jv bGwtbGVmdCA1KTsgYW5kLCB0aGVuIHByZXNzIHRoZSBsZWZ0IGFycm93IGtleSBvbmUgdGltZS4K KyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBfaXNfIGhvcml6b250YWxseSBzY3JvbGxlZCBk aWZmZXJlbnRseS4qLworICBib29sIGhzY2xfdGVtcF9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNj cm9sbAorICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAg ICYmIHctPm1pbl9oc2Nyb2xsID09IDApOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBk byBzb21ldGhpbmcgdGhhdCBjYXVzZXMgdGhlIGN1cnJlbnQgbGluZSB0byBiZQorICAgICAgICAg ICAgICAgaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LgorICAgICAgICAgICAgICAg Q3VycmVudCBsaW5lIF9pc18gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLwor ICBib29sIGhzY2xfcGVybV9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAg ICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAg ICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Ny b2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhz Y3JvbGwpOworICBpbnQgZnJpbmdlX2JpdG1hcCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgIGlu dCBmYWNlX2lkID0gREVGQVVMVF9GQUNFX0lEOworICBpZiAoIXJlbW92ZV9wCisgICAgICAmJiBn bHlwaF9mbGF2b3IgPT0gTUNfT1ZFUkxBWV9BUlJPV19CSVRNQVAKKyAgICAgICYmICFoc2NsX2Fs bF90ZW1wX3AKKyAgICAgICYmICFoc2NsX3RlbXBfcAorICAgICAgJiYgIWhzY2xfcGVybV9wCisg ICAgICAmJiAhaHNjbF9hbGxfcGVybV8wX3AKKyAgICAgICYmICFoc2NsX2FsbF9wZXJtXzFfcAor ICAgICAgJiYgIWhzY2xfYWxsX3Blcm1fMl9wKQorICAgIHsKKyAgICAgIGVudW0gZmFjZV9pZCBv dmVybGF5X2Fycm93X2ZhY2VfaWQgPQorICAgICAgICAoIWFjdGl2ZV9wCisgICAgICAgICAmJiAh TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkp CisgICAgICAgID8gbG9va3VwX2Rlcml2ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5 LWFycm93LWluYWN0aXZlLXByZS16di1mYWNlIiksIEZSSU5HRV9GQUNFX0lELCB0cnVlKQorICAg ICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAgICA/IGxvb2t1cF9kZXJpdmVkX2ZhY2UgKHcsIGYs IGludGVybiAoIistb3ZlcmxheS1hcnJvdy1wcmUtenYtZmFjZSIpLCBGUklOR0VfRkFDRV9JRCwg dHJ1ZSkKKyAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICBmYWNlX2lkID0gKGN1cnNv cl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICA/IG92ZXJs YXlfYXJyb3dfZmFjZV9pZAorICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAg ICAgaWYgKHctPmhzY3JvbGwgIT0gMCkKKyAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9m cmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ciKSwgZmFsc2UsIHRydWUp OworICAgICAgICBlbHNlCisgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2Vf Yml0bWFwICh3LCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ciKSwgdHJ1ZSwgdHJ1ZSk7CisgICAg ICByb3ctPmxlZnRfZnJpbmdlX2JpdG1hcCA9IChjdXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5H RV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZnJpbmdlX2JpdG1h cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7 CisgICAgICByb3ctPmxlZnRfZnJpbmdlX2ZhY2VfaWQgPSBmYWNlX2lkOworICAgICAgcm93LT5s ZWZ0X2ZyaW5nZV9vZmZzZXQgPSAwOworICAgICAgcm93LT5mcmluZ2VfYml0bWFwX3BlcmlvZGlj X3AgPSBmYWxzZTsKKyAgICB9CisgICAgZWxzZSBpZiAoIXJlbW92ZV9wCisgICAgICAgICAgICAg JiYgZ2x5cGhfZmxhdm9yID09IE1DX09WRVJMQVlfQVJST1dfQklUTUFQCisgICAgICAgICAgICAg JiYgKGhzY2xfYWxsX3RlbXBfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzBf cAorICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzFfcAorICAgICAgICAgICAgICAg ICB8fCBoc2NsX2FsbF9wZXJtXzJfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX3RlbXBfcAor ICAgICAgICAgICAgICAgICB8fCBoc2NsX3Blcm1fcCkpCisgICAgICB7CisgICAgICAgIGVudW0g ZmFjZV9pZCBvdmVybGF5X2Fycm93X2ZhY2VfaWQgPQorICAgICAgICAgICghYWN0aXZlX3AKKyAg ICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaW5hY3Rp dmVfd2luZG93cykpKQorICAgICAgICAgID8gbG9va3VwX2Rlcml2ZWRfZmFjZSAodywgZiwgaW50 ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtaW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwgRlJJTkdF X0ZBQ0VfSUQsIHRydWUpCisgICAgICAgICAgOiAoYWN0aXZlX3ApCisgICAgICAgICAgICA/IGxv b2t1cF9kZXJpdmVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1oc2NsLXBy ZS16di1mYWNlIiksIEZSSU5HRV9GQUNFX0lELCB0cnVlKQorICAgICAgICAgIDogREVGQVVMVF9G QUNFX0lEOworICAgICAgICBmYWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdF X0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgID8gb3ZlcmxheV9hcnJvd19mYWNlX2lkCisgICAg ICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgaWYgKGhzY2xfYWxsX3Bl cm1fMF9wKQorICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAo dywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAgICBlbHNl IGlmIChoc2NsX2FsbF9wZXJtXzFfcCkKKyAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19n ZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgdHJ1ZSwgZmFsc2Up OworICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF9hbGxfcGVybV8yX3ApCisgICAgICAgICAgICAg IGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2Ns LXBlcm0iKSwgZmFsc2UsIHRydWUpOworICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX3Blcm1f cCkKKyAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAg KHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIHRydWUsIHRydWUpOworICAgICAgICAgICAgICAg IGVsc2UgaWYgKGhzY2xfYWxsX3RlbXBfcCkKKyAgICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRt YXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXRlbXAiKSwgZmFs c2UsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xfdGVtcF9wKQorICAg ICAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcs IGludGVybiAoIistaHNjbC10ZW1wIiksIHRydWUsIGZhbHNlKTsKKyAgICAgICAgcm93LT5sZWZ0 X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAg ICAgcm93LT5sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gZmFjZV9pZDsKKyAgICAgICAgcm93LT5sZWZ0 X2ZyaW5nZV9vZmZzZXQgPSAwOworICAgICAgICByb3ctPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNf cCA9IGZhbHNlOworICAgICAgfQorICAgICAgZWxzZSBpZiAoIXJlbW92ZV9wCisgICAgICAgICAg ICAgICAmJiAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cK KyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9X X1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZv ciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFCisgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxh dm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIHx8 IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAg ICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSCisgICAg ICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JB UgorICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJf QkFDS1NMQVNIKSkKKyAgICAgICAgeworICAgICAgICAgIExpc3BfT2JqZWN0IGJpdG1hcF9mbGF2 b3IgPSAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hvbGxvd19yZWN0YW5n bGVfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAo Z2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRf aG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xl CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9 PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNF RF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19W RVJUSUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBR bWNfdmVydGljYWxfYmFyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog KGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxfYmFyCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBN Q19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jhcl9iYWNrc2xhc2gKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiBRbmlsOworICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSAo Y3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBsb29rdXBfZnJpbmdlX2JpdG1hcCAoYml0bWFwX2ZsYXZvcikKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgOiBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgIGZhY2Vf aWQgPSAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAorICAgICAgICAgICAg ICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xF X1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09 IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAg ICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpKQorICAg ICAgICAgICAgICAgICAgICAgID8gbG9va3VwX2Rlcml2ZWRfZmFjZSAodywgZiwgaW50ZXJuICgi Ky1yZXZlcnNlZC1iYXItcHJlLXp2LWZhY2UiKSwgRlJJTkdFX0ZBQ0VfSUQsIHRydWUpCisgICAg ICAgICAgICAgICAgICAgIDogKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAK KyAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX0hP TExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5 cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAg ICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxf QkFSKQorICAgICAgICAgICAgICAgICAgICAgID8gbG9va3VwX2Rlcml2ZWRfZmFjZSAodywgZiwg aW50ZXJuICgiKy1iYXItcHJlLXp2LWZhY2UiKSwgRlJJTkdFX0ZBQ0VfSUQsIHRydWUpCisgICAg ICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAgIHJvdy0+Y3Vyc29y X2luX2ZyaW5nZV9wID0gZmFsc2U7CisgICAgICAgICAgcm93LT5yaWdodF9mcmluZ2VfYml0bWFw ID0gZnJpbmdlX2JpdG1hcDsKKyAgICAgICAgICByb3ctPnJpZ2h0X2ZyaW5nZV9mYWNlX2lkID0g ZmFjZV9pZDsKKyAgICAgICAgICByb3ctPnJpZ2h0X2ZyaW5nZV9vZmZzZXQgPSAwOworICAgICAg ICAgIHJvdy0+ZnJpbmdlX2JpdG1hcF9wZXJpb2RpY19wID0gZmFsc2U7CisgICAgICAgIH0KKyAg ICAgICAgZWxzZSBpZiAoZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBICisgICAgICAgICAgICAgICAg IHx8IGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSExFU1MpCisgICAgICAgICAgeworICAgICAgICAg ICAgYm9vbCBvbl9wID0gdHJ1ZTsKKyAgICAgICAgICAgIEZSQU1FX1JJRiAoZiktPm1jX3Njcmli ZV9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCB3ZCwgaCwgbHNsLCBjdXJz b3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1 cnNvcl93aWR0aCwgZ2x5cGhfZmxhdm9yLCBvbl9wLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgYWN0aXZlX3ApOworICAgICAgICAgIH0KK30KKworLyogRHVt cCBjb250ZW50cyBvZiBnbHlwaCBHTFlQSCB0byBzdGRlcnIuICBST1cgYW5kIEFSRUEgYXJlCisg ICB0aGUgZ2x5cGggcm93IGFuZCBhcmVhIHdoZXJlIHRoZSBnbHlwaCBjb21lcyBmcm9tLiAqLwor dm9pZAorbWNfZHVtcF9nbHlwaCAoc3RydWN0IGdseXBoX3JvdyAqcm93LCBzdHJ1Y3QgZ2x5cGgg KmdseXBoLCBpbnQgYXJlYSwKKyAgICAgICAgICAgICAgIGludCByZWxhdGl2ZV94LCBpbnQgdnBv cykKK3sKKyAgYm9vbCBnbHlwaF96dl9wID0gKGdseXBoIC0gcm93LT5nbHlwaHNbYXJlYV0gPT0g cm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgJiYgTUFUUklYX1JPV19F TkRfQ0hBUlBPUyAocm93KSA9PSBaVik7CisgIGlmIChnbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBI CisgICAgICB8fCBnbHlwaC0+dHlwZSA9PSBHTFlQSExFU1NfR0xZUEgpCisgICAgeworICAgICAg ZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAl YyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICAlM2QgJXMgJXNcbiIsCisgICAgICAgIGdseXBo IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0g MCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAg ICAgIChnbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAgICA/ICdDJworICAgICAgICAg OiAnRycpLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBo LT5vYmplY3QpCisgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9i amVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2Jq ZWN0KQorICAgICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAg ICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIGdseXBoLT51LmNoLAorICAgICAgICBn bHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAg Z2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9w ID8gIlpWIiA6ICItLSIsCisgICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nIChnbHlwaC0+dS5jaCkp OworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gU1RSRVRDSF9HTFlQSCkKKyAgICB7 CisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICIgJTUicEQiZC8lLTVkICU1ZCAlYyAl OSJwRCJkICVjICUzZCAweCUwNnggJTRkICUxLjFkJTEuMWQgICUzZCAlcyAlc1xuIiwKKyAgICAg ICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFth cmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVf eCwKKyAgICAgICAgJ1MnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZF UlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdCJworICAgICAgICAgIDogKFNUUklO R1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgIDogKE5JTFAg KGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICcwJworICAgICAgICAgIDogJy0nKSkpLAor ICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIDB1LAorICAgICAgICBnbHlwaC0+ ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgt PnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpW IiA6ICItLSIsCisgICAgICAgICJcXFMiKTsKKyAgICB9CisgIGVsc2UgaWYgKGdseXBoLT50eXBl ID09IElNQUdFX0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAg IiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4x ZCAgJTNkICVzICVjXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0s CisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAt IDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAnSScsCisgICAgICAgIGdseXBoLT5j aGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8g J0InCisgICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8g J1MnCisgICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJzAn CisgICAgICAgICAgOiAnLScpKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAg ICAgKHVuc2lnbmVkIGludCkgZ2x5cGgtPnUuaW1nX2lkLAorICAgICAgICBnbHlwaC0+ZmFjZV9p ZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0 X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICIt LSIsCisgICAgICAgICcuJyk7CisgICAgfQorICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBDT01Q T1NJVEVfR0xZUEgpCisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICU1 InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4IiwKKyAgICAgICAgZ2x5cGgg LSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAw KSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAg ICAgJysnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBo LT5vYmplY3QpCisgICAgICAgICAgICA/ICdCJworICAgICAgICAgIDogKFNUUklOR1AgKGdseXBo LT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5v YmplY3QpCisgICAgICAgICAgICA/ICcwJworICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBn bHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgICh1bnNpZ25lZCBpbnQpIGdseXBoLT51LmNtcC5p ZCk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgJTRkICUxLjFkJTEuMWQiLAorICAgICAgICBn bHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAg Z2x5cGgtPnJpZ2h0X2JveF9saW5lX3ApOworICAgICAgaWYgKGdseXBoLT51LmNtcC5hdXRvbWF0 aWMpCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgJTNkICVzIC4gWyVkLSVkXVxuIiwKKyAg ICAgICAgICAgICAgICAgICAgICAgICBnbHlwaC0+aHBvcywgZ2x5cGhfenZfcCA/ICJaViIgOiAi LS0iLAorICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoLT5zbGljZS5jbXAuZnJvbSwgZ2x5 cGgtPnNsaWNlLmNtcC50byk7CisgICAgICAgIGVsc2UKKyAgICAgICAgZnByaW50ZiAoc3RkZXJy LCAiXG4iKTsKKyAgICB9CisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IFhXSURHRVRfR0xZUEgp CisgICAgeworI2lmbmRlZiBIQVZFX1hXSURHRVRTCisgICAgICBlYXNzdW1lIChmYWxzZSk7Cisj ZWxzZQorICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICAlNWQvJS01ZCAlNWQgJTRj ICU2ZCAlYyAlM2QgMHglMDV4ICU0ZCAlMS4xZCUxLjFkICAlM2QgJXMgJWNcbiIsCisgICAgICAg IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJl YV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gs CisgICAgICAgICdYJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQ IChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAo Z2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICA6ICctJykpLAorICAg ICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAg ICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVf cCwKKyAgICAgICAgZ2x5cGgtPnUueHdpZGdldCwKKyAgICAgICAgZ2x5cGgtPmhwb3MsIGdseXBo X3p2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgJy4nKTsKKyNlbmRpZgorICAgIH0KK30KKwor LyogRHVtcCB0aGUgY29udGVudHMgb2YgZ2x5cGggcm93IGF0IFZQT1MgaW4gTUFUUklYIHRvIHN0 ZGVyci4KKyAgIEdMWVBIUyAwIG1lYW5zIGRvbid0IHNob3cgZ2x5cGggY29udGVudHMuCisgICBH TFlQSFMgMSBtZWFucyBzaG93IGdseXBocyBpbiBzaG9ydCBmb3JtCisgICBHTFlQSFMgPiAxIG1l YW5zIHNob3cgZ2x5cGhzIGluIGxvbmcgZm9ybS4gKi8KK3ZvaWQKK21jX2R1bXBfZ2x5cGhfcm93 IChzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCB2cG9zLCBpbnQgZ2x5cGhzKQoreworICBpbnQg cmVsYXRpdmVfeCA9IDA7CisgIGlmIChnbHlwaHMgIT0gMSkKKyAgICB7CisgICAgICBmcHJpbnRm IChzdGRlcnIsICJcbkRVTVAgR0xZUEggUk9XXG4iKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwg IlJvdyAgICAgU3RhcnQgICAgICAgRW5kIFVzZWQgb0U+PFxcQ1RaRmVzbSAgICAgWCAgICBZICAg IFcgICAgSCAgICBWICAgIEEgICAgUFxuIik7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICI9PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT1cbiIpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiJTNkICU5InBE ImQgJTkicEQiZCAlNGQgJTEuMWQlMS4xZCUxLjFkJTEuMWRcCislMS4xZCUxLjFkJTEuMWQlMS4x ZCUxLjFkJTEuMWQlMS4xZCUxLjFkICAlNGQgJTRkICU0ZCAlNGQgJTRkICU0ZCAlNGRcbiIsCisg ICAgICAgICB2cG9zLAorICAgICAgICAgTUFUUklYX1JPV19TVEFSVF9DSEFSUE9TIChyb3cpLAor ICAgICAgICAgTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSwKKyAgICAgICAgIHJvdy0+dXNl ZFtURVhUX0FSRUFdLAorICAgICAgICAgcm93LT5jb250YWluc19vdmVybGFwcGluZ19nbHlwaHNf cCwKKyAgICAgICAgIHJvdy0+ZW5hYmxlZF9wLAorICAgICAgICAgcm93LT50cnVuY2F0ZWRfb25f bGVmdF9wLAorICAgICAgICAgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCwKKyAgICAgICAgIHJv dy0+Y29udGludWVkX3AsCisgICAgICAgICBNQVRSSVhfUk9XX0NPTlRJTlVBVElPTl9MSU5FX1Ag KHJvdyksCisgICAgICAgICBNQVRSSVhfUk9XX0RJU1BMQVlTX1RFWFRfUCAocm93KSwKKyAgICAg ICAgIHJvdy0+ZW5kc19hdF96dl9wLAorICAgICAgICAgcm93LT5maWxsX2xpbmVfcCwKKyAgICAg ICAgIHJvdy0+ZW5kc19pbl9taWRkbGVfb2ZfY2hhcl9wLAorICAgICAgICAgcm93LT5zdGFydHNf aW5fbWlkZGxlX29mX2NoYXJfcCwKKyAgICAgICAgIHJvdy0+bW91c2VfZmFjZV9wLAorICAgICAg ICAgcm93LT54LAorICAgICAgICAgcm93LT55LAorICAgICAgICAgcm93LT5waXhlbF93aWR0aCwK KyAgICAgICAgIHJvdy0+aGVpZ2h0LAorICAgICAgICAgcm93LT52aXNpYmxlX2hlaWdodCwKKyAg ICAgICAgIHJvdy0+YXNjZW50LAorICAgICAgICAgcm93LT5waHlzX2FzY2VudCk7CisgICAgICAv KiBUaGUgbmV4dCAzIGxpbmVzIHNob3VsZCBhbGlnbiB0byAiU3RhcnQiIGluIHRoZSBoZWFkZXIu ICovCisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgICAgJTkicEQiZCAlOSJwRCJkXHQlNWRcbiIs IHJvdy0+c3RhcnQub3ZlcmxheV9zdHJpbmdfaW5kZXgsCisgICAgICAgICByb3ctPmVuZC5vdmVy bGF5X3N0cmluZ19pbmRleCwKKyAgICAgICAgIHJvdy0+Y29udGludWF0aW9uX2xpbmVzX3dpZHRo KTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgICAlOSJwRCJkICU5InBEImRcbiIsCisgICAg ICAgICBDSEFSUE9TIChyb3ctPnN0YXJ0LnN0cmluZ19wb3MpLAorICAgICAgICAgQ0hBUlBPUyAo cm93LT5lbmQuc3RyaW5nX3BvcykpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICAgICU5ZCAl OWRcbiIsIHJvdy0+c3RhcnQuZHB2ZWNfaW5kZXgsCisgICAgICAgICByb3ctPmVuZC5kcHZlY19p bmRleCk7CisgICAgfQorICBpZiAoZ2x5cGhzID4gMSkKKyAgICB7CisgICAgICBmb3IgKGludCBh cmVhID0gTEVGVF9NQVJHSU5fQVJFQTsgYXJlYSA8IExBU1RfQVJFQTsgKythcmVhKQorICAgICAg ICB7CisgICAgICAgICAgc3RydWN0IGdseXBoICpnbHlwaCA9IHJvdy0+Z2x5cGhzW2FyZWFdOwor ICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGhfZW5kID0gZ2x5cGggKyByb3ctPnVzZWRbYXJl YV07CisgICAgICAgICAgLyogR2x5cGggZm9yIGEgbGluZSBlbmQgaW4gdGV4dC4gKi8KKyAgICAg ICAgICBpZiAoYXJlYSA9PSBURVhUX0FSRUEgJiYgZ2x5cGggPT0gZ2x5cGhfZW5kICYmIGdseXBo LT5jaGFycG9zID4gMCkKKyAgICAgICAgICAgICsrZ2x5cGhfZW5kOworICAgICAgICAgIGlmIChn bHlwaCA8IGdseXBoX2VuZCkKKyAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIkdseXBoIy9U b3RhbCBSZWwuWCBUICAgICAgIFBvcyBPICAgVyAgICAgQ29kZSBGYWNlIExSIEhQT1MgWlYgQ1xu Iik7CisgICAgICAgICAgZm9yICg7IGdseXBoIDwgZ2x5cGhfZW5kOyArK2dseXBoKQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICBtY19kdW1wX2dseXBoIChyb3csIGdseXBoLCBhcmVhLCBy ZWxhdGl2ZV94LCB2cG9zKTsKKyAgICAgICAgICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4 ZWxfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZiAo Z2x5cGhzID09IDEpCisgICAgICB7CisgICAgICAgIGNoYXIgc1tTSFJUX01BWCArIDRdOworICAg ICAgICBmb3IgKGludCBhcmVhID0gTEVGVF9NQVJHSU5fQVJFQTsgYXJlYSA8IExBU1RfQVJFQTsg KythcmVhKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGludCBpOworICAgICAgICAgICAgZm9y IChpID0gMDsgaSA8IHJvdy0+dXNlZFthcmVhXTsgKytpKQorICAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgc3RydWN0IGdseXBoICpnbHlwaCA9IHJvdy0+Z2x5cGhzW2FyZWFdICsgaTsK KyAgICAgICAgICAgICAgICBpZiAoaSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAg ICAgICAgICAgICYmIGFyZWEgPT0gVEVYVF9BUkVBCisgICAgICAgICAgICAgICAgICAgICYmIE5J TFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT50eXBlID09 IENIQVJfR0xZUEgKKyAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGgtPnUuY2ggPT0gJyAnKQor ICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzdHJjcHkgKCZzW2ldLCAi W1xcbl0iKTsKKyAgICAgICAgICAgICAgICAgICAgaSArPSA0OworICAgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGgtPnUuY2ggPCAweDgwCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaC0+dS5jaCA+PSAnICcpCisgICAgICAgICAgICAg ICAgICAgIHNbaV0gPSBnbHlwaC0+dS5jaDsKKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICAgICAgICAgIHNbaV0gPSAnLic7CisgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgIHNbaV0gPSAnXDAnOworICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiJTNkOiAoJWQp ICclcydcbiIsIHZwb3MsIHJvdy0+ZW5hYmxlZF9wLCBzKTsKKyAgICAgICAgICB9CisgICAgICB9 Cit9CisKK0RFRlVOICgibWMtZHVtcC1nbHlwaC1yb3ciLCBGbWNfZHVtcF9nbHlwaF9yb3csIFNt Y19kdW1wX2dseXBoX3JvdywgMSwgMiwgIlAiLAorICAgICAgIGRvYzogLyogRHVtcCBnbHlwaCBy b3cgUk9XIHRvIHN0ZGVyci4KK0ludGVyYWN0aXZlbHksIFJPVyBpcyB0aGUgcHJlZml4IG51bWVy aWMgYXJndW1lbnQgYW5kIGRlZmF1bHRzIHRvCit0aGUgcm93IHdoaWNoIGRpc3BsYXlzIHBvaW50 LgorT3B0aW9uYWwgYXJndW1lbnQgR0xZUEhTIDAgbWVhbnMgZG9uJ3QgZHVtcCBnbHlwaHMuCitH TFlQSFMgMSBtZWFucyBkdW1wIGdseXBocyBpbiBzaG9ydCBmb3JtLgorR0xZUEhTID4gMSBvciBv bWl0dGVkIG1lYW5zIGR1bXAgZ2x5cGhzIGluIGxvbmcgZm9ybS4gICovKQorICAoTGlzcF9PYmpl Y3Qgcm93LCBMaXNwX09iamVjdCBnbHlwaHMpCit7CisgIHN0cnVjdCB3aW5kb3cgKncgPSBYV0lO RE9XIChzZWxlY3RlZF93aW5kb3cpOworICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXggPSB3 LT5jdXJyZW50X21hdHJpeDsKKyAgRU1BQ1NfSU5UIHZwb3M7CisgIGlmIChOSUxQIChyb3cpKQor ICAgIHsKKyAgICAgIGludCBkMSwgZDIsIGQzLCBkNCwgZDUsIHlwb3M7CisgICAgICBib29sIHZp c2libGVfcCA9IHBvc192aXNpYmxlX3AgKHcsIFBULCAmZDEsICZkMiwgJmQzLCAmZDQsICZkNSwg Jnlwb3MpOworICAgICAgaW50IGhlYWRlcl9saW5lX2hlaWdodCA9IFdJTkRPV19IRUFERVJfTElO RV9IRUlHSFQgKHcpOworICAgICAgaW50IHZvZmZzZXQgPSAoaGVhZGVyX2xpbmVfaGVpZ2h0ID4g MAorICAgICAgICAgICAgICAgICAgICAgJiYgeXBvcyA+IDApCisgICAgICAgICAgICAgICAgICAg ICAgPyB5cG9zICsgMQorICAgICAgICAgICAgICAgICAgICAgIDogeXBvczsKKyAgICAgIGlmICh2 aXNpYmxlX3ApCisgICAgICAgIHZwb3MgPSB2b2Zmc2V0OworICAgICAgICBlbHNlCisgICAgICAg ICAgdnBvcyA9IDA7CisgICAgfQorICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgQ0hFQ0tfTlVN QkVSIChyb3cpOworICAgICAgICB2cG9zID0gWEZJWE5VTSAocm93KTsKKyA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bnQsIGl0cyB2YWx1ZSBpcyBwYXNzZWQgYXMgdGhlIEdMWVBIUyBmbGFnLiAgKi8p CisgIChMaXNwX09iamVjdCBnbHlwaHMpCit7CisgIHN0cnVjdCB3aW5kb3cgKncgPSBYV0lORE9X IChzZWxlY3RlZF93aW5kb3cpOworICBzdHJ1Y3QgYnVmZmVyICpidWZmZXIgPSBYQlVGRkVSICh3 LT5jb250ZW50cyk7CisgIGZwcmludGYgKHN0ZGVyciwgIlBUID0gJSJwRCJkLCBCRUdWID0gJSJw RCJkLiBaViA9ICUicEQiZFxuIiwKKyAgICAgQlVGX1BUIChidWZmZXIpLCBCVUZfQkVHViAoYnVm ZmVyKSwgQlVGX1pWIChidWZmZXIpKTsKKyAgZnByaW50ZiAoc3RkZXJyLCAiQ3Vyc29yIHggPSAl ZCwgeSA9ICVkLCBocG9zID0gJWQsIHZwb3MgPSAlZFxuIiwKKyAgICAgdy0+Y3Vyc29yLngsIHct PmN1cnNvci55LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MpOworICBmcHJpbnRmIChz dGRlcnIsICI9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiIp OworICBtY19kdW1wX2dseXBoX21hdHJpeCAody0+Y3VycmVudF9tYXRyaXgsCisgICAgICAgICBU WVBFX1JBTkdFRF9GSVhOVU1QIChpbnQsIGdseXBocykgPyBYRklYTlVNIChnbHlwaHMpIDogMCk7 CisgIHJldHVybiBRbmlsOworfQorCitib29sCittY190cmF2ZXJzZV9jYWNoZV9wIChzdHJ1Y3Qg bWNfbWF0cml4IG1hdHJpeCwgZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUsCisgICAgICAg ICAgICAgICAgICAgICBpbnQgdm50aCwgaW50IG50aCkKK3sKKyAgaWYgKHZudGggPCBtYXRyaXgu dnBvc191c2VkCisgICAgICAmJiBtYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5cGVdID4gMAor ICAgICAgJiYgbnRoIDwgbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXSkK KyAgICByZXR1cm4gdHJ1ZTsKKyAgICBlbHNlCisgICAgICByZXR1cm4gZmFsc2U7Cit9CisKK3Zv aWQKK21jX3Jlc2V0X2NhY2hlIChzdHJ1Y3Qgd2luZG93ICp3KQoreworICBpZiAoIUJVRkZFUlAg KHctPmNvbnRlbnRzKSkKKyAgICByZXR1cm47CisgIGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNh Y2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7CisgICAg ICAgKytjYWNoZV90eXBlKQorICAgIHsKKyAgICAgIGJvb2wgYnZhcl9hY3RpdmVfcDsKKyAgICAg IHN3aXRjaCAoY2FjaGVfdHlwZSkKKyAgICAgICAgeworICAgICAgICAgIGNhc2UgTk9fQ0FDSEU6 CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAg ICAgICAgICBjYXNlIE1DX0NBQ0hFOgorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAo QlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAmJiBOSUxQIChCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkKKyAgICAgICAgICAgICAgICBidmFyX2Fj dGl2ZV9wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoQlVGRkVSUCAody0+Y29u dGVudHMpCisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIg KHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQorICAgICAgICAgICAgICAgICAgYnZhcl9hY3RpdmVf cCA9IHRydWU7CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAg IGNhc2UgQ0hfQ0FDSEU6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmIChCVUZGRVJQ ICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIg KHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgICAgICAgICAgICAgIGJ2YXJfYWN0aXZl X3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBlbHNlIGlmIChCVUZGRVJQICh3LT5jb250ZW50 cykKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisgICAgICAgICAgICAgICAgICBidmFyX2FjdGl2ZV9w ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAg Y2FzZSBGQ19DQUNIRToKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKEJVRkZFUlAg KHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpCisgICAgICAgICAgICAgICAgYnZhcl9hY3RpdmVf cCA9IGZhbHNlOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRz KQorICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIGZjX3Zpc2libGUpKSkKKyAgICAgICAgICAgICAgICAgIGJ2YXJfYWN0aXZlX3Ag PSB0cnVlOworICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQor ICAgICAgaWYgKCFidmFyX2FjdGl2ZV9wKQorICAgICAgICB7CisgICAgICAgICAgLyogRGVjcmVh c2UgdGhlIHNpemUgb2YgdGhlIGFycmF5IHRvIGEgYmFyZSBtaW5pbXVtLiAqLworICAgICAgICAg IGZvciAoaW50IHZudGggPSAwOyB2bnRoIDwgdy0+bWNfbWF0cml4LnZwb3NfdXNlZDsgKyt2bnRo KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAody0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVfYWxsb2NhdGVkW2NhY2hlX3R5cGVdID4gMSkKKyAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XSA9CisgICAgICAgICAgICAgICAgICAgIHhucmVhbGxvYyAody0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV0sIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg c2l6ZW9mICp3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXSk7CisgICAg ICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2Fj aGVfdHlwZV0gPSAxOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgdy0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXSA9IDA7CisgICAgICAgICAgICB9 CisgICAgICAgICAgdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90eXBlXSA9IDA7Cisg ICAgICAgIH0KKyAgICAgICAgLy8gIEFsdGhvdWdoIGl0IHdvdWxkIG5vdCBiZSB2ZXJ5IGVmZmlj aWVudCwgaXQgaXMgcG9zc2libGUgdG8gc2V0CisgICAgICAgIC8vICB0aGUgX3VzZWRfIGVsZW1l bnRzIG9mIHRoZSBhcnJheSB0byB6ZXJvLiAgSW4gc3VjaCBhIGNhc2UsIHRoZQorICAgICAgICAv LyAgLi4uX2VsdHMuYWxsb2NhdGVkW2N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orICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGgucmlnaHRfYm94X2xpbmVfcCA9PSBn bHlwaC0+cmlnaHRfYm94X2xpbmVfcAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGgudm9mZnNldCA9PSBnbHlwaC0+dm9m ZnNldAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF0uZ2x5cGgucGl4ZWxfd2lkdGggPT0gZ2x5cGgtPnBpeGVsX3dpZHRoCisgICAg ICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XS5nbHlwaC5zbGljZS5pbWcueCA9PSBnbHlwaC0+c2xpY2UuaW1nLngKKyAgICAgICAgICAgICAm JiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLnNs aWNlLmltZy55ID09IGdseXBoLT5zbGljZS5pbWcueQorICAgICAgICAgICAgICYmIHctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGguc2xpY2UuaW1nLndp ZHRoID09IGdseXBoLT5zbGljZS5pbWcud2lkdGgKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLnNsaWNlLmltZy5oZWln aHQgPT0gZ2x5cGgtPnNsaWNlLmltZy5oZWlnaHQKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLnNsaWNlLmNtcC5mcm9t ID09IGdseXBoLT5zbGljZS5jbXAuZnJvbQorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ueCA9PSB4CisgICAgICAgICAgICAgJiYg dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5meCA9PSBmeAor ICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF0ueSA9PSB5CisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXS5meSA9PSBmeQorICAgICAgICAgICAgICYmIHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uaHBvcyA9PSBocG9zCisgICAgICAg ICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS52 cG9zID09IHZwb3MKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhdLndkID09IHdkCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5oID09IGgKKyAgICAgICAgICAgICAm JiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmN1cnNvcl90 eXBlID09IGN1cnNvcl90eXBlCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5jdXJzb3Jfd2lkdGggPT0gY3Vyc29yX3dpZHRoCisg ICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY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250aF0uZW5hYmxlZF9wID09IHRydWUpOworICAgICAgICB9Cisg ICAgICAvKiBJbiBhIHNpdHVhdGlvbiB3aGVyZSB0aGVyZSBhcmUgbm8gY2hhbmdlcyAoZS5nLiwg Qy1nKSwgd2Ugc3RpbGwgbmVlZCB0bworICAgICAgcmVzZXQgdGhlIGxlZnQvcmlnaHQgZnJpbmdl IGJpdG1hcCBpbmRpY2F0b3JzLiAqLworICAgICAgaWYgKCFzYW1lX3AKKyAgICAgICAgICB8fCBj dXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICB8fCBjdXJzb3Jf dHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQKQorICAgICAgICBtY19kcmF3X2VyYXNlX2h5 YnJpZCAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsIGN1 cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoLCBm b3JlZ3JvdW5kLCBhY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCByZW1vdmVfcCk7CisgICAgICByZXR1 cm47CisgICAgfQorICAgIGVsc2UgaWYgKGRyYXdfcAorICAgICAgICAgICAgICYmIChmcm9tX3do ZXJlID09IFNDUklCRV9PTkUKKyAgICAgICAgICAgICAgICAgfHwgZnJvbV93aGVyZSA9PSBTQ1JJ QkVfVFdPCisgICAgICAgICAgICAgICAgIHx8IGZyb21fd2hlcmUgPT0gU0NSSUJFX1RIUkVFCisg ICAgICAgICAgICAgICAgIHx8IGZyb21fd2hlcmUgPT0gTk9XSEVSRSkpCisgICAgICB7CisgICAg ICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBo cG9zLCB2cG9zLCB3ZCwgaCwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIHJl bW92ZV9wKTsKKyAgICAgICAgcmV0dXJuOworICAgICAgfQorICBpZiAoY2FjaGVfdHlwZSA9PSBO T19DQUNIRSkKKyAgICByZXR1cm47CisgICsrdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtjYWNo ZV90eXBlXTsKKyAgaWYgKHZudGggPj0gdy0+bWNfbWF0cml4LnZwb3NfdXNlZCkKKyAgICB3LT5t Y19tYXRyaXgudnBvc191c2VkID0gdm50aCArIDE7CisgIGlmICh3LT5tY19tYXRyaXgudnBvc19h bGxvY2F0ZWQgPCB3LT5tY19tYXRyaXgudnBvc191c2VkKQorICAgIHsKKyAgICAgIGludCBvbGRf YWxsb2MgPSB3LT5tY19tYXRyaXgudnBvc19hbGxvY2F0ZWQ7CisgICAgICBpbnQgbmV3X2VsdHMg PSB3LT5tY19tYXRyaXgudnBvc191c2VkIC0gdy0+bWNfbWF0cml4LnZwb3NfYWxsb2NhdGVkOwor ICAgICAgdy0+bWNfbWF0cml4LnZwb3MgPSB4cGFsbG9jICh3LT5tY19tYXRyaXgudnBvcywgJnct Pm1jX21hdHJpeC52cG9zX2FsbG9jYXRlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgbmV3X2VsdHMsIElOVF9NQVgsIHNpemVvZiAqdy0+bWNfbWF0cml4LnZwb3MpOworICAg ICAgbWVtc2V0ICh3LT5tY19tYXRyaXgudnBvcyArIG9sZF9hbGxvYywgMCwKKyAgICAgICAgICAg ICAgICh3LT5tY19tYXRyaXgudnBvc19hbGxvY2F0ZWQgLSBvbGRfYWxsb2MpICogc2l6ZW9mICp3 LT5tY19tYXRyaXgudnBvcyk7CisgICAgfQorICArK3ctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlX3VzZWRbY2FjaGVfdHlwZV07CisgIGlmICh3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV0gPCB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91 c2VkW2NhY2hlX3R5cGVdKQorICAgIHsKKyAgICAgIGludCBvbGRfYWxsb2MgPSB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV07CisgICAgICBpbnQgbmV3 X2VsdHMgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdIC0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVkW2NhY2hlX3R5cGVdOworICAg ICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV0gPSB4cGFsbG9jICh3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXSwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlX2FsbG9jYXRlZFtjYWNoZV90eXBlXSwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2VsdHMsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IElOVF9NQVgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHNpemVvZiAqdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV0pOworICAgICAgbWVtc2V0ICh3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXSArIG9sZF9hbGxvYywgMCwKKyAgICAgICAgICAgICAgICh3LT5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uZGl0 aW9ucyBmb3IgdXNlci1zcGVjaWZpZWQgdGhpY2tuZXNzIG9mIE1DX0JBUiBhbmQKKyAgICAgICAg ICAgICAgIE1DX0hCQVIgYXMgdG8gYG1jLXJlYWwtZmFrZS1jdXJzb3InLgorICAgTVVMVElQTEVf Q1VSU09SUzogIFdlIGRvIG5vdCB1c2UgdGhpcyBmdW5jdGlvbi4KKyAgIEhPUklaT05UQUxfUlVM RVI6ICBXZSB3YW50IGEgdW5pdmVyc2FsIEZZIGNvb3JkaW5hdGUgZm9yIGEgbGV2ZWwgcnVsZXIu CisgICBWRVJUSUNBTF9SVUxFUiBhbmQgRklMTF9DT0xVTU46ICBXZSB3YW50IGFuIEggdGhhdCBl bnN1cmVzIG5vIGdhcCBiZXR3ZWVuIHRoZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgcHJldmlvdXMvbmV4dCBsaW5lLiAgVGhlIEZYIGNvb3JkaW5hdGUgaXMgc2V0CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNld2hlcmU6ICBgdy0+Y3Vyc29yLnhg IC8gYG1jLmZjX3hgLiAqLwordm9pZAorbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeSAoc3RydWN0IHdp bmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LAorICAgICAgICAgICAgICAgICAg ICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93LCBpbnQgeCwgaW50ICpmeCwgaW50IHksCisgICAg ICAgICAgICAgICAgICAgICAgICBpbnQgKmZ5LCBpbnQgaHBvcywgaW50IHZwb3MsIGludCAqaCwK KyAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUs IGludCBjdXJzb3Jfd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgKndkKQorewor ICBzdHJ1Y3QgZ2x5cGggKmdseXBoID0gbWNfZ2V0X2N1cnNvc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pOworICBzd2l0Y2ggKGN1cnNvcl90eXBlKQorICAgIHsKKyAgICAgIGNhc2UgTUNf QkFSOgorICAgICAgICB7CisgICAgICAgICAgaWYgKGN1cnNvcl93aWR0aCA8IDEpCisgICAgICAg ICAgICBjdXJzb3Jfd2lkdGggPSBtYXggKEZSQU1FX0NVUlNPUl9XSURUSCAoZiksIDEpOworICAg ICAgICAgIGlmIChjdXJzb3Jfd2lkdGggPCBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAg KndkID0gY3Vyc29yX3dpZHRoOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBj YXNlIE1DX0hCQVI6CisgICAgICAgIHsKKyAgICAgICAgICBpbnQgY3Vyc29yX2hlaWdodCA9IChj dXJzb3Jfd2lkdGggPCAxKSA/IGxyaW50ICgwLjI1ICogKmgpIDogY3Vyc29yX3dpZHRoOworICAg ICAgICAgIGlmIChjdXJzb3JfaGVpZ2h0ID4gcm93LT5oZWlnaHQpCisgICAgICAgICAgICBjdXJz b3JfaGVpZ2h0ID0gcm93LT5oZWlnaHQ7CisgICAgICAgICAgLyogQ3Vyc29yIHNtYWxsZXIgdGhh biBsaW5lIGhlaWdodCwgc28gbW92ZSBkb3duLiAqLworICAgICAgICAgIGlmICgqaCA+IGN1cnNv cl9oZWlnaHQpCisgICAgICAgICAgICAqZnkgKz0gKmggLSBjdXJzb3JfaGVpZ2h0OworICAgICAg ICAgICpoID0gY3Vyc29yX2hlaWdodDsKKyAgICAgICAgICAqd2QgPSBnbHlwaC0+cGl4ZWxfd2lk dGg7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGNhc2UgTUNfUklHSFRfRlJJ TkdFX0JJVE1BUDoKKyAgICAgIGNhc2UgTUNfTEVGVF9GUklOR0VfQklUTUFQOgorICAgICAgY2Fz ZSBNQ19OT19GUklOR0VfQklUTUFQOgorICAgICAgY2FzZSBNQ19OT19DVVJTT1I6CisgICAgICBj YXNlIE1DX0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HksCisgICAgICAgICAg IGludCBocG9zLCBpbnQgdnBvcywgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSwgaW50 IGN1cnNvcl93aWR0aCwKKyAgICAgICAgICAgc3RydWN0IGdseXBoX21hdHJpeCAqY3Vyc29yX21h dHJpeCwgc3RydWN0IG1jX2Vzc2VudGlhbHMgZXNzZW50aWFscywKKyAgICAgICAgICAgZW51bSBt Y19yb3dfcG9zaXRpb24gcm93X3Bvc2l0aW9uLCBzdHJ1Y3QgbWNfUkdCIGZvcmVncm91bmQsCisg ICAgICAgICAgIGVudW0gbWNfZW5naW5lX3R5cGUgYWN0aW9uX3R5cGUsIGJvb2wgZHJhd19wLAor ICAgICAgICAgICBlbnVtIG1jX2RyYXdfcm93X3R5cGUgZnJvbV93aGVyZSwgZW51bSBtY19jYWNo ZV90eXBlIGNhY2hlX3R5cGUpCit7CisgIGludCBvcG9pbnRfeCA9IHctPmN1cnNvci54OworICBp bnQgb3BvaW50X3kgPSB3LT5jdXJzb3IueTsKKyAgaW50IG9wb2ludF9ocG9zID0gdy0+Y3Vyc29y Lmhwb3M7CisgIGludCBvcG9pbnRfdnBvcyA9IHctPmN1cnNvci52cG9zOworICBpbnQgZngsIGZ5 LCBoLCB3ZDsKKyAgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeSAodywgbWF0cml4LCByb3csIHJlbGF0 aXZlX3gsICZmeCwgeSwgJmZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAmaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgJndkKTsKKyAgaW50IG9wb2ludF9meCA9 IFdJTkRPV19URVhUX1RPX0ZSQU1FX1BJWEVMX1ggKHcsIG9wb2ludF94KTsKKyAgaW50IGZjX2Z4 ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgZXNzZW50aWFscy5mY194KTsKKyAg Ym9vbCBnbHlwaF96dl9wID0gKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ct PnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAmJiBNQVRSSVhfUk9XX0VORF9D SEFSUE9TIChyb3cpID09IFpWKTsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFt ZSk7CisgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSICh3LT5jb250ZW50cyk7CisgIGludCB0 ZXh0X2FyZWFfd2lkdGggPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOworICBzdHJ1 Y3QgZ2x5cGhfcm93ICpjdXJzb3Jfcm93ID0gKHctPmN1cnNvci52cG9zICE9IC0xKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XIChjdXJzb3JfbWF0cml4LCB3 LT5jdXJzb3IudnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTlVMTDsK KyAgc3RydWN0IGdseXBoICpjdXJzb3JfZ2x5cGggPSAody0+Y3Vyc29yLnZwb3MgIT0gLTEpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY19nZXRfY3Vyc29yX2dseXBoICh3LCBj dXJzb3JfbWF0cml4LCBjdXJzb3Jfcm93LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTlVMTDsKKyAgYm9vbCBjdXJzb3JfYXRf ZnJpbmdlX3AgPSAoY3Vyc29yX2dseXBoID09IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgY3Vyc29yX3JvdyAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIHctPmN1cnNvci5ocG9zID09IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93LT5leGFjdF93aW5kb3dfd2lkdGhf bGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID09IHRl eHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3Iu eCA9PSBjdXJzb3Jfcm93LT5waXhlbF93aWR0aCk7CisgIGJvb2wgY3Vyc29yX2JleW9uZF9mcmlu Z2VfcCA9IChjdXJzb3JfZ2x5cGggPT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgY3Vyc29yX3JvdyAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFjdXJzb3Jfcm93LT5leGFjdF93aW5k b3dfd2lkdGhfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5j dXJzb3IueCA+PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHctPmN1cnNvci54ID49IGN1cnNvcl9yb3ctPnBpeGVsX3dpZHRoKTsKKyAgaW50IGZy YW1lX2NoYXJfd2lkdGggPSBGUkFNRV9DT0xVTU5fV0lEVEggKGYpOworICBpbnQgdGVtcF9mYWNl X2lkID0gZ2x5cGgtPmZhY2VfaWQ7CisgIHN0cnVjdCBtY19SR0IgYmFja2dyb3VuZDsKKyAgbWNf c2V0X2xzbF9iZyAodywgdGVtcF9mYWNlX2lkLCAmYmFja2dyb3VuZCk7CisgIGJvb2wgcmVhbF9m YWtlX2N1cnNvcl9wID0gKG9wb2ludF94ID09IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgb3BvaW50X2hwb3MgPT0gaHBvcworICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBvcG9pbnRfeSA9PSByb3ctPnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgb3BvaW50X3Zwb3MgPT0gdnBvcyk7CisKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLwor LyogICAgICAgICAgICAgICAgICAgICAgIEJFR0lOOiAgQ0hBUl9HTFlQSCB8IEdMWVBITEVTU19H TFlQSCAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgaWYg KGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgIHx8IGdseXBoLT50eXBlID09IEdMWVBI TEVTU19HTFlQSCkKKyAgeworICAgIGlmIChtY19zdGRlcnJfcCkKKyAgICAgIGZwcmludGYgKHN0 ZGVyciwKKyAgICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHgl MDZ4ICU0ZCAlMS4xZCUxLjFkICAlM2QgJXMgJXNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5n bHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDog cm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgIChnbHlw aC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAgICA/ICdDJworICAgICAgICAgOiAnRycpLAor ICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3Qp CisgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAg ICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAg ICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICAgICAg ICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIGdseXBoLT51LmNoLAorICAgICAgICBnbHlw aC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5 cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8g IlpWIiA6ICItLSIsCisgICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nIChnbHlwaC0+dS5jaCkpOwor ICBzd2l0Y2ggKGFjdGlvbl90eXBlKQorICB7CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8q ICAgICAgICAgICAgICAgTVVMVElQTEVfQ1VSU09SUzogIENIQVJfR0xZUEggfCBHTFlQSExFU1Nf R0xZUEggICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2Fz ZSBNVUxUSVBMRV9DVVJTT1JTOgorICAgIHsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCBy b3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAg ICAgICAgIHdkLCBoLCB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wZSwgYWN0aW9uX3R5 cGUpOworICAgICAgaWYgKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVz ZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYgcmVsYXRpdmVfeCA8PSB4X2xpbWl0KQorICAgICAg ICB7CisgICAgICAgICAgaWYgKHJlbGF0aXZlX3ggPCByb3ctPnBpeGVsX3dpZHRoKQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0aDsK KyAgICAgICAgICAgICAgZnggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgfQor ICAgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBm eCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICB4X2xpbWl0IC0gcmVs YXRpdmVfeCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcm93X3Bvc2l0aW9uLAorICAg ICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwgZXNzZW50aWFscy5hY3Rp dmVfcCwgTUNfR0xZUEhMRVNTLAorICAgICAgICAgICAgICAgICAgICAgZHJhd19wLCBmcm9tX3do ZXJlLCBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICAgIH0KKyAgICAgIGJyZWFrOwor ICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICBWRVJUSUNB TF9SVUxFUjogIENIQVJfR0xZUEggfCBHTFlQSExFU1NfR0xZUEggICAgICAgICAgICAgICAgICov CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIFZFUlRJQ0FMX1JVTEVSOgorICAg IHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChjdXJzb3JfYXRfZnJpbmdl X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPmNvbnRpbnVl ZF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FM X0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1 cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgIXJvdy0+Y29udGludWVkX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9B UlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9u ZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93 LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3ctPnVzZWRbVEVY VF9BUkVBXSAhPSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAh cm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ct PnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvcG9pbnRfeCA+PSByb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOiAoZ2x5cGhfenZfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogTUNfR0xZUEg7CisgICAgICBpZiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9S SUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJU SUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVS VElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgIHx8IGdseXBoX2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FdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlh bHMuZmNfeCA+PSByb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAoZ2x5cGhfenZfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog KCFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX3Zl cnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IG9wb2ludF95ID09IHkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IG9wb2ludF92cG9zID09IHZwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IE1DX0dMWVBIOworICAgICAgd2QgPSAxOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJv dywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZjX2Z4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAg ICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwg Zm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgYmFja2dyb3VuZCwgZXNzZW50aWFscy5hY3Rp dmVfcCwgZ2x5cGhfZmxhdm9yLCBkcmF3X3AsIGZyb21fd2hlcmUsC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5cGUgPT0gU1RSRVRDSF9HTFlQSCkKKyAgeworICAgIGlmIChtY19zdGRlcnJfcCkKKyAgICAg IGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQi ZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICAlM2QgJXMgJXNcbiIsCisgICAgICAgIGds eXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0g PT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisg ICAgICAgICdTJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChn bHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNUUklOR1AgKGdseXBo LT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgOiAoTklMUCAoZ2x5cGgt Pm9iamVjdCkKKyAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAgICA6ICctJykpKSwK KyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAwdSwKKyAgICAgICAgZ2x5cGgt PmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBo LT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+aHBvcywgZ2x5cGhfenZfcCA/ICJa ViIgOiAiLS0iLAorICAgICAgICAiXFxTIik7CisgIHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsK Ky8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICBNVUx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1cnNvcl9wKQorICAgICAgICBtY19oZWxwZXIgKHcsIG1h dHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAg ICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9z aXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZCwgZXNzZW50 aWFscy5hY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAg ICAgICAgICBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICBpZiAoZ2x5cGggLSByb3ct PmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiBy ZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAocmVsYXRpdmVf eCA8IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHJlbGF0 aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICBmeCArPSBnbHlwaC0+ cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgICAgdGVtcF9mYWNlX2lkID0gKHJv dy0+ZmlsbF9saW5lX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgPyBnbHlwaC0+ZmFjZV9p ZAorICAgICAgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAg IHN0cnVjdCBtY19SR0IgYmFja2dyb3VuZDsKKyAgICAgICAgICBtY19zZXRfbHNsX2JnICh3LCB0 ZW1wX2ZhY2VfaWQsICZiYWNrZ3JvdW5kKTsKKyAgICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJp eCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAg ICAgICAgICAgICAgICAgeF9saW1pdCAtIHJlbGF0aXZlX3gsIGgsIGN1cnNvcl90eXBlLCB4X2xp bWl0IC0gcmVsYXRpdmVfeCwKKyAgICAgICAgICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgZm9y ZWdyb3VuZCwgYmFja2dyb3VuZCwgZXNzZW50aWFscy5hY3RpdmVfcCwKKyAgICAgICAgICAgICAg ICAgICAgIE1DX0dMWVBITEVTUywgZHJhd19wLCBmcm9tX3doZXJlLCBjYWNoZV90eXBlLCBhY3Rp b25fdHlwZSk7CisgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgIFZFUlRJQ0FMX1JVTEVSOiAg U1RSRVRDSF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KKyAgICBjYXNlIFZFUlRJQ0FMX1JVTEVSOgorICAgIHsKKyAgICAgIGlmIChyb3ctPmZp bGxfbGluZV9wCisgICAgICAgICAgJiYgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09 IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiBvcG9pbnRfeCA+IHJlbGF0aXZlX3gg KyBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAgICAgIHRlbXBfZmFjZV9pZCA9IGdseXBoLT5mYWNl X2lkOworICAgICAgICBlbHNlIGlmICghcm93LT5maWxsX2xpbmVfcAorICAgICAgICAgICAgICAg ICAmJiBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0g MQorICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeCA+IHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4 ZWxfd2lkdGgpCisgICAgICAgICAgdGVtcF9mYWNlX2lkID0gREVGQVVMVF9GQUNFX0lEOworICAg ICAgc3RydWN0IG1jX1JHQiBiYWNrZ3JvdW5kOworICAgICAgbWNfc2V0X2xzbF9iZyAodywgdGVt cF9mYWNlX2lkLCAmYmFja2dyb3VuZCk7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2 b3IgPSAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPmNvbnRpbnVlZF9wCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVIK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2Vf cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0 ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBN Q19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJ R0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3Jf YmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0gIT0gMQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFS CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBITEVTUzsKKyAg ICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAg ICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9B UlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NM QVNICisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAg ICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAg IGN1cnNvcl90eXBlID0gTUNfUklHSFRfRlJJTk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W2FyZWFd ID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94LAor ICAgICAgICAnSScsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAo Z2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJTkdQIChnbHlw aC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICAgIDogKE5JTFAgKGdseXBo LT5vYmplY3QpCisgICAgICAgICAgICAgICA/ICcwJworICAgICAgICAgICAgICAgOiAnLScpKSks CisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgKHVuc2lnbmVkIGludCkgZ2x5 cGgtPnUuaW1nX2lkLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxl ZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAg IGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7Cisg IHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyog ICAgICAgICAgICAgICAgICAgICAgICAgTVVMVElQTEVfQ1VSU09SUzogIElNQUdFX0dMWVBIICAg ICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNl IE1VTFRJUExFX0NVUlNPUlM6CisgICAgeworICAgICAgY3Vyc29yX3R5cGUgPSBNQ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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVORDogIElNQUdFX0dMWVBI ICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8K KworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAg ICBCRUdJTjogIENPTVBPU0lURV9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8q IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBDT01QT1NJ VEVfR0xZUEgpCisgIHsKKyAgICBpZiAobWNfc3RkZXJyX3ApCisgICAgICB7CisgICAgICAgIGZw cmludGYgKHN0ZGVyciwKKyAgICAgICAgICAiXG4gJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJk ICVjICUzZCAweCUwNngiLAorICAgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVB XSwKKyAgICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJl YV0gLSAxKSwKKyAgICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAgICcrJywKKyAgICAgICAg ICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAg ICAgICAgICAgPyAnQicKKyAgICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAg ICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkK KyAgICAgICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICAgICAgICAgOiAnLScpKSksCisgICAg ICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAgICh1bnNpZ25lZCBpbnQpIGdseXBo LT51LmNtcC5pZCk7CisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAlNGQgJTEuMWQlMS4xZCIs CisgICAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xp bmVfcCwKKyAgICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCk7CisgICAgICBpZiAoZ2x5 cGgtPnUuY21wLmF1dG9tYXRpYykKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICAlM2QgJXMg LiBbJWQtJWRdXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoLT5ocG9zLCBnbHlw aF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGgtPnNs aWNlLmNtcC5mcm9tLCBnbHlwaC0+c2xpY2UuY21wLnRvKTsKKyAgICAgICAgZWxzZQorICAgICAg ICAgIGZwcmludGYgKHN0ZGVyciwgIlxuIik7CisgICAgICB9CisgIHN3aXRjaCAoYWN0aW9uX3R5 cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAg ICAgIE1VTFRJUExFX0NVUlNPUlM6ICBDT01QT1NJVEVfR0xZUEggICAgICAgICAgICAgICAgICA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GF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAg ICAgICAgICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcm93X3Bv c2l0aW9uLCBmb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQsIGVzc2Vu dGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUsCisgICAgICAgICAg ICAgICAgICAgY2FjaGVfdHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAgaWYgKGdseXBoIC0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYg cmVsYXRpdmVfeCA8PSB4X2xpbWl0KQorICAgICAgICB7CisgICAgICAgICAgcmVsYXRpdmVfeCAr PSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgd2hpbGUgKHJlbGF0aXZlX3ggPD0geF9s aW1pdCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgs IHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAg ICAgICAgICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcm93X3Bv c2l0aW9uLCBmb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQs IGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBITEVTUywgZHJhd19wLAorICAgICAgICAgICAg ICAgICAgICAgICAgIGZyb21fd2hlcmUsIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAg ICAgICAgICAgcmVsYXRpdmVfeCArPSBmcmFtZV9jaGFyX3dpZHRoOworICAgICAgICAgICAgfQor ICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8K Ky8qICAgICAgICAgICAgICAgICAgICAgICAgIFZFUlRJQ0FMX1JVTEVSOiAgQ09NUE9TSVRFX0dM WVBIICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAg Y2FzZSBWRVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9m bGF2b3IgPSAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPmNvbnRpbnVlZF9wCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRf cCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9C QVIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmlu Z2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVu Y2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFS X1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJz b3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0gIT0gMQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxf QkFSCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaCAtIHJvdy0+ Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3ggPj0gcm93LT5waXhlbF93aWR0aCkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX3p2X3ApCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgaWYgKGdseXBoX2Zs YXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9m bGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAg fHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICB8 fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgfHwgZ2x5cGhfZmxh dm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgY3Vyc29yX3R5cGUgPSBN Q19SSUdIVF9GUklOR0VfQklUTUFQOworICAgICAgd2QgPSAxOworICAgICAgbWNfaGVscGVyICh3 LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIG9wb2ludF9meCwgeSwgZnksIGhwb3Ms IHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRo LCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIGJhY2tncm91bmQs IGVzc2VudGlhbHMuYWN0aXZlX3AsIGdseXBoX2ZsYXZvciwgZHJhd19wLCBmcm9tX3doZXJlLAor ICAgICAgICAgICAgICAgICBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICBicmVhazsK KyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAg ICAgICBGSUxMX0NPTFVNTjogIENPTVBPU0lURV9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAq LworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBGSUxMX0NPTFVNTjoKKyAgICB7 CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoZ2x5cGggLSByb3ctPmdseXBo c1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPiByZWxhdGl2ZV94KQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfenZfcCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF95ID09IHkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF92cG9zID09IHZwb3MpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgd2QgPSAxOworICAgICAgbWNf aGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbG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S0tLS0t LS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJFR0lOOiAgWFdJREdFVF9H TFlQSCAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0g Ki8KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gWFdJREdFVF9HTFlQSCkKKyAgeworI2lmbmRl ZiBIQVZFX1hXSURHRVRTCisgICAgZWFzc3VtZSAoZmFsc2UpOworI2Vsc2UKKyAgICBpZiAobWNf c3RkZXJyX3ApCisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICJcbiAgJTVkLyUtNWQg JTVkICU0YyAlNmQgJWMgJTNkIDB4JTA1eCAlNGQgJTEuMWQlMS4xZCAgJTNkICVzICVjXG4iLAor ICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51 c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxh dGl2ZV94LAorICAgICAgICAnWCcsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAo QlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJ TkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICAgIDogJy0n KSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQs CisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdodF9i b3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+dS54d2lkZ2V0LAorICAgICAgICBnbHlwaC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aWR0aCwgcm93X3Bvc2l0aW9uLCBmb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgICAg ICAgIGJhY2tncm91bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBITEVTUywgZHJhd19w LAorICAgICAgICAgICAgICAgICAgICAgICAgIGZyb21fd2hlcmUsIGNhY2hlX3R5cGUsIGFjdGlv bl90eXBlKTsKKyAgICAgICAgICAgICAgcmVsYXRpdmVfeCArPSBmcmFtZV9jaGFyX3dpZHRoOwor ICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxF UjogIFhXSURHRVRfR0xZUEggICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tICovCisgICAgY2FzZSBWRVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAgICBlbnVtIG1j X2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPmNvbnRpbnVl ZF9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVu Y2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog KGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3Jp Z2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJT RURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IChjdXJzb3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0gIT0gMQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29u X3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVW RVJTRURfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3ggPj0gcm93 LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBN Q19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBo X3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhM RVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAg ICAgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAg ICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FS Uk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xB U0gKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSCisgICAgICAg ICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAg Y3Vyc29yX3R5cGUgPSBNQ19SSUdIVF9GUklOR0VfQklUTUFQOworICAgICAgbWNfaGVscGVyICh3 LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIG9wb2ludF9meCwgeSwgZnksIGhwb3Ms IHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRo LCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIGJhY2tncm91bmQs IGVzc2VudGlhbHMuYWN0aXZlX3AsIGdseXBoX2ZsYXZvciwgZHJhd19wLCBmcm9tX3doZXJlLAor ICAgICAgICAgICAgICAgICBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICBicmVhazsK KyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAg ICAgICAgRklMTF9DT0xVTU46ICBYV0lER0VUX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICAq LworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBGSUxMX0NPTFVNTjoKKyAgICB7 CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoZ2x5cGggLSByb3ctPmdseXBo c1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPiByZWxhdGl2ZV94KQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfenZfcCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF95ID09IHkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF92cG9zID09IHZwb3MpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgbWNfaGVscGVyICh3LCBtYXRy aXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZjX2Z4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAg ICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3Np dGlvbiwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgYmFja2dyb3VuZCwgZXNzZW50aWFs cy5hY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCBkcmF3X3AsIGZyb21fd2hlcmUsCisgICAgICAgICAg ICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8q IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgQ1VSU09SX0lORElDQVRPUjoKKyAgICB7 CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgfQorICB9 CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgI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gZ2x5cGhfcm93ICpib3R0b21fcm93ID0gTUFUUklY X0JPVFRPTV9URVhUX1JPVyAobWF0cml4LCB3KTsKKyAgaW50IGJvdHRvbV92cG9zID0gTUFUUklY X1JPV19WUE9TIChib3R0b21fcm93LCBtYXRyaXgpOworICBpZiAodnBvcyA9PSBib3R0b21fdnBv cykKKyAgICByZXR1cm47CisgIGlmICghcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgcmV0dXJu OworICBpbnQgaHBvc19zdGFydCA9IHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAg aWYgKG1jX3N0ZGVycl9wKQorICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX2RyYXdfcm93ICglZCk6 ICBkcmF3X3AgKCVzKSB8IGhwb3MgKCVkKSB8IGxlbiAoJWQpXG4iLAorICAgICAgICAgICAgICAg ICAgICAgdnBvcywgZHJhd19wID8gInkiIDogIm4iLCBocG9zX3N0YXJ0LCBocG9zX2xlbmd0aCk7 CisgIGludCBvcG9pbnRfZngsIG9wb2ludF9meSwgb3BvaW50X3dkLCBvcG9pbnRfaDsKKyAgaW50 IHRleHRfYXJlYV93aWR0aCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgIGlu dCBoZWFkZXJfbGluZV9mb3JtYXQgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAg c3RydWN0IGdseXBoX3JvdyAqY3Vyc29yX3JvdyA9ICh3LT5jdXJzb3IudnBvcyAhPSAtMSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPVyAoY3Vyc29yX21hdHJp eCwgdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5V TEw7CisgIHN0cnVjdCBnbHlwaCAqY3Vyc29yX2dseXBoID0gKHctPmN1cnNvci52cG9zICE9IC0x KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfZ2V0X2N1cnNvcl9nbHlwaCAo dywgY3Vyc29yX21hdHJpeCwgY3Vyc29yX3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBv cykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgIGJvb2wgY3Vyc29y X2F0X2ZyaW5nZV9wID0gKGN1cnNvcl9nbHlwaCA9PSBOVUxMCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIGN1cnNvcl9yb3cgIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+ZXhhY3Rfd2luZG93X3dp ZHRoX2xpbmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA9 PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vy c29yLnggPT0gY3Vyc29yX3Jvdy0+cGl4ZWxfd2lkdGgpOworICBib29sIGN1cnNvcl9iZXlvbmRf ZnJpbmdlX3AgPSAoY3Vyc29yX2dseXBoID09IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIGN1cnNvcl9yb3cgIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFd CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhY3Vyc29yX3Jvdy0+ZXhhY3Rf d2luZG93X3dpZHRoX2xpbmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg dy0+Y3Vyc29yLnggPj0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiB3LT5jdXJzb3IueCA+PSBjdXJzb3Jfcm93LT5waXhlbF93aWR0aCk7CisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgUkVQTEFDRSBU SEUgUkVBTCBDVVJTT1IKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICBlbnVtIGZhY2VfaWQg YmdfZmFjZV9pZCA9IChjdXJzb3JfZ2x5cGggIT0gTlVMTCkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IGN1cnNvcl9nbHlwaC0+ZmFjZV9pZAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogREVGQVVMVF9GQUNFX0lEOworICBzdHJ1Y3QgbWNfUkdCIGN1cnNvcl9iZzsKKyAgbWNf c2V0X2xzbF9iZyAodywgYmdfZmFjZV9pZCwgJmN1cnNvcl9iZyk7CisgIC8qIEZJWE1FOiAgUHV0 IGluIHNvbWUgY29kZSB0byBkZWZhdWx0IHRvIE1DX0hPTExPV19CT1ggaWYgdGhlIHVzZXIgaGFz CisgIHVud2l0dGluZ2x5IGNvbWUgdXAgd2l0aCBzb21lIHVuYWNjZXB0YWJsZSBmb3JtIG9mIHVu cmVjb2duaXplZCBjdXJzb3IgdHlwZS4gKi8KKyAgTGlzcF9PYmplY3QgbGlzcF90eXBlID0gQlZB UiAoYiwgbWNfcmVhbF9mYWtlX2N1cnNvcik7CisgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29y X3R5cGUgPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKFhDQVIgKGxpc3BfdHlwZSkpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUg KGxpc3BfdHlwZSk7CisgIGludCBjdXJzb3Jfd2lkdGggPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisg ICAgICAgICAgICAgICAgICAgICA/IFhGSVhOVU0gKFhDQVIgKFhDRFIgKGxpc3BfdHlwZSkpKQor ICAgICAgICAgICAgICAgICAgICAgOiAtMTsKKyAgc3RydWN0IG1jX1JHQiBjdXJzb3JfZmc7Cisg IG1jX2NvbG9yX3BpY2tlciAodywgY3Vyc29yX2dseXBoLCBlc3NlbnRpYWxzLCAmY3Vyc29yX2Zn LCAtMSwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgcm93X3Bvc2l0aW9uLCBDVVJT T1JfSU5ESUNBVE9SKTsKKyAgYm9vbCBmaWxsX2NvbHVtbl90cnVtcHNfcCA9ICghTklMUCAoQlZB UiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmICFOSUxQIChCVkFSIChiLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiB3LT5jdXJzb3IueCA9PSBlc3NlbnRpYWxzLmZjX3gKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiAhY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgIWN1cnNvcl9iZXlvbmRfZnJpbmdlX3ApOworICAvKiBXZSB1c2Ug YSB0ZXN0IHNpbWlsYXIgdG8gdGhlIHJlYWwgZmFrZSBjdXJzb3Igc28gdGhhdCB0aGUgZnJpbmdl IGJpdG1hcCBpcworICBvbmx5IGRyYXduIG9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IGds eXBoLT5jaGFycG9zID4gMCkKKyAgICAgICAgKytnbHlwaF9lbmQ7CisgICAgICBtY19oZWxwZXIg KHcsIG1hdHJpeCwgcm93LCBnbHlwaF9lbmQgLSAxLCByb3ctPnBpeGVsX3dpZHRoLCAtMSwgdy0+ Y3Vyc29yLnksCisgICAgICAgICAgICAgICAgIC0xLCByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEs IHctPmN1cnNvci52cG9zLCAtMSwgLTEsCisgICAgICAgICAgICAgICAgIE1DX1JJR0hUX0ZSSU5H RV9CSVRNQVAsIC0xLCByb3dfcG9zaXRpb24sIGN1cnNvcl9mZywgY3Vyc29yX2JnLAorICAgICAg ICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgZnJv bV93aGVyZSwgQ0hfQ0FDSEUsCisgICAgICAgICAgICAgICAgIENVUlNPUl9JTkRJQ0FUT1IpOwor ICAgIH0KKyAgLyogRVhBTVBMRSAoYnVmZmVyLWxvY2FsKTogIChzZXRxIG1jLXJlYWwtZmFrZS1j dXJzb3IgbmlsLyduby8ibm8iKSAqLworICBlbHNlIGlmICghY3Vyc29yX2F0X2ZyaW5nZV9wCisg ICAgICAgICAgICYmIGN1cnNvcl9nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICYmIGN1cnNvcl90 eXBlID09IE1DX05PX0NVUlNPUgorICAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9z CisgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID49IGhwb3Nfc3RhcnQKKyAgICAgICAgICAg JiYgdy0+Y3Vyc29yLmhwb3MgPCBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGgpCisgICAgeworICAg ICAgLyogV2hlbiBhIHVzZXIgaGFzIG5vdCBzcGVjaWZpZWQgYSB2YWx1ZSBmb3IgYG1jLXJlYWwt ZmFrZS1jdXJzb3InLCBvciB0aGUKKyAgICAgIHZhbHVlIGlzIGBub2AgaW4gdGhlIGZvcm0gb2Yg YSBzeW1ib2wgb3Igc3RyaW5nLCB0aGVuIHRoZSBkZWZhdWx0IHdlIHVzZQorICAgICAgYW4gTUNf QkFSIGFuZCBhbiBNQ19IQkFSIC0tIGJvdGggaGF2aW5nIGEgY3Vyc29yX3dpZHRoIG9mIDEuICov CisgICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29y LngsICZvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJm9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQ19CQVIsIDEsICZvcG9pbnRfd2QpOwor ICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgY3Vyc29yX2dseXBoLCB3LT5jdXJzb3Iu eCwgb3BvaW50X2Z4LCB3LT5jdXJzb3IueSwKKyAgICAgICAgICAgICAgICAgb3BvaW50X2Z5LCB3 LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MsIG9wb2ludF93ZCwgb3BvaW50X2gsCisgICAg ICAgICAgICAgICAgIE1DX0JBUiwgMSwgcm93X3Bvc2l0aW9uLCBjdXJzb3JfZmcsIGN1cnNvcl9i ZywgZXNzZW50aWFscy5hY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgTUNfR0xZUEhMRVNTLCBk cmF3X3AsIGZyb21fd2hlcmUsIE5JTFAgKEJWQVIgKGIsIG1jX2NvbmYpKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBDSF9DQUNIRQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19DQUNIRSwg Q1VSU09SX0lORElDQVRPUik7CisgICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRy aXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNv ci52cG9zLCAmb3BvaW50X2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQ19IQkFS LCAxLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGN1cnNv cl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAg ICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCBvcG9pbnRf d2QsIG9wb2ludF9oLAorICAgICAgICAgICAgICAgICBNQ19IQkFSLCAxLCByb3dfcG9zaXRpb24s IGN1cnNvcl9mZywgY3Vyc29yX2JnLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLAorICAgICAgICAgICAg ICAgICBNQ19HTFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLCBOSUxQIChCVkFSIChiLCBtY19jb25m KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBDSF9D QUNIRQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1D X0NBQ0hFLCBDVVJTT1JfSU5ESUNBVE9SKTsKKyAgICB9CisgIGVsc2UgaWYgKCFjdXJzb3JfYXRf ZnJpbmdlX3AKKyAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAg JiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA+ PSBocG9zX3N0YXJ0CisgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zIDwgaHBvc19zdGFydCAr IGhwb3NfbGVuZ3RoCisgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+dHlwZSAhPSBTVFJFVENI X0dMWVBIKQorICAgIHsKKyAgICAgIG1jX2dldF9jdXJzb3JfZ2VvbWV0cnkgKHcsIG1hdHJpeCwg cm93LCB3LT5jdXJzb3IueCwgJm9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZw b3MsICZvcG9pbnRfaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBl LCBjdXJzb3Jfd2lkdGgsICZvcG9pbnRfd2QpOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgs IHJvdywgY3Vyc29yX2dseXBoLCB3LT5jdXJzb3IueCwgb3BvaW50X2Z4LCB3LT5jdXJzb3IueSwK KyAgICAgICAgICAgICAgICAgb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZw b3MsIG9wb2ludF93ZCwgb3BvaW50X2gsCisgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCBj dXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsCisgICAgICAg ICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hl cmUsCisgICAgICAgICAgICAgICAgIE5JTFAgKEJWQVIgKGIsIG1jX2NvbmYpKQorICAgICAgICAg ICAgICAgICA/IENIX0NBQ0hFCisgICAgICAgICAgICAgICAgIDogTUNfQ0FDSEUsIENVUlNPUl9J TkRJQ0FUT1IpOworICAgIH0KKyAgZWxzZSBpZiAoIWN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAg ICAgICAmJiBjdXJzb3JfZ2x5cGggIT0gTlVMTAorICAgICAgICAgICAmJiB2cG9zID09IHctPmN1 cnNvci52cG9zCisgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID49IGhwb3Nfc3RhcnQKKyAg ICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPCBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGgKKyAg ICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT50eXBlID09IFNUUkVUQ0hfR0xZUEgpCisgICAgewor ICAgICAgLyogSWYgYSB1c2VyIGhhcyBzZXQgYHgtc3RyZXRjaC1jdXJzb3InIHRvIGEgbm9uLW5p bCB2YWx1ZSwgaGUvc2hlIGNob3NlIHRvCisgICAgICBoYXZlIGEgY3Vyc29yIHRoYXQgc3BhbnMg dGhlIGVudGlyZSBsZW5ndGggb2YgdGhlIFNUUkVUQ0hfR0xZUEguICovCisgICAgICBpZiAoIXhf c3RyZXRjaF9jdXJzb3JfcCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRoZSBNQ19IQkFSIHNo YWxsIGhhdmUgYSBgY3Vyc29yX3dpZHRoYCBvZiAxLiAqLworICAgICAgICAgIG1jX2dldF9jdXJz b3JfZ2VvbWV0cnkgKHcsIG1hdHJpeCwgcm93LCB3LT5jdXJzb3IueCwgJm9wb2ludF9meCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5jdXJzb3IueSwgJm9wb2ludF9meSwg dy0+Y3Vyc29yLmhwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vy c29yLnZwb3MsICZvcG9pbnRfaCwgTUNfSEJBUiwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmb3BvaW50X3dkKTsKKyAgICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwg cm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1cnNvci54LCBvcG9pbnRfZngsCisgICAgICAgICAgICAg ICAgICAgICB3LT5jdXJzb3IueSwgb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29y LnZwb3MsCisgICAgICAgICAgICAgICAgICAgICBvcG9pbnRfd2QsIG9wb2ludF9oLCBNQ19IQkFS LCAxLCByb3dfcG9zaXRpb24sIGN1cnNvcl9mZywKKyAgICAgICAgICAgICAgICAgICAgIGN1cnNv cl9iZywgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwK KyAgICAgICAgICAgICAgICAgICAgIE5JTFAgKEJWQVIgKGIsIG1jX2NvbmYpKQorICAgICAgICAg ICAgICAgICAgICAgPyBDSF9DQUNIRQorICAgICAgICAgICAgICAgICAgICAgOiBNQ19DQUNIRSwg Q1VSU09SX0lORElDQVRPUik7CisgICAgICAgIH0KKyAgICAgIG1jX2dldF9jdXJzb3JfZ2VvbWV0 cnkgKHcsIG1hdHJpeCwgcm93LCB3LT5jdXJzb3IueCwgJm9wb2ludF9meCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci55LCAmb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBv cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci52cG9zLCAmb3BvaW50 X2gsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dp ZHRoLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGN1cnNv cl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAg ICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCBvcG9pbnRf d2QsIG9wb2ludF9oLAorICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRo LCByb3dfcG9zaXRpb24sIGN1cnNvcl9mZywgY3Vyc29yX2JnLAorICAgICAgICAgICAgICAgICBl c3NlbnRpYWxzLmFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAg ICAgICAgICAgICBOSUxQIChCVkFSIChiLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgPyBD SF9DQUNIRQorICAgICAgICAgICAgICAgICA6IE1DX0NBQ0hFLCBDVVJTT1JfSU5ESUNBVE9SKTsK KyAgICB9CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgRFJBVyBBTkQgUkVDT1JEIEZBS0UgQ1VSU09SUworKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisgIGlmICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgJiYgTklMUCAoQlZBUiAoYiwgbWNf aW5hY3RpdmVfd2luZG93cykpCisgICAgICAmJiBOSUxQIChCVkFSIChiLCBjaF9pbmFjdGl2ZV93 aW5kb3dzKSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKGIsIGZjX2luYWN0aXZlX3dpbmRvd3MpKSkK KyAgICByZXR1cm47CisgIGlmIChocG9zX2xlbmd0aCA9PSAxKQorICAgIHsKKyAgICAgIGlmICgh TklMUCAoQlZBUiAoYiwgbWNfY29uZikpCisgICAgICAgICAgJiYgKGVzc2VudGlhbHMuYWN0aXZl X3AKKyAgICAgICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAg ICAgICAmJiAhTklMUCAoQlZBUiAoYiwgbWNfaW5hY3RpdmVfd2luZG93cykpKSkpCisgICAgICAg IHsKKyAgICAgICAgICAvKiBUaGUgc3BhY2UgYXBwZW5kZWQgd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qbGFzdF9nbHlwaCA9IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVz ZWRbVEVYVF9BUkVBXSAtIDE7CisgICAgICAgICAgYm9vbCBza2lwX3AgPSAocHJldmlvdXNfZ2x5 cGggIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICYmIHByZXZpb3VzX2dseXBoLT5j aGFycG9zID09IE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgLSAxCisgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgc3RhcnQtPmJ5dGVwb3MgIT0gZXNzZW50aWFscy56dl9ieXRlKQorICAg ICAgICAgICAgICAgICAgICAgICAgICA/IHRydWUKKyAgICAgICAgICAgICAgICAgICAgICAgIC8q IFdoZW4gYSBgYnVmZmVyLWRpc3BsYXktdGFibGUnIGVudHJ5IGNvbnRhaW5zCisgICAgICAgICAg ICAgICAgICAgICAgICBhIHZpc2libGUgdGFiIGNoYXJhY3RlciAoIsK7IiksIHRoZSBzdWJzZXF1 ZW50CisgICAgICAgICAgICAgICAgICAgICAgICBTVFJFVENIX0dMWVBIIHdpbGwgaGF2ZSB0aGUg c2FtZSBzdGFydC0+Y2hhcnBvcworICAgICAgICAgICAgICAgICAgICAgICAgYXMgdGhlIGFmb3Jl bWVudGlvbmVkIHZpc2libGUgdGFiIGNoYXJhY3Rlci4gKi8KKyAgICAgICAgICAgICAgICAgICAg ICAgIDogKHByZXZpb3VzX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIHByZXZpb3VzX2dseXBoLT5jaGFycG9zID09IHN0YXJ0LT5jaGFycG9zKQorICAgICAgICAg ICAgICAgICAgICAgICAgICA/IHRydWUKKyAgICAgICAgICAgICAgICAgICAgICAgIDogZmFsc2U7 CisgICAgICAgICAgaW50IHBvc2ludCA9IChyb3dfcG9zaXRpb24gPT0gUE9TVF9aVikKKyAgICAg ICAgICAgICAgICAgICAgICAgICA/IC0xCisgICAgICAgICAgICAgICAgICAgICAgIDogKHJvd19w b3NpdGlvbiA9PSBBVF9aVikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgPyBlc3NlbnRpYWxz Lnp2CisgICAgICAgICAgICAgICAgICAgICAgIDogKHN0YXJ0LT5ieXRlcG9zICE9IGVzc2VudGlh bHMuenZfYnl0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBzdGFydCAtIHJvdy0+Z2x5 cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKQorICAgICAgICAgICAg ICAgICAgICAgICAgID8gTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSAtIDEKKyAgICAgICAg ICAgICAgICAgICAgICAgOiAoc3RhcnQtPmJ5dGVwb3MgPT0gZXNzZW50aWFscy56dl9ieXRlCisg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVB XSA9PSByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAg PyBlc3NlbnRpYWxzLnp2CisgICAgICAgICAgICAgICAgICAgICAgIDogc3RhcnQtPmNoYXJwb3M7 CisgICAgICAgICAgTGlzcF9PYmplY3Qgc3BlY3MgPSBtY19hc3NvYyAobWFrZV9maXhudW0gKHBv c2ludCksIEJWQVIgKGIsIG1jX2NvbmYpKTsKKyAgICAgICAgICBpZiAoKChoZWFkZXJfbGluZV9m b3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9y bWF0ID09IDApCisgICAgICAgICAgICAgICYmICFOSUxQIChzcGVjcykKKyAgICAgICAgICAgICAg JiYgcm93LT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAgICAgICAgICAmJiAh c2tpcF9wCisgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiAhPSBQT1NUX1pWKQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICBMaXNwX09iamVjdCBsaXNwX3R5cGUgPSBtY19udGggKDEs IHNwZWNzKTsKKyAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSA9 IChDT05TUCAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoWENBUiAobGlzcF90eXBlKSkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogbWNfbGlz cF90b19jdXJzb3JfdHlwZSAobGlzcF90eXBlKTsKKyAgICAgICAgICAgICAgY3Vyc29yX3R5cGUg PSAoc3RhcnQtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBNQ19IT0xMT1dfQk9YCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBjdXJzb3Jf dHlwZTsKKyAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aCA9IChDT05TUCAobGlzcF90eXBl KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gWEZJWE5VTSAoWENBUiAoWENE UiAobGlzcF90eXBlKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IC0xOwor ICAgICAgICAgICAgICBMaXNwX09iamVjdCBtY19mb3JlZ3JvdW5kID0gbWNfbnRoICgyLCBzcGVj cyk7CisgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAgICAgICAgICAgICBp ZiAoU1RSSU5HUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAgbWNfeHdfY29sb3Jf dmFsdWVzICh3LCBtY19mb3JlZ3JvdW5kLCAmbHNsX2ZnKTsKKyAgICAgICAgICAgICAgICBlbHNl IGlmIChWRUNUT1JQIChtY19mb3JlZ3JvdW5kKSkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgICAgbHNsX2ZnLnJlZCA9IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3Jv dW5kLCAwKSk7CisgICAgICAgICAgICAgICAgICAgIGxzbF9mZy5ncmVlbiA9IFhGTE9BVF9EQVRB IChBUkVGIChtY19mb3JlZ3JvdW5kLCAxKSk7CisgICAgICAgICAgICAgICAgICAgIGxzbF9mZy5i bHVlID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDIpKTsKKyAgICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKE5JTFAgKG1jX2ZvcmVncm91bmQp KQorICAgICAgICAgICAgICAgICAgICBtY19jb2xvcl9waWNrZXIgKHcsIHN0YXJ0LCBlc3NlbnRp YWxzLCAmbHNsX2ZnLCBwb3NpbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgY3Vyc29yX3R5cGUsIHJvd19wb3NpdGlvbiwgTVVMVElQTEVfQ1VSU09SUyk7CisgICAgICAg ICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgICAgICAg ICAgICAgIGludCB4X2xpbWl0ID0gdGV4dF9hcmVhX3dpZHRoOworICAgICAgICAgICAgICBtY19l bmdpbmUgKHcsIG1hdHJpeCwgcm93LCBzdGFydCwgVEVYVF9BUkVBLCB4LCB4X2xpbWl0LCByb3ct PnksCisgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FS RUFdLCB2cG9zLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jf d2lkdGgsIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwKKyAgICAgICAg ICAgICAgICAgICAgICAgICBsc2xfZmcsIE1VTFRJUExFX0NVUlNPUlMsIGRyYXdfcCwgZnJvbV93 aGVyZSwgTUNfQ0FDSEUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBpZiAoIU5J TFAgKEJWQVIgKGIsIGZjX3Zpc2libGUpKQorICAgICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2 ZV9wCisgICAgICAgICAgICAgIHx8ICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAg ICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGZjX2luYWN0aXZlX3dpbmRvd3MpKSkpCisgICAgICAg ICAgLy8gJiYgZXNzZW50aWFscy5mY194IDw9IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICYm IGVzc2VudGlhbHMuZmNfeCA8IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICYmIGVzc2VudGlh bHMuZmNfeCA+PSB3LT5tYy5sbnVtX3BpeGVsX3dpZHRoKQorICAgICAgICB7CisgICAgICAgICAg aW50IHhfbGltaXQgPSB4ICsgc3RhcnQtPnBpeGVsX3dpZHRoOworICAgICAgICAgIGJvb2wgcmVh bF9mYWtlX2N1cnNvcl9wID0gKHctPmN1cnNvci54ID09IGVzc2VudGlhbHMuZmNfeAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci55ID09IHJvdy0+eQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID09 IHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPmN1cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAgIHN0cnVj dCBtY19SR0IgbHNsX2ZnOworICAgICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywgc3RhcnQsIGVz c2VudGlhbHMsICZsc2xfZmcsIC0xLCBNQ19CQVIsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICByb3dfcG9zaXRpb24sIEZJTExfQ09MVU1OKTsKKyAgICAgICAgICBpZiAoeCA8IHRleHRfYXJl YV93aWR0aAorICAgICAgICAgICAgICAvLyB4ICsgc3RhcnQtPnBpeGVsX3dpZHRoIDw9IHRleHRf YXJlYV93aWR0aAorICAgICAgICAgICAgICAmJiAoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYg dnBvcyA+IDApCisgICAgICAgICAgICAgICAgICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkK KyAgICAgICAgICAgICAgJiYgKChzdGFydCAhPSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93 LT51c2VkW1RFWFRfQVJFQV0gLSAxCisgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5m Y194ID49IHgKKyAgICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPCB4ICsgc3Rh cnQtPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgfHwgKHN0YXJ0ID09IHJvdy0+Z2x5 cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEKKyAgICAgICAgICAgICAg ICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPj0geCkpCisgICAgICAgICAgICAgICYmIHJvdy0+ eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAgICAgJiYgIXJlYWxfZmFr ZV9jdXJzb3JfcCkKKyAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIHN0YXJ0 LCBURVhUX0FSRUEsIHgsIHhfbGltaXQsIHJvdy0+eSwKKyAgICAgICAgICAgICAgICAgICAgICAg c3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLCB2cG9zLCBNQ19CQVIsIDEsCisgICAgICAg ICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwg bHNsX2ZnLAorICAgICAgICAgICAgICAgICAgICAgICBGSUxMX0NPTFVNTiwgZHJhd19wLCBmcm9t X3doZXJlLCBGQ19DQUNIRSk7CisgICAgICAgIH0KKyAgICAgIGlmICghTklMUCAoQlZBUiAoYiwg Y3Jvc3NoYWlycykpCisgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2hvcml6b250YWxf cnVsZXIpKQorICAgICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAg IHx8ICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJW QVIgKGIsIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkpCisgICAgICAgICAgJiYgdnBvcyA9PSB3LT5j dXJzb3IudnBvcykKKyAgICAgICAgeworICAgICAgICAgIGludCB4X2xpbWl0ID0gKHN0YXJ0ID09 IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpCisgICAg ICAgICAgICAgICAgICAgICAgICA/IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAg ICAgICAgOiB4ICsgc3RhcnQtPnBpeGVsX3dpZHRoOworICAgICAgICAgIHN0cnVjdCBtY19SR0Ig bHNsX2ZnOworICAgICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywgc3RhcnQsIGVzc2VudGlhbHMs ICZsc2xfZmcsIC0xLCBNQ19IQkFSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93X3Bv c2l0aW9uLCBIT1JJWk9OVEFMX1JVTEVSKTsKKyAgICAgICAgICAvKiBQcmVzZXJ2ZSBzdXBwb3J0 IGZvciBkZWZhdWx0IGJlaGF2aW9yIHN1Y2ggdGhhdCBhIHVzZXIgbWF5CisgICAgICAgICAgc3Bl Y2lmeSB0aGUgaGVpZ2h0IG9mIGFuIE1DX0hCQVIsIHdoaWNoIGJlZ2lucyBpdHMgam91cm5leQor ICAgICAgICAgIGFzIHRoZSBgY3Vyc29yX3dpZHRoJy4gIGBtY19nZXRfY3Vyc29yX2dlb21ldHJ5 JyByZWFkanVzdHMuICovCisgICAgICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgc3Rh cnQsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwgcm93LT55LAorICAgICAgICAgICAgICAgICAgICAg c3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLCB2cG9zLCBNQ19IQkFSLCAxLAorICAgICAg ICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBs c2xfZmcsCisgICAgICAgICAgICAgICAgICAgICBIT1JJWk9OVEFMX1JVTEVSLCBkcmF3X3AsIGZy b21fd2hlcmUsIENIX0NBQ0hFKTsKKyAgICAgICAgfQorICAgICAgaWYgKCFOSUxQIChCVkFSIChi LCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxf cnVsZXIpKQorICAgICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAg IHx8ICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJW QVIgKGIsIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkpCisgICAgICAgICAgJiYgIWZpbGxfY29sdW1u X3RydW1wc19wKQorICAgICAgICB7CisgICAgICAgICAgY3Vyc29yX3R5cGUgPSAoc3RhcnQtPnR5 cGUgPT0gSU1BR0VfR0xZUEgpCisgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0hPTExPV19C T1gKKyAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfQkFSOworICAgICAgICAgIGludCB4X2xp bWl0ID0gdGV4dF9hcmVhX3dpZHRoOworICAgICAgICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9w ID0gKHctPmN1cnNvci55ID09IHJvdy0+eQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHctPmN1cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAgIHN0cnVjdCBtY19S R0IgbHNsX2ZnOworICAgICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywgc3RhcnQsIGVzc2VudGlh bHMsICZsc2xfZmcsIC0xLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg IHJvd19wb3NpdGlvbiwgVkVSVElDQUxfUlVMRVIpOworICAgICAgICAgIGlmICgoKGhlYWRlcl9s aW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICB8fCBoZWFkZXJfbGlu ZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAgJiYgKChzdGFydCAhPSByb3ctPmdseXBoc1tU RVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxCisgICAgICAgICAgICAgICAgICAg JiYgdy0+Y3Vyc29yLnggPj0geAorICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54IDwg eCArIHN0YXJ0LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgIHx8IChzdGFydCA9PSBy b3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxCisgICAgICAg ICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0geCkpCisgICAgICAgICAgICAgICYmIHJv dy0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAgICAgJiYgIXJlYWxf ZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIHN0 YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGltaXQsIHJvdy0+eSwKKyAgICAgICAgICAgICAgICAgICAg ICAgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLCB2cG9zLCBjdXJzb3JfdHlwZSwgMSwK KyAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bv c2l0aW9uLCBsc2xfZmcsCisgICAgICAgICAgICAgICAgICAgICAgIFZFUlRJQ0FMX1JVTEVSLCBk cmF3X3AsIGZyb21fd2hlcmUsIENIX0NBQ0hFKTsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNl CisgICAgICB7CisgICAgICAgIGludCByZWxhdGl2ZV94ID0gMDsKKyAgICAgICAgZm9yIChpbnQg YXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFyZWEgPCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAgICAg ICAgICB7CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoID0gcm93LT5nbHlwaHNbYXJl YV07CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoX2VuZCA9IGdseXBoICsgcm93LT51 c2VkW2FyZWFdOworICAgICAgICAgICAgLyogR2x5cGggZm9yIGEgbGluZSBlbmQgaW4gdGV4dC4g Ki8KKyAgICAgICAgICAgIGlmIChhcmVhID09IFRFWFRfQVJFQSAmJiBnbHlwaCA9PSBnbHlwaF9l bmQgJiYgZ2x5cGgtPmNoYXJwb3MgPiAwKQorICAgICAgICAgICAgICArK2dseXBoX2VuZDsKKyAg ICAgICAgICAgIGZvciAoOyBnbHlwaCA8IGdseXBoX2VuZDsgKytnbHlwaCkKKyAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgIGlmICh2cG9zICE9IHctPmN1cnNvci52cG9zCisgICAgICAg ICAgICAgICAgICAgICYmIGdseXBoICE9IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAgICAg ICAgJiYgZXNzZW50aWFscy5mY194IDwgcmVsYXRpdmVfeAorICAgICAgICAgICAgICAgICAgICAm JiB3LT5jdXJzb3IueCA8IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgJiYgTklMUCAo QlZBUiAoYiwgbWNfY29uZikpKQorICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAg ICAgICAgaWYgKCFOSUxQIChCVkFSIChiLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAg JiYgKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8ICghZXNz ZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChC VkFSIChiLCBtY19pbmFjdGl2ZV93aW5kb3dzKSkpKSkKKyAgICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAgICAgLyogVGhlIHNwYWNlIGFwcGVuZGVkIHRvIGEgcm93IGVuZGluZyB3 aXRoIGEgbmV3IGxpbmUgZG9lcworICAgICAgICAgICAgICAgICAgICBub3QgaGF2ZSBhIGBnbHlw aC0+Y2hhcnBvc2AgKC0xLCAwKSB0aGF0IHdlIGNhbiB1c2UgZm9yIHRoaXMKKyAgICAgICAgICAg ICAgICAgICAgcGFydGljdWxhciBhcHBsaWNhdGlvbi4gIFdoZW4gYSBgYnVmZmVyLWRpc3BsYXkt dGFibGUnIGVudHJ5CisgICAgICAgICAgICAgICAgICAgIGFzc2lnbnMgYSB2aXNpYmxlIGdseXBo IHRvIGEgbmV3IGxpbmUsIHRoZXJlIGlzIG5vIHByb2JsZW0KKyAgICAgICAgICAgICAgICAgICAg YmVjYXVzZSB0aGF0IGdseXBoIGhhcyBhIGBnbHlwaC0+Y2hhcnBvcycgdGhhdCB3ZSBjYW4gdXNl LgorICAgICAgICAgICAgICAgICAgICBXaGVuIG5vIHZpc2libGUgRU9MIGdseXBoIGV4aXN0cywg d2UgdXNlIHRoZSBmb2xsb3dpbmcgdGVzdDoKKyAgICAgICAgICAgICAgICAgICAgdGhlIGFwcGVu ZGVkIHNwYWNlIGhhcyBhIHBvc2l0aW9uIHRoYXQgaXMgb25lIGxlc3MgdGhhbiB0aGUKKyAgICAg ICAgICAgICAgICAgICAgZW5kIG9mIHRoZSBtYXRyaXggcm93LiAqLworICAgICAgICAgICAgICAg ICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAg ICAgICAgICAgICAgc3RydWN0IGdseXBoICpwcmV2aW91c19nbHlwaCA9ICgwIDw9IGhwb3MgLSAx ICYmIGhwb3MgLSAxIDwgcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0g KyBocG9zIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiBOVUxMOworICAgICAgICAgICAgICAgICAgICAvLyBzdHJ1Y3QgZ2x5cGggKmxhc3Rf Z2x5cGggPSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAx OworICAgICAgICAgICAgICAgICAgICBib29sIHNraXBfcCA9IChwcmV2aW91c19nbHlwaCAhPSBO VUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHByZXZpb3VzX2dseXBo LT5jaGFycG9zID09IE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgLSAxCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT5ieXRlcG9zICE9IGVzc2VudGlhbHMu enZfYnl0ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gdHJ1ZQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFdoZW4gYSBgYnVmZmVyLWRpc3BsYXkt dGFibGUnIGVudHJ5IGNvbnRhaW5zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg YSB2aXNpYmxlIHRhYiBjaGFyYWN0ZXIgKCLCuyIpLCB0aGUgc3Vic2VxdWVudAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIFNUUkVUQ0hfR0xZUEggd2lsbCBoYXZlIHRoZSBzYW1l IGdseXBoLT5jaGFycG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXMgdGhl IGFmb3JlbWVudGlvbmVkIHZpc2libGUgdGFiIGNoYXJhY3Rlci4gKi8KKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IChwcmV2aW91c19nbHlwaCAhPSBOVUxMCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcHJldmlvdXNfZ2x5cGgtPmNoYXJwb3MgPT0g Z2x5cGgtPmNoYXJwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IHRy dWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGZhbHNlOworICAgICAgICAg ICAgICAgICAgICBpbnQgcG9zaW50ID0gKHJvd19wb3NpdGlvbiA9PSBQT1NUX1pWKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IC0xCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IChyb3dfcG9zaXRpb24gPT0gQVRfWlYpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IGVzc2VudGlhbHMuenYKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogKGdseXBoLT5ieXRlcG9zICE9IGVzc2VudGlhbHMuenZfYnl0ZQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGggLSByb3ctPmdseXBoc1tURVhU X0FSRUFdID09IHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpIC0gMQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGgtPmJ5dGVwb3MgPT0gZXNzZW50aWFs cy56dl9ieXRlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaCAt IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGVzc2VudGlhbHMuenYKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogZ2x5cGgtPmNoYXJwb3M7CisgICAgICAgICAgICAg ICAgICAgIExpc3BfT2JqZWN0IHNwZWNzID0gbWNfYXNzb2MgKG1ha2VfZml4bnVtIChwb3NpbnQp LCBCVkFSIChiLCBtY19jb25mKSk7CisgICAgICAgICAgICAgICAgICAgIGlmICgoKGhlYWRlcl9s aW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwg aGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklM UCAoc3BlY3MpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnkgPD0gd2luZG93X3Rl eHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAhc2tpcF9wCisgICAg ICAgICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gIT0gUE9TVF9aVikKKyAgICAgICAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBMaXNwX09iamVjdCBsaXNw X3R5cGUgPSBtY19udGggKDEsIHNwZWNzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVudW0g bWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUgPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY19s aXNwX3RvX2N1cnNvcl90eXBlIChYQ0FSIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogbWNfbGlzcF90b19jdXJz b3JfdHlwZSAobGlzcF90eXBlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBl ID0gKGdseXBoLT50eXBlID09IElNQUdFX0dMWVBIKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IE1DX0hPTExPV19CT1gKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiBjdXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBj dXJzb3Jfd2lkdGggPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBYRklYTlVNIChYQ0FSIChYQ0RSIChsaXNwX3R5cGUpKSkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IC0xOworICAgICAg ICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3QgbWNfZm9yZWdyb3VuZCA9IG1jX250aCAoMiwg c3BlY3MpOworICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7Cisg ICAgICAgICAgICAgICAgICAgICAgICBpZiAoU1RSSU5HUCAobWNfZm9yZWdyb3VuZCkpCisgICAg ICAgICAgICAgICAgICAgICAgICAgIG1jX3h3X2NvbG9yX3ZhbHVlcyAodywgbWNfZm9yZWdyb3Vu ZCwgJmxzbF9mZyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKFZFQ1RPUlAg KG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGxzbF9mZy5yZWQgPSBYRkxPQVRfREFUQSAoQVJFRiAobWNf Zm9yZWdyb3VuZCwgMCkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNsX2ZnLmdy ZWVuID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDEpKTsKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGxzbF9mZy5ibHVlID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2Zv cmVncm91bmQsIDIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoTklMUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBtY19jb2xvcl9waWNrZXIgKHcsIGdseXBoLCBlc3NlbnRp YWxzLCAmbHNsX2ZnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBwb3NpbnQsIGN1cnNvcl90eXBlLCByb3dfcG9zaXRpb24sCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1VTFRJUExFX0NVUlNPUlMpOworICAgICAg ICAgICAgICAgICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4 KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gdGV4dF9hcmVhX3dpZHRo OworICAgICAgICAgICAgICAgICAgICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgZ2x5 cGgsIGFyZWEsIHJlbGF0aXZlX3gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHhfbGltaXQsIHJvdy0+eSwgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dp ZHRoLCBjdXJzb3JfbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBl c3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGxzbF9mZywKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgTVVMVElQTEVfQ1VSU09SUywgZHJhd19wLCBmcm9tX3doZXJlLCBNQ19DQUNI RSk7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgICAgIGlmICghTklMUCAoQlZBUiAoYiwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgICAg ICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICB8 fCAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAh TklMUCAoQlZBUiAoYiwgZmNfaW5hY3RpdmVfd2luZG93cykpKSkKKyAgICAgICAgICAgICAgICAg ICAgLy8gJiYgZXNzZW50aWFscy5mY194IDw9IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAg ICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPCB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAg ICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID49IHctPm1jLmxudW1fcGl4ZWxfd2lkdGgpCisg ICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gdGV4 dF9hcmVhX3dpZHRoOworICAgICAgICAgICAgICAgICAgICBib29sIHJlYWxfZmFrZV9jdXJzb3Jf cCA9ICh3LT5jdXJzb3IueCA9PSBlc3NlbnRpYWxzLmZjX3gKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnkgPT0gcm93LT55CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci5o cG9zID09IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IudnBvcyA9PSB2cG9zKTsK KyAgICAgICAgICAgICAgICAgICAgaW50IGhwb3MgPSBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRf QVJFQV07CisgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAgICAg ICAgICAgICAgICAgICBtY19jb2xvcl9waWNrZXIgKHcsIGdseXBoLCBlc3NlbnRpYWxzLCAmbHNs X2ZnLCAtMSwgTUNfQkFSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJv d19wb3NpdGlvbiwgRklMTF9DT0xVTU4pOworICAgICAgICAgICAgICAgICAgICBpZiAoaHBvcyA+ PSBocG9zX3N0YXJ0CisgICAgICAgICAgICAgICAgICAgICAgICAmJiBocG9zIDwgaHBvc19zdGFy dCArIGhwb3NfbGVuZ3RoCisgICAgICAgICAgICAgICAgICAgICAgICAvLyAmJiByZWxhdGl2ZV94 ICsgZ2x5cGgtPnBpeGVsX3dpZHRoIDw9IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAg ICAgICAgICAgJiYgcmVsYXRpdmVfeCA8IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAg ICAgICAgICAgJiYgKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAg ICAgICAgICAgICAgICAgICAgJiYgKChnbHlwaCAhPSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSByZWxhdGl2ZV94CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA8IHJlbGF0aXZlX3gg KyBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKGds eXBoID09IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg ZXNzZW50aWFscy5mY194ID49IHJlbGF0aXZlX3gpKQorICAgICAgICAgICAgICAgICAgICAgICAg JiYgcm93LT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAgICAgICAgICAgICAg ICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgICAgICAgICAgICBtY19l bmdpbmUgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgYXJlYSwgcmVsYXRpdmVfeCwgeF9saW1pdCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvdy0+eSwgaHBvcywgdnBvcywgTUNf QkFSLCAxLCBjdXJzb3JfbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBsc2xfZmcsIEZJTExfQ09MVU1OLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgZHJhd19wLCBmcm9tX3doZXJlLCBGQ19DQUNIRSk7Cisg ICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKCFOSUxQIChCVkFSIChiLCBj cm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2hv cml6b250YWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAmJiAoZXNzZW50aWFscy5hY3Rp dmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2luYWN0aXZl X3dpbmRvd3MpKSkpCisgICAgICAgICAgICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZw b3MpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGludCB4X2xpbWl0 ID0gdGV4dF9hcmVhX3dpZHRoOworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGdseXBo IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1j X1JHQiBsc2xfZmc7CisgICAgICAgICAgICAgICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywgZ2x5 cGgsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0xLCBNQ19IQkFSLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgSE9SSVpPTlRBTF9SVUxFUik7CisgICAg ICAgICAgICAgICAgICAgIC8qIFByZXNlcnZlIHN1cHBvcnQgZm9yIGRlZmF1bHQgYmVoYXZpb3Ig c3VjaCB0aGF0IGEgdXNlciBtYXkKKyAgICAgICAgICAgICAgICAgICAgc3BlY2lmeSB0aGUgaGVp Z2h0IG9mIGFuIE1DX0hCQVIsIHdoaWNoIGJlZ2lucyBpdHMgam91cm5leQorICAgICAgICAgICAg ICAgICAgICBhcyB0aGUgYGN1cnNvcl93aWR0aCcuICBgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeScg cmVhZGp1c3RzLiAqLworICAgICAgICAgICAgICAgICAgICBpZiAoaHBvcyA+PSBocG9zX3N0YXJ0 CisgICAgICAgICAgICAgICAgICAgICAgICAmJiBocG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVu Z3RoKQorICAgICAgICAgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIGds eXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4X2xpbWl0LAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgcm93LT55LCBocG9zLCB2cG9zLCBNQ19IQkFSLCAxLCBjdXJzb3JfbWF0cml4LAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscywgcm93X3Bvc2l0aW9u LCBsc2xfZmcsIEhPUklaT05UQUxfUlVMRVIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBkcmF3X3AsIGZyb21fd2hlcmUsIENIX0NBQ0hFKTsKKyAgICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAg ICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAg ICAgICAgICAgICAgICAgICAmJiAoZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAg ICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkpCisgICAgICAg ICAgICAgICAgICAgICYmICFmaWxsX2NvbHVtbl90cnVtcHNfcCkKKyAgICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUgPSAoZ2x5cGgtPnR5cGUgPT0gSU1B R0VfR0xZUEgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19IT0xMT1df Qk9YCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19CQVI7CisgICAgICAg ICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gdGV4dF9hcmVhX3dpZHRoOworICAgICAgICAgICAg ICAgICAgICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9ICh3LT5jdXJzb3IueSA9PSByb3ctPnkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vy c29yLnZwb3MgPT0gdnBvcyk7CisgICAgICAgICAgICAgICAgICAgIGludCBocG9zID0gZ2x5cGgg LSByb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNf UkdCIGxzbF9mZzsKKyAgICAgICAgICAgICAgICAgICAgbWNfY29sb3JfcGlja2VyICh3LCBnbHlw aCwgZXNzZW50aWFscywgJmxzbF9mZywgLTEsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgVkVSVElDQUxfUlVMRVIpOworICAg ICAgICAgICAgICAgICAgICBpZiAoaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICAgICAg ICAgICAgICAmJiBocG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoCisgICAgICAgICAgICAg ICAgICAgICAgICAmJiAoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAg ICAgICAgICAgICAgICAgICAgICAmJiAoKGdseXBoICE9IGdseXBoX2VuZCAtIDEKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0gcmVsYXRpdmVfeAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA8IHJlbGF0aXZlX3ggKyBnbHlw aC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKGdseXBoID09 IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vy c29yLnggPj0gcmVsYXRpdmVfeCkpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnkg PD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAh cmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywg bWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4X2xpbWl0LAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgcm93LT55LCBocG9zLCB2cG9zLCBjdXJzb3JfdHlwZSwg MSwgY3Vyc29yX21hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVzc2Vu dGlhbHMsIHJvd19wb3NpdGlvbiwgbHNsX2ZnLCBWRVJUSUNBTF9SVUxFUiwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGRyYXdfcCwgZnJvbV93aGVyZSwgQ0hfQ0FDSEUpOworICAg ICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBp eGVsX3dpZHRoOworICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgfQorICAvLyAg Y2xvY2tfdCBjbG9ja19lbmQgPSBjbG9jaygpOworICAvLyAgZG91YmxlIGNwdV90aW1lX3VzZWQg PSAoKGRvdWJsZSkgKGNsb2NrX2VuZCAtIGNsb2NrX3N0YXJ0KSkgLyBDTE9DS1NfUEVSX1NFQzsK KyAgLy8gIGZwcmludGYgKHN0ZGVyciwgIm1jX2RyYXdfcm93ICglcyk6ICBUSU1FICglZilcbiIs IG1jX3dpbmRvdyAodyksIGNwdV90aW1lX3VzZWQpOworfQorCitib29sCittY19yZWRyYXdfcm93 IChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsIHN0c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x5cGggcm93LiAqLworICAgICAgICAgICAg ICAgICAgfHwgKGhwb3MgKyAxID09IHN0YXJ0X2hwb3MKKyAgICAgICAgICAgICAgICAgICAgICAm JiBocG9zICsgMSA9PSBlbmRfaHBvcykpCisgICAgICAgICAgICAgICYmIGVuYWJsZWRfcCkKKyAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgYm9vbCByZW1vdmVfcCA9IGZhbHNlOworICAgICAg ICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBm eSwgaHBvcywgdnBvcywgd2QsIGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBsc2xfZmcsIGFjdGl2ZV9wLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGhfZmxhdm9yLCByZW1vdmVfcCk7CisgICAg ICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIHJldHVybiB0cnVlOworICAvLyAgY2xvY2tf ZW5kID0gY2xvY2soKTsKKyAgLy8gIGRvdWJsZSB0aW1lX2N1cnNvcnMgPSAoKGRvdWJsZSkgKGNs b2NrX2VuZCAtIGNsb2NrX3N0YXJ0KSkgLyBDTE9DS1NfUEVSX1NFQzsKKyAgLy8gIGZwcmludGYg KHN0ZGVyciwgIm1jX3JlZHJhd19yb3cgKCVkKTogIGhwb3MgKCVkLyVkKSB8IGdseXBocyAoJWYp IHwgY3Vyc29ycyAoJWYpXG4iLAorICAvLyAgICAgICAgICAgICAgICAgICB2cG9zLCBzdGFydF9o cG9zLCBlbmRfaHBvcywgdGltZV9nbHlwaHMsIHRpbWVfY3Vyc29ycyk7Cit9CisKK3ZvaWQKK21j X2VyYXNlX3JvdyAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4 LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cpCit7CisgIGludCB2bnRoID0gTUFUUklYX1JPV19WUE9T IChyb3csIG1hdHJpeCk7CisgIGlmIChtY19zdGRlcnJfcCkKKyAgICBmcHJpbnRmIChzdGRlcnIs ICJtY19lcmFzZV9yb3cgKCVzKTogIHZwb3MgKCVkKVxuIiwgbWNfd2luZG93ICh3KSwgdm50aCk7 CisgIC8vICBpZiAobWNfc3RkZXJyX3ApCisgIC8vICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX2Vy YXNlX2hlbHBlciAoJXMpOiAgY2FjaGUgKCVzKSB8IHZwb3MgKCVkKVxuIiwKKyAgLy8gICAgICBt Y193aW5kb3cgKHcpLCBtY19jYWNoZV90eXBlX3RvX3N0cmluZyAoY2FjaGVfdHlwZSksIHZudGgp OworICBmb3IgKGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7CisgICAg ICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICsrY2FjaGVfdHlwZSkKKyAgICB7Cisg ICAgICBmb3IgKGludCBudGggPSAwOworICAgICAgICAgICBtY190cmF2ZXJzZV9jYWNoZV9wICh3 LT5tY19tYXRyaXgsIGNhY2hlX3R5cGUsIHZudGgsIG50aCk7CisgICAgICAgICAgICsrbnRoKQor ICAgICAgICB7CisgICAgICAgICAgaW50IHggPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhdLng7CisgICAgICAgICAgaW50IGZ4ID0gdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5meDsKKyAgICAgICAgICBpbnQgeSA9IHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ueTsKKyAgICAgICAg ICBpbnQgZnkgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhd LmZ5OworICAgIC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lOworICAgICAgICAgIGJvb2wgYmFyZl9jcmFzaF90d28gPSAodnBv cyA+PSAwICYmIHZwb3MgPCBtYXRyaXgtPm5yb3dzKSA/IGZhbHNlIDogdHJ1ZTsKKyAgICAgICAg ICBpZiAoYmFyZl9jcmFzaF90d28pCisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICBp ZiAodnBvcyA9PSB2bnRoCisgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQ SAorICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIG1jX2VyYXNlX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIHksIGhwb3MsIHZwb3MsIGds eXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkKTsKKyAgICAgICAgICAgICAgdy0+bWNfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFibGVkX3AgPSBmYWxzZTsKKyAg ICAgICAgICAgICAgLS13LT5tY19tYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5cGVdOworICAg ICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAodnBvcyA9PSB2bnRoCisgICAgICAgICAg ICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg ICBib29sIHJlbW92ZV9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICBtY19kcmF3X2VyYXNlX2h5 YnJpZCAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCBjdXJzb3Jf d2lkdGgsIGxzbF9iZywgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGdseXBoX2ZsYXZvciwgcmVtb3ZlX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BERUwuXQor ICArLS0tLS0tLS0tLS0tLSsgPD0gaXQuY3VycmVudF95ID09IDAKKyAgfCAgICAgICAgICAgICB8 CisgIHwgICAgICAgICAgICAgfCA8PSBydW4uZGVzaXJlZF95ID09IDI3MCBbdXAgKOKGkSldID09 IHJ1bi5jdXJyZW50X3kgPCBydW4uZGVzaXJlZF95CisgIHwgICAgICAgICAgICAgfCAgICBydW4u aGVpZ2h0ID0gaXQubGFzdF92aXNpYmxlX3kgLSBydW4uY3VycmVudF95OworICB8ICAgICAgICAg ICAgIHwgICAgcnVuLmhlaWdodCA9PSAxMDgwIC0gNTQwID09IDU0MAorICB8ICAgICAgICAgICAg IHwgICAgW1RoZSBlbnRpcmUgYm90dG9tIHJlY3RhbmdsZSBnZXRzIGNvcGllZCB0byB1cHBlciBy dW4uZGVzaXJlZF95Ll0KKyAgfCAgICAgICAgICAgICB8CisgICstLS0tLS0tLS0tLS0tKyA8PSBy dW4uY3VycmVudF95ID09IDU0MAorICB8ICAgICAgICAgICAgIHwKKyAgfCAgICAgICAgICAgICB8 IDw9IHJ1bi5kZXNpcmVkX3kgPT0gODEwIFtkb3duICjihpMpXSA9PSBydW4uY3VycmVudF95ID4g cnVuLmRlc2lyZWRfeQorICB8ICAgICAgICAgICAgIHwgICAgcnVuLmhlaWdodCA9IGl0Lmxhc3Rf dmlzaWJsZV95IC0gcnVuLmRlc2lyZWRfeQorICB8ICAgICAgICAgICAgIHwgICAgcnVuLmhlaWdo dCA9PSAxMDgwIC0gODEwID09IDI3MAorICB8ICAgICAgICAgICAgIHwgICAgW1RvcCBwYXJ0IG9m IHRoZSBsb3dlciByZWN0YW5nbGUgZ2V0cyBjb3BpZWQgdG8gbG93ZXIgcnVuLmRlc2lyZWRfeS5d CisgIHwgICAgICAgICAgICAgfAorICArLS0tLS0tLS0tLS0tLSsgPD0gaXQubGFzdF92aXNpYmxl X3kgPT0gMTA4MCAqLwordm9pZAorbWNfcHJlX3Njcm9sbF9jbGVhbiAoc3RydWN0IHdpbmRvdyAq dywgc3RydWN0IHJ1biBydW4sIGludCBzdGFydF92cG9zLAorICAgICAgICAgICAgICAgICAgICAg aW50IG5yb3dzX3Njcm9sbGVkLCBlbnVtIG1jX3ByZV9zY3JvbGxfY2xlYW5fdHlwZSBmcm9tX3do ZXJlKQoreworICBpZiAoTUlOSV9XSU5ET1dfUCAodykpCisgICAgcmV0dXJuOworICBib29sIGdv X29uZV9wID0gKHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbTUNfQ0FDSEVdID4gMAorICAgICAg ICAgICAgICAgICAgIHx8IHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbQ0hfQ0FDSEVdID4gMAor ICAgICAgICAgICAgICAgICAgIHx8IHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbRkNfQ0FDSEVd ID4gMCk7CisgIGJvb2wgZ29fdHdvX3AgPSAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAg ICAgICAgICAgICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3Nz aGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKSk7CisgIGlmIChtY19z dGRlcnJfcCkKKyAgICBmcHJpbnRmIChzdGRlcnIsICJtY19wcmVfc2Nyb2xsX2NsZWFuICglcyk6 XG5cCisgICVzIHwgZ29fb25lX3AgKCVzKSB8IGdvX3R3b19wICglcylcblwKKyAgc3RhcnRfdnBv cyAoJWQpIHwgbnJvd3Nfc2Nyb2xsZWQgKCVkKVxuXAorICAlczogIHJ1bi5jdXJyZW50L2Rlc2ly ZWRfeSAoJWQvJWQpIHwgcnVuLmhlaWdodCAoJWQpXG4iLAorICAgIG1jX3dpbmRvdyAodyksIChm cm9tX3doZXJlID09IFRSWV9XSU5ET1dfUkVVU0lOR19DVVJSRU5UX01BVFJJWF9ET1dOKQorICAg ICAgICAgICAgICAgICAgICAgPyAiVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX0RP V04iCisgICAgICAgICAgICAgICAgICAgOiAoZnJvbV93aGVyZSA9PSBUUllfV0lORE9XX1JFVVNJ TkdfQ1VSUkVOVF9NQVRSSVhfVVApCisgICAgICAgICAgICAgICAgICAgICA/ICJUUllfV0lORE9X X1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfVVAiCisgICAgICAgICAgICAgICAgICAgOiAoZnJvbV93 aGVyZSA9PSBUUllfV0lORE9XX0lEKQorICAgICAgICAgICAgICAgICAgICAgPyAiVFJZX1dJTkRP V19JRCIKKyAgICAgICAgICAgICAgICAgICA6ICJVTktOT1dOIiwKKyAgICBnb19vbmVfcCA/ICJ5 ZXMiIDogIm5vIiwgZ29fdHdvX3AgPyAieWVzIiA6ICJubyIsCisgICAgc3RhcnRfdnBvcywgbnJv d3Nfc2Nyb2xsZWQsCisgICAgcnVuLmN1cnJlbnRfeSA8IHJ1bi5kZXNpcmVkX3kgPyAi4oaTIiA6 ICLihpEiLAorICAgIHJ1bi5jdXJyZW50X3ksIHJ1bi5kZXNpcmVkX3ksIHJ1bi5oZWlnaHQpOwor ICBpZiAoIWdvX29uZV9wICYmICFnb190d29fcCkKKyAgICByZXR1cm47CisgIGJvb2wgdXBkYXRp bmdfZnJhbWVfcCA9IGZhbHNlOworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1l KTsKKyAgaWYgKFhGUkFNRSAody0+ZnJhbWUpICE9IGYtPm1jX3VwZGF0aW5nX2ZyYW1lCisgICAg ICAmJiAoZ29fb25lX3AgfHwgZ29fdHdvX3ApKQorICAgIHsKKyAgICAgIHVwZGF0aW5nX2ZyYW1l X3AgPSB0cnVlOworICAgICAgd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ycl9w ID0gWEZJWE5VTSAoYXJnKSA+IDA7CisgICAgfQorICByZXR1cm4gUW5pbDsKK30KKworLyogZW5k IE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAwKIC8q KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKgogCQkgICAgICBXaW5kb3cgZGlzcGxheSBkaW1lbnNpb25zCkBAIC0xMzUx MSw2ICsxODM5MSw2OSBAQCBoc2Nyb2xsX3dpbmRvd190cmVlIChMaXNwX09iamVjdCB3aW5kb3cp CiAJICAgICAgZWxzZQogCQlwdCA9IGNsaXBfdG9fYm91bmRzIChCRUdWLCBtYXJrZXJfcG9zaXRp b24gKHctPnBvaW50bSksIFpWKTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJl Z2luIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyogKGdkYikgYnQKKyMwICB0ZXJtaW5hdGVfZHVl X3RvX3NpZ25hbCAoc2lnPTYsIGJhY2t0cmFjZV9saW1pdD0yMTQ3NDgzNjQ3KSBhdCBlbWFjcy5j OjM1OQorIzEgIDB4MDAwMDAwMDEwMDFlZTk5NiBpbiBkaWUgKAorICAgIG1zZz0weDEwMDMyZmM4 OCAiY2hhcnBvcyA8IDAgfHwgKGNoYXJwb3MgPj0gQlVGX0JFRyAoY3VycmVudF9idWZmZXIpICYm IGNoYXJwb3MgPD0gWlYpIiwgZmlsZT0weDEwMDMyZTMyZCAieGRpc3AuYyIsIGxpbmU9Nzk1MSkg YXQgYWxsb2MuYzo3MjE0CisjMiAgMHgwMDAwMDAwMTAwMDRkMmFiIGluIGluaXRfaXRlcmF0b3Ig K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XNwbGF5X3BvcyAqcG9zID0gJmN1cnNvcl9yb3ctPnN0YXJ0OworICBwdHJkaWZmX3QgY2hhcnBv cyA9IENIQVJQT1MgKHBvcy0+cG9zKTsKKworICBib29sIGJhcmZfY3Jhc2hfb25lID0gKGNoYXJw b3MgPCAwCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKGNoYXJwb3MgPj0gQlVGX0JFRyAo Y3VycmVudF9idWZmZXIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGNoYXJwb3Mg PD0gWlYpKQorICAgICAgICAgICAgICAgICAgICAgICAgPyBmYWxzZQorICAgICAgICAgICAgICAg ICAgICAgICAgOiB0cnVlOworICBpZiAoYmFyZl9jcmFzaF9vbmUpCisgICAgcmV0dXJuIGhzY3Jv bGxlZF9wOworCisgIC8qIGByZXNlYXRfMSc6ICBDSEFSUE9TIChwb3MpID49IEJFR1YgJiYgQ0hB UlBPUyAocG9zKSA8PSBaViAqLworICBib29sIGJhcmZfY3Jhc2hfdHdvID0gKGNoYXJwb3MgPj0g QkVHViAmJiBjaGFycG9zIDw9IFpWKQorICAgICAgICAgICAgICAgICAgICAgICAgID8gZmFsc2UK KyAgICAgICAgICAgICAgICAgICAgICAgICA6IHRydWU7CisgIGlmIChiYXJmX2NyYXNoX3R3bykK KyAgICByZXR1cm4gaHNjcm9sbGVkX3A7CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAgICAgLyogTW92ZSBpdGVyYXRvciB0byBw dCBzdGFydGluZyBhdCBjdXJzb3Jfcm93LT5zdGFydCBpbgogCQkgYSBsaW5lIHdpdGggaW5maW5p dGUgd2lkdGguICAqLwogCSAgICAgIGluaXRfdG9fcm93X3N0YXJ0ICgmaXQsIHcsIGN1cnNvcl9y b3cpOwpAQCAtMTQzOTcsOSArMTkzNDAsMjIgQEAgcmVkaXNwbGF5X2ludGVybmFsICh2b2lkKQog CSAgICAgICp3LT5kZXNpcmVkX21hdHJpeC0+bWV0aG9kID0gMDsKIAkgICAgICBkZWJ1Z19tZXRo b2RfYWRkICh3LCAib3B0aW1pemF0aW9uIDEiKTsKICNlbmRpZgorCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCiAjaWZkZWYgSEFWRV9XSU5ET1df U1lTVEVNCisgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICYmICFOSUxQIChCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICBtY191cGRhdGVfd2lu ZG93X2ZyaW5nZXMgKHcsIGZhbHNlKTsKKyAgICBlbHNlCiAJICAgICAgdXBkYXRlX3dpbmRvd19m cmluZ2VzICh3LCBmYWxzZSk7CiAjZW5kaWYKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisK KwogCSAgICAgIGdvdG8gdXBkYXRlOwogCSAgICB9CiAJICBlbHNlCkBAIC0xNzc5MiwxMCArMjI3 NDgsMjIgQEAgcmVkaXNwbGF5X3dpbmRvdyAoTGlzcF9PYmplY3Qgd2luZG93LCBib29sIGp1c3Rf dGhpc19vbmVfcCkKICAgICB9CiAKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KKworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBib29sIGtl ZXBfY3VycmVudF9wID0gKGp1c3RfdGhpc19vbmVfcAorICAgICAgICAgICAgICAgICAgICAgICAg IHx8ICghdXNlZF9jdXJyZW50X21hdHJpeF9wICYmICFvdmVybGF5X2Fycm93X3NlZW4pCisgICAg ICAgICAgICAgICAgICAgICAgICAgfHwgdy0+cHNldWRvX3dpbmRvd19wKTsKKworICBib29sIGZy aW5nZXNfdXBkYXRlZF9wID0gKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3Nz aGFpcnMpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfdXBkYXRlX3dpbmRvd19m cmluZ2VzICh3LCBrZWVwX2N1cnJlbnRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIDog dXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCBrZWVwX2N1cnJlbnRfcCk7CisKICAgaWYgKEZSQU1F X1dJTkRPV19QIChmKQotICAgICAgJiYgdXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCAoanVzdF90 aGlzX29uZV9wCi0JCQkJICAgIHx8ICghdXNlZF9jdXJyZW50X21hdHJpeF9wICYmICFvdmVybGF5 X2Fycm93X3NlZW4pCi0JCQkJICAgIHx8IHctPnBzZXVkb193aW5kb3dfcCkpKQorICAgICAgJiYg ZnJpbmdlc191cGRhdGVkX3ApCiAgICAgewogICAgICAgdXBkYXRlX2JlZ2luIChmKTsKICAgICAg IGJsb2NrX2lucHV0ICgpOwpAQCAtMTc4MTAsNiArMjI3NzgsOSBAQCByZWRpc3BsYXlfd2luZG93 IChMaXNwX09iamVjdCB3aW5kb3csIGJvb2wganVzdF90aGlzX29uZV9wKQogICAgICAgdXBkYXRl X2VuZCAoZik7CiAgICAgfQogCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIGlmIChX SU5ET1dfQk9UVE9NX0RJVklERVJfV0lEVEggKHcpKQogICAgIGd1aV9kcmF3X2JvdHRvbV9kaXZp ZGVyICh3KTsKICNlbmRpZiAvKiBIQVZFX1dJTkRPV19TWVNURU0gKi8KQEAgLTE4MTI1LDYgKzIz MDk2LDE2IEBAIHRyeV93aW5kb3dfcmV1c2luZ19jdXJyZW50X21hdHJpeCAoc3RydWN0IHdpbmRv dyAqdykKIAkgICAgICB1cGRhdGVfYmVnaW4gKGYpOwogCSAgICAgIGd1aV91cGRhdGVfd2luZG93 X2JlZ2luICh3KTsKIAkgICAgICBGUkFNRV9SSUYgKGYpLT5jbGVhcl93aW5kb3dfbW91c2VfZmFj ZSAodyk7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JT ICovCisKKyAgICBtY19wcmVfc2Nyb2xsX2NsZWFuICh3LCBydW4sIHN0YXJ0X3Zwb3MsIG5yb3dz X3Njcm9sbGVkLCBUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfRE9XTik7CisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgICAgICBGUkFNRV9SSUYgKGYpLT5zY3JvbGxf cnVuX2hvb2sgKHcsICZydW4pOwogCSAgICAgIGd1aV91cGRhdGVfd2luZG93X2VuZCAodywgZmFs c2UsIGZhbHNlKTsKIAkgICAgICB1cGRhdGVfZW5kIChmKTsKQEAgLTE4MjkxLDYgKzIzMjcyLDE2 IEBAIHRyeV93aW5kb3dfcmV1c2luZ19jdXJyZW50X21hdHJpeCAoc3RydWN0IHdpbmRvdyAqdykK IAkgIHVwZGF0ZV9iZWdpbiAoZik7CiAJICBndWlfdXBkYXRlX3dpbmRvd19iZWdpbiAodyk7CiAJ ICBGUkFNRV9SSUYgKGYpLT5jbGVhcl93aW5kb3dfbW91c2VfZmFjZSAodyk7CisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICBtY19wcmVf c2Nyb2xsX2NsZWFuICh3LCBydW4sIHN0YXJ0X3Zwb3MsIG5yb3dzX3Njcm9sbGVkLCBUUllfV0lO RE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfVVApOworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKworCiAJICBGUkFNRV9SSUYgKGYpLT5zY3JvbGxfcnVuX2hvb2sgKHcsICZydW4pOwogCSAg Z3VpX3VwZGF0ZV93aW5kb3dfZW5kICh3LCBmYWxzZSwgZmFsc2UpOwogCSAgdXBkYXRlX2VuZCAo Zik7CkBAIC0xOTI0NSw2ICsyNDIzNiwxNiBAQCB0cnlfd2luZG93X2lkIChzdHJ1Y3Qgd2luZG93 ICp3KQogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQogCSAgZ3VpX3VwZGF0ZV93aW5kb3dfYmVn aW4gKHcpOwogCSAgRlJBTUVfUklGIChmKS0+Y2xlYXJfd2luZG93X21vdXNlX2ZhY2UgKHcpOwor CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisg ICAgbWNfcHJlX3Njcm9sbF9jbGVhbiAodywgcnVuLCBmaXJzdF91bmNoYW5nZWRfYXRfZW5kX3Zw b3MsIGR2cG9zLCBUUllfV0lORE9XX0lEKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisK KwogCSAgRlJBTUVfUklGIChmKS0+c2Nyb2xsX3J1bl9ob29rICh3LCAmcnVuKTsKIAkgIGd1aV91 cGRhdGVfd2luZG93X2VuZCAodywgZmFsc2UsIGZhbHNlKTsKICNlbmRpZgpAQCAtMjE1MjgsNiAr MjY1MjksMTcgQEAgbWF5YmVfcHJvZHVjZV9saW5lX251bWJlciAoc3RydWN0IGl0ICppdCkKICAg ICAgIFNFVF9URVhUX1BPUyAodGVtX2l0LnBvc2l0aW9uLCAtMSwgLTEpOwogICAgICAgUFJPRFVD RV9HTFlQSFMgKCZ0ZW1faXQpOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCisgICAgICAvKiBUaGlzIHBlcm1pdHMgdXMgdG8gaW5zcGVjdCB0 aGUgSFBPUyBvZiBsaW5lIG51bWJlciBnbHlwaHMgYW5kIHRoZSBzcGFjZQorICAgICAgcGFkZGlu ZyBiZWZvcmUvYWZ0ZXIgdGhlIGxpbmUgbnVtYmVycy4gIFdlIHNldCBgZ2x5cGgtPmhwb3NgIGVs c2V3aGVyZS4gKi8KKyAgICAgIHRlbV9pdC5ocG9zICs9IDE7CisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworCisKICAgICAgIC8qIFN0b3AgcHJvZHVjaW5nIGdseXBocywgYW5kIHJlZnJhaW4g ZnJvbSBwcm9kdWNpbmcgdGhlIGxpbmUKIAkgbnVtYmVyLCBpZiB3ZSBkb24ndCBoYXZlIGVub3Vn aCBzcGFjZSBvbiB0aGlzIGxpbmUuICAqLwogICAgICAgaWYgKHRlbV9pdC5jdXJyZW50X3ggPj0g d2lkdGhfbGltaXQpCkBAIC0yMTUzOSw2ICsyNjU1MSwyOCBAQCBtYXliZV9wcm9kdWNlX2xpbmVf bnVtYmVyIChzdHJ1Y3QgaXQgKml0KQogCX0KICAgICB9CiAKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgc3RydWN0IGJ1ZmZlciAqYiA9IFhC VUZGRVIgKGl0LT53LT5jb250ZW50cyk7CisgIHN0cnVjdCBidWZmZXIgKm9sZF9idWZmZXIgPSBO VUxMOworICAvKiBOZWVkZWQgc28gdGhhdCBidWZmZXItbG9jYWwgdmFsdWVzIGNhbiBiZSBkZXRl cm1pbmVkOyBlLmcuLCB3aGVuIHN3aXRjaGluZworICB0byB0aGUgbWluaWJ1ZmZlci4gKi8KKyAg aWYgKGIgIT0gY3VycmVudF9idWZmZXIpCisgICAgeworICAgICAgb2xkX2J1ZmZlciA9IGN1cnJl bnRfYnVmZmVyOworICAgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAoYik7CisgICAgfQorICBpdC0+ dy0+bWMubG51bV9waXhlbF93aWR0aCA9ICghTklMUCAoVmRpc3BsYXlfbGluZV9udW1iZXJzKSkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IHRlbV9pdC5jdXJyZW50X3gKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IDA7CisgIGlmIChvbGRfYnVmZmVyKQorICAgIHNl dF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKworCiAgIC8qIFJlY29yZCB0aGUgd2lkdGggaW4gcGl4ZWxzIHdlIG5lZWQgZm9yIHRoZSBs aW5lIG51bWJlciBkaXNwbGF5LiAgKi8KICAgaXQtPmxudW1fcGl4ZWxfd2lkdGggPSB0ZW1faXQu Y3VycmVudF94OwogICAvKiBDb3B5IHRoZSBwcm9kdWNlZCBnbHlwaHMgaW50byBJVCdzIGdseXBo X3Jvdy4gICovCkBAIC0yNzM2MCw2ICszMjM5NCwxNyBAQCBhcHBlbmRfZ2x5cGggKHN0cnVjdCBp dCAqaXQpCiAJICAgIGdbMV0gPSAqZzsKIAkgIGdseXBoID0gaXQtPmdseXBoX3Jvdy0+Z2x5cGhz W2FyZWFdOwogCX0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBoLT5i eXRlcG9zID0gSVRfQllURVBPUyAoKml0KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisK KwogICAgICAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9zaXRpb24pOwogICAgICAg Z2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAgICAgICBpZiAoaXQtPnBpeGVsX3dpZHRoID4g MCkKQEAgLTI3NDQyLDYgKzMyNDg3LDE3IEBAIGFwcGVuZF9jb21wb3NpdGVfZ2x5cGggKHN0cnVj dCBpdCAqaXQpCiAJICAgIGdbMV0gPSAqZzsKIAkgIGdseXBoID0gaXQtPmdseXBoX3Jvdy0+Z2x5 cGhzW2l0LT5hcmVhXTsKIAl9CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBn bHlwaC0+Ynl0ZXBvcyA9IElUX0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKICAgICAgIGdseXBoLT5jaGFycG9zID0gaXQtPmNtcF9pdC5jaGFycG9zOwogICAg ICAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAgICAgICBlYXNzZXJ0IChpdC0+cGl4ZWxf d2lkdGggPD0gU0hSVF9NQVgpOwpAQCAtMjc2NTAsNiArMzI3MDYsMTcgQEAgcHJvZHVjZV9pbWFn ZV9nbHlwaCAoc3RydWN0IGl0ICppdCkKIAl9CiAgICAgICBpZiAoZ2x5cGggPCBpdC0+Z2x5cGhf cm93LT5nbHlwaHNbYXJlYSArIDFdKQogCXsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsK KyAgICAgIGdseXBoLT5ieXRlcG9zID0gSVRfQllURVBPUyAoKml0KTsKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisKKwogCSAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9zaXRp b24pOwogCSAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAJICBnbHlwaC0+cGl4ZWxfd2lk dGggPSBjbGlwX3RvX2JvdW5kcyAoLTEsIGl0LT5waXhlbF93aWR0aCwgU0hSVF9NQVgpOwpAQCAt Mjc3NTMsNiArMzI4MjAsMTcgQEAgcHJvZHVjZV94d2lkZ2V0X2dseXBoIChzdHJ1Y3QgaXQgKml0 KQogCX0KICAgICAgIGlmIChnbHlwaCA8IGl0LT5nbHlwaF9yb3ctPmdseXBoc1thcmVhICsgMV0p CiAJeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAq LworCisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPmJ5dGVwb3Mg PSBJVF9CWVRFUE9TICgqaXQpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICBn bHlwaC0+Y2hhcnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAJICBnbHlwaC0+b2JqZWN0 ID0gaXQtPm9iamVjdDsKIAkgIGdseXBoLT5waXhlbF93aWR0aCA9IGNsaXBfdG9fYm91bmRzICgt MSwgaXQtPnBpeGVsX3dpZHRoLCBTSFJUX01BWCk7CkBAIC0yNzgzOSw2ICszMjkxNywxNyBAQCBh cHBlbmRfc3RyZXRjaF9nbHlwaCAoc3RydWN0IGl0ICppdCwgTGlzcF9PYmplY3Qgb2JqZWN0LAog CSAgICB3aWR0aCAtPSBpdC0+Zmlyc3RfdmlzaWJsZV94IC0gaXQtPmN1cnJlbnRfeDsKIAkgIGVh c3NlcnQgKHdpZHRoID4gMCk7CiAJfQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyog TVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAg ICAgZ2x5cGgtPmJ5dGVwb3MgPSBJVF9CWVRFUE9TICgqaXQpOworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKworCiAgICAgICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlv bik7CiAgICAgICBnbHlwaC0+b2JqZWN0ID0gb2JqZWN0OwogICAgICAgLyogRklYTUU6IEl0IHdv dWxkIGJlIGJldHRlciB0byB1c2UgVFlQRV9NQVggaGVyZSwgYnV0CkBAIC0yODI5Myw2ICszMzM4 MiwxNyBAQCBhcHBlbmRfZ2x5cGhsZXNzX2dseXBoIChzdHJ1Y3QgaXQgKml0LCBpbnQgZmFjZV9p ZCwgYm9vbCBmb3Jfbm9fZm9udCwgaW50IGxlbiwKIAkgICAgZ1sxXSA9ICpnOwogCSAgZ2x5cGgg PSBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJlYV07CiAJfQorCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+aHBvcyA9IGl0 LT5ocG9zOworICAgICAgZ2x5cGgtPmJ5dGVwb3MgPSBJVF9CWVRFUE9TICgqaXQpOworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1Mg KGl0LT5wb3NpdGlvbik7CiAgICAgICBnbHlwaC0+b2JqZWN0ID0gaXQtPm9iamVjdDsKICAgICAg IGVhc3NlcnQgKGl0LT5waXhlbF93aWR0aCA8PSBTSFJUX01BWCk7CkBAIC0yOTM0MywxMCArMzQ0 NDMsMjAgQEAgZ3VpX2luc2VydF9nbHlwaHMgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlw aF9yb3cgKnVwZGF0ZWRfcm93LAogCiAgIC8qIFdyaXRlIHRoZSBnbHlwaHMuICAqLwogICBocG9z ID0gc3RhcnQgLSByb3ctPmdseXBoc1t1cGRhdGVkX2FyZWFdOworCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlmICghbWNfcmVkcmF3X3Jv dyAodywgdy0+Y3VycmVudF9tYXRyaXgsIHJvdywgdXBkYXRlZF9hcmVhLCB3LT5vdXRwdXRfY3Vy c29yLngsCisgICAgICAgICAgICAgICAgICAgICAgaHBvcywgaHBvcyArIGxlbiwgZmFsc2UsIERS QVdfTk9STUFMX1RFWFQsIEdVSV9JTlNFUlRfR0xZUEhTKSkKICAgZHJhd19nbHlwaHMgKHcsIHct Pm91dHB1dF9jdXJzb3IueCwgcm93LCB1cGRhdGVkX2FyZWEsCiAJICAgICAgIGhwb3MsIGhwb3Mg KyBsZW4sCiAJICAgICAgIERSQVdfTk9STUFMX1RFWFQsIDApOwogCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKworCiAgIC8qIEFkdmFuY2UgdGhlIG91dHB1dCBjdXJzb3IuICAqLwogICB3LT5v dXRwdXRfY3Vyc29yLmhwb3MgKz0gbGVuOwogICB3LT5vdXRwdXRfY3Vyc29yLnggKz0gc2hpZnRf Ynlfd2lkdGg7CkBAIC0yOTc3Miw5ICszNDg4MiwxOSBAQCBndWlfZml4X292ZXJsYXBwaW5nX2Fy ZWEgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKIAkgIHdoaWxlIChp IDwgcm93LT51c2VkW2FyZWFdCiAJCSAmJiByb3ctPmdseXBoc1thcmVhXVtpXS5vdmVybGFwc192 ZXJ0aWNhbGx5X3ApOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUt Q1VSU09SUyAqLworCisgICAgICBpZiAoIW1jX3JlZHJhd19yb3cgKHcsIHctPmN1cnJlbnRfbWF0 cml4LCByb3csIGFyZWEsIHN0YXJ0X3gsIHN0YXJ0LCBpLAorICAgICAgICAgIGZhbHNlLCBEUkFX X05PUk1BTF9URVhULCBHVUlfRklYX09WRVJMQVBQSU5HX0FSRUEpKQogCSAgZHJhd19nbHlwaHMg KHcsIHN0YXJ0X3gsIHJvdywgYXJlYSwKIAkJICAgICAgIHN0YXJ0LCBpLAogCQkgICAgICAgRFJB V19OT1JNQUxfVEVYVCwgb3ZlcmxhcHMpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAJfQogICAgICAgZWxzZQogCXsKQEAgLTMwMDI1LDEwICszNTE0NSwxNyBAQCBkaXNwbGF5X2Fu ZF9zZXRfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIG9uLAogICBuZXdfY3Vyc29yX3R5 cGUgPSBnZXRfd2luZG93X2N1cnNvcl90eXBlICh3LCBnbHlwaCwKIAkJCQkJICAgICZuZXdfY3Vy c29yX3dpZHRoLCAmYWN0aXZlX2N1cnNvcik7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgLyogSWYgY3Vyc29yIGlzIGN1cnJlbnRseSBi ZWluZyBzaG93biBhbmQgd2UgZG9uJ3Qgd2FudCBpdCB0byBiZSBvcgogICAgICBpdCBpcyBpbiB0 aGUgd3JvbmcgcGxhY2UsIG9yIHRoZSBjdXJzb3IgdHlwZSBpcyBub3Qgd2hhdCB3ZSB3YW50LAog ICAgICBlcmFzZSBpdC4gICovCiAgIGlmICh3LT5waHlzX2N1cnNvcl9vbl9wCisgICAgICAmJiBO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgJiYg TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICYm IE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCiAgICAgICAmJiAo IW9uCiAJICB8fCB3LT5waHlzX2N1cnNvci54ICE9IHgKIAkgIHx8IHctPnBoeXNfY3Vyc29yLnkg IT0geQpAQCAtMzAwNDEsNiArMzUxNjgsOSBAQCBkaXNwbGF5X2FuZF9zZXRfY3Vyc29yIChzdHJ1 Y3Qgd2luZG93ICp3LCBib29sIG9uLAogCSAgICAgICYmIG5ld19jdXJzb3Jfd2lkdGggIT0gdy0+ cGh5c19jdXJzb3Jfd2lkdGgpKSkKICAgICBlcmFzZV9waHlzX2N1cnNvciAodyk7CiAKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICAgLyogRG9uJ3QgY2hlY2sgcGh5c19jdXJzb3Jfb25f cCBoZXJlIGJlY2F1c2UgdGhhdCBmbGFnIGlzIG9ubHkgc2V0CiAgICAgIHRvIGZhbHNlIGluIHNv bWUgY2FzZXMgd2hlcmUgd2Uga25vdyB0aGF0IHRoZSBjdXJzb3IgaGFzIGJlZW4KICAgICAgY29t cGxldGVseSBlcmFzZWQsIHRvIGF2b2lkIHRoZSBleHRyYSB3b3JrIG9mIGVyYXNpbmcgdGhlIGN1 cnNvcgpAQCAtMzAwNTksOSArMzUxODksMjAgQEAgZGlzcGxheV9hbmRfc2V0X2N1cnNvciAoc3Ry dWN0IHdpbmRvdyAqdywgYm9vbCBvbiwKICAgICAgIHctPnBoeXNfY3Vyc29yLnZwb3MgPSB2cG9z OwogICAgIH0KIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNP UlMgKi8KKworICBpZiAoTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hh aXJzKSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlz aWJsZSkpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2Nv bmYpKSkKICAgRlJBTUVfUklGIChmKS0+ZHJhd193aW5kb3dfY3Vyc29yICh3LCBnbHlwaF9yb3cs IHgsIHksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2N1cnNvcl90 eXBlLCBuZXdfY3Vyc29yX3dpZHRoLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIG9uLCBhY3RpdmVfY3Vyc29yKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog fQogCiAKQEAgLTMwMTU0LDcgKzM1Mjk1LDE4IEBAIGRyYXdfcm93X3dpdGhfbW91c2VfZmFjZSAo c3RydWN0IHdpbmRvdyAqdywgaW50IHN0YXJ0X3gsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKICNp ZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KICAgaWYgKEZSQU1FX1dJTkRPV19QIChYRlJBTUUgKHct PmZyYW1lKSkpCiAgICAgeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQ TEUtQ1VSU09SUyAqLworCisgICAgICBpZiAoIW1jX3JlZHJhd19yb3cgKHcsIHctPmN1cnJlbnRf bWF0cml4LCByb3csIFRFWFRfQVJFQSwgc3RhcnRfeCwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgc3RhcnRfaHBvcywgZW5kX2hwb3MsIGZhbHNlLCBkcmF3LCBEUkFXX1JPV19XSVRIX01PVVNF X0ZBQ0UpKQogICAgICAgZHJhd19nbHlwaHMgKHcsIHN0YXJ0X3gsIHJvdywgVEVYVF9BUkVBLCBz dGFydF9ocG9zLCBlbmRfaHBvcywgZHJhdywgMCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKICAgICAgIHJldHVybjsKICAgICB9CiAjZW5kaWYKQEAgLTMyMjE0LDExICszNzM2Niwy MyBAQCBleHBvc2VfYXJlYSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqcm93 LCBjb25zdCBFbWFjc19SZWN0YW5nbGUgKnIsCiAgIHN0cnVjdCBnbHlwaCAqbGFzdDsKICAgaW50 IGZpcnN0X3gsIHN0YXJ0X3gsIHg7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBN VUxUSVBMRS1DVVJTT1JTICovCisKICAgaWYgKGFyZWEgPT0gVEVYVF9BUkVBICYmIHJvdy0+Zmls bF9saW5lX3ApCisgICAgeworICAgICAgaWYgKCFtY19yZWRyYXdfcm93ICh3LCB3LT5jdXJyZW50 X21hdHJpeCwgcm93LCBhcmVhLCAwLCAwLCByb3ctPnVzZWRbYXJlYV0sCisgICAgICAgICAgICAg ICAgICAgICAgICAgIGZhbHNlLCBEUkFXX05PUk1BTF9URVhULCBFWFBPU0VfQVJFQV9PTkUpKQog ICAgIC8qIElmIHJvdyBleHRlbmRzIGZhY2UgdG8gZW5kIG9mIGxpbmUgd3JpdGUgdGhlIHdob2xl IGxpbmUuICAqLwogICAgIGRyYXdfZ2x5cGhzICh3LCAwLCByb3csIGFyZWEsCiAJCSAwLCByb3ct PnVzZWRbYXJlYV0sCiAJCSBEUkFXX05PUk1BTF9URVhULCAwKTsKKyAgICB9CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgZWxzZQogICAgIHsKICAgICAgIC8qIFNldCBTVEFSVF9Y IHRvIHRoZSB3aW5kb3ctcmVsYXRpdmUgc3RhcnQgcG9zaXRpb24gZm9yIGRyYXdpbmcgZ2x5cGhz IG9mCkBAIC0zMjI1MCwxMSArMzc0MTQsMjMgQEAgZXhwb3NlX2FyZWEgKHN0cnVjdCB3aW5kb3cg KncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgY29uc3QgRW1hY3NfUmVjdGFuZ2xlICpyLAogCSAg KytsYXN0OwogCX0KIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKwogICAgICAgLyogUmVwYWludC4gICovCi0gICAgICBpZiAobGFzdCA+IGZpcnN0 KQorICAgICAgLyogRmxvYXRpbmcgZmFrZSBjdXJzb3JzIHdpbGwgZXhpc3Qgd2hlbiAobGFzdCA9 PSBmaXJzdCkuICovCisgICAgICBpZiAoIW1jX3JlZHJhd19yb3cgKHcsIHctPmN1cnJlbnRfbWF0 cml4LCByb3csIGFyZWEsIGZpcnN0X3ggLSBzdGFydF94LAorICAgICAgICAgICAgICAgICAgICAg ICAgICBmaXJzdCAtIHJvdy0+Z2x5cGhzW2FyZWFdLCBsYXN0IC0gcm93LT5nbHlwaHNbYXJlYV0s CisgICAgICAgICAgICAgICAgICAgICAgICAgIGZhbHNlLCBEUkFXX05PUk1BTF9URVhULCBFWFBP U0VfQVJFQV9UV08pCisgICAgICAgICAgJiYgbGFzdCA+IGZpcnN0KQogCWRyYXdfZ2x5cGhzICh3 LCBmaXJzdF94IC0gc3RhcnRfeCwgcm93LCBhcmVhLAogCQkgICAgIGZpcnN0IC0gcm93LT5nbHlw aHNbYXJlYV0sIGxhc3QgLSByb3ctPmdseXBoc1thcmVhXSwKIAkJICAgICBEUkFXX05PUk1BTF9U RVhULCAwKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgIH0KIH0KIApAQCAt MzIyNjgsMTAgKzM3NDQ0LDIyIEBAIGV4cG9zZV9saW5lIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1 Y3QgZ2x5cGhfcm93ICpyb3csIGNvbnN0IEVtYWNzX1JlY3RhbmdsZSAqcikKIHsKICAgZWFzc2Vy dCAocm93LT5lbmFibGVkX3ApOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCiAgIGlmIChyb3ctPm1vZGVfbGluZV9wIHx8IHctPnBzZXVkb193 aW5kb3dfcCkKKyAgICB7CisgICAgICBpZiAoIW1jX3JlZHJhd19yb3cgKHcsIHctPmN1cnJlbnRf bWF0cml4LCByb3csIFRFWFRfQVJFQSwgMCwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg cm93LT51c2VkW1RFWFRfQVJFQV0sIGZhbHNlLCBEUkFXX05PUk1BTF9URVhULCBFWFBPU0VfTElO RSkpCiAgICAgZHJhd19nbHlwaHMgKHcsIDAsIHJvdywgVEVYVF9BUkVBLAogCQkgMCwgcm93LT51 c2VkW1RFWFRfQVJFQV0sCiAJCSBEUkFXX05PUk1BTF9URVhULCAwKTsKKyAgICB9CisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICAgZWxzZQogICAgIHsKICAgICAgIGlmIChyb3ctPnVz ZWRbTEVGVF9NQVJHSU5fQVJFQV0pCkBAIC0zMjgxOSw2ICszODAwNywyMiBAQCBndWlfaW50ZXJz ZWN0X3JlY3RhbmdsZXMgKGNvbnN0IEVtYWNzX1JlY3RhbmdsZSAqcjEsIGNvbnN0IEVtYWNzX1Jl Y3RhbmdsZSAqcjIsCiB2b2lkCiBzeW1zX29mX3hkaXNwICh2b2lkKQogeworCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGRlZnN1YnIgKCZT bWNfZHVtcF9nbHlwaF9yb3cpOworCisgIGRlZnN1YnIgKCZTbWNfZHVtcF9nbHlwaF9tYXRyaXgp OworCisgIGRlZnN1YnIgKCZTbWNfY3VycmVudF9jb2x1bW4pOworCisgIGRlZnN1YnIgKCZTbWNf c3RkZXJyKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBWd2l0aF9lY2hvX2Fy ZWFfc2F2ZV92ZWN0b3IgPSBRbmlsOwogICBzdGF0aWNwcm8gKCZWd2l0aF9lY2hvX2FyZWFfc2F2 ZV92ZWN0b3IpOwogCmRpZmYgLS1naXQgYS9zcmMveHRlcm0uYyBiL3NyYy94dGVybS5jCmluZGV4 IGM5NmFhNzQuLjdmOGYxYTAgMTAwNjQ0Ci0tLSBhL3NyYy94dGVybS5jCisrKyBiL3NyYy94dGVy bS5jCkBAIC0xMzIsNiArMTMyLD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AgICAgICAgeworICAgICAgICAgIGdjID0gWENyZWF0ZUdDIChkcHks IHdpbmRvdywgbWFzaywgJnhnY3YpOworICAgICAgICAgIEZSQU1FX0RJU1BMQVlfSU5GTyAoZikt PnNjcmF0Y2hfY3Vyc29yX2djID0gZ2M7CisgICAgICAgIH0KKyAgICAgIHhfY2xpcF90b19yb3cg KHcsIHJvdywgVEVYVF9BUkVBLCBnYyk7CisgICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChmLCBnYywg ZngsIGZ5LCB3ZCwgaCk7CisgICAgICB4X3Jlc2V0X2NsaXBfcmVjdGFuZ2xlcyAoZiwgZ2MpOwor ICAgIH0KK30KKworLyogUklGOiBEcmF3IGN1cnNvciBvbiB3aW5kb3cgVy4gKi8KK3N0YXRpYyB2 b2lkCittY194X2RyYXdfd2luZG93X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGds eXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAg ICAgICAgICAgICAgaW50IHgsIGludCBmeCwgaW50IHksIGludCBmeSwgaW50IGhwb3MsIGludCB2 cG9zLCBpbnQgd2QsCisgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGgsIHN0cnVjdCBtY19S R0IgbHNsLCBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAg ICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGgsIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciwg Ym9vbCBvbl9wLAorICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgYWN0aXZlX3ApCit7Cisg IHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7CisgIC8qIFRoZSBm cmluZ2UgYml0bWFwcyBhcmUgcHJlc2VudGx5IGhhbmRsZWQgZWxzZXdoZXJlLCBidXQgY291bGQg c29tZWRhe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Gl2ZV9mYWNl X2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNv ci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9s bG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQp OworICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBm LT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19hY3RpdmVfZmFjZS0+Zm9yZWdyb3Vu ZCk7CisgICAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiks IGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2Zh Y2UtPmJhY2tncm91bmQpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UgaWYg KHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcAorICAg ICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3MgPiByZWdpb25fYmVn CisgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+Y2hhcnBvcyA8IHJlZ2lv bl9lbmQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lk IGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNl ICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItaW4tcmVnaW9uLXByZS16di1mYWNl IiksIHRydWUpOworICAgICAgICAgICAgICAgICAgc3RydWN0I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AgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJz b3JfcGl4ZWw7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoY3Vyc29yX2dseXBoLT50eXBl ID09IElNQUdFX0dMWVBIICYmIGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wu Ymx1ZSA+PSAwKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFj ayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsJy4gKi8KKyAgICAgICAgICAgIGYtPm91 dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IGNvbG9yLnBpeGVsOworICAgICAgICAgICAgbWNf eF9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3Ms IHZwb3MsIHdkLCBoKTsKKyAgICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhl bCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgICB9CisgICAgICAgICAgZWxzZQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91 dHB1dF9kYXRhLngtPmN1cnNvcl9nYycgYnkgYm9ycm93aW5nIHRoZQorICAgICAgICAgICAgICBm dW5jdGlvbmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHhmbnMuYy4gKi8KKyAgICAgICAgICAgICAg aWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgJiYgYWN0aXZlX3AKKyAgICAg ICAgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+Y2hhcnBvcyA9PSByZWdpb25fYmVnKQorICAg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0 aXZlX3JlZ2lvbl9iZWdfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4g KCIrLXJlYWwtZmFrZS1jdXJzb3ItYXQtcmVnaW9uLXByZS16di1mYWNlIiksIHRydWUpOworICAg ICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfcmVnaW9uX2JlZ19mYWNl ID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZWdfZmFjZV9pZCk7Cisg ICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9v a3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1wcmUtenYt ZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0 aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAg ICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0 cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQpOwor ICAgICAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYt Pm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9yZWdpb25fYmVnX2ZhY2Ut PmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlm IChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcAor ICAgICAgICAgICAgICAgICAgICAgICAgIC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9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3MgPiByZWdpb25fYmVnCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3MgPCByZWdpb25fZW5kKQorICAgICAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxv d19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBm LCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItaW4tcmVnaW9uLXByZS16di1mYWNlIiksIHRy dWUpOworICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX3Jl Z2lvbl9iZXR3ZWVuX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfcmVnaW9u X2JldHdlZW5fZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhv bGxvd19hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIr LXJlYWwtZmFrZS1jdXJzb3ItcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAg ICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwg aG9sbG93X2FjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdy b3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBo b2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgICAgICAgIFhT ZXRCYWNrZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJz b3JfZ2MsIGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZS0+Zm9yZWdyb3VuZCk7Cisg ICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoYWN0aXZl X3ApCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgZW51 bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBm LCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAg ICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFD RV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAg ICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRh LngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAg ICAgICAgICAgICAgICAgIFhTZXRCYWNrZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5v dXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19hY3RpdmVfZmFjZS0+YmFja2dyb3VuZCk7 CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYg KCFhY3RpdmVfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25h bWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1wcmUt enYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2Ug KmhvbGxvd19pbmFjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfaW5hY3RpdmVf ZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChGUkFN RV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19pbmFj dGl2ZV9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgWFNldEJh Y2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9n YywgaG9sbG93X2luYWN0aXZlX2ZhY2UtPmJhY2tncm91bmQpOworICAgICAgICAgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgLyog Rm9yY2UgYG1jX3hfc2V0X2N1cnNvcl9nYycgdG8gdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS54LT5j dXJzb3JfZ2MnLiAqLworICAgICAgICAgICAgICBib29sIGN1cnNvcl9nY19wID0gdHJ1ZTsKKyAg ICAgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NV UlNPUiwgeCwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9wLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX2djX3ApOworICAgICAgICAgICAgICBY U2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vy c29yX2djLCB4Z2N2LmZvcmVncm91bmQpOworICAgICAgICAgICAgICBYU2V0QmFja2dyb3VuZCAo RlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCB4Z2N2LmJh Y2tncm91bmQpOworICAgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgICAgICAg ICAvKiBEcmF3IHRoZSBmcmFtZSBhcm91bmQgdGhlIGJveC4gKi8KKyAgICAgICAgICAgICAgbWNf eF9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3Ms IHZwb3MsIHdkLCBoKTsKKyAgICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBj YXNlIE1DX0hPTExPV19CT1g6CisgICAgeworICAgICAgaWYgKGxzbC5yZWQgPj0gMCAmJiBsc2wu Z3JlZW4gPj0gMCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVt cG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwnLiAqLworICAg ICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IGNvbG9yLnBpeGVsOworICAg ICAgICAgIG1jX3hfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHks IGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vy c29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVs c2UKKyAgICAgICAgICBtY194X2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgs IGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgYnJlYWs7CisgICAgfQorICAg IGNhc2UgTUNfRklMTEVEX0JPWDoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxz bC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhp amFjayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djJyBieSBib3Jyb3dpbmcgdGhlCisgICAg ICAgIGZ1bmN0aW9uYWxpdHkgb2YgYHhfbWFrZV9nYycgaW4geGZucy5jLiAqLworICAgICAgICB7 CisgICAgICAgICAgYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZS QU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgRlJBTUVfQkFD S0dST1VORF9QSVhFTCAoZikpOworICAgICAgICAgIFhTZXRCYWNrZ3JvdW5kIChGUkFNRV9YX0RJ U1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGNvbG9yLnBpeGVsKTsKKyAg ICAgICAgICAvKiBGb3JjZSBgbWNfeF9zZXRfY3Vyc29yX2djJyB0byB1c2UgYHMtPmYtPm91dHB1 dF9kYXRhLngtPmN1cnNvcl9nYycuICovCisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IHRy dWU7CisgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFX X0NVUlNPUiwgeCwgaHBvcywgdnBvcywgbHNsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsIGN1cnNvcl9nY19w KTsKKyAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0 cHV0X2RhdGEueC0+Y3Vyc29yX2djLCB4Z2N2LmZvcmVncm91bmQpOworICAgICAgICAgIFhTZXRC YWNrZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3Jf Z2MsIHhnY3YuYmFja2dyb3VuZCk7CisgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAg ICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3Jf Z2NfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJp eCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywgbHNsLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVf cCwgY3Vyc29yX2djX3ApOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBj YXNlIE1DX0JBUjoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+ PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3Jhcmls eSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCcuICovCisgICAgICAgICAg Zi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gY29sb3IucGl4ZWw7CisgICAgICAgICAg Ym9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IHRydWU7CisgICAgICAgICAgbWNfeF9k cmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3Ms IHdkLCBoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIE1D X0JBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIGYtPm91dHB1dF9k YXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQor ICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52 aXNpYmxlX29rYXlfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJzb3Ig KHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl93aWR0aCwgTUNfQkFSLCBjdXJzb3Jf Z2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQor ICAgIGNhc2UgTUNfSEJBUjoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5n cmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1w b3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCcuICovCisgICAg ICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gY29sb3IucGl4ZWw7CisgICAg ICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IHRydWU7CisgICAgICAgICAg bWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3Ms IHZwb3MsIHdkLCBoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lk dGgsIE1DX0hCQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICBmLT5v dXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAg ICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgY3Vyc29y X2djX2ludmlzaWJsZV9va2F5X3AgPSBmYWxzZTsKKyAgICAgICAgICAgIG1jX3hfZHJhd19iYXJf Y3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0hCQVIs IGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICB9CisgICAgICBicmVhazsK KyAgICB9CisgICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOworICB9CisgICAgICAg IH0KKyNpZmRlZiBIQVZFX1hfSTE4TgorICBpZiAodyA9PSBYV0lORE9XIChmLT5zZWxlY3RlZF93 aW5kb3cpKQorICAgIGlmIChGUkFNRV9YSUMgKGYpICYmIChGUkFNRV9YSUNfU1RZTEUgKGYpICYg WElNUHJlZWRpdFBvc2l0aW9uKSkKKyAgICAgIHhpY19zZXRfcHJlZWRpdGFyZWEgKHcsIHgsIHkp OworI2VuZGlmCisgICAgfQorICBYRmx1c2ggKEZSQU1FX1hfRElTUExBWSAoZikpOworfQorCisv KiBEcmF3IHN0cmV0Y2ggZ2x5cGggc3RyaW5nIFMuICovCitzdGF0aWMgdm9pZAorbWNfeF9kcmF3 X3N0cmV0Y2hfZ2x5cGhfc3RyaW5nIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzKQoreworICBlYXNz ZXJ0IChzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKTsKKyAgaWYgKHMtPmhs ID09IERSQVdfQ1VSU09SCisgICAgICAmJiAheF9zdHJldGNoX2N1cnNvcl9wKQorICAgIHsKKyAg ICAgIC8qIElmIGB4LXN0cmV0Y2gtY3Vyc29yJyBpcyBuaWwsIGRvbid0IGRyYXcgYSBibG9jayBj dXJzb3IgYXMgd2lkZSBhcyB0aGUKKyAgICAgIHN0cmV0Y2ggZ2x5cGguICovCisgICAgICBpbnQg d2lkdGgsIGJhY2tncm91bmRfd2lkdGggPSBzLT5iYWNrZ3JvdW5kX3dpZHRoOworICAgICAgaW50 IHggPSBzLT54OworICAgICAgaWYgKCFzLT5yb3ctPnJldmVyc2VkX3ApCisgICAgICAgIHsKKyAg ICAgICAgICBpbnQgbGVmdF94ID0gd2luZG93X2JveF9sZWZ0X29mZnNldCAocy0+dywgVEVYVF9B UkVBKTsKKyAgICAgICAgICBpZiAoeCA8IGxlZnRfeCkKKyAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgYmFja2dyb3VuZF93aWR0aCAtPSBsZWZ0X3ggLSB4OworICAgICAgICAgICAgICB4ID0g bGVmdF94OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAg ICB7CisgICAgICAgICAgICAvKiBJbiBSMkwgcm93cywgZHJhdyB0aGUgY3Vyc29yIG9uIHRoZSBy aWdodCBlZGdlIG9mIHRoZQorICAgICAgICAgICAgICAgc3RyZXRjaCBnbHlwaC4gKi8KKyAgICAg ICAgICAgIGludCByaWdodF94ID0gd2luZG93X2JveF9yaWdodCAocy0+dywgVEVYVF9BUkVBKTsK KyAgICAgICAgICAgIGlmICh4ICsgYmFja2dyb3VuZF93aWR0aCA+IHJpZ2h0X3gpCisgICAgICAg ICAgICAgIGJhY2tncm91bmRfd2lkdGggLT0geCAtIHJpZ2h0X3g7CisgICAgICAgICAgICB4ICs9 IGJhY2tncm91bmRfd2lkdGg7CisgICAgICAgICAgfQorICAgICAgd2lkdGggPSBtaW4gKEZSQU1F X0NPTFVNTl9XSURUSCAocy0+ZiksIGJhY2tncm91bmRfd2lkdGgpOworICAgICAgaWYgKHMtPnJv dy0+cmV2ZXJzZWRfcCkKKyAgICAgICAgeCAtPSB3aWR0aDsKKyAgICAgIC8qIERyYXcgY3Vyc29y LiAqLworICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19iZ19yZWN0IChzLCB4LCBzLT55LCB3aWR0 aCwgcy0+aGVpZ2h0KTsKKyAgICAgIC8qIENsZWFyIHJlc3QgdXNpbmcgdGhlIEdDIG9mIHRoZSBv cmlnaW5hbCBub24tY3Vyc29yIGZhY2UuICovCisgICAgICBpZiAod2lkdGggPCBiYWNrZ3JvdW5k X3dpZHRoKQorICAgICAgICB7CisgICAgICAgICAgaW50IHkgPSBzLT55OworICAgICAgICAgIGlu dCB3ID0gYmFja2dyb3VuZF93aWR0aCAtIHdpZHRoLCBoID0gcy0+aGVpZ2h0OworICAgICAgICAg IFhSZWN0YW5nbGUgcjsKKyAgICAgICAgICBHQyBnYzsKKyAgICAgICAgICBpZiAoIXMtPnJvdy0+ cmV2ZXJzZWRfcCkKKyAgICAgICAgICAgIHggKz0gd2lkdGg7CisgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgeCA9IHMtPng7CisgICAgICAgICAgaWYgKHMtPnJvdy0+bW91c2VfZmFjZV9wCisg ICAgICAgICAgICAgICYmIGN1cnNvcl9pbl9tb3VzZV9mYWNlX3AgKHMtPncpKQorICAgICAgICAg ICAgeworICAgICAgICAgICAgICB4X3NldF9tb3VzZV9mYWNlX2djIChzKTsKKyAgICAgICAgICAg ICAgZ2MgPSBzLT5nYzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAg ICBnYyA9IHMtPmZhY2UtPmdjOworICAgICAgICAgIGdldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0 IChzLCAmcik7CisgICAgICAgICAgeF9zZXRfY2xpcF9yZWN0YW5nbGVzIChzLT5mLCBnYywgJnIs IDEpOworICAgICAgICAgIGlmIChzLT5mYWNlLT5zdGlwcGxlKQorICAgICAgICAgICAgeworICAg ICAgICAgICAgICAvKiBGaWxsIGJhY2tncm91bmQgd2l0aCBhIHN0aXBwbGUgcGF0dGVybi4gKi8K KyAgICAgICAgICAgICAgWFNldEZpbGxTdHlsZSAoRlJBTUVfWF9ESVNQTEFZIChzLT5mKSwgZ2Ms IEZpbGxPcGFxdWVTdGlwcGxlZCk7CisgICAgICAgICAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMt PmYsIGdjLCB4LCB5LCB3LCBoKTsKKyAgICAgICAgICAgICAgWFNldEZpbGxTdHlsZSAoRlJBTUVf WF9ESVNQTEFZIChzLT5mKSwgZ2MsIEZpbGxTb2xpZCk7CisgICAgICAgICAgICB9CisgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBYR0NWYWx1ZXMgeGdjdjsKKyAg ICAgICAgICAgICAgWEdldEdDVmFsdWVzIChGUkFNRV9YX0RJU1BMQVkgKHMtPmYpLCBnYywgR0NG b3JlZ3JvdW5kIHwgR0NCYWNrZ3JvdW5kLCAmeGdjdik7CisgICAgICAgICAgICAgIFhTZXRGb3Jl Z3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKHMtPmYpLCBnYywgeGdjdi5iYWNrZ3JvdW5kKTsKKyAg ICAgICAgICAgICAgeF9maWxsX3JlY3RhbmdsZSAocy0+ZiwgZ2MsIHgsIHksIHcsIGgpOworICAg ICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChzLT5mKSwgZ2MsIHhn Y3YuZm9yZWdyb3VuZCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgeF9yZXNldF9jbGlwX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AgIGlmIChu ZXh0LT5maXJzdF9nbHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKQorICAgICAgICAgICAgICBt Y194X2RyYXdfc3RyZXRjaF9nbHlwaF9zdHJpbmcgKG5leHQpOworICAgICAgICAgICAgZWxzZQor ICAgICAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKG5leHQsIHRydWUp OworICAgICAgICAgICAgbmV4dC0+bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICB9CisgICAgfQor ICAvKiBTZXQgdXAgUy0+Z2MsIHNldCBjbGlwcGluZyBhbmQgZHJhdyBTLiAqLworICBtY194X3Nl dF9nbHlwaF9zdHJpbmdfZ2MgKHMsIGN1cnNvcl9nY19wKTsKKyAgLyogRHJhdyByZWxpZWYgKGlm IGFueSkgaW4gYWR2YW5jZSBmb3IgY2hhci9jb21wb3NpdGlvbiBzbyB0aGF0IHRoZQorICAgICBn bHlwaCBzdHJpbmcgY2FuIGJlIGRyYXduIG92ZXIgaXQuICovCisgIGlmICghcy0+Zm9yX292ZXJs YXBzCisgICAgICAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gKKyAgICAgICYmIChzLT5m aXJzdF9nbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAgICAgfHwgcy0+Zmlyc3RfZ2x5 cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKSkKKyAgICB7CisgICAgICB4X3NldF9nbHlwaF9z dHJpbmdfY2xpcHBpbmcgKHMpOworICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19iYWNrZ3JvdW5k IChzLCB0cnVlKTsKKyAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYm94IChzKTsKKyAgICAgIHhf c2V0X2dseXBoX3N0cmluZ19jbGlwcGluZyAocyk7CisgICAgICByZWxpZWZfZHJhd25fcCA9IHRy dWU7CisgICAgfQorICAgIGVsc2UgaWYgKCFzLT5jbGlwX2hlYWQgLyogZHJhd19nbHlwaHMgZGlk bid0IHNwZWNpZnkgYSBjbGlwIG1hc2suICovCisgICAgICAgICAgICAgJiYgIXMtPmNsaXBfdGFp bAorICAgICAgICAgICAgICYmICgocy0+cHJldiAmJiBzLT5wcmV2LT5obCAhPSBzLT5obCAmJiBz LT5sZWZ0X292ZXJoYW5nKQorICAgICAgICAgICAgICAgICB8fCAocy0+bmV4dCAmJiBzLT5uZXh0 LT5obCAhPSBzLT5obCAmJiBzLT5yaWdodF9vdmVyaGFuZykpKQorICAgICAgLyogV2UgbXVzdCBj bGlwIGp1c3QgdGhpcyBnbHlwaC4gIGxlZnRfb3ZlcmhhbmcgcGFydCBoYXMgYWxyZWFkeQorICAg ICAgICAgZHJhd24gd2hlbiBzLT5wcmV2IHdhcyBkcmF3biwgYW5kIHJpZ2h0X292ZXJoYW5nIHBh cnQgd2lsbCBiZQorICAgICAgICAgZHJhd24gbGF0ZXIgd2hlbiBzLT5uZXh0IGlzIGRyYXduLiAq LworICAgICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nX2V4YWN0bHkgKHMsIHMpOworICAg ICAgZWxzZQorICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmcgKHMpOworICBzd2l0 Y2ggKHMtPmZpcnN0X2dseXBoLT50eXBlKQorICAgIHsKKyAgICBjYXNlIElNQUdFX0dMWVBIOgor ICAgICAgeF9kcmF3X2ltYWdlX2dseXBoX3N0cmluZyAocyk7CisgICAgICBicmVhazsKKyAgICBj YXNlIFhXSURHRVRfR0xZUEg6CisgICAgICB4X2RyYXdfeHdpZGdldF9nbHlwaF9zdHJpbmcgKHMp OworICAgICAgYnJlYWs7CisgICAgY2FzZSBTVFJFVENIX0dMWVBIOgorICAgICAgbWNfeF9kcmF3 X3N0cmV0Y2hfZ2x5cGhfc3RyaW5nIChzKTsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgQ0hBUl9H TFlQSDoKKyAgICAgIGlmIChzLT5mb3Jfb3ZlcmxhcHMpCisgICAgICAgIHMtPmJhY2tncm91bmRf ZmlsbGVkX3AgPSB0cnVlOworICAgICAgZWxzZQorICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5n X2JhY2tncm91bmQgKHMsIGZhbHNlKTsKKyAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfZm9yZWdy b3VuZCAocyk7CisgICAgICBicmVhazsKKyAgICBjYXNlIENPTVBPU0lURV9HTFlQSDoKKyAgICAg IGlmIChzLT5mb3Jfb3ZlcmxhcHMgfHwgKHMtPmNtcF9mcm9tID4gMAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgISBzLT5maXJzdF9nbHlwaC0+dS5jbXAuYXV0b21hdGljKSkKKyAg ICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICBlbHNlCisgICAgICAg IHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgdHJ1ZSk7CisgICAgICB4X2RyYXdf Y29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAgICAgIGJyZWFrOworICAg IGNhc2UgR0xZUEhMRVNTX0dMWVBIOgorICAgICAgaWYgKHMtPmZvcl9vdmVybGFwcykKKyAgICAg ICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICBlbHNlCisgICAgICAgIHhf ZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgdHJ1ZSk7CisgICAgICB4X2RyYXdfZ2x5 cGhsZXNzX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAgICAgIGJyZWFrOworICAgIGRl ZmF1bHQ6CisgICAgICBlbWFjc19hYm9ydCAoKTsKKyAgICB9CisgIGlmICghcy0+Zm9yX292ZXJs YXBzKQorICAgIHsKKyAgICAgIC8qIERyYXcgdW5kZXJsaW5lLiAqLworICAgICAgaWYgKHMtPmZh Y2UtPnVuZGVybGluZV9wKQorICAgICAgICB7CisgICAgICAgICAgaWYgKHMtPmZhY2UtPnVuZGVy bGluZV90eXBlID09IEZBQ0VfVU5ERVJfV0FWRSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICB4 X2RyYXdfdW5kZXJ3YXZlIChzKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgIFhHQ1ZhbHVlcyB4Z2N2OworICAgICAgICAgICAgICAgICAg WEdldEdDVmFsdWVzIChGUkFNRV9YX0RJU1BMQVkgKHMtPmYpLCBzLT5nYywgR0NGb3JlZ3JvdW5k LCAmeGdjdik7CisgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQ TEFZIChzLT5mKSwgcy0+Z2MsIHMtPmZhY2UtPnVuZGVybGluZV9jb2xvcik7CisgICAgICAgICAg ICAgICAgICB4X2RyYXdfdW5kZXJ3YXZlIChzKTsKKyAgICAgICAgICAgICAgICAgIFhTZXRGb3Jl Z3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKHMtPmYpLCBzLT5nYywgeGdjdi5mb3JlZ3JvdW5kKTsK KyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxzZSBpZiAocy0+ ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIHRoaWNrbmVzcywgcG9zaXRpb247CisgICAgICAg ICAgICAgIGludCB5OworICAgICAgICAgICAgICBpZiAocy0+cHJldiAmJiBzLT5wcmV2LT5mYWNl LT51bmRlcmxpbmVfcAorICAgICAgICAgICAgICAgICAgJiYgcy0+cHJldi0+ZmFjZS0+dW5kZXJs aW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAgIC8qIFdlIHVzZSB0aGUgc2FtZSB1bmRlcmxpbmUgc3R5bGUgYXMgdGhlIHByZXZp b3VzIG9uZS4gKi8KKyAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPnByZXYtPnVuZGVy bGluZV90aGlja25lc3M7CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPnByZXYtPnVu ZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVybGlu ZSB0aGlja25lc3MuICBEZWZhdWx0IGlzIDEgcGl4ZWwuICovCisgICAgICAgICAgICAgICAgICBp ZiAocy0+Zm9udCAmJiBzLT5mb250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4gMCkKKyAgICAgICAg ICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAg ICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gMTsK KyAgICAgICAgICAgICAgICAgIGlmICh4X3VuZGVybGluZV9hdF9kZXNjZW50X2xpbmUpCisgICAg ICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmhlaWdodCAtIHRoaWNrbmVzcykgLSAocy0+ eWJhc2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJsaW5lIHBvc2l0aW9u LiAgVGhpcyBpcyB0aGUgcmVjb21tZW5kZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICB2ZXJ0 aWNhbCBvZmZzZXQgaW4gcGl4ZWxzIGZyb20gdGhlIGJhc2VsaW5lIHRvIHRoZSB0b3Agb2YKKyAg ICAgICAgICAgICAgICAgICAgICAgICB0aGUgdW5kZXJsaW5lLiAgVGhpcyBpcyBhIHNpZ25lZCB2 YWx1ZSBhY2NvcmRpbmcgdG8gdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgc3BlY3MsIGFu ZCBpdHMgZGVmYXVsdCBpcworICAgICAgICAgICAgICAgICAgICAgICAgIFJPVU5EICgobWF4aW11 bSBkZXNjZW50KSAvIDIpLCB3aXRoCisgICAgICAgICAgICAgICAgICAgICAgICAgUk9VTkQoeCkg PSBmbG9vciAoeCArIDAuNSkgICovCisgICAgICAgICAgICAgICAgICAgICAgaWYgKHhfdXNlX3Vu ZGVybGluZV9wb3NpdGlvbl9wcm9wZXJ0aWVzCisgICAgICAgICAgICAgICAgICAgICAgICAgICYm IHMtPmZvbnQgJiYgcy0+Zm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uID49IDApCisgICAgICAgICAg ICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPmZvbnQtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAg ICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChzLT5mb250KQorICAgICAgICAgICAgICAgICAg ICAgICAgcG9zaXRpb24gPSAocy0+Zm9udC0+ZGVzY2VudCArIDEpIC8gMjsKKyAgICAgICAgICAg ICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHVuZGVy bGluZV9taW5pbXVtX29mZnNldDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICAgICAgcG9zaXRpb24gPSBtYXggKHBvc2l0aW9uLCB1bmRlcmxpbmVfbWluaW11bV9vZmZzZXQp OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgLyogQ2hlY2sgdGhlIHNhbml0eSBv ZiB0aGlja25lc3MgYW5kIHBvc2l0aW9uLiAgV2Ugc2hvdWxkCisgICAgICAgICAgICAgICAgIGF2 b2lkIGRyYXdpbmcgdW5kZXJsaW5lIG91dCBvZiB0aGUgY3VycmVudCBsaW5lIGFyZWEuICovCisg ICAgICAgICAgICAgIGlmIChzLT55ICsgcy0+aGVpZ2h0IDw9IHMtPnliYXNlICsgcG9zaXRpb24p CisgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+aGVpZ2h0IC0gMSkgLSAocy0+eWJhc2Ug LSBzLT55KTsKKyAgICAgICAgICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQgPCBzLT55YmFzZSAr IHBvc2l0aW9uICsgdGhpY2tuZXNzKQorICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IChzLT55 ICsgcy0+aGVpZ2h0KSAtIChzLT55YmFzZSArIHBvc2l0aW9uKTsKKyAgICAgICAgICAgICAgcy0+ dW5kZXJsaW5lX3RoaWNrbmVzcyA9IHRoaWNrbmVzczsKKyAgICAgICAgICAgICAgcy0+dW5kZXJs aW5lX3Bvc2l0aW9uID0gcG9zaXRpb247CisgICAgICAgICAgICAgIHkgPSBzLT55YmFzZSArIHBv c2l0aW9uOworICAgICAgICAgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX2RlZmF1bHRlZF9w KQorICAgICAgICAgICAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCB5 LCBzLT53aWR0aCwgdGhpY2tuZXNzKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgIFhHQ1ZhbHVlcyB4Z2N2OworICAgICAgICAgICAgICAg ICAgWEdldEdDVmFsdWVzIChGUkFNRV9YX0RJU1BMQVkgKHMtPmYpLCBzLT5nYywgR0NGb3JlZ3Jv dW5kLCAmeGdjdik7CisgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9E SVNQTEFZIChzLT5m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5ZXQgZHJhd24uICovCisgICAgICBpZiAoIXJlbGllZl9kcmF3bl9wICYmIHMtPmZh Y2UtPmJveCAhPSBGQUNFX05PX0JPWCkKKyAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2Jv eCAocyk7CisgICAgICBpZiAocy0+cHJldikKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBn bHlwaF9zdHJpbmcgKnByZXY7CisgICAgICAgICAgZm9yIChwcmV2ID0gcy0+cHJldjsgcHJldjsg cHJldiA9IHByZXYtPnByZXYpCisgICAgICAgICAgICBpZiAocHJldi0+aGwgIT0gcy0+aGwKKyAg ICAgICAgICAgICAgICAmJiBwcmV2LT54ICsgcHJldi0+d2lkdGggKyBwcmV2LT5yaWdodF9vdmVy aGFuZyA+IHMtPngpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBBcyBwcmV2 IHdhcyBkcmF3biB3aGlsZSBjbGlwcGVkIHRvIGl0cyBvd24gYXJlYSwgd2UKKyAgICAgICAgICAg ICAgICAgICBtdXN0IGRyYXcgdGhlIHJpZ2h0X292ZXJoYW5nIHBhcnQgdXNpbmcgcy0+aGwgbm93 LiAqLworICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBzYXZlID0gcHJldi0+ aGw7CisgICAgICAgICAgICAgICAgcHJldi0+aGwgPSBzLT5obDsKKyAgICAgICAgICAgICAgICBt Y194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKHByZXYsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICAg ICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywgcHJldik7CisgICAg ICAgICAgICAgICAgaWYgKHByZXYtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgpCisg ICAgICAgICAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHByZXYpOwor ICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIHhfZHJhd19jb21wb3NpdGVf Z2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHByZXYpOworICAgICAgICAgICAgICAgIHhfcmVzZXRf Y2xpcF9yZWN0YW5nbGVzIChwcmV2LT5mLCBwcmV2LT5nYyk7CisgICAgICAgICAgICAgICAgcHJl di0+aGwgPSBzYXZlOworICAgICAgICAgICAgICAgIHByZXYtPm51bV9jbGlwcyA9IDA7CisgICAg ICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKHMtPm5leHQpCisgICAgICAgIHsKKyAg ICAgICAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpuZXh0OworICAgICAgICAgIGZvciAobmV4dCA9 IHMtPm5leHQ7IG5leHQ7IG5leHQgPSBuZXh0LT5uZXh0KQorICAgICAgICAgICAgaWYgKG5leHQt PmhsICE9IHMtPmhsCisgICAgICAgICAgICAgICAgJiYgbmV4dC0+eCAtIG5leHQtPmxlZnRfb3Zl cmhhbmcgPCBzLT54ICsgcy0+d2lkdGgpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg ICAvKiBBcyBuZXh0IHdpbGwgYmUgZHJhd24gd2hpbGUgY2xpcHBlZCB0byBpdHMgb3duIGFyZWEs CisgICAgICAgICAgICAgICAgICAgd2UgbXVzdCBkcmF3IHRoZSBsZWZ0X292ZXJoYW5nIHBhcnQg dXNpbmcgcy0+aGwgbm93LiAqLworICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFj ZSBzYXZlID0gbmV4dC0+aGw7CisgICAgICAgICAgICAgICAgbmV4dC0+aGwgPSBzLT5obDsKKyAg ICAgICAgICAgICAgICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKG5leHQsIGN1cnNvcl9nY19w KTsKKyAgICAgICAgICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAo cywgbmV4dCk7CisgICAgICAgICAgICAgICAgaWYgKG5leHQtPmZpcnN0X2dseXBoLT50eXBlID09 IENIQVJfR0xZUEgpCisgICAgICAgICAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVn cm91bmQgKG5leHQpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIHhf ZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5leHQpOworICAgICAgICAg ICAgICAgIHhfcmVzZXRfY2xpcF9yZWN0YW5nbGVzIChuZXh0LT5mLCBuZXh0LT5nYyk7CisgICAg ICAgICAgICAgICAgbmV4dC0+aGwgPSBzYXZlOworICAgICAgICAgICAgICAgIG5leHQtPm51bV9j bGlwcyA9IDA7CisgICAgICAgICAgICAgICAgbmV4dC0+Y2xpcF9oZWFkID0gcy0+bmV4dDsKKyAg ICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAvKiBSZXNldCBjbGlwcGluZy4gKi8K KyAgeF9yZXNldF9jbGlwX3JlY3RhbmdsZXMgKHMtPmYsIHMtPmdjKTsKKyAgcy0+bnVtX2NsaXBz ID0gMDsKK30KKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworCisKIC8qIERlZmF1bHQgdG8gdXNpbmcgWElNIGlmIGF2YWlsYWJsZS4gICovCiAj aWZkZWYgVVNFX1hJTQogYm9vbCB1c2VfeGltID0gdHJ1ZTsKQEAgLTExMDksNiArMjAwNywxNiBA QCBzdGF0aWMgdm9pZAogeF91cGRhdGVfYmVnaW4gKHN0cnVjdCBmcmFtZSAqZikKIHsKICAgLyog Tm90aGluZyB0byBkby4gICovCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBmOworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKworCiB9CiAKIC8qIERyYXcgYSB2ZXJ0aWNhbCB3aW5kb3cgYm9y ZGVyIGZyb20gKHgseTApIHRvICh4LHkxKSAgKi8KQEAgLTEyNTQsNiArMjE2MiwxNiBAQCB4X3Vw ZGF0ZV9lbmQgKHN0cnVjdCBmcmFtZSAqZikKICAgWEZsdXNoIChGUkFNRV9YX0RJU1BMQVkgKGYp KTsKICAgdW5ibG9ja19pbnB1dCAoKTsKICNlbmRpZgorCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0g TlVMTDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAvKiBUaGlzIGZ1bmN0 aW9uIGlzIGNhbGxlZCBmcm9tIHZhcmlvdXMgcGxhY2VzIGluIHhkaXNwLmMKQEAgLTEzMjM4LDYg KzE0MTU2LDIwIEBAIGV4dGVybiBmcmFtZV9wYXJtX2hhbmRsZXIgeF9mcmFtZV9wYXJtX2hhbmRs ZXJzW107CiAKIHN0YXRpYyBzdHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFjZSB4X3JlZGlzcGxheV9p bnRlcmZhY2UgPQogICB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKKy8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgeHRlcm0uY2AgbXVz dCBiZSBpbiB0aGUgZXhhY3Qgc2FtZSBvcmRlciBhcyB0aGUKK2ByZWRpc3BsYXlfaW50ZXJmYWNl JyBpbiBgZGlzcGV4dGVybi5oYCEgKi8KKworICBtY194X2RyYXdfd2luZG93X2N1cnNvciwKKyAg bWNfeF9kcmF3X2dseXBoX3N0cmluZywKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog ICAgIHhfZnJhbWVfcGFybV9oYW5kbGVycywKICAgICBndWlfcHJvZHVjZV9nbHlwaHMsCiAgICAg Z3VpX3dyaXRlX2dseXBocywK --Multipart_Thu_Oct_17_14:08:08_2019-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs / fill-column). References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 18 Oct 2019 01:15:02 +0000 Resent-Message-ID: <handler.22873.B22873.157136125531306 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22873 <at> debbugs.gnu.org,17684 <at> debbugs.gnu.org Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.157136125531306 (code B ref 22873); Fri, 18 Oct 2019 01:15:02 +0000 Received: (at 22873) by debbugs.gnu.org; 18 Oct 2019 01:14:15 +0000 Received: from localhost ([127.0.0.1]:49076 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1iLGqM-00088s-Ua for submit <at> debbugs.gnu.org; Thu, 17 Oct 2019 21:14:15 -0400 Received: from [192.185.51.228] (port=30506 helo=gateway24.websitewelcome.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1iLGqJ-00088j-QZ for 22873 <at> debbugs.gnu.org; Thu, 17 Oct 2019 21:14:13 -0400 Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway24.websitewelcome.com (Postfix) with ESMTP id AA4B363FA8 for <22873 <at> debbugs.gnu.org>; Thu, 17 Oct 2019 20:12:40 -0500 (CDT) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id LGoqi2tcPW4frLGoqicEaE; Thu, 17 Oct 2019 20:12:40 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:To:From:Message-ID:Date: Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=C44tEBrjTXon1j9gP2S4zh1i4h92r1n+3XmcjDuEiqQ=; b=Sn+trgEvY6zL5qCB1njbSu8Hkn RtIqc4z76ErCw2cdQptuyHBzYYrpOZnuu/gZZpL4LTj8fXugFM9ZIN5dIHojfce5t9wN/2wa4jMNT PKPMNbEZy/VAN4WQDr/m0YV+soCoKRz0nQCy/YMA4yUfdh2aXC6aFP3zqL4BB+lrRyxt1omHRpn3Q O2HK9CX6ZOFi1P6zMTz/WZyjZRbSs/qP+69pwqBqNjmo3r+2O01zPoPkP7tNC3xNSv46Z55RJbpFJ hxfCEQL0wFzxuDnSEQklBKMmb9fFDgG5xVWj5EIkyCnpTz1xrVTQXjBAgMkN6sG7fd40T4/o9NFPU y5n2WfIg==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:49273 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from <esq@HIDDEN>) id 1iLGom-000IYQ-Hp; Thu, 17 Oct 2019 20:12:39 -0500 Date: Thu, 17 Oct 2019 18:12:35 -0700 Message-ID: <m24l067t6k.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Thu_Oct_17_18:12:35_2019-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1iLGom-000IYQ-Hp X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:49273 X-Source-Auth: lawlist X-Email-Count: 2 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> --Multipart_Thu_Oct_17_18:12:35_2019-1 Content-Type: text/plain; charset=US-ASCII VERSION: 022.004 [10/17/2019] See previous post: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22873#170 The attached patch supersedes the patch attached to the previous post. This new patch contains the modification to display_and_set_cursor, which is described in the CHANGELOG section. --Multipart_Thu_Oct_17_18:12:35_2019-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="2019_10_17__18_06_25_414.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvY3Jvc3NoYWlycy5lbCBiL2xpc3AvY3Jvc3NoYWlycy5lbApuZXcg ZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5kMDlhMTMyCi0tLSAvZGV2L251bGwKKysr IGIvbGlzcC9jcm9zc2hhaXJzLmVsCkBAIC0wLDAgKzEsMTI4NCBAQAorOzs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Cis7OzsgQkVHSU4gbW9kaWZpY2F0aW9uIG9mIHRoZSBNdWx0aXBsZSBDdXJzb3Jz IGxpYnJhcnkgd3JpdHRlbiBieSAgTWFnbmFyIFN2ZWVuLgorCisoZGVmdmFyIHBhY2thZ2UtYXJj aGl2ZXMpCisKKyhkZWZ2YXIgbWMtLW1heC1jdXJzb3JzLW9yaWdpbmFsKQorKGRlZnZhciBtYy9t YXgtY3Vyc29ycykKKyhkZWZ2YXIgbWMtLW1heC1jdXJzb3JzLW9yaWdpbmFsKQorKGRlZnZhciBt Yy9tYXgtY3Vyc29ycykKKyhkZWZ2YXIgbWMvYWx3YXlzLXJ1bi1mb3ItYWx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cnNvcnMpCisgICAgICAgIChpZiAoeWVzLW9yLW5vLXAgKGZvcm1hdCAiJWQgYWN0aXZlIGN1 cnNvcnMuIENvbnRpbnVlPyAiIChtYy9udW0tY3Vyc29ycykpKQorICAgICAgICAgICAgKHNldHEg bWMvbWF4LWN1cnNvcnMgKHJlYWQtbnVtYmVyICJFbnRlciBhIG5ldywgdGVtcG9yYXJ5IG1heGlt dW06ICIpKQorICAgICAgICAgIChtYy9yZW1vdmUtZmFrZS1jdXJzb3JzKQorICAgICAgICAgIChl cnJvciAiQWJvcnRlZDogdG9vIG1hbnkgY3Vyc29ycyIpKSkpCisgICAgKGxldCAoKG92ZXJsYXkK KyAgICAgICAgICAgIChpZiBtYy91c2UtYnVpbHQtaW4tY3Vyc29ycworICAgICAgICAgICAgICAo bWFrZS1vdmVybGF5IChwb2ludCkgKHBvaW50KSkKKyAgICAgICAgICAgICAgKG1jL21ha2UtY3Vy c29yLW92ZXJsYXktYXQtcG9pbnQpKSkpCisgICAgICAob3ZlcmxheS1wdXQgb3ZlcmxheSAnbWMt aWQgKG9yIGlkIChtYy9jcmVhdGUtY3Vyc29yLWlkKSkpCisgICAgICAob3ZlcmxheS1wdXQgb3Zl cmxheSAndHlwZSAnZmFrZS1jdXJzb3IpCisgICAgICAob3ZlcmxheS1wdXQgb3ZlcmxheSAncHJp b3JpdHkgMTAwKQorICAgICAgKG1jL3N0b3JlLWN1cnJlbnQtc3RhdGUtaW4tb3ZlcmxheSBvdmVy bGF5KQorICAgICAgKHdoZW4gKHVzZS1yZWdpb24tcCkKKyAgICAgICAgKG92ZXJsYXktcHV0IG92 ZXJsYXkgJ3JlZ2lvbi1vdmVybGF5CisgICAgICAgICAgICAgICAgICAgICAobWMvbWFrZS1yZWdp b24tb3ZlcmxheS1iZXR3ZWVuLXBvaW50LWFuZC1tYXJrKSkpCisgICAgICBvdmVybGF5KSkKKwor ICAoZGVmdW4gbWMvZXhlY3V0ZS1jb21tYW5kLWZvci1hbGwtZmFrZS1jd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IC0gd2UnbGwgaGFuZGxl IHRob3NlIGxhdGVyIGluc3RlYWQuCisgICAgICAgICAgICAod2hlbiAoZnVuY3Rpb25wIG9yaWdp bmFsLWNvbW1hbmQpCisgICAgICAgICAgICAgIDs7IGlmIGl0J3MgYSBsYW1iZGEsIHdlIGNhbid0 IGtub3cgaWYgaXQncyBzdXBwb3J0ZWQgb3Igbm90CisgICAgICAgICAgICAgIDs7IC0gc28gZ28g YWhlYWQgYW5kIGFzc3VtZSBpdCdzIG9rLCBiZWNhdXNlIHdlJ3JlIGp1c3Qgb3B0aW1pc3RpYyBs aWtlIHRoYXQKKyAgICAgICAgICAgICAgKGlmIChvciAobm90IChzeW1ib2xwIG9yaWdpbmFsLWNv bW1hbmQpKQorICAgICAgICAgICAgICAgICAgICAgIDs7IGxhbWJkYSByZWdpc3RlcmVkIGJ5IHNt YXJ0cmVwCisgICAgICAgICAgICAgICAgICAgICAgKHN0cmluZy1wcmVmaXgtcCAiKCIgKHN5bWJv bC1uYW1lIG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAgICAgICAgICAgICAgICAgIChtYy9leGVjdXRl LWNvbW1hbmQtZm9yLWFsbC1mYWtlLWN1cnNvcnMgb3JpZ2luYWwtY29tbWFuZCkKKyAgICAgICAg ICAgICAgICA7OyBzbWFydHJlcCBgaW50ZXJuJ3MgY29tbWFuZHMgaW50byBvd24gb2JhcnJheSB0 byBoZWxwCisgICAgICAgICAgICAgICAgOzsgYGRlc2NyaWJlLWJpbmRpbmdzJy4gIFNvLCBsZXQn cyByZS1gaW50ZXJuJyBoZXJlIHRvCisgICAgICAgICAgICAgICAgOzsgbWFrZSB0aGUgY29tbWFu ZCBjb21wYXJhYmxlIGJ5IGBlcScuCisgICAgICAgICAgICAgICAgKHNldHEgb3JpZ2luYWwtY29t bWFuZCAoaW50ZXJuIChzeW1ib2wtbmFtZSBvcmlnaW5hbC1jb21tYW5kKSkpCisgICAgICAgICAg ICAgICAgOzsgb3RoZXJ3aXNlIGl0J3MgYSBzeW1ib2wsIGFuZCB3ZSBjYW4gYmUgbW9yZSB0aG9y b3VnaAorICAgICAgICAgICAgICAgIChpZiAoZ2V0IG9yaWdpbmFsLWNvbW1hbmQgJ21jLS11bnN1 cHBvcnRlZCkKKyAgICAgICAgICAgICAgICAgICAgKG1lc3NhZ2UgIiVTIGlzIG5vdCBzdXBwb3J0 ZWQgd2l0aCBtdWx0aXBsZSBjdXJzb3JzJXMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg IG9yaWdpbmFsLWNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdldCBvcmln aW5hbC1jb21tYW5kICdtYy0tdW5zdXBwb3J0ZWQpKQorICAgICAgICAgICAgICAgICAgKHdoZW4g KGFuZCBvcmlnaW5hbC1jb21tYW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChub3Qg KG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy0tZGVmYXVsdC1jbWRzLXRvLXJ1bi1vbmNlKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKG5vdCAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1j L2NtZHMtdG8tcnVuLW9uY2UpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAob3IgbWMv YWx3YXlzLXJ1bi1mb3ItYWxsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVt cSBvcmlnaW5hbC1jb21tYW5kIG1jLS1kZWZhdWx0LWNtZHMtdG8tcnVuLWZvci1hbGwpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jL2Nt ZHMtdG8tcnVuLWZvci1hbGwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWMv cHJvbXB0LWZvci1pbmNsdXNpb24taW4td2hpdGVsaXN0IG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAg ICAgICAgICAgICAgICAgICAgKG1jL2V4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ml0IFJHQiAtLSB0aGUgY29udmVyc2lvbiBm cm9tIExTTAoraGFwcGVucyBpbnRlcm5hbGx5IGJ5IG11bHRpcGx5aW5nIGVhY2ggZWxlbWVudCBv ZiB0aGUgTFNMIGNvbG9yIHZlY3RvciBieSA2NTUzNS4iCisoaW50ZXJhY3RpdmUpCisgIChsZXQg KChidWZmZXIgKGdldC1idWZmZXItY3JlYXRlICIqTUMtVEVTVCoiKSkpCisgICAgKHdpdGgtY3Vy cmVudC1idWZmZXIgYnVmZmVyCisgICAgICAoZXJhc2UtYnVmZmVyKQorICAgICAgKGluc2VydCAi VGhpcyBpcyBhIHRlc3QhIikKKyAgICAgIChzZXRxIG1jLWNvbmYgJygoMSAiaGJhciIgIm1hZ2Vu dGEiKQorICAgICAgICAgICAgICAgICAgICAgICgyICJiYXIiICJwdXJwbGUiKQorICAgICAgICAg ICAgICAgICAgICAgICgzICJib3giICIjMDBGRjAwIikKKyAgICAgICAgICAgICAgICAgICAgICAo NCAiaG9sbG93IiAiIzAwMDBGRiIpCisgICAgICAgICAgICAgICAgICAgICAgKDUgKCJoYmFyIiAz KSBbMS4wIDAuMCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg2ICgiYmFyIiAzKSBbMC4w IDEuMCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg3ICJmcmFtZWQiICJPcmFuZ2VSZWQi KQorICAgICAgICAgICAgICAgICAgICAgICg4ICJib3giICJncmV5MjUiKQorICAgICAgICAgICAg ICAgICAgICAgICg5ICJib3giICJncmV5NzUiKSkpKQorICAgIChzZWxlY3Qtd2luZG93IChkaXNw bGF5LWJ1ZmZlciBidWZmZXIpKSkpCisKKyhkZWZ1biArLXRpbWVyLWZuICgpCisiU2luY2UgdGhp cyBmaXJlcyBnbG9iYWxseSwgd2UgbXVzdCBjb250cm9sIHdoaWNoIGJ1ZmZlcnMgY3Jvc3NoYWly cyBhcHBlYXIgaW4uIgorICAod2hlbiArLW1vZGUKKyAgICAodW5sZXNzIChvciAobWVtcSBsYXN0 LWNvbW1hbmQgKy1wYXJlbnMtZXhjbHVzaW9ucykKKyAgICAgICAgICAgICAgICAobnVsbCArLXBh cmVucy1wKSkKKyAgICAgICgrLXBhcmVucy1mbikpCisgICAgKHdoZW4gKy10aW1lci12YXIKKyAg ICAgIChzZXRxIHRpbWVyLWlkbGUtbGlzdCAoZGVscSArLXRpbWVyLXZhciB0aW1lci1pZGxlLWxp c3QpKQorICAgICAgKHNldHEgKy10aW1lci12YXIgbmlsKSkpKQorCisoZGVmdW4gKy1kcmF3LWZv cnRod2l0aCAoKQorIkltbWVkaWF0ZWx5IGRlbGV0ZS9kcmF3IG1hdGNoaW5nIHBhcmVudGhlc2Vz LiIKKyAgKCstZHJhdy1jcm9zc2hhaXJzICdmb3JjZSkpCisKKyhkZWZ1biArLWRyYXctY3Jvc3No YWlycyAoJm9wdGlvbmFsIGZvcmNlKQorIkltbWVkaWF0ZWx5IGRlbGV0ZSBtYXRjaGluZyBwYXJl bnRoZXNlcy4gIElmIEZPUkNFIGlzIG5vbi1uaWwsIHRoZW4gaW1tZWRpYXRlbHkKK2RyYXcgbWF0 Y2hpbmcgcGFyZW50aGVzaXM7IG90aGVyd2lzZSwgZHJhdyB0aGVtIG9uIGFuIGlkbGUtdGllci4i CisgICh3aGVuICstbW9kZQorICAgICh3aGVuICstdGltZXItdmFyCisgICAgICAoc2V0cSB0aW1l ci1pZGxlLWxpc3QgKGRlbHEgKy10aW1lci12YXIgdGltZXItaWRsZS1saXN0KSkKKyAgICAgIChz ZXRxICstdGltZXItdmFyIG5pbCkpCisgICAgKHVubGVzcyAob3IgKG1lbXEgdGhpcy1jb21tYW5k ICstcGFyZW5zLWV4Y2x1c2lvbnMpCisgICAgICAgICAgICAgICAgKGFuZCAobnVsbCArLXBhcmVu cy1wKQorICAgICAgICAgICAgICAgICAgICAgKG51bGwgKy1wYXJlbnMtb3ZlcmxheXMtZXhpc3Qt cCkpKQorICAgICAgKCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykpCisgICAgKGlmIGZvcmNlCisg ICAgICAocHJvZ24KKyAgICAgICAgKHdoZW4gKy1wYXJlbnMtcAorICAgICAgICAgICgrLXBhcmVu cy1mbikpKQorICAgICAgKHNldHEgKy10aW1lci12YXIgKHJ1bi13aXRoLWlkbGUtdGltZXIgKy1p ZGxlLXRpbWVyLXNlY29uZHMgbmlsICMnKy10aW1lci1mbikpKSkpCisKKyhkZWZ2YXIgZmMtbW9k ZSkKKworOzs7IyMjYXV0b2xvYWQKKyhkZWZpbmUtbWlub3ItbW9kZSArLW1vZGUKKyJNaW5vciBt b2RlIGZvciBkaXNwbGF5aW5nIGEgaG9yaXpvbnRhbCBydWxlci4iCisgIDppbml0LXZhbHVlIG5p bAorICA6bGlnaHRlciAiICsiCisgIDprZXltYXAgbmlsCisgIDpnbG9iYWwgbmlsCisgIDpncm91 cCAnKy1tb2RlCisgIChjb25kCisgICAgKCstbW9kZQorICAgICAgOzs7IGArLW1vZGUnIGhhcyB0 aGUgYWJpbGl0eSB0byBhbHNvIGRpc3BsYXkgYSBmaWxsIGNvbHVtbiBpbmRpY2F0b3IuCisgICAg ICA7OzsgU2VlIHRoZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicuCisgICAgICAod2hlbiBmYy1t b2RlCisgICAgICAgIChmYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgZ2xvYmFsLWVsZG9j LW1vZGUKKyAgICAgICAgICAgICAgICAgKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAgJ2FueSkKKyAg ICAgICAgICAgICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAgICAgICAg KGdsb2JhbC1lbGRvYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgaml0LWxvY2stY29udGV4 dC10aW1lcgorICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQor ICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAg ICAod2hlbiAodGltZXJwIGppdC1sb2NrLWNvbnRleHQtdGltZXIpCisgICAgICAgICAgKGNhbmNl bC10aW1lciBqaXQtbG9jay1jb250ZXh0LXRpbWVyKSkKKyAgICAgICAgOzsgKHNldHEgaml0LWxv Y2stY29udGV4dC10aW1lciAocnVuLXdpdGgtaWRsZS10aW1lciA1LjAgJ3JlcGVhdCAnaml0LWxv Y2stY29udGV4dC1mb250aWZ5KSkKKyAgICAgICAgKHNldHEgaml0LWxvY2stY29udGV4dC10aW1l ciBuaWwpKQorICAgICAgKHdoZW4gKGFuZCAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQor ICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAg ICAod2hlbiAodGltZXJwIHVuZG8tYXV0by1jdXJyZW50LWJvdW5kYXJ5LXRpbWVyKQorICAgICAg ICAgIChjYW5jZWwtdGltZXIgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpKQorICAg ICAgICAoZnNldCAndW5kby1hdXRvLS11bmRvYWJsZS1jaGFuZ2UKKyAgICAgICAgICAgICAgKGxh bWJkYSAoKSAoYWRkLXRvLWxpc3QgJ3VuZG8tYXV0by0tdW5kb2FibHktY2hhbmdlZC1idWZmZXJz IChjdXJyZW50LWJ1ZmZlcikpKSkKKyAgICAgICAgKGZzZXQgJ3VuZG8tYXV0by1hbWFsZ2FtYXRl ICdpZ25vcmUpKQorICAgICAgKHdoZW4gYmxpbmstY3Vyc29yLW1vZGUKKyAgICAgICAgKGJsaW5r LWN1cnNvci1tb2RlIC0xKQorICAgICAgICAod2hlbiAobWVtcSAnYmxpbmstY3Vyc29yLWNoZWNr IHBvc3QtY29tbWFuZC1ob29rKQorICAgICAgICAgIChyZW1vdmUtaG9vayAncG9zdC1jb21tYW5k LWhvb2sgJ2JsaW5rLWN1cn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XZhcmlhYmxlICcrLS1zYXZlZC1zdGF0 ZSkgbmlsKQorICAgICAgKGRvbGlzdCAodmFyICcoYnVmZmVyLWRpc3BsYXktdGFibGUKKyAgICAg ICAgICAgICAgICAgICAgIGZyaW5nZS1pbmRpY2F0b3ItYWxpc3QKKyAgICAgICAgICAgICAgICAg ICAgIHRhYi13aWR0aAorICAgICAgICAgICAgICAgICAgICAgbGluZS1tb3ZlLXZpc3VhbAorICAg ICAgICAgICAgICAgICAgICAgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgICAgICAgICAgICAgIHRy dW5jYXRlLXBhcnRpYWwtd2lkdGgtd2luZG93cworICAgICAgICAgICAgICAgICAgICAgd29yZC13 cmFwKSkKKyAgICAgICAgKHdoZW4gKGxvY2FsLXZhcmlhYmxlLXAgdmFyKQorICAgICAgICAgIChw dXNoIChjb25zIHZhciAoc3ltYm9sLXZhbHVlIHZhcikpICstLXNhdmVkLXN0YXRlKSkpCisgICAg ICAoc2V0cSBmaWxsLWNvbHVtbiA4MCkKKyAgICAgIChzZXRxIGRpc3BsYXktbGluZS1udW1iZXJz IHQpCisgICAgICAoc2V0cS1sb2NhbCBhdXRvLWhzY3JvbGwtbW9kZSAnY3VycmVudC1saW5lKQor ICAgICAgKHNldHEtbG9jYWwgaHNjcm9sbC1zdGVwIDUpCisgICAgICAoc2V0cSBidWZmZXItZGlz cGxheS10YWJsZSArLWJ1ZmZlci1kaXNwbGF5LXRhYmxlKQorICAgICAgKHNldHEgdGFiLXdpZHRo IDQpCisgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICdsaW5lLW1vdmUtdmlzdWFsKSB0 KQorICAgICAgKHNldHEgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgKGNvbmQKKyAgICAgICAgICAo KGxldCAoKGxzdCArLXRydW5jYXRlLWxpbmVzLWRlcml2ZWQtbW9kZXMpCisgICAgICAgICAgICAg ICAgICBtb2RlKQorICAgICAgICAgICAgKGNhdGNoICdmb3VuZAorICAgICAgICAgICAgICAod2hp bGUgKHNldHEgbW9kZSAocG9wIGxzdCkpCisgICAgICAgICAgICAgICAgKHdoZW4gKGRlcml2ZWQt bW9kZS1wIG1vZGUpCisgICAgICAgICAgICAgICAgICAodGhyb3cgJ2ZvdW5kIHQpKSkpKSkKKyAg ICAgICAgICAgKChtZW1xIG1ham9yLW1vZGUgKy10cnVuY2F0ZS1saW5lcy1tYWpvci1tb2Rlcykp CisgICAgICAgICAgICh0CisgICAgICAgICAgICAgbmlsKSkpCisgICAgICAoc2V0IChtYWtlLWxv Y2FsLXZhcmlhYmxlICd0cnVuY2F0ZS1wYXJ0aWFsLXdpZHRoLXdpbmRvd3MpIG5pbCkKKyAgICAg IChzZXRxIHdvcmQtd3JhcCB0KQorICAgICAgKHNldHEgaW5kaWNhdGUtZW1wdHktbGluZXMgdCkK KyAgICAgIChzZXRxIGluZGljYXRlLWJ1ZmZlci1ib3VuZGFyaWVzICdsZWZ0KQorICAgICAgKHNl dHEgZnJpbmdlLWluZGljYXRvci1hbGlzdAorICAgICAgICAgIDs7OyBoc2NsX2FsbF90ZW1wX3Ag fCBoc2NsX3RlbXBfcAorICAgICAgICAnKCgrLWhzY2wtdGVtcCAuICgrLXNpbmdsZS1hbmdsZS1s ZWZ0CisgICAgICAgICAgICAgICAgICAgICAgICAgICstZG91YmxlLWFuZ2xlLWxlZnQpKQorICAg ICAgICAgIDs7OyBoc2NsX2FsbF9wZXJtXzBfcCB8IGhzY2xfYWxsX3Blcm1fMV9wIHwgaHNjbF9h bGxfcGVybV8yX3AgfCBoc2NsX3Blcm1fcAorICAgICAgICAgICgrLWhzY2wtcGVybSAuICgrLXNp bmdsZS1hbmdsZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLWRvdWJsZS1hbmdsZS11 cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLXRyaXBsZS1hbmdsZS11cAorICAgICAgICAg ICAgICAgICAgICAgICAgICArLXF1YWRydXBsZS1hbmdsZS11cCkpCisgICAgICAgICAgKCstb3Zl cmxheS1hcnJvdyAuICgrLWZyaW5nZS1sZWZ0LWFycm93CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICArLWZyaW5nZS1yaWdodC1hcnJvdykpCisgICAgICAgICAgKHRydW5jYXRpb24gLiAo Ky1mcmluZ2UtbGVmdC1hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICstZnJpbmdlLXJp Z2h0LWFycm93KSkKKyAgICAgICAgICAoY29udGludWF0aW9uIC4gKCstZnJpbmdlLWxlZnQtY3Vy bHktYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICstYmFja3NsYXNoKSkKKyAgICAg ICAgICAob3ZlcmxheS1hcnJvdyAuICstZnJpbmdlLXJpZ2h0LXRyaWFuZ2xlKQorICAgICAgICAg ICh1cCAuICstZnJpbmdlLXVwLWFycm93KQorICAgICAgICAgIChkb3duIC4gKy1mcmluZ2UtZG93 bi1hcnJvdykKKyAgICAgICAgICAodG9wIC4gKy1mcmluZ2UtdG9wLWxlZnQtYW5nbGUpCisgICAg ICAgICAgKGJvdHRvbSAuICstZnJpbmdlLWJvdHRvbS1yaWdodC1hbmdsZSkKKyAgICAgICAgICAo dG9wLWJvdHRvbSAuICgrLWZyaW5nZS1sZWZ0LWJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAg ICAgICArLWZyaW5nZS1yaWdodC1icmFja2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgKy1m cmluZ2UtdG9wLXJpZ2h0LWFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgKy1mcmluZ2Ut dG9wLWxlZnQtYW5nbGUpKQorICAgICAgICAgIChlbXB0eS1saW5lIC4gKy1mcmluZ2UtZW1wdHkt bGluZSkKKyAgICAgICAgICAodW5rbm93biAuICstZnJpbmdlLXF1ZXN0aW9uLW1hcmspKSkKKyAg ICAgIChzZXRxIGZyaW5nZS1jdXJzb3ItYWxpc3QgJygoYm94IC4gKy1mcmluZ2UtbGVmdC10cmlh bmdsZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaG9sbG93IC4gKy1ob2xs b3ctcmVjdGFuZ2xlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChiYXIgLiAr LXZlcnRpY2FsLWJhcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaGJhciAu ICstZnJpbmdlLWhvcml6b250YWwtYmFyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIChob2xsb3ctc21hbGwgLiArLWZyaW5nZS1ob2xsb3ctc3F1YXJlKSkpCisgICAgICAoaWYg KG9yICstZm9ydGh3aXRoCisgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcg Jyg0KSkpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJhdy1mb3J0 aHdpdGggJ2FwcGVuZCAnbG9jYWwpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhv b2sgJystZHJhdy1jcm9zc2hhaXJzICdhcHBlbmQgJ2xvY2FsKSkKKyAgICAgICh3aGVuICstZm9y dGh3aXRoCisgICAgICAgIChhZGQtaG9vayAnd2luZG93LWNvbmZpZ3VyYXRpb24tY2hhbmdlLWhv b2sgJystZHJhdy1mb3J0aHdpdGggbmlsICdsb2NhbCkpCisgICAgICAoYWRkLWhvb2sgJ2NoYW5n ZS1tYWpvci1tb2RlLWhvb2sgJ3R1cm4tb2ZmLSstbW9kZSBuaWwgJ2xvY2FsKQorICAgICAgOzs7 IE1hdGNoaW5nIHBhcmVudGhlc2VzIGRyYXdpbmcgZm9ydGh3aXRoIGludGVyZmVyZXMgd2l0aCB5 YXNuaXBwZXQuCisgICAgICAod2hlbiArLWZvcnRod2l0aAorICAgICAgICAoc2V0cSArLXBhcmVu cy1wIG5pbCkpCisgICAgICAod2hlbiAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAg ICAgICAoY29uZAorICAgICAgICAgICgrLWZvcnRod2l0aAorICAgICAgICAgICAgKG1lc3NhZ2Ug IlR1cm5lZCBPTiBgKy1tb2RlJyAtLSBEcmF3IG1hdGNoaW5nIHBhcmVudGhlc2VzIGltbWVkaWF0 ZWx5LiIpKQorICAgICAgICAgICgoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpCisgICAg ICAgICAgICA7OzsgTWF0Y2hpbmcgcGFyZW50aGVzZXMgd2lsbCBiZSBkcmF3biBpbW1lZGlhdGVs eS4KKyAgICAgICAgICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScgLS0gT3B0aW1pemVk IGZvciBkZWJ1Z2dpbmcgcHVycG9zZXMuIikpCisgICAgICAgICAgKHQKKyAgICAgICAgICAgICht ZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScuIikpKSkpCisgICAgKHQKKyAgICAgIChraWxsLWxv Y2FsLXZhcmlhYmxlICdmaWxsLWNvbHVtbikKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdh dXRvLWhzY3JvbGwtbW9kZSkKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdoc2Nyb2xsLXN0 ZXApCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnY3Jvc3NoYWlycykKKyAgICAgIChraWxs LWxvY2FsLXZhcmlhYmxlICdmYy12aXNpYmxlKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUg J2Rpc3BsYXktbGluZS1udW1iZXJzKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJ2Rpc3Bs YXktbGluZS1udW1iZXJzLXdpZHRoKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJ21jLWNv bmYpCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnYnVmZmVyLWRpc3BsYXktdGFibGUpCisg ICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAndGFiLXdpZHRoKQorICAg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AgKGkg MCkKKyAgICAgICAgIChwcmVjZWRpbmctY2hhciAocHJlY2VkaW5nLWNoYXIpKQorICAgICAgICAg KG9jaGFyIChjaGFyLWFmdGVyIG9wb2ludCkpCisgICAgICAgICAocG9zMQorICAgICAgICAgICAo Y29uZAorICAgICAgICAgICAgICgoYW5kIG9jaGFyCisgICAgICAgICAgICAgICAgICAgKG9yIDs7 OyAoY2hhci10by1zdHJpbmcgNDApID0+IG9wZW5pbmcgcGFyZW50aGVzaXMKKyAgICAgICAgICAg ICAgICAgICAgICAgKD0gb2NoYXIgNDApCisgICAgICAgICAgICAgICAgICAgICAgIDs7OyAoY2hh ci10by1zdHJpbmcgOTEpID0+IG9wZW5pbmcgc3F1YXJlIGJyYWNrZXQKKyAgICAgICAgICAgICAg ICAgICAgICAgKD0gb2NoYXIgOTEpCisgICAgICAgICAgICAgICAgICAgICAgIDs7OyAoY2hhci10 by1zdHJpbmcgMTIzKSA9PiBvcGVuaW5nIHdhdnkgYnJhY2tldAorICAgICAgICAgICAgICAgICAg ICAgICAoPSBvY2hhciAxMjMpKSkKKyAgICAgICAgICAgICAgICAobWluICgxKyBvcG9pbnQpIChw b2ludC1tYXgpKSkKKyAgICAgICAgICAgICAoKG9yIDs7OyAoY2hhci10by1zdHJpbmcgNDEpID0+ IGNsb3NpbmcgcGFyZW50aGVzaXMKKyAgICAgICAgICAgICAgICAgICg9IHByZWNlZGluZy1jaGFy IDQxKQorICAgICAgICAgICAgICAgICAgOzs7IChjaGFyLXRvLXN0cmluZyA5MykgPT4gY2xvc2lu ZyBzcXVhcmUgYnJhY2tldAorICAgICAgICAgICAgICAgICAgKD0gcHJlY2VkaW5nLWNoYXIgOTMp CisgICAgICAgICAgICAgICAgICA7OzsgKGNoYXItdG8tc3RyaW5nIDEyNSkgPT4gY2xvc2luZyB3 YXZ5IGJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICg9IHByZWNlZGluZy1jaGFyIDEyNSkpCisg ICAgICAgICAgICAgICAgKG1heCAocG9pbnQtbWluKSAoMS0gb3BvaW50KSkpCisgICAgICAgICAg ICAgKHQKKyAgICAgICAgICAgICAgICBvcG9pbnQpKSkKKyAgICAgICAgIHBvczIKKyAgICAgICAg IHNlbGVjdGVkLWZhY2UpCisgICAgKHNhdmUtZXhjdXJzaW9uCisgICAgICAoY29uZGl0aW9uLWNh c2UgbmlsCisgICAgICAgICh3aGlsZSAoc2V0cSBwb3MxIChudGggMSAocGFyc2UtcGFydGlhbC1z ZXhwIGZyb20gcG9zMSkpKQorICAgICAgICAgIChzZXRxIHBvczIgKHNjYW4tc2V4cHMgcG9zMSAx KSkKKyAgICAgICAgICAoaWYgKD0gaSAxMCkKKyAgICAgICAgICAgIChzZXRxIGkgMSkKKyAgICAg ICAgICAgIChzZXRxIGkgKDErIGkpKSkKKyAgICAgICAgICAoc2V0cSBzZWxlY3RlZC1mYWNlIChj b25kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDEpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLW9uZS1mYWNlKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAoKD0gaSAyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICcrLXBhcmVucy10d28tZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgKCg9IGkgMykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMt dGhyZWUtZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgNCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtZm91ci1mYWNlKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA1KQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICcrLXBhcmVucy1maXZlLWZhY2UpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICgoPSBpIDYpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JystcGFyZW5zLXNpeC1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0g aSA3KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1zZXZlbi1m YWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA4KQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1laWdodC1mYWNlKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA5KQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICcrLXBhcmVucy1uaW5lLWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICgoPSBpIDEwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBh cmVucy10ZW4tZmFjZSkpKQorICAgICAgICAgIChsZXQgKChvdiAobWFrZS1vdmVybGF5IHBvczEg KDErIHBvczEpKSkpCisgICAgICAgICAgICAodW5sZXNzICstcGFyZW5zLWluYWN0aXZlLXdpbmRv d3MKKyAgICAgICAgICAgICAgKG92ZXJsYXktcHV0IG92ICd3aW5kb3cgd2luKSkKKyAgICAgICAg ICAgIChvdmVybGF5LXB1dCBvdiAnZmFjZSBzZWxlY3RlZC1mYWNlKSkKKyAgICAgICAgICAod2hl biBwb3MyCisgICAgICAgICAgICAobGV0ICgob3YgKG1ha2Utb3ZlcmxheSAoMS0gcG9zMikgcG9z MikpKQorICAgICAgICAgICAgICAodW5sZXNzICstcGFyZW5zLWluYWN0aXZlLXdpbmRvd3MKKyAg ICAgICAgICAgICAgICAob3ZlcmxheS1wdXQgb3YgJ3dpbmRvdyB3aW4pKQorICAgICAgICAgICAg ICAob3ZlcmxheS1wdXQgb3YgJ2ZhY2Ugc2VsZWN0ZWQtZmFjZSkpKSkKKyAgICAgICAgKGVycm9y IG5pbCkpKQorICAgIChzZXRxICstcGFyZW5zLW92ZXJsYXlzLWV4aXN0LXAgdCkpKQorCisoZGVm dW4gKy1yZW1vdmUtb3ZlcmxheXMgKGJlZyBlbmQgbmFtZSB2YWwpCisiUmVtb3ZlIHRoZSBvdmVy bGF5cyB0aGF0IGFyZSBgZXF1YWwtaW5jbHVkaW5nLXByb3BlcnRpZXNgLgorSW5jbHVkZXMgYSB1 bmlxdWUgc2l0dWF0aW9uIHdoZW4gYW4gb3ZlcmxheSB3aXRoIGFuIGAnYWZ0ZXItc3RyaW5nYCBw cm9wZXJ0eQoraXMgYXQgdGhlIHZlcnkgZW5kIG9mIGEgbmFycm93ZWQtYnVmZmVyLiIKKyAgKGxl dCogKChwb2ludC1tYXggKHBvaW50LW1heCkpCisgICAgICAgICAocG9pbnQtbWluIChwb2ludC1t aW4pKQorICAgICAgICAgKG5hcnJvd2VkLXAgKGJ1ZmZlci1uYXJyb3dlZC1wKSkKKyAgICAgICAg IChiZWcgKGlmIGJlZyBiZWcgcG9pbnQtbWluKSkKKyAgICAgICAgIChlbmQKKyAgICAgICAgICAg KGNvbmQKKyAgICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAobm90IG5hcnJvd2Vk LXApCisgICAgICAgICAgICAgICAgIGVuZCkKKyAgICAgICAgICAgICAgIGVuZCkKKyAgICAgICAg ICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAobm90IG5hcnJvd2VkLXApCisgICAgICAgICAg ICAgICAgIChudWxsIGVuZCkpCisgICAgICAgICAgICAgICBwb2ludC1tYXgpCisgICAgICAgICAg ICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFycm93ZWQtcAorICAgICAgICAgICAgICAgICBl bmQKKyAgICAgICAgICAgICAgICAgKDwgZW5kIHBvaW50LW1heCkpCisgICAgICAgICAgICAgICBl bmQpCisgICAgICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFycm93ZWQtcAorICAg ICAgICAgICAgICAgICBlbmQKKyAgICAgICAgICAgICAgICAgKD0gZW5kIHBvaW50LW1heCkpCisg ICAgICAgICAgICAgICAoMSsgZW5kKSkKKyAgICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAg ICAgICBuYXJyb3dlZC1wCisgICAgICAgICAgICAgICAgIChudWxsIGVuZCkpCisgICAgICAgICAg ICAgICAoMSsgcG9pbnQtbWF4KSkgKSkKKyAgICAgICAgIChvdmVybGF5cworICAgICAgICAgICAo cHJvZ24KKyAgICAgICAgICAgICAob3ZlcmxheS1yZWNlbnRlciBlbmQpCisgICAgICAgICAgICAg KG92ZXJsYXlzLWluIGJlZyBlbmQpKSkpCisgICAgKHdoZW4gKGFuZCBiZWcgZW5kIG5hbWUgdmFs KQorICAgICAgKGRvbGlzdCAobyBvdmVybGF5cykKKyAgICAgICAgKGNvbmQKKyAgICAgICAgICAo KGFuZCAoZXEgbmFtZSAnZmFjZSkKKyAgICAgICAgICAgICAgICAoZXEgKG92ZXJsYXktZ2V0IG8g bmFtZSkgdmFsKSkKKyAgICAgICAgICAgIDs7IEVpdGhlciBwdXNoIHRoaXMgb3ZlcmxheSBvdXRz aWRlIGJlZy4uLmVuZAorICAgICAgICAgICAgOzsgb3Igc3BsaXQgaXQgdG8gZXhjbHVkZSBiZWcu Li5lbmQKKyAgICAgICAgICAgIDs7IG9yIGRlbGV0ZSBpdCBlbnRpcmVseSAoaWYgaXQgaXMgY29u dGFpbmVkIGluIGJlZy4uLmVuZCkuCisgICAgICAgICAgICAoaWYgKDwgKG92ZXJsYXktc3RhcnQg bykgYmVnKQorICAgICAgICAgICAgICAgIChpZiAoPiAob3ZlcmxheS1lbmQgbykgZW5kKQorICAg ICAgICAgICAgICAocHJvZ24KKyAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IChjb3B5LW92 ZXJsYXkgbykKKyAgICAgICAgICAgICAgICAgIChvdmVybGF5LXN0YXJ0IG8pIGJlZykKKyAgICAg ICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVuZCBvKSkpCisgICAgICAg ICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gKG92ZXJsYXktc3RhcnQgbykgYmVnKSkKKyAgICAg ICAgICAgICAgKGlmICg+IChvdmVybGF5LWVuZCBvKSBlbmQpCisgICAgICAgICAgICAgICAgICAo bW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVuZCBvKSkKKyAgICAgICAgICAgICAgICAoZGVs ZXRlLW92ZXJsYXkgbykpKSkKKyAgICAgICAgICAoKGFuZCAobm90IChlcSBuYW1lICdmYWNlKSkK KyAgICAgICAgICAgICAgICAoZXF1YWwtaW5jbHVkaW5nLXByb3BlcnRpZXMgKG92ZXJsYXktZ2V0 IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIChkZWxldGUtb3ZlcmxheSBvKSkpKSkpKQorCiso ZGVmdW4gKy1kZWxldGUtcGFyZW5zLW92ZXJsYXlzICgpCisgICh3aGVuICstcGFyZW5zLW92ZXJs YXlzLWV4aXN0LXAKKyAgICAoZG9saXN0IChmYWNlICcoKy1wYXJlbnMtb25lLWZhY2UKKyAgICAg ICAgICAgICAgICAgICAgKy1wYXJlbnMtdHdvLWZhY2UKKyAgICAgICAgICAgICAgICAgICAgKy1w YXJlbnMtdGhyZWUtZmFjZQorICAgICAgICAgICAgICAgICAgICArLXBhcmVucy1mb3VyLWZhY2UK KyAgICAgICAgICAgICAgICAgICAgKy1wYXJlbnMtZml2ZS1mYWNlCisgICAgICAgICAgICAgICAg ICAgICstcGFyZW5zLXNpeC1mYWNlCisgICAgICAgICAgICAgICAgICAgICstcGFyZW5zLXNldmVu LWZhY2UKKyAgICAgICAgICAgICAgICAgICAgKy1wYXJlbnMtZWlnaHQtZmFjZQorICAgICAgICAg ICAgICAgICAgICArLXBhcmVucy1uaW5lLWZhY2UKKyAgICAgICAgICAgICAgICAgICAgKy1wYXJl bnMtdGVuLWZhY2UpKQorICAgICAgKCstcmVtb3ZlLW92ZXJsYXlzIG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ZGUnICglcykg LS0gc2VlIHRoZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicuIiAoY3VycmVudC1idWZmZXIpKSkK KyAgICAoZmMtbW9kZQorICAgICAgKHdoZW4gKGFuZCBnbG9iYWwtZWxkb2MtbW9kZQorICAgICAg ICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAgICAgICAg ICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAoZ2xvYmFsLWVsZG9j LW1vZGUgLTEpKQorICAgICAgKHdoZW4gKGFuZCBqaXQtbG9jay1jb250ZXh0LXRpbWVyCisgICAg ICAgICAgICAgICAgIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAg ICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVuICh0aW1l cnAgaml0LWxvY2stY29udGV4dC10aW1lcikKKyAgICAgICAgICAoY2FuY2VsLXRpbWVyIGppdC1s b2NrLWNvbnRleHQtdGltZXIpKQorICAgICAgICA7OyAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRp bWVyIChydW4td2l0aC1pZGxlLXRpbWVyIDUuMCAncmVwZWF0ICdqaXQtbG9jay1jb250ZXh0LWZv bnRpZnkpKQorICAgICAgICAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIG5pbCkpCisgICAg ICAod2hlbiAoYW5kIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAg ICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVuICh0aW1l cnAgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpCisgICAgICAgICAgKGNhbmNlbC10 aW1lciB1bmRvLWF1dG8tY3VycmVudC1ib3VuZGFyeS10aW1lcikpCisgICAgICAgIChmc2V0IC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ZhY2UuIgorICA6Z3JvdXAgJystbW9kZSkK KworKGRlZmZhY2UgKy1iYXItcHJlLXp2LWZhY2UKKyAgJygodCAoOmZvcmVncm91bmQgIm1hZ2Vu dGExIikpKQorICAiRmFjZSBmb3IgYCstYmFyLXByZS16di1mYWNlJy4iCisgIDpncm91cCAnKy1t b2RlKQorCisoZGVmZmFjZSArLWJhci1hdC16di1mYWNlCisgICcoKHQgKDpmb3JlZ3JvdW5kICJ5 ZWxsb3ciKSkpCisgICJGYWNlIGZvciBgKy1iYXItYXQtenYtZmFjZScuIgorICA6Z3JvdXAgJyst bW9kZSkKKworKGRlZmZhY2UgKy1iYXItcG9zdC16di1mYWNlCisgICcoKHQgKDpmb3JlZ3JvdW5k ICJtYWdlbnRhNCIpKSkKKyAgIkZhY2UgZm9yIGArLWJhci1wb3N0LXp2LWZhY2UnLiIKKyAgOmdy b3VwICcrLW1vZGUpCisKKyhkZWZmYWNlICstcmV2ZXJzZWQtYmFyLXByZS16di1mYWNlCisgICco KHQgKDpmb3JlZ3JvdW5kICJjeWFuMSIpKSkKKyAgIkZhY2UgZm9yIGArLXJldmVyc2VkLWJhci1w cmUtenYtZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1yZXZlcnNlZC1i YXItYXQtenYtZmFjZQorICAnKCh0ICg6Zm9yZWdyb3VuZCAiY2hhcnRyZXVzZSIpKSkKKyAgIkZh Y2UgZm9yIGArLXJldmVyc2VkLWJhci1hdC16di1mYWNlJy4iCisgIDpncm91cCAnKy1tb2RlKQor CisoZGVmZmFjZSArLXJldmVyc2VkLWJhci1wb3N0LXp2LWZhY2UKKyAgJygodCAoOmZvcmVncm91 bmQgImN5YW40IikpKQorICAiRmFjZSBmb3IgYCstcmV2ZXJzZWQtYmFyLXBvc3QtenYtZmFjZScu IgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1ldmVuLXByZS16di1mYWNlCisgICco KCgoY2xhc3MgY29sb3IpICh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IpIChtaW4t Y29sb3JzIDE2KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJibHVlMSIp CisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDgpKQorICAgICA6Zm9yZWdyb3VuZCAi d2hpdGUiKQorICAgICgoKHR5cGUgdHR5KSAoY2xhc3MgbW9ubykpCisgICAgIDppbnZlcnNlLXZp ZGVvIHQpCisgICAgKHQgOmZvcmVncm91bmQgInBpbmsiKSkKKyAgIkZhY2UgZm9yIGArLWV2ZW4t aW5hY3RpdmUtcHJlLXp2LWZhY2UnLiIKKyAgOmdyb3VwICcrLW1vZGUpCisKKyhkZWZmYWNlICst ZXZlbi1hdC16di1mYWNlCisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFj a2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgIkRlZXBQaW5rMSIpCisgICAgKCgoY2xh c3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3Jl Z3JvdW5kICJEZWVwUGluazEiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikg KGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJEZWVwUGluazEiKQorICAgICgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6 Zm9yZWdyb3VuZCAiRGVlcFBpbmsxIikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMg OCkpCisgICAgIDpmb3JlZ3JvdW5kICJ3aGl0ZSIpCisgICAgKCgodHlwZSB0dHkpIChjbGFzcyBt b25vKSkKKyAgICAgOmludmVyc2UtdmlkZW8gdCkKKyAgICAodCA6Zm9yZWdyb3VuZCAicGluayIp KQorICAiRmFjZSBmb3IgYCstZXZlbi1hdC16di1m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enYtZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZh Y2UgKy1vZGQtcG9zdC16di1mYWNlCisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4 KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTEiKQorICAgICgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6 Zm9yZWdyb3VuZCAiRGFya1NhbG1vbiIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3Jz IDE2KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTEiKQorICAg ICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQpKQorICAg ICA6Zm9yZWdyb3VuZCAiRGFya1NhbG1vbiIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29s b3JzIDgpKQorICAgICA6Zm9yZWdyb3VuZCAid2hpdGUiKQorICAgICgoKHR5cGUgdHR5KSAoY2xh c3MgbW9ubykpCisgICAgIDppbnZlcnNlLXZpZGVvIHQpCisgICAgKHQgOmZvcmVncm91bmQgInBp bmsiKSkKKyAgIkZhY2UgZm9yIGArLW9kZC1wb3N0LXp2LWZhY2UnLiIKKyAgOmdyb3VwICcrLW1v ZGUpCisKKyhkZWZmYWNlICstb2RkLWluYWN0aXZlLXBvc3QtenYtZmFjZQorICAnKCgoKGNsYXNz IGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3Jv dW5kICJzaWVubmE0IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgODgpIChiYWNr Z3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTQiKQorICAgICgoKGNsYX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IGItPmNoX2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQorCitzdGF0 aWMgdm9pZAorYnNldF9mY192aXNpYmxlIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2 YWwpCit7CisgIGItPmZjX3Zpc2libGVfID0gdmFsOworfQorCitzdGF0aWMgdm9pZAorYnNldF9m Y19pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7 CisgIGItPmZjX2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQorCisvKiBlbmQgTVVMVElQTEUt Q1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogc3RhdGljIHZvaWQKIGJz ZXRfYWJicmV2X21vZGUgKHN0cnVjdCBidWZmZXIgKmIsIExpc3BfT2JqZWN0IHZhbCkKIHsKQEAg LTUxNDUsNiArNTIwOCwyNCBAQCBpbml0X2J1ZmZlcl9vbmNlICh2b2lkKQogICBic2V0X2xhc3Rf c2VsZWN0ZWRfd2luZG93ICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBtYWtlX2ZpeG51bSAoMCkpOwog CiAgIGlkeCA9IDE7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1D VVJTT1JTICovCisKKyAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIG1j X3JlYWxfZmFrZV9jdXJzb3IpLCBpZHgpOyArK2lkeDsKKyAgWFNFVEZBU1RJTlQgKEJWQVIgKCZi dWZmZXJfbG9jYWxfZmxhZ3MsIG1jX2NvbmYpLCBpZHgpOyArK2lkeDsKKyAgWFNFVEZBU1RJTlQg KEJWQVIgKCZidWZ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OwpAQCAtNTIzMSw2ICs1MzEyLDI0IEBAIGluaXRfYnVmZmVyX29u Y2UgKHZvaWQpCiAgIC8qIE11c3QgZG8gdGhlc2UgYmVmb3JlIG1ha2luZyB0aGUgZmlyc3QgYnVm ZmVyISAqLwogCiAgIC8qIHJlYWwgc2V0dXAgaXMgZG9uZSBpbiBiaW5kaW5ncy5lbCAqLworCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGJz ZXRfbWNfcmVhbF9mYWtlX2N1cnNvciAoJmJ1ZmZlcl9kZWZhdWx0cywgUWhvbGxvdyk7CisgIGJz ZXRfbWNfY29uZiAoJmJ1ZmZlcl9kZWZhdWx0cywgUW5pbCk7CisgIGJzZXRfbWNfaW5hY3RpdmVf d2luZG93cyAoJmJ1ZmZlcl9kZWZhdWx0cywgUXQpOworICBic2V0X2Nyb3NzaGFpcnMgKCZidWZm ZXJfZGVmYXVsdHMsIFFuaWwpOworICBic2V0X2NoX2hvcml6b250YWxfcnVsZXIgKCZidWZmZXJf ZGVmYXVsdHMsIFF0KTsKKyAgYnNldF9jaF92ZXJ0aWNhbF9ydWxlciAoJmJ1ZmZlcl9kZWZhdWx0 cywgUXQpOworICBic2V0X2NoX2luYWN0aXZlX3dpbmRvd3MgKCZidWZmZXJfZGVmYXVsdHMsIFF0 KTsKKyAgYnNldF9mY192aXNpYmxlICgmYnVmZmVyX2RlZmF1bHRzLCBRbmlsKTsKKyAgYnNldF9m Y19pbmFjdGl2ZV93aW5kb3dzICgmYnVmZmVyX2RlZmF1bHRzLCBRdCk7CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKICAgYnNldF9tb2RlX2xpbmVfZm9ybWF0ICgmYnVmZmVyX2RlZm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isvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIHN0YXRpY3BybyAoJmxhc3Rf b3ZlcmxheV9tb2RpZmljYXRpb25faG9va3MpOwogICBsYXN0X292ZXJsYXlfbW9kaWZpY2F0aW9u X2hvb2tzID0gbWFrZV9uaWxfdmVjdG9yICgxMCk7CiAKZGlmZiAtLWdpdCBhL3NyYy9idWZmZXIu aCBiL3NyYy9idWZmZXIuaAppbmRleCAyMDgwYTZmLi4xYWRhOTNlIDEwMDY0NAotLS0gYS9zcmMv YnVmZmVyLmgKKysrIGIvc3JjL2J1ZmZlci5oCkBAIC03NDAsNiArNzQwLDQwIEBAIHN0cnVjdCBi dWZmZXIKICAgICAgaW4gdGhlIGRpc3BsYXkgb2YgdGhpcyBidWZmZXIuICAqLwogICBMaXNwX09i amVjdCBleHRyYV9saW5lX3NwYWNpbmdfOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8qIFRoZSBjdXJzb3IgdHlwZSBvZiB0aGUgcmVh bCBmYWtlIGN1cnNvci4gKi8KKyAgTGlzcF9PYmplY3QgbWNfcmVhbF9mYWtlX2N1cnNvcl87CisK KyAgLyogVGhlIG5hbWUgb2YgbGlzdCB1c2VkIGJ5IG11bHRpcGxlIGN1cnNvcnMgZm9yIG5leHQg cmVkaXNwbGF5LiAqLworICBMaXNwX09iamVjdCBtY19jb25mXzsKKworICAvKiBXaGV0aGVyIHRv IGRyYXcgbXVsdGlwbGUgY3Vyc29ycyBpbiBpbmFjdGl2ZSB3aW5kb3dzLiAqLworICBMaXNwX09i amVjdCBtY19pbmFjdGl2ZV93aW5kb3dzXzsKKworICAvKiBUaGUgbmFtZSBvZiB0aGUgYnVmZmVy LWxvY2FsIHZhcmlhYmxlLiAqLworICBMaXNwX09iamVjdCBjcm9zc2hhaXJzXzsKKworICAvKiBU aGUgbmFtZSBvZiB0aGUgY3Jvc3NoYWlycyBob3Jpem9udGFsIHJ1bGVyLiAqLworICBMaXNwX09i amVjdCBjaF9ob3Jpem9udGFsX3J1bGVyXzsKKworICAvKiBUaGUgbmFtZSBvZiB0aGUgY3Jvc3No YWlycyB2ZXJ0aWNhbCBydWxlci4gKi8KKyAgTGlzcF9PYmplY3QgY2hfdmVydGljYWxfcnVsZXJf OworCisgIC8qIFdoZXRoZXIgdG8gZHJhdyBjcm9zc2hhaXJzIGluIGluYWN0aXZlIHdpbmRvd3Mu ICovCisgIExpc3BfT2JqZWN0IGNoX2luYWN0aXZlX3dpbmRvd3NfOworCisgIC8qIFRoZSBuYW1l IG9mIHRoZSBidWZmZXItbG9jYWwgdmFyaWFibGUuICovCisgIExpc3BfT2JqZWN0IGZjX3Zpc2li bGVfOworCisgIC8qIFdoZXRoZXIgdG8gZHJhdyBtdWx0aXBsZSBjdXJzb3JzIGZpbGwgY29sdW1u IGluIGluYWN0aXZlIHdpbmRvd3MuICovCisgIExpc3BfT2JqZWN0IGZjX2luYWN0aXZlX3dpbmRv d3NfOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIEN1cnNvciB0eXBlIHRv IGRpc3BsYXkgaW4gbm9uLXNlbGVjdGVkIHdpbmRvd3MuCiAgICAgIHQgbWVhbnMgdG8gdXNlIGhv bGxvdyBib3ggY3Vyc29yLgogICAgICBTZWUgYGN1cnNvci10eXBlJyBmb3Igb3RoZXIgdmFsdWVz LiAgKi8KQEAgLTc5MSwxNCArODI1LDIxIEBAIHN0cnVjdCBidWZmZXIKICAgICAgYW4gaW5kaXJl Y3QgYnVmZmVyIHNpbmNlIGl0IGNvdW50cyBhcyBpdHMgYmFzZSBidWZmZXIuICAqLwogICBpbnQg d2luZG93X2NvdW50OwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUt Q1VSU09SUyAqLworCiAgIC8qIEEgbm9uLXplcm8gdmFsdWUgaW4gc2xvdCBJRFggbWVhbnMgdGhh dCBwZXItYnVmZmVyIHZhcmlhYmxlCiAgICAgIHdpdGggaW5kZXggSURYIGhhcyBhIGxvY2FsIHZh bHVlIGluIHRoaXMgYnVmZmVyLiAgVGhlIGluZGV4IElEWAogICAgICBmb3IgYSBidWZmZXItbG9j YWwgdmFyaWFibGUgaXMgc3RvcmVkIGluIHRoYXQgdmFyaWFibGUncyBzbG90CiAgICAgIGluIGJ1 ZmZlcl9sb2NhbF9mbGFncyBhcyBhIExpc3AgaW50ZWdlci4gIElmIHRoZSBpbmRleCBpcyAtMSwK ICAgICAgdGhpcyBtZWFucyB0aGUgdmFyaWFibGUgaXMgYWx3YXlzIGxvY2FsIGluIGFsbCBidWZm ZXJzLiAgKi8KLSNkZWZpbmUgTUFYX1BFUl9CVUZGRVJfVkFSUyA1MAorI2RlZmluZSBNQVhfUEVS X0JVRkZFUl9WQVJTIDYwCiAgIGNoYXIgbG9jYWxfZmxhZ3NbTUFYX1BFUl9CVUZGRVJfVkFSU107 CiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogU2V0IHRvIHRoZSBtb2R0aW1l IG9mIHRoZSB2aXNpdGVkIGZpbGUgd2hlbiByZWFkIG9yIHdyaXR0ZW4uCiAgICAgIG1vZHRpbWUu dHZfbnNlYyA9PSBOT05FWElTVEVOVF9NT0RUSU1FX05TRUNTIG1lYW5zCiAgICAgIHZpc2l0ZWQg ZmlsZSB3YXMgbm9uZXhpc3RlbnQuICBtb2R0aW1lLnR2X25zZWMgPT0KQEAgLTkwNyw2ICs5NDgs NjkgQEAgWEJVRkZFUiAoTGlzcF9PYmplY3QgYSkKIC8qIE1vc3QgY29kZSBzaG91bGQgdXNlIHRo ZXNlIGZ1bmN0aW9ucyB0byBzZXQgTGlzcCBmaWVsZHMgaW4gc3RydWN0CiAgICBidWZmZXIuICAo U29tZSBzZXR0ZXJzIHRoYXQgYXJlIHByaXZhdGUgdG8gYSBzaW5nbGUgLmMgZmlsZSBhcmUKICAg IGRlZmluZWQgYXMgc3RhdGljIGluIHRob3NlIGZpbGVzLikgICovCisKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKK0lOTElORSB2b2lk Citic2V0X2Jsdl9tY19yZWFsX2Zha2VfY3Vyc29yIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09i amVjdCB2YWwpCit7CisgIGItPm1jX3JlYWxfZmFrZV9jdXJzb3JfID0gdmFsOworfQorCitJTkxJ TkUgdm9pZAorYnNldF9ibHZfbWNfY29uZiAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3Qg dmFsKQoreworICBiLT5tY19jb25mXyA9IHZhbDsKK30KKworSU5MSU5FIHZvaWQKK2JzZXRfYmx2 X21jX2luYWN0aXZlX3dpbmRvd3MgKHN0cnVjdCBidWZmZXIgKmIsIExpc3BfT2JqZWN0IHZhbCkK K3sKKyAgYi0+bWNfaW5hY3RpdmVfd2luZG93c18gPSB2YWw7Cit9CisKK0lOTElORSB2b2lkCiti c2V0X2Jsdl9jcm9zc2hhaXJzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7 CisgIGItPmNyb3NzaGFpcnNfID0gdmFsOworfQorCitJTkxJTkUgdm9pZAorYnNldF9ibHZfY2hf aG9yaXpvbnRhbF9ydWxlciAoc3Ryd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c3BleHRlcm4u aAorKysgYi9zcmMvZGlzcGV4dGVybi5oCkBAIC0xNDUsNiArMTQ1LDEzMSBAQCB0eXBlZGVmIHZv aWQgKkVtYWNzX0N1cnNvcjsKICNkZWZpbmUgTmF0aXZlUmVjdGFuZ2xlIGludAogI2VuZGlmCiAK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICov CisKK2V4dGVybiBib29sIG1jX3N0ZGVycl9wIEVYVEVSTkFMTFlfVklTSUJMRTsKKworc3RydWN0 IGdseXBoOworCitzdHJ1Y3QgZ2x5cGhfcm93OworCitzdHJ1Y3QgZ2x5cGhfbWF0cml4OworCitl bnVtIGRyYXdfZ2x5cGhzX2ZhY2U7CisKK2VudW0gZ2x5cGhfcm93X2FyZWE7CisKK3N0cnVjdCBt Y19tYXRyaXg7CisKK2VudW0gbWNfY2FjaGVfdHlwZTsKKworZW51bSBtY19jdXJzb3JfdHlwZTsK KworZW51bSBtY19mbGF2b3I7CisKK3N0cnVjdCBtY19SR0I7CisKK3N0cnVjdCBtY19lc3NlbnRp YWxzOworCitlbnVtIG1jX2RyYXdfcm93X3R5cGU7CisKK2VudW0gbWNfZW5naW5lX3R5cGU7CisK K2VudW0gbWNfcm93X3Bvc2l0aW9uOworCitlbnVtIG1jX3JlZHJhd19yb3dfdHlwZTsKKworZW51 bSBkcmF3X2dseXBoX2FjdGlvbjsKKworZXh0ZXJuIExpc3BfT2JqZWN0IG1jX2xpc3RuIChwdHJk aWZmX3QsIExpc3BfT2JqZWN0LCAuLi4pOworCitleHRlcm4gTGlzcF9PYmplY3QgbWNfbnRoIChp bnQsIExpc3BfT2JqZWN0KTsKKworZXh0ZXJuIExpc3BfT2JqZWN0IG1jX2Fzc3EgKExpc3BfT2Jq ZWN0LCBMaXNwX09iamVjdCk7CisKK2V4dGVybiBlbnVtIG1jX3Jvd19wb3NpdGlvbiBtY19yb3df cG9zaXRpb24gKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqLCBp bnQpOworCitleHRlcm4gcHRyZGlmZl90IG1jX3JlZ2lvbl9saW1pdCAoYm9vbCk7CisKK2V4dGVy biBzdHJ1Y3QgZ2x5cGggKiBtY19nZXRfY3Vyc29yX2dseXBoIChzdHJ1Y3Qgd2luZG93ICosIHN0 cnVjdCBnbHlwaF9tYXRyaXggKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICosIGludCwgaW50KTsKKworZXh0ZXJuIHZvaWQgbWNf eHdfY29sb3JfdmFsdWVzIChzdHJ1Y3Qgd2luZG93ICosIExpc3BfT2JqZWN0LCBzdHJ1Y3QgbWNf UkdCICopOworCitleHRlcm4gYm9vbCBtY191cGRhdGVfd2luZG93X2ZyaW5nZXMgKHN0cnVjdCB3 aW5kb3cgKiwgYm9vbCk7CisKK2V4dGVybiBjaGFyICogbWNfd2luZG93IChzdHJ1Y3Qgd2luZG93 ICopOworCitleHRlcm4gY2hhciAqIG1jX2NoYXJfdG9fc3RyaW5nIChpbnQpOworCitleHRlcm4g Y2hhciAqIG1jX2N1cnNvcl90eXBlX3RvX3N0cmluZyAoZW51bSBtY19jdXJzb3JfdHlwZSk7CisK K2V4dGVybiBjaGFyICogbWNfZmxhdm9yX3RvX3N0cmluZyAoZW51bSBtY19mbGF2b3IpOworCitl eHRlcm4gY2hhciAqIG1jX2NhY2hlX3R5cGVfdG9fc3RyaW5nIChlbnVtIG1jX2NhY2hlX3R5cGUp OworCitleHRlcm4gY2hhciAqIG1jX3JlZHJhd19yb3dfdHlwZV90b19zdHJpbmcgKGVudW0gbWNf cmVkcmF3X3Jvd190eXBlKTsKKworZXh0ZXJuIHZvaWQgbWNfY2FjaGVfaW5zcGVjdG9yIChzdHJ1 Y3Qgd2luZG93ICosIHN0cnVjdCBtY19tYXRyaXgpOworCitleHRlcm4gYm9vbCBtY190cmF2ZXJz ZV9jYWNoZV9wIChzdHJ1Y3QgbWNfbWF0cml4LCBlbnVtIG1jX2NhY2hlX3R5cGUsIGludCwgaW50 KTsKKworZXh0ZXJuIHZvaWQgbWNfZHJhd19mcmluZ2VfYml0bWFwIChzdHJ1Y3Qgd2luZG93ICos IHN0cnVjdCBnbHlwaF9yb3cgKiwgaW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBlbnVtIG1jX2N1cnNvcl90eXBlKTsKKworZXh0ZXJuIGludCBtY19nZXRfZnJpbmdlX2Jp dG1hcCAoc3RydWN0IHdpbmRvdyAqLCBMaXNwX09iamVjdCwgaW50LCBpbnQpOworCitleHRlcm4g dm9pZCBtY19lbmdpbmUgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLCBz dHJ1Y3QgZ2x5cGhfcm93ICosCisgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAq LCBpbnQsIGludCwgaW50LCBpbnQsIGludCwgaW50LAorICAgICAgICAgICAgICAgICAgICAgICBl bnVtIG1jX2N1cnNvcl90eXBlLCBpbnQsIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwKKyAgICAgICAg ICAgICAgICAgICAgICAgc3RydWN0IG1jX2Vzc2VudGlhbHMsIGVudW0gbWNfcm93X3Bvc2l0aW9u LCBzdHJ1Y3QgbWNfUkdCLAorICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2VuZ2luZV90 eXBlLCBib29sLCBlbnVtIG1jX2RyYXdfcm93X3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAg IGVudW0gbWNfY2FjaGVfdHlwZSk7CisKK2V4dGVybiB2b2lkIG1jX3NldF9lc3NlbnRpYWxzIChz dHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBtY19lc3NlbnRpYWxzICopOworCitleHRlcm4gdm9pZCBt Y19kcmF3X3JvdyAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVj dCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKiwg aW50LCBpbnQsIGludCwgc3RydWN0IGdseXBoX21hdHJpeCAqLAorICAgICAgICAgICAgICAgICAg ICAgICAgIHN0cnVjdCBtY19lc3NlbnRpYWxzLCBlbnVtIG1jX3Jvd19wb3NpdGlvbiwgYm9vbCwK KyAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2RyYXdfcm93X3R5cGUpOworCitleHRl cm4gYm9vbCBtY19yZWRyYXdfcm93IChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRy aXggKiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51 bSBnbHlwaF9yb3dfYXJlYSwgaW50LCBpbnQsIGludCwgYm9vbCwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSwgZW51bSBtY19yZWRyYXdfcm93X3R5cGUp OworCitleHRlcm4gdm9pZCBtY19yZXNldF9jYWNoZSAoc3RydWN0IHdpbmRvdyAqKTsKKworZXh0 ZXJuIHZvaWQgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGds eXBoX21hdHJpeCAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBn bHlwaF9yb3cgKiwgZW51bSBkcmF3X2dseXBoc19mYWNlLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGludCwgaW50LCBpbnQsIHN0cnVjdCBtY19SR0IsIGVudW0gbWNfZmxhdm9y LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUs IGludCwgYm9vbCwgYm9vbCk7CisKK2V4dGVybiB2b2lkIG1jX2VyYXNlX2N1cnNvciAoc3RydWN0 IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBpbnQsIGludCwgaW50LCBlbnVtIG1jX2Zs YXZvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSwg aW50KTsKKworZXh0ZXJuIHZvaWQgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHN0cnVjdCB3aW5kb3cg Kiwgc3RydWN0IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBpbnQsIGludCwgaW50LCBpbnQsIGludCwgaW50 LCBpbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3Jf dHlwZSwgaW50LCBzdHJ1Y3QgbWNfUkdCLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGJvb2wsIGVudW0gbWNfZmxhdm9yLCBib29sKTsKKworZXh0ZXJuIGludCBtY19kcmF3X2ds eXBocyAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlw aF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCwgZW51bSBnbHlwaF9yb3df YXJlYSwgcHRyZGlmZl90LCBwdHJkaWZmX3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBl bnVtIGRyYXdfZ2x5cGhzX2ZhY2UsIGludCwgaW50LCBzdHJ1Y3QgbWNfUkdCLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgZW51bSBtY19mbGF2b3IsIGVudW0gbWNfY3Vyc29yX3R5cGUsIGlu dCwgYm9vbCwgYm9vbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlw aF9hY3Rpb24sIGJvb2wpOworCitleHRlcm4gc3RydWN0IGdseXBoX21hdHJpeCAqIG1jX3NhdmVf Z2x5cGhfbWF0cml4IChzdHJ1Y3QgZ2x5cGhfbWF0cml4ICopOworCitleHRlcm4gdm9pZCBtY19y ZXN0b3JlX2dseXBoX21hdHJpeCAoc3RydWN0IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhf bWF0cml4ICopOworCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogLyogVGV4dCBjdXJzb3IgdHlwZXMuICAqLwogCiBlbnVtIHRleHRfY3Vy c29yX2tpbmRzCkBAIC00MDQsNiArNTI5LDE4IEBAIHN0cnVjdCBnbHlwaF9zbGljZQogCiBzdHJ1 Y3QgZ2x5cGgKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKworICBpbnQgcmVsYXRpdmVfeCwgaHBvczsKKworICBwdHJkaWZmX3QgYnl0ZXBv czsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBQb3NpdGlvbiBmcm9tIHdo aWNoIHRoaXMgZ2x5cGggd2FzIGRyYXduLiAgSWYgYG9iamVjdCcgYmVsb3cgaXMgYQogICAgICBM aXNwIHN0cmluZywgdGhpcyBpcyBhbiBpbmRleCBpbnRvIHRoYXQgc3RyaW5nLiAgSWYgaXQgaXMg YQogICAgICBidWZmZXIsIHRoaXMgaXMgYSBwb3NpdGlvbiBpbiB0aGF0IGJ1ZmZlci4gIEluIGFk ZGl0aW9uLCBzb21lCkBAIC0xMjcwLDYgKzE0MDcsMjggQEAgZW51bSBkcmF3X2dseXBoc19mYWNl CiAKIHN0cnVjdCBnbHlwaF9zdHJpbmcKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIGJvb2xfYmYgbGVmdF9vdmVyd3JpdHRlbl9w IDogMTsKKworICAgIGJvb2xfYmYgcmlnaHRfb3ZlcndyaXR0ZW5fcCA6IDE7CisKKyAgICBib29s X2JmIHJlY3RhbmdsZV9udWtlZF9wIDogMTsKKworICAgIGJvb2xfYmYgYmFja2dyb3VuZF9udWtl ZF9wIDogMTsKKworICAgIGVudW0gZHJhd19nbHlwaF9hY3Rpb24KKyAgICB7CisgICAgICBNQ19E UkFXX0dMWVBIX1NUUklORywKKyAgICAgIE1DX0VSQVNFX0dMWVBIX1NUUklORworICAgIH0gYWN0 aW9uX3R5cGU7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogWC1vcmlnaW4g b2YgdGhlIHN0cmluZy4gICovCiAgIGludCB4OwogCkBAIC0yODM0LDYgKzI5OTMsMjggQEAgdHlw ZWRlZiB2b2lkICgqZnJhbWVfcGFybV9oYW5kbGVyKSAoc3RydWN0IGZyYW1lICosIExpc3BfT2Jq ZWN0LCBMaXNwX09iamVjdCk7CiAKIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlCiB7CisKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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XBoX3JvdyAqcm93LAorICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbCwgZW51bSBtY19m bGF2b3IgZ2x5cGhfZmxhdm9yLAorICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90 eXBlLCBpbnQgd2QsIGJvb2wgYWN0aXZlX3AsIGJvb2wgY3Vyc29yX2djX3ApOworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKworCiAgIC8qIEhhbmRsZXJzIGZvciBzZXR0aW5nIGZyYW1lIHBh cmFtZXRlcnMuICAqLwogICBmcmFtZV9wYXJtX2hhbmRsZXIgKmZyYW1lX3Bhcm1faGFuZGxlcnM7 CiAKZGlmZiAtLWdpdCBhL3NyYy9kaXNwbmV3LmMgYi9zcmMvZGlzcG5ldy5jCmluZGV4IDAxMzFi NjMuLjhhY2M4MWMgMTAwNjQ0Ci0tLSBhL3NyYy9kaXNwbmV3LmMKKysrIGIvc3JjL2Rpc3BuZXcu YwpAQCAtNTYsNiArNTYsMTc4MiBAQCBhbG9uZyB3aXRoIEdOVSBFbWFjcy4gIElmIG5vdCwgc2Vl IDxodHRwczovL3d3dy5nbnUub3JnL2xpY2Vuc2VzLz4uICAqLwogI2luY2x1ZGUgInczMi5oIgog I2VuZGlmCiAMCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBM RS1DVVJTT1JTICovCisKK3N0cnVjdCBnbHlwaHNfc2tpcHBlZAoreworICBwdHJkaWZmX3QgYWxs b2NhdGVkOworICBwdHJkaWZmX3QgdXNlZDsKKyAgc3RydWN0IHNraXBwZWRfaXRlbXMKKyAgICB7 CisgICAgICBpbnQgeDsKKyAgICAgIGludCBocG9zOworICAgICAgYm9vbCBlbmFibGVkX3A7Cisg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Uk9XIChjdXJyZW50X21hdHJpeCwgaSk7CisgICAgICBpZiAoYy0+ZW5h YmxlZF9wCisgICAgICAgICAgJiYgZC0+ZW5hYmxlZF9wCisgICAgICAgICAgJiYgIWQtPnJlZHJh d19mcmluZ2VfYml0bWFwc19wCisgICAgICAgICAgJiYgYy0+eSA9PSBkLT55CisgICAgICAgICAg JiYgTUFUUklYX1JPV19CT1RUT01fWSAoYykgPD0geWIKKyAgICAgICAgICAmJiBNQVRSSVhfUk9X X0JPVFRPTV9ZIChkKSA8PSB5YgorICAgICAgICAgICYmIHJvd19lcXVhbF9wIChjLCBkLCAxKSkK KyAgICAgICAgeworICAgICAgICAgIGFzc2lnbl9yb3cgKGMsIGQpOworICAgICAgICAgIGQtPmVu YWJsZWRfcCA9IGZhbHNlOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICBicmVh azsKKyAgICB9CisjaWZkZWYgSEFWRV9YV0lER0VUUworICAvKiBDdXJyZW50bHkgdGhpcyBzZWVt cyBuZWVkZWQgdG8gZGV0ZWN0IHh3aWRnZXQgbW92ZW1lbnQgcmVsaWFibHkuICovCisgICAgcmV0 dXJuIDA7CisjZW5kaWYKKyAgLyogR2l2ZSB1cCBpZiBzb21lIHJvd3MgaW4gdGhlIGRlc2lyZWQg bWF0cml4IGFyZSBub3QgZW5hYmxlZC4gKi8KKyAgaWYgKCEgTUFUUklYX1JPV19FTkFCTEVEX1Ag KGRlc2lyZWRfbWF0cml4LCBpKSkKKyAgICByZXR1cm4gLTE7CisgIGZpcnN0X29sZCA9IGZpcnN0 X25ldyA9IGk7CisgIC8qIFNldCBsYXN0X25ldyB0byB0aGUgaW5kZXggKyAxIG9mIHRoZSByb3cg dGhhdCByZWFjaGVzIHRoZQorICAgICBib3R0b20gYm91bmRhcnkgaW4gdGhlIGRlc2lyZWQgbWF0 cml4LiAgR2l2ZSB1cCBpZiB3ZSBmaW5kIGEKKyAgICAgZGlzYWJsZWQgcm93IGJlZm9yZSB3ZSBy ZWFjaCB0aGUgYm90dG9tIGJvdW5kYXJ5LiAqLworICBpID0gZmlyc3RfbmV3ICsgMTsKKyAgd2hp bGUgKGkgPCBkZXNpcmVkX21hdHJpeC0+bnJvd3MgLSAxKQorICAgIHsKKyAgICAgIGludCBib3R0 b207CisgICAgICBpZiAoISBNQVRSSVhfUk9XX0VOQUJMRURfUCAoZGVzaXJlZF9tYXRyaXgsIGkp KQorICAgICAgICByZXR1cm4gMDsKKyAgICAgIGJvdHRvbSA9IE1BVFJJWF9ST1dfQk9UVE9NX1kg KE1BVFJJWF9ST1cgKGRlc2lyZWRfbWF0cml4LCBpKSk7CisgICAgICBpZiAoYm90dG9tIDw9IHli KQorICAgICAgICArK2k7CisgICAgICBpZiAoYm90dG9tID49IHliKQorICAgICAgICBicmVhazsK KyAgICB9CisgIGxhc3RfbmV3ID0gaTsKKyAgLyogU2V0IGxhc3Rfb2xkIHRvIHRoZSBpbmRleCAr IDEgb2YgdGhlIHJvdyB0aGF0IHJlYWNoZXMgdGhlIGJvdHRvbQorICAgICBib3VuZGFyeSBpbiB0 aGUgY3VycmVudCBtYXRyaXguICBXZSBkb24ndCBsb29rIGF0IHRoZSBlbmFibGVkCisgICAgIGZs YWcgaGVyZSBiZWNhdXNlIHdlIHBsYW4gdG8gcmV1c2UgcGFydCBvZiB0aGUgZGlzcGxheSBldmVu IGlmCisgICAgIG90aGVyIHBhcnRzIGFyZSBkaXNhYmxlZC4gKi8KKyAgaSA9IGZpcnN0X29sZCAr IDE7CisgIHdoaWxlIChpIDwgY3VycmVudF9tYXRyaXgtPm5yb3dzIC0gMSkKKyAgICB7CisgICAg ICBpbnQgYm90dG9tID0gTUFUUklYX1JPV19CT1RUT01fWSAoTUFUUklYX1JPVyAoY3VycmVudF9t YXRyaXgsIGkpKTsKKyAgICAgIGlmIChib3R0b20gPD0geWIpCisgICAgICAgICsraTsKKyAgICAg IGlmIChib3R0b20gPj0geWIpCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgbGFz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ucm93cyA+IG1jX29sZF9s aW5lc19zaXplKQorICAgIG1jX29sZF9saW5lcyA9IHhwYWxsb2MgKG1jX29sZF9saW5lcywgJm1j X29sZF9saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRfbWF0cml4 LT5ucm93cyAtIG1jX29sZF9saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgIElO VF9NQVgsIHNpemVvZiAqbWNfb2xkX2xpbmVzKTsKKyAgaWYgKGRlc2lyZWRfbWF0cml4LT5ucm93 cyA+IG1jX25ld19saW5lc19zaXplKQorICAgIG1jX25ld19saW5lcyA9IHhwYWxsb2MgKG1jX25l d19saW5lcywgJm1jX25ld19saW5lc19zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgIGRl c2lyZWRfbWF0cml4LT5ucm93cyAtIG1jX25ld19saW5lc19zaXplLAorICAgICAgICAgICAgICAg ICAgICAgICAgIElOVF9NQVgsIHNpemVvZiAqbWNfbmV3X2xpbmVzKTsKKyAgbiA9IGRlc2lyZWRf bWF0cml4LT5ucm93czsKKyAgbiArPSBjdXJyZW50X21hdHJpeC0+bnJvd3M7CisgIGlmIChtY19y b3dfdGFibGVfc2l6ZSA8IDMgKiBuKQorICAgIHsKKyAgICAgIHB0cmRpZmZfdCBzaXplID0gbmV4 dF9hbG1vc3RfcHJpbWUgKDMgKiBuKTsKKyAgICAgIG1jX3Jvd190YWJsZSA9IHhucmVhbGxvYyAo bWNfcm93X3RhYmxlLCBzaXplLCBzaXplb2YgKm1jX3Jvd190YWJsZSk7CisgICAgICBtY19yb3df dGFibGVfc2l6ZSA9IHNpemU7CisgICAgICBtZW1zZXQgKG1jX3Jvd190YWJsZSwgMCwgc2l6ZSAq IHNpemVvZiAqbWNfcm93X3RhYmxlKTsKKyAgICB9CisgIGlmIChuID4gbWNfcm93X2VudHJ5X3Bv b2xfc2l6ZSkKKyAgICBtY19yb3dfZW50cnlfcG9vbCA9IHhwYWxsb2MgKG1jX3Jvd19lbnRyeV9w b29sLCAmbWNfcm93X2VudHJ5X3Bvb2xfc2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIG4gLSBtY19yb3dfZW50cnlfcG9vbF9zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgLTEsIHNpemVvZiAqbWNfcm93X2VudHJ5X3Bvb2wpOworICBpZiAoZGVzaXJlZF9tYXRy aXgtPm5yb3dzID4gbWNfcnVuc19zaXplKQorICAgIHsKKyAgICAgIG1jX3J1bnMgPSB4bnJlYWxs b2MgKG1jX3J1bnMsIGRlc2lyZWRfbWF0cml4LT5ucm93cywgc2l6ZW9mICptY19ydW5zKTsKKyAg ICAgIG1jX3J1bl9wb29sID0geG5yZWFsbG9jIChtY19ydW5fcG9vbCwgZGVzaXJlZF9tYXRyaXgt Pm5yb3dzLCBzaXplb2YgKm1jX3J1bl9wb29sKTsKKyAgICAgIG1jX3J1bnNfc2l6ZSA9IGRlc2ly ZWRfbWF0cml4LT5ucm93czsKKyAgICB9CisgIG5ydW5zID0gcnVuX2lkeCA9IDA7CisgIG1jX3Jv d19lbnRyeV9pZHggPSAwOworICAvKiBBZGQgcm93cyBmcm9tIHRoZSBjdXJyZW50IGFuZCBkZXNp cmVkIG1hdHJpeCB0byB0aGUgaGFzaCB0YWJsZQorICAgICByb3dfaGFzaF90YWJsZSB0byBiZSBh YmxlIHRvIGZpbmQgZXF1YWwgb25lcyBxdWlja2x5LiAqLworICBmb3IgKGkgPSBmaXJzdF9vbGQ7 IGkgPCBsYXN0X29sZDsgKytpKQorICAgIHsKKyAgICAgIGlmIChNQVRSSVhfUk9XX0VOQUJMRURf UCAoY3VycmVudF9tYXRyaXgsIGkpKQorICAgICAgICB7CisgICAgICAgICAgZW50cnkgPSBtY19h ZGRfcm93X2VudHJ5IChNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSkpOworICAgICAgICAg IG1jX29sZF9saW5lc1tpXSA9IGVudHJ5OworICAgICAgICAgICsrZW50cnktPm9sZF91c2VzOwor ICAgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIG1jX29sZF9saW5lc1tpXSA9IE5VTEw7Cisg ICAgfQorICBmb3IgKGkgPSBmaXJzdF9uZXc7IGkgPCBsYXN0X25ldzsgKytpKQorICAgIHsKKyAg ICAgIGVhc3NlcnQgKE1BVFJJWF9ST1dfRU5BQkxFRF9QIChkZXNpcmVkX21hdHJpeCwgaSkpOwor ICAgICAgZW50cnkgPSBtY19hZGRfcm93X2VudHJ5IChNQVRSSVhfUk9XIChkZXNpcmVkX21hdHJp eCwgaSkpOworICAgICAgKytlbnRyeS0+bmV3X3VzZXM7CisgICAgICBlbnRyeS0+bmV3X2xpbmVf bnVtYmVyID0gaTsKKyAgICAgIG1jX25ld19saW5lc1tpXSA9IGVudHJ5OworICAgIH0KKyAgLyog SWRlbnRpZnkgbW92ZXMgYmFzZWQgb24gbGluZXMgdGhhdCBhcmUgdW5pcXVlIGFuZCBlcXVhbAor ICAgICBpbiBib3RoIG1hdHJpY2VzLiAqLworICBmb3IgKGkgPSBmaXJzdF9vbGQ7IGkgPCBsYXN0 X29sZDspCisgICAgaWYgKG1jX29sZF9saW5lc1tpXQorICAgICAgICAmJiBtY19vbGRfbGluZXNb aV0tPm9sZF91c2VzID09IDEKKyAgICAgICAgJiYgbWNfb2xkX2xpbmVzW2ldLT5uZXdfdXNlcyA9 PSAxKQorICAgICAgeworICAgICAgICBpbnQgcCwgcTsKKyAgICAgICAgaW50IG5ld19saW5lID0g bWNfb2xkX2xpbmVzW2ldLT5uZXdfbGluZV9udW1iZXI7CisgICAgICAgIHN0cnVjdCBydW4gKnJ1 biA9IG1jX3J1bl9wb29sICsgcnVuX2lkeCsrOworICAgICAgICAvKiBSZWNvcmQgbW92ZS4gKi8K KyAgICAgICAgcnVuLT5jdXJyZW50X3Zwb3MgPSBpOworICAgICAgICBydW4tPmN1cnJlbnRfeSA9 IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCBpKS0+eTsKKyAgICAgICAgcnVuLT5kZXNpcmVk X3Zwb3MgPSBuZXdfbGluZTsKKyAgICAgICAgcnVuLT5kZXNpcmVkX3kgPSBNQVRSSVhfUk9XIChk ZXNpcmVkX21hdHJpeCwgbmV3X2xpbmUpLT55OworICAgICAgICBydW4tPm5yb3dzID0gMTsKKyAg ICAgICAgcnVuLT5oZWlnaHQgPSBNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSktPmhlaWdo dDsKKyAgICAgICAgLyogRXh0ZW5kIGJhY2t3YXJkLiAqLworICAgICAgICBwID0gaSAtIDE7Cisg ICAgICAgIHEgPSBuZXdfbGluZSAtIDE7CisgICAgICAgIHdoaWxlIChwID4gZmlyc3Rfb2xkCisg ICAgICAgICAgICAgICAmJiBxID4gZmlyc3RfbmV3CisgICAgICAgICAgICAgICAmJiBtY19vbGRf bGluZXNbcF0gPT0gbWNfbmV3X2xpbmVzW3FdKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGlu dCBoID0gTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIHApLT5oZWlnaHQ7CisgICAgICAgICAg ICAtLXJ1bi0+Y3VycmVudF92cG9zOworICAgICAgICAgICAgLS1ydW4tPmRlc2lyZWRfdnBvczsK KyAgICAgICAgICAgICsrcnVuLT5ucm93czsKKyAgICAgICAgICAgIHJ1bi0+aGVpZ2h0ICs9IGg7 CisgICAgICAgICAgICBydW4tPmRlc2lyZWRfeSAtPSBoOworICAgICAgICAgICAgcnVuLT5jdXJy ZW50X3kgLT0gaDsKKyAgICAgICAgICAgIC0tcCwgLS1xOworICAgICAgICAgIH0KKyAgICAgICAg LyogRXh0ZW5kIGZvcndhcmQuICovCisgICAgICAgIHAgPSBpICsgMTsKKyAgICAgICAgcSA9IG5l d19saW5lICsgMTsKKyAgICAgICAgd2hpbGUgKHAgPCBsYXN0X29sZAorICAgICAgICAgICAgICAg JiYgcSA8IGxhc3RfbmV3CisgICAgICAgICAgICAgICAmJiBtY19vbGRfbGluZXNbcF0gPT0gbWNf bmV3X2xpbmVzW3FdKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGludCBoID0gTUFUUklYX1JP VyAoY3VycmVudF9tYXRyaXgsIHApLT5oZWlnaHQ7CisgICAgICAgICAgICArK3J1bi0+bnJvd3M7 CisgICAgICAgICAgICBydW4tPmhlaWdodCArPSBoOworICAgICAgICAgICAgKytwLCArK3E7Cisg ICAgICAgICAgfQorICAgICAgICAvKiBJbnNlcnQgcnVuIGludG8gbGlzdCBvZiBhbGwgcnVucy4g IE9yZGVyIHJ1bnMgYnkgY29waWVkCisgICAgICAgICAgIHBpeGVsIGxpbmVzLiAgTm90ZSB0aGF0 IHdlIHJlY29yZCBydW5zIHRoYXQgZG9uJ3QgaGF2ZSB0bworICAgICAgICAgICBiZSBjb3BpZWQg YmVjYXVzZSB0aGV5IGFyZSBhbHJlYWR5IGluIHBsYWNlLiAgVGhpcyBpcyBkb25lCisgICAgICAg ICAgIGJlY2F1c2Ugd2UgY2FuIGF2b2lkIGNhbGxpbmcgdXBkYXRlX3dpbmRvd19saW5lIGluIHRo aXMKKyAgICAgICAgICAgY2FzZS4gKi8KKyAgICAgICAgZm9yIChwID0gMDsgcCA8IG5ydW5zICYm IG1jX3J1bnNbcF0tPmhlaWdodCA+IHJ1bi0+aGVpZ2h0OyArK3ApCisgICAgICAgICAgOworICAg ICAgICBmb3IgKHEgPSBucnVuczsgcSA+IHA7IC0tcSkKKyAgICAgICAgICBtY19ydW5zW3FdID0g bWNfcnVuc1txIC0gMV07CisgICAgICAgIG1jX3J1bnNbcF0gPSBydW47CisgICAgICAgICsrbnJ1 bnM7CisgICAgICAgIGkgKz0gcnVuLT5ucm93czsKKyAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAg ICAgKytpOworICAvKiBEbyB0aGUgbW92ZXMuICBEbyBpdCBpbiBhIHdheSB0aGF0IHdlIGRvbid0 IG92ZXJ3cml0ZSBzb21ldGhpbmcKKyAgICAgd2Ugd2FudCB0byBjb3B5IGxhdGVyIG9uLiAgVGhp cyBpcyBub3Qgc29sdmFibGUgaW4gZ2VuZXJhbAorICAgICBiZWNhdXNlIHRoZXJlIGlzIG9ubHkg b25lIGRpc3BsYXkgYW5kIHdlIGRvbid0IGhhdmUgYSB3YXkgdG8KKyAgICAgZXhjaGFuZ2UgYXJl YXMgb24gdGhpcyBkaXNwbGF5LiAgRXhhbXBsZToKKyAgICAgICAgICArLS0tLS0tLS0tLS0rICAg ICAgICstLS0tLS0tLS0tLSsKKyAgICAgICAgICB8ICAgICBBICAgICB8ICAgICAgIHwgICAgIEIg ICAgIHwKKyAgICAgICAgICArLS0tLS0tLS0tLS0rICAtLT4gICstLS0tLS0tLS0tLSsKKyAgICAg ICAgICB8ICAgICBCICAgICB8ICAgICAgIHwgICAgIEEgICAgIHwKKyAgICAgICAgICArLS0tLS0t LS0tLS0rICAgICAgICstLS0tLS0tLS0tLSsKKyAgICAgSW5zdGVhZCwgcHJlZmVyIGJpZ2dlciBt b3ZlcywgYW5kIGludmFsaWRhdGUgbW92ZXMgdGhhdCB3b3VsZAorICAgICBjb3B5IGZyb20gd2hl cmUgd2UgY29waWVkIHRvLiAqLworICBmb3IgKGkgPSAwOyBpIDwgbnJ1bnM7ICsraSkKKyAgICBp ZiAobWNfcnVuc1tpXS0+bnJvd3MgPiAwKQorICAgICAgeworICAgICAgICBzdHJ1Y3QgcnVuICpy ID0gbWNfcnVuc1tpXTsKKyAgICAgICAgaWYgKHItPmN1cnJlbnRfeSAhPSByLT5kZXNpcmVkX3kp CisgICAgICAgICAgeworICAgICAgICAgICAgLy8gIGZwcmludGYgKHN0ZGVyciwgIiVzOiAgci0+ Y3VycmVudC9kZXNpcmVkX3Zwb3MgKCVkLyVkKSB8IHItPmN1cnJlbnQvZGVzaXJlZF95ICglZC8l ZClcbiIsCisgICAgICAgICAgICAvLyAgICAgICAgICAgci0+Y3VycmVudF95IDwgci0+ZGVzaXJl ZF95ID8gIuKGkyIgOiAi4oaRIiwKKyAgICAgICAgICAgIC8vICAgICAgICAgICByLT5jdXJyZW50 X3Zwb3MsIHItPmRlc2lyZWRfdnBvcywgci0+Y3VycmVudF95LCByLT5kZXNpcmVkX3kpOworICAg ICAgICAgICAgLy8gIHJpZi0+Y2xlYXJfd2luZG93X21vdXNlX2ZhY2UgKHcpOworICAgICAgICAg ICAgLy8gIHJpZi0+c2Nyb2xsX3J1bl9ob29rICh3LCByKTsKKyAgICAgICAgICB9CisgICAgICAg IC8qIFRydW5jYXRlIHJ1bnMgdGhhdCBjb3B5IHRvIHdoZXJlIHdlIGNvcGllZCB0bywgYW5kCisg ICAgICAgICAgIGludmFsaWRhdGUgcnVucyB0aGF0IGNvcHkgZnJvbSB3aGVyZSB3ZSBjb3BpZWQg dG8uICovCisgICAgICAgIGZvciAoaiA9IG5ydW5zIC0gMTsgaiA+IGk7IC0taikKKyAgICAgICAg ICB7CisgICAgICAgICAgICBzdHJ1Y3QgcnVuICpwID0gbWNfcnVuc1tqXTsKKyAgICAgICAgICAg IGJvb2wgdHJ1bmNhdGVkX3AgPSAwOworICAgICAgICAgICAgaWYgKHAtPm5yb3dzID4gMAorICAg ICAgICAgICAgICAgICYmIHAtPmRlc2lyZWRfeSA8IHItPmRlc2lyZWRfeSArIHItPmhlaWdodAor ICAgICAgICAgICAgICAgICYmIHAtPmRlc2lyZWRfeSArIHAtPmhlaWdodCA+IHItPmRlc2lyZWRf eSkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChwLT5kZXNpcmVkX3kgPCBy LT5kZXNpcmVkX3kpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHAt Pm5yb3dzID0gci0+ZGVzaXJlZF92cG9zIC0gcC0+ZGVzaXJlZF92cG9zOworICAgICAgICAgICAg ICAgICAgICBwLT5oZWlnaHQgPSByLT5kZXNpcmVkX3kgLSBwLT5kZXNpcmVkX3k7CisgICAgICAg ICAgICAgICAgICAgIHRydW5jYXRlZF9wID0gMTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAg ICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAg IGludCBucm93c19jb3BpZWQgPSAoci0+ZGVzaXJlZF92cG9zICsgci0+bnJvd3MKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIHAtPmRlc2lyZWRfdnBvcyk7CisgICAg ICAgICAgICAgICAgICAgIGlmIChwLT5ucm93cyA8PSBucm93c19jb3BpZWQpCisgICAgICAgICAg ICAgICAgICAgICAgcC0+bnJvd3MgPSAwOworICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGhl aWdodF9jb3BpZWQgPSAoci0+ZGVzaXJlZF95ICsgci0+aGVpZ2h0CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gcC0+ZGVzaXJlZF95KTsKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgcC0+Y3VycmVudF92cG9zICs9IG5yb3dzX2NvcGllZDsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgcC0+ZGVzaXJlZF92cG9zICs9IG5yb3dzX2NvcGllZDsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgcC0+bnJvd3MgLT0gbnJvd3NfY29waWVkOworICAgICAg ICAgICAgICAgICAgICAgICAgICBwLT5jdXJyZW50X3kgKz0gaGVpZ2h0X2NvcGllZDsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgcC0+ZGVzaXJlZF95ICs9IGhlaWdodF9jb3BpZWQ7CisgICAg ICAgICAgICAgICAgICAgICAgICAgIHAtPmhlaWdodCAtPSBoZWlnaHRfY29waWVkOworICAgICAg ICAgICAgICAgICAgICAgICAgICB0cnVuY2F0ZWRfcCA9IDE7CisgICAgICAgICAgICAgICAgICAg ICAgICB9CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAg IGlmIChyLT5jdXJyZW50X3kgIT0gci0+ZGVzaXJlZF95CisgICAgICAgICAgICAgICAgLyogVGhl IGNvbmRpdGlvbiBiZWxvdyBpcyBlcXVpdmFsZW50IHRvCisgICAgICAgICAgICAgICAgICAgKChw LT5jdXJyZW50X3kgPj0gci0+ZGVzaXJlZF95CisgICAgICAgICAgICAgICAgICAgICAmJiBwLT5j dXJyZW50X3kgPCByLT5kZXNpcmVkX3kgKyByLT5oZWlnaHQpCisgICAgICAgICAgICAgICAgICAg IHx8IChwLT5jdXJyZW50X3kgKyBwLT5oZWlnaHQgPiByLT5kZXNpcmVkX3kKKyAgICAgICAgICAg ICAgICAgICAgICAgICYmIChwLT5jdXJyZW50X3kgKyBwLT5oZWlnaHQKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICA8PSByLT5kZXNpcmVkX3kgKyByLT5oZWlnaHQpKSkKKyAgICAgICAgICAg ICAgICAgICBiZWNhdXNlIHdlIGhhdmUgMCA8IHAtPmhlaWdodCA8PSByLT5oZWlnaHQuICovCisg ICAgICAgICAgICAgICAgJiYgcC0+Y3VycmVudF95IDwgci0+ZGVzaXJlZF95ICsgci0+aGVpZ2h0 CisgICAgICAgICAgICAgICAgJiYgcC0+Y3VycmVudF95ICsgcC0+aGVpZ2h0ID4gci0+ZGVzaXJl ZF95KQorICAgICAgICAgICAgICBwLT5ucm93cyA9IDA7CisgICAgICAgICAgICAvKiBSZW9yZGVy IHJ1bnMgYnkgY29waWVkIHBpeGVsIGxpbmVzIGlmIHRydW5jYXRlZC4gKi8KKyAgICAgICAgICAg IGlmICh0cnVuY2F0ZWRfcCAmJiBwLT5ucm93cyA+IDApCisgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICBpbnQgayA9IG5ydW5zIC0gMTsKKyAgICAgICAgICAgICAgICB3aGlsZSAobWNf cnVuc1trXS0+bnJvd3MgPT0gMCB8fCBtY19ydW5zW2tdLT5oZWlnaHQgPCBwLT5oZWlnaHQpCisg ICAgICAgICAgICAgICAgICBrLS07CisgICAgICAgICAgICAgICAgbWVtbW92ZSAobWNfcnVucyAr IGosIG1jX3J1bnMgKyBqICsgMSwgKGsgLSBqKSAqIHNpemVvZiAoKm1jX3J1bnMpKTsKKyAgICAg ICAgICAgICAgICBtY19ydW5zW2tdID0gcDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0K KyAgICAgICAgLyogQXNzaWduIG1hdHJpeCByb3dzLiAqLworICAgICAgICBmb3IgKGogPSAwOyBq IDwgci0+bnJvd3M7ICsraikKKyAgICAgICAgICB7CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhf cm93ICpmcm9tLCAqdG87CisgICAgICAgICAgICBib29sIHRvX292ZXJsYXBwZWRfcDsKKyAgICAg ICAgICAgIHRvID0gTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIHItPmRlc2lyZWRfdnBvcyAr IGopOworICAgICAgICAgICAgZnJvbSA9IE1BVFJJWF9ST1cgKGRlc2lyZWRfbWF0cml4LCByLT5k ZXNpcmVkX3Zwb3MgKyBqKTsKKyAgICAgICAgICAgIHRvX292ZXJsYXBwZWRfcCA9IHRvLT5vdmVy bGFwcGVkX3A7CisgICAgICAgICAgICBmcm9tLT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcCA9IGZy b20tPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcDsKKyAgICAgICAgICAgIGFzc2lnbl9yb3cgKHRv LCBmcm9tKTsKKyAgICAgICAgICAgIC8qIFRoZSBhYm92ZSBgYXNzaWduX3JvdycgYWN0dWFsbHkg ZG9lcyBzd2FwLCBzbyBpZiB3ZSBoYWQKKyAgICAgICAgICAgICAgIGFuIG92ZXJsYXAgaW4gdGhl IGNvcHkgZGVzdGluYXRpb24gb2YgdHdvIHJ1bnMsIHRoZW4KKyAgICAgICAgICAgICAgIHRoZSBz ZWNvbmQgcnVuI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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IC0xOworICBp bnQgbWF0cml4X3Jvd19zdGFydF9ieXRlcG9zID0gTUFUUklYX1JPV19TVEFSVF9CWVRFUE9TIChk ZXNpcmVkX3Jvdyk7CisgIGludCBtYXRyaXhfcm93X2VuZF9ieXRlcG9zID0gTUFUUklYX1JPV19F TkRfQllURVBPUyAoZGVzaXJlZF9yb3cpOworICAvKiBUaGUgZmlyc3QgY29uZGl0aW9uIHRlc3Rz IGZvciBhIHNvbGl0YXJ5IHJvdyBjb250YWluaW5nIFpWLCBwcmVjZWRlZCBieSBhCisgIHJvdyBj b250YWluaW5nIGEgcGVudWx0aW1hdGUgZ2x5cGggd2l0aCBhIGNoYXJwb3Mgb2YgWlYgLSAxIGZv bGxvd2VkIGJ5IGFuIGVuZAorICBvZiByb3cgc3BhY2UgZ2x5cGggd2l0aCBhIGNoYXJwb3Mgb2Yg MC4gIFRoZSBvdGhlciBjb25kaXRpb25zIHRlc3QgZm9yIGFuIGVtcHR5CisgIGJ1ZmZlciAobm90 IG5hcnJvd2VkKSwgb3IgYW4gZW1wdHkgbmFycm93ZWQgYnVmZmVyLiAqLworICBib29sIHJvd19h dF96dl9wID0gKCh2cG9zICE9IDAKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgKGN1cnJlbnRf cm93IC0gMSktPnVzZWRbVEVYVF9BUkVBXSA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgJiYg cHJldl9tYXRyaXhfcm93X3N0YXJ0X2J5dGVwb3MgIT0gcHJldl9tYXRyaXhfcm93X2VuZF9ieXRl cG9zCisgICAgICAgICAgICAgICAgICAgICAgICYmICEoY3VycmVudF9yb3cgLSAxKS0+ZW5kc19h dF96dl9wCisgICAgICAgICAgICAgICAgICAgICAgICYmIG1hdHJpeF9yb3dfc3RhcnRfYnl0ZXBv cyA9PSBtYXRyaXhfcm93X2VuZF9ieXRlcG9zCisgICAgICAgICAgICAgICAgICAgICAgICYmIGRl c2lyZWRfcm93LT5lbmRzX2F0X3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgfHwgKCgoaGVh ZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID09IDEpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICB8fCAoaGVhZGVyX2xpbmVfZm9ybWF0ID09IDAgJiYgdnBvcyA9PSAwKSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgYnVmZmVyX25hcnJvd2VkX3AKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgYm9iX3Jlc3BlY3RfbmFycm93ID09IGVvYl9yZXNwZWN0X25hcnJvdykKKyAg ICAgICAgICAgICAgICAgICAgICB8fCAoKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3Mg PT0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChoZWFkZXJfbGluZV9mb3JtYXQg PT0gMCAmJiB2cG9zID09IDApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBib2JfZGlz cmVnYXJkX25hcnJvdyA9PSBlb2JfZGlzcmVnYXJkX25hcnJvdykpOworICAvKiBJZiBsaW5lLW51 bWJlcnMgYXJlIGFjdGl2ZSwgdGhlbiBzcGFjZSBnbHlwaCBwYWRkaW5nIGVxdWFsIHRvIGl0cyB3 aWR0aAorICBjb3VudGVkIGluIEhQT1MgYXJlIGZvbGxvd2VkIGJ5IGEgc2luZ2xlIHJvdyBlbmQg c3BhY2UgZ2x5cGguICBMaW5lIG51bWJlcgorICBwYWRkaW5nIHNwYWNlIGdseXBocyBoYXZlIGEg Y2hhcnBvcyBvZiAtMSwgd2hlcmVhcyB0aGUgZW5kIG9mIHJvdyBzcGFjZSBnbHlwaAorICBoYXMg YSBjaGFycG9zIG9mIDAuICBJZiBsaW5lIG51bWJlcnMgYXJlIGluYWN0aXZlLCB0aGVuIHRoZSBy b3cgd2lsbCBjb250YWluCisgIGEgc29saXRhcnkgc3BhY2UgZ2x5cGggd2l0aCBhIGNoYXJwb3Mg b2YgLTEuICovCisgIGJvb2wgcm93X2JleW9uZF96dl9wID0gKG1hdHJpeF9yb3dfc3RhcnRfYnl0 ZXBvcyA9PSBtYXRyaXhfcm93X2VuZF9ieXRlcG9zCisgICAgICAgICAgICAgICAgICAgICAgICAg ICYmICFyb3dfYXRfenZfcCk7CisgIHJldHVybiAocm93X2F0X3p2X3ApCisgICAgICAgICAgID8g QVRfWlYKKyAgICAgICAgIDogKHJvd19iZXlvbmRfenZfcCkKKyAgICAgICAgICAgPyBQT1NUX1pW CisgICAgICAgICA6IFBSRV9aVjsKK30KKworLyogVXBkYXRlIHRoZSBkaXNwbGF5IG9mIHRoZSB0 ZXh0IGFyZWEgb2Ygcm93IFZQT1MgaW4gd2luZG93IFcuCisgICBWYWx1ZSBpcyB0cnVlIGlmIGRp c3BsYXkgaGFzIGNoYW5nZWQuICovCitzdGF0aWMgYm9vbAorbWNfdXBkYXRlX3RleHRfYXJlYSAo c3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqdXBkYXRlZF9yb3csIGludCB2cG9z LAorICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX21hdHJpeCAqY3Vyc29yX21hdHJp eCwKKyAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19lc3NlbnRpYWxzIGVzc2VudGlhbHMs IGJvb2wgZHJhd19wKQoreworICBib29sIGRlYnVnX3AgPSBmYWxzZTsKKyAgc3RydWN0IGdseXBo X3JvdyAqY3VycmVudF9yb3cgPSBNQVRSSVhfUk9XICh3LT5jdXJyZW50X21hdHJpeCwgdnBvcyk7 CisgIHN0cnVjdCBnbHlwaF9yb3cgKmRlc2lyZWRfcm93ID0gTUFUUklYX1JPVyAody0+ZGVzaXJl ZF9tYXRyaXgsIHZwb3MpOworICBzdHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFjZSAqcmlmID0gRlJB TUVfUklGIChYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpKTsKKyAgYm9vbCBjaGFuZ2VkX3AgPSAw OworICBzdHJ1Y3QgbWNfUkdCIGxzbCA9IHsucmVkID0gLTEuMCwgLmdyZWVuID0gLTEuMCwgLmJs dWUgPSAtMS4wfTsKKyAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gTk9fRkxBVk9SOwor ICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlID0gTk9fQ1VSU09SOworICBpbnQgd2Qg PSAtMTsKKyAgYm9vbCBjdXJzb3JfZ2NfcCA9IGZhbHNlOworICBzdHJ1Y3QgZ2x5cGhfbWF0cml4 ICpkZXNpcmVkX21hdHJpeCA9IHctPmRlc2lyZWRfbWF0cml4OworICBpZiAoZGVidWdfcCkKKyAg ICBmcHJpbnRmIChzdGRlcnIsICJtY191cGRhdGVfdGV4dF9hcmVhICglcyk6ICB2cG9zICglZClc biIsCisgICAgICAgICAgICAgICAgICAgICAgbWNfd2luZG93ICh3KSwgdnBvcyk7CisgIC8qIElu YXNtdWNoIGFzIHdlIHByb2Nlc3MgdGhlIGN1cnNvciByb3cgYmVmb3JlIGFsbCBvdGhlciByb3dz LCB3ZSBjYW4gcmVseQorICB1cG9uIHRoZSBwcmV2aW91cyBgZGVzaXJlZF9yb3dgIHRvIGJlIGFj Y3VyYXRlLiAqLworICBlbnVtIG1jX3Jvd19wb3NpdGlvbiByb3dfcG9zaXRpb24gPSAgbWNfcm93 X3Bvc2l0aW9uICh3LCB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZGVzaXJlZF9yb3cKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiBjdXJyZW50X3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgZGVzaXJlZF9yb3csIHZwb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YVF9BUkVBXTsKKyAgICAgICAgICB3LT5vdXRwdXRfY3Vyc29y LnggPQorICAgICAgICAgICAgbWNfZHJhd19nbHlwaHMgKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRh dGVkX3Jvdywgdy0+b3V0cHV0X2N1cnNvci54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAg IFRFWFRfQVJFQSwgaHBvcywgaHBvcyArIGxlbiwgRFJBV19OT1JNQUxfVEVYVCwgMCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCBsc2wsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5 cGUsIHdkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZlX3As IGN1cnNvcl9nY19wLCBNQ19EUkFXX0dMWVBIX1NUUklORywKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICBkcmF3X3ApOworICAgICAgICAgIHctPm91dHB1dF9jdXJzb3IuaHBvcyArPSBsZW47 CisgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgfQorICAgICAgLyogQ2xlYXIg dG8gZW5kIG9mIHdpbmRvdy4gKi8KKyAgICAgIGlmIChkcmF3X3ApCisgICAgICAgIHJpZi0+Y2xl YXJfZW5kX29mX2xpbmUgKHcsIHVwZGF0ZWRfcm93LCBURVhUX0FSRUEsIC0xKTsKKyAgICAgIGNo YW5nZWRfcCA9IDE7CisgICAgICAvKiBUaGlzIGVyYXNlcyB0aGUgY3Vyc29yLiAgV2UgZG8gdGhp cyBoZXJlIGJlY2F1c2UKKyAgICAgICAgIG5vdGljZW92ZXJ3cml0dGVuX3RleHRfY3Vyc29yIGNh bm5vdCBlYXNpbHkgY2hlY2sgdGhpcywgd2hpY2gKKyAgICAgICAgIG1pZ2h0IGluZGljYXRlIHRo YXQgdGhlIHdob2xlIGZ1bmN0aW9uYWxpdHkgb2YKKyAgICAgICAgIG5vdGljZW92ZXJ3cml0dGVu X3RleHRfY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HNfcCA9IGN1cnJlbnRfcm93LT5jb250 YWluc19vdmVybGFwcGluZ19nbHlwaHNfcDsKKyAgICAgICAgaW50IGRlc2lyZWRfc3RvcF9wb3Mg PSBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdOworICAgICAgICBib29sIGFib3J0X3NraXBw aW5nID0gMDsKKyAgICAgICAgLyogSWYgdGhlIGRlc2lyZWQgcm93IGV4dGVuZHMgaXRzIGZhY2Ug dG8gdGhlIHRleHQgYXJlYSBlbmQsIGFuZCB1bmxlc3MgdGhlCisgICAgICAgIGN1cnJlbnQgcm93 IGFsc28gZG9lcyBzbyBhdCB0aGUgc2FtZSBwb3NpdGlvbiwgbWFrZSBzdXJlIHdlIHdyaXRlIGF0 IGxlYXN0IG9uZQorICAgICAgICBnbHlwaCwgc28gdGhhdCB0aGUgZmFjZSBleHRlbnNpb24gYWN0 dWFsbHkgdGFrZXMgcGxhY2UuICovCisgICAgICAgIGlmIChNQVRSSVhfUk9XX0VYVEVORFNfRkFD RV9QIChkZXNpcmVkX3JvdykKKyAgICAgICAgICAgICYmIChkZXNpcmVkX3N0b3BfcG9zIDwgY3Vy cmVudF9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgIHx8IChkZXNpcmVkX3N0 b3BfcG9zID09IGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAgICAg ICAgJiYgIU1BVFJJWF9ST1dfRVhURU5EU19GQUNFX1AgKGN1cnJlbnRfcm93KSkpKQorICAgICAg ICAgIC0tZGVzaXJlZF9zdG9wX3BvczsKKyAgICAgICAgc3RvcCA9IG1pbiAoY3VycmVudF9yb3ct PnVzZWRbVEVYVF9BUkVBXSwgZGVzaXJlZF9zdG9wX3Bvcyk7CisgICAgICAgIGkgPSAwOworICAg ICAgICB4ID0gZGVzaXJlZF9yb3ctPng7CisgICAgICAgIGludCBjbGVhcl90b194ID0gMDsKKwor ICAgICAgICAvKiBMb29wIG92ZXIgZ2x5cGhzIHRoYXQgY3VycmVudCBhbmQgZGVzaXJlZCByb3cg bWF5IGhhdmUgaW4gY29tbW9uLiAqLworICAgICAgICB3aGlsZSAoaSA8IHN0b3ApCisgICAgICAg ICAgeworICAgICAgICAgICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZCA9IDA7CisgICAgICAg ICAgICBib29sIGNhbl9za2lwX3AgPSAhYWJvcnRfc2tpcHBpbmc7CisgICAgICAgICAgICAvKiBT a2lwIG92ZXIgZ2x5cGhzIHRoYXQgYm90aCByb3dzIGhhdmUgaW4gY29tbW9uLiAgVGhlc2UgZG9u J3QgaGF2ZQorICAgICAgICAgICAgdG8gYmUgd3JpdHRlbi4gIFdlIGNhbid0IHNraXAgaWYgdGhl IGxhc3QgY3VycmVudCBnbHlwaCBvdmVybGFwcyB0aGUKKyAgICAgICAgICAgIGdseXBoIHRvIGl0 cyByaWdodC4gIEZvciBleGFtcGxlLCBjb25zaWRlciBhIGN1cnJlbnQgcm93IG9mIGBpZicgd2l0 aAorICAgICAgICAgICAgdGhlIGBmJyBpbiBDb3VyaWVyIGJvbGQgc28gdGhhdCBpdCBvdmVybGFw cyB0aGUgYCAnIHRvIGl0cyByaWdodC4KKyAgICAgICAgICAgIElmIHRoZSBkZXNpcmVkIHJvdyBp cyBgICcsIHdlIHdvdWxkIHNraXAgb3ZlciB0aGUgc3BhY2UgYWZ0ZXIgdGhlCisgICAgICAgICAg ICBgaWYnIGFuZCB0aGVyZSB3b3VsZCByZW1haW4gYSBwaXhlbCBmcm9tIHRoZSBgZicgb24gdGhl IHNjcmVlbi4gKi8KKyAgICAgICAgICAgIGlmIChvdmVybGFwcGluZ19nbHlwaHNfcCAmJiBpID4g MCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGgg PSAmY3VycmVudF9yb3ctPmdseXBoc1tURVhUX0FSRUFdW2kgLSAxXTsKKyAgICAgICAgICAgICAg ICBpbnQgbGVmdCwgcmlnaHQ7CisgICAgICAgICAgICAgICAgcmlmLT5nZXRfZ2x5cGhfb3Zlcmhh bmdzIChnbHlwaCwgWEZSQU1FICh3LT5mcmFtZSksICZsZWZ0LCAmcmlnaHQpOworICAgICAgICAg ICAgICAgIGNhbl9za2lwX3AgPSAocmlnaHQgPT0gMCAmJiAhYWJvcnRfc2tpcHBpbmcpOworICAg ICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoY2FuX3NraXBfcCkKKyAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgIGludCBzdGFydF9ocG9zID0gaTsKKyAgICAgICAgICAgICAgICB3 aGlsZSAoaSA8IHN0b3AKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgR0xZUEhfRVFVQUxfUCAo ZGVzaXJlZF9nbHlwaCwgY3VycmVudF9nbHlwaCkpCisgICAgICAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgICAgICsrYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZDsKKyAgICAgICAgICAg ICAgICAgICAgaWYgKGFycmF5X2dseXBoc19za2lwcGVkLmFsbG9jYXRlZCA8IGFycmF5X2dseXBo c19za2lwcGVkLnVzZWQpCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg ICAgICAgICAgaW50IG9sZF9hbGxvYyA9IGFycmF5X2dseXBoc19za2lwcGVkLmFsbG9jYXRlZDsK KyAgICAgICAgICAgICAgICAgICAgICAgIGludCBuZXdfZWx0cyA9IGFycmF5X2dseXBoc19za2lw cGVkLnVzZWQgLSBhcnJheV9nbHlwaHNfc2tpcHBlZC5hbGxvY2F0ZWQ7CisgICAgICAgICAgICAg ICAgICAgICAgICBhcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVkID0KKyAgICAgICAgICAgICAg ICAgICAgICAgICAgeHBhbGxvYyAoYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmFycmF5X2dseXBoc19za2lwcGVkLmFsbG9j YXRlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2VsdHMsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElOVF9NQVgsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHNpemVvZiAqYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZCk7 CisgICAgICAgICAgICAgICAgICAgICAgICBtZW1zZXQgKGFycmF5X2dseXBoc19za2lwcGVkLnNr aXBwZWQgKyBvbGRfYWxsb2MsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo YXJyYXlfZ2x5cGhzX3NraXBwZWQuYWxsb2NhdGVkIC0gb2xkX2FsbG9jKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAqIHNpemVvZiAqYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tp cHBlZCk7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpbnQg bnRoID0gYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZCAtIDE7CisgICAgICAgICAgICAgICAgICAg IGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbbnRoXS54ID0geDsKKyAgICAgICAgICAgICAg ICAgICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZFtudGhdLmhwb3MgPSBpOworICAgICAg ICAgICAgICAgICAgICBhcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVkW250aF0uZW5hYmxlZF9w ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgeCArPSBkZXNpcmVkX2dseXBoLT5waXhlbF93 aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgKytkZXNpcmVkX2dseXBoLCArK2N1cnJlbnRfZ2x5 cGgsICsraTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvKiBDb25zaWRl ciB0aGUgY2FzZSB0aGF0IHRoZSBjdXJyZW50IHJvdyBjb250YWlucyAieHh4IHBwcCBnZ2ciIGlu CisgICAgICAgICAgICAgICAgaXRhbGljIENvdXJpZXIgZm9udCwgYW5kIHRoZSBkZXNpcmVkIHJv dyBpcyAieHh4IGdnZyIuICBUaGUgY2hhcmFjdGVyIGBwJworICAgICAgICAgICAgICAgIGhhcyBs YmVhcmluZywgYGcnIGhhcyBub3QuICBUaGUgbG9vcCBhYm92ZSB3aWxsIHN0b3AgaW4gZnJvbnQg b2YgdGhlCisgICAgICAgICAgICAgICAgZmlyc3QgYHAnIGluIHRoZSBjdXJyZW50IHJvdy4gIElm IHdlIHdvdWxkIHN0YXJ0IHdyaXRpbmcgZ2x5cGhzIHRoZXJlLCB3ZQorICAgICAgICAgICAgICAg IHdvdWxkbid0IGVyYXNlIHRoZSBsYmVhcmluZyBvZiB0aGUgYHAnLiAgVGhlIHJlc3Qgb2YgdGhl IGxiZWFyaW5nIHByb2JsZW0KKyAgICAgICAgICAgICAgICBpcyB0aGVuIHRha2VuIGNhcmUgb2Yg YnkgZHJhd19nbHlwaHMuICovCisgICAgICAgICAgICAgICAgaWYgKG92ZXJsYXBwaW5nX2dseXBo c19wCisgICAgICAgICAgICAgICAgICAgICYmIGkgPiAwCisgICAgICAgICAgICAgICAgICAgICYm IGkgPCBjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAgICYm IChjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdICE9IGRlc2lyZWRfcm93LT51c2VkW1RFWFRf QVJFQV0pKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpbnQgbGVm dCwgcmlnaHQ7CisgICAgICAgICAgICAgICAgICAgIHJpZi0+Z2V0X2dseXBoX292ZXJoYW5ncyAo Y3VycmVudF9nbHlwaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBYRlJBTUUgKHctPmZy YW1lKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmbGVmdCwgJnJpZ2h0KTsKKyAgICAg ICAgICAgICAgICAgICAgd2hpbGUgKGxlZnQgPiAwICYmIGkgPiAwKQorICAgICAgICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC0taSwgLS1kZXNpcmVkX2dseXBoLCAt LWN1cnJlbnRfZ2x5cGg7CisgICAgICAgICAgICAgICAgICAgICAgICB4IC09IGRlc2lyZWRfZ2x5 cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICAgICAgICAgICAgbGVmdCAtPSBkZXNpcmVk X2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAg ICAgICAgICAgIC8qIEFib3J0IHRoZSBza2lwcGluZyBhbGdvcml0aG0gaWYgd2UgZW5kIHVwIGJl Zm9yZQorICAgICAgICAgICAgICAgICAgICAgICBvdXIgc3RhcnRpbmcgcG9pbnQsIHRvIGF2b2lk IGxvb3BpbmcgKGJ1ZyMxMDcwKS4KKyAgICAgICAgICAgICAgICAgICAgICAgVGhpcyBjYW4gaGFw cGVuIHdoZW4gdGhlIGxiZWFyaW5nIGlzIGxhcmdlciB0aGFuCisgICAgICAgICAgICAgICAgICAg ICAgIHRoZSBwaXhlbCB3aWR0aC4gKi8KKyAgICAgICAgICAgICAgICAgICAgYWJvcnRfc2tpcHBp bmcgPSAoaSA8IHN0YXJ0X2hwb3MpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICB9CisgICAgICAgICAgICAvKiBUcnkgdG8gYXZvaWQgd3JpdGluZyB0aGUgZW50aXJlIHJlc3Qg b2YgdGhlIGRlc2lyZWQgcm93CisgICAgICAgICAgICAgICBieSBsb29raW5nIGZvciBhIHJlc3lu YyBwb2ludC4gIFRoaXMgbWFpbmx5IHByZXZlbnRzCisgICAgICAgICAgICAgICBtb2RlIGxpbmUg ZmxpY2tlcmluZyBpbiB0aGUgY2FzZSB0aGUgbW9kZSBsaW5lIGlzIGluCisgICAgICAgICAgICAg ICBmaXhlZC1waXRjaCBmb250LCB3aGljaCBpdCB1c3VhbGx5IHdpbGwgYmUuICovCisgICAgICAg ICAgICBpZiAoaSA8IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICBpbnQgc3RhcnRfeCA9IHgsIHN0YXJ0X2hwb3MgPSBpOworICAg ICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqc3RhcnQgPSBkZXNpcmVkX2dseXBoOworICAgICAg ICAgICAgICAgIGludCBjdXJyZW50X3ggPSB4OworICAgICAgICAgICAgICAgIGJvb2wgc2tpcF9m aXJzdF9wID0gIWNhbl9za2lwX3A7CisgICAgICAgICAgICAgICAgLyogRmluZCB0aGUgbmV4dCBn bHlwaCB0aGF0J3MgZXF1YWwgYWdhaW4uICovCisgICAgICAgICAgICAgICAgd2hpbGUgKGkgPCBz dG9wCisgICAgICAgICAgICAgICAgICAgICAgICYmIChza2lwX2ZpcnN0X3AKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgIHx8ICFHTFlQSF9FUVVBTF9QIChkZXNpcmVkX2dseXBoLCBjdXJyZW50 X2dseXBoKSkKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgeCA9PSBjdXJyZW50X3gpCisgICAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHggKz0gZGVzaXJlZF9nbHlwaC0+ cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRfeCArPSBjdXJyZW50X2ds eXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgKytkZXNpcmVkX2dseXBoLCAr K2N1cnJlbnRfZ2x5cGgsICsraTsKKyAgICAgICAgICAgICAgICAgICAgc2tpcF9maXJzdF9wID0g MDsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBmb3IgKGludCBlbHQgPSAw OworICAgICAgICAgICAgICAgICAgICAgZWx0IDwgYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZDsK KyAgICAgICAgICAgICAgICAgICAgICsrZWx0KQorICAgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgICBpbnQgeCA9IGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbZWx0XS54 OworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGFycmF5X2dseXBoc19za2lwcGVkLnNr aXBwZWRbZWx0XS5ocG9zOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnRhcmdl dF9nbHlwaCA9CisgICAgICAgICAgICAgICAgICAgICAgbWNfZ2V0X2N1cnNvcl9nbHlwaCAodywg ZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCBocG9zLCB2cG9zKTsKKyAgICAgICAgICAgICAg ICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgICAgICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJy LCAiU0tJUFBFRDogIHZwb3MgKCVkKSB8IGNoYXIgKCVkLyVzKSB8IHg6ICglZCkgfCBocG9zICgl ZC8lZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCB0 YXJnZXRfZ2x5cGgtPnUuY2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBtY19jaGFyX3RvX3N0cmluZyAodGFyZ2V0X2dseXBoLT51LmNoKSwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHgsIGhwb3MsIHVwZGF0ZWRfcm93LT51c2VkW1RFWFRf QVJFQV0gLSAxKTsKKyAgICAgICAgICAgICAgICAgICAgbWNfZHJhd19yb3cgKHcsIGRlc2lyZWRf bWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBoLCB4LCAxLCB2cG9zLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bv c2l0aW9uLCBkcmF3X3AsIFNLSVBQRUQpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgICAgIGlmIChpID09IHN0YXJ0X2hwb3MgfHwgeCAhPSBjdXJyZW50X3gpCisgICAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGkgPSBzdGFydF9ocG9zOworICAgICAgICAg ICAgICAgICAgICB4ID0gc3RhcnRfeDsKKyAgICAgICAgICAgICAgICAgICAgZGVzaXJlZF9nbHlw aCA9IHN0YXJ0OworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgICAgICBvdXRwdXRfY3Vyc29yX3RvICh3LCB2cG9zLCBzdGFydF9ocG9z LCBkZXNpcmVkX3Jvdy0+eSwgc3RhcnRfeCk7CisgICAgICAgICAgICAgICAgLyogUmUtZHJhdyBh IHBvcnRpb24gb2YgdGhlIHJvdy4gKi8KKyAgICAgICAgICAgICAgICBpZiAoZGVidWdfcCkKKyAg ICAgICAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIlJFRFJBVyBTRUdNRU5UOlxuXAorICAg ICAgICAgICAgICAgICAgICB2cG9zICglZCkgfCBjaGFyICglZC8lcykgfCB4OiAoJWQpIHwgaHBv cyAoJWQvJWQpIHwgbGVuZ3RoICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgIHZwb3MsIHN0 YXJ0LT51LmNoLCBtY19jaGFyX3RvX3N0cmluZyAoc3RhcnQtPnUuY2gpLAorICAgICAgICAgICAg ICAgICAgICBzdGFydF94LCBzdGFydF9ocG9zLCB1cGRhdGVkX3Jvdy0+dXNlZFtURVhUX0FSRUFd IC0gMSwgaSAtIHN0YXJ0X2hwb3MpOworICAgICAgICAgICAgICAgIGJsb2NrX2lucHV0ICgpOwor ICAgICAgICAgICAgICAgIGludCBsZW4gPSBpIC0gc3RhcnRfaHBvczsKKyAgICAgICAgICAgICAg ICBpbnQgaHBvcyA9IHN0YXJ0IC0gdXBkYXRlZF9yb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAg ICAgICAgICAgICAgIHctPm91dHB1dF9jdXJzb3IueCA9CisgICAgICAgICAgICAgICAgICBtY19k cmF3X2dseXBocyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB3LT5vdXRwdXRfY3Vy c29yLngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVEVYVF9BUkVBLCBocG9z LCBocG9zICsgbGVuLCBEUkFXX05PUk1BTF9URVhULAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDAsIHZwb3MsIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVfcCwgY3Vy c29yX2djX3AsIE1DX0RSQVdfR0xZUEhfU1RSSU5HLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGRyYXdfcCk7CisgICAgICAgICAgICAgICAgdy0+b3V0cHV0X2N1cnNvci5ocG9z ICs9IGxlbjsKKyAgICAgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgICAgICAg ICAgIG1jX2RyYXdfcm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHN0YXJ0LCBz dGFydF94LCBpIC0gc3RhcnRfaHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdnBv cywgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBkcmF3X3AsIFNDUklC RV9UV08pOworICAgICAgICAgICAgICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAgICAgICAgIH0K KyAgICAgICAgICB9CisKKyAgICAgICAgLyogV3JpdGUgdGhlIHJlc3QuICovCisgICAgICAgIGlm IChpIDwgZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgICAgICB7CisgICAgICAg ICAgICBvdXRwdXRfY3Vyc29yX3RvICh3LCB2cG9zLCBpLCBkZXNpcmVkX3Jvdy0+eSwgeCk7Cisg ICAgICAgICAgICBpZiAoZGVidWdfcCkKKyAgICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAi RFJBVyBSRU1BSU5ERVIgT0YgVEhFIFJPVzpcblwKKyAgICAgICAgICAgICAgICB2cG9zICglZCkg fCBjaGFyICglZC8lcykgfCB4OiAoJWQpIHwgaHBvcyAoJWQvJWQpIHwgbGVuZ3RoICglZClcbiIs CisgICAgICAgICAgICAgICAgdnBvcywgZGVzaXJlZF9nbHlwaC0+dS5jaCwgbWNfY2hhcl90b19z dHJpbmcgKGRlc2lyZWRfZ2x5cGgtPnUuY2gpLAorICAgICAgICAgICAgICAgIHgsIGksIGRlc2ly ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxLCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFd IC0gaSk7CisgICAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgIGludCBsZW4g PSBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gaTsKKyAgICAgICAgICAgIGludCBocG9z ID0gZGVzaXJlZF9nbHlwaCAtIHVwZGF0ZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAg ICAgICAgIHctPm91dHB1dF9jdXJzb3IueCA9CisgICAgICAgICAgICAgIG1jX2RyYXdfZ2x5cGhz ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHctPm91dHB1dF9jdXJzb3IueCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRFWFRfQVJFQSwgaHBvcywgaHBvcyArIGxlbiwg RFJBV19OT1JNQ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GFyZWEgYXQgaXNzdWUuICov CisgICAgICAgICAgICBtY19kcmF3X3JvdyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93 LCBkZXNpcmVkX2dseXBoLCB4LAorICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2lyZWRfcm93 LT51c2VkW1RFWFRfQVJFQV0gLSBpLCB2cG9zLCBjdXJzb3JfbWF0cml4LAorICAgICAgICAgICAg ICAgICAgICAgICAgIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgZHJhd19wLCBTQ1JJQkVfVEhS RUUpOworICAgICAgICAgICAgY2hhbmdlZF9wID0gMTsKKyAgICAgICAgICB9CisgICAgICAgICAg LyogRXZlcnl0aGluZyBhZnRlciB0aGUgcHJldmlvdXMgY2hhbmdlIHJlbWFpbmVkIHRoZSBzYW1l LiAgYGlgIGFuZCBgeGAgd2VyZQorICAgICAgICAgIGluY3JlbWVudGVkIHRvIHRoZSBlbmQgb2Yg dGhlIGdseXBoIHJvdy4gIGkgPT0gZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAg ICAgIFRoZSBgdy0+b3V0cHV0X2N1cnNvci54L3kvaHBvcy92cG9zYCBpcyBhdCB0aGUgZW5kIG9m IHRoZSBwcmV2aW91cyBjaGFuZ2UuCisgICAgICAgICAgV2hlbiB0aGlzIHNpdHVhdGlvbiBleGlz dHMsIHRoZSBkaXN0YW5jZSBiZXR3ZWVuIHRoZSBlbmQgb2YgdGhlIGdseXBoIHJvdyBhbmQKKyAg ICAgICAgICB0aGUgcmlnaHQgZWRnZSBvZiB0aGUgd2luZG93IHdpbGwgX25vdF8gYmUgY2xlYXJl ZC4gIFRoZXJlZm9yZSwgaXQgaXMgb2theSB0bworICAgICAgICAgIGRyYXcgdGhlIGZsb2F0aW5n IGdseXBocyBmb3IgdGhlIGhvcml6b250YWwvdmVydGljYWwgcnVsZXJzIGhlcmUuICovCisgICAg ICAgICAgZWxzZSBpZiAoY2hhbmdlZF9wCisgICAgICAgICAgICAgICAgICAgJiYgdy0+b3V0cHV0 X2N1cnNvci5ocG9zICE9IHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgICAg ICB7CisgICAgICAgICAgICAgIGludCB4ID0gdy0+b3V0cHV0X2N1cnNvci54OworICAgICAgICAg ICAgICBpbnQgaHBvcyA9IHctPm91dHB1dF9jdXJzb3IuaHBvczsKKyAgICAgICAgICAgICAgc3Ry dWN0IGdseXBoICpzdGFydCA9IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIGRlc2lyZWRfbWF0cml4 LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgdXBkYXRlZF9yb3csIGhwb3MsIHZwb3MpOworICAgICAgICAgICAgICBpZiAody0+b3V0cHV0 X2N1cnNvci54ID09IHVwZGF0ZWRfcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICB4 IC09IHN0YXJ0LT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgaWYgKGRlYnVnX3ApCisgICAg ICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiUE9TVC1DSEFOR0VEOiAgdnBvcyAoJWQpIHwg eCAoJWQpIHwgaHBvcyAoJWQvJWQpIHwgY2hhciAoJWQvJXMpXG4iLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgdnBvcywgeCwgaHBvcywgdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9B UkVBXSAtIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydC0+dS5jaCwg bWNfY2hhcl90b19zdHJpbmcgKHN0YXJ0LT51LmNoKSk7CisgICAgICAgICAgICAgIG1jX2RyYXdf cm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHN0YXJ0LCB4LAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIGhwb3MsIHZw b3MsIGN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBlc3NlbnRpYWxz LCByb3dfcG9zaXRpb24sIGRyYXdfcCwgUE9TVF9DSEFOR0VEKTsKKyAgICAgICAgICAgIH0KKyAg ICAgICAgICAgIC8qIFRoZXJlIHdlcmUgbm8gY2hhbmdlcyBhbmQgaSA9PSBkZXNpcmVkX3Jvdy0+ dXNlZFtURVhUX0FSRUFdICovCisgICAgICAgICAgICBlbHNlIGlmICghY2hhbmdlZF9wKQorICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgICAgICAg ICAgICBmcHJpbnRmIChzdGRlcnIsICJVTkNIQU5HRUQgLS0gV1JJVEUgRU5USVJFIExJTkU6ICB2 cG9zICglZCkgfCByb3ctPnVzZWQgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgdnBvcywgdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpOworICAgICAg ICAgICAgICAgIG1jX2RyYXdfcm93ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIGRl c2lyZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgZGVzaXJlZF9yb3ctPngsIGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0sIHZwb3MsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIHJv d19wb3NpdGlvbiwgZHJhd19wLCBVTkNIQU5HRUQpOworICAgICAgICAgICAgICB9CisKKyAgICAg ICAgLyogTWF5YmUgY2xlYXIgdG8gZW5kIG9mIGxpbmUuICovCisgICAgICAgIGlmIChNQVRSSVhf Uk9XX0VYVEVORFNfRkFDRV9QIChkZXNpcmVkX3JvdykpCisgICAgICAgICAgeworICAgICAgICAg ICAgLyogSWYgbmV3IHJvdyBleHRlbmRzIHRvIHRoZSBlbmQgb2YgdGhlIHRleHQgYXJlYSwgbm90 aGluZworICAgICAgICAgICAgICAgaGFzIHRvIGJlIGNsZWFyZWQsIGlmIGFuZCBvbmx5IGlmIHdl IGRpZCBhIHdyaXRlX2dseXBocworICAgICAgICAgICAgICAgYWJvdmUuICBUaGlzIGlzIG1hZGUg c3VyZSBieSBzZXR0aW5nIGRlc2lyZWRfc3RvcF9wb3MKKyAgICAgICAgICAgICAgIGFwcHJvcHJp YXRlbHkgYWJvdmUuICovCisgICAgICAgICAgICBlYXNzZXJ0IChpIDwgZGVzaXJlZF9yb3ctPnVz ZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAgICAgfHwgKChkZXNpcmVkX3Jvdy0+dXNl ZFtURVhUX0FSRUFdID09IGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgTUFUUklYX1JPV19FWFRFTkRTX0ZBQ0VfUCAoY3VycmVudF9yb3cp KSk7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKE1BVFJJWF9ST1dfRVhURU5EU19G QUNFX1AgKGN1cnJlbnRfcm93KSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogSWYg b2xkIHJvdyBleHRlbmRzIHRvIHRoZSBlbmQgb2YgdGhlIHRleHQgYXJlYSwgY2xlYXIuICovCisg ICAgICAgICAgICAgIGlmIChpID49IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAg ICAgICAgICAgICAgb3V0cHV0X2N1cnNvcl90byAodywgdnBvcywgaSwgZGVzaXJlZF9yb3ctPnks IGRlc2lyZWRfcm93LT5waXhlbF93aWR0aCk7CisgICAgICAgICAgICAgIGlmIChkcmF3X3ApCisg ICAgICAgICAgICAgICAgcmlmLT5jbGVhcl9lbmRfb2ZfbGluZSAodywgdXBkYXRlZF9yb3csIFRF WFRfQVJFQSwgLTEpOworICAgICAgICAgICAgICBjbGVhcl90b194ID0gLTE7CisgICAgICAgICAg ICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmIChk ZXNpcmVkX3Jvdy0+cGl4ZWxfd2lkdGggPCBjdXJyZW50X3Jvdy0+cGl4ZWxfd2lkdGgpCisgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBPdGhlcndpc2UgY2xlYXIgdG8gdGhlIGVu ZCBvZiB0aGUgb2xkIHJvdy4gIEV2ZXJ5dGhpbmcKKyAgICAgICAgICAgICAgICAgICBhZnRlciB0 aGF0IHBvc2l0aW9uIHNob3VsZCBiZSBjbGVhciBhbHJlYWR5LiAqLworICAgICAgICAgICAgICAg IGludCB4bGltOworICAgICAgICAgICAgICAgIGlmIChpID49IGRlc2lyZWRfcm93LT51c2VkW1RF WFRfQVJFQV0pCisgICAgICAgICAgICAgICAgICBvdXRwdXRfY3Vyc29yX3RvICh3LCB2cG9zLCBp LCBkZXNpcmVkX3Jvdy0+eSwgZGVzaXJlZF9yb3ctPnBpeGVsX3dpZHRoKTsKKyAgICAgICAgICAg ICAgICAvKiBJZiBjdXJzb3IgaXMgZGlzcGxheWVkIGF0IHRoZSBlbmQgb2YgdGhlIGxpbmUsIG1h a2Ugc3VyZQorICAgICAgICAgICAgICAgICAgIGl0J3MgY2xlYXJlZC4gIE5vd2FkYXlzIHdlIGRv bid0IGhhdmUgYSBwaHlzX2N1cnNvcl9nbHlwaAorICAgICAgICAgICAgICAgICAgIHdpdGggd2hp Y2ggdG8gZXJhc2UgdGhlIGN1cnNvciAoYmVjYXVzZSB0aGlzIG1ldGhvZAorICAgICAgICAgICAg ICAgICAgIGRvZXNuJ3Qgd29yayB3aXRoIGxiZWFyaW5nL3JiZWFyaW5nKSwgc28gd2UgbXVzdCBk byBpdCB0aGlzIHdheS4gKi8KKyAgICAgICAgICAgICAgICBpZiAodnBvcyA9PSB3LT5waHlzX2N1 cnNvci52cG9zCisgICAgICAgICAgICAgICAgICAgICYmIChkZXNpcmVkX3Jvdy0+cmV2ZXJzZWRf cAorICAgICAgICAgICAgICAgICAgICAgICAgPyAody0+cGh5c19jdXJzb3IuaHBvcyA8IDApCisg ICAgICAgICAgICAgICAgICAgICAgICA6ICh3LT5waHlzX2N1cnNvci5ocG9zID49IGRlc2lyZWRf cm93LT51c2VkW1RFWFRfQVJFQV0pKSkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICAgICAgdy0+cGh5c19jdXJzb3Jfb25fcCA9IDA7CisgICAgICAgICAgICAgICAgICAgIHhs aW0gPSAtMTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgICAgICAgeGxpbSA9IGN1cnJlbnRfcm93LT5waXhlbF93aWR0aDsKKyAgICAg ICAgICAgICAgICBpZiAoZHJhd19wKQorICAgICAgICAgICAgICAgICAgcmlmLT5jbGVhcl9lbmRf b2ZfbGluZSAodywgdXBkYXRlZF9yb3csIFRFWFRfQVJFQSwgeGxpbSk7CisgICAgICAgICAgICAg ICAgY2xlYXJfdG9feCA9IHhsaW07CisgICAgICAgICAgICAgICAgY2hhbmdlZF9wID0gMTsKKyAg ICAgICAgICAgICAgfQorCisgICAgICAgIGlmIChjaGFuZ2VkX3AKKyAgICAgICAgICAgICYmIGNs ZWFyX3RvX3ggIT0gMCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpbnQgdGV4dF9hcmVhX3dp ZHRoID0gd2luZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgIHN0cnVj dCBtY19SR0IgZGVidWdfZmcgPSB7LnJlZCA9IDAuODY3LCAuZ3JlZW4gPSAwLjg2NywgLmJsdWUg PSAwLjg2N307CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnRhcmdldF9nbHlwaCA9CisgICAg ICAgICAgICAgIHVwZGF0ZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHVwZGF0ZWRfcm93LT51 c2VkW1RFWFRfQVJFQV0gLSAxOworICAgICAgICAgICAgLyogYG1jX2VuZ2luZScgb25seSBkcmF3 cyBhbiBNQ19HTFlQSCB3aGVuIHggPCB1cGRhdGVkX3Jvdy0+cGl4ZWxfd2lkdGguCisgICAgICAg ICAgICBUaGUgY3VycmVudCBkZXNpZ24gaW5oaWJpdHMgZHJhd2luZyBvdmVyIGFuIGV4aXN0aW5n IGdseXBoIGF0IHRoZSBlbmQgb2YgYQorICAgICAgICAgICAgd29yZC13cmFwcGVkIGxpbmUuICBT YWlkIGdseXBoIHJlY2VpdmVzIGEgZmFrZSBjdXJzb3IgaW4gZWl0aGVyIG9uZSBvZiB0aGUKKyAg ICAgICAgICAgIHByZXZpb3VzIHNlY3Rpb25zIGFib3ZlLCBhbmQgc2hvdWxkIG5vdCBiZSBvdmVy d3JpdHRlbiB3aXRoIGFub3RoZXIgb25lLgorICAgICAgICAgICAgVGhpcyBkZXNpZ24gaXMgbmVl ZGVkIGJlY2F1c2UgYSB3b3JkLXdyYXBwZWQgbGluZSBkb2VzIG5vdCByZWNlaXZlIGFuIGV4dHJh CisgICAgICAgICAgICBzcGFjZSBsaWtlIG5vbi13b3JkLXdyYXBwZWQgbGluZXMgZG8uICovCisg ICAgICAgICAgICBpbnQgeCA9IHVwZGF0ZWRfcm93LT5waXhlbF93aWR0aDsKKyAgICAgICAgICAg IGludCBocG9zID0gdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDE7CisgICAgICAgICAg ICBpbnQgeF9saW1pdCA9IChjbGVhcl90b194ID09IC0xKQorICAgICAgICAgICAgICAgICAgICAg ICAgICA/IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICA6IGNsZWFy X3RvX3g7CisgICAgICAgICAgICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAody0+Y29udGVu dHMpOworICAgICAgICAgICAgYm9vbCBmaWxsX2NvbHVtbl90cnVtcHNfcCA9ICghTklMUCAoQlZB UiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID09IGVzc2VudGlhbHMu ZmNfeCk7CisgICAgICAgICAgICBpZiAobWNfc3RkZXJyX3ApCisgICAgICAgICAgICAgIGZwcmlu dGYgKHN0ZGVyciwgIm1jX3VwZGF0ZV90ZXh0X2FyZWEgKGZsb2F0aW5nKTogIHZwb3MgKCVkKSB8 IHhfbGltaXQgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCB4 X2xpbWl0KTsKKyAgICAgICAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAg ICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgICAgICAg JiYgKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgfHwgKCFlc3NlbnRp YWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwg ZmNfaW5hY3RpdmVfd2luZG93cykpKSkKKyAgICAgICAgICAgICAgICAmJiB4IDwgdGV4dF9hcmVh X3dpZHRoCisgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID49IHgKKyAgICAgICAg ICAgICAgICAmJiB0YXJnZXRfZ2x5cGggIT0gTlVMTAorICAgICAgICAgICAgICAgICYmIGRyYXdf cCkKKyAgICAgICAgICAgICAgbWNfZW5naW5lICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9y b3csIHRhcmdldF9nbHlwaCwgVEVYVF9BUkVBLAorICAgICAgICAgICAgICAgICAgICAgICAgIHgs IHhfbGltaXQsIHVwZGF0ZWRfcm93LT55LCBocG9zLCB2cG9zLCBNQ19CQVIsIDEsCisgICAgICAg ICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9u LAorICAgICAgICAgICAgICAgICAgICAgICAgIGRlYnVnX3AgPyBkZWJ1Z19mZyA6IGVzc2VudGlh bHMuZmNfZmdbcm93X3Bvc2l0aW9uXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBGSUxMX0NP TFVNTiwgZHJhd19wLCBOT1dIRVJFLCBOT19DQUNIRSk7CisgICAgICAgICAgICBpZiAoQlVGRkVS UCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNyb3Nz aGFpcnMpKQorICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9ob3Jpem9udGFs X3J1bGVyKSkKKyAgICAgICAgICAgICAgICAmJiAoZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAg ICAgICAgICAgICAgICB8fCAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAg ICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkpKQorICAgICAg ICAgICAgICAgICYmIHggPCB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAmJiB2cG9z ID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICAgICAgJiYgdGFyZ2V0X2dseXBoICE9IE5V TEwKKyAgICAgICAgICAgICAgICAmJiBkcmF3X3ApCisgICAgICAgICAgICAgIG1jX2VuZ2luZSAo dywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRfZ2x5cGgsIFRFWFRfQVJFQSwK KyAgICAgICAgICAgICAgICAgICAgICAgICB4LCB4X2xpbWl0LCB1cGRhdGVkX3Jvdy0+eSwgaHBv cywgdnBvcywgTUNfSEJBUiwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0 cml4LCBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAg ZGVidWdfcCA/IGRlYnVnX2ZnIDogZXNzZW50aWFscy5jaF9mZ1tyb3dfcG9zaXRpb25dLAorICAg ICAgICAgICAgICAgICAgICAgICAgIEhPUklaT05UQUxfUlVMRVIsIGRyYXdfcCwgTk9XSEVSRSwg Tk9fQ0FDSEUpOworICAgICAgICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAg ICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAg ICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAg ICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgIHx8ICghZXNzZW50 aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIs IGNoX2luYWN0aXZlX3dpbmRvd3MpKSkpCisgICAgICAgICAgICAgICAgJiYgIWZpbGxfY29sdW1u X3RydW1wc19wCisgICAgICAgICAgICAgICAgJiYgeCA8IHRleHRfYXJlYV93aWR0aAorICAgICAg ICAgICAgICAgICYmIHZwb3MgIT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAgICAgICAgICAmJiB3 LT5jdXJzb3IueCA+PSB4CisgICAgICAgICAgICAgICAgJiYgdGFyZ2V0X2dseXBoICE9IE5VTEwK KyAgICAgICAgICAgICAgICAmJiBkcmF3X3ApCisgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywg ZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRfZ2x5cGgsIFRFWFRfQVJFQSwKKyAg ICAgICAgICAgICAgICAgICAgICAgICB4LCB4X2xpbWl0LCB1cGRhdGVkX3Jvdy0+eSwgaHBvcywg dnBvcywgTUNfQkFSLCAxLAorICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgs IGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBkZWJ1 Z19wID8gZGVidWdfZmcgOiBlc3NlbnRpYWxzLmNoX2ZnW3Jvd19wb3NpdGlvbl0sCisgICAgICAg ICAgICAgICAgICAgICAgICAgVkVSVElDQUxfUlVMRVIsIGRyYXdfcCwgTk9XSEVSRSwgTk9fQ0FD SEUpOworICAgICAgICAgIH0KKworICAgICAgfQorICByZXR1cm4gY2hhbmdlZF9wOworfQorCisv KiBVcGRhdGUgcm93IFZQT1MgaW4gd2luZG93IFcuICBWYWx1ZSBpcyB0cnVlIGlmIGRpc3BsYXkg aGFzIGJlZW4gY2hhbmdlZC4gKi8KK3N0YXRpYyBib29sCittY191cGRhdGVfd2luZG93X2xpbmUg KHN0cnVjdCB3aW5kb3cgKncsIGludCB2cG9zLCBib29sICptb3VzZV9mYWNlX292ZXJ3cml0dGVu X3AsCisgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9tYXRyaXggKmN1cnNvcl9t YXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19lc3NlbnRpYWxzIGVzc2Vu dGlhbHMsIGJvb2wgZHJhd19wKQoreworICBzdHJ1Y3QgZ2x5cGhfcm93ICpjdXJyZW50X3JvdyA9 IE1BVFJJWF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB2cG9zKTsKKyAgc3RydWN0IGdseXBoX3Jv dyAqZGVzaXJlZF9yb3cgPSBNQVRSSVhfUk9XICh3LT5kZXNpcmVkX21hdH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WxsIGVuc3Vy ZSB0aGUgdmVydGljYWwgYm9yZGVyLCBpZgorICAgICAgICAgICAgIGFueSwgYmV0d2VlbiB0aGlz IHdpbmRvdyBhbmQgdGhlIG9uZSBvbiBpdHMgbGVmdCB3aWxsIGJlCisgICAgICAgICAgICAgcmVk cmF3bi4gIFRoaXMgaXMgbmVjZXNzYXJ5IGJlY2F1c2UgdXBkYXRpbmcgdGhlIGxlZnQKKyAgICAg ICAgICAgICBtYXJnaW4gYXJlYSBjYW4gcG90ZW50aWFsbHkgZHJhdyBvdmVyIHRoZSBib3JkZXIu ICovCisgICAgICAgICAgY3VycmVudF9yb3ctPnJlZHJhd19mcmluZ2VfYml0bWFwc19wID0gMTsK KyAgICAgICAgfQorICAgICAgYm9vbCB1cGRhdGVkX3AgPSBtY191cGRhdGVfdGV4dF9hcmVhICh3 LCBkZXNpcmVkX3JvdywgdnBvcywgY3Vyc29yX21hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscywgZHJhd19wKTsKKyAgICAgIC8qIFVw ZGF0ZSB0aGUgZGlzcGxheSBvZiB0aGUgdGV4dCBhcmVhLiAqLworICAgICAgaWYgKHVwZGF0ZWRf cCkKKyAgICAgICAgeworICAgICAgICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAgICAgaWYgKGN1 cnJlbnRfcm93LT5tb3VzZV9mYWNlX3ApCisgICAgICAgICAgICAqbW91c2VfZmFjZV9vdmVyd3Jp dHRlbl9wID0gMTsKKyAgICAgICAgfQorICAgICAgLyogVXBkYXRlIGRpc3BsYXkgb2YgdGhlIHJp Z2h0IG1hcmdpbiBhcmVhLCBpZiB0aGVyZSBpcyBvbmUuICovCisgICAgICBpZiAoIWRlc2lyZWRf cm93LT5mdWxsX3dpZHRoX3AgJiYgdy0+cmlnaHRfbWFyZ2luX2NvbHMgPiAwKQorICAgICAgICB7 CisgICAgICAgICAgY2hhbmdlZF9wID0gMTsKKyAgICAgICAgICB1cGRhdGVfbWFyZ2luYWxfYXJl YSAodywgZGVzaXJlZF9yb3csIFJJR0hUX01BUkdJTl9BUkVBLCB2cG9zKTsKKyAgICAgICAgfQor ICAgICAgLyogRHJhdyB0cnVuY2F0aW9uIG1hcmtzIGV0Yy4gKi8KKyAgICAgIGlmICghY3VycmVu dF9yb3ctPmVuYWJsZWRfcAorICAgICAgICAgIHx8IGRlc2lyZWRfcm93LT55ICE9IGN1cnJlbnRf cm93LT55CisgICAgICAgICAgfHwgZGVzaXJlZF9yb3ctPnZpc2libGVfaGVpZ2h0ICE9IGN1cnJl bnRfcm93LT52aXNpYmxlX2hlaWdodAorICAgICAgICAgIHx8IGRlc2lyZWRfcm93LT5jdXJzb3Jf aW5fZnJpbmdlX3AgIT0gY3VycmVudF9yb3ctPmN1cnNvcl9pbl9mcmluZ2VfcAorICAgICAgICAg IHx8IGRlc2lyZWRfcm93LT5vdmVybGF5X2Fycm93X2JpdG1hcCAhPSBjdXJyZW50X3Jvdy0+b3Zl cmxheV9hcnJvd19iaXRtYXAKKyAgICAgICAgICB8fCBjdXJyZW50X3Jvdy0+cmVkcmF3X2ZyaW5n ZV9iaXRtYXBzX3AKKyAgICAgICAgICB8fCBkZXNpcmVkX3Jvdy0+bW9kZV9saW5lX3AgIT0gY3Vy cmVudF9yb3ctPm1vZGVfbGluZV9wCisgICAgICAgICAgfHwgZGVzaXJlZF9yb3ctPmV4YWN0X3dp bmRvd193aWR0aF9saW5lX3AgIT0gY3VycmVudF9yb3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5l X3AKKyAgICAgICAgICB8fCAoTUFUUklYX1JPV19DT05USU5VQVRJT05fTElORV9QIChkZXNpcmVk X3JvdykKKyAgICAgICAgICAgICAgIT0gTUFUUklYX1JPV19DT05USU5VQVRJT05fTElORV9QIChj dXJyZW50X3JvdykpKQorICAgICAgICByaWYtPmFmdGVyX3VwZGF0ZV93aW5kb3dfbGluZV9ob29r ICh3LCBkZXNpcmVkX3Jvdyk7CisgICAgfQorICAvKiBVcGRhdGUgY3VycmVudF9yb3cgZnJvbSBk ZXNpcmVkX3Jvdy4gKi8KKyAgbWFrZV9jdXJyZW50ICh3LT5kZXNpcmVkX21hdHJpeCwgdy0+Y3Vy cmVudF9tYXRyaXgsIHZwb3MpOworICByZXR1cm4gY2hhbmdlZF9wOworfQorCit2b2lkCittY191 cGRhdGVfd2luZG93X2VyYXNlIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgbWNfbWF0cml4IG9s ZF9tYXRyaXgpCit7CisgIGJvb2wgZGVidWdfcCA9IGZhbHNlOworICBib29sIGdvX29uZV9wID0g KG9sZF9tYXRyaXguY3Vyc29yc191c2VkW01DX0NBQ0hFXSA+IDAKKyAgICAgICAgICAgICAgICAg ICB8fCBvbGRfbWF0cml4LmN1cnNvcnNfdXNlZFtDSF9DQUNIRV0gPiAwCisgICAgICAgICAgICAg ICAgICAgfHwgb2xkX21hdHJpeC5jdXJzb3JzX3VzZWRbRkNfQ0FDSEVdID4gMCk7CisgIGJvb2wg Z29fdHdvX3AgPSAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgJiYg KCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAg ICAgICAgICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBm Y192aXNpYmxlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZG RVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKSk7CisgIGJvb2wgdXBkYXRpbmdfZnJhbWVfcCA9 IGZhbHNlOworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgaWYgKFhG UkFNRSAody0+ZnJhbWUpICE9IGYtPm1jX3VwZGF0aW5nX2ZyYW1lCisgICAgICAmJiAoZ29fb25l X3AgfHwgZ29fdHdvX3ApKQorICAgIHsKKyAgICAgIHVwZGF0aW5nX2ZyYW1lX3AgPSB0cnVlOwor ICAgICAgdXBkYXRlX2JlZ2luIChmKTsKKyAgICB9CisgIGlmICh3LT5waHlzX2N1cnNvcl9vbl9w CisgICAgICAmJiBnb190d29fcCkKKyAgICBlcmFzZV9waHlzX2N1cnNvciAodyk7CisgIGZvciAo aW50IHZudGggPSAwOworICAgICAgIGdvX29uZV9wCisgICAgICAgJiYgdm50aCA8IHctPm1jX21h dHJpeC52cG9zX3VzZWQ7CisgICAgICAgKyt2bnRoKQorICAgIHsKKyAgICAgIGZvciAoZW51bSBt Y19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICAgICAgY2FjaGVfdHlw ZSA8IE5PX0NBQ0hFOworICAgICAgICAgICArK2NhY2hlX3R5cGUpCisgICAgICAgIGZvciAoaW50 IG50aF8wID0gMDsKKyAgICAgICAgICAgICBtY190cmF2ZXJzZV9jYWNoZV9wIChvbGRfbWF0cml4 LCBjYWNoZV90eXBlLCB2bnRoLCBudGhfMCk7CisgICAgICAgICAgICAgKytudGhfMCkKKyAgICAg ICAgICB7CisgICAgICAgICAgICBib29sIHNhbWVfcCA9IGZhbHNlOworICAgICAgICAgICAgZm9y IChpbnQgd19udGggPSAwOyB3X250aCA8IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3Vz ZWRbY2FjaGVfdHlwZV07ICsrd19udGgpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg ICBzYW1lX3AgfD0gKG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhf MF0uZ2x5cGgudHlwZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgudHlwZQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgKChvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzBdLmdseXBoLmJ5dGVwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhd LmdseXBoLmJ5dGVwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKG9sZF9t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0ucm93X3Bvc2l0aW9uID09 IEFUX1pWCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5yb3dfcG9zaXRpb24gPT0gQVRf WlYpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKG9sZF9tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0ucm93X3Bvc2l0aW9uID09IFBPU1RfWlYKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLnJvd19wb3NpdGlvbiA9PSBQT1NUX1pWKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmICgob2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5jaGFycG9zCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3df bnRoXS5nbHlwaC5jaGFycG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLnJvd19wb3NpdGlv biA9PSBBVF9aVgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0ucm93X3Bvc2l0aW9uID09 IEFUX1pWKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLnJvd19wb3NpdGlvbiA9PSBQT1NUX1pW CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5yb3dfcG9zaXRpb24gPT0gUE9TVF9aVikp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnUudmFsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRo XS5nbHlwaC51LnZhbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5mYWNlX2lkCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5mYWNlX2lkCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBo LnBhZGRpbmdfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgucGFkZGluZ19wCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzBdLmdseXBoLmxlZnRfYm94X2xpbmVfcAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3 X250aF0uZ2x5cGgubGVmdF9ib3hfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnJp Z2h0X2JveF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnJpZ2h0X2JveF9s aW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGgudm9mZnNldAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVt3X250aF0uZ2x5cGgudm9mZnNldAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5waXhlbF93 aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgucGl4ZWxfd2lkdGgKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMF0uZ2x5cGguc2xpY2UuaW1nLngKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmds eXBoLnNsaWNlLmltZy54CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnNsaWNlLmltZy55Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5pbWcueQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8wXS5nbHlwaC5zbGljZS5pbWcud2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBo LnNsaWNlLmltZy53aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5zbGljZS5pbWcuaGVp Z2h0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5pbWcuaGVpZ2h0CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzBdLmdseXBoLnNsaWNlLmNtcC5mcm9tCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3df bnRoXS5nbHlwaC5zbGljZS5jbXAuZnJvbQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS54CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3dfbnRoXS54CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZ4CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3dfbnRoXS5meAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS55CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3df bnRoXS55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZ5CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5m eQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8wXS5ocG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5ocG9z CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzBdLnZwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLnZwb3MK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMF0ud2QKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLndkCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzBdLmgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmgKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMF0uY3Vyc29yX3R5cGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmN1cnNvcl90eXBl CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzBdLmN1cnNvcl93aWR0aAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250 aF0uY3Vyc29yX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZnLnJlZAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVt3X250aF0uZmcucmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZnLmdyZWVuCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3dfbnRoXS5mZy5ncmVlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5mZy5ibHVlCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5mZy5ibHVlCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmJnLnJl ZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uYmcucmVkCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmJn LmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5iZy5ncmVlbgorICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8wXS5iZy5ibHVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5iZy5ibHVlCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXzBdLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5hY3RpdmVfcAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8wXS5nbHlwaF9mbGF2b3IKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmds eXBoX2ZsYXZvcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5lbmFibGVkX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bd19udGhdLmVuYWJsZWRfcCk7CisgICAgICAgICAgICAgICAgaWYgKHNhbWVfcCkKKyAgICAg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAg ICAgICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiSElUICglcyk6ICB2cG9zICglZCkgfCBo cG9zICglZCkgfCBjaGFyICglcylcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAoY2FjaGVfdHlwZSA9PSBNQ19DQUNIRSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyAiTUMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IChjYWNoZV90eXBlID09IENIX0NBQ0hFKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/ICJDSCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogKGNhY2hlX3R5cGUgPT0gRkNfQ0FDSEUpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gIkZDIgorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiAiTk8iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLnZwb3Ms CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uaHBvcywKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nICh3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgudS5jaCkpOworICAgICAgICAg ICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250 aF0uc2FtZV9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmIChkZWJ1Z19wKQorICAgICAgICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgaW50IG9sZF9jYWNoZV91c2VkID0g b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV07CisgICAgICAgICAg ICAgICAgICAgICAgaW50IG5ld19jYWNoZV91c2VkID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVfdXNlZFtjYWNoZV90eXBlXTsKKyAgICAgICAgICAgICAgICAgICAgICBmcHJpbnRmIChz dGRlcnIsICJNSVNTICglcyk6ICB2cG9zICglZCkgfCBocG9zICglZCB2LiAlZCkgfCBjaGFyICgl cyB2LiAlcykgfCBjYWNoZV91c2VkICglZCB2LiAlZClcbiIsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAoY2FjaGVfdHlwZSA9PSBNQ19DQUNIRSkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAiTUMiCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IChjYWNoZV90eXBlID09IENIX0NBQ0hFKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICJDSCIKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogKGNhY2hlX3R5cGUgPT0gRkNfQ0FDSEUpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gIkZDIgorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiAiTk8iLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b d19udGhdLnZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmhwb3MsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVt3X250aF0uaHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nIChvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnUuY2gpLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgbWNfY2hhcl90b19zdHJpbmcgKHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC51LmNoKSwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIG9sZF9jYWNoZV91c2VkLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2NhY2hlX3VzZWQpOworICAgICAgICAgICAgICAg ICAgICB9CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICghc2FtZV9wKQorICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogYG1hdHJpeF9yb3cnIGluIGBkaXNwbmV3LmNg IGNvbnRhaW5zIHRoZSBmb2xsb3dpbmcgdGVzdHMsCisgICAgICAgICAgICAgICAgZWFzc2VydCAo bWF0cml4ICYmIG1hdHJpeC0+cm93cyk7CisgICAgICAgICAgICAgICAgZWFzc2VydCAocm93ID49 IDAgJiYgcm93IDwgbWF0cml4LT5ucm93cyk7ICovCisgICAgICAgICAgICAgICAgYm9vbCBiYXJm X2NyYXNoX29uZSA9ICh3LT5jdXJyZW50X21hdHJpeCAmJiB3LT5jdXJyZW50X21hdHJpeC0+cm93 cykgPyBmYWxzZSA6IHRydWU7CisgICAgICAgICAgICAgICAgaWYgKGJhcmZfY3Jhc2hfb25lKQor ICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgYm9vbCBiYXJmX2Ny YXNoX3R3byA9ICh2bnRoID49IDAgJiYgdm50aCA8IHctPmN1cnJlbnRfbWF0cml4LT5ucm93cykg PyBmYWxzZSA6IHRydWU7CisgICAgICAgICAgICAgICAgaWYgKGJhcmZfY3Jhc2hfdHdvKQorICAg ICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3Jv dyAqdm50aF9yb3cgPSBNQVRSSVhfUk9XICh3LT5jdXJyZW50X21hdHJpeCwgdm50aCk7CisgICAg ICAgICAgICAgICAgaW50IHhfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMF0ueDsKKyAgICAgICAgICAgICAgICBpbnQgZnhfMCA9IG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZng7CisgICAgICAgICAgICAgICAgaW50 IHlfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0ueTsK KyAgICAgICAgICAgICAgICBpbnQgZnlfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMF0uZnk7CisgICAgICAgICAgICAgICAgaW50IGhwb3NfMCA9IG9sZF9t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uaHBvczsKKyAgICAgICAg ICAgICAgICBpbnQgdnBvc18wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS52cG9zOworICAgICAgICAgICAgICAgIGludCB3ZF8wID0gb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS53ZDsKKyAgICAgICAgICAgICAgICBp bnQgaF8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5o OworICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGVfMCA9IG9s ZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uY3Vyc29yX3R5cGU7 CisgICAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aF8wID0gb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5jdXJzb3Jfd2lkdGg7CisgICAgICAgICAgICAg ICAgLy8gIHN0cnVjdCBtY19SR0IgbHNsX2ZnXzAgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZmcucmVkLAorICAgICAgICAgICAgICAgIC8v ICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZmcuZ3JlZW4sCisgICAgICAgICAgICAgICAgLy8g ICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZnLmJsdWV9OworICAgICAgICAgICAgICAgIHN0cnVj dCBtY19SR0IgbHNsX2JnXzAgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMF0uYmcucmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgLmdyZWVuID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS5iZy5ncmVlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIC5ibHVlID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8wXS5iZy5ibHVlfTsKKyAgICAgICAgICAgICAgICBib29sIGFjdGl2ZV9wXzAgPSBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmFjdGl2ZV9wOworICAgICAg ICAgICAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvcl8wID0gb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaF9mbGF2b3I7CisgICAgICAgICAg ICAgICAgYm9vbCBlbmFibGVkX3BfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMF0uZW5hYmxlZF9wOworICAgICAgICAgICAgICAgIGlmICh2cG9zXzAgPT0g dm50aAorICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3JfMCA9PSBNQ19HTFlQSAor ICAgICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3BfMAorICAgICAgICAgICAgICAgICAgICAm JiB2bnRoX3Jvdy0+ZW5hYmxlZF9wKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgICBtY19lcmFzZV9jdXJzb3IgKHcsIHctPmN1cnJlbnRfbWF0cml4LCB2bnRoX3Jvdywg eF8wLCB5XzAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaHBvc18wLCB2 cG9zXzAsIGdseXBoX2ZsYXZvcl8wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGN1cnNvcl90eXBlXzAsIHdkXzApOworICAgICAgICAgICAgICAgICAgICBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmVuYWJsZWRfcCA9IGZhbHNlOwor ICAgICAgICAgICAgICAgICAgICAtLW9sZF9tYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5cGVd OworICAgICAgICAgICAgICAgICAgICAvKiBJZiB3ZSBpbmFkdmVydGVudGx5IGVyYXNlZCBhbm90 aGVyIGZha2UgY3Vyc29yIGF0IHRoZSBzYW1lCisgICAgICAgICAgICAgICAgICAgIEhQT1MgdGhh dCBpcyBzdGlsbCBlbmFibGVkX3AgaW4gdGhlIGBvbGRfbWF0cml4YCwgdGhlbiByZWRyYXcgaXQu ICovCisgICAgICAgICAgICAgICAgICAgIGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5 cGUgPSBNQ19DQUNIRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICBjYWNoZV90eXBlIDwgTk9f Q0FDSEU7CisgICAgICAgICAgICAgICAgICAgICAgICAgKytjYWNoZV90eXBlKQorICAgICAgICAg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IG50aF8xID0g MDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWNfdHJhdmVyc2VfY2FjaGVfcCAob2xk X21hdHJpeCwgY2FjaGVfdHlwZSwgdm50aCwgbnRoXzEpOworICAgICAgICAgICAgICAgICAgICAg ICAgICAgICArK250aF8xKQorICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgaW50IHhfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMV0ueDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZnhf MSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZng7Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHlfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0ueTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICBpbnQgZnlfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhf MV0uZnk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGhwb3NfMSA9IG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uaHBvczsKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICBpbnQgdnBvc18xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF8xXS52cG9zOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlu dCB3ZF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS53 ZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaF8xID0gb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5oOworICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGVfMSA9IG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uY3Vyc29yX3R5cGU7CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aF8xID0gb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5jdXJzb3Jfd2lkdGg7CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmdfMSA9IHsucmVkID0gb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5mZy5yZWQsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmZnLmdyZWVuLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUg PSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmZnLmJsdWV9 OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBzdHJ1Y3QgbWNfUkdCIGxzbF9iZ18x ID0gey5yZWQgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFd LmJnLnJlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAuZ3JlZW4gPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXzFdLmJnLmdyZWVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF8xXS5iZy5ibHVlfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICBib29sIGFjdGl2ZV9wXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXzFdLmFjdGl2ZV9wOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNf Zmxhdm9yIGdseXBoX2ZsYXZvcl8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8xXS5nbHlwaF9mbGF2b3I7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg Ym9vbCBlbmFibGVkX3BfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMV0uZW5hYmxlZF9wOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgZ29f cF8xID0gKGhwb3NfMCA9PSBocG9zXzEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBlbmFibGVkX3BfMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg aWYgKCFnb19wXzEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIHJlbW92ZV9wXzEgPSBmYWxzZTsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgdy0+Y3VycmVu dF9tYXRyaXgsIHZudGhfcm93LCB4XzEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGZ4XzEsIHlfMSwgZnlfMSwgaHBvc18xLCB2cG9zXzEsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdkXzEsIGhfMSwg Y3Vyc29yX3R5cGVfMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgY3Vyc29yX3dpZHRoXzEsIGxzbF9mZ18xLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVfcF8xLCBnbHlwaF9mbGF2b3JfMSwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3Zl X3BfMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAg ICB9CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmICh2cG9z XzAgPT0gdm50aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wXzAKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHZudGhfcm93LT5lbmFibGVkX3ApCisgICAgICAg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBib29sIHJlbW92ZV9wXzAgPSB0 cnVlOworICAgICAgICAgICAgICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCB3LT5j dXJyZW50X21hdHJpeCwgdm50aF9yb3csIHhfMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgZnhfMCwgeV8wLCBmeV8wLCBocG9zXzAsIHZwb3NfMCwgd2RfMCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaF8wLCBjdXJzb3Jf dHlwZV8wLCBjdXJzb3Jfd2lkdGhfMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgbHNsX2JnXzAsIGFjdGl2ZV9wXzAsIGdseXBoX2ZsYXZvcl8wLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVfcF8wKTsKKyAgICAg ICAgICAgICAgICAgICAgICBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXzBdLmVuYWJsZWRfcCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgIC0tb2xkX21h dHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVfdHlwZV07CisgICAgICAgICAgICAgICAgICAgICAgLyog SWYgd2UgaW5hZHZlcnRlbnRseSBlcmFzZWQgYW5vdGhlciBmYWtlIGN1cnNvciBhdCB0aGUgc2Ft ZQorICAgICAgICAgICAgICAgICAgICAgIEhQT1MgdGhhdCBpcyBzdGlsbCBlbmFibGVkX3AgaW4g dGhlIGBvbGRfbWF0cml4YCwgdGhlbiByZWRyYXcgaXQuICovCisgICAgICAgICAgICAgICAgICAg ICAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOworICAgICAg ICAgICAgICAgICAgICAgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICAgICAg ICAgICAgICAgICAgICAgKytjYWNoZV90eXBlKQorICAgICAgICAgICAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBudGhfMiA9IDA7CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgbWNfdHJhdmVyc2VfY2FjaGVfcCAob2xkX21hdHJpeCwgY2Fj aGVfdHlwZSwgdm50aCwgbnRoXzIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsr bnRoXzIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgaW50IHhfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMl0ueDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmeF8yID0g b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5meDsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGludCB5XzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLnk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBpbnQgZnlfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhf Ml0uZnk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaHBvc18yID0gb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5ocG9zOworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgaW50IHZwb3NfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMl0udnBvczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGludCB3ZF8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8yXS53ZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBoXzIgPSBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmg7CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlXzIgPSBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmN1cnNvcl90eXBlOwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aF8yID0gb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5jdXJzb3Jfd2lkdGg7Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZ18yID0gey5y ZWQgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmZnLnJl ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgLmdyZWVuID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8y XS5mZy5ncmVlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgLmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXzJdLmZnLmJsdWV9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIHN0 cnVjdCBtY19SR0IgbHNsX2JnXzIgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMl0uYmcucmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5iZy5ncmVlbiwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0gb2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5iZy5ibHVlfTsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgYWN0aXZlX3BfMiA9IG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uYWN0aXZlX3A7CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3JfMiA9IG9sZF9t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uZ2x5cGhfZmxhdm9yOwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBlbmFibGVkX3BfMiA9IG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uZW5hYmxlZF9wOworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBnb19wXzIgPSAoaHBvc18wID09IGhwb3NfMgor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZnhfMCA8PSBm eF8yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBmeF8w ICsgd2RfMCA+IGZ4XzIgKyB3ZF8yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBlbmFibGVkX3BfMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBpZiAoIWdvX3BfMikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIHJlbW92ZV9wXzIgPSBmYWxzZTsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCB3 LT5jdXJyZW50X21hdHJpeCwgdm50aF9yb3csIHhfMiwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmeF8yLCB5XzIsIGZ5XzIsIGhwb3NfMiwgdnBv c18yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHdkXzIsIGhfMiwgY3Vyc29yX3R5cGVfMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGhfMiwgbHNsX2ZnXzIsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0aXZlX3BfMiwg Z2x5cGhfZmxhdm9yXzIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgcmVtb3ZlX3BfMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQor ICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICB9CisgIGlmICh1cGRhdGluZ19mcmFtZV9wKQor ICAgIHVwZGF0ZV9lbmQgKGYpOworfQorCit2b2lkCittY191cGRhdGVfd2luZG93X2RyeXJ1biAo c3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wLCBzdHJ1Y3QgbWNfZXNzZW50aWFscyBlc3Nl bnRpYWxzKQoreworICBpZiAoIUJVRkZFUlAgKHctPmNvbnRlbnRzKSkKKyAgICByZXR1cm47CisK KyAgaWYgKHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbTUNfQ0FDSEVdID09IDAKKyAgICAgICYm IHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbQ0hfQ0FDSEVdID09IDAKKyAgICAgICYmIHctPm1j X21hdHJpeC5jdXJzb3JzX3VzZWRbRkNfQ0FDSEVdID09IDAKKyAgICAgICYmIE5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAmJiBOSUxQIChCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgJiYgTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpCisgICAgcmV0dXJuOworCisgIC8v IGNsb2NrX3QgY2xvY2tfc3RhcnQgPSBjbG9jaygpOworCisgIGJvb2wgZHJhd19wID0gZmFsc2U7 CisKKyAgc3RydWN0IGdseXBoX21hdHJpeCAqc2F2ZWRfZGVzaXJlZCA9IG1jX3NhdmVfZ2x5cGhf bWF0cml4ICh3LT5kZXNpcmVkX21hdHJpeCk7CisgIHN0cnVjdCBnbHlwaF9tYXRyaXggKnNhdmVk X2N1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vZGVfbGlu ZV9yb3ctPm1vZGVfbGluZV9wICYmIG1vZGVfbGluZV9yb3ctPmVuYWJsZWRfcCkKKyAgICAgICAg eworICAgICAgICAgIG1vZGVfbGluZV9yb3ctPnkgPSB5YiArIFdJTkRPV19TQ1JPTExfQkFSX0FS RUFfSEVJR0hUICh3KTsKKyAgICAgICAgICB1cGRhdGVfd2luZG93X2xpbmUgKHcsIE1BVFJJWF9S T1dfVlBPUyAobW9kZV9saW5lX3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgZGVzaXJlZF9tYXRyaXgpLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCk7CisgICAgICAgIH0KKworICAgICAg LyogRmluZCBmaXJzdCBlbmFibGVkIHJvdy4gIE9wdGltaXphdGlvbnMgaW4gcmVkaXNwbGF5X2lu dGVybmFsCisgICAgICAgICBtYXkgbGVhZCB0byBhbiB1cGRhdGUgd2l0aCBvbmx5IG9uZSByb3cg ZW5hYmxlZC4gIFRoZXJlIG1heQorICAgICAgICAgYmUgYWxzbyBjb21wbGV0ZWx5IGVtcHR5IG1h dHJpY2VzLiAqLworICAgICAgd2hpbGUgKHJvdyA8IGVuZCAmJiAhcm93LT5lbmFibGVkX3ApCisg ICAgICAgICsrcm93OworCisgICAgICAvKiBUcnkgcmV1c2luZyBwYXJ0IG9mIHRoZSBkaXNwbGF5 IGJ5IGNvcHlpbmcuICovCisgICAgICBpZiAocm93IDwgZW5kICYmICF3LT5kZXNpcmVkX21hdHJp eC0+bm9fc2Nyb2xsaW5nX3ApCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgcmMgPSBtY19zY3Jv bGxpbmdfd2luZG93ICh3LCBoZWFkZXJfbGluZV9yb3cgIT0gTlVMTCk7CisgICAgICAgICAgaWYg KHJjIDwgMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogQWxs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3VycmVudF9tYXRyaXgnIGZvciBjdXJzb3Igcm93IGJhc2Vk IGRlY2lzaW9ucy4gKi8KKyAgICAgIGZvciAoc3RydWN0IGdseXBoX3JvdyAqbWNfcm93ID0gcm93 OworICAgICAgICAgICBtY19yb3cgPCBlbmQgJiYgKGZvcmNlX3AgfHwgIWlucHV0X3BlbmRpbmcp OworICAgICAgICAgICArK21jX3JvdykKKyAgICAgICAgeworICAgICAgICAgIGludCB2cG9zID0g TUFUUklYX1JPV19WUE9TIChtY19yb3csIHctPmRlc2lyZWRfbWF0cml4KTsKKyAgICAgICAgICBp ZiAobWNfcm93LT5lbmFibGVkX3AKKyAgICAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3Iu dnBvcykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCA9IHctPmRl c2lyZWRfbWF0cml4OworICAgICAgICAgICAgICBpZiAoIWZvcmNlX3AgJiYgKytuX3VwZGF0ZWQg JSBwcmVlbXB0X2NvdW50ID09IDApCisgICAgICAgICAgICAgICAgZGV0ZWN0X2lucHV0X3BlbmRp bmdfaWdub3JlX3NxdWVlemFibGVzICgpOworICAgICAgICAgICAgICBjaGFuZ2VkX3AgfD0gbWNf dXBkYXRlX3dpbmRvd19saW5lICh3LCB2cG9zLCAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jf bWF0cml4LCBlc3NlbnRpYWxzLCBkcmF3X3ApOworICAgICAgICAgICAgICBpZiAoTUFUUklYX1JP V19CT1RUT01fWSAocm93KSA+PSB5YikKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gdnBv cyArIDE7IGkgPCB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAgICAgICAg ICAgICAgICBTRVRfTUFUUklYX1JPV19FTkFCTEVEX1AgKHctPmN1cnJlbnRfbWF0cml4LCBpLCBm YWxzZSk7CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9Cisg ICAgICBjdXJzb3JfbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgICAgICAvKiBVcGRhdGUg dGhlIHJlc3Qgb2YgdGhlIGxpbmVzLiAqLworICAgICAgZm9yICg7IHJvdyA8IGVuZCAmJiAoZm9y Y2VfcCB8fCAhaW5wdXRfcGVuZGluZyk7ICsrcm93KQorICAgICAgICAvKiBzY3JvbGxpbmdfd2lu ZG93IHJlc2V0cyB0aGUgZW5hYmxlZF9wIGZsYWcgb2YgdGhlIHJvd3MgaXQgcmV1c2VzIGZyb20K KyAgICAgICAgY3VycmVudF9tYXRyaXguICovCisgICAgICAgIGlmIChyb3ctPmVuYWJsZWRfcCkK KyAgICAgICAgICB7CisgICAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAocm93 LCB3LT5kZXNpcmVkX21hdHJpeCk7CisgICAgICAgICAgICAvKiBJZiB0aGUgYGN1cnNvcl9yb3dg IGlzIHdpdGhpbiB0aGUgYGRlc2lyZWRfbWF0cml4YCwgdGhlbiBpdCB3YXMKKyAgICAgICAgICAg IHByb2Nlc3NlZCBoZXJlaW5hYm92ZSBhbmQgc2hvdWxkIGJlIHNraXBwZWQgYXQgdGhpcyB0aW1l LiAqLworICAgICAgICAgICAgaWYgKHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAg ICBjb250aW51ZTsKKyAgICAgICAgICAgIGludCBpOworICAgICAgICAgICAgLyogV2UnbGwgaGF2 ZSB0byBwbGF5IGEgbGl0dGxlIGJpdCB3aXRoIHdoZW4gdG8KKyAgICAgICAgICAgICAgIGRldGVj dF9pbnB1dF9wZW5kaW5nLiAgSWYgaXQncyBkb25lIHRvbyBvZnRlbiwKKyAgICAgICAgICAgICAg IHNjcm9sbGluZyBsYXJnZSB3aW5kb3dzIHdpdGggcmVwZWF0ZWQgc2Nyb2xsLXVwCisgICAgICAg ICAgICAgICBjb21tYW5kcyB3aWxsIHRvbyBxdWlja2x5IHBhdXNlIHJlZGlzcGxheS4gKi8KKyAg ICAgICAgICAgIGlmICghZm9yY2VfcCAmJiArK25fdXBkYXRlZCAlIHByZWVtcHRfY291bnQgPT0g MCkKKyAgICAgICAgICAgICAgZGV0ZWN0X2lucHV0X3BlbmRpbmdfaWdub3JlX3NxdWVlemFibGVz ICgpOworICAgICAgICAgICAgY2hhbmdlZF9wIHw9IG1jX3VwZGF0ZV93aW5kb3dfbGluZSAodywg dnBvcywgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIGRyYXdf cCk7CisgICAgICAgICAgICAvKiBNYXJrIGFsbCByb3dzIGJlbG93IHRoZSBsYXN0IHZpc2libGUg b25lIGluIHRoZSBjdXJyZW50CisgICAgICAgICAgICAgICBtYXRyaXggYXMgaW52YWxpZC4gIFRo aXMgaXMgbmVjZXNzYXJ5IGJlY2F1c2Ugb2YKKyAgICAgICAgICAgICAgIHZhcmlhYmxlIGxpbmUg aGVpZ2h0cy4gIENvbnNpZGVyIHRoZSBjYXNlIG9mIHRocmVlCisgICAgICAgICAgICAgICBzdWNj ZXNzaXZlIHJlZGlzcGxheXMsIHdoZXJlIHRoZSBmaXJzdCBkaXNwbGF5cyA1CisgICAgICAgICAg ICAgICBsaW5lcywgdGhlIHNlY29uZCAzIGxpbmVzLCBhbmQgdGhlIHRoaXJkIDUgbGluZXMgYWdh aW4uCisgICAgICAgICAgICAgICBJZiB0aGUgc2Vjb25kIHJlZGlzcGxheSB3b3VsZG4ndCBtYXJr IHJvd3MgaW4gdGhlCisgICAgICAgICAgICAgICBjdXJyZW50IG1hdHJpeCBpbnZhbGlkLCB0aGUg dGhpcmQgcmVkaXNwbGF5IG1pZ2h0IGJlCisgICAgICAgICAgICAgICB0ZW1wdGVkIHRvIG9wdGlt aXplIHJlZGlzcGxheSBiYXNlZCBvbiBsaW5lcyBkaXNwbGF5ZWQKKyAgICAgICAgICAgICAgIGlu IHRoZSBmaXJzdCByZWRpc3BsYXkuICovCisgICAgICAgICAgICBpZiAoTUFUUklYX1JPV19CT1RU T01fWSAocm93KSA+PSB5YikKKyAgICAgICAgICAgICAgZm9yIChpID0gdnBvcyArIDE7IGkgPCB3 LT5jdXJyZW50X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAgICAgICAgICAgICAgU0VUX01B VFJJWF9ST1dfRU5BQkxFRF9QICh3LT5jdXJyZW50X21hdHJpeCwgaSwgZmFsc2UpOworICAgICAg ICAgIH0KKyAgICAgIC8qIFdhcyBkaXNwbGF5IHByZWVtcHRlZD8gKi8KKyAgICAgIHBhdXNlZF9w ID0gcm93IDwgZW5kOworICAgICAgc2V0X2N1cnNvcjoKKyAgICAgIC8qIElmIHdlIGp1bXBlZCBo ZXJlIGZyb20gYHNldF9jdXJzb3JgLCB0aGVuIHNldCB0aGUgYGN1cnNvcl9tYXRyaXhgLiAqLwor ICAgICAgaWYgKGN1cnNvcl9tYXRyaXggPT0gTlVMTCkKKyAgICAgICAgY3Vyc29yX21hdHJpeCA9 IHctPmN1cnJlbnRfbWF0cml4OworICAgICAgLyogUmVzZXQgYHJvd2AgdG8gMCBzbyB0aGF0IGZh a2UgY3Vyc29ycyBjYW4gYmUgZHJhd24gb24gcm93cyBwcmVjZWRpbmcgdGhlCisgICAgICBmaXJz dCBgcm93LT5lbmFibGVkX3BgLiAgSnVzdCBwcmlvciB0byB0aGUgY2FsbCB0byBgc2Nyb2xsaW5n X3dpbmRvdycgYWJvdmUsCisgICAgICBgcm93YCB3YXMgYWR2YW5jZWQgdG8gdGhlIGZpcnN0IGBy b3ctPmVuYWJsZWRfcGAuICovCisgICAgICBmb3IgKHN0cnVjdCBnbHlwaF9yb3cgKmRlc2lyZWRf cm93ID0gTUFUUklYX1JPVyAody0+ZGVzaXJlZF9tYXRyaXgsIDApOworICAgICAgICAgICBkZXNp cmVkX3JvdyA8IGVuZAorICAgICAgICAgICAmJiAoZm9yY2VfcCB8fCAhaW5wdXRfcGVuZGluZykK KyAgICAgICAgICAgLyogVzMyIEVtYWNzIGNyYXNoZXMgb24gc3RhcnR1cCB3aXRob3V0IGEgQlVG RkVSUCBjaGVjay4gKi8KKyAgICAgICAgICAgJiYgQlVGRkVSUCAody0+Y29udGVudHMpCisgICAg ICAgICAgICYmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkK KyAgICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNy b3NzaGFpcnMpKQorICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgZmNfdmlzaWJsZSkpKTsKKyAgICAgICAgICAgKytkZXNpcmVkX3JvdykKKyAgICAg ICAgeworICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChkZXNpcmVkX3Jvdywg dy0+ZGVzaXJlZF9tYXRyaXgpOworICAgICAgICAgIGlmIChkZXNpcmVkX3Jvdy0+ZW5hYmxlZF9w KQorICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqY3Vy cmVudF9yb3cgPSBNQVRSSVhfUk9XICh3LT5jdXJyZW50X21hdHJpeCwgdnBvcyk7CisgICAgICAg ICAgZW51bSBtY19yb3dfcG9zaXRpb24gcm93X3Bvc2l0aW9uID0gbWNfcm93X3Bvc2l0aW9uICh3 LCBjdXJyZW50X3JvdywgY3VycmVudF9yb3csIHZwb3MpOworICAgICAgICAgIGlmIChjdXJyZW50 X3Jvdy0+ZW5hYmxlZF9wKQorICAgICAgICAgICAgbWNfZHJhd19yb3cgKHcsIHctPmN1cnJlbnRf bWF0cml4LCBjdXJyZW50X3JvdywgY3VycmVudF9yb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAg ICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRfcm93LT54LCBjdXJyZW50X3Jvdy0+dXNlZFtU RVhUX0FSRUFdLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgs IGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgZHJhd19wLAorICAgICAgICAgICAgICAgICAgICAg ICAgIFNFVF9DVVJTT1JfT05FKTsKKyAgICAgICAgfQorCisgICAgICBtY19yZXN0b3JlX2dseXBo X21hdHJpeCAoc2F2ZWRfZGVzaXJlZCwgdy0+ZGVzaXJlZF9tYXRyaXgpOworICAgICAgbWNfcmVz dG9yZV9nbHlwaF9tYXRyaXggKHNhdmVkX2N1cnJlbnQsIHctPmN1cnJlbnRfbWF0cml4KTsKKwor ICAgICAgbWNfdXBkYXRlX3dpbmRvd19lcmFzZSAodywgb2xkX21hdHJpeCk7CisKKyAgICAgIG1j X3hmcmVlX2NhY2hlX21hdHJpeCAodywgJm9sZF9tYXRyaXgpOworCisgICAgfQorICAvLyBjbG9j a190IGNsb2NrX2VuZCA9IGNsb2NrKCk7CisgIC8vIGRvdWJsZSBjcHVfdGltZV91c2VkID0gKChk b3VibGUpIChjbG9ja19lbmQgLSBjbG9ja19zdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7CisgIC8v IGZwcmludGYgKHN0ZGVyciwgIm1jX3Njcm9sbGluZ193aW5kb3cgKCVzKTogIFRJTUUgKCVmKVxu IiwgbWNfd2luZG93ICh3KSwgY3B1X3RpbWVfdXNlZCk7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1D VVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBTdHJ1Y3R1cmUgdG8g cGFzcyBkaW1lbnNpb25zIGFyb3VuZC4gIFVzZWQgZm9yIGNoYXJhY3RlciBib3VuZGluZwogICAg Ym94ZXMsIGdseXBoIG1hdHJpeCBkaW1lbnNpb25zIGFuZCBhbGlrZS4gICovCiAKQEAgLTIyNDEs NiArNDAxNywxNiBAQCBmcmVlX3dpbmRvd19tYXRyaWNlcyAoc3RydWN0IHdpbmRvdyAqdykKIAkg IGZyZWVfZ2x5cGhfbWF0cml4ICh3LT5jdXJyZW50X21hdHJpeCk7CiAJICBmcmVlX2dseXBoX21h dHJpeCAody0+ZGVzaXJlZF9tYXRyaXgpOwogCSAgdy0+Y3VycmVudF9tYXRyaXggPSB3LT5kZXNp cmVkX21hdHJpeCA9IE5VTEw7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKyAgbWNfeGZyZWVfY2FjaGVfbWF0cml4ICh3LCAmdy0+bWNfbWF0 cml4KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCX0KIAogICAgICAgLyogTmV4 dCB3aW5kb3cgb24gc2FtZSBsZXZlbC4gICovCkBAIC0zMzg3LDYgKzUxNzMsMjYgQEAgY2hlY2tf Y3VycmVudF9tYXRyaXhfZmxhZ3MgKHN0cnVjdCB3aW5kb3cgKncpCiBzdGF0aWMgYm9vbAogdXBk YXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wKQogeworCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlmIChtY19z dGRlcnJfcCkKKyAgICBmcHJpbnRmIChzdGRlcnIsICJ1cGRhdGVfd2luZG93ICglcylcbiIsIG1j X3dpbmRvdyAodykpOworCisgIHN0cnVjdCBtY19lc3NlbnRpYWxzIGVzc2VudGlhbHM7CisgIG1j X3NldF9lc3NlbnRpYWxzICh3LCAmZXNzZW50aWFscyk7CisKKyAgbWNfdXBkYXRlX3dpbmRvd19k cnlydW4gKHcsIGZvcmNlX3AsIGVzc2VudGlhbHMpOworCisgIHN0cnVjdCBnbHlwaF9tYXRyaXgg KmN1cnNvcl9tYXRyaXggPSBOVUxMOworCisgIGJvb2wgZHJhd19wID0gdHJ1ZTsKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICpkZXNpcmVkX21h dHJpeCA9IHctPmRlc2lyZWRfbWF0cml4OwogICBib29sIHBhdXNlZF9wOwogICBpbnQgcHJlZW1w dF9jb3VudCA9IGNsaXBfdG9fYm91bmRzICgxLCBiYXVkX3JhdGUgLyAyNDAwICsgMSwgSU5UX01B WCk7CkBAIC0zNDY0LDYgKzUyNzAsNDggQEAgdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAq dywgYm9vbCBmb3JjZV9wKQogCSAgICB9CiAJfQogCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAg LyogUHJvY2VzcyB0aGUgY3Vyc29yIHJvdyBhdCB0aGUgb3V0c2V0IGlmIGl0IGlzIHdpdGhpbiBg ZGVzaXJlZF9tYXRyaXhgLgorICBXaGVuIHByb2Nlc3Npbm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AgICAgICAgICAgZGV0ZWN0X2lucHV0X3BlbmRpbmdfaWdub3JlX3NxdWVlemFibGVzICgp OworICAgICAgICAgIGNoYW5nZWRfcCB8PSAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAg ICAgICAgICAgICAgICAgICAmJiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg bWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhC VUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgfHwgISBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUp KSkpCisgICAgICAgICAgICAgICAgICAgICAgID8gbWNfdXBkYXRlX3dpbmRvd19saW5lICh3LCB2 cG9zLCAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgZHJhd19w KQorICAgICAgICAgICAgICAgICAgICAgICA6IHVwZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywg Jm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCk7CisgICAgICAgICAgaWYgKE1BVFJJWF9ST1dfQk9U VE9NX1kgKHJvdykgPj0geWIpCisgICAgICAgICAgICBmb3IgKGludCBpID0gdnBvcyArIDE7IGkg PCB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3MgLSAxOyArK2kpCisgICAgICAgICAgICAgIFNFVF9N QVRSSVhfUk9XX0VOQUJMRURfUCAody0+Y3VycmVudF9tYXRyaXgsIGksIGZhbHNlKTsKKyAgICAg ICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKworICBjdXJzb3JfbWF0cml4ID0gdy0+Y3Vy cmVudF9tYXRyaXg7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIC8qIFVw ZGF0ZSB0aGUgcmVzdCBvZiB0aGUgbGluZXMuICAqLwogICAgICAgZm9yICg7IHJvdyA8IGVuZCAm JiAoZm9yY2VfcCB8fCAhaW5wdXRfcGVuZGluZyk7ICsrcm93KQogCS8qIHNjcm9sbGluZ193aW5k b3cgcmVzZXRzIHRoZSBlbmFibGVkX3AgZmxhZyBvZiB0aGUgcm93cyBpdApAQCAtMzQ3MSw2ICs1 MzE5LDE5IEBAIHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkK IAlpZiAocm93LT5lbmFibGVkX3ApCiAJICB7CiAJICAgIGludCB2cG9zID0gTUFUUklYX1JPV19W UE9TIChyb3csIGRlc2lyZWRfbWF0cml4KTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgICAgIC8qIElmIHRoZSBgY3Vyc29yX3Jv d2AgaXMgd2l0aGluIHRoZSBgZGVzaXJlZF9tYXRyaXhgLCB0aGVuIGl0IHdhcworICAgICAgICAg IHByb2Nlc3NlZCBoZXJlaW5hYm92ZSBhbmQgc2hvdWxkIGJlIHNraXBwZWQgYXQgdGhpcyB0aW1l LiAqLworICAgICAgICAgIGlmICh2cG9zID09IHctPmN1cnNvci52cG9zKQorICAgICAgICAgIGNv bnRpbnVlOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAgIGludCBpOwogCiAJ ICAgIC8qIFdlJ2xsIGhhdmUgdG8gcGxheSBhIGxpdHRsZSBiaXQgd2l0aCB3aGVuIHRvCkBAIC0z NDc5LDggKzUzNDAsMjEgQEAgdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBm b3JjZV9wKQogCSAgICAgICBjb21tYW5kcyB3aWxsIHRvbyBxdWlja2x5IHBhdXNlIHJlZGlzcGxh eS4gICovCiAJICAgIGlmICghZm9yY2VfcCAmJiArK25fdXBkYXRlZCAlIHByZWVtcHRfY291bnQg PT0gMCkKIAkgICAgICBkZXRlY3RfaW5wdXRfcGVuZGluZ19pZ25vcmVfc3F1ZWV6YWJsZXMgKCk7 Ci0JICAgIGNoYW5nZWRfcCB8PSB1cGRhdGVfd2luZG93X2xpbmUgKHcsIHZwb3MsCi0JCQkJCSAg ICAgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCk7CisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgICAgICBjaGFuZ2VkX3AgfD0gKEJV RkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKCFOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFp cnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICEgTklMUCAoQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpKQorICAgICAgICAgICAgICAgICAgICAgICA/ IG1jX3VwZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5f cCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNv cl9tYXRyaXgsIGVzc2VudGlhbHMsIGRyYXdfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgOiB1 cGRhdGVfd2luZG93X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3cml0dGVuX3ApOwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKwogCiAJICAgIC8qIE1hcmsgYWxsIHJvd3MgYmVs b3cgdGhlIGxhc3QgdmlzaWJsZSBvbmUgaW4gdGhlIGN1cnJlbnQKIAkgICAgICAgbWF0cml4IGFz IGludmFsaWQuICBUaGlzIGlzIG5lY2Vzc2FyeSBiZWNhdXNlIG9mCkBAIC0zNTAxLDYgKzUzNzUs NDEgQEAgdXBkYXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wKQogCiAg ICAgc2V0X2N1cnNvcjoKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExF LUNVUlNPUlMgKi8KKworICAvKiBJZiB3ZSBqdW1wZWQgaGVyZSBmcm9tIGBzZXRfY3Vyc29yYCwg dGhlbiBzZXQgdGhlIGBjdXJzb3JfbWF0cml4YC4gKi8KKyAgaWYgKGN1cnNvcl9tYXRyaXggPT0g TlVMTCkKKyAgICBjdXJzb3JfbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisKKyAgLyogUmVz ZXQgYHJvd2AgdG8gMCBzbyB0aGF0IGZha2UgY3Vyc29ycyBjYW4gYmUgZHJhd24gb24gcm93cyBw cmVjZWRpbmcgdGhlCisgIGZpcnN0IGByb3ctPmVuYWJsZWRfcGAuICBKdXN0IHByaW9yIHRvIHRo ZSBjYWxsIHRvIGBzY3JvbGxpbmdfd2luZG93JyBhYm92ZSwKKyAgYHJvd2Agd2FzIGFkdmFuY2Vk IHRvIHRoZSBmaXJzdCBgcm93LT5lbmFibGVkX3BgLiAqLworICBmb3IgKHN0cnVjdCBnbHlwaF9y b3cgKmRlc2lyZWRfcm93ID0gTUFUUklYX1JPVyAoZGVzaXJlZF9tYXRyaXgsIDApOworICAgICAg IGRlc2lyZWRfcm93IDwgZW5kCisgICAgICAgJiYgKGZvcmNlX3AgfHwgIWlucHV0X3BlbmRpbmcp CisgICAgICAgLyogVzMyIEVtYWNzIGNyYXNoZXMgb24gc3RhcnR1cCB3aXRob3V0IGEgQlVGRkVS UCBjaGVjay4gKi8KKyAgICAgICAmJiBCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAmJiAo IU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAg IHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAg ICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxl KSkpOworICAgICAgICsrZGVzaXJlZF9yb3cpCisgICAgeworICAgICAgaW50IHZwb3MgPSBNQVRS SVhfUk9XX1ZQT1MgKGRlc2lyZWRfcm93LCBkZXNpcmVkX21hdHJpeCk7CisgICAgICBpZiAoZGVz aXJlZF9yb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgY29udGludWU7CisgICAgICBzdHJ1Y3QgZ2x5 cGhfcm93ICpjdXJyZW50X3JvdyA9IE1BVFJJWF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB2cG9z KTsKKyAgICAgIGVudW0gbWNfcm93X3Bvc2l0aW9uIHJvd19wb3NpdGlvbiA9IG1jX3Jvd19wb3Np dGlvbiAodywgY3VycmVudF9yb3csIGN1cnJlbnRfcm93LCB2cG9zKTsKKyAgICAgIGlmIChjdXJy ZW50X3Jvdy0+ZW5hYmxlZF9wKQorICAgICAgICBtY19kcmF3X3JvdyAodywgdy0+Y3VycmVudF9t YXRyaXgsIGN1cnJlbnRfcm93LCBjdXJyZW50X3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAg ICAgICAgICAgICAgICAgICBjdXJyZW50X3Jvdy0+eCwgY3VycmVudF9yb3ctPnVzZWRbVEVYVF9B UkVBXSwgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlh bHMsIHJvd19wb3NpdGlvbiwgZHJhd19wLCBTRVRfQ1VSU09SX1RXTyk7CisgICAgfQorCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICAvKiBVcGRhdGUgdGhlIGhlYWRlciBsaW5l IGFmdGVyIHNjcm9sbGluZyBiZWNhdXNlIGEgbmV3IGhlYWRlcgogCSBsaW5lIHdvdWxkIG90aGVy d2lzZSBvdmVyd3JpdGUgbGluZXMgYXQgdGhlIHRvcCBvZiB0aGUgd2luZG93CiAJIHRoYXQgY2Fu IGJlIHNjcm9sbGVkLiAgKi8KQEAgLTM1MTYsNyArNTQyNSw0OSBAQCB1cGRhdGVfd2luZG93IChz dHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3ApCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVN CiAJICBpZiAoY2hhbmdlZF9wICYmIHJpZi0+Zml4X292ZXJsYXBwaW5nX2FyZWEpCiAJICAgIHsK LQkgICAgICByZWRyYXdfb3ZlcmxhcHBlZF9yb3dzICh3LCB5Yik7CisKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRyYXdfb3Zlcmxh cHBlZF9yb3d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B1dF9jdXJzb3JfdG8g KHcsIGksIDAsIHJvdy0+eSwgYXJlYSA9PSBURVhUX0FSRUEgPyByb3ctPnggOiAwKTsKKyAgICAg ICAgICAgICAgaWYgKCFtY19yZWRyYXdfcm93ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgcm93LCBh cmVhLCByb3ctPngsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT51 c2VkW2FyZWFdLCB0cnVlLCBEUkFXX05PUk1BTF9URVhULAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIFVQREFURV9XSU5ET1dfX1JFRFJBV19PVkVSTEFQUEVEX1JPV1MpCisgICAg ICAgICAgICAgICAgICAmJiByb3ctPnVzZWRbYXJlYV0pCisgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgRlJBTUVfUklGIChmKS0+d3JpdGVfZ2x5cGhzICh3LCByb3csIHJvdy0+ Z2x5cGhzW2FyZWFdLCBhcmVhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICByb3ctPnVzZWRbYXJlYV0pOworICAgICAgICAgICAgICAgICAgRlJBTUVfUklG IChmKS0+Y2xlYXJfZW5kX29mX2xpbmUgKHcsIHJvdywgYXJlYSwgLTEpOworICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICByb3ctPm92ZXJsYXBwZWRfcCA9IDA7Cisg ICAgICAgIH0KKyAgICAgIGlmIChNQVRSSVhfUk9XX0JPVFRPTV9ZIChyb3cpID49IHliKQorICAg ICAgICBicmVhazsKKyAgICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgICAg ICByZWRyYXdfb3ZlcmxhcHBpbmdfcm93cyAodywgeWIpOwogCSAgICB9CiAjZW5kaWYKQEAgLTM1 MzYsOCArNTQ4NywyMCBAQCB1cGRhdGVfd2luZG93IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGZv cmNlX3ApCiAjZW5kaWYKIAogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQorCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlmIChCVUZGRVJQ ICh3LT5jb250ZW50cykKKyAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIGNyb3NzaGFpcnMpKSkKKyAgICBtY191cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIDApOwor ICAgIGVsc2UKICAgICAgIHVwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgMCk7CiAKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgICAgIC8qIEVuZCB0aGUgdXBkYXRlIG9mIHdpbmRvdyBX LiAgRG9uJ3Qgc2V0IHRoZSBjdXJzb3IgaWYgd2UKICAgICAgICAgIHBhdXNlZCB1cGRhdGluZyB0 aGUgZGlzcGxheSBiZWNhdXNlIGluIHRoaXMgY2FzZSwKICAgICAgICAgIHNldF93aW5kb3dfY3Vy c29yX2FmdGVyX3VwZGF0ZSBoYXNuJ3QgYmVlbiBjYWxsZWQsIGFuZApkaWZmIC0tZ2l0IGEvc3Jj L2ZyYW1lLmggYi9zcmMvZnJhbWUuaAppbmRleCBmYTQ1YTMyLi41M2FkMTMxIDEwMDY0NAotLS0g YS9zcmMvZnJhbWUuaAorKysgYi9zcmMvZnJhbWUuaApAQCAtMjA1LDYgKzIwNSwxNiBAQCBzdHJ1 Y3QgZnJhbWUKICAgTGlzcF9PYmplY3QgdG9vbF9iYXJfaXRlbXM7CiAgIC8qIHRvb2xfYmFyX2l0 ZW1zIHNob3VsZCBiZSB0aGUgbGFzdCBMaXNwX09iamVjdCBtZW1iZXIuICAqLwogCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8qIE5vbi1u aWwgd2hlbiB0aGUgZnJhbWUgaXMgaW4gdGhlIHByb2Nlc3Mgb2YgYmVpbmcgdXBkYXRlZC4gKi8K KyAgc3RydWN0IGZyYW1lICptY191cGRhdGluZ19mcmFtZTsKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogICAvKiBDYWNoZSBvZiByZWFsaXplZCBmYWNlcy4gICovCiAgIHN0cnVjdCBm YWNlX2NhY2hlICpmYWNlX2NhY2hlOwogCmRpZmYgLS1naXQgYS9zcmMvZnJpbmdlLmMgYi9zcmMv ZnJpbmdlLmMKaW5kZXggZDBkNTk5Mi4uMjUyZWRhYyAxMDA2NDQKLS0tIGEvc3JjL2ZyaW5nZS5j CisrKyBiL3NyYy9mcmluZ2UuYwpAQCAtNDM3LDggKzQzNyw0NjIgQEAgc3RhdGljIHVuc2lnbmVk IHNob3J0IGVtcHR5X2xpbmVfYml0c1tdID0gewogI2RlZmluZSBTVEFOREFSRF9CSVRNQVBfSEVJ R0hUKGJpdHMpIChzaXplb2YgKGJpdHMpL0JZVEVTX1BFUl9CSVRNQVBfUk9XKQogI2RlZmluZSBG UkJJVFMoYml0cykgIGJpdHMsIFNUQU5EQVJEX0JJVE1BUF9IRUlHSFQgKGJpdHMpCiAKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8q IGArLWZyaW5nZS1oZWxwZXItZGVjaW1hbCcgZGVmaW5lZCBpbiBgY3Jvc3NoYWlycy5lbGAgKi8K KworLyogVE9ETzogIENvbnNpZGVyIGFkZGluZyB0aGUgZm9sbG93aW5nIGZyaW5nZSBiaXRtYXBz OgorICAoZGVmaW5lLWZyaW5nZS1iaXRtYXAgJ2JyZWFrcG9pbnQgIlx4M2NceDdlXHhmZlx4ZmZc eGZmXHhmZlx4N2VceDNjIikKKyAgKGRlZmluZS1mcmluZ2UtYml0bWFwICdob2xsb3ctcmlnaHQt dHJpYW5nbGUgIlx4ZTBceDkwXHg4OFx4ODRceDg0XHg4OFx4OTBceGUwIikgKi8KKworLyogMjQK KyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC4uLi4uLi4iCisgICAg ICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4ueHguLi4iCisgICAgICAi eC4uLnh4Li4iCisgICAgICAieC4uLi54eC4iCisgICAgICAieC54eHh4eHgiCisgICAgICAieC54 eHh4eHgiCisgICAgICAieC4uLi54eC4iCisgICAgICAieC4uLnh4Li4iCisgICAgICAieC4ueHgu Li4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4i KQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY192ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3df Yml0c1tdID17CisgIDB4ODAsIDB4ODAsIDB4ODAsIDB4OTgsIDB4OGMsIDB4ODYsIDB4YmYsCisg IDB4YmYsIDB4ODYsIDB4OGMsIDB4OTgsIDB4ODAsIDB4ODAsIDB4ODB9OworCisvKiAyNQorICAg ICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIu Li4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIueHguLi54eCIKKyAgICAgICIuLnh4 Li54eCIKKyAgICAgICIuLi54eC54eCIKKyAgICAgICJ4eHh4eHh4eCIKKyAgICAgICJ4eHh4eHh4 eCIKKyAgICAgICIuLi54eC54eCIKKyAgICAgICIuLnh4Li54eCIKKyAgICAgICIueHguLi54eCIK KyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIpCisq Lworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3JldmVyc2VkX3ZlcnRpY2FsX2Jhcl9yaWdodF9h cnJvd19iaXRzW10gPXsKKyAgMHgzLCAweDMsIDB4MywgMHg2MywgMHgzMywgMHgxYiwgMHhmZiwg MHhmZiwgMHgxYiwgMHgzMywgMHg2MywgMHgzLCAweDMsIDB4M307CisKKy8qIDI2CisgICAgKCst ZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4eHh4eHh4IgorICAgICAgInguLi4u Li54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLnh4Li54IgorICAgICAgInguLi54eC54 IgorICAgICAgInguLi4ueHh4IgorICAgICAgIngueHh4eHh4IgorICAgICAgIngueHh4eHh4Igor ICAgICAgInguLi4ueHh4IgorICAgICAgInguLi54eC54IgorICAgICAgInguLnh4Li54IgorICAg ICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInh4eHh4eHh4IikKKyovCitz dGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvd19iaXRz W10gPXsKKyAgMHhmZiwgMHg4MSwgMHg4MSwgMHg5OSwgMHg4ZCwgMHg4NywgMHhiZiwKKyAgMHhi ZiwgMHg4NywgMHg4ZCwgMHg5OSwgMHg4MSwgMHg4MSwgMHhmZn07CisKKy8qIDI3CisgICAgKCst ZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4eHh4eHh4IgorICAgICAgInguLi4u Lnh4IgorICAgICAgInguLi4uLnh4IgorICAgICAgIngueHguLnh4IgorICAgICAgInguLnh4Lnh4 IgorICAgICAgInguLi54eHh4IgorICAgICAgInh4eHh4eHh4IgorICAgICAgInh4eHh4eHh4Igor ICAgICAgInguLi54eHh4IgorICAgICAgInguLnh4Lnh4IgorICAgICAgIngueHguLnh4IgorICAg ICAgInguLi4uLnh4IgorICAgICAgInguLi4uLnh4IgorICAgICAgInh4eHh4eHh4IikKKyovCitz dGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcmV2ZXJzZWRfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9h cnJvd19iaXRzW10gPXsKKyAgMHhmZiwgMHg4MSwgMHg4MSwgMHhiMSwgMHg5OSwgMHg4ZCwgMHhm ZiwKKyAgMHhmZiwgMHg4ZCwgMHg5OSwgMHhiMSwgMHg4MSwgMHg4MSwgMHhmZn07CisKKy8qIDI4 CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4eHh4eHh4IgorICAg ICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAg InguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgIngu Li4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4u Li54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInh4eHh4eHh4 IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfaG9sbG93X3JlY3RhbmdsZV9iaXRzW10g PXsKKyAgMHhmZiwgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwKKyAgMHg4MSwg MHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwgMHhmZn07CisKKy8qIDI5CisgICAgKCstZnJp bmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4u IgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgor ICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAg ICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAg InguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIikKKyovCitzdGF0 aWMgdW5zaWduZWQgc2hvcnQgbWNfdmVydGljYWxfYmFyX2JpdHNbXSA9eworICAweDgwLCAweDgw LCAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwLAorICAweDgwLCAweDgwLCAweDgwLCAweDgw LCAweDgwLCAweDgwLCAweDgwfTsKKworLyogMzAKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFk ZWNpbWFsCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4u eHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgi CisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisg ICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAg ICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9y dCBtY19yZXZlcnNlZF92ZXJ0aWNhbF9iYXJfYml0c1tdID17CisgIDB4MywgMHgzLCAweDMsIDB4 MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzfTsKKwor LyogMzEKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHguLi4uLi4i CisgICAgICAieHguLi4uLi4iCisgICAgICAiIHh4Li4uLi4iCis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AgICIueHh4eHh4LiIKKyAgICAgICJ4eHh4LnguLiIKKyAgICAgICJ4eHh4Lngu LiIKKyAgICAgICJ4eHh4LnguLiIKKyAgICAgICIueHh4LnguLiIKKyAgICAgICIuLi54LnguLiIK KyAgICAgICIuLi54LnguLiIKKyAgICAgICIuLi54LnguLiIKKyAgICAgICIuLi54LnguLiIKKyAg ICAgICIuLi54LnguLiIKKyAgICAgICIuLi54LnguLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNo b3J0IG1jX3BpbGNyb3dfYml0c1tdID17CisgIDB4N2UsIDB4ZjQsIDB4ZjQsIDB4ZjQsIDB4NzQs IDB4MTQsIDB4MTQsIDB4MTQsIDB4MTQsIDB4MTQsIDB4MTR9OworCisvKiAzNAorICAgICgrLWZy aW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLnh4eHguLiIKKyAgICAgICIueHh4eHh4 LiIKKyAgICAgICJ4Li54eC4ueCIKKyAgICAgICJ4Li54eC4ueCIKKyAgICAgICJ4eHh4eHh4eCIK KyAgICAgICJ4eC4uLi54eCIKKyAgICAgICJ4eHguLnh4eCIKKyAgICAgICIueHh4eHh4LiIKKyAg ICAgICIuLnh4eHguLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3NtaWxleV9mYWNl X2JpdHNbXSA9eworICAweDNjLCAweDdlLCAweDk5LCAweDk5LCAweGZmLCAweGMzLCAweGU3LCAw eDdlLCAweDNjfTsKKworLyogMzUKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisg ICAgICAiLi54Li4uLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLnguLi4iCisgICAg ICAiLi4uLi54Li4iCisgICAgICAiLi4uLnguLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAi Li54Li4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zaW5nbGVfYW5nbGVfcmln aHRfYml0c1tdID17CisgIDB4MjAsIDB4MTAsIDB4OCwgMHg0LCAweDgsIDB4MTAsIDB4MjB9Owor CisvKiAzNgorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLngu LiIKKyAgICAgICIuLi4ueC4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLnguLi4uLiIK KyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLi4ueC4uLiIKKyAgICAgICIuLi4uLnguLiIpCisq Lworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3NpbmdsZV9hbmdsZV9sZWZ0X2JpdHNbXSA9ewor ICAweDQsIDB4OCwgMHgxMCwgMHgyMCwgMHgxMCwgMHg4LCAweDR9OworCisvKiAzNworICAgICgr LWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICJ4eC54eC4uLiIKKyAgICAgICIueHgu eHguLiIKKyAgICAgICIuLnh4Lnh4LiIKKyAgICAgICIuLi54eC54eCIKKyAgICAgICIuLnh4Lnh4 LiIKKyAgICAgICIueHgueHguLiIKKyAgICAgICJ4eC54eC4uLiIpCisqLworc3RhdGljIHVuc2ln bmVkIHNob3J0IG1jX2RvdWJsZV9hbmdsZV9yaWdodF9iaXRzW10gPXsKKyAgMHhkOCwgMHg2Yywg MHgzNiwgMHgxYiwgMHgzNiwgMHg2YywgMHhkOH07CisKKy8qIDM4CisgICAgKCstZnJpbmdlLWhl bHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLnh4Lnh4IgorICAgICAgIi4ueHgueHguIgorICAg ICAgIi54eC54eC4uIgorICAgICAgInh4Lnh4Li4uIgorICAgICAgIi54eC54eC4uIgorICAgICAg Ii4ueHgueHguIgorICAgICAgIi4uLnh4Lnh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQg bWNfZG91YmxlX2FuZ2xlX2xlZnRfYml0c1tdID17CisgIDB4MWIsIDB4MzYsIDB4NmMsIDB4ZDgs IDB4NmMsIDB4MzYsIDB4MWJ9OworCisvKiAzOQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRl Y2ltYWwKKyAgICAgICJ4LngueC4uLiIKKyAgICAgICIueC54LnguLiIKKyAgICAgICIuLngueC54 LiIKKyAgICAgICIuLi54LngueCIKKyAgICAgICIuLngueC54LiIKKyAgICAgICIueC54LnguLiIK KyAgICAgICJ4LngueC4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3RyaXBsZV9h bmdsZV9yaWdodF9iaXRzW10gPXsKKyAgMHhhOCwgMHg1NCwgMHgyYSwgMHgxNSwgMHgyYSwgMHg1 NCwgMHhhOH07CisKKy8qIDQwCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAg ICAgIi4uLngueC54IgorICAgICAgIi4ueC54LnguIgorICAgICAgIi54LngueC4uIgorICAgICAg IngueC54Li4uIgorICAgICAgIi54LngueC4uIgorICAgICAgIi4ueC54LnguIgorICAgICAgIi4u LngueC54IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdHJpcGxlX2FuZ2xlX2xlZnRf Yml0c1tdID17CisgIDB4MTUsIDB4MmEsIDB4NTQsIDB4YTgsIDB4NTQsIDB4MmEsIDB4MTV9Owor CisvKiA0MQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4u LiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIK KyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAg ICAgICJ4Li4uLi54LiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAg ICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0 IG1jX3NpbmdsZV9hbmdsZV91cF9iaXRzW10gPXsKKyAgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwg MHgxMCwgMHgyOCwgMHg0NCwgMHg4MiwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMH07CisKKy8qIDQy CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4uLi4uIgorICAg ICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAg InguLi4uLnguIgorICAgICAgIi54Li4ueC4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi4u LnguLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4u Li4uIgorICAgICAgIi4uLi4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc2lu Z2xlX2FuZ2xlX2Rvd25fYml0c1tdID17CisgIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4ODIs IDB4NDQsIDB4MjgsIDB4MTAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDB9OworCisvKiA0MworICAg ICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIu Li4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLngu eC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIuLngueC4u LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIuLi4uLi4uLiIK KyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVk IHNob3J0IG1jX2RvdWJsZV9hbmdsZV91cF9iaXRzW10gPXsKKyAgMHgwMCwgMHgwMCwgMHgwMCwg MHgxMCwgMHgyOCwgMHg0NCwgMHg5MiwgMHgyOCwgMHg0NCwgMHg4MiwgMHgwMCwgMHgwMCwgMHgw MH07CisKKy8qIDQ0CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4u Li4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgInguLi4u LnguIgorICAgICAgIi54Li4ueC4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgInguLnguLngu IgorICAgICAgIi54Li4ueC4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi4uLnguLi4uIgor ICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIikKKyov CitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xlX2Rvd25fYml0c1tdID17Cisg IDB4MDAsIDB4MDAsIDB4MDAsIDB4ODIsIDB4NDQsIDB4MjgsIDB4OTIsIDB4NDQsIDB4MjgsIDB4 MTAsIDB4MDAsIDB4MDAsIDB4MDB9OworCisvKiA0NQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4 YWRlY2ltYWwKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLngu eC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIuLngueC4u LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIuLngueC4uLiIK KyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIuLi4uLi4uLiIpCisq Lworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3RyaXBsZV9hbmdsZV91cF9iaXRzW10gPXsKKyAg MHgwMCwgMHgxMCwgMHgyOCwgMHg0NCwgMHg5MiwgMHgyOCwgMHg0NCwgMHg5MiwgMHgyOCwgMHg0 NCwgMHg4MiwgMHgwMH07CisKKy8qIDQ2CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1h bAorICAgICAgIi4uLi4uLi4uIgorICAgICAgInguLi4uLnguIgorICAgICAgIi54Li4ueC4uIgor ICAgICAgIi4ueC54Li4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi54Li4ueC4uIgorICAg ICAgIi4ueC54Li4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi54Li4ueC4uIgorICAgICAg Ii4ueC54Li4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4uLi4uLi4uIikKKyovCitzdGF0 aWMgdW5zaWduZWQgc2hvcnQgbWNfcXVhZHJ1cGxlX2FuZ2xlX2Rvd25fYml0c1tdID17CisgIDB4 MDAsIDB4ODIsIDB4NDQsIDB4MjgsIDB4OTIsIDB4NDQsIDB4MjgsIDB4OTIsIDB4NDQsIDB4Mjgs IDB4MTAsIDB4MDB9OworCisvKiA0NworICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwK KyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAg ICAgICJ4Li54Li54LiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAgICAg ICJ4Li54Li54LiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4 Li54Li54LiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4Li4u Li54LiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3F1YWRydXBsZV9hbmdsZV91cF9i aXRzW10gPXsKKyAgMHgxMCwgMHgyOCwgMHg0NCwgMHg5MiwgMHgyOCwgMHg0NCwgMHg5MiwgMHgy OCwgMHg0NCwgMHg5MiwgMHgyOCwgMHg0NCwgMHg4Mn07CisKKy8qIDQ4CisgICAgKCstZnJpbmdl LWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInguLi4uLnguIgorICAgICAgIi54Li4ueC4uIgor ICAgICAgIi4ueC54Li4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi54Li4ueC4uIgorICAg ICAgIi4ueC54Li4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi54Li4ueC4uIgorICAgICAg Ii4ueC54Li4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi54Li4ueC4uIgorICAgICAgIi4u eC54Li4uIgorICAgICAgIi4uLnguLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNf dHJpcGxlX2FuZ2xlX2Rvd25fYml0c1tdID17CisgIDB4ODIsIDB4NDQsIDB4MjgsIDB4OTIsIDB4 NDQsIDB4MjgsIDB4OTIsIDB4NDQsIDB4MjgsIDB4OTIsIDB4NDQsIDB4MjgsIDB4MTB9OworCiAv KiBOT1RFOiAgVGhlIG9yZGVyIG9mIHRoZXNlIGJpdG1hcHMgbXVzdCBtYXRjaCB0aGUgc2VxdWVu Y2UKLSAgIHVzZWQgaW4gZnJpbmdlLmVsIHRvIGRlZmluZSB0aGUgY29ycmVzcG9uZGluZyBzeW1i b2xzLiAgKi8KKyAgIHVzZWQgaW4gZnJpbmdlLmVsIHRvIGRlZmluZSB0aGUgY29ycmVzcG9uZGlu ZyBzeW1ib2xzLiAqLwogCiBzdGF0aWMgc3RydWN0IGZyaW5nZV9iaXRtYXAgc3RhbmRhcmRfYml0 bWFwc1tdID0KIHsKQEAgLTQ2Niw4ICs5MjAsMTA3MiBAQCBzdGF0aWMgc3RydWN0IGZyaW5nZV9i aXRtYXAgc3RhbmRhcmRfYml0bWFwc1tdID0KICAgeyBGUkJJVFMgKHZlcnRpY2FsX2Jhcl9iaXRz KSwgICAgICAgOCwgMCwgQUxJR05fQklUTUFQX0NFTlRFUiwgMCB9LAogICB7IEZSQklUUyAoaG9y aXpvbnRhbF9iYXJfYml0cyksICAgICA4LCAwLCBBTElHTl9CSVRNQV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8gMiA6IDApOworICBpZiAoKGNt YXAgPSBCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3Qp KSwgIU5JTFAgKGNtYXApKQorICAgIHsKKyAgICAgIGJtMSA9IG1jX2Fzc3EgKGJpdG1hcCwgY21h cCk7CisgICAgICBpZiAoQ09OU1AgKGJtMSkpCisgIHsKKyAgICBpZiAoKGJtMSA9IFhDRFIgKGJt MSkpLCBOSUxQIChibTEpKQorICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAg aWYgKENPTlNQIChibTEpKQorICAgICAgeworICAgICAgICBsbjEgPSBYRklYTlVNIChGbGVuZ3Ro IChibTEpKTsKKyAgICAgICAgaWYgKHBhcnRpYWxfcCkKKyAgICAgICAgICB7CisgICAgICAgICAg ICBpZiAobG4xID4gaXgyKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgYm0gPSBt Y19udGggKGl4MiwgYm0xKTsKKyAgICAgICAgICAgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAg ICAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0K KyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmIChsbjEgPiBp eDEpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgYm0gPSBtY19udGggKGl4 MSwgYm0xKTsKKyAgICAgICAgICAgICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAg ICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQor ICAgICAgfQorICAgIGVsc2UgaWYgKChibSA9IGJtMSwgIUVRIChibSwgUXQpKSkKKyAgICAgIGdv dG8gZm91bmQ7CisgIH0KKyAgICB9CisgIGlmICghRVEgKGNtYXAsIEJWQVIgKCZidWZmZXJfZGVm YXVsdHMsIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKQorICAgICAgJiYgIU5JTFAgKEJWQVIgKCZi dWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKSkKKyAgICB7CisgICAgICBi bTIgPSBtY19hc3NxIChiaXRtYXAsIEJWQVIgKCZidWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9pbmRp Y2F0b3JfYWxpc3QpKTsKKyAgICAgIGlmIChDT05TUCAoYm0yKSkKKyAgICAgICAgeworICAgICAg ICAgIGlmICgoYm0yID0gWENEUiAoYm0yKSksICFOSUxQIChibTIpKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICBpZiAoQ09OU1AgKGJtMikpCisgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgbG4yID0gWEZJWE5VTSAoRmxlbmd0aCAoYm0yKSk7CisgICAgICAgICAgICAg ICAgICBpZiAocGFydGlhbF9wKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAg ICAgICAgICAgaWYgKGxuMiA+IGl4MikKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgYm0gPSBtY19udGggKGl4MiwgYm0yKTsKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICBnb3RvIGZvdW5kOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9Cisg ICAgfQorICBpZiAobG4xID4gaXgxKQorICAgIHsKKyAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJt MSk7CisgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgICBnb3RvIGZvdW5kOworICAgIH0K KyAgaWYgKGxuMiA+IGl4MSkKKyAgICB7CisgICAgICBibSA9IG1jX250aCAoaXgxLCBibTIpOwor ICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAgZ290byBmb3VuZDsKKyAgICAgIHJldHVy biBNQ19OT19GUklOR0VfQklUTUFQOworICAgIH0KKyAgICBlbHNlIGlmICgoYm0gPSBibTIsIE5J TFAgKGJtKSkpCisgICAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgZm91bmQ6Cisg IHJldHVybiBsb29rdXBfZnJpbmdlX2JpdG1hcCAoYm0pOworfQorCitzdGF0aWMgaW50CittY19n ZXRfbG9naWNhbF9jdXJzb3JfYml0bWFwIChzdHJ1Y3Qgd2luZG93ICp3LCBMaXNwX09iamVjdCBj dXJzb3IpCit7CisgIExpc3BfT2JqZWN0IGNtYXAsIGJtID0gUW5pbDsKKyAgaWYgKChjbWFwID0g QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmcmluZ2VfY3Vyc29yX2FsaXN0KSksICFOSUxQ IChjbWFwKSkKKyAgICB7CisgICAgICBibSA9IG1jX2Fzc3EgKGN1cnNvciwgY21hcCk7CisgICAg ICBpZiAoQ09OU1AgKGJtKSkKKyAgICAgICAgeworICAgICAgICAgIGlmICgoYm0gPSBYQ0RSIChi bSkpLCBOSUxQIChibSkpCisgICAgICAgICAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsK KyAgICAgICAgICByZXR1cm4gbG9va3VwX2ZyaW5nZV9iaXRtYXAgKGJtKTsKKyAgICAgICAgfQor ICAgIH0KKyAgaWYgKEVRIChjbWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfY3Vy c29yX2FsaXN0KSkpCisgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgIGJtID0gbWNf YXNzcSAoY3Vyc29yLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfY3Vyc29yX2FsaXN0 KSk7CisgIGlmICghQ09OU1AgKGJtKSB8fCAo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sIHVzZSBub24tcGFydGlhbCBiaXRtYXAu ICovCisgIGlmICgoY21hcCA9IEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZnJpbmdlX2lu ZGljYXRvcl9hbGlzdCkpLCAhTklMUCAoY21hcCkpCisgICAgeworICAgICAgYm0xID0gbWNfYXNz cSAoYml0bWFwLCBjbWFwKTsKKyAgICAgIGlmIChDT05TUCAoYm0xKSkKKyAgICAgICAgeworICAg ICAgICAgIGlmICgoYm0xID0gWENEUiAoYm0xKSksIE5JTFAgKGJtMSkpCisgICAgICAgICAgICBy ZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICBpZiAoQ09OU1AgKGJtMSkpCisg ICAgICAgICAgICB7CisgICAgICAgICAgICAgIGxuMSA9IFhGSVhOVU0gKEZsZW5ndGggKGJtMSkp OworICAgICAgICAgICAgICBpZiAocGFydGlhbF9wKQorICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgIGlmIChsbjEgPiBpeDIpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgICAgICBibSA9IG1jX250aCAoaXgyLCBibTEpOworICAgICAgICAgICAgICAg ICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAgICAgICAgICAgICAgICBnb3RvIGZv dW5kOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYg KGxuMSA+IGl4MSkKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAg ICAgICBibSA9IG1jX250aCAoaXgxLCBibTEpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYg KCFFUSAoYm0sIFF0KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAg ICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9 CisgICAgICAgICAgICBlbHNlIGlmICgoYm0gPSBibTEsICFFUSAoYm0sIFF0KSkpCisgICAgICAg ICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgIH0KKyAgICB9CisgIGlmICghRVEgKGNtYXAsIEJW QVIgKCZidWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKQorICAgICAgJiYg IU5JTFAgKEJWQVIgKCZidWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKSkK KyAgICB7CisgICAgICBibTIgPSBtY19hc3NxIChiaXRtYXAsIEJWQVIgKCZidWZmZXJfZGVmYXVs dHMsIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKTsKKyAgICAgIGlmIChDT05TUCAoYm0yKSkKKyAg ICAgICAgeworICAgICAgICAgIGlmICgoYm0yID0gWENEUiAoYm0yKSksICFOSUxQIChibTIpKQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAoQ09OU1AgKGJtMikpCisgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgbG4yID0gWEZJWE5VTSAoRmxlbmd0aCAoYm0yKSk7 CisgICAgICAgICAgICAgICAgICBpZiAocGFydGlhbF9wKQorICAgICAgICAgICAgICAgICAgICB7 CisgICAgICAgICAgICAgICAgICAgICAgaWYgKGxuMiA+IGl4MikKKyAgICAgICAgICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgYm0gPSBtY19udGggKGl4MiwgYm0y KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5kOworICAgICAgICAgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg fQorICAgICAgICB9CisgICAgfQorICBpZiAobG4xID4gaXgxKQorICAgIHsKKyAgICAgIGJtID0g bWNfbnRoIChpeDEsIGJtMSk7CisgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgICBnb3Rv IGZvdW5kOworICAgIH0KKyAgaWYgKGxuMiA+IGl4MSkKKyAgICB7CisgICAgICBibSA9IG1jX250 aCAoaXgxLCBibTIpOworICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAgZ290byBmb3Vu ZDsKKyAgICAgIHJldHVybiBNQ19OT19GUklOR0VfQklUTUFQOworICAgIH0KKyAgICBlbHNlIGlm ICgoYm0gPSBibTIsIE5JTFAgKGJtKSkpCisgICAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1B UDsKKyAgZm91bmQ6CisgIHJldHVybiBsb29rdXBfZnJpbmdlX2JpdG1hcCAoYm0pOworfQorCisv KiBSZWNhbGN1bGF0ZSB0aGUgYml0bWFwcyB0byBzaG93IGluIHRoZSBmcmluZ2VzIG9mIHdpbmRv dyBXLgorICAgT25seSBtYXJrIHJvd3Mgd2l0aCBtb2RpZmllZCBiaXRtYXBzIGZvciB1cGRhdGUg aW4gcmVkcmF3X2ZyaW5nZV9iaXRtYXBzX3AuCisgICBJZiBLRUVQX0NVUlJFTlRfUCBpcyAwLCB1 cGRhdGUgY3VycmVudF9tYXRyaXggdG9vLiAqLworYm9vbAorbWNfdXBkYXRlX3dpbmRvd19mcmlu Z2VzIChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGtlZXBfY3VycmVudF9wKQoreworICBzdHJ1Y3Qg Z2x5cGhfcm93ICpyb3csICpjdXIgPSAwOworICBpbnQgeWIgPSB3aW5kb3dfdGV4dF9ib3R0b21f eSAodyk7CisgIGludCBybiwgbnJvd3MgPSB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3M7CisgIGlu dCB5OworICBib29sIHJlZHJhd19wID0gMDsKKyAgTGlzcF9PYmplY3QgYm91bmRhcnlfdG9wID0g UW5pbCwgYm91bmRhcnlfYm90ID0gUW5pbDsKKyAgTGlzcF9PYmplY3QgYXJyb3dfdG9wID0gUW5p bCwgYXJyb3dfYm90ID0gUW5pbDsKKyAgTGlzcF9PYmplY3QgZW1wdHlfcG9zOworICBMaXNwX09i amVjdCBpbmQgPSBRbmlsOworI2RlZmluZSBNQVhfQklUTUFQX0NBQ0hFICg4KjQpCisgIGludCBi aXRtYXBfY2FjaGVbTUFYX0JJVE1BUF9DQUNIRV07CisgIGludCB0b3BfaW5kX3JuLCBib3RfaW5k X3JuOworICBpbnQgdG9wX2luZF9taW5feSwgYm90X2luZF9tYXhfeTsKKyAgLyogdG9wX2luZF9y biBpcyBzZXQgdG8gYSBub25uZWdhdGl2ZSB2YWx1ZSB3aGVuZXZlcgorICAgICByb3ctPmluZGlj YXRlX2JvYl9wIGlzIHNldCwgc28gaXQncyBPSyB0aGF0IHRvcF9yb3dfZW5kc19hdF96dl9wCisg ICAgIGlzIG5vdCBpbml0aWFsaXplZCBoZXJlLiAgU2ltaWxhcmx5IGZvciBib3RfaW5kX3JuLAor ICAgICByb3ctPmluZGljYXRlX2VvYl9wIGFuZCBib3Rfcm93X2VuZHNfYXRfenZfcC4gKi8KKyAg aW50IHRvcF9yb3dfZW5kc19hdF96dl9wIE1DX0lGX0xJTlQgKD0gMCksIGJvdF9yb3dfZW5kc19h dF96dl9wIE1DX0lGX0xJTlQgKD0gMCk7CisgIGlmICh3LT5wc2V1ZG9fd2luZG93X3ApCisgICAg cmV0dXJuIDA7CisgIGlmICghTUlOSV9XSU5ET1dfUCAodykKKyAgICAgICYmIChpbmQgPSBCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIGluZGljYXRlX2J1ZmZlcl9ib3VuZGFyaWVzKSwgIU5J TFAgKGluZCkpKQorICAgIHsKKyAgICAgIGlmIChFUSAoaW5kLCBRbGVmdCkgfHwgRVEgKGluZCwg UXJpZ2h0KSkKKyAgICAgICAgYm91bmRhcnlfdG9wID0gYm91bmRhcnlfYm90ID0gYXJyb3dfdG9w ID0gYXJyb3dfYm90ID0gaW5kOworICAgICAgICBlbHNlIGlmIChDT05TUCAoaW5kKQorICAgICAg ICAgICAgICAgICAmJiBDT05TUCAoWENBUiAoaW5kKSkpCisgICAgICAgIHsKKyAgICAgICAgICBM aXNwX09iamVjdCBwb3M7CisgICAgICAgICAgaWYgKHBvcyA9IG1jX2Fzc3EgKFF0LCBpbmQpLCAh TklMUCAocG9zKSkKKyAgICAgICAgICAgIGJvdW5kYXJ5X3RvcCA9IGJvdW5kYXJ5X2JvdCA9IGFy cm93X3RvcCA9IGFycm93X2JvdCA9IFhDRFIgKHBvcyk7CisgICAgICAgICAgaWYgKHBvcyA9IG1j X2Fzc3EgKFF0b3AsIGluZCksICFOSUxQIChwb3MpKQorICAgICAgICAgICAgYm91bmRhcnlfdG9w ID0gWENEUiAocG9zKTsKKyAgICAgICAgICBpZiAocG9zID0gbWNfYXNzcSAoUWJvdHRvbSwgaW5k KSwgIU5JTFAgKHBvcykpCisgICAgICAgICAgICBib3VuZGFyeV9ib3QgPSBYQ0RSIChwb3MpOwor ICAgICAgICAgIGlmIChwb3MgPSBtY19hc3NxIChRdXAsIGluZCksICFOSUxQIChwb3MpKQorICAg ICAgICAgICAgYXJyb3dfdG9wID0gWENEUiAocG9zKTsKKyAgICAgICAgICBpZiAocG9zID0gbWNf YXNzcSAoUWRvd24sIGluZCksICFOSUxQIChwb3MpKQorICAgICAgICAgICAgYXJyb3dfYm90ID0g WENEUiAocG9zKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgLyogQW55dGhp bmcgZWxzZSBtZWFucyBib3VuZGFyeSBvbiBsZWZ0IGFuZCBubyBhcnJvd3MuICovCisgICAgICAg ICAgYm91bmRhcnlfdG9wID0gYm91bmRhcnlfYm90ID0gUWxlZnQ7CisgICAgfQorICB0b3BfaW5k X3JuID0gYm90X2luZF9ybiA9IC0xOworICBpZiAoIU5JTFAgKGluZCkpCisgICAgeworICAgICAg Zm9yICh5ID0gdy0+dnNjcm9sbCwgcm4gPSAwOworICAgICAgICAgICB5IDwgeWIgJiYgcm4gPCBu cm93czsKKyAgICAgICAgICAgeSArPSByb3ctPmhlaWdodCwgKytybikKKyAgICAgICAgeworICAg ICAgICAgIHJvdyA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgaWYg KCFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgICAgIHJvdyA9IHctPmN1cnJlbnRfbWF0cml4LT5y b3dzICsgcm47CisgICAgICAgICAgcm93LT5pbmRpY2F0ZV9ib2JfcCA9IHJvdy0+aW5kaWNhdGVf dG9wX2xpbmVfcCA9IDA7CisgICAgICAgICAgcm93LT5pbmRpY2F0ZV9lb2JfcCA9IHJvdy0+aW5k aWNhdGVfYm90dG9tX2xpbmVfcCA9IDA7CisgICAgICAgICAgaWYgKCFyb3ctPm1vZGVfbGluZV9w KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAodG9wX2luZF9ybiA8IDAgJiYgcm93 LT52aXNpYmxlX2hlaWdodCA+IDApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg ICAgaWYgKE1BVFJJWF9ST1dfU1RBUlRfQ0hBUlBPUyAocm93KSA8PSBCVUZfQkVHViAoWEJVRkZF UiAody0+Y29udGVudHMpKQorICAgICAgICAgICAgICAgICAgICAgICYmICFNQVRSSVhfUk9XX1BB UlRJQUxMWV9WSVNJQkxFX0FUX1RPUF9QICh3LCByb3cpKQorICAgICAgICAgICAgICAgICAgICBy b3ctPmluZGljYXRlX2JvYl9wID0gIU5JTFAgKGJvdW5kYXJ5X3RvcCk7CisgICAgICAgICAgICAg ICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICByb3ctPmluZGljYXRlX3RvcF9saW5l X3AgPSAhTklMUCAoYXJyb3dfdG9wKTsKKyAgICAgICAgICAgICAgICAgIHRvcF9pbmRfcm4gPSBy bjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGlmIChib3RfaW5kX3JuIDwgMCkK KyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBpZiAoTUFUUklYX1JPV19FTkRf Q0hBUlBPUyAocm93KSA+PSBCVUZfWlYgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSkKKyAgICAgICAg ICAgICAgICAgICAgICAmJiAhTUFUUklYX1JPV19QQVJUSUFMTFlfVklTSUJMRV9BVF9CT1RUT01f UCAodywgcm93KSkKKyAgICAgICAgICAgICAgICAgICAgcm93LT5pbmRpY2F0ZV9lb2JfcCA9ICFO SUxQIChib3VuZGFyeV9ib3QpLCBib3RfaW5kX3JuID0gcm47CisgICAgICAgICAgICAgICAgICAg IGVsc2UgaWYgKHkgKyByb3ctPmhlaWdodCA+PSB5YikKKyAgICAgICAgICAgICAgICAgICAgICBy b3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3AgPSAhTklMUCAoYXJyb3dfYm90KSwgYm90X2luZF9y biA9IHJuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAg IH0KKyAgZW1wdHlfcG9zID0gQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBpbmRpY2F0ZV9l bXB0eV9saW5lcyk7CisgIGlmICghTklMUCAoZW1wdHlfcG9zKSAmJiAhRVEgKGVtcHR5X3Bvcywg UXJpZ2h0KSkKKyAgICBlbXB0eV9wb3MgPSBXSU5ET1dfTEVGVF9GUklOR0VfV0lEVEggKHcpID09 IDAgPyBRcmlnaHQgOiBRbGVmdDsKKyAgZm9yICh5ID0gMDsgeSA8IE1BWF9CSVRNQVBfQ0FDSEU7 IHkrKykKKyAgICBiaXRtYXBfY2FjaGVbeV0gPSAtMTsKKyNkZWZpbmUgTUNfTEVGVF9GUklOR0Uo Y2FjaGUsIHdoaWNoLCBwYXJ0aWFsX3ApCQkJXAorICAoYml0bWFwX2NhY2hlW2NhY2hlKjQrcGF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dG9wX3Jvd19lbmRzX2F0X3p2X3AgPSByb3ctPmVuZHNfYXRfenZfcDsKKyAgICAgIGlm IChyb3ctPmluZGljYXRlX2JvYl9wKQorICAgICAgICB7CisgICAgICAgICAgaWYgKEVRIChib3Vu ZGFyeV90b3AsIFFsZWZ0KSkKKyAgICAgICAgICAgIGJuID0gKChyb3ctPmluZGljYXRlX2VvYl9w ICYmIEVRIChib3VuZGFyeV9ib3QsIFFsZWZ0KSkKKyAgICAgICAgICAgICAgICAgID8gTUNfTEVG VF9GUklOR0UgKDEsIFF0b3BfYm90dG9tLCByb3ctPmVuZHNfYXRfenZfcCkKKyAgICAgICAgICAg ICAgICAgIDogTUNfTEVGVF9GUklOR0UgKDIsIFF0b3AsIDApKTsKKyAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgYm4gPSAoKHJvdy0+aW5kaWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5kYXJ5 X2JvdCwgUXJpZ2h0KSkKKyAgICAgICAgICAgICAgICAgICAgPyBNQ19SSUdIVF9GUklOR0UgKDEs IFF0b3BfYm90dG9tLCByb3ctPmVuZHNfYXRfenZfcCkKKyAgICAgICAgICAgICAgICAgICAgOiBN Q19SSUdIVF9GUklOR0UgKDIsIFF0b3AsIDApKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlm IChyb3ctPmluZGljYXRlX3RvcF9saW5lX3ApCisgICAgICAgICAgeworICAgICAgICAgICAgaWYg KEVRIChhcnJvd190b3AsIFFsZWZ0KSkKKyAgICAgICAgICAgICAgYm4gPSBNQ19MRUZUX0ZSSU5H RSAoNiwgUXVwLCAwKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIGJuID0g TUNfUklHSFRfRlJJTkdFICg2LCBRdXAsIDApOworICAgICAgICAgIH0KKyAgICAgIGlmIChibiAh PSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGZyaW5n ZV9iaXRtYXAgKmZiID0gZ2V0X2ZyaW5nZV9iaXRtYXBfZGF0YSAoYm4pOworICAgICAgICAgIGlm IChmYi0+YWxpZ24gPT0gQUxJR05fQklUTUFQX1RPUCAmJiBmYi0+cGVyaW9kID09IDApCisgICAg ICAgICAgICB7CisgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdzE7CisgICAgICAg ICAgICAgIGludCB0b3BfaW5kX21heF95OworICAgICAgICAgICAgICB0b3BfaW5kX21pbl95ID0g V0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgICAgICAgICAgICAgIHRvcF9pbmRfbWF4 X3kgPSB0b3BfaW5kX21pbl95ICsgZmItPmhlaWdodDsKKyAgICAgICAgICAgICAgaWYgKHRvcF9p bmRfbWF4X3kgPiB5YikKKyAgICAgICAgICAgICAgICB0b3BfaW5kX21heF95ID0geWI7CisgICAg ICAgICAgICAgIGZvciAoeSA9IHJvdy0+eSArIHJvdy0+aGVpZ2h0LCBybiA9IHRvcF9pbmRfcm4g KyAxOworICAgICAgICAgICAgICAgICAgIHkgPCB0b3BfaW5kX21heF95ICYmIHJuIDwgbnJvd3M7 CisgICAgICAgICAgICAgICAgICAgeSArPSByb3cxLT5oZWlnaHQsIHJuKyspCisgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgaWYgKGJvdF9pbmRfcm4gPj0gMCAmJiBybiA+PSBi b3RfaW5kX3JuKQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAg IHJvdzEgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHJuOworICAgICAgICAgICAgICAgICAg aWYgKCFyb3cxLT5lbmFibGVkX3ApCisgICAgICAgICAgICAgICAgICAgIHJvdzEgPSB3LT5jdXJy ZW50X21hdHJpeC0+cm93cyArIHJuOworICAgICAgICAgICAgICAgICAgcm93MS0+aW5kaWNhdGVf Ym9iX3AgPSByb3ctPmluZGljYXRlX2JvYl9wOworICAgICAgICAgICAgICAgICAgcm93MS0+aW5k aWNhdGVfdG9wX2xpbmVfcCA9IHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcDsKKyAgICAgICAgICAg ICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIGlmIChib3RfaW5kX3Ju ID49IDApCisgICAgeworICAgICAgaW50IGJuID0gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAg IHJvdyA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgYm90X2luZF9ybjsKKyAgICAgIGlmICgh cm93LT5lbmFibGVkX3ApCisgICAgICAgIHJvdyA9IHctPmN1cnJlbnRfbWF0cml4LT5yb3dzICsg Ym90X2luZF9ybjsKKyAgICAgIGJvdF9yb3dfZW5kc19hdF96dl9wID0gcm93LT5lbmRzX2F0X3p2 X3A7CisgICAgICBpZiAocm93LT5pbmRpY2F0ZV9lb2JfcCkKKyAgICAgICAgeworICAgICAgICAg IGlmIChFUSAoYm91bmRhcnlfYm90LCBRbGVmdCkpCisgICAgICAgICAgICBibiA9IE1DX0xFRlRf RlJJTkdFICgzLCBRYm90dG9tLCByb3ctPmVuZHNfYXRfenZfcCk7CisgICAgICAgICAgICBlbHNl CisgICAgICAgICAgICAgIGJuID0gTUNfUklHSFRfRlJJTkdFICgzLCBRYm90dG9tLCByb3ctPmVu ZHNfYXRfenZfcCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9i b3R0b21fbGluZV9wKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChFUSAoYXJyb3dfYm90 LCBRbGVmdCkpCisgICAgICAgICAgICAgIGJuID0gTUNfTEVGVF9GUklOR0UgKDcsIFFkb3duLCAw KTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIGJuID0gTUNfUklHSFRfRlJJ TkdFICg3LCBRZG93biwgMCk7CisgICAgICAgICAgfQorICAgICAgaWYgKGJuICE9IE1DX05PX0ZS SU5HRV9CSVRNQVApCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZnJpbmdlX2JpdG1hcCAq ZmIgPSBnZXRfZnJpbmdlX2JpdG1hcF9kYXRhIChibik7CisgICAgICAgICAgaWYgKGZiLT5hbGln biA9PSBBTElHTl9CSVRNQVBfQk9UVE9NICYmIGZiLT5wZXJpb2QgPT0gMCkKKyAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93MTsKKyAgICAgICAgICAgICAg aW50IGJvdF9pbmRfbWluX3k7CisgICAgICAgICAgICAgIGJvdF9pbmRfbWF4X3kgPSByb3ctPnkg KyByb3ctPnZpc2libGVfaGVpZ2h0OworICAgICAgICAgICAgICBib3RfaW5kX21pbl95ID0gYm90 X2luZF9tYXhfeSAtIGZiLT5oZWlnaHQ7CisgICAgICAgICAgICAgIGlmIChib3RfaW5kX21pbl95 IDwgV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodykpCisgICAgICAgICAgICAgICAgYm90X2lu ZF9taW5feSA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICAgICAgICAgICAgICBm b3IgKHkgPSByb3ctPnksIHJuID0gYm90X2luZF9ybiAtIDE7CisgICAgICAgICAgICAgICAgICAg eSA+PSBib3RfaW5kX21pbl95ICYmIHJuID49IDA7CisgICAgICAgICAgICAgICAgICAgeSAtPSBy b3cxLT5oZWlnaHQsIHJuLS0pCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg aWYgKHRvcF9pbmRfcm4gPj0gMCAmJiBybiA8PSB0b3BfaW5kX3JuKQorICAgICAgICAgICAgICAg ICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgIHJvdzEgPSB3LT5kZXNpcmVkX21hdHJpeC0+ cm93cyArIHJuOworICAgICAgICAgICAgICAgICAgaWYgKCFyb3cxLT5lbmFibGVkX3ApCisgICAg ICAgICAgICAgICAgICAgIHJvdzEgPSB3LT5jdXJyZW50X21hdHJpeC0+cm93cyArIHJuOworICAg ICAgICAgICAgICAgICAgcm93MS0+aW5kaWNhdGVfZW9iX3AgPSByb3ctPmluZGljYXRlX2VvYl9w OworICAgICAgICAgICAgICAgICAgcm93MS0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCA9IHJvdy0+ aW5kaWNhdGVfYm90dG9tX2xpbmVfcDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9 CisgICAgICAgIH0KKyAgICB9CisgIGJvb2wgYXV0b19oc2Nyb2xsX21vZGVfcCA9IEVRIChGYnVm ZmVyX2xvY2FsX3ZhbHVlIChRYXV0b19oc2Nyb2xsX21vZGUsIHctPmNvbnRlbnRzKSwgUWN1cnJl bnRfbGluZSk7CisgIC8qIEVYQU1QTEU6ICAoc2Nyb2xsLWxlZnQgNSkgKi8KKyAgYm9vbCBoc2Ns X2FsbF90ZW1wX3AgPSAody0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5f aHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBhbmQgZG8gbm90aGluZy4g Ki8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzBfcCA9ICh3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAg Qy11IEMteCA8IGFuZCBkbyBzb21ldGhpbmcgZWxzZSBiZXNpZGVzIGhvcml6b250YWxseSBzY3Jv bGxpbmcgdGhlCisgICAgICAgICAgICAgICBjdXJyZW50IGxpbmUgZGlmZmVyZW50bHkuCisgICAg ICAgICAgICAgICBDdXJyZW50IGxpbmUgaXMgX25vdF8gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRp ZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMV9wID0gKCF3LT5zdXNwZW5kX2F1 dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9t b2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhzY3JvbGwpOworICAv KiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCAuLi4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGlu ZSBpcyBfbm90XyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wg aHNjbF9hbGxfcGVybV8yX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPT0gMAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IHctPm1pbl9oc2Nyb2xsICE9IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgKHNjcm9sbC1s ZWZ0IDUpOyBhbmQsIHRoZW4gcHJlc3MgdGhlIGxlZnQgYXJyb3cga2V5IG9uZSB0aW1lLgorICAg ICAgICAgICAgICAgQ3VycmVudCBsaW5lIF9pc18gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZl cmVudGx5LiovCisgIGJvb2wgaHNjbF90ZW1wX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xs CisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAg ICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYg dy0+bWluX2hzY3JvbGwgPT0gMCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIHNv bWV0aGluZyB0aGF0IGNhdXNlcyB0aGUgY3VycmVudCBsaW5lIHRvIGJlCisgICAgICAgICAgICAg ICBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuCisgICAgICAgICAgICAgICBDdXJy ZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJv b2wgaHNjbF9wZXJtX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAg ICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICYm IHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwg PiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgIT0gdy0+aHNjcm9s bCk7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBmb3IgKHkgPSB3 LT52c2Nyb2xsLCBybiA9IDA7CisgICAgICAgeSA8IHliICY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gc3RydWN0IG1jX1JHQiBsc2xfZmcg PSB7LnJlZCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhfY21dLmNhY2hlW2NhY2hlX3R5cGVdW250 aF0uZmcucmVkLAorICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IHct Pm1jX21hdHJpeC52cG9zW3ZudGhfY21dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZmcuZ3JlZW4s CisgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSB3LT5tY19tYXRyaXgu dnBvc1t2bnRoX2NtXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZnLmJsdWV9OworICAgICAgLy8g IHN0cnVjdCBtY19SR0IgbHNsX2JnID0gey5yZWQgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoX2Nt XS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLnJlZCwKKyAgICAgIC8vICAgICAgICAgICAgICAg ICAgICAgICAgICAuZ3JlZW4gPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoX2NtXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhdLmJnLmdyZWVuLAorICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAg IC5ibHVlID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF9jbV0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XS5iZy5ibHVlfTsKKyAgICAgIGJvb2wgYWN0aXZlX3AgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRo X2NtXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmFjdGl2ZV9wOworICAgICAgZW51bSBtY19mbGF2 b3IgZ2x5cGhfZmxhdm9yID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF9jbV0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXS5nbHlwaF9mbGF2b3I7CisgICAgICBib29sIGVuYWJsZWRfcCA9IHctPm1jX21h dHJpeC52cG9zW3ZudGh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JRDsKKyAg ICAgICAgICBtY19sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRf RlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gb3Zl cmxheV9hcnJvd19mYWNlX2lkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICBpZiAody0+aHNjcm9sbCAhPSAwKQorICAgICAg ICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIr LW92ZXJsYXktYXJyb3ciKSwgZmFsc2UsIHRydWUpOworICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAo Iistb3ZlcmxheS1hcnJvdyIpLCB0cnVlLCB0cnVlKTsKKyAgICAgICAgICBtY19sZWZ0X2ZyaW5n ZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGZyaW5nZV9iaXRtYXAKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICB9 CisgICAgICAgIGVsc2UgaWYgKCh2cG9zID09IHZudGhfZG0gfHwgdnBvcyA9PSB2bnRoX2NtKQor ICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgPT0gTUNfT1ZFUkxBWV9BUlJPV19CSVRN QVAKKyAgICAgICAgICAgICAgICAgJiYgKGhzY2xfYWxsX3RlbXBfcAorICAgICAgICAgICAgICAg ICAgICAgfHwgaHNjbF9hbGxfcGVybV8wX3AKKyAgICAgICAgICAgICAgICAgICAgIHx8IGhzY2xf YWxsX3Blcm1fMV9wCisgICAgICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzJfcAor ICAgICAgICAgICAgICAgICAgICAgfHwgaHNjbF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgICAg IHx8IGhzY2xfcGVybV9wKQorICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAg ICAgeworICAgICAgICAgICAgaW50IGZyaW5nZV9iaXRtYXAgPSBNQ19OT19GUklOR0VfQklUTUFQ OworICAgICAgICAgICAgZW51bSBmYWNlX2lkIG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAg ICAgICAgICAgICghYWN0aXZlX3AKKyAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVG RkVSICh3LT5jb250ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgICAgICAg PyBsb29rdXBfZGVyaXZlZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ctaHNj bC1pbmFjdGl2ZS1wcmUtenYtZmFjZSIpLCBGUklOR0VfRkFDRV9JRCwgdHJ1ZSkKKyAgICAgICAg ICAgICAgOiAoYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgPyBsb29rdXBfZGVyaXZlZF9mYWNl ICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ctaHNjbC1wcmUtenYtZmFjZSIpLCBGUklO R0VfRkFDRV9JRCwgdHJ1ZSkKKyAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAg ICAgICAgICBtY19sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRf RlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBv dmVybGF5X2Fycm93X2ZhY2VfaWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgICBpZiAoaHNjbF9hbGxfcGVybV8wX3Ap CisgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywg aW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAgICAgICAgZWxz ZSBpZiAoaHNjbF9hbGxfcGVybV8xX3ApCisgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9 IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCB0cnVlLCBm YWxzZSk7CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF9hbGxfcGVybV8yX3ApCisgICAg ICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGlu dGVybiAoIistaHNjbC1wZXJtIiksIGZhbHNlLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgIGVs c2UgaWYgKGhzY2xfcGVybV9wKQorICAgICAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0g bWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIHRydWUsIHRy dWUpOworICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX2FsbF90ZW1wX3ApCisgICAg ICAgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3 LCBpbnRlcm4gKCIrLWhzY2wtdGVtcCIpLCBmYWxzZSwgZmFsc2UpOworICAgICAgICAgICAgICAg ICAgICAgIGVsc2UgaWYgKGhzY2xfdGVtcF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgZnJp bmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtdGVt cCIpLCB0cnVlLCBmYWxzZSk7CisgICAgICAgICAgICBtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgPSAo Y3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICB9CisgICAg ICAgICAgZWxzZSBpZiAoKHZwb3MgPT0gdm50aF9kbSB8fCB2cG9zID09IHZudGhfY20pCisgICAg ICAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRV9S SUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1D X1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAg ICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFCisgICAgICAgICAg ICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FS Uk9XCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJT RURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBn bHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAgICB8 fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAg ICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSCkK KyAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBMaXNwX09iamVjdCBiaXRtYXBfZmxhdm9yID0gKGdseXBoX2ZsYXZvciA9PSBNQ19I T0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBRbWNfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1D X1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX2hvbGxvd19yZWN0YW5n bGVfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xlCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0g TUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3cKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19S RVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX3ZlcnRpY2FsX2Jhcl9yaWdodF9h cnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhf Zmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElD QUxfQkFSKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFt Y19yZXZlcnNlZF92ZXJ0aWNhbF9iYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNh bF9iYXJfYmFja3NsYXNoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IFFuaWw7CisgICAgICAgICAgICAgIG1jX3JpZ2h0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29y X3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IGxvb2t1cF9mcmluZ2VfYml0bWFwIChiaXRtYXBfZmxhdm9yKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJ VE1BUDsKKyAgICAgICAgICAgICAgbWNfcmlnaHRfZnJpbmdlX2ZhY2VfaWQgPQorICAgICAgICAg ICAgICAgIChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisgICAgICAgICAg ICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYKKyAgICAgICAgICAgICAgICAgJiYgKGds eXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisg ICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElD QUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3Ig PT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKSkKKyAgICAgICAgICAgICAgICAgID8gbG9va3Vw X2Rlcml2ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZXZlcnNlZC1iYXItcHJlLXp2LWZhY2Ui KSwgRlJJTkdFX0ZBQ0VfSUQsIHRydWUpCisgICAgICAgICAgICAgICAgOiAoY3Vyc29yX3R5cGUg PT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAgICYmIHJvd19wb3Np dGlvbiA9PSBBVF9aVgorICAgICAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNf UkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAg ICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FS Uk9XCisgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNF RF9WRVJUSUNBTF9CQVIpKQorICAgICAgICAgICAgICAgICAgPyBsb29rdXBfZGVyaXZlZF9mYWNl ICh3LCBmLCBpbnRlcm4gKCIrLXJldmVyc2VkLWJhci1hdC16di1mYWNlIiksIEZSSU5HRV9GQUNF X0lELCB0cnVlKQorICAgICAgICAgICAgICAgIDogKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZS SU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gPT0gUE9TVF9a VgorICAgICAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9M TE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlw aF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAg ICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9C QVIpKQorICAgICAgICAgICAgICAgICAgPyBsb29rdXBfZGVyaXZlZF9mYWNlICh3LCBmLCBpbnRl cm4gKCIrLXJldmVyc2VkLWJhci1wb3N0LXp2LWZhY2UiKSwgRlJJTkdFX0ZBQ0VfSUQsIHRydWUp CisgICAgICAgICAgICAgICAgOiAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1B UAorICAgICAgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYKKyAgICAgICAg ICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdM RV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19S RVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAmJiBn bHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAg ICAgPyBsb29rdXBfZGVyaXZlZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLWJhci1wcmUtenYtZmFj ZSIpLCBGUklOR0VfRkFDRV9JRCwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlw ZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bv c2l0aW9uID09IEFUX1pWCisgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1D X1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAg ICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9X CisgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX1ZFUlRJ Q0FMX0JBUikKKyAgICAgICAgICAgICAgICAgID8gbG9va3VwX2Rlcml2ZWRfZmFjZSAodywgZiwg aW50ZXJuICgiKy1iYXItYXQtenYtZmFjZSIpLCBGUklOR0VfRkFDRV9JRCwgdHJ1ZSkKKyAgICAg ICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisgICAg ICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBPU1RfWlYKKyAgICAgICAgICAgICAg ICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdI VF9BUlJPVworICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNF RF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9m bGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAgICAgPyBs b29rdXBfZGVyaXZlZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLWJhci1wb3N0LXp2LWZhY2UiKSwg RlJJTkdFX0ZBQ0VfSUQs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QpKQorICAgICAgICB7CisgICAgICAg ICAgbGVmdCA9ICgocm93LT5pbmRpY2F0ZV9lb2JfcCAmJiBFUSAoYm91bmRhcnlfYm90LCBRbGVm dCkpCisgICAgICAgICAgICAgICAgID8gTUNfTEVGVF9GUklOR0UgKDEsIFF0b3BfYm90dG9tLCB0 b3Bfcm93X2VuZHNfYXRfenZfcCkKKyAgICAgICAgICAgICAgICAgOiBNQ19MRUZUX0ZSSU5HRSAo MiwgUXRvcCwgMCkpOworICAgICAgICAgIGlmICh0b3BfaW5kX21pbl95ID49IDApCisgICAgICAg ICAgICBsZWZ0X29mZnNldCA9IHRvcF9pbmRfbWluX3kgLSByb3ctPnk7CisgICAgICAgIH0KKyAg ICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5kYXJ5X2JvdCwgUWxl ZnQpKQorICAgICAgICB7CisgICAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdFICgzLCBRYm90 dG9tLCBib3Rfcm93X2VuZHNfYXRfenZfcCk7CisgICAgICAgICAgaWYgKGJvdF9pbmRfbWF4X3kg Pj0gMCkKKyAgICAgICAgICAgIGxlZnRfb2Zmc2V0ID0gYm90X2luZF9tYXhfeSAtIChyb3ctPnkg KyByb3ctPnZpc2libGVfaGVpZ2h0KTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAoKCFyb3ct PnJldmVyc2VkX3AgJiYgTUFUUklYX1JPV19DT05USU5VQVRJT05fTElORV9QIChyb3cpKQorICAg ICAgICAgICAgICAgfHwgKHJvdy0+cmV2ZXJzZWRfcCAmJiByb3ctPmNvbnRpbnVlZF9wKSkKKyAg ICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdFICg0LCBRY29udGludWF0aW9uLCAwKTsKKyAgICAg IGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfZW1wdHlfbGluZV9wICYmIEVRIChlbXB0eV9wb3MsIFFs ZWZ0KSkKKyAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdFICg1LCBRZW1wdHlfbGluZSwgMCk7 CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX3RvcF9saW5lX3AgJiYgRVEgKGFycm93X3Rv cCwgUWxlZnQpKQorICAgICAgICB7CisgICAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdFICg2 LCBRdXAsIDApOworICAgICAgICAgIGlmICh0b3BfaW5kX21pbl95ID49IDApCisgICAgICAgICAg ICBsZWZ0X29mZnNldCA9IHRvcF9pbmRfbWluX3kgLSByb3ctPnk7CisgICAgICAgIH0KKyAgICAg IGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCAmJiBFUSAoYXJyb3dfYm90LCBR bGVmdCkpCisgICAgICAgIHsKKyAgICAgICAgICBsZWZ0ID0gTUNfTEVGVF9GUklOR0UgKDcsIFFk b3duLCAwKTsKKyAgICAgICAgICBpZiAoYm90X2luZF9tYXhfeSA+PSAwKQorICAgICAgICAgICAg bGVmdF9vZmZzZXQgPSBib3RfaW5kX21heF95IC0gKHJvdy0+eSArIHJvdy0+dmlzaWJsZV9oZWln aHQpOworICAgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIGxlZnQgPSBNQ19OT19GUklOR0Vf QklUTUFQOworICAgICAgLyogRGVjaWRlIHdoaWNoIGJpdG1hcCB0byBkcmF3IGluIHRoZSByaWdo dCBmcmluZ2UuICovCisgICAgICBpZiAoV0lORE9XX1JJR0hUX0ZSSU5HRV9XSURUSCAodykgPT0g MCkKKyAgICAgICAgcmlnaHQgPSBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgZWxzZSBpZiAo cm93LT5yaWdodF91c2VyX2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAg ICAgICAgeworICAgICAgICAgIHJpZ2h0ID0gcm93LT5yaWdodF91c2VyX2ZyaW5nZV9iaXRtYXA7 CisgICAgICAgICAgcmlnaHRfZmFjZV9pZCA9IHJvdy0+cmlnaHRfdXNlcl9mcmluZ2VfZmFjZV9p ZDsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAoKCFyb3ctPnJldmVyc2VkX3AgJiYgcm93LT50 cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgIHx8IChyb3ctPnJldmVyc2VkX3Ag JiYgcm93LT50cnVuY2F0ZWRfb25fbGVmdF9wKSkKKyAgICAgICAgcmlnaHQgPSBNQ19SSUdIVF9G UklOR0UgKDAsIFF0cnVuY2F0aW9uLCAwKTsKKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVf Ym9iX3AgJiYgRVEgKGJvdW5kYXJ5X3RvcCwgUXJpZ2h0KSkKKyAgICAgICAgeworICAgICAgICAg IHJpZ2h0ID0gKChyb3ctPmluZGljYXRlX2VvYl9wICYmIEVRIChib3VuZGFyeV9ib3QsIFFyaWdo dCkpCisgICAgICAgICAgICAgPyBNQ19SSUdIVF9GUklOR0UgKDEsIFF0b3BfYm90dG9tLCB0b3Bf cm93X2VuZHNfYXRfenZfcCkKKyAgICAgICAgICAgICA6IE1DX1JJR0hUX0ZSSU5HRSAoMiwgUXRv cCwgMCkpOworICAgICAgICAgIGlmICh0b3BfaW5kX21pbl95ID49IDApCisgICAgICAgICAgICBy aWdodF9vZmZzZXQgPSB0b3BfaW5kX21pbl95IC0gcm93LT55OworICAgICAgICB9CisgICAgICBl bHNlIGlmIChyb3ctPmluZGljYXRlX2VvYl9wICYmIEVRIChib3VuZGFyeV9ib3QsIFFyaWdodCkp CisgICAgICAgIHsKKyAgICAgICAgICByaWdodCA9IE1DX1JJR0hUX0ZSSU5HRSAoMywgUWJvdHRv bSwgYm90X3Jvd19lbmRzX2F0X3p2X3ApOworICAgICAgICAgIGlmIChib3RfaW5kX21heF95ID49 IDApCisgICAgICAgICAgICByaWdodF9vZmZzZXQgPSBib3RfaW5kX21heF95IC0gKHJvdy0+eSAr IHJvdy0+dmlzaWJsZV9oZWlnaHQpOworICAgICAgICB9CisgICAgICBlbHNlIGlmICgoIXJvdy0+ cmV2ZXJzZWRfcCAmJiByb3ctPmNvbnRpbnVlZF9wKQorICAgICAgICAgICAgICAgfHwgKHJvdy0+ cmV2ZXJzZWRfcCAmJiBNQVRSSVhfUk9XX0NPTlRJTlVBVElPTl9MSU5FX1AgKHJvdykpKQorICAg ICAgICByaWdodCA9IE1DX1JJR0hUX0ZSSU5HRSAoNCwgUWNvbnRpbnVhdGlvbiwgMCk7CisgICAg ICBlbHNlIGlmIChyb3ctPmluZGljYXRlX3RvcF9saW5lX3AgJiYgRVEgKGFycm93X3RvcCwgUXJp Z2h0KSkKKyAgICAgICAgeworICAgICAgICAgIHJpZ2h0ID0gTUNfUklHSFRfRlJJTkdFICg2LCBR dXAsIDApOworICAgICAgICAgIGlmICh0b3BfaW5kX21pbl95ID49IDApCisgICAgICAgICAgICBy aWdodF9vZmZzZXQgPSB0b3BfaW5kX21pbl95IC0gcm93LT55OworICAgICAgICB9CisgICAgICBl bHNlIGlmIChyb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3AgJiYgRVEgKGFycm93X2JvdCwgUXJp Z2h0KSkKKyAgICAgICAgeworICAgICAgICAgIHJpZ2h0ID0gTUNfUklHSFRfRlJJTkdFICg3LCBR ZG93biwgMCk7CisgICAgICAgICAgaWYgKGJvdF9pbmRfbWF4X3kgPj0gMCkKKyAgICAgICAgICAg IHJpZ2h0X29mZnNldCA9IGJvdF9pbmRfbWF4X3kgLSAocm93LT55ICsgcm93LT52aXNpYmxlX2hl aWdodCk7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfZW1wdHlfbGlu ZV9wICYmIEVRIChlbXB0eV9wb3MsIFFyaWdodCkpCisgICAgICAgIHJpZ2h0ID0gTUNfUklHSFRf RlJJTkdFICg1LCBRZW1wdHlfbGluZSwgMCk7CisgICAgICBlbHNlCisgICAgICAgIHJpZ2h0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ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGN1ci0+cmVkcmF3X2Zy aW5nZV9iaXRtYXBzX3AgPSAxOworICAgICAgICAgICAgICBpZiAobWNfbGVmdF9mcmluZ2VfYml0 bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgIHx8IG1jX3JpZ2h0 X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICBj dXItPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcCA9IGZhbHNlOworICAgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICAgIGN1ci0+ZnJpbmdlX2JpdG1hcF9wZXJpb2RpY19wID0gcGVy aW9kaWNfcDsKKyAgICAgICAgICAgICAgaWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19O T19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgIGN1ci0+bGVmdF9mcmluZ2VfYml0bWFw ID0gbWNfbGVmdF9mcmluZ2VfYml0bWFwOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgICAgICAgIGN1ci0+bGVmdF9mcmluZ2VfYml0bWFwID0gbGVmdDsKKyAgICAgICAgICAgICAg aWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAg ICAgICAgICAgIGN1ci0+bGVmdF9mcmluZ2VfZmFjZV9pZCA9IG1jX2xlZnRfZnJpbmdlX2ZhY2Vf aWQ7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgY3VyLT5sZWZ0X2Zy aW5nZV9mYWNlX2lkID0gbGVmdF9mYWNlX2lkOworICAgICAgICAgICAgICBpZiAobWNfbGVmdF9m cmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgY3Vy LT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1jX2dldF9sb2dpY2FsX2ZyaW5n ZV9iaXRtYXAgKHcsIFFvdmVybGF5X2Fycm93LCAwLCAwKTsKKyAgICAgIGlmIChyb3ctPm92ZXJs YXlfYXJyb3dfYml0bWFwICE9IGN1ci0+b3ZlcmxheV9hcnJvd19iaXRtYXApCisgICAgICAgIHsK KyAgICAgICAgICByZWRyYXdfcCA9IDEsIHJvdy0+cmVkcmF3X2ZyaW5nZV9iaXRtYXBzX3AgPSAx OworICAgICAgICAgIGlmICgha2VlcF9jdXJyZW50X3ApCisgICAgICAgICAgICB7CisgICAgICAg ICAgICAgIGN1ci0+cmVkcmF3X2ZyaW5nZV9iaXRtYXBzX3AgPSAxOworICAgICAgICAgICAgICBj dXItPm92ZXJsYXlfYXJyb3dfYml0bWFwID0gcm93LT5vdmVybGF5X2Fycm93X2JpdG1hcDsKKyAg ICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAh PSBNQ19OT19GUklOR0VfQklUTUFQCisgICAgICAgICAgfHwgbWNfcmlnaHRfZnJpbmdlX2JpdG1h cCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICByb3ctPmZyaW5nZV9iaXRtYXBfcGVy aW9kaWNfcCA9IGZhbHNlOworICAgICAgICBlbHNlCisgICAgICAgICAgcm93LT5mcmluZ2VfYml0 bWFwX3BlcmlvZGljX3AgPSBwZXJpb2RpY19wOworICAgICAgaWYgKG1jX2xlZnRfZnJpbmdlX2Jp dG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICByb3ctPmxlZnRfZnJpbmdlX2Jp dG1hcCA9IG1jX2xlZnRfZnJpbmdlX2JpdG1hcDsKKyAgICAgICAgZWxzZQorICAgICAgICAgIHJv dy0+bGVmdF9mcmluZ2VfYml0bWFwID0gbGVmdDsKKyAgICAgIGlmIChtY19sZWZ0X2ZyaW5nZV9i aXRtYXAgIT0gTUNfTk9fRlJJTkdFX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Aodywgcm93LT55KSArIG9mZnNldDsKKyAgcC53aGljaCA9IHdoaWNoOworICBwLmJp dHMgPSBmYi0+Yml0czsKKyAgcC53ZCA9IGZiLT53aWR0aDsKKyAgcC5oID0gZmItPmhlaWdodDsK KyAgcC5kaCA9IChwZXJpb2QgPiAwID8gKHAueSAlIHBlcmlvZCkgOiAwKTsKKyAgcC5oIC09IHAu ZGg7CisgIC8qIEFkanVzdCB5IHRvIHRoZSBvZmZzZXQgaW4gdGhlIHJvdyB0byBzdGFydCBkcmF3 aW5nIHRoZSBiaXRtYXAuICovCisgIHN3aXRjaCAoZmItPmFsaWduKQorICAgIHsKKyAgICBjYXNl IEFMSUdOX0JJVE1BUF9DRU5URVI6CisgICAgICBwLnkgKz0gKHJvdy0+aGVpZ2h0IC0gcC5oKSAv IDI7CisgICAgICBicmVhazsKKyAgICBjYXNlIEFMSUdOX0JJVE1BUF9CT1RUT006CisgICAgICBw LnkgKz0gKHJvdy0+dmlzaWJsZV9oZWlnaHQgLSBwLmgpOworICAgICAgYnJlYWs7CisgICAgY2Fz ZSBBTElHTl9CSVRNQVBfVE9QOgorICAgICAgYnJlYWs7CisgICAgfQorICBwLmZhY2UgPSBGQUNF X0ZST01fSUQgKGYsIGZhY2VfaWQpOworICBpZiAocC5mYWNlID09IE5VTEwpCisgICAgeworICAg ICAgLyogVGhpcyBjb3VsZCBoYXBwZW4gYWZ0ZXIgY2xlYXJpbmcgZmFjZSBjYWNoZS4KKyAgICAg IEJ1dCBpdCBzaG91bGRuJ3QgaGFwcGVuIGFueW1vcmUuICArK2tmcyAqLworICAgICAgcmV0dXJu OworICAgIH0KKyAgcHJlcGFyZV9mYWNlX2Zvcl9kaXNwbGF5IChmLCBwLmZhY2UpOworICAvKiBD bGVhciBsZWZ0IGZyaW5nZSBpZiBubyBiaXRtYXAgdG8gZHJhdyBvciBpZiBiaXRtYXAgZG9lc24n dCBmaWxsCisgICAgIHRoZSBmcmluZ2UuICovCisgIHAuYnggPSAtMTsKKyA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0lEVEggKGYpCisgICAgICAgICAgICAmJiAhV0lORE9XX0hBU19W RVJUSUNBTF9TQ1JPTExfQkFSICh3KQorICAgICAgICAgICAgLyogQnV0IGRvbid0IHJlZHVjZSB0 aGUgZnJpbmdlIHdpZHRoIGlmIHRoZSB3aW5kb3cKKyAgICAgICAgICAgICAgIGhhcyBhIGxlZnQg bWFyZ2luLCBiZWNhdXNlIHRoYXQgbWVhbnMgd2UgYXJlIG5vdAorICAgICAgICAgICAgICAgaW4g ZGFuZ2VyIG9mIGRyYXdpbmcgb3ZlciB0aGUgdmVydGljYWwgYm9yZGVyLAorICAgICAgICAgICAg ICAgYW5kIE9UT0ggbGVhdmluZyBvdXQgdGhhdCBvbmUgcGl4ZWwgbGVhdmVzIGJlaGluZAorICAg ICAgICAgICAgICAgdHJhY2VzIG9mIHRoZSBjdXJzb3IsIGlmIGl0IHdhcyBpbiBjb2x1bW4gemVy bworICAgICAgICAgICAgICAgYmVmb3JlIGRyYXdpbmcgbm9uLWVtcHR5IG1hcmdpbiBhcmVhLiAq LworICAgICAgICAgICAgJiYgdy0+bGVmdF9tYXJnaW5fY29scyA9PSAwKQorICAgICAgICAgICA/ IDEgOiAwKTsKKyAgICAgICAgICBwLmJ4ID0geCAtIHdkOworICAgICAgICAgIHAubnggPSB3ZDsK KyAgICAgICAgfQorICAgIH0KKyAgZWxzZQorICAgIHsKKyAgICAgIGludCB4ID0gd2luZG93X2Jv eF9yaWdodCAodywKKyAgICAgICAgKFdJTkRPV19IQVNfRlJJTkdFU19PVVRTSURFX01BUkdJTlMg KHcpCisgICAgICAgICA/IFJJR0hUX01BUkdJTl9BUkVBCisgICAgICAgICA6IFRFWFRfQVJFQSkp OworICAgICAgaW50IHdkID0gV0lORE9XX1JJR0hUX0ZSSU5HRV9XSURUSCAodyk7CisgICAgICBp ZiAocC53ZCA+IHdkKQorICAgICAgICBwLndkID0gd2Q7CisgICAgICBwLnggPSB4ICsgKHdkIC0g cC53ZCkgLyAyOworICAgICAgLyogQ2xlYXIgcmlnaHQgZnJpbmdlIGlmIG5vIGJpdG1hcCB0byBk cmF3IG9mIGlmIGJpdG1hcCBkb2Vzbid0IGZpbGwKKyAgIHRoZSBmcmluZ2UuICovCisgICAgICBp ZiAocC53ZCA8IHdkIHx8IHAueSA+IHAuYnkgfHwgcC55ICsgcC5oIDwgcC5ieSArIHAubnkpCisg ICAgICAgIHsKKyAgICAgICAgICBwLmJ4ID0geDsKKyAgICAgICAgICBwLm54ID0gd2Q7CisgICAg ICAgIH0KKyAgICB9CisgIGlmIChwLnggPj0gV0lORE9XX0JPWF9MRUZUX0VER0VfWCAodykKKyAg ICAgICYmIChwLnggKyBwLndkKSA8PSBXSU5ET1dfQk9YX0xFRlRfRURHRV9YICh3KSArIFdJTkRP V19QSVhFTF9XSURUSCAodykpCisgICAgRlJBTUVfUklGIChmKS0+ZHJhd19mcmluZ2VfYml0bWFw ICh3LCByb3csICZwKTsKK30KKwordm9pZAorbWNfZHJhd19mcmluZ2VfYml0bWFwIChzdHJ1Y3Qg d2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCBsZWZ0X3AsIGVudW0gbWNfY3Vy c29yX3R5cGUgY3Vyc29yX3R5cGUpCit7CisgIGludCBvdmVybGF5ID0gMDsKKyAgaWYgKGxlZnRf cCA9PSByb3ctPnJldmVyc2VkX3AgJiYgcm93LT5jdXJzb3JfaW5fZnJpbmdlX3ApCisgICAgewor ICAgICAgTGlzcF9PYmplY3QgY3Vyc29yID0gUW5pbDsKKyAgICAgIHN3aXRjaCAoY3Vyc29yX3R5 cGUpCisgICAgICAgIHsKKyAgICAgICAgY2FzZSBNQ19GUkFNRURfQk9YOgorICAgICAgICAgIGlm IChyb3ctPnZpc2libGVfaGVpZ2h0ID49IFNUQU5EQVJEX0JJVE1BUF9IRUlHSFQgKGhvbGxvd19y ZWN0YW5nbGVfYml0cykpCisgICAgICAgICAgICBjdXJzb3IgPSBRaG9sbG93OworICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgIGN1cnNvciA9IFFob2xsb3dfc21hbGw7CisgICAgICAgICAgYnJl YWs7CisgICAgICAgIGNhc2UgTUNfSE9MTE9XX0JPWDoKKyAgICAgICAgICBpZiAocm93LT52aXNp YmxlX2hlaWdodCA+PSBTVEFOREFSRF9CSVRNQVBfSEVJR0hUIChob2xsb3dfcmVjdGFuZ2xlX2Jp dHMpKQorICAgICAgICAgICAgY3Vyc29yID0gUWhvbGxvdzsKKyAgICAgICAgICBlbHNlCisgICAg ICAgICAgICBjdXJzb3IgPSBRaG9sbG93X3NtYWxsOworICAgICAgICAgIGJyZWFrOworICAgICAg ICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAgICAgICAgY3Vyc29yID0gUWJveDsKKyAgICAgICAg ICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19CQVI6CisgICAgICAgICAgY3Vyc29yID0gUWJhcjsK KyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19IQkFSOgorICAgICAgICAgIGN1cnNv ciA9IFFoYmFyOworICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1DX05PX0ZSSU5HRV9C SVRNQVA6CisgICAgICAgIGNhc2UgTUNfTk9fQ1VSU09SOgorICAgICAgICBjYXNlIE1DX1JJR0hU X0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGNhc2UgTUNfTEVGVF9GUklOR0VfQklUTUFQOgorICAg ICAgICBkZWZhdWx0OgorICAgICAgICAgIHctPnBoeXNfY3Vyc29yX29uX3AgPSAwOworICAgICAg ICAgIHJvdy0+Y3Vyc29yX2luX2ZyaW5nZV9wID0gMDsKKyAgICAgICAgICBicmVhazsKKyAgICAg ICAgfQorICAgICAgaWYgKCFOSUxQIChjdXJzb3IpKQorICAgICAgICB7CisgICAgICAgICAgaW50 IGJtID0gbWNfZ2V0X2xvZ2ljYWxfY3Vyc29yX2JpdG1hcCAodywgY3Vyc29yKTsKKyAgICAgICAg ICBpZiAoYm0gIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgbWNfZHJhd19mcmluZ2VfYml0bWFwXzEgKHcsIHJvdywgbGVmdF9wLCAyLCBibSk7Cisg ICAgICAgICAgICAgIG92ZXJsYXkgPSBFUSAoY3Vyc29yLCBRYm94KSA/IDMgOiAxOworICAgICAg ICAgICAgfQorICAgICAgICB9CisgICAgfQorICBtY19kcmF3X2ZyaW5nZV9iaXRtYXBfMSAodywg cm93LCBsZWZ0X3AsIG92ZXJsYXksIE1DX05PX0ZSSU5HRV9CSVRNQVApOworICBpZiAobGVmdF9w ICYmIHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAg ICBtY19kcmF3X2ZyaW5nZV9iaXRtYXBfMSAodywgcm93LCAxLCAxLCByb3ctPm92ZXJsYXlfYXJy b3dfYml0bWFwKTsKK30KKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKICNkZWZpbmUgTk9fRlJJTkdFX0JJVE1BUCAwCiAjZGVmaW5lIFVO REVGX0ZSSU5HRV9CSVRNQVAgMQogI2RlZmluZSBNQVhfU1RBTkRBUkRfRlJJTkdFX0JJVE1BUFMg QVJSQVlFTFRTIChzdGFuZGFyZF9iaXRtYXBzKQpAQCAtMTY5OSw2ICszMjE3LDE2OCBAQCBSZXR1 cm4gbmlsIGlmIFBPUyBpcyBub3QgdmlzaWJsZSBpbiBXSU5ET1cuICAqLykKIHZvaWQKIHN5bXNf b2ZfZnJpbmdlICh2b2lkKQogeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogYmVn aW4gTVVMVElQTE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maXhudW0gKDQ4KSk7CisgIC8qIChnZXQgJystcXVhZHJ1cGxlLWFuZ2xlLWRv d24gJ2ZyaW5nZSkgPT4gNDggKi8KKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICAgREVGU1lNIChRdHJ1bmNhdGlvbiwgInRydW5jYXRp b24iKTsKICAgREVGU1lNIChRY29udGludWF0aW9uLCAiY29udGludWF0aW9uIik7CiAgIERFRlNZ TSAoUW92ZXJsYXlfYXJyb3csICJvdmVybGF5LWFycm93Iik7CmRpZmYgLS1naXQgYS9zcmMvbnN0 ZXJtLmggYi9zcmMvbnN0ZXJtLmgKaW5kZXggOTc3M2ViMy4uZTM0YTExNiAxMDA2NDQKLS0tIGEv c3JjL25zdGVybS5oCisrKyBiL3NyYy9uc3Rlcm0uaApAQCAtNjYzLDYgKzY2MywxNiBAQCB0eXBl ZGVmIGlkIGluc3RhbmNldHlwZTsKIAogQGludGVyZmFjZSBFbWFjc1Njcm9sbGVyIDogTlNTY3Jv bGxlcgogICB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJT T1JTICovCisKKyAgICBOU1JlY3QgbWNfcmVjdGFuZ2xlOworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKworCiAgICBzdHJ1Y3Qgd2luZG93ICp3aW5kb3c7CiAgICBzdHJ1Y3QgZnJhbWUgKmZy YW1lOwogICAgTlNSZXNwb25kZXIgKnByZXZSZXNwb25kZXI7CkBAIC02ODMsNiArNjkzLDE4IEBA IHR5cGVkZWYgaWQgaW5zdGFuY2V0eXBlOwogICAgaW50IGVtX3dob2xlOwogICAgfQogCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCistICh2b2lk KW1jX3NldF9yZWN0YW5nbGU6IChOU1JlY3QpcmVjdDsKKy0gKE5TUmVjdCltY19nZXRfcmVjdGFu Z2xlOworLSAoc3RydWN0IHdpbmRvdyAqKW1jX2dldF93aW5kb3c7CistIChib29sKW1jX2p1ZGdl OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAtIChpbnN0YW5jZXR5cGUpIGluaXRG cmFtZTogKE5TUmVjdCApciB3aW5kb3c6IChMaXNwX09iamVjdCl3aW47CiAtICh2b2lkKXNldEZy YW1lOiAoTlNSZWN0KXI7CiAKZGlmZiAtLWdpdCBhL3NyYy9uc3Rlcm0ubSBiL3NyYy9uc3Rlcm0u bQppbmRleCAwMjMzMTgyLi5iNzA4ZTk0IDEwMDY0NAotLS0gYS9zcmMvbnN0ZXJtLm0KKysrIGIv c3JjL25zdGVybS5tCkBAIC03Niw2ICs3Niw5NzUgQEAgVXBkYXRlZCBieSBDaHJpc3RpYW4gTGlt cGFjaCAoY2hyaXNAbmljZS5jaCkKIHN0YXRpYyBFbWFjc01lbnUgKm1haW5NZW51OwogI2VuZGlm CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JT ICovCisKK3N0YXRpYyBCT09MIG5zX2NsaXBfdG9fcmVjdCAoc3RydWN0IGZyYW1lICosIE5TUmVj dCAqLCBpbnQpOworCitzdGF0aWMgdm9pZCBuc19yZXNldF9jbGlwcGluZyAoc3RydWN0I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Is ICZjb2wpKQorICAgIHsKKyAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICBsc2wtPnJlZCA9 IC0xLjA7CisgICAgICBsc2wtPmdyZWVuID0gLTEuMDsKKyAgICAgIGxzbC0+Ymx1ZSA9IC0xLjA7 CisgICAgfQorICBbW2NvbCBjb2xvclVzaW5nRGVmYXVsdENvbG9yU3BhY2VdCisgICAgICAgIGdl dFJlZDogJnJlZCBncmVlbjogJmdyZWVuIGJsdWU6ICZibHVlIGFscGhhOiAmYWxwaGFdOworICB1 bmJsb2NrX2lucHV0ICgpOworICBsc2wtPnJlZCA9IHJlZDsKKyAgbHNsLT5ncmVlbiA9IGdyZWVu OworICBsc2wtPmJsdWUgPSBibHVlOworfQorCitzdGF0aWMgdm9pZAorbWNfbnNfZHJhd19vdmVy d3JpdHRlbiAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0 cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93LCBzdHJ1 Y3QgZ2x5cGggKmN1cnNvcl9nbHlwaCkKK3sKKyAgLy8gIGludCB2cG9zID0gTUFUUklYX1JPV19W UE9TIChyb3csIG1hdHJpeCk7CisgIC8vICBjbG9ja190IGNsb2NrX3N0YXJ0ID0gY2xvY2soKTsK KyAgLy8gbnNfZHJhd191bmRlcndhdmUgKHMsIHMtPndpZHRoLCBzLT54KTsKKyAgTlNDb2xvciAq aG9sbG93X2NvbG9yID0gRlJBTUVfQkFDS0dST1VORF9DT0xPUiAocy0+Zik7CisgIHN0cnVjdCBm YWNlICpmYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBERUZBVUxUX0ZBQ0VfSUQpOworICBpbnQg dm50aCA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAvKiBTVFJFVENIX0dMWVBI IG1heSBjb250YWluIG1vcmUgdGhhbiBvbmUgZmFrZSBjdXJzb3IgYXQgdGhlIHNhbWUgSFBPUy4K KyAgTk9URTogIEEgZmFrZSBjdXJzb3IgZnJvbSBvbmUgY2FjaGUgbWF5IG92ZXJ3cml0ZSBhIGZh a2UgY3Vyc29yIGZyb20gYW5vdGhlcgorICBjYWNoZSAtLSB0aHVzLCB3ZSBtdXN0IGNoZWNrIHRo ZW0gYWxsIGZvciBvdmVyd3JpdHRlbiBmYWtlIGN1cnNvcnMuICovCisgIGZvciAoZW51bSBtY19j YWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICBjYWNoZV90eXBlIDwgTk9f Q0FDSEU7CisgICAgICAgKytjYWNoZV90eXBlKQorICAgIHsKKyAgICAgIGZvciAoaW50IG50aCA9 IDA7CisgICAgICAgICAgIHMKKyAgICAgICAgICAgJiYgbWNfdHJhdmVyc2VfY2FjaGVfcCAocy0+ dy0+bWNfbWF0cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGgpOworICAgICAgICAgICArK250aCkK KyAgICAgICAgeworICAgICAgICAgIC8vICBpbnQgeCA9IHMtPnctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ueDsKKyAgICAgICAgICBpbnQgZnggPSBzLT53LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZ4OworICAgICAgICAg IC8vICBpbnQgeSA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF0ueTsKKyAgICAgICAgICBpbnQgZnkgPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLmZ5OworICAgICAgICAgIGludCBocG9zID0gcy0+dy0+bWNf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5ocG9zOworICAgICAgICAg IGludCB2cG9zID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXS52cG9zOworICAgICAgICAgIGludCB3ZCA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF0ud2Q7CisgICAgICAgICAgaW50IGggPSBzLT53LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmg7CisgICAgICAgICAgZW51 bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF0uY3Vyc29yX3R5cGU7CisgICAgICAgICAgLy8gIGludCBj dXJzb3Jfd2lkdGggPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLmN1cnNvcl93aWR0aDsKKyAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZyA9IHsu cmVkID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5m Zy5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gcy0+dy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5mZy5ncmVlbiwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IHMtPnctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZmcuYmx1ZX07CisgICAgICAgICAgLy8g IHN0cnVjdCBtY19SR0IgbHNsX2JnID0gey5yZWQgPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLnJlZCwKKyAgICAgICAgICAvLyAgICAgICAgICAg ICAgICAgICAgICAgICAgLmdyZWVuID0gcy0+dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXS5iZy5ncmVlbiwKKyAgICAgICAgICAvLyAgICAgICAgICAgICAgICAg ICAgICAgICAgLmJsdWUgPSBzLT53LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhdLmJnLmJsdWV9OworICAgICAgICAgIGJvb2wgYWN0aXZlX3AgPSBzLT53LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmFjdGl2ZV9wOworICAgICAg ICAgIC8vICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSBzLT53LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoX2ZsYXZvcjsKKyAgICAgICAgICBi b29sIGVuYWJsZWRfcCA9IHMtPnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF0uZW5hYmxlZF9wOworICAgICAgICAgIGJvb2wgZ29fcCA9ICh2cG9zID09IHZudGgK KyAgICAgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA9PSBjdXJzb3JfZ2x5cGgtPmhwb3MKKyAg ICAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKTsKKyAgICAgICAgICBpZiAoIWdvX3Ap CisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICBOU1JlY3QgcjsKKyAgICAgICAgICBy Lm9yaWdpbi54ID0gZng7CisgICAgICAgICAgci5vcmlnaW4ueSA9IGZ5OworICAgICAgICAgIHIu c2l6ZS5oZWlnaHQgPSBoOworICAgICAgICAgIHIuc2l6ZS53aWR0aCA9IHdkOworICAgICAgICAg IFtbTlNDb2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiBsc2xfZmcucmVkCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JlZW46IGxzbF9mZy5ncmVlbgorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBibHVlOiBsc2xfZmcuYmx1ZQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscGhhOiAxLjBdIHNldF07CisgICAgICBpZiAo Y3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVj dCBidWZmZXIgKmIgPSBYQlVGRkVSIChzLT53LT5jb250ZW50cyk7CisgICAgICAgICAgYm9vbCBy ZWdpb25fYWN0aXZlX3AgPSAoIU5JTFAgKFZ0cmFuc2llbnRfbWFya19tb2RlKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBtYXJrX2FjdGl2ZSkp KTsKKyAgICAgICAgICBwdHJkaWZmX3QgcmVnaW9uX2JlZyA9IChyZWdpb25fYWN0aXZlX3ApID8g bWNfcmVnaW9uX2xpbWl0ICgxKSA6IC0xOworICAgICAgICAgIHB0cmRpZmZfdCByZWdpb25fZW5k ID0gKHJlZ2lvbl9hY3RpdmVfcCkgPyBtY19yZWdpb25fbGltaXQgKDApIDogLTE7CisgICAgICAg ICAgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAmJiBhY3RpdmVfcAorICAgICAg ICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3MgPT0gcmVnaW9uX2JlZykKKyAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2Jl Z19mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAoIistcmVh bC1mYWtlLWN1cnNvci1hdC1yZWdpb24tcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICA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G9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGhvbGxv d19hY3RpdmVfcmVnaW9uX2VuZF9mYWNlKSwgcy0+Zik7CisgICAgICAgICAgICAgICAgaG9sbG93 X2NvbG9yID0gaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2NvbG9yOworICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAgIGVsc2UgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAg ICAgICAgICAmJiBhY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5 cGgtPmNoYXJwb3MgPiByZWdpb25fYmVnCisgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNv cl9nbHlwaC0+Y2hhcnBvcyA8IHJlZ2lvbl9lbmQpCisgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFj ZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlIChzLT53LCBzLT5mLCBpbnRlcm4gKCIrLXJlYWwtZmFr ZS1jdXJzb3ItaW4tcmVnaW9uLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAg ICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZSA9IEZBQ0Vf RlJPTV9JRCAocy0+ZiwgaG9sbG93X2FjdGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNlX2lkKTsKKyAg ICAgICAgICAgICAgICAgIE5TQ29sb3IgKmhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fY29s b3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChob2xsb3df YWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2UpLCBzLT5mKTsKKyAgICAgICAgICAgICAgICAgIGhv bGxvd19jb2xvciA9IGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fY29sb3I7CisgICAgICAg ICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYgKGFjdGl2ZV9wKQorICAgICAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2 ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAoIistcmVh bC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAg c3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgaG9s bG93X2FjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAgTlNDb2xvciAqaG9sbG93 X2FjdGl2ZV9jb2xvciA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9V TkQgKGhvbGxvd19hY3RpdmVfZmFjZSksIHMtPmYpOworICAgICAgICAgICAgICAgICAgICBob2xs b3dfY29sb3IgPSBob2xsb3dfYWN0aXZlX2NvbG9yOworICAgICAgICAgICAgICAgICAgfQorICAg ICAgICAgICAgICAgICAgZWxzZSBpZiAoIWFjdGl2ZV9wKQorICAgICAgICAgICAgICAgICAgICB7 CisgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNl X2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAoIistcmVhbC1mYWtl LWN1cnNvci1pbmFjdGl2ZS1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAg ICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2luYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKHMt PmYsIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAgICBOU0Nv bG9yICpob2xsb3dfaW5hY3RpdmVfY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNf RkFDRV9CQUNLR1JPVU5EIChob2xsb3dfaW5hY3RpdmVfZmFjZSksIHMtPmYpOworICAgICAgICAg ICAgICAgICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19pbmFjdGl2ZV9jb2xvcjsKKyAgICAg ICAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKGZhY2UgJiYgTlNf RkFDRV9CQUNLR1JPVU5EIChmYWNlKSA9PSBuc19pbmRleF9jb2xvciAoRlJBTUVfQ1VSU09SX0NP TE9SIChzLT5mKSwgcy0+ZikpCisgICAgICAgICAgeworICAgICAgICAgICAgW25zX2xvb2t1cF9p bmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQgKGZhY2UpLCBzLT5mKSBzZXRdOworICAg ICAgICAgICAgaG9sbG93X2NvbG9yID0gRlJBTUVfQ1VSU09SX0NPTE9SIChzLT5mKTsKKyAgICAg ICAgICB9CisgICAgICAgICAgc3dpdGNoIChjdXJzb3JfdHlwZSkKKyAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgY2FzZSBNQ19OT19GUklOR0VfQklUTUFQOgorICAgICAgICAgICAgICAgIGJy ZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX05PX0NVUlNPUjoKKyAgICAgICAgICAgICAgICBi cmVhazsKKyAgICAgICAgICAgICAgY2FzZSBNQ19SSUdIVF9GUklOR0VfQklUTUFQOgorICAgICAg ICAgICAgICBjYXNlIE1DX0xFRlRfRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgICAgICAgY2FzZSBN Q19GSUxMRURfQk9YOgorICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAg ICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX0ZSQU1FRF9CT1g6CisgICAgICAg ICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAgICAgICAgW2hvbGxvd19jb2xvciBz ZXRdOworICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKE5TSW5zZXRSZWN0IChyLCAxLCAxKSk7 CisgICAgICAgICAgICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAocy0+Zikgc2V0XTsKKyAgICAg ICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSBNQ19IT0xMT1dfQk9YOgorICAg ICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAgICAgIFtob2xsb3dfY29s b3Igc2V0XTsKKyAgICAgICAgICAgICAgICBOU1JlY3RGaWxsIChOU0luc2V0UmVjdCAociwgMSwg MSkpOworICAgICAgICAgICAgICAgIFtGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpIHNldF07Cisg ICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgTUNfSEJBUjoKKyAgICAg ICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAg ICAgICAgICAgY2FzZSBNQ19CQVI6CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7Cisg ICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgLyogSWYgYSBn bHlwaCBleGlzdHMgKHMtPmNoYXIyYiAhPSBOVUxMKSwgdGhlbiBkcmF3IHRoZSBnbHlwaCBvbiB0 b3Agb2YgdGhlCisgICAgICAgICAgbmV3bHkgZHJhd24gcmVjdGFuZ2xlIHRoYXQgd2FzIGNyZWF0 ZWQgaGVyZWluYWJvdmUuICBUbyB0aGUgZXh0ZW50IHRoYXQgd2UKKyAgICAgICAgICB3YW50IHRv IGRvdWJsZS1pbXByaW50IGdseXBocyB0byBtYWtlIHRoZW0gYXBwZWFyIHRvIGJlIHNlbWktYm9s ZCwgaXQgY2FuCisgICAgICAgICAgYmUgZG9uZSBoZXJlIGZvciBhbGwgY3Vyc29yIHR5cGVzLiAg VGhlIGJveC1zdHlsZSBjdXJzb3JzIGFyZSBpbXByaW50ZWQKKyAgICAgICAgICB3aXRoIGdseXBo cyBvbmx5IG9uZSAoMSkgdGltZS4gIFRoZSBzZW1pLWJvbGQgYXBwZWFyYW5jZSBpcyBoZWxwZnVs IHdoZW4KKyAgICAgICAgICBkZWJ1Z2dpbmcgdG8gc2VlIHRoYXQgdGhlIGNvb3JkaW5hdGVzIGFy ZSBjb3JyZWN0LiAqLworICAgICAgICAgIGlmIChzLT5jaGFyMmIgIT0gTlVMTAorICAgICAgICAg ICAgICAmJiAoY3Vyc29yX3R5cGUgPT0gTUNfRklMTEVEX0JPWAorICAgICAgICAgICAgICAgICAg fHwgY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWAorICAgICAgICAgICAgICAgICAgfHwgY3Vy c29yX3R5cGUgPT0gTUNfSE9MTE9XX0JPWCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAg IEJPT0wgaXNDb21wb3NpdGUgPSBzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZ UEg7CisgICAgICAgICAgICAgIGlmIChpc0NvbXBvc2l0ZSkKKyAgICAgICAgICAgICAgICBuc19k cmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAgICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qg Zm9udCAqZm9udCA9IHMtPmZhY2UtPmZvbnQ7CisgICAgICAgICAgICAgICAgICAgIGlmICghZm9u dCkKKyAgICAgICAgICAgICAgICAgICAgICBmb250ID0gRlJBTUVfRk9OVCAocy0+Zik7CisgICAg ICAgICAgICAgICAgICAgIGJvb2wgd2l0aF9iZ19wID0gZmFsc2U7CisgICAgICAgICAgICAgICAg ICAgIGZvbnQtPmRyaXZlci0+ZHJhdyAocywgcy0+Y21wX2Zyb20sIHMtPm5jaGFycywgcy0+eCwg cy0+eWJhc2UsIHdpdGhfYmdfcCk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9 CisgICAgICAgIH0KKyAgICB9CisgIC8vICBjbG9ja190IGNsb2NrX2VuZCA9IGNsb2NrKCk7Cisg IC8vICBkb3VibGUgY3B1X3RpbWVfdXNlZCA9ICgoZG91YmxlKSAoY2xvY2tfZW5kIC0gY2xvY2tf c3RhcnQpKSAvIENMT0NLU19QRVJfU0VDOworICAvLyAgZnByaW50ZiAoc3RkZXJyLCAibnNfZHJh d19vdmVyd3JpdHRlbiAoJWQpOiAgVElNRSAoJWYpXG4iLCB2cG9zLCBjcHVfdGltZV91c2VkKTsK K30KKworc3RhdGljIHZvaWQKK21jX25zX2RyYXdfd2luZG93X2N1cnNvciAoc3RydWN0IHdpbmRv dyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cs CisgICAgICAgICAgICAgICAgICBpbnQgeCwgaW50IGZ4LCBpbnQgeSwgaW50IGZ5LCBpbnQgaHBv cywgaW50IHZwb3MsIGludCB3ZCwgaW50IGgsCisgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNf UkdCIGxzbCwgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAg ICAgIGludCBjdXJzb3Jfd2lkdGgsIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciwgYm9vbCBv bl9wLCBib29sIGFjdGl2ZV9wKQoreworICAvKiBUaGUgcHJpb3IgYnVnIG9mIGEgZG91YmxlIGlt cHJpbnQgb24gdGhlIGdseXBoIHdoZXJlIGFuIE1DX0hCQVIgYW5kCisgIE1DX0JBUiBpcyBwb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vbG9yV2l0aENh bGlicmF0ZWRSZWQ6IGxzbC5yZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBncmVl bjogbHNsLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJsdWU6IGxzbC5i bHVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwaGE6IDEuMF0gc2V0XTsKKyAg ICBlbHNlCisgICAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChmKSBzZXRdOworICBpZiAoY3Vyc29y X3R5cGUgPT0gTUNfRlJBTUVEX0JPWCkKKyAgICB7CisgICAgICBzdHJ1Y3QgYnVmZmVyICpiID0g WEJVRkZFUiAody0+Y29udGVudHMpOworICAgICAgYm9vbCByZWdpb25fYWN0aXZlX3AgPSAoIU5J TFAgKFZ0cmFuc2llbnRfbWFya19tb2RlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgIU5JTFAgKEJWQVIgKGIsIG1hcmtfYWN0aXZlKSkpOworICAgICAgcHRyZGlmZl90IHJlZ2lv bl9iZWcgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IG1jX3JlZ2lvbl9saW1pdCAoMSkgOiAtMTsKKyAg ICAgIHB0cmRpZmZfdCByZWdpb25fZW5kID0gKHJlZ2lvbl9hY3RpdmVfcCkgPyBtY19yZWdpb25f bGltaXQgKDApIDogLTE7CisgICAgICBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgJiYg YWN0aXZlX3AKKyAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3MgPT0gcmVnaW9uX2Jl ZykKKyAgICAgICAgeworICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lv bl9iZWdfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwt ZmFrZS1jdXJzb3ItYXQtcmVnaW9uLXByZS16di1mYWNlI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mFj dGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgIE5TQ29sb3IgKmhvbGxvd19pbmFjdGl2 ZV9jb2xvciA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGhv bGxvd19pbmFjdGl2ZV9mYWNlKSwgZik7CisgICAgICAgICAgICAgICAgICBob2xsb3dfY29sb3Ig PSBob2xsb3dfaW5hY3RpdmVfY29sb3I7CisgICAgICAgICAgICAgICAgfQorICAgIH0KKyAgICBl bHNlIGlmIChmYWNlICYmIE5TX0ZBQ0VfQkFDS0dST1VORCAoZmFjZSkgPT0gbnNfaW5kZXhfY29s b3IgKEZSQU1FX0NVUlNPUl9DT0xPUiAoZiksIGYpKQorICAgICAgeworICAgICAgICBbbnNfbG9v a3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoZmFjZSksIGYpIHNldF07Cisg ICAgICAgIGhvbGxvd19jb2xvciA9IEZSQU1FX0NVUlNPUl9DT0xPUiAoZik7CisgICAgICB9Cisj aWZkZWYgTlNfSU1QTF9DT0NPQQorICBOU0Rpc2FibGVTY3JlZW5VcGRhdGVzICgpOworI2VuZGlm CisgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgeworICAgICAgY2FzZSBNQ19OT19GUklOR0Vf QklUTUFQOgorICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfTk9fQ1VSU09SOgorICAgICAg ICBicmVhazsKKyAgICAgIGNhc2UgTUNfUklHSFRfRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgYnJl YWs7CisgICAgICBjYXNlIE1DX0xFRlRfRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgYnJlYWs7Cisg ICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAg ICBicmVhazsKKyAgICAgIGNhc2UgTUNfRlJBTUVEX0JPWDoKKyAgICAgICAgTlNSZWN0RmlsbCAo cik7CisgICAgICAgIFtob2xsb3dfY29sb3Igc2V0XTsKKyAgICAgICAgTlNSZWN0RmlsbCAoTlNJ bnNldFJlY3QgKHIsIDEsIDEpKTsKKyAgICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAoZikgc2V0 XTsKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1DX0hPTExPV19CT1g6CisgICAgICAgIE5T UmVjdEZpbGwgKHIpOworICAgICAgICBbaG9sbG93X2NvbG9yIHNldF07CisgICAgICAgIE5TUmVj dEZpbGwgKE5TSW5zZXRSZWN0IChyLCAxLCAxKSk7CisgICAgICAgIFtGUkFNRV9DVVJTT1JfQ09M T1IgKGYpIHNldF07CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19IQkFSOgorICAgICAg ICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1DX0JBUjoKKyAg ICAgICAgcyA9IHI7CisgICAgICAgIC8qIEBsYXdsaXN0IGlzIGZvY3VzaW5nIHRoZSBpbml0aWFs IGRldmVsb3BtZW50IG9mIGZlYXR1cmUgcmVxdWVzdHMKKyAgICAgICAgIzE3Njg0IGFuZCAjMjI4 NzMgb24gTDJSIGxhbmd1YWdlcy4gKi8KKyAgICAgICAgaWYgKGdseXBoX2ZsYXZvciAhPSBNQ19H TFlQSAorICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX0dMWVBITEVTUykKKyAgICAg ICAgICB7CisgICAgICAgICAgICAvKiBJZiB0aGUgY2hhcmFjdGVyIHVuZGVyIGN1cnNvciBpcyBS MkwsIGRyYXcgdGhlIGJhciBjdXJzb3IKKyAgICAgICAgICAgICAgIG9uIHRoZSByaWdodCBvZiBp dHMgZ2x5cGgsIHJhdGhlciB0aGFuIG9uIHRoZSBsZWZ0LiAqLworICAgICAgICAgICAgaWYgKChj dXJzb3JfZ2x5cGgtPnJlc29sdmVkX2xldmVsICYgMSkgIT0gMCkKKyAgICAgICAgICAgICAgcy5v cmlnaW4ueCArPSBjdXJzb3JfZ2x5cGgtPnBpeGVsX3dpZHRoIC0gcy5zaXplLndpZHRoOworICAg ICAgICAgIH0KKyAgICAgICAgTlNSZWN0RmlsbCAocyk7CisgICAgICAgIGJyZWFrOworICAgIH0K KyAgbnNfcmVzZXRfY2xpcHBpbmcgKGYpOworICAvKiBkcmF3IHRoZSBjaGFyYWN0ZXIgdW5kZXIg dGhlIGN1cnNvciAqLworICBpZiAoZ2x5cGhfZmxhdm9yICE9IE1DX0dMWVBITEVTUworICAgICAg JiYgKGN1cnNvcl90eXBlID09IE1DX0ZSQU1FRF9CT1gKKyAgICAgICAgICB8fCBjdXJzb3JfdHlw ZSA9PSBNQ19GSUxMRURfQk9YCisgICAgICAgICAgfHwgY3Vyc29yX3R5cGUgPT0gTUNfSE9MTE9X X0JPWAorICAgICAgICAgIHx8IChkZWJ1Z19wCisgICAgICAgICAgICAgICYmIGN1cnNvcl90eXBl ID09IE1DX0hCQVIpCisgICAgICAgICAgfHwgKGRlYnVnX3AKKyAgICAgICAgICAgICAgJiYgY3Vy c29yX3R5cGUgPT0gTUNfQkFSKSkpCisgICAgeworICAgICAgLyogYGN1cnNvcl9nY19wYCBpcyB1 c2VkIG9ubHkgYnkgYHczMnRlcm0uY2AgYW5kIGB4dGVybS5jJy4gKi8KKyAgICAgIGJvb2wgY3Vy c29yX2djX3AgPSBmYWxzZTsKKyAgICAgIGNvbnN0IEVtYWNzX1JlY3RhbmdsZSAqc2F2ZWRfY2xp cCA9IE5VTEw7CisgICAgICBpZiAocm93LT5jbGlwICE9IE5VTEwpCisgICAgICAgIHsKKyAgICAg ICAgICBzYXZlZF9jbGlwID0gcm93LT5jbGlwOworICAgICAgICAgIHJvdy0+Y2xpcCA9IE5VTEw7 CisgICAgICAgIH0KKyAgICAgIG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywg RFJBV19DVV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X2RlZmF1bHRlZF9wKQorICAgICAgICAg ICAgW2RlZmF1bHRDb2wgc2V0XTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgW25z X2xvb2t1cF9pbmRleGVkX2NvbG9yIChmYWNlLT51bmRlcmxpbmVfY29sb3IsIHMtPmYpIHNldF07 CisgICAgICAgICAgbnNfZHJhd191bmRlcndhdmUgKHMsIHdpZHRoLCB4KTsKKyAgICAgICAgfQor ICAgICAgICBlbHNlIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX0xJ TkUpCisgICAgICAgICAgeworICAgICAgICAgICAgTlNSZWN0IHI7CisgICAgICAgICAgICB1bnNp Z25lZCBsb25nIHRoaWNrbmVzcywgcG9zaXRpb247CisgICAgICAgICAgICAvKiBJZiB0aGUgcHJl diB3YXMgdW5kZXJsaW5lZCwgbWF0Y2ggaXRzIGFwcGVhcmFuY2UuICovCisgICAgICAgICAgICBp ZiAocy0+cHJldiAmJiBzLT5wcmV2LT5mYWNlLT51bmRlcmxpbmVfcAorICAgICAgICAgICAgICAg ICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORQorICAg ICAgICAgICAgICAgICYmIHMtPnByZXYtPnVuZGVybGluZV90aGlja25lc3MgPiAwKQorICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+cHJldi0+dW5kZXJsaW5l X3RoaWNrbmVzczsKKyAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPnByZXYtPnVuZGVybGlu ZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlCisgICAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgICAgc3RydWN0IGZvbnQgKmZvbnQ7CisgICAgICAg ICAgICAgICAgICB1bnNpZ25lZCBsb25nIGRlc2NlbnQ7CisgICAgICAgICAgICAgICAgICBmb250 PXMtPmZvbnQ7CisgICAgICAgICAgICAgICAgICBkZXNjZW50ID0gcy0+eSArIHMtPmhlaWdodCAt IHMtPnliYXNlOworICAgICAgICAgICAgICAgICAgLyogVXNlIHVuZGVybGluZSB0aGlja25lc3Mg b2YgZm9udCwgZGVmYXVsdGluZyB0byAxLiAqLworICAgICAgICAgICAgICAgICAgdGhpY2tuZXNz ID0gKGZvbnQgJiYgZm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzcyA+IDApCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IGZvbnQtPnVuZGVybGluZV90aGlja25lc3MKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogMTsKKyAgICAgICAgICAgICAgICAgIC8qIERldGVybWluZSB0 aGUgb2Zmc2V0IG9mIHVuZGVybGluaW5nIGZyb20gdGhlIGJhc2VsaW5lLiAqLworICAgICAgICAg ICAgICAgICAgaWYgKHhfdW5kZXJsaW5lX2F0X2Rlc2NlbnRfbGluZSkKKyAgICAgICAgICAgICAg ICAgICAgcG9zaXRpb24gPSBkZXNjZW50IC0gdGhpY2tuZXNzOworICAgICAgICAgICAgICAgICAg ICBlbHNlIGlmICh4X3VzZV91bmRlcmxpbmVfcG9zaXRpb25fcHJvcGVydGllcworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBmb250ICYmIGZvbnQtPnVuZGVybGluZV9wb3NpdGlvbiA+ PSAwKQorICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gZm9udC0+dW5kZXJsaW5lX3Bv c2l0aW9uOworICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGZvbnQpCisgICAgICAgICAg ICAgICAgICAgICAgICBwb3NpdGlvbiA9IGxyb3VuZCAoZm9udC0+ZGVzY2VudCAvIDIpOworICAg ICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICBwb3Np dGlvbiA9IHVuZGVybGluZV9taW5pbXVtX29mZnNldDsKKyAgICAgICAgICAgICAgICAgIHBvc2l0 aW9uID0gbWF4IChwb3NpdGlvbiwgdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0KTsKKyAgICAgICAg ICAgICAgICAgIC8qIEVuc3VyZSB1bmRlcmxpbmluZyBpcyBub3QgY3JvcHBlZC4gKi8KKyAgICAg ICAgICAgICAgICAgIGlmIChkZXNjZW50IDw9IHBvc2l0aW9uKQorICAgICAgICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBkZXNjZW50IC0gMTsKKyAgICAg ICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAxOworICAgICAgICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGRlc2NlbnQgPCBwb3NpdGlvbiArIHRoaWNrbmVz cykKKyAgICAgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAxOworICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgIHMtPnVuZGVybGluZV90aGlja25lc3MgPSB0aGlja25lc3M7CisgICAg ICAgICAgICBzLT51bmRlcmxpbmVfcG9zaXRpb24gPSBwb3NpdGlvbjsKKyAgICAgICAgICAgIHIg PSBOU01ha2VSZWN0ICh4LCBzLT55YmFzZSArIHBvc2l0aW9uLCB3aWR0aCwgdGhpY2tuZXNzKTsK KyAgICAgICAgICAgIGlmIChmYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3ApCisgICAgICAgICAg ICAgIFtkZWZhdWx0Q29sIHNldF07CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAg ICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKGZhY2UtPnVuZGVybGluZV9jb2xvciwgcy0+Zikg c2V0XTsKKyAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgIH0KKyAgICB9Cisg IC8qIERvIG92ZXJsaW5lLiBXZSBmb2xsb3cgb3RoZXIgdGVybXMgaW4gdXNpb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9pbmRleGVkX2NvbG9yIChOU19G QUNFX0ZPUkVHUk9VTkQgKGZhY2UpLCBzLT5mKTsKKyAgICAgIGZvciAoaSA9IDA7IGkgPCBuOyAr K2kpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoIXMtPnJvdy0+ZnVsbF93aWR0aF9wKQorICAg ICAgICAgICAgeworICAgICAgICAgICAgICBpbnQgb3ZlcnJ1biwgbGVmdG92ZXJydW47CisgICAg ICAgICAgICAgIC8qIHRydW5jYXRlIHRvIGF2b2lkIG92ZXJ3cml0aW5nIGZyaW5nZSBhbmQvb3Ig c2Nyb2xsYmFyICovCisgICAgICAgICAgICAgIG92ZXJydW4gPSBtYXggKDAsIChzLT54ICsgcy0+ YmFja2dyb3VuZF93aWR0aCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gKFdJ TkRPV19CT1hfUklHSFRfRURHRV9YIChzLT53KQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgLSBXSU5ET1dfUklHSFRfRlJJTkdFX1dJRFRIIChzLT53KSkpOworICAgICAgICAgICAgICAg ICAgICByW2ldLnNpemUud2lkdGggLT0gb3ZlcnJ1bjsKKyAgICAgICAgICAgICAgLyogdHJ1bmNh dGUgdG8gYXZvaWQgb3ZlcndyaXRpbmcgdG8gbGVmdCBvZiB0aGUgd2luZG93IGJveCAqLworICAg ICAgICAgICAgICBsZWZ0b3ZlcnJ1biA9IChXSU5ET1dfQk9YX0xFRlRfRURHRV9YIChzLT53KQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIFdJTkRPV19MRUZUX0ZSSU5HRV9XSURUSCAo cy0+dykpIC0gcy0+eDsKKyAgICAgICAgICAgICAgaWYgKGxlZnRvdmVycnVuID4gMCkKKyAgICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICByW2ldLm9yaWdpbi54ICs9IGxlZnRvdmVy cnVuOworICAgICAgICAgICAgICAgICAgcltpXS5zaXplLndpZHRoIC09IGxlZnRvdmVycnVuOwor ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgLyogWFhYOiBUcnkgdG8gd29yayBiZXR3 ZWVuIHByb2JsZW0gd2hlcmUgYSBzdHJldGNoIGdseXBoIG9uCisgICAgICAgICAgICAgICAgIGEg cGFydGlhbGx5LXZpc2libGUgYm90dG9tIHJvdyB3aWxsIGNsZWFyIHBhcnQgb2YgdGhlCisgICAg ICAgICAgICAgICAgIG1vZGVsaW5lLCBhbmQgYW5vdGhlciB3aGVyZSBsaXN0LWJ1ZmZlcnMgaGVh ZGVycyBhbmQgc2ltaWxhcgorICAgICAgICAgICAgICAgICByb3dzIGVycm9uZW91c2x5IGhhdmUg dmlzaWJsZV9oZWlnaHQgc2V0IHRvIDAuICBOb3Qgc3VyZQorICAgICAgICAgICAgICAgICB3aGVy ZSB0aGlzIGlzIGNvbWluZyBmcm9tIGFzIG90aGVyIHRlcm1zIHNlZW0gbm90IHRvIHNob3cuICov CisgICAgICAgICAgICAgIHJbaV0uc2l6ZS5oZWlnaHQgPSBtaW4gKHMtPmhlaWdodCwgcy0+cm93 LT52aXNpYmxlX2hlaWdodCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgW2JnQ29sIHNldF07 CisgICAgICAgICAgLyogTk9URTogdW5kZXIgTlMgdGhpcyBpcyBOT1QgdXNlZCB0byBkcmF3IGN1 cnNvcnMsIGJ1dCB3ZSBtdXN0IGF2b2lkCisgICAgICAgICAgICAgb3ZlcndyaXRpbmcgY3Vyc29y ICh1c3VhbGx5IHdoZW4gY3Vyc29yIG9uIGEgdGFiKSAqLworICAgICAgICAgIGlmIChzLT5obCA9 PSBEUkFXX0NVUlNPUikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogRklYTUU6ICBE byB3ZSBzdGlsbCBuZWVkIHRvIHByZXZlbnQgdGhpcyBzZWN0aW9uIG9mIGNvZGUgZnJvbQorICAg ICAgICAgICAgICBlcmFzaW5nIHRoZSBmYWtlIE1DX0hCQVIgdGhhdCBleHRlbmRzIHRoZSBlbnRp cmUgbGVuZ3RoIG9mIHRoZQorICAgICAgICAgICAgICBTVFJFVENIX0dMWVBIPyAgVGhpcyBtYXkg aGF2ZSBiZWVuIGRvbmUgcHJpb3IgdG8gdGhlIGZpeCByZWxhdGluZworICAgICAgICAgICAgICB0 byBsZWZ0L3JpZ2h0IG92ZXJ3cml0dGVuIGdseXBocy4gKi8KKyAgICAgICAgICAgICAgcltpXS5z aXplLmhlaWdodCAtPSAxOworICAgICAgICAgICAgICAvLyAgZW51bSBmYWNlX2lkIGRlYnVnZ2lu Z19mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAoIistZGVi dWdnaW5nLWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgIC8vICBzdHJ1Y3QgZmFjZSAqZGVi dWdnaW5nX2ZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIGRlYnVnZ2luZ19mYWNlX2lkKTsKKyAg ICAgICAgICAgICAgLy8gIE5TQ29sb3IgKmNvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3Ig KE5TX0ZBQ0VfRk9SRUdST1VORCAoZGVidWdnaW5nX2ZhY2UpLCBzLT5mKTsKKyAgICAgICAgICAg ICAgLy8gIFtjb2xvciBzZXRdOworICAgICAgICAgICAgICBDR0Zsb2F0IHggPSByW2ldLm9yaWdp bi54OworICAgICAgICAgICAgICBDR0Zsb2F0IHdpZHRoID0gd2Q7CisgICAgICAgICAgICAgIHJb aV0uc2l6ZS53aWR0aCAtPSB3aWR0aDsKKyAgICAgICAgICAgICAgcltpXS5vcmlnaW4ueCArPSB3 aWR0aDsKKyAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocltpXSk7CisgICAgICAgICAgICAgIC8q IERyYXcgb3ZlcmxpbmluZywgZXRjLiBvbiB0aGUgY3Vyc29yLiAqLworICAgICAgICAgICAgICBp ZiAocy0+dy0+cGh5c19jdXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9YKQorICAgICAgICAgICAg ICAgIG1jX25zX2RyYXdfdGV4dF9kZWNvcmF0aW9uIChzLCBmYWNlLCBiZ0NvbCwgd2lkdGgsIHgp OworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIG1jX25zX2RyYXdfdGV4 dF9kZWNvcmF0aW9uIChzLCBmYWNlLCBmZ0NvbCwgd2lkdGgsIHgpOworICAgICAgICAgICAgfQor ICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgLy8gIGludCByeCA9IHJbaV0ub3JpZ2lu Lng7CisgIC8vICBpbnQgcnkgPSByW2ldLm9yaWdpbi55OworICAvLyAgaW50IHJ3ID0gcltpXS5z aXplLndpZHRoOworICAvLyAgaW50IHJoID0gcltpXS5zaXplLmhlaWdodDsKKyAgLy8gIGZwcmlu dGYgKHN0ZGVyciwgIm1jX25zX2R1bXBnbHlwaHNfc3RyZXRjaDogIHZwb3MgKCVkKSB8IHJ4ICgl ZCkgfCByeSAoJWQpIHwgcncgKCVkKSB8IHJoICglZClcbiIsCisgIC8vICAgICAgICAgICAgICAg ICAgIHMtPmZpcnN0X2dseXBoLT52cG9zLCByeCwgcnksIHJ3LCByaCk7CisgICAgICAgICAgICAg IE5TUmVjdEZpbGwgKHJbaV0pOworICAgICAgICAgICAgfQorICAgICAgICAgIC8qIERyYXcgb3Zl cmxpbmluZywgZXRjLiBvbiB0aGUgc3RyZXRjaCBnbHlwaCAob3IgdGhlIHBhcnQKKyAgICAgICAg ICAgICBvZiB0aGUgc3RyZXRjaCBnbHlwaCBhZnRlciB0aGUgY3Vyc29yKS4gKi8KKyAgICAgICAg ICBtY19uc19kcmF3X3RleHRfZGVjb3JhdGlvbiAocywgZmFjZSwgZmdDb2wsIHJbaV0uc2l6ZS53 aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcltpXS5vcmlnaW4u eCk7CisgICAgICAgIH0KKy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NlaG9sZGVyIGlmIGltZyA9PW5pbD8gKi8KKyAgaWYgKGltZyAhPSBu aWwpCisgICAgeworI2lmZGVmIE5TX0lNUExfQ09DT0EKKyAgICAgIE5TUmVjdCBkciA9IE5TTWFr ZVJlY3QgKHgsIHksIHMtPnNsaWNlLndpZHRoLCBzLT5zbGljZS5oZWlnaHQpOworICAgICAgTlNS ZWN0IGlyID0gTlNNYWtlUmVjdCAocy0+c2xpY2UueCwgcy0+c2xpY2UueSwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLndpZHRoLCBzLT5zbGljZS5oZWlnaHQpOworICAg ICAgW2ltZyBkcmF3SW5SZWN0OiBkcgorICAgICAgICAgICAgIGZyb21SZWN0OiBpcgorICAgICAg ICAgICAgIG9wZXJhdGlvbjogTlNDb21wb3NpdGVTb3VyY2VPdmVyCisgICAgICAgICAgICAgIGZy YWN0aW9uOiAxLjAKKyAgICAgICAgICAgcmVzcGVjdEZsaXBwZWQ6IFlFUworICAgICAgICAgICAg ICAgIGhpbnRzOiBuaWxdOworI2Vsc2UKKyAgICAgIFtpbWcgY29tcG9zaXRlVG9Qb2ludDogTlNN YWtlUG9pbnQgKHgsIHkgKyBzLT5zbGljZS5oZWlnaHQpCisgICAgICAgICAgICAgICAgICBvcGVy YXRpb246IE5TQ29tcG9zaXRlU291cmNlT3Zlcl07CisjZW5kaWYKKyAgICB9CisgIGlmIChzLT5o bCA9PSBEUkFXX0NVUlNPUikKKyAgICB7CisgICAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChzLT5m KSBzZXRdOworICAgICAgaWYgKHMtPnctPnBoeXNfY3Vyc29yX3R5cGUgPT0gTUNfRklMTEVEX0JP WCkKKyAgICAgICAgdGRDb2wgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNL R1JPVU5EIChmYWNlKSwgcy0+Zik7CisgICAgICAgIGVsc2UKKyAgICAgICAgICAvKiBDdXJyZW50 bHkgb24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1dHRvbl9yZWxpZWYgOiBERUZBVUxU X1RPT0xfQkFSX0JVVFRPTl9SRUxJRUY7CisgICAgICAgICAgcmFpc2VkX3AgPSAocy0+aGwgPT0g RFJBV19JTUFHRV9SQUlTRUQpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7 CisgICAgICAgICAgICB0aCA9IGFicyAocy0+aW1nLT5yZWxpZWYpOworICAgICAgICAgICAgcmFp c2VkX3AgPSAocy0+aW1nLT5yZWxpZWYgPiAwKTsKKyAgICAgICAgICB9CisgICAgICByLm9yaWdp bi54ID0geCAtIHRoOworICAgICAgci5vcmlnaW4ueSA9IHkgLSB0aDsKKyAgICAgIHIuc2l6ZS53 aWR0aCA9IHMtPnNsaWNlLndpZHRoICsgMip0aC0xOworICAgICAgci5zaXplLmhlaWdodCA9IHMt PnNsaWNlLmhlaWdodCArIDIqdGgtMTsKKyAgICAgIG5zX2RyYXdfcmVsaWVmIChyLCB0aCwgcmFp c2VkX3AsCisgICAgICAgICAgICAgICAgICAgICAgcy0+c2xpY2UueSA9PSAwLAorICAgICAgICAg ICAgICAgICAgICAgIHMtPnNsaWNlLnkgKyBzLT5zbGljZS5oZWlnaHQgPT0gcy0+aW1nLT5oZWln aHQsCisgICAgICAgICAgICAgICAgICAgICAgcy0+c2xpY2UueCA9PSAwLAorICAgICAgICAgICAg ICAgICAgICAgIHMtPnNsaWNlLnggKyBzLT5zbGljZS53aWR0aCA9PSBzLT5pbWctPndpZHRoLCBz KTsKKyAgICB9CisgIC8qIElmIHRoZXJlIGlzIG5vIG1hc2ssIHRoZSBiYWNrZ3JvdW5kIHdvbid0 IGJlIHNlZW4sCisgICAgIHNvIGRyYXcgYSByZWN0YW5nbGUgb24gdGhlIGltYWdlIGZvciB0aGUg Y3Vyc29yLgorICAgICBEbyB0aGlzIGZvciBhbGwgaW1hZ2VzLCBnZXR0aW5nIHRyYW5zcGFyZW5j eSByaWdodCBpcyBub3QgcmVsaWFibGUuICovCisgIGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUikK KyAgICB7CisgICAgICBpbnQgdGhpY2tuZXNzID0gYWJzIChzLT5pbWctPnJlbGllZik7CisgICAg ICBpZiAodGhpY2tuZXNzID09IDApIHRoaWNrbmVzcyA9IDE7CisgICAgaWYgKGdseXBoX2ZsYXZv ciA9PSBNQ19HTFlQSAorICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEhMRVNTKQor ICAgICAgeworICAgICAgICBOU0NvbG9yICpib3JkZXJfY29sb3IgPSBbTlNDb2xvciBjb2xvcldp dGhDYWxpYnJhdGVkUmVkOiBsc2wucmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JlZW46IGxzbC5ncmVlbgorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBibHVlOiBsc2wu Ymx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGFscGhhOiAxLjBdOworICAgICAgICBuc19kcmF3X2JveCAoYnIsIHRoaWNrbmVzcywg Ym9yZGVyX2NvbG9yLCAxLCAxKTsKKyAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgICAgbnNfZHJh d19ib3ggKGJyLCB0aGlja25lc3MsIEZSQU1FX0NVUlNPUl9DT0xPUiAocy0+ZiksIDEsIDEpOwor ICAgIH0KK30KKworc3RhdGljIHZvaWQKK21jX25zX21heWJlX2R1bXBnbHlwaHNfYmFja2dyb3Vu ZCAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgY2hhciBmb3JjZV9wKQoreworICBOU1RSQUNFICgi bWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIik7CisgIGlmICghcy0+YmFja2dyb3Vu ZF9maWxsZWRfcC8qIHx8IHMtPmhsID09IERSQVdfTU9VU0VfRkFDRSovKQorICAgIHsKKyAgICAg IGludCBib3hfbGluZV93aWR0aCA9IG1heCAocy0+ZmFjZS0+Ym94X2xpbmVfd2lkdGgsIDApOwor ICAgICAgaWYgKEZPTlRfSEVJR0hUIChzLT5mb250KSA8IHMtPmhlaWdodCAtIDIgKiBib3hfbGlu ZV93aWR0aAorICAgICAgICAgIC8qIFdoZW4geGRpc3AuYyBpZ25vcmVzIEZPTlRfSEVJR0hULCB3 ZSBjYW5ub3QgdHJ1c3QgZm9udAorICAgICAgICAgICAgIGRpbWVuc2lvbnMsIHNpbmNlIHRoZSBh Y3R1YWwgZ2x5cGhzIG1pZ2h0IGJlIG11Y2gKKyAgICAgICAgICAgICBzbWFsbGVyLiAgU28gaW4g dGhhdCBjYXNlIHdlIGFsd2F5cyBjbGVhciB0aGUgcmVjdGFuZ2xlCisgICAgICAgICAgICAgd2l0 aCBiYWNrZ3JvdW5kIGNvbG9yLiAqLworICAgICAgICAgIHx8IEZPTlRfVE9PX0hJR0ggKHMtPmZv bnQpCisgICAgICAgICAgfHwgcy0+Zm9udF9ub3RfZm91bmRfcCB8fCBzLT5leHRlbmRzX3RvX2Vu ZF9vZl9saW5lX3AgfHwgZm9yY2VfcCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBmYWNl ICpmYWNlOworICAgICAgICAgIGlmIChzLT5obCA9PSBEUkFXX01PVVNFX0ZBQ0UpCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIE1PVVNFX0hM X0lORk8gKHMtPmYpLT5tb3VzZV9mYWNlX2ZhY2VfaWQpOworICAgICAgICAgICAgICBpZiAoIWZh Y2UpCisgICAgICAgICAgICAgICAgZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgTU9VU0VfRkFD RV9JRCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGZh Y2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIHMtPmZpcnN0X2dseXBoLT5mYWNlX2lkKTsKKyAgICAg ICAgICBpZiAoIWZhY2UtPnN0aXBwbGUpCisgICAgICAgICAgICBbKE5TX0ZBQ0VfQkFDS0dST1VO RCAoZmFjZSkgIT0gMAorICAgICAgICAgICAgICA/IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChO U19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpLCBzLT5mKQorICAgICAgICAgICAgICA6IEZSQU1FX0JB Q0tHUk9VTkRfQ09MT1IgKHMtPmYpKSBzZXRdOworICAgICAgICAgICAgZWxzZQorICAgICAgICAg ICAgICB7CisgICAgICAgICAgICAgICAgc3RydWN0IG5zX2Rpc3BsYXlfaW5mbyAqZHB5aW5mbyA9 IEZSQU1FX0RJU1BMQVlfSU5GTyAocy0+Zik7CisgICAgICAgICAgICAgICAgW1tkcHlpbmZvLT5i aXRtYXBzW2ZhY2UtPnN0aXBwbGUtMV0uaW1nIHN0aXBwbGVNYXNrXSBzZXRdOworICAgICAgICAg ICAgICB9CisgICAgICAgICAgaWYgKHMtPmhsICE9IERSQVdfQ1VSU09SKQorICAgICAgICAgICAg eworICAgICAgICAgICAgICBzLT5yZWN0YW5nbGVfbnVrZWRfcCA9IHRydWU7CisgICAgICAgICAg ICAgIE5TUmVjdCByID0gTlNNYWtlUmVjdCAocy0+eCwgcy0+eSArIGJveF9saW5lX3dpZHRoLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+YmFja2dyb3VuZF93aWR0aCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPmhlaWdodC0yKmJveF9saW5l X3dpZHRoKTsKKyAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAgICB9Cisg ICAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IDE7CisgICAgICAgIH0KKyAgICB9Cit9 CisKK3N0YXRpYyB2b2lkCittY19uc19kcmF3X2dseXBoX3N0cmluZyA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ID0gcy0+bmV4dDsKKyAgICAgICAgICAgbmV4dCAmJiB3aWR0aCA8IHMt PnJpZ2h0X292ZXJoYW5nOworICAgICAgICAgICB3aWR0aCArPSBuZXh0LT53aWR0aCwgbmV4dCA9 IG5leHQtPm5leHQpCisgICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSAhPSBJTUFH RV9HTFlQSCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpZiAobmV4dC0+Zmlyc3RfZ2x5cGgt PnR5cGUgIT0gU1RSRVRDSF9HTFlQSCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg IG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocy0+bmV4dCwgcik7CisgICAgICAg ICAgICAgICAgaWYgKCFuc19jbGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4pKQorICAgICAgICAgICAg ICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIG1jX25zX21heWJlX2R1bXBnbHlwaHNfYmFj a2dyb3VuZCAocy0+bmV4dCwgMSk7CisgICAgICAgICAgICAgICAgbnNfcmVzZXRfY2xpcHBpbmcg KHMtPmYpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICBtY19uc19kdW1wZ2x5cGhzX3N0cmV0Y2ggKHMtPm5leHQsIG1hdHJpeCwgcm93LCB3ZCk7 CisgICAgICAgICAgICBuZXh0LT5udW1fY2xpcHMgPSAwOworICAgICAgICAgIH0KKyAgICB9Cisg IGlmICghcy0+Zm9yX292ZXJsYXBzICYmIHMtPmZhY2UtPmJveCAhPSBGQUNFX05PX0JPWAorICAg ICAgJiYgKHMtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgICAgICB8fCBz LT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpKQorICAgIHsKKyAgICAgIG4g PSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgcik7CisgICAgICBpZiAoIW5zX2Ns aXBfdG9fcmVjdCAocy0+ZiwgciwgbikpCisgICAgICAgIHJldHVybjsKKyAgICAgIG1jX25zX21h eWJlX2R1bXBnbHlwaHNfYmFja2dyb3VuZCAocywgMSk7CisgICAgICBuc19kdW1wZ2x5cGhzX2Jv eF9vcl9yZWxpZWYgKHMpOworICAgICAgbnNfcmVzZXRfY2xpcHBpbmcgKHMtPmYpOworICAgICAg Ym94X2RyYXduX3AgPSAxOworICAgIH0KKyAgc3dpdGNoIChzLT5maXJzdF9nbHlwaC0+dHlwZSkK KyAgICB7CisgICAgY2FzZSBJTUFHRV9HTFlQSDoKKyAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3Ry aW5nX2NsaXBfcmVjdCAocywgcik7CisgICAgICBpZiAoIW5zX2NsaXBfdG9fcmVjdCAocy0+Ziwg ciwgbikpCisgICAgICAgIHJldHVybjsKKyAgICAgIG1jX25zX2R1bXBnbHlwaHNfaW1hZ2UgKHMs IHJbMF0sIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgYWN0aXZlX3ApOworICAgICAg bnNfcmVzZXRfY2xpcHBpbmcgKHMtPmYpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBTVFJFVENI X0dMWVBIOgorICAgICAgbWNfbnNfZHVtcGdseXBoc19zdHJldGNoIChzLCBtYXRyaXgsIHJvdywg d2QpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBDSEFSX0dMWVBIOgorICAgIGNhc2UgQ09NUE9T SVRFX0dMWVBIOgorICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCBy KTsKKyAgICAgIGlmICghbnNfY2xpcF90b19yZWN0IChzLT5mLCByLCBuKSkKKyAgICAgICAgcmV0 dXJuOworICAgICAgaWYgKHMtPmZvcl9vdmVybGFwcworICAgICAgICAgIHx8IChzLT5jbXBfZnJv bSA+IDAKKyAgICAgICAgICAgICAgJiYgISBzLT5maXJzdF9nbHlwaC0+dS5jbXAuYXV0b21hdGlj KSkKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IDE7CisgICAgICAgIGVsc2UKKyAg ICAgICAgICBtY19uc19tYXliZV9kdW1wZ2x5cGhzX2JhY2tncm91bmQgKHMsIHMtPmZpcnN0X2ds eXBoLT50eXBlID09IENPTVBPU0lURV9HTFlQSCk7CisgICAgICBpbnQgZmxhZ3MgPSAocy0+aGwg PT0gRFJBV19DVVJTT1IpCisgICAgICAgICAgICAgICAgICAgID8gTlNfRFVNUEdMWVBIX0NVUlNP UgorICAgICAgICAgICAgICAgICAgOiAocy0+aGwgPT0gRFJBV19NT1VTRV9GQUNFKQorICAgICAg ICAgICAgICAgICAgICA/IE5TX0RVTVBHTFlQSF9NT1VTRUZBQ0UKKyAgICAgICAgICAgICAgICAg IDogKHMtPmZvcl9vdmVybGFwcykKKyAgICAgICAgICAgICAgICAgICAgPyBOU19EVU1QR0xZUEhf Rk9SRUdST1VORAorICAgICAgICAgICAgICAgICAgOiBOU19EVU1QR0xZUEhfTk9STUFMOworICAg ICAgdW5zaWduZWQgbG9uZyBzYXZlZF9mZyA9IE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSk7 CisgICAgICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IgJiYgY3Vyc29yX3R5cGUgPT0gTUNfRklM TEVEX0JPWCkKKyAgICAgICAgeworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgdG1wID0gTlNfRkFD RV9CQUNLR1JPVU5EIChzLT5mYWNlKTsKKyAgICAgICAgICBOU19GQUNFX0JBQ0tHUk9VTkQgKHMt PmZhY2UpID0gTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKTsKKyAgICAgICAgICBOU19GQUNF X0ZPUkVHUk9VTkQgKHMtPmZhY2UpID0gdG1wOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYg KHMtPmhsID09IERSQVdfQ1VSU09SCisgICAgICAgICAgICAgICAgICYmIGN1cnNvcl90eXBlID09 IE1DX0ZSQU1FRF9CT1gKKyAgICAgICAgICAgICAgICAgJiYgYWN0aXZlX3ApCisgICAgICAgICAg eworICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfZmFjZV9pZCA9CisgICAg ICAgICAgICAgIGxvb2t1cF9uYW1lZF9mYWNlIChzLT53LCBzLT5mLCBpbnRlcm4gKCIrLXJlYWwt ZmFrZS1jdXJzb3ItcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICBzdHJ1Y3QgZmFj ZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBob2xsb3dfYWN0aXZl X2ZhY2VfaWQpOworICAgICAgICAgICAgTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKSA9IE5T X0ZBQ0VfRk9SRUdST1VORCAoaG9sbG93X2FjdGl2ZV9mYWNlKTsKKyAgICAgICAgICB9CisgICAg ICAgICAgZWxzZSBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IKKyAgICAgICAgICAgICAgICAgICAm JiBjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YCisgICAgICAgICAgICAgICAgICAgJiYgYWN0 aXZlX3ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3df aW5hY3RpdmVfZmFjZV9pZCA9CisgICAgICAgICAgICAgICAgbG9va3VwX25hbWVkX2ZhY2UgKHMt PncsIHMtPmYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1wcmUtenYtZmFj ZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19pbmFjdGl2ZV9m YWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCk7CisgICAg ICAgICAgICAgIE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSkgPSBOU19GQUNFX0ZPUkVHUk9V TkQgKGhvbGxvd19pbmFjdGl2ZV9mYWNlKTsKKyAgICAgICAgICAgIH0KKyAgICAgIGlmIChzLT5m aXJzdF9nbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpCisgICAgICAgIG5zX2RyYXdfY29t cG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAgICAgICAgZWxzZQorICAgICAg ICAgIHsKKyAgICAgICAgICAgIGJvb2wgd2l0aF9iZ19wID0gKChmbGFncyA9PSBOU19EVU1QR0xZ UEhfTk9STUFMICYmICFzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgfHwgZmxhZ3MgPT0gTlNfRFVNUEdMWVBIX01PVVNFRkFDRSk7CisgICAgICAg ICAgICBpZiAod2l0aF9iZ19wKQorICAgICAgICAgICAgICBzLT5iYWNrZ3JvdW5kX251a2VkX3Ag PSB0cnVlOworICAgICAgICAgICAgZm9udC0+ZHJpdmVyLT5kcmF3IChzLCBzLT5jbXBfZnJvbSwg cy0+bmNoYXJzLCBzLT54LCBzLT55YmFzZSwgd2l0aF9iZ19wKTsKKyAgICAgICAgICB9CisgICAg ICBOU0NvbG9yICpjb2wgPSAoTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKSAhPSAwCisgICAg ICAgICAgICAgICAgICAgICA/IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVH Uk9VTkQgKHMtPmZhY2UpLCBzLT5mKQorICAgICAgICAgICAgICAgICAgICAgOiBGUkFNRV9GT1JF R1JPVU5EX0NPTE9SIChzLT5mKSk7CisgICAgICBbY29sIHNldF07CisgICAgICAvKiBEcmF3IHVu ZGVybGluZSwgb3ZlcmxpbmUsIHN0cm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Up ID0gc2F2ZWRfZmc7CisgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICBicmVh azsKKyAgICBjYXNlIEdMWVBITEVTU19HTFlQSDoKKyAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3Ry aW5nX2NsaXBfcmVjdCAocywgcik7CisgICAgICBpZiAoIW5zX2NsaXBfdG9fcmVjdCAocy0+Ziwg ciwgbikpCisgICAgICAgIHJldHVybjsKKyAgICAgIGlmIChzLT5mb3Jfb3ZlcmxhcHMKKyAgICAg ICAgICB8fCAocy0+Y21wX2Zyb20gPiAwCisgICAgICAgICAgICAgICYmICEgcy0+Zmlyc3RfZ2x5 cGgtPnUuY21wLmF1dG9tYXRpYykpCisgICAgICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSAx OworICAgICAgZWxzZQorICAgICAgICBtY19uc19tYXliZV9kdW1wZ2x5cGhzX2JhY2tncm91bmQg KHMsIHMtPmZpcnN0X2dseXBoLT50eXBlID09IENPTVBPU0lURV9HTFlQSCk7CisgICAgICBuc19y ZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAg ZW1hY3NfYWJvcnQgKCk7CisgICAgfQorICAvKiBEcmF3IGJveCBpZiBub3QgZG9uZSBhbHJlYWR5 LiAqLworICBpZiAoIXMtPmZvcl9vdmVybGFwcworICAgICAgJiYgIWJveF9kcmF3bl9wCisgICAg ICAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gpCisgICAgeworICAgICAgbiA9IG5zX2dl dF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAgICAgIGlmICghbnNfY2xpcF90b19y ZWN0IChzLT5mLCByLCBuKSkKKyAgICAgICAgcmV0dXJuOworICAgICAgbnNfZHVtcGdseXBoc19i b3hfb3JfcmVsaWVmIChzKTsKKyAgICAgIG5zX3Jlc2V0X2NsaXBwaW5nIChzLT5mKTsKKyAgICB9 CisgIHMtPm51bV9jbGlwcyA9IDA7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiA9PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQogCiAgICBO U1RSQUNFLCBUcmFjZSBzdXBwb3J0LgpAQCAtMTA3OSw2ICsyMDQ4LDE2IEBAIHN0YXRpYyBOU1Jl Y3QgY29uc3RyYWluX2ZyYW1lX3JlY3QoTlNSZWN0IGZyYW1lUmVjdCwgYm9vbCBpc0Z1bGxzY3Jl ZW4pCiAgICBleHRlcm5hbCAoUklGKSBjYWxsOyB3aG9sZSBmcmFtZSwgY2FsbGVkIGJlZm9yZSBn dWlfdXBkYXRlX3dpbmRvd19iZWdpbgogICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KIHsKKworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5t Y191cGRhdGluZ19mcmFtZSA9IGY7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICNp ZmRlZiBOU19JTVBMX0NPQ09BCiAgIEVtYWNzVmlldyAqdmlldyA9IEZSQU1FX05TX1ZJRVcgKGYp OwogCkBAIC0xMTA5LDYgKzIwODgsMTYgQEAgc3RhdGljIE5TUmVjdCBjb25zdHJhaW5fZnJhbWVf cmVjdChOU1JlY3QgZnJhbWVSZWN0LCBib29sIGlzRnVsbHNjcmVlbikKIAogLyogICBpZiAoZiA9 PSBNT1VTRV9ITF9JTkZPIChmKS0+bW91c2VfZmFjZV9tb3VzZV9mcmFtZSkgKi8KICAgTU9VU0Vf SExfSU5GTyAoZiktPm1vdXNlX2ZhY2VfZGVmZXIgPSAwOworCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1l ID0gTlVMTDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAKQEAgLTQ3NTks NiArNTc0OCwxNyBAQCBpbiBjZXJ0YWluIHNpdHVhdGlvbnMgKHJhcGlkIGluY29taW5nIGV2ZW50 cykuCiAgICAgICBiYXIgPSBbW0VtYWNzU2Nyb2xsZXIgYWxsb2NdIGluaXRGcmFtZTogciB3aW5k b3c6IHdpbl07CiAgICAgICB3c2V0X3ZlcnRpY2FsX3Njcm9sbF9iYXIgKHdpbmRvdywgbWFrZV9t aW50X3B0ciAoYmFyKSk7CiAgICAgICB1cGRhdGVfcCA9IFlFUzsKKworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgLyogVGhpcyBpcyBv bmx5IGZvciBkZWJ1Z2dpbmcgcHVycG9zZXMuICovCisgICAgICBbYmFyIG1jX3NldF9yZWN0YW5n bGU6IHJdOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgfQogICBlbHNlCiAg ICAgewpAQCAtNDc2NiwxMiArNTc2NiwzMCBAQCBpbiBjZXJ0YWluIHNpdHVhdGlvbnMgKHJhcGlk IGluY29taW5nIGV2ZW50cykuCiAgICAgICBiYXIgPSBYTlNfU0NST0xMX0JBUiAod2luZG93LT52 ZXJ0aWNhbF9zY3JvbGxfYmFyKTsKICAgICAgIG9sZFJlY3QgPSBbYmFyIGZyYW1lXTsKICAgICAg IHIuc2l6ZS53aWR0aCA9IG9sZFJlY3Quc2l6ZS53aWR0aDsKKworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogICAgICAgaWYgKEZSQU1FX0xJVkVf UCAoZikgJiYgIU5TRXF1YWxSZWN0cyAob2xkUmVjdCwgcikpCiAgICAgICAgIHsKKyAgICAgICAg ICAvKiBUaGUgbWFpbiB3aW5kb3cgaGFzIHByb2JhYmx5IGJlZW4gcmVzaXplZC4gIEdyYWNpb3Vz bHkgZGVsZXRlIHRoZQorICAgICAgICAgIG9sZCBzY3JvbGwgYmFyIHdpdGhvdXQgcmVwYWludGlu ZyBpdHMgcmVjdGFuZ2xlOyBhbmQsIGNyZWF0ZSBhIG5ldworICAgICAgICAgIHNjcm9sbCBiYXIg ZWxzZXdoZXJlLiovCiAgICAgICAgICAgaWYgKG9sZFJlY3Qub3JpZ2luLnggIT0gci5vcmlnaW4u eCkKKyAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgbnNfY2xlYXJfZnJhbWVfYXJlYSAoZiwg bGVmdCwgdG9wLCB3aWR0aCwgaGVpZ2h0KTsKKyAgICAgICAgICAgICAgW2JhciBtY19qdWRnZV07 CisgICAgICAgICAgICAgIGJhciA9IFtbRW1hY3NTY3JvbGxlciBhbGxvY10gaW5pdEZyYW1lOiBy IHdpbmRvdzogd2luXTsKKyAgICAgICAgICAgICAgd3NldF92ZXJ0aWNhbF9zY3JvbGxfYmFyICh3 aW5kb3csIG1ha2VfbWludF9wdHIgKGJhcikpOworICAgICAgICAgICAgfQorICAgICAgICAgICAg ZWxzZQogICAgICAgICAgIFtiYXIgc2V0RnJhbWU6IHJdOwogICAgICAgICB9CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgICB9CiAKICAgaWYgKHVwZGF0ZV9wKQpAQCAtNDkzMSw5 ICs1OTQ5LDU3IEBAIGluIGNlcnRhaW4gc2l0dWF0aW9ucyAocmFwaWQgaW5jb21pbmcgZXZlbnRz KS4KICAgICB7CiAgICAgICB2aWV3ID0gW3N1YnZpZXdzIG9iamVjdEF0SW5kZXg6IGldOwogICAg ICAgaWYgKCFbdmlldyBpc0tpbmRPZkNsYXNzOiBbRW1hY3NTY3JvbGxlciBjbGFzc11dKSBjb250 aW51ZTsKLSAgICAgIGlmIChbdmlldyBqdWRnZV0pCisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogYFhTRVRXSU5ET1cnIHdpbGwgc29t ZXRpbWVzIGNhdXNlIEVtYWNzIHRvIGNyYXNoIHdoZW4gcnVubmluZyB1bmRlciBnZGIgZXZlbgor ICB0aG91Z2ggKHcgIT0gTlVMTCkuICBUaGVyZWZvcmUsIHdlIGNhbm5vdCByZWxpYWJseSB1c2Ug YFdJTkRPV19MSVZFX1AnLiAqLworICBzdHJ1Y3Qgd2luZG93ICp3ID0gW3ZpZXcgbWNfZ2V0X3dp bmRvd107CisgIGlmICh3ICE9IE5VTEwKKyAgICAgICYmIE5JTFAgKHctPmNvbnRlbnRzKSkKKyAg ICB7CisgICAgICBCT09MIGRlYnVnX3AgPSBmYWxzZTsKKyAgICAgIGlmIChkZWJ1Z19wCisgICAg ICAgICAgLyogYHdpbmRvd19ib3gnIGNhbGxzIGB3aW5kb3dfYm94X2hlaWdodCcsIHdoaWNoIHdp bGwgY2F1c2UgRW1hY3MgdG8KKyAgICAgICAgICBjcmFzaCBpZiBGUkFNRVAgKHctPmZyYW1lKSBp cyBub3Qgc2F0aXNmaWVkLiAqLworICAgICAgICAgICYmIEZSQU1FUCAody0+ZnJhbWUpKQorICAg ICAgICB7CisgICAgICAgICAgTlNSZWN0IHIwID0gW3ZpZXcgbWNfZ2V0X3JlY3RhbmdsZV07Cisg ICAgICAgICAgaW50IHgwID0gTlNNaW5YIChyMCk7CisgICAgICAgICAgaW50IHkwID0gTlNNaW5Z IChyMCk7CisgICAgICAgICAgaW50IHdkMCA9IE5TV2lkdGggKHIwKTsKKyAgICAgICAgICBpbnQg aDAgPSBOU0hlaWdodCAocjApOworICAgICAgICAgIGludCB3aW5kb3dfeSwgd2luZG93X2hlaWdo dDsKKyAgICAgICAgICB3aW5kb3dfYm94ICh3LCBBTllfQVJFQSwgMCwgJndpbmRvd195LCAwLCAm d2luZG93X2hlaWdodCk7CisgICAgICAgICAgaW50IHRvcCA9IHdpbmRvd195OworICAgICAgICAg IGludCBoZWlnaHQgPSB3aW5kb3dfaGVpZ2h0OworICAgICAgICAgIGludCB3aWR0aCA9IFdJTkRP V19DT05GSUdfU0NST0xMX0JBUl9DT0xTICh3KSAqIEZSQU1FX0NPTFVNTl9XSURUSCAoZik7Cisg ICAgICAgICAgaW50IGxlZnQgPSBXSU5ET1dfU0NST0xMX0JBUl9BUkVBX1ggKHcpOworICAgICAg ICAgIE5TUmVjdCByMSA9IE5TTWFrZVJlY3QgKGxlZnQsIHRvcCwgd2lkdGgsIGhlaWdodCk7Cisg ICAgICAgICAgLyogVGhlIHBhcmVudCB2aWV3IGlzIGZsaXBwZWQsIHNvIHdlIG5lZWQgdG8gZmxp cCB5IHZhbHVlLiAqLworICAgICAgICAgIEVtYWNzVmlldyAqZnJhbWVfdmlldyA9IEZSQU1FX05T X1ZJRVcgKGYpOworICAgICAgICAgIE5TUmVjdCB2ID0gW2ZyYW1lX3ZpZXcgZnJhbWVdOworICAg ICAgICAgIHIxLm9yaWdpbi55ID0gKHYuc2l6ZS5oZWlnaHQgLSByMS5zaXplLmhlaWdodCAtIHIx Lm9yaWdpbi55KTsKKyAgICAgICAgICBpbnQgeDEgPSBOU01pblggKHIxKTsKKyAgICAgICAgICBp bnQgeTEgPSBOU01pblkgKHIxKTsKKyAgICAgICAgICBpbnQgd2QxID0gTlNXaWR0aCAocjEpOwor ICAgICAgICAgIGludCBoMSA9IE5TSGVpZ2h0IChyMSk7CisgICAgICAgICAgZnByaW50ZiAoc3Rk ZXJyLCAiJXMgLS0gREVBRDpcblwKKyAgICAgICAgICB4MC94MSAoJWQvJWQpIHwgeTAveTEgKCVk LyVkKSB8IHdkMC93ZDEgKCVkLyVkKSB8IGgwL2gxICglZC8lZClcbiIsCisgICAgICAgICAgbWNf d2luZG93ICh3KSwgeDAsIHgxLCB5MCwgeTEsIHdkMCwgd2QxLCBoMCwgaDEpOworICAgICAgICB9 CisgICAgICBpZiAoW3ZpZXcgbWNfanVkZ2VdKQogICAgICAgICByZW1vdmVkID0gWUVTOwogICAg IH0KKyAgICBlbHNlIGlmIChbdmlldyBqdWRnZV0pCisgICAgICByZW1vdmVkID0gWUVTOworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCisgICAgfQogCiAgIGlmIChyZW1vdmVkKQogICAg IFtldmlldyB1cGRhdGVGcmFtZVNpemU6IE5PXTsKQEAgLTUwNzQsNiArNjE0MCwyMCBAQCBzdGF0 aWMgTGlzcF9PYmplY3QgbnNfc3RyaW5nX3RvX2xpc3Btb2QgKGNvbnN0IGNoYXIgKnMpCiBleHRl cm4gZnJhbWVfcGFybV9oYW5kbGVyIG5zX2ZyYW1lX3Bhcm1faGFuZGxlcnNbXTsKIHN0YXRpYyBz dHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFjZSBuc19yZWRpc3BsYXlfaW50ZXJmYWNlID0KIHsKKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyog YHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGBuc3Rlcm0ubWAgbXVzdCBiZSBpbiB0aGUgZXhhY3Qg c2FtZSBvcmRlciBhcyB0aGUKK2ByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgZGlzcGV4dGVybi5o YCEgKi8KKworICBtY19uc19kcmF3X3dpbmRvd19jdXJzb3IsCisgIG1jX25zX2RyYXdfZ2x5cGhf c3RyaW5nLAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIG5zX2ZyYW1lX3Bhcm1f aGFuZGxlcnMsCiAgIGd1aV9wcm9kdWNlX2dseXBocywKICAgZ3VpX3dyaXRlX2dseXBocywKQEAg LTg3MTEsNiArOTc5MSw0OSBAQCAtIChCT09MKWNhbkJlY29tZU1haW5XaW5kb3cKIAogQGltcGxl bWVudGF0aW9uIEVtYWNzU2Nyb2xsZXIKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFLUNVUlNPUlMgKi8KKworLSAodm9pZCltY19zZXRfcmVjdGFuZ2xlOiAoTlNSZWN0 KXJlY3QKK3sKKyAgbWNfcmVjdGFuZ2xlID0gcmVjdDsKK30KKworLSAoTlNSZWN0KW1jX2dldF9y ZWN0YW5nbGUKK3sKKyAgcmV0dXJuIG1jX3JlY3RhbmdsZTsKK30KKworLSAoc3RydWN0IHdpbmRv dyAqKW1jX2dldF93aW5kb3cKK3sKKyAgcmV0dXJuIHdpbmRvdzsKK30KKworLSAoYm9vbCltY19q dWRnZQoreworICBOU1RSQUNFICgiW0VtYWNzU2Nyb2xsZXIgbWNfanVkZ2VdIik7CisgIGJvb2wg cmV0ID0gY29uZGVtbmVkOworICBibG9ja19pbnB1dCAoKTsKKyAgaWYgKGNvbmRlbW5lZCkKKyAg ICB7CisgICAgICAvKiBlbnN1cmUgb3RoZXIgc2Nyb2xsYmFyIHVwZGF0ZXMgYWZ0ZXIgZGVsZXRp b24gKi8KKyAgICAgIEVtYWNzVmlldyAqdmlldyA9IChFbWFjc1ZpZXcgKilGUkFNRV9OU19WSUVX IChmcmFtZSk7CisgICAgICBpZiAodmlldyAhPSBuaWwpCisgICAgICAgIHZpZXctPnNjcm9sbGJh cnNOZWVkaW5nVXBkYXRlKys7CisgICAgfQorICBpZiAod2luZG93KQorICAgIHdzZXRfdmVydGlj YWxfc2Nyb2xsX2JhciAod2luZG93LCBRbmlsKTsKKyAgd2luZG93ID0gMDsKKyAgW3NlbGYgcmVt b3ZlRnJvbVN1cGVydmlld1dpdGhvdXROZWVkaW5nRGlzcGxheV07CisgIFtzZWxmIHJlbGVhc2Vd OworICB1bmJsb2NrX2lucHV0ICgpOworICByZXR1cm4gcmV0OworfQorCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKworCiAvKiBmb3IgcmVwZWF0IGJ1dHRvbiBwdXNoICovCiAjZGVmaW5lIFND Uk9MTF9CQVJfRklSU1RfREVMQVkgMC41CiAjZGVmaW5lIFNDUk9MTF9CQVJfQ09OVElOVU9VU19E RUxBWSAoMS4wIC8gMTUpCmRpZmYgLS1naXQgYS9zcmMvdzMydGVybS5jIGIvc3JjL3czMnRlcm0u YwppbmRleCBjNmUxNzVlLi5jZDk2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cF9sb29rdXAgKGNvbnN0IGNoYXIgKmNvbG9ybmFtZSkKK3sK KyAgTGlzcF9PYmplY3QgdGFpbCwgcmV0ID0gUW5pbDsKKyAgYmxvY2tfaW5wdXQgKCk7CisgIGZv ciAodGFpbCA9IFZ3MzJfY29sb3JfbWFwOyBDT05TUCAodGFpbCk7IHRhaWwgPSBYQ0RSICh0YWls KSkKKyAgICB7CisgICAgICByZWdpc3RlciBMaXNwX09iamVjdCBlbHQsIHRlbTsKKyAgICAgIGVs dCA9IFhDQVIgKHRhaWwpOworICAgICAgaWYgKCFDT05TUCAoZWx0KSkgY29udGludWU7CisgICAg ICB0ZW0gPSBYQ0FSIChlbHQpOworICAgICAgaWYgKGxzdHJjbXBpIChTU0RBVEEgKHRlbSksIGNv bG9ybmFtZSkgPT0gMCkKKyAgICAgICAgeworICAgICAgICAgIHJldCA9IEZjZHIgKGVsdCk7Cisg ICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIE1DX1FVSVQ7CisgICAgfQorICB1bmJs b2NrX2lucHV0ICgpOworICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgTGlzcF9PYmplY3QKK21j X3hfdG9fdzMyX2NvbG9yIChjb25zdCBjaGFyICogY29sb3JuYW1lKQoreworICByZWdpc3RlciBM aXNwX09iamVjdCByZXQgPSBRbmlsOworICBibG9ja19pbnB1dCAoKTsKKyAgaWYgKGNvbG9ybmFt ZVswXSA9PSAnIycpCisgICAgeworICAgICAgLyogQ291bGQgYmUgYW4gb2xkLXN0eWxlIFJHQiBE ZXZpY2Ugc3BlY2lmaWNhdGlvbi4gKi8KKyAgICAgIGludCBzaXplID0gc3RybGVuIChjb2xvcm5h bWUgKyAxKTsKKyAgICAgIGNoYXIgKmNvbG9yID0gYWxsb2NhIChzaXplICsgMSk7CisgICAgICBz dHJjcHkgKGNvbG9yLCBjb2xvcm5hbWUgKyAxKTsKKyAgICAgIGlmIChzaXplID09IDMgfHwgc2l6 ZSA9PSA2IHx8IHNpemUgPT0gOSB8fCBzaXplID09IDEyKQorICAgICAgICB7CisgICAgICAgICAg VUlOVCBjb2xvcnZhbDsKKyAgICAgICAgICBpbnQgaSwgcG9zOworICAgICAgICAgIHBvcyA9IDA7 CisgICAgICAgICAgc2l6ZSAvPSAzOworICAgICAgICAgIGNvbG9ydmFsID0gMDsKKyAgICAgICAg ICBmb3IgKGkgPSAwOyBpIDwgMzsgaSsrKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBj aGFyICplbmQ7CisgICAgICAgICAgICAgIGNoYXIgdDsKKyAgICAgICAgICAgICAgdW5zaWduZWQg bG9uZyB2YWx1ZTsKKyAgICAgICAgICAgICAgLyogVGhlIGNoZWNrIGZvciAneCcgaW4gdGhlIGZv bGxvd2luZyBjb25kaXRpb25hbCB0YWtlcyBpbnRvCisgICAgICAgICAgICAgIGFjY291bnQgdGhl IGZhY3QgdGhhdCBzdHJ0b2wgYWxsb3dzIGEgIjB4IiBpbiBmcm9udCBvZgorICAgICAgICAgICAg ICBvdXIgbnVtYmVycywgYW5kIHdlIGRvbid0LiAqLworICAgICAgICAgICAgICBpZiAoIWlzeGRp Z2l0IChjb2xvclswXSkgfHwgY29sb3JbMV0gPT0gJ3gnKQorICAgICAgICAgICAgICAgIGJyZWFr OworICAgICAgICAgICAgICB0ID0gY29sb3Jbc2l6ZV07CisgICAgICAgICAgICAgIGNvbG9yW3Np emVdID0gJ1wwJzsKKyAgICAgICAgICAgICAgdmFsdWUgPSBzdHJ0b3VsIChjb2xvciwgJmVuZCwg MTYpOworICAgICAgICAgICAgICBjb2xvcltzaXplXSA9IHQ7CisgICAgICAgICAgICAgIGlmIChl cnJubyA9PSBFUkFOR0UgfHwgZW5kIC0gY29sb3IgIT0gc2l6ZSkKKyAgICAgICAgICAgICAgICBi cmVhazsKKyAgICAgICAgICAgICAgc3dpdGNoIChzaXplKQorICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICBjYXNlIDE6CisgICAgICAgICAgICAgICAgICB2YWx1ZSA9IHZhbHVlICog MHgxMDsKKyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgMjoK KyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgMzoKKyAgICAg ICAgICAgICAgICAgIHZhbHVlIC89IDB4MTA7CisgICAgICAgICAgICAgICAgICBicmVhazsKKyAg ICAgICAgICAgICAgICBjYXNlIDQ6CisgICAgICAgICAgICAgICAgICB2YWx1ZSAvPSAweDEwMDsK KyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAg ICAgY29sb3J2YWwgfD0gKHZhbHVlIDw8IHBvcyk7CisgICAgICAgICAgICAgIHBvcyArPSAweDg7 CisgICAgICAgICAgICAgIGlmIChpID09IDIpCisgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgICAgIFhTRVRJTlQgKHJl dCwgY29sb3J2YWwpOworICAgICAgICAgICAgICAgICAgcmV0dXJuIHJldDsKKyAgICAgICAgICAg ICAgICB9CisgICAgICAgICAgICAgIGNvbG9yID0gZW5kOworICAgICAgICAgICAgfQorICAgICAg ICB9CisgICAgfQorICBlbHNlIGlmIChzdHJuaWNtcCAoY29sb3JuYW1lLCAicmdiOiIsIDQpID09 IDApCisgICAgeworICAgICAgY29uc3QgY2hhciAqY29sb3I7CisgICAgICBVSU5UIGNvbG9ydmFs OworICAgICAgaW50IGksIHBvczsKKyAgICAgIHBvcyA9IDA7CisgICAgICBjb2xvcnZhbCA9IDA7 CisgICAgICBjb2xvciA9IGNvbG9ybmFtZSArIDQ7CisgICAgICBmb3IgKGkgPSAwOyBpIDwgMzsg aSsrKQorICAgICAgICB7CisgICAgICAgICAgY2hhciAqZW5kOworICAgICAgICAgIHVuc2lnbmVk IGxvbmcgdmFsdWU7CisgICAgICAgICAgLyogVGhlIGNoZWNrIGZvciAneCcgaW4gdGhlIGZvbGxv d2luZyBjb25kaXRpb25hbCB0YWtlcyBpbnRvCisgICAgICAgICAgICAgYWNjb3VudCB0aGUgZmFj dCB0aGF0IHN0cnRvbCBhbGxvd3MgYSAiMHgiIGluIGZyb250IG9mCisgICAgICAgICAgICAgb3Vy IG51bWJlcnMsIGFuZCB3ZSBkb24ndC4gKi8KKyAgICAgICAgICBpZiAoIWlzeGRpZ2l0IChjb2xv clswXSkgfHwgY29sb3JbMV0gPT0gJ3gnKQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAg dmFsdWUgPSBzdHJ0b3VsIChjb2xvciwgJmVuZCwgMTYpOworICAgICAgICAgIGlmIChlcnJubyA9 PSBFUkFOR0UpCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBzd2l0Y2ggKGVuZCAtIGNv bG9yKQorICAgICAgICAgICAgeworICAgICAgICAgICAgY2FzZSAxOgorICAgICAgICAgICAgICB2 YWx1ZSA9IHZhbHVlICogMHgxMCArIHZhbHVlOworICAgICAgICAgICAgICBicmVhazsKKyAgICAg ICAgICAgIGNhc2UgMjoKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDM6 CisgICAgICAgICAgICAgIHZhbHVlIC89IDB4MTA7CisgICAgICAgICAgICAgIGJyZWFrOworICAg ICAgICAgICAgY2FzZSA0OgorICAgICAgICAgICAgICB2YWx1ZSAvPSAweDEwMDsKKyAgICAgICAg ICAgICAgYnJlYWs7CisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICB2YWx1ZSA9 IFVMT05HX01BWDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBpZiAodmFsdWUgPT0gVUxPTkdf TUFYKQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgY29sb3J2YWwgfD0gKHZhbHVlIDw8 IHBvcyk7CisgICAgICAgICAgcG9zICs9IDB4ODsKKyAgICAgICAgICBpZiAoaSA9PSAyKQorICAg ICAgICAgICAgeworICAgICAgICAgICAgICBpZiAoKmVuZCAhPSAnXDAnKQorICAgICAgICAgICAg ICAgIGJyZWFrOworICAgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgICAgICAg ICBYU0VUSU5UIChyZXQsIGNvbG9ydmFsKTsKKyAgICAgICAgICAgICAgcmV0dXJuIHJldDsKKyAg ICAgICAgICAgIH0KKyAgICAgICAgICBpZiAoKmVuZCAhPSAnLycpCisgICAgICAgICAgICBicmVh azsKKyAgICAgICAgICBjb2xvciA9IGVuZCArIDE7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxz ZSBpZiAoc3RybmljbXAgKGNvbG9ybmFtZSwgInJnYmk6IiwgNSkgPT0gMCkKKyAgICAgIHsKKyAg ICAgICAgLyogVGhpcyBpcyBhbiBSR0IgSW50ZW5zaXR5IHNwZWNpZmljYXRpb24uICovCisgICAg ICAgIGNvbnN0IGNoYXIgKmNvbG9yOworICAgICAgICBVSU5UIGNvbG9ydmFsOworICAgICAgICBp bnQgaSwgcG9zOworICAgICAgICBwb3MgPSAwOworICAgICAgICBjb2xvcnZhbCA9IDA7CisgICAg ICAgIGNvbG9yID0gY29sb3JuYW1lICsgNTsKKyAgICAgICAgZm9yIChpID0gMDsgaSA8IDM7IGkr KykKKyAgICAgICAgICB7CisgICAgICAgICAgICBjaGFyICplbmQ7CisgICAgICAgICAgICBkb3Vi bGUgdmFsdWU7CisgICAgICAgICAgICBVSU5UIHZhbDsKKyAgICAgICAgICAgIHZhbHVlID0gc3Ry dG9kIChjb2xvciwgJmVuZCk7CisgICAgICAgICAgICBpZiAoZXJybm8gPT0gRVJBTkdFKQorICAg ICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGlmICh2YWx1ZSA8IDAuMCB8fCB2YWx1ZSA+ IDEuMCkKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB2YWwgPSAoVUlOVCkoMHgx MDAgKiB2YWx1ZSk7CisgICAgICAgICAgICAvKiBXZSB1c2VkIDB4MTAwIGluc3RlYWQgb2YgMHhG RiB0byBnaXZlIGEgY29udGludW91cworICAgICAgICAgICAgICAgcmFuZ2UgYmV0d2VlbiAwLjAg YW5kIDEuMCBpbmNsdXNpdmUuICBUaGUgbmV4dCBzdGF0ZW1lbnQKKyAgICAgICAgICAgICAgIGZp eGVzIHRoZSAxLjAgY2FzZS4gKi8KKyAgICAgICAgICAgIGlmICh2YWwgPT0gMHgxMDApCisgICAg ICAgICAgICAgIHZhbCA9IDB4RkY7CisgICAgICAgICAgICBjb2xvcnZhbCB8PSAodmFsIDw8IHBv cyk7CisgICAgICAgICAgICBwb3MgKz0gMHg4OworICAgICAgICAgICAgaWYgKGkgPT0gMikKKyAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmICgqZW5kICE9ICdcMCcpCisgICAgICAg ICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAg ICAgICAgICAgICAgIFhTRVRJTlQgKHJldCwgY29sb3J2YWwpOworICAgICAgICAgICAgICAgIHJl dHVybiByZXQ7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICgqZW5kICE9ICcvJykK KyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjb2xvciA9IGVuZCArIDE7CisgICAg ICAgICAgfQorICAgICAgfQorICAvKiBJIGFtIG5vdCBnb2luZyB0byBhdHRlbXB0IHRvIGhhbmRs ZSBhbnkgb2YgdGhlIENJRSBjb2xvciBzY2hlbWVzCisgICAgIG9yIFRla0hWQywgc2luY2UgSSBk b24ndCBrbm93IHRoZSBhbGdvcml0aG1zIGZvciBjb252ZXJzaW9uIHRvIFJHQi4KKyAgICAgSWYg d2UgZmFpbCB0byBsb29rdXAgdGhlIGNvbG9yIG5hbWUgaW4gdzMyX2NvbG9yX21hcCwgdGhlbiBj aGVjayB0aGUKKyAgICAgY29sb3JuYW1lIHRvIHNlZSBpZiBpdCBjYW4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cm1hcCBjZWxsLiAqLworaW50CittY193MzJfZGVmaW5lZF9jb2xvciAo c3RydWN0IGZyYW1lICpmLCBjb25zdCBjaGFyICpjb2xvciwgbWNfWENvbG9yICpjb2xvcl9kZWYs IGJvb2wgYWxsb2NfcCkKK3sKKyAgcmVnaXN0ZXIgTGlzcF9PYmplY3QgdGVtOworICBDT0xPUlJF RiB3MzJfY29sb3JfcmVmOworICB0ZW0gPSBtY194X3RvX3czMl9jb2xvciAoY29sb3IpOworICBp ZiAoIU5JTFAgKHRlbSkpCisgICAgeworICAgICAgaWYgKGYpCisgICAgICAgIHsKKyAgICAgICAg ICAvKiBBcHBseSBnYW1tYSBjb3JyZWN0aW9uLiAqLworICAgICAgICAgIHczMl9jb2xvcl9yZWYg PSBYVUZJWE5VTV9SQVcgKHRlbSk7CisgICAgICAgICAgZ2FtbWFfY29ycmVjdCAoZiwgJnczMl9j b2xvcl9yZWYpOworICAgICAgICAgIFhTRVRJTlQgKHRlbSwgdzMyX2NvbG9yX3JlZik7CisgICAg ICAgIH0KKyAgICAgIC8qIE1hcCB0aGlzIGNvbG9yIHRvIHRoZSBwYWxldHRlIGlmIGl0IGlzIGVu YWJsZWQuICovCisgICAgICBpZiAoIU5JTFAgKFZ3MzJfZW5hYmxlX3BhbGV0dGUpKQorICAgICAg ICB7CisgICAgICAgICAgc3RydWN0IHczMl9wYWxldHRlX2VudHJ5ICogZW50cnkgPSBvbmVfdzMy X2Rpc3BsYXlfaW5mby5jb2xvcl9saXN0OworICAgICAgICAgIHN0cnVjdCB3MzJfcGFsZXR0ZV9l bnRyeSAqKiBwcmV2ID0gJm9uZV93MzJfZGlzcGxheV9pbmZvLmNvbG9yX2xpc3Q7CisgICAgICAg ICAgLyogY2hlY2sgaWYgY29sb3IgaXMgYWxyZWFkeSBtYXBwZWQgKi8KKyAgICAgICAgICB3aGls ZSAoZW50cnkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmIChNQ19XMzJfQ09MT1Ig KGVudHJ5LT5lbnRyeSkgPT0gWFVGSVhOVU1fUkFXICh0ZW0pKQorICAgICAgICAgICAgICAgIGJy ZWFrOworICAgICAgICAgICAgICBwcmV2ID0gJmVudHJ5LT5uZXh0OworICAgICAgICAgICAgICBl bnRyeSA9IGVudHJ5LT5uZXh0OworICAgICAgICAgICAgfQorICAgICAgICAgIGlmIChlbnRyeSA9 PSBOVUxMICYmIGFsbG9jX3ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIC8qIG5vdCBh bHJlYWR5IG1hcHBlZCwgc28gYWRkIHRvIGxpc3QgKi8KKyAgICAgICAgICAgICAgZW50cnkgPSB4 bWFsbG9jIChzaXplb2YgKHN0cnVjdCB3MzJfcGFsZXR0ZV9lbnRyeSkpOworICAgICAgICAgICAg ICBNQ19XMzJfU0VUX0NPTE9SIChlbnRyeS0+ZW50cnksIFhVRklYTlVNX1JBVyAodGVtKSk7Cisg ICAgICAgICAgICAgIGVudHJ5LT5uZXh0ID0gTlVMTDsKKyAgICAgICAgICAgICAgKnByZXYgPSBl bnRyeTsKKyAgICAgICAgICAgICAgb25lX3czMl9kaXNwbGF5X2luZm8ubnVtX2NvbG9ycysrOwor ICAgICAgICAgICAgICAvKiBzZXQgZmxhZyB0aGF0IHBhbGV0dGUgbXVzdCBiZSByZWdlbmVyYXRl ZCAqLworICAgICAgICAgICAgICBvbmVfdzMyX2Rpc3BsYXlfaW5mby5yZWdlbl9wYWxldHRlID0g VFJVRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgLyogRW5zdXJlIENPTE9SUkVG IHZhbHVlIGlzIHNuYXBwZWQgdG8gbmVhcmVzdCBjb2xvciBpbiAoZGVmYXVsdCkKKyAgICAgICAg IHBhbGV0dGUgYnkgc2ltdWxhdGluZyB0aGUgUEFMRVRURVJHQiBtYWNyby4gIFRoaXMgd29ya3Mg d2hldGhlcgorICAgICAgICAgb3Igbm90IHRoZSBkaXNwbGF5IGRldmljZSBoYXMgYSBwYWxldHRl L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hbHVlICh0ZW1wLnBpeGVsKSA8PCA4KSB8IEdldEJWYWx1ZSAodGVtcC5w aXhlbCkpIC8gNjU1MzUuMDsKKyAgICB9CisgICAgZWxzZQorICAgICAgeworICAgICAgICBsc2wt PnJlZCA9IC0xLjA7CisgICAgICAgIGxzbC0+Z3JlZW4gPSAtMS4wOworICAgICAgICBsc2wtPmJs dWUgPSAtMS4wOworICAgICAgfQorfQorCisvKiBEcmF3IHN0cmV0Y2ggZ2x5cGggc3RyaW5nIFMu ICovCitzdGF0aWMgdm9pZAorbWNfdzMyX2RyYXdfc3RyZXRjaF9nbHlwaF9zdHJpbmcgKHN0cnVj dCBnbHlwaF9zdHJpbmcgKnMpCit7CisgIGVhc3NlcnQgKHMtPmZpcnN0X2dseXBoLT50eXBlID09 IFNUUkVUQ0hfR0xZUEgpOworICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IKKyAgICAgICYmICF4 X3N0cmV0Y2hfY3Vyc29yX3ApCisgICAgeworICAgICAgLyogSWYgYHgtc3RyZXRjaC1jdXJzb3In IGlzIG5pbCwgZG9uJ3QgZHJhdyBhIGJsb2NrIGN1cnNvciBhcyB3aWRlIGFzIHRoZQorICAgICAg c3RyZXRjaCBnbHlwaC4gKi8KKyAgICAgIGludCB3aWR0aCwgYmFja2dyb3VuZF93aWR0aCA9IHMt PmJhY2tncm91bmRfd2lkdGg7CisgICAgICBpbnQgeCA9IHMtPng7CisgICAgICBpZiAoIXMtPnJv dy0+cmV2ZXJzZWRfcCkKKyAgICAgICAgeworICAgICAgICAgIGludCBsZWZ0X3ggPSB3aW5kb3df Ym94X2xlZnRfb2Zmc2V0IChzLT53LCBURVhUX0FSRUEpOworICAgICAgICAgIGlmICh4IDwgbGVm dF94KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBiYWNrZ3JvdW5kX3dpZHRoIC09IGxl ZnRfeCAtIHg7CisgICAgICAgICAgICAgIHggPSBsZWZ0X3g7CisgICAgICAgICAgICB9CisgICAg ICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAvKiBJbiBSMkwgcm93 cywgZHJhdyB0aGUgY3Vyc29yIG9uIHRoZSByaWdodCBlZGdlIG9mIHRoZQorICAgICAgICAgICAg ICBzdHJldGNoIGdseXBoLiAqLworICAgICAgICAgICBpbnQgcmlnaHRfeCA9IHdpbmRvd19ib3hf cmlnaHQgKHMtPncsIFRFWFRfQVJFQSk7CisgICAgICAgICAgIGlmICh4ICsgYmFja2dyb3VuZF93 aWR0aCA+IHJpZ2h0X3gpCisgICAgICAgICAgICAgYmFja2dyb3VuZF93aWR0aCAtPSB4IC0gcmln aHRfeDsKKyAgICAgICAgICAgeCArPSBiYWNrZ3JvdW5kX3dpZHRoOworICAgICAgICAgfQorICAg ICAgd2lkdGggPSBtaW4gKEZSQU1FX0NPTFVNTl9XSURUSCAocy0+ZiksIGJhY2tncm91bmRfd2lk dGgpOworICAgICAgaWYgKHMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAgICAgICAgeCAtPSB3aWR0aDsK KyAgICAgIC8qIERyYXcgY3Vyc29yLiAqLworICAgICAgdzMyX2RyYXdfZ2x5cGhfc3RyaW5nX2Jn X3JlY3QgKHMsIHgsIHMtPnksIHdpZHRoLCBzLT5oZWlnaHQpOworICAgICAgLyogQ2xlYXIgcmVz dCB1c2luZyB0aGUgR0Mgb2YgdGhlIG9yaWdpbmFsIG5vbi1jdXJzb3IgZmFjZS4gKi8KKyAgICAg IGlmICh3aWR0aCA8IGJhY2tncm91bmRfd2lkdGgpCisgICAgICAgIHsKKyAgICAgICAgICBFbWFj c19HQyAqZ2MgPSBzLT5mYWNlLT5nYzsKKyAgICAgICAgICBpbnQgeSA9IHMtPnk7CisgICAgICAg ICAgaW50IHcgPSBiYWNrZ3JvdW5kX3dpZHRoIC0gd2lkdGgsIGggPSBzLT5oZWlnaHQ7CisgICAg ICAgICAgUkVDVCByOworICAgICAgICAgIEhEQyBoZGMgPSBzLT5oZGM7CisgICAgICAgICAgaWYg KCFzLT5yb3ctPnJldmVyc2VkX3ApCisgICAgICAgICAgICB4ICs9IHdpZHRoOworICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICB4ID0gcy0+eDsKKyAgICAgICAgICBpZiAocy0+cm93LT5t b3VzZV9mYWNlX3AKKyAgICAgICAgICAgICAgJiYgY3Vyc29yX2luX21vdXNlX2ZhY2VfcCAocy0+ dykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHczMl9zZXRfbW91c2VfZmFjZV9nYyAo cyk7CisgICAgICAgICAgICAgIGdjID0gcy0+Z2M7CisgICAgICAgICAgICB9CisgICAgICAgICAg ICBlbHNlCisgICAgICAgICAgICAgIGdjID0gcy0+ZmFjZS0+Z2M7CisgICAgICAgICAgZ2V0X2ds eXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsICZyKTsKKyAgICAgICAgICB3MzJfc2V0X2NsaXBfcmVj dGFuZ2xlIChoZGMsICZyKTsKKyNpZiAwIC8qIFRPRE86IHN0aXBwbGUgKi8KKyAgICAgICAgICBp ZiAocy0+ZmFjZS0+c3RpcHBsZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogRmls bCBiYWNrZ3JvdW5kIHdpdGggYSBzdGlwcGxlIHBhdHRlcm4uICovCisgICAgICAgICAgICAgIFhT ZXRGaWxsU3R5bGUgKHMtPmRpc3BsYXksIGdjLCBGaWxsT3BhcXVlU3RpcHBsZWQpOworICAgICAg ICAgICAgICBYRmlsbFJlY3RhbmdsZSAocy0+ZGlzcGxheSwgcy0+d2luZG93LCBnYywgeCwgeSwg dywgaCk7CisgICAgICAgICAgICAgIFhTZXRGaWxsU3R5bGUgKHMtPmRpc3BsYXksIGdjLCBGaWxs U29saWQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorI2VuZGlmCisgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIGdj LT5iYWNrZ3JvdW5kLCB4LCB5LCB3LCBoKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9Cisg ICAgfQorICAgIGVsc2UgaWYgKCFzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wKQorICAgICAgeworICAg ICAgICBpbnQgYmFja2dyb3VuZF93aWR0aCA9IHMtPmJhY2tncm91bmRfd2lkdGg7CisgICAgICAg IGludCB4ID0gcy0+eCwgbGVmdF94ID0gd2luZG93X2JveF9sZWZ0X29mZnNldCAocy0+dywgVEVY VF9BUkVBKTsKKyAgICAgICAgLyogRG9uJ3QgZHJhdyBpbnRvIGxlZnQgbWFyZ2luLCBmcmluZ2Ug b3Igc2Nyb2xsYmFyIGFyZWEKKyAgICAgICAgICAgZXhjZXB0IGZvciBoZWFkZXIgbGluZSBhbmQg bW9kZSBsaW5lLiAqLworICAgICAgICBpZiAoeCA8IGxlZnRfeCAmJiAhcy0+cm93LT5tb2RlX2xp bmVfcCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBiYWNrZ3JvdW5kX3dpZHRoIC09IGxlZnRf eCAtIHg7CisgICAgICAgICAgICB4ID0gbGVmdF94OworICAgICAgICAgIH0KKyAgICAgICAgaWYg KGJhY2tncm91bmRfd2lkdGggPiAwKQorICAgICAgICAgIHczMl9kcmF3X2dseXBoX3N0cmluZ19i Z19yZWN0IChzLCB4LCBzLT55LCBiYWNrZ3JvdW5kX3dpZHRoLCBzLT5oZWlnaHQpOworICAgICAg fQorICBzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wID0gdHJ1ZTsKK30KKworLyogU2V0IFMtPmdjIHRv IGEgc3VpdGFibGUgR0MgZm9yIGRyYXdpbmcgZ2x5cGggc3RyaW5nIFMgaW4gY3Vyc29yCisgICBm YWNlLiAqLworc3RhdGljIHZvaWQKK21jX3czMl9zZXRfY3Vyc29yX2djIChzdHJ1Y3QgZ2x5cGhf c3RyaW5nICpzLCBib29sIGN1cnNvcl9nY19wKQoreworICBpZiAoY3Vy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PKQorICAg ICAgeworICAgICAgICB3MzJfc2V0X21vZGVfbGluZV9mYWNlX2djIChzKTsKKyAgICAgICAgcy0+ c3RpcHBsZWRfcCA9IHMtPmZhY2UtPnN0aXBwbGUgIT0gMDsKKyAgICAgIH0KKyAgICAgIGVsc2Ug aWYgKHMtPmhsID09IERSQVdfQ1VSU09SKQorICAgICAgICB7CisgICAgICAgICAgbWNfdzMyX3Nl dF9jdXJzb3JfZ2MgKHMsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICBzLT5zdGlwcGxlZF9wID0g ZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAocy0+aGwgPT0gRFJBV19NT1VTRV9G QUNFKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIHczMl9zZXRfbW91c2VfZmFjZV9nYyAocyk7 CisgICAgICAgICAgICBzLT5zdGlwcGxlZF9wID0gcy0+ZmFjZS0+c3RpcHBsZSAhPSAwOworICAg ICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmIChzLT5obCA9PSBEUkFXX0lNQUdFX1JBSVNFRAor ICAgICAgICAgICAgICAgICAgIHx8IHMtPmhsID09IERSQVdfSU1BR0VfU1VOS0VOKQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICBzLT5nYyA9IHMtPmZhY2UtPmdjOworICAgICAgICAgICAg ICBzLT5zdGlwcGxlZF9wID0gcy0+ZmFjZS0+c3RpcHBsZSAhPSAwOworICAgICAgICAgICAgfQor ICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBlbWFjc19hYm9ydCAoKTsKKyAgLyogR0Mg bXVzdCBoYXZlIGJlZW4gc2V0LiAqLworICBlYXNzZXJ0IChzLT5nYyAhPSAwKTsKK30KKworLyog RHJhdyBhIGhvbGxvdyBib3ggY3Vyc29yIG9uIHdpbmRvdyBXIGluIGdseXBoIHJvdyBST1cuICov CitzdGF0aWMgdm9pZAorbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAoc3RydWN0IHdpbmRvdyAq dywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgc3RydWN0IGdseXBoX3JvdyAqcm93LCBpbnQgeCwgaW50IGZ4LCBpbnQgeSwgaW50IGZ5LAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGhwb3MsIGludCB2cG9zLCBpbnQgd2QsIGlu dCBoKQoreworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOwor ICBIREMgaGRjOworICBSRUNUIHJlY3Q7CisgIEhCUlVTSCBoYiA9IENyZWF0ZVNvbGlkQnJ1c2gg KGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsKTsKKyAgLyogR2V0IHRoZSBnbHlwaCB0 aGUgY3Vyc29yIGlzIG9uLiAgSWYgd2UgY2FuJ3QgdGVsbCBiZWNhdXNlCisgICAgIHRoZSBjdXJy ZW50IG1hdHJpeCBpcyBpbnZhbGlkIG9yIHN1Y2gsIGdpdmUgdXAuICovCisgIHN0cnVjdCBnbHlw aCAqY3Vyc29yX2dseXBoID0gbWNfZ2V0X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIGhw b3MsIHZwb3MpOworICBpZiAoY3Vyc29yX2dseXBoID09IE5VTEwpCisgICAgeworICAgICAgRGVs ZXRlT2JqZWN0IChoYik7CisgICAgICByZXR1cm47CisgICAgfQorICBpbnQgcmwgPSBmeDsKKyAg aW50IHJ0ID0gZnk7CisgIGludCByciA9IHJsICsgd2Q7CisgIGludCByYiA9IHJ0ICsgaDsKKyAg Ly8gIGZwcmludGYgKHN0ZGVyciwgIk1DX0hPTExPV19CT1g6ICBybCAoJWQpIHwgcnQgKCVkKSB8 IHJyICglZCkgfCByYiAoJWQpXG4iLAorICAvLyAgICAgICAgICAgICAgICAgICBybCwgcnQsIHJy LCByYik7CisgIHJlY3QubGVmdCA9IHJsOworICByZWN0LnRvcCA9I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HdhcmUgbGlrZSBzY3JlZW4gbWFnbmlmaWVycworICAgICAgYW5kIHNwZWVjaCBz eW50aGVzaXplcnMgY2FuIGZvbGxvdyB0aGUgY3Vyc29yLiAqLworICAgICAgaWYgKGFjdGl2ZV9w KQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1df RlJBTUUgKHcpKTsKKyAgICAgICAgICBIV05EIGh3bmQgPSBGUkFNRV9XMzJfV0lORE9XIChmKTsK KyAgICAgICAgICB3MzJfc3lzdGVtX2NhcmV0X3gKKyAgICAgICAgICAgID0gV0lORE9XX1RFWFRf VE9fRlJBTUVfUElYRUxfWCAodywgeCk7CisgICAgICAgICAgLyogRklYTUU6ICBXaGF0IHNob3Vs ZCB3ZSB1c2UgaW5zdGVhZCBvZiBgdy0+cGh5c19jdXJzb3JfYXNjZW50Jz8gKi8KKyAgICAgICAg ICB3MzJfc3lzdGVtX2NhcmV0X3kKKyAgICAgICAgICAgID0gKFdJTkRPV19UT19GUkFNRV9QSVhF TF9ZICh3LCB5KQorICAgICAgICAgICAgICAgKyByb3ctPmFzY2VudCAtIHctPnBoeXNfY3Vyc29y X2FzY2VudCk7CisgICAgICAgICAgdzMyX3N5c3RlbV9jYXJldF93aW5kb3cgPSB3OworICAgICAg ICAgIHczMl9zeXN0ZW1fY2FyZXRfaGRyX2hlaWdodCA9IFdJTkRPV19IRUFERVJfTElORV9IRUlH SFQgKHcpOworICAgICAgICAgIHczMl9zeXN0ZW1fY2FyZXRfbW9kZV9oZWlnaHQgPSBXSU5ET1df TU9ERV9MSU5FX0hFSUdIVCAodyk7CisgICAgICAgICAgUG9zdE1lc3NhZ2UgKGh3bmQsIFdNX0lN RV9TVEFSVENPTVBPU0lUSU9OLCAwLCAwKTsKKyAgICAgICAgICAvKiBJZiB0aGUgc2l6ZSBvZiB0 aGUgYWN0aXZlIGN1cnNvciBjaGFuZ2VkLCBkZXN0cm95IHRoZSBvbGQKKyAgICAgICAgICAgICBz eXN0ZW0gY2FyZXQuICovCisgICAgICAgICAgaWYgKHczMl9zeXN0ZW1fY2FyZXRfaHduZAorICAg ICAgICAgICAgICAmJiAodzMyX3N5c3RlbV9jYXJldF9oZWlnaHQgIT0gaCkpCisgICAgICAgICAg ICBQb3N0TWVzc2FnZSAoaHduZCwgV01fRU1BQ1NfREVTVFJPWV9DQVJFVCwgMCwgMCk7CisgICAg ICAgICAgdzMyX3N5c3RlbV9jYXJldF9oZWlnaHQgPSBoOworICAgICAgICAgIC8qIE1vdmUgdGhl IHN5c3RlbSBjYXJldC4gKi8KKyAgICAgICAgICBQb3N0TWVzc2FnZSAoaHduZCwgV01fRU1BQ1Nf VFJBQ0tfQ0FSRVQsIDAsIDApOworICAgICAgICB9CisgICAgICAvKiBUaGUgZnJpbmdlIGJpdG1h cHMgYXJlIHByZXNlbnRseSBoYW5kbGVkIGVsc2V3aGVyZSwgYnV0IGNvdWxkIHNvbWVkYXkKKyAg ICAgIGJlIG1hbmFnZWQgKGluIHBhcnQpIGF0IHRoaXMgc2VjdGlvbiBvZiBjb2RlLiAqLworICAg ICAgaWYgKHJvdy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVfcAorICAgICAgICAgICYmIChyb3ct PnJldmVyc2VkX3AKKyAgICAgICAgICAgICA/IChocG9zIDwgMCkKKyAgICAgICAgICAgICA6ICho cG9zID49IHJvdy0+dXNlZFtURVhUX0FSRUFdKSkpCisgICAgICAgIHsKKyAgICAgICAgICByb3ct PmN1cnNvcl9pbl9mcmluZ2VfcCA9IHRydWU7CisgICAgICAgICAgbWNfZHJhd19mcmluZ2VfYml0 bWFwICh3LCByb3csIHJvdy0+cmV2ZXJzZWRfcCwgY3Vyc29yX3R5cGUpOworICAgICAgICAgIHJl dHVybjsKKyAgICAgICAgfQorICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFN RSAodykpOworICBDT0xPUlJFRiBvcmlnaW5hbF9jdXJzb3J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3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3 LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItYXQtcmVnaW9uLXByZS16di1mYWNlIiks IHRydWUpOworICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX3JlZ2lv bl9lbmRfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2Zh Y2VfaWQpOworICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2Vf aWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29y LXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xs b3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7 CisgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2Zh Y2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBo b2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZS0+YmFja2dyb3VuZDsKKyAgICAgICAgICAgICAg fQorICAgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgJiYgYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2ds eXBoLT5jaGFycG9zID4gcmVnaW9uX2JlZworICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJz b3JfZ2x5cGgtPmNoYXJwb3MgPCByZWdpb25fZW5kKQorICAgICAgICAgICAgICA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ICAgICBlbHNlIGlmIChjdXJzb3JfZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEggJiYgbHNsLnJl ZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgICAgewor ICAgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1 cnNvcl9waXhlbCcuICovCisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9w aXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNv ciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAg ICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJz b3JfcGl4ZWw7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1 cnNvcl9nYycgYnkgYm9ycm93aW5nIHRoZQorICAgICAgICAgICAgICBmdW5jdGlvbmFsaXR5IG9m IGB4X21ha2VfZ2MnIGluIHczMmZucy5jLiAqLworICAgICAgICAgICAgICBpZiAocmVnaW9uX2Fj dGl2ZV9wCisgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcAorICAgICAgICAgICAgICAgICAg JiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID09IHJlZ2lvbl9iZWcpCisgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2Jl Z19mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtl L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IistcmVhbC1mYWtlLWN1cnNvci1hdC1yZWdp b24tcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNl ICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93 X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICBlbnVtIGZh Y2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGlu dGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAg ICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9J RCAoZiwgaG9sbG93X2FjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAgZ2NfdmFs dWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAg ICAgICAgICAgICAgIGdjX3ZhbHVlcy5iYWNrZ3JvdW5kID0gaG9sbG93X2FjdGl2ZV9yZWdpb25f ZW5kX2ZhY2UtPmJhY2tncm91bmQ7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAg ICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIGFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgt PmNoYXJwb3MgPiByZWdpb25fYmVnCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJz b3JfZ2x5cGgtPmNoYXJwb3MgPCByZWdpb25fZW5kKQorICAgICAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgIC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wX25hbWVkX2Zh Y2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVl KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2Zh Y2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAg ICAgICAgICAgICAgICBnY192YWx1ZXMuZm9yZWdyb3VuZCA9IGhvbGxvd19hY3RpdmVfZmFjZS0+ Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5iYWNrZ3JvdW5k ID0gaG9sbG93X2FjdGl2ZV9mYWNlLT5iYWNrZ3JvdW5kOworICAgICAgICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICghYWN0aXZlX3ApCisgICAgICAgICAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBo b2xsb3dfaW5hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4g KCIrLXJlYWwtZmFrZS1jdXJzb3ItaW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAg ICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9 IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAg ICAgICAgICAgICAgICBnY192YWx1ZXMuZm9yZWdyb3VuZCA9IGhvbGxvd19pbmFjdGl2ZV9mYWNl LT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICAgICAgICAgICAgICBnY192YWx1ZXMuYmFja2dy b3VuZCA9IGhvbGxvd19pbmFjdGl2ZV9mYWNlLT5iYWNrZ3JvdW5kOworICAgICAgICAgICAgICAg ICAgICAgICAgfQorICAgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYyA9 IFhDcmVhdGVHQyAoTlVMTCwgRlJBTUVfVzMyX1dJTkRPVyAoZiksIG1hc2ssICZnY192YWx1ZXMp OworICAgICAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgLyogRm9yY2Ug YG1jX3czMl9zZXRfY3Vyc29yX2djJyB0byB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLnczMi0+Y3Vy c29yX2djJy4gKi8KKyAgICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IHRydWU7CisgICAg ICAgICAgICAgIG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywgRFJBV19DVVJT T1IsIHgsIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBs c2wsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3Ap OworICAgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYyA9IG9yaWdpbmFs X2N1cnNvcl9nYzsKKyAgICAgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAg ICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBm eSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAg fQorICAgIGNhc2UgTUNfSE9MTE9XX0JPWDoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAw ICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAg ICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVs Jy4gKi8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9y X3BpeGVsOworICAgICAgICAgIG1jX3czMl9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwg cm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAgICAgICAgICBmLT5vdXRw dXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAg ICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAo dywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAg YnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAgICB7CisgICAgICBpZiAo bHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAg IHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+ Y3Vyc29yX2djJyBieSBib3Jyb3dpbmcgdGhlCisgICAgICAgICAgZnVuY3Rpb25hbGl0eSBvZiBg eF9tYWtlX2djJyBpbiB3MzJmbnMuYy4gKi8KKyAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAg ICAgICAgICBFbWFjc19HQyBnY192YWx1ZXM7CisgICAgICAgICAgdW5zaWduZWQgbG9uZyBtYXNr ID0gR0NGb3JlZ3JvdW5kIHwgR0NCYWNrZ3JvdW5kOworICAgICAgICAgIGdjX3ZhbHVlcy5mb3Jl Z3JvdW5kID0gRlJBTUVfQkFDS0dST1VORF9QSVhFTCAoZik7CisgICAgICAgICAgZ2NfdmFsdWVz LmJhY2tncm91bmQgPSBjb2xvcl9waXhlbDsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzIt PmN1cnNvcl9nYyA9IFhDcmVhdGVHQyAoTlVMTCwgRlJBTUVfVzMyX1dJTkRPVyAoZiksIG1hc2ss ICZnY192YWx1ZXMpOworICAgICAgICAgIC8qIEZvcmNlIGBtY193MzJfc2V0X2N1cnNvcl9nYycg dG8gdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycuICovCisgICAgICAgICAg Ym9vbCBjdXJzb3JfZ2NfcCA9IHRydWU7CisgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGgg KHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywgbHNsLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwg YWN0aXZlX3AsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1 cnNvcl9nYyA9IG9yaWdpbmFsX2N1cnNvcl9nYzsKKyAgICAgICAgICB1bmJsb2NrX2lucHV0ICgp OworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBib29s IGN1cnNvcl9nY19wID0gZmFsc2U7CisgICAgICAgICAgICBtY19kcmF3X2N1cnNvcl9nbHlwaCAo dywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4LCBocG9zLCB2cG9zLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2Qs IGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9nY19w KTsKKyAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBNQ19CQVI6Cisg ICAgeworICAgICAgaWYgKGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wuYmx1 ZSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5v dXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcuICovCisgICAgICAgICAgZi0+b3V0cHV0X2Rh dGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBjb2xvcl9waXhlbDsKKyAgICAgICAgICBib29sIGN1cnNv cl9nY19pbnZpc2libGVfb2theV9wID0gdHJ1ZTsKKyAgICAgICAgICBtY193MzJfZHJhd19iYXJf Y3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0JBUiwg Y3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLncz Mi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAg ICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2li bGVfb2theV9wID0gZmFsc2U7CisgICAgICAgICAgICBtY193MzJfZHJhd19iYXJfY3Vyc29yICh3 LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl93aWR0aCwgTUNfQkFSLCBjdXJzb3Jf Z2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQor ICAgIGNhc2UgTUNfSEJBUjoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5n cmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1w b3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4gKi8KKyAg ICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOwor ICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSB0cnVlOworICAgICAg ICAgIG1jX3czMl9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnks IGhwb3MsIHZwb3MsIHdkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGgsIGN1 cnNvcl93aWR0aCwgTUNfSEJBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAg ICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3Bp eGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBi b29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7CisgICAgICAgICAgICBtY193 MzJfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2 cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl93 aWR0aCwgTUNfSEJBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIH0K KyAgICAgIGJyZWFrOworICAgIH0KKyAgICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7 CisgIH0KKyAgICB9Cit9CisKKy8qIERyYXcgZ2x5cGggc3RyaW5nIFMuICovCitzdGF0aWMgdm9p ZAorbWNfdzMy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+Zmlyc3RfZ2x5cGgtPnR5cGUgIT0gSU1BR0Vf R0xZUEgpCisgICAgICAgICAgeworICAgICAgICAgICAgbWNfdzMyX3NldF9nbHlwaF9zdHJpbmdf Z2MgKG5leHQsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICAgIHczMl9zZXRfZ2x5cGhfc3RyaW5n X2NsaXBwaW5nIChuZXh0KTsKKyAgICAgICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlw ZSA9PSBTVFJFVENIX0dMWVBIKQorICAgICAgICAgICAgICBtY193MzJfZHJhd19zdHJldGNoX2ds eXBoX3N0cmluZyAobmV4dCk7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB3 MzJfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAobmV4dCwgdHJ1ZSk7CisgICAgICAgICAg ICBuZXh0LT5udW1fY2xpcHMgPSAwOworICAgICAgICAgIH0KKyAgICB9CisgIC8qIFNldCB1cCBT LT5nYywgc2V0IGNsaXBwaW5nIGFuZCBkcmF3IFMuICovCisgIG1jX3czMl9zZXRfZ2x5cGhfc3Ry aW5nX2djIChzLCBjdXJzb3JfZ2NfcCk7CisgIC8qIERyYXcgcmVsaWVmIChpZiBhbnkpIGluIGFk dmFuY2UgZm9yIGNoYXIvY29tcG9zaXRpb24gc28gdGhhdCB0aGUKKyAgICAgZ2x5cGggc3RyaW5n IGNhbiBiZSBkcmF3biBvdmVyIGl0LiAqLworICBpZiAoIXMtPmZvcl9vdmVybGFwcworICAgICAg JiYgcy0+ZmFjZS0+Ym94ICE9IEZBQ0VfTk9fQk9YCisgICAgICAmJiAocy0+Zmlyc3RfZ2x5cGgt PnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgIHx8IHMtPmZpcnN0X2dseXBoLT50eXBlID09 IENPTVBPU0lURV9HTFlQSCkpCisgICAgeworICAgICAgdzMyX3NldF9nbHlwaF9zdHJpbmdfY2xp cHBpbmcgKHMp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CisgICAgICBlbWFjc19hYm9ydCAoKTsKKyAgICB9CisgIGlmICghcy0+Zm9y X292ZXJsYXBzKQorICAgIHsKKyAgICAgIC8qIERyYXcgdW5kZXJsaW5lLiAqLworICAgICAgaWYg KHMtPmZhY2UtPnVuZGVybGluZV9wKQorICAgICAgICB7CisgICAgICAgICAgaWYgKHMtPmZhY2Ut PnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfV0FWRSkKKyAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgQ09MT1JSRUYgY29sb3I7CisgICAgICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRl cmxpbmVfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICAgICAgY29sb3IgPSBzLT5nYy0+Zm9yZWdy b3VuZDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjb2xvciA9IHMt PmZhY2UtPnVuZGVybGluZV9jb2xvcjsKKyAgICAgICAgICAgICAgdzMyX2RyYXdfdW5kZXJ3YXZl IChzLCBjb2xvcik7CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxzZSBpZiAocy0+ZmFjZS0+ dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICB1bnNpZ25lZCBsb25nIHRoaWNrbmVzcywgcG9zaXRpb247CisgICAgICAgICAgICAg IGludCB5OworICAgICAgICAgICAgICBpZiAocy0+cHJldiAmJiBzLT5wcmV2LT5mYWNlLT51bmRl cmxpbmVfcAorICAgICAgICAgICAgICAgICAgJiYgcy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3R5 cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg ICAgIC8qIFdlIHVzZSB0aGUgc2FtZSB1bmRlcmxpbmUgc3R5bGUgYXMgdGhlIHByZXZpb3VzIG9u ZS4gKi8KKyAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPnByZXYtPnVuZGVybGluZV90 aGlja25lc3M7CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPnByZXYtPnVuZGVybGlu ZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVybGluZSB0aGlj a25lc3MuICBEZWZhdWx0IGlzIDEgcGl4ZWwuICovCisgICAgICAgICAgICAgICAgICBpZiAocy0+ Zm9udCAmJiBzLT5mb250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4gMCkKKyAgICAgICAgICAgICAg ICAgICAgdGhpY2tuZXNzID0gcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAgICAg ICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IDE7Cisg ICAgICAgICAgICAgICAgICBpZiAoeF91bmRlcmxpbmVfYXRfZGVzY2VudF9saW5lKQorICAgICAg ICAgICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5oZWlnaHQgLSB0aGlja25lc3MpIC0gKHMtPnli YXNlIC0gcy0+eSk7CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAg ICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVybGluZSBwb3Np dGlvbi4gIFRoaXMgaXMgdGhlIHJlY29tbWVuZGVkCisgICAgICAgICAgICAgICAgICAgICAgICAg ICB2ZXJ0aWNhbCBvZmZzZXQgaW4gcGl4ZWxzIGZyb20gdGhlIGJhc2VsaW5lIHRvIHRoZSB0b3Ag b2YKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSB1bmRlcmxpbmUuICBUaGlzIGlzIGEg c2lnbmVkIHZhbHVlIGFjY29yZGluZyB0byB0aGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAg IHNwZWNzLCBhbmQgaXRzIGRlZmF1bHQgaXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIFJP VU5EICgobWF4aW11bV9kZXNjZW50KSAvIDIpLCB3aXRoCisgICAgICAgICAgICAgICAgICAgICAg ICAgICBST1VORCAoeCkgPSBmbG9vciAoeCArIDAuNSkgICovCisgICAgICAgICAgICAgICAgICAg ICAgICBpZiAoeF91c2VfdW5kZXJsaW5lX3Bvc2l0aW9uX3Byb3BlcnRpZXMKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBzLT5mb250ICYmIHMtPmZvbnQtPnVuZGVybGluZV9wb3NpdGlv biA+PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPmZvbnQtPnVu ZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHMtPmZv bnQpCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmZvbnQtPmRlc2Nl bnQgKyAxKSAvIDI7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAg cG9zaXRpb24gPSBtYXggKHBvc2l0aW9uLCB1bmRlcmxpbmVfbWluaW11bV9vZmZzZXQpOworICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgLyogQ2hlY2sgdGhlIHNhbml0eSBvZiB0aGlj a25lc3MgYW5kIHBvc2l0aW9uLiAgV2Ugc2hvdWxkCisgICAgICAgICAgICAgICAgIGF2b2lkIGRy YXdpbmcgdW5kZXJsaW5lIG91dCBvZiB0aGUgY3VycmVudCBsaW5lIGFyZWEuICovCisgICAgICAg ICAgICAgIGlmIChzLT55ICsgcy0+aGVpZ2h0IDw9IHMtPnliYXNlICsgcG9zaXRpb24pCisgICAg ICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+aGVpZ2h0IC0gMSkgLSAocy0+eWJhc2UgLSBzLT55 KTsKKyAgICAgICAgICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQgPCBzLT55YmFzZSArIHBvc2l0 aW9uICsgdGhpY2tuZXNzKQorICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IChzLT55ICsgcy0+ aGVpZ2h0KSAtIChzLT55YmFzZSArIHBvc2l0aW9uKTsKKyAgICAgICAgICAgICAgcy0+dW5kZXJs aW5lX3RoaWNrbmVzcyA9IHRoaWNrbmVzczsKKyAgICAgICAgICAgICAgcy0+dW5kZXJsaW5lX3Bv c2l0aW9uID1wb3NpdGlvbjsKKyAgICAgICAgICAgICAgeSA9IHMtPnliYXNlICsgcG9zaXRpb247 CisgICAgICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3ApCisgICAg ICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5nYy0+Zm9yZWdyb3Vu ZCwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5LCBzLT53aWR0aCwgMSk7 CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAo cy0+Ziwgcy0+aGRjLCBzLT5mYWNlLT51bmRlcmxpbmVfY29sb3IsIHMtPngsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICB5LCBzLT53aWR0aCwgMSk7CisgICAgICAgICAgICB9Cisg ICAgICAgIH0KKyAgICAgIC8qIERyYXcgb3ZlcmxpbmUuICovCisgICAgICBpZiAocy0+ZmFjZS0+ b3ZlcmxpbmVfcCkKKyAgICAgICAgeworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZHkgPSAwLCBo ID0gMTsKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+b3ZlcmxpbmVfY29sb3JfZGVmYXVsdGVkX3Ap CisgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmdjLT5mb3JlZ3Jv dW5kLCBzLT54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+eSArIGR5LCBzLT53aWR0 aCwgaCk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMt PmYsIHMtPmhkYywgcy0+ZmFjZS0+b3ZlcmxpbmVfY29sb3IsIHMtPngsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHMtPnkgKyBkeSwgcy0+d2lkdGgsIGgpOworICAgICAgICB9CisgICAg ICAvKiBEcmF3IHN0cmlrZS10aHJvdWdoLiAqLworICAgICAgaWYgKHMtPmZhY2UtPnN0cmlrZV90 aHJvdWdoX3AKKyAgICAgICAgICAmJiAhRk9OVF9URVhUTUVUUklDIChzLT5mb250KS50bVN0cnVj a091dCkKKyAgICAgICAgeworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgaCA9IDE7CisgICAgICAg ICAgdW5zaWduZWQgbG9uZyBkeSA9IChzLT5oZWlnaHQgLSBoKSAvIDI7CisgICAgICAgICAgaWYg KHMtPmZhY2UtPnN0cmlrZV90aHJvdWdoX2NvbG9yX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAg dzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5nYy0+Zm9yZWdyb3VuZCwgcy0+eCwgcy0+ eSArIGR5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+d2lkdGgsIGgpOworICAgICAg ICAgICAgZWxzZQorICAgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMt PmZhY2UtPnN0cmlrZV90aHJvdWdoX2NvbG9yLCBzLT54LAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBzLT55ICsgZHksIHMtPndpZHRoLCBoKTsKKyAgICAgICAgfQorICAgICAgLyogRHJh dyByZWxpZWYgaWYgbm90IHlldCBkcmF3bi4gKi8KKyAgICAgIGlmICghcmVsaWVmX2RyYXduX3Ag JiYgcy0+ZmFjZS0+Ym94ICE9IEZBQ0VfTk9fQk9YKQorICAgICAgICB3MzJfZHJhd19nbHlwaF9z dHJpbmdfYm94IChzKTsKKyAgICAgIGlmIChzLT5wcmV2KQorICAgICAgICB7CisgICAgICAgICAg c3RydWN0IGdseXBoX3N0cmluZyAqcHJldjsKKyAgICAgICAgICBmb3IgKHByZXYgPSBzLT5wcmV2 OyBwcmV2OyBwcmV2ID0gcHJldi0+cHJldikKKyAgICAgICAgICAgIGlmIChwcmV2LT5obCAhPSBz LT5obAorICAgICAgICAgICAgICAgICYmIHByZXYtPnggKyBwcmV2LT53aWR0aCArIHByZXYtPnJp Z2h0X292ZXJoYW5nID4gcy0+eCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8q IEFzIHByZXYgd2FzIGRyYXduIHdoaWxlIGNsaXBwZWQgdG8gaXRzIG93biBhcmVhLCB3ZQorICAg ICAgICAgICAgICAgICAgIG11c3QgZHJhdyB0aGUgcmlnaHRfb3ZlcmhhbmcgcGFydCB1c2luZyBz LT5obCBub3cuICovCisgICAgICAgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIHNhdmUg PSBwcmV2LT5obDsKKyAgICAgICAgICAgICAgICBwcmV2LT5obCA9IHMtPmhsOworICAgICAgICAg ICAgICAgIG1jX3czMl9zZXRfZ2x5cGhfc3RyaW5nX2djIChwcmV2LCBjdXJzb3JfZ2NfcCk7Cisg ICAgICAgICAgICAgICAgdzMyX3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywg cHJldik7CisgICAgICAgICAgICAgICAgaWYgKHByZXYtPmZpcnN0X2dseXBoLT50eXBlID09IENI QVJfR0xZUEgpCisgICAgICAgICAgICAgICAgICB3MzJfZHJhd19nbHlwaF9zdHJpbmdfZm9yZWdy b3VuZCAocHJldik7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAg IHczMl9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocHJldik7CisgICAg ICAgICAgICAgICAgdzMyX3NldF9jbGlwX3JlY3RhbmdsZSAocHJldi0+aGRjLCBOVUxMKTsKKyAg ICAgICAgICAgICAgICBwcmV2LT5obCA9IHNhdmU7CisgICAgICAgICAgICAgICAgcHJldi0+bnVt X2NsaXBzID0gMDsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBpZiAocy0+bmV4 dCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBnbHlwaF9zdHJpbmcgKm5leHQ7CisgICAg ICAgICAgZm9yIChuZXh0ID0gcy0+bmV4dDsgbmV4dDsgbmV4dCA9IG5leHQtPm5leHQpCisgICAg ICAgICAgICBpZiAobmV4dC0+aGwgIT0gcy0+aGwKKyAgICAgICAgICAgICAgICAmJiBuZXh0LT54 IC0gbmV4dC0+bGVmdF9vdmVyaGFuZyA8IHMtPnggKyBzLT53aWR0aCkKKyAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgIC8qIEFzIG5leHQgd2lsbCBiZSBkcmF3biB3aGlsZSBjbGlwcGVk IHRvIGl0cyBvd24gYXJlYSwKKyAgICAgICAgICAgICAgICAgICB3ZSBtdXN0IGRyYXcgdGhlIGxl ZnRfb3ZlcmhhbmcgcGFydCB1c2luZyBzLT5obCBub3cuICovCisgICAgICAgICAgICAgICAgZW51 bSBkcmF3X2dseXBoc19mYWNlIHNhdmUgPSBuZXh0LT5obDsKKyAgICAgICAgICAgICAgICBuZXh0 LT5obCA9IHMtPmhsOworICAgICAgICAgICAgICAgIG1jX3czMl9zZXRfZ2x5cGhfc3RyaW5nX2dj IChuZXh0LCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgICAgICAgdzMyX3NldF9nbHlwaF9zdHJp bmdfY2xpcHBpbmdfZXhhY3RseSAocywgbmV4dCk7CisgICAgICAgICAgICAgICAgaWYgKG5leHQt PmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgpCisgICAgICAgICAgICAgICAgICB3MzJf ZHJhd19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAobmV4dCk7CisgICAgICAgICAgICAgICAgICBl bHNlCisgICAgICAgICAgICAgICAgICAgIHczMl9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdf Zm9yZWdyb3VuZCAobmV4dCk7CisgICAgICAgICAgICAgICAgdzMyX3NldF9jbGlwX3JlY3Rhbmds ZSAobmV4dC0+aGRjLCBOVUxMKTsKKyAgICAgICAgICAgICAgICBuZXh0LT5obCA9IHNhdmU7Cisg ICAgICAgICAgICAgICAgbmV4dC0+bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICAgICAgICBuZXh0 LT5jbGlwX2hlYWQgPSBzLT5uZXh0OworICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9 CisgIC8qIFJlc2V0IGNsaXBwaW5nLiAqLworICB3MzJfc2V0X2NsaXBfcmVjdGFuZ2xlIChzLT5o ZGMsIE5VTEwpOworICBzLT5udW1fY2xpcHMgPSAwOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VS U09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogLyogRnJpbmdlIGJpdG1hcHMu ICAqLwogCiBzdGF0aWMgaW50IG1heF9mcmluZ2VfYm1wID0gMDsKQEAgLTU0Miw2ICsxNzAxLDE1 IEBAIHczMl91cGRhdGVfYmVnaW4gKHN0cnVjdCBmcmFtZSAqZikKICAgaWYgKCEgRlJBTUVfVzMy X1AgKGYpKQogICAgIHJldHVybjsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1V TFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGluZ19mcmFtZSA9IGY7CisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICAgLyogUmVnZW5lcmF0ZSBkaXNwbGF5IHBhbGV0dGUg YmVmb3JlIGRyYXdpbmcgaWYgbGlzdCBvZiByZXF1ZXN0ZWQKICAgICAgY29sb3JzIGhhcyBjaGFu Z2VkLiAqLwogICBpZiAoZGlzcGxheV9pbmZvLT5yZWdlbl9wYWxldHRlKQpAQCAtNjc0LDYgKzE4 NDIsMTYgQEAgdzMyX3VwZGF0ZV9lbmQgKHN0cnVjdCBmcmFtZSAqZikKIAogICAvKiBNb3VzZSBo aWdobGlnaHQgbWF5IGJlIGRpc3BsYXllZCBhZ2Fpbi4gICovCiAgIE1PVVNFX0hMX0lORk8gKGYp LT5tb3VzZV9mYWNlX2RlZmVyID0gZmFsc2U7CisKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBOVUxM OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiB9CiAKIApAQCAtNDAwMiwxMyArNTE4 MCw3NCBAQCB3MzJfc2V0X3ZlcnRpY2FsX3Njcm9sbF9iYXIgKHN0cnVjdCB3aW5kb3cgKncsCiAJ ICAgICAgcmVsZWFzZV9mcmFtZV9kYyAoZiwgaGRjKTsKIAkgICAgICB3MzJfY2xlYXJfdW5kZXJf aW50ZXJuYWxfYm9yZGVyIChmKTsKIAkgICAgfQorCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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orICAgICAgICAgICAgbXlfc2hvd193aW5kb3cgKGYsIGh3bmQsIFNXX0hJREUpOworICAg ICAgICAgIE1vdmVXaW5kb3cgKGh3bmQsIGxlZnQsIHRvcCwgd2lkdGgsIG1heCAoaGVpZ2h0LCAx KSwgbGVmdCA8PSBiYXItPmxlZnQpOworCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKIAogCSAgc2kuY2JTaXplID0gc2l6ZW9mIChzaSk7CiAJ ICBzaS5mTWFzayA9IFNJRl9SQU5HRTsKQEAgLTQyNzcsNiArNTUxNiwyMSBAQCB3MzJfanVkZ2Vf c2Nyb2xsX2JhcnMgKHN0cnVjdCBmcmFtZSAqZikKICAgICB7CiAgICAgICBzdHJ1Y3Qgc2Nyb2xs X2JhciAqYiA9IFhTQ1JPTExfQkFSIChiYXIpOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICAvKiBgRGVzdHJveVdpbmRvdycgd2l0 aGluIGB4X3Njcm9sbF9iYXJfcmVtb3ZlJyByZXBhaW50cyB0aGUgcmVjdGFuZ2xlLgorICAgICAg VGhlcmVmb3JlLCB3ZSBmaXJzdCBzZW5kIGEgbWVzc2FnZSB0byBpbmhpYml0IHJlcGFpbnRpbmcu ICovCisgICAgICBpZiAoIVdJTkRPV19MSVZFX1AgKGItPndpbmRvdykpCisgICAgICAgIHsKKyAg ICAgICAgICBIV05EIGh3bmQgPSBTQ1JPTExfQkFSX1czMl9XSU5ET1cgKGIpOworICAgICAgICAg IFNlbmRNZXNzYWdlIChod25kLCBXTV9TRVRSRURSQVcsIGZhbHNlLCAwKTsKKyAgICAgICAgfQor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICB3MzJfc2Nyb2xsX2Jhcl9yZW1v dmUgKGIpOwogCiAgICAgICBuZXh0ID0gYi0+bmV4dDsKQEAgLTcwODgsNiArODM0MiwyMCBAQCBl eHRlcm4gZnJhbWVfcGFybV9oYW5kbGVyIHczMl9mcmFtZV9wYXJtX2hhbmRsZXJzW107CiAKIHN0 YXRpYyBzdHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFjZSB3MzJfcmVkaXNwbGF5X2ludGVyZmFjZSA9 CiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKy8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgdzMydGVybS5jYCBtdXN0IGJlIGluIHRo ZSBleGFjdCBzYW1lIG9yZGVyIGFzIHRoZQorYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGBkaXNw ZXh0ZXJuLmhgISAqLworCisgIG1jX3czMl9kcmF3X3dpbmRvd19jdXJzb3IsCisgIG1jX3czMl9k cmF3X2dseXBoX3N0cmluZywKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICB3MzJf ZnJhbWVfcGFybV9oYW5kbGVycywKICAgZ3VpX3Byb2R1Y2VfZ2x5cGhzLAogICBndWlfd3JpdGVf Z2x5cGhzLApkaWZmIC0tZ2l0IGEvc3JjL3dpbmRvdy5oIGIvc3JjL3dpbmRvdy5oCmluZGV4IDZi MGYwZTUuLjE0ZGQzOGEgMTAwNjQ0Ci0tLSBhL3NyYy93aW5kb3cuaAorKysgYi9zcmMvd2luZG93 LmgKQEAgLTMyNCw2ICszMjQsMTQ3IEBAIHN0cnVjdCB3aW5kb3cKIAogI2lmZGVmIEhBVkVfV0lO RE9XX1NZU1RFTQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4gTVVMVElQ TEUtQ1VSU09SUyAqLworCisvKiBTdWZmaXhlcyBmb3IgdGhlIGBtY2Agd2luZG93IHBvaW50ZXIg cHJlZml4LiAqLworc3RydWN0IG11bHRpcGxlX2N1cnNvcnMKK3sKKyAgLyogVGhlIHJlY29yZGVk IHBpeGVsIHdpZHRoIG9mIHRoZSBsYXN0IGxpbmUgbnVtYmVyIGRyYXduIGR1cmluZyByZWRpc3Bs YXkgKi8KKyAgaW50IGxudW1fcGl4ZWxfd2lkdGg7Cit9IG1jOworCitzdHJ1Y3QgbWNfbWF0cml4 Cit7CisgIHB0cmRpZmZfdCB2cG9zX2FsbG9jYXRlZDsKKyAgcHRyZGlmZl90IHZwb3NfdXNlZDsK KyAgcHRyZGlmZl90IGN1cnNvcnNfdXNlZFs0XTsKKyAgZW51bSBtY19jYWNoZV90eXBlCisgIHsK KyAgICBNQ19DQUNIRSwKKyAgICBDSF9DQUNIRSwKKyAgICBGQ19DQUNIRSwKKyAgICBOT19DQUNI RQorICB9IGNhY2hlX3R5cGU7CisgIHN0cnVjdCBtY192cG9zCisgIHsKKyAgICBwdHJkaWZmX3Qg Y2FjaGVfYWxsb2NhdGVkWzRdOworICAgIHB0cmRpZmZfdCBjYWNoZV91c2VkWzRdOworICAgIHN0 cnVjdCBtY19jb250ZW50cworICAgIHsKKyAgICAgIGJvb2xfYmYgc2FtZV9wIDogMTsKKyAgICAg IHN0cnVjdCBnbHlwaCBnbHlwaDsKKyAgICAgIGludCB4OworICAgICAgaW50IGZ4OworICAgICAg aW50IHk7CisgICAgICBpbnQgZnk7CisgICAgICBpbnQgaHBvczsKKyAgICAgIGludCB2cG9zOwor ICAgICAgaW50IHdkOworICAgICAgaW50IGg7CisgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlCisg ICAgICB7CisgICAgICAgIC8qIE5PVEU6ICBUaGUgZnJpbmdlIGJpdG1hcCBmcmFtZXdvcmsgcmVs aWVzIHVwb24gTUNfTk9fRlJJTkdFX0JJVE1BUAorICAgICAgICBoYXZpbmcgYSB2YWx1ZSBvZiB6 ZXJvICgwKS4gKi8KKyAgICAgICAgTUNfTk9fRlJJTkdFX0JJVE1BUCwKKyAgICAgICAgTUNfTk9f Q1VSU09SLAorICAgICAgICBNQ19SSUdIVF9GUklOR0VfQklUTUFQLAorICAgICAgICBNQ19MRUZU X0ZSSU5HRV9CSVRNQVAsCisgICAgICAgIE1DX0ZSQU1FRF9CT1gsCisgICAgICAgIE1DX0ZJTExF RF9CT1gsCisgICAgICAgIE1DX0hPTExPV19CT1gsCisgICAgICAgIE1DX0JBUiwKKyAgICAgICAg TUNfSEJBUgorICAgICAgfSBjdXJzb3JfdHlwZTsKKyAgICAgIGludCBjdXJzb3Jfd2lkdGg7Cisg ICAgICBzdHJ1Y3QgbWNfUkdCCisgICAgICB7CisgICAgICAgIGRvdWJsZSByZWQ7CisgICAgICAg IGRvdWJsZSBncmVlbjsKKyAgICAgICAgZG91YmxlIGJsdWU7CisgICAgICB9IGZnLCBiZzsKKyAg ICAgIGJvb2xfYmYgYWN0aXZlX3AgOiAxOworICAgICAgZW51bSBtY19mbGF2b3IKKyAgICAgIHsK KyAgICAgICAgTk9fRkxBVk9SLAorICAgICAgICBNQ19HTFlQSCwKKyAgICAgICAgTUNfR0xZUEhM RVNTLAorICAgICAgICBNQ19PVkVSTEFZX0FSUk9XX0JJVE1BUCwKKyAgICAgICAgTUNfUElMQ1JP VywKKyAgICAgICAgTUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVywKKyAgICAgICAgTUNf UkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVywKKyAgICAgICAgTUNfSE9MTE9X X1JFQ1RBTkdMRSwKKyAgICAgICAgTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XLAorICAgICAg ICBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1csCisgICAgICAgIE1DX1ZFUlRJ Q0FMX0JBUiwKKyAgICAgICAgTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSLAorICAgICAgICBNQ19W RVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICB9IGdseXBoX2ZsYXZvcjsKKyAgICAgIGVudW0g bWNfcm93X3Bvc2l0aW9uCisgICAgICB7CisgICAgICAgIFBSRV9aViwKKyAgICAgICAgQVRfWlYs CisgICAgICAgIFBPU1RfWlYKKyAgICAgIH0gcm93X3Bvc2l0aW9uOworICAgICAgYm9vbF9iZiBl bmFibGVkX3AgOiAxOworICAgIH0gKmNhY2hlWzRdOworICB9ICp2cG9zOworICAvKiBVc2VkIGVs c2V3aGVyZS4gKi8KKyAgc3RydWN0IG1jX2Vzc2VudGlhbHMKKyAgeworICAgIGJvb2xfYmYgYWN0 aXZlX3AgOiAxOworICAgIHN0cnVjdCBtY19SR0IgY2hfZmdbM10sIGZjX2ZnWzNdLCBzcF9mZzsK KyAgICBpbnQgZmNfeDsKKyAgICBpbnQgenY7CisgICAgaW50IHp2X2J5dGU7CisgIH0gZXNzZW50 aWFsczsKKyAgLyogVXNlZCBlbHNld2hlcmUuICovCisgIGVudW0gbWNfZW5naW5lX3R5cGUKKyAg eworICAgIE1VTFRJUExFX0NVUlNPUlMsCisgICAgSE9SSVpPTlRBTF9SVUxFUiwKKyAgICBWRVJU SUNBTF9SVUxFUiwKKyAgICBGSUxMX0NPTFVNTiwKKyAgICBDVVJTT1JfSU5ESUNBVE9SCisgIH0g YWN0aW9uX3R5cGU7CisgIC8qIFVzZWQgZWxzZXdoZXJlLiAqLworICBlbnVtIG1jX3ByZV9zY3Jv bGxfY2xlYW5fdHlwZQorICB7CisgICAgVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklY X0RPV04sCisgICAgVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX1VQLAorICAgIFRS WV9XSU5ET1dfSUQKKyAgfSBtY19wcmVfc2Nyb2xsX2NsZWFuX3R5cGVfX2Zyb21fd2hlcmU7Cisg IC8qIFVzZWQgZWxzZXdoZXJlLiAqLworICBlbnVtIG1jX2RyYXdfcm93X3R5cGUKKyAgeworICAg IE5PV0hFUkUsCisgICAgU0NSSUJFX09ORSwKKyAgICBTQ1JJQkVfVFdPLAorICAgIFNDUklCRV9U SFJFRSwKKyAgICBTS0lQUEVELAorICAgIFBPU1RfQ0hBTkdFRCwKKyAgICBVTkNIQU5HRUQsCisg ICAgU0VUX0NVUlNPUl9PTkUsCisgICAgU0VUX0NVUlNPUl9UV08KKyAgfSBtY19kcmF3X3Jvd190 eXBlX19mcm9tX3doZXJlOworICAvKiBVc2VkIGVsc2V3aGVyZS4gKi8KKyAgZW51bSBtY19yZWRy YXdfcm93X3R5cGUKKyAgeworICAgIFVQREFURV9XSU5ET1dfX1JFRFJBV19PVkVSTEFQUEVEX1JP V1MsCisgICAgR1VJX0lOU0VSVF9HTFlQSFMsCisgICAgR1VJX0ZJWF9PVkVSTEFQUElOR19BUkVB LAorICAgIERSQVdfUk9XX1dJVEhfTU9VU0VfRkFDRSwKKyAgICBFWFBPU0VfQVJFQV9PTkUsCisg ICAgRVhQT1NFX0FSRUFfVFdPLAorICAgIEVYUE9TRV9MSU5FCisgIH0gbWNfcmVkcmF3X3Jvd190 eXBlX19mcm9tX3doZXJlOworfSBtY19tYXRyaXg7CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JT ICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgLyogQ3Vyc29yIHR5cGUgb2Yg bGFzdCBjdXJ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GZvbGRlciwgZ28gYmFjayB0 byBhbiBFbWFjcyB2ZXJzaW9uIGZyb20gMDcvMTQvMjAxOToKKworZ2l0IHJlc2V0IC0taGFyZCBh YzU3YzUwOTM4MjllZTA5MDg0YzU2MmJiYmMxYzQxMjE3OWJlMTNkCisKK1N0ZXAgMzogIEZyb20g d2l0aGluIHRoZSBuZXcgZW1hY3MgZm9sZGVyIGNyZWF0ZWQgaW4gU3RlcCAxLCBhcHBseSB0aGUg cGF0Y2g6CisKK2dpdCBhcHBseSAvcGF0aC90by90aGUvcGF0Y2guZGlmZgorCitTdGVwIDQ6ICAu L2F1dG9nZW4uc2gKKworU3RlcCA1OiAgLi9jb25maWd1cmUgLi4uIFt5b3VyIGN1c3RvbSBvcHRp b25zXQorCitTdGVwIDY6ICBtYWtlCisKK1N0ZXAgNzogIG1ha2UgaW5zdGFsbAorCisKK1VTQUdF OgorCistIEZvciBhIG1pbmltYWwgd29ya2luZyBleGFtcGxlIG9mIGJ1aWx0LWluIGZha2UgY3Vy c29ycywgdHlwZTogIE0teCBtYy10ZXN0CisKKyAgOzs7IFRVUk4gT04gRkFLRSBDVVJTT1JTIChi dWZmZXIgcG9zaXRpb24sIGN1cnNvci10eXBlLCBjdXJzb3IgY29sb3IpOgorCisgIChzZXRxIG1j LWNvbmYgJygoMSAiaGJhciIgIm1hZ2VudGEiKQorICAgICAgICAgICAgICAgICAgKDIgImJhciIg InB1cnBsZSIpCisgICAgICAgICAgICAgICAgICAoMyAiYm94IiAiIzAwRkYwMCIpCisgICAgICAg ICAgICAgICAgICAoNCAiaG9sbG93IiAiIzAwMDBGRiIpCisgICAgICAgICAgICAgICAgICAoNSAo ImhiYXIiIDMpIFsxLjAgMC4wIDEuMF0pCisgICAgICAgICAgICAgICAgICAoNiAoImJhciIgMykg WzAuMCAxLjAgMS4wXSkKKyAgICAgICAgICAgICAgICAgICg3ICJmcmFtZWQiICJPcmFuZ2VSZWQi KSkpCisKKyAgOzs7IFRVUk4gT0ZGIEZBS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IRUFELCBUQUlMLAkJXAorCQkJCQlITCwgWCwgTEFTVF9YKTsJ CQlcCisJICAgICAgYnJlYWs7CisKKyNkZWZpbmUgTUNfQlVJTERfR0xZUEhfU1RSSU5HU19YVyhT VEFSVCwgRU5ELCBIRUFELCBUQUlMLCBITCwgWCwgTEFTVF9YKQlcCisgICAgICAgICAgICBjYXNl IFhXSURHRVRfR0xZUEg6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBc CisgICAgICAgICAgICAgIE1DX0JVSUxEX1hXSURHRVRfR0xZUEhfU1RSSU5HIChTVEFSVCwgRU5E LCBIRUFELCBUQUlMLCAgICAgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBITCwgWCwgTEFTVF9YKTsgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgIGJy ZWFrOworCisjZGVmaW5lIE1DX0JVSUxEX0dMWVBIX1NUUklOR1NfMihTVEFSVCwgRU5ELCBIRUFE LCBUQUlMLCBITCwgWCwgTEFTVF9YKQlcCisJICAgIGNhc2UgR0xZUEhMRVNTX0dMWVBIOgkJCQkJ XAorCSAgICAgIE1DX0JVSUxEX0dMWVBITEVTU19HTFlQSF9TVFJJTkcgKFNUQVJULCBFTkQsIEhF QUQsIFRBSUwsCVwKKwkJCQkJICAgIEhMLCBYLCBMQVNUX1gpOwkJXAorCSAgICAgIGJyZWFrOwkJ CQkJCQlcCisJCQkJCQkJCQlcCisJICAgIGRlZmF1bHQ6CQkJCQkJCVwKKwkgICAgICBlbWFjc19h Ym9ydCAoKTsJCQkJCQlcCisJICAgIH0JCQkJCQkJCVwKKwkJCQkJCQkJCVwKKwkgIGlmIChzKQkJ CQkJCQlcCisJICAgIHsJCQkJCQkJCVwKKwkgICAgICBzZXRfZ2x5cGhfc3RyaW5nX2JhY2tncm91 bmRfd2lkdGggKHMsIFNUQVJULCBMQVNUX1gpOwlcCisJICAgICAgKFgpICs9IHMtPndpZHRoOwkJ CQkJ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CkKK3sKKyAgd2hpbGUgKDEpCisgICAg eworICAgICAgaWYgKCFDT05TUCAobGlzdCkgfHwgRVEgKFhDQVIgKGxpc3QpLCBlbHQpKQorICAg ICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlmICghQ09OU1Ag KGxpc3QpIHx8IEVRIChYQ0FSIChsaXN0KSwgZWx0KSkKKyAgICAgICAgYnJlYWs7CisgICAgICBs aXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KSB8fCBFUSAoWENBUiAo bGlzdCksIGVsdCkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOwor ICAgIH0KKyAgcmV0dXJuIGxpc3Q7Cit9CisKK0xpc3BfT2JqZWN0CittY19udGggKGludCBudW0s IExpc3BfT2JqZWN0IGxpc3QpCit7CisgIGZvciAoaW50IGkgPSAwOyBpIDwgbnVtICYmICFOSUxQ IChsaXN0KTsgaSsrKQorICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgaWYgKENPTlNQIChsaXN0 KSkKKyAgICByZXR1cm4gWENBUiAobGlzdCk7CisgICAgZWxzZQorICAgICAgcmV0dXJuIFFuaWw7 Cit9CisKK0xpc3BfT2JqZWN0CittY19hc3NxIChMaXNwX09iamVjdCBrZXksIExpc3BfT2JqZWN0 IGxpc3QpCit7CisgIHdoaWxlICgxKQorICAgIHsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisg ICAgICAgICAgfHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgRVEgKFhD QVIgKFhDQVIgKGxpc3QpKSwga2V5KSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhD RFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1Ag KFhDQVIgKGxpc3QpKQorICAgICAgICAgICAgICAmJiBFUSAoWENBUiAoWENBUiAobGlzdCkpLCBr ZXkpKSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBp ZiAoIUNPTlNQIChsaXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAg ICAgICAgICAgICYmIEVRIChYQ0FSIChYQ0FSIChsaXN0KSksIGtleSkpKQorICAgICAgICBicmVh azsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICB9CisgIGlmIChDT05TUCAobGlzdCkp CisgICAgcmV0dXJuIFhDQVIgKGxpc3QpOworICAgIGVsc2UKKyAgICAgIHJldHVybiBRbmlsOwor fQorCitMaXNwX09iamVjdAorbWNfYXNzb2MgKExpc3BfT2JqZWN0IGtleSwgTGlzcF9PYmplY3Qg bGlzdCkKK3sKKyAgTGlzcF9PYmplY3QgY2FyOworICB3aGlsZSAoMSkKKyAgICB7CisgICAgICBp ZiAoIUNPTlNQIChsaXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAg ICAgICAgICAgICYmIChjYXIgPSBYQ0FSIChYQ0FSIChsaXN0KSksCisgICAgICAgICAgICAgICAg ICBFUSAoY2FyLCBrZXkpIHx8ICFOSUxQIChGZXF1YWwgKGNhciwga2V5KSkpKSkKKyAgICAgICAg YnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNPTlNQIChsaXN0 KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAgICYmIChj YXIgPSBYQ0FSIChYQ0FSIChsaXN0KSksCisgICAgICAgICAgICAgICAgICBFUSAoY2FyLCBrZXkp IHx8ICFOSUxQIChGZXF1YWwgKGNhciwga2V5KSkpKSkKKyAgICAgICAgYnJlYWs7CisgICAgICBs aXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KQorICAgICAgICAgIHx8 IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAgICYmIChjYXIgPSBYQ0FSIChYQ0FS IChsaXN0KSksCisgICAgICAgICAgICAgICAgICBFUSAoY2FyLCBrZXkpIHx8ICFOSUxQIChGZXF1 YWwgKGNhciwga2V5KSkpKSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlz dCk7CisgICAgfQorICBpZiAoQ09OU1AgKGxpc3QpKQorICAgIHJldHVybiBYQ0FSIChsaXN0KTsK KyAgICBlbHNlCisgICAgICByZXR1cm4gUW5pbDsKK30KKworTGlzcF9PYmplY3QKK21jX3BsaXN0 X2dldCAoTGlzcF9PYmplY3QgcGxpc3QsIExpc3BfT2JqZWN0IHByb3ApCit7CisgIExpc3BfT2Jq ZWN0IHRhaWwsIGhhbGZ0YWlsOworICAvKiBoYWxmdGFpbCBpcyB1c2VkIHRvIGRldGVjdCBjaXJj dWxhciBsaXN0cy4gICovCisgIHRhaWwgPSBoYWxmdGFpbCA9IHBsaXN0OworICB3aGlsZSAoQ09O U1AgKHRhaWwpICYmIENPTlNQIChYQ0RSICh0YWlsKSkpCisgICAgeworICAgICAgaWYgKEVRIChw cm9wLCBYQ0FSICh0YWlsKSkpCisgICAgICAgIHJldHVybiBYQ0FSIChYQ0RSICh0YWlsKSk7Cisg ICAgICB0YWlsID0gWENEUiAoWENEUiAodGFpbCkpOworICAgICAgaGFsZnRhaWwgPSBYQ0RSICho YWxmdGFpbCk7CisgICAgICBpZiAoRVEgKHRhaWwsIGhhbGZ0YWlsKSkKKyAgICAgICAgYnJlYWs7 CisgICAgfQorICByZXR1cm4gUW5pbDsKK30KKworLyogUkVHSU9OIEJFR0lOOiAgbWNfcmVnaW9u X2xpbWl0ICgxKQorICAgUkVHSU9OIEVORDogIG1jX3JlZ2lvbl9saW1pdCAoMCkgKi8KK3B0cmRp ZmZfdAorbWNfcmVnaW9uX2xpbWl0IChib29sIGJlZ2luX3ApCit7CisgIGlmICghTklMUCAoVnRy YW5zaWVudF9tYXJrX21vZGUpCisgICAgICAmJiBOSUxQIChWbWFya19ldmVuX2lmX2luYWN0aXZl KQorICAgICAgJiYgTklMUCAoQlZBUiAoY3VycmVudF9idWZmZXIsIG1hcmtfYWN0aXZlKSkpCisg ICAgeHNpZ25hbDAgKFFtYXJrX2luYWN0aXZlKTsKKyAgTGlzcF9PYmplY3QgbWFya2VyID0gQlZB UiAoY3VycmVudF9idWZmZXIsIG1hcmspOworICBpbnQgbSA9IChYTUFSS0VSIChtYXJrZXIpLT5i dWZmZXIpCisgICAgICAgICAgPyBYTUFSS0VSIChtYXJrZXIpLT5jaGFycG9zCisgICAgICAgICAg OiAtMTsKKyAgcmV0dXJuIChtID09IC0xKQorICAgICAgICAgICA/IC0xCisgICAgICAgICA6IChQ VCA8IG0pID09IGJlZ2luX3AKKyAgICAgICAgICAgPyBQVAorICAgICAgICAgOiBjbGlwX3RvX2Jv dW5kcyAoQkVHViwgbSwgWlYpOworfQorCisvKiBDaGVjayB0aGUgcHJlc2VuY2Ugb2YgYSBkaXNw bGF5IHByb3BlcnR5IGFuZCBjb21wdXRlIGl0cyB3aWR0aC4KKyAgIElmIGEgcHJvcGVydHkgd2Fz IGZvdW5kIGFuZCBpdHMgd2lkdGggd2FzIGZvdW5kIGFzIHdlbGwsIHJldHVybgorICAgaXRzIHdp ZHRoICg+PSAwKSBhbmQgc2V0IHRoZSBwb3NpdGlvbiBvZiB0aGUgZW5kIG9mIHRoZSBwcm9wZXJ0 eQorICAgaW4gRU5EUE9TLgorICAgT3RoZXJ3aXNlIGp1c3QgcmV0dXJuIC0xLiAqLworc3RhdGlj IGludAorbWNfY2hlY2tfZGlzcGxheV93aWR0aCAocHRyZGlmZl90IHBvcywgcHRyZGlmZl90IGNv bCwgcHRyZGlmZl90ICplbmRwb3MpCit7CisgIExpc3BfT2JqZWN0IHZhbCwgb3ZlcmxheTsKKyAg aWYgKENPTlNQICh2YWwgPSBnZXRfY2hhcl9wcm9wZXJ0eV9hbmRfb3ZlcmxheQorICAgICAgICAg ICAgICAobWFrZV9maXhudW0gKHBvcyksIFFkaXNwbGF5LCBRbmlsLCAmb3ZlcmxheSkpCisgICAg ICAmJiBFUSAoUXNwYWNlLCBYQ0FSICh2YWwpKSkKKyAgICB7IC8qIEZJWE1FOiBVc2UgY2FsY19w aXhlbF93aWR0aF9vcl9oZWlnaHQuICovCisgICAgICBMaXNwX09iamVjdCBwbGlzdCA9IFhDRFIg KHZhbCksIHByb3A7CisgICAgICBpbnQgd2lkdGggPSAtMTsKKyAgICAgIEVNQUNTX0lOVCBhbGln bl90b19tYXggPSAoY29sIDwgTU9TVF9QT1NJVElWRV9GSVhOVU0gLSBJTlRfTUFYCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IChFTUFDU19JTlQpIElOVF9NQVggKyBjb2wKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTU9TVF9QT1NJVElWRV9GSVhOVU0pOwor ICAgICAgaWYgKChwcm9wID0gbWNfcGxpc3RfZ2V0IChwbGlzdCwgUUN3aWR0aCksIFJBTkdFRF9G SVhOVU1QICgwLCBwcm9wLCBJTlRfTUFYKSkKKyAgICAgICAgICB8fCAocHJvcCA9IG1jX3BsaXN0 X2dldCAocGxpc3QsIFFDcmVsYXRpdmVfd2lkdGgpLAorICAgICAgICAgICAgICBSQU5HRURfRklY TlVNUCAoMCwgcHJvcCwgSU5UX01BWCkpKQorICAgICAgICB3aWR0aCA9IFhGSVhOVU0gKHByb3Ap OworICAgICAgICBlbHNlIGlmIChGTE9BVFAgKHByb3ApICYmIDAgPD0gWEZMT0FUX0RBVEEgKHBy b3ApCisgICAgICAgICAgICAgICAgICYmIFhGTE9BVF9EQVRBIChwcm9wKSA8PSBJTlRfTUFYKQor ICAgICAgICAgIHdpZHRoID0gKGludCkoWEZMT0FUX0RBVEEgKHByb3ApICsgMC41KTsKKyAgICAg ICAgICBlbHNlIGlmICgocHJvcCA9IG1jX3BsaXN0X2dldCAocGxpc3QsIFFDYWxpZ25fdG8pLAor ICAgICAgICAgICAgICAgICAgICBSQU5HRURfRklYTlVNUCAoY29sLCBwcm9wLCBhbGlnbl90b19t YXgpKSkKKyAgICAgICAgICAgIHdpZHRoID0gWEZJWE5VTSAocHJvcCkgLSBjb2w7CisgICAgICAg ICAgICAgIGVsc2UgaWYgKEZMT0FUUCAocHJvcCkgJiYgY29sIDw9IFhGTE9BVF9EQVRBIChwcm9w KQorICAgICAgICAgICAgICAgICAgICAgICAmJiAoWEZMT0FUX0RBVEEgKHByb3ApIDw9IGFsaWdu X3RvX21heCkpCisgICAgICAgICAgICAgICAgd2lkdGggPSAoaW50KShYRkxPQVRfREFUQSAocHJv cCkgKyAwLjUpIC0gY29sOworICAgICAgaWYgKHdpZHRoID49IDApCisgICAgICAgIHsKKyAgICAg ICAgICBwdHJkaWZmX3Qgc3RhcnQ7CisgICAgICAgICAgaWYgKE9WRVJMQVlQIChvdmVybGF5KSkK KyAgICAgICAgICAgICplbmRwb3MgPSBPVkVSTEFZX1BPU0lUSU9OIChPVkVSTEFZX0VORCAob3Zl cmxheSkpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBnZXRfcHJvcGVydHlfYW5k X3JhbmdlIChwb3MsIFFkaXNwbGF5LCAmdmFsLCAmc3RhcnQsIGVuZHBvcywgUW5pbCk7CisgICAg ICAgICAgLyogRm9yIDpyZWxhdGl2ZS13aWR0aCwgd2UgbmVlZCB0byBtdWx0aXBseSBieSB0aGUg Y29sdW1uCisgICAgICAgICAgICAgd2lkdGggb2YgdGhlIGNoYXJhY3RlciBhdCBQT1MsIGlmIGl0 IGlzIGdyZWF0ZXIgdGhhbiAxLiAqLworICAgICAgICAgIGlmICghTklMUCAobWNfcGxpc3RfZ2V0 IChwbGlzdCwgUUNyZWxhdGl2ZV93aWR0aCkpCisgICAgICAgICAgICAgICYmICFOSUxQIChCVkFS IChjdXJyZW50X2J1ZmZlciwgZW5hYm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CBs aW1pdCwgc3RydWN0IHdpbmRvdyAqd2luLCBzdHJ1Y3QgZmFjZSAqZmFjZSwKKyAgICAgICAgICAg ICAgICAgIExpc3BfT2JqZWN0IHN0cmluZykKK3sKKyAgcHRyZGlmZl90IGNvdW50ID0gU1BFQ1BE TF9JTkRFWCAoKTsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3aW4tPmZyYW1lKTsKKyAg TGlzcF9PYmplY3QgcG9zID0gbWFrZV9maXhudW0gKGNoYXJwb3MpOworICBwdHJkaWZmX3QgdG87 CisgIHB0cmRpZmZfdCBwdCA9IFBULCBwdF9ieXRlID0gUFRfQllURTsKKyAgTGlzcF9PYmplY3Qg cmUsIGZvbnRfb2JqZWN0LCBsZ3N0cmluZzsKKyAgcHRyZGlmZl90IGxlbjsKKyAgcmVjb3JkX3Vu d2luZF9zYXZlX21hdGNoX2RhdGEgKCk7CisgIHJlID0gQVJFRiAocnVsZSwgMCk7CisgIGlmIChO SUxQIChyZSkpCisgICAgbGVuID0gMTsKKyAgZWxzZSBpZiAoISBTVFJJTkdQIChyZSkpCisgICAg cmV0dXJuIHVuYmluZF90byAoY291bnQsIFFuaWwpOworICBlbHNlIGlmICgobGVuID0gZmFzdF9s b29raW5nX2F0IChyZSwgY2hhcnBvcywgYnl0ZXBvcywgbGltaXQsIC0xLCBzdHJpbmcpKQorICAg ICAgICAgICA+IDApCisgICAgeworICAgICAgaWYgKE5JTFAgKHN0cmluZykpCisgICAgICAgIGxl biA9IEJZVEVfVE9fQ0hBUiAoYnl0ZXBvcyArIGxlbikgLSBjaGFycG9zOworICAgICAgZWxzZQor ICAgICAgICBsZW4gPSBzdHJpbmdfYnl0ZV90b19jaGFyIChzdHJpbmcsIGJ5dGVwb3MgKyBsZW4p IC0gY2hhcnBvczsKKyAgICB9CisgIGlmIChsZW4gPD0gMCkKKyAgICByZXR1cm4gdW5iaW5kX3Rv IChjb3VudCwgUW5pbCk7CisgIHRvID0gbGltaXQgPSBjaGFycG9zICsgbGVuOworI2lmZGVmIEhB VkVfV0lORE9XX1NZU1RFTQorICBpZiAoRlJBTUVfV0lORE9XX1AgKGYpKQorICAgIHsKKyAgICAg IGZvbnRfb2JqZWN0ID0gZm9udF9yYW5nZSAoY2hhcnBvcywgYnl0ZXBvcywgJnRvLCB3aW4sIGZh Y2UsIHN0cmluZyk7CisgICAgICBpZiAoISBGT05UX09CSkVDVF9QIChmb250X29iamVjdCkKKyAg ICAgICAgICB8fCAoISBOSUxQIChyZSkKKyAgICAgICAgICAgICAgJiYgdG8gPCBsaW1pdAorICAg ICAgICAgICAgICAmJiAoZmFzdF9sb29raW5nX2F0IChyZSwgY2hhcnBvcywgYnl0ZXBvcywgdG8s IC0xLCBzdHJpbmcpIDw9IDApKSkKKyAgICAgICAgcmV0dXJuIHVuYmluZF90byAoY291bnQsIFFu aWwpOworICAgIH0KKyAgZWxzZQorI2VuZGlmICAgICAgICAvKiBub3QgSEFWRV9XSU5ET1dfU1lT VEVNICovCisgICAgZm9udF9vYmplY3QgPSB3aW4tPmZyYW1lOworICBsZ3N0cmluZyA9IEZjb21w b3NpdGlvbl9nZXRfZ3N0cmluZyAocG9zLCBtYWtlX2ZpeG51bSAodG8pLCBmb250X29iamVjdCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmluZyk7CisgIGlmIChO SUxQIChMR1NUUklOR19JRCAobGdzdHJpbmcpKSkKKyAgICB7CisgICAgICAvKiBTYXZlIHBvaW50 IGFzIG1hcmtlciBiZWZvcmUgY2FsbGluZyBvdXQgdG8gbGlzcC4gICovCisgICAgICBpZiAoTklM UCAoc3RyaW5nKSkKKyAgICAgICAgcmVjb3JkX3Vud2luZF9wcm90ZWN0IChyZXN0b3JlX3BvaW50 X3Vud2luZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBidWlsZF9tYXJrZXIgKGN1 cnJlbnRfYnVmZmVyLCBwdCwgcHRfYnl0ZSkpOworICAgICAgbGdzdH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Bvc2l0aW9u X2l0ICpjbXBfaXQsIHB0cmRpZmZfdCBjaGFycG9zLAorICAgICAgICAgICAgICAgICAgICAgICAg ICBwdHJkaWZmX3QgYnl0ZXBvcywgcHRyZGlmZl90IGVuZHBvcywgc3RydWN0IHdpbmRvdyAqdywK KyAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmZhY2UsIExpc3BfT2JqZWN0 IHN0cmluZykKK3sKKyAgaWYgKGNtcF9pdC0+Y2ggPT0gLTIpCisgICAgeworICAgICAgY29tcG9z aXRpb25fY29tcHV0ZV9zdG9wX3BvcyAoY21wX2l0LCBjaGFycG9zLCBieXRlcG9zLCBlbmRwb3Ms IHN0cmluZyk7CisgICAgICBpZiAoY21wX2l0LT5jaCA9PSAtMiB8fCBjbXBfaXQtPnN0b3BfcG9z ICE9IGNoYXJwb3MpCisgICAgICAgIC8qIFRoZSBjdXJyZW50IHBvc2l0aW9uIGlzIG5vdCBjb21w b3NlZC4gICovCisgICAgICAgIHJldHVybiAwOworICAgIH0KKyAgaWYgKGVuZHBvcyA8IDApCisg ICAgZW5kcG9zID0gTklMUCAoc3RyaW5nKSA/IEJFR1YgOiAwOworICBpZiAoY21wX2l0LT5jaCA8 IDApCisgICAgeworICAgICAgLyogV2UgYXJlIGxvb2tpbmcgYXQgYSBzdGF0aWMgY29tcG9zaXRp b24uICAqLworICAgICAgcHRyZGlmZl90IHN0YXJ0LCBlbmQ7CisgICAgICBMaXNwX09iamVjdCBw cm9wOworICAgICAgZmluZF9jb21wb3NpdGlvbiAoY2hhcnBvcywgLTEsICZzdGFydCwgJmVuZCwg JnByb3AsIHN0cmluZyk7CisgICAgICBjbXBfaXQtPmlkID0gZ2V0X2NvbXBvc2l0aW9uX2lkIChj aGFycG9zLCBieXRlcG9zLCBlbmQgLSBzdGFydCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHByb3AsIHN0cmluZyk7CisgICAgICBpZiAoY21wX2l0LT5pZCA8IDApCisg ICAgICAgIGdvdG8gbm9fY29tcG9zaXRpb247CisgICAgICBjbXBfaXQtPm5jaGFycyA9IGVuZCAt IHN0YXJ0OworICAgICAgY21wX2l0LT5uZ2x5cGhzID0gY29tcG9zaXRpb25fdGFibGVbY21wX2l0 LT5pZF0tPmdseXBoX2xlbjsKKyAgICB9CisgIGVsc2UgaWYgKHcpCisgICAgeworICAgICAgTGlz cF9PYmplY3QgbGdzdHJpbmcgPSBRbmlsOworICAgICAgTGlzcF9PYmplY3QgdmFsLCBlbHQ7Cisg ICAgICBwdHJkaWZmX3QgaTsKKyAgICAgIHZhbCA9IENIQVJfVEFCTEVfUkVGIChWY29tcG9zaXRp b25fZnVuY3Rpb25fdGFibGUsIGNtcF9pdC0+Y2gpOworICAgICAgZm9yIChpID0gMDsgaSA8IGNt cF9pdC0+cnVsZV9pZHg7IGkrKywgdmFsID0gWENEUiAodmFsKSk7CisgICAgICBpZiAoY2hhcnBv cyA8IGVuZHBvcykKKyAgICAgICAgeworICAgICAgICAgIGZvciAoOyBDT05TUCAodmFsKTsgdmFs ID0gWENEUiAodmFsKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgZWx0ID0gWENBUiAo dmFsKTsKKyAgICAgICAgICAgICAgaWYgKCEgVkVDVE9SUCAoZWx0KSB8fCBBU0laRSAoZWx0KSAh PSAzCisgICAgICAgICAgICAgICAgICB8fCAhIElOVEVHRVJQIChBUkVGIChlbHQsIDEpKSkKKyAg ICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgaWYgKFhGSVhOQVQgKEFSRUYg KGVsdCwgMSkpICE9IGNtcF9pdC0+bG9va2JhY2spCisgICAgICAgICAgICAgICAgZ290byBub19j b21wb3NpdGlvbjsKKyAgICAgICAgICAgICAgbGdzdHJpbmcgPSBtY19hdXRvY21wX2NoYXJzIChl bHQsIGNoYXJwb3MsIGJ5dGVwb3MsIGVuZHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICB3LCBmYWNlLCBzdHJpbmcpOworICAgICAgICAgICAgICBpZiAoY29tcG9z aXRpb25fZ3N0cmluZ19wIChsZ3N0cmluZykpCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAg ICAgICAgICAgIGxnc3RyaW5nID0gUW5pbDsKKyAgICAgICAgICAgICAgLyogQ29tcG9zaXRpb24g ZmFpbGVkIHBlcmhhcHMgYmVjYXVzZSB0aGUgZm9udCBkb2Vzbid0CisgICAgICAgICAgICAgICAg IHN1cHBvcnQgc3VmZmljaWVudCByYW5nZSBvZiBjaGFyYWN0ZXJzLiAgVHJ5IHRoZQorICAgICAg ICAgICAgICAgICBvdGhlciBjb21wb3NpdGlvbiBydWxlcyBpZiBhbnkuICAqLworICAgICAgICAg ICAgfQorICAgICAgICAgIGNtcF9pdC0+cmV2ZXJzZWRfcCA9IDA7CisgICAgICAgIH0KKyAgICAg IGVsc2UKKyAgICAgICAgeworICAgICAgICAgIHB0cmRpZmZfdCBjcG9zID0gY2hhcnBvcywgYnBv cyA9IGJ5dGVwb3M7CisgICAgICAgICAgY21wX2l0LT5yZXZlcnNlZF9wID0gMTsKKyAgICAgICAg ICBlbHQgPSBYQ0FSICh2YWwpOworICAgICAgICAgIGlmIChjbXBfaXQtPmxvb2tiYWNrID4gMCkK KyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY3BvcyA9IGNoYXJwb3MgLSBjbXBfaXQtPmxv b2tiYWNrOworICAgICAgICAgICAgICBpZiAoU1RSSU5HUCAoc3RyaW5nKSkKKyAgICAgICAgICAg ICAgICBicG9zID0gc3RyaW5nX2NoYXJfdG9fYnl0ZSAoc3RyaW5nLCBjcG9zKTsKKyAgICAgICAg ICAgICAgZWxzZQorICAgICAgICAgICAgICAgIGJwb3MgPSBDSEFSX1RPX0JZVEUgKGNwb3MpOwor ICAgICAgICAgICAgfQorICAgICAgICAgIGxnc3RyaW5nID0gbWNfYXV0b2NtcF9jaGFycyAoZWx0 LCBjcG9zLCBicG9zLCBjaGFycG9zICsgMSwgdywgZmFjZSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHN0cmluZyk7CisgICAgICAgICAgaWYgKCEgY29tcG9zaXRpb25fZ3N0 cmluZ19wIChsZ3N0cmluZykKKyAgICAgICAgICAgICAgfHwgY3BvcyArIExHU1RSSU5HX0NIQVJf TEVOIChsZ3N0cmluZykgLSAxICE9IGNoYXJwb3MpCisgICAgICAgICAgICAvKiBDb21wb3NpdGlv biBmYWlsZWQgb3IgZGlkbid0IGNvdmVyIHRoZSBjdXJyZW50CisgICAgICAgICAgICAgICBjaGFy YWN0ZXIuICAqLworICAgICAgICAgICAgZ290byBub19jb21wb3NpdGlvbjsKKyAgICAgICAgfQor ICAgICAgaWYgKE5JTFAgKGxnc3RyaW5nKSkKKyAgICAgICAgZ290byBub19jb21wb3NpdGlvbjsK KyAgICAgIGlmIChOSUxQIChMR1NUUklOR19JRCAobGdzdHJpbmcpKSkKKyAgICAgICAgbGdzdHJp bmcgPSBjb21wb3NpdGlvbl9nc3RyaW5nX3B1dF9jYWNoZSAobGdzdHJpbmcsIC0xKTsKKyAgICAg IGNtcF9pdC0+aWQgPSBYRklYTlVNIChMR1NUUklOR19JRCAobGdzdHJpbmcpKTsKKyAgICAgIGZv ciAoaSA9IDA7IGkgPCBMR1NUUklOR19HTFlQSF9MRU4gKGxnc3RyaW5nKTsgaSsrKQorICAgICAg ICBpZiAoTklMUCAoTEdTVFJJTkdfR0xZUEggKGxnc3RyaW5nLCBpKSkpCisgICAgICAgICAgYnJl YWs7CisgICAgICBjbXBfaXQtPm5nbHlwaHMgPSBpOworICAgICAgY21wX2l0LT5mcm9tID0gMDsK KyAgICAgIGNtcF9pdC0+dG8gPSBpOworICAgIH0KKyAgZWxzZQorICAgIGdvdG8gbm9fY29tcG9z aXRpb247CisgIHJldHVybiAxOworIG5vX2NvbXBvc2l0aW9uOgorICBpZiAoY2hhcnBvcyA9PSBl bmRwb3Mp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zY2FuX2J5dGUgPSBDSEFSX1RPX0JZVEUgKHNjYW4pOworICAgICAgICAgIGlmIChzY2Fu ID49IGVuZCkKKyAgICAgICAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgfQorICAgICAgLyog VGVzdCByZWFjaGluZyB0aGUgZ29hbCBjb2x1bW4uICBXZSBkbyB0aGlzIGFmdGVyIHNraXBwaW5n CisgICBpbnZpc2libGUgY2hhcmFjdGVycywgc28gdGhhdCB3ZSBwdXQgcG9pbnQgYmVmb3JlIHRo ZQorICAgY2hhcmFjdGVyIG9uIHdoaWNoIHRoZSBjdXJzb3Igd2lsbCBhcHBlYXIuICovCisgICAg ICBpZiAoY29sID49IGdvYWwpCisgICAgICAgIGJyZWFrOworICAgICAgcHJldl9jb2wgPSBjb2w7 CisgICAgICB7IC8qIENoZWNrIGRpc3BsYXkgcHJvcGVydHkuICovCisgICAgICAgIHB0cmRpZmZf dCBlbmRwOworICAgICAgICBpbnQgd2lkdGggPSBtY19jaGVja19kaXNwbGF5X3dpZHRoIChzY2Fu LCBjb2wsICZlbmRwKTsKKyAgICAgICAgaWYgKHdpZHRoID49IDApCisgICAgICAgICAgeworICAg ICAgICAgICAgY29sICs9IHdpZHRoOworICAgICAgICAgICAgaWYgKGVuZHAgPiBzY2FuKSAvKiBB dm9pZCBpbmZpbml0ZSBsb29wcyB3aXRoIDAtd2lkdGggb3ZlcmxheXMuICovCisgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICBzY2FuID0gZW5kcDsKKyAgICAgICAgICAgICAgICBzY2Fu X2J5dGUgPSBDSEFSX1RPX0JZVEUgKHNjYW4pOworICAgICAgICAgICAgICAgIGNvbnRpbnVlOwor ICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgfQorICAgICAgLyogQ2hlY2sgY29t cG9zaXRpb24gc2VxdWVuY2UuICovCisgICAgICBpZiAoY21wX2l0LmlkID49IDAKKyAgICAgICAg ICB8fCAoc2NhbiA9PSBjbXBfaXQuc3RvcF9wb3MKKyAgICAgICAgICAgICAgJiYgbWNfY29tcG9z aXRpb25fcmVzZWF0X2l0ICgmY21wX2l0LCBzY2FuLCBzY2FuX2J5dGUsIGVuZCwgdywgTlVMTCwg UW5pbCkpKQorICAgICAgICBjb21wb3NpdGlvbl91cGRhdGVfaXQgKCZjbXBfaXQsIHNjYW4sIHNj YW5fYnl0ZSwgUW5pbCk7CisgICAgICBpZiAoY21wX2l0LmlkID49IDApCisgICAgICAgIHsKKyAg ICAgICAgICBzY2FuICs9IGNtcF9pdC5uY2hhcnM7CisgICAgICAgICAgc2Nhbl9ieXRlICs9IGNt cF9pdC5uYnl0ZXM7CisgICAgICAgICAgaWYgKHNjYW4gPD0gZW5kKQorICAgICAgICAgICAgY29s ICs9IGNtcF9pdC53aWR0aDsKKyAgICAgICAgICBpZiAoY21wX2l0LnRvID09IGNtcF9pdC5uZ2x5 cGhzKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBjbXBfaXQuaWQgPSAtMTsKKyAgICAg ICAgICAgICAgY29tcG9zaXRpb25fY29tcHV0ZV9zdG9wX3BvcyAoJmNtcF9pdCwgc2Nhbiwgc2Nh bl9ieXRlLCBlbmQsIFFuaWwpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICBjbXBfaXQuZnJvbSA9IGNtcF9pdC50bzsKKyAgICAgICAgICBjb250aW51ZTsK KyAgICAgICAgfQorICAgICAgYyA9IEZFVENIX0JZVEUgKHNjYW5fYnl0ZSk7CisgICAgICAvKiBT ZWUgaWYgdGhlcmUgaXMgYSBkaXNwbGF5IHRhYmxlIGFuZCBpdCByZWxhdGVzIHRvIHRoaXMgY2hh cmFjdGVyLiAqLworICAgICAgaWYgKGRwICE9IDAKKyAgICAgICAgICAmJiAhIChtdWx0aWJ5dGUg JiYgTEVBRElOR19DT0RFX1AgKGMpKQorICAgICAgICAgICYmIFZFQ1RPUlAgKERJU1BfQ0hBUl9W RUNUT1IgKGRwLCBjKSkpCisgICAgICAgIHsKKyAgICAgICAgICBMaXNwX09iamVjdCBjaGFydmVj OworICAgICAgICAgIHB0cmRpZmZfdCBpLCBuOworICAgICAgICAgIC8qIFRoaXMgY2hhcmFjdGVy IGlzIGRpc3BsYXllZCB1c2luZyBhIHZlY3RvciBvZiBnbHlwaHMuCisgICAgICAgICAgICAgVXBk YXRlIHRoZSBjb2x1bW4vcG9zaXRpb24gYmFzZWQgb24gdGhvc2UgZ2x5cGhzLiAqLworICAgICAg ICAgIGNoYXJ2ZWMgPSBESVNQX0NIQVJfVkVDVE9SIChkcCwgYyk7CisgICAgICAgICAgbiA9IEFT SVpFIChjaGFydmVjKTsKKyAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgbjsgaSsrKQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICAvKiBUaGlzIHNob3VsZCBiZSBoYW5kbGVkIHRoZSBzYW1l IGFzCisgICAgICAgICAgICAgIG5leHRfZWxlbWVudF9mcm9tX2Rpc3BsYXlfdmVjdG9yIGRvZXMg aXQuICovCisgICAgICAgICAgICAgIExpc3BfT2JqZWN0IGVudHJ5ID0gQVJFRiAoY2hhcnZlYywg aSk7CisgICAgICAgICAgICAgIGlmIChHTFlQSF9DT0RFX1AgKGVudHJ5KSkKKyAgICAgICAgICAg ICAgICBjID0gR0xZUEhfQ09ERV9DSEFSIChlbnRyeSk7CisgICAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgICBjID0gJyAnOworICAgICAgICAgICAgICBpZiAoYyA9PSAnXG4nKQorICAg ICAgICAgICAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgICAgICAgaWYgKGMgPT0gJ1xyJyAm JiBFUSAoQlZBUiAoY3VycmVudF9idWZmZXIsIHNlbGVjdGl2ZV9kaXNwbGF5KSwgUXQpKQorICAg ICAgICAgICAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgICAgICAgaWYgKGMgPT0gJ1x0JykK KyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBjb2wgKz0gdGFiX3dpZHRoOwor ICAgICAgICAgICAgICAgICAgY29sID0gY29sIC8gdGFiX3dpZHRoICogdGFiX3dpZHRoOworICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAr K2NvbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAg eworICAgICAgICAgICAgLyogVGhlIGRpc3BsYXkgdGFibGUgZG9lc24ndCBhZmZlY3QgdGhpcyBj aGFyYWN0ZXI7CisgICAgICAgICAgICAgICBpdCBkaXNwbGF5cyBhcyBpdHNlbGYuICovCisgICAg ICAgICAgICBpZiAoYyA9PSAnXG4nKQorICAgICAgICAgICAgICBnb3RvIGVuZGxvb3A7CisgICAg ICAgICAgICBpZiAoYyA9PSAnXHInICYmIEVRIChCVkFSIChjdXJyZW50X2J1ZmZlciwgc2VsZWN0 aXZlX2Rpc3BsYXkpLCBRdCkpCisgICAgICAgICAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAg ICAgIGlmIChjID09ICdcdCcpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjb2wg Kz0gdGFiX3dpZHRoOworICAgICAgICAgICAgICAgIGNvbCA9IGNvbCAvIHRhYl93aWR0aCAqIHRh Yl93aWR0aDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlIGlmIChtdWx0aWJ5 dGUgJiYgTEVBRElOR19DT0RFX1AgKGMpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICAgIC8qIFN0YXJ0IG9mIG11bHRpLWJ5dGUgZm9ybS4gKi8KKyAgICAgICAgICAgICAgICAg IHVuc2lnbmVkIGNoYXIgKnB0cjsKKyAgICAgICAgICAgICAgICAgIGludCBieXRlcywgd2lkdGg7 CisgICAgICAgICAgICAgICAgICBwdHIgPSBCWVRFX1BPU19BRERSIChzY2FuX2J5dGUpOworICAg ICAgICAgICAgICAgICAgTUNfTVVMVElCWVRFX0JZVEVTX1dJRFRIIChwdHIsIGRwLCBieXRlcywg d2lkdGgpOworICAgICAgICAgICAgICAgICAgLyogU3VidHJhY3Qgb25lIHRvIGNvbXBlbnNhdGUg Zm9yIHRoZSBpbmNyZW1lbnQKKyAgICAgICAgICAgICAgICAgIHRoYXQgaXMgZ29pbmcgdG8gaGFw cGVuIGJlbG93LiAqLworICAgICAgICAgICAgICAgICAgc2Nhbl9ieXRlICs9IGJ5dGVzIC0gMTsK KyAgICAgICAgICAgICAgICAgIGNvbCArPSB3aWR0aDsKKyAgICAgICAgICAgICAgICB9CisgICAg ICAgICAgICAgICAgZWxzZSBpZiAoY3RsX2Fycm93ICYmIChjIDwgMDQwIHx8IGMgPT0gMDE3Nykp CisgICAgICAgICAgICAgICAgICBjb2wgKz0gMjsKKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYg KGMgPCAwNDAgfHwgYyA+PSAwMTc3KQorICAgICAgICAgICAgICAgICAgICBjb2wgKz0gNDsKKyAg ICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgIGNvbCsrOworICAg ICAgICAgIH0KKyAgICAgIHNjYW4rKzsKKyAgICAgIHNjYW5fYnl0ZSsrOworICAgIH0KKyBlbmRs b29wOgorICBsYXN0X2tub3duX2NvbHVtbiA9IGNvbDsKKyAgbGFzdF9rbm93bl9jb2x1bW5fcG9p bnQgPSBwdDsKKyAgbGFzdF9rbm93bl9jb2x1bW5fbW9kaWZpZWQgPSBNT0RJRkY7CisgIGlmIChn b2FsY29sKQorICAgICpnb2FsY29sID0gY29sOworICBpZiAoZW5kcG9zKQorICAgICplbmRwb3Mg PSBzY2FuOworICBpZiAocHJldmNvbCkKKyAgICAqcHJldmNvbCA9IHByZXZfY29sOworfQorCitw dHJkaWZmX3QKK21jX2N1cnJlbnRfY29sdW1uIChzdHJ1Y3Qgd2luZG93ICp3LCBwdH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2ludC4gKi8KKyAgcHRyID0gQllURV9QT1NfQUREUiAoQ0hBUl9UT19CWVRFIChwdCkgLSAx KSArIDE7CisgIC8qIE1ha2UgYSBwb2ludGVyIHRvIHdoZXJlIGNvbnNlY3V0aXZlIGNoYXJzIGxl YXZlIG9mZiwKKyAgICAgZ29pbmcgYmFja3dhcmRzIGZyb20gcG9pbnQuICovCisgIGlmIChwdCA9 PSBCRUdWKQorICAgIHN0b3AgPSBwdHI7CisgICAgZWxzZSBpZiAocHQgPD0gR1BUIHx8IEJFR1Yg PiBHUFQpCisgICAgICBzdG9wID0gQkVHVl9BRERSOworICAgICAgZWxzZQorICAgICAgICBzdG9w ID0gR0FQX0VORF9BRERSOworICBjb2wgPSAwLCB0YWJfc2VlbiA9IDAsIHBvc3RfdGFiID0gMDsK KyAgd2hpbGUgKDEpCisgICAgeworICAgICAgcHRyZGlmZl90IGksIG47CisgICAgICBMaXNwX09i amVjdCBjaGFydmVjOworICAgICAgaWYgKHB0ciA9PSBzdG9wKQorICAgICAgICB7CisgICAgICAg ICAgLyogV2Ugc3RvcHBlZCBlaXRoZXIgZm9yIHRoZSBiZWdpbm5pbmcgb2YgdGhlIGJ1ZmZlcgor ICAgICAgICAgICAgIG9yIGZvciB0aGUgZ2FwLiAqLworICAgICAgICAgIGlmIChwdHIgPT0gQkVH Vl9BRERSKQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgLyogSXQgd2FzIHRoZSBnYXAu ICBKdW1wIGJhY2sgb3ZlciBpdC4gKi8KKyAgICAgICAgICBzdG9wID0gQkVHVl9BRERSOworICAg ICAgICAgIHB0ciA9IEdQVF9BRERSOworICAgICAgICAgIC8qIENoZWNrIHdoZXRoZXIgdGhhdCBi cmluZ3MgdXMgdG8gYmVnaW5uaW5nIG9mIGJ1ZmZlci4gKi8KKyAgICAgICAgICBpZiAoQkVHViA+ PSBHUFQpCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgYyA9ICotLXB0cjsK KyAgICAgIGlmIChkcCAmJiBWRUNUT1JQIChESVNQX0NIQVJfVkVDVE9SIChkcCwgYykpKQorICAg ICAgICB7CisgICAgICAgICAgY2hhcnZlYyA9IERJU1BfQ0hBUl9WRUNUT1IgKGRwLCBjKTsKKyAg ICAgICAgICBuID0gQVNJWkUgKGNoYXJ2ZWMpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAg ICAgICAgICB7CisgICAgICAgICAgICBjaGFydmVjID0gUW5pbDsKKyAgICAgICAgICAgIG4gPSAx OworICAgICAgICAgIH0KKyAgICAgIGZvciAoaSA9IG4gLSAxOyBpID49IDA7IC0taSkKKyAgICAg ICAgeworICAgICAgICAgIGlmIChWRUNUT1JQIChjaGFydmVjKSkKKyAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgLyogVGhpcyBzaG91bGQgYmUgaGFuZGxlZCB0aGUgc2FtZSBhcworICAgICAg ICAgICBuZXh0X2VsZW1lbnRfZnJvbV9kaXNwbGF5X3ZlY3RvciBkb2VzIGl0LiAqLworICAgICAg ICAgICAgICBMaXNwX09iamVjdCBlbnRyeSA9IEFSRUYgKGNoYXJ2ZWMsIGkpOworICAgICAgICAg ICAgICBpZiAoR0xZUEhfQ09ERV9QIChlbnRyeSkpCisgICAgICAgICAgICAgICAgYyA9IEdMWVBI X0NPREVfQ0hBUiAoZW50cnkpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAg ICAgIGMgPSAnICc7CisgICAgICAgICAgICB9CisgICAgICAgICAgaWYgKGMgPj0gMDQwICYmIGMg PCAwMTc3KQorICAgICAgICAgICAgY29sKys7CisgICAgICAgICAgICBlbHNlIGlmIChjID09ICdc bicKKyAgICAgICAgICAgICAgICAgICAgIHx8IChjID09ICdccicKKyAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBFUSAoQlZBUiAoY3VycmVudF9idWZmZXIsIHNlbGVjdGl2ZV9kaXNwbGF5KSwg UXQpKSkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHB0cisrOworICAgICAgICAg ICAgICAgIGdvdG8gc3RhcnRfb2ZfbGluZV9mb3VuZDsKKyAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgICBlbHNlIGlmIChjID09ICdcdCcpCisgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgaWYgKHRhYl9zZWVuKQorICAgICAgICAgICAgICAgICAgICBjb2wgPSAoKGNvbCAr IHRhYl93aWR0aCkgLyB0YWJfd2lkdGgpICogdGFiX3dpZHRoOworICAgICAgICAgICAgICAgICAg cG9zdF90YWIgKz0gY29sOworICAgICAgICAgICAgICAgICAgY29sID0gMDsKKyAgICAgICAgICAg ICAgICAgIHRhYl9zZWVuID0gMTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAg ZWxzZSBpZiAoVkVDVE9SUCAoY2hhcnZlYykpCisgICAgICAgICAgICAgICAgICAvKiBXaXRoIGEg ZGlzcGxheSB0YWJsZSBlbnRyeSwgQyBpcyBkaXNwbGF5ZWQgYXMgaXMsIGFuZAorICAgICAgICAg ICAgICAgICAgICAgbm90IGRpc3BsYXllZCBhcyBcTk5OIG9yIGFzIF5OLiAgSWYgQyBpcyBhIHNp bmdsZS1ieXRlCisgICAgICAgICAgICAgICAgICAgICBjaGFyYWN0ZXIsIGl0IHRha2VzIG9uZSBj b2x1bW4uICBJZiBDIGlzIG11bHRpLWJ5dGUgaW4KKyAgICAgICAgICAgICAgICAgICAgIGEgdW5p Ynl0ZSBidWZmZXIsIGl0J3MgdHJhbnNsYXRlZCB0byB1bmlieXRlLCBzbyBpdAorICAgICAgICAg ICAgICAgICAgICAgYWxzbyB0YWtlcyBvbmUgY29sdW1uLiAqLworICAgICAgICAgICAgICAgICAg Kytjb2w7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIGNvbCAr PSAoY3RsX2Fycm93ICYmIGMgPCAwMjAwKSA/IDIgOiA0OworICAgICAgICB9CisgICAgfQorIH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jdCB3aW5kb3cgKncpCit7CisgIExpc3BfT2JqZWN0IHdp bmRvdzsKKyAgWFNFVFdJTkRPVyAod2luZG93LCB3KTsKKyAgcmV0dXJuIFNTREFUQSAoRnByaW4x X3RvX3N0cmluZyAod2luZG93LCBRbmlsKSk7Cit9CisKKy8qIFVTQUdFOiAgZnByaW50ZiAoc3Rk ZXJyLCAiQ0hBUkFDVEVSICglcykiLCBtY19jaGFyX3RvX3N0cmluZyAoZ2x5cGgtPnUuY2gpKTsg Ki8KK2NoYXIgKgorbWNfY2hhcl90b19zdHJpbmcgKGludCBhcmcpCit7CisgIExpc3BfT2JqZWN0 IGNoYXJhY3RlciA9ICgwIDw9IGFyZyAmJiBhcmcgPD0gTUFYX0NIQVIpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IEZjaGFyX3RvX3N0cmluZyAobWFrZV9maXhudW0gKGFyZykpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IFFuaWw7CisgIGNoYXIgKiByZXN1bHQgPSAoIU5JTFAg KGNoYXJhY3RlcikKKyAgICAgICAgICAgICAgICAgICAmJiBhcmcgPT0gOSkKKyAgICAgICAgICAg ICAgICAgICAgPyAiXFx0IgorICAgICAgICAgICAgICAgICAgOiAoIU5JTFAgKGNoYXJhY3RlcikK KyAgICAgICAgICAgICAgICAgICAgICYmIGFyZyA9PSAxMCkKKyAgICAgICAgICAgICAgICAgICAg PyAiXFxuIgorICAgICAgICAgICAgICAgICAgOiAoIU5JTFAgKGNoYXJhY3RlcikKKyAgICAgICAg ICAgICAgICAgICAgICYmIGFyZyA9PSAzMikKKyAgICAgICAgICAgICAgICAgICAgPyAiXFxzIgor ICAgICAgICAgICAgICAgICAgOiAoIU5JTFAgKGNoYXJhY3RlcikKKyAgICAgICAgICAgICAgICAg ICAgICYmIGFyZyAhPSA5CisgICAgICAgICAgICAgICAgICAgICAmJiBhcmcgIT0gMTAKKyAgICAg ICAgICAgICAgICAgICAgICYmIGFyZyAhPSAzMikKKyAgICAgICAgICAgICAgICAgICAgPyBTU0RB VEEgKGNoYXJhY3RlcikKKyAgICAgICAgICAgICAgICAgIDogIlxcPyI7CisgIHJldHVybiByZXN1 bHQ7Cit9CisKK2ludAorbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoTGlzcF9PYmplY3QgYXJnKQor eworICBjaGFyICpzdHI7CisgIGlmIChYVFlQRSAoYXJnKSA9PSBMaXNwX1N0cmluZykKKyAgICBz dHIgPSBTU0RBVEEgKGFyZyk7CisgICAgZWxzZSBpZiAoWFRZUEUgKGFyZykgPT0gTGlzcF9TeW1i b2wpCisgICAgICBzdHIgPSBTU0RBVEEgKFNZTUJPTF9OQU1FIChhcmcpKTsKKyAgICAgIGVsc2Ug cmV0dXJuIC0xOworICBpZiAoIXN0cmNtcCAoc3RyLCAibm8iKSkKKyAgICByZXR1cm4gTUNfTk9f Q1VSU09SOworICBpZiAoIXN0cmNtcCAoc3RyLCAibWMtbGVmdC1mcmluZ2UtYml0bWFwIikpCisg ICAgcmV0dXJuIE1DX0xFRlRfRlJJTkdFX0JJVE1BUDsKKyAgaWYgKCFzdHJjbXAgKHN0ciwgIm1j LXJpZ2h0LWZyaW5nZS1iaXRtYXAiKSkKKyAgICByZXR1cm4gTUNfUklHSFRfRlJJTkdFX0JJVE1B UDsKKyAgaWYgKCFzdHJjbXAgKHN0ciwgImJveCIpKQorICAgIHJldHVybiBNQ19GSUxMRURfQk9Y OworICBpZiAoIXN0cmNtcCAoc3RyLCAiZnJhbWVkIikpCisgICAgcmV0dXJuIE1DX0ZSQU1FRF9C T1g7CisgIGlmICghc3RyY21wIChzdHIsICJob2xsb3ciKSkKKyAgICByZXR1cm4gTUNfSE9MTE9X X0JPWDsKKyAgaWYgKCFzdHJjbXAgKHN0ciwgImJhciIpKQorICAgIHJldHVybiBNQ19CQVI7Cisg IGlmICghc3RyY21wIChzdHIsICJoYmFyIikpCisgICAgcmV0dXJuIE1DX0hCQVI7CisgIHJldHVy biAtMTsKK30KKworLyogVVN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VjdCB3aW5kb3cgKncsIHN0cnVjdCBtY19tYXRyaXggbWF0 cml4KQoreworICBpbnQgdnBvc19hbGxvY2F0ZWQgPSB3LT5tY19tYXRyaXgudnBvc19hbGxvY2F0 ZWQ7CisgIGludCB2cG9zX3VzZWQgPSB3LT5tY19tYXRyaXgudnBvc191c2VkOworICBmcHJpbnRm IChzdGRlcnIsICIlczogIG1hdHJpeC52cG9zX2FsbG9jYXRlZCAoJWQpIHwgbWF0cml4LnZwb3Nf dXNlZCAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgIG1jX3dpbmRvdyAodyksIHZwb3NfYWxs b2NhdGVkLCB2cG9zX3VzZWQpOworICBmb3IgKGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBl ID0gTUNfQ0FDSEU7CisgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICsrY2Fj aGVfdHlwZSkKKyAgICB7CisgICAgICBpbnQgY3Vyc29yc191c2VkID0gdy0+bWNfbWF0cml4LmN1 cnNvcnNfdXNlZFtjYWNoZV90eXBlXTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgbWF0cml4 LmN1cnNvcnNfdXNlZFslc10gKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgbWNfY2Fj aGVfdHlwZV90b19zdHJpbmcgKGNhY2hlX3R5cGUpLCBjdXJzb3JzX3VzZWQpOworICAgIH0KKyAg Zm9yIChpbnQgdm50aCA9IDA7CisgICAgICAgdm50aCA8IHctPm1jX21hdHJpeC52cG9zX3VzZWQ7 CisgICAgICAgKyt2bnRoKQorICAgIHsKKyAgICAgIGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNh Y2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOwor ICAgICAgICAgICArK2NhY2hlX3R5cGUpCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgY2FjaGVf YWxsb2NhdGVkID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVkW2NhY2hl X3R5cGVdOworICAgICAgICAgIGludCBjYWNoZV91c2VkID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXTsKKyAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIg ICAgdm50aCAoJWQpIHwgY2FjaGVfYWxsb2NhdGVkWyVzXSAoJWQpIHwgY2FjaGVfdXNlZFslc10g KCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHZudGgsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICBtY19jYWNoZV90eXBlX3RvX3N0cmluZyAoY2FjaGVfdHlwZSksCisgICAg ICAgICAgICAgICAgICAgICAgICAgICBjYWNoZV9hbGxvY2F0ZWQsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICBtY19jYWNoZV90eXBlX3RvX3N0cmluZyAoY2FjaGVfdHlwZSksCisgICAgICAg ICAgICAgICAgICAgICAgICAgICBjYWNoZV91c2VkKTsKKyAgICAgICAgfQorICAgIH0KK30KKwor dm9pZAorbWNfc2V0X2xzbF9iZyAoc3RydWN0IHdpbmRvdyAqdywgZW51bSBmYWNlX2lkIGZhY2Vf aWQsIHN0cnVjdCBtY19SR0IgKmxzbCkKK3sKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3 LT5mcmFtZSk7CisgIHN0cnVjdCBmYWNlICpmYWNlOworICBpZiAoIU5JTFAgKFZmYWNlX3JlbWFw cGluZ19hbGlzdCkKKyAgICAgICYmIChmYWNlX2lkID09IERFRkFVTFRfRkFDRV9JRCAvKiBRZGVm YXVsdCAqLworICAgICAgICAgIHx8IGZhY2VfaWQgPT0gTU9ERV9MSU5FX0ZBQ0VfSUQgLyogUW1v ZGVfbGluZSAqLworICAgICAgICAgIHx8IGZhY2VfaWQgPT0gTU9ERV9MSU5FX0lOQUNUSVZFX0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FjZV9pZCA9PSBJTlRFUk5BTF9CT1JERVJfRkFDRV9J RCkpIC8qIFFpbnRlcm5hbF9ib3JkZXIgKi8KKyAgICBmYWNlID0gRkFDRV9GUk9NX0lEIChmLCBs b29rdXBfYmFzaWNfZmFjZSAodywgZiwgZmFjZV9pZCkpOworICAgIGVsc2UKKyAgICAgIGZhY2Ug PSBGQUNFX0ZST01fSUQgKGYsIGZhY2VfaWQpOworICBMaXNwX09iamVjdCBjb2xvciA9IChmYWNl ICE9IE5VTEwpCisgICAgICAgICAgICAgICAgICAgICAgPyBmYWNlLT5sZmFjZVtMRkFDRV9CQUNL R1JPVU5EX0lOREVYXQorICAgICAgICAgICAgICAgICAgICAgIDogYnVpbGRfc3RyaW5nICgiT3Jh bmdlUmVkIik7CisgIG1jX3h3X2NvbG9yX3ZhbHVlcyAodywgY29sb3IsIGxzbCk7Cit9CisKK3Zv aWQKK21jX3NldF9lc3NlbnRpYWxzIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgbWNfZXNzZW50 aWFscyAqZXNzZW50aWFscykKK3sKKyAgaWYgKCFCVUZGRVJQICh3LT5jb250ZW50cykpCisgICAg cmV0dXJuOworICBpZiAoTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25m KSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWly cykpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2li bGUpKSkKKyAgICByZXR1cm47CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUp OworICBlc3NlbnRpYWxzLT5hY3RpdmVfcCA9ICh3ID09IFhXSU5ET1cgKGYtPnNlbGVjdGVkX3dp bmRvdykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZiA9PSBGUkFNRV9ESVNQTEFZX0lO Rk8gKGYpLT5oaWdobGlnaHRfZnJhbWUpOworICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAo dy0+Y29udGVudHMpOworICBzdHJ1Y3QgYnVmZmVyICpvbGRfYnVmZmVyID0gTlVMTDsKKyAgcHRy ZGlmZl90IG9wb2ludCA9ICh3ID09IFhXSU5ET1cgKHNlbGVjdGVkX3dpbmRvdykpCisgICAgICAg ICAgICAgICAgICAgICA/IFBUCisgICAgICAgICAgICAgICAgICAgICA6IFhGSVhOVU0gKEZtYXJr ZXJfcG9zaXRpb24gKHctPnBvaW50bSkpOworICBwdHJkaWZmX3QgY3VycmVudF9jb2wgPSBtY19j dXJyZW50X2NvbHVtbiAodywgb3BvaW50KTsKKyAgaW50IGZyYW1lX2NoYXJfd2lkdGggPSBGUkFN RV9DT0xVTU5fV0lEVEggKGYpOworICBib29sIGZpbGxfY29sdW1uX3AgPSAhTklMUCAoQlZBUiAo YiwgZmlsbF9jb2x1bW4pKTsKKyAgaW50IGZpbGxfY29sID0gWEZJWE5VTSAoQlZBUiAoYiwgZmls bF9jb2x1bW4pKTsKKyAgaW50IGhzY2xfeCA9IHctPmhzY3JvbGwgKiBmcmFtZV9jaGFyX3dpZHRo OworICBpZiAoYiAhPSBjdXJyZW50X2J1ZmZlcikKKyAgICB7CisgICAgICBvbGRfYnVmZmVyID0g Y3VycmVudF9idWZmZXI7CisgICAgICBzZXRfYnVmZmVyX2ludGVybmFsIChiKTsKKyAgICB9Cisg IGVzc2VudGlhbHMtPnp2ID0gWlY7CisgIGVzc2VudGlhbHMtPnp2X2J5dGUgPSBaVl9CWVRFOwor ICBlc3NlbnRpYWxzLT5mY194ID0gKGZpbGxfY29sdW1uX3AKKyAgICAgICAgICAgICAgICAgICAg ICAmJiAhTklMUCAoVmRpc3BsYXlfbGluZV9udW1iZXJzKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgPyAoZmlsbF9jb2wgKiBmcmFtZV9jaGFyX3dpZHRoKSArIHctPm1jLmxudW1fcGl4ZWxfd2lk dGggLSBoc2NsX3gKKyAgICAgICAgICAgICAgICAgICAgIDogKGZpbGxfY29sdW1uX3AKKyAgICAg ICAgICAgICAgICAgICAgICAgICYmIE5JTFAgKFZkaXNwbGF5X2xpbmVfbnVtYmVycykpCisgICAg ICAgICAgICAgICAgICAgICAgID8gKGZpbGxfY29sICogZnJhbWVfY2hhcl93aWR0aCkgLSBoc2Ns X3gKKyAgICAgICAgICAgICAgICAgICAgIDogMDsKKyAgaWYgKG9sZF9idWZmZXIpCisgICAgc2V0 X2J1ZmZlcl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7CisgIGVudW0gZmFjZV9pZCBmaWxsX2NvbHVt bl9wcmVfenZfZmFjZV9pZCA9CisgICAgKCFlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAgICAmJiAh TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY19pbmFjdGl2ZV93aW5kb3dzKSkK KyAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkp CisgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCJmYy1pbmFjdGl2ZS1w cmUtenYtZmFjZSIpLCB0cnVlKQorICAgIDogKCFlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAgICAg ICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX2luYWN0aXZlX3dpbmRv d3MpKQorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3Nz aGFpcnMpKQorICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisg ICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gZXNzZW50aWFscy0+ZmNfeCkKKyAgICAgID8gbG9va3Vw X25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoImZjLW9wb2ludC1p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hdF96dl9mZy5ibHVlOworICBlbnVtIGZhY2VfaWQgZmlsbF9j b2x1bW5fcG9zdF96dl9mYWNlX2lkID0KKyAgICAoIWVzc2VudGlhbHMtPmFjdGl2ZV9wCisgICAg ICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX2luYWN0aXZlX3dpbmRv d3MpKQorICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFp cnMpKSkKKyAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoImZjLWluYWN0 aXZlLXBvc3QtenYtZmFjZSIpLCB0cnVlKQorICAgIDogKCFlc3NlbnRpYWxzLT5hY3RpdmVfcAor ICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX2luYWN0aXZl X3dpbmRvd3MpKQorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGNyb3NzaGFpcnMpKQorICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxl cikpCisgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gZXNzZW50aWFscy0+ZmNfeCkKKyAgICAgID8g bG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoImZjLW9wb2ludC1pbmFjdGl2ZS1wb3N0 LXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICA6IChlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAgICAgICYm ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAg ICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgJiYgdy0+Y3Vy c29yLnggPT0gZXNzZW50aWFscy0+ZmNfeCkKKyAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcs IGYsIGludGVyb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RvdyAqdywgc3RydWN0IGdseXBoICpnbHlwaCwgc3RydWN0 IG1jX2Vzc2VudGlhbHMgZXNzZW50aWFscywKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1j X1JHQiAqbHNsX2ZnLCBpbnQgcG9zaW50LCBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBl LAorICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX3Jvd19wb3NpdGlvbiByb3dfcG9zaXRpb24s IGVudW0gbWNfZW5naW5lX3R5cGUgYWN0aW9uX3R5cGUpCit7CisgIHN3aXRjaCAoYWN0aW9uX3R5 cGUpCisgIHsKKyAgICBjYXNlIE1VTFRJUExFX0NVUlNPUlM6CisgICAgeworICAgICAgc3RydWN0 IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgICAgICBwdHJkaWZmX3QgY3VycmVudF9j b2wgPSBtY19jdXJyZW50X2NvbHVtbiAodywgcG9zaW50KTsKKyAgICAgIHN0cnVjdCBidWZmZXIg KmIgPSBYQlVGRkVSICh3LT5jb250ZW50cyk7CisgICAgICBib29sIGZpbGxfY29sdW1uX3AgPSAh TklMUCAoQlZBUiAoYiwgZmlsbF9jb2x1bW4pKTsKKyAgICAgIGludCBmaWxsX2NvbCA9IChmaWxs X2NvbHVtbl9wKQorICAgICAgICAgICAgICAgICAgICAgPyBYRklYTlVNIChCVkFSIChiLCBmaWxs X2NvbHVtbikpCisgICAgICAgICAgICAgICAgICAgICA6IDA7CisgICAgICBlbnVtIGZhY2VfaWQg ZXZlbl9mYWNlX2lkID0KKyAgICAgICAgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAm JiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF9pbmFjdGl2ZV93aW5kb3dz KSkpCisgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistZXZlbi1p bmFjdGl2ZS1wcmUtenYtZmFj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cl92YWx1ZXMgKHcsIG9kZF9jb2xvciwgJm9kZF9mb3JlZ3Jv dW5kKTsKKyAgICAgIGVudW0gZmFjZV9pZCBiZXlvbmRfZmlsbF9mYWNlX2lkID0KKyAgICAgICAg KCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkpCisgICAgICAgID8gbG9va3VwX25h bWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcG9zdC1maWxsLWluYWN0aXZlLXByZS16di1mYWNl IiksIHRydWUpCisgICAgICAgIDogbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIist cG9zdC1maWxsLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgc3RydWN0IGZhY2UgKmJleW9u ZF9maWxsX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGJleW9uZF9maWxsX2ZhY2VfaWQpOworICAg ICAgTGlzcF9PYmplY3QgYmV5b25kX2ZpbGxfY29sb3IgPSBiZXlvbmRfZmlsbF9mYWNlLT5sZmFj ZVtMRkFDRV9GT1JFR1JPVU5EX0lOREVYXTsKKyAgICAgIHN0cnVjdCBtY19SR0IgYmV5b25kX2Zp bGxfZm9yZWdyb3VuZDsKKyAgICAgIG1jX3h3X2NvbG9yX3ZhbHVlcyAodywgYmV5b25kX2ZpbGxf Y29sb3IsICZiZXlvbmRfZmlsbF9mb3JlZ3JvdW5kKTsKKyAgICAgIC8qIHJlZCAqLworICAgICAg aWYgKCghZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAmJiBjdXJyZW50X2NvbCAlIDIgIT0gMAor ICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gPT0gUFJFX1pWKQorICAgICAgICAgIHx8IChmaWxs X2NvbHVtbl9wCisgICAgICAgICAgICAgICYmIGN1cnJlbnRfY29sICUgMiAhPSAwCisgICAgICAg ICAgICAgICYmIGN1cnJlbnRfY29sIDw9IGZpbGxfY29sCisgICAgICAgICAgICAgICYmIHJvd19w b3NpdGlvbiA9PSBQUkVfWlYpKQorICAgICAgICB7CisgICAgICAgICAgbHNsX2ZnLT5yZWQgPSBv ZGRfZm9yZWdyb3VuZC5yZWQ7CisgICAgICAgICAgbHNsX2ZnLT5ncmVlbiA9IG9kZF9mb3JlZ3Jv dW5kLmdyZWVuOworICAgICAgICAgIGxzbF9mZy0+Ymx1ZSA9IG9kZF9mb3JlZ3JvdW5kLmJsdWU7 CisgICAgICAgIH0KKyAgICAgICAgLyogeWVsbG93ICovCisgICAgICAgIGVsc2UgaWYgKCghZmls bF9jb2x1bW5fcAorICAgICAgICAgICAgICAgICAgJiYgY3VycmVudF9jb2wgJSAyID09IDAKKyAg ICAgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYpCisgICAgICAgICAgICAg ICAgIHx8IChmaWxsX2NvbHVtbl9wCisgICAgICAgICAgICAgICAgICAgICAmJiBjdXJyZW50X2Nv bCAlIDIgPT0gMAorICAgICAgICAgICAgICAgICAgICAgJiYgY3VycmVudF9jb2wgPD0gZmlsbF9j b2wKKyAgICAgICAgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYpKQorICAg ICAgICAgIHsKKyAgICAgICAgICAgIGxzbF9mZy0+cmVkID0gZXZlbl9mb3JlZ3JvdW5kLnJlZDsK KyAgICAgICAgICAgIGxzbF9mZy0+Z3JlZW4gPSBldmVuX2ZvcmVncm91bmQuZ3JlZW47CisgICAg ICAgICAgICBsc2xfZmctPmJsdWUgPSBldmVuX2ZvcmVncm91bmQuYmx1ZTsKKyAgICAgICAgICB9 CisgICAgICAgICAgLyogZ3JlZW4gKi8KKyAgICAgICAgICBlbHNlIGlmIChmaWxsX2NvbHVtbl9w CisgICAgICAgICAgICAgICAgICAgJiYgY3VycmVudF9jb2wgPiBmaWxsX2NvbAorICAgICAgICAg ICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYpCisgICAgICAgICAgICB7CisgICAg ICAgICAgICAgIGxzbF9mZy0+cmVkID0gYmV5b25kX2ZpbGxfZm9yZWdyb3VuZC5yZWQ7CisgICAg ICAgICAgICAgIGxzbF9mZy0+Z3JlZW4gPSBiZXlvbmRfZmlsbF9mb3JlZ3JvdW5kLmdyZWVuOwor ICAgICAgICAgICAgICBsc2xfZmctPmJsdWUgPSBiZXlvbmRfZmlsbF9mb3JlZ3JvdW5kLmJsdWU7 CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmIChyb3dfcG9zaXRpb24gPT0gQVRf WlYpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBsc2xfZmctPnJlZCA9IGVzc2Vu dGlhbHMuc3BfZmcucmVkOworICAgICAgICAgICAgICAgIGxzbF9mZy0+Z3JlZW4gPSBlc3NlbnRp YWxzLnNwX2ZnLmdyZWVuOworICAgICAgICAgICAgICAgIGxzbF9mZy0+Ymx1ZSA9IGVzc2VudGlh bHMuc3BfZmcuYmx1ZTsKKyAgICAgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAg IGNhc2UgSE9SSVpPTlRBTF9SVUxFUjoKKyAgICB7CisgICAgICBpZiAoZ2x5cGggIT0gTlVMTAor ICAgICAgICAgICYmIGdseXBoLT51LmNoID09IDk1CisgICAgICAgICAgJiYgY3Vyc29yX3R5cGUg PT0gTUNfSEJBUikKKyAgICAgICAgeworICAgICAgICAgIGxzbF9mZy0+cmVkID0gZXNzZW50aWFs cy5zcF9mZy5yZWQ7CisgICAgICAgICAgbHNsX2ZnLT5ncmVlbiA9IGVzc2VudGlhbHMuc3BfZmcu Z3JlZW47CisgICAgICAgICAgbHNsX2ZnLT5ibHVlID0gZXNzZW50aWFscy5zcF9mZy5ibHVlOwor ICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBsc2xfZmct PnJlZ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5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgY2hfaW5hY3RpdmVfd2luZG93cykpCisgICAgICAgICAmJiByb3dfcG9zaXRpb24g PT0gUFJFX1pWKQorICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAo IistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1wcmUtenYtZmFjZSIpLCB0cnVlKQorICAgICAg ICA6IChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQ UkVfWlYpCisgICAgICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1y ZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpCisgICAgICAgIDogKCFlc3NlbnRp YWxzLmFjdGl2ZV9wCisgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKQorICAgICAgICAgICAmJiByb3dfcG9zaXRpb24g PT0gQVRfWlYpCisgICAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4g KCIrLXJlYWwtZmFrZS1jdXJzb3ItaW5hY3RpdmUtYXQtenYtZmFjZSIpLCB0cnVlKQorICAgICAg ICA6IChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBB VF9aVikKKyAgICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJl YWwtZmFrZS1jdXJzb3ItYXQtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICA6IGxvb2t1cF9uYW1l ZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItYXQtenYtZmFjZSIpLCB0 cnVlKTsKKyAgICAgIH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E1DX0JVSUxEX0dMWVBIX1NUUklO R1MgKGksIGVuZCwgaGVhZCwgdGFpbCwgaGwsIHgsIGxhc3RfeCk7CisgIGlmICh0YWlsKQorICAg IHsKKyAgICAgIHMgPSBnbHlwaF9zdHJpbmdfY29udGFpbmluZ19iYWNrZ3JvdW5kX3dpZHRoICh0 YWlsKTsKKyAgICAgIHhfcmVhY2hlZCA9IHMtPnggKyBzLT5iYWNrZ3JvdW5kX3dpZHRoOworICAg IH0KKyAgICBlbHNlCisgICAgICB4X3JlYWNoZWQgPSB4OworICAvKiBJZiB0aGVyZSBhcmUgYW55 IGdseXBocyB3aXRoIGxiZWFyaW5nIDwgMCBvciByYmVhcmluZyA+IHdpZHRoIGluCisgICAgIHRo ZSByb3csIHJlZHJhdyBzb21lIGdseXBocyBpbiBmcm9udCBvciBmb2xsb3dpbmcgdGhlIGdseXBo CisgICAgIHN0cmluZ3MgYnVpbHQgYWJvdmUuICovCisgIGlmIChoZWFkICYmICFvdmVybGFwcyAm JiByb3ctPmNvbnRhaW5zX292ZXJsYXBwaW5nX2dseXBoc19wKQorICAgIHsKKyAgICAgIHN0cnVj dCBnbHlwaF9zdHJpbmcgKmgsICp0OworICAgICAgTW91c2VfSExJbmZvICpobGluZm8gPSBNT1VT RV9ITF9JTkZPIChmKTsKKyAgICAgIGludCBtb3VzZV9iZWdfY29sIFVOSU5JVCwgbW91c2VfZW5k X2NvbCBVTklOSVQ7CisgICAgICBib29sIGNoZWNrX21vdXNlX2ZhY2UgPSBmYWxzZTsKKyAgICAg IGludCBkdW1teV94ID0gMDsKKyAgICAgIC8qIElmIG1vdXNlIGhpZ2hsaWdodGluZyBpcyBvbiwg d2UgbWF5IG5lZWQgdG8gZHJhdyBhZGphY2VudAorICAgZ2x5cGhzIHVzaW5nIG1vdXNlLWZhY2Ug aGlnaGxpZ2h0aW5nLiAqLworICAgICAgaWYgKGFyZWEgPT0gVEVYVF9BUkVBICYmIHJvdy0+bW91 c2VfZmFjZV9wCisgICAgICAgICAgJiYgaGxpbmZvLT5tb3VzZV9mYWNlX2JlZ19yb3cgPj0gMAor ICAgICAgICAgICYmIGhsaW5mby0+bW91c2VfZmFjZV9lbmRfcm93ID49IDApCisgICAgICAgIHsK KyAgICAgICAgICBwdHJkaWZmX3Qgcm93X3Zwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgdy0+ Y3VycmVudF9tYXRyaXgpOworICAgICAgICAgIGlmIChyb3dfdnBvcyA+PSBobGluZm8tPm1vdXNl X2ZhY2VfYmVnX3JvdworICAgICAgICAgICAgICAmJiByb3dfdnBvcyA8PSBobGluZm8tPm1vdXNl X2ZhY2VfZW5kX3JvdykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY2hlY2tfbW91c2Vf ZmFjZSA9IHRydWU7CisgICAgICAgICAgICAgIG1vdXNlX2JlZ19jb2wgPSAocm93X3Zwb3MgPT0g aGxpbmZvLT5tb3VzZV9mYWNlX2JlZ19yb3cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IGhsaW5mby0+bW91c2VfZmFjZV9iZWdfY29sCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IDA7CisgICAgICAgICAgICAgIG1vdXNlX2VuZF9jb2wgPSAocm93X3Zwb3MgPT0gaGxp bmZvLT5tb3VzZV9mYWNlX2VuZF9yb3cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IGhsaW5mby0+bW91c2VfZmFjZV9lbmRfY29sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IHJvdy0+dXNlZFtURVhUX0FSRUFdOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAg ICAvKiBDb21wdXRlIG92ZXJoYW5ncyBmb3IgYWxsIGdseXBoIHN0cmluZ3MuICovCisgICAgICBp ZiAoRlJBTUVfUklGIChmKS0+Y29tcHV0ZV9nbHlwaF9zdHJpbmdfb3ZlcmhhbmdzKQorICAgICAg ICBmb3IgKHMgPSBoZWFkOyBzO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ICAgIGNvZGUs IGFuZCBJIGRvbid0IGtub3cgaWYgdGhlIHBhdGhvbG9naWNhbCBjYXNlIG9jY3VycyBpbgorICAg ICAgICAgICAgIHByYWN0aWNlLCBzbyB3ZSdsbCBzdGljayB0byB0aGlzIGZvciBub3cuICAtLS0g Y3lkICAqLworICAgICAgICAgIGlmIChjaGVja19tb3VzZV9mYWNlCisgICAgICAgICAgICAgICYm IG1vdXNlX2JlZ19jb2wgPCBzdGFydCAmJiBtb3VzZV9lbmRfY29sID4gaSkKKyAgICAgICAgICAg IG92ZXJsYXBfaGwgPSBEUkFXX01PVVNFX0ZBQ0U7CisgICAgICAgICAgICBlbHNlCisgICAgICAg ICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX05PUk1BTF9URVhUOworICAgICAgICAgIGlmIChobCAh PSBvdmVybGFwX2hsKQorICAgICAgICAgICAgY2xpcF9oZWFkID0gaGVhZDsKKyAgICAgICAgICBq ID0gaTsKKyAgICAgICAgICBNQ19CVUlMRF9HTFlQSF9TVFJJTkdTIChqLCBzdGFydCwgaCwgdCwg b3ZlcmxhcF9obCwgZHVtbXlfeCwgbGFzdF94KTsKKyAgICAgICAgICAvKiBUaGUgYGxlZnRfb3Zl cndyaXR0ZW5gIGJlaGF2aW9yIHRoYXQgZXJhc2VzIHRoZSBmYWtlIGN1cnNvcnMgdHJhY2VzIHRv CisgICAgICAgICAgYGZvbnQtPmRyaXZlci0+ZHJhd2AgaW4gYG5zX2RyYXdfZ2x5cGhfc3RyaW5n JzsgYW5kLCB0aGUgaGVpZ2h0IG9mIHRoZSByZWN0YW5nbGUKKyAgICAgICAgICBkcmF3biBieSBg bnNfZHVtcGdseXBoc19zdHJldGNoJzsgYW5kLCBgbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3Jv dW5kJyB3aGljaAorICAgICAgICAgIGVyYXNlcyB0aGUgYXBwbGljYWJsZSByZWN0YW5nbGUuICov CisgICAgICAgICAgLyogRVhBTVBMRTogIAlNCisgICAgICA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9IGxlZnRfb3ZlcndyaXRpbmcg KGhlYWQpOworICAgICAgaWYgKGkgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIGVudW0gZHJh d19nbHlwaHNfZmFjZSBvdmVybGFwX2hsOworICAgICAgICAgIGlmIChjaGVja19tb3VzZV9mYWNl CisgICAgICAgICAgICAgICYmIG1vdXNlX2JlZ19jb2wgPCBzdGFydCAmJiBtb3VzZV9lbmRfY29s ID4gaSkKKyAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX01PVVNFX0ZBQ0U7CisgICAgICAg ICAgICBlbHNlCisgICAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX05PUk1BTF9URVhUOwor ICAgICAgICAgIGlmIChobCA9PSBvdmVybGFwX2hsIHx8IGNsaXBfaGVhZCA9PSBOVUxMKQorICAg ICAgICAgICAgY2xpcF9oZWFkID0gaGVhZDsKKyAgICAgICAgICBNQ19CVUlMRF9HTFlQSF9TVFJJ TkdTIChpLCBzdGFydCwgaCwgdCwgb3ZlcmxhcF9obCwgZHVtbXlfeCwgbGFzdF94KTsKKyAgICAg ICAgICBmb3IgKHMgPSBoOyBzOyBzID0gcy0+bmV4dCkKKyAgICAgICAgICAgIHMtPmJhY2tncm91 bmRfZmlsbGVkX3AgPSB0cnVlOworICAgICAgICAgIGNvbXB1dGVfb3ZlcmhhbmdzX2FuZF94ICh0 LCBoZWFkLT54LCB0cnVlKTsKKyAgICAgICAgICBwcmVwZW5kX2dseXBoX3N0cmluZ19saXN0cyAo JmhlYWQsICZ0YWlsLCBoLCB0KTsKKyAgICAgICAgfQorICAgICAgLyogQXBwZW5kIGdseXBocyBz dHJpbmdzIGZvciBnbHlwaHMgZm9sbG93aW5nIHRoZSBsYXN0IGdseXBoCisgICAgICBzdHJpbmcg dGFpbCB0aGF0IGFyZSBvdmVyd3JpdHRlbiBieSB0YWlsLiAgVGhlIGJhY2tncm91bmQgb2YKKyAg ICAgIHRoZXNlIHN0cmluZ3MgaGFzIHRvIGJlIGRyYXduIGJlY2F1c2UgdGFpbCdzIGZvcmVncm91 bmQgZHJhd3MKKyAgICAgIG92ZXIgaXQuICovCisgICAgICBpID0gcmlnaHRfb3ZlcndyaXR0ZW4g KHRhaWwpOworICAgICAgaWYgKGkgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIGVudW0gZHJh d19nbHlwaHNfZmFjZSBvdmVybGFwX2hsOworICAgICAgICAgIGlmIChjaGVja19tb3VzZV9mYWNl CisgICAgICAgICAgICAgICYmIG1vdXNlX2JlZ19jb2wgPCBpICYmIG1vdXNlX2VuZF9jb2wgPiBl bmQpCisgICAgICAgICAgICBvdmVybGFwX2hsID0gRFJBV19NT1VTRV9GQUNFOworICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICBvdmVybGFwX2hsID0gRFJBV19OT1JNQUxfVEVYVDsKKyAg ICAgICAgICBpZiAoaGwgIT0gb3ZlcmxhcF9obCkKKyAgICAgICAgICAgIGNsaXBfdGFpbCA9IHRh aWw7CisgICAgICAgICAgTUNfQlVJTERfR0xZUEhfU1RSSU5HUyAoZW5kLCBpLCBoLCB0LCBvdmVy bGFwX2hsLCB4LCBsYXN0X3gpOworICAgICAgICAvKiBUaGUgYHJpZ2h0X292ZXJ3cml0dGVuYCBi ZWhhdmlvciB0aGF0IGVyYXNlcyB0aGUgZmFrZSBjdXJzb3JzIHRyYWNlcyB0bworICAgICAgICBg Zm9udC0+ZHJpdmVyLT5kcmF3YCBpbiBgbnNfZHJhd19nbHlwaF9zdHJpbmcnOyBhbmQsIHRoZSBo ZWlnaHQgb2YgdGhlIHJlY3RhbmdsZQorICAgICAgICBkcmF3biBieSBgbnNfZHVtcGdseXBoc19z dHJldGNoJzsgYW5kLCBgbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kJyB3aGljaAorICAg ICAgICBlcmFzZXMgdGhlIGFwcGxpY2FibGUgcmVjdGFuZ2xlLiAqLworICAgICAgICAvKiBFWEFN UExFOiAgIkV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wZW5kIGdseXBoIHN0cmluZ3MgZm9yIGds eXBocyBmb2xsb3dpbmcgdGhlIGxhc3QgZ2x5cGgKKyAgICAgIHN0cmluZyB0YWlsIHRoYXQgb3Zl cndyaXRlIHRhaWwuICBUaGUgZm9yZWdyb3VuZCBvZiBzdWNoCisgICAgICBnbHlwaHMgaGFzIHRv IGJlIGRyYXduIGJlY2F1c2UgaXQgd3JpdGVzIGludG8gdGhlIGJhY2tncm91bmQKKyAgICAgIG9m IHRhaWwuICBUaGUgYmFja2dyb3VuZCBtdXN0IG5vdCBiZSBkcmF3biBiZWNhdXNlIGl0IGNvdWxk CisgICAgICBwYWludCBvdmVyIHRoZSBmb3JlZ3JvdW5kIG9mIGZvbGxvd2luZyBnbHlwaHMuICov CisgICAgICBpID0gcmlnaHRfb3ZlcndyaXRpbmcgKHRhaWwpOworICAgICAgaWYgKGkgPj0gMCkK KyAgICAgICAgeworICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBvdmVybGFwX2hsOwor ICAgICAgICAgIGlmIChjaGVja19tb3VzZV9mYWNlCisgICAgICAgICAgICAgICYmIG1vdXNlX2Jl Z19jb2wgPCBpICYmIG1vdXNlX2VuZF9jb2wgPiBlbmQpCisgICAgICAgICAgICBvdmVybGFwX2hs ID0gRFJBV19NT1VTRV9GQUNFOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBvdmVy bGFwX2hsID0gRFJBV19OT1JNQUxfVEVYVDsKKyAgICAgICAgICBpZiAoaGwgPT0gb3ZlcmxhcF9o bCB8fCBjbGlwX3RhaWwgPT0gTlVMTCkKKyAgICAgICAgICAgIGNsaXBfdGFpbCA9IHRhaWw7Cisg ICAgICAgICAgaSsrOyAgICAgIC8qIFdlIG11c3QgaW5jbHVkZSB0aGUgSXRoIGdseXBoLiAqLwor ICAgICAgICAgIE1DX0JVSUxEX0dMWVBIX1NUUklOR1MgKGVuZCwgaSwgaCwgdCwgb3ZlcmxhcF9o bCwgeCwgbGFzdF94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aDsKKyAgZW51bSBkcmF3X2dseXBoc19mYWNl IGhsOworICAvKiBObyBjdXJzb3IgZGlzcGxheWVkIG9yIHJvdyBpbnZhbGlkYXRlZCA9PiBub3Ro aW5nIHRvIGRvIG9uIHRoZSBzY3JlZW4uICovCisgIGlmIChjdXJzb3JfdHlwZSA9PSBNQ19OT19D VVJTT1IpCisgICAgeworICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgIGZwcmludGYgKHN0ZGVy ciwgIm1jX2VyYXNlX2N1cnNvcjogIHJldHVybiAoJWQpXG4iLCAxKTsKKyAgICAgIHJldHVybjsK KyAgICB9CisgIC8qIFZQT1MgPj0gbWF0cml4LT5ucm93cyBtZWFucyB0aGF0IHdpbmRvdyBoYXMg YmVlbiByZXNpemVkLgorICAgICBEb24ndCBib3RoZXIgdG8gZXJhc2UgdGhlIGN1cnNvci4gKi8K KyAgaWYgKHZwb3MgPj0gbWF0cml4LT5ucm93cykKKyAgICB7CisgICAgICBpZiAoZGVidWdfcCkK KyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZXJhc2VfY3Vyc29yOiAgcmV0dXJuICglZClc biIsIDIpOworICAgICAgcmV0dXJuOworICAgIH0KKyAgLyogSWYgcm93IGNvbnRhaW5pbmcgY3Vy c29yIGlzIG1hcmtlZCBpbnZhbGlkLCB0aGVyZSBpcyBub3RoaW5nIHdlCisgICAgIGNhbiBkby4g Ki8KKyAgaWYgKCFyb3ctPmVuYWJsZWRfcCkKKyAgICB7CisgICAgICBpZiAoZGVidWdfcCkKKyAg ICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZXJhc2VfY3Vyc29yOiAgcmV0dXJuICglZClcbiIs IDMpOworICAgICAgcmV0dXJuOworICAgIH0KKyAgLyogSWYgbGluZSBzcGFjaW5nIGlzID4gMCwg b2xkIGN1cnNvciBtYXkgb25seSBiZSBwYXJ0aWFsbHkgdmlzaWJsZSBpbgorICAgICB3aW5kb3cg YWZ0ZXIgc3BsaXQtd2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3Vyc29y X3R5cGUgY3Vyc29yX3R5cGUsIGludCBjdXJzb3Jfd2lkdGgsCisgICAgICAgICAgICAgICAgICAg ICAgc3RydWN0IG1jX1JHQiBsc2wsIGJvb2wgYWN0aXZlX3AsIGVudW0gbWNfZmxhdm9yIGdseXBo X2ZsYXZvciwKKyAgICAgICAgICAgICAgICAgICAgICBib29sIHJlbW92ZV9wKQoreworICAvKiBg bWF0cml4X3JvdycgaW4gYGRpc3BuZXcuY2AgY29udGFpbnMgdGhlIGZvbGxvd2luZyB0ZXN0cywK KyAgZWFzc2VydCAobWF0cml4ICYmIG1hdHJpeC0+cm93cyk7CisgIGVhc3NlcnQgKHJvdyA+PSAw ICYmIHJvdyA8IG1hdHJpeC0+bnJvd3MpOyAqLworICBib29sIGJhcmZfY3Jhc2hfb25lID0gKG1h dHJpeCAmJiBtYXRyaXgtPnJvd3MpID8gZmFsc2UgOiB0cnVlOworICBpZiAoYmFyZl9jcmFzaF9v bmUpCisgICAgcmV0dXJuOworICBib29sIGJhcmZfY3Jhc2hfdHdvID0gKHZwb3MgPj0gMCAmJiB2 cG9zIDwgbWF0cml4LT5ucm93cykgPyBmYWxzZSA6IHRydWU7CisgIGlmIChiYXJmX2NyYXNoX3R3 bykKKyAgICByZXR1cm47CisgIGlmICh4IDwgMAorICAgICAgfHwgeSA8IDAKKyAgICAgIHx8IGhw b3MgPCAwCisgICAgICB8fCB2cG9zIDwgMCkKKyAgICByZXR1cm47CisgIHN0cnVjdCBmcmFtZSAq ZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBib29sIGF1dG9faHNjcm9sbF9tb2RlX3AgPSBFUSAo RmJ1ZmZlcl9sb2NhbF92YWx1ZSAoUWF1dG9faHNjcm9sbF9tb2RlLCB3LT5jb250ZW50cyksIFFj dXJyZW50X2xpbmUpOworICAvKiBFWEFNUExFOiAgKHNjcm9sbC1sZWZ0IDUpICovCisgIGJvb2wg aHNjbF9hbGxfdGVtcF9wID0gKHctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+ bWluX2hzY3JvbGwgPT0gMCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIG5vdGhp bmcuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8wX3AgPSAody0+c3VzcGVuZF9hdXRvX2hzY3Jv bGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSB3LT5oc2Nyb2xsKTsKKyAgLyogRVhBTVBM RTogIEMtdSBDLXggPCBhbmQgZG8gc29tZXRoaW5nIGVsc2UgYmVzaWRlcyBob3Jpem9udGFsbHkg c2Nyb2xsaW5nIHRoZQorICAgICAgICAgICAgICAgY3VycmVudCBsaW5lIGRpZmZlcmVudGx5Lgor ICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIGlzIF9ub3RfIGhvcml6b250YWxseSBzY3JvbGxl ZCBkaWZmZXJlbnRseS4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzFfcCA9ICghdy0+c3VzcGVu ZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3Jv bGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSB3LT5oc2Nyb2xsKTsK KyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBhbmQgLi4uCisgICAgICAgICAgICAgICBDdXJyZW50 IGxpbmUgaXMgX25vdF8gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBi b29sIGhzY2xfYWxsX3Blcm1fMl9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID09IDAKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiB3LT5taW5faHNjcm9sbCAhPSB3LT5oc2Nyb2xsKTsKKyAgLyogRVhBTVBMRTogIChzY3Jv bGwtbGVmdCA1KTsgYW5kLCB0aGVuIHByZXNzIHRoZSBsZWZ0IGFycm93IGtleSBvbmUgdGltZS4K KyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBfaXNfIGhvcml6b250YWxseSBzY3JvbGxlZCBk aWZmZXJlbnRseS4qLworICBib29sIGhzY2xfdGVtcF9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNj cm9sbAorICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAg ICYmIHctPm1pbl9oc2Nyb2xsID09IDApOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBk byBzb21ldGhpbmcgdGhhdCBjYXVzZXMgdGhlIGN1cnJlbnQgbGluZSB0byBiZQorICAgICAgICAg ICAgICAgaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LgorICAgICAgICAgICAgICAg Q3VycmVudCBsaW5lIF9pc18gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLwor ICBib29sIGhzY2xfcGVybV9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAg ICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAg ICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Ny b2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhz Y3JvbGwpOworICBpbnQgZnJpbmdlX2JpdG1hcCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgIGlu dCBmYWNlX2lkID0gREVGQVVMVF9GQUNFX0lEOworICBpZiAoIXJlbW92ZV9wCisgICAgICAmJiBn bHlwaF9mbGF2b3IgPT0gTUNfT1ZFUkxBWV9BUlJPV19CSVRNQVAKKyAgICAgICYmICFoc2NsX2Fs bF90ZW1wX3AKKyAgICAgICYmICFoc2NsX3RlbXBfcAorICAgICAgJiYgIWhzY2xfcGVybV9wCisg ICAgICAmJiAhaHNjbF9hbGxfcGVybV8wX3AKKyAgICAgICYmICFoc2NsX2FsbF9wZXJtXzFfcAor ICAgICAgJiYgIWhzY2xfYWxsX3Blcm1fMl9wKQorICAgIHsKKyAgICAgIGVudW0gZmFjZV9pZCBv dmVybGF5X2Fycm93X2ZhY2VfaWQgPQorICAgICAgICAoIWFjdGl2ZV9wCisgICAgICAgICAmJiAh TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkp CisgICAgICAgID8gbG9va3VwX2Rlcml2ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5 LWFycm93LWluYWN0aXZlLXByZS16di1mYWNlIiksIEZSSU5HRV9GQUNFX0lELCB0cnVlKQorICAg ICAgICA6IChhY3RpdmVfcCkKKyAgICAgICAgICA/IGxvb2t1cF9kZXJpdmVkX2ZhY2UgKHcsIGYs IGludGVybiAoIistb3ZlcmxheS1hcnJvdy1wcmUtenYtZmFjZSIpLCBGUklOR0VfRkFDRV9JRCwg dHJ1ZSkKKyAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICBmYWNlX2lkID0gKGN1cnNv cl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICA/IG92ZXJs YXlfYXJyb3dfZmFjZV9pZAorICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAg ICAgaWYgKHctPmhzY3JvbGwgIT0gMCkKKyAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9m cmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ciKSwgZmFsc2UsIHRydWUp OworICAgICAgICBlbHNlCisgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2Vf Yml0bWFwICh3LCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ciKSwgdHJ1ZSwgdHJ1ZSk7CisgICAg ICByb3ctPmxlZnRfZnJpbmdlX2JpdG1hcCA9IChjdXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5H RV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZnJpbmdlX2JpdG1h cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7 CisgICAgICByb3ctPmxlZnRfZnJpbmdlX2ZhY2VfaWQgPSBmYWNlX2lkOworICAgICAgcm93LT5s ZWZ0X2ZyaW5nZV9vZmZzZXQgPSAwOworICAgICAgcm93LT5mcmluZ2VfYml0bWFwX3BlcmlvZGlj X3AgPSBmYWxzZTsKKyAgICB9CisgICAgZWxzZSBpZiAoIXJlbW92ZV9wCisgICAgICAgICAgICAg JiYgZ2x5cGhfZmxhdm9yID09IE1DX09WRVJMQVlfQVJST1dfQklUTUFQCisgICAgICAgICAgICAg JiYgKGhzY2xfYWxsX3RlbXBfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzBf cAorICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzFfcAorICAgICAgICAgICAgICAg ICB8fCBoc2NsX2FsbF9wZXJtXzJfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX3RlbXBfcAor ICAgICAgICAgICAgICAgICB8fCBoc2NsX3Blcm1fcCkpCisgICAgICB7CisgICAgICAgIGVudW0g ZmFjZV9pZCBvdmVybGF5X2Fycm93X2ZhY2VfaWQgPQorICAgICAgICAgICghYWN0aXZlX3AKKyAg ICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaW5hY3Rp dmVfd2luZG93cykpKQorICAgICAgICAgID8gbG9va3VwX2Rlcml2ZWRfZmFjZSAodywgZiwgaW50 ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtaW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwgRlJJTkdF X0ZBQ0VfSUQsIHRydWUpCisgICAgICAgICAgOiAoYWN0aXZlX3ApCisgICAgICAgICAgICA/IGxv b2t1cF9kZXJpdmVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1oc2NsLXBy ZS16di1mYWNlIiksIEZSSU5HRV9GQUNFX0lELCB0cnVlKQorICAgICAgICAgIDogREVGQVVMVF9G QUNFX0lEOworICAgICAgICBmYWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdF X0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgID8gb3ZlcmxheV9hcnJvd19mYWNlX2lkCisgICAg ICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgaWYgKGhzY2xfYWxsX3Bl cm1fMF9wKQorICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAo dywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAgICBlbHNl IGlmIChoc2NsX2FsbF9wZXJtXzFfcCkKKyAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19n ZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgdHJ1ZSwgZmFsc2Up OworICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF9hbGxfcGVybV8yX3ApCisgICAgICAgICAgICAg IGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2Ns LXBlcm0iKSwgZmFsc2UsIHRydWUpOworICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX3Blcm1f cCkKKyAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAg KHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIHRydWUsIHRydWUpOworICAgICAgICAgICAgICAg IGVsc2UgaWYgKGhzY2xfYWxsX3RlbXBfcCkKKyAgICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRt YXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXRlbXAiKSwgZmFs c2UsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xfdGVtcF9wKQorICAg ICAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcs IGludGVybiAoIistaHNjbC10ZW1wIiksIHRydWUsIGZhbHNlKTsKKyAgICAgICAgcm93LT5sZWZ0 X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAg ICAgcm93LT5sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gZmFjZV9pZDsKKyAgICAgICAgcm93LT5sZWZ0 X2ZyaW5nZV9vZmZzZXQgPSAwOworICAgICAgICByb3ctPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNf cCA9IGZhbHNlOworICAgICAgfQorICAgICAgZWxzZSBpZiAoIXJlbW92ZV9wCisgICAgICAgICAg ICAgICAmJiAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cK KyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9X X1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZv ciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFCisgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxh dm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIHx8 IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAg ICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSCisgICAg ICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JB UgorICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJf QkFDS1NMQVNIKSkKKyAgICAgICAgeworICAgICAgICAgIExpc3BfT2JqZWN0IGJpdG1hcF9mbGF2 b3IgPSAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hvbGxvd19yZWN0YW5n bGVfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAo Z2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRf aG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xl CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9 PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNF RF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19W RVJUSUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBR bWNfdmVydGljYWxfYmFyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog KGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxfYmFyCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBN Q19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jhcl9iYWNrc2xhc2gKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiBRbmlsOworICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSAo Y3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBsb29rdXBfZnJpbmdlX2JpdG1hcCAoYml0bWFwX2ZsYXZvcikKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgOiBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgIGZhY2Vf aWQgPSAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAorICAgICAgICAgICAg ICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xF X1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09 IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAg ICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpKQorICAg ICAgICAgICAgICAgICAgICAgID8gbG9va3VwX2Rlcml2ZWRfZmFjZSAodywgZiwgaW50ZXJuICgi Ky1yZXZlcnNlZC1iYXItcHJlLXp2LWZhY2UiKSwgRlJJTkdFX0ZBQ0VfSUQsIHRydWUpCisgICAg ICAgICAgICAgICAgICAgIDogKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAK KyAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX0hP TExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5 cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAg ICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxf QkFSKQorICAgICAgICAgICAgICAgICAgICAgID8gbG9va3VwX2Rlcml2ZWRfZmFjZSAodywgZiwg aW50ZXJuICgiKy1iYXItcHJlLXp2LWZhY2UiKSwgRlJJTkdFX0ZBQ0VfSUQsIHRydWUpCisgICAg ICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAgIHJvdy0+Y3Vyc29y X2luX2ZyaW5nZV9wID0gZmFsc2U7CisgICAgICAgICAgcm93LT5yaWdodF9mcmluZ2VfYml0bWFw ID0gZnJpbmdlX2JpdG1hcDsKKyAgICAgICAgICByb3ctPnJpZ2h0X2ZyaW5nZV9mYWNlX2lkID0g ZmFjZV9pZDsKKyAgICAgICAgICByb3ctPnJpZ2h0X2ZyaW5nZV9vZmZzZXQgPSAwOworICAgICAg ICAgIHJvdy0+ZnJpbmdlX2JpdG1hcF9wZXJpb2RpY19wID0gZmFsc2U7CisgICAgICAgIH0KKyAg ICAgICAgZWxzZSBpZiAoZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBICisgICAgICAgICAgICAgICAg IHx8IGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSExFU1MpCisgICAgICAgICAgeworICAgICAgICAg ICAgYm9vbCBvbl9wID0gdHJ1ZTsKKyAgICAgICAgICAgIEZSQU1FX1JJRiAoZiktPm1jX3Njcmli ZV9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCB3ZCwgaCwgbHNsLCBjdXJz b3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1 cnNvcl93aWR0aCwgZ2x5cGhfZmxhdm9yLCBvbl9wLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgYWN0aXZlX3ApOworICAgICAgICAgIH0KK30KKworLyogRHVt cCBjb250ZW50cyBvZiBnbHlwaCBHTFlQSCB0byBzdGRlcnIuICBST1cgYW5kIEFSRUEgYXJlCisg ICB0aGUgZ2x5cGggcm93IGFuZCBhcmVhIHdoZXJlIHRoZSBnbHlwaCBjb21lcyBmcm9tLiAqLwor dm9pZAorbWNfZHVtcF9nbHlwaCAoc3RydWN0IGdseXBoX3JvdyAqcm93LCBzdHJ1Y3QgZ2x5cGgg KmdseXBoLCBpbnQgYXJlYSwKKyAgICAgICAgICAgICAgIGludCByZWxhdGl2ZV94LCBpbnQgdnBv cykKK3sKKyAgYm9vbCBnbHlwaF96dl9wID0gKGdseXBoIC0gcm93LT5nbHlwaHNbYXJlYV0gPT0g cm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgJiYgTUFUUklYX1JPV19F TkRfQ0hBUlBPUyAocm93KSA9PSBaVik7CisgIGlmIChnbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBI CisgICAgICB8fCBnbHlwaC0+dHlwZSA9PSBHTFlQSExFU1NfR0xZUEgpCisgICAgeworICAgICAg ZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAl YyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICAlM2QgJXMgJXNcbiIsCisgICAgICAgIGdseXBo IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0g MCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAg ICAgIChnbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAgICA/ICdDJworICAgICAgICAg OiAnRycpLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBo LT5vYmplY3QpCisgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9i amVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2Jq ZWN0KQorICAgICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAg ICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIGdseXBoLT51LmNoLAorICAgICAgICBn bHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAg Z2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9w ID8gIlpWIiA6ICItLSIsCisgICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nIChnbHlwaC0+dS5jaCkp OworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gU1RSRVRDSF9HTFlQSCkKKyAgICB7 CisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICIgJTUicEQiZC8lLTVkICU1ZCAlYyAl OSJwRCJkICVjICUzZCAweCUwNnggJTRkICUxLjFkJTEuMWQgICUzZCAlcyAlc1xuIiwKKyAgICAg ICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFth cmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVf eCwKKyAgICAgICAgJ1MnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZF UlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdCJworICAgICAgICAgIDogKFNUUklO R1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgIDogKE5JTFAg KGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICcwJworICAgICAgICAgIDogJy0nKSkpLAor ICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIDB1LAorICAgICAgICBnbHlwaC0+ ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgt PnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpW IiA6ICItLSIsCisgICAgICAgICJcXFMiKTsKKyAgICB9CisgIGVsc2UgaWYgKGdseXBoLT50eXBl ID09IElNQUdFX0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAg IiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4x ZCAgJTNkICVzICVjXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0s CisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAt IDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAnSScsCisgICAgICAgIGdseXBoLT5j aGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8g J0InCisgICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8g J1MnCisgICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJzAn CisgICAgICAgICAgOiAnLScpKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAg ICAgKHVuc2lnbmVkIGludCkgZ2x5cGgtPnUuaW1nX2lkLAorICAgICAgICBnbHlwaC0+ZmFjZV9p ZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0 X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICIt LSIsCisgICAgICAgICcuJyk7CisgICAgfQorICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBDT01Q T1NJVEVfR0xZUEgpCisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICU1 InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4IiwKKyAgICAgICAgZ2x5cGgg LSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAw KSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAg ICAgJysnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBo LT5vYmplY3QpCisgICAgICAgICAgICA/ICdCJworICAgICAgICAgIDogKFNUUklOR1AgKGdseXBo LT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5v YmplY3QpCisgICAgICAgICAgICA/ICcwJworICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBn bHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgICh1bnNpZ25lZCBpbnQpIGdseXBoLT51LmNtcC5p ZCk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgJTRkICUxLjFkJTEuMWQiLAorICAgICAgICBn bHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAg Z2x5cGgtPnJpZ2h0X2JveF9saW5lX3ApOworICAgICAgaWYgKGdseXBoLT51LmNtcC5hdXRvbWF0 aWMpCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgJTNkICVzIC4gWyVkLSVkXVxuIiwKKyAg ICAgICAgICAgICAgICAgICAgICAgICBnbHlwaC0+aHBvcywgZ2x5cGhfenZfcCA/ICJaViIgOiAi LS0iLAorICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoLT5zbGljZS5jbXAuZnJvbSwgZ2x5 cGgtPnNsaWNlLmNtcC50byk7CisgICAgICAgIGVsc2UKKyAgICAgICAgZnByaW50ZiAoc3RkZXJy LCAiXG4iKTsKKyAgICB9CisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IFhXSURHRVRfR0xZUEgp CisgICAgeworI2lmbmRlZiBIQVZFX1hXSURHRVRTCisgICAgICBlYXNzdW1lIChmYWxzZSk7Cisj ZWxzZQorICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICAlNWQvJS01ZCAlNWQgJTRj ICU2ZCAlYyAlM2QgMHglMDV4ICU0ZCAlMS4xZCUxLjFkICAlM2QgJXMgJWNcbiIsCisgICAgICAg IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJl YV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gs CisgICAgICAgICdYJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQ IChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAo Z2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICA6ICctJykpLAorICAg ICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAg ICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVf cCwKKyAgICAgICAgZ2x5cGgtPnUueHdpZGdldCwKKyAgICAgICAgZ2x5cGgtPmhwb3MsIGdseXBo X3p2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgJy4nKTsKKyNlbmRpZgorICAgIH0KK30KKwor LyogRHVtcCB0aGUgY29udGVudHMgb2YgZ2x5cGggcm93IGF0IFZQT1MgaW4gTUFUUklYIHRvIHN0 ZGVyci4KKyAgIEdMWVBIUyAwIG1lYW5zIGRvbid0IHNob3cgZ2x5cGggY29udGVudHMuCisgICBH TFlQSFMgMSBtZWFucyBzaG93IGdseXBocyBpbiBzaG9ydCBmb3JtCisgICBHTFlQSFMgPiAxIG1l YW5zIHNob3cgZ2x5cGhzIGluIGxvbmcgZm9ybS4gKi8KK3ZvaWQKK21jX2R1bXBfZ2x5cGhfcm93 IChzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCB2cG9zLCBpbnQgZ2x5cGhzKQoreworICBpbnQg cmVsYXRpdmVfeCA9IDA7CisgIGlmIChnbHlwaHMgIT0gMSkKKyAgICB7CisgICAgICBmcHJpbnRm IChzdGRlcnIsICJcbkRVTVAgR0xZUEggUk9XXG4iKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwg IlJvdyAgICAgU3RhcnQgICAgICAgRW5kIFVzZWQgb0U+PFxcQ1RaRmVzbSAgICAgWCAgICBZICAg IFcgICAgSCAgICBWICAgIEEgICAgUFxuIik7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICI9PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT1cbiIpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiJTNkICU5InBE ImQgJTkicEQiZCAlNGQgJTEuMWQlMS4xZCUxLjFkJTEuMWRcCislMS4xZCUxLjFkJTEuMWQlMS4x ZCUxLjFkJTEuMWQlMS4xZCUxLjFkICAlNGQgJTRkICU0ZCAlNGQgJTRkICU0ZCAlNGRcbiIsCisg ICAgICAgICB2cG9zLAorICAgICAgICAgTUFUUklYX1JPV19TVEFSVF9DSEFSUE9TIChyb3cpLAor ICAgICAgICAgTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSwKKyAgICAgICAgIHJvdy0+dXNl ZFtURVhUX0FSRUFdLAorICAgICAgICAgcm93LT5jb250YWluc19vdmVybGFwcGluZ19nbHlwaHNf cCwKKyAgICAgICAgIHJvdy0+ZW5hYmxlZF9wLAorICAgICAgICAgcm93LT50cnVuY2F0ZWRfb25f bGVmdF9wLAorICAgICAgICAgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCwKKyAgICAgICAgIHJv dy0+Y29udGludWVkX3AsCisgICAgICAgICBNQVRSSVhfUk9XX0NPTlRJTlVBVElPTl9MSU5FX1Ag KHJvdyksCisgICAgICAgICBNQVRSSVhfUk9XX0RJU1BMQVlTX1RFWFRfUCAocm93KSwKKyAgICAg ICAgIHJvdy0+ZW5kc19hdF96dl9wLAorICAgICAgICAgcm93LT5maWxsX2xpbmVfcCwKKyAgICAg ICAgIHJvdy0+ZW5kc19pbl9taWRkbGVfb2ZfY2hhcl9wLAorICAgICAgICAgcm93LT5zdGFydHNf aW5fbWlkZGxlX29mX2NoYXJfcCwKKyAgICAgICAgIHJvdy0+bW91c2VfZmFjZV9wLAorICAgICAg ICAgcm93LT54LAorICAgICAgICAgcm93LT55LAorICAgICAgICAgcm93LT5waXhlbF93aWR0aCwK KyAgICAgICAgIHJvdy0+aGVpZ2h0LAorICAgICAgICAgcm93LT52aXNpYmxlX2hlaWdodCwKKyAg ICAgICAgIHJvdy0+YXNjZW50LAorICAgICAgICAgcm93LT5waHlzX2FzY2VudCk7CisgICAgICAv KiBUaGUgbmV4dCAzIGxpbmVzIHNob3VsZCBhbGlnbiB0byAiU3RhcnQiIGluIHRoZSBoZWFkZXIu ICovCisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgICAgJTkicEQiZCAlOSJwRCJkXHQlNWRcbiIs IHJvdy0+c3RhcnQub3ZlcmxheV9zdHJpbmdfaW5kZXgsCisgICAgICAgICByb3ctPmVuZC5vdmVy bGF5X3N0cmluZ19pbmRleCwKKyAgICAgICAgIHJvdy0+Y29udGludWF0aW9uX2xpbmVzX3dpZHRo KTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgICAlOSJwRCJkICU5InBEImRcbiIsCisgICAg ICAgICBDSEFSUE9TIChyb3ctPnN0YXJ0LnN0cmluZ19wb3MpLAorICAgICAgICAgQ0hBUlBPUyAo cm93LT5lbmQuc3RyaW5nX3BvcykpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICAgICU5ZCAl OWRcbiIsIHJvdy0+c3RhcnQuZHB2ZWNfaW5kZXgsCisgICAgICAgICByb3ctPmVuZC5kcHZlY19p bmRleCk7CisgICAgfQorICBpZiAoZ2x5cGhzID4gMSkKKyAgICB7CisgICAgICBmb3IgKGludCBh cmVhID0gTEVGVF9NQVJHSU5fQVJFQTsgYXJlYSA8IExBU1RfQVJFQTsgKythcmVhKQorICAgICAg ICB7CisgICAgICAgICAgc3RydWN0IGdseXBoICpnbHlwaCA9IHJvdy0+Z2x5cGhzW2FyZWFdOwor ICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGhfZW5kID0gZ2x5cGggKyByb3ctPnVzZWRbYXJl YV07CisgICAgICAgICAgLyogR2x5cGggZm9yIGEgbGluZSBlbmQgaW4gdGV4dC4gKi8KKyAgICAg ICAgICBpZiAoYXJlYSA9PSBURVhUX0FSRUEgJiYgZ2x5cGggPT0gZ2x5cGhfZW5kICYmIGdseXBo LT5jaGFycG9zID4gMCkKKyAgICAgICAgICAgICsrZ2x5cGhfZW5kOworICAgICAgICAgIGlmIChn bHlwaCA8IGdseXBoX2VuZCkKKyAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIkdseXBoIy9U b3RhbCBSZWwuWCBUICAgICAgIFBvcyBPICAgVyAgICAgQ29kZSBGYWNlIExSIEhQT1MgWlYgQ1xu Iik7CisgICAgICAgICAgZm9yICg7IGdseXBoIDwgZ2x5cGhfZW5kOyArK2dseXBoKQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICBtY19kdW1wX2dseXBoIChyb3csIGdseXBoLCBhcmVhLCBy ZWxhdGl2ZV94LCB2cG9zKTsKKyAgICAgICAgICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4 ZWxfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZiAo Z2x5cGhzID09IDEpCisgICAgICB7CisgICAgICAgIGNoYXIgc1tTSFJUX01BWCArIDRdOworICAg ICAgICBmb3IgKGludCBhcmVhID0gTEVGVF9NQVJHSU5fQVJFQTsgYXJlYSA8IExBU1RfQVJFQTsg KythcmVhKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGludCBpOworICAgICAgICAgICAgZm9y IChpID0gMDsgaSA8IHJvdy0+dXNlZFthcmVhXTsgKytpKQorICAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgc3RydWN0IGdseXBoICpnbHlwaCA9IHJvdy0+Z2x5cGhzW2FyZWFdICsgaTsK KyAgICAgICAgICAgICAgICBpZiAoaSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAg ICAgICAgICAgICYmIGFyZWEgPT0gVEVYVF9BUkVBCisgICAgICAgICAgICAgICAgICAgICYmIE5J TFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT50eXBlID09 IENIQVJfR0xZUEgKKyAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGgtPnUuY2ggPT0gJyAnKQor ICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzdHJjcHkgKCZzW2ldLCAi W1xcbl0iKTsKKyAgICAgICAgICAgICAgICAgICAgaSArPSA0OworICAgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGgtPnUuY2ggPCAweDgwCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaC0+dS5jaCA+PSAnICcpCisgICAgICAgICAgICAg ICAgICAgIHNbaV0gPSBnbHlwaC0+dS5jaDsKKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICAgICAgICAgIHNbaV0gPSAnLic7CisgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgIHNbaV0gPSAnXDAnOworICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiJTNkOiAoJWQp ICclcydcbiIsIHZwb3MsIHJvdy0+ZW5hYmxlZF9wLCBzKTsK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gICAgICAgICAgICAgICAgJiYgeXBvcyA+IDApCisgICAgICAgICAgICAgICAgICAg ICAgPyB5cG9zICsgMQorICAgICAgICAgICAgICAgICAgICAgIDogeXBvczsKKyAgICAgIGlmICh2 aXNpYmxlX3ApCisgICAgICAgIHZwb3MgPSB2b2Zmc2V0OworICAgICAgICBlbHNlCisgICAgICAg ICAgdnBvcyA9IDA7CisgICAgfQorICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgQ0hFQ0tfTlVN QkVSIChyb3cpOworICAgICAgICB2cG9zID0gWEZJWE5VTSAocm93KTsKKyAgICAgIH0KKyAgaWYg KHZwb3MgPj0gMCAmJiB2cG9zIDwgbWF0cml4LT5ucm93cykKKyAgICBtY19kdW1wX2dseXBoX3Jv dyAoTUFUUklYX1JPVyAobWF0cml4LCB2cG9zKSwKKyAgICAgICAgdnBvcywKKyAgICAgICAgVFlQ RV9SQU5HRURfRklYTlVNUCAoaW50LCBnbHlwaHMpID8gWEZJWE5VTSAoZ2x5cGhzKSA6IDIpOwor ICByZXR1cm4gUW5pbDsKK30KKwordm9pZAorbWNfZHVtcF9nbHlwaF9tYXRyaXggKHN0cnVjdCBn bHlwaF9tYXRyaXggKm1hdHJpeCwgaW50IGdseXBocykKK3sKKyAgaW50IGk7CisgIGZvciAoaSA9 IDA7IGkgPCBtYXRyaXgtPm5yb3dzOyArK2kpCisgICAgbWNfZHVtcF9nbHlwaF9yb3cgKE1BVFJJ WF9ST1cgKG1hdHJpeCwgaSksIGksIGdseXBocyk7Cit9CisKK0RFRlVOICgibWMtZHVtcC1nbHlw aC1tYXRyaXgiLCBGbWNfZHVtcF9nbHlwaF9tYXRyaXgsCisgICAgICAgU21jX2R1bXBfZ2x5cGhf bWF0cml4LCAwLCAxLCAicCIsCisgICAgICAgZG9jOiAvKiBEdW1wIHRoZSBjdXJyZW50IG1hdHJp eCBvZiB0aGUgc2VsZWN0ZWQgd2luZG93IHRvIHN0ZGVyci4KK1Nob3dzIGNvbnRlbnRzI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ocykgPyBYRklYTlVNIChnbHlwaHMpIDogMCk7 CisgIHJldHVybiBRbmlsOworfQorCitib29sCittY190cmF2ZXJzZV9jYWNoZV9wIChzdHJ1Y3Qg bWNfbWF0cml4IG1hdHJpeCwgZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUsCisgICAgICAg ICAgICAgICAgICAgICBpbnQgdm50aCwgaW50IG50aCkKK3sKKyAgaWYgKHZudGggPCBtYXRyaXgu dnBvc191c2VkCisgICAgICAmJiBtYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5cGVdID4gMAor ICAgICAgJiYgbnRoIDwgbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXSkK KyAgICByZXR1cm4gdHJ1ZTsKKyAgICBlbHNlCisgICAgICByZXR1cm4gZmFsc2U7Cit9CisKK3Zv aWQKK21jX3Jlc2V0X2NhY2hlIChzdHJ1Y3Qgd2luZG93ICp3KQoreworICBpZiAoIUJVRkZFUlAg KHctPmNvbnRlbnRzKSkKKyAgICByZXR1cm47CisgIGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNh Y2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7CisgICAg ICAgKytjYWNoZV90eXBlKQorICAgIHsKKyAgICAgIGJvb2wgYnZhcl9hY3RpdmVfcDsKKyAgICAg IHN3aXRjaCAoY2FjaGVfdHlwZSkKKyAgICAgICAgeworICAgICAgICAgIGNhc2UgTk9fQ0FDSEU6 CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAg ICAgICAgICBjYXNlIE1DX0NBQ0hFOgorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAo QlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAmJiBOSUxQIChCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkKKyAgICAgICAgICAgICAgICBidmFyX2Fj dGl2ZV9wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoQlVGRkVSUCAody0+Y29u dGVudHMpCisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIg KHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQorICAgICAgICAgICAgICAgICAgYnZhcl9hY3RpdmVf cCA9IHRydWU7CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAg IGNhc2UgQ0hfQ0FDSEU6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmIChCVUZGRVJQ ICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIg KHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgICAgICAgICAgICAgIGJ2YXJfYWN0aXZl X3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBlbHNlIGlmIChCVUZGRVJQICh3LT5jb250ZW50 cykKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisgICAgICAgICAgICAgICAgICBidmFyX2FjdGl2ZV9w ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAg Y2FzZSBGQ19DQUNIRToKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKEJVRkZFUlAg KHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpCisgICAgICAgICAgICAgICAgYnZhcl9hY3RpdmVf cCA9IGZhbHNlOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRz KQorICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIGZjX3Zpc2libGUpKSkKKyAgICAgICAgICAgICAgICAgIGJ2YXJfYWN0aXZlX3Ag PSB0cnVlOworICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQor ICAgICAgaWYgKCFidmFyX2FjdGl2ZV9wKQorICAgICAgICB7CisgICAgICAgICAgLyogRGVjcmVh c2UgdGhlIHNpemUgb2YgdGhlIGFycmF5IHRvIGEgYmFyZSBtaW5pbXVtLiAqLworICAgICAgICAg IGZvciAoaW50IHZudGggPSAwOyB2bnRoIDwgdy0+bWNfbWF0cml4LnZwb3NfdXNlZDsgKyt2bnRo KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAody0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVfYWxsb2NhdGVkW2NhY2hlX3R5cGVdID4gMSkKKyAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XSA9CisgICAgICAgICAgICAgICAgICAgIHhucmVhbGxvYyAody0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV0sIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg c2l6ZW9mICp3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXSk7CisgICAg ICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2Fj aGVfdHlwZV0gPSAxOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgdy0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXSA9IDA7CisgICAgICAgICAgICB9 CisgICAgICAgICAgd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rdm50aCkKKyAgICAgICAgICAgICAgdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXSA9IDA7CisgICAgICAg ICAgICB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5cGVdID0gMDsKKyAgICAgICAg ICB9CisgICAgfQorfQorCitzdGF0aWMgdm9pZAorbWNfaGVscGVyIChzdHJ1Y3Qgd2luZG93ICp3 LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKKyAg ICAgICAgICAgc3RydWN0IGdseXBoICpnbHlwaCwgaW50IHgsIGludCBmeCwgaW50IHksIGludCBm eSwgaW50IGhwb3MsIGludCB2cG9zLAorICAgICAgICAgICBpbnQgd2QsIGludCBoLCBlbnVtIG1j X2N1cnNvcl90eXBlIGN1cnNvcl90eXBlLCBpbnQgY3Vyc29yX3dpZHRoLAorICAgICAgICAgICBl bnVtIG1jX3Jvd19wb3NpdGlvbiByb3dfcG9zaXRpb24sIHN0cnVjdCBtY19SR0IgZm9yZWdyb3Vu ZCwKKyAgICAgICAgICAgc3RydWN0IG1jX1JHQiBiYWNrZ3JvdW5kLCBib29sIGFjdGl2ZV9wLCBl bnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IsCisgICAgICAgICAgIGJvb2wgZHJhd19wLCBlbnVt IG1jX2RyYXdfcm93X3R5cGUgZnJvbV93aGVyZSwKKyAgICAgICAgICAgZW51bSBtY19jYWNoZV90 eXBlIGNhY2hlX3R5cGUsIGVudW0gbWNfZW5naW5lX3R5cGUgYWN0aW9uX3R5cGUpCit7CisgIGlu dCB2bnRoID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgIGlmIChtY19zdGRlcnJf cAorICAgICAgJiYgZHJhd19wKQorICAgIHsKKyAgICAgIGludCBjaGFycG9zID0gZ2x5cGgtPmNo YXJwb3M7CisgICAgICBmc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gKGRyYXdfcAorICAgICAgJiYgKGZyb21fd2hl cmUgPT0gU0tJUFBFRAorICAgICAgICAgIHx8IGZyb21fd2hlcmUgPT0gUE9TVF9DSEFOR0VECisg ICAgICAgICAgfHwgZnJvbV93aGVyZSA9PSBVTkNIQU5HRUQKKyAgICAgICAgICB8fCBmcm9tX3do ZXJlID09IFNFVF9DVVJTT1JfVFdPKSkKKyAgICB7CisgICAgICBib29sIHNhbWVfcCA9IGZhbHNl OworICAgICAgZm9yIChpbnQgbnRoID0gMDsgbnRoIDwgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVfdXNlZFtjYWNoZV90eXBlXTsgKytudGgpCisgICAgICAgIHsKKyAgICAgICAgICBzYW1l X3AgfD0KKyAgICAgICAgICAgICh3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhdLnNhbWVfcCA9PSB0cnVlCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5nbHlwaC50eXBlID09IGdseXBoLT50eXBl CisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXS5nbHlwaC5ieXRlcG9zID09IGdseXBoLT5ieXRlcG9zCisgICAgICAgICAgICAgJiYg dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5nbHlwaC5jaGFy cG9zID09IGdseXBoLT5jaGFycG9zCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5nbHlwaC51LnZhbCA9PSBnbHlwaC0+dS52YWwK KyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLmdseXBo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c2xpY2UuaW1nLndp ZHRoID09IGdseXBoLT5zbGljZS5pbWcud2lkdGgKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLnNsaWNlLmltZy5oZWln aHQgPT0gZ2x5cGgtPnNsaWNlLmltZy5oZWlnaHQKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLnNsaWNlLmNtcC5mcm9t ID09IGdseXBoLT5zbGljZS5jbXAuZnJvbQorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ueCA9PSB4CisgICAgICAgICAgICAgJiYg dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5meCA9PSBmeAor ICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF0ueSA9PSB5CisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXS5meSA9PSBmeQorICAgICAgICAgICAgICYmIHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uaHBvcyA9PSBocG9zCisgICAgICAg ICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS52 cG9zID09IHZwb3MKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhdLndkID09IHdkCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1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RpdmVf cAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF0uZ2x5cGhfZmxhdm9yID09IGdseXBoX2ZsYXZvcgorICAgICAgICAgICAgICYmIHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ucm93X3Bvc2l0aW9u ID09IHJvd19wb3NpdGlvbgorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZW5hYmxlZF9wID09IHRydWUpOworICAgICAgICB9Cisg ICAgICAvKiBJbiBhIHNpdHVhdGlvbiB3aGVyZSB0aGVyZSBhcmUgbm8gY2hhbmdlcyAoZS5nLiwg Qy1nKSwgd2Ugc3RpbGwgbmVlZCB0bworICAgICAgcmVzZXQgdGhlIGxlZnQvcmlnaHQgZnJpbmdl IGJpdG1hcCBpbmRpY2F0b3JzLiAqLworICAgICAgaWYgKCFzYW1lX3AKKyAgICAgICAgICB8fCBj dXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICB8fCBjdXJzb3Jf dHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQKQorICAgICAgICBtY19kcmF3X2VyYXNlX2h5 YnJpZCAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsIGN1 cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoLCBm b3JlZ3JvdW5kLCBhY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCByZW1vdmVfcCk7CisgICAgICByZXR1 cm47CisgICAgfQorICAgIGVsc2UgaWYgKGRyYXdfcAorICAgICAgICAgICAgICYmIChmcm9tX3do ZXJlID09IFNDUklCRV9PTkUKKyAgICAgICAgICAgICAgICAgfHwgZnJvbV93aGVyZSA9PSBTQ1JJ QkVfVFdPCisgICAgICAgICAgICAgICAgIHx8IGZyb21fd2hlcmUgPT0gU0NSSUJFX1RIUkVFCisg ICAgICAgICAgICAgICAgIHx8IGZyb21fd2hlcmUgPT0gTk9XSEVSRSkpCisgICAgICB7CisgICAg ICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBo cG9zLCB2cG9zLCB3ZCwgaCwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIHJl bW92ZV9wKTsKKyAgICAgICAgcmV0dXJuOworICAgICAgfQorICBpZiAoY2FjaGVfdHlwZSA9PSBO T19DQUNIRSkKKyAgICByZXR1cm47CisgICsrdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtjYWNo ZV90eXBlXTsKKyAgaWYgKHZudGggPj0gdy0+bWNfbWF0cml4LnZwb3NfdXNlZCkKKyAgICB3LT5t Y19tYXRyaXgudnBvc191c2VkID0gdm50aCArIDE7CisgIGlmICh3LT5tY19tYXRyaXgudnBvc19h bGxvY2F0ZWQgPCB3LT5tY19tYXRyaXgudnBvc191c2VkKQorICAgIHsKKyAgICAgIGludCBvbGRf YWxsb2MgPSB3LT5tY19tYXRyaXgudnBvc19hbGxvY2F0ZWQ7CisgICAgICBpbnQgbmV3X2VsdHMg PSB3LT5tY19tYXRyaXgudnBvc191c2VkIC0gdy0+bWNfbWF0cml4LnZwb3NfYWxsb2NhdGVkOwor ICAgICAgdy0+bWNfbWF0cml4LnZwb3MgPSB4cGFsbG9jICh3LT5tY19tYXRyaXgudnBvcywgJnct Pm1jX21hdHJpeC52cG9zX2FsbG9jYXRlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgbmV3X2VsdHMsIElOVF9NQVgsIHNpemVvZiAqdy0+bWNfbWF0cml4LnZwb3MpOworICAg ICAgbWVtc2V0ICh3LT5tY19tYXRyaXgudnBvcyArIG9sZF9hbGxvYywgMCwKKyAgICAgICAgICAg ICAgICh3LT5tY19tYXRyaXgudnBvc19hbGxvY2F0ZWQgLSBvbGRfYWxsb2MpICogc2l6ZW9mICp3 LT5tY19tYXRyaXgudnBvcyk7CisgICAgfQorICArK3ctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlX3VzZWRbY2FjaGVfdHlwZV07CisgIGlmICh3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV0gPCB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91 c2VkW2NhY2hlX3R5cGVdKQorICAgIHsKKyAgICAgIGludCBvbGRfYWxsb2MgPSB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV07CisgICAgICBpbnQgbmV3 X2VsdHMgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdIC0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVkW2NhY2hlX3R5cGVdOworICAg ICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV0gPSB4cGFsbG9jICh3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXSwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlX2FsbG9jYXRlZFtjYWNoZV90eXBlXSwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2VsdHMsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IElOVF9NQVgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHNpemVvZiAqdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV0pOworICAgICAgbWVtc2V0ICh3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXSArIG9sZF9hbGxvYywgMCwKKyAgICAgICAgICAgICAgICh3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV0gLSBvbGRfYWxsb2MpCisgICAgICAg ICAgICAgICAgICogc2l6ZW9mICp3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXSk7CisgICAgfQorICBpbnQgbnRoID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVf dXNlZFtjYWNoZV90eXBlXSAtIDE7CisgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF0uc2FtZV9wID0gZmFsc2U7CisgIHctPm1jX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGgudHlwZSA9IGdseXBoLT50eXBlOworICB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLmJ5dGVwb3Mg PSBnbHlwaC0+Ynl0ZXBvczsKKyAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXS5nbHlwaC5jaGFycG9zID0gZ2x5cGgtPmNoYXJwb3M7CisgIHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGgudS52YWw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WN0IGdseXBoX3JvdyAqcm93LCBpbnQgeCwgaW50ICpmeCwgaW50IHksCisgICAg ICAgICAgICAgICAgICAgICAgICBpbnQgKmZ5LCBpbnQgaHBvcywgaW50IHZwb3MsIGludCAqaCwK KyAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUs IGludCBjdXJzb3Jfd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgKndkKQorewor ICBzdHJ1Y3QgZ2x5cGggKmdseXBoID0gbWNfZ2V0X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCBy b3csIGhwb3MsIHZwb3MpOworICBpZiAoZ2x5cGggPT0gTlVMTCkKKyAgICByZXR1cm47CisgIHN0 cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7CisgICpmeCA9IFdJTkRP V19URVhUX1RPX0ZSQU1FX1BJWEVMX1ggKHcsIHgpOworICAqaCA9IHJvdy0+dmlzaWJsZV9oZWln aHQ7CisgIC8qIERvbid0IGxldCB0aGUgY3Vyc29yIGV4Y2VlZCB0aGUgZGltZW5zaW9ucyBvZiB0 aGUgcm93LCBzbyB0aGF0CisgIHRoZSB1cHBlci9sb3dlciBzaWRlIG9mIHRoZSBib3ggYXJlbid0 IGNsaXBwZWQuICAqLworICBpbnQgd19oZWFkZXJfbGluZV9oZWlnaHQgPSBXSU5ET1dfSEVBREVS X0xJTkVfSEVJR0hUICh3KTsKKyAgaW50IHdfdGV4dF9ib3R0b21feSA9IHdpbmRvd190ZXh0X2Jv dHRvbV95ICh3KSAtICpoOworICBpZiAoeSA8IHdfaGVhZGVyX2xpbmVfaGVpZ2h0KQorICAgIHsK KyAgICAgICpoID0gbWF4ICgqaCAtICh3X2hlYWRlcl9saW5lX2hlaWdodCAtIHkpICsgMSwgKmgp OworICAgICAgeSA9IHdfaGVhZGVyX2xpbmVfaGVpZ2h0IC0gMTsKKyAgICAgIC8vIGZwcmludGYg KHN0ZGVyciwgIkNPTkRJVElPTiAjIDFcbiIpOworICAgIH0KKyAgIGVsc2UgaWYgKHkgPiB3X3Rl eHRfYm90dG9tX3kpCisgICAgIHsKKyAgICAgICAqaCArPSB5IC0gd190ZXh0X2JvdHRvbV95Owor ICAgICAgIHkgPSB3X3RleHRfYm90dG9tX3k7CisgICAgICAgLy8gZnByaW50ZiAoc3RkZXJyLCAi Q09ORElUSU9OICMgMlxuIik7CisgICAgIH0KKyAgKmZ5ID0gV0lORE9XX1RPX0ZSQU1FX1BJWEVM X1kgKHcsIHkpOworICBzd2l0Y2ggKGN1cnNvcl90eXBlKQorICAgIHsKKyAgICAgIGNhc2UgTUNf QkFSOgorICAgICAgICB7CisgICAgICAgICAgaWYgKGN1cnNvcl93aWR0aCA8IDEpCisgICAgICAg ICAgICBjdXJzb3Jfd2lkdGggPSBtYXggKEZSQU1FX0NVUlNPUl9XSURUSCAoZiksIDEpOworICAg ICAgICAgIGlmIChjdXJzb3Jfd2lkdGggPCBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAg KndkID0gY3Vyc29yX3dpZHRoOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBj YXNlIE1DX0hCQVI6CisgICAgICAgIHsKKyAgICAgICAgICBpbnQgY3Vyc29yX2hlaWdodCA9IChj dXJzb3Jfd2lkdGggPCAxKSA/IGxyaW50ICgwLjI1ICogKmgpIDogY3Vyc29yX3dpZHRoOworICAg ICAgICAgIGlmIChjdXJzb3JfaGVpZ2h0ID4gcm93LT5oZWlnaHQpCisgICAgICAgICAgICBjdXJz b3JfaGVpZ2h0ID0gcm93LT5oZWlnaHQ7CisgICAgICAgICAgLyogQ3Vyc29yIHNtYWxsZXIgdGhh biBsaW5lIGhlaWdodCwgc28gbW92ZSBkb3duLiAqLworICAgICAgICAgIGlmICgqaCA+IGN1cnNv cl9oZWlnaHQpCisgICAgICAgICAgICAqZnkgKz0gKmggLSBjdXJzb3Jfa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8ICpoICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAg IGN1cnNvcl93aWR0aCwgeCwgKmZ4LCB5LCAqZnksICp3ZCwgKmgpOworKi8KK30KKwordm9pZAor bWNfZW5naW5lIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgs IHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKKyAgICAgICAgICAgc3RydWN0IGdseXBoICpnbHlwaCwg aW50IGFyZWEsIGludCByZWxhdGl2ZV94LCBpbnQgeF9saW1pdCwgaW50IHksCisgICAgICAgICAg IGludCBocG9zLCBpbnQgdnBvcywgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSwgaW50 IGN1cnNvcl93aWR0aCwKKyAgICAgICAgICAgc3RydWN0IGdseXBoX21hdHJpeCAqY3Vyc29yX21h dHJpeCwgc3RydWN0IG1jX2Vzc2VudGlhbHMgZXNzZW50aWFscywKKyAgICAgICAgICAgZW51bSBt Y19yb3dfcG9zaXRpb24gcm93X3Bvc2l0aW9uLCBzdHJ1Y3QgbWNfUkdCIGZvcmVncm91bmQsCisg ICAgICAgICAgIGVudW0gbWNfZW5naW5lX3R5cGUgYWN0aW9uX3R5cGUsIGJvb2wgZHJhd19wLAor ICAgICAgICAgICBlbnVtIG1jX2RyYXdfcm93X3R5cGUgZnJvbV93aGVyZSwgZW51bSBtY19jYWNo ZV90eXBlIGNhY2hlX3R5cGUpCit7CisgIGludCBvcG9pbnRfeCA9IHctPmN1cnNvci54OworICBp bnQgb3BvaW50X3kgPSB3LT5jdXJzb3IueTsKKyAgaW50IG9wb2ludF9ocG9zID0gdy0+Y3Vyc29y Lmhwb3M7CisgIGludCBvcG9pbnRfdnBvcyA9IHctPmN1cnNvci52cG9zOworICBpbnQgZngsIGZ5 LCBoLCB3ZDsKKyAgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeSAodywgbWF0cml4LCByb3csIHJlbGF0 aXZlX3gsICZmeCwgeSwgJmZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAmaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgJndkKTsKKyAgaW50IG9wb2ludF9meCA9 IFdJTkRPV19URVhUX1RPX0ZSQU1FX1BJWEVMX1ggKHcsIG9wb2ludF94KTsKKyAgaW50IGZjX2Z4 ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgZXNzZW50aWFscy5mY194KTsKKyAg Ym9vbCBnbHlwaF96dl9wID0gKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ct PnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAmJiBNQVRSSVhfUk9XX0VORF9D SEFSUE9TIChyb3cpID09IFpWKTsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFt ZSk7CisgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSICh3LT5jb250ZW50cyk7CisgIGludCB0 ZXh0X2FyZWFfd2lkdGggPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOworICBzdHJ1 Y3QgZ2x5cGhfcm93ICpjdXJzb3Jfcm93ID0gKHctPmN1cnNvci52cG9zICE9IC0xKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XIChjdXJzb3JfbWF0cml4LCB3 LT5jdXJzb3IudnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTlVMTDsK KyAgc3RydWN0IGdseXBoICpjdXJzb3JfZ2x5cGggPSAody0+Y3Vyc29yLnZwb3MgIT0gLTEpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY19nZXRfY3Vyc29yX2dseXBoICh3LCBj dXJzb3JfbWF0cml4LCBjdXJzb3Jfcm93LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTlVMTDsKKyAgYm9vbCBjdXJzb3JfYXRf ZnJpbmdlX3AgPSAoY3Vyc29yX2dseXBoID09IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgY3Vyc29yX3JvdyAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIHctPmN1cnNvci5ocG9zID09IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93LT5leGFjdF93aW5kb3dfd2lkdGhf bGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID09IHRl eHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3Iu eCA9PSBjdXJzb3Jfcm93LT5waXhlbF93aWR0aCk7CisgIGJvb2wgY3Vyc29yX2JleW9uZF9mcmlu Z2VfcCA9IChjdXJzb3JfZ2x5cGggPT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgY3Vyc29yX3JvdyAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFjdXJzb3Jfcm93LT5leGFjdF93aW5k b3dfd2lkdGhfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5j dXJzb3IueCA+PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHctPmN1cnNvci54ID49IGN1cnNv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0ZCAlMS4xZCUxLjFkICAlM2QgJXMgJXNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5n bHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDog cm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgIChnbHlw aC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAgICA/ICdDJworICAgICAgICAgOiAnRycpLAor ICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3Qp CisgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAg ICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAg ICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICAgICAg ICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIGdseXBoLT51LmNoLAorICAgICAgICBnbHlw aC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5 cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8g IlpWIiA6ICItLSIsCisgICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nIChnbHlwaC0+dS5jaCkpOwor ICBzd2l0Y2ggKGFjdGlvbl90eXBlKQorICB7CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8q ICAgICAgICAgICAgICAgTVVMVElQTEVfQ1VSU09SUzogIENIQVJfR0xZUEggfCBHTFlQS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XRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gs IGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICB3ZCwgaCwgY3Vyc29y X3R5cGUsIGN1cnNvcl93aWR0aCwgcm93X3Bvc2l0aW9uLCBmb3JlZ3JvdW5kLAorICAgICAgICAg ICAgICAgICAgIGJhY2tncm91bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3 X3AsIGZyb21fd2hlcmUsCisgICAgICAgICAgICAgICAgICAgY2FjaGVfdHlwZSwgYWN0aW9uX3R5 cGUpOworICAgICAgaWYgKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVz ZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYgcmVsYXRpdmVfeCA8PSB4X2xpbWl0KQorICAgICAg ICB7CisgICAgICAgICAgaWYgKHJlbGF0aXZlX3ggPCByb3ctPnBpeGVsX3dpZHRoKQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0aDsK KyAgICAgICAgICAgICAgZnggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgfQor ICAgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBm eCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICB4X2xpbWl0IC0gcmVs YXRpdmVfeCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcm93X3Bvc2l0aW9uLAorICAg ICAgICAgICAgICAgICAgICAgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwgZXNzZW50aWFscy5hY3Rp dmVfcCwgTUNfR0xZUEhMRVNTLAorICAgICAgICAgICAgICAgICAgICAgZHJhd19wLCBmcm9tX3do ZXJlLCBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICAgIH0KKyAgICAgIGJyZWFrOwor ICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICBWRVJUSUNB TF9SVUxFUjogIENIQVJfR0xZUEggfCBHTFlQSExFU1NfR0xZUEggICAgICAgICAgICAgICAgICov CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIFZFUlRJQ0FMX1JVTEVSOgorICAg IHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChjdXJzb3JfYXRfZnJpbmdl X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPmNvbnRpbnVl ZF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FM X0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1 cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgIXJvdy0+Y29udGludWVkX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9B UlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9u ZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93 LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3ctPnVzZWRbVEVY VF9BUkVBXSAhPSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAh cm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ct PnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvcG9pbnRfeCA+PSByb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOiAoZ2x5cGhfenZfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBNQ19HTFlQSExFU1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xZUEggfCBHTFlQ SExFU1NfR0xZUEggICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8K KyAgICBjYXNlIEZJTExfQ09MVU1OOgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBo X2ZsYXZvciA9IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2Fy ZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlh bHMuZmNfeCA+PSByb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAoZ2x5cGhfenZfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog KCFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX3Zl cnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IG9wb2ludF95ID09IHkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IG9wb2ludF92cG9zID09IHZwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IE1DX0dMWVBIOworICAgICAgd2QgPSAxOworICA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LS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAg ICAgICAgICAgICAgICAgICAgIEJFR0lOOiAgU1RSRVRDSF9HTFlQSCAgICAgICAgICAgICAgICAg ICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgZWxzZSBpZiAoZ2x5cGgt PnR5cGUgPT0gU1RSRVRDSF9HTFlQSCkKKyAgeworICAgIGlmIChtY19zdGRlcnJfcCkKKyAgICAg IGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIlxuICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQi ZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICAlM2QgJXMgJXNcbiIsCisgICAgICAgIGds eXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0g PT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisg ICAgICAgICdTJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChn bHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNUUklOR1AgKGdseXBo LT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgOiAoTklMUCAoZ2x5cGgt Pm9iamVjdCkKKyAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAgICA6ICctJykpKSwK KyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAwdSwKKyAgICAgICAgZ2x5cGgt PmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9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hPUklaT05UQUxfUlVMRVI6ICBTVFJFVENIX0dMWVBIICAgICAgICAgICAgICAg ICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgSE9SSVpPTlRBTF9S VUxFUjoKKyAgICB7CisgICAgICBpZiAocmVsYXRpdmVfeCA8IHJvdy0+cGl4ZWxfd2lkdGgKKyAg ICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICBtY19oZWxwZXIgKHcsIG1h dHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAg ICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9z aXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZCwgZXNzZW50 aWFscy5hY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAg ICAgICAgICBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICBpZiAoZ2x5cGggLSByb3ct PmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiBy ZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAocmVsYXRpdmVf eCA8IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHJlbGF0 aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICBmeCArPSBnbHlwaC0+ cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgICAgdGVtcF9mYWNlX2lkID0gKHJv dy0+ZmlsbF9saW5lX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgPyBnbHlwaC0+ZmFjZV9p ZAorICAgICAgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAg IHN0cnVjdCBtY19SR0IgYmFja2dyb3VuZDsKKyAgICAgICAgICBtY19zZXRfbHNsX2JnICh3LCB0 ZW1wX2ZhY2VfaWQsICZiYWNrZ3JvdW5kKTsKKyAgICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJp eCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAg ICAgICAgICAgICAgICAgeF9saW1pdCAtIHJlbGF0aXZlX3gsIGgsIGN1cnNvcl90eXBlLCB4X2xp bWl0IC0gcmVsYXRpdmVfeCwKKyAgICAgICAgICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgZm9y ZWdyb3VuZCwgYmFja2dyb3VuZCwgZXNzZW50aWFscy5hY3RpdmVfcCwKKyAgICAgICAgICAgICAg ICAgICAgIE1DX0dMWVBITEVTUywgZHJhd19wLCBmcm9tX3doZXJlLCBjYWNoZV90eXBlLCBhY3Rp b25fdHlwZSk7CisgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgIFZFUlRJQ0FMX1JVTEVSOiAg U1RSRVRDSF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KKyAgICBjYXNlIFZFUlRJQ0FMX1JVTEVSOgorICAgIHsKKyAgICAgIGlmIChyb3ctPmZp bGxfbGluZV9wCisgICAgICAgICAgJiYgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09 IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiBvcG9pbnRfeCA+IHJlbGF0aXZlX3gg KyBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAgICAgIHRlbXBfZmFjZV9pZCA9IGdseXBoLT5mYWNl X2lkOworICAgICAgICBlbHNlIGlmICghcm93LT5maWxsX2xpbmVfcAorICAgICAgICAgICAgICAg ICAmJiBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0g MQorICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeCA+IHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4 ZWxfd2lkdGgpCisgICAgICAgICAgdGVtcF9mYWNlX2lkID0gREVGQVVMVF9GQUNFX0lEOworICAg ICAgc3RydWN0IG1jX1JHQiBiYWNrZ3JvdW5kOworICAgICAgbWNfc2V0X2xzbF9iZyAodywgdGVt cF9mYWNlX2lkLCAmYmFja2dyb3VuZCk7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2 b3IgPSAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPmNvbnRpbnVlZF9wCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVIK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2Vf cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0 ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBN Q19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJ R0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3Jf YmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0gIT0gMQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFS CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBITEVTUzsKKyAg ICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAg ICAgICAgfHwgZ2x5cGh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0tLS0gKi8KKyAgZWxzZSBpZiAoZ2x5 cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgIHsKKyAgICBpZiAobWNfc3RkZXJyX3ApCisgICAg ICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICJcbiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBE ImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4xZCAgJTNkICVzICVjXG4iLAorICAgICAgICBn bHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2VkW2FyZWFd ID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94LAor ICAgICAgICAnSScsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAo Z2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJTkdQIChnbHlw aC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICAgIDogKE5JTFAgKGdseXBo LT5vYmplY3QpCisgICAgICAgICAgICAgICA/ICcwJworICAgICAgICAgICAgICAgOiAnLScpKSks CisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgKHVuc2lnbmVkIGludCkgZ2x5 cGgtPnUuaW1nX2lkLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxl ZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAg IGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7Cisg IHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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LTVkICU1ZCAlYyAlOSJwRCJk ICVjICUzZCAweCUwNngiLAorICAgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVB XSwKKyAgICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJl YV0gLSAxKSwKKyAgICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAgICcrJywKKyAgICAgICAg ICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAg ICAgICAgICAgPyAnQicKKyAgICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAg ICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkK KyAgICAgICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICAgICAgICAgOiAnLScpKSksCisgICAg ICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAgICh1bnNpZ25lZCBpbnQpIGdseXBo LT51LmNtcC5pZCk7CisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAlNGQgJTEuMWQlMS4xZCIs CisgICAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xp bmVfcCwKKyAgICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCk7CisgICAgICBpZiAoZ2x5 cGgtPnUuY21wLmF1dG9tYXRpYykKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICAlM2QgJXMg LiBbJWQtJWRdXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoLT5ocG9zLCBnbHlw aF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGgtPnNs aWNlLmNtcC5mcm9tLCBnbHlwaC0+c2xpY2UuY21wLnRvKT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GN1cnNvcl93aWR0aCwgcm93X3Bv c2l0aW9uLCBmb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQs IGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBITEVTUywgZHJhd19wLAorICAgICAgICAgICAg ICAgICAgICAgICAgIGZyb21fd2hlcmUsIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAg ICAgICAgICAgcmVsYXRpdmVfeCArPSBmcmFtZV9jaGFyX3dpZHRoOworICAgICAgICAgICAgfQor ICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8K Ky8qICAgICAgICAgICAgICAgICAgICAgICAgIFZFUlRJQ0FMX1JVTEVSOiAgQ09NUE9TSVRFX0dM WVBIICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAg Y2FzZSBWRVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9m bGF2b3IgPSAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPmNvbnRpbnVlZF9wCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRf cCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9C QVIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmlu Z2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVu Y2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFS X1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJz b3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0gIT0gMQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxf QkFSCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaCAtIHJvdy0+ Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3ggPj0gcm93LT5waXhlbF93aWR0aCkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX3p2X3ApCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgaWYgKGdseXBoX2Zs YXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9m bGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAg fHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICB8 fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgfHwgZ2x5cGhfZmxh dm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgY3Vyc29yX3R5cGUgPSBN Q19SSUdIVF9GUklOR0VfQklUTUFQOworICAgICAgd2QgPSAxOworICAgICAgbWNfaGVscGVyICh3 LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIG9wb2ludF9meCwgeSwgZnksIGhwb3Ms IHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRo LCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIGJhY2tncm91bmQs IGVzc2VudGlhbHMuYWN0aXZlX3AsIGdseXBoX2ZsYXZvciwgZHJhd19wLCBmcm9tX3doZXJlLAor ICAgICAgICAgICAgICAgICBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICBicmVhazsK KyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAg ICAgICBGSUxMX0NPTFVNTjogIENPTVBPU0lURV9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAq LworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBGSUxMX0NPTFVNTjoKKyAgICB7 CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoZ2x5cGggLSByb3ctPmdseXBo c1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPiByZWxhdGl2ZV94KQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfenZfcCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF95ID09IHkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF92cG9zID09IHZwb3MpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgd2QgPSAxOworICAgICAgbWNf aGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZjX2Z4LCB5LCBmeSwg aHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jf d2lkdGgsIHJvd19wb3NpdGlvbiwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgYmFja2dy b3VuZCwgZXNzZW50aWFscy5hY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCBkcmF3X3AsIGZyb21fd2hl cmUsCisgICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGJy ZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgQ1VSU09SX0lO RElDQVRPUjoKKyAgICB7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KKyAgfQorICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgRU5EOiAgQ09NUE9TSVRFX0dMWVBIICAgICAgICAgICAgICAgICAg ICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisKKy8qIC0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJFR0lOOiAgWFdJREdFVF9H TFlQSCAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0g Ki8KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gWFdJREdFVF9HTFlQSCkKKyAgeworI2lmbmRl ZiBIQVZFX1hXSURHRVRTCisgICAgZWFzc3VtZSAoZmFsc2UpOworI2Vsc2UKKyAgICBpZiAobWNf c3RkZXJyX3ApCisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICJcbiAgJTVkLyUtNWQg JTVkICU0YyAlNmQgJWMgJTNkIDB4JTA1eCAlNGQgJTEuMWQlMS4xZCAgJTNkICVzICVjXG4iLAor ICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51 c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxh dGl2ZV94LAorICAgICAgICAnWCcsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAo QlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJ TkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICAgIDogJy0n KSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQs CisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdodF9i b3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+dS54d2lkZ2V0LAorICAgICAgICBnbHlwaC0+aHBv cywgZ2x5cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAnLicpOworI2VuZGlmCisgIHN3 aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAg ICAgICAgICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTOiAgWFdJREdFVF9HTFlQSCAgICAg ICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIE1V TFRJUExFX0NVUlNPUlM6CisgICAgeworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywg Z2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAg ICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgZm9yZWdy b3VuZCwKKyAgICAgICAgICAgICAgICAgYmFja2dyb3VuZCwgZXNzZW50aWFscy5hY3RpdmVfcCwg TUNfR0xZ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ICAgICAgICB7CisgICAgICAg ICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgd2hpbGUgKHJl bGF0aXZlX3ggPD0geF9saW1pdCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbWNfaGVs cGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywg dnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNv cl93aWR0aCwgcm93X3Bvc2l0aW9uLCBmb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICAgICAg ICAgIGJhY2tncm91bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBITEVTUywgZHJhd19w LAorICAgICAgICAgICAgICAgICAgICAgICAgIGZyb21fd2hlcmUsIGNhY2hlX3R5cGUsIGFjdGlv bl90eXBlKTsKKyAgICAgICAgICAgICAgcmVsYXRpdmVfeCArPSBmcmFtZV9jaGFyX3dpZHRoOwor ICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxF UjogIFhXSURHRVRfR0xZUEggICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tICovCisgICAgY2FzZSBWRVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAgICBlbnVtIG1j X2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPmNvbnRpbnVl ZF9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVu Y2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog KGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3Jp Z2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJT RURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IChjdXJzb3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0gIT0gMQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29u X3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVW RVJTRURfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3ggPj0gcm93 LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBN Q19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBo X3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhM RVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAg ICAgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAg ICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FS Uk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xB U0gKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSCisgICAgICAg ICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAg Y3Vyc29yX3R5cGUgPSBNQ19SSUdIVF9GUklOR0VfQklUTUFQOworICAgICAgbWNfaGVscGVyICh3 LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIG9wb2ludF9meCwgeSwgZnksIGhwb3Ms IHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRo LCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIGJhY2tncm91bmQs IGVzc2VudGlhbHMuYWN0aXZlX3AsIGdseXBoX2ZsYXZvciwgZHJhd19wLCBmcm9tX3doZXJlLAor ICAgICAgICAgICAgICAgICBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICBicmVhazsK KyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAg ICAgICAgRklMTF9DT0xVTU46ICBYV0lER0VUX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICAq LworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBGSUxMX0NPTFVNTjoKKyAgICB7 CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoZ2x5cGggLSByb3ctPmdseXBo c1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPiByZWxhdGl2ZV94KQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfenZfcCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF95ID09IHkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF92cG9zID09IHZwb3MpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgbWNfaGVscGVyICh3LCBtYXRy aXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZjX2Z4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAg ICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3Np dGlvbiwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgYmFja2dyb3VuZCwgZXNzZW50aWFs cy5hY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCBkcmF3X3AsIGZyb21fd2hlcmUsCisgICAgICAgICAg ICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8q IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgQ1VSU09SX0lORElDQVRP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BjaGVjayBpbiBgdXBkYXRlX3dpbmRvdycuICovCisgIGlmICghQlVGRkVSUCAody0+Y29u dGVudHMpKQorICAgIHJldHVybjsKKyAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKHctPmNv bnRlbnRzKTsKKyAgaWYgKE5JTFAgKEJWQVIgKGIsIG1jX2NvbmYpKQorICAgICAgJiYgTklMUCAo QlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAmJiBOSUxQIChCVkFSIChiLCBmY192aXNpYmxl KSkpCisgICAgcmV0dXJuOworICBzdHJ1Y3QgZ2x5cGhfcm93ICpib3R0b21fcm93ID0gTUFUUklY X0JPVFRPTV9URVhUX1JPVyAobWF0cml4LCB3KTsKKyAgaW50IGJvdHRvbV92cG9zID0gTUFUUklY X1JPV19WUE9TIChib3R0b21fcm93LCBtYXRyaXgpOworICBpZiAodnBvcyA9PSBib3R0b21fdnBv cykKKyAgICByZXR1cm47CisgIGlmICghcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgcmV0dXJu OworICBpbnQgaHBvc19zdGFydCA9IHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAg aWYgKG1jX3N0ZGVycl9wKQorICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX2RyYXdfcm93ICglZCk6 ICBkcmF3X3AgKCVzKSB8IGhwb3MgKCVkKSB8IGxlbiAoJWQpXG4iLAorICAgICAgICAgICAgICAg ICAgICAgdnBvcywgZHJhd19wID8gInkiIDogIm4iLCBocG9zX3N0YXJ0LCBocG9zX2xlbmd0aCk7 CisgIGludCBvcG9pbnRfZngsIG9wb2ludF9meSwgb3BvaW50X3dkLCBvcG9pbnRfaDsKKyAgaW50 IHRleHRfYXJlYV93aWR0aCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgIGlu dCBoZWFkZXJfbGluZV9mb3JtYXQgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAg c3RydWN0IGdseXBoX3JvdyAqY3Vyc29yX3JvdyA9ICh3LT5jdXJzb3IudnBvcyAhPSAtMSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPVyAoY3Vyc29yX21hdHJp eCwgdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5V TEw7CisgIHN0cnVjdCBnbHlwaCAqY3Vyc29yX2dseXBoID0gKHctPmN1cnNvci52cG9zICE9IC0x KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfZ2V0X2N1cnNvcl9nbHlwaCAo dywgY3Vyc29yX21hdHJpeCwgY3Vyc29yX3JvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBv cykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgIGJvb2wgY3Vyc29y X2F0X2ZyaW5nZV9wID0gKGN1cnNvcl9nbHlwaCA9PSBOVUxMCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIGN1cnNvcl9yb3cgIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+ZXhhY3Rfd2luZG93X3dp ZHRoX2xpbmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA9 PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vy c29yLnggPT0gY3Vyc29yX3Jvdy0+cGl4ZWxfd2lkdGgpOworICBib29sIGN1cnNvcl9iZXlvbmRf ZnJpbmdlX3AgPSAoY3Vyc29yX2dseXBoID09IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIGN1cnNvcl9yb3cgIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFd CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhY3Vyc29yX3Jvdy0+ZXhhY3Rf d2luZG93X3dpZHRoX2xpbmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg dy0+Y3Vyc29yLnggPj0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiB3LT5jdXJzb3IueCA+PSBjdXJzb3Jfcm93LT5waXhlbF93aWR0aCk7CisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgUkVQTEFDRSBU SEUgUkVBTCBDVVJTT1IKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICBlbnVtIGZhY2VfaWQg YmdfZmFjZV9pZCA9IChjdXJzb3JfZ2x5cGggIT0gTlVMTCkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IGN1cnNvcl9nbHlwaC0+ZmFjZV9pZAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogREVGQVVMVF9GQUNFX0lEOworICBzdHJ1Y3QgbWNfUkdCIGN1cnNvcl9iZzsKKyAgbWNf c2V0X2xzbF9iZyAodywgYmdfZmFjZV9pZCwgJmN1cnNvcl9iZyk7CisgIC8qIEZJWE1FOiAgUHV0 IGluIHNvbWUgY29kZSB0byBkZWZhdWx0IHRvIE1DX0hPTExPV19CT1ggaWYgdGhlIHVzZXIgaGFz CisgIHVud2l0dGluZ2x5IGNvbWUgdXAgd2l0aCBzb21lIHVuYWNjZXB0YWJsZSBmb3JtIG9mIHVu cmVjb2duaXplZCBjdXJzb3IgdHlwZS4gKi8KKyAgTGlzcF9PYmplY3QgbGlzcF90eXBlID0gQlZB UiAoYiwgbWNfcmVhbF9mYWtlX2N1cnNvcik7CisgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29y X3R5cGUgPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKFhDQVIgKGxpc3BfdHlwZSkpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUg KGxpc3BfdHlwZSk7CisgIGludCBjdXJzb3Jfd2lkdGggPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisg ICAgICAgICAgICAgICAgICAgICA/IFhGSVhOVU0gKFhDQVIgKFhDRFIgKGxpc3BfdHlwZSkpKQor ICAgICAgICAgICAgICAgICAgICAgOiAtMTsKKyAgc3RydWN0IG1jX1JHQiBjdXJzb3JfZmc7Cisg IG1jX2NvbG9yX3BpY2tlciAodywgY3Vyc29yX2dseXBoLCBlc3NlbnRpYWxzLCAmY3Vyc29yX2Zn LCAtMSwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgcm93X3Bvc2l0aW9uLCBDVVJT T1JfSU5ESUNBVE9SKTsKKyAgYm9vbCBmaWxsX2NvbHVtbl90cnVtcHNfcCA9ICghTklMUCAoQlZB UiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmICFOSUxQIChCVkFSIChiLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA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GN1cnNvcl9i ZywgZXNzZW50aWFscy5hY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgTUNfR0xZUEhMRVNTLCBk cmF3X3AsIGZyb21fd2hlcmUsIE5JTFAgKEJWQVIgKGIsIG1jX2NvbmYpKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBDSF9DQUNIRQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19DQUNIRSwg Q1VSU09SX0lORElDQVRPUik7CisgICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRy aXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNv ci52cG9zLCAmb3BvaW50X2gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQ19IQkFS LCAxLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGN1cnNv cl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAg ICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCBvcG9pbnRf d2QsIG9wb2ludF9oLAorICAgICAgICAgICAgICAgICBNQ19IQkFSLCAxLCByb3dfcG9zaXRpb24s IGN1cnNvcl9mZywgY3Vyc29yX2JnLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLAorICAgICAgICAgICAg ICAgICBNQ19HTFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLCBOSUxQIChCVkFSIChiLCBtY19jb25m KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBDSF9D QUNIRQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1D X0NBQ0hFLCBDVVJTT1JfSU5ESUNBVE9SKTsKKyAgICB9CisgIGVsc2UgaWYgKCFjdXJzb3JfYXRf ZnJpbmdlX3AKKyAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAg JiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA+ PSBocG9zX3N0YXJ0CisgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zIDwgaHBvc19zdGFydCAr IGhwb3NfbGVuZ3RoCisgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+dHlwZSAhPSBTVFJFVENI X0dMWVBIKQorICAgIHsKKyAgICAgIG1jX2dldF9jdXJzb3JfZ2VvbWV0cnkgKHcsIG1hdHJpeCwg cm93LCB3LT5jdXJzb3IueCwgJm9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZw b3MsICZvcG9pbnRfaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBl LCBjdXJzb3Jfd2lkdGgsICZvcG9pbnRfd2QpOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgs IHJvdywgY3Vyc29yX2dseXBoLCB3LT5jdXJzb3IueCwgb3BvaW50X2Z4LCB3LT5jdXJzb3IueSwK KyAgICAgICAgICAgICAgICAgb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZw b3MsIG9wb2ludF93ZCwgb3BvaW50X2gsCisgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCBj dXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsCisgICAgICAg ICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hl cmUsCisgICAgICAgICAgICAgICAgIE5JTFAgKEJWQVIgKGIsIG1jX2NvbmYpKQorICAgICAgICAg ICAgICAgICA/IENIX0NBQ0hFCisgICAgICAgICAgICAgICAgIDogTUNfQ0FDSEUsIENVUlNPUl9J TkRJQ0FUT1IpOworICAgIH0KKyAgZWxzZSBpZiAoIWN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAg ICAgICAmJiBjdXJzb3JfZ2x5cGggIT0gTlVMTAorICAgICAgICAgICAmJiB2cG9zID09IHctPmN1 cnNvci52cG9zCisgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID49IGhwb3Nfc3RhcnQKKyAg ICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPCBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGgKKyAg ICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT50eXBlID09IFNUUkVUQ0hfR0xZUEgpCisgICAgewor ICAgICAgLyogSWYgYSB1c2VyIGhhcyBzZXQgYHgtc3RyZXRjaC1jdXJzb3InIHRvIGEgbm9uLW5p bCB2YWx1ZSwgaGUvc2hlIGNob3NlIHRvCisgICAgICBoYXZlIGEgY3Vyc29yIHRoYXQgc3BhbnMg dGhlIGVudGlyZSBsZW5ndGggb2YgdGhlIFNUUkVUQ0hfR0xZUEguICovCisgICAgICBpZiAoIXhf c3RyZXRjaF9jdXJzb3JfcCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRoZSBNQ19IQkFSIHNo YWxsIGhhdmUgYSBgY3Vyc29yX3dpZHRoYCBvZiAxLiAqLworICAgICAgICAgIG1jX2dldF9jdXJz b3JfZ2VvbWV0cnkgKHcsIG1hdHJpeCwgcm93LCB3LT5jdXJzb3IueCwgJm9wb2ludF9meCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5jdXJzb3IueSwgJm9wb2ludF9meSwg dy0+Y3Vyc29yLmhwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vy c29yLnZwb3MsICZvcG9pbnRfaCwgTUNfSEJBUiwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmb3BvaW50X3dkKTsKKyAgICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwg cm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1cnNvci54LCBvcG9pbnRfZngsCisgICAgICAgICAgICAg ICAgICAgICB3LT5jdXJzb3IueSwgb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29y LnZwb3MsCisgICAgICAgICAgICAgICAgICAgICBvcG9pbnRfd2QsIG9wb2ludF9oLCBNQ19IQkFS LCAxLCByb3dfcG9zaXRpb24sIGN1cnNvcl9mZywKKyAgICAgICAgICAgICAgICAgICAgIGN1cnNv cl9iZywgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwK KyAgICAgICAgICAgICAgICAgICAgIE5JTFAgKEJWQVIgKGIsIG1jX2NvbmYpKQorICAgICAgICAg ICAgICAgICAgICAgPyBDSF9DQUNIRQorICAgICAgICAgICAgICAgICAgICAgOiBNQ19DQUNIRSwg Q1VSU09SX0lORElDQVRPUik7CisgICAgICAgIH0KKyAgICAgIG1jX2dldF9jdXJzb3JfZ2VvbWV0 cnkgKHcsIG1hdHJpeCwgcm93LCB3LT5jdXJzb3IueCwgJm9wb2ludF9meCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci55LCAmb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBv cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci52cG9zLCAmb3BvaW50 X2gsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dp ZHRoLCAmb3BvaW50X3dkKTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGN1cnNv cl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAg ICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCBvcG9pbnRf d2QsIG9wb2ludF9oLAorICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRo LCByb3dfcG9zaXRpb24sIGN1cnNvcl9mZywgY3Vyc29yX2JnLAorICAgICAgICAgICAgICAgICBl c3NlbnRpYWxzLmFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAg ICAgICAgICAgICBOSUxQIChCVkFSIChiLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgPyBD SF9DQUNIRQorICAgICAgICAgICAgICAgICA6IE1DX0NBQ0hFLCBDVVJTT1JfSU5ESUNBVE9SKTsK KyAgICB9CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgRFJBVyBBTkQgUkVDT1JEIEZBS0UgQ1VSU09SUworKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisgIGlmICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgJiYgTklMUCAoQlZBUiAoYiwgbWNf aW5hY3RpdmVfd2luZG93cykpCisgICAgICAmJiBOSUxQIChCVkFSIChiLCBjaF9pbmFjdGl2ZV93 aW5kb3dzKSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKGIsIGZjX2luYWN0aXZlX3dpbmRvd3MpKSkK KyAgICByZXR1cm47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UkVBXTsKKyAgICAgICAg ICBzdHJ1Y3QgZ2x5cGggKnByZXZpb3VzX2dseXBoID0gKDAgPD0gaHBvcyAtIDEgJiYgaHBvcyAt IDEgPCByb3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgaHBvcyAtIDEKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOVUxMOworICAgICAgICAgIC8vIHN0 cnVjdCBnbHlwaCAqbGFzdF9nbHlwaCA9IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVz ZWRbVEVYVF9BUkVBXSAtIDE7CisgICAgICAgICAgYm9vbCBza2lwX3AgPSAocHJldmlvdXNfZ2x5 cGggIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICYmIHByZXZpb3VzX2dseXBoLT5j aGFycG9zID09IE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgLSAxCisgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgc3RhcnQtPmJ5dGVwb3MgIT0gZXNzZW50aWFscy56dl9ieXRlKQorICAg ICAgICAgICAgICAgICAgICAgICAgICA/IHRydWUKKyAgICAgICAgICAgICAgICAgICAgICAgIC8q IFdoZW4gYSBgYnVmZmVyLWRpc3BsYXktdGFibGUnIGVudHJ5IGNvbnRhaW5zCisgICAgICAgICAg ICAgICAgICAgICAgICBhIHZpc2libGUgdGFiIGNoYXJhY3RlciAoIsK7IiksIHRoZSBzdWJzZXF1 ZW50CisgICAgICAgICAgICAgICAgICAgICAgICBTVFJFVENIX0dMWVBIIHdpbGwgaGF2ZSB0aGUg c2FtZSBzdGFydC0+Y2hhcnBvcworICAgICAgICAgICAgICAgICAgICAgICAgYXMgdGhlIGFmb3Jl bWVudGlvbmVkIHZpc2libGUgdGFiIGNoYXJhY3Rlci4gKi8KKyAgICAgICAgICAgICAgICAgICAg ICAgIDogKHByZXZpb3VzX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIHByZXZpb3VzX2dseXBoLT5jaGFycG9zID09IHN0YXJ0LT5jaGFycG9zKQorICAgICAgICAg ICAgICAgICAgICAgICAgICA/IHRydWUKKyAgICAgICAgICAgICAgICAgICAgICAgIDogZmFsc2U7 CisgICAgICAgICAgaW50IHBvc2ludCA9IChyb3dfcG9zaXRpb24gPT0gUE9TVF9aVikKKyAgICAg ICAgICAgICAgICAgICAgICAgICA/IC0xCisgICAgICAgICAgICAgICAgICAgICAgIDogKHJvd19w b3NpdGlvbiA9PSBBVF9aVikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgPyBlc3NlbnRpYWxz Lnp2CisgICAgICAgICAgICAgICAgICAgICAgIDogKHN0YXJ0LT5ieXRlcG9zICE9IGVzc2VudGlh bHMuenZfYnl0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBzdGFydCAtIHJvdy0+Z2x5 cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKQorICAgICAgICAgICAg ICAgICAgICAgICAgID8gTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSAtIDEKKyAgICAgICAg ICAgICAgICAgICAgICAgOiAoc3RhcnQtPmJ5dGVwb3MgPT0gZXNzZW50aWFscy56dl9ieXRlCisg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVB XSA9PSByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAg PyBlc3NlbnRpYWxzLnp2CisgICAgICAgICAgICAgICAgICAgICAgIDogc3RhcnQtPmNoYXJwb3M7 CisgICAgICAgICAgTGlzcF9PYmplY3Qgc3BlY3MgPSBtY19hc3NvYyAobWFrZV9maXhudW0gKHBv c2ludCksIEJWQVIgKGIsIG1jX2NvbmYpKTsKKyAgICAgICAgICBpZiAoKChoZWFkZXJfbGluZV9m b3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9y bWF0ID09IDApCisgICAgICAgICAgICAgICYmICFOSUxQIChzcGVjcykKKyAgICAgICAgICAgICAg JiYgcm93LT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAgICAgICAgICAmJiAh c2tpcF9wCisgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiAhPSBQT1NUX1pWKQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICBMaXNwX09iamVjdCBsaXNwX3R5cGUgPSBtY19udGggKDEs IHNwZWNzKTsKKyAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSA9 IChDT05TUCAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoWENBUiAobGlzcF90eXBlKSkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogbWNfbGlz cF90b19jdXJzb3JfdHlwZSAobGlzcF90eXBlKTsKKyAgICAgICAgICAgICAgY3Vyc29yX3R5cGUg PSAoc3RhcnQtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBNQ19IT0xMT1dfQk9YCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBjdXJzb3Jf dHlwZTsKKyAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aCA9IChDT05TUCAobGlzcF90eXBl KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gWEZJWE5VTSAoWENBUiAoWENE UiAobGlzcF90eXBlKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IC0xOwor ICAgICAgICAgICAgICBMaXNwX09iamVjdCBtY19mb3JlZ3JvdW5kID0gbWNfbnRoICgyLCBzcGVj cyk7CisgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAgICAgICAgICAgICBp ZiAoU1RSSU5HUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAgbWNfeHdfY29sb3Jf dmFsdWVzICh3LCBtY19mb3JlZ3JvdW5kLCAmbHNsX2ZnKTsKKyAgICAgICAgICAgICAgICBlbHNl IGlmIChWRUNUT1JQIChtY19mb3JlZ3JvdW5kKSkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgICAgbHNsX2ZnLnJlZCA9IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3Jv dW5kLCAwKSk7CisgICAgICAgICAgICAgICAgICAgIGxzbF9mZy5ncmVlbiA9IFhGTE9BVF9EQVRB IChBUkVGIChtY19mb3JlZ3JvdW5kLCAxKSk7CisgICAgICAgICAgICAgICAgICAgIGxzbF9mZy5i bHVlID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDIpKTsKKyAgICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKE5JTFAgKG1jX2ZvcmVncm91bmQp KQorICAgICAgICAgICAgICAgICAgICBtY19jb2xvcl9waWNrZXIgKHcsIHN0YXJ0LCBlc3NlbnRp YWxzLCAmbHNsX2ZnLCBwb3NpbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgY3Vyc29yX3R5cGUsIHJvd19wb3NpdGlvbiwgTVVMVElQTEVfQ1VSU09SUyk7CisgICAgICAg ICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgICAgICAg ICAgICAgIGludCB4X2xpbWl0ID0gdGV4dF9hcmVhX3dpZHRoOworICAgICAgICAgICAgICBtY19l bmdpbmUgKHcsIG1hdHJpeCwgcm93LCBzdGFydCwgVEVYVF9BUkVBLCB4LCB4X2xpbWl0LCByb3ct PnksCisgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FS RUFdLCB2cG9zLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jf d2lkdGgsIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwKKyAgICAgICAg ICAgICAgICAgICAgICAgICBsc2xfZmcsIE1VTFRJUExFX0NVUlNPUlMsIGRyYXdfcCwgZnJvbV93 aGVyZSwgTUNfQ0FDSEUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBpZiAoIU5J TFAgKEJWQVIgKGIsIGZjX3Zpc2libGUpKQorICAgICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2 ZV9wCisgICAgICAgICAgICAgIHx8ICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAg ICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGZjX2luYWN0aXZlX3dpbmRvd3MpKSkpCisgICAgICAg ICAgLy8gJiYgZXNzZW50aWFscy5mY194IDw9IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICYm IGVzc2VudGlhbHMuZmNfeCA8IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICYmIGVzc2VudGlh bHMuZmNfeCA+PSB3LT5tYy5sbnVtX3BpeGVsX3dpZHRoKQorICAgICAgICB7CisgICAgICAgICAg aW50IHhfbGltaXQgPSB4ICsgc3RhcnQtPnBpeGVsX3dpZHRoOworICAgICAgICAgIGJvb2wgcmVh bF9mYWtlX2N1cnNvcl9wID0gKHctPmN1cnNvci54ID09IGVzc2VudGlhbHMuZmNfeAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci55ID09IHJvdy0+eQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID09 IHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPmN1cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAgIHN0cnVj dCBtY19SR0IgbHNsX2ZnOworICAgICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywgc3RhcnQsIGVz c2VudGlhbHMsICZsc2xfZmcsIC0xLCBNQ19CQVIsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICByb3dfcG9zaXRpb24sIEZJTExfQ09MVU1OKTsKKyAgICAgICAgICBpZiAoeCA8IHRleHRfYXJl YV93aWR0aAorICAgICAgICAgICAgICAvLyB4ICsgc3RhcnQtPnBpeGVsX3dpZHRoIDw9IHRleHRf YXJlYV93aWR0aAorICAgICAgICAgICAgICAmJiAoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYg dnBvcyA+IDApCisgICAgICAgICAgICAgICAgICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkK KyAgICAgICAgICAgICAgJiYgKChzdGFydCAhPSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93 LT51c2VkW1RFWFRfQVJFQV0gLSAxCisgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5m Y194ID49IHgKKyAgICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPCB4ICsgc3Rh cnQtPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgfHwgKHN0YXJ0ID09IHJvdy0+Z2x5 cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEKKyAgICAgICAgICAgICAg ICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPj0geCkpCisgICAgICAgICAgICAgICYmIHJvdy0+ eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAgICAgJiYgIXJlYWxfZmFr ZV9jdXJzb3JfcCkKKyAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIHN0YXJ0 LCBURVhUX0FSRUEsIHgsIHhfbGltaXQsIHJvdy0+eSwKKyAgICAgICAgICAgICAgICAgICAgICAg c3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLCB2cG9zLCBNQ19CQVIsIDEsCisgICAgICAg ICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwg bHNsX2ZnLAorICAgICAgICAgICAgICAgICAgICAgICBGSUxMX0NPTFVNTiwgZHJhd19wLCBmcm9t X3doZXJlLCBGQ19DQUNIRSk7CisgICAgICAgIH0KKyAgICAgIGlmICghTklMUCAoQlZBUiAoYiwg Y3Jvc3NoYWlycykpCisgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2hvcml6b250YWxf cnVsZXIpKQorICAgICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAg IHx8ICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJW QVIgKGIsIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkpCisgICAgICAgICAgJiYgdnBvcyA9PSB3LT5j dXJzb3IudnBvcykKKyAgICAgICAgeworICAgICAgICAgIGludCB4X2xpbWl0ID0gKHN0YXJ0ID09 IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpCisgICAg ICAgICAgICAgICAgICAgICAgICA/IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAg ICAgICAgOiB4ICsgc3RhcnQtPnBpeGVsX3dpZHRoOworICAgICAgICAgIHN0cnVjdCBtY19SR0Ig bHNsX2ZnOworICAgICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywgc3RhcnQsIGVzc2VudGlhbHMs ICZsc2xfZmcsIC0xLCBNQ19IQkFSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93X3Bv c2l0aW9uLCBIT1JJWk9OVEFMX1JVTEVSKTsKKyAgICAgICAgICAvKiBQcmVzZXJ2ZSBzdXBwb3J0 IGZvciBkZWZhdWx0IGJlaGF2aW9yIHN1Y2ggdGhhdCBhIHVzZXIgbWF5CisgICAgICAgICAgc3Bl Y2lmeSB0aGUgaGVpZ2h0IG9mIGFuIE1DX0hCQVIsIHdoaWNoIGJlZ2lucyBpdHMgam91cm5leQor ICAgICAgICAgIGFzIHRoZSBgY3Vyc29yX3dpZHRoJy4gIGBtY19nZXRfY3Vyc29yX2dlb21ldHJ5 JyByZWFkanVzdHMuICovCisgICAgICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgc3Rh cnQsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwgcm93LT55LAorICAgICAgICAgICAgICAgICAgICAg c3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLCB2cG9zLCBNQ19IQkFSLCAxLAorICAgICAg ICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBs c2xfZmcsCisgICAgICAgICAgICAgICAgICAgICBIT1JJWk9OVEFMX1JVTEVSLCBkcmF3X3AsIGZy b21fd2hlcmUsIENIX0NBQ0hFKTsKKyAgICAgICAgfQorICAgICAgaWYgKCFOSUxQIChCVkFSIChi LCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxf cnVsZXIpKQorICAgICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAg IHx8ICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJW QVIgKGIsIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkpCisgICAgICAgICAgJiYgIWZpbGxfY29sdW1u X3RydW1wc19wKQorICAgICAgICB7CisgICAgICAgICAgY3Vyc29yX3R5cGUgPSAoc3RhcnQtPnR5 cGUgPT0gSU1BR0VfR0xZUEgpCisgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0hPTExPV19C T1gKKyAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfQkFSOworICAgICAgICAgIGludCB4X2xp bWl0ID0gdGV4dF9hcmVhX3dpZHRoOworICAgICAgICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9w ID0gKHctPmN1cnNvci55ID09IHJvdy0+eQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHctPmN1cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAgIHN0cnVjdCBtY19S R0IgbHNsX2ZnOworICAgICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywgc3RhcnQsIGVzc2VudGlh bHMsICZsc2xfZmcsIC0xLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg IHJvd19wb3NpdGlvbiwgVkVSVElDQUxfUlVMRVIpOworICAgICAgICAgIGlmICgoKGhlYWRlcl9s aW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICB8fCBoZWFkZXJfbGlu ZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAgJiYgKChzdGFydCAhPSByb3ctPmdseXBoc1tU RVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxCisgICAgICAgICAgICAgICAgICAg JiYgdy0+Y3Vyc29yLnggPj0geAorICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54IDwg eCArIHN0YXJ0LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgIHx8IChzdGFydCA9PSBy b3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxCisgICAgICAg ICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0geCkpCisgICAgICAgICAgICAgICYmIHJv dy0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAgICAgJiYgIXJlYWxf ZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIHN0 YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGltaXQsIHJvdy0+eSwKKyAgICAgICAgICAgICAgICAgICAg ICAgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLCB2cG9zLCBjdXJzb3JfdHlwZSwgMSwK KyAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bv c2l0aW9uLCBsc2xfZmcsCisgICAgICAgICAgICAgICAgICAgICAgIFZFUlRJQ0FMX1JVTEVSLCBk cmF3X3AsIGZyb21fd2hlcmUsIENIX0NBQ0hFKTsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNl CisgICAgICB7CisgICAgICAgIGludCByZWxhdGl2ZV94ID0gMDsKKyAgICAgICAgZm9yIChpbnQg YXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFyZWEgPCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAgICAg ICAgICB7CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoID0gcm93LT5nbHlwaHNbYXJl YV07CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoX2VuZCA9IGdseXBoICsgcm93LT51 c2VkW2FyZWFdOworICAgICAgICAgICAgLyogR2x5cGggZm9yIGEgbGluZSBlbmQgaW4gdGV4dC4g Ki8KKyAgICAgICAgICAgIGlmIChhcmVhID09IFRFWFRfQVJFQSAmJiBnbHlwaCA9PSBnbHlwaF9l bmQgJiYgZ2x5cGgtPmNoYXJwb3MgPiAwKQorICAgICAgICAgICAgICArK2dseXBoX2VuZDsKKyAg ICAgICAgICAgIGZvciAoOyBnbHlwaCA8IGdseXBoX2VuZDsgKytnbHlwaCkKKyAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgIGlmICh2cG9zICE9IHctPmN1cnNvci52cG9zCisgICAgICAg ICAgICAgICAgICAgICYmIGdseXBoICE9IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAgICAg ICAgJiYgZXNzZW50aWFscy5mY194IDwgcmVsYXRpdmVfeAorICAgICAgICAgICAgICAgICAgICAm JiB3LT5jdXJzb3IueCA8IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgJiYgTklMUCAo QlZBUiAoYiwgbWNfY29uZikpKQorICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAg ICAgICAgaWYgKCFOSUxQIChCVkFSIChiLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAg JiYgKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8ICghZXNz ZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChC VkFSIChiLCBtY19pbmFjdGl2ZV93aW5kb3dzKSkpKSkKKyAgICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAgICAgLyogVGhlIHNwYWNlIGFwcGVuZGVkIHRvIGEgcm93IGVuZGluZyB3 aXRoIGEgbmV3IGxpbmUgZG9lcworICAgICAgICAgICAgICAgICAgICBub3QgaGF2ZSBhIGBnbHlw aC0+Y2hhcnBvc2AgKC0xLCAwKSB0aGF0IHdlIGNhbiB1c2UgZm9yIHRoaXMKKyAgICAgICAgICAg ICAgICAgICAgcGFydGljdWxhciBhcHBsaWNhdGlvbi4gIFdoZW4gYSBgYnVmZmVyLWRpc3BsYXkt dGFibGUnIGVudHJ5CisgICAgICAgICAgICAgICAgICAgIGFzc2lnbnMgYSB2aXNpYmxlIGdseXBo IHRvIGEgbmV3IGxpbmUsIHRoZXJlIGlzIG5vIHByb2JsZW0KKyAgICAgICAgICAgICAgICAgICAg YmVjYXVzZSB0aGF0IGdseXBoIGhhcyBhIGBnbHlwaC0+Y2hhcnBvcycgdGhhdCB3ZSBjYW4gdXNl LgorICAgICAgICAgICAgICAgICAgICBXaGVuIG5vIHZpc2libGUgRU9MIGdseXBoIGV4aXN0cywg d2UgdXNlIHRoZSBmb2xsb3dpbmcgdGVzdDoKKyAgICAgICAgICAgICAgICAgICAgdGhlIGFwcGVu ZGVkIHNwYWNlIGhhcyBhIHBvc2l0aW9uIHRoYXQgaXMgb25lIGxlc3MgdGhhbiB0aGUKKyAgICAg ICAgICAgICAgICAgICAgZW5kIG9mIHRoZSBtYXRyaXggcm93LiAqLworICAgICAgICAgICAgICAg ICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAg ICAgICAgICAgICAgc3RydWN0IGdseXBoICpwcmV2aW91c19nbHlwaCA9ICgwIDw9IGhwb3MgLSAx ICYmIGhwb3MgLSAxIDwgcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0g KyBocG9zIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiBOVUxMOworICAgICAgICAgICAgICAgICAgICAvLyBzdHJ1Y3QgZ2x5cGggKmxhc3Rf Z2x5cGggPSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAx OworICAgICAgICAgICAgICAgICAgICBib29sIHNraXBfcCA9IChwcmV2aW91c19nbHlwaCAhPSBO VUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHByZXZpb3VzX2dseXBo LT5jaGFycG9zID09IE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgLSAxCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT5ieXRlcG9zICE9IGVzc2VudGlhbHMu enZfYnl0ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gdHJ1ZQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFdoZW4gYSBgYnVmZmVyLWRpc3BsYXkt dGFibGUnIGVudHJ5IGNvbnRhaW5zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg YSB2aXNpYmxlIHRhYiBjaGFyYWN0ZXIgKCLCuyIpLCB0aGUgc3Vic2VxdWVudAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIFNUUkVUQ0hfR0xZUEggd2lsbCBoYXZlIHRoZSBzYW1l IGdseXBoLT5jaGFycG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXMgdGhl IGFmb3JlbWVudGlvbmVkIHZpc2libGUgdGFiIGNoYXJhY3Rlci4gKi8KKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IChwcmV2aW91c19nbHlwaCAhPSBOVUxMCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcHJldmlvdXNfZ2x5cGgtPmNoYXJwb3MgPT0g Z2x5cGgtPmNoYXJwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IHRy dWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGZhbHNlOworICAgICAgICAg ICAgICAgICAgICBpbnQgcG9zaW50ID0gKHJvd19wb3NpdGlvbiA9PSBQT1NUX1pWKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IC0xCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IChyb3dfcG9zaXRpb24gPT0gQVRfWlYpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IGVzc2VudGlhbHMuenYKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogKGdseXBoLT5ieXRlcG9zICE9IGVzc2VudGlhbHMuenZfYnl0ZQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGggLSByb3ctPmdseXBoc1tURVhU X0FSRUFdID09IHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpIC0gMQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGgtPmJ5dGVwb3MgPT0gZXNzZW50aWFs cy56dl9ieXRlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaCAt IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGVzc2VudGlhbHMuenYKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogZ2x5cGgtPmNoYXJwb3M7CisgICAgICAgICAgICAg ICAgICAgIExpc3BfT2JqZWN0IHNwZWNzID0gbWNfYXNzb2MgKG1ha2VfZml4bnVtIChwb3NpbnQp LCBCVkFSIChiLCBtY19jb25mKSk7CisgICAgICAgICAgICAgICAgICAgIGlmICgoKGhlYWRlcl9s aW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwg aGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklM UCAoc3BlY3MpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnkgPD0gd2luZG93X3Rl eHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAhc2tpcF9wCisgICAg ICAgICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gIT0gUE9TVF9aVikKKyAgICAgICAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBMaXNwX09iamVjdCBsaXNw X3R5cGUgPSBtY19udGggKDEsIHNwZWNzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVudW0g bWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUgPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY19s aXNwX3RvX2N1cnNvcl90eXBlIChYQ0FSIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogbWNfbGlzcF90b19jdXJz b3JfdHlwZSAobGlzcF90eXBlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBl ID0gKGdseXBoLT50eXBlID09IElNQUdFX0dMWVBIKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IE1DX0hPTExPV19CT1gKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiBjdXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBj dXJzb3Jfd2lkdGggPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBYRklYTlVNIChYQ0FSIChYQ0RSIChsaXNwX3R5cGUpKSkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IC0xOworICAgICAg ICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3QgbWNfZm9yZWdyb3VuZCA9IG1jX250aCAoMiwg c3BlY3MpOworICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7Cisg ICAgICAgICAgICAgICAgICAgICAgICBpZiAoU1RSSU5HUCAobWNfZm9yZWdyb3VuZCkpCisgICAg ICAgICAgICAgICAgICAgICAgICAgIG1jX3h3X2NvbG9yX3ZhbHVlcyAodywgbWNfZm9yZWdyb3Vu ZCwgJmxzbF9mZyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKFZFQ1RPUlAg KG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGxzbF9mZy5yZWQgPSBYRkxPQVRfREFUQSAoQVJFRiAobWNf Zm9yZWdyb3VuZCwgMCkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNsX2ZnLmdy ZWVuID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDEpKTsKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGxzbF9mZy5ibHVlID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2Zv cmVncm91bmQsIDIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoTklMUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBtY19jb2xvcl9waWNrZXIgKHcsIGdseXBoLCBlc3NlbnRp YWxzLCAmbHNsX2ZnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBwb3NpbnQsIGN1cnNvcl90eXBlLCByb3dfcG9zaXRpb24sCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1VTFRJUExFX0NVUlNPUlMpOworICAgICAg ICAgICAgICAgICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4 KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gdGV4dF9hcmVhX3dpZHRo OworICAgICAgICAgICAgICAgICAgICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgZ2x5 cGgsIGFyZWEsIHJlbGF0aXZlX3gsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHhfbGltaXQsIHJvdy0+eSwgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dp ZHRoLCBjdXJzb3JfbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBl c3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGxzbF9mZywKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgTVVMVElQTEVfQ1VSU09SUywgZHJhd19wLCBmcm9tX3doZXJlLCBNQ19DQUNI RSk7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgICAgIGlmICghTklMUCAoQlZBUiAoYiwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgICAg ICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICB8 fCAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAh TklMUCAoQlZBUiAoYiwgZmNfaW5hY3RpdmVfd2luZG93cykpKSkKKyAgICAgICAgICAgICAgICAg ICAgLy8gJiYgZXNzZW50aWFscy5mY194IDw9IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAg ICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPCB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAg ICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID49IHctPm1jLmxudW1fcGl4ZWxfd2lkdGgpCisg ICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gdGV4 dF9hcmVhX3dpZHRoOworICAgICAgICAgICAgICAgICAgICBib29sIHJlYWxfZmFrZV9jdXJzb3Jf cCA9ICh3LT5jdXJzb3IueCA9PSBlc3NlbnRpYWxzLmZjX3gKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnkgPT0gcm93LT55CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci5o cG9zID09IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IudnBvcyA9PSB2cG9zKTsK KyAgICAgICAgICAgICAgICAgICAgaW50IGhwb3MgPSBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRf QVJFQV07CisgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAgICAg ICAgICAgICAgICAgICBtY19jb2xvcl9waWNrZXIgKHcsIGdseXBoLCBlc3NlbnRpYWxzLCAmbHNs X2ZnLCAtMSwgTUNfQkFSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJv d19wb3NpdGlvbiwgRklMTF9DT0xVTU4pOworICAgICAgICAgICAgICAgICAgICBpZiAoaHBvcyA+ PSBocG9zX3N0YXJ0CisgICAgICAgICAgICAgICAgICAgICAgICAmJiBocG9zIDwgaHBvc19zdGFy dCArIGhwb3NfbGVuZ3RoCisgICAgICAgICAgICAgICAgICAgICAgICAvLyAmJiByZWxhdGl2ZV94 ICsgZ2x5cGgtPnBpeGVsX3dpZHRoIDw9IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAg ICAgICAgICAgJiYgcmVsYXRpdmVfeCA8IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAg ICAgICAgICAgJiYgKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAg ICAgICAgICAgICAgICAgICAgJiYgKChnbHlwaCAhPSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSByZWxhdGl2ZV94CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA8IHJlbGF0aXZlX3gg KyBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKGds eXBoID09IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg ZXNzZW50aWFscy5mY194ID49IHJlbGF0aXZlX3gpKQorICAgICAgICAgICAgICAgICAgICAgICAg JiYgcm93LT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAgICAgICAgICAgICAg ICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgICAgICAgICAgICBtY19l bmdpbmUgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgYXJlYSwgcmVsYXRpdmVfeCwgeF9saW1pdCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvdy0+eSwgaHBvcywgdnBvcywgTUNf QkFSLCAxLCBjdXJzb3JfbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBsc2xfZmcsIEZJTExfQ09MVU1OLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgZHJhd19wLCBmcm9tX3doZXJlLCBGQ19DQUNIRSk7Cisg ICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKCFOSUxQIChCVkFSIChiLCBj cm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2hv cml6b250YWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAmJiAoZXNzZW50aWFscy5hY3Rp dmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2luYWN0aXZl X3dpbmRvd3MpKSkpCisgICAgICAgICAgICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZw b3MpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGludCB4X2xpbWl0 ID0gdGV4dF9hcmVhX3dpZHRoOworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGdseXBo IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1j X1JHQiBsc2xfZmc7CisgICAgICAgICAgICAgICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywgZ2x5 cGgsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0xLCBNQ19IQkFSLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgSE9SSVpPTlRBTF9SVUxFUik7CisgICAg ICAgICAgICAgICAgICAgIC8qIFByZXNlcnZlIHN1cHBvcnQgZm9yIGRlZmF1bHQgYmVoYXZpb3Ig c3VjaCB0aGF0IGEgdXNlciBtYXkKKyAgICAgICAgICAgICAgICAgICAgc3BlY2lmeSB0aGUgaGVp Z2h0IG9mIGFuIE1DX0hCQVIsIHdoaWNoIGJlZ2lucyBpdHMgam91cm5leQorICAgICAgICAgICAg ICAgICAgICBhcyB0aGUgYGN1cnNvcl93aWR0aCcuICBgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeScg cmVhZGp1c3RzLiAqLworICAgICAgICAgICAgICAgICAgICBpZiAoaHBvcyA+PSBocG9zX3N0YXJ0 CisgICAgICAgICAgICAgICAgICAgICAgICAmJiBocG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVu Z3RoKQorICAgICAgICAgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIGds eXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4X2xpbWl0LAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgcm93LT55LCBocG9zLCB2cG9zLCBNQ19IQkFSLCAxLCBjdXJzb3JfbWF0cml4LAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscywgcm93X3Bvc2l0aW9u LCBsc2xfZmcsIEhPUklaT05UQUxfUlVMRVIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBkcmF3X3AsIGZyb21fd2hlcmUsIENIX0NBQ0hFKTsKKyAgICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAg ICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAg ICAgICAgICAgICAgICAgICAmJiAoZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAg ICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkpCisgICAgICAg ICAgICAgICAgICAgICYmICFmaWxsX2NvbHVtbl90cnVtcHNfcCkKKyAgICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUgPSAoZ2x5cGgtPnR5cGUgPT0gSU1B R0VfR0xZUEgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19IT0xMT1df Qk9YCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19CQVI7CisgICAgICAg ICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gdGV4dF9hcmVhX3dpZHRoOworICAgICAgICAgICAg ICAgICAgICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9ICh3LT5jdXJzb3IueSA9PSByb3ctPnkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vy c29yLnZwb3MgPT0gdnBvcyk7CisgICAgICAgICAgICAgICAgICAgIGludCBocG9zID0gZ2x5cGgg LSByb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNf UkdCIGxzbF9mZzsKKyAgICAgICAgICAgICAgICAgICAgbWNfY29sb3JfcGlja2VyICh3LCBnbHlw aCwgZXNzZW50aWFscywgJmxzbF9mZywgLTEsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgVkVSVElDQUxfUlVMRVIpOworICAg ICAgICAgICAgICAgICAgICBpZiAoaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICAgICAg ICAgICAgICAmJiBocG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoCisgICAgICAgICAgICAg ICAgICAgICAgICAmJiAoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAg ICAgICAgICAgICAgICAgICAgICAmJiAoKGdseXBoICE9IGdseXBoX2VuZCAtIDEKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0gcmVsYXRpdmVfeAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA8IHJlbGF0aXZlX3ggKyBnbHlw aC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKGdseXBoID09 IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vy c29yLnggPj0gcmVsYXRpdmVfeCkpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnkg PD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAh cmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywg bWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4X2xpbWl0LAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgcm93LT55LCBocG9zLCB2cG9zLCBjdXJzb3JfdHlwZSwg MSwgY3Vyc29yX21hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVzc2Vu dGlhbHMsIHJvd19wb3NpdGlvbiwgbHNsX2ZnLCBWRVJUSUNBTF9SVUxFUiwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGRyYXdfcCwgZnJvbV93aGVyZSwgQ0hfQ0FDSEUpOworICAg ICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBp eGVsX3dpZHRoOworICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgfQorICAvLyAg Y2xvY2tfdCBjbG9ja19lbmQgPSBjbG9jaygpOworICAvLyAgZG91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AgICAgICAgICBib29sIGVuYWJsZWRfcCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF0uZW5hYmxlZF9wOworICAgICAgICAgIGlmICh2cG9zID09IHZu dGgKKyAgICAgICAgICAgICAgJiYgKChocG9zID49IHN0YXJ0X2hwb3MKKyAgICAgICAgICAgICAg ICAgICAmJiBocG9zIDwgZW5kX2hwb3MpCisgICAgICAgICAgICAgICAgICAvKiBBIGZsb2F0aW5n IGN1cnNvciBiZXlvbmQgdGhlIGVuZCBvZiB0aGUgZ2x5cGggcm93LiAqLworICAgICAgICAgICAg ICAgICAgfHwgKGhwb3MgKyAxID09IHN0YXJ0X2hwb3MKKyAgICAgICAgICAgICAgICAgICAgICAm JiBocG9zICsgMSA9PSBlbmRfaHBvcykpCisgICAgICAgICAgICAgICYmIGVuYWJsZWRfcCkKKyAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgYm9vbCByZW1vdmVfcCA9IGZhbHNlOworICAgICAg ICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBm eSwgaHBvcywgdnBvcywgd2QsIGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBsc2xfZmcsIGFjdGl2ZV9wLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGhfZmxhdm9yLCByZW1vdmVfcCk7CisgICAg ICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIHJldHVybiB0cnVlOworICAvLyAgY2xvY2tf ZW5kID0gY2xvY2soKTsKKyAgLy8gIGRvdWJsZSB0aW1lX2N1cnNvcnMgPSAoKGRvdWJsZSkgKGNs b2NrX2VuZCAtIGNsb2NrX3N0YXJ0KSkgLyBDTE9DS1NfUEVSX1NFQzsKKyAgLy8gIGZwcmludGYg KHN0ZGVyciwgIm1jX3JlZHJhd19yb3cgKCVkKTogIGhwb3MgKCVkLyVkKSB8IGdseXBocyAoJWYp IHwgY3Vyc29ycyAoJWYpXG4iLAorICAvLyAgICAgICAgICAgICAgICAgICB2cG9zLCBzdGFydF9o cG9zLCBlbmRfaHBvcywgdGltZV9nbHlwaHMsIHRpbWVfY3Vyc29ycyk7Cit9CisKK3ZvaWQKK21j X2VyYXNlX3JvdyAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4 LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cpCit7CisgIGludCB2bnRoID0gTUFUUklYX1JPV19WUE9T IChyb3csIG1hdHJpeCk7CisgIGlmIChtY19zdGRlcnJfcCkKKyAgICBmcHJpbnRmIChzdGRlcnIs ICJtY19lcmFzZV9yb3cgKCVzKTogIHZwb3MgKCVkKVxuIiwgbWNfd2luZG93ICh3KSwgdm50aCk7 CisgIC8vICBpZiAobWNfc3RkZXJyX3ApCisgIC8vICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX2Vy YXNlX2hlbHBlciAoJXMpOiAgY2FjaGUgKCVzKSB8IHZwb3MgKCVkKVxuIiwKKyAgLy8gICAgICBt Y193aW5kb3cgKHcpLCBtY19jYWNoZV90eXBlX3RvX3N0cmluZyAoY2FjaGVfdHlwZSksIHZudGgp OworICBmb3IgKGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7CisgICAg ICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICsrY2FjaGVfdHlwZSkKKyAgICB7Cisg ICAgICBmb3IgKGludCBudGggPSAwOworICAgICAgICAgICBtY190cmF2ZXJzZV9jYWNoZV9wICh3 LT5tY19tYXRyaXgsIGNhY2hlX3R5cGUsIHZudGgsIG50aCk7CisgICAgICAgICAgICsrbnRoKQor ICAgICAgICB7CisgICAgICAgICAgaW50IHggPSB3LT5tY19tYXRyaXgudnBvc1t2bnR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hl IGZvbGxvd2luZyB0ZXN0cywKKyAgICAgICAgICBlYXNzZXJ0IChtYXRyaXggJiYgbWF0cml4LT5y b3dzKTsKKyAgICAgICAgICBlYXNzZXJ0IChyb3cgPj0gMCAmJiByb3cgPCBtYXRyaXgtPm5yb3dz KTsgKi8KKyAgICAgICAgICBib29sIGJhcmZfY3Jhc2hfb25lID0gKG1hdHJpeCAmJiBtYXRyaXgt PnJvd3MpID8gZmFsc2UgOiB0cnVlOworICAgICAgICAgIGlmIChiYXJmX2NyYXNoX29uZSkKKyAg ICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgIGJvb2wgYmFyZl9jcmFzaF90d28gPSAodnBv cyA+PSAwICYmIHZwb3MgPCBtYXRyaXgtPm5yb3dzKSA/IGZhbHNlIDogdHJ1ZTsKKyAgICAgICAg ICBpZiAoYmFyZl9jcmFzaF90d28pCisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICBp ZiAodnBvcyA9PSB2bnRoCisgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQ SAorICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIG1jX2VyYXNlX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIHksIGhwb3MsIHZwb3MsIGds eXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkKTsKKyAgICAgICAgICAgICAgdy0+bWNfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFibGVkX3AgPSBmYWxzZTsKKyAg ICAgICAgICAgICAgLS13LT5tY19tYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5cGVdOworICAg ICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAodnBvcyA9PSB2bnRoCisgICAgICAgICAg ICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg ICBib29sIHJlbW92ZV9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICBtY19kcmF3X2VyYXNlX2h5 YnJpZCAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCBjdXJzb3Jf d2lkdGgsIGxzbF9iZywgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGdseXBoX2ZsYXZvciwgcmVtb3ZlX3ApOworICAgICAgICAgICAgICAgIHctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZW5hYmxlZF9wID0gZmFsc2U7 CisgICAgICAgICAgICAgICAgLS13LT5tY19tYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5cGVd OworICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV0gPSAwOworICAgIH0KK30KKworLyogRXJhc2UgZmFr ZSBjdXJzb3JzIGZyb20gKG1pbiwgcnVuLmN1cnJlbnRfeSwgcnVuLmRlc2lyZWRfeSkgdG8gZW5k IG9mIHdpbmRvdy4KKyAgVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX0RPV046Cisg ICAgcnVuLmhlaWdodCA9IGl0Lmxhc3RfdmlzaWJsZV95IC0gcnVuLmRlc2lyZWRfeQorICAgIFtl bWFjcyAtcTogIEhvbGQgdXAtYXJyb3cga2V5IHRyaWdnZXJpbmcgYXV0by1yZWNlbnRlciBhdCBz Y3JvbGwtbWFyZ2luLl0KKyAgVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX1VQOgor ICAgIHJ1bi5oZWlnaHQgPSBpdC5sYXN0X3Zpc2libGVfeSAtIHJ1bi5jdXJyZW50X3k7CisgICAg W2VtYWNzIC1xOiAgSG9sZCB1cC1hcnJvdyBrZXkgdHJpZ2dlcmluZyBhdXRvLXJlY2VudGVyIGF0 IHNjcm9sbC1tYXJnaW4uXQorICBUUllfV0lORE9XX0lEOgorICAgIHJ1bi5oZWlnaHQgPSBpdC5s YXN0X3Zpc2libGVfeSAtIG1heCAocnVuLmN1cnJlbnRfeSwgcnVuLmRlc2lyZWRfeSkKKyAgICBb QWRkIG9yIHJlbW92ZSBsaW5lcyBmcm9tIHRoZSBidWZmZXI7IGUuZy4sIFJFVCBvciBERUwuXQor ICArLS0tLS0tLS0tLS0tLSsgPD0gaXQuY3VycmVudF95ID09IDAKKyAgfCAgICAgICAgICAgICB8 CisgIHwgICAgICAgICAgICAgfCA8PSBydW4uZGVzaXJlZF95ID09IDI3MCBbdXAgKOKGkSldID09 IHJ1bi5jdXJyZW50X3kgPCBydW4uZGVzaXJlZF95CisgIHwgICAgICAgICAgICAgfCAgICBydW4u aGVpZ2h0ID0gaXQubGFzdF92aXNpYmxlX3kgLSBydW4uY3VycmVudF95OworICB8ICAgICAgICAg ICAgIHwgICAgcnVuLmhlaWdodCA9PSAxMDgwIC0gNTQwID09IDU0MAorICB8ICAgICAgICAgICAg IHwgICAgW1RoZSBlbnRpcmUgYm90dG9tIHJlY3RhbmdsZSBnZXRzIGNvcGllZCB0byB1cHBlciBy dW4uZGVzaXJlZF95Ll0KKyAgfCAgICAgICAgICAgICB8CisgICstLS0tLS0tLS0tLS0tKyA8PSBy dW4uY3VycmVudF95ID09IDU0MAorICB8ICAgICAgICAgICAgIHwKKyAgfCAgICAgICAgICAgICB8 IDw9IHJ1bi5kZXNpcmVkX3kgPT0gODEwIFtkb3duICjihpMpXSA9PSBydW4uY3VycmVudF95ID4g cnVuLmRlc2lyZWRfeQorICB8ICAgICAgICAgICAgIHwgICAgcnVuLmhlaWdodCA9IGl0Lmxhc3Rf dmlzaWJsZV95IC0gcnVuLmRlc2lyZWRfeQorICB8ICAgICAgICAgICAgIHwgICAgcnVuLmhlaWdo dCA9PSAxMDgwIC0gODEwID09IDI3MAorICB8ICAgICAgICAgICAgIHwgICAgW1RvcCBwYXJ0IG9m IHRoZSBsb3dlciByZWN0YW5nbGUgZ2V0cyBjb3BpZWQgdG8gbG93ZXIgcnVuLmRlc2lyZWRfeS5d CisgIHwgICAgICAgICAgICAgfAorICArLS0tLS0tLS0tLS0tLSsgPD0gaXQubGFzdF92aXNpYmxl X3kgPT0gMTA4MCAqLwordm9pZAorbWNfcHJlX3Njcm9sbF9jbGVhbiAoc3RydWN0IHdpbmRvdyAq dywgc3RydWN0IHJ1biBydW4sIGludCBzdGFydF92cG9zLAorICAgICAgICAgICAgICAgICAgICAg aW50IG5yb3dzX3Njcm9sbGVkLCBlbnVtIG1jX3ByZV9zY3JvbGxfY2xlYW5fdHlwZSBmcm9tX3do ZXJlKQoreworICBpZiAoTUlOSV9XSU5ET1dfUCAodykpCisgICAgcmV0dXJuOworICBib29sIGdv X29uZV9wID0gKHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbTUNfQ0FDSEVdID4gMAorICAgICAg ICAgICAgICAgICAgIHx8IHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbQ0hfQ0FDSEVdID4gMAor ICAgICAgICAgICAgICAgICAgIHx8IHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbRkNfQ0FDSEVd ID4gMCk7CisgIGJvb2wgZ29fdHdvX3AgPSAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAg ICAgICAgICAgICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3Nz aGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbn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ZiAoIWdvX29uZV9wICYmICFnb190d29fcCkKKyAgICByZXR1cm47CisgIGJvb2wgdXBkYXRp bmdfZnJhbWVfcCA9IGZhbHNlOworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1l KTsKKyAgaWYgKFhGUkFNRSAody0+ZnJhbWUpICE9IGYtPm1jX3VwZGF0aW5nX2ZyYW1lCisgICAg ICAmJiAoZ29fb25lX3AgfHwgZ29fdHdvX3ApKQorICAgIHsKKyAgICAgIHVwZGF0aW5nX2ZyYW1l X3AgPSB0cnVlOworICAgICAgdXBkYXRlX2JlZ2luIChmKTsKKyAgICB9CisgIGlmICh3LT5waHlz X2N1cnNvcl9vbl9wCisgICAgICAmJiBnb190d29fcCkKKyAgICBlcmFzZV9waHlzX2N1cnNvciAo dyk7CisgIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4Owor ICBmb3IgKGludCB2bnRoID0gc3RhcnRfdnBvczsKKyAgICAgICBtYXRyaXggIT0gTlVMTAorICAg ICAgICYmIHZudGggPCBtYXRyaXgtPm5yb3dzCisgICAgICAgJiYgTUFUUklYX1JPVyAobWF0cml4 LCB2bnRoKS0+ZW5hYmxlZF9wCisgICAgICAgJiYgZ29fb25lX3A7CisgICAgICAgKyt2bnRoKQor ICAgIHsKKyAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdyA9IE1BVFJJWF9ST1cgKG1hdHJpeCwg dm50aCk7CisgICAgICBtY19lcmFzZV9yb3cgKHcsIG1hdHJpeCwgcm93KTsKKyAgICB9CisgIGlm ICh1cGRhdGluZ19mcmFtZV9wKQorICAgIHVwZGF0ZV9lbmQgKGYpOworICAvLyBtY19yZXNldF9j YWNoZSAodyk7Cit9CisKK0RFRlVOICgibWMtc3RkZXJyIiwgRm1jX3N0ZGVyciwgU21jX3N0ZGVy ciwgMCwgMSwgIlAiLAorICAgICAgIGRvYzogLyogVG9nZ2xlIHRyYWNpbmcgb2YgbXVsdGlwbGUg ZmFrZSBjdXJzb3JzLgorV2l0aCBBUkcsIHR1cm4gdHJhY2luZyBvbiBpZiBhbmQgb25seSBpZiBB UkcgaXMgcG9zaXRpdmUuICovKQorICAoTGlzcF9PYmplY3QgYXJnKQoreworICBpZiAoTklMUCAo YXJnKSkKKyAgICBtY19zdGRlcnJfcCA9ICFtY19zdGRlcnJfcDsKKyAgZWxzZQorICAgIHsKKyAg ICAgIGFyZyA9IEZwcmVmaXhfbnVtZXJpY192YWx1ZSAoYXJnKTsKKyAgICAgIG1jX3N0ZGVycl9w ID0gWEZJWE5VTSAoYXJnKSA+IDA7CisgICAgfQorICByZXR1cm4gUW5pbDsKK30KKworLyogZW5k IE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAwKIC8q KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKgogCQkgICAgICBXaW5kb3cgZGlzcGxheSBkaW1lbnNpb25zCkBAIC0xMzUx MSw2ICsxODM5MSw2OSBAQCBoc2Nyb2xsX3dpbmRvd190cmVlIChMaXNwX09iamVjdCB3aW5kb3cp CiAJICAgICAgZWxzZQogCQlwdCA9IGNsaXBfdG9fYm91bmRzIChCRUdWLCBtYXJrZXJfcG9zaXRp b24gKHctPnBvaW50bSksIFpWKTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJl Z2luIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyogKGdkYikgYnQKKyMwICB0ZXJtaW5hdGVfZHVl X3RvX3NpZ25hbCAoc2lnPTYsIGJhY2t0cmFjZV9saW1pdD0yMTQ3NDgzNjQ3KSBhdCBl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mNyBpbiBoc2Nyb2xsX3dpbmRvd190cmVl ICh3aW5kb3c9Li4uKSBhdCB4ZGlzcC5jOjE4NTQ2CisqLworCisgIC8qIGBpbml0X2l0ZXJhdG9y JzogIGVhc3NlcnQgKGNoYXJwb3MgPCAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHx8IChjaGFycG9zID49IEJVRl9CRUcgKGN1cnJlbnRfYnVmZmVyKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgY2hhcnBvcyA8PSBaVikpOyAqLworCisgIHN0cnVjdCBk aXNwbGF5X3BvcyAqcG9zID0gJmN1cnNvcl9yb3ctPnN0YXJ0OworICBwdHJkaWZmX3QgY2hhcnBv cyA9IENIQVJQT1MgKHBvcy0+cG9zKTsKKworICBib29sIGJhcmZfY3Jhc2hfb25lID0gKGNoYXJw b3MgPCAwCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKGNoYXJwb3MgPj0gQlVGX0JFRyAo Y3VycmVudF9idWZmZXIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGNoYXJwb3Mg PD0gWlYpKQorICAgICAgICAgICAgICAgICAgICAgICAgPyBmYWxzZQorICAgICAgICAgICAgICAg ICAgICAgICAgOiB0cnVlOworICBpZiAoYmFyZl9jcmFzaF9vbmUpCisgICAgcmV0dXJuIGhzY3Jv bGxlZF9wOworCisgIC8qIGByZXNlYXRfMSc6ICBDSEFSUE9TIChwb3MpID49IEJFR1YgJiYgQ0hB UlBPUyAocG9zKSA8PSBaViAqLworICBib29sIGJhcmZfY3Jhc2hfdHdvID0gKGNoYXJwb3MgPj0g QkVHViAmJiBjaGFycG9zIDw9IFpWKQorICAgICAgICAgICAgICAgICAgICAgICAgID8gZmFsc2UK KyAgICAgICAgICAgICAgICAgICAgICAgICA6IHRydWU7CisgIGlmIChiYXJmX2NyYXNoX3R3bykK KyAgICByZXR1cm4gaHNjcm9sbGVkX3A7CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAgICAgLyogTW92ZSBpdGVyYXRvciB0byBw dCBzdGFydGluZyBhdCBjdXJzb3Jfcm93LT5zdGFydCBpbgogCQkgYSBsaW5lIHdpdGggaW5maW5p dGUgd2lkdGguICAqLwogCSAgICAgIGluaXRfdG9fcm93X3N0YXJ0ICgmaXQsIHcsIGN1cnNvcl9y b3cpOwpAQCAtMTQzOTcsOSArMTkzNDAsMjIgQEAgcmVkaXNwbGF5X2ludGVybmFsICh2b2lkKQog CSAgICAgICp3LT5kZXNpcmVkX21hdHJpeC0+bWV0aG9kID0gMDsKIAkgICAgICBkZWJ1Z19tZXRo b2RfYWRkICh3LCAib3B0aW1pemF0aW9uIDEiKTsKICNlbmRpZgorCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCiAjaWZkZWYgSEFWRV9XSU5ET1df U1lTVEVNCisgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICYmICFOSUxQIChCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICBtY191cGRhdGVfd2lu ZG93X2ZyaW5nZXMgKHcsIGZhbHNlKTsKKyAgICBlbHNlCiAJICAgICAgdXBkYXRlX3dpbmRvd19m cmluZ2VzICh3LCBmYWxzZSk7CiAjZW5kaWYKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisK KwogCSAgICAgIGdvdG8gdXBkYXRlOwogCSAgICB9CiAJICBlbHNlCkBAIC0xNzc5MiwxMCArMjI3 NDgsMjIgQEAgcmVkaXNwbGF5X3dpbmRvdyAoTGlzcF9PYmplY3Qgd2luZG93LCBib29sIGp1c3Rf dGhpc19vbmVfcCkKICAgICB9CiAKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KKworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBib29sIGtl ZXBfY3VycmVudF9wID0gKGp1c3RfdGhpc19vbmVfcAorICAgICAgICAgICAgICAgICAgICAgICAg IHx8ICghdXNlZF9jdXJyZW50X21hdHJpeF9wICYmICFvdmVybGF5X2Fycm93X3NlZW4pCisgICAg ICAgICAgICAgICAgICAgICAgICAgfHwgdy0+cHNldWRvX3dpbmRvd19wKTsKKworICBib29sIGZy aW5nZXNfdXBkYXRlZF9wID0gKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3Nz aGFpcnMpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfdXBkYXRlX3dpbmRvd19m cmluZ2VzICh3LCBrZWVwX2N1cnJlbnRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIDog dXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCBrZWVwX2N1cnJlbnRfcCk7CisKICAgaWYgKEZSQU1F X1dJTkRPV19QIChmKQotICAgICAgJiYgdXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCAoanVzdF90 aGlzX29uZV9wCi0JCQkJICAgIHx8ICghdXNlZF9jdXJyZW50X21hdHJpeF9wICYmICFvdmVybGF5 X2Fycm93X3NlZW4pCi0JCQkJICAgIHx8IHctPnBzZXVkb193aW5kb3dfcCkpKQorICAgICAgJiYg ZnJpbmdlc191cGRhdGVkX3ApCiAgICAgewogICAgICAgdXBkYXRlX2JlZ2luIChmKTsKICAgICAg IGJsb2NrX2lucHV0ICgpOwpAQCAtMTc4MTAsNiArMjI3NzgsOSBAQCByZWRpc3BsYXlfd2luZG93 IChMaXNwX09iamVjdCB3aW5kb3csIGJvb2wganVzdF90aGlzX29uZV9wKQogICAgICAgdXBkYXRl X2VuZCAoZik7CiAgICAgfQogCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIGlmIChX SU5ET1dfQk9UVE9NX0RJVklERVJfV0lEVEggKHcpKQogICAgIGd1aV9kcmF3X2JvdHRvbV9kaXZp ZGVyICh3KTsKICNlbmRpZiAvKiBIQVZFX1dJTkRPV19TWVNURU0gKi8KQEAgLTE4MTI1LDYgKzIz MDk2LDE2IEBAIHRyeV93aW5kb3dfcmV1c2luZ19jdXJyZW50X21hdHJpeCAoc3RydWN0IHdpbmRv dyAqdykKIAkgICAgICB1cGRhdGVfYmVnaW4gKGYpOwogCSAgICAgIGd1aV91cGRhdGVfd2luZG93 X2JlZ2luICh3KTsKIAkgICAgICBGUkFNRV9SSUYgKGYpLT5jbGVhcl93aW5kb3dfbW91c2VfZmFj ZSAodyk7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JT ICovCisKKyAgICBtY19wcmVfc2Nyb2xsX2NsZWFuICh3LCBydW4sIHN0YXJ0X3Zwb3MsIG5yb3dz X3Njcm9sbGVkLCBUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfRE9XTik7CisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgICAgICBGUkFNRV9SSUYgKGYpLT5zY3JvbGxf cnVuX2hvb2sgKHcsICZydW4pOwogCSAgICAgIGd1aV91cGRhdGVfd2luZG93X2VuZCAodywgZmFs c2UsIGZhbHNlKTsKIAkgICAgICB1cGRhdGVfZW5kIChmKTsKQEAgLTE4MjkxLDYgKzIzMjcyLDE2 IEBAIHRyeV93aW5kb3dfcmV1c2luZ19jdXJyZW50X21hdHJpeCAoc3RydWN0IHdpbmRvdyAqdykK IAkgIHVwZGF0ZV9iZWdpbiAoZik7CiAJICBndWlfdXBkYXRlX3dpbmRvd19iZWdpbiAodyk7CiAJ ICBGUkFNRV9SSUYgKGYpLT5jbGVhcl93aW5kb3dfbW91c2VfZmFjZSAodyk7CisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICBtY19wcmVf c2Nyb2xsX2NsZWFuICh3LCBydW4sIHN0YXJ0X3Zwb3MsIG5yb3dzX3Njcm9sbGVkLCBUUllfV0lO RE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfVVApOworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKworCiAJICBGUkFNRV9SSUYgKGYpLT5zY3JvbGxfcnVuX2hvb2sgKHcsICZydW4pOwogCSAg Z3VpX3VwZGF0ZV93aW5kb3dfZW5kICh3LCBmYWxzZSwgZmFsc2UpOwogCSAgdXBkYXRlX2VuZCAo Zik7CkBAIC0xOTI0NSw2ICsyNDIzNiwxNiBAQCB0cnlfd2luZG93X2lkIChzdHJ1Y3Qgd2luZG93 ICp3KQogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQogCSAgZ3VpX3VwZGF0ZV93aW5kb3dfYmVn aW4gKHcpOwogCSAgRlJBTUVfUklGIChmKS0+Y2xlYXJfd2luZG93X21vdXNlX2ZhY2UgKHcpOwor CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisg ICAgbWNfcHJlX3Njcm9sbF9jbGVhbiAodywgcnVuLCBmaXJzdF91bmNoYW5nZWRfYXRfZW5kX3Zw b3MsIGR2cG9zLCBUUllfV0lORE9XX0lEKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisK KwogCSAgRlJBTUVfUklGIChmKS0+c2Nyb2xsX3J1bl9ob29rICh3LCAmcnVuKTsKIAkgIGd1aV91 cGRhdGVfd2luZG93X2VuZCAodywgZmFsc2UsIGZhbHNlKTsKICNlbmRpZgpAQCAtMjE1MjgsNiAr MjY1MjksMTcgQEAgbWF5YmVfcHJvZHVjZV9saW5lX251bWJlciAoc3RydWN0IGl0ICppdCkKICAg ICAgIFNFVF9URVhUX1BPUyAodGVtX2l0LnBvc2l0aW9uLCAtMSwgLTEpOwogICAgICAgUFJPRFVD RV9HTFlQSFMgKCZ0ZW1faXQpOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCisgICAgICAvKiBUaGlzIHBlcm1pdHMgdXMgdG8gaW5zcGVjdCB0 aGUgSFBPUyBvZiBsaW5lIG51bWJlciBnbHlwaHMgYW5kIHRoZSBzcGFjZQorICAgICAgcGFkZGlu ZyBiZWZvcmUvYWZ0ZXIgdGhlIGxpbmUgbnVtYmVycy4gIFdlIHNldCBgZ2x5cGgtPmhwb3NgIGVs c2V3aGVyZS4gKi8KKyAgICAgIHRlbV9pdC5ocG9zICs9IDE7CisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworCisKICAgICAgIC8qIFN0b3AgcHJvZHVjaW5nIGdseXBocywgYW5kIHJlZnJhaW4g ZnJvbSBwcm9kdWNpbmcgdGhlIGxpbmUKIAkgbnVtYmVyLCBpZiB3ZSBkb24ndCBoYXZlIGVub3Vn aCBzcGFjZSBvbiB0aGlzIGxpbmUuICAqLwogICAgICAgaWYgKHRlbV9pdC5jdXJyZW50X3ggPj0g d2lkdGhfbGltaXQpCkBAIC0yMTUzOSw2ICsyNjU1MSwyOCBAQCBtYXliZV9wcm9kdWNlX2xpbmVf bnVtYmVyIChzdHJ1Y3QgaXQgKml0KQogCX0KICAgICB9CiAKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgc3RydWN0IGJ1ZmZlciAqYiA9IFhC VUZGRVIgKGl0LT53LT5jb250ZW50cyk7CisgIHN0cnVjdCBidWZmZXIgKm9sZF9idWZmZXIgPSBO VUxMOworICAvKiBOZWVkZWQgc28gdGhhdCBidWZmZXItbG9jYWwgdmFsdWVzIGNhbiBiZSBkZXRl cm1pbmVkOyBlLmcuLCB3aGVuIHN3aXRjaGluZworICB0byB0aGUgbWluaWJ1ZmZlci4gKi8KKyAg aWYgKGIgIT0gY3VycmVudF9idWZmZXIpCisgICAgeworICAgICAgb2xkX2J1ZmZlciA9IGN1cnJl bnRfYnVmZmVyOworICAgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAoYik7CisgICAgfQorICBpdC0+ dy0+bWMubG51bV9waXhlbF93aWR0aCA9ICghTklMUCAoVmRpc3BsYXlfbGluZV9udW1iZXJzKSkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IHRlbV9pdC5jdXJyZW50X3gKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IDA7CisgIGlmIChvbGRfYnVmZmVyKQorICAgIHNl dF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKworCiAgIC8qIFJlY29yZCB0aGUgd2lkdGggaW4gcGl4ZWxzIHdlIG5lZWQgZm9yIHRoZSBs aW5lIG51bWJlciBkaXNwbGF5LiAgKi8KICAgaXQtPmxudW1fcGl4ZWxfd2lkdGggPSB0ZW1faXQu Y3VycmVudF94OwogICAvKiBDb3B5IHRoZSBwcm9kdWNlZCBnbHlwaHMgaW50byBJVCdzIGdseXBo X3Jvdy4gICovCkBAIC0yNzM2MCw2ICszMjM5NCwxNyBAQCBhcHBlbmRfZ2x5cGggKHN0cnVjdCBp dCAqaXQpCiAJICAgIGdbMV0gPSAqZzsKIAkgIGdseXBoID0gaXQtPmdseXBoX3Jvdy0+Z2x5cGhz W2FyZWFdOwogCX0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBoLT5i eXRlcG9zID0gSVRfQllURVBPUyAoKml0KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisK KwogICAgICAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9zaXRpb24pOwogICAgICAg Z2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAgICAgICBpZiAoaXQtPnBpeGVsX3dpZHRoID4g MCkKQEAgLTI3NDQyLDYgKzMyNDg3LDE3IEBAIGFwcGVuZF9jb21wb3NpdGVfZ2x5cGggKHN0cnVj dCBpdCAqaXQpCiAJICAgIGdbMV0gPSAqZzsKIAkgIGdseXBoID0gaXQtPmdseXBoX3Jvdy0+Z2x5 cGhzW2l0LT5hcmVhXTsKIAl9CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBn bHlwaC0+Ynl0ZXBvcyA9IElUX0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKICAgICAgIGdseXBoLT5jaGFycG9zID0gaXQtPmNtcF9pdC5jaGFycG9zOwogICAg ICAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAgICAgICBlYXNzZXJ0IChpdC0+cGl4ZWxf d2lkdGggPD0gU0hSVF9NQVgpOwpAQCAtMjc2NTAsNiArMzI3MDYsMTcgQEAgcHJvZHVjZV9pbWFn ZV9nbHlwaCAoc3RydWN0IGl0ICppdCkKIAl9CiAgICAgICBpZiAoZ2x5cGggPCBpdC0+Z2x5cGhf cm93LT5nbHlwaHNbYXJlYSArIDFdKQogCXsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsK KyAgICAgIGdseXBoLT5ieXRlcG9zID0gSVRfQllURVBPUyAoKml0KTsKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisKKwogCSAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9zaXRp b24pOwogCSAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAJICBnbHlwaC0+cGl4ZWxfd2lk dGggPSBjbGlwX3RvX2JvdW5kcyAoLTEsIGl0LT5waXhlbF93aWR0aCwgU0hSVF9NQVgpOwpAQCAt Mjc3NTMsNiArMzI4MjAsMTcgQEAgcHJvZHVjZV94d2lkZ2V0X2dseXBoIChzdHJ1Y3QgaXQgKml0 KQogCX0KICAgICAgIGlmIChnbHlwaCA8IGl0LT5nbHlwaF9yb3ctPmdseXBoc1thcmVhICsgMV0p CiAJeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAq LworCisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPmJ5dGVwb3Mg PSBJVF9CWVRFUE9TICgqaXQpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICBn bHlwaC0+Y2hhcnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAJICBnbHlwaC0+b2JqZWN0 ID0gaXQtPm9iamVjdDsKIAkgIGdseXBoLT5waXhlbF93aWR0aCA9IGNsaXBfdG9fYm91bmRzICgt MSwgaXQtPnBpeGVsX3dpZHRoLCBTSFJUX01BWCk7CkBAIC0yNzgzOSw2ICszMjkxNywxNyBAQCBh cHBlbmRfc3RyZXRjaF9nbHlwaCAoc3RydWN0IGl0ICppdCwgTGlzcF9PYmplY3Qgb2JqZWN0LAog CSAgICB3aWR0aCAtPSBpdC0+Zmlyc3RfdmlzaWJsZV94IC0gaXQtPmN1cnJlbnRfeDsKIAkgIGVh c3NlcnQgKHdpZHRoID4gMCk7CiAJfQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyog TVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAg ICAgZ2x5cGgtPmJ5dGVwb3MgPSBJVF9CWVRFUE9TICgqaXQpOworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKworCiAgICAgICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlv bik7CiAgICAgICBnbHlwaC0+b2JqZWN0ID0gb2JqZWN0OwogICAgICAgLyogRklYTUU6IEl0IHdv dWxkIGJlIGJldHRlciB0byB1c2UgVFlQRV9NQVggaGVyZSwgYnV0CkBAIC0yODI5Myw2ICszMzM4 MiwxNyBAQCBhcHBlbmRfZ2x5cGhsZXNzX2dseXBoIChzdHJ1Y3QgaXQgKml0LCBpbnQgZmFjZV9p ZCwgYm9vbCBmb3Jfbm9fZm9udCwgaW50IGxlbiwKIAkgICAgZ1sxXSA9ICpnOwogCSAgZ2x5cGgg PSBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJlYV07CiAJfQorCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+aHBvcyA9IGl0 LT5ocG9zOworICAgICAgZ2x5cGgtPmJ5dGVwb3MgPSBJVF9CWVRFUE9TICgqaXQpOworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1Mg KGl0LT5wb3NpdGlvbik7CiAgICAgICBnbHlwaC0+b2JqZWN0ID0gaXQtPm9iamVjdDsKICAgICAg IGVhc3NlcnQgKGl0LT5waXhlbF93aWR0aCA8PSBTSFJUX01BWCk7CkBAIC0yOTM0MywxMCArMzQ0 NDMsMjAgQEAgZ3VpX2luc2VydF9nbHlwaHMgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlw aF9yb3cgKnVwZGF0ZWRfcm93LAogCiAgIC8qIFdyaXRlIHRoZSBnbHlwaHMuICAqLwogICBocG9z ID0gc3RhcnQgLSByb3ctPmdseXBoc1t1cGRhdGVkX2FyZWFdOworCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlmICghbWNfcmVkcmF3X3Jv dyAodywgdy0+Y3VycmVudF9tYXRyaXgsIHJvdywgdXBkYXRlZF9hcmVhLCB3LT5vdXRwdXRfY3Vy c29yLngsCisgICAgICAgICAgICAgICAgICAgICAgaHBvcywgaHBvcyArIGxlbiwgZmFsc2UsIERS QVdfTk9STUFMX1RFWFQsIEdVSV9JTlNFUlRfR0xZUEhTKSkKICAgZHJhd19nbHlwaHMgKHcsIHct Pm91dHB1dF9jdXJzb3IueCwgcm93LCB1cGRhdGVkX2FyZWEsCiAJICAgICAgIGhwb3MsIGhwb3Mg KyBsZW4sCiAJICAgICAgIERSQVdfTk9STUFMX1RFWFQsIDApOwogCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKworCiAgIC8qIEFkdmFuY2UgdGhlIG91dHB1dCBjdXJzb3IuICAqLwogICB3LT5v dXRwdXRfY3Vyc29yLmhwb3MgKz0gbGVuOwogICB3LT5vdXRwdXRfY3Vyc29yLnggKz0gc2hpZnRf Ynlfd2lkdGg7CkBAIC0yOTc3Miw5ICszNDg4MiwxOSBAQCBndWlfZml4X292ZXJsYXBwaW5nX2Fy ZWEgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKIAkgIHdoaWxlIChp IDwgcm93LT51c2VkW2FyZWFdCiAJCSAmJiByb3ctPmdseXBoc1thcmVhXVtpXS5vdmVybGFwc192 ZXJ0aWNhbGx5X3ApOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUt Q1VSU09SUyAqLworCisgICAgICBpZiAoIW1jX3JlZHJhd19yb3cgKHcsIHctPmN1cnJlbnRfbWF0 cml4LCByb3csIGFyZWEsIHN0YXJ0X3gsIHN0YXJ0LCBpLAorICAgICAgICAgIGZhbHNlLCBEUkFX X05PUk1BTF9URVhULCBHVUlfRklYX09WRVJMQVBQSU5HX0FSRUEpKQogCSAgZHJhd19nbHlwaHMg KHcsIHN0YXJ0X3gsIHJvdywgYXJlYSwKIAkJICAgICAgIHN0YXJ0LCBpLAogCQkgICAgICAgRFJB V19OT1JNQUxfVEVYVCwgb3ZlcmxhcHMpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAJfQogICAgICAgZWxzZQogCXsKQEAgLTMwMDI1LDEwICszNTE0NSwyMCBAQCBkaXNwbGF5X2Fu ZF9zZXRfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIG9uLAogICBuZXdfY3Vyc29yX3R5 cGUgPSBnZXRfd2luZG93X2N1cnNvcl90eXBlICh3LCBnbHlwaCwKIAkJCQkJICAgICZuZXdfY3Vy c29yX3dpZHRoLCAmYWN0aXZlX2N1cnNvcik7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgLyogSWYgY3Vyc29yIGlzIGN1cnJlbnRseSBi ZWluZyBzaG93biBhbmQgd2UgZG9uJ3Qgd2FudCBpdCB0byBiZSBvcgogICAgICBpdCBpcyBpbiB0 aGUgd3JvbmcgcGxhY2UsIG9yIHRoZSBjdXJzb3IgdHlwZSBpcyBub3Qgd2hhdCB3ZSB3YW50LAog ICAgICBlcmFzZSBpdC4gICovCiAgIGlmICh3LT5waHlzX2N1cnNvcl9vbl9wCisgICAgICAmJiBO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgJiYg TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICYm IE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAmJiB3 LT5tY19tYXRyaXguY3Vyc29yc191c2VkW01DX0NBQ0hFXSA9PSAwCisgICAgICAmJiB3LT5tY19t YXRyaXguY3Vyc29yc191c2VkW0NIX0NBQ0hFXSA9PSAwCisgICAgICAmJiB3LT5tY19tYXRyaXgu Y3Vyc29yc191c2VkW0ZDX0NBQ0hFXSA9PSAwCiAgICAgICAmJiAoIW9uCiAJICB8fCB3LT5waHlz X2N1cnNvci54ICE9IHgKIAkgIHx8IHctPnBoeXNfY3Vyc29yLnkgIT0geQpAQCAtMzAwNDEsNiAr MzUxNzEsOSBAQCBkaXNwbGF5X2FuZF9zZXRfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBib29s IG9uLAogCSAgICAgICYmIG5ld19jdXJzb3Jfd2lkdGggIT0gdy0+cGh5c19jdXJzb3Jfd2lkdGgp KSkKICAgICBlcmFzZV9waHlzX2N1cnNvciAodyk7CiAKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKICAgLyogRG9uJ3QgY2hlY2sgcGh5c19jdXJzb3Jfb25fcCBoZXJlIGJlY2F1c2UgdGhh dCBmbGFnIGlzIG9ubHkgc2V0CiAgICAgIHRvIGZhbHNlIGluIHNvbWUgY2FzZXMgd2hlcmUgd2Ug a25vdyB0aGF0IHRoZSBjdXJzb3IgaGFzIGJlZW4KICAgICAgY29tcGxldGVseSBlcmFzZWQsIHRv IGF2b2lkIHRoZSBleHRyYSB3b3JrIG9mIGVyYXNpbmcgdGhlIGN1cnNvcgpAQCAtMzAwNTksOSAr MzUxOTIsMjMgQEAgZGlzcGxheV9hbmRfc2V0X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgYm9v bCBvbiwKICAgICAgIHctPnBoeXNfY3Vyc29yLnZwb3MgPSB2cG9zOwogICAgIH0KIAorCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBpZiAoTklM UCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICYmIE5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpCisgICAgICAmJiBO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAgJiYgdy0+ bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtNQ19DQUNIRV0gPT0gMAorICAgICAgJiYgdy0+bWNfbWF0 cml4LmN1cnNvcnNfdXNlZFtDSF9DQUNIRV0gPT0gMAorICAgICAgJiYgdy0+bWNfbWF0cml4LmN1 cnNvcnNfdXNlZFtGQ19DQUNIRV0gPT0gMCkKICAgRlJBTUVfUklGIChmKS0+ZHJhd193aW5kb3df Y3Vyc29yICh3LCBnbHlwaF9yb3csIHgsIHksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgbmV3X2N1cnNvcl90eXBlLCBuZXdfY3Vyc29yX3dpZHRoLAogICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIG9uLCBhY3RpdmVfY3Vyc29yKTsKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogfQogCiAKQEAgLTMwMTU0LDcgKzM1MzAxLDE4IEBAIGRyYXdf cm93X3dpdGhfbW91c2VfZmFjZSAoc3RydWN0IHdpbmRvdyAqdywgaW50IHN0YXJ0X3gsIHN0cnVj dCBnbHlwaF9yb3cgKnJvdywKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KICAgaWYgKEZSQU1F X1dJTkRPV19QIChYRlJBTUUgKHctPmZyYW1lKSkpCiAgICAgeworCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBpZiAoIW1jX3JlZHJh d19yb3cgKHcsIHctPmN1cnJlbnRfbWF0cml4LCByb3csIFRFWFRfQVJFQSwgc3RhcnRfeCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnRfaHBvcywgZW5kX2hwb3MsIGZhbHNlLCBkcmF3 LCBEUkFXX1JPV19XSVRIX01PVVNFX0ZBQ0UpKQogICAgICAgZHJhd19nbHlwaHMgKHcsIHN0YXJ0 X3gsIHJvdywgVEVYVF9BUkVBLCBzdGFydF9ocG9zLCBlbmRfaHBvcywgZHJhdywgMCk7CisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIHJldHVybjsKICAgICB9CiAjZW5kaWYK QEAgLTMyMjE0LDExICszNzM3MiwyMyBAQCBleHBvc2VfYXJlYSAoc3RydWN0IHdpbmRvdyAqdywg c3RydWN0IGdseXBoX3JvdyAqcm93LCBjb25zdCBFbWFjc19SZWN0YW5nbGUgKnIsCiAgIHN0cnVj dCBnbHlwaCAqbGFzdDsKICAgaW50IGZpcnN0X3gsIHN0YXJ0X3gsIHg7CiAKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgaWYgKGFyZWEgPT0g VEVYVF9BUkVBICYmIHJvdy0+ZmlsbF9saW5lX3ApCisgICAgeworICAgICAgaWYgKCFtY19yZWRy YXdfcm93ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgcm93LCBhcmVhLCAwLCAwLCByb3ctPnVzZWRb YXJlYV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgIGZhbHNlLCBEUkFXX05PUk1BTF9URVhU LCBFWFBPU0VfQVJFQV9PTkUpKQogICAgIC8qIElmIHJvdyBleHRlbmRzIGZhY2UgdG8gZW5kIG9m IGxpbmUgd3JpdGUgdGhlIHdob2xlIGxpbmUuICAqLwogICAgIGRyYXdfZ2x5cGhzICh3LCAwLCBy b3csIGFyZWEsCiAJCSAwLCByb3ctPnVzZWRbYXJlYV0sCiAJCSBEUkFXX05PUk1BTF9URVhULCAw KTsKKyAgICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgZWxzZQogICAgIHsK ICAgICAgIC8qIFNldCBTVEFSVF9YIHRvIHRoZSB3aW5kb3ctcmVsYXRpdmUgc3RhcnQgcG9zaXRp b24gZm9yIGRyYXdpbmcgZ2x5cGhzIG9mCkBAIC0zMjI1MCwxMSArMzc0MjAsMjMgQEAgZXhwb3Nl X2FyZWEgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgY29uc3QgRW1h Y3NfUmVjdGFuZ2xlICpyLAogCSAgKytsYXN0OwogCX0KIAorCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogICAgICAgLyogUmVwYWludC4gICovCi0g ICAgICBpZiAobGFzdCA+IGZpcnN0KQorICAgICAgLyogRmxvYXRpbmcgZmFrZSBjdXJzb3JzIHdp bGwgZXhpc3Qgd2hlbiAobGFzdCA9PSBmaXJzdCkuICovCisgICAgICBpZiAoIW1jX3JlZHJhd19y b3cgKHcsIHctPmN1cnJlbnRfbWF0cml4LCByb3csIGFyZWEsIGZpcnN0X3ggLSBzdGFydF94LAor ICAgICAgICAgICAgICAgICAgICAgICAgICBmaXJzdCAtIHJvdy0+Z2x5cGhzW2FyZWFdLCBsYXN0 IC0gcm93LT5nbHlwaHNbYXJlYV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgIGZhbHNlLCBE UkFXX05PUk1BTF9URVhULCBFWFBPU0VfQVJFQV9UV08pCisgICAgICAgICAgJiYgbGFzdCA+IGZp cnN0KQogCWRyYXdfZ2x5cGhzICh3LCBmaXJzdF94IC0gc3RhcnRfeCwgcm93LCBhcmVhLAogCQkg ICAgIGZpcnN0IC0gcm93LT5nbHlwaHNbYXJlYV0sIGxhc3QgLSByb3ctPmdseXBoc1thcmVhXSwK IAkJICAgICBEUkFXX05PUk1BTF9URVhULCAwKTsKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogICAgIH0KIH0KIApAQCAtMzIyNjgsMTAgKzM3NDUwLDIyIEBAIGV4cG9zZV9saW5lIChz dHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGNvbnN0IEVtYWNzX1JlY3Rh bmdsZSAqcikKIHsKICAgZWFzc2VydCAocm93LT5lbmFibGVkX3ApOwogCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCiAgIGlmIChyb3ctPm1vZGVf bGluZV9wIHx8IHctPnBzZXVkb193aW5kb3dfcCkKKyAgICB7CisgICAgICBpZiAoIW1jX3JlZHJh d19yb3cgKHcsIHctPmN1cnJlbnRfbWF0cml4LCByb3csIFRFWFRfQVJFQSwgMCwgMCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgcm93LT51c2VkW1RFWFRfQVJFQV0sIGZhbHNlLCBEUkFXX05P Uk1BTF9URVhULCBFWFBPU0VfTElORSkpCiAgICAgZHJhd19nbHlwaHMgKHcsIDAsIHJvdywgVEVY VF9BUkVBLAogCQkgMCwgcm93LT51c2VkW1RFWFRfQVJFQV0sCiAJCSBEUkFXX05PUk1BTF9URVhU LCAwKTsKKyAgICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgZWxzZQogICAg IHsKICAgICAgIGlmIChyb3ctPnVzZWRbTEVGVF9NQVJHSU5fQVJFQV0pCkBAIC0zMjgxOSw2ICsz ODAxMywyMiBAQCBndWlfaW50ZXJzZWN0X3JlY3RhbmdsZXMgKGNvbnN0IEVtYWNzX1JlY3Rhbmds ZSAqcjEsIGNvbnN0IEVtYWNzX1JlY3RhbmdsZSAqcjIsCiB2b2lkCiBzeW1zX29mX3hkaXNwICh2 b2lkKQogeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09S UyAqLworCisgIGRlZnN1YnIgKCZTbWNfZHVtcF9nbHlwaF9yb3cpOworCisgIGRlZnN1YnIgKCZT bWNfZHVtcF9nbHlwaF9tYXRyaXgpOworCisgIGRlZnN1YnIgKCZTbWNfY3VycmVudF9jb2x1bW4p OworCisgIGRlZnN1YnIgKCZTbWNfc3RkZXJyKTsKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogICBWd2l0aF9lY2hvX2FyZWFfc2F2ZV92ZWN0b3IgPSBRbmlsOwogICBzdGF0aWNwcm8g KCZWd2l0aF9lY2hvX2FyZWFfc2F2ZV92ZWN0b3IpOwogCmRpZmYgLS1naXQgYS9zcmMveHRlcm0u YyBiL3NyYy94dGVybS5jCmluZGV4IGM5NmFhNzQuLjdmOGYxYTAgMTAwNjQ0Ci0tLSBhL3NyYy94 dGVybS5jCisrKyBiL3NyYy94dGVybS5jCkBAIC0xMzIsNiArMTMyLDkwNCBAQCBhbG9uZyB3aXRo IEdOVSBFbWFjcy4gIElmIG5vdCwgc2VlIDxodHRwczovL3d3dy5nbnUub3JnL2xpY2Vuc2VzLz4u ICAqLwogI2luY2x1ZGUgPFgxMS9YS0JsaWIuaD4KICNlbmRpZgogCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCisjaWZkZWYgR0xZUEhf REVCVUcKK3N0YXRpYyB2b2lkIHhfY2hlY2tfZm9udCAoc3RydWN0IGZyYW1lICosIHN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ZGVfbGluZV9mYWNlX2djIChzKTsKKyAg ICAgIHMtPnN0aXBwbGVkX3AgPSBzLT5mYWNlLT5zdGlwcGxlICE9IDA7CisgICAgfQorICBlbHNl IGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUikKKyAgICB7CisgICAgICBtY194X3NldF9jdXJzb3Jf Z2MgKHMsIGN1cnNvcl9nY19wKTsKKyAgICAgIHMtPnN0aXBwbGVkX3AgPSBmYWxzZTsKKyAgICB9 CisgIGVsc2UgaWYgKHMtPmhsID09IERSQVdfTU9VU0VfRkFDRSkKKyAgICB7CisgICAgICB4X3Nl dF9tb3VzZV9mYWNlX2djIChzKTsKKyAgICAgIHMtPnN0aXBwbGVkX3AgPSBzLT5mYWNlLT5zdGlw cGxlICE9IDA7CisgICAgfQorICBlbHNlIGlmIChzLT5obCA9PSBEUkFXX0lNQUdFX1JBSVNFRAor ICAgICAgICAgICB8fCBzLT5obCA9PSBEUkFXX0lNQUdFX1NVTktFTikKKyAgICB7CisgICAgICBz LT5nYyA9IHMtPmZhY2UtPmdjOworICAgICAgcy0+c3RpcHBsZWRfcCA9IHMtPmZhY2UtPnN0aXBw bGUgIT0gMDsKKyAgICB9CisgIGVsc2UKKyAgICBlbWFjc19hYm9ydCAoKTsKKyAgLyogR0MgbXVz dCBoYXZlIGJlZW4gc2V0LiAqLworICBlYXNzZXJ0IChzLT5nYyAhPSAwKTsKK30KKworLyogRHJh dyBhIGhvbGxvdyBib3ggY3Vyc29yIG9uIHdpbmRvdyBXIGluIGdseXBoIHJvdyBST1cuICovCitz dGF0aWMgdm9pZAorbWNfeF9kcmF3X2hvbGxvd19jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0 cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAg ICAgICAgICAgICAgICAgICAgIGludCB4LCBpbnQgZngsIGludCB5LCBpbnQgZnksIGludCBocG9z LCBpbnQgdnBvcywgaW50IH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iBEcmF3IGN1cnNvciBvbiB3 aW5kb3cgVy4gKi8KK3N0YXRpYyB2b2lkCittY194X2RyYXdfd2luZG93X2N1cnNvciAoc3RydWN0 IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93 ICpyb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHgsIGludCBmeCwgaW50IHksIGlu dCBmeSwgaW50IGhwb3MsIGludCB2cG9zLCBpbnQgd2QsCisgICAgICAgICAgICAgICAgICAgICAg ICAgaW50IGgsIHN0cnVjdCBtY19SR0IgbHNsLCBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90 eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGgsIGVudW0gbWNf Zmxhdm9yIGdseXBoX2ZsYXZvciwgYm9vbCBvbl9wLAorICAgICAgICAgICAgICAgICAgICAgICAg IGJvb2wgYWN0aXZlX3ApCit7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAoV0lORE9XX0ZS QU1FICh3KSk7CisgIC8qIFRoZSBmcmluZ2UgYml0bWFwcyBhcmUgcHJlc2VudGx5IGhhbmRsZWQg ZWxzZXdoZXJlLCBidXQgY291bGQgc29tZWRheQorICBiZSBtYW5hZ2VkIChpbiBwYXJ0KSBhdCB0 aGlzIHNlY3Rpb24gb2YgY29kZS4gKi8KKyAgaWYgKG9uX3ApCisgICAgeworICAgICAgaWYgKHJv dy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVfcAorICAgICAgICAgICYmIChyb3ctPnJldmVyc2Vk X3AKKyAgICAgICAgICAgICAgPyAoaHBvcyA8IDApCisgICAgICAgICAgICAgIDogKGhwb3MgPj0g cm93LT51c2VkW1RFWFRfQVJFQV0pKSkKKyAgICAgICAgeworICAgICAgICAgIHJvdy0+Y3Vyc29y X2luX2ZyaW5nZV9wID0gdHJ1ZTsKKyAgICAgIC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y3RpdmVfZmFjZS0+Zm9yZWdyb3VuZCk7CisgICAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQg KEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93 X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2UtPmJhY2tncm91bmQpOworICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICAgIGVsc2UgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAg ICAgICAmJiBhY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgt PmNoYXJwb3MgPiByZWdpb25fYmVnCisgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9n bHlwaC0+Y2hhcnBvcyA8IHJlZ2lvbl9lbmQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZV9p ZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3It aW4tcmVnaW9uLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgc3RydWN0 IGZhY2UgKmhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZSA9IEZBQ0VfRlJPTV9JRCAo ZiwgaG9sbG93X2FjdGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNlX2lkKTsKKyAgICAgICAgICAgICAg ICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFj ZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUp OworICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmV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IGhvbGxvd19hY3RpdmVfZmFjZS0+YmFja2dyb3VuZCk7CisgICAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAgICAgICBlbHNlIGlmICghYWN0aXZlX3ApCisgICAgICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0aXZl X2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2Ut Y3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAg ICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwg aG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICAgIFhTZXRGb3Jl Z3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2Ms IGhvbGxvd19pbmFjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgICAg ICBYU2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+ Y3Vyc29yX2djLCBob2xsb3dfaW5hY3RpdmVfZmFjZS0+YmFja2dyb3VuZCk7CisgICAgICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAvKiBGb3Jj ZSBgbWNfeF9zZXRfY3Vyc29yX2djJyB0byB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLngtPmN1cnNv cl9nYycuICovCisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IHRydWU7CisgICAgICAgICAg bWNfZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0N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gICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IGNvbG9yLnBp eGVsOworICAgICAgICAgICAgbWNfeF9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93 LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAgICAgICAgICAgIGYtPm91dHB1 dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAg ICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBUZW1w b3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYycgYnkgYm9ycm93aW5n IHRoZQorICAgICAgICAgICAgICBmdW5jdGlvbmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHhmbnMu Yy4gKi8KKyAgICAgICAgICAgICAgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAg ICAgJiYgYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+Y2hhcnBv cyA9PSByZWdpb25fYmVnKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGVu dW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZWdfZmFjZV9pZCA9IGxvb2t1cF9uYW1l ZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItYXQtcmVnaW9uLXByZS16 di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19h Y3RpdmVfcmVnaW9uX2JlZ19mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX3Jl Z2lvbl9iZWdfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93 X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVh bC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgIHN0 cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19h Y3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVf WF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfYWN0aXZl X2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZS QU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2Fj dGl2ZV9yZWdpb25fYmVnX2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBhY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9n bHlwaC0+Y2hhcnBvcyA9PSByZWdpb25fZW5kKQorICAgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2Vf aWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29y LWF0LXJlZ2lvbi1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgc3Ry dWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfcmVnaW9uX2VuZF9mYWNlID0gRkFDRV9GUk9NX0lEIChm LCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAg IGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAo dywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOwor ICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFD RV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAg ICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+ Y3Vyc29yX2djLCBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAg ICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2Rh dGEueC0+Y3Vyc29yX2djLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZS0+YmFja2dyb3Vu ZCk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmIChyZWdp b25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9wCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3MgPiByZWdpb25f YmVnCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3Mg PCByZWdpb25fZW5kKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAg ICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVf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ICAg ICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfZmFjZV9pZCA9IGxv b2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItcHJlLXp2 LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9s bG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQp OworICAgICAgICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExB WSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9mYWNlLT5m b3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIFhTZXRCYWNrZ3JvdW5kIChGUkFN RV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19hY3Rp dmVfZmFjZS0+YmFja2dyb3VuZCk7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgICAgICAgICAgIGVsc2UgaWYgKCFhY3RpdmVfcCkKKyAgICAgICAgICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2 ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtl LWN1cnNvci1pbmFjdGl2ZS1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19pbmFjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lE IChmLCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAg IFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5j dXJzb3JfZ2MsIGhvbGxvd19pbmFjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91 dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2luYWN0aXZlX2ZhY2UtPmJhY2tncm91bmQp OworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBibG9ja19pbnB1dCAo KTsKKyAgICAgICAgICAgICAgLyogRm9yY2UgYG1jX3hfc2V0X2N1cnNvcl9nYycgdG8gdXNlIGBz LT5mLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MnLiAqLworICAgICAgICAgICAgICBib29sIGN1 cnNvcl9nY19wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcs IG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2Qs IGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX2dj X3ApOworICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwg Zi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCB4Z2N2LmZvcmVncm91bmQpOworICAgICAgICAg ICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEu eC0+Y3Vyc29yX2djLCB4Z2N2LmJhY2tncm91bmQpOworICAgICAgICAgICAgICB1bmJsb2NrX2lu cHV0ICgpOworICAgICAgICAgICAgICAvKiBEcmF3IHRoZSBmcmFtZSBhcm91bmQgdGhlIGJveC4g Ki8KKyAgICAgICAgICAgICAgbWNfeF9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93 LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAgICAgICAgICAgIH0KKyAgICAg IGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0hPTExPV19CT1g6CisgICAgeworICAgICAgaWYg KGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAg ICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5j dXJzb3JfcGl4ZWwnLiAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhl bCA9IGNvbG9yLnBpeGVsOworICAgICAgICAgIG1jX3hfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBt YXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICAgICAg Zi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOwor ICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICBtY194X2RyYXdfaG9sbG93X2N1cnNv ciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAg ICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAgICB7CisgICAgICBp ZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAg ICAgIC8qIFRlbXBvcm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k7CisgICAgICAgICAgdW5i bG9ja19pbnB1dCAoKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAg ICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNfZHJhd19j dXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywg bHNsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgY3Vy c29yX3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOworICAgICAgICAgIH0KKyAgICAg IGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0JBUjoKKyAgICB7CisgICAgICBpZiAobHNsLnJl ZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAg ICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9w aXhlbCcuICovCisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gY29s b3IucGl4ZWw7CisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IHRy dWU7CisgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBm eCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBjdXJzb3Jfd2lkdGgsIE1DX0JBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOwor ICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNv cl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAg ICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IGZhbHNlOworICAgICAgICAgICAg bWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3Ms IHZwb3MsIHdkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl93 aWR0aCwgTUNfQkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgfQor ICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfSEJBUjoKKyAgICB7CisgICAgICBpZiAo bHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAg IHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1 cnNvcl9waXhlbCcuICovCisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVs ID0gY29sb3IucGl4ZWw7CisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlf cCA9IHRydWU7CisgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93 LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIE1DX0hCQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2th eV9wKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5h bF9jdXJzb3JfcGl4ZWw7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAg ICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSBmYWxzZTsKKyAgICAg ICAgICAgIG1jX3hfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5 LCBocG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoLCBj dXJzb3Jfd2lkdGgsIE1DX0hCQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAg ICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fi b3J0ICgpOworICB9CisgICAgICAgIH0KKyNpZmRlZiBIQVZFX1hfSTE4TgorICBpZiAodyA9PSBY V0lORE9XIChmLT5zZWxlY3RlZF93aW5kb3cpKQorICAgIGlmIChGUkFNRV9YSUMgKGYpICYmIChG UkFNRV9YSUNfU1RZTEUgKGYpICYgWElNUHJlZWRpdFBvc2l0aW9uKSkKKyAgICAgIHhpY19zZXRf cHJlZWRpdGFyZWEgKHcsIHgsIHkpOworI2VuZGlmCisgICAgfQorICBYRmx1c2ggKEZSQU1FX1hf RElTUExBWSAoZikpOworfQorCisvKiBEcmF3IHN0cmV0Y2ggZ2x5cGggc3RyaW5nIFMuICovCitz dGF0aWMgdm9pZAorbWNfeF9kcmF3X3N0cmV0Y2hfZ2x5cGhfc3RyaW5nIChzdHJ1Y3QgZ2x5cGhf c3RyaW5nICpzKQoreworICBlYXNzZXJ0IChzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBTVFJFVENI X0dMWVBIKTsKKyAgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SCisgICAgICAmJiAheF9zdHJldGNo X2N1cnNvcl9wKQorICAgIHsKKyAgICAgIC8qIElmIGB4LXN0cmV0Y2gtY3Vyc29yJyBpcyBuaWws IGRvbid0IGRyYXcgYSBibG9jayBjdXJzb3IgYXMgd2lkZSBhcyB0aGUKKyAgICAgIHN0cmV0Y2gg Z2x5cGguICovCisgICAgICBpbnQgd2lkdGgsIGJhY2tncm91bmRfd2lkdGggPSBzLT5iYWNrZ3Jv dW5kX3dpZHRoOworICAgICAgaW50IHggPSBzLT54OworICAgICAgaWYgKCFzLT5yb3ctPnJldmVy c2VkX3ApCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgbGVmdF94ID0gd2luZG93X2JveF9sZWZ0 X29mZnNldCAocy0+dywgVEVYVF9BUkVBKTsKKyAgICAgICAgICBpZiAoeCA8IGxlZnRfeCkKKyAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgYmFja2dyb3VuZF93aWR0aCAtPSBsZWZ0X3ggLSB4 OworICAgICAgICAgICAgICB4ID0gbGVmdF94OworICAgICAgICAgICAgfQorICAgICAgICB9Cisg ICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICAvKiBJbiBSMkwgcm93cywgZHJh dyB0aGUgY3Vyc29yIG9uIHRoZSByaWdodCBlZGdlIG9mIHRoZQorICAgICAgICAgICAgICAgc3Ry ZXRjaCBnbHlwaC4gKi8KKyAgICAgICAgICAgIGludCByaWdodF94ID0gd2luZG93X2JveF9yaWdo dCAocy0+dywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgIGlmICh4ICsgYmFja2dyb3VuZF93aWR0 aCA+IHJpZ2h0X3gpCisgICAgICAgICAgICAgIGJhY2tncm91bmRfd2lkdGggLT0geCAtIHJpZ2h0 X3g7CisgICAgICAgICAgICB4ICs9IGJhY2tncm91bmRfd2lkdGg7CisgICAgICAgICAgfQorICAg ICAgd2lkdGggPSBtaW4gKEZSQU1FX0NPTFVNTl9XSURUSCAocy0+ZiksIGJhY2tncm91bmRfd2lk dGgpOworICAgICAgaWYgKHMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAgICAgICAgeCAtPSB3aWR0aDsK KyAgICAgIC8qIERyYXcgY3Vyc29yLiAqLworICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19iZ19y ZWN0IChzLCB4LCBzLT55LCB3aWR0aCwgcy0+aGVpZ2h0KTsKKyAgICAgIC8qIENsZWFyIHJlc3Qg dXNpbmcgdGhlIEdDIG9mIHRoZSBvcmlnaW5hbCBub24tY3Vyc29yIGZhY2UuICovCisgICAgICBp ZiAod2lkdGggPCBiYWNrZ3JvdW5kX3dpZHRoKQorICAgICAgICB7CisgICAgICAgICAgaW50IHkg PSBzLT55OworICAgICAgICAgIGludCB3ID0gYmFja2dyb3VuZF93aWR0aCAtIHdpZHRoLCBoID0g cy0+aGVpZ2h0OworICAgICAgICAgIFhSZWN0YW5nbGUgcjsKKyAgICAgICAgICBHQyBnYzsKKyAg ICAgICAgICBpZiAoIXMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAgICAgICAgICAgIHggKz0gd2lkdGg7 CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeCA9IHMtPng7CisgICAgICAgICAgaWYgKHMt PnJvdy0+bW91c2VfZmFjZV9wCisgICAgICAgICAgICAgICYmIGN1cnNvcl9pbl9tb3VzZV9mYWNl X3AgKHMtPncpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICB4X3NldF9tb3VzZV9mYWNl X2djIChzKTsKKyAgICAgICAgICAgICAgZ2MgPSBzLT5nYzsKKyAgICAgICAgICAgIH0KKyAgICAg ICAgICBlbHNlCisgICAgICAgICAgICBnYyA9IHMtPmZhY2UtPmdjOworICAgICAgICAgIGdldF9n bHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCAmcik7CisgICAgICAgICAgeF9zZXRfY2xpcF9yZWN0 YW5nbGVzIChzLT5mLCBnYywgJnIsIDEpOworICAgICAgICAgIGlmIChzLT5mYWNlLT5zdGlwcGxl KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBGaWxsIGJhY2tncm91bmQgd2l0aCBh IHN0aXBwbGUgcGF0dGVybi4gKi8KKyAgICAgICAgICAgICAgWFNldEZpbGxTdHlsZSAoRlJBTUVf WF9ESVNQTEFZIChzLT5mKSwgZ2MsIEZpbGxP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dWNjZXNzb3JzIGZpcnN0IHNvIHRoYXQgUyBjYW4g ZHJhdyBpbnRvIGl0LgorICAgICBUaGlzIG1ha2VzIFMtPm5leHQgdXNlIFhEcmF3U3RyaW5nIGlu c3RlYWQgb2YgWERyYXdJbWFnZVN0cmluZy4gKi8KKyAgaWYgKHMtPm5leHQgJiYgcy0+cmlnaHRf b3ZlcmhhbmcgJiYgIXMtPmZvcl9vdmVybGFwcykKKyAgICB7CisgICAgICBpbnQgd2lkdGg7Cisg ICAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpuZXh0OworICAgICAgZm9yICh3aWR0aCA9IDAsIG5l eHQgPSBzLT5uZXh0OworICAgICAgICAgICBuZXh0ICYmIHdpZHRoIDwgcy0+cmlnaHRfb3Zlcmhh bmc7CisgICAgICAgICAgIHdpZHRoICs9IG5leHQtPndpZHRoLCBuZXh0ID0gbmV4dC0+bmV4dCkK KyAgICAgICAgaWYgKG5leHQtPmZpcnN0X2dseXBoLT50eXBlICE9IElNQUdFX0dMWVBIKQorICAg ICAgICAgIHsKKyAgICAgICAgICAgIG1jX3hfc2V0X2dseXBoX3N0cmluZ19nYyAobmV4dCwgY3Vy c29yX2djX3ApOworICAgICAgICAgICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nIChuZXh0 KTsKKyAgICAgICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSA9PSBTVFJFVENIX0dM WVBIKQorICAgICAgICAgICAgICBtY194X2RyYXdfc3RyZXRjaF9nbHlwaF9zdHJpbmcgKG5leHQp OworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2Jh Y2tncm91bmQgKG5leHQsIHRydWUpOworICAgICAgICAgICAgbmV4dC0+bnVtX2NsaXBzID0gMDsK KyAgICAgICAgICB9CisgICAgfQorICAvKiBTZXQgdXAgUy0+Z2MsIHNldCBjbGlwcGluZyBhbmQg ZHJhdyBTLiAqLworICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKHMsIGN1cnNvcl9nY19wKTsK KyAgLyogRHJhdyByZWxpZWYgKGlmIGFueSkgaW4gYWR2YW5jZSBmb3IgY2hhci9jb21wb3NpdGlv biBzbyB0aGF0IHRoZQorICAgICBnbHlwaCBzdHJpbmcgY2FuIGJlIGRyYXduIG92ZXIgaXQuICov CisgIGlmICghcy0+Zm9yX292ZXJsYXBzCisgICAgICAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9O T19CT1gKKyAgICAgICYmIChzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAg ICAgICAgfHwgcy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKSkKKyAgICB7 CisgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmcgKHMpOworICAgICAgeF9kcmF3X2ds eXBoX3N0cmluZ19iYWNrZ3JvdW5kIChzLCB0cnVlKTsKKyAgICAgIHhfZHJhd19nbHlwaF9zdHJp bmdfYm94IChzKTsKKyAgICAgIHhfc2V0X2dseXBoX3N0cmluZ19jbGlwcGluZyAocyk7CisgICAg ICByZWxpZWZfZHJhd25fcCA9IHRydWU7CisgICAgfQorICAgIGVsc2UgaWYgKCFzLT5jbGlwX2hl YWQgLyogZHJhd19nbHlwaHMgZGlkbid0IHNwZWNpZnkgYSBjbGlwIG1hc2suICovCisgICAgICAg ICAgICAgJiYgIXMtPmNsaXBfdGFpbAorICAgICAgICAgICAgICYmICgocy0+cHJldiAmJiBzLT5w cmV2LT5obCAhPSBzLT5obCAmJiBzLT5sZWZ0X292ZXJoYW5nKQorICAgICAgICAgICAgICAgICB8 fCAocy0+bmV4dCAmJiBzLT5uZXh0LT5obCAhPSBzLT5obCAmJiBzLT5yaWdodF9vdmVyaGFuZykp KQorICAgICAgLyogV2UgbXVzdCBjbGlwIGp1c3QgdGhpcyBnbHlwaC4gIGxlZnRfb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ICAgICAgICAgJiYgISBzLT5maXJzdF9nbHlwaC0+ dS5jbXAuYXV0b21hdGljKSkKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7 CisgICAgICBlbHNlCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywg dHJ1ZSk7CisgICAgICB4X2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChz KTsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgR0xZUEhMRVNTX0dMWVBIOgorICAgICAgaWYgKHMt PmZvcl9vdmVybGFwcykKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7Cisg ICAgICBlbHNlCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgdHJ1 ZSk7CisgICAgICB4X2RyYXdfZ2x5cGhsZXNzX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsK KyAgICAgIGJyZWFrOworICAgIGRlZmF1bHQ6CisgICAgICBlbWFjc19hYm9ydCAoKTsKKyAgICB9 CisgIGlmICghcy0+Zm9yX292ZXJsYXBzKQorICAgIHsKKyAgICAgIC8qIERyYXcgdW5kZXJsaW5l LiAqLworICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9wKQorICAgICAgICB7CisgICAgICAg ICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfV0FWRSkKKyAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRf cCkKKyAgICAgICAgICAgICAgICB4X2RyYXdfdW5kZXJ3YXZlIChzKTsKKyAgICAgICAgICAgICAg ZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIFhHQ1ZhbHVlcyB4Z2N2 OworICAgICAgICAgICAgICAgICAgWEdldEdDVmFsdWVzIChGUkFNRV9YX0RJU1BMQVkgKHMtPmYp LCBzLT5nYywgR0NGb3JlZ3JvdW5kLCAmeGdjdik7CisgICAgICAgICAgICAgICAgICBYU2V0Rm9y ZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChzLT5mKSwgcy0+Z2MsIHMtPmZhY2UtPnVuZGVybGlu ZV9jb2xvcik7CisgICAgICAgICAgICAgICAgICB4X2RyYXdfdW5kZXJ3YXZlIChzKTsKKyAgICAg ICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKHMtPmYpLCBzLT5n YywgeGdjdi5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9Cisg ICAgICAgICAgZWxzZSBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9M SU5FKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIHRoaWNrbmVz cywgcG9zaXRpb247CisgICAgICAgICAgICAgIGludCB5OworICAgICAgICAgICAgICBpZiAocy0+ cHJldiAmJiBzLT5wcmV2LT5mYWNlLT51bmRlcmxpbmVfcAorICAgICAgICAgICAgICAgICAgJiYg cy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIC8qIFdlIHVzZSB0aGUgc2FtZSB1bmRlcmxp bmUgc3R5bGUgYXMgdGhlIHByZXZpb3VzIG9uZS4gKi8KKyAgICAgICAgICAgICAgICAgIHRoaWNr bmVzcyA9IHMtPnByZXYtPnVuZGVybGluZV90aGlja25lc3M7CisgICAgICAgICAgICAgICAgICBw b3NpdGlvbiA9IHMtPnByZXYtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICAvKiBHZXQgdGhlIHVuZGVybGluZSB0aGlja25lc3MuICBEZWZhdWx0IGlzIDEgcGl4ZWwuICov CisgICAgICAgICAgICAgICAgICBpZiAocy0+Zm9udCAmJiBzLT5mb250LT51bmRlcmxpbmVfdGhp Y2tuZXNzID4gMCkKKyAgICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+Zm9udC0+dW5k ZXJsaW5lX3RoaWNrbmVzczsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAg ICAgICAgdGhpY2tuZXNzID0gMTsKKyAgICAgICAgICAgICAgICAgIGlmICh4X3VuZGVybGluZV9h dF9kZXNjZW50X2xpbmUpCisgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmhlaWdo dCAtIHRoaWNrbmVzcykgLSAocy0+eWJhc2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIC8qIEdldCB0 aGUgdW5kZXJsaW5lIHBvc2l0aW9uLiAgVGhpcyBpcyB0aGUgcmVjb21tZW5kZWQKKyAgICAgICAg ICAgICAgICAgICAgICAgICB2ZXJ0aWNhbCBvZmZzZXQgaW4gcGl4ZWxzIGZyb20gdGhlIGJhc2Vs aW5lIHRvIHRoZSB0b3Agb2YKKyAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgdW5kZXJsaW5l LiAgVGhpcyBpcyBhIHNpZ25lZCB2YWx1ZSBhY2NvcmRpbmcgdG8gdGhlCisgICAgICAgICAgICAg ICAgICAgICAgICAgc3BlY3MsIGFuZCBpdHMgZGVmYXVsdCBpcworICAgICAgICAgICAgICAgICAg ICAgICAgIFJPVU5EICgobWF4aW11bSBkZXNjZW50KSAvIDIpLCB3aXRoCisgICAgICAgICAgICAg ICAgICAgICAgICAgUk9VTkQoeCkgPSBmbG9vciAoeCArIDAuNSkgICovCisgICAgICAgICAgICAg ICAgICAgICAgaWYgKHhfdXNlX3VuZGVybGluZV9wb3NpdGlvbl9wcm9wZXJ0aWVzCisgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHMtPmZvbnQgJiYgcy0+Zm9udC0+dW5kZXJsaW5lX3Bvc2l0 aW9uID49IDApCisgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPmZvbnQtPnVu ZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChzLT5mb250 KQorICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+Zm9udC0+ZGVzY2VudCAr IDEpIC8gMjsKKyAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAg ICAgICBwb3NpdGlvbiA9IHVuZGVybGluZV9taW5pbXVtX29mZnNldDsKKyAgICAgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBtYXggKHBvc2l0aW9uLCB1bmRl cmxpbmVfbWluaW11bV9vZmZzZXQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAg LyogQ2hlY2sgdGhlIHNhbml0eSBvZiB0aGlja25lc3MgYW5kIHBvc2l0aW9uLiAgV2Ugc2hvdWxk CisgICAgICAgICAgICAgICAgIGF2b2lkIGRyYXdpbmcgdW5kZXJsaW5lIG91dCBvZiB0aGUgY3Vy cmVudCBsaW5lIGFyZWEuICovCisgICAgICAgICAgICAgIGlmIChzLT55ICsgcy0+aGVpZ2h0IDw9 IHMtPnliYXNlICsgcG9zaXRpb24pCisgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+aGVp Z2h0IC0gMSkgLSAocy0+eWJhc2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgaWYgKHMtPnkgKyBz LT5oZWlnaHQgPCBzLT55YmFzZSArIHBvc2l0aW9uICsgdGhpY2tuZXNzKQorICAgICAgICAgICAg ICAgIHRoaWNrbmVzcyA9IChzLT55ICsgcy0+aGVpZ2h0KSAtIChzLT55YmFzZSArIHBvc2l0aW9u KTsKKyAgICAgICAgICAgICAgcy0+dW5kZXJsaW5lX3RoaWNrbmVzcyA9IHRoaWNrbmVzczsKKyAg ICAgICAgICAgICAgcy0+dW5kZXJsaW5lX3Bvc2l0aW9uID0gcG9zaXRpb247CisgICAgICAgICAg ICAgIHkgPSBzLT55YmFzZSArIHBvc2l0aW9uOworICAgICAgICAgICAgICBpZiAocy0+ZmFjZS0+ dW5kZXJsaW5lX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgICAgIHhfZmlsbF9yZWN0YW5nbGUg KHMtPmYsIHMtPmdjLCBzLT54LCB5LCBzLT53aWR0aCwgdGhpY2tuZXNzKTsKKyAgICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIFhHQ1ZhbHVlcyB4 Z2N2OworICAgICAgICAgICAgICAgICAgWEdldEdDVmFsdWVzIChGUkFNRV9YX0RJU1BMQVkgKHMt PmYpLCBzLT5nYywgR0NGb3JlZ3JvdW5kLCAmeGdjdik7CisgICAgICAgICAgICAgICAgICBYU2V0 Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChzLT5mKSwgcy0+Z2MsIHMtPmZhY2UtPnVuZGVy bGluZV9jb2xvcik7CisgICAgICAgICAgICAgICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChzLT5mLCBz LT5nYywgcy0+eCwgeSwgcy0+d2lkdGgsIHRoaWNrbmVzcyk7CisgICAgICAgICAgICAgICAgICBY U2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChzLT5mKSwgcy0+Z2MsIHhnY3YuZm9yZWdy b3VuZCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAg ICAvKiBEcmF3IG92ZXJsaW5lLiAqLworICAgIC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2Nv bG9yX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgeF9maWxsX3JlY3RhbmdsZSAocy0+Ziwgcy0+ Z2MsIHMtPngsIHMtPnkgKyBkeSwgcy0+d2lkdGgsIGgpOworICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgWEdDVmFsdWVzIHhnY3Y7CisgICAgICAgICAgICAgIFhH ZXRHQ1ZhbHVlcyAoRlJBTUVfWF9ESVNQTEFZIChzLT5mKSwgcy0+Z2MsIEdDRm9yZWdyb3VuZCwg JnhnY3YpOworICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChz LT5mKSwgcy0+Z2MsIHMtPmZhY2UtPnN0cmlrZV90aHJvdWdoX2NvbG9yKTsKKyAgICAgICAgICAg ICAgeF9maWxsX3JlY3RhbmdsZSAocy0+Ziwgcy0+Z2MsIHMtPngsIHMtPnkgKyBkeSwgcy0+d2lk dGgsIGgpOworICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChz LT5mKSwgcy0+Z2MsIHhnY3YuZm9yZWdyb3VuZCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0K KyAgICAgIC8qIERyYXcgcmVsaWVmIGlmIG5vdCB5ZXQgZHJhd24uICovCisgICAgICBpZiAoIXJl bGllZl9kcmF3bl9wICYmIHMtPmZhY2UtPmJveCAhPSBGQUNFX05PX0JPWCkKKyAgICAgICAgICB4 X2RyYXdfZ2x5cGhfc3RyaW5nX2JveCAocyk7CisgICAgICBpZiAocy0+cHJldikKKyAgICAgICAg eworICAgICAgICAgIHN0cnVjdCBnbHlwaF9zdHJpbmcgKnByZXY7CisgICAgICAgICAgZm9yIChw cmV2ID0gcy0+cHJldjsgcHJldjsgcHJldiA9IHByZXYtPnByZXYpCisgICAgICAgICAgICBpZiAo cHJldi0+aGwgIT0gcy0+aGwKKyAgICAgICAgICAgICAgICAmJiBwcmV2LT54ICsgcHJldi0+d2lk dGggKyBwcmV2LT5yaWdodF9vdmVyaGFuZyA+IHMtPngpCisgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAvKiBBcyBwcmV2IHdhcyBkcmF3biB3aGlsZSBjbGlwcGVkIHRvIGl0cyBvd24g YXJlYSwgd2UKKyAgICAgICAgICAgICAgICAgICBtdXN0IGRyYXcgdGhlIHJpZ2h0X292ZXJoYW5n IHBhcnQgdXNpbmcgcy0+aGwgbm93LiAqLworICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlw aHNfZmFjZSBzYXZlID0gcHJldi0+aGw7CisgICAgICAgICAgICAgICAgcHJldi0+aGwgPSBzLT5o bDsKKyAgICAgICAgICAgICAgICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKHByZXYsIGN1cnNv cl9nY19wKTsKKyAgICAgICAgICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhh Y3RseSAocywgcHJldik7CisgICAgICAgICAgICAgICAgaWYgKHByZXYtPmZpcnN0X2dseXBoLT50 eXBlID09IENIQVJfR0xZUEgpCisgICAgICAgICAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5n X2ZvcmVncm91bmQgKHByZXYpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAg ICAgIHhfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHByZXYpOworICAg ICAgICAgICAgICAgIHhfcmVzZXRfY2xpcF9yZWN0YW5nbGVzIChwcmV2LT5mLCBwcmV2LT5nYyk7 CisgICAgICAgICAgICAgICAgcHJldi0+aGwgPSBzYXZlOworICAgICAgICAgICAgICAgIHByZXYt Pm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKHMt Pm5leHQpCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpuZXh0Owor ICAgICAgICAgIGZvciAobmV4dCA9IHMtPm5leHQ7IG5leHQ7IG5leHQgPSBuZXh0LT5uZXh0KQor ICAgICAgICAgICAgaWYgKG5leHQtPmhsICE9IHMtPmhsCisgICAgICAgICAgICAgICAgJiYgbmV4 dC0+eCAtIG5leHQtPmxlZnRfb3ZlcmhhbmcgPCBzLT54ICsgcy0+d2lkdGgpCisgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAvKiBBcyBuZXh0IHdpbGwgYmUgZHJhd24gd2hpbGUgY2xp cHBlZCB0byBpdHMgb3duIGFyZWEsCisgICAgICAgICAgICAgICAgICAgd2UgbXVzdCBkcmF3IHRo ZSBsZWZ0X292ZXJoYW5nIHBhcnQgdXNpbmcgcy0+aGwgbm93LiAqLworICAgICAgICAgICAgICAg IGVudW0gZHJhd19nbHlwaHNfZmFjZSBzYXZlID0gbmV4dC0+aGw7CisgICAgICAgICAgICAgICAg bmV4dC0+aGwgPSBzLT5obDsKKyAgICAgICAgICAgICAgICBtY194X3NldF9nbHlwaF9zdHJpbmdf Z2MgKG5leHQsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICAgICAgICB4X3NldF9nbHlwaF9zdHJp bmdfY2xpcHBpbmdfZXhhY3RseSAocywgbmV4dCk7CisgICAgICAgICAgICAgICAgaWYgKG5leHQt PmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgpCisgICAgICAgICAgICAgICAgICB4X2Ry YXdfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5leHQpOworICAgICAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgICAgIHhfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91 bmQgKG5leHQpOworICAgICAgICAgICAgICAgIHhfcmVzZXRfY2xpcF9yZWN0YW5nbGVzIChuZXh0 LT5mLCBuZXh0LT5nYyk7CisgICAgICAgICAgICAgICAgbmV4dC0+aGwgPSBzYXZlOworICAgICAg ICAgICAgICAgIG5leHQtPm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgICAgICAgbmV4dC0+Y2xp cF9oZWFkID0gcy0+bmV4dDsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAv KiBSZXNldCBjbGlwcGluZy4gKi8KKyAgeF9yZXNldF9jbGlwX3JlY3RhbmdsZXMgKHMtPmYsIHMt PmdjKTsKKyAgcy0+bnVtX2NsaXBzID0gMDsKK30KKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMg Ki8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC8qIERlZmF1bHQgdG8gdXNpbmcgWElN IGlmIGF2YWlsYWJsZS4gICovCiAjaWZkZWYgVVNFX1hJTQogYm9vbCB1c2VfeGltID0gdHJ1ZTsK QEAgLTExMDksNiArMjAwNywxNiBAQCBzdGF0aWMgdm9pZAogeF91cGRhdGVfYmVnaW4gKHN0cnVj dCBmcmFtZSAqZikKIHsKICAgLyogTm90aGluZyB0byBkby4gICovCisKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdf ZnJhbWUgPSBmOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiB9CiAKIC8qIERyYXcg YSB2ZXJ0aWNhbCB3aW5kb3cgYm9yZGVyIGZyb20gKHgseTApIHRvICh4LHkxKSAgKi8KQEAgLTEy NTQsNiArMjE2MiwxNiBAQCB4X3VwZGF0ZV9lbmQgKHN0cnVjdCBmcmFtZSAqZikKICAgWEZsdXNo IChGUkFNRV9YX0RJU1BMQVkgKGYpKTsKICAgdW5ibG9ja19pbnB1dCAoKTsKICNlbmRpZgorCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYt Pm1jX3VwZGF0aW5nX2ZyYW1lID0gTlVMTDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisK KwogfQogCiAvKiBUaGlzIGZ1bmN0aW9uIGlzIGNhbGxlZCBmcm9tIHZhcmlvdXMgcGxhY2VzIGlu IHhkaXNwLmMKQEAgLTEzMjM4LDYgKzE0MTU2LDIwIEBAIGV4dGVybiBmcmFtZV9wYXJtX2hhbmRs ZXIgeF9mcmFtZV9wYXJtX2hhbmRsZXJzW107CiAKIHN0YXRpYyBzdHJ1Y3QgcmVkaXNwbGF5X2lu dGVyZmFjZSB4X3JlZGlzcGxheV9pbnRlcmZhY2UgPQogICB7CisKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRpc3BsYXlfaW50ZXJm YWNlJyBpbiBgeHRlcm0uY2AgbXVzdCBiZSBpbiB0aGUgZXhhY3Qgc2FtZSBvcmRlciBhcyB0aGUK K2ByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgZGlzcGV4dGVybi5oYCEgKi8KKworICBtY194X2Ry YXdfd2luZG93X2N1cnNvciwKKyAgbWNfeF9kcmF3X2dseXBoX3N0cmluZywKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogICAgIHhfZnJhbWVfcGFybV9oYW5kbGVycywKICAgICBndWlf cHJvZHVjZV9nbHlwaHMsCiAgICAgZ3VpX3dyaXRlX2dseXBocywK --Multipart_Thu_Oct_17_18:12:35_2019-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs / fill-column). References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Mon, 18 Nov 2019 06:59:05 +0000 Resent-Message-ID: <handler.22873.B22873.157406032613254 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22873 <at> debbugs.gnu.org,17684 <at> debbugs.gnu.org Cc: eliz@HIDDEN, johnw@HIDDEN, mbork@HIDDEN, rms@HIDDEN, akioburns@HIDDEN Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.157406032613254 (code B ref 22873); Mon, 18 Nov 2019 06:59:05 +0000 Received: (at 22873) by debbugs.gnu.org; 18 Nov 2019 06:58:46 +0000 Received: from localhost ([127.0.0.1]:43064 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1iWazl-0003Ri-Tn for submit <at> debbugs.gnu.org; Mon, 18 Nov 2019 01:58:45 -0500 Received: from gateway32.websitewelcome.com ([192.185.145.1]:39335) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1iWazL-0003R6-VL for 22873 <at> debbugs.gnu.org; Mon, 18 Nov 2019 01:58:40 -0500 Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway32.websitewelcome.com (Postfix) with ESMTP id 4F5EB14A9E for <22873 <at> debbugs.gnu.org>; Mon, 18 Nov 2019 00:58:19 -0600 (CST) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id WazKijFD5BnGaWazKiJ13X; Mon, 18 Nov 2019 00:58:19 -0600 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=h6D2KZ/eLGdfkp841ly7OK0WwrErhjLCw+RixGJv9Cs=; b=d32b8Btq7xJKa1OdOiyTTtGBCi k8TEW0tLDrWPLvVvrUGn30094aZeJieHzML8SWN4Uj0q0gwO1TMzenhESgbYDz0EZIwWLO7IFQegL httmYQ8caGesHAUJJvGRMudI9QWrsnoxFHE7HC/8KjgRiGfaFH7N8GtYcMK4lzgFBSIATCdiRfhZH VDNacoFXuYGgOEK8iWRBjikJcKkEbUxKItQ1Y2+VeBnvVMG7y1pqQ1OIUVyE1Iwhn+hzJr3SO7QlB L58Q6E2bZrCr3QC+rT4AspAx/m2meYrsnQ3cbkjEJ+SH06b9guXfKEDe517bLRnt/UUYmJzP6rdyt C4RMKpfQ==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:52650 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from <esq@HIDDEN>) id 1iWazG-0004A9-OE; Mon, 18 Nov 2019 00:58:17 -0600 Date: Sun, 17 Nov 2019 22:58:13 -0800 Message-ID: <m24kz1zn5m.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Sun_Nov_17_22:58:13_2019-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1iWazG-0004A9-OE X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:52650 X-Source-Auth: lawlist X-Email-Count: 7 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> --Multipart_Sun_Nov_17_22:58:13_2019-1 Content-Type: text/plain; charset=US-ASCII VERSION: 022.005 [11/17/2019] CHANGELOG: - Fixed a bug affecting the NS port relating to redrawing fake cursors on left/ right overwritten glyphs. When `mc_update_window_erase' calls `mc_erase_cursor', the window cache of fake cursors has already been updated even though the window contents have not. As such, it is necessary to use the `old_cache' (saved fake cursor cache from the previous command loop) to determine which fake cursors must be redrawn. [Prior to this bug fix, the updated cache of fake cursors (i.e., `w->mc_matrix`) was used when determining which fake cursors to redraw on the left/right overwritten glyphs.] As to the W32 port and the X11 port, support for redrawing fake cursors on left/right overwritten glyphs is still on the "todo list". However, `mc_w32_draw_glyph_string' and `mc_x_draw_glyph_string' have now been updated to include an extra argument for the `mc_matrix`. - Miscellaneous tidying-up of code. VIDEOS: w32: https://youtu.be/r3BdJVlsAnQ ns: https://youtu.be/bc1h8jtbXmw x11: https://youtu.be/aCIFhD2Xz5s SCREENSHOTS: https://www.lawlist.com/images/22873_17684_light_dark_backgrounds.png SETUP: Step 1: git clone -b master git://git.sv.gnu.org/emacs.git Step 2: In the new emacs folder, go back to an Emacs version from 07/14/2019: git reset --hard ac57c5093829ee09084c562bbbc1c412179be13d Step 3: From within the new emacs folder created in Step 1, apply the patch: git apply /path/to/the/patch.diff Step 4: ./autogen.sh Step 5: ./configure ... [your custom options] Step 6: make Step 7: make install USAGE: - For a minimal working example of built-in fake cursors, type: M-x mc-test ;;; TURN ON FAKE CURSORS (buffer position, cursor-type, cursor color): (setq mc-conf '((1 "hbar" "magenta") (2 "bar" "purple") (3 "box" "#00FF00") (4 "hollow" "#0000FF") (5 ("hbar" 3) [1.0 0.0 1.0]) (6 ("bar" 3) [0.0 1.0 1.0]) (7 "framed" "OrangeRed"))) ;;; TURN OFF FAKE CURSORS: (setq mc-conf nil) - To try out both the crosshairs feature and the visible fill column indicator feature, type: M-x +-mode - To try out just the visible fill column indicator feature, type: M-x fc-mode - To try out built-in fake cursors with Magnar Sveen's multiple-cursors package, that package must be installed. If the multiple-cursors package is already installed, then just (require 'crosshairs) and `crosshairs.el` will redefine a few of the multiple-cursors functions and set up a few keyboard shortcuts. If the multiple-cursors package by Magnar Sveen is not already installed, then here are two easy ways to install that package: Type: M-x mc-install OR, evaluate the following snippet: (progn (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) (package-refresh-contents) (package-install 'multiple-cursors) (mc/built-in-cursors)) NOTES: - Our journey begins at the outset of `update_window' when `mc_update_window_dryrun' performs a `!draw_p` simulation to create a new cache of fake cursors that are stored in the `w->mc_matrix`. The cache of fake cursors from the previous redisplay is copied to a temporary `mc_matrix` under the name of `old_matrix`. `mc_update_text_area' (used for `!draw_p` / `draw_p` situations) calls `mc_draw_glyphs' (writes glyphs to the glass) followed by `mc_draw_row' (writes fake cursors to the glass immediately thereafter). At the tail end of `mc_update_window_dryrun', `mc_update_window_erase' compares the new `w->mc_matrix` with the `old_matrix` to determine which fake cursors are the same -- setting the `same_p` boolean struct member accordingly for each applicable fake cursor within the `w->mc_matrix`. All fake cursors in the `old_matrix` that are `!same_p` get erased at this juncture. [Fn 1.] After the dryrun is complete, `update_window' does the real thing -- `draw_p`. As to the `from_where` situations of SKIPPED, POST_CHANGED, UNCHANGED, and SET_CURSOR_TWO, `mc_helper' compares the incoming tentative fake cursor with the `w->mc_matrix` to see if it has previously been marked as `same_p` -- if it is `!same_p`, then the fake cursor is drawn and we `return`. Fake cursors that have a `cursor_type` of MC_LEFT_FRINGE_BITMAP or MC_RIGHT_FRINGE_BITMAP are always reset even if they are `same_p`. As to the `from_where` situations of SCRIBE_ONE, SCRIBE_TWO, SCRIBE_THREE, and NOWHERE, `mc_helper' always causes fake cursors to be drawn (because new glyphs were written to the glass, or the area to the right of the display line was cleared) and we `return`. . Fn. 1: Even though writing new glyphs to the glass (SCRIBE_ONE, SCRIBE_TWO, and SCRIBE_THREE) would erase fake cursors within those boundaries, it is still necessary to erase `!same_p` fake cursors prior thereto. This is because `scrolling_window' occurs before new glyphs are written and `rif->scroll_run_hook' may copy one or more rows to other areas of the glass. It is not worth the effort to programmatically track both the _copied_ fake cursors and the _original_ fake cursors from the previous redisplay cycle, whose glyphs may remain where they are in the current redisplay cycle because they satisfy the `GLYPH_EQUAL_P' test. - The rest of our journey takes place wherever `draw_glyphs' would ordinarily be called, excluding `update_text_area'. If features 17684/22873 are active, `mc_redraw_row' calls `mc_draw_glyphs' (writes glyphs to the glass) and fake cursors are written to the glass immediately thereafter (if the coordinates coincide with prerecorded data in the `w->mc_matrix`). The functions containing the aforementioned calls are: . `gui_insert_glyphs' . `gui_fix_overlapping_area' . `draw_row_with_mouse_face' . `expose_area' . `expose_line' . `redraw_overlapped_rows' [which has been incorporated into `update_window'] - As to `mc_scrolling_window', it would appear that there is no tangible benefit to rotating the current/prospective cache of fake cursors to compare the data before removing the fake cursors. When scrolling the display, only _some_ lines are copied to new locations. Areas that are not overwritten may have fake cursors and those may not necessarily be removed if desired/current matrix glyphs are equal. The test for `GLYPH_EQUAL_P' does not take into consideration the existence of a fake cursor, and the glyph (with a fake cursor) may not be updated as a result thereof. As to lines that are not copied, portions may be updated and fake cursors would be removed thereby. `mc_rotate_matrix' and `mc_reverse_vpos' were removed with patch v. 022.002. - NS: As of 09/28/2018 (7946445962372c4255180af45cb7c857f1b0b5fa), the NS port no longer does anything useful during `update_window' except mark dirty rectangles. All drawing is now done when the MacOS calls `drawRect', which in turn calls `expose_frame'. TODO: - When an idle-timer fires and point is at the end of a horizontally scrolled line in a narrow window, the temporary horizontal scroll is canceled. Create a minimal working example and file a bug report. (progn (defun test () (interactive) (let ((ov (make-overlay (point) (1+ (point)) nil t t))) (overlay-put ov 'face '(:foreground "red")))) (global-set-key [f5] 'test) (split-window-horizontally) (switch-to-buffer (get-buffer-create "foo")) (setq bidi-display-reordering nil) (setq-local auto-hscroll-mode 'current-line) (dotimes (i 80) (insert (char-to-string (+ 65 i))))) - `ns_draw_window_cursor' calls `ns_clip_to_rect', which does _not_ take `row->clip` into consideration when drawing cursors with `NSRectFill'. When it comes time to draw glyphs on top of the box/hollow family of cursors, `row->clip` is taken into consideration by `get_glyph_string_clip'. Fake cursors can be drawn even though the glyphs cannot, resulting in hollow/box family of cursors without text. The issue can be reproduced with M-x mc-test. [A temporary workaround is to disable `row->clip` while drawing the glyphs.] https://lists.gnu.org/archive/html/emacs-devel/2019-04/msg00009.html - Deal with left/right overwritten glyphs in the w32 and X ports of Emacs. - There is a bug affecting the recorded `w->mc.lnum_pixel_width` that is observable when not running under gdb, but disappears when running under gdb. While viewing a folded org-mode buffer, the non-gdb instance had a visible line number pixel-width of 44, but Emacs treated it as fluctuating between 44 and 55 as the cursor was moved to the end of line. In the gdb instance, the visible line number pixel width was 55 with no fluctuation under the same conditions as the non-gdb instance. This appears to be a different bug than bug#32177 (current line number shifts one column to the left) because the line number of the current line does not shift left, and changing the bidi settings did not correct the issue. - The current test for `auto_hscroll_mode_p' only looks for `current_line` and all five related tests are based upon that assumption, which may not be true. - Multiple Cursors: If point is in the middle of a composite character, then select a fully composed character so that the fake cursor is visible. - Implement functionality similar to the Lisp multiple-cursors by Magnar Sveen. - Follow up with the Emacs team re bug#32177; i.e., (Current line number shifts one column to the left.) - Follow up with the Emacs team re bug#32060; i.e., Horizontal Scrolling (Current Line): Wrong line gets h-scrolled. - Determine if bug #28936 needs to be fixed and help the Emacs team re same. - Is there any additional meaningful optimization that can be added to the three calls of `mc_pre_scroll_clean'? - There is a bug affecting an older version of Emacs for the NS port that causes partial line flickering when the same characters are grouped together (;;;;;;) and MC_GLYPHLESS cursors are above or below -- having the same background color as the frame; e.g., black on black (used to erase a glyphless cursor). The partial flickering is only noticeable with rapid fire; e.g., holding down the right/left arrow key. When changing the color of the glyphless cursor, the issue is not present. [@lawlist has verified that the X and HPOS coordinates are accurate.] --Multipart_Sun_Nov_17_22:58:13_2019-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="2019_11_17__20_26_22_702.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvY3Jvc3NoYWlycy5lbCBiL2xpc3AvY3Jvc3NoYWlycy5lbApuZXcg ZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5kMDlhMTMyCi0tLSAvZGV2L251bGwKKysr IGIvbGlzcC9jcm9zc2hhaXJzLmVsCkBAIC0wLDAgKzEsMTI4NCBAQAorOzs7Ozs7Ozs7Ozs7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nNvcnMtbW9kZSAwKQorICAgICAgICAod2hlbiB0aGlzLW9yaWdpbmFsLWNvbW1hbmQKKyAgICAg ICAgICAobGV0ICgob3JpZ2luYWwtY29tbWFuZCAob3IgbWMtLXRoaXMtY29tbWFuZAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29tbWFuZC1yZW1hcHBpbmcgdGhpcy1v cmlnaW5hbC1jb21tYW5kKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0 aGlzLW9yaWdpbmFsLWNvbW1hbmQpKSkKKyAgICAgICAgICAgIDs7IHNraXAga2V5Ym9hcmQgbWFj cm9zLCBzaW5jZSB0aGV5IHdpbGwgZ2VuZXJhdGUgYWN0dWFsIGNvbW1hbmRzIHRoYXQgYXJlCisg ICAgICAgICAgICA7OyBhbHNvIHJ1biBpbiB0aGUgY29tbWFuZCBsb29wIC0gd2UnbGwgaGFuZGxl IHRob3NlIGxhdGVyIGluc3RlYWQuCisgICAgICAgICAgICAod2hlbiAoZnVuY3Rpb25wIG9yaWdp bmFsLWNvbW1hbmQpCisgICAgICAgICAgICAgIDs7IGlmIGl0J3MgYSBsYW1iZGEsIHdlIGNhbid0 IGtub3cgaWYgaXQncyBzdXBwb3J0ZWQgb3Igbm90CisgICAgICAgICAgICAgIDs7IC0gc28gZ28g YWhlYWQgYW5kIGFzc3VtZSBpdCdzIG9rLCBiZWNhdXNlIHdlJ3JlIGp1c3Qgb3B0aW1pc3RpYyBs aWtlIHRoYXQKKyAgICAgICAgICAgICAgKGlmIChvciAobm90IChzeW1ib2xwIG9yaWdpbmFsLWNv bW1hbmQpKQorICAgICAgICAgICAgICAgICAgICAgIDs7IGxhbWJkYSByZWdpc3RlcmVkIGJ5IHNt YXJ0cmVwCisgICAgICAgICAgICAgICAgICAgICAgKHN0cmluZy1wcmVmaXgtcCAiKCIgKHN5bWJv bC1uYW1lIG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAgICAgICAgICAgICAgICAgIChtYy9leGVjdXRl LWNvbW1hbmQtZm9yLWFsbC1mYWtlLWN1cnNvcnMgb3JpZ2luYWwtY29tbWFuZCkKKyAgICAgICAg ICAgICAgICA7OyBzbWFydHJlcCBgaW50ZXJuJ3MgY29tbWFuZHMgaW50byBvd24gb2JhcnJheSB0 byBoZWxwCisgICAgICAgICAgICAgICAgOzsgYGRlc2NyaWJlLWJpbmRpbmdzJy4gIFNvLCBsZXQn cyByZS1gaW50ZXJuJyBoZXJlIHRvCisgICAgICAgICAgICAgICAgOzsgbWFrZSB0aGUgY29tbWFu ZCBjb21wYXJhYmxlIGJ5IGBlcScuCisgICAgICAgICAgICAgICAgKHNldHEgb3JpZ2luYWwtY29t bWFuZCAoaW50ZXJuIChzeW1ib2wtbmFtZSBvcmlnaW5hbC1jb21tYW5kKSkpCisgICAgICAgICAg ICAgICAgOzsgb3RoZXJ3aXNlIGl0J3MgYSBzeW1ib2wsIGFuZCB3ZSBjYW4gYmUgbW9yZSB0aG9y b3VnaAorICAgICAgICAgICAgICAgIChpZiAoZ2V0IG9yaWdpbmFsLWNvbW1hbmQgJ21jLS11bnN1 cHBvcnRlZCkKKyAgICAgICAgICAgICAgICAgICAgKG1lc3NhZ2UgIiVTIGlzIG5vdCBzdXBwb3J0 ZWQgd2l0aCBtdWx0aXBsZSBjdXJzb3JzJXMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg IG9yaWdpbmFsLWNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdldCBvcmln aW5hbC1jb21tYW5kICdtYy0tdW5zdXBwb3J0ZWQpKQorICAgICAgICAgICAgICAgICAgKHdoZW4g KGFuZCBvcmlnaW5hbC1jb21tYW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChub3Qg KG1lbXEgb3JpZ2luYWwtY29tbWFuZCBtYy0tZGVmYXVsdC1jbWRzLXRvLXJ1bi1vbmNlKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKG5vdCAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1j L2NtZHMtdG8tcnVuLW9uY2UpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAob3IgbWMv YWx3YXlzLXJ1bi1mb3ItYWxsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVt cSBvcmlnaW5hbC1jb21tYW5kIG1jLS1kZWZhdWx0LWNtZHMtdG8tcnVuLWZvci1hbGwpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jL2Nt ZHMtdG8tcnVuLWZvci1hbGwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWMv cHJvbXB0LWZvci1pbmNsdXNpb24taW4td2hpdGVsaXN0IG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAg ICAgICAgICAgICAgICAgICAgKG1jL2V4ZWN1dGUtY29tbWFuZC1mb3ItYWxsLWZha2UtY3Vyc29y cyBvcmlnaW5hbC1jb21tYW5kKSkpKQorICAgICAgICAgICAgICAod2hlbiBtYy91c2UtYnVpbHQt aW4tY3Vyc29ycworICAgICAgICAgICAgICAgIChzZXRxIG1jLWNvbmYKKyAgICAgICAgICAgICAg ICAgICAgICAgIChtYXBjYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKGxhbWJkYSAoeCkg KGxpc3QgKG92ZXJsYXktc3RhcnQgeCkgImJhciIgbmlsKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgKG1jL2FsbC1mYWtlLWN1cnNvcnMpKSkpKSkpKSkpCisKKyAgKGRlZnVuIG1jL21hcmst bmV4dC1saWtlLXRoaXMtY3ljbGUtZm9yd2FyZCAoKQorICAiTWFya3MgbmV4dCBvY2N1cmVuY2Ug b2Ygd29yZCBsaWtlIHRoaXMgYW5kIGFkdmFuY2VzIGN1cnNvciB0byB0aGlzIG9jY3VycmVuY2Ui CisgIChpbnRlcmFjdGl2ZSkKKyAgICAobWMvbWFy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JoYmFyIiAz KSBbMS4wIDAuMCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg2ICgiYmFyIiAzKSBbMC4w IDEuMCAxLjBdKQorICAgICAgICAgICAgICAgICAgICAgICg3ICJmcmFtZWQiICJPcmFuZ2VSZWQi KQorICAgICAgICAgICAgICAgICAgICAgICg4ICJib3giICJncmV5MjUiKQorICAgICAgICAgICAg ICAgICAgICAgICg5ICJib3giICJncmV5NzUiKSkpKQorICAgIChzZWxlY3Qtd2luZG93IChkaXNw bGF5LWJ1ZmZlciBidWZmZXIpKSkpCisKKyhkZWZ1biArLXRpbWVyLWZuICgpCisiU2luY2UgdGhp cyBmaXJlcyBnbG9iYWxseSwgd2UgbXVzdCBjb250cm9sIHdoaWNoIGJ1ZmZlcnMgY3Jvc3NoYWly cyBhcHBlYXIgaW4uIgorICAod2hlbiArLW1vZGUKKyAgICAodW5sZXNzIChvciAobWVtcSBsYXN0 LWNvbW1hbmQgKy1wYXJlbnMtZXhjbHVzaW9ucykKKyAgICAgICAgICAgICAgICAobnVsbCArLXBh cmVucy1wKSkKKyAgICAgICgrLXBhcmVucy1mbikpCisgICAgKHdoZW4gKy10aW1lci12YXIKKyAg ICAgIChzZXRxIHRpbWVyLWlkbGUtbGlzdCAoZGVscSArLXRpbWVyLXZhciB0aW1lci1pZGxlLWxp c3QpKQorICAgICAgKHNldHEgKy10aW1lci12YXIgbmlsKSkpKQorCisoZGVmdW4gKy1kcmF3LWZv cnRod2l0aCAoKQorIkltbWVkaWF0ZWx5IGRlbGV0ZS9kcmF3IG1hdGNoaW5nIHBhcmVudGhlc2Vz LiIKKyAgKCstZHJhdy1jcm9zc2hhaXJzICdmb3JjZSkpCisKKyhkZWZ1biArLWRyYXctY3Jvc3No YWlycyAoJm9wdGlvbmFsIGZvcmNlKQorIkltbWVkaWF0ZWx5IGRlbGV0ZSBtYXRjaGluZyBwYXJl bnRoZXNlcy4gIElmIEZPUkNFIGlzIG5vbi1uaWwsIHRoZW4gaW1tZWRpYXRlbHkKK2RyYXcgbWF0 Y2hpbmcgcGFyZW50aGVzaXM7IG90aGVyd2lzZSwgZHJhdyB0aGVtIG9uIGFuIGlkbGUtdGllci4i CisgICh3aGVuICstbW9kZQorICAgICh3aGVuICstdGltZXItdmFyCisgICAgICAoc2V0cSB0aW1l ci1pZGxlLWxpc3QgKGRlbHEgKy10aW1lci12YXIgdGltZXItaWRsZS1saXN0KSkKKyAgICAgIChz ZXRxICstdGltZXItdmFyIG5pbCkpCisgICAgKHVubGVzcyAob3IgKG1lbXEgdGhpcy1jb21tYW5k ICstcGFyZW5zLWV4Y2x1c2lvbnMpCisgICAgICAgICAgICAgICAgKGFuZCAobnVsbCArLXBhcmVu cy1wKQorICAgICAgICAgICAgICAgICAgICAgKG51bGwgKy1wYXJlbnMtb3ZlcmxheXMtZXhpc3Qt cCkpKQorICAgICAgKCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykpCisgICAgKGlmIGZvcmNlCisg ICAgICAocHJvZ24KKyAgICAgICAgKHdoZW4gKy1wYXJlbnMtcAorICAgICAgICAgICgrLXBhcmVu cy1mbikpKQorICAgICAgKHNldHEgKy10aW1lci12YXIgKHJ1bi13aXRoLWlkbGUtdGltZXIgKy1p ZGxlLXRpbWVyLXNlY29uZHMgbmlsICMnKy10aW1lci1mbikpKSkpCisKKyhkZWZ2YXIgZmMtbW9k ZSkKKworOzs7IyMjYXV0b2xvYWQKKyhkZWZpbmUtbWlub3ItbW9kZSArLW1vZGUKKyJNaW5vciBt b2RlIGZvciBkaXNwbGF5aW5nIGEgaG9yaXpvbnRhbCBydWxlci4iCisgIDppbml0LXZhbHVlIG5p bAorICA6bGlnaHRlciAiICsiCisgIDprZXltYXAgbmlsCisgIDpnbG9iYWwgbmlsCisgIDpncm91 cCAnKy1tb2RlCisgIChjb25kCisgICAgKCstbW9kZQorICAgICAgOzs7IGArLW1vZGUnIGhhcyB0 aGUgYWJpbGl0eSB0byBhbHNvIGRpc3BsYXkgYSBmaWxsIGNvbHVtbiBpbmRpY2F0b3IuCisgICAg ICA7OzsgU2VlIHRoZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicuCisgICAgICAod2hlbiBmYy1t b2RlCisgICAgICAgIChmYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgZ2xvYmFsLWVsZG9j LW1vZGUKKyAgICAgICAgICAgICAgICAgKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAgJ2FueSkKKyAg ICAgICAgICAgICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAgICAgICAg KGdsb2JhbC1lbGRvYy1tb2RlIC0xKSkKKyAgICAgICh3aGVuIChhbmQgaml0LWxvY2stY29udGV4 dC10aW1lcgorICAgICAgICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQor ICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAg ICAod2hlbiAodGltZXJwIGppdC1sb2NrLWNvbnRleHQtdGltZXIpCisgICAgICAgICAgKGNhbmNl bC10aW1lciBqaXQtbG9jay1jb250ZXh0LXRpbWVyKSkKKyAgICAgICAgOzsgKHNldHEgaml0LWxv Y2stY29udGV4dC10aW1lciAocnVuLXdpdGgtaWRsZS10aW1lciA1LjAgJ3JlcGVhdCAnaml0LWxv Y2stY29udGV4dC1mb250aWZ5KSkKKyAgICAgICAgKHNldHEgaml0LWxvY2stY29udGV4dC10aW1l ciBuaWwpKQorICAgICAgKHdoZW4gKGFuZCAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQor ICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAg ICAod2hlbiAodGltZXJwIHVuZG8tYXV0by1jdXJyZW50LWJvdW5kYXJ5LXRpbWVyKQorICAgICAg ICAgIChjYW5jZWwtdGltZXIgdW5kby1hdXRvLWN1cnJlbnQtYm91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gIzE3Njg0CisgICAgICA7OzsgYW5kICMyMjg3MyBvbiBMMlIgbGFuZ3VhZ2Vz LiAgVGhlIGZlYXR1cmUgdGVzdCBmaWxlIHVzZWQgYnkgQGxhd2xpc3QKKyAgICAgIDs7OyBib2dz IEVtYWNzIGRvd24gdW5sZXNzIGBiaWRpLWRpc3BsYXktcmVvcmRlcmluZycgaXMgc2V0IHRvIGEg bmlsIHZhbHVlLgorICAgICAgOzs7IEhvd2V2ZXIsIG1vc3QgdXNlcnMgd2lsbCBwcm9iYWJseSBu b3Qgd2FudCB0aGlzIHBhcnRpY3VsYXIgc2V0dGluZy4KKyAgICAgICh1bmxlc3MgKG51bGwgYmlk aS1kaXNwbGF5LXJlb3JkZXJpbmcpCisgICAgICAgIChzZXRxIGJpZGktZGlzcGxheS1yZW9yZGVy aW5nIG5pbCkpCisgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICcrLS1zYXZlZC1zdGF0 ZSkgbmlsKQorICAgICAgKGRvbGlzdCAodmFyICcoYnVmZmVyLWRpc3BsYXktdGFibGUKKyAgICAg ICAgICAgICAgICAgICAgIGZyaW5nZS1pbmRpY2F0b3ItYWxpc3QKKyAgICAgICAgICAgICAgICAg ICAgIHRhYi13aWR0aAorICAgICAgICAgICAgICAgICAgICAgbGluZS1tb3ZlLXZpc3VhbAorICAg ICAgICAgICAgICAgICAgICAgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgICAgICAgICAgICAgIHRy dW5jYXRlLXBhcnRpYWwtd2lkdGgtd2luZG93cworICAgICAgICAgICAgICAgICAgICAgd29yZC13 cmFwKSkKKyAgICAgICAgKHdoZW4gKGxvY2FsLXZhcmlhYmxlLXAgdmFyKQorICAgICAgICAgIChw dXNoIChjb25zIHZhciAoc3ltYm9sLXZhbHVlIHZhcikpICstLXNhdmVkLXN0YXRlKSkpCisgICAg ICAoc2V0cSBmaWxsLWNvbHVtbiA4MCkKKyAgICAgIChzZXRxIGRpc3BsYXktbGluZS1udW1iZXJz IHQpCisgICAgICAoc2V0cS1sb2NhbCBhdXRvLWhzY3JvbGwtbW9kZSAnY3VycmVudC1saW5lKQor ICAgICAgKHNldHEtbG9jYWwgaHNjcm9sbC1zdGVwIDUpCisgICAgICAoc2V0cSBidWZmZXItZGlz cGxheS10YWJsZSArLWJ1ZmZlci1kaXNwbGF5LXRhYmxlKQorICAgICAgKHNldHEgdGFiLXdpZHRo IDQpCisgICAgICAoc2V0IChtYWtlLWxvY2FsLXZhcmlhYmxlICdsaW5lLW1vdmUtdmlzdWFsKSB0 KQorICAgICAgKHNldHEgdHJ1bmNhdGUtbGluZXMKKyAgICAgICAgKGNvbmQKKyAgICAgICAgICAo KGxldCAoKGxzdCArLXRydW5jYXRlLWxpbmVzLWRlcml2ZWQtbW9kZXMpCisgICAgICAgICAgICAg ICAgICBtb2RlKQorICAgICAgICAgICAgKGNhdGNoICdmb3VuZAorICAgICAgICAgICAgICAod2hp bGUgKHNldHEgbW9kZSAocG9wIGxzdCkpCisgICAgICAgICAgICAgICAgKHdoZW4gKGRlcml2ZWQt bW9kZS1wIG1vZGUpCisgICAgICAgICAgICAgICAgICAodGhyb3cgJ2ZvdW5kIHQpKSkpKSkKKyAg ICAgICAgICAgKChtZW1xIG1ham9yLW1vZGUgKy10cnVuY2F0ZS1saW5lcy1tYWpvci1tb2Rlcykp CisgICAgICAgICAgICh0CisgICAgICAgICAgICAgbmlsKSkpCisgICAgICAoc2V0IChtYWtlLWxv Y2FsLXZhcmlhYmxlICd0cnVuY2F0ZS1wYXJ0aWFsLXdpZHRoLXdpbmRvd3MpIG5pbCkKKyAgICAg IChzZXRxIHdvcmQtd3JhcCB0KQorICAgICAgKHNldHEgaW5kaWNhdGUtZW1wdHktbGluZXMgdCkK KyAgICAgIChzZXRxIGluZGljYXRlLWJ1ZmZlci1ib3VuZGFyaWVzICdsZWZ0KQorICAgICAgKHNl dHEgZnJpbmdlLWluZGljYXRvci1hbGlzdAorICAgICAgICAgIDs7OyBoc2NsX2FsbF90ZW1wX3Ag fCBoc2NsX3RlbXBfcAorICAgICAgICAnKCgrLWhzY2wtdGVtcCAuICgrLXNpbmdsZS1hbmdsZS1s ZWZ0CisgICAgICAgICAgICAgICAgICAgICAgICAgICstZG91YmxlLWFuZ2xlLWxlZnQpKQorICAg ICAgICAgIDs7OyBoc2NsX2FsbF9wZXJtXzBfcCB8IGhzY2xfYWxsX3Blcm1fMV9wIHwgaHNjbF9h bGxfcGVybV8yX3AgfCBoc2NsX3Blcm1fcAorICAgICAgICAgICgrLWhzY2wtcGVybSAuICgrLXNp bmdsZS1hbmdsZS11cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLWRvdWJsZS1hbmdsZS11 cAorICAgICAgICAgICAgICAgICAgICAgICAgICArLXRyaXBsZS1hbmdsZS11cAorICAgICAgICAg ICAgICAgICAgICAgICAgICArLXF1YWRydXBsZS1hbmdsZS11cCkpCisgICAgICAgICAgKCstb3Zl cmxheS1hcnJvdyAuICgrLWZyaW5nZS1sZWZ0LWFycm93CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICArLWZyaW5nZS1yaWdodC1hcnJvdykpCisgICAgICAgICAgKHRydW5jYXRpb24gLiAo Ky1mcmluZ2UtbGVmdC1hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICstZnJpbmdlLXJp Z2h0LWFycm93KSkKKyAgICAgICAgICAoY29udGludWF0aW9uIC4gKCstZnJpbmdlLWxlZnQtY3Vy bHktYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICstYmFja3NsYXNoKSkKKyAgICAg ICAgICAob3ZlcmxheS1hcnJvdyAuICstZnJpbmdlLXJpZ2h0LXRyaWFuZ2xlKQorICAgICAgICAg ICh1cCAuICstZnJpbmdlLXVwLWFycm93KQorICAgICAgICAgIChkb3duIC4gKy1mcmluZ2UtZG93 bi1hcnJvdykKKyAgICAgICAgICAodG9wIC4gKy1mcmluZ2UtdG9wLWxlZnQtYW5nbGUpCisgICAg ICAgICAgKGJvdHRvbSAuICstZnJpbmdlLWJvdHRvbS1yaWdodC1hbmdsZSkKKyAgICAgICAgICAo dG9wLWJvdHRvbSAuICgrLWZyaW5nZS1sZWZ0LWJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAg ICAgICArLWZyaW5nZS1yaWdodC1icmFja2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgKy1m cmluZ2UtdG9wLXJpZ2h0LWFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgKy1mcmluZ2Ut dG9wLWxlZnQtYW5nbGUpKQorICAgICAgICAgIChlbXB0eS1saW5lIC4gKy1mcmluZ2UtZW1wdHkt bGluZSkKKyAgICAgICAgICAodW5rbm93biAuICstZnJpbmdlLXF1ZXN0aW9uLW1hcmspKSkKKyAg ICAgIChzZXRxIGZyaW5nZS1jdXJzb3ItYWxpc3QgJygoYm94IC4gKy1mcmluZ2UtbGVmdC10cmlh bmdsZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaG9sbG93IC4gKy1ob2xs b3ctcmVjdGFuZ2xlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChiYXIgLiAr LXZlcnRpY2FsLWJhcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaGJhciAu ICstZnJpbmdlLWhvcml6b250YWwtYmFyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIChob2xsb3ctc21hbGwgLiArLWZyaW5nZS1ob2xsb3ctc3F1YXJlKSkpCisgICAgICAoaWYg KG9yICstZm9ydGh3aXRoCisgICAgICAgICAgICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcg Jyg0KSkpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJhdy1mb3J0 aHdpdGggJ2FwcGVuZCAnbG9jYWwpCisgICAgICAgIChhZGQtaG9vayAncG9zdC1jb21tYW5kLWhv b2sgJystZHJhdy1jcm9zc2hhaXJzICdhcHBlbmQgJ2xvY2FsKSkKKyAgICAgICh3aGVuICstZm9y dGh3aXRoCisgICAgICAgIChhZGQtaG9vayAnd2luZG93LWNvbmZpZ3VyYXRpb24tY2hhbmdlLWhv b2sgJystZHJhdy1mb3J0aHdpdGggbmlsICdsb2NhbCkpCisgICAgICAoYWRkLWhvb2sgJ2NoYW5n ZS1tYWpvci1tb2RlLWhvb2sgJ3R1cm4tb2ZmLSstbW9kZSBuaWwgJ2xvY2FsKQorICAgICAgOzs7 IE1hdGNoaW5nIHBhcmVudGhlc2VzIGRyYXdpbmcgZm9ydGh3aXRoIGludGVyZmVyZXMgd2l0aCB5 YXNuaXBwZXQuCisgICAgICAod2hlbiArLWZvcnRod2l0aAorICAgICAgICAoc2V0cSArLXBhcmVu cy1wIG5pbCkpCisgICAgICAod2hlbiAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAg ICAgICAoY29uZAorICAgICAgICAgICgrLWZvcnRod2l0aAorICAgICAgICAgICAgKG1lc3NhZ2Ug IlR1cm5lZCBPTiBgKy1tb2RlJyAtLSBEcmF3IG1hdGNoaW5nIHBhcmVudGhlc2VzIGltbWVkaWF0 ZWx5LiIpKQorICAgICAgICAgICgoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpCisgICAg ICAgICAgICA7OzsgTWF0Y2hpbmcgcGFyZW50aGVzZXMgd2lsbCBiZSBkcmF3biBpbW1lZGlhdGVs eS4KKyAgICAgICAgICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScgLS0gT3B0aW1pemVk IGZvciBkZWJ1Z2dpbmcgcHVycG9zZXMuIikpCisgICAgICAgICAgKHQKKyAgICAgICAgICAgICht ZXNzYWdlICJUdXJuZWQgT04gYCstbW9kZScuIikpKSkpCisgICAgKHQKKyAgICAgIChraWxsLWxv Y2FsLXZhcmlhYmxlICdmaWxsLWNvbHVtbikKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdh dXRvLWhzY3Jv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ZG9saXN0IChzYXZlZCArLS1zYXZl ZC1zdGF0ZSkKKyAgICAgICAgKHNldCAobWFrZS1sb2NhbC12YXJpYWJsZSAoY2FyIHNhdmVkKSkg KGNkciBzYXZlZCkpKQorICAgICAgKGtpbGwtbG9jYWwtdmFyaWFibGUgJystLXNhdmVkLXN0YXRl KQorICAgICAgKCstZGVsZXRlLXBhcmVucy1vdmVybGF5cykKKyAgICAgICh3aGVuIChtZW1xICcr LWRyYXctZm9ydGh3aXRoIHBvc3QtY29tbWFuZC1ob29rKQorICAgICAgICAocmVtb3ZlLWhvb2sg J3Bvc3QtY29tbWFuZC1ob29rICcrLWRyYXctZm9ydGh3aXRoICdsb2NhbCkpCisgICAgICAod2hl biAobWVtcSAnKy1kcmF3LWNyb3NzaGFpcnMgcG9zdC1jb21tYW5kLWhvb2spCisgICAgICAgIChy ZW1vdmUtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJystZHJhdy1jcm9zc2hhaXJzICdsb2NhbCkp CisgICAgICAod2hlbiAobWVtcSAnKy1kcmF3LWZvcnRod2l0aCB3aW5kb3ctY29uZmlndXJhdGlv bi1jaGFuZ2UtaG9vaykKKyAgICAgICAgKHJlbW92ZS1ob29rICd3aW5kb3ctY29uZmlndXJhdGlv bi1jaGFuZ2UtaG9vayAnKy1kcmF3LWZvcnRod2l0aCAnbG9jYWwpKQorICAgICAgKHJlbW92ZS1o b29rICdjaGFuZ2UtbWFqb3ItbW9kZS1ob29rICd0dXJuLW9mZi0rLW1vZGUgJ2xvY2FsKQorICAg ICAgKHdoZW4gKy10aW1lci12YXIKKyAgICAgICAgKHNldHEgdGltZXItaWRsZS1saXN0IChkZWxx ICstdGltZXItdmFyIHRpbWVyLWlkbGUtbGlzdCkpCisgICAgICAgIChzZXRxICstdGltZXItdmFy IG5pbCkpCisgICAgICAod2hlbiAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAg ICAobWVzc2FnZSAiVHVybmVkIE9GRiBgKy1tb2RlJy4iKSkpKSkKKworKGRlZnVuIHR1cm4tb2Zm LSstbW9kZSAoKQorICAoKy1tb2RlIC0xKSkKKworOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7CisK KyhkZWZ1biArLXBhcmVucy1mbiAoKQorICAiRG9jLXN0cmluZy4iCisgIChsZXQqICgob3BvaW50 IChwb2ludCkpCisgICAgICAgICAoZnJvbSAoaWYgKy1wYXJlbnMtZnJvbS1mbgorICAgICAgICAg ICAgICAgICAoZnVuY2FsbCArLXBhcmVucy1mcm9tLWZuKQorICAgICAgICAgICAgICAgICAocG9p bnQtbWluKSkpCisgICAgICAgICAod2luIChzZWxlY3RlZC13aW5kb3cpKQorICAgICAgICAgKGkg MCkKKyAgICAgICAgIChwcmVjZWRpbmctY2hhciAocHJlY2VkaW5nLWNoYXIpKQorICAgICAgICAg KG9jaGFyIChjaGFyLWFmdGVyIG9wb2ludCkpCisgICAgICAgICAocG9zMQorICAgICAgICAgICAo Y29uZAorICAgICAgICAgICAgICgoYW5kIG9jaGFyCisgICAgICAgICAgICAgICAgICAgKG9yIDs7 OyAoY2hhci10by1zdHJpbmcgNDApID0+IG9wZW5pbmcgcGFyZW50aGVzaXMKKyAgICAgICAgICAg ICAgICAgICAgICAgKD0gb2NoYXIgNDApCisgICAgICAgICAgICAgICAgICAgICAgIDs7OyAoY2hh ci10by1zdHJpbmcgOTEpID0+IG9wZW5pbmcgc3F1YXJlIGJyYWNrZXQKKyAgICAgICAgICAgICAg ICAgICAgICAgKD0gb2NoYXIgOTEpCisgICAgICAgICAgICAgICAgICAgICAgIDs7OyAoY2hhci10 by1zdHJpbmcgMTIzKSA9PiBvcGVuaW5nIHdhdnkgYnJhY2tldAorICAgICAgICAgICAgICAgICAg ICAgICAoPSBvY2hhciAxMjMpKSkKKyAgICAgICAgICAgICAgICAobWluICgxKyBvcG9pbnQpIChw b2ludC1tYXgpKSkKKyAgICAgICAgICAgICAoKG9yIDs7OyAoY2hhci10by1zdHJpbmcgNDEpID0+ IGNsb3NpbmcgcGFyZW50aGVzaXMKKyAgICAgICAgICAgICAgICAgICg9IHByZWNlZGluZy1jaGFy IDQxKQorICAgICAgICAgICAgICAgICAgOzs7IChjaGFyLXRvLXN0cmluZyA5MykgPT4gY2xvc2lu ZyBzcXVhcmUgYnJhY2tldAorICAgICAgICAgICAgICAgICAgKD0gcHJlY2VkaW5nLWNoYXIgOTMp CisgICAgICAgICAgICAgICAgICA7OzsgKGNoYXItdG8tc3RyaW5nIDEyNSkgPT4gY2xvc2luZyB3 YXZ5IGJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICg9IHByZWNlZGluZy1jaGFyIDEyNSkpCisg ICAgICAgICAgICAgICAgKG1heCAocG9pbnQtbWluKSAoMS0gb3BvaW50KSkpCisgICAgICAgICAg ICAgKHQKKyAgICAgICAgICAgICAgICBvcG9pbnQpKSkKKyAgICAgICAgIHBvczIKKyAgICAgICAg IHNlbGVjdGVkLWZhY2UpCisgICAgKHNhdmUtZXhjdXJzaW9uCisgICAgICAoY29uZGl0aW9uLWNh c2UgbmlsCisgICAgICAgICh3aGlsZSAoc2V0cSBwb3MxIChudGggMSAocGFyc2UtcGFydGlhbC1z ZXhwIGZyb20gcG9zMSkpKQorICAgICAgICAgIChzZXRxIHBvczIgKHNjYW4tc2V4cHMgcG9zMSAx KSkKKyAgICAgICAgICAoaWYgKD0gaSAxMCkKKyAgICAgICAgICAgIChzZXRxIGkgMSkKKyAgICAg ICAgICAgIChzZXRxIGkgKDErIGkpKSkKKyAgICAgICAgICAoc2V0cSBzZWxlY3RlZC1mYWNlIChj b25kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDEpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLW9uZS1mYWNlKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAoKD0gaSAyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICcrLXBhcmVucy10d28tZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgKCg9IGkgMykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMt dGhyZWUtZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgNCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtZm91ci1mYWNlKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA1KQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICcrLXBhcmVucy1maXZlLWZhY2UpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICgoPSBpIDYpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JystcGFyZW5zLXNpeC1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0g aSA3KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1zZXZlbi1m YWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA4KQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1laWdodC1mYWNlKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSA5KQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICcrLXBhcmVucy1uaW5lLWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICgoPSBpIDEwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBh cmVucy10ZW4tZmFjZSkpKQorICAgICAgICAgIChsZXQgKChvdiAobWFrZS1vdmVybGF5IHBvczEg KDErIHBvczEpKSkpCisgICAg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ICAgICAg KGNvbmQKKyAgICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAobm90IG5hcnJvd2Vk LXApCisgICAgICAgICAgICAgICAgIGVuZCkKKyAgICAgICAgICAgICAgIGVuZCkKKyAgICAgICAg ICAgICAoKGFuZAorICAgICAgICAgICAgICAgICAobm90IG5hcnJvd2VkLXApCisgICAgICAgICAg ICAgICAgIChudWxsIGVuZCkpCisgICAgICAgICAgICAgICBwb2ludC1tYXgpCisgICAgICAgICAg ICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFycm93ZWQtcAorICAgICAgICAgICAgICAgICBl bmQKKyAgICAgICAgICAgICAgICAgKDwgZW5kIHBvaW50LW1heCkpCisgICAgICAgICAgICAgICBl bmQpCisgICAgICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFycm93ZWQtcAorICAg ICAgICAgICAgICAgICBlbmQKKyAgICAgICAgICAgICAgICAgKD0gZW5kIHBvaW50LW1heCkpCisg ICAgICAgICAgICAgICAoMSsgZW5kKSkKKyAgICAgICAgICAgICAoKGFuZAorICAgICAgICAgICAg ICAgICBuYXJyb3dlZC1wCisgICAgICAgICAgICAgICAgIChudWxsIGVuZCkpCisgICAgICAgICAg ICAgICAoMSsgcG9pbnQtbWF4KSkgKSkKKyAgICAgICAgIChvdmVybGF5cworICAgICAgICAgICAo cHJvZ24KKyAgICAgICAgICAgICAob3ZlcmxheS1yZWNlbnRlciBlbmQpCisgICAgICAgICAgICAg KG92ZXJsYXlzLWluIGJlZyBlbmQpKSkpCisgICAgKHdoZW4gKGFuZCBiZWcgZW5kIG5hbWUgdmFs KQorICAgICAgKGRvbGlzdCAobyBvdmVybGF5cykKKyAgICAgICAgKGNvbmQKKyAgICAgICAgICAo KGFuZCAoZXEgbmFtZSAnZmFjZSkKKyAgICAgICAgICAgICAgICAoZXEgKG92ZXJsYXktZ2V0IG8g bmFtZSkgdmFsKSkKKyAgICAgICAgICAgIDs7IEVpdGhlciBwdXNoIHRoaXMgb3ZlcmxheSBvdXRz aWRlIGJlZy4uLmVuZAorICAgICAgICAgICAgOzsgb3Igc3BsaXQgaXQgdG8gZXhjbHVkZSBiZWcu Li5lbmQKKyAgICAgICAgICAgIDs7IG9yIGRlbGV0ZSBpdCBlbnRpcmVseSAoaWYgaXQgaXMgY29u dGFpbmVkIGluIGJlZy4uLmVuZCkuCisgICAgICAgICAgICAoaWYgKDwgKG92ZXJsYXktc3RhcnQg bykgYmVnKQorICAgICAgICAgICAgICAgIChpZiAoPiAob3ZlcmxheS1lbmQgbykgZW5kKQorICAg ICAgICAgICAgICAocHJvZ24KKyAgICAgICAgICAgICAgICAobW92ZS1vdmVybGF5IChjb3B5LW92 ZXJsYXkgbykKKyAgICAgICAgICAgICAgICAgIChvdmVybGF5LXN0YXJ0IG8pIGJlZykKKyAgICAg ICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVuZCBvKSkpCisgICAgICAg ICAgICAgICAgICAobW92ZS1vdmVybGF5IG8gKG92ZXJsYXktc3RhcnQgbykgYmVnKSkKKyAgICAg ICAgICAgICAgKGlmICg+IChvdmVybGF5LWVuZCBvKSBlbmQpCisgICAgICAgICAgICAgICAgICAo bW92ZS1vdmVybGF5IG8gZW5kIChvdmVybGF5LWVuZCBvKSkKKyAgICAgICAgICAgICAgICAoZGVs ZXRlLW92ZXJsYXkgbykpKSkKKyAgICAgICAgICAoKGFuZCAobm90IChlcSBuYW1lICdmYWNlKSkK KyAgICAgICAgICAgICAgICAoZXF1YWwtaW5jbHVkaW5nLXByb3BlcnRpZXMgKG92ZXJsYXktZ2V0 IG8gbmFtZSkgdmFsKSkKKyAgICAgICAgICAgIChkZWxldGUtb3ZlcmxheSBvKSkpKSkpKQorCiso ZGVmdW4gKy1kZWxldGUtcGFyZW5zLW92ZXJsYXlzICgpCisgICh3aGVuICstcGFyZW5zLW92ZXJs YXlzLWV4aXN0LXAKKyAgICAoZG9saXN0IChmYWNlICcoKy1wYXJlbn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S1taW5vci1tb2RlIGZjLW1vZGUKKyJNaW5vciBtb2RlIGZvciBk aXNwbGF5aW5nIGEgdmlzdWFsIGZpbGwgY29sdW1uLiIKKyAgOmluaXQtdmFsdWUgbmlsCisgIDps aWdodGVyICIgRkMiCisgIDprZXltYXAgbmlsCisgIDpnbG9iYWwgbmlsCisgIDpncm91cCAnZmMt bW9kZQorICAoY29uZAorICAgIDs7OyBgKy1tb2RlJyBoYXMgdGhlIGFiaWxpdHkgdG8gYWxzbyBk aXNwbGF5IGEgZmlsbCBjb2x1bW4gaW5kaWNhdG9yLgorICAgIDs7OyBTZWUgdGhlIHZhcmlhYmxl IGArLWZpbGwtY29sdW1uJy4KKyAgICAoKGFuZCBmYy1tb2RlICstbW9kZSkKKyAgICAgIChzZXRx IGZjLW1vZGUgbmlsKQorICAgICAgKG1lc3NhZ2UgIlR1cm5lZCBPRkYgYGZjLW1vZGUnICglcykg LS0gc2VlIHRoZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicuIiAoY3VycmVudC1idWZmZXIpKSkK KyAgICAoZmMtbW9kZQorICAgICAgKHdoZW4gKGFuZCBnbG9iYWwtZWxkb2MtbW9kZQorICAgICAg ICAgICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAgICAgICAg ICAoZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAoZ2xvYmFsLWVsZG9j LW1vZGUgLTEpKQorICAgICAgKHdoZW4gKGFuZCBqaXQtbG9jay1jb250ZXh0LXRpbWVyCisgICAg ICAgICAgICAgICAgIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAg ICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVuICh0aW1l cnAgaml0LWxvY2stY29udGV4dC10aW1lcikKKyAgICAgICAgICAoY2FuY2VsLXRpbWVyIGppdC1s b2NrLWNvbnRleHQtdGltZXIpKQorICAgICAgICA7OyAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRp bWVyIChydW4td2l0aC1pZGxlLXRpbWVyIDUuMCAncmVwZWF0ICdqaXQtbG9jay1jb250ZXh0LWZv bnRpZnkpKQorICAgICAgICAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIG5pbCkpCisgICAg ICAod2hlbiAoYW5kIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAg ICAgIChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVuICh0aW1l cnAgdW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpCisgICAgICAgICAgKGNhbmNlbC10 aW1lciB1bmRvLWF1dG8tY3VycmVudC1ib3VuZGFyeS10aW1lcikpCisgICAgICAgIChmc2V0ICd1 bmRvLWF1dG8tLXVuZG9hYmxlLWNoYW5nZQorICAgICAgICAgICAgICAobGFtYmRhICgpIChhZGQt dG8tbGlzdCAndW5kby1hdXRvLS11bmRvYWJseS1jaGFuZ2VkLWJ1ZmZlcnMgKGN1cnJlbnQtYnVm ZmVyKSkpKQorICAgICAgICAoZnNldCAndW5kby1hdXRvLWFtYWxnYW1hdGUgJ2lnbm9yZSkpCisg ICAgICAod2hlbiBibGluay1jdXJzb3ItbW9kZQorICAgICAgICAoYmxpbmstY3Vyc29yLW1vZGUg LTEpCisgICAgICAgICh3aGVuIChtZW1xICdibGluay1jdXJzb3ItY2hlY2sgcG9zdC1jb21tYW5k LWhvb2spCisgICAgICAgICAgKHJlbW92ZS1ob29rICdwb3N0LWNvbW1hbmQtaG9vayAnYmxpbmst Y3Vyc29yLWNoZWNrKSkpCisgICAgICAoc2V0cSBmYy12aXNpYmxlIHQpCisgICAgICA7OzsgYGF1 dG8tY29tcG9zaXRpb24tbW9kZScgaXMgbmVlZGVkIGZvciBjcm9zc2hhaXJzIHRvIHByb3Blcmx5 IGNhb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2UgZm9yIGArLXJldmVyc2VkLWJhci1w cmUtenYtZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1yZXZlcnNlZC1i YXItYXQtenYtZmFjZQorICAnKCh0ICg6Zm9yZWdyb3VuZCAiY2hhcnRyZXVzZSIpKSkKKyAgIkZh Y2UgZm9yIGArLXJldmVyc2VkLWJhci1hdC16di1mYWNlJy4iCisgIDpncm91cCAnKy1tb2RlKQor CisoZGVmZmFjZSArLXJldmVyc2VkLWJhci1wb3N0LXp2LWZhY2UKKyAgJygodCAoOmZvcmVncm91 bmQgImN5YW40IikpKQorICAiRmFjZSBmb3IgYCstcmV2ZXJzZWQtYmFyLXBvc3QtenYtZmFjZScu IgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1ldmVuLXByZS16di1mYWNlCisgICco KCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAg OmZvcmVncm91bmQgInllbGxvdyIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4 KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJjeWFuMSIpCisgICAgKCgo Y2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDE2KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZv cmVncm91bmQgInllbGxvdyIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDE2KSAo YmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJjeWFuMSIpCisgICAgKCgoY2xh c3MgY29sb3IpIChtaW4tY29sb3JzIDgpKQorICAgICA6Zm9yZWdyb3VuZCAid2hpdGUiKQorICAg ICgoKHR5cGUgdHR5KSAoY2xhc3MgbW9ubykpCisgICAgIDppbnZlcnNlLXZpZGVvIHQpCisgICAg KHQgOmZvcmVncm91bmQgInBpbmsiKS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AgIDpmb3Jl Z3JvdW5kICJEZWVwUGluazEiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikg KGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJEZWVwUGluazEiKQorICAgICgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6 Zm9yZWdyb3VuZCAiRGVlcFBpbmsxIikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMg OCkpCisgICAgIDpmb3JlZ3JvdW5kICJ3aGl0ZSIpCisgICAgKCgodHlwZSB0dHkpIChjbGFzcyBt b25vKSkKKyAgICAgOmludmVyc2UtdmlkZW8gdCkKKyAgICAodCA6Zm9yZWdyb3VuZCAicGluayIp KQorICAiRmFjZSBmb3IgYCstZXZlbi1hdC16di1mYWNlJy4iCisgIDpncm91cCAnKy1tb2RlKQor CisoZGVmZmFjZSArLWV2ZW4taW5hY3RpdmUtYXQtenYtZmFjZQorICAnKCgoKGNsYXNzIGNvbG9y KSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJE ZWVwUGluazQiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91 bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3VuZCAiRGVlcFBpbms0IikKKyAgICAoKChjbGFzcyBj b2xvcikgKG1pbi1jb2xvcnMgMTYpIChiYWNrZ3JvdW5kIGRhcmspKQorICAgICA6Zm9yZWdyb3Vu ZCAiRGVlcFBpbms0IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgMTYpIChiYWNr Z3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgIkRlZXBQaW5rNCIpCisgICAgKCgoY2xh c3MgY29sb3IpIChtaW4tY29sb3JzIDgpKQorICA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3VuZCAid2hpdGUiKQorICAgICgoKHR5cGUgdHR5KSAoY2xh c3MgbW9ubykpCisgICAgIDppbnZlcnNlLXZpZGVvIHQpCisgICAgKHQgOmZvcmVncm91bmQgInBp bmsiKSkKKyAgIkZhY2UgZm9yIGArLW9kZC1wb3N0LXp2LWZhY2UnLiIKKyAgOmdyb3VwICcrLW1v ZGUpCisKKyhkZWZmYWNlICstb2RkLWluYWN0aXZlLXBvc3QtenYtZmFjZQorICAnKCgoKGNsYXNz IGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3Jv dW5kICJzaWVubmE0IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgODgpIChiYWNr Z3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTQiKQorICAgICgoKGNsYXNz IGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3Jv dW5kICJzaWVubmE0IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgMTYpIChiYWNr Z3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgInNpZW5uYTQiKQorICAgICgoKGNsYXNz IGNvbG9yKSAobWluLWNvbG9ycyA4KSkKKyAgICAgOmZvcmVncm91bmQgIndoaXRlIikKKyAgICAo KCh0eXBlIHR0eSkgKGNsYXNzIG1vbm8pKQorICAgICA6aW52ZXJzZS12aWRlbyB0KQorICAgICh0 IDpmb3JlZ3JvdW5kICJwaW5rIikpCisgICJGYWNlIGZvciBgKy1vZGQtaW5hY3RpdmUtcG9zdC16 di1mYWNlJy4iCisgIDpncm91cCAnKy1tb2RlKQorCisoZGVmZmFjZSArLXBvc3QtZmlsbC1wcmUt enYtZmFjZQorICAnKCgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQg Z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1ZmZlciAqYiwgTGlz cF9PYmplY3QgdmFsKQoreworICBiLT5jcm9zc2hhaXJzXyA9IHZhbDsKK30KKworc3RhdGljIHZv aWQKK2JzZXRfY2hfaG9yaXpvbnRhbF9ydWxlciAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmpl Y3QgdmFsKQoreworICBiLT5jaF9ob3Jpem9udGFsX3J1bGVyXyA9IHZhbDsKK30KKworc3RhdGlj IHZvaWQKK2JzZXRfY2hfdmVydGljYWxfcnVsZXIgKHN0cnVjdCBidWZmZXIgKmIsIExpc3BfT2Jq ZWN0IHZhbCkKK3sKKyAgYi0+Y2hfdmVydGljYWxfcnVsZXJfID0gdmFsOworfQorCitzdGF0aWMg dm9pZAorYnNldF9jaF9pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09i amVjdCB2YWwpCit7CisgIGItPmNoX2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQorCitzdGF0 aWMgdm9pZAorYnNldF9mY192aXNpYmxlIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2 YWwpCit7CisgIGItPmZjX3Zpc2libGVfID0gdmFsOworfQorCitzdGF0aWMgdm9pZAorYnNldF9m Y19pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7 CisgIGItPmZjX2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQorCisvKiBlbmQgTVVMVElQTEUt Q1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogc3RhdGljIHZvaWQKIGJz ZXRfYWJicmV2X21vZGUgKHN0cnVjdCBidWZmZXIgKmIsIExpc3BfT2JqZWN0IHZhbCkKIHsKQEAg LTUxNDUsNiArNTIwOCwyNCBAQCBpbml0X2J1ZmZlcl9v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aWwpOworICBic2V0X2NoX2hvcml6b250YWxfcnVsZXIgKCZidWZmZXJf ZGVmYXVsdHMsIFF0KTsKKyAgYnNldF9jaF92ZXJ0aWNhbF9ydWxlciAoJmJ1ZmZlcl9kZWZhdWx0 cywgUXQpOworICBic2V0X2NoX2luYWN0aXZlX3dpbmRvd3MgKCZidWZmZXJfZGVmYXVsdHMsIFF0 KTsKKyAgYnNldF9mY192aXNpYmxlICgmYnVmZmVyX2RlZmF1bHRzLCBRbmlsKTsKKyAgYnNldF9m Y19pbmFjdGl2ZV93aW5kb3dzICgmYnVmZmVyX2RlZmF1bHRzLCBRdCk7CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKICAgYnNldF9tb2RlX2xpbmVfZm9ybWF0ICgmYnVmZmVyX2RlZmF1 bHRzLCBidWlsZF9wdXJlX2Nfc3RyaW5nICgiJS0iKSk7CiAgIGJzZXRfaGVhZGVyX2xpbmVfZm9y bWF0ICgmYnVmZmVyX2RlZmF1bHRzLCBRbmlsKTsKICAgYnNldF9hYmJyZXZfbW9kZSAoJmJ1ZmZl cl9kZWZhdWx0cywgUW5pbCk7CkBAIC01NDYxLDYgKzU1NjAsNTEgQEAgZGVmdmFyX3Blcl9idWZm ZXIgKHN0cnVjdCBMaXNwX0J1ZmZlcl9PYmpmd2QgKmJvX2Z3ZCwgY29uc3QgY2hhciAqbmFtZXN0 cmluZywKIHZvaWQKIHN5bXNfb2ZfYnVmZmVyICh2b2lkKQogeworCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIERFRlNZTSAoUW1jX3JlYWxf ZmFrZV9jdXJzb3IsICJtYy1yZWFsLWZha2UtY3Vyc29yIik7CisgIERFRlZBUl9QRVJfQlV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N1cnJlbnRfYnVmZmVyLCBmY192aXNpYmxl KSwgUW5pbCwKKyAgICBkb2M6IC8qIEEgYnVmZXItbG9jYWwgdmFyaWFibGUgdG8gdHVybiBvbi9v ZmYgdGhlIG11bHRpcGxlIGN1cnNvcnMgZmlsbCBjb2x1bW4uICovKTsKKworICBERUZTWU0gKFFm Y192aXNpYmxlX2luYWN0aXZlX3dpbmRvdywgImZjLWluYWN0aXZlLXdpbmRvdyIpOworICBERUZW QVJfUEVSX0JVRkZFUiAoImZjLWluYWN0aXZlLXdpbmRvd3MiLCAmQlZBUiAoY3VycmVudF9idWZm ZXIsIGZjX2luYWN0aXZlX3dpbmRvd3MpLCBRbmlsLAorICAgIGRvYzogLyogV2hlbiBub24tbmls LCBkcmF3IG11bHRpcGxlIGN1cnNvcnMgZmlsbCBjb2x1bW4gaW4gaW5hY3RpdmUgd2luZG93cy4g Ki8pOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIHN0YXRpY3BybyAoJmxhc3Rf b3ZlcmxheV9tb2RpZmljYXRpb25faG9va3MpOwogICBsYXN0X292ZXJsYXlfbW9kaWZpY2F0aW9u X2hvb2tzID0gbWFrZV9uaWxfdmVjdG9yICgxMCk7CiAKZGlmZiAtLWdpdCBhL3NyYy9idWZmZXIu aCBiL3NyYy9idWZmZXIuaAppbmRleCAyMDgwYTZmLi4xYWRhOTNlIDEwMDY0NAotLS0gYS9zcmMv YnVmZmVyLmgKKysrIGIvc3JjL2J1ZmZlci5oCkBAIC03NDAsNiArNzQwLDQwIEBAIHN0cnVjdCBi dWZmZXIKICAgICAgaW4gdGhlIGRpc3BsYXkgb2YgdGhpcyBidWZmZXIuICAqLwogICBMaXNwX09i amVjdCBleHRyYV9saW5lX3NwYWNpbmdfOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqK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IGluYWN0aXZlIHdpbmRvd3MuICovCisgIExpc3BfT2JqZWN0IGZjX2luYWN0aXZlX3dpbmRv d3NfOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIEN1cnNvciB0eXBlIHRv IGRpc3BsYXkgaW4gbm9uLXNlbGVjdGVkIHdpbmRvd3MuCiAgICAgIHQgbWVhbnMgdG8gdXNlIGhv bGxvdyBib3ggY3Vyc29yLgogICAgICBTZWUgYGN1cnNvci10eXBlJyBmb3Igb3RoZXIgdmFsdWVz LiAgKi8KQEAgLTc5MSwxNCArODI1LDIxIEBAIHN0cnVjdCBidWZmZXIKICAgICAgYW4gaW5kaXJl Y3QgYnVmZmVyIHNpbmNlIGl0IGNvdW50cyBhcyBpdHMgYmFzZSBidWZmZXIuICAqLwogICBpbnQg d2luZG93X2NvdW50OwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUt Q1VSU09SUyAqLworCiAgIC8qIEEgbm9uLXplcm8gdmFsdWUgaW4gc2xvdCBJRFggbWVhbnMgdGhh dCBwZXItYnVmZmVyIHZhcmlhYmxlCiAgICAgIHdpdGggaW5kZXggSURYIGhhcyBhIGxvY2FsIHZh bHVlIGluIHRoaXMgYnVmZmVyLiAgVGhlIGluZGV4IElEWAogICAgICBmb3IgYSBidWZmZXItbG9j YWwgdmFyaWFibGUgaXMgc3RvcmVkIGluIHRoYXQgdmFyaWFibGUncyBzbG90CiAgICAgIGluIGJ1 ZmZlcl9sb2NhbF9mbGFncyBhcyBhIExpc3AgaW50ZWdlci4gIElmIHRoZSBpbmRleCBpcyAtMSwK ICAgICAgdGhpcyBtZWFucyB0aGUgdmFyaWFibGUgaXMgYWx3YXlzIGxvY2FsIGluIGFsbCBidWZm ZXJzLiAgKi8KLSNkZWZpbmUgTUFYX1BFUl9CVUZGRVJfVkFSUyA1MAorI2RlZmluZSBNQVhfUEVS X0JVRkZFUl9WQVJTIDYwCiAgIGNoYXIgbG9jYWxfZmxhZ3NbTUFYX1BFUl9CVUZGRVJfVkFSU107 CiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogU2V0IHRvIHRoZSBtb2R0aW1l IG9mIHRoZSB2aXNpdGVkIGZpbGUgd2hlbiByZWFkIG9yIHdyaXR0ZW4uCiAgICAgIG1vZHRpbWUu dHZfbnNlYyA9PSBOT05FWElTVEVOVF9NT0RUSU1FX05TRUNTIG1lYW5zCiAgICAgIHZpc2l0ZWQg ZmlsZSB3YXMgbm9uZXhpc3RlbnQuICBtb2R0aW1lLnR2X25zZWMgPT0KQEAgLTkwNyw2ICs5NDgs NjkgQEAgWEJVRkZFUiAoTGlzcF9PYmplY3QgYSkKIC8qIE1vc3QgY29kZSBzaG91bGQgdXNlIHRo ZXNlIGZ1bmN0aW9ucyB0byBzZXQgTGlzcCBmaWVsZHMgaW4gc3RydWN0CiAgICBidWZmZXIuICAo U29tZSBzZXR0ZXJzIHRoYXQgYXJlIHByaXZhdGUgdG8gYSBzaW5nbGUgLmMgZmlsZSBhcmUKICAg IGRlZmluZWQgYXMgc3RhdGljIGluIHRob3NlIGZpbGVzLikgICovCisKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKK0lOTElORSB2b2lk Citic2V0X2Jsdl9tY19yZWFsX2Zha2VfY3Vyc29yIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09i amVjdCB2YWwpCit7CisgIGItPm1jX3JlYWxfZmFrZV9jdXJzb3JfID0gdmFsOwor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3RpdmVfd2luZG93cyAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFs KQoreworICBiLT5mY19pbmFjdGl2ZV93aW5kb3dzXyA9IHZhbDsKK30KKworLyogZW5kIE1VTFRJ UExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIElOTElORSB2b2lk CiBic2V0X2JpZGlfcGFyYWdyYXBoX2RpcmVjdGlvbiAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9P YmplY3QgdmFsKQogewpkaWZmIC0tZ2l0IGEvc3JjL2Rpc3BleHRlcm4uaCBiL3NyYy9kaXNwZXh0 ZXJuLmgKaW5kZXggNGU5NDdkYS4uOGRiNWIwYiAxMDA2NDQKLS0tIGEvc3JjL2Rpc3BleHRlcm4u aAorKysgYi9zcmMvZGlzcGV4dGVybi5oCkBAIC0xNDUsNiArMTQ1LDEzMSBAQCB0eXBlZGVmIHZv aWQgKkVtYWNzX0N1cnNvcjsKICNkZWZpbmUgTmF0aXZlUmVjdGFuZ2xlIGludAogI2VuZGlmCiAK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICov CisKK2V4dGVybiBib29sIG1jX3N0ZGVycl9wIEVYVEVSTkFMTFlfVklTSUJMRTsKKworc3RydWN0 IGdseXBoOworCitzdHJ1Y3QgZ2x5cGhfcm93OworCitzdHJ1Y3QgZ2x5cGhfbWF0cml4OworCitl bnVtIGRyYXdfZ2x5cGhzX2ZhY2U7CisKK2VudW0gZ2x5cGhfcm93X2FyZWE7CisKK3N0cnVjdCBt Y19tYXRyaXg7CisKK2VudW0gbWNfY2FjaGVfdHlwZTsKKworZW51bSBtY19jdXJzb3JfdHlwZTsK KworZW51bSBtY19mbGF2b3I7CisKK3N0cnVjdCBtY19SR0I7CisKK3N0cnVjdCBtY19lc3NlbnRp YWxzOworCitlbnVtIG1jX2RyYXdfcm93X3R5cGU7CisKK2VudW0gbWNfZW5naW5lX3R5cGU7CisK K2VudW0gbWNfcm93X3Bvc2l0aW9uOworCitlbnVtIG1jX3JlZHJhd19yb3dfdHlwZTsKKworZW51 bSBkcmF3X2dseXBoX2FjdGlvbjsKKworZXh0ZXJuIExpc3BfT2JqZWN0IG1jX2xpc3RuIChwdHJk aWZmX3QsIExpc3BfT2JqZWN0LCAuLi4pOworCitleHRlcm4gTGlzcF9PYmplY3QgbWNfbnRoIChp bnQsIExpc3BfT2JqZWN0KTsKKworZXh0ZXJuIExpc3BfT2JqZWN0IG1jX2Fzc3EgKExpc3BfT2Jq ZWN0LCBMaXNwX09iamVjdCk7CisKK2V4dGVybiBlbnVtIG1jX3Jvd19wb3NpdGlvbiBtY19yb3df cG9zaXRpb24gKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqLCBp bnQpOworCitleHRlcm4gcHRyZGlmZl90IG1jX3JlZ2lvbl9saW1pdCAoYm9vbCk7CisKK2V4dGVy biBzdHJ1Y3QgZ2x5cGggKiBtY19nZXRfY3Vyc29yX2dseXBoIChzdHJ1Y3Qgd2luZG93ICosIHN0 cnVjdCBnbHlwaF9tYXRyaXggKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICosIGludCwgaW50KTsKKworZXh0ZXJuIHZvaWQgbWNf eHdfY29sb3JfdmFsdWVzIChzdHJ1Y3Qgd2luZG93ICosIExpc3BfT2JqZWN0LCBzdHJ1Y3QgbWNf UkdCICopOworCitleHRlcm4gYm9vbCBtY191cGRhdGVfd2luZG93X2Zy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ICosCisgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAq LCBpbnQsIGludCwgaW50LCBpbnQsIGludCwgaW50LAorICAgICAgICAgICAgICAgICAgICAgICBl bnVtIG1jX2N1cnNvcl90eXBlLCBpbnQsIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwKKyAgICAgICAg ICAgICAgICAgICAgICAgc3RydWN0IG1jX2Vzc2VudGlhbHMsIGVudW0gbWNfcm93X3Bvc2l0aW9u LCBzdHJ1Y3QgbWNfUkdCLAorICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2VuZ2luZV90 eXBlLCBib29sLCBlbnVtIG1jX2RyYXdfcm93X3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAg IGVudW0gbWNfY2FjaGVfdHlwZSk7CisKK2V4dGVybiB2b2lkIG1jX3NldF9lc3NlbnRpYWxzIChz dHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBtY19lc3NlbnRpYWxzICopOworCitleHRlcm4gdm9pZCBt Y19kcmF3X3JvdyAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVj dCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKiwg aW50LCBpbnQsIGludCwgc3RydWN0IGdseXBoX21hdHJpeCAqLAorICAgICAgICAgICAgICAgICAg ICAgICAgIHN0cnVjdCBtY19lc3NlbnRpYWxzLCBlbnVtIG1jX3Jvd19wb3NpdGlvbiwgYm9vbCwK KyAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2RyYXdfcm93X3R5cGUpOworCitleHRl cm4gYm9vbCBtY19yZWRyYXdfcm93IChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRy aXggKiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51 bSBnbHlwaF9yb3dfYXJlYSwgaW50LCBpbnQsIGludCwgYm9vbCwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSwgZW51bSBtY19yZWRyYXdfcm93X3R5cGUp OworCitleHRlcm4gdm9pZCBtY19yZXNldF9jYWNoZSAoc3RydWN0IHdpbmRvdyAqKTsKKworZXh0 ZXJuIHZvaWQgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGds eXBoX21hdHJpeCAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBn bHlwaF9yb3cgKiwgZW51bSBkcmF3X2dseXBoc19mYWNlLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGludCwgaW50LCBpbnQsIHN0cnVjdCBtY19SR0IsIGVudW0gbWNfZmxhdm9y LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUs IGludCwgYm9vbCwgYm9vbCk7CisKK2V4dGVybiB2b2lkIG1jX2VyYXNlX2N1cnNvciAoc3RydWN0 IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX21hdHJpeCwgaW50LCBpbnQsIGlu dCwgaW50LCBlbnVtIG1jX2ZsYXZvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51 bSBtY19jdXJzb3JfdHlwZSwgaW50KTsKKworZXh0ZXJuIHZvaWQgbWNfZHJhd19lcmFzZV9oeWJy aWQgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhf cm93ICosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBpbnQsIGludCwg aW50LCBpbnQsIGludCwgaW50LCBpbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgZW51bSBtY19jdXJzb3JfdHlwZSwgaW50LCBzdHJ1Y3QgbWNfUkdCLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGJvb2wsIGVudW0gbWNfZmxhdm9yLCBib29sKTsKKworZXh0 ZXJuIGludCBtY19kcmF3X2dseXBocyAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0 cml4ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0 cnVjdCBtY19tYXRyaXgsIGludCwgZW51bSBnbHlwaF9yb3dfYXJlYSwgcHRyZGlmZl90LAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgcHRyZGlmZl90LCBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2Us IGludCwgaW50LCBzdHJ1Y3QgbWNfUkdCLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51 bSBtY19mbGF2b3IsIGVudW0gbWNfY3Vyc29yX3R5cGUsIGludCwgYm9vbCwgYm9vbCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlwaF9hY3Rpb24sIGJvb2wpOworCitl eHRlcm4gc3RydWN0IGdseXBoX21hdHJpeCAqIG1jX3NhdmVfZ2x5cGhfbWF0cml4IChzdHJ1Y3Qg Z2x5cGhfbWF0cml4ICopOworCitleHRlcm4gdm9pZCBtY19yZXN0b3JlX2dseXBoX21hdHJpeCAo c3RydWN0IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICopOworCisvKiBlbmQg TVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogLyogVGV4 dCBjdXJzb3IgdHlwZXMuICAqLwogCiBlbnVtIHRleHRfY3Vyc29yX2tpbmRzCkBAIC00MDQsNiAr NTI5LDE4IEBAIHN0cnVjdCBnbHlwaF9zbGljZQogCiBzdHJ1Y3QgZ2x5cGgKIHsKKworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBpbnQgcmVs YXRpdmVfeCwgaHBvczsKKworICBwdHJkaWZmX3QgYnl0ZXBvczsKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisKKwogICAvKiBQb3NpdGlvbiBmcm9tIHdoaWNoIHRoaXMgZ2x5cGggd2FzIGRy YXduLiAgSWYgYG9iamVjdCcgYmVsb3cgaXMgYQogICAgICBMaXNwIHN0cmluZywgdGhpcyBpcyBh biBpbmRleCBpbnRvIHRoYXQgc3RyaW5nLiAgSWYgaXQgaXMgYQogICAgICBidWZmZXIsIHRoaXMg aXMgYSBwb3NpdGlvbiBpbiB0aGF0IGJ1ZmZlci4gIEluIGFkZGl0aW9uLCBzb21lCkBAIC0xMjcw LDYgKzE0MDcsMjggQEAgZW51bSBkcmF3X2dseXBoc19mYWNlCiAKIHN0cnVjdCBnbHlwaF9zdHJp bmcKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMg Ki8KKworICAgIGJvb2xfYmYgbGVmdF9vdmVyd3JpdHRlbl9wIDogMTsKKworICAgIGJvb2xfYmYg cmlnaHRfb3ZlcndyaXR0ZW5fcCA6IDE7CisKKyAgICBib29sX2JmIHJlY3RhbmdsZV9udWtlZF9w IDogMTsKKworICAgIGJvb2xfYmYgYmFja2dyb3VuZF9udWtlZF9wIDogMTsKKworICAgIGVudW0g ZHJhd19nbHlwaF9hY3Rpb24KKyAgICB7CisgICAgICBNQ19EUkFXX0dMWVBIX1NUUklORywKKyAg ICAgIE1DX0VSQVNFX0dMWVBIX1NUUklORworICAgIH0gYWN0aW9uX3R5cGU7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgLyogWC1vcmlnaW4gb2YgdGhlIHN0cmluZy4gICovCiAg IGludCB4OwogCkBAIC0yODM0LDYgKzI5OTMsMjkgQEAgdHlwZWRlZiB2b2lkICgqZnJhbWVfcGFy bV9oYW5kbGVyKSAoc3RydWN0IGZyYW1lICosIExpc3BfT2JqZWN0LCBMaXNwX09iamVjdCk7CiAK IHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlCiB7CisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBp biBgbnN0ZXJtLm1gIHwgYHczMnRlcm0uY2AgfCBgeHRlcm0uY2AgbXVzdCBiZSBpbiB0aGUKK2V4 YWN0IHNhbWUgb3JkZXIgYXMgdGhlIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgZGlzcGV4dGVy bi5oYCEgKi8KKworICAvKiBgbWNfbnNfZHJhd193aW5kb3dfY3Vyc29yJyB8IGBtY193MzJfZHJh d193aW5kb3dfY3Vyc29yJyB8IGBtY194X2RyYXdfd2luZG93X2N1cnNvcicgKi8KKyAgdm9pZCAo Km1jX3NjcmliZV9jdXJzb3IpIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4 ICptYXRyaXgsCisgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKmdseXBoX3JvdywgaW50IHgsIGlu dCBmeCwgaW50IHksIGludCBmeSwgaW50IGhwb3MsCisgICAgICAgIGludCB2cG9zLCBpbnQgd2Qs IGludCBoLCBzdHJ1Y3QgbWNfUkdCIGxzbCwgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlw ZSwKKyAgICAgICAgaW50IGN1cnNvcl93aWR0aCwgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9y LCBib29sIG9uX3AsIGJvb2wgYWN0aXZlX3ApOworCisgIC8qIGBtY19uc19kcmF3X2dseXBoX3N0 cmluZycgfCBgbWNfdzMyX2RyYXdfZ2x5cGhfc3RyaW5nJyB8IGBtY194X2RyYXdfZ2x5cGhfc3Ry aW5nJyAqLworICB2b2lkICgqbWNfc2NyaWJlX3N0cmluZykgKHN0cnVjdCBnbHlwaF9zdHJpbmcg KnMsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwKKyAgICAgICAgc3RydWN0IGdseXBoX3Jv dyAqcm93LCBzdHJ1Y3QgbWNfbWF0cml4IG1jX21hdHJpeCwgc3RydWN0IG1jX1JHQiBsc2wsCisg ICAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciwgZW51bSBtY19jdXJzb3JfdHlwZSBj dXJzb3JfdHlwZSwgaW50IHdkLAorICAgICAgICBib29sIGFjdGl2ZV9wLCBib29sIGN1cnNvcl9n Y19wKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBIYW5kbGVycyBmb3Ig c2V0dGluZyBmcmFtZSBwYXJhbWV0ZXJzLiAgKi8KICAgZnJhbWVfcGFybV9oYW5kbGVyICpmcmFt ZV9wYXJtX2hhbmRsZXJzOwogCmRpZmYgLS1naXQgYS9zcmMvZGlzcG5ldy5jIGIvc3JjL2Rpc3Bu ZXcuYwppbmRleCAwMTMx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0cnVjdCBnbHlwaF9yb3cgKnJvdykKK3sKKyAgc3RydWN0IG1jX3Jv d19lbnRyeSAqZW50cnk7CisgIHB0cmRpZmZfdCBpID0gcm93LT5oYXNoICUgbWNfcm93X3RhYmxl X3NpemU7CisgIGVudHJ5ID0gbWNfcm93X3RhYmxlW2ldOworICBlYXNzZXJ0IChlbnRyeSB8fCBt Y192ZXJpZnlfcm93X2hhc2ggKHJvdykpOworICB3aGlsZSAoZW50cnkgJiYgIXJvd19lcXVhbF9w IChlbnRyeS0+cm93LCByb3csIDEpKQorICAgIGVudHJ5ID0gZW50cnktPm5leHQ7CisgIGlmIChl bnRyeSA9PSBOVUxMKQorICAgIHsKKyAgICAgIGVudHJ5ID0gbWNfcm93X2VudHJ5X3Bvb2wgKyBt Y19yb3dfZW50cnlfaWR4Kys7CisgICAgICBlbnRyeS0+cm93ID0gcm93OworICAgICAgZW50cnkt Pm9sZF91c2VzID0gZW50cnktPm5ld191c2VzID0gMDsKKyAgICAgIGVudHJ5LT5uZXdfbGluZV9u dW1iZXIgPSAwOworICAgICAgZW50cnktPmJ1Y2tldCA9IGk7CisgICAgICBlbnRyeS0+bmV4dCA9 IG1jX3Jvd190YWJsZVtpXTsKKyAgICAgIG1jX3Jvd190YWJsZVtpXSA9IGVudHJ5OworICAgIH0K KyAgcmV0dXJuIGVudHJ5OworfQorCitzdHJ1Y3QgbWNfbWF0cml4CittY19zYXZlX2NhY2hlX21h dHJpeCAoc3RydWN0IG1jX21hdHJpeCBtYXRyaXgpCit7CisgIHN0cnVjdCBtY19tYXRyaXggc2F2 ZWQ7CisgIHNhdmVkLnZwb3NfYWxsb2NhdGVkID0gbWF0cml4LnZwb3NfYWxsb2NhdGVkOworICBz YXZlZC52cG9zX3VzZWQgPSBtYXRyaXgudnBvc191c2VkOworICBzYXZlZC52cG9zID0geHphbGxv YyAoc2F2ZWQudnBvc19hbGxvY2F0ZWQgKiBzaXplb2YgKnNhdmVkLnZwb3MpOworICBmb3IgKGVu dW0g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5ieXRlcyk7CisgICAgICBtZW1jcHkgKHRvLT5nbHlwaHNbVEVYVF9BUkVBXSwgZnJvbS0+Z2x5 cGhzW1RFWFRfQVJFQV0sIG5ieXRlcyk7CisgICAgICB0by0+dXNlZFtURVhUX0FSRUFdID0gZnJv bS0+dXNlZFtURVhUX0FSRUFdOworICAgICAgdG8tPmhhc2ggPSBmcm9tLT5oYXNoOworICAgICAg dG8tPnggPSBmcm9tLT54OworICAgICAgdG8tPnkgPSBmcm9tLT55OworICAgICAgdG8tPnBpeGVs X3dpZHRoID0gZnJvbS0+cGl4ZWxfd2lkdGg7CisgICAgICB0by0+YXNjZW50ID0gZnJvbS0+YXNj ZW50OworICAgICAgdG8tPmhlaWdodCA9IGZyb20tPmhlaWdodDsKKyAgICAgIHRvLT5waHlzX2Fz Y2VudCA9IGZyb20tPnBoeXNfYXNjZW50OworICAgICAgdG8tPnBoeXNfaGVpZ2h0ID0gZnJvbS0+ cGh5c19oZWlnaHQ7CisgICAgICB0by0+dmlzaWJsZV9oZWlnaHQgPSBmcm9tLT52aXNpYmxlX2hl aWdodDsKKyAgICAgIHRvLT5leHRyYV9saW5lX3NwYWNpbmcgPSBmcm9tLT5leHRyYV9saW5lX3Nw YWNpbmc7CisgICAgICB0by0+c3RhcnQgPSBmcm9tLT5zdGFydDsKKyAgICAgIHRvLT5lbmQgPSBm cm9tLT5lbmQ7CisgICAgICB0by0+bWlucG9zID0gZnJvbS0+bWlucG9zOworICAgICAgdG8tPm1h eHBvcyA9IGZyb20tPm1heHBvczsKKyAgICAgIHRvLT5vdmVybGF5X2Fycm93X2JpdG1hcCA9IGZy b20tPm92ZXJsYXlfYXJyb3dfYml0bWFwOworICAgICAgdG8tPmxlZnRfdXNlcl9mcmluZ2VfYml0 bWFwID0gZnJvbS0+bGVmdF91c2VyX2ZyaW5nZV9iaXRtYXA7CisgICAgICB0by0+cmlnaHRfdXNl cl9mcmluZ2VfYml0bWFwID0gZnJvbS0+cmlnaHRfdXNlcl9mcmlu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GdseXBoX21hdHJpeCAqY3VycmVudF9tYXRyaXgg PSB3LT5jdXJyZW50X21hdHJpeDsKKyAgaW50IHliID0gd2luZG93X3RleHRfYm90dG9tX3kgKHcp OworICBwdHJkaWZmX3QgaTsKKyAgaW50IGosIGZpcnN0X29sZCwgZmlyc3RfbmV3LCBsYXN0X29s ZCwgbGFzdF9uZXc7CisgIGludCBucnVucywgcnVuX2lkeDsKKyAgcHRyZGlmZl90IG47CisgIHN0 cnVjdCBtY19yb3dfZW50cnkgKmVudHJ5OworICAvLyBzdHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFj ZSAqcmlmID0gRlJBTUVfUklGIChYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpKTsKKyAgLyogU2tp cCBvdmVyIHJvd3MgZXF1YWwgYXQgdGhlIHN0YXJ0LiAqLworICBmb3IgKGkgPSBoZWFkZXJfbGlu ZV9wOyBpIDwgY3VycmVudF9tYXRyaXgtPm5yb3dzIC0gMTsgKytpKQorICAgIHsKKyAgICAgIHN0 cnVjdCBnbHlwaF9yb3cgKmQgPSBNQVRSSVhfUk9XIChkZXNpcmVkX21hdHJpeCwgaSk7CisgICAg ICBzdHJ1Y3QgZ2x5cGhfcm93ICpjID0gTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIGkpOwor ICAgICAgaWYgKGMtPmVuYWJsZWRfcAorICAgICAgICAgICYmIGQtPmVuYWJsZWRfcAorICAgICAg ICAgICYmICFkLT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcAorICAgICAgICAgICYmIGMtPnkgPT0g ZC0+eQorICAgICAgICAgICYmIE1BVFJJWF9ST1dfQk9UVE9NX1kgKGMpIDw9IHliCisgICAgICAg ICAgJiYgTUFUUklYX1JPV19CT1RUT01fWSAoZCkgPD0geWIKKyAgICAgICAgICAmJiByb3dfZXF1 YWxfcCAoYywgZCwgMSkpCisgICAgICAgIHsKKyAgICAgICAgICBhc3NpZ25fcm93IChjLCBkKTsK KyAgICAgICAgIC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GJvdHRvbSA+PSB5YikK KyAgICAgICAgYnJlYWs7CisgICAgfQorICBsYXN0X25ldyA9IGk7CisgIC8qIFNldCBsYXN0X29s ZCB0byB0aGUgaW5kZXggKyAxIG9mIHRoZSByb3cgdGhhdCByZWFjaGVzIHRoZSBib3R0b20KKyAg ICAgYm91bmRhcnkgaW4gdGhlIGN1cnJlbnQgbWF0cml4LiAgV2UgZG9uJ3QgbG9vayBhdCB0aGUg ZW5hYmxlZAorICAgICBmbGFnIGhlcmUgYmVjYXVzZSB3ZSBwbGFuIHRvIHJldXNlIHBhcnQgb2Yg dGhlIGRpc3BsYXkgZXZlbiBpZgorICAgICBvdGhlciBwYXJ0cyBhcmUgZGlzYWJsZWQuICovCisg IGkgPSBmaXJzdF9vbGQgKyAxOworICB3aGlsZSAoaSA8IGN1cnJlbnRfbWF0cml4LT5ucm93cyAt IDEpCisgICAgeworICAgICAgaW50IGJvdHRvbSA9IE1BVFJJWF9ST1dfQk9UVE9NX1kgKE1BVFJJ WF9ST1cgKGN1cnJlbnRfbWF0cml4LCBpKSk7CisgICAgICBpZiAoYm90dG9tIDw9IHliKQorICAg ICAgICArK2k7CisgICAgICBpZiAoYm90dG9tID49IHliKQorICAgICAgICBicmVhazsKKyAgICB9 CisgIGxhc3Rfb2xkID0gaTsKKyAgLyogU2tpcCBvdmVyIHJvd3MgZXF1YWwgYXQgdGhlIGJvdHRv bS4gKi8KKyAgaSA9IGxhc3RfbmV3OworICBqID0gbGFzdF9vbGQ7CisgIHdoaWxlIChpIC0gMSA+ IGZpcnN0X25ldworICAgICAgICAgJiYgaiAtIDEgPiBmaXJzdF9vbGQKKyAgICAgICAgICYmIE1B VFJJWF9ST1dfRU5BQkxFRF9QIChjdXJyZW50X21hdHJpeCwgaiAtIDEpCisgICAgICAgICAmJiAo TUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIGogLSAxKS0+eQorICAgICAgICAgICAgID09IE1B VFJJWF9ST1cgKGRlc2lyZWRfbWF0cml4LC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bW9z dF9wcmltZSAoMTEzKSB3b3VsZCBiZSAxMjcuICovCisgIHsKKyAgICB2ZXJpZnkgKE5FWFRfQUxN T1NUX1BSSU1FX0xJTUlUID09IDExKTsKKyAgICBlbnVtIHsgbmV4dF9hbG1vc3RfcHJpbWVfaW5j cmVtZW50X21heCA9IDEwIH07CisgICAgcHRyZGlmZl90IHJvd190YWJsZV9tYXggPQorICAgICAg KG1pbiAoUFRSRElGRl9NQVgsIFNJWkVfTUFYKSAvICgzICogc2l6ZW9mICptY19yb3dfdGFibGUp CisgICAgICAgLSBuZXh0X2FsbW9zdF9wcmltZV9pbmNyZW1lbnRfbWF4KTsKKyAgICBwdHJkaWZm X3QgY3VycmVudF9ucm93c19tYXggPSByb3dfdGFibGVfbWF4IC0gZGVzaXJlZF9tYXRyaXgtPm5y b3dzOworICAgIGlmIChjdXJyZW50X25yb3dzX21heCA8IGN1cnJlbnRfbWF0cml4LT5ucm93cykK KyAgICAgIG1lbW9yeV9mdWxsIChTSVpFX01BWCk7CisgIH0KKyAgLyogUmVhbGxvY2F0ZSB2ZWN0 b3JzLCB0YWJsZXMgZXRjLiBpZiBuZWNlc3NhcnkuICovCisgIGlmIChjdXJyZW50X21hdHJpeC0+ bnJvd3MgPiBtY19vbGRfbGluZXNfc2l6ZSkKKyAgICBtY19vbGRfbGluZXMgPSB4cGFsbG9jICht Y19vbGRfbGluZXMsICZtY19vbGRfbGluZXNfc2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICBjdXJyZW50X21hdHJpeC0+bnJvd3MgLSBtY19vbGRfbGluZXNfc2l6ZSwKKyAgICAgICAgICAg ICAgICAgICAgICAgICBJTlRfTUFYLCBzaXplb2YgKm1jX29sZF9saW5lcyk7CisgIGlmIChkZXNp cmVkX21hdHJpeC0+bnJvd3MgPiBtY19uZXdfbGluZXNfc2l6ZSkKKyAgICBtY19uZXdfbGluZXMg PSB4cGFsbG9jIChtY19uZXdfbGluZXMsICZtY19uZXdfbGluZXNfc2l6ZSwKKyAgICAgICAgICAg ICAgICAgICAgICAgICBkZXNpcmVkX21hdHJpeC0+bnJvd3MgLSBtY19uZXdfbGluZXNfc2l6ZSwK KyAgICAgICAgICAgICAgICAgICAgICAgICBJTlRfTUFYLCBzaXplb2YgKm1jX25ld19saW5lcyk7 CisgIG4gPSBkZXNpcmVkX21hdHJpeC0+bnJvd3M7CisgIG4gKz0gY3VycmVudF9tYXRyaXgtPm5y b3dzOworICBpZiAobWNfcm93X3RhYmxlX3NpemUgPCAzICogbikKKyAgICB7CisgICAgICBwdHJk aWZmX3Qgc2l6ZSA9IG5leHRfYWxtb3N0X3ByaW1lICgzICogbik7CisgICAgICBtY19yb3dfdGFi bGUgPSB4bnJlYWxsb2MgKG1jX3Jvd190YWJsZSwgc2l6ZSwgc2l6ZW9mICptY19yb3dfdGFibGUp OworICAgICAgbWNfcm93X3RhYmxlX3NpemUgPSBzaXplOworICAgICAgbWVtc2V0IChtY19yb3df dGFibGUsIDAsIHNpemUgKiBzaXplb2YgKm1jX3Jvd190YWJsZSk7CisgICAgfQorICBpZiAobiA+ IG1jX3Jvd19lbnRyeV9wb29sX3NpemUpCisgICAgbWNfcm93X2VudHJ5X3Bvb2wgPSB4cGFsbG9j IChtY19yb3dfZW50cnlfcG9vbCwgJm1jX3Jvd19lbnRyeV9wb29sX3NpemUsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBuIC0gbWNfcm93X2VudHJ5X3Bvb2xfc2l6ZSwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC0xLCBzaXplb2YgKm1jX3Jvd19lbnRyeV9wb29sKTsKKyAg aWYgKGRlc2lyZWRfbWF0cml4LT5ucm93cyA+IG1jX3J1bnNfc2l6ZSkKKyAgICB7CisgICAgICBt Y19ydW5zID0geG5yZWFsbG9jIChtY19ydW5zLCBkZXNpcmVkX21hdHJpeC0+bnJvd3MsIHNpemVv ZiAqbWNfcnVucyk7CisgICAgICBtY19ydW5fcG9vbCA9IHhucmVhbGxvYyAobWNfcnVuX3Bvb2ws IGRlc2lyZWRfbWF0cml4LT5ucm93cywgc2l6ZW9mICptY19ydW5fcG9vbCk7CisgICAgICBtY19y dW5zX3NpemUgPSBkZXNpcmVkX21hdHJpeC0+bnJvd3M7CisgICAgfQorICBucnVucyA9IHJ1bl9p ZHggPSAwOworICBtY19yb3dfZW50cnlfaWR4ID0gMDsKKyAgLyogQWRkIHJvd3MgZnJvbSB0aGUg Y3VycmVudCBhbmQgZGVzaXJlZCBtYXRyaXggdG8gdGhlIGhhc2ggdGFibGUKKyAgICAgcm93X2hh c2hfdGFibGUgdG8gYmUgYWJsZSB0byBmaW5kIGVxdWFsIG9uZXMgcXVpY2tseS4gKi8KKyAgZm9y IChpID0gZmlyc3Rfb2xkOyBpIDwgbGFzdF9vbGQ7ICsraSkKKyAgICB7CisgICAgICBpZiAoTUFU UklYX1JPV19FTkFCTEVEX1AgKGN1cnJlbnRfbWF0cml4LCBpKSkKKyAgICAgICAgeworICAgICAg ICAgIGVudHJ5ID0gbWNfYWRkX3Jvd19lbnRyeSAoTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgs IGkpKTsKKyAgICAgICAgICBtY19vbGRfbGluZXNbaV0gPSBlbnRyeTsKKyAgICAgICAgICArK2Vu dHJ5LT5vbGRfdXNlczsKKyAgICAgICAgfQorICAgICAgZWxzZQorICAgICAgICBtY19vbGRfbGlu ZXNbaV0gPSBOVUxMOworICAgIH0KKyAgZm9yIChpID0gZmlyc3RfbmV3OyBpIDwgbGFzdF9uZXc7 ICsraSkKKyAgICB7CisgICAgICBlYXNzZXJ0IChNQVRSSVhfUk9XX0VOQUJMRURfUCAoZGVzaXJl ZF9tYXRyaXgsIGkpKTsKKyAgICAgIGVudHJ5ID0gbWNfYWRkX3Jvd19lbnRyeSAoTUFUUklYX1JP VyAoZGVzaXJlZF9tYXRyaXgsIGkpKTsKKyAgICAgICsrZW50cnktPm5ld191c2VzOworICAgICAg ZW50cnktPm5ld19saW5lX251bWJ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ZSAo cCA+IGZpcnN0X29sZAorICAgICAgICAgICAgICAgJiYgcSA+IGZpcnN0X25ldworICAgICAgICAg ICAgICAgJiYgbWNfb2xkX2xpbmVzW3BdID09IG1jX25ld19saW5lc1txXSkKKyAgICAgICAgICB7 CisgICAgICAgICAgICBpbnQgaCA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCBwKS0+aGVp Z2h0OworICAgICAgICAgICAgLS1ydW4tPmN1cnJlbnRfdnBvczsKKyAgICAgICAgICAgIC0tcnVu LT5kZXNpcmVkX3Zwb3M7CisgICAgICAgICAgICArK3J1bi0+bnJvd3M7CisgICAgICAgICAgICBy dW4tPmhlaWdodCArPSBoOworICAgICAgICAgICAgcnVuLT5kZXNpcmVkX3kgLT0gaDsKKyAgICAg ICAgICAgIHJ1bi0+Y3VycmVudF95IC09IGg7CisgICAgICAgICAgICAtLXAsIC0tcTsKKyAgICAg ICAgICB9CisgICAgICAgIC8qIEV4dGVuZCBmb3J3YXJkLiAqLworICAgICAgICBwID0gaSArIDE7 CisgICAgICAgIHEgPSBuZXdfbGluZSArIDE7CisgICAgICAgIHdoaWxlIChwIDwgbGFzdF9vbGQK KyAgICAgICAgICAgICAgICYmIHEgPCBsYXN0X25ldworICAgICAgICAgICAgICAgJiYgbWNfb2xk X2xpbmVzW3BdID09IG1jX25ld19saW5lc1txXSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBp bnQgaCA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCBwKS0+aGVpZ2h0OworICAgICAgICAg ICAgKytydW4tPm5yb3dzOworICAgICAgICAgICAgcnVuLT5oZWlnaHQgKz0gaDsKKyAgICAgICAg ICAgICsrcCwgKytxOworICAgICAgICAgIH0KKyAgICAgICAgLyogSW5zZXJ0IHJ1biBpbnRvIGxp c3Qgb2YgYWxsIHJ1bnMuICBPcmRlciBydW5zIGJ5IGNvcGllZAorICAgICAgICAgICBwaXhlbCBs aW5lcy4gIE5vdGUgdGhhdCB3ZSByZWNvcmQgcnVucyB0aGF0IGRvbid0IGhhdmUgdG8KKyAgICAg ICAgICAgYmUgY29waWVkIGJlY2F1c2UgdGhleSBhcmUgYWxyZWFkeSBpbiBwbGFjZS4gIFRoaXMg aXMgZG9uZQorICAgICAgICAgICBiZWNhdXNlIHdlIGNhbiBhdm9pZCBjYWxsaW5nIHVwZGF0ZV93 aW5kb3dfbGluZSBpbiB0aGlzCisgICAgICAgICAgIGNhc2UuICovCisgICAgICAgIGZvciAocCA9 IDA7IHAgPCBucnVucyAmJiBtY19ydW5zW3BdLT5oZWlnaHQgPiBydW4tPmhlaWdodDsgKytwKQor ICAgICAgICAgIDsKKyAgICAgICAgZm9yIChxID0gbnJ1bnM7IHEgPiBwOyAtLXEpCisgICAgICAg ICAgbWNfcnVuc1txXSA9IG1jX3J1bnNbcSAtIDFdOworICAgICAgICBtY19ydW5zW3BdID0gcnVu OworICAgICAgICArK25ydW5zOworICAgICAgICBpICs9IHJ1bi0+bnJvd3M7CisgICAgICB9Cisg ICAgICBlbHNlCisgICAgICAgICsraTsKKyAgLyogRG8gdGhlIG1vdmVzLiAgRG8gaXQgaW4gYSB3 YXkgdGhhdCB3ZSBkb24ndCBvdmVyd3JpdGUgc29tZXRoaW5nCisgICAgIHdlIHdhbnQgdG8gY29w eSBsYXRlciBvbi4gIFRoaXMgaXMgbm90IHNvbHZhYmxlIGluIGdlbmVyYWwKKyAgICAgYmVjYXVz ZSB0aGVyZSBpcyBvbmx5IG9uZSBkaXNwbGF5IGFuZCB3ZSBkb24ndCBoYXZlIGEgd2F5IHRvCisg ICAgIGV4Y2hhbmdlIGFyZWFzIG9uIHRoaXMgZGlzcGxheS4gIEV4YW1wbGU6CisgICAgICAgICAg Ky0tLS0tLS0tLS0tKyAgICAgICArLS0tLS0tLS0tLS0rCisgICAgICAgICAgfCAgICAgQSAgICAg fCAgICAgICB8ICAgICBCICAgICB8CisgICAgICAgICAgKy0tLS0tLS0tLS0tKyAgLS0+ICArLS0t LS0tLS0tLS0rCisgICAgICAgICAgfCAgICAgQiAgICAgfCAgICAgICB8ICAgICBBICAgICB8Cisg ICAgICAgICAgKy0tLS0tLS0tLS0tKyAgICAgICArLS0tLS0tLS0tLS0rCisgICAgIEluc3RlYWQs IHByZWZlciBiaWdnZXIgbW92ZXMsIGFuZCBpbnZhbGlkYXRlIG1vdmVzIHRoYXQgd291bGQKKyAg ICAgY29weSBmcm9tIHdoZXJlIHdlIGNvcGllZCB0by4gKi8KKyAgZm9yIChpID0gMDsgaSA8IG5y dW5zOyArK2kpCisgICAgaWYgKG1jX3J1bnNbaV0tPm5yb3dzID4gMCkKKyAgICAgIHsKKyAgICAg ICAgc3RydWN0IHJ1biAqciA9IG1jX3J1bnNbaV07CisgICAgICAgIGlmIChyLT5jdXJyZW50X3kg IT0gci0+ZGVzaXJlZF95KQorICAgICAgICAgIHsKKyAgICAgICAgICAgIC8vICBmcHJpbnRmIChz dGRlcnIsICIlczogIHItPmN1cnJlbnQvZGVzaXJlZF92cG9zICglZC8lZCkgfCByLT5jdXJyZW50 L2Rlc2lyZWRfeSAoJWQvJWQpXG4iLAorICAgICAgICAgICAgLy8gICAgICAgICAgIHItPmN1cnJl bnRfeSA8IHItPmRlc2lyZWRfeSA/ICLihpMiIDogIuKGkSIsCisgICAgICAgICAgICAvLyAgICAg ICAgICAgci0+Y3VycmVudF92cG9zLCByLT5kZXNpcmVkX3Zwb3MsIHItPmN1cnJlbnRfeSwgci0+ ZGVzaXJlZF95KTsKKyAgICAgICAgICAgIC8vICByaWYtPmNsZWFyX3dpbmRvd19tb3VzZV9mYWNl ICh3KTsKKyAgICAgICAgICAgIC8vICByaWYtPnNjcm9sbF9ydW5faG9vayAodywgcik7CisgICAg ICAgICAgfQorICAgICAgICAvKiBUcnVuY2F0ZSBydW5zIHRoYXQgY29weSB0byB3aGVyZSB3ZSBj b3BpZWQgdG8sIGFuZAorICAgICAgICAgICBpbnZhbGlkYXRlIHJ1bnMgdGhhdCBjb3B5IGZyb20g d2hlcmUgd2UgY29waWVkIHRvLiAqLworICAgICAgICBmb3IgKGogPSBucnVucyAtIDE7IGogPiBp OyAtLWopCisgICAgICAgICAgeworICAgICAgICAgICAgc3RydWN0IHJ1biAqcCA9IG1jX3J1bnNb al07CisgICAgICAgICAgICBib29sIHRydW5jYXRlZF9wID0gMDsKKyAgICAgICAgICAgIGlmIChw LT5ucm93cyA+IDAKKyAgICAgICAgICAgICAgICAmJiBwLT5kZXNpcmVkX3kgPCByLT5kZXNpcmVk X3kgKyByLT5oZWlnaHQKKyAgICAgICAgICAgICAgICAmJiBwLT5kZXNpcmVkX3kgKyBwLT5oZWln aHQgPiByLT5kZXNpcmVkX3kpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAo cC0+ZGVzaXJlZF95IDwgci0+ZGVzaXJlZF95KQorICAgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgICBwLT5ucm93cyA9IHItPmRlc2lyZWRfdnBvcyAtIHAtPmRlc2lyZWRfdnBv czsKKyAgICAgICAgICAgICAgICAgICAgcC0+aGVpZ2h0ID0gci0+ZGVzaXJlZF95IC0gcC0+ZGVz aXJlZF95OworICAgICAgICAgICAgICAgICAgICB0cnVuY2F0ZWRfcCA9IDE7CisgICAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgICBpbnQgbnJvd3NfY29waWVkID0gKHItPmRlc2lyZWRfdnBvcyArIHIt Pm5yb3dzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBwLT5kZXNp cmVkX3Zwb3MpOworICAgICAgICAgICAgICAgICAgICBpZiAocC0+bnJvd3MgPD0gbnJvd3NfY29w aWVkKQorICAgICAgICAgICAgICAgICAgICAgIHAtPm5yb3dzID0gMDsKKyAgICAgICAgICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICAgICAgICAgIGludCBoZWlnaHRfY29waWVkID0gKHItPmRlc2lyZWRfeSArIHItPmhlaWdodAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIHAtPmRlc2ly ZWRfeSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmN1cnJlbnRfdnBvcyArPSBucm93 c19jb3BpZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmRlc2lyZWRfdnBvcyArPSBu cm93c19jb3BpZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPm5yb3dzIC09IG5yb3dz X2NvcGllZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcC0+Y3VycmVudF95ICs9IGhlaWdo dF9jb3BpZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmRlc2lyZWRfeSArPSBoZWln aHRfY29waWVkOworICAgICAgICAgICAgICAgICAgICAgICAgICBwLT5oZWlnaHQgLT0gaGVpZ2h0 X2NvcGllZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ1bmNhdGVkX3AgPSAxOworICAg ICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICB9CisgICAgICAgICAgICBpZiAoci0+Y3VycmVudF95ICE9IHItPmRlc2lyZWRfeQorICAgICAg ICAgICAgICAgIC8qIFRoZSBjb25kaXRpb24gYmVsb3cgaXMgZXF1aXZhbGVudCB0bworICAgICAg ICAgICAgICAgICAgICgocC0+Y3VycmVudF95ID49IHItPmRlc2lyZWRfeQorICAgICAgICAgICAg ICAgICAgICAgJiYgcC0+Y3VycmVudF95IDwgci0+ZGVzaXJlZF95ICsgci0+aGVpZ2h0KQorICAg ICAgICAgICAgICAgICAgICB8fCAocC0+Y3VycmVudF95ICsgcC0+aGVpZ2h0ID4gci0+ZGVzaXJl ZF95CisgICAgICAgICAgICAgICAgICAgICAgICAmJiAocC0+Y3VycmVudF95ICsgcC0+aGVpZ2h0 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPD0gci0+ZGVzaXJlZF95ICsgci0+aGVpZ2h0 KSkpCisgICAgICAgICAgICAgICAgICAgYmVjYXVzZSB3ZSBoYXZlIDAgPCBwLT5oZWlnaHQgPD0g ci0+aGVpZ2h0LiAqLworICAgICAgICAgICAgICAgICYmIHAtPmN1cnJlbnRfeSA8IHItPmRlc2ly ZWRfeSArIHItPmhlaWdodAorICAgICAgICAgICAgICAgICYmIHAtPmN1cnJlbnRfeSArIHAtPmhl aWdodCA+IHItPmRlc2lyZWRfeSkKKyAgICAgICAgICAgICAgcC0+bnJvd3MgPSAwOworICAgICAg ICAgICAgLyogUmVvcmRlciBydW5zIGJ5IGNvcGllZCBwaXhlbCBsaW5lcyBpZiB0cnVuY2F0ZWQu ICovCisgICAgICAgICAgICBpZiAodHJ1bmNhdGVkX3AgJiYgcC0+bnJvd3MgPiAwKQorICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgaW50IGsgPSBucnVucyAtIDE7CisgICAgICAgICAg ICAgICAgd2hpbGUgKG1jX3J1bnNba10tPm5yb3dzID09IDAgfHwgbWNfcnVuc1trXS0+aGVpZ2h0 IDwgcC0+aGVpZ2h0KQorICAgICAgICAgICAgICAgICAgay0tOworICAgICAgICAgICAgICAgIG1l bW1vdmUgKG1jX3J1bnMgKyBqLCBtY19ydW5zICsgaiArIDEsIChrIC0gaikgKiBzaXplb2YgKCpt Y19ydW5zKSk7CisgICAgICAgICAgICAgICAgbWNfcnVuc1trXSA9IHA7CisgICAgICAgICAgICAg IH0KKyAgICAgICAgICB9CisgICAgICAgIC8qIEFzc2lnbiBtYXRyaXggcm93cy4gKi8KKyAgICAg ICAgZm9yIChqID0gMDsgaiA8IHItPm5yb3dzOyArK2opCisgICAgICAgICAgeworICAgICAgICAg ICAgc3RydWN0IGdseXBoX3JvdyAqZnJvbSwgKnRvOworICAgICAgICAgICAgYm9vbCB0b19vdmVy bGFwcGVkX3A7CisgICAgICAgICAgICB0byA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCBy LT5kZXNpcmVkX3Zwb3MgKyBqKTsKKyAgICAgICAgICAgIGZyb20gPSBNQVRSSVhfUk9XIChkZXNp cmVkX21hdHJpeCwgci0+ZGVzaXJlZF92cG9zICsgaik7CisgICAgICAgICAgICB0b19vdmVybGFw cGVkX3AgPSB0by0+b3ZlcmxhcHBlZF9wOworICAgICAgICAgICAgZnJvbS0+cmVkcmF3X2ZyaW5n ZV9iaXRtYXBzX3AgPSBmcm9tLT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3A7CisgICAgICAgICAg ICBhc3NpZ25fcm93ICh0bywgZnJvbSk7CisgICAgICAgICAgICAvKiBUaGUgYWJvdmUgYGFzc2ln bl9yb3cnIGFjdHVhbGx5IGRvZXMgc3dhcCwgc28gaWYgd2UgaGFkCisgICAgICAgICAgICAgICBh biBvdmVybGFwIGluIHRoZSBjb3B5IGRlc3RpbmF0aW9uIG9mIHR3byBydW5zLCB0aGVuCisgICAg ICAgICAgICAgICB0aGUgc2Vjb25kIHJ1biB3b3VsZCBhc3NpZ24gYSBwcmV2aW91c2x5IGRpc2Fi bGVkIGJvZ3VzCisgICAgICAgICAgICAgICByb3cuICBCdXQgdGhhbmtzIHRvIHRoZSB0cnVuY2F0 aW9uIGNvZGUgaW4gdGhlCisgICAgICAgICAgICAgICBwcmVjZWRpbmcgZm9yLWxvb3AsIHdlIG5v IGxvbmdlciBoYXZlIHN1Y2ggYW4gb3ZlcmxhcCwKKyAgICAgICAgICAgICAgIGFuZCB0aHVzIHRo ZSBhc3NpZ25lZCByb3cgc2hvdWxkIGFsd2F5cyBiZSBlbmFibGVkLiAqLworICAgICAgICAgICAg ZWFzc2VydCAodG8tPmVuYWJsZWRfcCk7CisgICAgICAgICAgICBmcm9tLT5lbmFibGVkX3AgPSBm YWxzZTsKKyAgICAgICAgICAgIHRvLT5vdmVybGFwcGVkX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lbnQnIGluIGB1cGRh dGVfd2luZG93X2xpbmUnLCBvciBiZWNhdXNlIHRoZSBwcmV2aW91cyByb3cgd291bGQgYmUKKyAg dGhlIHNhbWUgaW4gYm90aCBtYXRyaWNlcyBpZiB3ZSBqdW1wZWQgdG8gYHNldF9jdXJzb3I6YCB3 aXRoaW4gYHVwZGF0ZV93aW5kb3cnCisgIGFuZCBgbWNfdXBkYXRlX3dpbmRvd19kcnlydW4nLiAq LworICBpbnQgcHJldl9tYXRyaXhfcm93X3N0YXJ0X2J5dGVwb3MgPSAodnBvcyAhPSAwKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1BVFJJWF9ST1dfU1RBUlRfQllU RVBPUyAoY3VycmVudF9yb3cgLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IC0xOworICBpbnQgcHJldl9tYXRyaXhfcm93X2VuZF9ieXRlcG9zID0gKHZwb3MgIT0g MCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPV19FTkRf QllURVBPUyAoY3VycmVudF9yb3cgLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAtMTsKKyAgaW50IG1hdHJpeF9yb3dfc3RhcnRfYnl0ZXBvcyA9IE1BVFJJWF9ST1df U1RBUlRfQllURVBPUyAoZGVzaXJlZF9yb3cpOworICBpbnQgbWF0cml4X3Jvd19lbmRfYnl0ZXBv cyA9IE1BVFJJWF9ST1dfRU5EX0JZVEVQT1MgKGRlc2lyZWRfcm93KTsKKyAgLyogVGhlIGZpcnN0 IGNvbmRpdGlvbiB0ZXN0cyBmb3IgYSBzb2xpdGFyeSByb3cgY29udGFpbmluZyBaViwgcHJlY2Vk ZWQgYnkgYQorICByb3cgY29udGFpbmluZyBhIHBlbnVsdGltYXRlIGdseXBoIHdpdGggYSBjaGFy cG9zIG9mIFpWIC0gMSBmb2xsb3dlZCBieSBhbiBlbmQKKyAgb2Ygcm93IHNwYWNlIGdseXBoIHdp dGggYSBjaGFycG9zIG9mIDAuICBUaGUgb3RoZXIgY29uZGl0aW9ucyB0ZXN0IGZvciBhbiBlbXB0 eQorICBidWZmZXIgKG5vdCBuYXJyb3dlZCksIG9yIGFuIGVtcHR5IG5hcnJvd2VkIGJ1ZmZlci4g Ki8KKyAgYm9vbCByb3dfYXRfenZfcCA9ICgodnBvcyAhPSAwCisgICAgICAgICAgICAgICAgICAg ICAgICYmIChjdXJyZW50X3JvdyAtIDEpLT51c2VkW1RFWFRfQVJFQV0gPiAwCisgICAgICAgICAg ICAgICAgICAgICAgICYmIHByZXZfbWF0cml4X3Jvd19zdGFydF9ieXRlcG9zICE9IHByZXZfbWF0 cml4X3Jvd19lbmRfYnl0ZXBvcworICAgICAgICAgICAgICAgICAgICAgICAmJiAhKGN1cnJlbnRf cm93IC0gMSktPmVuZHNfYXRfenZfcAorICAgICAgICAgICAgICAgICAgICAgICAmJiBtYXRyaXhf cm93X3N0YXJ0X2J5dGVwb3MgPT0gbWF0cml4X3Jvd19lbmRfYnl0ZXBvcworICAgICAgICAgICAg ICAgICAgICAgICAmJiBkZXNpcmVkX3Jvdy0+ZW5kc19hdF96dl9wKQorICAgICAgICAgICAgICAg ICAgICAgIHx8ICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA9PSAxKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgfHwgKGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwICYmIHZwb3Mg PT0gMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGJ1ZmZlcl9uYXJyb3dlZF9wCisg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIGJvYl9yZXNwZWN0X25hcnJvdyA9PSBlb2JfcmVz cGVjdF9uYXJyb3cpCisgICAgICAgICAgICAgICAgICAgICAgfHwgKCgoaGVhZGVyX2xpbmVfZm9y bWF0ID4gMCAmJiB2cG9zID09IDEpCisgICAg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peDsKKyAg aWYgKGRlYnVnX3ApCisgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfdXBkYXRlX3RleHRfYXJlYSAo JXMpOiAgdnBvcyAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgIG1jX3dpbmRvdyAodyks IHZwb3MpOworICAvKiBJbmFzbXVjaCBhcyB3ZSBwcm9jZXNzIHRoZSBjdXJzb3Igcm93IGJlZm9y ZSBhbGwgb3RoZXIgcm93cywgd2UgY2FuIHJlbHkKKyAgdXBvbiB0aGUgcHJldmlvdXMgYGRlc2ly ZWRfcm93YCB0byBiZSBhY2N1cmF0ZS4gKi8KKyAgZW51bSBtY19yb3dfcG9zaXRpb24gcm93X3Bv c2l0aW9uID0gIG1jX3Jvd19wb3NpdGlvbiAodywgdnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IGRlc2lyZWRfcm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogY3VycmVudF9yb3csCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2lyZWRfcm93LCB2cG9zKTsKKyAgLyog SWYgcm93cyBhcmUgYXQgZGlmZmVyZW50IFggb3IgWSwgb3Igcm93cyBoYXZlIGRpZmZlcmVudCBo ZWlnaHQsCisgICAgIG9yIHRoZSBjdXJyZW50IHJvdyBpcyBtYXJrZWQgaW52YWxpZCwgd3JpdGUg dGhlIGVudGlyZSBsaW5lLiAqLworICBpZiAoIWN1cnJlbnRfcm93LT5lbmFibGVkX3AKKyAgICAg IHx8IGRlc2lyZWRfcm93LT55ICE9IGN1cnJlbnRfcm93LT55CisgICAgICB8fCBkZXNpcmVkX3Jv dy0+YXNjZW50ICE9IGN1cnJlbnRfcm93LT5hc2NlbnQKKyAgICAgIHx8IGRlc2lyZW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9y b3ctPngpOworICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIldS SVRFIEVOVElSRSBST1c6XG5cCisgICAgICAgICAgdnBvcyAoJWQpIHwgY2hhciAoJWQvJXMpIHwg c3RhcnRfeDogKCVkKSB8IHN0YXJ0X2hwb3MgKCVkLyVkKVxuIiwKKyAgICAgICAgICB2cG9zLCBk ZXNpcmVkX3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV0tPnUuY2gsCisgICAgICAgICAgbWNfY2hhcl90 b19zdHJpbmcgKGRlc2lyZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXS0+dS5jaCksCisgICAgICAg ICAgZGVzaXJlZF9yb3ctPngsIDAsIGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKTsK KyAgICAgIGlmIChkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdKQorICAgICAgICB7CisgICAg ICAgICAgYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgaW50IGxlbiA9IGRlc2lyZWRfcm93LT51 c2VkW1RFWFRfQVJFQV07CisgICAgICAgICAgaW50IGhwb3MgPSBkZXNpcmVkX3Jvdy0+Z2x5cGhz W1RFWFRfQVJFQV0gLSB1cGRhdGVkX3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICAgICAg dy0+b3V0cHV0X2N1cnNvci54ID0KKyAgICAgICAgICAgIG1jX2RyYXdfZ2x5cGhzICh3LCBkZXNp cmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHctPm1jX21hdHJpeCwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICB3LT5vdXRwdXRfY3Vyc29yLngsIFRFWFRfQVJFQSwgaHBvcywgaHBvcyArIGxl biwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBEUkFXX05PUk1BTF9URVhULCAwLCB2cG9z LCBsc2wsIGdseXBoX2ZsYXZvciwKKyAgICAgICAgICAgICAgIC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yBhdCB0aGUgc2FtZSBw b3NpdGlvbiwgbWFrZSBzdXJlIHdlIHdyaXRlIGF0IGxlYXN0IG9uZQorICAgICAgICBnbHlwaCwg c28gdGhhdCB0aGUgZmFjZSBleHRlbnNpb24gYWN0dWFsbHkgdGFrZXMgcGxhY2UuICovCisgICAg ICAgIGlmIChNQVRSSVhfUk9XX0VYVEVORFNfRkFDRV9QIChkZXNpcmVkX3JvdykKKyAgICAgICAg ICAgICYmIChkZXNpcmVkX3N0b3BfcG9zIDwgY3VycmVudF9yb3ctPnVzZWRbVEVYVF9BUkVBXQor ICAgICAgICAgICAgICAgIHx8IChkZXNpcmVkX3N0b3BfcG9zID09IGN1cnJlbnRfcm93LT51c2Vk W1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICAgJiYgIU1BVFJJWF9ST1dfRVhURU5EU19G QUNFX1AgKGN1cnJlbnRfcm93KSkpKQorICAgICAgICAgIC0tZGVzaXJlZF9zdG9wX3BvczsKKyAg ICAgICAgc3RvcCA9IG1pbiAoY3VycmVudF9yb3ctPnVzZWRbVEVYVF9BUkVBXSwgZGVzaXJlZF9z dG9wX3Bvcyk7CisgICAgICAgIGkgPSAwOworICAgICAgICB4ID0gZGVzaXJlZF9yb3ctPng7Cisg ICAgICAgIGludCBjbGVhcl90b194ID0gMDsKKworICAgICAgICAvKiBMb29wIG92ZXIgZ2x5cGhz IHRoYXQgY3VycmVudCBhbmQgZGVzaXJlZCByb3cgbWF5IGhhdmUgaW4gY29tbW9uLiAqLworICAg ICAgICB3aGlsZSAoaSA8IHN0b3ApCisgICAgICAgICAgeworICAgICAgICAgICAgYXJyYXlfZ2x5 cGhzX3NraXBwZWQudXNlZCA9IDA7CisgICAgICAgICAgICBib29sIGNhbl9za2lwX3AgPSAhYWJv cnRfc2tpcHBpbmc7CisgICAgICAgICAgICAvKiBTa2lwIG92ZXIgZ2x5cGhzIHRoYXQgYm90aCBy b3dzIGhhdmUgaW4gY29tbW9uLiAgVGhlc2UgZG9uJ3QgaGF2ZQorICAgICAgICAgICAgdG8gYmUg d3JpdHRlbi4gIFdlIGNhbid0IHNraXAgaWYgdGhlIGxhc3QgY3VycmVudCBnbHlwaCBvdmVybGFw cyB0aGUKKyAgICAgICAgICAgIGdseXBoIHRvIGl0cyByaWdodC4gIEZvciBleGFtcGxlLCBjb25z aWRlciBhIGN1cnJlbnQgcm93IG9mIGBpZicgd2l0aAorICAgICAgICAgICAgdGhlIGBmJyBpbiBD b3VyaWVyIGJvbGQgc28gdGhhdCBpdCBvdmVybGFwcyB0aGUgYCAnIHRvIGl0cyByaWdodC4KKyAg ICAgICAgICAgIElmIHRoZSBkZXNpcmVkIHJvdyBpcyBgICcsIHdlIHdvdWxkIHNraXAgb3ZlciB0 aGUgc3BhY2UgYWZ0ZXIgdGhlCisgICAgICAgICAgICBgaWYnIGFuZCB0aGVyZSB3b3VsZCByZW1h aW4gYSBwaXhlbCBmcm9tIHRoZSBgZicgb24gdGhlIHNjcmVlbi4gKi8KKyAgICAgICAgICAgIGlm IChvdmVybGFwcGluZ19nbHlwaHNfcCAmJiBpID4gMCkKKyAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSAmY3VycmVudF9yb3ctPmdseXBoc1tURVhU X0FSRUFdW2kgLSAxXTsKKyAgICAgICAgICAgICAgICBpbnQgbGVmdCwgcmlnaHQ7CisgICAgICAg ICAgICAgICAgcmlmLT5nZXRfZ2x5cGhfb3ZlcmhhbmdzIChnbHlwaCwgWEZSQU1FICh3LT5mcmFt ZSksICZsZWZ0LCAmcmlnaHQpOworICAgICAgICAgICAgICAgIGNhbl9za2lwX3AgPSAocmlnaHQg PT0gMCAmJiAhYWJvcnRfc2tpcHBpbmcpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICBp ZiAoY2FuX3NraXBfcCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGludCBzdGFy dF9ocG9zID0gaTsKKyAgICAgICAgICAgICAgICB3aGlsZSAoaSA8IHN0b3AKKyAgICAgICAgICAg ICAgICAgICAgICAgJiYgR0xZUEhfRVFVQUxfUCAoZGVzaXJlZF9nbHlwaCwgY3VycmVudF9nbHlw aCkpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICsrYXJyYXlfZ2x5 cGhzX3NraXBwZWQudXNlZDsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGFycmF5X2dseXBoc19z a2lwcGVkLmFsbG9jYXRlZCA8IGFycmF5X2dseXBoc19za2lwcGVkLnVzZWQpCisgICAgICAgICAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgaW50IG9sZF9hbGxvYyA9IGFy cmF5X2dseXBoc19za2lwcGVkLmFsbG9jYXRlZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlu dCBuZXdfZWx0cyA9IGFycmF5X2dseXBoc19za2lwcGVkLnVzZWQgLSBhcnJheV9nbHlwaHNfc2tp cHBlZC5hbGxvY2F0ZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICBhcnJheV9nbHlwaHNfc2tp cHBlZC5za2lwcGVkID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgeHBhbGxvYyAoYXJyYXlf Z2x5cGhzX3NraXBwZWQuc2tpcHBlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJmFycmF5X2dseXBoc19za2lwcGVkLmFsbG9jYXRlZCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgbmV3X2VsdHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIElOVF9NQVgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiAq YXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBt ZW1zZXQgKGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWQgKyBvbGRfYWxsb2MsIDAsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYXJyYXlfZ2x5cGhzX3NraXBwZWQuYWxsb2Nh dGVkIC0gb2xkX2FsbG9jKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHNp emVvZiAqYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZCk7CisgICAgICAgICAgICAgICAgICAg ICAgfQorICAgICAgICAgICAgICAgICAgICBpbnQgbnRoID0gYXJyYXlfZ2x5cGhzX3NraXBwZWQu dXNlZCAtIDE7CisgICAgICAgICAgICAgICAgICAgIGFycmF5X2dseXBoc19za2lwcGVkLnNraXBw ZWRbbnRoXS54ID0geDsKKyAgICAgICAgICAgICAgICAgICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQu c2tpcHBlZFtudGhdLmhwb3MgPSBpOworICAgICAgICAgICAgICAgICAgICBhcnJheV9nbHlwaHNf c2tpcHBlZC5za2lwcGVkW250aF0uZW5hYmxlZF9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAg ICAgeCArPSBkZXNpcmVkX2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAg KytkZXNpcmVkX2dseXBoLCArK2N1cnJlbnRfZ2x5cGgsICsraTsKKyAgICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgICAgICAvKiBDb25zaWRlciB0aGUgY2FzZSB0aGF0IHRoZSBjdXJyZW50 IHJvdyBjb250YWlucyAieHh4IHBwcCBnZ2ciIGluCisgICAgICAgICAgICAgICAgaXRhbGljIENv dXJpZXIgZm9udCwgYW5kIHRoZSBkZXNpcmVkIHJvdyBpcyAieHh4IGdnZyIuICBUaGUgY2hhcmFj dGVyIGBwJworICAgICAgICAgICAgICAgIGhhcyBsYmVhcmluZywgYGcnIGhhcyBub3QuICBUaGUg bG9vcCBhYm92ZSB3aWxsIHN0b3AgaW4gZnJvbnQgb2YgdGhlCisgICAgICAgICAgICAgICAgZmly c3QgYHAnIGluIHRoZSBjdXJyZW50IHJvdy4gIElmIHdlIHdvdWxkIHN0YXJ0IHdyaXRpbmcgZ2x5 cGhzIHRoZXJlLCB3ZQorICAgICAgICAgICAgICAgIHdvdWxkbid0IGVyYXNlIHRoZSBsYmVhcmlu ZyBvZiB0aGUgYHAnLiAgVGhlIHJlc3Qgb2YgdGhlIGxiZWFyaW5nIHByb2JsZW0KKyAgICAgICAg ICAgICAgICBpcyB0aGVuIHRha2VuIGNhcmUgb2YgYnkgZHJhd19nbHlwaHMuICovCisgICAgICAg ICAgICAgICAgaWYgKG92ZXJsYXBwaW5nX2dseXBoc19wCisgICAgICAgICAgICAgICAgICAgICYm IGkgPiAwCisgICAgICAgICAgICAgICAgICAgICYmIGkgPCBjdXJyZW50X3Jvdy0+dXNlZFtURVhU X0FSRUFdCisgICAgICAgICAgICAgICAgICAgICYmIChjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FS RUFdICE9IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pKQorICAgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgICBpbnQgbGVmdCwgcmlnaHQ7CisgICAgICAgICAgICAgICAg ICAgIHJpZi0+Z2V0X2dseXBoX292ZXJoYW5ncyAoY3VycmVudF9nbHlwaCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICBYRlJBTUUgKHctPmZyYW1lKSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmbGVmdCwgJnJpZ2h0KTsKKyAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGxlZnQg PiAwICYmIGkgPiAwKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAg ICAgICAgIC0taSwgLS1kZXNpcmVkX2dseXBoLCAtLWN1cnJlbnRfZ2x5cGg7CisgICAgICAgICAg ICAgICAgICAgICAgICB4IC09IGRlc2lyZWRfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAg ICAgICAgICAgICAgICAgbGVmdCAtPSBkZXNpcmVkX2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAg ICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIC8qIEFib3J0IHRoZSBza2lw cGluZyBhbGdvcml0aG0gaWYgd2UgZW5kIHVwIGJlZm9yZQorICAgICAgICAgICAgICAgICAgICAg ICBvdXIgc3RhcnRpbmcgcG9pbnQsIHRvIGF2b2lkIGxvb3BpbmcgKGJ1ZyMxMDcwKS4KKyAgICAg ICAgICAgICAgICAgICAgICAgVGhpcyBjYW4gaGFwcGVuIHdoZW4gdGhlIGxiZWFyaW5nIGlzIGxh cmdlciB0aGFuCisgICAgICAgICAgICAgICAgICAgICAgIHRoZSBwaXhlbCB3aWR0aC4gKi8KKyAg ICAgICAgICAgICAgICAgICAgYWJvcnRfc2tpcHBpbmcgPSAoaSA8IHN0YXJ0X2hwb3MpOworICAg ICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICB9CisgICAgICAgICAgICAvKiBUcnkgdG8g YXZvaWQgd3JpdGluZyB0aGUgZW50aXJlIHJlc3Qgb2YgdGhlIGRlc2lyZWQgcm93CisgICAgICAg ICAgICAgICBieSBsb29raW5nIGZvciBhIHJlc3luYyBwb2ludC4gIFRoaXMgbWFpbmx5IHByZXZl bnRzCisgICAgICAgICAgICAgICBtb2RlIGxpbmUgZmxpY2tlcmluZyBpbiB0aGUgY2FzZSB0aGUg bW9kZSBsaW5lIGlzIGluCisgICAgICAgICAgICAgICBmaXhlZC1waXRjaCBmb250LCB3aGljaCBp dCB1c3VhbGx5IHdpbGwgYmUuICovCisgICAgICAgICAgICBpZiAoaSA8IGRlc2lyZWRfcm93LT51 c2VkW1RFWFRfQVJFQV0pCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpbnQgc3Rh cnRfeCA9IHgsIHN0YXJ0X2hwb3MgPSBpOworICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAq c3RhcnQgPSBkZXNpcmVkX2dseXBoOworICAgICAgICAgICAgICAgIGludCBjdXJyZW50X3ggPSB4 OworICAgICAgICAgICAgICAgIGJvb2wgc2tpcF9maXJzdF9wID0gIWNhbl9za2lwX3A7CisgICAg ICAgICAgICAgICAgLyogRmluZCB0aGUgbmV4dCBnbHlwaCB0aGF0J3MgZXF1YWwgYWdhaW4uICov CisgICAgICAgICAgICAgICAgd2hpbGUgKGkgPCBzdG9wCisgICAgICAgICAgICAgICAgICAgICAg ICYmIChza2lwX2ZpcnN0X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICFHTFlQSF9F UVVBTF9QIChkZXNpcmVkX2dseXBoLCBjdXJyZW50X2dseXBoKSkKKyAgICAgICAgICAgICAgICAg ICAgICAgJiYgeCA9PSBjdXJyZW50X3gpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgICAgIHggKz0gZGVzaXJlZF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAg ICAgICAgIGN1cnJlbnRfeCArPSBjdXJyZW50X2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAg ICAgICAgICAgICAgKytkZXNpcmVkX2dseXBoLCArK2N1cnJlbnRfZ2x5cGgsICsraTsKKyAgICAg ICAgICAgICAgICAgICAgc2tpcF9maXJzdF9wID0gMDsKKyAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgICBmb3IgKGludCBlbHQgPSAwOworICAgICAgICAgICAgICAgICAgICAgZWx0 IDwgYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZDsKKyAgICAgICAgICAgICAgICAgICAgICsrZWx0 KQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpbnQgeCA9IGFycmF5 X2dseXBoc19za2lwcGVkLnNraXBwZWRbZWx0XS54OworICAgICAgICAgICAgICAgICAgICBpbnQg aHBvcyA9IGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbZWx0XS5ocG9zOworICAgICAgICAg ICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnRhcmdldF9nbHlwaCA9CisgICAgICAgICAgICAgICAg ICAgICAgbWNfZ2V0X2N1cnNvcl9nbHlwaCAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93 LCBocG9zLCB2cG9zKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAg ICAgICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiU0tJUFBFRDogIHZwb3MgKCVkKSB8IGNo YXIgKCVkLyVzKSB8IHg6ICglZCkgfCBocG9zICglZC8lZClcbiIsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCB0YXJnZXRfZ2x5cGgtPnUuY2gsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAodGFyZ2V0 X2dseXBoLT51LmNoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHgs IGhwb3MsIHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKTsKKyAgICAgICAgICAgICAg ICAgICAgbWNfZHJhd19yb3cgKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0 X2dseXBoLCB4LCAxLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vy c29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBkcmF3X3AsIFNLSVBQRUQpOwor ICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChpID09IHN0YXJ0X2hwb3Mg fHwgeCAhPSBjdXJyZW50X3gpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICAgIGkgPSBzdGFydF9ocG9zOworICAgICAgICAgICAgICAgICAgICB4ID0gc3RhcnRfeDsKKyAg ICAgICAgICAgICAgICAgICAgZGVzaXJlZF9nbHlwaCA9IHN0YXJ0OworICAgICAgICAgICAgICAg ICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBvdXRwdXRf Y3Vyc29yX3RvICh3LCB2cG9zLCBzdGFydF9ocG9zLCBkZXNpcmVkX3Jvdy0+eSwgc3RhcnRfeCk7 CisgICAgICAgICAgICAgICAgLyogUmUtZHJhdyBhIHBvcnRpb24gb2YgdGhlIHJvdy4gKi8KKyAg ICAgICAgICAgICAgICBpZiAoZGVidWdfcCkKKyAgICAgICAgICAgICAgICAgIGZwcmludGYgKHN0 ZGVyciwgIlJFRFJBVyBTRUdNRU5UOlxuXAorICAgICAgICAgICAgICAgICAgICB2cG9zICglZCkg fCBjaGFyICglZC8lcykgfCB4OiAoJWQpIHwgaHBvcyAoJWQvJWQpIHwgbGVuZ3RoICglZClcbiIs CisgICAgICAgICAgICAgICAgICAgIHZwb3MsIHN0YXJ0LT51LmNoLCBtY19jaGFyX3RvX3N0cmlu ZyAoc3RhcnQtPnUuY2gpLAorICAgICAgICAgICAgICAgICAgICBzdGFydF94LCBzdGFydF9ocG9z LCB1cGRhdGVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSwgaSAtIHN0YXJ0X2hwb3MpOworICAg ICAgICAgICAgICAgIGJsb2NrX2lucHV0ICgpOworICAgICAgICAgICAgICAgIGludCBsZW4gPSBp IC0gc3RhcnRfaHBvczsKKyAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IHN0YXJ0IC0gdXBkYXRl ZF9yb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgICAgICAgIHctPm91dHB1dF9jdXJz b3IueCA9CisgICAgICAgICAgICAgICAgICBtY19kcmF3X2dseXBocyAodywgZGVzaXJlZF9tYXRy aXgsIHVwZGF0ZWRfcm93LCB3LT5tY19tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgdy0+b3V0cHV0X2N1cnNvci54LCBURVhUX0FSRUEsIGhwb3MsIGhwb3MgKyBsZW4s CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRFJBV19OT1JNQUxfVEVYVCwgMCwg dnBvcywgbHNsLCBnbHlwaF9mbGF2b3IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgY3Vyc29yX3R5cGUsIHdkLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGN1cnNvcl9nY19wLCBNQ19EUkFXX0dMWVBIX1NUUklORywgZHJh d19wKTsKKyAgICAgICAgICAgICAgICB3LT5vdXRwdXRfY3Vyc29yLmhwb3MgKz0gbGVuOworICAg ICAgICAgICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgICAgICAgbWNfZHJhd19y b3cgKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3Jvdywgc3RhcnQsIHN0YXJ0X3gsIGkgLSBz dGFydF9ocG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCBjdXJzb3JfbWF0 cml4LCBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGRyYXdfcCwgU0NSSUJFX1RXTyk7CisgICAg ICAgICAgICAgICAgY2hhbmdlZF9wID0gMTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0K KworICAgICAgICAvKiBXcml0ZSB0aGUgcmVzdC4gKi8KKyAgICAgICAgaWYgKGkgPCBkZXNpcmVk X3Jvdy0+dXNlZFtURVhUX0FSRUFdKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIG91dHB1dF9j dXJzb3JfdG8gKHcsIHZwb3MsIGksIGRlc2lyZWRfcm93LT55LCB4KTsKKyAgICAgICAgICAgIGlm IChkZWJ1Z19wKQorICAgICAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJEUkFXIFJFTUFJTkRF UiBPRiBUSEUgUk9XOlxuXAorICAgICAgICAgICAgICAgIHZwb3MgKCVkKSB8IGNoYXIgKCVkLyVz KSB8IHg6ICglZCkgfCBocG9zICglZC8lZCkgfCBsZW5ndGggKCVkKVxuIiwKKyAgICAgICAgICAg ICAgICB2cG9zLCBkZXNpcmVkX2dseXBoLT51LmNoLCBtY19jaGFyX3RvX3N0cmluZyAoZGVzaXJl ZF9nbHlwaC0+dS5jaCksCisgICAgICAgICAgICAgICAgeCwgaSwgZGVzaXJlZF9yb3ctPnVzZWRb VEVYVF9BUkVBXSAtIDEsIGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSBpKTsKKyAgICAg ICAgICAgIGJsb2NrX2lucHV0ICgpOworICAgICAgICAgICAgaW50IGxlbiA9IGRlc2lyZWRfcm93 LT51c2VkW1RFWFRfQVJFQV0gLSBpOworICAgICAgICAgICAgaW50IGhwb3MgPSBkZXNpcmVkX2ds eXBoIC0gdXBkYXRlZF9yb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgICAgdy0+b3V0 cHV0X2N1cnNvci54ID0KKyAgICAgICAgICAgICAgbWNfZHJhd19nbHlwaHMgKHcsIGRlc2lyZWRf bWF0cml4LCB1cGRhdGVkX3Jvdywgdy0+bWNfbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgdy0+b3V0cHV0X2N1cnNvci54LCBURVhUX0FSRUEsIGhwb3MsIGhwb3MgKyBsZW4s CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEUkFXX05PUk1BTF9URVhULCAwLCB2cG9z LCBsc2wsIGdseXBoX2ZsYXZvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNv cl90eXBlLCB3ZCwgZXNzZW50aWFscy5hY3RpdmVfcCwgY3Vyc29yX2djX3AsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBNQ19EUkFXX0dMWVBIX1NUUklORywgZHJhd19wKTsKKyAgICAg ICAgICAgIHctPm91dHB1dF9jdXJzb3IuaHB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c3RhcnQgPSBtY19nZXRfY3Vyc29yX2dseXBoICh3LCBkZXNpcmVkX21hdHJp eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHVwZGF0ZWRfcm93LCBocG9zLCB2cG9zKTsKKyAgICAgICAgICAgICAgaWYgKHctPm91dHB1 dF9jdXJzb3IueCA9PSB1cGRhdGVkX3Jvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAg eCAtPSBzdGFydC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgIGlmIChkZWJ1Z19wKQorICAg ICAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIlBPU1QtQ0hBTkdFRDogIHZwb3MgKCVkKSB8 IHggKCVkKSB8IGhwb3MgKCVkLyVkKSB8IGNoYXIgKCVkLyVzKVxuIiwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHZwb3MsIHgsIGhwb3MsIHVwZGF0ZWRfcm93LT51c2VkW1RFWFRf QVJFQV0gLSAxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQtPnUuY2gs IG1jX2NoYXJfdG9fc3RyaW5nIChzdGFydC0+dS5jaCkpOworICAgICAgICAgICAgICBtY19kcmF3 X3JvdyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCBzdGFydCwgeCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgIHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSBocG9zLCB2 cG9zLCBjdXJzb3JfbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFs cywgcm93X3Bvc2l0aW9uLCBkcmF3X3AsIFBPU1RfQ0hBTkdFRCk7CisgICAgICAgICAgICB9Cisg ICAgICAgICAgICAvKiBUaGVyZSB3ZXJlIG5vIGNoYW5nZXMgYW5kIGkgPT0gZGVzaXJlZF9yb3ct PnVzZWRbVEVYVF9BUkVBXSAqLworICAgICAgICAgICAgZWxzZSBpZiAoIWNoYW5nZWRfcCkKKyAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICAgICAg ICAgICAgZnByaW50ZiAoc3RkZXJyLCAiVU5DSEFOR0VEIC0tIFdSSVRFIEVOVElSRSBMSU5FOiAg dnBvcyAoJWQpIHwgcm93LT51c2VkICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHZwb3MsIHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKTsKKyAgICAg ICAgICAgICAgICBtY19kcmF3X3JvdyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCBk ZXNpcmVkX3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGRlc2lyZWRfcm93LT54LCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdLCB2cG9zLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCBy b3dfcG9zaXRpb24sIGRyYXdfcCwgVU5DSEFOR0VEKTsKKyAgICAgICAgICAgICAgfQorCisgICAg ICAgIC8qIE1heWJlIGNsZWFyIHRvIGVuZCBvZiBsaW5lLiAqLworICAgICAgICBpZiAoTUFUUklY X1JPV19FWFRFTkRTX0ZBQ0VfUCAoZGVzaXJlZF9yb3cpKQorICAgICAgICAgIHsKKyAgICAgICAg ICAgIC8qIElmIG5ldyByb3cgZXh0ZW5kcyB0byB0aGUgZW5kIG9mIHRoZSB0ZXh0IGFyZWEsIG5v dGhpbmcKKyAgICAgICAgICAgICAgIGhhcyB0byBiZSBjbGVhcmVkLCBpZiBhbmQgb25seSBpZiB3 ZSBkaWQgYSB3cml0ZV9nbHlwaHMKKyAgICAgICAgICAgICAgIGFib3ZlLiAgVGhpcyBpcyBtYWRl IHN1cmUgYnkgc2V0dGluZyBkZXNpcmVkX3N0b3BfcG9zCisgICAgICAgICAgICAgICBhcHByb3By aWF0ZWx5IGFib3ZlLiAqLworICAgICAgICAgICAgZWFzc2VydCAoaSA8IGRlc2lyZWRfcm93LT51 c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICAgIHx8ICgoZGVzaXJlZF9yb3ctPnVz ZWRbVEVYVF9BUkVBXSA9PSBjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdKQorICAgICAgICAg ICAgICAgICAgICAgICAgICYmIE1BVFJJWF9ST1dfRVhURU5EU19GQUNFX1AgKGN1cnJlbnRfcm93 KSkpOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmIChNQVRSSVhfUk9XX0VYVEVORFNf RkFDRV9QIChjdXJyZW50X3JvdykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIC8qIElm IG9sZCByb3cgZXh0ZW5kcyB0byB0aGUgZW5kIG9mIHRoZSB0ZXh0IGFyZWEsIGNsZWFyLiAqLwor ICAgICAgICAgICAgICBpZiAoaSA+PSBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdKQorICAg ICAgICAgICAgICAgIG91dHB1dF9jdXJzb3JfdG8gKHcsIHZwb3MsIGksIGRlc2lyZWRfcm93LT55 LCBkZXNpcmVkX3Jvdy0+cGl4ZWxfd2lkdGgpOworICAgICAgICAgICAgICBpZiAoZHJhd19wKQor ICAgICAgICAgICAgICAgIHJpZi0+Y2xlYXJfZW5kX29mX2xpbmUgKHcsIHVwZGF0ZWRfcm93LCBU RVhUX0FSRUEsIC0xKTsKKyAgICAgICAgICAgICAgY2xlYXJfdG9feCA9IC0xOworICAgICAgICAg ICAgICBjaGFuZ2VkX3AgPSAxOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAo ZGVzaXJlZF9yb3ctPnBpeGVsX3dpZHRoIDwgY3VycmVudF9yb3ctPnBpeGVsX3dpZHRoKQorICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogT3RoZXJ3aXNlIGNsZWFyIHRvIHRoZSBl bmQgb2YgdGhlIG9sZCByb3cuICBFdmVyeXRoaW5nCisgICAgICAgICAgICAgICAgICAgYWZ0ZXIg dGhhdCBwb3NpdGlvbiBzaG91bGQgYmUgY2xlYXIgYWxyZWFkeS4gKi8KKyAgICAgICAgICAgICAg ICBpbnQgeGxpbTsKKyAgICAgICAgICAgICAgICBpZiAoaSA+PSBkZXNpcmVkX3Jvdy0+dXNlZFtU RVhUX0FSRUFdKQorICAgICAgICAgICAgICAgICAgb3V0cHV0X2N1cnNvcl90byAodywgdnBvcywg aSwgZGVzaXJlZF9yb3ctPnksIGRlc2lyZWRfcm93LT5waXhlbF93aWR0aCk7CisgICAgICAgICAg ICAgICAgLyogSWYgY3Vyc29yIGlzIGRpc3BsYXllZCBhdCB0aGUgZW5kIG9mIHRoZSBsaW5lLCBt YWtlIHN1cmUKKyAgICAgICAgICAgICAgICAgICBpdCdzIGNsZWFyZWQuICBOb3dhZGF5cyB3ZSBk b24ndCBoYXZlIGEgcGh5c19jdXJzb3JfZ2x5cGgKKyAgICAgICAgICAgICAgICAgICB3aXRoIHdo aWNoIHRvIGVyYXNlIHRoZSBjdXJzb3IgKGJlY2F1c2UgdGhpcyBtZXRob2QKKyAgICAgICAgICAg ICAgICAgICBkb2Vzbid0IHdvcmsgd2l0aCBsYmVhcmluZy9yYmVhcmluZyksIHNvIHdlIG11c3Qg ZG8gaXQgdGhpcyB3YXkuICovCisgICAgICAgICAgICAgICAgaWYgKHZwb3MgPT0gdy0+cGh5c19j dXJzb3IudnBvcworICAgICAgICAgICAgICAgICAgICAmJiAoZGVzaXJlZF9yb3ctPnJldmVyc2Vk X3AKKyAgICAgICAgICAgICAgICAgICAgICAgID8gKHctPnBoeXNfY3Vyc29yLmhwb3MgPCAwKQor ICAgICAgICAgICAgICAgICAgICAgICAgOiAody0+cGh5c19jdXJzb3IuaHBvcyA+PSBkZXNpcmVk X3Jvdy0+dXNlZFtURVhUX0FSRUFdKSkpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgICAgIHctPnBoeXNfY3Vyc29yX29uX3AgPSAwOworICAgICAgICAgICAgICAgICAgICB4 bGltID0gLTE7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlCisg ICAgICAgICAgICAgICAgICAgIHhsaW0gPSBjdXJyZW50X3Jvdy0+cGl4ZWxfd2lkdGg7CisgICAg ICAgICAgICAgICAgaWYgKGRyYXdfcCkKKyAgICAgICAgICAgICAgICAgIHJpZi0+Y2xlYXJfZW5k X29mX2xpbmUgKHcsIHVwZGF0ZWRfcm93LCBURVhUX0FSRUEsIHhsaW0pOworICAgICAgICAgICAg ICAgIGNsZWFyX3RvX3ggPSB4bGltOworICAgICAgICAgICAgICAgIGNoYW5nZWRfcCA9IDE7Cisg ICAgICAgICAgICAgIH0KKworICAgICAgICBpZiAoY2hhbmdlZF9wCisgICAgICAgICAgICAmJiBj bGVhcl90b194ICE9IDApCisgICAgICAgICAgeworICAgICAgICAgICAgaW50IHRleHRfYXJlYV93 aWR0aCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAgICAgICAgICBzdHJ1 Y3QgbWNfUkdCIGRlYnVnX2ZnID0gey5yZWQgPSAwLjg2NywgLmdyZWVuID0gMC44NjcsIC5ibHVl ID0gMC44Njd9OworICAgICAgICAgICAgc3RydWN0IGdseXBoICp0YXJnZXRfZ2x5cGggPQorICAg ICAgICAgICAgICB1cGRhdGVkX3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyB1cGRhdGVkX3Jvdy0+ dXNlZFtURVhUX0FSRUFdIC0gMTsKKyAgICAgICAgICAgIC8qIGBtY19lbmdpbmUnIG9ubHkgZHJh d3MgYW4gTUNfR0xZUEggd2hlbiB4IDwgdXBkYXRlZF9yb3ctPnBpeGVsX3dpZHRoLgorICAgICAg ICAgICAgVGhlIGN1cnJlbnQgZGVzaWduIGluaGliaXRzIGRyYXdpbmcgb3ZlciBhbiBleGlzdGlu ZyBnbHlwaCBhdCB0aGUgZW5kIG9mIGEKKyAgICAgICAgICAgIHdvcmQtd3JhcHBlZCBsaW5lLiAg U2FpZCBnbHlwaCByZWNlaXZlcyBhIGZha2UgY3Vyc29yIGluIGVpdGhlciBvbmUgb2YgdGhlCisg ICAgICAgICAgICBwcmV2aW91cyBzZWN0aW9ucyBhYm92ZSwgYW5kIHNob3VsZCBub3QgYmUgb3Zl cndyaXR0ZW4gd2l0aCBhbm90aGVyIG9uZS4KKyAgICAgICAgICAgIFRoaXMgZGVzaWduIGlzIG5l ZWRlZCBiZWNhdXNlIGEgd29yZC13cmFwcGVkIGxpbmUgZG9lcyBub3QgcmVjZWl2ZSBhbiBleHRy YQorICAgICAgICAgICAgc3BhY2UgbGlrZSBub24td29yZC13cmFwcGVkIGxpbmVzIGRvLiAqLwor ICAgICAgICAgICAgaW50IHggPSB1cGRhdGVkX3Jvdy0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAg ICBpbnQgaHBvcyA9IHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxOworICAgICAgICAg ICAgaW50IHhfbGltaXQgPSAoY2xlYXJfdG9feCA9PSAtMSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgPyB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgOiBjbGVh cl90b194OworICAgICAgICAgICAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKHctPmNvbnRl bnRzKTsKKyAgICAgICAgICAgIGJvb2wgZmlsbF9jb2x1bW5fdHJ1bXBzX3AgPSAoIU5JTFAgKEJW QVIgKGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGZjX3Zpc2libGUpKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA9PSBlc3NlbnRpYWxz LmZjX3gpOworICAgICAgICAgICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAgICAgICAgICBmcHJp bnRmIChzdGRlcnIsICJtY191cGRhdGVfdGV4dF9hcmVhIChmbG9hdGluZyk6ICB2cG9zICglZCkg fCB4X2xpbWl0ICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdnBvcywg eF9saW1pdCk7CisgICAgICAgICAgICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAg ICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGZjX3Zpc2libGUpKQorICAgICAgICAgICAgICAg ICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgIHx8ICghZXNzZW50 aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIs IGZjX2luYWN0aXZlX3dpbmRvd3MpKSkpCisgICAgICAgICAgICAgICAgJiYgeCA8IHRleHRfYXJl YV93aWR0aAorICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSB4CisgICAgICAg ICAgICAgICAgJiYgdGFyZ2V0X2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAgICAmJiBkcmF3 X3ApCisgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRf cm93LCB0YXJnZXRfZ2x5cGgsIFRFWFRfQVJFQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICB4 LCB4X2xpbWl0LCB1cGRhdGVkX3Jvdy0+eSwgaHBvcywgdnBvcywgTUNfQkFSLCAxLAorICAgICAg ICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlv biwKKyAgICAgICAgICAgICAgICAgICAgICAgICBkZWJ1Z19wID8gZGVidWdfZmcgOiBlc3NlbnRp YWxzLmZjX2ZnW3Jvd19wb3NpdGlvbl0sCisgICAgICAgICAgICAgICAgICAgICAgICAgRklMTF9D T0xVTU4sIGRyYXdfcCwgTk9XSEVSRSwgTk9fQ0FDSEUpOworICAgICAgICAgICAgaWYgKEJVRkZF UlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjcm9z c2hhaXJzKSkKKyAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfaG9yaXpvbnRh bF9ydWxlcikpCisgICAgICAgICAgICAgICAgJiYgKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAg ICAgICAgICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAg ICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfaW5hY3RpdmVfd2luZG93cykpKSkKKyAgICAg ICAgICAgICAgICAmJiB4IDwgdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgJiYgdnBv cyA9PSB3LT5jdXJzb3IudnBvcworICAgICAgICAgICAgICAgICYmIHRhcmdldF9nbHlwaCAhPSBO VUxMCisgICAgICAgICAgICAgICAgJiYgZHJhd19wKQorICAgICAgICAgICAgICBtY19lbmdpbmUg KHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBoLCBURVhUX0FSRUEs CisgICAgICAgICAgICAgICAgICAgICAgICAgeCwgeF9saW1pdCwgdXBkYXRlZF9yb3ctPnksIGhw b3MsIHZwb3MsIE1DX0hCQVIsIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21h dHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAg IGRlYnVnX3AgPyBkZWJ1Z19mZyA6IGVzc2VudGlhbHMuY2hfZmdbcm93X3Bvc2l0aW9uXSwKKyAg ICAgICAgICAgICAgICAgICAgICAgICBIT1JJWk9OVEFMX1JVTEVSLCBkcmF3X3AsIE5PV0hFUkUs IE5PX0NBQ0hFKTsKKyAgICAgICAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAg ICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAg ICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAgICAg ICAmJiAoZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICB8fCAoIWVzc2Vu dGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChi LCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkpKQorICAgICAgICAgICAgICAgICYmICFmaWxsX2NvbHVt bl90cnVtcHNfcAorICAgICAgICAgICAgICAgICYmIHggPCB0ZXh0X2FyZWFfd2lkdGgKKyAgICAg ICAgICAgICAgICAmJiB2cG9zICE9IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICAgICAgJiYg dy0+Y3Vyc29yLnggPj0geAorICAgICAgICAgICAgICAgICYmIHRhcmdldF9nbHlwaCAhPSBOVUxM CisgICAgICAgICAgICAgICAgJiYgZHJhd19wKQorICAgICAgICAgICAgICBtY19lbmdpbmUgKHcs IGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBoLCBURVhUX0FSRUEsCisg ICAgICAgICAgICAgICAgICAgICAgICAgeCwgeF9saW1pdCwgdXBkYXRlZF9yb3ctPnksIGhwb3Ms IHZwb3MsIE1DX0JBUiwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml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5nZWRfcDsKK30KKwordm9pZAorbWNf dXBkYXRlX3dpbmRvd19lcmFzZSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IG1jX21hdHJpeCBv bGRfbWF0cml4KQoreworICBib29sIGRlYnVnX3AgPSBmYWxzZTsKKyAgYm9vbCBnb19vbmVfcCA9 IChvbGRfbWF0cml4LmN1cnNvcnNfdXNlZFtNQ19DQUNIRV0gPiAwCisgICAgICAgICAgICAgICAg ICAgfHwgb2xkX21hdHJpeC5jdXJzb3JzX3VzZWRbQ0hfQ0FDSEVdID4gMAorICAgICAgICAgICAg ICAgICAgIHx8IG9sZF9tYXRyaXguY3Vyc29yc191c2VkW0ZDX0NBQ0hFXSA+IDApOworICBib29s IGdvX3R3b19wID0gKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICYm ICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAg ICAgICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg ZmNfdmlzaWJsZSkpCisgICAgICAgICAgICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVG RkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkpOworICBib29sIHVwZGF0aW5nX2ZyYW1lX3Ag PSBmYWxzZTsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIGlmIChY RlJBTUUgKHctPmZyYW1lKSAhPSBmLT5tY191cGRhdGluZ19mcmFtZQorICAgICAgJiYgKGdvX29u ZV9wIHx8IGdvX3R3b19wKSkKKyAgICB7CisgICAgICB1cGRhdGluZ19mcmFtZV9wID0gdHJ1ZTsK KyAgICAgIHVwZGF0ZV9iZWdpbiAoZik7CisgICAgfQorICBpZiAody0+cGh5c19jdXJzb3Jfb25f cAorICAgICAgJiYgZ29fdHdvX3ApCisgICAgZXJhc2VfcGh5c19jdXJzb3IgKHcpOworICBmb3Ig KGludCB2bnRoID0gMDsKKyAgICAgICBnb19vbmVfcAorICAgICAgICYmIHZudGggPCB3LT5tY19t YXRyaXgudnBvc191c2VkOworICAgICAgICsrdm50aCkKKyAgICB7CisgICAgICBmb3IgKGVudW0g bWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7CisgICAgICAgICAgIGNhY2hlX3R5 cGUgPCBOT19DQUNIRTsKKyAgICAgICAgICAgKytjYWNoZV90eXBlKQorICAgICAgICBmb3IgKGlu dCBudGhfMCA9IDA7CisgICAgICAgICAgICAgbWNfdHJhdmVyc2VfY2FjaGVfcCAob2xkX21hdHJp eCwgY2FjaGVfdHlwZSwgdm50aCwgbnRoXzApOworICAgICAgICAgICAgICsrbnRoXzApCisgICAg ICAgICAgeworICAgICAgICAgICAgYm9vbCBzYW1lX3AgPSBmYWxzZTsKKyAgICAgICAgICAgIGZv ciAoaW50IHdfbnRoID0gMDsgd19udGggPCB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91 c2VkW2NhY2hlX3R5cGVdOyArK3dfbnRoKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAg ICAgc2FtZV9wIHw9IChvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XzBdLmdseXBoLnR5cGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnR5cGUKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmICgob2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8wXS5nbHlwaC5ieXRlcG9zCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRo XS5nbHlwaC5ieXRlcG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLnJvd19wb3NpdGlvbiA9 PSBBVF9aVgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0ucm93X3Bvc2l0aW9uID09IEFU X1pWKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChvbGRfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLnJvd19wb3NpdGlvbiA9PSBQT1NUX1pWCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5yb3dfcG9zaXRpb24gPT0gUE9TVF9aVikpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAoKG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGguY2hhcnBvcworICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3 X250aF0uZ2x5cGguY2hhcnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAo b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5yb3dfcG9zaXRp b24gPT0gQVRfWlYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWNf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLnJvd19wb3NpdGlvbiA9 PSBBVF9aVikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAob2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5yb3dfcG9zaXRpb24gPT0gUE9TVF9a VgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0ucm93X3Bvc2l0aW9uID09IFBPU1RfWlYp KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC51LnZhbAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250 aF0uZ2x5cGgudS52YWwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGguZmFjZV9pZAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVt3X250aF0uZ2x5cGguZmFjZV9pZAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlw aC5wYWRkaW5nX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnBhZGRpbmdfcAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8wXS5nbHlwaC5sZWZ0X2JveF9saW5lX3AKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b d19udGhdLmdseXBoLmxlZnRfYm94X2xpbmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5y aWdodF9ib3hfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5yaWdodF9ib3hf bGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnZvZmZzZXQKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bd19udGhdLmdseXBoLnZvZmZzZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9s ZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGgucGl4ZWxf d2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnBpeGVsX3dpZHRoCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXzBdLmdseXBoLnNsaWNlLmltZy54CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5n bHlwaC5zbGljZS5pbWcueAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5zbGljZS5pbWcueQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGguc2xpY2UuaW1nLnkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhfMF0uZ2x5cGguc2xpY2UuaW1nLndpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlw aC5zbGljZS5pbWcud2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGguc2xpY2UuaW1nLmhl aWdodAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGguc2xpY2UuaW1nLmhlaWdodAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8wXS5nbHlwaC5zbGljZS5jbXAuZnJvbQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3 X250aF0uZ2x5cGguc2xpY2UuY21wLmZyb20KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0ueAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVt3X250aF0ueAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5meAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVt3X250aF0uZngKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0ueQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3 X250aF0ueQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5meQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0u ZnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMF0uaHBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uaHBv cworICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8wXS52cG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS52cG9z CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzBdLndkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09 IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS53ZAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8wXS5oCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5oCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXzBdLmN1cnNvcl90eXBlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5jdXJzb3JfdHlw ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8wXS5jdXJzb3Jfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19u dGhdLmN1cnNvcl93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5mZy5yZWQKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bd19udGhdLmZnLnJlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5mZy5ncmVlbgorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVt3X250aF0uZmcuZ3JlZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZmcuYmx1ZQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVt3X250aF0uZmcuYmx1ZQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5iZy5y ZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmJnLnJlZAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5i Zy5ncmVlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uYmcuZ3JlZW4KKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhfMF0uYmcuYmx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uYmcuYmx1ZQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uYWN0aXZlX3AKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMF0uZ2x5cGhfZmxhdm9yCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5n bHlwaF9mbGF2b3IKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZW5hYmxlZF9wCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3dfbnRoXS5lbmFibGVkX3ApOworICAgICAgICAgICAgICAgIGlmIChzYW1lX3ApCisgICAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmIChkZWJ1Z19wKQorICAgICAg ICAgICAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIkhJVCAoJXMpOiAgdnBvcyAoJWQpIHwg aHBvcyAoJWQpIHwgY2hhciAoJXMpXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKGNhY2hlX3R5cGUgPT0gTUNfQ0FDSEUpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gIk1DIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOiAoY2FjaGVfdHlwZSA9PSBDSF9DQUNIRSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyAiQ0giCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IChjYWNoZV90eXBlID09IEZDX0NBQ0hFKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/ICJGQyIKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogIk5PIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS52cG9z LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmhwb3MsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAody0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnUuY2gpKTsKKyAgICAgICAg ICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19u dGhdLnNhbWVfcCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAg ICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoZGVidWdfcCkKKyAgICAgICAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGludCBvbGRfY2FjaGVfdXNlZCA9 IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdOworICAgICAgICAg ICAgICAgICAgICAgIGludCBuZXdfY2FjaGVfdXNlZCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlX3VzZWRbY2FjaGVfdHlwZV07CisgICAgICAgICAgICAgICAgICAgICAgZnByaW50ZiAo c3RkZXJyLCAiTUlTUyAoJXMpOiAgdnBvcyAoJWQpIHwgaHBvcyAoJWQgdi4gJWQpIHwgY2hhciAo JXMgdi4gJXMpIHwgY2FjaGVfdXNlZCAoJWQgdi4gJWQpXG4iLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgKGNhY2hlX3R5cGUgPT0gTUNfQ0FDSEUpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gIk1DIgorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiAoY2FjaGVfdHlwZSA9PSBDSF9DQUNIRSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAiQ0giCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IChjYWNoZV90eXBlID09IEZDX0NBQ0hFKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICJGQyIKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogIk5PIiwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W3dfbnRoXS52cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5ocG9zLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmhwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAob2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC51LmNoKSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nICh3LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgudS5jaCksCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBvbGRfY2FjaGVfdXNlZCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19jYWNoZV91c2VkKTsKKyAgICAgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoIXNhbWVfcCkKKyAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIGBtYXRyaXhfcm93JyBpbiBgZGlzcG5ldy5j YCBjb250YWlucyB0aGUgZm9sbG93aW5nIHRlc3RzLAorICAgICAgICAgICAgICAgIGVhc3NlcnQg KG1hdHJpeCAmJiBtYXRyaXgtPnJvd3MpOworICAgICAgICAgICAgICAgIGVhc3NlcnQgKHJvdyA+ PSAwICYmIHJvdyA8IG1hdHJpeC0+bnJvd3MpOyAqLworICAgICAgICAgICAgICAgIGJvb2wgYmFy Zl9jcmFzaF9vbmUgPSAody0+Y3VycmVudF9tYXRyaXggJiYgdy0+Y3VycmVudF9tYXRyaXgtPnJv d3MpID8gZmFsc2UgOiB0cnVlOworICAgICAgICAgICAgICAgIGlmIChiYXJmX2NyYXNoX29uZSkK KyAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIGJvb2wgYmFyZl9j cmFzaF90d28gPSAodm50aCA+PSAwICYmIHZudGggPCB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3Mp ID8gZmFsc2UgOiB0cnVlOworICAgICAgICAgICAgICAgIGlmIChiYXJmX2NyYXNoX3R3bykKKyAg ICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9y b3cgKnZudGhfcm93ID0gTUFUUklYX1JPVyAody0+Y3VycmVudF9tYXRyaXgsIHZudGgpOworICAg ICAgICAgICAgICAgIGludCB4XzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXzBdLng7CisgICAgICAgICAgICAgICAgaW50IGZ4XzAgPSBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZ4OworICAgICAgICAgICAgICAgIGlu dCB5XzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLnk7 CisgICAgICAgICAgICAgICAgaW50IGZ5XzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXzBdLmZ5OworICAgICAgICAgICAgICAgIGludCBocG9zXzAgPSBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmhwb3M7CisgICAgICAg ICAgICAgICAgaW50IHZwb3NfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMF0udnBvczsKKyAgICAgICAgICAgICAgICBpbnQgd2RfMCA9IG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90e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lXVtudGhfMF0uYmcuZ3JlZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAuYmx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhfMF0uYmcuYmx1ZX07CisgICAgICAgICAgICAgICAgYm9vbCBhY3RpdmVfcF8wID0gb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5hY3RpdmVfcDsKKyAgICAg ICAgICAgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3JfMCA9IG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGhfZmxhdm9yOworICAgICAgICAg ICAgICAgIGJvb2wgZW5hYmxlZF9wXzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzBdLmVuYWJsZWRfcDsKKyAgICAgICAgICAgICAgICBpZiAodnBvc18wID09 IHZudGgKKyAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yXzAgPT0gTUNfR0xZUEgK KyAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wXzAKKyAgICAgICAgICAgICAgICAgICAg JiYgdm50aF9yb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICAgICAgbWNfZXJhc2VfY3Vyc29yICh3LCB3LT5jdXJyZW50X21hdHJpeCwgdm50aF9yb3cs IG9sZF9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeF8wLCB5 XzAsIGhwb3NfMCwgdnBvc18wLCBnbHlwaF9mbGF2b3JfMCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZV8wLCB3ZF8wKTsKKyAgICAgICAgICAgICAgICAg ICAgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5lbmFibGVk X3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgLS1vbGRfbWF0cml4LmN1cnNvcnNfdXNl ZFtjYWNoZV90eXBlXTsKKyAgICAgICAgICAgICAgICAgICAgLyogSWYgd2UgaW5hZHZlcnRlbnRs eSBlcmFzZWQgYW5vdGhlciBmYWtlIGN1cnNvciBhdCB0aGUgc2FtZQorICAgICAgICAgICAgICAg ICAgICBIUE9TIHRoYXQgaXMgc3RpbGwgZW5hYmxlZF9wIGluIHRoZSBgb2xkX21hdHJpeGAsIHRo ZW4gcmVkcmF3IGl0LiAqLworICAgICAgICAgICAgICAgICAgICBmb3IgKGVudW0gbWNfY2FjaGVf dHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7CisgICAgICAgICAgICAgICAgICAgICAgICAgY2Fj aGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICAgICAgICAgICAgICAgICAgICsrY2FjaGVfdHlw ZSkKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBmb3Ig KGludCBudGhfMSA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX3RyYXZlcnNl X2NhY2hlX3AgKG9sZF9tYXRyaXgsIGNhY2hlX3R5cGUsIHZudGgsIG50aF8xKTsKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgKytudGhfMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB4XzEgPSBvbGRfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLng7CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgaW50IGZ4XzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXzFdLmZ4OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB5XzEgPSBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLnk7CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgaW50IGZ5XzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzFdLmZ5OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBocG9z XzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmhwb3M7 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHZwb3NfMSA9IG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0udnBvczsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICBpbnQgd2RfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMV0ud2Q7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGhfMSA9IG9s ZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uaDsKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlXzEgPSBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmN1cnNvcl90eXBl OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGhfMSA9IG9sZF9t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uY3Vyc29yX3dpZHRoOwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnXzEgPSB7LnJl ZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZmcucmVk LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg LmdyZWVuID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5m Zy5ncmVlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIC5ibHVlID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8xXS5mZy5ibHVlfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgc3RydWN0IG1j X1JHQiBsc2xfYmdfMSA9IHsucmVkID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8xXS5iZy5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gICAg ICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8xXS5iZy5ncmVlbiwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uYmcuYmx1ZX07CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgYm9vbCBhY3RpdmVfcF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8xXS5hY3RpdmVfcDsKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3JfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZ2x5cGhfZmxhdm9yOworICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGJvb2wgZW5hYmxlZF9wXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzFdLmVuYWJsZWRfcDsKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICBib29sIGdvX3BfMSA9IChocG9zXzAgPT0gaHBvc18xCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wXzEpOworICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGlmICghZ29fcF8xKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg Y29udGludWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCByZW1vdmVfcF8xID0g ZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWNfZHJhd19lcmFzZV9oeWJyaWQg KHcsIHctPmN1cnJlbnRfbWF0cml4LCB2bnRoX3JvdywgeF8xLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmeF8xLCB5XzEsIGZ5XzEsIGhwb3NfMSwg dnBvc18xLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICB3ZF8xLCBoXzEsIGN1cnNvcl90eXBlXzEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aF8xLCBsc2xfZmdfMSwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0aXZlX3BfMSwgZ2x5 cGhfZmxhdm9yXzEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHJlbW92ZV9wXzEpOworICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAg ZWxzZSBpZiAodnBvc18wID09IHZudGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGVu YWJsZWRfcF8wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB2bnRoX3Jvdy0+ZW5hYmxl ZF9wKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgYm9vbCBy ZW1vdmVfcF8wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICBtY19kcmF3X2VyYXNlX2h5 YnJpZCAodywgdy0+Y3VycmVudF9tYXRyaXgsIHZudGhfcm93LCB4XzAsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ4XzAsIHlfMCwgZnlfMCwgaHBvc18wLCB2 cG9zXzAsIHdkXzAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGhfMCwgY3Vyc29yX3R5cGVfMCwgY3Vyc29yX3dpZHRoXzAsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGxzbF9iZ18wLCBhY3RpdmVfcF8wLCBnbHlwaF9mbGF2 b3JfMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3Zl X3BfMCk7CisgICAgICAgICAgICAgICAgICAgICAgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF8wXS5lbmFibGVkX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAg ICAgICAtLW9sZF9tYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5cGVdOworICAgICAgICAgICAg ICAgICAgICAgIC8qIElmIHdlIGluYWR2ZXJ0ZW50bHkgZXJhc2VkIGFub3RoZXIgZmFrZSBjdXJz b3IgYXQgdGhlIHNhbWUKKyAgICAgICAgICAgICAgICAgICAgICBIUE9TIHRoYXQgaXMgc3RpbGwg ZW5hYmxlZF9wIGluIHRoZSBgb2xkX21hdHJpeGAsIHRoZW4gcmVkcmF3IGl0LiAqLworICAgICAg ICAgICAgICAgICAgICAgIGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19D QUNIRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUgPCBOT19DQUNIRTsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICsrY2FjaGVfdHlwZSkKKyAgICAgICAgICAgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgbnRoXzIgPSAw OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX3RyYXZlcnNlX2NhY2hlX3AgKG9s ZF9tYXRyaXgsIGNhY2hlX3R5cGUsIHZudGgsIG50aF8yKTsKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICArK250aF8yKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGludCB4XzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLng7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBpbnQgZnhfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhf Ml0uZng7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgeV8yID0gb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS55OworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgaW50IGZ5XzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzJdLmZ5OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGhw b3NfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uaHBv czsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB2cG9zXzIgPSBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLnZwb3M7CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBpbnQgd2RfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMl0ud2Q7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQg aF8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5oOwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3Jf dHlwZV8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5j dXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjdXJzb3Jfd2lk dGhfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uY3Vy c29yX3dpZHRoOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBs c2xfZmdfMiA9IHsucmVkID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF8yXS5mZy5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIC5ncmVlbiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMl0uZmcuZ3JlZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8yXS5mZy5ibHVlfTsKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIC8vICBzdHJ1Y3QgbWNfUkdCIGxzbF9iZ18yID0gey5yZWQgPSBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmJnLnJlZCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IG9s ZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uYmcuZ3JlZW4sCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAuYmx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0u YmcuYmx1ZX07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGFjdGl2ZV9wXzIg PSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmFjdGl2ZV9w OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxh dm9yXzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmds eXBoX2ZsYXZvcjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgZW5hYmxlZF9w XzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmVuYWJs ZWRfcDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgZ29fcF8yID0gKGhwb3Nf MCA9PSBocG9zXzIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIGZ4XzAgPD0gZnhfMgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgZnhfMCArIHdkXzAgPiBmeF8yICsgd2RfMgorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wXzIpOworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgaWYgKCFnb19wXzIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCByZW1vdmVf cF8yID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtY19kcmF3X2VyYXNl X2h5YnJpZCAodywgdy0+Y3VycmVudF9tYXRyaXgsIHZudGhfcm93LCB4XzIsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnhfMiwgeV8yLCBmeV8y LCBocG9zXzIsIHZwb3NfMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICB3ZF8yLCBoXzIsIGN1cnNvcl90eXBlXzIsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoXzIsIGxzbF9m Z18yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGFjdGl2ZV9wXzIsIGdseXBoX2ZsYXZvcl8yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZV9wXzIpOworICAgICAgICAgICAgICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAg ICAgfQorICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgfQorICBpZiAodXBkYXRp bmdfZnJhbWVfcCkKKyAgICB1cGRhdGVfZW5kIChmKTsKK30KKwordm9pZAorbWNfdXBkYXRlX3dp bmRvd19kcnlydW4gKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgZm9yY2VfcCwgc3RydWN0IG1jX2Vz c2VudGlhbHMgZXNzZW50aWFscykKK3sKKyAgaWYgKCFCVUZGRVJQICh3LT5jb250ZW50cykpCisg ICAgcmV0dXJuOworCisgIGlmICh3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW01DX0NBQ0hFXSA9 PSAwCisgICAgICAmJiB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0NIX0NBQ0hFXSA9PSAwCisg ICAgICAmJiB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0ZDX0NBQ0hFXSA9PSAwCisgICAgICAm JiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAgJiYg TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICYm IE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpKQorICAgIHJl dHVybjsKKworICAvLyBjbG9ja190IGNsb2NrX3N0YXJ0ID0gY2xvY2soKTsKKworICBib29sIGRy YXdfcCA9IGZhbHNlOworCisgIHN0cnVjdCBnbHlwaF9tYXRyaXggKnNhdmVkX2Rlc2lyZWQgPSBt Y19zYXZlX2dseXBoX21hdHJpeCAody0+ZGVzaXJlZF9tYXRyaXgpOworICBzdHJ1Y3QgZ2x5cGhf bWF0cml4ICpzYXZlZF9jdXJyZW50ID0gbWNfc2F2ZV9nbHlwaF9tYXRyaXggKHctPmN1cnJlbnRf bWF0cml4KTsKKworICBzdHJ1Y3QgbWNfbWF0cml4IG9sZF9tYXRyaXgg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ICAgICAvLyAgc3RydWN0IHJlZGlzcGxheV9pbnRlcmZhY2UgKnJpZiA9IEZSQU1F X1JJRiAoWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKSk7CisgICAgICAvLyAgcmlmLT51cGRhdGVf d2luZG93X2JlZ2luX2hvb2sgKHcpOworICAgICAgaW50IHliID0gd2luZG93X3RleHRfYm90dG9t X3kgKHcpOworICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93ID0gTUFUUklYX1JPVyAoZGVzaXJl ZF9tYXRyaXgsIDApOworICAgICAgc3RydWN0IGdseXBoX3JvdyAqZW5kID0gTUFUUklYX01PREVf TElORV9ST1cgKGRlc2lyZWRfbWF0cml4KTsKKworICAgICAgLyogVGFrZSBub3RlIG9mIHRoZSBo ZWFkZXIgbGluZSwgaWYgdGhlcmUgaXMgb25lLiAgV2Ugd2lsbAorICAgICAgICAgdXBkYXRlIGl0 IGJlbG93LCBhZnRlciB1cGRhdGluZyBhbGwgb2YgdGhlIHdpbmRvdydzIGxpbmVzLiAqLworICAg ICAgaWYgKHJvdy0+bW9kZV9saW5lX3ApCisgICAgICAgIHsKKyAgICAgICAgICBoZWFkZXJfbGlu ZV9yb3cgPSByb3c7CisgICAgICAgICAgKytyb3c7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQor ICAgICAgICAgIGhlYWRlcl9saW5lX3JvdyA9IE5VTEw7CisKKyAgICAgIC8qIFVwZGF0ZSB0aGUg bW9kZSBsaW5lLCBpZiBuZWNlc3NhcnkuICovCisgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICptb2Rl X2xpbmVfcm93ID0gTUFUUklYX01PREVfTElORV9ST1cgKGRlc2lyZWRfbWF0cml4KTsKKyAgICAg IGlmIChtb2RlX2xpbmVfcm93LT5tb2RlX2xpbmVfcCAmJiBtb2RlX2xpbmVfcm93LT5lbmFibGVk X3ApCisgICAgICAgIHsKKyAgICAgICAgICBtb2RlX2xpbmVfcm93LT55ID0geWIgKyBXSU5ET1df U0NST0xMX0JBUl9BUkVBX0hFSUdIVCAodyk7CisgICAgICAgICAgdXBkYXRlX3dpbmRvd19saW5l ICh3LCBNQVRSSVhfUk9XX1ZQT1MgKG1vZGVfbGluZV9yb3csCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2lyZWRfbWF0cml4KSwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICZtb3VzZV9mYWNlX292ZXJ3cml0dGVuX3ApOworICAgICAg ICB9CisKKyAgICAgIC8qIEZpbmQgZmlyc3QgZW5hYmxlZCByb3cuICBPcHRpbWl6YXRpb25zIGlu IHJlZGlzcGxheV9pbnRlcm5hbAorICAgICAgICAgbWF5IGxlYWQgdG8gYW4gdXBkYXRlIHdpdGgg b25seSBvbmUgcm93IGVuYWJsZWQuICBUaGVyZSBtYXkKKyAgICAgICAgIGJlIGFsc28gY29tcGxl dGVseSBlbXB0eSBtYXRyaWNlcy4gKi8KKyAgICAgIHdoaWxlIChyb3cgPCBlbmQgJiYgIXJvdy0+ ZW5hYmxlZF9wKQorICAgICAgICArK3JvdzsKKworICAgICAgLyogVHJ5IHJldXNpbmcgcGFydCBv ZiB0aGUgZGlzcGxheSBieSBjb3B5aW5nLiAqLworICAgICAgaWYgKHJvdyA8IGVuZCAmJiAhdy0+ ZGVzaXJlZF9tYXRyaXgtPm5vX3Njcm9sbGluZ19wKQorICAgICAgICB7CisgICAgICAgICAgaW50 IHJjID0gbWNfc2Nyb2xsaW5nX3dpbmRvdyAodywgaGVhZGVyX2xpbmVfcm93ICE9IE5VTEwpOwor ICAgICAgICAgIGlmIChyYyA8IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIC8qIEFs bCByb3dzIHdlcmUgZm91bmQgdG8gYmUgZXF1YWwuICovCisgICAgICAgICAgICAgIHBhdXNlZF9w ID0gMDsKKyAgICAgICAgICAgICAgZ290byBzZXRfY3Vyc29yOworICAgICAgICAgICAgfQorICAg ICAgICAgICA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wgZW5kICYmIChmb3JjZV9wIHx8ICFp bnB1dF9wZW5kaW5nKTsKKyAgICAgICAgICAgKyttY19yb3cpCisgICAgICAgIHsKKyAgICAgICAg ICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAobWNfcm93LCB3LT5kZXNpcmVkX21hdHJpeCk7 CisgICAgICAgICAgaWYgKG1jX3Jvdy0+ZW5hYmxlZF9wCisgICAgICAgICAgICAgICYmIHZwb3Mg PT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGN1cnNvcl9t YXRyaXggPSB3LT5kZXNpcmVkX21hdHJpeDsKKyAgICAgICAgICAgICAgaWYgKCFmb3JjZV9wICYm ICsrbl91cGRhdGVkICUgcHJlZW1wdF9jb3VudCA9PSAwKQorICAgICAgICAgICAgICAgIGRldGVj dF9pbnB1dF9wZW5kaW5nX2lnbm9yZV9zcXVlZXphYmxlcyAoKTsKKyAgICAgICAgICAgICAgY2hh bmdlZF9wIHw9IG1jX3VwZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywgJm1vdXNlX2ZhY2Vfb3Zl cndyaXR0ZW5fcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgZHJhd19wKTsKKyAgICAgICAgICAgICAg aWYgKE1BVFJJWF9ST1dfQk9UVE9NX1kgKHJvdykgPj0geWIpCisgICAgICAgICAgICAgICAgZm9y IChpbnQgaSA9IHZwb3MgKyAxOyBpIDwgdy0+Y3VycmVudF9tYXRyaXgtPm5yb3dzIC0gMTsgKytp KQorICAgICAgICAgICAgICAgICAgU0VUX01BVFJJWF9ST1dfRU5BQkxFRF9QICh3LT5jdXJyZW50 X21hdHJpeCwgaSwgZmFsc2UpOworICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0K KyAgICAgICAgfQorICAgICAgY3Vyc29yX21hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworICAg ICAgLyogVXBkYXRlIHRoZSByZXN0IG9mIHRoZSBsaW5lcy4gKi8KKyAgICAgIGZvciAoOyByb3cg PCBlbmQgJiYgKGZvcmNlX3AgfHwgIWlucHV0X3BlbmRpbmcpOyArK3JvdykKKyAgICAgICAgLyog c2Nyb2xsaW5nX3dpbmRvdyByZXNldHMgdGhlIGVuYWJsZWRfcCBmbGFnIG9mIHRoZSByb3dzIGl0 IHJldXNlcyBmcm9tCisgICAgICAgIGN1cnJlbnRfbWF0cml4LiAqLworICAgICAgICBpZiAocm93 LT5lbmFibGVkX3ApCisgICAgICAgICAgeworICAgICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhf Uk9XX1ZQT1MgKHJvdywgdy0+ZGVzaXJlZF9tYXRyaXgpOworICAgICAgICAgICAgLyogSWYgdGhl IGBjdXJzb3Jfcm93YCBpcyB3aXRoaW4gdGhlIGBkZXNpcmVkX21hdHJpeGAsIHRoZW4gaXQgd2Fz CisgICAgICAgICAgICBwcm9jZXNzZWQgaGVyZWluYWJvdmUgYW5kIHNob3VsZCBiZSBza2lwcGVk IGF0IHRoaXMgdGltZS4gKi8KKyAgICAgICAgICAgIGlmICh2cG9zID09IHctPmN1cnNvci52cG9z KQorICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICBpbnQgaTsKKyAgICAgICAgICAg IC8qIFdlJ2xsIGhhdmUgdG8gcGxheSBhIGxpdHRsZSBiaXQgd2l0aCB3aGVuIHRvCisgICAgICAg ICAgICAgICBkZXRlY3RfaW5wdXRfcGVuZGluZy4gIElmIGl0J3MgZG9uZSB0b28gb2Z0ZW4sCisg ICAgICAgICAgICAgICBzY3JvbGxpbmcgbGFyZ2Ugd2luZG93cyB3aXRoIHJlcGVhdGVkIHNjcm9s bC11cAorICAgICAgICAgICAgICAgY29tbWFuZHMgd2lsbCB0b28gcXVpY2tseSBwYXVzZSByZWRp c3BsYXkuICovCisgICAgICAgICAgICBpZiAoIWZvcmNlX3AgJiYgKytuX3VwZGF0ZWQgJSBwcmVl bXB0X2NvdW50ID09IDApCisgICAgICAgICAgICAgIGRldGVjdF9pbnB1dF9wZW5kaW5nX2lnbm9y ZV9zcXVlZXphYmxlcyAoKTsKKyAgICAgICAgICAgIGNoYW5nZWRfcCB8PSBtY191cGRhdGVfd2lu ZG93X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3cml0dGVuX3AsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBlc3Nl bnRpYWxzLCBkcmF3X3ApOworICAgICAgICAgICAgLyogTWFyayBhbGwgcm93cyBiZWxvdyB0aGUg bGFzdCB2aXNpYmxlIG9uZSBpbiB0aGUgY3VycmVudAorICAgICAgICAgICAgICAgbWF0cml4IGFz IGludmFsaWQuICBUaGlzIGlzIG5lY2Vzc2FyeSBiZWNhdXNlIG9mCisgICAgICAgICAgICAgICB2 YXJpYWJsZSBsaW5lIGhlaWdodHMuICBDb25zaWRlciB0aGUgY2FzZSBvZiB0aHJlZQorICAgICAg ICAgICAgICAgc3VjY2Vzc2l2ZSByZWRpc3BsYXlzLCB3aGVyZSB0aGUgZmlyc3QgZGlzcGxheXMg NQorICAgICAgICAgICAgICAgbGluZXMsIHRoZSBzZWNvbmQgMyBsaW5lcywgYW5kIHRoZSB0aGly ZCA1IGxpbmVzIGFnYWluLgorICAgICAgICAgICAgICAgSWYgdGhlIHNlY29uZCByZWRpc3BsYXkg d291bGRuJ3QgbWFyayByb3dzIGluIHRoZQorICAgICAgICAgICAgICAgY3VycmVudCBtYXRyaXgg aW52YWxpZCwgdGhlIHRoaXJkIHJlZGlzcGxheSBtaWdodCBiZQorICAgICAgICAgICAgICAgdGVt cHRlZCB0byBvcHRpbWl6ZSByZWRpc3BsYXkgYmFzZWQgb24gbGluZXMgZGlzcGxheWVkCisgICAg ICAgICAgICAgICBpbiB0aGUgZmlyc3QgcmVk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lX3AgfHwgIWlu cHV0X3BlbmRpbmcpCisgICAgICAgICAgIC8qIFczMiBFbWFjcyBjcmFzaGVzIG9uIHN0YXJ0dXAg d2l0aG91dCBhIEJVRkZFUlAgY2hlY2suICovCisgICAgICAgICAgICYmIEJVRkZFUlAgKHctPmNv bnRlbnRzKQorICAgICAgICAgICAmJiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgbWNfY29uZikpCisgICAgICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKSk7CisgICAgICAgICAgICsrZGVzaXJl ZF9yb3cpCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAo ZGVzaXJlZF9yb3csIHctPmRlc2lyZWRfbWF0cml4KTsKKyAgICAgICAgICBpZiAoZGVzaXJlZF9y b3ctPmVuYWJsZWRfcCkKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgIHN0cnVjdCBn bHlwaF9yb3cgKmN1cnJlbnRfcm93ID0gTUFUUklYX1JPVyAody0+Y3VycmVudF9tYXRyaXgsIHZw b3MpOworICAgICAgICAgIGVudW0gbWNfcm93X3Bvc2l0aW9uIHJvd19wb3NpdGlvbiA9IG1jX3Jv d19wb3NpdGlvbiAodywgY3VycmVudF9yb3csIGN1cnJlbnRfcm93LCB2cG9zKTsKKyAgICAgICAg ICBpZiAoY3VycmVudF9yb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgICAgIG1jX2RyYXdfcm93ICh3 LCB3LT5jdXJyZW50X21hdHJpeCwgY3VycmVudF9yb3csIGN1cnJlbnRfcm93LT5nbHlwaHNbVEVY VF9BUkVBXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50X3Jvdy0+eCwgY3VycmVu dF9yb3ctPnVzZWRbVEVYVF9BUkVBXSwgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICBj dXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGRyYXdfcCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICBTRVRfQ1VSU09SX09ORSk7CisgICAgICAgIH0KKworICAgICAgbWNf cmVzdG9yZV9nbHlwaF9tYXRyaXggKHNhdmVkX2Rlc2lyZWQsIHctPmRlc2lyZWRfbWF0cml4KTsK KyAgICAgIG1jX3Jlc3RvcmVfZ2x5cGhfbWF0cml4IChzYXZlZF9jdXJyZW50LCB3LT5jdXJyZW50 X21hdHJpeCk7CisKKyAgICAgIG1jX3VwZGF0ZV93aW5kb3dfZXJhc2UgKHcsIG9sZF9tYXRyaXgp OworCisgICAgICBtY194ZnJlZV9jYWNoZV9tYXRyaXggKHcsICZvbGRfbWF0cml4KTsKKworICAg IH0KKyAgLy8gY2xvY2tfdCBjbG9ja19lbmQgPSBjbG9jaygpOworICAvLyBkb3VibGUgY3B1X3Rp bWVfdXNlZCA9ICgoZG91YmxlKSAoY2xvY2tfZW5kIC0gY2xvY2tfc3RhcnQpKSAvIENMT0NLU19Q RVJfU0VDOworICAvLyBmcHJpbnRmIChzdGRlcnIsICJtY19zY3JvbGxpbmdfd2luZG93ICglcyk6 ICBUSU1FICglZilcbiIsIG1jX3dpbmRvdyAodyksIGNwdV90aW1lX3VzZWQpOworfQorCisvKiBl bmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogLyog U3RydWN0dXJlIHRvIHBhc3MgZGltZW5zaW9ucyBhcm91bmQuICBVc2VkIGZvciBjaGFyYWN0ZXIg Ym91bmRpbmcKICAgIGJveGVzLCBnbHlwaCBtYXRyaXggZGltZW5zaW9ucyBhbmQgYWxpa2UuICAq LwogCkBAIC0yMjQxLDYgKzQwMTcsMTYgQEAgZnJlZV93aW5kb3dfbWF0cmljZXMgKHN0cnVjdCB3 aW5kb3cgKncpCiAJICBmcmVlX2dseXBoX21hdHJpeCAody0+Y3VycmVudF9tYXRyaXgpOwogCSAg ZnJlZV9nbHlwaF9tYXRyaXggKHctPmRlc2lyZWRfbWF0cml4KTsKIAkgIHctPmN1cnJlbnRfbWF0 cml4ID0gdy0+ZGVzaXJlZF9tYXRyaXggPSBOVUxMOworCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIG1jX3hmcmVlX2NhY2hlX21hdHJpeCAo dywgJnctPm1jX21hdHJpeCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAl9CiAK ICAgICAgIC8qIE5leHQgd2luZG93IG9uIHNhbWUgbGV2ZWwuICAqLwpAQCAtMzM4Nyw2ICs1MTcz LDI2IEBAIGNoZWNrX2N1cnJlbnRfbWF0cml4X2ZsYWdzIChzdHJ1Y3Qgd2luZG93ICp3KQogc3Rh dGljIGJvb2wKIHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkK IHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8K KworICBpZiAobWNfc3RkZXJyX3ApCisgICAgZnByaW50ZiAoc3RkZXJyLCAidXBkYXRlX3dpbmRv dyAoJXMpXG4iLCBtY193aW5kb3cgKHcpKTsKKworICBzdHJ1Y3QgbWNfZXNzZW50aWFscyBlc3Nl bnRpYWxzOworICBtY19zZXRfZXNzZW50aWFscyAodywgJmVzc2VudGlhbHMpOworCisgIG1jX3Vw ZGF0ZV93aW5kb3dfZHJ5cnVuICh3LCBmb3JjZV9wLCBlc3NlbnRpYWxzKTsKKworICBzdHJ1Y3Qg Z2x5cGhfbWF0cml4ICpjdXJzb3JfbWF0cml4ID0gTlVMTDsKKworICBib29sIGRyYXdfcCA9IHRy dWU7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgc3RydWN0IGdseXBoX21hdHJp eCAqZGVzaXJlZF9tYXRyaXggPSB3LT5kZXNpcmVkX21hdHJpeDsKICAgYm9vbCBwYXVzZWRfcDsK ICAgaW50IHByZWVtcHRfY291bnQgPSBjbGlwX3RvX2JvdW5kcyAoMSwgYmF1ZF9yYXRlIC8gMjQw MCArIDEsIElOVF9NQVgpOwpAQCAtMzQ2NCw2ICs1MjcwLDQ3IEBAIHVwZGF0ZV93aW5kb3cgKHN0 cnVjdCB3aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkKIAkgICAgfQogCX0KIAorCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAvKiBQcm9jZXNzIHRo ZSBjdXJzb3Igcm93IGF0IHRoZSBvdXRzZXQgaWYgaXQgaXMgd2l0aGluIGBkZXNpcmVkX21hdHJp eGAuCisgIFdoZW4gcHJvY2Vzc2luZyBhbGwgb3RoZXIgcm93cywgd2Ugd2lsbCBxdWVyeSB0aGUg YHctPmN1cnJlbnRfbWF0cml4YCBmb3IgZGF0YQorICByZWxhdGluZyB0byB0aGUgY3Vyc29yIHJv dy4gIGBtYWtlX2N1cnJlbnRgICh3aXRoaW4gYHVwZGF0Z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ICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAhIE5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpKSkKKyAgICAgICAg ICAgICAgICAgICAgICAgPyBtY191cGRhdGVfd2luZG93X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9m YWNlX292ZXJ3cml0dGVuX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCBkcmF3X3ApCisgICAgICAgICAg ICAgICAgICAgICAgIDogdXBkYXRlX3dpbmRvd19saW5lICh3LCB2cG9zLCAmbW91c2VfZmFjZV9v dmVyd3JpdHRlbl9wKTsKKyAgICAgICAgICBpZiAoTUFUUklYX1JPV19CT1RUT01fWSAocm93KSA+ PSB5YikKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSB2cG9zICsgMTsgaSA8IHctPmN1cnJlbnRf bWF0cml4LT5ucm93cyAtIDE7ICsraSkKKyAgICAgICAgICAgICAgU0VUX01BVFJJWF9ST1dfRU5B QkxFRF9QICh3LT5jdXJyZW50X21hdHJpeCwgaSwgZmFsc2UpOworICAgICAgICAgIGJyZWFrOwor ICAgICAgICB9CisgICAgfQorCisgIGN1cnNvcl9tYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgLyogVXBkYXRlIHRoZSByZXN0 IG9mIHRoZSBsaW5lcy4gICovCiAgICAgICBmb3IgKDsgcm93IDwgZW5kICYmIChmb3JjZV9wIHx8 ICFpbnB1dF9wZW5kaW5nKTsgKytyb3cpCiAJLyogc2Nyb2xsaW5nX3dpbmRvdyByZXNldHMgdGhl IGVuYWJsZWRfcCBmbGFnIG9mIHRoZSByb3dzIGl0CkBAIC0zNDcxLDYgKzUzMTgsMTkgQEAgdXBk YXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wKQogCWlmIChyb3ctPmVu YWJsZWRfcCkKIAkgIHsKIAkgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgZGVz aXJlZF9tYXRyaXgpOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUt Q1VSU09SUyAqLworCisgICAgICAgICAgLyogSWYgdGhlIGBjdXJzb3Jfcm93YCBpcyB3aXRoaW4g dGhlIGBkZXNpcmVkX21hdHJpeGAsIHRoZW4gaXQgd2FzCisgICAgICAgICAgcHJvY2Vzc2VkIGhl cmVpbmFib3ZlIGFuZCBzaG91bGQgYmUgc2tpcHBlZCBhdCB0aGlzIHRpbWUuICovCisgICAgICAg ICAgaWYgKHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgY29udGludWU7CisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgICAgaW50IGk7CiAKIAkgICAgLyogV2UnbGwg aGF2ZSB0byBwbGF5IGEgbGl0dGxlIGJpdCB3aXRoIHdoZW4gdG8KQEAgLTM0NzksOCArNTMzOSwy MSBAQCB1cGRhdGVfd2luZG93IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3ApCiAJICAg ICAgIGNvbW1hbmRzIHdpbGwgdG9vIHF1aWNrbHkgcGF1c2UgcmVkaXNwbGF5LiAgKi8KIAkgICAg aWYgKCFmb3JjZV9wICYmICsrbl91cGRhdGVkICUgcHJlZW1wdF9jb3VudCA9PSAwKQogCSAgICAg IGRldGVjdF9pbnB1dF9wZW5kaW5nX2lnbm9yZV9zcXVlZXphYmxlcyAoKTsKLQkgICAgY2hhbmdl ZF9wIHw9IHVwZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywKLQkJCQkJICAgICAmbW91c2VfZmFj ZV9vdmVyd3JpdHRlbl9wKTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJ UExFLUNVUlNPUlMgKi8KKworICAgICAgICAgIGNoYW5nZWRfcCB8PSAoQlVGRkVSUCAody0+Y29u dGVudHMpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIg KHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwg IU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgfHwgISBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIGZjX3Zpc2libGUpKSkpCisgICAgICAgICAgICAgICAgICAgICAgID8gbWNfdXBkYXRlX3dp bmRvd19saW5lICh3LCB2cG9zLCAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNz ZW50aWFscywgZHJhd19wKQorICAgICAgICAgICAgICAgICAgICAgICA6IHVwZGF0ZV93aW5kb3df bGluZSAodywgdnBvcywgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCk7CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCiAKIAkgICAgLyogTWFyayBhbGwgcm93cyBiZWxvdyB0aGUgbGFzdCB2 aXNpYmxlIG9uZSBpbiB0aGUgY3VycmVudAogCSAgICAgICBtYXRyaXggYXMgaW52YWxpZC4gIFRo aXMgaXMgbmVjZXNzYXJ5IGJlY2F1c2Ugb2YKQEAgLTM1MDEsNiArNTM3NCw0MSBAQCB1cGRhdGVf d2luZG93IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3ApCiAKICAgICBzZXRfY3Vyc29y OgogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLwor CisgIC8qIElmIHdlIGp1bXBlZCBoZXJlIGZyb20gYHNldF9jdXJzb3JgLCB0aGVuIHNldCB0aGUg YGN1cnNvcl9tYXRyaXhgLiAqLworICBpZiAoY3Vyc29yX21hdHJpeCA9PSBOVUxMKQorICAgIGN1 cnNvcl9tYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKworICAvKiBSZXNldCBgcm93YCB0byAw IHNvIHRoYXQgZmFrZSBjdXJzb3JzIGNhbiBiZSBkcmF3biBvbiByb3dzIHByZWNlZGluZyB0aGUK KyAgZmlyc3QgYHJvdy0+ZW5hYmxlZF9wYC4gIEp1c3QgcHJpb3IgdG8gdGhlIGNhbGwgdG8gYHNj cm9sbGluZ193aW5kb3cnIGFib3ZlLAorICBgcm93YCB3YXMgYWR2YW5jZWQgdG8gdGhlIGZpcnN0 IGByb3ctPmVuYWJsZWRfcGAuICovCisgIGZvciAoc3RydWN0IGdseXBoX3JvdyAqZGVzaXJlZF9y b3cgPSBNQVRSSVhfUk9XIChkZXNpcmVkX21hdHJpeCwgMCk7CisgICAgICAgZGVzaXJlZF9yb3cg PCBlbmQKKyAgICAgICAmJiAoZm9yY2VfcCB8fCAhaW5wdXRfcGVuZGluZykKKyAgICAgICAvKiBX MzIgRW1hY3MgY3Jhc2hlcyBvbiBzdGFydHVwIHdpdGhvdXQgYSBCVUZGRVJQIGNoZWNrLiAqLwor ICAgICAgICYmIEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICYmICghTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAgICAgICAgfHwgIU5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgIHx8ICFO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKSk7CisgICAgICAg KytkZXNpcmVkX3JvdykKKyAgICB7CisgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBPUyAo ZGVzaXJlZF9yb3csIGRlc2lyZWRfbWF0cml4KTsKKyAgICAgIGlmIChkZXNpcmVkX3Jvdy0+ZW5h YmxlZF9wKQorICAgICAgICBjb250aW51ZTsKKyAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKmN1cnJl bnRfcm93ID0gTUFUUklYX1JPVyAody0+Y3VycmVudF9tYXRyaXgsIHZwb3MpOworICAgICAgZW51 bSBtY19yb3dfcG9zaXRpb24gcm93X3Bvc2l0aW9uID0gbWNfcm93X3Bvc2l0aW9uICh3LCBjdXJy ZW50X3JvdywgY3VycmVudF9yb3csIHZwb3MpOworICAgICAgaWYgKGN1cnJlbnRfcm93LT5lbmFi bGVkX3ApCisgICAgICAgIG1jX2RyYXdfcm93ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgY3VycmVu dF9yb3csIGN1cnJlbnRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgICAgICAgICAg ICAgIGN1cnJlbnRfcm93LT54LCBjdX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F0cml4LCByb3csIGFyZWEsIHJvdy0+eCwg MCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb3ctPnVzZWRbYXJlYV0sIHRy dWUsIERSQVdfTk9STUFMX1RFWFQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg VVBEQVRFX1dJTkRPV19fUkVEUkFXX09WRVJMQVBQRURfUk9XUykKKyAgICAgICAgICAgICAgICAg ICYmIHJvdy0+dXNlZFthcmVhXSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICBGUkFNRV9SSUYgKGYpLT53cml0ZV9nbHlwaHMgKHcsIHJvdywgcm93LT5nbHlwaHNbYXJlYV0s IGFyZWEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJv dy0+dXNlZFthcmVhXSk7CisgICAgICAgICAgICAgICAgICBGUkFNRV9SSUYgKGYpLT5jbGVhcl9l bmRfb2ZfbGluZSAodywgcm93LCBhcmVhLCAtMSk7CisgICAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgfQorICAgICAgICAgIHJvdy0+b3ZlcmxhcHBlZF9wID0gMDsKKyAgICAgICAgfQorICAg ICAgaWYgKE1BVFJJWF9ST1dfQk9UVE9NX1kgKHJvdykgPj0geWIpCisgICAgICAgIGJyZWFrOwor ICAgIH0KKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgICAgIHJlZHJhd19vdmVy bGFwcGluZ19yb3dzICh3LCB5Yik7CiAJICAgIH0KICNlbmRpZgpAQCAtMzUzNiw4ICs1NDg2LDIw IEBAIHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkKICNlbmRp ZgogCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRz KQorICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWly cykpKQorICAgIG1jX3VwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgMCk7CisgICAgZWxzZQogICAg ICAgdXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCAwKTsKIAorLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogICAgICAgLyogRW5kIHRoZSB1cGRhdGUgb2Ygd2luZG93IFcuICBEb24ndCBzZXQg dGhlIGN1cnNvciBpZiB3ZQogICAgICAgICAgcGF1c2VkIHVwZGF0aW5nIHRoZSBkaXNwbGF5IGJl Y2F1c2UgaW4gdGhpcyBjYXNlLAogICAgICAgICAgc2V0X3dpbmRvd19jdXJzb3JfYWZ0ZXJfdXBk YXRlIGhhc24ndCBiZWVuIGNhbGxlZCwgYW5kCmRpZmYgLS1naXQgYS9zcmMvZnJhbWUuaCBiL3Ny Yy9mcmFtZS5oCmluZGV4IGZhNDVhMzIuLjUzYWQxMzEgMTAwNjQ0Ci0tLSBhL3NyYy9mcmFtZS5o CisrKyBiL3NyYy9mcmFtZS5oCkBAIC0yMDUsNiArMjA1LDE2IEBAIHN0cnVjdCBmcmFtZQogICBM aXNwX09iamVjdCB0b29sX2Jhcl9pdGVtczsKICAgLyogdG9vbF9iYXJfaXRlbXMgc2hvdWxkIGJl IHRoZSBsYXN0IExpc3BfT2JqZWN0IG1lbWJlci4gICovCiAKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogTm9uLW5pbCB3aGVuIHRoZSBm cmFtZSBpcyBpbiB0aGUgcHJvY2VzcyBvZiBiZWluZyB1cGRhdGVkLiAqLworICBzdHJ1Y3QgZnJh bWUgKm1jX3VwZGF0aW5nX2ZyYW1lOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAg IC8qIENhY2hlIG9mIHJlYWxpemVkIGZhY2VzLiAgKi8KICAgc3RydWN0IGZhY2VfY2FjaGUgKmZh Y2VfY2FjaGU7CiAKZGlmZiAtLWdpdCBhL3NyYy9mcmluZ2UuYyBiL3NyYy9mcmluZ2UuYwppbmRl eCBkMGQ1OTkyLi4yNTJlZGFjIDEwMDY0NAotLS0gYS9zcmMvZnJpbmdlLmMKKysrIGIvc3JjL2Zy aW5nZS5jCkBAIC00MzcsOCArNDM3LDQ2MiBAQCBzdGF0aWMgdW5zaWduZWQgc2hvcnQgZW1wdHlf bGluZV9iaXRzW10gPSB7CiAjZGVmaW5lIFNUQU5EQVJEX0JJVE1BUF9IRUlHSFQoYml0cykgKHNp emVvZiAoYml0cykvQllURVNfUEVSX0JJVE1BUF9ST1cpCiAjZGVmaW5lIEZSQklUUyhiaXRzKSAg Yml0cywgU1RBTkRBUkRfQklUTUFQX0hFSUdIVCAoYml0cykKIAorCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyogYCstZnJpbmdlLWhl bHBlci1kZWNpbWFsJyBkZWZpbmVkIGluIGBjcm9zc2hhaXJzLmVsYCAqLworCisvKiBUT0RPOiAg Q29uc2lkZXIgYWRkaW5nIHRoZSBmb2xsb3dpbmcgZnJpbmdlIGJpdG1hcHM6CisgICh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AgICAgIi4ueHguLnh4IgorICAgICAgIi54eC4uLnh4IgorICAgICAgIi4uLi4u Lnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IikKKyovCitzdGF0aWMgdW5z aWduZWQgc2hvcnQgbWNfcmV2ZXJzZWRfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93X2JpdHNbXSA9 eworICAweDMsIDB4MywgMHgzLCAweDYzLCAweDMzLCAweDFiLCAweGZmLCAweGZmLCAweDFiLCAw eDMzLCAweDYzLCAweDMsIDB4MywgMHgzfTsKKworLyogMjYKKyAgICAoKy1mcmluZ2UtaGVscGVy LWhleGFkZWNpbWFsCisgICAgICAieHh4eHh4eHgiCisgICAgICAieC4uLi4uLngiCisgICAgICAi eC4uLi4uLngiCisgICAgICAieC4ueHguLngiCisgICAgICAieC4uLnh4LngiCisgICAgICAieC4u Li54eHgiCisgICAgICAieC54eHh4eHgiCisgICAgICAieC54eHh4eHgiCisgICAgICAieC4uLi54 eHgiCisgICAgICAieC4uLnh4LngiCisgICAgICAieC4ueHguLngiCisgICAgICAieC4uLi4uLngi CisgICAgICAieC4uLi4uLngiCisgICAgICAieHh4eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25l ZCBzaG9ydCBtY19ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93X2JpdHNbXSA9eworICAweGZm LCAweDgxLCAweDgxLCAweDk5LCAweDhkLCAweDg3LCAweGJmLAorICAweGJmLCAweDg3LCAweDhk LCAweDk5LCAweDgxLCAweDgxLCAweGZmfTsKKworLyogMjcKKyAgICAoKy1mcmluZ2UtaGVscGVy LWhleGFkZWNpbWFsCisgICAgICAieHh4eHh4eHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAi eC4uLi4ueHgiCisgICAgICAieC54eC4ueHgiCisgICAgICAieC4ueHgueHgiCisgICAgICAieC4u Lnh4eHgiCisgICAgICAieHh4eHh4eHgiCisgICAgICAieHh4eHh4eHgiCisgICAgICAieC4uLnh4 eHgiCisgICAgICAieC4ueHgueHgiCisgICAgICAieC54eC4ueHgiCisgICAgICAieC4uLi4ueHgi CisgICAgICAieC4uLi4ueHgiCisgICAgICAieHh4eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25l ZCBzaG9ydCBtY19yZXZlcnNlZF9ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93X2JpdHNbXSA9 eworICAweGZmLCAweDgxLCAweDgxLCAweGIxLCAweDk5LCAweDhkLCAweGZmLAorICAweGZmLCAw eDhkLCAweDk5LCAweGIxLCAweDgxLCAweDgxLCAweGZmfTsKKworLyogMjgKKyAgICAoKy1mcmlu Z2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHh4eHh4eHgiCisgICAgICAieC4uLi4uLngi CisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisg ICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAg ICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAi eC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieHh4eHh4eHgiKQorKi8KK3N0YXRp YyB1bnNpZ25lZCBzaG9ydCBtY19ob2xsb3dfcmVjdGFuZ2xlX2JpdHNbXSA9eworICAweGZmLCAw eDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLAorICAweDgxLCAweDgxLCAweDgxLCAw eDgxLCAweDgxLCAweDgxLCAweGZmfTsKKworLyogMjkKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhl eGFkZWNpbWFsCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4u Li4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4u Li4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4i CisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisg ICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBz aG9ydCBtY192ZXJ0aWNhbF9iYXJfYml0c1tdID17CisgIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAs IDB4ODAsIDB4ODAsIDB4ODAsCisgIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAs IDB4ODB9OworCisvKiAzMAorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAg ICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIu Li4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4u Li54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54 eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIK KyAgICAgICIuLi4uLi54eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3JldmVyc2Vk X3ZlcnRpY2FsX2Jhcl9iaXRzW10gPXsKKyAgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4Mywg MHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDN9OworCisvKiAzMQorICAgICgr LWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICJ4eC4uLi4uLiIKKyAgICAgICJ4eC4u Li4uLiIKKyAgICAgICIgeHguLi4uLiIKKyAgICAgICIueHguLi4uLiIKKyAgICAgICIuLnh4Li4u LiIKKyAgICAgICIuLnh4Li4uLiIKKyAgICAgICIuLi54eC4uLiIKKyAgICAgICIuLi54eC4uLiIK KyAgICAgICIuLi4ueHguLiIKKyAgICAgICIuLi4ueHguLiIKKyAgICAgICIuLi4uLnh4LiIKKyAg ICAgICIuLi4uLnh4LiIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIpCisqLwor c3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX2JhY2tzbGFzaF9iaXRzW10gPXsKKyAgMHhjMCwgMHhj MCwgMHhlMCwgMHg2MCwgMHgzMCwgMHgzMCwgMHgxOCwgMHgxOCwgMHhjLCAweGMsIDB4NiwgMHg2 LCAweDMsIDB4M307CisKKy8qIDMyCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAor ICAgICAgInh4Li4uLi4uIgorICAgICAgInh4Li4uLi4uIgorICAgICAgInh4eC4uLi4uIgorICAg ICAgInh4eC4uLi4uIgorICAgICAgIngueHguLi4uIgorICAgICAgIngueHguLi4uIgorICAgICAg InguLnh4Li4uIgorICAgICAgInguLnh4Li4uIgorICAgICAgInguLi54eC4uIgorICAgICAgIngu Li54eC4uIgorICAgICAgInguLi4ueHguIgorICAgICAgInguLi4ueHguIgorICAgICAgInguLi4u Lnh4IgorICAgICAgInguLi4uLnh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdmVy dGljYWxfYmFyX2JhY2tzbGFzaF9iaXRzW10gPXsKKyAgMHhjMCwgMHhjMCwgMHhlMCwgMHhlMCwg MHhiMCwgMHhiMCwgMHg5OCwKKyAgMHg5OCwgMHg4YywgMHg4YywgMHg4NiwgMHg4NiwgMHg4Mywg MHg4M307CisKKy8qIDMzCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAg Ii54eHh4eHguIgorICAgICAgInh4eHgueC4uIgorICAgICAgInh4eHgueC4uIgorICAgICAgInh4 eHgueC4uIgorICAgICAgIi54eHgueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngu eC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4u IgorICAgICAgIi4uLngueC4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcGlsY3Jv d19iaXRzW10gPXsKKyAgMHg3ZSwgMHhmNCwgMHhmNCwgMHhmNCwgMHg3NCwgMHgxNCwgMHgxNCwg MHgxNCwgMHgxNCwgMHgxNCwgMHgxNH07CisKKy8qIDM0CisgICAgKCstZnJpbmdlLWhlbHBlci1o ZXhhZGVjaW1hbAorICAgICAgIi4ueHh4eC4uIgorICAgICAgIi54eHh4eHguIgorICAgICAgIngu Lnh4Li54IgorICAgICAgInguLnh4Li54IgorICAgICAgInh4eHh4eHh4IgorICAgICAgInh4Li4u Lnh4IgorICAgICAgInh4eC4ueHh4IgorICAgICAgIi54eHh4eHguIgorICAgICAgIi4ueHh4eC4u IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc21pbGV5X2ZhY2VfYml0c1tdID17Cisg IDB4M2MsIDB4N2UsIDB4OTksIDB4OTksIDB4ZmYsIDB4YzMsIDB4ZTcsIDB4N2UsIDB4M2N9Owor CisvKiAzNQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLnguLi4u LiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLi4ueC4uLiIKKyAgICAgICIuLi4uLnguLiIK KyAgICAgICIuLi4ueC4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLnguLi4uLiIpCisq Lworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3NpbmdsZV9hbmdsZV9yaWdodF9iaXRzW10gPXsK KyAgMHgyMCwgMHgxMCwgMHg4LCAweDQsIDB4OCwgMHgxMCwgMHgyMH07CisKKy8qIDM2CisgICAg KCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4ueC4uIgorICAgICAgIi4u Li54Li4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC4uLi4uIgorICAgICAgIi4uLngu Li4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4uLi4ueC4uIikKKyovCitzdGF0aWMgdW5z aWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX2xlZnRfYml0c1tdID17CisgIDB4NCwgMHg4LCAw eDEwLCAweDIwLCAweDEwLCAweDgsIDB4NH07CisKKy8qIDM3CisgICAgKCstZnJpbmdlLWhlbHBl ci1oZXhhZGVjaW1hbAorICAgICAgInh4Lnh4Li4uIgorICAgICAgIi54eC54eC4uIgorICAgICAg Ii4ueHgueHguIgorICAgICAgIi4uLnh4Lnh4IgorICAgICAgIi4ueHgueHguIgorICAgICAgIi54 eC54eC4uIgorICAgICAgInh4Lnh4Li4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNf ZG91YmxlX2FuZ2xlX3JpZ2h0X2JpdHNbXSA9eworICAweGQ4LCAweDZjLCAweDM2LCAweDFiLCAw eDM2LCAweDZjLCAweGQ4fTsKKworLyogMzgKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNp bWFsCisgICAgICAiLi4ueHgueHgiCisgICAgICAiLi54eC54eC4iCisgICAgICAiLnh4Lnh4Li4i CisgICAgICAieHgueHguLi4iCisgICAgICAiLnh4Lnh4Li4iCisgICAgICAiLi54eC54eC4iCisg ICAgICAiLi4ueHgueHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19kb3VibGVfYW5n bGVfbGVmdF9iaXRzW10gPXsKKyAgMHgxYiwgMHgzNiwgMHg2YywgMHhkOCwgMHg2YywgMHgzNiwg MHgxYn07CisKKy8qIDM5CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAg IngueC54Li4uIgorICAgICAgIi54LngueC4uIgorICAgICAgIi4ueC54LnguIgorICAgICAgIi4u LngueC54IgorICAgICAgIi4ueC54LnguIgorICAgICAgIi54LngueC4uIgorICAgICAgIngueC54 Li4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdHJpcGxlX2FuZ2xlX3JpZ2h0X2Jp dHNbXSA9eworICAweGE4LCAweDU0LCAweDJhLCAweDE1LCAweDJhLCAweDU0LCAweGE4fTsKKwor LyogNDAKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4ueC54Lngi CisgICAgICAiLi54LngueC4iCisgICAgICAiLngueC54Li4iCisgICAgICAieC54LnguLi4iCisg ICAgICAiLngueC54Li4iCisgICAgICAiLi54LngueC4iCisgICAgICAiLi4ueC54LngiKQorKi8K K3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190cmlwbGVfYW5nbGVfbGVmdF9iaXRzW10gPXsKKyAg MHgxNSwgMHgyYSwgMHg1NCwgMHhhOCwgMHg1NCwgMHgyYSwgMHgxNX07CisKKy8qIDQxCisgICAg KCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4u Li4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLngu Li4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLi4uLngu IgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgor ICAgICAgIi4uLi4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc2luZ2xlX2Fu Z2xlX3VwX2JpdHNbXSA9eworICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDEwLCAweDI4LCAw eDQ0LCAweDgyLCAweDAwLCAweDAwLCAweDAwLCAweDAwfTsKKworLyogNDIKKyAgICAoKy1mcmlu Z2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4i CisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAieC4uLi4ueC4iCisg ICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAg ICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAi Li4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zaW5nbGVfYW5nbGVfZG93 bl9iaXRzW10gPXsKKyAgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwg MHgxMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMH07CisKKy8qIDQzCisgICAgKCstZnJpbmdlLWhl bHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAg ICAgIi4uLi4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAg Ii54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54 Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4u Li4uIgorICAgICAgIi4uLi4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfZG91 YmxlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDAwLCAweDAwLCAweDAwLCAweDEwLCAweDI4LCAw eDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDgyLCAweDAwLCAweDAwLCAweDAwfTsKKworLyogNDQK KyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAg ICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAi LnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLngu Li54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLi4u Li4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNp Z25lZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfZG93bl9iaXRzW10gPXsKKyAgMHgwMCwgMHgwMCwg MHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHgxMCwgMHgwMCwgMHgw MCwgMHgwMH07CisKKy8qIDQ1CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAg ICAgIi4uLi4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAg Ii54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54 Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4u eC4uIgorICAgICAgInguLi4uLnguIgorICAgICAgIi4uLi4uLi4uIikKKyovCitzdGF0aWMgdW5z aWduZWQgc2hvcnQgbWNfdHJpcGxlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDAwLCAweDEwLCAw eDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDgyLCAweDAw fTsKKworLyogNDYKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4u Li4uLi4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54Lngu Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4i CisgICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisg ICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBz aG9ydCBtY19xdWFkcnVwbGVfYW5nbGVfZG93bl9iaXRzW10gPXsKKyAgMHgwMCwgMHg4MiwgMHg0 NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHgxMCwgMHgwMH07 CisKKy8qIDQ3CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLngu Li4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLngu IgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgor ICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAg ICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLi4uLnguIikKKyovCitz dGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcXVhZHJ1cGxlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAw eDEwLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDky LCAweDI4LCAweDQ0LCAweDgyfTsKKworLyogNDgKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFk ZWNpbWFsCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54Lngu Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4i CisgICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisg ICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54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SksIE5JTFAgKGJt MSkpCisgICAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICBpZiAoQ09OU1AgKGJt MSkpCisgICAgICB7CisgICAgICAgIGxuMSA9IFhGSVhOVU0gKEZsZW5ndGggKGJtMSkpOworICAg ICAgICBpZiAocGFydGlhbF9wKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChsbjEgPiBp eDIpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBibSA9IG1jX250aCAoaXgyLCBi bTEpOworICAgICAgICAgICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAgICAgICAg ICBnb3RvIGZvdW5kOworICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKGxuMSA+IGl4MSkKKyAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICBibSA9IG1jX250aCAoaXgxLCBibTEpOworICAg ICAgICAgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAgICAgICAgICAgICAgZ290 byBmb3VuZDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICB9CisgICAg ZWxzZSBpZiAoKGJtID0gYm0xLCAhRVEgKGJtLCBRdCkpKQorICAgICAgZ290byBmb3VuZDsKKyAg fQorICAgIH0KKyAgaWYgKCFFUSAoY21hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdl X2luZGljYXRvcl9hbGlzdCkpCisgICAgICAmJiAhTklMUCAoQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0 cywgZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpKQorICAgIHsKKyAgICAgIGJtMiA9IG1jX2Fzc3Eg KGJpdG1hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRvcl9hbGlzdCkp OworICAgICAgaWYgKENPTlNQIChibTIpKQorICAgICAgICB7CisgICAgICAgICAgaWYgKChibTIg PSBYQ0RSIChibTIpKSwgIU5JTFAgKGJtMikpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAg IGlmIChDT05TUCAoYm0yKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBs bjIgPSBYRklYTlVNIChGbGVuZ3RoIChibTIpKTsKKyAgICAgICAgICAgICAgICAgIGlmIChwYXJ0 aWFsX3ApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBpZiAo bG4yID4gaXgyKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg ICAgICAgICBibSA9IG1jX250aCAoaXgyLCBibTIpOworICAgICAgICAgICAgICAgICAgICAgICAg ICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdvdG8gZm91 bmQ7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIGlmIChs bjEgPiBpeDEpCisgICAgeworICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0xKTsKKyAgICAgIGlm ICghRVEgKGJtLCBRdCkpCisgICAgICAgIGdvdG8gZm91bmQ7CisgICAgfQorICBpZiAobG4yID4g aXgxKQorICAgIHsKKyAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMik7CisgICAgICBpZiAoIUVR IChibSwgUXQpKQorICAgICAgICBnb3RvIGZvdW5kOworICAgICAgcmV0dXJuIE1DX05PX0ZSSU5H RV9CSVRNQVA7CisgICAgfQorICAgIGVsc2UgaWYgKChibSA9IGJtMiwgTklMUCAoYm0pKSkKKyAg ICAgIHJldHVybiBNQ19OT19GUklOR0VfQklUTUFQOworICBmb3VuZDoKKyAgcmV0dXJuIGxvb2t1 cF9mcmluZ2VfYml0bWFwIChibSk7Cit9CisKK3N0YXRpYyBpbnQKK21jX2dldF9sb2dpY2FsX2N1 cnNvcl9iaXRtYXAgKHN0cnVjdCB3aW5kb3cgKncsIExpc3BfT2JqZWN0IGN1cnNvcikKK3sKKyAg TGlzcF9PYmplY3QgY21hcCwgYm0gPSBRbmlsOworICBpZiAoKGNtYXAgPSBCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGZyaW5nZV9jdXJzb3JfYWxpc3QpKSwgIU5JTFAgKGNtYXApKQorICAg IHsKKyAgICAgIGJtID0gbWNfYXNzcSAoY3Vyc29yLCBjbWFwKTsKKyAgICAgIGlmIChDT05TUCAo Ym0pKQorICAgICAgICB7CisgICAgICAgICAgaWYgKChibSA9IFhDRFIgKGJtKSksIE5JTFAgKGJt KSkKKyAgICAgICAgICAgIHJldHVybiBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgIHJl dHVybiBsb29rdXBfZnJpbmdlX2JpdG1hcCAoYm0pOworICAgICAgICB9CisgICAgfQorICBpZiAo RVEgKGNtYXAsIEJWQVIgKCZidWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9jdXJzb3JfYWxpc3QpKSkK KyAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgYm0gPSBtY19hc3NxIChjdXJzb3Is IEJWQVIgKCZidWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9jdXJzb3JfYWxpc3QpKTsKKyAgaWYgKCFD T05TUCAoYm0pIHx8ICgoYm0gPSBYQ0RSIChibSkpLCBOSUxQIChibSkpKQorICAgIHJldHVybiBN Q19OT19GUklOR0VfQklUTUFQOworICByZXR1cm4gbG9va3VwX2ZyaW5nZV9iaXRtYXAgKGJtKTsK K30KKworc3RhdGljIGludAorbWNfZ2V0X2xvZ2ljYWxfZnJpbmdlX2JpdG1hcCAoc3RydWN0IHdp bmRvdyAqdywgTGlzcF9PYmplY3QgYml0bWFwLCBpbnQgcmlnaHRfcCw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RSIChibTEpKSwgTklMUCAoYm0xKSkKKyAgICAgICAgICAgIHJldHVybiBNQ19OT19G UklOR0VfQklUTUFQOworICAgICAgICAgIGlmIChDT05TUCAoYm0xKSkKKyAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgbG4xID0gWEZJWE5VTSAoRmxlbmd0aCAoYm0xKSk7CisgICAgICAgICAg ICAgIGlmIChwYXJ0aWFsX3ApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg aWYgKGxuMSA+IGl4MikKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg ICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMSk7CisgICAgICAgICAgICAgICAgICAgICAgaWYgKCFF USAoYm0sIFF0KSkKKyAgICAgICAgICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQor ICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZiAobG4xID4gaXgxKQor ICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJtID0gbWNf bnRoIChpeDEsIGJtMSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIUVRIChibSwgUXQp KQorICAgICAgICAgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5kOworICAgICAgICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAg IGVsc2UgaWYgKChibSA9IGJtMSwgIUVRIChibSwgUXQpKSkKKyAgICAgICAgICAgICAgZ290byBm b3VuZDsKKyAgICAgICAgfQorICAgIH0KKyAgaWYgKCFFUSAoY21hcCwgQlZBUiAoJmJ1ZmZlcl9k ZWZhdWx0cywgZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpCisgICAgICAmJiAhTklMUCAoQlZBUiAo JmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpKQorICAgIHsKKyAgICAg IGJtMiA9IG1jX2Fzc3EgKGJpdG1hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2lu ZGljYXRvcl9hbGlzdCkpOworICAgICAgaWYgKENPTlNQIChibTIpKQorICAgICAgICB7CisgICAg ICAgICAgaWYgKChibTIgPSBYQ0RSIChibTIpKSwgIU5JTFAgKGJtMikpCisgICAgICAgICAgICB7 CisgICAgICAgICAgICAgIGlmIChDT05TUCAoYm0yKSkKKyAgICAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgICBsbjIgPSBYRklYTlVNIChGbGVuZ3RoIChibTIpKTsKKyAgICAgICAgICAg ICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICAgICAgICBpZiAobG4yID4gaXgyKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgICAgICAgICBibSA9IG1jX250aCAoaXgyLCBibTIpOworICAgICAgICAg ICAgICAgICAgICAgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0K KyAgICB9CisgIGlmIChsbjEgPiBpeDEpCisgICAgeworICAgICAgYm0gPSBtY19udGggKGl4MSwg Ym0xKTsKKyAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgIGdvdG8gZm91bmQ7CisgICAg fQorICBpZiAobG4yID4gaXgxKQorICAgIHsKKyAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMik7 CisgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgICBnb3RvIGZvdW5kO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Qor ICAgICAgICAgICAgYm91bmRhcnlfdG9wID0gYm91bmRhcnlfYm90ID0gYXJyb3dfdG9wID0gYXJy b3dfYm90ID0gWENEUiAocG9zKTsKKyAgICAgICAgICBpZiAocG9zID0gbWNfYXNzcSAoUXRvcCwg aW5kKSwgIU5JTFAgKHBvcykpCisgICAgICAgICAgICBib3VuZGFyeV90b3AgPSBYQ0RSIChwb3Mp OworICAgICAgICAgIGlmIChwb3MgPSBtY19hc3NxIChRYm90dG9tLCBpbmQpLCAhTklMUCAocG9z KSkKKyAgICAgICAgICAgIGJvdW5kYXJ5X2JvdCA9IFhDRFIgKHBvcyk7CisgICAgICAgICAgaWYg KHBvcyA9IG1jX2Fzc3EgKFF1cCwgaW5kKSwgIU5JTFAgKHBvcykpCisgICAgICAgICAgICBhcnJv d190b3AgPSBYQ0RSIChwb3MpOworICAgICAgICAgIGlmIChwb3MgPSBtY19hc3NxIChRZG93biwg aW5kKSwgIU5JTFAgKHBvcykpCisgICAgICAgICAgICBhcnJvd19ib3QgPSBYQ0RSIChwb3MpOwor ICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICAvKiBBbnl0aGluZyBlbHNlIG1lYW5z IGJvdW5kYXJ5IG9uIGxlZnQgYW5kIG5vIGFycm93cy4gKi8KKyAgICAgICAgICBib3VuZGFyeV90 b3AgPSBib3VuZGFyeV9ib3QgPSBRbGVmdDsKKyAgICB9CisgIHRvcF9pbmRfcm4gPSBib3RfaW5k X3JuID0gLTE7CisgIGlmICghTklMUCAoaW5kKSkKKyAgICB7CisgICAgICBmb3IgKHkgPSB3LT52 c2Nyb2xsLCBybiA9IDA7CisgICAgICAgICAgIHkgPCB5YiAmJiBybiA8IG5yb3dzOworICAgICAg ICAgICB5ICs9IHJvdy0+aGVpZ2h0LCArK3JuKQorICAgICAgICB7CisgICAgICAgICAgcm93ID0g dy0+ZGVzaXJlZF9tYXRyaXgtPnJvd3MgKyBybjsKKyAgICAgICAgICBpZiAoIXJvdy0+ZW5hYmxl ZF9wKQorICAgICAgICAgICAgcm93ID0gdy0+Y3VycmVudF9tYXRyaXgtPnJvd3MgKyBybjsKKyAg ICAgICAgICByb3ctPmluZGljYXRlX2JvYl9wID0gcm93LT5pbmRpY2F0ZV90b3BfbGluZV9wID0g MDsKKyAgICAgICAgICByb3ctPmluZGljYXRlX2VvYl9wID0gcm93LT5pbmRpY2F0ZV9ib3R0b21f bGluZV9wID0gMDsKKyAgICAgICAgICBpZiAoIXJvdy0+bW9kZV9saW5lX3ApCisgICAgICAgICAg ICB7CisgICAgICAgICAgICAgIGlmICh0b3BfaW5kX3JuIDwgMCAmJiByb3ctPnZpc2libGVfaGVp Z2h0ID4gMCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBpZiAoTUFUUklY X1JPV19TVEFSVF9DSEFSUE9TIChyb3cpIDw9IEJVRl9CRUdWIChYQlVGRkVSICh3LT5jb250ZW50 cykpCisgICAgICAgICAgICAgICAgICAgICAgJiYgIU1BVFJJWF9ST1dfUEFSVElBTExZX1ZJU0lC TEVfQVRfVE9QX1AgKHcsIHJvdykpCisgICAgICAgICAgICAgICAgICAgIHJvdy0+aW5kaWNhdGVf Ym9iX3AgPSAhTklMUCAoYm91bmRhcnlfdG9wKTsKKyAgICAgICAgICAgICAgICAgICAgZWxzZQor ICAgICAgICAgICAgICAgICAgICAgIHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcCA9ICFOSUxQIChh cnJvd190b3ApOworICAgICAgICAgICAgICAgICAgdG9wX2luZF9ybiA9IHJuOworICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgICAgaWYgKGJvdF9pbmRfcm4gPCAwKQorICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgIGlmIChNQVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cp ID49IEJVRl9aViAoWEJVRkZFUiAody0+Y29udGVudHMpKQorICAgICAgICAgICAgICAgICAgICAg ICYmICFNQVRSSVhfUk9XX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ICAgICAgICAgICAgICAgICAgPyBNQ19MRUZUX0ZSSU5HRSAoMSwg UXRvcF9ib3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKQorICAgICAgICAgICAgICAgICAgOiBNQ19M RUZUX0ZSSU5HRSAoMiwgUXRvcCwgMCkpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICBibiA9ICgocm93LT5pbmRpY2F0ZV9lb2JfcCAmJiBFUSAoYm91bmRhcnlfYm90LCBRcmlnaHQp KQorICAgICAgICAgICAgICAgICAgICA/IE1DX1JJR0hUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20s IHJvdy0+ZW5kc19hdF96dl9wKQorICAgICAgICAgICAgICAgICAgICA6IE1DX1JJR0hUX0ZSSU5H RSAoMiwgUXRvcCwgMCkpOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNh dGVfdG9wX2xpbmVfcCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpZiAoRVEgKGFycm93X3Rv cCwgUWxlZnQpKQorICAgICAgICAgICAgICBibiA9IE1DX0xFRlRfRlJJTkdFICg2LCBRdXAsIDAp OworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgYm4gPSBNQ19SSUdIVF9GUklO R0UgKDYsIFF1cCwgMCk7CisgICAgICAgICAgfQorICAgICAgaWYgKGJuICE9IE1DX05PX0ZSSU5H RV9CSVRNQVApCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZnJpbmdlX2JpdG1hcCAqZmIg PSBnZXRfZnJpbmdlX2JpdG1hcF9kYXRhIChibik7CisgICAgICAgICAgaWYgKGZiLT5hbGlnbiA9 PSBBTElHTl9CSVRNQVBfVE9QICYmIGZiLT5wZXJpb2QgPT0gMCkKKyAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93MTsKKyAgICAgICAgICAgICAgaW50IHRv cF9pbmRfbWF4X3k7CisgICAgICAgICAgICAgIHRvcF9pbmRfbWluX3kgPSBXSU5ET1dfSEVBREVS X0xJTkVfSEVJR0hUICh3KTsKKyAgICAgICAgICAgICAgdG9wX2luZF9tYXhfeSA9IHRvcF9pbmRf bWluX3kgKyBmYi0+aGVpZ2h0OworICAgICAgICAgICAgICBpZiAodG9wX2luZF9tYXhfeSA+IHli KQorICAgICAgICAgICAgICAgIHRvcF9pbmRfbWF4X3kgPSB5YjsKKyAgICAgICAgICAgICAgZm9y ICh5ID0gcm93LT55ICsgcm93LT5oZWlnaHQsIHJuID0gdG9wX2luZF9ybiArIDE7CisgICAgICAg ICAgICAgICAgICAgeSA8IHRvcF9pbmRfbWF4X3kgJiYgcm4gPCBucm93czsKKyAgICAgICAgICAg ICAgICAgICB5ICs9IHJvdzEtPmhlaWdodCwgcm4rKykKKyAgICAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgICBpZiAoYm90X2luZF9ybiA+PSAwICYmIHJuID49IGJvdF9pbmRfcm4pCisg ICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgcm93MSA9IHctPmRl c2lyZWRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgICAgICAgICBpZiAoIXJvdzEtPmVu YWJsZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgcm93MSA9IHctPmN1cnJlbnRfbWF0cml4LT5y b3dzICsgcm47CisgICAgICAgICAgICAgICAgICByb3cxLT5pbmRpY2F0ZV9ib2JfcCA9IHJvdy0+ aW5kaWNhdGVfYm9iX3A7CisgICAgICAgICAgICAgICAgICByb3cxLT5pbmRpY2F0ZV90b3BfbGlu ZV9wID0gcm93LT5pbmRpY2F0ZV90b3BfbGluZV9wOworICAgICAgICAgICAgICAgIH0KKyAgICAg ICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgaWYgKGJvdF9pbmRfcm4gPj0gMCkKKyAgICB7 CisgICAgICBpbnQgYm4gPSBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgcm93ID0gdy0+ZGVz aXJlZF9tYXRyaXgtPnJvd3MgKyBib3RfaW5kX3JuOworICAgICAgaWYgKCFyb3ctPmVuYWJsZWRf cCkKKyAgICAgICAgcm93ID0gdy0+Y3VycmVudF9tYXRyaXgtPnJvd3MgKyBib3RfaW5kX3JuOwor ICAgICAgYm90X3Jvd19lbmRzX2F0X3p2X3AgPSByb3ctPmVuZHNfYXRfenZfcDsKKyAgICAgIGlm IChyb3ctPmluZGljYXRlX2VvYl9wKQorICAgICAgICB7CisgICAgICAgICAgaWYgKEVRIChib3Vu ZGFyeV9ib3QsIFFsZWZ0KSkKKyAgICAgICAgICAgIGJuID0gTUNfTEVGVF9GUklOR0UgKDMsIFFi b3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgYm4gPSBNQ19SSUdIVF9GUklOR0UgKDMsIFFib3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKTsK KyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3Ap CisgICAgICAgICAgeworICAgICAgICAgICAgaWYgKEVRIChhcnJvd19ib3QsIFFsZWZ0KSkKKyAg ICAgICAgICAgICAgYm4gPSBNQ19MRUZUX0ZSSU5HRSAoNywgUWRvd24sIDApOworICAgICAgICAg ICAgICBlbHNlCisgICAgICAgICAgICAgICAgYm4gPSBNQ19SSUdIVF9GUklOR0UgKDcsIFFkb3du LCAwKTsKKyAgICAgICAgICB9CisgICAgICBpZiAoYm4gIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkK KyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBmcmluZ2VfYml0bWFwICpmYiA9IGdldF9mcmlu Z2VfYml0bWFwX2RhdGEgKGJuKTsKKyAgICAgICAgICBpZiAoZmItPmFsaWduID09IEFMSUdOX0JJ VE1BUF9CT1RUT00gJiYgZmItPnBlcmlvZCA9PSAwKQorICAgICAgICAgICAgeworICAgICAgICAg ICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cxOworICAgICAgICAgICAgICBpbnQgYm90X2luZF9t aW5feTsKKyAgICAgICAgICAgICAgYm90X2luZF9tYXhfeSA9IHJvdy0+eSArIHJvdy0+dmlzaWJs ZV9oZWlnaHQ7CisgICAgICAgICAgICAgIGJvdF9pbmRfbWluX3kgPSBib3RfaW5kX21heF95IC0g ZmItPmhlaWdodDsKKyAgICAgICAgICAgICAgaWYgKGJvdF9pbmRfbWluX3kgPCBXSU5ET1dfSEVB REVSX0xJTkVfSEVJR0hUICh3KSkKKyAgICAgICAgICAgICAgICBib3RfaW5kX21pbl95ID0gV0lO RE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgICAgICAgICAgICAgIGZvciAoeSA9IHJvdy0+ eSwgcm4gPSBib3RfaW5kX3JuIC0gMTsKKyAgICAgICAgICAgICAgICAgICB5ID49IGJvdF9pbmRf bWluX3kgJiYgcm4gPj0gMDsKKyAgICAgICAgICAgICAgICAgICB5IC09IHJvdzEtPmhlaWdodCwg cm4tLSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBpZiAodG9wX2luZF9y biA+PSAwICYmIHJuIDw9IHRvcF9pbmRfcm4pCisgICAgICAgICAgICAgICAgICAgIGJyZWFrOwor ICAgICAgICAgICAgICAgICAgcm93MSA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgcm47Cisg ICAgICAgICAgICAgICAgICBpZiAoIXJvdzEtPmVuYWJsZWRfcCkKKyAgICAgICAgICAgICAgICAg ICAgcm93MSA9IHctPmN1cnJlbnRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgICAgICAg ICByb3cxLT5pbmRpY2F0ZV9lb2JfcCA9IHJvdy0+aW5kaWNhdGVfZW9iX3A7CisgICAgICAgICAg ICAgICAgICByb3cxLT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wID0gcm93LT5pbmRpY2F0ZV9ib3R0 b21fbGluZV9wOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQor ICAgIH0KKyAgYm9vbCBhdXRvX2hzY3JvbGxfbW9kZV9wID0gRVEgKEZidWZmZXJfbG9jYWxfdmFs dWUgKFFhdXRvX2hzY3JvbGxfbW9kZSwgdy0+Y29udGVudHMpLCBRY3VycmVudF9saW5lKTsKKyAg LyogRVhBTVBMRTogIChzY3JvbGwtbGVmdCA1KSAqLworICBib29sIGhzY2xfYWxsX3RlbXBfcCA9 ICh3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBh dXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3Jv bGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IDAp OworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBub3RoaW5nLiAqLworICBib29sIGhz Y2xfYWxsX3Blcm1fMF9wID0gKHctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+ bWluX2hzY3JvbGwgPT0gdy0+aHNjcm9sbCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5k IGRvIHNvbWV0aGluZyBlbHNlIGJlc2lkZXMgaG9yaXpvbnRhbGx5IHNjcm9sbGluZyB0aGUKKyAg ICAgICAgICAgICAgIGN1cnJlbnQgbGluZSBkaWZmZXJlbnRseS4KKyAgICAgICAgICAgICAgIEN1 cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICov CisgIGJvb2wgaHNjbF9hbGxfcGVybV8xX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gdy0+aHNjcm9sbCk7CisgIC8qIEVYQU1QTEU6ICBD LXUgQy14IDwgYW5kIC4uLgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIGlzIF9ub3RfIGhv cml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJt XzJfcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgdy0+aHNjcm9sbCA9PSAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWlu X2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3Jv bGwgIT0gdy0+aHNjcm9sbCk7CisgIC8qIEVYQU1QTEU6ICAoc2Nyb2xsLWxlZnQgNSk7IGFuZCwg dGhlbiBwcmVzcyB0aGUgbGVmdCBhcnJvdyBrZXkgb25lIHRpbWUuCisgICAgICAgICAgICAgICBD dXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuKi8KKyAg Ym9vbCBoc2NsX3RlbXBfcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAg ICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAg JiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9s bCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBhbmQgZG8gc29tZXRoaW5nIHRoYXQg Y2F1c2VzIHRoZSBjdXJyZW50IGxpbmUgdG8gYmUKKyAgICAgICAgICAgICAgIGhvcml6b250YWxs eSBzY3JvbGxlZCBkaWZmZXJlbnRseS4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBfaXNf IGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4gKi8KKyAgYm9vbCBoc2NsX3Blcm1f cCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAmJiBh dXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+ IDAKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAg ICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCAhPSB3LT5oc2Nyb2xsKTsKKyAgc3RydWN0 IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIGZvciAoeSA9IHctPnZzY3JvbGwsIHJu ID0gMDsKKyAgICAgICB5IDwgeWIgJiYgcm4gPCBucm93czsKKyAgICAgICB5ICs9IHJvdy0+aGVp Z2h0LCBybisrKQorICAgIHsKKyAgaW50IGxlZnQsIHJpZ2h0OworICB1bnNpZ25lZCBsZWZ0X2Zh Y2VfaWQsIHJpZ2h0X2ZhY2VfaWQ7CisgIGludCBsZWZ0X29mZnNldCw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JST1dfQklUTUFQCisgICAgICAgICAgJiYgIWhzY2xfYWxsX3RlbXBf cAorICAgICAgICAgICYmICFoc2NsX3RlbXBfcAorICAgICAgICAgICYmICFoc2NsX3Blcm1fcAor ICAgICAgICAgICYmICFoc2NsX2FsbF9wZXJtXzBfcAorICAgICAgICAgICYmICFoc2NsX2FsbF9w ZXJtXzFfcAorICAgICAgICAgICYmICFoc2NsX2FsbF9wZXJtXzJfcAorICAgICAgICAgICYmIGVu YWJsZWRfcCkKKyAgICAgICAgeworICAgICAgICAgIGludCBmcmluZ2VfYml0bWFwID0gTUNfTk9f RlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICBlbnVtIGZhY2VfaWQgb3ZlcmxheV9hcnJvd19mYWNl X2lkID0KKyAgICAgICAgICAgICghYWN0aXZlX3AKKyAgICAgICAgICAgICAmJiAhTklMUCAoQlZB UiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkpCisgICAgICAg ICAgICA/IGxvb2t1cF9kZXJpdmVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJv dy1pbmFjdGl2ZS1wcmUtenYtZmFjZSIpLCBGUklOR0VfRkFDRV9JRCwgdHJ1ZSkKKyAgICAgICAg ICAgIDogKGFjdGl2ZV9wKQorICAgICAgICAgICAgICA/IGxvb2t1cF9kZXJpdmVkX2ZhY2UgKHcs IGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1wcmUtenYtZmFjZSIpLCBGUklOR0VfRkFDRV9J RCwgdHJ1ZSkKKyAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAgIG1jX2xl ZnRfZnJpbmdlX2ZhY2VfaWQgPSAoY3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQ KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBvdmVybGF5X2Fycm93X2Zh Y2VfaWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNF X0lEOworICAgICAgICAgIGlmICh3LT5oc2Nyb2xsICE9IDApCisgICAgICAgICAgICBmcmluZ2Vf Yml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistb3ZlcmxheS1hcnJv dyIpLCBmYWxzZSwgdHJ1ZSk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGZyaW5n ZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1vdmVybGF5LWFy cm93IiksIHRydWUsIHRydWUpOworICAgICAgICAgIG1jX2xlZnRfZnJpbmdlX2JpdG1hcCA9IChj dXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgIH0KKyAgICAgICAgZWxz ZSBpZiAoKHZwb3MgPT0gdm50aF9kbSB8fCB2cG9zID09IHZudGhfY20pCisgICAgICAgICAgICAg ICAgICYmIGdseXBoX2ZsYXZvciA9PSBNQ19PVkVSTEFZX0FSUk9XX0JJVE1BUAorICAgICAgICAg ICAgICAgICAmJiAoaHNjbF9hbGxfdGVtcF9wCisgICAgICAgICAgICAgICAgICAgICB8fCBoc2Ns X2FsbF9wZXJtXzBfcAorICAgICAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8xX3AK KyAgICAgICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxsX3Blcm1fMl9wCisgICAgICAgICAgICAg ICAgICAgICB8fCBoc2NsX3RlbXBfcAorICAgICAgICAgICAgICAgICAgICAgfHwgaHNjbF9wZXJt X3ApCisgICAgICAgICAgICAgICAgICYmIGVuYWJsZWRfcCkKKyAgICAgICAgICB7CisgICAgICAg ICAgICBpbnQgZnJpbmdlX2JpdG1hcCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgICAg ICBlbnVtIGZhY2VfaWQgb3ZlcmxheV9hcnJvd19mYWNlX2lkID0KKyAgICAgICAgICAgICAgKCFh Y3RpdmVfcAorICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRl bnRzKSwgY2hfaW5hY3RpdmVfd2luZG93cykpKQorICAgICAgICAgICAgICA/IGxvb2t1cF9kZXJp dmVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1oc2NsLWluYWN0aXZlLXBy ZS16di1mYWNlIiksIEZSSU5HRV9GQUNFX0lELCB0cnVlKQorICAgICAgICAgICAgICA6IChhY3Rp dmVfcCkKKyAgICAgICAgICAgICAgICA/IGxvb2t1cF9kZXJpdmVkX2ZhY2UgKHcsIGYsIGludGVy biAoIistb3ZlcmxheS1hcnJvdy1oc2NsLXByZS16di1mYWNlIiksIEZSSU5HRV9GQUNFX0lELCB0 cnVlKQorICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICAgIG1jX2xl ZnRfZnJpbmdlX2ZhY2VfaWQgPSAoY3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQ KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IG92ZXJsYXlfYXJyb3df ZmFjZV9pZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRf RkFDRV9JRDsKKyAgICAgICAgICAgIGlmIChoc2NsX2FsbF9wZXJtXzBfcCkKKyAgICAgICAgICAg ICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhz Y2wtcGVybSIpLCBmYWxzZSwgZmFsc2UpOworICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX2Fs bF9wZXJtXzFfcCkKKyAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5n ZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIHRydWUsIGZhbHNlKTsKKyAgICAg ICAgICAgICAgICBlbHNlIGlmIChoc2NsX2FsbF9wZXJtXzJfcCkKKyAgICAgICAgICAgICAgICAg IGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2Ns LXBlcm0iKSwgZmFsc2UsIHRydWUpOworICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF9w ZXJtX3ApCisgICAgICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdl X2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgdHJ1ZSwgdHJ1ZSk7CisgICAgICAg ICAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xfYWxsX3RlbXBfcCkKKyAgICAgICAgICAgICAgICAg ICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIist aHNjbC10ZW1wIiksIGZhbHNlLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgZWxzZSBp ZiAoaHNjbF90ZW1wX3ApCisgICAgICAgICAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0g bWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC10ZW1wIiksIHRydWUsIGZh bHNlKTsKKyAgICAgICAgICAgIG1jX2xlZnRfZnJpbmdlX2JpdG1hcCA9IChjdXJzb3JfdHlwZSA9 PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBmcmluZ2VfYml0bWFwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlm ICgodnBvcyA9PSB2bnRoX2RtIHx8IHZwb3MgPT0gdm50aF9jbSkKKyAgICAgICAgICAgICAgICAg ICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisg ICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9M TE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5 cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEUKKyAgICAgICAgICAgICAgICAgICAgICAg IHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAg ICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9C QVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9 PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZv ciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8 IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIKQorICAgICAgICAgICAg ICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIExpc3Bf T2JqZWN0IGJpdG1hcF9mbGF2b3IgPSAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5H TEVfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9M TE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJv dworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxh dm9yID09IE1DX0hPTExPV19SRUNUQU5HTEUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gUW1jX2hvbGxvd19yZWN0YW5nbGUKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9C QVJfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID8gUW1jX3ZlcnRpY2FsX2Jhcl9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJ Q0FMX0JBUl9SSUdIVF9BUlJPVykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNf VkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IFFtY192ZXJ0aWNhbF9iYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX3Zl cnRpY2FsX2JhcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAo Z2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jhcl9iYWNrc2xh c2gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogUW5pbDsKKyAg ICAgICAgICAgICAgbWNfcmlnaHRfZnJpbmdlX2JpdG1hcCA9IChjdXJzb3JfdHlwZSA9PSBNQ19S SUdIVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID8gbG9va3VwX2ZyaW5nZV9iaXRtYXAgKGJpdG1hcF9mbGF2b3IpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAg ICAgICAgICBtY19yaWdodF9mcmluZ2VfZmFjZV9pZCA9CisgICAgICAgICAgICAgICAgKGN1cnNv cl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgJiYgcm93 X3Bvc2l0aW9uID09IFBSRV9aVgorICAgICAgICAgICAgICAgICAmJiAoZ2x5cGhfZmxhdm9yID09 IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAg ICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRf QVJST1cKKyAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNF RF9WRVJUSUNBTF9CQVIpKQorICAgICAgICAgICAgICAgICAgPyBsb29rdXBfZGVyaXZlZF9mYWNl ICh3LCBmLCBpbnRlcm4gKCIrLXJldmVyc2VkLWJhci1wcmUtenYtZmFjZSIpLCBGUklOR0VfRkFD RV9JRCwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9G UklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IEFUX1pW CisgICAgICAgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xM T1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBo X2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAg ICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JB UikpCisgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9kZXJpdmVkX2ZhY2UgKHcsIGYsIGludGVy biAoIistcmV2ZXJzZWQtYmFyLWF0LXp2LWZhY2UiKSwgRlJJTkdFX0ZBQ0VfSUQsIHRydWUpCisg ICAgICAgICAgICAgICAgOiAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAor ICAgICAgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQT1NUX1pWCisgICAgICAgICAg ICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xF X1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBN Q19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAg ICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikpCisgICAgICAg ICAgICAgICAgICA/IGxvb2t1cF9kZXJpdmVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmV2ZXJz ZWQtYmFyLXBvc3QtenYtZmFjZSIpLCBGUklOR0VfRkFDRV9JRCwgdHJ1ZSkKKyAgICAgICAgICAg ICAgICA6IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisgICAgICAgICAg ICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVgorICAgICAgICAgICAgICAgICAgICYm IGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9X CisgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX1ZFUlRJ Q0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAh PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9k ZXJpdmVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistYmFyLXByZS16di1mYWNlIiksIEZSSU5HRV9G QUNFX0lELCB0cnVlKQorICAgICAgICAgICAgICAgIDogKGN1cnNvcl90eXBlID09IE1DX1JJR0hU X0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gPT0gQVRf WlYKKyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfSE9M TE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2Zs YXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAg ICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAg ICAgICAgICAgICAgICAgPyBsb29rdXBfZGVyaXZlZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLWJh ci1hdC16di1mYWNlIiksIEZSSU5HRV9GQUNFX0lELCB0cnVlKQorICAgICAgICAgICAgICAgIDog KGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAg ICAmJiByb3dfcG9zaXRpb24gPT0gUE9TVF9aVgorICAgICAgICAgICAgICAgICAgICYmIGdseXBo X2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAg ICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JB Ul9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19S RVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9kZXJpdmVk X2ZhY2UgKHcsIGYsIGludGVybiAoIistYmFyLXBvc3QtenYtZmFjZSIpLCBGUklOR0VfRkFDRV9J RCwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICAg IH0KKyAgICAgICAgfQorICAgICAgaWYgKCFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgcm93ID0g Y3VyOworICAgICAgbGVmdF9mYWNlX2lkID0gcmlnaH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dF96dl9wKQorICAgICAgICAgICAgICAgICA6IE1DX0xFRlRfRlJJTkdFICgyLCBRdG9wLCAwKSk7 CisgICAgICAgICAgaWYgKHRvcF9pbmRfbWluX3kgPj0gMCkKKyAgICAgICAgICAgIGxlZnRfb2Zm c2V0ID0gdG9wX2luZF9taW5feSAtIHJvdy0+eTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAo cm93LT5pbmRpY2F0ZV9lb2JfcCAmJiBFUSAoYm91bmRhcnlfYm90LCBRbGVmdCkpCisgICAgICAg IHsKKyAgICAgICAgICBsZWZ0ID0gTUNfTEVGVF9GUklOR0UgKDMsIFFib3R0b20sIGJvdF9yb3df ZW5kc19hdF96dl9wKTsKKyAgICAgICAgICBpZiAoYm90X2luZF9tYXhfeSA+PSAwKQorICAgICAg ICAgICAgbGVmdF9vZmZzZXQgPSBib3RfaW5kX21heF95IC0gKHJvdy0+eSArIHJvdy0+dmlzaWJs ZV9oZWlnaHQpOworICAgICAgICB9CisgICAgICBlbHNlIGlmICgoIXJvdy0+cmV2ZXJzZWRfcCAm JiBNQVRSSVhfUk9XX0NPTlRJTlVBVElPTl9MSU5FX1AgKHJvdykpCisgICAgICAgICAgICAgICB8 fCAocm93LT5yZXZlcnNlZF9wICYmIHJvdy0+Y29udGludWVkX3ApKQorICAgICAgICBsZWZ0ID0g TUNfTEVGVF9GUklOR0UgKDQsIFFjb250aW51YXRpb24sIDApOworICAgICAgZWxzZSBpZiAocm93 LT5pbmRpY2F0ZV9lbXB0eV9saW5lX3AgJiYgRVEgKGVtcHR5X3BvcywgUWxlZnQpKQorICAgICAg ICBsZWZ0ID0gTUNfTEVGVF9GUklOR0UgKDUsIFFlbXB0eV9saW5lLCAwKTsKKyAgICAgIGVsc2Ug aWYgKHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcCAmJiBFUSAoYXJyb3dfdG9wLCBRbGVmdCkpCisg ICAgICAgIHsKKyAgICAgICAgICBsZWZ0ID0gTUNfTEVGVF9GUklOR0UgKDYsIFF1cCwgMCk7Cisg ICAgICAgICAgaWYgKHRvcF9pbmRfbWluX3kgPj0gMCkKKyAgICAgICAgICAgIGxlZnRfb2Zmc2V0 ID0gdG9wX2luZF9taW5feSAtIHJvdy0+eTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAocm93 LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wICYmIEVRIChhcnJvd19ib3QsIFFsZWZ0KSkKKyAgICAg ICAgeworICAgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAoNywgUWRvd24sIDApOworICAg ICAgICAgIGlmIChib3RfaW5kX21heF95ID49IDApCisgICAgICAgICAgICBsZWZ0X29mZnNldCA9 IGJvdF9pbmRfbWF4X3kgLSAocm93LT55ICsgcm93LT52aXNpYmxlX2hlaWdodCk7CisgICAgICAg IH0KKyAgICAgIGVsc2UKKyAgICAgICAgbGVmdCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAg ICAvKiBEZWNpZGUgd2hpY2ggYml0bWFwIHRvIGRyYXcgaW4gdGhlIHJpZ2h0IGZyaW5nZS4gKi8K KyAgICAgIGlmIChXSU5ET1dfUklHSFRfRlJJTkdFX1dJRFRIICh3KSA9PSAwKQorICAgICAgICBy aWdodCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICBlbHNlIGlmIChyb3ctPnJpZ2h0X3Vz ZXJfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICB7CisgICAg ICAgICAgcmlnaHQgPSByb3ctPnJpZ2h0X3VzZXJfZnJpbmdlX2JpdG1hcDsKKyAgICAgICAgICBy aWdodF9mYWNlX2lkID0gcm93LT5yaWdodF91c2VyX2ZyaW5nZV9mYWNlX2lkOworICAgICAgICB9 CisgICAgICBlbHNlIGlmICgoIXJvdy0+cmV2ZXJzZWRfcCAmJiByb3ctPnRydW5jYXRlZF9vbl9y aWdodF9wKQorICAgICAgICAgICAgICAgfH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k9f RlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAgfHwgbWNfcmlnaHRfZnJpbmdlX2JpdG1h cCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgIGN1ci0+ZnJpbmdlX2Jp dG1hcF9wZXJpb2RpY19wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAg ICAgICAgICAgY3VyLT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3AgPSBwZXJpb2RpY19wOworICAg ICAgICAgICAgICBpZiAobWNfbGVmdF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRN QVApCisgICAgICAgICAgICAgICAgY3VyLT5sZWZ0X2ZyaW5nZV9iaXRtYXAgPSBtY19sZWZ0X2Zy aW5nZV9iaXRtYXA7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgY3Vy LT5sZWZ0X2ZyaW5nZV9iaXRtYXAgPSBsZWZ0OworICAgICAgICAgICAgICBpZiAobWNfbGVmdF9m cmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgY3Vy LT5sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gbWNfbGVmdF9mcmluZ2VfZmFjZV9pZDsKKyAgICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPmxlZnRfZnJpbmdlX2ZhY2VfaWQg PSBsZWZ0X2ZhY2VfaWQ7CisgICAgICAgICAgICAgIGlmIChtY19sZWZ0X2ZyaW5nZV9iaXRtYXAg IT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICBjdXItPmxlZnRfZnJpbmdl X29mZnNldCA9IDA7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgY3Vy LT5sZWZ0X2ZyaW5nZV9vZmZzZXQgPSBsZWZ0X29mZnNldDsKKyAgICAgICA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93X2JpdG1hcCkKKyAgICAgICAgeworICAgICAgICAgIHJl ZHJhd19wID0gMSwgcm93LT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcCA9IDE7CisgICAgICAgICAg aWYgKCFrZWVwX2N1cnJlbnRfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY3VyLT5y ZWRyYXdfZnJpbmdlX2JpdG1hcHNfcCA9IDE7CisgICAgICAgICAgICAgIGN1ci0+b3ZlcmxheV9h cnJvd19iaXRtYXAgPSByb3ctPm92ZXJsYXlfYXJyb3dfYml0bWFwOworICAgICAgICAgICAgfQor ICAgICAgICB9CisgICAgICBpZiAobWNfbGVmdF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5H RV9CSVRNQVAKKyAgICAgICAgICB8fCBtY19yaWdodF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZS SU5HRV9CSVRNQVApCisgICAgICAgIHJvdy0+ZnJpbmdlX2JpdG1hcF9wZXJpb2RpY19wID0gZmFs c2U7CisgICAgICAgIGVsc2UKKyAgICAgICAgICByb3ctPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNf cCA9IHBlcmlvZGljX3A7CisgICAgICBpZiAobWNfbGVmdF9mcmluZ2VfYml0bWFwICE9IE1DX05P X0ZSSU5HRV9CSVRNQVApCisgICAgICAgIHJvdy0+bGVmdF9mcmluZ2VfYml0bWFwID0gbWNfbGVm dF9mcmluZ2VfYml0bWFwOworICAgICAgICBlbHNlCisgICAgICAgICAgcm93LT5sZWZ0X2ZyaW5n ZV9iaXRtYXAgPSBsZWZ0OworICAgICAgaWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19O T19GUklOR0VfQklUTUFQKQorICAgICAgICByb3ctPmxlZnRfZnJpbmdlX2ZhY2VfaWQgPSBtY19s ZWZ0X2ZyaW5nZV9mYWNlX2lkOworICAgICAgICBlbHNlCisgICAgICAgICAgcm93LT5sZWZ0X2Zy aW5nZV9mYWNlX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3ct PnZpc2libGVfaGVpZ2h0OworICBpZiAobGVmdF9wKQorICAgIHsKKyAgICAgIGludCB3ZCA9IFdJ TkRPV19MRUZUX0ZSSU5HRV9XSURUSCAodyk7CisgICAgICBpbnQgeCA9IHdpbmRvd19ib3hfbGVm dCAodywgKFdJTkRPV19IQVNfRlJJTkdFU19PVVRTSURFX01BUkdJTlMgKHcpCisgICAgICAgICAg ID8gTEVGVF9NQVJHSU5fQVJFQQorICAgICAgICAgICA6IFRFWFRfQVJFQSkpOworICAgICAgaWYg KHAud2QgPiB3ZCkKKyAgICAgICAgcC53ZCA9IHdkOworICAgICAgcC54ID0geCAtIHAud2QgLSAo d2QgLSBwLndkKSAvIDI7CisgICAgICBpZiAocC53ZCA8IHdkIHx8IHAueSA+IHAuYnkgfHwgcC55 ICsgcC5oIDwgcC5ieSArIHAubnkpCisgICAgICAgIHsKKyAgICAgICAgICAvKiBJZiBXIGhhcyBh IHZlcnRpY2FsIGJvcmRlciB0byBpdHMgbGVmdCwgZG9uJ3QgZHJhdyBvdmVyIGl0LiAqLworICAg ICAgICAgIHdkIC09ICgoIVdJTkRPV19MRUZUTU9TVF9QICh3KQorICAgICAgICAgICAgLyogVGhp cyBjb3VsZCBiZSB3cm9uZyB3aGVuIHdlIGFsbG93IHdpbmRvdyBsb2NhbAorICAgICAgICAgICAg ICAgcmlnaHQgZGl2aWRlcnMgLSBidXQgdGhlIHdpbmRvdyBvbiB0aGUgbGVmdCBpcyBoYXJkCisg ICAgICAgICAgICAgICB0byBnZXQuICovCisgICAgICAgICAgICAmJiAhRlJBTUVfUklHSFRfRElW SURFUl9XSURUSCAoZikKKyAgICAgICAgICAgICYmICFXSU5ET1dfSEFTX1ZFUlRJQ0FMX1NDUk9M TF9CQVIgKHcpCisgICAgICAgICAgICAvKiBCdXQgZG9uJ3QgcmVkdWNlIHRoZSBmcmluZ2Ugd2lk dGggaWYgdGhlIHdpbmRvdworICAgICAgICAgICAgICAgaGFzIGEgbGVmdCBtYXJnaW4sIGJlY2F1 c2UgdGhhdCBtZWFucyB3ZSBhcmUgbm90CisgICAgICAgICAgICAgICBpbiBkYW5nZXIgb2YgZHJh d2luZyBvdmVyIHRoZSB2ZXJ0aWNhbCBib3JkZXIsCisgICAgICAgICAgICAgICBhbmQgT1RPSCBs ZWF2aW5nIG91dCB0aGF0IG9uZSBwaXhlbCBsZWF2ZXMgYmVoaW5kCisgICAgICAgICAgICAgICB0 cmFjZXMgb2YgdGhlIGN1cnNvciwgaWYgaXQgd2FzIGluIGNvbHVtbiB6ZXJvCisgICAgICAgICAg ICAgICBiZWZvcmUgZHJhd2luZyBub24tZW1wdHkgbWFyZ2luIGFyZWEuICovCisgICAgICAgICAg ICAmJiB3LT5sZWZ0X21hcmdpbl9jb2xzID09IDApCisgICAgICAgICAgID8gMSA6IDApOworICAg ICAgICAgIHAuYnggPSB4IC0gd2Q7CisgICAgICAgICAgcC5ueCA9IHdkOworICAgICAgICB9Cisg ICAgfQorICBlbHNlCisgICAgeworICAgICAgaW50IHggPSB3aW5kb3dfYm94X3JpZ2h0ICh3LAor ICAgICAgICAoV0lORE9XX0hBU19GUklOR0VTX09VVFNJREVfTUFSR0lOUyAodykKKyAgICAgICAg ID8gUklHSFRfTUFSR0lOX0FSRUEKKyAgICAgICAgIDogVEVYVF9BUkVBKSk7CisgICAgICBpbnQg d2QgPSBXSU5ET1dfUklHSFRfRlJJTkdFX1dJRFRIICh3KTsKKyAgICAgIGlmIChwLndkID4gd2Qp CisgICAgICAgIHAud2QgPSB3ZDsKKyAgICAgIHAueCA9IHggKyAod2QgLSBwLndkKSAvIDI7Cisg ICAgICAvKiBDbGVhciByaWdodCBmcmluZ2UgaWYgbm8gYml0bWFwIHRvIGRyYXcgb2YgaWYgYml0 bWFwIGRvZXNuJ3QgZmlsbAorICAgdGhlIGZyaW5nZS4gKi8KKyAgICAgIGlmIChwLndkIDwgd2Qg fHwgcC55ID4gcC5ieSB8fCBwLnkgKyBwLmggPCBwLmJ5ICsgcC5ueSkKKyAgICAgICAgeworICAg ICAgICAgIHAuYnggPSB4OworICAgICAgICAgIHAubnggPSB3ZDsKKyAgICAgICAgfQorICAgIH0K KyAgaWYgKHAueCA+PSBXSU5ET1dfQk9YX0xFRlRfRURHRV9YICh3KQorICAgICAgJiYgKHAueCAr IHAud2QpIDw9IFdJTkRPV19CT1hfTEVGVF9FREdFX1ggKHcpICsgV0lORE9XX1BJWEVMX1dJRFRI ICh3KSkKKyAgICBGUkFNRV9SSUYgKGYpLT5kcmF3X2ZyaW5nZV9iaXRtYXAgKHcsIHJvdywgJnAp OworfQorCit2b2lkCittY19kcmF3X2ZyaW5nZV9iaXRtYXAgKHN0cnVjdCB3aW5kb3cgKncsIHN0 cnVjdCBnbHlwaF9yb3cgKnJvdywgaW50IGxlZnRfcCwgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJz b3JfdHlwZSkKK3sKKyAgaW50IG92ZXJsYXkgPSAwOworICBpZiAobGVmdF9wID09IHJvdy0+cmV2 ZXJzZWRfcCAmJiByb3ctPmN1cnNvcl9pbl9mcmluZ2VfcCkKKyAgICB7CisgICAgICBMaXNwX09i amVjdCBjdXJzb3IgPSBRbmlsOworICAgICAgc3dpdGNoIChjdXJzb3JfdHlwZSkKKyAgICAgICAg eworICAgICAgICBjYXNlIE1DX0ZSQU1FRF9CT1g6CisgICAgICAgICAgaWYgKHJvdy0+dmlzaWJs ZV9oZWlnaHQgPj0gU1RBTkRBUkRfQklUTUFQX0hFSUdIVCAoaG9sbG93X3JlY3RhbmdsZV9iaXRz KSkKKyAgICAgICAgICAgIGN1cnNvciA9IFFob2xsb3c7CisgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgY3Vyc29yID0gUWhvbGxvd19zbWFsbDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAg Y2FzZSBNQ19IT0xMT1dfQk9YOgorICAgICAgICAgIGlmIChyb3ctPnZpc2libGVfaGVpZ2h0ID49 IFNUQU5EQVJEX0JJVE1BUF9IRUlHSFQgKGhvbGxvd19yZWN0YW5nbGVfYml0cykpCisgICAgICAg ICAgICBjdXJzb3IgPSBRaG9sbG93OworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGN1cnNv ciA9IFFob2xsb3dfc21hbGw7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTUNfRklM TEVEX0JPWDoKKyAgICAgICAgICBjdXJzb3IgPSBRYm94OworICAgICAgICAgIGJyZWFrOworICAg ICAgICBjYXNlIE1DX0JBUjoKKyAgICAgICAgICBjdXJzb3IgPSBRYmFyOworICAgICAgICAgIGJy ZWFrOworICAgICAgICBjYXNlIE1DX0hCQVI6CisgICAgICAgICAgY3Vyc29yID0gUWhiYXI7Cisg ICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTUNfTk9fRlJJTkdFX0JJVE1BUDoKKyAgICAg ICAgY2FzZSBNQ19OT19DVVJTT1I6CisgICAgICAgIGNhc2UgTUNfUklHSFRfRlJJTkdFX0JJVE1B UDoKKyAgICAgICAgY2FzZSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGRlZmF1bHQ6 CisgICAgICAgICAgdy0+cGh5c19jdXJzb3Jfb25fcCA9IDA7CisgICAgICAgICAgcm93LT5jdXJz b3JfaW5fZnJpbmdlX3AgPSAwOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBp ZiAoIU5JTFAgKGN1cnNvcikpCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgYm0gPSBtY19nZXRf bG9naWNhbF9jdXJzb3JfYml0bWFwICh3LCBjdXJzb3IpOworICAgICAgICAgIGlmIChibSAhPSBN Q19OT19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19kcmF3 X2ZyaW5nZV9iaXRtYXBfMSAodywgcm93LCBsZWZ0X3AsIDIsIGJtKTsKKyAgICAgICAgICAgICAg b3ZlcmxheSA9IEVRIChjdXJzb3IsIFFib3gpID8gMyA6IDE7CisgICAgICAgICAgICB9CisgICAg ICAgIH0KKyAgICB9CisgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcF8xICh3LCByb3csIGxlZnRfcCwg b3ZlcmxheSwgTUNfTk9fRlJJTkdFX0JJVE1BUCk7CisgIGlmIChsZWZ0X3AgJiYgcm93LT5vdmVy bGF5X2Fycm93X2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgIG1jX2RyYXdfZnJp bmdlX2JpdG1hcF8xICh3LCByb3csIDEsIDEsIHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXApOwor fQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogI2RlZmluZSBOT19GUklOR0VfQklUTUFQIDAKICNkZWZpbmUgVU5ERUZfRlJJTkdFX0JJ VE1BUCAxCiAjZGVmaW5lIE1BWF9TVEFOREFSRF9GUklOR0VfQklUTUFQUyBBUlJBWUVMVFMgKHN0 YW5kYXJkX2JpdG1hcHMpCkBAIC0xNjk5LDYgKzMyMTcsMTY4IEBAIFJldHVybiBuaWwgaWYgUE9T IGlzIG5vdCB2aXNpYmxlIGluIFdJTkRPVy4gICovKQogdm9pZAogc3ltc19vZl9mcmluZ2UgKHZv aWQpCiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1D VVJTT1JTICovCisKKyAgLyogKGdldCAnZW1wdHktbGluZSAnZnJpbmdlKSA9PiAyMyA9PiB0aGUg bGFzdCBzdGFuZGFyZC1iaXRtYXAgYmVmb3JlIHRoaXMgb25lLgorICBTZWUgYGZyaW5nZS5lbGAu ICovCisKKyAgLyogMjQgKi8KKyAgREVGU1lNIChRbWNfdmVydGljYWxfY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qKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogICBERUZTWU0gKFF0cnVuY2F0aW9uLCAidHJ1bmNhdGlvbiIpOwogICBERUZT WU0gKFFjb250aW51YXRpb24sICJjb250aW51YXRpb24iKTsKICAgREVGU1lNIChRb3ZlcmxheV9h cnJvdywgIm92ZXJsYXktYXJyb3ciKTsKZGlmZiAtLWdpdCBhL3NyYy9uc3Rlcm0uaCBiL3NyYy9u c3Rlcm0uaAppbmRleCA5NzczZWIzLi5lMzRhMTE2IDEwMDY0NAotLS0gYS9zcmMvbnN0ZXJtLmgK KysrIGIvc3JjL25zdGVybS5oCkBAIC02NjMsNiArNjYzLDE2IEBAIHR5cGVkZWYgaWQgaW5zdGFu Y2V0eXBlOwogCiBAaW50ZXJmYWNlIEVtYWNzU2Nyb2xsZXIgOiBOU1Njcm9sbGVyCiAgIHsKKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAg IE5TUmVjdCBtY19yZWN0YW5nbGU7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAg IHN0cnVjdCB3aW5kb3cgKndpbmRvdzsKICAgIHN0cnVjdCBmcmFtZSAqZnJhbWU7CiAgICBOU1Jl c3BvbmRlciAqcHJldlJlc3BvbmRlcjsKQEAgLTY4Myw2ICs2OTMsMTggQEAgdHlwZWRlZiBpZCBp bnN0YW5jZXR5cGU7CiAgICBpbnQgZW1fd2hvbGU7CiAgICB9CiAKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy0gKHZvaWQpbWNfc2V0X3JlY3Rh bmdsZTogKE5TUmVjdClyZWN0OworLSAoTlNSZWN0KW1jX2dldF9yZWN0YW5nbGU7CistIChzdHJ1 Y3Qgd2luZG93ICopbWNfZ2V0X3dpbmRvdzsKKy0gKGJvb2wpbWNfanVkZ2U7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKIC0gKGluc3RhbmNldHlwZSkgaW5pdEZyYW1lOiAoTlNSZWN0 IClyIHdpbmRvdzogKExpc3BfT2JqZWN0KXdpbjsKIC0gKHZvaWQpc2V0RnJhbWU6IChOU1JlY3Qp cjsKIApkaWZmIC0tZ2l0IGEvc3JjL25zdGVybS5tIGIvc3JjL25zdGVybS5tCmluZGV4IDAyMzMx ODIuLmFmNzkzOWIgMTAwNjQ0Ci0tLSBhL3NyYy9uc3Rlcm0ubQorKysgYi9zcmMvbnN0ZXJtLm0K QEAgLTc2LDYgKzc2LDk3NiBAQCBVcGRhdGVkIGJ5IENocmlzdGlhbiBMaW1wYWNoIChjaHJpc0Bu aWNlLmNoKQogc3RhdGljIEVtYWNzTWVudSAqbWFpbk1lbnU7CiAjZW5kaWYKIAorCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExFLUNVUlNPUlMgKi8KKworc3RhdGlj IEJPT0wgbnNfY2xpcF90b19yZWN0IChzdHJ1Y3QgZnJhbWUgKiwgTlNSZWN0ICosIGludCk7CisK K3N0YXRpYyB2b2lkIG5zX3Jlc2V0X2NsaXBwaW5nIChzdHJ1Y3QgZnJhbWUgKik7CisKK3N0YXRp YyB2b2lkIG5zX2R1bXBnbHlwaHNfYm94X29yX3JlbGllZiAoc3RydWN0IGdseXBoX3N0cmluZyAq K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NoZV90eXBlXVtudGhdLmZnLmdy ZWVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0gbWNfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5mZy5ibHVlfTsKKyAgICAgICAgICAv LyAgc3RydWN0IG1jX1JHQiBsc2xfYmcgPSB7LnJlZCA9IG1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF0uYmcucmVkLAorICAgICAgICAgIC8vICAgICAgICAgICAgICAg ICAgICAgICAgICAuZ3JlZW4gPSBtY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLmJnLmdyZWVuLAorICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAu Ymx1ZSA9IG1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmcuYmx1 ZX07CisgICAgICAgICAgYm9vbCBhY3RpdmVfcCA9IG1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF0uYWN0aXZlX3A7CisgICAgICAgICAgLy8gIGVudW0gbWNfZmxhdm9y IGdseXBoX2ZsYXZvciA9IG1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF0uZ2x5cGhfZmxhdm9yOworICAgICAgICAgIGJvb2wgZW5hYmxlZF9wID0gbWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFibGVkX3A7CisgICAgICAgICAgYm9v bCBnb19wID0gKHZwb3MgPT0gdm50aAorICAgICAgICAgICAgICAgICAgICAgICAmJiBocG9zID09 IGN1cnNvcl9nbHlwaC0+aHBvcworICAgICAgICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3Ap OworICAgICAgICAgIGlmICghZ29fcCkKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAg IE5TUmVjdCByOworICAgICAgICAgIHIub3JpZ2luLnggPSBmeDsKKyAgICAgICAgICByLm9yaWdp bi55ID0gZnk7CisgICAgICAgICAgci5zaXplLmhlaWdodCA9IGg7CisgICAgICAgICAgci5zaXpl LndpZHRoID0gd2Q7CisgICAgICAgICAgW1tOU0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6 IGxzbF9mZy5yZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBncmVlbjog bHNsX2ZnLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJsdWU6 IGxzbF9mZy5ibHVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwaGE6 IDEuMF0gc2V0XTsKKyAgICAgIGlmIChjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YKQorICAg ICAgICB7CisgICAgICAgICAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKHMtPnctPmNvbnRl bnRzKTsKKyAgICAgICAgICBib29sIHJlZ2lvbl9hY3RpdmVfcCA9ICghTklMUCAoVnRyYW5zaWVu dF9tYXJrX21vZGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAg KEJWQVIgKGIsIG1hcmtfYWN0aXZlKSkpOworICAgICAgICAgIHB0cmRpZmZfdCByZWdpb25fYmVn ID0gKHJlZ2lvbl9hY3RpdmVfcCkgPyBtY19yZWdpb25fbGltaXQgKDEpIDogLTE7CisgICAgICAg ICAgcHRyZGlmZl90IHJlZ2lvbl9lbmQgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IG1jX3JlZ2lvbl9s aW1pdCAoMCkgOiAtMTsKKyAgICAgICAgICBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAg ICAgICYmIGFjdGl2ZV9wCisgICAgICAgICAgICAgICYmIGN1cnNvcl9nb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XZlX3JlZ2lv bl9iZXR3ZWVuX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgTlNDb2xvciAqaG9sbG93X2Fj dGl2ZV9yZWdpb25fYmV0d2Vlbl9jb2xvciA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19G QUNFX0ZPUkVHUk9VTkQgKGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZSksIHMtPmYp OworICAgICAgICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2FjdGl2ZV9yZWdpb25f YmV0d2Vlbl9jb2xvcjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSBp ZiAoYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGVu dW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+ dywgcy0+ZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUp OworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0g RkFDRV9GUk9NX0lEIChzLT5mLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAg ICAgICAgICBOU0NvbG9yICpob2xsb3dfYWN0aXZlX2NvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRf Y29sb3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoaG9sbG93X2FjdGl2ZV9mYWNlKSwgcy0+Zik7Cisg ICAgICAgICAgICAgICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19hY3RpdmVfY29sb3I7Cisg ICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmICghYWN0aXZlX3Ap CisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2Vf aWQgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ ZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRy dWUpOworICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVf ZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAg ICAgICAgICAgICAgICAgICAgIE5TQ29sb3IgKmhvbGxvd19pbmFjdGl2ZV9jb2xvciA9IG5zX2xv b2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGhvbGxvd19pbmFjdGl2ZV9m YWNlKSwgcy0+Zik7CisgICAgICAgICAgICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9sbG93 X2luYWN0aXZlX2NvbG9yOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAg ICAgZWxzZSBpZiAoZmFjZSAmJiBOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpID09IG5zX2luZGV4 X2NvbG9yIChGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpLCBzLT5mKSkKKyAgICAgICAgICB7Cisg ICAgICAgICAgICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAo ZmFjZSksIHMtPmYpIHNldF07CisgICAgICAgICAgICBob2xsb3dfY29sb3IgPSBGUkFNRV9DVVJT T1JfQ09MT1IgKHMtPmYpOworICAgICAgICAgIH0KKyAgICAgICAgICBzd2l0Y2ggKGN1cnNvcl90 eXBlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBjYXNlIE1DX05PX0ZSSU5HRV9CSVRN QVA6CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgTUNfTk9fQ1VS U09SOgorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX1JJR0hU X0ZSSU5HRV9CSVRNQVA6CisgICAgICAgICAgICAgIGNhc2UgTUNfTEVGVF9GUklOR0VfQklUTUFQ OgorICAgICAgICAgICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAgICAgICAgICAgICAgTlNS ZWN0RmlsbCAocik7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2Ug TUNfRlJBTUVEX0JPWDoKKyAgICAgICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAg ICAgICAgICBbaG9sbG93X2NvbG9yIHNldF07CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAo TlNJbnNldFJlY3QgKHIsIDEsIDEpKTsKKyAgICAgICAgICAgICAgICBbRlJBTUVfQ1VSU09SX0NP TE9SIChzLT5mKSBzZXRdOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBj YXNlIE1DX0hPTExPV19CT1g6CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAg ICAgICAgICAgICAgW2hvbGxvd19jb2xvciBzZXRdOworICAgICAgICAgICAgICAgIE5TUmVjdEZp bGwgKE5TSW5zZXRSZWN0IChyLCAxLCAxKSk7CisgICAgICAgICAgICAgICAgW0ZSQU1FX0NVUlNP Ul9DT0xPUiAocy0+Zikgc2V0XTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAg ICAgY2FzZSBNQ19IQkFSOgorICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAg ICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX0JBUjoKKyAgICAgICAgICAg ICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAg IH0KKyAgIC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X2dseXBoX3N0cmluZ19mb3JlZ3Jv dW5kIChzKTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgICAgIHN0cnVjdCBmb250ICpmb250ID0gcy0+ZmFjZS0+Zm9udDsKKyAgICAg ICAgICAgICAgICAgICAgaWYgKCFmb250KQorICAgICAgICAgICAgICAgICAgICAgIGZvbnQgPSBG UkFNRV9GT05UIChzLT5mKTsKKyAgICAgICAgICAgICAgICAgICAgYm9vbCB3aXRoX2JnX3AgPSBm YWxzZTsKKyAgICAgICAgICAgICAgICAgICAgZm9udC0+ZHJpdmVyLT5kcmF3IChzLCBzLT5jbXBf ZnJvbSwgcy0+bmNoYXJzLCBzLT54LCBzLT55YmFzZSwgd2l0aF9iZ19wKTsKKyAgICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgLy8gIGNsb2NrX3Qg Y2xvY2tfZW5kID0gY2xvY2soKTsKKyAgLy8gIGRvdWJsZSBjcHVfdGltZV91c2VkID0gKChkb3Vi bGUpIChjbG9ja19lbmQgLSBjbG9ja19zdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7CisgIC8vICBm cHJpbnRmIChzdGRlcnIsICJuc19kcmF3X292ZXJ3cml0dGVuICglZCk6ICBUSU1FICglZilcbiIs IHZwb3MsIGNwdV90aW1lX3VzZWQpOworfQorCitzdGF0aWMgdm9pZAorbWNfbnNfZHJhd193aW5k b3dfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgs IHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKKyAgICAgICAgICAgICAgICAgIGludCB4LCBpbnQgZngs IGludCB5LCBpbnQgZnksIGludCBocG9zLCBpbnQgdnBvcywgaW50IHdkLCBpbnQgaCwKKyAgICAg ICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsL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ICAgTGlzcF9PYmplY3QgZm9yZWdyb3VuZCA9IGZhY2UtPmxmYWNlW0xG QUNFX0ZPUkVHUk9VTkRfSU5ERVhdOworICAgICBMaXNwX09iamVjdCBiYWNrZ3JvdW5kID0gZmFj ZS0+bGZhY2VbTEZBQ0VfQkFDS0dST1VORF9JTkRFWF07CisgICAgIGZwcmludGYgKHN0ZGVyciwg IlxuZm9yZWdyb3VuZCAoJXMpIHwgYmFja2dyb3VuZCAoJXMpXG4iLAorICAgICAgICAgICAgICAg ICAgICAgICghTklMUCAoZm9yZWdyb3VuZCkgPyBTU0RBVEEgKGZvcmVncm91bmQpIDogIk5JTFAi KSwKKyAgICAgICAgICAgICAgICAgICAgICAoIU5JTFAgKGJhY2tncm91bmQpID8gU1NEQVRBIChi YWNrZ3JvdW5kKSA6ICJOSUxQIikpOworICAtICBFWEFNUExFIE9GIEhPVyBUTyBDUkVBVEUgQSBD T0xPUiBXSVRIIFJHQi9MU0wgZmxvYXQgdmFsdWVzOgorICAgICBOU0NvbG9yICpteV9jb2xvciA9 IFtOU0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6IDEuMAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JlZW46IDEuMAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJsdWU6IDEuMAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwaGE6IDEuMF07 CisgIC0gIEFMVEVSTkFUSVZFIEVYQU1QTEU6CisgICAgIGVudW0gZmFjZV9pZCBkZWJ1Z2dpbmdf ZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlIChzLT53LCBzLT5mLCBpbnRlcm4gKCIrLWRlYnVn Z2luZy1mYWNlIiksIHRydWUpOworICAgICBzdHJ1Y3QgZmFjZSAqZGVidWdnaW5nX2ZhY2UgPSBG QUNFX0ZST01fSUQgKHMtPmYsIGRlYnVnZ2luZ19mYWNlX2lkKTsKKyAgICAgTlNDb2xvciAqY29s b3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChkZWJ1Z2dp bmdfZmFjZSksIHMtPmYpOworICAgICBbY29sb3Igc2V0XTsgKi8KKyAgaWYgKGdseXBoX2ZsYXZv ciA9PSBNQ19HTFlQSAorICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBITEVTUykKKyAg ICBbW05TQ29sb3IgY29sb3JXaXRoQ2FsaWJyYXRlZFJlZDogbHNsLnJlZAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGdyZWVuOiBsc2wuZ3JlZW4KKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgYmx1ZTogbHNsLmJsdWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBhbHBoYTogMS4wXSBzZXRdOworICAgIGVsc2UKKyAgICAgIFtGUkFNRV9DVVJTT1JfQ09MT1Ig KGYpIHNldF07CisgIGlmIChjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YKQorICAgIHsKKyAg ICAgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSICh3LT5jb250ZW50cyk7CisgICAgICBib29s IHJlZ2lvbl9hY3RpdmVfcCA9ICghTklMUCAoVnRyYW5zaWVudF9tYXJrX21vZGUpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgbWFya19hY3RpdmUpKSk7 CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2JlZyA9IChyZWdpb25fYWN0aXZlX3ApID8gbWNfcmVn aW9uX2xpbWl0ICgxKSA6IC0xOworICAgICAgcHRyZGlmZl90IHJlZ2lvbl9lbmQgPSAocmVnaW9u X2FjdGl2ZV9wKSA/IG1jX3JlZ2lvbl9saW1pdCAoMCkgOiAtMTsKKyAgICAgIG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mYWNlIiksIHRydWUpOworICAgICAgICAgICAgc3RydWN0IGZhY2Ug KmhvbGxvd19hY3RpdmVfcmVnaW9uX2VuZF9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3df YWN0aXZlX3JlZ2lvbl9lbmRfZmFjZV9pZCk7CisgICAgICAgICAgICBOU0NvbG9yICpob2xsb3df YWN0aXZlX3JlZ2lvbl9lbmRfY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFD RV9CQUNLR1JPVU5EIChob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZSksIGYpOworICAgICAg ICAgICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2NvbG9yOworICAg ICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAg ICAgICAgICAmJiBhY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+ Y2hhcnBvcyA+IHJlZ2lvbl9iZWcKKyAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgt PmNoYXJwb3MgPCByZWdpb25fZW5kKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBlbnVt IGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNlX2lkID0gbG9va3VwX25h bWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbi1yZWdpb24tcHJl LXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0 aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVf cmVnaW9uX2JldHdlZW5fZmFjZV9pZCk7CisgICAgICAgICAgICAgIE5TQ29sb3IgKmhvbGxv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fz ZSBNQ19OT19DVVJTT1I6CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19SSUdIVF9GUklO R0VfQklUTUFQOgorICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfTEVGVF9GUklOR0VfQklU TUFQOgorICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAgICAgICAg TlNSZWN0RmlsbCAocik7CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19GUkFNRURfQk9Y OgorICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgW2hvbGxvd19jb2xvciBzZXRdOwor ICAgICAgICBOU1JlY3RGaWxsIChOU0luc2V0UmVjdCAociwgMSwgMSkpOworICAgICAgICBbRlJB TUVfQ1VSU09SX0NPTE9SIChmKSBzZXRdOworICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNf SE9MTE9XX0JPWDoKKyAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgIFtob2xsb3dfY29s b3Igc2V0XTsKKyAgICAgICAgTlNSZWN0RmlsbCAoTlNJbnNldFJlY3QgKHIsIDEsIDEpKTsKKyAg ICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAoZikgc2V0XTsKKyAgICAgICAgYnJlYWs7CisgICAg ICBjYXNlIE1DX0hCQVI6CisgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICBicmVhazsK KyAgICAgIGNhc2UgTUNfQkFSOgorICAgICAgICBzID0gcjsKKyAgICAgICAgLyogQGxhd2xpc3Qg aXMgZm9jdXNpbmcgdGhlIGluaXRpYWwgZGV2ZWxvcG1lbnQgb2YgZmVhdHVyZSByZXF1ZXN0cwor ICAgICAgICAjMTc2ODQgYW5kICMyMjg3MyBvbiBMMlIgbGFuZ3VhZ2VzLiAqLworICAgICAgICBp ZiAoZ2x5cGhfZmxhdm9yICE9IE1DX0dMWVBICisgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3Ig IT0gTUNfR0xZUEhMRVNTKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIC8qIElmIHRoZSBjaGFy YWN0ZXIgdW5kZXIgY3Vyc29yIGlzIFIyTCwgZHJhdyB0aGUgYmFyIGN1cnNvcgorICAgICAgICAg ICAgICAgb24gdGhlIHJpZ2h0IG9mIGl0cyBnbHlwaCwgcmF0aGVyIHRoYW4gb24gdGhlIGxlZnQu ICovCisgICAgICAgICAgICBpZiAoKGN1cnNvcl9nbHlwaC0+cmVzb2x2ZWRfbGV2ZWwgJiAxKSAh PSAwKQorICAgICAgICAgICAgICBzLm9yaWdpbi54ICs9IGN1cnNvcl9nbHlwaC0+cGl4ZWxfd2lk dGggLSBzLnNpemUud2lkdGg7CisgICAgICAgICAgfQorICAgICAgICBOU1JlY3RGaWxsIChzKTsK KyAgICAgICAgYnJlYWs7CisgICAgfQorICBuc19yZXNldF9jbGlwcGluZyAoZik7CisgIC8qIGRy YXcgdGhlIGNoYXJhY3RlciB1bmRlciB0aGUgY3Vyc29yICovCisgIGlmIChnbHlwaF9mbGF2b3Ig IT0gTUNfR0xZUEhMRVNTCisgICAgICAmJiAoY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWAor ICAgICAgICAgIHx8IGN1cnNvcl90eXBlID09IE1DX0ZJTExFRF9CT1gKKyAgICAgICAgICB8fCBj dXJzb3JfdHlwZSA9PSBNQ19IT0xMT1dfQk9YCisgICAgICAgICAgfHwgKGRlYnVnX3AKKyAgICAg ICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gTUNfSEJBUikKKyAgICAgICAgICB8fCAoZGVidWdf cAorICAgICAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19CQVIpKSkKKyAgICB7CisgICAg ICAvKiBgY3Vyc29yX2djX3BgIGlzIHVzZWQgb25seSBieSBgdzMydGVybS5jYCBhbmQgYHh0ZXJt LmMnLiAqLworICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IGZ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S0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworeworICBpZiAocy0+Zm9yX292ZXJs YXBzKQorICAgIHJldHVybjsKKyAgLyogRG8gdW5kZXJsaW5lLiAqLworICBpZiAoZmFjZS0+dW5k ZXJsaW5lX3ApCisgICAgeworICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZB Q0VfVU5ERVJfV0FWRSkKKyAgICAgICAgeworICAgICAgICAgIGlmIChmYWNlLT51bmRlcmxpbmVf ZGVmYXVsdGVkX3ApCisgICAgICAgICAgICBbZGVmYXVsdENvbCBzZXRdOworICAgICAgICAgICAg ZWxzZQorICAgICAgICAgICAgICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKGZhY2UtPnVuZGVy bGluZV9jb2xvciwgcy0+Zikgc2V0XTsKKyAgICAgICAgICBuc19kcmF3X3VuZGVyd2F2ZSAocywg d2lkdGgsIHgpOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKHMtPmZhY2UtPnVuZGVybGlu ZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBOU1Jl Y3QgcjsKKyAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgdGhpY2tuZXNzLCBwb3NpdGlvbjsKKyAg ICAgICAgICAgIC8qIElmIHRoZSBwcmV2IHdhcyB1bmRlcmxpbmVkLCBtYXRjaCBpdHMgYXBwZWFy YW5jZS4gKi8KKyAgICAgICAgICAgIGlmIChzLT5wcmV2ICYmIHMtPnByZXYtPmZhY2UtPnVuZGVy bGluZV9wCisgICAgICAgICAgICAgICAgJiYgcy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUg PT0gRkFDRV9VTkRFUl9MSU5FCisgICAgICAgICAgICAgICAgJiYgcy0+cHJldi0+dW5kZXJsaW5l X3RoaWNrbmVzcyA+IDApCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB0aGlja25l c3MgPSBzLT5wcmV2LT51bmRlcmxpbmVfdGhpY2tuZXNzOworICAgICAgICAgICAgICAgIHBvc2l0 aW9uID0gcy0+cHJldi0+dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICB9CisgICAg ICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBzdHJ1 Y3QgZm9udCAqZm9udDsKKyAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZGVzY2VudDsK KyAgICAgICAgICAgICAgICAgIGZvbnQ9cy0+Zm9udDsKKyAgICAgICAgICAgICAgICAgIGRlc2Nl bnQgPSBzLT55ICsgcy0+aGVpZ2h0IC0gcy0+eWJhc2U7CisgICAgICAgICAgICAgICAgICAvKiBV c2UgdW5kZXJsaW5lIHRoaWNrbmVzcyBvZiBmb250LCBkZWZhdWx0aW5nIHRvIDEuICovCisgICAg ICAgICAgICAgICAgICB0aGlja25lc3MgPSAoZm9udCAmJiBmb250LT51bmRlcmxpbmVfdGhpY2tu ZXNzID4gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZm9udC0+dW5kZXJsaW5l X3RoaWNrbmVzcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAxOworICAgICAgICAg ICAgICAgICAgLyogRGV0ZXJtaW5lIHRoZSBvZmZzZXQgb2YgdW5kZXJsaW5pbmcgZnJvbSB0aGUg YmFzZWxpbmUuICovCisgICAgICAgICAgICAgICAgICBpZiAoeF91bmRlcmxpbmVfYXRfZGVzY2Vu dF9saW5lKQorICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IGRlc2NlbnQgLSB0aGlja25l c3M7CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHhfdXNlX3VuZGVybGluZV9wb3NpdGlv bl9wcm9wZXJ0aWVzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGZvbnQgJiYgZm9u dC0+dW5kZXJsaW5lX3Bvc2l0aW9uID49IDApCisgICAgICAgICAgICAgICAgICAgICAgcG9zaXRp b24gPSBmb250LT51bmRlcmxpbmVfcG9zaXRpb247CisgICAgICAgICAgICAgICAgICAgICAgZWxz ZSBpZiAoZm9udCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gbHJvdW5kIChm b250LT5kZXNjZW50IC8gMik7CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAg ICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0Owor ICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBtYXggKHBvc2l0aW9uLCB1bmRlcmxpbmVfbWlu aW11bV9vZmZzZXQpOworICAgICAgICAgICAgICAgICAgLyogRW5zdXJlIHVuZGVybGluaW5nIGlz IG5vdCBjcm9wcGVkLiAqLworICAgICAgICAgICAgICAgICAgaWYgKGRlc2NlbnQgPD0gcG9zaXRp b24pCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlv biA9IGRlc2NlbnQgLSAxOworICAgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IDE7Cisg ICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoZGVzY2Vu dCA8IHBvc2l0aW9uICsgdGhpY2tuZXNzKQorICAgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVz cyA9IDE7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgcy0+dW5kZXJsaW5lX3RoaWNr bmVzcyA9IHRoaWNrbmVzczsKKyAgICAgICAgICAgIHMtPnVuZGVybGluZV9wb3NpdGlvbiA9IHBv c2l0aW9uOworICAgICAgICAgICAgciA9IE5TTWFrZVJlY3QgKHgsIHMtPnliYXNlICsgcG9zaXRp b24sIHdpZHRoLCB0aGlja25lc3MpOworICAgICAgICAgICAgaWYgKGZhY2UtPnVuZGVybGluZV9k ZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsKKyAgICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoZmFjZS0+ dW5kZXJsaW5lX2NvbG9yLCBzLT5mKSBzZXRdOworICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7 CisgICAgICAgICAgfQorICAgIH0KKyAgLyogRG8gb3ZlcmxpbmUuIFdlIGZvbGxvdyBvdGhlciB0 ZXJtcyBpbiB1c2luZyBhIHRoaWNrbmVzcyBvZiAxCisgICAgIGFuZCBpZ25vcmluZyBvdmVybGlu ZV9tYXJnaW4uICovCisgIGlmIChmYWNlLT5vdmVybGluZV9wKQorICAgIHsKKyAgICAgIE5TUmVj dCByOworICAgICAgciA9IE5TTWFrZVJlY3QgKHgsIHMtPnksIHdpZHRoLCAxKTsKKyAgICAgIGlm IChmYWNlLT5vdmVybGluZV9jb2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgW2RlZmF1bHRDb2wg c2V0XTsKKyAgICAgICAgZWxzZQorICAgICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAo ZmFjZS0+b3ZlcmxpbmVfY29sb3IsIHMtPmYpIHNldF07CisgICAgICBOU1JlY3RGaWxsIChyKTsK KyAgICB9CisgIC8qIERvIHN0cmlrZS10aHJvdWdoLiAgV2UgZm9sbG93IG90aGVyIHRlcm1zIGZv ciB0aGlja25lc3MgYW5kCisgICAgIHZlcnRpY2FsIHBvc2l0aW9uLiovCisgIGlmIChmYWNlLT5z dHJpa2VfdGhyb3VnaF9wKQorICAgIHsKKyAgICAgIE5TUmVjdCByOworICAgICAgdW5zaWduZWQg bG9uZyBkeTsKKyAgICAgIGR5ID0gbHJpbnQgKChzLT5oZWlnaHQgLSAxKSAvIDIpOworICAgICAg ciA9IE5TTWFrZVJlY3QgKHgsIHMtPnkgKyBkeSwgd2lkdGgsIDEpOworICAgICAgaWYgKGZhY2Ut PnN0cmlrZV90aHJvdWdoX2NvbG9yX2RlZmF1bHRlZF9wKQorICAgICAgICBbZGVmYXVsdENvbCBz ZXRdOworICAgICAgICBlbHNlCisgICAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChm YWNlLT5zdHJpa2VfdGhyb3VnaF9jb2xvciwgcy0+Zikgc2V0XTsKKyAgICAgIE5TUmVjdEZpbGwg KHIpOworICAgIH0KK30KKworc3RhdGljIHZvaWQKK21jX25zX2R1bXBnbHlwaHNfc3RyZXRjaCAo c3RydWN0IGdseXBoX3N0cmluZyAqcywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LAorICAg ICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIHN0cnVjdCBtY19t YXRyaXggbWNfbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgd2QpCit7Cisg IE5TUmVjdCByWzJdOworICBpbnQgbiwgaTsKKyAgc3RydWN0IGZhY2UgKmZhY2U7CisgIE5TQ29s b3IgKmZnQ29sLCAqYmdDb2w7CisgIGlmICghcy0+YmFja2dyb3VuZF9maWxsZWRfcCkKKyAgICB7 CisgICAgICBuID0gbnNfZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsIHIpOworICAgICAg aWYgKCFuc19jbGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4pKQorICAgICAgICByZXR1cm47CisgICAg ICAqciA9IE5TTWFrZVJlY3QgKHMtPngsIHMtPnksIHMtPmJhY2tncm91bmRfd2lkdGgsIHMtPmhl aWdodCk7CisgICAgICBpZiAocy0+aGwgPT0gRFJBV19NT1VTRV9GQUNFKQorICAgICAgICB7Cisg ICAgICAgICAgZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgTU9VU0VfSExfSU5GTyAocy0+Zikt Pm1vdXNlX2ZhY2VfZmFjZV9pZCk7CisgICAgICAgICAgaWYgKCFmYWNlKQorICAgICAgICAgICAg ZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgTU9VU0VfRkFDRV9JRCk7CisgICAgICAgIH0KKyAg ICAgICAgZWxzZQorICAgICAgICAgZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+Ziwgcy0+Zmlyc3Rf Z2x5cGgtPmZhY2VfaWQpOworICAgICAgYmdDb2wgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAo TlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKSwgcy0+Zik7CisgICAgICBmZ0NvbCA9IG5zX2xvb2t1 cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQgKGZhY2UpLCBzLT5mKTsKKyAgICAg IGZvciAoaSA9IDA7IGkgPCBuOyArK2kpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoIXMtPnJv dy0+ZnVsbF93aWR0aF9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpbnQgb3ZlcnJ1 biwgbGVmdG92ZXJydW47CisgICAgICAgICAgICAgIC8qIHRydW5jYXRlIHRvIGF2b2lkIG92ZXJ3 cml0aW5nIGZyaW5nZSBhbmQvb3Igc2Nyb2xsYmFyICovCisgICAgICAgICAgICAgIG92ZXJydW4g PSBtYXggKDAsIChzLT54ICsgcy0+YmFja2dyb3VuZF93aWR0aCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIC0gKFdJTkRPV19CT1hfUklHSFRfRURHRV9YIChzLT53KQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgLSBXSU5ET1dfUklHSFRfRlJJTkdFX1dJRFRIIChzLT53 KSkpOworICAgICAgICAgICAgICAgICAgICByW2ldLnNpemUud2lkdGggLT0gb3ZlcnJ1bjsKKyAg ICAgICAgICAgICAgLyogdHJ1bmNhdGUgdG8gYXZvaWQgb3ZlcndyaXRpbmcgdG8gbGVmdCBvZiB0 aGUgd2luZG93IGJveCAqLworICAgICAgICAgICAgICBsZWZ0b3ZlcnJ1biA9IChXSU5ET1dfQk9Y X0xFRlRfRURHRV9YIChzLT53KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIFdJTkRP V19MRUZUX0ZSSU5HRV9XSURUSCAocy0+dykpIC0gcy0+eDsKKyAgICAgICAgICAgICAgaWYgKGxl ZnRvdmVycnVuID4gMCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICByW2ld Lm9yaWdpbi54ICs9IGxlZnRvdmVycnVuOworICAgICAgICAgICAgICAgICAgcltpXS5zaXplLndp ZHRoIC09IGxlZnRvdmVycnVuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAg ICAgICAgICBbYmdDb2wgc2V0XTsKKyAgICAgICAgICAvKiBOT1RFOiB1bmRlciBOUyB0aGlzIGlz IE5PVCB1c2VkIHRvIGRyYXcgY3Vyc29ycywgYnV0IHdlIG11c3QgYXZvaWQKKyAgICAgICAgICAg ICBvdmVyd3JpdGluZyBjdXJzb3IgKHVzdWFsbHkgd2hlbiBjdXJzb3Igb24gYSB0YWIpICovCisg ICAgICAgICAgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SKQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICAvKiBGSVhNRTogIERvIHdlIHN0aWxsIG5lZWQgdG8gcHJldmVudCB0aGlzIHNlY3Rp b24gb2YgY29kZSBmcm9tCisgICAgICAgICAgICAgIGVyYXNpbmcgdGhlIGZha2UgTUNfSEJBUiB0 aGF0IGV4dGVuZHMgdGhlIGVudGlyZSBsZW5ndGggb2YgdGhlCisgICAgICAgICAgICAgIFNUUkVU Q0hfR0xZUEg/ICBUaGlzIG1heSBoYXZlIGJlZW4gZG9uZSBwcmlvciB0byB0aGUgZml4IHJlbGF0 aW5nCisgICAgICAgICAgICAgIHRvIGxlZnQvcmlnaHQgb3ZlcndyaXR0ZW4gZ2x5cGhzLiAqLwor ICAgICAgICAgICAgICByW2ldLnNpemUuaGVpZ2h0IC09IDE7CisgICAgICAgICAgICAgIC8vICBl bnVtIGZhY2VfaWQgZGVidWdnaW5nX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywg cy0+ZiwgaW50ZXJuICgiKy1kZWJ1Z2dpbmctZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAg Ly8gIHN0cnVjdCBmYWNlICpkZWJ1Z2dpbmdfZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgZGVi dWdnaW5nX2ZhY2VfaWQpOworICAgICAgICAgICAgICAvLyAgTlNDb2xvciAqY29sb3IgPSBuc19s b29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChkZWJ1Z2dpbmdfZmFjZSks IHMtPmYpOworICAgICAgICAgICAgICAvLyAgW2NvbG9yIHNldF07CisgICAgICAgICAgICAgIENH RmxvYXQgeCA9IHJbaV0ub3JpZ2luLng7CisgICAgICAgICAgICAgIENHRmxvYXQgd2lkdGggPSB3 ZDsKKyAgICAgICAgICAgICAgcltpXS5zaXplLndpZHRoIC09IHdpZHRoOworICAgICAgICAgICAg ICByW2ldLm9yaWdpbi54ICs9IHdpZHRoOworICAgICAgICAgICAgICBOU1JlY3RGaWxsIChyW2ld KTsKKyAgICAgICAgICAgICAgLyogRHJhdyBvdmVybGluaW5nLCBldGMuIG9uIHRoZSBjdXJzb3Iu ICovCisgICAgICAgICAgICAgIGlmIChzLT53LT5waHlzX2N1cnNvcl90eXBlID09IE1DX0ZJTExF RF9CT1gpCisgICAgICAgICAgICAgICAgbWNfbnNfZHJhd190ZXh0X2RlY29yYXRpb24gKHMsIGZh Y2UsIGJnQ29sLCB3aWR0aCwgeCk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICAgICAgbWNfbnNfZHJhd190ZXh0X2RlY29yYXRpb24gKHMsIGZhY2UsIGZnQ29sLCB3aWR0aCwg eCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAvLyAg aW50IHJ4ID0gcltpXS5vcmlnaW4ueDsKKyAgLy8gIGludCByeSA9IHJbaV0ub3JpZ2luLnk7Cisg IC8vICBpbnQgcncgPSByW2ldLnNpemUud2lkdGg7CisgIC8vICBpbnQgcmggPSByW2ldLnNpemUu aGVpZ2h0OworICAvLyAgZnByaW50ZiAoc3RkZXJyLCAibWNfbnNfZHVtcGdseXBoc19zdHJldGNo OiAgdnBvcyAoJWQpIHwgcnggKCVkKSB8IHJ5ICglZCkgfCBydyAoJWQpIHwgcmggKCVkKVxuIiwK KyAgLy8gICAgICAgICAgICAgICAgICAgcy0+Zmlyc3RfZ2x5cGgtPnZwb3MsIHJ4LCByeSwgcncs IHJoKTsKKyAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocltpXSk7CisgICAgICAgICAgICB9Cisg ICAgICAgICAgLyogRHJhdyBvdmVybGluaW5nLCBldGMuIG9uIHRoZSBzdHJldGNoIGdseXBoIChv ciB0aGUgcGFydAorICAgICAgICAgICAgIG9mIHRoZSBzdHJldGNoIGdseXBoIGFmdGVyIHRoZSBj dXJzb3IpLiAqLworICAgICAgICAgIG1jX25zX2RyYXdfdGV4dF9kZWNvcmF0aW9uIChzLCBmYWNl LCBmZ0NvbCwgcltpXS5zaXplLndpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICByW2ldLm9yaWdpbi54KTsKKyAgICAgICAgfQorICAgICAgaWYgKChzLT5sZWZ0X292 ZXJ3cml0dGVuX3AgfHwgcy0+cmlnaHRfb3ZlcndyaXR0ZW5fcCkKKyAgICAgICAgICAmJiAocy0+ YWN0aW9uX3R5cGUgPT0gTUNfRFJBV19HTFlQSF9TVFJJTkcgfHwgcy0+YWN0aW9uX3R5cGUgPT0g TUNfRVJBU0VfR0xZUEhfU1RSSU5HKSkKKyAgICAgICAgbWNfbnNfZHJhd19vdmVyd3JpdHRlbiAo cywgbWF0c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T5zbGljZS55LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+c2xp Y2Uud2lkdGgsIHMtPnNsaWNlLmhlaWdodCk7CisgICAgICBbaW1nIGRyYXdJblJlY3Q6IGRyCisg ICAgICAgICAgICAgZnJvbVJlY3Q6IGlyCisgICAgICAgICAgICAgb3BlcmF0aW9uOiBOU0NvbXBv c2l0ZVNvdXJjZU92ZXIKKyAgICAgICAgICAgICAgZnJhY3Rpb246IDEuMAorICAgICAgICAgICBy ZXNwZWN0RmxpcHBlZDogWUVTCisgICAgICAgICAgICAgICAgaGludHM6IG5pbF07CisjZWxzZQor ICAgICAgW2ltZyBjb21wb3NpdGVUb1BvaW50OiBOU01ha2VQb2ludCAoeCwgeSArIHMtPnNsaWNl LmhlaWdodCkKKyAgICAgICAgICAgICAgICAgIG9wZXJhdGlvbjogTlNDb21wb3NpdGVTb3VyY2VP dmVyXTsKKyNlbmRpZgorICAgIH0KKyAgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SKQorICAgIHsK KyAgICAgIFtGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpIHNldF07CisgICAgICBpZiAocy0+dy0+ cGh5c19jdXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9YKQorICAgICAgICB0ZENvbCA9IG5zX2xv b2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpLCBzLT5mKTsKKyAg ICAgICAgZWxzZQorICAgICAgICAgIC8qIEN1cnJlbnRseSBvbiBOUyBpbWctPm1hc2sgaXMgYWx3 YXlzIDAuIFNpbmNlCisgICAgICAgICAgICAgZ2V0X3dpbmRvd19jdXJzb3JfdHlwZSBzcGVjaWZp ZXMgYSBob2xsb3cgYm94IGN1cnNvciB3aGVuIG9uCisgICAgICAgICAgICAgYSBub24tbWFza2Vk IGltYWdlIHdlIG5ldmVyIHJlYWNoIHRoaXMgY2xhdXNlLiBCdXQgd2UgcHV0IGl0CisgICAgICAg ICAgICAgaW4gaW4gYW50aWNpcGF0aW9uIG9mIGJldHRlciBzdXBwb3J0IGZvciBpbWFnZSBtYXNr cyBvbiBOUy4gKi8KKyAgICAgICAgICB0ZENvbCA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChO U19GQUNFX0ZPUkVHUk9VTkQgKGZhY2UpLCBzLT5mKTsKKyAgICB9CisgICAgZWxzZQorICAgICAg dGRDb2wgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChmYWNl KSwgcy0+Zik7CisgIC8qIERyYXcgdW5kZXJsaW5lLCBvdmVybGluZSwgc3RyaWtlLXRocm91Z2gu ICovCisgIG1jX25zX2RyYXdfdGV4dF9kZWNvcmF0aW9uIChzLCBmYWNlLCB0ZENvbCwgYnIuc2l6 ZS53aWR0aCwgYnIub3JpZ2luLngpOworICAvKiBEcmF3IHJlbGllZiwgaWYgcmVxdWVzdGVkICov CisgIGlmIChzLT5pbWctPnJlbGllZiB8fCBzLT5obCA9PURSQVdfSU1BR0VfUkFJU0VEIHx8IHMt PmhsID09RFJBV19JTUFHRV9TVU5LRU4pCisgICAgeworICAgICAgaWYgKHMtPmhsID09IERSQVdf SU1BR0VfU1VOS0VOIHx8IHMtPmhsID09IERSQVdfSU1BR0VfUkFJU0VEKQorICAgICAgICB7Cisg ICAgICAgICAgdGggPSB0b29sX2Jhcl9idXR0b25fcmVsaWVmID49IDAgPworICAgICAgICAgICAg dG9vbF9iYXJfYnV0dG9uX3JlbGllZiA6IERFRkFVTFRfVE9PTF9CQVJfQlVUVE9OX1JFTElFRjsK KyAgICAgICAgICByYWlzZWRfcCA9IChzLT5obCA9PSBEUkFXX0lNQUdFX1JBSVNFRCk7CisgICAg ICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIHRoID0gYWJzIChz LT5pbWctPnJlbGllZik7CisgICAgICAgICAgICByYWlzZWRfcCA9IChzLT5pbWctPnJlbGllZiA+ IDApOworICAgICAgICAgIH0KKyAgICAgIHIub3JpZ2luLnggPSB4IC0gdGg7CisgICAgICByLm9y aWdpbi55ID0geSAtIHRoOworICAgICAgci5zaXplLndpZHRoID0gcy0+c2xpY2Uud2lkdGggKyAy KnRoLTE7CisgICAgICByLnNpemUuaGVpZ2h0ID0gcy0+c2xpY2UuaGVpZ2h0ICsgMip0aC0xOwor ICAgICAgbnNfZHJhd19yZWxpZWYgKHIsIHRoLCByYWlzZWRfcCwKKyAgICAgICAgICAgICAgICAg ICAgICBzLT5zbGljZS55ID09IDAsCisgICAgICAgICAgICAgICAgICAgICAgcy0+c2xpY2UueSAr IHMtPnNsaWNlLmhlaWdodCA9PSBzLT5pbWctPmhlaWdodCwKKyAgICAgICAgICAgICAgICAgICAg ICBzLT5zbGljZS54ID09IDAsCisgICAgICAgICAgICAgICAgICAgICAgcy0+c2xpY2UueCArIHMt PnNsaWNlLndpZHRoID09IHMtPmltZy0+d2lkdGgsIHMpOworICAgIH0KKyAgLyogSWYgdGhlcmUg aXMgbm8gbWFzaywgdGhlIGJhY2tncm91bmQgd29uJ3QgYmUgc2VlbiwKKyAgICAgc28gZHJhdyBh IHJlY3RhbmdsZSBvbiB0aGUgaW1hZ2UgZm9yIHRoZSBjdXJzb3IuCisgICAgIERvIHRoaXMgZm9y IGFsbCBpbWFnZXMsIGdldHRpbmcgdHJhbnNwYXJlbmN5IHJpZ2h0IGlzIG5vdCByZWxpYWJsZS4g Ki8KKyAgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SKQorICAgIHsKKyAgICAgIGludCB0aGlja25l c3MgPSBhYnMgKHMtPmltZy0+cmVsaWVmKTsKKyAgICAgIGlmICh0aGlja25lc3MgPT0gMCkgdGhp Y2tuZXNzID0gMTsKKyAgICBpZiAoZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBICisgICAgICAgIHx8 IGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSExFU1MpCisgICAgICB7CisgICAgICAgIE5TQ29sb3Ig KmJvcmRlcl9jb2xvciA9IFtOU0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6IGxzbC5yZWQK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBncmVlbjogbHNsLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGJsdWU6IGxzbC5ibHVlCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwaGE6IDEuMF07CisgICAg ICAgIG5zX2RyYXdfYm94IChiciwgdGhpY2tuZXNzLCBib3JkZXJfY29sb3IsIDEsIDEpOworICAg ICAgfQorICAgICAgZWxzZQorICAgICAgICBuc19kcmF3X2JveCAoYnIsIHRoaWNrbmVzcywgRlJB TUVfQ1VSU09SX0NPTE9SIChzLT5mKSwgMSwgMSk7CisgICAgfQorfQorCitzdGF0aWMgdm9pZAor bWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpz LCBjaGFyIGZvcmNlX3ApCit7CisgIE5TVFJBQ0UgKCJtY19uc19tYXliZV9kdW1wZ2x5cGhzX2Jh Y2tncm91bmQiKTsKKyAgaWYgKCFzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wLyogfHwgcy0+aGwgPT0g RFJBV19NT1VTRV9GQUNFKi8pCisgICAgeworICAgICAgaW50IGJveF9saW5lX3dpZHRoID0gbWF4 IChzLT5mYWNlLT5ib3hfbGluZV93aWR0aCwgMCk7CisgICAgICBpZiAoRk9OVF9IRUlHSFQgKHMt PmZvbnQpIDwgcy0+aGVpZ2h0IC0gMiAqIGJveF9saW5lX3dpZHRoCisgICAgICAgICAgLyogV2hl biB4ZGlzcC5jIGlnbm9yZXMgRk9OVF9IRUlHSFQsIHdlIGNhbm5vdCB0cnVzdCBmb250CisgICAg ICAgICAgICAgZGltZW5zaW9ucywgc2luY2UgdGhlIGFjdHVhbCBnbHlwaHMgbWlnaHQgYmUgbXVj aAorICAgICAgICAgICAgIHNtYWxsZXIuICBTbyBpbiB0aGF0IGNhc2Ugd2UgYWx3YXlzIGNsZWFy IHRoZSByZWN0YW5nbGUKKyAgICAgICAgICAgICB3aXRoIGJhY2tncm91bmQgY29sb3IuICovCisg ICAgICAgICAgfHwgRk9OVF9UT09fSElHSCAocy0+Zm9udCkKKyAgICAgICAgICB8fCBzLT5mb250 X25vdF9mb3VuZF9wIHx8IHMtPmV4dGVuZHNfdG9fZW5kX29mX2xpbmVfcCB8fCBmb3JjZV9wKQor ICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGZhY2UgKmZhY2U7CisgICAgICAgICAgaWYgKHMt PmhsID09IERSQVdfTU9VU0VfRkFDRSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgZmFj ZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgTU9VU0VfSExfSU5GTyAocy0+ZiktPm1vdXNlX2ZhY2Vf ZmFjZV9pZCk7CisgICAgICAgICAgICAgIGlmICghZmFjZSkKKyAgICAgICAgICAgICAgICBmYWNl ID0gRkFDRV9GUk9NX0lEIChzLT5mLCBNT1VTRV9GQUNFX0lEKTsKKyAgICAgICAgICAgIH0KKyAg ICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+Ziwg cy0+Zmlyc3RfZ2x5cGgtPmZhY2VfaWQpOworICAgICAgICAgIGlmICghZmFjZS0+c3RpcHBsZSkK KyAgICAgICAgICAgIFsoTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKSAhPSAwCisgICAgICAgICAg ICAgID8gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoZmFjZSks IHMtPmYpCisgICAgICAgICAgICAgIDogRlJBTUVfQkFDS0dST1VORF9DT0xPUiAocy0+ZikpIHNl dF07CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBz dHJ1Y3QgbnNfZGlzcGxheV9pbmZvICpkcHlpbmZvID0gRlJBTUVfRElTUExBWV9JTkZPIChzLT5m KTsKKyAgICAgICAgICAgICAgICBbW2RweWluZm8tPmJpdG1hcHNbZmFjZS0+c3RpcHBsZS0xXS5p bWcgc3RpcHBsZU1hc2tdIHNldF07CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICBpZiAocy0+ aGwgIT0gRFJBV19DVVJTT1IpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHMtPnJlY3Rh bmdsZV9udWtlZF9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgTlNSZWN0IHIgPSBOU01ha2VSZWN0 IChzLT54LCBzLT55ICsgYm94X2xpbmVfd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBzLT5iYWNrZ3JvdW5kX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgcy0+aGVpZ2h0LTIqYm94X2xpbmVfd2lkdGgpOworICAgICAgICAgICAgICBO U1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBzLT5iYWNrZ3JvdW5kX2Zp bGxlZF9wID0gMTsKKyAgICAgICAgfQorICAgIH0KK30KKworc3RhdGljIHZvaWQKK21jX25zX2Ry YXdfZ2x5cGhfc3RyaW5nIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzLCBzdHJ1Y3QgZ2x5cGhfbWF0 cml4ICptYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAq cm93LCBzdHJ1Y3QgbWNfbWF0cml4IG1jX21hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAgICAg ICBzdHJ1Y3QgbWNfUkdCIGxzbCwgZW51bSBtY19mbGF2b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HQtPmZpcnN0X2dseXBoLT50eXBlICE9IElNQUdFX0dMWVBIKQorICAgICAgICAgIHsKKyAgICAg ICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSAhPSBTVFJFVENIX0dMWVBIKQorICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xp cF9yZWN0IChzLT5uZXh0LCByKTsKKyAgICAgICAgICAgICAgICBpZiAoIW5zX2NsaXBfdG9fcmVj dCAocy0+ZiwgciwgbikpCisgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAg ICAgbWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzLT5uZXh0LCAxKTsKKyAgICAg ICAgICAgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIG1jX25zX2R1bXBnbHlwaHNfc3RyZXRj aCAocy0+bmV4dCwgbWF0cml4LCByb3csIG1jX21hdHJpeCwgd2QpOworICAgICAgICAgICAgbmV4 dC0+bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICB9CisgICAgfQorICBpZiAoIXMtPmZvcl9vdmVy bGFwcyAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gKKyAgICAgICYmIChzLT5maXJzdF9n bHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAgICAgfHwgcy0+Zmlyc3RfZ2x5cGgtPnR5 cGUgPT0gQ09NUE9TSVRFX0dMWVBIKSkKKyAgICB7CisgICAgICBuID0gbnNfZ2V0X2dseXBoX3N0 cmluZ19jbGlwX3JlY3QgKHMsIHIpOworICAgICAgaWYgKCFuc19jbGlwX3RvX3JlY3QgKHMtPmYs IHIsIG4pKQorICAgICAgICByZXR1cm47CisgICAgICBtY19uc19tYXliZV9kdW1wZ2x5cGhzX2Jh Y2tncm91bmQgKHMsIDEpOworICAgICAgbnNfZHVtcGdseXBoc19ib3hfb3JfcmVsaWVmIChzKTsK KyAgICAgIG5zX3Jlc2V0X2NsaXBwaW5nIChzLT5mKTsKKyAgICAgIGJveF9kcmF3bl9wID0gMTsK KyAgICB9CisgIHN3aXRjaCAocy0+Zmlyc3RfZ2x5cGgtPnR5cGUpCisgICAgeworICAgIGNhc2Ug SU1BR0VfR0xZUEg6CisgICAgICBuID0gbnNfZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMs IHIpOworICAgICAgaWYgKCFuc19jbGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4pKQorICAgICAgICBy ZXR1cm47CisgICAgICBtY19uc19kdW1wZ2x5cGhzX2ltYWdlIChzLCByWzBdLCBsc2wsIGdseXBo X2ZsYXZvciwgY3Vyc29yX3R5cGUsIGFjdGl2ZV9wKTsKKyAgICAgIG5zX3Jlc2V0X2NsaXBwaW5n IChzLT5mKTsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgU1RSRVRDSF9HTFlQSDoKKyAgICAgIG1j X25zX2R1bXBnbHlwaHNfc3RyZXRjaCAocywgbWF0cml4LCByb3csIG1jX21hdHJpeCwgd2QpOwor ICAgICAgYnJlYWs7CisgICAgY2FzZSBDSEFSX0dMWVBIOgorICAgIGNhc2UgQ09NUE9TSVRFX0dM WVBIOgorICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAg ICAgIGlmICghbnNfY2xpcF90b19yZWN0IChzLT5mLCByLCBuKSkKKyAgICAgICAgcmV0dXJuOwor ICAgICAgaWYgKHMtPmZvcl9vdmVybGFwcworICAgICAgICAgIHx8IChzLT5jbXBfZnJvbSA+IDAK KyAgICAgICAgICAgICAgJiYgISBzLT5maXJzdF9nbHlwaC0+dS5jbXAuYXV0b21hdGljKSkKKyAg ICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IDE7CisgICAgICAgIGVsc2UKKyAgICAgICAg ICBtY19uc19tYXliZV9kdW1wZ2x5cGhzX2JhY2tncm91bmQgKHMsIHMtPmZpcnN0X2dseXBoLT50 eXBlID09IENPTVBPU0lURV9HTFlQSCk7CisgICAgICBpbnQgZmxhZ3MgPSAocy0+aGwgPT0gRFJB V19DVVJTT1IpCisgICAgICAgICAgICAgICAgICAgID8gTlNfRFVNUEdMWVBIX0NVUlNPUgorICAg ICAgICAgICAgICAgICAgOiAocy0+aGwgPT0gRFJBV19NT1VTRV9GQUNFKQorICAgICAgICAgICAg ICAgICAgICA/IE5TX0RVTVBHTFlQSF9NT1VTRUZBQ0UKKyAgICAgICAgICAgICAgICAgIDogKHMt PmZvcl9vdmVybGFwcykKKyAgICAgICAgICAgICAgICAgICAgPyBOU19EVU1QR0xZUEhfRk9SRUdS T1VORAorICAgICAgICAgICAgICAgICAgOiBOU19EVU1QR0xZUEhfTk9STUFMOworICAgICAgdW5z aWduZWQgbG9uZyBzYXZlZF9mZyA9IE5TX0ZBQ0VfRk9SRUdST1VORCAocy0+ZmFjZSk7CisgICAg ICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IgJiYgY3Vyc29yX3R5cGUgPT0gTUNfRklMTEVEX0JP WCkKKyAgICAgICAgeworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgdG1wID0gTlNfRkFDRV9CQUNL R1JPVU5EIChzLT5mYWNlKTsKKyAgICAgICAgICBOU19GQUNFX0JBQ0tHUk9VTkQgKHMtPmZhY2Up ID0gTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKTsKKyAgICAgICAgICBOU19GQUNFX0ZPUkVH Uk9VTkQgKHMtPmZhY2UpID0gdG1wOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKHMtPmhs ID09IERSQVdfQ1VSU09SCisgICAgICAgICAgICAgICAgICYmIGN1cnNvcl90eXBlID09IE1DX0ZS QU1FRF9CT1gKKyAgICAgICAgICAgICAgICAgJiYgYWN0aXZlX3Ap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V9mYWNlKTsKKyAgICAgICAgICAgIH0KKyAgICAgIGlmIChzLT5maXJzdF9n bHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpCisgICAgICAgIG5zX2RyYXdfY29tcG9zaXRl X2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAgICAgICAgZWxzZQorICAgICAgICAgIHsK KyAgICAgICAgICAgIGJvb2wgd2l0aF9iZ19wID0gKChmbGFncyA9PSBOU19EVU1QR0xZUEhfTk9S TUFMICYmICFzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgfHwgZmxhZ3MgPT0gTlNfRFVNUEdMWVBIX01PVVNFRkFDRSk7CisgICAgICAgICAgICBp ZiAod2l0aF9iZ19wKQorICAgICAgICAgICAgICBzLT5iYWNrZ3JvdW5kX251a2VkX3AgPSB0cnVl OworICAgICAgICAgICAgZm9udC0+ZHJpdmVyLT5kcmF3IChzLCBzLT5jbXBfZnJvbSwgcy0+bmNo YXJzLCBzLT54LCBzLT55YmFzZSwgd2l0aF9iZ19wKTsKKyAgICAgICAgICB9CisgICAgICBOU0Nv bG9yICpjb2wgPSAoTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKSAhPSAwCisgICAgICAgICAg ICAgICAgICAgICA/IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQg KHMtPmZhY2UpLCBzLT5mKQorICAgICAgICAgICAgICAgICAgICAgOiBGUkFNRV9GT1JFR1JPVU5E X0NPTE9SIChzLT5mKSk7CisgICAgICBbY29sIHNldF07CisgICAgICAvKiBEcmF3IHVuZGVybGlu ZSwgb3ZlcmxpbmUsIHN0cmlrZS10aHJvdWdoLiAqLworICAgICAgbWNfbnNfZHJhd190ZXh0X2Rl Y29yYXRpb24gKHMsIHMtPmZhY2UsIGNvbCwgcy0+d2lkdGgsIHMtPngpOworICAgICAgaWYgKHMt Pm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KKyAgICAgIG4gPSBuc19nZXRfZ2x5 cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgcik7CisgICAgICBpZiAoIW5zX2NsaXBfdG9fcmVjdCAo cy0+ZiwgciwgbikpCisgICAgICAgIHJldHVybjsKKyAgICAgIGlmIChzLT5mb3Jfb3ZlcmxhcHMK KyAgICAgICAgICB8fCAocy0+Y21wX2Zyb20gPiAwCisgICAgICAgICAgICAgICYmICEgcy0+Zmly c3RfZ2x5cGgtPnUuY21wLmF1dG9tYXRpYykpCisgICAgICAgIHMtPmJhY2tncm91bmRfZmlsbGVk X3AgPSAxOworICAgICAgZWxzZQorICAgICAgICBtY19uc19tYXliZV9kdW1wZ2x5cGhzX2JhY2tn cm91bmQgKHMsIHMtPmZpcnN0X2dseXBoLT50eXBlID09IENPTVBPU0lURV9HTFlQSCk7CisgICAg ICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICBicmVhazsKKyAgICBkZWZhdWx0Ogor ICAgICAgZW1hY3NfYWJvcnQgKCk7CisgICAgfQorICAvKiBEcmF3IGJveCBpZiBub3QgZG9uZSBh bHJlYWR5LiAqLworICBpZiAoIXMtPmZvcl9vdmVybGFwcworICAgICAgJiYgIWJveF9kcmF3bl9w CisgICAgICAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gpCisgICAgeworICAgICAgbiA9 IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAgICAgIGlmICghbnNfY2xp cF90b19yZWN0IChzLT5mLCByLCBuKSkKKyAgICAgICAgcmV0dXJuOworICAgICAgbnNfZHVtcGds eXBoc19ib3hfb3JfcmVsaWVmIChzKTsKKyAgICAgIG5zX3Jlc2V0X2NsaXBwaW5nIChzLT5mKTsK KyAgICB9CisgIHMtPm51bV9jbGlwcyA9IDA7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JT ICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiA9PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQog CiAgICBOU1RSQUNFLCBUcmFjZSBzdXBwb3J0LgpAQCAtMTA3OSw2ICsyMDQ5LDE2IEBAIHN0YXRp YyBOU1JlY3QgY29uc3RyYWluX2ZyYW1lX3JlY3QoTlNSZWN0IGZyYW1lUmVjdCwgYm9vbCBpc0Z1 bGxzY3JlZW4pCiAgICBleHRlcm5hbCAoUklGKSBjYWxsOyB3aG9sZSBmcmFtZSwgY2FsbGVkIGJl Zm9yZSBndWlfdXBkYXRlX3dpbmRvd19iZWdpbgogICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KIHsK KworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwor ICBmLT5tY191cGRhdGluZ19mcmFtZSA9IGY7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor CisKICNpZmRlZiBOU19JTVBMX0NPQ09BCiAgIEVtYWNzVmlldyAqdmlldyA9IEZSQU1FX05TX1ZJ RVcgKGYpOwogCkBAIC0xMTA5LDYgKzIwODksMTYgQEAgc3RhdGljIE5TUmVjdCBjb25zdHJhaW5f ZnJhbWVfcmVjdChOU1JlY3QgZnJhbWVSZWN0LCBib29sIGlzRnVsbHNjcmVlbikKIAogLyogICBp ZiAoZiA9PSBNT1VTRV9ITF9JTkZPIChmKS0+bW91c2VfZmFjZV9tb3VzZV9mcmFtZSkgKi8KICAg TU9VU0VfSExfSU5GTyAoZiktPm1vdXNlX2ZhY2VfZGVmZXIgPSAwOworCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5n X2ZyYW1lID0gTlVMTDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAKQEAg LTQ3NTksNiArNTc0OSwxNyBAQCBpbiBjZXJ0YWluIHNpdHVhdGlvbnMgKHJhcGlkIGluY29taW5n IGV2ZW50cykuCiAgICAgICBiYXIgPSBbW0VtYWNzU2Nyb2xsZXIgYWxsb2NdIGluaXRGcmFtZTog ciB3aW5kb3c6IHdpbl07CiAgICAgICB3c2V0X3ZlcnRpY2FsX3Njcm9sbF9iYXIgKHdpbmRvdywg bWFrZV9taW50X3B0ciAoYmFyKSk7CiAgICAgICB1cGRhdGVfcCA9IFlFUzsKKworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgLyogVGhp cyBpcyBvbmx5IGZvciBkZWJ1Z2dpbmcgcHVycG9zZXMuICovCisgICAgICBbYmFyIG1jX3NldF9y ZWN0YW5nbGU6IHJdOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgfQogICBl bHNlCiAgICAgewpAQCAtNDc2NiwxMiArNTc2NywzMCBAQCBpbiBjZXJ0YWluIHNpdHVhdGlvbnMg KHJhcGlkIGluY29taW5nIGV2ZW50cykuCiAgICAgICBiYXIgPSBYTlNfU0NST0xMX0JBUiAod2lu ZG93LT52ZXJ0aWNhbF9zY3JvbGxfYmFyKTsKICAgICAgIG9sZFJlY3QgPSBbYmFyIGZyYW1lXTsK ICAgICAgIHIuc2l6ZS53aWR0aCA9IG9sZFJlY3Quc2l6ZS53aWR0aDsKKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogICAgICAgaWYgKEZSQU1F X0xJVkVfUCAoZikgJiYgIU5TRXF1YWxSZWN0cyAob2xkUmVjdCwgcikpCiAgICAgICAgIHsKKyAg ICAgICAgICAvKiBUaGUgbWFpbiB3aW5kb3cgaGFzIHByb2JhYmx5IGJlZW4gcmVzaXplZC4gIEdy YWNpb3VzbHkgZGVsZXRlIHRoZQorICAgICAgICAgIG9sZCBzY3JvbGwgYmFyIHdpdGhvdXQgcmVw YWludGluZyBpdHMgcmVjdGFuZ2xlOyBhbmQsIGNyZWF0ZSBhIG5ldworICAgICAgICAgIHNjcm9s bCBiYXIgZWxzZXdoZXJlLiovCiAgICAgICAgICAgaWYgKG9sZFJlY3Qub3JpZ2luLnggIT0gci5v cmlnaW4ueCkKKyAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgbnNfY2xlYXJfZnJhbWVfYXJl YSAoZiwgbGVmdCwgdG9wLCB3aWR0aCwgaGVpZ2h0KTsKKyAgICAgICAgICAgICAgW2JhciBtY19q dWRnZV07CisgICAgICAgICAgICAgIGJhciA9IFtbRW1hY3NTY3JvbGxlciBhbGxvY10gaW5pdEZy YW1lOiByIHdpbmRvdzogd2luXTsKKyAgICAgICAgICAgICAgd3NldF92ZXJ0aWNhbF9zY3JvbGxf YmFyICh3aW5kb3csIG1ha2VfbWludF9wdHIgKGJhcikpOworICAgICAgICAgICAgfQorICAgICAg ICAgICAgZWxzZQogICAgICAgICAgIFtiYXIgc2V0RnJhbWU6IHJdOwogICAgICAgICB9CisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICB9CiAKICAgaWYgKHVwZGF0ZV9wKQpAQCAt NDkzMSw5ICs1OTUwLDU3IEBAIGluIGNlcnRhaW4gc2l0dWF0aW9ucyAocmFwaWQgaW5jb21pbmcg ZXZlbnRzKS4KICAgICB7CiAgICAgICB2aWV3ID0gW3N1YnZpZXdzIG9iamVjdEF0SW5kZXg6IGld OwogICAgICAgaWYgKCFbdmlldyBpc0tpbmRPZkNsYXNzOiBbRW1hY3NTY3JvbGxlciBjbGFzc11d KSBjb250aW51ZTsKLSAgICAgIGlmIChbdmlldyBqdWRnZV0pCisKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogYFhTRVRXSU5ET1cnIHdp bGwgc29tZXRpbWVzIGNhdXNlIEVtYWNzIHRvIGNyYXNoIHdoZW4gcnVubmluZyB1bmRlciBnZGIg ZXZlbgorICB0aG91Z2ggKHcgIT0gTlVMTCkuICBUaGVyZWZvcmUsIHdlIGNhbm5vdCByZWxpYWJs eSB1c2UgYFdJTkRPV19MSVZFX1AnLiAqLworICBzdHJ1Y3Qgd2luZG93ICp3ID0gW3ZpZXcgbWNf Z2V0X3dpbmRvd107CisgIGlmICh3ICE9IE5VTEwKKyAgICAgICYmIE5JTFAgKHctPmNvbnRlbnRz KSkKKyAgICB7CisgICAgICBCT09MIGRlYnVnX3AgPSBmYWxzZTsKKyAgICAgIGlmIChkZWJ1Z19w CisgICAgICAgICAgLyogYHdpbmRvd19ib3gnIGNhbGxzIGB3aW5kb3dfYm94X2hlaWdodCcsIHdo aWNoIHdpbGwgY2F1c2UgRW1hY3MgdG8KKyAgICAgICAgICBjcmFzaCBpZiBGUkFNRVAgKHctPmZy YW1lKSBpcyBub3Qgc2F0aXNmaWVkLiAqLworICAgICAgICAgICYmIEZSQU1FUCAody0+ZnJhbWUp KQorICAgICAgICB7CisgICAgICAgICAgTlNSZWN0IHIwID0gW3ZpZXcgbWNfZ2V0X3JlY3Rhbmds ZV07CisgICAgICAgICAgaW50IHgwID0gTlNNaW5YIChyMCk7CisgICAgICAgICAgaW50IHkwID0g TlNNaW5ZIChyMCk7CisgICAgICAgICAgaW50IHdkMCA9IE5TV2lkdGggKHIwKTsKKyAgICAgICAg ICBpbnQgaDAgPSBOU0hlaWdodCAocjApOworICAgICAgICAgIGludCB3aW5kb3dfeSwgd2luZG93 X2hlaWdodDsKKyAgICAgICAgICB3aW5kb3dfYm94ICh3LCBBTllfQVJFQSwgMCwgJndpbmRvd195 LCAwLCAmd2luZG93X2hlaWdodCk7CisgICAgICAgICAgaW50IHRvcCA9IHdpbmRvd195OworICAg ICAgICAgIGludCBoZWlnaHQgPSB3aW5kb3dfaGVpZ2h0OworICAgICAgICAgIGludCB3aWR0aCA9 IFdJTkRPV19DT05GSUdfU0NST0xMX0JBUl9DT0xTICh3KSAqIEZSQU1FX0NPTFVNTl9XSURUSCAo Zik7CisgICAgICAgICAgaW50IGxlZnQgPSBXSU5ET1dfU0NST0xMX0JBUl9BUkVBX1ggKHcpOwor ICAgICAgICAgIE5TUmVjdCByMSA9IE5TTWFrZVJlY3QgKGxlZnQsIHRvcCwgd2lkdGgsIGhlaWdo dCk7CisgICAgICAgICAgLyogVGhlIHBhcmVudCB2aWV3IGlzIGZsaXBwZWQsIHNvIHdlIG5lZWQg dG8gZmxpcCB5IHZhbHVlLiAqLworICAgICAgICAgIEVtYWNzVmlldyAqZnJhbWVfdmlldyA9IEZS QU1FX05TX1ZJRVcgKGYpOworICAgICAgICAgIE5TUmVjdCB2ID0gW2ZyYW1lX3ZpZXcgZnJhbWVd OworICAgICAgICAgIHIxLm9yaWdpbi55ID0gKHYuc2l6ZS5oZWlnaHQgLSByMS5zaXplLmhlaWdo dCAtIHIxLm9yaWdpbi55KTsKKyAgICAgICAgICBpbnQgeDEgPSBOU01pblggKHIxKTsKKyAgICAg ICAgICBpbnQgeTEgPSBOU01pblkgKHIxKTsKKyAgICAgICAgICBpbnQgd2QxID0gTlNXaWR0aCAo cjEpOworICAgICAgICAgIGludCBoMSA9IE5TSGVpZ2h0IChyMSk7CisgICAgICAgICAgZnByaW50 ZiAoc3RkZXJyLCAiJXMgLS0gREVBRDpcblwKKyAgICAgICAgICB4MC94MSAoJWQvJWQpIHwgeTAv eTEgKCVkLyVkKSB8IHdkMC93ZDEgKCVkLyVkKSB8IGgwL2gxICglZC8lZClcbiIsCisgICAgICAg ICAgbWNfd2luZG93ICh3KSwgeDAsIHgxLCB5MCwgeTEsIHdkMCwgd2QxLCBoMCwgaDEpOworICAg ICAgICB9CisgICAgICBpZiAoW3ZpZXcgbWNfanVkZ2VdKQogICAgICAgICByZW1vdmVkID0gWUVT OwogICAgIH0KKyAgICBlbHNlIGlmIChbdmlldyBqdWRnZV0pCisgICAgICByZW1vdmVkID0gWUVT OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCisgICAgfQogCiAgIGlmIChyZW1vdmVk KQogICAgIFtldmlldyB1cGRhdGVGcmFtZVNpemU6IE5PXTsKQEAgLTUwNzQsNiArNjE0MSwyMCBA QCBzdGF0aWMgTGlzcF9PYmplY3QgbnNfc3RyaW5nX3RvX2xpc3Btb2QgKGNvbnN0IGNoYXIgKnMp CiBleHRlcm4gZnJhbWVfcGFybV9oYW5kbGVyIG5zX2ZyYW1lX3Bhcm1faGFuZGxlcnNbXTsKIHN0 YXRpYyBzdHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFjZSBuc19yZWRpc3BsYXlfaW50ZXJmYWNlID0K IHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8K KworLyogYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGBuc3Rlcm0ubWAgbXVzdCBiZSBpbiB0aGUg ZXhhY3Qgc2FtZSBvcmRlciBhcyB0aGUKK2ByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgZGlzcGV4 dGVybi5oYCEgKi8KKworICBtY19uc19kcmF3X3dpbmRvd19jdXJzb3IsCisgIG1jX25zX2RyYXdf Z2x5cGhfc3RyaW5nLAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIG5zX2ZyYW1l X3Bhcm1faGFuZGxlcnMsCiAgIGd1aV9wcm9kdWNlX2dseXBocywKICAgZ3VpX3dyaXRlX2dseXBo cywKQEAgLTg3MTEsNiArOTc5Miw0OSBAQCAtIChCT09MKWNhbkJlY29tZU1haW5XaW5kb3cKIAog QGltcGxlbWVudGF0aW9uIEVtYWNzU2Nyb2xsZXIKIAorCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLSAodm9pZCltY19zZXRfcmVjdGFuZ2xlOiAo TlNSZWN0KXJlY3QKK3sKKyAgbWNfcmVjdGFuZ2xlID0gcmVjdDsKK30KKworLSAoTlNSZWN0KW1j X2dldF9yZWN0YW5nbGUKK3sKKyAgcmV0dXJuIG1jX3JlY3RhbmdsZTsKK30KKworLSAoc3RydWN0 IHdpbmRvdyAqKW1jX2dldF93aW5kb3cKK3sKKyAgcmV0dXJuIHdpbmRvdzsKK30KKworLSAoYm9v bCltY19qdWRnZQoreworICBOU1RSQUNFICgiW0VtYWNzU2Nyb2xsZXIgbWNfanVkZ2VdIik7Cisg IGJvb2wgcmV0ID0gY29uZGVtbmVkOworICBibG9ja19pbnB1dCAoKTsKKyAgaWYgKGNvbmRlbW5l ZCkKKyAgICB7CisgICAgICAvKiBlbnN1cmUgb3RoZXIgc2Nyb2xsYmFyIHVwZGF0ZXMgYWZ0ZXIg ZGVsZXRpb24gKi8KKyAgICAgIEVtYWNzVmlldyAqdmlldyA9IChFbWFjc1ZpZXcgKilGUkFNRV9O U19WSUVXIChmcmFtZSk7CisgICAgICBpZiAodmlldyAhPSBuaWwpCisgICAgICAgIHZpZXctPnNj cm9sbGJhcnNOZWVkaW5nVXBkYXRlKys7CisgICAgfQorICBpZiAod2luZG93KQorICAgIHdzZXRf dmVydGljYWxfc2Nyb2xsX2JhciAod2luZG93LCBRbmlsKTsKKyAgd2luZG93ID0gMDsKKyAgW3Nl bGYgcmVtb3ZlRnJvbVN1cGVydmlld1dpdGhvdXROZWVkaW5nRGlzcGxheV07CisgIFtzZWxmIHJl bGVhc2VdOworICB1bmJsb2NrX2lucHV0ICgpOworICByZXR1cm4gcmV0OworfQorCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKworCiAvKiBmb3IgcmVwZWF0IGJ1dHRvbiBwdXNoICovCiAjZGVm aW5lIFNDUk9MTF9CQVJfRklSU1RfREVMQVkgMC41CiAjZGVmaW5lIFNDUk9MTF9CQVJfQ09OVElO VU9VU19ERUxBWSAoMS4wIC8gMTUpCmRpZmYgLS1naXQgYS9zcmMvdzMydGVybS5jIGIvc3JjL3cz MnRlcm0uYwppbmRleCBjNmUxNzVlLi5mYTExNWMwIDEwMDY0NAotLS0gYS9zcmMvdzMydGVybS5j CisrKyBiL3NyYy93MzJ0ZXJtLmMKQEAgLTYyLDYgKzYyLDExNjggQEAgYWxvbmcgd2l0aCBHTlUg RW1hY3MuIC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FpbCA9IFZ3MzJfY29sb3JfbWFwOyBDT05TUCAodGFpbCk7IHRhaWwgPSBYQ0RS ICh0YWlsKSkKKyAgICB7CisgICAgICByZWdpc3RlciBMaXNwX09iamVjdCBlbHQsIHRlbTsKKyAg ICAgIGVsdCA9IFhDQVIgKHRhaWwpOworICAgICAgaWYgKCFDT05TUCAoZWx0KSkgY29udGludWU7 CisgICAgICB0ZW0gPSBYQ0FSIChlbHQpOworICAgICAgaWYgKGxzdHJjbXBpIChTU0RBVEEgKHRl bSksIGNvbG9ybmFtZSkgPT0gMCkKKyAgICAgICAgeworICAgICAgICAgIHJldCA9IEZjZHIgKGVs dCk7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIE1DX1FVSVQ7CisgICAgfQor ICB1bmJsb2NrX2lucHV0ICgpOworICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgTGlzcF9PYmpl Y3QKK21jX3hfdG9fdzMyX2NvbG9yIChjb25zdCBjaGFyICogY29sb3JuYW1lKQoreworICByZWdp c3RlciBMaXNwX09iamVjdCByZXQgPSBRbmlsOworICBibG9ja19pbnB1dCAoKTsKKyAgaWYgKGNv bG9ybmFtZVswXSA9PSAnIycpCisgICAgeworICAgICAgLyogQ291bGQgYmUgYW4gb2xkLXN0eWxl IFJHQiBEZXZpY2Ugc3BlY2lmaWNhdGlvbi4gKi8KKyAgICAgIGludCBzaXplID0gc3RybGVuIChj b2xvcm5hbWUgKyAxKTsKKyAgICAgIGNoYXIgKmNvbG9yID0gYWxsb2NhIChzaXplICsgMSk7Cisg ICAgICBzdHJjcHkgKGNvbG9yLCBjb2xvcm5hbWUgKyAxKTsKKyAgICAgIGlmIChzaXplID09IDMg fHwgc2l6ZSA9PSA2IHx8IHNpemUgPT0gOSB8fCBzaXplID09IDEyKQorICAgICAgICB7CisgICAg ICAgICAgVUlOVCBjb2xvcnZhbDsKKyAgICAgICAgICBpbnQgaSwgcG9zOworICAgICAgICAgIHBv cyA9IDA7CisgICAgICAgICAgc2l6ZSAvPSAzOworICAgICAgICAgIGNvbG9ydmFsID0gMDsKKyAg ICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMzsgaSsrKQorICAgICAgICAgICAgeworICAgICAgICAg ICAgICBjaGFyICplbmQ7CisgICAgICAgICAgICAgIGNoYXIgdDsKKyAgICAgICAgICAgICAgdW5z aWduZWQgbG9uZyB2YWx1ZTsKKyAgICAgICAgICAgICAgLyogVGhlIGNoZWNrIGZvciAneCcgaW4g dGhlIGZvbGxvd2luZyBjb25kaXRpb25hbCB0YWtlcyBpbnRvCisgICAgICAgICAgICAgIGFjY291 bnQgdGhlIGZhY3QgdGhhdCBzdHJ0b2wgYWxsb3dzIGEgIjB4IiBpbiBmcm9udCBvZgorICAgICAg ICAgICAgICBvdXIgbnVtYmVycywgYW5kIHdlIGRvbid0LiAqLworICAgICAgICAgICAgICBpZiAo IWlzeGRpZ2l0IChjb2xvclswXSkgfHwgY29sb3JbMV0gPT0gJ3gnKQorICAgICAgICAgICAgICAg IGJyZWFrOworICAgICAgICAgICAgICB0ID0gY29sb3Jbc2l6ZV07CisgICAgICAgICAgICAgIGNv bG9yW3NpemVdID0gJ1wwJzsKKyAgICAgICAgICAgICAgdmFsdWUgPSBzdHJ0b3VsIChjb2xvciwg JmVuZCwgMTYpOworICAgICAgICAgICAgICBjb2xvcltzaXplXSA9IHQ7CisgICAgICAgICAgICAg IGlmIChlcnJubyA9PSBFUkFOR0UgfHwgZW5kIC0gY29sb3IgIT0gc2l6ZSkKKyAgICAgICAgICAg ICAgICBicmVhazsKKyAgICAgICAgICAgICAgc3dpdGNoIChzaXplKQorICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICBjYXNlIDE6CisgICAgICAgICAgICAgICAgICB2YWx1ZSA9IHZh bHVlICogMHgxMDsKKyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNh c2UgMjoKKyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgMzoK KyAgICAgICAgICAgICAgICAgIHZhbHVlIC89IDB4MTA7CisgICAgICAgICAgICAgICAgICBicmVh azsKKyAgICAgICAgICAgICAgICBjYXNlIDQ6CisgICAgICAgICAgICAgICAgICB2YWx1ZSAvPSAw eDEwMDsKKyAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAg ICAgICAgICAgY29sb3J2YWwgfD0gKHZhbHVlIDw8IHBvcyk7CisgICAgICAgICAgICAgIHBvcyAr PSAweDg7CisgICAgICAgICAgICAgIGlmIChpID09IDIpCisgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgICAgIFhTRVRJ TlQgKHJldCwgY29sb3J2YWwpOworICAgICAgICAgICAgICAgICAgcmV0dXJuIHJldDsKKyAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICAgIGNvbG9yID0gZW5kOworICAgICAgICAgICAgfQor ICAgICAgICB9CisgICAgfQorICBlbHNlIGlmIChzdHJuaWNtcCAoY29sb3JuYW1lLCAicmdiOiIs IDQpID09IDApCisgICAgeworICAgICAgY29uc3QgY2hhciAqY29sb3I7CisgICAgICBVSU5UIGNv bG9ydmFsOworICAgICAgaW50IGksIHBvczsKKyAgICAgIHBvcyA9IDA7CisgICAgICBjb2xvcnZh bCA9IDA7CisgICAgICBjb2xvciA9IGNvbG9ybmFtZSArIDQ7CisgICAgICBmb3IgKGkgPSAwOyBp IDwgMzsgaSsrKQorICAgICAgICB7CisgICAgICAgICAgY2hhciAqZW5kOworICAgICAgICAgIHVu c2lnbmVkIGxvbmcgdmFsdWU7CisgICAgICAgICAgLyogVGhlIGNoZWNrIGZvciAneCcgaW4gdGhl IGZvbGxvd2luZyBjb25kaXRpb25hbCB0YWtlcyBpbnRvCisgICAgICAgICAgICAgYWNjb3VudCB0 aGUgZmFjdCB0aGF0IHN0cnRvbCBhbGxvd3MgYSAiMHgiIGluIGZyb250IG9mCisgICAgICAgICAg ICAgb3VyIG51bWJlcnMsIGFuZCB3ZSBkb24ndC4gKi8KKyAgICAgICAgICBpZiAoIWlzeGRpZ2l0 IChjb2xvclswXSkgfHwgY29sb3JbMV0gPT0gJ3gnKQorICAgICAgICAgICAgYnJlYWs7CisgICAg ICAgICAgdmFsdWUgPSBzdHJ0b3VsIChjb2xvciwgJmVuZCwgMTYpOworICAgICAgICAgIGlmIChl cnJubyA9PSBFUkFOR0UpCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBzd2l0Y2ggKGVu ZCAtIGNvbG9yKQorICAgICAgICAgICAgeworICAgICAgICAgICAgY2FzZSAxOgorICAgICAgICAg ICAgICB2YWx1ZSA9IHZhbHVlICogMHgxMCArIHZhbHVlOworICAgICAgICAgICAgICBicmVhazsK KyAgICAgICAgICAgIGNhc2UgMjoKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBj YXNlIDM6CisgICAgICAgICAgICAgIHZhbHVlIC89IDB4MTA7CisgICAgICAgICAgICAgIGJyZWFr OworICAgICAgICAgICAgY2FzZSA0OgorICAgICAgICAgICAgICB2YWx1ZSAvPSAweDEwMDsKKyAg ICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICB2 YWx1ZSA9IFVMT05HX01BWDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBpZiAodmFsdWUgPT0g VUxPTkdfTUFYKQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgY29sb3J2YWwgfD0gKHZh bHVlIDw8IHBvcyk7CisgICAgICAgICAgcG9zICs9IDB4ODsKKyAgICAgICAgICBpZiAoaSA9PSAy KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAoKmVuZCAhPSAnXDAnKQorICAgICAg ICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAg ICAgICAgICBYU0VUSU5UIChyZXQsIGNvbG9ydmFsKTsKKyAgICAgICAgICAgICAgcmV0dXJuIHJl dDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBpZiAoKmVuZCAhPSAnLycpCisgICAgICAgICAg ICBicmVhazsKKyAgICAgICAgICBjb2xvciA9IGVuZCArIDE7CisgICAgICAgIH0KKyAgICB9Cisg ICAgZWxzZSBpZiAoc3RybmljbXAgKGNvbG9ybmFtZSwgInJnYmk6IiwgNSkgPT0gMCkKKyAgICAg IHsKKyAgICAgICAgLyogVGhpcyBpcyBhbiBSR0IgSW50ZW5zaXR5IHNwZWNpZmljYXRpb24uICov CisgICAgICAgIGNvbnN0IGNoYXIgKmNvbG9yOworICAgICAgICBVSU5UIGNvbG9ydmFsOworICAg ICAgICBpbnQgaSwgcG9zOworICAgICAgICBwb3MgPSAwOworICAgICAgICBjb2xvcnZhbCA9IDA7 CisgICAgICAgIGNvbG9yID0gY29sb3JuYW1lICsgNTsKKyAgICAgICAgZm9yIChpID0gMDsgaSA8 IDM7IGkrKykKKyAgICAgICAgICB7CisgICAgICAgICAgICBjaGFyICplbmQ7CisgICAgICAgICAg ICBkb3VibGUgdmFsdWU7CisgICAgICAgICAgICBVSU5UIHZhbDsKKyAgICAgICAgICAgIHZhbHVl ID0gc3RydG9kIChjb2xvciwgJmVuZCk7CisgICAgICAgICAgICBpZiAoZXJybm8gPT0gRVJBTkdF KQorICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGlmICh2YWx1ZSA8IDAuMCB8fCB2 YWx1ZSA+IDEuMCkKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB2YWwgPSAoVUlO VCkoMHgxMDAgKiB2YWx1ZSk7CisgICAgICAgICAgICAvKiBXZSB1c2VkIDB4MTAwIGluc3RlYWQg b2YgMHhGRiB0byBnaXZlIGEgY29udGludW91cworICAgICAgICAgICAgICAgcmFuZ2UgYmV0d2Vl biAwLjAgYW5kIDEuMCBpbmNsdXNpdmUuICBUaGUgbmV4dCBzdGF0ZW1lbnQKKyAgICAgICAgICAg ICAgIGZpeGVzIHRoZSAxLjAgY2FzZS4gKi8KKyAgICAgICAgICAgIGlmICh2YWwgPT0gMHgxMDAp CisgICAgICAgICAgICAgIHZhbCA9IDB4RkY7CisgICAgICAgICAgICBjb2xvcnZhbCB8PSAodmFs IDw8IHBvcyk7CisgICAgICAgICAgICBwb3MgKz0gMHg4OworICAgICAgICAgICAgaWYgKGkgPT0g MikKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmICgqZW5kICE9ICdcMCcpCisg ICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgp OworICAgICAgICAgICAgICAgIFhTRVRJTlQgKHJldCwgY29sb3J2YWwpOworICAgICAgICAgICAg ICAgIHJldHVybiByZXQ7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICgqZW5kICE9 ICcvJykKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjb2xvciA9IGVuZCArIDE7 CisgICAgICAgICAgfQorICAgICAgfQorICAvKiBJIGFtIG5vdCBnb2luZyB0byBhdHRlbXB0IHRv IGhhbmRsZSBhbnkgb2YgdGhlIENJRSBjb2xvciBzY2hlbWVzCisgICAgIG9yIFRla0hWQywgc2lu Y2UgSSBkb24ndCBrbm93IHRoZSBhbGdvcml0aG1zIGZvciBjb252ZXJzaW9uIHRvIFJHQi4KKyAg ICAgSWYgd2UgZmFpbCB0byBsb29rdXAgdGhlIGNvbG9yIG5hbWUgaW4gdzMyX2NvbG9yX21hcCwg dGhlbiBjaGVjayB0aGUKKyAgICAgY29sb3JuYW1lIHRvIHNlZSBpZiBpdCBjYW4gYmUgY3J1ZGVs eSBhcHByb3hpbWF0ZWQ6IElmIHRoZSBYIGNvbG9yCisgICAgIGVuZHMgaW4gYSBudW1iZXIgKGUu Zy4sICJkYXJrc2VhZ3JlZW4yIiksIHN0cmlwIHRoZSBudW1iZXIgYW5kCisgICAgIHJldHVybiB0 aGUgcmVzdWx0IG9mIGxvb2tpbmcgdXAgdGhlIGJhc2UgY29sb3IgbmFtZS4gKi8KKyAgcmV0ID0g bWNfdzMyX2NvbG9yX21hcF9sb29rdXAgKGNvbG9ybmFtZSk7CisgIGlmIChOSUxQIChyZXQpKQor ICAgIHsKKyAgICAgIGludCBsZW4gPSBzdHJsZW4gKGNvbG9ybmFtZSk7CisgICAgICBpZiAoaXNk aWdpdCAoY29sb3JuYW1lW2xlbiAtIDFdKSkKKyAgICAgICAgeworICAgICAgICAgIGNoYXIgKnB0 ciwgKmFwcHJveCA9IGFsbG9jYSAobGVuICsgMSk7CisgICAgICAgICAgc3RyY3B5IChhcHByb3gs IGNvbG9ybmFtZSk7CisgICAgICAgICAgcHRyID0gJmFwcHJveFtsZW4gLSAxXTsKKyAgICAgICAg ICB3aGlsZSAocHRyID4gYXBwcm94ICYmIGlzZGlnaXQgKCpwdHIpKQorICAgICAgICAgICAgKnB0 ci0tID0gJ1wwJzsKKyAgICAgICAgICByZXQgPSBtY193MzJfY29sb3JfbWFwX2xvb2t1cCAoYXBw cm94KTsKKyAgICAgICAgfQorICAgIH0KKyAgdW5ibG9ja19pbnB1dCAoKTsKKyAgcmV0dXJuIHJl dDsKK30KKworLyogRGVjaWRlIGlmIGNvbG9yIG5hbWVkIENPTE9SIGlzIHZhbGlkIGZvciB0aGUg ZGlzcGxheSBhc3NvY2lhdGVkIHdpdGgKKyAgIHRoZSBzZWxlY3RlZCBmcmFtZTsgaWYgc28sIHJl dHVybiB0aGUgcmdiIHZhbHVlcyBpbiBDT0xPUl9ERUYuCisgICBJZiBBTExPQyBpcyBub256ZXJv LCBhbGxvY2F0ZSBhIG5ldyBjb2xvcm1hcCBjZWxsLiAqLworaW50CittY193MzJfZGVmaW5lZF9j b2xvciAoc3RydWN0IGZyYW1lICpmLCBjb25zdCBjaGFyICpjb2xvciwgbWNfWENvbG9yICpjb2xv cl9kZWYsIGJvb2wgYWxsb2NfcCkKK3sKKyAgcmVnaXN0ZXIgTGlzcF9PYmplY3QgdGVtOworICBD T0xPUlJFRiB3MzJfY29sb3JfcmVmOworICB0ZW0gPSBtY194X3RvX3czMl9jb2xvciAoY29sb3Ip OworICBpZiAoIU5JTFAgKHRlbSkpCisgICAgeworICAgICAgaWYgKGYpCisgICAgICAgIHsKKyAg ICAgICAgICAvKiBBcHBseSBnYW1tYSBjb3JyZWN0aW9uLiAqLworICAgICAgICAgIHczMl9jb2xv cl9yZWYgPSBYVUZJWE5VTV9SQVcgKHRlbSk7CisgICAgICAgICAgZ2FtbWFfY29ycmVjdCAoZiwg JnczMl9jb2xvcl9yZWYpOworICAgICAgICAgIFhTRVRJTlQgKHRlbSwgdzMyX2NvbG9yX3JlZik7 CisgICAgICAgIH0KKyAgICAgIC8qIE1hcCB0aGlzIGNvbG9yIHRvIHRoZSBwYWxldHRlIGlmIGl0 IGlzIGVuYWJsZWQuICovCisgICAgICBpZiAoIU5JTFAgKFZ3MzJfZW5hYmxlX3BhbGV0dGUpKQor ICAgICAgICB7CisgICAgICAgICAgc3RydWN0IHczMl9wYWxldHRlX2VudHJ5ICogZW50cnkgPSBv bmVfdzMyX2Rpc3BsYXlfaW5mby5jb2xvcl9saXN0OworICAgICAgICAgIHN0cnVjdCB3MzJfcGFs ZXR0ZV9lbnRyeSAqKiBwcmV2ID0gJm9uZV93MzJfZGlzcGxheV9pbmZvLmNvbG9yX2xpc3Q7Cisg ICAgICAgICAgLyogY2hlY2sgaWYgY29sb3IgaXMgYWxyZWFkeSBtYXBwZWQgKi8KKyAgICAgICAg ICB3aGlsZSAoZW50cnkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmIChNQ19XMzJf Q09MT1IgKGVudHJ5LT5lbnRyeSkgPT0gWFVGSVhOVU1fUkFXICh0ZW0pKQorICAgICAgICAgICAg ICAgIGJyZWFrOworICAgICAgICAgICAgICBwcmV2ID0gJmVudHJ5LT5uZXh0OworICAgICAgICAg ICAgICBlbnRyeSA9IGVudHJ5LT5uZXh0OworICAgICAgICAgICAgfQorICAgICAgICAgIGlmIChl bnRyeSA9PSBOVUxMICYmIGFsbG9jX3ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIC8q IG5vdCBhbHJlYWR5IG1hcHBlZCwgc28gYWRkIHRvIGxpc3QgKi8KKyAgICAgICAgICAgICAgZW50 cnkgPSB4bWFsbG9jIChzaXplb2YgKHN0cnVjdCB3MzJfcGFsZXR0ZV9lbnRyeSkpOworICAgICAg ICAgICAgICBNQ19XMzJfU0VUX0NPTE9SIChlbnRyeS0+ZW50cnksIFhVRklYTlVNX1JBVyAodGVt KSk7CisgICAgICAgICAgICAgIGVudHJ5LT5uZXh0ID0gTlVMTDsKKyAgICAgICAgICAgICAgKnBy ZXYgPSBlbnRyeTsKKyAgICAgICAgICAgICAgb25lX3czMl9kaXNwbGF5X2luZm8ubnVtX2NvbG9y cysrOworICAgICAgICAgICAgICAvKiBzZXQgZmxhZyB0aGF0IHBhbGV0dGUgbXVzdCBiZSByZWdl bmVyYXRlZCAqLworICAgICAgICAgICAgICBvbmVfdzMyX2Rpc3BsYXlfaW5mby5yZWdlbl9wYWxl dHRlID0gVFJVRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgLyogRW5zdXJlIENP TE9SUkVGIHZhbHVlIGlzIHNuYXBwZWQgdG8gbmVhcmVzdCBjb2xvciBpbiAoZGVmYXVsdCkKKyAg ICAgICAgIHBhbGV0dGUgYnkgc2ltdWxhdGluZyB0aGUgUEFMRVRURVJHQiBtYWNyby4gIFRoaXMg d29ya3Mgd2hldGhlcgorICAgICAgICAgb3Igbm90IHRoZSBkaXNwbGF5IGRldmljZSBoYXMgYSBw YWxldHRlLiAqLworICAgICAgdzMyX2NvbG9yX3JlZiA9IFhVRklYTlVNX1JBVyAodGVtKSB8IDB4 MjAwMDAwMDsKKyAgICAgIGNvbG9yX2RlZi0+cGl4ZWwgPSB3MzJfY29sb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tPnJlZCA9IC0xLjA7CisgICAgICAgIGxzbC0+Z3JlZW4gPSAtMS4wOworICAgICAgICBs c2wtPmJsdWUgPSAtMS4wOworICAgICAgfQorfQorCisvKiBEcmF3IHN0cmV0Y2ggZ2x5cGggc3Ry aW5nIFMuICovCitzdGF0aWMgdm9pZAorbWNfdzMyX2RyYXdfc3RyZXRjaF9nbHlwaF9zdHJpbmcg KHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMpCit7CisgIGVhc3NlcnQgKHMtPmZpcnN0X2dseXBoLT50 eXBlID09IFNUUkVUQ0hfR0xZUEgpOworICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IKKyAgICAg ICYmICF4X3N0cmV0Y2hfY3Vyc29yX3ApCisgICAgeworICAgICAgLyogSWYgYHgtc3RyZXRjaC1j dXJzb3InIGlzIG5pbCwgZG9uJ3QgZHJhdyBhIGJsb2NrIGN1cnNvciBhcyB3aWRlIGFzIHRoZQor ICAgICAgc3RyZXRjaCBnbHlwaC4gKi8KKyAgICAgIGludCB3aWR0aCwgYmFja2dyb3VuZF93aWR0 aCA9IHMtPmJhY2tncm91bmRfd2lkdGg7CisgICAgICBpbnQgeCA9IHMtPng7CisgICAgICBpZiAo IXMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAgICAgICAgeworICAgICAgICAgIGludCBsZWZ0X3ggPSB3 aW5kb3dfYm94X2xlZnRfb2Zmc2V0IChzLT53LCBURVhUX0FSRUEpOworICAgICAgICAgIGlmICh4 IDwgbGVmdF94KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBiYWNrZ3JvdW5kX3dpZHRo IC09IGxlZnRfeCAtIHg7CisgICAgICAgICAgICAgIHggPSBsZWZ0X3g7CisgICAgICAgICAgICB9 CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgeworICAgICAgICAgICAvKiBJbiBS Mkwgcm93cywgZHJhdyB0aGUgY3Vyc29yIG9uIHRoZSByaWdodCBlZGdlIG9mIHRoZQorICAgICAg ICAgICAgICBzdHJldGNoIGdseXBoLiAqLworICAgICAgICAgICBpbnQgcmlnaHRfeCA9IHdpbmRv d19ib3hfcmlnaHQgKHMtPncsIFRFWFRfQVJFQSk7CisgICAgICAgICAgIGlmICh4ICsgYmFja2dy b3VuZF93aWR0aCA+IHJpZ2h0X3gpCisgICAgICAgICAgICAgYmFja2dyb3VuZF93aWR0aCAtPSB4 IC0gcmlnaHRfeDsKKyAgICAgICAgICAgeCArPSBiYWNrZ3JvdW5kX3dpZHRoOworICAgICAgICAg fQorICAgICAgd2lkdGggPSBtaW4gKEZSQU1FX0NPTFVNTl9XSURUSCAocy0+ZiksIGJhY2tncm91 bmRfd2lkdGgpOworICAgICAgaWYgKHMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAgICAgICAgeCAtPSB3 aWR0aDsKKyAgICAgIC8qIERyYXcgY3Vyc29yLiAqLworICAgICAgdzMyX2RyYXdfZ2x5cGhfc3Ry aW5nX2JnX3JlY3QgKHMsIHgsIHMtPnksIHdpZHRoLCBzLT5oZWlnaHQpOworICAgICAgLyogQ2xl YXIgcmVzdCB1c2luZyB0aGUgR0Mgb2YgdGhlIG9yaWdpbmFsIG5vbi1jdXJzb3IgZmFjZS4gKi8K KyAgICAgIGlmICh3aWR0aCA8IGJhY2tncm91bmRfd2lkdGgpCisgICAgICAgIHsKKyAgICAgICAg ICBFbWFjc19HQyAqZ2MgPSBzLT5mYWNlLT5nYzsKKyAgICAgICAgICBpbnQgeSA9IHMtPnk7Cisg ICAgICAgICAgaW50IHcgPSBiYWNrZ3JvdW5kX3dpZHRoIC0gd2lkdGgsIGggPSBzLT5oZWlnaHQ7 CisgICAgICAgICAgUkVDVCByOworICAgICAgICAgIEhEQyBoZGMgPSBzLT5oZGM7CisgICAgICAg ICAgaWYgKCFzLT5yb3ctPnJldmVyc2VkX3ApCisgICAgICAgICAgICB4ICs9IHdpZHRoOworICAg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgICB4ID0gcy0+eDsKKyAgICAgICAgICBpZiAocy0+ cm93LT5tb3VzZV9mYWNlX3AKKyAgICAgICAgICAgICAgJiYgY3Vyc29yX2luX21vdXNlX2ZhY2Vf cCAocy0+dykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHczMl9zZXRfbW91c2VfZmFj ZV9nYyAocyk7CisgICAgICAgICAgICAgIGdjID0gcy0+Z2M7CisgICAgICAgICAgICB9CisgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGdjID0gcy0+ZmFjZS0+Z2M7CisgICAgICAgICAg Z2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsICZyKTsKKyAgICAgICAgICB3MzJfc2V0X2Ns aXBfcmVjdGFuZ2xlIChoZGMsICZyKTsKKyNpZiAwIC8qIFRPRE86IHN0aXBwbGUgKi8KKyAgICAg ICAgICBpZiAocy0+ZmFjZS0+c3RpcHBsZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg LyogRmlsbCBiYWNrZ3JvdW5kIHdpdGggYSBzdGlwcGxlIHBhdHRlcm4uICovCisgICAgICAgICAg ICAgIFhTZXRGaWxsU3R5bGUgKHMtPmRpc3BsYXksIGdjLCBGaWxsT3BhcXVlU3RpcHBsZWQpOwor ICAgICAgICAgICAgICBYRmlsbFJlY3RhbmdsZSAocy0+ZGlzcGxheSwgcy0+d2luZG93LCBnYywg eCwgeSwgdywgaCk7CisgICAgICAgICAgICAgIFhTZXRGaWxsU3R5bGUgKHMtPmRpc3BsYXksIGdj LCBGaWxsU29saWQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorI2VuZGlmCisg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5o ZGMsIGdjLT5iYWNrZ3JvdW5kLCB4LCB5LCB3LCBoKTsKKyAgICAgICAgICAgICAgfQorICAgICAg ICB9CisgICAgfQorICAgIGVsc2UgaWYgKCFzLT5iYWNrZ3JvdW5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hY2UtPnN0aXBwbGUgIT0gMDsKKyAgICAgIH0KKyAgICAg IGVsc2UgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SKQorICAgICAgICB7CisgICAgICAgICAgbWNf dzMyX3NldF9jdXJzb3JfZ2MgKHMsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICBzLT5zdGlwcGxl ZF9wID0gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAocy0+aGwgPT0gRFJBV19N T1VTRV9GQUNFKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIHczMl9zZXRfbW91c2VfZmFjZV9n YyAocyk7CisgICAgICAgICAgICBzLT5zdGlwcGxlZF9wID0gcy0+ZmFjZS0+c3RpcHBsZSAhPSAw OworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmIChzLT5obCA9PSBEUkFXX0lNQUdFX1JB SVNFRAorICAgICAgICAgICAgICAgICAgIHx8IHMtPmhsID09IERSQVdfSU1BR0VfU1VOS0VOKQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICBzLT5nYyA9IHMtPmZhY2UtPmdjOworICAgICAg ICAgICAgICBzLT5zdGlwcGxlZF9wID0gcy0+ZmFjZS0+c3RpcHBsZSAhPSAwOworICAgICAgICAg ICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBlbWFjc19hYm9ydCAoKTsKKyAg LyogR0MgbXVzdCBoYXZlIGJlZW4gc2V0LiAqLworICBlYXNzZXJ0IChzLT5nYyAhPSAwKTsKK30K KworLyogRHJhdyBhIGhvbGxvdyBib3ggY3Vyc29yIG9uIHdpbmRvdyBXIGluIGdseXBoIHJvdyBS T1cuICovCitzdGF0aWMgdm9pZAorbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAoc3RydWN0IHdp bmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93LCBpbnQgeCwgaW50IGZ4LCBpbnQgeSwgaW50 IGZ5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGhwb3MsIGludCB2cG9zLCBpbnQg d2QsIGludCBoKQoreworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAo dykpOworICBIREMgaGRjOworICBSRUNUIHJlY3Q7CisgIEhCUlVTSCBoYiA9IENyZWF0ZVNvbGlk QnJ1c2ggKGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsKTsKKyAgLyogR2V0IHRoZSBn bHlwaCB0aGUgY3Vyc29yIGlzIG9uLiAgSWYgd2UgY2FuJ3QgdGVsbCBiZWNhdXNlCisgICAgIHRo ZSBjdXJyZW50IG1hdHJpeCBpcyBpbnZhbGlkIG9yIHN1Y2gsIGdpdmUgdXAuICovCisgIHN0cnVj dCBnbHlwaCAqY3Vyc29yX2dseXBoID0gbWNfZ2V0X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCBy b3csIGhwb3MsIHZwb3MpOworICBpZiAoY3Vyc29yX2dseXBoID09IE5VTEwpCisgICAgeworICAg ICAgRGVsZXRlT2JqZWN0IChoYik7CisgICAgICByZXR1cm47CisgICAgfQorICBpbnQgcmwgPSBm eDsKKyAgaW50IHJ0ID0gZnk7CisgIGludCByciA9IHJsICsgd2Q7CisgIGludCByYiA9IHJ0ICsg aDsKKyAgLy8gIGZwcmludGYgKHN0ZGVyciwgIk1DX0hPTExPV19CT1g6ICBybCAoJWQpIHwgcnQg KCVkKSB8IHJyICglZCkgfCByYiAoJWQpXG4iLAorICAvLyAgICAgICAgICAgICAgICAgICBybCwg cnQsIHJyLCByYik7CisgIHJlY3QubGVmdCA9IHJsOworICByZWN0LnRvcCA9IHJ0OworICByZWN0 LnJpZ2h0ID0gcnI7CisgIHJlY3QuYm90dG9tID0gcmI7CisgIGhkYyA9IGdldF9mcmFtZV9kYyAo Zik7CisgIC8qIFNldCBjbGlw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AqLworICAgICAgaWYgKGFj dGl2ZV9wKQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChX SU5ET1dfRlJBTUUgKHcpKTsKKyAgICAgICAgICBIV05EIGh3bmQgPSBGUkFNRV9XMzJfV0lORE9X IChmKTsKKyAgICAgICAgICB3MzJfc3lzdGVtX2NhcmV0X3gKKyAgICAgICAgICAgID0gV0lORE9X X1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgeCk7CisgICAgICAgICAgLyogRklYTUU6ICBXaGF0 IHNob3VsZCB3ZSB1c2UgaW5zdGVhZCBvZiBgdy0+cGh5c19jdXJzb3JfYXNjZW50Jz8gKi8KKyAg ICAgICAgICB3MzJfc3lzdGVtX2NhcmV0X3kKKyAgICAgICAgICAgID0gKFdJTkRPV19UT19GUkFN RV9QSVhFTF9ZICh3LCB5KQorICAgICAgICAgICAgICAgKyByb3ctPmFzY2VudCAtIHctPnBoeXNf Y3Vyc29yX2FzY2VudCk7CisgICAgICAgICAgdzMyX3N5c3RlbV9jYXJldF93aW5kb3cgPSB3Owor ICAgICAgICAgIHczMl9zeXN0ZW1fY2FyZXRfaGRyX2hlaWdodCA9IFdJTkRPV19IRUFERVJfTElO RV9IRUlHSFQgKHcpOworICAgICAgICAgIHczMl9zeXN0ZW1fY2FyZXRfbW9kZV9oZWlnaHQgPSBX SU5ET1dfTU9ERV9MSU5FX0hFSUdIVCAodyk7CisgICAgICAgICAgUG9zdE1lc3NhZ2UgKGh3bmQs IFdNX0lNRV9TVEFSVENPTVBPU0lUSU9OLCAwLCAwKTsKKyAgICAgICAgICAvKiBJZiB0aGUgc2l6 ZSBvZiB0aGUgYWN0aXZlIGN1cnNvciBjaGFuZ2VkLCBkZXN0cm95IHRoZSBvbGQKKyAgICAgICAg ICAgICBzeXN0ZW0gY2FyZXQuICovCisgICAgICAgICAgaWYgKHczMl9zeXN0ZW1fY2FyZXRfaHdu ZAorICAgICAgICAgICAgICAmJiAodzMyX3N5c3RlbV9jYXJldF9oZWlnaHQgIT0gaCkpCisgICAg ICAgICAgICBQb3N0TWVzc2FnZSAoaHduZCwgV01fRU1BQ1NfREVTVFJPWV9DQVJFVCwgMCwgMCk7 CisgICAgICAgICAgdzMyX3N5c3RlbV9jYXJldF9oZWlnaHQgPSBoOworICAgICAgICAgIC8qIE1v dmUgdGhlIHN5c3RlbSBjYXJldC4gKi8KKyAgICAgICAgICBQb3N0TWVzc2FnZSAoaHduZCwgV01f RU1BQ1NfVFJBQ0tfQ0FSRVQsIDAsIDApOworICAgICAgICB9CisgICAgICAvKiBUaGUgZnJpbmdl IGJpdG1hcHMgYXJlIHByZXNlbnRseSBoYW5kbGVkIGVsc2V3aGVyZSwgYnV0IGNvdWxkIHNvbWVk YXkKKyAgICAgIGJlIG1hbmFnZWQgKGluIHBhcnQpIGF0IHRoaXMgc2VjdGlvbiBvZiBjb2RlLiAq LworICAgICAgaWYgKHJvdy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVfcAorICAgICAgICAgICYm IChyb3ctPnJldmVyc2VkX3AKKyAgICAgICAgICAgICA/IChocG9zIDwgMCkKKyAgICAgICAgICAg ICA6IChocG9zID49IHJvdy0+dXNlZFtURVhUX0FSRUFdKSkpCisgICAgICAgIHsKKyAgICAgICAg ICByb3ctPmN1cnNvcl9pbl9mcmluZ2VfcCA9IHRydWU7CisgICAgICAgICAgbWNfZHJhd19mcmlu Z2VfYml0bWFwICh3LCByb3csIHJvdy0+cmV2ZXJzZWRfcCwgY3Vyc29yX3R5cGUpOworICAgICAg ICAgIHJldHVybjsKKyAgICAgICAgfQorICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRP V19GUkFNRSAodykpOworICBDT0xPUlJFRiBvcmlnaW5hbF9jdXJzb3JfcGl4ZWwgPSBmLT5vdXRw dXRfZGF0YS53MzItPmN1cnNvcl9waXhlbDsKKyAgLyogeHRlcm0uYy94dGVybS5oIHVzZSBHQzsg d2hlcm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S1jdXJzb3ItYXQtcmVnaW9uLXByZS16di1m YWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZl X3JlZ2lvbl9lbmRfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2FjdGl2ZV9yZWdpb25f ZW5kX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZl X2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2Ut Y3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNl ICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFj ZV9pZCk7CisgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0 aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91 bmQgPSBob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZS0+YmFja2dyb3VuZDsKKyAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAg ICAgICAgICAgICAgICAgJiYgYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vy c29yX2dseXBoLT5jaGFycG9zID4gcmVnaW9uX2JlZworICAgICAgICAgICAgICAgICAgICAgICAm JiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3MgPCByZWdpb25fZW5kKQorICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3 ZWVuX2ZhY2VfaWQgPSBsb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wICYmIGxzbC5ibHVlID49IDApCisgICAgICAg ICAgeworICAgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53 MzItPmN1cnNvcl9waXhlbCcuICovCisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1 cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93 X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgp OworICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5h bF9jdXJzb3JfcGl4ZWw7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53 MzItPmN1cnNvcl9nYycgYnkgYm9ycm93aW5nIHRoZQorICAgICAgICAgICAgICBmdW5jdGlvbmFs aXR5IG9mIGB4X21ha2VfZ2MnIGluIHczMmZucy5jLiAqLworICAgICAgICAgICAgICBpZiAocmVn aW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcAorICAgICAgICAgICAg ICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID09IHJlZ2lvbl9iZWcpCisgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVn aW9uX2JlZ19mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVh bC1mYWtlLWN1cnNvci1hdC1yZWdpb24tcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAg ICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2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ICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwg aG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICBl bnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcs IGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAg ICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFjZSA9IEZBQ0Vf RlJPTV9JRCAoZiwgaG9sbG93X2FjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAg Z2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7Cisg ICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5iYWNrZ3JvdW5kID0gaG9sbG93X2FjdGl2ZV9y ZWdpb25fZW5kX2ZhY2UtPmJhY2tncm91bmQ7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIGFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jf Z2x5cGgtPmNoYXJwb3MgPiByZWdpb25fYmVnCisgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3MgPCByZWdpb25fZW5kKQorICAgICAgICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVn aW9uX2JldHdlZW5fZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIr LXJlYWwtZmFrZS1jdXJzb3ItaW4tcmVnaW9uLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAg ICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVu X2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFj ZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVf ZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1j dXJzb3ItcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgc3RydWN0 IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2FjdGl2 ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAgICBnY192YWx1ZXMuZm9yZWdyb3VuZCA9 IGhvbGxvd19hY3RpdmVfZmFjZS0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICBn Y192YWx1ZXMuYmFja2dyb3VuZCA9IGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZS0+ Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBl bHNlIGlmIChhY3RpdmVfcCkKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAg ICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25h bWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIp LCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0 aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAg ICAgICAgICAgICAgICAgICAgICBnY192YWx1ZXMuZm9yZWdyb3VuZCA9IGhvbGxvd19hY3RpdmVf ZmFjZS0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5iYWNr Z3JvdW5kID0gaG9sbG93X2FjdGl2ZV9mYWNlLT5iYWNrZ3JvdW5kOworICAgICAgICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICghYWN0aXZlX3ApCisgICAg ICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gZmFj ZV9pZCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBp bnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItaW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7 CisgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVf ZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAg ICAgICAgICAgICAgICAgICAgICBnY192YWx1ZXMuZm9yZWdyb3VuZCA9IGhvbGxvd19pbmFjdGl2 ZV9mYWNlLT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICAgICAgICAgICAgICBnY192YWx1ZXMu YmFja2dyb3VuZCA9IGhvbGxvd19pbmFjdGl2ZV9mYWNlLT5iYWNrZ3JvdW5kOworICAgICAgICAg ICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNv cl9nYyA9IFhDcmVhdGVHQyAoTlVMTCwgRlJBTUVfVzMyX1dJTkRPVyAoZiksIG1hc2ssICZnY192 YWx1ZXMpOworICAgICAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgLyog Rm9yY2UgYG1jX3czMl9zZXRfY3Vyc29yX2djJyB0byB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLncz Mi0+Y3Vyc29yX2djJy4gKi8KKyAgICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IHRydWU7 CisgICAgICAgICAgICAgIG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywgRFJB V19DVVJTT1IsIHgsIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBsc2wsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29y X2djX3ApOworICAgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYyA9IG9y aWdpbmFsX2N1cnNvcl9nYzsKKyAgICAgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAg ICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4 LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgICAgfQorICAgICAgYnJlYWs7 CisgICAgfQorICAgIGNhc2UgTUNfSE9MTE9XX0JPWDoKKyAgICB7CisgICAgICBpZiAobHNsLnJl ZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAg ICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29y X3BpeGVsJy4gKi8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9 IGNvbG9yX3BpeGVsOworICAgICAgICAgIG1jX3czMl9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIG1h dHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAgICAgICAgICBm LT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsK KyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1 cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOwor ICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAgICB7CisgICAg ICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisg ICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRh LnczMi0+Y3Vyc29yX2djJyBieSBib3Jyb3dpbmcgdGhlCisgICAgICAgICAgZnVuY3Rpb25hbGl0 eSBvZiBgeF9tYWtlX2djJyBpbiB3MzJmbnMuYy4gKi8KKyAgICAgICAgICBibG9ja19pbnB1dCAo KTsKKyAgICAgICAgICBFbWFjc19HQyBnY192YWx1ZXM7CisgICAgICAgICAgdW5zaWduZWQgbG9u ZyBtYXNrID0gR0NGb3JlZ3JvdW5kIHwgR0NCYWNrZ3JvdW5kOworICAgICAgICAgIGdjX3ZhbHVl cy5mb3JlZ3JvdW5kID0gRlJBTUVfQkFDS0dST1VORF9QSVhFTCAoZik7CisgICAgICAgICAgZ2Nf dmFsdWVzLmJhY2tncm91bmQgPSBjb2xvcl9waXhlbDsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0 YS53MzItPmN1cnNvcl9nYyA9IFhDcmVhdGVHQyAoTlVMTCwgRlJBTUVfVzMyX1dJTkRPVyAoZiks IG1hc2ssICZnY192YWx1ZXMpOworICAgICAgICAgIC8qIEZvcmNlIGBtY193MzJfc2V0X2N1cnNv cl9nYycgdG8gdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycuICovCisgICAg ICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IHRydWU7CisgICAgICAgICAgbWNfZHJhd19jdXJzb3Jf Z2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywgbHNsLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBl LCB3ZCwgYWN0aXZlX3AsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53 MzItPmN1cnNvcl9nYyA9IG9yaWdpbmFsX2N1cnNvcl9nYzsKKyAgICAgICAgICB1bmJsb2NrX2lu cHV0ICgpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAg ICBib29sIGN1cnNvcl9nY19wID0gZmFsc2U7CisgICAgICAgICAgICBtY19kcmF3X2N1cnNvcl9n bHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4LCBocG9zLCB2cG9zLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlw ZSwgd2QsIGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNv cl9nY19wKTsKKyAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBNQ19C QVI6CisgICAgeworICAgICAgaWYgKGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBs c2wuYmx1ZSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNr IGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcuICovCisgICAgICAgICAgZi0+b3V0 cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBjb2xvcl9waXhlbDsKKyAgICAgICAgICBib29s IGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gdHJ1ZTsKKyAgICAgICAgICBtY193MzJfZHJh d19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3 ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1D X0JBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIGYtPm91dHB1dF9k YXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9 CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBib29sIGN1cnNvcl9nY19p bnZpc2libGVfb2theV9wID0gZmFsc2U7CisgICAgICAgICAgICBtY193MzJfZHJhd19iYXJfY3Vy c29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl93aWR0aCwgTUNfQkFSLCBj dXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7Cisg ICAgfQorICAgIGNhc2UgTUNfSEJBUjoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYm IGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAv KiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4g Ki8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3Bp eGVsOworICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSB0cnVlOwor ICAgICAgICAgIG1jX3czMl9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwg eSwgZnksIGhwb3MsIHZwb3MsIHdkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGgsIGN1cnNvcl93aWR0aCwgTUNfSEJBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOwor ICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vy c29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAg ICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7CisgICAgICAgICAg ICBtY193MzJfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBo cG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGgsIGN1 cnNvcl93aWR0aCwgTUNfSEJBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAg ICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJv cnQgKCk7CisgIH0KKyAgICB9Cit9CisKKy8qIERyYXcgZ2x5cGggc3RyaW5nIFMuICBUaGUgYG1j X21hdHJpeGAgaXMgcmVzZXJ2ZWQgZm9yIGZ1dHVyZSB1c2Ugd2hlbiBlcmFzaW5nCisgICBmYWtl IGN1cnNvcnMgZHVyaW5nIGBtY191cGRhdGVfd2luZG93X2VyYXNlJyBh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aCA9IDAsIG5leHQgPSBzLT5uZXh0OworICAgICAgICAgICBuZXh0ICYmIHdpZHRoIDwg cy0+cmlnaHRfb3Zlcmhhbmc7CisgICAgICAgICAgIHdpZHRoICs9IG5leHQtPndpZHRoLCBuZXh0 ID0gbmV4dC0+bmV4dCkKKyAgICAgICAgaWYgKG5leHQtPmZpcnN0X2dseXBoLT50eXBlICE9IElN QUdFX0dMWVBIKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIG1jX3czMl9zZXRfZ2x5cGhfc3Ry aW5nX2djIChuZXh0LCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgICB3MzJfc2V0X2dseXBoX3N0 cmluZ19jbGlwcGluZyAobmV4dCk7CisgICAgICAgICAgICBpZiAobmV4dC0+Zmlyc3RfZ2x5cGgt PnR5cGUgPT0gU1RSRVRDSF9HTFlQSCkKKyAgICAgICAgICAgICAgbWNfdzMyX2RyYXdfc3RyZXRj aF9nbHlwaF9zdHJpbmcgKG5leHQpOworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAg ICAgdzMyX2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKG5leHQsIHRydWUpOworICAgICAg ICAgICAgbmV4dC0+bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICB9CisgICAgfQorICAvKiBTZXQg dXAgUy0+Z2MsIHNldCBjbGlwcGluZyBhbmQgZHJhdyBTLiAqLworICBtY193MzJfc2V0X2dseXBo X3N0cmluZ19nYyAocywgY3Vyc29yX2djX3ApOworICAvKiBEcmF3IHJlbGllZiAoaWYgYW55KSBp biBhZHZhbmNlIGZvciBjaGFyL2NvbXBvc2l0aW9uIHNvIHRoYXQgdGhlCisgICAgIGdseXBoIHN0 cmluZyBjYW4gYmUgZHJhd24gb3ZlciBpdC4gKi8KKyAgaWYgKCFzLT5mb3Jfb3ZlcmxhcHMKKyAg ICAgICYmIHMtPmZhY2UtPmJveCAhPSBGQUNFX05PX0JPWAorICAgICAgJiYgKHMtP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Ag ICAgdzMyX2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKHMsIGZhbHNlKTsKKyAgICAgIHcz Ml9kcmF3X2dseXBobGVzc19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAgICBicmVh azsKKyAgICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7CisgICAgfQorICBpZiAoIXMt PmZvcl9vdmVybGFwcykKKyAgICB7CisgICAgICAvKiBEcmF3IHVuZGVybGluZS4gKi8KKyAgICAg IGlmIChzLT5mYWNlLT51bmRlcmxpbmVfcCkKKyAgICAgICAgeworICAgICAgICAgIGlmIChzLT5m YWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX1dBVkUpCisgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgIENPTE9SUkVGIGNvbG9yOworICAgICAgICAgICAgICBpZiAocy0+ZmFjZS0+ dW5kZXJsaW5lX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgICAgIGNvbG9yID0gcy0+Z2MtPmZv cmVncm91bmQ7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgY29sb3Ig PSBzLT5mYWNlLT51bmRlcmxpbmVfY29sb3I7CisgICAgICAgICAgICAgIHczMl9kcmF3X3VuZGVy d2F2ZSAocywgY29sb3IpOworICAgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKHMtPmZh Y2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgdW5zaWduZWQgbG9uZyB0aGlja25lc3MsIHBvc2l0aW9uOworICAgICAgICAg ICAgICBpbnQgeTsKKyAgICAgICAgICAgICAgaWYgKHMtPnByZXYgJiYgcy0+cHJldi0+ZmFjZS0+ dW5kZXJsaW5lX3AKKyAgICAgICAgICAgICAgICAgICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGlu ZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgICAvKiBXZSB1c2UgdGhlIHNhbWUgdW5kZXJsaW5lIHN0eWxlIGFzIHRoZSBwcmV2aW91 cyBvbmUuICovCisgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSBzLT5wcmV2LT51bmRlcmxp bmVfdGhpY2tuZXNzOworICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBzLT5wcmV2LT51bmRl cmxpbmVfcG9zaXRpb247CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlCisg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgLyogR2V0IHRoZSB1bmRlcmxpbmUg dGhpY2tuZXNzLiAgRGVmYXVsdCBpcyAxIHBpeGVsLiAqLworICAgICAgICAgICAgICAgICAgaWYg KHMtPmZvbnQgJiYgcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzcyA+IDApCisgICAgICAgICAg ICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPmZvbnQtPnVuZGVybGluZV90aGlja25lc3M7CisgICAg ICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAx OworICAgICAgICAgICAgICAgICAgaWYgKHhfdW5kZXJsaW5lX2F0X2Rlc2NlbnRfbGluZSkKKyAg ICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+aGVpZ2h0IC0gdGhpY2tuZXNzKSAtIChz LT55YmFzZSAtIHMtPnkpOworICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgLyogR2V0IHRoZSB1bmRlcmxpbmUg cG9zaXRpb24uICBUaGlzIGlzIHRoZSByZWNvbW1lbmRlZAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgdmVydGljYWwgb2Zmc2V0IGluIHBpeGVscyBmcm9tIHRoZSBiYXNlbGluZSB0byB0aGUg dG9wIG9mCisgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgdW5kZXJsaW5lLiAgVGhpcyBp cyBhIHNpZ25lZCB2YWx1ZSBhY2NvcmRpbmcgdG8gdGhlCisgICAgICAgICAgICAgICAgICAgICAg ICAgICBzcGVjcywgYW5kIGl0cyBkZWZhdWx0IGlzCisgICAgICAgICAgICAgICAgICAgICAgICAg ICBST1VORCAoKG1heGltdW1fZGVzY2VudCkgLyAyKSwgd2l0aAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgUk9VTkQgKHgpID0gZmxvb3IgKHggKyAwLjUpICAqLworICAgICAgICAgICAgICAg ICAgICAgICAgaWYgKHhfdXNlX3VuZGVybGluZV9wb3NpdGlvbl9wcm9wZXJ0aWVzCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgcy0+Zm9udCAmJiBzLT5mb250LT51bmRlcmxpbmVfcG9z aXRpb24gPj0gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBzLT5mb250 LT51bmRlcmxpbmVfcG9zaXRpb247CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChz LT5mb250KQorICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5mb250LT5k ZXNjZW50ICsgMSkgLyAyOworICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAg ICAgIHBvc2l0aW9uID0gbWF4IChwb3NpdGlvbiwgdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0KTsK KyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIC8qIENoZWNrIHRoZSBzYW5pdHkgb2Yg dGhpY2tuZXNzIGFuZCBwb3NpdGlvbi4gIFdlIHNob3VsZAorICAgICAgICAgICAgICAgICBhdm9p ZCBkcmF3aW5nIHVuZGVybGluZSBvdXQgb2YgdGhlIGN1cnJlbnQgbGluZSBhcmVhLiAqLworICAg ICAgICAgICAgICBpZiAocy0+eSArIHMtPmhlaWdodCA8PSBzLT55YmFzZSArIHBvc2l0aW9uKQor ICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmhlaWdodCAtIDEpIC0gKHMtPnliYXNlIC0g cy0+eSk7CisgICAgICAgICAgICAgIGlmIChzLT55ICsgcy0+aGVpZ2h0IDwgcy0+eWJhc2UgKyBw b3NpdGlvbiArIHRoaWNrbmVzcykKKyAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAocy0+eSAr IHMtPmhlaWdodCkgLSAocy0+eWJhc2UgKyBwb3NpdGlvbik7CisgICAgICAgICAgICAgIHMtPnVu ZGVybGluZV90aGlja25lc3MgPSB0aGlja25lc3M7CisgICAgICAgICAgICAgIHMtPnVuZGVybGlu ZV9wb3NpdGlvbiA9cG9zaXRpb247CisgICAgICAgICAgICAgIHkgPSBzLT55YmFzZSArIHBvc2l0 aW9uOworICAgICAgICAgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX2RlZmF1bHRlZF9wKQor ICAgICAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+Z2MtPmZvcmVn cm91bmQsIHMtPngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeSwgcy0+d2lkdGgs IDEpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIHczMl9maWxsX2Fy ZWEgKHMtPmYsIHMtPmhkYywgcy0+ZmFjZS0+dW5kZXJsaW5lX2NvbG9yLCBzLT54LAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgeSwgcy0+d2lkdGgsIDEpOworICAgICAgICAgICAg fQorICAgICAgICB9CisgICAgICAvKiBEcmF3IG92ZXJsaW5lLiAqLworICAgICAgaWYgKHMtPmZh Y2UtPm92ZXJsaW5lX3ApCisgICAgICAgIHsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIGR5ID0g MCwgaCA9IDE7CisgICAgICAgICAgaWYgKHMtPmZhY2UtPm92ZXJsaW5lX2NvbG9yX2RlZmF1bHRl ZF9wKQorICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5nYy0+Zm9y ZWdyb3VuZCwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPnkgKyBkeSwgcy0+ d2lkdGgsIGgpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICB3MzJfZmlsbF9hcmVh IChzLT5mLCBzLT5oZGMsIHMtPmZhY2UtPm92ZXJsaW5lX2NvbG9yLCBzLT54LAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBzLT55ICsgZHksIHMtPndpZHRoLCBoKTsKKyAgICAgICAgfQor ICAgICAgLyogRHJhdyBzdHJpa2UtdGhyb3VnaC4gKi8KKyAgICAgIGlmIChzLT5mYWNlLT5zdHJp a2VfdGhyb3VnaF9wCisgICAgICAgICAgJiYgIUZPTlRfVEVYVE1FVFJJQyAocy0+Zm9udCkudG1T dHJ1Y2tPdXQpCisgICAgICAgIHsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIGggPSAxOworICAg ICAgICAgIHVuc2lnbmVkIGxvbmcgZHkgPSAocy0+aGVpZ2h0IC0gaCkgLyAyOworICAgICAgICAg IGlmIChzLT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9jb2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAgICAg ICAgIHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+Z2MtPmZvcmVncm91bmQsIHMtPngs IHMtPnkgKyBkeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPndpZHRoLCBoKTsKKyAg ICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRj LCBzLT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9jb2xvciwgcy0+eCwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgcy0+eSArIGR5LCBzLT53aWR0aCwgaCk7CisgICAgICAgIH0KKyAgICAgIC8q IERyYXcgcmVsaWVmIGlmIG5vdCB5ZXQgZHJhd24uICovCisgICAgICBpZiAoIXJlbGllZl9kcmF3 bl9wICYmIHMtPmZhY2UtPmJveCAhPSBGQUNFX05PX0JPWCkKKyAgICAgICAgdzMyX2RyYXdfZ2x5 cGhfc3RyaW5nX2JveCAocyk7CisgICAgICBpZiAocy0+cHJldikKKyAgICAgICAgeworICAgICAg ICAgIHN0cnVjdCBnbHlwaF9zdHJpbmcgKnByZXY7CisgICAgICAgICAgZm9yIChwcmV2ID0gcy0+ cHJldjsgcHJldjsgcHJldiA9IHByZXYtPnByZXYpCisgICAgICAgICAgICBpZiAocHJldi0+aGwg IT0gcy0+aGwKKyAgICAgICAgICAgICAgICAmJiBwcmV2LT54ICsgcHJldi0+d2lkdGggKyBwcmV2 LT5yaWdodF9vdmVyaGFuZyA+IHMtPngpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg ICAvKiBBcyBwcmV2IHdhcyBkcmF3biB3aGlsZSBjbGlwcGVkIHRvIGl0cyBvd24gYXJlYSwgd2UK KyAgICAgICAgICAgICAgICAgICBtdXN0IGRyYXcgdGhlIHJpZ2h0X292ZXJoYW5nIHBhcnQgdXNp bmcgcy0+aGwgbm93LiAqLworICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBz YXZlID0gcHJldi0+aGw7CisgICAgICAgICAgICAgICAgcHJldi0+aGwgPSBzLT5obDsKKyAgICAg ICAgICAgICAgICBtY193MzJfc2V0X2dseXBoX3N0cmluZ19nYyAocHJldiwgY3Vyc29yX2djX3Ap OworICAgICAgICAgICAgICAgIHczMl9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nX2V4YWN0bHkg KHMsIHByZXYpOworICAgICAgICAgICAgICAgIGlmIChwcmV2LT5maXJzdF9nbHlwaC0+dHlwZSA9 PSBDSEFSX0dMWVBIKQorICAgICAgICAgICAgICAgICAgdzMyX2RyYXdfZ2x5cGhfc3RyaW5nX2Zv cmVncm91bmQgKHByZXYpOworICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAg ICAgICB3MzJfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHByZXYpOwor ICAgICAgICAgICAgICAgIHczMl9zZXRfY2xpcF9yZWN0YW5nbGUgKHByZXYtPmhkYywgTlVMTCk7 CisgICAgICAgICAgICAgICAgcHJldi0+aGwgPSBzYXZlOworICAgICAgICAgICAgICAgIHByZXYt Pm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKHMt Pm5leHQpCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpuZXh0Owor ICAgICAgICAgIGZvciAobmV4dCA9IHMtPm5leHQ7IG5leHQ7IG5leHQgPSBuZXh0LT5uZXh0KQor ICAgICAgICAgICAgaWYgKG5leHQtPmhsICE9IHMtPmhsCisgICAgICAgICAgICAgICAgJiYgbmV4 dC0+eCAtIG5leHQtPmxlZnRfb3ZlcmhhbmcgPCBzLT54ICsgcy0+d2lkdGgpCisgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAvKiBBcyBuZXh0IHdpbGwgYmUgZHJhd24gd2hpbGUgY2xp cHBlZCB0byBpdHMgb3duIGFyZWEsCisgICAgICAgICAgICAgICAgICAgd2UgbXVzdCBkcmF3IHRo ZSBsZWZ0X292ZXJoYW5nIHBhcnQgdXNpbmcgcy0+aGwgbm93LiAqLworICAgICAgICAgICAgICAg IGVudW0gZHJhd19nbHlwaHNfZmFjZSBzYXZlID0gbmV4dC0+aGw7CisgICAgICAgICAgICAgICAg bmV4dC0+aGwgPSBzLT5obDsKKyAgICAgICAgICAgICAgICBtY193MzJfc2V0X2dseXBoX3N0cmlu Z19nYyAobmV4dCwgY3Vyc29yX2djX3ApOworICAgICAgICAgICAgICAgIHczMl9zZXRfZ2x5cGhf c3RyaW5nX2NsaXBwaW5nX2V4YWN0bHkgKHMsIG5leHQpOworICAgICAgICAgICAgICAgIGlmIChu ZXh0LT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBIKQorICAgICAgICAgICAgICAgICAg dzMyX2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5leHQpOworICAgICAgICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB3MzJfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3Ry aW5nX2ZvcmVncm91bmQgKG5leHQpOworICAgICAgICAgICAgICAgIHczMl9zZXRfY2xpcF9yZWN0 YW5nbGUgKG5leHQtPmhkYywgTlVMTCk7CisgICAgICAgICAgICAgICAgbmV4dC0+aGwgPSBzYXZl OworICAgICAgICAgICAgICAgIG5leHQtPm51bV9jbGlwcyA9IDA7CisgICAgICAgICAgICAgICAg bmV4dC0+Y2xpcF9oZWFkID0gcy0+bmV4dDsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9Cisg ICAgfQorICAvKiBSZXNldCBjbGlwcGluZy4gKi8KKyAgdzMyX3NldF9jbGlwX3JlY3RhbmdsZSAo cy0+aGRjLCBOVUxMKTsKKyAgcy0+bnVtX2NsaXBzID0gMDsKK30KKworLyogZW5kIE1VTFRJUExF LUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC8qIEZyaW5nZSBiaXRt YXBzLiAgKi8KIAogc3RhdGljIGludCBtYXhfZnJpbmdlX2JtcCA9IDA7CkBAIC01NDIsNiArMTcw NCwxNSBAQCB3MzJfdXBkYXRlX2JlZ2luIChzdHJ1Y3QgZnJhbWUgKmYpCiAgIGlmICghIEZSQU1F X1czMl9QIChmKSkKICAgICByZXR1cm47CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisv KiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBmOworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIFJlZ2VuZXJhdGUgZGlzcGxheSBwYWxl dHRlIGJlZm9yZSBkcmF3aW5nIGlmIGxpc3Qgb2YgcmVxdWVzdGVkCiAgICAgIGNvbG9ycyBoYXMg Y2hhbmdlZC4gKi8KICAgaWYgKGRpc3BsYXlfaW5mby0+cmVnZW5fcGFsZXR0ZSkKQEAgLTY3NCw2 ICsxODQ1LDE2IEBAIHczMl91cGRhdGVfZW5kIChzdHJ1Y3QgZnJhbWUgKmYpCiAKICAgLyogTW91 c2UgaGlnaGxpZ2h0IG1heSBiZSBkaXNwbGF5ZWQgYWdhaW4uICAqLwogICBNT1VTRV9ITF9JTkZP IChmKS0+bW91c2VfZmFjZV9kZWZlciA9IGZhbHNlOworCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0g TlVMTDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAKQEAgLTQwMDIsMTMg KzUxODMsNzQgQEAgdzMyX3NldF92ZXJ0aWNhbF9zY3JvbGxfYmFyIChzdHJ1Y3Qgd2luZG93ICp3 LAogCSAgICAgIHJlbGVhc2VfZnJhbWVfZGMgKGYsIGhkYyk7CiAJICA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CAoaGVpZ2h0LCAxKSwKLSAgICAgICAgICAg ICAgICAgICAgICAgIFNXUF9GUkFNRUNIQU5HRUQpOworICAgICAgICAgIGlmIChsZWZ0IDw9IGJh ci0+bGVmdCkKKyAgICAgICAgICAgIG15X3Nob3dfd2luZG93IChmLCBod25kLCBTV19ISURFKTsK KyAgICAgICAgICBNb3ZlV2luZG93IChod25kLCBsZWZ0LCB0b3AsIHdpZHRoLCBtYXggKGhlaWdo dCwgMSksIGxlZnQgPD0gYmFyLT5sZWZ0KTsKKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8K Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCiAKIAkgIHNpLmNiU2l6ZSA9IHNpemVvZiAoc2kp OwogCSAgc2kuZk1hc2sgPSBTSUZfUkFOR0U7CkBAIC00Mjc3LDYgKzU1MTksMjEgQEAgdzMyX2p1 ZGdlX3Njcm9sbF9iYXJzIChzdHJ1Y3QgZnJhbWUgKmYpCiAgICAgewogICAgICAgc3RydWN0IHNj cm9sbF9iYXIgKmIgPSBYU0NST0xMX0JBUiAoYmFyKTsKIAorCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgLyogYERlc3Ryb3lXaW5kb3cn IHdpdGhpbiBgeF9zY3JvbGxfYmFyX3JlbW92ZScgcmVwYWludHMgdGhlIHJlY3RhbmdsZS4KKyAg ICAgIFRoZXJlZm9yZSwgd2UgZmlyc3Qgc2VuZCBhIG1lc3NhZ2UgdG8gaW5oaWJpdCByZXBhaW50 aW5nLiAqLworICAgICAgaWYgKCFXSU5ET1dfTElWRV9QIChiLT53aW5kb3cpKQorICAgICAgICB7 CisgICAgICAgICAgSFdORCBod25kID0gU0NST0xMX0JBUl9XMzJfV0lORE9XIChiKTsKKyAgICAg ICAgICBTZW5kTWVzc2FnZSAoaHduZCwgV01fU0VUUkVEUkFXLCBmYWxzZSwgMCk7CisgICAgICAg IH0KKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgdzMyX3Njcm9sbF9iYXJf cmVtb3ZlIChiKTsKIAogICAgICAgbmV4dCA9IGItPm5leHQ7CkBAIC03MDg4LDYgKzgzNDUsMjAg QEAgZXh0ZXJuIGZyYW1lX3Bhcm1faGFuZGxlciB3MzJfZnJhbWVfcGFybV9oYW5kbGVyc1tdOwog CiBzdGF0aWMgc3RydWN0IHJlZGlzcGxheV9pbnRlcmZhY2UgdzMyX3JlZGlzcGxheV9pbnRlcmZh Y2UgPQogeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09S UyAqLworCisvKiBgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYHczMnRlcm0uY2AgbXVzdCBiZSBp biB0aGUgZXhhY3Qgc2FtZSBvcmRlciBhcyB0aGUKK2ByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBg ZGlzcGV4dGVybi5oYCEgKi8KKworICBtY193MzJfZHJhd193aW5kb3dfY3Vyc29yLAorICBtY193 MzJfZHJhd19nbHlwaF9zdHJpbmcsCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAg dzMyX2ZyYW1lX3Bhcm1faGFuZGxlcnMsCiAgIGd1aV9wcm9kdWNlX2dseXBocywKICAgZ3VpX3dy aXRlX2dseXBocywKZGlmZiAtLWdpdCBhL3NyYy93aW5kb3cuaCBiL3NyYy93aW5kb3c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Gg7CisgICAgICBpbnQgeDsKKyAgICAgIGludCBmeDsKKyAg ICAgIGludCB5OworICAgICAgaW50IGZ5OworICAgICAgaW50IGhwb3M7CisgICAgICBpbnQgdnBv czsKKyAgICAgIGludCB3ZDsKKyAgICAgIGludCBoOworICAgICAgZW51bSBtY19jdXJzb3JfdHlw ZQorICAgICAgeworICAgICAgICAvKiBOT1RFOiAgVGhlIGZyaW5nZSBiaXRtYXAgZnJhbWV3b3Jr IHJlbGllcyB1cG9uIE1DX05PX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgaGF2aW5nIGEgdmFsdWUg b2YgemVybyAoMCkuICovCisgICAgICAgIE1DX05PX0ZSSU5HRV9CSVRNQVAsCisgICAgICAgIE1D X05PX0NVUlNPUiwKKyAgICAgICAgTUNfUklHSFRfRlJJTkdFX0JJVE1BUCwKKyAgICAgICAgTUNf TEVGVF9GUklOR0VfQklUTUFQLAorICAgICAgICBNQ19GUkFNRURfQk9YLAorICAgICAgICBNQ19G SUxMRURfQk9YLAorICAgICAgICBNQ19IT0xMT1dfQk9YLAorICAgICAgICBNQ19CQVIsCisgICAg ICAgIE1DX0hCQVIKKyAgICAgIH0gY3Vyc29yX3R5cGU7CisgICAgICBpbnQgY3Vyc29yX3dpZHRo OworICAgICAgc3RydWN0IG1jX1JHQgorICAgICAgeworICAgICAgICBkb3VibGUgcmVkOworICAg ICAgICBkb3VibGUgZ3JlZW47CisgICAgICAgIGRvdWJsZSBibHVlOworICAgICAgfSBmZywgYmc7 CisgICAgICBib29sX2JmIGFjdGl2ZV9wIDogMTsKKyAgICAgIGVudW0gbWNfZmxhdm9yCisgICAg ICB7CisgICAgICAgIE5PX0ZMQVZPUiwKKyAgICAgICAgTUNfR0xZUEgsCisgICAgICAgIE1DX0dM WVBITEVTUywKKyAgICAgICAgTUNfT1ZFUkxBWV9BUlJPV19CSVRNQVAsCisgICAgICAgIE1DX1BJ TENST1csCisgICAgICAgIE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1csCisgICAgICAg IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1csCisgICAgICAgIE1DX0hP TExPV19SRUNUQU5HTEUsCisgICAgICAgIE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVywKKyAg ICAgICAgTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XLAorICAgICAgICBNQ19W RVJUSUNBTF9CQVIsCisgICAgICAgIE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUiwKKyAgICAgICAg TUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgfSBnbHlwaF9mbGF2b3I7CisgICAgICBl bnVtIG1jX3Jvd19wb3NpdGlvbgorICAgICAgeworICAgICAgICBQUkVfWlYsCisgICAgICAgIEFU X1pWLAorICAgICAgICBQT1NUX1pWCisgICAgICB9IHJvd19wb3NpdGlvbjsKKyAgICAgIGJvb2xf YmYgZW5hYmxlZF9wIDogMTsKKyAgICB9ICpjYWNoZVs0XTsKKyAgfSAqdnBvczsKKyAgLyogVXNl ZCBlbHNld2hlcmUuICovCisgIHN0cnVjdCBtY19lc3NlbnRpYWxzCisgIHsKKyAgICBib29sX2Jm IGFjdGl2ZV9wIDogMTsKKyAgICBzdHJ1Y3QgbWNfUkdCIGNoX2ZnWzNdLCBmY19mZ1szXSwgc3Bf Zmc7CisgICAgaW50IGZjX3g7CisgICAgaW50IHp2OworICAgIGludCB6dl9ieXRlOworICB9IGVz c2VudGlhbHM7CisgIC8qIFVzZWQgZWxzZXdoZXJlLiAqLworICBlbnVtIG1jX2VuZ2luZV90eXBl CisgIHsKKyAgICBNVUxUSVBMRV9DVVJTT1JTLAorICAgIEhPUklaT05UQUxfUlVMRVIsCisgICAg VkVSVElDQUxfUlVMRVIsCisgICAgRklMTF9DT0xVTU4sCisgICAgQ1VSU09SX0lORElDQVRPUgor ICB9IGFjdGlvbl90eXBlOworICAvKiBVc2VkIGVsc2V3aGVyZS4gKi8KKyAgZW51bSBtY19wcmVf c2Nyb2xsX2NsZWFuX3R5cGUKKyAgeworICAgIFRSWV9XSU5ET1dfUkVVU0lOR19DVVJSRU5UX01B VFJJWF9ET1dOLAorICAgIFRSWV9XSU5ET1dfUkVVU0lOR19DVVJSRU5UX01BVFJJWF9VUCwKKyAg ICBUUllfV0lORE9XX0lECisgIH0gbWNfcHJlX3Njcm9sbF9jbGVhbl90eXBlX19mcm9tX3doZXJl OworICAvKiBVc2VkIGVsc2V3aGVyZS4gKi8KKyAgZW51bSBtY19kcmF3X3Jvd190eXBlCisgIHsK KyAgICBOT1dIRVJFLAorICAgIFNDUklCRV9PTkUsCisgICAgU0NSSUJFX1RXTywKKyAgICBTQ1JJ QkVfVEhSRUUsCisgICAgU0tJUFBFRCwKKyAgICBQT1NUX0NIQU5HRUQsCisgICAgVU5DSEFOR0VE LAorICAgIFNFVF9DVVJTT1JfT05FLAorICAgIFNFVF9DVVJTT1JfVFdPCisgIH0gbWNfZHJhd19y b3dfdHlwZV9fZnJvbV93aGVyZTsKKyAgLyogVXNlZCBlbHNld2hlcmUuICovCisgIGVudW0gbWNf cmVkcmF3X3Jvd190eXBlCisgIHsKKyAgICBVUERBVEVfV0lORE9XX19SRURSQVdfT1ZFUkxBUFBF RF9ST1dTLAorICAgIEdVSV9JTlNFUlRfR0xZUEhTLAorICAgIEdVSV9GSVhfT1ZFUkxBUFBJTkdf QVJFQSwKKyAgICBEUkFXX1JPV19XSVRIX01PVVNFX0ZBQ0UsCisgICAgRVhQT1NFX0FSRUFfT05F LAorICAgIEVYUE9TRV9BUkVBX1RXTywKKyAgICBFWFBPU0VfTElORQorICB9IG1jX3JlZHJhd19y b3dfdHlwZV9fZnJvbV93aGVyZTsKK30gbWNfbWF0cml4OworCisvKiBlbmQgTVVMVElQTEUtQ1VS U09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKio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BITCwgWCwgTEFTVF9YKTsJ CVwKKwkgICAgICBicmVhazsJCQkJCQkJXAorCQkJCQkJCQkJXAorCSAgICBjYXNlIFNUUkVUQ0hf R0xZUEg6CQkJCQkJXAorCSAgICAgIE1DX0JVSUxEX1NUUkVUQ0hfR0xZUEhfU1RSSU5HIChTVEFS VCwgRU5ELCBIRUFELCBUQUlMLAlcCisJCQkJCSAgSEwsIFgsIExBU1RfWCk7CQlcCisJICAgICAg YnJlYWs7CQkJCQkJCVwKKwkJCQkJCQkJCVwKKwkgICAgY2FzZSBJTUFHRV9HTFlQSDoJCQkJCQlc CisJICAgICAgTUNfQlVJTERfSU1BR0VfR0xZUEhfU1RSSU5HIChTVEFSVCwgRU5ELCBIRUFELCBU QUlMLAkJXAorCQkJCQlITCwgWCwgTEFTVF9YKTsJCQlcCisJICAgICAgYnJlYWs7CisKKyNkZWZp bmUgTUNfQlVJTERfR0xZUEhfU1RSSU5HU19YVyhTVEFSVCwgRU5ELCBIRUFELCBUQUlMLCBITCwg WCwgTEFTVF9YKQlcCisgICAgICAgICAgICBjYXNlIFhXSURHRVRfR0xZUEg6ICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgIE1DX0JVSUxEX1hX SURHRVRfR0xZUEhfU1RSSU5HIChTVEFSVCwgRU5ELCBIRUFELCBUQUlMLCAgICAgICBcCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBITCwgWCwgTEFTVF9YKTsgICAg ICAgICAgICAgICBcCisgICAgICAgICAgICAgIGJyZWFrOworCisjZGVmaW5lIE1DX0JVSUxEX0dM WVBIX1NUUklOR1NfMihTVEFSVCwgRU5ELCBIRUFELCBUQUlMLCBITCwgWCwgTEFTVF9YKQlcCisJ ICAgIGNhc2UgR0xZUEhMRVNTX0dMWVBIOgkJCQkJXAorCSAgICAgIE1DX0JVSUxEX0dMWVBITEVT U19HTFlQSF9TVFJJTkcgKFNUQVJULCBFT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HZhX2xp c3QgYXA7CisgIHZhX3N0YXJ0IChhcCwgYXJnKTsKKyAgZm9yIChwdHJkaWZmX3QgaSA9IDE7IGkg PCBjb3VudDsgaSsrKQorICAgIHsKKyAgICAgIExpc3BfT2JqZWN0IGVsZW0gPSBGY29ucyAodmFf YXJnIChhcCwgTGlzcF9PYmplY3QpLCBRbmlsKTsKKyAgICAgIFhTRVRDRFIgKHRhaWwsIGVsZW0p OworICAgICAgdGFpbCA9IGVsZW07CisgICAgfQorICB2YV9lbmQgKGFwKTsKKyAgcmV0dXJuIHZh bDsKK30KKworTGlzcF9PYmplY3QKK21jX21lbXEgKExpc3BfT2JqZWN0IGVsdCwgTGlzcF9PYmpl Y3QgbGlzdCkKK3sKKyAgd2hpbGUgKDEpCisgICAgeworICAgICAgaWYgKCFDT05TUCAobGlzdCkg fHwgRVEgKFhDQVIgKGxpc3QpLCBlbHQpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBY Q0RSIChsaXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpIHx8IEVRIChYQ0FSIChsaXN0KSwg ZWx0KSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBp ZiAoIUNPTlNQIChsaXN0KSB8fCBFUSAoWENBUiAobGlzdCksIGVsdCkpCisgICAgICAgIGJyZWFr OworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgIH0KKyAgcmV0dXJuIGxpc3Q7Cit9CisK K0xpc3BfT2JqZWN0CittY19udGggKGludCBudW0sIExpc3BfT2JqZWN0IGxpc3QpCit7CisgIGZv ciAoaW50IGkgPSAwOyBpIDwgbnVtICYmICFOSUxQIChsaXN0KTsgaSsrKQorICAgIGxpc3QgPSBY Q0RSIChsaXN0KTsKKyAgaWYgKENPTlNQIChsaXN0KSkKKyAgICByZXR1cm4gWENBUiAobGlzdCk7 CisgICAgZWxzZQorICAgICAgcmV0dXJuIFFuaWw7Cit9CisKK0xpc3BfT2JqZWN0CittY19hc3Nx IChMaXNwX09iamVjdCBrZXksIExpc3BfT2JqZWN0IGxpc3QpCit7CisgIHdoaWxlICgxKQorICAg IHsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAgfHwgKENPTlNQIChYQ0FSIChs aXN0KSkKKyAgICAgICAgICAgICAgJiYgRVEgKFhDQVIgKFhDQVIgKGxpc3QpKSwga2V5KSkpCisg ICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05T UCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAgICAg ICAmJiBFUSAoWENBUiAoWENBUiAobGlzdCkpLCBrZXkpKSkKKyAgICAgICAgYnJlYWs7CisgICAg ICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KQorICAgICAgICAg IHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAgICYmIEVRIChYQ0FSIChYQ0FS IChsaXN0KSksIGtleSkpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0 KTsKKyAgICB9CisgIGlmIChDT05TUCAobGlzdCkpCisgICAgcmV0dXJuIFhDQVIgKGxpc3QpOwor ICAgIGVsc2UKKyAgICAgIHJldHVybiBRbmlsOworfQorCitMaXNwX09iamVjdAorbWNfYXNzb2Mg KExpc3BfT2JqZWN0IGtleSwgTGlzcF9PYmplY3QgbGlzdCkKK3sKKyAgTGlzcF9PYmplY3QgY2Fy OworICB3aGlsZSAoMSkKKyAgICB7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KQorICAgICAgICAg IHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAgICYmIChjYXIgPSBYQ0FSIChY Q0FSIChsaXN0KSksCisgICAgICAgICAgICAgICAgICBFUSAoY2FyLCBrZXkpIHx8ICFOSUxQIChG ZXF1YWwgKGNhciwga2V5KSkpKSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAo bGlzdCk7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENB UiAobGlzdCkpCisgICAgICAgICAgICAgICYmIChjYXIgPSBYQ0FSIChYQ0FSIChsaXN0KSksCisg ICAgICAgICAgICAgICAgICBFUSAoY2FyLCBrZXkpIHx8ICFOSUxQIChGZXF1YWwgKGNhciwga2V5 KSkpKSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBp ZiAoIUNPTlNQIChsaXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAg ICAgICAgICAgICYmIChjYXIgPSBYQ0FSIChYQ0FSIChsaXN0KSksCisgICAgICAgICAgICAgICAg ICBFUSAoY2FyLCBrZXkpIHx8ICFOSUxQIChGZXF1YWwgKGNhciwga2V5KSkpKSkKKyAgICAgICAg YnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgfQorICBpZiAoQ09OU1AgKGxp c3QpKQorICAgIHJldHVybiBYQ0FSIChsaXN0KTsKKyAgICBlbHNlCisgICAgICByZXR1cm4gUW5p bDsKK30KKworTGlzcF9PYmplY3QKK21jX3BsaXN0X2dldCAoTGlzcF9PYmplY3QgcGxpc3QsIExp c3BfT2JqZWN0IHByb3ApCit7CisgIExpc3BfT2JqZWN0IHRhaWwsIGhhbGZ0YWlsOworICAvKiBo YWxmdGFpbCBpcyB1c2VkIHRvIGRldGVjdCBjaXJjdWxhciBsaXN0cy4gICovCisgIHRhaWwgPSBo YWxmdGFpbCA9IHBsaXN0OworICB3aGlsZSAoQ09OU1AgKHRhaWwpICYmIENPTlNQIChYQ0RSICh0 YWlsKSkpCisgICAgeworICAgICAgaWYgKEVRIChwcm9wLCBYQ0FSICh0YWlsKSkpCisgICAgICAg IHJldHVybiBYQ0FSIChYQ0RSICh0YWlsKSk7CisgICAgICB0YWlsID0gWENEUiAoWENEUiAodGFp bCkpOworICAgICAgaGFsZnRhaWwgPSBYQ0RSIChoYWxmdGFpbCk7CisgICAgICBpZiAoRVEgKHRh aWwsIGhhbGZ0YWlsKSkKKyAgICAgICAgYnJlYWs7CisgICAgfQorICByZXR1cm4gUW5pbDsKK30K KworLyogUkVHSU9OIEJFR0lOOiAgbWNfcmVnaW9uX2xpbWl0ICgxKQorICAgUkVHSU9OIEVORDog IG1jX3JlZ2lvbl9saW1pdCAoMCkgKi8KK3B0cmRpZmZfdAorbWNfcmVnaW9uX2xpbWl0IChib29s IGJlZ2luX3ApCit7CisgIGlmICghTklMUCAoVnRyYW5zaWVudF9tYXJrX21vZGUpCisgICAgICAm JiBOSUxQIChWbWFya19ldmVuX2lmX2luYWN0aXZlKQorICAgICAgJiYgTklMUCAoQlZBUiAoY3Vy cmVudF9idWZmZXIsIG1hcmtfYWN0aXZlKSkpCisgICAgeHNpZ25hbDAgKFFtYXJrX2luYWN0aXZl KTsKKyAgTGlzcF9PYmplY3QgbWFya2VyID0gQlZBUiAoY3VycmVudF9idWZmZXIsIG1hcmspOwor ICBpbnQgbSA9IChYTUFSS0VSIChtYXJrZXIpLT5idWZmZXIpCisgICAgICAgICAgPyBYTUFSS0VS IChtYXJrZXIpLT5jaGFycG9zCisgICAgICAgICAgOiAtMTsKKyAgcmV0dXJuIChtID09IC0xKQor ICAgICAgICAgICA/IC0xCisgICAgICAgICA6IChQVCA8IG0pID09IGJlZ2luX3AKKyAgICAgICAg ICAgPyBQVAorICAgICAgICAgOiBjbGlwX3RvX2JvdW5kcyAoQkVHViwgbSwgWlYpOworfQorCisv KiBDaGVjayB0aGUgcHJlc2VuY2Ugb2YgYSBkaXNwbGF5IHByb3BlcnR5IGFuZCBjb21wdXRlIGl0 cyB3aWR0aC4KKyAgIElmIGEgcHJvcGVydHkgd2FzIGZvdW5kIGFuZCBpdHMgd2lkdGggd2FzIGZv dW5kIGFzIHdlbGwsIHJldHVybgorICAgaXRzIHdpZHRoICg+PSAwKSBhbmQgc2V0IHRoZSBwb3Np dGlvbiBvZiB0aGUgZW5kIG9mIHRoZSBwcm9wZXJ0eQorICAgaW4gRU5EUE9TLgorICAgT3RoZXJ3 aXNlIGp1c3QgcmV0dXJuIC0xLiAqLworc3RhdGljIGludAorbWNfY2hlY2tfZGlzcGxheV93aWR0 aCAocHRyZGlmZl90IHBvcywgcHRyZGlmZl90IGNvbCwgcHRyZGlmZl90ICplbmRwb3MpCit7Cisg IExpc3BfT2JqZWN0IHZhbCwgb3ZlcmxheTsKKyAgaWYgKENPTlNQICh2YWwgPSBnZXRfY2hhcl9w cm9wZXJ0eV9hbmRfb3ZlcmxheQorICAgICAgICAgICAgICAobWFrZV9maXhudW0gKHBvcyksIFFk aXNwbGF5LCBRbmlsLCAmb3ZlcmxheSkpCisgICAgICAmJiBFUSAoUXNwYWNlLCBYQ0FSICh2YWwp KSkKKyAgICB7IC8qIEZJWE1FOiBVc2UgY2FsY19waXhlbF93aWR0aF9vcl9oZWlnaHQuICovCisg ICAgICBMaXNwX09iamVjdCBwbGlzdCA9IFhDRFIgKHZhbCksIHByb3A7CisgICAgICBpbnQgd2lk dGggPSAtMTsKKyAgICAgIEVNQUNTX0lOVCBhbGlnbl90b19tYXggPSAoY29sIDwgTU9TVF9QT1NJ VElWRV9GSVhOVU0gLSBJTlRfTUFYCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IChFTUFDU19JTlQpIElOVF9NQVggKyBjb2wKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogTU9TVF9QT1NJVElWRV9GSVhOVU0pOworICAgICAgaWYgKChwcm9wID0gbWNfcGxpc3Rf Z2V0IChwbGlzdCwgUUN3aWR0aCksIFJBTkdFRF9GSVhOVU1QICgwLCBwcm9wLCBJTlRfTUFYKSkK KyAgICAgICAgICB8fCAocHJvcCA9IG1jX3BsaXN0X2dldCAocGxpc3QsIFFDcmVsYXRpdmVfd2lk dGgpLAorICAgICAgICAgICAgICBSQU5HRURfRklYTlVNUCAoMCwgcHJvcCwgSU5UX01BWCkpKQor ICAgICAgICB3aWR0aCA9IFhGSVhOVU0gKHByb3ApOworICAgICAgICBlbHNlIGlmIChGTE9BVFAg KHByb3ApICYmIDAgPD0gWEZMT0FUX0RBVEEgKHByb3ApCisgICAgICAgICAgICAgICAgICYmIFhG TE9BVF9EQVRBIChwcm9wKSA8PSBJTlRfTUFYKQorICAgICAgICAgIHdpZHRoID0gKGludCkoWEZM T0FUX0RBVEEgKHByb3ApICsgMC41KTsKKyAgICAgICAgICBlbHNlIGlmICgocHJvcCA9IG1jX3Bs aXN0X2dldCAocGxpc3QsIFFDYWxpZ25fdG8pLAorICAgICAgICAgICAgICAgICAgICBSQU5HRURf RklYTlVNUCAoY29sLCBwcm9wLCBhbGlnbl90b19tYXgpKSkKKyAgICAgICAgICAgIHdpZHRoID0g WEZJWE5VTSAocHJvcCkgLSBjb2w7CisgICAgICAgICAgICAgIGVsc2UgaWYgKEZMT0FUUCAocHJv cCkgJiYgY29sIDw9IFhGTE9BVF9EQVRBIChwcm9wKQorICAgICAgICAgICAgICAgICAgICAgICAm JiAoWEZMT0FUX0RBVEEgKHByb3ApIDw9IGFsaWduX3RvX21heCkpCisgICAgICAgICAgICAgICAg d2lkdGggPSAoaW50KShYRkxPQVRfREFUQSAocHJvcCkgKyAwLjUpIC0gY29sOworICAgICAgaWYg KHdpZHRoID49IDApCisgICAgICAgIHsKKyAgICAgICAgICBwdHJkaWZmX3Qgc3RhcnQ7CisgICAg ICAgICAgaWYgKE9WRVJMQVlQIChvdmVybGF5KSkKKyAgICAgICAgICAgICplbmRwb3MgPSBPVkVS TEFZX1BPU0lUSU9OIChPVkVSTEFZX0VORCAob3ZlcmxheSkpOworICAgICAgICAgICAgZWxzZQor ICAgICAgICAgICAgICBnZXRfcHJvcGVydHlfYW5kX3JhbmdlIChwb3MsIFFkaXNwbGF5LCAmdmFs LCAmc3RhcnQsIGVuZHBvcywgUW5pbCk7CisgICAgICAgICAgLyogRm9yIDpyZWxhdGl2ZS13aWR0 aCwgd2UgbmVlZCB0byBtdWx0aXBseSBieSB0aGUgY29sdW1uCisgICAgICAgICAgICAgd2lkdGgg b2YgdGhlIGNoYXJhY3RlciBhdCBQT1MsIGlmIGl0IGlzIGdyZWF0ZXIgdGhhbiAxLiAqLworICAg ICAgICAgIGlmICghTklMUCAobWNfcGxpc3RfZ2V0IChwbGlzdCwgUUNyZWxhdGl2ZV93aWR0aCkp CisgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChjdXJyZW50X2J1ZmZlciwgZW5hYmxlX211 bHRpYnl0ZV9jaGFyYWN0ZXJzKSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGludCBi LCB3ZDsKKyAgICAgICAgICAgICAgdW5zaWduZWQgY2hhciAqcCA9IEJZVEVfUE9TX0FERFIgKENI QVJfVE9fQllURSAocG9zKSk7CisgICAgICAgICAgICAgIE1DX01VTFRJQllURV9CWVRFU19XSURU SCAocCwgYnVmZmVyX2Rpc3BsYXlfdGFibGUgKCksIGIsIHdkKTsKKyAgICAgICAgICAgICAgd2lk dGggKj0gd2Q7CisgICAgICAgICAgICB9CisgICAgICAgICAgcmV0dXJuIHdpZHRoOworICAgICAg ICB9CisgICAgfQorICByZXR1cm4gLTE7Cit9CisKKy8qIFRyeSB0byBjb21wb3NlIHRoZSBjaGFy YWN0ZXJzIGF0IENIQVJQT1MgYWNjb3JkaW5nIHRvIGNvbXBvc2l0aW9uCisgICBydWxlIFJVTEUg KFtQQVRURVJOIFBSRVYtQ0hBUlMgRlVOQ10pLiAgTElNSVQgbGltaXRzIHRoZSBjaGFyYWN0ZXJz CisgICB0byBjb21wb3NlLiAgU1RSSU5HLCBpZiBub3QgbmlsLCBpcyBhIHRhcmdldCBzdHJpbmcu ICBXSU4gaXMgYQorICAgd2luZG93IHdoZXJlIHRoZSBjaGFyY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ZXBvcywgbGltaXQsIC0xLCBzdHJpbmcpKQorICAgICAgICAgICA+IDApCisgICAgeworICAgICAg aWYgKE5JTFAgKHN0cmluZykpCisgICAgICAgIGxlbiA9IEJZVEVfVE9fQ0hBUiAoYnl0ZXBvcyAr IGxlbikgLSBjaGFycG9zOworICAgICAgZWxzZQorICAgICAgICBsZW4gPSBzdHJpbmdfYnl0ZV90 b19jaGFyIChzdHJpbmcsIGJ5dGVwb3MgKyBsZW4pIC0gY2hhcnBvczsKKyAgICB9CisgIGlmIChs ZW4gPD0gMCkKKyAgICByZXR1cm4gdW5iaW5kX3RvIChjb3VudCwgUW5pbCk7CisgIHRvID0gbGlt aXQgPSBjaGFycG9zICsgbGVuOworI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQorICBpZiAoRlJB TUVfV0lORE9XX1AgKGYpKQorICAgIHsKKyAgICAgIGZvbnRfb2JqZWN0ID0gZm9udF9yYW5nZSAo Y2hhcnBvcywgYnl0ZXBvcywgJnRvLCB3aW4sIGZhY2UsIHN0cmluZyk7CisgICAgICBpZiAoISBG T05UX09CSkVDVF9QIChmb250X29iamVjdCkKKyAgICAgICAgICB8fCAoISBOSUxQIChyZSkKKyAg ICAgICAgICAgICAgJiYgdG8gPCBsaW1pdAorICAgICAgICAgICAgICAmJiAoZmFzdF9sb29raW5n X2F0IChyZSwgY2hhcnBvcywgYnl0ZXBvcywgdG8sIC0xLCBzdHJpbmcpIDw9IDApKSkKKyAgICAg ICAgcmV0dXJuIHVuYmluZF90byAoY291bnQsIFFuaWwpOworICAgIH0KKyAgZWxzZQorI2VuZGlm ICAgICAgICAvKiBub3QgSEFWRV9XSU5ET1dfU1lTVEVNICovCisgICAgZm9udF9vYmplY3QgPSB3 aW4tPmZyYW1lOworICBsZ3N0cmluZyA9IEZjb21wb3NpdGlvbl9nZXRfZ3N0cmluZyAocG9zLCBt YWtlX2ZpeG51bSAodG8pLCBmb250X29iamVjdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICA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b2tpbmcgYXQgYSBzdGF0aWMgY29tcG9zaXRpb24uICAqLworICAgICAgcHRyZGlmZl90IHN0 YXJ0LCBlbmQ7CisgICAgICBMaXNwX09iamVjdCBwcm9wOworICAgICAgZmluZF9jb21wb3NpdGlv biAoY2hhcnBvcywgLTEsICZzdGFydCwgJmVuZCwgJnByb3AsIHN0cmluZyk7CisgICAgICBjbXBf aXQtPmlkID0gZ2V0X2NvbXBvc2l0aW9uX2lkIChjaGFycG9zLCBieXRlcG9zLCBlbmQgLSBzdGFy dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb3AsIHN0cmluZyk7 CisgICAgICBpZiAoY21wX2l0LT5pZCA8IDApCisgICAgICAgIGdvdG8gbm9fY29tcG9zaXRpb247 CisgICAgICBjbXBfaXQtPm5jaGFycyA9IGVuZCAtIHN0YXJ0OworICAgICAgY21wX2l0LT5uZ2x5 cGhzID0gY29tcG9zaXRpb25fdGFibGVbY21wX2l0LT5pZF0tPmdseXBoX2xlbjsKKyAgICB9Cisg IGVsc2UgaWYgKHcpCisgICAgeworICAgICAgTGlzcF9PYmplY3QgbGdzdHJpbmcgPSBRbmlsOwor ICAgICAgTGlzcF9PYmplY3QgdmFsLCBlbHQ7CisgICAgICBwdHJkaWZmX3QgaTsKKyAgICAgIHZh bCA9IENIQVJfVEFCTEVfUkVGIChWY29tcG9zaXRpb25fZnVuY3Rpb25fdGFibGUsIGNtcF9pdC0+ Y2gpOworICAgICAgZm9yIChpID0gMDsgaSA8IGNtcF9pdC0+cnVsZV9pZHg7IGkrKywgdmFsID0g WENEUiAodmFsKSk7CisgICAgICBpZiAoY2hhcnBvcyA8IGVuZHBvcykKKyAgICAgICAgeworICAg ICAgICAgIGZvciAoOyBDT05TUCAodmFsKTsgdmFsID0gWENEUiAodmFsKSkKKyAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgZWx0ID0gWENBUiAodmFsKTsKKyAgICAgICAgICAgICAgaWYgKCEg VkVDVE9SUCAoZWx0KSB8fCBBU0laRSAoZWx0KSAhPSAzCisgICAgICAgICAgICAgICAgICB8fCAh IElOVEVHRVJQIChBUkVGIChlbHQsIDEpKSkKKyAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAg ICAgICAgICAgICAgaWYgKFhGSVhOQVQgKEFSRUYgKGVsdCwgMSkpICE9IGNtcF9pdC0+bG9va2Jh Y2spCisgICAgICAgICAgICAgICAgZ290byBub19jb21wb3NpdGlvbjsKKyAgICAgICAgICAgICAg bGdzdHJpbmcgPSBtY19hdXRvY21wX2NoYXJzIChlbHQsIGNoYXJwb3MsIGJ5dGVwb3MsIGVuZHBv cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LCBmYWNlLCBzdHJp bmcpOworICAgICAgICAgICAgICBpZiAoY29tcG9zaXRpb25fZ3N0cmluZ19wIChsZ3N0cmluZykp CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGxnc3RyaW5nID0gUW5pbDsK KyAgICAgICAgICAgICAgLyogQ29tcG9zaXRpb24gZmFpbGVkIHBlcmhhcHMgYmVjYXVzZSB0aGUg Zm9udCBkb2Vzbid0CisgICAgICAgICAgICAgICAgIHN1cHBvcnQgc3VmZmljaWVudCByYW5nZSBv ZiBjaGFyYWN0ZXJzLiAgVHJ5IHRoZQorICAgICAgICAgICAgICAgICBvdGhlciBjb21wb3NpdGlv biBydWxlcyBpZiBhbnkuICAqLworICAgICAgICAgICAgfQorICAgICAgICAgIGNtcF9pdC0+cmV2 ZXJzZWRfcCA9IDA7CisgICAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAg IHB0cmRpZmZfdCBjcG9zID0gY2hhcnBvcywgYnBvcyA9IGJ5dGVwb3M7CisgICAgICAgICAgY21w X2l0LT5yZXZlcnNlZF9wID0gMTsKKyAgICAgICAgICBlbHQgPSBYQ0FSICh2YWwpOworICAgICAg ICAgIGlmIChjbXBfaXQtPmxvb2tiYWNrID4gMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgY3BvcyA9IGNoYXJwb3MgLSBjbXBfaXQtPmxvb2tiYWNrOworICAgICAgICAgICAgICBpZiAo U1RSSU5HUCAoc3RyaW5nKSkKKyAgICAgICAgICAgICAgICBicG9zID0gc3RyaW5nX2NoYXJfdG9f Ynl0ZSAoc3RyaW5nLCBjcG9zKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAg IGJwb3MgPSBDSEFSX1RPX0JZVEUgKGNwb3MpOworICAgICAgICAgICAgfQorICAgICAgICAgIGxn c3RyaW5nID0gbWNfYXV0b2NtcF9jaGFycyAoZWx0LCBjcG9zLCBicG9zLCBjaGFycG9zICsgMSwg dywgZmFjZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmluZyk7Cisg ICAgICAgICAgaWYgKCEgY29tcG9zaXRpb25fZ3N0cmluZ19wIChsZ3N0cmluZykKKyAgICAgICAg ICAgICAgfHwgY3BvcyArIExHU1RSSU5HX0NIQVJfTEVOIChsZ3N0cmluZykgLSAxICE9IGNoYXJw b3MpCisgICAgICAgICAgICAvKiBDb21wb3NpdGlvbiBmYWlsZWQgb3IgZGlkbid0IGNvdmVyIHRo ZSBjdXJyZW50CisgICAgICAgICAgICAgICBjaGFyYWN0ZXIuICAqLworICAgICAgICAgICAgZ290 byBub19jb21wb3NpdGlvbjsKKyAgICAgICAgfQorICAgICAgaWYgKE5JTFAgKGxnc3RyaW5nKSkK KyAgICAgICAgZ290byBub19jb21wb3NpdGlvbjsKKyAgICAgIGlmIChOSUxQIChMR1NUUklOR19J RCAobGdzdHJpbmcpKSkKKyAgICAgICAgbGdzdHJpbmcgPSBjb21wb3NpdGlvbl9nc3RyaW5nX3B1 dF9jYWNoZSAobGdzdHJpbmcsIC0xKTsKKyAgICAgIGNtcF9pdC0+aWQgPSBYRklYTlVNIChMR1NU UklOR19JRCAobGdzdHJpbmcpKTsKKyAgICAgIGZvciAoaSA9IDA7IGkgPCBMR1NUUklOR19HTFlQ SF9MRU4gKGxnc3RyaW5nKTsgaSsrKQorICAgICAgICBpZiAoTklMUCAoTEdTVFJJTkdfR0xZUEgg KGxnc3RyaW5nLCBpKSkpCisgICAgICAgICAgYnJlYWs7CisgICAgICBjbXBfaXQtPm5nbHlwaHMg PSBpOworICAgICAgY21wX2l0LT5mcm9tID0gMDsKKyAgICAgIGNtcF9pdC0+dG8gPSBpOworICAg IH0KKyAgZWxzZQorICAgIGdvdG8gbm9fY29tcG9zaXRpb247CisgIHJldHVybiAxOworIG5vX2Nv bXBvc2l0aW9uOgorICBpZiAoY2hhcnBvcyA9PSBlbmRwb3MpCisgICAgcmV0dXJuIDA7CisgIGlm IChjaGFycG9zIDwgZW5kcG9zKQorICAgIHsKKyAgICAgIGNoYXJwb3MrKzsKKyAgICAgIGlmIChO SUxQIChzdHJpbmcpKQorICAgICAgICBJTkNfUE9TIChieXRlcG9zKTsKKyAgICAgIGVsc2UKKyAg ICAgICAgYnl0ZXBvcyArPSBCWVRFU19CWV9DSEFSX0hFQUQgKCooU0RBVEEgKHN0cmluZykgKyBi eXRlcG9zKSk7CisgICAgfQorICBlbHNlCisgICAgeworICAgICAgY2hhcnBvcy0tOworICAgICAg LyogQllURVBPUyBpcyBjYWxjdWxhdGVkIGluIGNvbXBvc2l0aW9uX2NvbXB1dGVfc3RvcF9wb3Mg Ki8KKyAgICAgIGJ5dGVwb3MgPSAtMTsKKyAgICB9CisgIGlmIChjbXBfaXQtPnJldmVyc2VkX3Ap CisgICAgZW5kcG9zID0gLTE7CisgIGNvbXBvc2l0aW9uX2NvbXB1dGVfc3RvcF9wb3MgKGNtcF9p dCwgY2hhcnBvcywgYnl0ZXBvcywgZW5kcG9zLCBzdHJpbmcpOworICByZXR1cm4gMDsKK30KKwor LyogU2Nhbm5pbmcgZnJvbSB0aGUgYmVnaW5uaW5nIG9mIHRoZSBjdXJyZW50IGxpbmUsIHN0b3Ag YXQ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2JvdW5kYXJ5KQorICAgICAgICB7CisgICAgICAgICAgcHRy ZGlmZl90IG9sZF9zY2FuID0gc2NhbjsKKyAgICAgICAgICAvKiBUaGlzIHVwZGF0ZXMgTkVYVF9C T1VOREFSWSB0byB0aGUgbmV4dCBwbGFjZQorICAgICAgICAgICAgIHdoZXJlIHdlIG1pZ2h0IG5l ZWQgdG8gc2tpcCBtb3JlIGludmlzaWJsZSB0ZXh0LiAqLworICAgICAgICAgIHNjYW4gPSBza2lw X2ludmlzaWJsZSAoc2NhbiwgJm5leHRfYm91bmRhcnksIGVuZCwgUW5pbCk7CisgICAgICAgICAg aWYgKHNjYW4gIT0gb2xkX3NjYW4pCisgICAgICAgICAgICBzY2FuX2J5dGUgPSBDSEFSX1RPX0JZ VEUgKHNjYW4pOworICAgICAgICAgIGlmIChzY2FuID49IGVuZCkKKyAgICAgICAgICAgIGdvdG8g ZW5kbG9vcDsKKyAgICAgICAgfQorICAgICAgLyogVGVzdCByZWFjaGluZyB0aGUgZ29hbCBjb2x1 bW4uICBXZSBkbyB0aGlzIGFmdGVyIHNraXBwaW5nCisgICBpbnZpc2libGUgY2hhcmFjdGVycywg c28gdGhhdCB3ZSBwdXQgcG9pbnQgYmVmb3JlIHRoZQorICAgY2hhcmFjdGVyIG9uIHdoaWNoIHRo ZSBjdXJzb3Igd2lsbCBhcHBlYXIuICovCisgICAgICBpZiAoY29sID49IGdvYWwpCisgICAgICAg IGJyZWFrOworICAgICAgcHJldl9jb2wgPSBjb2w7CisgICAgICB7IC8qIENoZWNrIGRpc3BsYXkg cHJvcGVydHkuICovCisgICAgICAgIHB0cmRpZmZfdCBlbmRwOworICAgICAgICBpbnQgd2lkdGgg PSBtY19jaGVja19kaXNwbGF5X3dpZHRoIChzY2FuLCBjb2wsICZlbmRwKTsKKyAgICAgICAgaWYg KHdpZHRoID49IDApCisgICAgICAgICAgeworICAgICAgICAgICAgY29sICs9IHdpZHRoOworICAg ICAgICAgICAgaWYgKGVuZHAgPiBzY2FuKSAvKiBBdm9pZCBpbmZpbml0ZSBsb29wcyB3aXRoIDAt d2lkdGggb3ZlcmxheXMuICovCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzY2Fu ID0gZW5kcDsKKyAgICAgICAgICAgICAgICBzY2FuX2J5dGUgPSBDSEFSX1RPX0JZVEUgKHNjYW4p OworICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICB9CisgICAgICAgICAg fQorICAgICAgfQorICAgICAgLyogQ2hlY2sgY29tcG9zaXRpb24gc2VxdWVuY2UuICovCisgICAg ICBpZiAoY21wX2l0LmlkID49IDAKKyAgICAgICAgICB8fCAoc2NhbiA9PSBjbXBfaXQuc3RvcF9w b3MKKyAgICAgICAgICAgICAgJiYgbWNfY29tcG9zaXRpb25fcmVzZWF0X2l0ICgmY21wX2l0LCBz Y2FuLCBzY2FuX2J5dGUsIGVuZCwgdywgTlVMTCwgUW5pbCkpKQorICAgICAgICBjb21wb3NpdGlv bl91cGRhdGVfaXQgKCZjbXBfaXQsIHNjYW4sIHNjYW5fYnl0ZSwgUW5pbCk7CisgICAgICBpZiAo Y21wX2l0LmlkID49IDApCisgICAgICAgIHsKKyAgICAgICAgICBzY2FuICs9IGNtcF9pdC5uY2hh cnM7CisgICAgICAgICAgc2Nhbl9ieXRlICs9IGNtcF9pdC5uYnl0ZXM7CisgICAgICAgICAgaWYg KHNjYW4gPD0gZW5kKQorICAgICAgICAgICAgY29sICs9IGNtcF9pdC53aWR0aDsKKyAgICAgICAg ICBpZiAoY21wX2l0LnRvID09IGNtcF9pdC5uZ2x5cGhzKQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBjbXBfaXQuaWQgPSAtMTsKKyAgICAgICAgICAgICAgY29tcG9zaXRpb25fY29tcHV0 ZV9zdG9wX3BvcyAoJmNtcF9pdCwgc2Nhbiwgc2Nhbl9ieXRlLCBlbmQsIFFuaWwpOworICAgICAg ICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBjbXBfaXQuZnJvbSA9IGNt cF9pdC50bzsKKyAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgfQorICAgICAgYyA9IEZFVENI X0JZVEUgKHNjYW5fYnl0ZSk7CisgICAgICAvKiBTZWUgaWYgdGhlcmUgaXMgYSBkaXNwbGF5IHRh YmxlIGFuZCBpdCByZWxhdGVzIHRvIHRoaXMgY2hhcmFjdGVyLiAqLworICAgICAgaWYgKGRwICE9 IDAKKyAgICAgICAgICAmJiAhIChtdWx0aWJ5dGUgJiYgTEVBRElOR19DT0RFX1AgKGMpKQorICAg ICAgICAgICYmIFZFQ1RPUlAgKERJU1BfQ0hBUl9WRUNUT1IgKGRwLCBjKSkpCisgICAgICAgIHsK KyAgICAgICAgICBMaXNwX09iamVjdCBjaGFydmVjOworICAgICAgICAgIHB0cmRpZmZfdCBpLCBu OworICAgICAgICAgIC8qIFRoaXMgY2hhcmFjdGVyIGlzIGRpc3BsYXllZCB1c2luZyBhIHZlY3Rv ciBvZiBnbHlwaHMuCisgICAgICAgICAgICAgVXBkYXRlIHRoZSBjb2x1bW4vcG9zaXRpb24gYmFz ZWQgb24gdGhvc2UgZ2x5cGhzLiAqLworICAgICAgICAgIGNoYXJ2ZWMgPSBESVNQX0NIQVJfVkVD VE9SIChkcCwgYyk7CisgICAgICAgICAgbiA9IEFTSVpFIChjaGFydmVjKTsKKyAgICAgICAgICBm b3IgKGkgPSAwOyBpIDwgbjsgaSsrKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBU aGlzIHNob3VsZCBiZSBoYW5kbGVkIHRoZSBzYW1lIGFzCisgICAgICAgICAgICAgIG5leHRfZWxl bWVudF9mcm9tX2Rpc3BsYXlfdmVjdG9yIGRvZXMgaXQuICovCisgICAgICAgICAgICAgIExpc3Bf T2JqZWN0IGVudHJ5ID0gQVJFRiAoY2hhcnZlYywgaSk7CisgICAgICAgICAgICAgIGlmIChHTFlQ SF9DT0RFX1AgKGVudHJ5KSkKKyAgICAgICAgICAgICAgICBjID0gR0xZUEhfQ09ERV9DSEFSIChl bnRyeSk7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBjID0gJyAnOworICAg ICAgICAgICAgICBpZiAoYyA9PSAnXG4nKQorICAgICAgICAgICAgICAgIGdvdG8gZW5kbG9vcDsK KyAgICAgICAgICAgICAgaWYgKGMgPT0gJ1xyJyAmJiBFUSAoQlZBUiAoY3VycmVudF9idWZmZXIs IHNlbGVjdGl2ZV9kaXNwbGF5KSwgUXQpKQorICAgICAgICAgICAgICAgIGdvdG8gZW5kbG9vcDsK KyAgICAgICAgICAgICAgaWYgKGMgPT0gJ1x0JykKKyAgICAgICAgICAgICAgICB7CisgICAgICAg ICAgICAgICAgICBjb2wgKz0gdGFiX3dpZHRoOworICAgICAgICAgICAgICAgICAgY29sID0gY29s IC8gdGFiX3dpZHRoICogdGFiX3dpZHRoOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAg ICAgICBlbHNlCisgICAgICAgICAgICAgICAgICArK2NvbDsKKyAgICAgICAgICAgIH0KKyAgICAg ICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgLyogVGhlIGRpc3Bs YXkgdGFibGUgZG9lc24ndCBhZmZlY3QgdGhpcyBjaGFyYWN0ZXI7CisgICAgICAgICAgICAgICBp dCBkaXNwbGF5cyBhcyBpdHNlbGYuICovCisgICAgICAgICAgICBpZiAoYyA9PSAnXG4nKQorICAg ICAgICAgICAgICBnb3RvIGVuZGxvb3A7CisgICAgICAgICAgICBpZiAoYyA9PSAnXHInICYmIEVR IChCVkFSIChjdXJyZW50X2J1ZmZlciwgc2VsZWN0aXZlX2Rpc3BsYXkpLCBRdCkpCisgICAgICAg ICAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgICAgIGlmIChjID09ICdcdCcpCisgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICBjb2wgKz0gdGFiX3dpZHRoOworICAgICAgICAgICAg ICAgIGNvbCA9IGNvbCAvIHRhYl93aWR0aCAqIHRhYl93aWR0aDsKKyAgICAgICAgICAgICAgfQor ICAgICAgICAgICAgICBlbHNlIGlmIChtdWx0aWJ5dGUgJiYgTEVBRElOR19DT0RFX1AgKGMpKQor ICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIC8qIFN0YXJ0IG9mIG11bHRpLWJ5 dGUgZm9ybS4gKi8KKyAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGNoYXIgKnB0cjsKKyAgICAg ICAgICAgICAgICAgIGludCBieXRlcywgd2lkdGg7CisgICAgICAgICAgICAgICAgICBwdHIgPSBC WVRFX1BPU19BRERSIChzY2FuX2J5dGUpOworICAgICAgICAgICAgICAgICAgTUNfTVVMVElCWVRF X0JZVEVTX1dJRFRIIChwdHIsIGRwLCBieXRlcywgd2lkdGgpOworICAgICAgICAgICAgICAgICAg LyogU3VidHJhY3Qgb25lIHRvIGNvbXBlbnNhdGUgZm9yIHRoZSBpbmNyZW1lbnQKKyAgICAgICAg ICAgICAgICAgIHRoYXQgaXMgZ29pbmcgdG8gaGFwcGVuIGJlbG93LiAqLworICAgICAgICAgICAg ICAgICAgc2Nhbl9ieXRlICs9IGJ5dGVzIC0gMTsKKyAgICAgICAgICAgICAgICAgIGNvbCArPSB3 aWR0aDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoY3RsX2Fy cm93ICYmIChjIDwgMDQwIHx8IGMgPT0gMDE3NykpCisgICAgICAgICAgICAgICAgICBjb2wgKz0g MjsKKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGMgPCAwNDAgfHwgYyA+PSAwMTc3KQorICAg ICAgICAgICAgICAgICAgICBjb2wgKz0gNDsKKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICAgICAgICAgIGNvbCsrOworICAgICAgICAgIH0KKyAgICAgIHNjYW4rKzsKKyAg ICAgIHNjY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KKyAgICAgICAgaWYgKG9sZF9idWZmZXIpCisgICAgICAgICAgc2V0 X2J1ZmZlcl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7CisgICAgICAgIHJldHVybiBjb2w7CisgICAg ICB9CisgICAgfQorICAvKiBTY2FuIGJhY2t3YXJkcyBmcm9tIHBvaW50IHRvIHRoZSBwcmV2aW91 cyBuZXdsaW5lLAorICAgICBjb3VudGluZyB3aWR0aC4gIFRhYiBjaGFyYWN0ZXJzIGFyZSB0aGUg b25seSBjb21wbGljYXRlZCBjYXNlLiAqLworICAvKiBNYWtlIGEgcG9pbnRlciBmb3IgZGVjcmVt ZW50aW5nIHRocm91Z2ggdGhlIGNoYXJzIGJlZm9yZSBwb2ludC4gKi8KKyAgcHRyID0gQllURV9Q T1NfQUREUiAoQ0hBUl9UT19CWVRFIChwdCkgLSAxKSArIDE7CisgIC8qIE1ha2UgYSBwb2ludGVy IHRvIHdoZXJlIGNvbnNlY3V0aXZlIGNoYXJzIGxlYXZlIG9mZiwKKyAgICAgZ29pbmcgYmFja3dh cmRzIGZyb20gcG9pbnQuICovCisgIGlmIChwdCA9PSBCRUdWKQorICAgIHN0b3AgPSBwdHI7Cisg ICAgZWxzZSBpZiAocHQgPD0gR1BUIHx8IEJFR1YgPiBHUFQpCisgICAgICBzdG9wID0gQkVHVl9B RERSOworICAgICAgZWxzZQorICAgICAgICBzdG9wID0gR0FQX0VORF9BRERSOworICBjb2wgPSAw LCB0YWJfc2VlbiA9IDAsIHBvc3RfdGFiID0gMDsKKyAgd2hpbGUgKDEpCisgICAgeworICAgICAg cHRyZGlmZl90IGksIG47CisgICAgICBMaXNwX09iamVjdCBjaGFydmVjOworICAgICAgaWYgKHB0 ciA9PSBzdG9wKQorICAgICAgICB7CisgICAgICAgICAgLyogV2Ugc3RvcHBlZCBlaXRoZXIgZm9y IHRoZSBiZWdpbm5pbmcgb2YgdGhlIGJ1ZmZlcgorICAgICAgICAgICAgIG9yIGZvciB0aGUgZ2Fw LiAqLworICAgICAgICAgIGlmIChwdHIgPT0gQkVHVl9BRERSKQorICAgICAgICAgICAgYnJlYWs7 CisgICAgICAgICAgLyogSXQgd2FzIHRoZSBnYXAuICBKdW1wIGJhY2sgb3ZlciBpdC4gKi8KKyAg ICAgICAgICBzdG9wID0gQkVHVl9BRERSOworICAgICAgICAgIHB0ciA9IEdQVF9BRERSOworICAg ICAgICAgIC8qIENoZWNrIHdoZXRoZXIgdGhhdCBicmluZ3MgdXMgdG8gYmVnaW5uaW5nIG9mIGJ1 ZmZlci4gKi8KKyAgICAgICAgICBpZiAoQkVHViA+PSBHUFQpCisgICAgICAgICAgICBicmVhazsK KyAgICAgICAgfQorICAgICAgYyA9ICotLXB0cjsKKyAgICAgIGlmIChkcCAmJiBWRUNUT1JQIChE SVNQX0NIQVJfVkVDVE9SIChkcCwgYykpKQorICAgICAgICB7CisgICAgICAgICAgY2hhcnZlYyA9 IERJU1BfQ0hBUl9WRUNUT1IgKGRwLCBjKTsKKyAgICAgICAgICBuID0gQVNJWkUgKGNoYXJ2ZWMp OworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBjaGFy dmVjID0gUW5pbDsKKyAgICAgICAgICAgIG4gPSAxOworICAgICAgICAgIH0KKyAgICAgIGZvciAo aSA9IG4gLSAxOyBpID49IDA7IC0taSkKKyAgICAgICAgeworICAgICAgICAgIGlmIChWRUNUT1JQ IChjaGFydmVjKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogVGhpcyBzaG91bGQg YmUgaGFuZGxlZCB0aGUgc2FtZSBhcworICAgICAgICAgICBuZXh0X2VsZW1lbnRfZnJvbV9kaXNw bGF5X3ZlY3RvciBkb2VzIGl0LiAqLworICAgICAgICAgICAgICBMaXNwX09iamVjdCBlbnRyeSA9 IEFSRUYgKGNoYXJ2ZWMsIGkpOworICAgICAgICAgICAgICBpZiAoR0xZUEhfQ09ERV9QIChlbnRy eSkpCisgICAgICAgICAgICAgICAgYyA9IEdMWVBIX0NPREVfQ0hBUiAoZW50cnkpOworICAgICAg ICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIGMgPSAnICc7CisgICAgICAgICAgICB9 CisgICAgICAgICAgaWYgKGMgPj0gMDQwICYmIGMgPCAwMTc3KQorICAgICAgICAgICAgY29sKys7 CisgICAgICAgICAgICBlbHNlIGlmIChjID09ICdcbicKKyAgICAgICAgICAgICAgICAgICAgIHx8 IChjID09ICdccicKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiBFUSAoQlZBUiAoY3VycmVu dF9idWZmZXIsIHNlbGVjdGl2ZV9kaXNwbGF5KSwgUXQpKSkKKyAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgIHB0cisrOworICAgICAgICAgICAgICAgIGdvdG8gc3RhcnRfb2ZfbGluZV9m b3VuZDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlIGlmIChjID09ICdcdCcp CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgaWYgKHRhYl9zZWVuKQorICAg ICAgICAgICAgICAgICAgICBjb2wgPSAoKGNvbCArIHRhYl93aWR0aCkgLyB0YWJfd2lkdGgpICog dGFiX3dpZHRoOworICAgICAgICAgICAgICAgICAgcG9zdF90YWIgKz0gY29sOworICAgICAgICAg ICAgICAgICAgY29sID0gMDsKKyAgICAgICAgICAgICAgICAgIHRhYl9zZWVuID0gMTsKKyAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoVkVDVE9SUCAoY2hhcnZlYykp CisgICAgICAgICAgICAgICAgICAvKiBXaXRoIGEgZGlzcGxheSB0YWJsZSBlbnRyeSwgQyBpcyBk aXNwbGF5ZWQgYXMgaXMsIGFuZAorICAgICAgICAgICAgICAgICAgICAgbm90IGRpc3BsYXllZCBh cyBcTk5OIG9yIGFzIF5OLiAgSWYgQyBpcyBhIHNpbmdsZS1ieXRlCisgICAgICAgICAgICAgICAg ICAgICBjaGFyYWN0ZXIsIGl0IHRha2VzIG9uZSBjb2x1bW4uICBJZiBDIGlzIG11bHRpLWJ5dGUg aW4KKyAgICAgICAgICAgICAgICAgICAgIGEgdW5pYnl0ZSBidWZmZXIsIGl0J3MgdHJhbnNsYXRl ZCB0byB1bmlieXRlLCBzbyBpdAorICAgICAgICAgICAgICAgICAgICAgYWxzbyB0YWtlcyBvbmUg Y29sdW1uLiAqLworICAgICAgICAgICAgICAgICAgKytjb2w7CisgICAgICAgICAgICAgICAgICBl bHNlCisgICAgICAgICAgICAgICAgICAgIGNvbCArPSAoY3RsX2Fycm93ICYmIGMgPCAwMjAwKSA/ IDIgOiA0OworICAgICAgICB9CisgICAgfQorIHN0YXJ0X29mX2xpbmVfZm91bmQ6CisgIGlmICh0 YWJfc2VlbikKKyAgICB7CisgICAgICBjb2wgPSAoKGNvbCArIHRhYl93aWR0aCkgLyB0YWJfd2lk dGgpICogdGFiX3dpZHRoOworICAgICAgY29sICs9IHBvc3RfdGFiOworICAgIH0KKyAgbGFzdF9r bm93bl9jb2x1bW4gPSBjb2w7CisgIGxhc3Rfa25vd25fY29sdW1uX3BvaW50ID0gcHQ7CisgIGxh c3Rfa25vd25fY29sdW1uX21vZGlmaWVkID0gTU9ESUZGOworICBpZiAob2xkX2J1ZmZlcikKKyAg ICBzZXRfYnVmZmVyX2ludGVybmFsIChvbGRfYnVmZmVyKTsKKyAgcmV0dXJuIGNvbDsKK30KKwor REVGVU4gKCJtYy1jdXJyZW50LWNvbHVtbiIsIEZtY19jdXJyZW50X2NvbHVtbiwgU21jX2N1cnJl bnRfY29sdW1uLCAyLCAyLCAwLAorICAgICAgIGRvYzogLyogUmV0dXJuIHRoZSBob3Jpem9udGFs IHBvc2l0aW9uIG9mIHBvaW50LiAgQmVnaW5uaW5nIG9mIGxpbmUgaXMgY29sdW1uIDAuCitUaGlz IGlzIGNhbGN1bGF0ZWQgYnkgYWRkaW5nIHRvZ2V0aGVyIHRoZSB3aWR0aHMgb2Y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Ky8qIFVTQUdF OiAgZnByaW50ZiAoc3RkZXJyLCAiRlJBTUUgKCVzKSIsIG1jX2ZyYW1lIChmKSk7ICovCitjaGFy ICoKK21jX2ZyYW1lIChzdHJ1Y3QgZnJhbWUgKmYpCit7CisgIExpc3BfT2JqZWN0IGZyYW1lOwor ICBYU0VURlJBTUUgKGZyYW1lLCBmKTsKKyAgcmV0dXJuIFNTREFUQSAoRnByaW4xX3RvX3N0cmlu ZyAoZnJhbWUsIFFuaWwpKTsKK30KKworLyogVVNBR0U6ICBmcHJpbnRmIChzdGRlcnIsICJXSU5E T1cgKCVzKSIsIG1jX3dpbmRvdyAodykpOyAqLworY2hhciAqCittY193aW5kb3cgKHN0cnVjdCB3 aW5kb3cgKncpCit7CisgIExpc3BfT2JqZWN0IHdpbmRvdzsKKyAgWFNFVFdJTkRPVyAod2luZG93 LCB3KTsKKyAgcmV0dXJuIFNTREFUQSAoRnByaW4xX3RvX3N0cmluZyAod2luZG93LCBRbmlsKSk7 Cit9CisKKy8qIFVTQUdFOiAgZnByaW50ZiAoc3RkZXJyLCAiQ0hBUkFDVEVSICglcykiLCBtY19j aGFyX3RvX3N0cmluZyAoZ2x5cGgtPnUuY2gpKTsgKi8KK2NoYXIgKgorbWNfY2hhcl90b19zdHJp bmcgKGludCBhcmcpCit7CisgIExpc3BfT2JqZWN0IGNoYXJhY3RlciA9ICgwIDw9IGFyZyAmJiBh cmcgPD0gTUFYX0NIQVIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICA/IEZjaGFyX3RvX3N0 cmluZyAobWFrZV9maXhudW0gKGFyZykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFFu aWw7CisgIGNoYXIgKiByZXN1bHQgPSAoIU5JTFAgKGNoYXJhY3RlcikKKyAgICAgICAgICAgICAg ICAgICAmJiBhcmcgPT0gOSkKKyAgICAgICAgICAgICAgICAgICAgPyAiXFx0IgorICAgICAgICAg ICAgICAgICAgOiAoIU5JTFAgKGNoYXJhY3RlcikKKyAgICAgICAgICAgICAgICAgICAgICYmIGFy ZyA9PSAxMCkKKyAgICAgICAgICAgICAgICAgICAgPyAiXFxuIgorICAgICAgICAgICAgICAgICAg OiAoIU5JTFAgKGNoYXJhY3RlcikKKyAgICAgICAgICAgICAgICAgICAgICYmIGFyZyA9PSAzMikK KyAgICAgICAgICAgICAgICAgICAgPyAiXFxzIgorICAgICAgICAgICAgICAgICAgOiAoIU5JTFAg KGNoYXJhY3RlcikKKyAgICAgICAgICAgICAgICAgICAgICYmIGFyZyAhPSA5CisgICAgICAgICAg ICAgICAgICAgICAmJiBhcmcgIT0gMTAKKyAgICAgICAgICAgICAgICAgICAgICYmIGFyZyAhPSAz MikKKyAgICAgICAgICAgICAgICAgICAgPyBTU0RBVEEgKGNoYXJhY3RlcikKKyAgICAgICAgICAg ICAgICAgIDogIlxcPyI7CisgIHJldHVybiByZXN1bHQ7Cit9CisKK2ludAorbWNfbGlzcF90b19j dXJzb3JfdHlwZSAoTGlzcF9PYmplY3QgYXJnKQoreworICBjaGFyICpzdHI7CisgIGlmIChYVFlQ RSAoYXJnKSA9PSBMaXNwX1N0cmluZykKKyAgICBzdHIgPSBTU0RBVEEgKGFyZyk7CisgICAgZWxz ZSBpZiAoWFRZUEUgKGFyZykgPT0gTGlzcF9TeW1ib2wpCisgICAgICBzdHIgPSBTU0RBVEEgKFNZ TUJPTF9OQU1FIChhcmcpKTsKKyAgICAgIGVsc2UgcmV0dXJuIC0xOworICBpZiAoIXN0cmNtcCAo c3RyLCAibm8iKSkKKyAgICByZXR1cm4gTUNfTk9fQ1VSU09SOworICBpZiAoIXN0cmNtcCAoc3Ry LCAibWMtbGVmdC1mcmluZ2UtYml0bWFwIikpCisgICAgcmV0dXJuIE1DX0xFRlRfRlJJTkdFX0JJ VE1BUDsKKyAgaWYgKCFzdHJjbXAgKHN0ciwgIm1jLXJpZ2h0LWZyaW5nZS1iaXRtYXAiKSkKKyAg ICByZXR1cm4gTUNfUklHSFRfRlJJTkdFX0JJV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0NBQ0hFIjsKKyAgICAgIGRlZmF1bHQ6CisgICAgICByZXR1 cm4gIlVOS05PV04iOworICAgIH0KK30KKworLyogVVNBR0U6ICBmcHJpbnRmIChzdGRlcnIsICJB Q1RJT04tVFlQRSAoJXMpIiwgbWNfZW5naW5lX3R5cGVfdG9fc3RyaW5nIChhcmcpKTsgKi8KK2No YXIgKgorbWNfZW5naW5lX3R5cGVfdG9fc3RyaW5nIChlbnVtIG1jX2VuZ2luZV90eXBlIGFjdGlv bl90eXBlKQoreworICBzd2l0Y2ggKGFjdGlvbl90eXBlKQorICAgIHsKKyAgICAgIGNhc2UgTVVM VElQTEVfQ1VSU09SUzogcmV0dXJuICJNVUxUSVBMRV9DVVJTT1JTIjsKKyAgICAgIGNhc2UgSE9S SVpPTlRBTF9SVUxFUjogcmV0dXJuICJIT1JJWk9OVEFMX1JVTEVSIjsKKyAgICAgIGNhc2UgVkVS VElDQUxfUlVMRVI6IHJldHVybiAiVkVSVElDQUxfUlVMRVIiOworICAgICAgY2FzZSBGSUxMX0NP TFVNTjogcmV0dXJuICJGSUxMX0NPTFVNTiI7CisgICAgICBjYXNlIENVUlNPUl9JTkRJQ0FUT1I6 IHJldHVybiAiQ1VSU09SX0lORElDQVRPUiI7CisgICAgICBkZWZhdWx0OgorICAgICAgcmV0dXJu ICJVTktOT1dOIjsKKyAgICB9Cit9CisKKy8qIFVTQUdFOiAgZnByaW50ZiAoc3RkZXJyLCAiRlJP TV9XSEVSRSAoJXMpIiwgbWNfZHJhd19yb3dfdHlwZV90b19zdHJpbmcgKGFyZykpOyAqLworY2hh ciAqCittY19kcmF3X3Jvd190eXBlX3RvX3N0cmluZyAoZW51bSBtY19kcmF3X3Jvd190eXBlIGZy b21fd2hlcmUpCit7CisgIHN3aXRjaCAoZnJvbV93aGVyZSkKKyAgICB7CisgICAgICBjYXNlIE5P V0hFUkU6IHJldHVybiAiTk9XSEVSRSI7CisgICAgICBjYXNlIFNDUklCRV9PTkU6IHJldHVybiAi U0NS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gRFJBV19ST1dfV0lUSF9NT1VTRV9G QUNFOiByZXR1cm4gIkRSQVdfUk9XX1dJVEhfTU9VU0VfRkFDRSI7CisgICAgICBjYXNlIEVYUE9T RV9BUkVBX09ORTogcmV0dXJuICJFWFBPU0VfQVJFQV9PTkUiOworICAgICAgY2FzZSBFWFBPU0Vf QVJFQV9UV086IHJldHVybiAiRVhQT1NFX0FSRUFfVFdPIjsKKyAgICAgIGNhc2UgRVhQT1NFX0xJ TkU6IHJldHVybiAiRVhQT1NFX0xJTkUiOworICAgICAgZGVmYXVsdDoKKyAgICAgIHJldHVybiAi VU5LTk9XTiI7CisgICAgfQorfQorCit2b2lkCittY19jYWNoZV9pbnNwZWN0b3IgKHN0cnVjdCB3 aW5kb3cgKncsIHN0cnVjdCBtY19tYXRyaXggbWF0cml4KQoreworICBpbnQgdnBvc19hbGxvY2F0 ZWQgPSB3LT5tY19tYXRyaXgudnBvc19hbGxvY2F0ZWQ7CisgIGludCB2cG9zX3VzZWQgPSB3LT5t Y19tYXRyaXgudnBvc191c2VkOworICBmcHJpbnRmIChzdGRlcnIsICIlczogIG1hdHJpeC52cG9z X2FsbG9jYXRlZCAoJWQpIHwgbWF0cml4LnZwb3NfdXNlZCAoJWQpXG4iLAorICAgICAgICAgICAg ICAgICAgIG1jX3dpbmRvdyAodyksIHZwb3NfYWxsb2NhdGVkLCB2cG9zX3VzZWQpOworICBmb3Ig KGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7CisgICAgICAgY2FjaGVf dHlwZSA8IE5PX0NBQ0hFOworICAgICAgICsrY2FjaGVfdHlwZSkKKyAgICB7CisgICAgICBpbnQg Y3Vyc29yc191c2VkID0gdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90eXBlXTsKKyAg ICAgIGZwcmludGYgKHN0ZGVyciwgIiAgbWF0cml4LmN1cnNvcnNfdXNlZFslc10gKCVkKVxuIiwK KyAgICAgICAgICAgICAgICAgICAgICAgbWNfY2FjaGVfdHlwZV90b19zdHJpbmcgKGNhY2hlX3R5 cGUpLCBjdXJzb3JzX3VzZWQpOworICAgIH0KKyAgZm9yIChpbnQgdm50aCA9IDA7CisgICAgICAg dm50aCA8IHctPm1jX21hdHJpeC52cG9zX3VzZWQ7CisgICAgICAgKyt2bnRoKQorICAgIHsKKyAg ICAgIGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAg ICAgICAgY2FjaGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICAgICArK2NhY2hlX3R5cGUpCisg ICAgICAgIHsKKyAgICAgICAgICBpbnQgY2FjaGVfYWxsb2NhdGVkID0gdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVkW2NhY2hlX3R5cGVdOworICAgICAgICAgIGludCBjYWNo ZV91c2VkID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXTsK KyAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIgICAgdm50aCAoJWQpIHwgY2FjaGVfYWxsb2Nh dGVkWyVzXSAoJWQpIHwgY2FjaGVfdXNlZFslc10gKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgIHZudGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBtY19jYWNoZV90eXBl X3RvX3N0cmluZyAoY2FjaGVfdHlwZSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICBjYWNo ZV9hbGxvY2F0ZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBtY19jYWNoZV90eXBlX3Rv X3N0cmluZyAoY2FjaGVfdHlwZSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICBjYWNoZV91 c2VkKTsKKyAgICAgICAgfQorICAgIH0KK30KKwordm9pZAorbWNfc2V0X2xzbF9iZyAoc3RydWN0 IHdpbmRvdyAqdywgZW51bSBmY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0VfSUQgLyogUXdpbmRvd19k aXZpZGVyICovCisgICAgICAgICAgfHwgZmFjZV9pZCA9PSBXSU5ET1dfRElWSURFUl9GSVJTVF9Q SVhFTF9GQUNFX0lEIC8qIFF3aW5kb3dfZGl2aWRlcl9maXJzdF9waXhlbCAqLworICAgICAgICAg IHx8IGZhY2VfaWQgPT0gV0lORE9XX0RJVklERVJfTEFTVF9QSVhFTF9GQUNFX0lEIC8qIFF3aW5k b3dfZGl2aWRlcl9sYXN0X3BpeGVsICovCisgICAgICAgICAgfHwgZmFjZV9pZCA9PSBWRVJUSUNB TF9CT1JERVJfRkFDRV9JRCAvKiBRdmVydGljYWxfYm9yZGVyICovCisgICAgICAgICAgfHwgZmFj ZV9pZCA9PSBJTlRFUk5BTF9CT1JERVJfRkFDRV9JRCkpIC8qIFFpbnRlcm5hbF9ib3JkZXIgKi8K KyAgICBmYWNlID0gRkFDRV9GUk9NX0lEIChmLCBsb29rdXBfYmFzaWNfZmFjZSAodywgZiwgZmFj ZV9pZCkpOworICAgIGVsc2UKKyAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGZhY2VfaWQp OworICBMaXNwX09iamVjdCBjb2xvciA9IChmYWNlICE9IE5VTEwpCisgICAgICAgICAgICAgICAg ICAgICAgPyBmYWNlLT5sZmFjZVtMRkFDRV9CQUNLR1JPVU5EX0lOREVYXQorICAgICAgICAgICAg ICAgICAgICAgIDogYnVpbGRfc3RyaW5nICgiT3JhbmdlUmVkIik7CisgIG1jX3h3X2NvbG9yX3Zh bHVlcyAodywgY29sb3IsIGxzbCk7Cit9CisKK3ZvaWQKK21jX3NldF9lc3NlbnRpYWxzIChzdHJ1 Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgbWNfZXNzZW50aWFscyAqZXNzZW50aWFscykKK3sKKyAgaWYg KCFCVUZGRVJQICh3LT5jb250ZW50cykpCisgICAgcmV0dXJuOworICBpZiAoTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHM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l cikKKyAgICB7CisgICAgICBvbGRfYnVmZmVyID0gY3VycmVudF9idWZmZXI7CisgICAgICBzZXRf YnVmZmVyX2ludGVybmFsIChiKTsKKyAgICB9CisgIGVzc2VudGlhbHMtPnp2ID0gWlY7CisgIGVz c2VudGlhbHMtPnp2X2J5dGUgPSBaVl9CWVRFOworICBlc3NlbnRpYWxzLT5mY194ID0gKGZpbGxf Y29sdW1uX3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoVmRpc3BsYXlfbGluZV9u dW1iZXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgPyAoZmlsbF9jb2wgKiBmcmFtZV9jaGFy X3dpZHRoKSArIHctPm1jLmxudW1fcGl4ZWxfd2lkdGggLSBoc2NsX3gKKyAgICAgICAgICAgICAg ICAgICAgIDogKGZpbGxfY29sdW1uX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIE5JTFAg KFZkaXNwbGF5X2xpbmVfbnVtYmVycykpCisgICAgICAgICAgICAgICAgICAgICAgID8gKGZpbGxf Y29sICogZnJhbWVfY2hhcl93aWR0aCkgLSBoc2NsX3gKKyAgICAgICAgICAgICAgICAgICAgIDog MDsKKyAgaWYgKG9sZF9idWZmZXIpCisgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAob2xkX2J1ZmZl cik7CisgIGVudW0gZmFjZV9pZCBmaWxsX2NvbHVtbl9wcmVfenZfZmFjZV9pZCA9CisgICAgKCFl c3NlbnRpYWxzLT5hY3RpdmVfcAorICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBmY19pbmFjdGl2ZV93aW5kb3dzKSkKKyAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNl ICh3LCBmLCBpbnRlcm4gKCJmYy1pbmFjdGl2ZS1wcmUtenYtZmFjZSIpLCB0cnVl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V5b25kX2ZpbGxfZm9yZWdyb3VuZDsKKyAgICAgIG1jX3h3 X2NvbG9yX3ZhbHVlcyAodywgYmV5b25kX2ZpbGxfY29sb3IsICZiZXlvbmRfZmlsbF9mb3JlZ3Jv dW5kKTsKKyAgICAgIC8qIHJlZCAqLworICAgICAgaWYgKCghZmlsbF9jb2x1bW5fcAorICAgICAg ICAgICAmJiBjdXJyZW50X2NvbCAlIDIgIT0gMAorICAgICAgICAgICAmJiByb3dfcG9zaXRpb24g PT0gUFJFX1pWKQorICAgICAgICAgIHx8IChmaWxsX2NvbHVtbl9wCisgICAgICAgICAgICAgICYm IGN1cnJlbnRfY29sICUgMiAhPSAwCisgICAgICAgICAgICAgICYmIGN1cnJlbnRfY29sIDw9IGZp bGxfY29sCisgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYpKQorICAgICAg ICB7CisgICAgICAgICAgbHNsX2ZnLT5yZWQgPSBvZGRfZm9yZWdyb3VuZC5yZWQ7CisgICAgICAg ICAgbHNsX2ZnLT5ncmVlbiA9IG9kZF9mb3JlZ3JvdW5kLmdyZWVuOworICAgICAgICAgIGxzbF9m Zy0+Ymx1ZSA9IG9kZF9mb3JlZ3JvdW5kLmJsdWU7CisgICAgICAgIH0KKyAgICAgICAgLyogeWVs bG93ICovCisgICAgICAgIGVsc2UgaWYgKCghZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAgICAg ICAgJiYgY3VycmVudF9jb2wgJSAyID09IDAKKyAgICAgICAgICAgICAgICAgICYmIHJvd19wb3Np dGlvbiA9PSBQUkVfWlYpCisgICAgICAgICAgICAgICAgIHx8IChmaWxsX2NvbHVtbl9wCisgICAg ICAgICAgICAgICAgICAgICAmJiBjdXJyZW50X2NvbCAlIDIgPT0gMAorICAgICAgICAgICAgICAg ICAgICAgJiYgY3VycmVudF9jb2wgPD0gZmlsbF9jb2wKKyAgICAgICAgICAgICAgICAgICAgICYm IHJvd19wb3NpdGlvbiA9PSBQUkVfWlYpKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGxzbF9m Zy0+cmVkID0gZXZlbl9mb3JlZ3JvdW5kLnJlZDsKKyAgICAgICAgICAgIGxzbF9mZy0+Z3JlZW4g PSBldmVuX2ZvcmVncm91bmQuZ3JlZW47CisgICAgICAgICAgICBsc2xfZmctPmJsdWUgPSBldmVu X2ZvcmVncm91bmQuYmx1ZTsKKyAgICAgICAgICB9CisgICAgICAgICAgLyogZ3JlZW4gKi8KKyAg ICAgICAgICBlbHNlIGlmIChmaWxsX2NvbHVtbl9wCisgICAgICAgICAgICAgICAgICAgJiYgY3Vy cmVudF9jb2wgPiBmaWxsX2NvbAorICAgICAgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9 PSBQUkVfWlYpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGxzbF9mZy0+cmVkID0gYmV5 b25kX2ZpbGxfZm9yZWdyb3VuZC5yZWQ7CisgICAgICAgICAgICAgIGxzbF9mZy0+Z3JlZW4gPSBi ZXlvbmRfZmlsbF9mb3JlZ3JvdW5kLmdyZWVuOworICAgICAgICAgICAgICBsc2xfZmctPmJsdWUg PSBiZXlvbmRfZmlsbF9mb3JlZ3JvdW5kLmJsdWU7CisgICAgICAgICAgICB9CisgICAgICAgICAg ICBlbHNlIGlmIChyb3dfcG9zaXRpb24gPT0gQVRfWlYpCisgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICBsc2xfZmctPnJlZCA9IGVzc2VudGlhbHMuc3BfZmcucmVkOworICAgICAgICAg ICAgICAgIGxzbF9mZy0+Z3JlZW4gPSBlc3NlbnRpYWxzLnNwX2ZnLmdyZWVuOworICAgICAgICAg ICAgICAgIGxzbF9mZy0+Ymx1ZSA9IGVzc2VudGlhbHMuc3BfZmcuYmx1ZTsKKyAgICAgICAgICAg ICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgSE9SSVpPTlRBTF9SVUxFUjoKKyAg ICB7CisgICAgICBpZiAoZ2x5cGggIT0gTlVMTAorICAgICAgICAgICYmIGdseXBoLT51LmNoID09 IDk1CisgICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gTUNfSEJBUikKKyAgICAgICAgeworICAg ICAgICAgIGxzbF9mZy0+cmVkID0gZXNzZW50aWFscy5zcF9mZy5yZWQ7CisgICAgICAgICAgbHNs X2ZnLT5ncmVlbiA9IGVzc2VudGlhbHMuc3BfZmcuZ3JlZW47CisgICAgICAgICAgbHNsX2ZnLT5i bHVlID0gZXNzZW50aWFscy5zcF9mZy5ibHVlOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAg ICAgICAgICB7CisgICAgICAgICAgICBsc2xfZmctPnJlZCA9IGVzc2VudGlhbHMuY2hfZmdbcm93 X3Bvc2l0aW9uXS5yZWQ7CisgICAgICAgICAgICBsc2xfZmctPmdyZWVuID0gZXNzZW50aWFscy5j aF9mZ1tyb3dfcG9zaXRpb25dLmdyZWVuOworICAgICAgICAgICAgbHNsX2ZnLT5ibHVlID0gZXNz ZW50aWFscy5jaF9mZ1tyb3dfcG9zaXRpb25dLmJsdWU7CisgICAgICAgICAgfQorICAgICAgYnJl YWs7CisgICAgfQorICAgIGNhc2UgVkVSVElDQUxfUlVMRVI6CisgICAgeworICAgICAgbHNsX2Zn LT5yZWQgPSBlc3NlbnRpYWxzLmNoX2ZnW3Jvd19wb3NpdGlvbl0ucmVkOworICAgICAgbHNsX2Zn LT5ncmVlbiA9IGVzc2VudGlhbHMuY2hfZmdbcm93X3Bvc2l0aW9uXS5ncmVlbjsKKyAgICAgIGxz bF9mZy0+Ymx1ZSA9IGVzc2VudGlhbHMuY2hfZmdbcm93X3Bvc2l0aW9uXS5ibHVlOworICAgICAg YnJlYWs7CisgICAgfQorICAgIGNhc2UgRklMTF9DT0xVTU46CisgICAgeworICAgICAgbHNsX2Zn LT5yZWQgPSBlc3NlbnRpYWxzLmZjX2ZnW3Jvd19wb3NpdGlvbl0ucmVkOworICAgICAgbHNsX2Zn LT5ncmVlbiA9IGVzc2VudGlhbHMuZmNfZmdbcm93X3Bvc2l0aW9uXS5ncmVlbjsKKyAgICAgIGxz bF9mZy0+Ymx1ZSA9IGVzc2VudGlhbHMuZmNfZmdbcm93X3Bvc2l0aW9uXS5ibHVlOworICAgICAg YnJlYWs7CisgICAgfQorICAgIGNhc2UgQ1VSU09SX0lORElDQVRPUjoKKyAgICB7CisgICAgICBz dHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgICAgIGVudW0gZmFjZV9pZCBj dXJzb3JfZmFjZV9pZCA9CisgICAgICAgICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAg JiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaW5hY3RpdmVfd2luZG93 cykpCisgICAgICAgICAmJiByb3dfcG9zaXRpb24gPT0gUFJFX1pWKQorICAgICAgICAgID8gbG9v a3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2 ZS1wcmUtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICA6IChlc3NlbnRpYWxzLmFjdGl2ZV9wCisg ICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYpCisgICAgICAgICAgPyBsb29rdXBf bmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNl IiksIHRydWUpCisgICAgICAgIDogKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICYm ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3Mp KQorICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gPT0gQVRfWlYpCisgICAgICAgICAgICA/IGxv b2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFr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TW91c2VfSExJ bmZvICpobGluZm8gPSBNT1VTRV9ITF9JTkZPIChmKTsKKyAgICAgIGludCBtb3VzZV9iZWdfY29s IFVOSU5JVCwgbW91c2VfZW5kX2NvbCBVTklOSVQ7CisgICAgICBib29sIGNoZWNrX21vdXNlX2Zh Y2UgPSBmYWxzZTsKKyAgICAgIGludCBkdW1teV94ID0gMDsKKyAgICAgIC8qIElmIG1vdXNlIGhp Z2hsaWdodGluZyBpcyBvbiwgd2UgbWF5IG5lZWQgdG8gZHJhdyBhZGphY2VudAorICAgZ2x5cGhz IHVzaW5nIG1vdXNlLWZhY2UgaGlnaGxpZ2h0aW5nLiAqLworICAgICAgaWYgKGFyZWEgPT0gVEVY VF9BUkVBICYmIHJvdy0+bW91c2VfZmFjZV9wCisgICAgICAgICAgJiYgaGxpbmZvLT5tb3VzZV9m YWNlX2JlZ19yb3cgPj0gMAorICAgICAgICAgICYmIGhsaW5mby0+bW91c2VfZmFjZV9lbmRfcm93 ID49IDApCisgICAgICAgIHsKKyAgICAgICAgICBwdHJkaWZmX3Qgcm93X3Zwb3MgPSBNQVRSSVhf Uk9XX1ZQT1MgKHJvdywgdy0+Y3VycmVudF9tYXRyaXgpOworICAgICAgICAgIGlmIChyb3dfdnBv cyA+PSBobGluZm8tPm1vdXNlX2ZhY2VfYmVnX3JvdworICAgICAgICAgICAgICAmJiByb3dfdnBv cyA8PSBobGluZm8tPm1vdXNlX2ZhY2VfZW5kX3JvdykKKyAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgY2hlY2tfbW91c2VfZmFjZSA9IHRydWU7CisgICAgICAgICAgICAgIG1vdXNlX2JlZ19j b2wgPSAocm93X3Zwb3MgPT0gaGxpbmZvLT5tb3VzZV9mYWNlX2JlZ19yb3cpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IGhsaW5mby0+bW91c2VfZmFjZV9iZWdfY29sCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IDA7CisgICAgICAgICAgICAgIG1vdXNlX2VuZF9jb2wg PSAocm93X3Zwb3MgPT0gaGxpbmZvLT5tb3VzZV9mYWNlX2VuZF9yb3cpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IGhsaW5mby0+bW91c2VfZmFjZV9lbmRfY29sCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IHJvdy0+dXNlZFtURVhUX0FSRUFdOworICAgICAgICAgICAg fQorICAgICAgICB9CisgICAgICAvKiBDb21wdXRlIG92ZXJoYW5ncyBmb3IgYWxsIGdseXBoIHN0 cmluZ3MuICovCisgICAgICBpZiAoRlJBTUVfUklGIChmKS0+Y29tcHV0ZV9nbHlwaF9zdHJpbmdf b3ZlcmhhbmdzKQorICAgICAgICBmb3IgKHMgPSBoZWFkOyBzOyBzID0gcy0+bmV4dCkKKyAgICAg ICAgICBGUkFNRV9SSUYgKGYpLT5jb21wdXRlX2dseXBoX3N0cmluZ19vdmVyaGFuZ3MgKHMpOwor ICAgICAgLyogUHJlcGVuZCBnbHlwaCBzdHJpbmdzIGZvciBnbHlwaHMgaW4gZnJvbnQgb2YgdGhl IGZpcnN0IGdseXBoCisgICAgICBzdHJpbmcgdGhhdCBhcmUgb3ZlcndyaXR0ZW4gYmVjYXVzZSBv ZiB0aGUgZmlyc3QgZ2x5cGgKKyAgICAgIHN0cmluZydzIGxlZnQgb3ZlcmhhbmcuICBUaGUgYmFj a2dyb3VuZCBvZiBhbGwgc3RyaW5ncworICAgICAgcHJlcGVuZGVkIG11c3QgYmUgZHJhd24gYmVj YXVzZSB0aGUgZmlyc3QgZ2x5cGggc3RyaW5nCisgICAgICBkcmF3cyBvdmVyIGl0LiAqLworICAg ICAgaSA9IGxlZnRfb3ZlcndyaXR0ZW4gKGhlYWQpOworICAgICAgaWYgKGkgPj0gMCkKKyAgICAg ICAgeworICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBvdmVybGFwX2hsOworICAgICAg ICAgIC8qIElmIHRoaXMgcm93IGNvbnRhaW5zIG1vdXNlIGhpZ2hsaWdodGluZywgYXR0ZW1wdCB0 byBkcmF3CisgICAgICAgICAgICAgdGhlIG92ZXJsYXBwZWQgZ2x5cGhzIHdpdGggdGhlIGNvcnJl Y3QgaGlnaGxpZ2h0LiAgVGhpcworICAgICAgICAgICAgIGNvZGUgZmFpbHMgaWYgdGhlIG92ZXJs YXAgZW5jb21wYXNzZXMgbW9yZSB0aGFuIG9uZSBnbHlwaAorICAgICAgICAgICAgIGFuZCBtb3Vz ZS1oaWdobGlnaHQgc3BhbnMgb25seSBzb21lIG9mIHRoZXNlIGdseXBocy4KKyAgICAgICAgICAg ICBIb3dldmVyLCBtYWtpbmcgaXQgd29yayBwZXJmZWN0bHkgaW52b2x2ZXMgYSBsb3QgbW9yZQor ICAgICAgICAgICAgIGNvZGUsIGFuZCBJIGRvbid0IGtub3cgaWYgdGhlIHBhdGhvbG9naWNhbCBj YXNlIG9jY3VycyBpbgorICAgICAgICAgICAgIHByYWN0aWNlLCBzbyB3ZSdsbCBzdGljayB0byB0 aGlzIGZvciBub3cuICAtLS0gY3lkICAqLworICAgICAgICAgIGlmIChjaGVja19tb3VzZV9mYWNl CisgICAgICAgICAgICAgICYmIG1vdXNlX2JlZ19jb2wgPCBzdGFydCAmJiBtb3VzZV9lbmRfY29s ID4gaSkKKyAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX01PVVNFX0ZBQ0U7CisgICAgICAg ICAgICBlbHNlCisgICAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX05PUk1BTF9URVhUOwor ICAgICAgICAgIGlmIChobCAhPSBvdmVybGFwX2hsKQorICAgICAgICAgICAgY2xpcF9oZWFkID0g aGVhZDsKKyAgICAgICAgICBqID0gaTsKKyAgICAgICAgICBNQ19CVUlMRF9HTFlQSF9TVFJJTkdT IChqLCBzdGFydCwgaCwgdCwgb3ZlcmxhcF9obCwgZHVtbXlfeCwgbGFzdF94KTsKKyAgICAgICAg ICAvKiBUaGUg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bHNvIGVyYXNlIGZha2UKKyAgICAgICAgICBjdXJzb3JzIHRo YXQgYXJlIGBsZWZ0X292ZXJ3cml0dGVuJy4gKi8KKyAgICAgICAgICBsZW5ndGggPSAwOworICAg ICAgICAgIGZvciAocyA9IGg7IHM7IHMgPSBzLT5uZXh0KQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBzLT5sZWZ0X292ZXJ3cml0dGVuX3AgPSB0cnVlOworICAgICAgICAgICAgICBzLT5h Y3Rpb25fdHlwZSA9IGFjdGlvbl90eXBlOworICAgICAgICAgICAgICBsZW5ndGggKz0gcy0+Zmly c3RfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgfQorICAgICAgICAgIHJlbGF0aXZl X3ggPSBzdGFydF94IC0gbGVuZ3RoOworICAgICAgICAgIGZvciAocyA9IGg7IHM7IHMgPSBzLT5u ZXh0KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzLT5maXJzdF9nbHlwaC0+cmVsYXRp dmVfeCA9IHJlbGF0aXZlX3g7CisgICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0gcy0+Zmlyc3Rf Z2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgfQorICAgICAgICAgIHN0YXJ0ID0gaTsK KyAgICAgICAgICBjb21wdXRlX292ZXJoYW5nc19hbmRfeCAodCwgaGVhZC0+eCwgdHJ1ZSk7Cisg ICAgICAgICAgcHJlcGVuZF9nbHlwaF9zdHJpbmdfbGlzdHMgKCZoZWFkLCAmdGFpbCwgaCwgdCk7 CisgICAgICAgICAgaWYgKGNsaXBfaGVhZCA9PSBOVUxMKQorICAgICAgICAgICAgY2xpcF9oZWFk ID0gaGVhZDsKKyAgICAgICAgfQorICAgICAgLyogUHJlcGVuZCBnbHlwaCBzdHJpbmdzIGZvciBn bHlwaHMgaW4gZnJvbnQgb2YgdGhlIGZpcnN0IGdseXBoCisgICAgICBzdHJpbmcgdGhhdCBvdmVy d3JpdGUgdGhhdCBnbHlwaCBzdHJpbmcgYmVjYXVzZSBvZiB0aGVpcgorICAgICAgcmlnaHQgb3Zl cmhhbmcuICBGb3IgdGhlc2Ugc3RyaW5ncywgb25seSB0aGUgZm9yZWdyb3VuZCBtdXN0CisgICAg ICBiZSBkcmF3biwgYmVjYXVzZSBpdCBkcmF3cyBvdmVyIHRoZSBnbHlwaCBzdHJpbmcgYXQgYGhl YWQnLgorICAgICAgVGhlIGJhY2tncm91bmQgbXVzdCBub3QgYmUgZHJhd24gYmVjYXVzZSB0aGlz IHdvdWxkIG92ZXJ3cml0ZQorICAgICAgcmlnaHQgb3ZlcmhhbmdzIG9mIHByZWNlZGluZyBnbHlw aHMgZm9yIHdoaWNoIG5vIGdseXBoCisgICAgICBzdHJpbmdzIGV4aXN0LiAqLworICAgICAgaSA9 IGxlZnRfb3ZlcndyaXRpbmcgKGhlYWQpOworICAgICAgaWYgKGkgPj0gMCkKKyAgICAgICAgewor ICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBvdmVybGFwX2hsOworICAgICAgICAgIGlm IChjaGVja19tb3VzZV9mYWNlCisgICAgICAgICAgICAgICYmIG1vdXNlX2JlZ19jb2wgPCBzdGFy dCAmJiBtb3VzZV9lbmRfY29sID4gaSkKKyAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX01P VVNFX0ZBQ0U7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBE UkFXX05PUk1BTF9URVhUOworICAgICAgICAgIGlmIChobCA9PSBvdmVybGFwX2hsIHx8IGNsaXBf aGVhZCA9PSBOVUxMKQorICAgICAgICAgICAgY2xpcF9oZWFkID0gaGVhZDsKKyAgICAgICAgICBN Q19CVUlMRF9HTFlQSF9TVFJJTkdTIChpLCBzdGFydCwgaCwgdCwgb3ZlcmxhcF9obCwgZHVtbXlf eCwgbGFzdF94KTsKKyAgICAgICAgICBmb3IgKHMgPSBoOyBzOyBzID0gcy0+bmV4dCkKKyAgICAg ICAgICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVlOworICAgICAgICAgIGNvbXB1dGVf b3ZlcmhhbmdzX2FuZF94ICh0LCBoZWFkLT54LCB0cnVlKTsKKyAgICAgICAgICBwcmVwZW5kX2ds eXBoX3N0cmluZ19saXN0cyAoJmhlYWQsICZ0YWlsLCBoLCB0KTsKKyAgICAgICAgfQorICAgICAg LyogQXBwZW5kIGdseXBocyBzdHJpbmdzIGZvciBnbHlwaHMgZm9sbG93aW5nIHRoZSBsYXN0IGds eXBoCisgICAgICBzdHJpbmcgdGFpbCB0aGF0IGFyZSBvdmVyd3JpdHRlbiBieSB0YWlsLiAgVGhl IGJhY2tncm91bmQgb2YKKyAgICAgIHRoZXNlIHN0cmluZ3MgaGFzIHRvIGJlIGRyYXduIGJlY2F1 c2UgdGFpbCdzIGZvcmVncm91bmQgZHJhd3MKKyAgICAgIG92ZXIgaXQuICovCisgICAgICBpID0g cmlnaHRfb3ZlcndyaXR0ZW4gKHRhaWwpOworICAgICAgaWYgKGkgPj0gMCkKKyAgICAgICAgewor ICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBvdmVybGFwX2hsOworICAgICAgICAgIGlm IChjaGVja19tb3VzZV9mYWNlCisgICAgICAgICAgICAgICYmIG1vdXNlX2JlZ19jb2wgPCBpICYm IG1vdXNlX2VuZF9jb2wgPiBlbmQpCisgICAgICAgICAgICBvdmVybGFwX2hsID0gRFJBV19NT1VT RV9GQUNFOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBvdmVybGFwX2hsID0gRFJB V19OT1JNQUxfVEVYVDsKKyAgICAgICAgICBpZiAoaGwgIT0gb3ZlcmxhcF9obCkKKyAgICAgICAg ICAgIGNsaXBfdGFpbCA9IHRhaWw7CisgICAgICAgICAgTUNfQlVJTERfR0xZUEhfU1RSSU5HUyAo ZW5kLCBpLCBoLCB0LCBvdmVybGFwX2hsLCB4LCBsYXN0X3gpOworICAgICAg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X2VuZF9jb2wgPiBlbmQpCisgICAg ICAgICAgICBvdmVybGFwX2hsID0gRFJBV19NT1VTRV9GQUNFOworICAgICAgICAgICAgZWxzZQor ICAgICAgICAgICAgICBvdmVybGFwX2hsID0gRFJBV19OT1JNQUxfVEVYVDsKKyAgICAgICAgICBp ZiAoaGwgPT0gb3ZlcmxhcF9obCB8fCBjbGlwX3RhaWwgPT0gTlVMTCkKKyAgICAgICAgICAgIGNs aXBfdGFpbCA9IHRhaWw7CisgICAgICAgICAgaSsrOyAgICAgIC8qIFdlIG11c3QgaW5jbHVkZSB0 aGUgSXRoIGdseXBoLiAqLworICAgICAgICAgIE1DX0JVSUxEX0dMWVBIX1NUUklOR1MgKGVuZCwg aSwgaCwgdCwgb3ZlcmxhcF9obCwgeCwgbGFzdF94KTsKKyAgICAgICAgICBmb3IgKHMgPSBoOyBz OyBzID0gcy0+bmV4dCkKKyAgICAgICAgICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVl OworICAgICAgICAgIGNvbXB1dGVfb3ZlcmhhbmdzX2FuZF94IChoLCB0YWlsLT54ICsgdGFpbC0+ d2lkdGgsIGZhbHNlKTsKKyAgICAgICAgICBhcHBlbmRfZ2x5cGhfc3RyaW5nX2xpc3RzICgmaGVh ZCwgJnRhaWwsIGgsIHQpOworICAgICAgICB9CisgICAgICB0YWlsID0gZ2x5cGhfc3RyaW5nX2Nv bnRhaW5pbmdfYmFja2dyb3VuZF93aWR0aCAodGFpbCk7CisgICAgICBpZiAoY2xpcF90YWlsKQor ICAgICAgICBjbGlwX3RhaWwgPSBnbHlwaF9zdHJpbmdfY29udGFpbmluZ19iYWNrZ3JvdW5kX3dp ZHRoIChjbGlwX3RhaWwpOworICAgICAgaWYgKGNsaXBfaGVhZCB8fCBjbGlwX3RhaWwpCisgICAg ICAgIGZvciAocyA9IGhlYWQ7IHM7IHMgPSBzLT5uZXh0KQorICAgICAgICAgIHsKKyAgICAgICAg ICAgIHMtPmNsaXBfaGVhZCA9IGNsaXBfaGVhZDsKKyAgICAgICAgICAgIHMtPmNsaXBfdGFpbCA9 IGNsaXBfdGFpbDsKKyAgICAgICAgICB9CisgICAgfQorICAvKiBEcmF3IGFsbCBzdHJpbmdzLiAq LworICBmb3IgKHMgPSBoZWFkOyBzICYmIGRyYXdfcDsgcyA9IHMtPm5leHQpCisgICAgRlJBTUVf UklGIChmKS0+bWNfc2NyaWJlX3N0cmluZyAocywgbWF0cml4LCByb3csIG1jX21hdHJpeCwgbHNs LCBnbHlwaF9mbGF2b3IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vy c29yX3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOworI2lmbmRlZiBIQVZFX05TCisg IC8qIFdoZW4gZm9jdXMgYSBzb2xlIGZyYW1lIGFuZCBtb3ZlIGhvcml6b250YWxseSwgdGhpcyBj bGVhcnMgb25fcAorICAgICBjYXVzaW5nIGEgZmFpbHVyZSB0byBlcmFzZSBwcmV2IGN1cnNvciBw b3NpdGlvbi4gKi8KKyAgaWYgKGFyZWEgPT0gVEVYVF9BUkVBCisgICAgICAmJiAhcm93LT5mdWxs X3dpZHRoX3AKKyAgICAgIC8qIFdoZW4gZHJhd2luZyBvdmVybGFwcGluZyByb3dzLCBvbmx5IHRo ZSBnbHlwaCBzdHJpbmdzJworICAgICAgZm9yZWdyb3VuZCBpcyBkcmF3biwgd2hpY2ggZG9lc24n dCBlcmFzZSBhIGN1cnNvciBjb21wbGV0ZWx5LiAqLworICAgICAgJiYgIW92ZXJsYXBzKQorICAg IHsKKyAgICAgIGludCB4MCA9IGNsaXBfaGVhZCA/IGNsaXBfaGVhZC0+eCA6IChoZWFkID8gaGVh ZC0+eCA6IHgpOworICAgICAgaW50IHgxID0gKGNsaXBfdGFpbCA/IGNsaXBfdGFpbC0+eCArIGNs aXBfdGFpbC0+YmFja2dyb3VuZF93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICA6ICh0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XJzb3I6 ICByZXR1cm4gKCVkKVxuIiwgMik7CisgICAgICByZXR1cm47CisgICAgfQorICAvKiBJZiByb3cg Y29udGFpbmluZyBjdXJzb3IgaXMgbWFya2VkIGludmFsaWQsIHRoZXJlIGlzIG5vdGhpbmcgd2UK KyAgICAgY2FuIGRvLiAqLworICBpZiAoIXJvdy0+ZW5hYmxlZF9wKQorICAgIHsKKyAgICAgIGlm IChkZWJ1Z19wKQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6ICBy ZXR1cm4gKCVkKVxuIiwgMyk7CisgICAgICByZXR1cm47CisgICAgfQorICAvKiBJZiBsaW5lIHNw YWNpbmcgaXMgPiAwLCBvbGQgY3Vyc29yIG1heSBvbmx5IGJlIHBhcnRpYWxseSB2aXNpYmxlIGlu CisgICAgIHdpbmRvdyBhZnRlciBzcGxpdC13aW5kb3cuICBTbyBhZGp1c3QgdmlzaWJsZSBoZWln aHQuICovCisgIHJvdy0+dmlzaWJsZV9oZWlnaHQgPSBtaW4gKHJvdy0+dmlzaWJsZV9oZWlnaHQs CisgICAgICAgICAgICB3aW5kb3dfdGV4dF9ib3R0b21feSAodykgLSByb3ctPnkpOworICAvKiBJ ZiByb3cgaXMgY29tcGxldGVseSBpbnZpc2libGUsIGRvbid0IGF0dGVtcHQgdG8gZGVsZXRlIGEg Y3Vyc29yIHdoaWNoCisgICAgIGlzbid0IHRoZXJlLiAgVGhpcyBjYW4gaGFwcGVuIGlmIGN1cnNv ciBpcyBhdCB0b3Agb2YgYSB3aW5kb3csIGFuZAorICAgICB3ZSBzd2l0Y2ggdG8gYSBidWZmZXIg d2l0aCBhIGhlYWRlciBsaW5lIGluIHRoYXQgd2luZG93LiAqLworICBpZiAocm93LT52aXNpYmxl X2hlaWdodCA8PSAwKQorICAgIHsKKyAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICBmcHJpbnRm IChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6ICByZXR1cm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ICAvKiBNYXliZSBjbGVhciB0aGUg ZGlzcGxheSB1bmRlciB0aGUgY3Vyc29yLiAqLworICBpZiAoY3Vyc29yX3R5cGUgPT0gTUNfSE9M TE9XX0JPWAorICAgICAgfHwgY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWCkKKyAgICB7Cisg ICAgICBpbnQgdGVtcF94ID0geDsKKyAgICAgIGludCBoZWFkZXJfbGluZV9oZWlnaHQgPSBXSU5E T1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgICAgIGN1cnNvcl9nbHlwaCA9IG1jX2dldF9j dXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBocG9zLCB2cG9zKTsKKyAgICAgIGlmIChjdXJz b3JfZ2x5cGggPT0gTlVMTCkKKyAgICAgICAgeworICAgICAgICAgIGlmIChkZWJ1Z19wKQorICAg ICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZXJhc2VfY3Vyc29yOiAgcmV0dXJuICglZClc biIsIDcpOworICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgaW50IHRlbXBfd2Qg PSBjdXJzb3JfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgaWYgKHRlbXBfeCA8IDApCisgICAg ICAgIHsKKyAgICAgICAgICB0ZW1wX3dkICs9IHRlbXBfeDsKKyAgICAgICAgICB0ZW1wX3ggPSAw OworICAgICAgICB9CisgICAgICB0ZW1wX3dkID0gbWluICh3ZCwgd2luZG93X2JveF93aWR0aCAo dywgVEVYVF9BUkVBKSAtIHRlbXBfeCk7CisgICAgICBpbnQgZnkgPSBXSU5ET1dfVE9fRlJBTUVf UElYRUxfWSAodywgbWF4IChoZWFkZXJfbGluZV9oZWlnaHQsIHJvdy0+eSkpOworICAgICAgaW50 IGZ4ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgdGVtcF94KTsKKyAgICAgIGlm ICh0ZW1wX3dkID4gMCkKKyAgICAgICA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8IG1hdHJpeC0+bnJvd3MpID8gZmFsc2UgOiB0 cnVlOworICBpZiAoYmFyZl9jcmFzaF90d28pCisgICAgcmV0dXJuOworICBpZiAoeCA8IDAKKyAg ICAgIHx8IHkgPCAwCisgICAgICB8fCBocG9zIDwgMAorICAgICAgfHwgdnBvcyA8IDApCisgICAg cmV0dXJuOworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgYm9vbCBh dXRvX2hzY3JvbGxfbW9kZV9wID0gRVEgKEZidWZmZXJfbG9jYWxfdmFsdWUgKFFhdXRvX2hzY3Jv bGxfbW9kZSwgdy0+Y29udGVudHMpLCBRY3VycmVudF9saW5lKTsKKyAgLyogRVhBTVBMRTogIChz Y3JvbGwtbGVmdCA1KSAqLworICBib29sIGhzY2xfYWxsX3RlbXBfcCA9ICh3LT5zdXNwZW5kX2F1 dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9k ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IDApOworICAvKiBFWEFNUExF OiAgQy11IEMteCA8IGFuZCBkbyBub3RoaW5nLiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMF9w ID0gKHctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHct PmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3Jv bGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0g dy0+aHNjcm9sbCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIHNvbWV0aGluZyBl bHNlIGJlc2lkZXMgaG9yaXpvbnRhbGx5IHNjcm9sbGluZyB0aGUKKyAgICAgICAgICAgICAgIGN1 cnJlbnQgbGluZSBkaWZmZXJlbnRseS4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBpcyBf bm90XyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9h bGxfcGVybV8xX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg dy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWlu X2hzY3JvbGwgPT0gdy0+aHNjcm9sbCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIC4u LgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIGlzIF9ub3RfIGhvcml6b250YWxseSBzY3Jv bGxlZCBkaWZmZXJlbnRseS4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzJfcCA9ICghdy0+c3Vz cGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hz Y3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA9 PSAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgIT0gdy0+aHNjcm9s bCk7CisgIC8qIEVYQU1QTEU6ICAoc2Nyb2xsLWxlZnQgNSk7IGFuZCwgdGhlbiBwcmVzcyB0aGUg bGVmdCBhcnJvdyBrZXkgb25lIHRpbWUuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lz XyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuKi8KKyAgYm9vbCBoc2NsX3RlbXBf cCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAmJiBh dXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+ IDAKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyog RVhBTVBMRTogIEMtdSBDLXggPCBhbmQgZG8gc29tZXRoaW5nIHRoYXQgY2F1c2VzIHRoZSBjdXJy ZW50IGxpbmUgdG8gYmUKKyAgICAgICAgICAgICAgIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZm ZXJlbnRseS4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBfaXNfIGhvcml6b250YWxseSBz Y3JvbGxlZCBkaWZmZXJlbnRseS4gKi8KKyAgYm9vbCBoc2NsX3Blcm1fcCA9ICghdy0+c3VzcGVu ZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9k ZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAm JiB3LT5taW5faHNjcm9sbCAhPSB3LT5oc2Nyb2xsKTsKKyAgaW50IGZyaW5nZV9iaXRtYXAgPSBN Q19OT19GUklOR0VfQklUTUFQOworICBpbnQgZmFjZV9pZCA9IERFRkFVTFRfRkFDRV9JRDsKKyAg aWYgKCFyZW1vdmVfcAorICAgIC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Ky1vdmVy bGF5LWFycm93IiksIGZhbHNlLCB0cnVlKTsKKyAgICAgICAgZWxzZQorICAgICAgICAgIGZyaW5n ZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1vdmVybGF5LWFy cm93IiksIHRydWUsIHRydWUpOworICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vy c29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IGZyaW5nZV9iaXRtYXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9mYWNlX2lk ID0gZmFjZV9pZDsKKyAgICAgIHJvdy0+bGVmdF9mcmluZ2Vfb2Zmc2V0ID0gMDsKKyAgICAgIHJv dy0+ZnJpbmdlX2JpdG1hcF9wZXJpb2RpY19wID0gZmFsc2U7CisgICAgfQorICAgIGVsc2UgaWYg KCFyZW1vdmVfcAorICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciA9PSBNQ19PVkVSTEFZX0FS Uk9XX0JJVE1BUAorICAgICAgICAgICAgICYmIChoc2NsX2FsbF90ZW1wX3AKKyAgICAgICAgICAg ICAgICAgfHwgaHNjbF9hbGxfcGVybV8wX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxf cGVybV8xX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8yX3AKKyAgICAgICAg ICAgICAgICAgfHwgaHNjbF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgfHwgaHNjbF9wZXJtX3Ap KQorICAgICAgeworICAgICAgICBlbnVtIGZhY2VfaWQgb3ZlcmxheV9hcnJvd19mYWNlX2lkID0K KyAgICAgICAgICAoIWFjdGl2ZV9wCisgICAgICAgICAgICYmICFOSUxQIChCVk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bC1wZXJtIiksIGZhbHNlLCB0cnVlKTsKKyAgICAgICAg ICAgICAgZWxzZSBpZiAoaHNjbF9wZXJtX3ApCisgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1h cCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCB0cnVl LCB0cnVlKTsKKyAgICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX2FsbF90ZW1wX3ApCisgICAg ICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGlu dGVybiAoIistaHNjbC10ZW1wIiksIGZhbHNlLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICBl bHNlIGlmIChoc2NsX3RlbXBfcCkKKyAgICAgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9 IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtdGVtcCIpLCB0cnVlLCBm YWxzZSk7CisgICAgICAgIHJvdy0+bGVmdF9mcmluZ2VfYml0bWFwID0gKGN1cnNvcl90eXBlID09 IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IGZyaW5nZV9iaXRtYXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1D X05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgIHJvdy0+bGVmdF9mcmluZ2VfZmFjZV9pZCA9IGZh Y2VfaWQ7CisgICAgICAgIHJvdy0+bGVmdF9mcmluZ2Vfb2Zmc2V0ID0gMDsKKyAgICAgICAgcm93 LT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3AgPSBmYWxzZTsKKyAgICAgIH0KKyAgICAgIGVsc2Ug aWYgKCFyZW1vdmVfcAorICAgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xM T1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxh dm9yID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAg ICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRQorICAgICAg ICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJS T1cKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVS VElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9y ID09IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9 PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9m bGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSCkpCisgICAgICAgIHsKKyAgICAgICAg ICBMaXNwX09iamVjdCBiaXRtYXBfZmxhdm9yID0gKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1df UkVDVEFOR0xFX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xM T1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gUW1jX3JldmVyc2VkX2hvbGxvd19yZWN0YW5nbGVfcmlnaHRfYXJyb3cKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1D X0hPTExPV19SRUNUQU5HTEUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBRbWNfaG9sbG93X3JlY3RhbmdsZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jh cl9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChn bHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX3ZlcnRp Y2FsX2Jhcl9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2JhcgorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVS VElDQUxfQkFSKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1j X3JldmVyc2VkX3ZlcnRpY2FsX2JhcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXJfYmFj a3NsYXNoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogUW5pbDsKKyAg ICAgICAgICBmcmluZ2VfYml0bWFwID0gKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9C SVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAgID8gbG9va3VwX2ZyaW5nZV9iaXRtYXAg KGJpdG1hcF9mbGF2b3IpCisgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJTkdF X0JJVE1BUDsKKyAgICAgICAgICBmYWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZS SU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNf UkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAg ICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRf QVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVW RVJTRURfVkVSVElDQUxfQkFSKSkKKyAgICAgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9kZXJp dmVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmV2ZXJzZWQtYmFyLXByZS16di1mYWNlIiksIEZS SU5HRV9GQUNFX0lELCB0cnVlKQorICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9 PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBo X2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAg ICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNB TF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9y ICE9IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgICAgICA/IGxv b2t1cF9kZXJpdmVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistYmFyLXByZS16di1mYWNlIiksIEZS SU5HRV9GQUNFX0lELCB0cnVlKQorICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9J RDsKKyAgICAgICAgICByb3ctPmN1cnNvcl9pbl9mcmluZ2VfcCA9IGZhbHNlOworICAgICAgICAg IHJvdy0+cmlnaHRfZnJpbmdlX2JpdG1hcCA9IGZyaW5nZV9iaXRtYXA7CisgICAgICAgICAgcm93 LT5yaWdodF9mcmluZ2VfZmFjZV9pZCA9IGZhY2VfaWQ7CisgICAgICAgICAgcm93LT5yaWdodF9m cmluZ2Vfb2Zmc2V0ID0gMDsKKyAgICAgICAgICByb3ctPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNf cCA9IGZhbHNlOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKGdseXBoX2ZsYXZvciA9PSBN Q19HTFlQSAorICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEhMRVNT KQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgb25fcCA9IHRydWU7CisgICAgICAgICAg ICBGUkFNRV9SSUYgKGYpLT5tY19zY3JpYmVfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngs IHksIGZ5LCBocG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgdnBvcywgd2QsIGgsIGxzbCwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIGdseXB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AgICAgIDogJ0cnKSwKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3Ms CisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAgICAg ICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAg ICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgID8gJzAnCisgICAg ICAgICAgICAgICA6ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAg ICBnbHlwaC0+dS5jaCwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5s ZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAg ICBnbHlwaC0+aHBvcywgZ2x5cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICBtY19jaGFy X3RvX3N0cmluZyAoZ2x5cGgtPnUuY2gpKTsKKyAgICB9CisgIGVsc2UgaWYgKGdseXBoLT50eXBl ID09IFNUUkVUQ0hfR0xZUEgpCisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAg ICAiICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUx LjFkICAlM2QgJXMgJXNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVB XSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFd IC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdTJywKKyAgICAgICAgZ2x5cGgt PmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAg PyAnQicKKyAgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAg PyAnUycKKyAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAn MCcKKyAgICAgICAgICA6ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAg ICAgICAwdSwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2Jv eF9saW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlw aC0+aHBvcywgZ2x5cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAiXFxTIik7CisgICAg fQorICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkKKyAgICB7CisgICAgICBm cHJpbnRmIChzdGRlcnIsCisgICAgICAgICIgJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVj ICUzZCAweCUwNnggJTRkICUxLjFkJTEuMWQgICUzZCAlcyAlY1xuIiwKKyAgICAgICAgZ2x5cGgg LSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAw KSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAg ICAgJ0knLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBo LT5vYmplY3QpCisgICAgICAgICAgICA/ICdCJworICAgICAgICAgIDogKFNUUklOR1AgKGdseXBo LT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5v YmplY3QpCisgICAgICAgICAgICA/ICcwJworICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBn bHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgICh1bnNpZ25lZCBpbnQpIGdseXBoLT51LmltZ19p ZCwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5l X3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+aHBv cywgZ2x5cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAnLicpOworICAgIH0KKyAgZWxz ZSBpZiAoZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmlu dGYgKHN0ZGVyciwKKyAgICAgICAgIiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNk IDB4JTA2eCIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAg ICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisg ICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICcrJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3Ms CisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnQicKKyAg ICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAg ICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnMCcKKyAgICAg ICAgICA6ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAgICAodW5z aWduZWQgaW50KSBnbHlwaC0+dS5jbXAuaWQpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICU0 ZCAlMS4xZCUxLjFkIiwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5s ZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wKTsKKyAgICAg IGlmIChnbHlwaC0+dS5jbXAuYXV0b21hdGljKQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICIg ICUzZCAlcyAuIFslZC0lZF1cbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGgtPmhw b3MsIGdseXBoX3p2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBn bHlwaC0+c2xpY2UuY21wLmZyb20sIGdseXBoLT5zbGljZS5jbXAudG8pOworICAgICAgICBlbHNl CisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIlxuIik7CisgICAgfQorICBlbHNlIGlmIChnbHlw aC0+dHlwZSA9PSBYV0lER0VUX0dMWVBIKQorICAgIHsKKyNpZm5kZWYgSEFWRV9YV0lER0VUUwor ICAgICAgZWFzc3VtZSAoZmFsc2UpOworI2Vsc2UKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAg ICAgICAgIiAgJTVkLyUtNWQgJTVkICU0YyAlNmQgJWMgJTNkIDB4JTA1eCAlNGQgJTEuMWQlMS4x ZCAgJTNkICVzICVjXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0s CisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAt IDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAnWCcsCisgICAgICAgIGdseXBoLT5j aGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgPyAn QicKKyAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdT JworICAgICAgICAgOiAnLScpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAg ICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAg ICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT51Lnh3aWRnZXQsCisg ICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcu Jyk7CisjZW5kaWYKKyAgICB9Cit9CisKKy8qIER1bXAgdGhlIGNvbnRlbnRzIG9mIGdseXBoIHJv dyBhdCBWUE9TIGluIE1BVFJJWCB0byBzdGRlcnIuCisgICBHTFlQSFMgMCBtZWFucyBkb24ndCBz aG93IGdseXBoIGNvbnRlbnRzLgorICAgR0xZUEhTIDEgbWVhbnMgc2hvdyBnbHlwaHMgaW4gc2hv cnQgZm9ybQorICAgR0xZUEhTID4gMSBtZWFucyBzaG93IGdseXBocyBpbiBsb25nIGZvcm0uICov Cit2b2lkCittY19kdW1wX2dseXBoX3JvdyAoc3RydWN0IGdseXBoX3JvdyAqcm93LCBpbnQgdnBv cywgaW50IGdseXBocykKK3sKKyAgaW50IHJlbGF0aXZlX3ggPSAwOworICBpZiAoZ2x5cGhzICE9 IDEpCisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiXG5EVU1QIEdMWVBIIFJPV1xuIik7 CisgICAgICBmcHJpbnRmIChzdGRlcnIsICJSb3cgICAgIFN0YXJ0ICAgICAgIEVuZCBVc2VkIG9F PjxcXENUWkZlc20gICAgIFggICAgWSAgICBXICAgIEggICAgViAgICBBICAgIFBcbiIpOworICAg ICAgZnByaW50ZiAoc3RkZXJyLCAiPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4iKTsKKyAgICAgIGZw cmludGYgKHN0ZGVyciwgIiUzZCAlOSJwRCJkICU5InBEImQgJTRkICUxLjFkJTEuMWQlMS4xZCUx LjFkXAorJTEuMWQlMS4xZCUxLjFkJTEuMWQlMS4xZCUxLjFkJTEuMWQlMS4xZCAgJTRkICU0ZCAl NGQgJTRkICU0ZCAlNGQgJTRkXG4iLAorICAgICAgICAgdnBvcywKKyAgICAgICAgIE1BVFJJWF9S T1dfU1RBUlRfQ0hBUlBPUyAocm93KSwKKyAgICAgICAgIE1BVFJJWF9ST1dfRU5EX0NIQVJQT1Mg KHJvdyksCisgICAgICAgICByb3ctPnVzZWRbVEVYVF9BUkVBXSwKKyAgICAgICAgIHJvdy0+Y29u dGFpbnNfb3ZlcmxhcHBpbmdfZ2x5cGhzX3AsCisgICAgICAgICByb3ctPmVuYWJsZWRfcCwKKyAg ICAgICAgIHJvdy0+dHJ1bmNhdGVkX29uX2xlZnRfcCwKKyAgICAgICAgIHJvdy0+dHJ1bmNhdGVk X29uX3JpZ2h0X3AsCisgICAgICAgICByb3ctPmNvbnRpbnVlZF9wLAorICAgICAgICAgTUFUUklY X1JPV19DT05USU5VQVRJT05fTElORV9QIChyb3cpLAorICAgICAgICAgTUFUUklYX1JPV19ESVNQ TEFZU19URVhUX1AgKHJvdyksCisgICAgICAgICByb3ctPmVuZHNfYXRfenZfcCwKKyAgICAgICAg IHJvdy0+ZmlsbF9saW5lX3AsCisgICAgICAgICByb3ctPmVuZHNfaW5fbWlkZGxlX29mX2NoYXJf cCwKKyAgICAgICAgIHJvdy0+c3RhcnRzX2luX21pZGRsZV9vZl9jaGFyX3AsCisgICAgICAgICBy b3ctPm1vdXNlX2ZhY2VfcCwKKyAgICAgICAgIHJvdy0+eCwKKyAgICAgICAgIHJvdy0+eSwKKyAg ICAgICAgIHJvdy0+cGl4ZWxfd2lkdGgsCisgICAgICAgICByb3ctPmhlaWdodCwKKyAgICAgICAg IHJvdy0+dmlzaWJsZV9oZWlnaHQsCisgICAgICAgICByb3ctPmFzY2VudCwKKyAgICAgICAgIHJv dy0+cGh5c19hc2NlbnQpOworICAgICAgLyogVGhlIG5leHQgMyBsaW5lcyBzaG91bGQgYWxpZ24g dG8gIlN0YXJ0IiBpbiB0aGUgaGVhZGVyLiAqLworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICAg ICU5InBEImQgJTkicEQiZFx0JTVkXG4iLCByb3ctPnN0YXJ0Lm92ZXJsYXlfc3RyaW5nX2luZGV4 LAorICAgICAgICAgcm93LT5lbmQub3ZlcmxheV9zdHJpbmdfaW5kZXgsCisgICAgICAgICByb3ct PmNvbnRpbnVhdGlvbl9saW5lc193aWR0aCk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgICAg JTkicEQiZCAlOSJwRCJkXG4iLAorICAgICAgICAgQ0hBUlBPUyAocm93LT5zdGFydC5zdHJpbmdf cG9zKSwKKyAgICAgICAgIENIQVJQT1MgKHJvdy0+ZW5kLnN0cmluZ19wb3MpKTsKKyAgICAgIGZw cmludGYgKHN0ZGVyciwgIiAgICAlOWQgJTlkXG4iLCByb3ctPnN0YXJ0LmRwdmVjX2luZGV4LAor ICAgICAgICAgcm93LT5lbmQuZHB2ZWNfaW5kZXgpOworICAgIH0KKyAgaWYgKGdseXBocyA+IDEp CisgICAgeworICAgICAgZm9yIChpbnQgYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFyZWEgPCBM QVNUX0FSRUE7ICsrYXJlYSkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5 cGggPSByb3ctPmdseXBoc1thcmVhXTsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoX2Vu ZCA9IGdseXBoICsgcm93LT51c2VkW2FyZWFdOworICAgICAgICAgIC8qIEdseXBoIGZvciBhIGxp bmUgZW5kIGluIHRleHQuICovCisgICAgICAgICAgaWYgKGFyZWEgPT0gVEVYVF9BUkVBICYmIGds eXBoID09IGdseXBoX2VuZCAmJiBnbHlwaC0+Y2hhcnBvcyA+IDApCisgICAgICAgICAgICArK2ds eXBoX2VuZDsKKyAgICAgICAgICBpZiAoZ2x5cGggPCBnbHlwaF9lbmQpCisgICAgICAgICAgICBm cHJpbnRmIChzdGRlcnIsICJHbHlwaCMvVG90YWwgUmVsLlggVCAgICAgICBQb3MgTyAgIFcgICAg IENvZGUgRmFjZSBMUiBIUE9TIFpWIENcbiIpOworICAgICAgICAgIGZvciAoOyBnbHlwaCA8IGds eXBoX2VuZDsgKytnbHlwaCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbWNfZHVtcF9n bHlwaCAocm93LCBnbHlwaCwgYXJlYSwgcmVsYXRpdmVfeCwgdnBvcyk7CisgICAgICAgICAgICAg IHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgfQorICAgICAg ICB9CisgICAgfQorICAgIGVsc2UgaWYgKGdseXBocyA9PSAxKQorICAgICAgeworICAgICAgICBj aGFyIHNbU0hSVF9NQVggKyA0XTsKKyAgICAgICAgZm9yIChpbnQgYXJlYSA9IExFRlRfTUFSR0lO X0FSRUE7IGFyZWEgPCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAgICAgICAgICB7CisgICAgICAgICAg ICBpbnQgaTsKKyAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCByb3ctPnVzZWRbYXJlYV07ICsr aSkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGgg PSByb3ctPmdseXBoc1thcmVhXSArIGk7CisgICAgICAgICAgICAgICAgaWYgKGkgPT0gcm93LT51 c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAmJiBhcmVhID09IFRFWFRfQVJFQQor ICAgICAgICAgICAgICAgICAgICAmJiBOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAg ICAgICAgICAmJiBnbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAgICAgICAgICAgICAg ICYmIGdseXBoLT51LmNoID09ICcgJykKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICAgICAgc3RyY3B5ICgmc1tpXSwgIltcXG5dIik7CisgICAgICAgICAgICAgICAgICAgIGkg Kz0gNDsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGds eXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGds eXBoLT51LmNoIDwgMHg4MAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGgtPnUu Y2ggPj0gJyAnKQorICAgICAgICAgICAgICAgICAgICBzW2ldID0gZ2x5cGgtPnUuY2g7CisgICAg ICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICBzW2ldID0gJy4nOwor ICAgICAgICAgICAgICB9CisgICAgICAgICAgICBzW2ldID0gJ1wwJzsKKyAgICAgICAgICAgIGZw cmludGYgKHN0ZGVyciwgIiUzZDogKCVkKSAnJXMnXG4iLCB2cG9zLCByb3ctPmVuYWJsZWRfcCwg cyk7CisgICAgICAgICAgfQorICAgICAgfQorfQorCitERUZVTiAoIm1jLWR1bXAtZ2x5cGgtcm93 IiwgRm1jX2R1bXBfZ2x5cGhfcm93LCBTbWNfZHVtcF9nbHlwaF9yb3csIDEsIDIsICJQIiwKKyAg ICAgICBkb2M6IC8qIER1bXAgZ2x5cGggcm93IFJPVyB0byBzdGRlcnIuCitJbnRlcmFjdGl2ZWx5 LCBST1cgaXMgdGhlIHByZWZpeCBudW1lcmljIGFyZ3VtZW50IGFuZCBkZWZhdWx0cyB0bwordGhl IHJvdyB3aGljaCBkaXNwbGF5cyBwb2ludC4KK09wdGlvbmFsIGFyZ3VtZW50IEdMWVBIUyAwIG1l YW5zIGRvbid0IGR1bXAgZ2x5cGhzLgorR0xZUEhTIDEgbWVhbnMgZHVtcCBnbHlwaHMgaW4gc2hv cnQgZm9ybS4KK0dMWVBIUyA+IDEgb3Igb21pdHRlZCBtZWFucyBkdW1wIGdseXBocyBpbiBsb25n IGZvcm0uICAqLykKKyAgKExpc3BfT2JqZWN0IHJvdywgTGlzcF9PYmplY3QgZ2x5cGhzKQorewor ICBzdHJ1Y3Qgd2luZG93ICp3ID0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93KTsKKyAgc3RydWN0 IGdseXBoX21hdHJpeCAqbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgIEVNQUNTX0lOVCB2 cG9zOworICBpZiAoTklMUCAocm93KSkKKyAgICB7CisgICAgICBpbnQgZDEsIGQyLCBkMywgZDQs IGQ1LCB5cG9zOworICAgICAgYm9vbCB2aXNpYmxlX3AgPSBwb3NfdmlzaWJsZV9wICh3LCBQVCwg JmQxLCAmZDIsICZkMywgJmQ0LCAmZDUsICZ5cG9zKTsKKyAgICAgIGludCBoZWFkZXJfbGluZV9o ZWlnaHQgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgICAgIGludCB2b2Zmc2V0 ID0gKGhlYWRlcl9saW5lX2hlaWdodCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICYmIHlwb3Mg PiAwKQorICAgICAgICAgICAgICAgICAgICAgID8geXBvcyArIDEKKyAgICAgICAgICAgICAgICAg ICAgICA6IHlwb3M7CisgICAgICBpZiAodmlzaWJsZV9wKQorICAgICAgICB2cG9zID0gdm9mZnNl dDsKKyAgICAgICAgZWxzZQorICAgICAgICAgIHZwb3MgPSAwOworICAgIH0KKyAgICBlbHNlCisg ICAgICB7CisgICAgICAgIENIRUNLX05VTUJFUiAocm93KTsKKyAgICAgICAgdnBvcyA9IFhGSVhO VU0gKHJvdyk7CisgICAgICB9CisgIGlmICh2cG9zID49IDAgJiYgdnBvcyA8IG1hdHJpeC0+bnJv d3MpCisgICAgbWNfZHVtcF9nbHlwaF9yb3cgKE1BVFJJWF9ST1cgKG1hdHJpeCwgdnBvcyksCisg ICAgICAgIHZwb3MsCisgICAgICAgIFRZUEVfUkFOR0VEX0ZJWE5VTVAgKGludCwgZ2x5cGhzKSA/ IFhGSVhOVU0gKGdseXBoc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mcHJpbnRmIChzdGRlcnIs ICJQVCA9ICUicEQiZCwgQkVHViA9ICUicEQiZC4gWlYgPSAlInBEImRcbiIsCisgICAgIEJVRl9Q VCAoYnVmZmVyKSwgQlVGX0JFR1YgKGJ1ZmZlciksIEJVRl9aViAoYnVmZmVyKSk7CisgIGZwcmlu dGYgKHN0ZGVyciwgIkN1cnNvciB4ID0gJWQsIHkgPSAlZCwgaHBvcyA9ICVkLCB2cG9zID0gJWRc biIsCisgICAgIHctPmN1cnNvci54LCB3LT5jdXJzb3IueSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1 cnNvci52cG9zKTsKKyAgZnByaW50ZiAoc3RkZXJyLCAiPT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09XG4iKTsKKyAgbWNfZHVtcF9nbHlwaF9tYXRyaXggKHctPmN1 cnJlbnRfbWF0cml4LAorICAgICAgICAgVFlQRV9SQU5HRURfRklYTlVNUCAoaW50LCBnbHlwaHMp ID8gWEZJWE5VTSAoZ2x5cGhzKSA6IDApOworICByZXR1cm4gUW5pbDsKK30KKworYm9vbAorbWNf dHJhdmVyc2VfY2FjaGVfcCAoc3RydWN0IG1jX21hdHJpeCBtYXRyaXgsIGVudW0gbWNfY2FjaGVf dHlwZSBjYWNoZV90eXBlLAorICAgICAgICAgICAgICAgICAgICAgaW50IHZudGgsIGludCBudGgp Cit7CisgIGlmICh2bnRoIDwgbWF0cml4LnZwb3NfdXNlZAorICAgICAgJiYgbWF0cml4LmN1cnNv cnNfdXNlZFtjYWNoZV90eXBlXSA+IDAKKyAgICAgICYmIG50aCA8IG1hdHJpeC52cG9zW3ZudGhd LmNhY2hlX3VzZWRbY2FjaGVfdHlwZV0pCisgICAgcmV0dXJuIHRydWU7CisgICAgZWxzZQorICAg ICAgcmV0dXJuIGZhbHNlOworfQorCit2b2lkCittY19yZXNldF9jYWNoZSAoc3RydWN0IHdpbmRv dyAqdykKK3sKKyAgaWYgKCFCVUZGRVJQICh3LT5jb250ZW50cykpCisgICAgcmV0dXJuOworICBm b3IgKGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7CisgICAgICAgY2Fj aGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICsrY2FjaGVfdHlwZSkKKyAgICB7CisgICAgICBi b29sIGJ2YXJfYWN0aXZlX3A7CisgICAgICBzd2l0Y2ggKGNhY2hlX3R5cGUpCisgICAgICAgIHsK KyAgICAgICAgICBjYXNlIE5PX0NBQ0hFOgorICAgICAgICAgICAgeworICAgICAgICAgICAgICBy ZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgY2FzZSBNQ19DQUNIRToKKyAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAg ICAgICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkp CisgICAgICAgICAgICAgICAgYnZhcl9hY3RpdmVfcCA9IGZhbHNlOworICAgICAgICAgICAgICAg IGVsc2UgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICAgICAg ICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkKKyAgICAg ICAgICAgICAgICAgIGJ2YXJfYWN0aXZlX3AgPSB0cnVlOworICAgICAgICAgICAgICBicmVhazsK KyAgICAgICAgICAgIH0KKyAgICAgICAgICBjYXNlIENIX0NBQ0hFOgorICAgICAgICAgICAgewor ICAgICAgICAgICAgICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAg ICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAg ICAgICAgICAgICAgICBidmFyX2FjdGl2ZV9wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgZWxz ZSBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgICAgICAgJiYg IU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgICAg ICAgICAgICAgICAgYnZhcl9hY3RpdmVfcCA9IHRydWU7CisgICAgICAgICAgICAgIGJyZWFrOwor ICAgICAgICAgICAgfQorICAgICAgICAgIGNhc2UgRkNfQ0FDSEU6CisgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAg ICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpKQorICAg ICAgICAgICAgICAgIGJ2YXJfYWN0aXZlX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBlbHNl IGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiAh TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpCisgICAgICAg ICAgICAgICAgICBidmFyX2FjdGl2ZV9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgYnJlYWs7Cisg ICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGlmICghYnZhcl9hY3RpdmVfcCkKKyAgICAg ICAgeworICAgICAgICAgIC8qIERlY3JlYXNlIHRoZSBzaXplIG9mIHRoZSBhcnJheSB0byBhIGJh cmUgbWluaW11bS4gKi8KKyAgICAgICAgICBmb3IgKGludCB2bnRoID0gMDsgdm50aCA8IHctPm1j X21hdHJpeC52cG9zX3VzZWQ7ICsrdm50aCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg aWYgKHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX2FsbG9jYXRlZFtjYWNoZV90eXBlXSA+ IDEpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV0gPQorICAgICAgICAgICAgICAgICAgICB4bnJlYWxs b2MgKHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdLCAxLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiAqdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV0pOworICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVfYWxsb2NhdGVkW2NhY2hlX3R5cGVdID0gMTsKKyAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVf dHlwZV0gPSAwOworICAgICAgICAgICAgfQorICAgICAgICAgIHctPm1jX21hdHJpeC5jdXJzb3Jz X3VzZWRbY2FjaGVfdHlwZV0gPSAwOworICAgICAgICB9CisgICAgICAgIC8vICBBbHRob3VnaCBp dCB3b3VsZCBub3QgYmUgdmVyeSBlZmZpY2llbnQsIGl0IGlzIHBvc3NpYmxlIHRvIHNldAorICAg ICAgICAvLyAgdGhlIF91c2VkXyBlbGVtZW50cyBvZiB0aGUgYXJyYXkgdG8gemVyby4gIEluIHN1 Y2ggYSBjYXNlLCB0aGUKKyAgICAgICAgLy8gIC4uLl9lbHRzLmFsbG9jYXRlZFtjYWNoZV90eXBl XSB3b3VsZCByZW1haW4gdGhlIHNhbWUuCisgICAgICAgIC8vICBtZW1zZXQgKHctPm1jX21hdHJp eC52cG9zW0BdLmNhY2hlW2NhY2hlX3R5cGVdLCAwLCB3LT5tY19tYXRyaXgudnBvc1tAXS5jYWNo ZV91c2VkW2NhY2hlX3R5cGVdCisgICAgICAgIC8vICAgICAgICAgICogKHNpemVvZiAqdy0+bWNf bWF0cml4LnZw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b24gcm93X3Bvc2l0aW9u LCBzdHJ1Y3QgbWNfUkdCIGZvcmVncm91bmQsCisgICAgICAgICAgIHN0cnVjdCBtY19SR0IgYmFj a2dyb3VuZCwgYm9vbCBhY3RpdmVfcCwgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yLAorICAg ICAgICAgICBib29sIGRyYXdfcCwgZW51bSBtY19kcmF3X3Jvd190eXBlIGZyb21fd2hlcmUsCisg ICAgICAgICAgIGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlLCBlbnVtIG1jX2VuZ2luZV90 eXBlIGFjdGlvbl90eXBlKQoreworICBpbnQgdm50aCA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBt YXRyaXgpOworICBpZiAobWNfc3RkZXJyX3AKKyAgICAgICYmIGRyYXdfcCkKKyAgICB7CisgICAg ICBpbnQgY2hhcnBvcyA9IGdseXBoLT5jaGFycG9zOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAi XG5tY19oZWxwZXIgKCVzKTogIGZyb21fd2hlcmUgKCVzKVxuXAorICBhY3Rpb25fdHlwZSAoJXMp IHwgZmxhdm9yICglcykgfCBjaGFycG9zICglZClcblwKKyAgY2hhciAoJXMpIHwgeCAoJWQpIHwg ZnggKCVkKSB8IHkgKCVkKSB8IGZ5ICglZCkgfCBocG9zICglZC8lZCkgfCB2cG9zICglZClcblwK KyAgd2QgKCVkKSB8IGggKCVkKSB8IGN1cnNvcl90eXBlICglcykgfCBjdXJzb3Jfd2lkdGggKCVk KSB8IGFjdGl2ZV9wICglcylcblwKKyAgRkctUkdCICglZi8lZi8lZikgfCBCRy1SR0IgKCVmLyVm LyVmKVxuIiwKKyAgICAgIG1jX3dpbmRvdyAodyksIG1jX2RyYXdfcm93X3R5cGVfdG9fc3RyaW5n IChmcm9tX3doZXJlKSwKKyAgICAgIG1jX2VuZ2luZV90eXBlX3RvX3N0cmluZyAoYWN0aW9uX3R5 cGUpLCBtY19mbGF2b3JfdG9fc3Ry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udnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLnkgPT0geQorICAgICAgICAgICAgICYmIHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZnkgPT0gZnkKKyAg ICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLmhwb3MgPT0gaHBvcworICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF0udnBvcyA9PSB2cG9zCisgICAgICAgICAgICAgJiYgdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS53ZCA9PSB3ZAorICAg ICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF0uaCA9PSBoCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXS5jdXJzb3JfdHlwZSA9PSBjdXJzb3JfdHlwZQorICAgICAgICAgICAg ICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uY3Vyc29y X3dpZHRoID09IGN1cnNvcl93aWR0aAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZmcucmVkID09IGZvcmVncm91bmQucmVkCisg ICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXS5mZy5ncmVlbiA9PSBmb3JlZ3JvdW5kLmdyZWVuCisgICAgICAgICAgICAgJiYgdy0+bWNf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV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V9wCisgICAgICAgICAgfHwgY3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklU TUFQCisgICAgICAgICAgfHwgY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUCkK KyAgICAgICAgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwg ZnksIGhwb3MsIHZwb3MsIHdkLCBoLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYWN0aXZlX3AsIGdseXBoX2ZsYXZv ciwgcmVtb3ZlX3ApOworICAgICAgcmV0dXJuOworICAgIH0KKyAgICBlbHNlIGlmIChkcmF3X3AK KyAgICAgICAgICAgICAmJiAoZnJvbV93aGVyZSA9PSBTQ1JJQkVfT05FCisgICAgICAgICAgICAg ICAgIHx8IGZyb21fd2hlcmUgPT0gU0NSSUJFX1RXTworICAgICAgICAgICAgICAgICB8fCBmcm9t X3doZXJlID09IFNDUklCRV9USFJFRQorICAgICAgICAgICAgICAgICB8fCBmcm9tX3doZXJlID09 IE5PV0hFUkUpKQorICAgICAgeworICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgbWF0 cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsIGN1cnNvcl90eXBlLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBh Y3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCByZW1vdmVfcCk7CisgICAgICAgIHJldHVybjsKKyAgICAg IH0KKyAgaWYgKGNhY2hlX3R5cGUgPT0gTk9fQ0FDSEUpCisgICAgcmV0dXJuOworICArK3ctPm1j X21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVfdHlwZV07CisgIGlmICh2bnRoID49IHctPm1jX21h dHJpeC52cG9zX3VzZWQpCisgICAgdy0+bWNfbWF0cml4LnZwb3NfdXNlZCA9IHZudGggKyAxOwor ICBpZiAody0+bWNfbWF0cml4LnZwb3NfYWxsb2NhdGVkIDwgdy0+bWNfbWF0cml4LnZwb3NfdXNl ZCkKKyAgICB7CisgICAgICBpbnQgb2xkX2FsbG9jID0gdy0+bWNfbWF0cml4LnZwb3NfYWxsb2Nh dGVkOworICAgICAgaW50IG5ld19lbHRzID0gdy0+bWNfbWF0cml4LnZwb3NfdXNlZCAtIHctPm1j X21hdHJpeC52cG9zX2FsbG9jYXRlZDsKKyAgICAgIHctPm1jX21hdHJpeC52cG9zID0geHBhbGxv YyAody0+bWNfbWF0cml4LnZwb3MsICZ3LT5tY19tYXRyaXgudnBvc19hbGxvY2F0ZWQsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19lbHRzLCBJTlRfTUFYLCBzaXplb2Yg KnctPm1jX21hdHJpeC52cG9zKTsKKyAgICAgIG1lbXNldCAody0+bWNfbWF0cml4LnZwb3MgKyBv bGRfYWxsb2MsIDAsCisgICAgICAgICAgICAgICAody0+bWNfbWF0cml4LnZwb3NfYWxsb2NhdGVk IC0gb2xkX2FsbG9jKSAqIHNpemVvZiAqdy0+bWNfbWF0cml4LnZwb3MpOworICAgIH0KKyAgKyt3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdOworICBpZiAody0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVkW2NhY2hlX3R5cGVdIDwgdy0+bWNf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXSkKKyAgICB7CisgICAgICBp bnQgb2xkX2FsbG9jID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVkW2Nh Y2hlX3R5cGVdOworICAgICAgaW50IG5ld19lbHRzID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVfdXNlZFtjYWNoZV90eXBlXSAtIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX2Fs bG9jYXRlZFtjYWNoZV90eXBlXTsKKyAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdID0geHBhbGxvYyAody0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICZ3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2Fj aGVfdHlwZV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIG5ld19lbHRzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBJTlRfTUFYLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YgKnctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdKTsKKyAgICAgIG1lbXNldCAody0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV0gKyBvbGRfYWxsb2MsIDAsCisgICAgICAg ICAgICAgICAody0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVkW2NhY2hlX3R5 cGVdIC0gb2xkX2FsbG9jKQorICAgICAgICAgICAgICAgICAqIHNpemVvZiAqdy0+bWNfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV0pOworICAgIH0KKyAgaW50IG50aCA9IHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV0gL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SBjb29y ZGluYXRlIGZvciBhIGxldmVsIHJ1bGVyLgorICAgVkVSVElDQUxfUlVMRVIgYW5kIEZJTExfQ09M VU1OOiAgV2Ugd2FudCBhbiBIIHRoYXQgZW5zdXJlcyBubyBnYXAgYmV0d2VlbiB0aGUKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZXZpb3VzL25leHQgbGluZS4gIFRoZSBG WCBjb29yZGluYXRlIGlzIHNldAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ZWxzZXdoZXJlOiAgYHctPmN1cnNvci54YCAvIGBtYy5mY194YC4gKi8KK3ZvaWQKK21jX2dldF9j dXJzb3JfZ2VvbWV0cnkgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1h dHJpeCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgaW50 IHgsIGludCAqZngsIGludCB5LAorICAgICAgICAgICAgICAgICAgICAgICAgaW50ICpmeSwgaW50 IGhwb3MsIGludCB2cG9zLCBpbnQgKmgsCisgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1j X2N1cnNvcl90eXBlIGN1cnNvcl90eXBlLCBpbnQgY3Vyc29yX3dpZHRoLAorICAgICAgICAgICAg ICAgICAgICAgICAgaW50ICp3ZCkKK3sKKyAgc3RydWN0IGdseXBoICpnbHlwaCA9IG1jX2dldF9j dXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBocG9zLCB2cG9zKTsKKyAgaWYgKGdseXBoID09 IE5VTEwpCisgICAgcmV0dXJuOworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19G UkFNRSAodykpOworICAqZnggPSBXSU5ET1dfVEVYVF9UT19GUkFNRV9QSVhFTF9YICh3LCB4KTsK KyAgKmggPSByb3ctPnZpc2libGVfaGVpZ2h0OworICAvKiBEb24ndCBsZXQgdGhlIGN1cnNvciBl eGNlZWQgdGhlIGRpbWVuc2lvbnMgb2YgdGhlIHJvdywgc28gdGhhdAorICB0aGUgdXBwZXIvbG93 ZXIgc2lkZSBvZiB0aGUgYm94IGFyZW4ndCBjbGlwcGVkLiAgKi8KKyAgaW50IHdfaGVhZGVyX2xp bmVfaGVpZ2h0ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgIGludCB3X3RleHRf Ym90dG9tX3kgPSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykgLSAqaDsKKyAgaWYgKHkgPCB3X2hl YWRlcl9saW5lX2hlaWdodCkKKyAgICB7CisgICAgICAqaCA9IG1heCAoKmggLSAod19oZWFkZXJf bGluZV9oZWlnaHQgLSB5KSArIDEsICpoKTsKKyAgICAgIHkgPSB3X2hlYWRlcl9saW5lX2hlaWdo dCAtIDE7CisgICAgICAvLyBmcHJpbnRmIChzdGRlcnIsICJDT05ESVRJT04gIyAxXG4iKTsKKyAg ICB9CisgICBlbHNlIGlmICh5ID4gd190ZXh0X2JvdHRvbV95KQorICAgICB7CisgICAgICAgKmgg Kz0geSAtIHdfdGV4dF9ib3R0b21feTsKKyAgICAgICB5ID0gd190ZXh0X2JvdHRvbV95OworICAg ICAgIC8vIGZwcmludGYgKHN0ZGVyciwgIkNPTkRJVElPTiAjIDJcbiIpOworICAgICB9CisgICpm eSA9IFdJTkRPV19UT19GUkFNRV9QSVhFTF9ZICh3LCB5KTsKKyAgc3dpdGNoIChjdXJzb3JfdHlw ZSkKKyAgICB7CisgICAgICBjYXNlIE1DX0JBUjoKKyAgICAgICAgeworICAgICAgICAgIGlmIChj dXJzb3Jfd2lkdGggPCAxKQorICAgICAgICAgICAgY3Vyc29yX3dpZHRoID0gbWF4IChGUkFNRV9D VVJTT1JfV0lEVEggKGYpLCAxKTsKKyAgICAgICAgICBpZiAoY3Vyc29yX3dpZHRoIDwgZ2x5cGgt PnBpeGVsX3dpZHRoKQorICAgICAgICAgICp3ZCA9IGN1cnNvcl93aWR0aDsKKyAgICAgICAgICBi cmVhazsKKyAgICAgICAgfQorICAgICAgY2FzZSBNQ19IQkFSOgorICAgICAgICB7CisgICAgICAg ICAgaW50IGN1cnNvcl9oZWlnaHQgPSAoY3Vyc29yX3dpZHRoIDwgMSkgPyBscmludCAoMC4yNSAq ICpoKSA6IGN1cnNvcl93aWR0aDsKKyAgICAgICAgICBpZiAoY3Vyc29yX2hlaWdodCA+IHJvdy0+ aGVpZ2h0KQorICAgICAgICAgICAgY3Vyc29yX2hlaWdodCA9IHJvdy0+aGVpZ2h0OworICAgICAg ICAgIC8qIEN1cnNvciBzbWFsbGVyIHRoYW4gbGluZSBoZWlnaHQsIHNvIG1vdmUgZG93bi4gKi8K KyAgICAgICAgICBpZiAoKmggPiBjdXJzb3JfaGVpZ2h0KQorICAgICAgICAgICAgKmZ5ICs9ICpo IC0gY3Vyc29yX2hlaWdodDsKKyAgICAgICAgICAqaCA9IGN1cnNvcl9oZWlnaHQ7CisgICAgICAg ICAgKndkID0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9 CisgICAgICBjYXNlIE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA6CisgICAgICBjYXNlIE1DX0xFRlRf RlJJTkdFX0JJVE1BUDoKKyAgICAgIGNhc2UgTUNfTk9fRlJJTkdFX0JJVE1BUDoKKyAgICAgIGNh c2UgTUNfTk9fQ1VSU09SOgorICAgICAgY2FzZSBNQ19GUkFNRURfQk9YOgorICAgICAgY2FzZSBN Q19GSUxMRURfQk9YOgorICAgICAgY2FzZSBNQ19IT0xMT1dfQk9YOgorICAgICAgZGVmYXVsdDoK KyAgICAgIC8qIENvbXB1dGUgdGhlIHdpZHRoIG9mIHRoZSByZWN0YW5nbGUgdG8gZHJhdy4gIElm IG9uIGEgc3RyZXRjaCBnbHlwaCwgYW5kCisgICAgICBgeC1zdHJldGNoLWN1cnNvcicgaXMgbmls LCBkb24ndCBkcmF3IGEgc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MpOworICBpbnQgdGV4dF9hcmVhX3dpZHRoID0gd2luZG93X2JveF93aWR0 aCAodywgVEVYVF9BUkVBKTsKKyAgc3RydWN0IGdseXBoX3JvdyAqY3Vyc29yX3JvdyA9ICh3LT5j dXJzb3IudnBvcyAhPSAtMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUFU UklYX1JPVyAoY3Vyc29yX21hdHJpeCwgdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IE5VTEw7CisgIHN0cnVjdCBnbHlwaCAqY3Vyc29yX2dseXBoID0g KHctPmN1cnNvci52cG9zICE9IC0xKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g bWNfZ2V0X2N1cnNvcl9nbHlwaCAodywgY3Vyc29yX21hdHJpeCwgY3Vyc29yX3JvdywKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNv ci5ocG9zLCB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IE5VTEw7CisgIGJvb2wgY3Vyc29yX2F0X2ZyaW5nZV9wID0gKGN1cnNvcl9nbHlwaCA9PSBOVUxM CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3cgIT0gTlVMTAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBjdXJzb3Jfcm93 LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29y X3Jvdy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVfcAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5jdXJzb3IueCA9PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gY3Vyc29yX3Jvdy0+cGl4ZWxfd2lkdGgpOwor ICBib29sIGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AgPSAoY3Vyc29yX2dseXBoID09IE5VTEwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3cgIT0gTlVMTAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gY3Vyc29y X3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiAhY3Vyc29yX3Jvdy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVfcAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0gdGV4dF9hcmVhX3dpZHRoCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA+PSBjdXJzb3Jfcm93 LT5waXhlbF93aWR0aCk7CisgIGludCBmcmFtZV9jaGFyX3dpZHRoID0gRlJBTUVfQ09MVU1OX1dJ RFRIIChmKTsKKyAgaW50IHRlbXBfZmFjZV9pZCA9IGdseXBoLT5mYWNlX2lkOworICBzdHJ1Y3Qg bWNfUkdCIGJhY2tncm91bmQ7CisgIG1jX3NldF9sc2xfYmcgKHcsIHRlbXBfZmFjZV9pZCwgJmJh Y2tncm91bmQpOworICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9IChvcG9pbnRfeCA9PSByZWxh dGl2ZV94CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF9ocG9zID09IGhw b3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3kgPT0gcm93LT55Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF92cG9zID09IHZwb3MpOworCisv KiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICBCRUdJTjog IENIQVJfR0xZUEggfCBHTFlQSExFU1NfR0xZUEggICAgICAgICAgICAgICAgICAqLworLyogLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tICovCisgIGlmIChnbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAg ICB8fCBnbHlwaC0+dHlwZSA9PSBHTFlQSExFU1NfR0xZUEgpCisgIHsKKyAgICBpZiAobWNfc3Rk ZXJyX3ApCisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICJcbiAlNSJwRCJkLyUtNWQg JTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4xZCAgJTNkICVzICVzXG4i LAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93 LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICBy ZWxhdGl2ZV94LAorICAgICAgICAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAg PyAnQycKKyAgICAgICAgIDogJ0cnKSwKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAg IChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNU UklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgOiAo TklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgICAg ICA6ICctJykpKSwKKyAgICAgICAgICAgICAgZ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icmVh azsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgSE9S SVpPTlRBTF9SVUxFUjogIENIQVJfR0xZUEggfCBHTFlQSExFU1NfR0xZUEggICAgICAgICAgICAg ICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBIT1JJWk9OVEFMX1JVTEVS OgorICAgIHsKKyAgICAgIGlmIChyZWxhdGl2ZV94IDwgcm93LT5waXhlbF93aWR0aAorICAgICAg ICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4 LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAg ICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlv biwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxz LmFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAg ICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGlmIChnbHlwaCAtIHJvdy0+Z2x5 cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICYmIHJlbGF0 aXZlX3ggPD0geF9saW1pdCkKKyAgICAgICAgeworICAgICAgICAgIGlmIChyZWxhdGl2ZV94IDwg cm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgcmVsYXRpdmVf eCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgIGZ4ICs9IGdseXBoLT5waXhl bF93aWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwg cm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAg ICAgICAgICAgICAgeF9saW1pdCAtIHJlbGF0aXZlX3gsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jf d2lkdGgsIHJvd19wb3NpdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmQsIGJh Y2tncm91bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBITEVTUywKKyAgICAgICAgICAg ICAgICAgICAgIGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwgYWN0aW9uX3R5cGUpOwor ICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8K Ky8qICAgICAgICAgICAgICAgVkVSVElDQUxfUlVMRVI6ICBDSEFSX0dMWVBIIHwgR0xZUEhMRVNT X0dMWVBIICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAg Y2FzZSBWRVJUSUNBTF9SVUxFUjoKKyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9m bGF2b3IgPSAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgcm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPmNvbnRpbnVlZF9wCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRf cCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9C QVIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmlu Z2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVu Y2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFS X1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJz b3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0gIT0gMQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxf QkFSCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaCAtIHJvdy0+ Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3ggPj0gcm93LT5waXhlbF93aWR0aCkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX3p2X3ApCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgaWYgKGdseXBoX2Zs YXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9m bGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAg fHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICB8 fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgfHwgZ2x5cGhfZmxh dm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgY3Vyc29yX3R5cGUgPSBN Q19SSUdIVF9GUklOR0VfQklUTUFQOworICAgICAgd2QgPSAxOworICAgICAgbWNfaGVscGVyICh3 LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIG9wb2ludF9meCwgeSwgZnksIGhwb3Ms IHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRo LCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIGJhY2tncm91bmQs IGVzc2VudGlhbHMuYWN0aXZlX3AsIGdseXBoX2ZsYXZvciwgZHJhd19wLCBmcm9tX3doZXJlLAor ICAgICAgICAgICAgICAgICBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICBicmVhazsK KyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgRklMTF9D T0xVTU46ICBDSEFSX0dMWVBIIHwgR0xZUEhMRVNTX0dMWVBIICAgICAgICAgICAgICAgICAqLwor LyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBGSUxMX0NPTFVNTjoKKyAgICB7Cisg ICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoZ2x5cGggLSByb3ctPmdseXBoc1tU RVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPj0gcm93LT5waXhlbF93aWR0aCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX3p2X3ApCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6ICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJV RkZFUiAody0+Y29udGVudHMpLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeSA9PSB5CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfdnBvcyA9PSB2cG9zKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIHdkID0gMTsKKyAgICAg IG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmY19meCwgeSwg ZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vy c29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIGJh Y2tncm91bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsIGdseXBoX2ZsYXZvciwgZHJhd19wLCBmcm9t X3doZXJlLAorICAgICAgICAgICAgICAgICBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAg ICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIENVUlNP Ul9JTkRJQ0FUT1I6CisgICAgeworICAgICAgYnJlYWs7CisgICAgf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2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEp LAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAnUycsCisgICAgICAgIGdseXBoLT5jaGFy cG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0InCisg ICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAg ICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICA/ICcwJwor ICAgICAgICAgICAgICAgOiAnLScpKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAg ICAgICAgMHUsCisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9i b3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5 cGgtPmhwb3MsIGdseXBoX3p2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgIlxcUyIpOworICBz d2l0Y2ggKGFjdGlvbl90eXBlKQorICB7CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAg ICAgICAgICAgICAgICAgICAgICAgTVVMVElQTEVfQ1VSU09SUzogIFNUUkVUQ0hfR0xZUEggICAg ICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBN VUxUSVBMRV9DVVJTT1JTOgorICAgIHsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3cs IGdseXBoLCByZWxhdGl2ZV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CBkcmF3X3As IGZyb21fd2hlcmUsCisgICAgICAgICAgICAgICAgICAgY2FjaGVfdHlwZSwgYWN0aW9uX3R5cGUp OworICAgICAgaWYgKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRb YXJlYV0gLSAxCisgICAgICAgICAgJiYgcmVsYXRpdmVfeCA8PSB4X2xpbWl0KQorICAgICAgICB7 CisgICAgICAgICAgaWYgKHJlbGF0aXZlX3ggPCByb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAg ICAgeworICAgICAgICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAg ICAgICAgICAgICAgZnggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgfQorICAg ICAgICAgIHRlbXBfZmFjZV9pZCA9IChyb3ctPmZpbGxfbGluZV9wKQorICAgICAgICAgICAgICAg ICAgICAgICAgID8gZ2x5cGgtPmZhY2VfaWQKKyAgICAgICAgICAgICAgICAgICAgICAgICA6IERF RkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGJhY2tncm91bmQ7CisgICAg ICAgICAgbWNfc2V0X2xzbF9iZyAodywgdGVtcF9mYWNlX2lkLCAmYmFja2dyb3VuZCk7CisgICAg ICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5 LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgIHhfbGltaXQgLSByZWxhdGl2 ZV94LCBoLCBjdXJzb3JfdHlwZSwgeF9saW1pdCAtIHJlbGF0aXZlX3gsCisgICAgICAgICAgICAg ICAgICAgICByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsIGJhY2tncm91bmQsIGVzc2VudGlhbHMu YWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICBNQ19HTFlQSExFU1MsIGRyYXd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BfZmFjZV9pZCwgJmJhY2tncm91bmQpOworICAgICAg ZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+Y29udGludWVkX3ApCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX0JBQ0tT TEFTSAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2Zy aW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT5j b250aW51ZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJv dy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5b25kX2ZyaW5nZV9w CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRl ZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1D X1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdICE9 IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5j YXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiBNQ19HTFlQSExFU1M7CisgICAgICBpZiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJ Q0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZF UlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3Ig PT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9 PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJT RURfVkVSVElDQUxfQkFSKQorICAgICAgICBjdXJzb3JfdHlwZSA9IE1DX1JJR0hUX0ZSSU5HRV9C SVRNQVA7CisgICAgICB3ZCA9IDE7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBn bHlwaCwgb3BvaW50X3gsIG9wb2ludF9meCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAg ICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGZv cmVncm91bmQsCisgICAgICAgICAgICAgICAgIGJhY2tncm91bmQsIGVzc2VudGlhbHMuYWN0aXZl X3AsIGdseXBoX2ZsYXZvciwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICBj YWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgRklMTF9DT0xVTU46 ICBTVFJFVENIX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tICovCisgICAgY2FzZSBGSUxMX0NPTFVNTjoKKyAgICB7CisgICAgICBpZiAocm93LT5m aWxsX2xpbmVfcAorICAgICAgICAgICYmIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9 PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID4gcmVs YXRpdmVfeCArIGdseXBoLT5waXhlbF93aWR0aCkKKyAgICAgICAgdGVtcF9mYWNlX2lkID0gZ2x5 cGgtPmZhY2VfaWQ7CisgICAgICAgIGVsc2UgaWYgKCFyb3ctPmZpbGxfbGluZV9wCisgICAgICAg ICAgICAgICAgICYmIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRb YXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+IHJlbGF0aXZl X3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgdGVtcF9mYWNlX2lkID0gREVGQVVM VF9GQUNFX0lEOworICAgICAgc3RydWN0IG1jX1JHQiBiYWNrZ3JvdW5kOworICAgICAgbWNfc2V0 X2xzbF9iZyAodywgdGVtcF9mYWNlX2lkLCAmYmFja2dyb3VuZCk7CisgICAgICBlbnVtIG1jX2Zs YXZvciBnbHlwaF9mbGF2b3IgPSBNQ19HTFlQSExFU1M7CisgICAgICB3ZCA9IDE7CisgICAgICBt Y19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgZXNzZW50aWFscy5mY194LCBmY19meCwg eSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwg Y3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAg IGJhY2tncm91bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsIGdseXBoX2ZsYXZvciwgZHJhd19wLCBm cm9tX3doZXJlLAorICAgICAgICAgICAgICAgICBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7Cisg ICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIENV UlNPUl9JTkRJQ0FUT1I6CisgICAgeworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tICovCisgIH0KKyAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBFTkQ6ICBTVFJFVENIX0dMWVBIICAgICAgICAgICAg ICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworCisvKiAtLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQkVHSU46ICBJ TUFHRV9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tICovCisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IElNQUdFX0dMWVBIKQorICB7Cisg ICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiXG4g JTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNnggJTRkICUxLjFkJTEuMWQg ICUzZCAlcyAlY1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAor ICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAx KSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ0knLAorICAgICAgICBnbHlwaC0+Y2hh cnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICA/ICdCJwor ICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisg ICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgICAgPyAnMCcK KyAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisg ICAgICAgICh1bnNpZ25lZCBpbnQpIGdseXBoLT51LmltZ19pZCwKKyAgICAgICAgZ2x5cGgtPmZh Y2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5y aWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+aHBvcywgZ2x5cGhfenZfcCA/ICJaViIg OiAiLS0iLAorICAgICAgICAnLicpOworICBzd2l0Y2ggKGFjdGlvbl90eXBlKQorICB7CisvKiAt LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgIE1VTFRJUExF X0NVUlNPUlM6ICBJTUFHRV9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBNVUxUSVBMRV9DVVJTT1JTOgorICAgIHsKKyAgICAg IGN1cnNvcl90eXBlID0gTUNfSE9MTE9XX0JPWDsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4 LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAg ICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24s IGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIGJhY2tncm91bmQsIGVzc2VudGlhbHMuYWN0 aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUsCisgICAgICAgICAgICAgICAgIGNh Y2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgSE9SSVpPTlRBTF9SVUxF UjogIElNQUdFX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0gKi8KKyAgICBjYXNlIEhPUklaT05UQUxfUlVMRVI6CisgICAgeworICAgICAgY3Vyc29y X3R5cGUgPSBNQ19IT0xMT1dfQk9YOworICAgICAgaWYgKCFyZWFsX2Zha2VfY3Vyc29yX3ApCisg ICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwg eSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBl LCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAg ICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLCBm cm9tX3doZXJlLAorICAgICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsK KyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAg ICAgICAgICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIElNQUdFX0dMWVBIICA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LSAqLworLyog ICAgICAgICAgICAgICAgICAgICAgICAgICAgQkVHSU46ICBDT01QT1NJVEVfR0xZUEggICAgICAg ICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgZWxzZSBp ZiAoZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKQorICB7CisgICAgaWYgKG1jX3N0ZGVy cl9wKQorICAgICAgeworICAgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICAgIlxuICU1 InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4IiwKKyAgICAgICAgICBnbHlw aCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0g PT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgICAgcmVsYXRpdmVfeCwK KyAgICAgICAgICAnKycsCisgICAgICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgICAgKEJV RkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgID8gJ0InCisgICAgICAgICAgIDogKFNU UklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICAg IDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICAgID8gJzAnCisgICAgICAg ICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAg ICAgICAodW5zaWduZWQgaW50KSBnbHlwaC0+dS5jbXAuaWQpOworICAgICAgICBmcHJpbnRmIChz dGRlcnIsICIgJTRkICUxLjFkJTEuMWQiLAorICAgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAg ICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgICAgZ2x5cGgtPnJpZ2h0X2Jv eF9saW5lX3ApOworICAgICAgaWYgKGdseXBoLT51LmNtcC5hdXRvbWF0aWMpCisgICAgICAgIGZw cmludGYgKHN0ZGVyciwgIiAgJTNkICVzIC4gWyVkLSVkXVxuIiwKKyAgICAgICAgICAgICAgICAg ICAgICAgICBnbHlwaC0+aHBvcywgZ2x5cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAg ICAgICAgICAgICAgICAgIGdseXBoLT5zbGljZS5jbXAuZnJvbSwgZ2x5cGgtPnNsaWNlLmNtcC50 byk7CisgICAgICAgIGVsc2UKKyAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJcbiIpOworICAg ICAgfQorICBzd2l0Y2ggKGFjdGlvbl90eXBlKQorICB7CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0g Ki8KKy8qICAgICAgICAgICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTOiAgQ09NUE9TSVRF X0dMWVBIICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisg ICAgY2FzZSBNVUxUSVBMRV9DVVJTT1JTOgorICAgIHsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0 cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAg ICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRp b24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIGJhY2tncm91bmQsIGVzc2VudGlhbHMu YWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUsCisgICAgICAgICAgICAgICAg IGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgIEhPUklaT05UQUxfUlVM RVI6ICBDT01QT1NJVEVfR0xZUEggICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0gKi8KKyAgICBjYXNlIEhPUklaT05UQUxfUlVMRVI6CisgICAgeworICAgICAgaWYg KHJlbGF0aXZlX3ggPD0geF9saW1pdAorICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3Ap CisgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBm eCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90 eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAg ICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19w LCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBl KTsKKyAgICAgIGlmIChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2Vk W2FyZWFdIC0gMQorICAgICAgICAgICYmIHJlbGF0aXZlX3ggPD0geF9saW1pdCkKKyAgICAgICAg eworICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAg IHdoaWxlIChyZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwg ZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90 eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBNQ19HTFlQSExF U1MsIGRyYXdfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBmcm9tX3doZXJlLCBjYWNoZV90 eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZnJhbWVfY2hh cl93aWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQor LyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICBWRVJU SUNBTF9SVUxFUjogIENPTVBPU0lURV9HTFlQSCAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgVkVSVElDQUxfUlVMRVI6CisgICAgeworICAg ICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1cnNvcl9hdF9mcmluZ2VfcAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+Y29udGludWVkX3ApCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX0JB Q0tTTEFTSAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0 X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93 LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg IXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5b25kX2ZyaW5n ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5j YXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFd ICE9IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPnRy dW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFth cmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2lu dF94ID49IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IChnbHlwaF96dl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19H TFlQSDsKKyAgICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FS Uk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JB Ul9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9C QVJfQkFDS1NMQVNICisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JB UgorICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIp CisgICAgICAgIGN1cnNvcl90eXBlID0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUDsKKyAgICAgIHdk ID0gMTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94 LCBvcG9pbnRfZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICB3ZCwgaCwg Y3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcm93X3Bvc2l0aW9uLCBmb3JlZ3JvdW5kLAorICAg ICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBnbHlwaF9mbGF2 b3IsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgY2FjaGVfdHlwZSwgYWN0 aW9uX3R5cGUpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICov CisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgRklMTF9DT0xVTU46ICBDT01QT1NJVEVfR0xZ UEggICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAg IGNhc2UgRklMTF9DT0xVTU46CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxh dm9yID0gKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0g LSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5m Y194ID4gcmVsYXRpdmVfeCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGds eXBoX3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZ UEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICghTklMUCAoQlZB UiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF92ZXJ0aWNhbF9ydWxl cikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeSA9 PSB5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfdnBv cyA9PSB2cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dM WVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSDsK KyAgICAgIHdkID0gMTsKKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCBy ZWxhdGl2ZV94LCBmY19meCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdk LCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQs CisgICAgICAgICAgICAgICAgIGJhY2tncm91bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsIGdseXBo X2ZsYXZvciwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICBjYWNoZV90eXBl LCBhY3Rpb25fdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KKyAgICBjYXNlIENVUlNPUl9JTkRJQ0FUT1I6CisgICAgeworICAgICAgYnJlYWs7Cisg ICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgIH0KKyAgfQorLyogLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVORDogIENPTVBPU0lU RV9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LSAqLworCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBCRUdJTjogIFhXSURHRVRfR0xZUEggICAgICAgICAgICAgICAgICAgICAgICAgICAq LworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IFhX SURHRVRfR0xZUEgpCisgIHsKKyNpZm5kZWYgSEFWRV9YV0lER0VUUworICAgIGVhc3N1bWUgKGZh bHNlKTsKKyNlbHNlCisgICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAgZnByaW50ZiAoc3RkZXJy LAorICAgICAgICAiXG4gICU1ZC8lLTVkICU1ZCAlNGMgJTZkICVjICUzZCAweCUwNXggJTRkICUx LjFkJTEuMWQgICUzZCAlcyAlY1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhU X0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRb YXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ1gnLAorICAgICAgICBn bHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAg ID8gJ1MnCisgICAgICAgICAgICA6ICctJykpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgs CisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9w LAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnUueHdp ZGdldCwKKyAgICAgICAgZ2x5cGgtPmhwb3MsIGdseXBoX3p2X3AgPyAiWlYiIDogIi0tIiwKKyAg ICAgICAgJy4nKTsKKyNlbmRpZgorICBzd2l0Y2ggKGFjdGlvbl90eXBlKQorICB7CisvKiAtLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgTVVMVElQTEVfQ1VS U09SUzogIFhXSURHRVRfR0xZUEggICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tICovCisgICAgY2FzZSBNVUxUSVBMRV9DVVJTT1JTOgorICAgIHsKKyAgICAgIG1j X2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhw b3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dp ZHRoLCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgIGJhY2tncm91 bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUsCisg ICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGJyZWFrOwor ICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAg ICBIT1JJWk9OVEFMX1JVTEVSOiAgWFdJREdFVF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICov CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEhPUklaT05UQUxfUlVMRVI6Cisg ICAgeworICAgICAgaWYgKHJlbGF0aXZlX3ggPD0geF9saW1pdAorICAgICAgICAgICYmICFyZWFs X2Zha2VfY3Vyc29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBo LCByZWxhdGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAg d2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgZm9yZWdyb3Vu ZCwKKyAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBN Q19HTFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICAgIGNhY2hlX3R5 cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGlmIChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJF QV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICYmIHJlbGF0aXZlX3ggPD0geF9s aW1pdCkKKyAgICAgICAgeworICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dp ZHRoOworICAgICAgICAgIHdoaWxlIChyZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAgICAg ICB7CisgICAgICAgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxh dGl2ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAg d2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgZm9yZWdyb3Vu ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2 ZV9wLCBNQ19HTFlQSExFU1MsIGRyYXdfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBmcm9t X3doZXJlLCBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICAgICAgICAgIHJlbGF0aXZl X3ggKz0gZnJhbWVfY2hhcl93aWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAg YnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAg ICAgICAgICAgICAgVkVSVElDQUxfUlVMRVI6ICBYV0lER0VUX0dMWVBIICAgICAgICAgICAgICAg ICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgVkVSVElDQUxfUlVM RVI6CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGN1cnNvcl9h dF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+ Y29udGludWVkX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNf VkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3Ap CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFS X1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJz b3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2Vf cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+ dXNlZFtURVhUX0FSRUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFd ID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIG9wb2ludF94ID49IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IChnbHlwaF96dl9wKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElD QUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVS U0VEX1ZFUlRJQ0FMX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F2b3IgZ2x5cGhfZmxh dm9yID0gKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0g LSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5m Y194ID4gcmVsYXRpdmVfeCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGds eXBoX3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZ UEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICghTklMUCAoQlZB UiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF92ZXJ0aWNhbF9ydWxl cikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeSA9 PSB5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfdnBv cyA9PSB2cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dM WVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSDsK KyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmY19m eCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlw ZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAg ICAgIGJhY2tncm91bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsIGdseXBoX2ZsYXZvciwgZHJhd19w LCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7 CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNl IENVUlNPUl9JTkRJQ0FUT1I6CisgICAgeworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tICovCisgIH0KKyAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFTkQ6ICBYV0lER0VUX0dMWVBIICAgICAgICAg ICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworfQorCit2b2lk CittY19kcmF3X3JvdyAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0 cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgc3RydWN0IGdseXBoICpz dGFydCwgaW50IHgsIGludCBocG9zX2xlbmd0aCwgaW50IHZwb3MsCisgICAgICAgICAgICAgc3Ry dWN0IGdseXBoX21hdHJpeCAqY3Vyc29yX21hdHJpeCwgc3RydWN0IG1jX2Vzc2VudGlhbHMgZXNz ZW50aWFscywKKy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fcCA/ICJ5IiA6ICJuIiwg aHBvc19zdGFydCwgaHBvc19sZW5ndGgpOworICBpbnQgb3BvaW50X2Z4LCBvcG9pbnRfZnksIG9w b2ludF93ZCwgb3BvaW50X2g7CisgIGludCB0ZXh0X2FyZWFfd2lkdGggPSB3aW5kb3dfYm94X3dp ZHRoICh3LCBURVhUX0FSRUEpOworICBpbnQgaGVhZGVyX2xpbmVfZm9ybWF0ID0gV0lORE9XX0hF QURFUl9MSU5FX0hFSUdIVCAodyk7CisgIHN0cnVjdCBnbHlwaF9yb3cgKmN1cnNvcl9yb3cgPSAo dy0+Y3Vyc29yLnZwb3MgIT0gLTEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IE1BVFJJWF9ST1cgKGN1cnNvcl9tYXRyaXgsIHctPmN1cnNvci52cG9zKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiBOVUxMOworICBzdHJ1Y3QgZ2x5cGggKmN1cnNvcl9nbHlw aCA9ICh3LT5jdXJzb3IudnBvcyAhPSAtMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIGN1cnNvcl9tYXRyaXgsIGN1cnNvcl9yb3csCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5j dXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBOVUxMOworICBib29sIGN1cnNvcl9hdF9mcmluZ2VfcCA9IChjdXJzb3JfZ2x5cGggPT0g TlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93ICE9IE5VTEwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gY3Vyc29y X3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1 cnNvcl9yb3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID09IGN1cnNvcl9yb3ctPnBpeGVsX3dpZHRo KTsKKyAgYm9vbCBjdXJzb3JfYmV5b25kX2ZyaW5nZV9wID0gKGN1cnNvcl9nbHlwaCA9PSBOVUxM CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93ICE9IE5VTEwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID09IGN1 cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgIWN1cnNvcl9yb3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5lX3AKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHRleHRfYXJlYV93aWR0aAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0gY3Vyc29y X3Jvdy0+cGl4ZWxfd2lkdGgpOworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAg ICAgICAgICAgICAgICAgIFJFUExBQ0UgVEhFIFJFQUwgQ1VSU09SCisqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKyAgZW51bSBmYWNlX2lkIGJnX2ZhY2VfaWQgPSAoY3Vyc29yX2dseXBoICE9IE5V TEwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBjdXJzb3JfZ2x5cGgtPmZhY2VfaWQK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgc3RydWN0 IG1jX1JHQiBjdXJzb3JfYmc7CisgIG1jX3NldF9sc2xfYmcgKHcsIGJnX2ZhY2VfaWQsICZjdXJz b3JfYmcpOworICAvKiBGSVhNRTogIFB1dCBpbiBzb21lIGNvZGUgdG8gZGVmYXVsdCB0byBNQ19I T0xMT1dfQk9YIGlmIHRoZSB1c2VyIGhhcworICB1bndpdHRpbmdseSBjb21lIHVwIHdpdGggc29t ZSB1bmFjY2VwdGFibGUgZm9ybSBvZiB1bnJlY29nbml6ZWQgY3Vyc29yIHR5cGUuICovCisgIExp c3BfT2JqZWN0IGxpc3BfdHlwZSA9IEJWQVIgKGIsIG1jX3JlYWxfZmFrZV9jdXJzb3IpOworICBl bnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY19saXNwX3RvX2N1cnNvcl90eXBl IChYQ0FSIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiBtY19saXNwX3RvX2N1cnNvcl90eXBlIChsaXNwX3R5cGUpOworICBpbnQgY3Vyc29yX3dpZHRo ID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgPyBYRklYTlVNIChY Q0FSIChYQ0RSIChsaXNwX3R5cGUpKSkKKyAgICAgICAgICAgICAgICAgICAgIDogLTE7CisgIHN0 cnVjdCBtY19SR0IgY3Vyc29yX2ZnOworICBtY19jb2xvcl9waWNrZXIgKHcsIGN1cnNvcl9nbHlw aCwgZXNzZW50aWFscywgJmN1cnNvcl9mZywgLTEsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAg ICAgICAgIHJvd19wb3NpdGlvbiwgQ1VSU09SX0lORElDQVRPUik7CisgIGJvb2wgZmlsbF9jb2x1 bW5fdHJ1bXBzX3AgPSAoIU5JTFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgZmNfdmlzaWJsZSkp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gZXNzZW50 aWFscy5mY194CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIWN1cnNvcl9hdF9m cmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFjdXJzb3JfYmV5b25k X2ZyaW5nZV9wKTsKKyAgLyogV2UgdXNlIGEgdGVzdCBzaW1pbGFyIHRvIHRoZSByZWFsIGZha2Ug Y3Vyc29yIHNvIHRoYXQgdGhlIGZyaW5nZSBiaXRtYXAgaXMKKyAgb25seSBkcmF3biBvbmNlIHBl ciB3aW5kb3cuICovCisgIGlmICh2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAmJiBocG9z X3N0YXJ0ICsgaHBvc19sZW5ndGggPT0gcm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICYmICFO SUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9o b3Jpem9udGFsX3J1bGVyKSkpCisgICAgeworICAgICAgLyogZnJpbmdlIGJpdG1hcHMgdXNlIGZh Y2VfaWQgdG8gc2V0IHRoZSBmb3JlZ3JvdW5kIGNvbG9yLiAgVGhlIG92ZXJsYXktYXJyb3cKKyAg ICAgIGlzIHByZXNlbnRseSB0aGUgb25seSBzaXR1YXRpb24gd2hlcmUgdGhlIGBlc3NlbnRpYWxz LmFjdGl2ZV9wYCBhbmQgYG1pbmltYWxfcGAgYXJlCisgICAgICB1c2VkIHRvIGRldGVybWluZSB0 aGUgYXBwbGljYWJsZSBmYWNlX2lkLiAqLworICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmcgPSB7 LnJlZCA9IC0xLjAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSAtMS4w LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSAtMS4wfTsKKyAgICAgIC8q IFdlIHVzZSB0aGUgZmlyc3QgZ2x5cGggaW4gdGhlIHJvdywgd2l0aCBhbiBYIGFuZCBIUE9TIG9m IHplcm8uICovCisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCByb3ctPmdseXBoc1tU RVhUX0FSRUFdLCAwLCAtMSwgdy0+Y3Vyc29yLnksIC0xLAorICAgICAgICAgICAgICAgICAwLCB3 LT5jdXJzb3IudnBvcywgLTEsIC0xLCBNQ19MRUZUX0ZSSU5HRV9CSVRNQVAsIC0xLCByb3dfcG9z aXRpb24sCisgICAgICAgICAgICAgICAgIGxzbF9mZywgY3Vyc29yX2JnLCBlc3NlbnRpYWxzLmFj dGl2ZV9wLCBNQ19PVkVSTEFZX0FSUk9XX0JJVE1BUCwKKyAgICAgICAgICAgICAgICAgZHJhd19w LCBmcm9tX3doZXJlLCBDSF9DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgfQorICBpZiAo Y3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAg ICAmJiB3LT5jdXJzb3IuaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAmJiB3LT5jdXJzb3IuaHBv cyA9PSBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGgKKyAgICAgICYmICFOSUxQIChCVkFSIChiLCBj cm9zc2hhaXJzKSkKKyAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9ob3Jpem9udGFsX3J1bGVy KSkpCisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gTU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Cwgdy0+Y3Vyc29yLnksCisgICAg ICAgICAgICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCBv cG9pbnRfd2QsIG9wb2ludF9oLAorICAgICAgICAgICAgICAgICBNQ19CQVIsIDEsIHJvd19wb3Np dGlvbiwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsIGVzc2VudGlhbHMuYWN0aXZlX3AsCisgICAgICAg ICAgICAgICAgIE1DX0dMWVBITEVTUywgZHJhd19wLCBmcm9tX3doZXJlLCBOSUxQIChCVkFSIChi LCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogTUNfQ0FDSEUsIENVUlNPUl9JTkRJQ0FUT1IpOworICAgICAgbWNfZ2V0 X2N1cnNvcl9nZW9tZXRyeSAodywgbWF0cml4LCByb3csIHctPmN1cnNvci54LCAmb3BvaW50X2Z4 LCB3LT5jdXJzb3IueSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZvcG9pbnRfZnks IHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgTUNfSEJBUiwgMSwgJm9wb2ludF93ZCk7CisgICAgICBtY19oZWxw ZXIgKHcsIG1hdHJpeCwgcm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1cnNvci54LCBvcG9pbnRfZngs IHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICBvcG9pbnRfZnksIHctPmN1cnNvci5ocG9z LCB3LT5jdXJzb3IudnBvcywgb3BvaW50X3dkLCBvcG9pbnRfaCwKKyAgICAgICAgICAgICAgICAg TUNfSEJBUiwgMSwgcm93X3Bvc2l0aW9uLCBjdXJzb3JfZmcsIGN1cnNvcl9iZywgZXNzZW50aWFs cy5hY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVy ZSwgTklMUCAoQlZBUiAoYiwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiBNQ19DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAg fQorICBlbHNlIGlmICghY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICYmIGN1cnNvcl9n bHlwaCAhPSBOVUxMCisgICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAg ICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPj0gaHBvc19zdGFydAorICAgICAgICAgICAmJiB3LT5j dXJzb3IuaHBvcyA8IGhwb3Nfc3RhcnQgKyBocG9zX2xlbmd0aAorICAgICAgICAgICAmJiBjdXJz b3JfZ2x5cGgtPnR5cGUgIT0gU1RSRVRDSF9HTFlQSCkKKyAgICB7CisgICAgICBtY19nZXRfY3Vy c29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRfZngsIHct PmN1cnNvci55LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF9meSwgdy0+ Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCAmb3BvaW50X3dkKTsKKyAg ICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngs IG9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAgICAgICAgIG9wb2ludF9meSwgdy0+ Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9oLAorICAgICAg ICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGN1cnNv cl9mZywgY3Vyc29yX2JnLAorICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBN Q19HTFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICBOSUxQIChCVkFS IChiLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgPyBDSF9DQUNIRQorICAgICAgICAgICAg ICAgICA6IE1DX0NBQ0hFLCBDVVJTT1JfSU5ESUNBVE9SKTsKKyAgICB9CisgIGVsc2UgaWYgKCFj dXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoICE9IE5VTEwKKyAg ICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAgICAgICAmJiB3LT5jdXJz b3IuaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zIDwgaHBv c19zdGFydCArIGhwb3NfbGVuZ3RoCisgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+dHlwZSA9 PSBTVFJFVENIX0dMWVBIKQorICAgIHsKKyAgICAgIC8qIElmIGEgdXNlciBoYXMgc2V0IGB4LXN0 cmV0Y2gtY3Vyc29yJyB0byBhIG5vbi1uaWwgdmFsdWUsIGhlL3NoZSBjaG9zZSB0bworICAgICAg aGF2ZSBhIGN1cnNvciB0aGF0IHNwYW5zIHRoZSBlbnRpcmUgbGVuZ3RoIG9mIHRoZSBTVFJFVENI X0dMWVBILiAqLworICAgICAgaWYgKCF4X3N0cmV0Y2hfY3Vyc29yX3ApCisgICAgICAgIHsKKyAg ICAgICAgICAvKiBUaGUgTUNfSEJBUiBzaGFsbCBoYXZlIGEgYGN1cnNvcl93aWR0aGAgb2YgMS4g Ki8KKyAgICAgICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+ Y3Vyc29yLngsICZvcG9pbnRfZngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg dy0+Y3Vyc29yLnksICZvcG9pbnRfZnksIHctPmN1cnNvci5ocG9zLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsIE1DX0hCQVIsIDEs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF93ZCk7CisgICAgICAg ICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgY3Vyc29yX2dseXBoLCB3LT5jdXJzb3IueCwg b3BvaW50X2Z4LAorICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLnksIG9wb2ludF9meSwg dy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLAorICAgICAgICAgICAgICAgICAgICAgb3Bv aW50X3dkLCBvcG9pbnRfaCwgTUNfSEJBUiwgMSwgcm93X3Bvc2l0aW9uLCBjdXJzb3JfZmcsCisg ICAgICAgICAgICAgICAgICAgICBjdXJzb3JfYmcsIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dM WVBILCBkcmF3X3AsIGZyb21fd2hlcmUsCisgICAgICAgICAgICAgICAgICAgICBOSUxQIChCVkFS IChiLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAg ICAgICAgICAgICAgIDogTUNfQ0FDSEUsIENVUlNPUl9JTkRJQ0FUT1IpOworICAgICAgICB9Cisg ICAgICBtY19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngs ICZvcG9pbnRfZngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5jdXJzb3IueSwg Jm9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgJm9wb2ludF93ZCk7CisgICAgICBtY19oZWxw ZXIgKHcsIG1hdHJpeCwgcm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1cnNvci54LCBvcG9pbnRfZngs IHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICBvcG9pbnRfZnksIHctPmN1cnNvci5ocG9z LCB3LT5jdXJzb3IudnBvcywgb3BvaW50X3dkLCBvcG9pbnRfaCwKKyAgICAgICAgICAgICAgICAg Y3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcm93X3Bvc2l0aW9uLCBjdXJzb3JfZmcsIGN1cnNv cl9iZywKKyAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEgsIGRy YXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgTklMUCAoQlZBUiAoYiwgbWNfY29u ZikpCisgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAgICAgICAgOiBNQ19D QUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgfQorLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq CisgICAgICAgICAgICAgICAgICAgICAgICAgIERSQVcgQU5EIFJFQ09SRCBGQUtFIENVUlNPUlMK KyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworICBpZiAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAg ICAgICYmIE5JTFAgKEJWQVIgKGIsIG1jX2luYWN0aXZlX3dpbmRvd3MpKQorICAgICAgJiYgTklM UCAoQlZBUiAoYiwgY2hfaW5hY3RpdmVfd2luZG93cykpCisgICAgICAmJiBOSUxQIChCVkFSIChi LCBmY19pbmFjdGl2ZV93aW5kb3dzKSkpCisgICAgcmV0dXJuOworICBpZiAoaHBvc19sZW5ndGgg PT0gMSkKKyAgICB7CisgICAgICBpZiAoIU5JTFAgKEJWQVIgKGIsIG1jX2NvbmYpKQorICAgICAg ICAgICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgIHx8ICghZXNzZW50aWFs cy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIG1jX2luYWN0 aXZlX3dpbmRvd3MpKSkpKQorICAgICAgICB7CisgICAgICAgICAgLyogVGhlIHNwYWNlIGFwcGVu ZGVkIHRvIGEgcm93IGVuZGluZyB3aXRoIGEgbmV3IGxpbmUKKyAgICAgICAgICBkb2VzIG5vdCBo YXZlIGEgYGdseXBoLT5jaGFycG9zYCAoLTEsIDApIHRoYXQgd2UgY2FuCisgICAgICAgICAgdXNl IGZvciB0aGlzIHBhcnRpY3VsYXIgYXBwbGljYXRpb24uICBXaGVuIHRoZXJlIGlzIGEKKyAgICAg ICAgICBgYnVmZmVyLWRpc3BsYXktdGFibGUnIGVudHJ5IHRoYXQgYXNzaWducyBhIHZpc2libGUK KyAgICAgICAgICBnbHlwaCB0byBhIG5ldyBsaW5lLCB0aGVyZSBpcyBubyBwcm9ibGVtIGJlY2F1 c2UgdGhhdAorICAgICAgICAgIGdseXBoIGhhcyBhIGBnbHlwaC0+Y2hhcnBvcycgdGhhdCB3ZSBj YW4gdXNlLiAgV2hlbgorICAgICAgICAgIG5vIHZpc2libGUgRU9MIGdseXBoIGV4aXN0cywgd2Ug dXNlIHRoZSBmb2xsb3dpbmcKKyAgICAgICAgICB0ZXN0OiAgdGhlIGFwcGVuZGVkIHNwYWNlIGhh cyBhIHBvc2l0aW9uIHRoYXQgaXMgb25lCisgICAgICAgICAgbGVzcyB0aGFuIHRoZSBlbmQgb2Yg dGhlIG1hdHJpeCByb3cuICovCisgICAgICAgICAgaW50IGhwb3MgPSBzdGFydCAtIHJvdy0+Z2x5 cGhzW1RFWFRfQVJFQV07CisgICAgICAgICAgc3RydWN0IGdseXBoICpwcmV2aW91c19nbHlwaCA9 ICgwIDw9IGhwb3MgLSAxICYmIGhwb3MgLSAxIDwgcm93LT51c2VkW1RFWFRfQVJFQV0pCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gcm93LT5nbHlwaHNbVEVYVF9B UkVBXSArIGhwb3MgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogTlVMTDsKKyAgICAgICAgICAvLyBzdHJ1Y3QgZ2x5cGggKmxhc3RfZ2x5cGggPSByb3ctPmds eXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxOworICAgICAgICAgIGJv b2wgc2tpcF9wID0gKHByZXZpb3VzX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBwcmV2aW91c19nbHlwaC0+Y2hhcnBvcyA9PSBNQVRSSVhfUk9XX0VORF9DSEFSUE9T IChyb3cpIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICYmIHN0YXJ0LT5ieXRlcG9zICE9 IGVzc2VudGlhbHMuenZfYnl0ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgPyB0cnVlCisg ICAgICAgICAgICAgICAgICAgICAgICAvKiBXaGVuIGEgYGJ1ZmZlci1kaXNwbGF5LXRhYmxlJyBl bnRyeSBjb250YWlucworICAgICAgICAgICAgICAgICAgICAgICAgYSB2aXNpYmxlIHRhYiBjaGFy YWN0ZXIgKCLCuyIpLCB0aGUgc3Vic2VxdWVudAorICAgICAgICAgICAgICAgICAgICAgICAgU1RS RVRDSF9HTFlQSCB3aWxsIGhhdmUgdGhlIHNhbWUgc3RhcnQtPmNoYXJwb3MKKyAgICAgICAgICAg ICAgICAgICAgICAgIGFzIHRoZSBhZm9yZW1lbnRpb25lZCB2aXNpYmxlIHRhYiBjaGFyYWN0ZXIu ICovCisgICAgICAgICAgICAgICAgICAgICAgICA6IChwcmV2aW91c19nbHlwaCAhPSBOVUxMCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBwcmV2aW91c19nbHlwaC0+Y2hhcnBvcyA9PSBz dGFydC0+Y2hhcnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgPyB0cnVlCisgICAgICAg ICAgICAgICAgICAgICAgICA6IGZhbHNlOworICAgICAgICAgIGludCBwb3NpbnQgPSAocm93X3Bv c2l0aW9uID09IFBPU1RfWlYpCisgICAgICAgICAgICAgICAgICAgICAgICAgPyAtMQorICAgICAg ICAgICAgICAgICAgICAgICA6IChyb3dfcG9zaXRpb24gPT0gQVRfWlYpCisgICAgICAgICAgICAg ICAgICAgICAgICAgID8gZXNzZW50aWFscy56dgorICAgICAgICAgICAgICAgICAgICAgICA6IChz dGFydC0+Ynl0ZXBvcyAhPSBlc3NlbnRpYWxzLnp2X2J5dGUKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFtURVhU X0FSRUFdIC0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICA/IE1BVFJJWF9ST1dfRU5EX0NI QVJQT1MgKHJvdykgLSAxCisgICAgICAgICAgICAgICAgICAgICAgIDogKHN0YXJ0LT5ieXRlcG9z ID09IGVzc2VudGlhbHMuenZfYnl0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBzdGFy dCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKQor ICAgICAgICAgICAgICAgICAgICAgICAgID8gZXNzZW50aWFscy56dgorICAgICAgICAgICAgICAg ICAgICAgICA6IHN0YXJ0LT5jaGFycG9zOworICAgICAgICAgIExpc3BfT2JqZWN0IHNwZWNzID0g bWNfYXNzb2MgKG1ha2VfZml4bnVtIChwb3NpbnQpLCBCVkFSIChiLCBtY19jb25mKSk7CisgICAg ICAgICAgaWYgKCgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID4gMCkKKyAgICAgICAg ICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAgICAmJiAhTklM UCAoc3BlY3MpCisgICAgICAgICAgICAgICYmIHJvdy0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21f eSAodykKKyAgICAgICAgICAgICAgJiYgIXNraXBfcAorICAgICAgICAgICAgICAmJiByb3dfcG9z aXRpb24gIT0gUE9TVF9aVikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgTGlzcF9PYmpl Y3QgbGlzcF90eXBlID0gbWNfbnRoICgxLCBzcGVjcyk7CisgICAgICAgICAgICAgIGVudW0gbWNf Y3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUgPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IG1jX2xpc3BfdG9fY3Vyc29y X3R5cGUgKFhDQVIgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKGxpc3BfdHlwZSk7Cisg ICAgICAgICAgICAgIGN1cnNvcl90eXBlID0gKHN0YXJ0LT50eXBlID09IElNQUdFX0dMWVBIKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfSE9MTE9XX0JPWAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogY3Vyc29yX3R5cGU7CisgICAgICAgICAgICAgIGludCBjdXJzb3Jf d2lkdGggPSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IFhGSVhOVU0gKFhDQVIgKFhDRFIgKGxpc3BfdHlwZSkpKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiAtMTsKKyAgICAgICAgICAgICAgTGlzcF9PYmplY3QgbWNfZm9y ZWdyb3VuZCA9IG1jX250aCAoMiwgc3BlY3MpOworICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdC IGxzbF9mZzsKKyAgICAgICAgICAgICAgaWYgKFNUUklOR1AgKG1jX2ZvcmVncm91bmQpKQorICAg ICAgICAgICAgICAgIG1jX3h3X2NvbG9yX3ZhbHVlcyAodywgbWNfZm9yZWdyb3VuZCwgJmxzbF9m Zyk7CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoVkVDVE9SUCAobWNfZm9yZWdyb3VuZCkpCisg ICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGxzbF9mZy5yZWQgPSBYRkxP QVRfREFUQSAoQVJFRiAobWNfZm9yZWdyb3VuZCwgMCkpOworICAgICAgICAgICAgICAgICAgICBs c2xfZmcuZ3JlZW4gPSBYRkxPQVRfREFUQSAoQVJFRiAobWNfZm9yZWdyb3VuZCwgMSkpOworICAg ICAgICAgICAgICAgICAgICBsc2xfZmcuYmx1ZSA9IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3Jl Z3JvdW5kLCAyKSk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNl IGlmIChOSUxQIChtY19mb3JlZ3JvdW5kKSkKKyAgICAgICAgICAgICAgICAgICAgbWNfY29sb3Jf cGlja2VyICh3LCBzdGFydCwgZXNzZW50aWFscywgJmxzbF9mZywgcG9zaW50LAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCByb3dfcG9zaXRpb24sIE1V TFRJUExFX0NVUlNPUlMpOworICAgICAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9ST1dfVlBP UyAocm93LCBtYXRyaXgpOworICAgICAgICAgICAgICBpbnQgeF9saW1pdCA9IHRleHRfYXJlYV93 aWR0aDsKKyAgICAgICAgICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgc3RhcnQsIFRF WFRfQVJFQSwgeCwgeF9saW1pdCwgcm93LT55LAorICAgICAgICAgICAgICAgICAgICAgICAgIHN0 YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwgdnBvcywgY3Vyc29yX3R5cGUsCisgICAgICAg ICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoLCBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxz LCByb3dfcG9zaXRpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgbHNsX2ZnLCBNVUxUSVBM RV9DVVJTT1JTLCBkcmF3X3AsIGZyb21fd2hlcmUsIE1DX0NBQ0hFKTsKKyAgICAgICAgICAgIH0K KyAgICAgICAgfQorICAgICAgaWYgKCFOSUxQIChCVkFSIChiLCBmY192aXNpYmxlKSkKKyAgICAg ICAgICAmJiAoZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICB8fCAoIWVzc2VudGlh bHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBmY19pbmFj dGl2ZV93aW5kb3dzKSkpKQorICAgICAgICAgIC8vICYmIGVzc2VudGlhbHMuZmNfeCA8PSB0ZXh0 X2FyZWFfd2lkdGgKKyAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPCB0ZXh0X2FyZWFfd2lk dGgKKyAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPj0gdy0+bWMubG51bV9waXhlbF93aWR0 aCkKKyAgICAgICAgeworICAgICAgICAgIGludCB4X2xpbWl0ID0geCArIHN0YXJ0LT5waXhlbF93 aWR0aDsKKyAgICAgICAgICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9ICh3LT5jdXJzb3IueCA9 PSBlc3NlbnRpYWxzLmZjX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiB3LT5jdXJzb3IueSA9PSByb3ctPnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0K KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IudnBvcyA9 PSB2cG9zKTsKKyAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICBtY19j b2xvcl9waWNrZXIgKHcsIHN0YXJ0LCBlc3NlbnRpYWxzLCAmbHNsX2ZnLCAtMSwgTUNfQkFSLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93X3Bvc2l0aW9uLCBGSUxMX0NPTFVNTik7Cisg ICAgICAgICAgaWYgKHggPCB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgLy8geCArIHN0 YXJ0LT5waXhlbF93aWR0aCA8PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgJiYgKCho ZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgICAgfHwg aGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAgICYmICgoc3RhcnQgIT0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMQorICAgICAgICAg ICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSB4CisgICAgICAgICAgICAgICAgICAgJiYg ZXNzZW50aWFscy5mY194IDwgeCArIHN0YXJ0LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAg ICAgIHx8IChzdGFydCA9PSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRf QVJFQV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID49IHgp KQorICAgICAgICAgICAgICAmJiByb3ctPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisg ICAgICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgICAgICBtY19lbmdp bmUgKHcsIG1hdHJpeCwgcm93LCBzdGFydCwgVEVYVF9BUkVBLCB4LCB4X2xpbWl0LCByb3ctPnks CisgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwg dnBvcywgTUNfQkFSLCAxLAorICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBl c3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGxzbF9mZywKKyAgICAgICAgICAgICAgICAgICAgICAg RklMTF9DT0xVTU4sIGRyYXdfcCwgZnJvbV93aGVyZSwgRkNfQ0FDSEUpOworICAgICAgICB9Cisg ICAgICBpZiAoIU5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAgICAgICYmICFOSUxQ IChCVkFSIChiLCBjaF9ob3Jpem9udGFsX3J1bGVyKSkKKyAgICAgICAgICAmJiAoZXNzZW50aWFs cy5hY3RpdmVfcAorICAgICAgICAgICAgICB8fCAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAg ICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkpKQor ICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgIHsKKyAgICAgICAg ICBpbnQgeF9saW1pdCA9IChzdGFydCA9PSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51 c2VkW1RFWFRfQVJFQV0gLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgPyB0ZXh0X2FyZWFf d2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgIDogeCArIHN0YXJ0LT5waXhlbF93aWR0aDsK KyAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICBtY19jb2xvcl9waWNr ZXIgKHcsIHN0YXJ0LCBlc3NlbnRpYWxzLCAmbHNsX2ZnLCAtMSwgTUNfSEJBUiwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgSE9SSVpPTlRBTF9SVUxFUik7CisgICAg ICAgICAgLyogUHJlc2VydmUgc3VwcG9ydCBmb3IgZGVmYXVsdCBiZWhhdmlvciBzdWNoIHRoYXQg YSB1c2VyIG1heQorICAgICAgICAgIHNwZWNpZnkgdGhlIGhlaWdodCBvZiBhbiBNQ19IQkFSLCB3 aGljaCBiZWdpbnMgaXRzIGpvdXJuZXkKKyAgICAgICAgICBhcyB0aGUgYGN1cnNvcl93aWR0aCcu ICBgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeScgcmVhZGp1c3RzLiAqLworICAgICAgICAgIG1jX2Vu Z2luZSAodywgbWF0cml4LCByb3csIHN0YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGltaXQsIHJvdy0+ eSwKKyAgICAgICAgICAgICAgICAgICAgIHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwg dnBvcywgTUNfSEJBUiwgMSwKKyAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVz c2VudGlhbHMsIHJvd19wb3NpdGlvbiwgbHNsX2ZnLAorICAgICAgICAgICAgICAgICAgICAgSE9S SVpPTlRBTF9SVUxFUiwgZHJhd19wLCBmcm9tX3doZXJlLCBDSF9DQUNIRSk7CisgICAgICAgIH0K KyAgICAgIGlmICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgJiYgIU5J TFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAmJiAoZXNzZW50aWFs cy5hY3RpdmVfcAorICAgICAgICAgICAgICB8fCAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAg ICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkpKQor ICAgICAgICAgICYmICFmaWxsX2NvbHVtbl90cnVtcHNfcCkKKyAgICAgICAgeworICAgICAgICAg IGN1cnNvcl90eXBlID0gKHN0YXJ0LT50eXBlID09IElNQUdFX0dMWVBIKQorICAgICAgICAgICAg ICAgICAgICAgICAgPyBNQ19IT0xMT1dfQk9YCisgICAgICAgICAgICAgICAgICAgICAgICA6IE1D X0JBUjsKKyAgICAgICAgICBpbnQgeF9saW1pdCA9IHRleHRfYXJlYV93aWR0aDsKKyAgICAgICAg ICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9ICh3LT5jdXJzb3IueSA9PSByb3ctPnkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IudnBvcyA9PSB2cG9z KTsKKyAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICBtY19jb2xvcl9w aWNrZXIgKHcsIHN0YXJ0LCBlc3NlbnRpYWxzLCAmbHNsX2ZnLCAtMSwgY3Vyc29yX3R5cGUsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICByb3dfcG9zaXRpb24sIFZFUlRJQ0FMX1JVTEVSKTsK KyAgICAgICAgICBpZiAoKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAg ICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAgICYm ICgoc3RhcnQgIT0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFd IC0gMQorICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHgKKyAgICAgICAgICAg ICAgICAgICAmJiB3LT5jdXJzb3IueCA8IHggKyBzdGFydC0+cGl4ZWxfd2lkdGgpCisgICAgICAg ICAgICAgICAgICB8fCAoc3RhcnQgPT0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNl ZFtURVhUX0FSRUFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49 IHgpKQorICAgICAgICAgICAgICAmJiByb3ctPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcp CisgICAgICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgICAgICBtY19l bmdpbmUgKHcsIG1hdHJpeCwgcm93LCBzdGFydCwgVEVYVF9BUkVBLCB4LCB4X2xpbWl0LCByb3ct PnksCisgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVB XSwgdnBvcywgY3Vyc29yX3R5cGUsIDEsCisgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9t YXRyaXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgbHNsX2ZnLAorICAgICAgICAgICAgICAg ICAgICAgICBWRVJUSUNBTF9SVUxFUiwgZHJhd19wLCBmcm9tX3doZXJlLCBDSF9DQUNIRSk7Cisg ICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgICAgeworICAgICAgICBpbnQgcmVsYXRpdmVf eCA9IDA7CisgICAgICAgIGZvciAoaW50IGFyZWEgPSBMRUZUX01BUkdJTl9BUkVBOyBhcmVhIDwg TEFTVF9BUkVBOyArK2FyZWEpCisgICAgICAgICAgeworICAgICAgICAgICAgc3RydWN0IGdseXBo ICpnbHlwaCA9IHJvdy0+Z2x5cGhzW2FyZWFdOworICAgICAgICAgICAgc3RydWN0IGdseXBoICpn bHlwaF9lbmQgPSBnbHlwaCArIHJvdy0+dXNlZFthcmVhXTsKKyAgICAgICAgICAgIC8qIEdseXBo IGZvciBhIGxpbmUgZW5kIGluIHRleHQuICovCisgICAgICAgICAgICBpZiAoYXJlYSA9PSBURVhU X0FSRUEgJiYgZ2x5cGggPT0gZ2x5cGhfZW5kICYmIGdseXBoLT5jaGFycG9zID4gMCkKKyAgICAg ICAgICAgICAgKytnbHlwaF9lbmQ7CisgICAgICAgICAgICBmb3IgKDsgZ2x5cGggPCBnbHlwaF9l bmQ7ICsrZ2x5cGgpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAodnBvcyAh PSB3LT5jdXJzb3IudnBvcworICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaCAhPSBnbHlwaF9l bmQgLSAxCisgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA8IHJlbGF0aXZl X3gKKyAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPCByZWxhdGl2ZV94CisgICAg ICAgICAgICAgICAgICAgICYmIE5JTFAgKEJWQVIgKGIsIG1jX2NvbmYpKSkKKyAgICAgICAgICAg ICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGlmICghTklMUCAoQlZBUiAoYiwgbWNfY29u ZikpCisgICAgICAgICAgICAgICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAg ICAgICAgICAgICAgICAgICB8fCAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgbWNfaW5hY3RpdmVfd2luZG93cykpKSkp CisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8qIFRoZSBzcGFjZSBh cHBlbmRlZCB0byBhIHJvdyBlbmRpbmcgd2l0aCBhIG5ldyBsaW5lIGRvZXMKKyAgICAgICAgICAg ICAgICAgICAgbm90IGhhdmUgYSBgZ2x5cGgtPmNoYXJwb3NgICgtMSwgMCkgdGhhdCB3ZSBjYW4g dXNlIGZvciB0aGlzCisgICAgICAgICAgICAgICAgICAgIHBhcnRpY3VsYXIgYXBwbGljYXRpb24u ICBXaGVuIGEgYGJ1ZmZlci1kaXNwbGF5LXRhYmxlJyBlbnRyeQorICAgICAgICAgICAgICAgICAg ICBhc3NpZ25zIGEgdmlzaWJsZSBnbHlwaCB0byBhIG5ldyBsaW5lLCB0aGVyZSBpcyBubyBwcm9i bGVtCisgICAgICAgICAgICAgICAgICAgIGJlY2F1c2UgdGhhdCBnbHlwaCBoYXMgYSBgZ2x5cGgt PmNoYXJwb3MnIHRoYXQgd2UgY2FuIHVzZS4KKyAgICAgICAgICAgICAgICAgICAgV2hlbiBubyB2 aXNpYmxlIEVPTCBnbHlwaCBleGlzdHMsIHdlIHVzZSB0aGUgZm9sbG93aW5nIHRlc3Q6CisgICAg ICAgICAgICAgICAgICAgIHRoZSBhcHBlbmRlZCBzcGFjZSBoYXMgYSBwb3NpdGlvbiB0aGF0IGlz IG9uZSBsZXNzIHRoYW4gdGhlCisgICAgICAgICAgICAgICAgICAgIGVuZCBvZiB0aGUgbWF0cml4 IHJvdy4gKi8KKyAgICAgICAgICAgICAgICAgICAgaW50IGhwb3MgPSBnbHlwaCAtIHJvdy0+Z2x5 cGhzW1RFWFRfQVJFQV07CisgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqcHJldmlv dXNfZ2x5cGggPSAoMCA8PSBocG9zIC0gMSAmJiBocG9zIC0gMSA8IHJvdy0+dXNlZFtURVhUX0FS RUFdKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgaHBvcyAtIDEKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTlVMTDsKKyAgICAgICAgICAgICAgICAg ICAgLy8gc3RydWN0IGdseXBoICpsYXN0X2dseXBoID0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSAr IHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMTsKKyAgICAgICAgICAgICAgICAgICAgYm9vbCBza2lw X3AgPSAocHJldmlvdXNfZ2x5cGggIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBwcmV2aW91c19nbHlwaC0+Y2hhcnBvcyA9PSBNQVRSSVhfUk9XX0VORF9DSEFS UE9TIChyb3cpIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlw aC0+Ynl0ZXBvcyAhPSBlc3NlbnRpYWxzLnp2X2J5dGUpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IHRydWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAv KiBXaGVuIGEgYGJ1ZmZlci1kaXNwbGF5LXRhYmxlJyBlbnRyeSBjb250YWlucworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGEgdmlzaWJsZSB0YWIgY2hhcmFjdGVyICgiwrsiKSwg dGhlIHN1YnNlcXVlbnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTVFJFVENI X0dMWVBIIHdpbGwgaGF2ZSB0aGUgc2FtZSBnbHlwaC0+Y2hhcnBvcworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGFzIHRoZSBhZm9yZW1lbnRpb25lZCB2aXNpYmxlIHRhYiBjaGFy YWN0ZXIuICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAocHJldmlvdXNf Z2x5cGggIT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHBy ZXZpb3VzX2dseXBoLT5jaGFycG9zID09IGdseXBoLT5jaGFycG9zKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyB0cnVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgaW50IHBvc2ludCA9IChyb3dfcG9z aXRpb24gPT0gUE9TVF9aVikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAt MQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAocm93X3Bvc2l0aW9uID09IEFU X1pWKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBlc3NlbnRpYWxzLnp2 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaC0+Ynl0ZXBvcyAhPSBl c3NlbnRpYWxzLnp2X2J5dGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbVEVYVF9BUkVBXSAt IDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPV19FTkRf Q0hBUlBPUyAocm93KSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGds eXBoLT5ieXRlcG9zID09IGVzc2VudGlhbHMuenZfYnl0ZQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+ dXNlZFtURVhUX0FSRUFdIC0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBlc3NlbnRpYWxzLnp2CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGdseXBo LT5jaGFycG9zOworICAgICAgICAgICAgICAgICAgICBMaXNwX09iamVjdCBzcGVjcyA9IG1jX2Fz c29jIChtYWtlX2ZpeG51bSAocG9zaW50KSwgQlZBUiAoYiwgbWNfY29uZikpOworICAgICAgICAg ICAgICAgICAgICBpZiAoKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAg ICAgICAgICAgICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAg ICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKHNwZWNzKQorICAgICAgICAgICAgICAgICAgICAg ICAgJiYgcm93LT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAgICAgICAgICAg ICAgICAgICAgJiYgIXNraXBfcAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0 aW9uICE9IFBPU1RfWlYpCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg ICAgICAgICAgTGlzcF9PYmplY3QgbGlzcF90eXBlID0gbWNfbnRoICgxLCBzcGVjcyk7CisgICAg ICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlID0gKENP TlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoWENBUiAobGlzcF90 eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKGxpc3BfdHlwZSk7CisgICAgICAgICAg ICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IChnbHlwaC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19IT0xMT1dfQk9YCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogY3Vyc29yX3R5cGU7CisgICAg ICAgICAgICAgICAgICAgICAgICBpbnQgY3Vyc29yX3dpZHRoID0gKENPTlNQIChsaXNwX3R5cGUp KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gWEZJWE5VTSAo WENBUiAoWENEUiAobGlzcF90eXBlKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiAtMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIExpc3BfT2JqZWN0IG1j X2ZvcmVncm91bmQgPSBtY19udGggKDIsIHNwZWNzKTsKKyAgICAgICAgICAgICAgICAgICAgICAg IHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFNUUklO R1AgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICBtY194d19jb2xv cl92YWx1ZXMgKHcsIG1jX2ZvcmVncm91bmQsICZsc2xfZmcpOworICAgICAgICAgICAgICAgICAg ICAgICAgICBlbHNlIGlmIChWRUNUT1JQIChtY19mb3JlZ3JvdW5kKSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsc2xfZmcucmVk ID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDApKTsKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGxzbF9mZy5ncmVlbiA9IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3Jl Z3JvdW5kLCAxKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsc2xfZmcuYmx1ZSA9 IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3JvdW5kLCAyKSk7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKE5JTFAg KG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWNfY29sb3Jf cGlja2VyICh3LCBnbHlwaCwgZXNzZW50aWFscywgJmxzbF9mZywKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaW50LCBjdXJzb3JfdHlwZSwgcm93X3Bv c2l0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBN VUxUSVBMRV9DVVJTT1JTKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCB2cG9zID0gTUFU UklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQg eF9saW1pdCA9IHRleHRfYXJlYV93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1jX2Vu Z2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICB4X2xpbWl0LCByb3ctPnksIGdseXBoIC0gcm93LT5n bHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdnBv cywgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgY3Vyc29yX21hdHJpeCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBsc2xfZmcs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1VTFRJUExFX0NVUlNPUlMsIGRy YXdfcCwgZnJvbV93aGVyZSwgTUNfQ0FDSEUpOworICAgICAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKGIsIGZj X3Zpc2libGUpKQorICAgICAgICAgICAgICAgICAgICAmJiAoZXNzZW50aWFscy5hY3RpdmVfcAor ICAgICAgICAgICAgICAgICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGZjX2luYWN0aXZlX3dpbmRv d3MpKSkpCisgICAgICAgICAgICAgICAgICAgIC8vICYmIGVzc2VudGlhbHMuZmNfeCA8PSB0ZXh0 X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194IDwgdGV4 dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSB3 LT5tYy5sbnVtX3BpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgICBpbnQgeF9saW1pdCA9IHRleHRfYXJlYV93aWR0aDsKKyAgICAgICAgICAgICAgICAg ICAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3AgPSAody0+Y3Vyc29yLnggPT0gZXNzZW50aWFscy5m Y194CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHct PmN1cnNvci55ID09IHJvdy0+eQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRf QVJFQV0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg dy0+Y3Vyc29yLnZwb3MgPT0gdnBvcyk7CisgICAgICAgICAgICAgICAgICAgIGludCBocG9zID0g Z2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgICAgICAgICAgICBzdHJ1 Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICAgICAgICAgICAgbWNfY29sb3JfcGlja2VyICh3 LCBnbHlwaCwgZXNzZW50aWFscywgJmxzbF9mZywgLTEsIE1DX0JBUiwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICByb3dfcG9zaXRpb24sIEZJTExfQ09MVU1OKTsKKyAgICAg ICAgICAgICAgICAgICAgaWYgKGhwb3MgPj0gaHBvc19zdGFydAorICAgICAgICAgICAgICAgICAg ICAgICAgJiYgaHBvcyA8IGhwb3Nfc3RhcnQgKyBocG9zX2xlbmd0aAorICAgICAgICAgICAgICAg ICAgICAgICAgLy8gJiYgcmVsYXRpdmVfeCArIGdseXBoLT5waXhlbF93aWR0aCA8PSB0ZXh0X2Fy ZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIHJlbGF0aXZlX3ggPCB0ZXh0X2Fy ZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICgoaGVhZGVyX2xpbmVfZm9ybWF0 ID4gMCAmJiB2cG9zID4gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBoZWFkZXJf bGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICgoZ2x5cGggIT0g Z2x5cGhfZW5kIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxz LmZjX3ggPj0gcmVsYXRpdmVfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBlc3Nl bnRpYWxzLmZjX3ggPCByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHx8IChnbHlwaCA9PSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSByZWxhdGl2ZV94KSkK KyAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21f eSAodykKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisg ICAgICAgICAgICAgICAgICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIGFy ZWEsIHJlbGF0aXZlX3gsIHhfbGltaXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICByb3ctPnksIGhwb3MsIHZwb3MsIE1DX0JBUiwgMSwgY3Vyc29yX21hdHJpeCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgbHNsX2Zn LCBGSUxMX0NPTFVNTiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdfcCwg ZnJvbV93aGVyZSwgRkNfQ0FDSEUpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICAgIGlmICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAg ICYmICFOSUxQIChCVkFSIChiLCBjaF9ob3Jpem9udGFsX3J1bGVyKSkKKyAgICAgICAgICAgICAg ICAgICAgJiYgKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8 ICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFO SUxQIChCVkFSIChiLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkpKQorICAgICAgICAgICAgICAgICAg ICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zKQorICAgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgICBpbnQgeF9saW1pdCA9IHRleHRfYXJlYV93aWR0aDsKKyAgICAgICAgICAg ICAgICAgICAgaW50IGhwb3MgPSBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAg ICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAgICAgICAgICAgICAgICAg ICBtY19jb2xvcl9waWNrZXIgKHcsIGdseXBoLCBlc3NlbnRpYWxzLCAmbHNsX2ZnLCAtMSwgTUNf SEJBUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb3dfcG9zaXRpb24s IEhPUklaT05UQUxfUlVMRVIpOworICAgICAgICAgICAgICAgICAgICAvKiBQcmVzZXJ2ZSBzdXBw b3J0IGZvciBkZWZhdWx0IGJlaGF2aW9yIHN1Y2ggdGhhdCBhIHVzZXIgbWF5CisgICAgICAgICAg ICAgICAgICAgIHNwZWNpZnkgdGhlIGhlaWdodCBvZiBhbiBNQ19IQkFSLCB3aGljaCBiZWdpbnMg aXRzIGpvdXJuZXkKKyAgICAgICAgICAgICAgICAgICAgYXMgdGhlIGBjdXJzb3Jfd2lkdGgnLiAg YG1jX2dldF9jdXJzb3JfZ2VvbWV0cnknIHJlYWRqdXN0cy4gKi8KKyAgICAgICAgICAgICAgICAg ICAgaWYgKGhwb3MgPj0gaHBvc19zdGFydAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgaHBv cyA8IGhwb3Nfc3RhcnQgKyBocG9zX2xlbmd0aCkKKyAgICAgICAgICAgICAgICAgICAgICBtY19l bmdpbmUgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgYXJlYSwgcmVsYXRpdmVfeCwgeF9saW1pdCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvdy0+eSwgaHBvcywgdnBvcywgTUNf SEJBUiwgMSwgY3Vyc29yX21hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgbHNsX2ZnLCBIT1JJWk9OVEFMX1JVTEVSLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhd19wLCBmcm9tX3doZXJlLCBDSF9DQUNI RSk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKCFOSUxQIChCVkFS IChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIs IGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAgJiYgKGVzc2VudGlhbHMu YWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8ICghZXNzZW50aWFscy5hY3RpdmVf cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9pbmFj dGl2ZV93aW5kb3dzKSkpKQorICAgICAgICAgICAgICAgICAgICAmJiAhZmlsbF9jb2x1bW5fdHJ1 bXBzX3ApCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90 eXBlID0gKGdseXBoLT50eXBlID09IElNQUdFX0dMWVBIKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gTUNfSE9MTE9XX0JPWAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogTUNfQkFSOworICAgICAgICAgICAgICAgICAgICBpbnQgeF9saW1pdCA9IHRleHRf YXJlYV93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3Ag PSAody0+Y3Vyc29yLnkgPT0gcm93LT55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAgICAg ICAgICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAg ICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgICAgICAgICAg IG1jX2NvbG9yX3BpY2tlciAodywgZ2x5cGgsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0xLCBjdXJz b3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb3dfcG9zaXRp b24sIFZFUlRJQ0FMX1JVTEVSKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGhwb3MgPj0gaHBv c19zdGFydAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA8IGhwb3Nfc3RhcnQgKyBo cG9zX2xlbmd0aAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKChoZWFkZXJfbGluZV9mb3Jt YXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGhlYWRl cl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKChnbHlwaCAh PSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNv ci54ID49IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vy c29yLnggPCByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHx8IChnbHlwaCA9PSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHJlbGF0aXZlX3gpKQorICAgICAgICAg ICAgICAgICAgICAgICAgJiYgcm93LT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAg ICAgICAgICAgICAgICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAg ICAgICAgICAgICBtY19lbmdpbmUgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgYXJlYSwgcmVsYXRp dmVfeCwgeF9saW1pdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvdy0+eSwg aHBvcywgdnBvcywgY3Vyc29yX3R5cGUsIDEsIGN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGxzbF9mZywgVkVS VElDQUxfUlVMRVIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3X3AsIGZy b21fd2hlcmUsIENIX0NBQ0hFKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAg ICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgfQorICAg ICAgICAgIH0KKyAgICAgIH0KKyAgLy8gIGNsb2NrX3QgY2xvY2tfZW5kID0gY2xvY2soKTsKKyAg Ly8gIGRvdWJsZSBjcHVfdGltZV91c2VkID0gKChkb3VibGUpIChjbG9ja19lbmQgLSBjbG9ja19z dGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7CisgIC8vICBmcHJpbnRmIChzdGRlcnIsICJtY19kcmF3 X3JvdyAoJXMpOiAgVElNRSAoJWYpXG4iLCBtY193aW5kb3cgKHcpLCBjcHVfdGltZV91c2VkKTsK K30KKworYm9vbAorbWNfcmVkcmF3X3JvdyAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBo X21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICBl bnVtIGdseXBoX3Jvd19hcmVhIGFyZWEsIGludCBzdGFydF94LCBpbnQgc3RhcnRfaHBvcywgaW50 IGVuZF9ocG9zLAorICAgICAgICAgICAgICAgYm9vbCBjbGVhcl9lb2xfcCwgZW51bSBkcmF3X2ds eXBoc19mYWNlIGhsLAorICAgICAgICAgICAgICAgZW51bSBtY19yZWRyYXdfcm93X3R5cGUgZnJv bV93aGVyZSkKK3sKKyAgYm9vbCBnb19wID0gKCh3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW01D X0NBQ0hFXSA+IDAKKyAgICAgICAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191c2Vk W0NIX0NBQ0hFXSA+IDAKKyAgICAgICAgICAgICAgICB8fCB3LT5tY19tYXRyaXguY3Vyc29yc191 c2VkW0ZDX0NBQ0hFXSA+IDAp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hcnQgPSBjbG9jaygpOwor ICBpZiAoZW5kX2hwb3MgPiBzdGFydF9ocG9zKQorICAgIHggPSBtY19kcmF3X2dseXBocyAodywg bWF0cml4LCByb3csIHctPm1jX21hdHJpeCwgc3RhcnRfeCwgVEVYVF9BUkVBLAorICAgICAgICAg ICAgICAgICAgICAgICAgc3RhcnRfaHBvcywgZW5kX2hwb3MsIGhsLCBvdmVybGFwcywgdnBvcywg bHNsLAorICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwg d2QsIGFjdGl2ZV9wLCBjdXJzb3JfZ2NfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgIE1DX0RS QVdfR0xZUEhfU1RSSU5HLCBkcmF3X3ApOworICAvLyAgY2xvY2tfdCBjbG9ja19lbmQgPSBjbG9j aygpOworICAvLyAgZG91YmxlIHRpbWVfZ2x5cGhzID0gKChkb3VibGUpIChjbG9ja19lbmQgLSBj bG9ja19zdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7CisgIC8qIGByZWRyYXdfb3ZlcmxhcHBlZF9y b3dzJyBjYWxscyBgcmlmLT5jbGVhcl9lbmRfb2ZfbGluZScuICovCisgIGlmIChjbGVhcl9lb2xf cAorICAgICAgJiYgZW5kX2hwb3MgPiBzdGFydF9ocG9zKQorICAgIHsKKyAgICAgIC8qIEFkdmFu Y2UgdGhlIG91dHB1dCBjdXJzb3IuICovCisgICAgICB3LT5vdXRwdXRfY3Vyc29yLmhwb3MgPSBl bmRfaHBvczsKKyAgICAgIHctPm91dHB1dF9jdXJzb3IueCA9IHg7CisgICAgICBGUkFNRV9SSUYg KGYpLT5jbGVhcl9lbmRfb2ZfbGluZSAodywgcm93LCBURVhUX0FSRUEsIC0xKTsKKyAgICB9Cisg IC8vICBjbG9ja19zdGFydCA9IGNsb2NrKCk7CisgIGludCB2bnRoID0gTUFUUklYX1JPV19WUE9T IChyb3csIG1hdHJpeCk7CisgIC8qIFNUUkVUQ0hfR0xZUEggbWF5IGNvbnRhaW4gbW9yZSB0aGFu IG9uZSBmYWtlIGN1cnNvciBhdCB0aGUgc2FtZSBIUE9TLiAqLworICBmb3IgKGVudW0gbWNfY2Fj aGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7CisgICAgICAgY2FjaGVfdHlwZSA8IE5PX0NB Q0hFOworICAgICAgICsrY2FjaGVfdHlwZSkKKyAgICB7CisgICAgICBmb3IgKGludCBudGggPSAw OworICAgICAgICAgICBtY190cmF2ZXJzZV9jYWNoZV9wICh3LT5tY19tYXRyaXgsIGNhY2hlX3R5 cGUsIHZudGgsIG50aCk7CisgICAgICAgICAgICsrbnRoKQorICAgICAgICB7CisgICAgICAgICAg aW50IHggPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLng7 CisgICAgICAgICAgaW50IGZ4ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXS5meDsKKyAgICAgICAgICBpbnQgeSA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF0ueTsKKyAgICAgICAgICBpbnQgZnkgPSB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZ5OworICAgICAgICAgIGludCBo cG9zID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5ocG9z OworICAgICAgICAgIGludCB2cG9zID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXS52cG9zOworICAgICAgICAgIGludCB3ZCA9IHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ud2Q7CisgICAgICAgICAgaW50IGggPSB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmg7CisgICAgICAgICAg ZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF0uY3Vyc29yX3R5cGU7CisgICAgICAgICAgaW50IGN1cnNv cl93aWR0aCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0u Y3Vyc29yX3dpZHRoOworICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnID0gey5yZWQgPSB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZnLnJlZCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZnLmdyZWVuLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIC5ibHVlID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXS5mZy5ibHVlfTsKKyAgICAgICAgICAvLyAgc3RydWN0IG1jX1JHQiBs c2xfYmcgPSB7LnJlZCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF0uYmcucmVkLAorICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3Jl ZW4gPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLmdy ZWVuLAorICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmcuYmx1ZX07CisgICAg ICAgICAgYm9vbCBhY3RpdmVfcCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF0uYWN0aXZlX3A7CisgICAgICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxh dm9yID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5nbHlw aF9mbGF2b3I7CisgICAgICAgICAgYm9vbCBlbmFibGVkX3AgPSB3LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmVuYWJsZWRfcDsKKyAgICAgICAgICBpZiAodnBv cyA9PSB2bnRoCisgICAgICAgICAgICAgICYmICgoaHBvcyA+PSBzdGFydF9ocG9zCisgICAgICAg ICAgICAgICAgICAgJiYgaHBvcyA8IGVuZF9ocG9zKQorICAgICAgICAgICAgICAgICAgLyogQSBm bG9hdGluZyBjdXJzb3IgYmV5b25kIHRoZSBlbmQgb2YgdGhlIGdseXBoIHJvdy4gKi8KKyAgICAg ICAgICAgICAgICAgIHx8IChocG9zICsgMSA9PSBzdGFydF9ocG9zCisgICAgICAgICAgICAgICAg ICAgICAgJiYgaHBvcyArIDEgPT0gZW5kX2hwb3MpKQorICAgICAgICAgICAgICAmJiBlbmFibGVk X3ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGJvb2wgcmVtb3ZlX3AgPSBmYWxzZTsK KyAgICAgICAgICAgICAgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHcsIG1hdHJpeCwgcm93LCB4LCBm eCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgbHNsX2ZnLCBhY3RpdmVfcCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgcmVtb3ZlX3Ap OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICByZXR1cm4gdHJ1ZTsKKyAgLy8g IGNsb2NrX2VuZCA9IGNsb2NrKCk7CisgIC8vICBkb3VibGUgdGltZV9jdXJzb3JzID0gKChkb3Vi bGUpIChjbG9ja19lbmQgLSBjbG9ja19zdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7CisgIC8vICBm cHJpbnRmIChzdGRlcnIsICJtY19yZWRyYXdfcm93ICglZCk6ICBocG9zICglZC8lZCkgfCBnbHlw aHMgKCVmKSB8IGN1cnNvcnMgKCVmKVxuIiwKKyAgLy8gICAgICAgICAgICAgICAgICAgdnBvcywg c3RhcnRfaHBvcywgZW5kX2hwb3MsIHRpbWVfZ2x5cGhzLCB0aW1lX2N1cnNvcnMpOworfQorCit2 b2lkCittY19lcmFzZV9yb3cgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXgg Km1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93KQoreworICBpbnQgdm50aCA9IE1BVFJJWF9S T1dfVlBPUyAocm93LCBtYXRyaXgpOworICBpZiAobWNfc3RkZXJyX3ApCisgICAgZnByaW50ZiAo c3RkZXJyLCAibWNfZXJhc2Vfcm93ICglcyk6ICB2cG9zICglZClcbiIsIG1jX3dpbmRvdyAodyks IHZudGgpOworICAvLyAgaWYgKG1jX3N0ZGVycl9wKQorICAvLyAgICBmcHJpbnRmIChzdGRlcnIs ICJtY19lcmFzZV9oZWxwZXIgKCVzKTogIGNhY2hlICglcykgfCB2cG9zICglZClcbiIsCisgIC8v ICAgICAgbWNfd2luZG93ICh3KSwgbWNfY2FjaGVfdHlwZV90b19zdHJpbmcgKGNhY2hlX3R5cGUp LCB2bnRoKTsKKyAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hF OworICAgICAgIGNhY2hlX3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICArK2NhY2hlX3R5cGUpCisg ICAgeworICAgICAgZm9yIChpbnQgbnRoID0gMDsKKyAgICAgICAgICAgbWNfdHJhdmVyc2VfY2Fj aGVfcCAody0+bWNfbWF0cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGgpOworICAgICAgICAgICAr K250aCkKKyAgICAgICAgeworICAgICAgICAgIGludCB4ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS54OworICAgICAgICAgIGludCBmeCA9IHctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZng7CisgICAgICAgICAgaW50 IHkgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLnk7Cisg ICAgICAgICAgaW50IGZ5ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXS5meTsKKyAgICAgICAgICBpbnQgaHBvcyA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF0uaHBvczsKKyAgICAgICAgICBpbnQgdnBvcyA9IHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0udnBvczsKKyAgICAgICAg ICBpbnQgd2QgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhd LndkOworICAgICAgICAgIGludCBoID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXS5oOworICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5 cGUgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmN1cnNv cl90eXBlOworICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGggPSB3LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmN1cnNvcl93aWR0aDsKKyAgICAgICAgICAvLyAg c3RydWN0IG1jX1JHQiBsc2xfZmcgPSB7LnJlZCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF0uZmcucmVkLAorICAgICAgICAgIC8vICAgICAgICAgICAgICAg ICAgICAgICAgICAuZ3JlZW4gPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhdLmZnLmdyZWVuLAorICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAg ICAuYmx1ZSA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0u ZmcuYmx1ZX07CisgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfYmcgPSB7LnJlZCA9IHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmcucmVkLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmcuZ3JlZW4sCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgLmJsdWUgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhdLmJnLmJsdWV9OworICAgICAgICAgIGJvb2wgYWN0aXZlX3AgPSB3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmFjdGl2ZV9wOworICAgICAg ICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGhfZmxhdm9yOworICAgICAgICAgIGJvb2wgZW5h YmxlZF9wID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5l bmFibGVkX3A7CisgICAgICAgICAgLyogYG1hdHJpeF9yb3cnIGluIGBkaXNwbmV3LmNgIGNvbnRh aW5zIHRoZSBmb2xsb3dpbmcgdGVzdHMsCisgICAgICAgICAgZWFzc2VydCAobWF0cml4ICYmIG1h dHJpeC0+cm93cyk7CisgICAgICAgICAgZWFzc2VydCAocm93ID49IDAgJiYgcm93IDwgbWF0cml4 LT5ucm93cyk7ICovCisgICAgICAgICAgYm9vbCBiYXJmX2NyYXNoX29uZSA9IChtYXRyaXggJiYg bWF0cml4LT5yb3dzKSA/IGZhbHNlIDogdHJ1ZTsKKyAgICAgICAgICBpZiAoYmFyZl9jcmFzaF9v bmUpCisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICBib29sIGJhcmZfY3Jhc2hfdHdv ID0gKHZwb3MgPj0gMCAmJiB2cG9zIDwgbWF0cml4LT5ucm93cykgPyBmYWxzZSA6IHRydWU7Cisg ICAgICAgICAgaWYgKGJhcmZfY3Jhc2hfdHdvKQorICAgICAgICAgICAgY29udGludWU7CisgICAg ICAgICAgaWYgKHZwb3MgPT0gdm50aAorICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgPT0g TUNfR0xZUEgKKyAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAgICAgeworICAg ICAgICAgICAgICBtY19lcmFzZV9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB3LT5tY19tYXRyaXgs IHgsIHksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGhf Zmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QpOworICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmVuYWJsZWRfcCA9IGZhbHNlOworICAgICAg ICAgICAgICAtLXctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVfdHlwZV07CisgICAgICAg ICAgICB9CisgICAgICAgICAgICBlbHNlIGlmICh2cG9zID09IHZudGgKKyAgICAgICAgICAgICAg ICAgICAgICYmIGVuYWJsZWRfcCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGJv b2wgcmVtb3ZlX3AgPSB0cnVlOworICAgICAgICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlk ICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0 aCwgbHNsX2JnLCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgZ2x5cGhfZmxhdm9yLCByZW1vdmVfcCk7CisgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFibGVkX3AgPSBmYWxzZTsKKyAg ICAgICAgICAgICAgICAtLXctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVfdHlwZV07Cisg ICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVfdXNlZFtjYWNoZV90eXBlXSA9IDA7CisgICAgfQorfQorCisvKiBFcmFzZSBmYWtlIGN1 cnNvcnMgZnJvbSAobWluLCBydW4uY3VycmVudF95LCBydW4uZGVzaXJlZF95KSB0byBlbmQgb2Yg d2luZG93LgorICBUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfRE9XTjoKKyAgICBy dW4uaGVpZ2h0ID0gaXQubGFzdF92aXN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29fcCA9IChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAg ICAgICAgICAmJiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWly cykpCisgICAgICAgICAgICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIGZjX3Zpc2libGUpKQorICAgICAgICAgICAgICAgICAgICAgICB8fCAhTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkpKTsKKyAgaWYgKG1jX3N0ZGVy cl9wKQorICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX3ByZV9zY3JvbGxfY2xlYW4gKCVzKTpcblwK KyAgJXMgfCBnb19vbmVfcCAoJXMpIHwgZ29fdHdvX3AgKCVzKVxuXAorICBzdGFydF92cG9zICgl ZCkgfCBucm93c19zY3JvbGxlZCAoJWQpXG5cCisgICVzOiAgcnVuLmN1cnJlbnQvZGVzaXJlZF95 ICglZC8lZCkgfCBydW4uaGVpZ2h0ICglZClcbiIsCisgICAgbWNfd2luZG93ICh3KSwgKGZyb21f d2hlcmUgPT0gVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX0RPV04pCisgICAgICAg ICAgICAgICAgICAgICA/ICJUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfRE9XTiIK KyAgICAgICAgICAgICAgICAgICA6IChmcm9tX3doZXJlID09IFRSWV9XSU5ET1dfUkVVU0lOR19D VVJSRU5UX01BVFJJWF9VUCkKKyAgICAgICAgICAgICAgICAgICAgID8gIlRSWV9XSU5ET1dfUkVV U0lOR19DVVJSRU5UX01BVFJJWF9VUCIKKyAgICAgICAgICAgICAgICAgICA6IChmcm9tX3doZXJl ID09IFRSWV9XSU5ET1dfSUQpCisgICAgICAgICAgICAgICAgICAgICA/ICJUUllfV0lORE9XX0lE IgorICAgICAgICAgICAgICAgICAgIDogIlVOS05PV04iLAorICAgIGdvX29uZV9wID8gInllcyIg OiAibm8iLCBnb190d29fcCA/ICJ5ZXMiIDogIm5vIiwKKyAgICBzdGFydF92cG9zLCBucm93c19z Y3JvbGxlZCwKKyAgICBydW4uY3VycmVudF95IDwgcnVuLmRlc2lyZWRfeSA/ICLihpMiIDogIuKG kSIsCisgICAgcnVuLmN1cnJlbnRfeSwgcnVuLmRlc2lyZWRfeSwgcnVuLmhlaWdodCk7CisgIGlm ICghZ29fb25lX3AgJiYgIWdvX3R3b19wKQorICAgIHJldHVybjsKKyAgYm9vbCB1cGRhdGluZ19m cmFtZV9wID0gZmFsc2U7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOwor ICBpZiAoWEZSQU1FICh3LT5mcmFtZSkgIT0gZi0+bWNfdXBkYXRpbmdfZnJhbWUKKyAgICAgICYm IChnb19vbmVfcCB8fCBnb190d29fcCkpCisgICAgeworICAgICAgdXBkYXRpbmdfZnJhbWVfcCA9 IHRydWU7CisgICAgICB1cGRhdGVfYmVnaW4gKGYpOworICAgIH0KKyAgaWYgKHctPnBoeXNfY3Vy c29yX29uX3AKKyAgICAgICYmIGdvX3R3b19wKQorICAgIGVyYXNlX3BoeXNfY3Vyc29yICh3KTsK KyAgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgIGZv ciAoaW50IHZudGggPSBzdGFydF92cG9zOworICAgICAgIG1hdHJpeCAhPSBOVUxMCisgICAgICAg JiYgdm50aCA8IG1hdHJpeC0+bnJvd3MKKyAgICAgICAmJiBNQVRSSVhfUk9XIChtYXRyaXgsIHZu dGgpLT5lbmFibGVkX3AKKyAgICAgICAmJiBnb19vbmVfcDsKKyAgICAgICArK3ZudGgpCisgICAg eworICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93ID0gTUFUUklYX1JPVyAobWF0cml4LCB2bnRo KTsKKyAgICAgIG1jX2VyYXNlX3JvdyAodywgbWF0cml4LCByb3cpOworICAgIH0KKyAgaWYgKHVw ZGF0aW5nX2ZyYW1lX3ApCisgICAgdXBkYXRlX2VuZCAoZik7CisgIC8vIG1jX3Jlc2V0X2NhY2hl ICh3KTsKK30KKworREVGVU4gKCJtYy1zdGRlcnIiLCBGbWNfc3RkZXJyLCBTbWNfc3RkZXJyLCAw LCAxLCAiUCIsCisgICAgICAgZG9jOiAvKiBUb2dnbGUgdHJhY2luZyBvZiBtdWx0aXBsZSBmYWtl IGN1cnNvcnMuCitXaXRoIEFSRywgdHVybiB0cmFjaW5nIG9uIGlmIGFuZCBvbmx5IGlmIEFSRyBp cyBwb3NpdGl2ZS4gKi8pCisgIChMaXNwX09iamVjdCBhcmcpCit7CisgIGlmIChOSUxQIChhcmcp KQorICAgIG1jX3N0ZGVycl9wID0gIW1jX3N0ZGVycl9wOworICBlbHNlCisgICAgeworICAgICAg YXJnID0gRnByZWZpeF9udW1lcmljX3ZhbHVlIChhcmcpOworICAgICAgbWNfc3RkZXJyX3AgPSBY RklYTlVNIChhcmcpID4gMDsKKyAgICB9CisgIHJldHVybiBRbmlsOworfQorCisvKiBlbmQgTVVM VElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogDAogLyoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqCiAJCSAgICAgIFdpbmRvdyBkaXNwbGF5IGRpbWVuc2lvbnMKQEAgLTEzNTExLDYg KzE4Mzk3LDY5IEBAIGhzY3JvbGxfd2luZG93X3RyZWUgKExpc3BfT2JqZWN0IHdpbmRvdykKIAkg ICAgICBlbHNlCiAJCXB0ID0gY2xpcF90b19ib3VuZHMgKEJFR1YsIG1hcmtlcl9wb3NpdGlvbiAo dy0+cG9pbnRtKSwgWlYpOwogCisKKy8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cG9zPTB4MTIxMjQzZDUwKSBhdCB4ZGlzcC5jOjgy OTkKKyM2ICAweDAwMDAwMDAxMDAwNGQzN2UgaW4gaW5pdF90b19yb3dfc3RhcnQgKGl0PTB4N2Zm ZjVmYmY5ZTMwLCB3PTB4MTFiZjcyYzk4LAorICAgIHJvdz0weDEyMTI0M2QwMCkgYXQgeGRpc3Au Yzo4NDIzCisjNyAgMHgwMDAwMDAwMTAwMDZjM2Y3IGluIGhzY3JvbGxfd2luZG93X3RyZWUgKHdp bmRvdz0uLi4pIGF0IHhkaXNwLmM6MTg1NDYKKyovCisKKyAgLyogYGluaXRfaXRlcmF0b3InOiAg ZWFzc2VydCAoY2hhcnBvcyA8IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwg KGNoYXJwb3MgPj0gQlVGX0JFRyAoY3VycmVudF9idWZmZXIpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBjaGFycG9zIDw9IFpWKSk7ICovCisKKyAgc3RydWN0IGRpc3Bs YXlfcG9zICpwb3MgPSAmY3Vyc29yX3Jvdy0+c3RhcnQ7CisgIHB0cmRpZmZfdCBjaGFycG9zID0g Q0hBUlBPUyAocG9zLT5wb3MpOworCisgIGJvb2wgYmFyZl9jcmFzaF9vbmUgPSAoY2hhcnBvcyA8 IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICB8fCAoY2hhcnBvcyA+PSBCVUZfQkVHIChjdXJy ZW50X2J1ZmZlcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY2hhcnBvcyA8PSBa VikpCisgICAgICAgICAgICAgICAgICAgICAgICA/IGZhbHNlCisgICAgICAgICAgICAgICAgICAg ICAgICA6IHRydWU7CisgIGlmIChiYXJmX2NyYXNoX29uZSkKKyAgICByZXR1cm4gaHNjcm9sbGVk X3A7CisKKyAgLyogYHJlc2VhdF8xJzogIENIQVJQT1MgKHBvcykgPj0gQkVHViAmJiBDSEFSUE9T IChwb3MpIDw9IFpWICovCisgIGJvb2wgYmFyZl9jcmFzaF90d28gPSAoY2hhcnBvcyA+PSBCRUdW ICYmIGNoYXJwb3MgPD0gWlYpCisgICAgICAgICAgICAgICAgICAgICAgICAgPyBmYWxzZQorICAg ICAgICAgICAgICAgICAgICAgICAgIDogdHJ1ZTsKKyAgaWYgKGJhcmZfY3Jhc2hfdHdvKQorICAg IHJldHVybiBoc2Nyb2xsZWRfcDsKKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKIAkgICAgICAvKiBNb3ZlIGl0ZXJhdG9yIHRvIHB0IHN0 YXJ0aW5nIGF0IGN1cnNvcl9yb3ctPnN0YXJ0IGluCiAJCSBhIGxpbmUgd2l0aCBpbmZpbml0ZSB3 aWR0aC4gICovCiAJICAgICAgaW5pdF90b19yb3dfc3RhcnQgKCZpdCwgdywgY3Vyc29yX3Jvdyk7 CkBAIC0xNDM5Nyw5ICsxOTM0NiwyMiBAQCByZWRpc3BsYXlfaW50ZXJuYWwgKHZvaWQpCiAJICAg ICAgKnctPmRlc2lyZWRfbWF0cml4LT5tZXRob2QgPSAwOwogCSAgICAgIGRlYnVnX21ldGhvZF9h ZGQgKHcsICJvcHRpbWl6YXRpb24gMSIpOwogI2VuZGlmCisKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNU RU0KKyAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgJiYgIU5JTFAgKEJWQVIgKFhC VUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgIG1jX3VwZGF0ZV93aW5kb3df ZnJpbmdlcyAodywgZmFsc2UpOworICAgIGVsc2UKIAkgICAgICB1cGRhdGVfd2luZG93X2ZyaW5n ZXMgKHcsIGZhbHNlKTsKICNlbmRpZgorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJ ICAgICAgZ290byB1cGRhdGU7CiAJICAgIH0KIAkgIGVsc2UKQEAgLTE3NzkyLDEwICsyMjc1NCwy MiBAQCByZWRpc3BsYXlfd2luZG93IChMaXNwX09iamVjdCB3aW5kb3csIGJvb2wganVzdF90aGlz X29uZV9wKQogICAgIH0KIAogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQorCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGJvb2wga2VlcF9j dXJyZW50X3AgPSAoanVzdF90aGlzX29uZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwg KCF1c2VkX2N1cnJlbnRfbWF0cml4X3AgJiYgIW92ZXJsYXlfYXJyb3dfc2VlbikKKyAgICAgICAg ICAgICAgICAgICAgICAgICB8fCB3LT5wc2V1ZG9fd2luZG93X3ApOworCisgIGJvb2wgZnJpbmdl c191cGRhdGVkX3AgPSAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWly cykpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY191cGRhdGVfd2luZG93X2ZyaW5n ZXMgKHcsIGtlZXBfY3VycmVudF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgOiB1cGRh dGVfd2luZG93X2ZyaW5nZXMgKHcsIGtlZXBfY3VycmVudF9wKTsKKwogICBpZiAoRlJBTUVfV0lO RE9XX1AgKGYpCi0gICAgICAmJiB1cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIChqdXN0X3RoaXNf b25lX3AKLQkJCQkgICAgfHwgKCF1c2VkX2N1cnJlbnRfbWF0cml4X3AgJiYgIW92ZXJsYXlfYXJy b3dfc2VlbikKLQkJCQkgICAgfHwgdy0+cHNldWRvX3dpbmRvd19wKSkpCisgICAgICAmJiBmcmlu Z2VzX3VwZGF0ZWRfcCkKICAgICB7CiAgICAgICB1cGRhdGVfYmVnaW4gKGYpOwogICAgICAgYmxv Y2tfaW5wdXQgKCk7CkBAIC0xNzgxMCw2ICsyMjc4NCw5IEBAIHJlZGlzcGxheV93aW5kb3cgKExp c3BfT2JqZWN0IHdpbmRvdywgYm9vbCBqdXN0X3RoaXNfb25lX3ApCiAgICAgICB1cGRhdGVfZW5k IChmKTsKICAgICB9CiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgaWYgKFdJTkRP V19CT1RUT01fRElWSURFUl9XSURUSCAodykpCiAgICAgZ3VpX2RyYXdfYm90dG9tX2RpdmlkZXIg KHcpOwogI2VuZGlmIC8qIEhBVkVfV0lORE9XX1NZU1RFTSAqLwpAQCAtMTgxMjUsNiArMjMxMDIs MTYgQEAgdHJ5X3dpbmRvd19yZXVzaW5nX2N1cnJlbnRfbWF0cml4IChzdHJ1Y3Qgd2luZG93ICp3 KQogCSAgICAgIHVwZGF0ZV9iZWdpbiAoZik7CiAJICAgICAgZ3VpX3VwZGF0ZV93aW5kb3dfYmVn aW4gKHcpOwogCSAgICAgIEZSQU1FX1JJRiAoZiktPmNsZWFyX3dpbmRvd19tb3VzZV9mYWNlICh3 KTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8K KworICAgIG1jX3ByZV9zY3JvbGxfY2xlYW4gKHcsIHJ1biwgc3RhcnRfdnBvcywgbnJvd3Nfc2Ny b2xsZWQsIFRSWV9XSU5ET1dfUkVVU0lOR19DVVJSRU5UX01BVFJJWF9ET1dOKTsKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogCSAgICAgIEZSQU1FX1JJRiAoZiktPnNjcm9sbF9ydW5f aG9vayAodywgJnJ1bik7CiAJICAgICAgZ3VpX3VwZGF0ZV93aW5kb3dfZW5kICh3LCBmYWxzZSwg ZmFsc2UpOwogCSAgICAgIHVwZGF0ZV9lbmQgKGYpOwpAQCAtMTgyOTEsNiArMjMyNzgsMTYgQEAg dHJ5X3dpbmRvd19yZXVzaW5nX2N1cnJlbnRfbWF0cml4IChzdHJ1Y3Qgd2luZG93ICp3KQogCSAg dXBkYXRlX2JlZ2luIChmKTsKIAkgIGd1aV91cGRhdGVfd2luZG93X2JlZ2luICh3KTsKIAkgIEZS QU1FX1JJRiAoZiktPmNsZWFyX3dpbmRvd19tb3VzZV9mYWNlICh3KTsKKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIG1jX3ByZV9zY3Jv bGxfY2xlYW4gKHcsIHJ1biwgc3RhcnRfdnBvcywgbnJvd3Nfc2Nyb2xsZWQsIFRSWV9XSU5ET1df UkVVU0lOR19DVVJSRU5UX01BVFJJWF9VUCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor CisKIAkgIEZSQU1FX1JJRiAoZiktPnNjcm9sbF9ydW5faG9vayAodywgJnJ1bik7CiAJICBndWlf dXBkYXRlX3dpbmRvd19lbmQgKHcsIGZhbHNlLCBmYWxzZSk7CiAJICB1cGRhdGVfZW5kIChmKTsK QEAgLTE5MjQ1LDYgKzI0MjQyLDE2IEBAIHRyeV93aW5kb3dfaWQgKHN0cnVjdCB3aW5kb3cgKncp CiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCiAJICBndWlfdXBkYXRlX3dpbmRvd19iZWdpbiAo dyk7CiAJICBGUkFNRV9SSUYgKGYpLT5jbGVhcl93aW5kb3dfbW91c2VfZmFjZSAodyk7CisKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICBt Y19wcmVfc2Nyb2xsX2NsZWFuICh3LCBydW4sIGZpcnN0X3VuY2hhbmdlZF9hdF9lbmRfdnBvcywg ZHZwb3MsIFRSWV9XSU5ET1dfSUQpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJ ICBGUkFNRV9SSUYgKGYpLT5zY3JvbGxfcnVuX2hvb2sgKHcsICZydW4pOwogCSAgZ3VpX3VwZGF0 ZV93aW5kb3dfZW5kICh3LCBmYWxzZSwgZmFsc2UpOwogI2VuZGlmCkBAIC0yMTUyOCw2ICsyNjUz NSwxNyBAQCBtYXliZV9wcm9kdWNlX2xpbmVfbnVtYmVyIChzdHJ1Y3QgaXQgKml0KQogICAgICAg U0VUX1RFWFRfUE9TICh0ZW1faXQucG9zaXRpb24sIC0xLCAtMSk7CiAgICAgICBQUk9EVUNFX0dM WVBIUyAoJnRlbV9pdCk7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKKyAgICAgIC8qIFRoaXMgcGVybWl0cyB1cyB0byBpbnNwZWN0IHRoZSBI UE9TIG9mIGxpbmUgbnVtYmVyIGdseXBocyBhbmQgdGhlIHNwYWNlCisgICAgICBwYWRkaW5nIGJl Zm9yZS9hZnRlciB0aGUgbGluZSBudW1iZXJzLiAgV2Ugc2V0IGBnbHlwaC0+aHBvc2AgZWxzZXdo ZXJlLiAqLworICAgICAgdGVtX2l0Lmhwb3MgKz0gMTsKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogICAgICAgLyogU3RvcCBwcm9kdWNpbmcgZ2x5cGhzLCBhbmQgcmVmcmFpbiBmcm9t IHByb2R1Y2luZyB0aGUgbGluZQogCSBudW1iZXIsIGlmIHdlIGRvbid0IGhhdmUgZW5vdWdoIHNw YWNlIG9uIHRoaXMgbGluZS4gICovCiAgICAgICBpZiAodGVtX2l0LmN1cnJlbnRfeCA+PSB3aWR0 aF9saW1pdCkKQEAgLTIxNTM5LDYgKzI2NTU3LDI4IEBAIG1heWJlX3Byb2R1Y2VfbGluZV9udW1i ZXIgKHN0cnVjdCBpdCAqaXQpCiAJfQogICAgIH0KIAorCisvKiAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog Ki8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZF UiAoaXQtPnctPmNvbnRlbnRzKTsKKyAgc3RydWN0IGJ1ZmZlciAqb2xkX2J1ZmZlciA9IE5VTEw7 CisgIC8qIE5lZWRlZCBzbyB0aGF0IGJ1ZmZlci1sb2NhbCB2YWx1ZXMgY2FuIGJlIGRldGVybWlu ZWQ7IGUuZy4sIHdoZW4gc3dpdGNoaW5nCisgIHRvIHRoZSBtaW5pYnVmZmVyLiAqLworICBpZiAo YiAhPSBjdXJyZW50X2J1ZmZlcikKKyAgICB7CisgICAgICBvbGRfYnVmZmVyID0gY3VycmVudF9i dWZmZXI7CisgICAgICBzZXRfYnVmZmVyX2ludGVybmFsIChiKTsKKyAgICB9CisgIGl0LT53LT5t Yy5sbnVtX3BpeGVsX3dpZHRoID0gKCFOSUxQIChWZGlzcGxheV9saW5lX251bWJlcnMpKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gdGVtX2l0LmN1cnJlbnRfeAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogMDsKKyAgaWYgKG9sZF9idWZmZXIpCisgICAgc2V0X2J1 ZmZlcl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor CisKICAgLyogUmVjb3JkIHRoZSB3aWR0aCBpbiBwaXhlbHMgd2UgbmVlZCBmb3IgdGhlIGxpbmUg bnVtYmVyIGRpc3BsYXkuICAqLwogICBpdC0+bG51bV9waXhlbF93aWR0aCA9IHRlbV9pdC5jdXJy ZW50X3g7CiAgIC8qIENvcHkgdGhlIHByb2R1Y2VkIGdseXBocyBpbnRvIElUJ3MgZ2x5cGhfcm93 LiAgKi8KQEAgLTI3MzYwLDYgKzMyNDAwLDE3IEBAIGFwcGVuZF9nbHlwaCAoc3RydWN0IGl0ICpp dCkKIAkgICAgZ1sxXSA9ICpnOwogCSAgZ2x5cGggPSBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJl YV07CiAJfQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09S UyAqLworCisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPmJ5dGVw b3MgPSBJVF9CWVRFUE9TICgqaXQpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAg ICAgICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAgICAgICBnbHlw aC0+b2JqZWN0ID0gaXQtPm9iamVjdDsKICAgICAgIGlmIChpdC0+cGl4ZWxfd2lkdGggPiAwKQpA QCAtMjc0NDIsNiArMzI0OTMsMTcgQEAgYXBwZW5kX2NvbXBvc2l0ZV9nbHlwaCAoc3RydWN0IGl0 ICppdCkKIAkgICAgZ1sxXSA9ICpnOwogCSAgZ2x5cGggPSBpdC0+Z2x5cGhfcm93LT5nbHlwaHNb aXQtPmFyZWFdOwogCX0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExF LUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBo LT5ieXRlcG9zID0gSVRfQllURVBPUyAoKml0KTsKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogICAgICAgZ2x5cGgtPmNoYXJwb3MgPSBpdC0+Y21wX2l0LmNoYXJwb3M7CiAgICAgICBn bHlwaC0+b2JqZWN0ID0gaXQtPm9iamVjdDsKICAgICAgIGVhc3NlcnQgKGl0LT5waXhlbF93aWR0 aCA8PSBTSFJUX01BWCk7CkBAIC0yNzY1MCw2ICszMjcxMiwxNyBAQCBwcm9kdWNlX2ltYWdlX2ds eXBoIChzdHJ1Y3QgaXQgKml0KQogCX0KICAgICAgIGlmIChnbHlwaCA8IGl0LT5nbHlwaF9yb3ct PmdseXBoc1thcmVhICsgMV0pCiAJeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyog TVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAg ICAgZ2x5cGgtPmJ5dGVwb3MgPSBJVF9CWVRFUE9TICgqaXQpOworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKworCiAJICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7 CiAJICBnbHlwaC0+b2JqZWN0ID0gaXQtPm9iamVjdDsKIAkgIGdseXBoLT5waXhlbF93aWR0aCA9 IGNsaXBfdG9fYm91bmRzICgtMSwgaXQtPnBpeGVsX3dpZHRoLCBTSFJUX01BWCk7CkBAIC0yNzc1 Myw2ICszMjgyNiwxNyBAQCBwcm9kdWNlX3h3aWRnZXRfZ2x5cGggKHN0cnVjdCBpdCAqaXQpCiAJ fQogICAgICAgaWYgKGdseXBoIDwgaXQtPmdseXBoX3Jvdy0+Z2x5cGhzW2FyZWEgKyAxXSkKIAl7 CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK KyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9IElU X0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgIGdseXBo LT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKIAkgIGdseXBoLT5vYmplY3QgPSBp dC0+b2JqZWN0OwogCSAgZ2x5cGgtPnBpeGVsX3dpZHRoID0gY2xpcF90b19ib3VuZHMgKC0xLCBp dC0+cGl4ZWxfd2lkdGgsIFNIUlRfTUFYKTsKQEAgLTI3ODM5LDYgKzMyOTIzLDE3IEBAIGFwcGVu ZF9zdHJldGNoX2dseXBoIChzdHJ1Y3QgaXQgKml0LCBMaXNwX09iamVjdCBvYmplY3QsCiAJICAg IHdpZHRoIC09IGl0LT5maXJzdF92aXNpYmxlX3ggLSBpdC0+Y3VycmVudF94OwogCSAgZWFzc2Vy dCAod2lkdGggPiAwKTsKIAl9CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBn bHlwaC0+Ynl0ZXBvcyA9IElUX0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKICAgICAgIGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsK ICAgICAgIGdseXBoLT5vYmplY3QgPSBvYmplY3Q7CiAgICAgICAvKiBGSVhNRTogSXQgd291bGQg YmUgYmV0dGVyIHRvIHVzZSBUWVBFX01BWCBoZXJlLCBidXQKQEAgLTI4MjkzLDYgKzMzMzg4LDE3 IEBAIGFwcGVuZF9nbHlwaGxlc3NfZ2x5cGggKHN0cnVjdCBpdCAqaXQsIGludCBmYWNlX2lkLCBi b29sIGZvcl9ub19mb250LCBpbnQgbGVuLAogCSAgICBnWzFdID0gKmc7CiAJICBnbHlwaCA9IGl0 LT5nbHlwaF9yb3ctPmdseXBoc1thcmVhXTsKIAl9CisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhw b3M7CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9IElUX0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgICAgIGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQt PnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5vYmplY3QgPSBpdC0+b2JqZWN0OwogICAgICAgZWFz c2VydCAoaXQtPnBpeGVsX3dpZHRoIDw9IFNIUlRfTUFYKTsKQEAgLTI5MzQzLDEwICszNDQ0OSwy MCBAQCBndWlfaW5zZXJ0X2dseXBocyAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3Jv dyAqdXBkYXRlZF9yb3csCiAKICAgLyogV3JpdGUgdGhlIGdseXBocy4gICovCiAgIGhwb3MgPSBz dGFydCAtIHJvdy0+Z2x5cGhzW3VwZGF0ZWRfYXJlYV07CisKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgaWYgKCFtY19yZWRyYXdfcm93ICh3 LCB3LT5jdXJyZW50X21hdHJpeCwgcm93LCB1cGRhdGVkX2FyZWEsIHctPm91dHB1dF9jdXJzb3Iu eCwKKyAgICAgICAgICAgICAgICAgICAgICBocG9zLCBocG9zICsgbGVuLCBmYWxzZSwgRFJBV19O T1JNQUxfVEVYVCwgR1VJX0lOU0VSVF9HTFlQSFMpKQogICBkcmF3X2dseXBocyAodywgdy0+b3V0 cHV0X2N1cnNvci54LCByb3csIHVwZGF0ZWRfYXJlYSwKIAkgICAgICAgaHBvcywgaHBvcyArIGxl biwKIAkgICAgICAgRFJBV19OT1JNQUxfVEVYVCwgMCk7CiAKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKICAgLyogQWR2YW5jZSB0aGUgb3V0cHV0IGN1cnNvci4gICovCiAgIHctPm91dHB1 dF9jdXJzb3IuaHBvcyArPSBsZW47CiAgIHctPm91dHB1dF9jdXJzb3IueCArPSBzaGlmdF9ieV93 aWR0aDsKQEAgLTI5NzcyLDkgKzM0ODg4LDE5IEBAIGd1aV9maXhfb3ZlcmxhcHBpbmdfYXJlYSAo c3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqcm93LAogCSAgd2hpbGUgKGkgPCBy b3ctPnVzZWRbYXJlYV0KIAkJICYmIHJvdy0+Z2x5cGhzW2FyZWFdW2ldLm92ZXJsYXBzX3ZlcnRp Y2FsbHlfcCk7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJT T1JTICovCisKKyAgICAgIGlmICghbWNfcmVkcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgs IHJvdywgYXJlYSwgc3RhcnRfeCwgc3RhcnQsIGksCisgICAgICAgICAgZmFsc2UsIERSQVdfTk9S TUFMX1RFWFQsIEdVSV9GSVhfT1ZFUkxBUFBJTkdfQVJFQSkpCiAJICBkcmF3X2dseXBocyAodywg c3RhcnRfeCwgcm93LCBhcmVhLAogCQkgICAgICAgc3RhcnQsIGksCiAJCSAgICAgICBEUkFXX05P Uk1BTF9URVhULCBvdmVybGFwcyk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAl9 CiAgICAgICBlbHNlCiAJewpAQCAtMzAwMjUsMTAgKzM1MTUxLDIwIEBAIGRpc3BsYXlfYW5kX3Nl dF9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgb24sCiAgIG5ld19jdXJzb3JfdHlwZSA9 IGdldF93aW5kb3dfY3Vyc29yX3R5cGUgKHcsIGdseXBoLAogCQkJCQkgICAgJm5ld19jdXJzb3Jf d2lkdGgsICZhY3RpdmVfY3Vyc29yKTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFLUNVUlNPUlMgKi8KKwogICAvKiBJZiBjdXJzb3IgaXMgY3VycmVudGx5IGJlaW5n IHNob3duIGFuZCB3ZSBkb24ndCB3YW50IGl0IHRvIGJlIG9yCiAgICAgIGl0IGlzIGluIHRoZSB3 cm9uZyBwbGFjZSwgb3IgdGhlIGN1cnNvciB0eXBlIGlzIG5vdCB3aGF0IHdlIHdhbnQsCiAgICAg IGVyYXNlIGl0LiAgKi8KICAgaWYgKHctPnBoeXNfY3Vyc29yX29uX3AKKyAgICAgICYmIE5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAmJiBOSUxQ IChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQorICAgICAgJiYgTklM UCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAgICYmIHctPm1j X21hdHJpeC5jdXJzb3JzX3VzZWRbTUNfQ0FDSEVdID09IDAKKyAgICAgICYmIHctPm1jX21hdHJp eC5jdXJzb3JzX3VzZWRbQ0hfQ0FDSEVdID09IDAKKyAgICAgICYmIHctPm1jX21hdHJpeC5jdXJz b3JzX3VzZWRbRkNfQ0FDSEVdID09IDAKICAgICAgICYmICghb24KIAkgIHx8IHctPnBoeXNfY3Vy c29yLnggIT0geAogCSAgfHwgdy0+cGh5c19jdXJzb3IueSAhPSB5CkBAIC0zMDA0MSw2ICszNTE3 Nyw5IEBAIGRpc3BsYXlfYW5kX3NldF9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgb24s CiAJICAgICAgJiYgbmV3X2N1cnNvcl93aWR0aCAhPSB3LT5waHlzX2N1cnNvcl93aWR0aCkpKQog ICAgIGVyYXNlX3BoeXNfY3Vyc29yICh3KTsKIAorLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisK KwogICAvKiBEb24ndCBjaGVjayBwaHlzX2N1cnNvcl9vbl9wIGhlcmUgYmVjYXVzZSB0aGF0IGZs YWcgaXMgb25seSBzZXQKICAgICAgdG8gZmFsc2UgaW4gc29tZSBjYXNlcyB3aGVyZSB3ZSBrbm93 IHRoYXQgdGhlIGN1cnNvciBoYXMgYmVlbgogICAgICBjb21wbGV0ZWx5IGVyYXNlZCwgdG8gYXZv aWQgdGhlIGV4dHJhIHdvcmsgb2YgZXJhc2luZyB0aGUgY3Vyc29yCkBAIC0zMDA1OSw5ICszNTE5 OCwyMyBAQCBkaXNwbGF5X2FuZF9zZXRfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIG9u LAogICAgICAgdy0+cGh5c19jdXJzb3IudnBvcyA9IHZwb3M7CiAgICAgfQogCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlmIChOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgJiYgTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICYmIE5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAmJiB3LT5tY19t YXRyaXguY3Vyc29yc191c2VkW01DX0NBQ0hFXSA9PSAwCisgICAgICAmJiB3LT5tY19tYXRyaXgu Y3Vyc29yc191c2VkW0NIX0NBQ0hFXSA9PSAwCisgICAgICAmJiB3LT5tY19tYXRyaXguY3Vyc29y c191c2VkW0ZDX0NBQ0hFXSA9PSAwKQogICBGUkFNRV9SSUYgKGYpLT5kcmF3X3dpbmRvd19jdXJz b3IgKHcsIGdseXBoX3JvdywgeCwgeSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBuZXdfY3Vyc29yX3R5cGUsIG5ld19jdXJzb3Jfd2lkdGgsCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgb24sIGFjdGl2ZV9jdXJzb3IpOworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKworCiB9CiAKIApAQCAtMzAxNTQsNyArMzUzMDcsMTggQEAgZHJhd19yb3df d2l0aF9tb3VzZV9mYWNlIChzdHJ1Y3Qgd2luZG93ICp3LCBpbnQgc3RhcnRfeCwgc3RydWN0IGds eXBoX3JvdyAqcm93LAogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQogICBpZiAoRlJBTUVfV0lO RE9XX1AgKFhGUkFNRSAody0+ZnJhbWUpKSkKICAgICB7CisKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGlmICghbWNfcmVkcmF3X3Jv dyAodywgdy0+Y3VycmVudF9tYXRyaXgsIHJvdywgVEVYVF9BUkVBLCBzdGFydF94LAorICAgICAg ICAgICAgICAgICAgICAgICAgICBzdGFydF9ocG9zLCBlbmRfaHBvcywgZmFsc2UsIGRyYXcsIERS QVdfUk9XX1dJVEhfTU9VU0VfRkFDRSkpCiAgICAgICBkcmF3X2dseXBocyAodywgc3RhcnRfeCwg cm93LCBURVhUX0FSRUEsIHN0YXJ0X2hwb3MsIGVuZF9ocG9zLCBkcmF3LCAwKTsKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogICAgICAgcmV0dXJuOwogICAgIH0KICNlbmRpZgpAQCAt MzIyMTQsMTEgKzM3Mzc4LDIzIEBAIGV4cG9zZV9hcmVhIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1 Y3QgZ2x5cGhfcm93ICpyb3csIGNvbnN0IEVtYWNzX1JlY3RhbmdsZSAqciwKICAgc3RydWN0IGds eXBoICpsYXN0OwogICBpbnQgZmlyc3RfeCwgc3RhcnRfeCwgeDsKIAorCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogICBpZiAoYXJlYSA9PSBURVhU X0FSRUEgJiYgcm93LT5maWxsX2xpbmVfcCkKKyAgICB7CisgICAgICBpZiAoIW1jX3JlZHJhd19y b3cgKHcsIHctPmN1cnJlbnRfbWF0cml4LCByb3csIGFyZWEsIDAsIDAsIHJvdy0+dXNlZFthcmVh XSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZmFsc2UsIERSQVdfTk9STUFMX1RFWFQsIEVY UE9TRV9BUkVBX09ORSkpCiAgICAgLyogSWYgcm93IGV4dGVuZHMgZmFjZSB0byBlbmQgb2YgbGlu ZSB3cml0ZSB0aGUgd2hvbGUgbGluZS4gICovCiAgICAgZHJhd19nbHlwaHMgKHcsIDAsIHJvdywg YXJlYSwKIAkJIDAsIHJvdy0+dXNlZFthcmVhXSwKIAkJIERSQVdfTk9STUFMX1RFWFQsIDApOwor ICAgIH0KKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBlbHNlCiAgICAgewogICAg ICAgLyogU2V0IFNUQVJUX1ggdG8gdGhlIHdpbmRvdy1yZWxhdGl2ZSBzdGFydCBwb3NpdGlvbiBm b3IgZHJhd2luZyBnbHlwaHMgb2YKQEAgLTMyMjUwLDExICszNzQyNiwyMyBAQCBleHBvc2VfYXJl YSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqcm93LCBjb25zdCBFbWFjc19S ZWN0YW5nbGUgKnIsCiAJICArK2xhc3Q7CiAJfQogCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCiAgICAgICAvKiBSZXBhaW50LiAgKi8KLSAgICAg IGlmIChsYXN0ID4gZmlyc3QpCisgICAgICAvKiBGbG9hdGluZyBmYWtlIGN1cnNvcnMgd2lsbCBl eGlzdCB3aGVuIChsYXN0ID09IGZpcnN0KS4gKi8KKyAgICAgIGlmICghbWNfcmVkcmF3X3JvdyAo dywgdy0+Y3VycmVudF9tYXRyaXgsIHJvdywgYXJlYSwgZmlyc3RfeCAtIHN0YXJ0X3gsCisgICAg ICAgICAgICAgICAgICAgICAgICAgIGZpcnN0IC0gcm93LT5nbHlwaHNbYXJlYV0sIGxhc3QgLSBy b3ctPmdseXBoc1thcmVhXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZmFsc2UsIERSQVdf Tk9STUFMX1RFWFQsIEVYUE9TRV9BUkVBX1RXTykKKyAgICAgICAgICAmJiBsYXN0ID4gZmlyc3Qp CiAJZHJhd19nbHlwaHMgKHcsIGZpcnN0X3ggLSBzdGFydF94LCByb3csIGFyZWEsCiAJCSAgICAg Zmlyc3QgLSByb3ctPmdseXBoc1thcmVhXSwgbGFzdCAtIHJvdy0+Z2x5cGhzW2FyZWFdLAogCQkg ICAgIERSQVdfTk9STUFMX1RFWFQsIDApOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAgICAgfQogfQogCkBAIC0zMjI2OCwxMCArMzc0NTYsMjIgQEAgZXhwb3NlX2xpbmUgKHN0cnVj dCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgY29uc3QgRW1hY3NfUmVjdGFuZ2xl ICpyKQogewogICBlYXNzZXJ0IChyb3ctPmVuYWJsZWRfcCk7CiAKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgaWYgKHJvdy0+bW9kZV9saW5l X3AgfHwgdy0+cHNldWRvX3dpbmRvd19wKQorICAgIHsKKyAgICAgIGlmICghbWNfcmVkcmF3X3Jv dyAodywgdy0+Y3VycmVudF9tYXRyaXgsIHJvdywgVEVYVF9BUkVBLCAwLCAwLAorICAgICAgICAg ICAgICAgICAgICAgICAgICByb3ctPnVzZWRbVEVYVF9BUkVBXSwgZmFsc2UsIERSQVdfTk9STUFM X1RFWFQsIEVYUE9TRV9MSU5FKSkKICAgICBkcmF3X2dseXBocyAodywgMCwgcm93LCBURVhUX0FS RUEsCiAJCSAwLCByb3ctPnVzZWRbVEVYVF9BUkVBXSwKIAkJIERSQVdfTk9STUFMX1RFWFQsIDAp OworICAgIH0KKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBlbHNlCiAgICAgewog ICAgICAgaWYgKHJvdy0+dXNlZFtMRUZUX01BUkdJTl9BUkVBXSkKQEAgLTMyODE5LDYgKzM4MDE5 LDIyIEBAIGd1aV9pbnRlcnNlY3RfcmVjdGFuZ2xlcyAoY29uc3QgRW1hY3NfUmVjdGFuZ2xlICpy MSwgY29uc3QgRW1hY3NfUmVjdGFuZ2xlICpyMiwKIHZvaWQKIHN5bXNfb2ZfeGRpc3AgKHZvaWQp CiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICov CisKKyAgZGVmc3ViciAoJlNtY19kdW1wX2dseXBoX3Jvdyk7CisKKyAgZGVmc3ViciAoJlNtY19k dW1wX2dseXBoX21hdHJpeCk7CisKKyAgZGVmc3ViciAoJlNtY19jdXJyZW50X2NvbHVtbik7CisK KyAgZGVmc3ViciAoJlNtY19zdGRlcnIpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAgIFZ3aXRoX2VjaG9fYXJlYV9zYXZlX3ZlY3RvciA9IFFuaWw7CiAgIHN0YXRpY3BybyAoJlZ3 aXRoX2VjaG9fYXJlYV9zYXZlX3ZlY3Rvcik7CiAKZGlmZiAtLWdpdCBhL3NyYy94dGVybS5jIGIv c3JjL3h0ZXJtLmMKaW5kZXggYzk2YWE3NC4uZDM0ZDgxZCAxMDA2NDQKLS0tIGEvc3JjL3h0ZXJt LmMKKysrIGIvc3JjL3h0ZXJtLmMKQEAgLTEzMiw2ICsxMzIsOTA3IEBAIGFsb25nIHdpdGggR05V IEVtYWNzLiAg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ogRHJhdyBhIGJhciBjdXJzb3Igb24gd2luZG93IFcgaW4gZ2x5cGggcm93IFJPVy4g Ki8KK3N0YXRpYyB2b2lkCittY194X2RyYXdfYmFyX2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywg c3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAg ICAgICAgICAgICAgICAgICAgaW50IHgsIGludCBmeCwgaW50IHksIGludCBmeSwgaW50IGhwb3Ms IGludCB2cG9zLCBpbnQgd2QsIGludCBoLAorICAgICAgICAgICAgICAgICAgICAgIGludCB3aWR0 aCwgZW51bSBtY19jdXJzb3JfdHlwZSBraW5kLCBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2th eV9wKQoreworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgLyogSWYg Y3Vyc29yIGlzIG91dCBvZiBib3VuZHMsIGRvbid0IGRyYXcgZ2FyYmFnZS4gIFRoaXMgY2FuIGhh cHBlbgorICAgICBpbiBtaW5pLWJ1ZmZlciB3aW5kb3dzIHdoZW4gc3dpdGNoaW5nIGJldHdlZW4g ZWNobyBhcmVhIGdseXBocworICAgICBhbmQgbWluaS1idWZmZXIuICovCisgIHN0cnVjdCBnbHlw aCAqY3Vyc29yX2dseXBoID0gbWNfZ2V0X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIGhw b3MsIHZwb3MpOworICBpZiAoY3Vyc29yX2dseXBoID09IE5VTEwpCisgICAgcmV0dXJuOworICAv KiBFeHBlcmltZW50YWwgYXZvaWRhbmNlIG9mIGN1cnNvciBvbiB4d2lkZ2V0LiAqLworICBpZiAo Y3Vyc29yX2dseXBoLT50eXBlID09IFhXSURHRVRfR0xZUEgpCisgICAgcmV0dXJuOworICAvKiBJ ZiBvbiBhbiBpbWFnZSwgZHJhdyBsaWtlIGEgbm9ybWFsIGN1cnNvci4gIFRoYXQncyB1c3V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WZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAg IHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxv d19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1F X1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2 ZV9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJB TUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfYWN0 aXZlX3JlZ2lvbl9lbmRfZmFjZS0+YmFja2dyb3VuZCk7CisgICAgICAgICAgICAgIH0KKyAgICAg ICAgICAgICAgZWxzZSBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAg ICYmIGFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+Y2hh cnBvcyA+IHJlZ2lvbl9iZWcKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBo LT5jaGFycG9zIDwgcmVnaW9uX2VuZCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAg ICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNlX2lkID0g bG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbi1y ZWdpb24tcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFj ZSAqaG9sbG93X2FjdGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNlID0gRkFDRV9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V9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQg KEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93 X2FjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgICAgWFNldEJhY2tn cm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywg aG9sbG93X2FjdGl2ZV9mYWNlLT5iYWNrZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgICAgIGVsc2UgaWYgKCFhY3RpdmVfcCkKKyAgICAgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfaW5hY3RpdmVfZmFj ZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJz b3ItaW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAg c3RydWN0IGZhY2UgKmhvbGxvd19pbmFjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xs b3dfaW5hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91 bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9s bG93X2luYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgICAgICAgIFhT ZXRCYWNrZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJz b3JfZ2MsIGhvbGxvd19pbmFjdGl2ZV9mYWNlLT5iYWNrZ3JvdW5kKTsKKyAgICAgICAgICAgICAg ICAgICAgfQorICAgICAgICAgIGJsb2NrX2lucHV0ICgpOworICAgICAgICAgIC8qIEZvcmNlIGBt Y194X3NldF9jdXJzb3JfZ2MnIHRvIHVzZSBgcy0+Zi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2dj Jy4gKi8KKyAgICAgICAgICBib29sIGN1cnNvcl9nY19wID0gdHJ1ZTsKKyAgICAgICAgICBtY19k cmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4LCBocG9zLCB2 cG9zLCBsc2wsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwg Y3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOworICAgICAgICAgIFhTZXRG b3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3Jf Z2MsIHhnY3YuZm9yZWdyb3VuZCk7CisgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hf RElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgeGdjdi5iYWNrZ3JvdW5k KTsKKyAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5 IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsJy4gKi8KKyAgICAgICAgICBm LT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBjb2xvci5waXhlbDsKKyAgICAgICAgICBt Y194X2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBv cywgdnBvcywgd2QsIGgpOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhl bCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChj dXJzb3JfZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEggJiYgbHNsLnJlZCA+PSAwICYmIGxzbC5n cmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgICAgeworICAgICAgICAgICAgLyog VGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwnLiAqLwor ICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gY29sb3IucGl4ZWw7 CisgICAgICAgICAgICBtY194X2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgs IGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgICAgZi0+b3V0cHV0X2Rh dGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICAgIH0K KyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIC8qIFRlbXBvcmFy aWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djJyBieSBib3Jyb3dpbmcgdGhl CisgICAgICAgICAgICAgIGZ1bmN0aW9uYWxpdHkgb2YgYHhfbWFrZV9nYycgaW4geGZucy5jLiAq LworICAgICAgICAgICAgICBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAm JiBhY3RpdmVfcAorICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID09 IHJlZ2lvbl9iZWcpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgZW51bSBm YWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2JlZ19mYWNlX2lkID0gbG9va3VwX25hbWVkX2Zh Y2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1c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b3VuZCk7CisgICAgICAg ICAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91 dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNl LT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAg ICBlbHNlIGlmIChhY3RpdmVfcCkKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3Vw X25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFj ZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3df YWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7Cisg ICAgICAgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChm KSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVn cm91bmQpOworICAgICAgICAgICAgICAgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hf RElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9m YWNlLT5iYWNrZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAg ICAgICAgICAgZWxzZSBpZiAoIWFjdGl2ZV9wKQorICAgICAgICAgICAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0aXZlX2Zh Y2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vy c29yLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAg ICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2luYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYs IGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgWFNl dEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNv cl9nYywgaG9sbG93X2luYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICAg ICAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0 X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfaW5hY3RpdmVfZmFjZS0+YmFja2dyb3VuZCk7Cisg ICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGJsb2NrX2lucHV0ICgpOwor ICAgICAgICAgICAgICAvKiBGb3JjZSBgbWNfeF9zZXRfY3Vyc29yX2djJyB0byB1c2UgYHMtPmYt Pm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYycuICovCisgICAgICAgICAgICAgIGJvb2wgY3Vyc29y X2djX3AgPSB0cnVlOworICAgICAgICAgICAgICBtY19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0 cml4LCByb3csIERSQVdfQ1VSU09SLCB4LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgbHNsLCBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0 aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfZ2NfcCk7 CisgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5v dXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIHhnY3YuZm9yZWdyb3VuZCk7CisgICAgICAgICAgICAg IFhTZXRCYWNrZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5j dXJzb3JfZ2MsIHhnY3YuYmFja2dyb3VuZCk7CisgICAgICAgICAgICAgIHVuYmxvY2tfaW5wdXQg KCk7CisgICAgICAgICAgICAgIC8qIERyYXcgdGhlIGZyYW1lIGFyb3VuZCB0aGUgYm94LiAqLwor ICAgICAgICAgICAgICBtY194X2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgs IGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgICAgfQorICAgICAgYnJl YWs7CisgICAgfQorICAgIGNhc2UgTUNfSE9MTE9XX0JPWDoKKyAgICB7CisgICAgICBpZiAobHNs LnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsK KyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNv cl9waXhlbCcuICovCisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0g Y29sb3IucGl4ZWw7CisgICAgICAgICAgbWNfeF9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJp eCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAgICAgICAgICBmLT5v dXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAg ICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIG1j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c29yX2djX3ApOworICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJ U1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIHhnY3YuZm9yZWdyb3VuZCk7 CisgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1 dF9kYXRhLngtPmN1cnNvcl9nYywgeGdjdi5iYWNrZ3JvdW5kKTsKKyAgICAgICAgICB1bmJsb2Nr X2lucHV0ICgpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAg ICAgICBib29sIGN1cnNvcl9nY19wID0gZmFsc2U7CisgICAgICAgICAgICBtY19kcmF3X2N1cnNv cl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4LCBocG9zLCB2cG9zLCBsc2ws CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGhfZmxhdm9yLCBjdXJzb3Jf dHlwZSwgd2QsIGFjdGl2ZV9wLCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgfQorICAgICAgYnJl YWs7CisgICAgfQorICAgIGNhc2UgTUNfQkFSOgorICAgIHsKKyAgICAgIGlmIChsc2wucmVkID49 IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAgeworICAgICAg ICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVs Jy4gKi8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBjb2xvci5w aXhlbDsKKyAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gdHJ1ZTsK KyAgICAgICAgICBtY194X2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5 LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGN1cnNvcl93aWR0aCwgTUNfQkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAg ICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3Bp eGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBi b29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7CisgICAgICAgICAgICBtY194 X2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBv cywgd2QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaCwgY3Vyc29yX3dpZHRo LCBNQ19CQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICB9CisgICAg ICBicmVhazsKKyAgICB9CisgICAgY2FzZSBNQ19IQkFSOgorICAgIHsKKyAgICAgIGlmIChsc2wu cmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAgewor ICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29y X3BpeGVsJy4gKi8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBj b2xvci5waXhlbDsKKyAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0g dHJ1ZTsKKyAgICAgICAgICBtY194X2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgs IGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGN1cnNvcl93aWR0aCwgTUNfSEJBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3Ap OworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1 cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAg ICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IGZhbHNlOworICAgICAgICAg ICAgbWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhw b3MsIHZwb3MsIHdkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGgsIGN1cnNv cl93aWR0aCwgTUNfSEJBUiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAg IH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQg KCk7CisgIH0KKyAgICAgICAgfQorI2lmZGVmIEhBVkVfWF9JMThOCisgIGlmICh3ID09IFhXSU5E T1cgKGYtPnNlbGVjdGVkX3dpbmRvdykpCisgICAgaWYgKEZSQU1FX1hJQyAoZikgJiYgKEZSQU1F X1hJQ19TVFlMRSAoZikgJiBYSU1QcmVlZGl0UG9zaXRpb24pKQorICAgICAgeGljX3NldF9wcmVl ZGl0YXJlYSAodywgeCwgeSk7CisjZW5kaWYKKyAgICB9CisgIFhGbHVzaCAoRlJBTUVfWF9ESVNQ TEFZIChmKSk7Cit9CisKKy8qIERyYXcgc3RyZXRjaCBnbHlwaCBzdHJpbmcgUy4gKi8KK3N0YXRp YyB2b2lkCittY194X2RyYXdfc3RyZXRjaF9nbHlwaF9zdHJpbmcgKHN0cnVjdCBnbHlwaF9zdHJp bmcgKnMpCit7CisgIGVhc3NlcnQgKHMtPmZpcnN0X2dseXBoLT50eXBlID09IFNUUkVUQ0hfR0xZ UEgpOworICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IKKyAgICAgICYmICF4X3N0cmV0Y2hfY3Vy c29yX3ApCisgICAgeworICAgICAgLyogSWYgYHgtc3RyZXRjaC1jdXJzb3InIGlzIG5pbCwgZG9u J3QgZHJhdyBhIGJsb2NrIGN1cnNvciBhcyB3aWRlIGFzIHRoZQorICAgICAgc3RyZXRjaCBnbHlw aC4gKi8KKyAgICAgIGludCB3aWR0aCwgYmFja2dyb3VuZF93aWR0aCA9IHMtPmJhY2tncm91bmRf d2lkdGg7CisgICAgICBpbnQgeCA9IHMtPng7CisgICAgICBpZiAoIXMtPnJvdy0+cmV2ZXJzZWRf cCkKKyAgICAgICAgeworICAgICAgICAgIGludCBsZWZ0X3ggPSB3aW5kb3dfYm94X2xlZnRfb2Zm c2V0IChzLT53LCBURVhUX0FSRUEpOworICAgICAgICAgIGlmICh4IDwgbGVmdF94KQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICBiYWNrZ3JvdW5kX3dpZHRoIC09IGxlZnRfeCAtIHg7Cisg ICAgICAgICAgICAgIHggPSBsZWZ0X3g7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAg ICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIC8qIEluIFIyTCByb3dzLCBkcmF3IHRo ZSBjdXJzb3Igb24gdGhlIHJpZ2h0IGVkZ2Ugb2YgdGhlCisgICAgICAgICAgICAgICBzdHJldGNo IGdseXBoLiAqLworICAgICAgICAgICAgaW50IHJpZ2h0X3ggPSB3aW5kb3dfYm94X3JpZ2h0IChz LT53LCBURVhUX0FSRUEpOworICAgICAgICAgICAgaWYgKHggKyBiYWNrZ3JvdW5kX3dpZHRoID4g cmlnaHRfeCkKKyAgICAgICAgICAgICAgYmFja2dyb3VuZF93aWR0aCAtPSB4IC0gcmlnaHRfeDsK KyAgICAgICAgICAgIHggKz0gYmFja2dyb3VuZF93aWR0aDsKKyAgICAgICAgICB9CisgICAgICB3 aWR0aCA9IG1pbiAoRlJBTUVfQ09MVU1OX1dJRFRIIChzLT5mKSwgYmFja2dyb3VuZF93aWR0aCk7 CisgICAgICBpZiAocy0+cm93LT5yZXZlcnNlZF9wKQorICAgICAgICB4IC09IHdpZHRoOworICAg ICAgLyogRHJhdyBjdXJzb3IuICovCisgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JnX3JlY3Qg KHMsIHgsIHMtPnksIHdpZHRoLCBzLT5oZWlnaHQpOworICAgICAgLyogQ2xlYXIgcmVzdCB1c2lu ZyB0aGUgR0Mgb2YgdGhlIG9yaWdpbmFsIG5vbi1jdXJzb3IgZmFjZS4gKi8KKyAgICAgIGlmICh3 aWR0aCA8IGJhY2tncm91bmRfd2lkdGgpCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgeSA9IHMt Pnk7CisgICAgICAgICAgaW50IHcgPSBiYWNrZ3JvdW5kX3dpZHRoIC0gd2lkdGgsIGggPSBzLT5o ZWlnaHQ7CisgICAgICAgICAgWFJlY3RhbmdsZSByOworICAgICAgICAgIEdDIGdjOworICAgICAg ICAgIGlmICghcy0+cm93LT5yZXZlcnNlZF9wKQorICAgICAgICAgICAgeCArPSB3aWR0aDsKKyAg ICAgICAgICBlbHNlCisgICAgICAgICAgICB4ID0gcy0+eDsKKyAgICAgICAgICBpZiAocy0+cm93 LT5tb3VzZV9mYWNlX3AKKyAgICAgICAgICAgICAgJiYgY3Vyc29yX2luX21vdXNlX2ZhY2VfcCAo cy0+dykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHhfc2V0X21vdXNlX2ZhY2VfZ2Mg KHMpOworICAgICAgICAgICAgICBnYyA9IHMtPmdjOworICAgICAgICAgICAgfQorICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgIGdjID0gcy0+ZmFjZS0+Z2M7CisgICAgICAgICAgZ2V0X2dseXBo X3N0cmluZ19jbGlwX3JlY3QgKHMsICZyKTsKKyAgICAgICAgICB4X3NldF9jbGlwX3JlY3Rhbmds ZXMgKHMtPmYsIGdjLCAmciwgMSk7CisgICAgICAgICAgaWYgKHMtPmZhY2UtPnN0aXBwbGUpCisg ICAgICAgICAgICB7CisgICAgICAgICAgICAgIC8qIEZpbGwgYmFja2dyb3VuZCB3aXRoIGEgc3Rp cHBsZSBwYXR0ZXJuLiAqLworICAgICAgICAgICAgICBYU2V0RmlsbFN0eWxlIChGUkFNRV9YX0RJ U1BMQVkgKHMtPmYpLCBnYywgRmlsbE9wYXF1ZVN0aXBwbGVkKTsKKyAgICAgICAgICAgICAgeF9m aWxsX3JlY3RhbmdsZSAocy0+ZiwgZ2MsIHgsIHksIHcsIGgpOworICAgICAgICAgICAgICBYU2V0 RmlsbFN0eWxlIChGUkFNRV9YX0RJU1BMQVkgKHMtPmYpLCBnYywgRmlsbFNvbGlkKTsKKyAgICAg ICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIFhH Q1ZhbHVlcyB4Z2N2OworICAgICAgICAgICAgICBYR2V0R0NWYWx1ZXMgKEZSQU1FX1hfRElTUExB WSAocy0+ZiksIGdjLCBHQ0ZvcmVncm91bmQgfCBHQ0JhY2tncm91bmQsICZ4Z2N2KTsKKyAgICAg ICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIGdjLCB4Z2N2 LmJhY2tncm91bmQpOworICAgICAgICAgICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChzLT5mLCBnYywg eCwgeSwgdywgaCk7CisgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BM QVkgKHMtPmYpLCBnYywgeGdjdi5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAg ICB4X3Jlc2V0X2NsaXBfcmVjdGFuZ2xlcyAocy0+ZiwgZ2MpOworICAgICAgICB9CisgICAgfQor ICBlbHNlIGlmICghcy0+YmFja2dyb3VuZF9maWxsZWRfc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cGhfbWF0cml4 ICptYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cs IHN0cnVjdCBtY19tYXRyaXggbWNfbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgc3Ry dWN0IG1jX1JHQiBsc2wsIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciwKKyAgICAgICAgICAg ICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUsIGludCBjdXJzb3Jf d2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICBib29sIGFjdGl2ZV9wLCBib29sIGN1cnNv cl9nY19wKQoreworICBib29sIHJlbGllZl9kcmF3bl9wID0gZmFsc2U7CisgIC8qIElmIFMgZHJh d3MgaW50byB0aGUgYmFja2dyb3VuZCBvZiBpdHMgc3VjY2Vzc29ycywgZHJhdyB0aGUKKyAgICAg YmFja2dyb3VuZCBvZiB0aGUgc3VjY2Vzc29ycyBmaXJzdCBzbyB0aGF0IFMgY2FuIGRyYXcgaW50 byBpdC4KKyAgICAgVGhpcyBtYWtlcyBTLT5uZXh0IHVzZSBYRHJhd1N0cmluZyBpbnN0ZWFkIG9m IFhEcmF3SW1hZ2VTdHJpbmcuICovCisgIGlmIChzLT5uZXh0ICYmIHMtPnJpZ2h0X292ZXJoYW5n ICYmICFzLT5mb3Jfb3ZlcmxhcHMpCisgICAgeworICAgICAgaW50IHdpZHRoOworICAgICAgc3Ry dWN0IGdseXBoX3N0cmluZyAqbmV4dDsKKyAgICAgIGZvciAod2lkdGggPSAwLCBuZXh0ID0gcy0+ bmV4dDsKKyAgICAgICAgICAgbmV4dCAmJiB3aWR0aCA8IHMtPnJpZ2h0X292ZXJoYW5nOworICAg ICAgICAgICB3aWR0aCArPSBuZXh0LT53aWR0aCwgbmV4dCA9IG5leHQtPm5leHQpCisgICAgICAg IGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSAhPS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V0lER0VUX0dMWVBIOgorICAgICAgeF9kcmF3X3h3aWRnZXRfZ2x5 cGhfc3RyaW5nIChzKTsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgU1RSRVRDSF9HTFlQSDoKKyAg ICAgIG1jX3hfZHJhd19zdHJldGNoX2dseXBoX3N0cmluZyAocyk7CisgICAgICBicmVhazsKKyAg ICBjYXNlIENIQVJfR0xZUEg6CisgICAgICBpZiAocy0+Zm9yX292ZXJsYXBzKQorICAgICAgICBz LT5iYWNrZ3JvdW5kX2ZpbGxlZF9wID0gdHJ1ZTsKKyAgICAgIGVsc2UKKyAgICAgICAgeF9kcmF3 X2dseXBoX3N0cmluZ19iYWNrZ3JvdW5kIChzLCBmYWxzZSk7CisgICAgICB4X2RyYXdfZ2x5cGhf c3RyaW5nX2ZvcmVncm91bmQgKHMpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBDT01QT1NJVEVf R0xZUEg6CisgICAgICBpZiAocy0+Zm9yX292ZXJsYXBzIHx8IChzLT5jbXBfZnJvbSA+IDAKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICEgcy0+Zmlyc3RfZ2x5cGgtPnUuY21wLmF1 dG9tYXRpYykpCisgICAgICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVlOworICAgICAg ZWxzZQorICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKHMsIHRydWUpOwor ICAgICAgeF9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAg ICBicmVhazsKKyAgICBjYXNlIEdMWVBITEVTU19HTFlQSDoKKyAgICAgIGlmIChzLT5mb3Jfb3Zl cmxhcHMpCisgICAgICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVlOworICAgICAgZWxz ZQorICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKHMsIHRydWUpOworICAg ICAgeF9kcmF3X2dseXBobGVzc19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAgICBi cmVhazsKKyAgICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7CisgICAgfQorICBpZiAo IXMtPmZvcl9vdmVybGFwcykKKyAgICB7CisgICAgICAvKiBEcmF3IHVuZGVybGluZS4gKi8KKyAg ICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfcCkKKyAgICAgICAgeworICAgICAgICAgIGlmIChz LT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX1dBVkUpCisgICAgICAgICAgICB7 CisgICAgICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3ApCisgICAg ICAgICAgICAgICAgeF9kcmF3X3VuZGVyd2F2ZSAocyk7CisgICAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBYR0NWYWx1ZXMgeGdjdjsKKyAgICAg ICAgICAgICAgICAgIFhHZXRHQ1ZhbHVlcyAoRlJBTUVfWF9ESVNQTEFZIChzLT5mKSwgcy0+Z2Ms IEdDRm9yZWdyb3VuZCwgJnhnY3YpOworICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQg KEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMtPmdjLCBzLT5mYWNlLT51bmRlcmxpbmVfY29sb3Ip OworICAgICAgICAgICAgICAgICAgeF9kcmF3X3VuZGVyd2F2ZSAocyk7CisgICAgICAgICAgICAg ICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChzLT5mKSwgcy0+Z2MsIHhnY3Yu Zm9yZWdyb3VuZCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAg IGVsc2UgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgdW5zaWduZWQgbG9uZyB0aGlja25lc3MsIHBvc2l0 aW9uOworICAgICAgICAgICAgICBpbnQgeTsKKyAgICAgICAgICAgICAgaWYgKHMtPnByZXYgJiYg cy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3AKKyAgICAgICAgICAgICAgICAgICYmIHMtPnByZXYt PmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKyAgICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgICAvKiBXZSB1c2UgdGhlIHNhbWUgdW5kZXJsaW5lIHN0eWxl IGFzIHRoZSBwcmV2aW91cyBvbmUuICovCisgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSBz LT5wcmV2LT51bmRlcmxpbmVfdGhpY2tuZXNzOworICAgICAgICAgICAgICAgICAgcG9zaXRpb24g PSBzLT5wcmV2LT51bmRlcmxpbmVfcG9zaXRpb247CisgICAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgLyogR2V0 IHRoZSB1bmRlcmxpbmUgdGhpY2tuZXNzLiAgRGVmYXVsdCBpcyAxIHBpeGVsLiAqLworICAgICAg ICAgICAgICAgICAgaWYgKHMtPmZvbnQgJiYgcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzcyA+ IDApCisgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPmZvbnQtPnVuZGVybGluZV90 aGlja25lc3M7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHRo aWNrbmVzcyA9IDE7CisgICAgICAgICAgICAgICAgICBpZiAoeF91bmRlcmxpbmVfYXRfZGVzY2Vu dF9saW5lKQorICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5oZWlnaHQgLSB0aGlj a25lc3MpIC0gKHMtPnliYXNlIC0gcy0+eSk7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAg ICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVy bGluZSBwb3NpdGlvbi4gIFRoaXMgaXMgdGhlIHJlY29tbWVuZGVkCisgICAgICAgICAgICAgICAg ICAgICAgICAgdmVydGljYWwgb2Zmc2V0IGluIHBpeGVscyBmcm9tIHRoZSBiYXNlbGluZSB0byB0 aGUgdG9wIG9mCisgICAgICAgICAgICAgICAgICAgICAgICAgdGhlIHVuZGVybGluZS4gIFRoaXMg aXMgYSBzaWduZWQgdmFsdWUgYWNjb3JkaW5nIHRvIHRoZQorICAgICAgICAgICAgICAgICAgICAg ICAgIHNwZWNzLCBhbmQgaXRzIGRlZmF1bHQgaXMKKyAgICAgICAgICAgICAgICAgICAgICAgICBS T1VORCAoKG1heGltdW0gZGVzY2VudCkgLyAyKSwgd2l0aAorICAgICAgICAgICAgICAgICAgICAg ICAgIFJPVU5EKHgpID0gZmxvb3IgKHggKyAwLjUpICAqLworICAgICAgICAgICAgICAgICAgICAg IGlmICh4X3VzZV91bmRlcmxpbmVfcG9zaXRpb25fcHJvcGVydGllcworICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBzLT5mb250ICYmIHMtPmZvbnQtPnVuZGVybGluZV9wb3NpdGlvbiA+PSAw KQorICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBzLT5mb250LT51bmRlcmxpbmVf cG9zaXRpb247CisgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAocy0+Zm9udCkKKyAgICAg ICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmZvbnQtPmRlc2NlbnQgKyAxKSAvIDI7 CisgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgcG9z aXRpb24gPSB1bmRlcmxpbmVfbWluaW11bV9vZmZzZXQ7CisgICAgICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gbWF4IChwb3NpdGlvbiwgdW5kZXJsaW5lX21p bmltdW1fb2Zmc2V0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIC8qIENoZWNr IHRoZSBzYW5pdHkgb2YgdGhpY2tuZXNzIGFuZCBwb3NpdGlvbi4gIFdlIHNob3VsZAorICAgICAg ICAgICAgICAgICBhdm9pZCBkcmF3aW5nIHVuZGVybGluZSBvdXQgb2YgdGhlIGN1cnJlbnQgbGlu ZSBhcmVhLiAqLworICAgICAgICAgICAgICBpZiAocy0+eSArIHMtPmhlaWdodCA8PSBzLT55YmFz ZSArIHBvc2l0aW9uKQorICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmhlaWdodCAtIDEp IC0gKHMtPnliYXNlIC0gcy0+eSk7CisgICAgICAgICAgICAgIGlmIChzLT55ICsgcy0+aGVpZ2h0 IDwgcy0+eWJhc2UgKyBwb3NpdGlvbiArIHRoaWNrbmVzcykKKyAgICAgICAgICAgICAgICB0aGlj a25lc3MgPSAocy0+eSArIHMtPmhlaWdodCkgLSAocy0+eWJhc2UgKyBwb3NpdGlvbik7CisgICAg ICAgICAgICAgIHMtPnVuZGVybGluZV90aGlja25lc3MgPSB0aGlja25lc3M7CisgICAgICAgICAg ICAgIHMtPnVuZGVybGluZV9wb3NpdGlvbiA9IHBvc2l0aW9uOworICAgICAgICAgICAgICB5ID0g cy0+eWJhc2UgKyBwb3NpdGlvbjsKKyAgICAgICAgICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGlu ZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChzLT5mLCBz LT5nYywgcy0+eCwgeSwgcy0+d2lkdGgsIHRoaWNrbmVzcyk7CisgICAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBYR0NWYWx1ZXMgeGdjdjsKKyAg ICAgICAgICAgICAgICAgIFhHZXRHQ1ZhbHVlcyAoRlJBTUVfWF9ESVNQTEFZIChzLT5mKSwgcy0+ Z2MsIEdDRm9yZWdyb3VuZCwgJnhnY3YpOworICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91 bmQgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMtPmdjLCBzLT5mYWNlLT51bmRlcmxpbmVfY29s b3IpOworICAgICAgICAgICAgICAgICAgeF9maWxsX3JlY3RhbmdsZSAocy0+Ziwgcy0+Z2MsIHMt PngsIHksIHMtPndpZHRoLCB0aGlja25lc3MpOworICAgICAgICAgICAgICAgICAgWFNldEZvcmVn cm91bmQgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMtPmdjLCB4Z2N2LmZvcmVncm91bmQpOwor ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgLyogRHJh dyBvdmVybGluZS4gKi8KKyAgICAgIGlmIChzLT5mYWNlLT5vdmVybGluZV9wKQorICAgICAgICB7 CisgICAgICAgICAgdW5zaWduZWQgbG9uZyBkeSA9IDAsIGggPSAxOworICAgICAgICAgIGlmIChz LT5mYWNlLT5vdmVybGluZV9jb2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgIHhfZmlsbF9y ZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCBzLT55ICsgZHksIHMtPndpZHRoLCBoKTsKKyAg ICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIFhHQ1ZhbHVlcyB4Z2N2 OworICAgICAgICAgICAgICBYR2V0R0NWYWx1ZXMgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMt PmdjLCBHQ0ZvcmVncm91bmQsICZ4Z2N2KTsKKyAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQg KEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMtPmdjLCBzLT5mYWNlLT5vdmVybGluZV9jb2xvcik7 CisgICAgICAgICAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCBzLT55 ICsgZHksIHMtPndpZHRoLCBoKTsKKyAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1F X1hfRElTUExBWSAocy0+ZiksIHMtPmdjLCB4Z2N2LmZvcmVncm91bmQpOworICAgICAgICAgICAg fQorICAgICAgICB9CisgICAgICAvKiBEcmF3IHN0cmlrZS10aHJvdWdoLiAqLworICAgICAgaWYg KHMtPmZhY2UtPnN0cmlrZV90aHJvdWdoX3ApCisgICAgICAgIHsKKyAgICAgICAgICB1bnNpZ25l ZCBsb25nIGggPSAxOworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZHkgPSAocy0+aGVpZ2h0IC0g aCkgLyAyOworICAgICAgICAgIGlmIChzLT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9jb2xvcl9kZWZh dWx0ZWRfcCkKKyAgICAgICAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54 LCBzLT55ICsgZHksIHMtPndpZHRoLCBoKTsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7 CisgICAgICAgICAgICAgIFhHQ1ZhbHVlcyB4Z2N2OworICAgICAgICAgICAgICBYR2V0R0NWYWx1 ZXMgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMtPmdjLCBHQ0ZvcmVncm91bmQsICZ4Z2N2KTsK KyAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMt PmdjLCBzLT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9jb2xvcik7CisgICAgICAgICAgICAgIHhfZmls bF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCBzLT55ICsgZHksIHMtPndpZHRoLCBoKTsK KyAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMt PmdjLCB4Z2N2LmZvcmVncm91bmQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAv KiBEcmF3IHJlbGllZiBpZiBub3QgeWV0IGRyYXduLiAqLworICAgICAgaWYgKCFyZWxpZWZfZHJh d25fcCAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gpCisgICAgICAgICAgeF9kcmF3X2ds eXBoX3N0cmluZ19ib3ggKHMpOworICAgICAgaWYgKHMtPnByZXYpCisgICAgICAgIHsKKyAgICAg ICAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpwcmV2OworICAgICAgICAgIGZvciAocHJldiA9IHMt PnByZXY7IHByZXY7IHByZXYgPSBwcmV2LT5wcmV2KQorICAgICAgICAgICAgaWYgKHByZXYtPmhs ICE9IHMtPmhsCisgICAgICAgICAgICAgICAgJiYgcHJldi0+eCArIHByZXYtPndpZHRoICsgcHJl di0+cmlnaHRfb3ZlcmhhbmcgPiBzLT54KQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAg ICAgLyogQXMgcHJldiB3YXMgZHJhd24gd2hpbGUgY2xpcHBlZCB0byBpdHMgb3duIGFyZWEsIHdl CisgICAgICAgICAgICAgICAgICAgbXVzdCBkcmF3IHRoZSByaWdodF9vdmVyaGFuZyBwYXJ0IHVz aW5nIHMtPmhsIG5vdy4gKi8KKyAgICAgICAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2Ug c2F2ZSA9IHByZXYtPmhsOworICAgICAgICAgICAgICAgIHByZXYtPmhsID0gcy0+aGw7CisgICAg ICAgICAgICAgICAgbWNfeF9zZXRfZ2x5cGhfc3RyaW5nX2djIChwcmV2LCBjdXJzb3JfZ2NfcCk7 CisgICAgICAgICAgICAgICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBwaW5nX2V4YWN0bHkgKHMs IHByZXYpOworICAgICAgICAgICAgICAgIGlmIChwcmV2LT5maXJzdF9nbHlwaC0+dHlwZSA9PSBD SEFSX0dMWVBIKQorICAgICAgICAgICAgICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19mb3JlZ3Jv dW5kIChwcmV2KTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICB4X2Ry YXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChwcmV2KTsKKyAgICAgICAgICAg ICAgICB4X3Jlc2V0X2NsaXBfcmVjdGFuZ2xlcyAocHJldi0+ZiwgcHJldi0+Z2MpOworICAgICAg ICAgICAgICAgIHByZXYtPmhsID0gc2F2ZTsKKyAgICAgICAgICAgICAgICBwcmV2LT5udW1fY2xp cHMgPSAwOworICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGlmIChzLT5uZXh0KQor ICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAqbmV4dDsKKyAgICAgICAg ICBmb3IgKG5leHQgPSBzLT5uZXh0OyBuZXh0OyBuZXh0ID0gbmV4dC0+bmV4dCkKKyAgICAgICAg ICAgIGlmIChuZXh0LT5obCAhPSBzLT5obAorICAgICAgICAgICAgICAgICYmIG5leHQtPnggLSBu ZXh0LT5sZWZ0X292ZXJoYW5nIDwgcy0+eCArIHMtPndpZHRoKQorICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgLyogQXMgbmV4dCB3aWxsIGJlIGRyYXduIHdoaWxlIGNsaXBwZWQgdG8g aXRzIG93biBhcmVhLAorICAgICAgICAgICAgICAgICAgIHdlIG11c3QgZHJhdyB0aGUgbGVmdF9v dmVyaGFuZyBwYXJ0IHVzaW5nIHMtPmhsIG5vdy4gKi8KKyAgICAgICAgICAgICAgICBlbnVtIGRy YXdfZ2x5cGhzX2ZhY2Ugc2F2ZSA9IG5leHQtPmhsOworICAgICAgICAgICAgICAgIG5leHQtPmhs ID0gcy0+aGw7CisgICAgICAgICAgICAgICAgbWNfeF9zZXRfZ2x5cGhfc3RyaW5nX2djIChuZXh0 LCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgICAgICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBw aW5nX2V4YWN0bHkgKHMsIG5leHQpOworICAgICAgICAgICAgICAgIGlmIChuZXh0LT5maXJzdF9n bHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBIKQorICAgICAgICAgICAgICAgICAgeF9kcmF3X2dseXBo X3N0cmluZ19mb3JlZ3JvdW5kIChuZXh0KTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAg ICAgICAgICAgICB4X2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChuZXh0 KTsKKyAgICAgICAgICAgICAgICB4X3Jlc2V0X2NsaXBfcmVjdGFuZ2xlcyAobmV4dC0+ZiwgbmV4 dC0+Z2MpOworICAgICAgICAgICAgICAgIG5leHQtPmhsID0gc2F2ZTsKKyAgICAgICAgICAgICAg ICBuZXh0LT5udW1fY2xpcHMgPSAwOworICAgICAgICAgICAgICAgIG5leHQtPmNsaXBfaGVhZCA9 IHMtPm5leHQ7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgLyogUmVzZXQg Y2xpcHBpbmcuICovCisgIHhfcmVzZXRfY2xpcF9yZWN0YW5nbGVzIChzLT5mLCBzLT5nYyk7Cisg IHMtPm51bV9jbGlwcyA9IDA7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBEZWZhdWx0IHRvIHVzaW5nIFhJTSBpZiBhdmFp bGFibGUuICAqLwogI2lmZGVmIFVTRV9YSU0KIGJvb2wgdXNlX3hpbSA9IHRydWU7CkBAIC0xMTA5 LDYgKzIwMTAsMTYgQEAgc3RhdGljIHZvaWQKIHhfdXBkYXRlX2JlZ2luIChzdHJ1Y3QgZnJhbWUg KmYpCiB7CiAgIC8qIE5vdGhpbmcgdG8gZG8uICAqLworCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0g ZjsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAvKiBEcmF3IGEgdmVydGlj YWwgd2luZG93IGJvcmRlciBmcm9tICh4LHkwKSB0byAoeCx5MSkgICovCkBAIC0xMjU0LDYgKzIx NjUsMTYgQEAgeF91cGRhdGVfZW5kIChzdHJ1Y3QgZnJhbWUgKmYpCiAgIFhGbHVzaCAoRlJBTUVf WF9ESVNQTEFZIChmKSk7CiAgIHVuYmxvY2tfaW5wdXQgKCk7CiAjZW5kaWYKKworCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5tY191cGRh dGluZ19mcmFtZSA9IE5VTEw7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIH0KIAog LyogVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgZnJvbSB2YXJpb3VzIHBsYWNlcyBpbiB4ZGlzcC5j CkBAIC0xMzIzOCw2ICsxNDE1OSwyMCBAQCBleHRlcm4gZnJhbWVfcGFybV9oYW5kbGVyIHhfZnJh bWVfcGFybV9oYW5kbGVyc1tdOwogCiBzdGF0aWMgc3RydWN0IHJlZGlzcGxheV9pbnRlcmZhY2Ug eF9yZWRpc3BsYXlfaW50ZXJmYWNlID0KICAgeworCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisvKiBgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4g YHh0ZXJtLmNgIG11c3QgYmUgaW4gdGhlIGV4YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitgcmVkaXNw bGF5X2ludGVyZmFjZScgaW4gYGRpc3BleHRlcm4uaGAhICovCisKKyAgbWNfeF9kcmF3X3dpbmRv d19jdXJzb3IsCisgIG1jX3hfZHJhd19nbHlwaF9zdHJpbmcsCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworCisKICAgICB4X2ZyYW1lX3Bhcm1faGFuZGxlcnMsCiAgICAgZ3VpX3Byb2R1Y2Vf Z2x5cGhzLAogICAgIGd1aV93cml0ZV9nbHlwaHMsCg== --Multipart_Sun_Nov_17_22:58:13_2019-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs / fill-column). References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Mon, 27 Jan 2020 07:40:02 +0000 Resent-Message-ID: <handler.22873.B22873.158011077019677 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22873 <at> debbugs.gnu.org,17684 <at> debbugs.gnu.org Cc: eliz@HIDDEN, johnw@HIDDEN, mbork@HIDDEN, rms@HIDDEN, akioburns@HIDDEN Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.158011077019677 (code B ref 22873); Mon, 27 Jan 2020 07:40:02 +0000 Received: (at 22873) by debbugs.gnu.org; 27 Jan 2020 07:39:30 +0000 Received: from localhost ([127.0.0.1]:57770 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ivyzZ-00057F-Rs for submit <at> debbugs.gnu.org; Mon, 27 Jan 2020 02:39:29 -0500 Received: from gateway21.websitewelcome.com ([192.185.45.133]:33009) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1ivyzX-00056y-4m for 22873 <at> debbugs.gnu.org; Mon, 27 Jan 2020 02:39:27 -0500 Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway21.websitewelcome.com (Postfix) with ESMTP id B2B13400CDACC for <22873 <at> debbugs.gnu.org>; Mon, 27 Jan 2020 01:39:26 -0600 (CST) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id vyzViFr2iNBC3vyzWiWprO; Mon, 27 Jan 2020 01:39:26 -0600 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=FF7Ia8CX/kkOViBte79P6A5utyb4qOSr6Xf5QXxPIy0=; b=ndFbF0Rc9Y38HUopdU8EpMiRX3 Ir3hRvZeAMEhUJK/dEIhDdgsQJjs0pXaQYcqct3Ccv6gj54uSj+7Q/E3HoT7dTbPsY6RfUcFg8Guv 6mW7EAnSoodXyi/hMtqsarqRHRQwcJhMeYwMOCkrZwr+D+5Hm8HcNEs3GH6+rjjwIYAA2eYIphbfx e7OuT0xcO6rNwUuYmsnSgmveeHxhrn7Qx3jJVFNQs5Z9PEmlgmgr+Dwd0ANT9k6KjBzlDhUWc+B1b ObmHF0uJfuErSXn4/mNkdwjHkSF5I9M64bxnMxphsaEpzTc3X6eqsA1QU7FVgZUZ0E7YImQrk8hbB EBuxF0Cg==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:54196 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from <esq@HIDDEN>) id 1ivyzS-003Ks1-42; Mon, 27 Jan 2020 01:39:25 -0600 Date: Sun, 26 Jan 2020 23:39:21 -0800 Message-ID: <m2a769cpqu.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Sun_Jan_26_23:39:20_2020-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1ivyzS-003Ks1-42 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:54196 X-Source-Auth: lawlist X-Email-Count: 7 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> --Multipart_Sun_Jan_26_23:39:20_2020-1 Content-Type: text/plain; charset=US-ASCII VERSION: 022.006 [01/26/2020] CHANGELOG: - Fixed a bug in `mc_engine' that erroneously permitted an attempt to draw a floating fake cursors (horizontal ruler) when the WD (width) had a negative value. It is now properly suppressed when the preceding character is MC_GLYPH. - crosshairs.el: The variable `+-fill-column' is now buffer-local. Renamed the variable `+-parens-p' to `+-parens-highlight'. - The setting of `w->mc.lnum_pixel_width` within `maybe_produce_line_number' is now conditioned upon (it->area == TEXT_AREA && IT_CHARPOS (*it) == wstart.charpos): https://lists.gnu.org/archive/html/emacs-devel/2019-12/msg00232.html - Miscellaneous tidying-up of code. VIDEOS: w32: https://youtu.be/r3BdJVlsAnQ ns: https://youtu.be/bc1h8jtbXmw x11: https://youtu.be/aCIFhD2Xz5s SCREENSHOTS: https://www.lawlist.com/images/22873_17684_light_dark_backgrounds.png SETUP: Step 1: git clone -b master git://git.sv.gnu.org/emacs.git Step 2: In the new emacs folder, go back to an Emacs version from 07/14/2019: git reset --hard ac57c5093829ee09084c562bbbc1c412179be13d Step 3: From within the new emacs folder created in Step 1, apply the patch: git apply /path/to/the/patch.diff Step 4: ./autogen.sh Step 5: ./configure ... [your custom options] Step 6: make Step 7: make install USAGE: - For a minimal working example of built-in fake cursors, type: M-x mc-test ;;; TURN ON FAKE CURSORS (buffer position, cursor-type, cursor color): (setq mc-conf '((1 "hbar" "magenta") (2 "bar" "purple") (3 "box" "#00FF00") (4 "hollow" "#0000FF") (5 ("hbar" 3) [1.0 0.0 1.0]) (6 ("bar" 3) [0.0 1.0 1.0]) (7 "framed" "OrangeRed"))) ;;; TURN OFF FAKE CURSORS: (setq mc-conf nil) - To try out both the crosshairs feature and the visible fill column indicator feature, type: M-x +-mode - To try out just the visible fill column indicator feature, type: M-x fc-mode - To try out built-in fake cursors with Magnar Sveen's multiple-cursors package, that package must be installed. If the multiple-cursors package is already installed, then just (require 'crosshairs) and `crosshairs.el` will redefine a few of the multiple-cursors functions and set up a few keyboard shortcuts. If the multiple-cursors package by Magnar Sveen is not already installed, then here are two easy ways to install that package: Type: M-x mc-install OR, evaluate the following snippet: (progn (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) (package-refresh-contents) (package-install 'multiple-cursors) (mc/built-in-cursors)) NOTES: - Our journey begins at the outset of `update_window' when `mc_update_window_dryrun' performs a `!draw_p` simulation to create a new cache of fake cursors that are stored in the `w->mc_matrix`. The cache of fake cursors from the previous redisplay is copied to a temporary `mc_matrix` under the name of `old_matrix`. `mc_update_text_area' (used for `!draw_p` / `draw_p` situations) calls `mc_draw_glyphs' (writes glyphs to the glass) followed by `mc_draw_row' (writes fake cursors to the glass immediately thereafter). At the tail end of `mc_update_window_dryrun', `mc_update_window_erase' compares the new `w->mc_matrix` with the `old_matrix` to determine which fake cursors are the same -- setting the `same_p` boolean struct member accordingly for each applicable fake cursor within the `w->mc_matrix`. All fake cursors in the `old_matrix` that are `!same_p` get erased at this juncture. [Fn 1.] After the dryrun is complete, `update_window' does the real thing -- `draw_p`. As to the `from_where` situations of SKIPPED, POST_CHANGED, UNCHANGED, and SET_CURSOR_TWO, `mc_helper' compares the incoming tentative fake cursor with the `w->mc_matrix` to see if it has previously been marked as `same_p` -- if it is `!same_p`, then the fake cursor is drawn and we `return`. Fake cursors that have a `cursor_type` of MC_LEFT_FRINGE_BITMAP or MC_RIGHT_FRINGE_BITMAP are always reset even if they are `same_p`. As to the `from_where` situations of SCRIBE_ONE, SCRIBE_TWO, SCRIBE_THREE, and NOWHERE, `mc_helper' always causes fake cursors to be drawn (because new glyphs were written to the glass, or the area to the right of the display line was cleared) and we `return`. . Fn. 1: Even though writing new glyphs to the glass (SCRIBE_ONE, SCRIBE_TWO, and SCRIBE_THREE) would erase fake cursors within those boundaries, it is still necessary to erase `!same_p` fake cursors prior thereto. This is because `scrolling_window' occurs before new glyphs are written and `rif->scroll_run_hook' may copy one or more rows to other areas of the glass. It is not worth the effort to programmatically track both the _copied_ fake cursors and the _original_ fake cursors from the previous redisplay cycle, whose glyphs may remain where they are in the current redisplay cycle because they satisfy the `GLYPH_EQUAL_P' test. - The rest of our journey takes place wherever `draw_glyphs' would ordinarily be called, excluding `update_text_area'. If features 17684/22873 are active, `mc_redraw_row' calls `mc_draw_glyphs' (writes glyphs to the glass) and fake cursors are written to the glass immediately thereafter (if the coordinates coincide with prerecorded data in the `w->mc_matrix`). The functions containing the aforementioned calls are: . `gui_insert_glyphs' . `gui_fix_overlapping_area' . `draw_row_with_mouse_face' . `expose_area' . `expose_line' . `redraw_overlapped_rows' [which has been incorporated into `update_window'] - As to `mc_scrolling_window', it would appear that there is no tangible benefit to rotating the current/prospective cache of fake cursors to compare the data before removing the fake cursors. When scrolling the display, only _some_ lines are copied to new locations. Areas that are not overwritten may have fake cursors and those may not necessarily be removed if desired/current matrix glyphs are equal. The test for `GLYPH_EQUAL_P' does not take into consideration the existence of a fake cursor, and the glyph (with a fake cursor) may not be updated as a result thereof. As to lines that are not copied, portions may be updated and fake cursors would be removed thereby. `mc_rotate_matrix' and `mc_reverse_vpos' were removed with patch v. 022.002. - NS: As of 09/28/2018 (7946445962372c4255180af45cb7c857f1b0b5fa), the NS port no longer does anything useful during `update_window' except mark dirty rectangles. All drawing is now done when the MacOS calls `drawRect', which in turn calls `expose_frame'. TODO: - When an idle-timer fires and point is at the end of a horizontally scrolled line in a narrow window, the temporary horizontal scroll is canceled. Create a minimal working example and file a bug report. (progn (defun test () (interactive) (let ((ov (make-overlay (point) (1+ (point)) nil t t))) (overlay-put ov 'face '(:foreground "red")))) (global-set-key [f5] 'test) (split-window-horizontally) (switch-to-buffer (get-buffer-create "foo")) (setq bidi-display-reordering nil) (setq-local auto-hscroll-mode 'current-line) (dotimes (i 80) (insert (char-to-string (+ 65 i))))) - `ns_draw_window_cursor' calls `ns_clip_to_rect', which does _not_ take `row->clip` into consideration when drawing cursors with `NSRectFill'. When it comes time to draw glyphs on top of the box/hollow family of cursors, `row->clip` is taken into consideration by `get_glyph_string_clip'. Fake cursors can be drawn even though the glyphs cannot, resulting in hollow/box family of cursors without text. The issue can be reproduced with M-x mc-test. [A temporary workaround is to disable `row->clip` while drawing the glyphs.] https://lists.gnu.org/archive/html/emacs-devel/2019-04/msg00009.html - Deal with left/right overwritten glyphs in the w32 and X ports of Emacs. - The current test for `auto_hscroll_mode_p' only looks for `current_line` and all five related tests are based upon that assumption, which may not be true. - Multiple Cursors: If point is in the middle of a composite character, then select a fully composed character so that the fake cursor is visible. - Implement functionality similar to the Lisp multiple-cursors by Magnar Sveen. - Follow up with the Emacs team re bug#32177; i.e., (Current line number shifts one column to the left.) - Follow up with the Emacs team re bug#32060; i.e., Horizontal Scrolling (Current Line): Wrong line gets h-scrolled. - Determine if bug #28936 needs to be fixed and help the Emacs team re same. - Is there any additional meaningful optimization that can be added to the three calls of `mc_pre_scroll_clean'? - There is a bug affecting an older version of Emacs for the NS port that causes partial line flickering when the same characters are grouped together (;;;;;;) and MC_GLYPHLESS cursors are above or below -- having the same background color as the frame; e.g., black on black (used to erase a glyphless cursor). The partial flickering is only noticeable with rapid fire; e.g., holding down the right/left arrow key. When changing the color of the glyphless cursor, the issue is not present. [@lawlist has verified that the X and HPOS coordinates are accurate.] --Multipart_Sun_Jan_26_23:39:20_2020-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="2020_01_26__21_06_44_685.diff" Content-Transfer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4gbWMvbWF4LWN1cnNvcnMKKyAgICAgICh1bmxlc3MgKDwg KG1jL251bS1jdXJzb3JzKSBtYy9tYXgtY3Vyc29ycykKKyAgICAgICAgKGlmICh5ZXMtb3Itbm8t cCAoZm9ybWF0ICIlZCBhY3RpdmUgY3Vyc29ycy4gQ29udGludWU/ICIgKG1jL251bS1jdXJzb3Jz KSkpCisgICAgICAgICAgICAoc2V0cSBtYy9tYXgtY3Vyc29ycyAocmVhZC1udW1iZXIgIkVudGVy IGEgbmV3LCB0ZW1wb3JhcnkgbWF4aW11bTogIikpCisgICAgICAgICAgKG1jL3JlbW92ZS1mYWtl LWN1cnNvcnMpCisgICAgICAgICAgKGVycm9yICJBYm9ydGVkOiB0b28gbWFueSBjdXJzb3JzIikp KSkKKyAgICAobGV0ICgob3ZlcmxheQorICAgICAgICAgICAgKGlmIG1jL3VzZS1idWlsdC1pbi1j dXJzb3JzCisgICAgICAgICAgICAgIChtYWtlLW92ZXJsYXkgKHBvaW50KSAocG9pbnQpKQorICAg ICAgICAgICAgICAobWMvbWFrZS1jdXJzb3Itb3ZlcmxheS1hdC1wb2ludCkpKSkKKyAgICAgIChv dmVybGF5LXB1dCBvdmVybGF5ICdtYy1pZCAob3IgaWQgKG1jL2NyZWF0ZS1jdXJzb3ItaWQpKSkK KyAgICAgIChvdmVybGF5LXB1dCBvdmVybGF5ICd0eXBlICdmYWtlLWN1cnNvcikKKyAgICAgIChv dmVybGF5LXB1dCBvdmVybGF5ICdwcmlvcml0eSAxMDApCisgICAgICAobWMvc3RvcmUtY3VycmVu dC1zdGF0ZS1pbi1vdmVybGF5IG92ZXJsYXkpCisgICAgICAod2hlbiAodXNlLXJlZ2lvbi1wKQor ICAgICAgICAob3ZlcmxheS1wdXQgb3ZlcmxheSAncmVnaW9uLW92ZXJsYXkKKyAgICAgICAgICAg ICAgICAgICAgIChtYy9tYWtlLXJlZ2lvbi1vdmVybGF5LWJldHdlZW4tcG9pbnQtYW5kLW1hcmsp KSkKKyAgIC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1jb21tYW5kIChpbnRlcm4gKHN5bWJvbC1uYW1lIG9yaWdpbmFs LWNvbW1hbmQpKSkKKyAgICAgICAgICAgICAgICA7OyBvdGhlcndpc2UgaXQncyBhIHN5bWJvbCwg YW5kIHdlIGNhbiBiZSBtb3JlIHRob3JvdWdoCisgICAgICAgICAgICAgICAgKGlmIChnZXQgb3Jp Z2luYWwtY29tbWFuZCAnbWMtLXVuc3VwcG9ydGVkKQorICAgICAgICAgICAgICAgICAgICAobWVz c2FnZSAiJVMgaXMgbm90IHN1cHBvcnRlZCB3aXRoIG11bHRpcGxlIGN1cnNvcnMlcyIKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgb3JpZ2luYWwtY29tbWFuZAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAoZ2V0IG9yaWdpbmFsLWNvbW1hbmQgJ21jLS11bnN1cHBvcnRlZCkpCisg ICAgICAgICAgICAgICAgICAod2hlbiAoYW5kIG9yaWdpbmFsLWNvbW1hbmQKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgKG5vdCAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jLS1kZWZhdWx0 LWNtZHMtdG8tcnVuLW9uY2UpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobm90ICht ZW1xIG9yaWdpbmFsLWNvbW1hbmQgbWMvY21kcy10by1ydW4tb25jZSkpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIChvciBtYy9hbHdheXMtcnVuLWZvci1hbGwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIChtZW1xIG9yaWdpbmFsLWNvbW1hbmQgbWMtLWRlZmF1bHQtY21k cy10by1ydW4tZm9yLWFsbCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtZW1x IG9yaWdpbmFsLWNvbW1hbmQgbWMvY21kcy10by1ydW4tZm9yLWFsbCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIChtYy9wcm9tcHQtZm9yLWluY2x1c2lvbi1pbi13aGl0ZWxpc3Qg b3JpZ2luYWwtY29tbWFuZCkpKQorICAgICAgICAgICAgICAgICAgICAobWMvZXhlY3V0ZS1jb21t YW5kLWZvci1hbGwtZmFrZS1jdXJzb3JzIG9yaWdpbmFsLWNvbW1hbmQpKSkpCisgICAgICAgICAg ICAgICh3aGVuIG1jL3VzZS1idWlsdC1pbi1jdXJzb3JzCisgICAgICAgICAgICAgICAgKHNldHEg bWMtY29uZgorICAgICAgICAgICAgICAgICAgICAgICAgKG1hcGNhcgorICAgICAgICAgICAgICAg ICAgICAgICAgICAobGFtYmRhICh4KSAobGlzdCAob3ZlcmxheS1zdGFydCB4KSAiYmFyIiBuaWwp KQorICAgICAgICAgICAgICAgICAgICAgICAgICAobWMvYWxsLWZha2UtY3Vyc29ycykpKSkpKSkp KSkKKworICAoZGVmdW4gbWMvbWFyay1uZXh0LWxpa2UtdGhpcy1jeWNsZS1mb3J3YXJkICgpCisg ICJNYXJrcyBuZXh0IG9jY3VyZW5jZSBvZiB3b3JkIGxpa2UgdGhpcyBhbmQgYWR2YW5jZXMgY3Vy c29yIHRvIHRoaXMgb2NjdXJyZW5jZSIKKyAgKGludGVyYWN0aXZlKQorICAgIChtYy9tYXJrLW5l eHQtbGlrZS10aGlzIDEpKQorCisgIChkZWZ1biBtYy9tYXJrLXByZXZpb3VzLWxpa2UtdGhpcy1j eWNsZS1mb3J3YXJkICgpCisgICJNYXJrcyBuZXh0IG9jY3VycmVuY2Ugb2Ygd29yZCBsaWtlIHRo aXMgYW5kIGFkdmFuY2VzIGN1cnNvciB0byB0aGlzIG9jY3VycmVuY2UiCisgIChpbnRlcmFjdGl2 ZSkKKyAgICAobWMvbWFyay1wcmV2aW91cy1saWtlLXRoaXMgMSkpCisKKyAgKGFkZC10by1saXN0 ICdtYy0tZGVmYXVsdC1jbWRzLXRvLXJ1bi1vbmNlICdtYy9tYXJrLW5leHQtbGlrZS10aGlzLWN5 Y2xlLWZvcndhcmQp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mcgZWFjaCBlbGVtZW50IG9mIHRoZSBMU0wgY29sb3IgdmVjdG9yIGJ5IDI1NS4g IGB4dGVybS5jJyB1c2VzCitgeF9tYWtlX3RydWVjb2xvcl9waXhlbCcsIHdoaWNoIHVzZXMgMTYt Yml0IFJHQiAtLSB0aGUgY29udmVyc2lvbiBmcm9tIExTTAoraGFwcGVucyBpbnRlcm5hbGx5IGJ5 IG11bHRpcGx5aW5nIGVhY2ggZWxlbWVudCBvZiB0aGUgTFNMIGNvbG9yIHZlY3RvciBieSA2NTUz NS4iCisoaW50ZXJhY3RpdmUpCisgIChsZXQgKChidWZmZXIgKGdldC1idWZmZXItY3JlYXRlICIq TUMtVEVTVCoiKSkpCisgICAgKHdpdGgtY3VycmVudC1idWZmZXIgYnVmZmVyCisgICAgICAoZXJh c2UtYnVmZmVyKQorICAgICAgKGluc2VydCAiVGhpcyBpcyBhIHRlc3QhIikKKyAgICAgIChzZXRx IG1jLWNvbmYgJygoMSAiaGJhciIgIm1hZ2VudGEiKQorICAgICAgICAgICAgICAgICAgICAgICgy ICJiYXIiICJwdXJwbGUiKQorICAgICAgICAgICAgICAgICAgICAgICgzICJib3giICIjMDBGRjAw IikKKyAgICAgICAgICAgICAgICAgICAgICAoNCAiaG9sbG93IiAiIzAwMDBGRiIpCisgICAgICAg ICAgICAgICAgICAgICAgKDUgKCJoYmFyIiAzKSBbMS4wIDAuMCAxLjBdKQorICAgICAgICAgICAg ICAgICAgICAgICg2ICgiYmFyIiAzKSBbMC4wIDEuMCAxLjBdKQorICAgICAgICAgICAgICAgICAg ICAgICg3ICJmcmFtZWQiICJPcmFuZ2VSZWQiKQorICAgICAgICAgICAgICAgICAgICAgICg4ICJi b3giICJncmV5MjUiKQorICAgICAgICAgICAgICAgICAgICAgICg5ICJib3giICJncmV5NzUiKSkp KQorICAgIChzZWxlY3Qtd2luZG93IChkaXNwbGF5LWJ1ZmZlciBidWZmZXIpKSkpCisKKyhkZWZ1 biArLXRpbWVyLWZuICgpCisi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jbHVzaW9ucykK KyAgICAgICAgICAgICAgICAoYW5kIChudWxsICstcGFyZW5zLWhpZ2hsaWdodCkKKyAgICAgICAg ICAgICAgICAgICAgIChudWxsICstcGFyZW5zLW92ZXJsYXlzLWV4aXN0LXApKSkKKyAgICAgICgr LWRlbGV0ZS1wYXJlbnMtb3ZlcmxheXMpKQorICAgIChpZiBmb3JjZQorICAgICAgKHdoZW4gKy1w YXJlbnMtaGlnaGxpZ2h0CisgICAgICAgICgrLXBhcmVucy1mbikpCisgICAgICAoc2V0cSArLXRp bWVyLXZhciAocnVuLXdpdGgtaWRsZS10aW1lciArLWlkbGUtdGltZXItc2Vjb25kcyBuaWwgIycr LXRpbWVyLWZuKSkpKSkKKworKGRlZnZhciBmYy1tb2RlKQorCis7OzsjIyNhdXRvbG9hZAorKGRl ZmluZS1taW5vci1tb2RlICstbW9kZQorIk1pbm9yIG1vZGUgZm9yIGRpc3BsYXlpbmcgYSBob3Jp em9udGFsIHJ1bGVyLiIKKyAgOmluaXQtdmFsdWUgbmlsCisgIDpsaWdodGVyICIgKyIKKyAgOmtl eW1hcCBuaWwKKyAgOmdsb2JhbCBuaWwKKyAgOmdyb3VwICcrLW1vZGUKKyAgKGNvbmQKKyAgICAo Ky1tb2RlCisgICAgICA7OzsgYCstbW9kZScgaGFzIHRoZSBhYmlsaXR5IHRvIGFsc28gZGlzcGxh eSBhIGZpbGwgY29sdW1uIGluZGljYXRvci4KKyAgICAgIDs7OyBTZWUgdGhlIHZhcmlhYmxlIGAr LWZpbGwtY29sdW1uJy4KKyAgICAgICh3aGVuIGZjLW1vZGUKKyAgICAgICAgKGZjLW1vZGUgLTEp KQorICAgICAgKHdoZW4gKGFuZCBnbG9iYWwtZWxkb2MtbW9kZQorICAgICAgICAgICAgICAgICAo Y2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAgICAgICAgICAoZXF1YWwgY3Vy cmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAoZ2xvYmFsLWVsZG9jLW1vZGUgLTEpKQor ICAgICAgKHdoZW4gKGFuZCBqaXQtbG9jay1jb250ZXh0LXRpbWVyCisgICAgICAgICAgICAgICAg IChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgIChlcXVhbCBj dXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVuICh0aW1lcnAgaml0LWxvY2st Y29udGV4dC10aW1lcikKKyAgICAgICAgICAoY2FuY2VsLXRpbWVyIGppdC1sb2NrLWNvbnRleHQt dGltZXIpKQorICAgICAgICA7OyAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIChydW4td2l0 aC1pZGxlLXRpbWVyIDUuMCAncmVwZWF0ICdqaXQtbG9jay1jb250ZXh0LWZvbnRpZnkpKQorICAg ICAgICAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIG5pbCkpCisgICAgICAod2hlbiAoYW5k IChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAgIChlcXVhbCBj dXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVuICh0aW1lcnAgdW5kby1hdXRv LWN1cnJlbnQtYm91bmRhcnktdGltZXIpCisgICAgICAgICAgKGNhbmNlbC10aW1lciB1bmRvLWF1 dG8tY3VycmVudC1ib3VuZGFyeS10aW1lcikpCisgICAgICAgIChmc2V0ICd1bmRvLWF1dG8tLXVu ZG9hYmxlLWNoYW5nZQorICAgICAgICAgICAgICAobGFtYmRhICgpIChhZGQtdG8tbGlzdCAndW5k by1hdXRvLS11bmRvYWJseS1jaGFuZ2VkLWJ1ZmZlcnMgKGN1cnJlbnQtYnVmZmVyKSkpKQorICAg ICAgICAoZnNldCAndW5kby1hdXRvLWFtYWxnYW1hdGUgJ2lnbm9yZSkpCisgICAgICAod2hlbiBi bGluay1jdXJzb3ItbW9kZQorICAgICAgICAoYmxpbmstY3Vy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LgorICAgICAgKHVubGVzcyAobnVsbCBiaWRpLWRpc3BsYXktcmVvcmRlcmluZykKKyAg ICAgICAgKHNldHEgYmlkaS1kaXNwbGF5LXJlb3JkZXJpbmcgbmlsKSkKKyAgICAgIChzZXQgKG1h a2UtbG9jYWwtdmFyaWFibGUgJystLXNhdmVkLXN0YXRlKSBuaWwpCisgICAgICAoZG9saXN0ICh2 YXIgJyhidWZmZXItZGlzcGxheS10YWJsZQorICAgICAgICAgICAgICAgICAgICAgZnJpbmdlLWlu ZGljYXRvci1hbGlzdAorICAgICAgICAgICAgICAgICAgICAgdGFiLXdpZHRoCisgICAgICAgICAg ICAgICAgICAgICBsaW5lLW1vdmUtdmlzdWFsCisgICAgICAgICAgICAgICAgICAgICB0cnVuY2F0 ZS1saW5lcworICAgICAgICAgICAgICAgICAgICAgdHJ1bmNhdGUtcGFydGlhbC13aWR0aC13aW5k b3dzCisgICAgICAgICAgICAgICAgICAgICB3b3JkLXdyYXApKQorICAgICAgICAod2hlbiAobG9j YWwtdmFyaWFibGUtcCB2YXIpCisgICAgICAgICAgKHB1c2ggKGNvbnMgdmFyIChzeW1ib2wtdmFs dWUgdmFyKSkgKy0tc2F2ZWQtc3RhdGUpKSkKKyAgICAgIChzZXRxIGZpbGwtY29sdW1uIDgwKQor ICAgICAgKHNldHEgZGlzcGxheS1saW5lLW51bWJlcnMgdCkKKyAgICAgIChzZXRxLWxvY2FsIGF1 dG8taHNjcm9sbC1tb2RlICdjdXJyZW50LWxpbmUpCisgICAgICAoc2V0cS1sb2NhbCBoc2Nyb2xs LXN0ZXAgNSkKKyAgICAgIChzZXRxIGJ1ZmZlci1kaXNwbGF5LXRhYmxlICstYnVmZmVyLWRpc3Bs YXktdGFibGUpCisgICAgICAoc2V0cSB0YWItd2lkdGggNCkKKyAgICAgIChzZXQgKG1ha2UtbG9j YWwtdmFyaWFibGUgJ2xpbmUtbW92ZS12aXN1YWwpIHQpCisgICAgICAoc2V0cSB0cnVuY2F0ZS1s aW5lcworICAgICAgICAoY29uZAorICAgICAgICAgICgobGV0ICgobHN0ICstdHJ1bmNhdGUtbGlu ZXMtZGVyaXZlZC1tb2RlcykKKyAgICAgICAgICAgICAgICAgIG1vZGUpCisgICAgICAgICAgICAo Y2F0Y2ggJ2ZvdW5kCisgICAgICAgICAgICAgICh3aGlsZSAoc2V0cSBtb2RlIChwb3AgbHN0KSkK KyAgICAgICAgICAgICAgICAod2hlbiAoZGVyaXZlZC1tb2RlLXAgbW9kZSkKKyAgICAgICAgICAg ICAgICAgICh0aHJvdyAnZm91bmQgdCkpKSkpKQorICAgICAgICAgICAoKG1lbXEgbWFqb3ItbW9k ZSArLXRydW5jYXRlLWxpbmVzLW1ham9yLW1vZGVzKSkKKyAgICAgICAgICAgKHQKKyAgICAgICAg ICAgICBuaWwpKSkKKyAgICAgIChzZXQgKG1ha2UtbG9jYWwtdmFyaWFibGUgJ3RydW5jYXRlLXBh cnRpYWwtd2lkdGgtd2luZG93cykgbmlsKQorICAgICAgKHNldHEgd29yZC13cmFwIHQpCisgICAg ICAoc2V0cSBpbmRpY2F0ZS1lbXB0eS1saW5lcyB0KQorICAgICAgKHNldHEgaW5kaWNhdGUtYnVm ZmVyLWJvdW5kYXJpZXMgJ2xlZnQpCisgICAgICAoc2V0cSBmcmluZ2UtaW5kaWNhdG9yLWFsaXN0 CisgICAgICAgICAgOzs7IGhzY2xfYWxsX3RlbXBfcCB8IGhzY2xfdGVtcF9wCisgICAgICAgICco KCstaHNjbC10ZW1wIC4gKCstc2luZ2xlLWFuZ2xlLWxlZnQKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgKy1kb3VibGUtYW5nbGUtbGVmdCkpCisgICAgICAgICAgOzs7IGhzY2xfYWxsX3Blcm1f MF9wIHwgaHNjbF9hbGxfcGVybV8xX3AgfCBoc2NsX2FsbF9wZXJtXzJfcCB8IGhzY2xfcGVybV9w CisgICAgICAgICAgKCstaHNjbC1wZXJtIC4gKCstc2luZ2xlLWFuZ2xlLXVwCisgICAgICAgICAg ICAgICAgICAgICAgICAgICstZG91YmxlLWFuZ2xlLXVwCisgICAgICAgICAgICAgICAgICAgICAg ICAgICstdHJpcGxlLWFuZ2xlLXVwCisgICAgICAgICAgICAgICAgICAgICAgICAgICstcXVhZHJ1 cGxlLWFuZ2xlLXVwKSkKKyAgICAgICAgICAoKy1vdmVybGF5LWFycm93IC4gKCstZnJpbmdlLWxl ZnQtYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICstZnJpbmdlLXJpZ2h0LWFy cm93KSkKKyAgICAgICAgICAodHJ1bmNhdGlvbiAuICgrLWZyaW5nZS1sZWZ0LWFycm93CisgICAg ICAgICAgICAgICAgICAgICAgICAgKy1mcmluZ2UtcmlnaHQtYXJyb3cpKQorICAgICAgICAgIChj b250aW51YXRpb24gLiAoKy1mcmluZ2UtbGVmdC1jdXJseS1hcnJvdworICAgICAgICAgICAgICAg ICAgICAgICAgICAgKy1iYWNrc2xhc2gpKQorICAgICAgICAgIChvdmVybGF5LWFycm93IC4gKy1m cmluZ2UtcmlnaHQtdHJpYW5nbGUpCisgICAgICAgICAgKHVwIC4gKy1mcmluZ2UtdXAtYXJyb3cp CisgICAgICAgICAgKGRvd24gLiArLWZyaW5nZS1kb3duLWFycm93KQorICAgICAgICAgICh0b3Ag LiArLWZyaW5nZS10b3AtbGVmdC1hbmdsZSkKKyAgICAgICAgICAoYm90dG9tIC4gKy1mcmluZ2Ut Ym90dG9tLXJpZ2h0LWFuZ2xlKQorICAgICAgICAgICh0b3AtYm90dG9tIC4gKCstZnJpbmdlLWxl ZnQtYnJhY2tldAorICAgICAgICAgICAgICAgICAgICAgICAgICstZnJpbmdlLXJpZ2h0LWJyYWNr ZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICArLWZyaW5nZS10b3AtcmlnaHQtYW5nbGUKKyAg ICAgICAgICAgICAgICAgICAgICAgICArLWZyaW5nZS10b3AtbGVmdC1hbmdsZSkpCisgICAgICAg ICAgKGVtcHR5LWxpbmUgLiArLWZyaW5nZS1lbXB0eS1saW5lKQorICAgICAgICAgICh1bmtub3du IC4gKy1mcmluZ2UtcXVlc3Rpb24tbWFyaykpKQorICAgICAgKHNldHEgZnJpbmdlLWN1cnNvci1h bGlzdCAnKChib3ggLiArLWZyaW5nZS1sZWZ0LXRyaWFuZ2xlKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIChob2xsb3cgLiArLWhvbGxvdy1yZWN0YW5nbGUpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgKGJhciAuICstdmVydGljYWwtYmFyKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIChoYmFyIC4gKy1mcmluZ2UtaG9yaXpvbnRhbC1iYXIp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGhvbGxvdy1zbWFsbCAuICstZnJp bmdlLWhvbGxvdy1zcXVhcmUpKSkKKyAgICAgIChpZiAob3IgKy1mb3J0aHdpdGgKKyAgICAgICAg ICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAgICAgICAgKGFkZC1ob29r ICdwb3N0LWNvbW1hbmQtaG9vayAnKy1kcmF3LWZvcnRod2l0aCAnYXBwZW5kICdsb2NhbCkKKyAg ICAgICAgKGFkZC1ob29rICdwb3N0LWNvbW1hbmQtaG9vayAnKy1kcmF3LWNyb3NzaGFpcnMgJ2Fw cGVuZCAnbG9jYWwpKQorICAgICAgKHdoZW4gKy1mb3J0aHdpdGgKKyAgICAgICAgKGFkZC1ob29r ICd3aW5kb3ctY29uZmlndXJhdGlvbi1jaGFuZ2UtaG9vayAnKy1kcmF3LWZvcnRod2l0aCBuaWwg J2xvY2FsKSkKKyAgICAgIChhZGQtaG9vayAnY2hhbmdlLW1ham9yLW1vZGUtaG9vayAndHVybi1v ZmYtKy1tb2RlIG5pbCAnbG9jYWwpCisgICAgICA7OzsgTWF0Y2hpbmcgcGFyZW50aGVzZXMgZHJh d2luZyBmb3J0aHdpdGggaW50ZXJmZXJlcyB3aXRoIHlhc25pcHBldC4KKyAgICAgICh3aGVuICst Zm9ydGh3aXRoCisgICAgICAgIChzZXRxICstcGFyZW5zLWhpZ2hsaWdodCBuaWwpKQorICAgICAg KHdoZW4gKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAgJ2FueSkKKyAgICAgICAgKGNvbmQKKyAgICAg ICAgICAoKy1mb3J0aHdpdGgKKyAgICAgICAgICAgIChtZXNzYWdlICJUdXJuZWQgT04gYCstbW9k ZScgLS0gRHJhdyBtYXRjaGluZyBwYXJlbnRoZXNlcyBpbW1lZGlhdGVseS4iKSkKKyAgICAgICAg ICAoKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKQorICAgICAgICAgICAgOzs7IE1hdGNo aW5nIHBhcmVudGhlc2VzIHdpbGwgYmUgZHJhd24gaW1tZWRpYXRlbHkuCisgICAgICAgICAgICAo bWVzc2FnZSAiVHVybmVkIE9OIGArLW1vZGUnIC0tIE9wdGltaXplZCBmb3IgZGVidWdnaW5nIHB1 cnBvc2VzLiIpKQorICAgICAgICAgICh0CisgICAgICAgICAgICAobWVzc2FnZSAiVHVybmVkIE9O IGArLW1vZGUnLiIpKSkpKQorICAgICh0CisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnZmls bC1jb2x1bW4pCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnYXV0by1oc2Nyb2xsLW1vZGUp CisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAnaHNjcm9sbC1zdGVwKQorICAgICAgKGtpbGwt bG9jYWwtdmFyaWFibGUgJ2Nyb3NzaGFpcnMpCisgICAgICAoa2lsbC1sb2NhbC12YXJpYWJsZSAn ZmMtdmlzaWJsZSkKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdkaXNwbGF5LWxpbmUtbnVt YmVycykKKyAgICAgIChraWxsLWxvY2FsLXZhcmlhYmxlICdkaXNwb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kKKyAgIkRvYy1zdHJpbmcuIgorICAobGV0KiAoKG9wb2ludCAocG9pbnQpKQorICAgICAg ICAgKGZyb20gKGlmICstcGFyZW5zLWZyb20tZm4KKyAgICAgICAgICAgICAgICAgKGZ1bmNhbGwg Ky1wYXJlbnMtZnJvbS1mbikKKyAgICAgICAgICAgICAgICAgKHBvaW50LW1pbikpKQorICAgICAg ICAgKHdpbiAoc2VsZWN0ZWQtd2luZG93KSkKKyAgICAgICAgIChpIDApCisgICAgICAgICAocHJl Y2VkaW5nLWNoYXIgKHByZWNlZGluZy1jaGFyKSkKKyAgICAgICAgIChvY2hhciAoY2hhci1hZnRl ciBvcG9pbnQpKQorICAgICAgICAgKHBvczEKKyAgICAgICAgICAgKGNvbmQKKyAgICAgICAgICAg ICAoKGFuZCBvY2hhcgorICAgICAgICAgICAgICAgICAgIChvciA7OzsgKGNoYXItdG8tc3RyaW5n IDQwKSA9PiBvcGVuaW5nIHBhcmVudGhlc2lzCisgICAgICAgICAgICAgICAgICAgICAgICg9IG9j aGFyIDQwKQorICAgICAgICAgICAgICAgICAgICAgICA7OzsgKGNoYXItdG8tc3RyaW5nIDkxKSA9 PiBvcGVuaW5nIHNxdWFyZSBicmFja2V0CisgICAgICAgICAgICAgICAgICAgICAgICg9IG9jaGFy IDkxKQorICAgICAgICAgICAgICAgICAgICAgICA7OzsgKGNoYXItdG8tc3RyaW5nIDEyMykgPT4g b3BlbmluZyB3YXZ5IGJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgKD0gb2NoYXIgMTIz KSkpCisgICAgICAgICAgICAgICAgKG1pbiAoMSsgb3BvaW50KSAocG9pbnQtbWF4KSkpCisgICAg ICAgICAgICAgKChvciA7OzsgKGNoYXItdG8tc3RyaW5nIDQxKSA9PiBjbG9zaW5nIHBhcmVudGhl c2lzCisgICAgICAgICAgICAgICAgICAoPSBwcmVjZWRpbmctY2hhciA0MSkKKyAgICAgICAgICAg ICAgICAgIDs7OyAoY2hhci10by1zdHJpbmcgOTMpID0+IGNsb3Npbmcgc3F1YXJlIGJyYWNrZXQK KyAgICAgICAgICAgICAgICAgICg9IHByZWNlZGluZy1jaGFyIDkzKQorICAgICAgICAgICAgICAg ICAgOzs7IChjaGFyLXRvLXN0cmluZyAxMjUpID0+IGNsb3Npbmcgd2F2eSBicmFja2V0CisgICAg ICAgICAgICAgICAgICAoPSBwcmVjZWRpbmctY2hhciAxMjUpKQorICAgICAgICAgICAgICAgICht YXggKHBvaW50LW1pbikgKDEtIG9wb2ludCkpKQorICAgICAgICAgICAgICh0CisgICAgICAgICAg ICAgICAgb3BvaW50KSkpCisgICAgICAgICBwb3MyCisgICAgICAgICBzZWxlY3RlZC1mYWNlKQor ICAgIChzYXZlLWV4Y3Vyc2lvbgorICAgICAgKGNvbmRpdGlvbi1jYXNlIG5pbAorICAgICAgICAo d2hpbGUgKHNldHEgcG9zMSAobnRoIDEgKHBhcnNlLXBhcnRpYWwtc2V4cCBmcm9tIHBvczEpKSkK KyAgICAgICAgICAoc2V0cSBwb3MyIChzY2FuLXNleHBzIHBvczEgMSkpCisgICAgICAgICAgKGlm ICg9IGkgMTApCisgICAgICAgICAgICAoc2V0cSBpIDEpCisgICAgICAgICAgICAoc2V0cSBpICgx KyBpKSkpCisgICAgICAgICAgKHNldHEgc2VsZWN0ZWQtZmFjZSAoY29uZAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAoKD0gaSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICcrLXBhcmVucy1vbmUtZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgKCg9IGkgMikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMt dHdvLWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDMpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLXRocmVlLWZhY2UpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDQpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJystcGFyZW5zLWZvdXItZmFjZSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgKCg9IGkgNSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAn Ky1wYXJlbnMtZml2ZS1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0g aSA2KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVucy1zaXgtZmFj ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgNykKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtc2V2ZW4tZmFjZSkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgKCg9IGkgOCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAnKy1wYXJlbnMtZWlnaHQtZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgKCg9IGkgOSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJl bnMtbmluZS1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSAxMCkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtdGVuLWZhY2UpKSkK KyAgICAgICAgICAobGV0ICgob3YgKG1ha2Utb3ZlcmxheSBwb3MxICgxKyBwb3MxKSkpKQorICAg ICAgICAgICAgKHVubGVzcyArLXBhcmVucy1pbmFjdGl2ZS13aW5kb3dzCisgICAgICAgICAgICAg IChvdmVybGF5LXB1dCBvdiAnd2luZG93IHdpbikpCisgICAgICAgICAgICAob3ZlcmxheS1wdXQg b3YgJ2ZhY2Ugc2VsZWN0ZWQtZmFjZSkpCisgICAgICAgICAgKHdoZW4gcG9zMgorICAgICAgICAg ICAgKGxldCAoKG92IChtYWtlLW92ZXJsYXkgKDEtIHBvczIpIHBvczIpKSkKKyAgICAgICAgICAg ICAgKHVubGVzcyArLXBhcmVucy1pbmFjdGl2ZS13aW5kb3dzCisgICAgICAgICAgICAgICAgKG92 ZXJsYXktcHV0IG92ICd3aW5kb3cgd2luKSkKKyAgICAgICAgICAgICAgKG92ZXJsYXktcHV0IG92 ICdmYWNlIHNlbGVjdGVkLWZhY2UpKSkpCisgICAgICAgIChlcnJvciBuaWwpKSkKKyAgICAoc2V0 cSArLXBhcmVucy1vdmVybGF5cy1leGlzdC1wIHQpKSkKKworKGRlZnVuICstcmVtb3ZlLW92ZXJs YXlzIChiZWcgZW5kIG5hbWUgdmFsKQorIlJlbW92ZSB0aGUgb3ZlcmxheXMgdGhhdCBhcmUgYGVx dWFsLWluY2x1ZGluZy1wcm9wZXJ0aWVzYC4KK0luY2x1ZGVzIGEgdW5pcXVlIHNpdHVhdGlvbiB3 aGVuIGFuIG92ZXJsYXkgd2l0aCBhbiBgJ2FmdGVyLXN0cmluZ2AgcHJvcGVydHkKK2lzIGF0IHRo ZSB2ZXJ5IGVuZCBvZiBhIG5hcnJvd2VkLWJ1ZmZlci4iCisgIChsZXQqICgocG9pbnQtbWF4IChw b2ludC1tYXgpKQorICAgICAgICAgKHBvaW50LW1pbiAocG9pbnQtbWluKSkKKyAgICAgICAgIChu YXJyb3dlZC1wIChidWZmZXItbmFycm93ZWQtcCkpCisgICAgICAgICAoYmVnIChpZiBiZWcgYmVn IHBvaW50LW1pbikpCisgICAgICAgICAoZW5kCisgICAgICAgICAgIChjb25kCisgICAgICAgICAg ICAgKChhbmQKKyAgICAgICAgICAgICAgICAgKG5vdCBuYXJyb3dlZC1wKQorICAgICAgICAgICAg ICAgICBlbmQpCisgICAgICAgICAgICAgICBlbmQpCisgICAgICAgICAgICAgKChhbmQKKyAgICAg ICAgICAgICAgICAgKG5vdCBuYXJyb3dlZC1wKQorICAgICAgICAgICAgICAgICAobnVsbCBlbmQp KQorICAgICAgICAgICAgICAgcG9pbnQtbWF4KQorICAgICAgICAgICAgICgoYW5kCisgICAgICAg ICAgICAgICAgIG5hcnJvd2VkLXAKKyAgICAgICAgICAgICAgICAgZW5kCisgICAgICAgICAgICAg ICAgICg8IGVuZCBwb2ludC1tYXgpKQorICAgICAgICAgICAgICAgZW5kKQorICAgICAgICAgICAg ICgoYW5kCisgICAgICAgICAgICAgICAgIG5hcnJvd2VkLXAKKyAgICAgICAgICAgICAgICAgZW5k CisgICAgICAgICAgICAgICAgICg9IGVuZCBwb2ludC1tYXgpKQorICAgICAgICAgICAgICAgKDEr IGVuZCkpCisgICAgICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFycm93ZWQtcAor ICAgICAgICAgICAgICAgICAobnVsbCBlbmQpKQorICAgICAgICAgICAgICAgKDErIHBvaW50LW1h eCkpICkpCisgICAgICAgICAob3ZlcmxheXMKKyAgICAgICAgICAgKHByb2duCisgICAgICAgICAg ICAgKG92ZXJsYXktcmVjZW50ZXIgZW5kKQorICAgICAgICAgICAgIChvdmVybGF5cy1pbiBiZWcg ZW5kKSkpKQorICAgICh3aGVuIChhbmQgYmVnIGVuZCBuYW1lIHZhbCkKKyAgICAgIChkb2xpc3Qg KG8gb3ZlcmxheXMpCisgICAgICAgIChjb25kCisgICAgICAgICAgKChhbmQgKGVxIG5hbWUgJ2Zh Y2UpCisgICAgICAgICAgICAgICAgKGVxIChvdmVybGF5LWdldCBvIG5hbWUpIHZhbCkpCisgICAg ICAgICAgICA7OyBFaXRoZXIgcHVzaCB0aGlzIG92ZXJsYXkgb3V0c2lkZSBiZWcuLi5lbmQKKyAg ICAgICAgICAgIDs7IG9yIHNwbGl0IGl0IHRvIGV4Y2x1ZGUgYmVnLi4uZW5kCisgICAgICAgICAg ICA7OyBvciBkZWxldGUgaXQgZW50aXJlbHkgKGlmIGl0IGlzIGNvbnRhaW5lZCBpbiBiZWcuLi5l bmQpLgorICAgICAgICAgICAgKGlmICg8IChvdmVybGF5LXN0YXJ0IG8pIGJlZykKKyAgICAgICAg ICAgICAgICAoaWYgKD4gKG92ZXJsYXktZW5kIG8pIGVuZCkKKyAgICAgICAgICAgICAgKHByb2du CisgICAgICAgICAgICAgICAgKG1vdmUtb3ZlcmxheSAoY29weS1vdmVybGF5IG8pCisgICAgICAg ICAgICAgICAgICAob3ZlcmxheS1zdGFydCBvKSBiZWcpCisgICAgICAgICAgICAgICAgKG1vdmUt b3ZlcmxheSBvIGVuZCAob3ZlcmxheS1lbmQgbykpKQorICAgICAgICAgICAgICAgICAgKG1vdmUt b3ZlcmxheSBvIChvdmVybGF5LXN0YXJ0IG8pIGJlZykpCisgICAgICAgICAgICAgIChpZiAoPiAo b3ZlcmxheS1lbmQgbykgZW5kKQorICAgICAgICAgICAgICAgICAgKG1vdmUtb3ZlcmxheSBvIGVu ZCAob3ZlcmxheS1lbmQgbykpCisgICAgICAgICAgICAgICAgKGRlbGV0ZS1vdmVybGF5IG8pKSkp CisgICAgICAgICAgKChhbmQgKG5vdCAoZXEgbmFtZSAnZmFjZSkpCisgICAgICAgICAgICAgICAg KGVxdWFsLWluY2x1ZGluZy1wcm9wZXJ0aWVzIChvdmVybGF5LWdldCBvIG5hbWUpIHZhbCkpCisg ICAgICAgICAgICAoZGVsZXRlLW92ZXJsYXkgbykpKSkpKSkKKworKGRlZnVuICstZGVsZXRlLXBh cmVucy1vdmVybGF5cyAoKQorICAod2hlbiArLXBhcmVucy1vdmVybGF5cy1leGlzdC1wCisgICAg KGRvbGlzdCAoZmFjZSAnKCstcGFyZW5zLW9uZS1mYWNlCisgICAgICAgICAgICAgICAgICAgICst cGFyZW5zLXR3by1mYWNlCisgICAgICAgICAgICAgICAgICAgICstcGFyZW5zLXRocmVlLWZhY2UK KyAgICAgICAgICAgICAgICAgICAgKy1wYXJlbnMtZm91ci1mYWNlCisgICAgICAgICAgICAgICAg ICAgICstcGFyZW5zLWZpdmUtZmFjZQorICAgICAgICAgICAgICAgICAgICArLXB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AiIEZDIgorICA6 a2V5bWFwIG5pbAorICA6Z2xvYmFsIG5pbAorICA6Z3JvdXAgJ2ZjLW1vZGUKKyAgKGNvbmQKKyAg ICA7OzsgYCstbW9kZScgaGFzIHRoZSBhYmlsaXR5IHRvIGFsc28gZGlzcGxheSBhIGZpbGwgY29s dW1uIGluZGljYXRvci4KKyAgICA7OzsgU2VlIHRoZSB2YXJpYWJsZSBgKy1maWxsLWNvbHVtbicu CisgICAgKChhbmQgZmMtbW9kZSArLW1vZGUpCisgICAgICAoc2V0cSBmYy1tb2RlIG5pbCkKKyAg ICAgIChtZXNzYWdlICJUdXJuZWQgT0ZGIGBmYy1tb2RlJyAoJXMpIC0tIHNlZSB0aGUgdmFyaWFi bGUgYCstZmlsbC1jb2x1bW4nLiIgKGN1cnJlbnQtYnVmZmVyKSkpCisgICAgKGZjLW1vZGUKKyAg ICAgICh3aGVuIChhbmQgZ2xvYmFsLWVsZG9jLW1vZGUKKyAgICAgICAgICAgICAgICAgKGNhbGxl ZC1pbnRlcmFjdGl2ZWx5LXAgJ2FueSkKKyAgICAgICAgICAgICAgICAgKGVxdWFsIGN1cnJlbnQt cHJlZml4LWFyZyAnKDQpKSkKKyAgICAgICAgKGdsb2JhbC1lbGRvYy1tb2RlIC0xKSkKKyAgICAg ICh3aGVuIChhbmQgaml0LWxvY2stY29udGV4dC10aW1lcgorICAgICAgICAgICAgICAgICAoY2Fs bGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVu dC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAod2hlbiAodGltZXJwIGppdC1sb2NrLWNvbnRl eHQtdGltZXIpCisgICAgICAgICAgKGNhbmNlbC10aW1lciBqaXQtbG9jay1jb250ZXh0LXRpbWVy KSkKKyAgICAgICAgOzsgKHNldHEgaml0LWxvY2stY29udGV4dC10aW1lciAocnVuLXdpdGgtaWRs ZS10aW1lciA1LjAgJ3JlcGVhdCAnaml0LWxvY2stY29udGV4dC1mb250aWZ5KSkKKyAgICAgICAg KHNldHEgaml0LWxvY2stY29udGV4dC10aW1lciBuaWwpKQorICAgICAgKHdoZW4gKGFuZCAoY2Fs bGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAgICAgICAgICAoZXF1YWwgY3VycmVu dC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAod2hlbiAodGltZXJwIHVuZG8tYXV0by1jdXJy ZW50LWJvdW5kYXJ5LXRpbWVyKQorICAgICAgICAgIChjYW5jZWwtdGltZXIgdW5kby1hdXRvLWN1 cnJlbnQtYm91bmRhcnktdGltZXIpKQorICAgICAgICAoZnNldCAndW5kby1hdXRvLS11bmRvYWJs ZS1jaGFuZ2UKKyAgICAgICAgICAgICAgKGxhbWJkYSAoKSAoYWRkLXRvLWxpc3QgJ3VuZG8tYXV0 by0tdW5kb2FibHktY2hhbmdlZC1idWZmZXJzIChjdXJyZW50LWJ1ZmZlcikpKSkKKyAgICAgICAg KGZzZXQgJ3VuZG8tYXV0by1hbWFsZ2FtYXRlICdpZ25vcmUpKQorICAgICAgKHdoZW4gYmxpbmst Y3Vyc29yLW1vZGUKKyAgICAgICAgKGJsaW5rLWN1cnNvci1tb2RlIC0xKQorICAgICAgICAod2hl biAobWVtcSAnYmxpbmstY3Vyc29yLWNoZWNrIHBvc3QtY29tbWFuZC1ob29rKQorICAgICAgICAg IChyZW1vdmUtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJ2JsaW5rLWN1cnNvci1jaGVjaykpKQor ICAgICAgKHNldHEgZmMtdmlzaWJsZSB0KQorICAgICAgOzs7IGBhdXRvLWNvbXBvc2l0aW9uLW1v ZGUnIGlzIG5lZWRlZCBmb3IgY3Jvc3NoYWlycyB0byBwcm9wZXJseSBjYWxjdWxhdGUKKyAgICAg IDs7OyBjb29yZGluYXRlcyBvZiBjb21wb3NpdGlvbiBjaGFyYWN0ZXJzLiAgQXV0b21hdGljYWxs eSBiZWNvbWVzIHB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CisKKyhkZWZmYWNlICstcmV2ZXJzZWQtYmFyLWF0LXp2LWZhY2UKKyAg JygodCAoOmZvcmVncm91bmQgImNoYXJ0cmV1c2UiKSkpCisgICJGYWNlIGZvciBgKy1yZXZlcnNl ZC1iYXItYXQtenYtZmFjZScuIgorICA6Z3JvdXAgJystbW9kZSkKKworKGRlZmZhY2UgKy1yZXZl cnNlZC1iYXItcG9zdC16di1mYWNlCisgICcoKHQgKDpmb3JlZ3JvdW5kICJjeWFuNCIpKSkKKyAg IkZhY2UgZm9yIGArLXJldmVyc2VkLWJhci1wb3N0LXp2LWZhY2UnLiIKKyAgOmdyb3VwICcrLW1v ZGUpCisKKyhkZWZmYWNlICstZXZlbi1wcmUtenYtZmFjZQorICAnKCgoKGNsYXNzIGNvbG9yKSAo bWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJ5ZWxs b3ciKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgbGln aHQpKQorICAgICA6Zm9yZWdyb3VuZCAiY3lhbjEiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWlu LWNvbG9ycyAxNikgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJ5ZWxsb3ci KQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQp KQorICAgICA6Zm9yZWdyb3VuZCAiY3lhbjEiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNv bG9ycyA4KSkKKyAgICAgOmZvcmVncm91bmQgIndoaXRlIikKKyAgICAoKCh0eXBlIHR0eSkgKGNs YXNzIG1vbm8pKQorICAgICA6aW52ZXJzZS12aWRlbyB0KQorICAgICh0IDpmb3JlZ3JvdW5kICJw aW5rIikpCisgICJGYWNlIGZvciBgKy1ldmVuLXByZS16di1mYWNlJy4iCisgIDpncm91cC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ZWdyb3VuZCAiZ3JlZW4xIikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgODgpIChi YWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgImdyZWVuMSIpCisgICAgKCgoY2xh c3MgY29sb3IpIChtaW4tY29sb3JzIDE2KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVn cm91bmQgImdyZWVuMSIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDE2KSAoYmFj a2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJncmVlbjEiKQorICAgICgoKGNsYXNz IGNvbG9yKSAobWluLWNvbG9ycyA4KSkKKyAgICAgOmZvcmVncm91bmQgIndoaXRlIikKKyAgICAo KCh0eXBlIHR0eSkgKGNsYXNzIG1vbm8pKQorICAgICA6aW52ZXJzZS12aWRlbyB0KQorICAgICh0 IDpmb3JlZ3JvdW5kICJwaW5rIikpCisgICJGYWNlIGZvciBgKy1wb3N0LWZpbGwtcHJlLXp2LWZh Y2UnLiIKKyAgOmdyb3VwICcrLW1vZGUpCisKKyhkZWZmYWNlICstcG9zdC1maWxsLWluYWN0aXZl LXByZS16di1mYWNlCisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dy b3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgImdyZWVuNCIpCisgICAgKCgoY2xhc3MgY29s b3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5k ICJncmVlbjQiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91 bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJncmVlbjQiKQorICAgICgoKGNsYXNzIGNvbG9y KSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3VuZCAi Z3JlZW40IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgOCkpCisgICAgIDpmb3Jl Z3JvdW5kICJ3aGl0ZSIpCisgICAgKCgodHlwZSB0dHkpIChjbGFzcyBtb25vKSkKKyAgICAgOmlu dmVyc2UtdmlkZW8gdCkKKyAgICAodCA6Zm9yZWdyb3VuZCAicGluayIpKQorICAiRmFjZSBmb3Ig YCstcG9zdC1maWxsLWluYWN0aXZlLXByZS16di1mYWNlJy4iCisgIDpncm91cCAnKy1tb2RlKQor CisoZGVmZmFjZSArLXBvc3QtZmlsbC1hdC16di1mYWNlCisgICcoKCgoY2xhc3MgY29sb3IpICht aW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgInB1cnBs ZTMiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgbGln aHQpKQorICAgICA6Zm9yZWdyb3VuZCAicmVkMSIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4t Y29sb3JzIDE2KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgInB1cnBsZTMi KQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQp KQorICAgICA6Zm9yZWdyb3VuZCAicmVkMSIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29s b3JzIDgpKQorICAgICA6Zm9yZWdyb3VuZCAid2hpdGUiKQorICAgICgoKHR5cGUgdHR5KSAoY2xh c3MgbW9ubykpCisgICAgIDppbnZlcnNlLXZpZGVvIHQpCisgICAgKHQgOmZvcmVncm91bmQgInBp bmsiKSkKKyAgIkZhY2UgZm9yIGArLXBvc3QtZmlsbC1hdC16di1mYWNlJy4iCisgIDpncm91cCAn Ky1tb2RlKQorCisoZGVmZmFjZSArLXBvc3QtZmlsbC1pbmFjdGl2ZS1hdC16di1mYWNlCisgICco KCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAg OmZvcmVncm91bmQgInB1cnBsZTQiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4 OCkgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3VuZCAicmVkNCIpCisgICAgKCgo Y2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDE2KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZv cmVncm91bmQgInB1cnBsZTQiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikg KGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3VuZCAicmVkNCIpCisgICAgKCgoY2xh c3MgY29sb3IpIChtaW4tY29sb3JzIDgpKQorICAgICA6Zm9yZWdyb3VuZCAid2hpdGUiKQorICAg ICgoKHR5cGUgdHR5KSAoY2xhc3MgbW9ubykpCisgICAgIDppbnZlcnNlLXZpZGVvIHQpCisgICAg KHQgOmZvcmVncm91bmQgInBpbmsiKSkKKyAgIkZhY2UgZm9yIGArLXBvc3QtZmlsbC1pbmFjdGl2 ZS1hdC16di1mYWNlJy4iCisgIDpncm91cCAnKy1tb2RlKQorCisoZGVmZmFjZSArLXBvc3QtZmls bC1wb3N0LXp2LWZhY2UKKyAgJygoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgODgpIChiYWNr Z3JvdW5kIGRhcmspKQorICAgICA6Zm9yZWdyb3VuZCAiUGFsZUdyZWVuMyIpCisgICAgKCgoY2xh c3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3Jl Z3JvdW5kICJQYWxlR3JlZW4zIikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgMTYp IChiYW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HlwZSB0dHkpIChjbGFzcyBtb25vKSkK KyAgICAgOmludmVyc2UtdmlkZW8gdCkKKyAgICAodCA6Zm9yZWdyb3VuZCAicGluayIpKQorICAi RmFjZSBmb3IgYCstcG9zdC1maWxsLWluYWN0aXZlLXBvc3QtenYtZmFjZScuIgorICA6Z3JvdXAg JystbW9kZSkKKworKGRlZmZhY2UgZmMtcHJlLXp2LWZhY2UKKyAgJygoKChjbGFzcyBjb2xvcikg KG1pbi1jb2xvcnMgODgpIChiYWNrZ3JvdW5kIGRhcmspKQorICAgICA6Zm9yZWdyb3VuZCAiZ3Jl eTE1IikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgODgpIChiYWNrZ3JvdW5kIGxp Z2h0KSkKKyAgICAgOmZvcmVncm91bmQgImdyZXkxNSIpCisgICAgKCgoY2xhc3MgY29sb3IpICht aW4tY29sb3JzIDE2KSAoYmFja2dyb3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgImdyZXkx NSIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDE2KSAoYmFja2dyb3VuZCBsaWdo dCkpCisgICAgIDpmb3JlZ3JvdW5kICJncmV5MTUiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWlu LWNvbG9ycyA4KSkKKyAgICAgOmZvcmVncm91bmQgIndoaXRlIikKKyAgICAoKCh0eXBlIHR0eSkg KGNsYXNzIG1vbm8pKQorICAgICA6aW52ZXJzZS12aWRlbyB0KQorICAgICh0IDpmb3JlZ3JvdW5k ICJwaW5rIikpCisgICJGYWNlIGZvciBgZmMtcHJlLXp2LWZhY2UnIGluIHRoZSBhY3RpdmUgd2lu ZG93LiIKKyAgOmdyb3VwICcrLW1vZGUpCisKKyhkZWZmYWNlIGZjLWluYWN0aXZlLXByZS16di1m YWNlCisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBkYXJr KSkKKyAgICAgOmZvc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ioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKworCiAgIFhTRVRGQVNUSU5UIChCVkFSICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBt b2RlX2xpbmVfZm9ybWF0KSwgaWR4KTsgKytpZHg7CiAgIFhTRVRGQVNUSU5UIChCVkFSICgmYnVm ZmVyX2xvY2FsX2ZsYWdzLCBhYmJyZXZfbW9kZSksIGlkeCk7ICsraWR4OwogICBYU0VURkFTVElO VCAoQlZBUiAoJmJ1ZmZlcl9sb2NhbF9mbGFncywgb3ZlcndyaXRlX21vZGUpLCBpZHgpOyArK2lk eDsKQEAgLTUyMzEsNiArNTMxMiwyNCBAQCBpbml0X2J1ZmZlcl9vbmNlICh2b2lkKQogICAvKiBN dXN0IGRvIHRoZXNlIGJlZm9yZSBtYWtpbmcgdGhlIGZpcnN0IGJ1ZmZlciEgKi8KIAogICAvKiBy ZWFsIHNldHVwIGlzIGRvbmUgaW4gYmluZGluZ3MuZWwgKi8KKworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBic2V0X21jX3JlYWxfZmFrZV9j dXJzb3IgKCZidWZmZXJfZGVmYXVsdHMsIFFob2xsb3cpOworICBic2V0X21jX2NvbmYgKCZidWZm ZXJfZGVmYXVsdHMsIFFuaWwpOworICBic2V0X21jX2luYWN0aXZlX3dpbmRvd3MgKCZidWZmZXJf ZGVmYXVsdHMsIFF0KTsKKyAgYnNldF9jcm9zc2hhaXJzICgmYnVmZmVyX2RlZmF1bHRzLCBRbmls KTsKKyAgYnNldF9jaF9ob3Jpem9udGFsX3J1bGVyICgmYnVmZmVyX2RlZmF1bHRzLCBRdCk7Cisg IGJzZXRfY2hfdmVydGljYWxfcnVsZXIgKCZidWZmZXJfZGVmYXVsdHMsIFF0KTsKKyAgYnNldF9j aF9pbmFjdGl2ZV93aW5kb3dzICgmYnVmZmVyX2RlZmF1bHRzLCBRdCk7CisgIGJzZXRfZmNfdmlz aWJsZSAoJmJ1ZmZlcl9kZWZhdWx0cywgUW5pbCk7CisgIGJzZXRfZmNfaW5hY3RpdmVfd2luZG93 cyAoJmJ1ZmZlcl9kZWZhdWx0cywgUXQpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAgIGJzZXRfbW9kZV9saW5lX2Zvcm1hdCAoJmJ1ZmZlcl9kZWZhdWx0cywgYnVpbGRfcHVyZV9j X3N0cmluZyAoIiUtIikpOwogICBic2V0X2hlYWRlcl9saW5lX2Zvcm1hdCAoJmJ1ZmZlcl9kZWZh dWx0cywgUW5pbCk7CiAgIGJzZXRfYWJicmV2X21vZGUgKCZidWZmZXJfZGVmYXVsdHMsIFFuaWwp OwpAQCAtNTQ2MSw2ICs1NTYwLDUxIEBAIGRlZnZhcl9wZXJfYnVmZmVyIChzdHJ1Y3QgTGlzcF9C dWZmZXJfT2JqZndkICpib19md2QsIGNvbnN0IGNoYXIgKm5hbWVzdHJpbmcsCiB2b2lkCiBzeW1z X29mX2J1ZmZlciAodm9pZCkKIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1V TFRJUExFLUNVUlNPUlMgKi8KKworICBERUZTWU0gKFFtY19yZWFsX2Zha2VfY3Vyc29yLCAibWMt cmVhbC1mYWtlLWN1cnNvciIpOworICBERUZWQVJfUEVSX0JVRkZFUiAoIm1jLXJlYWwtZmFrZS1j dXJzb3IiLCAmQlZBUiAoY3VycmVudF9idWZmZXIsIG1jX3JlYWxfZmFrZV9jdXJzb3IpLCBRbmls LAorICAgIGRvYzogLyogQS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l2ZV93aW5kb3dzXzsKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogICAvKiBDdXJzb3IgdHlwZSB0byBkaXNwbGF5IGluIG5vbi1z ZWxlY3RlZCB3aW5kb3dzLgogICAgICB0IG1lYW5zIHRvIHVzZSBob2xsb3cgYm94IGN1cnNvci4K ICAgICAgU2VlIGBjdXJzb3ItdHlwZScgZm9yIG90aGVyIHZhbHVlcy4gICovCkBAIC03OTEsMTQg KzgyNSwyMSBAQCBzdHJ1Y3QgYnVmZmVyCiAgICAgIGFuIGluZGlyZWN0IGJ1ZmZlciBzaW5jZSBp dCBjb3VudHMgYXMgaXRzIGJhc2UgYnVmZmVyLiAgKi8KICAgaW50IHdpbmRvd19jb3VudDsKIAor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogICAv KiBBIG5vbi16ZXJvIHZhbHVlIGluIHNsb3QgSURYIG1lYW5zIHRoYXQgcGVyLWJ1ZmZlciB2YXJp YWJsZQogICAgICB3aXRoIGluZGV4IElEWCBoYXMgYSBsb2NhbCB2YWx1ZSBpbiB0aGlzIGJ1ZmZl ci4gIFRoZSBpbmRleCBJRFgKICAgICAgZm9yIGEgYnVmZmVyLWxvY2FsIHZhcmlhYmxlIGlzIHN0 b3JlZCBpbiB0aGF0IHZhcmlhYmxlJ3Mgc2xvdAogICAgICBpbiBidWZmZXJfbG9jYWxfZmxhZ3Mg YXMgYSBMaXNwIGludGVnZXIuICBJZiB0aGUgaW5kZXggaXMgLTEsCiAgICAgIHRoaXMgbWVhbnMg dGhlIHZhcmlhYmxlIGlzIGFsd2F5cyBsb2NhbCBpbiBhbGwgYnVmZmVycy4gICovCi0jZGVmaW5l IE1BWF9QRVJfQlVGRkVSX1ZBUlMgNTAKKyNkZWZpbmUgTUFYX1BFUl9CVUZGRVJfVkFSUyA2MAog ICBjaGFyIGxvY2FsX2ZsYWdzW01BWF9QRVJfQlVGRkVSX1ZBUlNdOwogCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKworCiAgIC8qIFNldCB0byB0aGUgbW9kdGltZSBvZiB0aGUgdmlzaXRlZCBm aWxlIHdoZW4gcmVhZCBvciB3cml0dGVuLgogICAgICBtb2R0aW1lLnR2X25zZWMgPT0gTk9ORVhJ U1RFTlRfTU9EVElNRV9OU0VDUyBtZWFucwogICAgICB2aXNpdGVkIGZpbGUgd2FzIG5vbmV4aXN0 ZW50LiAgbW9kdGltZS50dl9uc2VjID09CkBAIC05MDcsNiArOTQ4LDY5IEBAIFhCVUZGRVIgKExp c3BfT2JqZWN0IGEpCiAvKiBNb3N0IGNvZGUgc2hvdWxkIHVzZSB0aGVzZSBmdW5jdGlvbnMgdG8g c2V0IExpc3AgZmllbGRzIGluIHN0cnVjdAogICAgYnVmZmVyLiAgKFNvbWUgc2V0dGVycyB0aGF0 IGFyZSBwcml2YXRlIHRvIGEgc2luZ2xlIC5jIGZpbGUgYXJlCiAgICBkZWZpbmVkIGFzIHN0YXRp YyBpbiB0aG9zZSBmaWxlcy4pICAqLworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyog YmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCitJTkxJTkUgdm9pZAorYnNldF9ibHZfbWNfcmVh bF9mYWtlX2N1cnNvciAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFsKQoreworICBi LT5tY19yZWFsX2Zha2VfY3Vyc29yXyA9IHZhbDsKK30KKworSU5MSU5FIHZvaWQKK2JzZXRfYmx2 X21j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KmIsIExpc3BfT2JqZWN0IHZhbCkKK3sKKyAgYi0+ZmNfaW5h Y3RpdmVfd2luZG93c18gPSB2YWw7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiBJTkxJTkUgdm9pZAogYnNldF9iaWRpX3BhcmFn cmFwaF9kaXJlY3Rpb24gKHN0cnVjdCBidWZmZXIgKmIsIExpc3BfT2JqZWN0IHZhbCkKIHsKZGlm ZiAtLWdpdCBhL3NyYy9kaXNwZXh0ZXJuLmggYi9zcmMvZGlzcGV4dGVybi5oCmluZGV4IDRlOTQ3 ZGEuLjhkYjViMGIgMTAwNjQ0Ci0tLSBhL3NyYy9kaXNwZXh0ZXJuLmgKKysrIGIvc3JjL2Rpc3Bl eHRlcm4uaApAQCAtMTQ1LDYgKzE0NSwxMzEgQEAgdHlwZWRlZiB2b2lkICpFbWFjc19DdXJzb3I7 CiAjZGVmaW5lIE5hdGl2ZVJlY3RhbmdsZSBpbnQKICNlbmRpZgogCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCitleHRlcm4gYm9vbCBt Y19zdGRlcnJfcCBFWFRFUk5BTExZX1ZJU0lCTEU7CisKK3N0cnVjdCBnbHlwaDsKKworc3RydWN0 IGdseXBoX3JvdzsKKworc3RydWN0IGdseXBoX21hdHJpeDsKKworZW51bSBkcmF3X2dseXBoc19m YWNlOworCitlbnVtIGdseXBoX3Jvd19hcmVhOworCitzdHJ1Y3QgbWNfbWF0cml4OworCitlbnVt IG1jX2NhY2hlX3R5cGU7CisKK2VudW0gbWNfY3Vyc29yX3R5cGU7CisKK2VudW0gbWNfZmxhdm9y OworCitzdHJ1Y3QgbWNfUkdCOworCitzdHJ1Y3QgbWNfZXNzZW50aWFsczsKKworZW51bSBtY19k cmF3X3Jvd190eXBlOworCitlbnVtIG1jX2VuZ2luZV90eXBlOworCitlbnVtIG1jX3Jvd19wb3Np dGlvbjsKKworZW51bSBtY19yZWRyYXdfcm93X3R5cGU7CisKK2VudW0gZHJhd19nbHlwaF9hY3Rp b247CisKK2V4dGVybiBMaXNwX09iamVjdCBtY19saXN0biAocHRyZGlmZl90LCBMaXNwX09iamVj dCwgLi4uKTsKKworZXh0ZXJuIExpc3BfT2JqZWN0IG1jX250aCAoaW50LCBMaXNwX09iamVjdCk7 CisKK2V4dGVybiBMaXNwX09iamVjdCBtY19hc3NxIChMaXNwX09iamVjdCwgTGlzcF9PYmplY3Qp OworCitleHRlcm4gZW51bSBtY19yb3dfcG9zaXRpb24gbWNfcm93X3Bvc2l0aW9uIChzdHJ1Y3Qg d2luZG93ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKiwgaW50KTsKKworZXh0ZXJuIHB0 cmRpZmZfdCBtY19yZWdpb25fbGltaXQgKGJvb2wpOworCitleHRlcm4gc3RydWN0IGdseXBoICog bWNfZ2V0X2N1cnNvcl9nbHlwaCAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4 ICosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGds eXBoX3JvdyAqLCBpbnQsIGludCk7CisKK2V4dGVybiB2b2lkIG1jX3h3X2NvbG9yX3ZhbHVlcyAo c3RydWN0IHdpbmRvdyAqLCBMaXNwX09iamVjdCwgc3RydWN0IG1jX1JHQiAqKTsKKworZXh0ZXJu IGJvb2wgbWNfdXBkYXRlX3dpbmRvd19mcmluZ2VzIChzdHJ1Y3Qgd2luZG93ICosIGJvb2wpOwor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zdHJ1Y3QgZ2x5cGggKiwgaW50LCBpbnQsIGludCwg aW50LCBpbnQsIGludCwKKyAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlw ZSwgaW50LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosCisgICAgICAgICAgICAgICAgICAgICAgIHN0 cnVjdCBtY19lc3NlbnRpYWxzLCBlbnVtIG1jX3Jvd19wb3NpdGlvbiwgc3RydWN0IG1jX1JHQiwK KyAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19lbmdpbmVfdHlwZSwgYm9vbCwgZW51bSBt Y19kcmF3X3Jvd190eXBlLAorICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2NhY2hlX3R5 cGUpOworCitleHRlcm4gdm9pZCBtY19zZXRfZXNzZW50aWFscyAoc3RydWN0IHdpbmRvdyAqLCBz dHJ1Y3QgbWNfZXNzZW50aWFscyAqKTsKKworZXh0ZXJuIHZvaWQgbWNfZHJhd19yb3cgKHN0cnVj dCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisg ICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoICosIGludCwgaW50LCBpbnQsIHN0 cnVjdCBnbHlwaF9tYXRyaXggKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNf ZXNzZW50aWFscywgZW51bSBtY19yb3dfcG9zaXRpb24sIGJvb2wsCisgICAgICAgICAgICAgICAg ICAgICAgICAgZW51bSBtY19kcmF3X3Jvd190eXBlKTsKKworZXh0ZXJuIGJvb2wgbWNfcmVkcmF3 X3JvdyAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlw aF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gZ2x5cGhfcm93X2FyZWEs IGludCwgaW50LCBpbnQsIGJvb2wsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIGRy YXdfZ2x5cGhzX2ZhY2UsIGVudW0gbWNfcmVkcmF3X3Jvd190eXBlKTsKKworZXh0ZXJuIHZvaWQg bWNfcmVzZXRfY2FjaGUgKHN0cnVjdCB3aW5kb3cgKik7CisKK2V4dGVybiB2b2lkIG1jX2RyYXdf Y3Vyc29yX2dseXBoIChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICosIGVudW0g ZHJhd19nbHlwaHNfZmFjZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQs IGludCwgaW50LCBzdHJ1Y3QgbWNfUkdCLCBlbnVtIG1jX2ZsYXZvciwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlLCBpbnQsIGJvb2wsIGJvb2wp OworCitleHRlcm4gdm9pZCBtY19lcmFzZV9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0 IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHN0cnVjdCBtY19tYXRyaXgsIGludCwgaW50LCBpbnQsIGludCwgZW51bSBtY19m bGF2b3IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUs IGludCk7CisKK2V4dGVybiB2b2lkIG1jX2RyYXdfZXJhc2VfaHlicmlkIChzdHJ1Y3Qgd2luZG93 ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGludCwgaW50LCBpbnQsIGludCwgaW50LCBpbnQsIGlu dCwgaW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29y X3R5cGUsIGludCwgc3RydWN0IG1jX1JHQiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBib29sLCBlbnVtIG1jX2ZsYXZvciwgYm9vbCk7CisKK2V4dGVybiBpbnQgbWNfZHJhd19n bHlwaHMgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5 cGhfcm93ICosCisgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfbWF0cml4LCBp bnQsIGVudW0gZ2x5cGhfcm93X2FyZWEsIHB0cmRpZmZfdCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgIHB0cmRpZmZfdCwgZW51bSBkcmF3X2dseXBoc19mYWNlLCBpbnQsIGludCwgc3RydWN0 IG1jX1JHQiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfZmxhdm9yLCBlbnVt IG1jX2N1cnNvcl90eXBlLCBpbnQsIGJvb2wsIGJvb2wsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICBlbnVtIGRyYXdfZ2x5cGhfYWN0aW9uLCBib29sKTsKKworZXh0ZXJuIHN0cnVjdCBnbHlw aF9tYXRyaXggKiBtY19zYXZlX2dseXBoX21hdHJpeCAoc3RydWN0IGdseXBoX21hdHJpeCAqKTsK KworZXh0ZXJuIHZvaWQgbWNfcmVzdG9yZV9nbHlwaF9tYXRyaXggKHN0cnVjdCBnbHlwaF9tYXRy aXggKiwgc3RydWN0IGdseXBoX21hdHJpeCAqKTsKKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMg Ki8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC8qIFRleHQgY3Vyc29yIHR5cGVzLiAg Ki8KIAogZW51bSB0ZXh0X2N1cnNvcl9raW5kcwpAQCAtNDA0LDYgKzUyOSwxOCBAQCBzdHJ1Y3Qg Z2x5cGhfc2xpY2UKIAogc3RydWN0IGdseXBoCiB7CisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgaW50IHJlbGF0aXZlX3gsIGhwb3M7CisK KyAgcHRyZGlmZl90IGJ5dGVwb3M7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAg LyogUG9zaXRpb24gZnJvbSB3aGljaCB0aGlzIGdseXBoIHdhcyBkcmF3bi4gIElmIGBvYmplY3Qn IGJlbG93IGlzIGEKICAgICAgTGlzcCBzdHJpbmcsIHRoaXMgaXMgYW4gaW5kZXggaW50byB0aGF0 IHN0cmluZy4gIElmIGl0IGlzIGEKICAgICAgYnVmZmVyLCB0aGlzIGlzIGEgcG9zaXRpb24gaW4g dGhhdCBidWZmZXIuICBJbiBhZGRpdGlvbiwgc29tZQpAQCAtMTI3MCw2ICsxNDA3LDI4IEBAIGVu dW0gZHJhd19nbHlwaHNfZmFjZQogCiBzdHJ1Y3QgZ2x5cGhfc3RyaW5nCiB7CisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICBib29sX2Jm IGxlZnRfb3ZlcndyaXR0ZW5fcCA6IDE7CisKKyAgICBib29sX2JmIHJpZ2h0X292ZXJ3cml0dGVu X3AgOiAxOworCisgICAgYm9vbF9iZiByZWN0YW5nbGVfbnVrZWRfcCA6IDE7CisKKyAgICBib29s X2JmIGJhY2tncm91bmRfbnVrZWRfcCA6IDE7CisKKyAgICBlbnVtIGRyYXdfZ2x5cGhfYWN0aW9u CisgICAgeworICAgICAgTUNfRFJBV19HTFlQSF9TVFJJTkcsCisgICAgICBNQ19FUkFTRV9HTFlQ SF9TVFJJTkcKKyAgICB9IGFjdGlvbl90eXBlOworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiAgIC8qIFgtb3JpZ2luIG9mIHRoZSBzdHJpbmcuICAqLwogICBpbnQgeDsKIApAQCAtMjgz NCw2ICsyOTkzLDI5IEBAIHR5cGVkZWYgdm9pZCAoKmZyYW1lX3Bhcm1faGFuZGxlcikgKHN0cnVj dCBmcmFtZSAqLCBMaXNwX09iamVjdCwgTGlzcF9PYmplY3QpOwogCiBzdHJ1Y3QgcmVkaXNwbGF5 X2ludGVyZmFjZQogeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUt Q1VSU09SUyAqLworCisvKiBgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYG5zdGVybS5tYCB8IGB3 MzJ0ZXJtLmNgIHwgYHh0ZXJtLmNgIG11c3QgYmUgaW4gdGhlCitleGFjdCBzYW1lIG9yZGVyIGFz IHRoZSBgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYGRpc3BleHRlcm4uaGAhICovCisKKyAgLyog YG1jX25zX2RyYXdfd2luZG93X2N1cnNvcicgfCBgbWNfdzMyX2RyYXdfd2luZG93X2N1cnNvcicg fCBgbWNfeF9kcmF3X3dpbmRvd19jdXJzb3InICovCisgIHZvaWQgKCptY19zY3JpYmVfY3Vyc29y KSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LAorICAgICAg ICBzdHJ1Y3QgZ2x5cGhfcm93ICpnbHlwaF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ODU4N2ZlYiAxMDA2NDQKLS0tIGEvc3JjL2Rpc3BuZXcuYworKysgYi9zcmMvZGlzcG5ldy5j CkBAIC01Niw2ICs1NiwxNzgyIEBAIGFsb25nIHdpdGggR05VIEVtYWNzLiAgSWYgbm90LCBzZWUg PGh0dHBzOi8vd3d3LmdudS5vcmcvbGljZW5zZXMvPi4gICovCiAjaW5jbHVkZSAidzMyLmgiCiAj ZW5kaWYKIAwKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIGJlZ2luIE1VTFRJUExF LUNVUlNPUlMgKi8KKworc3RydWN0IGdseXBoc19za2lwcGVkCit7CisgIHB0cmRpZmZfdCBhbGxv Y2F0ZWQ7CisgIHB0cmRpZmZfdCB1c2VkOworICBzdHJ1Y3Qgc2tpcHBlZF9pdGVtcworICAgIHsK KyAgICAgIGludCB4OworICAgICAgaW50IGhwb3M7CisgICAgICBib29sIGVuYWJsZWRfcDsKKyAg ICB9ICpza2lwcGVkOworfSBhcnJheV9nbHlwaHNfc2tpcHBlZDsKKworc3RydWN0IG1jX3Jvd19l bnRyeQoreworICBpbnQgb2xkX3VzZXMsIG5ld191c2VzOworICBpbnQgbmV3X2xpbmVfbnVtYmVy OworICBwdHJkaWZmX3QgYnVja2V0OworICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3c7CisgIHN0cnVj dCBtY19yb3dfZW50cnkgKm5leHQ7Cit9Oworc3RhdGljIHN0cnVjdCBtY19yb3dfZW50cnkgKm1j X3Jvd19lbnRyeV9wb29sOworc3RhdGljIHB0cmRpZmZfdCBtY19yb3dfZW50cnlfcG9vbF9zaXpl Oworc3RhdGljIHB0cmRpZmZfdCBtY19yb3dfZW50cnlfaWR4Oworc3RhdGljIHN0cnVjdCBtY19y b3dfZW50cnkgKiptY19yb3dfdGFibGU7CitzdGF0aWMgcHRyZGlmZl90IG1jX3Jvd190YWJsZV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bdm50aF0uY2FjaGVbY2FjaGVfdHlwZV0sIG1hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdLCBuYnl0ZXMpOworICAgICAgICAgICAgfQorICAg ICAgICB9CisgICAgfQorICByZXR1cm4gc2F2ZWQ7Cit9CisKK3ZvaWQKK21jX3hmcmVlX2NhY2hl X21hdHJpeCAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IG1jX21hdHJpeCAqbWF0cml4KQorewor ICBpZiAobWF0cml4LT52cG9zID09IE5VTEwpCisgICAgcmV0dXJuOworICBmb3IgKGludCB2bnRo ID0gMDsgdm50aCA8IG1hdHJpeC0+dnBvc19hbGxvY2F0ZWQ7ICsrdm50aCkKKyAgICB7CisgICAg ICBmb3IgKGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7CisgICAgICAg ICAgIGNhY2hlX3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICAgICAgKytjYWNoZV90eXBlKQorICAg ICAgICBpZiAobWF0cml4LT52cG9zW3ZudGhdLmNhY2hlX2FsbG9jYXRlZFtjYWNoZV90eXBlXSA+ IDApCisgICAgICAgICAgeworICAgICAgICAgICAgeGZyZWUgKG1hdHJpeC0+dnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXSk7CisgICAgICAgICAgICBtYXRyaXgtPnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV0gPSBOVUxMOworICAgICAgICAgICAgbWF0cml4LT52cG9zW3ZudGhdLmNhY2hl X2FsbG9jYXRlZFtjYWNoZV90eXBlXSA9IDA7CisgICAgICAgICAgICBtYXRyaXgtPnZwb3Nbdm50 aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXSA9IDA7CisgICAgICAgICAgfQorICAgIH0KKyAgeGZy ZWUgKG1hdHJpeC0+dnBvcyk7CisgIG1hdHJpeC0+dnBvcyA9IE5VTEw7CisgIG1hdHJpeC0+dnBv c19hbGxv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xzZQorICAgICAgICAgIGJyZWFr OworICAgIH0KKyNpZmRlZiBIQVZFX1hXSURHRVRTCisgIC8qIEN1cnJlbnRseSB0aGlzIHNlZW1z IG5lZWRlZCB0byBkZXRlY3QgeHdpZGdldCBtb3ZlbWVudCByZWxpYWJseS4gKi8KKyAgICByZXR1 cm4gMDsKKyNlbmRpZgorICAvKiBHaXZlIHVwIGlmIHNvbWUgcm93cyBpbiB0aGUgZGVzaXJlZCBt YXRyaXggYXJlIG5vdCBlbmFibGVkLiAqLworICBpZiAoISBNQVRSSVhfUk9XX0VOQUJMRURfUCAo ZGVzaXJlZF9tYXRyaXgsIGkpKQorICAgIHJldHVybiAtMTsKKyAgZmlyc3Rfb2xkID0gZmlyc3Rf bmV3ID0gaTsKKyAgLyogU2V0IGxhc3RfbmV3IHRvIHRoZSBpbmRleCArIDEgb2YgdGhlIHJvdyB0 aGF0IHJlYWNoZXMgdGhlCisgICAgIGJvdHRvbSBib3VuZGFyeSBpbiB0aGUgZGVzaXJlZCBtYXRy aXguICBHaXZlIHVwIGlmIHdlIGZpbmQgYQorICAgICBkaXNhYmxlZCByb3cgYmVmb3JlIHdlIHJl YWNoIHRoZSBib3R0b20gYm91bmRhcnkuICovCisgIGkgPSBmaXJzdF9uZXcgKyAxOworICB3aGls ZSAoaSA8IGRlc2lyZWRfbWF0cml4LT5ucm93cyAtIDEpCisgICAgeworICAgICAgaW50IGJvdHRv bTsKKyAgICAgIGlmICghIE1BVFJJWF9ST1dfRU5BQkxFRF9QIChkZXNpcmVkX21hdHJpeCwgaSkp CisgICAgICAgIHJldHVybiAwOworICAgICAgYm90dG9tID0gTUFUUklYX1JPV19CT1RUT01fWSAo TUFUUklYX1JPVyAoZGVzaXJlZF9tYXRyaXgsIGkpKTsKKyAgICAgIGlmIChib3R0b20gPD0geWIp CisgICAgICAgICsraTsKKyAgICAgIGlmIChib3R0b20gPj0geWIpCisgICAgICAgIGJyZWFrOwor ICAgIH0KKyAgbGFzdF9uZXcgPSBpO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WF0 cml4LCBpIC0gMSktPnJlZHJhd19mcmluZ2VfYml0bWFwc19wCisgICAgICAgICAmJiByb3dfZXF1 YWxfcCAoTUFUUklYX1JPVyAoZGVzaXJlZF9tYXRyaXgsIGkgLSAxKSwKKyAgICAgICAgICAgICAg ICAgICAgICAgICBNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaiAtIDEpLCAxKSkKKyAgICAt LWksIC0tajsKKyAgbGFzdF9uZXcgPSBpOworICBsYXN0X29sZCA9IGo7CisgIC8qIE5vdGhpbmcg dG8gZG8gaWYgYWxsIHJvd3MgYXJlIGVxdWFsLiAqLworICBpZiAobGFzdF9uZXcgPT0gZmlyc3Rf bmV3KQorICAgIHJldHVybiAwOworICAvKiBDaGVjayBmb3IgaW50ZWdlciBvdmVyZmxvdyBpbiBz aXplIGNhbGN1bGF0aW9uLgorICAgICBJZiBuZXh0X2FsbW9zdF9wcmltZSBjaGVja3MgKE4pIGZv ciBkaXZpc2liaWxpdHkgYnkgMi4uMTAsIHRoZW4KKyAgICAgaXQgY2FuIHJldHVybiBhdCBtb3N0 IE4gKyAxMCwgZS5nLiwgbmV4dF9hbG1vc3RfcHJpbWUgKDEpID09IDExLgorICAgICBTbywgc2V0 IG5leHRfYWxtb3N0X3ByaW1lX2luY3JlbWVudF9tYXggdG8gMTAuCisgICAgIEl0J3MganVzdCBh IGNvaW5jaWRlbmNlIHRoYXQgbmV4dF9hbG1vc3RfcHJpbWVfaW5jcmVtZW50X21heCA9PQorICAg ICBORVhUX0FMTU9TVF9QUklNRV9MSU1JVCAtIDEuICBJZiBORVhUX0FMTU9TVF9QUklNRV9MSU1J VCB3ZXJlCisgICAgIDEzLCB0aGVuIG5leHRfYWxtb3N0X3ByaW1lX2luY3JlbWVudF9tYXggd291 bGQgYmUgMTQsIGUuZy4sCisgICAgIGJlY2F1c2UgbmV4dF9hbG1vc3RfcHJpbWUgKDExMykgd291 bGQgYmUgMTI3LiAqLworICB7CisgICAgdmVyaWZ5IChORVhUX0FMTU9TVF9QUklNRV9MSU1JVCA9 PSAxMSk7CisgICAgZW51bSB7IG5leHRfYWxtb3N0X3ByaW1lX2luY3JlbWVudF9tYXggPSAxMCB9 OworICAgIHB0cmRpZmZfdCByb3dfdGFibGVfbWF4ID0KKyAgICAgIChtaW4gKFBUUkRJRkZfTUFY LCBTSVpFX01BWCkgLyAoMyAqIHNpemVvZiAqbWNfcm93X3RhYmxlKQorICAgICAgIC0gbmV4dF9h bG1vc3RfcHJpbWVfaW5jcmVtZW50X21heCk7CisgICAgcHRyZGlmZl90IGN1cnJlbnRfbnJvd3Nf bWF4ID0gcm93X3RhYmxlX21heCAtIGRlc2lyZWRfbWF0cml4LT5ucm93czsKKyAgICBpZiAoY3Vy cmVudF9ucm93c19tYXggPCBjdXJyZW50X21hdHJpeC0+bnJvd3MpCisgICAgICBtZW1vcnlfZnVs bCAoU0laRV9NQVgpOworICB9CisgIC8qIFJlYWxsb2NhdGUgdmVjdG9ycywgdGFibGVzIGV0Yy4g aWYgbmVjZXNzYXJ5LiAqLworICBpZiAoY3VycmVudF9tYXRyaXgtPm5yb3dzID4gbWNfb2xkX2xp bmVzX3NpemUpCisgICAgbWNfb2xkX2xpbmVzID0geHBhbGxvYyAobWNfb2xkX2xpbmVzLCAmbWNf b2xkX2xpbmVzX3NpemUsCisgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudF9tYXRyaXgt Pm5yb3dzIC0gbWNfb2xkX2xpbmVzX3NpemUsCisgICAgICAgICAgICAgICAgICAgICAgICAgSU5U X01BWCwgc2l6ZW9mICptY19vbGRfbGluZXMpOworICBpZiAoZGVzaXJlZF9tYXRyaXgtPm5yb3dz ID4gbWNfbmV3X2xpbmVzX3NpemUpCisgICAgbWNfbmV3X2xpbmVzID0geHBhbGxvYyAobWNfbmV3 X2xpbmVzLCAmbWNfbmV3X2xpbmVzX3NpemUsCisgICAgICAgICAgICAgICAgICAgICAgICAgZGVz aXJlZF9tYXRyaXgtPm5yb3dzIC0gbWNfbmV3X2xpbmVzX3NpemUsCisgICAgICAgICAgICAgICAg ICAgICAgICAgSU5UX01BWCwgc2l6ZW9mICptY19uZXdfbGluZXMpOworICBuID0gZGVzaXJlZF9t YXRyaXgtPm5yb3dzOworICBuICs9IGN1cnJlbnRfbWF0cml4LT5ucm93czsKKyAgaWYgKG1jX3Jv d190YWJsZV9zaXplIDwgMyAqIG4pCisgICAgeworICAgICAgcHRyZGlmZl90IHNpemUgPSBuZXh0 X2FsbW9zdF9wcmltZSAoMyAqIG4pOworICAgICAgbWNfcm93X3RhYmxlID0geG5yZWFsbG9jICht Y19yb3dfdGFibGUsIHNpemUsIHNpemVvZiAqbWNfcm93X3RhYmxlKTsKKyAgICAgIG1jX3Jvd190 YWJsZV9zaXplID0gc2l6ZTsKKyAgICAgIG1lbXNldCAobWNfcm93X3RhYmxlLCAwLCBzaXplICog c2l6ZW9mICptY19yb3dfdGFibGUpOworICAgIH0KKyAgaWYgKG4gPiBtY19yb3dfZW50cnlfcG9v bF9zaXplKQorICAgIG1jX3Jvd19lbnRyeV9wb29sID0geHBhbGxvYyAobWNfcm93X2VudHJ5X3Bv b2wsICZtY19yb3dfZW50cnlfcG9vbF9zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgbiAtIG1jX3Jvd19lbnRyeV9wb29sX3NpemUsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAtMSwgc2l6ZW9mICptY19yb3dfZW50cnlfcG9vbCk7CisgIGlmIChkZXNpcmVkX21hdHJp eC0+bnJvd3MgPiBtY19ydW5zX3NpemUpCisgICAgeworICAgICAgbWNfcnVucyA9IHhucmVhbGxv YyAobWNfcnVucywgZGVzaXJlZF9tYXRyaXgtPm5yb3dzLCBzaXplb2YgKm1jX3J1bnMpOworICAg ICAgbWNfcnVuX3Bvb2wgPSB4bnJlYWxsb2MgKG1jX3J1bl9wb29sLCBkZXNpcmVkX21hdHJpeC0+ bnJvd3MsIHNpemVvZiAqbWNfcnVuX3Bvb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ZGVudGlmeSBtb3ZlcyBiYXNlZCBvbiBsaW5lcyB0aGF0IGFyZSB1bmlxdWUgYW5kIGVxdWFsCisg ICAgIGluIGJvdGggbWF0cmljZXMuICovCisgIGZvciAoaSA9IGZpcnN0X29sZDsgaSA8IGxhc3Rf b2xkOykKKyAgICBpZiAobWNfb2xkX2xpbmVzW2ldCisgICAgICAgICYmIG1jX29sZF9saW5lc1tp XS0+b2xkX3VzZXMgPT0gMQorICAgICAgICAmJiBtY19vbGRfbGluZXNbaV0tPm5ld191c2VzID09 IDEpCisgICAgICB7CisgICAgICAgIGludCBwLCBxOworICAgICAgICBpbnQgbmV3X2xpbmUgPSBt Y19vbGRfbGluZXNbaV0tPm5ld19saW5lX251bWJlcjsKKyAgICAgICAgc3RydWN0IHJ1biAqcnVu ID0gbWNfcnVuX3Bvb2wgKyBydW5faWR4Kys7CisgICAgICAgIC8qIFJlY29yZCBtb3ZlLiAqLwor ICAgICAgICBydW4tPmN1cnJlbnRfdnBvcyA9IGk7CisgICAgICAgIHJ1bi0+Y3VycmVudF95ID0g TUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIGkpLT55OworICAgICAgICBydW4tPmRlc2lyZWRf dnBvcyA9IG5ld19saW5lOworICAgICAgICBydW4tPmRlc2lyZWRfeSA9IE1BVFJJWF9ST1cgKGRl c2lyZWRfbWF0cml4LCBuZXdfbGluZSktPnk7CisgICAgICAgIHJ1bi0+bnJvd3MgPSAxOworICAg ICAgICBydW4tPmhlaWdodCA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCBpKS0+aGVpZ2h0 OworICAgICAgICAvKiBFeHRlbmQgYmFja3dhcmQuICovCisgICAgICAgIHAgPSBpIC0gMTsKKyAg ICAgICAgcSA9IG5ld19saW5lIC0gMTsKKyAgICAgICAgd2hpbGUgKHAgPiBmaXJzdF9vbGQKKyAg ICAgICAgICAgICAgICYmIHEgPiBmaXJzdF9uZXcKKyAgICAgICAgICAgICAgICYmIG1jX29sZF9s aW5lc1twXSA9PSBtY19uZXdfbGluZXNbcV0pCisgICAgICAgICAgeworICAgICAgICAgICAgaW50 IGggPSBNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgcCktPmhlaWdodDsKKyAgICAgICAgICAg IC0tcnVuLT5jdXJyZW50X3Zwb3M7CisgICAgICAgICAgICAtLXJ1bi0+ZGVzaXJlZF92cG9zOwor ICAgICAgICAgICAgKytydW4tPm5yb3dzOworICAgICAgICAgICAgcnVuLT5oZWlnaHQgKz0gaDsK KyAgICAgICAgICAgIHJ1bi0+ZGVzaXJlZF95IC09IGg7CisgICAgICAgICAgICBydW4tPmN1cnJl bnRfeSAtPSBoOworICAgICAgICAgICAgLS1wLCAtLXE7CisgICAgICAgICAgfQorICAgICAgICAv KiBFeHRlbmQgZm9yd2FyZC4gKi8KKyAgICAgICAgcCA9IGkgKyAxOworICAgICAgICBxID0gbmV3 X2xpbmUgKyAxOworICAgICAgICB3aGlsZSAocCA8IGxhc3Rfb2xkCisgICAgICAgICAgICAgICAm JiBxIDwgbGFzdF9uZXcKKyAgICAgICAgICAgICAgICYmIG1jX29sZF9saW5lc1twXSA9PSBtY19u ZXdfbGluZXNbcV0pCisgICAgICAgICAgeworICAgICAgICAgICAgaW50IGggPSBNQVRSSVhfUk9X IChjdXJyZW50X21hdHJpeCwgcCktPmhlaWdodDsKKyAgICAgICAgICAgICsrcnVuLT5ucm93czsK KyAgICAgICAgICAgIHJ1bi0+aGVpZ2h0ICs9IGg7CisgICAgICAgICAgICArK3AsICsrcTsKKyAg ICAgICAgICB9CisgICAgICAgIC8qIEluc2VydCBydW4gaW50byBsaXN0IG9mIGFsbCBydW5zLiAg T3JkZXIgcnVucyBieSBjb3BpZWQKKyAgICAgICAgICAgcGl4ZWwgbGluZXMuICBOb3RlIHRoYXQg d2UgcmVjb3JkIHJ1bnMgdGhhdCBkb24ndCBoYXZlIHRvCisgICAgICAgICAgIGJlIGNvcGllZCBi ZWNhdXNlIHRoZXkgYXJlIGFscmVhZHkgaW4gcGxhY2UuICBUaGlzIGlzIGRvbmUKKyAgICAgICAg ICAgYmVjYXVzZSB3ZSBjYW4gYXZvaWQgY2FsbGluZyB1cGRhdGVfd2luZG93X2xpbmUgaW4gdGhp cworICAgICAgICAgICBjYXNlLiAqLworICAgICAgICBmb3IgKHAgPSAwOyBwIDwgbnJ1bnMgJiYg bWNfcnVuc1twXS0+aGVpZ2h0ID4gcnVuLT5oZWlnaHQ7ICsrcCkKKyAgICAgICAgICA7CisgICAg ICAgIGZvciAocSA9IG5ydW5zOyBxID4gcDsgLS1xKQorICAgICAgICAgIG1jX3J1bnNbcV0gPSBt Y19ydW5zW3EgLSAxXTsKKyAgICAgICAgbWNfcnVuc1twXSA9IHJ1bjsKKyAgICAgICAgKytucnVu czsKKyAgICAgICAgaSArPSBydW4tPm5yb3dzOworICAgICAgfQorICAgICAgZWxzZQorICAgICAg ICArK2k7CisgIC8qIERvIHRoZSBtb3Zlcy4gIERvIGl0IGluIGEgd2F5IHRoYXQgd2UgZG9uJ3Qg b3ZlcndyaXRlIHNvbWV0aGluZworICAgICB3ZSB3YW50IHRvIGNvcHkgbGF0ZXIgb24uICBUaGlz IGlzIG5vdCBzb2x2YWJsZSBpbiBnZW5lcmFsCisgICAgIGJlY2F1c2UgdGhlcmUgaXMgb25seSBv bmUgZGlzcGxheSBhbmQgd2UgZG9uJ3QgaGF2ZSBhIHdheSB0bworICAgICBleGNoYW5nZSBhcmVh cyBvbiB0aGlzIGRpc3BsYXkuICBFeGFtcGxlOgorICAgICAgICAgICstLS0tLS0tLS0tLSsgICAg ICAgKy0tLS0tLS0tLS0tKworICAgICAgICAgIHwgICAgIEEgICAgIHwgICAgICAgfCAgICAgQiAg ICAgfAorICAgICAgICAgICstLS0tLS0tLS0tLSsgIC0tPiAgKy0tLS0tLS0tLS0tKworICAgICAg ICAgIHwgICAgIEIgICAgIHwgICAgICAgfCAgICAgQSAgICAgfAorICAgICAgICAgICstLS0tLS0t LS0tLSsgICAgICAgKy0tLS0tLS0tLS0tKworICAgICBJbnN0ZWFkLCBwcmVmZXIgYmlnZ2VyIG1v dmVzLCBhbmQgaW52YWxpZGF0ZSBtb3ZlcyB0aGF0IHdvdWxkCisgICAgIGNvcHkgZnJvbSB3aGVy ZSB3ZSBjb3BpZWQgdG8uICovCisgIGZvciAoaSA9IDA7IGkgPCBucnVuczsgKytpKQorICAgIGlm IChtY19ydW5zW2ldLT5ucm93cyA+IDApCisgICAgICB7CisgICAgICAgIHN0cnVjdCBydW4gKnIg PSBtY19ydW5zW2ldOworICAgICAgICBpZiAoci0+Y3VycmVudF95ICE9IHItPmRlc2lyZWRfeSkK KyAgICAgICAgICB7CisgICAgICAgICAgICAvLyAgZnByaW50ZiAoc3RkZXJyLCAiJXM6ICByLT5j dXJyZW50L2Rlc2lyZWRfdnBvcyAoJWQvJWQpIHwgci0+Y3VycmVudC9kZXNpcmVkX3kgKCVkLyVk KVxuIiwKKyAgICAgICAgICAgIC8vICAgICAgICAgICByLT5jdXJyZW50X3kgPCByLT5kZXNpcmVk X3kgPyAi4oaTIiA6ICLihpEiLAorICAgICAgICAgICAgLy8gICAgICAgICAgIHItPmN1cnJlbnRf dnBvcywgci0+ZGVzaXJlZF92cG9zLCByLT5jdXJyZW50X3ksIHItPmRlc2lyZWRfeSk7CisgICAg ICAgICAgICAvLyAgcmlmLT5jbGVhcl93aW5kb3dfbW91c2VfZmFjZSAodyk7CisgICAgICAgICAg ICAvLyAgcmlmLT5zY3JvbGxfcnVuX2hvb2sgKHcsIHIpOworICAgICAgICAgIH0KKyAgICAgICAg LyogVHJ1bmNhdGUgcnVucyB0aGF0IGNvcHkgdG8gd2hlcmUgd2UgY29waWVkIHRvLCBhbmQKKyAg ICAgICAgICAgaW52YWxpZGF0ZSBydW5zIHRoYXQgY29weSBmcm9tIHdoZXJlIHdlIGNvcGllZCB0 by4gKi8KKyAgICAgICAgZm9yIChqID0gbnJ1bnMgLSAxOyBqID4gaTsgLS1qKQorICAgICAgICAg IHsKKyAgICAgICAgICAgIHN0cnVjdCBydW4gKnAgPSBtY19ydW5zW2pdOworICAgICAgICAgICAg Ym9vbCB0cnVuY2F0ZWRfcCA9IDA7CisgICAgICAgICAgICBpZiAocC0+bnJvd3MgPiAwCisgICAg ICAgICAgICAgICAgJiYgcC0+ZGVzaXJlZF95IDwgci0+ZGVzaXJlZF95ICsgci0+aGVpZ2h0Cisg ICAgICAgICAgICAgICAgJiYgcC0+ZGVzaXJlZF95ICsgcC0+aGVpZ2h0ID4gci0+ZGVzaXJlZF95 KQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKHAtPmRlc2lyZWRfeSA8IHIt PmRlc2lyZWRfeSkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcC0+ bnJvd3MgPSByLT5kZXNpcmVkX3Zwb3MgLSBwLT5kZXNpcmVkX3Zwb3M7CisgICAgICAgICAgICAg ICAgICAgIHAtPmhlaWdodCA9IHItPmRlc2lyZWRfeSAtIHAtPmRlc2lyZWRfeTsKKyAgICAgICAg ICAgICAgICAgICAgdHJ1bmNhdGVkX3AgPSAxOworICAgICAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAg aW50IG5yb3dzX2NvcGllZCA9IChyLT5kZXNpcmVkX3Zwb3MgKyByLT5ucm93cworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gcC0+ZGVzaXJlZF92cG9zKTsKKyAgICAg ICAgICAgICAgICAgICAgaWYgKHAtPm5yb3dzIDw9IG5yb3dzX2NvcGllZCkKKyAgICAgICAgICAg ICAgICAgICAgICBwLT5ucm93cyA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaGVp Z2h0X2NvcGllZCA9IChyLT5kZXNpcmVkX3kgKyByLT5oZWlnaHQKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBwLT5kZXNpcmVkX3kpOworICAgICAgICAg ICAgICAgICAgICAgICAgICBwLT5jdXJyZW50X3Zwb3MgKz0gbnJvd3NfY29waWVkOworICAgICAg ICAgICAgICAgICAgICAgICAgICBwLT5kZXNpcmVkX3Zwb3MgKz0gbnJvd3NfY29waWVkOworICAg ICAgICAgICAgICAgICAgICAgICAgICBwLT5ucm93cyAtPSBucm93c19jb3BpZWQ7CisgICAgICAg ICAgICAgICAgICAgICAgICAgIHAtPmN1cnJlbnRfeSArPSBoZWlnaHRfY29waWVkOworICAgICAg ICAgICAgICAgICAgICAgICAgICBwLT5kZXNpcmVkX3kgKz0gaGVpZ2h0X2NvcGllZDsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgcC0+aGVpZ2h0IC09IGhlaWdodF9jb3BpZWQ7CisgICAgICAg ICAgICAgICAgICAgICAgICAgIHRydW5jYXRlZF9wID0gMTsKKyAgICAgICAgICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAg aWYgKHItPmN1cnJlbnRfeSAhPSByLT5kZXNpcmVkX3kKKyAgICAgICAgICAgICAgICAvKiBUaGUg Y29uZGl0aW9uIGJlbG93IGlzIGVxdWl2YWxlbnQgdG8KKyAgICAgICAgICAgICAgICAgICAoKHAt PmN1cnJlbnRfeSA+PSByLT5kZXNpcmVkX3kKKyAgICAgICAgICAgICAgICAgICAgICYmIHAtPmN1 cnJlbnRfeSA8IHItPmRlc2lyZWRfeSArIHItPmhlaWdodCkKKyAgICAgICAgICAgICAgICAgICAg fHwgKHAtPmN1cnJlbnRfeSArIHAtPmhlaWdodCA+IHItPmRlc2lyZWRfeQorICAgICAgICAgICAg ICAgICAgICAgICAgJiYgKHAtPmN1cnJlbnRfeSArIHAtPmhlaWdodAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDw9IHItPmRlc2lyZWRfeSArIHItPmhlaWdodCkpKQorICAgICAgICAgICAg ICAgICAgIGJlY2F1c2Ugd2UgaGF2ZSAwIDwgcC0+aGVpZ2h0IDw9IHItPmhlaWdodC4gKi8KKyAg ICAgICAgICAgICAgICAmJiBwLT5jdXJyZW50X3kgPCByLT5kZXNpcmVkX3kgKyByLT5oZWlnaHQK KyAgICAgICAgICAgICAgICAmJiBwLT5jdXJyZW50X3kgKyBwLT5oZWlnaHQgPiByLT5kZXNpcmVk X3kpCisgICAgICAgICAgICAgIHAtPm5yb3dzID0gMDsKKyAgICAgICAgICAgIC8qIFJlb3JkZXIg cnVucyBieSBjb3BpZWQgcGl4ZWwgbGluZXMgaWYgdHJ1bmNhdGVkLiAqLworICAgICAgICAgICAg aWYgKHRydW5jYXRlZF9wICYmIHAtPm5yb3dzID4gMCkKKyAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgIGludCBrID0gbnJ1bnMgLSAxOworICAgICAgICAgICAgICAgIHdoaWxlIChtY19y dW5zW2tdLT5ucm93cyA9PSAwIHx8IG1jX3J1bnNba10tPmhlaWdodCA8IHAtPmhlaWdodCkKKyAg ICAgICAgICAgICAgICAgIGstLTsKKyAgICAgICAgICAgICAgICBtZW1tb3ZlIChtY19ydW5zICsg aiwgbWNfcnVucyArIGogKyAxLCAoayAtIGopICogc2l6ZW9mICgqbWNfcnVucykpOworICAgICAg ICAgICAgICAgIG1jX3J1bnNba10gPSBwOworICAgICAgICAgICAgICB9CisgICAgICAgICAgfQor ICAgICAgICAvKiBBc3NpZ24gbWF0cml4IHJvd3MuICovCisgICAgICAgIGZvciAoaiA9IDA7IGog PCByLT5ucm93czsgKytqKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9y b3cgKmZyb20sICp0bzsKKyAgICAgICAgICAgIGJvb2wgdG9fb3ZlcmxhcHBlZF9wOworICAgICAg ICAgICAgdG8gPSBNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgci0+ZGVzaXJlZF92cG9zICsg aik7CisgICAgICAgICAgICBmcm9tID0gTUFUUklYX1JPVyAoZGVzaXJlZF9tYXRyaXgsIHItPmRl c2lyZWRfdnBvcyArIGopOworICAgICAgICAgICAgdG9fb3ZlcmxhcHBlZF9wID0gdG8tPm92ZXJs YXBwZWRfcDsKKyAgICAgICAgICAgIGZyb20tPnJlZHJhd19mcmluZ2VfYml0bWFwc19wID0gZnJv bS0+ZnJpbmdlX2JpdG1hcF9wZXJpb2RpY19wOworICAgICAgICAgICAgYXNzaWduX3JvdyAodG8s IGZyb20pOworICAgICAgICAgICAgLyogVGhlIGFib3ZlIGBhc3NpZ25fcm93JyBhY3R1YWxseSBk b2VzIHN3YXAsIHNvIGlmIHdlIGhhZAorICAgICAgICAgICAgICAgYW4gb3ZlcmxhcCBpbiB0aGUg Y29weSBkZXN0aW5hdGlvbiBvZiB0d28gcnVucywgdGhlbgorICAgICAgICAgICAgICAgdGhlIHNl Y29uZCBydW4gd291bGQgYXNzaWduIGEgcHJldmlvdXNseSBkaXNhYmxlZCBib2d1cworICAgICAg ICAgICAgICAgcm93LiAgQnV0IHRoYW5rcyB0byB0aGUgdHJ1bmNhdGlvbiBjb2RlIGluIHRoZQor ICAgICAgICAgICAgICAgcHJlY2VkaW5nIGZvci1sb29wLCB3ZSBubyBsb25nZXIgaGF2ZSBzdWNo IGFuIG92ZXJsYXAsCisgICAgICAgICAgICAgICBhbmQgdGh1cyB0aGUgYXNzaWduZWQgcm93IHNo b3VsZCBhbHdheXMgYmUgZW5hYmxlZC4gKi8KKyAgICAgICAgICAgIGVhc3NlcnQgKHRvLT5lbmFi bGVkX3ApOworICAgICAgICAgICAgZnJvbS0+ZW5hYmxlZF9wID0gZmFsc2U7CisgICAgICAgICAg ICB0by0+b3ZlcmxhcHBlZF9wID0gdG9fb3ZlcmxhcHBlZF9wOworICAgICAgICAgIH0KKyAgICAg IH0KKyAgLyogQ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VyIGNvbmRpdGlvbnMgdGVzdCBmb3IgYW4gZW1wdHkKKyAgYnVmZmVyIChub3Qg bmFycm93ZWQpLCBvciBhbiBlbXB0eSBuYXJyb3dlZCBidWZmZXIuICovCisgIGJvb2wgcm93X2F0 X3p2X3AgPSAoKHZwb3MgIT0gMAorICAgICAgICAgICAgICAgICAgICAgICAmJiAoY3VycmVudF9y b3cgLSAxKS0+dXNlZFtURVhUX0FSRUFdID4gMAorICAgICAgICAgICAgICAgICAgICAgICAmJiBw cmV2X21hdHJpeF9yb3dfc3RhcnRfYnl0ZXBvcyAhPSBwcmV2X21hdHJpeF9yb3dfZW5kX2J5dGVw b3MKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgIShjdXJyZW50X3JvdyAtIDEpLT5lbmRzX2F0 X3p2X3AKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgbWF0cml4X3Jvd19zdGFydF9ieXRlcG9z ID09IG1hdHJpeF9yb3dfZW5kX2J5dGVwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgZGVz aXJlZF9yb3ctPmVuZHNfYXRfenZfcCkKKyAgICAgICAgICAgICAgICAgICAgICB8fCAoKChoZWFk ZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPT0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgIHx8IChoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCAmJiB2cG9zID09IDApKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBidWZmZXJfbmFycm93ZWRfcAorICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBib2JfcmVzcGVjdF9uYXJyb3cgPT0gZW9iX3Jlc3BlY3RfbmFycm93KQorICAg ICAgICAgICAgICAgICAgICAgIHx8ICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA9 PSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKGhlYWRlcl9saW5lX2Zvcm1hdCA9 PSAwICYmIHZwb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wb3MgKCVkKVxu IiwKKyAgICAgICAgICAgICAgICAgICAgICBtY193aW5kb3cgKHcpLCB2cG9zKTsKKyAgLyogSW5h c211Y2ggYXMgd2UgcHJvY2VzcyB0aGUgY3Vyc29yIHJvdyBiZWZvcmUgYWxsIG90aGVyIHJvd3Ms IHdlIGNhbiByZWx5CisgIHVwb24gdGhlIHByZXZpb3VzIGBkZXNpcmVkX3Jvd2AgdG8gYmUgYWNj dXJhdGUuICovCisgIGVudW0gbWNfcm93X3Bvc2l0aW9uIHJvd19wb3NpdGlvbiA9ICBtY19yb3df cG9zaXRpb24gKHcsIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBkZXNpcmVkX3JvdworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IGN1cnJlbnRfcm93LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBkZXNpcmVkX3JvdywgdnBvcyk7CisgIC8qIElmIHJvd3MgYXJlIGF0IGRp ZmZlcmVudCBYIG9yIFksIG9yIHJvd3MgaGF2ZSBkaWZmZXJlbnQgaGVpZ2h0LAorICAgICBvciB0 aGUgY3VycmVudCByb3cgaXMgbWFya2VkIGludmFsaWQsIHdyaXRlIHRoZSBlbnRpcmUgbGluZS4g Ki8KKyAgaWYgKCFjdXJyZW50X3Jvdy0+ZW5hYmxlZF9wCisgICAgICB8fCBkZXNpcmVkX3Jvdy0+ eSAhPSBjdXJyZW50X3Jvdy0+eQorICAgICAgfHwgZGVzaXJlZF9yb3ctPmFzY2VudCAhPSBjdXJy ZW50X3Jvdy0+YXNjZW50CisgICAgICB8fCBkZXNpcmVkX3Jvdy0+cGh5c19hc2NlbnQgIT0gY3Vy cmVudF9yb3ctPnBoeXNfYXNjZW50CisgICAgICB8fCBkZXNp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xu XAorICAgICAgICAgIHZwb3MgKCVkKSB8IGNoYXIgKCVkLyVzKSB8IHN0YXJ0X3g6ICglZCkgfCBz dGFydF9ocG9zICglZC8lZClcbiIsCisgICAgICAgICAgdnBvcywgZGVzaXJlZF9yb3ctPmdseXBo c1tURVhUX0FSRUFdLT51LmNoLAorICAgICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nIChkZXNpcmVk X3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV0tPnUuY2gpLAorICAgICAgICAgIGRlc2lyZWRfcm93LT54 LCAwLCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSk7CisgICAgICBpZiAoZGVzaXJl ZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgICAgeworICAgICAgICAgIGJsb2NrX2lucHV0 ICgpOworICAgICAgICAgIGludCBsZW4gPSBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdOwor ICAgICAgICAgIGludCBocG9zID0gZGVzaXJlZF9yb3ctPmdseXBoc1tURVhUX0FSRUFdIC0gdXBk YXRlZF9yb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgIHctPm91dHB1dF9jdXJzb3Iu eCA9CisgICAgICAgICAgICBtY19kcmF3X2dseXBocyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0 ZWRfcm93LCB3LT5tY19tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+b3V0 cHV0X2N1cnNvci54LCBURVhUX0FSRUEsIGhwb3MsIGhwb3MgKyBsZW4sCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgRFJBV19OT1JNQUxfVEVYVCwgMCwgdnBvcywgbHNsLCBnbHlwaF9mbGF2 b3IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUsIHdkLCBlc3NlbnRp YWxzLmFjdGl2ZV9wLCBjdXJzb3JfZ2NfcCwKKyAgICAgICAgICAgICAgICAg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GgsIHNvIHRoYXQgdGhlIGZhY2Ug ZXh0ZW5zaW9uIGFjdHVhbGx5IHRha2VzIHBsYWNlLiAqLworICAgICAgICBpZiAoTUFUUklYX1JP V19FWFRFTkRTX0ZBQ0VfUCAoZGVzaXJlZF9yb3cpCisgICAgICAgICAgICAmJiAoZGVzaXJlZF9z dG9wX3BvcyA8IGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAgICB8 fCAoZGVzaXJlZF9zdG9wX3BvcyA9PSBjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAg ICAgICAgICAgICAgICAgICYmICFNQVRSSVhfUk9XX0VYVEVORFNfRkFDRV9QIChjdXJyZW50X3Jv dykpKSkKKyAgICAgICAgICAtLWRlc2lyZWRfc3RvcF9wb3M7CisgICAgICAgIHN0b3AgPSBtaW4g KGN1cnJlbnRfcm93LT51c2VkW1RFWFRfQVJFQV0sIGRlc2lyZWRfc3RvcF9wb3MpOworICAgICAg ICBpID0gMDsKKyAgICAgICAgeCA9IGRlc2lyZWRfcm93LT54OworICAgICAgICBpbnQgY2xlYXJf dG9feCA9IDA7CisKKyAgICAgICAgLyogTG9vcCBvdmVyIGdseXBocyB0aGF0IGN1cnJlbnQgYW5k IGRlc2lyZWQgcm93IG1heSBoYXZlIGluIGNvbW1vbi4gKi8KKyAgICAgICAgd2hpbGUgKGkgPCBz dG9wKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGFycmF5X2dseXBoc19za2lwcGVkLnVzZWQg PSAwOworICAgICAgICAgICAgYm9vbCBjYW5fc2tpcF9wID0gIWFib3J0X3NraXBwaW5nOworICAg ICAgICAgICAgLyogU2tpcCBvdmVyIGdseXBocyB0aGF0IGJvdGggcm93cyBoYXZlIGluIGNvbW1v bi4gIFRoZXNlIGRvbid0IGhhdmUKKyAgICAgICAgICAgIHRvIGJlIHdyaXR0ZW4uICBXZSBjYW4n dCBza2lwIGlmIHRoZSBsYXN0IGN1cnJlbnQgZ2x5cGggb3ZlcmxhcHMgdGhlCisgICAgICAgICAg ICBnbHlwaCB0byBpdHMgcmlnaHQuICBGb3IgZXhhbXBsZSwgY29uc2lkZXIgYSBjdXJyZW50IHJv dyBvZiBgaWYnIHdpdGgKKyAgICAgICAgICAgIHRoZSBgZicgaW4gQ291cmllciBib2xkIHNvIHRo YXQgaXQgb3ZlcmxhcHMgdGhlIGAgJyB0byBpdHMgcmlnaHQuCisgICAgICAgICAgICBJZiB0aGUg ZGVzaXJlZCByb3cgaXMgYCAnLCB3ZSB3b3VsZCBza2lwIG92ZXIgdGhlIHNwYWNlIGFmdGVyIHRo ZQorICAgICAgICAgICAgYGlmJyBhbmQgdGhlcmUgd291bGQgcmVtYWluIGEgcGl4ZWwgZnJvbSB0 aGUgYGYnIG9uIHRoZSBzY3JlZW4uICovCisgICAgICAgICAgICBpZiAob3ZlcmxhcHBpbmdfZ2x5 cGhzX3AgJiYgaSA+IDApCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzdHJ1Y3Qg Z2x5cGggKmdseXBoID0gJmN1cnJlbnRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXVtpIC0gMV07Cisg ICAgICAgICAgICAgICAgaW50IGxlZnQsIHJpZ2h0OworICAgICAgICAgICAgICAgIHJpZi0+Z2V0 X2dseXBoX292ZXJoYW5ncyAoZ2x5cGgsIFhGUkFNRSAody0+ZnJhbWUpLCAmbGVmdCwgJnJpZ2h0 KTsKKyAgICAgICAgICAgICAgICBjYW5fc2tpcF9wID0gKHJpZ2h0ID09IDAgJiYgIWFib3J0X3Nr aXBwaW5nKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKGNhbl9za2lwX3ApCisg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpbnQgc3RhcnRfaHBvcyA9IGk7CisgICAg ICAgICAgICAgICAgd2hpbGUgKGkgPCBzdG9wCisgICAgICAgICAgICAgICAgICAgICAgICYmIEdM WVBIX0VRVUFMX1AgKGRlc2lyZWRfZ2x5cGgsIGN1cnJlbnRfZ2x5cGgpKQorICAgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgICArK2FycmF5X2dseXBoc19za2lwcGVkLnVzZWQ7 CisgICAgICAgICAgICAgICAgICAgIGlmIChhcnJheV9nbHlwaHNfc2tpcHBlZC5hbGxvY2F0ZWQg PCBhcnJheV9nbHlwaHNfc2tpcHBlZC51c2VkKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAgICAgICAgIGludCBvbGRfYWxsb2MgPSBhcnJheV9nbHlwaHNfc2tpcHBl ZC5hbGxvY2F0ZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgbmV3X2VsdHMgPSBhcnJh eV9nbHlwaHNfc2tpcHBlZC51c2VkIC0gYXJyYXlfZ2x5cGhzX3NraXBwZWQuYWxsb2NhdGVkOwor ICAgICAgICAgICAgICAgICAgICAgICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZCA9Cisg ICAgICAgICAgICAgICAgICAgICAgICAgIHhwYWxsb2MgKGFycmF5X2dseXBoc19za2lwcGVkLnNr aXBwZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZhcnJheV9nbHlwaHNf c2tpcHBlZC5hbGxvY2F0ZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5l d19lbHRzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJTlRfTUFYLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YgKmFycmF5X2dseXBoc19za2lw cGVkLnNraXBwZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgbWVtc2V0IChhcnJheV9nbHlw aHNfc2tpcHBlZC5za2lwcGVkICsgb2xkX2FsbG9jLCAwLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgKGFycmF5X2dseXBoc19za2lwcGVkLmFsbG9jYXRlZCAtIG9sZF9hbGxvYykK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBzaXplb2YgKmFycmF5X2dseXBo c19za2lwcGVkLnNraXBwZWQpOworICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAg ICAgICAgICAgaW50IG50aCA9IGFycmF5X2dseXBoc19za2lwcGVkLnVzZWQgLSAxOworICAgICAg ICAgICAgICAgICAgICBhcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVkW250aF0ueCA9IHg7Cisg ICAgICAgICAgICAgICAgICAgIGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbbnRoXS5ocG9z ID0gaTsKKyAgICAgICAgICAgICAgICAgICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZFtu dGhdLmVuYWJsZWRfcCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIHggKz0gZGVzaXJlZF9n bHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgICAgICAgICsrZGVzaXJlZF9nbHlwaCwg KytjdXJyZW50X2dseXBoLCArK2k7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAg ICAgLyogQ29uc2lkZXIgdGhlIGNhc2UgdGhhdCB0aGUgY3VycmVudCByb3cgY29udGFpbnMgInh4 eCBwcHAgZ2dnIiBpbgorICAgICAgICAgICAgICAgIGl0YWxpYyBDb3VyaWVyIGZvbnQsIGFuZCB0 aGUgZGVzaXJlZCByb3cgaXMgInh4eCBnZ2ciLiAgVGhlIGNoYXJhY3RlciBgcCcKKyAgICAgICAg ICAgICAgICBoYXMgbGJlYXJpbmcsIGBnJyBoYXMgbm90LiAgVGhlIGxvb3AgYWJvdmUgd2lsbCBz dG9wIGluIGZyb250IG9mIHRoZQorICAgICAgICAgICAgICAgIGZpcnN0IGBwJyBpbiB0aGUgY3Vy cmVudCByb3cuICBJZiB3ZSB3b3VsZCBzdGFydCB3cml0aW5nIGdseXBocyB0aGVyZSwgd2UKKyAg ICAgICAgICAgICAgICB3b3VsZG4ndCBlcmFzZSB0aGUgbGJlYXJpbmcgb2YgdGhlIGBwJy4gIFRo ZSByZXN0IG9mIHRoZSBsYmVhcmluZyBwcm9ibGVtCisgICAgICAgICAgICAgICAgaXMgdGhlbiB0 YWtlbiBjYXJlIG9mIGJ5IGRyYXdfZ2x5cGhzLiAqLworICAgICAgICAgICAgICAgIGlmIChvdmVy bGFwcGluZ19nbHlwaHNfcAorICAgICAgICAgICAgICAgICAgICAmJiBpID4gMAorICAgICAgICAg ICAgICAgICAgICAmJiBpIDwgY3VycmVudF9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAg ICAgICAgICAgICAmJiAoY3VycmVudF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAhPSBkZXNpcmVkX3Jv dy0+dXNlZFtURVhUX0FSRUFdKSkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg ICAgICAgaW50IGxlZnQsIHJpZ2h0OworICAgICAgICAgICAgICAgICAgICByaWYtPmdldF9nbHlw aF9vdmVyaGFuZ3MgKGN1cnJlbnRfZ2x5cGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg WEZSQU1FICh3LT5mcmFtZSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmxlZnQsICZy aWdodCk7CisgICAgICAgICAgICAgICAgICAgIHdoaWxlIChsZWZ0ID4gMCAmJiBpID4gMCkKKyAg ICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAtLWksIC0tZGVz aXJlZF9nbHlwaCwgLS1jdXJyZW50X2dseXBoOworICAgICAgICAgICAgICAgICAgICAgICAgeCAt PSBkZXNpcmVkX2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxl ZnQgLT0gZGVzaXJlZF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgICAgICAgICAvKiBBYm9ydCB0aGUgc2tpcHBpbmcgYWxnb3JpdGhtIGlm IHdlIGVuZCB1cCBiZWZvcmUKKyAgICAgICAgICAgICAgICAgICAgICAgb3VyIHN0YXJ0aW5nIHBv aW50LCB0byBhdm9pZCBsb29waW5nIChidWcjMTA3MCkuCisgICAgICAgICAgICAgICAgICAgICAg IFRoaXMgY2FuIGhhcHBlbiB3aGVuIHRoZSBsYmVhcmluZyBpcyBsYXJnZXIgdGhhbgorICAgICAg ICAgICAgICAgICAgICAgICB0aGUgcGl4ZWwgd2lkdGguICovCisgICAgICAgICAgICAgICAgICAg IGFib3J0X3NraXBwaW5nID0gKGkgPCBzdGFydF9ocG9zKTsKKyAgICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgLyogVHJ5IHRvIGF2b2lkIHdyaXRpbmcgdGhl IGVudGlyZSByZXN0IG9mIHRoZSBkZXNpcmVkIHJvdworICAgICAgICAgICAgICAgYnkgbG9va2lu ZyBmb3IgYSByZXN5bmMgcG9pbnQuICBUaGlzIG1haW5seSBwcmV2ZW50cworICAgICAgICAgICAg ICAgbW9kZSBsaW5lIGZsaWNrZXJpbmcgaW4gdGhlIGNhc2UgdGhlIG1vZGUgbGluZSBpcyBpbgor ICAgICAgICAgICAgICAgZml4ZWQtcGl0Y2ggZm9udCwgd2hpY2ggaXQgdXN1YWxseSB3aWxsIGJl LiAqLworICAgICAgICAgICAgaWYgKGkgPCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdKQor ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaW50IHN0YXJ0X3ggPSB4LCBzdGFydF9o cG9zID0gaTsKKyAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnN0YXJ0ID0gZGVzaXJlZF9n bHlwaDsKKyAgICAgICAgICAgICAgICBpbnQgY3VycmVudF94ID0geDsKKyAgICAgICAgICAgICAg ICBib29sIHNraXBfZmlyc3RfcCA9ICFjYW5fc2tpcF9wOworICAgICAgICAgICAgICAgIC8qIEZp bmQgdGhlIG5leHQgZ2x5cGggdGhhdCdzIGVxdWFsIGFnYWluLiAqLworICAgICAgICAgICAgICAg IHdoaWxlIChpIDwgc3RvcAorICAgICAgICAgICAgICAgICAgICAgICAmJiAoc2tpcF9maXJzdF9w CisgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAhR0xZUEhfRVFVQUxfUCAoZGVzaXJlZF9n bHlwaCwgY3VycmVudF9nbHlwaCkpCisgICAgICAgICAgICAgICAgICAgICAgICYmIHggPT0gY3Vy cmVudF94KQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB4ICs9IGRl c2lyZWRfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICAgICAgICBjdXJyZW50X3gg Kz0gY3VycmVudF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgICAgICAgICsrZGVz aXJlZF9nbHlwaCwgKytjdXJyZW50X2dseXBoLCArK2k7CisgICAgICAgICAgICAgICAgICAgIHNr aXBfZmlyc3RfcCA9IDA7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZm9y IChpbnQgZWx0ID0gMDsKKyAgICAgICAgICAgICAgICAgICAgIGVsdCA8IGFycmF5X2dseXBoc19z a2lwcGVkLnVzZWQ7CisgICAgICAgICAgICAgICAgICAgICArK2VsdCkKKyAgICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaW50IHggPSBhcnJheV9nbHlwaHNfc2tpcHBlZC5z a2lwcGVkW2VsdF0ueDsKKyAgICAgICAgICAgICAgICAgICAgaW50IGhwb3MgPSBhcnJheV9nbHlw aHNfc2tpcHBlZC5za2lwcGVkW2VsdF0uaHBvczsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0 IGdseXBoICp0YXJnZXRfZ2x5cGggPQorICAgICAgICAgICAgICAgICAgICAgIG1jX2dldF9jdXJz b3JfZ2x5cGggKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgaHBvcywgdnBvcyk7Cisg ICAgICAgICAgICAgICAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICAgICAgICAgICAgICAgIGZw cmludGYgKHN0ZGVyciwgIlNLSVBQRUQ6ICB2cG9zICglZCkgfCBjaGFyICglZC8lcykgfCB4OiAo JWQpIHwgaHBvcyAoJWQvJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgdnBvcywgdGFyZ2V0X2dseXBoLT51LmNoLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgbWNfY2hhcl90b19zdHJpbmcgKHRhcmdldF9nbHlwaC0+dS5jaCksCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4LCBocG9zLCB1cGRhdGVkX3Jv dy0+dXNlZFtURVhUX0FSRUFdIC0gMSk7CisgICAgICAgICAgICAgICAgICAgIG1jX2RyYXdfcm93 ICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9yb3csIHRhcmdldF9nbHlwaCwgeCwgMSwgdnBv cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2Vu dGlhbHMsIHJvd19wb3NpdGlvbiwgZHJhd19wLCBTS0lQUEVEKTsKKyAgICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgICAgICBpZiAoaSA9PSBzdGFydF9ocG9zIHx8IHggIT0gY3VycmVudF94 KQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpID0gc3RhcnRfaHBv czsKKyAgICAgICAgICAgICAgICAgICAgeCA9IHN0YXJ0X3g7CisgICAgICAgICAgICAgICAgICAg IGRlc2lyZWRfZ2x5cGggPSBzdGFydDsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAg ICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgb3V0cHV0X2N1cnNvcl90byAodywgdnBv cywgc3RhcnRfaHBvcywgZGVzaXJlZF9yb3ctPnksIHN0YXJ0X3gpOworICAgICAgICAgICAgICAg IC8qIFJlLWRyYXcgYSBwb3J0aW9uIG9mIHRoZSByb3cuICovCisgICAgICAgICAgICAgICAgaWYg KGRlYnVnX3ApCisgICAgICAgICAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJSRURSQVcgU0VH TUVOVDpcblwKKyAgICAgICAgICAgICAgICAgICAgdnBvcyAoJWQpIHwgY2hhciAoJWQvJXMpIHwg eDogKCVkKSB8IGhwb3MgKCVkLyVkKSB8IGxlbmd0aCAoJWQpXG4iLAorICAgICAgICAgICAgICAg ICAgICB2cG9zLCBzdGFydC0+dS5jaCwgbWNfY2hhcl90b19zdHJpbmcgKHN0YXJ0LT51LmNoKSwK KyAgICAgICAgICAgICAgICAgICAgc3RhcnRfeCwgc3RhcnRfaHBvcywgdXBkYXRlZF9yb3ctPnVz ZWRbVEVYVF9BUkVBXSAtIDEsIGkgLSBzdGFydF9ocG9zKTsKKyAgICAgICAgICAgICAgICBibG9j a19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgICBpbnQgbGVuID0gaSAtIHN0YXJ0X2hwb3M7Cisg ICAgICAgICAgICAgICAgaW50IGhwb3MgPSBzdGFydCAtIHVwZGF0ZWRfcm93LT5nbHlwaHNbVEVY VF9BUkVBXTsKKyAgICAgICAgICAgICAgICB3LT5vdXRwdXRfY3Vyc29yLnggPQorICAgICAgICAg ICAgICAgICAgbWNfZHJhd19nbHlwaHMgKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3Jvdywg dy0+bWNfbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPm91dHB1 dF9jdXJzb3IueCwgVEVYVF9BUkVBLCBocG9zLCBocG9zICsgbGVuLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIERSQVdfTk9STUFMX1RFWFQsIDAsIHZwb3MsIGxzbCwgZ2x5cGhf Zmxhdm9yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCB3 ZCwgZXNzZW50aWFscy5hY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBjdXJzb3JfZ2NfcCwgTUNfRFJBV19HTFlQSF9TVFJJTkcsIGRyYXdfcCk7CisgICAgICAgICAg ICAgICAgdy0+b3V0cHV0X2N1cnNvci5ocG9zICs9IGxlbjsKKyAgICAgICAgICAgICAgICB1bmJs b2NrX2lucHV0ICgpOworICAgICAgICAgICAgICAgIG1jX2RyYXdfcm93ICh3LCBkZXNpcmVkX21h dHJpeCwgdXBkYXRlZF9yb3csIHN0YXJ0LCBzdGFydF94LCBpIC0gc3RhcnRfaHBvcywKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgdnBvcywgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywg cm93X3Bvc2l0aW9uLCBkcmF3X3AsIFNDUklCRV9UV08pOworICAgICAgICAgICAgICAgIGNoYW5n ZWRfcCA9IDE7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICB9CisKKyAgICAgICAgLyogV3Jp dGUgdGhlIHJlc3QuICovCisgICAgICAgIGlmIChpIDwgZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9B UkVBXSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBvdXRwdXRfY3Vyc29yX3RvICh3LCB2cG9z LCBpLCBkZXNpcmVkX3Jvdy0+eSwgeCk7CisgICAgICAgICAgICBpZiAoZGVidWdfcCkKKyAgICAg ICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiRFJBVyBSRU1BSU5ERVIgT0YgVEhFIFJPVzpcblwK KyAgICAgICAgICAgICAgICB2cG9zICglZCkgfCBjaGFyICglZC8lcykgfCB4OiAoJWQpIHwgaHBv cyAoJWQvJWQpIHwgbGVuZ3RoICglZClcbiIsCisgICAgICAgICAgICAgICAgdnBvcywgZGVzaXJl ZF9nbHlwaC0+dS5jaCwgbWNfY2hhcl90b19zdHJpbmcgKGRlc2lyZWRfZ2x5cGgtPnUuY2gpLAor ICAgICAgICAgICAgICAgIHgsIGksIGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxLCBk ZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gaSk7CisgICAgICAgICAgICBibG9ja19pbnB1 dCAoKTsKKyAgICAgICAgICAgIGludCBsZW4gPSBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFd IC0gaTsKKyAgICAgICAgICAgIGludCBocG9zID0gZGVzaXJlZF9nbHlwaCAtIHVwZGF0ZWRfcm93 LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICAgIHctPm91dHB1dF9jdXJzb3IueCA9Cisg ICAgICAgICAgICAgIG1jX2RyYXdfZ2x5cGhzICh3LCBkZXNpcmVkX21hdHJpeCwgdXBkYXRlZF9y b3csIHctPm1jX21hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPm91dHB1 dF9jdXJzb3IueCwgVEVYVF9BUkVBLCBocG9zLCBocG9zICsgbGVuLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgRFJBV19OT1JNQUxfVEVYVCwgMCwgdnBvcywgbHNsLCBnbHlwaF9mbGF2 b3IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgd2QsIGVzc2Vu dGlhbHMuYWN0aXZlX3AsIGN1cnNvcl9nY19wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgTUNfRFJBV19HTFlQSF9TVFJJTkcsIGRyYXdfcCk7CisgICAgICAgICAgICB3LT5vdXRwdXRf Y3Vyc29yLmhwb3MgKz0gbGVuOworICAgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAg ICAgICAgIC8qIEZ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Ag ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVkX3Jvdywg aHBvcywgdnBvcyk7CisgICAgICAgICAgICAgIGlmICh3LT5vdXRwdXRfY3Vyc29yLnggPT0gdXBk YXRlZF9yb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgIHggLT0gc3RhcnQtPnBpeGVs X3dpZHRoOworICAgICAgICAgICAgICBpZiAoZGVidWdfcCkKKyAgICAgICAgICAgICAgICBmcHJp bnRmIChzdGRlcnIsICJQT1NULUNIQU5HRUQ6ICB2cG9zICglZCkgfCB4ICglZCkgfCBocG9zICgl ZC8lZCkgfCBjaGFyICglZC8lcylcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICB2cG9zLCB4LCBocG9zLCB1cGRhdGVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0LT51LmNoLCBtY19jaGFyX3RvX3N0cmlu ZyAoc3RhcnQtPnUuY2gpKTsKKyAgICAgICAgICAgICAgbWNfZHJhd19yb3cgKHcsIGRlc2lyZWRf bWF0cml4LCB1cGRhdGVkX3Jvdywgc3RhcnQsIHgsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICB1cGRhdGVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gaHBvcywgdnBvcywgY3Vyc29yX21hdHJp eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwg ZHJhd19wLCBQT1NUX0NIQU5HRUQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgLyogVGhl cmUgd2VyZSBubyBjaGFuZ2VzIGFuZCBpID09IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0g Ki8KKyAgICAgICAgICAgIGVsc2UgaWYgKCFjaGFuZ2VkX3ApCisgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICBpZiAoZGVidWdfcCkKKyAgICAgICAgICAgICAgICAgIGZwcmludGYgKHN0 ZGVyciwgIlVOQ0hBTkdFRCAtLSBXUklURSBFTlRJUkUgTElORTogIHZwb3MgKCVkKSB8IHJvdy0+ dXNlZCAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCB1 cGRhdGVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSk7CisgICAgICAgICAgICAgICAgbWNfZHJh d19yb3cgKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgZGVzaXJlZF9yb3ctPmdseXBo c1tURVhUX0FSRUFdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNpcmVkX3Jvdy0+ eCwgZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSwgdnBvcywKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBkcmF3 X3AsIFVOQ0hBTkdFRCk7CisgICAgICAgICAgICAgIH0KKworICAgICAgICAvKiBNYXliZSBjbGVh ciB0byBlbmQgb2YgbGluZS4gKi8KKyAgICAgICAgaWYgKE1BVFJJWF9ST1dfRVhURU5EU19GQUNF X1AgKGRlc2lyZWRfcm93KSkKKyAgICAgICAgICB7CisgICAgICAgICAgICAvKiBJZiBuZXcgcm93 IGV4dGVuZHMgdG8gdGhlIGVuZCBvZiB0aGUgdGV4dCBhcmVhLCBub3RoaW5nCisgICAgICAgICAg ICAgICBoYXMgdG8gYmUgY2xlYXJlZCwgaWYgYW5kIG9ubHkgaWYgd2UgZGlkIGEgd3JpdGVfZ2x5 cGhzCisgICAgICAgICAgICAgICBhYm92ZS4gIFRoaXMgaXMgbWFkZSBzdXJlIGJ5IHNldHRpbmcg ZGVzaXJlZF9zdG9wX3BvcworICAgICAgICAgICAgICAgYXBwcm9wcmlhdGVseSBhYm92ZS4gKi8K KyAgICAgICAgICAgIGVhc3NlcnQgKGkgPCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdCisg ICAgICAgICAgICAgICAgICAgICB8fCAoKGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gPT0g Y3VycmVudF9yb3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAm JiBNQVRSSVhfUk9XX0VYVEVORFNfRkFDRV9QIChjdXJyZW50X3JvdykpKTsKKyAgICAgICAgICB9 CisgICAgICAgICAgZWxzZSBpZiAoTUFUUklYX1JPV19FWFRFTkRTX0ZBQ0VfUCAoY3VycmVudF9y b3cpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBJZiBvbGQgcm93IGV4dGVuZHMg dG8gdGhlIGVuZCBvZiB0aGUgdGV4dCBhcmVhLCBjbGVhci4gKi8KKyAgICAgICAgICAgICAgaWYg KGkgPj0gZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICAgICAgICAgICAgICBvdXRw dXRfY3Vyc29yX3RvICh3LCB2cG9zLCBpLCBkZXNpcmVkX3Jvdy0+eSwgZGVzaXJlZF9yb3ctPnBp eGVsX3dpZHRoKTsKKyAgICAgICAgICAgICAgaWYgKGRyYXdfcCkKKyAgICAgICAgICAgICAgICBy aWYtPmNsZWFyX2VuZF9vZl9saW5lICh3LCB1cGRhdGVkX3JvdywgVEVYVF9BUkVBLCAtMSk7Cisg ICAgICAgICAgICAgIGNsZWFyX3RvX3ggPSAtMTsKKyAgICAgICAgICAgICAgY2hhbmdlZF9wID0g MTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKGRlc2lyZWRfcm93LT5waXhl bF93aWR0aCA8IGN1cnJlbnRfcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgIC8qIE90aGVyd2lzZSBjbGVhciB0byB0aGUgZW5kIG9mIHRoZSBvbGQgcm93 LiAgRXZlcnl0aGluZworICAgICAgICAgICAgICAgICAgIGFmdGVyIHRoYXQgcG9zaXRpb24gc2hv dWxkIGJlIGNsZWFyIGFscmVhZHkuICovCisgICAgICAgICAgICAgICAgaW50IHhsaW07CisgICAg ICAgICAgICAgICAgaWYgKGkgPj0gZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSkKKyAgICAg ICAgICAgICAgICAgIG91dHB1dF9jdXJzb3JfdG8gKHcsIHZwb3MsIGksIGRlc2lyZWRfcm93LT55 LCBkZXNpcmVkX3Jvdy0+cGl4ZWxfd2lkdGgpOworICAgICAgICAgICAgICAgIC8qIElmIGN1cnNv ciBpcyBkaXNwbGF5ZWQgYXQgdGhlIGVuZCBvZiB0aGUgbGluZSwgbWFrZSBzdXJlCisgICAgICAg ICAgICAgICAgICAgaXQncyBjbGVhcmVkLiAgTm93YWRheXMgd2UgZG9uJ3QgaGF2ZSBhIHBoeXNf Y3Vyc29yX2dseXBoCisgICAgICAgICAgICAgICAgICAgd2l0aCB3aGljaCB0byBlcmFzZSB0aGUg Y3Vyc29yIChiZWNhdXNlIHRoaXMgbWV0aG9kCisgICAgICAgICAgICAgICAgICAgZG9lc24ndCB3 b3JrIHdpdGggbGJlYXJpbmcvcmJlYXJpbmcpLCBzbyB3ZSBtdXN0IGRvIGl0IHRoaXMgd2F5LiAq LworICAgICAgICAgICAgICAgIGlmICh2cG9zID09IHctPnBoeXNfY3Vyc29yLnZwb3MKKyAgICAg ICAgICAgICAgICAgICAgJiYgKGRlc2lyZWRfcm93LT5yZXZlcnNlZF9wCisgICAgICAgICAgICAg ICAgICAgICAgICA/ICh3LT5waHlzX2N1cnNvci5ocG9zIDwgMCkKKyAgICAgICAgICAgICAgICAg ICAgICAgIDogKHctPnBoeXNfY3Vyc29yLmhwb3MgPj0gZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9B UkVBXSkpKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB3LT5waHlz X2N1cnNvcl9vbl9wID0gMDsKKyAgICAgICAgICAgICAgICAgICAgeGxpbSA9IC0xOworICAgICAg ICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAg ICB4bGltID0gY3VycmVudF9yb3ctPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICAgIGlmIChk cmF3X3ApCisgICAgICAgICAgICAgICAgICByaWYtPmNsZWFyX2VuZF9vZl9saW5lICh3LCB1cGRh dGVkX3JvdywgVEVYVF9BUkVBLCB4bGltKTsKKyAgICAgICAgICAgICAgICBjbGVhcl90b194ID0g eGxpbTsKKyAgICAgICAgICAgICAgICBjaGFuZ2VkX3AgPSAxOworICAgICAgICAgICAgICB9CisK KyAgICAgICAgaWYgKGNoYW5nZWRfcAorICAgICAgICAgICAgJiYgY2xlYXJfdG9feCAhPSAwKQor ICAgICAgICAgIHsKKyAgICAgICAgICAgIGludCB0ZXh0X2FyZWFfd2lkdGggPSB3aW5kb3dfYm94 X3dpZHRoICh3LCBURVhUX0FSRUEpOworICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBkZWJ1Z19m ZyA9IHsucmVkID0gMC44NjcsIC5ncmVlbiA9IDAuODY3LCAuYmx1ZSA9IDAuODY3fTsKKyAgICAg ICAgICAgIHN0cnVjdCBnbHlwaCAqdGFyZ2V0X2dseXBoID0KKyAgICAgICAgICAgICAgdXBkYXRl ZF9yb3ctPmdseXBoc1tURVhUX0FSRUFdICsgdXBkYXRlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAt IDE7CisgICAgICAgICAgICAvKiBgbWNfZW5naW5lJyBvbmx5IGRyYXdzIGFuIE1DX0dMWVBIIHdo ZW4geCA8IHVwZGF0ZWRfcm93LT5waXhlbF93aWR0aC4KKyAgICAgICAgICAgIFRoZSBjdXJyZW50 IGRlc2lnbiBpbmhpYml0cyBkcmF3aW5nIG92ZXIgYW4gZXhpc3RpbmcgZ2x5cGggYXQgdGhlIGVu ZCBvZiBhCisgICAgICAgICAgICB3b3JkLXdyYXBwZWQgbGluZS4gIFNhaWQgZ2x5cGggcmVjZWl2 ZXMgYSBmYWtlIGN1cnNvciBpbiBlaXRoZXIgb25lIG9mIHRoZQorICAgICAgICAgICAgcHJldmlv dXMgc2VjdGlvbnMgYWJvdmUsIGFuZCBzaG91bGQgbm90IGJlIG92ZXJ3cml0dGVuIHdpdGggYW5v dGhlciBvbmUuCisgICAgICAgICAgICBUaGlzIGRlc2lnbiBpcyBuZWVkZWQgYmVjYXVzZSBhIHdv cmQtd3JhcHBlZCBsaW5lIGRvZXMgbm90IHJlY2VpdmUgYW4gZXh0cmEKKyAgICAgICAgICAgIHNw YWNlIGxpa2Ugbm9uLXdvcmQtd3JhcHBlZCBsaW5lcyBkby4gKi8KKyAgICAgICAgICAgIGludCB4 ID0gdXBkYXRlZF9yb3ctPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgaW50IGhwb3MgPSB1cGRh dGVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gMTsKKyAgICAgICAgICAgIGludCB4X2xpbWl0ID0g KGNsZWFyX3RvX3ggPT0gLTEpCisgICAgICAgICAgICAgICAgICAgICAgICAgID8gdGV4dF9hcmVh X3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgIDogY2xlYXJfdG9feDsKKyAgICAgICAg ICAgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSICh3LT5jb250ZW50cyk7CisgICAgICAgICAg ICBib29sIGZpbGxfY29sdW1uX3RydW1wc19wID0gKCFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNh bF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFO SUxQIChCVkFSIChiLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gZXNzZW50aWFscy5mY194KTsKKyAgICAgICAg ICAgIGlmIChtY19zdGRlcnJfcCkKKyAgICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNf dXBkYXRlX3RleHRfYXJlYSAoZmxvYXRpbmcpOiAgdnBvcyAoJWQpIHwgeF9saW1pdCAoJWQpXG4i LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZwb3MsIHhfbGltaXQpOworICAgICAg ICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICYmICFOSUxQ IChCVkFSIChiLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAgICAgICAmJiAoZXNzZW50aWFscy5h Y3RpdmVfcAorICAgICAgICAgICAgICAgICAgICB8fCAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAg ICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBmY19pbmFjdGl2ZV93aW5k b3dzKSkpKQorICAgICAgICAgICAgICAgICYmIHggPCB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAg ICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPj0geAorICAgICAgICAgICAgICAgICYmIHRhcmdl dF9nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICAgICAgJiYgZHJhd19wKQorICAgICAgICAgICAg ICBtY19lbmdpbmUgKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBo LCBURVhUX0FSRUEsCisgICAgICAgICAgICAgICAgICAgICAgICAgeCwgeF9saW1pdCwgdXBkYXRl ZF9yb3ctPnksIGhwb3MsIHZwb3MsIE1DX0JBUiwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sCisgICAgICAgICAgICAg ICAgICAgICAgICAgZGVidWdfcCA/IGRlYnVnX2ZnIDogZXNzZW50aWFscy5mY19mZ1tyb3dfcG9z aXRpb25dLAorICAgICAgICAgICAgICAgICAgICAgICAgIEZJTExfQ09MVU1OLCBkcmF3X3AsIE5P V0hFUkUsIE5PX0NBQ0hFKTsKKyAgICAgICAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykK KyAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAg ICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2hvcml6b250YWxfcnVsZXIpKQorICAgICAg ICAgICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgIHx8 ICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAg KEJWQVIgKGIsIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkpCisgICAgICAgICAgICAgICAgJiYgeCA8 IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZw b3MKKyAgICAgICAgICAgICAgICAmJiB0YXJnZXRfZ2x5cGggIT0gTlVMTAorICAgICAgICAgICAg ICAgICYmIGRyYXdfcCkKKyAgICAgICAgICAgICAgbWNfZW5naW5lICh3LCBkZXNpcmVkX21hdHJp eCwgdXBkYXRlZF9yb3csIHRhcmdldF9nbHlwaCwgVEVYVF9BUkVBLAorICAgICAgICAgICAgICAg ICAgICAgICAgIHgsIHhfbGltaXQsIHVwZGF0ZWRfcm93LT55LCBocG9zLCB2cG9zLCBNQ19IQkFS LCAxLAorICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMs IHJvd19wb3NpdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBkZWJ1Z19wID8gZGVidWdf ZmcgOiBlc3NlbnRpYWxzLmNoX2ZnW3Jvd19wb3NpdGlvbl0sCisgICAgICAgICAgICAgICAgICAg ICAgICAgSE9SSVpPTlRBTF9SVUxFUiwgZHJhd19wLCBOT1dIRVJFLCBOT19DQUNIRSk7CisgICAg ICAgICAgICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgJiYgIU5J TFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFS IChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgJiYgKGVzc2VudGlhbHMu YWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisg ICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfaW5hY3RpdmVfd2lu ZG93cykpKSkKKyAgICAgICAgICAgICAgICAmJiAhZmlsbF9jb2x1bW5fdHJ1bXBzX3AKKyAgICAg ICAgICAgICAgICAmJiB4IDwgdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgJiYgdnBv cyAhPSB3LT5jdXJzb3IudnBvcworICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHgK KyAgICAgICAgICAgICAgICAmJiB0YXJnZXRfZ2x5cGggIT0gTlVMTAorICAgICAgICAgICAgICAg ICYmIGRyYXdfcCkKKyAgICAgICAgICAgICAgbWNfZW5naW5lICh3LCBkZXNpcmVkX21hdHJpeCwg dXBkYXRlZF9yb3csIHRhcmdldF9nbHlwaCwgVEVYVF9BUkVBLAorICAgICAgICAgICAgICAgICAg ICAgICAgIHgsIHhfbGltaXQsIHVwZGF0ZWRfcm93LT55LCBocG9zLCB2cG9zLCBNQ19CQVIsIDEs CisgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93 X3Bvc2l0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgIGRlYnVnX3AgPyBkZWJ1Z19mZyA6 IGVzc2VudGlhb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gICBj dXJyZW50X3Jvdy0+cmVkcmF3X2ZyaW5nZV9iaXRtYXBzX3AgPSAxOworICAgICAgICB9CisgICAg ICBib29sIHVwZGF0ZWRfcCA9IG1jX3VwZGF0ZV90ZXh0X2FyZWEgKHcsIGRlc2lyZWRfcm93LCB2 cG9zLCBjdXJzb3JfbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBlc3NlbnRpYWxzLCBkcmF3X3ApOworICAgICAgLyogVXBkYXRlIHRoZSBkaXNwbGF5 IG9mIHRoZSB0ZXh0IGFyZWEuICovCisgICAgICBpZiAodXBkYXRlZF9wKQorICAgICAgICB7Cisg ICAgICAgICAgY2hhbmdlZF9wID0gMTsKKyAgICAgICAgICBpZiAoY3VycmVudF9yb3ctPm1vdXNl X2ZhY2VfcCkKKyAgICAgICAgICAgICptb3VzZV9mYWNlX292ZXJ3cml0dGVuX3AgPSAxOworICAg ICAgICB9CisgICAgICAvKiBVcGRhdGUgZGlzcGxheSBvZiB0aGUgcmlnaHQgbWFyZ2luIGFyZWEs IGlmIHRoZXJlIGlzIG9uZS4gKi8KKyAgICAgIGlmICghZGVzaXJlZF9yb3ctPmZ1bGxfd2lkdGhf cCAmJiB3LT5yaWdodF9tYXJnaW5fY29scyA+IDApCisgICAgICAgIHsKKyAgICAgICAgICBjaGFu Z2VkX3AgPSAxOworICAgICAgICAgIHVwZGF0ZV9tYXJnaW5hbF9hcmVhICh3LCBkZXNpcmVkX3Jv dywgUklHSFRfTUFSR0lOX0FSRUEsIHZwb3MpOworICAgICAgICB9CisgICAgICAvKiBEcmF3IHRy dW5jYXRpb24gbWFya3MgZXRjLiAqLworICAgICAgaWYgKCFjdXJyZW50X3Jvdy0+ZW5hYmxlZF9w CisgICAgICAgICAgfHwgZGVzaXJlZF9yb3ctPnkgIT0gY3VycmVudF9yb3ctPnkKKyAgICAgICAg ICB8fCBkZXNpcmVkX3Jvdy0+dmlzaWJsZV9oZWlnaHQgIT0gY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eCkKK3sKKyAg Ym9vbCBkZWJ1Z19wID0gZmFsc2U7CisgIGJvb2wgZ29fb25lX3AgPSAob2xkX21hdHJpeC5jdXJz b3JzX3VzZWRbTUNfQ0FDSEVdID4gMAorICAgICAgICAgICAgICAgICAgIHx8IG9sZF9tYXRyaXgu Y3Vyc29yc191c2VkW0NIX0NBQ0hFXSA+IDAKKyAgICAgICAgICAgICAgICAgICB8fCBvbGRfbWF0 cml4LmN1cnNvcnNfdXNlZFtGQ19DQUNIRV0gPiAwKTsKKyAgYm9vbCBnb190d29fcCA9IChCVUZG RVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICAmJiAoIU5JTFAgKEJWQVIgKFhC VUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAg IHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQorICAg ICAgICAgICAgICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMp LCBtY19jb25mKSkpKTsKKyAgYm9vbCB1cGRhdGluZ19mcmFtZV9wID0gZmFsc2U7CisgIHN0cnVj dCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBpZiAoWEZSQU1FICh3LT5mcmFtZSkg IT0gZi0+bWNfdXBkYXRpbmdfZnJhbWUKKyAgICAgICYmIChnb19vbmVfcCB8fCBnb190d29fcCkp CisgICAgeworICAgICAgdXBkYXRpbmdfZnJhbWVfcCA9IHRydWU7CisgICAgICB1cGRhdGVfYmVn aW4gKGYpOworICAgIH0KKyAgaWYgKHctPnBoeXNfY3Vyc29yX29uX3AKKyAgICAgICYmIGdvX3R3 b19wKQorICAgIGVyYXNlX3BoeXNfY3Vyc29yICh3KTsKKyAgZm9yIChpbnQgdm50aCA9IDA7Cisg ICAgICAgZ29fb25lX3AKKyAgICAgICAmJiB2bnRoIDwgdy0+bWNfbWF0cml4LnZwb3NfdXNlZDsK KyAgICAgICArK3ZudGgpCisgICAgeworICAgICAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2Fj aGVfdHlwZSA9IE1DX0NBQ0hFOworICAgICAgICAgICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7Cisg ICAgICAgICAgICsrY2FjaGVfdHlwZSkKKyAgICAgICAgZm9yIChpbnQgbnRoXzAgPSAwOworICAg ICAgICAgICAgIG1jX3RyYXZlcnNlX2NhY2hlX3AgKG9sZF9tYXRyaXgsIGNhY2hlX3R5cGUsIHZu dGgsIG50aF8wKTsKKyAgICAgICAgICAgICArK250aF8wKQorICAgICAgICAgIHsKKyAgICAgICAg ICAgIGJvb2wgc2FtZV9wID0gZmFsc2U7CisgICAgICAgICAgICBmb3IgKGludCB3X250aCA9IDA7 IHdfbnRoIDwgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXTsg Kyt3X250aCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNhbWVfcCB8PSAob2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC50eXBlCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC50eXBlCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiAoKG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0u Z2x5cGguYnl0ZXBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGguYnl0ZXBvcykK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAob2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5yb3dfcG9zaXRpb24gPT0gQVRfWlYKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bd19udGhdLnJvd19wb3NpdGlvbiA9PSBBVF9aVikKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICB8fCAob2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8wXS5yb3dfcG9zaXRpb24gPT0gUE9TVF9aVgorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVt3X250aF0ucm93X3Bvc2l0aW9uID09IFBPU1RfWlYpKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgKChvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XzBdLmdseXBoLmNoYXJwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLmNoYXJw b3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKG9sZF9tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0ucm93X3Bvc2l0aW9uID09IEFUX1pWCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5yb3dfcG9zaXRpb24gPT0gQVRfWlYpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgfHwgKG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMF0ucm93X3Bvc2l0aW9uID09IFBPU1RfWlYKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bd19udGhdLnJvd19wb3NpdGlvbiA9PSBQT1NUX1pWKSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhfMF0uZ2x5cGgudS52YWwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnUudmFsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLmZhY2VfaWQKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhd LmdseXBoLmZhY2VfaWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGgucGFkZGluZ19wCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5wYWRkaW5nX3AKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0u Z2x5cGgubGVmdF9ib3hfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5sZWZ0 X2JveF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGgucmlnaHRfYm94X2xpbmVfcAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgucmlnaHRfYm94X2xpbmVfcAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS5nbHlwaC52b2Zmc2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09 IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC52 b2Zmc2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnBpeGVsX3dpZHRoCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW3dfbnRoXS5nbHlwaC5waXhlbF93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlw aC5zbGljZS5pbWcueAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGguc2xpY2UuaW1nLngK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGguc2xpY2UuaW1nLnkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b d19udGhdLmdseXBoLnNsaWNlLmltZy55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnNsaWNl LmltZy53aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGguc2xpY2UuaW1nLndpZHRo CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnNsaWNlLmltZy5oZWlnaHQKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bd19udGhdLmdseXBoLnNsaWNlLmltZy5oZWlnaHQKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0u Z2x5cGguc2xpY2UuY21wLmZyb20KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnNsaWNl LmNtcC5mcm9tCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLngKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhd LngKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZngKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmZ4Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXzBdLnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLnkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMF0uZnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmZ5CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXzBdLmhwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmhwb3MKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhfMF0udnBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0udnBvcworICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8wXS53ZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0ud2QKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0u aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uaAorICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5jdXJzb3Jf dHlwZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uY3Vyc29yX3R5cGUKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhfMF0uY3Vyc29yX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5jdXJzb3Jfd2lkdGgK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMF0uZmcucmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5mZy5y ZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZmcuZ3JlZW4KKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhd LmZnLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZnLmJsdWUKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b d19udGhdLmZnLmJsdWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uYmcucmVkCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW3dfbnRoXS5iZy5yZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uYmcuZ3JlZW4KKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bd19udGhdLmJnLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmJnLmJsdWUKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bd19udGhdLmJnLmJsdWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uYWN0aXZl X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBd LmdseXBoX2ZsYXZvcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGhfZmxhdm9yCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzBdLmVuYWJsZWRfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9 PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZW5hYmxl ZF9wKTsKKyAgICAgICAgICAgICAgICBpZiAoc2FtZV9wKQorICAgICAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgICAgICBpZiAoZGVidWdfcCkKKyAgICAgICAgICAgICAgICAgICAgICBm cHJpbnRmIChzdGRlcnIsICJISVQgKCVzKTogIHZwb3MgKCVkKSB8IGhwb3MgKCVkKSB8IGNoYXIg KCVzKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjYWNoZV90 eXBlID09IE1DX0NBQ0hFKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/ICJNQyIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGNhY2hl X3R5cGUgPT0gQ0hfQ0FDSEUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID8gIkNIIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY2Fj aGVfdHlwZSA9PSBGQ19DQUNIRSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyAiRkMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICJO TyIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0udnBvcywKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3dfbnRoXS5ocG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgbWNfY2hhcl90b19zdHJpbmcgKHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3dfbnRoXS5nbHlwaC51LmNoKSk7CisgICAgICAgICAgICAgICAgICAgIHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5zYW1lX3AgPSB0cnVl OworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAg ICAgICAgICAgICAgIGVsc2UgaWYgKGRlYnVnX3ApCisgICAgICAgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICAgICAgICBpbnQgb2xkX2NhY2hlX3VzZWQgPSBvbGRfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXTsKKyAgICAgICAgICAgICAgICAgICAgICBpbnQg bmV3X2NhY2hlX3VzZWQgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hl X3R5cGVdOworICAgICAgICAgICAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIk1JU1MgKCVz KTogIHZwb3MgKCVkKSB8IGhwb3MgKCVkIHYuICVkKSB8IGNoYXIgKCVzIHYuICVzKSB8IGNhY2hl X3VzZWQgKCVkIHYuICVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIChjYWNoZV90eXBlID09IE1DX0NBQ0hFKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/ICJNQyIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogKGNhY2hlX3R5cGUgPT0gQ0hfQ0FDSEUpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gIkNIIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAoY2FjaGVfdHlwZSA9PSBGQ19DQUNIRSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyAiRkMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6ICJOTyIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0udnBvcywKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uaHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W3dfbnRoXS5ocG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWNf Y2hhcl90b19zdHJpbmcgKG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhfMF0uZ2x5cGgudS5jaCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBtY19jaGFyX3RvX3N0cmluZyAody0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bd19udGhdLmdseXBoLnUuY2gpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgb2xkX2NhY2hlX3VzZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBuZXdfY2FjaGVfdXNlZCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgaWYgKCFzYW1lX3ApCisgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAvKiBgbWF0cml4X3JvdycgaW4gYGRpc3BuZXcuY2AgY29udGFpbnMgdGhlIGZv bGxvd2luZyB0ZXN0cywKKyAgICAgICAgICAgICAgICBlYXNzZXJ0IChtYXRyaXggJiYgbWF0cml4 LT5yb3dzKTsKKyAgICAgICAgICAgICAgICBlYXNzZXJ0IChyb3cgPj0gMCAmJiByb3cgPCBtYXRy aXgtPm5yb3dzKTsgKi8KKyAgICAgICAgICAgICAgICBib29sIGJhcmZfY3Jhc2hfb25lID0gKHct PmN1cnJlbnRfbWF0cml4ICYmIHctPmN1cnJlbnRfbWF0cml4LT5yb3dzKSA/IGZhbHNlIDogdHJ1 ZTsKKyAgICAgICAgICAgICAgICBpZiAoYmFyZl9jcmFzaF9vbmUpCisgICAgICAgICAgICAgICAg ICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICBib29sIGJhcmZfY3Jhc2hfdHdvID0gKHZudGgg Pj0gMCAmJiB2bnRoIDwgdy0+Y3VycmVudF9tYXRyaXgtPm5yb3dzKSA/IGZhbHNlIDogdHJ1ZTsK KyAgICAgICAgICAgICAgICBpZiAoYmFyZl9jcmFzaF90d28pCisgICAgICAgICAgICAgICAgICBj b250aW51ZTsKKyAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICp2bnRoX3JvdyA9IE1B VFJJWF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB2bnRoKTsKKyAgICAgICAgICAgICAgICBpbnQg eF8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS54Owor ICAgICAgICAgICAgICAgIGludCBmeF8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8wXS5meDsKKyAgICAgICAgICAgICAgICBpbnQgeV8wID0gb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS55OworICAgICAgICAgICAgICAg IGludCBmeV8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8w XS5meTsKKyAgICAgICAgICAgICAgICBpbnQgaHBvc18wID0gb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5ocG9zOworICAgICAgICAgICAgICAgIGludCB2cG9z XzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLnZwb3M7 CisgICAgICAgICAgICAgICAgaW50IHdkXzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXzBdLndkOworICAgICAgICAgICAgICAgIGludCBoXzAgPSBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmg7CisgICAgICAgICAgICAg ICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZV8wID0gb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5jdXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAg ICBpbnQgY3Vyc29yX3dpZHRoXzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXzBdLmN1cnNvcl93aWR0aDsKKyAgICAgICAgICAgICAgICAvLyAgc3RydWN0IG1j X1JHQiBsc2xfZmdfMCA9IHsucmVkID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8wXS5mZy5yZWQsCisgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAg ICAgICAgICAgICAgLmdyZWVuID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS5mZy5ncmVlbiwKKyAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAuYmx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMF0uZmcuYmx1ZX07CisgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfYmdf MCA9IHsucmVkID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8w XS5iZy5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3Jl ZW4gPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmJnLmdy ZWVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmJnLmJsdWV9Owor ICAgICAgICAgICAgICAgIGJvb2wgYWN0aXZlX3BfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMF0uYWN0aXZlX3A7CisgICAgICAgICAgICAgICAgZW51bSBt Y19mbGF2b3IgZ2x5cGhfZmxhdm9yXzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzBdLmdseXBoX2ZsYXZvcjsKKyAgICAgICAgICAgICAgICBib29sIGVuYWJs ZWRfcF8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5l bmFibGVkX3A7CisgICAgICAgICAgICAgICAgaWYgKHZwb3NfMCA9PSB2bnRoCisgICAgICAgICAg ICAgICAgICAgICYmIGdseXBoX2ZsYXZvcl8wID09IE1DX0dMWVBICisgICAgICAgICAgICAgICAg ICAgICYmIGVuYWJsZWRfcF8wCisgICAgICAgICAgICAgICAgICAgICYmIHZudGhfcm93LT5lbmFi bGVkX3ApCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIG1jX2VyYXNl X2N1cnNvciAodywgdy0+Y3VycmVudF9tYXRyaXgsIHZudGhfcm93LCBvbGRfbWF0cml4LAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHhfMCwgeV8wLCBocG9zXzAsIHZwb3Nf MCwgZ2x5cGhfZmxhdm9yXzAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg Y3Vyc29yX3R5cGVfMCwgd2RfMCk7CisgICAgICAgICAgICAgICAgICAgIG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZW5hYmxlZF9wID0gZmFsc2U7CisgICAg ICAgICAgICAgICAgICAgIC0tb2xkX21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVfdHlwZV07Cisg ICAgICAgICAgICAgICAgICAgIC8qIElmIHdlIGluYWR2ZXJ0ZW50bHkgZXJhc2VkIGFub3RoZXIg ZmFrZSBjdXJzb3IgYXQgdGhlIHNhbWUKKyAgICAgICAgICAgICAgICAgICAgSFBPUyB0aGF0IGlz IHN0aWxsIGVuYWJsZWRfcCBpbiB0aGUgYG9sZF9tYXRyaXhgLCB0aGVuIHJlZHJhdyBpdC4gKi8K KyAgICAgICAgICAgICAgICAgICAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9 IE1DX0NBQ0hFOworICAgICAgICAgICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUgPCBOT19DQUNI RTsKKyAgICAgICAgICAgICAgICAgICAgICAgICArK2NhY2hlX3R5cGUpCisgICAgICAgICAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgbnRoXzEgPSAwOwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtY190cmF2ZXJzZV9jYWNoZV9wIChvbGRfbWF0 cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGhfMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICsrbnRoXzEpCisgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICBpbnQgeF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8xXS54OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmeF8xID0g b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5meDsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICBpbnQgeV8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8xXS55OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlu dCBmeV8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5m eTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaHBvc18xID0gb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5ocG9zOworICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGludCB2cG9zXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzFdLnZwb3M7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHdk XzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLndkOwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBoXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmg7CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZV8xID0gb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5jdXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICBpbnQgY3Vyc29yX3dpZHRoXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmN1cnNvcl93aWR0aDsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZ18xID0gey5yZWQgPSBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmZnLnJlZCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZmcuZ3JlZW4sCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IG9s ZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZmcuYmx1ZX07Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIHN0cnVjdCBtY19SR0IgbHNsX2JnXzEgPSB7 LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uYmcu cmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAg ICAgICAgIC5ncmVlbiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhfMV0uYmcuZ3JlZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAg ICAgICAgICAgICAgICAgICAgLmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzFdLmJnLmJsdWV9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJv b2wgYWN0aXZlX3BfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhfMV0uYWN0aXZlX3A7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19mbGF2 b3IgZ2x5cGhfZmxhdm9yXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXzFdLmdseXBoX2ZsYXZvcjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29s IGVuYWJsZWRfcF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8xXS5lbmFibGVkX3A7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBnb19wXzEg PSAoaHBvc18wID09IGhwb3NfMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIGVuYWJsZWRfcF8xKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAo IWdvX3BfMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGJvb2wgcmVtb3ZlX3BfMSA9IGZhbHNlOworICAgICAgICAg ICAgICAgICAgICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCB3LT5jdXJyZW50X21h dHJpeCwgdm50aF9yb3csIHhfMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgZnhfMSwgeV8xLCBmeV8xLCBocG9zXzEsIHZwb3NfMSwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2RfMSwgaF8xLCBjdXJz b3JfdHlwZV8xLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBjdXJzb3Jfd2lkdGhfMSwgbHNsX2ZnXzEsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2ZV9wXzEsIGdseXBoX2ZsYXZvcl8xLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVfcF8x KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHZwb3NfMCA9 PSB2bnRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3BfMAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgdm50aF9yb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGJvb2wgcmVtb3ZlX3BfMCA9IHRydWU7 CisgICAgICAgICAgICAgICAgICAgICAgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHcsIHctPmN1cnJl bnRfbWF0cml4LCB2bnRoX3JvdywgeF8wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBmeF8wLCB5XzAsIGZ5XzAsIGhwb3NfMCwgdnBvc18wLCB3ZF8wLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoXzAsIGN1cnNvcl90eXBl XzAsIGN1cnNvcl93aWR0aF8wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBsc2xfYmdfMCwgYWN0aXZlX3BfMCwgZ2x5cGhfZmxhdm9yXzAsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZV9wXzApOworICAgICAgICAg ICAgICAgICAgICAgIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhf MF0uZW5hYmxlZF9wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgLS1vbGRfbWF0cml4 LmN1cnNvcnNfdXNlZFtjYWNoZV90eXBlXTsKKyAgICAgICAgICAgICAgICAgICAgICAvKiBJZiB3 ZSBpbmFkdmVydGVudGx5IGVyYXNlZCBhbm90aGVyIGZha2UgY3Vyc29yIGF0IHRoZSBzYW1lCisg ICAgICAgICAgICAgICAgICAgICAgSFBPUyB0aGF0IGlzIHN0aWxsIGVuYWJsZWRfcCBpbiB0aGUg YG9sZF9tYXRyaXhgLCB0aGVuIHJlZHJhdyBpdC4gKi8KKyAgICAgICAgICAgICAgICAgICAgICBm b3IgKGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7CisgICAgICAgICAg ICAgICAgICAgICAgICAgICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICArK2NhY2hlX3R5cGUpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IG50aF8yID0gMDsKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBtY190cmF2ZXJzZV9jYWNoZV9wIChvbGRfbWF0cml4LCBjYWNoZV90 eXBlLCB2bnRoLCBudGhfMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKytudGhf MikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBpbnQgeF8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF8yXS54OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZ4XzIgPSBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmZ4OworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgaW50IHlfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMl0ueTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlu dCBmeV8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5m eTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBocG9zXzIgPSBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmhwb3M7CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBpbnQgdnBvc18yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF8yXS52cG9zOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg aW50IHdkXzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJd LndkOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGhfMiA9IG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uaDsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGVfMiA9IG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uY3Vyc29yX3R5cGU7CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY3Vyc29yX3dpZHRoXzIgPSBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmN1cnNvcl93aWR0aDsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnXzIgPSB7LnJlZCA9 IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uZmcucmVkLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAu Z3JlZW4gPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmZn LmdyZWVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAuYmx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhfMl0uZmcuYmx1ZX07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgc3RydWN0 IG1jX1JHQiBsc2xfYmdfMiA9IHsucmVkID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8yXS5iZy5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAv LyAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmJnLmdyZWVuLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmJnLmJsdWV9OworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBhY3RpdmVfcF8yID0gb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5hY3RpdmVfcDsKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvcl8yID0gb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5nbHlwaF9mbGF2b3I7CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGVuYWJsZWRfcF8yID0gb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5lbmFibGVkX3A7CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBib29sIGdvX3BfMiA9IChocG9zXzAgPT0gaHBvc18yCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBmeF8wIDw9IGZ4XzIK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGZ4XzAgKyB3 ZF8wID4gZnhfMiArIHdkXzIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIGVuYWJsZWRfcF8yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlm ICghZ29fcF8yKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgcmVtb3ZlX3BfMiA9IGZhbHNlOworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHcsIHctPmN1 cnJlbnRfbWF0cml4LCB2bnRoX3JvdywgeF8yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGZ4XzIsIHlfMiwgZnlfMiwgaHBvc18yLCB2cG9zXzIs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2Rf MiwgaF8yLCBjdXJzb3JfdHlwZV8yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aF8yLCBsc2xfZmdfMiwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVfcF8yLCBnbHlw aF9mbGF2b3JfMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICByZW1vdmVfcF8yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAg ICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAg ICAgfQorICAgICAgICAgICAgfQorICA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ICsgV0lORE9XX1NDUk9MTF9CQVJfQVJFQV9I RUlHSFQgKHcpOworICAgICAgICAgIHVwZGF0ZV93aW5kb3dfbGluZSAodywgTUFUUklYX1JPV19W UE9TIChtb2RlX2xpbmVfcm93LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBkZXNpcmVkX21hdHJpeCksCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wKTsKKyAgICAgICAgfQorCisgICAgICAvKiBG aW5kIGZpcnN0IGVuYWJsZWQgcm93LiAgT3B0aW1pemF0aW9ucyBpbiByZWRpc3BsYXlfaW50ZXJu YWwKKyAgICAgICAgIG1heSBsZWFkIHRvIGFuIHVwZGF0ZSB3aXRoIG9ubHkgb25lIHJvdyBlbmFi bGVkLiAgVGhlcmUgbWF5CisgICAgICAgICBiZSBhbHNvIGNvbXBsZXRlbHkgZW1wdHkgbWF0cmlj ZXMuICovCisgICAgICB3aGlsZSAocm93IDwgZW5kICYmICFyb3ctPmVuYWJsZWRfcCkKKyAgICAg ICAgKytyb3c7CisKKyAgICAgIC8qIFRyeSByZXVzaW5nIHBhcnQgb2YgdGhlIGRpc3BsYXkgYnkg Y29weWluZy4gKi8KKyAgICAgIGlmIChyb3cgPCBlbmQgJiYgIXctPmRlc2lyZWRfbWF0cml4LT5u b19zY3JvbGxpbmdfcCkKKyAgICAgICAgeworICAgICAgICAgIGludCByYyA9IG1jX3Njcm9sbGlu Z193aW5kb3cgKHcsIGhlYWRlcl9saW5lX3JvdyAhPSBOVUxMKTsKKyAgICAgICAgICBpZiAocmMg PCAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBBbGwgcm93cyB3ZXJlIGZvdW5k IHRvIGJlIGVxdWFsLiAqLworICAgICAgICAgICAgICBwYXVzZWRfcCA9IDA7CisgICAgICAgICAg ICAgIGdvdG8gc2V0X2N1cnNvcjsKKyAgICAgICAgICAgIH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AgIG1jX3JvdyA8IGVuZCAmJiAoZm9yY2VfcCB8fCAhaW5wdXRfcGVuZGluZyk7Cisg ICAgICAgICAgICsrbWNfcm93KQorICAgICAgICB7CisgICAgICAgICAgaW50IHZwb3MgPSBNQVRS SVhfUk9XX1ZQT1MgKG1jX3Jvdywgdy0+ZGVzaXJlZF9tYXRyaXgpOworICAgICAgICAgIGlmICht Y19yb3ctPmVuYWJsZWRfcAorICAgICAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9z KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4ID0gdy0+ZGVzaXJl ZF9tYXRyaXg7CisgICAgICAgICAgICAgIGlmICghZm9yY2VfcCAmJiArK25fdXBkYXRlZCAlIHBy ZWVtcHRfY291bnQgPT0gMCkKKyAgICAgICAgICAgICAgICBkZXRlY3RfaW5wdXRfcGVuZGluZ19p Z25vcmVfc3F1ZWV6YWJsZXMgKCk7CisgICAgICAgICAgICAgIGNoYW5nZWRfcCB8PSBtY191cGRh dGVfd2luZG93X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3cml0dGVuX3AsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRy aXgsIGVzc2VudGlhbHMsIGRyYXdfcCk7CisgICAgICAgICAgICAgIGlmIChNQVRSSVhfUk9XX0JP VFRPTV9ZIChyb3cpID49IHliKQorICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSB2cG9zICsg MTsgaSA8IHctPmN1cnJlbnRfbWF0cml4LT5ucm93cyAtIDE7ICsraSkKKyAgICAgICAgICAgICAg ICAgIFNFVF9NQVRSSVhfUk9XX0VOQUJMRURfUCAody0+Y3VycmVudF9tYXRyaXgsIGksIGZhbHNl KTsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAg IGN1cnNvcl9tYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAgICAgIC8qIFVwZGF0ZSB0aGUg cmVzdCBvZiB0aGUgbGluZXMuICovCisgICAgICBmb3IgKDsgcm93IDwgZW5kICYmIChmb3JjZV9w IHx8ICFpbnB1dF9wZW5kaW5nKTsgKytyb3cpCisgICAgICAgIC8qIHNjcm9sbGluZ193aW5kb3cg cmVzZXRzIHRoZSBlbmFibGVkX3AgZmxhZyBvZiB0aGUgcm93cyBpdCByZXVzZXMgZnJvbQorICAg ICAgICBjdXJyZW50X21hdHJpeC4gKi8KKyAgICAgICAgaWYgKHJvdy0+ZW5hYmxlZF9wKQorICAg ICAgICAgIHsKKyAgICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIHct PmRlc2lyZWRfbWF0cml4KTsKKyAgICAgICAgICAgIC8qIElmIHRoZSBgY3Vyc29yX3Jvd2AgaXMg d2l0aGluIHRoZSBgZGVzaXJlZF9tYXRyaXhgLCB0aGVuIGl0IHdhcworICAgICAgICAgICAgcHJv Y2Vzc2VkIGhlcmVpbmFib3ZlIGFuZCBzaG91bGQgYmUgc2tpcHBlZCBhdCB0aGlzIHRpbWUuICov CisgICAgICAgICAgICBpZiAodnBvcyA9PSB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICAgIGNv bnRpbnVlOworICAgICAgICAgICAgaW50IGk7CisgICAgICAgICAgICAvKiBXZSdsbCBoYXZlIHRv IHBsYXkgYSBsaXR0bGUgYml0IHdpdGggd2hlbiB0bworICAgICAgICAgICAgICAgZGV0ZWN0X2lu cHV0X3BlbmRpbmcuICBJZiBpdCdzIGRvbmUgdG9vIG9mdGVuLAorICAgICAgICAgICAgICAgc2Ny b2xsaW5nIGxhcmdlIHdpbmRvd3Mgd2l0aCByZXBlYXRlZCBzY3JvbGwtdXAKKyAgICAgICAgICAg ICAgIGNvbW1hbmRzIHdpbGwgdG9vIHF1aWNrbHkgcGF1c2UgcmVkaXNwbGF5LiAqLworICAgICAg ICA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XllZAorICAgICAgICAgICAgICAgaW4gdGhl IGZpcnN0IHJlZGlzcGxheS4gKi8KKyAgICAgICAgICAgIGlmIChNQVRSSVhfUk9XX0JPVFRPTV9Z IChyb3cpID49IHliKQorICAgICAgICAgICAgICBmb3IgKGkgPSB2cG9zICsgMTsgaSA8IHctPmN1 cnJlbnRfbWF0cml4LT5ucm93cyAtIDE7ICsraSkKKyAgICAgICAgICAgICAgICBTRVRfTUFUUklY X1JPV19FTkFCTEVEX1AgKHctPmN1cnJlbnRfbWF0cml4LCBpLCBmYWxzZSk7CisgICAgICAgICAg fQorICAgICAgLyogV2FzIGRpc3BsYXkgcHJlZW1wdGVkPyAqLworICAgICAgcGF1c2VkX3AgPSBy b3cgPCBlbmQ7CisgICAgICBzZXRfY3Vyc29yOgorICAgICAgLyogSWYgd2UganVtcGVkIGhlcmUg ZnJvbSBgc2V0X2N1cnNvcmAsIHRoZW4gc2V0IHRoZSBgY3Vyc29yX21hdHJpeGAuICovCisgICAg ICBpZiAoY3Vyc29yX21hdHJpeCA9PSBOVUxMKQorICAgICAgICBjdXJzb3JfbWF0cml4ID0gdy0+ Y3VycmVudF9tYXRyaXg7CisgICAgICAvKiBSZXNldCBgcm93YCB0byAwIHNvIHRoYXQgZmFrZSBj dXJzb3JzIGNhbiBiZSBkcmF3biBvbiByb3dzIHByZWNlZGluZyB0aGUKKyAgICAgIGZpcnN0IGBy b3ctPmVuYWJsZWRfcGAuICBKdXN0IHByaW9yIHRvIHRoZSBjYWxsIHRvIGBzY3JvbGxpbmdfd2lu ZG93JyBhYm92ZSwKKyAgICAgIGByb3dgIHdhcyBhZHZhbmNlZCB0byB0aGUgZmlyc3QgYHJvdy0+ ZW5hYmxlZF9wYC4gKi8KKyAgICAgIGZvciAoc3RydWN0IGdseXBoX3JvdyAqZGVzaXJlZF9yb3cg PSBNQVRSSVhfUk9XICh3LT5kZXNpcmVkX21hdHJpeCwgMCk7CisgICAgICAgICAgIGRlc2lyZWRf cm93IDwgZW5kCisgICAgICAgICAgICYmIChmb3JjZV9wIHx8ICFpbnB1dF9wZW5kaW5nKQorICAg ICAgICAgICAvKiBXMzIgRW1hY3MgY3Jhc2hlcyBvbiBzdGFydHVwIHdpdGhvdXQgYSBCVUZGRVJQ IGNoZWNrLiAqLworICAgICAgICAgICAmJiBCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAg ICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAg ICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3No YWlycykpCisgICAgICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBmY192aXNpYmxlKSkpOworICAgICAgICAgICArK2Rlc2lyZWRfcm93KQorICAgICAgICB7 CisgICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKGRlc2lyZWRfcm93LCB3LT5k ZXNpcmVkX21hdHJpeCk7CisgICAgICAgICAgaWYgKGRlc2lyZWRfcm93LT5lbmFibGVkX3ApCisg ICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpjdXJyZW50 X3JvdyA9IE1BVFJJWF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB2cG9zKTsKKyAgICAgICAgICBl bnVtIG1jX3Jvd19wb3NpdGlvbiByb3dfcG9zaXRpb24gPSBtY19yb3dfcG9zaXRpb24gKHcsIGN1 cnJlbnRfcm93LCBjdXJyZW50X3JvdywgdnBvcyk7CisgICAgICAgICAgaWYgKGN1cnJlbnRfcm93 LT5lbmFibGVkX3ApCisgICAgICAgICAgICBtY19kcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRy aXgsIGN1cnJlbnRfcm93LCBjdXJyZW50X3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAg ICAgICAgICAgICAgICAgICAgY3VycmVudF9yb3ctPngsIGN1cnJlbnRfcm93LT51c2VkW1RFWFRf QVJFQV0sIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNz ZW50aWFscywgcm93X3Bvc2l0aW9uLCBkcmF3X3AsCisgICAgICAgICAgICAgICAgICAgICAgICAg U0VUX0NVUlNPUl9PTkUpOworICAgICAgICB9CisKKyAgICAgIG1jX3Jlc3RvcmVfZ2x5cGhfbWF0 cml4IChzYXZlZF9kZXNpcmVkLCB3LT5kZXNpcmVkX21hdHJpeCk7CisgICAgICBtY19yZXN0b3Jl X2dseXBoX21hdHJpeCAoc2F2ZWRfY3VycmVudCwgdy0+Y3VycmVudF9tYXRyaXgpOworCisgICAg ICBtY191cGRhdGVfd2luZG93X2VyYXNlICh3LCBvbGRfbWF0cml4KTsKKworICAgICAgbWNfeGZy ZWVfY2FjaGVfbWF0cml4ICh3LCAmb2xkX21hdHJpeCk7CisKKyAgICB9CisgIC8vIGNsb2NrX3Qg Y2xvY2tfZW5kID0gY2xvY2soKTsKKyAgLy8gZG91YmxlIGNwdV90aW1lX3VzZWQgPSAoKGRvdWJs ZSkgKGNsb2NrX2VuZCAtIGNsb2NrX3N0YXJ0KSkgLyBDTE9DS1NfUEVSX1NFQzsKKyAgLy8gZnBy aW50ZiAoc3RkZXJyLCAibWNfc2Nyb2xsaW5nX3dpbmRvdyAoJXMpOiAgVElNRSAoJWYpXG4iLCBt Y193aW5kb3cgKHcpLCBjcHVfdGltZV91c2VkKTsKK30KKworLyogZW5kIE1VTFRJUExFLUNVUlNP UlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC8qIFN0cnVjdHVyZSB0byBwYXNz IGRpbWVuc2lvbnMgYXJvdW5kLiAgVXNlZCBmb3IgY2hhcmFjdGVyIGJvdW5kaW5nCiAgICBib3hl cywgZ2x5cGggbWF0cml4IGRpbWVuc2lvbnMgYW5kIGFsaWtlLiAgKi8KIApAQCAtMjI0MSw2ICs0 MDE3LDE2IEBAIGZyZWVfd2luZG93X21hdHJpY2VzIChzdHJ1Y3Qgd2luZG93ICp3KQogCSAgZnJl ZV9nbHlwaF9tYXRyaXggKHctPmN1cnJlbnRfbWF0cml4KTsKIAkgIGZyZWVfZ2x5cGhfbWF0cml4 ICh3LT5kZXNpcmVkX21hdHJpeCk7CiAJICB3LT5jdXJyZW50X21hdHJpeCA9IHctPmRlc2lyZWRf bWF0cml4ID0gTlVMTDsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExF LUNVUlNPUlMgKi8KKworICBtY194ZnJlZV9jYWNoZV9tYXRyaXggKHcsICZ3LT5tY19tYXRyaXgp OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJfQogCiAgICAgICAvKiBOZXh0IHdp bmRvdyBvbiBzYW1lIGxldmVsLiAgKi8KQEAgLTMzODcsNiArNTE3MywyNiBAQCBjaGVja19jdXJy ZW50X21hdHJpeF9mbGFncyAoc3RydWN0IHdpbmRvdyAqdykKIHN0YXRpYyBib29sCiB1cGRhdGVf d2luZG93IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3ApCiB7CisKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgaWYgKG1jX3N0ZGVy cl9wKQorICAgIGZwcmludGYgKHN0ZGVyciwgInVwZGF0ZV93aW5kb3cgKCVzKVxuIiwgbWNfd2lu ZG93ICh3KSk7CisKKyAgc3RydWN0IG1jX2Vzc2VudGlhbHMgZXNzZW50aWFsczsKKyAgbWNfc2V0 X2Vzc2VudGlhbHMgKHcsICZlc3NlbnRpYWxzKTsKKworICBtY191cGRhdGVfd2luZG93X2RyeXJ1 biAodywgZm9yY2VfcCwgZXNzZW50aWFscyk7CisKKyAgc3RydWN0IGdseXBoX21hdHJpeCAqY3Vy c29yX21hdHJpeCA9IE5VTEw7CisKKyAgYm9vbCBkcmF3X3AgPSB0cnVlOworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAgIHN0cnVjdCBnbHlwaF9tYXRyaXggKmRlc2lyZWRfbWF0cml4 ID0gdy0+ZGVzaXJlZF9tYXRyaXg7CiAgIGJvb2wgcGF1c2VkX3A7CiAgIGludCBwcmVlbXB0X2Nv dW50ID0gY2xpcF90b19ib3VuZHMgKDEsIGJhdWRfcmF0ZSAvIDI0MDAgKyAxLCBJTlRfTUFYKTsK QEAgLTM0NjQsNiArNTI3MCw0NyBAQCB1cGRhdGVfd2luZG93IChzdHJ1Y3Qgd2luZG93ICp3LCBi b29sIGZvcmNlX3ApCiAJICAgIH0KIAl9CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisv KiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogUHJvY2VzcyB0aGUgY3Vyc29yIHJvdyBhdCB0 aGUgb3V0c2V0IGlmIGl0IGlzIHdpdGhpbiBgZGVzaXJlZF9tYXRyaXhgLgorICBXaGVuIHByb2Nl c3NpbmcgYWxsIG90aGVyIHJvd3MsIHdlIHdpbGwgcXVlcnkgdGhlIGB3LT5jdXJyZW50X21hdHJp eGAgZm9yIGRhdGEKKyAgcmVsYXRpbmcgdG8gdGhlIGN1cnNvciByb3cuICBgbWFrZV9jdXJyZW50 YCAod2l0aGluIGB1cGRhdGVfd2luZG93X2xpbmUnKQorICB1cGRhdGVzIHRoZSBgdy0+Y3VycmVu dF9tYXRyaXhgIGZvciB0aGUgYXBwbGljYWJsZSByb3cuICBJbiBkb2luZyBzbywgaG93ZXZlciwK KyAgdGhlIGFwcGxpY2FibGUgcm93IGluIHRoZSBkZXNpcmVkIG1hdHJpeCBpcyBhbHRlcmVkIHN1 Y2ggdGhhdCB3ZSBjYW4gbm8gbG9uZ2VyCisgIHJlbHkgdXBvbiB0aGUgYWNjdXJhY3kgb2YgYFJP Vy0+dXNlZFtURVhUX0FSRUFdYC4gIFRoZXJlZm9yZSwgd2UgbXVzdCBub3cgcmVseQorICBleGNs dXNpdmVseSB1cG9uIGB3LT5jdXJyZW50X21hdHJpeCcgZm9yIGN1cnNvciByb3cgYmFzZWQgZGVj aXNpb25zLiAqLworICBmb3IgKHN0cnVjdCBnbHlwaF9yb3cgKm1jX3JvdyA9IHJvdzsKKyAgICAg ICBtY19yb3cgPCBlbmQgJiYgKGZvcmNlX3AgfHwgIWlucHV0X3BlbmRpbmcpOworICAgICAgICsr bWNfcm93KQorICAgIHsKKyAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChtY19yb3cs IGRlc2lyZWRfbWF0cml4KTsKKyAgICAgIGlmIChtY19yb3ctPmVuYWJsZWRfcAorICAgICAgICAg ICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgIHsKKyAgICAgICAgICBjdXJzb3Jf bWF0cml4ID0gZGVzaXJlZF9tYXRyaXg7CisgICAgICAgICAgaWYgKCFmb3JjZV9wICYmICsrbl91 cGRhdGVkICUgcHJlZW1wdF9jb3VudCA9PSAwKQorICAgICAgICAgICAgZGV0ZWN0X2lucHV0X3Bl bmRpbmdfaWdub3JlX3NxdWVlemFibGVzICgpOworICAgICAgICAgIGNoYW5nZWRfcCB8PSAoQlVG RkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoIU5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWly cykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgISBOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKSkpCisgICAgICAgICAgICAgICAgICAgICAgID8g bWNfdXBkYXRlX3dpbmRvd19saW5lICh3LCB2cG9zLCAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9w LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29y X21hdHJpeCwgZXNzZW50aWFscywgZHJhd19wKQorICAgICAgICAgICAgICAgICAgICAgICA6IHVw ZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCk7Cisg ICAgICAgICAgaWYgKE1BVFJJWF9ST1dfQk9UVE9NX1kgKHJvdykgPj0geWIpCisgICAgICAgICAg ICBmb3IgKGludCBpID0gdnBvcyArIDE7IGkgPCB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3MgLSAx OyArK2kpCisgICAgICAgICAgICAgIFNFVF9NQVRSSVhfUk9XX0VOQUJMRURfUCAody0+Y3VycmVu dF9tYXRyaXgsIGksIGZhbHNlKTsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0K KworICBjdXJzb3JfbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKICAgICAgIC8qIFVwZGF0ZSB0aGUgcmVzdCBvZiB0aGUgbGluZXMuICAq LwogICAgICAgZm9yICg7IHJvdyA8IGVuZCAmJiAoZm9yY2VfcCB8fCAhaW5wdXRfcGVuZGluZyk7 ICsrcm93KQogCS8qIHNjcm9sbGluZ193aW5kb3cgcmVzZXRzIHRoZSBlbmFibGVkX3AgZmxhZyBv ZiB0aGUgcm93cyBpdApAQCAtMzQ3MSw2ICs1MzE4LDE5IEBAIHVwZGF0ZV93aW5kb3cgKHN0cnVj dCB3aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkKIAlpZiAocm93LT5lbmFibGVkX3ApCiAJICB7CiAJ ICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIGRlc2lyZWRfbWF0cml4KTsKKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAg ICAgICAgIC8qIElmIHRoZSBgY3Vyc29yX3Jvd2AgaXMgd2l0aGluIHRoZSBgZGVzaXJlZF9tYXRy aXhgLCB0aGVuIGl0IHdhcworICAgICAgICAgIHByb2Nlc3NlZCBoZXJlaW5hYm92ZSBhbmQgc2hv dWxkIGJlIHNraXBwZWQgYXQgdGhpcyB0aW1lLiAqLworICAgICAgICAgIGlmICh2cG9zID09IHct PmN1cnNvci52cG9zKQorICAgICAgICAgIGNvbnRpbnVlOworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKworCiAJICAgIGludCBpOwogCiAJICAgIC8qIFdlJ2xsIGhhdmUgdG8gcGxheSBhIGxp dHRsZSBiaXQgd2l0aCB3aGVuIHRvCkBAIC0zNDc5LDggKzUzMzksMjEgQEAgdXBkYXRlX3dpbmRv dyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wKQogCSAgICAgICBjb21tYW5kcyB3aWxs IHRvbyBxdWlja2x5IHBhdXNlIHJlZGlzcGxheS4gICovCiAJICAgIGlmICghZm9yY2VfcCAmJiAr K25fdXBkYXRlZCAlIHByZWVtcHRfY291bnQgPT0gMCkKIAkgICAgICBkZXRlY3RfaW5wdXRfcGVu ZGluZ19pZ25vcmVfc3F1ZWV6YWJsZXMgKCk7Ci0JICAgIGNoYW5nZWRfcCB8PSB1cGRhdGVfd2lu ZG93X2xpbmUgKHcsIHZwb3MsCi0JCQkJCSAgICAgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCk7 CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK KyAgICAgICAgICBjaGFuZ2VkX3AgfD0gKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAg ICAgICAgICAgICAgICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1j X2NvbmYpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVG RkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHx8ICEgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkp KQorICAgICAgICAgICAgICAgICAgICAgICA/IG1jX3VwZGF0ZV93aW5kb3dfbGluZSAodywgdnBv cywgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIGRyYXdfcCkK KyAgICAgICAgICAgICAgICAgICAgICAgOiB1cGRhdGVfd2luZG93X2xpbmUgKHcsIHZwb3MsICZt b3VzZV9mYWNl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gTUFUUklYX1JPVyAo ZGVzaXJlZF9tYXRyaXgsIDApOworICAgICAgIGRlc2lyZWRfcm93IDwgZW5kCisgICAgICAgJiYg KGZvcmNlX3AgfHwgIWlucHV0X3BlbmRpbmcpCisgICAgICAgLyogVzMyIEVtYWNzIGNyYXNoZXMg b24gc3RhcnR1cCB3aXRob3V0IGEgQlVGRkVSUCBjaGVjay4gKi8KKyAgICAgICAmJiBCVUZGRVJQ ICh3LT5jb250ZW50cykKKyAgICAgICAmJiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRl bnRzKSwgbWNfY29uZikpCisgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpOworICAgICAgICsrZGVzaXJlZF9yb3cpCisg ICAgeworICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKGRlc2lyZWRfcm93LCBkZXNp cmVkX21hdHJpeCk7CisgICAgICBpZiAoZGVzaXJlZF9yb3ctPmVuYWJsZWRfcCkKKyAgICAgICAg Y29udGludWU7CisgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpjdXJyZW50X3JvdyA9IE1BVFJJWF9S T1cgKHctPmN1cnJlbnRfbWF0cml4LCB2cG9zKTsKKyAgICAgIGVudW0gbWNfcm93X3Bvc2l0aW9u IHJvd19wb3NpdGlvbiA9IG1jX3Jvd19wb3NpdGlvbiAodywgY3VycmVudF9yb3csIGN1cnJlbnRf cm93LCB2cG9zKTsKKyAgICAgIGlmIChjdXJyZW50X3Jvdy0+ZW5hYmxlZF9wKQorICAgICAgICBt Y19kcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgsIGN1cnJlbnRfcm93LCBjdXJyZW50X3Jv dy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgICAgICAgICAgICBjdXJyZW50X3Jvdy0+ eCwgY3VycmVudF9yb3ctPnVzZWRbVEVYVF9BUkVBXSwgdnBvcywKKyAgICAgICAgICAgICAgICAg ICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgZHJhd19wLCBTRVRf Q1VSU09SX1RXTyk7CisgICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAg ICAvKiBVcGRhdGUgdGhlIGhlYWRlciBsaW5lIGFmdGVyIHNjcm9sbGluZyBiZWNhdXNlIGEgbmV3 IGhlYWRlcgogCSBsaW5lIHdvdWxkIG90aGVyd2lzZSBvdmVyd3JpdGUgbGluZXMgYXQgdGhlIHRv cCBvZiB0aGUgd2luZG93CiAJIHRoYXQgY2FuIGJlIHNjcm9sbGVkLiAgKi8KQEAgLTM1MTYsNyAr NTQyNCw0OSBAQCB1cGRhdGVfd2luZG93IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3Ap CiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCiAJICBpZiAoY2hhbmdlZF9wICYmIHJpZi0+Zml4 X292ZXJsYXBwaW5nX2FyZWEpCiAJICAgIHsKLQkgICAgICByZWRyYXdfb3ZlcmxhcHBlZF9yb3dz ICh3LCB5Yik7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJT T1JTICovCisKKy8qIGByZWRyYXdfb3ZlcmxhcHBlZF9yb3dzJzogIFJlZHJhdyBsaW5lcyBmcm9t IHRoZSBjdXJyZW50IG1hdHJpeCBvZiB3aW5kb3cgVwordGhhdCBhcmUgb3ZlcmxhcHBlZCBieSBv dGhlciByb3dzLiAgWUIgaXMgYm90dG9tLW1vc3QgeS1wb3NpdGlvbiBpbiBXLiAgSWYgcm93cwor b3ZlcmxhcHBpbmcgb3RoZXJzIGhhdmUgYmVlbiBjaGFuZ2VkLCB0aGUgcm93cyBiZWluZyBvdmVy bGFwcGVkIGhhdmUgdG8gYmUKK3JlZHJhd24uICBUaGlzIHdvbid0IGRyYXcgbGluZXMgdGhhdCBo YXZlIGFscmVhZHkgYmVlbiBkcmF3biBpbiB1cGRhdGVfd2luZG93CitsaW5lIGJlY2F1c2Ugb3Zl cmxhcHBlZF9wIGluIGRlc2lyZWQgcm93cyBpcyAwLCBzbyBhZnRlciByb3cgYXNzaWdubWVudAor b3ZlcmxhcHBlZF9wIGluIGN1cnJlbnQgcm93cyBpcyAwLiAqLworICBzdHJ1Y3QgZnJhbWUgKmYg PSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworICBmb3IgKGludCBpID0gMDsgaSA8IHctPmN1 cnJlbnRfbWF0cml4LT5ucm93czsgKytpKQorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlwaF9yb3cg KnJvdyA9IHctPmN1cnJlbnRfbWF0cml4LT5yb3dzICsgaTsKKyAgICAgIGlmICghcm93LT5lbmFi bGVkX3ApCisgICAgICAgIGJyZWFrOworICAgICAgICBlbHNlIGlmIChyb3ctPm1vZGVfbGluZV9w KQorICAgICAgICAgIGNvbnRpbnVlOworICAgICAgaWYgKHJvdy0+b3ZlcmxhcHBlZF9wKQorICAg ICAgICB7CisgICAgICAgICAgZm9yIChlbnVtIGdseXBoX3Jvd19hcmVhIGFyZWEgPSBMRUZUX01B UkdJTl9BUkVBOyBhcmVhIDwgTEFTVF9BUkVBOyArK2FyZWEpCisgICAgICAgICAgICB7CisgICAg ICAgICAgICAgIG91dHB1dF9jdXJzb3JfdG8gKHcsIGksIDAsIHJvdy0+eSwgYXJlYSA9PSBURVhU X0FSRUEgPyByb3ctPnggOiAwKTsKKyAgICAgICAgICAgICAgaWYgKCFtY19yZWRyYXdfcm93ICh3 LCB3LT5jdXJyZW50X21hdHJpeCwgcm93LCBhcmVhLCByb3ctPngsIDAsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgcm93LT51c2VkW2FyZWFdLCB0cnVlLCBEUkFXX05PUk1BTF9U RVhULAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVQREFURV9XSU5ET1dfX1JF RFJBV19PVkVSTEFQUEVEX1JPV1MpCisgICAgICAgICAgICAgICAgICAmJiByb3ctPnVzZWRbYXJl YV0pCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgRlJBTUVfUklGIChmKS0+ d3JpdGVfZ2x5cGhzICh3LCByb3csIHJvdy0+Z2x5cGhzW2FyZWFdLCBhcmVhLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb3ctPnVzZWRbYXJlYV0pOwor ICAgICAgICAgICAgICAgICAgRlJBTUVfUklGIChmKS0+Y2xlYXJfZW5kX29mX2xpbmUgKHcsIHJv dywgYXJlYSwgLTEpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAg ICByb3ctPm92ZXJsYXBwZWRfcCA9IDA7CisgICAgICAgIH0KKyAgICAgIGlmIChNQVRSSVhfUk9X X0JPVFRPTV9ZIChyb3cpID49IHliKQorICAgICAgICBicmVhazsKKyAgICB9CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKIAkgICAgICByZWRyYXdfb3ZlcmxhcHBpbmdfcm93cyAodywg eWIpOwogCSAgICB9CiAjZW5kaWYKQEAgLTM1MzYsOCArNTQ4NiwyMCBAQCB1cGRhdGVfd2luZG93 IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3ApCiAjZW5kaWYKIAogI2lmZGVmIEhBVkVf V0lORE9XX1NZU1RFTQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUt Q1VSU09SUyAqLworCisgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICYmICFOSUxQ IChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICBtY191cGRh dGVfd2luZG93X2ZyaW5nZXMgKHcsIDApOworICAgIGVsc2UKICAgICAgIHVwZGF0ZV93aW5kb3df ZnJpbmdlcyAodywgMCk7CiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIC8q IEVuZCB0aGUgdXBkYXRlIG9mIHdpbmRvdyBXLiAgRG9uJ3Qgc2V0IHRoZSBjdXJzb3IgaWYgd2UK ICAgICAgICAgIHBhdXNlZCB1cGRhdGluZyB0aGUgZGlzcGxheSBiZWNhdXNlIGluIHRoaXMgY2Fz ZSwKICAgICAgICAgIHNldF93aW5kb3dfY3Vyc29yX2FmdGVyX3VwZGF0ZSBoYXNuJ3QgYmVlbiBj YWxsZWQsIGFuZApkaWZmIC0tZ2l0IGEvc3JjL2ZyYW1lLmggYi9zcmMvZnJhbWUuaAppbmRleCBm YTQ1YTMyLi41M2FkMTMxIDEwMDY0NAotLS0gYS9zcmMvZnJhbWUuaAorKysgYi9zcmMvZnJhbWUu aApAQCAtMjA1LDYgKzIwNSwxNiBAQCBzdHJ1Y3QgZnJhbWUKICAgTGlzcF9PYmplY3QgdG9vbF9i YXJfaXRlbXM7CiAgIC8qIHRvb2xfYmFyX2l0ZW1zIHNob3VsZCBiZSB0aGUgbGFzdCBMaXNwX09i amVjdCBtZW1iZXIuICAqLwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQ TEUtQ1VSU09SUyAqLworCisgIC8qIE5vbi1uaWwgd2hlbiB0aGUgZnJhbWUgaXMgaW4gdGhlIHBy b2Nlc3Mgb2YgYmVpbmcgdXBkYXRlZC4gKi8KKyAgc3RydWN0IGZyYW1lICptY191cGRhdGluZ19m cmFtZTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBDYWNoZSBvZiByZWFs aXplZCBmYWNlcy4gICovCiAgIHN0cnVjdCBmYWNlX2NhY2hlICpmYWNlX2NhY2hlOwogCmRpZmYg LS1naXQgYS9zcmMvZnJpbmdlLmMgYi9zcmMvZnJpbmdlLmMKaW5kZXggZDBkNTk5Mi4uMjUyZWRh YyAxMDA2NDQKLS0tIGEvc3JjL2ZyaW5nZS5jCisrKyBiL3NyYy9mcmluZ2UuYwpAQCAtNDM3LDgg KzQzNyw0NjIgQEAgc3RhdGljIHVuc2lnbmVkIHNob3J0IGVtcHR5X2xpbmVfYml0c1tdID0gewog I2RlZmluZSBTVEFOREFSRF9CSVRNQVBfSEVJR0hUKGJpdHMpIChzaXplb2YgKGJpdHMpL0JZVEVT X1BFUl9CSVRNQVBfUk9XKQogI2RlZmluZSBGUkJJVFMoYml0cykgIGJpdHMsIFNUQU5EQVJEX0JJ VE1BUF9IRUlHSFQgKGJpdHMpCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdp biBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIGArLWZyaW5nZS1oZWxwZXItZGVjaW1hbCcgZGVm aW5lZCBpbiBgY3Jvc3NoYWlycy5lbGAgKi8KKworLyogVE9ETzogIENvbnNpZGVyIGFkZGluZyB0 aGUgZm9sbG93aW5nIGZyaW5nZSBiaXRtYXBzOgorICAoZGVmaW5lLWZyaW5nZS1iaXRtYXAgJ2Jy ZWFrcG9pbnQgIlx4M2NceDdlXHhmZlx4ZmZceGZmXHhmZlx4N2VceDNjIikKKyAgKGRlZmluZS1m cmluZ2UtYml0bWFwICdob2xsb3ctcmlnaHQtdHJpYW5nbGUgIlx4ZTBceDkwXHg4OFx4ODRceDg0 XHg4OFx4OTBceGUwIikgKi8KKworLyogMjQKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNp bWFsCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4i CisgICAgICAieC4ueHguLi4iCisgICAgICAieC4uLnh4Li4iCisgICAgICAieC4uLi54eC4iCisg ICAgICAieC54eHh4eHgiCisgICAgICAieC54eHh4eHgiCisgICAgICAieC4uLi54eC4iCisgICAg ICAieC4uLnh4Li4iCisgICAgICAieC4ueHguLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAi eC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBt Y192ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3dfYml0c1tdID17CisgIDB4ODAsIDB4ODAsIDB4ODAs IDB4OTgsIDB4OGMsIDB4ODYsIDB4YmYsCisgIDB4YmYsIDB4ODYsIDB4OGMsIDB4OTgsIDB4ODAs IDB4ODAsIDB4ODB9OworCisvKiAyNQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwK KyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAg ICAgICIueHguLi54eCIKKyAgICAgICIuLnh4Li54eCIKKyAgICAgICIuLi54eC54eCIKKyAgICAg ICJ4eHh4eHh4eCIKKyAgICAgICJ4eHh4eHh4eCIKKyAgICAgICIuLi54eC54eCIKKyAgICAgICIu Lnh4Li54eCIKKyAgICAgICIueHguLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4u Li54eCIKKyAgICAgICIuLi4uLi54eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3Jl dmVyc2VkX3ZlcnRpY2FsX2Jhcl9yaWdodF9hcnJvd19iaXRzW10gPXsKKyAgMHgzLCAweDMsIDB4 MywgMHg2MywgMHgzMywgMHgxYiwgMHhmZiwgMHhmZiwgMHgxYiwgMHgzMywgMHg2MywgMHgzLCAw eDMsIDB4M307CisKKy8qIDI2CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAg ICAgInh4eHh4eHh4IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAg InguLnh4Li54IgorICAgICAgInguLi54eC54IgorICAgICAgInguLi4ueHh4IgorICAgICAgIngu eHh4eHh4IgorICAgICAgIngueHh4eHh4IgorICAgICAgInguLi4ueHh4IgorICAgICAgInguLi54 eC54IgorICAgICAgInguLnh4Li54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54 IgorICAgICAgInh4eHh4eHh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfaG9sbG93 X3JlY3RhbmdsZV9yaWdodF9hcnJvd19iaXRzW10gPXsKKyAgMHhmZiwgMHg4MSwgMHg4MSwgMHg5 OSwgMHg4ZCwgMHg4NywgMHhiZiwKKyAgMHhiZiwgMHg4NywgMHg4ZCwgMHg5OSwgMHg4MSwgMHg4 MSwgMHhmZn07CisKKy8qIDI3CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAg ICAgInh4eHh4eHh4IgorICAgICAgInguLi4uLnh4IgorICAgICAgInguLi4uLnh4IgorICAgICAg IngueHguLnh4IgorICAgICAgInguLnh4Lnh4IgorICAgICAgInguLi54eHh4IgorICAgICAgInh4 eHh4eHh4IgorICAgICAgInh4eHh4eHh4IgorICAgICAgInguLi54eHh4IgorICAgICAgInguLnh4 Lnh4IgorICAgICAgIngueHguLnh4IgorICAgICAgInguLi4uLnh4IgorICAgICAgInguLi4uLnh4 IgorICAgICAgInh4eHh4eHh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcmV2ZXJz ZWRfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvd19iaXRzW10gPXsKKyAgMHhmZiwgMHg4MSwg MHg4MSwgMHhiMSwgMHg5OSwgMHg4ZCwgMHhmZiwKKyAgMHhmZiwgMHg4ZCwgMHg5OSwgMHhiMSwg MHg4MSwgMHg4MSwgMHhmZn07CisKKy8qIDI4CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVj aW1hbAorICAgICAgInh4eHh4eHh4IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54 IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54Igor ICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAg ICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAgInguLi4uLi54IgorICAgICAg InguLi4uLi54IgorICAgICAgInh4eHh4eHh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQg bWNfaG9sbG93X3JlY3RhbmdsZV9iaXRzW10gPXsKKyAgMHhmZiwgMHg4MSwgMHg4MSwgMHg4MSwg MHg4MSwgMHg4MSwgMHg4MSwKKyAgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwgMHg4MSwg MHhmZn07CisKKy8qIDI5CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAg InguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgIngu Li4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4u Li4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4u IgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgor ICAgICAgInguLi4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdmVydGljYWxf YmFyX2JpdHNbXSA9eworICAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgw LAorICAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwLCAweDgwfTsKKworLyogMzAK KyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4ueHgiCisgICAg ICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAi Li4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4u Li4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4u eHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgi KQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19yZXZlcnNlZF92ZXJ0aWNhbF9iYXJfYml0 c1tdID17CisgIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4 MywgMHgzLCAweDMsIDB4MywgMHgzfTsKKworLyogMzEKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhl eGFkZWNpbWFsCisgICAgICAieHguLi4uLi4iCisgICAgICAieHguLi4uLi4iCisgICAgICAiIHh4 Li4uLi4iCisgICAgICAiLnh4Li4uLi4iCisgICAgICAiLi54eC4uLi4iCisgICAgICAiLi54eC4u Li4iCisgICAgICAiLi4ueHguLi4iCisgICAgICAiLi4ueHguLi4iCisgICAgICAiLi4uLnh4Li4i C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KKyAgICAgICIuLi54LnguLiIKKyAgICAgICIuLi54 LnguLiIKKyAgICAgICIuLi54LnguLiIKKyAgICAgICIuLi54LnguLiIKKyAgICAgICIuLi54Lngu LiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3BpbGNyb3dfYml0c1tdID17CisgIDB4 N2UsIDB4ZjQsIDB4ZjQsIDB4ZjQsIDB4NzQsIDB4MTQsIDB4MTQsIDB4MTQsIDB4MTQsIDB4MTQs IDB4MTR9OworCisvKiAzNAorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAg ICIuLnh4eHguLiIKKyAgICAgICIueHh4eHh4LiIKKyAgICAgICJ4Li54eC4ueCIKKyAgICAgICJ4 Li54eC4ueCIKKyAgICAgICJ4eHh4eHh4eCIKKyAgICAgICJ4eC4uLi54eCIKKyAgICAgICJ4eHgu Lnh4eCIKKyAgICAgICIueHh4eHh4LiIKKyAgICAgICIuLnh4eHguLiIpCisqLworc3RhdGljIHVu c2lnbmVkIHNob3J0IG1jX3NtaWxleV9mYWNlX2JpdHNbXSA9eworICAweDNjLCAweDdlLCAweDk5 LCAweDk5LCAweGZmLCAweGMzLCAweGU3LCAweDdlLCAweDNjfTsKKworLyogMzUKKyAgICAoKy1m cmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi54Li4uLi4iCisgICAgICAiLi4ueC4u Li4iCisgICAgICAiLi4uLnguLi4iCisgICAgICAiLi4uLi54Li4iCisgICAgICAiLi4uLnguLi4i CisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54Li4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25l ZCBzaG9ydCBtY19zaW5nbGVfYW5nbGVfcmlnaHRfYml0c1tdID17CisgIDB4MjAsIDB4MTAsIDB4 OCwgMHg0LCAweDgsIDB4MTAsIDB4MjB9OworCisvKiAzNgorICAgICgrLWZyaW5nZS1oZWxwZXIt aGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLnguLiIKKyAgICAgICIuLi4ueC4uLiIKKyAgICAgICIu Li54Li4uLiIKKyAgICAgICIuLnguLi4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLi4u eC4uLiIKKyAgICAgICIuLi4uLnguLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3Np bmdsZV9hbmdsZV9sZWZ0X2JpdHNbXSA9eworICAweDQsIDB4OCwgMHgxMCwgMHgyMCwgMHgxMCwg MHg4LCAweDR9OworCisvKiAzNworICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAg ICAgICJ4eC54eC4uLiIKKyAgICAgICIueHgueHguLiIKKyAgICAgICIuLnh4Lnh4LiIKKyAgICAg ICIuLi54eC54eCIKKyAgICAgICIuLnh4Lnh4LiIKKyAgICAgICIueHgueHguLiIKKyAgICAgICJ4 eC54eC4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX2RvdWJsZV9hbmdsZV9yaWdo dF9iaXRzW10gPXsKKyAgMHhkOCwgMHg2YywgMHgzNiwgMHgxYiwgMHgzNiwgMHg2YywgMHhkOH07 CisKKy8qIDM4CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLnh4 Lnh4IgorICAgICAgIi4ueHgueHguIgorICAgICAgIi54eC54eC4uIgorICAgICAgInh4Lnh4Li4u IgorICAgICAgIi54eC54eC4uIgorICAgICAgIi4ueHgueHguIgorICAgICAgIi4uLnh4Lnh4IikK KyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xlX2xlZnRfYml0c1tdID17 CisgIDB4MWIsIDB4MzYsIDB4NmMsIDB4ZDgsIDB4NmMsIDB4MzYsIDB4MWJ9OworCisvKiAzOQor ICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICJ4LngueC4uLiIKKyAgICAg ICIueC54LnguLiIKKyAgICAgICIuLngueC54LiIKKyAgICAgICIuLi54LngueCIKKyAgICAgICIu LngueC54LiIKKyAgICAgICIueC54LnguLiIKKyAgICAgICJ4LngueC4uLiIpCisqLworc3RhdGlj IHVuc2lnbmVkIHNob3J0IG1jX3RyaXBsZV9hbmdsZV9yaWdodF9iaXRzW10gPXsKKyAgMHhhOCwg MHg1NCwgMHgyYSwgMHgxNSwgMHgyYSwgMHg1NCwgMHhhOH07CisKKy8qIDQwCisgICAgKCstZnJp bmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLngueC54IgorICAgICAgIi4ueC54Lngu IgorICAgICAgIi54LngueC4uIgorICAgICAgIngueC54Li4uIgorICAgICAgIi54LngueC4uIgor ICAgICAgIi4ueC54LnguIgorICAgICAgIi4uLngueC54IikKKyovCitzdGF0aWMgdW5zaWduZWQg c2hvcnQgbWNfdHJpcGxlX2FuZ2xlX2xlZnRfYml0c1tdID17CisgIDB4MTUsIDB4MmEsIDB4NTQs IDB4YTgsIDB4NTQsIDB4MmEsIDB4MTV9OworCisvKiA0MQorICAgICgrLWZyaW5nZS1oZWxwZXIt aGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIu Li4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLngu eC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIuLi4uLi4u LiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIp CisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3NpbmdsZV9hbmdsZV91cF9iaXRzW10gPXsK KyAgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHgxMCwgMHgyOCwgMHg0NCwgMHg4MiwgMHgwMCwg MHgwMCwgMHgwMCwgMHgwMH07CisKKy8qIDQyCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVj aW1hbAorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4u IgorICAgICAgIi4uLi4uLi4uIgorICAgICAgInguLi4uLnguIgorICAgICAgIi54Li4ueC4uIgor ICAgICAgIi4ueC54Li4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAg ICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIikKKyovCitz dGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX2Rvd25fYml0c1tdID17CisgIDB4 MDAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4ODIsIDB4NDQsIDB4MjgsIDB4MTAsIDB4MDAsIDB4MDAs IDB4MDAsIDB4MDB9OworCisvKiA0MworICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwK KyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAg ICAgICIuLi54Li4uLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAgICAg ICJ4Li54Li54LiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4 Li4uLi54LiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4u Li4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX2RvdWJsZV9hbmdsZV91cF9iaXRz W10gPXsKKyAgMHgwMCwgMHgwMCwgMHgwMCwgMHgxMCwgMHgyOCwgMHg0NCwgMHg5MiwgMHgyOCwg MHg0NCwgMHg4MiwgMHgwMCwgMHgwMCwgMHgwMH07CisKKy8qIDQ0CisgICAgKCstZnJpbmdlLWhl bHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAg ICAgIi4uLi4uLi4uIgorICAgICAgInguLi4uLnguIgorICAgICAgIi54Li4ueC4uIgorICAgICAg Ii4ueC54Li4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi54Li4ueC4uIgorICAgICAgIi4u eC54Li4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4u Li4uIgorICAgICAgIi4uLi4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfZG91 YmxlX2FuZ2xlX2Rvd25fYml0c1tdID17CisgIDB4MDAsIDB4MDAsIDB4MDAsIDB4ODIsIDB4NDQs IDB4MjgsIDB4OTIsIDB4NDQsIDB4MjgsIDB4MTAsIDB4MDAsIDB4MDAsIDB4MDB9OworCisvKiA0 NQorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4uLiIKKyAg ICAgICIuLi54Li4uLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAgICAg ICJ4Li54Li54LiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4 Li54Li54LiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4Li4u Li54LiIKKyAgICAgICIuLi4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3Ry aXBsZV9hbmdsZV91cF9iaXRzW10gPXsKKyAgMHgwMCwgMHgxMCwgMHgyOCwgMHg0NCwgMHg5Miwg MHgyOCwgMHg0NCwgMHg5MiwgMHgyOCwgMHg0NCwgMHg4MiwgMHgwMH07CisKKy8qIDQ2CisgICAg KCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4uLi4uIgorICAgICAgIngu Li4uLnguIgorICAgICAgIi54Li4ueC4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgInguLngu LnguIgorICAgICAgIi54Li4ueC4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgInguLnguLngu IgorICAgICAgIi54Li4ueC4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi4uLnguLi4uIgor ICAgICAgIi4uLi4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcXVhZHJ1cGxl X2FuZ2xlX2Rvd25fYml0c1tdID17CisgIDB4MDAsIDB4ODIsIDB4NDQsIDB4MjgsIDB4OTIsIDB4 NDQsIDB4MjgsIDB4OTIsIDB4NDQsIDB4MjgsIDB4MTAsIDB4MDB9OworCisvKiA0NworICAgICgr LWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLngu eC4uLiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIuLngueC4u LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIuLngueC4uLiIK KyAgICAgICIueC4uLnguLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIuLngueC4uLiIKKyAg ICAgICIueC4uLnguLiIKKyAgICAgICJ4Li4uLi54LiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNo b3J0IG1jX3F1YWRydXBsZV9hbmdsZV91cF9iaXRzW10gPXsKKyAgMHgxMCwgMHgyOCwgMHg0NCwg MHg5MiwgMHgyOCwgMHg0NCwgMHg5MiwgMHgyOCwgMHg0NCwgMHg5MiwgMHgyOCwgMHg0NCwgMHg4 Mn07CisKKy8qIDQ4CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIngu Li4uLnguIgorICAgICAgIi54Li4ueC4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgInguLngu LnguIgorICAgICAgIi54Li4ueC4uIgorICAg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KQorICAgIHsKKyAgICAg IGJtMSA9IG1jX2Fzc3EgKGJpdG1hcCwgY21hcCk7CisgICAgICBpZiAoQ09OU1AgKGJtMSkpCisg IHsKKyAgICBpZiAoKGJtMSA9IFhDRFIgKGJtMSkpLCBOSUxQIChibTEpKQorICAgICAgcmV0dXJu IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgaWYgKENPTlNQIChibTEpKQorICAgICAgeworICAg ICAgICBsbjEgPSBYRklYTlVNIChGbGVuZ3RoIChibTEpKTsKKyAgICAgICAgaWYgKHBhcnRpYWxf cCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpZiAobG4xID4gaXgyKQorICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgYm0gPSBtY19udGggKGl4MiwgYm0xKTsKKyAgICAgICAgICAg ICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAg ICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7 CisgICAgICAgICAgICAgIGlmIChsbjEgPiBpeDEpCisgICAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0xKTsKKyAgICAgICAgICAgICAgICAgIGlm ICghRVEgKGJtLCBRdCkpCisgICAgICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAg ICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgfQorICAgIGVsc2UgaWYgKChibSA9IGJt MSwgIUVRIChibSwgUXQpKSkKKyAgICAgIGdvdG8gZm91bmQ7CisgIH0KKyAgICB9CisgIGlmICgh RVEgKGNtYXAsIEJWQVIgKCZidWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3Qp KQorICAgICAgJiYgIU5JTFAgKEJWQVIgKCZidWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9pbmRpY2F0 b3JfYWxpc3QpKSkKKyAgICB7CisgICAgICBibTIgPSBtY19hc3NxIChiaXRtYXAsIEJWQVIgKCZi dWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKTsKKyAgICAgIGlmIChDT05T UCAoYm0yKSkKKyAgICAgICAgeworICAgICAgICAgIGlmICgoYm0yID0gWENEUiAoYm0yKSksICFO SUxQIChibTIpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAoQ09OU1AgKGJtMikp CisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgbG4yID0gWEZJWE5VTSAoRmxl bmd0aCAoYm0yKSk7CisgICAgICAgICAgICAgICAgICBpZiAocGFydGlhbF9wKQorICAgICAgICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgaWYgKGxuMiA+IGl4MikKKyAgICAg ICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgYm0gPSBtY19u dGggKGl4MiwgYm0yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0 KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5kOworICAgICAgICAgICAg ICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQor ICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICBpZiAobG4xID4gaXgxKQorICAgIHsK KyAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMSk7CisgICAgICBpZiAoIUVRIChibSwgUXQpKQor ICAgICAgICBnb3RvIGZvdW5kOworICAgIH0KKyAgaWYgKGxuMiA+IGl4MSkKKyAgICB7CisgICAg ICBibSA9IG1jX250aCAoaXgxLCBibTIpOworICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAg ICAgZ290byBmb3VuZDsKKyAgICAgIHJldHVybiBNQ19OT19GUklOR0VfQklUTUFQOworICAgIH0K Ky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GlzdCkpLCAhTklMUCAoY21hcCkp CisgICAgeworICAgICAgYm0xID0gbWNfYXNzcSAoYml0bWFwLCBjbWFwKTsKKyAgICAgIGlmIChD T05TUCAoYm0xKSkKKyAgICAgICAgeworICAgICAgICAgIGlmICgoYm0xID0gWENEUiAoYm0xKSks IE5JTFAgKGJtMSkpCisgICAgICAgICAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAg ICAgICAgICBpZiAoQ09OU1AgKGJtMSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGxu MSA9IFhGSVhOVU0gKEZsZW5ndGggKGJtMSkpOworICAgICAgICAgICAgICBpZiAocGFydGlhbF9w KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGlmIChsbjEgPiBpeDIpCisg ICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBibSA9IG1jX250aCAo aXgyLCBibTEpOworICAgICAgICAgICAgICAgICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAg ICAgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5kOworICAgICAgICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGxuMSA+IGl4MSkKKyAgICAgICAgICAgICAgICAg ICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBibSA9IG1jX250aCAoaXgxLCBibTEpOwor ICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmICgoYm0gPSBi bTEsICFFUSAoYm0sIFF0KSkpCisgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgIH0K KyAgICB9CisgIGlmICghRVEgKGNtYXAsIEJWQVIgKCZidWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9p bmRpY2F0b3JfYWxpc3QpKQorICAgICAgJiYgIU5JTFAgKEJWQVIgKCZidWZmZXJfZGVmYXVsdHMs IGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKSkKKyAgICB7CisgICAgICBibTIgPSBtY19hc3NxIChi aXRtYXAsIEJWQVIgKCZidWZmZXJfZGVmYXVsdHMsIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKTsK KyAgICAgIGlmIChDT05TUCAoYm0yKSkKKyAgICAgICAgeworICAgICAgICAgIGlmICgoYm0yID0g WENEUiAoYm0yKSksICFOSUxQIChibTIpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBp ZiAoQ09OU1AgKGJtMikpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgbG4y ID0gWEZJWE5VTSAoRmxlbmd0aCAoYm0yKSk7CisgICAgICAgICAgICAgICAgICBpZiAocGFydGlh bF9wKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgaWYgKGxu MiA+IGl4MikKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgYm0gPSBtY19udGggKGl4MiwgYm0yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAg aWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5k OworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAg ICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICBpZiAobG4x ID4gaXgxKQorICAgIHsKKyAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMSk7CisgICAgICBpZiAo IUVRIChibSwgUXQpKQorICAgICAgICBnb3RvIGZvdW5kOworICAgIH0KKyAgaWYgKGxuMiA+IGl4 MSkKKyAgICB7CisgICAgICBibSA9IG1jX250aCAoaXgxLCBibTIpOworICAgICAgaWYgKCFFUSAo Ym0sIFF0KSkKKyAgICAgICAgZ290byBmb3VuZDsKKyAgICAgIHJldHVybiBNQ19OT19GUklOR0Vf QklUTUFQOworICAgIH0KKyAgICBlbHNlIGlmICgoYm0gPSBibTIsIE5JTFAgKGJtKSkpCisgICAg ICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgZm91bmQ6CisgIHJldHVybiBsb29rdXBf ZnJpbmdlX2JpdG1hcCAoYm0pOworfQorCisvKiBSZWNhbGN1bGF0ZSB0aGUgYml0bWFwcyB0byBz aG93IGluIHRoZSBmcmluZ2VzIG9mIHdpbmRvdyBXLgorICAgT25seSBtYXJrIHJvd3Mgd2l0aCBt b2RpZmllZCBiaXRtYXBzIGZvciB1cGRhdGUgaW4gcmVkcmF3X2ZyaW5nZV9iaXRtYXBzX3AuCisg ICBJZiBLRUVQX0NVUlJFTlRfUCBpcyAwLCB1cGRhdGUgY3VycmVudF9tYXRyaXggdG9vLiAqLwor Ym9vbAorbWNfdXBkYXRlX3dpbmRvd19mcmluZ2VzIChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGtl ZXBfY3VycmVudF9wKQoreworICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csICpjdXIgPSAwOworICBp bnQgeWIgPSB3aW5kb3dfdGV4dF9ib3R0b21feSAodyk7CisgIGludCBybiwgbnJvd3MgPSB3LT5j dXJyZW50X21hdHJpeC0+bnJvd3M7CisgIGludCB5OworICBib29sIHJlZHJhd19wID0gMDsKKyAg TGlzcF9PYmplY3QgYm91bmRhcnlfdG9wID0gUW5pbCwgYm91bmRhcnlfYm90ID0gUW5pbDsKKyAg TGlzcF9PYmplY3QgYXJyb3dfdG9wID0gUW5pbCwgYXJyb3dfYm90ID0gUW5pbDsKKyAgTGlzcF9P YmplY3QgZW1wdHlfcG9zOworICBMaXNwX09iamVjdCBpbmQgPSBRbmlsOworI2RlZmluZSBNQVhf QklUTUFQX0NBQ0hFICg4KjQpCisgIGludCBiaXRtYXBfY2FjaGVbTUFYX0JJVE1BUF9DQUNIRV07 CisgIGludCB0b3BfaW5kX3JuLCBib3RfaW5kX3JuOworICBpbnQgdG9wX2luZF9taW5feSwgYm90 X2luZF9tYXhfeTsKKyAgLyogdG9wX2luZF9ybiBpcyBzZXQgdG8gYSBub25uZWdhdGl2ZSB2YWx1 ZSB3aGVuZXZlcgorICAgICByb3ctPmluZGljYXRlX2JvYl9wIGlzIHNldCwgc28gaXQncyBPSyB0 aGF0IHRvcF9yb3dfZW5kc19hdF96dl9wCisgICAgIGlzIG5vdCBpbml0aWFsaXplZCBoZXJlLiAg U2ltaWxhcmx5IGZvciBib3RfaW5kX3JuLAorICAgICByb3ctPmluZGljYXRlX2VvYl9wIGFuZCBi b3Rfcm93X2VuZHNfYXRfenZfcC4gKi8KKyAgaW50IHRvcF9yb3dfZW5kc19hdF96dl9wIE1DX0lG X0xJTlQgKD0gMCksIGJvdF9yb3dfZW5kc19hdF96dl9wIE1DX0lGX0xJTlQgKD0gMCk7CisgIGlm ICh3LT5wc2V1ZG9fd2luZG93X3ApCisgICAgcmV0dXJuIDA7CisgIGlmICghTUlOSV9XSU5ET1df UCAodykKKyAgICAgICYmIChpbmQgPSBCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGluZGlj YXRlX2J1ZmZlcl9ib3VuZGFyaWVzKSwgIU5JTFAgKGluZCkpKQorICAgIHsKKyAgICAgIGlmIChF USAoaW5kLCBRbGVmdCkgfHwgRVEgKGluZCwgUXJpZ2h0KSkKKyAgICAgICAgYm91bmRhcnlfdG9w ID0gYm91bmRhcnlfYm90ID0gYXJyb3dfdG9wID0gYXJyb3dfYm90ID0gaW5kOworICAgICAgICBl bHNlIGlmIChDT05TUCAoaW5kKQorICAgICAgICAgICAgICAgICAmJiBDT05TUCAoWENBUiAoaW5k KSkpCisgICAgICAgIHsKKyAgICAgICAgICBMaXNwX09iamVjdCBwb3M7CisgICAgICAgICAgaWYg KHBvcyA9IG1jX2Fzc3EgKFF0LCBpbmQpLCAhTklMUCAocG9zKSkKKyAgICAgICAgICAgIGJvdW5k YXJ5X3RvcCA9IGJvdW5kYXJ5X2JvdCA9IGFycm93X3RvcCA9IGFycm93X2JvdCA9IFhDRFIgKHBv cyk7CisgICAgICAgICAgaWYgKHBvcyA9IG1jX2Fzc3EgKFF0b3AsIGluZCksICFOSUxQIChwb3Mp KQorICAgICAgICAgICAgYm91bmRhcnlfdG9wID0gWENEUiAocG9zKTsKKyAgICAgICAgICBpZiAo cG9zID0gbWNfYXNzcSAoUWJvdHRvbSwgaW5kKSwgIU5JTFAgKHBvcykpCisgICAgICAgICAgICBi b3VuZGFyeV9ib3QgPSBYQ0RSIChwb3MpOworICAgICAgICAgIGlmIChwb3MgPSBtY19hc3NxIChR dXAsIGluZCksICFOSUxQIChwb3MpKQorICAgICAgICAgICAgYXJyb3dfdG9wID0gWENEUiAocG9z KTsKKyAgICAgICAgICBpZiAocG9zID0gbWNfYXNzcSAoUWRvd24sIGluZCksICFOSUxQIChwb3Mp KQorICAgICAgICAgICAgYXJyb3dfYm90ID0gWENEUiAocG9zKTsKKyAgICAgICAgfQorICAgICAg ICBlbHNlCisgICAgICAgICAgLyogQW55dGhpbmcgZWxzZSBtZWFucyBib3VuZGFyeSBvbiBsZWZ0 IGFuZCBubyBhcnJvd3MuICovCisgICAgICAgICAgYm91bmRhcnlfdG9wID0gYm91bmRhcnlfYm90 ID0gUWxlZnQ7CisgICAgfQorICB0b3BfaW5kX3JuID0gYm90X2luZF9ybiA9IC0xOworICBpZiAo IU5JTFAgKGluZCkpCisgICAgeworICAgICAgZm9yICh5ID0gdy0+dnNjcm9sbCwgcm4gPSAwOwor ICAgICAgICAgICB5IDwgeWIgJiYgcm4gPCBucm93czsKKyAgICAgICAgICAgeSArPSByb3ctPmhl aWdodCwgKytybikKKyAgICAgICAgeworICAgICAgICAgIHJvdyA9IHctPmRlc2lyZWRfbWF0cml4 LT5yb3dzICsgcm47CisgICAgICAgICAgaWYgKCFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgICAg IHJvdyA9IHctPmN1cnJlbnRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgcm93LT5pbmRp Y2F0ZV9ib2JfcCA9IHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcCA9IDA7CisgICAgICAgICAgcm93 LT5pbmRpY2F0ZV9lb2JfcCA9IHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCA9IDA7CisgICAg ICAgICAgaWYgKCFyb3ctPm1vZGVfbGluZV9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAg ICBpZiAodG9wX2luZF9ybiA8IDAgJiYgcm93LT52aXNpYmxlX2hlaWdodCA+IDApCisgICAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgICAgaWYgKE1BVFJJWF9ST1dfU1RBUlRfQ0hBUlBP UyAocm93KSA8PSBCVUZfQkVHViAoWEJVRkZFUiAody0+Y29udGVudHMpKQorICAgICAgICAgICAg ICAgICAgICAgICYmICFNQVRSSVhfUk9XX1BBUlRJQUxMWV9WSVNJQkxFX0FUX1RPUF9QICh3LCBy b3cpKQorICAgICAgICAgICAgICAgICAgICByb3ctPmluZGljYXRlX2JvYl9wID0gIU5JTFAgKGJv dW5kYXJ5X3RvcCk7CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAg ICAgICByb3ctPmluZGljYXRlX3RvcF9saW5lX3AgPSAhTklMUCAoYXJyb3dfdG9wKTsKKyAgICAg ICAgICAgICAgICAgIHRvcF9pbmRfcm4gPSBybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgIGlmIChib3RfaW5kX3JuIDwgMCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgICBpZiAoTUFUUklYX1JPV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gICAgaWYgKEVRIChib3VuZGFyeV90b3AsIFFsZWZ0KSkKKyAgICAgICAgICAg IGJuID0gKChyb3ctPmluZGljYXRlX2VvYl9wICYmIEVRIChib3VuZGFyeV9ib3QsIFFsZWZ0KSkK KyAgICAgICAgICAgICAgICAgID8gTUNfTEVGVF9GUklOR0UgKDEsIFF0b3BfYm90dG9tLCByb3ct PmVuZHNfYXRfenZfcCkKKyAgICAgICAgICAgICAgICAgIDogTUNfTEVGVF9GUklOR0UgKDIsIFF0 b3AsIDApKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgYm4gPSAoKHJvdy0+aW5k aWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5kYXJ5X2JvdCwgUXJpZ2h0KSkKKyAgICAgICAgICAgICAg ICAgICAgPyBNQ19SSUdIVF9GUklOR0UgKDEsIFF0b3BfYm90dG9tLCByb3ctPmVuZHNfYXRfenZf cCkKKyAgICAgICAgICAgICAgICAgICAgOiBNQ19SSUdIVF9GUklOR0UgKDIsIFF0b3AsIDApKTsK KyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX3RvcF9saW5lX3ApCisg ICAgICAgICAgeworICAgICAgICAgICAgaWYgKEVRIChhcnJvd190b3AsIFFsZWZ0KSkKKyAgICAg ICAgICAgICAgYm4gPSBNQ19MRUZUX0ZSSU5HRSAoNiwgUXVwLCAwKTsKKyAgICAgICAgICAgICAg ZWxzZQorICAgICAgICAgICAgICAgIGJuID0gTUNfUklHSFRfRlJJTkdFICg2LCBRdXAsIDApOwor ICAgICAgICAgIH0KKyAgICAgIGlmIChibiAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAg ICB7CisgICAgICAgICAgc3RydWN0IGZyaW5nZV9iaXRtYXAgKmZiID0gZ2V0X2ZyaW5nZV9iaXRt YXBfZGF0YSAoYm4pOworICAgICAgICAgIGlmIChmYi0+YWxpZ24gPT0gQUxJR05fQklUTUFQX1RP UCAmJiBmYi0+cGVyaW9kID09IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHN0cnVj dCBnbHlwaF9yb3cgKnJvdzE7CisgICAgICAgICAgICAgIGludCB0b3BfaW5kX21heF95OworICAg ICAgICAgICAgICB0b3BfaW5kX21pbl95ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7 CisgICAgICAgICAgICAgIHRvcF9pbmRfbWF4X3kgPSB0b3BfaW5kX21pbl95ICsgZmItPmhlaWdo dDsKKyAgICAgICAgICAgICAgaWYgKHRvcF9pbmRfbWF4X3kgPiB5YikKKyAgICAgICAgICAgICAg ICB0b3BfaW5kX21heF95ID0geWI7CisgICAgICAgICAgICAgIGZvciAoeSA9IHJvdy0+eSArIHJv dy0+aGVpZ2h0LCBybiA9IHRvcF9pbmRfcm4gKyAxOworICAgICAgICAgICAgICAgICAgIHkgPCB0 b3BfaW5kX21heF95ICYmIHJuIDwgbnJvd3M7CisgICAgICAgICAgICAgICAgICAgeSArPSByb3cx LT5oZWlnaHQsIHJuKyspCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgaWYg KGJvdF9pbmRfcm4gPj0gMCAmJiBybiA+PSBib3RfaW5kX3JuKQorICAgICAgICAgICAgICAgICAg ICBicmVhazsKKyAgICAgICAgICAgICAgICAgIHJvdzEgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93 cyArIHJuOworICAgICAgICAgICAgICAgICAgaWYgKCFyb3cxLT5lbmFibGVkX3ApCisgICAgICAg ICAgICAgICAgICAgIHJvdzEgPSB3LT5jdXJyZW50X21hdHJpeC0+cm93cyArIHJuOworICAgICAg ICAgICAgICAgICAgcm93MS0+aW5kaWNhdGVfYm9iX3AgPSByb3ctPmluZGljYXRlX2JvYl9wOwor ICAgICAgICAgICAgICAgICAgcm93MS0+aW5kaWNhdGVfdG9wX2xpbmVfcCA9IHJvdy0+aW5kaWNh dGVfdG9wX2xpbmVfcDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAg IH0KKyAgICB9CisgIGlmIChib3RfaW5kX3JuID49IDApCisgICAgeworICAgICAgaW50IGJuID0g TUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgIHJvdyA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dz ICsgYm90X2luZF9ybjsKKyAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgICAgIHJvdyA9 IHctPmN1cnJlbnRfbWF0cml4LT5yb3dzICsgYm90X2luZF9ybjsKKyAgICAgIGJvdF9yb3dfZW5k c19hdF96dl9wID0gcm93LT5lbmRzX2F0X3p2X3A7CisgICAgICBpZiAocm93LT5pbmRpY2F0ZV9l b2JfcCkKKyAgICAgICAgeworICAgICAgICAgIGlmIChFUSAoYm91bmRhcnlfYm90LCBRbGVmdCkp CisgICAgICAgICAgICBibiA9IE1DX0xFRlRfRlJJTkdFICgzLCBRYm90dG9tLCByb3ctPmVuZHNf YXRfenZfcCk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGJuID0gTUNfUklHSFRf RlJJTkdFICgzLCBRYm90dG9tLCByb3ctPmVuZHNfYXRfenZfcCk7CisgICAgICAgIH0KKyAgICAg ICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wKQorICAgICAgICAgIHsKKyAg ICAgICAgICAgIGlmIChFUSAoYXJyb3dfYm90LCBRbGVmdCkpCisgICAgICAgICAgICAgIGJuID0g TUNfTEVGVF9GUklOR0UgKDcsIFFkb3duLCAwKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICAgIGJuID0gTUNfUklHSFRfRlJJTkdFICg3LCBRZG93biwgMCk7CisgICAgICAgICAg fQorICAgICAgaWYgKGJuICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgIHsKKyAgICAg ICAgICBzdHJ1Y3QgZnJpbmdlX2JpdG1hcCAqZmIgPSBnZXRfZnJpbmdlX2JpdG1hcF9kYXRhIChi bik7CisgICAgICAgICAgaWYgKGZiLT5hbGlnbiA9PSBBTElHTl9CSVRNQVBfQk9UVE9NICYmIGZi LT5wZXJpb2QgPT0gMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgc3RydWN0IGdseXBo X3JvdyAqcm93MTsKKyAgICAgICAgICAgICAgaW50IGJvdF9pbmRfbWluX3k7CisgICAgICAgICAg ICAgIGJvdF9pbmRfbWF4X3kgPSByb3ctPnkgKyByb3ctPnZpc2libGVfaGVpZ2h0OworICAgICAg ICAgICAgICBib3RfaW5kX21pbl95ID0gYm90X2luZF9tYXhfeSAtIGZiLT5oZWlnaHQ7CisgICAg ICAgICAgICAgIGlmIChib3RfaW5kX21pbl95IDwgV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAo dykpCisgICAgICAgICAgICAgICAgYm90X2luZF9taW5feSA9IFdJTkRPV19IRUFERVJfTElORV9I RUlHSFQgKHcpOworICAgICAgICAgICAgICBmb3IgKHkgPSByb3ctPnksIHJuID0gYm90X2luZF9y biAtIDE7CisgICAgICAgICAgICAgICAgICAgeSA+PSBib3RfaW5kX21pbl95ICYmIHJuID49IDA7 CisgICAgICAgICAgICAgICAgICAgeSAtPSByb3cxLT5oZWlnaHQsIHJuLS0pCisgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgaWYgKHRvcF9pbmRfcm4gPj0gMCAmJiBybiA8PSB0 b3BfaW5kX3JuKQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAg IHJvdzEgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHJuOworICAgICAgICAgICAgICAgICAg aWYgKCFyb3cxLT5lbmFibGVkX3ApCisgICAgICAgICAgICAgICAgICAgIHJvdzEgPSB3LT5jdXJy ZW50X21hdHJpeC0+cm93cyArIHJuOworICAgICAgICAgICAgICAgICAgcm93MS0+aW5kaWNhdGVf ZW9iX3AgPSByb3ctPmluZGljYXRlX2VvYl9wOworICAgICAgICAgICAgICAgICAgcm93MS0+aW5k aWNhdGVfYm90dG9tX2xpbmVfcCA9IHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcDsKKyAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIGJvb2wgYXV0 b19oc2Nyb2xsX21vZGVfcCA9IEVRIChGYnVmZmVyX2xvY2FsX3ZhbHVlIChRYXV0b19oc2Nyb2xs X21vZGUsIHctPmNvbnRlbnRzKSwgUWN1cnJlbnRfbGluZSk7CisgIC8qIEVYQU1QTEU6ICAoc2Ny b2xsLWxlZnQgNSkgKi8KKyAgYm9vbCBoc2NsX2FsbF90ZW1wX3AgPSAody0+c3VzcGVuZF9hdXRv X2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVf cAorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTog IEMtdSBDLXggPCBhbmQgZG8gbm90aGluZy4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzBfcCA9 ICh3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5o c2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xs ID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHct PmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBzb21ldGhpbmcgZWxz ZSBiZXNpZGVzIGhvcml6b250YWxseSBzY3JvbGxpbmcgdGhlCisgICAgICAgICAgICAgICBjdXJy ZW50IGxpbmUgZGlmZmVyZW50bHkuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgaXMgX25v dF8gaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfYWxs X3Blcm1fMV9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHct Pm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9o c2Nyb2xsID09IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCAuLi4K KyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFsbHkgc2Nyb2xs ZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8yX3AgPSAoIXctPnN1c3Bl bmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Ny b2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPT0g MAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhzY3JvbGwp OworICAvKiBFWEFNUExFOiAgKHNjcm9sbC1sZWZ0IDUpOyBhbmQsIHRoZW4gcHJlc3MgdGhlIGxl ZnQgYXJyb3cga2V5IG9uZSB0aW1lLgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIF9pc18g aG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiovCisgIGJvb2wgaHNjbF90ZW1wX3Ag PSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0 b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAw CisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gMCk7CisgIC8qIEVY QU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIHNvbWV0aGluZyB0aGF0IGNhdXNlcyB0aGUgY3VycmVu dCBsaW5lIHRvIGJlCisgICAgICAgICAgICAgICBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVy ZW50bHkuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkgc2Ny b2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9wZXJtX3AgPSAoIXctPnN1c3BlbmRf YXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVf cAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAg ICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYg dy0+bWluX2hzY3JvbGwgIT0gdy0+aHNjcm9sbCk7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFN RSAody0+ZnJhbWUpOworICBmb3IgKHkgPSB3LT52c2Nyb2xsLCBybiA9IDA7CisgICAgICAgeSA8 IHliICYmIHJuIDwgbnJvd3M7CisgICAgICAgeSArPSByb3ctPmhlaWdodCwgcm4rKykKKyAgICB7 CisgIGludCBsZWZ0LCByaWdodDsKKyAgdW5zaWduZWQgbGVmdF9mYWNlX2lkLC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ICAgLy8gICAgICAgICAg ICAgICAgICAgICAgICAgIC5ncmVlbiA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhfY21dLmNhY2hl W2NhY2hlX3R5cGVdW250aF0uZmcuZ3JlZW4sCisgICAgICAvLyAgICAgICAgICAgICAgICAgICAg ICAgICAgLmJsdWUgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoX2NtXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLmZnLmJsdWV9OworICAgICAgLy8gIHN0cnVjdCBtY19SR0IgbHNsX2JnID0gey5yZWQg PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoX2NtXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLnJl ZCwKKyAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSB3LT5tY19tYXRy aXgudnBvc1t2bnRoX2NtXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLmdyZWVuLAorICAgICAg Ly8gICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF9jbV0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5iZy5ibHVlfTsKKyAgICAgIGJvb2wgYWN0aXZl X3AgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoX2NtXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmFj dGl2ZV9wOworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gdy0+bWNfbWF0cml4 LnZwb3Nbdm50aF9jbV0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5nbHlwaF9mbGF2b3I7CisgICAg ICBib29sIGVuYWJsZWRfcCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhfY21dLmNhY2hlW2NhY2hl X3R5cGVdW250aF0uZW5hYmxlZF9wOworICAgICAgaWYgKCh2cG9zID09IHZudGhfZG0gfHwgdnBv cyA9PSB2bnRoX2NtKQorICAgICAgICAg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gICAg ICAgICAgICAgICAgICAgICAgICAgID8gb3ZlcmxheV9hcnJvd19mYWNlX2lkCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICBp ZiAody0+aHNjcm9sbCAhPSAwKQorICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9m cmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ciKSwgZmFsc2UsIHRydWUp OworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0 X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistb3ZlcmxheS1hcnJvdyIpLCB0cnVlLCB0cnVl KTsKKyAgICAgICAgICBtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0gTUNf TEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IGZyaW5nZV9iaXRtYXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19O T19GUklOR0VfQklUTUFQOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKCh2cG9zID09IHZu dGhfZG0gfHwgdnBvcyA9PSB2bnRoX2NtKQorICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2 b3IgPT0gTUNfT1ZFUkxBWV9BUlJPV19CSVRNQVAKKyAgICAgICAgICAgICAgICAgJiYgKGhzY2xf YWxsX3RlbXBfcAorICAgICAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8wX3AKKyAg ICAgICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxsX3Blcm1fMV9wCisgICAgICAgICAgICAgICAg ICAgICB8fCBoc2NsX2FsbF9wZXJtXzJfcAorICAgICAgICAgICAgICAgICAgICAgfHwgaHNjbF90 ZW1wX3AKKyAgICAgICAgICAgICAgICAgICAgIHx8IGhzY2xfcGVybV9wKQorICAgICAgICAgICAg ICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgeworICAgICAgICAgICAgaW50IGZyaW5nZV9i aXRtYXAgPSBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgICAgZW51bSBmYWNlX2lkIG92 ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICAgICAgICghYWN0aXZlX3AKKyAgICAgICAg ICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2luYWN0aXZl X3dpbmRvd3MpKSkKKyAgICAgICAgICAgICAgPyBsb29rdXBfZGVyaXZlZF9mYWNlICh3LCBmLCBp bnRlcm4gKCIrLW92ZXJsYXktYXJyb3ctaHNjbC1pbmFjdGl2ZS1wcmUtenYtZmFjZSIpLCBGUklO R0VfRkFDRV9JRCwgdHJ1ZSkKKyAgICAgICAgICAgICAgOiAoYWN0aXZlX3ApCisgICAgICAgICAg ICAgICAgPyBsb29rdXBfZGVyaXZlZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJy b3ctaHNjbC1wcmUtenYtZmFjZSIpLCBGUklOR0VfRkFDRV9JRCwgdHJ1ZSkKKyAgICAgICAgICAg ICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgICBtY19sZWZ0X2ZyaW5nZV9mYWNlX2lk ID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBvdmVybGF5X2Fycm93X2ZhY2VfaWQKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAg ICAgICBpZiAoaHNjbF9hbGxfcGVybV8wX3ApCisgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAg PSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgZmFsc2Us IGZhbHNlKTsKKyAgICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF9hbGxfcGVybV8xX3ApCisgICAg ICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRl cm4gKCIrLWhzY2wtcGVybSIpLCB0cnVlLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgZWxzZSBp ZiAoaHNjbF9hbGxfcGVybV8yX3ApCisgICAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0g bWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIGZhbHNlLCB0 cnVlKTsKKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xfcGVybV9wKQorICAgICAgICAg ICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVy biAoIistaHNjbC1wZXJtIiksIHRydWUsIHRydWUpOworICAgICAgICAgICAgICAgICAgICBlbHNl IGlmIChoc2NsX2FsbF90ZW1wX3ApCisgICAgICAgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1h cCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtdGVtcCIpLCBmYWxz ZSwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xfdGVtcF9wKQor ICAgICAgICAgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0 bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtdGVtcCIpLCB0cnVlLCBmYWxzZSk7CisgICAgICAgICAg ICBtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0Vf QklUTUFQKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZnJpbmdlX2Jp dG1hcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfTk9fRlJJTkdF X0JJVE1BUDsKKyAgICAgICAgICB9CisgICAgICAgICAgZWxzZSBpZiAoKHZwb3MgPT0gdm50aF9k bSB8fCB2cG9zID09IHZudGhfY20pCisgICAgICAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2 b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAg ICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklH SFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19I T0xMT1dfUkVDVEFOR0xFCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3Ig PT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICB8 fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisg ICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFS CisgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURf VkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0g TUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSCkKKyAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxl ZF9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBMaXNwX09iamVjdCBiaXRtYXBfZmxh dm9yID0gKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfaG9sbG93X3Jl Y3RhbmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklH SFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g UW1jX3JldmVyc2VkX2hvbGxvd19yZWN0YW5nbGVfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1df UkVDVEFOR0xFKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IFFtY19ob2xsb3dfcmVjdGFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNh bF9iYXJfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJS T1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3Jl dmVyc2VkX3ZlcnRpY2FsX2Jhcl9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUikKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxf YmFyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9m bGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19yZXZlcnNlZF92ZXJ0aWNhbF9iYXIKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBN Q19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXJfYmFja3NsYXNoCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFFuaWw7CisgICAgICAgICAgICAgIG1jX3Jp Z2h0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1B UCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9mcmlu Z2VfYml0bWFwIChiaXRtYXBfZmxhdm9yKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICAgICAgbWNfcmlnaHRf ZnJpbmdlX2ZhY2VfaWQgPQorICAgICAgICAgICAgICAgIChjdXJzb3JfdHlwZSA9PSBNQ19SSUdI VF9GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVf WlYKKyAgICAgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xM T1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9m bGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAg ICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKSkK KyAgICAgICAgICAgICAgICAgID8gbG9va3VwX2Rlcml2ZWRfZmFjZSAodywgZiwgaW50ZXJuICgi Ky1yZXZlcnNlZC1iYXItcHJlLXp2LWZhY2UiKSwgRlJJTkdFX0ZBQ0VfSUQsIHRydWUpCisgICAg ICAgICAgICAgICAgOiAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAorICAg ICAgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBBVF9aVgorICAgICAgICAgICAgICAg ICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdI VF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVW RVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgIHx8 IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpKQorICAgICAgICAgICAg ICAgICAgPyBsb29rdXBfZGVyaXZlZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJldmVyc2VkLWJh ci1hdC16di1mYWNlIiksIEZSSU5HRV9GQUNFX0lELCB0cnVlKQorICAgICAgICAgICAgICAgIDog KGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAg ICAmJiByb3dfcG9zaXRpb24gPT0gUE9TVF9aVgorICAgICAgICAgICAgICAgICAgICYmIChnbHlw aF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAg ICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElD QUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZv ciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpKQorICAgICAgICAgICAgICAgICAgPyBsb29r dXBfZGVyaXZlZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJldmVyc2VkLWJhci1wb3N0LXp2LWZh Y2UiKSwgRlJJTkdFX0ZBQ0VfSUQsIHRydWUpCisgICAgICAgICAgICAgICAgOiAoY3Vyc29yX3R5 cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAgICYmIHJvd19w b3NpdGlvbiA9PSBQUkVfWlYKKyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0g TUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAg ICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJS T1cKKyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVS VElDQUxfQkFSKQorICAgICAgICAgICAgICAgICAgPyBsb29rdXBfZGVyaXZlZF9mYWNlICh3LCBm LCBpbnRlcm4gKCIrLWJhci1wcmUtenYtZmFjZSIpLCBGUklOR0VfRkFDRV9JRCwgdHJ1ZSkKKyAg ICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisg ICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IEFUX1pWCisgICAgICAgICAgICAg ICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklH SFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJT RURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhf Zmxhdm9yICE9IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgID8g bG9va3VwX2Rlcml2ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1iYXItYXQtenYtZmFjZSIpLCBG UklOR0VfRkFDRV9JRCwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChjdXJzb3JfdHlwZSA9PSBN Q19SSUdIVF9GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9u ID09IFBPU1RfWlYKKyAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVW RVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICYm IGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAg ICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxf QkFSKQorICAgICAgICAgICAgICAgICAgPyBsb29rdXBfZGVyaXZlZF9mYWNlICh3LCBmLCBpbnRl cm4gKCIrLWJhci1wb3N0LXp2LWZhY2UiKSwgRlJJTkdFX0ZBQ0VfSUQsIHRydWUpCisgICAgICAg ICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAg ICAgIGlmICghcm93LT5lbmFibGVkX3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Fycm93X3RvcCwgUWxlZnQpKQorICAgICAgICB7CisgICAgICAg ICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdFICg2LCBRdXAsIDApOworICAgICAgICAgIGlmICh0b3Bf aW5kX21pbl95ID49IDApCisgICAgICAgICAgICBsZWZ0X29mZnNldCA9IHRvcF9pbmRfbWluX3kg LSByb3ctPnk7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfYm90dG9t X2xpbmVfcCAmJiBFUSAoYXJyb3dfYm90LCBRbGVmdCkpCisgICAgICAgIHsKKyAgICAgICAgICBs ZWZ0ID0gTUNfTEVGVF9GUklOR0UgKDcsIFFkb3duLCAwKTsKKyAgICAgICAgICBpZiAoYm90X2lu ZF9tYXhfeSA+PSAwKQorICAgICAgICAgICAgbGVmdF9vZmZzZXQgPSBib3RfaW5kX21heF95IC0g KHJvdy0+eSArIHJvdy0+dmlzaWJsZV9oZWlnaHQpOworICAgICAgICB9CisgICAgICBlbHNlCisg ICAgICAgIGxlZnQgPSBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgLyogRGVjaWRlIHdoaWNo IGJpdG1hcCB0byBkcmF3IGluIHRoZSByaWdodCBmcmluZ2UuICovCisgICAgICBpZiAoV0lORE9X X1JJR0hUX0ZSSU5HRV9XSURUSCAodykgPT0gMCkKKyAgICAgICAgcmlnaHQgPSBNQ19OT19GUklO R0VfQklUTUFQOworICAgICAgZWxzZSBpZiAocm93LT5yaWdodF91c2VyX2ZyaW5nZV9iaXRtYXAg IT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgeworICAgICAgICAgIHJpZ2h0ID0gcm93 LT5yaWdodF91c2VyX2ZyaW5nZV9iaXRtYXA7CisgICAgICAgICAgcmlnaHRfZmFjZV9pZCA9IHJv dy0+cmlnaHRfdXNlcl9mcmluZ2VfZmFjZV9pZDsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAo KCFyb3ctPnJldmVyc2VkX3AgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAg ICAgICAgIHx8IChyb3ctPnJldmVyc2VkX3AgJiYgcm93LT50cnVuY2F0ZWRfb25fbGVmdF9wKSkK KyAgICAgICAgcmlnaHQgPSBNQ19SSUdIVF9GUklOR0UgKDAsIFF0cnVuY2F0aW9uLCAwKTsKKyAg ICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfYm9iX3AgJiYgRVEgKGJvdW5kYXJ5X3RvcCwgUXJp Z2h0KSkKKyAgICAgICAgeworICAgICAgICAgIHJpZ2h0ID0gKChyb3ctPmluZGljYXRlX2VvYl9w ICYmIEVRIChib3VuZGFyeV9ib3QsIFFyaWdodCkpCisgICAgICAgICAgICAgPyBNQ19SSUdIVF9G UklOR0UgKDEsIFF0b3BfYm90dG9tLCB0b3Bfcm93X2VuZHNfYXRfenZfcCkKKyAgICAgICAgICAg ICA6IE1DX1JJR0hUX0ZSSU5HRSAoMiwgUXRvcCwgMCkpOworICAgICAgICAgIGlmICh0b3BfaW5k X21pbl95ID49IDApCisgICAgICAgICAgICByaWdodF9vZmZzZXQgPSB0b3BfaW5kX21pbl95IC0g cm93LT55OworICAgICAgICB9CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2VvYl9wICYm IEVRIChib3VuZGFyeV9ib3QsIFFyaWdodCkpCisgICAgICAgIHsKKyAgICAgICAgICByaWdodCA9 IE1DX1JJR0hUX0ZSSU5HRSAoMywgUWJvdHRvbSwgYm90X3Jvd19lbmRzX2F0X3p2X3ApOworICAg ICAgICAgIGlmIChib3RfaW5kX21heF95ID49IDApCisgICAgICAgICAgICByaWdodF9vZmZzZXQg PSBib3RfaW5kX21heF95IC0gKHJvdy0+eSArIHJvdy0+dmlzaWJsZV9oZWlnaHQpOworICAgICAg ICB9CisgICAgICBlbHNlIGlmICgoIXJvdy0+cmV2ZXJzZWRfcCAmJiByb3ctPmNvbnRpbnVlZF9w KQorICAgICAgICAgICAgICAgfHwgKHJvdy0+cmV2ZXJzZWRfcCAmJiBNQVRSSVhfUk9XX0NPTlRJ TlVBVElPTl9MSU5FX1AgKHJvdykpKQorICAgICAgICByaWdodCA9IE1DX1JJR0hUX0ZSSU5HRSAo NCwgUWNvbnRpbnVhdGlvbiwgMCk7CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX3RvcF9s aW5lX3AgJiYgRVEgKGFycm93X3RvcCwgUXJpZ2h0KSkKKyAgICAgICAgeworICAgICAgICAgIHJp Z2h0ID0gTUNfUklHSFRfRlJJTkdFICg2LCBRdXAsIDApOworICAgICAgICAgIGlmICh0b3BfaW5k X21pbl95ID49IDApCisgICAgICAgICAgICByaWdodF9vZmZzZXQgPSB0b3BfaW5kX21pbl95IC0g cm93LT55OworICAgICAgICB9CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2JvdHRvbV9s aW5lX3AgJiYgRVEgKGFycm93X2JvdCwgUXJpZ2h0KSkKKyAgICAgICAgeworICAgICAgICAgIHJp Z2h0ID0gTUNfUklHSFRfRlJJTkdFICg3LCBRZG93biwgMCk7CisgICAgICAgICAgaWYgKGJvdF9p bmRfbWF4X3kgPj0gMCkKKyAgICAgICAgICAgIHJpZ2h0X29mZnNldCA9IGJvdF9pbmRfbWF4X3kg LSAocm93LT55ICsgcm93LT52aXNpYmxlX2hlaWdodCk7CisgICAgICAgIH0KKyAgICAgIGVsc2Ug aWYgKHJvdy0+aW5kaWNhdGVfZW1wdHlfbGluZV9wICYmIEVRIChlbXB0eV9wb3MsIFFyaWdodCkp CisgICAgICAgIHJpZ2h0ID0gTUNfUklHSFRfRlJJTkdFICg1LCBRZW1wdHlfbGluZSwgMCk7Cisg ICAgICBlbHNlCisgICAgICAgIHJpZ2h0ID0gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgIHBl cmlvZGljX3AgPSAoZ2V0X2ZyaW5nZV9iaXRtYXBfZGF0YSAobGVmdCktPnBlcmlvZCAhPSAwCis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VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVAKKyAg ICAgICAgICAgICAgICAgIHx8IG1jX3JpZ2h0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdF X0JJVE1BUCkKKyAgICAgICAgICAgICAgICBjdXItPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcCA9 IGZhbHNlOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIGN1ci0+ZnJp bmdlX2JpdG1hcF9wZXJpb2RpY19wID0gcGVyaW9kaWNfcDsKKyAgICAgICAgICAgICAgaWYgKG1j X2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAg ICAgIGN1ci0+bGVmdF9mcmluZ2VfYml0bWFwID0gbWNfbGVmdF9mcmluZ2VfYml0bWFwOworICAg ICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIGN1ci0+bGVmdF9mcmluZ2VfYml0 bWFwID0gbGVmdDsKKyAgICAgICAgICAgICAgaWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBN Q19OT19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgIGN1ci0+bGVmdF9mcmluZ2VfZmFj ZV9pZCA9IG1jX2xlZnRfZnJpbmdlX2ZhY2VfaWQ7CisgICAgICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICAgICAgY3VyLT5sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gbGVmdF9mYWNlX2lkOwor ICAgICAgICAgICAgICBpZiAobWNfbGVmdF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9C SVRNQVApCisgICAgICAgICAgICAgICAgY3VyLT5sZWZ0X2ZyaW5nZV9vZmZzZXQgPSAwOworICAg ICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIGN1ci0+bGVmdF9mcmluZ2Vfb2Zm c2V0ID0gbGVmdF9vZmZzZXQ7CisgICAgICAgICAgICAgIGlmIChtY19yaWdodF9mcmluZ2VfYml0 bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9m cmluZ2VfYml0bWFwID0gbWNfcmlnaHRfZnJpbmdlX2JpdG1hcDsKKyAgICAgICAgICAgICAgICBl bHNlCisgICAgICAgICAgICAgICAgICBjdXItPnJpZ2h0X2ZyaW5nZV9iaXRtYXAgPSByaWdodDsK KyAgICAgICAgICAgICAgaWYgKG1jX3JpZ2h0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdF X0JJVE1BUCkKKyAgICAgICAgICAgICAgICBjdXItPnJpZ2h0X2ZyaW5nZV9mYWNlX2lkID0gbWNf cmlnaHRfZnJpbmdlX2ZhY2VfaWQ7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICAgICAgY3VyLT5yaWdodF9mcmluZ2VfZmFjZV9pZCA9IHJpZ2h0X2ZhY2VfaWQ7CisgICAgICAg ICAgICAgIGlmIChtY19yaWdodF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVAp CisgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2Vfb2Zmc2V0ID0gMDsKKyAgICAgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPnJpZ2h0X2ZyaW5nZV9vZmZzZXQg PSByaWdodF9vZmZzZXQ7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGlmIChyb3ct Pm92ZXJsYXlfYXJyb3dfYml0bWFwIDwgMCkKKyAgICAgICAgcm93LT5vdmVybGF5X2Fycm93X2Jp dG1hcCA9IG1jX2dldF9sb2dpY2FsX2ZyaW5nZV9iaXRtYXAgKHcsIFFvdmVybGF5X2Fycm93LCAw LCAwKTsKKyAgICAgIGlmIChyb3ctPm92ZXJsYXlfYXJyb3dfYml0bWFwICE9IGN1ci0+b3Zlcmxh eV9hcnJvd19iaXRtYXApCisgICAgICAgIHsKKyAgICAgICAgICByZWRyYXdfcCA9IDEsIHJvdy0+ cmVkcmF3X2ZyaW5nZV9iaXRtYXBzX3AgPSAxOworICAgICAgICAgIGlmICgha2VlcF9jdXJyZW50 X3ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGN1ci0+cmVkcmF3X2ZyaW5nZV9iaXRt YXBzX3AgPSAxOworICAgICAgICAgICAgICBjdXItPm92ZXJsYXlfYXJyb3dfYml0bWFwID0gcm93 LT5vdmVybGF5X2Fycm93X2JpdG1hcDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAg aWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQCisgICAgICAg ICAgfHwgbWNfcmlnaHRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAg ICAgICByb3ctPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcCA9IGZhbHNlOworICAgICAgICBlbHNl CisgICAgICAgICAgcm93LT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3AgPSBwZXJpb2RpY19wOwor ICAgICAgaWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQor ICAgICAgICByb3ctPmxlZnRfZnJpbmdlX2JpdG1hcCA9IG1jX2xlZnRfZnJpbmdlX2JpdG1hcDsK KyAgICAgICAgZWxzZQorICAgICAgICAgIHJvdy0+bGVmdF9mcmluZ2VfYml0bWFwID0gbGVmdDsK KyAgICAgIGlmIChtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkK KyAgICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gbWNfbGVmdF9mcmluZ2VfZmFjZV9p ZDsKKyAgICAgICAgZWxzZQorICAgICAgIC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AodywgbWF4IChoZWFk ZXJfbGluZV9oZWlnaHQsIHJvdy0+eSkpOworICBwLm55ID0gcm93LT52aXNpYmxlX2hlaWdodDsK KyAgaWYgKGxlZnRfcCkKKyAgICB7CisgICAgICBpbnQgd2QgPSBXSU5ET1dfTEVGVF9GUklOR0Vf V0lEVEggKHcpOworICAgICAgaW50IHggPSB3aW5kb3dfYm94X2xlZnQgKHcsIChXSU5ET1dfSEFT X0ZSSU5HRVNfT1VUU0lERV9NQVJHSU5TICh3KQorICAgICAgICAgICA/IExFRlRfTUFSR0lOX0FS RUEKKyAgICAgICAgICAgOiBURVhUX0FSRUEpKTsKKyAgICAgIGlmIChwLndkID4gd2QpCisgICAg ICAgIHAud2QgPSB3ZDsKKyAgICAgIHAueCA9IHggLSBwLndkIC0gKHdkIC0gcC53ZCkgLyAyOwor ICAgICAgaWYgKHAud2QgPCB3ZCB8fCBwLnkgPiBwLmJ5IHx8IHAueSArIHAuaCA8IHAuYnkgKyBw Lm55KQorICAgICAgICB7CisgICAgICAgICAgLyogSWYgVyBoYXMgYSB2ZXJ0aWNhbCBib3JkZXIg dG8gaXRzIGxlZnQsIGRvbid0IGRyYXcgb3ZlciBpdC4gKi8KKyAgICAgICAgICB3ZCAtPSAoKCFX SU5ET1dfTEVGVE1PU1RfUCAodykKKyAgICAgICAgICAgIC8qIFRoaXMgY291bGQgYmUgd3Jvbmcg d2hlbiB3ZSBhbGxvdyB3aW5kb3cgbG9jYWwKKyAgICAgICAgICAgICAgIHJpZ2h0IGRpdmlkZXJz IC0gYnV0IHRoZSB3aW5kb3cgb24gdGhlIGxlZnQgaXMgaGFyZAorICAgICAgICAgICAgICAgdG8g Z2V0LiAqLworICAgICAgICAgICAgJiYgIUZSQU1FX1JJR0hUX0RJVklERVJfV0lEVEggKGYpCisg ICAgICAgICAgICAmJiAhV0lORE9XX0hBU19WRVJUSUNBTF9TQ1JPTExfQkFSICh3KQorICAgICAg ICAgICAgLyogQnV0IGRvbid0IHJlZHVjZSB0aGUgZnJpbmdlIHdpZHRoIGlmIHRoZSB3aW5kb3cK KyAgICAgICAgICAgICAgIGhhcyBhIGxlZnQgbWFyZ2luLCBiZWNhdXNlIHRoYXQgbWVhbnMgd2Ug YXJlIG5vdAorICAgICAgICAgICAgICAgaW4gZGFuZ2VyIG9mIGRyYXdpbmcgb3ZlciB0aGUgdmVy dGljYWwgYm9yZGVyLAorICAgICAgICAgICAgICAgYW5kIE9UT0ggbGVhdmluZyBvdXQgdGhhdCBv bmUgcGl4ZWwgbGVhdmVzIGJlaGluZAorICAgICAgICAgICAgICAgdHJhY2VzIG9mIHRoZSBjdXJz b3IsIGlmIGl0IHdhcyBpbiBjb2x1bW4gemVybworICAgICAgICAgICAgICAgYmVmb3JlIGRyYXdp bmcgbm9uLWVtcHR5IG1hcmdpbiBhcmVhLiAqLworICAgICAgICAgICAgJiYgdy0+bGVmdF9tYXJn aW5fY29scyA9PSAwKQorICAgICAgICAgICA/IDEgOiAwKTsKKyAgICAgICAgICBwLmJ4ID0geCAt IHdkOworICAgICAgICAgIHAubnggPSB3ZDsKKyAgICAgICAgfQorICAgIH0KKyAgZWxzZQorICAg IHsKKyAgICAgIGludCB4ID0gd2luZG93X2JveF9yaWdodCAodywKKyAgICAgICAgKFdJTkRPV19I QVNfRlJJTkdFU19PVVRTSURFX01BUkdJTlMgKHcpCisgICAgICAgICA/IFJJR0hUX01BUkdJTl9B UkVBCisgICAgICAgICA6IFRFWFRfQVJFQSkpOworICAgICAgaW50IHdkID0gV0lORE9XX1JJR0hU X0ZSSU5HRV9XSURUSCAodyk7CisgICAgICBpZiAocC53ZCA+IHdkKQorICAgICAgICBwLndkID0g d2Q7CisgICAgICBwLnggPSB4ICsgKHdkIC0gcC53ZCkgLyAyOworICAgICAgLyogQ2xlYXIgcmln aHQgZnJpbmdlIGlmIG5vIGJpdG1hcCB0byBkcmF3IG9mIGlmIGJpdG1hcCBkb2Vzbid0IGZpbGwK KyAgIHRoZSBmcmluZ2UuICovCisgICAgICBpZiAocC53ZCA8IHdkIHx8IHAueSA+IHAuYnkgfHwg cC55ICsgcC5oIDwgcC5ieSArIHAubnkpCisgICAgICAgIHsKKyAgICAgICAgICBwLmJ4ID0geDsK KyAgICAgICAgICBwLm54ID0gd2Q7CisgICAgICAgIH0KKyAgICB9CisgIGlmIChwLnggPj0gV0lO RE9XX0JPWF9MRUZUX0VER0VfWCAodykKKyAgICAgICYmIChwLnggKyBwLndkKSA8PSBXSU5ET1df Qk9YX0xFRlRfRURHRV9YICh3KSArIFdJTkRPV19QSVhFTF9XSURUSCAodykpCisgICAgRlJBTUVf UklGIChmKS0+ZHJhd19mcmluZ2VfYml0bWFwICh3LCByb3csICZwKTsKK30KKwordm9pZAorbWNf ZHJhd19mcmluZ2VfYml0bWFwIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICpy b3csIGludCBsZWZ0X3AsIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUpCit7CisgIGlu dCBvdmVybGF5ID0gMDsKKyAgaWYgKGxlZnRfcCA9PSByb3ctPnJldmVyc2VkX3AgJiYgcm93LT5j dXJzb3JfaW5fZnJpbmdlX3ApCisgICAgeworICAgICAgTGlzcF9PYmplY3QgY3Vyc29yID0gUW5p bDsKKyAgICAgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgICAgIHsKKyAgICAgICAgY2FzZSBN Q19GUkFNRURfQk9YOgorICAgICAgICAgIGlmIChyb3ctPnZpc2libGVfaGVpZ2h0ID49IFNUQU5E QVJEX0JJVE1BUF9IRUlHSFQgKGhvbGxvd19yZWN0YW5nbGVfYml0cykpCisgICAgICAgICAgICBj dXJzb3IgPSBRaG9sbG93OworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGN1cnNvciA9IFFo b2xsb3dfc21hbGw7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTUNfSE9MTE9XX0JP WDoKKyAgICAgICAgICBpZiAocm93LT52aXNpYmxlX2hlaWdodCA+PSBTVEFOREFSRF9CSVRNQVBf SEVJR0hUIChob2xsb3dfcmVjdGFuZ2xlX2JpdHMpKQorICAgICAgICAgICAgY3Vyc29yID0gUWhv bGxvdzsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICBjdXJzb3IgPSBRaG9sbG93X3NtYWxs OworICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAgICAg ICAgY3Vyc29yID0gUWJveDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19CQVI6 CisgICAgICAgICAgY3Vyc29yID0gUWJhcjsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2Fz ZSBNQ19IQkFSOgorICAgICAgICAgIGN1cnNvciA9IFFoYmFyOworICAgICAgICAgIGJyZWFrOwor ICAgICAgICBjYXNlIE1DX05PX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGNhc2UgTUNfTk9fQ1VS U09SOgorICAgICAgICBjYXNlIE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGNhc2Ug TUNfTEVGVF9GUklOR0VfQklUTUFQOgorICAgICAgICBkZWZhdWx0OgorICAgICAgICAgIHctPnBo eXNfY3Vyc29yX29uX3AgPSAwOworICAgICAgICAgIHJvdy0+Y3Vyc29yX2luX2ZyaW5nZV9wID0g MDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgaWYgKCFOSUxQIChjdXJzb3Ip KQorICAgICAgICB7CisgICAgICAgICAgaW50IGJtID0gbWNfZ2V0X2xvZ2ljYWxfY3Vyc29yX2Jp dG1hcCAodywgY3Vyc29yKTsKKyAgICAgICAgICBpZiAoYm0gIT0gTUNfTk9fRlJJTkdFX0JJVE1B UCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbWNfZHJhd19mcmluZ2VfYml0bWFwXzEg KHcsIHJvdywgbGVmdF9wLCAyLCBibSk7CisgICAgICAgICAgICAgIG92ZXJsYXkgPSBFUSAoY3Vy c29yLCBRYm94KSA/IDMgOiAxOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICBt Y19kcmF3X2ZyaW5nZV9iaXRtYXBfMSAodywgcm93LCBsZWZ0X3AsIG92ZXJsYXksIE1DX05PX0ZS SU5HRV9CSVRNQVApOworICBpZiAobGVmdF9wICYmIHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAg IT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXBfMSAodywg cm93LCAxLCAxLCByb3ctPm92ZXJsYXlfYXJyb3dfYml0bWFwKTsKK30KKworLyogZW5kIE1VTFRJ UExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICNkZWZpbmUgTk9f RlJJTkdFX0JJVE1BUCAwCiAjZGVmaW5lIFVOREVGX0ZSSU5HRV9CSVRNQVAgMQogI2RlZmluZSBN QVhfU1RBTkRBUkRfRlJJTkdFX0JJVE1BUFMgQVJSQVlFTFRTIChzdGFuZGFyZF9iaXRtYXBzKQpA QCAtMTY5OSw2ICszMjE3LDE2OCBAQCBSZXR1cm4gbmlsIGlmIFBPUyBpcyBub3QgdmlzaWJsZSBp biBXSU5ET1cuICAqLykKIHZvaWQKIHN5bXNfb2ZfZnJpbmdlICh2b2lkKQogeworCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8q IChnZXQgJ2VtcHR5LWxpbmUgJ2ZyaW5nZSkgPT4gMjMgPT4gdGhlIGxhc3Qgc3RhbmRhcmQtYml0 bWFwIGJlZm9yZSB0aGlzIG9uZS4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qKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgREVG U1lNIChRdHJ1bmNhdGlvbiwgInRydW5jYXRpb24iKTsKICAgREVGU1lNIChRY29udGludWF0aW9u LCAiY29udGludWF0aW9uIik7CiAgIERFRlNZTSAoUW92ZXJsYXlfYXJyb3csICJvdmVybGF5LWFy cm93Iik7CmRpZmYgLS1naXQgYS9zcmMvbnN0ZXJtLmggYi9zcmMvbnN0ZXJtLmgKaW5kZXggOTc3 M2ViMy4uZTM0YTExNiAxMDA2NDQKLS0tIGEvc3JjL25zdGVybS5oCisrKyBiL3NyYy9uc3Rlcm0u aApAQCAtNjYzLDYgKzY2MywxNiBAQCB0eXBlZGVmIGlkIGluc3RhbmNldHlwZTsKIAogQGludGVy ZmFjZSBFbWFjc1Njcm9sbGVyIDogTlNTY3JvbGxlcgogICB7CisKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICBOU1JlY3QgbWNfcmVjdGFu Z2xlOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICBzdHJ1Y3Qgd2luZG93ICp3 aW5kb3c7CiAgICBzdHJ1Y3QgZnJhbWUgKmZyYW1lOwogICAgTlNSZXNwb25kZXIgKnByZXZSZXNw b25kZXI7CkBAIC02ODMsNiArNjkzLDE4IEBAIHR5cGVkZWYgaWQgaW5zdGFuY2V0eXBlOwogICAg aW50IGVtX3dob2xlOwogICAgfQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCistICh2b2lkKW1jX3NldF9yZWN0YW5nbGU6IChOU1JlY3QpcmVj dDsKKy0gKE5TUmVjdCltY19nZXRfcmVjdGFuZ2xlOworLSAoc3RydWN0IHdpbmRvdyAqKW1jX2dl dF93aW5kb3c7CistIChib29sKW1jX2p1ZGdlOworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiAtIChpbnN0YW5jZXR5cGUpIGluaXRGcmFtZTogKE5TUmVjdCApciB3aW5kb3c6IChMaXNw X09iamVjdCl3aW47CiAtICh2b2lkKXNldEZyYW1lOiAoTlNSZWN0KXI7CiAKZGlmZiAtLWdpdCBh L3NyYy9uc3Rlcm0ubSBiL3NyYy9uc3Rlcm0ubQppbmRleCAwMjMzMTgyLi5hZjc5MzliIDEwMDY0 NAotLS0gYS9zcmMvbnN0ZXJtLm0KKysrIGIvc3JjL25zdGVybS5tCkBAIC03Niw2ICs3Niw5NzYg QEAgVXBkYXRlZCBieSBDaHJpc3RpYW4gTGltcGFjaCAoY2hyaXNAbmljZS5jaCkKIHN0YXRpYyBF bWFjc01lbnUgKm1haW5NZW51OwogI2VuZGlmCiAKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKK3N0YXRpYyBCT09MIG5zX2NsaXBfdG9f cmVjdCAoc3RydWN0IGZyYW1lICosIE5TUmVjdCAqLCBpbnQpOworCitzdGF0aWMgdm9pZCBuc19y ZXNldF9jbGlwcGluZyAoc3RydWN0IGZyYW1lICopOworCitzdGF0aWMgdm9pZCBuc19kdW1wZ2x5 cGhzX2JveF9vcl9yZWxpZWYgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKik7CisKK3N0YXRpYyB2b2lk IG5zX2RyYXdfY29tcG9zaXRlX2dseXB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gICAgICAgICAgICAgICAgICAuYmx1ZSA9IG1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF0uZmcuYmx1ZX07CisgICAgICAgICAgLy8gIHN0cnVjdCBtY19SR0Ig bHNsX2JnID0gey5yZWQgPSBtY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLmJnLnJlZCwKKyAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVu ID0gbWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5iZy5ncmVlbiwK KyAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBtY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLmJsdWV9OworICAgICAgICAgIGJv b2wgYWN0aXZlX3AgPSBtY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhd LmFjdGl2ZV9wOworICAgICAgICAgIC8vICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSBt Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoX2ZsYXZvcjsK KyAgICAgICAgICBib29sIGVuYWJsZWRfcCA9IG1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF0uZW5hYmxlZF9wOworICAgICAgICAgIGJvb2wgZ29fcCA9ICh2cG9zID09 IHZudGgKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgaHBvcyA9PSBjdXJzb3JfZ2x5cGgtPmhw b3MKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKTsKKyAgICAgICAgICBpZiAo IWdvX3ApCisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICBOU1JlY3QgcjsKKyAgICAg ICAgICByLm9yaWdpbi54ID0gZng7CisgICAgICAgICAgci5vcmlnaW4ueSA9IGZ5OworICAgICAg ICAgIHIuc2l6ZS5oZWlnaHQgPSBoOworICAgICAgICAgIHIuc2l6ZS53aWR0aCA9IHdkOworICAg ICAgICAgIFtbTlNDb2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiBsc2xfZmcucmVkCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JlZW46IGxzbF9mZy5ncmVlbgorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBibHVlOiBsc2xfZmcuYmx1ZQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscGhhOiAxLjBdIHNldF07CisgICAg ICBpZiAoY3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWCkKKyAgICAgICAgeworICAgICAgICAg IHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSIChzLT53LT5jb250ZW50cyk7CisgICAgICAgICAg Ym9vbCByZWdpb25fYWN0aXZlX3AgPSAoIU5JTFAgKFZ0cmFuc2llbnRfbWFya19tb2RlKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBtYXJrX2Fj dGl2ZSkpKTsKKyAgICAgICAgICBwdHJkaWZmX3QgcmVnaW9uX2JlZyA9IChyZWdpb25fYWN0aXZl X3ApID8gbWNfcmVnaW9uX2xpbWl0ICgxKSA6IC0xOworICAgICAgICAgIHB0cmRpZmZfdCByZWdp b25fZW5kID0gKHJlZ2lvbl9hY3RpdmVfcCkgPyBtY19yZWdpb25fbGltaXQgKDApIDogLTE7Cisg ICAgICAgICAgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAmJiBhY3RpdmVfcAor ICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3MgPT0gcmVnaW9uX2JlZykKKyAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVn aW9uX2JlZ19mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAo IistcmVhbC1mYWtlLWN1cnNvci1hdC1yZWdpb24tcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAg ICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZWdfZmFjZSA9IEZB Q0VfRlJPTV9JRCAocy0+ZiwgaG9sbG93X2FjdGl2ZV9yZWdpb25fYmVnX2ZhY2VfaWQpOworICAg ICAgICAgICAgICBOU0NvbG9yICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZWdfY29sb3IgPSBuc19s b29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChob2xsb3dfYWN0aXZlX3Jl Z2lvbl9iZWdfZmFjZSksIHMtPmYpOworICAgICAgICAgICAgICBob2xsb3dfY29sb3IgPSBob2xs b3dfYWN0aXZlX3JlZ2lvbl9iZWdfY29sb3I7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBl bHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9w CisgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3MgPT0gcmVnaW9u X2VuZCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xs b3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlIChzLT53LCBz LT5mLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItYXQtcmVnaW9uLXByZS16di1mYWNlIiks IHRydWUpOworICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX3JlZ2lv bl9lbmRfZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ZiwgaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5k X2ZhY2VfaWQpOworICAgICAgICAgICAgICAgIE5TQ29sb3IgKmhvbGxvd19hY3RpdmVfcmVnaW9u X2VuZF9jb2xvciA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQg KGhvbGxvd19hY3RpdmVfcmVnaW9uX2VuZF9mYWNlKSwgcy0+Zik7CisgICAgICAgICAgICAgICAg aG9sbG93X2NvbG9yID0gaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2NvbG9yOworICAgICAgICAg ICAgICB9CisgICAgICAgICAgICAgIGVsc2UgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAg ICAgICAgICAgICAgICAmJiBhY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJz b3JfZ2x5cGgtPmNoYXJwb3MgPiByZWdpb25fYmVnCisgICAgICAgICAgICAgICAgICAgICAgICYm IGN1cnNvcl9nbHlwaC0+Y2hhcnBvcyA8IHJlZ2lvbl9lbmQpCisgICAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdl ZW5fZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlIChzLT53LCBzLT5mLCBpbnRlcm4gKCIrLXJl YWwtZmFrZS1jdXJzb3ItaW4tcmVnaW9uLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAg ICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZSA9 IEZBQ0VfRlJPTV9JRCAocy0+ZiwgaG9sbG93X2FjdGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNlX2lk KTsKKyAgICAgICAgICAgICAgICAgIE5TQ29sb3IgKmhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdl ZW5fY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EICho b2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2UpLCBzLT5mKTsKKyAgICAgICAgICAgICAg ICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fY29sb3I7Cisg ICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYgKGFjdGl2ZV9wKQorICAg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93 X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAo IistcmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAg ICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAocy0+ ZiwgaG9sbG93X2FjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAgTlNDb2xvciAq aG9sbG93X2FjdGl2ZV9jb2xvciA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0JB Q0tHUk9VTkQgKGhvbGxvd19hY3RpdmVfZmFjZSksIHMtPmYpOworICAgICAgICAgICAgICAgICAg ICBob2xsb3dfY29sb3IgPSBob2xsb3dfYWN0aXZlX2NvbG9yOworICAgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoIWFjdGl2ZV9wKQorICAgICAgICAgICAgICAg ICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2 ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAoIistcmVh bC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAg ICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2luYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01f SUQgKHMtPmYsIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAg ICBOU0NvbG9yICpob2xsb3dfaW5hY3RpdmVfY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xv ciAoTlNfRkFDRV9CQUNLR1JPVU5EIChob2xsb3dfaW5hY3RpdmVfZmFjZSksIHMtPmYpOworICAg ICAgICAgICAgICAgICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19pbmFjdGl2ZV9jb2xvcjsK KyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKGZhY2Ug JiYgTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKSA9PSBuc19pbmRleF9jb2xvciAoRlJBTUVfQ1VS U09SX0NPTE9SIChzLT5mKSwgcy0+ZikpCisgICAgICAgICAgeworICAgICAgICAgICAgW25zX2xv b2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQgKGZhY2UpLCBzLT5mKSBzZXRd OworICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gRlJBTUVfQ1VSU09SX0NPTE9SIChzLT5mKTsK KyAgICAgICAgICB9CisgICAgICAgICAgc3dpdGNoIChjdXJzb3JfdHlwZSkKKyAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgY2FzZSBNQ19OT19GUklOR0VfQklUTUFQOgorICAgICAgICAgICAg ICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX05PX0NVUlNPUjoKKyAgICAgICAgICAg ICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSBNQ19SSUdIVF9GUklOR0VfQklUTUFQOgor ICAgICAgICAgICAgICBjYXNlIE1DX0xFRlRfRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgICAgICAg Y2FzZSBNQ19GSUxMRURfQk9YOgorICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAg ICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX0ZSQU1FRF9CT1g6Cisg ICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAgICAgICAgW2hvbGxvd19j b2xvciBzZXRdOworICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKE5TSW5zZXRSZWN0IChyLCAx LCAxKSk7CisgICAgICAgICAgICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAocy0+Zikgc2V0XTsK KyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSBNQ19IT0xMT1dfQk9Y OgorICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAgICAgIFtob2xs b3dfY29sb3Igc2V0XTsKKyAgICAgICAgICAgICAgICBOU1JlY3RGaWxsIChOU0luc2V0UmVjdCAo ciwgMSwgMSkpOworICAgICAgICAgICAgICAgIFtGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpIHNl dF07CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgTUNfSEJBUjoK KyAgICAgICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAgICAgICBicmVhazsK KyAgICAgICAgICAgICAgY2FzZSBNQ19CQVI6CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAo cik7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgLyog SWYgYSBnbHlwaCBleGlzdHMgKHMtPmNoYXIyYiAhPSBOVUxMKSwgdGh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zZQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBz dHJ1Y3QgZm9udCAqZm9udCA9IHMtPmZhY2UtPmZvbnQ7CisgICAgICAgICAgICAgICAgICAgIGlm ICghZm9udCkKKyAgICAgICAgICAgICAgICAgICAgICBmb250ID0gRlJBTUVfRk9OVCAocy0+Zik7 CisgICAgICAgICAgICAgICAgICAgIGJvb2wgd2l0aF9iZ19wID0gZmFsc2U7CisgICAgICAgICAg ICAgICAgICAgIGZvbnQtPmRyaXZlci0+ZHJhdyAocywgcy0+Y21wX2Zyb20sIHMtPm5jaGFycywg cy0+eCwgcy0+eWJhc2UsIHdpdGhfYmdfcCk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIC8vICBjbG9ja190IGNsb2NrX2VuZCA9IGNsb2Nr KCk7CisgIC8vICBkb3VibGUgY3B1X3RpbWVfdXNlZCA9ICgoZG91YmxlKSAoY2xvY2tfZW5kIC0g Y2xvY2tfc3RhcnQpKSAvIENMT0NLU19QRVJfU0VDOworICAvLyAgZnByaW50ZiAoc3RkZXJyLCAi bnNfZHJhd19vdmVyd3JpdHRlbiAoJWQpOiAgVElNRSAoJWYpXG4iLCB2cG9zLCBjcHVfdGltZV91 c2VkKTsKK30KKworc3RhdGljIHZvaWQKK21jX25zX2RyYXdfd2luZG93X2N1cnNvciAoc3RydWN0 IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93 ICpyb3csCisgICAgICAgICAgICAgICAgICBpbnQgeCwgaW50IGZ4LCBpbnQgeSwgaW50IGZ5LCBp bnQgaHBvcywgaW50IHZwb3MsIGludCB3ZCwgaW50IGgsCisgICAgICAgICAgICAgICAgICBzdHJ1 Y3QgbWNfUkdCIGxzbCwgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSwKKyAgICAgICAg ICAgICAgICAgI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F9PYmplY3QgYmFja2dyb3VuZCA9IGZhY2UtPmxmYWNlW0xGQUNFX0JB Q0tHUk9VTkRfSU5ERVhdOworICAgICBmcHJpbnRmIChzdGRlcnIsICJcbmZvcmVncm91bmQgKCVz KSB8IGJhY2tncm91bmQgKCVzKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAoIU5JTFAgKGZv cmVncm91bmQpID8gU1NEQVRBIChmb3JlZ3JvdW5kKSA6ICJOSUxQIiksCisgICAgICAgICAgICAg ICAgICAgICAgKCFOSUxQIChiYWNrZ3JvdW5kKSA/IFNTREFUQSAoYmFja2dyb3VuZCkgOiAiTklM UCIpKTsKKyAgLSAgRVhBTVBMRSBPRiBIT1cgVE8gQ1JFQVRFIEEgQ09MT1IgV0lUSCBSR0IvTFNM IGZsb2F0IHZhbHVlczoKKyAgICAgTlNDb2xvciAqbXlfY29sb3IgPSBbTlNDb2xvciBjb2xvcldp dGhDYWxpYnJhdGVkUmVkOiAxLjAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGdyZWVuOiAxLjAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBibHVlOiAxLjAKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscGhhOiAxLjBdOworICAtICBBTFRFUk5BVElW RSBFWEFNUExFOgorICAgICBlbnVtIGZhY2VfaWQgZGVidWdnaW5nX2ZhY2VfaWQgPSBsb29rdXBf bmFtZWRfZmFjZSAocy0+dywgcy0+ZiwgaW50ZXJuICgiKy1kZWJ1Z2dpbmctZmFjZSIpLCB0cnVl KTsKKyAgICAgc3RydWN0IGZhY2UgKmRlYnVnZ2luZ19mYWNlID0gRkFDRV9GUk9NX0lEIChzLT5m LCBkZWJ1Z2dpbmdfZmFjZV9pZCk7CisgICAgIE5TQ29sb3IgKmNvbG9yID0gbnNfbG9va3VwX2lu ZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoZGVidWdnaW5nX2ZhY2UpLCBzLT5mKTsK KyAgICAgW2NvbG9yIHNldF07ICovCisgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEgKKyAg ICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSExFU1MpCisgICAgW1tOU0NvbG9yIGNvbG9y V2l0aENhbGlicmF0ZWRSZWQ6IGxzbC5yZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBncmVlbjogbHNsLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJsdWU6 IGxzbC5ibHVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwaGE6IDEuMF0gc2V0 XTsKKyAgICBlbHNlCisgICAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChmKSBzZXRdOworICBpZiAo Y3Vyc29yX3R5cGUgPT0gTUNfRlJBTUVEX0JPWCkKKyAgICB7CisgICAgICBzdHJ1Y3QgYnVmZmVy ICpiID0gWEJVRkZFUiAody0+Y29udGVudHMpOworICAgICAgYm9vbCByZWdpb25fYWN0aXZlX3Ag PSAoIU5JTFAgKFZ0cmFuc2llbnRfbWFya19tb2RlKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIG1hcmtfYWN0aXZlKSkpOworICAgICAgcHRyZGlmZl90 IHJlZ2lvbl9iZWcgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IG1jX3JlZ2lvbl9saW1pdCAoMSkgOiAt MTsKKyAgICAgIHB0cmRpZmZfdCByZWdpb25fZW5kID0gKHJlZ2lvbl9hY3RpdmVfcCkgPyBtY19y ZWdpb25fbGltaXQgKDApIDogLTE7CisgICAgICBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAg ICAgJiYgYWN0aXZlX3AKKyAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgt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Y29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAo aG9sbG93X2FjdGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNlKSwgZik7CisgICAgICAgICAgICAgIGhv bGxvd19jb2xvciA9IGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fY29sb3I7CisgICAgICAg ICAgICB9CisgICAgICAgICAgICBlbHNlIGlmIChhY3RpdmVfcCkKKyAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29r dXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1m YWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZl X2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAg ICAgICAgICAgTlNDb2xvciAqaG9sbG93X2FjdGl2ZV9jb2xvciA9IG5zX2xvb2t1cF9pbmRleGVk X2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGhvbGxvd19hY3RpdmVfZmFjZSksIGYpOworICAg ICAgICAgICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19hY3RpdmVfY29sb3I7CisgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgICAgLyogVGhlIHJlZ2lvbiBpcyBfbm90XyB2aXNpYmxlIGlu IHRoZSBpbmFjdGl2ZSB3aW5kb3cgYmVjYXVzZSB0aGUgb3ZlcmxheSB3aW5kb3cgcHJvcGVydHkg aXMgdXNlZC4gKi8KKyAgICAgICAgICAgICAgZWxzZSBpZiAoIWFjdGl2ZV9wKQorICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfaW5hY3RpdmVf ZmFjZV9pZCA9IGxvb2t1c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KyAgICAg ICAgYnJlYWs7CisgICAgICBjYXNlIE1DX0xFRlRfRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgYnJl YWs7CisgICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAgICAgIE5TUmVjdEZpbGwgKHIpOwor ICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfRlJBTUVEX0JPWDoKKyAgICAgICAgTlNSZWN0 RmlsbCAocik7CisgICAgICAgIFtob2xsb3dfY29sb3Igc2V0XTsKKyAgICAgICAgTlNSZWN0Rmls bCAoTlNJbnNldFJlY3QgKHIsIDEsIDEpKTsKKyAgICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAo Zikgc2V0XTsKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1DX0hPTExPV19CT1g6CisgICAg ICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICBbaG9sbG93X2NvbG9yIHNldF07CisgICAgICAg IE5TUmVjdEZpbGwgKE5TSW5zZXRSZWN0IChyLCAxLCAxKSk7CisgICAgICAgIFtGUkFNRV9DVVJT T1JfQ09MT1IgKGYpIHNldF07CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19IQkFSOgor ICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1DX0JB UjoKKyAgICAgICAgcyA9IHI7CisgICAgICAgIC8qIEBsYXdsaXN0IGlzIGZvY3VzaW5nIHRoZSBp bml0aWFsIGRldmVsb3BtZW50IG9mIGZlYXR1cmUgcmVxdWVzdHMKKyAgICAgICAgIzE3Njg0IGFu ZCAjMjI4NzMgb24gTDJSIGxhbmd1YWdlcy4gKi8KKyAgICAgICAgaWYgKGdseXBoX2ZsYXZvciAh PSBNQ19HTFlQSAorICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX0dMWVBITEVTUykK KyAgICAgICAgICB7CisgICAgICAgICAgICAvKiBJZiB0aGUgY2hh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GFwcykKKyAgICByZXR1cm47 CisgIC8qIERvIHVuZGVybGluZS4gKi8KKyAgaWYgKGZhY2UtPnVuZGVybGluZV9wKQorICAgIHsK KyAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX1dBVkUpCisg ICAgICAgIHsKKyAgICAgICAgICBpZiAoZmFjZS0+dW5kZXJsaW5lX2RlZmF1bHRlZF9wKQorICAg ICAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChmYWNlLT51bmRlcmxpbmVfY29sb3IsIHMtPmYp IHNldF07CisgICAgICAgICAgbnNfZHJhd191bmRlcndhdmUgKHMsIHdpZHRoLCB4KTsKKyAgICAg ICAgfQorICAgICAgICBlbHNlIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VO REVSX0xJTkUpCisgICAgICAgICAgeworICAgICAgICAgICAgTlNSZWN0IHI7CisgICAgICAgICAg ICB1bnNpZ25lZCBsb25nIHRoaWNrbmVzcywgcG9zaXRpb247CisgICAgICAgICAgICAvKiBJZiB0 aGUgcHJldiB3YXMgdW5kZXJsaW5lZCwgbWF0Y2ggaXRzIGFwcGVhcmFuY2UuICovCisgICAgICAg ICAgICBpZiAocy0+cHJldiAmJiBzLT5wcmV2LT5mYWNlLT51bmRlcmxpbmVfcAorICAgICAgICAg ICAgICAgICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElO RQorICAgICAgICAgICAgICAgICYmIHMtPnByZXYtPnVuZGVybGluZV90aGlja25lc3MgPiAwKQor ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+cHJldi0+dW5k ZXJsaW5lX3RoaWNrbmVzczsKKyAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPnByZXYtPnVu ZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlCisg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgc3RydWN0IGZvbnQgKmZvbnQ7Cisg ICAgICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIGRlc2NlbnQ7CisgICAgICAgICAgICAgICAg ICBmb250PXMtPmZvbnQ7CisgICAgICAgICAgICAgICAgICBkZXNjZW50ID0gcy0+eSArIHMtPmhl aWdodCAtIHMtPnliYXNlOworICAgICAgICAgICAgICAgICAgLyogVXNlIHVuZGVybGluZSB0aGlj a25lc3Mgb2YgZm9udCwgZGVmYXVsdGluZyB0byAxLiAqLworICAgICAgICAgICAgICAgICAgdGhp Y2tuZXNzID0gKGZvbnQgJiYgZm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzcyA+IDApCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IGZvbnQtPnVuZGVybGluZV90aGlja25lc3MKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogMTsKKyAgICAgICAgICAgICAgICAgIC8qIERldGVy bWluZSB0aGUgb2Zmc2V0IG9mIHVuZGVybGluaW5nIGZyb20gdGhlIGJhc2VsaW5lLiAqLworICAg ICAgICAgICAgICAgICAgaWYgKHhfdW5kZXJsaW5lX2F0X2Rlc2NlbnRfbGluZSkKKyAgICAgICAg ICAgICAgICAgICAgcG9zaXRpb24gPSBkZXNjZW50IC0gdGhpY2tuZXNzOworICAgICAgICAgICAg ICAgICAgICBlbHNlIGlmICh4X3VzZV91bmRlcmxpbmVfcG9zaXRpb25fcHJvcGVydGllcworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBmb250ICYmIGZvbnQtPnVuZGVybGluZV9wb3Np dGlvbiA+PSAwKQorICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gZm9udC0+dW5kZXJs aW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGZvbnQpCisgICAg ICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IGxyb3VuZCAoZm9udC0+ZGVzY2VudCAvIDIp OworICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAg ICBwb3NpdGlvbiA9IHVuZGVybGluZV9taW5pbXVtX29mZnNldDsKKyAgICAgICAgICAgICAgICAg IHBvc2l0aW9uID0gbWF4IChwb3NpdGlvbiwgdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0KTsKKyAg ICAgICAgICAgICAgICAgIC8qIEVuc3VyZSB1bmRlcmxpbmluZyBpcyBub3QgY3JvcHBlZC4gKi8K KyAgICAgICAgICAgICAgICAgIGlmIChkZXNjZW50IDw9IHBvc2l0aW9uKQorICAgICAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBkZXNjZW50IC0gMTsK KyAgICAgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAxOworICAgICAgICAgICAgICAgICAg ICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGRlc2NlbnQgPCBwb3NpdGlvbiArIHRo aWNrbmVzcykKKyAgICAgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAxOworICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgIHMtPnVuZGVybGluZV90aGlja25lc3MgPSB0aGlja25lc3M7 CisgICAgICAgICAgICBzLT51bmRlcmxpbmVfcG9zaXRpb24gPSBwb3NpdGlvbjsKKyAgICAgICAg ICAgIHIgPSBOU01ha2VSZWN0ICh4LCBzLT55YmFzZSArIHBvc2l0aW9uLCB3aWR0aCwgdGhpY2tu ZXNzKTsKKyAgICAgICAgICAgIGlmIChmYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3ApCisgICAg ICAgICAgICAgIFtkZWZhdWx0Q29sIHNldF07CisgICAgICAgICAgICAgIGVsc2UKKyAgIC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KKyAgICAgICAgW2RlZmF1bHRDb2wgc2V0XTsKKyAgICAgICAgZWxz ZQorICAgICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoZmFjZS0+c3RyaWtlX3Rocm91 Z2hfY29sb3IsIHMtPmYpIHNldF07CisgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICB9Cit9CisK K3N0YXRpYyB2b2lkCittY19uc19kdW1wZ2x5cGhzX3N0cmV0Y2ggKHN0cnVjdCBnbHlwaF9zdHJp bmcgKnMsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93LCBzdHJ1Y3QgbWNfbWF0cml4IG1jX21hdHJpeCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHdkKQoreworICBOU1JlY3QgclsyXTsKKyAg aW50IG4sIGk7CisgIHN0cnVjdCBmYWNlICpmYWNlOworICBOU0NvbG9yICpmZ0NvbCwgKmJnQ29s OworICBpZiAoIXMtPmJhY2tncm91bmRfZmlsbGVkX3ApCisgICAgeworICAgICAgbiA9IG5zX2dl dF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAgICAgIGlmICghbnNfY2xpcF90b19y ZWN0IChzLT5mLCByLCBuKSkKKyAgICAgICAgcmV0dXJuOworICAgICAgKnIgPSBOU01ha2VSZWN0 IChzLT54LCBzLT55LCBzLT5iYWNrZ3JvdW5kX3dpZHRoLCBzLT5oZWlnaHQpOworICAgICAgaWYg KHMtPmhsID09IERSQVdfTU9VU0VfRkFDRSkKKyAgICAgICAgeworICAgICAgICAgIGZhY2UgPSBG QUNFX0ZST01fSUQgKHMtPmYsIE1PVVNFX0hMX0lORk8gKHMtPmYpLT5tb3VzZV9mYWNlX2ZhY2Vf aWQpOworICAgICAgICAgIGlmICghZmFjZSkKKyAgICAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01f SUQgKHMtPmYsIE1PVVNFX0ZBQ0VfSUQpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAg ICAgIGZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIHMtPmZpcnN0X2dseXBoLT5mYWNlX2lkKTsK KyAgICAgIGJnQ29sID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfQkFDS0dST1VO RCAoZmFjZSksIHMtPmYpOworICAgICAgZmdDb2wgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAo TlNfRkFDRV9GT1JFR1JPVU5EIChmYWNlKSwgcy0+Zik7CisgICAgICBmb3IgKGkgPSAwOyBpIDwg bjsgKytpKQorICAgICAgICB7CisgICAgICAgICAgaWYgKCFzLT5yb3ctPmZ1bGxfd2lkdGhfcCkK KyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaW50IG92ZXJydW4sIGxlZnRvdmVycnVuOwor ICAgICAgICAgICAgICAvKiB0cnVuY2F0ZSB0byBhdm9pZCBvdmVyd3JpdGluZyBmcmluZ2UgYW5k L29yIHNjcm9sbGJhciAqLworICAgICAgICAgICAgICBvdmVycnVuID0gbWF4ICgwLCAocy0+eCAr IHMtPmJhY2tncm91bmRfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAt IChXSU5ET1dfQk9YX1JJR0hUX0VER0VfWCAocy0+dykKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIC0gV0lORE9XX1JJR0hUX0ZSSU5HRV9XSURUSCAocy0+dykpKTsKKyAgICAgICAgICAg ICAgICAgICAgcltpXS5zaXplLndpZHRoIC09IG92ZXJydW47CisgICAgICAgICAgICAgIC8qIHRy dW5jYXRlIHRvIGF2b2lkIG92ZXJ3cml0aW5nIHRvIGxlZnQgb2YgdGhlIHdpbmRvdyBib3ggKi8K KyAgICAgICAgICAgICAgbGVmdG92ZXJydW4gPSAoV0lORE9XX0JPWF9MRUZUX0VER0VfWCAocy0+ dykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBXSU5ET1dfTEVGVF9GUklOR0VfV0lE VEggKHMtPncpKSAtIHMtPng7CisgICAgICAgICAgICAgIGlmIChsZWZ0b3ZlcnJ1biA+IDApCisg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgcltpXS5vcmlnaW4ueCArPSBsZWZ0 b3ZlcnJ1bjsKKyAgICAgICAgICAgICAgICAgIHJbaV0uc2l6ZS53aWR0aCAtPSBsZWZ0b3ZlcnJ1 bjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgW2JnQ29sIHNl dF07CisgICAgICAgICAgLyogTk9URTogdW5kZXIgTlMgdGhpcyBpcyBOT1QgdXNlZCB0byBkcmF3 IGN1cnNvcnMsIGJ1dCB3ZSBtdXN0IGF2b2lkCisgICAgICAgICAgICAgb3ZlcndyaXRpbmcgY3Vy c29yICh1c3VhbGx5IHdoZW4gY3Vyc29yIG9uIGEgdGFiKSAqLworICAgICAgICAgIGlmIChzLT5o bCA9PSBEUkFXX0NVUlNPUikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogRklYTUU6 ICBEbyB3ZSBzdGlsbCBuZWVkIHRvIHByZXZlbnQgdGhpcyBzZWN0aW9uIG9mIGNvZGUgZnJvbQor ICAgICAgICAgICAgICBlcmFzaW5nIHRoZSBmYWtlIE1DX0hCQVIgdGhhdCBleHRlbmRzIHRoZSBl bnRpcmUgbGVuZ3RoIG9mIHRoZQorICAgICAgICAgICAgICBTVFJFVENIX0dMWVBIPyAgVGhpcyBt YXkgaGF2ZSBiZWVuIGRvbmUgcHJpb3IgdG8gdGhlIGZpeCByZWxhdGluZworICAgICAgICAgICAg ICB0byBsZWZ0L3JpZ2h0IG92ZXJ3cml0dGVuIGdseXBocy4gKi8KKyAgICAgICAgICAgICAgcltp XS5zaXplLmhlaWdodCAtPSAxOworICAgICAgICAgICAgICAvLyAgZW51bSBmYWNlX2lkIGRlYnVn Z2luZ19mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAoIist ZGVidWdnaW5nLWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgIC8vICBzdHJ1Y3QgZmFjZSAq ZGVidWdnaW5nX2ZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIGRlYnVnZ2luZ19mYWNlX2lkKTsK KyAgICAgICAgICAgICAgLy8gIE5TQ29sb3IgKmNvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29s b3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoZGVidWdnaW5nX2ZhY2UpLCBzLT5mKTsKKyAgICAgICAg ICAgICAgLy8gIFtjb2xvciBzZXRdOworICAgICAgICAgICAgICBDR0Zsb2F0IHggPSByW2ldLm9y aWdpbi54OworICAgICAgICAgICAgICBDR0Zsb2F0IHdpZHRoID0gd2Q7CisgICAgICAgICAgICAg IHJbaV0uc2l6ZS53aWR0aCAtPSB3aWR0aDsKKyAgICAgICAgICAgICAgcltpXS5vcmlnaW4ueCAr PSB3aWR0aDsKKyAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocltpXSk7CisgICAgICAgICAgICAg IC8qIERyYXcgb3ZlcmxpbmluZywgZXRjLiBvbiB0aGUgY3Vyc29yLiAqLworICAgICAgICAgICAg ICBpZiAocy0+dy0+cGh5c19jdXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9YKQorICAgICAgICAg ICAgICAgIG1jX25zX2RyYXdfdGV4dF9kZWNvcmF0aW9uIChzLCBmYWNlLCBiZ0NvbCwgd2lkdGgs IHgpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIG1jX25zX2RyYXdf dGV4dF9kZWNvcmF0aW9uIChzLCBmYWNlLCBmZ0NvbCwgd2lkdGgsIHgpOworICAgICAgICAgICAg fQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgLy8gIGludCByeCA9IHJbaV0ub3Jp Z2luLng7CisgIC8vICBpbnQgcnkgPSByW2ldLm9yaWdpbi55OworICAvLyAgaW50IHJ3ID0gcltp XS5zaXplLndpZHRoOworICAvLyAgaW50IHJoID0gcltpXS5zaXplLmhlaWdodDsKKyAgLy8gIGZw cmludGYgKHN0ZGVyciwgIm1jX25zX2R1bXBnbHlwaHNfc3RyZXRjaDogIHZwb3MgKCVkKSB8IHJ4 ICglZCkgfCByeSAoJWQpIHwgcncgKCVkKSB8IHJoICglZClcbiIsCisgIC8vICAgICAgICAgICAg ICAgICAgIHMtPmZpcnN0X2dseXBoLT52cG9zLCByeCwgcnksIHJ3LCByaCk7CisgICAgICAgICAg ICAgIE5TUmVjdEZpbGwgKHJbaV0pOworICAgICAgICAgICAgfQorICAgICAgICAgIC8qIERyYXcg b3ZlcmxpbmluZywgZXRjLiBvbiB0aGUgc3RyZXRjaCBnbHlwaCAob3IgdGhlIHBhcnQKKyAgICAg ICAgICAgICBvZiB0aGUgc3RyZXRjaCBnbHlwaCBhZnRlciB0aGUgY3Vyc29yKS4gKi8KKyAgICAg ICAgICBtY19uc19kcmF3X3RleHRfZGVjb3JhdGlvbiAocywgZmFjZSwgZmdDb2wsIHJbaV0uc2l6 ZS53aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcltpXS5vcmln aW4ueCk7CisgICAgICAgIH0KKyAgICAgIGlmICgocy0+bGVmdF9vdmVyd3JpdHRlbl9wIHx8IHMt PnJpZ2h0X292ZXJ3cml0dGVuX3ApCisgICAgICAgICAgJiYgKHMtPmFjdGlvbl90eXBlID09IE1D X0RSQVdfR0xZUEhfU1RSSU5HIHx8IHMtPmFjdGlvbl90eXBlID09IE1DX0VSQVNFX0dMWVBIX1NU UklORykpCisgICAgICAgIG1jX25zX2RyYXdfb3ZlcndyaXR0ZW4gKHMsIG1hdHJpeCwgcm93LCBt Y19tYXRyaXgsIHMtPmZpcnN0X2dseXBoKTsKKyAgICAgIG5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LndpZHRoLCBzLT5zbGlj ZS5oZWlnaHQpOworICAgICAgW2ltZyBkcmF3SW5SZWN0OiBkcgorICAgICAgICAgICAgIGZyb21S ZWN0OiBpcgorICAgICAgICAgICAgIG9wZXJhdGlvbjogTlNDb21wb3NpdGVTb3VyY2VPdmVyCisg ICAgICAgICAgICAgIGZyYWN0aW9uOiAxLjAKKyAgICAgICAgICAgcmVzcGVjdEZsaXBwZWQ6IFlF UworICAgICAgICAgICAgICAgIGhpbnRzOiBuaWxdOworI2Vsc2UKKyAgICAgIFtpbWcgY29tcG9z aXRlVG9Qb2ludDogTlNNYWtlUG9pbnQgKHgsIHkgKyBzLT5zbGljZS5oZWlnaHQpCisgICAgICAg ICAgICAgICAgICBvcGVyYXRpb246IE5TQ29tcG9zaXRlU291cmNlT3Zlcl07CisjZW5kaWYKKyAg ICB9CisgIGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUikKKyAgICB7CisgICAgICBbRlJBTUVfQ1VS U09SX0NPTE9SIChzLT5mKSBzZXRdOworICAgICAgaWYgKHMtPnctPnBoeXNfY3Vyc29yX3R5cGUg PT0gTUNfRklMTEVEX0JPWCkKKyAgICAgICAgdGRDb2wgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xv ciAoTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKSwgcy0+Zik7CisgICAgICAgIGVsc2UKKyAgICAg ICAgICAvKiBDdXJyZW50bHkgb24gTlMgaW1nLT5tYXNrIGlzIGFsd2F5cyAwLiBTaW5jZQorICAg ICAgICAgICAgIGdldF93aW5kb3dfY3Vyc29yX3R5cGUgc3BlY2lmaWVzIGEgaG9sbG93IGJveCBj dXJzb3Igd2hlbiBvbgorICAgICAgICAgICAgIGEgbm9uLW1hc2tlZCBpbWFnZSB3ZSBuZXZlciBy ZWFjaCB0aGlzIGNsYXVzZS4gQnV0IHdlIHB1dCBpdAorICAgICAgICAgICAgIGluIGluIGFudGlj aXBhdGlvbiBvZiBiZXR0ZXIgc3VwcG9ydCBmb3IgaW1hZ2UgbWFza3Mgb24gTlMuICovCisgICAg ICAgICAgdGRDb2wgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5E IChmYWNlKSwgcy0+Zik7CisgICAgfQorICAgIGVsc2UKKyAgICAgIHRkQ29sID0gbnNfbG9va3Vw X2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoZmFjZSksIHMtPmYpOworICAvKiBE cmF3IHVuZGVybGluZSwgb3ZlcmxpbmUsIHN0cmlrZS10aHJvdWdoLiAqLworICBtY19uc19kcmF3 X3RleHRfZGVjb3JhdGlvbiAocywgZmFjZSwgdGRDb2wsIGJyLnNpemUud2lkdGgsIGJyLm9yaWdp bi54KTsKKyAgLyogRHJhdyByZWxpZWYsIGlmIHJlcXVlc3RlZCAqLworICBpZiAocy0+aW1nLT5y ZWxpZWYgfHwgcy0+aGwgPT1EUkFXX0lNQUdFX1JBSVNFRCB8fCBzLT5obCA9PURSQVdfSU1BR0Vf U1VOS0VOKQorICAgIHsKKyAgICAgIGlmIChzLT5obCA9PSBEUkFXX0lNQUdFX1NVTktFTiB8fCBz LT5obCA9PSBEUkFXX0lNQUdFX1JBSVNFRCkKKyAgICAgICAgeworICAgICAgICAgIHRoID0gdG9v bF9iYXJfYnV0dG9uX3JlbGllZiA+PSAwID8KKyAgICAgICAgICAgIHRvb2xfYmFyX2J1dHRvbl9y ZWxpZWYgOiBERUZBVUxUX1RPT0xfQkFSX0JVVFRPTl9SRUxJRUY7CisgICAgICAgICAgcmFpc2Vk X3AgPSAocy0+aGwgPT0gRFJBV19JTUFHRV9SQUlTRUQpOworICAgICAgICB9CisgICAgICAgIGVs c2UKKyAgICAgICAgICB7CisgICAgICAgICAgICB0aCA9IGFicyAocy0+aW1nLT5yZWxpZWYpOwor ICAgICAgICAgICAgcmFpc2VkX3AgPSAocy0+aW1nLT5yZWxpZWYgPiAwKTsKKyAgICAgICAgICB9 CisgICAgICByLm9yaWdpbi54ID0geCAtIHRoOworICAgICAgci5vcmlnaW4ueSA9IHkgLSB0aDsK KyAgICAgIHIuc2l6ZS53aWR0aCA9IHMtPnNsaWNlLndpZHRoICsgMip0aC0xOworICAgICAgci5z aXplLmhlaWdodCA9IHMtPnNsaWNlLmhlaWdodCArIDIqdGgtMTsKKyAgICAgIG5zX2RyYXdfcmVs aWVmIChyLCB0aCwgcmFpc2VkX3AsCisgICAgICAgICAgICAgICAgICAgICAgcy0+c2xpY2UueSA9 PSAwLAorICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLnkgKyBzLT5zbGljZS5oZWlnaHQg PT0gcy0+aW1nLT5oZWlnaHQsCisgICAgICAgICAgICAgICAgICAgICAgcy0+c2xpY2UueCA9PSAw LAorICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLnggKyBzLT5zbGljZS53aWR0aCA9PSBz LT5pbWctPndpZHRoLCBzKTsKKyAgICB9CisgIC8qIElmIHRoZXJlIGlzIG5vIG1hc2ssIHRoZSBi YWNrZ3JvdW5kIHdvbid0IGJlIHNlZW4sCisgICAgIHNvIGRyYXcgYSByZWN0YW5nbGUgb24gdGhl IGltYWdlIGZvciB0aGUgY3Vyc29yLgorICAgICBEbyB0aGlzIGZvciBhbGwgaW1hZ2VzLCBnZXR0 aW5nIHRyYW5zcGFyZW5jeSByaWdodCBpcyBub3QgcmVsaWFibGUuICovCisgIGlmIChzLT5obCA9 PSBEUkFXX0NVUlNPUikKKyAgICB7CisgICAgICBpbnQgdGhpY2tuZXNzID0gYWJzIChzLT5pbWct PnJlbGllZik7CisgICAgICBpZiAodGhpY2tuZXNzID09IDApIHRoaWNrbmVzcyA9IDE7CisgICAg aWYgKGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSAorICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0g TUNfR0xZUEhMRVNTKQorICAgICAgeworICAgICAgICBOU0NvbG9yICpib3JkZXJfY29sb3IgPSBb TlNDb2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiBsc2wucmVkCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JlZW46IGxzbC5ncmVl bgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBibHVlOiBsc2wuYmx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGFscGhhOiAxLjBdOworICAgICAgICBuc19kcmF3X2JveCAo YnIsIHRoaWNrbmVzcywgYm9yZGVyX2NvbG9yLCAxLCAxKTsKKyAgICAgIH0KKyAgICAgIGVsc2UK KyAgICAgICAgbnNfZHJhd19ib3ggKGJyLCB0aGlja25lc3MsIEZSQU1FX0NVUlNPUl9DT0xPUiAo cy0+ZiksIDEsIDEpOworICAgIH0KK30KKworc3RhdGljIHZvaWQKK21jX25zX21heWJlX2R1bXBn bHlwaHNfYmFja2dyb3VuZCAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgY2hhciBmb3JjZV9wKQor eworICBOU1RSQUNFICgibWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIik7CisgIGlm ICghcy0+YmFja2dyb3VuZF9maWxsZWRfcC8qIHx8IHMtPmhsID09IERSQVdfTU9VU0VfRkFDRSov KQorICAgIHsKKyAgICAgIGludCBib3hfbGluZV93aWR0aCA9IG1heCAocy0+ZmFjZS0+Ym94X2xp bmVfd2lkdGgsIDApOworICAgICAgaWYgKEZPTlRfSEVJR0hUIChzLT5mb250KSA8IHMtPmhlaWdo dCAtIDIgKiBib3hfbGluZV93aWR0aAorICAgICAgICAgIC8qIFdoZW4geGRpc3AuYyBpZ25vcmVz IEZPTlRfSEVJR0hULCB3ZSBjYW5ub3QgdHJ1c3QgZm9udAorICAgICAgICAgICAgIGRpbWVuc2lv bnMsIHNpbmNlIHRoZSBhY3R1YWwgZ2x5cGhzIG1pZ2h0IGJlIG11Y2gKKyAgICAgICAgICAgICBz bWFsbGVyLiAgU28gaW4gdGhhdCBjYXNlIHdlIGFsd2F5cyBjbGVhciB0aGUgcmVjdGFuZ2xlCisg ICAgICAgICAgICAgd2l0aCBiYWNrZ3JvdW5kIGNvbG9yLiAqLworICAgICAgICAgIHx8IEZPTlRf VE9PX0hJR0ggKHMtPmZvbnQpCisgICAgICAgICAgfHwgcy0+Zm9udF9ub3RfZm91bmRfcCB8fCBz LT5leHRlbmRzX3RvX2VuZF9vZl9saW5lX3AgfHwgZm9yY2VfcCkKKyAgICAgICAgeworICAgICAg ICAgIHN0cnVjdCBmYWNlICpmYWNlOworICAgICAgICAgIGlmIChzLT5obCA9PSBEUkFXX01PVVNF X0ZBQ0UpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQg KHMtPmYsIE1PVVNFX0hMX0lORk8gKHMtPmYpLT5tb3VzZV9mYWNlX2ZhY2VfaWQpOworICAgICAg ICAgICAgICBpZiAoIWZhY2UpCisgICAgICAgICAgICAgICAgZmFjZSA9IEZBQ0VfRlJPTV9JRCAo cy0+ZiwgTU9VU0VfRkFDRV9JRCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisg ICAgICAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIHMtPmZpcnN0X2dseXBoLT5m YWNlX2lkKTsKKyAgICAgICAgICBpZiAoIWZhY2UtPnN0aXBwbGUpCisgICAgICAgICAgICBbKE5T X0ZBQ0VfQkFDS0dST1VORCAoZmFjZSkgIT0gMAorICAgICAgICAgICAgICA/IG5zX2xvb2t1cF9p bmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpLCBzLT5mKQorICAgICAgICAg ICAgICA6IEZSQU1FX0JBQ0tHUk9VTkRfQ09MT1IgKHMtPmYpKSBzZXRdOworICAgICAgICAgICAg ZWxzZQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RydWN0IG5zX2Rpc3BsYXlf aW5mbyAqZHB5aW5mbyA9IEZSQU1FX0RJU1BMQVlfSU5GTyAocy0+Zik7CisgICAgICAgICAgICAg ICAgW1tkcHlpbmZvLT5iaXRtYXBzW2ZhY2UtPnN0aXBwbGUtMV0uaW1nIHN0aXBwbGVNYXNrXSBz ZXRdOworICAgICAgICAgICAgICB9CisgICAgICAgICAgaWYgKHMtPmhsICE9IERSQVdfQ1VSU09S KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzLT5yZWN0YW5nbGVfbnVrZWRfcCA9IHRy dWU7CisgICAgICAgICAgICAgIE5TUmVjdCByID0gTlNNYWtlUmVjdCAocy0+eCwgcy0+eSArIGJv eF9saW5lX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+YmFj a2dyb3VuZF93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPmhl aWdodC0yKmJveF9saW5lX3dpZHRoKTsKKyAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7Cisg ICAgICAgICAgICB9CisgICAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IDE7CisgICAg ICAgIH0KKyAgICB9Cit9CisKK3N0YXRpYyB2b2lkCittY19uc19kcmF3X2dseXBoX3N0cmluZyAo c3RydWN0IGdseXBoX3N0cmluZyAqcywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LAorICAg ICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgc3RydWN0IG1jX21h dHJpeCBtY19tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBs c2wsIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciwKKyAgICAgICAgICAgICAgICAgICAgICAg ICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnN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zmlyc3RfZ2x5cGgtPnR5cGUgIT0gU1RSRVRDSF9HTFlQSCkKKyAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocy0+bmV4dCwg cik7CisgICAgICAgICAgICAgICAgaWYgKCFuc19jbGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4pKQor ICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIG1jX25zX21heWJlX2R1 bXBnbHlwaHNfYmFja2dyb3VuZCAocy0+bmV4dCwgMSk7CisgICAgICAgICAgICAgICAgbnNfcmVz ZXRfY2xpcHBpbmcgKHMtPmYpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgICBtY19uc19kdW1wZ2x5cGhzX3N0cmV0Y2ggKHMtPm5leHQsIG1hdHJp eCwgcm93LCBtY19tYXRyaXgsIHdkKTsKKyAgICAgICAgICAgIG5leHQtPm51bV9jbGlwcyA9IDA7 CisgICAgICAgICAgfQorICAgIH0KKyAgaWYgKCFzLT5mb3Jfb3ZlcmxhcHMgJiYgcy0+ZmFjZS0+ Ym94ICE9IEZBQ0VfTk9fQk9YCisgICAgICAmJiAocy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hB Ul9HTFlQSAorICAgICAgICAgIHx8IHMtPmZpcnN0X2dseXBoLT50eXBlID09IENPTVBPU0lURV9H TFlQSCkpCisgICAgeworICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChz LCByKTsKKyAgICAgIGlmICghbnNfY2xpcF90b19yZWN0IChzLT5mLCByLCBuKSkKKyAgICAgICAg cmV0dXJuOworICAgICAgbWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzLCAxKTsK KyAgICAgIG5zX2R1bXBnbHlwaHNfYm94X29yX3JlbGllZiAocyk7CisgICAgICBuc19yZXNldF9j bGlwcGluZyAocy0+Zik7CisgICAgICBib3hfZHJhd25fcCA9IDE7CisgICAgfQorICBzd2l0Y2gg KHMtPmZpcnN0X2dseXBoLT50eXBlKQorICAgIHsKKyAgICBjYXNlIElNQUdFX0dMWVBIOgorICAg ICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAgICAgIGlmICgh bnNfY2xpcF90b19yZWN0IChzLT5mLCByLCBuKSkKKyAgICAgICAgcmV0dXJuOworICAgICAgbWNf bnNfZHVtcGdseXBoc19pbWFnZSAocywgclswXSwgbHNsLCBnbHlwaF9mbGF2b3IsIGN1cnNvcl90 eXBlLCBhY3RpdmVfcCk7CisgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICBi cmVhazsKKyAgICBjYXNlIFNUUkVUQ0hfR0xZUEg6CisgICAgICBtY19uc19kdW1wZ2x5cGhzX3N0 cmV0Y2ggKHMsIG1hdHJpeCwgcm93LCBtY19tYXRyaXgsIHdkKTsKKyAgICAgIGJyZWFrOworICAg IGNhc2UgQ0hBUl9HTFlQSDoKKyAgICBjYXNlIENPTVBPU0lURV9HTFlQSDoKKyAgICAgIG4gPSBu c19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgcik7CisgICAgICBpZiAoIW5zX2NsaXBf dG9fcmVjdCAocy0+ZiwgciwgbikpCisgICAgICAgIHJldHVybjsKKyAgICAgIGlmIChzLT5mb3Jf b3ZlcmxhcHMKKyAgICAgICAgICB8fCAocy0+Y21wX2Zyb20gPiAwCisgICAgICAgICAgICAgICYm ICEgcy0+Zmlyc3RfZ2x5cGgtPnUuY21wLmF1dG9tYXRpYykpCisgICAgICAgIHMtPmJhY2tncm91 bmRfZmlsbGVkX3AgPSAxOworICAgICAgICBlbHNlCisgICAgICAgICAgbWNfbnNfbWF5YmVfZHVt cGdseXBoc19iYWNrZ3JvdW5kIChzLCBzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVf R0xZUEgpOworICAgICAgaW50IGZsYWdzID0gKHMtPmhsID09IERSQVdfQ1VSU09SKQorICAgICAg ICAgICAgICAgICAgICA/IE5TX0RVTVBHTFlQSF9DVVJTT1IKKyAgICAgICAgICAgICAgICAgIDog KHMtPmhsID09IERSQVdfTU9VU0VfRkFDRSkKKyAgICAgICAgICAgICAgICAgICAgPyBOU19EVU1Q R0xZUEhfTU9VU0VGQUNFCisgICAgICAgICAgICAgICAgICA6IChzLT5mb3Jfb3ZlcmxhcHMpCisg ICAgICAgICAgICAgICAgICAgID8gTlNfRFVNUEdMWVBIX0ZPUkVHUk9VTkQKKyAgICAgICAgICAg ICAgICAgIDogTlNfRFVNUEdMWVBIX05PUk1BTDsKKyAgICAgIHVuc2lnbmVkIGxvbmcgc2F2ZWRf ZmcgPSBOU19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2UpOworICAgICAgaWYgKHMtPmhsID09IERS QVdfQ1VSU09SICYmIGN1cnNvcl90eXBlID09IE1DX0ZJTExFRF9CT1gpCisgICAgICAgIHsKKyAg ICAgICAgICB1bnNpZ25lZCBsb25nIHRtcCA9IE5TX0ZBQ0VfQkFDS0dST1VORCAocy0+ZmFjZSk7 CisgICAgICAgICAgTlNfRkFDRV9CQUNLR1JPVU5EIChzLT5mYWNlKSA9IE5TX0ZBQ0VfRk9SRUdS T1VORCAocy0+ZmFjZSk7CisgICAgICAgICAgTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKSA9 IHRtcDsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUgor ICAgICAgICAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YCisgICAgICAg ICAgICAgICAgICYmIGFjdGl2ZV9wKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGVudW0gZmFj ZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgP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RFX0dMWVBIKQorICAgICAgICBuc19kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9y ZWdyb3VuZCAocyk7CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBib29s IHdpdGhfYmdfcCA9ICgoZmxhZ3MgPT0gTlNfRFVNUEdMWVBIX05PUk1BTCAmJiAhcy0+YmFja2dy b3VuZF9maWxsZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGZsYWdzID09 IE5TX0RVTVBHTFlQSF9NT1VTRUZBQ0UpOworICAgICAgICAgICAgaWYgKHdpdGhfYmdfcCkKKyAg ICAgICAgICAgICAgcy0+YmFja2dyb3VuZF9udWtlZF9wID0gdHJ1ZTsKKyAgICAgICAgICAgIGZv bnQtPmRyaXZlci0+ZHJhdyAocywgcy0+Y21wX2Zyb20sIHMtPm5jaGFycywgcy0+eCwgcy0+eWJh c2UsIHdpdGhfYmdfcCk7CisgICAgICAgICAgfQorICAgICAgTlNDb2xvciAqY29sID0gKE5TX0ZB Q0VfRk9SRUdST1VORCAocy0+ZmFjZSkgIT0gMAorICAgICAgICAgICAgICAgICAgICAgPyBuc19s b29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKSwgcy0+ZikK KyAgICAgICAgICAgICAgICAgICAgIDogRlJBTUVfRk9SRUdST1VORF9DT0xPUiAocy0+ZikpOwor ICAgICAgW2NvbCBzZXRdOworICAgICAgLyogRHJhdyB1bmRlcmxpbmUsIG92ZXJsaW5lLCBzdHJp a2UtdGhyb3VnaC4gKi8KKyAgICAgIG1jX25zX2RyYXdfdGV4dF9kZWNvcmF0aW9uIChzLCBzLT5m YWNlLCBjb2wsIHMtPndpZHRoLCBzLT54KTsKKyAgICAgIGlmIChzLT5maXJzdF9nbHlwaC0+dHlw ZSAhPSBDT01QT1NJVEVfR0xZUEgKKyAgICAgICAgICAmJiAocy0+bGVmdF9vdm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uc19jbGlwX3RvX3JlY3QgKHMtPmYsIHIsIG4pKQorICAg ICAgICByZXR1cm47CisgICAgICBpZiAocy0+Zm9yX292ZXJsYXBzCisgICAgICAgICAgfHwgKHMt PmNtcF9mcm9tID4gMAorICAgICAgICAgICAgICAmJiAhIHMtPmZpcnN0X2dseXBoLT51LmNtcC5h dXRvbWF0aWMpKQorICAgICAgICBzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wID0gMTsKKyAgICAgIGVs c2UKKyAgICAgICAgbWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzLCBzLT5maXJz dF9nbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpOworICAgICAgbnNfcmVzZXRfY2xpcHBp bmcgKHMtPmYpOworICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0 ICgpOworICAgIH0KKyAgLyogRHJhdyBib3ggaWYgbm90IGRvbmUgYWxyZWFkeS4gKi8KKyAgaWYg KCFzLT5mb3Jfb3ZlcmxhcHMKKyAgICAgICYmICFib3hfZHJhd25fcAorICAgICAgJiYgcy0+ZmFj ZS0+Ym94ICE9IEZBQ0VfTk9fQk9YKQorICAgIHsKKyAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3Ry aW5nX2NsaXBfcmVjdCAocywgcik7CisgICAgICBpZiAoIW5zX2NsaXBfdG9fcmVjdCAocy0+Ziwg ciwgbikpCisgICAgICAgIHJldHVybjsKKyAgICAgIG5zX2R1bXBnbHlwaHNfYm94X29yX3JlbGll ZiAocyk7CisgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgfQorICBzLT5udW1f Y2xpcHMgPSAwOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisKKwogLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KIAogICAgTlNUUkFDRSwgVHJh Y2Ugc3VwcG9ydC4KQEAgLTEwNzksNiArMjA0OSwxNiBAQCBzdGF0aWMgTlNSZWN0IGNvbnN0cmFp bl9mcmFtZV9yZWN0KE5TUmVjdCBmcmFtZVJlY3QsIGJvb2wgaXNGdWxsc2NyZWVuKQogICAgZXh0 ZXJuYWwgKFJJRikgY2FsbDsgd2hvbGUgZnJhbWUsIGNhbGxlZCBiZWZvcmUgZ3VpX3VwZGF0ZV93 aW5kb3dfYmVnaW4KICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCiB7CisKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdf ZnJhbWUgPSBmOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAjaWZkZWYgTlNfSU1Q TF9DT0NPQQogICBFbWFjc1ZpZXcgKnZpZXcgPSBGUkFNRV9OU19WSUVXIChmKTsKIApAQCAtMTEw OSw2ICsyMDg5LDE2IEBAIHN0YXRpYyBOU1JlY3QgY29uc3RyYWluX2ZyYW1lX3JlY3QoTlNSZWN0 IGZyYW1lUmVjdCwgYm9vbCBpc0Z1bGxzY3JlZW4pCiAKIC8qICAgaWYgKGYgPT0gTU9VU0VfSExf SU5GTyAoZiktPm1vdXNlX2ZhY2VfbW91c2VfZnJhbWUpICovCiAgIE1PVVNFX0hMX0lORk8gKGYp LT5tb3VzZV9mYWNlX2RlZmVyID0gMDsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGluZ19mcmFtZSA9IE5VTEw7CisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIH0KIAogCkBAIC00NzU5LDYgKzU3NDksMTcg QEAgaW4gY2VydGFpbiBzaXR1YXRpb25zIChyYXBpZCBpbmNvbWluZyBldmVudHMpLgogICAgICAg YmFyID0gW1tFbWFjc1Njcm9sbGVyIGFsbG9jXSBpbml0RnJhbWU6IHIgd2luZG93OiB3aW5dOwog ICAgICAgd3NldF92ZXJ0aWNhbF9zY3JvbGxfYmFyICh3aW5kb3csIG1ha2VfbWludF9wdHIgKGJh cikpOwogICAgICAgdXBkYXRlX3AgPSBZRVM7CisKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIC8qIFRoaXMgaXMgb25seSBmb3IgZGVi dWdnaW5nIHB1cnBvc2VzLiAqLworICAgICAgW2JhciBtY19zZXRfcmVjdGFuZ2xlOiByXTsKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgIH0KICAgZWxzZQogICAgIHsKQEAgLTQ3 NjYsMTIgKzU3NjcsMzAgQEAgaW4gY2VydGFpbiBzaXR1YXRpb25zIChyYXBpZCBpbmNvbWluZyBl dmVudHMpLgogICAgICAgYmFyID0gWE5TX1NDUk9MTF9CQVIgKHdpbmRvdy0+dmVydGljYWxfc2Ny b2xsX2Jhcik7CiAgICAgICBvbGRSZWN0ID0gW2JhciBmcmFtZV07CiAgICAgICByLnNpemUud2lk dGggPSBvbGRSZWN0LnNpemUud2lkdGg7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisv KiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgICAgIGlmIChGUkFNRV9MSVZFX1AgKGYpICYmICFO U0VxdWFsUmVjdHMgKG9sZFJlY3QsIHIpKQogICAgICAgICB7CisgICAgICAgICAgLyogVGhlIG1h aW4gd2luZG93IGhhcyBwcm9iYWJseSBiZWVuIHJlc2l6ZWQuICBHcmFjaW91c2x5IGRlbGV0ZSB0 aGUKKyAgICAgICAgICBvbGQgc2Nyb2xsIGJhciB3aXRob3V0IHJlcGFpbnRpbmcgaXRzIHJlY3Rh bmdsZTsgYW5kLCBjcmVhdGUgYSBuZXcKKyAgICAgICAgICBzY3JvbGwgYmFyIGVsc2V3aGVyZS4q LwogICAgICAgICAgIGlmIChvbGRSZWN0Lm9yaWdpbi54ICE9IHIub3JpZ2luLngpCisgICAgICAg ICAgICB7CiAgICAgICAgICAgICAgIG5zX2NsZWFyX2ZyYW1lX2FyZWEgKGYsIGxlZnQsIHRvcCwg d2lkdGgsIGhlaWdodCk7CisgICAgICAgICAgICAgIFtiYXIgbWNfanVkZ2VdOworICAgICAgICAg ICAgICBiYXIgPSBbW0VtYWNzU2Nyb2xsZXIgYWxsb2NdIGluaXRGcmFtZTogciB3aW5kb3c6IHdp bl07CisgICAgICAgICAgICAgIHdzZXRfdmVydGljYWxfc2Nyb2xsX2JhciAod2luZG93LCBtYWtl X21pbnRfcHRyIChiYXIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKICAgICAg ICAgICBbYmFyIHNldEZyYW1lOiByXTsKICAgICAgICAgfQorCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKworCiAgICAgfQogCiAgIGlmICh1cGRhdGVfcCkKQEAgLTQ5MzEsOSArNTk1MCw1NyBA QCBpbiBjZXJ0YWluIHNpdHVhdGlvbnMgKHJhcGlkIGluY29taW5nIGV2ZW50cykuCiAgICAgewog ICAgICAgdmlldyA9IFtzdWJ2aWV3cyBvYmplY3RBdEluZGV4OiBpXTsKICAgICAgIGlmICghW3Zp ZXcgaXNLaW5kT2ZDbGFzczogW0VtYWNzU2Nyb2xsZXIgY2xhc3NdXSkgY29udGludWU7Ci0gICAg ICBpZiAoW3ZpZXcganVkZ2VdKQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCisgIC8qIGBYU0VUV0lORE9XJyB3aWxsIHNvbWV0aW1lcyBjYXVz ZSBFbWFjcyB0byBjcmFzaCB3aGVuIHJ1bm5pbmcgdW5kZXIgZ2RiIGV2ZW4KKyAgdGhvdWdoICh3 ICE9IE5VTEwpLiAgVGhlcmVmb3JlLCB3ZSBjYW5ub3QgcmVsaWFibHkgdXNlIGBXSU5ET1dfTElW RV9QJy4gKi8KKyAgc3RydWN0IHdpbmRvdyAqdyA9IFt2aWV3IG1jX2dldF93aW5kb3ddOworICBp ZiAodyAhPSBOVUxMCisgICAgICAmJiBOSUxQICh3LT5jb250ZW50cykpCisgICAgeworICAgICAg Qk9PTCBkZWJ1Z19wID0gZmFsc2U7CisgICAgICBpZiAoZGVidWdfcAorICAgICAgICAgIC8qIGB3 aW5kb3dfYm94JyBjYWxscyBgd2luZG93X2JveF9oZWlnaHQnLCB3aGljaCB3aWxsIGNhdXNlIEVt YWNzIHRvCisgICAgICAgICAgY3Jhc2ggaWYgRlJBTUVQICh3LT5mcmFtZSkgaXMgbm90IHNhdGlz ZmllZC4gKi8KKyAgICAgICAgICAmJiBGUkFNRVAgKHctPmZyYW1lKSkKKyAgICAgICAgeworICAg ICAgICAgIE5TUmVjdCByMCA9IFt2aWV3IG1jX2dldF9yZWN0YW5nbGVdOworICAgICAgICAgIGlu dCB4MCA9IE5TTWluWCAocjApOworICAgICAgICAgIGludCB5MCA9IE5TTWluWSAocjApOworICAg ICAgICAgIGludCB3ZDAgPSBOU1dpZHRoIChyMCk7CisgICAgICAgICAgaW50IGgwID0gTlNIZWln aHQgKHIwKTsKKyAgICAgICAgICBpbnQgd2luZG93X3ksIHdpbmRvd19oZWlnaHQ7CisgICAgICAg ICAgd2luZG93X2JveCAodywgQU5ZX0FSRUEsIDAsICZ3aW5kb3dfeSwgMCwgJndpbmRvd19oZWln aHQpOworICAgICAgICAgIGludCB0b3AgPSB3aW5kb3dfeTsKKyAgICAgICAgICBpbnQgaGVpZ2h0 ID0gd2luZG93X2hlaWdodDsKKyAgICAgICAgICBpbnQgd2lkdGggPSBXSU5ET1dfQ09ORklHX1ND Uk9MTF9CQVJfQ09MUyAodykgKiBGUkFNRV9DT0xVTU5fV0lEVEggKGYpOworICAgICAgICAgIGlu dCBsZWZ0ID0gV0lORE9XX1NDUk9MTF9CQVJfQVJFQV9YICh3KTsKKyAgICAgICAgICBOU1JlY3Qg cjEgPSBOU01ha2VSZWN0IChsZWZ0LCB0b3AsIHdpZHRoLCBoZWlnaHQpOworICAgICAgICAgIC8q IFRoZSBwYXJlbnQgdmlldyBpcyBmbGlwcGVkLCBzbyB3ZSBuZWVkIHRvIGZsaXAgeSB2YWx1ZS4g Ki8KKyAgICAgICAgICBFbWFjc1ZpZXcgKmZyYW1lX3ZpZXcgPSBGUkFNRV9OU19WSUVXIChmKTsK KyAgICAgICAgICBOU1JlY3QgdiA9IFtmcmFtZV92aWV3IGZyYW1lXTsKKyAgICAgICAgICByMS5v cmlnaW4ueSA9ICh2LnNpemUuaGVpZ2h0IC0gcjEuc2l6ZS5oZWlnaHQgLSByMS5vcmlnaW4ueSk7 CisgICAgICAgICAgaW50IHgxID0gTlNNaW5YIChyMSk7CisgICAgICAgICAgaW50IHkxID0gTlNN aW5ZIChyMSk7CisgICAgICAgICAgaW50IHdkMSA9IE5TV2lkdGggKHIxKTsKKyAgICAgICAgICBp bnQgaDEgPSBOU0hlaWdodCAocjEpOworICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiVzIC0t IERFQUQ6XG5cCisgICAgICAgICAgeDAveDEgKCVkLyVkKSB8IHkwL3kxICglZC8lZCkgfCB3ZDAv d2QxICglZC8lZCkgfCBoMC9oMSAoJWQvJWQpXG4iLAorICAgICAgICAgIG1jX3dpbmRvdyAodyks IHgwLCB4MSwgeTAsIHkxLCB3ZDAsIHdkMSwgaDAsIGgxKTsKKyAgICAgICAgfQorICAgICAgaWYg KFt2aWV3IG1jX2p1ZGdlXSkKICAgICAgICAgcmVtb3ZlZCA9IFlFUzsKICAgICB9CisgICAgZWxz ZSBpZiAoW3ZpZXcganVkZ2VdKQorICAgICAgcmVtb3ZlZCA9IFlFUzsKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisKKworICAgIH0KIAogICBpZiAocmVtb3ZlZCkKICAgICBbZXZpZXcgdXBk YXRlRnJhbWVTaXplOiBOT107CkBAIC01MDc0LDYgKzYxNDEsMjAgQEAgc3RhdGljIExpc3BfT2Jq ZWN0IG5zX3N0cmluZ190b19saXNwbW9kIChjb25zdCBjaGFyICpzKQogZXh0ZXJuIGZyYW1lX3Bh cm1faGFuZGxlciBuc19mcmFtZV9wYXJtX2hhbmRsZXJzW107CiBzdGF0aWMgc3RydWN0IHJlZGlz cGxheV9pbnRlcmZhY2UgbnNfcmVkaXNwbGF5X2ludGVyZmFjZSA9CiB7CisKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRpc3BsYXlf aW50ZXJmYWNlJyBpbiBgbnN0ZXJtLm1gIG11c3QgYmUgaW4gdGhlIGV4YWN0IHNhbWUgb3JkZXIg YXMgdGhlCitgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYGRpc3BleHRlcm4uaGAhICovCisKKyAg bWNfbnNfZHJhd193aW5kb3dfY3Vyc29yLAorICBtY19uc19kcmF3X2dseXBoX3N0cmluZywKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBuc19mcmFtZV9wYXJtX2hhbmRsZXJzLAog ICBndWlfcHJvZHVjZV9nbHlwaHMsCiAgIGd1aV93cml0ZV9nbHlwaHMsCkBAIC04NzExLDYgKzk3 OTIsNDkgQEAgLSAoQk9PTCljYW5CZWNvbWVNYWluV2luZG93CiAKIEBpbXBsZW1lbnRhdGlvbiBF bWFjc1Njcm9sbGVyCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1D VVJTT1JTICovCisKKy0gKHZvaWQpbWNfc2V0X3JlY3RhbmdsZTogKE5TUmVjdClyZWN0Cit7Cisg IG1jX3JlY3RhbmdsZSA9IHJlY3Q7Cit9CisKKy0gKE5TUmVjdCltY19nZXRfcmVjdGFuZ2xlCit7 CisgIHJldHVybiBtY19yZWN0YW5nbGU7Cit9CisKKy0gKHN0cnVjdCB3aW5kb3cgKiltY19nZXRf d2luZG93Cit7CisgIHJldHVybiB3aW5kb3c7Cit9CisKKy0gKGJvb2wpbWNfanVkZ2UKK3sKKyAg TlNUUkFDRSAoIltFbWFjc1Njcm9sbGVyIG1jX2p1ZGdlXSIpOworICBib29sIHJldCA9IGNvbmRl bW5lZDsKKyAgYmxvY2tfa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Agewor ICAgICAgcmVnaXN0ZXIgTGlzcF9PYmplY3QgZWx0LCB0ZW07CisgICAgICBlbHQgPSBYQ0FSICh0 YWlsKTsKKyAgICAgIGlmICghQ09OU1AgKGVsdCkpIGNvbnRpbnVlOworICAgICAgdGVtID0gWENB UiAoZWx0KTsKKyAgICAgIGlmIChsc3RyY21waSAoU1NEQVRBICh0ZW0pLCBjb2xvcm5hbWUpID09 IDApCisgICAgICAgIHsKKyAgICAgICAgICByZXQgPSBGY2RyIChlbHQpOworICAgICAgICAgIGJy ZWFrOworICAgICAgICB9CisgICAgICBNQ19RVUlUOworICAgIH0KKyAgdW5ibG9ja19pbnB1dCAo KTsKKyAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIExpc3BfT2JqZWN0CittY194X3RvX3czMl9j b2xvciAoY29uc3QgY2hhciAqIGNvbG9ybmFtZSkKK3sKKyAgcmVnaXN0ZXIgTGlzcF9PYmplY3Qg cmV0ID0gUW5pbDsKKyAgYmxvY2tfaW5wdXQgKCk7CisgIGlmIChjb2xvcm5hbWVbMF0gPT0gJyMn KQorICAgIHsKKyAgICAgIC8qIENvdWxkIGJlIGFuIG9sZC1zdHlsZSBSR0IgRGV2aWNlIHNwZWNp ZmljYXRpb24uICovCisgICAgICBpbnQgc2l6ZSA9IHN0cmxlbiAoY29sb3JuYW1lICsgMSk7Cisg ICAgICBjaGFyICpjb2xvciA9IGFsbG9jYSAoc2l6ZSArIDEpOworICAgICAgc3RyY3B5IChjb2xv ciwgY29sb3JuYW1lICsgMSk7CisgICAgICBpZiAoc2l6ZSA9PSAzIHx8IHNpemUgPT0gNiB8fCBz aXplID09IDkgfHwgc2l6ZSA9PSAxMikKKyAgICAgICAgeworICAgICAgICAgIFVJTlQgY29sb3J2 YWw7CisgICAgICAgICAgaW50IGksIHBvczsKKyAgICAgICAgICBwb3MgPSAwOworICAgICAgICAg IHNpemUgLz0gMzsKKyAgICAgICAgICBjb2xvcnZhbCA9IDA7CisgICAgICAgICAgZm9yIChpID0g MDsgaSA8IDM7IGkrKykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY2hhciAqZW5kOwor ICAgICAgICAgICAgICBjaGFyIHQ7CisgICAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgdmFsdWU7 CisgICAgICAgICAgICAgIC8qIFRoZSBjaGVjayBmb3IgJ3gnIGluIHRoZSBmb2xsb3dpbmcgY29u ZGl0aW9uYWwgdGFrZXMgaW50bworICAgICAgICAgICAgICBhY2NvdW50IHRoZSBmYWN0IHRoYXQg c3RydG9sIGFsbG93cyBhICIweCIgaW4gZnJvbnQgb2YKKyAgICAgICAgICAgICAgb3VyIG51bWJl cnMsIGFuZCB3ZSBkb24ndC4gKi8KKyAgICAgICAgICAgICAgaWYgKCFpc3hkaWdpdCAoY29sb3Jb MF0pIHx8IGNvbG9yWzFdID09ICd4JykKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAg ICAgICAgdCA9IGNvbG9yW3NpemVdOworICAgICAgICAgICAgICBjb2xvcltzaXplXSA9ICdcMCc7 CisgICAgICAgICAgICAgIHZhbHVlID0gc3RydG91bCAoY29sb3IsICZlbmQsIDE2KTsKKyAgICAg ICAgICAgICAgY29sb3Jbc2l6ZV0gPSB0OworICAgICAgICAgICAgICBpZiAoZXJybm8gPT0gRVJB TkdFIHx8IGVuZCAtIGNvbG9yICE9IHNpemUpCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAg ICAgICAgICAgIHN3aXRjaCAoc2l6ZSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAg ICAgY2FzZSAxOgorICAgICAgICAgICAgICAgICAgdmFsdWUgPSB2YWx1ZSAqIDB4MTA7CisgICAg ICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIDI6CisgICAgICAgICAg ICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIDM6CisgICAgICAgICAgICAgICAg ICB2YWx1ZSAvPSAweDEwOworICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAg ICAgY2FzZSA0OgorICAgICAgICAgICAgICAgICAgdmFsdWUgLz0gMHgxMDA7CisgICAgICAgICAg ICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGNvbG9ydmFs IHw9ICh2YWx1ZSA8PCBwb3MpOworICAgICAgICAgICAgICBwb3MgKz0gMHg4OworICAgICAgICAg ICAgICBpZiAoaSA9PSAyKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIHVu YmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgICAgICAgICBYU0VUSU5UIChyZXQsIGNvbG9ydmFs KTsKKyAgICAgICAgICAgICAgICAgIHJldHVybiByZXQ7CisgICAgICAgICAgICAgICAgfQorICAg ICAgICAgICAgICBjb2xvciA9IGVuZDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0K KyAgZWxzZSBpZiAoc3RybmljbXAgKGNvbG9ybmFtZSwgInJnYjoiLCA0KSA9PSAwKQorICAgIHsK KyAgICAgIGNvbnN0IGNoYXIgKmNvbG9yOworICAgICAgVUlOVCBjb2xvcnZhbDsKKyAgICAgIGlu dCBpLCBwb3M7CisgICAgICBwb3MgPSAwOworICAgICAgY29sb3J2YWwgPSAwOworICAgICAgY29s b3IgPSBjb2xvcm5hbWUgKyA0OworICAgICAgZm9yIChpID0gMDsgaSA8IDM7IGkrKykKKyAgICAg ICAgeworICAgICAgICAgIGNoYXIgKmVuZDsKKyAgICAgICAgICB1bnNpZ25lZCBsb25nIHZhbHVl OworICAgICAgICAgIC8qIFRoZSBjaGVjayBmb3IgJ3gnIGluIHRoZSBmb2xsb3dpbmcgY29uZGl0 aW9uYWwgdGFrZXMgaW50bworICAgICAgICAgICAgIGFjY291bnQgdGhlIGZhY3QgdGhhdCBzdHJ0 b2wgYWxsb3dzIGEgIjB4IiBpbiBmcm9udCBvZgorICAgICAgICAgICAgIG91ciBudW1iZXJzLCBh bmQgd2UgZG9uJ3QuICovCisgICAgICAgICAgaWYgKCFpc3hkaWdpdCAoY29sb3JbMF0pIHx8IGNv bG9yWzFdID09ICd4JykKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIHZhbHVlID0gc3Ry dG91bCAoY29sb3IsICZlbmQsIDE2KTsKKyAgICAgICAgICBpZiAoZXJybm8gPT0gRVJBTkdFKQor ICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgc3dpdGNoIChlbmQgLSBjb2xvcikKKyAgICAg ICAgICAgIHsKKyAgICAgICAgICAgIGNhc2UgMToKKyAgICAgICAgICAgICAgdmFsdWUgPSB2YWx1 ZSAqIDB4MTAgKyB2YWx1ZTsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNl IDI6CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSAzOgorICAgICAgICAg ICAgICB2YWx1ZSAvPSAweDEwOworICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNh c2UgNDoKKyAgICAgICAgICAgICAgdmFsdWUgLz0gMHgxMDA7CisgICAgICAgICAgICAgIGJyZWFr OworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgdmFsdWUgPSBVTE9OR19NQVg7 CisgICAgICAgICAgICB9CisgICAgICAgICAgaWYgKHZhbHVlID09IFVMT05HX01BWCkKKyAgICAg ICAgICAgIGJyZWFrOworICAgICAgICAgIGNvbG9ydmFsIHw9ICh2YWx1ZSA8PCBwb3MpOworICAg ICAgICAgIHBvcyArPSAweDg7CisgICAgICAgICAgaWYgKGkgPT0gMikKKyAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgaWYgKCplbmQgIT0gJ1wwJykKKyAgICAgICAgICAgICAgICBicmVhazsK KyAgICAgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgWFNFVElOVCAo cmV0LCBjb2xvcnZhbCk7CisgICAgICAgICAgICAgIHJldHVybiByZXQ7CisgICAgICAgICAgICB9 CisgICAgICAgICAgaWYgKCplbmQgIT0gJy8nKQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAg ICAgY29sb3IgPSBlbmQgKyAxOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UgaWYgKHN0cm5p Y21wIChjb2xvcm5hbWUsICJyZ2JpOiIsIDUpID09IDApCisgICAgICB7CisgICAgICAgIC8qIFRo aXMgaXMgYW4gUkdCIEludGVuc2l0eSBzcGVjaWZpY2F0aW9uLiAqLworICAgICAgICBjb25zdCBj aGFyICpjb2xvcjsKKyAgICAgICAgVUlOVCBjb2xvcnZhbDsKKyAgICAgICAgaW50IGksIHBvczsK KyAgICAgICAgcG9zID0gMDsKKyAgICAgICAgY29sb3J2YWwgPSAwOworICAgICAgICBjb2xvciA9 IGNvbG9ybmFtZSArIDU7CisgICAgICAgIGZvciAoaSA9IDA7IGkgPCAzOyBpKyspCisgICAgICAg ICAgeworICAgICAgICAgICAgY2hhciAqZW5kOworICAgICAgICAgICAgZG91YmxlIHZhbHVlOwor ICAgICAgICAgICAgVUlOVCB2YWw7CisgICAgICAgICAgICB2YWx1ZSA9IHN0cnRvZCAoY29sb3Is ICZlbmQpOworICAgICAgICAgICAgaWYgKGVycm5vID09IEVSQU5HRSkKKyAgICAgICAgICAgICAg YnJlYWs7CisgICAgICAgICAgICBpZiAodmFsdWUgPCAwLjAgfHwgdmFsdWUgPiAxLjApCisgICAg ICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgdmFsID0gKFVJTlQpKDB4MTAwICogdmFsdWUp OworICAgICAgICAgICAgLyogV2UgdXNlZCAweDEwMCBpbnN0ZWFkIG9mIDB4RkYgdG8gZ2l2ZSBh IGNvbnRpbnVvdXMKKyAgICAgICAgICAgICAgIHJhbmdlIGJldHdlZW4gMC4wIGFuZCAxLjAgaW5j bHVzaXZlLiAgVGhlIG5leHQgc3RhdGVtZW50CisgICAgICAgICAgICAgICBmaXhlcyB0aGUgMS4w IGNhc2UuICovCisgICAgICAgICAgICBpZiAodmFsID09IDB4MTAwKQorICAgICAgICAgICAgICB2 YWwgPSAweEZGOworICAgICAgICAgICAgY29sb3J2YWwgfD0gKHZhbCA8PCBwb3MpOworICAgICAg ICAgICAgcG9zICs9IDB4ODsKKyAgICAgICAgICAgIGlmIChpID09IDIpCisgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICBpZiAoKmVuZCAhPSAnXDAnKQorICAgICAgICAgICAgICAgICAg YnJlYWs7CisgICAgICAgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAg ICBYU0VUSU5UIChyZXQsIGNvbG9ydmFsKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gcmV0Owor ICAgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoKmVuZCAhPSAnLycpCisgICAgICAgICAg ICAgIGJyZWFrOworICAgICAgICAgICAgY29sb3IgPSBlbmQgKyAxOworICAgICAgICAgIH0KKyAg ICAgIH0KKyAgLyogSSBhbSBub3QgZ29pbmcgdG8gYXR0ZW1wdCB0byBoYW5kbGUgYW55IG9mIHRo ZSBDSUUgY29sb3Igc2NoZW1lcworICAgICBvciBUZWtIVkMsIHNpbmNlIEkgZG9uJ3Qga25vdyB0 aGUgYWxnb3JpdGhtcyBmb3IgY29udmVyc2lvbiB0byBSR0IuCisgICAgIElmIHdlIGZhaWwgdG8g bG9va3VwIHRoZSBjb2xvciBuYW1lIGluIHczMl9jb2xvcl9tYXAsIHRoZW4gY2hlY2sgdGhlCisg ICAgIGNvbG9ybmFtZSB0byBzZWUgaWYgaXQgY2FuIGJlIGNydWRlbHkgYXBwcm94aW1hdGVkOiBJ ZiB0aGUgWCBjb2xvcgorICAgICBlbmRzIGluIGEgbnVtYmVyIChlLmcuLCAiZGFya3NlYWdyZWVu MiIpLCBzdHJpcCB0aGUgbnVtYmVyIGFuZAorICAgICByZXR1cm4gdGhlIHJlc3VsdCBvZiBsb29r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KyAgQ09MT1JSRUYgdzMyX2NvbG9y X3JlZjsKKyAgdGVtID0gbWNfeF90b193MzJfY29sb3IgKGNvbG9yKTsKKyAgaWYgKCFOSUxQICh0 ZW0pKQorICAgIHsKKyAgICAgIGlmIChmKQorICAgICAgICB7CisgICAgICAgICAgLyogQXBwbHkg Z2FtbWEgY29ycmVjdGlvbi4gKi8KKyAgICAgICAgICB3MzJfY29sb3JfcmVmID0gWFVGSVhOVU1f UkFXICh0ZW0pOworICAgICAgICAgIGdhbW1hX2NvcnJlY3QgKGYsICZ3MzJfY29sb3JfcmVmKTsK KyAgICAgICAgICBYU0VUSU5UICh0ZW0sIHczMl9jb2xvcl9yZWYpOworICAgICAgICB9CisgICAg ICAvKiBNYXAgdGhpcyBjb2xvciB0byB0aGUgcGFsZXR0ZSBpZiBpdCBpcyBlbmFibGVkLiAqLwor ICAgICAgaWYgKCFOSUxQIChWdzMyX2VuYWJsZV9wYWxldHRlKSkKKyAgICAgICAgeworICAgICAg ICAgIHN0cnVjdCB3MzJfcGFsZXR0ZV9lbnRyeSAqIGVudHJ5ID0gb25lX3czMl9kaXNwbGF5X2lu Zm8uY29sb3JfbGlzdDsKKyAgICAgICAgICBzdHJ1Y3QgdzMyX3BhbGV0dGVfZW50cnkgKiogcHJl diA9ICZvbmVfdzMyX2Rpc3BsYXlfaW5mby5jb2xvcl9saXN0OworICAgICAgICAgIC8qIGNoZWNr IGlmIGNvbG9yIGlzIGFscmVhZHkgbWFwcGVkICovCisgICAgICAgICAgd2hpbGUgKGVudHJ5KQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAoTUNfVzMyX0NPTE9SIChlbnRyeS0+ZW50 cnkpID09IFhVRklYTlVNX1JBVyAodGVtKSkKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAg ICAgICAgICAgcHJldiA9ICZlbnRyeS0+bmV4dDsKKyAgICAgICAgICAgICAgZW50cnkgPSBlbnRy eS0+bmV4dDsKKyAgICAgICAgICAgIH0KKyA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MDsKKyAgICAgICAgbHNsLT5ibHVlID0gLTEuMDsK KyAgICAgIH0KK30KKworLyogRHJhdyBzdHJldGNoIGdseXBoIHN0cmluZyBTLiAqLworc3RhdGlj IHZvaWQKK21jX3czMl9kcmF3X3N0cmV0Y2hfZ2x5cGhfc3RyaW5nIChzdHJ1Y3QgZ2x5cGhfc3Ry aW5nICpzKQoreworICBlYXNzZXJ0IChzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBTVFJFVENIX0dM WVBIKTsKKyAgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SCisgICAgICAmJiAheF9zdHJldGNoX2N1 cnNvcl9wKQorICAgIHsKKyAgICAgIC8qIElmIGB4LXN0cmV0Y2gtY3Vyc29yJyBpcyBuaWwsIGRv bid0IGRyYXcgYSBibG9jayBjdXJzb3IgYXMgd2lkZSBhcyB0aGUKKyAgICAgIHN0cmV0Y2ggZ2x5 cGguICovCisgICAgICBpbnQgd2lkdGgsIGJhY2tncm91bmRfd2lkdGggPSBzLT5iYWNrZ3JvdW5k X3dpZHRoOworICAgICAgaW50IHggPSBzLT54OworICAgICAgaWYgKCFzLT5yb3ctPnJldmVyc2Vk X3ApCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgbGVmdF94ID0gd2luZG93X2JveF9sZWZ0X29m ZnNldCAocy0+dywgVEVYVF9BUkVBKTsKKyAgICAgICAgICBpZiAoeCA8IGxlZnRfeCkKKyAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgYmFja2dyb3VuZF93aWR0aCAtPSBsZWZ0X3ggLSB4Owor ICAgICAgICAgICAgICB4ID0gbGVmdF94OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAg ICAgIGVsc2UKKyAgICAgICAgIHsKKyAgICAgICAgICAgLyogSW4gUjJMIHJvd3MsIGRyYXcgdGhl IGN1cnNvciBvbiB0aGUgcmlnaHQgZWRnZSBvZiB0aGUKKyAgICAgICAgICAgICAgc3RyZXRjaCBn bHlwaC4gKi8KKyAgICAgICAgICAgaW50IHJpZ2h0X3ggPSB3aW5kb3dfYm94X3JpZ2h0IChzLT53 LCBURVhUX0FSRUEpOworICAgICAgICAgICBpZiAoeCArIGJhY2tncm91bmRfd2lkdGggPiByaWdo dF94KQorICAgICAgICAgICAgIGJhY2tncm91bmRfd2lkdGggLT0geCAtIHJpZ2h0X3g7CisgICAg ICAgICAgIHggKz0gYmFja2dyb3VuZF93aWR0aDsKKyAgICAgICAgIH0KKyAgICAgIHdpZHRoID0g bWluIChGUkFNRV9DT0xVTU5fV0lEVEggKHMtPmYpLCBiYWNrZ3JvdW5kX3dpZHRoKTsKKyAgICAg IGlmIChzLT5yb3ctPnJldmVyc2VkX3ApCisgICAgICAgIHggLT0gd2lkdGg7CisgICAgICAvKiBE cmF3IGN1cnNvci4gKi8KKyAgICAgIHczMl9kcmF3X2dseXBoX3N0cmluZ19iZ19yZWN0IChzLCB4 LCBzLT55LCB3aWR0aCwgcy0+aGVpZ2h0KTsKKyAgICAgIC8qIENsZWFyIHJlc3QgdXNpbmcgdGhl IEdDIG9mIHRoZSBvcmlnaW5hbCBub24tY3Vyc29yIGZhY2UuICovCisgICAgICBpZiAod2lkdGgg PCBiYWNrZ3JvdW5kX3dpZHRoKQorICAgICAgICB7CisgICAgICAgICAgRW1hY3NfR0MgKmdjID0g cy0+ZmFjZS0+Z2M7CisgICAgICAgICAgaW50IHkgPSBzLT55OworICAgICAgICAgIGludCB3ID0g YmFja2dyb3VuZF93aWR0aCAtIHdpZHRoLCBoID0gcy0+aGVpZ2h0OworICAgICAgICAgIFJFQ1Qg cjsKKyAgICAgICAgICBIREMgaGRjID0gcy0+aGRjOworICAgICAgICAgIGlmICghcy0+cm93LT5y ZXZlcnNlZF9wKQorICAgICAgICAgICAgeCArPSB3aWR0aDsKKyAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgeCA9IHMtPng7CisgICAgICAgICAgaWYgKHMtPnJvdy0+bW91c2VfZmFjZV9w CisgICAgICAgICAgICAgICYmIGN1cnNvcl9pbl9tb3VzZV9mYWNlX3AgKHMtPncpKQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICB3MzJfc2V0X21vdXNlX2ZhY2VfZ2MgKHMpOworICAgICAg ICAgICAgICBnYyA9IHMtPmdjOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgICBnYyA9IHMtPmZhY2UtPmdjOworICAgICAgICAgIGdldF9nbHlwaF9zdHJpbmdf Y2xpcF9yZWN0IChzLCAmcik7CisgICAgICAgICAgdzMyX3NldF9jbGlwX3JlY3RhbmdsZSAoaGRj LCAmcik7CisjaWYgMCAvKiBUT0RPOiBzdGlwcGxlICovCisgICAgICAgICAgaWYgKHMtPmZhY2Ut PnN0aXBwbGUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIC8qIEZpbGwgYmFja2dyb3Vu ZCB3aXRoIGEgc3RpcHBsZSBwYXR0ZXJuLiAqLworICAgICAgICAgICAgICBYU2V0RmlsbFN0eWxl IChzLT5kaXNwbGF5LCBnYywgRmlsbE9wYXF1ZVN0aXBwbGVkKTsKKyAgICAgICAgICAgICAgWEZp bGxSZWN0YW5nbGUgKHMtPmRpc3BsYXksIHMtPndpbmRvdywgZ2MsIHgsIHksIHcsIGgpOworICAg ICAgICAgICAgICBYU2V0RmlsbFN0eWxlIChzLT5kaXNwbGF5LCBnYywgRmlsbFNvbGlkKTsKKyAg ICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyNlbmRpZgorICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBnYy0+YmFja2dyb3Vu ZCwgeCwgeSwgdywgaCk7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICBl bHNlIGlmICghcy0+YmFja2dyb3VuZF9maWxsZWRfcCkKKyAgICAgIHsKKyAgICAgICAgaW50IGJh Y2tncm91bmRfd2lkdGggPSBzL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SBEUkFXX0NVUlNPUikKKyAgICAgICAgeworICAgICAgICAgIG1jX3czMl9zZXRfY3Vyc29yX2dj IChzLCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgcy0+c3RpcHBsZWRfcCA9IGZhbHNlOworICAg ICAgICB9CisgICAgICAgIGVsc2UgaWYgKHMtPmhsID09IERSQVdfTU9VU0VfRkFDRSkKKyAgICAg ICAgICB7CisgICAgICAgICAgICB3MzJfc2V0X21vdXNlX2ZhY2VfZ2MgKHMpOworICAgICAgICAg ICAgcy0+c3RpcHBsZWRfcCA9IHMtPmZhY2UtPnN0aXBwbGUgIT0gMDsKKyAgICAgICAgICB9Cisg ICAgICAgICAgZWxzZSBpZiAocy0+aGwgPT0gRFJBV19JTUFHRV9SQUlTRUQKKyAgICAgICAgICAg ICAgICAgICB8fCBzLT5obCA9PSBEUkFXX0lNQUdFX1NVTktFTikKKyAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgcy0+Z2MgPSBzLT5mYWNlLT5nYzsKKyAgICAgICAgICAgICAgcy0+c3RpcHBs ZWRfcCA9IHMtPmZhY2UtPnN0aXBwbGUgIT0gMDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgICAgZW1hY3NfYWJvcnQgKCk7CisgIC8qIEdDIG11c3QgaGF2ZSBi ZWVuIHNldC4gKi8KKyAgZWFzc2VydCAocy0+Z2MgIT0gMCk7Cit9CisKKy8qIERyYXcgYSBob2xs b3cgYm94IGN1cnNvciBvbiB3aW5kb3cgVyBpbiBnbHlwaCByb3cgUk9XLiAqLworc3RhdGljIHZv aWQKK21jX3czMl9kcmF3X2hvbGxvd19jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBn bHlwaF9tYXRyaXggKm1hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBn bHlwaF9yb3cgKnJvdywgaW50IHgsIGludCBmeCwgaW50IHksIGludCBmeSwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgIGludCBocG9zLCBpbnQgdnBvcywgaW50IHdkLCBpbnQgaCkKK3sKKyAg c3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsKKyAgSERDIGhkYzsK KyAgUkVDVCByZWN0OworICBIQlJVU0ggaGIgPSBDcmVhdGVTb2xpZEJydXNoIChmLT5vdXRwdXRf ZGF0YS53MzItPmN1cnNvcl9waXhlbCk7CisgIC8qIEdldCB0aGUgZ2x5cGggdGhlIGN1cnNvciBp cyBvbi4gIElmIHdlIGNhbid0IHRlbGwgYmVjYXVzZQorICAgICB0aGUgY3VycmVudCBtYXRyaXgg aXMgaW52YWxpZCBvciBzdWNoLCBnaXZlIHVwLiAqLworICBzdHJ1Y3QgZ2x5cGggKmN1cnNvcl9n bHlwaCA9IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBocG9zLCB2cG9zKTsK KyAgaWYgKGN1cnNvcl9nbHlwaCA9PSBOVUxMKQorICAgIHsKKyAgICAgIERlbGV0ZU9iamVjdCAo aGIpOworICAgICAgcmV0dXJuOworICAgIH0KKyAgaW50IHJsID0gZng7CisgIGludCBydCA9IGZ5 OworICBpbnQgcnIgPSBybCArIHdkOworICBpbnQgcmIgPSBydCArIGg7CisgIC8vICBmcHJpbnRm IChzdGRlcnIsICJNQ19IT0xMT1dfQk9YOiAgcmwgKCVkKSB8IHJ0ICglZCkgfCByciAoJWQpIHwg cmIgKCVkKVxuIiwKKyAgLy8gICAgICAgICAgICAgICAgICAgcmwsIHJ0LCByciwgcmIpOworICBy ZWN0LmxlZnQgPSBybDsKKyAgcmVjdC50b3AgPSBydDsKKyAgcmVjdC5yaWdodCA9IHJyOworICBy ZWN0LmJvdHRvbSA9IHJiOworICBoZGMgPSBnZXRfZnJhbWVfZGMgKGYpOworICAvKiBTZXQgY2xp cHBpbmcsIGRyYXcgdGhlIHJlY3RhbmdsZSwgYW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ZCk7CisgICAgICAgIEhEQyBoZGM7CisgICAgICAgIC8qIElmIHRoZSBnbHlwaCdzIGJh Y2tncm91bmQgZXF1YWxzIHRoZSBjb2xvciB3ZSBub3JtYWxseSBkcmF3CisgICAgICAgIHRoZSBi YXIgY3Vyc29yIGluLCB0aGUgYmFyIGN1cnNvciBpbiBpdHMgbm9ybWFsIGNvbG9yIGlzCisgICAg ICAgIGludmlzaWJsZS4gIFVzZSB0aGUgZ2x5cGgncyBmb3JlZ3JvdW5kIGNvbG9yIGluc3RlYWQg aW4gdGhpcworICAgICAgICBjYXNlLCBvbiB0aGUgYXNzdW1wdGlvbiB0aGF0IHRoZSBnbHlwaCdz IGNvbG9ycyBhcmUgY2hvc2VuIHNvCisgICAgICAgIHRoYXQgdGhlIGdseXBoIGlzIGxlZ2libGUu ICovCisgICAgICAgIGlmIChmYWNlLT5iYWNrZ3JvdW5kID09IGN1cnNvcl9jb2xvcgorICAgICAg ICAgICAgJiYgIWN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKQorICAgICAgICAgIGN1cnNvcl9j b2xvciA9IGZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgIGludCBkZWZhdWx0X2Z4ID0gV0lORE9X X1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgeCk7CisgICAgICAgIGhkYyA9IGdldF9mcmFtZV9k YyAoZik7CisgICAgICAgIHczMl9jbGlwX3RvX3JvdyAodywgcm93LCBURVhUX0FSRUEsIGhkYyk7 CisgICAgICAgIGludCByeCA9IGZ4OworICAgICAgICBpbnQgcnkgPSBmeTsKKyAgICAgICAgaW50 IHJ3ID0gd2Q7CisgICAgICAgIGludCByaCA9IGg7CisgICAgICAgIC8vICBmcHJpbnRmIChzdGRl cnIsICJNQ19IQkFSOiAgZnggKCVkKSB8IGZ5ICglZCkgfCB3ZCAoJWQpIHwgaCAoJWQpXG4iLAor ICAgICAgICAvLyAgICAgICAgICAgICAgICAgICByeCwgcnksIHJ3LCByaCk7CisgICAgICAgIH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ZSAqZiA9IFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7 CisgICAgICAgICAgSFdORCBod25kID0gRlJBTUVfVzMyX1dJTkRPVyAoZik7CisgICAgICAgICAg dzMyX3N5c3RlbV9jYXJldF94CisgICAgICAgICAgICA9IFdJTkRPV19URVhUX1RPX0ZSQU1FX1BJ WEVMX1ggKHcsIHgpOworICAgICAgICAgIC8qIEZJWE1FOiAgV2hhdCBzaG91bGQgd2UgdXNlIGlu c3RlYWQgb2YgYHctPnBoeXNfY3Vyc29yX2FzY2VudCc/ICovCisgICAgICAgICAgdzMyX3N5c3Rl bV9jYXJldF95CisgICAgICAgICAgICA9IChXSU5ET1dfVE9fRlJBTUVfUElYRUxfWSAodywgeSkK KyAgICAgICAgICAgICAgICsgcm93LT5hc2NlbnQgLSB3LT5waHlzX2N1cnNvcl9hc2NlbnQpOwor ICAgICAgICAgIHczMl9zeXN0ZW1fY2FyZXRfd2luZG93ID0gdzsKKyAgICAgICAgICB3MzJfc3lz dGVtX2NhcmV0X2hkcl9oZWlnaHQgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAg ICAgICAgICB3MzJfc3lzdGVtX2NhcmV0X21vZGVfaGVpZ2h0ID0gV0lORE9XX01PREVfTElORV9I RUlHSFQgKHcpOworICAgICAgICAgIFBvc3RNZXNzYWdlIChod25kLCBXTV9JTUVfU1RBUlRDT01Q T1NJVElPTiwgMCwgMCk7CisgICAgICAgICAgLyogSWYgdGhlIHNpemUgb2YgdGhlIGFjdGl2ZSBj dXJzb3IgY2hhbmdlZCwgZGVzdHJveSB0aGUgb2xkCisgICAgICAgICAgICAgc3lzdGVtIGNhcmV0 LiAqLworICAgICAgICAgIGlmICh3MzJfc3lzdGVtX2NhcmV0X2h3bmQKKyAgICAgICAgICAgICAg JiYgKHczMl9zeXN0ZW1fY2FyZXRfaGVpZ2h0ICE9IGgpKQorICAgICAgICAgICAgUG9zdE1lc3Nh Z2UgKGh3bmQsIF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Nl ID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAg ICAgICAgICBnY192YWx1ZXMuZm9yZWdyb3VuZCA9IGhvbGxvd19hY3RpdmVfZmFjZS0+Zm9yZWdy b3VuZDsKKyAgICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3df YWN0aXZlX2ZhY2UtPmJhY2tncm91bmQ7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAg ICAgICAgICBlbHNlIGlmICghYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQgPSBs b29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0 aXZlLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBm YWNlICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgaG9sbG93X2luYWN0 aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5mb3JlZ3JvdW5k ID0gaG9sbG93X2luYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgICAg ICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfaW5hY3RpdmVfZmFjZS0+YmFja2dyb3Vu ZDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+ Y3Vyc29yX2djID0gWENyZWF0ZUdDIChOVUxMLCBGUkFNRV9XMzJfV0lORE9XIChmKSwgbWFzaywg JmdjX3ZhbHVlcyk7CisgICAgICAgICAgYmxvY2tfaW5wdXQgKCk7CisgICAgICAgIC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QgKGYsIGhvbGxvd19hY3RpdmVfcmVn aW9uX2VuZF9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxv d19hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJl YWwtZmFrZS1jdXJzb3ItcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAg IHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxv d19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5mb3JlZ3Jv dW5kID0gaG9sbG93X2FjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICAgICAg ICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IGhvbGxvd19hY3RpdmVfcmVnaW9uX2VuZF9mYWNlLT5i YWNrZ3JvdW5kOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgZWxzZSBp ZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVf cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID4g cmVnaW9uX2JlZworICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5j aGFycG9zIDwgcmVnaW9uX2VuZCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2Vf aWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29y LWluLXJlZ2lvbi1wcmUtenYtZmFjZS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uk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICAg ICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7 CisgICAgICAgICAgICAgICAgICAgICAgICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IGhvbGxvd19h Y3RpdmVfZmFjZS0+YmFja2dyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgICAgICAgICAgZWxzZSBpZiAoIWFjdGl2ZV9wKQorICAgICAgICAgICAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0 aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZh a2UtY3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAg ICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2luYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01f SUQgKGYsIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfaW5hY3RpdmVfZmFjZS0+Zm9yZWdyb3Vu ZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xs b3dfaW5hY3RpdmVfZmFjZS0+YmFja2dyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MgPSBYQ3JlYXRlR0Mg KE5VTEwsIEZSQU1FX1czMl9XSU5ET1cgKGYpLCBtYXNrLCAmZ2NfdmFsdWVzKTsKKyAgICAgICAg ICAgICAgYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgICAgIC8qIEZvcmNlIGBtY193MzJfc2V0 X2N1cnNvcl9nYycgdG8gdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycuICov CisgICAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX3AgPSB0cnVlOworICAgICAgICAgICAgICBt Y19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4LCBocG9z LCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNsLCBnbHlwaF9m bGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsIGN1cnNvcl9nY19wKTsKKyAgICAgICAg ICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MgPSBvcmlnaW5hbF9jdXJzb3JfZ2M7 CisgICAgICAgICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgICAgIG1jX3czMl9k cmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZw b3MsIHdkLCBoKTsKKyAgICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNl IE1DX0hPTExPV19CT1g6CisgICAgeworICAgICAgaWYgKGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3Jl ZW4gPj0gMCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9y YXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcuICovCisgICAg ICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBjb2xvcl9waXhlbDsKKyAg ICAgICAgICBtY193MzJfZHJhd19ob2xsb3dfY3Vyc29y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sdWVz KTsKKyAgICAgICAgICAvKiBGb3JjZSBgbWNfdzMyX3NldF9jdXJzb3JfZ2MnIHRvIHVzZSBgcy0+ Zi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MnLiAqLworICAgICAgICAgIGJvb2wgY3Vyc29y X2djX3AgPSB0cnVlOworICAgICAgICAgIG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgs IHJvdywgRFJBV19DVVJTT1IsIHgsIGhwb3MsIHZwb3MsIGxzbCwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9wLCBj dXJzb3JfZ2NfcCk7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2MgPSBv cmlnaW5hbF9jdXJzb3JfZ2M7CisgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAg fQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2Nf cCA9IGZhbHNlOworICAgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwg cm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBsc2wsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfZ2NfcCk7CisgICAgICAg ICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfQkFSOgorICAgIHsKKyAgICAg IGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAg ICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEu dzMyLT5jdXJzb3JfcGl4ZWwnLiAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vy c29yX3BpeGVsID0gY29sb3JfcGl4ZWw7CisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNp YmxlX29rYXlfcCA9IHRydWU7CisgICAgICAgICAgbWNfdzMyX2RyYXdfYmFyX2N1cnNvciAodywg bWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgaCwgY3Vyc29yX3dpZHRoLCBNQ19CQVIsIGN1cnNvcl9nY19p bnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9w aXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisg ICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9 IGZhbHNlOworICAgICAgICAgICAgbWNfdzMyX2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCBy b3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0JBUiwgY3Vyc29yX2djX2ludmlzaWJs ZV9va2F5X3ApOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1D X0hCQVI6CisgICAgeworICAgICAgaWYgKGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3JlZW4gPj0gMCAm JiBsc2wuYmx1ZSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlq YWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcuICovCisgICAgICAgICAgZi0+ b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBjb2xvcl9waXhlbDsKKyAgICAgICAgICBi b29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gdHJ1ZTsKKyAgICAgICAgICBtY193MzJf ZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9z LCB3ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lkdGgs IE1DX0hCQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICBmLT5vdXRw dXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAg ICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3Jf Z2NfaW52aXNpYmxlX29rYXlfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNfdzMyX2RyYXdfYmFy X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0hC QVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICB9CisgICAgICBicmVh azsKKyAgICB9CisgICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOworICB9CisgICAg fQorfQorCisvKiBEcmF3IGdseXBoIHN0cmluZyBTLiAgVGhlIGBtY19tYXRyaXhgIGlzIHJlc2Vy dmVkIGZvciBmdXR1cmUgdXNlIHdoZW4gZXJhc2luZworICAgZmFrZSBjdXJzb3JzIGR1cmluZyBg bWNfdXBkYXRlX3dpbmRvd19lcmFzZScgYW5kIHJlZHJhd2luZyBmYWtlIGN1cnNvcnMgb24KKyAg IGxlZnQvcmlnaHQgb3ZlcndyaXR0ZW4gZ2x5cGhzLiAqLworc3RhdGljIHZvaWQKK21jX3czMl9k cmF3X2dseXBoX3N0cmluZyAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgc3RydWN0IGdseXBoX21h dHJpeCAqbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93 ICpyb3csIHN0cnVjdCBtY19tYXRyaXggbWNfbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAg ICAgICBzdHJ1Y3QgbWNfUkdCIGxzbCwgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yLAorICAg ICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlLCBp bnQgY3Vyc29yX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGFjdGl2ZV9w LCBib29sIGN1cnNvcl9nY19wKQoreworICBib29sIHJlbGllZl9kcmF3bl9wID0gMDsKKyAgLyog SWYgUyBkcmF3cyBpbnRvIHRoZSBiYWNrZ3JvdW5kIG9mIGl0cyBzdWNjZXNzb3IsIGRyYXcgdGhl CisgICAgIGJhY2tncm91bmQgb2YgdGhlIHN1Y2Nlc3NvciBmaXJzdCBzbyB0aGF0IFMgY2FuIGRy YXcgaW50byBpdC4KKyAgICAgVGhpcyBtYWtlcyBTLT5uZXh0IHVzZSBYRHJhd1N0cmluZyBpbnN0 ZWFkIG9mIFhEcmF3SW1hZ2VTdHJpbmcuICovCisgIGlmIChzLT5uZXh0ICYmIHMtPnJpZ2h0X292 ZXJoYW5nICYmICFzLT5mb3Jfb3ZlcmxhcHMpCisgICAgeworICAgICAgaW50IHdpZHRoOworICAg ICAgc3RydWN0IGdseXBoX3N0cmluZyAqbmV4dDsKKyAgICAgIGZvciAod2lkdGggPSAwLCBuZXh0 ID0gcy0+bmV4dDsKKyAgICAgICAgICAgbmV4dCAmJiB3aWR0aCA8IHMtPnJpZ2h0X292ZXJoYW5n OworICAgICAgICAgICB3aWR0aCArPSBuZXh0LT53aWR0aCwgbmV4dCA9IG5leHQtPm5leHQpCisg ICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSAhPSBJTUFHRV9HTFlQSCkKKyAgICAg ICAgICB7CisgICAgICAgICAgICBtY193MzJfc2V0X2dseXBoX3N0cmluZ19nYyAobmV4dCwgY3Vy c29yX2djX3ApOworICAgICAgICAgICAgdzMyX3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmcgKG5l eHQpOworICAgICAgICAgICAgaWYgKG5leHQtPmZpcnN0X2dseXBoLT50eXBlID09IFNUUkVUQ0hf R0xZUEgpCisgICAgICAgICAgICAgIG1jX3czMl9kcmF3X3N0cmV0Y2hfZ2x5cGhfc3RyaW5nIChu ZXh0KTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHczMl9kcmF3X2dseXBo X3N0cmluZ19iYWNrZ3JvdW5kIChuZXh0LCB0cnVlKTsKKyAgICAgICAgICAgIG5leHQtPm51bV9j bGlwcyA9IDA7CisgICAgICAgICAgfQorICAgIH0KKyAgLyogU2V0IHVwIFMtPmdjLCBzZXQgY2xp cHBpbmcgYW5kIGRyYXcgUy4gKi8KKyAgbWNfdzMyX3NldF9nbHlwaF9zdHJpbmdfZ2MgKHMsIGN1 cnNvcl9nY19wKTsKKyAgLyogRHJhdyByZWxpZWYgKGlmIGFueSkgaW4gYWR2YW5jZSBmb3IgY2hh ci9jb21wb3NpdGlvbiBzbyB0aGF0IHRoZQorICAgICBnbHlwaCBzdHJpbmcgY2FuIGJlIGRyYXdu IG92ZXIgaXQuICovCisgIGlmICghcy0+Zm9yX292ZXJsYXBzCisgICAgICAmJiBzLT5mYWNlLT5i b3ggIT0gRkFDRV9OT19CT1gKKyAgICAgICYmIChzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDSEFS X0dMWVBIC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WNrZ3JvdW5kIChzLCBmYWxzZSk7CisgICAgICB3MzJfZHJhd19nbHlwaGxlc3Nf Z2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHMpOworICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoK KyAgICAgIGVtYWNzX2Fib3J0ICgpOworICAgIH0KKyAgaWYgKCFzLT5mb3Jfb3ZlcmxhcHMpCisg ICAgeworICAgICAgLyogRHJhdyB1bmRlcmxpbmUuICovCisgICAgICBpZiAocy0+ZmFjZS0+dW5k ZXJsaW5lX3ApCisgICAgICAgIHsKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3R5 cGUgPT0gRkFDRV9VTkRFUl9XQVZFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBDT0xP UlJFRiBjb2xvcjsKKyAgICAgICAgICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9kZWZhdWx0 ZWRfcCkKKyAgICAgICAgICAgICAgICBjb2xvciA9IHMtPmdjLT5mb3JlZ3JvdW5kOworICAgICAg ICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIGNvbG9yID0gcy0+ZmFjZS0+dW5kZXJs aW5lX2NvbG9yOworICAgICAgICAgICAgICB3MzJfZHJhd191bmRlcndhdmUgKHMsIGNvbG9yKTsK KyAgICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlw ZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHVuc2ln bmVkIGxvbmcgdGhpY2tuZXNzLCBwb3NpdGlvbjsKKyAgICAgICAgICAgICAgaW50IHk7CisgICAg ICAgICAgICAgIGlmIChzLT5wcmV2ICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV9wCisgICAg ICAgICAgICAgICAgICAmJiBzLT5wcmV2LT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VO REVSX0xJTkUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgLyogV2UgdXNl IHRoZSBzYW1lIHVuZGVybGluZSBzdHlsZSBhcyB0aGUgcHJldmlvdXMgb25lLiAqLworICAgICAg ICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+cHJldi0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAg ICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gcy0+cHJldi0+dW5kZXJsaW5lX3Bvc2l0aW9uOwor ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJsaW5lIHRoaWNrbmVzcy4gIERlZmF1 bHQgaXMgMSBwaXhlbC4gKi8KKyAgICAgICAgICAgICAgICAgIGlmIChzLT5mb250ICYmIHMtPmZv bnQtPnVuZGVybGluZV90aGlja25lc3MgPiAwKQorICAgICAgICAgICAgICAgICAgICB0aGlja25l c3MgPSBzLT5mb250LT51bmRlcmxpbmVfdGhpY2tuZXNzOworICAgICAgICAgICAgICAgICAgICBl bHNlCisgICAgICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gMTsKKyAgICAgICAgICAgICAg ICAgIGlmICh4X3VuZGVybGluZV9hdF9kZXNjZW50X2xpbmUpCisgICAgICAgICAgICAgICAgICAg IHBvc2l0aW9uID0gKHMtPmhlaWdodCAtIHRoaWNrbmVzcykgLSAocy0+eWJhc2UgLSBzLT55KTsK KyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJsaW5lIHBvc2l0aW9uLiAgVGhpcyBp cyB0aGUgcmVjb21tZW5kZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHZlcnRpY2FsIG9m ZnNldCBpbiBwaXhlbHMgZnJvbSB0aGUgYmFzZWxpbmUgdG8gdGhlIHRvcCBvZgorICAgICAgICAg ICAgICAgICAgICAgICAgICAgdGhlIHVuZGVybGluZS4gIFRoaXMgaXMgYSBzaWduZWQgdmFsdWUg YWNjb3JkaW5nIHRvIHRoZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgc3BlY3MsIGFuZCBp dHMgZGVmYXVsdCBpcworICAgICAgICAgICAgICAgICAgICAgICAgICAgUk9VTkQgKChtYXhpbXVt X2Rlc2NlbnQpIC8gMiksIHdpdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIFJPVU5EICh4 KSA9IGZsb29yICh4ICsgMC41KSAgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICh4X3Vz ZV91bmRlcmxpbmVfcG9zaXRpb25fcHJvcGVydGllcworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHMtPmZvbnQgJiYgcy0+Zm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uID49IDApCisgICAg ICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gcy0+Zm9udC0+dW5kZXJsaW5lX3Bvc2l0 aW9uOworICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAocy0+Zm9udCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+Zm9udC0+ZGVzY2VudCArIDEpIC8gMjsK KyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IG1h eCAocG9zaXRpb24sIHVuZGVybGluZV9taW5pbXVtX29mZnNldCk7CisgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgICAvKiBDaGVjayB0aGUgc2FuaXR5IG9mIHRoaWNrbmVzcyBhbmQgcG9z aXRpb24uICBXZSBzaG91bGQKKyAgICAgICAgICAgICAgICAgYXZvaWQgZHJhd2luZyB1bmRlcmxp bmUgb3V0IG9mIHRoZSBjdXJyZW50IGxpbmUgYXJlYS4gKi8KKyAgICAgICAgICAgICAgaWYgKHMt PnkgKyBzLT5oZWlnaHQgPD0gcy0+eWJhc2UgKyBwb3NpdGlvbikKKyAgICAgICAgICAgICAgICBw b3NpdGlvbiA9IChzLT5oZWlnaHQgLSAxKSAtIChzLT55YmFzZSAtIHMtPnkpOworICAgICAgICAg ICAgICBpZiAocy0+eSArIHMtPmhlaWdodCA8IHMtPnliYXNlICsgcG9zaXRpb24gKyB0aGlja25l c3MpCisgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gKHMtPnkgKyBzLT5oZWlnaHQpIC0gKHMt PnliYXNlICsgcG9zaXRpb24pOworICAgICAgICAgICAgICBzLT51bmRlcmxpbmVfdGhpY2tuZXNz ID0gdGhpY2tuZXNzOworICAgICAgICAgICAgICBzLT51bmRlcmxpbmVfcG9zaXRpb24gPXBvc2l0 aW9uOworICAgICAgICAgICAgICB5ID0gcy0+eWJhc2UgKyBwb3NpdGlvbjsKKyAgICAgICAgICAg ICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICB3 MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmdjLT5mb3JlZ3JvdW5kLCBzLT54LAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHksIHMtPndpZHRoLCAxKTsKKyAgICAgICAgICAg ICAgICBlbHNlCisgICAgICAgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMs IHMtPmZhY2UtPnVuZGVybGluZV9jb2xvciwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHksIHMtPndpZHRoLCAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAg ICAgLyogRHJhdyBvdmVybGluZS4gKi8KKyAgICAgIGlmIChzLT5mYWNlLT5vdmVybGluZV9wKQor ICAgICAgICB7CisgICAgICAgICAgdW5zaWduZWQgbG9uZyBkeSA9IDAsIGggPSAxOworICAgICAg ICAgIGlmIChzLT5mYWNlLT5vdmVybGluZV9jb2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAg IHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+Z2MtPmZvcmVncm91bmQsIHMtPngsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICBzLT55ICsgZHksIHMtPndpZHRoLCBoKTsKKyAgICAg ICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBz LT5mYWNlLT5vdmVybGluZV9jb2xvciwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgcy0+eSArIGR5LCBzLT53aWR0aCwgaCk7CisgICAgICAgIH0KKyAgICAgIC8qIERyYXcgc3Ry aWtlLXRocm91Z2guICovCisgICAgICBpZiAocy0+ZmFjZS0+c3RyaWtlX3Rocm91Z2hfcAorICAg ICAgICAgICYmICFGT05UX1RFWFRNRVRSSUMgKHMtPmZvbnQpLnRtU3RydWNrT3V0KQorICAgICAg ICB7CisgICAgICAgICAgdW5zaWduZWQgbG9uZyBoID0gMTsKKyAgICAgICAgICB1bnNpZ25lZCBs b25nIGR5ID0gKHMtPmhlaWdodCAtIGgpIC8gMjsKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+c3Ry aWtlX3Rocm91Z2hfY29sb3JfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICB3MzJfZmlsbF9hcmVh IChzLT5mLCBzLT5oZGMsIHMtPmdjLT5mb3JlZ3JvdW5kLCBzLT54LCBzLT55ICsgZHksCisgICAg ICAgICAgICAgICAgICAgICAgICAgICBzLT53aWR0aCwgaCk7CisgICAgICAgICAgICBlbHNlCisg ICAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+ZmFjZS0+c3RyaWtl X3Rocm91Z2hfY29sb3IsIHMtPngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPnkg KyBkeSwgcy0+d2lkdGgsIGgpOworICAgICAgICB9CisgICAgICAvKiBEcmF3IHJlbGllZiBpZiBu b3QgeWV0IGRyYXduLiAqLworICAgICAgaWYgKCFyZWxpZWZfZHJhd25fcCAmJiBzLT5mYWNlLT5i b3ggIT0gRkFDRV9OT19CT1gpCisgICAgICAgIHczMl9kcmF3X2dseXBoX3N0cmluZ19ib3ggKHMp OworICAgICAgaWYgKHMtPnByZXYpCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhf c3RyaW5nICpwcmV2OworICAgICAgICAgIGZvciAocHJldiA9IHMtPnByZXY7IHByZXY7IHByZXYg PSBwcmV2LT5wcmV2KQorICAgICAgICAgICAgaWYgKHByZXYtPmhsICE9IHMtPmhsCisgICAgICAg ICAgICAgICAgJiYgcHJldi0+eCArIHByZXYtPndpZHRoICsgcHJldi0+cmlnaHRfb3Zlcmhhbmcg PiBzLT54KQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogQXMgcHJldiB3YXMg ZHJhd24gd2hpbGUgY2xpcHBlZCB0byBpdHMgb3duIGFyZWEsIHdlCisgICAgICAgICAgICAgICAg ICAgbXVzdCBkcmF3IHRoZSByaWdodF9vdmVyaGFuZyBwYXJ0IHVzaW5nIHMtPmhsIG5vdy4gKi8K KyAgICAgICAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2Ugc2F2ZSA9IHByZXYtPmhsOwor ICAgICAgICAgICAgICAgIHByZXYtPmhsID0gcy0+aGw7CisgICAgICAgICAgICAgICAgbWNfdzMy X3NldF9nbHlwaF9zdHJpbmdfZ2MgKHByZXYsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICAgICAg ICB3MzJfc2V0X2dseXBoX3N0cmluZ19jbGlwcGluZ19leGFjdGx5IChzLCBwcmV2KTsKKyAgICAg ICAgICAgICAgICBpZiAocHJldi0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSCkKKyAg ICAgICAgICAgICAgICAgIHczMl9kcmF3X2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChwcmV2KTsK KyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgdzMyX2RyYXdfY29t cG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChwcmV2KTsKKyAgICAgICAgICAgICAgICB3 MzJfc2V0X2NsaXBfcmVjdGFuZ2xlIChwcmV2LT5oZGMsIE5VTEwpOworICAgICAgICAgICAgICAg IHByZXYtPmhsID0gc2F2ZTsKKyAgICAgICAgICAgICAgICBwcmV2LT5udW1fY2xpcHMgPSAwOwor ICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGlmIChzLT5uZXh0KQorICAgICAgICB7 CisgICAgICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAqbmV4dDsKKyAgICAgICAgICBmb3IgKG5l eHQgPSBzLT5uZXh0OyBuZXh0OyBuZXh0ID0gbmV4dC0+bmV4dCkKKyAgICAgICAgICAgIGlmIChu ZXh0LT5obCAhPSBzLT5obAorICAgICAgICAgICAgICAgICYmIG5leHQtPnggLSBuZXh0LT5sZWZ0 X292ZXJoYW5nIDwgcy0+eCArIHMtPndpZHRoKQorICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgLyogQXMgbmV4dCB3aWxsIGJlIGRyYXduIHdoaWxlIGNsaXBwZWQgdG8gaXRzIG93biBh cmVhLAorICAgICAgICAgICAgICAgICAgIHdlIG11c3QgZHJhdyB0aGUgbGVmdF9vdmVyaGFuZyBw YXJ0IHVzaW5nIHMtPmhsIG5vdy4gKi8KKyAgICAgICAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhz X2ZhY2Ugc2F2ZSA9IG5leHQtPmhsOworICAgICAgICAgICAgICAgIG5leHQtPmhsID0gcy0+aGw7 CisgICAgICAgICAgICAgICAgbWNfdzMyX3NldF9nbHlwaF9zdHJpbmdfZ2MgKG5leHQsIGN1cnNv cl9nY19wKTsKKyAgICAgICAgICAgICAgICB3MzJfc2V0X2dseXBoX3N0cmluZ19jbGlwcGluZ19l eGFjdGx5IChzLCBuZXh0KTsKKyAgICAgICAgICAgICAgICBpZiAobmV4dC0+Zmlyc3RfZ2x5cGgt PnR5cGUgPT0gQ0hBUl9HTFlQSCkKKyAgICAgICAgICAgICAgICAgIHczMl9kcmF3X2dseXBoX3N0 cmluZ19mb3JlZ3JvdW5kIChuZXh0KTsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgICAgICAgICAgdzMyX2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChu ZXh0KTsKKyAgICAgICAgICAgICAgICB3MzJfc2V0X2NsaXBfcmVjdGFuZ2xlIChuZXh0LT5oZGMs IE5VTEwpOworICAgICAgICAgICAgICAgIG5leHQtPmhsID0gc2F2ZTsKKyAgICAgICAgICAgICAg ICBuZXh0LT5udW1fY2xpcHMgPSAwOworICAgICAgICAgICAgICAgIG5leHQtPmNsaXBfaGVhZCA9 IHMtPm5leHQ7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgLyogUmVzZXQg Y2xpcHBpbmcuICovCisgIHczMl9zZXRfY2xpcF9yZWN0YW5nbGUgKHMtPmhkYywgTlVMTCk7Cisg IHMtPm51bV9jbGlwcyA9IDA7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBGcmluZ2UgYml0bWFwcy4gICovCiAKIHN0YXRp YyBpbnQgbWF4X2ZyaW5nZV9ibXAgPSAwOwpAQCAtNTQyLDYgKzE3MDQsMTUgQEAgdzMyX3VwZGF0 ZV9iZWdpbiAoc3RydWN0IGZyYW1lICpmKQogICBpZiAoISBGUkFNRV9XMzJfUCAoZikpCiAgICAg cmV0dXJuOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09S UyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gZjsKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogICAvKiBSZWdlbmVyYXRlIGRpc3BsYXkgcGFsZXR0ZSBiZWZvcmUgZHJhd2lu ZyBpZiBsaXN0IG9mIHJlcXVlc3RlZAogICAgICBjb2xvcnMgaGFzIGNoYW5nZWQuICovCiAgIGlm IChkaXNwbGF5X2luZm8tPnJlZ2VuX3BhbGV0dGUpCkBAIC02NzQsNiArMTg0NSwxNiBAQCB3MzJf dXBkYXRlX2VuZCAoc3RydWN0IGZyYW1lICpmKQogCiAgIC8qIE1vdXNlIGhpZ2hsaWdodCBtYXkg YmUgZGlzcGxheWVkIGFnYWluLiAgKi8KICAgTU9VU0VfSExfSU5GTyAoZiktPm1vdXNlX2ZhY2Vf ZGVmZXIgPSBmYWxzZTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExF LUNVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGluZ19mcmFtZSA9IE5VTEw7CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKIH0KIAogCkBAIC00MDAyLDEzICs1MTgzLDc0IEBAIHczMl9z ZXRfdmVydGljYWxfc2Nyb2xsX2JhciAoc3RydWN0IHdpbmRvdyAqdywKIAkgICAgICByZWxlYXNl X2ZyYW1lX2RjIChmLCBoZGMpOwogCS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k9UVE9NLCBsZWZ0LCB0 b3AsIHdpZHRoLCBtYXggKGhlaWdodCwgMSksCi0gICAgICAgICAgICAgICAgICAgICAgICBTV1Bf RlJBTUVDSEFOR0VEKTsKKyAgICAgICAgICBpZiAobGVmdCA8PSBiYXItPmxlZnQpCisgICAgICAg ICAgICBteV9zaG93X3dpbmRvdyAoZiwgaHduZCwgU1dfSElERSk7CisgICAgICAgICAgTW92ZVdp bmRvdyAoaHduZCwgbGVmdCwgdG9wLCB3aWR0aCwgbWF4IChoZWlnaHQsIDEpLCBsZWZ0IDw9IGJh ci0+bGVmdCk7CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKwogCiAJICBzaS5jYlNpemUgPSBzaXplb2YgKHNpKTsKIAkgIHNpLmZNYXNrID0g U0lGX1JBTkdFOwpAQCAtNDI3Nyw2ICs1NTE5LDIxIEBAIHczMl9qdWRnZV9zY3JvbGxfYmFycyAo c3RydWN0IGZyYW1lICpmKQogICAgIHsKICAgICAgIHN0cnVjdCBzY3JvbGxfYmFyICpiID0gWFND Uk9MTF9CQVIgKGJhcik7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKKyAgICAgIC8qIGBEZXN0cm95V2luZG93JyB3aXRoaW4gYHhfc2Nyb2xs X2Jhcl9yZW1vdmUnIHJlcGFpbnRzIHRoZSByZWN0YW5nbGUuCisgICAgICBUaGVyZWZvcmUsIHdl IGZpcnN0IHNlbmQgYSBtZXNzYWdlIHRvIGluaGliaXQgcmVwYWludGluZy4gKi8KKyAgICAgIGlm ICghV0lORE9XX0xJVkVfUCAoYi0+d2luZG93KSkKKyAgICAgICAgeworICAgICAgICAgIEhXTkQg aHduZCA9IFNDUk9MTF9CQVJfVzMyX1dJTkRPVyAoYik7CisgICAgICAgICAgU2VuZE1lc3NhZ2Ug KGh3bmQsIFdNX1NFVFJFRFJBVywgZmFsc2UsIDApOworICAgICAgICB9CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKICAgICAgIHczMl9zY3JvbGxfYmFyX3JlbW92ZSAoYik7CiAKICAg ICAgIG5leHQgPSBiLT5uZXh0OwpAQCAtNzA4OCw2ICs4MzQ1LDIwIEBAIGV4dGVybiBmcmFtZV9w YXJtX2hhbmRsZXIgdzMyX2ZyYW1lX3Bhcm1faGFuZGxlcnNbXTsKIAogc3RhdGljIHN0cnVjdCBy ZWRpc3BsYXlfaW50ZXJmYWNlIHczMl9yZWRpc3BsYXlfaW50ZXJmYWNlID0KIHsKKworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyogYHJlZGlz cGxheV9pbnRlcmZhY2UnIGluIGB3MzJ0ZXJtLmNgIG11c3QgYmUgaW4gdGhlIGV4YWN0IHNhbWUg b3JkZXIgYXMgdGhlCitgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYGRpc3BleHRlcm4uaGAhICov CisKKyAgbWNfdzMyX2RyYXdfd2luZG93X2N1cnNvciwKKyAgbWNfdzMyX2RyYXdfZ2x5cGhfc3Ry aW5nLAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIHczMl9mcmFtZV9wYXJtX2hh bmRsZXJzLAogICBndWlfcHJvZHVjZV9nbHlwaHMsCiAgIGd1aV93cml0ZV9nbHlwaHMsCmRpZmYg LS1naXQgYS9zcmMvd2luZG93LmggYi9zcmMvd2luZG93LmgKaW5kZXggNmIwZjBlNS4uMTRkZDM4 YSAxMDA2NDQKLS0tIGEvc3JjL3dpbmRvdy5oCisrKyBiL3NyYy93aW5kb3cuaApAQCAtMzI0LDYg KzMyNCwxNDcgQEAgc3RydWN0IHdpbmRvdwogCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCiAK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICov CisKKy8qIFN1ZmZpeGVzIGZvciB0aGUgYG1jYCB3aW5kb3cgcG9pbnRlciBwcmVmaXguICovCitz dHJ1Y3QgbXVsdGlwbGVfY3Vyc29ycworeworICAvKiBUaGUgcmVjb3JkZWQgcGl4ZWwgd2lkdGgg b2YgdGhlIGxhc3QgbGluZSBudW1iZXIgZHJhd24gZHVyaW5nIHJlZGlzcGxheSAqLworICBpbnQg bG51bV9waXhlbF93aWR0aDsKK30gbWM7CisKK3N0cnVjdCBtY19tYXRyaXgKK3sKKyAgcHRyZGlm Zl90IHZwb3NfYWxsb2NhdGVkOworICBwdHJkaWZmX3QgdnBvc191c2VkOworICBwdHJkaWZmX3Qg Y3Vyc29yc191c2VkWzRdOworICBlbnVtIG1jX2NhY2hlX3R5cGUKKyAgeworICAgIE1DX0NBQ0hF LAorICAgIENIX0NBQ0hFLAorICAgIEZDX0NBQ0hFLAorICAgIE5PX0NBQ0hFCisgIH0gY2FjaGVf dHlwZTsKKyAgc3RydWN0IG1jX3Zwb3MKKyAgeworICAgIHB0cmRpZmZfdCBjYWNoZV9hbGxvY2F0 ZWRbNF07CisgICAgcHRyZGlmZl90IGNhY2hlX3VzZWRbNF07CisgICAgc3RydWN0IG1jX2NvbnRl bnRzCisgICAgeworICAgICAgYm9vbF9iZiBzYW1lX3AgOiAxOworICAgICAgc3RydWN0IGdseXBo IGdseXBoOworICAgICAgaW50IHg7CisgICAgICBpbnQgZng7CisgICAgICBpbnQgeTsKKyAgICAg IGludCBmeTsKKyAgICAgIGludCBocG9zOworICAgICAgaW50IHZwb3M7CisgICAgICBpbnQgd2Q7 CisgICAgICBpbnQgaDsKKyAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUKKyAgICAgIHsKKyAgICAg ICAgLyogTk9URTogIFRoZSBmcmluZ2UgYml0bWFwIGZyYW1ld29yayByZWxpZXMgdXBvbiBNQ19O T19GUklOR0VfQklUTUFQCisgICAgICAgIGhhdmluZyBhIHZhbHVlIG9mIHplcm8gKDApLiAqLwor ICAgICAgICBNQ19OT19GUklOR0VfQklUTUFQLAorICAgICAgICBNQ19OT19DVVJTT1IsCisgICAg ICAgIE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAsCisgICAgICAgIE1DX0xFRlRfRlJJTkdFX0JJVE1B UCwKKyAgICAgICAgTUNfRlJBTUVEX0JPWCwKKyAgICAgICAgTUNfRklMTEVEX0JPWCwKKyAgICAg ICAgTUNfSE9MTE9XX0JPWCwKKyAgICAgICAgTUNfQkFSLAorICAgICAgICBNQ19IQkFSCisgICAg ICB9IGN1cnNvcl90eXBlOworICAgICAgaW50IGN1cnNvcl93aWR0aDsKKyAgICAgIHN0cnVjdCBt Y19SR0IKKyAgICAgIHsKKyAgICAgICAgZG91YmxlIHJlZDsKKyAgICAgICAgZG91YmxlIGdyZWVu OworICAgICAgICBkb3VibGUgYmx1ZTsKKyAgICAgIH0gZmcsIGJnOworICAgICAgYm9vbF9iZiBh Y3RpdmVfcCA6IDE7CisgICAgICBlbnVtIG1jX2ZsYXZvcgorICAgICAgeworICAgICAgICBOT19G TEFWT1IsCisgICAgICAgIE1DX0dMWVBILAorICAgICAgICBNQ19HTFlQSExFU1MsCisgICAgICAg IE1DX09WRVJMQVlfQVJST1dfQklUTUFQLAorICAgICAgICBNQ19QSUxDUk9XLAorICAgICAgICBN Q19IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XLAorICAgICAgICBNQ19SRVZFUlNFRF9IT0xM T1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XLAorICAgICAgICBNQ19IT0xMT1dfUkVDVEFOR0xFLAor ICAgICAgICBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1csCisgICAgICAgIE1DX1JFVkVSU0VE X1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVywKKyAgICAgICAgTUNfVkVSVElDQUxfQkFSLAorICAg ICAgICBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIsCisgICAgICAgIE1DX1ZFUlRJQ0FMX0JBUl9C QUNLU0xBU0gKKyAgICAgIH0gZ2x5cGhfZmxhdm9yOworICAgICAgZW51bSBtY19yb3dfcG9zaXRp b24KKyAgICAgIHsKKyAgICAgICAgUFJFX1pWLAorICAgICAgICBBVF9aViwKKyAgICAgICAgUE9T VF9aVgorICAgICAgfSByb3dfcG9zaXRpb247CisgICAgICBib29sX2JmIGVuYWJsZWRfcCA6IDE7 CisgICAgfSAqY2FjaGVbNF07CisgIH0gKnZwb3M7CisgIC8qIFVzZWQgZWxzZXdoZXJlLiAqLwor ICBzdHJ1Y3QgbWNfZXNzZW50aWFscworICB7CisgICAgYm9vbF9iZiBhY3RpdmVfcCA6IDE7Cisg ICAgc3RydWN0IG1jX1JHQiBjaF9mZ1szXSwgZmNfZmdbM10sIHNwX2ZnOworICAgIGludCBmY194 OworICAgIGludCB6djsKKyAgICBpbnQgenZfYnl0ZTsKKyAgfSBlc3NlbnRpYWxzOworICAvKiBV c2VkIGVsc2V3aGVyZS4gKi8KKyAgZW51bSBtY19lbmdpbmVfdHlwZQorICB7CisgICAgTVVMVElQ TEVfQ1VSU09SUywKKyAgICBIT1JJWk9OVEFMX1JVTEVSLAorICAgIFZFUlRJQ0FMX1JVTEVSLAor ICAgIEZJTExfQ09MVU1OLAorICAgIENVUlNPUl9JTkRJQ0FUT1IKKyAgfSBhY3Rpb25fdHlwZTsK KyAgLyogVXNlZCBlbHNld2hlcmUuICovCisgIGVudW0gbWNfcHJlX3Njcm9sbF9jbGVhbl90eXBl CisgIHsKKyAgICBUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfRE9XTiwKKyAgICBU UllfV0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfVVAsCisgICAgVFJZX1dJTkRPV19JRAor ICB9IG1jX3ByZV9zY3JvbGxfY2xlYW5fdHlwZV9fZnJvbV93aGVyZTsKKyAgLyogVXNlZCBlbHNl d2hlcmUuICovCisgIGVudW0gbWNfZHJhd19yb3dfdHlwZQorICB7CisgICAgTk9XSEVSRSwKKyAg ICBTQ1JJQkVfT05FLAorICAgIFNDUklCRV9UV08sCisgICAgU0NSSUJFX1RIUkVFLAorICAgIFNL SVBQRUQsCisgICAgUE9TVF9DSEFOR0VELAorICAgIFVOQ0hBTkdFRCwKKyAgICBTRVRfQ1VSU09S X09ORSwKKyAgICBTRVRfQ1VSU09SX1RXTworICB9IG1jX2RyYXdfcm93X3R5cGVfX2Zyb21fd2hl cmU7CisgIC8qIFVzZWQgZWxzZXdoZXJlLiAqLworICBlbnVtIG1jX3JlZHJhd19yb3dfdHlwZQor ICB7CisgICAgVVBEQVRFX1dJTkRPV19fUkVEUkFXX09WRVJMQVBQRURfUk9XUywKKyAgICBHVUlf SU5TRVJUX0dMWVBIUywKKyAgICBHVUlfRklYX09WRVJMQVBQSU5HX0FSRUEsCisgICAgRFJBV19S T1dfV0lUSF9NT1VTRV9GQUNFLAorICAgIEVYUE9TRV9BUkVBX09ORSwKKyAgICBFWFBPU0VfQVJF QV9UV08sCisgICAgRVhQT1NFX0xJTkUKKyAgfSBtY19yZWRyYXdfcm93X3R5cGVfX2Zyb21fd2hl cmU7Cit9IG1jX21hdHJpeDsKKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqK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VE9SIChkcCwgY2gpKSkJCVwKKwkgIHdpZHRoID0gc2FuaXRpemVfY2hhcl93aWR0 aCAoQVNJWkUgKERJU1BfQ0hBUl9WRUNUT1IgKGRwLCBjaCkpKTsgXAorCWVsc2UJCQkJCQkJCVwK KwkgIHdpZHRoID0gQ0hBUkFDVEVSX1dJRFRIIChjaCk7CQkJCQlcCisgICAgICB9CQkJCQkJCQkJ XAorICB9IHdoaWxlICgwKQorCitMaXNwX09iamVjdAorbWNfdmVjdG9yIChpbnQgbGVuZ3RoKQor eworICBzdHJ1Y3QgTGlzcF9WZWN0b3IgKnAgPSBhbGxvY2F0ZV92ZWN0b3IgKGxlbmd0aCk7Cisg IGZvciAocHRyZGlmZl90IGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspCisgICAgcC0+Y29udGVudHNb aV0gPSBRbmlsOworICByZXR1cm4gbWFrZV9saXNwX3B0ciAocCwgTGlzcF9WZWN0b3JsaWtlKTsK K30KKworTGlzcF9PYmplY3QKK21jX2xpc3RuIChwdHJkaWZmX3QgY291bnQsIExpc3BfT2JqZWN0 IGFyZywgLi4uKQoreworICBlYXNzdW1lICgwIDwgY291bnQpOworICBMaXNwX09iamVjdCB2YWwg PSBGY29ucyAoYXJnLCBRbmlsKTsKKyAgTGlzcF9PYmplY3QgdGFpbCA9IHZhbDsKKyAgdmFfbGlz dCBhcDsKKyAgdmFfc3RhcnQgKGFwLCBhcmcpOworICBmb3IgKHB0cmRpZmZfdCBpID0gMTsgaSA8 IGNvdW50OyBpKyspCisgICAgeworICAgICAgTGlzcF9PYmplY3QgZWxlbSA9IEZjb25zICh2YV9h cmcgKGFwLCBMaXNwX09iamVjdCksIFFuaWwpOworICAgICAgWFNFVENEUiAodGFpbCwgZWxlbSk7 CisgICAgICB0YWlsID0gZWxlbTsKKyAgICB9CisgIHZhX2VuZCAoYXApOworICByZXR1cm4gdmFs OworfQorCitMaXNwX09iamVjdAorbWNfbWVtcSAoTGlzcF9PYmplY3QgZWx0LCBMaXNwX09iamVj dCBsaXN0KQoreworICB3aGlsZSAoMSkKKyAgICB7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KSB8 fCBFUSAoWENBUiAobGlzdCksIGVsdCkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhD RFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkgfHwgRVEgKFhDQVIgKGxpc3QpLCBl bHQpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlm ICghQ09OU1AgKGxpc3QpIHx8IEVRIChYQ0FSIChsaXN0KSwgZWx0KSkKKyAgICAgICAgYnJlYWs7 CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgfQorICByZXR1cm4gbGlzdDsKK30KKwor TGlzcF9PYmplY3QKK21jX250aCAoaW50IG51bSwgTGlzcF9PYmplY3QgbGlzdCkKK3sKKyAgZm9y IChpbnQgaSA9IDA7IGkgPCBudW0gJiYgIU5JTFAgKGxpc3QpOyBpKyspCisgICAgbGlzdCA9IFhD RFIgKGxpc3QpOworICBpZiAoQ09OU1AgKGxpc3QpKQorICAgIHJldHVybiBYQ0FSIChsaXN0KTsK KyAgICBlbHNlCisgICAgICByZXR1cm4gUW5pbDsKK30KKworTGlzcF9PYmplY3QKK21jX2Fzc3Eg KExpc3BfT2JqZWN0IGtleSwgTGlzcF9PYmplY3QgbGlzdCkKK3sKKyAgd2hpbGUgKDEpCisgICAg eworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxp c3QpKQorICAgICAgICAgICAgICAmJiBFUSAoWENBUiAoWENBUiAobGlzdCkpLCBrZXkpKSkKKyAg ICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNPTlNQ IChsaXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAg ICYmIEVRIChYQ0FSIChYQ0FSIChsaXN0KSksIGtleSkpKQorICAgICAgICBicmVhazsKKyAgICAg IGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAg fHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgRVEgKFhDQVIgKFhDQVIg KGxpc3QpKSwga2V5KSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3Qp OworICAgIH0KKyAgaWYgKENPTlNQIChsaXN0KSkKKyAgICByZXR1cm4gWENBUiAobGlzdCk7Cisg ICAgZWxzZQorICAgICAgcmV0dXJuIFFuaWw7Cit9CisKK0xpc3BfT2JqZWN0CittY19hc3NvYyAo TGlzcF9PYmplY3Qga2V5LCBMaXNwX09iamVjdCBsaXN0KQoreworICBMaXNwX09iamVjdCBjYXI7 CisgIHdoaWxlICgxKQorICAgIHsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAg fHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgKGNhciA9IFhDQVIgKFhD QVIgKGxpc3QpKSwKKyAgICAgICAgICAgICAgICAgIEVRIChjYXIsIGtleSkgfHwgIU5JTFAgKEZl cXVhbCAoY2FyLCBrZXkpKSkpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChs aXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAgfHwgKENPTlNQIChYQ0FS IChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgKGNhciA9IFhDQVIgKFhDQVIgKGxpc3QpKSwKKyAg ICAgICAgICAgICAgICAgIEVRIChjYXIsIGtleSkgfHwgIU5JTFAgKEZlcXVhbCAoY2FyLCBrZXkp KSkpKQorICAgICAgICBicmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlm ICghQ09OU1AgKGxpc3QpCisgICAgICAgICAgfHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAg ICAgICAgICAgJiYgKGNhciA9IFhDQVIgKFhDQVIgKGxpc3QpKSwKKyAgICAgICAgICAgICAgICAg IEVRIChjYXIsIGtleSkgfHwgIU5JTFAgKEZlcXVhbCAoY2FyLCBrZXkpKSkpKQorICAgICAgICBi cmVhazsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICB9CisgIGlmIChDT05TUCAobGlz dCkpCisgICAgcmV0dXJuIFhDQVIgKGxpc3QpOworICAgIGVsc2UKKyAgICAgIHJldHVybiBRbmls OworfQorCitMaXNwX09iamVjdAorbWNfcGxpc3RfZ2V0IChMaXNwX09iamVjdCBwbGlzdCwgTGlz cF9PYmplY3QgcHJvcCkKK3sKKyAgTGlzcF9PYmplY3QgdGFpbCwgaGFsZnRhaWw7CisgIC8qIGhh bGZ0YWlsIGlzIHVzZWQgdG8gZGV0ZWN0IGNpcmN1bGFyIGxpc3RzLiAgKi8KKyAgdGFpbCA9IGhh bGZ0YWlsID0gcGxpc3Q7CisgIHdoaWxlIChDT05TUCAodGFpbCkgJiYgQ09OU1AgKFhDRFIgKHRh aWwpKSkKKyAgICB7CisgICAgICBpZiAoRVEgKHByb3AsIFhDQVIgKHRhaWwpKSkKKyAgICAgICAg cmV0dXJuIFhDQVIgKFhDRFIgKHRhaWwpKTsKKyAgICAgIHRhaWwgPSBYQ0RSIChYQ0RSICh0YWls KSk7CisgICAgICBoYWxmdGFpbCA9IFhDRFIgKGhhbGZ0YWlsKTsKKyAgICAgIGlmIChFUSAodGFp bCwgaGFsZnRhaWwpKQorICAgICAgICBicmVhazsKKyAgICB9CisgIHJldHVybiBRbmlsOworfQor CisvKiBSRUdJT04gQkVHSU46ICBtY19yZWdpb25fbGltaXQgKDEpCisgICBSRUdJT04gRU5EOiAg bWNfcmVnaW9uX2xpbWl0ICgwKSAqLworcHRyZGlmZl90CittY19yZWdpb25fbGltaXQgKGJvb2wg YmVnaW5fcCkKK3sKKyAgaWYgKCFOSUxQIChWdHJhbnNpZW50X21hcmtfbW9kZSkKKyAgICAgICYm IE5JTFAgKFZtYXJrX2V2ZW5faWZfaW5hY3RpdmUpCisgICAgICAmJiBOSUxQIChCVkFSIChjdXJy ZW50X2J1ZmZlciwgbWFya19hY3RpdmUpKSkKKyAgICB4c2lnbmFsMCAoUW1hcmtfaW5hY3RpdmUp OworICBMaXNwX09iamVjdCBtYXJrZXIgPSBCVkFSIChjdXJyZW50X2J1ZmZlciwgbWFyayk7Cisg IGludCBtID0gKFhNQVJLRVIgKG1hcmtlciktPmJ1ZmZlcikKKyAgICAgICAgICA/IFhNQVJLRVIg KG1hcmtlciktPmNoYXJwb3MKKyAgICAgICAgICA6IC0xOworICByZXR1cm4gKG0gPT0gLTEpCisg ICAgICAgICAgID8gLTEKKyAgICAgICAgIDogKFBUIDwgbSkgPT0gYmVnaW5fcAorICAgICAgICAg ICA/IFBUCisgICAgICAgICA6IGNsaXBfdG9fYm91bmRzIChCRUdWLCBtLCBaVik7Cit9CisKKy8q IENoZWNrIHRoZSBwcmVzZW5jZSBvZiBhIGRpc3BsYXkgcHJvcGVydHkgYW5kIGNvbXB1dGUgaXRz IHdpZHRoLgorICAgSWYgYSBwcm9wZXJ0eSB3YXMgZm91bmQgYW5kIGl0cyB3aWR0aCB3YXMgZm91 bmQgYXMgd2VsbCwgcmV0dXJuCisgICBpdHMgd2lkdGggKD49IDApIGFuZCBzZXQgdGhlIHBvc2l0 aW9uIG9mIHRoZSBlbmQgb2YgdGhlIHByb3BlcnR5CisgICBpbiBFTkRQT1MuCisgICBPdGhlcndp c2UganVzdCByZXR1cm4gLTEuICovCitzdGF0aWMgaW50CittY19jaGVja19kaXNwbGF5X3dpZHRo IChwdHJkaWZmX3QgcG9zLCBwdHJkaWZmX3QgY29sLCBwdHJkaWZmX3QgKmVuZHBvcykKK3sKKyAg TGlzcF9PYmplY3QgdmFsLCBvdmVybGF5OworICBpZiAoQ09OU1AgKHZhbCA9IGdldF9jaGFyX3By b3BlcnR5X2FuZF9vdmVybGF5CisgICAgICAgICAgICAgIChtYWtlX2ZpeG51bSAocG9zKSwgUWRp c3BsYXksIFFuaWwsICZvdmVybGF5KSkKKyAgICAgICYmIEVRIChRc3BhY2UsIFhDQVIgKHZhbCkp KQorICAgIHsgLyogRklYTUU6IFVzZSBjYWxjX3BpeGVsX3dpZHRoX29yX2hlaWdodC4gKi8KKyAg ICAgIExpc3BfT2JqZWN0IHBsaXN0ID0gWENEUiAodmFsKSwgcHJvcDsKKyAgICAgIGludCB3aWR0 aCA9IC0xOworICAgICAgRU1BQ1NfSU5UIGFsaWduX3RvX21heCA9IChjb2wgPCBNT1NUX1BPU0lU SVZFX0ZJWE5VTSAtIElOVF9NQVgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g KEVNQUNTX0lOVCkgSU5UX01BWCArIGNvbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBNT1NUX1BPU0lUSVZFX0ZJWE5VTSk7CisgICAgICBpZiAoKHByb3AgPSBtY19wbGlzdF9n ZXQgKHBsaXN0LCBRQ3dpZHRoKSwgUkFOR0VEX0ZJWE5VTVAgKDAsIHByb3AsIElOVF9NQVgpKQor ICAgICAgICAgIHx8IChwcm9wID0gbWNfcGxpc3RfZ2V0IChwbGlzdCwgUUNyZWxhdGl2ZV93aWR0 aCksCisgICAgICAgICAgICAgIFJBTkdFRF9GSVhOVU1QICgwLCBwcm9wLCBJTlRfTUFYKSkpCisg ICAgICAgIHdpZHRoID0gWEZJWE5VTSAocHJvcCk7CisgICAgICAgIGVsc2UgaWYgKEZMT0FUUCAo cHJvcCkgJiYgMCA8PSBYRkxPQVRfREFUQSAocHJvcCkKKyAgICAgICAgICAgICAgICAgJiYgWEZM T0FUX0RBVEEgKHByb3ApIDw9IElOVF9NQVgpCisgICAgICAgICAgd2lkdGggPSAoaW50KShYRkxP QVRfREFUQSAocHJvcCkgKyAwLjUpOworICAgICAgICAgIGVsc2UgaWYgKChwcm9wID0gbWNfcGxp c3RfZ2V0IChwbGlzdCwgUUNhbGlnbl90byksCisgICAgICAgICAgICAgICAgICAgIFJBTkdFRF9G SVhOVU1QIChjb2wsIHByb3AsIGFsaWduX3RvX21heCkpKQorICAgICAgICAgICAgd2lkdGggPSBY RklYTlVNIChwcm9wKSAtIGNvbDsKKyAgICAgICAgICAgICAgZWxzZSBpZiAoRkxPQVRQIChwcm9w KSAmJiBjb2wgPD0gWEZMT0FUX0RBVEEgKHByb3ApCisgICAgICAgICAgICAgICAgICAgICAgICYm IChYRkxPQVRfREFUQSAocHJvcCkgPD0gYWxpZ25fdG9fbWF4KSkKKyAgICAgICAgICAgICAgICB3 aWR0aCA9IChpbnQpKFhGTE9BVF9EQVRBIChwcm9wKSArIDAuNSkgLSBjb2w7CisgICAgICBpZiAo d2lkdGggPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIHB0cmRpZmZfdCBzdGFydDsKKyAgICAg ICAgICBpZiAoT1ZFUkxBWVAgKG92ZXJsYXkpKQorICAgICAgICAgICAgKmVuZHBvcyA9IE9WRVJM QVlfUE9TSVRJT04gKE9WRVJMQVlfRU5EIChvdmVybGF5KSk7CisgICAgICAgICAgICBlbHNlCisg ICAgICAgICAgICAgIGdldF9wcm9wZXJ0eV9hbmRfcmFuZ2UgKHBvcywgUWRpc3BsYXksICZ2YWws ICZzdGFydCwgZW5kcG9zLCBRbmlsKTsKKyAgICAgICAgICAvKiBGb3IgOnJlbGF0aXZlLXdpZHRo LCB3ZSBuZWVkIHRvIG11bHRpcGx5IGJ5IHRoZSBjb2x1bW4KKyAgICAgICAgICAgICB3aWR0aCBv ZiB0aGUgY2hhcmFjdGVyIGF0IFBPUywgaWYgaXQgaXMgZ3JlYXRlciB0aGFuIDEuICovCisgICAg ICAgICAgaWYgKCFOSUxQIChtY19wbGlzdF9nZXQgKHBsaXN0LCBRQ3JlbGF0aX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SwgcHRyZGlmZl90IGNoYXJwb3MsIHB0cmRpZmZfdCBieXRlcG9zLAor ICAgICAgICAgICAgICAgICAgcHRyZGlmZl90IGxpbWl0LCBzdHJ1Y3Qgd2luZG93ICp3aW4sIHN0 cnVjdCBmYWNlICpmYWNlLAorICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3Qgc3RyaW5nKQor eworICBwdHJkaWZmX3QgY291bnQgPSBTUEVDUERMX0lOREVYICgpOworICBzdHJ1Y3QgZnJhbWUg KmYgPSBYRlJBTUUgKHdpbi0+ZnJhbWUpOworICBMaXNwX09iamVjdCBwb3MgPSBtYWtlX2ZpeG51 bSAoY2hhcnBvcyk7CisgIHB0cmRpZmZfdCB0bzsKKyAgcHRyZGlmZl90IHB0ID0gUFQsIHB0X2J5 dGUgPSBQVF9CWVRFOworICBMaXNwX09iamVjdCByZSwgZm9udF9vYmplY3QsIGxnc3RyaW5nOwor ICBwdHJkaWZmX3QgbGVuOworICByZWNvcmRfdW53aW5kX3NhdmVfbWF0Y2hfZGF0YSAoKTsKKyAg cmUgPSBBUkVGIChydWxlLCAwKTsKKyAgaWYgKE5JTFAgKHJlKSkKKyAgICBsZW4gPSAxOworICBl bHNlIGlmICghIFNUUklOR1AgKHJlKSkKKyAgICByZXR1cm4gdW5iaW5kX3RvIChjb3VudCwgUW5p bCk7CisgIGVsc2UgaWYgKChsZW4gPSBmYXN0X2xvb2tpbmdfYXQgKHJlLCBjaGFycG9zLCBieXRl cG9zLCBsaW1pdCwgLTEsIHN0cmluZykpCisgICAgICAgICAgID4gMCkKKyAgICB7CisgICAgICBp ZiAoTklMUCAoc3RyaW5nKSkKKyAgICAgICAgbGVuID0gQllURV9UT19DSEFSIChieXRlcG9zICsg bGVuKSAtIGNoYXJwb3M7CisgICAgICBlbHNlCisgICAgICAgIGxlbiA9IHN0cmluZ19ieXRlX3Rv X2NoYXIgKHN0cmluZywgYnl0ZXBvcyArIGxlbikgLSBjaGFycG9zOworICAgIH0KKyAgaWYgKGxl biA8PSAwKQorICAgIHJldHVybiB1bmJpbmRfdG8gKGNvdW50LCBRbmlsKTsKKyAgdG8gPSBsaW1p dCA9IGNoYXJwb3MgKyBsZW47CisjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCisgIGlmIChGUkFN RV9XSU5ET1dfUCAoZikpCisgICAgeworICAgICAgZm9udF9vYmplY3QgPSBmb250X3JhbmdlIChj aGFycG9zLCBieXRlcG9zLCAmdG8sIHdpbiwgZmFjZSwgc3RyaW5nKTsKKyAgICAgIGlmICghIEZP TlRfT0JKRUNUX1AgKGZvbnRfb2JqZWN0KQorICAgICAgICAgIHx8ICghIE5JTFAgKHJlKQorICAg ICAgICAgICAgICAmJiB0byA8IGxpbWl0CisgICAgICAgICAgICAgICYmIChmYXN0X2xvb2tpbmdf YXQgKHJlLCBjaGFycG9zLCBieXRlcG9zLCB0bywgLTEsIHN0cmluZykgPD0gMCkpKQorICAgICAg ICByZXR1cm4gdW5iaW5kX3RvIChjb3VudCwgUW5pbCk7CisgICAgfQorICBlbHNlCisjZW5kaWYg ICAgICAgIC8qIG5vdCBIQVZFX1dJTkRPV19TWVNURU0gKi8KKyAgICBmb250X29iamVjdCA9IHdp bi0+ZnJhbWU7CisgIGxnc3RyaW5nID0gRmNvbXBvc2l0aW9uX2dldF9nc3RyaW5nIChwb3MsIG1h a2VfZml4bnVtICh0byksIGZvbnRfb2JqZWN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgc3RyaW5nKTsKKyAgaWYgKE5JTFAgKExHU1RSSU5HX0lEIChsZ3N0cmluZykp KQorICAgIHsKKyAgICAgIC8qIFNhdmUgcG9pbnQgYXMgbWFya2VyIGJlZm9yZSBjYWxsaW5nIG91 dCB0byBsaXNwLiAgKi8KKyAgICAgIGlmIChOSUxQIChzdHJpbmcpKQorICAgICAgICByZWNvcmRf dW53aW5kX3Byb3RlY3QgKHJlc3RvcmVfcG9pbnRfdW53aW5kLAorICAgICAgICAgICAgIC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IGVuZCAtIHN0YXJ0 LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvcCwgc3RyaW5nKTsK KyAgICAgIGlmIChjbXBfaXQtPmlkIDwgMCkKKyAgICAgICAgZ290byBub19jb21wb3NpdGlvbjsK KyAgICAgIGNtcF9pdC0+bmNoYXJzID0gZW5kIC0gc3RhcnQ7CisgICAgICBjbXBfaXQtPm5nbHlw aHMgPSBjb21wb3NpdGlvbl90YWJsZVtjbXBfaXQtPmlkXS0+Z2x5cGhfbGVuOworICAgIH0KKyAg ZWxzZSBpZiAodykKKyAgICB7CisgICAgICBMaXNwX09iamVjdCBsZ3N0cmluZyA9IFFuaWw7Cisg ICAgICBMaXNwX09iamVjdCB2YWwsIGVsdDsKKyAgICAgIHB0cmRpZmZfdCBpOworICAgICAgdmFs ID0gQ0hBUl9UQUJMRV9SRUYgKFZjb21wb3NpdGlvbl9mdW5jdGlvbl90YWJsZSwgY21wX2l0LT5j aCk7CisgICAgICBmb3IgKGkgPSAwOyBpIDwgY21wX2l0LT5ydWxlX2lkeDsgaSsrLCB2YWwgPSBY Q0RSICh2YWwpKTsKKyAgICAgIGlmIChjaGFycG9zIDwgZW5kcG9zKQorICAgICAgICB7CisgICAg ICAgICAgZm9yICg7IENPTlNQICh2YWwpOyB2YWwgPSBYQ0RSICh2YWwpKQorICAgICAgICAgICAg eworICAgICAgICAgICAgICBlbHQgPSBYQ0FSICh2YWwpOworICAgICAgICAgICAgICBpZiAoISBW RUNUT1JQIChlbHQpIHx8IEFTSVpFIChlbHQpICE9IDMKKyAgICAgICAgICAgICAgICAgIHx8ICEg SU5URUdFUlAgKEFSRUYgKGVsdCwgMSkpKQorICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAg ICAgICAgICAgICBpZiAoWEZJWE5BVCAoQVJFRiAoZWx0LCAxKSkgIT0gY21wX2l0LT5sb29rYmFj aykKKyAgICAgICAgICAgICAgICBnb3RvIG5vX2NvbXBvc2l0aW9uOworICAgICAgICAgICAgICBs Z3N0cmluZyA9IG1jX2F1dG9jbXBfY2hhcnMgKGVsdCwgY2hhcnBvcywgYnl0ZXBvcywgZW5kcG9z LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcsIGZhY2UsIHN0cmlu Zyk7CisgICAgICAgICAgICAgIGlmIChjb21wb3NpdGlvbl9nc3RyaW5nX3AgKGxnc3RyaW5nKSkK KyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgbGdzdHJpbmcgPSBRbmlsOwor ICAgICAgICAgICAgICAvKiBDb21wb3NpdGlvbiBmYWlsZWQgcGVyaGFwcyBiZWNhdXNlIHRoZSBm b250IGRvZXNuJ3QKKyAgICAgICAgICAgICAgICAgc3VwcG9ydCBzdWZmaWNpZW50IHJhbmdlIG9m IGNoYXJhY3RlcnMuICBUcnkgdGhlCisgICAgICAgICAgICAgICAgIG90aGVyIGNvbXBvc2l0aW9u IHJ1bGVzIGlmIGFueS4gICovCisgICAgICAgICAgICB9CisgICAgICAgICAgY21wX2l0LT5yZXZl cnNlZF9wID0gMDsKKyAgICAgICAgfQorICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAg cHRyZGlmZl90IGNwb3MgPSBjaGFycG9zLCBicG9zID0gYnl0ZXBvczsKKyAgICAgICAgICBjbXBf aXQtPnJldmVyc2VkX3AgPSAxOworICAgICAgICAgIGVsdCA9IFhDQVIgKHZhbCk7CisgICAgICAg ICAgaWYgKGNtcF9pdC0+bG9va2JhY2sgPiAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAg ICBjcG9zID0gY2hhcnBvcyAtIGNtcF9pdC0+bG9va2JhY2s7CisgICAgICAgICAgICAgIGlmIChT VFJJTkdQIChzdHJpbmcpKQorICAgICAgICAgICAgICAgIGJwb3MgPSBzdHJpbmdfY2hhcl90b19i eXRlIChzdHJpbmcsIGNwb3MpOworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAg YnBvcyA9IENIQVJfVE9fQllURSAoY3Bvcyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgbGdz dHJpbmcgPSBtY19hdXRvY21wX2NoYXJzIChlbHQsIGNwb3MsIGJwb3MsIGNoYXJwb3MgKyAxLCB3 LCBmYWNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyaW5nKTsKKyAg ICAgICAgICBpZiAoISBjb21wb3NpdGlvbl9nc3RyaW5nX3AgKGxnc3RyaW5nKQorICAgICAgICAg ICAgICB8fCBjcG9zICsgTEdTVFJJTkdfQ0hBUl9MRU4gKGxnc3RyaW5nKSAtIDEgIT0gY2hhcnBv cykKKyAgICAgICAgICAgIC8qIENvbXBvc2l0aW9uIGZhaWxlZCBvciBkaWRuJ3QgY292ZXIgdGhl IGN1cnJlbnQKKyAgICAgICAgICAgICAgIGNoYXJhY3Rlci4gICovCisgICAgICAgICAgICBnb3Rv IG5vX2NvbXBvc2l0aW9uOworICAgICAgICB9CisgICAgICBpZiAoTklMUCAobGdzdHJpbmcpKQor ICAgICAgICBnb3RvIG5vX2NvbXBvc2l0aW9uOworICAgICAgaWYgKE5JTFAgKExHU1RSSU5HX0lE IChsZ3N0cmluZykpKQorICAgICAgICBsZ3N0cmluZyA9IGNvbXBvc2l0aW9uX2dzdHJpbmdfcHV0 X2NhY2hlIChsZ3N0cmluZywgLTEpOworICAgICAgY21wX2l0LT5pZCA9IFhGSVhOVU0gKExHU1RS SU5HX0lEIChsZ3N0cmluZykpOworICAgICAgZm9yIChpID0gMDsgaSA8IExHU1RSSU5HX0dMWVBI X0xFTiAobGdzdHJpbmcpOyBpKyspCisgICAgICAgIGlmIChOSUxQIChMR1NUUklOR19HTFlQSCAo bGdzdHJpbmcsIGkpKSkKKyAgICAgICAgICBicmVhazsKKyAgICAgIGNtcF9pdC0+bmdseXBocyA9 IGk7CisgICAgICBjbXBfaXQtPmZyb20gPSAwOworICAgICAgY21wX2l0LT50byA9IGk7CisgICAg fQorICBlbHNlCisg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bmV4dF9ib3VuZGFyeSwgZW5kLCBRbmlsKTsKKyAgICAgICAgICBp ZiAoc2NhbiAhPSBvbGRfc2NhbikKKyAgICAgICAgICAgIHNjYW5fYnl0ZSA9IENIQVJfVE9fQllU RSAoc2Nhbik7CisgICAgICAgICAgaWYgKHNjYW4gPj0gZW5kKQorICAgICAgICAgICAgZ290byBl bmRsb29wOworICAgICAgICB9CisgICAgICAvKiBUZXN0IHJlYWNoaW5nIHRoZSBnb2FsIGNvbHVt bi4gIFdlIGRvIHRoaXMgYWZ0ZXIgc2tpcHBpbmcKKyAgIGludmlzaWJsZSBjaGFyYWN0ZXJzLCBz byB0aGF0IHdlIHB1dCBwb2ludCBiZWZvcmUgdGhlCisgICBjaGFyYWN0ZXIgb24gd2hpY2ggdGhl IGN1cnNvciB3aWxsIGFwcGVhci4gKi8KKyAgICAgIGlmIChjb2wgPj0gZ29hbCkKKyAgICAgICAg YnJlYWs7CisgICAgICBwcmV2X2NvbCA9IGNvbDsKKyAgICAgIHsgLyogQ2hlY2sgZGlzcGxheSBw cm9wZXJ0eS4gKi8KKyAgICAgICAgcHRyZGlmZl90IGVuZHA7CisgICAgICAgIGludCB3aWR0aCA9 IG1jX2NoZWNrX2Rpc3BsYXlfd2lkdGggKHNjYW4sIGNvbCwgJmVuZHApOworICAgICAgICBpZiAo d2lkdGggPj0gMCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBjb2wgKz0gd2lkdGg7CisgICAg ICAgICAgICBpZiAoZW5kcCA+IHNjYW4pIC8qIEF2b2lkIGluZmluaXRlIGxvb3BzIHdpdGggMC13 aWR0aCBvdmVybGF5cy4gKi8KKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNjYW4g PSBlbmRwOworICAgICAgICAgICAgICAgIHNjYW5fYnl0ZSA9IENIQVJfVE9fQllURSAoc2Nhbik7 CisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICB9 CisgICAgICB9CisgICAgICAvKiBDaGVjayBjb21wb3NpdGlvbiBzZXF1ZW5jZS4gKi8KKyAgICAg IGlmIChjbXBfaXQuaWQgPj0gMAorICAgICAgICAgIHx8IChzY2FuID09IGNtcF9pdC5zdG9wX3Bv cworICAgICAgICAgICAgICAmJiBtY19jb21wb3NpdGlvbl9yZXNlYXRfaXQgKCZjbXBfaXQsIHNj YW4sIHNjYW5fYnl0ZSwgZW5kLCB3LCBOVUxMLCBRbmlsKSkpCisgICAgICAgIGNvbXBvc2l0aW9u X3VwZGF0ZV9pdCAoJmNtcF9pdCwgc2Nhbiwgc2Nhbl9ieXRlLCBRbmlsKTsKKyAgICAgIGlmIChj bXBfaXQuaWQgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIHNjYW4gKz0gY21wX2l0Lm5jaGFy czsKKyAgICAgICAgICBzY2FuX2J5dGUgKz0gY21wX2l0Lm5ieXRlczsKKyAgICAgICAgICBpZiAo c2NhbiA8PSBlbmQpCisgICAgICAgICAgICBjb2wgKz0gY21wX2l0LndpZHRoOworICAgICAgICAg IGlmIChjbXBfaXQudG8gPT0gY21wX2l0Lm5nbHlwaHMpCisgICAgICAgICAgICB7CisgICAgICAg ICAgICAgIGNtcF9pdC5pZCA9IC0xOworICAgICAgICAgICAgICBjb21wb3NpdGlvbl9jb21wdXRl X3N0b3BfcG9zICgmY21wX2l0LCBzY2FuLCBzY2FuX2J5dGUsIGVuZCwgUW5pbCk7CisgICAgICAg ICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGNtcF9pdC5mcm9tID0gY21w X2l0LnRvOworICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICB9CisgICAgICBjID0gRkVUQ0hf QllURSAoc2Nhbl9ieXRlKTsKKyAgICAgIC8qIFNlZSBpZiB0aGVyZSBpcyBhIGRpc3BsYXkgdGFi bGUgYW5kIGl0IHJlbGF0ZXMgdG8gdGhpcyBjaGFyYWN0ZXIuICovCisgICAgICBpZiAoZHAgIT0g MAorICAgICAgICAgICYmICEgKG11bHRpYnl0ZSAmJiBMRUFESU5HX0NPREVfUCAoYykpCisgICAg ICAgICAgJiYgVkVDVE9SUCAoRElTUF9DSEFSX1ZFQ1RPUiAoZHAsIGMpKSkKKyAgICAgICAgewor ICAgICAgICAgIExpc3BfT2JqZWN0IGNoYXJ2ZWM7CisgICAgICAgICAgcHRyZGlmZl90IGksIG47 CisgICAgICAgICAgLyogVGhpcyBjaGFyYWN0ZXIgaXMgZGlzcGxheWVkIHVzaW5nIGEgdmVjdG9y IG9mIGdseXBocy4KKyAgICAgICAgICAgICBVcGRhdGUgdGhlIGNvbHVtbi9wb3NpdGlvbiBiYXNl ZCBvbiB0aG9zZSBnbHlwaHMuICovCisgICAgICAgICAgY2hhcnZlYyA9IERJU1BfQ0hBUl9WRUNU T1IgKGRwLCBjKTsKKyAgICAgICAgICBuID0gQVNJWkUgKGNoYXJ2ZWMpOworICAgICAgICAgIGZv ciAoaSA9IDA7IGkgPCBuOyBpKyspCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIC8qIFRo aXMgc2hvdWxkIGJlIGhhbmRsZWQgdGhlIHNhbWUgYXMKKyAgICAgICAgICAgICAgbmV4dF9lbGVt ZW50X2Zyb21fZGlzcGxheV92ZWN0b3IgZG9lcyBpdC4gKi8KKyAgICAgICAgICAgICAgTGlzcF9P YmplY3QgZW50cnkgPSBBUkVGIChjaGFydmVjLCBpKTsKKyAgICAgICAgICAgICAgaWYgKEdMWVBI X0NPREVfUCAoZW50cnkpKQorICAgICAgICAgICAgICAgIGMgPSBHTFlQSF9DT0RFX0NIQVIgKGVu dHJ5KTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIGMgPSAnICc7CisgICAg ICAgICAgICAgIGlmIChjID09ICdcbicpCisgICAgICAgICAgICAgICAgZ290byBlbmRsb29wOwor ICAgICAgICAgICAgICBpZiAoYyA9PSAnXHInICYmIEVRIChCVkFSIChjdXJyZW50X2J1ZmZlciwg c2VsZWN0aXZlX2Rpc3BsYXkpLCBRdCkpCisgICAgICAgICAgICAgICAgZ290byBlbmRsb29wOwor ICAgICAgICAgICAgICBpZiAoYyA9PSAnXHQnKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAgIGNvbCArPSB0YWJfd2lkdGg7CisgICAgICAgICAgICAgICAgICBjb2wgPSBjb2wg LyB0YWJfd2lkdGggKiB0YWJfd2lkdGg7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICsrY29sOworICAgICAgICAgICAgfQorICAgICAg ICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICAvKiBUaGUgZGlzcGxh eSB0YWJsZSBkb2Vzbid0IGFmZmVjdCB0aGlzIGNoYXJhY3RlcjsKKyAgICAgICAgICAgICAgIGl0 IGRpc3BsYXlzIGFzIGl0c2VsZi4gKi8KKyAgICAgICAgICAgIGlmIChjID09ICdcbicpCisgICAg ICAgICAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgICAgIGlmIChjID09ICdccicgJiYgRVEg KEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBzZWxlY3RpdmVfZGlzcGxheSksIFF0KSkKKyAgICAgICAg ICAgICAgZ290byBlbmRsb29wOworICAgICAgICAgICAgaWYgKGMgPT0gJ1x0JykKKyAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgIGNvbCArPSB0YWJfd2lkdGg7CisgICAgICAgICAgICAg ICAgY29sID0gY29sIC8gdGFiX3dpZHRoICogdGFiX3dpZHRoOworICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICAgIGVsc2UgaWYgKG11bHRpYnl0ZSAmJiBMRUFESU5HX0NPREVfUCAoYykpCisg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgLyogU3RhcnQgb2YgbXVsdGktYnl0 ZSBmb3JtLiAqLworICAgICAgICAgICAgICAgICAgdW5zaWduZWQgY2hhciAqcHRyOworICAgICAg ICAgICAgICAgICAgaW50IGJ5dGVzLCB3aWR0aDsKKyAgICAgICAgICAgICAgICAgIHB0ciA9IEJZ VEVfUE9TX0FERFIgKHNjYW5fYnl0ZSk7CisgICAgICAgICAgICAgICAgICBNQ19NVUxUSUJZVEVf QllURVNfV0lEVEggKHB0ciwgZHAsIGJ5dGVzLCB3aWR0aCk7CisgICAgICAgICAgICAgICAgICAv KiBTdWJ0cmFjdCBvbmUgdG8gY29tcGVuc2F0ZSBmb3IgdGhlIGluY3JlbWVudAorICAgICAgICAg ICAgICAgICAgdGhhdCBpcyBnb2luZyB0byBoYXBwZW4gYmVsb3cuICovCisgICAgICAgICAgICAg ICAgICBzY2FuX2J5dGUgKz0gYnl0ZXMgLSAxOworICAgICAgICAgICAgICAgICAgY29sICs9IHdp ZHRoOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlmIChjdGxfYXJy b3cgJiYgKGMgPCAwNDAgfHwgYyA9PSAwMTc3KSkKKyAgICAgICAgICAgICAgICAgIGNvbCArPSAy OworICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoYyA8IDA0MCB8fCBjID49IDAxNzcpCisgICAg ICAgICAgICAgICAgICAgIGNvbCArPSA0OworICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAg ICAgICAgICAgICAgICAgICAgY29sKys7CisgICAgICAgICAgfQorICAgICAgc2NhbisrOworICAg ICAgc2Nhbl9ieXRlKys7CisgICAgfQorIGVuZGxvb3A6CisgIGxhc3Rfa25vd25fY29sdW1uID0g Y29sOworICBsYXN0X2tub3duX2NvbHVtbl9wb2ludCA9IHB0OworICBsYXN0X2tub3duX2NvbHVt bl9tb2RpZmllZCA9IE1PRElGRjsKKyAgaWYgKGdvYWxjb2wpCisgICAgKmdvYWxjb2wgPSBjb2w7 CisgIGlmIChlbmRwb3MpCisgICAgKmVuZHBvcyA9IHNjYW47CisgIGlmIChwcmV2Y29sKQorICAg ICpwcmV2Y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kFSIChjdXJyZW50X2J1ZmZlciwgY3Rs X2Fycm93KSk7CisgIHN0cnVjdCBMaXNwX0NoYXJfVGFibGUgKmRwID0gYnVmZmVyX2Rpc3BsYXlf dGFibGUgKCk7CisgIGlmIChwdCA9PSBsYXN0X2tub3duX2NvbHVtbl9wb2ludAorICAgICAgJiYg TU9ESUZGID09IGxhc3Rfa25vd25fY29sdW1uX21vZGlmaWVkKQorICAgIHsKKyAgICAgIGlmIChv bGRfYnVmZmVyKQorICAgICAgICBzZXRfYnVmZmVyX2ludGVybmFsIChvbGRfYnVmZmVyKTsKKyAg ICAgIHJldHVybiBsYXN0X2tub3duX2NvbHVtbjsKKyAgICB9CisgIC8qIElmIHRoZSBidWZmZXIg aGFzIG92ZXJsYXlzLCB0ZXh0IHByb3BlcnRpZXMsCisgICAgIG9yIG11bHRpYnl0ZSBjaGFyYWN0 ZXJzLCB1c2UgYSBtb3JlIGdlbmVyYWwgYWxnb3JpdGhtLiAqLworICBpZiAoYnVmZmVyX2ludGVy dmFscyAoY3VycmVudF9idWZmZXIpCisgICAgICB8fCBidWZmZXJfaGFzX292ZXJsYXlzICgpCisg ICAgICB8fCBaICE9IFpfQllURSkKKyAgICB7CisgICAgICBFTUFDU19JTlQgY29sID0gTU9TVF9Q T1NJVElWRV9GSVhOVU07CisgICAgICBtY19zY2FuX2Zvcl9jb2x1bW4gKCZwdCwgJmNvbCwgTlVM TCwgcHQpOworICAgICAgeworICAgICAgICBpZiAob2xkX2J1ZmZlcikKKyAgICAgICAgICBzZXRf YnVmZmVyX2ludGVybmFsIChvbGRfYnVmZmVyKTsKKyAgICAgICAgcmV0dXJuIGNvbDsKKyAgICAg IH0KKyAgICB9CisgIC8qIFNjYW4gYmFja3dhcmRzIGZyb20gcG9pbnQgdG8gdGhlIHByZXZpb3Vz IG5ld2xpbmUsCisgICAgIGNvdW50aW5nIHdpZHRoLiAgVGFiIGNoYXJhY3RlcnMgYXJlIHRoZSBv bmx5IGNvbXBsaWNhdGVkIGNhc2UuICovCisgIC8qIE1ha2UgYSBwb2ludGVyIGZvciBkZWNyZW1l bnRpbmcgdGhyb3VnaCB0aGUgY2hhcnMgYmVmb3JlIHBvaW50LiAqLworICBwdHIgPSBCWVRFX1BP U19BRERSIChDSEFSX1RPX0JZVEUgKHB0KSAtIDEpICsgMTsKKyAgLyogTWFrZSBhIHBvaW50ZXIg dG8gd2hlcmUgY29uc2VjdXRpdmUgY2hhcnMgbGVhdmUgb2ZmLAorICAgICBnb2luZyBiYWNrd2Fy ZHMgZnJvbSBwb2ludC4gKi8KKyAgaWYgKHB0ID09IEJFR1YpCisgICAgc3RvcCA9IHB0cjsKKyAg ICBlbHNlIGlmIChwdCA8PSBHUFQgfHwgQkVHViA+IEdQVCkKKyAgICAgIHN0b3AgPSBCRUdWX0FE RFI7CisgICAgICBlbHNlCisgICAgICAgIHN0b3AgPSBHQVBfRU5EX0FERFI7CisgIGNvbCA9IDAs IHRhYl9zZWVuID0gMCwgcG9zdF90YWIgPSAwOworICB3aGlsZSAoMSkKKyAgICB7CisgICAgICBw dHJkaWZmX3QgaSwgbjsKKyAgICAgIExpc3BfT2JqZWN0IGNoYXJ2ZWM7CisgICAgICBpZiAocHRy ID09IHN0b3ApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBXZSBzdG9wcGVkIGVpdGhlciBmb3Ig dGhlIGJlZ2lubmluZyBvZiB0aGUgYnVmZmVyCisgICAgICAgICAgICAgb3IgZm9yIHRoZSBnYXAu ICovCisgICAgICAgICAgaWYgKHB0ciA9PSBCRUdWX0FERFIpCisgICAgICAgICAgICBicmVhazsK KyAgICAgICAgICAvKiBJdCB3YXMgdGhlIGdhcC4gIEp1bXAgYmFjayBvdmVyIGl0LiAqLworICAg ICAgICAgIHN0b3AgPSBCRUdWX0FERFI7CisgICAgICAgICAgcHRyID0gR1BUX0FERFI7CisgICAg ICAgICAgLyogQ2hlY2sgd2hldGhlciB0aGF0IGJyaW5ncyB1cyB0byBiZWdpbm5pbmcgb2YgYnVm ZmVyLiAqLworICAgICAgICAgIGlmIChCRUdWID49IEdQVCkKKyAgICAgICAgICAgIGJyZWFrOwor ICAgICAgICB9CisgICAgICBjID0gKi0tcHRyOworICAgICAgaWYgKGRwICYmIFZFQ1RPUlAgKERJ U1BfQ0hBUl9WRUNUT1IgKGRwLCBjKSkpCisgICAgICAgIHsKKyAgICAgICAgICBjaGFydmVjID0g RElTUF9DSEFSX1ZFQ1RPUiAoZHAsIGMpOworICAgICAgICAgIG4gPSBBU0laRSAoY2hhcnZlYyk7 CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGNoYXJ2 ZWMgPSBRbmlsOworICAgICAgICAgICAgbiA9IDE7CisgICAgICAgICAgfQorICAgICAgZm9yIChp ID0gbiAtIDE7IGkgPj0gMDsgLS1pKQorICAgICAgICB7CisgICAgICAgICAgaWYgKFZFQ1RPUlAg KGNoYXJ2ZWMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBUaGlzIHNob3VsZCBi ZSBoYW5kbGVkIHRoZSBzYW1lIGFzCisgICAgICAgICAgIG5leHRfZWxlbWVudF9mcm9tX2Rpc3Bs YXlfdmVjdG9yIGRvZXMgaXQuICovCisgICAgICAgICAgICAgIExpc3BfT2JqZWN0IGVudHJ5ID0g QVJFRiAoY2hhcnZlYywgaSk7CisgICAgICAgICAgICAgIGlmIChHTFlQSF9DT0RFX1AgKGVudHJ5 KSkKKyAgICAgICAgICAgICAgICBjID0gR0xZUEhfQ09ERV9DSEFSIChlbnRyeSk7CisgICAgICAg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgYyA9ICcgJzsKKyAgICAgICAgICAgIH0K KyAgICAgICAgICBpZiAoYyA+PSAwNDAgJiYgYyA8IDAxNzcpCisgICAgICAgICAgICBjb2wrKzsK KyAgICAgICAgICAgIGVsc2UgaWYgKGMgPT0gJ1xuJworICAgICAgICAgICAgICAgICAgICAgfHwg KGMgPT0gJ1xyJworICAgICAgICAgICAgICAgICAgICAgICAgICYmIEVRIChCVkFSIChjdXJyZW50 X2J1ZmZlciwgc2VsZWN0aXZlX2Rpc3BsYXkpLCBRdCkpKQorICAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgcHRyKys7CisgICAgICAgICAgICAgICAgZ290byBzdGFydF9vZl9saW5lX2Zv dW5kOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UgaWYgKGMgPT0gJ1x0JykK KyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBpZiAodGFiX3NlZW4pCisgICAg ICAgICAgICAgICAgICAgIGNvbCA9ICgoY29sICsgdGFiX3dpZHRoKSAvIHRhYl93aWR0aCkgKiB0 YWJfd2lkdGg7CisgICAgICAgICAgICAgICAgICBwb3N0X3RhYiArPSBjb2w7CisgICAgICAgICAg ICAgICAgICBjb2wgPSAwOworICAgICAgICAgICAgICAgICAgdGFiX3NlZW4gPSAxOworICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlmIChWRUNUT1JQIChjaGFydmVjKSkK KyAgICAgICAgICAgICAgICAgIC8qIFdpdGggYSBkaXNwbGF5IHRhYmxlIGVudHJ5LCBDIGlzIGRp c3BsYXllZCBhcyBpcywgYW5kCisgICAgICAgICAgICAgICAgICAgICBub3QgZGlzcGxheWVkIGFz IFxOTk4gb3IgYXMgXk4uICBJZiBDIGlzIGEgc2luZ2xlLWJ5dGUKKyAgICAgICAgICAgICAgICAg ICAgIGNoYXJhY3RlciwgaXQgdGFrZXMgb25lIGNvbHVtbi4gIElmIEMgaXMgbXVsdGktYnl0ZSBp bgorICAgICAgICAgICAgICAgICAgICAgYSB1bmlieXRlIGJ1ZmZlciwgaXQncyB0cmFuc2xhdGVk IHRvIHVuaWJ5dGUsIHNvIGl0CisgICAgICAgICAgICAgICAgICAgICBhbHNvIHRha2VzIG9uZSBj b2x1bW4uICovCisgICAgICAgICAgICAgICAgICArK2NvbDsKKy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bCkpOworfQorCisvKiBVU0FHRTogIGZwcmludGYgKHN0ZGVyciwgIldJTkRP VyAoJXMpIiwgbWNfd2luZG93ICh3KSk7ICovCitjaGFyICoKK21jX3dpbmRvdyAoc3RydWN0IHdp bmRvdyAqdykKK3sKKyAgTGlzcF9PYmplY3Qgd2luZG93OworICBYU0VUV0lORE9XICh3aW5kb3cs IHcpOworICByZXR1cm4gU1NEQVRBIChGcHJpbjFfdG9fc3RyaW5nICh3aW5kb3csIFFuaWwpKTsK K30KKworLyogVVNBR0U6ICBmcHJpbnRmIChzdGRlcnIsICJDSEFSQUNURVIgKCVzKSIsIG1jX2No YXJfdG9fc3RyaW5nIChnbHlwaC0+dS5jaCkpOyAqLworY2hhciAqCittY19jaGFyX3RvX3N0cmlu ZyAoaW50IGFyZykKK3sKKyAgTGlzcF9PYmplY3QgY2hhcmFjdGVyID0gKDAgPD0gYXJnICYmIGFy ZyA8PSBNQVhfQ0hBUikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgID8gRmNoYXJfdG9fc3Ry aW5nIChtYWtlX2ZpeG51bSAoYXJnKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIDogUW5p bDsKKyAgY2hhciAqIHJlc3VsdCA9ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAg ICAgICYmIGFyZyA9PSA5KQorICAgICAgICAgICAgICAgICAgICA/ICJcXHQiCisgICAgICAgICAg ICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJn ID09IDEwKQorICAgICAgICAgICAgICAgICAgICA/ICJcXG4iCisgICAgICAgICAgICAgICAgICA6 ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnID09IDMyKQor ICAgICAgICAgICAgICAgICAgICA/ICJcXHMiCisgICAgICAgICAgICAgICAgICA6ICghTklMUCAo Y2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnICE9IDkKKyAgICAgICAgICAg ICAgICAgICAgICYmIGFyZyAhPSAxMAorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnICE9IDMy KQorICAgICAgICAgICAgICAgICAgICA/IFNTREFUQSAoY2hhcmFjdGVyKQorICAgICAgICAgICAg ICAgICAgOiAiXFw/IjsKKyAgcmV0dXJuIHJlc3VsdDsKK30KKworaW50CittY19saXNwX3RvX2N1 cnNvcl90eXBlIChMaXNwX09iamVjdCBhcmcpCit7CisgIGNoYXIgKnN0cjsKKyAgaWYgKFhUWVBF IChhcmcpID09IExpc3BfU3RyaW5nKQorICAgIHN0ciA9IFNTREFUQSAoYXJnKTsKKyAgICBlbHNl IGlmIChYVFlQRSAoYXJnKSA9PSBMaXNwX1N5bWJvbCkKKyAgICAgIHN0ciA9IFNTREFUQSAoU1lN Qk9MX05BTUUgKGFyZykpOworICAgICAgZWxzZSByZXR1cm4gLTE7CisgIGlmICghc3RyY21wIChz dHIsICJubyIpKQorICAgIHJldHVybiBNQ19OT19DVVJTT1I7CisgIGlmICghc3RyY21wIChzdHIs ICJtYy1sZWZ0LWZyaW5nZS1iaXRtYXAiKSkKKyAgICByZXR1cm4gTUNfTEVGVF9GUklOR0VfQklU TUFQOworICBpZiAoIXN0cmNtcCAoc3RyLCAibWMtcmlnaHQtZnJpbmdlLWJpdG1hcCIpKQorICAg IHJldHVybiBNQ19SSUdIVF9GUklOR0VfQklUTUFQOworICBpZiAoIXN0cmNtcCAoc3RyLCAiYm94 IikpCisgICAgcmV0dXJuIE1DX0ZJTExFRF9CT1g7CisgIGlmICghc3RyY21wIChzdHIsICJmcmFt ZWQiKSkKKyAgICByZXR1cm4gTUNfRlJBTUVEX0JPWDsKKyAgaWYgKCFzdHJjbXAgKHN0ciwgImhv bGxvdyIpKQorICAgIHJldHVybiBNQ19IT0xMT1dfQk9YOworICBpZiAoIXN0cmNtcCAoc3RyLCAi YmFyIikpCisgICAgcmV0dXJuIE1DX0JBUjsKKyAgaWYgKCFzd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iU0VUX0NVUlNPUl9P TkUiOworICAgICAgY2FzZSBTRVRfQ1VSU09SX1RXTzogcmV0dXJuICJTRVRfQ1VSU09SX1RXTyI7 CisgICAgICBkZWZhdWx0OgorICAgICAgcmV0dXJuICJVTktOT1dOIjsKKyAgICB9Cit9CisKKy8q IFVTQUdFOiAgZnByaW50ZiAoc3RkZXJyLCAiRlJPTV9XSEVSRSAoJXMpIiwgbWNfZHJhd19yb3df dHlwZV90b19zdHJpbmcgKGFyZykpOyAqLworY2hhciAqCittY19yZWRyYXdfcm93X3R5cGVfdG9f c3RyaW5nIChlbnVtIG1jX3JlZHJhd19yb3dfdHlwZSBmcm9tX3doZXJlKQoreworICBzd2l0Y2gg KGZyb21fd2hlcmUpCisgICAgeworICAgICAgY2FzZSBVUERBVEVfV0lORE9XX19SRURSQVdfT1ZF UkxBUFBFRF9ST1dTOiByZXR1cm4gIlVQREFURV9XSU5ET1dfX1JFRFJBV19PVkVSTEFQUEVEX1JP V1MiOworICAgICAgY2FzZSBHVUlfSU5TRVJUX0dMWVBIUzogcmV0dXJuICJHVUlfSU5TRVJUX0dM WVBIUyI7CisgICAgICBjYXNlIEdVSV9GSVhfT1ZFUkxBUFBJTkdfQVJFQTogcmV0dXJuICJHVUlf RklYX09WRVJMQVBQSU5HX0FSRUEiOworICAgICAgY2FzZSBEUkFXX1JPV19XSVRIX01PVVNFX0ZB Q0U6IHJldHVybiAiRFJBV19ST1dfV0lUSF9NT1VTRV9GQUNFIjsKKyAgICAgIGNhc2UgRVhQT1NF X0FSRUFfT05FOiByZXR1cm4gIkVYUE9TRV9BUkVBX09ORSI7CisgICAgICBjYXNlIEVYUE9TRV9B UkVBX1RXTzogcmV0dXJuICJFWFBPU0VfQVJFQV9UV08iOworICAgICAgY2FzZSBFWFBPU0VfTElO RTogcmV0dXJuICJFWFBPU0VfTElORSI7CisgICAgICBkZWZhdWx0OgorICAgICAgcmV0dXJuICJV TktOT1dOIjsKKyAgICB9Cit9CisKK3ZvaWQKK21jX2NhY2hlX2luc3BlY3RvciAoc3RydWN0IHdp bmRvdyAqdywgc3RydWN0IG1jX21hdHJpeCBtYXRyaXgpCit7CisgIGludCB2cG9zX2FsbG9jYXRl ZCA9IHctPm1jX21hdHJpeC52cG9zX2FsbG9jYXRlZDsKKyAgaW50IHZwb3NfdXNlZCA9IHctPm1j X21hdHJpeC52cG9zX3VzZWQ7CisgIGZwcmludGYgKHN0ZGVyciwgIiVzOiAgbWF0cml4LnZwb3Nf YWxsb2NhdGVkICglZCkgfCBtYXRyaXgudnBvc191c2VkICglZClcbiIsCisgICAgICAgICAgICAg ICAgICAgbWNfd2luZG93ICh3KSwgdnBvc19hbGxvY2F0ZWQsIHZwb3NfdXNlZCk7CisgIGZvciAo ZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICBjYWNoZV90 eXBlIDwgTk9fQ0FDSEU7CisgICAgICAgKytjYWNoZV90eXBlKQorICAgIHsKKyAgICAgIGludCBj dXJzb3JzX3VzZWQgPSB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5cGVdOworICAg ICAgZnByaW50ZiAoc3RkZXJyLCAiICBtYXRyaXguY3Vyc29yc191c2VkWyVzXSAoJWQpXG4iLAor ICAgICAgICAgICAgICAgICAgICAgICBtY19jYWNoZV90eXBlX3RvX3N0cmluZyAoY2FjaGVfdHlw ZSksIGN1cnNvcnNfdXNlZCk7CisgICAgfQorICBmb3IgKGludCB2bnRoID0gMDsKKyAgICAgICB2 bnRoIDwgdy0+bWNfbWF0cml4LnZwb3NfdXNlZDsKKyAgICAgICArK3ZudGgpCisgICAgeworICAg ICAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOworICAgICAg ICAgICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7CisgICAgICAgICAgICsrY2FjaGVfdHlwZSkKKyAg ICAgICAgeworICAgICAgICAgIGludCBjYWNoZV9hbGxvY2F0ZWQgPSB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV07CisgICAgICAgICAgaW50IGNhY2hl X3VzZWQgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdOwor ICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgICB2bnRoICglZCkgfCBjYWNoZV9hbGxvY2F0 ZWRbJXNdICglZCkgfCBjYWNoZV91c2VkWyVzXSAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgdm50aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2NhY2hlX3R5cGVf dG9fc3RyaW5nIChjYWNoZV90eXBlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhY2hl X2FsbG9jYXRlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2NhY2hlX3R5cGVfdG9f c3RyaW5nIChjYWNoZV90eXBlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhY2hlX3Vz ZWQpOworICAgICAgICB9CisgICAgfQorfQorCit2b2lkCittY19zZXRfbHNsX2JnIChzdHJ1Y3Qg d2luZG93ICp3LCBlbnVtIGZhY2VfaWQgZmFjZV9pZCwgc3RydWN0IG1jX1JHQiAqbHNsKQorewor ICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgc3RydWN0IGZhY2UgKmZh Y2U7CisgIGlmICghTklMUCAoVmZhY2VfcmVtYXBwaW5nX2FsaXN0KQorICAgICAgJiYgKGZhY2Vf aWQgPT0gREVGQVVMVF9GQUNFX0lEIC8qIFFkZWZhdWx0ICovCisgICAgICAgICAgfHwgZmFjZV9p ZCA9PSBNT0RFX0xJTkVfRkFDRV9JRCAvKiBRbW9kZV9saW5lICovCisgICAgICAgICAgfHwgZmFj ZV9pZCA9P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NhbF9ib3JkZXIgKi8KKyAgICAgICAgICB8fCBmYWNl X2lkID09IElOVEVSTkFMX0JPUkRFUl9GQUNFX0lEKSkgLyogUWludGVybmFsX2JvcmRlciAqLwor ICAgIGZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGxvb2t1cF9iYXNpY19mYWNlICh3LCBmLCBmYWNl X2lkKSk7CisgICAgZWxzZQorICAgICAgZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwgZmFjZV9pZCk7 CisgIExpc3BfT2JqZWN0IGNvbG9yID0gKGZhY2UgIT0gTlVMTCkKKyAgICAgICAgICAgICAgICAg ICAgICA/IGZhY2UtPmxmYWNlW0xGQUNFX0JBQ0tHUk9VTkRfSU5ERVhdCisgICAgICAgICAgICAg ICAgICAgICAgOiBidWlsZF9zdHJpbmcgKCJPcmFuZ2VSZWQiKTsKKyAgbWNfeHdfY29sb3JfdmFs dWVzICh3LCBjb2xvciwgbHNsKTsKK30KKwordm9pZAorbWNfc2V0X2Vzc2VudGlhbHMgKHN0cnVj dCB3aW5kb3cgKncsIHN0cnVjdCBtY19lc3NlbnRpYWxzICplc3NlbnRpYWxzKQoreworICBpZiAo IUJVRkZFUlAgKHctPmNvbnRlbnRzKSkKKyAgICByZXR1cm47CisgIGlmIChOSUxQIChCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJV RkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhC VUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpKQorICAgIHJldHVybjsKKyAgc3RydWN0 IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIGVzc2VudGlhbHMtPmFjdGl2ZV9wID0g KHcgPT0gWFdJTkRPVyAoZi0+c2VsZWN0ZWRfd2luZG93KQorICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBmID09IEZSQU1FX0RJU1BMQVlfSU5GTyAoZiktPmhpZ2hsaWdodF9mcmFtZSk7Cisg IHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSICh3LT5jb250ZW50cyk7CisgIHN0cnVjdCBidWZm ZXIgKm9sZF9idWZmZXIgPSBOVUxMOworICBwdHJkaWZmX3Qgb3BvaW50ID0gKHcgPT0gWFdJTkRP VyAoc2VsZWN0ZWRfd2luZG93KSkKKyAgICAgICAgICAgICAgICAgICAgID8gUFQKKyAgICAgICAg ICAgICAgICAgICAgIDogWEZJWE5VTSAoRm1hcmtlcl9wb3NpdGlvbiAody0+cG9pbnRtKSk7Cisg IHB0cmRpZmZfdCBjdXJyZW50X2NvbCA9IG1jX2N1cnJlbnRfY29sdW1uICh3LCBvcG9pbnQpOwor ICBpbnQgZnJhbWVfY2hhcl93aWR0aCA9IEZSQU1FX0NPTFVNTl9XSURUSCAoZik7CisgIGJvb2wg ZmlsbF9jb2x1bW5fcCA9ICFOSUxQIChCVkFSIChiLCBmaWxsX2NvbHVtbikpOworICBpbnQgZmls bF9jb2wgPSBYRklYTlVNIChCVkFSIChiLCBmaWxsX2NvbHVtbikpOworICBpbnQgaHNjbF94ID0g dy0+aHNjcm9sbCAqIGZyYW1lX2NoYXJfd2lkdGg7CisgIGlmIChiICE9IGN1cnJlbnRfYnVmZmVy KQorICAgIHsKKyAgICAgIG9sZF9idWZmZXIgPSBjdXJyZW50X2J1ZmZlcjsKKyAgICAgIHNldF9i dWZmZXJfaW50ZXJuYWwgKGIpOworICAgIH0KKyAgZXNzZW50aWFscy0+enYgPSBaVjsKKyAgZXNz ZW50aWFscy0+enZfYnl0ZSA9IFpWX0JZVEU7CisgIGVzc2VudGlhbHMtPmZjX3ggPSAoZmlsbF9j b2x1bW5fcAorICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChWZGlzcGxheV9saW5lX251 bWJlcnMpKQorICAgICAgICAgICAgICAgICAgICAgICA/IChmaWxsX2NvbCAqIGZyYW1lX2NoYXJf d2lkdGgpICsgdy0+bWMubG51bV9waXhlbF93aWR0aCAtIGhzY2xfeAorICAgICAgICAgICAgICAg ICAgICAgOiAoZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgTklMUCAo VmRpc3BsYXlfbGluZV9udW1iZXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgPyAoZmlsbF9j b2wgKiBmcmFtZV9jaGFyX3dpZHRoKSAtIGhzY2xfeAorICAgICAgICAgICAgICAgICAgICAgOiAw OworICBpZiAob2xkX2J1ZmZlcikKKyAgICBzZXRfYnVmZmVyX2ludGVybmFsIChvbGRfYnVmZmVy KTsKKyAgZW51bSBmYWNlX2lkIGZpbGxfY29sdW1uX3ByZV96dl9mYWNlX2lkID0KKyAgICAoIWVz c2VudGlhbHMtPmFjdGl2ZV9wCisgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIGZjX2luYWN0aXZlX3dpbmRvd3MpKQorICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICAgID8gbG9va3VwX25hbWVkX2ZhY2Ug KHcsIGYsIGludGVybiAoImZjLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpCisgICAgOiAo IWVzc2VudGlhbHMtPmFjdGl2ZV9wCisgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgZmNfaW5hY3RpdmVfd2luZG93cykpCisgICAgICAgJiYgIU5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgJiYgIU5JTFAgKEJW QVIgKGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAmJiB3LT5jdXJzb3IueCA9PSBlc3Nl bnRpYWxzLT5mY194KQorICAgICAgPyBsb29rdXBfbmFtZWRfZm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JuICgiZmMtaW5hY3RpdmUtYXQtenYtZmFjZSIpLCB0cnVl KQorICAgIDogKCFlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAgICAgICYmICFOSUxQIChCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIGZjX2luYWN0aXZlX3dpbmRvd3MpKQorICAgICAgICYmICFO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICYm ICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgJiYgdy0+Y3Vyc29y LnggPT0gZXNzZW50aWFscy0+ZmNfeCkKKyAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYs IGludGVybiAoImZjLW9wb2ludC1pbmFjdGl2ZS1hdC16di1mYWNlIiksIHRydWUpCisgICAgOiAo ZXNzZW50aWFscy0+YWN0aXZlX3AKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVy dGljYWxfcnVsZXIpKQorICAgICAgICYmIHctPmN1cnNvci54ID09IGVzc2VudGlhbHMtPmZjX3gp CisgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCJmYy1vcG9pbnQtYXQt enYtZmFjZSIpLCB0cnVlKQorICAgIDogKCFlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAgICAgICYm ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX2luYWN0aXZlX3dpbmRvd3Mp KQorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFp cnMpKQorICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAg ICAgJiYgdy0+Y3Vyc29yLn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Y194KQor ICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiZmMtb3BvaW50LXBvc3Qt enYtZmFjZSIpLCB0cnVlKQorICAgIDogKCFlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAgICAgICYm ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX2luYWN0aXZlX3dpbmRvd3Mp KQorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFp cnMpKQorICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAg ICAgJiYgdy0+Y3Vyc29yLnggIT0gZXNzZW50aWFscy0+ZmNfeCkKKyAgICAgID8gbG9va3VwX25h bWVkX2ZhY2UgKHcsIGYsIGludGVybiAoImZjLWluYWN0aXZlLXBvc3QtenYtZmFjZSIpLCB0cnVl KQorICAgIDogKGVzc2VudGlhbHMtPmFjdGl2ZV9wCisgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhC VUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgJiYgIU5JTFAgKEJWQVIg KGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAmJiB3LT5jdXJzb3IueCAhPSBlc3NlbnRp YWxzLT5mY194KQorICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiZmMt cG9zdC16di1mYWNlIiksIHRydWUpCisgICAgOiBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50 ZXJuICgiZmMtcG9zdC16di1mYWNlIiksIHRydWUpOworICBzdHJ1Y3QgZmFjZSAqZmlsbF9jb2x1 bW5fcG9zdF96dl9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBmaWxsX2NvbHVtbl9wb3N0X3p2X2Zh Y2VfaWQpOworICBMaXNwX09iamVjdCBmaWxsX2NvbHVtb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fWlYpCisgICAgICAgICAgfHwgKGZpbGxfY29sdW1uX3AKKyAgICAgICAgICAgICAgJiYg Y3VycmVudF9jb2wgJSAyICE9IDAKKyAgICAgICAgICAgICAgJiYgY3VycmVudF9jb2wgPD0gZmls bF9jb2wKKyAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVikpCisgICAgICAg IHsKKyAgICAgICAgICBsc2xfZmctPnJlZCA9IG9kZF9mb3JlZ3JvdW5kLnJlZDsKKyAgICAgICAg ICBsc2xfZmctPmdyZWVuID0gb2RkX2ZvcmVncm91bmQuZ3JlZW47CisgICAgICAgICAgbHNsX2Zn LT5ibHVlID0gb2RkX2ZvcmVncm91bmQuYmx1ZTsKKyAgICAgICAgfQorICAgICAgICAvKiB5ZWxs b3cgKi8KKyAgICAgICAgZWxzZSBpZiAoKCFmaWxsX2NvbHVtbl9wCisgICAgICAgICAgICAgICAg ICAmJiBjdXJyZW50X2NvbCAlIDIgPT0gMAorICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0 aW9uID09IFBSRV9aVikKKyAgICAgICAgICAgICAgICAgfHwgKGZpbGxfY29sdW1uX3AKKyAgICAg ICAgICAgICAgICAgICAgICYmIGN1cnJlbnRfY29sICUgMiA9PSAwCisgICAgICAgICAgICAgICAg ICAgICAmJiBjdXJyZW50X2NvbCA8PSBmaWxsX2NvbAorICAgICAgICAgICAgICAgICAgICAgJiYg cm93X3Bvc2l0aW9uID09IFBSRV9aVikpCisgICAgICAgICAgeworICAgICAgICAgICAgbHNsX2Zn LT5yZWQgPSBldmVuX2ZvcmVncm91bmQucmVkOworICAgICAgICAgICAgbHNsX2ZnLT5ncmVlbiA9 IGV2ZW5fZm9yZWdyb3VuZC5ncmVlbjsKKyAgICAgICAgICAgIGxzbF9mZy0+Ymx1ZSA9IGV2ZW5f Zm9yZWdyb3VuZC5ibHVlOworICAgICAgICAgIH0KKyAgICAgICAgICAvKiBncmVlbiAqLworICAg ICAgICAgIGVsc2UgaWYgKGZpbGxfY29sdW1uX3AKKyAgICAgICAgICAgICAgICAgICAmJiBjdXJy ZW50X2NvbCA+IGZpbGxfY29sCisgICAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09 IFBSRV9aVikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbHNsX2ZnLT5yZWQgPSBiZXlv bmRfZmlsbF9mb3JlZ3JvdW5kLnJlZDsKKyAgICAgICAgICAgICAgbHNsX2ZnLT5ncmVlbiA9IGJl eW9uZF9maWxsX2ZvcmVncm91bmQuZ3JlZW47CisgICAgICAgICAgICAgIGxzbF9mZy0+Ymx1ZSA9 IGJleW9uZF9maWxsX2ZvcmVncm91bmQuYmx1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAg IGVsc2UgaWYgKHJvd19wb3NpdGlvbiA9PSBBVF9aVikKKyAgICAgICAgICAgICAgeworICAgICAg ICAgICAgICAgIGxzbF9mZy0+cmVkID0gZXNzZW50aWFscy5zcF9mZy5yZWQ7CisgICAgICAgICAg ICAgICAgbHNsX2ZnLT5ncmVlbiA9IGVzc2VudGlhbHMuc3BfZmcuZ3JlZW47CisgICAgICAgICAg ICAgICAgbHNsX2ZnLT5ibHVlID0gZXNzZW50aWFscy5zcF9mZy5ibHVlOworICAgICAgICAgICAg ICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBIT1JJWk9OVEFMX1JVTEVSOgorICAg IHsKKyAgICAgIGlmIChnbHlwaCAhPSBOVUxMCisgICAgICAgICAgJiYgZ2x5cGgtPnUuY2ggPT0g OTUKKyAgICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19IQkFSKQorICAgICAgICB7CisgICAg ICAgICAgbHNsX2ZnLT5yZWQgPSBlc3NlbnRpYWxzLnNwX2ZnLnJlZDsKKyAgICAgICAgICBsc2xf ZmctPmdyZWVuID0gZXNzZW50aWFscy5zcF9mZy5ncmVlbjsKKyAgICAgICAgICBsc2xfZmctPmJs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OworICAgICAgZW51bSBmYWNlX2lkIGN1 cnNvcl9mYWNlX2lkID0KKyAgICAgICAgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAm JiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF9pbmFjdGl2ZV93aW5kb3dz KSkKKyAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBQUkVfWlYpCisgICAgICAgICAgPyBsb29r dXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZl LXByZS16di1mYWNlIiksIHRydWUpCisgICAgICAgIDogKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAg ICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVikKKyAgICAgICAgICA/IGxvb2t1cF9u YW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItcHJlLXp2LWZhY2Ui KSwgdHJ1ZSkKKyAgICAgICAgOiAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgJiYg IU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaW5hY3RpdmVfd2luZG93cykp CisgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBBVF9aVikKKyAgICAgICAgICAgID8gbG9v a3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2 ZS1hdC16di1mYWNlIiksIHRydWUpCisgICAgICAgIDogKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAg ICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IEFUX1pWKQorICAgICAgICAgID8gbG9va3VwX25h bWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1hdC16di1mYWNlIiks IHRydWUpCisgICAgICAgIDogbG9va3Vw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9uLCB3ZSBtYXkgbmVlZCB0byBkcmF3IGFkamFjZW50CisgICBnbHlwaHMg dXNpbmcgbW91c2UtZmFjZSBoaWdobGlnaHRpbmcuICovCisgICAgICBpZiAoYXJlYSA9PSBURVhU X0FSRUEgJiYgcm93LT5tb3VzZV9mYWNlX3AKKyAgICAgICAgICAmJiBobGluZm8tPm1vdXNlX2Zh Y2VfYmVnX3JvdyA+PSAwCisgICAgICAgICAgJiYgaGxpbmZvLT5tb3VzZV9mYWNlX2VuZF9yb3cg Pj0gMCkKKyAgICAgICAgeworICAgICAgICAgIHB0cmRpZmZfdCByb3dfdnBvcyA9IE1BVFJJWF9S T1dfVlBPUyAocm93LCB3LT5jdXJyZW50X21hdHJpeCk7CisgICAgICAgICAgaWYgKHJvd192cG9z ID49IGhsaW5mby0+bW91c2VfZmFjZV9iZWdfcm93CisgICAgICAgICAgICAgICYmIHJvd192cG9z IDw9IGhsaW5mby0+bW91c2VfZmFjZV9lbmRfcm93KQorICAgICAgICAgICAgeworICAgICAgICAg ICAgICBjaGVja19tb3VzZV9mYWNlID0gdHJ1ZTsKKyAgICAgICAgICAgICAgbW91c2VfYmVnX2Nv bCA9IChyb3dfdnBvcyA9PSBobGluZm8tPm1vdXNlX2ZhY2VfYmVnX3JvdykKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gaGxpbmZvLT5tb3VzZV9mYWNlX2JlZ19jb2wKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogMDsKKyAgICAgICAgICAgICAgbW91c2VfZW5kX2NvbCA9 IChyb3dfdnBvcyA9PSBobGluZm8tPm1vdXNlX2ZhY2VfZW5kX3JvdykKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gaGxpbmZvLT5tb3VzZV9mYWNlX2VuZF9jb2wKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogcm93LT51c2VkW1RFWFRfQVJFQV07CisgICAgICAgICAgICB9 CisgICAgICAgIH0KKyAgICAgIC8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9IHRydWU7CisgICAgICAgICAgICAgIHMtPmFj dGlvbl90eXBlID0gYWN0aW9uX3R5cGU7CisgICAgICAgICAgICAgIGxlbmd0aCArPSBzLT5maXJz dF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgICAgcmVsYXRpdmVf eCA9IHN0YXJ0X3ggLSBsZW5ndGg7CisgICAgICAgICAgZm9yIChzID0gaDsgczsgcyA9IHMtPm5l eHQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHMtPmZpcnN0X2dseXBoLT5yZWxhdGl2 ZV94ID0gcmVsYXRpdmVfeDsKKyAgICAgICAgICAgICAgcmVsYXRpdmVfeCArPSBzLT5maXJzdF9n bHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgICAgc3RhcnQgPSBpOwor ICAgICAgICAgIGNvbXB1dGVfb3ZlcmhhbmdzX2FuZF94ICh0LCBoZWFkLT54LCB0cnVlKTsKKyAg ICAgICAgICBwcmVwZW5kX2dseXBoX3N0cmluZ19saXN0cyAoJmhlYWQsICZ0YWlsLCBoLCB0KTsK KyAgICAgICAgICBpZiAoY2xpcF9oZWFkID09IE5VTEwpCisgICAgICAgICAgICBjbGlwX2hlYWQg PSBoZWFkOworICAgICAgICB9CisgICAgICAvKiBQcmVwZW5kIGdseXBoIHN0cmluZ3MgZm9yIGds eXBocyBpbiBmcm9udCBvZiB0aGUgZmlyc3QgZ2x5cGgKKyAgICAgIHN0cmluZyB0aGF0IG92ZXJ3 cml0ZSB0aGF0IGdseXBoIHN0cmluZyBiZWNhdXNlIG9mIHRoZWlyCisgICAgICByaWdodCBvdmVy aGFuZy4gIEZvciB0aGVzZSBzdHJpbmdzLCBvbmx5IHRoZSBmb3JlZ3JvdW5kIG11c3QKKyAgICAg IGJlIGRyYXduLCBiZWNhdXNlIGl0IGRyYXdzIG92ZXIgdGhlIGdseXBoIHN0cmluZyBhdCBgaGVh ZCcuCisgICAgICBUaGUgYmFja2dyb3VuZCBtdXN0IG5vdCBiZSBkcmF3biBiZWNhdXNlIHRoaXMg d291bGQgb3ZlcndyaXRlCisgICAgICByaWdodCBvdmVyaGFuZ3Mgb2YgcHJlY2VkaW5nIGdseXBo cyBmb3Igd2hpY2ggbm8gZ2x5cGgKKyAgICAgIHN0cmluZ3MgZXhpc3QuICovCisgICAgICBpID0g bGVmdF9vdmVyd3JpdGluZyAoaGVhZCk7CisgICAgICBpZiAoaSA+PSAwKQorICAgICAgICB7Cisg ICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIG92ZXJsYXBfaGw7CisgICAgICAgICAgaWYg KGNoZWNrX21vdXNlX2ZhY2UKKyAgICAgICAgICAgICAgJiYgbW91c2VfYmVnX2NvbCA8IHN0YXJ0 ICYmIG1vdXNlX2VuZF9jb2wgPiBpKQorICAgICAgICAgICAgb3ZlcmxhcF9obCA9IERSQVdfTU9V U0VfRkFDRTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgb3ZlcmxhcF9obCA9IERS QVdfTk9STUFMX1RFWFQ7CisgICAgICAgICAgaWYgKGhsID09IG92ZXJsYXBfaGwgfHwgY2xpcF9o ZWFkID09IE5VTEwpCisgICAgICAgICAgICBjbGlwX2hlYWQgPSBoZWFkOworICAgICAgICAgIE1D X0JVSUxEX0dMWVBIX1NUUklOR1MgKGksIHN0YXJ0LCBoLCB0LCBvdmVybGFwX2hsLCBkdW1teV94 LCBsYXN0X3gpOworICAgICAgICAgIGZvciAocyA9IGg7IHM7IHMgPSBzLT5uZXh0KQorICAgICAg ICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICAgICAgY29tcHV0ZV9v dmVyaGFuZ3NfYW5kX3ggKHQsIGhlYWQtPngsIHRydWUpOworICAgICAgICAgIHByZXBlbmRfZ2x5 cGhfc3RyaW5nX2xpc3RzICgmaGVhZCwgJnRhaWwsIGgsIHQpOworICAgICAgICB9CisgICAgICAv KiBB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xMKQorICAgICAgICAgICAgY2xp cF90YWlsID0gdGFpbDsKKyAgICAgICAgICBpKys7ICAgICAgLyogV2UgbXVzdCBpbmNsdWRlIHRo ZSBJdGggZ2x5cGguICovCisgICAgICAgICAgTUNfQlVJTERfR0xZUEhfU1RSSU5HUyAoZW5kLCBp LCBoLCB0LCBvdmVybGFwX2hsLCB4LCBsYXN0X3gpOworICAgICAgICAgIGZvciAocyA9IGg7IHM7 IHMgPSBzLT5uZXh0KQorICAgICAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7 CisgICAgICAgICAgY29tcHV0ZV9vdmVyaGFuZ3NfYW5kX3ggKGgsIHRhaWwtPnggKyB0YWlsLT53 aWR0aCwgZmFsc2UpOworICAgICAgICAgIGFwcGVuZF9nbHlwaF9zdHJpbmdfbGlzdHMgKCZoZWFk LCAmdGFpbCwgaCwgdCk7CisgICAgICAgIH0KKyAgICAgIHRhaWwgPSBnbHlwaF9zdHJpbmdfY29u dGFpbmluZ19iYWNrZ3JvdW5kX3dpZHRoICh0YWlsKTsKKyAgICAgIGlmIChjbGlwX3RhaWwpCisg ICAgICAgIGNsaXBfdGFpbCA9IGdseXBoX3N0cmluZ19jb250YWluaW5nX2JhY2tncm91bmRfd2lk dGggKGNsaXBfdGFpbCk7CisgICAgICBpZiAoY2xpcF9oZWFkIHx8IGNsaXBfdGFpbCkKKyAgICAg ICAgZm9yIChzID0gaGVhZDsgczsgcyA9IHMtPm5leHQpCisgICAgICAgICAgeworICAgICAgICAg ICAgcy0+Y2xpcF9oZWFkID0gY2xpcF9oZWFkOworICAgICAgICAgICAgcy0+Y2xpcF90YWlsID0g Y2xpcF90YWlsOworICAgICAgICAgIH0KKyAgICB9CisgIC8qIERyYXcgYWxsIHN0cmluZ3MuICov CisgIGZvciAocyA9IGhlYWQ7IHMgJiYgZHJhd19wOyBzID0gcy0+bmV4dCkKKyAgICBGUkFNRV9S SUYgKGYpLT5tY19zY3JpYmVfc3RyaW5nIChz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2N1cnNvcl90eXBlX3RvX3N0cmluZyAoY3Vyc29y X3R5cGUpKTsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIE1vdXNl X0hMSW5mbyAqaGxpbmZvID0gTU9VU0VfSExfSU5GTyAoZik7CisgIGJvb2wgbW91c2VfZmFjZV9o ZXJlX3AgPSBmYWxzZTsKKyAgc3RydWN0IGdseXBoICpjdXJzb3JfZ2x5cGg7CisgIGVudW0gZHJh d19nbHlwaHNfZmFjZSBobDsKKyAgLyogTm8gY3Vyc29yIGRpc3BsYXllZCBvciByb3cgaW52YWxp ZGF0ZWQgPT4gbm90aGluZyB0byBkbyBvbiB0aGUgc2NyZWVuLiAqLworICBpZiAoY3Vyc29yX3R5 cGUgPT0gTUNfTk9fQ1VSU09SKQorICAgIHsKKyAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICBm cHJpbnRmIChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6ICByZXR1cm4gKCVkKVxuIiwgMSk7Cisg ICAgICByZXR1cm47CisgICAgfQorICAvKiBWUE9TID49IG1hdHJpeC0+bnJvd3MgbWVhbnMgdGhh dCB3aW5kb3cgaGFzIGJlZW4gcmVzaXplZC4KKyAgICAgRG9uJ3QgYm90aGVyIHRvIGVyYXNlIHRo ZSBjdXJzb3IuICovCisgIGlmICh2cG9zID49IG1hdHJpeC0+bnJvd3MpCisgICAgeworICAgICAg aWYgKGRlYnVnX3ApCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX2VyYXNlX2N1cnNvcjog IHJldHVybiAoJWQpXG4iLCAyKTsKKyAgICAgIHJldHVybjsKKyAgICB9CisgIC8qIElmIHJvdyBj b250YWluaW5nIGN1cnNvciBpcyBtYXJrZWQgaW52YWxpZCwgdGhlcmUgaXMgbm90aGluZyB3ZQor ICAgICBjYW4gZG8uICovCisgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgeworICAgICAgaWYg KGRlYnVnX3ApCis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worICAgICAgaW50IGhlYWRlcl9saW5lX2hlaWdodCA9IFdJTkRP V19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICAgICAgY3Vyc29yX2dseXBoID0gbWNfZ2V0X2N1 cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIGhwb3MsIHZwb3MpOworICAgICAgaWYgKGN1cnNv cl9nbHlwaCA9PSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgaWYgKGRlYnVnX3ApCisgICAg ICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6ICByZXR1cm4gKCVkKVxu IiwgNyk7CisgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICBpbnQgdGVtcF93ZCA9 IGN1cnNvcl9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICBpZiAodGVtcF94IDwgMCkKKyAgICAg ICAgeworICAgICAgICAgIHRlbXBfd2QgKz0gdGVtcF94OworICAgICAgICAgIHRlbXBfeCA9IDA7 CisgICAgICAgIH0KKyAgICAgIHRlbXBfd2QgPSBtaW4gKHdkLCB3aW5kb3dfYm94X3dpZHRoICh3 LCBURVhUX0FSRUEpIC0gdGVtcF94KTsKKyAgICAgIGludCBmeSA9IFdJTkRPV19UT19GUkFNRV9Q SVhFTF9ZICh3LCBtYXggKGhlYWRlcl9saW5lX2hlaWdodCwgcm93LT55KSk7CisgICAgICBpbnQg ZnggPSBXSU5ET1dfVEVYVF9UT19GUkFNRV9QSVhFTF9YICh3LCB0ZW1wX3gpOworICAgICAgaWYg KHRlbXBfd2QgPiAwKQorICAgICAgICBGUkFNRV9SSUYgKGYpLT5jbGVhcl9mcmFtZV9hcmVhIChm LCBmeCwgZnksIHRlbXBfd2QsIHJvdy0+dmlzaWJsZV9oZWlnaHQpOworICAgIH0KKyAgLyogRXJh c2UgdGhlIGN1cnNvciBieSByZWRyYXdpbmcgdGhlIGNoYXJhY3RlciB1bmRlcm5lYXRoIGl0LiAq LworICBpZiAobW91c2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ZCAo c3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5 cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICAgICAgaW50IHgsIGludCBmeCwgaW50IHks IGludCBmeSwgaW50IGhwb3MsIGludCB2cG9zLCBpbnQgd2QsIGludCBoLAorICAgICAgICAgICAg ICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUsIGludCBjdXJzb3Jfd2lk dGgsCisgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2wsIGJvb2wgYWN0aXZl X3AsIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciwKKyAgICAgICAgICAgICAgICAgICAgICBi b29sIHJlbW92ZV9wKQoreworICAvKiBgbWF0cml4X3JvdycgaW4gYGRpc3BuZXcuY2AgY29udGFp bnMgdGhlIGZvbGxvd2luZyB0ZXN0cywKKyAgZWFzc2VydCAobWF0cml4ICYmIG1hdHJpeC0+cm93 cyk7CisgIGVhc3NlcnQgKHJvdyA+PSAwICYmIHJvdyA8IG1hdHJpeC0+bnJvd3MpOyAqLworICBi b29sIGJhcmZfY3Jhc2hfb25lID0gKG1hdHJpeCAmJiBtYXRyaXgtPnJvd3MpID8gZmFsc2UgOiB0 cnVlOworICBpZiAoYmFyZl9jcmFzaF9vbmUpCisgICAgcmV0dXJuOworICBib29sIGJhcmZfY3Jh c2hfdHdvID0gKHZwb3MgPj0gMCAmJiB2cG9zIDwgbWF0cml4LT5ucm93cykgPyBmYWxzZSA6IHRy dWU7CisgIGlmIChiYXJmX2NyYXNoX3R3bykKKyAgICByZXR1cm47CisgIGlmICh4IDwgMAorICAg ICAgfHwgeSA8IDAKKyAgICAgIHx8IGhwb3MgPCAwCisgICAgICB8fCB2cG9zIDwgMCkKKyAgICBy ZXR1cm47CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBib29sIGF1 dG9faHNjcm9sbF9tb2RlX3AgPSBFUSAoRmJ1ZmZlcl9sb2NhbF92YWx1ZSAoUWF1dG9faHNjcm9s bF9tb2RlLCB3LT5jb250ZW50cyksIFFjdXJyZW50X2xpbmUpOworICAvKiBFWEFNUExFOiAgKHNj cm9sbC1sZWZ0IDUpICovCisgIGJvb2wgaHNjbF9hbGxfdGVtcF9wID0gKHctPnN1c3BlbmRfYXV0 b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2Rl X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gMCk7CisgIC8qIEVYQU1QTEU6 ICBDLXUgQy14IDwgYW5kIGRvIG5vdGhpbmcuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8wX3Ag PSAody0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+ aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9s bCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSB3 LT5oc2Nyb2xsKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBhbmQgZG8gc29tZXRoaW5nIGVs c2UgYmVzaWRlcyBob3Jpem9udGFsbHkgc2Nyb2xsaW5nIHRoZQorICAgICAgICAgICAgICAgY3Vy cmVudCBsaW5lIGRpZmZlcmVudGx5LgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIGlzIF9u b3RfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4gKi8KKyAgYm9vbCBoc2NsX2Fs bF9wZXJtXzFfcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5f aHNjcm9sbCA9PSB3LT5oc2Nyb2xsKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBhbmQgLi4u CisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgaXMgX25vdF8gaG9yaXpvbnRhbGx5IHNjcm9s bGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMl9wID0gKCF3LT5zdXNw ZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNj cm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID09 IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCAhPSB3LT5oc2Nyb2xs KTsKKyAgLyogRVhBTVBMRTogIChzY3JvbGwtbGVmdCA1KTsgYW5kLCB0aGVuIHByZXNzIHRoZSBs ZWZ0IGFycm93IGtleSBvbmUgdGltZS4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBfaXNf IGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4qLworICBib29sIGhzY2xfdGVtcF9w ID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICYmIGF1 dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4g MAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IDApOworICAvKiBF WEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBzb21ldGhpbmcgdGhhdCBjYXVzZXMgdGhlIGN1cnJl bnQgbGluZSB0byBiZQorICAgICAgICAgICAgICAgaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZl cmVudGx5LgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIF9pc18gaG9yaXpvbnRhbGx5IHNj cm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfcGVybV9wID0gKCF3LT5zdXNwZW5k X2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2Rl X3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAg ICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICYm IHctPm1pbl9oc2Nyb2xsICE9IHctPmhzY3JvbGwpOworICBpbnQgZnJpbmdlX2JpdG1hcCA9IE1D X05PX0ZSSU5HRV9CSVRNQVA7CisgIGludCBmYWNlX2lkID0gREVGQVVMVF9GQUNFX0lEOworICBp ZiAoIXJlbW92ZV9wCisgICAgICAmJiBnbHlwaF9mbGF2b3IgPT0gTUNfT1ZFUkxBWV9BUlJPV19C SVRNQVAKKyAgICAgICYmICFoc2NsX2FsbF90ZW1wX3AKKyAgICAgICYmICFoc2NsX3RlbXBfcAor ICAgICAgJiYgIWhzY2xfcGVybV9wCisgICAgICAmJiAhaHNjbF9hbGxfcGVybV8wX3AKKyAgICAg ICYmICFoc2NsX2FsbF9wZXJtXzFfcAorICAgICAgJiYgIWhzY2xfYWxsX3Blcm1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V9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICByb3ctPmxlZnRfZnJpbmdlX2ZhY2VfaWQg PSBmYWNlX2lkOworICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9vZmZzZXQgPSAwOworICAgICAgcm93 LT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3AgPSBmYWxzZTsKKyAgICB9CisgICAgZWxzZSBpZiAo IXJlbW92ZV9wCisgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yID09IE1DX09WRVJMQVlfQVJS T1dfQklUTUFQCisgICAgICAgICAgICAgJiYgKGhzY2xfYWxsX3RlbXBfcAorICAgICAgICAgICAg ICAgICB8fCBoc2NsX2FsbF9wZXJtXzBfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9w ZXJtXzFfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzJfcAorICAgICAgICAg ICAgICAgICB8fCBoc2NsX3RlbXBfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX3Blcm1fcCkp CisgICAgICB7CisgICAgICAgIGVudW0gZmFjZV9pZCBvdmVybGF5X2Fycm93X2ZhY2VfaWQgPQor ICAgICAgICAgICghYWN0aXZlX3AKKyAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIg KHctPmNvbnRlbnRzKSwgY2hfaW5hY3RpdmVfd2luZG93cykpKQorICAgICAgICAgID8gbG9va3Vw X2Rlcml2ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtaW5hY3Rp dmUtcHJlLXp2LWZhY2UiKSwgRlJJTkdFX0ZBQ0VfSUQsIHRydWUpCisgICAgICAgICAgOiAoYWN0 aXZlX3ApCisgICAgICAgICAgICA/IGxvb2t1cF9kZXJpdmVkX2ZhY2UgKHcsIGYsIGludGVybiAo Iistb3ZlcmxheS1hcnJvdy1oc2NsLXByZS16di1mYWNlIiksIEZSSU5HRV9GQUNFX0lELCB0cnVl KQorICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICBmYWNlX2lkID0gKGN1cnNv cl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgID8gb3Zl cmxheV9hcnJvd19mYWNlX2lkCisgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsK KyAgICAgICAgaWYgKGhzY2xfYWxsX3Blcm1fMF9wKQorICAgICAgICAgIGZyaW5nZV9iaXRtYXAg PSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgZmFsc2Us IGZhbHNlKTsKKyAgICAgICAgICBlbHNlIGlmIChoc2NsX2FsbF9wZXJtXzFfcCkKKyAgICAgICAg ICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1o c2NsLXBlcm0iKSwgdHJ1ZSwgZmFsc2UpOworICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF9hbGxf cGVybV8yX3ApCisgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2Jp dG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgZmFsc2UsIHRydWUpOworICAgICAgICAg ICAgICBlbHNlIGlmIChoc2NsX3Blcm1fcCkKKyAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFw ID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIHRydWUs IHRydWUpOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xfYWxsX3RlbXBfcCkKKyAgICAg ICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50 ZXJuICgiKy1oc2NsLXRlbXAiKSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgIGVs c2UgaWYgKGhzY2xfdGVtcF9wKQorICAgICAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0g bWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC10ZW1wIiksIHRydWUsIGZh bHNlKTsKKyAgICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0g TUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gZnJpbmdlX2JpdG1hcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNf Tk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9mYWNlX2lkID0gZmFj ZV9pZDsKKyAgICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9vZmZzZXQgPSAwOworICAgICAgICByb3ct PmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcCA9IGZhbHNlOworICAgICAgfQorICAgICAgZWxzZSBp ZiAoIXJlbW92ZV9wCisgICAgICAgICAgICAgICAmJiAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExP V19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2 b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAg ICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFCisgICAgICAg ICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJP VworICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJU SUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3Ig PT0gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09 IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2Zs YXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIKSkKKyAgICAgICAgeworICAgICAgICAg IExpc3BfT2JqZWN0IGJpdG1hcF9mbGF2b3IgPSAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19S RUNUQU5HTEVfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID8gUW1jX2hvbGxvd19yZWN0YW5nbGVfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX0hPTExP V19SRUNUQU5HTEVfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNf SE9MTE9XX1JFQ1RBTkdMRSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFy X3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGds eXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGlj YWxfYmFyX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJU SUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNf cmV2ZXJzZWRfdmVydGljYWxfYmFyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jhcl9iYWNr c2xhc2gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBRbmlsOworICAg ICAgICAgIGZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJTkdFX0JJ VE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgPyBsb29rdXBfZnJpbmdlX2JpdG1hcCAo Yml0bWFwX2ZsYXZvcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19OT19GUklOR0Vf QklUTUFQOworICAgICAgICAgIGZhY2VfaWQgPSAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRfRlJJ TkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAgICAgJiYgKGdseXBoX2ZsYXZvciA9PSBNQ19S RVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAg ICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9B UlJPVworICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZF UlNFRF9WRVJUSUNBTF9CQVIpKQorICAgICAgICAgICAgICAgICAgICAgID8gbG9va3VwX2Rlcml2 ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZXZlcnNlZC1iYXItcHJlLXp2LWZhY2UiKSwgRlJJ TkdFX0ZBQ0VfSUQsIHRydWUpCisgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl90eXBlID09 IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhf Zmxhdm9yICE9IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAg ICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX1ZFUlRJQ0FM X0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3Ig IT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAgICAgICAgID8gbG9v a3VwX2Rlcml2ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1iYXItcHJlLXp2LWZhY2UiKSwgRlJJ TkdFX0ZBQ0VfSUQsIHRydWUpCisgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lE OworICAgICAgICAgIHJvdy0+Y3Vyc29yX2luX2ZyaW5nZV9wID0gZmFsc2U7CisgICAgICAgICAg cm93LT5yaWdodF9mcmluZ2VfYml0bWFwID0gZnJpbmdlX2JpdG1hcDsKKyAgICAgICAgICByb3ct PnJpZ2h0X2ZyaW5nZV9mYWNlX2lkID0gZmFjZV9pZDsKKyAgICAgICAgICByb3ctPnJpZ2h0X2Zy aW5nZV9vZmZzZXQgPSAwOworICAgICAgICAgIHJvdy0+ZnJpbmdlX2JpdG1hcF9wZXJpb2RpY19w ID0gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoZ2x5cGhfZmxhdm9yID09IE1D X0dMWVBICisgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSExFU1Mp CisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBvbl9wID0gdHJ1ZTsKKyAgICAgICAgICAg IEZSQU1FX1JJRiAoZiktPm1jX3NjcmliZV9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwg eSwgZnksIGhwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICB2cG9zLCB3ZCwgaCwgbHNsLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgZ2x5cGhfZmxhdm9yLCBvbl9wLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0aXZlX3ApOwor ICAgICAgICAgIH0KK30KKworLyogRHVtcCBjb250ZW50cyBvZiBnbHlwaCBHTFlQSCB0byBzdGRl cnIuICBST1cgYW5kIEFSRUEgYXJlCisgICB0aGUgZ2x5cGggcm93IGFuZCBhcmVhIHdoZXJlIHRo ZSBnbHlwaCBjb21lcyBmcm9tLiAqLwordm9pZAorbWNfZHVtcF9nbHlwaCAoc3RydWN0IGdseXBo X3JvdyAqcm93LCBzdHJ1Y3QgZ2x5cGggKmdseXBoLCBpbnQgYXJlYSwKKyAgICAgICAgICAgICAg IGludCByZWxhdGl2ZV94LCBpbnQgdnBvcykKK3sKKyAgYm9vbCBnbHlwaF96dl9wID0gKGdseXBo IC0gcm93LT5nbHlwaHNbYXJlYV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAg ICAgICAgICAgJiYgTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSA9PSBaVik7CisgIGlmIChn bHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICB8fCBnbHlwaC0+dHlwZSA9PSBHTFlQSExF U1NfR0xZUEgpCisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBE ImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICAlM2Qg JXMgJXNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAg ICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisg ICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgIChnbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisg ICAgICAgICA/ICdDJworICAgICAgICAgOiAnRycpLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywK KyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICA/ICdCJworICAgICAg ICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAg ICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgICAgPyAnMCcKKyAgICAg ICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAg IGdseXBoLT51LmNoLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxl ZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAg IGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgIG1jX2NoYXJf dG9fc3RyaW5nIChnbHlwaC0+dS5jaCkpOworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUg PT0gU1RSRVRDSF9HTFlQSCkKKyAgICB7CisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAg ICIgJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNnggJTRkICUxLjFkJTEu MWQgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFd LAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0g LSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ1MnLAorICAgICAgICBnbHlwaC0+ Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ ICdCJworICAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ ICdTJworICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICcw JworICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAg ICAgIDB1LAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94 X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBo LT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICJcXFMiKTsKKyAgICB9 CisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IElNQUdFX0dMWVBIKQorICAgIHsKKyAgICAgIGZw cmludGYgKHN0ZGVyciwKKyAgICAgICAgIiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMg JTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4xZCAgJTNkICVzICVjXG4iLAorICAgICAgICBnbHlwaCAt IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDAp ID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAg ICAnSScsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgt Pm9iamVjdCkKKyAgICAgICAgICAgID8gJ0InCisgICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgt Pm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9i amVjdCkKKyAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgOiAnLScpKSksCisgICAgICAgIGds eXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgKHVuc2lnbmVkIGludCkgZ2x5cGgtPnUuaW1nX2lk LAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVf cCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9z LCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7CisgICAgfQorICBlbHNl IGlmIChnbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpCisgICAgeworICAgICAgZnByaW50 ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2Qg MHglMDZ4IiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAg ICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAg ICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJysnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywK KyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdCJworICAg ICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAg ICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICcwJworICAgICAg ICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgICh1bnNp Z25lZCBpbnQpIGdseXBoLT51LmNtcC5pZCk7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgJTRk ICUxLjFkJTEuMWQiLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxl ZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3ApOworICAgICAg aWYgKGdseXBoLT51LmNtcC5hdXRvbWF0aWMpCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAg JTNkICVzIC4gWyVkLSVkXVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaC0+aHBv cywgZ2x5cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAgICAgICAgICAgICAgICAgIGds eXBoLT5zbGljZS5jbXAuZnJvbSwgZ2x5cGgtPnNsaWNlLmNtcC50byk7CisgICAgICAgIGVsc2UK KyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiXG4iKTsKKyAgICB9CisgIGVsc2UgaWYgKGdseXBo LT50eXBlID09IFhXSURHRVRfR0xZUEgpCisgICAgeworI2lmbmRlZiBIQVZFX1hXSURHRVRTCisg ICAgICBlYXNzdW1lIChmYWxzZSk7CisjZWxzZQorICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAg ICAgICAiICAlNWQvJS01ZCAlNWQgJTRjICU2ZCAlYyAlM2QgMHglMDV4ICU0ZCAlMS4xZCUxLjFk ICAlM2QgJXMgJWNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwK KyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0g MSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdYJywKKyAgICAgICAgZ2x5cGgtPmNo YXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICA/ICdC JworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1Mn CisgICAgICAgICA6ICctJykpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAg IGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAg ICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnUueHdpZGdldCwKKyAg ICAgICAgZ2x5cGgtPmhwb3MsIGdseXBoX3p2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgJy4n KTsKKyNlbmRpZgorICAgIH0KK30KKworLyogRHVtcCB0aGUgY29udGVudHMgb2YgZ2x5cGggcm93 IGF0IFZQT1MgaW4gTUFUUklYIHRvIHN0ZGVyci4KKyAgIEdMWVBIUyAwIG1lYW5zIGRvbid0IHNo b3cgZ2x5cGggY29udGVudHMuCisgICBHTFlQSFMgMSBtZWFucyBzaG93IGdseXBocyBpbiBzaG9y dCBmb3JtCisgICBHTFlQSFMgPiAxIG1lYW5zIHNob3cgZ2x5cGhzIGluIGxvbmcgZm9ybS4gKi8K K3ZvaWQKK21jX2R1bXBfZ2x5cGhfcm93IChzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCB2cG9z LCBpbnQgZ2x5cGhzKQoreworICBpbnQgcmVsYXRpdmVfeCA9IDA7CisgIGlmIChnbHlwaHMgIT0g MSkKKyAgICB7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICJcbkRVTVAgR0xZUEggUk9XXG4iKTsK KyAgICAgIGZwcmludGYgKHN0ZGVyciwgIlJvdyAgICAgU3RhcnQgICAgICAgRW5kIFVzZWQgb0U+ PFxcQ1RaRmVzbSAgICAgWCAgICBZICAgIFcgICAgSCAgICBWICAgIEEgICAgUFxuIik7CisgICAg ICBmcHJpbnRmIChzdGRlcnIsICI9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiIpOworICAgICAgZnBy aW50ZiAoc3RkZXJyLCAiJTNkICU5InBEImQgJTkicEQiZCAlNGQgJTEuMWQlMS4xZCUxLjFkJTEu MWRcCislMS4xZCUxLjFkJTEuMWQlMS4xZCUxLjFkJTEuMWQlMS4xZCUxLjFkICAlNGQgJTRkICU0 ZCAlNGQgJTRkICU0ZCAlNGRcbiIsCisgICAgICAgICB2cG9zLAorICAgICAgICAgTUFUUklYX1JP V19TVEFSVF9DSEFSUE9TIChyb3cpLAorICAgICAgICAgTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAo cm93KSwKKyAgICAgICAgIHJvdy0+dXNlZFtURVhUX0FSRUFdLAorICAgICAgICAgcm93LT5jb250 YWluc19vdmVybGFwcGluZ19nbHlwaHNfcCwKKyAgICAgICAgIHJvdy0+ZW5hYmxlZF9wLAorICAg ICAgICAgcm93LT50cnVuY2F0ZWRfb25fbGVmdF9wLAorICAgICAgICAgcm93LT50cnVuY2F0ZWRf b25fcmlnaHRfcCwKKyAgICAgICAgIHJvdy0+Y29udGludWVkX3AsCisgICAgICAgICBNQVRSSVhf Uk9XX0NPTlRJTlVBVElPTl9MSU5FX1AgKHJvdyksCisgICAgICAgICBNQVRSSVhfUk9XX0RJU1BM QVlTX1RFWFRfUCAocm93KSwKKyAgICAgICAgIHJvdy0+ZW5kc19hdF96dl9wLAorICAgICAgICAg cm93LT5maWxsX2xpbmVfcCwKKyAgICAgICAgIHJvdy0+ZW5kc19pbl9taWRkbGVfb2ZfY2hhcl9w LAorICAgICAgICAgcm93LT5zdGFydHNfaW5fbWlkZGxlX29mX2NoYXJfcCwKKyAgICAgICAgIHJv dy0+bW91c2VfZmFjZV9wLAorICAgICAgICAgcm93LT54LAorICAgICAgICAgcm93LT55LAorICAg ICAgICAgcm93LT5waXhlbF93aWR0aCwKKyAgICAgICAgIHJvdy0+aGVpZ2h0LAorICAgICAgICAg cm93LT52aXNpYmxlX2hlaWdodCwKKyAgICAgICAgIHJvdy0+YXNjZW50LAorICAgICAgICAgcm93 LT5waHlzX2FzY2VudCk7CisgICAgICAvKiBUaGUgbmV4dCAzIGxpbmVzIHNob3VsZCBhbGlnbiB0 byAiU3RhcnQiIGluIHRoZSBoZWFkZXIuICovCisgICAgICBmcHJpbnRmIChzdGRlcnIsICIgICAg JTkicEQiZCAlOSJwRCJkXHQlNWRcbiIsIHJvdy0+c3RhcnQub3ZlcmxheV9zdHJpbmdfaW5kZXgs CisgICAgICAgICByb3ctPmVuZC5vdmVybGF5X3N0cmluZ19pbmRleCwKKyAgICAgICAgIHJvdy0+ Y29udGludWF0aW9uX2xpbmVzX3dpZHRoKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgICAl OSJwRCJkICU5InBEImRcbiIsCisgICAgICAgICBDSEFSUE9TIChyb3ctPnN0YXJ0LnN0cmluZ19w b3MpLAorICAgICAgICAgQ0hBUlBPUyAocm93LT5lbmQuc3RyaW5nX3BvcykpOworICAgICAgZnBy aW50ZiAoc3RkZXJyLCAiICAgICU5ZCAlOWRcbiIsIHJvdy0+c3RhcnQuZHB2ZWNfaW5kZXgsCisg ICAgICAgICByb3ctPmVuZC5kcHZlY19pbmRleCk7CisgICAgfQorICBpZiAoZ2x5cGhzID4gMSkK KyAgICB7CisgICAgICBmb3IgKGludCBhcmVhID0gTEVGVF9NQVJHSU5fQVJFQTsgYXJlYSA8IExB U1RfQVJFQTsgKythcmVhKQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGdseXBoICpnbHlw aCA9IHJvdy0+Z2x5cGhzW2FyZWFdOworICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGhfZW5k ID0gZ2x5cGggKyByb3ctPnVzZWRbYXJlYV07CisgICAgICAgICAgLyogR2x5cGggZm9yIGEgbGlu ZSBlbmQgaW4gdGV4dC4gKi8KKyAgICAgICAgICBpZiAoYXJlYSA9PSBURVhUX0FSRUEgJiYgZ2x5 cGggPT0gZ2x5cGhfZW5kICYmIGdseXBoLT5jaGFycG9zID4gMCkKKyAgICAgICAgICAgICsrZ2x5 cGhfZW5kOworICAgICAgICAgIGlmIChnbHlwaCA8IGdseXBoX2VuZCkKKyAgICAgICAgICAgIGZw cmludGYgKHN0ZGVyciwgIkdseXBoIy9Ub3RhbCBSZWwuWCBUICAgICAgIFBvcyBPICAgVyAgICAg Q29kZSBGYWNlIExSIEhQT1MgWlYgQ1xuIik7CisgICAgICAgICAgZm9yICg7IGdseXBoIDwgZ2x5 cGhfZW5kOyArK2dseXBoKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19kdW1wX2ds eXBoIChyb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB2cG9zKTsKKyAgICAgICAgICAgICAg cmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAg IH0KKyAgICB9CisgICAgZWxzZSBpZiAoZ2x5cGhzID09IDEpCisgICAgICB7CisgICAgICAgIGNo YXIgc1tTSFJUX01BWCArIDRdOworICAgICAgICBmb3IgKGludCBhcmVhID0gTEVGVF9NQVJHSU5f QVJFQTsgYXJlYSA8IExBU1RfQVJFQTsgKythcmVhKQorICAgICAgICAgIHsKKyAgICAgICAgICAg IGludCBpOworICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHJvdy0+dXNlZFthcmVhXTsgKytp KQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoICpnbHlwaCA9 IHJvdy0+Z2x5cGhzW2FyZWFdICsgaTsKKyAgICAgICAgICAgICAgICBpZiAoaSA9PSByb3ctPnVz ZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICYmIGFyZWEgPT0gVEVYVF9BUkVBCisg ICAgICAgICAgICAgICAgICAgICYmIE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAg ICAgICAgICYmIGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgICAgICAgICAgICAgICAg JiYgZ2x5cGgtPnUuY2ggPT0gJyAnKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgICBzdHJjcHkgKCZzW2ldLCAiW1xcbl0iKTsKKyAgICAgICAgICAgICAgICAgICAgaSAr PSA0OworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoZ2x5 cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5 cGgtPnUuY2ggPCAweDgwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaC0+dS5j aCA+PSAnICcpCisgICAgICAgICAgICAgICAgICAgIHNbaV0gPSBnbHlwaC0+dS5jaDsKKyAgICAg ICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgIHNbaV0gPSAnLic7Cisg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHNbaV0gPSAnXDAnOworICAgICAgICAgICAgZnBy aW50ZiAoc3RkZXJyLCAiJTNkOiAoJWQpICclcydcbiIsIHZwb3MsIHJvdy0+ZW5hYmxlZF9wLCBz KTsKKyAgICAgICAgICB9CisgICAgICB9Cit9CisKK0RFRlVOICgibWMtZHVtcC1nbHlwaC1yb3ci LCBGbWNfZHVtcF9nbHlwaF9yb3csIFNtY19kdW1wX2dseXBoX3JvdywgMSwgMiwgIlAiLAorICAg ICAgIGRvYzogLyogRHVtcCBnbHlwaCByb3cgUk9XIHRvIHN0ZGVyci4KK0ludGVyYWN0aXZlbHks IFJPVyBpcyB0aGUgcHJlZml4IG51bWVyaWMgYXJndW1lbnQgYW5kIGRlZmF1bHRzIHRvCit0aGUg cm93IHdoaWNoIGRpc3BsYXlzIHBvaW50LgorT3B0aW9uYWwgYXJndW1lbnQgR0xZUEhTIDAgbWVh bnMgZG9uJ3QgZHVtcCBnbHlwaHMuCitHTFlQSFMgMSBtZWFucyBkdW1wIGdseXBocyBpbiBzaG9y dCBmb3JtLgorR0xZUEhTID4gMSBvciBvbWl0dGVkIG1lYW5zIGR1bXAgZ2x5cGhzIGluIGxvbmcg Zm9ybS4gICovKQorICAoTGlzcF9PYmplY3Qgcm93LCBMaXNwX09iamVjdCBnbHlwaHMpCit7Cisg IHN0cnVjdCB3aW5kb3cgKncgPSBYV0lORE9XIChzZWxlY3RlZF93aW5kb3cpOworICBzdHJ1Y3Qg Z2x5cGhfbWF0cml4ICptYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAgRU1BQ1NfSU5UIHZw b3M7CisgIGlmIChOSUxQIChyb3cpKQorICAgIHsKKyAgICAgIGludCBkMSwgZDIsIGQzLCBkNCwg ZDUsIHlwb3M7CisgICAgICBib29sIHZpc2libGVfcCA9IHBvc192aXNpYmxlX3AgKHcsIFBULCAm ZDEsICZkMiwgJmQzLCAmZDQsICZkNSwgJnlwb3MpOworICAgICAgaW50IGhlYWRlcl9saW5lX2hl aWdodCA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICAgICAgaW50IHZvZmZzZXQg PSAoaGVhZGVyX2xpbmVfaGVpZ2h0ID4gMAorICAgICAgICAgICAgICAgICAgICAgJiYgeXBvcyA+ IDApCisgICAgICAgICAgICAgICAgICAgICAgPyB5cG9zICsgMQorICAgICAgICAgICAgICAgICAg ICAgIDogeXBvczsKKyAgICAgIGlmICh2aXNpYmxlX3ApCisgICAgICAgIHZwb3MgPSB2b2Zmc2V0 OworICAgICAgICBlbHNlCisgICAgICAgICAgdnBvcyA9IDA7CisgICAgfQorICAgIGVsc2UKKyAg ICAgIHsKKyAgICAgICAgQ0hFQ0tfTlVNQkVSIChyb3cpOworICAgICAgICB2cG9zID0gWEZJWE5V TSAocm93KTsKKyAgICAgIH0KKyAgaWYgKHZwb3MgPj0gMCAmJiB2cG9zIDwgbWF0cml4LT5ucm93 cykKKyAgICBtY19kdW1wX2dseXBoX3JvdyAoTUFUUklYX1JPVyAobWF0cml4LCB2cG9zKSwKKyAg ICAgICAgdnBvcywKKyAgICAgICAgVFlQRV9SQU5HRURfRklYTlVNUCAoaW50LCBnbHlwaHMpID8g WEZJWE5VTSAoZ2x5cGhzKSA6IDIpOworICByZXR1cm4gUW5pbDsKK30KKwordm9pZAorbWNfZHVt cF9nbHlwaF9tYXRyaXggKHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgaW50IGdseXBocykK K3sKKyAgaW50IGk7CisgIGZvciAoaSA9IDA7IGkgPCBtYXRyaXgtPm5yb3dzOyArK2kpCisgICAg bWNfZHVtcF9nbHlwaF9yb3cgKE1BVFJJWF9ST1cgKG1hdHJpeCwgaSksIGksIGdseXBocyk7Cit9 CisKK0RFRlVOICgibWMtZHVtcC1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LT5jdXJzb3IuaHBvcywgdy0+Y3Vy c29yLnZwb3MpOworICBmcHJpbnRmIChzdGRlcnIsICI9PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT1cbiIpOworICBtY19kdW1wX2dseXBoX21hdHJpeCAody0+Y3Vy cmVudF9tYXRyaXgsCisgICAgICAgICBUWVBFX1JBTkdFRF9GSVhOVU1QIChpbnQsIGdseXBocykg PyBYRklYTlVNIChnbHlwaHMpIDogMCk7CisgIHJldHVybiBRbmlsOworfQorCitib29sCittY190 cmF2ZXJzZV9jYWNoZV9wIChzdHJ1Y3QgbWNfbWF0cml4IG1hdHJpeCwgZW51bSBtY19jYWNoZV90 eXBlIGNhY2hlX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICBpbnQgdm50aCwgaW50IG50aCkK K3sKKyAgaWYgKHZudGggPCBtYXRyaXgudnBvc191c2VkCisgICAgICAmJiBtYXRyaXguY3Vyc29y c191c2VkW2NhY2hlX3R5cGVdID4gMAorICAgICAgJiYgbnRoIDwgbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVfdXNlZFtjYWNoZV90eXBlXSkKKyAgICByZXR1cm4gdHJ1ZTsKKyAgICBlbHNlCisgICAg ICByZXR1cm4gZmFsc2U7Cit9CisKK3ZvaWQKK21jX3Jlc2V0X2NhY2hlIChzdHJ1Y3Qgd2luZG93 ICp3KQoreworICBpZiAoIUJVRkZFUlAgKHctPmNvbnRlbnRzKSkKKyAgICByZXR1cm47CisgIGZv ciAoZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICBjYWNo ZV90eXBlIDwgTk9fQ0FDSEU7CisgICAgICAgKytjYWNoZV90eXBlKQorICAgIHsKKyAgICAgIGJv b2wgYnZhcl9hY3RpdmVfcDsKKyAgICAgIHN3aXRjaCAoY2FjaGVfdHlwZSkKKyAgICAgICAgewor ICAgICAgICAgIGNhc2UgTk9fQ0FDSEU6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHJl dHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBjYXNlIE1DX0NBQ0hFOgorICAgICAgICAg ICAgeworICAgICAgICAgICAgICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAg ICAgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkK KyAgICAgICAgICAgICAgICBidmFyX2FjdGl2ZV9wID0gZmFsc2U7CisgICAgICAgICAgICAgICAg ZWxzZSBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgICAgICAg JiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQorICAgICAg ICAgICAgICAgICAgYnZhcl9hY3RpdmVfcCA9IHRydWU7CisgICAgICAgICAgICAgIGJyZWFrOwor ICAgICAgICAgICAgfQorICAgICAgICAgIGNhc2UgQ0hfQ0FDSEU6CisgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAg ICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAg ICAgICAgICAgICAgIGJ2YXJfYWN0aXZlX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBlbHNl IGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiAh TklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisgICAgICAg ICAgICAgICAgICBidmFyX2FjdGl2ZV9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgYnJlYWs7Cisg ICAgICAgICAgICB9CisgICAgICAgICAgY2FzZSBGQ19DQUNIRToKKyAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAg JiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpCisgICAg ICAgICAgICAgICAgYnZhcl9hY3RpdmVfcCA9IGZhbHNlOworICAgICAgICAgICAgICAgIGVsc2Ug aWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICAgICAgICYmICFO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKSkKKyAgICAgICAg ICAgICAgICAgIGJ2YXJfYWN0aXZlX3AgPSB0cnVlOworICAgICAgICAgICAgICBicmVhazsKKyAg ICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKCFidmFyX2FjdGl2ZV9wKQorICAgICAg ICB7CisgICAgICAgICAgLyogRGVjcmVhc2UgdGhlIHNpemUgb2YgdGhlIGFycmF5IHRvIGEgYmFy ZSBtaW5pbXVtLiAqLworICAgICAgICAgIGZvciAoaW50IHZudGggPSAwOyB2bnRoIDwgdy0+bWNf bWF0cml4LnZwb3NfdXNlZDsgKyt2bnRoKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBp ZiAody0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVkW2NhY2hlX3R5cGVdID4g MSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXSA9CisgICAgICAgICAgICAgICAgICAgIHhucmVhbGxv YyAody0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV0sIDEsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mICp3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXSk7C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bHlwaC0+c2xp Y2UuaW1nLngKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhdLmdseXBoLnNsaWNlLmltZy55ID09IGdseXBoLT5zbGljZS5pbWcueQor ICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF0uZ2x5cGguc2xpY2UuaW1nLndpZHRoID09IGdseXBoLT5zbGljZS5pbWcud2lkdGgKKyAg ICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLmdseXBoLnNsaWNlLmltZy5oZWlnaHQgPT0gZ2x5cGgtPnNsaWNlLmltZy5oZWlnaHQKKyAg ICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLmdseXBoLnNsaWNlLmNtcC5mcm9tID09IGdseXBoLT5zbGljZS5jbXAuZnJvbQorICAgICAg ICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0u eCA9PSB4CisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXS5meCA9PSBmeAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0ueSA9PSB5CisgICAgICAgICAgICAgJiYgdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5meSA9PSBmeQorICAg ICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF0uaHBvcyA9PSBocG9zCisgICAgICAgICAgICAgJiYgdy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gICAgICAgICAgICAgICAgICAg ICAgICAgICAgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBhY3RpdmVfcCwgZ2x5cGhfZmxhdm9y LCByZW1vdmVfcCk7CisgICAgICByZXR1cm47CisgICAgfQorICAgIGVsc2UgaWYgKGRyYXdfcAor ICAgICAgICAgICAgICYmIChmcm9tX3doZXJlID09IFNDUklCRV9PTkUKKyAgICAgICAgICAgICAg ICAgfHwgZnJvbV93aGVyZSA9PSBTQ1JJQkVfVFdPCisgICAgICAgICAgICAgICAgIHx8IGZyb21f d2hlcmUgPT0gU0NSSUJFX1RIUkVFCisgICAgICAgICAgICAgICAgIHx8IGZyb21fd2hlcmUgPT0g Tk9XSEVSRSkpCisgICAgICB7CisgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCBtYXRy aXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwgY3Vyc29yX3R5cGUsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGFj dGl2ZV9wLCBnbHlwaF9mbGF2b3IsIHJlbW92ZV9wKTsKKyAgICAgICAgcmV0dXJuOworICAgICAg fQorICBpZiAoY2FjaGVfdHlwZSA9PSBOT19DQUNIRSkKKyAgICByZXR1cm47CisgICsrdy0+bWNf bWF0cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90eXBlXTsKKyAgaWYgKHZudGggPj0gdy0+bWNfbWF0 cml4LnZwb3NfdXNlZCkKKyAgICB3LT5tY19tYXRyaXgudnBvc191c2VkID0gdm50aCArIDE7Cisg IGlmICh3LT5tY19tYXRyaXgudnBvc19hbGxvY2F0ZWQgPCB3LT5tY19tYXRyaXgudnBvc191c2Vk KQorICAgIHsKKyAgICAgIGludCBvbGRfYWxsb2MgPSB3LT5tY19tYXRyaXgudnBvc19hbGxvY2F0 ZWQ7CisgICAgICBpbnQgbmV3X2VsdHMgPSB3LT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o ZV90eXBlXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX2FsbG9jYXRlZFtjYWNo ZV90eXBlXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgbmV3X2VsdHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIElOVF9NQVgsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiAqdy0+bWNfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV0pOworICAgICAgbWVtc2V0ICh3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXSArIG9sZF9hbGxvYywgMCwKKyAgICAgICAg ICAgICAgICh3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlw ZV0gLSBvbGRfYWxsb2MpCisgICAgICAgICAgICAgICAgICogc2l6ZW9mICp3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXSk7CisgICAgfQorICBpbnQgbnRoID0gdy0+bWNf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXSAtIDE7CisgIHctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uc2FtZV9wID0gZmFsc2U7Cisg IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGgudHlw ZSA9IGdseXBoLT50eXBlOworICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGh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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBl bHNld2hlcmU6ICBgdy0+Y3Vyc29yLnhgIC8gYG1jLmZjX3hgLiAqLwordm9pZAorbWNfZ2V0X2N1 cnNvcl9nZW9tZXRyeSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0 cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93LCBpbnQg eCwgaW50ICpmeCwgaW50IHksCisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgKmZ5LCBpbnQg aHBvcywgaW50IHZwb3MsIGludCAqaCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNf Y3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUsIGludCBjdXJzb3Jfd2lkdGgsCisgICAgICAgICAgICAg ICAgICAgICAgICBpbnQgKndkKQoreworICBzdHJ1Y3QgZ2x5cGggKmdseXBoID0gbWNfZ2V0X2N1 cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIGhwb3MsIHZwb3MpOworICBpZiAoZ2x5cGggPT0g TlVMTCkKKyAgICByZXR1cm47CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAoV0lORE9XX0ZS QU1FICh3KSk7CisgICpmeCA9IFdJTkRPV19URVhUX1RPX0ZSQU1FX1BJWEVMX1ggKHcsIHgpOwor ICAqaCA9IHJvdy0+dmlzaWJsZV9oZWlnaHQ7CisgIC8qIERvbid0IGxldCB0aGUgY3Vyc29yIGV4 Y2VlZCB0aGUgZGltZW5zaW9ucyBvZiB0aGUgcm93LCBzbyB0aGF0CisgIHRoZSB1cHBlci9sb3dl ciBzaWRlIG9mIHRoZSBib3ggYXJlbid0IGNsaXBwZWQuICAqLworICBpbnQgd19oZWFkZXJfbGlu ZV9oZWlnaHQgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgaW50IHdfdGV4dF9i b3R0b21feSA9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KSAtICpoOworICBpZiAoeSA8IHdfaGVh ZGVyX2xpbmVfaGVpZ2h0KQorICAgIHsKKyAgICAgICpoID0gbWF4ICgqaCAtICh3X2hlYWRlcl9s aW5lX2hlaWdodCAtIHkpICsgMSwgKmgpOworICAgICAgeSA9IHdfaGVhZGVyX2xpbmVfaGVpZ2h0 IC0gMTsKKyAgICAgIC8vIGZwcmludGYgKHN0ZGVyciwgIkNPTkRJVElPTiAjIDFcbiIpOworICAg IH0KKyAgIGVsc2UgaWYgKHkgPiB3X3RleHRfYm90dG9tX3kpCisgICAgIHsKKyAgICAgICAqaCAr PSB5IC0gd190ZXh0X2JvdHRvbV95OworICAgICAgIHkgPSB3X3RleHRfYm90dG9tX3k7CisgICAg ICAgLy8gZnByaW50ZiAoc3RkZXJyLCAiQ09ORElUSU9OICMgMlxuIik7CisgICAgIH0KKyAgKmZ5 ID0gV0lORE9XX1RPX0ZSQU1FX1BJWEVMX1kgKHcsIHkpOworICBzd2l0Y2ggKGN1cnNvcl90eXBl KQorICAgIHsKKyAgICAgIGNhc2UgTUNfQkFSOgorICAgICAgICB7CisgICAgICAgICAgaWYgKGN1 cnNvcl93aWR0aCA8IDEpCisgICAgICAgICAgICBjdXJzb3Jfd2lkdGggPSBtYXggKEZSQU1FX0NV UlNPUl9XSURUSCAoZiksIDEpOworICAgICAgICAgIGlmIChjdXJzb3Jfd2lkdGggPCBnbHlwaC0+ cGl4ZWxfd2lkdGgpCisgICAgICAgICAgKndkID0gY3Vyc29yX3dpZHRoOworICAgICAgICAgIGJy ZWFrOworICAgICAgICB9CisgICAgICBjYXNlIE1DX0hCQVI6CisgICAgICAgIHsKKyAgICAgICAg ICBpbnQgY3Vyc29yX2hlaWdodCA9IChjdXJzb3Jfd2lkdGggPCAxKSA/IGxyaW50ICgwLjI1ICog KmgpIDogY3Vyc29yX3dpZHRoOworICAgICAgICAgIGlmIChjdXJzb3JfaGVpZ2h0ID4gcm93LT5o ZWlnaHQpCisgICAgICAgICAgICBjdXJzb3JfaGVpZ2h0ID0gcm93LT5oZWlnaHQ7CisgICAgICAg ICAgLyogQ3Vyc29yIHNtYWxsZXIgdGhhbiBsaW5lIGhlaWdodCwgc28gbW92ZSBkb3duLiAqLwor ICAgICAgICAgIGlmICgqaCA+IGN1cnNvcl9oZWlnaHQpCisgICAgICAgICAgICAqZnkgKz0gKmgg LSBjdXJzb3JfaGVpZ2h0OworICAgICAgICAgICpoID0gY3Vyc29yX2hlaWdodDsKKyAgICAgICAg ICAqd2QgPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0K KyAgICAgIGNhc2UgTUNfUklHSFRfRlJJTkdFX0JJVE1BUDoKKyAgICAgIGNhc2UgTUNfTEVGVF9G UklOR0VfQklUTUFQOgorICAgICAgY2FzZSBNQ19OT19GUklOR0VfQklUTUFQOgorICAgICAgY2Fz ZSBNQ19OT19DVVJTT1I6CisgICAgICBjYXNlIE1DX0ZSQU1FRF9CT1g6CisgICAgICBjYXNlIE1D X0ZJTExFRF9CT1g6CisgICAgICBjYXNlIE1DX0hPTExPV19CT1g6CisgICAgICBkZWZhdWx0Ogor ICAgICAgLyogQ29tcHV0ZSB0aGUgd2lkdGggb2YgdGhlIHJlY3RhbmdsZSB0byBkcmF3LiAgSWYg b24gYSBzdHJldGNoIGdseXBoLCBhbmQKKyAgICAgIGB4LXN0cmV0Y2gtY3Vyc29yJyBpcyBuaWws IGRvbid0IGRyYXcgYSByZWN0YW5nbGUgYXMgd2lkZSBhcyB0aGUgZ2x5cGgsIGJ1dAorICAgICAg dXNlIGEgY2Fub25pY2FsIGNoYXJhY3RlciB3aWR0aCBpbnN0ZWFkLiAqLworICAgICAgKndkID0g KGdseXBoLT50eXBlID09IFNUUkVUQ0hfR0xZUEgKKyAgICAgICAgICAgICAmJiAheF9zdHJldGNo X2N1cnNvcl9wKQorICAgICAgICAgICAgPyBtaW4gKEZSQU1FX0NPTFVNTl9XSURUSCAoZiksIGds eXBoLT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgIDogZ2x5cGgtPnBpeGVsX3dpZHRoOworICAg IH0KKy8qCisgICAgICBmcHJpbnRmIChzdGRlcnIsICJjdXJzb3Jfd2lkdGg6ICglZCkgfCB4ICgl ZCkgfCAqZnggKCVkKSB8IHkgKCVkKSB8ICpmeSAoJWQpLCAqd2QgKCVkKSB8ICpoICglZClcbiIs CisgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgeCwgKmZ4LCB5LCAqZnksICp3 ZCwgKmgpOworKi8KK30KKwordm9pZAorbWNfZW5naW5lIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1 Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKKyAgICAgICAg ICAgc3RydWN0IGdseXBoICpnbHlwaCwgaW50IGFyZWEsIGludCByZWxhdGl2ZV94LCBpbnQgeF9s aW1pdCwgaW50IHksCisgICAgICAgICAgIGludCBocG9zLCBpbnQgdnBvcywgZW51bSBtY19jdXJz b3JfdHlwZSBjdXJzb3JfdHlwZSwgaW50IGN1cnNvcl93aWR0aCwKKyAgICAgICAgICAgc3RydWN0 IGdseXBoX21hdHJpeCAqY3Vyc29yX21hdHJpeCwgc3RydWN0IG1jX2Vzc2VudGlhbHMgZXNzZW50 aWFscywKKyAgICAgICAgICAgZW51bSBtY19yb3dfcG9zaXRpb24gcm93X3Bvc2l0aW9uLCBzdHJ1 Y3QgbWNfUkdCIGZvcmVncm91bmQsCisgICAgICAgICAgIGVudW0gbWNfZW5naW5lX3R5cGUgYWN0 aW9uX3R5cGUsIGJvb2wgZHJhd19wLAorICAgICAgICAgICBlbnVtIG1jX2RyYXdfcm93X3R5cGUg ZnJvbV93aGVyZSwgZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUpCit7CisgIGludCBvcG9p bnRfeCA9IHctPmN1cnNvci54OworICBpbnQgb3BvaW50X3kgPSB3LT5jdXJzb3IueTsKKyAgaW50 IG9wb2ludF9ocG9zID0gdy0+Y3Vyc29yLmhwb3M7CisgIGludCBvcG9pbnRfdnBvcyA9IHctPmN1 cnNvci52cG9zOworICBpbnQgZngsIGZ5LCBoLCB3ZDsKKyAgbWNfZ2V0X2N1cnNvcl9nZW9tZXRy eSAodywgbWF0cml4LCByb3csIHJlbGF0aXZlX3gsICZmeCwgeSwgJmZ5LCBocG9zLCB2cG9zLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAmaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwg JndkKTsKKyAgaW50IG9wb2ludF9meCA9IFdJTkRPV19URVhUX1RPX0ZSQU1FX1BJWEVMX1ggKHcs IG9wb2ludF94KTsKKyAgaW50IGZjX2Z4ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAo dywgZXNzZW50aWFscy5mY194KTsKKyAgYm9vbCBnbHlwaF96dl9wID0gKGdseXBoIC0gcm93LT5n bHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAg ICAgICAmJiBNQVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpID09IFpWKTsKKyAgc3RydWN0IGZy YW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVS ICh3LT5jb250ZW50cyk7CisgIGludCB0ZXh0X2FyZWFfd2lkdGggPSB3aW5kb3dfYm94X3dpZHRo ICh3LCBURVhUX0FSRUEpOworICBzdHJ1Y3QgZ2x5cGhfcm93ICpjdXJzb3Jfcm93ID0gKHctPmN1 cnNvci52cG9zICE9IC0xKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRS SVhfUk9XIChjdXJzb3JfbWF0cml4LCB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogTlVMTDsKKyAgc3RydWN0IGdseXBoICpjdXJzb3JfZ2x5cGggPSAo dy0+Y3Vyc29yLnZwb3MgIT0gLTEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBt Y19nZXRfY3Vyc29yX2dseXBoICh3LCBjdXJzb3JfbWF0cml4LCBjdXJzb3Jfcm93LAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29y Lmhwb3MsIHctPmN1cnNvci52cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog TlVMTDsKKyAgYm9vbCBjdXJzb3JfYXRfZnJpbmdlX3AgPSAoY3Vyc29yX2dseXBoID09IE5VTEwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3JvdyAhPSBOVUxMCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID09IGN1cnNvcl9yb3ct PnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jf cm93LT5leGFjdF93aW5kb3dfd2lkdGhfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHctPmN1cnNvci54ID09IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA9PSBjdXJzb3Jfcm93LT5waXhlbF93aWR0aCk7Cisg IGJvb2wgY3Vyc29yX2JleW9uZF9mcmluZ2VfcCA9IChjdXJzb3JfZ2x5cGggPT0gTlVMTAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3JvdyAhPSBOVUxMCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBjdXJzb3Jf cm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm ICFjdXJzb3Jfcm93LT5leGFjdF93aW5kb3dfd2lkdGhfbGluZV9wCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA+PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IGN1cnNvcl9yb3ct PnBpeGVsX3dpZHRoKTsKKyAgaW50IGZyYW1lX2NoYXJfd2lkdGggPSBGUkFNRV9DT0xVTU5fV0lE VEggKGYpOworICBpbnQgdGVtcF9mYWNlX2lkID0gZ2x5cGgtPmZhY2VfaWQ7CisgIHN0cnVjdCBt Y19SR0IgYmFja2dyb3VuZDsKKyAgbWNfc2V0X2xzbF9iZyAodywgdGVtcF9mYWNlX2lkLCAmYmFj a2dyb3VuZCk7CisgIGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKG9wb2ludF94ID09IHJlbGF0 aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X2hwb3MgPT0gaHBv cworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeSA9PSByb3ctPnkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3Zwb3MgPT0gdnBvcyk7CisKKy8q IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgIEJFR0lOOiAg Q0hBUl9HTFlQSCB8IEdMWVBITEVTU19HTFlQSCAgICAgICAgICAgICAgICAgICovCisvKiAtLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0gKi8KKyAgaWYgKGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAg IHx8IGdseXBoLT50eXBlID09IEdMWVBITEVTU19HTFlQSCkKKyAgeworICAgIGlmIChtY19zdGRl cnJfcCkKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIlxuICU1InBEImQvJS01ZCAl NWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUxLjFkICAlM2QgJXMgJXNcbiIs CisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ct PnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJl bGF0aXZlX3gsCisgICAgICAgIChnbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAgICA/ ICdDJworICAgICAgICAgOiAnRycpLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAg KEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICA/ICdCJworICAgICAgICAgOiAoU1RS SU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgICA6IChO SUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgICAgPyAnMCcKKyAgICAgICAgICAgICAg IDogJy0nKSkpLAorICAgICAgICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgIGds eXBoLT51LmNoLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRf Ym94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGds eXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgIG1jX2NoYXJfdG9f c3RyaW5nIChnbHlwaC0+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aCwgcm93X3Bvc2l0aW9uLAorICAgICAgICAgICAgICAg ICAgIGZvcmVncm91bmQsIGJhY2tncm91bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBI TEVTUywKKyAgICAgICAgICAgICAgICAgICBkcmF3X3AsIGZyb21fd2hlcmUsIGNhY2hlX3R5cGUs IGFjdGlvbl90eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LSAqLworLyogICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIENIQVJfR0xZUEggfCBHTFlQ SExFU1NfR0xZUEggICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8K KyAgICBjYXNlIFZFUlRJQ0FMX1JVTEVSOgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGds eXBoX2ZsYXZvciA9IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiByb3ctPmNvbnRpbnVlZF9wKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+Y29udGludWVkX3AKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9y aWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJ Q0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0 X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ct PnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNB TF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog KGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXSAhPSAxCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJU SUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoIC0g cm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeCA+PSByb3ctPnBpeGVsX3dp ZHRoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVT UworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfenZfcCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfR0xZUEg7CisgICAgICBpZiAoZ2x5 cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGds eXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAg ICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAg ICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICB8fCBnbHlw aF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICBjdXJzb3JfdHlw ZSA9IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA7CisgICAgICB3ZCA9IDE7CisgICAgICBtY19oZWxw ZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgb3BvaW50X2Z4LCB5LCBmeSwg aHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jf d2lkdGgsIHJvd19wb3NpdGlvbiwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAgYmFja2dy b3VuZCwgZXNzZW50aWFscy5hY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCBkcmF3X3AsIGZyb21fd2hl cmUsCisgICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGJy ZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICBG SUxMX0NPTFVNTjogIENIQVJfR0xZUEggfCBHTFlQSExFU1NfR0xZUEggICAgICAgICAgICAgICAg ICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIEZJTExfQ09MVU1OOgorICAg IHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChnbHlwaCAtIHJvdy0+Z2x5 cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSByb3ctPnBpeGVsX3dpZHRo KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfenZfcCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJz KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF95ID09IHkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF92cG9zID09IHZwb3MpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgd2QgPSAxOwor ICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZjX2Z4 LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBl LCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAg ICAgYmFja2dyb3VuZCwgZXNzZW50aWFscy5hY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCBkcmF3X3As IGZyb21fd2hlcmUsCisgICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsK KyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2Ug Q1VSU09SX0lORElDQVRPUjoKKyAgICB7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0gKi8KKyAgfQorICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAg ICAgICAgICAgICAgICAgICAgICAgRU5EOiAgQ0hBUl9HTFlQSCB8IEdMWVBITEVTU19HTFlQSCAg ICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisKKy8qIC0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJFR0lOOiAg U1RSRVRDSF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0gKi8KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gU1RSRVRDSF9HTFlQSCkKKyAg eworICAgIGlmIChtY19zdGRlcnJfcCkKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAg IlxuICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4xZCUx LjFkICAlM2QgJXMgJXNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVB XSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFd IC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdTJywKKyAgICAgICAgZ2x5cGgt PmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAn QicKKyAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdT JworICAgICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdC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uX3R5cGUpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgIEhPUklaT05UQUxfUlVMRVI6 ICBTVFJFVENIX0dMWVBIICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLSAqLworICAgIGNhc2UgSE9SSVpPTlRBTF9SVUxFUjoKKyAgICB7CisgICAgICBpZiAocmVs YXRpdmVfeCA8IHJvdy0+cGl4ZWxfd2lkdGgKKyAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNv cl9wKQorICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVf eCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJz b3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAg ICAgICAgICAgICAgYmFja2dyb3VuZCwgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEgsIGRy YXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgICBjYWNoZV90eXBlLCBhY3Rpb25f dHlwZSk7CisgICAgICBpZiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+ dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiByZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAg ICAgIHsKKyAgICAgICAgICBpZiAocmVsYXRpdmVfeCA8IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAg ICAgICAgICB7CisgICAgICAgICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRo OworICAgICAgICAgICAgICBmeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICB9 CisgICAgICAgICAgdGVtcF9mYWNlX2lkID0gKHJvdy0+ZmlsbF9saW5lX3ApCisgICAgICAgICAg ICAgICAgICAgICAgICAgPyBnbHlwaC0+ZmFjZV9pZAorICAgICAgICAgICAgICAgICAgICAgICAg IDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAgIHN0cnVjdCBtY19SR0IgYmFja2dyb3VuZDsK KyAgICAgICAgICBtY19zZXRfbHNsX2JnICh3LCB0ZW1wX2ZhY2VfaWQsICZiYWNrZ3JvdW5kKTsK KyAgICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwg ZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgeF9saW1pdCAtIHJl bGF0aXZlX3gsIGgsIGN1cnNvcl90eXBlLCB4X2xpbWl0IC0gcmVsYXRpdmVfeCwKKyAgICAgICAg ICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwgZXNzZW50 aWFscy5hY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgIE1DX0dMWVBITEVTUywgZHJhd19w LCBmcm9tX3doZXJlLCBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICAgIH0KKyAgICAg IGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAg ICAgICAgICAgICAgIFZFUlRJQ0FMX1JVTEVSOiAgU1RSRVRDSF9HTFlQSCAgICAgICAgICAgICAg ICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIFZFUlRJQ0FMX1JV TEVSOgorICAgIHsKKyAgICAgIGlmIChyb3ctPmZpbGxfbGluZV9wCisgICAgICAgICAgJiYgZ2x5 cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAg ICAgICAmJiBvcG9pbnRfeCA+IHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAg ICAgIHRlbXBfZmFjZV9pZCA9IGdseXBoLT5mYWNlX2lkOworICAgICAgICBlbHNlIGlmICghcm93 LT5maWxsX2xpbmVfcAorICAgICAgICAgICAgICAgICAmJiBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RF WFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAmJiBvcG9p bnRfeCA+IHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgdGVtcF9m YWNlX2lkID0gREVGQVVMVF9GQUNFX0lEOworICAgICAgc3RydWN0IG1jX1JHQiBiYWNrZ3JvdW5k OworICAgICAgbWNfc2V0X2xzbF9iZyAodywgdGVtcF9mYWNlX2lkLCAmYmFja2dyb3VuZCk7Cisg ICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoY3Vyc29yX2F0X2ZyaW5nZV9wCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT5jb250aW51ZWRfcCkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJf QkFDS1NMQVNICisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3Jf YXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFy b3ctPmNvbnRpbnVlZF9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJp bmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1 bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJF QV0gIT0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+ dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID8gTUNfUkVWRVJTRURfVk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AgICAgICBCRUdJ TjogIElNQUdFX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0gKi8KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisg IHsKKyAgICBpZiAobWNfc3RkZXJyX3ApCisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAg ICJcbiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQl MS4xZCAgJTNkICVzICVjXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJF QV0sCisgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVh XSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAnSScsCisgICAgICAgIGdseXBo LT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8g J0InCisgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAn UycKKyAgICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICA/ ICcwJworICAgICAgICAgICAgICAgOiAnLScpKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0 aCwKKyAgICAgICAgKHVuc2lnbmVkIGludCkgZ2x5cGgtPnUuaW1nX2lkLAorICAgICAgICBnbHlw aC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5 cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9zLCBnbHlw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qLworICBl bHNlIGlmIChnbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpCisgIHsKKyAgICBpZiAobWNf c3RkZXJyX3ApCisgICAgICB7CisgICAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgICAi XG4gJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNngiLAorICAgICAgICAg IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAgICAgICAoKHJvdy0+dXNlZFth cmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgICByZWxhdGl2 ZV94LAorICAgICAgICAgICcrJywKKyAgICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAg ICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgPyAnQicKKyAgICAgICAgICAg OiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgPyAnUycKKyAgICAgICAg ICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgICAgPyAnMCcKKyAg ICAgICAgICAgICAgICAgOiAnLScpKSksCisgICAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAor ICAgICAgICAgICh1bnNpZ25lZCBpbnQpIGdseXBoLT51LmNtcC5pZCk7CisgICAgICAgIGZwcmlu dGYgKHN0ZGVyciwgIiAlNGQgJTEuMWQlMS4xZCIsCisgICAgICAgICAgZ2x5cGgtPmZhY2VfaWQs CisgICAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgICBnbHlwaC0+cmln aHRfYm94X2xpbmVfcCk7CisgICAgICBpZiAoZ2x5cGgtPnUuY21wLmF1dG9tYXRpYykKKyAgICAg ICAgZnByaW50ZiAoc3RkZXJyLCAiICAlM2QgJXMgLiBbJWQtJWRdXG4iLA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Ag ICAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4 LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICB3ZCwgaCwgY3Vy c29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcm93X3Bvc2l0aW9uLCBmb3JlZ3JvdW5kLAorICAgICAg ICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dM WVBITEVTUywgZHJhd19wLAorICAgICAgICAgICAgICAgICAgICAgICAgIGZyb21fd2hlcmUsIGNh Y2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgICAgICAgICAgcmVsYXRpdmVfeCArPSBmcmFt ZV9jaGFyX3dpZHRoOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBicmVhazsKKyAg ICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAg IFZFUlRJQ0FMX1JVTEVSOiAgQ09NUE9TSVRFX0dMWVBIICAgICAgICAgICAgICAgICAgICAqLwor LyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBWRVJUSUNBTF9SVUxFUjoKKyAgICB7 CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoY3Vyc29yX2F0X2ZyaW5nZV9w CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT5jb250aW51ZWRf cCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9C QVJfQkFDS1NMQVNICisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJz b3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm ICFyb3ctPmNvbnRpbnVlZF9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJS T1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRf ZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+ dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93LT51c2VkW1RFWFRf QVJFQV0gIT0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJv dy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51 c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg b3BvaW50X3ggPj0gcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogKGdseXBoX3p2X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IE1DX0dMWVBIOworICAgICAgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklH SFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElD QUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJ Q0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElD QUxfQkFSCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FM X0JBUikKKyAgICAgICAgY3Vyc29yX3R5cGUgPSBNQ19SSUdIVF9GUklOR0VfQklUTUFQOworICAg ICAgd2QgPSAxOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0 aXZlX3gsIG9wb2ludF9meCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdk LCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQs CisgICAgICAgICAgICAgICAgIGJhY2tncm91bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsIGdseXBo X2ZsYXZvciwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICBjYWNoZV90eXBl LCBhY3Rpb25fdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICBGSUxMX0NPTFVNTjogIENPTVBPU0lU RV9HTFlQSCAgICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICov CisgICAgY2FzZSBGSUxMX0NPTFVNTjoKKyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlw aF9mbGF2b3IgPSAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFth cmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBlc3NlbnRp YWxzLmZjX3ggPiByZWxhdGl2ZV94KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiAoZ2x5cGhfenZfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBN Q19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKCFOSUxQ IChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX3ZlcnRpY2Fs X3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2lu dF95ID09IHkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2lu dF92cG9zID09IHZwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g TUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0dM WVBIOworICAgICAgd2QgPSAxOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5 cGgsIHJlbGF0aXZlX3gsIGZjX2Z4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAg ICAgd2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgZm9yZWdy b3VuZCwKKyAgICAgICAgICAgICAgICAgYmFja2dyb3VuZCwgZXNzZW50aWFscy5hY3RpdmVfcCwg Z2x5cGhfZmxhdm9yLCBkcmF3X3AsIGZyb21fd2hlcmUsCisgICAgICAgICAgICAgICAgIGNhY2hl X3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLSAqLworICAgIGNhc2UgQ1VSU09SX0lORElDQVRPUjoKKyAgICB7CisgICAgICBicmVh azsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tL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FyZWFdID09IDApID8gMCA6IHJvdy0+ dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxhdGl2ZV94LAorICAgICAgICAnWCcsCisgICAg ICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAg ICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAg ICAgICAgPyAnUycKKyAgICAgICAgICAgIDogJy0nKSksCisgICAgICAgIGdseXBoLT5waXhlbF93 aWR0aCwKKyAgICAgICAgZ2x5cGgtPmZhY2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9s aW5lX3AsCisgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+ dS54d2lkZ2V0LAorICAgICAgICBnbHlwaC0+aHBvcywgZ2x5cGhfenZfcCA/ICJaViIgOiAiLS0i LAorICAgICAgICAnLicpOworI2VuZGlmCisgIHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsKKy8q IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICBNVUxUSVBM RV9DVVJTT1JTOiAgWFdJREdFVF9HTFlQSCAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIE1VTFRJUExFX0NVUlNPUlM6CisgICAgeworICAg ICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gsIGZ4LCB5LCBm eSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgIC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aGVfdHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAgaWYgKGdseXBoIC0gcm93LT5nbHlwaHNbVEVY VF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgJiYgcmVsYXRpdmVfeCA8 PSB4X2xpbWl0KQorICAgICAgICB7CisgICAgICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4 ZWxfd2lkdGg7CisgICAgICAgICAgd2hpbGUgKHJlbGF0aXZlX3ggPD0geF9saW1pdCkKKyAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgs IHJlbGF0aXZlX3gsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAg ICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcm93X3Bvc2l0aW9uLCBmb3Jl Z3JvdW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQsIGVzc2VudGlhbHMu YWN0aXZlX3AsIE1DX0dMWVBITEVTUywgZHJhd19wLAorICAgICAgICAgICAgICAgICAgICAgICAg IGZyb21fd2hlcmUsIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgICAgICAgICAgcmVs YXRpdmVfeCArPSBmcmFtZV9jaGFyX3dpZHRoOworICAgICAgICAgICAgfQorICAgICAgICB9Cisg ICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAg ICAgICAgICAgICAgICAgICBWRVJUSUNBTF9SVUxFUjogIFhXSURHRVRfR0xZUEggICAgICAgICAg ICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBWRVJUSUNB TF9SVUxFUjoKKyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSAoY3Vy c29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg cm93LT5jb250aW51ZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNICisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmICFyb3ctPmNvbnRpbnVlZF9wCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmln aHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19WRVJUSUNB TF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog KGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9X CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5b25kX2Zy aW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jf cm93LT51c2VkW1RFWFRfQVJFQV0gIT0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgID8gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRf QVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgb3BvaW50X3ggPj0gcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX3p2X3ApCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IE1DX0dMWVBIOworICAgICAgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19W RVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNf UkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxh dm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2 b3IgPT0gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JF VkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgY3Vyc29yX3R5cGUgPSBNQ19SSUdIVF9GUklO R0VfQklUTUFQOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0 aXZlX3gsIG9wb2ludF9meCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgIHdk LCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQs CisgICAgICAgICAgICAgICAgIGJhY2tncm91bmQsIGVzc2VudGlhbHMuYWN0aXZlX3AsIGdseXBo X2ZsYXZvciwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICBjYWNoZV90eXBl LCBhY3Rpb25fdHlwZSk7CisgICAgICBicmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgRklMTF9DT0xVTU46ICBYV0lER0VU X0dMWVBIICAgICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICov CisgICAgY2FzZSBGSUxMX0NPTFVNTjoKKyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlw aF9mbGF2b3IgPSAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFth cmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBlc3NlbnRp YWxzLmZjX3ggPiByZWxhdGl2ZV94KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiAoZ2x5cGhfenZfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBN Q19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKCFOSUxQ IChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX3ZlcnRpY2Fs X3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2lu dF95ID09IHkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2lu dF92cG9zID09IHZwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8g TUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0dM WVBIOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIHJlbGF0aXZlX3gs IGZjX2Z4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNv cl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgZm9yZWdyb3VuZCwKKyAgICAgICAg ICAgICAgICAgYmFja2dyb3VuZCwgZXNzZW50aWFscy5hY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCBk cmF3X3AsIGZyb21fd2hlcmUsCisgICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90 eXBlKTsKKyAgICAgIGJyZWFrOworIC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3dfdHlwZSBmcm9tX3doZXJlKQorewor ICAvLyAgY2xvY2tfdCBjbG9ja19zdGFydCA9IGNsb2NrKCk7CisgIC8qIFczMiBFbWFjcyBjcmFz aGVzIG9uIHN0YXJ0dXAgd2l0aG91dCBhIGBCVUZGRVJQJyBjaGVjayBpbiBgdXBkYXRlX3dpbmRv dycuICovCisgIGlmICghQlVGRkVSUCAody0+Y29udGVudHMpKQorICAgIHJldHVybjsKKyAgc3Ry dWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKHctPmNvbnRlbnRzKTsKKyAgaWYgKE5JTFAgKEJWQVIg KGIsIG1jX2NvbmYpKQorICAgICAgJiYgTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAg ICAmJiBOSUxQIChCVkFSIChiLCBmY192aXNpYmxlKSkpCisgICAgcmV0dXJuOworICBzdHJ1Y3Qg Z2x5cGhfcm93ICpib3R0b21fcm93ID0gTUFUUklYX0JPVFRPTV9URVhUX1JPVyAobWF0cml4LCB3 KTsKKyAgaW50IGJvdHRvbV92cG9zID0gTUFUUklYX1JPV19WUE9TIChib3R0b21fcm93LCBtYXRy aXgpOworICBpZiAodnBvcyA9PSBib3R0b21fdnBvcykKKyAgICByZXR1cm47CisgIGlmICghcm93 LT51c2VkW1RFWFRfQVJFQV0pCisgICAgcmV0dXJuOworICBpbnQgaHBvc19zdGFydCA9IHN0YXJ0 IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgaWYgKG1jX3N0ZGVycl9wKQorICAgIGZwcmlu dGYgKHN0ZGVyciwgIm1jX2RyYXdfcm93ICglZCk6ICBkcmF3X3AgKCVzKSB8IGhwb3MgKCVkKSB8 IGxlbiAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgdnBvcywgZHJhd19wID8gInkiIDog Im4iLCBocG9zX3N0YXJ0LCBocG9zX2xlbmd0aCk7CisgIGludCBvcG9pbnRfZngsIG9wb2ludF9m eSwgb3BvaW50X3dkLCBvcG9pbnRfaDsKKyAgaW50IHRleHRfYXJlYV93aWR0aCA9IHdpbmRvd19i b3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgIGludCBoZWFkZXJfbGluZV9mb3JtYXQgPSBXSU5E T1dfSEVBREVSX0xJTkVfSEVJR0hUICh3KTsKKyAgc3RydWN0IGdseXBoX3JvdyAqY3Vyc29yX3Jv dyA9ICh3LT5jdXJzb3IudnBvcyAhPSAtMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID8gTUFUUklYX1JPVyAoY3Vyc29yX21hdHJpeCwgdy0+Y3Vyc29yLnZwb3MpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgIHN0cnVjdCBnbHlwaCAqY3Vyc29y X2dseXBoID0gKHctPmN1cnNvci52cG9zICE9IC0xKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gbWNfZ2V0X2N1cnNvcl9nbHlwaCAodywgY3Vyc29yX21hdHJpeCwgY3Vyc29yX3Jv dywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IE5VTEw7CisgIGJvb2wgY3Vyc29yX2F0X2ZyaW5nZV9wID0gKGN1cnNvcl9nbHlw aCA9PSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3cgIT0g TlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBj dXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgY3Vyc29yX3Jvdy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVfcAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA9PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gY3Vyc29yX3Jvdy0+cGl4ZWxf d2lkdGgpOworICBib29sIGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AgPSAoY3Vyc29yX2dseXBoID09 IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3cgIT0g TlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3Mg PT0gY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiAhY3Vyc29yX3Jvdy0+ZXhhY3Rfd2luZG93X3dpZHRoX2xpbmVfcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0gdGV4dF9hcmVhX3dp ZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA+PSBj dXJzb3Jfcm93LT5waXhlbF93aWR0aCk7CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgUkVQTEFDRSBUSEUgUkVBTCBDVVJTT1IKKyoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworICBlbnVtIGZhY2VfaWQgYmdfZmFjZV9pZCA9IChjdXJzb3JfZ2x5cGgg IT0gTlVMTCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGN1cnNvcl9nbHlwaC0+ZmFj ZV9pZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0l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GxzbF9m ZyA9IHsucmVkID0gLTEuMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9 IC0xLjAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IC0xLjB9OworICAg ICAgLyogV2UgdXNlIHRoZSBmaXJzdCBnbHlwaCBpbiB0aGUgcm93LCB3aXRoIGFuIFggYW5kIEhQ T1Mgb2YgemVyby4gKi8KKyAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIHJvdy0+Z2x5 cGhzW1RFWFRfQVJFQV0sIDAsIC0xLCB3LT5jdXJzb3IueSwgLTEsCisgICAgICAgICAgICAgICAg IDAsIHctPmN1cnNvci52cG9zLCAtMSwgLTEsIE1DX0xFRlRfRlJJTkdFX0JJVE1BUCwgLTEsIHJv d19wb3NpdGlvbiwKKyAgICAgICAgICAgICAgICAgbHNsX2ZnLCBjdXJzb3JfYmcsIGVzc2VudGlh bHMuYWN0aXZlX3AsIE1DX09WRVJMQVlfQVJST1dfQklUTUFQLAorICAgICAgICAgICAgICAgICBk cmF3X3AsIGZyb21fd2hlcmUsIENIX0NBQ0hFLCBDVVJTT1JfSU5ESUNBVE9SKTsKKyAgICB9Cisg IGlmIChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MK KyAgICAgICYmIHctPmN1cnNvci5ocG9zID49IGhwb3Nfc3RhcnQKKyAgICAgICYmIHctPmN1cnNv ci5ocG9zID09IGhwb3Nfc3RhcnQgKyBocG9zX2xlbmd0aAorICAgICAgJiYgIU5JTFAgKEJWQVIg KGIsIGNyb3NzaGFpcnMpKQorICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2hvcml6b250YWxf cnVsZXIpKSkKKyAgICB7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSBNQ19I T0xMT1dfUkVDVEFOR0xFOworICAgICAgc3RydWN0I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Jzb3IgbmlsLyduby8ibm8iKSAqLworICBl bHNlIGlmICghY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaCAh PSBOVUxMCisgICAgICAgICAgICYmIGN1cnNvcl90eXBlID09IE1DX05PX0NVUlNPUgorICAgICAg ICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICYmIHctPmN1cnNvci5o cG9zID49IGhwb3Nfc3RhcnQKKyAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPCBocG9zX3N0 YXJ0ICsgaHBvc19sZW5ndGgpCisgICAgeworICAgICAgLyogV2hlbiBhIHVzZXIgaGFzIG5vdCBz cGVjaWZpZWQgYSB2YWx1ZSBmb3IgYG1jLXJlYWwtZmFrZS1jdXJzb3InLCBvciB0aGUKKyAgICAg IHZhbHVlIGlzIGBub2AgaW4gdGhlIGZvcm0gb2YgYSBzeW1ib2wgb3Igc3RyaW5nLCB0aGVuIHRo ZSBkZWZhdWx0IHdlIHVzZQorICAgICAgYW4gTUNfQkFSIGFuZCBhbiBNQ19IQkFSIC0tIGJvdGgg aGF2aW5nIGEgY3Vyc29yX3dpZHRoIG9mIDEuICovCisgICAgICBtY19nZXRfY3Vyc29yX2dlb21l dHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9pbnRfZngsIHctPmN1cnNvci55 LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2ludF9meSwgdy0+Y3Vyc29yLmhw b3MsIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBNQ19CQVIsIDEsICZvcG9pbnRfd2QpOworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgs IHJvdywgY3Vyc29yX2dseXBoLCB3LT5jdXJzb3IueCwgb3BvaW50X2Z4LCB3LT5jdXJzb3IueSwK KyAgICAgICAgICAgICAgICAgb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZw b3MsIG9wb2ludF93ZCwgb3BvaW50X2gsCisgICAgICAgICAgICAgICAgIE1DX0JBUiwgMSwgcm93 X3Bvc2l0aW9uLCBjdXJzb3JfZmcsIGN1cnNvcl9iZywgZXNzZW50aWFscy5hY3RpdmVfcCwKKyAg ICAgICAgICAgICAgICAgTUNfR0xZUEhMRVNTLCBkcmF3X3AsIGZyb21fd2hlcmUsIE5JTFAgKEJW QVIgKGIsIG1jX2NvbmYpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBDSF9DQUNIRQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiBNQ19DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgICBt Y19nZXRfY3Vyc29yX2dlb21ldHJ5ICh3LCBtYXRyaXgsIHJvdywgdy0+Y3Vyc29yLngsICZvcG9p bnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9wb2lu dF9meSwgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBNQ19IQkFSLCAxLCAmb3BvaW50X3dkKTsKKyAgICAgIG1j X2hlbHBlciAodywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2lu dF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAgICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29y Lmhwb3MsIHctPmN1cnNvci52cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9oLAorICAgICAgICAgICAg ICAgICBNQ19IQkFSLCAxLCByb3dfcG9zaXRpb24sIGN1cnNvcl9mZywgY3Vyc29yX2JnLCBlc3Nl bnRpYWxzLmFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICBNQ19HTFlQSCwgZHJhd19wLCBmcm9t X3doZXJlLCBOSUxQIChCVkFSIChiLCBtY19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBDSF9DQUNIRQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX0NBQ0hFLCBDVVJTT1JfSU5ESUNBVE9SKTsK KyAgICB9CisgIGVsc2UgaWYgKCFjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgJiYgY3Vy c29yX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcwor ICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICYm IHctPmN1cnNvci5ocG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoCisgICAgICAgICAgICYm IGN1cnNvcl9nbHlwaC0+dHlwZSAhPSBTVFJFVENIX0dMWVBIKQorICAgIHsKKyAgICAgIG1jX2dl dF9jdXJzb3JfZ2VvbWV0cnkgKHcsIG1hdHJpeCwgcm93LCB3LT5jdXJzb3IueCwgJm9wb2ludF9m eCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmb3BvaW50X2Z5 LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MsICZvcG9pbnRfaCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsICZvcG9pbnRfd2Qp OworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgY3Vyc29yX2dseXBoLCB3LT5jdXJz b3IueCwgb3BvaW50X2Z4LCB3LT5jdXJzb3IueSwKKyAgICAgICAgICAgICAgICAgb3BvaW50X2Z5 LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MsIG9wb2ludF93ZCwgb3BvaW50X2gsCisg ICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwg Y3Vyc29yX2ZnLCBjdXJzb3JfYmcsCisgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZl X3AsIE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUsCisgICAgICAgICAgICAgICAgIE5JTFAg KEJWQVIgKGIsIG1jX2NvbmYpKQorICAgICAgICAgICAgICAgICA/IENIX0NBQ0hFCisgICAgICAg ICAgICAgICAgIDogTUNfQ0FDSEUsIENVUlNPUl9JTkRJQ0FUT1IpOworICAgIH0KKyAgZWxzZSBp ZiAoIWN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGggIT0gTlVM TAorICAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICYmIHct PmN1cnNvci5ocG9zID49IGhwb3Nfc3RhcnQKKyAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3Mg PCBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGgKKyAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT50 eXBlID09IFNUUkVUQ0hfR0xZUEgpCisgICAgeworICAgICAgLyogSWYgYSB1c2VyIGhhcyBzZXQg YHgtc3RyZXRjaC1jdXJzb3InIHRvIGEgbm9uLW5pbCB2YWx1ZSwgaGUvc2hlIGNob3NlIHRvCisg ICAgICBoYXZlIGEgY3Vyc29yIHRoYXQgc3BhbnMgdGhlIGVudGlyZSBsZW5ndGggb2YgdGhlIFNU UkVUQ0hfR0xZUEguICovCisgICAgICBpZiAoIXhfc3RyZXRjaF9jdXJzb3JfcCkKKyAgICAgICAg eworICAgICAgICAgIC8qIFRoZSBNQ19IQkFSIHNoYWxsIGhhdmUgYSBgY3Vyc29yX3dpZHRoYCBv ZiAxLiAqLworICAgICAgICAgIG1jX2dldF9jdXJzb3JfZ2VvbWV0cnkgKHcsIG1hdHJpeCwgcm93 LCB3LT5jdXJzb3IueCwgJm9wb2ludF9meCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICB3LT5jdXJzb3IueSwgJm9wb2ludF9meSwgdy0+Y3Vyc29yLmhwb3MsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLnZwb3MsICZvcG9pbnRfaCwgTUNfSEJB UiwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmb3BvaW50X3dkKTsKKyAg ICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1cnNv ci54LCBvcG9pbnRfZngsCisgICAgICAgICAgICAgICAgICAgICB3LT5jdXJzb3IueSwgb3BvaW50 X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MsCisgICAgICAgICAgICAgICAgICAg ICBvcG9pbnRfd2QsIG9wb2ludF9oLCBNQ19IQkFSLCAxLCByb3dfcG9zaXRpb24sIGN1cnNvcl9m ZywKKyAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9iZywgZXNzZW50aWFscy5hY3RpdmVfcCwg TUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgICAgIE5JTFAg KEJWQVIgKGIsIG1jX2NvbmYpKQorICAgICAgICAgICAgICAgICAgICAgPyBDSF9DQUNIRQorICAg ICAgICAgICAgICAgICAgICAgOiBNQ19DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgICAg IH0KKyAgICAgIG1jX2dldF9jdXJzb3JfZ2VvbWV0cnkgKHcsIG1hdHJpeCwgcm93LCB3LT5jdXJz b3IueCwgJm9wb2ludF9meCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNv ci55LCAmb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHctPmN1cnNvci52cG9zLCAmb3BvaW50X2gsIGN1cnNvcl90eXBlLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoLCAmb3BvaW50X3dkKTsKKyAgICAgIG1j X2hlbHBlciAodywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2lu dF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAgICAgICAgIG9wb2ludF9meSwgdy0+Y3Vyc29y Lmhwb3MsIHctPmN1cnNvci52cG9zLCBvcG9pbnRfd2QsIG9wb2ludF9oLAorICAgICAgICAgICAg ICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGN1cnNvcl9mZywg Y3Vyc29yX2JnLAorICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBNQ19HTFlQ SCwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICBOSUxQIChCVkFSIChiLCBt Y19jb25mKSkKKyAgICAgICAgICAgICAgICAgPyBDSF9DQUNIRQorICAgICAgICAgICAgICAgICA6 IE1DX0NBQ0hFLCBDVVJTT1JfSU5ESUNBVE9SKTsKKyAgICB9CisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgICAgRFJBVyBBTkQgUkVDT1JEIEZBS0UgQ1VS U09SUworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisgIGlmICghZXNzZW50aWFscy5hY3RpdmVf cAorICAgICAgJiYgTklMUCAoQlZBUiAoY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UgaGFzIGEgcG9zaXRpb24gdGhhdCBpcyBvbmUKKyAgICAgICAgICBsZXNzIHRoYW4gdGhlIGVu ZCBvZiB0aGUgbWF0cml4IHJvdy4gKi8KKyAgICAgICAgICBpbnQgaHBvcyA9IHN0YXJ0IC0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnByZXZpb3VzX2ds eXBoID0gKDAgPD0gaHBvcyAtIDEgJiYgaHBvcyAtIDEgPCByb3ctPnVzZWRbVEVYVF9BUkVBXSkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyByb3ctPmdseXBoc1tU RVhUX0FSRUFdICsgaHBvcyAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiBOVUxMOworICAgICAgICAgIC8vIHN0cnVjdCBnbHlwaCAqbGFzdF9nbHlwaCA9IHJv dy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDE7CisgICAgICAg ICAgYm9vbCBza2lwX3AgPSAocHJldmlvdXNfZ2x5cGggIT0gTlVMTAorICAgICAgICAgICAgICAg ICAgICAgICAgICYmIHByZXZpb3VzX2dseXBoLT5jaGFycG9zID09IE1BVFJJWF9ST1dfRU5EX0NI QVJQT1MgKHJvdykgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgc3RhcnQtPmJ5dGVw b3MgIT0gZXNzZW50aWFscy56dl9ieXRlKQorICAgICAgICAgICAgICAgICAgICAgICAgICA/IHRy dWUKKyAgICAgICAgICAgICAgICAgICAgICAgIC8qIFdoZW4gYSBgYnVmZmVyLWRpc3BsYXktdGFi bGUnIGVudHJ5IGNvbnRhaW5zCisgICAgICAgICAgICAgICAgICAgICAgICBhIHZpc2libGUgdGFi IGNoYXJhY3RlciAoIsK7IiksIHRoZSBzdWJzZXF1ZW50CisgICAgICAgICAgICAgICAgICAgICAg ICBTVFJFVENIX0dMWVBIIHdpbGwgaGF2ZSB0aGUgc2FtZSBzdGFydC0+Y2hhcnBvcworICAgICAg ICAgICAgICAgICAgICAgICAgYXMgdGhlIGFmb3JlbWVudGlvbmVkIHZpc2libGUgdGFiIGNoYXJh Y3Rlci4gKi8KKyAgICAgICAgICAgICAgICAgICAgICAgIDogKHByZXZpb3VzX2dseXBoICE9IE5V TEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHByZXZpb3VzX2dseXBoLT5jaGFycG9z ID09IHN0YXJ0LT5jaGFycG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICA/IHRydWUKKyAg ICAgICAgICAgICAgICAgICAgICAgIDogZmFsc2U7CisgICAgICAgICAgaW50IHBvc2ludCA9IChy b3dfcG9zaXRpb24gPT0gUE9TVF9aVikKKyAgICAgICAgICAgICAgICAgICAgICAgICA/IC0xCisg ICAgICAgICAgICAgICAgICAgICAgIDogKHJvd19wb3NpdGlvbiA9PSBBVF9aVikKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBlc3NlbnRpYWxzLnp2CisgICAgICAgICAgICAgICAgICAgICAg IDogKHN0YXJ0LT5ieXRlcG9zICE9IGVzc2VudGlhbHMuenZfYnl0ZQorICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2Vk W1RFWFRfQVJFQV0gLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPV19F TkRfQ0hBUlBPUyAocm93KSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgOiAoc3RhcnQtPmJ5 dGVwb3MgPT0gZXNzZW50aWFscy56dl9ieXRlCisgICAgICAgICAgICAgICAgICAgICAgICAgICYm IHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbVEVYVF9BUkVBXSAt IDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgPyBlc3NlbnRpYWxzLnp2CisgICAgICAgICAg ICAgICAgICAgICAgIDogc3RhcnQtPmNoYXJwb3M7CisgICAgICAgICAgTGlzcF9PYmplY3Qgc3Bl Y3MgPSBtY19hc3NvYyAobWFrZV9maXhudW0gKHBvc2ludCksIEJWQVIgKGIsIG1jX2NvbmYpKTsK KyAgICAgICAgICBpZiAoKChoZWFkZXJfbGluZV9mb3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAg ICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAgICYm ICFOSUxQIChzcGVjcykKKyAgICAgICAgICAgICAgJiYgcm93LT55IDw9IHdpbmRvd190ZXh0X2Jv dHRvbV95ICh3KQorICAgICAgICAgICAgICAmJiAhc2tpcF9wCisgICAgICAgICAgICAgICYmIHJv d19wb3NpdGlvbiAhPSBQT1NUX1pWKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBMaXNw X09iamVjdCBsaXNwX3R5cGUgPSBtY19udGggKDEsIHNwZWNzKTsKKyAgICAgICAgICAgICAgZW51 bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSA9IChDT05TUCAobGlzcF90eXBlKSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfbGlzcF90b19j dXJzb3JfdHlwZSAoWENBUiAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogbWNfbGlzcF90b19jdXJzb3JfdHlwZSAobGlzcF90eXBl KTsKKyAgICAgICAgICAgICAgY3Vyc29yX3R5cGUgPSAoc3RhcnQtPnR5cGUgPT0gSU1BR0VfR0xZ UEgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19IT0xMT1dfQk9YCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiBjdXJzb3JfdHlwZTsKKyAgICAgICAgICAgICAgaW50IGN1 cnNvcl93aWR0aCA9IChDT05TUCAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID8gWEZJWE5VTSAoWENBUiAoWENEUiAobGlzcF90eXBlKSkpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IC0xOworICAgICAgICAgICAgICBMaXNwX09iamVjdCBt Y19mb3JlZ3JvdW5kID0gbWNfbnRoICgyLCBzcGVjcyk7CisgICAgICAgICAgICAgIHN0cnVjdCBt Y19SR0IgbHNsX2ZnOworICAgICAgICAgICAgICBpZiAoU1RSSU5HUCAobWNfZm9yZWdyb3VuZCkp CisgICAgICAgICAgICAgICAgbWNfeHdfY29sb3JfdmFsdWVzICh3LCBtY19mb3JlZ3JvdW5kLCAm bHNsX2ZnKTsKKyAgICAgICAgICAgICAgICBlbHNlIGlmIChWRUNUT1JQIChtY19mb3JlZ3JvdW5k KSkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbHNsX2ZnLnJlZCA9 IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3JvdW5kLCAwKSk7CisgICAgICAgICAgICAgICAg ICAgIGxzbF9mZy5ncmVlbiA9IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3JvdW5kLCAxKSk7 CisgICAgICAgICAgICAgICAgICAgIGxzbF9mZy5ibHVlID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1j X2ZvcmVncm91bmQsIDIpKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAg IGVsc2UgaWYgKE5JTFAgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAgICAgICAgICAgICBtY19j b2xvcl9waWNrZXIgKHcsIHN0YXJ0LCBlc3NlbnRpYWxzLCAmbHNsX2ZnLCBwb3NpbnQsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUsIHJvd19wb3NpdGlv biwgTVVMVElQTEVfQ1VSU09SUyk7CisgICAgICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JP V19WUE9TIChyb3csIG1hdHJpeCk7CisgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gdGV4dF9h cmVhX3dpZHRoOworICAgICAgICAgICAgICBtY19lbmdpbmUgKHcsIG1hdHJpeCwgcm93LCBzdGFy dCwgVEVYVF9BUkVBLCB4LCB4X2xpbWl0LCByb3ctPnksCisgICAgICAgICAgICAgICAgICAgICAg ICAgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLCB2cG9zLCBjdXJzb3JfdHlwZSwKKyAg ICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIGN1cnNvcl9tYXRyaXgsIGVzc2Vu dGlhbHMsIHJvd19wb3NpdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBsc2xfZmcsIE1V TFRJUExFX0NVUlNPUlMsIGRyYXdfcCwgZnJvbV93aGVyZSwgTUNfQ0FDSEUpOworICAgICAgICAg ICAgfQorICAgICAgICB9CisgICAgICBpZiAoIU5JTFAgKEJWQVIgKGIsIGZjX3Zpc2libGUpKQor ICAgICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgIHx8ICghZXNz ZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGZj X2luYWN0aXZlX3dpbmRvd3MpKSkpCisgICAgICAgICAgLy8gJiYgZXNzZW50aWFscy5mY194IDw9 IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA8IHRleHRfYXJl YV93aWR0aAorICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSB3LT5tYy5sbnVtX3BpeGVs X3dpZHRoKQorICAgICAgICB7CisgICAgICAgICAgaW50IHhfbGltaXQgPSB4ICsgc3RhcnQtPnBp eGVsX3dpZHRoOworICAgICAgICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKHctPmN1cnNv ci54ID09IGVzc2VudGlhbHMuZmNfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHctPmN1cnNvci55ID09IHJvdy0+eQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID09IHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9B UkVBXQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci52 cG9zID09IHZwb3MpOworICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAgICAgICAg IG1jX2NvbG9yX3BpY2tlciAodywgc3RhcnQsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0xLCBNQ19C QVIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICByb3dfcG9zaXRpb24sIEZJTExfQ09MVU1O KTsKKyAgICAgICAgICBpZiAoeCA8IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAvLyB4 ICsgc3RhcnQtPnBpeGVsX3dpZHRoIDw9IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAm JiAoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICAg ICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAgJiYgKChzdGFydCAh PSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxCisgICAg ICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID49IHgKKyAgICAgICAgICAgICAgICAg ICAmJiBlc3NlbnRpYWxzLmZjX3ggPCB4ICsgc3RhcnQtPnBpeGVsX3dpZHRoKQorICAgICAgICAg ICAgICAgICAgfHwgKHN0YXJ0ID09IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVzZWRb VEVYVF9BUkVBXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3gg Pj0geCkpCisgICAgICAgICAgICAgICYmIHJvdy0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAo dykKKyAgICAgICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAgIG1j X2VuZ2luZSAodywgbWF0cml4LCByb3csIHN0YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGltaXQsIHJv dy0+eSwKKyAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FS RUFdLCB2cG9zLCBNQ19CQVIsIDEsCisgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRy aXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgbHNsX2ZnLAorICAgICAgICAgICAgICAgICAg ICAgICBGSUxMX0NPTFVNTiwgZHJhd19wLCBmcm9tX3doZXJlLCBGQ19DQUNIRSk7CisgICAgICAg IH0KKyAgICAgIGlmICghTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgJiYg IU5JTFAgKEJWQVIgKGIsIGNoX2hvcml6b250YWxfcnVsZXIpKQorICAgICAgICAgICYmIChlc3Nl bnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgIHx8ICghZXNzZW50aWFscy5hY3RpdmVfcAor ICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2luYWN0aXZlX3dpbmRvd3Mp KSkpCisgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgeworICAg ICAgICAgIGludCB4X2xpbWl0ID0gKHN0YXJ0ID09IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyBy b3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICA/IHRleHRf YXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgOiB4ICsgc3RhcnQtPnBpeGVsX3dp ZHRoOworICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAgICAgICAgIG1jX2NvbG9y X3BpY2tlciAodywgc3RhcnQsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0xLCBNQ19IQkFSLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgcm93X3Bvc2l0aW9uLCBIT1JJWk9OVEFMX1JVTEVSKTsK KyAgICAgICAgICAvKiBQcmVzZXJ2ZSBzdXBwb3J0IGZvciBkZWZhdWx0IGJlaGF2aW9yIHN1Y2gg dGhhdCBhIHVzZXIgbWF5CisgICAgICAgICAgc3BlY2lmeSB0aGUgaGVpZ2h0IG9mIGFuIE1DX0hC QVIsIHdoaWNoIGJlZ2lucyBpdHMgam91cm5leQorICAgICAgICAgIGFzIHRoZSBgY3Vyc29yX3dp ZHRoJy4gIGBtY19nZXRfY3Vyc29yX2dlb21ldHJ5JyByZWFkanVzdHMuICovCisgICAgICAgICAg bWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgc3RhcnQsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwg cm93LT55LAorICAgICAgICAgICAgICAgICAgICAgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FS RUFdLCB2cG9zLCBNQ19IQkFSLCAxLAorICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJp eCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBsc2xfZmcsCisgICAgICAgICAgICAgICAgICAg ICBIT1JJWk9OVEFMX1JVTEVSLCBkcmF3X3AsIGZyb21fd2hlcmUsIENIX0NBQ0hFKTsKKyAgICAg ICAgfQorICAgICAgaWYgKCFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAm JiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICYmIChlc3Nl bnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgIHx8ICghZXNzZW50aWFscy5hY3RpdmVfcAor ICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2luYWN0aXZlX3dpbmRvd3Mp KSkpCisgICAgICAgICAgJiYgIWZpbGxfY29sdW1uX3RydW1wc19wKQorICAgICAgICB7CisgICAg ICAgICAgY3Vyc29yX3R5cGUgPSAoc3RhcnQtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgICAgICAg ICAgICAgICAgICAgICAgICA/IE1DX0hPTExPV19CT1gKKyAgICAgICAgICAgICAgICAgICAgICAg IDogTUNfQkFSOworICAgICAgICAgIGludCB4X2xpbWl0ID0gdGV4dF9hcmVhX3dpZHRoOworICAg ICAgICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKHctPmN1cnNvci55ID09IHJvdy0+eQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci52cG9zID09 IHZwb3MpOworICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAgICAgICAgIG1jX2Nv bG9yX3BpY2tlciAodywgc3RhcnQsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0xLCBjdXJzb3JfdHlw ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgVkVSVElDQUxfUlVM RVIpOworICAgICAgICAgIGlmICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDAp CisgICAgICAgICAgICAgICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAg ICAgJiYgKChzdGFydCAhPSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93LT51c2VkW1RFWFRf QVJFQV0gLSAxCisgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0geAorICAgICAg ICAgICAgICAgICAgICYmIHctPmN1cnNvci54IDwgeCArIHN0YXJ0LT5waXhlbF93aWR0aCkKKyAg ICAgICAgICAgICAgICAgIHx8IChzdGFydCA9PSByb3ctPmdseXBoc1tURVhUX0FSRUFdICsgcm93 LT51c2VkW1RFWFRfQVJFQV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29y LnggPj0geCkpCisgICAgICAgICAgICAgICYmIHJvdy0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21f eSAodykKKyAgICAgICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3JfcCkKKyAgICAgICAgICAg IG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIHN0YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGltaXQs IHJvdy0+eSwKKyAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgLSByb3ctPmdseXBoc1tURVhU X0FSRUFdLCB2cG9zLCBjdXJzb3JfdHlwZSwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgY3Vy c29yX21hdHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBsc2xfZmcsCisgICAgICAgICAg ICAgICAgICAgICAgIFZFUlRJQ0FMX1JVTEVSLCBkcmF3X3AsIGZyb21fd2hlcmUsIENIX0NBQ0hF KTsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgICB7CisgICAgICAgIGludCByZWxh dGl2ZV94ID0gMDsKKyAgICAgICAgZm9yIChpbnQgYXJlYSA9IExFRlRfTUFSR0lOX0FSRUE7IGFy ZWEgPCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBzdHJ1Y3Qg Z2x5cGggKmdseXBoID0gcm93LT5nbHlwaHNbYXJlYV07CisgICAgICAgICAgICBzdHJ1Y3QgZ2x5 cGggKmdseXBoX2VuZCA9IGdseXBoICsgcm93LT51c2VkW2FyZWFdOworICAgICAgICAgICAgLyog R2x5cGggZm9yIGEgbGluZSBlbmQgaW4gdGV4dC4gKi8KKyAgICAgICAgICAgIGlmIChhcmVhID09 IFRFWFRfQVJFQSAmJiBnbHlwaCA9PSBnbHlwaF9lbmQgJiYgZ2x5cGgtPmNoYXJwb3MgPiAwKQor ICAgICAgICAgICAgICArK2dseXBoX2VuZDsKKyAgICAgICAgICAgIGZvciAoOyBnbHlwaCA8IGds eXBoX2VuZDsgKytnbHlwaCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmICh2 cG9zICE9IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICAgICAgICAgICYmIGdseXBoICE9IGds eXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194IDwgcmVs YXRpdmVfeAorICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA8IHJlbGF0aXZlX3gK KyAgICAgICAgICAgICAgICAgICAgJiYgTklMUCAoQlZBUiAoYiwgbWNfY29uZikpKQorICAgICAg ICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgaWYgKCFOSUxQIChCVkFSIChiLCBt Y19jb25mKSkKKyAgICAgICAgICAgICAgICAgICAgJiYgKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAg ICAgICAgICAgICAgICAgICAgICAgIHx8ICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBtY19pbmFjdGl2ZV93aW5kb3dz KSkpKSkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLyogVGhlIHNw YWNlIGFwcGVuZGVkIHRvIGEgcm93IGVuZGluZyB3aXRoIGEgbmV3IGxpbmUgZG9lcworICAgICAg ICAgICAgICAgICAgICBub3QgaGF2ZSBhIGBnbHlwaC0+Y2hhcnBvc2AgKC0xLCAwKSB0aGF0IHdl IGNhbiB1c2UgZm9yIHRoaXMKKyAgICAgICAgICAgICAgICAgICAgcGFydGljdWxhciBhcHBsaWNh dGlvbi4gIFdoZW4gYSBgYnVmZmVyLWRpc3BsYXktdGFibGUnIGVudHJ5CisgICAgICAgICAgICAg ICAgICAgIGFzc2lnbnMgYSB2aXNpYmxlIGdseXBoIHRvIGEgbmV3IGxpbmUsIHRoZXJlIGlzIG5v IHByb2JsZW0KKyAgICAgICAgICAgICAgICAgICAgYmVjYXVzZSB0aGF0IGdseXBoIGhhcyBhIGBn bHlwaC0+Y2hhcnBvcycgdGhhdCB3ZSBjYW4gdXNlLgorICAgICAgICAgICAgICAgICAgICBXaGVu IG5vIHZpc2libGUgRU9MIGdseXBoIGV4aXN0cywgd2UgdXNlIHRoZSBmb2xsb3dpbmcgdGVzdDoK KyAgICAgICAgICAgICAgICAgICAgdGhlIGFwcGVuZGVkIHNwYWNlIGhhcyBhIHBvc2l0aW9uIHRo YXQgaXMgb25lIGxlc3MgdGhhbiB0aGUKKyAgICAgICAgICAgICAgICAgICAgZW5kIG9mIHRoZSBt YXRyaXggcm93LiAqLworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoICpw cmV2aW91c19nbHlwaCA9ICgwIDw9IGhwb3MgLSAxICYmIGhwb3MgLSAxIDwgcm93LT51c2VkW1RF WFRfQVJFQV0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyBocG9zIC0gMQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOVUxMOworICAgICAgICAgICAg ICAgICAgICAvLyBzdHJ1Y3QgZ2x5cGggKmxhc3RfZ2x5cGggPSByb3ctPmdseXBoc1tURVhUX0FS RUFdICsgcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxOworICAgICAgICAgICAgICAgICAgICBib29s IHNraXBfcCA9IChwcmV2aW91c19nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHByZXZpb3VzX2dseXBoLT5jaGFycG9zID09IE1BVFJJWF9ST1dfRU5E X0NIQVJQT1MgKHJvdykgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IGdseXBoLT5ieXRlcG9zICE9IGVzc2VudGlhbHMuenZfYnl0ZSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gdHJ1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIC8qIFdoZW4gYSBgYnVmZmVyLWRpc3BsYXktdGFibGUnIGVudHJ5IGNvbnRhaW5zCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYSB2aXNpYmxlIHRhYiBjaGFyYWN0ZXIgKCLC uyIpLCB0aGUgc3Vic2VxdWVudAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNU UkVUQ0hfR0xZUEggd2lsbCBoYXZlIHRoZSBzYW1lIGdseXBoLT5jaGFycG9zCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgYXMgdGhlIGFmb3JlbWVudGlvbmVkIHZpc2libGUgdGFi IGNoYXJhY3Rlci4gKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChwcmV2 aW91c19nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgcHJldmlvdXNfZ2x5cGgtPmNoYXJwb3MgPT0gZ2x5cGgtPmNoYXJwb3MpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IHRydWUKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBpbnQgcG9zaW50ID0gKHJv d19wb3NpdGlvbiA9PSBQT1NUX1pWKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IC0xCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChyb3dfcG9zaXRpb24g PT0gQVRfWlYpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGVzc2VudGlh bHMuenYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoLT5ieXRlcG9z ICE9IGVzc2VudGlhbHMuenZfYnl0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFtURVhUX0FS RUFdIC0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9X X0VORF9DSEFSUE9TIChyb3cpIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiAoZ2x5cGgtPmJ5dGVwb3MgPT0gZXNzZW50aWFscy56dl9ieXRlCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0g cm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IGVzc2VudGlhbHMuenYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog Z2x5cGgtPmNoYXJwb3M7CisgICAgICAgICAgICAgICAgICAgIExpc3BfT2JqZWN0IHNwZWNzID0g bWNfYXNzb2MgKG1ha2VfZml4bnVtIChwb3NpbnQpLCBCVkFSIChiLCBtY19jb25mKSk7CisgICAg ICAgICAgICAgICAgICAgIGlmICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDAp CisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisg ICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoc3BlY3MpCisgICAgICAgICAgICAgICAg ICAgICAgICAmJiByb3ctPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpCisgICAgICAgICAg ICAgICAgICAgICAgICAmJiAhc2tpcF9wCisgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3df cG9zaXRpb24gIT0gUE9TVF9aVikKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAg ICAgICAgICAgICAgICBMaXNwX09iamVjdCBsaXNwX3R5cGUgPSBtY19udGggKDEsIHNwZWNzKTsK KyAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUg PSAoQ09OU1AgKGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBtY19saXNwX3RvX2N1cnNvcl90eXBlIChYQ0FSIChs aXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogbWNfbGlzcF90b19jdXJzb3JfdHlwZSAobGlzcF90eXBlKTsKKyAgICAg ICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlID0gKGdseXBoLT50eXBlID09IElNQUdFX0dM WVBIKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0hPTExPV19C T1gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBjdXJzb3JfdHlwZTsK KyAgICAgICAgICAgICAgICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGggPSAoQ09OU1AgKGxpc3Bf dHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBYRklY TlVNIChYQ0FSIChYQ0RSIChsaXNwX3R5cGUpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IC0xOworICAgICAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmpl Y3QgbWNfZm9yZWdyb3VuZCA9IG1jX250aCAoMiwgc3BlY3MpOworICAgICAgICAgICAgICAgICAg ICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAo U1RSSU5HUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX3h3 X2NvbG9yX3ZhbHVlcyAodywgbWNfZm9yZWdyb3VuZCwgJmxzbF9mZyk7CisgICAgICAgICAgICAg ICAgICAgICAgICAgIGVsc2UgaWYgKFZFQ1RPUlAgKG1jX2ZvcmVncm91bmQpKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxzbF9m Zy5yZWQgPSBYRkxPQVRfREFUQSAoQVJFRiAobWNfZm9yZWdyb3VuZCwgMCkpOworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgbHNsX2ZnLmdyZWVuID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1j X2ZvcmVncm91bmQsIDEpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxzbF9mZy5i bHVlID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDIpKTsKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAo TklMUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtY19j b2xvcl9waWNrZXIgKHcsIGdseXBoLCBlc3NlbnRpYWxzLCAmbHNsX2ZnLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpbnQsIGN1cnNvcl90eXBlLCBy b3dfcG9zaXRpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIE1VTFRJUExFX0NVUlNPUlMpOworICAgICAgICAgICAgICAgICAgICAgICAgaW50IHZwb3Mg PSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgICAgICAgICAgICAgICAgICAgICAg IGludCB4X2xpbWl0ID0gdGV4dF9hcmVhX3dpZHRoOworICAgICAgICAgICAgICAgICAgICAgICAg bWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIGFyZWEsIHJlbGF0aXZlX3gsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHhfbGltaXQsIHJvdy0+eSwgZ2x5cGggLSBy b3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICB2cG9zLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBjdXJzb3JfbWF0cml4LAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGxz bF9mZywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTVVMVElQTEVfQ1VSU09S UywgZHJhd19wLCBmcm9tX3doZXJlLCBNQ19DQUNIRSk7CisgICAgICAgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICghTklMUCAoQlZBUiAo YiwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgICAgICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2 ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICB8fCAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgZmNfaW5hY3RpdmVf d2luZG93cykpKSkKKyAgICAgICAgICAgICAgICAgICAgLy8gJiYgZXNzZW50aWFscy5mY194IDw9 IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3gg PCB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194 ID49IHctPm1jLmxudW1fcGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAg ICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gdGV4dF9hcmVhX3dpZHRoOworICAgICAgICAgICAg ICAgICAgICBib29sIHJlYWxfZmFrZV9jdXJzb3JfcCA9ICh3LT5jdXJzb3IueCA9PSBlc3NlbnRp YWxzLmZjX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgdy0+Y3Vyc29yLnkgPT0gcm93LT55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID09IGdseXBoIC0gcm93LT5nbHlwaHNb VEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiB3LT5jdXJzb3IudnBvcyA9PSB2cG9zKTsKKyAgICAgICAgICAgICAgICAgICAgaW50IGhw b3MgPSBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICAgICAgICAgICAgICAg IHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAgICAgICAgICAgICAgICAgICBtY19jb2xvcl9waWNr ZXIgKHcsIGdseXBoLCBlc3NlbnRpYWxzLCAmbHNsX2ZnLCAtMSwgTUNfQkFSLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgRklMTF9DT0xVTU4pOwor ICAgICAgICAgICAgICAgICAgICBpZiAoaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICAg ICAgICAgICAgICAmJiBocG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoCisgICAgICAgICAg ICAgICAgICAgICAgICAvLyAmJiByZWxhdGl2ZV94ICsgZ2x5cGgtPnBpeGVsX3dpZHRoIDw9IHRl eHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgcmVsYXRpdmVfeCA8IHRl eHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKChoZWFkZXJfbGluZV9m b3JtYXQgPiAwICYmIHZwb3MgPiAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGhl YWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgKChnbHlw aCAhPSBnbHlwaF9lbmQgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGVzc2Vu dGlhbHMuZmNfeCA+PSByZWxhdGl2ZV94CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IGVzc2VudGlhbHMuZmNfeCA8IHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgfHwgKGdseXBoID09IGdseXBoX2VuZCAtIDEKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID49IHJlbGF0aXZl X3gpKQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT55IDw9IHdpbmRvd190ZXh0X2Jv dHRvbV95ICh3KQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJlYWxfZmFrZV9jdXJzb3Jf cCkKKyAgICAgICAgICAgICAgICAgICAgICBtY19lbmdpbmUgKHcsIG1hdHJpeCwgcm93LCBnbHlw aCwgYXJlYSwgcmVsYXRpdmVfeCwgeF9saW1pdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHJvdy0+eSwgaHBvcywgdnBvcywgTUNfQkFSLCAxLCBjdXJzb3JfbWF0cml4LAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBs c2xfZmcsIEZJTExfQ09MVU1OLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJh d19wLCBmcm9tX3doZXJlLCBGQ19DQUNIRSk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgICAgaWYgKCFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAg ICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX2hvcml6b250YWxfcnVsZXIpKQorICAgICAgICAg ICAgICAgICAgICAmJiAoZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAg ICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgIU5JTFAgKEJWQVIgKGIsIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkpCisgICAgICAgICAgICAg ICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0gdGV4dF9hcmVhX3dpZHRoOworICAgICAg ICAgICAgICAgICAgICBpbnQgaHBvcyA9IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsK KyAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgICAg ICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywgZ2x5cGgsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0x LCBNQ19IQkFSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvd19wb3Np dGlvbiwgSE9SSVpPTlRBTF9SVUxFUik7CisgICAgICAgICAgICAgICAgICAgIC8qIFByZXNlcnZl IHN1cHBvcnQgZm9yIGRlZmF1bHQgYmVoYXZpb3Igc3VjaCB0aGF0IGEgdXNlciBtYXkKKyAgICAg ICAgICAgICAgICAgICAgc3BlY2lmeSB0aGUgaGVpZ2h0IG9mIGFuIE1DX0hCQVIsIHdoaWNoIGJl Z2lucyBpdHMgam91cm5leQorICAgICAgICAgICAgICAgICAgICBhcyB0aGUgYGN1cnNvcl93aWR0 aCcuICBgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeScgcmVhZGp1c3RzLiAqLworICAgICAgICAgICAg ICAgICAgICBpZiAoaHBvcyA+PSBocG9zX3N0YXJ0CisgICAgICAgICAgICAgICAgICAgICAgICAm JiBocG9zIDwgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoKQorICAgICAgICAgICAgICAgICAgICAg IG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4X2xp bWl0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT55LCBocG9zLCB2cG9z LCBNQ19IQkFSLCAxLCBjdXJzb3JfbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBsc2xfZmcsIEhPUklaT05UQUxfUlVMRVIs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3X3AsIGZyb21fd2hlcmUsIENI X0NBQ0hFKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAg KEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZB UiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAmJiAoZXNzZW50 aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFj dGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNo X2luYWN0aXZlX3dpbmRvd3MpKSkpCisgICAgICAgICAgICAgICAgICAgICYmICFmaWxsX2NvbHVt bl90cnVtcHNfcCkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgY3Vy c29yX3R5cGUgPSAoZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPyBNQ19IT0xMT1dfQk9YCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiBNQ19CQVI7CisgICAgICAgICAgICAgICAgICAgIGludCB4X2xpbWl0ID0g dGV4dF9hcmVhX3dpZHRoOworICAgICAgICAgICAgICAgICAgICBib29sIHJlYWxfZmFrZV9jdXJz b3JfcCA9ICh3LT5jdXJzb3IueSA9PSByb3ctPnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnZwb3MgPT0gdnBvcyk7CisgICAgICAg ICAgICAgICAgICAgIGludCBocG9zID0gZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdOwor ICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICAgICAg ICAgICAgbWNfY29sb3JfcGlja2VyICh3LCBnbHlwaCwgZXNzZW50aWFscywgJmxzbF9mZywgLTEs IGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvd19w b3NpdGlvbiwgVkVSVElDQUxfUlVMRVIpOworICAgICAgICAgICAgICAgICAgICBpZiAoaHBvcyA+ PSBocG9zX3N0YXJ0CisgICAgICAgICAgICAgICAgICAgICAgICAmJiBocG9zIDwgaHBvc19zdGFy dCArIGhwb3NfbGVuZ3RoCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoKGhlYWRlcl9saW5l X2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwg aGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoKGds eXBoICE9IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+ Y3Vyc29yLnggPj0gcmVsYXRpdmVfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5jdXJzb3IueCA8IHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgfHwgKGdseXBoID09IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0gcmVsYXRpdmVfeCkpCisgICAg ICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcp CisgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAg ICAgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCBy ZWxhdGl2ZV94LCB4X2xpbWl0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93 LT55LCBocG9zLCB2cG9zLCBjdXJzb3JfdHlwZSwgMSwgY3Vyc29yX21hdHJpeCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgbHNsX2Zn LCBWRVJUSUNBTF9SVUxFUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdf cCwgZnJvbV93aGVyZSwgQ0hfQ0FDSEUpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgICAgIHJlbGF0aXZlX3ggKz0gZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICB9 CisgICAgICAgICAgfQorICAgICAgfQorICAvLyAgY2xvY2tfdCBjbG9ja19lbmQgPSBjbG9jaygp OworICAvLyAgZG91YmxlIGNwdV90aW1lX3VzZWQgPSAoKGRvdWJsZSkgKGNsb2NrX2VuZCAtIGNs b2NrX3N0YXJ0KSkgLyBDTE9DS1NfUEVSX1NFQzsKKyAgLy8gIGZwcmludGYgKHN0ZGVyciwgIm1j X2RyYXdfcm93ICglcyk6ICBUSU1FICglZilcbiIsIG1jX3dpbmRvdyAodyksIGNwdV90aW1lX3Vz ZWQpOworfQorCitib29sCittY19yZWRyYXdfcm93IChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3Qg Z2x5cGhfbWF0cml4ICptYXRyaXgsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKKyAgICAgICAgICAg ICAgIGVudW0gZ2x5cGhfcm93X2FyZWEgYXJlYSwgaW50IHN0YXJ0X3gsIGludCBzdGFydF9ocG9z LCBpbnQgZW5kX2hwb3MsCisgICAgICAgICAgICAgICBib29sIGNsZWFyX2VvbF9wLCBlbnVtIGRy YXdfZ2x5cGhzX2ZhY2UgaGwsCisgICAgICAgICAgICAgICBlbnVtIG1jX3JlZHJhd19yb3dfdHlw ZSBmcm9tX3doZXJlKQoreworICBib29sIGdvX3AgPSAoKHctPm1jX21hdHJpeC5jdXJzb3JzX3Vz ZWRbTUNfQ0FDSEVdID4gMAorICAgICAgICAgICAgICAgIHx8IHctPm1jX21hdHJpeC5jdXJzb3Jz X3VzZWRbQ0hfQ0FDSEVdID4gMAorICAgICAgICAgICAgICAgIHx8IHctPm1jX21hdHJpeC5jdXJz b3JzX3VzZWRbRkNfQ0FDSEVdID4gMCkKKyAgICAgICAgICAgICAgICYmIGFyZWEgPT0gVEVYVF9B UkVBCisgICAgICAgICAgICAgICAmJiByb3ctPnVzZWRbYXJlYV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BzYW1lIEhQT1MuICovCisgIGZvciAoZW51bSBt Y19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAgICBjYWNoZV90eXBlIDwg Tk9fQ0FDSEU7CisgICAgICAgKytjYWNoZV90eXBlKQorICAgIHsKKyAgICAgIGZvciAoaW50IG50 aCA9IDA7CisgICAgICAgICAgIG1jX3RyYXZlcnNlX2NhY2hlX3AgKHctPm1jX21hdHJpeCwgY2Fj aGVfdHlwZSwgdm50aCwgbnRoKTsKKyAgICAgICAgICAgKytudGgpCisgICAgICAgIHsKKyAgICAg ICAgICBpbnQgeCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF0ueDsKKyAgICAgICAgICBpbnQgZnggPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhdLmZ4OworICAgICAgICAgIGludCB5ID0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS55OworICAgICAgICAgIGludCBmeSA9IHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZnk7CisgICAgICAgICAg aW50IGhwb3MgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhd Lmhwb3M7CisgICAgICAgICAgaW50IHZwb3MgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhdLnZwb3M7CisgICAgICAgICAgaW50IHdkID0gdy0+bWNfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS53ZDsKKyAgICAgICAgICBpbnQgaCA9 IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uaDsKKyAgICAg ICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlID0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5jdXJzb3JfdHlwZTsKKyAgICAgICAgICBpbnQg Y3Vyc29yX3dpZHRoID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXS5jdXJzb3Jfd2lkdGg7CisgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmcgPSB7LnJl ZCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZmcucmVk LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZmcuZ3JlZW4sCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLmZnLmJsdWV9OworICAgICAgICAgIC8vICBzdHJ1Y3QgbWNf UkdCIGxzbF9iZyA9IHsucmVkID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXS5iZy5yZWQsCisgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAg IC5ncmVlbiA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0u YmcuZ3JlZW4sCisgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5iZy5ibHVlfTsK KyAgICAgICAgICBib29sIGFjdGl2ZV9wID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXS5hY3RpdmVfcDsKKyAgICAgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlw aF9mbGF2b3IgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhd LmdseXBoX2ZsYXZvcjsKKyAgICAgICAgICBib29sIGVuYWJsZWRfcCA9IHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZW5hYmxlZF9wOworICAgICAgICAgIGlm ICh2cG9zID09IHZudGgKKyAgICAgICAgICAgICAgJiYgKChocG9zID49IHN0YXJ0X2hwb3MKKyAg ICAgICAgICAgICAgICAgICAmJiBocG9zIDwgZW5kX2hwb3MpCisgICAgICAgICAgICAgICAgICAv KiBBIGZsb2F0aW5nIGN1cnNvciBiZXlvbmQgdGhlIGVuZCBvZiB0aGUgZ2x5cGggcm93LiAqLwor ICAgICAgICAgICAgICAgICAgfHwgKGhwb3MgKyAxID09IHN0YXJ0X2hwb3MKKyAgICAgICAgICAg ICAgICAgICAgICAmJiBocG9zICsgMSA9PSBlbmRfaHBvcykpCisgICAgICAgICAgICAgICYmIGVu YWJsZWRfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgYm9vbCByZW1vdmVfcCA9IGZh bHNlOworICAgICAgICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgbWF0cml4LCByb3cs IHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCBsc2xfZmcsIGFjdGl2ZV9w LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGhfZmxhdm9yLCByZW1v dmVfcCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIHJldHVybiB0cnVlOwor IC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CBudGggPSAwOworICAgICAgICAgICBtY190cmF2ZXJz ZV9jYWNoZV9wICh3LT5tY19tYXRyaXgsIGNhY2hlX3R5cGUsIHZudGgsIG50aCk7CisgICAgICAg ICAgICsrbnRoKQorICAgICAgICB7CisgICAgICAgICAgaW50IHggPSB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLng7CisgICAgICAgICAgaW50IGZ4ID0gdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5meDsKKyAgICAgICAg ICBpbnQgeSA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0u eTsKKyAgICAgICAgICBpbnQgZnkgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhdLmZ5OworICAgICAgICAgIGludCBocG9zID0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5ocG9zOworICAgICAgICAgIGludCB2cG9zID0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS52cG9zOworICAg ICAgICAgIGludCB3ZCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF0ud2Q7CisgICAgICAgICAgaW50IGggPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhdLmg7CisgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJz b3JfdHlwZSA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0u Y3Vyc29yX3R5cGU7CisgICAgICAgICAgaW50IGN1cnNvcl93aWR0aCA9IHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW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ICAgICAgICAgYm9v bCBlbmFibGVkX3AgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLmVuYWJsZWRfcDsKKyAgICAgICAgICAvKiBgbWF0cml4X3JvdycgaW4gYGRpc3BuZXcuY2Ag Y29udGFpbnMgdGhlIGZvbGxvd2luZyB0ZXN0cywKKyAgICAgICAgICBlYXNzZXJ0IChtYXRyaXgg JiYgbWF0cml4LT5yb3dzKTsKKyAgICAgICAgICBlYXNzZXJ0IChyb3cgPj0gMCAmJiByb3cgPCBt YXRyaXgtPm5yb3dzKTsgKi8KKyAgICAgICAgICBib29sIGJhcmZfY3Jhc2hfb25lID0gKG1hdHJp eCAmJiBtYXRyaXgtPnJvd3MpID8gZmFsc2UgOiB0cnVlOworICAgICAgICAgIGlmIChiYXJmX2Ny YXNoX29uZSkKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgIGJvb2wgYmFyZl9jcmFz aF90d28gPSAodnBvcyA+PSAwICYmIHZwb3MgPCBtYXRyaXgtPm5yb3dzKSA/IGZhbHNlIDogdHJ1 ZTsKKyAgICAgICAgICBpZiAoYmFyZl9jcmFzaF90d28pCisgICAgICAgICAgICBjb250aW51ZTsK KyAgICAgICAgICBpZiAodnBvcyA9PSB2bnRoCisgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZv ciA9PSBNQ19HTFlQSAorICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgICB7 CisgICAgICAgICAgICAgIG1jX2VyYXNlX2N1cnNvciAodywgbWF0cml4LCByb3csIHctPm1jX21h dHJpeCwgeCwgeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBn bHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCk7CisgICAgICAgICAgICAgIHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZW5hYmxlZF9wID0gZmFsc2U7Cisg ICAgICAgICAgICAgIC0tdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90eXBlXTsKKyAg ICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKHZwb3MgPT0gdm50aAorICAgICAgICAg ICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAg ICAgYm9vbCByZW1vdmVfcCA9IHRydWU7CisgICAgICAgICAgICAgICAgbWNfZHJhd19lcmFzZV9o eWJyaWQgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgY3Vyc29y X3dpZHRoLCBsc2xfYmcsIGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBnbHlwaF9mbGF2b3IsIHJlbW92ZV9wKTsKKyAgICAgICAgICAgICAgICB3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmVuYWJsZWRfcCA9IGZhbHNl OworICAgICAgICAgICAgICAgIC0tdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90eXBl XTsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICB3LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdID0gMDsKKyAgICB9Cit9CisKKy8qIEVyYXNlIGZh a2UgY3Vyc29ycyBmcm9tIChtaW4sIHJ1bi5jdXJyZW50X3ksIHJ1bi5kZXNpcmVkX3kpIHRvIGVu ZCBvZiB3aW5kb3cuCisgIFRSWV9XSU5ET1dfUkVVU0lOR19DVVJSRU5UX01BVFJJWF9ET1dOOgor ICAgIHJ1bi5oZWlnaHQgPSBpdC5sYXN0X3Zpc2libGV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R3b19wID0gKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAg ICAgICAgICAgICAgICYmICghTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9z c2hhaXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIg KHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpCisgICAgICAgICAgICAgICAgICAgICAgIHx8ICFO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKSkpOworICBpZiAobWNf c3RkZXJyX3ApCisgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfcHJlX3Njcm9sbF9jbGVhbiAoJXMp OlxuXAorICAlcyB8IGdvX29uZV9wICglcykgfCBnb190d29fcCAoJXMpXG5cCisgIHN0YXJ0X3Zw b3MgKCVkKSB8IG5yb3dzX3Njcm9sbGVkICglZClcblwKKyAgJXM6ICBydW4uY3VycmVudC9kZXNp cmVkX3kgKCVkLyVkKSB8IHJ1bi5oZWlnaHQgKCVkKVxuIiwKKyAgICBtY193aW5kb3cgKHcpLCAo ZnJvbV93aGVyZSA9PSBUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfRE9XTikKKyAg ICAgICAgICAgICAgICAgICAgID8gIlRSWV9XSU5ET1dfUkVVU0lOR19DVVJSRU5UX01BVFJJWF9E T1dOIgorICAgICAgICAgICAgICAgICAgIDogKGZyb21fd2hlcmUgPT0gVFJZX1dJTkRPV19SRVVT SU5HX0NVUlJFTlRfTUFUUklYX1VQKQorICAgICAgICAgICAgICAgICAgICAgPyAiVFJZX1dJTkRP V19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX1VQIgorICAgICAgICAgICAgICAgICAgIDogKGZyb21f d2hlcmUgPT0gVFJZX1dJTkRPV19JRCkKKyAgICAgICAgICAgICAgICAgICAgID8gIlRSWV9XSU5E T1dfSUQiCisgICAgICAgICAgICAgICAgICAgOiAiVU5LTk9XTiIsCisgICAgZ29fb25lX3AgPyAi eWVzIiA6ICJubyIsIGdvX3R3b19wID8gInllcyIgOiAibm8iLAorICAgIHN0YXJ0X3Zwb3MsIG5y b3dzX3Njcm9sbGVkLAorICAgIHJ1bi5jdXJyZW50X3kgPCBydW4uZGVzaXJlZF95ID8gIuKGkyIg OiAi4oaRIiwKKyAgICBydW4uY3VycmVudF95LCBydW4uZGVzaXJlZF95LCBydW4uaGVpZ2h0KTsK KyAgaWYgKCFnb19vbmVfcCAmJiAhZ29fdHdvX3ApCisgICAgcmV0dXJuOworICBib29sIHVwZGF0 aW5nX2ZyYW1lX3AgPSBmYWxzZTsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFt ZSk7CisgIGlmIChYRlJBTUUgKHctPmZyYW1lKSAhPSBmLT5tY191cGRhdGluZ19mcmFtZQorICAg ICAgJiYgKGdvX29uZV9wIHx8IGdvX3R3b19wKSkKKyAgICB7CisgICAgICB1cGRhdGluZ19mcmFt ZV9wID0gdHJ1ZTsKKyAgICAgIHVwZGF0ZV9iZWdpbiAoZik7CisgICAgfQorICBpZiAody0+cGh5 c19jdXJzb3Jfb25fcAorICAgICAgJiYgZ29fdHdvX3ApCisgICAgZXJhc2VfcGh5c19jdXJzb3Ig KHcpOworICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsK KyAgZm9yIChpbnQgdm50aCA9IHN0YXJ0X3Zwb3M7CisgICAgICAgbWF0cml4ICE9IE5VTEwKKyAg ICAgICAmJiB2bnRoIDwgbWF0cml4LT5ucm93cworICAgICAgICYmIE1BVFJJWF9ST1cgKG1hdHJp eCwgdm50aCktPmVuYWJsZWRfcAorICAgICAgICYmIGdvX29uZV9wOworICAgICAgICsrdm50aCkK KyAgICB7CisgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cgPSBNQVRSSVhfUk9XIChtYXRyaXgs IHZudGgpOworICAgICAgbWNfZXJhc2Vfcm93ICh3LCBtYXRyaXgsIHJvdyk7CisgICAgfQorICBp ZiAodXBkYXRpbmdfZnJhbWVfcCkKKyAgICB1cGRhdGVfZW5kIChmKTsKKyAgLy8gbWNfcmVzZXRf Y2FjaGUgKHcpOworfQorCitERUZVTiAoIm1jLXN0ZGVyciIsIEZtY19zdGRlcnIsIFNtY19zdGRl cnIsIDAsIDEsICJQIiwKKyAgICAgICBkb2M6IC8qIFRvZ2dsZSB0cmFjaW5nIG9mIG11bHRpcGxl IGZha2UgY3Vyc29ycy4KK1dpdGggQVJHLCB0dXJuIHRyYWNpbmcgb24gaWYgYW5kIG9ubHkgaWYg QVJHIGlzIHBvc2l0aXZlLiAqLykKKyAgKExpc3BfT2JqZWN0IGFyZykKK3sKKyAgaWYgKE5JTFAg KGFyZykpCisgICAgbWNfc3RkZXJyX3AgPSAhbWNfc3RkZXJyX3A7CisgIGVsc2UKKyAgICB7Cisg ICAgICBhcmcgPSBGcHJlZml4X251bWVyaWNfdmFsdWUgKGFyZyk7CisgICAgICBtY19zdGRlcnJf cCA9IFhGSVhOVU0gKGFyZykgPiAwOworICAgIH0KKyAgcmV0dXJuIFFuaWw7Cit9CisKKy8qIGVu ZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAMCiAv KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioKIAkJICAgICAgV2luZG93IGRpc3BsYXkgZGltZW5zaW9ucwpAQCAtMTQz OTcsOSArMTkyNjksMjIgQEAgcmVkaXNwbGF5X2ludGVybmFsICh2b2lkKQogCSAgICAgICp3LT5k ZXNpcmVkX21hdHJpeC0+bWV0aG9kID0gMDsKIAkgICAgICBkZWJ1Z19tZXRob2RfYWRkICh3LCAi b3B0aW1pemF0aW9uIDEiKTsKICNlbmRpZgorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUtQ1VSU09SUyAqLworCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCisgIGlm IChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3 LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICBtY191cGRhdGVfd2luZG93X2ZyaW5nZXMg KHcsIGZhbHNlKTsKKyAgICBlbHNlCiAJICAgICAgdXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCBm YWxzZSk7CiAjZW5kaWYKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgICAgIGdv dG8gdXBkYXRlOwogCSAgICB9CiAJICBlbHNlCkBAIC0xNzc5MiwxMCArMjI2NzcsMjIgQEAgcmVk aXNwbGF5X3dpbmRvdyAoTGlzcF9PYmplY3Qgd2luZG93LCBib29sIGp1c3RfdGhpc19vbmVfcCkK ICAgICB9CiAKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KKworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBib29sIGtlZXBfY3VycmVudF9w ID0gKGp1c3RfdGhpc19vbmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICghdXNlZF9j dXJyZW50X21hdHJpeF9wICYmICFvdmVybGF5X2Fycm93X3NlZW4pCisgICAgICAgICAgICAgICAg ICAgICAgICAgfHwgdy0+cHNldWRvX3dpbmRvd19wKTsKKworICBib29sIGZyaW5nZXNfdXBkYXRl ZF9wID0gKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfdXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCBr ZWVwX2N1cnJlbnRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIDogdXBkYXRlX3dpbmRv d19mcmluZ2VzICh3LCBrZWVwX2N1cnJlbnRfcCk7CisKICAgaWYgKEZSQU1FX1dJTkRPV19QIChm KQotICAgICAgJiYgdXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCAoanVzdF90aGlzX29uZV9wCi0J CQkJICAgIHx8ICghdXNlZF9jdXJyZW50X21hdHJpeF9wICYmICFvdmVybGF5X2Fycm93X3NlZW4p Ci0JCQkJICAgIHx8IHctPnBzZXVkb193aW5kb3dfcCkpKQorICAgICAgJiYgZnJpbmdlc191cGRh dGVkX3ApCiAgICAgewogICAgICAgdXBkYXRlX2JlZ2luIChmKTsKICAgICAgIGJsb2NrX2lucHV0 ICgpOwpAQCAtMTc4MTAsNiArMjI3MDcsOSBAQCByZWRpc3BsYXlfd2luZG93IChMaXNwX09iamVj dCB3aW5kb3csIGJvb2wganVzdF90aGlzX29uZV9wKQogICAgICAgdXBkYXRlX2VuZCAoZik7CiAg ICAgfQogCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIGlmIChXSU5ET1dfQk9UVE9N X0RJVklERVJfV0lEVEggKHcpKQogICAgIGd1aV9kcmF3X2JvdHRvbV9kaXZpZGVyICh3KTsKICNl bmRpZiAvKiBIQVZFX1dJTkRPV19TWVNURU0gKi8KQEAgLTE4MTI1LDYgKzIzMDI1LDE2IEBAIHRy eV93aW5kb3dfcmV1c2luZ19jdXJyZW50X21hdHJpeCAoc3RydWN0IHdpbmRvdyAqdykKIAkgICAg ICB1cGRhdGVfYmVnaW4gKGYpOwogCSAgICAgIGd1aV91cGRhdGVfd2luZG93X2JlZ2luICh3KTsK IAkgICAgICBGUkFNRV9SSUYgKGYpLT5jbGVhcl93aW5kb3dfbW91c2VfZmFjZSAodyk7CisKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICBt Y19wcmVfc2Nyb2xsX2NsZWFuICh3LCBydW4sIHN0YXJ0X3Zwb3MsIG5yb3dzX3Njcm9sbGVkLCBU UllfV0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfRE9XTik7CisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKIAkgICAgICBGUkFNRV9SSUYgKGYpLT5zY3JvbGxfcnVuX2hvb2sgKHcs ICZydW4pOwogCSAgICAgIGd1aV91cGRhdGVfd2luZG93X2VuZCAodywgZmFsc2UsIGZhbHNlKTsK IAkgICAgICB1cGRhdGVfZW5kIChmKTsKQEAgLTE4MjkxLDYgKzIzMjAxLDE2IEBAIHRyeV93aW5k b3dfcmV1c2luZ19jdXJyZW50X21hdHJpeCAoc3RydWN0IHdpbmRvdyAqdykKIAkgIHVwZGF0ZV9i ZWdpbiAoZik7CiAJICBndWlfdXBkYXRlX3dpbmRvd19iZWdpbiAodyk7CiAJICBGUkFNRV9SSUYg KGYpLT5jbGVhcl93aW5kb3dfbW91c2VfZmFjZSAodyk7CisKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICBtY19wcmVfc2Nyb2xsX2NsZWFu ICh3LCBydW4sIHN0YXJ0X3Zwb3MsIG5yb3dzX3Njcm9sbGVkLCBUUllfV0lORE9XX1JFVVNJTkdf Q1VSUkVOVF9NQVRSSVhfVVApOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICBG UkFNRV9SSUYgKGYpLT5zY3JvbGxfcnVuX2hvb2sgKHcsICZydW4pOwogCSAgZ3VpX3VwZGF0ZV93 aW5kb3dfZW5kICh3LCBmYWxzZSwgZmFsc2UpOwogCSAgdXBkYXRlX2VuZCAoZik7CkBAIC0xOTI0 NSw2ICsyNDE2NSwxNiBAQCB0cnlfd2luZG93X2lkIChzdHJ1Y3Qgd2luZG93ICp3KQogI2lmZGVm IEhBVkVfV0lORE9XX1NZU1RFTQogCSAgZ3VpX3VwZGF0ZV93aW5kb3dfYmVnaW4gKHcpOwogCSAg RlJBTUVfUklGIChmKS0+Y2xlYXJfd2luZG93X21vdXNlX2ZhY2UgKHcpOworCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgbWNfcHJlX3Nj cm9sbF9jbGVhbiAodywgcnVuLCBmaXJzdF91bmNoYW5nZWRfYXRfZW5kX3Zwb3MsIGR2cG9zLCBU UllfV0lORE9XX0lEKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgRlJBTUVf UklGIChmKS0+c2Nyb2xsX3J1bl9ob29rICh3LCAmcnVuKTsKIAkgIGd1aV91cGRhdGVfd2luZG93 X2VuZCAodywgZmFsc2UsIGZhbHNlKTsKICNlbmRpZgpAQCAtMjE1MjgsNiArMjY0NTgsMTcgQEAg bWF5YmVfcHJvZHVjZV9saW5lX251bWJlciAoc3RydWN0IGl0ICppdCkKICAgICAgIFNFVF9URVhU X1BPUyAodGVtX2l0LnBvc2l0aW9uLCAtMSwgLTEpOwogICAgICAgUFJPRFVDRV9HTFlQSFMgKCZ0 ZW1faXQpOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09S UyAqLworCisgICAgICAvKiBUaGlzIHBlcm1pdHMgdXMgdG8gaW5zcGVjdCB0aGUgSFBPUyBvZiBs aW5lIG51bWJlciBnbHlwaHMgYW5kIHRoZSBzcGFjZQorICAgICAgcGFkZGluZyBiZWZvcmUvYWZ0 ZXIgdGhlIGxpbmUgbnVtYmVycy4gIFdlIHNldCBgZ2x5cGgtPmhwb3NgIGVsc2V3aGVyZS4gKi8K KyAgICAgIHRlbV9pdC5ocG9zICs9IDE7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK ICAgICAgIC8qIFN0b3AgcHJvZHVjaW5nIGdseXBocywgYW5kIHJlZnJhaW4gZnJvbSBwcm9kdWNp bmcgdGhlIGxpbmUKIAkgbnVtYmVyLCBpZiB3ZSBkb24ndCBoYXZlIGVub3VnaCBzcGFjZSBvbiB0 aGlzIGxpbmUuICAqLwogICAgICAgaWYgKHRlbV9pdC5jdXJyZW50X3ggPj0gd2lkdGhfbGltaXQp CkBAIC0yMTUzOSw2ICsyNjQ4MCwzNCBAQCBtYXliZV9wcm9kdWNlX2xpbmVfbnVtYmVyIChzdHJ1 Y3QgaXQgKml0KQogCX0KICAgICB9CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBN VUxUSVBMRS1DVVJTT1JTICovCisKKyAgc3RydWN0IHRleHRfcG9zIHdzdGFydDsKKyAgU0VUX1RF WFRfUE9TX0ZST01fTUFSS0VSICh3c3RhcnQsIGl0LT53LT5zdGFydCk7CisgIGlmIChpdC0+YXJl YSA9PSBURVhUX0FSRUEKKyAgICAgICYmIElUX0NIQVJQT1MgKCppdCkgPT0gd3N0YXJ0LmNoYXJw b3MpCisgICAgeworICAgICAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKGl0LT53LT5jb250 ZW50cyk7CisgICAgICBzdHJ1Y3QgYnVmZmVyICpvbGRfYnVmZmVyID0gTlVMTDsKKyAgICAgIC8q IE5lZWRlZCBzbyB0aGF0IGJ1ZmZlci1sb2NhbCB2YWx1ZXMgY2FuIGJlIGRldGVybWluZWQ7IGUu Zy4sIHdoZW4KKyAgICAgIHN3aXRjaGluZyB0byB0aGUgbWluaWJ1ZmZlci4gKi8KKyAgICAgIGlm IChiICE9IGN1cnJlbnRfYnVmZmVyKQorICAgICAgICB7CisgICAgICAgICAgb2xkX2J1ZmZlciA9 IGN1cnJlbnRfYnVmZmVyOworICAgICAgICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKGIpOworICAg ICAgICB9CisgICAgICBpdC0+dy0+bWMubG51bV9waXhlbF93aWR0aCA9ICghTklMUCAoVmRpc3Bs YXlfbGluZV9udW1iZXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyB0 ZW1faXQuY3VycmVudF94CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogMDsK KyAgICAgIGlmIChvbGRfYnVmZmVyKQorICAgICAgICBzZXRfYnVmZmVyX2ludGVybmFsIChvbGRf YnVmZmVyKTsKKyAgICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogUmVj b3JkIHRoZSB3aWR0aCBpbiBwaXhlbHMgd2UgbmVlZCBmb3IgdGhlIGxpbmUgbnVtYmVyIGRpc3Bs YXkuICAqLwogICBpdC0+bG51bV9waXhlbF93aWR0aCA9IHRlbV9pdC5jdXJyZW50X3g7CiAgIC8q IENvcHkgdGhlIHByb2R1Y2VkIGdseXBocyBpbnRvIElUJ3MgZ2x5cGhfcm93LiAgKi8KQEAgLTI3 MzYwLDYgKzMyMzI5LDE3IEBAIGFwcGVuZF9nbHlwaCAoc3RydWN0IGl0ICppdCkKIAkgICAgZ1sx XSA9ICpnOwogCSAgZ2x5cGggPSBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJlYV07CiAJfQorCisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAg ICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPmJ5dGVwb3MgPSBJVF9CWVRF UE9TICgqaXQpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICBnbHlwaC0+ Y2hhcnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAgICAgICBnbHlwaC0+b2JqZWN0ID0g aXQtPm9iamVjdDsKICAgICAgIGlmIChpdC0+cGl4ZWxfd2lkdGggPiAwKQpAQCAtMjc0NDIsNiAr MzI0MjIsMTcgQEAgYXBwZW5kX2NvbXBvc2l0ZV9nbHlwaCAoc3RydWN0IGl0ICppdCkKIAkgICAg Z1sxXSA9ICpnOwogCSAgZ2x5cGggPSBpdC0+Z2x5cGhfcm93LT5nbHlwaHNbaXQtPmFyZWFdOwog CX0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8K KworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBoLT5ieXRlcG9zID0g SVRfQllURVBPUyAoKml0KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAg Z2x5cGgtPmNoYXJwb3MgPSBpdC0+Y21wX2l0LmNoYXJwb3M7CiAgICAgICBnbHlwaC0+b2JqZWN0 ID0gaXQtPm9iamVjdDsKICAgICAgIGVhc3NlcnQgKGl0LT5waXhlbF93aWR0aCA8PSBTSFJUX01B WCk7CkBAIC0yNzY1MCw2ICszMjY0MSwxNyBAQCBwcm9kdWNlX2ltYWdlX2dseXBoIChzdHJ1Y3Qg aXQgKml0KQogCX0KICAgICAgIGlmIChnbHlwaCA8IGl0LT5nbHlwaF9yb3ctPmdseXBoc1thcmVh ICsgMV0pCiAJeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VS U09SUyAqLworCisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPmJ5 dGVwb3MgPSBJVF9CWVRFUE9TICgqaXQpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAJICBnbHlwaC0+Y2hhcnBvcyA9IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAJICBnbHlwaC0+ b2JqZWN0ID0gaXQtPm9iamVjdDsKIAkgIGdseXBoLT5waXhlbF93aWR0aCA9IGNsaXBfdG9fYm91 bmRzICgtMSwgaXQtPnBpeGVsX3dpZHRoLCBTSFJUX01BWCk7CkBAIC0yNzc1Myw2ICszMjc1NSwx NyBAQCBwcm9kdWNlX3h3aWRnZXRfZ2x5cGggKHN0cnVjdCBpdCAqaXQpCiAJfQogICAgICAgaWYg KGdseXBoIDwgaXQtPmdseXBoX3Jvdy0+Z2x5cGhzW2FyZWEgKyAxXSkKIAl7CisKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGdseXBo LT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9IElUX0JZVEVQT1MgKCpp dCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgIGdseXBoLT5jaGFycG9zID0g Q0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKIAkgIGdseXBoLT5vYmplY3QgPSBpdC0+b2JqZWN0Owog CSAgZ2x5cGgtPnBpeGVsX3dpZHRoID0gY2xpcF90b19ib3VuZHMgKC0xLCBpdC0+cGl4ZWxfd2lk dGgsIFNIUlRfTUFYKTsKQEAgLTI3ODM5LDYgKzMyODUyLDE3IEBAIGFwcGVuZF9zdHJldGNoX2ds eXBoIChzdHJ1Y3QgaXQgKml0LCBMaXNwX09iamVjdCBvYmplY3QsCiAJICAgIHdpZHRoIC09IGl0 LT5maXJzdF92aXNpYmxlX3ggLSBpdC0+Y3VycmVudF94OwogCSAgZWFzc2VydCAod2lkdGggPiAw KTsKIAl9CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JT ICovCisKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBnbHlwaC0+Ynl0ZXBv cyA9IElUX0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAg ICAgIGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKICAgICAgIGdseXBo LT5vYmplY3QgPSBvYmplY3Q7CiAgICAgICAvKiBGSVhNRTogSXQgd291bGQgYmUgYmV0dGVyIHRv IHVzZSBUWVBFX01BWCBoZXJlLCBidXQKQEAgLTI4MjkzLDYgKzMzMzE3LDE3IEBAIGFwcGVuZF9n bHlwaGxlc3NfZ2x5cGggKHN0cnVjdCBpdCAqaXQsIGludCBmYWNlX2lkLCBib29sIGZvcl9ub19m b250LCBpbnQgbGVuLAogCSAgICBnWzFdID0gKmc7CiAJICBnbHlwaCA9IGl0LT5nbHlwaF9yb3ct PmdseXBoc1thcmVhXTsKIAl9CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBn bHlwaC0+Ynl0ZXBvcyA9IElUX0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKICAgICAgIGdseXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsK ICAgICAgIGdseXBoLT5vYmplY3QgPSBpdC0+b2JqZWN0OwogICAgICAgZWFzc2VydCAoaXQtPnBp eGVsX3dpZHRoIDw9IFNIUlRfTUFYKTsKQEAgLTI5MzQzLDEwICszNDM3OCwyMCBAQCBndWlfaW5z ZXJ0X2dseXBocyAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqdXBkYXRlZF9y b3csCiAKICAgLyogV3JpdGUgdGhlIGdseXBocy4gICovCiAgIGhwb3MgPSBzdGFydCAtIHJvdy0+ Z2x5cGhzW3VwZGF0ZWRfYXJlYV07CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBN VUxUSVBMRS1DVVJTT1JTICovCisKKyAgaWYgKCFtY19yZWRyYXdfcm93ICh3LCB3LT5jdXJyZW50 X21hdHJpeCwgcm93LCB1cGRhdGVkX2FyZWEsIHctPm91dHB1dF9jdXJzb3IueCwKKyAgICAgICAg ICAgICAgICAgICAgICBocG9zLCBocG9zICsgbGVuLCBmYWxzZSwgRFJBV19OT1JNQUxfVEVYVCwg R1VJX0lOU0VSVF9HTFlQSFMpKQogICBkcmF3X2dseXBocyAodywgdy0+b3V0cHV0X2N1cnNvci54 LCByb3csIHVwZGF0ZWRfYXJlYSwKIAkgICAgICAgaHBvcywgaHBvcyArIGxlbiwKIAkgICAgICAg RFJBV19OT1JNQUxfVEVYVCwgMCk7CiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAg LyogQWR2YW5jZSB0aGUgb3V0cHV0IGN1cnNvci4gICovCiAgIHctPm91dHB1dF9jdXJzb3IuaHBv cyArPSBsZW47CiAgIHctPm91dHB1dF9jdXJzb3IueCArPSBzaGlmdF9ieV93aWR0aDsKQEAgLTI5 NzcyLDkgKzM0ODE3LDE5IEBAIGd1aV9maXhfb3ZlcmxhcHBpbmdfYXJlYSAoc3RydWN0IHdpbmRv dyAqdywgc3RydWN0IGdseXBoX3JvdyAqcm93LAogCSAgd2hpbGUgKGkgPCByb3ctPnVzZWRbYXJl YV0KIAkJICYmIHJvdy0+Z2x5cGhzW2FyZWFdW2ldLm92ZXJsYXBzX3ZlcnRpY2FsbHlfcCk7CiAK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAg ICAgIGlmICghbWNfcmVkcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgsIHJvdywgYXJlYSwg c3RhcnRfeCwgc3RhcnQsIGksCisgICAgICAgICAgZmFsc2UsIERSQVdfTk9STUFMX1RFWFQsIEdV SV9GSVhfT1ZFUkxBUFBJTkdfQVJFQSkpCiAJICBkcmF3X2dseXBocyAodywgc3RhcnRfeCwgcm93 LCBhcmVhLAogCQkgICAgICAgc3RhcnQsIGksCiAJCSAgICAgICBEUkFXX05PUk1BTF9URVhULCBv dmVybGFwcyk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAl9CiAgICAgICBlbHNl CiAJewpAQCAtMzAwMjUsMTAgKzM1MDgwLDIwIEBAIGRpc3BsYXlfYW5kX3NldF9jdXJzb3IgKHN0 cnVjdCB3aW5kb3cgKncsIGJvb2wgb24sCiAgIG5ld19jdXJzb3JfdHlwZSA9IGdldF93aW5kb3df Y3Vyc29yX3R5cGUgKHcsIGdseXBoLAogCQkJCQkgICAgJm5ld19jdXJzb3Jfd2lkdGgsICZhY3Rp dmVfY3Vyc29yKTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKwogICAvKiBJZiBjdXJzb3IgaXMgY3VycmVudGx5IGJlaW5nIHNob3duIGFuZCB3 ZSBkb24ndCB3YW50IGl0IHRvIGJlIG9yCiAgICAgIGl0IGlzIGluIHRoZSB3cm9uZyBwbGFjZSwg b3IgdGhlIGN1cnNvciB0eXBlIGlzIG5vdCB3aGF0IHdlIHdhbnQsCiAgICAgIGVyYXNlIGl0LiAg Ki8KICAgaWYgKHctPnBoeXNfY3Vyc29yX29uX3AKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZG RVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVG RkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJV RkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAgICYmIHctPm1jX21hdHJpeC5jdXJz b3JzX3VzZWRbTUNfQ0FDSEVdID09IDAKKyAgICAgICYmIHctPm1jX21hdHJpeC5jdXJzb3JzX3Vz ZWRbQ0hfQ0FDSEVdID09IDAKKyAgICAgICYmIHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbRkNf Q0FDSEVdID09IDAKICAgICAgICYmICghb24KIAkgIHx8IHctPnBoeXNfY3Vyc29yLnggIT0geAog CSAgfHwgdy0+cGh5c19jdXJzb3IueSAhPSB5CkBAIC0zMDA0MSw2ICszNTEwNiw5IEBAIGRpc3Bs YXlfYW5kX3NldF9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgb24sCiAJICAgICAgJiYg bmV3X2N1cnNvcl93aWR0aCAhPSB3LT5waHlzX2N1cnNvcl93aWR0aCkpKQogICAgIGVyYXNlX3Bo eXNfY3Vyc29yICh3KTsKIAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBEb24n dCBjaGVjayBwaHlzX2N1cnNvcl9vbl9wIGhlcmUgYmVjYXVzZSB0aGF0IGZsYWcgaXMgb25seSBz ZXQKICAgICAgdG8gZmFsc2UgaW4gc29tZSBjYXNlcyB3aGVyZSB3ZSBrbm93IHRoYXQgdGhlIGN1 cnNvciBoYXMgYmVlbgogICAgICBjb21wbGV0ZWx5IGVyYXNlZCwgdG8gYXZvaWQgdGhlIGV4dHJh IHdvcmsgb2YgZXJhc2luZyB0aGUgY3Vyc29yCkBAIC0zMDA1OSw5ICszNTEyNywyMyBAQCBkaXNw bGF5X2FuZF9zZXRfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIG9uLAogICAgICAgdy0+ cGh5c19jdXJzb3IudnBvcyA9IHZwb3M7CiAgICAgfQogCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlmIChOSUxQIChCVkFSIChYQlVGRkVS ICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZG RVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAmJiB3LT5tY19tYXRyaXguY3Vyc29y c191c2VkW01DX0NBQ0hFXSA9PSAwCisgICAgICAmJiB3LT5tY19tYXRyaXguY3Vyc29yc191c2Vk W0NIX0NBQ0hFXSA9PSAwCisgICAgICAmJiB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0ZDX0NB Q0hFXSA9PSAwKQogICBGUkFNRV9SSUYgKGYpLT5kcmF3X3dpbmRvd19jdXJzb3IgKHcsIGdseXBo X3JvdywgeCwgeSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfY3Vy c29yX3R5cGUsIG5ld19jdXJzb3Jfd2lkdGgsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgb24sIGFjdGl2ZV9jdXJzb3IpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiB9CiAKIApAQCAtMzAxNTQsNyArMzUyMzYsMTggQEAgZHJhd19yb3dfd2l0aF9tb3VzZV9m YWNlIChzdHJ1Y3Qgd2luZG93ICp3LCBpbnQgc3RhcnRfeCwgc3RydWN0IGdseXBoX3JvdyAqcm93 LAogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQogICBpZiAoRlJBTUVfV0lORE9XX1AgKFhGUkFN RSAody0+ZnJhbWUpKSkKICAgICB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBN VUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGlmICghbWNfcmVkcmF3X3JvdyAodywgdy0+Y3Vy cmVudF9tYXRyaXgsIHJvdywgVEVYVF9BUkVBLCBzdGFydF94LAorICAgICAgICAgICAgICAgICAg ICAgICAgICBzdGFydF9ocG9zLCBlbmRfaHBvcywgZmFsc2UsIGRyYXcsIERSQVdfUk9XX1dJVEhf TU9VU0VfRkFDRSkpCiAgICAgICBkcmF3X2dseXBocyAodywgc3RhcnRfeCwgcm93LCBURVhUX0FS RUEsIHN0YXJ0X2hwb3MsIGVuZF9ocG9zLCBkcmF3LCAwKTsKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisKKwogICAgICAgcmV0dXJuOwogICAgIH0KICNlbmRpZgpAQCAtMzIyMTQsMTEgKzM3 MzA3LDIzIEBAIGV4cG9zZV9hcmVhIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93 ICpyb3csIGNvbnN0IEVtYWNzX1JlY3RhbmdsZSAqciwKICAgc3RydWN0IGdseXBoICpsYXN0Owog ICBpbnQgZmlyc3RfeCwgc3RhcnRfeCwgeDsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogICBpZiAoYXJlYSA9PSBURVhUX0FSRUEgJiYgcm93 LT5maWxsX2xpbmVfcCkKKyAgICB7CisgICAgICBpZiAoIW1jX3JlZHJhd19yb3cgKHcsIHctPmN1 cnJlbnRfbWF0cml4LCByb3csIGFyZWEsIDAsIDAsIHJvdy0+dXNlZFthcmVhXSwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgZmFsc2UsIERSQVdfTk9STUFMX1RFWFQsIEVYUE9TRV9BUkVBX09O RSkpCiAgICAgLyogSWYgcm93IGV4dGVuZHMgZmFjZSB0byBlbmQgb2YgbGluZSB3cml0ZSB0aGUg d2hvbGUgbGluZS4gICovCiAgICAgZHJhd19nbHlwaHMgKHcsIDAsIHJvdywgYXJlYSwKIAkJIDAs IHJvdy0+dXNlZFthcmVhXSwKIAkJIERSQVdfTk9STUFMX1RFWFQsIDApOworICAgIH0KKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogICBlbHNlCiAgICAgewogICAgICAgLyogU2V0IFNU QVJUX1ggdG8gdGhlIHdpbmRvdy1yZWxhdGl2ZSBzdGFydCBwb3NpdGlvbiBmb3IgZHJhd2luZyBn bHlwaHMgb2YKQEAgLTMyMjUwLDExICszNzM1NSwyNCBAQCBleHBvc2VfYXJlYSAoc3RydWN0IHdp bmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqcm93LCBjb25zdCBFbWFjc19SZWN0YW5nbGUgKnIs CiAJICArK2xhc3Q7CiAJfQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQ TEUtQ1VSU09SUyAqLworCiAgICAgICAvKiBSZXBhaW50LiAgKi8KLSAgICAgIGlmIChsYXN0ID4g Zmlyc3QpCisKKyAgICAgIC8qIEZsb2F0aW5nIGZha2UgY3Vyc29ycyB3aWxsIGV4aXN0IHdoZW4g KGxhc3QgPT0gZmlyc3QpLiAqLworICAgICAgaWYgKCFtY19yZWRyYXdfcm93ICh3LCB3LT5jdXJy ZW50X21hdHJpeCwgcm93LCBhcmVhLCBmaXJzdF94IC0gc3RhcnRfeCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgZmlyc3QgLSByb3ctPmdseXBoc1thcmVhXSwgbGFzdCAtIHJvdy0+Z2x5cGhz W2FyZWFdLAorICAgICAgICAgICAgICAgICAgICAgICAgICBmYWxzZSwgRFJBV19OT1JNQUxfVEVY VCwgRVhQT1NFX0FSRUFfVFdPKQorICAgICAgICAgICYmIGxhc3QgPiBmaXJzdCkKIAlkcmF3X2ds eXBocyAodywgZmlyc3RfeCAtIHN0YXJ0X3gsIHJvdywgYXJlYSwKIAkJICAgICBmaXJzdCAtIHJv dy0+Z2x5cGhzW2FyZWFdLCBsYXN0IC0gcm93LT5nbHlwaHNbYXJlYV0sCiAJCSAgICAgRFJBV19O T1JNQUxfVEVYVCwgMCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICB9CiB9 CiAKQEAgLTMyMjY4LDEwICszNzM4NiwyMiBAQCBleHBvc2VfbGluZSAoc3RydWN0IHdpbmRvdyAq dywgc3RydWN0IGdseXBoX3JvdyAqcm93LCBjb25zdCBFbWFjc19SZWN0YW5nbGUgKnIpCiB7CiAg IGVhc3NlcnQgKHJvdy0+ZW5hYmxlZF9wKTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogICBpZiAocm93LT5tb2RlX2xpbmVfcCB8fCB3LT5w c2V1ZG9fd2luZG93X3ApCisgICAgeworICAgICAgaWYgKCFtY19yZWRyYXdfcm93ICh3LCB3LT5j dXJyZW50X21hdHJpeCwgcm93LCBURVhUX0FSRUEsIDAsIDAsCisgICAgICAgICAgICAgICAgICAg ICAgICAgIHJvdy0+dXNlZFtURVhUX0FSRUFdLCBmYWxzZSwgRFJBV19OT1JNQUxfVEVYVCwgRVhQ T1NFX0xJTkUpKQogICAgIGRyYXdfZ2x5cGhzICh3LCAwLCByb3csIFRFWFRfQVJFQSwKIAkJIDAs IHJvdy0+dXNlZFtURVhUX0FSRUFdLAogCQkgRFJBV19OT1JNQUxfVEVYVCwgMCk7CisgICAgfQor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIGVsc2UKICAgICB7CiAgICAgICBpZiAo cm93LT51c2VkW0xFRlRfTUFSR0lOX0FSRUFdKQpAQCAtMzI4MTksNiArMzc5NDksMjIgQEAgZ3Vp X2ludGVyc2VjdF9yZWN0YW5nbGVzIChjb25zdCBFbWFjc19SZWN0YW5nbGUgKnIxLCBjb25zdCBF bWFjc19SZWN0YW5nbGUgKnIyLAogdm9pZAogc3ltc19vZl94ZGlzcCAodm9pZCkKIHsKKworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBkZWZz dWJyICgmU21jX2R1bXBfZ2x5cGhfcm93KTsKKworICBkZWZzdWJyICgmU21jX2R1bXBfZ2x5cGhf bWF0cml4KTsKKworICBkZWZzdWJyICgmU21jX2N1cnJlbnRfY29sdW1uKTsKKworICBkZWZzdWJy ICgmU21jX3N0ZGVycik7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgVndpdGhf ZWNob19hcmVhX3NhdmVfdmVjdG9yID0gUW5pbDsKICAgc3RhdGljcHJvICgmVndpdGhfZWNob19h cmVhX3NhdmVfdmVjdG9yKTsKIApkaWZmIC0tZ2l0IGEvc3JjL3h0ZXJtLmMgYi9zcmMveHRlcm0u YwppbmRleCBjOTZhYTc0Li5kMzRkODFkIDEwMDY0NAotLS0gYS9zcmMveHRlcm0uYworKysgYi9z cmMveHRlcm0uYwpAQCAtMTMyLDYgKzEzMiw5MDcgQEAgYWxvbmcgd2l0aCBHTlUgRW1hY3MuICBJ ZiBub3QsIHNlZSA8aHR0cHM6Ly93d3cuZ251Lm9yZy9saWNlbnNlcy8+LiAgKi8KICNpbmNsdWRl IDxYMTEvWEtCbGliLmg+CiAjZW5kaWYKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IGJlZ2luIE1VTFRJUExFLUNVUlNPUlMgKi8KKworI2lmZGVmIEdMWVBIX0RFQlVHCitzdGF0aWMg dm9pZCB4X2NoZWNrX2ZvbnQgKHN0cnVjdCBmcmFtZSAqLCBzdHJ1Y3QgZm9udCAqKTsKKyNlbmRp ZgorCitzdGF0aWMgdm9pZCB4X3NldF9tb2RlX2xpbmVfZmFjZV9nYyAoc3RydWN0IGdseXBoX3N0 cmluZyAqKTsKKworc3RhdGljIHZvaWQgeF9zZXRfbW91c2VfZmFjZV9nYyAoc3RydWN0IGdseXBo X3N0cmluZyAqKTsKKworc3R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ydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAg ICAgICAgICAgICAgICAgICAgIGludCB4LCBpbnQgZngsIGludCB5LCBpbnQgZnksIGludCBocG9z LCBpbnQgdnBvcywgaW50IHdkLAorICAgICAgICAgICAgICAgICAgICAgICAgIGludCBoLCBzdHJ1 Y3QgbWNfUkdCIGxzbCwgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSwKKyAgICAgICAg ICAgICAgICAgICAgICAgICBpbnQgY3Vyc29yX3dpZHRoLCBlbnVtIG1jX2ZsYXZvciBnbHlwaF9m bGF2b3IsIGJvb2wgb25fcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGFjdGl2ZV9w KQoreworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworICAv KiBUaGUgZnJpbmdlIGJpdG1hcHMgYXJlIHByZXNlbnRseSBoYW5kbGVkIGVsc2V3aGVyZSwgYnV0 IGNvdWxkIHNvbWVkYXkKKyAgYmUgbWFuYWdlZCAoaW4gcGFydCkgYXQgdGhpcyBzZWN0aW9uIG9m IGNvZGUuICovCisgIGlmIChvbl9wKQorICAgIHsKKyAgICAgIGlmIChyb3ctPmV4YWN0X3dpbmRv d193aWR0aF9saW5lX3AKKyAgICAgICAgICAmJiAocm93LT5yZXZlcnNlZF9wCisgICAgICAgICAg ICAgID8gKGhwb3MgPCAwKQorICAgICAgICAgICAgICA6IChocG9zID49IHJvdy0+dXNlZFtURVhU X0FSRUFdKSkpCisgICAgICAgIHsKKyAgICAgICAgICByb3ctPmN1cnNvcl9pbl9mcmluZ2VfcCA9 IHRydWU7CisgICAgICAgICAgbWNfZHJhd19mcmluZ2VfYml0bWFwICh3LCByb3csIHJvdy0+cmV2 ZXJzZWRfcCwgY3Vyc29yX3R5cGUpOworICAgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIHsK KyAgQ29sb3JtYXAgY21hcCA9IEZSQU1FX1hfQ09M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isgICAgICBicmVhazsK KyAgICBjYXNlIE1DX0ZSQU1FRF9CT1g6CisgICAgeworICAgICAgc3RydWN0IGdseXBoICpjdXJz b3JfZ2x5cGggPSBtY19nZXRfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywgaHBvcywgdnBv cyk7CisgICAgICBpZiAoY3Vyc29yX2dseXBoID09IE5VTEwpCisgICAgICAgIHJldHVybjsKKyAg ICAgIHN0cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSICh3LT5jb250ZW50cyk7CisgICAgICBib29s IHJlZ2lvbl9hY3RpdmVfcCA9ICghTklMUCAoVnRyYW5zaWVudF9tYXJrX21vZGUpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgbWFya19hY3RpdmUpKSk7 CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2JlZyA9IChyZWdpb25fYWN0aXZlX3ApID8gbWNfcmVn aW9uX2xpbWl0ICgxKSA6IC0xOworICAgICAgcHRyZGlmZl90IHJlZ2lvbl9lbmQgPSAocmVnaW9u X2FjdGl2ZV9wKSA/IG1jX3JlZ2lvbl9saW1pdCAoMCkgOiAtMTsKKyAgICAgIGlmIChjdXJzb3Jf Z2x5cGgtPnR5cGUgIT0gSU1BR0VfR0xZUEggJiYgbHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+ PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3Jhcmls eSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYycgYnkgYm9ycm93aW5nIHRoZQor ICAgICAgICAgIGZ1bmN0aW9uYWxpdHkgb2YgYHhfbWFrZV9nYycgaW4geGZucy5jLiAqLworICAg ICAgICAgIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgJiYgYWN0aXZlX3AKKyAg ICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5j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X2RhdGEueC0+Y3Vyc29yX2djLCBob2xs b3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgICAgWFNldEJhY2tn cm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywg aG9sbG93X2FjdGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAg ICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoYWN0aXZlX3ApCisgICAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZl X2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2Ut Y3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3Qg ZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZl X2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9E SVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfYWN0aXZlX2Zh Y2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJB TUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfYWN0 aXZlX2ZhY2UtPmJhY2tncm91bmQpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICAgICAgZWxzZSBpZiAoIWFjdGl2ZV9wKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAg ICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIG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25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAo IistcmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAg ICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwg aG9sbG93X2FjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91 bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9s bG93X2FjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgICAgWFNldEJh Y2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9n YywgaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2UtPmJhY2tncm91bmQpOworICAgICAgICAg ICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgZWxzZSBpZiAocmVnaW9uX2FjdGl2ZV9wCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID4gcmVnaW9uX2JlZworICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zIDwgcmVnaW9uX2VuZCkK KyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9p ZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFj ZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluLXJlZ2lvbi1wcmUtenYtZmFj ZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2Fj dGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZl X3JlZ2lvbl9iZXR3ZWVuX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICAgIGVudW0gZmFj ZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50 ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAg ICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01f SUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgWFNl dEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNv cl9nYywgaG9sbG93X2FjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAg ICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEu eC0+Y3Vyc29yX2djLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2UtPmZvcmVncm91 bmQpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYg KGFjdGl2ZV9wKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAg ICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFj ZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUp OworICAgICAgIC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gICAgICAgICAgICAgICAg IFhTZXRCYWNrZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5j dXJzb3JfZ2MsIGhvbGxvd19pbmFjdGl2ZV9mYWNlLT5iYWNrZ3JvdW5kKTsKKyAgICAgICAgICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAg ICAgIC8qIEZvcmNlIGBtY194X3NldF9jdXJzb3JfZ2MnIHRvIHVzZSBgcy0+Zi0+b3V0cHV0X2Rh dGEueC0+Y3Vyc29yX2djJy4gKi8KKyAgICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IHRy dWU7CisgICAgICAgICAgICAgIG1jX2RyYXdfY3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywg RFJBV19DVVJTT1IsIHgsIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBsc2wsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9nY19wKTsKKyAgICAgICAg ICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRh LngtPmN1cnNvcl9nYywgeGdjdi5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgWFNldEJhY2tn cm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywg eGdjdi5iYWNrZ3JvdW5kKTsKKyAgICAgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAg ICAgICAgICAgLyogRHJhdyB0aGUgZnJhbWUgYXJvdW5kIHRoZSBib3guICovCisgICAgICAgICAg ICAgIG1jX3hfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5 LCBocG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9 CisgICAgY2FzZSBNQ19IT0xMT1dfQk9YOgorICAgIHsKKyAgICAgIGlmIChsc2wucmVkID49IDAg JiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAg IC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsJy4g Ki8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBjb2xvci5waXhl bDsKKyAgICAgICAgICBtY194X2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgs IGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgIGYtPm91dHB1dF9kYXRh LngtPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAg ICAgICBlbHNlCisgICAgICAgICAgbWNfeF9kcmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwg cm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsKKyAgICAgIGJyZWFrOworICAg IH0KKyAgICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAgeworICAgICAgaWYgKGxzbC5yZWQgPj0g MCAmJiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAgICAvKiBUZW1wb3Jh cmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYycgYnkgYm9ycm93aW5nIHRo ZQorICAgICAgICBmdW5jdGlvbmFsaXR5IG9mIGB4X21ha2VfZ2MnIGluIHhmbnMuYy4gKi8KKyAg ICAgICAgeworIC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yYXdfY3Vyc29yX2dseXBoICh3 LCBtYXRyaXgsIHJvdywgRFJBV19DVVJTT1IsIHgsIGhwb3MsIHZwb3MsIGxzbCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwg YWN0aXZlX3AsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9 CisgICAgY2FzZSBNQ19CQVI6CisgICAgeworICAgICAgaWYgKGxzbC5yZWQgPj0gMCAmJiBsc2wu Z3JlZW4gPj0gMCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVt cG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwnLiAqLworICAg ICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IGNvbG9yLnBpeGVsOworICAg ICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSB0cnVlOworICAgICAgICAg IG1jX3hfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9z LCB2cG9zLCB3ZCwgaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dp ZHRoLCBNQ19CQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICBmLT5v dXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAg ICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgY3Vyc29y X2djX2ludmlzaWJsZV9va2F5X3AgPSBmYWxzZTsKKyAgICAgICAgICAgIG1jX3hfZHJhd19iYXJf Y3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0JBUiwg Y3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOwor ICAgIH0KKyAgICBjYXNlIE1DX0hCQVI6CisgICAgeworICAgICAgaWYgKGxzbC5yZWQgPj0gMCAm JiBsc2wuZ3JlZW4gPj0gMCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAg LyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwnLiAq LworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IGNvbG9yLnBpeGVs OworICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSB0cnVlOworICAg ICAgICAgIG1jX3hfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5 LCBocG9zLCB2cG9zLCB3ZCwgaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vy c29yX3dpZHRoLCBNQ19IQkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAg ICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVs OworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICBib29s IGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7CisgICAgICAgICAgICBtY194X2Ry YXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywg d2QsCisgICAgICAgICAgICAgICAg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ICB7CisgICAgICAgICAgaW50IGxlZnRfeCA9IHdpbmRvd19ib3hfbGVmdF9vZmZzZXQgKHMtPncs IFRFWFRfQVJFQSk7CisgICAgICAgICAgaWYgKHggPCBsZWZ0X3gpCisgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgIGJhY2tncm91bmRfd2lkdGggLT0gbGVmdF94IC0geDsKKyAgICAgICAgICAg ICAgeCA9IGxlZnRfeDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisg ICAgICAgICAgeworICAgICAgICAgICAgLyogSW4gUjJMIHJvd3MsIGRyYXcgdGhlIGN1cnNvciBv biB0aGUgcmlnaHQgZWRnZSBvZiB0aGUKKyAgICAgICAgICAgICAgIHN0cmV0Y2ggZ2x5cGguICov CisgICAgICAgICAgICBpbnQgcmlnaHRfeCA9IHdpbmRvd19ib3hfcmlnaHQgKHMtPncsIFRFWFRf QVJFQSk7CisgICAgICAgICAgICBpZiAoeCArIGJhY2tncm91bmRfd2lkdGggPiByaWdodF94KQor ICAgICAgICAgICAgICBiYWNrZ3JvdW5kX3dpZHRoIC09IHggLSByaWdodF94OworICAgICAgICAg ICAgeCArPSBiYWNrZ3JvdW5kX3dpZHRoOworICAgICAgICAgIH0KKyAgICAgIHdpZHRoID0gbWlu IChGUkFNRV9DT0xVTU5fV0lEVEggKHMtPmYpLCBiYWNrZ3JvdW5kX3dpZHRoKTsKKyAgICAgIGlm IChzLT5yb3ctPnJldmVyc2VkX3ApCisgICAgICAgIHggLT0gd2lkdGg7CisgICAgICAvKiBEcmF3 IGN1cnNvci4gKi8KKyAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmdfcmVjdCAocywgeCwgcy0+ eSwgd2lkdGgsIHMtPmhlaWdodCk7CisgICAgICAvKiBDbGVhciByZXN0IHVzaW5nIHRoZSBHQyBv ZiB0aGUgb3JpZ2luYWwgbm9uLWN1cnNvciBmYWNlLiAqLworICAgICAgaWYgKHdpZHRoIDwgYmFj a2dyb3VuZF93aWR0aCkKKyAgICAgICAgeworICAgICAgICAgIGludCB5ID0gcy0+eTsKKyAgICAg ICAgICBpbnQgdyA9IGJhY2tncm91bmRfd2lkdGggLSB3aWR0aCwgaCA9IHMtPmhlaWdodDsKKyAg ICAgICAgICBYUmVjdGFuZ2xlIHI7CisgICAgICAgICAgR0MgZ2M7CisgICAgICAgICAgaWYgKCFz LT5yb3ctPnJldmVyc2VkX3ApCisgICAgICAgICAgICB4ICs9IHdpZHRoOworICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgIHggPSBzLT54OworICAgICAgICAgIGlmIChzLT5yb3ctPm1vdXNlX2Zh Y2VfcAorICAgICAgICAgICAgICAmJiBjdXJzb3JfaW5fbW91c2VfZmFjZV9wIChzLT53KSkKKyAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgeF9zZXRfbW91c2VfZmFjZV9nYyAocyk7CisgICAg ICAgICAgICAgIGdjID0gcy0+Z2M7CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAg ICAgICAgICAgZ2MgPSBzLT5mYWNlLT5nYzsKKyAgICAgICAgICBnZXRfZ2x5cGhfc3RyaW5nX2Ns aXBfcmVjdCAocywgJnIpOworICAgICAgICAgIHhfc2V0X2NsaXBfcmVjdGFuZ2xlcyAocy0+Ziwg Z2MsICZyLCAxKTsKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+c3RpcHBsZSkKKyAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgLyogRmlsbCBiYWNrZ3JvdW5kIHdpdGggYSBzdGlwcGxlIHBhdHRl cm4uICovCisgICAgICAgICAgICAgIFhTZXRGaWxsU3R5bGUgKEZSQU1FX1hfRElTUExBWSAocy0+ ZiksIGdjLCBGaWxsT3BhcXVlU3RpcHBsZWQpOworICAgICAgICAgICAgICB4X2ZpbGxfcmVjdGFu Z2xlIChzLT5mLCBnYywgeCwgeSwgdywgaCk7CisgICAgICAgICAgICAgIFhTZXRGaWxsU3R5bGUg KE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AgICAgeworICAgICAgICAgIGJh Y2tncm91bmRfd2lkdGggLT0gbGVmdF94IC0geDsKKyAgICAgICAgICB4ID0gbGVmdF94OworICAg ICAgICB9CisgICAgICBpZiAoYmFja2dyb3VuZF93aWR0aCA+IDApCisgICAgICAgIHhfZHJhd19n bHlwaF9zdHJpbmdfYmdfcmVjdCAocywgeCwgcy0+eSwgYmFja2dyb3VuZF93aWR0aCwgcy0+aGVp Z2h0KTsKKyAgICB9CisgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVlOworfQorCisvKiBE cmF3IGdseXBoIHN0cmluZyBTLiAgVGhlIGBtY19tYXRyaXhgIGlzIHJlc2VydmVkIGZvciBmdXR1 cmUgdXNlIHdoZW4gZXJhc2luZworICAgZmFrZSBjdXJzb3JzIGR1cmluZyBgbWNfdXBkYXRlX3dp bmRvd19lcmFzZScgYW5kIHJlZHJhd2luZyBmYWtlIGN1cnNvcnMgb24KKyAgIGxlZnQvcmlnaHQg b3ZlcndyaXR0ZW4gZ2x5cGhzLiAqLworc3RhdGljIHZvaWQKK21jX3hfZHJhd19nbHlwaF9zdHJp bmcgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwK KyAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgc3RydWN0IG1j X21hdHJpeCBtY19tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdC IGxzbCwgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yLAorICAgICAgICAgICAgICAgICAgICAg ICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSwgaW50IGN1cnNvcl93aWR0aCwKKyAg ICAgICAgICAgICAgICAgICAgICAgIGJvb2wgYWN0aXZlX3AsIGJvb2wgY3Vyc29yX2djX3ApCit7 CisgIGJvb2wgcmVsaWVmX2RyYXduX3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leHQsIHRy dWUpOworICAgICAgICAgICAgbmV4dC0+bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICB9CisgICAg fQorICAvKiBTZXQgdXAgUy0+Z2MsIHNldCBjbGlwcGluZyBhbmQgZHJhdyBTLiAqLworICBtY194 X3NldF9nbHlwaF9zdHJpbmdfZ2MgKHMsIGN1cnNvcl9nY19wKTsKKyAgLyogRHJhdyByZWxpZWYg KGlmIGFueSkgaW4gYWR2YW5jZSBmb3IgY2hhci9jb21wb3NpdGlvbiBzbyB0aGF0IHRoZQorICAg ICBnbHlwaCBzdHJpbmcgY2FuIGJlIGRyYXduIG92ZXIgaXQuICovCisgIGlmICghcy0+Zm9yX292 ZXJsYXBzCisgICAgICAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gKKyAgICAgICYmIChz LT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICAgICAgfHwgcy0+Zmlyc3Rf Z2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKSkKKyAgICB7CisgICAgICB4X3NldF9nbHlw aF9zdHJpbmdfY2xpcHBpbmcgKHMpOworICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19iYWNrZ3Jv dW5kIChzLCB0cnVlKTsKKyAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYm94IChzKTsKKyAgICAg IHhfc2V0X2dseXBoX3N0cmluZ19jbGlwcGluZyAocyk7CisgICAgICByZWxpZWZfZHJhd25fcCA9 IHRydWU7CisgICAgfQorICAgIGVsc2UgaWYgKCFzLT5jbGlwX2hlYWQgLyogZHJhd19nbHlwaHMg ZGlkbid0IHNwZWNpZnkgYSBjbGlwIG1hc2suICovCisgICAgICAgICAgICAgJiYgIXMtPmNsaXBf dGFpbAorICAgICAgICAgICAgICYmICgocy0+cHJldiAmJiBzLT5wcmV2LT5obCAhPSBzLT5obCAm JiBzLT5sZWZ0X292ZXJoYW5nKQorICAgICAgICAgICAgICAgIC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CAocyk7CisgICAgICBicmVhazsKKyAgICBjYXNlIENPTVBPU0lURV9HTFlQSDoKKyAg ICAgIGlmIChzLT5mb3Jfb3ZlcmxhcHMgfHwgKHMtPmNtcF9mcm9tID4gMAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgISBzLT5maXJzdF9nbHlwaC0+dS5jbXAuYXV0b21hdGljKSkK KyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICBlbHNlCisgICAg ICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgdHJ1ZSk7CisgICAgICB4X2Ry YXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAgICAgIGJyZWFrOwor ICAgIGNhc2UgR0xZUEhMRVNTX0dMWVBIOgorICAgICAgaWYgKHMtPmZvcl9vdmVybGFwcykKKyAg ICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICBlbHNlCisgICAgICAg IHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgdHJ1ZSk7CisgICAgICB4X2RyYXdf Z2x5cGhsZXNzX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAgICAgIGJyZWFrOworICAg IGRlZmF1bHQ6CisgICAgICBlbWFjc19hYm9ydCAoKTsKKyAgICB9CisgIGlmICghcy0+Zm9yX292 ZXJsYXBzKQorICAgIHsKKyAgICAgIC8qIERyYXcgdW5kZXJsaW5lLiAqLworICAgICAgaWYgKHMt PmZhY2UtPnVuZGVybGluZV9wKQorICAgICAgICB7CisgICAgICAgICAgaWYgKHMtPmZhY2UtPnVu ZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfV0FWRSkKKyAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAg ICB4X2RyYXdfdW5kZXJ3YXZlIChzKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgIFhHQ1ZhbHVlcyB4Z2N2OworICAgICAgICAgICAgICAg ICAgWEdldEdDVmFsdWVzIChGUkFNRV9YX0RJU1BMQVkgKHMtPmYpLCBzLT5nYywgR0NGb3JlZ3Jv dW5kLCAmeGdjdik7CisgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9E SVNQTEFZIChzLT5mKSwgcy0+Z2MsIHMtPmZhY2UtPnVuZGVybGluZV9jb2xvcik7CisgICAgICAg ICAgICAgICAgICB4X2RyYXdfdW5kZXJ3YXZlIChzKTsKKyAgICAgICAgICAgICAgICAgIFhTZXRG b3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKHMtPmYpLCBzLT5nYywgeGdjdi5mb3JlZ3JvdW5k KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxzZSBpZiAo cy0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAgICAgICAg eworICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIHRoaWNrbmVzcywgcG9zaXRpb247CisgICAg ICAgICAgICAgIGludCB5OworICAgICAgICAgICAgICBpZiAocy0+cHJldiAmJiBzLT5wcmV2LT5m YWNlLT51bmRlcmxpbmVfcAorICAgICAgICAgICAgICAgICAgJiYgcy0+cHJldi0+ZmFjZS0+dW5k ZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgIC8qIFdlIHVzZSB0aGUgc2FtZSB1bmRlcmxpbmUgc3R5bGUgYXMgdGhlIHBy ZXZpb3VzIG9uZS4gKi8KKyAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPnByZXYtPnVu ZGVybGluZV90aGlja25lc3M7CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPnByZXYt PnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVy bGluZSB0aGlja25lc3MuICBEZWZhdWx0IGlzIDEgcGl4ZWwuICovCisgICAgICAgICAgICAgICAg ICBpZiAocy0+Zm9udCAmJiBzLT5mb250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4gMCkKKyAgICAg ICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzczsK KyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0g MTsKKyAgICAgICAgICAgICAgICAgIGlmICh4X3VuZGVybGluZV9hdF9kZXNjZW50X2xpbmUpCisg ICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmhlaWdodCAtIHRoaWNrbmVzcykgLSAo cy0+eWJhc2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJsaW5lIHBvc2l0 aW9uLiAgVGhpcyBpcyB0aGUgcmVjb21tZW5kZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICB2 ZXJ0aWNhbCBvZmZzZXQgaW4gcGl4ZWxzIGZyb20gdGhlIGJhc2VsaW5lIHRvIHRoZSB0b3Agb2YK KyAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgdW5kZXJsaW5lLiAgVGhpcyBpcyBhIHNpZ25l ZCB2YWx1ZSBhY2NvcmRpbmcgdG8gdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgc3BlY3Ms IGFuZCBpdHMgZGVmYXVsdCBpcworICAgICAgICAgICAgICAgICAgICAgICAgIFJPVU5EICgobWF4 aW11bSBkZXNjZW50KSAvIDIpLCB3aXRoCisgICAgICAgICAgICAgICAgICAgICAgICAgUk9VTkQo eCkgPSBmbG9vciAoeCArIDAuNSkgICovCisgICAgICAgICAgICAgICAgICAgICAgaWYgKHhfdXNl X3VuZGVybGluZV9wb3NpdGlvbl9wcm9wZXJ0aWVzCisgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIHMtPmZvbnQgJiYgcy0+Zm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uID49IDApCisgICAgICAg ICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPmZvbnQtPnVuZGVybGluZV9wb3NpdGlvbjsK KyAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChzLT5mb250KQorICAgICAgICAgICAgICAg ICAgICAgICAgcG9zaXRpb24gPSAocy0+Zm9udC0+ZGVzY2VudCArIDEpIC8gMjsKKyAgICAgICAg ICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHVu ZGVybGluZV9taW5pbXVtX29mZnNldDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgICAgICAgcG9zaXRpb24gPSBtYXggKHBvc2l0aW9uLCB1bmRlcmxpbmVfbWluaW11bV9vZmZz ZXQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgLyogQ2hlY2sgdGhlIHNhbml0 eSBvZiB0aGlja25lc3MgYW5kIHBvc2l0aW9uLiAgV2Ugc2hvdWxkCisgICAgICAgICAgICAgICAg IGF2b2lkIGRyYXdpbmcgdW5kZXJsaW5lIG91dCBvZiB0aGUgY3VycmVudCBsaW5lIGFyZWEuICov CisgICAgICAgICAgICAgIGlmIChzLT55ICsgcy0+aGVpZ2h0IDw9IHMtPnliYXNlICsgcG9zaXRp b24pCisgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+aGVpZ2h0IC0gMSkgLSAocy0+eWJh c2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQgPCBzLT55YmFz ZSArIHBvc2l0aW9uICsgdGhpY2tuZXNzKQorICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IChz LT55ICsgcy0+aGVpZ2h0KSAtIChzLT55YmFzZSArIHBvc2l0aW9uKTsKKyAgICAgICAgICAgICAg cy0+dW5kZXJsaW5lX3RoaWNrbmVzcyA9IHRoaWNrbmVzczsKKyAgICAgICAgICAgICAgcy0+dW5k ZXJsaW5lX3Bvc2l0aW9uID0gcG9zaXRpb247CisgICAgICAgICAgICAgIHkgPSBzLT55YmFzZSAr IHBvc2l0aW9uOworICAgICAgICAgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX2RlZmF1bHRl ZF9wKQorICAgICAgICAgICAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54 LCB5LCBzLT53aWR0aCwgdGhpY2tuZXNzKTsKKyAgICAgICAgICAgICAgZWxzZQorICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIFhHQ1ZhbHVlcyB4Z2N2OworICAgICAgICAgICAg ICAgICAgWEdldEdDVmFsdWVzIChGUkFNRV9YX0RJU1BMQVkgKHMtPmYpLCBzLT5nYywgR0NGb3Jl Z3JvdW5kLCAmeGdjdik7CisgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVf WF9ESVNQTEFZIChzLT5mKSwgcy0+Z2MsIHMtPmZhY2UtPnVuZGVybGluZV9jb2xvcik7CisgICAg ICAgICAgICAgICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChzLT5mLCBzLT5nYywgcy0+eCwgeSwgcy0+ d2lkdGgsIHRoaWNrbmVzcyk7CisgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJB TUVfWF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aF9zdHJpbmcgKnByZXY7CisgICAgICAgICAgZm9yIChwcmV2ID0gcy0+cHJldjsgcHJl djsgcHJldiA9IHByZXYtPnByZXYpCisgICAgICAgICAgICBpZiAocHJldi0+aGwgIT0gcy0+aGwK KyAgICAgICAgICAgICAgICAmJiBwcmV2LT54ICsgcHJldi0+d2lkdGggKyBwcmV2LT5yaWdodF9v dmVyaGFuZyA+IHMtPngpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBBcyBw cmV2IHdhcyBkcmF3biB3aGlsZSBjbGlwcGVkIHRvIGl0cyBvd24gYXJlYSwgd2UKKyAgICAgICAg ICAgICAgICAgICBtdXN0IGRyYXcgdGhlIHJpZ2h0X292ZXJoYW5nIHBhcnQgdXNpbmcgcy0+aGwg bm93LiAqLworICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNfZmFjZSBzYXZlID0gcHJl di0+aGw7CisgICAgICAgICAgICAgICAgcHJldi0+aGwgPSBzLT5obDsKKyAgICAgICAgICAgICAg ICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKHByZXYsIGN1cnNvcl9nY19wKTsKKyAgICAgICAg ICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywgcHJldik7Cisg ICAgICAgICAgICAgICAgaWYgKHByZXYtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgp CisgICAgICAgICAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHByZXYp OworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIHhfZHJhd19jb21wb3Np dGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHByZXYpOworICAgICAgICAgICAgICAgIHhfcmVz ZXRfY2xpcF9yZWN0YW5nbGVzIChwcmV2LT5mLCBwcmV2LT5nYyk7CisgICAgICAgICAgICAgICAg cHJldi0+aGwgPSBzYXZlOworICAgICAgICAgICAgICAgIHByZXYtPm51bV9jbGlwcyA9IDA7Cisg ICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKHMtPm5leHQpCisgICAgICAgIHsK KyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpuZXh0OworICAgICAgICAgIGZvciAobmV4 dCA9IHMtPm5leHQ7IG5leHQ7IG5leHQgPSBuZXh0LT5uZXh0KQorICAgICAgICAgICAgaWYgKG5l eHQtPmhsICE9IHMtPmhsCisgICAgICAgICAgICAgICAgJiYgbmV4dC0+eCAtIG5leHQtPmxlZnRf b3ZlcmhhbmcgPCBzLT54ICsgcy0+d2lkdGgpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICAvKiBBcyBuZXh0IHdpbGwgYmUgZHJhd24gd2hpbGUgY2xpcHBlZCB0byBpdHMgb3duIGFy ZWEsCisgICAgICAgICAgICAgICAgICAgd2UgbXVzdCBkcmF3IHRoZSBsZWZ0X292ZXJoYW5nIHBh cnQgdXNpbmcgcy0+aGwgbm93LiAqLworICAgICAgICAgICAgICAgIGVudW0gZHJhd19nbHlwaHNf ZmFjZSBzYXZlID0gbmV4dC0+aGw7CisgICAgICAgICAgICAgICAgbmV4dC0+aGwgPSBzLT5obDsK KyAgICAgICAgICAgICAgICBtY194X3NldF9nbHlwaF9zdHJpbmdfZ2MgKG5leHQsIGN1cnNvcl9n Y19wKTsKKyAgICAgICAgICAgICAgICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3Rs eSAocywgbmV4dCk7CisgICAgICAgICAgICAgICAgaWYgKG5leHQtPmZpcnN0X2dseXBoLT50eXBl ID09IENIQVJfR0xZUEgpCisgICAgICAgICAgICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2Zv cmVncm91bmQgKG5leHQpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAg IHhfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKG5leHQpOworICAgICAg ICAgICAgICAgIHhfcmVzZXRfY2xpcF9yZWN0YW5nbGVzIChuZXh0LT5mLCBuZXh0LT5nYyk7Cisg ICAgICAgICAgICAgICAgbmV4dC0+aGwgPSBzYXZlOworICAgICAgICAgICAgICAgIG5leHQtPm51 bV9jbGlwcyA9IDA7CisgICAgICAgICAgICAgICAgbmV4dC0+Y2xpcF9oZWFkID0gcy0+bmV4dDsK KyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAvKiBSZXNldCBjbGlwcGluZy4g Ki8KKyAgeF9yZXNldF9jbGlwX3JlY3RhbmdsZXMgKHMtPmYsIHMtPmdjKTsKKyAgcy0+bnVtX2Ns aXBzID0gMDsKK30KKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKIC8qIERlZmF1bHQgdG8gdXNpbmcgWElNIGlmIGF2YWlsYWJsZS4gICov CiAjaWZkZWYgVVNFX1hJTQogYm9vbCB1c2VfeGltID0gdHJ1ZTsKQEAgLTExMDksNiArMjAxMCwx NiBAQCBzdGF0aWMgdm9pZAogeF91cGRhdGVfYmVnaW4gKHN0cnVjdCBmcmFtZSAqZikKIHsKICAg LyogTm90aGluZyB0byBkby4gICovCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBN VUxUSVBMRS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBmOworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiB9CiAKIC8qIERyYXcgYSB2ZXJ0aWNhbCB3aW5kb3cg Ym9yZGVyIGZyb20gKHgseTApIHRvICh4LHkxKSAgKi8KQEAgLTEyNTQsNiArMjE2NSwxNiBAQCB4 X3VwZGF0ZV9lbmQgKHN0cnVjdCBmcmFtZSAqZikKICAgWEZsdXNoIChGUkFNRV9YX0RJU1BMQVkg KGYpKTsKICAgdW5ibG9ja19pbnB1dCAoKTsKICNlbmRpZgorCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1l ID0gTlVMTDsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAvKiBUaGlzIGZ1 bmN0aW9uIGlzIGNhbGxlZCBmcm9tIHZhcmlvdXMgcGxhY2VzIGluIHhkaXNwLmMKQEAgLTEzMjM4 LDYgKzE0MTU5LDIwIEBAIGV4dGVybiBmcmFtZV9wYXJtX2hhbmRsZXIgeF9mcmFtZV9wYXJtX2hh bmRsZXJzW107CiAKIHN0YXRpYyBzdHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFjZSB4X3JlZGlzcGxh eV9pbnRlcmZhY2UgPQogICB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgeHRlcm0uY2Ag bXVzdCBiZSBpbiB0aGUgZXhhY3Qgc2FtZSBvcmRlciBhcyB0aGUKK2ByZWRpc3BsYXlfaW50ZXJm YWNlJyBpbiBgZGlzcGV4dGVybi5oYCEgKi8KKworICBtY194X2RyYXdfd2luZG93X2N1cnNvciwK KyAgbWNfeF9kcmF3X2dseXBoX3N0cmluZywKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisK KwogICAgIHhfZnJhbWVfcGFybV9oYW5kbGVycywKICAgICBndWlfcHJvZHVjZV9nbHlwaHMsCiAg ICAgZ3VpX3dyaXRlX2dseXBocywK --Multipart_Sun_Jan_26_23:39:20_2020-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs / fill-column). References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Wed, 04 Mar 2020 09:04:02 +0000 Resent-Message-ID: <handler.22873.B22873.158331259928762 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22873 <at> debbugs.gnu.org,17684 <at> debbugs.gnu.org Cc: mbork@HIDDEN, rms@HIDDEN, johnw@HIDDEN, akioburns@HIDDEN, eliz@HIDDEN, drew.adams@HIDDEN Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.158331259928762 (code B ref 22873); Wed, 04 Mar 2020 09:04:02 +0000 Received: (at 22873) by debbugs.gnu.org; 4 Mar 2020 09:03:19 +0000 Received: from localhost ([127.0.0.1]:40344 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1j9Pvy-0007Tp-SA for submit <at> debbugs.gnu.org; Wed, 04 Mar 2020 04:03:18 -0500 Received: from gateway24.websitewelcome.com ([192.185.50.252]:24007) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1j9Pvw-0007TZ-KJ for 22873 <at> debbugs.gnu.org; Wed, 04 Mar 2020 04:03:17 -0500 Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway24.websitewelcome.com (Postfix) with ESMTP id 2685B1993A for <22873 <at> debbugs.gnu.org>; Wed, 4 Mar 2020 03:03:16 -0600 (CST) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id 9Pvvj1qAVXVkQ9PvvjLqtH; Wed, 04 Mar 2020 03:03:16 -0600 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=kfANWl8rg2ub655fc+3KfEwPoU06Lh5DJKIwIKF8wCY=; b=Z9TE5K9qaNYm/Gld4a4dbVw8L/ PJscDdBdMclKecGR+z0dSEVM/0t976f8myM1IIwC6VQScImIaEDjiJKkCtBhdFPj6wcRxcEoUao2v n2MuXGuKvVxZ0rQ3HiTXZYYC/DSRtixkAAI2B5k+S5d0yXr2jQPTEv9wdouhfazE7PlVh6S1RGrnj 7eM/PBIVp2xtmbCsqnDR+FjTAiCvVYSWaWdEt46mNxv7IVX5yFMvPv/yWZ8t55o1Y0YJAURY7tayg FINsStEB9Rm7DAbh4TPZQqyMvRt+vnpTK1wibXSUpPeApIucrSUWax4grYT05mrBQZTZLo8riSH4Y /Nl9WmMg==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:59173 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from <esq@HIDDEN>) id 1j9Pvr-000YYW-HH; Wed, 04 Mar 2020 03:03:14 -0600 Date: Wed, 04 Mar 2020 01:03:10 -0800 Message-ID: <m2o8tcjxv5.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Wed_Mar__4_01:03:10_2020-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1j9Pvr-000YYW-HH X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:59173 X-Source-Auth: lawlist X-Email-Count: 8 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> --Multipart_Wed_Mar__4_01:03:10_2020-1 Content-Type: text/plain; charset=US-ASCII VERSION: 022.007 [03/03/2020] CHANGELOG: - nsterm.m: Bug fix in `mc_ns_draw_window_cursor' relating to a situation where the `cursor_glyph` is NULL and the face_id is invalid. In such a situation, we now use the DEFAULT_FACE_ID. - Pursuant to the written request of Drew Adams on 01-27-2020 to change the name of the "crosshairs.el" Lisp file to something else, said file has been changed to the file name of "+-mode.el". - Miscellaneous tidying-up of code. VIDEOS: w32: https://youtu.be/r3BdJVlsAnQ ns: https://youtu.be/bc1h8jtbXmw x11: https://youtu.be/aCIFhD2Xz5s SCREENSHOTS: https://www.lawlist.com/images/22873_17684_light_dark_backgrounds.png SETUP: Step 1: git clone -b master git://git.sv.gnu.org/emacs.git Step 2: In the new emacs folder, go back to an Emacs version from 07/14/2019: git reset --hard ac57c5093829ee09084c562bbbc1c412179be13d Step 3: From within the new emacs folder created in Step 1, apply the patch: git apply /path/to/the/patch.diff Step 4: ./autogen.sh Step 5: ./configure ... [your custom options] Step 6: make Step 7: make install USAGE: - For a minimal working example of built-in fake cursors, type: M-x mc-test ;;; TURN ON FAKE CURSORS (buffer position, cursor-type, cursor color): (setq mc-conf '((1 "hbar" "magenta") (2 "bar" "purple") (3 "box" "#00FF00") (4 "hollow" "#0000FF") (5 ("hbar" 3) [1.0 0.0 1.0]) (6 ("bar" 3) [0.0 1.0 1.0]) (7 "framed" "OrangeRed"))) ;;; TURN OFF FAKE CURSORS: (setq mc-conf nil) - To try out both the crosshairs feature and the visible fill column indicator feature, type: M-x +-mode - To try out just the visible fill column indicator feature, type: M-x fc-mode - To try out built-in fake cursors with Magnar Sveen's multiple-cursors package, that package must be installed. If the multiple-cursors package is already installed, then just (require '+-mode) and `+-mode.el` will redefine a few of the multiple-cursors functions and set up a few keyboard shortcuts. If the multiple-cursors package by Magnar Sveen is not already installed, then here are two easy ways to install that package: Type: M-x mc-install OR, evaluate the following snippet: (progn (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) (package-refresh-contents) (package-install 'multiple-cursors) (mc/built-in-cursors)) NOTES: - Our journey begins at the outset of `update_window' when `mc_update_window_dryrun' performs a `!draw_p` simulation to create a new cache of fake cursors that are stored in the `w->mc_matrix`. The cache of fake cursors from the previous redisplay is copied to a temporary `mc_matrix` under the name of `old_matrix`. `mc_update_text_area' (used for `!draw_p` / `draw_p` situations) calls `mc_draw_glyphs' (writes glyphs to the glass) followed by `mc_draw_row' (writes fake cursors to the glass immediately thereafter). At the tail end of `mc_update_window_dryrun', `mc_update_window_erase' compares the new `w->mc_matrix` with the `old_matrix` to determine which fake cursors are the same -- setting the `same_p` boolean struct member accordingly for each applicable fake cursor within the `w->mc_matrix`. All fake cursors in the `old_matrix` that are `!same_p` get erased at this juncture. [Fn 1.] After the dryrun is complete, `update_window' does the real thing -- `draw_p`. As to the `from_where` situations of SKIPPED, POST_CHANGED, UNCHANGED, and SET_CURSOR_TWO, `mc_helper' compares the incoming tentative fake cursor with the `w->mc_matrix` to see if it has previously been marked as `same_p` -- if it is `!same_p`, then the fake cursor is drawn and we `return`. Fake cursors that have a `cursor_type` of MC_LEFT_FRINGE_BITMAP or MC_RIGHT_FRINGE_BITMAP are always reset even if they are `same_p`. As to the `from_where` situations of SCRIBE_ONE, SCRIBE_TWO, SCRIBE_THREE, and NOWHERE, `mc_helper' always causes fake cursors to be drawn (because new glyphs were written to the glass, or the area to the right of the display line was cleared) and we `return`. . Fn. 1: Even though writing new glyphs to the glass (SCRIBE_ONE, SCRIBE_TWO, and SCRIBE_THREE) would erase fake cursors within those boundaries, it is still necessary to erase `!same_p` fake cursors prior thereto. This is because `scrolling_window' occurs before new glyphs are written and `rif->scroll_run_hook' may copy one or more rows to other areas of the glass. It is not worth the effort to programmatically track both the _copied_ fake cursors and the _original_ fake cursors from the previous redisplay cycle, whose glyphs may remain where they are in the current redisplay cycle because they satisfy the `GLYPH_EQUAL_P' test. - The rest of our journey takes place wherever `draw_glyphs' would ordinarily be called, excluding `update_text_area'. If features 17684/22873 are active, `mc_redraw_row' calls `mc_draw_glyphs' (writes glyphs to the glass) and fake cursors are written to the glass immediately thereafter (if the coordinates coincide with prerecorded data in the `w->mc_matrix`). The functions containing the aforementioned calls are: . `gui_insert_glyphs' . `gui_fix_overlapping_area' . `draw_row_with_mouse_face' . `expose_area' . `expose_line' . `redraw_overlapped_rows' [which has been incorporated into `update_window'] - As to `mc_scrolling_window', it would appear that there is no tangible benefit to rotating the current/prospective cache of fake cursors to compare the data before removing the fake cursors. When scrolling the display, only _some_ lines are copied to new locations. Areas that are not overwritten may have fake cursors and those may not necessarily be removed if desired/current matrix glyphs are equal. The test for `GLYPH_EQUAL_P' does not take into consideration the existence of a fake cursor, and the glyph (with a fake cursor) may not be updated as a result thereof. As to lines that are not copied, portions may be updated and fake cursors would be removed thereby. `mc_rotate_matrix' and `mc_reverse_vpos' were removed with patch v. 022.002. - NS: As of 09/28/2018 (7946445962372c4255180af45cb7c857f1b0b5fa), the NS port no longer does anything useful during `update_window' except mark dirty rectangles. All drawing is now done when the MacOS calls `drawRect', which in turn calls `expose_frame'. This was done to add support for MacOS Mojave .... TODO: - When an idle-timer fires and point is at the end of a horizontally scrolled line in a narrow window, the temporary horizontal scroll is canceled. Create a minimal working example and file a bug report. (progn (defun test () (interactive) (let ((ov (make-overlay (point) (1+ (point)) nil t t))) (overlay-put ov 'face '(:foreground "red")))) (global-set-key [f5] 'test) (split-window-horizontally) (switch-to-buffer (get-buffer-create "foo")) (setq bidi-display-reordering nil) (setq-local auto-hscroll-mode 'current-line) (dotimes (i 80) (insert (char-to-string (+ 65 i))))) - `ns_draw_window_cursor' calls `ns_clip_to_rect', which does _not_ take `row->clip` into consideration when drawing cursors with `NSRectFill'. When it comes time to draw glyphs on top of the box/hollow family of cursors, `row->clip` is taken into consideration by `get_glyph_string_clip'. Fake cursors can be drawn even though the glyphs cannot, resulting in hollow/box family of cursors without text. The issue can be reproduced with M-x mc-test. [A temporary workaround is to disable `row->clip` while drawing the glyphs.] https://lists.gnu.org/archive/html/emacs-devel/2019-04/msg00009.html - Deal with left/right overwritten glyphs in the w32 and X ports of Emacs. - The current test for `auto_hscroll_mode_p' only looks for `current_line` and all five related tests are based upon that assumption, which may not be true. - Multiple Cursors: If point is in the middle of a composite character, then select a fully composed character so that the fake cursor is visible. - Implement functionality similar to the Lisp multiple-cursors by Magnar Sveen. - Follow up with the Emacs team re bug#32177; i.e., (Current line number shifts one column to the left.) - Follow up with the Emacs team re bug#32060; i.e., Horizontal Scrolling (Current Line): Wrong line gets h-scrolled. - Determine if bug #28936 needs to be fixed and help the Emacs team re same. - Is there any additional meaningful optimization that can be added to the three calls of `mc_pre_scroll_clean'? - There is a bug affecting an older version of Emacs for the NS port that causes partial line flickering when the same characters are grouped together (;;;;;;) and MC_GLYPHLESS cursors are above or below -- having the same background color as the frame; e.g., black on black (used to erase a glyphless cursor). The partial flickering is only noticeable with rapid fire; e.g., holding down the right/left arrow key. When changing the color of the glyphless cursor, the issue is not present. [@lawlist has verified that the X and HPOS coordinates are accurate.] --Multipart_Wed_Mar__4_01:03:10_2020-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="2020_03_03__22_21_51_685.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvKy1tb2RlLmVsIGIvbGlzcC8rLW1vZGUuZWwKbmV3IGZpbGUgbW9k ZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMWJiMGY3NAotLS0gL2Rldi9udWxsCisrKyBiL2xpc3Av Ky1tb2RlLmVsCkBAIC0wLDAgKzEsMTI5MiBAQAorOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Cis7 OzsgRVhBTVBMRTogIFVsdHJhbGlnaHQgaW1wbGVtZW50YXRpb24gb2YgYSBob3Jpem9udGFsIHJ1 bGVyLgorOzs7Cis7OzsgKH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xhY2sgb2Ygc3VwcG9ydC4iCisgICAgKHVubGVzcyBtYy0tZXhlY3V0aW5nLWNv bW1hbmQtZm9yLWZha2UtY3Vyc29yCisgICAgICAoaWYgKGVxIDEgKG1jL251bS1jdXJzb3JzKSkg Ozsgbm8gZmFrZSBjdXJzb3JzPyBkaXNhYmxlIG1jLW1vZGUKKyAgICAgICAgICAobXVsdGlwbGUt Y3Vyc29ycy1tb2RlIDApCisgICAgICAgICh3aGVuIHRoaXMtb3JpZ2luYWwtY29tbWFuZAorICAg ICAgICAgIChsZXQgKChvcmlnaW5hbC1jb21tYW5kIChvciBtYy0tdGhpcy1jb21tYW5kCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjb21tYW5kLXJlbWFwcGluZyB0aGlz LW9yaWdpbmFsLWNvbW1hbmQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHRoaXMtb3JpZ2luYWwtY29tbWFuZCkpKQorICAgICAgICAgICAgOzsgc2tpcCBrZXlib2FyZCBt YWNyb3MsIHNpbmNlIHRoZXkgd2lsbCBnZW5lcmF0ZSBhY3R1YWwgY29tbWFuZHMgdGhhdCBhcmUK KyAgICAgICAgICAgIDs7IGFsc28gcnVuIGluIHRoZSBjb21tYW5kIGxvb3AgLSB3ZSdsbCBoYW5k bGUgdGhvc2UgbGF0ZXIgaW5zdGVhZC4KKyAgICAgICAgICAgICh3aGVuIChmdW5jdGlvbnAgb3Jp Z2luYWwtY29tbWFuZCkKKyAgICAgICAgICAgICAgOzsgaWYgaXQncyBhIGxhbWJkYSwgd2UgY2Fu J3Qga25vdyBpZiBpdCdzIHN1cHBvcnRlZCBvciBub3QKKyAgICAgICAgICAgICAgOzsgLSBzbyBn byBhaGVhZCBhbmQgYXNzdW1lIGl0J3Mgb2ssIGJlY2F1c2Ugd2UncmUganVzdCBvcHRpbWlzdGlj IGxpa2UgdGhhdAorICAgICAgICAgICAgICAoaWYgKG9yIChub3QgKHN5bWJvbHAgb3JpZ2luYWwt Y29tbWFuZCkpCisgICAgICAgICAgICAgICAgICAgICAgOzsgbGFtYmRhIHJlZ2lzdGVyZWQgYnkg c21hcnRyZXAKKyAgICAgICAgICAgICAgICAgICAgICAoc3RyaW5nLXByZWZpeC1wICIoIiAoc3lt Ym9sLW5hbWUgb3JpZ2luYWwtY29tbWFuZCkpKQorICAgICAgICAgICAgICAgICAgKG1jL2V4ZWN1 dGUtY29tbWFuZC1mb3ItYWxsLWZha2UtY3Vyc29ycyBvcmlnaW5hbC1jb21tYW5kKQorICAgICAg ICAgICAgICAgIDs7IHNtYXJ0cmVwIGBpbnRlcm4ncyBjb21tYW5kcyBpbnRvIG93biBvYmFycmF5 IHRvIGhlbHAKKyAgICAgICAgICAgICAgICA7OyBgZGVzY3JpYmUtYmluZGluZ3MnLiAgU28sIGxl dCdzIHJlLWBpbnRlcm4nIGhlcmUgdG8KKyAgICAgICAgICAgICAgICA7OyBtYWtlIHRoZSBjb21t YW5kIGNvbXBhcmFibGUgYnkgYGVxJy4KKyAgICAgICAgICAgICAgICAoc2V0cSBvcmlnaW5hbC1j b21tYW5kIChpbnRlcm4gKHN5bWJvbC1uYW1lIG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAgICAgICAg ICAgICAgICA7OyBvdGhlcndpc2UgaXQncyBhIHN5bWJvbCwgYW5kIHdlIGNhbiBiZSBtb3JlIHRo b3JvdWdoCisgICAgICAgICAgICAgICAgKGlmIChnZXQgb3JpZ2luYWwtY29tbWFuZCAnbWMtLXVu c3VwcG9ydGVkKQorICAgICAgICAgICAgICAgICAgICAobWVzc2FnZSAiJVMgaXMgbm90IHN1cHBv cnRlZCB3aXRoIG11bHRpcGxlIGN1cnNvcnMlcyIKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgb3JpZ2luYWwtY29tbWFuZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZ2V0IG9y aWdpbmFsLWNvbW1hbmQgJ21jLS11bnN1cHBvcnRlZCkpCisgICAgICAgICAgICAgICAgICAod2hl biAoYW5kIG9yaWdpbmFsLWNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG5v dCAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jLS1kZWZhdWx0LWNtZHMtdG8tcnVuLW9uY2UpKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobm90IChtZW1xIG9yaWdpbmFsLWNvbW1hbmQg bWMvY21kcy10by1ydW4tb25jZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChvciBt Yy9hbHdheXMtcnVuLWZvci1hbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICht ZW1xIG9yaWdpbmFsLWNvbW1hbmQgbWMtLWRlZmF1bHQtY21kcy10by1ydW4tZm9yLWFsbCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtZW1xIG9yaWdpbmFsLWNvbW1hbmQgbWMv Y21kcy10by1ydW4tZm9yLWFsbCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICht Yy9wcm9tcHQtZm9yLWluY2x1c2lvbi1pbi13aGl0ZWxpc3Qgb3JpZ2luYWwtY29tbWFuZCkpKQor ICAgICAgICAgICAgICAgICAgICAobWMvZXhlY3V0ZS1jb21tYW5kLWZvci1hbGwtZmFrZS1jdXJz b3JzIG9yaWdpbmFsLWNvbW1hbmQpKSkpCisgICAgICAgICAgICAgICh3aGVuIG1jL3VzZS1idWls dC1pbi1jdXJzb3JzCisgICAgICAgICAgICAgICAgKHNldHEgbWMtY29uZgorICAgICAgICAgICAg ICAgICAgICAgICAgKG1hcGNhcgorICAgICAgICAgICAgICAgICAgICAgICAgICAobGFtYmRhICh4 KSAobGlzdCAob3ZlcmxheS1zdGFydCB4KSAiYmFyIiBuaWwpKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAobWMvYWxsLWZha2UtY3Vyc29ycykpKSkpKSkpKSkKKworICAoZGVmdW4gbWMvbWFy ay1u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LWNvbmYgJygoMSAiaGJhciIgIm1hZ2VudGEiKQorICAgICAgICAgICAgICAg ICAgICAgICgyICJiYXIiICJwdXJwbGUiKQorICAgICAgICAgICAgICAgICAgICAgICgzICJib3gi ICIjMDBGRjAwIikKKyAgICAgICAgICAgICAgICAgICAgICAoNCAiaG9sbG93IiAiIzAwMDBGRiIp CisgICAgICAgICAgICAgICAgICAgICAgKDUgKCJoYmFyIiAzKSBbMS4wIDAuMCAxLjBdKQorICAg ICAgICAgICAgICAgICAgICAgICg2ICgiYmFyIiAzKSBbMC4wIDEuMCAxLjBdKQorICAgICAgICAg ICAgICAgICAgICAgICg3ICJmcmFtZWQiICJPcmFuZ2VSZWQiKQorICAgICAgICAgICAgICAgICAg ICAgICg4ICJib3giICJncmV5MjUiKQorICAgICAgICAgICAgICAgICAgICAgICg5ICJib3giICJn cmV5NzUiKSkpKQorICAgIChzZWxlY3Qtd2luZG93IChkaXNwbGF5LWJ1ZmZlciBidWZmZXIpKSkp CisKKyhkZWZ1biArLXRpbWVyLWZuICgpCisiU2luY2UgdGhpcyBmaXJlcyBnbG9iYWxseSwgd2Ug bXVzdCBjb250cm9sIHdoaWNoIGJ1ZmZlcnMgY3Jvc3NoYWlycyBhcHBlYXIgaW4uIgorICAod2hl biArLW1vZGUKKyAgICAodW5sZXNzIChvciAobWVtcSBsYXN0LWNvbW1hbmQgKy1wYXJlbnMtZXhj bHVzaW9ucykKKyAgICAgICAgICAgICAgICAobnVsbCArLXBhcmVucy1oaWdobGlnaHQpKQorICAg ICAgKCstcGFyZW5zLWZuKSkKKyAgICAod2hlbiArLXRpbWVyLXZhcgorICAgICAgKHNldHEgdGlt ZXItaWRsZS1saXN0IChkZWxxICstdGltZXItdmFyIHRpbWVyLWlkbGUtbGlzdCkpCisgICAgICAo c2V0cSArLXRpbWVyLXZhciBuaWwpKSkpCisKKyhkZWZ1biArLWRyYXctZm9ydGh3aXRoICgpCisi SW1tZWRpYXRlbHkgZGVsZXRlL2RyYXcgbWF0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Bob3Jpem9udGFsIHJ1bGVyLiIKKyAgOmluaXQtdmFsdWUgbmlsCisgIDpsaWdodGVyICIg KyIKKyAgOmtleW1hcCBuaWwKKyAgOmdsb2JhbCBuaWwKKyAgOmdyb3VwICcrLW1vZGUKKyAgKGNv bmQKKyAgICAoKy1tb2RlCisgICAgICA7OzsgYCstbW9kZScgaGFzIHRoZSBhYmlsaXR5IHRvIGFs c28gZGlzcGxheSBhIGZpbGwgY29sdW1uIGluZGljYXRvci4KKyAgICAgIDs7OyBTZWUgdGhlIHZh cmlhYmxlIGArLWZpbGwtY29sdW1uJy4KKyAgICAgICh3aGVuIGZjLW1vZGUKKyAgICAgICAgKGZj LW1vZGUgLTEpKQorICAgICAgKHdoZW4gKGFuZCBnbG9iYWwtZWxkb2MtbW9kZQorICAgICAgICAg ICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAgICAgICAgICAo ZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAoZ2xvYmFsLWVsZG9jLW1v ZGUgLTEpKQorICAgICAgKHdoZW4gKGFuZCBqaXQtbG9jay1jb250ZXh0LXRpbWVyCisgICAgICAg ICAgICAgICAgIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAg IChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVuICh0aW1lcnAg aml0LWxvY2stY29udGV4dC10aW1lcikKKyAgICAgICAgICAoY2FuY2VsLXRpbWVyIGppdC1sb2Nr LWNvbnRleHQtdGltZXIpKQorICAgICAgICA7OyAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVy IChydW4td2l0aC1pZGxlLXRpbWVyIDUuMCAncmVwZWF0ICdqaXQtbG9jay1jb250ZXh0LWZvbnRp ZnkpKQorICAgICAgICAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIG5pbCkpCisgICAgICAo d2hlbiAoYW5kIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAg IChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVuICh0aW1lcnAg dW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpCisgICAgICAgICAgKGNhbmNlbC10aW1l ciB1bmRvLWF1dG8tY3VycmVudC1ib3VuZGFyeS10aW1lcikpCisgICAgICAgIChmc2V0ICd1bmRv LWF1dG8tLXVuZG9hYmxlLWNoYW5nZQorICAgICAgICAgICAgICAobGFtYmRhICgpIChhZGQtdG8t bGlzdCAndW5kby1hdXRvLS11bmRvYWJseS1jaGFuZ2VkLWJ1ZmZlcnMgKGN1cnJlbnQtYnVmZmVy KSkpKQorICAgICAgICAoZnNldCAndW5kby1hdXRvLWFtYWxnYW1hdGUgJ2lnbm9yZSkpCisgICAg ICAod2hlbiBibGluay1jdXJzb3ItbW9kZQorICAgICAgICAoYmxpbmstY3Vyc29yLW1vZGUgLTEp CisgICAgICAgICh3aGVuIChtZW1xICdibGluay1jdXJzb3ItY2hlY2sgcG9zdC1jb21tYW5kLWhv b2spCisgICAgICAgICAgKHJlbW92ZS1ob29rICdwb3N0LWNvbW1hbmQtaG9vayAnYmxpbmstY3Vy c29yLWNoZWNrKSkpCisgICAgICAoc2V0cSBjcm9zc2hhaXJzIHQpCisgICAgICAod2hlbiArLWZp bGwtY29sdW1uCisgICAgICAgIChzZXRxIGZjLXZpc2libGUgdCkpCisgICAgICA7OzsgYGF1dG8t Y29tcG9zaXRpb24tbW9kZScgaXMgbmVlZGVkIGZvciBjcm9zc2hhaXJzIHRvIHByb3Blcmx5IGNh bGN1bGF0ZQorICAgICAgOzs7IGNvb3JkaW5hdGVzIG9mIGNvbXBvc2l0aW9uIGNoYXJhY3RlcnMu ICBBdXRvbWF0aWNhbGx5IGJlY29tZXMgcGVybWFuZW50bHkKKyAgICAgIDs7OyBidWZmZXItbG9j YWwgd2hlbiBzZXQuCisgICAgICAodW5sZXNzIGF1dG8tY29tcG9zaXRpb24tbW9kZQorICAgICAg ICAoc2V0cSBhdXRvLWNvbXBvc2l0aW9uLW1vZGUgdCkpCisgICAgICA7OzsgQGxhd2xpc3QgaXMg Zm9jdXNpbmcgdGhlIGluaXRpYWwgZGV2ZWxvcG1lbnQgb2YgZmVhdHVyZSByZXF1ZXN0cyAjMTc2 ODQKKyAgICAgIDs7OyBhbmQgIzIyODczIG9uIEwyUiBsYW5ndWFnZXMuICBUaGUgZmVhdHVyZSB0 ZXN0IGZpbGUgdXNlZCBieSBAbGF3bGlzdAorICAgICAgOzs7IGJvZ3MgRW1hY3MgZG93biB1bmxl c3MgYGJpZGktZGlzcGxheS1yZW9yZGVyaW5nJyBpcyBzZXQgdG8gYSBuaWwgdmFsdWUuCisgICAg ICA7OzsgSG93ZXZlciwgbW9zdCB1c2VycyB3aWxsIHByb2JhYmx5IG5vdCB3YW50IHRoaXMgcGFy dGljdWxhciBzZXR0aW5nLgorICAgICAgKHVubGVzcyAobnVsbCBiaWRpLWRpc3BsYXktcmVvcmRl cmluZykKKyAgICAgICAgKHNldHEgYmlkaS1kaXNwbGF5LXJlb3JkZXJpbmcgbmlsKSkKKyAgICAg IChzZXQgKG1ha2UtbG9jYWwtdmFyaWFibGUgJystLXNhdmVkLXN0YXRlKSBuaWwpCisgICAgICAo ZG9saXN0ICh2YXIgJyhidWZmZXItZGlzcGxheS10YWJsZQorICAgICAgICAgICAgICAgICAgICAg ZnJpbmdlLWluZGljYXRvci1hbGlzdAorICAgICAgICAgICAgICAgICAgICAgdGFiLXdpZHRoCisg ICAgICAgICAgICAgICAgICAgICBsaW5lLW1vdmUtdmlzdWFsCisgICAgICAgICAgICAgICAgICAg ICB0cnVuY2F0ZS1saW5lcworICAgICAgICAgICAgICAgICAgICAgdHJ1bmNhdGUtcGFydGlhbC13 aWR0aC13aW5kb3dzCisgICAgICAgICAgICAgICAgICAgICB3b3JkLXdyYXApKQorICAgICAgICAo d2hlbiAobG9jYWwtdmFyaWFibGUtcCB2YXIpCisgICAgICAgICAgKHB1c2ggKGNvbnMgdmFyIChz eW1ib2wtdmFsdWUgdmFyKSkgKy0tc2F2ZWQtc3RhdGUpKSkKKyAgICAgIChzZXRxIGZpbGwtY29s dW1uIDgwKQorICAgICAgKHNldHEgZGlzcGxheS1saW5lLW51bWJlcnMgdCkKKyAgICAgIChzZXRx LWxvY2FsIGF1dG8taHNjcm9sbC1tb2RlICdjdXJyZW50LWxpbmUpCisgICAgICAoc2V0cS1sb2Nh bCBoc2Nyb2xsLXN0ZXAgNSkKKyAgICAgIChzZXRxIGJ1ZmZlci1kaXNwbGF5LXRhYmxlICstYnVm ZmVyLWRpc3BsYXktdGFibGUpCisgICAgICAoc2V0cSB0YWItd2lkdGggNCkKKyAgICAgIChzZXQg KG1ha2UtbG9jYWwtdmFyaWFibGUgJ2xpbmUtbW92ZS12aXN1YWwpIHQpCisgICAgICAoc2V0cSB0 cnVuY2F0ZS1saW5lcworICAgICAgICAoY29uZAorICAgICAgICAgICgobGV0ICgobHN0ICstdHJ1 bmNhdGUtbGluZXMtZGVyaXZlZC1tb2RlcykKKyAgICAgICAgICAgICAgICAgIG1vZGUpCisgICAg ICAgICAgICAoY2F0Y2ggJ2ZvdW5kCisgICAgICAgICAgICAgICh3aGlsZSAoc2V0cSBtb2RlIChw b3AgbHN0KSkKKyAgICAgICAgICAgICAgICAod2hlbiAoZGVyaXZlZC1tb2RlLXAgbW9kZSkKKyAg ICAgICAgICAgICAgICAgICh0aHJvdyAnZm91bmQgdCkpKSkpKQorICAgICAgICAgICAoKG1lbXEg bWFqb3ItbW9kZSArLXRydW5jYXRlLWxpbmVzLW1ham9yLW1vZGVzKSkKKyAgICAgICAgICAgKHQK KyAgICAgICAgICAgICBuaWwpKSkKKyAgICAgIChzZXQgKG1ha2UtbG9jYWwtdmFyaWFibGUgJ3Ry dW5jYXRlLXBhcnRpYWwtd2lkdGgtd2luZG93cykgbmlsKQorICAgICAgKHNldHEgd29yZC13cmFw IHQpCisgICAgICAoc2V0cSBpbmRpY2F0ZS1lbXB0eS1saW5lcyB0KQorICAgICAgKHNldHEgaW5k aWNhdGUtYnVmZmVyLWJvdW5kYXJpZXMgJ2xlZnQpCisgICAgICAoc2V0cSBmcmluZ2UtaW5kaWNh dG9yLWFsaXN0CisgICAgICAgICAgOzs7IGhzY2xfYWxsX3RlbXBfcCB8IGhzY2xfdGVtcF9wCisg ICAgICAgICcoKCstaHNjbC10ZW1wIC4gKCstc2luZ2xlLWFuZ2xlLWxlZnQKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgKy1kb3VibGUtYW5nbGUtbGVmdCkpCisgICAgICAgICAgOzs7IGhzY2xf YWxsX3Blcm1fMF9wIHwgaHNjbF9hbGxfcGVybV8xX3AgfCBoc2NsX2FsbF9wZXJtXzJfcCB8IGhz Y2xfcGVybV9wCisgICAgICAgICAgKCstaHNjbC1wZXJtIC4gKCstc2luZ2xlLWFuZ2xlLXVwCisg ICAgICAgICAgICAgICAgICAgICAgICAgICstZG91YmxlLWFuZ2xlLXVwCisgICAgICAgICAgICAg ICAgICAgICAgICAgICstdHJpcGxlLWFuZ2xlLXVwCisgICAgICAgICAgICAgICAgICAgICAgICAg ICstcXVhZHJ1cGxlLWFuZ2xlLXVwKSkKKyAgICAgICAgICAoKy1vdmVybGF5LWFycm93IC4gKCst ZnJpbmdlLWxlZnQtYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICstZnJpbmdl LXJpZ2h0LWFycm93KSkKKyAgICAgICAgICAodHJ1bmNhdGlvbiAuICgrLWZyaW5nZS1sZWZ0LWFy cm93CisgICAgICAgICAgICAgICAgICAgICAgICAgKy1mcmluZ2UtcmlnaHQtYXJyb3cpKQorICAg ICAgICAgIChjb250aW51YXRpb24gLiAoKy1mcmluZ2UtbGVmdC1jdXJseS1hcnJvdworICAgICAg ICAgICAgICAgICAgICAgICAgICAgKy1iYWNrc2xhc2gpKQorICAgICAgICAgIChvdmVybGF5LWFy cm93IC4gKy1mcmluZ2UtcmlnaHQtdHJpYW5nbGUpCisgICAgICAgICAgKHVwIC4gKy1mcmluZ2Ut dXAtYXJyb3cpCisgICAgICAgICAgKGRvd24gLiArLWZyaW5nZS1kb3duLWFycm93KQorICAgICAg ICAgICh0b3AgLiArLWZyaW5nZS10b3AtbGVmdC1hbmdsZSkKKyAgICAgICAgICAoYm90dG9tIC4g Ky1mcmluZ2UtYm90dG9tLXJpZ2h0LWFuZ2xlKQorICAgICAgICAgICh0b3AtYm90dG9tIC4gKCst ZnJpbmdlLWxlZnQtYnJhY2tldAorICAgICAgICAgICAgICAgICAgICAgICAgICstZnJpbmdlLXJp Z2h0LWJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICArLWZyaW5nZS10b3AtcmlnaHQt YW5nbGUKKyAgICAgICAgICAgICAgICAgICAgICAgICArLWZyaW5nZS10b3AtbGVmdC1hbmdsZSkp CisgICAgICAgICAgKGVtcHR5LWxpbmUgLiArLWZyaW5nZS1lbXB0eS1saW5lKQorICAgICAgICAg ICh1bmtub3duIC4gKy1mcmluZ2UtcXVlc3Rpb24tbWFyaykpKQorICAgICAgKHNldHEgZnJpbmdl LWN1cnNvci1hbGlzdCAnKChib3ggLiArLWZyaW5nZS1sZWZ0LXRyaWFuZ2xlKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIChob2xsb3cgLiArLWhvbGxvdy1yZWN0YW5nbGUpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGJhciAuICstdmVydGljYWwtYmFyKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChoYmFyIC4gKy1mcmluZ2UtaG9yaXpv bnRhbC1iYXIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGhvbGxvdy1zbWFs bCAuICstZnJpbmdlLWhvbGxvdy1zcXVhcmUpKSkKKyAgICAgIChpZiAob3IgKy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ICAgICAgICAgICAg ICAgICg9IG9jaGFyIDQwKQorICAgICAgICAgICAgICAgICAgICAgICA7OzsgKGNoYXItdG8tc3Ry aW5nIDkxKSA9PiBvcGVuaW5nIHNxdWFyZSBicmFja2V0CisgICAgICAgICAgICAgICAgICAgICAg ICg9IG9jaGFyIDkxKQorICAgICAgICAgICAgICAgICAgICAgICA7OzsgKGNoYXItdG8tc3RyaW5n IDEyMykgPT4gb3BlbmluZyB3YXZ5IGJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgKD0g b2NoYXIgMTIzKSkpCisgICAgICAgICAgICAgICAgKG1pbiAoMSsgb3BvaW50KSAocG9pbnQtbWF4 KSkpCisgICAgICAgICAgICAgKChvciA7OzsgKGNoYXItdG8tc3RyaW5nIDQxKSA9PiBjbG9zaW5n IHBhcmVudGhlc2lzCisgICAgICAgICAgICAgICAgICAoPSBwcmVjZWRpbmctY2hhciA0MSkKKyAg ICAgICAgICAgICAgICAgIDs7OyAoY2hhci10by1zdHJpbmcgOTMpID0+IGNsb3Npbmcgc3F1YXJl IGJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICg9IHByZWNlZGluZy1jaGFyIDkzKQorICAgICAg ICAgICAgICAgICAgOzs7IChjaGFyLXRvLXN0cmluZyAxMjUpID0+IGNsb3Npbmcgd2F2eSBicmFj a2V0CisgICAgICAgICAgICAgICAgICAoPSBwcmVjZWRpbmctY2hhciAxMjUpKQorICAgICAgICAg ICAgICAgIChtYXggKHBvaW50LW1pbikgKDEtIG9wb2ludCkpKQorICAgICAgICAgICAgICh0Cisg ICAgICAgICAgICAgICAgb3BvaW50KSkpCisgICAgICAgICBwb3MyCisgICAgICAgICBzZWxlY3Rl ZC1mYWNlKQorICAgIChzYXZlLWV4Y3Vyc2lvbgorICAgICAgKGNvbmRpdGlvbi1jYXNlIG5pbAor ICAgICAgICAod2hpbGUgKHNldHEgcG9zMSAobnRoIDEgKHBhcnNlLXBhcnRpYWwtc2V4cCBmcm9t IHBvczEpKSkKKyAgICAgICAgICAoc2V0cSBwb3MyIChzY2FuLXNleHBzIHBvczEgMSkpCisgICAg ICAgICAgKGlmICg9IGkgMTApCisgICAgICAgICAgICAoc2V0cSBpIDEpCisgICAgICAgICAgICAo c2V0cSBpICgxKyBpKSkpCisgICAgICAgICAgKHNldHEgc2VsZWN0ZWQtZmFjZSAoY29uZAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSAxKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICcrLXBhcmVucy1vbmUtZmFjZSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgKCg9IGkgMikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAn Ky1wYXJlbnMtdHdvLWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBp IDMpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLXRocmVlLWZh Y2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDQpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLWZvdXItZmFjZSkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgKCg9IGkgNSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAnKy1wYXJlbnMtZml2ZS1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAoKD0gaSA2KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVu cy1zaXgtZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgNykKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtc2V2ZW4tZmFjZSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgOCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtZWlnaHQtZmFjZSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgKCg9IGkgOSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAnKy1wYXJlbnMtbmluZS1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo KD0gaSAxMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtdGVu LWZhY2UpKSkKKyAgICAgICAgICAobGV0ICgob3YgKG1ha2Utb3ZlcmxheSBwb3MxICgxKyBwb3Mx KSkpKQorICAgICAgICAgICAgKHVubGVzcyArLXBhcmVucy1pbmFjdGl2ZS13aW5kb3dzCisgICAg ICAgICAgICAgIChvdmVybGF5LXB1dCBvdiAnd2luZG93IHdpbikpCisgICAgICAgICAgICAob3Zl cmxheS1wdXQgb3YgJ2ZhY2Ugc2VsZWN0ZWQtZmFjZSkpCisgICAgICAgICAgKHdoZW4gcG9zMgor ICAgICAgICAgICAgKGxldCAoKG92IChtYWtlLW92ZXJsYXkgKDEtIHBvczIpIHBvczIpKSkKKyAg ICAgICAgICAgICAgKHVubGVzcyArLXBhcmVucy1pbmFjdGl2ZS13aW5kb3dzCisgICAgICAgICAg ICAgICAgKG92ZXJsYXktcHV0IG92ICd3aW5kb3cgd2luKSkKKyAgICAgICAgICAgICAgKG92ZXJs YXktcHV0IG92ICdmYWNlIHNlbGVjdGVkLWZhY2UpKSkpCisgICAgICAgIChlcnJvciBuaWwpKSkK KyAgICAoc2V0cSArLXBhcmVucy1vdmVybGF5cy1leGlzdC1wIHQpKSkKKworKGRlZnVuICstcmVt b3ZlLW92ZXJsYXlzIChiZWcgZW5kIG5hbWUgdmFsKQorIlJlbW92ZSB0aGUgb3ZlcmxheXMgdGhh dCBhcmUgYGVxdWFsLWluY2x1ZGluZy1wcm9wZXJ0aWVzYC4KK0luY2x1ZGVzIGEgdW5pcXVlIHNp dHVhdGlvbiB3aGVuIGFuIG92ZXJsYXkgd2l0aCBhbiBgJ2FmdGVyLXN0cmluZ2AgcHJvcGVydHkK K2lzIGF0IHRoZSB2ZXJ5IGVuZCBvZiBhIG5hcnJvd2VkLWJ1ZmZlci4iCisgIChsZXQqICgocG9p bnQtbWF4IChwb2ludC1tYXgpKQorICAgICAgICAgKHBvaW50LW1pbiAocG9pbnQtbWluKSkKKyAg ICAgICAgIChuYXJyb3dlZC1wIChidWZmZXItbmFycm93ZWQtcCkpCisgICAgICAgICAoYmVnIChp ZiBiZWcgYmVnIHBvaW50LW1pbikpCisgICAgICAgICAoZW5kCisgICAgICAgICAgIChjb25kCisg ICAgICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgKG5vdCBuYXJyb3dlZC1wKQorICAg ICAgICAgICAgICAgICBlbmQpCisgICAgICAgICAgICAgICBlbmQpCisgICAgICAgICAgICAgKChh bmQKKyAgICAgICAgICAgICAgICAgKG5vdCBuYXJyb3dlZC1wKQorICAgICAgICAgICAgICAgICAo bnVsbCBlbmQpKQorICAgICAgICAgICAgICAgcG9pbnQtbWF4KQorICAgICAgICAgICAgICgoYW5k CisgICAgICAgICAgICAgICAgIG5hcnJvd2VkLXAKKyAgICAgICAgICAgICAgICAgZW5kCisgICAg ICAgICAgICAgICAgICg8IGVuZCBwb2ludC1tYXgpKQorICAgICAgICAgICAgICAgZW5kKQorICAg ICAgICAgICAgICgoYW5kCisgICAgICAgICAgICAgICAgIG5hcnJvd2VkLXAKKyAgICAgICAgICAg ICAgICAgZW5kCisgICAgICAgICAgICAgICAgICg9IGVuZCBwb2ludC1tYXgpKQorICAgICAgICAg ICAgICAgKDErIGVuZCkpCisgICAgICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFy cm93ZWQtcAorICAgICAgICAgICAgICAgICAobnVsbCBlbmQpKQorICAgICAgICAgICAgICAgKDEr IHBvaW50LW1heCkpICkpCisgICAgICAgICAob3ZlcmxheXMKKyAgICAgICAgICAgKHByb2duCisg ICAgICAgICAgICAgKG92ZXJsYXktcmVjZW50ZXIgZW5kKQorICAgICAgICAgICAgIChvdmVybGF5 cy1pbiBiZWcgZW5kKSkpKQorICAgICh3aGVuIChhbmQgYmVnIGVuZCBuYW1lIHZhbCkKKyAgICAg IChkb2xpc3QgKG8gb3ZlcmxheXMpCisgICAgICAgIChjb25kCisgICAgICAgICAgKChhbmQgKGVx IG5hbWUgJ2ZhY2UpCisgICAgICAgICAgICAgICAgKGVxIChvdmVybGF5LWdldCBvIG5hbWUpIHZh bCkpCisgICAgICAgICAgICA7OyBFaXRoZXIgcHVzaCB0aGlzIG92ZXJsYXkgb3V0c2lkZSBiZWcu Li5lbmQKKyAgICAgICAgICAgIDs7IG9yIHNwbGl0IGl0IHRvIGV4Y2x1ZGUgYmVnLi4uZW5kCisg ICAgICAgICAgICA7OyBvciBkZWxldGUgaXQgZW50aXJlbHkgKGlmIGl0IGlzIGNvbnRhaW5lZCBp biBiZWcuLi5lbmQpLgorICAgICAgICAgICAgKGlmICg8IChvdmVybGF5LXN0YXJ0IG8pIGJlZykK KyAgICAgICAgICAgICAgICAoaWYgKD4gKG92ZXJsYXktZW5kIG8pIGVuZCkKKyAgICAgICAgICAg ICAgKHByb2duCisgICAgICAgICAgICAgICAgKG1vdmUtb3ZlcmxheSAoY29weS1vdmVybGF5IG8p CisgICAgICAgICAgICAgICAgICAob3ZlcmxheS1zdGFydCBvKSBiZWcpCisgICAgICAgICAgICAg ICAgKG1vdmUtb3ZlcmxheSBvIGVuZCAob3ZlcmxheS1lbmQgbykpKQorICAgICAgICAgICAgICAg ICAgKG1vdmUtb3ZlcmxheSBvIChvdmVybGF5LXN0YXJ0IG8pIGJlZykpCisgICAgICAgICAgICAg IChpZiAoPiAob3ZlcmxheS1lbmQgbykgZW5kKQorICAgICAgICAgICAgICAgICAgKG1vdmUtb3Zl cmxheSBvIGVuZCAob3ZlcmxheS1lbmQgbykpCisgICAgICAgICAgICAgICAgKGRlbGV0ZS1vdmVy bGF5IG8pKSkpCisgICAgICAgICAgKChhbmQgKG5vdCAoZXEgbmFtZSAnZmFjZSkpCisgICAgICAg ICAgICAgICAgKGVxdWFsLWluY2x1ZGluZy1wcm9wZXJ0aWVzIChvdmVybGF5LWdldCBvIG5hbWUp IHZhbCkpCisgICAgICAgICAgICAoZGVsZXRlLW92ZXJsYXkgbykpKSkpKSkKKworKGRlZnVuICst ZGVsZXRlLXBhcmVucy1vdmVybGF5cyAoKQorICAod2hlbiArLXBhcmVucy1vdmVybGF5cy1leGlz dC1wCisgICAgKGRvbGlzdCAoZmFjZSAnKCstcGFyZW5zLW9uZS1mYWNlCisgICAgICAgICAgICAg ICAgICAgICstcGFyZW5zLXR3by1mYWNlCisgICAgICAgICAgICAgICAgICAgICstcGFyZW5zLXRo cmVlLWZhY2UKKyAgICAgICAgICAgICAgICAgICAgKy1wYXJlbnMtZm91ci1mYWNlCisgICAgICAg ICAgICAgICAgICAgICstcGFyZW5zLWZpdmUtZmFjZQorICAgICAgICAgICAgICAgICAgICArLXBh cmVucy1zaXgtZmFjZQorICAgICAgICAgICAgICAgICAgICArLXBhcmVucy1zZXZlbi1mYWNlCisg ICAgICAgICAgICAgICAgICAgICstcGFyZW5zLWVpZ2h0LWZhY2UKKyAgICAgICAgICAgICAgICAg ICAgKy1wYXJlbnMtbmluZS1mYWNlCisgICAgICAgICAgICAgICAgICAgICstcGFyZW5zLXRlbi1m YWNlKSkKKyAgICAgICgrLXJlbW92ZS1vdmVybGF5cyBuaWwgbmlsICdmYWNlIGZhY2UpKQorICAg IChzZXRxICstcGFyZW5zLW92ZXJsYXlzLWV4aXN0LXAgbmlsKSkpCisKKzs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7OworCis7OzsgTW9kaWZpY2F0aW9uIGJ5IEBsYXdsaXN0IG9mIG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ICAgICAgICAgICAg ICAgKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAgJ2FueSkKKyAgICAgICAgICAgICAgICAgKGVxdWFs IGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAgICAgICAgKGdsb2JhbC1lbGRvYy1tb2RlIC0x KSkKKyAgICAgICh3aGVuIChhbmQgaml0LWxvY2stY29udGV4dC10aW1lcgorICAgICAgICAgICAg ICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAgICAgICAgICAoZXF1 YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAod2hlbiAodGltZXJwIGppdC1s b2NrLWNvbnRleHQtdGltZXIpCisgICAgICAgICAgKGNhbmNlbC10aW1lciBqaXQtbG9jay1jb250 ZXh0LXRpbWVyKSkKKyAgICAgICAgOzsgKHNldHEgaml0LWxvY2stY29udGV4dC10aW1lciAocnVu LXdpdGgtaWRsZS10aW1lciA1LjAgJ3JlcGVhdCAnaml0LWxvY2stY29udGV4dC1mb250aWZ5KSkK KyAgICAgICAgKHNldHEgaml0LWxvY2stY29udGV4dC10aW1lciBuaWwpKQorICAgICAgKHdoZW4g KGFuZCAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAgICAgICAgICAoZXF1 YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAod2hlbiAodGltZXJwIHVuZG8t YXV0by1jdXJyZW50LWJvdW5kYXJ5LXRpbWVyKQorICAgICAgICAgIChjYW5jZWwtdGltZXIgdW5k by1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpKQorICAgICAgICAoZnNldCAndW5kby1hdXRv LS11bmRvYWJsZS1jaGFuZ2UKKyAgICAgICAgICAgICAgKGxhbWJkYSAoKSAoYWRkLXRvLWxpc3Qg J3VuZG8tYXV0by0tdW5kb2FibHktY2hhbmdlZC1idWZmZXJzIChjdXJyZW50LWJ1ZmZlcikpK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m9yZWdyb3VuZCAid2hpdGUiKQorICAg ICgoKHR5cGUgdHR5KSAoY2xhc3MgbW9ubykpCisgICAgIDppbnZlcnNlLXZpZGVvIHQpCisgICAg KHQgOmZvcmVncm91bmQgInBpbmsiKSkKKyAgIkZhY2UgZm9yIGArLWV2ZW4taW5hY3RpdmUtcHJl LXp2LWZhY2UnLiIKKyAgOmdyb3VwICcrLW1vZGUpCisKKyhkZWZmYWNlICstZXZlbi1hdC16di1m YWNlCisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBkYXJr KSkKKyAgICAgOmZvcmVncm91bmQgIkRlZXBQaW5rMSIpCisgICAgKCgoY2xhc3MgY29sb3IpICht aW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJEZWVw UGluazEiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQg ZGFyaykpCisgICAgIDpmb3JlZ3JvdW5kICJEZWVwUGluazEiKQorICAgICgoKGNsYXNzIGNvbG9y KSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3VuZCAi RGVlcFBpbmsxIikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgOCkpCisgICAgIDpm b3JlZ3JvdW5kICJ3aGl0ZSIpCisgICAgKCgodHlwZSB0dHkpIChjbGFzcyBtb25vKSkKKyAgICAg OmludmVyc2UtdmlkZW8gdCkKKyAgICAodCA6Zm9yZWdyb3VuZCAicGluayIpKQorICAiRmFjZSBm b3IgYCstZXZlbi1hdC16di1mYWNlJy4iCisgIDpncm91cCAnKy1tb2RlKQorCisoZGVmZmFjZSAr LWV2ZW4taW5hY3RpdmUtYXQtenYtZmFjZQorICAnKCgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9y cyA4OCkgKGJhY2tncm91bmQg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pIChiYWNrZ3JvdW5kIGRhcmsp KQorICAgICA6Zm9yZWdyb3VuZCAiUGFsZUdyZWVuNCIpCisgICAgKCgoY2xhc3MgY29sb3IpICht aW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJEYXJr T2xpdmVHcmVlbiIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDE2KSAoYmFja2dy b3VuZCBkYXJrKSkKKyAgICAgOmZvcmVncm91bmQgIlBhbGVHcmVlbjQiKQorICAgICgoKGNsYXNz IGNvbG9yKSAobWluLWNvbG9ycyAxNikgKGJhY2tncm91bmQgbGlnaHQpKQorICAgICA6Zm9yZWdy b3VuZCAiRGFya09saXZlR3JlZW4iKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4 KSkKKyAgICAgOmZvcmVncm91bmQgIndoaXRlIikKKyAgICAoKCh0eXBlIHR0eSkgKGNsYXNzIG1v bm8pKQorICAgICA6aW52ZXJzZS12aWRlbyB0KQorICAgICh0IDpmb3JlZ3JvdW5kICJwaW5rIikp CisgICJGYWNlIGZvciBgKy1wb3N0LWZpbGwtaW5hY3RpdmUtcG9zdC16di1mYWNlJy4iCisgIDpn cm91cCAnKy1tb2RlKQorCisoZGVmZmFjZSBmYy1wcmUtenYtZmFjZQorICAnKCgoKGNsYXNzIGNv bG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpmb3JlZ3JvdW5k ICJncmV5MTUiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91 bmQgbGlnaHQpKQorICAgICA6Zm9yZWdyb3VuZCAiZ3JleTE1IikKKyAgICAoKChjbGFzcyBjb2xv cikgKG1pbi1jb2xvcnMgMTYpIChiYWNrZ3JvdW5kIGRhcmspKQorICAgICA6Zm9yZWdyb3VuZCAi Z3JleTE1IikKKyAgICAoKChj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t PmZjX3Zpc2libGVfID0gdmFsOworfQorCitzdGF0aWMgdm9pZAorYnNldF9mY19pbmFjdGl2ZV93 aW5kb3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7CisgIGItPmZjX2lu YWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogc3RhdGljIHZvaWQKIGJzZXRfYWJicmV2X21v ZGUgKHN0cnVjdCBidWZmZXIgKmIsIExpc3BfT2JqZWN0IHZhbCkKIHsKQEAgLTUxNDUsNiArNTIw OCwyNCBAQCBpbml0X2J1ZmZlcl9vbmNlICh2b2lkKQogICBic2V0X2xhc3Rfc2VsZWN0ZWRfd2lu ZG93ICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBtYWtlX2ZpeG51bSAoMCkpOwogCiAgIGlkeCA9IDE7 CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK KyAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIG1jX3JlYWxfZmFrZV9j dXJzb3IpLCBpZHgpOyArK2lkeDsKKyAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxf ZmxhZ3MsIG1jX2NvbmYpLCBpZHgpOyArK2lkeDsKKyAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZm ZXJfbG9jYWxfZmxhZ3MsIG1jX2luYWN0aXZlX3dpbmRvd3MpLCBpZHgpOyArK2lkeDsKKyAgWFNF VEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxfZmxhZ3MsIGNy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AqLwogCiAg IC8qIHJlYWwgc2V0dXAgaXMgZG9uZSBpbiBiaW5kaW5ncy5lbCAqLworCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGJzZXRfbWNfcmVhbF9m YWtlX2N1cnNvciAoJmJ1ZmZlcl9kZWZhdWx0cywgUWhvbGxvdyk7CisgIGJzZXRfbWNfY29uZiAo JmJ1ZmZlcl9kZWZhdWx0cywgUW5pbCk7CisgIGJzZXRfbWNfaW5hY3RpdmVfd2luZG93cyAoJmJ1 ZmZlcl9kZWZhdWx0cywgUXQpOworICBic2V0X2Nyb3NzaGFpcnMgKCZidWZmZXJfZGVmYXVsdHMs IFFuaWwpOworICBic2V0X2NoX2hvcml6b250YWxfcnVsZXIgKCZidWZmZXJfZGVmYXVsdHMsIFF0 KTsKKyAgYnNldF9jaF92ZXJ0aWNhbF9ydWxlciAoJmJ1ZmZlcl9kZWZhdWx0cywgUXQpOworICBi c2V0X2NoX2luYWN0aXZlX3dpbmRvd3MgKCZidWZmZXJfZGVmYXVsdHMsIFF0KTsKKyAgYnNldF9m Y192aXNpYmxlICgmYnVmZmVyX2RlZmF1bHRzLCBRbmlsKTsKKyAgYnNldF9mY19pbmFjdGl2ZV93 aW5kb3dzICgmYnVmZmVyX2RlZmF1bHRzLCBRdCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKICAgYnNldF9tb2RlX2xpbmVfZm9ybWF0ICgmYnVmZmVyX2RlZmF1bHRzLCBidWlsZF9w dXJlX2Nfc3RyaW5nICgiJS0iKSk7CiAgIGJzZXRfaGVhZGVyX2xpbmVfZm9ybWF0ICgmYnVmZmVy X2RlZmF1bHRzLCBRbmlsKTsKICAgYnNldF9hYmJyZXZ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oYWlycyB2ZXJ0aWNhbCBydWxlci4gKi8pOworCisg IERFRlNZTSAoUWNoX2luYWN0aXZlX3dpbmRvd3MsICJjaC1pbmFjdGl2ZS13aW5kb3dzIik7Cisg IERFRlZBUl9QRVJfQlVGRkVSICgiY2gtaW5hY3RpdmUtd2luZG93cyIsICZCVkFSIChjdXJyZW50 X2J1ZmZlciwgY2hfaW5hY3RpdmVfd2luZG93cyksIFFuaWwsCisgICAgZG9jOiAvKiBXaGVuIG5v bi1uaWwsIGRyYXcgY3Jvc3NoYWlycyBpbiBpbmFjdGl2ZSB3aW5kb3dzLiAqLyk7CisKKyAgREVG U1lNIChRZmNfdmlzaWJsZSwgImZjLXZpc2libGUiKTsKKyAgREVGVkFSX1BFUl9CVUZGRVIgKCJm Yy12aXNpYmxlIiwgJkJWQVIgKGN1cnJlbnRfYnVmZmVyLCBmY192aXNpYmxlKSwgUW5pbCwKKyAg ICBkb2M6IC8qIEEgYnVmZXItbG9jYWwgdmFyaWFibGUgdG8gdHVybiBvbi9vZmYgdGhlIG11bHRp cGxlIGN1cnNvcnMgZmlsbCBjb2x1bW4uICovKTsKKworICBERUZTWU0gKFFmY192aXNpYmxlX2lu YWN0aXZlX3dpbmRvdywgImZjLWluYWN0aXZlLXdpbmRvdyIpOworICBERUZWQVJfUEVSX0JVRkZF UiAoImZjLWluYWN0aXZlLXdpbmRvd3MiLCAmQlZBUiAoY3VycmVudF9idWZmZXIsIGZjX2luYWN0 aXZlX3dpbmRvd3MpLCBRbmlsLAorICAgIGRvYzogLyogV2hlbiBub24tbmlsLCBkcmF3IG11bHRp cGxlIGN1cnNvcnMgZmlsbCBjb2x1bW4gaW4gaW5hY3RpdmUgd2luZG93cy4gKi8pOworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAgIHN0YXRpY3BybyAoJmxhc3Rfb3ZlcmxheV9tb2Rp ZmljYXRpb25faG9va3MpOwogICBsYXN0X292ZXJsYXlfbW9kaWZpY2F0aW9uX2hvb2tzID0gbWFr ZV9uaWxfdmVjdG9yICgxMCk7CiAKZGlmZiAtLWdpdCBhL3NyYy9idWZmZXIuaCBiL3NyYy9idWZm ZXIuaAppbmRleCAyMDgwYTZmLi4xYWRhOTNlIDEwMDY0NAotLS0gYS9zcmMvYnVmZmVyLmgKKysr IGIvc3JjL2J1ZmZlci5oCkBAIC03NDAsNiArNzQwLDQwIEBAIHN0cnVjdCBidWZmZXIKICAgICAg aW4gdGhlIGRpc3BsYXkgb2YgdGhpcyBidWZmZXIuICAqLwogICBMaXNwX09iamVjdCBleHRyYV9s aW5lX3NwYWNpbmdfOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUt Q1VSU09SUyAqLworCisgIC8qIFRoZSBjdXJzb3IgdHlwZSBvZiB0aGUgcmVhbCBmYWtlIGN1cnNv ci4gKi8KKyAgTGlzcF9PYmplY3QgbWNfcmVhbF9mYWtlX2N1cnNvcl87CisKKyAgLyogVGhlIG5h bWUgb2YgbGlzdCB1c2VkIGJ5IG11bHRpcGxlIGN1cnNvcnMgZm9yIG5leHQgcmVkaXNwbGF5LiAq LworICBMaXNwX09iamVjdCBtY19jb25mXzsKKworICAvKiBXaGV0aGVyIHRvIGRyYXcgbXVsdGlw bGUgY3Vyc29ycyBpbiBpbmFjdGl2ZSB3aW5kb3dzLiAqLworICBMaXNwX09iamVjdCBtY19pbmFj dGl2ZV93aW5kb3dzXzsKKworICAvKiBUaGUgbmFtZSBvZiB0aGUgYnVmZmVyLWxvY2FsIHZhcmlh YmxlLiAqLworICBMaXNwX09iamVjdCBjcm9zc2hhaXJzXzsKKworICAvKiBUaGUgbmFtZSBvZiB0 aGUgY3Jvc3NoYWlycyBob3Jpem9udGFsIHJ1bGVyLiAqLworICBMaXNwX09iamVjdCBjaF9ob3Jp em9udGFsX3J1bGVyXzsKKworICAvKiBUaGUgbmFtZSBvZiB0aGUgY3Jvc3NoYWlycyB2ZXJ0aWNh bCBydWxlci4gKi8KKyAgTGlzcF9PYmplY3QgY2hfdmVydGljYWxfcnVsZXJfOworCisgIC8qIFdo ZXRoZXIgdG8gZHJhdyBjcm9zc2hhaXJzIGluIGluYWN0aXZlIHdpbmRvd3MuICovCisgIExpc3Bf T2JqZWN0IGNoX2luYWN0aXZlX3dpbmRvd3NfOworCisgIC8qIFRoZSBuYW1lIG9mIHRoZSBidWZm ZXItbG9jYWwgdmFyaWFibGUuICovCisgIExpc3BfT2JqZWN0IGZjX3Zpc2libGVfOworCisgIC8q IFdoZXRoZXIgdG8gZHJhdyBtdWx0aXBsZSBjdXJzb3JzIGZpbGwgY29sdW1uIGluIGluYWN0aXZl IHdpbmRvd3MuICovCisgIExpc3BfT2JqZWN0IGZjX2luYWN0aXZlX3dpbmRvd3NfOworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIEN1cnNvciB0eXBlIHRvIGRpc3BsYXkgaW4g bm9uLXNlbGVjdGVkIHdpbmRvd3MuCiAgICAgIHQgbWVhbnMgdG8gdXNlIGhvbGxvdyBib3ggY3Vy c29yLgogICAgICBTZWUgYGN1cnNvci10eXBlJyBmb3Igb3RoZXIgdmFsdWVzLiAgKi8KQEAgLTc5 MSwxNCArODI1LDIxIEBAIHN0cnVjdCBidWZmZXIKICAgICAgYW4gaW5kaXJlY3QgYnVmZmVyIHNp bmNlIGl0IGNvdW50cyBhcyBpdHMgYmFzZSBidWZmZXIuICAqLwogICBpbnQgd2luZG93X2NvdW50 OwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ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BmaWVsZHMgaW4gc3RydWN0CiAgICBidWZmZXIuICAoU29tZSBzZXR0ZXJz IHRoYXQgYXJlIHByaXZhdGUgdG8gYSBzaW5nbGUgLmMgZmlsZSBhcmUKICAgIGRlZmluZWQgYXMg c3RhdGljIGluIHRob3NlIGZpbGVzLikgICovCisKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKK0lOTElORSB2b2lkCitic2V0X2Jsdl9t Y19yZWFsX2Zha2VfY3Vyc29yIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7 CisgIGItPm1jX3JlYWxfZmFrZV9jdXJzb3JfID0gdmFsOworfQorCitJTkxJTkUgdm9pZAorYnNl dF9ibHZfbWNfY29uZiAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFsKQoreworICBi LT5tY19jb25mXyA9IHZhbDsKK30KKworSU5MSU5FIHZvaWQKK2JzZXRfYmx2X21jX2luYWN0aXZl X3dpbmRvd3MgKHN0cnVjdCBidWZmZXIgKmIsIExpc3BfT2JqZWN0IHZhbCkKK3sKKyAgYi0+bWNf aW5hY3RpdmVfd2luZG93c18gPSB2YWw7Cit9CisKK0lOTElORSB2b2lkCitic2V0X2Jsdl9jcm9z c2hhaXJzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7CisgIGItPmNyb3Nz aGFpcnNfID0gdmFsOworfQorCitJTkxJTkUgdm9pZAorYnNldF9ibHZfY2hfaG9yaXpvbnRhbF9y dWxlciAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFsKQoreworICBiLT5jaF9ob3Jp em9udGFsX3J1bGVyXyA9IHZhbDsKK30KKworSU5MSU5FIHZvaWQKK2JzZXRfYmx2X2NoX3ZlcnRp Y2Fs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2xlIGludAogI2VuZGlmCiAKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKK2V4dGVybiBi b29sIG1jX3N0ZGVycl9wIEVYVEVSTkFMTFlfVklTSUJMRTsKKworc3RydWN0IGdseXBoOworCitz dHJ1Y3QgZ2x5cGhfcm93OworCitzdHJ1Y3QgZ2x5cGhfbWF0cml4OworCitlbnVtIGRyYXdfZ2x5 cGhzX2ZhY2U7CisKK2VudW0gZ2x5cGhfcm93X2FyZWE7CisKK3N0cnVjdCBtY19tYXRyaXg7CisK K2VudW0gbWNfY2FjaGVfdHlwZTsKKworZW51bSBtY19jdXJzb3JfdHlwZTsKKworZW51bSBtY19m bGF2b3I7CisKK3N0cnVjdCBtY19SR0I7CisKK3N0cnVjdCBtY19lc3NlbnRpYWxzOworCitlbnVt IG1jX2RyYXdfcm93X3R5cGU7CisKK2VudW0gbWNfZW5naW5lX3R5cGU7CisKK2VudW0gbWNfcm93 X3Bvc2l0aW9uOworCitlbnVtIG1jX3JlZHJhd19yb3dfdHlwZTsKKworZW51bSBkcmF3X2dseXBo X2FjdGlvbjsKKworZXh0ZXJuIExpc3BfT2JqZWN0IG1jX2xpc3RuIChwdHJkaWZmX3QsIExpc3Bf T2JqZWN0LCAuLi4pOworCitleHRlcm4gTGlzcF9PYmplY3QgbWNfbnRoIChpbnQsIExpc3BfT2Jq ZWN0KTsKKworZXh0ZXJuIExpc3BfT2JqZWN0IG1jX2Fzc3EgKExpc3BfT2JqZWN0LCBMaXNwX09i amVjdCk7CisKK2V4dGVybiBlbnVtIG1jX3Jvd19wb3NpdGlvbiBtY19yb3dfcG9zaXRpb24gKHN0 cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAg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HJ1Y3QgbWNfbWF0cml4LCBlbnVtIG1jX2NhY2hlX3R5cGUsIGludCwgaW50KTsKKworZXh0ZXJu IHZvaWQgbWNfZHJhd19mcmluZ2VfYml0bWFwIChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlw aF9yb3cgKiwgaW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1j X2N1cnNvcl90eXBlKTsKKworZXh0ZXJuIGludCBtY19nZXRfZnJpbmdlX2JpdG1hcCAoc3RydWN0 IHdpbmRvdyAqLCBMaXNwX09iamVjdCwgaW50LCBpbnQpOworCitleHRlcm4gdm9pZCBtY19lbmdp bmUgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhf cm93ICosCisgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqLCBpbnQsIGludCwg aW50LCBpbnQsIGludCwgaW50LAorICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNv cl90eXBlLCBpbnQsIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwKKyAgICAgICAgICAgICAgICAgICAg ICAgc3RydWN0IG1jX2Vzc2VudGlhbHMsIGVudW0gbWNfcm93X3Bvc2l0aW9uLCBzdHJ1Y3QgbWNf UkdCLAorICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2VuZ2luZV90eXBlLCBib29sLCBl bnVtIG1jX2RyYXdfcm93X3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY2Fj aGVfdHlwZSk7CisKK2V4dGVybiB2b2lkIG1jX3NldF9lc3NlbnRpYWxzIChzdHJ1Y3Qgd2luZG93 ICosIHN0cnVjdCBtY19lc3NlbnRpYWxzICopOworCitleHRlcm4gdm9pZCBtY19kcmF3X3JvdyAo c3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlwaF9yb3cg KiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKiwgaW50LCBpbnQsIGlu dCwgc3RydWN0IGdseXBoX21hdHJpeCAqLAorICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVj dCBtY19lc3NlbnRpYWxzLCBlbnVtIG1jX3Jvd19wb3NpdGlvbiwgYm9vbCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICBlbnVtIG1jX2RyYXdfcm93X3R5cGUpOworCitleHRlcm4gYm9vbCBtY19y ZWRyYXdfcm93IChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwgc3RydWN0 IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBnbHlwaF9yb3df YXJlYSwgaW50LCBpbnQsIGludCwgYm9vbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGVu dW0gZHJhd19nbHlwaHNfZmFjZSwgZW51bSBtY19yZWRyYXdfcm93X3R5cGUpOworCitleHRlcm4g dm9pZCBtY19yZXNldF9jYWNoZSAoc3RydWN0IHdpbmRvdyAqKTsKKworZXh0ZXJuIHZvaWQgbWNf ZHJhd19jdXJzb3JfZ2x5cGggKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAq LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKiwg ZW51bSBkcmF3X2dseXBoc19mYWNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGludCwgaW50LCBpbnQsIHN0cnVjdCBtY19SR0IsIGVudW0gbWNfZmxhdm9yLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUsIGludCwgYm9vbCwg Ym9vbCk7CisKK2V4dGVybiB2b2lkIG1jX2VyYXNlX2N1cnNvciAoc3RydWN0IHdpbmRvdyAqLCBz dHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgc3RydWN0IG1jX21hdHJpeCwgaW50LCBpbnQsIGludCwgaW50LCBlbnVt IG1jX2ZsYXZvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3Jf dHlwZSwgaW50KTsKKworZXh0ZXJuIHZvaWQgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHN0cnVjdCB3 aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBpbnQsIGludCwgaW50LCBpbnQsIGlu dCwgaW50LCBpbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19j dXJzb3JfdHlwZSwgaW50LCBzdHJ1Y3QgbWNfUkdCLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGJvb2wsIGVudW0gbWNfZmxhdm9yLCBib29sKTsKKworZXh0ZXJuIGludCBtY19k cmF3X2dseXBocyAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVj dCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19tYXRy aXgsIGludCwgZW51bSBnbHlwaF9yb3dfYXJlYSwgcHRyZGlmZl90LAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgcHRyZGlmZl90LCBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UsIGludCwgaW50LCBz dHJ1Y3QgbWNfUkdCLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19mbGF2b3Is IGVudW0gbWNfY3Vyc29yX3R5cGUsIGludCwgYm9vbCwgYm9vbCwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgIGVudW0gZHJhd19nbHlwaF9hY3Rpb24sIGJvb2wpOworCitleHRlcm4gc3RydWN0 IGdseXBoX21hdHJpeCAqIG1jX3NhdmVfZ2x5cGhfbWF0cml4IChzdHJ1Y3QgZ2x5cGhfbWF0cml4 ICopOworCitleHRlcm4gdm9pZCBtY19yZXN0b3JlX2dseXBoX21hdHJpeCAoc3RydWN0IGdseXBo X21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICopOworCisvKiBlbmQgTVVMVElQTEUtQ1VS U09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogLyogVGV4dCBjdXJzb3IgdHlw ZXMuICAqLwogCiBlbnVtIHRleHRfY3Vyc29yX2tpbmRzCkBAIC00MDQsNiArNTI5LDE4IEBAIHN0 cnVjdCBnbHlwaF9zbGljZQogCiBzdHJ1Y3QgZ2x5cGgKIHsKKworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBpbnQgcmVsYXRpdmVfeCwgaHBv czsKKworICBwdHJkaWZmX3QgYnl0ZXBvczsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisK KwogICAvKiBQb3NpdGlvbiBmcm9tIHdoaWNoIHRoaXMgZ2x5cGggd2FzIGRyYXduLiAgSWYgYG9i amVjdCcgYmVsb3cgaXMgYQogICAgICBMaXNwIHN0cmluZywgdGhpcyBpcyBhbiBpbmRleCBpbnRv IHRoYXQgc3RyaW5nLiAgSWYgaXQgaXMgYQogICAgICBidWZmZXIsIHRoaXMgaXMgYSBwb3NpdGlv biBpbiB0aGF0IGJ1ZmZlci4gIEluIGFkZGl0aW9uLCBzb21lCkBAIC0xMjcwLDYgKzE0MDcsMjgg QEAgZW51bSBkcmF3X2dseXBoc19mYWNlCiAKIHN0cnVjdCBnbHlwaF9zdHJpbmcKIHsKKworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIGJv b2xfYmYgbGVmdF9vdmVyd3JpdHRlbl9wIDogMTsKKworICAgIGJvb2xfYmYgcmlnaHRfb3Zlcndy aXR0ZW5fcCA6IDE7CisKKyAgICBib29sX2JmIHJlY3RhbmdsZV9udWtlZF9wIDogMTsKKworICAg IGJvb2xfYmYgYmFja2dyb3VuZF9udWtlZF9wIDogMTsKKworICAgIGVudW0gZHJhd19nbHlwaF9h Y3Rpb24KKyAgICB7CisgICAgICBNQ19EUkFXX0dMWVBIX1NUUklORywKKyAgICAgIE1DX0VSQVNF X0dMWVBIX1NUUklORworICAgIH0gYWN0aW9uX3R5cGU7CisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKICAgLyogWC1vcmlnaW4gb2YgdGhlIHN0cmluZy4gICovCiAgIGludCB4OwogCkBA IC0yODM0LDYgKzI5OTMsMjkgQEAgdHlwZWRlZiB2b2lkICgqZnJhbWVfcGFybV9oYW5kbGVyKSAo c3RydWN0IGZyYW1lICosIExpc3BfT2JqZWN0LCBMaXNwX09iamVjdCk7CiAKIHN0cnVjdCByZWRp c3BsYXlfaW50ZXJmYWNlCiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRpc3BsYXlfaW50Z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GVudW0g bWNfZmxhdm9yIGdseXBoX2ZsYXZvciwgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSwg aW50IHdkLAorICAgICAgICBib29sIGFjdGl2ZV9wLCBib29sIGN1cnNvcl9nY19wKTsKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBIYW5kbGVycyBmb3Igc2V0dGluZyBmcmFt ZSBwYXJhbWV0ZXJzLiAgKi8KICAgZnJhbWVfcGFybV9oYW5kbGVyICpmcmFtZV9wYXJtX2hhbmRs ZXJzOwogCmRpZmYgLS1naXQgYS9zcmMvZGlzcG5ldy5jIGIvc3JjL2Rpc3BuZXcuYwppbmRleCAw MTMxYjYzLi44NTg3ZmViIDEwMDY0NAotLS0gYS9zcmMvZGlzcG5ldy5jCisrKyBiL3NyYy9kaXNw bmV3LmMKQEAgLTU2LDYgKzU2LDE3ODIgQEAgYWxvbmcgd2l0aCBHTlUgRW1hY3MuICBJZiBub3Qs IHNlZSA8aHR0cHM6Ly93d3cuZ251Lm9yZy9saWNlbnNlcy8+LiAgKi8KICNpbmNsdWRlICJ3MzIu aCIKICNlbmRpZgogDAorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4gTVVM VElQTEUtQ1VSU09SUyAqLworCitzdHJ1Y3QgZ2x5cGhzX3NraXBwZWQKK3sKKyAgcHRyZGlmZl90 IGFsbG9jYXRlZDsKKyAgcHRyZGlmZl90IHVzZWQ7CisgIHN0cnVjdCBza2lwcGVkX2l0ZW1zCisg ICAgeworICAgICAgaW50IHg7CisgICAgICBpbnQgaHBvczsKKyAgICAgIGJvb2wgZW5hYmxlZF9w OworICAgIH0gKnNraXBwZWQ7Cit9IGFycmF5X2dseXBoc19za2lwcGVkOworCitzdH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2x5 cGhfcm93ICpjID0gTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIGkpOworICAgICAgaWYgKGMt PmVuYWJsZWRfcAorICAgICAgICAgICYmIGQtPmVuYWJsZWRfcAorICAgICAgICAgICYmICFkLT5y ZWRyYXdfZnJpbmdlX2JpdG1hcHNfcAorICAgICAgICAgICYmIGMtPnkgPT0gZC0+eQorICAgICAg ICAgICYmIE1BVFJJWF9ST1dfQk9UVE9NX1kgKGMpIDw9IHliCisgICAgICAgICAgJiYgTUFUUklY X1JPV19CT1RUT01fWSAoZCkgPD0geWIKKyAgICAgICAgICAmJiByb3dfZXF1YWxfcCAoYywgZCwg MSkpCisgICAgICAgIHsKKyAgICAgICAgICBhc3NpZ25fcm93IChjLCBkKTsKKyAgICAgICAgICBk LT5lbmFibGVkX3AgPSBmYWxzZTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAg YnJlYWs7CisgICAgfQorI2lmZGVmIEhBVkVfWFdJREdFVFMKKyAgLyogQ3VycmVudGx5IHRoaXMg c2VlbXMgbmVlZGVkIHRvIGRldGVjdCB4d2lkZ2V0IG1vdmVtZW50IHJlbGlhYmx5LiAqLworICAg IHJldHVybiAwOworI2VuZGlmCisgIC8qIEdpdmUgdXAgaWYgc29tZSByb3dzIGluIHRoZSBkZXNp cmVkIG1hdHJpeCBhcmUgbm90IGVuYWJsZWQuICovCisgIGlmICghIE1BVFJJWF9ST1dfRU5BQkxF RF9QIChkZXNpcmVkX21hdHJpeCwgaSkpCisgICAgcmV0dXJuIC0xOworICBmaXJzdF9vbGQgPSBm aXJzdF9uZXcgPSBpOworICAvKiBTZXQgbGFzdF9uZXcgdG8gdGhlIGluZGV4ICsgMSBvZiB0aGUg cm93IHRoYXQgcmVhY2hlcyB0aGUKKyAgICAgYm90dG9tIGJvdW5kYXJ5IGluIHRoZSBkZXNpcmVk IG1hdHJpeC4gIEdpdmUgdXAgaWYgd2UgZmluZCBhCisgICAgIGRpc2FibGVkIHJvdyBiZWZvcmUg d2UgcmVhY2ggdGhlIGJvdHRvbSBib3VuZGFyeS4gKi8KKyAgaSA9IGZpcnN0X25ldyArIDE7Cisg IHdoaWxlIChpIDwgZGVzaXJlZF9tYXRyaXgtPm5yb3dzIC0gMSkKKyAgICB7CisgICAgICBpbnQg Ym90dG9tOworICAgICAgaWYgKCEgTUFUUklYX1JPV19FTkFCTEVEX1AgKGRlc2lyZWRfbWF0cml4 LCBpKSkKKyAgICAgICAgcmV0dXJuIDA7CisgICAgICBib3R0b20gPSBNQVRSSVhfUk9XX0JPVFRP TV9ZIChNQVRSSVhfUk9XIChkZXNpcmVkX21hdHJpeCwgaSkpOworICAgICAgaWYgKGJvdHRvbSA8 PSB5YikKKyAgICAgICAgKytpOworICAgICAgaWYgKGJvdHRvbSA+PSB5YikKKyAgICAgICAgYnJl YWs7CisgICAgfQorICBsYXN0X25ldyA9IGk7CisgIC8qIFNldCBsYXN0X29sZCB0byB0aGUgaW5k ZXggKyAxIG9mIHRoZSByb3cgdGhhdCByZWFjaGVzIHRoZSBib3R0b20KKyAgICAgYm91bmRhcnkg aW4gdGhlIGN1cnJlbnQgbWF0cml4LiAgV2UgZG9uJ3QgbG9vayBhdCB0aGUgZW5hYmxlZAorICAg ICBmbGFnIGhlcmUgYmVjYXVzZSB3ZSBwbGFuIHRvIHJldXNlIHBhcnQgb2YgdGhlIGRpc3BsYXkg ZXZlbiBpZgorICAgICBvdGhlciBwYXJ0cyBhcmUgZGlzYWJsZWQuICovCisgIGkgPSBmaXJzdF9v bGQgKyAxOworICB3aGlsZSAoaSA8IGN1cnJlbnRfbWF0cml4LT5ucm93cyAtIDEpCisgICAgewor ICAgICAgaW50IGJvdHRvbSA9IE1BVFJJWF9ST1dfQk9UVE9NX1kgKE1BVFJJWF9ST1cgKGN1cnJl bnRfbWF0cml4LCBpKSk7CisgICAgICBpZiAoYm90dG9tIDw9IHliKQorICAgICAgICArK2k7Cisg ICAgICBpZiAoYm90dG9tID49IHliKQorICAgICAgICBicmVhazsKKyAgICB9CisgIGxhc3Rfb2xk ID0gaTsKKyAgLyogU2tpcCBvdmVyIHJvd3MgZXF1YWwgYXQgdGhlIGJvdHRvbS4gKi8KKyAgaSA9 IGxhc3RfbmV3OworICBqID0gbGFzdF9vbGQ7CisgIHdoaWxlIChpIC0gMSA+IGZpcnN0X25ldwor ICAgICAgICAgJiYgaiAtIDEgPiBmaXJzdF9vbGQKKyAgICAgICAgICYmIE1BVFJJWF9ST1dfRU5B QkxFRF9QIChjdXJyZW50X21hdHJpeCwgaiAtIDEpCisgICAgICAgICAmJiAoTUFUUklYX1JPVyAo Y3VycmVudF9tYXRyaXgsIGogLSAxKS0+eQorICAgICAgICAgICAgID09IE1BVFJJWF9ST1cgKGRl c2lyZWRfbWF0cml4LCBpIC0gMSktPnkpCisgICAgICAgICAmJiAhTUFUUklYX1JPVyAoZGVzaXJl ZF9tYXRyaXgsIGkgLSAxKS0+cmVkcmF3X2ZyaW5nZV9iaXRtYXBzX3AKKyAgICAgICAgICYmIHJv d19lcXVhbF9wIChNQVRSSVhfUk9XIChkZXNpcmVkX21hdHJpeCwgaSAtIDEpLAorICAgICAgICAg ICAgICAgICAgICAgICAgIE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCBqIC0gMSksIDEpKQor ICAgIC0taSwgLS1qOworICBsYXN0X25ldyA9IGk7CisgIGxhc3Rfb2xkID0gajsKKyAgLyogTm90 aGluZyB0byBkbyBpZiBhbGwgcm93cyBhcmUgZXF1YWwuICovCisgIGlmIChsYXN0X25ldyA9PSBm aXJzdF9uZXcpCisgICAgcmV0dXJuIDA7CisgIC8qIENoZWNrIGZvciBpbnRlZ2VyIG92ZXJmbG93 IGluIHNpemUgY2FsY3VsYXRpb24uCisgICAgIElmIG5leHRfYWxtb3N0X3ByaW1lIGNoZWNrcyAo TikgZm9yIGRpdmlzaWJpbGl0eSBieSAyLi4xMCwgdGhlbgorICAgICBpdCBjYW4gcmV0dXJuIGF0 IG1vc3Q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jdXJyZW50X21hdHJpeC0+bnJvd3MgPiBtY19v bGRfbGluZXNfc2l6ZSkKKyAgICBtY19vbGRfbGluZXMgPSB4cGFsbG9jIChtY19vbGRfbGluZXMs ICZtY19vbGRfbGluZXNfc2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50X21h dHJpeC0+bnJvd3MgLSBtY19vbGRfbGluZXNfc2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICBJTlRfTUFYLCBzaXplb2YgKm1jX29sZF9saW5lcyk7CisgIGlmIChkZXNpcmVkX21hdHJpeC0+ bnJvd3MgPiBtY19uZXdfbGluZXNfc2l6ZSkKKyAgICBtY19uZXdfbGluZXMgPSB4cGFsbG9jICht Y19uZXdfbGluZXMsICZtY19uZXdfbGluZXNfc2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICBkZXNpcmVkX21hdHJpeC0+bnJvd3MgLSBtY19uZXdfbGluZXNfc2l6ZSwKKyAgICAgICAgICAg ICAgICAgICAgICAgICBJTlRfTUFYLCBzaXplb2YgKm1jX25ld19saW5lcyk7CisgIG4gPSBkZXNp cmVkX21hdHJpeC0+bnJvd3M7CisgIG4gKz0gY3VycmVudF9tYXRyaXgtPm5yb3dzOworICBpZiAo bWNfcm93X3RhYmxlX3NpemUgPCAzICogbikKKyAgICB7CisgICAgICBwdHJkaWZmX3Qgc2l6ZSA9 IG5leHRfYWxtb3N0X3ByaW1lICgzICogbik7CisgICAgICBtY19yb3dfdGFibGUgPSB4bnJlYWxs b2MgKG1jX3Jvd190YWJsZSwgc2l6ZSwgc2l6ZW9mICptY19yb3dfdGFibGUpOworICAgICAgbWNf cm93X3RhYmxlX3NpemUgPSBzaXplOworICAgICAgbWVtc2V0IChtY19yb3dfdGFibGUsIDAsIHNp emUgKiBzaXplb2YgKm1jX3Jvd190YWJsZSk7CisgICAgfQorICBpZiAobiA+IG1jX3Jvd19lbnRy eV9wb29sX3NpemUpCisgICAgbWNfcm93X2VudHJ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19vbGRfbGluZXNbaV0gPSBlbnRyeTsKKyAgICAgICAgICArK2VudHJ5LT5vbGRfdXNl czsKKyAgICAgICAgfQorICAgICAgZWxzZQorICAgICAgICBtY19vbGRfbGluZXNbaV0gPSBOVUxM OworICAgIH0KKyAgZm9yIChpID0gZmlyc3RfbmV3OyBpIDwgbGFzdF9uZXc7ICsraSkKKyAgICB7 CisgICAgICBlYXNzZXJ0IChNQVRSSVhfUk9XX0VOQUJMRURfUCAoZGVzaXJlZF9tYXRyaXgsIGkp KTsKKyAgICAgIGVudHJ5ID0gbWNfYWRkX3Jvd19lbnRyeSAoTUFUUklYX1JPVyAoZGVzaXJlZF9t YXRyaXgsIGkpKTsKKyAgICAgICsrZW50cnktPm5ld191c2VzOworICAgICAgZW50cnktPm5ld19s aW5lX251bWJlciA9IGk7CisgICAgICBtY19uZXdfbGluZXNbaV0gPSBlbnRyeTsKKyAgICB9Cisg IC8qIElkZW50aWZ5IG1vdmVzIGJhc2VkIG9uIGxpbmVzIHRoYXQgYXJlIHVuaXF1ZSBhbmQgZXF1 YWwKKyAgICAgaW4gYm90aCBtYXRyaWNlcy4gKi8KKyAgZm9yIChpID0gZmlyc3Rfb2xkOyBpIDwg bGFzdF9vbGQ7KQorICAgIGlmIChtY19vbGRfbGluZXNbaV0KKyAgICAgICAgJiYgbWNfb2xkX2xp bmVzW2ldLT5vbGRfdXNlcyA9PSAxCisgICAgICAgICYmIG1jX29sZF9saW5lc1tpXS0+bmV3X3Vz ZXMgPT0gMSkKKyAgICAgIHsKKyAgICAgICAgaW50IHAsIHE7CisgICAgICAgIGludCBuZXdfbGlu ZSA9IG1jX29sZF9saW5lc1tpXS0+bmV3X2xpbmVfbnVtYmVyOworICAgICAgICBzdHJ1Y3QgcnVu ICpydW4gPSBtY19ydW5fcG9vbCArIHJ1bl9pZHgrKzsKKyAgICAgICAgLyogUmVjb3JkIG1vdmUu ICovCisgICAgICAgIHJ1bi0+Y3VycmVudF92cG9zID0gaTsKKyAgICAgICAgcnVuLT5jdXJyZW50 X3kgPSBNQVRSSVhfUk9XIChjdXJyZW50X21hdHJpeCwgaSktPnk7CisgICAgICAgIHJ1bi0+ZGVz aXJlZF92cG9zID0gbmV3X2xpbmU7CisgICAgICAgIHJ1bi0+ZGVzaXJlZF95ID0gTUFUUklYX1JP VyAoZGVzaXJlZF9tYXRyaXgsIG5ld19saW5lKS0+eTsKKyAgICAgICAgcnVuLT5ucm93cyA9IDE7 CisgICAgICAgIHJ1bi0+aGVpZ2h0ID0gTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIGkpLT5o ZWlnaHQ7CisgICAgICAgIC8qIEV4dGVuZCBiYWNrd2FyZC4gKi8KKyAgICAgICAgcCA9IGkgLSAx OworICAgICAgICBxID0gbmV3X2xpbmUgLSAxOworICAgICAgICB3aGlsZSAocCA+IGZpcnN0X29s ZAorICAgICAgICAgICAgICAgJiYgcSA+IGZpcnN0X25ldworICAgICAgICAgICAgICAgJiYgbWNf b2xkX2xpbmVzW3BdID09IG1jX25ld19saW5lc1txXSkKKyAgICAgICAgICB7CisgICAgICAgICAg ICBpbnQgaCA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCBwKS0+aGVpZ2h0OworICAgICAg ICAgICAgLS1ydW4tPmN1cnJlbnRfdnBvczsKKyAgICAgICAgICAgIC0tcnVuLT5kZXNpcmVkX3Zw b3M7CisgICAgICAgICAgICArK3J1bi0+bnJvd3M7CisgICAgICAgICAgICBydW4tPmhlaWdodCAr PSBoOworICAgICAgICAgICAgcnVuLT5kZXNpcmVkX3kgLT0gaDsKKyAgICAgICAgICAgIHJ1bi0+ Y3VycmVudF95IC09IGg7CisgICAgICAgICAgICAtLXAsIC0tcTsKKyAgICAgICAgICB9CisgICAg ICAgIC8qIEV4dGVuZCBmb3J3YXJkLiAqLworICAgICAgICBwID0gaSArIDE7CisgICAgICAgIHEg PSBuZXdfbGluZSArIDE7CisgICAgICAgIHdoaWxlIChwIDwgbGFzdF9vbGQKKyAgICAgICAgICAg ICAgICYmIHEgPCBsYXN0X25ldworICAgICAgICAgICAgICAgJiYgbWNfb2xkX2xpbmVzW3BdID09 IG1jX25ld19saW5lc1txXSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpbnQgaCA9IE1BVFJJ WF9ST1cgKGN1cnJlbnRfbWF0cml4LCBwKS0+aGVpZ2h0OworICAgICAgICAgICAgKytydW4tPm5y b3dzOworICAgICAgICAgICAgcnVuLT5oZWlnaHQgKz0gaDsKKyAgICAgICAgICAgICsrcCwgKytx OworICAgICAgICAgIH0KKyAgICAgICAgLyogSW5zZXJ0IHJ1biBpbnRvIGxpc3Qgb2YgYWxsIHJ1 bnMuICBPcmRlciBydW5zIGJ5IGNvcGllZAorICAgICAgICAgICBwaXhlbCBsaW5lcy4gIE5vdGUg dGhhdCB3ZSByZWNvcmQgcnVucyB0aGF0IGRvbid0IGhhdmUgdG8KKyAgICAgICAgICAgYmUgY29w aWVkIGJlY2F1c2UgdGhleSBhcmUgYWxyZWFkeSBpbiBwbGFjZS4gIFRoaXMgaXMgZG9uZQorICAg ICAgICAgICBiZWNhdXNlIHdlIGNhbiBhdm9pZCBjYWxsaW5nIHVwZGF0ZV93aW5kb3dfbGluZSBp biB0aGlzCisgICAgICAgICAgIGNhc2UuICovCisgICAgICAgIGZvciAocCA9IDA7IHAgPCBucnVu cyAmJiBtY19ydW5zW3BdLT5oZWlnaHQgPiBydW4tPmhlaWdodDsgKytwKQorICAgICAgICAgIDsK KyAgICAgICAgZm9yIChxID0gbnJ1bnM7IHEgPiBwOyAtLXEpCisgICAgICAgICAgbWNfcnVuc1tx XSA9IG1jX3J1bnNbcSAtIDFdOworICAgICAgICBtY19ydW5zW3BdID0gcnVuOworICAgICAgICAr K25ydW5zOworICAgICAgICBpICs9IHJ1bi0+bnJvd3M7CisgICAgICB9CisgICAgICBlbHNlCisg ICAgICAgICsraTsKKyAgLyogRG8gdGhlIG1vdmVzLiAgRG8gaXQgaW4gYSB3YXkgdGhhdCB3ZSBk b24ndCBvdmVyd3JpdGUgc29tZXRoaW5nCisgICAgIHdlIHdhbnQgdG8gY29weSBsYXRlciBvbi4g IFRoaXMgaXMgbm90IHNvbHZhYmxlIGluIGdlbmVyYWwKKyAgICAgYmVjYXVzZSB0aGVyZSBpcyBv bmx5IG9uZSBkaXNwbGF5IGFuZCB3ZSBkb24ndCBoYXZlIGEgd2F5IHRvCisgICAgIGV4Y2hhbmdl IGFyZWFzIG9uIHRoaXMgZGlzcGxheS4gIEV4YW1wbGU6CisgICAgICAgICAgKy0tLS0tLS0tLS0t KyAgICAgICArLS0tLS0tLS0tLS0rCisgICAgICAgICAgfCAgICAgQSAgICAgfCAgICAgICB8ICAg ICBCICAgICB8CisgICAgICAgICAgKy0tLS0tLS0tLS0tKyAgLS0+ICArLS0tLS0tLS0tLS0rCisg ICAgICAgICAgfCAgICAgQiAgICAgfCAgICAgICB8ICAgICBBICAgICB8CisgICAgICAgICAgKy0t LS0tLS0tLS0tKyAgICAgICArLS0tLS0tLS0tLS0rCisgICAgIEluc3RlYWQsIHByZWZlciBiaWdn ZXIgbW92ZXMsIGFuZCBpbnZhbGlkYXRlIG1vdmVzIHRoYXQgd291bGQKKyAgICAgY29weSBmcm9t IHdoZXJlIHdlIGNvcGllZCB0by4gKi8KKyAgZm9yIChpID0gMDsgaSA8IG5ydW5zOyArK2kpCisg ICAgaWYgKG1jX3J1bnNbaV0tPm5yb3dzID4gMCkKKyAgICAgIHsKKyAgICAgICAgc3RydWN0IHJ1 biAqciA9IG1jX3J1bnNbaV07CisgICAgICAgIGlmIChyLT5jdXJyZW50X3kgIT0gci0+ZGVzaXJl ZF95KQorICAgICAgICAgIHsKKyAgICAgICAgICAgIC8vICBmcHJpbnRmIChzdGRlcnIsICIlczog IHItPmN1cnJlbnQvZGVzaXJlZF92cG9zICglZC8lZCkgfCByLT5jdXJyZW50L2Rlc2lyZWRfeSAo JWQvJWQpXG4iLAorICAgICAgICAgICAgLy8gICAgICAgICAgIHItPmN1cnJlbnRfeSA8IHItPmRl c2lyZWRfeSA/ICLihpMiIDogIuKGkSIsCisgICAgICAgICAgICAvLyAgICAgICAgICAgci0+Y3Vy cmVudF92cG9zLCByLT5kZXNpcmVkX3Zwb3MsIHItPmN1cnJlbnRfeSwgci0+ZGVzaXJlZF95KTsK KyAgICAgICAgICAgIC8vICByaWYtPmNsZWFyX3dpbmRvd19tb3VzZV9mYWNlICh3KTsKKyAgICAg ICAgICAgIC8vICByaWYtPnNjcm9sbF9ydW5faG9vayAodywgcik7CisgICAgICAgICAgfQorICAg ICAgICAvKiBUcnVuY2F0ZSBydW5zIHRoYXQgY29weSB0byB3aGVyZSB3ZSBjb3BpZWQgdG8sIGFu ZAorICAgICAgICAgICBpbnZhbGlkYXRlIHJ1bnMgdGhhdCBjb3B5IGZyb20gd2hlcmUgd2UgY29w aWVkIHRvLiAqLworICAgICAgICBmb3IgKGogPSBucnVucyAtIDE7IGogPiBpOyAtLWopCisgICAg ICAgICAgeworICAgICAgICAgICAgc3RydWN0IHJ1biAqcCA9IG1jX3J1bnNbal07CisgICAgICAg ICAgICBib29sIHRydW5jYXRlZF9wID0gMDsKKyAgICAgICAgICAgIGlmIChwLT5ucm93cyA+IDAK KyAgICAgICAgICAgICAgICAmJiBwLT5kZXNpcmVkX3kgPCByLT5kZXNpcmVkX3kgKyByLT5oZWln aHQKKyAgICAgICAgICAgICAgICAmJiBwLT5kZXNpcmVkX3kgKyBwLT5oZWlnaHQgPiByLT5kZXNp cmVkX3kpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAocC0+ZGVzaXJlZF95 IDwgci0+ZGVzaXJlZF95KQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg ICBwLT5ucm93cyA9IHItPmRlc2lyZWRfdnBvcyAtIHAtPmRlc2lyZWRfdnBvczsKKyAgICAgICAg ICAgICAgICAgICAgcC0+aGVpZ2h0ID0gci0+ZGVzaXJlZF95IC0gcC0+ZGVzaXJlZF95OworICAg ICAgICAgICAgICAgICAgICB0cnVuY2F0ZWRfcCA9IDE7CisgICAgICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg ICAgICBpbnQgbnJvd3NfY29waWVkID0gKHItPmRlc2lyZWRfdnBvcyArIHItPm5yb3dzCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBwLT5kZXNpcmVkX3Zwb3MpOwor ICAgICAgICAgICAgICAgICAgICBpZiAocC0+bnJvd3MgPD0gbnJvd3NfY29waWVkKQorICAgICAg ICAgICAgICAgICAgICAgIHAtPm5yb3dzID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICBlbHNl CisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGlu dCBoZWlnaHRfY29waWVkID0gKHItPmRlc2lyZWRfeSArIHItPmhlaWdodAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIHAtPmRlc2lyZWRfeSk7CisgICAg ICAgICAgICAgICAgICAgICAgICAgIHAtPmN1cnJlbnRfdnBvcyArPSBucm93c19jb3BpZWQ7Cisg ICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmRlc2lyZWRfdnBvcyArPSBucm93c19jb3BpZWQ7 CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPm5yb3dzIC09IG5yb3dzX2NvcGllZDsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgcC0+Y3VycmVudF95ICs9IGhlaWdodF9jb3BpZWQ7Cisg ICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmRlc2lyZWRfeSArPSBoZWlnaHRfY29waWVkOwor ICAgICAgICAgICAgICAgICAgICAgICAgICBwLT5oZWlnaHQgLT0gaGVpZ2h0X2NvcGllZDsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgdHJ1bmNhdGVkX3AgPSAxOworICAgICAgICAgICAgICAg ICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICB9CisgICAgICAg ICAgICBpZiAoci0+Y3VycmVudF95ICE9IHItPmRlc2lyZWRfeQorICAgICAgICAgICAgICAgIC8q IFRoZSBjb25kaXRpb24gYmVsb3cgaXMgZXF1aXZhbGVudCB0bworICAgICAgICAgICAgICAgICAg ICgocC0+Y3VycmVudF95ID49IHItPmRlc2lyZWRfeQorICAgICAgICAgICAgICAgICAgICAgJiYg cC0+Y3VycmVudF95IDwgci0+ZGVzaXJlZF95ICsgci0+aGVpZ2h0KQorICAgICAgICAgICAgICAg ICAgICB8fCAocC0+Y3VycmVudF95ICsgcC0+aGVpZ2h0ID4gci0+ZGVzaXJlZF95CisgICAgICAg ICAgICAgICAgICAgICAgICAmJiAocC0+Y3VycmVudF95ICsgcC0+aGVpZ2h0CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgPD0gci0+ZGVzaXJlZF95ICsgci0+aGVpZ2h0KSkpCisgICAgICAg ICAgICAgICAgICAgYmVjYXVzZSB3ZSBoYXZlIDAgPCBwLT5oZWlnaHQgPD0gci0+aGVpZ2h0LiAq LworICAgICAgICAgICAgICAgICYmIHAtPmN1cnJlbnRfeSA8IHItPmRlc2lyZWRfeSArIHItPmhl aWdodAorICAgICAgICAgICAgICAgICYmIHAtPmN1cnJlbnRfeSArIHAtPmhlaWdodCA+IHItPmRl c2lyZWRfeSkKKyAgICAgICAgICAgICAgcC0+bnJvd3MgPSAwOworICAgICAgICAgICAgLyogUmVv cmRlciBydW5zIGJ5IGNvcGllZCBwaXhlbCBsaW5lcyBpZiB0cnVuY2F0ZWQuICovCisgICAgICAg ICAgICBpZiAodHJ1bmNhdGVkX3AgJiYgcC0+bnJvd3MgPiAwKQorICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgaW50IGsgPSBucnVucyAtIDE7CisgICAgICAgICAgICAgICAgd2hpbGUg KG1jX3J1bnNba10tPm5yb3dzID09IDAgfHwgbWNfcnVuc1trXS0+aGVpZ2h0IDwgcC0+aGVpZ2h0 KQorICAgICAgICAgICAgICAgICAgay0tOworICAgICAgICAgICAgICAgIG1lbW1vdmUgKG1jX3J1 bnMgKyBqLCBtY19ydW5zICsgaiArIDEsIChrIC0gaikgKiBzaXplb2YgKCptY19ydW5zKSk7Cisg ICAgICAgICAgICAgICAgbWNfcnVuc1trXSA9IHA7CisgICAgICAgICAgICAgIH0KKyAgICAgICAg ICB9CisgICAgICAgIC8qIEFzc2lnbiBtYXRyaXggcm93cy4gKi8KKyAgICAgICAgZm9yIChqID0g MDsgaiA8IHItPm5yb3dzOyArK2opCisgICAgICAgICAgeworICAgICAgICAgICAgc3RydWN0IGds eXBoX3JvdyAqZnJvbSwgKnRvOworICAgICAgICAgICAgYm9vbCB0b19vdmVybGFwcGVkX3A7Cisg ICAgICAgICAgICB0byA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCByLT5kZXNpcmVkX3Zw b3MgKyBqKTsKKyAgICAgICAgICAgIGZyb20gPSBNQVRSSVhfUk9XIChkZXNpcmVkX21hdHJpeCwg ci0+ZGVzaXJlZF92cG9zICsgaik7CisgICAgICAgICAgICB0b19vdmVybGFwcGVkX3AgPSB0by0+ b3ZlcmxhcHBlZF9wOworICAgICAgICAgICAgZnJvbS0+cmVkcmF3X2ZyaW5nZV9iaXRtYXBzX3Ag PSBmcm9tLT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3A7CisgICAgICAgICAgICBhc3NpZ25fcm93 ICh0bywgZnJvbSk7CisgICAgICAgICAgICAvKiBUaGUgYWJvdmUgYGFzc2lnbl9yb3cnIGFjdHVh bGx5IGRvZXMgc3dhcCwgc28gaWYgd2UgaGFkCisgICAgICAgICAgICAgICBhbiBvdmVybGFwIGlu IHRoZSBjb3B5IGRlc3RpbmF0aW9uIG9mIHR3byBydW5zLCB0aGVuCisgICAgICAgICAgICAgICB0 aGUgc2Vjb25kIHJ1biB3b3V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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAtMTsK KyAgaW50IG1hdHJpeF9yb3dfc3RhcnRfYnl0ZXBvcyA9IE1BVFJJWF9ST1dfU1RBUlRfQllURVBP UyAoZGVzaXJlZF9yb3cpOworICBpbnQgbWF0cml4X3Jvd19lbmRfYnl0ZXBvcyA9IE1BVFJJWF9S T1dfRU5EX0JZVEVQT1MgKGRlc2lyZWRfcm93KTsKKyAgLyogVGhlIGZpcnN0IGNvbmRpdGlvbiB0 ZXN0cyBmb3IgYSBzb2xpdGFyeSByb3cgY29udGFpbmluZyBaViwgcHJlY2VkZWQgYnkgYQorICBy b3cgY29udGFpbmluZyBhIHBlbnVsdGltYXRlIGdseXBoIHdpdGggYSBjaGFycG9zIG9mIFpWIC0g MSBmb2xsb3dlZCBieSBhbiBlbmQKKyAgb2Ygcm93IHNwYWNlIGdseXBoIHdpdGggYSBjaGFycG9z IG9mIDAuICBUaGUgb3RoZXIgY29uZGl0aW9ucyB0ZXN0IGZvciBhbiBlbXB0eQorICBidWZmZXIg KG5vdCBuYXJyb3dlZCksIG9yIGFuIGVtcHR5IG5hcnJvd2VkIGJ1ZmZlci4gKi8KKyAgYm9vbCBy b3dfYXRfenZfcCA9ICgodnBvcyAhPSAwCisgICAgICAgICAgICAgICAgICAgICAgICYmIChjdXJy ZW50X3JvdyAtIDEpLT51c2VkW1RFWFRfQVJFQV0gPiAwCisgICAgICAgICAgICAgICAgICAgICAg ICYmIHByZXZfbWF0cml4X3Jvd19zdGFydF9ieXRlcG9zICE9IHByZXZfbWF0cml4X3Jvd19lbmRf Ynl0ZXBvcworICAgICAgICAgICAgICAgICAgICAgICAmJiAhKGN1cnJlbnRfcm93IC0gMSktPmVu ZHNfYXRfenZfcAorICAgICAgICAgICAgICAgICAgICAgICAmJiBtYXRyaXhfcm93X3N0YXJ0X2J5 dGVwb3MgPT0gbWF0cml4X3Jvd19lbmRfYnl0ZXBvcworICAgICAgICAgICAgICAgICAgICAgICAm J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UgKnJpZiA9 IEZSQU1FX1JJRiAoWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKSk7CisgIGJvb2wgY2hhbmdlZF9w ID0gMDsKKyAgc3RydWN0IG1jX1JHQiBsc2wgPSB7LnJlZCA9IC0xLjAsIC5ncmVlbiA9IC0xLjAs IC5ibHVlID0gLTEuMH07CisgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IE5PX0ZMQVZP UjsKKyAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSA9IE5PX0NVUlNPUjsKKyAgaW50 IHdkID0gLTE7CisgIGJvb2wgY3Vyc29yX2djX3AgPSBmYWxzZTsKKyAgc3RydWN0IGdseXBoX21h dHJpeCAqZGVzaXJlZF9tYXRyaXggPSB3LT5kZXNpcmVkX21hdHJpeDsKKyAgaWYgKGRlYnVnX3Ap CisgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfdXBkYXRlX3RleHRfYXJlYSAoJXMpOiAgdnBvcyAo JWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgIG1jX3dpbmRvdyAodyksIHZwb3MpOworICAv KiBJbmFzbXVjaCBhcyB3ZSBwcm9jZXNzIHRoZSBjdXJzb3Igcm93IGJlZm9yZSBhbGwgb3RoZXIg cm93cywgd2UgY2FuIHJlbHkKKyAgdXBvbiB0aGUgcHJldmlvdXMgYGRlc2lyZWRfcm93YCB0byBi ZSBhY2N1cmF0ZS4gKi8KKyAgZW51bSBtY19yb3dfcG9zaXRpb24gcm93X3Bvc2l0aW9uID0gIG1j X3Jvd19wb3NpdGlvbiAodywgdnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGRlc2lyZWRfcm93 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogY3VycmVudF9yb3csCisgICAgICAgICAgIC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Cisg ICAgICAgIGkgPSAwOworICAgICAgICB4ID0gZGVzaXJlZF9yb3ctPng7CisgICAgICAgIGludCBj bGVhcl90b194ID0gMDsKKworICAgICAgICAvKiBMb29wIG92ZXIgZ2x5cGhzIHRoYXQgY3VycmVu dCBhbmQgZGVzaXJlZCByb3cgbWF5IGhhdmUgaW4gY29tbW9uLiAqLworICAgICAgICB3aGlsZSAo aSA8IHN0b3ApCisgICAgICAgICAgeworICAgICAgICAgICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQu dXNlZCA9IDA7CisgICAgICAgICAgICBib29sIGNhbl9za2lwX3AgPSAhYWJvcnRfc2tpcHBpbmc7 CisgICAgICAgICAgICAvKiBTa2lwIG92ZXIgZ2x5cGhzIHRoYXQgYm90aCByb3dzIGhhdmUgaW4g Y29tbW9uLiAgVGhlc2UgZG9uJ3QgaGF2ZQorICAgICAgICAgICAgdG8gYmUgd3JpdHRlbi4gIFdl IGNhbid0IHNraXAgaWYgdGhlIGxhc3QgY3VycmVudCBnbHlwaCBvdmVybGFwcyB0aGUKKyAgICAg ICAgICAgIGdseXBoIHRvIGl0cyByaWdodC4gIEZvciBleGFtcGxlLCBjb25zaWRlciBhIGN1cnJl bnQgcm93IG9mIGBpZicgd2l0aAorICAgICAgICAgICAgdGhlIGBmJyBpbiBDb3VyaWVyIGJvbGQg c28gdGhhdCBpdCBvdmVybGFwcyB0aGUgYCAnIHRvIGl0cyByaWdodC4KKyAgICAgICAgICAgIElm IHRoZSBkZXNpcmVkIHJvdyBpcyBgICcsIHdlIHdvdWxkIHNraXAgb3ZlciB0aGUgc3BhY2UgYWZ0 ZXIgdGhlCisgICAgICAgICAgICBgaWYnIGFuZCB0aGVyZSB3b3VsZCByZW1haW4gYSBwaXhlbCBm cm9tIHRoZSBgZicgb24gdGhlIHNjcmVlbi4gKi8KKyAgICAgICAgICAgIGlmIChvdmVybGFwcGlu Z19nbHlwaHNfcCAmJiBpID4gMCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0 cnVjdCBnbHlwaCAqZ2x5cGggPSAmY3VycmVudF9yb3ctPmdseXBoc1tURVhUX0FSRUFdW2kgLSAx XTsKKyAgICAgICAgICAgICAgICBpbnQgbGVmdCwgcmlnaHQ7CisgICAgICAgICAgICAgICAgcmlm LT5nZXRfZ2x5cGhfb3ZlcmhhbmdzIChnbHlwaCwgWEZSQU1FICh3LT5mcmFtZSksICZsZWZ0LCAm cmlnaHQpOworICAgICAgICAgICAgICAgIGNhbl9za2lwX3AgPSAocmlnaHQgPT0gMCAmJiAhYWJv cnRfc2tpcHBpbmcpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoY2FuX3NraXBf cCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGludCBzdGFydF9ocG9zID0gaTsK KyAgICAgICAgICAgICAgICB3aGlsZSAoaSA8IHN0b3AKKyAgICAgICAgICAgICAgICAgICAgICAg JiYgR0xZUEhfRVFVQUxfUCAoZGVzaXJlZF9nbHlwaCwgY3VycmVudF9nbHlwaCkpCisgICAgICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICsrYXJyYXlfZ2x5cGhzX3NraXBwZWQu dXNlZDsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGFycmF5X2dseXBoc19za2lwcGVkLmFsbG9j YXRlZCA8IGFycmF5X2dseXBoc19za2lwcGVkLnVzZWQpCisgICAgICAgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgICAgICAgaW50IG9sZF9hbGxvYyA9IGFycmF5X2dseXBoc19z a2lwcGVkLmFsbG9jYXRlZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBuZXdfZWx0cyA9 IGFycmF5X2dseXBoc19za2lwcGVkLnVzZWQgLSBhcnJheV9nbHlwaHNfc2tpcHBlZC5hbGxvY2F0 ZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICBhcnJheV9nbHlwaHNfc2tpcHBlZC5za2lwcGVk ID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgeHBhbGxvYyAoYXJyYXlfZ2x5cGhzX3NraXBw ZWQuc2tpcHBlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmFycmF5X2ds eXBoc19za2lwcGVkLmFsbG9jYXRlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgbmV3X2VsdHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElOVF9NQVgs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiAqYXJyYXlfZ2x5cGhz X3NraXBwZWQuc2tpcHBlZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBtZW1zZXQgKGFycmF5 X2dseXBoc19za2lwcGVkLnNraXBwZWQgKyBvbGRfYWxsb2MsIDAsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAoYXJyYXlfZ2x5cGhzX3NraXBwZWQuYWxsb2NhdGVkIC0gb2xkX2Fs bG9jKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHNpemVvZiAqYXJyYXlf Z2x5cGhzX3NraXBwZWQuc2tpcHBlZCk7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgICAgICAgICBpbnQgbnRoID0gYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZCAtIDE7Cisg ICAgICAgICAgICAgICAgICAgIGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbbnRoXS54ID0g eDsKKyAgICAgICAgICAgICAgICAgICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZFtudGhd Lmhwb3MgPSBpOworICAgICAgICAgICAgICAgICAgICBhcnJheV9nbHlwaHNfc2tpcHBlZC5za2lw cGVkW250aF0uZW5hYmxlZF9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgeCArPSBkZXNp cmVkX2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgKytkZXNpcmVkX2ds eXBoLCArK2N1cnJlbnRfZ2x5cGgsICsraTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgICAgICAvKiBDb25zaWRlciB0aGUgY2FzZSB0aGF0IHRoZSBjdXJyZW50IHJvdyBjb250YWlu cyAieHh4IHBwcCBnZ2ciIGluCisgICAgICAgICAgICAgICAgaXRhbGljIENvdXJpZXIgZm9udCwg YW5kIHRoZSBkZXNpcmVkIHJvdyBpcyAieHh4IGdnZyIuICBUaGUgY2hhcmFjdGVyIGBwJworICAg ICAgICAgICAgICAgIGhhcyBsYmVhcmluZywgYGcnIGhhcyBub3QuICBUaGUgbG9vcCBhYm92ZSB3 aWxsIHN0b3AgaW4gZnJvbnQgb2YgdGhlCisgICAgICAgICAgICAgICAgZmlyc3QgYHAnIGluIHRo ZSBjdXJyZW50IHJvdy4gIElmIHdlIHdvdWxkIHN0YXJ0IHdyaXRpbmcgZ2x5cGhzIHRoZXJlLCB3 ZQorICAgICAgICAgICAgICAgIHdvdWxkbid0IGVyYXNlIHRoZSBsYmVhcmluZyBvZiB0aGUgYHAn LiAgVGhlIHJlc3Qgb2YgdGhlIGxiZWFyaW5nIHByb2JsZW0KKyAgICAgICAgICAgICAgICBpcyB0 aGVuIHRha2VuIGNhcmUgb2YgYnkgZHJhd19nbHlwaHMuICovCisgICAgICAgICAgICAgICAgaWYg KG92ZXJsYXBwaW5nX2dseXBoc19wCisgICAgICAgICAgICAgICAgICAgICYmIGkgPiAwCisgICAg ICAgICAgICAgICAgICAgICYmIGkgPCBjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdCisgICAg ICAgICAgICAgICAgICAgICYmIChjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdICE9IGRlc2ly ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgICBpbnQgbGVmdCwgcmlnaHQ7CisgICAgICAgICAgICAgICAgICAgIHJpZi0+Z2V0 X2dseXBoX292ZXJoYW5ncyAoY3VycmVudF9nbHlwaCwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICBYRlJBTUUgKHctPmZyYW1lKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmbGVm dCwgJnJpZ2h0KTsKKyAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGxlZnQgPiAwICYmIGkgPiAw KQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC0taSwg LS1kZXNpcmVkX2dseXBoLCAtLWN1cnJlbnRfZ2x5cGg7CisgICAgICAgICAgICAgICAgICAgICAg ICB4IC09IGRlc2lyZWRfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICAgICAgICAg ICAgbGVmdCAtPSBkZXNpcmVkX2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgICAg ICAgICB9CisgICAgICAgICAgICAgICAgICAgIC8qIEFib3J0IHRoZSBza2lwcGluZyBhbGdvcml0 aG0gaWYgd2UgZW5kIHVwIGJlZm9yZQorICAgICAgICAgICAgICAgICAgICAgICBvdXIgc3RhcnRp bmcgcG9pbnQsIHRvIGF2b2lkIGxvb3BpbmcgKGJ1ZyMxMDcwKS4KKyAgICAgICAgICAgICAgICAg ICAgICAgVGhpcyBjYW4gaGFwcGVuIHdoZW4gdGhlIGxiZWFyaW5nIGlzIGxhcmdlciB0aGFuCisg ICAgICAgICAgICAgICAgICAgICAgIHRoZSBwaXhlbCB3aWR0aC4gKi8KKyAgICAgICAgICAgICAg ICAgICAgYWJvcnRfc2tpcHBpbmcgPSAoaSA8IHN0YXJ0X2hwb3MpOworICAgICAgICAgICAgICAg ICAgfQorICAgICAgICAgICAgICB9CisgICAgICAgICAgICAvKiBUcnkgdG8gYXZvaWQgd3JpdGlu ZyB0aGUgZW50aXJlIHJlc3Qgb2YgdGhlIGRlc2lyZWQgcm93CisgICAgICAgICAgICAgICBieSBs b29raW5nIGZvciBhIHJlc3luYyBwb2ludC4gIFRoaXMgbWFpbmx5IHByZXZlbnRzCisgICAgICAg ICAgICAgICBtb2RlIGxpbmUgZmxpY2tlcmluZyBpbiB0aGUgY2FzZSB0aGUgbW9kZSBsaW5lIGlz IGluCisgICAgICAgICAgICAgICBmaXhlZC1waXRjaCBmb250LCB3aGljaCBpdCB1c3VhbGx5IHdp bGwgYmUuICovCisgICAgICAgICAgICBpZiAoaSA8IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJF QV0pCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpbnQgc3RhcnRfeCA9IHgsIHN0 YXJ0X2hwb3MgPSBpOworICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqc3RhcnQgPSBkZXNp cmVkX2dseXBoOworICAgICAgICAgICAgICAgIGludCBjdXJyZW50X3ggPSB4OworICAgICAgICAg ICAgICAgIGJvb2wgc2tpcF9maXJzdF9wID0gIWNhbl9za2lwX3A7CisgICAgICAgICAgICAgICAg LyogRmluZCB0aGUgbmV4dCBnbHlwaCB0aGF0J3MgZXF1YWwgYWdhaW4uICovCisgICAgICAgICAg ICAgICAgd2hpbGUgKGkgPCBzdG9wCisgICAgICAgICAgICAgICAgICAgICAgICYmIChza2lwX2Zp cnN0X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICFHTFlQSF9FUVVBTF9QIChkZXNp cmVkX2dseXBoLCBjdXJyZW50X2dseXBoKSkKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgeCA9 PSBjdXJyZW50X3gpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHgg Kz0gZGVzaXJlZF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgICAgICAgIGN1cnJl bnRfeCArPSBjdXJyZW50X2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAg KytkZXNpcmVkX2dseXBoLCArK2N1cnJlbnRfZ2x5cGgsICsraTsKKyAgICAgICAgICAgICAgICAg ICAgc2tpcF9maXJzdF9wID0gMDsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAg ICBmb3IgKGludCBlbHQgPSAwOworICAgICAgICAgICAgICAgICAgICAgZWx0IDwgYXJyYXlfZ2x5 cGhzX3NraXBwZWQudXNlZDsKKyAgICAgICAgICAgICAgICAgICAgICsrZWx0KQorICAgICAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpbnQgeCA9IGFycmF5X2dseXBoc19za2lw cGVkLnNraXBwZWRbZWx0XS54OworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGFycmF5 X2dseXBoc19za2lwcGVkLnNraXBwZWRbZWx0XS5ocG9zOworICAgICAgICAgICAgICAgICAgICBz dHJ1Y3QgZ2x5cGggKnRhcmdldF9nbHlwaCA9CisgICAgICAgICAgICAgICAgICAgICAgbWNfZ2V0 X2N1cnNvcl9nbHlwaCAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCBocG9zLCB2cG9z KTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgICAgICAgICAgICAg ICAgZnByaW50ZiAoc3RkZXJyLCAiU0tJUFBFRDogIHZwb3MgKCVkKSB8IGNoYXIgKCVkLyVzKSB8 IHg6ICglZCkgfCBocG9zICglZC8lZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICB2cG9zLCB0YXJnZXRfZ2x5cGgtPnUuY2gsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAodGFyZ2V0X2dseXBoLT51LmNo KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHgsIGhwb3MsIHVwZGF0 ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKTsKKyAgICAgICAgICAgICAgICAgICAgbWNfZHJh d19yb3cgKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBoLCB4LCAx LCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwg ZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBkcmF3X3AsIFNLSVBQRUQpOworICAgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChpID09IHN0YXJ0X2hwb3MgfHwgeCAhPSBjdXJy ZW50X3gpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGkgPSBzdGFy dF9ocG9zOworICAgICAgICAgICAgICAgICAgICB4ID0gc3RhcnRfeDsKKyAgICAgICAgICAgICAg ICAgICAgZGVzaXJlZF9nbHlwaCA9IHN0YXJ0OworICAgICAgICAgICAgICAgICAgICBicmVhazsK KyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBvdXRwdXRfY3Vyc29yX3RvICh3 LCB2cG9zLCBzdGFydF9ocG9zLCBkZXNpcmVkX3Jvdy0+eSwgc3RhcnRfeCk7CisgICAgICAgICAg ICAgICAgLyogUmUtZHJhdyBhIHBvcnRpb24gb2YgdGhlIHJvdy4gKi8KKyAgICAgICAgICAgICAg ICBpZiAoZGVidWdfcCkKKyAgICAgICAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIlJFRFJB VyBTRUdNRU5UOlxuXAorICAgICAgICAgICAgICAgICAgICB2cG9zICglZCkgfCBjaGFyICglZC8l cykgfCB4OiAoJWQpIHwgaHBvcyAoJWQvJWQpIHwgbGVuZ3RoICglZClcbiIsCisgICAgICAgICAg ICAgICAgICAgIHZwb3MsIHN0YXJ0LT51LmNoLCBtY19jaGFyX3RvX3N0cmluZyAoc3RhcnQtPnUu Y2gpLAorICAgICAgICAgICAgICAgICAgICBzdGFydF94LCBzdGFydF9ocG9zLCB1cGRhdGVkX3Jv dy0+dXNlZFtURVhUX0FSRUFdIC0gMSwgaSAtIHN0YXJ0X2hwb3MpOworICAgICAgICAgICAgICAg IGJsb2NrX2lucHV0ICgpOworICAgICAgICAgICAgICAgIGludCBsZW4gPSBpIC0gc3RhcnRfaHBv czsKKyAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IHN0YXJ0IC0gdXBkYXRlZF9yb3ctPmdseXBo c1tURVhUX0FSRUFdOworICAgICAgICAgICAgICAgIHctPm91dHB1dF9jdXJzb3IueCA9CisgICAg ICAgICAgICAgICAgICBtY19kcmF3X2dseXBocyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRf cm93LCB3LT5tY19tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+ b3V0cHV0X2N1cnNvci54LCBURVhUX0FSRUEsIGhwb3MsIGhwb3MgKyBsZW4sCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgRFJBV19OT1JNQUxfVEVYVCwgMCwgdnBvcywgbHNsLCBn bHlwaF9mbGF2b3IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5 cGUsIHdkLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGN1cnNvcl9nY19wLCBNQ19EUkFXX0dMWVBIX1NUUklORywgZHJhd19wKTsKKyAgICAg ICAgICAgICAgICB3LT5vdXRwdXRfY3Vyc29yLmhwb3MgKz0gbGVuOworICAgICAgICAgICAgICAg IHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgICAgICAgbWNfZHJhd19yb3cgKHcsIGRlc2ly ZWRfbWF0cml4LCB1cGRhdGVkX3Jvdywgc3RhcnQsIHN0YXJ0X3gsIGkgLSBzdGFydF9ocG9zLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCBjdXJzb3JfbWF0cml4LCBlc3NlbnRp YWxzLCByb3dfcG9zaXRpb24sIGRyYXdfcCwgU0NSSUJFX1RXTyk7CisgICAgICAgICAgICAgICAg Y2hhbmdlZF9wID0gMTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKworICAgICAgICAv KiBXcml0ZSB0aGUgcmVzdC4gKi8KKyAgICAgICAgaWYgKGkgPCBkZXNpcmVkX3Jvdy0+dXNlZFtU RVhUX0FSRUFdKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIG91dHB1dF9jdXJzb3JfdG8gKHcs IHZwb3MsIGksIGRlc2lyZWRfcm93LT55LCB4KTsKKyAgICAgICAgICAgIGlmIChkZWJ1Z19wKQor ICAgICAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJEUkFXIFJFTUFJTkRFUiBPRiBUSEUgUk9X OlxuXAorICAgICAgICAgICAgICAgIHZwb3MgKCVkKSB8IGNoYXIgKCVkLyVzKSB8IHg6ICglZCkg fCBocG9zICglZC8lZCkgfCBsZW5ndGggKCVkKVxuIiwKKyAgICAgICAgICAgICAgICB2cG9zLCBk ZXNpcmVkX2dseXBoLT51LmNoLCBtY19jaGFyX3RvX3N0cmluZyAoZGVzaXJlZF9nbHlwaC0+dS5j aCksCisgICAgICAgICAgICAgICAgeCwgaSwgZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVBXSAt IDEsIGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSBpKTsKKyAgICAgICAgICAgIGJsb2Nr X2lucHV0ICgpOworICAgICAgICAgICAgaW50IGxlbiA9IGRlc2lyZWRfcm93LT51c2VkW1RFWFRf QVJFQV0gLSBpOworICAgICAgICAgICAgaW50IGhwb3MgPSBkZXNpcmVkX2dseXBoIC0gdXBkYXRl ZF9yb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgICAgdy0+b3V0cHV0X2N1cnNvci54 ID0KKyAgICAgICAgICAgICAgbWNfZHJhd19nbHlwaHMgKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRh dGVkX3Jvdywgdy0+bWNfbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+ b3V0cHV0X2N1cnNvci54LCBURVhUX0FSRUEsIGhwb3MsIGhwb3MgKyBsZW4sCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBEUkFXX05PUk1BTF9URVhULCAwLCB2cG9zLCBsc2wsIGdseXBo X2ZsYXZvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCB3ZCwg ZXNzZW50aWFscy5hY3RpdmVfcCwgY3Vyc29yX2djX3AsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBNQ19EUkFXX0dMWVBIX1NUUklORywgZHJhd19wKTsKKyAgICAgICAgICAgIHctPm91 dHB1dF9jdXJzb3IuaHBvcyArPSBsZW47CisgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOwor ICAgICAgICAgICAgLyogRklYTUU6ICBBbHRob3VnaCB3ZSBuZWVkIHRvIHVwZGF0ZSB0aGUgY2Fj aGUgYmV0d2VlbiB0aGUgZW5kIG9mCisgICAgICAgICAgICB1cGRhdGVkX3JvdyBhbmQgdGhlIHJp Z2h0IHdpbmRvdyBlZGdlLCBpdCBpcyBub3QgbmVjZXNzYXJ5IHRvIGRyYXcKKyAgICAgICAgICAg IHRob3NlIGZha2UgY3Vyc29ycy4gQWx0aG91Z2ggd2UgbWF5IG5vdCBiZSBhYmxlIHRvIHNlZSBp dCB3aXRoIHRoZQorICAgICAgICAgICAgbmFrZWQgZXllLCB0aG9zZSBmYWtlIGN1cnNvcnMgYXJl IGJlaW5nIHN1cGVyaW1wb3NlZCBvbiB0aGUgZXhpc3RpbmcKKyAgICAgICAgICAgIGZha2UgY3Vy c29ycyB0aGF0IGRvIG5vdCBnZXQgZXJhc2VkIGJ5IHRoZSBjb2RlIGluIHRoZSBzZWN0aW9uIGJl bG93LgorICAgICAgICAgICAgSXQgd291bGQgYmUgYmV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UaGVyZWZv cmUsIGl0IGlzIG9rYXkgdG8KKyAgICAgICAgICBkcmF3IHRoZSBmbG9hdGluZyBnbHlwaHMgZm9y IHRoZSBob3Jpem9udGFsL3ZlcnRpY2FsIHJ1bGVycyBoZXJlLiAqLworICAgICAgICAgIGVsc2Ug aWYgKGNoYW5nZWRfcAorICAgICAgICAgICAgICAgICAgICYmIHctPm91dHB1dF9jdXJzb3IuaHBv cyAhPSB1cGRhdGVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdKQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBpbnQgeCA9IHctPm91dHB1dF9jdXJzb3IueDsKKyAgICAgICAgICAgICAgaW50IGhw b3MgPSB3LT5vdXRwdXRfY3Vyc29yLmhwb3M7CisgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAq c3RhcnQgPSBtY19nZXRfY3Vyc29yX2dseXBoICh3LCBkZXNpcmVkX21hdHJpeCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZWRf cm93LCBocG9zLCB2cG9zKTsKKyAgICAgICAgICAgICAgaWYgKHctPm91dHB1dF9jdXJzb3IueCA9 PSB1cGRhdGVkX3Jvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgeCAtPSBzdGFydC0+ cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICAgICAgICAg IGZwcmludGYgKHN0ZGVyciwgIlBPU1QtQ0hBTkdFRDogIHZwb3MgKCVkKSB8IHggKCVkKSB8IGhw b3MgKCVkLyVkKSB8IGNoYXIgKCVkLyVzKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHZwb3MsIHgsIGhwb3MsIHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQtPnUuY2gsIG1jX2NoYXJfdG9f c3RyaW5nIChzdGFydC0+dS5jaCkpOworICAgICAgICAgICAgICBtY19kcmF3X3JvdyAodywgZGVz aXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCBzdGFydCwgeCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgIHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSBocG9zLCB2cG9zLCBjdXJzb3Jf bWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscywgcm93X3Bvc2l0 aW9uLCBkcmF3X3AsIFBPU1RfQ0hBTkdFRCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAv KiBUaGVyZSB3ZXJlIG5vIGNoYW5nZXMgYW5kIGkgPT0gZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9B UkVBXSAqLworICAgICAgICAgICAgZWxzZSBpZiAoIWNoYW5nZWRfcCkKKyAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICAgICAgICAgICAgZnByaW50 ZiAoc3RkZXJyLCAiVU5DSEFOR0VEIC0tIFdSSVRFIEVOVElSRSBMSU5FOiAgdnBvcyAoJWQpIHwg cm93LT51c2VkICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZw b3MsIHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKTsKKyAgICAgICAgICAgICAgICBt Y19kcmF3X3JvdyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCBkZXNpcmVkX3Jvdy0+ Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2lyZWRf cm93LT54LCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdLCB2cG9zLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24s IGRyYXdfcCwgVU5DSEFOR0VEKTsKKyAgICAgICAgICAgICAgfQorCisgICAgICAgIC8qIE1heWJl IGNsZWFyIHRvIGVuZCBvZiBsaW5lLiAqLworICAgICAgICBpZiAoTUFUUklYX1JPV19FWFRFTkRT X0ZBQ0VfUCAoZGVzaXJlZF9yb3cpKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIC8qIElmIG5l dyByb3cgZXh0ZW5kcyB0byB0aGUgZW5kIG9mIHRoZSB0ZXh0IGFyZWEsIG5vdGhpbmcKKyAgICAg ICAgICAgICAgIGhhcyB0byBiZSBjbGVhcmVkLCBpZiBhbmQgb25seSBpZiB3ZSBkaWQgYSB3cml0 ZV9nbHlwaHMKKyAgICAgICAgICAgICAgIGFib3ZlLiAgVGhpcyBpcyBtYWRlIHN1cmUgYnkgc2V0 dGluZyBkZXNpcmVkX3N0b3BfcG9zCisgICAgICAgICAgICAgICBhcHByb3ByaWF0ZWx5IGFib3Zl LiAqLworICAgICAgICAgICAgZWFzc2VydCAoaSA8IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJF QV0KKyAgICAgICAgICAgICAgICAgICAgIHx8ICgoZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9BUkVB XSA9PSBjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdKQorICAgICAgICAgICAgICAgICAgICAg ICAgICYmIE1BVFJJWF9ST1dfRVhURU5EU19GQUNFX1AgKGN1cnJlbnRfcm93KSkpOworICAgICAg ICAgIH0KKyAgICAgICAgICBlbHNlIGlmIChNQVRSSVhfUk9XX0VYVEVORFNfRkFDRV9QIChjdXJy ZW50X3JvdykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIC8qIElmIG9sZCByb3cgZXh0 ZW5kcyB0byB0aGUgZW5kIG9mIHRoZSB0ZXh0IGFyZWEsIGNsZWFyLiAqLworICAgICAgICAgICAg ICBpZiAoaSA+PSBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdKQorICAgICAgICAgICAgICAg IG91dHB1dF9jdXJzb3JfdG8gKHcsIHZwb3MsIGksIGRlc2lyZWRfcm93LT55LCBkZXNpcmVkX3Jv dy0+cGl4ZWxfd2lkdGgpOworICAgICAgICAgICAgICBpZiAoZHJhd19wKQorICAgICAgICAgICAg ICAgIHJpZi0+Y2xlYXJfZW5kX29mX2xpbmUgKHcsIHVwZGF0ZWRfcm93LCBURVhUX0FSRUEsIC0x KTsKKyAgICAgICAgICAgICAgY2xlYXJfdG9feCA9IC0xOworICAgICAgICAgICAgICBjaGFuZ2Vk X3AgPSAxOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAoZGVzaXJlZF9yb3ct PnBpeGVsX3dpZHRoIDwgY3VycmVudF9yb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICB7 CisgICAgICAgICAgICAgICAgLyogT3RoZXJ3aXNlIGNsZWFyIHRvIHRoZSBlbmQgb2YgdGhlIG9s ZCByb3cuICBFdmVyeXRoaW5nCisgICAgICAgICAgICAgICAgICAgYWZ0ZXIgdGhhdCBwb3NpdGlv biBzaG91bGQgYmUgY2xlYXIgYWxyZWFkeS4gKi8KKyAgICAgICAgICAgICAgICBpbnQgeGxpbTsK KyAgICAgICAgICAgICAgICBpZiAoaSA+PSBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdKQor ICAgICAgICAgICAgICAgICAgb3V0cHV0X2N1cnNvcl90byAodywgdnBvcywgaSwgZGVzaXJlZF9y b3ctPnksIGRlc2lyZWRfcm93LT5waXhlbF93aWR0aCk7CisgICAgICAgICAgICAgICAgLyogSWYg Y3Vyc29yIGlzIGRpc3BsYXllZCBhdCB0aGUgZW5kIG9mIHRoZSBsaW5lLCBtYWtlIHN1cmUKKyAg ICAgICAgICAgICAgICAgICBpdCdzIGNsZWFyZWQuICBOb3dhZGF5cyB3ZSBkb24ndCBoYXZlIGEg cGh5c19jdXJzb3JfZ2x5cGgKKyAgICAgICAgICAgICAgICAgICB3aXRoIHdoaWNoIHRvIGVyYXNl IHRoZSBjdXJzb3IgKGJlY2F1c2UgdGhpcyBtZXRob2QKKyAgICAgICAgICAgICAgICAgICBkb2Vz bid0IHdvcmsgd2l0aCBsYmVhcmluZy9yYmVhcmluZyksIHNvIHdlIG11c3QgZG8gaXQgdGhpcyB3 YXkuICovCisgICAgICAgICAgICAgICAgaWYgKHZwb3MgPT0gdy0+cGh5c19jdXJzb3IudnBvcwor ICAgICAgICAgICAgICAgICAgICAmJiAoZGVzaXJlZF9yb3ctPnJldmVyc2VkX3AKKyAgICAgICAg ICAgICAgICAgICAgICAgID8gKHctPnBoeXNfY3Vyc29yLmhwb3MgPCAwKQorICAgICAgICAgICAg ICAgICAgICAgICAgOiAody0+cGh5c19jdXJzb3IuaHBvcyA+PSBkZXNpcmVkX3Jvdy0+dXNlZFtU RVhUX0FSRUFdKSkpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHct PnBoeXNfY3Vyc29yX29uX3AgPSAwOworICAgICAgICAgICAgICAgICAgICB4bGltID0gLTE7Cisg ICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAg ICAgICAgIHhsaW0gPSBjdXJyZW50X3Jvdy0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgICAg aWYgKGRyYXdfcCkKKyAgICAgICAgICAgICAgICAgIHJpZi0+Y2xlYXJfZW5kX29mX2xpbmUgKHcs IHVwZGF0ZWRfcm93LCBURVhUX0FSRUEsIHhsaW0pOworICAgICAgICAgICAgICAgIGNsZWFyX3Rv X3ggPSB4bGltOworICAgICAgICAgICAgICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAgICAgICAg IH0KKworICAgICAgICBpZiAoY2hhbmdlZF9wCisgICAgICAgICAgICAmJiBjbGVhcl90b194ICE9 IDApCisgICAgICAgICAgeworICAgICAgICAgICAgaW50IHRleHRfYXJ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Rfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxOworICAgICAgICAgICAgaW50IHhfbGlt aXQgPSAoY2xlYXJfdG9feCA9PSAtMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgPyB0ZXh0 X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgOiBjbGVhcl90b194OworICAg ICAgICAgICAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKHctPmNvbnRlbnRzKTsKKyAgICAg ICAgICAgIGJvb2wgZmlsbF9jb2x1bW5fdHJ1bXBzX3AgPSAoIU5JTFAgKEJWQVIgKGIsIGNoX3Zl cnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgIU5JTFAgKEJWQVIgKGIsIGZjX3Zpc2libGUpKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA9PSBlc3NlbnRpYWxzLmZjX3gpOworICAg ICAgICAgICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAgICAgICAgICBmcHJpbnRmIChzdGRlcnIs ICJtY191cGRhdGVfdGV4dF9hcmVhIChmbG9hdGluZyk6ICB2cG9zICglZCkgfCB4X2xpbWl0ICgl ZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdnBvcywgeF9saW1pdCk7Cisg ICAgICAgICAgICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgJiYg IU5JTFAgKEJWQVIgKGIsIGZjX3Zpc2libGUpKQorICAgICAgICAgICAgICAgICYmIChlc3NlbnRp YWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgIHx8ICghZXNzZW50aWFscy5hY3RpdmVf cAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGZjX2luYWN0aXZl X3dpbmRvd3MpKSkpCisgICAgICAgICAgICAgICAgJiYgeCA8IHRleHRfYXJlYV93aWR0aAorICAg ICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSB4CisgICAgICAgICAgICAgICAgJiYg dGFyZ2V0X2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAgICAmJiBkcmF3X3ApCisgICAgICAg ICAgICAgIG1jX2VuZ2luZSAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0YXJnZXRf Z2x5cGgsIFRFWFRfQVJFQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICB4LCB4X2xpbWl0LCB1 cGRhdGVkX3Jvdy0+eSwgaHBvcywgdnBvcywgTUNfQkFSLCAxLAorICAgICAgICAgICAgICAgICAg ICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwKKyAgICAgICAg ICAgICAgICAgICAgICAgICBkZWJ1Z19wID8gZGVidWdfZmcgOiBlc3NlbnRpYWxzLmZjX2ZnW3Jv d19wb3NpdGlvbl0sCisgICAgICAgICAgICAgICAgICAgICAgICAgRklMTF9DT0xVTU4sIGRyYXdf cCwgTk9XSEVSRSwgTk9fQ0FDSEUpOworICAgICAgICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRl bnRzKQorICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAg ICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfaG9yaXpvbnRhbF9ydWxlcikpCisg ICAgICAgICAgICAgICAgJiYgKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAg ICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAh TklMUCAoQlZBUiAoYiwgY2hfaW5hY3RpdmVfd2luZG93cykpKSkKKyAgICAgICAgICAgICAgICAm JiB4IDwgdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJz b3IudnBvcworICAgICAgICAgICAgICAgICYmIHRhcmdldF9nbHlwaCAhPSBOVUxMCisgICAgICAg ICAgICAgICAgJiYgZHJhd19wKQorICAgICAgICAgICAgICBtY19lbmdpbmUgKHcsIGRlc2lyZWRf bWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBoLCBURVhUX0FSRUEsCisgICAgICAgICAg ICAgICAgICAgICAgICAgeCwgeF9saW1pdCwgdXBkYXRlZF9yb3ctPnksIGhwb3MsIHZwb3MsIE1D X0hCQVIsIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50 aWFscywgcm93X3Bvc2l0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgIGRlYnVnX3AgPyBk ZWJ1Z19mZyA6IGVzc2VudGlhbHMuY2hfZmdbcm93X3Bvc2l0aW9uXSwKKyAgICAgICAgICAgICAg ICAgICAgICAgICBIT1JJWk9OVEFMX1JVTEVSLCBkcmF3X3AsIE5PV0hFUkUsIE5PX0NBQ0hFKTsK KyAgICAgICAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAm JiAhTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgJiYgIU5JTFAg KEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAmJiAoZXNzZW50 aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICB8fCAoIWVzc2VudGlhbHMuYWN0aXZl X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9pbmFjdGl2 ZV93aW5kb3dzKSkpKQorICAgICAgICAgICAgICAgICYmICFmaWxsX2NvbHVtbl90cnVtcHNfcAor ICAgICAgICAgICAgICAgICYmIHggPCB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAm JiB2cG9zICE9IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLngg Pj0geAorICAgICAgICAgICAgICAgICYmIHRhcmdldF9nbHlwaCAhPSBOVUxMCisgICAgICAgICAg ICAgICAgJiYgZHJhd19wKQorICAgICAgICAgICAgICBtY19lbmdpbmUgKHcsIGRlc2lyZWRfbWF0 cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBoLCBURVhUX0FSRUEsCisgICAgICAgICAgICAg ICAgICAgICAgICAgeCwgeF9saW1pdCwgdXBkYXRlZF9yb3ctPnksIGhwb3MsIHZwb3MsIE1DX0JB UiwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxz LCByb3dfcG9zaXRpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgZGVidWdfcCA/IGRlYnVn X2ZnIDogZXNzZW50aWFscy5jaF9mZ1tyb3dfcG9zaXRpb25dLAorICAgICAgICAgICAgICAgICAg ICAgICAgIFZFUlRJQ0FMX1JVTEVSLCBkcmF3X3AsIE5PV0hFUkUsIE5PX0NBQ0hFKTsKKyAgICAg ICAgICB9CisKKyAgICAgIH0KKyAgcmV0dXJuIGNoYW5nZWRfcDsKK30KKworLyogVXBkYXRlIHJv dyBWUE9TIGluIHdpbmRvdyBXLiAgVmFsdWUgaXMgdHJ1ZSBpZiBkaXNwbGF5IGhhcyBiZWVuIGNo YW5nZWQuICovCitzdGF0aWMgYm9vbAorbWNfdXBkYXRlX3dpbmRvd19saW5lIChzdHJ1Y3Qgd2lu ZG93ICp3LCBpbnQgdnBvcywgYm9vbCAqbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wLAorICAgICAg ICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICpjdXJzb3JfbWF0cml4LAorICAg ICAgICAgICAgICAgICAgICAgICBzdH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3dfd2lkdGhfbGluZV9wCisgICAgICAg ICAgfHwgKE1BVFJJWF9ST1dfQ09OVElOVUFUSU9OX0xJTkVfUCAoZGVzaXJlZF9yb3cpCisgICAg ICAgICAgICAgICE9IE1BVFJJWF9ST1dfQ09OVElOVUFUSU9OX0xJTkVfUCAoY3VycmVudF9yb3cp KSkKKyAgICAgICAgcmlmLT5hZnRlcl91cGRhdGVfd2luZG93X2xpbmVfaG9vayAodywgZGVzaXJl ZF9yb3cpOworICAgIH0KKyAgLyogVXBkYXRlIGN1cnJlbnRfcm93IGZyb20gZGVzaXJlZF9yb3cu ICovCisgIG1ha2VfY3VycmVudCAody0+ZGVzaXJlZF9tYXRyaXgsIHctPmN1cnJlbnRfbWF0cml4 LCB2cG9zKTsKKyAgcmV0dXJuIGNoYW5nZWRfcDsKK30KKwordm9pZAorbWNfdXBkYXRlX3dpbmRv d19lcmFzZSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IG1jX21hdHJpeCBvbGRfbWF0cml4KQor eworICBib29sIGRlYnVnX3AgPSBmYWxzZTsKKyAgYm9vbCBnb19vbmVfcCA9IChvbGRfbWF0cml4 LmN1cnNvcnNfdXNlZFtNQ19DQUNIRV0gPiAwCisgICAgICAgICAgICAgICAgICAgfHwgb2xkX21h dHJpeC5jdXJzb3JzX3VzZWRbQ0hfQ0FDSEVdID4gMAorICAgICAgICAgICAgICAgICAgIHx8IG9s ZF9tYXRyaXguY3Vyc29yc191c2VkW0ZDX0NBQ0hFXSA+IDApOworICBib29sIGdvX3R3b19wID0g KEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICYmICghTklMUCAoQlZB UiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAgICAgICAg ICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkp CisgICAgICAgICAgICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIG1jX2NvbmYpKSkpOworICBib29sIHVwZGF0aW5nX2ZyYW1lX3AgPSBmYWxzZTsKKyAg c3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIGlmIChYRlJBTUUgKHctPmZy YW1lKSAhPSBmLT5tY191cGRhdGluZ19mcmFtZQorICAgICAgJiYgKGdvX29uZV9wIHx8IGdvX3R3 b19wKSkKKyAgICB7CisgICAgICB1cGRhdGluZ19mcmFtZV9wID0gdHJ1ZTsKKyAgICAgIHVwZGF0 ZV9iZWdpbiAoZik7CisgICAgfQorICBpZiAody0+cGh5c19jdXJzb3Jfb25fcAorICAgICAgJiYg Z29fdHdvX3ApCisgICAgZXJhc2VfcGh5c19jdXJzb3IgKHcpOworICBmb3IgKGludCB2bnRoID0g MDsKKyAgICAgICBnb19vbmVfcAorICAgICAgICYmIHZudGggPCB3LT5tY19tYXRyaXgudnBvc191 c2VkOworICAgICAgICsrdm50aCkKKyAgICB7CisgICAgICBmb3IgKGVudW0gbWNfY2FjaGVfdHlw ZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7CisgICAgICAgICAgIGNhY2hlX3R5cGUgPCBOT19DQUNI RTsKKyAgICAgICAgICAgKytjYWNoZV90eXBlKQorICAgICAgICBmb3IgKGludCBudGhfMCA9IDA7 CisgICAgICAgICAgICAgbWNfdHJhdmVyc2VfY2FjaGVfcCAob2xkX21hdHJpeCwgY2FjaGVfdHlw ZSwgdm50aCwgbnRoXzApOworICAgICAgICAgICAgICsrbnRoXzApCisgICAgICAgICAgeworICAg ICAgICAgICAgYm9vbCBzYW1lX3AgPSBmYWxzZTsKKyAgICAgICAgICAgIGZvciAoaW50IHdfbnRo ID0gMDsgd19udGggPCB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5 cGVdOyArK3dfbnRoKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc2FtZV9wIHw9 IChvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnR5 cGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnR5cGUKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmICgob2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8wXS5nbHlwaC5ieXRlcG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5ieXRl cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChvbGRfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLnJvd19wb3NpdGlvbiA9PSBBVF9aVgorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0ucm93X3Bvc2l0aW9uID09IEFUX1pWKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXzBdLnJvd19wb3NpdGlvbiA9PSBQT1NUX1pWCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3dfbnRoXS5yb3dfcG9zaXRpb24gPT0gUE9TVF9aVikpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiAoKG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMF0uZ2x5cGguY2hhcnBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9 PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgu Y2hhcnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAob2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5yb3dfcG9zaXRpb24gPT0gQVRfWlYK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLnJvd19wb3NpdGlvbiA9PSBBVF9aVikKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAob2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8wXS5yb3dfcG9zaXRpb24gPT0gUE9TVF9aVgorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVt3X250aF0ucm93X3Bvc2l0aW9uID09IFBPU1RfWlYpKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS5nbHlwaC51LnZhbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgudS52 YWwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGguZmFjZV9pZAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3 X250aF0uZ2x5cGguZmFjZV9pZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5wYWRkaW5nX3AK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnBhZGRpbmdfcAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8wXS5nbHlwaC5sZWZ0X2JveF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBo LmxlZnRfYm94X2xpbmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5yaWdodF9ib3hfbGlu ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5yaWdodF9ib3hfbGluZV9wCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzBdLmdseXBoLnZvZmZzZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmds eXBoLnZvZmZzZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGgucGl4ZWxfd2lkdGgKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnBpeGVsX3dpZHRoCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBd LmdseXBoLnNsaWNlLmltZy54CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5p bWcueAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC5zbGljZS5pbWcueQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVt3X250aF0uZ2x5cGguc2xpY2UuaW1nLnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGgu c2xpY2UuaW1nLndpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5zbGljZS5pbWcu d2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGguc2xpY2UuaW1nLmhlaWdodAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVt3X250aF0uZ2x5cGguc2xpY2UuaW1nLmhlaWdodAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8wXS5nbHlwaC5zbGljZS5jbXAuZnJvbQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9 PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgu c2xpY2UuY21wLmZyb20KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0ueAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3 X250aF0ueAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5meAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0u ZngKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhfMF0ueQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9 PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0ueQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8wXS5meQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZnkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMF0uaHBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uaHBvcworICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS52cG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS52cG9zCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXzBdLndkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS53ZAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8wXS5oCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5oCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmN1 cnNvcl90eXBlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5jdXJzb3JfdHlwZQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS5jdXJzb3Jfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmN1cnNvcl93 aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5mZy5yZWQKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhd LmZnLnJlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5mZy5ncmVlbgorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3 X250aF0uZmcuZ3JlZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZmcuYmx1ZQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVt3X250aF0uZmcuYmx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5iZy5yZWQKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bd19udGhdLmJnLnJlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5iZy5ncmVlbgorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVt3X250aF0uYmcuZ3JlZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uYmcuYmx1 ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uYmcuYmx1ZQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5h Y3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uYWN0aXZlX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhfMF0uZ2x5cGhfZmxhdm9yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaF9mbGF2b3IK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMF0uZW5hYmxlZF9wCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5l bmFibGVkX3ApOworICAgICAgICAgICAgICAgIGlmIChzYW1lX3ApCisgICAgICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICAgICAgICAgICAg ICAgIGZwcmludGYgKHN0ZGVyciwgIkhJVCAoJXMpOiAgdnBvcyAoJWQpIHwgaHBvcyAoJWQpIHwg Y2hhciAoJXMpXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNh Y2hlX3R5cGUgPT0gTUNfQ0FDSEUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gIk1DIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAo Y2FjaGVfdHlwZSA9PSBDSF9DQUNIRSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyAiQ0giCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IChjYWNoZV90eXBlID09IEZDX0NBQ0hFKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/ICJGQyIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogIk5PIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPm1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS52cG9zLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bd19udGhdLmhwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAody0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnUuY2gpKTsKKyAgICAgICAgICAgICAgICAgICAg dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLnNhbWVfcCA9 IHRydWU7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgfQor ICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoZGVidWdfcCkKKyAgICAgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgICAgIGludCBvbGRfY2FjaGVfdXNlZCA9IG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdOworICAgICAgICAgICAgICAgICAgICAg IGludCBuZXdfY2FjaGVfdXNlZCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRb Y2FjaGVfdHlwZV07CisgICAgICAgICAgICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiTUlT UyAoJXMpOiAgdnBvcyAoJWQpIHwgaHBvcyAoJWQgdi4gJWQpIHwgY2hhciAoJXMgdi4gJXMpIHwg Y2FjaGVfdXNlZCAoJWQgdi4gJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKGNhY2hlX3R5cGUgPT0gTUNfQ0FDSEUpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gIk1DIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOiAoY2FjaGVfdHlwZSA9PSBDSF9DQUNIRSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyAiQ0giCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IChjYWNoZV90eXBlID09IEZDX0NBQ0hFKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/ICJGQyIKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogIk5PIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS52cG9z LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5ocG9zLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bd19udGhdLmhwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBtY19jaGFyX3RvX3N0cmluZyAob2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS5nbHlwaC51LmNoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nICh3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVt3X250aF0uZ2x5cGgudS5jaCksCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBvbGRfY2FjaGVfdXNlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIG5ld19jYWNoZV91c2VkKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAg ICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoIXNhbWVfcCkKKyAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgIC8qIGBtYXRyaXhfcm93JyBpbiBgZGlzcG5ldy5jYCBjb250YWlucyB0 aGUgZm9sbG93aW5nIHRlc3RzLAorICAgICAgICAgICAgICAgIGVhc3NlcnQgKG1hdHJpeCAmJiBt YXRyaXgtPnJvd3MpOworICAgICAgICAgICAgICAgIGVhc3NlcnQgKHJvdyA+PSAwICYmIHJvdyA8 IG1hdHJpeC0+bnJvd3MpOyAqLworICAgICAgICAgICAgICAgIGJvb2wgYmFyZl9jcmFzaF9vbmUg PSAody0+Y3VycmVudF9tYXRyaXggJiYgdy0+Y3VycmVudF9tYXRyaXgtPnJvd3MpID8gZmFsc2Ug OiB0cnVlOworICAgICAgICAgICAgICAgIGlmIChiYXJmX2NyYXNoX29uZSkKKyAgICAgICAgICAg ICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIGJvb2wgYmFyZl9jcmFzaF90d28gPSAo dm50aCA+PSAwICYmIHZudGggPCB3LT5jdXJyZW50X21hdHJpeC0+bnJvd3MpID8gZmFsc2UgOiB0 cnVlOworICAgICAgICAgICAgICAgIGlmIChiYXJmX2NyYXNoX3R3bykKKyAgICAgICAgICAgICAg ICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnZudGhfcm93 ID0gTUFUUklYX1JPVyAody0+Y3VycmVudF9tYXRyaXgsIHZudGgpOworICAgICAgICAgICAgICAg IGludCB4XzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBd Lng7CisgICAgICAgICAgICAgICAgaW50IGZ4XzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZ4OworICAgICAgICAgICAgICAgIGludCB5XzAgPSBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY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2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzBdLmZnLmdyZWVuLAorICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAg ICAgICAgICAgICAgICAgIC5ibHVlID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8wXS5mZy5ibHVlfTsKKyAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxz bF9iZ18wID0gey5yZWQgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXzBdLmJnLnJlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IC5ncmVlbiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0u YmcuZ3JlZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1 ZSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uYmcuYmx1 ZX07CisgICAgICAgICAgICAgICAgYm9vbCBhY3RpdmVfcF8wID0gb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5hY3RpdmVfcDsKKyAgICAgICAgICAgICAgICBl bnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3JfMCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGhfZmxhdm9yOworICAgICAgICAgICAgICAgIGJvb2wg ZW5hYmxlZF9wXzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XzBdLmVuYWJsZWRfcDsKKyAgICAgICAgICAgICAgICBpZiAodnBvc18wID09IHZudGgKKyAgICAg ICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yXzAgPT0gTUNfR0xZUEgKKyAgICAgICAgICAg ICAgICAgICAgJiYgZW5hYmxlZF9wXzAKKyAgICAgICAgICAgICAgICAgICAgJiYgdm50aF9yb3ct PmVuYWJsZWRfcCkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbWNf ZXJhc2VfY3Vyc29yICh3LCB3LT5jdXJyZW50X21hdHJpeCwgdm50aF9yb3csIG9sZF9tYXRyaXgs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeF8wLCB5XzAsIGhwb3NfMCwg dnBvc18wLCBnbHlwaF9mbGF2b3JfMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBjdXJzb3JfdHlwZV8wLCB3ZF8wKTsKKyAgICAgICAgICAgICAgICAgICAgb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5lbmFibGVkX3AgPSBmYWxzZTsK KyAgICAgICAgICAgICAgICAgICAgLS1vbGRfbWF0cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90eXBl XTsKKyAgICAgICAgICAgICAgICAgICAgLyogSWYgd2UgaW5hZHZlcnRlbnRseSBlcmFzZWQgYW5v dGhlciBmYWtlIGN1cnNvciBhdCB0aGUgc2FtZQorICAgICAgICAgICAgICAgICAgICBIUE9TIHRo YXQgaXMgc3RpbGwgZW5hYmxlZF9wIGluIHRoZSBgb2xkX21hdHJpeGAsIHRoZW4gcmVkcmF3IGl0 LiAqLworICAgICAgICAgICAgICAgICAgICBmb3IgKGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90 eXBlID0gTUNfQ0FDSEU7CisgICAgICAgICAgICAgICAgICAgICAgICAgY2FjaGVfdHlwZSA8IE5P X0NBQ0hFOworICAgICAgICAgICAgICAgICAgICAgICAgICsrY2FjaGVfdHlwZSkKKyAgICAgICAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBudGhfMSA9 IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX3RyYXZlcnNlX2NhY2hlX3AgKG9s ZF9tYXRyaXgsIGNhY2hlX3R5cGUsIHZudGgsIG50aF8xKTsKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKytudGhfMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGludCB4XzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXzFdLng7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZ4 XzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmZ4Owor ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB5XzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLnk7CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgaW50IGZ5XzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XzFdLmZ5OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBocG9zXzEgPSBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmhwb3M7CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgaW50IHZwb3NfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMV0udnBvczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBp bnQgd2RfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0u d2Q7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGhfMSA9IG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uaDsKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlXzEgPSBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmN1cnNvcl90eXBlOworICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGhfMSA9IG9sZF9tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uY3Vyc29yX3dpZHRoOworICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnXzEgPSB7LnJlZCA9IG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZmcucmVkLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gb2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5mZy5ncmVlbiwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVl ID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5mZy5ibHVl fTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgc3RydWN0IG1jX1JHQiBsc2xfYmdf MSA9IHsucmVkID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8x XS5iZy5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAg ICAgICAgICAgICAgLmdyZWVuID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8xXS5iZy5ncmVlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMV0uYmcuYmx1ZX07CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgYm9vbCBhY3RpdmVfcF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8xXS5hY3RpdmVfcDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1j X2ZsYXZvciBnbHlwaF9mbGF2b3JfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMV0uZ2x5cGhfZmxhdm9yOworICAgICAgICAgICAgICAgICAgICAgICAgICAg IGJvb2wgZW5hYmxlZF9wXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXzFdLmVuYWJsZWRfcDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGdv X3BfMSA9IChocG9zXzAgPT0gaHBvc18xCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgZW5hYmxlZF9wXzEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAg IGlmICghZ29fcF8xKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCByZW1vdmVfcF8xID0gZmFsc2U7CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHcsIHctPmN1cnJl bnRfbWF0cml4LCB2bnRoX3JvdywgeF8xLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBmeF8xLCB5XzEsIGZ5XzEsIGhwb3NfMSwgdnBvc18xLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ZF8xLCBoXzEs IGN1cnNvcl90eXBlXzEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGN1cnNvcl93aWR0aF8xLCBsc2xfZmdfMSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0aXZlX3BfMSwgZ2x5cGhfZmxhdm9yXzEs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92 ZV9wXzEpOworICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAg ICAgfQorICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgZWxzZSBpZiAodnBv c18wID09IHZudGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGVuYWJsZWRfcF8wCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB2bnRoX3Jvdy0+ZW5hYmxlZF9wKQorICAgICAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgYm9vbCByZW1vdmVfcF8wID0g dHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgdy0+ Y3VycmVudF9tYXRyaXgsIHZudGhfcm93LCB4XzAsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGZ4XzAsIHlfMCwgZnlfMCwgaHBvc18wLCB2cG9zXzAsIHdkXzAs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhfMCwgY3Vyc29y X3R5cGVfMCwgY3Vyc29yX3dpZHRoXzAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGxzbF9iZ18wLCBhY3RpdmVfcF8wLCBnbHlwaF9mbGF2b3JfMCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3ZlX3BfMCk7CisgICAg ICAgICAgICAgICAgICAgICAgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF8wXS5lbmFibGVkX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAtLW9sZF9t YXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5cGVdOworICAgICAgICAgICAgICAgICAgICAgIC8q IElmIHdlIGluYWR2ZXJ0ZW50bHkgZXJhc2VkIGFub3RoZXIgZmFrZSBjdXJzb3IgYXQgdGhlIHNh bWUKKyAgICAgICAgICAgICAgICAgICAgICBIUE9TIHRoYXQgaXMgc3RpbGwgZW5hYmxlZF9wIGlu IHRoZSBgb2xkX21hdHJpeGAsIHRoZW4gcmVkcmF3IGl0LiAqLworICAgICAgICAgICAgICAgICAg ICAgIGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNIRTsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICsrY2FjaGVfdHlwZSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgbnRoXzIgPSAwOworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIG1jX3RyYXZlcnNlX2NhY2hlX3AgKG9sZF9tYXRyaXgsIGNh Y2hlX3R5cGUsIHZudGgsIG50aF8yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAr K250aF8yKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGludCB4XzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXzJdLng7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZnhfMiA9 IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uZng7CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgeV8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS55OworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgaW50IGZ5XzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XzJdLmZ5OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGhwb3NfMiA9IG9sZF9t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uaHBvczsKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGludCB2cG9zXzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLnZwb3M7CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBpbnQgd2RfMiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhfMl0ud2Q7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaF8yID0gb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5oOworICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZV8yID0gb2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5jdXJzb3JfdHlwZTsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjdXJzb3Jfd2lkdGhfMiA9IG9sZF9t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uY3Vyc29yX3dpZHRoOwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmdfMiA9IHsu cmVkID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5mZy5y ZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIC5ncmVlbiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhf Ml0uZmcuZ3JlZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIC5ibHVlID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8yXS5mZy5ibHVlfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBz dHJ1Y3QgbWNfUkdCIGxzbF9iZ18yID0gey5yZWQgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzJdLmJnLnJlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uYmcuZ3JlZW4sCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IG9s ZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uYmcuYmx1ZX07Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGFjdGl2ZV9wXzIgPSBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmFjdGl2ZV9wOworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yXzIgPSBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmdseXBoX2ZsYXZvcjsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgZW5hYmxlZF9wXzIgPSBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmVuYWJsZWRfcDsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgZ29fcF8yID0gKGhwb3NfMCA9PSBocG9zXzIK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGZ4XzAgPD0g ZnhfMgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZnhf MCArIHdkXzAgPiBmeF8yICsgd2RfMgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgZW5hYmxlZF9wXzIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgaWYgKCFnb19wXzIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVl OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCByZW1vdmVfcF8yID0gZmFsc2U7 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywg dy0+Y3VycmVudF9tYXRyaXgsIHZudGhfcm93LCB4XzIsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnhfMiwgeV8yLCBmeV8yLCBocG9zXzIsIHZw b3NfMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICB3ZF8yLCBoXzIsIGN1cnNvcl90eXBlXzIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3dpZHRoXzIsIGxzbF9mZ18yLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2ZV9wXzIs IGdseXBoX2ZsYXZvcl8yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHJlbW92ZV9wXzIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgfQorICBpZiAodXBkYXRpbmdfZnJhbWVfcCkK KyAgICB1cGRhdGVfZW5kIChmKTsKK30KKwordm9pZAorbWNfdXBkYXRlX3dpbmRvd19kcnlydW4g KHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgZm9yY2VfcCwgc3RydWN0IG1jX2Vzc2VudGlhbHMgZXNz ZW50aWFscykKK3sKKyAgaWYgKCFCVUZGRVJQICh3LT5jb250ZW50cykpCisgICAgcmV0dXJuOwor CisgIGlmICh3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW01DX0NBQ0hFXSA9PSAwCisgICAgICAm JiB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0NIX0NBQ0hFXSA9PSAwCisgICAgICAmJiB3LT5t Y19tYXRyaXguY3Vyc29yc191c2VkW0ZDX0NBQ0hFXSA9PSAwCisgICAgICAmJiBOSUxQIChCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAgJiYgTklMUCAoQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICA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RfaW5wdXRfcGVuZGluZ19pZ25vcmVfc3F1ZWV6YWJsZXMgKCk7CisKKyAgLyogSWYgZm9y Y2VkIHRvIGNvbXBsZXRlIHRoZSB1cGRhdGUsIG9yIGlmIG5vIGlucHV0IGlzIHBlbmRpbmcsIGRv IHRoZSB1cGRhdGUuICovCisgIGlmIChmb3JjZV9wIHx8ICFpbnB1dF9wZW5kaW5nIHx8ICFOSUxQ IChkb19tb3VzZV90cmFja2luZykpCisgICAgeworICAgICAgc3RydWN0IGdseXBoX3JvdyAqaGVh ZGVyX2xpbmVfcm93OworICAgICAgYm9vbCBjaGFuZ2VkX3AgPSAwOworICAgICAgYm9vbCBtb3Vz ZV9mYWNlX292ZXJ3cml0dGVuX3AgPSAwOworICAgICAgaW50IG5fdXBkYXRlZCA9IDA7CisgICAg ICAvLyAgc3RydWN0IHJlZGlzcGxheV9pbnRlcmZhY2UgKnJpZiA9IEZSQU1FX1JJRiAoWEZSQU1F IChXSU5ET1dfRlJBTUUgKHcpKSk7CisgICAgICAvLyAgcmlmLT51cGRhdGVfd2luZG93X2JlZ2lu X2hvb2sgKHcpOworICAgICAgaW50IHliID0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpOworICAg ICAgc3RydWN0IGdseXBoX3JvdyAqcm93ID0gTUFUUklYX1JPVyAoZGVzaXJlZF9tYXRyaXgsIDAp OworICAgICAgc3RydWN0IGdseXBoX3JvdyAqZW5kID0gTUFUUklYX01PREVfTElORV9ST1cgKGRl c2lyZWRfbWF0cml4KTsKKworICAgICAgLyogVGFrZSBub3RlIG9mIHRoZSBoZWFkZXIgbGluZSwg aWYgdGhlcmUgaXMgb25lLiAgV2Ugd2lsbAorICAgICAgICAgdXBkYXRlIGl0IGJlbG93LCBhZnRl ciB1cGRhdGluZyBhbGwgb2YgdGhlIHdpbmRvdydzIGxpbmVzLiAqLworICAgICAgaWYgKHJvdy0+ bW9kZV9saW5lX3ApCisgICAgICAgIHsKKyAgICAgICAgICBoZWFkZXJfbGluZV9yb3cgPSByb3c7 CisgICAgICAgICAgKytyb3c7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIGhl YWRlcl9saW5lX3JvdyA9IE5VTEw7CisKKyAgICAgIC8qIFVwZGF0ZSB0aGUgbW9kZSBsaW5lLCBp ZiBuZWNlc3NhcnkuICovCisgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICptb2RlX2xpbmVfcm93ID0g TUFUUklYX01PREVfTElORV9ST1cgKGRlc2lyZWRfbWF0cml4KTsKKyAgICAgIGlmIChtb2RlX2xp bmVfcm93LT5tb2RlX2xpbmVfcCAmJiBtb2RlX2xpbmVfcm93LT5lbmFibGVkX3ApCisgICAgICAg IHsKKyAgICAgICAgICBtb2RlX2xpbmVfcm93LT55ID0geWIgKyBXSU5ET1dfU0NST0xMX0JBUl9B UkVBX0hFSUdIVCAodyk7CisgICAgICAgICAgdXBkYXRlX3dpbmRvd19saW5lICh3LCBNQVRSSVhf Uk9XX1ZQT1MgKG1vZGVfbGluZV9yb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGRlc2lyZWRfbWF0cml4KSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICZtb3VzZV9mYWNlX292ZXJ3cml0dGVuX3ApOworICAgICAgICB9CisKKyAgICAg IC8qIEZpbmQgZmlyc3QgZW5hYmxlZCByb3cuICBPcHRpbWl6YXRpb25zIGluIHJlZGlzcGxheV9p bnRlcm5hbAorICAgICAgICAgbWF5IGxlYWQgdG8gYW4gdXBkYXRlIHdpdGggb25seSBvbmUgcm93 IGVuYWJsZWQuICBUaGVyZSBtYXkKKyAgICAgICAgIGJlIGFsc28gY29tcGxldGVseSBlbXB0eSBt YXRyaWNlcy4gKi8KKyAgICAgIHdoaWxlIChyb3cgPCBlbmQgJiYgIXJvdy0+ZW5hYmxlZF9wKQor ICAgICAgICArK3JvdzsKKworICAgICAgLyogVHJ5IHJldXNpbmcgcGFydCBvZiB0aGUgZGlzcGxh eSBieSBjb3B5aW5nLiAqLworICAgICAgaWYgKHJvdyA8IGVuZCAmJiAhdy0+ZGVzaXJlZF9tYXRy aXgtPm5vX3Njcm9sbGluZ19wKQorICAgICAgICB7CisgICAgICAgICAgaW50IHJjID0gbWNfc2Ny b2xsaW5nX3dpbmRvdyAodywgaGVhZGVyX2xpbmVfcm93ICE9IE5VTEwpOworICAgICAgICAgIGlm IChyYyA8IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIC8qIEFsbCByb3dzIHdlcmUg Zm91bmQgdG8gYmUgZXF1YWwuICovCisgICAgICAgICAgICAgIHBhdXNlZF9wID0gMDsKKyAgICAg ICAgICAgICAgZ290byBzZXRfY3Vyc29yOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxz ZSBpZiAocmMgPiAwKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogV2UndmUg c2Nyb2xsZWQgdGhlIGRpc3BsYXkuICovCisgICAgICAgICAgICAgICAgZm9yY2VfcCA9IDE7Cisg ICAgICAgICAgICAgICAgY2hhbmdlZF9wID0gMTsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9 CisgICAgICAvKiBQcm9jZXNzIHRoZSBjdXJzb3Igcm93IGF0IHRoZSBvdXRzZXQgaWYgaXQgaXMg d2l0aGluIGBkZXNpcmVkX21hdHJpeGAuCisgICAgICBXaGVuIHByb2Nlc3NpbmcgYWxsIG90aGVy IHJvd3MsIHdlIHdpbGwgcXVlcnkgdGhlIGB3LT5jdXJyZW50X21hdHJpeGAgZm9yIGRhdGEKKyAg ICAgIHJlbGF0aW5nIHRvIHRoZSBjdXJzb3Igcm93LiAgYG1ha2VfY3VycmVudGAgKHdpdGhpbiBg dXBkYXRlX3dpbmRvd19saW5lJykKKyAgICAgIHVwZGF0ZXMgdGhlIGB3LT5jdXJyZW50X21hdHJp eGAgZm9yIHRoZSBhcHBsaWNhYmxlIHJvdy4gIEluIGRvaW5nIHNvLCBob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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29y X21hdHJpeCwgZXNzZW50aWFscywgZHJhd19wKTsKKyAgICAgICAgICAgICAgaWYgKE1BVFJJWF9S T1dfQk9UVE9NX1kgKHJvdykgPj0geWIpCisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IHZw b3MgKyAxOyBpIDwgdy0+Y3VycmVudF9tYXRyaXgtPm5yb3dzIC0gMTsgKytpKQorICAgICAgICAg ICAgICAgICAgU0VUX01BVFJJWF9ST1dfRU5BQkxFRF9QICh3LT5jdXJyZW50X21hdHJpeCwgaSwg ZmFsc2UpOworICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQor ICAgICAgY3Vyc29yX21hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworICAgICAgLyogVXBkYXRl IHRoZSByZXN0IG9mIHRoZSBsaW5lcy4gKi8KKyAgICAgIGZvciAoOyByb3cgPCBlbmQgJiYgKGZv cmNlX3AgfHwgIWlucHV0X3BlbmRpbmcpOyArK3JvdykKKyAgICAgICAgLyogc2Nyb2xsaW5nX3dp bmRvdyByZXNldHMgdGhlIGVuYWJsZWRfcCBmbGFnIG9mIHRoZSByb3dzIGl0IHJldXNlcyBmcm9t CisgICAgICAgIGN1cnJlbnRfbWF0cml4LiAqLworICAgICAgICBpZiAocm93LT5lbmFibGVkX3Ap CisgICAgICAgICAgeworICAgICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJv dywgdy0+ZGVzaXJlZF9tYXRyaXgpOworICAgICAgICAgICAgLyogSWYgdGhlIGBjdXJzb3Jfcm93 YCBpcyB3aXRoaW4gdGhlIGBkZXNpcmVkX21hdHJpeGAsIHRoZW4gaXQgd2FzCisgICAgICAgICAg ICBwcm9jZXNzZWQgaGVyZWluYWJvdmUgYW5kIHNob3VsZCBiZSBza2lwcGVkIGF0IHRoaXMgdGlt ZS4gKi8KKyAgICAgICAgICAgIGlmICh2cG9zID09IHctPmN1cnNvci52cG9zKQorICAgICAgICAg ICAgY29udGludWU7CisgICAgICAgICAgICBpbnQgaTsKKyAgICAgICAgICAgIC8qIFdlJ2xsIGhh dmUgdG8gcGxheSBhIGxpdHRsZSBiaXQgd2l0aCB3aGVuIHRvCisgICAgICAgICAgICAgICBkZXRl Y3RfaW5wdXRfcGVuZGluZy4gIElmIGl0J3MgZG9uZSB0b28gb2Z0ZW4sCisgICAgICAgICAgICAg ICBzY3JvbGxpbmcgbGFyZ2Ugd2luZG93cyB3aXRoIHJlcGVhdGVkIHNjcm9sbC11cAorICAgICAg ICAgICAgICAgY29tbWFuZHMgd2lsbCB0b28gcXVpY2tseSBwYXVzZSByZWRpc3BsYXkuICovCisg ICAgICAgICAgICBpZiAoIWZvcmNlX3AgJiYgKytuX3VwZGF0ZWQgJSBwcmVlbXB0X2NvdW50ID09 IDApCisgICAgICAgICAgICAgIGRldGVjdF9pbnB1dF9wZW5kaW5nX2lnbm9yZV9zcXVlZXphYmxl cyAoKTsKKyAgICAgICAgICAgIGNoYW5nZWRfcCB8PSBtY191cGRhdGVfd2luZG93X2xpbmUgKHcs IHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3cml0dGVuX3AsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCBkcmF3 X3ApOworICAgICAgICAgICAgLyogTWFyayBhbGwgcm93cyBiZWxvdyB0aGUgbGFzdCB2aXNpYmxl IG9uZSBpbiB0aGUgY3VycmVudAorICAgICAgICAgICAgICAgbWF0cml4IGFzIGludmFsaWQuICBU aGlzIGlzIG5lY2Vzc2FyeSBiZWNhdXNlIG9mCisgICAgICAgICAgICAgICB2YXJpYWJsZSBsaW5l IGhlaWdodHMuICBDb25zaWRlciB0aGUgY2FzZSBvZiB0aHJlZQorICAgICAgICAgICAgICAgc3Vj Y2Vzc2l2ZSByZWRpc3BsYXlzLCB3aGVyZSB0aGUgZmlyc3QgZGlzcGxheXMgNQorICAgICAgICAg ICAgICAgbGluZXMsIHRoZSBzZWNvbmQgMyBsaW5lcywgYW5kIHRoZSB0aGlyZCA1IGxpbmVzIGFn YWluLgorICAgICAgICAgICAgICAgSWYgdGhlIHNlY29uZCByZWRpc3BsYXkgd291bGRuJ3QgbWFy ayByb3dzIGluIHRoZQorICAgICAgICAgICAgICAgY3VycmVudCBtYXRyaXggaW52YWxpZCwgdGhl IHRoaXJkIHJlZGlzcGxheSBtaWdodCBiZQorICAgICAgICAgICAgICAgdGVtcHRlZCB0byBvcHRp bWl6ZSByZWRpc3BsYXkgYmFzZWQgb24gbGluZXMgZGlzcGxheWVkCisgICAgICAgICAgICAgICBp biB0aGUgZmlyc3QgcmVkaXNwbGF5LiAqLworICAgICAgICAgICAgaWYgKE1BVFJJWF9ST1dfQk9U VE9NX1kgKHJvdykgPj0geWIpCisgICAgICAgICAgICAgIGZvciAoaSA9IHZwb3MgKyAxOyBpIDwg dy0+Y3VycmVudF9tYXRyaXgtPm5yb3dzIC0gMTsgKytpKQorICAgICAgICAgICAgICAgIFNFVF9N QVRSSVhfUk9XX0VOQUJMRURfUCAody0+Y3VycmVudF9tYXRyaXgsIGksIGZhbHNlKTsKKyAgICAg ICAgICB9CisgICAgICAvKiBXYXMgZGlzcGxheSBwcmVlbXB0ZWQ/ICovCisgICAgICBwYXVzZWRf cCA9IHJvdyA8IGVuZDsKKyAgICAgIHNldF9jdXJzb3I6CisgICAgICAvKiBJZiB3ZSBqdW1wZWQg aGVyZSBmcm9tIGBzZXRfY3Vyc29yYCwgdGhlbiBzZXQgdGhlIGBjdXJzb3JfbWF0cml4YC4gKi8K KyAgICAgIGlmIChjdXJzb3JfbWF0cml4ID09IE5VTEwpCisgICAgICAgIGN1cnNvcl9tYXRyaXgg PSB3LT5jdXJyZW50X21hdHJpeDsKKyAgICAgIC8qIFJlc2V0IGByb3dgIHRvIDAgc28gdGhhdCBm YWtl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kIC0gY2xvY2tfc3RhcnQpKSAvIENMT0NLU19QRVJfU0VDOworICAv LyBmcHJpbnRmIChzdGRlcnIsICJtY19zY3JvbGxpbmdfd2luZG93ICglcyk6ICBUSU1FICglZilc biIsIG1jX3dpbmRvdyAodyksIGNwdV90aW1lX3VzZWQpOworfQorCisvKiBlbmQgTVVMVElQTEUt Q1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogLyogU3RydWN0dXJlIHRv IHBhc3MgZGltZW5zaW9ucyBhcm91bmQuICBVc2VkIGZvciBjaGFyYWN0ZXIgYm91bmRpbmcKICAg IGJveGVzLCBnbHlwaCBtYXRyaXggZGltZW5zaW9ucyBhbmQgYWxpa2UuICAqLwogCkBAIC0yMjQx LDYgKzQwMTcsMTYgQEAgZnJlZV93aW5kb3dfbWF0cmljZXMgKHN0cnVjdCB3aW5kb3cgKncpCiAJ ICBmcmVlX2dseXBoX21hdHJpeCAody0+Y3VycmVudF9tYXRyaXgpOwogCSAgZnJlZV9nbHlwaF9t YXRyaXggKHctPmRlc2lyZWRfbWF0cml4KTsKIAkgIHctPmN1cnJlbnRfbWF0cml4ID0gdy0+ZGVz aXJlZF9tYXRyaXggPSBOVUxMOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCisgIG1jX3hmcmVlX2NhY2hlX21hdHJpeCAodywgJnctPm1jX21h dHJpeCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAl9CiAKICAgICAgIC8qIE5l eHQgd2luZG93IG9uIHNhbWUgbGV2ZWwuICAqLwpAQCAtMzM4Nyw2ICs1MTczLDI2IEBAIGNoZWNr X2N1cnJlbnRfbWF0cml4X2ZsYWdzIChzdHJ1Y3Qgd2luZG93ICp3KQogc3RhdGljIGJvb2wKIHVw ZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkKIHsKKworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBpZiAobWNf c3RkZXJyX3ApCisgICAgZnByaW50ZiAoc3RkZXJyLCAidXBkYXRlX3dpbmRvdyAoJXMpXG4iLCBt Y193aW5kb3cgKHcpKTsKKworICBzdHJ1Y3QgbWNfZXNzZW50aWFscyBlc3NlbnRpYWxzOworICBt Y19zZXRfZXNzZW50aWFscyAodywgJmVzc2VudGlhbHMpOworCisgIG1jX3VwZGF0ZV93aW5kb3df ZHJ5cnVuICh3LCBmb3JjZV9wLCBlc3NlbnRpYWxzKTsKKworICBzdHJ1Y3QgZ2x5cGhfbWF0cml4 ICpjdXJzb3JfbWF0cml4ID0gTlVMTDsKKworICBib29sIGRyYXdfcCA9IHRydWU7CisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICAgc3RydWN0IGdseXBoX21hdHJpeCAqZGVzaXJlZF9t YXRyaXggPSB3LT5kZXNpcmVkX21hdHJpeDsKICAgYm9vbCBwYXVzZWRfcDsKICAgaW50IHByZWVt cHRfY291bnQgPSBjbGlwX3RvX2JvdW5kcyAoMSwgYmF1ZF9yYXRlIC8gMjQwMCArIDEsIElOVF9N QVgpOwpAQCAtMzQ2NCw2ICs1MjcwLDQ3IEBAIHVwZGF0ZV93aW5kb3cgKHN0cnVjdCB3aW5kb3cg KncsIGJvb2wgZm9yY2VfcCkKIAkgICAgfQogCX0KIAorCisvKi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ZGVzaXJlZF9tYXRyaXgpOworICAgICAgaWYgKG1jX3Jvdy0+ZW5hYmxlZF9wCisgICAg ICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgeworICAgICAgICAgIGN1 cnNvcl9tYXRyaXggPSBkZXNpcmVkX21hdHJpeDsKKyAgICAgICAgICBpZiAoIWZvcmNlX3AgJiYg KytuX3VwZGF0ZWQgJSBwcmVlbXB0X2NvdW50ID09IDApCisgICAgICAgICAgICBkZXRlY3RfaW5w dXRfcGVuZGluZ19pZ25vcmVfc3F1ZWV6YWJsZXMgKCk7CisgICAgICAgICAgY2hhbmdlZF9wIHw9 IChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICghTklM UCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9z c2hhaXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAhIE5JTFAgKEJWQVIgKFhC VUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgPyBtY191cGRhdGVfd2luZG93X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3cml0 dGVuX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBj dXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCBkcmF3X3ApCisgICAgICAgICAgICAgICAgICAgICAg IDogdXBkYXRlX3dpbmRvd19saW5lICh3LCB2cG9zLCAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9w KTsKKyAgICAgICAgICBpZiAoTUFUUklYX1JPV19CT1RUT01fWSAocm93KSA+PSB5YikKKyAgICAg ICAgICAgIGZvciAoaW50IGkgPSB2cG9zICsgMTsgaSA8IHctPmN1cnJlbnRfbWF0cml4LT5ucm93 cyAtIDE7ICsraSkKKyAgICAgICAgICAgICAgU0VUX01BVFJJWF9ST1dfRU5BQkxFRF9QICh3LT5j dXJyZW50X21hdHJpeCwgaSwgZmFsc2UpOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9Cisg ICAgfQorCisgIGN1cnNvcl9tYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisKKwogICAgICAgLyogVXBkYXRlIHRoZSByZXN0IG9mIHRoZSBsaW5l cy4gICovCiAgICAgICBmb3IgKDsgcm93IDwgZW5kICYmIChmb3JjZV9wIHx8ICFpbnB1dF9wZW5k aW5nKTsgKytyb3cpCiAJLyogc2Nyb2xsaW5nX3dpbmRvdyByZXNldHMgdGhlIGVuYWJsZWRfcCBm bGFnIG9mIHRoZSByb3dzIGl0CkBAIC0zNDcxLDYgKzUzMTgsMTkgQEAgdXBkYXRlX3dpbmRvdyAo c3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wKQogCWlmIChyb3ctPmVuYWJsZWRfcCkKIAkg IHsKIAkgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJvdywgZGVzaXJlZF9tYXRyaXgp OworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLwor CisgICAgICAgICAgLyogSWYgdGhlIGBjdXJzb3Jfcm93YCBpcyB3aXRoaW4gdGhlIGBkZXNpcmVk X21hdHJpeGAsIHRoZW4gaXQgd2FzCisgICAgICAgICAgcHJvY2Vzc2VkIGhlcmVpbmFib3ZlIGFu ZCBzaG91bGQgYmUgc2tpcHBlZCBhdCB0aGlzIHRpbWUuICovCisgICAgICAgICAgaWYgKHZwb3Mg PT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgY29udGludWU7CisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKIAkgICAgaW50IGk7CiAKIAkgICAgLyogV2UnbGwgaGF2ZSB0byBwbGF5 IGEgbGl0dGxlIGJpdCB3aXRoIHdoZW4gdG8KQEAgLTM0NzksOCArNTMzOSwyMSBAQCB1cGRhdGVf d2luZG93IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3ApCiAJICAgICAgIGNvbW1hbmRz IHdpbGwgdG9vIHF1aWNrbHkgcGF1c2UgcmVkaXNwbGF5LiAgKi8KIAkgICAgaWYgKCFmb3JjZV9w ICYmICsrbl91cGRhdGVkICUgcHJlZW1wdF9jb3VudCA9PSAwKQogCSAgICAgIGRldGVjdF9pbnB1 dF9wZW5kaW5nX2lnbm9yZV9zcXVlZXphYmxlcyAoKTsKLQkgICAgY2hhbmdlZF9wIHw9IHVwZGF0 ZV93aW5kb3dfbGluZSAodywgdnBvcywKLQkJCQkJICAgICAmbW91c2VfZmFjZV9vdmVyd3JpdHRl bl9wKTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMg Ki8KKworICAgICAgICAgIGNoYW5nZWRfcCB8PSAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAg ICAgICAgICAgICAgICAgICAgICAmJiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgfHwgISBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2li bGUpKSkpCisgICAgICAgICAgICAgICAgICAgICAgID8gbWNfdXBkYXRlX3dpbmRvd19saW5lICh3 LCB2cG9zLCAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgZHJh d19wKQorICAgICAgICAgICAgICAgICAgICAgICA6IHVwZGF0ZV93aW5kb3dfbGluZSAodywgdnBv cywgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCiAKIAkgICAgLyogTWFyayBhbGwgcm93cyBiZWxvdyB0aGUgbGFzdCB2aXNpYmxlIG9uZSBp biB0aGUgY3VycmVudAogCSAgICAgICBtYXRyaXggYXMgaW52YWxpZC4gIFRoaXMgaXMgbmVjZXNz YXJ5IGJlY2F1c2Ugb2YKQEAgLTM1MDEsNiArNTM3NCw0MSBAQCB1cGRhdGVfd2luZG93IChzdHJ1 Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3ApCiAKICAgICBzZXRfY3Vyc29yOgogCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8qIElmIHdl IGp1bXBlZCBoZXJlIGZyb20gYHNldF9jdXJzb3JgLCB0aGVuIHNldCB0aGUgYGN1cnNvcl9tYXRy aXhgLiAqLworICBpZiAoY3Vyc29yX21hdHJpeCA9PSBOVUxMKQorICAgIGN1cnNvcl9tY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ICAgICAgIGVsc2UgaWYgKHJvdy0+bW9kZV9s aW5lX3ApCisgICAgICAgICAgY29udGludWU7CisgICAgICBpZiAocm93LT5vdmVybGFwcGVkX3Ap CisgICAgICAgIHsKKyAgICAgICAgICBmb3IgKGVudW0gZ2x5cGhfcm93X2FyZWEgYXJlYSA9IExF RlRfTUFSR0lOX0FSRUE7IGFyZWEgPCBMQVNUX0FSRUE7ICsrYXJlYSkKKyAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgb3V0cHV0X2N1cnNvcl90byAodywgaSwgMCwgcm93LT55LCBhcmVhID09 IFRFWFRfQVJFQSA/IHJvdy0+eCA6IDApOworICAgICAgICAgICAgICBpZiAoIW1jX3JlZHJhd19y b3cgKHcsIHctPmN1cnJlbnRfbWF0cml4LCByb3csIGFyZWEsIHJvdy0+eCwgMCwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICByb3ctPnVzZWRbYXJlYV0sIHRydWUsIERSQVdfTk9S TUFMX1RFWFQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVVBEQVRFX1dJTkRP V19fUkVEUkFXX09WRVJMQVBQRURfUk9XUykKKyAgICAgICAgICAgICAgICAgICYmIHJvdy0+dXNl ZFthcmVhXSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBGUkFNRV9SSUYg KGYpLT53cml0ZV9nbHlwaHMgKHcsIHJvdywgcm93LT5nbHlwaHNbYXJlYV0sIGFyZWEsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvdy0+dXNlZFthcmVh XSk7CisgICAgICAgICAgICAgICAgICBGUkFNRV9SSUYgKGYpLT5jbGVhcl9lbmRfb2ZfbGluZSAo dywgcm93LCBhcmVhLCAtMSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAg ICAgICAgIHJvdy0+b3ZlcmxhcHBlZF9wID0gMDsKKyAgICAgICAgfQorICAgICAgaWYgKE1BVFJJ WF9ST1dfQk9UVE9NX1kgKHJvdykgPj0geWIpCisgICAgICAgIGJyZWFrOworICAgIH0KKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogCSAgICAgIHJlZHJhd19vdmVybGFwcGluZ19yb3dz ICh3LCB5Yik7CiAJICAgIH0KICNlbmRpZgpAQCAtMzUzNiw4ICs1NDg2LDIwIEBAIHVwZGF0ZV93 aW5kb3cgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkKICNlbmRpZgogCiAjaWZkZWYg SEFWRV9XSU5ET1dfU1lTVEVNCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKyAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgJiYg IU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgIG1j X3VwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgMCk7CisgICAgZWxzZQogICAgICAgdXBkYXRlX3dp bmRvd19mcmluZ2VzICh3LCAwKTsKIAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAg ICAgLyogRW5kIHRoZSB1cGRhdGUgb2Ygd2luZG93IFcuICBEb24ndCBzZXQgdGhlIGN1cnNvciBp ZiB3ZQogICAgICAgICAgcGF1c2VkIHVwZGF0aW5nIHRoZSBkaXNwbGF5IGJlY2F1c2UgaW4gdGhp cyBjYXNlLAogICAgICAgICAgc2V0X3dpbmRvd19jdXJzb3JfYWZ0ZXJfdXBkYXRlIGhhc24ndCBi ZWVuIGNhbGxlZCwgY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VvZiAoYml0cykv QllURVNfUEVSX0JJVE1BUF9ST1cpCiAjZGVmaW5lIEZSQklUUyhiaXRzKSAgYml0cywgU1RBTkRB UkRfQklUTUFQX0hFSUdIVCAoYml0cykKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IGJlZ2luIE1VTFRJUExFLUNVUlNPUlMgKi8KKworLyogYCstZnJpbmdlLWhlbHBlci1kZWNpbWFs JyBkZWZpbmVkIGluIGArLW1vZGUuZWxgICovCisKKy8qIFRPRE86ICBDb25zaWRlciBhZGRpbmcg dGhlIGZvbGxvd2luZyBmcmluZ2UgYml0bWFwczoKKyAgKGRlZmluZS1mcmluZ2UtYml0bWFwICdi cmVha3BvaW50ICJceDNjXHg3ZVx4ZmZceGZmXHhmZlx4ZmZceDdlXHgzYyIpCisgIChkZWZpbmUt ZnJpbmdlLWJpdG1hcCAnaG9sbG93LXJpZ2h0LXRyaWFuZ2xlICJceGUwXHg5MFx4ODhceDg0XHg4 NFx4ODhceDkwXHhlMCIpICovCisKKy8qIDI0CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVj aW1hbAorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4uIgorICAgICAgInguLi4uLi4u IgorICAgICAgInguLnh4Li4uIgorICAgICAgInguLi54eC4uIgorICAgICAgInguLi4ueHguIgor ICAgICAgIngueHh4eHh4IgorICAgICAgIngueHh4eHh4IgorICAgICAgInguLi4ueHguIgorICAg ICAgInguLi54eC4uIgorICAgICAgInguLnh4Li4uIgorICAgICAgInguLi4uLi4uIgorICAgICAg InguLi4uLi4uIgorICAgICAgInguLi4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQg bWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93X2JpdHNbXSA9eworICAweDgwLCAweDgwLCAweDgw LCAweDk4LCAweDhjLCAweDg2LCAweGJmLAorICAweGJmLCAweDg2LCAweDhjLCAweDk4LCAweDgw LCAweDgwLCAweDgwfTsKKworLyogMjUKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFs CisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4uLi4ueHgiCisg ICAgICAiLnh4Li4ueHgiCisgICAgICAiLi54eC4ueHgiCisgICAgICAiLi4ueHgueHgiCisgICAg ICAieHh4eHh4eHgiCisgICAgICAieHh4eHh4eHgiCisgICAgICAiLi4ueHgueHgiCisgICAgICAi Li54eC4ueHgiCisgICAgICAiLnh4Li4ueHgiCisgICAgICAiLi4uLi4ueHgiCisgICAgICAiLi4u Li4ueHgiCisgICAgICAiLi4uLi4ueHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19y ZXZlcnNlZF92ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3dfYml0c1tdID17CisgIDB4MywgMHgzLCAw eDMsIDB4NjMsIDB4MzMsIDB4MWIsIDB4ZmYsIDB4ZmYsIDB4MWIsIDB4MzMsIDB4NjMsIDB4Mywg MHgzLCAweDN9OworCisvKiAyNgorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAg ICAgICJ4eHh4eHh4eCIKKyAgICAgICJ4Li4uLi4ueCIKKyAgICAgICJ4Li4uLi4ueCIKKyAgICAg ICJ4Li54eC4ueCIKKyAgICAgICJ4Li4ueHgueCIKKyAgICAgICJ4Li4uLnh4eCIKKyAgICAgICJ4 Lnh4eHh4eCIKKyAgICAgICJ4Lnh4eHh4eCIKKyAgICAgICJ4Li4uLnh4eCIKKyAgICAgICJ4Li4u eHgueCIKKyAgICAgICJ4Li54eC4ueCIKKyAgICAgICJ4Li4uLi4ueCIKKyAgICAgICJ4Li4uLi4u eCIKKyAgICAgICJ4eHh4eHh4eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX2hvbGxv d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4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4u Li4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4u Lnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4 IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcmV2ZXJzZWRfdmVydGljYWxfYmFyX2Jp dHNbXSA9eworICAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAw eDMsIDB4MywgMHgzLCAweDMsIDB4M307CisKKy8qIDMxCisgICAgKCstZnJpbmdlLWhlbHBlci1o ZXhhZGVjaW1hbAorICAgICAgInh4Li4uLi4uIgorICAgICAgInh4Li4uLi4uIgorICAgICAgIiB4 eC4uLi4uIgorICAgICAgIi54eC4uLi4uIgorICAgICAgIi4ueHguLi4uIgorICAgICAgIi4ueHgu Li4uIgorICAgICAgIi4uLnh4Li4uIgorICAgICAgIi4uLnh4Li4uIgorICAgICAgIi4uLi54eC4u IgorICAgICAgIi4uLi54eC4uIgorICAgICAgIi4uLi4ueHguIgorICAgICAgIi4uLi4ueHguIgor ICAgICAgIi4uLi4uLnh4IgorICAgICAgIi4uLi4uLnh4IikKKyovCitzdGF0aWMgdW5zaWduZWQg c2hvcnQgbWNfYmFja3NsYXNoX2JpdHNbXSA9eworICAweGMwLCAweGMwLCAweGUwLCAweDYwLCAw eDMwLCAweDMwLCAweDE4LCAweDE4LCAweGMsIDB4YywgMHg2LCAweDYsIDB4MywgMHgzfTsKKwor LyogMzIKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieHguLi4uLi4i CisgICAgICAieHguLi4uLi4iCisgICAgICAieHh4Li4uLi4iCisgICAgICAieHh4Li4uLi4iCisg ICAgICAieC54eC4uLi4iCisgICAgICAieC54eC4uLi4iCisgICAgICAieC4ueHguLi4iCisgICAg ICAieC4ueHguLi4iCisgICAgICAieC4uLnh4Li4iCisgICAgICAieC4uLnh4Li4iCisgICAgICAi eC4uLi54eC4iCisgICAgICAieC4uLi54eC4iCisgICAgICAieC4uLi4ueHgiCisgICAgICAieC4u Li4ueHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY192ZXJ0aWNhbF9iYXJfYmFja3Ns YXNoX2JpdHNbXSA9eworICAweGMwLCAweGMwLCAweGUwLCAweGUwLCAweGIwLCAweGIwLCAweDk4 LAorICAweDk4LCAweDhjLCAweDhjLCAweDg2LCAweDg2LCAweDgzLCAweDgzfTsKKworLyogMzMK KyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLnh4eHh4eC4iCisgICAg ICAieHh4eC54Li4iCisgICAgICAieHh4eC54Li4iCisgICAgICAieHh4eC54Li4iCisgICAgICAi Lnh4eC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAgICAiLi4u eC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54Li4iCisgICAgICAiLi4ueC54 Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19waWxjcm93X2JpdHNbXSA9eworICAw eDdlLCAweGY0LCAweGY0LCAweGY0LCAweDc0LCAweDE0LCAweDE0LCAweDE0LCAweDE0LCAweDE0 LCAweDE0fTsKKworLyogMzQKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAg ICAiLi54eHh4Li4iCisgICAgICAiLnh4eHh4eC4iCisgICAgICAieC4ueHguLngiCisgICAgICAi eC4ueHguLngiCisgICAgICAieHh4eHh4eHgiCisgICAgICAieHguLi4ueHgiCisgICAgICAieHh4 Li54eHgiCisgICAgICAiLnh4eHh4eC4iCisgICAgICAiLi54eHh4Li4iKQorKi8KK3N0YXRpYyB1 bnNpZ25lZCBzaG9ydCBtY19zbWlsZXlfZmFjZV9iaXRzW10gPXsKKyAgMHgzYywgMHg3ZSwgMHg5 OSwgMHg5OSwgMHhmZiwgMHhjMywgMHhlNywgMHg3ZSwgMHgzY307CisKKy8qIDM1CisgICAgKCst ZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4ueC4uLi4uIgorICAgICAgIi4uLngu Li4uIgorICAgICAgIi4uLi54Li4uIgorICAgICAgIi4uLi4ueC4uIgorICAgICAgIi4uLi54Li4u IgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC4uLi4uIikKKyovCitzdGF0aWMgdW5zaWdu ZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX3JpZ2h0X2JpdHNbXSA9eworICAweDIwLCAweDEwLCAw eDgsIDB4NCwgMHg4LCAweDEwLCAweDIwfTsKKworLyogMzYKKyAgICAoKy1mcmluZ2UtaGVscGVy LWhleGFkZWNpbWFsCisgICAgICAiLi4uLi54Li4iCisgICAgICAiLi4uLnguLi4iCisgICAgICAi Li4ueC4uLi4iCisgICAgICAiLi54Li4uLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4u LnguLi4iCisgICAgICAiLi4uLi54Li4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19z aW5nbGVfYW5nbGVfbGVmdF9iaXRzW10gPXsKKyAgMHg0LCAweDgsIDB4MTAsIDB4MjAsIDB4MTAs IDB4OCwgMHg0fTsKKworLyogMzcKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisg ICAgICAieHgueHguLi4iCisgICAgICAiLnh4Lnh4Li4iCisgICAgICAiLi54eC54eC4iCisgICAg ICAiLi4ueHgueHgiCisgICAgICAiLi54eC54eC4iCisgICAgICAiLnh4Lnh4Li4iCisgICAgICAi eHgueHguLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfcmln aHRfYml0c1tdID17CisgIDB4ZDgsIDB4NmMsIDB4MzYsIDB4MWIsIDB4MzYsIDB4NmMsIDB4ZDh9 OworCisvKiAzOAorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi54 eC54eCIKKyAgICAgICIuLnh4Lnh4LiIKKyAgICAgICIueHgueHguLiIKKyAgICAgICJ4eC54eC4u LiIKKyAgICAgICIueHgueHguLiIKKyAgICAgICIuLnh4Lnh4LiIKKyAgICAgICIuLi54eC54eCIp CisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX2RvdWJsZV9hbmdsZV9sZWZ0X2JpdHNbXSA9 eworICAweDFiLCAweDM2LCAweDZjLCAweGQ4LCAweDZjLCAweDM2LCAweDFifTsKKworLyogMzkK KyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAieC54LnguLi4iCisgICAg ICAiLngueC54Li4iCisgICAgICAiLi54LngueC4iCisgICAgICAiLi4ueC54LngiCisgICAgICAi Li54LngueC4iCisgICAgICAiLngueC54Li4iCisgICAgICAieC54LnguLi4iKQorKi8KK3N0YXRp YyB1bnNpZ25lZCBzaG9ydCBtY190cmlwbGVfYW5nbGVfcmlnaHRfYml0c1tdID17CisgIDB4YTgs IDB4NTQsIDB4MmEsIDB4MTUsIDB4MmEsIDB4NTQsIDB4YTh9OworCisvKiA0MAorICAgICgrLWZy aW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi54LngueCIKKyAgICAgICIuLngueC54 LiIKKyAgICAgICIueC54LnguLiIKKyAgICAgICJ4LngueC4uLiIKKyAgICAgICIueC54LnguLiIK KyAgICAgICIuLngueC54LiIKKyAgICAgICIuLi54LngueCIpCisqLworc3RhdGljIHVuc2lnbmVk IHNob3J0IG1jX3RyaXBsZV9hbmdsZV9sZWZ0X2JpdHNbXSA9eworICAweDE1LCAweDJhLCAweDU0 LCAweGE4LCAweDU0LCAweDJhLCAweDE1fTsKKworLyogNDEKKyAgICAoKy1mcmluZ2UtaGVscGVy LWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAi Li4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54 LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLi4uLi4u Li4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4i KQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zaW5nbGVfYW5nbGVfdXBfYml0c1tdID17 CisgIDB4MDAsIDB4MDAsIDB4MDAsIDB4MDAsIDB4MTAsIDB4MjgsIDB4NDQsIDB4ODIsIDB4MDAs IDB4MDAsIDB4MDAsIDB4MDB9OworCisvKiA0MgorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRl Y2ltYWwKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4u LiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIueC4uLnguLiIK KyAgICAgICIuLngueC4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAg ICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIpCisqLwor c3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3NpbmdsZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAw eDAwLCAweDAwLCAweDAwLCAweDAwLCAweDgyLCAweDQ0LCAweDI4LCAweDEwLCAweDAwLCAweDAw LCAweDAwLCAweDAwfTsKKworLyogNDMKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFs CisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisg ICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAg ICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAi eC4uLi4ueC4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4u Li4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfdXBfYml0 c1tdID17CisgIDB4MDAsIDB4MDAsIDB4MDAsIDB4MTAsIDB4MjgsIDB4NDQsIDB4OTIsIDB4Mjgs IDB4NDQsIDB4ODIsIDB4MDAsIDB4MDAsIDB4MDB9OworCisvKiA0NAorICAgICgrLWZyaW5nZS1o ZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAg ICAgICIuLi4uLi4uLiIKKyAgICAgICJ4Li4uLi54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAg ICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIu LngueC4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICIuLi4u Li4uLiIKKyAgICAgICIuLi4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX2Rv dWJsZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAweDAwLCAweDAwLCAweDAwLCAweDgyLCAweDQ0 LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDEwLCAweDAwLCAweDAwLCAweDAwfTsKKworLyog NDUKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisg ICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAg ICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAi eC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4u Li4ueC4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190 cmlwbGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4MDAsIDB4MTAsIDB4MjgsIDB4NDQsIDB4OTIs IDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4ODIsIDB4MDB9OworCisvKiA0NgorICAg ICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi4uLiIKKyAgICAgICJ4 Li4uLi54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54 Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54 LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIuLi54Li4uLiIK KyAgICAgICIuLi4uLi4uLiIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3F1YWRydXBs ZV9hbmdsZV9kb3duX2JpdHNbXSA9eworICAweDAwLCAweDgyLCAweDQ0LCAweDI4LCAweDkyLCAw eDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDEwLCAweDAwfTsKKworLyogNDcKKyAgICAo Ky1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi54 LnguLi4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54Lngu Li4iCisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4i CisgICAgICAiLnguLi54Li4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLi54LnguLi4iCisg ICAgICAiLnguLi54Li4iCisgICAgICAieC4uLi4ueC4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBz aG9ydCBtY19xdWFkcnVwbGVfYW5nbGVfdXBfYml0c1tdID17CisgIDB4MTAsIDB4MjgsIDB4NDQs IDB4OTIsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4OTIsIDB4MjgsIDB4NDQsIDB4 ODJ9OworCisvKiA0OAorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICJ4 Li4uLi54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54 Li54LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54 LiIKKyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICJ4Li54Li54LiIK KyAgICAgICIueC4uLnguLiIKKyAgICAgICIuLngueC4uLiIKKyAgICAgICIuLi54Li4uLiIpCisq Lworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3RyaXBsZV9hbmdsZV9kb3duX2JpdHNbXSA9ewor ICAweDgyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAweDkyLCAweDQ0LCAweDI4LCAw eDkyLCAweDQ0LCAweDI4LCAweDEwfTsKKwogLyogTk9URTogIFRoZSBvcmRlciBvZiB0aGVzZSBi aXRtYXBzIG11c3QgbWF0Y2ggdGhlIHNlcXVlbmNlCi0gICB1c2VkIGluIGZyaW5nZS5lbCB0byBk ZWZpbmUgdGhlIGNvcnJlc3BvbmRpbmcgc3ltYm9scy4gICovCisgICB1c2VkIGluIGZyaW5nZS5l bCB0byBkZWZpbmUgdGhlIGNvcnJlc3BvbmRpbmcgc3ltYm9scy4gKi8KIAogc3RhdGlj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IHByZXNlbnQsIHVzZSBub24tcGFydGlhbCBiaXRt YXAuICovCitpbnQKK21jX2dldF9mcmluZ2VfYml0bWFwIChzdHJ1Y3Qgd2luZG93ICp3LCBMaXNw X09iamVjdCBiaXRtYXAsIGludCByaWdodF9wLCBpbnQgcGFydGlhbF9wKQoreworICBMaXNwX09i amVjdCBjbWFwLCBibTEgPSBRbmlsLCBibTIgPSBRbmlsLCBibTsKKyAgRU1BQ1NfSU5UIGxuMSA9 IDAsIGxuMiA9IDA7CisgIGludCBpeDEgPSByaWdodF9wOworICBpbnQgaXgyID0gaXgxICsgKHBh cnRpYWxfcCA/IDIgOiAwKTsKKyAgaWYgKChjbWFwID0gQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSksICFOSUxQIChjbWFwKSkKKyAgICB7CisgICAg ICBibTEgPSBtY19hc3NxIChiaXRtYXAsIGNtYXApOworICAgICAgaWYgKENPTlNQIChibTEpKQor ICB7CisgICAgaWYgKChibTEgPSBYQ0RSIChibTEpKSwgTklMUCAoYm0xKSkKKyAgICAgIHJldHVy biBNQ19OT19GUklOR0VfQklUTUFQOworICAgIGlmIChDT05TUCAoYm0xKSkKKyAgICAgIHsKKyAg ICAgICAgbG4xID0gWEZJWE5VTSAoRmxlbmd0aCAoYm0xKSk7CisgICAgICAgIGlmIChwYXJ0aWFs X3ApCisgICAgICAgICAgeworICAgICAgICAgICAgaWYgKGxuMSA+IGl4MikKKyAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMSk7CisgICAgICAgICAg ICAgICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7Cisg ICAgICAgICAgICAgIH0KKyAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAg eworICAgICAgICAgICAgICBpZiAobG4xID4gaXgxKQorICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMSk7CisgICAgICAgICAgICAgICAgICBp ZiAoIUVRIChibSwgUXQpKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5kOworICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgIH0KKyAgICBlbHNlIGlmICgoYm0gPSBi bTEsICFFUSAoYm0sIFF0KSkpCisgICAgICBnb3RvIGZvdW5kOworICB9CisgICAgfQorICBpZiAo IUVRIChjbWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0 KSkKKyAgICAgICYmICFOSUxQIChCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNh dG9yX2FsaXN0KSkpCisgICAgeworICAgICAgYm0yID0gbWNfYXNzcSAoYml0bWFwLCBCVkFSICgm YnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSk7CisgICAgICBpZiAoQ09O U1AgKGJtMikpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoKGJtMiA9IFhDRFIgKGJtMikpLCAh TklMUCAoYm0yKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKENPTlNQIChibTIp KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGxuMiA9IFhGSVhOVU0gKEZs ZW5ndGggKGJtMikpOworICAgICAgICAgICAgICAgICAgaWYgKHBhcnRpYWxfcCkKKyAgICAgICAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGlmIChsbjIgPiBpeDIpCisgICAg ICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGJtID0gbWNf bnRoIChpeDIsIGJtMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghRVEgKGJtLCBR dCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgaWYgKGxuMSA+IGl4MSkKKyAgICB7 CisgICAgICBibSA9IG1jX250aCAoaXgxLCBibTEpOworICAgICAgaWYgKCFFUSAoYm0sIFF0KSkK KyAgICAgICAgZ290byBmb3VuZDsKKyAgICB9CisgIGlmIChsbjIgPiBpeDEpCisgICAgeworICAg ICAgYm0gPSBtY19udGggKGl4MSwgYm0yKTsKKyAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAg ICAgIGdvdG8gZm91bmQ7CisgICAgICByZXR1cm4gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICB9 CisgICAgZWxzZSBpZiAoKGJtID0gYm0yLCBOSUxQIChibSkpKQorICAgICAgcmV0dXJuIE1DX05P X0ZSSU5HRV9CSVRNQVA7CisgIGZvdW5kOgorICByZXR1cm4gbG9va3VwX2ZyaW5nZV9iaXRtYXAg KGJtKTsKK30KKworc3RhdGljIGludAorbWNfZ2V0X2xvZ2ljYWxfY3Vyc29yX2JpdG1hcCAoc3Ry dWN0IHdpbmRvdyAqdywgTGlzcF9PYmplY3QgY3Vyc29yKQoreworICBMaXNwX09iamVjdCBjbWFw LCBibSA9IFFuaWw7CisgIGlmICgoY21hcCA9IEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg ZnJpbmdlX2N1cnNvcl9hbGlzdCkpLCAhTklMUCAoY21hcCkpCisgICAgeworICAgICAgYm0gPSBt Y19hc3NxIChjdXJzb3IsIGNtYXApOworICAgICAgaWYgKENPTlNQIChibSkpCisgICAgICAgIHsK KyAgICAgICAgICBpZiAoKGJtID0gWENEUiAoYm0pKSwgTklMUCAoYm0pKQorICAgICAgICAgICAg cmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQV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aWdodCBwYXJ0aWFsLWxlZnQgcGFydGlhbC1yaWdodAorICBJZiBhbnkgdmFsdWUgaW4gbG9jYWwg YmluZGluZyBpcyBub3QgcHJlc2VudCBvciB0LCB1c2UgZ2xvYmFsIHZhbHVlLgorICAgICBJZiBw YXJ0aWFsLCBsb29rdXAgcGFydGlhbCBiaXRtYXAgaW4gZGVmYXVsdCB2YWx1ZSBpZiBub3QgZm91 bmQgaGVyZS4KKyAgICAgSWYgbm90IHBhcnRpYWwsIG9yIG5vIHBhcnRpYWwgc3BlYyBpcyBwcmVz ZW50LCB1c2Ugbm9uLXBhcnRpYWwgYml0bWFwLiAqLworICBpZiAoKGNtYXAgPSBCVkFSIChYQlVG RkVSICh3LT5jb250ZW50cyksIGZyaW5nZV9pbmRpY2F0b3JfYWxpc3QpKSwgIU5JTFAgKGNtYXAp KQorICAgIHsKKyAgICAgIGJtMSA9IG1jX2Fzc3EgKGJpdG1hcCwgY21hcCk7CisgICAgICBpZiAo Q09OU1AgKGJtMSkpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoKGJtMSA9IFhDRFIgKGJtMSkp LCBOSUxQIChibTEpKQorICAgICAgICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7Cisg ICAgICAgICAgaWYgKENPTlNQIChibTEpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBs bjEgPSBYRklYTlVNIChGbGVuZ3RoIChibTEpKTsKKyAgICAgICAgICAgICAgaWYgKHBhcnRpYWxf cCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBpZiAobG4xID4gaXgyKQor ICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgYm0gPSBtY19udGgg KGl4MiwgYm0xKTsKKyAgICAgICAgICAgICAgICAgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAg ICAgICAgICAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgfQor ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgICAgIGlmIChsbjEgPiBpeDEpCisgICAgICAgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0xKTsK KyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAgICAg ICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAoKGJtID0g Ym0xLCAhRVEgKGJtLCBRdCkpKQorICAgICAgICAgICAgICBnb3RvIGZvdW5kOworICAgICAgICB9 CisgICAgfQorICBpZiAoIUVRIChjbWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2Vf aW5kaWNhdG9yX2FsaXN0KSkKKyAgICAgICYmICFOSUxQIChCVkFSICgmYnVmZmVyX2RlZmF1bHRz LCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSkpCisgICAgeworICAgICAgYm0yID0gbWNfYXNzcSAo Yml0bWFwLCBCVkFSICgmYnVmZmVyX2RlZmF1bHRzLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSk7 CisgICAgICBpZiAoQ09OU1AgKGJtMikpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoKGJtMiA9 IFhDRFIgKGJtMikpLCAhTklMUCAoYm0yKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg aWYgKENPTlNQIChibTIpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGxu MiA9IFhGSVhOVU0gKEZsZW5ndGggKGJtMikpOworICAgICAgICAgICAgICAgICAgaWYgKHBhcnRp YWxfcCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGlmIChs bjIgPiBpeDIpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAg ICAgICAgIGJtID0gbWNfbnRoIChpeDIsIGJtMik7CisgICAgICAgICAgICAgICAgICAgICAgICAg IGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ290byBmb3Vu ZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgaWYgKGxu MSA+IGl4MSkKKyAgICB7CisgICAgICBibSA9IG1jX250aCAoaXgxLCBibTEpOworICAgICAgaWYg KCFFUSAoYm0sIFF0KSkKKyAgICAgICAgZ290byBmb3VuZDsKKyAgICB9CisgIGlmIChsbjIgPiBp eDEpCisgICAgeworICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0yKTsKKyAgICAgIGlmICghRVEg KGJtLCBRdCkpCisgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICByZXR1cm4gTUNfTk9fRlJJTkdF X0JJVE1BUDsKKyAgICB9CisgICAgZWxzZSBpZiAoKGJtID0gYm0yLCBOSUxQIChibSkpKQorICAg ICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgIGZvdW5kOgorICByZXR1cm4gbG9va3Vw X2ZyaW5nZV9iaXRtYXAgKGJtKTsKK30KKworLyogUmVjYWxjdWxhdGUgdGhlIGJpdG1hcHMgdG8g c2hvdyBpbiB0aGUgZnJpbmdlcyBvZiB3aW5kb3cgVy4KKyAgIE9ubHkgbWFyayByb3dzIHdpdGgg bW9kaWZpZWQgYml0bWFwcyBmb3IgdXBkYXRlIGluIHJlZHJhd19mcmluZ2VfYml0bWFwc19wLgor ICAgSWYgS0VFUF9DVVJSRU5UX1AgaXMgMCwgdXBkYXRlIGN1cnJlbnRfbWF0cml4IHRvby4g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g9IDApLCBib3Rfcm93X2VuZHNfYXRfenZfcCBNQ19JRl9MSU5UICg9IDApOworICBp ZiAody0+cHNldWRvX3dpbmRvd19wKQorICAgIHJldHVybiAwOworICBpZiAoIU1JTklfV0lORE9X X1AgKHcpCisgICAgICAmJiAoaW5kID0gQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBpbmRp Y2F0ZV9idWZmZXJfYm91bmRhcmllcyksICFOSUxQIChpbmQpKSkKKyAgICB7CisgICAgICBpZiAo RVEgKGluZCwgUWxlZnQpIHx8IEVRIChpbmQsIFFyaWdodCkpCisgICAgICAgIGJvdW5kYXJ5X3Rv cCA9IGJvdW5kYXJ5X2JvdCA9IGFycm93X3RvcCA9IGFycm93X2JvdCA9IGluZDsKKyAgICAgICAg ZWxzZSBpZiAoQ09OU1AgKGluZCkKKyAgICAgICAgICAgICAgICAgJiYgQ09OU1AgKFhDQVIgKGlu ZCkpKQorICAgICAgICB7CisgICAgICAgICAgTGlzcF9PYmplY3QgcG9zOworICAgICAgICAgIGlm IChwb3MgPSBtY19hc3NxIChRdCwgaW5kKSwgIU5JTFAgKHBvcykpCisgICAgICAgICAgICBib3Vu ZGFyeV90b3AgPSBib3VuZGFyeV9ib3QgPSBhcnJvd190b3AgPSBhcnJvd19ib3QgPSBYQ0RSIChw b3MpOworICAgICAgICAgIGlmIChwb3MgPSBtY19hc3NxIChRdG9wLCBpbmQpLCAhTklMUCAocG9z KSkKKyAgICAgICAgICAgIGJvdW5kYXJ5X3RvcCA9IFhDRFIgKHBvcyk7CisgICAgICAgICAgaWYg KHBvcyA9IG1jX2Fzc3EgKFFib3R0b20sIGluZCksICFOSUxQIChwb3MpKQorICAgICAgICAgICAg Ym91bmRhcnlfYm90ID0gWENEUiAocG9zKTsKKyAgICAgICAgICBpZiAocG9zID0gbWNfYXNzcSAo UXVwLCBpbmQpLCAhTklMUCAocG9zKSkKKyAgICAgICAgICAgIGFycm93X3RvcCA9IFhDRFIgKHBv cyk7CisgICAgICAgICAgaWYgKHBvcyA9IG1jX2Fzc3EgKFFkb3duLCBpbmQpLCAhTklMUCAocG9z KSkKKyAgICAgICAgICAgIGFycm93X2JvdCA9IFhDRFIgKHBvcyk7CisgICAgICAgIH0KKyAgICAg ICAgZWxzZQorICAgICAgICAgIC8qIEFueXRoaW5nIGVsc2UgbWVhbnMgYm91bmRhcnkgb24gbGVm dCBhbmQgbm8gYXJyb3dzLiAqLworICAgICAgICAgIGJvdW5kYXJ5X3RvcCA9IGJvdW5kYXJ5X2Jv dCA9IFFsZWZ0OworICAgIH0KKyAgdG9wX2luZF9ybiA9IGJvdF9pbmRfcm4gPSAtMTsKKyAgaWYg KCFOSUxQIChpbmQpKQorICAgIHsKKyAgICAgIGZvciAoeSA9IHctPnZzY3JvbGwsIHJuID0gMDsK KyAgICAgICAgICAgeSA8IHliICYmIHJuIDwgbnJvd3M7CisgICAgICAgICAgIHkgKz0gcm93LT5o ZWlnaHQsICsrcm4pCisgICAgICAgIHsKKyAgICAgICAgICByb3cgPSB3LT5kZXNpcmVkX21hdHJp eC0+cm93cyArIHJuOworICAgICAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgICAgICAg ICByb3cgPSB3LT5jdXJyZW50X21hdHJpeC0+cm93cyArIHJuOworICAgICAgICAgIHJvdy0+aW5k aWNhdGVfYm9iX3AgPSByb3ctPmluZGljYXRlX3RvcF9saW5lX3AgPSAwOworICAgICAgICAgIHJv dy0+aW5kaWNhdGVfZW9iX3AgPSByb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3AgPSAwOworICAg ICAgICAgIGlmICghcm93LT5tb2RlX2xpbmVfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgaWYgKHRvcF9pbmRfcm4gPCAwICYmIHJvdy0+dmlzaWJsZV9oZWlnaHQgPiAwKQorICAgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGlmIChNQVRSSVhfUk9XX1NUQVJUX0NIQVJQ T1MgKHJvdykgPD0gQlVGX0JFR1YgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSkKKyAgICAgICAgICAg ICAgICAgICAgICAmJiAhTUFUUklYX1JPV19QQVJUSUFMTFlfVklTSUJMRV9BVF9UT1BfUCAodywg cm93KSkKKyAgICAgICAgICAgICAgICAgICAgcm93LT5pbmRpY2F0ZV9ib2JfcCA9ICFOSUxQIChi b3VuZGFyeV90b3ApOworICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAg ICAgICAgcm93LT5pbmRpY2F0ZV90b3BfbGluZV9wID0gIU5JTFAgKGFycm93X3RvcCk7CisgICAg ICAgICAgICAgICAgICB0b3BfaW5kX3JuID0gcm47CisgICAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgICBpZiAoYm90X2luZF9ybiA8IDApCisgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgaWYgKE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgPj0gQlVGX1pWIChYQlVG RkVSICh3LT5jb250ZW50cykpCisgICAgICAgICAgICAgICAgICAgICAgJiYgIU1BVFJJWF9ST1df UEFSVElBTExZX1ZJU0lCTEVfQVRfQk9UVE9NX1AgKHcsIHJvdykpCisgICAgICAgICAgICAgICAg ICAgIHJvdy0+aW5kaWNhdGVfZW9iX3AgPSAhTklMUCAoYm91bmRhcnlfYm90KSwgYm90X2luZF9y biA9IHJuOworICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICh5ICsgcm93LT5oZWlnaHQgPj0g eWIpCisgICAgICAgICAgICAgICAgICAgICAgcm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wID0g IU5JTFAgKGFycm93X2JvdCksIGJvdF9pbmRfcm4gPSBybjsKKyAgICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIGVtcHR5X3BvcyA9IEJWQVIgKFhCVUZG RVIgKHctPmNvbnRlbnRzKSwgaW5kaWNhdGVfZW1wd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IGl0IGRvZXNuJ3QgZml0 IGluIG9uZSByb3cuICovCisgIHRvcF9pbmRfbWluX3kgPSBib3RfaW5kX21heF95ID0gLTE7Cisg IGlmICh0b3BfaW5kX3JuID49IDApCisgICAgeworICAgICAgaW50IGJuID0gTUNfTk9fRlJJTkdF X0JJVE1BUDsKKyAgICAgIHJvdyA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgdG9wX2luZF9y bjsKKyAgICAgIGlmICghcm93LT5lbmFibGVkX3ApCisgICAgICAgIHJvdyA9IHctPmN1cnJlbnRf bWF0cml4LT5yb3dzICsgdG9wX2luZF9ybjsKKyAgICAgIHRvcF9yb3dfZW5kc19hdF96dl9wID0g cm93LT5lbmRzX2F0X3p2X3A7CisgICAgICBpZiAocm93LT5pbmRpY2F0ZV9ib2JfcCkKKyAgICAg ICAgeworICAgICAgICAgIGlmIChFUSAoYm91bmRhcnlfdG9wLCBRbGVmdCkpCisgICAgICAgICAg ICBibiA9ICgocm93LT5pbmRpY2F0ZV9lb2JfcCAmJiBFUSAoYm91bmRhcnlfYm90LCBRbGVmdCkp CisgICAgICAgICAgICAgICAgICA/IE1DX0xFRlRfRlJJTkdFICgxLCBRdG9wX2JvdHRvbSwgcm93 LT5lbmRzX2F0X3p2X3ApCisgICAgICAgICAgICAgICAgICA6IE1DX0xFRlRfRlJJTkdFICgyLCBR dG9wLCAwKSk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGJuID0gKChyb3ctPmlu ZGljYXRlX2VvYl9wICYmIEVRIChib3VuZGFyeV9ib3QsIFFyaWdodCkpCisgICAgICAgICAgICAg ICAgICAgID8gTUNfUklHSFRfRlJJTkdFICgxLCBRdG9wX2JvdHRvbSwgcm93LT5lbmRzX2F0X3p2 X3ApCisgICAgICAgICAgICAgICAgICAgIDogTUNfUklHSFRfRlJJTkdFICgyLCBRdG9wLCAwKSk7 CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV90b3BfbGluZV9wKQor ICAgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChFUSAoYXJyb3dfdG9wLCBRbGVmdCkpCisgICAg ICAgICAgICAgIGJuID0gTUNfTEVGVF9GUklOR0UgKDYsIFF1cCwgMCk7CisgICAgICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgICAgICBibiA9IE1DX1JJR0hUX0ZSSU5HRSAoNiwgUXVwLCAwKTsK KyAgICAgICAgICB9CisgICAgICBpZiAoYm4gIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAg ICAgeworICAgICAgICAgIHN0cnVjdCBmcmluZ2VfYml0bWFwICpmYiA9IGdldF9mcmluZ2VfYml0 bWFwX2RhdGEgKGJuKTsKKyAgICAgICAgICBpZiAoZmItPmFsaWduID09IEFMSUdOX0JJVE1BUF9U T1AgJiYgZmItPnBlcmlvZCA9PSAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzdHJ1 Y3QgZ2x5cGhfcm93ICpyb3cxOworICAgICAgICAgICAgICBpbnQgdG9wX2luZF9tYXhfeTsKKyAg ICAgICAgICAgICAgdG9wX2luZF9taW5feSA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcp OworICAgICAgICAgICAgICB0b3BfaW5kX21heF95ID0gdG9wX2luZF9taW5feSArIGZiLT5oZWln aHQ7CisgICAgICAgICAgICAgIGlmICh0b3BfaW5kX21heF95ID4geWIpCisgICAgICAgICAgICAg ICAgdG9wX2luZF9tYXhfeSA9IHliOworICAgICAgICAgICAgICBmb3IgKHkgPSByb3ctPnkgKyBy b3ctPmhlaWdodCwgcm4gPSB0b3BfaW5kX3JuICsgMTsKKyAgICAgICAgICAgICAgICAgICB5IDwg dG9wX2luZF9tYXhfeSAmJiBybiA8IG5yb3dzOworICAgICAgICAgICAgICAgICAgIHkgKz0gcm93 MS0+aGVpZ2h0LCBybisrKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGlm IChib3RfaW5kX3JuID49IDAgJiYgcm4gPj0gYm90X2luZF9ybikKKyAgICAgICAgICAgICAgICAg ICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICByb3cxID0gdy0+ZGVzaXJlZF9tYXRyaXgtPnJv d3MgKyBybjsKKyAgICAgICAgICAgICAgICAgIGlmICghcm93MS0+ZW5hYmxlZF9wKQorICAgICAg ICAgICAgICAgICAgICByb3cxID0gdy0+Y3VycmVudF9tYXRyaXgtPnJvd3MgKyBybjsKKyAgICAg ICAgICAgICAgICAgIHJvdzEtPmluZGljYXRlX2JvYl9wID0gcm93LT5pbmRpY2F0ZV9ib2JfcDsK KyAgICAgICAgICAgICAgICAgIHJvdzEtPmluZGljYXRlX3RvcF9saW5lX3AgPSByb3ctPmluZGlj YXRlX3RvcF9saW5lX3A7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAg ICB9CisgICAgfQorICBpZiAoYm90X2luZF9ybiA+PSAwKQorICAgIHsKKyAgICAgIGludCBibiA9 IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICByb3cgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93 cyArIGJvdF9pbmRfcm47CisgICAgICBpZiAoIXJvdy0+ZW5hYmxlZF9wKQorICAgICAgICByb3cg PSB3LT5jdXJyZW50X21hdHJpeC0+cm93cyArIGJvdF9pbmRfcm47CisgICAgICBib3Rfcm93X2Vu ZHNfYXRfenZfcCA9IHJvdy0+ZW5kc19hdF96dl9wOworICAgICAgaWYgKHJvdy0+aW5kaWNhdGVf ZW9iX3ApCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoRVEgKGJvdW5kYXJ5X2JvdCwgUWxlZnQp KQorICAgICAgICAgICAgYm4gPSBNQ19MRUZUX0ZSSU5HRSAoMywgUWJvdHRvbSwgcm93LT5lbmRz X2F0X3p2X3ApOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBibiA9IE1DX1JJR0hU X0ZSSU5HRSAoMywgUWJvdHRvbSwgcm93LT5lbmRzX2F0X3p2X3ApOworICAgICAgICB9CisgICAg ICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfYm90dG9tX2xpbmVfcCkKKyAgICAgICAgICB7Cisg ICAgICAgICAgICBpZiAoRVEgKGFycm93X2JvdCwgUWxlZnQpKQorICAgICAgICAgICAgICBibiA9 IE1DX0xFRlRfRlJJTkdFICg3LCBRZG93biwgMCk7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAg ICAgICAgICAgICBibiA9IE1DX1JJR0hUX0ZSSU5HRSAoNywgUWRvd24sIDApOworICAgICAgICAg IH0KKyAgICAgIGlmIChibiAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICB7CisgICAg ICAgICAgc3RydWN0IGZyaW5nZV9iaXRtYXAgKmZiID0gZ2V0X2ZyaW5nZV9iaXRtYXBfZGF0YSAo Ym4pOworICAgICAgICAgIGlmIChmYi0+YWxpZ24gPT0gQUxJR05fQklUTUFQX0JPVFRPTSAmJiBm Yi0+cGVyaW9kID09IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHN0cnVjdCBnbHlw aF9yb3cgKnJvdzE7CisgICAgICAgICAgICAgIGludCBib3RfaW5kX21pbl95OworICAgICAgICAg ICAgICBib3RfaW5kX21heF95ID0gcm93LT55ICsgcm93LT52aXNpYmxlX2hlaWdodDsKKyAgICAg ICAgICAgICAgYm90X2luZF9taW5feSA9IGJvdF9pbmRfbWF4X3kgLSBmYi0+aGVpZ2h0OworICAg ICAgICAgICAgICBpZiAoYm90X2luZF9taW5feSA8IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQg KHcpKQorICAgICAgICAgICAgICAgIGJvdF9pbmRfbWluX3kgPSBXSU5ET1dfSEVBREVSX0xJTkVf SEVJR0hUICh3KTsKKyAgICAgICAgICAgICAgZm9yICh5ID0gcm93LT55LCBybiA9IGJvdF9pbmRf cm4gLSAxOworICAgICAgICAgICAgICAgICAgIHkgPj0gYm90X2luZF9taW5feSAmJiBybiA+PSAw OworICAgICAgICAgICAgICAgICAgIHkgLT0gcm93MS0+aGVpZ2h0LCBybi0tKQorICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGlmICh0b3BfaW5kX3JuID49IDAgJiYgcm4gPD0g dG9wX2luZF9ybikKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAg ICByb3cxID0gdy0+ZGVzaXJlZF9tYXRyaXgtPnJvd3MgKyBybjsKKyAgICAgICAgICAgICAgICAg IGlmICghcm93MS0+ZW5hYmxlZF9wKQorICAgICAgICAgICAgICAgICAgICByb3cxID0gdy0+Y3Vy cmVudF9tYXRyaXgtPnJvd3MgKyBybjsKKyAgICAgICAgICAgICAgICAgIHJvdzEtPmluZGljYXRl X2VvYl9wID0gcm93LT5pbmRpY2F0ZV9lb2JfcDsKKyAgICAgICAgICAgICAgICAgIHJvdzEtPmlu ZGljYXRlX2JvdHRvbV9saW5lX3AgPSByb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3A7CisgICAg ICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICBib29sIGF1 dG9faHNjcm9sbF9tb2RlX3AgPSBFUSAoRmJ1ZmZlcl9sb2NhbF92YWx1ZSAoUWF1dG9faHNjcm9s bF9tb2RlLCB3LT5jb250ZW50cyksIFFjdXJyZW50X2xpbmUpOworICAvKiBFWEFNUExFOiAgKHNj cm9sbC1sZWZ0IDUpICovCisgIGJvb2wgaHNjbF9hbGxfdGVtcF9wID0gKHctPnN1c3BlbmRfYXV0 b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2Rl X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gMCk7CisgIC8qIEVYQU1QTEU6 ICBDLXUgQy14IDwgYW5kIGRvIG5vdGhpbmcuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8wX3Ag PSAody0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+ aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9s bCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSB3 LT5oc2Nyb2xsKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBhbmQgZG8gc29tZXRoaW5nIGVs c2UgYmVzaWRlcyBob3Jpem9udGFsbHkgc2Nyb2xsaW5nIHRoZQorICAgICAgICAgICAgICAgY3Vy cmVudCBsaW5lIGRpZmZlcmVudGx5LgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIGlzIF9u b3RfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4gKi8KKyAgYm9vbCBoc2NsX2Fs bF9wZXJtXzFfcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5f aHNjcm9sbCA9PSB3LT5oc2Nyb2xsKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBhbmQgLi4u CisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgaXMgX25vdF8gaG9yaXpvbnRhbGx5IHNjcm9s bGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMl9wID0gKCF3LT5zdXNw ZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNj cm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID09 IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCAhPSB3LT5oc2Nyb2xs KTsKKyAgLyogRVhBTVBMRTogIChzY3JvbGwtbGVmdCA1KTsgYW5kLCB0aGVuIHByZXNzIHRoZSBs ZWZ0IGFycm93IGtleSBvbmUgdGltZS4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBfaXNf IGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4qLworICBib29sIGhzY2xfdGVtcF9w ID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICYmIGF1 dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4g MAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IDApOworICAvKiBF WEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBzb21ldGhpbmcgdGhhdCBjYXVzZXMgdGhlIGN1cnJl bnQgbGluZSB0byBiZQorICAgICAgICAgICAgICAgaG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZl cmVudGx5LgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIF9pc18gaG9yaXpvbnRhbGx5IHNj cm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfcGVybV9wID0gKCF3LT5zdXNwZW5k X2F1dG9faHNj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21hdHJpeC52cG9zW3Zu dGhfY21dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmcuYmx1ZX07CisgICAgICBib29sIGFjdGl2 ZV9wID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF9jbV0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5h Y3RpdmVfcDsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IHctPm1jX21hdHJp eC52cG9zW3ZudGhfY21dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGhfZmxhdm9yOworICAg ICAgYm9vbCBlbmFibGVkX3AgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoX2NtXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhdLmVuYWJsZWRfcDsKKyAgICAgIGlmICgodnBvcyA9PSB2bnRoX2RtIHx8IHZw b3MgPT0gdm50aF9jbSkKKyAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgPT0gTUNfT1ZFUkxBWV9B UlJPV19CSVRNQVAKKyAgICAgICAgICAmJiAhaHNjbF9hbGxfdGVtcF9wCisgICAgICAgICAgJiYg IWhzY2xfdGVtcF9wCisgICAgICAgICAgJiYgIWhzY2xfcGVybV9wCisgICAgICAgICAgJiYgIWhz Y2xfYWxsX3Blcm1fMF9wCisgICAgICAgICAgJiYgIWhzY2xfYWxsX3Blcm1fMV9wCisgICAgICAg ICAgJiYgIWhzY2xfYWxsX3Blcm1fMl9wCisgICAgICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAg ICB7CisgICAgICAgICAgaW50IGZyaW5nZV9iaXRtYXAgPSBNQ19OT19GUklOR0VfQklUTUFQOwor ICAgICAgICAgIGVudW0gZmFjZV9pZCBvdmVybGF5X2Fycm93X2ZhY2VfaWQgPQorICAgICAgICAg ICAgKCFhY3RpdmVfcAorICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgICAgID8gbG9va3VwX2Rl cml2ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWluYWN0aXZlLXByZS16 di1mYWNlIiksIEZSSU5HRV9GQUNFX0lELCB0cnVlKQorICAgICAgICAgICAgOiAoYWN0aXZlX3Ap CisgICAgICAgICAgICAgID8gbG9va3VwX2Rlcml2ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1v dmVybGF5LWFycm93LXByZS16di1mYWNlIiksIEZSSU5HRV9GQUNFX0lELCB0cnVlKQorICAgICAg ICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgbWNfbGVmdF9mcmluZ2VfZmFjZV9p ZCA9IChjdXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IG92ZXJsYXlfYXJyb3dfZmFjZV9pZAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAg aWYgKHctPmhzY3JvbGwgIT0gMCkKKyAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRf ZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1vdmVybGF5LWFycm93IiksIGZhbHNlLCB0cnVl KTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dl dF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ciKSwgdHJ1ZSwgdHJ1 ZSk7CisgICAgICAgICAgbWNfbGVmdF9mcmluZ2VfYml0bWFwID0gKGN1cnNvcl90eXBlID09IE1D X0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBmcmluZ2VfYml0bWFwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNf Tk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmICgodnBvcyA9PSB2 bnRoX2RtIHx8IHZwb3MgPT0gdm50aF9jbSkKKyAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxh dm9yID09IE1DX09WRVJMQVlfQVJST1dfQklUTUFQCisgICAgICAgICAgICAgICAgICYmIChoc2Ns X2FsbF90ZW1wX3AKKyAgICAgICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxsX3Blcm1fMF9wCisg ICAgICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzFfcAorICAgICAgICAgICAgICAg ICAgICAgfHwgaHNjbF9hbGxfcGVybV8yX3AKKyAgICAgICAgICAgICAgICAgICAgIHx8IGhzY2xf dGVtcF9wCisgICAgICAgICAgICAgICAgICAgICB8fCBoc2NsX3Blcm1fcCkKKyAgICAgICAgICAg ICAgICAgJiYgZW5hYmxlZF9wKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGludCBmcmluZ2Vf Yml0bWFwID0gTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgICAgIGVudW0gZmFjZV9pZCBv dmVybGF5X2Fycm93X2ZhY2VfaWQgPQorICAgICAgICAgICAgICAoIWFjdGl2ZV9wCisgICAgICAg ICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjaF9pbmFjdGl2 ZV93aW5kb3dzKSkpCisgICAgICAgICAgICAgID8gbG9va3VwX2Rlcml2ZWRfZmFjZSAodywgZiwg aW50ZXJuICgiKy1vdmVybGF5LWFycm93LWhzY2wtaW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwgRlJJ TkdFX0ZBQ0VfSUQsIHRydWUpCisgICAgICAgICAgICAgIDogKGFjdGl2ZV9wKQorICAgICAgICAg ICAgICAgID8gbG9va3VwX2Rlcml2ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFy cm93LWhzY2wtcHJlLXp2LWZhY2UiKSwgRlJJTkdFX0ZBQ0VfSUQsIHRydWUpCisgICAgICAgICAg ICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAgICAgbWNfbGVmdF9mcmluZ2VfZmFjZV9p ZCA9IChjdXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gb3ZlcmxheV9hcnJvd19mYWNlX2lkCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAg ICAgICAgaWYgKGhzY2xfYWxsX3Blcm1fMF9wKQorICAgICAgICAgICAgICBmcmluZ2VfYml0bWFw ID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC1wZXJtIiksIGZhbHNl LCBmYWxzZSk7CisgICAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xfYWxsX3Blcm1fMV9wKQorICAg ICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50 ZXJuICgiKy1oc2NsLXBlcm0iKSwgdHJ1ZSwgZmFsc2UpOworICAgICAgICAgICAgICAgIGVsc2Ug aWYgKGhzY2xfYWxsX3Blcm1fMl9wKQorICAgICAgICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9 IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCBmYWxzZSwg dHJ1ZSk7CisgICAgICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX3Blcm1fcCkKKyAgICAgICAg ICAgICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRl cm4gKCIrLWhzY2wtcGVybSIpLCB0cnVlLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgZWxz ZSBpZiAoaHNjbF9hbGxfdGVtcF9wKQorICAgICAgICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRt YXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXRlbXAiKSwgZmFs c2UsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX3RlbXBfcCkK KyAgICAgICAgICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2Jp dG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXRlbXAiKSwgdHJ1ZSwgZmFsc2UpOworICAgICAgICAg ICAgbWNfbGVmdF9mcmluZ2VfYml0bWFwID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdF X0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGZyaW5nZV9i aXRtYXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX05PX0ZSSU5H RV9CSVRNQVA7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKCh2cG9zID09IHZudGhf ZG0gfHwgdnBvcyA9PSB2bnRoX2NtKQorICAgICAgICAgICAgICAgICAgICAmJiAoZ2x5cGhfZmxh dm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAg ICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJ R0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNf SE9MTE9XX1JFQ1RBTkdMRQorICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9y ID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAg fHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVwor ICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JB UgorICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VE X1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09 IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gpCisgICAgICAgICAgICAgICAgICAgICYmIGVuYWJs ZWRfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgTGlzcF9PYmplY3QgYml0bWFwX2Zs YXZvciA9IChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVykK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hvbGxvd19y ZWN0YW5nbGVfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJ R0hUX0FSUk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IFFtY19yZXZlcnNlZF9ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9X X1JFQ1RBTkdMRSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBRbWNfaG9sbG93X3JlY3RhbmdsZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVykK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGlj YWxfYmFyX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FS Uk9XKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19y ZXZlcnNlZF92ZXJ0aWNhbF9iYXJfcmlnaHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2Fs X2JhcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhf Zmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxfYmFyCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0g TUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyX2JhY2tzbGFzaAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBRbmlsOworICAgICAgICAgICAgICBtY19y aWdodF9mcmluZ2VfYml0bWFwID0gKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRN QVApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBsb29rdXBfZnJp bmdlX2JpdG1hcCAoYml0bWFwX2ZsYXZvcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgICAgICAgIG1jX3JpZ2h0 X2ZyaW5nZV9mYWNlX2lkID0KKyAgICAgICAgICAgICAgICAoY3Vyc29yX3R5cGUgPT0gTUNfUklH SFRfRlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gPT0gUFJF X1pWCisgICAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9M TE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhf Zmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAg ICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikp CisgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9kZXJpdmVkX2ZhY2UgKHcsIGYsIGludGVybiAo IistcmV2ZXJzZWQtYmFyLXByZS16di1mYWNlIiksIEZSSU5HRV9GQUNFX0lELCB0cnVlKQorICAg ICAgICAgICAgICAgIDogKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAg ICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gPT0gQVRfWlYKKyAgICAgICAgICAgICAg ICAgICAmJiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklH SFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JF VkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICB8 fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKSkKKyAgICAgICAgICAg ICAgICAgID8gbG9va3VwX2Rlcml2ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZXZlcnNlZC1i YXItYXQtenYtZmFjZSIpLCBGUklOR0VfRkFDRV9JRCwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6 IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAg ICAgJiYgcm93X3Bvc2l0aW9uID09IFBPU1RfWlYKKyAgICAgICAgICAgICAgICAgICAmJiAoZ2x5 cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAg ICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJ Q0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2 b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKSkKKyAgICAgICAgICAgICAgICAgID8gbG9v a3VwX2Rlcml2ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZXZlcnNlZC1iYXItcG9zdC16di1m YWNlIiksIEZSSU5HRV9GQUNFX0lELCB0cnVlKQorICAgICAgICAgICAgICAgIDogKGN1cnNvcl90 eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgICAmJiByb3df cG9zaXRpb24gPT0gUFJFX1pWCisgICAgICAgICAgICAgICAg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gICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JF VkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAm JiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisg ICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX1ZFUlRJQ0FM X0JBUikKKyAgICAgICAgICAgICAgICAgID8gbG9va3VwX2Rlcml2ZWRfZmFjZSAodywgZiwgaW50 ZXJuICgiKy1iYXItcG9zdC16di1mYWNlIiksIEZSSU5HRV9GQUNFX0lELCB0cnVlKQorICAgICAg ICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAgICAgfQorICAgICAgICB9Cisg ICAgICBpZiAoIXJvdy0+ZW5hYmxlZF9wKQorICAgICAgICByb3cgPSBjdXI7CisgICAgICBsZWZ0 X2ZhY2VfaWQgPSByaWdodF9mYWNlX2lkID0gREVGQVVMVF9GQUNFX0lEOworICAgICAgbGVmdF9v ZmZzZXQgPSByaWdodF9vZmZzZXQgPSAwOworICAgICAgcGVyaW9kaWNfcCA9IDA7CisgICAgICAv KiBEZWNpZGUgd2hpY2ggYml0bWFwIHRvIGRyYXcgaW4gdGhlIGxlZnQgZnJpbmdlLiAqLworICAg ICAgaWYgKFdJTkRPV19MRUZUX0ZSSU5HRV9XSURUSCAodykgPT0gMCkKKyAgICAgICAgbGVmdCA9 IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICBlbHNlIGlmIChyb3ctPmxlZnRfdXNlcl9mcmlu Z2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgICAgIHsKKyAgICAgICAgICBs ZWZ0ID0gcm93LT5sZWZ0X3VzZXJfZnJpbmdlX2JpdG1hcDsKKyAgICAgICAgICBsZWZ0X2ZhY2Vf aWQgPSByb3ctPmxlZnRfdXNlcl9mcmluZ2VfZmFjZV9pZDsKKyAgICAgICAgfQorICAgICAgZWxz ZSBpZiAoKCFyb3ctPnJldmVyc2VkX3AgJiYgcm93LT50cnVuY2F0ZWRfb25fbGVmdF9wKQorICAg ICAgICAgICAgICAgfHwgKHJvdy0+cmV2ZXJzZWRfcCAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdo dF9wKSkKKyAgICAgICAgbGVmdCA9IE1DX0xFRlRfRlJJTkdFICgwLCBRdHJ1bmNhdGlvbiwgMCk7 CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2JvYl9wICYmIEVRIChib3VuZGFyeV90b3As IFFsZWZ0KSkKKyAgICAgICAgeworICAgICAgICAgIGxlZnQgPSAoKHJvdy0+aW5kaWNhdGVfZW9i X3AgJiYgRVEgKGJvdW5kYXJ5X2JvdCwgUWxlZnQpKQorICAgICAgICAgICAgICAgICA/IE1DX0xF RlRfRlJJTkdFICgxLCBRdG9wX2JvdHRvbSwgdG9wX3Jvd19lbmRzX2F0X3p2X3ApCisgICAgICAg ICAgICAgICAgIDogTUNfTEVGVF9GUklOR0UgKDIsIFF0b3AsIDApKTsKKyAgICAgICAgICBpZiAo dG9wX2luZF9taW5feSA+PSAwKQorICAgICAgICAgICAgbGVmdF9vZmZzZXQgPSB0b3BfaW5kX21p bl95IC0gcm93LT55OworICAgICAgICB9CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2Vv Yl9wICYmIEVRIChib3VuZGFyeV9ib3QsIFFsZWZ0KSkKKyAgICAgICAgeworICAgICAgICAgIGxl ZnQgPSBNQ19MRUZUX0ZSSU5HRSAoMywgUWJvdHRvbSwgYm90X3Jvd19lbmRzX2F0X3p2X3ApOwor ICAgICAgICAgIGlmIChib3RfaW5kX21heF95ID49IDApCisgICAgICAgICAgICBsZWZ0X29mZnNl dCA9IGJvdF9pbmRfbWF4X3kgLSAocm93LT55ICsgcm93LT52aXNpYmxlX2hlaWdodCk7CisgICAg ICAgIH0KKyAgICAgIGVsc2UgaWYgKCghcm93LT5yZXZlcnNlZF9wICYmIE1BVFJJWF9ST1dfQ09O VElOVUFUSU9OX0xJTkVfUCAocm93KSkKKyAgICAgICAgICAgICAgIHx8IChyb3ctPnJldmVyc2Vk X3AgJiYgcm93LT5jb250aW51ZWRfcCkpCisgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAo NCwgUWNvbnRpbnVhdGlvbiwgMCk7CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2VtcHR5 X2xpbmVfcCAmJiBFUSAoZW1wdHlfcG9zLCBRbGVmdCkpCisgICAgICAgIGxlZnQgPSBNQ19MRUZU X0ZSSU5HRSAoNSwgUWVtcHR5X2xpbmUsIDApOworICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0 ZV90b3BfbGluZV9wICYmIEVRIChhcnJvd190b3AsIFFsZWZ0KSkKKyAgICAgICAgeworICAgICAg ICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAoNiwgUXVwLCAwKTsKKyAgICAgICAgICBpZiAodG9w X2luZF9taW5feSA+PSAwKQorICAgICAgICAgICAgbGVmdF9vZmZzZXQgPSB0b3BfaW5kX21pbl95 IC0gcm93LT55OworICAgICAgICB9CisgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2JvdHRv bV9saW5lX3AgJiYgRVEgKGFycm93X2JvdCwgUWxlZnQpKQorICAgICAgICB7CisgICAgICAgICAg bGVmdCA9IE1DX0xFRlRfRlJJTkdFICg3LCBRZG93biwgMCk7CisgICAgICAgICAgaWYgKGJvdF9p bmRfbWF4X3kgPj0gMCkKKyAgICAgICAgICAgIGxlZnRfb2Zmc2V0ID0gYm90X2luZF9tYXhfeSAt IChyb3ctPnkgKyByb3ctPnZpc2libGVfaGVpZ2h0KTsKKyAgICAgICAgfQorICAgICAgZWxzZQor ICAgICAgICBsZWZ0ID0gTUNfTk9fRlJJTkdFX0J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F9taW5feSA+PSAwKQorICAgICAgICAgICAgcmlnaHRfb2Zmc2V0ID0gdG9wX2luZF9taW5feSAt IHJvdy0+eTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9lb2JfcCAm JiBFUSAoYm91bmRhcnlfYm90LCBRcmlnaHQpKQorICAgICAgICB7CisgICAgICAgICAgcmlnaHQg PSBNQ19SSUdIVF9GUklOR0UgKDMsIFFib3R0b20sIGJvdF9yb3dfZW5kc19hdF96dl9wKTsKKyAg ICAgICAgICBpZiAoYm90X2luZF9tYXhfeSA+PSAwKQorICAgICAgICAgICAgcmlnaHRfb2Zmc2V0 ID0gYm90X2luZF9tYXhfeSAtIChyb3ctPnkgKyByb3ctPnZpc2libGVfaGVpZ2h0KTsKKyAgICAg ICAgfQorICAgICAgZWxzZSBpZiAoKCFyb3ctPnJldmVyc2VkX3AgJiYgcm93LT5jb250aW51ZWRf cCkKKyAgICAgICAgICAgICAgIHx8IChyb3ctPnJldmVyc2VkX3AgJiYgTUFUUklYX1JPV19DT05U SU5VQVRJT05fTElORV9QIChyb3cpKSkKKyAgICAgICAgcmlnaHQgPSBNQ19SSUdIVF9GUklOR0Ug KDQsIFFjb250aW51YXRpb24sIDApOworICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV90b3Bf bGluZV9wICYmIEVRIChhcnJvd190b3AsIFFyaWdodCkpCisgICAgICAgIHsKKyAgICAgICAgICBy aWdodCA9IE1DX1JJR0hUX0ZSSU5HRSAoNiwgUXVwLCAwKTsKKyAgICAgICAgICBpZiAodG9wX2lu ZF9taW5feSA+PSAwKQorICAgICAgICAgICAgcmlnaHRfb2Zmc2V0ID0gdG9wX2luZF9taW5feSAt IHJvdy0+eTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9ib3R0b21f bGluZV9wICYmIEVRIChhcnJvd19ib3QsIFFyaWdodCkpCisgICAgICAgIHsKKyAgICAgICAgICBy aWdodCA9IE1DX1JJR0hUX0ZSSU5HRSAoNywgUWRvd24sIDApOworICAgICAgICAgIGlmIChib3Rf aW5kX21heF95ID49IDApCisgICAgICAgICAgICByaWdodF9vZmZzZXQgPSBib3RfaW5kX21heF95 IC0gKHJvdy0+eSArIHJvdy0+dmlzaWJsZV9oZWlnaHQpOworICAgICAgICB9CisgICAgICBlbHNl IGlmIChyb3ctPmluZGljYXRlX2VtcHR5X2xpbmVfcCAmJiBFUSAoZW1wdHlfcG9zLCBRcmlnaHQp KQorICAgICAgICByaWdodCA9IE1DX1JJR0hUX0ZSSU5HRSAoNSwgUWVtcHR5X2xpbmUsIDApOwor ICAgICAgZWxzZQorICAgICAgICByaWdodCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICBw ZXJpb2RpY19wID0gKGdldF9mcmluZ2VfYml0bWFwX2RhdGEgKGxlZnQpLT5wZXJpb2QgIT0gMAor ICAgICAgICAgICAgICAgICAgICB8fCBnZXRfZnJpbmdlX2JpdG1hcF9kYXRhIChyaWdodCktPnBl cmlvZCAhPSAwKTsKKyAgICAgIGlmIChyb3ctPnkgIT0gY3VyLT55CisgICAgICAgICAgfHwgcm93 LT52aXNpYmxlX2hlaWdodCAhPSBjdXItPnZpc2libGVfaGVpZ2h0CisgICAgICAgICAgfHwgcm93 LT5lbmRzX2F0X3p2X3AgIT0gY3VyLT5lbmRzX2F0X3p2X3AKKyAgICAgICAgICB8fCBsZWZ0ICE9 IGN1ci0+bGVmdF9mcmluZ2VfYml0bWFwCisgICAgICAgICAgfHwgcmlnaHQgIT0gY3VyLT5yaWdo dF9mcmluZ2VfYml0bWFwCisgICAgICAgICAgfHwgbGVmdF9mYWNlX2lkICE9IGN1ci0+bGVmdF9m cmluZ2VfZmFjZV9pZAorICAgICAgICAgIHx8IHJpZ2h0X2ZhY2VfaWQgIT0gY3VyLT5yaWdodF9m cmluZ2VfZmFjZV9pZAorICAgICAgICAgIHx8IGxlZnRfb2Zmc2V0ICE9IGN1ci0+bGVmdF9mcmlu Z2Vfb2Zmc2V0CisgICAgICAgICAgfHwgcmlnaHRfb2Zmc2V0ICE9IGN1ci0+cmlnaHRfZnJpbmdl X29mZnNldAorICAgICAgICAgIHx8IHBlcmlvZGljX3AgIT0gY3VyLT5mcmluZ2VfYml0bWFwX3Bl cmlvZGljX3AKKyAgICAgICAgICB8fCBjdXItPnJlZHJhd19mcmluZ2VfYml0bWFwc19wKQorICAg ICAgICB7CisgICAgICAgICAgcmVkcmF3X3AgPSAxLCByb3ctPnJlZHJhd19mcmluZ2VfYml0bWFw c19wID0gMTsKKyAgICAgICAgICBpZiAoIWtlZXBfY3VycmVudF9wKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICBjdXItPnJlZHJhd19mcmluZ2VfYml0bWFwc19wID0gMTsKKyAgICAgICAg ICAgICAgaWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQCisg ICAgICAgICAgICAgICAgICB8fCBtY19yaWdodF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5H RV9CSVRNQVApCisgICAgICAgICAgICAgICAgY3VyLT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3Ag PSBmYWxzZTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPmZy aW5nZV9iaXRtYXBfcGVyaW9kaWNfcCA9IHBlcmlvZGljX3A7CisgICAgICAgICAgICAgIGlmICht Y19sZWZ0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAg ICAgICBjdXItPmxlZnRfZnJpbmdlX2JpdG1hcCA9IG1jX2xlZnRfZnJpbmdlX2JpdG1hcDsKKyAg ICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPmxlZnRfZnJpbmdlX2Jp dG1hcCA9IGxlZnQ7CisgICAgICAgICAgICAgIGlmIChtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgIT0g TUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICBjdXItPmxlZnRfZnJpbmdlX2Zh Y2VfaWQgPSBtY19sZWZ0X2ZyaW5nZV9mYWNlX2lkOworICAgICAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgICAgIGN1ci0+bGVmdF9mcmluZ2VfZmFjZV9pZCA9IGxlZnRfZmFjZV9pZDsK KyAgICAgICAgICAgICAgaWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0Vf QklUTUFQKQorICAgICAgICAgICAgICAgIGN1ci0+bGVmdF9mcmluZ2Vfb2Zmc2V0ID0gMDsKKyAg ICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjdXItPmxlZnRfZnJpbmdlX29m ZnNldCA9IGxlZnRfb2Zmc2V0OworICAgICAgICAgICAgICBpZiAobWNfcmlnaHRfZnJpbmdlX2Jp dG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgIGN1ci0+cmlnaHRf ZnJpbmdlX2JpdG1hcCA9IG1jX3JpZ2h0X2ZyaW5nZV9iaXRtYXA7CisgICAgICAgICAgICAgICAg ZWxzZQorICAgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2VfYml0bWFwID0gcmlnaHQ7 CisgICAgICAgICAgICAgIGlmIChtY19yaWdodF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5H RV9CSVRNQVApCisgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2VfZmFjZV9pZCA9IG1j X3JpZ2h0X2ZyaW5nZV9mYWNlX2lkOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX2ZhY2VfaWQgPSByaWdodF9mYWNlX2lkOworICAgICAg ICAgICAgICBpZiAobWNfcmlnaHRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQ KQorICAgICAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX29mZnNldCA9IDA7CisgICAgICAg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgY3VyLT5yaWdodF9mcmluZ2Vfb2Zmc2V0 ID0gcmlnaHRfb2Zmc2V0OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBpZiAocm93 LT5vdmVybGF5X2Fycm93X2JpdG1hcCA8IDApCisgICAgICAgIHJvdy0+b3ZlcmxheV9hcnJvd19i aXRtYXAgPSBtY19nZXRfbG9naWNhbF9mcmluZ2VfYml0bWFwICh3LCBRb3ZlcmxheV9hcnJvdywg MCwgMCk7CisgICAgICBpZiAocm93LT5vdmVybGF5X2Fycm93X2JpdG1hcCAhPSBjdXItPm92ZXJs YXlfYXJyb3dfYml0bWFwKQorICAgICAgICB7CisgICAgICAgICAgcmVkcmF3X3AgPSAxLCByb3ct PnJlZHJhd19mcmluZ2VfYml0bWFwc19wID0gMTsKKyAgICAgICAgICBpZiAoIWtlZXBfY3VycmVu dF9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBjdXItPnJlZHJhd19mcmluZ2VfYml0 bWFwc19wID0gMTsKKyAgICAgICAgICAgICAgY3VyLT5vdmVybGF5X2Fycm93X2JpdG1hcCA9IHJv dy0+b3ZlcmxheV9hcnJvd19iaXRtYXA7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAg IGlmIChtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUAorICAgICAg ICAgIHx8IG1jX3JpZ2h0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAg ICAgICAgcm93LT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3AgPSBmYWxzZTsKKyAgICAgICAgZWxz ZQorICAgICAgICAgIHJvdy0+ZnJpbmdlX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F9wYXJhbXMgcDsKKyAgc3RydWN0IGZyaW5nZV9iaXRtYXAgKmZiOworICBpbnQgcGVyaW9kOwor ICBpbnQgZmFjZV9pZCA9IERFRkFVTFRfRkFDRV9JRDsKKyAgaW50IG9mZnNldCwgaGVhZGVyX2xp bmVfaGVpZ2h0OworICBwLm92ZXJsYXlfcCA9IChvdmVybGF5ICYgMSkgPT0gMTsKKyAgcC5jdXJz b3JfcCA9IChvdmVybGF5ICYgMikgPT0gMjsKKyAgaWYgKHdoaWNoICE9IE1DX05PX0ZSSU5HRV9C SVRNQVApCisgICAgeworICAgICAgb2Zmc2V0ID0gMDsKKyAgICB9CisgICAgZWxzZSBpZiAobGVm dF9wKQorICAgICAgeworICAgICAgICB3aGljaCA9IHJvdy0+bGVmdF9mcmluZ2VfYml0bWFwOwor ICAgICAgICBmYWNlX2lkID0gcm93LT5sZWZ0X2ZyaW5nZV9mYWNlX2lkOworICAgICAgICBvZmZz ZXQgPSByb3ctPmxlZnRfZnJpbmdlX29mZnNldDsKKyAgICAgIH0KKyAgICAgIGVsc2UKKyAgICAg ICAgeworICAgICAgICAgIHdoaWNoID0gcm93LT5yaWdodF9mcmluZ2VfYml0bWFwOworICAgICAg ICAgIGZhY2VfaWQgPSByb3ctPnJpZ2h0X2ZyaW5nZV9mYWNlX2lkOworICAgICAgICAgIG9mZnNl dCA9IHJvdy0+cmlnaHRfZnJpbmdlX29mZnNldDsKKyAgICAgICAgfQorICBpZiAoZmFjZV9pZCA9 PSBERUZBVUxUX0ZBQ0VfSUQpCisgICAgeworICAgICAgTGlzcF9PYmplY3QgZmFjZSA9IGZyaW5n ZV9mYWNlc1t3aGljaF07CisgICAgICBmYWNlX2lkID0gTklMUCAoZmFjZSkgPyBsb29rdXBfbmFt ZWRfZmFjZSAodywgZiwgUWZyaW5nZSwgZmFsc2UpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBsb29rdXBfZGVyaXZlZF9mYWNlICh3LCBmLCBmYWNlLCBGUklOR0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2QgLT0gKCgh V0lORE9XX0xFRlRNT1NUX1AgKHcpCisgICAgICAgICAgICAvKiBUaGlzIGNvdWxkIGJlIHdyb25n IHdoZW4gd2UgYWxsb3cgd2luZG93IGxvY2FsCisgICAgICAgICAgICAgICByaWdodCBkaXZpZGVy cyAtIGJ1dCB0aGUgd2luZG93IG9uIHRoZSBsZWZ0IGlzIGhhcmQKKyAgICAgICAgICAgICAgIHRv IGdldC4gKi8KKyAgICAgICAgICAgICYmICFGUkFNRV9SSUdIVF9ESVZJREVSX1dJRFRIIChmKQor ICAgICAgICAgICAgJiYgIVdJTkRPV19IQVNfVkVSVElDQUxfU0NST0xMX0JBUiAodykKKyAgICAg ICAgICAgIC8qIEJ1dCBkb24ndCByZWR1Y2UgdGhlIGZyaW5nZSB3aWR0aCBpZiB0aGUgd2luZG93 CisgICAgICAgICAgICAgICBoYXMgYSBsZWZ0IG1hcmdpbiwgYmVjYXVzZSB0aGF0IG1lYW5zIHdl IGFyZSBub3QKKyAgICAgICAgICAgICAgIGluIGRhbmdlciBvZiBkcmF3aW5nIG92ZXIgdGhlIHZl cnRpY2FsIGJvcmRlciwKKyAgICAgICAgICAgICAgIGFuZCBPVE9IIGxlYXZpbmcgb3V0IHRoYXQg b25lIHBpeGVsIGxlYXZlcyBiZWhpbmQKKyAgICAgICAgICAgICAgIHRyYWNlcyBvZiB0aGUgY3Vy c29yLCBpZiBpdCB3YXMgaW4gY29sdW1uIHplcm8KKyAgICAgICAgICAgICAgIGJlZm9yZSBkcmF3 aW5nIG5vbi1lbXB0eSBtYXJnaW4gYXJlYS4gKi8KKyAgICAgICAgICAgICYmIHctPmxlZnRfbWFy Z2luX2NvbHMgPT0gMCkKKyAgICAgICAgICAgPyAxIDogMCk7CisgICAgICAgICAgcC5ieCA9IHgg LSB3ZDsKKyAgICAgICAgICBwLm54ID0gd2Q7CisgICAgICAgIH0KKyAgICB9CisgIGVsc2UKKyAg ICB7CisgICAgICBpbnQgeCA9IHdpbmRvd19ib3hfcmlnaHQgKHcsCisgICAgICAgIChXSU5ET1df SEFTX0ZSSU5HRVNfT1VUU0lERV9NQVJHSU5TICh3KQorICAgICAgICAgPyBSSUdIVF9NQVJHSU5f QVJFQQorICAgICAgICAgOiBURVhUX0FSRUEpKTsKKyAgICAgIGludCB3ZCA9IFdJTkRPV19SSUdI VF9GUklOR0VfV0lEVEggKHcpOworICAgICAgaWYgKHAud2QgPiB3ZCkKKyAgICAgICAgcC53ZCA9 IHdkOworICAgICAgcC54ID0geCArICh3ZCAtIHAud2QpIC8gMjsKKyAgICAgIC8qIENsZWFyIHJp Z2h0IGZyaW5nZSBpZiBubyBiaXRtYXAgdG8gZHJhdyBvZiBpZiBiaXRtYXAgZG9lc24ndCBmaWxs CisgICB0aGUgZnJpbmdlLiAqLworICAgICAgaWYgKHAud2QgPCB3ZCB8fCBwLnkgPiBwLmJ5IHx8 IHAueSArIHAuaCA8IHAuYnkgKyBwLm55KQorICAgICAgICB7CisgICAgICAgICAgcC5ieCA9IHg7 CisgICAgICAgICAgcC5ueCA9IHdkOworICAgICAgICB9CisgICAgfQorICBpZiAocC54ID49IFdJ TkRPV19CT1hfTEVGVF9FREdFX1ggKHcpCisgICAgICAmJiAocC54ICsgcC53ZCkgPD0gV0lORE9X X0JPWF9MRUZUX0VER0VfWCAodykgKyBXSU5ET1dfUElYRUxfV0lEVEggKHcpKQorICAgIEZSQU1F X1JJRiAoZiktPmRyYXdfZnJpbmdlX2JpdG1hcCAodywgcm93LCAmcCk7Cit9CisKK3ZvaWQKK21j X2RyYXdfZnJpbmdlX2JpdG1hcCAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAq cm93LCBpbnQgbGVmdF9wLCBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlKQoreworICBp bnQgb3ZlcmxheSA9IDA7CisgIGlmIChsZWZ0X3AgPT0gcm93LT5yZXZlcnNlZF9wICYmIHJvdy0+ Y3Vyc29yX2luX2ZyaW5nZV9wKQorICAgIHsKKyAgICAgIExpc3BfT2JqZWN0IGN1cnNvciA9IFFu aWw7CisgICAgICBzd2l0Y2ggKGN1cnNvcl90eXBlKQorICAgICAgICB7CisgICAgICAgIGNhc2Ug TUNfRlJBTUVEX0JPWDoKKyAgICAgICAgICBpZiAocm93LT52aXNpYmxlX2hlaWdodCA+PSBTVEFO REFSRF9CSVRNQVBfSEVJR0hUIChob2xsb3dfcmVjdGFuZ2xlX2JpdHMpKQorICAgICAgICAgICAg Y3Vyc29yID0gUWhvbGxvdzsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICBjdXJzb3IgPSBR aG9sbG93X3NtYWxsOworICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1DX0hPTExPV19C T1g6CisgICAgICAgICAgaWYgKHJvdy0+dmlzaWJsZV9oZWlnaHQgPj0gU1RBTkRBUkRfQklUTUFQ X0hFSUdIVCAoaG9sbG93X3JlY3RhbmdsZV9iaXRzKSkKKyAgICAgICAgICAgIGN1cnNvciA9IFFo b2xsb3c7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgY3Vyc29yID0gUWhvbGxvd19zbWFs bDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19GSUxMRURfQk9YOgorICAgICAg ICAgIGN1cnNvciA9IFFib3g7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTUNfQkFS OgorICAgICAgICAgIGN1cnNvciA9IFFiYXI7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNh c2UgTUNfSEJBUjoKKyAgICAgICAgICBjdXJzb3IgPSBRaGJhcjsKKyAgICAgICAgICBicmVhazsK KyAgICAgICAgY2FzZSBNQ19OT19GUklOR0VfQklUTUFQOgorICAgICAgICBjYXNlIE1DX05PX0NV UlNPUjoKKyAgICAgICAgY2FzZSBNQ19SSUdIVF9GUklOR0VfQklUTUFQOgorICAgICAgICBjYXNl IE1DX0xFRlRfRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICB3LT5w aHlzX2N1cnNvcl9vbl9wID0gMDsKKyAgICAgICAgICByb3ctPmN1cnNvcl9pbl9mcmluZ2VfcCA9 IDA7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGlmICghTklMUCAoY3Vyc29y KSkKKyAgICAgICAgeworICAgICAgICAgIGludCBibSA9IG1jX2dldF9sb2dpY2FsX2N1cnNvcl9i aXRtYXAgKHcsIGN1cnNvcik7CisgICAgICAgICAgaWYgKGJtICE9IE1DX05PX0ZSSU5HRV9CSVRN QVApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcF8x ICh3LCByb3csIGxlZnRfcCwgMiwgYm0pOworICAgICAgICAgICAgICBvdmVybGF5ID0gRVEgKGN1 cnNvciwgUWJveCkgPyAzIDogMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAg bWNfZHJhd19mcmluZ2VfYml0bWFwXzEgKHcsIHJvdywgbGVmdF9wLCBvdmVybGF5LCBNQ19OT19G UklOR0VfQklUTUFQKTsKKyAgaWYgKGxlZnRfcCAmJiByb3ctPm92ZXJsYXlfYXJyb3dfYml0bWFw ICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisgICAgbWNfZHJhd19mcmluZ2VfYml0bWFwXzEgKHcs IHJvdywgMSwgMSwgcm93LT5vdmVybGF5X2Fycm93X2JpdG1hcCk7Cit9CisKKy8qIGVuZCBNVUxU SVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAjZGVmaW5lIE5P X0ZSSU5HRV9CSVRNQVAgMAogI2RlZmluZSBVTkRFRl9GUklOR0VfQklUTUFQIDEKICNkZWZpbmUg TUFYX1NUQU5EQVJEX0ZSSU5HRV9CSVRNQVBT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BsZS1hbmdsZS11cCAnZnJpbmdl KSA9PiA0NyAqLworCisgIC8qIDQ4ICovCisgIERFRlNZTSAoUW1jX3F1YWRydXBsZV9hbmdsZV9k b3duLCAiKy1xdWFkcnVwbGUtYW5nbGUtZG93biIpOworICBWZnJpbmdlX2JpdG1hcHMgPSBGY29u cyAoUW1jX3F1YWRydXBsZV9hbmdsZV9kb3duLCBWZnJpbmdlX2JpdG1hcHMpOworICBGcHV0IChR bWNfcXVhZHJ1cGxlX2FuZ2xlX2Rvd24sIFFmcmluZ2UsIG1ha2VfZml4bnVtICg0OCkpOworICAv KiAoZ2V0ICcrLXF1YWRydXBsZS1hbmdsZS1kb3duICdmcmluZ2UpID0+IDQ4ICovCisKKy8qIGVu ZCBNVUxUSVBMRS1DVVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIERF RlNZTSAoUXRydW5jYXRpb24sICJ0cnVuY2F0aW9uIik7CiAgIERFRlNZTSAoUWNvbnRpbnVhdGlv biwgImNvbnRpbnVhdGlvbiIpOwogICBERUZTWU0gKFFvdmVybGF5X2Fycm93LCAib3ZlcmxheS1h cnJvdyIpOwpkaWZmIC0tZ2l0IGEvc3JjL25zdGVybS5oIGIvc3JjL25zdGVybS5oCmluZGV4IDk3 NzNlYjMuLmUzNGExMTYgMTAwNjQ0Ci0tLSBhL3NyYy9uc3Rlcm0uaAorKysgYi9zcmMvbnN0ZXJt LmgKQEAgLTY2Myw2ICs2NjMsMTYgQEAgdHlwZWRlZiBpZCBpbnN0YW5jZXR5cGU7CiAKIEBpbnRl cmZhY2UgRW1hY3NTY3JvbGxlciA6IE5TU2Nyb2xsZXIKICAgeworCisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgTlNSZWN0IG1jX3JlY3Rh bmdsZTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgc3RydWN0IHdpbmRvdyAq d2luZG93OwogICAgc3RydWN0IGZyYW1lICpmcmFtZTsKICAgIE5TUmVzcG9uZGVyICpwcmV2UmVz cG9uZGVyOwpAQCAtNjgzLDYgKzY5MywxOCBAQCB0eXBlZGVmIGlkIGluc3RhbmNldHlwZTsKICAg IGludCBlbV93aG9sZTsKICAgIH0KIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1V TFRJUExFLUNVUlNPUlMgKi8KKworLSAodm9pZCltY19zZXRfcmVjdGFuZ2xlOiAoTlNSZWN0KXJl Y3Q7CistIChOU1JlY3QpbWNfZ2V0X3JlY3RhbmdsZTsKKy0gKHN0cnVjdCB3aW5kb3cgKiltY19n ZXRfd2luZG93OworLSAoYm9vbCltY19qdWRnZTsKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogLSAoaW5zdGFuY2V0eXBlKSBpbml0RnJhbWU6IChOU1JlY3QgKXIgd2luZG93OiAoTGlz cF9PYmplY3Qpd2luOwogLSAodm9pZClzZXRGcmFtZTogKE5TUmVjdClyOwogCmRpZmYgLS1naXQg YS9zcmMvbnN0ZXJtLm0gYi9zcmMvbnN0ZXJtLm0KaW5kZXggMDIzMzE4Mi4uYjA4NDU0NSAxMDA2 NDQKLS0tIGEvc3JjL25zdGVybS5tCisrKyBiL3NyYy9uc3Rlcm0ubQpAQCAtNzYsNiArNzYsOTc5 IEBAIFVwZGF0ZWQgYnkgQ2hyaXN0aWFuIExpbXBhY2ggKGNocmlzQG5pY2UuY2gpCiBzdGF0aWMg RW1hY3NNZW51ICptYWluTWVudTsKICNlbmRpZgogCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCitzdGF0aWMgQk9PTCBuc19jbGlwX3Rv X3JlY3QgKHN0cnVjdCBmcmFtZSAqLCBOU1JlY3QgKiwgaW50KTsKKworc3RhdGljIHZvaWQgbnNf cmVzZXRfY2xpcHBpbmcgKHN0cnVjdCBmcmFtZSAqKTsKKworc3RhdGljIHZvaWQgbnNfZHVtcGds eXBoc19ib3hfb3JfcmVsaWVmIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICopOworCitzdGF0aWMgdm9p ZCBuc19kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAoc3RydWN0IGdseXBo X3N0cmluZyAqKTsKKworc3RhdGljIGludCBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAo c3RydWN0IGdseXBoX3N0cmluZyAqLCBOYXRpdmVSZWN0YW5nbGUgKik7CisKK3N0YXRpYyB2b2lk IG5zX2RyYXdfcmVsaWVmIChOU1JlY3QsIGludCwgY2hhciwgY2hhciwgY2hhciwgY2hhciwgY2hh ciwgc3RydWN0IGdseXBoX3N0cmluZyAqKTsKKworc3RhdGljIHZvaWQgbnNfZHJhd19ib3ggKE5T UmVjdCwgQ0dGbG9hdCwgTlNDb2xvciAqLCBjaGFyLCBjaGFyKTsKKworc3RhdGljIHZvaWQgbnNf ZHJhd191bmRlcndhdmUgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKiwgRW1hY3NDR0Zsb2F0LCBFbWFj c0NHRmxvYXQpOworCisvKiBDdXJyZW50IGRlc2lnbiBhc3N1bWVzIHRoYXQgYWxwaGEgaXMgMS4w ICovCit2b2lkCittY194d19jb2xvcl92YW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m b3IgKGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7CisgICAgICAgY2Fj aGVfdHlwZSA8IE5PX0NBQ0hFOworICAgICAgICsrY2FjaGVfdHlwZSkKKyAgICB7CisgICAgICBm b3IgKGludCBudGggPSAwOworICAgICAgICAgICBzCisgICAgICAgICAgICYmIG1jX3RyYXZlcnNl X2NhY2hlX3AgKG1jX21hdHJpeCwgY2FjaGVfdHlwZSwgdm50aCwgbnRoKTsKKyAgICAgICAgICAg KytudGgpCisgICAgICAgIHsKKyAgICAgICAgICAvLyAgaW50IHggPSBtY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLng7CisgICAgICAgICAgaW50IGZ4ID0gbWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5meDsKKyAgICAgICAgICAvLyAg aW50IHkgPSBtY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLnk7Cisg ICAgICAgICAgaW50IGZ5ID0gbWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXS5meTsKKyAgICAgICAgICBpbnQgaHBvcyA9IG1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF0uaHBvczsKKyAgICAgICAgICBpbnQgdnBvcyA9IG1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0udnBvczsKKyAgICAgICAgICBpbnQgd2Qg PSBtY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLndkOworICAgICAg ICAgIGludCBoID0gbWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5o OworICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUgPSBtY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmN1cnNvcl90eXBlOworICAgICAgICAg IC8vICBpbnQgY3Vyc29yX3dpZHRoID0gbWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXS5jdXJzb3Jfd2lkdGg7CisgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmcg PSB7LnJlZCA9IG1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZmcu cmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IG1jX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZmcuZ3JlZW4sCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBtY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhdLmZnLmJsdWV9OworICAgICAgICAgIC8vICBzdHJ1Y3QgbWNfUkdC IGxzbF9iZyA9IHsucmVkID0gbWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXS5iZy5yZWQsCisgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVl biA9IG1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmcuZ3JlZW4s CisgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0gbWNfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5iZy5ibHVlfTsKKyAgICAgICAgICBi b29sIGFjdGl2ZV9wID0gbWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XS5hY3RpdmVfcDsKKyAgICAgICAgICAvLyAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0g bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5nbHlwaF9mbGF2b3I7 CisgICAgICAgICAgYm9vbCBlbmFibGVkX3AgPSBtY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhdLmVuYWJsZWRfcDsKKyAgICAgICAgICBib29sIGdvX3AgPSAodnBvcyA9 PSB2bnRoCisgICAgICAgICAgICAgICAgICAgICAgICYmIGhwb3MgPT0gY3Vyc29yX2dseXBoLT5o cG9zCisgICAgICAgICAgICAgICAgICAgICAgICYmIGVuYWJsZWRfcCk7CisgICAgICAgICAgaWYg KCFnb19wKQorICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgTlNSZWN0IHI7CisgICAg ICAgICAgci5vcmlnaW4ueCA9IGZ4OworICAgICAgICAgIHIub3JpZ2luLnkgPSBmeTsKKyAgICAg ICAgICByLnNpemUuaGVpZ2h0ID0gaDsKKyAgICAgICAgICByLnNpemUud2lkdGggPSB3ZDsKKyAg ICAgICAgICBbW05TQ29sb3IgY29sb3JXaXRoQ2FsaWJyYXRlZFJlZDogbHNsX2ZnLnJlZAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdyZWVuOiBsc2xfZmcuZ3JlZW4KKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmx1ZTogbHNsX2ZnLmJsdWUKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHBoYTogMS4wXSBzZXRdOworICAg ICAgaWYgKGN1cnNvcl90eXBlID09IE1DX0ZSQU1FRF9CT1gpCisgICAgICAgIHsKKyAgICAgICAg ICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAocy0+dy0+Y29udGVudHMpOworICAgICAgICAg IGJvb2wgcmVnaW9uX2FjdGl2ZV9wID0gKCFOSUxQIChWdH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2FjdGl2ZV9yZWdpb25fYmVnX2NvbG9yOworICAgICAgICAgICAgfQorICAgICAgICAgICAg ZWxzZSBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVf cAorICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBoLT5jaGFycG9zID09IHJlZ2lv bl9lbmQpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9s bG93X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywg cy0+ZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWF0LXJlZ2lvbi1wcmUtenYtZmFjZSIp LCB0cnVlKTsKKyAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9yZWdp b25fZW5kX2ZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIGhvbGxvd19hY3RpdmVfcmVnaW9uX2Vu ZF9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICBOU0NvbG9yICpob2xsb3dfYWN0aXZlX3JlZ2lv bl9lbmRfY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5E IChob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZSksIHMtPmYpOworICAgICAgICAgICAgICAg IGhvbGxvd19jb2xvciA9IGhvbGxvd19hY3RpdmVfcmVnaW9uX2VuZF9jb2xvcjsKKyAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAg ICAgICAgICAgICAgICAgJiYgYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vy c29yX2dseXBoLT5jaGFycG9zID4gcmVnaW9uX2JlZworICAgICAgICAgICAgICAgICAg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CBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKHMt PmYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgIE5TQ29sb3Ig KmhvbGxvd19hY3RpdmVfY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9C QUNLR1JPVU5EIChob2xsb3dfYWN0aXZlX2ZhY2UpLCBzLT5mKTsKKyAgICAgICAgICAgICAgICAg ICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2FjdGl2ZV9jb2xvcjsKKyAgICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKCFhY3RpdmVfcCkKKyAgICAgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfaW5hY3Rp dmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlIChzLT53LCBzLT5mLCBpbnRlcm4gKCIrLXJl YWwtZmFrZS1jdXJzb3ItaW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAg ICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19pbmFjdGl2ZV9mYWNlID0gRkFDRV9GUk9N X0lEIChzLT5mLCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAg ICAgTlNDb2xvciAqaG9sbG93X2luYWN0aXZlX2NvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29s b3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoaG9sbG93X2luYWN0aXZlX2ZhY2UpLCBzLT5mKTsKKyAg ICAgICAgICAgICAgICAgICAgICBob2xsb3dfY29sb3IgPSBob2xsb3dfaW5hY3RpdmVfY29sb3I7 CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChmYWNl ICYmIE5TX0ZBQ0VfQkFDS0dST1VORCAoZmFjZSkgPT0gbnNfaW5kZXhfY29sb3IgKEZSQU1FX0NV UlNPUl9DT0xPUiAocy0+ZiksIHMtPmYpKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIFtuc19s b29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChmYWNlKSwgcy0+Zikgc2V0 XTsKKyAgICAgICAgICAgIGhvbGxvd19jb2xvciA9IEZSQU1FX0NVUlNPUl9DT0xPUiAocy0+Zik7 CisgICAgICAgICAgfQorICAgICAgICAgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgICAgICAg ICB7CisgICAgICAgICAgICAgIGNhc2UgTUNfTk9fRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgICAg ICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSBNQ19OT19DVVJTT1I6CisgICAgICAgICAg ICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgTUNfUklHSFRfRlJJTkdFX0JJVE1BUDoK KyAgICAgICAgICAgICAgY2FzZSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgICAgICAg IGNhc2UgTUNfRklMTEVEX0JPWDoKKyAgICAgICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAg ICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSBNQ19GUkFNRURfQk9YOgor ICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAgICAgIFtob2xsb3df Y29sb3Igc2V0XTsKKyAgICAgICAgICAgICAgICBOU1JlY3RGaWxsIChOU0luc2V0UmVjdCAociwg MSwgMSkpOworICAgICAgICAgICAgICAgIFtGUkFNRV9DVVJTT1JfQ09MT1IgKHMtPmYpIHNldF07 CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgTUNfSE9MTE9XX0JP WDoKKyAgICAgICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAgICAgICBbaG9s bG93X2NvbG9yIHNldF07CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAoTlNJbnNldFJlY3Qg KHIsIDEsIDEpKTsKKyAgICAgICAgICAgICAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChzLT5mKSBz ZXRdOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX0hCQVI6 CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAgICAgICAgYnJlYWs7 CisgICAgICAgICAgICAgIGNhc2UgTUNfQkFSOgorICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwg KHIpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgIC8q IElmIGEgZ2x5cGggZXhpc3RzIChzLT5jaGFyMmIgIT0gTlVMTCksIHRoZW4gZHJhdyB0aGUgZ2x5 cGggb24gdG9wIG9mIHRoZQorICAgICAgICAgIG5ld2x5IGRyYXduIHJlY3RhbmdsZSB0aGF0IHdh cyBjcmVhdGVkIGhlcmVpbmFib3ZlLiAgVG8gdGhlIGV4dGVudCB0aGF0IHdlCisgICAgICAgICAg d2FudCB0byBkb3VibGUtaW1wcmludCBnbHlwaHMgdG8gbWFrZSB0aGVtIGFwcGVhciB0byBiZSBz ZW1pLWJvbGQsIGl0IGNhbgorICAgICAgICAgIGJlIGRvbmUgaGVyZSBmb3IgYWxsIGN1cnNvciB0 eXBlcy4gIFRoZSBib3gtc3R5bGUgY3Vyc29ycyBhcmUgaW1wcmludGVkCisgICAgICAgICAgd2l0 aCBnbHlwaHMgb25seSBvbmUgKDEpIHRpbWUuICBUaGUgc2VtaS1ib2xkIGFwcGVhcmFuY2UgaXMg aGVscGZ1bCB3aGVuCisgICAgICAgICAgZGVidWdnaW5nIHRvIHNlZSB0aGF0IHRoZSBjb29yZGlu YXRlcyBhcmUgY29ycmVjdC4gKi8KKyAgICAgICAgICBpZiAocy0+Y2hhcjJiICE9IE5VTEwKKyAg ICAgICAgICAgICAgJiYgKGN1cnNvcl90eXBlID09IE1DX0ZJTExFRF9CT1gKKyAgICAgICAgICAg ICAgICAgIHx8IGN1cnNvcl90eXBlID09IE1DX0ZSQU1FRF9CT1gKKyAgICAgICAgICAgICAgICAg IHx8IGN1cnNvcl90eXBlID09IE1DX0hPTExPV19CT1gpKQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBCT09MIGlzQ29tcG9zaXRlID0gcy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ09NUE9T SVRFX0dMWVBIOworICAgICAgICAgICAgICBpZiAoaXNDb21wb3NpdGUpCisgICAgICAgICAgICAg ICAgbnNfZHJhd19jb21wb3NpdGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHMpOworICAgICAg ICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAg c3RydWN0IGZvbnQgKmZvbnQgPSBzLT5mYWNlLT5mb250OworICAgICAgICAgICAgICAgICAgICBp ZiAoIWZvbnQpCisgICAgICAgICAgICAgICAgICAgICAgZm9udCA9IEZSQU1FX0ZPTlQgKHMtPmYp OworICAgICAgICAgICAgICAgICAgICBib29sIHdpdGhfYmdfcCA9IGZhbHNlOworICAgICAgICAg ICAgICAgICAgICBmb250LT5kcml2ZXItPmRyYXcgKHMsIHMtPmNtcF9mcm9tLCBzLT5uY2hhcnMs IHMtPngsIHMtPnliYXNlLCB3aXRoX2JnX3ApOworICAgICAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgfQorICAgICAgICB9CisgICAgfQorICAvLyAgY2xvY2tfdCBjbG9ja19lbmQgPSBjbG9j aygpOworICAvLyAgZG91YmxlIGNwdV90aW1lX3VzZWQgPSAoKGRvdWJsZSkgKGNsb2NrX2VuZCAt IGNsb2NrX3N0YXJ0KSkgLyBDTE9D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mKVxuXAorICBjdXJz b3JfdHlwZSAoJXMpIHwgY3Vyc29yX3dpZHRoICglZCkgfCBvbl9wICglcykgfCBhY3RpdmVfcCAo JXMpXG5cCisgIGdseXBoX2ZsYXZvciAoJXMpXG4iLAorICBtY193aW5kb3cgKHcpLCB4LCBmeCwg eSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLCBsc2wucmVkLCBsc2wuYmx1ZSwgbHNsLmdyZWVuLAor ICBtY19jdXJzb3JfdHlwZV90b19zdHJpbmcgKGN1cnNvcl90eXBlKSwgY3Vyc29yX3dpZHRoLCBv bl9wID8gInkiIDogIm4iLAorICBhY3RpdmVfcCA/ICJ5IiA6ICJuIiwgbWNfZmxhdm9yX3RvX3N0 cmluZyAoZ2x5cGhfZmxhdm9yKSk7CisqLworICBOU1JlY3QgciwgczsKKyAgc3RydWN0IGZyYW1l ICpmID0gV0lORE9XX1hGUkFNRSAodyk7CisgIHN0cnVjdCBnbHlwaCAqY3Vyc29yX2dseXBoID0g bWNfZ2V0X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIGhwb3MsIHZwb3MpOworICBlbnVt IGZhY2VfaWQgY3Vyc29yX2dseXBoX2ZhY2VfaWQgPSAoY3Vyc29yX2dseXBoID09IE5VTEwpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gREVGQVVMVF9GQUNFX0lECisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogY3Vyc29yX2dseXBoLT5mYWNl X2lkOworICBzdHJ1Y3QgZmFjZSAqZmFjZTsKKyAgTlNDb2xvciAqaG9sbG93X2NvbG9yID0gRlJB TUVfQkFDS0dST1VORF9DT0xPUiAoZik7CisgIC8qIElmIGN1cnNvciBpcyBvdXQgb2YgYm91bmRz LCBkb24ndCBkcmF3IGdhcmJhZ2UuICBUaGlzIGNhbiBoYXBwZW4KKyAgICAgaW4gbWluaS1idWZm ZXIgd2luZG93cyB3aGVuIHN3aXRjaGluZyBiZXR3ZWVuIGVjaG8gYXJlYSBnbHlwaHMKKyAgICAg YW5kIG1pbmktYnVmZmVyLiAqLworICBpZiAoIW9uX3ApCisgICAgcmV0dXJuOworICBpZiAoY3Vy c29yX3R5cGUgPT0gTUNfTk9fQ1VSU09SKQorICAgIHJldHVybjsKKyAgLyogVGhlIGZyaW5nZSBi aXRtYXBzIGFyZSBwcmVzZW50bHkgaGFuZGxlZCBlbHNld2hlcmUsIGJ1dCBjb3VsZCBzb21lZGF5 IGJlCisgIG1hbmFnZWQgKGluIHBhcnQpIGF0IHRoaXMgc2VjdGlvbiBvZiBjb2RlLiAqLworICBp ZiAocm93LT5leGFjdF93aW5kb3dfd2lkdGhfbGluZV9wCisgICAgICAmJiAocm93LT5yZXZlcnNl ZF9wCisgICAgICAgICA/IChocG9zIDwgMCkKKyAgICAgICAgIDogKGhwb3MgPj0gcm93LT51c2Vk W1RFWFRfQVJFQV0pKSkKKyAgICB7CisgICAgICByb3ctPmN1cnNvcl9pbl9mcmluZ2VfcCA9IHRy dWU7CisgICAgICBtY19kcmF3X2ZyaW5nZV9iaXRtYXAgKHcsIHJvdywgcm93LT5yZXZlcnNlZF9w LCBjdXJzb3JfdHlwZSk7CisgICAgICByZXR1cm47CisgICAgfQorICByLm9yaWdpbi54ID0gZng7 CisgIHIub3JpZ2luLnkgPSBmeTsKKyAgci5zaXplLmhlaWdodCA9IGg7CisgIHIuc2l6ZS53aWR0 aCA9IHdkOworICAvKiBgbnNfY2xpcF90b19yZWN0JyBtdXN0IHByZWNlZGUgdGhlIHNldHRpbmcg b2YgZmFjZXMgc28gYXMgdG8gYXZvaWQKKyAgICAgdW5zaWdodGx5IGdkYiBlcnJvciBtZXNzYWdl cyB0aGF0IGFyZSBuZXh0IHRvIGltcG9zc2libGUgdG8gZGVidWc6CisgICAgICAgVGh1IE1hciAy OCAxMzo1NDozMiBzZXJ2ZXIubG9jYWwgRW1hY3NbMTcyMDddIDxFcnJvcj46CisgICAgICAgQ0dD b250ZX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VhBTVBMRSBPRiBIT1cgVE8gQ1JFQVRFIEEgQ09MT1Ig V0lUSCBSR0IvTFNMIGZsb2F0IHZhbHVlczoKKyAgICAgTlNDb2xvciAqbXlfY29sb3IgPSBbTlND b2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiAxLjAKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdyZWVuOiAxLjAKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBibHVlOiAxLjAKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscGhhOiAxLjBdOworICAt ICBBTFRFUk5BVElWRSBFWEFNUExFOgorICAgICBlbnVtIGZhY2VfaWQgZGVidWdnaW5nX2ZhY2Vf aWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ZiwgaW50ZXJuICgiKy1kZWJ1Z2dpbmct ZmFjZSIpLCB0cnVlKTsKKyAgICAgc3RydWN0IGZhY2UgKmRlYnVnZ2luZ19mYWNlID0gRkFDRV9G Uk9NX0lEIChzLT5mLCBkZWJ1Z2dpbmdfZmFjZV9pZCk7CisgICAgIE5TQ29sb3IgKmNvbG9yID0g bnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoZGVidWdnaW5nX2Zh Y2UpLCBzLT5mKTsKKyAgICAgW2NvbG9yIHNldF07ICovCisgIGlmIChnbHlwaF9mbGF2b3IgPT0g TUNfR0xZUEgKKyAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSExFU1MpCisgICAgW1tO U0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6IGxzbC5yZWQKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBncmVlbjogbHNsLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGJsdWU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tHUk9VTkQgKGhvbGxvd19pbmFjdGl2ZV9mYWNlKSwgZik7CisgICAgICAgICAgICAg ICAgICBob2xsb3dfY29sb3IgPSBob2xsb3dfaW5hY3RpdmVfY29sb3I7CisgICAgICAgICAgICAg ICAgfQorICAgIH0KKyAgICBlbHNlIGlmIChmYWNlICYmIE5TX0ZBQ0VfQkFDS0dST1VORCAoZmFj ZSkgPT0gbnNfaW5kZXhfY29sb3IgKEZSQU1FX0NVUlNPUl9DT0xPUiAoZiksIGYpKQorICAgICAg eworICAgICAgICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAo ZmFjZSksIGYpIHNldF07CisgICAgICAgIGhvbGxvd19jb2xvciA9IEZSQU1FX0NVUlNPUl9DT0xP UiAoZik7CisgICAgICB9CisjaWZkZWYgTlNfSU1QTF9DT0NPQQorICBOU0Rpc2FibGVTY3JlZW5V cGRhdGVzICgpOworI2VuZGlmCisgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgeworICAgICAg Y2FzZSBNQ19OT19GUklOR0VfQklUTUFQOgorICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNf Tk9fQ1VSU09SOgorICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfUklHSFRfRlJJTkdFX0JJ VE1BUDoKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1DX0xFRlRfRlJJTkdFX0JJVE1BUDoK KyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAgICAgIE5TUmVj dEZpbGwgKHIpOworICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgTUNfRlJBTUVEX0JPWDoKKyAg ICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgIFtob2xsb3dfY29sb3Igc2V0XTsKKyAgICAg ICAgTlNSZWN0RmlsbCAoTlNJbnNldFJlY3QgKHIsIDEsIDEpKTsKKyAgICAgICAgW0ZSQU1FX0NV UlNPUl9DT0xPUiAoZikgc2V0XTsKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1DX0hPTExP V19CT1g6CisgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICBbaG9sbG93X2NvbG9yIHNl dF07CisgICAgICAgIE5TUmVjdEZpbGwgKE5TSW5zZXRSZWN0IChyLCAxLCAxKSk7CisgICAgICAg IFtGUkFNRV9DVVJTT1JfQ09MT1IgKGYpIHNldF07CisgICAgICAgIGJyZWFrOworICAgICAgY2Fz ZSBNQ19IQkFSOgorICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgYnJlYWs7CisgICAg ICBjYXNlIE1DX0JBUjoKKyAgICAgICAgcyA9IHI7CisgICAgICAgIC8qIEBsYXdsaXN0IGlzIGZv Y3VzaW5nIHRoZSBpbml0aWFsIGRldmVsb3BtZW50IG9mIGZlYXR1cmUgcmVxdWVzdHMKKyAgICAg ICAgIzE3Njg0IGFuZCAjMjI4NzMgb24gTDJSIGxhbmd1YWdlcy4gKi8KKyAgICAgICAgaWYgKGds eXBoX2ZsYXZvciAhPSBNQ19HTFlQSAorICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1D X0dMWVBITEVTUykKKyAgICAgICAgICB7CisgICAgICAgICAgICAvKiBJZiB0aGUgY2hhcmFjdGVy IHVuZGVyIGN1cnNvciBpcyBSMkwsIGRyYXcgdGhlIGJhciBjdXJzb3IKKyAgICAgICAgICAgICAg IG9uIHRoZSByaWdodCBvZiBpdHMgZ2x5cGgsIHJhdGhlciB0aGFuIG9uIHRoZSBsZWZ0LiAqLwor ICAgICAgICAgICAgaWYgKChjdXJzb3JfZ2x5cGgtPnJlc29sdmVkX2xldmVsICYgMSkgIT0gMCkK KyAgICAgICAgICAgICAgcy5vcmlnaW4ueCArPSBjdXJzb3JfZ2x5cGgtPnBpeGVsX3dpZHRoIC0g cy5zaXplLndpZHRoOworICAgICAgICAgIH0KKyAgICAgICAgTlNS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mYWNlLT51bmRlcmxpbmVf Y29sb3IsIHMtPmYpIHNldF07CisgICAgICAgICAgbnNfZHJhd191bmRlcndhdmUgKHMsIHdpZHRo LCB4KTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlw ZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgeworICAgICAgICAgICAgTlNSZWN0IHI7 CisgICAgICAgICAgICB1bnNpZ25lZCBsb25nIHRoaWNrbmVzcywgcG9zaXRpb247CisgICAgICAg ICAgICAvKiBJZiB0aGUgcHJldiB3YXMgdW5kZXJsaW5lZCwgbWF0Y2ggaXRzIGFwcGVhcmFuY2Uu ICovCisgICAgICAgICAgICBpZiAocy0+cHJldiAmJiBzLT5wcmV2LT5mYWNlLT51bmRlcmxpbmVf cAorICAgICAgICAgICAgICAgICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZB Q0VfVU5ERVJfTElORQorICAgICAgICAgICAgICAgICYmIHMtPnByZXYtPnVuZGVybGluZV90aGlj a25lc3MgPiAwKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0g cy0+cHJldi0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAgICAgICAgICAgICBwb3NpdGlvbiA9 IHMtPnByZXYtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgc3RydWN0IGZv bnQgKmZvbnQ7CisgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIGRlc2NlbnQ7CisgICAg ICAgICAgICAgICAgICBmb250PXMtPmZvbnQ7CisgICAgICAgICAgICAgICAgICBkZXNjZW50ID0g cy0+eSArIHMtPmhlaWdodCAtIHMtPnliYXNlOworICAgICAgICAgICAgICAgICAgLyogVXNlIHVu ZGVybGluZSB0aGlja25lc3Mgb2YgZm9udCwgZGVmYXVsdGluZyB0byAxLiAqLworICAgICAgICAg ICAgICAgICAgdGhpY2tuZXNzID0gKGZvbnQgJiYgZm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzcyA+ IDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGZvbnQtPnVuZGVybGluZV90aGlj a25lc3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogMTsKKyAgICAgICAgICAgICAg ICAgIC8qIERldGVybWluZSB0aGUgb2Zmc2V0IG9mIHVuZGVybGluaW5nIGZyb20gdGhlIGJhc2Vs aW5lLiAqLworICAgICAgICAgICAgICAgICAgaWYgKHhfdW5kZXJsaW5lX2F0X2Rlc2NlbnRfbGlu ZSkKKyAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBkZXNjZW50IC0gdGhpY2tuZXNzOwor ICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICh4X3VzZV91bmRlcmxpbmVfcG9zaXRpb25fcHJv cGVydGllcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBmb250ICYmIGZvbnQtPnVu ZGVybGluZV9wb3NpdGlvbiA+PSAwKQorICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0g Zm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYg KGZvbnQpCisgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IGxyb3VuZCAoZm9udC0+ ZGVzY2VudCAvIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICAgICAgICAgICAgICBwb3NpdGlvbiA9IHVuZGVybGluZV9taW5pbXVtX29mZnNldDsKKyAgICAg ICAgICAgICAgICAgIHBvc2l0aW9uID0gbWF4IChwb3NpdGlvbiwgdW5kZXJsaW5lX21pbmltdW1f b2Zmc2V0KTsKKyAgICAgICAgICAgICAgICAgIC8qIEVuc3VyZSB1bmRlcmxpbmluZyBpcyBub3Qg Y3JvcHBlZC4gKi8KKyAgICAgICAgICAgICAgICAgIGlmIChkZXNjZW50IDw9IHBvc2l0aW9uKQor ICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBk ZXNjZW50IC0gMTsKKyAgICAgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAxOworICAgICAg ICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGRlc2NlbnQgPCBw b3NpdGlvbiArIHRoaWNrbmVzcykKKyAgICAgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAx OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHMtPnVuZGVybGluZV90aGlja25lc3Mg PSB0aGlja25lc3M7CisgICAgICAgICAgICBzLT51bmRlcmxpbmVfcG9zaXRpb24gPSBwb3NpdGlv bjsKKyAgICAgICAgICAgIHIgPSBOU01ha2VSZWN0ICh4LCBzLT55YmFzZSArIHBvc2l0aW9uLCB3 aWR0aCwgdGhpY2tuZXNzKTsKKyAgICAgICAgICAgIGlmIChmYWNlLT51bmRlcmxpbmVfZGVmYXVs dGVkX3ApCisgICAgICAgICAgICAgIFtkZWZhdWx0Q29sIHNldF07CisgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICBbbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKGZhY2UtPnVuZGVy bGluZV9jb2xvciwgcy0+Zikgc2V0XTsKKyAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAg ICAgICAgIH0KKyAgICB9CisgIC8qIERvIG92ZXJsaW5lLiBXZSBmb2xsb3cgb3RoZXIgdGVybXMg aW4gdXNpbmcgYSB0aGlja25lc3Mgb2YgMQorICAgICBhbmQgaWdub3Jpbmcgb3ZlcmxpbmVfbWFy Z2luLiAqLworICBpZiAoZmFjZS0+b3ZlcmxpbmVfcCkKKyAgICB7CisgICAgICBOU1J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ICAgc3RydWN0IGdseXBoX3JvdyAqcm93LCBzdHJ1Y3QgbWNfbWF0cml4 IG1jX21hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHdkKQoreworICBOU1Jl Y3QgclsyXTsKKyAgaW50IG4sIGk7CisgIHN0cnVjdCBmYWNlICpmYWNlOworICBOU0NvbG9yICpm Z0NvbCwgKmJnQ29sOworICBpZiAoIXMtPmJhY2tncm91bmRfZmlsbGVkX3ApCisgICAgeworICAg ICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAgICAgIGlmICgh bnNfY2xpcF90b19yZWN0IChzLT5mLCByLCBuKSkKKyAgICAgICAgcmV0dXJuOworICAgICAgKnIg PSBOU01ha2VSZWN0IChzLT54LCBzLT55LCBzLT5iYWNrZ3JvdW5kX3dpZHRoLCBzLT5oZWlnaHQp OworICAgICAgaWYgKHMtPmhsID09IERSQVdfTU9VU0VfRkFDRSkKKyAgICAgICAgeworICAgICAg ICAgIGZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIE1PVVNFX0hMX0lORk8gKHMtPmYpLT5tb3Vz ZV9mYWNlX2ZhY2VfaWQpOworICAgICAgICAgIGlmICghZmFjZSkKKyAgICAgICAgICAgIGZhY2Ug PSBGQUNFX0ZST01fSUQgKHMtPmYsIE1PVVNFX0ZBQ0VfSUQpOworICAgICAgICB9CisgICAgICAg IGVsc2UKKyAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIHMtPmZpcnN0X2dseXBo LT5mYWNlX2lkKTsKKyAgICAgIGJnQ29sID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZB Q0VfQkFDS0dST1VORCAoZmFjZSksIHMtPmYpOworICAgICAgZmdDb2wgPSBuc19sb29rdXBfaW5k ZXhlZF9jb2xvciAoTlNfRkFDRV9GT1JFR1JPVU5EIChmYWNlKSwgcy0+Zik7CisgICAgICBmb3Ig KGkgPSAwOyBpIDwgbjsgKytpKQorICAgICAgICB7CisgICAgICAgICAgaWYgKCFzLT5yb3ctPmZ1 bGxfd2lkdGhfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaW50IG92ZXJydW4sIGxl ZnRvdmVycnVuOworICAgICAgICAgICAgICAvKiB0cnVuY2F0ZSB0byBhdm9pZCBvdmVyd3JpdGlu ZyBmcmluZ2UgYW5kL29yIHNjcm9sbGJhciAqLworICAgICAgICAgICAgICBvdmVycnVuID0gbWF4 ICgwLCAocy0+eCArIHMtPmJhY2tncm91bmRfd2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAtIChXSU5ET1dfQk9YX1JJR0hUX0VER0VfWCAocy0+dykKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIC0gV0lORE9XX1JJR0hUX0ZSSU5HRV9XSURUSCAocy0+dykpKTsK KyAgICAgICAgICAgICAgICAgICAgcltpXS5zaXplLndpZHRoIC09IG92ZXJydW47CisgICAgICAg ICAgICAgIC8qIHRydW5jYXRlIHRvIGF2b2lkIG92ZXJ3cml0aW5nIHRvIGxlZnQgb2YgdGhlIHdp bmRvdyBib3ggKi8KKyAgICAgICAgICAgICAgbGVmdG92ZXJydW4gPSAoV0lORE9XX0JPWF9MRUZU X0VER0VfWCAocy0+dykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBXSU5ET1dfTEVG VF9GUklOR0VfV0lEVEggKHMtPncpKSAtIHMtPng7CisgICAgICAgICAgICAgIGlmIChsZWZ0b3Zl cnJ1biA+IDApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgcltpXS5vcmln aW4ueCArPSBsZWZ0b3ZlcnJ1bjsKKyAgICAgICAgICAgICAgICAgIHJbaV0uc2l6ZS53aWR0aCAt PSBsZWZ0b3ZlcnJ1bjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAg ICAgW2JnQ29sIHNldF07C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5nX2ZhY2UpLCBzLT5m KTsKKyAgICAgICAgICAgICAgLy8gIFtjb2xvciBzZXRdOworICAgICAgICAgICAgICBDR0Zsb2F0 IHggPSByW2ldLm9yaWdpbi54OworICAgICAgICAgICAgICBDR0Zsb2F0IHdpZHRoID0gd2Q7Cisg ICAgICAgICAgICAgIHJbaV0uc2l6ZS53aWR0aCAtPSB3aWR0aDsKKyAgICAgICAgICAgICAgcltp XS5vcmlnaW4ueCArPSB3aWR0aDsKKyAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocltpXSk7Cisg ICAgICAgICAgICAgIC8qIERyYXcgb3ZlcmxpbmluZywgZXRjLiBvbiB0aGUgY3Vyc29yLiAqLwor ICAgICAgICAgICAgICBpZiAocy0+dy0+cGh5c19jdXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9Y KQorICAgICAgICAgICAgICAgIG1jX25zX2RyYXdfdGV4dF9kZWNvcmF0aW9uIChzLCBmYWNlLCBi Z0NvbCwgd2lkdGgsIHgpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAg IG1jX25zX2RyYXdfdGV4dF9kZWNvcmF0aW9uIChzLCBmYWNlLCBmZ0NvbCwgd2lkdGgsIHgpOwor ICAgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgLy8gIGludCBy eCA9IHJbaV0ub3JpZ2luLng7CisgIC8vICBpbnQgcnkgPSByW2ldLm9yaWdpbi55OworICAvLyAg aW50IHJ3ID0gcltpXS5zaXplLndpZHRoOworICAvLyAgaW50IHJoID0gcltpXS5zaXplLmhlaWdo dDsKKyAgLy8gIGZwcmludGYgKHN0ZGVyciwgIm1jX25zX2R1bXBnbHlwaHNfc3RyZXRjaDogIHZw b3MgKCVkKSB8IHJ4ICglZCkgfCByeSAoJWQpIHwgcncgKCVkKSB8IHJoICglZClcbiIsCisgIC8v ICAgICAgICAgICAgICAgICAgIHMtPmZpcnN0X2dseXBoLT52cG9zLCByeCwgcnksIHJ3LCByaCk7 CisgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHJbaV0pOworICAgICAgICAgICAgfQorICAgICAg ICAgIC8qIERyYXcgb3ZlcmxpbmluZywgZXRjLiBvbiB0aGUgc3RyZXRjaCBnbHlwaCAob3IgdGhl IHBhcnQKKyAgICAgICAgICAgICBvZiB0aGUgc3RyZXRjaCBnbHlwaCBhZnRlciB0aGUgY3Vyc29y KS4gKi8KKyAgICAgICAgICBtY19uc19kcmF3X3RleHRfZGVjb3JhdGlvbiAocywgZmFjZSwgZmdD b2wsIHJbaV0uc2l6ZS53aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgcltpXS5vcmlnaW4ueCk7CisgICAgICAgIH0KKyAgICAgIGlmICgocy0+bGVmdF9vdmVyd3Jp dHRlbl9wIHx8IHMtPnJpZ2h0X292ZXJ3cml0dGVuX3ApCisgICAgICAgICAgJiYgKHMtPmFjdGlv bl90eXBlID09IE1DX0RSQVdfR0xZUEhfU1RSSU5HIHx8IHMtPmFjdGlvbl90eXBlID09IE1DX0VS QVNFX0dMWVBIX1NUUklORykpCisgICAgICAgIG1jX25zX2RyYXdfb3ZlcndyaXR0ZW4gKHMsIG1h dHJpeCwgcm93LCBtY19tYXRyaXgsIHMtPmZpcnN0X2dseXBoKTsKKyAgICAgIG5zX3Jlc2V0X2Ns aXBwaW5nIChzLT5mKTsKKyAgICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSAxOworICAgIH0K K30KKworc3RhdGljIHZvaWQKK21jX25zX2R1bXBnbHlwaHNfaW1hZ2UgKHN0cnVjdCBnbHlwaF9z dHJpbmcgKnMsIE5TUmVjdCByLCBzdHJ1Y3QgbWNfUkdCIGxzbCwKKyAgICAgICAgICAgICAgICAg ICAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciwgZW51bSBtY19jdXJzb3JfdHlwZSBj dXJzb3JfdHlwZSwKKyAgICAgICAg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LT5pbWctPm1hc2sgfHwgcy0+aW1nLT5waXhtYXAgPT0gMCB8fCBzLT53aWR0aCAhPSBzLT5iYWNr Z3JvdW5kX3dpZHRoKQorICAgIHsKKyAgICAgIGJyID0gTlNNYWtlUmVjdCAoYmdfeCwgYmdfeSwg cy0+YmFja2dyb3VuZF93aWR0aCwgYmdfaGVpZ2h0KTsKKyAgICAgIHMtPmJhY2tncm91bmRfZmls bGVkX3AgPSAxOworICAgIH0KKyAgICBlbHNlCisgICAgICBiciA9IE5TTWFrZVJlY3QgKHgsIHks IHMtPnNsaWNlLndpZHRoLCBzLT5zbGljZS5oZWlnaHQpOworICBOU1JlY3RGaWxsIChicik7Cisg IC8qIERyYXcgdGhlIGltYWdlLi4gZG8gd2UgbmVlZCB0byBkcmF3IHBsYWNlaG9sZGVyIGlmIGlt ZyA9PW5pbD8gKi8KKyAgaWYgKGltZyAhPSBuaWwpCisgICAgeworI2lmZGVmIE5TX0lNUExfQ09D T0EKKyAgICAgIE5TUmVjdCBkciA9IE5TTWFrZVJlY3QgKHgsIHksIHMtPnNsaWNlLndpZHRoLCBz LT5zbGljZS5oZWlnaHQpOworICAgICAgTlNSZWN0IGlyID0gTlNNYWtlUmVjdCAocy0+c2xpY2Uu eCwgcy0+c2xpY2UueSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLndp ZHRoLCBzLT5zbGljZS5oZWlnaHQpOworICAgICAgW2ltZyBkcmF3SW5SZWN0OiBkcgorICAgICAg ICAgICAgIGZyb21SZWN0OiBpcgorICAgICAgICAgICAgIG9wZXJhdGlvbjogTlNDb21wb3NpdGVT b3VyY2VPdmVyCisgICAgICAgICAgICAgIGZyYWN0aW9uOiAxLjAKKyAgICAgICAgICAgcmVzcGVj dEZsaXBwZWQ6IFlFUworICAgICAgICAgICAgICAgIGhpbnRzOiBuaWxdOworI2Vsc2UKKyAgICAg IFtpbWcgY29tcG9zaXRlVG9Qb2ludDogTlNNYWtlUG9pbnQgKHgsIHkgKyBzLT5zbGljZS5oZWln aHQpCisgICAgICAgICAgICAgICAgICBvcGVyYXRpb246IE5TQ29tcG9zaXRlU291cmNlT3Zlcl07 CisjZW5kaWYKKyAgICB9CisgIGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUikKKyAgICB7CisgICAg ICBbRlJBTUVfQ1VSU09SX0NPTE9SIChzLT5mKSBzZXRdOworICAgICAgaWYgKHMtPnctPnBoeXNf Y3Vyc29yX3R5cGUgPT0gTUNfRklMTEVEX0JPWCkKKyAgICAgICAgdGRDb2wgPSBuc19sb29rdXBf aW5kZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKSwgcy0+Zik7CisgICAgICAg IGVsc2UKKyAgICAgICAgICAvKiBDdXJyZW50bHkgb24gTlMgaW1nLT5tYXNrIGlzIGFsd2F5cyAw LiBTaW5jZQorICAgICAgICAgICAgIGdldF93aW5kb3dfY3Vyc29yX3R5cGUgc3BlY2lmaWVzIGEg aG9sbG93IGJveCBjdXJzb3Igd2hlbiBvbgorICAgICAgICAgICAgIGEgbm9uLW1hc2tlZCBpbWFn ZSB3ZSBuZXZlciByZWFjaCB0aGlzIGNsYXVzZS4gQnV0IHdlIHB1dCBpdAorICAgICAgICAgICAg IGluIGluIGFudGljaXBhdGlvbiBvZiBiZXR0ZXIgc3VwcG9ydCBmb3IgaW1hZ2UgbWFza3Mgb24g TlMuICovCisgICAgICAgICAgdGRDb2wgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFD RV9GT1JFR1JPVU5EIChmYWNlKSwgcy0+Zik7CisgICAgfQorICAgIGVsc2UKKyAgICAgIHRkQ29s ID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoZmFjZSksIHMt PmYpOworICAvKiBEcmF3IHVuZGVybGluZSwgb3ZlcmxpbmUsIHN0cmlrZS10aHJvdWdoLiAqLwor ICBtY19uc19kcmF3X3RleHRfZGVjb3JhdGlvbiAocywgZmFjZSwgdGRDb2wsIGJyLnNpemUud2lk dGgsIGJyLm9yaWdpbi54KTsKKyAgLyogRHJhdyByZWxpZWYsIGlmIHJlcXVlc3RlZCAqLworICBp ZiAocy0+aW1nLT5yZWxpZWYgfHwgcy0+aGwgPT1EUkFXX0lNQUdFX1JBSVNFRCB8fCBzLT5obCA9 PURSQVdfSU1BR0VfU1VOS0VOKQorICAgIHsKKyAgICAgIGlmIChzLT5obCA9PSBEUkFXX0lNQUdF X1NVTktFTiB8fCBzLT5obCA9PSBEUkFXX0lNQUdFX1JBSVNFRCkKKyAgICAgICAgeworICAgICAg ICAgIHRoID0gdG9vbF9iYXJfYnV0dG9uX3JlbGllZiA+PSAwID8KKyAgICAgICAgICAgIHRvb2xf YmFyX2J1dHRvbl9yZWxpZWYgOiBERUZBVUxUX1RPT0xfQkFSX0JVVFRPTl9SRUxJRUY7CisgICAg ICAgICAgcmFpc2VkX3AgPSAocy0+aGwgPT0gRFJBV19JTUFHRV9SQUlTRUQpOworICAgICAgICB9 CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAgICAgICAgICB0aCA9IGFicyAocy0+aW1n LT5yZWxpZWYpOworICAgICAgICAgICAgcmFpc2VkX3AgPSAocy0+aW1nLT5yZWxpZWYgPiAwKTsK KyAgICAgICAgICB9CisgICAgICByLm9yaWdpbi54ID0geCAtIHRoOworICAgICAgci5vcmlnaW4u eSA9IHkgLSB0aDsKKyAgICAgIHIuc2l6ZS53aWR0aCA9IHMtPnNsaWNlLndpZHRoICsgMip0aC0x OworICAgICAgci5zaXplLmhlaWdodCA9IHMtPnNsaWNlLmhlaWdodCArIDIqdGgtMTsKKyAgICAg IG5zX2RyYXdfcmVsaWVmIChyLCB0aCwgcmFpc2VkX3AsCisgICAgICAgICAgICAgICAgICAgICAg cy0+c2xpY2UueSA9PSAwLAorICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLnkgKyBzLT5z bGljZS5oZWlnaHQgPT0gcy0+aW1nLT5oZWlnaHQsCisgICAgICAgICAgICAgICAgICAgICAgcy0+ c2xpY2UueCA9PSAwLAorICAgICAgICAgICAgICAgICAgICAgIHMtPnNsaWNlLnggKyBzLT5zbGlj ZS53aWR0aCA9PSBzLT5pbWctPndpZHRoLCBzKTsKKyAgICB9CisgIC8qIElmIHRoZXJlIGlzIG5v IG1hc2ssIHRoZSBiYWNrZ3JvdW5kIHdvbid0IGJlIHNlZW4sCisgICAgIHNvIGRyYXcgYSByZWN0 YW5nbGUgb24gdGhlIGltYWdlIGZvciB0aGUgY3Vyc29yLgorICAgICBEbyB0aGlzIGZvciBhbGwg aW1hZ2VzLCBnZXR0aW5nIHRyYW5zcGFyZW5jeSByaWdodCBpcyBub3QgcmVsaWFibGUuICovCisg IGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUikKKyAgICB7CisgICAgICBpbnQgdGhpY2tuZXNzID0g YWJzIChzLT5pbWctPnJlbGllZik7CisgICAgICBpZiAodGhpY2tuZXNzID09IDApIHRoaWNrbmVz cyA9IDE7CisgICAgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19HTFlQSAorICAgICAgICB8fCBnbHlw aF9mbGF2b3IgPT0gTUNfR0xZUEhMRVNTKQorICAgICAgeworICAgICAgICBOU0NvbG9yICpib3Jk ZXJfY29sb3IgPSBbTlNDb2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiBsc2wucmVkCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3Jl ZW46IGxzbC5ncmVlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBibHVlOiBsc2wuYmx1ZQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscGhhOiAxLjBdOworICAgICAgICBu c19kcmF3X2JveCAoYnIsIHRoaWNrbmVzcywgYm9y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gICAgICAgIHN0cnVjdCBmYWNlICpmYWNlOworICAgICAgICAgIGlmIChzLT5obCA9 PSBEUkFXX01PVVNFX0ZBQ0UpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGZhY2UgPSBG QUNFX0ZST01fSUQgKHMtPmYsIE1PVVNFX0hMX0lORk8gKHMtPmYpLT5tb3VzZV9mYWNlX2ZhY2Vf aWQpOworICAgICAgICAgICAgICBpZiAoIWZhY2UpCisgICAgICAgICAgICAgICAgZmFjZSA9IEZB Q0VfRlJPTV9JRCAocy0+ZiwgTU9VU0VfRkFDRV9JRCk7CisgICAgICAgICAgICB9CisgICAgICAg ICAgICBlbHNlCisgICAgICAgICAgICAgIGZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIHMtPmZp cnN0X2dseXBoLT5mYWNlX2lkKTsKKyAgICAgICAgICBpZiAoIWZhY2UtPnN0aXBwbGUpCisgICAg ICAgICAgICBbKE5TX0ZBQ0VfQkFDS0dST1VORCAoZmFjZSkgIT0gMAorICAgICAgICAgICAgICA/ IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpLCBzLT5m KQorICAgICAgICAgICAgICA6IEZSQU1FX0JBQ0tHUk9VTkRfQ09MT1IgKHMtPmYpKSBzZXRdOwor ICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RydWN0 IG5zX2Rpc3BsYXlfaW5mbyAqZHB5aW5mbyA9IEZSQU1FX0RJU1BMQVlfSU5GTyAocy0+Zik7Cisg ICAgICAgICAgICAgICAgW1tkcHlpbmZvLT5iaXRtYXBzW2ZhY2UtPnN0aXBwbGUtMV0uaW1nIHN0 aXBwbGVNYXNrXSBzZXRdOworICAgICAgICAgICAgICB9CisgICAgICAgICAgaWYgKHMtPmhsICE9 IERSQVdfQ1VSU09SKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzLT5yZWN0YW5nbGVf bnVrZWRfcCA9IHRydWU7CisgICAgICAgICAgICAgIE5TUmVjdCByID0gTlNNYWtlUmVjdCAocy0+ eCwgcy0+eSArIGJveF9saW5lX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgcy0+YmFja2dyb3VuZF93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHMtPmhlaWdodC0yKmJveF9saW5lX3dpZHRoKTsKKyAgICAgICAgICAgICAgTlNSZWN0 RmlsbCAocik7CisgICAgICAgICAgICB9CisgICAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRf cCA9IDE7CisgICAgICAgIH0KKyAgICB9Cit9CisKK3N0YXRpYyB2b2lkCittY19uc19kcmF3X2ds eXBoX3N0cmluZyAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgc3RydWN0IGdseXBoX21hdHJpeCAq bWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywg c3RydWN0IG1jX21hdHJpeCBtY19tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgc3Ry dWN0IG1jX1JHQiBsc2wsIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciwKKyAgICAgICAgICAg ICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlLCBpbnQgd2QsIGJv b2wgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfcCkK Ky8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICBFeHRlcm5hbCAoUklGKTogTWFpbiBkcmF3LXRl eHQgY2FsbC4KKyAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCit7CisgIE5TUmVjdCByWzJdOworICBp bnQgbjsKKyAgY2hhciBib3hfZHJhd25fcCA9IDA7CisgIHN0cnVjdCBmb250ICpmb250ID0gcy0+ ZmFjZS0+Zm9udDsKKyAgaWYgKCFmb250KQorICAgIGZvbnQgPSBGUkFNRV9GT05UIChzLT5mKTsK KyAgTlNUUkFDRV9XSEVOIChOU1RSQUNFX0dST1VQX0dMWVBIUywgIm1jX25zX2RyYXdfZ2x5cGhf c3RyaW5nIik7CisgIGlmIChzLT5uZXh0ICYmIHMtPnJpZ2h0X292ZXJoYW5nICYmICFzLT5mb3Jf b3ZlcmxhcHMpCisgICAgeworICAgICAgaW50IHdpZHRoOworICAgICAgc3RydWN0IGdseXBoX3N0 cmluZyAqbmV4dDsKKyAgICAgIGZvciAod2lkdGggPSAwLCBuZXh0ID0gcy0+bmV4dDsKKyAgICAg ICAgICAgbmV4dCAmJiB3aWR0aCA8IHMtPnJpZ2h0X292ZXJoYW5nOworICAgICAgICAgICB3aWR0 aCArPSBuZXh0LT53aWR0aCwgbmV4dCA9IG5leHQtPm5leHQpCisgICAgICAgIGlmIChuZXh0LT5m aXJzdF9nbHlwaC0+dHlwZSAhPSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICB7CisgICAgICAgICAg ICBpZiAobmV4dC0+Zmlyc3RfZ2x5cGgtPnR5cGUgIT0gU1RSRVRDSF9HTFlQSCkKKyAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVj dCAocy0+bmV4dCwgcik7CisgICAgICAgICAgICAgICAgaWYgKCFuc19jbGlwX3RvX3JlY3QgKHMt PmYsIHIsIG4pKQorICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIG1j X25zX21heWJlX2R1bXBnbHlwaHNfYmFja2dyb3VuZCAocy0+bmV4dCwgMSk7CisgICAgICAgICAg ICAgICAgbnNfcmVzZXRfY2xpcHBpbmcgKHMtPmYpOworICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBtY19uc19kdW1wZ2x5cGhzX3N0cmV0Y2ggKHMt Pm5leHQsIG1hdHJpeCwgcm93LCBtY19tYXRyaXgsIHdkKTsKKyAgICAgICAgICAgIG5leHQtPm51 bV9jbGlwcyA9IDA7CisgICAgICAgICAgfQorICAgIH0KKyAgaWYgKCFzLT5mb3Jfb3ZlcmxhcHMg JiYgcy0+ZmFjZS0+Ym94ICE9IEZBQ0VfTk9fQk9YCisgICAgICAmJiAocy0+Zmlyc3RfZ2x5cGgt PnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgIHx8IHMtPmZpcnN0X2dseXBoLT50eXBlID09 IENPTVBPU0lURV9HTFlQSCkpCisgICAgeworICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdf Y2xpcF9yZWN0IChzLCByKTsKKyAgICAgIGlmICghbnNfY2xpcF90b19yZWN0IChzLT5mLCByLCBu KSkKKyAgICAgICAgcmV0dXJuOworICAgICAgbWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3Jv dW5kIChzLCAxKTsKKyAgICAgIG5zX2R1bXBnbHlwaHNfYm94X29yX3JlbGllZiAocyk7CisgICAg ICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAgICBib3hfZHJhd25fcCA9IDE7CisgICAg fQorICBzd2l0Y2ggKHMtPmZpcnN0X2dseXBoLT50eXBlKQorICAgIHsKKyAgICBjYXNlIElNQUdF X0dMWVBIOgorICAgICAgbiA9IG5zX2dldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCByKTsK KyAgICAgIGlmICghbnNfY2xpcF90b19yZWN0IChzLT5mLCByLCBuKSkKKyAgICAgICAgcmV0dXJu OworICAgICAgbWNfbnNfZHVtcGdseXBoc19pbWFnZSAocywgclswXSwgbHNsLCBnbHlwaF9mbGF2 b3IsIGN1cnNvcl90eXBlLCBhY3RpdmVfcCk7CisgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+ Zik7CisgICAgICBicmVhazsKKyAgICBjYXNlIFNUUkVUQ0hfR0xZUEg6CisgICAgICBtY19uc19k dW1wZ2x5cGhzX3N0cmV0Y2ggKHMsIG1hdHJpeCwgcm93LCBtY19tYXRyaXgsIHdkKTsKKyAgICAg IGJyZWFrOworICAgIGNhc2UgQ0hBUl9HTFlQSDoKKyAgICBjYXNlIENPTVBPU0lURV9HTFlQSDoK KyAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgcik7CisgICAgICBp ZiAoIW5zX2NsaXBfdG9fcmVjdCAocy0+ZiwgciwgbikpCisgICAgICAgIHJldHVybjsKKyAgICAg IGlmIChzLT5mb3Jfb3ZlcmxhcHMKKyAgICAgICAgICB8fCAocy0+Y21wX2Zyb20gPiAwCisgICAg ICAgICAgICAgICYmICEgcy0+Zmlyc3RfZ2x5cGgtPnUuY21wLmF1dG9tYXRpYykpCisgICAgICAg IHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSAxOworICAgICAgICBlbHNlCisgICAgICAgICAgbWNf bnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5kIChzLCBzLT5maXJzdF9nbHlwaC0+dHlwZSA9 PSBDT01QT1NJVEVfR0xZUEgpOworICAgICAgaW50IGZsYWdzID0gKHMtPmhsID09IERSQVdfQ1VS U09SKQorICAgICAgICAgICAgICAgICAgICA/IE5TX0RVTVBHTFlQSF9DVVJTT1IKKyAgICAgICAg ICAgICAgICAgIDogKHMtPmhsID09IERSQVdfTU9VU0VfRkFDRSkKKyAgICAgICAgICAgICAgICAg ICAgPyBOU19EVU1QR0xZUEhfTU9VU0VGQUNFCisgICAgICAgICAgICAgICAgICA6IChzLT5mb3Jf b3ZlcmxhcHMpCisgICAgICAgICAgICAgICAgICAgID8gTlNfRF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19hY3RpdmVfZmFjZSk7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2Ug aWYgKHMtPmhsID09IERSQVdfQ1VSU09SCisgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3R5 cGUgPT0gTUNfRlJBTUVEX0JPWAorICAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9wKQorICAg ICAgICAgICAgeworICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0aXZlX2Zh Y2VfaWQgPQorICAgICAgICAgICAgICAgIGxvb2t1cF9uYW1lZF9mYWNlIChzLT53LCBzLT5mLCBp bnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItaW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7 CisgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9IEZBQ0Vf RlJPTV9JRCAocy0+ZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICBO U19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2UpID0gTlNfRkFDRV9GT1JFR1JPVU5EIChob2xsb3df aW5hY3RpdmVfZmFjZSk7CisgICAgICAgICAgICB9CisgICAgICBpZiAocy0+Zmlyc3RfZ2x5cGgt PnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKQorICAgICAgICBuc19kcmF3X2NvbXBvc2l0ZV9nbHlw aF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7CisgICAg ICAgICAgICBib29sIHdpdGhfYmdfcCA9ICgoZmxhZ3MgPT0gTlNfRFVNUEdMWVBIX05PUk1BTCAm JiAhcy0+YmFja2dyb3VuZF9maWxsZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHx8IGZsYWdzID09IE5TX0RVTVBHTFlQSF9NT1VTRUZBQ0UpOworICAgICAgICAgICAgaWYgKHdp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peCwgcy0+Zmlyc3RfZ2x5cGgpOworICAgICAg aWYgKHMtPmhsID09IERSQVdfQ1VSU09SCisgICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gTUNf RklMTEVEX0JPWCkKKyAgICAgICAgeworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgdG1wID0gTlNf RkFDRV9CQUNLR1JPVU5EIChzLT5mYWNlKTsKKyAgICAgICAgICBOU19GQUNFX0JBQ0tHUk9VTkQg KHMtPmZhY2UpID0gTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKTsKKyAgICAgICAgICBOU19G QUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2UpID0gdG1wOworICAgICAgICB9CisgICAgICAgIGVsc2Ug aWYgKHMtPmhsID09IERSQVdfQ1VSU09SCisgICAgICAgICAgICAgICAgICYmIGN1cnNvcl90eXBl ID09IE1DX0ZSQU1FRF9CT1gpCisgICAgICAgICAgTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNl KSA9IHNhdmVkX2ZnOworICAgICAgbnNfcmVzZXRfY2xpcHBpbmcgKHMtPmYpOworICAgICAgYnJl YWs7CisgICAgY2FzZSBHTFlQSExFU1NfR0xZUEg6CisgICAgICBuID0gbnNfZ2V0X2dseXBoX3N0 cmluZ19jbGlwX3JlY3QgKHMsIHIpOworICAgICAgaWYgKCFuc19jbGlwX3RvX3JlY3QgKHMtPmYs IHIsIG4pKQorICAgICAgICByZXR1cm47CisgICAgICBpZiAocy0+Zm9yX292ZXJsYXBzCisgICAg ICAgICAgfHwgKHMtPmNtcF9mcm9tID4gMAorICAgICAgICAgICAgICAmJiAhIHMtPmZpcnN0X2ds eXBoLT51LmNtcC5hdXRvbWF0aWMpKQorICAgICAgICBzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wID0g MTsKKyAgICAgIGVsc2UKKyAgICAgICAgbWNfbnNfbWF5YmVfZHVtcGdseXBoc19iYWNrZ3JvdW5k IChzLCBzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpOworICAgICAgbnNf cmVzZXRfY2xpcHBpbmcgKHMtPmYpOworICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoKKyAgICAg IGVtYWNzX2Fib3J0ICgpOworICAgIH0KKyAgLyogRHJhdyBib3ggaWYgbm90IGRvbmUgYWxyZWFk eS4gKi8KKyAgaWYgKCFzLT5mb3Jfb3ZlcmxhcHMKKyAgICAgICYmICFib3hfZHJhd25fcAorICAg ICAgJiYgcy0+ZmFjZS0+Ym94ICE9IEZBQ0VfTk9fQk9YKQorICAgIHsKKyAgICAgIG4gPSBuc19n ZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgcik7CisgICAgICBpZiAoIW5zX2NsaXBfdG9f cmVjdCAocy0+ZiwgciwgbikpCisgICAgICAgIHJldHVybjsKKyAgICAgIG5zX2R1bXBnbHlwaHNf Ym94X29yX3JlbGllZiAocyk7CisgICAgICBuc19yZXNldF9jbGlwcGluZyAocy0+Zik7CisgICAg fQorICBzLT5udW1fY2xpcHMgPSAwOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogLyogPT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KIAogICAg TlNUUkFDRSwgVHJhY2Ugc3VwcG9ydC4KQEAgLTEwNzksNiArMjA1MiwxNiBAQCBzdGF0aWMgTlNS ZWN0IGNvbnN0cmFpbl9mcmFtZV9yZWN0KE5TUmVjdCBmcmFtZVJlY3QsIGJvb2wgaXNGdWxsc2Ny ZWVuKQogICAgZXh0ZXJuYWwgKFJJRikgY2FsbDsgd2hvbGUgZnJhbWUsIGNhbGxlZCBiZWZvcmUg Z3VpX3VwZGF0ZV93aW5kb3dfYmVnaW4KICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCiB7CisKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZi0+ bWNfdXBkYXRpbmdfZnJhbWUgPSBmOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAj aWZkZWYgTlNfSU1QTF9DT0NPQQogICBFbWFjc1ZpZXcgKnZpZXcgPSBGUkFNRV9OU19WSUVXIChm KTsKIApAQCAtMTEwOSw2ICsyMDkyLDE2IEBAIHN0YXRpYyBOU1JlY3QgY29uc3RyYWluX2ZyYW1l X3JlY3QoTlNSZWN0IGZyYW1lUmVjdCwgYm9vbCBpc0Z1bGxzY3JlZW4pCiAKIC8qICAgaWYgKGYg PT0gTU9VU0VfSExfSU5GTyAoZiktPm1vdXNlX2ZhY2VfbW91c2VfZnJhbWUpICovCiAgIE1PVVNF X0hMX0lORk8gKGYpLT5tb3VzZV9mYWNlX2RlZmVyID0gMDsKKworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGluZ19mcmFt ZSA9IE5VTEw7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIH0KIAogCkBAIC00NzU5 LDYgKzU3NTIsMTcgQEAgaW4gY2VydGFpbiBzaXR1YXRpb25zIChyYXBpZCBpbmNvbWluZyBldmVu dHMpLgogICAgICAgYmFyID0gW1tFbWFjc1Njcm9sbGVyIGFsbG9jXSBpbml0RnJhbWU6IHIgd2lu ZG93OiB3aW5dOwogICAgICAgd3NldF92ZXJ0aWNhbF9zY3JvbGxfYmFyICh3aW5kb3csIG1ha2Vf bWludF9wdHIgKGJhcikpOwogICAgICAgdXBkYXRlX3AgPSBZRVM7CisKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIC8qIFRoaXMgaXMg b25seSBmb3IgZGVidWdnaW5nIHB1cnBvc2VzLiAqLworICAgICAgW2JhciBtY19zZXRfcmVjdGFu Z2xlOiByXTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgIH0KICAgZWxzZQog ICAgIHsKQEAgLTQ3NjYsMTIgKzU3NzAsMzAgQEAgaW4gY2VydGFpbiBzaXR1YXRpb25zIChyYXBp ZCBpbmNvbWluZyBldmVudHMpLgogICAgICAgYmFyID0gWE5TX1NDUk9MTF9CQVIgKHdpbmRvdy0+ dmVydGljYWxfc2Nyb2xsX2Jhcik7CiAgICAgICBvbGRSZWN0ID0gW2JhciBmcmFtZV07CiAgICAg ICByLnNpemUud2lkdGggPSBvbGRSZWN0LnNpemUud2lkdGg7CisKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgICAgIGlmIChGUkFNRV9MSVZF X1AgKGYpICYmICFOU0VxdWFsUmVjdHMgKG9sZFJlY3QsIHIpKQogICAgICAgICB7CisgICAgICAg ICAgLyogVGhlIG1haW4gd2luZG93IGhhcyBwcm9iYWJseSBiZWVuIHJlc2l6ZWQuICBHcmFjaW91 c2x5IGRlbGV0ZSB0aGUKKyAgICAgICAgICBvbGQgc2Nyb2xsIGJhciB3aXRob3V0IHJlcGFpbnRp bmcgaXRzIHJlY3RhbmdsZTsgYW5kLCBjcmVhdGUgYSBuZXcKKyAgICAgICAgICBzY3JvbGwgYmFy IGVsc2V3aGVyZS4qLwogICAgICAgICAgIGlmIChvbGRSZWN0Lm9yaWdpbi54ICE9IHIub3JpZ2lu LngpCisgICAgICAgICAgICB7CiAgICAgICAgICAgICAgIG5zX2NsZWFyX2ZyYW1lX2FyZWEgKGYs IGxlZnQsIHRvcCwgd2lkdGgsIGhlaWdodCk7CisgICAgICAgICAgICAgIFtiYXIgbWNfanVkZ2Vd OworICAgICAgICAgICAgICBiYXIgPSBbW0VtYWNzU2Nyb2xsZXIgYWxsb2NdIGluaXRGcmFtZTog ciB3aW5kb3c6IHdpbl07CisgICAgICAgICAgICAgIHdzZXRfdmVydGljYWxfc2Nyb2xsX2JhciAo d2luZG93LCBtYWtlX21pbnRfcHRyIChiYXIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAg IGVsc2UKICAgICAgICAgICBbYmFyIHNldEZyYW1lOiByXTsKICAgICAgICAgfQorCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKworCiAgICAgfQogCiAgIGlmICh1cGRhdGVfcCkKQEAgLTQ5MzEs OSArNTk1Myw1NyBAQCBpbiBjZXJ0YWluIHNpdHVhdGlvbnMgKHJhcGlkIGluY29taW5nIGV2ZW50 cykuCiAgICAgewogICAgICAgdmlldyA9IFtzdWJ2aWV3cyBvYmplY3RBdEluZGV4OiBpXTsKICAg ICAgIGlmICghW3ZpZXcgaXNLaW5kT2ZDbGFzczogW0VtYWNzU2Nyb2xsZXIgY2xhc3NdXSkgY29u dGludWU7Ci0gICAgICBpZiAoW3ZpZXcganVkZ2VdKQorCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8qIGBYU0VUV0lORE9XJyB3aWxsIHNv bWV0aW1lcyBjYXVzZSBFbWFjcyB0byBjcmFzaCB3aGVuIHJ1bm5pbmcgdW5kZXIgZ2RiIGV2ZW4K KyAgdGhvdWdoICh3ICE9IE5VTEwpLiAgVGhlcmVmb3JlLCB3ZSBjYW5ub3QgcmVsaWFibHkgdXNl IGBXSU5ET1dfTElWRV9QJy4gKi8KKyAgc3RydWN0IHdpbmRvdyAqdyA9IFt2aWV3IG1jX2dldF93 aW5kb3ddOworICBpZiAodyAhPSBOVUxMCisgICAgICAmJiBOSUxQICh3LT5jb250ZW50cykpCisg ICAgeworICAgICAgQk9PTCBkZWJ1Z19wID0gZmFsc2U7CisgICAgICBpZiAoZGVidWdfcAorICAg ICAgICAgIC8qIGB3aW5kb3dfYm94JyBjYWxscyBgd2luZG93X2JveF9oZWlnaHQnLCB3aGljaCB3 aWxsIGNhdXNlIEVtYWNzIHRvCisgICAgICAgICAgY3Jhc2ggaWYgRlJBTUVQICh3LT5mcmFtZSkg aXMgbm90IHNhdGlzZmllZC4gKi8KKyAgICAgICAgICAmJiBGUkFNRVAgKHctPmZyYW1lKSkKKyAg ICAgICAgeworICAgICAgICAgIE5TUmVjdCByMCA9IFt2aWV3IG1jX2dldF9yZWN0YW5nbGVdOwor ICAgICAgICAgIGludCB4MCA9IE5TTWluWCAocjApOworICAgICAgICAgIGludCB5MCA9IE5TTWlu WSAocjApOworICAgICAgICAgIGludCB3ZDAgPSBOU1dpZHRoIChyMCk7CisgICAgICAgICAgaW50 IGgwID0gTlNIZWlnaHQgKHIwKTsKKyAgICAgICAgICBpbnQgd2luZG93X3ksIHdpbmRvd19oZWln aHQ7CisgICAgICAgICAgd2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AgICAgIG1j X3dpbmRvdyAodyksIHgwLCB4MSwgeTAsIHkxLCB3ZDAsIHdkMSwgaDAsIGgxKTsKKyAgICAgICAg fQorICAgICAgaWYgKFt2aWV3IG1jX2p1ZGdlXSkKICAgICAgICAgcmVtb3ZlZCA9IFlFUzsKICAg ICB9CisgICAgZWxzZSBpZiAoW3ZpZXcganVkZ2VdKQorICAgICAgcmVtb3ZlZCA9IFlFUzsKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKworICAgIH0KIAogICBpZiAocmVtb3ZlZCkKICAg ICBbZXZpZXcgdXBkYXRlRnJhbWVTaXplOiBOT107CkBAIC01MDc0LDYgKzYxNDQsMjAgQEAgc3Rh dGljIExpc3BfT2JqZWN0IG5zX3N0cmluZ190b19saXNwbW9kIChjb25zdCBjaGFyICpzKQogZXh0 ZXJuIGZyYW1lX3Bhcm1faGFuZGxlciBuc19mcmFtZV9wYXJtX2hhbmRsZXJzW107CiBzdGF0aWMg c3RydWN0IHJlZGlzcGxheV9pbnRlcmZhY2UgbnNfcmVkaXNwbGF5X2ludGVyZmFjZSA9CiB7CisK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8q IGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgbnN0ZXJtLm1gIG11c3QgYmUgaW4gdGhlIGV4YWN0 IHNhbWUgb3JkZXIgYXMgdGhlCitgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYGRpc3BleHRlcm4u aGAhICovCisKKyAgbWNfbnNfZHJhd193aW5kb3dfY3Vyc29yLAorICBtY19uc19kcmF3X2dseXBo X3N0cmluZywKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICBuc19mcmFtZV9wYXJt X2hhbmRsZXJzLAogICBndWlfcHJvZHVjZV9nbHlwaHMsCiAgIGd1aV93cml0ZV9nbHlwaHMsCkBA IC04NzExLDYgKzk3OTUsNDkgQEAgLSAoQk9PTCljYW5CZWNvbWVNYWluV2luZG93CiAKIEBpbXBs ZW1lbnRhdGlvbiBFbWFjc1Njcm9sbGVyCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisv KiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy0gKHZvaWQpbWNfc2V0X3JlY3RhbmdsZTogKE5TUmVj dClyZWN0Cit7CisgIG1jX3JlY3RhbmdsZSA9IHJlY3Q7Cit9CisKKy0gKE5TUmVjdCltY19nZXRf cmVjdGFuZ2xlCit7CisgIHJldHVybiBtY19yZWN0YW5nbGU7Cit9CisKKy0gKHN0cnVjdCB3aW5k b3cgKiltY19nZXRfd2luZG93Cit7CisgIHJldHVybiB3aW5kb3c7Cit9CisKKy0gKGJvb2wpbWNf anVkZ2UKK3sKKyAgTlNUUkFDRSAoIltFbWFjc1Njcm9sbGVyIG1jX2p1ZGdlXSIpOworICBib29s IHJldCA9IGNvbmRlbW5lZDsKKyAgYmxvY2tfaW5wdXQgKCk7CisgIGlmIChjb25kZW1uZWQpCisg ICAgeworICAgICAgLyogZW5zdXJlIG90aGVyIHNjcm9sbGJhciB1cGRhdGVzIGFmdGVyIGRlbGV0 aW9uICovCisgICAgICBFbWFjc1ZpZXcgKnZpZXcgPSAoRW1hY3NWaWV3ICopRlJBTUVfTlNfVklF VyAoZnJhbWUpOworICAgICAgaWYgKHZpZXcgIT0gbmlsKQorICAgICAgICB2aWV3LT5zY3JvbGxi YXJzTmVlZGluZ1VwZGF0ZSsrOworICAgIH0KKyAgaWYgKHdpbmRvdykKKyAgICB3c2V0X3ZlcnRp Y2FsX3Njcm9sbF9iYXIgKHdpbmRvdywgUW5pbCk7CisgIHdpbmRvdyA9IDA7CisgIFtzZWxmIHJl bW92ZUZyb21TdXBlcnZpZXdXaXRob3V0TmVlZGluZ0Rpc3BsYXldOworICBbc2VsZiByZWxlYXNl XTsKKyAgdW5ibG9ja19pbnB1dCAoKTsKKyAgcmV0dXJuIHJldDsKK30KKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisKKwogLyogZm9yIHJlcGVhdCBidXR0b24gcHVzaCAqLwogI2RlZmluZSBT Q1JPTExfQkFSX0ZJUlNUX0RFTEFZIDAuNQogI2RlZmluZSBTQ1JPTExfQkFSX0NPTlRJTlVPVVNf REVMQVkgKDEuMCAvIDE1KQpkaWZmIC0tZ2l0IGEvc3JjL3czMnRlcm0uYyBiL3NyYy93MzJ0ZXJt LmMKaW5kZXggYzZlMTc1ZS4uZmExMTVjMCAxMDA2NDQKLS0tIGEvc3JjL3czMnRlcm0uYworKysg Yi9zcmMvdzMydGVybS5jCkBAIC02Miw2ICs2MiwxMTY4IEBAIGFsb25nIHdpdGggR05VIEVtYWNz LiAgSWYgbm90LCBzZWUgPGh0dHBzOi8vd3d3LmdudS5vcmcvbGljZW5zZXMvPi4gICovCiAjaW5j bHVkZSAiYml0bWFwcy9ncmF5LnhibSIKICNlbmRpZgogDAorCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogYmVnaW4gTVVMVElQTEUtQ1VSU09SUyAqLworCit0eXBlZGVmIHN0cnVjdCB7 CisgIHVuc2lnbmVkIGxvbmcgcGl4ZWw7CisgIHVuc2lnbmVkIHNob3J0IHJlZCwgZ3JlZW4sIGJs dWU7CisgIGNoYXIgZmxhZ3M7CisgIGNoYXIgcGFkOworfSBtY19YQ29sb3I7CisKKyNpZmR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VRIChmbGFnLCBRa2lsbF9lbWFjcykpCisgICAgRmtpbGxfZW1hY3MgKFFuaWwpOwor ICBpZiAoRVEgKFZ0aHJvd19vbl9pbnB1dCwgZmxhZykpCisgICAgRnRocm93IChWdGhyb3dfb25f aW5wdXQsIFF0KTsKKyAgRnNpZ25hbCAoUXF1aXQsIFFuaWwpOworfQorCisjZGVmaW5lIE1DX1FV SVQJCQkJCQlcCisgIGRvIHsJCQkJCQkJXAorICAgIGlmICghTklMUCAoVnF1aXRfZmxhZykgJiYg TklMUCAoVmluaGliaXRfcXVpdCkpCVwKKyAgICAgIG1jX3Byb2Nlc3NfcXVpdF9mbGFnICgpOwkJ CQlcCisgICAgZWxzZSBpZiAocGVuZGluZ19zaWduYWxzKQkJCQlcCisgICAgICBwcm9jZXNzX3Bl bmRpbmdfc2lnbmFscyAoKTsJCQlcCisgIH0gd2hpbGUgKGZhbHNlKQorCitzdGF0aWMgTGlzcF9P YmplY3QKK21jX3czMl9jb2xvcl9tYXBfbG9va3VwIChjb25zdCBjaGFyICpjb2xvcm5hbWUpCit7 CisgIExpc3BfT2JqZWN0IHRhaWwsIHJldCA9IFFuaWw7CisgIGJsb2NrX2lucHV0ICgpOworICBm b3IgKHRhaWwgPSBWdzMyX2NvbG9yX21hcDsgQ09OU1AgKHRhaWwpOyB0YWlsID0gWENEUiAodGFp bCkpCisgICAgeworICAgICAgcmVnaXN0ZXIgTGlzcF9PYmplY3QgZWx0LCB0ZW07CisgICAgICBl bHQgPSBYQ0FSICh0YWlsKTsKKyAgICAgIGlmICghQ09OU1AgKGVsdCkpIGNvbnRpbnVlOworICAg ICAgdGVtID0gWENBUiAoZWx0KTsKKyAgICAgIGlmIChsc3RyY21waSAoU1NEQVRBICh0ZW0pLCBj b2xvcm5hbWUpID09IDApCisgICAgICAgIHsKKyAgICAgICAgICByZXQgPSBGY2RyIChlbHQpOwor ICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBNQ19RVUlUOworICAgIH0KKyAgdW5i bG9ja19pbnB1dCAoKTsKKyAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIExpc3BfT2JqZWN0Citt Y194X3RvX3czMl9jb2xvciAoY29uc3QgY2hhciAqIGNvbG9ybmFtZSkKK3sKKyAgcmVnaXN0ZXIg TGlzcF9PYmplY3QgcmV0ID0gUW5pbDsKKyAgYmxvY2tfaW5wdXQgKCk7CisgIGlmIChjb2xvcm5h bWVbMF0gPT0gJyMnKQorICAgIHsKKyAgICAgIC8qIENvdWxkIGJlIGFuIG9sZC1zdHlsZSBSR0Ig RGV2aWNlIHNwZWNpZmljYXRpb24uICovCisgICAgICBpbnQgc2l6ZSA9IHN0cmxlbiAoY29sb3Ju YW1lICsgMSk7CisgICAgICBjaGFyICpjb2xvciA9IGFsbG9jYSAoc2l6ZSArIDEpOworICAgICAg c3RyY3B5IChjb2xvciwgY29sb3JuYW1lICsgMSk7CisgICAgICBpZiAoc2l6ZSA9PSAzIHx8IHNp emUgPT0gNiB8fCBzaXplID09IDkgfHwgc2l6ZSA9PSAxMikKKyAgICAgICAgeworICAgICAgICAg IFVJTlQgY29sb3J2YWw7CisgICAgICAgICAgaW50IGksIHBvczsKKyAgICAgICAgICBwb3MgPSAw OworICAgICAgICAgIHNpemUgLz0gMzsKKyAgICAgICAgICBjb2xvcnZhbCA9IDA7CisgICAgICAg ICAgZm9yIChpID0gMDsgaSA8IDM7IGkrKykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg Y2hhciAqZW5kOworICAgICAgICAgICAgICBjaGFyIHQ7CisgICAgICAgICAgICAgIHVuc2lnbmVk IGxvbmcgdmFsdWU7CisgICAgICAgICAgICAgIC8qIFRoZSBjaGVjayBmb3IgJ3gnIGluIHRoZSBm b2xsb3dpbmcgY29uZGl0aW9uYWwgdGFrZXMgaW50bworICAgICAgICAgICAgICBhY2NvdW50IHRo ZSBmYWN0IHRoYXQgc3RydG9sIGFsbG93cyBhICIweCIgaW4gZnJvbnQgb2YKKyAgICAgICAgICAg ICAgb3VyIG51bWJlcnMsIGFuZCB3ZSBkb24ndC4gKi8KKyAgICAgICAgICAgICAgaWYgKCFpc3hk aWdpdCAoY29sb3JbMF0pIHx8IGNvbG9yWzFdID09ICd4JykKKyAgICAgICAgICAgICAgICBicmVh azsKKyAgICAgICAgICAgICAgdCA9IGNvbG9yW3NpemVdOworICAgICAgICAgICAgICBjb2xvcltz aXplXSA9ICdcMCc7CisgICAgICAgICAgICAgIHZhbHVlID0gc3RydG91bCAoY29sb3IsICZlbmQs IDE2KTsKKyAgICAgICAgICAgICAgY29sb3Jbc2l6ZV0gPSB0OworICAgICAgICAgICAgICBpZiAo ZXJybm8gPT0gRVJBTkdFIHx8IGVuZCAtIGNvbG9yICE9IHNpemUpCisgICAgICAgICAgICAgICAg YnJlYWs7CisgICAgICAgICAgICAgIHN3aXRjaCAoc2l6ZSkKKyAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgY2FzZSAxOgorICAgICAgICAgICAgICAgICAgdmFsdWUgPSB2YWx1ZSAq IDB4MTA7CisgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIDI6 CisgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIDM6CisgICAg ICAgICAgICAgICAgICB2YWx1ZSAvPSAweDEwOworICAgICAgICAgICAgICAgICAgYnJlYWs7Cisg ICAgICAgICAgICAgICAgY2FzZSA0OgorICAgICAgICAgICAgICAgICAgdmFsdWUgLz0gMHgxMDA7 CisgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAg ICAgIGNvbG9ydmFsIHw9ICh2YWx1ZSA8PCBwb3MpOworICAgICAgICAgICAgICBwb3MgKz0gMHg4 OworICAgICAgICAgICAgICBpZiAoaSA9PSAyKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgICAgICAgICBYU0VUSU5UIChy ZXQsIGNvbG9ydmFsKTsKKyAgICAgICAgICAgICAgICAgIHJldHVybiByZXQ7CisgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgICBjb2xvciA9IGVuZDsKKyAgICAgICAgICAgIH0KKyAgICAg ICAgfQorICAgIH0KKyAgZWxzZSBpZiAoc3RybmljbXAgKGNvbG9ybmFtZSwgInJnYjoiLCA0KSA9 PSAwKQorICAgIHsKKyAgICAgIGNvbnN0IGNoYXIgKmNvbG9yOworICAgICAgVUlOVCBjb2xvcnZh bDsKKyAgICAgIGludCBpLCBwb3M7CisgICAgICBwb3MgPSAwOworICAgICAgY29sb3J2YWwgPSAw OworICAgICAgY29sb3IgPSBjb2xvcm5hbWUgKyA0OworICAgICAgZm9yIChpID0gMDsgaSA8IDM7 IGkrKykKKyAgICAgICAgeworICAgICAgICAgIGNoYXIgKmVuZDsKKyAgICAgICAgICB1bnNpZ25l ZCBsb25nIHZhbHVlOworICAgICAgICAgIC8qIFRoZSBjaGVjayBmb3IgJ3gnIGluIHRoZSBmb2xs b3dpbmcgY29uZGl0aW9uYWwgdGFrZXMgaW50bworICAgICAgICAgICAgIGFjY291bnQgdGhlIGZh Y3QgdGhhdCBzdHJ0b2wgYWxsb3dzIGEgIjB4IiBpbiBmcm9udCBvZgorICAgICAgICAgICAgIG91 ciBudW1iZXJzLCBhbmQgd2UgZG9uJ3QuICovCisgICAgICAgICAgaWYgKCFpc3hkaWdpdCAoY29s b3JbMF0pIHx8IGNvbG9yWzFdID09ICd4JykKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAg IHZhbHVlID0gc3RydG91bCAoY29sb3IsICZlbmQsIDE2KTsKKyAgICAgICAgICBpZiAoZXJybm8g PT0gRVJBTkdFKQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgc3dpdGNoIChlbmQgLSBj b2xvcikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgIGNhc2UgMToKKyAgICAgICAgICAgICAg dmFsdWUgPSB2YWx1ZSAqIDB4MTAgKyB2YWx1ZTsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAg ICAgICAgICBjYXNlIDI6CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSAz OgorICAgICAgICAgICAgICB2YWx1ZSAvPSAweDEwOworICAgICAgICAgICAgICBicmVhazsKKyAg ICAgICAgICAgIGNhc2UgNDoKKyAgICAgICAgICAgICAgdmFsdWUgLz0gMHgxMDA7CisgICAgICAg ICAgICAgIGJyZWFrOworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgdmFsdWUg PSBVTE9OR19NQVg7CisgICAgICAgICAgICB9CisgICAgICAgICAgaWYgKHZhbHVlID09IFVMT05H X01BWCkKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIGNvbG9ydmFsIHw9ICh2YWx1ZSA8 PCBwb3MpOworICAgICAgICAgIHBvcyArPSAweDg7CisgICAgICAgICAgaWYgKGkgPT0gMikKKyAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKCplbmQgIT0gJ1wwJykKKyAgICAgICAgICAg ICAgICBicmVhazsKKyAgICAgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAg ICAgWFNFVElOVCAocmV0LCBjb2xvcnZhbCk7CisgICAgICAgICAgICAgIHJldHVybiByZXQ7Cisg ICAgICAgICAgICB9CisgICAgICAgICAgaWYgKCplbmQgIT0gJy8nKQorICAgICAgICAgICAgYnJl YWs7CisgICAgICAgICAgY29sb3IgPSBlbmQgKyAxOworICAgICAgICB9CisgICAgfQorICAgIGVs c2UgaWYgKHN0cm5pY21wIChjb2xvcm5hbWUsICJyZ2JpOiIsIDUpID09IDApCisgICAgICB7Cisg ICAgICAgIC8qIFRoaXMgaXMgYW4gUkdCIEludGVuc2l0eSBzcGVjaWZpY2F0aW9uLiAqLworICAg ICAgICBjb25zdCBjaGFyICpjb2xvcjsKKyAgICAgICAgVUlOVCBjb2xvcnZhbDsKKyAgICAgICAg aW50IGksIHBvczsKKyAgICAgICAgcG9zID0gMDsKKyAgICAgICAgY29sb3J2YWwgPSAwOworICAg ICAgICBjb2xvciA9IGNvbG9ybmFtZSArIDU7CisgICAgICAgIGZvciAoaSA9IDA7IGkgPCAzOyBp KyspCisgICAgICAgICAgeworICAgICAgICAgICAgY2hhciAqZW5kOworICAgICAgICAgICAgZG91 YmxlIHZhbHVlOworICAgICAgICAgICAgVUlOVCB2YWw7CisgICAgICAgICAgICB2YWx1ZSA9IHN0 cnRvZCAoY29sb3IsICZlbmQpOworICAgICAgICAgICAgaWYgKGVycm5vID09IEVSQU5HRSkKKyAg ICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBpZiAodmFsdWUgPCAwLjAgfHwgdmFsdWUg PiAxLjApCisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgdmFsID0gKFVJTlQpKDB4 MTAwICogdmFsdWUpOworICAgICAgICAgICAgLyogV2UgdXNlZCAweDEwMCBpbnN0ZWFkIG9mIDB4 RkYgdG8gZ2l2ZSBhIGNvbnRpbnVvdXMKKyAgICAgICAgICAgICAgIHJhbmdlIGJldHdlZW4gMC4w IGFuZCAxLjAgaW5jbHVzaXZlLiAgVGhlIG5leHQgc3RhdGVtZW50CisgICAgICAgICAgICAgICBm aXhlcyB0aGUgMS4wIGNhc2UuICovCisgICAgICAgICAgICBpZiAodmFsID09IDB4MTAwKQorICAg ICAgICAgICAgICB2YWwgPSAweEZGOworICAgICAgICAgICAgY29sb3J2YWwgfD0gKHZhbCA8PCBw b3MpOworICAgICAgICAgICAgcG9zICs9IDB4ODsKKyAgICAgICAgICAgIGlmIChpID09IDIpCisg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoKmVuZCAhPSAnXDAnKQorICAgICAg ICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAg ICAgICAgICAgICAgICBYU0VUSU5UIChyZXQsIGNvbG9ydmFsKTsKKyAgICAgICAgICAgICAgICBy ZXR1cm4gcmV0OworICAgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoKmVuZCAhPSAnLycp CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY29sb3IgPSBlbmQgKyAxOworICAg ICAgICAgIH0KKyAgICAgIH0KKyAgLyogSSBhbSBub3QgZ29pbmcgdG8gYXR0ZW1wdCB0byBoYW5k bGUgYW55IG9mIHRoZSBDSUUgY29sb3Igc2NoZW1lcworICAgICBvciBUZWtIVkMsIHNpbmNlIEkg ZG9uJ3Qga25vdyB0aGUgYWxnb3JpdGhtcyBmb3IgY29udmVyc2lvbiB0byBSR0IuCisgICAgIElm IHdlIGZhaWwgdG8gbG9va3VwIHRoZSBjb2xvciBuYW1lIGluIHczMl9jb2xvcl9tYXAsIHRoZW4g Y2hlY2sgdGhlCisgICAgIGNvbG9ybmFtZSB0byBzZWUgaWYgaXQgY2FuIGJlIGNydWRlbHkgYXBw cm94aW1hdGVkOiBJZiB0aGUgWCBjb2xvcgorICAgICBlbmRzIGluIGEgbnVtYmVyIChlLmcuLCAi ZGFya3NlYWdyZWVuMiIpLCBzdHJpcCB0aGUgbnVtYmVyIGFuZAorICAgICByZXR1cm4gdGhlIHJl c3VsdCBvZiBsb29raW5nIHVwIHRoZSBiYXNlIGNvbG9yIG5hbWUuICovCisgIHJldCA9IG1jX3cz Ml9jb2xvcl9tYXBfbG9va3VwIChjb2xvcm5hbWUpOworICBpZiAoTklMUCAocmV0KSkKKyAgICB7 CisgICAgICBpbnQgbGVuID0gc3RybGVuIChjb2xvcm5hbWUpOworICAgICAgaWYgKGlzZGlnaXQg KGNvbG9ybmFtZVtsZW4gLSAxXSkpCisgICAgICAgIHsKKyAgICAgICAgICBjaGFyICpwdHIsICph cHByb3ggPSBhbGxvY2EgKGxlbiArIDEpOworICAgICAgICAgIHN0cmNweSAoYXBwcm94LCBjb2xv cm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h0ZW0sIHczMl9jb2xvcl9yZWYpOworICAg ICAgICB9CisgICAgICAvKiBNYXAgdGhpcyBjb2xvciB0byB0aGUgcGFsZXR0ZSBpZiBpdCBpcyBl bmFibGVkLiAqLworICAgICAgaWYgKCFOSUxQIChWdzMyX2VuYWJsZV9wYWxldHRlKSkKKyAgICAg ICAgeworICAgICAgICAgIHN0cnVjdCB3MzJfcGFsZXR0ZV9lbnRyeSAqIGVudHJ5ID0gb25lX3cz Ml9kaXNwbGF5X2luZm8uY29sb3JfbGlzdDsKKyAgICAgICAgICBzdHJ1Y3QgdzMyX3BhbGV0dGVf ZW50cnkgKiogcHJldiA9ICZvbmVfdzMyX2Rpc3BsYXlfaW5mby5jb2xvcl9saXN0OworICAgICAg ICAgIC8qIGNoZWNrIGlmIGNvbG9yIGlzIGFscmVhZHkgbWFwcGVkICovCisgICAgICAgICAgd2hp bGUgKGVudHJ5KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAoTUNfVzMyX0NPTE9S IChlbnRyeS0+ZW50cnkpID09IFhVRklYTlVNX1JBVyAodGVtKSkKKyAgICAgICAgICAgICAgICBi cmVhazsKKyAgICAgICAgICAgICAgcHJldiA9ICZlbnRyeS0+bmV4dDsKKyAgICAgICAgICAgICAg ZW50cnkgPSBlbnRyeS0+bmV4dDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBpZiAoZW50cnkg PT0gTlVMTCAmJiBhbGxvY19wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBub3Qg YWxyZWFkeSBtYXBwZWQsIHNvIGFkZCB0byBsaXN0ICovCisgICAgICAgICAgICAgIGVudHJ5ID0g eG1hbGxvYyAoc2l6ZW9mIChzdHJ1Y3QgdzMyX3BhbGV0dGVfZW50cnkpKTsKKyAgICAgICAgICAg ICAgTUNfVzMyX1NFVF9DT0xPUiAoZW50cnktPmVudHJ5LCBYVUZJWE5VTV9SQVcgKHRlbSkpOwor ICAgICAgICAgICAgICBlbnRyeS0+bmV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KQorICAgIHsKKyAgICAgIC8qIElmIGB4LXN0cmV0Y2gtY3Vyc29y JyBpcyBuaWwsIGRvbid0IGRyYXcgYSBibG9jayBjdXJzb3IgYXMgd2lkZSBhcyB0aGUKKyAgICAg IHN0cmV0Y2ggZ2x5cGguICovCisgICAgICBpbnQgd2lkdGgsIGJhY2tncm91bmRfd2lkdGggPSBz LT5iYWNrZ3JvdW5kX3dpZHRoOworICAgICAgaW50IHggPSBzLT54OworICAgICAgaWYgKCFzLT5y b3ctPnJldmVyc2VkX3ApCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgbGVmdF94ID0gd2luZG93 X2JveF9sZWZ0X29mZnNldCAocy0+dywgVEVYVF9BUkVBKTsKKyAgICAgICAgICBpZiAoeCA8IGxl ZnRfeCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgYmFja2dyb3VuZF93aWR0aCAtPSBs ZWZ0X3ggLSB4OworICAgICAgICAgICAgICB4ID0gbGVmdF94OworICAgICAgICAgICAgfQorICAg ICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgIHsKKyAgICAgICAgICAgLyogSW4gUjJMIHJv d3MsIGRyYXcgdGhlIGN1cnNvciBvbiB0aGUgcmlnaHQgZWRnZSBvZiB0aGUKKyAgICAgICAgICAg ICAgc3RyZXRjaCBnbHlwaC4gKi8KKyAgICAgICAgICAgaW50IHJpZ2h0X3ggPSB3aW5kb3dfYm94 X3JpZ2h0IChzLT53LCBURVhUX0FSRUEpOworICAgICAgICAgICBpZiAoeCArIGJhY2tncm91bmRf d2lkdGggPiByaWdodF94KQorICAgICAgICAgICAgIGJhY2tncm91bmRfd2lkdGggLT0geCAtIHJp Z2h0X3g7CisgICAgICAgICAgIHggKz0gYmFja2dyb3VuZF93aWR0aDsKKyAgICAgICAgIH0KKyAg ICAgIHdpZHRoID0gbWluIChGUkFNRV9DT0xVTU5fV0lEVEggKHMtPmYpLCBiYWNrZ3JvdW5kX3dp ZHRoKTsKKyAgICAgIGlmIChzLT5yb3ctPnJldmVyc2VkX3ApCisgICAgICAgIHggLT0gd2lkdGg7 CisgICAgICAvKiBEcmF3IGN1cnNvci4gKi8KKyAgICAgIHczMl9kcmF3X2dseXBoX3N0cmluZ19i Z19yZWN0IChzLCB4LCBzLT55LCB3aWR0aCwgcy0+aGVpZ2h0KTsKKyAgICAgIC8qIENsZWFyIHJl c3QgdXNpbmcgdGhlIEdDIG9mIHRoZSBvcmlnaW5hbCBub24tY3Vyc29yIGZhY2UuICovCisgICAg ICBpZiAod2lkdGggPCBiYWNrZ3JvdW5kX3dpZHRoKQorICAgICAgICB7CisgICAgICAgICAgRW1h Y3NfR0MgKmdjID0gcy0+ZmFjZS0+Z2M7CisgICAgICAgICAgaW50IHkgPSBzLT55OworICAgICAg ICAgIGludCB3ID0gYmFja2dyb3VuZF93aWR0aCAtIHdpZHRoLCBoID0gcy0+aGVpZ2h0OworICAg ICAgICAgIFJFQ1QgcjsKKyAgICAgICAgICBIREMgaGRjID0gcy0+aGRjOworICAgICAgICAgIGlm ICghcy0+cm93LT5yZXZlcnNlZF9wKQorICAgICAgICAgICAgeCArPSB3aWR0aDsKKyAgICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgICAgeCA9IHMtPng7CisgICAgICAgICAgaWYgKHMtPnJvdy0+ bW91c2VfZmFjZV9wCisgICAgICAgICAgICAgICYmIGN1cnNvcl9pbl9tb3VzZV9mYWNlX3AgKHMt PncpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICB3MzJfc2V0X21vdXNlX2ZhY2VfZ2Mg KHMpOworICAgICAgICAgICAgICBnYyA9IHMtPmdjOworICAgICAgICAgICAgfQorICAgICAgICAg ICAgZWxzZQorICAgICAgICAgICAgICBnYyA9IHMtPmZhY2UtPmdjOworICAgICAgICAgIGdldF9n bHlwaF9zdHJpbmdfY2xpcF9yZWN0IChzLCAmcik7CisgICAgICAgICAgdzMyX3NldF9jbGlwX3Jl Y3RhbmdsZSAoaGRjLCAmcik7CisjaWYgMCAvKiBUT0RPOiBzdGlwcGxlICovCisgICAgICAgICAg aWYgKHMtPmZhY2UtPnN0aXBwbGUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIC8qIEZp bGwgYmFja2dyb3VuZCB3aXRoIGEgc3RpcHBsZSBwYXR0ZXJuLiAqLworICAgICAgICAgICAgICBY U2V0RmlsbFN0eWxlIChzLT5kaXNwbGF5LCBnYywgRmlsbE9wYXF1ZVN0aXBwbGVkKTsKKyAgICAg ICAgICAgICAgWEZpbGxSZWN0YW5nbGUgKHMtPmRpc3BsYXksIHMtPndpbmRvdywgZ2MsIHgsIHks IHcsIGgpOworICAgICAgICAgICAgICBYU2V0RmlsbFN0eWxlIChzLT5kaXNwbGF5LCBnYywgRmls bFNvbGlkKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyNlbmRpZgorICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBn Yy0+YmFja2dyb3VuZCwgeCwgeSwgdywgaCk7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQor ICAgIH0KKyAgICBlbHNlIGlmICghcy0+YmFja2dyb3VuZF9maWxsZWRfcCkKKyAgICAgIHsKKyAg ICAgICAgaW50IGJhY2tncm91bmRfd2lkdGggPSBzLT5iYWNrZ3JvdW5kX3dpZHRoOworICAgICAg ICBpbnQgeCA9IHMtPngsIGxlZnRfeCA9IHdpbmRvd19ib3hfbGVmdF9vZmZzZXQgKHMtPncsIFRF WFRfQVJFQSk7CisgICAgICAgIC8qIERvbid0IGRyYXcgaW50byBsZWZ0IG1hcmdpbiwgZnJpbmdl IG9yIHNjcm9sbGJhciBhcmVhCisgICAgICAgICAgIGV4Y2VwdCBmb3IgaGVhZGVyIGxpbmUgYW5k IG1vZGUgbGluZS4gKi8KKyAgICAgICAgaWYgKHggPCBsZWZ0X3ggJiYgIXMtPnJvdy0+bW9kZV9s aW5lX3ApCisgICA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3IgZHJhd2luZyB0aGF0IGdseXBoIHN0 cmluZy4gIFNldAorICAgUy0+c3RpcHBsZWRfcCB0byBhIG5vbi16ZXJvIHZhbHVlIGlmIHRoZSBm YWNlIG9mIFMgaGFzIGEgc3RpcHBsZSBwYXR0ZXJuLiAqLworc3RhdGljIGlubGluZSB2b2lkCitt Y193MzJfc2V0X2dseXBoX3N0cmluZ19nYyAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgYm9vbCBj dXJzb3JfZ2NfcCkKK3sKKyAgcHJlcGFyZV9mYWNlX2Zvcl9kaXNwbGF5IChzLT5mLCBzLT5mYWNl KTsKKyAgaWYgKHMtPmhsID09IERSQVdfTk9STUFMX1RFWFQpCisgICAgeworICAgICAgcy0+Z2Mg PSBzLT5mYWNlLT5nYzsKKyAgICAgIHMtPnN0aXBwbGVkX3AgPSBzLT5mYWNlLT5zdGlwcGxlICE9 IDA7CisgICAgfQorICAgIGVsc2UgaWYgKHMtPmhsID09IERSQVdfSU5WRVJTRV9WSURFTykKKyAg ICAgIHsKKyAgICAgICAgdzMyX3NldF9tb2RlX2xpbmVfZmFjZV9nYyAocyk7CisgICAgICAgIHMt PnN0aXBwbGVkX3AgPSBzLT5mYWNlLT5zdGlwcGxlICE9IDA7CisgICAgICB9CisgICAgICBlbHNl IGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUikKKyAgICAgICAgeworICAgICAgICAgIG1jX3czMl9z ZXRfY3Vyc29yX2djIChzLCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgcy0+c3RpcHBsZWRfcCA9 IGZhbHNlOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKHMtPmhsID09IERSQVdfTU9VU0Vf RkFDRSkKKyAgICAgICAgICB7CisgICAgICAgICAgICB3MzJfc2V0X21vdXNlX2ZhY2VfZ2MgKHMp OworICAgICAgICAgICAgcy0+c3RpcHBsZWRfcCA9IHMtPmZhY2UtPnN0aXBwbGUgIT0gMDsKKyAg ICAgICAgICB9CisgICAgICAgICAgZWxzZSBpZiAocy0+aGwgPT0gRFJBV19JTUFHRV9SQUlTRUQK KyAgICAgICAgICAgICAgICAgICB8fCBzLT5obCA9PSBEUkFXX0lNQUdFX1NVTktFTikKKyAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgcy0+Z2MgPSBzLT5mYWNlLT5nYzsKKyAgICAgICAgICAg ICAgcy0+c3RpcHBsZWRfcCA9IHMtPmZhY2UtPnN0aXBwbGUgIT0gMDsKKyAgICAgICAgICAgIH0K KyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgZW1hY3NfYWJvcnQgKCk7CisgIC8qIEdD IG11c3QgaGF2ZSBiZWVuIHNldC4gKi8KKyAgZWFzc2VydCAocy0+Z2MgIT0gMCk7Cit9CisKKy8q IERyYXcgYSBob2xsb3cgYm94IGN1cnNvciBvbiB3aW5kb3cgVyBpbiBnbHlwaCByb3cgUk9XLiAq Lworc3RhdGljIHZvaWQKK21jX3czMl9kcmF3X2hvbGxvd19jdXJzb3IgKHN0cnVjdCB3aW5kb3cg KncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgaW50IHgsIGludCBmeCwgaW50IHksIGludCBmeSwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBocG9zLCBpbnQgdnBvcywgaW50IHdkLCBp bnQgaCkKK3sKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsK KyAgSERDIGhkYzsKKyAgUkVDVCByZWN0OworICBIQlJVU0ggaGIgPSBDcmVhdGVTb2xpZEJydXNo IChmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCk7CisgIC8qIEdldCB0aGUgZ2x5cGgg dGhlIGN1cnNvciBpcyBvbi4gIElmIHdlIGNhbid0IHRlbGwgYmVjYXVzZQorICAgICB0aGUgY3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lwaCdzIGNvbG9ycyBhcmUgY2hvc2VuIHNvCisgICAgICAgIHRoYXQgdGhlIGdseXBo IGlzIGxlZ2libGUuICovCisgICAgICAgIGlmIChmYWNlLT5iYWNrZ3JvdW5kID09IGN1cnNvcl9j b2xvcgorICAgICAgICAgICAgJiYgIWN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKQorICAgICAg ICAgIGN1cnNvcl9jb2xvciA9IGZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgIGludCBkZWZhdWx0 X2Z4ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgeCk7CisgICAgICAgIGhkYyA9 IGdldF9mcmFtZV9kYyAoZik7CisgICAgICAgIHczMl9jbGlwX3RvX3JvdyAodywgcm93LCBURVhU X0FSRUEsIGhkYyk7CisgICAgICAgIGludCByeCA9IGZ4OworICAgICAgICBpbnQgcnkgPSBmeTsK KyAgICAgICAgaW50IHJ3ID0gd2Q7CisgICAgICAgIGludCByaCA9IGg7CisgICAgICAgIC8vICBm cHJpbnRmIChzdGRlcnIsICJNQ19IQkFSOiAgZnggKCVkKSB8IGZ5ICglZCkgfCB3ZCAoJWQpIHwg aCAoJWQpXG4iLAorICAgICAgICAvLyAgICAgICAgICAgICAgICAgICByeCwgcnksIHJ3LCByaCk7 CisgICAgICAgIHczMl9maWxsX2FyZWEgKGYsIGhkYywgY3Vyc29yX2NvbG9yLCByeCwgcnksIHJ3 LCByaCk7CisgICAgICAgIHczMl9zZXRfY2xpcF9yZWN0YW5nbGUgKGhkYywgTlVMTCk7CisgICAg ICAgIHJlbGVhc2VfZnJhbWVfZGMgKGYsIGhkYyk7CisgICAgICB9Cit9CisKKy8qIFJJRjogRHJh dyBvciBjbGVhciBjdXJzb3Igb24gd2luZG93IFcuICovCitzdGF0aWMgdm9pZAorbWNfdzMyX2Ry YXdfd2luZG93X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAq bWF0cml4LC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wtZmFrZS1jdXJzb3ItcHJlLXp2LWZhY2UiKSwg dHJ1ZSk7CisgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNl ID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAg ICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91 bmQ7CisgICAgICAgICAgICAgICAgICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IGhvbGxvd19hY3Rp dmVfcmVnaW9uX2JldHdlZW5fZmFjZS0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICAgICAgZWxzZSBpZiAoYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBs b29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16 di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93 X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOwor ICAgICAgICAgICAgICAgICAgICBnY192YWx1ZXMuZm9yZWdyb3VuZCA9IGhvbGxvd19hY3RpdmVf ZmFjZS0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91 bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmJhY2tncm91bmQ7CisgICAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAgICAgICBlbHNlIGlmICghYWN0aXZlX3ApCisgICAgICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0aXZl X2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2Ut Y3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAg ICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZiwg aG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVl cy5mb3JlZ3JvdW5kID0gaG9sbG93X2luYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAg ICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfaW5hY3RpdmVfZmFj ZS0+YmFja2dyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgIGYtPm91dHB1 dF9kYXRhLnczMi0+Y3Vyc29yX2djID0gWENyZWF0ZUdDIChOVUxMLCBGUkFNRV9XMzJfV0lORE9X IChmKSwgbWFzaywgJmdjX3ZhbHVlcyk7CisgICAgICAgICAgYmxvY2tfaW5wdXQgKCk7CisgICAg ICAgICAgLyogRm9yY2UgYG1jX3czMl9zZXRfY3Vyc29yX2djJyB0byB1c2UgYHMtPmYtPm91dHB1 dF9kYXRhLnczMi0+Y3Vyc29yX2djJy4gKi8KKyAgICAgICAgICBib29sIGN1cnNvcl9nY19wID0g dHJ1ZTsKKyAgICAgICAgICBtY19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERS QVdfQ1VSU09SLCB4LCBocG9zLCB2cG9zLCBsc2wsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29yX2dj X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ICAgICAgICBlbHNlCisgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5j dXJzb3JfZ2MnIGJ5IGJvcnJvd2luZyB0aGUKKyAgICAgICAgICAgICAgZnVuY3Rpb25hbGl0eSBv ZiBgeF9tYWtlX2djJyBpbiB3MzJmbnMuYy4gKi8KKyAgICAgICAgICAgICAgaWYgKHJlZ2lvbl9h Y3RpdmVfcAorICAgICAgICAgICAgICAgICAgJiYgYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAg ICYmIGN1cnNvcl9nbHlwaC0+Y2hhcnBvcyA9PSByZWdpb25fYmVnKQorICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9i ZWdfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFr ZS1jdXJzb3ItYXQtcmVnaW9uLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAg ICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfcmVnaW9uX2JlZ19mYWNlID0gRkFDRV9GUk9N X0lEIChmLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZWdfZmFjZV9pZCk7CisgICAgICAgICAgICAg ICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2Zh Y2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVl KTsKKyAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBG QUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAg ICBnY192Y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ICAgICAgICAgICAgICAgIGdjX3Zh bHVlcy5mb3JlZ3JvdW5kID0gaG9sbG93X2FjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kOworICAgICAg ICAgICAgICAgICAgICBnY192YWx1ZXMuYmFja2dyb3VuZCA9IGhvbGxvd19hY3RpdmVfcmVnaW9u X2VuZF9mYWNlLT5iYWNrZ3JvdW5kOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAg ICAgICAgZWxzZSBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBhY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2dseXBo LT5jaGFycG9zID4gcmVnaW9uX2JlZworICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vy c29yX2dseXBoLT5jaGFycG9zIDwgcmVnaW9uX2VuZCkKKyAgICAgICAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9i ZXR3ZWVuX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFs LWZha2UtY3Vyc29yLWluLXJlZ2lvbi1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAg ICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9yZWdpb25fYmV0d2Vlbl9mYWNl ID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2VfaWQp OworICAgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2Vf aWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29y LXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNl ICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFj ZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xs b3dfYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgICAgICAgZ2NfdmFs dWVzLmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVuX2ZhY2UtPmZvcmVn cm91bmQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSBp ZiAoYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg ICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9m YWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItcHJlLXp2LWZhY2UiKSwgdHJ1 ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9m YWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAg ICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2Ut PmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgICAgICAgICBnY192YWx1ZXMuYmFja2dyb3Vu ZCA9IGhvbGxvd19hY3RpdmVfZmFjZS0+YmFja2dyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAg ICB9CisgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoIWFjdGl2ZV9wKQorICAgICAgICAg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQg aG9sbG93X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJu ICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpOworICAg ICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2luYWN0aXZlX2ZhY2Ug PSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfaW5hY3RpdmVfZmFj ZS0+Zm9yZWdyb3VuZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tn cm91bmQgPSBob2xsb3dfaW5hY3RpdmVfZmFjZS0+YmFja2dyb3VuZDsKKyAgICAgICAgICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfZ2Mg PSBYQ3JlYXRlR0MgKE5VTEwsIEZSQU1FX1czMl9XSU5ET1cgKGYpLCBtYXNrLCAmZ2NfdmFsdWVz KTsKKyAgICAgICAgICAgICAgYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgICAgIC8qIEZvcmNl IGBtY193MzJfc2V0X2N1cnNvcl9nYycgdG8gdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS53MzItPmN1 cnNvcl9nYycuICovCisgICAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX3AgPSB0cnVlOworICAg ICAgICAgICAgICBtY19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VS U09SLCB4LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg bHNsLCBnbHlwaF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2Qs IGFjdGl2ZV9wLCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5j dXJzb3JfZ2MgPSBvcmlnaW5hbF9jdXJzb3JfZ2M7CisgICAgICAgICAgdW5ibG9ja19pbnB1dCAo KTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgYm9v bCBjdXJzb3JfZ2NfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGgg KHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBsc2wsIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdk LCBhY3RpdmVfcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfZ2Nf cCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfQkFSOgor ICAgIHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJs dWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+ b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwnLiAqLworICAgICAgICAgIGYtPm91dHB1dF9k YXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gY29sb3JfcGl4ZWw7CisgICAgICAgICAgYm9vbCBjdXJz b3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IHRydWU7CisgICAgICAgICAgbWNfdzMyX2RyYXdfYmFy X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaCwgY3Vyc29yX3dpZHRoLCBNQ19CQVIs IGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53 MzItPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAg ICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNp YmxlX29rYXlfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNfdzMyX2RyYXdfYmFyX2N1cnNvciAo dywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0JBUiwgY3Vyc29y X2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0K KyAgICBjYXNlIE1DX0hCQVI6CisgICAgeworICAgICAgaWYgKGxzbC5yZWQgPj0gMCAmJiBsc2wu Z3JlZW4gPj0gMCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVt cG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCcuICovCisg ICAgICAgICAgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBjb2xvcl9waXhlbDsK KyAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gdHJ1ZTsKKyAgICAg ICAgICBtY193MzJfZHJhd19iYXJfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5 LCBocG9zLCB2cG9zLCB3ZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoLCBj dXJzb3Jfd2lkdGgsIE1DX0hCQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAg ICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9w aXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAg Ym9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNf dzMyX2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywg dnBvcywgd2QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jf d2lkdGgsIE1DX0hCQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICB9 CisgICAgICBicmVhazsKKyAgICB9CisgICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgp OworICB9CisgICAgfQorfQorCisvKiBEcmF3IGdseXBoIHN0cmluZyBTLiAgVGhlIGBtY19tYXRy aXhgIGlzIHJlc2VydmVkIGZvciBmdXR1cmUgdXNlIHdoZW4gZXJhc2luZworICAgZmFrZSBjdXJz b3JzIGR1cmluZyBgbWNfdXBkYXRlX3dpbmRvd19lcmFzZScgYW5kIHJlZHJhd2luZyBmYWtlIGN1 cnNvcnMgb24KKyAgIGxlZnQvcmlnaHQgb3ZlcndyaXR0ZW4gZ2x5cGhzLiAqLworc3RhdGljIHZv aWQKK21jX3czMl9kcmF3X2dseXBoX3N0cmluZyAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgc3Ry dWN0IGdseXBoX21hdHJpeCAqbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1 Y3QgZ2x5cGhfcm93ICpyb3csIHN0cnVjdCBtY19tYXRyaXggbWNfbWF0cml4LAorICAgICAgICAg ICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbCwgZW51bSBtY19mbGF2b3IgZ2x5cGhf Zmxhdm9yLAorICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNvcl90eXBlIGN1 cnNvcl90eXBlLCBpbnQgY3Vyc29yX3dpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICBi b29sIGFjdGl2ZV9wLCBib29sIGN1cnNvcl9nY19wKQoreworICBib29sIHJlbGllZl9kcmF3bl9w ID0gMDsKKyAgLyogSWYgUyBkcmF3cyBpbnRvIHRoZSBiYWNrZ3JvdW5kIG9mIGl0cyBzdWNjZXNz b3IsIGRyYXcgdGhlCisgICAgIGJhY2tncm91bmQgb2YgdGhlIHN1Y2Nlc3NvciBmaXJzdCBzbyB0 aGF0IFMgY2FuIGRyYXcgaW50byBpdC4KKyAgICAgVGhpcyBtYWtlcyBTLT5uZXh0IHVzZSBYRHJh d1N0cmluZyBpbnN0ZWFkIG9mIFhEcmF3SW1hZ2VTdHJpbmcuICovCisgIGlmIChzLT5uZXh0ICYm IHMtPnJpZ2h0X292ZXJoYW5nICYmICFzLT5mb3Jfb3ZlcmxhcHMpCisgICAgeworICAgICAgaW50 IHdpZHRoOworICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAqbmV4dDsKKyAgICAgIGZvciAod2lk dGggPSAwLCBuZXh0ID0gcy0+bmV4dDsKKyAgICAgICAgICAgbmV4dCAmJiB3aWR0aCA8IHMtPnJp Z2h0X292ZXJoYW5nOworICAgICAgICAgICB3aWR0aCArPSBuZXh0LT53aWR0aCwgbmV4dCA9IG5l eHQtPm5leHQpCisgICAgICAgIGlmIChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSAhPSBJTUFHRV9H TFlQSCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBtY193MzJfc2V0X2dseXBoX3N0cmluZ19n YyAobmV4dCwgY3Vyc29yX2djX3ApOworICAgICAgICAgICAgdzMyX3NldF9nbHlwaF9zdHJpbmdf Y2xpcHBpbmcgKG5leHQpOworICAgICAgICAgICAgaWYgKG5le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lX3R5cGUgPT0gRkFDRV9VTkRFUl9XQVZFKQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICBDT0xPUlJFRiBjb2xvcjsKKyAgICAgICAgICAgICAgaWYgKHMtPmZhY2UtPnVuZGVy bGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICBjb2xvciA9IHMtPmdjLT5mb3JlZ3Jv dW5kOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIGNvbG9yID0gcy0+ ZmFjZS0+dW5kZXJsaW5lX2NvbG9yOworICAgICAgICAgICAgICB3MzJfZHJhd191bmRlcndhdmUg KHMsIGNvbG9yKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmIChzLT5mYWNlLT51 bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgICB7CisgICAgICAg ICAgICAgIHVuc2lnbmVkIGxvbmcgdGhpY2tuZXNzLCBwb3NpdGlvbjsKKyAgICAgICAgICAgICAg aW50IHk7CisgICAgICAgICAgICAgIGlmIChzLT5wcmV2ICYmIHMtPnByZXYtPmZhY2UtPnVuZGVy bGluZV9wCisgICAgICAgICAgICAgICAgICAmJiBzLT5wcmV2LT5mYWNlLT51bmRlcmxpbmVfdHlw ZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg ICAgLyogV2UgdXNlIHRoZSBzYW1lIHVuZGVybGluZSBzdHlsZSBhcyB0aGUgcHJldmlvdXMgb25l LiAqLworICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+cHJldi0+dW5kZXJsaW5lX3Ro aWNrbmVzczsKKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gcy0+cHJldi0+dW5kZXJsaW5l X3Bvc2l0aW9uOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJsaW5lIHRoaWNr bmVzcy4gIERlZmF1bHQgaXMgMSBwaXhlbC4gKi8KKyAgICAgICAgICAgICAgICAgIGlmIChzLT5m b250ICYmIHMtPmZvbnQtPnVuZGVybGluZV90aGlja25lc3MgPiAwKQorICAgICAgICAgICAgICAg ICAgICB0aGlja25lc3MgPSBzLT5mb250LT51bmRlcmxpbmVfdGhpY2tuZXNzOworICAgICAgICAg ICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gMTsKKyAg ICAgICAgICAgICAgICAgIGlmICh4X3VuZGVybGluZV9hdF9kZXNjZW50X2xpbmUpCisgICAgICAg ICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmhlaWdodCAtIHRoaWNrbmVzcykgLSAocy0+eWJh c2UgLSBzLT55KTsKKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJsaW5lIHBvc2l0 aW9uLiAgVGhpcyBpcyB0aGUgcmVjb21tZW5kZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAg IHZlcnRpY2FsIG9mZnNldCBpbiBwaXhlbHMgZnJvbSB0aGUgYmFzZWxpbmUgdG8gdGhlIHRvcCBv ZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhlIHVuZGVybGluZS4gIFRoaXMgaXMgYSBz aWduZWQgdmFsdWUgYWNjb3JkaW5nIHRvIHRoZQorICAgICAgICAgICAgICAgICAgICAgICAgICAg c3BlY3MsIGFuZCBpdHMgZGVmYXVsdCBpcworICAgICAgICAgICAgICAgICAgICAgICAgICAgUk9V TkQgKChtYXhpbXVtX2Rlc2NlbnQpIC8gMiksIHdpdGgKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgIFJPVU5EICh4KSA9IGZsb29yICh4ICsgMC41KSAgKi8KKyAgICAgICAgICAgICAgICAgICAg ICAgIGlmICh4X3VzZV91bmRlcmxpbmVfcG9zaXRpb25fcHJvcGVydGllcworICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHMtPmZvbnQgJiYgcy0+Zm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9u ID49IDApCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gcy0+Zm9udC0+dW5k ZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAocy0+Zm9u dCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+Zm9udC0+ZGVzY2Vu dCArIDEpIC8gMjsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBw b3NpdGlvbiA9IG1heCAocG9zaXRpb24sIHVuZGVybGluZV9taW5pbXVtX29mZnNldCk7CisgICAg ICAgICAgICAgICAgfQorICAgICAgICAgICAgICAvKiBDaGVjayB0aGUgc2FuaXR5IG9mIHRoaWNr bmVzcyBhbmQgcG9zaXRpb24uICBXZSBzaG91bGQKKyAgICAgICAgICAgICAgICAgYXZvaWQgZHJh d2luZyB1bmRlcmxpbmUgb3V0IG9mIHRoZSBjdXJyZW50IGxpbmUgYXJlYS4gKi8KKyAgICAgICAg ICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQgPD0gcy0+eWJhc2UgKyBwb3NpdGlvbikKKyAgICAg ICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5oZWlnaHQgLSAxKSAtIChzLT55YmFzZSAtIHMtPnkp OworICAgICAgICAgICAgICBpZiAocy0+eSArIHMtPmhlaWdodCA8IHMtPnliYXNlICsgcG9zaXRp b24gKyB0aGlja25lc3MpCisgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gKHMtPnkgKyBzLT5o ZWlnaHQpIC0gKHMtPnliYXNlICsgcG9zaXRpb24pOworICAgICAgICAgICAgICBzLT51bmRlcmxp bmVfdGhpY2tuZXNzID0gdGhpY2tuZXNzOworICAgICAgICAgICAgICBzLT51bmRlcmxpbmVfcG9z aXRpb24gPXBvc2l0aW9uOworICAgICAgICAgICAgICB5ID0gcy0+eWJhc2UgKyBwb3NpdGlvbjsK KyAgICAgICAgICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAg ICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmdjLT5mb3JlZ3JvdW5k LCBzLT54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHksIHMtPndpZHRoLCAxKTsK KyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChz LT5mLCBzLT5oZGMsIHMtPmZhY2UtPnVuZGVybGluZV9jb2xvciwgcy0+eCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHksIHMtPndpZHRoLCAxKTsKKyAgICAgICAgICAgIH0KKyAg ICAgICAgfQorICAgICAgLyogRHJhdyBvdmVybGluZS4gKi8KKyAgICAgIGlmIChzLT5mYWNlLT5v dmVybGluZV9wKQorICAgICAgICB7CisgICAgICAgICAgdW5zaWduZWQgbG9uZyBkeSA9IDAsIGgg PSAxOworICAgICAgICAgIGlmIChzLT5mYWNlLT5vdmVybGluZV9jb2xvcl9kZWZhdWx0ZWRfcCkK KyAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+Z2MtPmZvcmVncm91 bmQsIHMtPngsCisgICAgICAgICAgICAgICAgICAgICAgICAgICBzLT55ICsgZHksIHMtPndpZHRo LCBoKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+ Ziwgcy0+aGRjLCBzLT5mYWNlLT5vdmVybGluZV9jb2xvciwgcy0+eCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgcy0+eSArIGR5LCBzLT53aWR0aCwgaCk7CisgICAgICAgIH0KKyAgICAg IC8qIERyYXcgc3RyaWtlLXRocm91Z2guICovCisgICAgICBpZiAocy0+ZmFjZS0+c3RyaWtlX3Ro cm91Z2hfcAorICAgICAgICAgICYmICFGT05UX1RFWFRNRVRSSUMgKHMtPmZvbnQpLnRtU3RydWNr T3V0KQorICAgICAgICB7CisgICAgICAgICAgdW5zaWduZWQgbG9uZyBoID0gMTsKKyAgICAgICAg ICB1bnNpZ25lZCBsb25nIGR5ID0gKHMtPmhlaWdodCAtIGgpIC8gMjsKKyAgICAgICAgICBpZiAo cy0+ZmFjZS0+c3RyaWtlX3Rocm91Z2hfY29sb3JfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICB3 MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmdjLT5mb3JlZ3JvdW5kLCBzLT54LCBzLT55 ICsgZHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICBzLT53aWR0aCwgaCk7CisgICAgICAg ICAgICBlbHNlCisgICAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+ ZmFjZS0+c3RyaWtlX3Rocm91Z2hfY29sb3IsIHMtPngsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHMtPnkgKyBkeSwgcy0+d2lkdGgsIGgpOworICAgICAgICB9CisgICAgICAvKiBEcmF3 IHJlbGllZiBpZiBub3QgeWV0IGRyYXduLiAqLworICAgICAgaWYgKCFyZWxpZWZfZHJhd25fcCAm JiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gpCisgICAgICAgIHczMl9kcmF3X2dseXBoX3N0 cmluZ19ib3ggKHMpOworICAgICAgaWYgKHMtPnByZXYpCisgICAgICAgIHsKKyAgICAgICAgICBz dHJ1Y3QgZ2x5cGhfc3RyaW5nICpwcmV2OworICAgICAgICAgIGZvciAocHJldiA9IHMtPnByZXY7 IHByZXY7IHByZXYgPSBwcmV2LT5wcmV2KQorICAgICAgICAgICAgaWYgKHByZXYtPmhsICE9IHMt PmhsCisgICAgICAgICAgICAgICAgJiYgcHJldi0+eCArIHByZXYtPndpZHRoICsgcHJldi0+cmln aHRfb3ZlcmhhbmcgPiBzLT54KQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyog QXMgcHJldiB3YXMgZHJhd24gd2hpbGUgY2xpcHBlZCB0byBpdHMgb3duIGFyZWEsIHdlCisgICAg ICAgICAgICAgICAgICAgbXVzdCBkcmF3IHRoZSByaWdodF9vdmVyaGFuZyBwYXJ0IHVzaW5nIHMt PmhsIG5vdy4gKi8KKyAgICAgICAgICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2Ugc2F2ZSA9 IHByZXYtPmhsOworICAgICAgICAgICAgICAgIHByZXYtPmhsID0gcy0+aGw7CisgICAgICAgICAg ICAgICAgbWNfdzMyX3NldF9nbHlwaF9zdHJpbmdfZ2MgKHByZXYsIGN1cnNvcl9nY19wKTsKKyAg ICAgICAgICAgICAgICB3MzJfc2V0X2dseXBoX3N0cmluZ19jbGlwcGluZ19leGFjdGx5IChzLCBw cmV2KTsKKyAgICAgICAgICAgICAgICBpZiAocHJldi0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hB Ul9HTFlQSCkKKyAgICAgICAgICAgICAgICAgIHczMl9kcmF3X2dseXBoX3N0cmluZ19mb3JlZ3Jv dW5kIChwcmV2KTsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAg dzMyX2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChwcmV2KTsKKyAgICAg ICAgICAgICAgICB3MzJfc2V0X2NsaXBfcmVjdGFuZ2xlIChwcmV2LT5oZGMsIE5VTEwpOworICAg ICAgICAgICAgICAgIHByZXYtPmhsID0gc2F2ZTsKKyAgICAgICAgICAgICAgICBwcmV2LT5udW1f Y2xpcHMgPSAwOworICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGlmIChzLT5uZXh0 KQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAqbmV4dDsKKyAgICAg ICAgICBmb3IgKG5leHQgPSBzLT5uZXh0OyBuZXh0OyBuZXh0ID0gbmV4dC0+bmV4dCkKKyAgICAg ICAgICAgIGlmIChuZXh0LT5obCAhPSBzLT5obAorICAgICAgICAgICAgICAgICYmIG5leHQtPngg LSBuZXh0LT5sZWZ0X292ZXJoYW5nIDwgcy0+eCArIHMtPndpZHRoKQorICAgICAgICAgICAgICB7 CisgICAgICAgICAgICAgICAgLyogQXMgbmV4dCB3aWxsIGJlIGRyYXduIHdoaWxlIGNsaXBwZWQg dG8gaXRzIG93biBhcmVhLAorICAgICAgICAgICAgICAgICAgIHdlIG11c3QgZHJhdyB0aGUgbGVm dF9vdmVyaGFuZyBwYXJ0IHVzaW5nIHMtPmhsIG5vdy4gKi8KKyAgICAgICAgICAgICAgICBlbnVt IGRyYXdfZ2x5cGhzX2ZhY2Ugc2F2ZSA9IG5leHQtPmhsOworICAgICAgICAgICAgICAgIG5leHQt PmhsID0gcy0+aGw7CisgICAgICAgICAgICAgICAgbWNfdzMyX3NldF9nbHlwaF9zdHJpbmdfZ2Mg KG5leHQsIGN1cnNvcl9nY19wKTsKKyAgICAgICAgICAgICAgICB3MzJfc2V0X2dseXBoX3N0cmlu Z19jbGlwcGluZ19leGFjdGx5IChzLCBuZXh0KTsKKyAgICAgICAgICAgICAgICBpZiAobmV4dC0+ Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSCkKKyAgICAgICAgICAgICAgICAgIHczMl9k cmF3X2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChuZXh0KTsKKyAgICAgICAgICAgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICAgICAgdzMyX2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19m b3JlZ3JvdW5kIChuZXh0KTsKKyAgICAgICAgICAgICAgICB3MzJfc2V0X2NsaXBfcmVjdGFuZ2xl IChuZXh0LT5oZGMsIE5VTEwpOworICAgICAgICAgICAgICAgIG5leHQtPmhsID0gc2F2ZTsKKyAg ICAgICAgICAgICAgICBuZXh0LT5udW1fY2xpcHMgPSAwOworICAgICAgICAgICAgICAgIG5leHQt PmNsaXBfaGVhZCA9IHMtPm5leHQ7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0K KyAgLyogUmVzZXQgY2xpcHBpbmcuICovCisgIHczMl9zZXRfY2xpcF9yZWN0YW5nbGUgKHMtPmhk YywgTlVMTCk7CisgIHMtPm51bV9jbGlwcyA9IDA7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJT T1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBGcmluZ2UgYml0bWFwcy4g ICovCiAKIHN0YXRpYyBpbnQgbWF4X2ZyaW5nZV9ibXAgPSAwOwpAQCAtNTQyLDYgKzE3MDQsMTUg QEAgdzMyX3VwZGF0ZV9iZWdpbiAoc3RydWN0IGZyYW1lICpmKQogICBpZiAoISBGUkFNRV9XMzJf UCAoZikpCiAgICAgcmV0dXJuOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVM VElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gZjsKKworLyogKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqICovCisKKwogICAvKiBSZWdlbmVyYXRlIGRpc3BsYXkgcGFsZXR0ZSBi ZWZvcmUgZHJhd2luZyBpZiBsaXN0IG9mIHJlcXVlc3RlZAogICAgICBjb2xvcnMgaGFzIGNoYW5n ZWQuICovCiAgIGlmIChkaXNwbGF5X2luZm8tPnJlZ2VuX3BhbGV0dGUpCkBAIC02NzQsNiArMTg0 NSwxNiBAQCB3MzJfdXBkYXRlX2VuZCAoc3RydWN0IGZyYW1lICpmKQogCiAgIC8qIE1vdXNlIGhp Z2hsaWdodCBtYXkgYmUgZGlzcGxheWVkIGFnYWluLiAgKi8KICAgTU9VU0VfSExfSU5GTyAoZikt Pm1vdXNlX2ZhY2VfZGVmZXIgPSBmYWxzZTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGluZ19mcmFtZSA9IE5VTEw7 CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIH0KIAogCkBAIC00MDAyLDEzICs1MTgz LDc0IEBAIHczMl9zZXRfdmVydGljYWxfc2Nyb2xsX2JhciAoc3RydWN0IHdpbmRvdyAqdywKIAkg ICAgICByZWxlYXNlX2ZyYW1lX2RjIChmLCBoZGMpOwogCSAgICAgIHczMl9jbGVhcl91bmRlcl9p bnRlcm5hbF9ib3JkZXIgKGYpOwogCSAgICB9CisKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIFJFUEFJTlRJTkcgV0hFTiBSRU1P VklORyBTQ1JPTEwgQkFSOgorCistIFNlcXVlbmNlIG9mIEV2ZW50czoKKworICAuIGByZWRpc3Bs YXlfaW50ZXJuYWwnIGNhbGxzIHRoZSBgY29uZGVtbl9zY3JvbGxfY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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKwogCiAJICBzaS5jYlNpemUgPSBzaXplb2YgKHNpKTsKIAkg IHNpLmZNYXNrID0gU0lGX1JBTkdFOwpAQCAtNDI3Nyw2ICs1NTE5LDIxIEBAIHczMl9qdWRnZV9z Y3JvbGxfYmFycyAoc3RydWN0IGZyYW1lICpmKQogICAgIHsKICAgICAgIHN0cnVjdCBzY3JvbGxf YmFyICpiID0gWFNDUk9MTF9CQVIgKGJhcik7CiAKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIC8qIGBEZXN0cm95V2luZG93JyB3aXRo aW4gYHhfc2Nyb2xsX2Jhcl9yZW1vdmUnIHJlcGFpbnRzIHRoZSByZWN0YW5nbGUuCisgICAgICBU aGVyZWZvcmUsIHdlIGZpcnN0IHNlbmQgYSBtZXNzYWdlIHRvIGluaGliaXQgcmVwYWludGluZy4g Ki8KKyAgICAgIGlmICghV0lORE9XX0xJVkVfUCAoYi0+d2luZG93KSkKKyAgICAgICAgeworICAg ICAgICAgIEhXTkQgaHduZCA9IFNDUk9MTF9CQVJfVzMyX1dJTkRPVyAoYik7CisgICAgICAgICAg U2VuZE1lc3NhZ2UgKGh3bmQsIFdNX1NFVFJFRFJBVywgZmFsc2UsIDApOworICAgICAgICB9CisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIHczMl9zY3JvbGxfYmFyX3JlbW92 ZSAoYik7CiAKICAgICAgIG5leHQgPSBiLT5uZXh0OwpAQCAtNzA4OCw2ICs4MzQ1LDIwIEBAIGV4 dGVybiBmcmFtZV9wYXJtX2hhbmRsZXIgdzMyX2ZyYW1lX3Bhcm1faGFuZGxlcnNbXTsKIAogc3Rh dGljIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlIHczMl9yZWRpc3BsYXlfaW50ZXJmYWNlID0K IHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8K KworLyogYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGB3MzJ0ZXJtLmNgIG11c3QgYmUgaW4gdGhl IGV4YWN0IHNhbWUgb3JkZXIgYXMgdGhlCitgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYGRpc3Bl eHRlcm4uaGAhICovCisKKyAgbWNfdzMyX2RyYXdfd2luZG93X2N1cnNvciwKKyAgbWNfdzMyX2Ry YXdfZ2x5cGhfc3RyaW5nLAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIHczMl9m cmFtZV9wYXJtX2hhbmRsZXJzLAogICBndWlfcHJvZHVjZV9nbHlwaHMsCiAgIGd1aV93cml0ZV9n bHlwaHMsCmRpZmYgLS1naXQgYS9zcmMvd2luZG93LmggYi9zcmMvd2luZG93LmgKaW5kZXggNmIw ZjBlNS4uMTRkZDM4YSAxMDA2NDQKLS0tIGEvc3JjL3dpbmRvdy5oCisrKyBiL3NyYy93aW5kb3cu aApAQCAtMzI0LDYgKzMyNCwxNDcgQEAgc3RydWN0IHdpbmRvdwogCiAjaWZkZWYgSEFWRV9XSU5E T1dfU1lTVEVNCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBM RS1DVVJTT1JTICovCisKKy8qIFN1ZmZpeGVzIGZvciB0aGUgYG1jYCB3aW5kb3cgcG9pbnRlciBw cmVmaXguICovCitzdHJ1Y3QgbXVsdGlwbGVfY3Vyc29ycworeworICAvKiBUaGUgcmVjb3JkZWQg cGl4ZWwgd2lkdGggb2YgdGhlIGxhc3QgbGluZSBudW1iZXIgZHJhd24gZHVyaW5nIHJlZGlzcGxh eSAqLworICBpbnQgbG51bV9waXhlbF93aWR0aDsKK30gbWM7CisKK3N0cnVjdCBtY19tYXRyaXgK K3sKKyAgcHRyZGlmZl90IHZwb3NfYWxsb2NhdGVkOworICBwdHJkaWZmX3QgdnBvc191c2VkOwor ICBwdHJkaWZmX3QgY3Vyc29yc191c2VkWzRdOworICBlbnVtIG1jX2NhY2hlX3R5cGUKKyAgewor ICAgIE1DX0NBQ0hFLAorICAgIENIX0NBQ0hFLAorICAgIEZDX0NBQ0hFLAorICAgIE5PX0NBQ0hF CisgIH0gY2FjaGVfdHlwZTsKKyAgc3RydWN0IG1jX3Zwb3MKKyAgeworICAgIHB0cmRpZmZfdCBj YWNoZV9hbGxvY2F0ZWRbNF07CisgICAgcHRyZGlmZl90IGNhY2hlX3VzZWRbNF07CisgICAgc3Ry dWN0IG1jX2NvbnRlbnRzCisgICAgeworICAgICAgYm9vbF9iZiBzYW1lX3AgOiAxOworICAgICAg c3RydWN0IGdseXBoIGdseXBoOworICAgICAgaW50IHg7CisgICAgICBpbnQgZng7CisgICAgICBp bnQgeTsKKyAgICAgIGludCBmeTsKKyAgICAgIGludCBocG9zOworICAgICAgaW50IHZwb3M7Cisg ICAgICBpbnQgd2Q7CisgICAgICBpbnQgaDsKKyAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUKKyAg ICAgIHsKKyAgICAgICAgLyogTk9URTogIFRoZSBmcmluZ2UgYml0bWFwIGZyYW1ld29yayByZWxp ZXMgdXBvbiBNQ19OT19GUklOR0VfQklUTUFQCisgICAgICAgIGhhdmluZyBhIHZhbHVlIG9mIHpl cm8gKDApLiAqLworICAgICAgICBNQ19OT19GUklOR0VfQklUTUFQLAorICAgICAgICBNQ19OT19D VVJTT1IsCisgICAgICAgIE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAsCisgICAgICAgIE1DX0xFRlRf RlJJTkdFX0JJVE1BUCwKKyAgICAgICAgTUNfRlJBTUVEX0JPWCwKKyAgICAgICAgTUNfRklMTEVE X0JPWCwKKyAgICAgICAgTUNfSE9MTE9XX0JPWCwKKyAgICAgICAgTUNfQkFSLAorICAgICAgICBN Q19IQkFSCisgICAgICB9IGN1cnNvcl90eXBlOworICAgICAgaW50IGN1cnNvcl93aWR0aDsKKyAg ICAgIHN0cnVjdCBtY19SR0IKKyAgICAgIHsKKyAgICAgICAgZG91YmxlIHJlZDsKKyAgICAgICAg ZG91YmxlIGdyZWVuOworICAgICAgICBkb3VibGUgYmx1ZTsKKyAgICAgIH0gZmcsIGJnOworICAg ICAgYm9vbF9iZiBhY3RpdmVfcCA6IDE7CisgICAgICBlbnVtIG1jX2ZsYXZvcgorICAgICAgewor ICAgICAgICBOT19GTEFWT1IsCisgICAgICAgIE1DX0dMWVBILAorICAgICAgICBNQ19HTFlQSExF U1MsCisgICAgICAgIE1DX09WRVJMQVlfQVJST1dfQklUTUFQLAorICAgICAgICBNQ19QSUxDUk9X LAorICAgICAgICBNQ19IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XLAorICAgICAgICBNQ19S RVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XLAorICAgICAgICBNQ19IT0xMT1df UkVDVEFOR0xFLAorICAgICAgICBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1csCisgICAgICAg IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVywKKyAgICAgICAgTUNfVkVSVElD QUxfQkFSLAorICAgICAgICBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIsCisgICAgICAgIE1DX1ZF UlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgIH0gZ2x5cGhfZmxhdm9yOworICAgICAgZW51bSBt Y19yb3dfcG9zaXRpb24KKyAgICAgIHsKKyAgICAgICAgUFJFX1pWLAorICAgICAgICBBVF9aViwK KyAgICAgICAgUE9TVF9aVgorICAgICAgfSByb3dfcG9zaXRpb247CisgICAgICBib29sX2JmIGVu YWJsZWRfcCA6IDE7CisgICAgfSAqY2FjaGVbNF07CisgIH0gKnZwb3M7CisgIC8qIFVzZWQgZWxz ZXdoZXJlLiAqLworICBzdHJ1Y3QgbWNfZXNzZW50aWFscworICB7CisgICAgYm9vbF9iZiBhY3Rp dmVfcCA6IDE7CisgICAgc3RydWN0IG1jX1JHQiBjaF9mZ1szXSwgZmNfZmdbM10sIHNwX2ZnOwor ICAgIGludCBmY194OworICAgIGludCB6djsKKyAgICBpbnQgenZfYnl0ZTsKKyAgfSBlc3NlbnRp YWxzOworICAvKiBVc2VkIGVsc2V3aGVyZS4gKi8KKyAgZW51bSBtY19lbmdpbmVfdHlwZQorICB7 CisgICAgTVVMVElQTEVfQ1VSU09SUywKKyAgICBIT1JJWk9OVEFMX1JVTEVSLAorICAgIFZFUlRJ Q0FMX1JVTEVSLAorICAgIEZJTExfQ09MVU1OLAorICAgIENVUlNPUl9JTkRJQ0FUT1IKKyAgfSBh Y3Rpb25fdHlwZTsKKyAgLyogVXNlZCBlbHNld2hlcmUuICovCisgIGVudW0gbWNfcHJlX3Njcm9s bF9jbGVhbl90eXBlCisgIHsKKyAgICBUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhf RE9XTiwKKyAgICBUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfVVAsCisgICAgVFJZ X1dJTkRPV19JRAorICB9IG1jX3ByZV9zY3JvbGxfY2xlYW5fdHlwZV9fZnJvbV93aGVyZTsKKyAg LyogVXNlZCBlbHNld2hlcmUuICovCisgIGVudW0gbWNfZHJhd19yb3dfdHlwZQorICB7CisgICAg Tk9XSEVSRSwKKyAgICBTQ1JJQkVfT05FLAorICAgIFNDUklCRV9UV08sCisgICAgU0NSSUJFX1RI UkVFLAorICAgIFNLSVBQRUQsCisgICAgUE9TVF9DSEFOR0VELAorICAgIFVOQ0hBTkdFRCwKKyAg ICBTRVRfQ1VSU09SX09ORSwKKyAgICBTRVRfQ1VSU09SX1RXTworICB9IG1jX2RyYXdfcm93X3R5 cGVfX2Zyb21fd2hlcmU7CisgIC8qIFVzZWQgZWxzZXdoZXJlLiAqLworICBlbnVtIG1jX3JlZHJh d19yb3dfdHlwZQorICB7CisgICAgVVBEQVRFX1dJTkRPV19fUkVEUkFXX09WRVJMQVBQRURfUk9X UywKKyAgICBHVUlfSU5TRVJUX0dMWVBIUywKKyAgICBHVUlfRklYX09WRVJMQVBQSU5HX0FSRUEs CisgICAgRFJBV19ST1dfV0lUSF9NT1VTRV9GQUNFLAorICAgIEVYUE9TRV9BUkVBX09ORSwKKyAg ICBFWFBPU0VfQVJFQV9UV08sCisgICAgRVhQT1NFX0xJTkUKKyAgfSBtY19yZWRyYXdfcm93X3R5 cGVfX2Zyb21fd2hlcmU7Cit9IG1jX21hdHJpeDsKKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMg Ki8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAvKiBDdXJzb3IgdHlwZSBvZiBs YXN0IGN1cnNvciBkcmF3biBvbiB0aGUgd2luZG93LiAgKi8KICAgICBlbnVtIHRleHRfY3Vyc29y X2tpbmRzIHBoeXNfY3Vyc29yX3R5cGU7CiAKZGlmZiAtLWdpdCBhL3NyYy94ZGlzcC5jIGIvc3Jj L3hkaXNwLmMKaW5kZXggNTBmNjQ0My4uMzEzNzg4YSAxMDA2NDQKLS0tIGEvc3JjL3hkaXNwLmMK KysrIGIvc3JjL3hkaXNwLmMKQEAgLTk2Miw2ICs5NjIs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nbHlwaF9zdHJpbmdf bGlzdHMgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKiosIHN0cnVjdCBnbHlwaF9zdHJpbmcgKiosCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGdseXBoX3N0cmlu ZyAqLCBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICopOworc3RhdGljIHZvaWQgYXBwZW5kX2dseXBoX3N0 cmluZ19saXN0cyAoc3RydWN0IGdseXBoX3N0cmluZyAqKiwgc3RydWN0IGdseXBoX3N0cmluZyAq KiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9z dHJpbmcgKiwgc3RydWN0IGdseXBoX3N0cmluZyAqKTsKK3N0YXRpYyB2b2lkIGluaXRfZ2x5cGhf c3RyaW5nIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICosIE1DX09QVElPTkFMX0hEQyAoaGRjKSB1bnNp Z25lZCAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCB3aW5kb3cgKiwg c3RydWN0IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0g Z2x5cGhfcm93X2FyZWEsIGludCwgZW51bSBkcmF3X2dseXBoc19mYWNlKTsKK3N0YXRpYyB2b2lk IGNvbXB1dGVfb3ZlcmhhbmdzX2FuZF94IChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICosIGludCwgYm9v bCk7CitzdGF0aWMgc3RydWN0IGdseXBoX3N0cmluZyAqIGdseXBoX3N0cmluZ19jb250YWluaW5n X2JhY2tncm91bmRfd2lkdGggKHN0cnVjdCBnbHlwaF9zdHJpbmcgKik7CitzdGF0aWMgdm9pZCBz ZXRfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmRfd2lkdGggKHN0cnVjdCBnbHlwaF9zdHJpbmcgKiwg aW50LCBpbnQpOworc3RhdGljIGludCBmaWxsX2d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0dMWVBIX1NUUklORyAoU1RBUlQs IEVORCwgSEVBRCwgVEFJTCwJXAorCQkJCQkgICAgSEwsIFgsIExBU1RfWCk7CQlcCisJICAgICAg ZWxzZQkJCQkJCQlcCisJCU1DX0JVSUxEX0NPTVBPU0lURV9HTFlQSF9TVFJJTkcgKFNUQVJULCBF TkQsIEhFQUQsIFRBSUwsCVwKKwkJCQkJICAgICAgSEwsIFgsIExBU1RfWCk7CQlcCisJICAgICAg YnJlYWs7CQkJCQkJCVwKKwkJCQkJCQkJCVwKKwkgICAgY2FzZSBTVFJFVENIX0dMWVBIOgkJCQkJ CVwKKwkgICAgICBNQ19CVUlMRF9TVFJFVENIX0dMWVBIX1NUUklORyAoU1RBUlQsIEVORCwgSEVB RCwgVEFJTCwJXAorCQkJCQkgIEhMLCBYLCBMQVNUX1gpOwkJXAorCSAgICAgIGJyZWFrOwkJCQkJ CQlcCisJCQkJCQkJCQlcCisJICAgIGNhc2UgSU1BR0VfR0xZUEg6CQkJCQkJXAorCSAgICAgIE1D X0JVSUxEX0lNQUdFX0dMWVBIX1NUUklORyAoU1RBUlQsIEVORCwgSEVBRCwgVEFJTCwJCVwKKwkJ CQkJSEwsIFgsIExBU1RfWCk7CQkJXAorCSAgICAgIGJyZWFrOworCisjZGVmaW5lIE1DX0JVSUxE X0dMWVBIX1NUUklOR1NfWFcoU1RBUlQsIEVORCwgSEVBRCwgVEFJTCwgSEwsIFgsIExBU1RfWCkJ XAorICAgICAgICAgICAgY2FzZSBYV0lER0VUX0dMWVBIOiAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICBNQ19CVUlMRF9YV0lER0VUX0dMWVBI X1NUUklORyAoU1RBUlQsIEVORCwgSEVBRCwgVEFJTCwgICAgICAgXAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgSEwsIFgsIExBU1RfWCk7ICAgICAgICAgICAgICAg XAorICAgICAgICAgICAgICBicmVhazs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UpOworfQorCitMaXNw X09iamVjdAorbWNfbGlzdG4gKHB0cmRpZmZfdCBjb3VudCwgTGlzcF9PYmplY3QgYXJnLCAuLi4p Cit7CisgIGVhc3N1bWUgKDAgPCBjb3VudCk7CisgIExpc3BfT2JqZWN0IHZhbCA9IEZjb25zIChh cmcsIFFuaWwpOworICBMaXNwX09iamVjdCB0YWlsID0gdmFsOworICB2YV9saXN0IGFwOworICB2 YV9zdGFydCAoYXAsIGFyZyk7CisgIGZvciAocHRyZGlmZl90IGkgPSAxOyBpIDwgY291bnQ7IGkr KykKKyAgICB7CisgICAgICBMaXNwX09iamVjdCBlbGVtID0gRmNvbnMgKHZhX2FyZyAoYXAsIExp c3BfT2JqZWN0KSwgUW5pbCk7CisgICAgICBYU0VUQ0RSICh0YWlsLCBlbGVtKTsKKyAgICAgIHRh aWwgPSBlbGVtOworICAgIH0KKyAgdmFfZW5kIChhcCk7CisgIHJldHVybiB2YWw7Cit9CisKK0xp c3BfT2JqZWN0CittY19tZW1xIChMaXNwX09iamVjdCBlbHQsIExpc3BfT2JqZWN0IGxpc3QpCit7 CisgIHdoaWxlICgxKQorICAgIHsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpIHx8IEVRIChYQ0FS IChsaXN0KSwgZWx0KSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7 CisgICAgICBpZiAoIUNPTlNQIChsaXN0KSB8fCBFUSAoWENBUiAobGlzdCksIGVsdCkpCisgICAg ICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAo bGlzdCkgfHwgRVEgKFhDQVIgKGxpc3QpLCBlbHQpKQorICAgICAgICBicmVhazsKKyAgICAgIGxp c3QgPSBYQ0RSIChsaXN0KTsKKyAgICB9CisgIHJldHVybiBsaXN0OworfQorCitMaXNwX09iamVj dAorbWNfbnRoIChpbnQgbnVtLCBMaXNwX09iamVjdCBsaXN0KQoreworICBmb3IgKGludCBpID0g MDsgaSA8IG51bSAmJiAhTklMUCAobGlzdCk7IGkrKykKKyAgICBsaXN0ID0gWENEUiAobGlzdCk7 CisgIGlmIChDT05TUCAobGlzdCkpCisgICAgcmV0dXJuIFhDQVIgKGxpc3QpOworICAgIGVsc2UK KyAgICAgIHJldHVybiBRbmlsOworfQorCitMaXNwX09iamVjdAorbWNfYXNzcSAoTGlzcF9PYmpl Y3Qga2V5LCBMaXNwX09iamVjdCBsaXN0KQoreworICB3aGlsZSAoMSkKKyAgICB7CisgICAgICBp ZiAoIUNPTlNQIChsaXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAg ICAgICAgICAgICYmIEVRIChYQ0FSIChYQ0FSIChsaXN0KSksIGtleSkpKQorICAgICAgICBicmVh azsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisg ICAgICAgICAgfHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgRVEgKFhD QVIgKFhDQVIgKGxpc3QpKSwga2V5KSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhD RFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1Ag KFhDQVIgKGxpc3QpKQorICAgICAgICAgICAgICAmJiBFUSAoWENBUiAoWENBUiAobGlzdCkpLCBr ZXkpKSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgfQor ICBpZiAoQ09OU1AgKGxpc3QpKQorICAgIHJldHVybiBYQ0FSIChsaXN0KTsKKyAgICBlbHNlCisg ICAgICByZXR1cm4gUW5pbDsKK30KKworTGlzcF9PYmplY3QKK21jX2Fzc29jIChMaXNwX09iamVj dCBrZXksIExpc3BfT2JqZWN0IGxpc3QpCit7CisgIExpc3BfT2JqZWN0IGNhcjsKKyAgd2hpbGUg KDEpCisgICAgeworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1Ag KFhDQVIgKGxpc3QpKQorICAgICAgICAgICAgICAmJiAoY2FyID0gWENBUiAoWENBUiAobGlzdCkp LAorICAgICAgICAgICAgICAgICAgRVEgKGNhciwga2V5KSB8fCAhTklMUCAoRmVxdWFsIChjYXIs IGtleSkpKSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAg ICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQor ICAgICAgICAgICAgICAmJiAoY2FyID0gWENBUiAoWENBUiAobGlzdCkpLAorICAgICAgICAgICAg ICAgICAgRVEgKGNhciwga2V5KSB8fCAhTklMUCAoRmVxdWFsIChjYXIsIGtleSkpKSkpCisgICAg ICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgICAgaWYgKCFDT05TUCAo bGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxpc3QpKQorICAgICAgICAgICAgICAm JiAoY2FyID0gWENBUiAoWENBUiAobGlzdCkpLAorICAgICAgICAgICAgICAgICAgRVEgKGNhciwg a2V5KSB8fCAhTklMUCAoRmVxdWFsIChjYXIsIGtleSkpKSkpCisgICAgICAgIGJyZWFrOworICAg ICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgIH0KKyAgaWYgKENPTlNQIChsaXN0KSkKKyAgICBy ZXR1cm4gWENBUiAobGlzdCk7CisgICAgZWxzZQorICAgICAgcmV0dXJuIFFuaWw7Cit9CisKK0xp c3BfT2JqZWN0CittY19wbGlzdF9nZXQgKExpc3BfT2JqZWN0IHBsaXN0LCBMaXNwX09iamVjdCBw cm9wKQoreworICBMaXNwX09iamVjdCB0YWlsLCBoYWxmdGFpbDsKKyAgLyogaGFsZnRhaWwgaXMg dXNlZCB0byBkZXRlY3QgY2lyY3VsYXIgbGlzdHMuICAqLworICB0YWlsID0gaGFsZnRhaWwgPSBw bGlzdDsKKyAgd2hpbGUgKENPTlNQICh0YWlsKSAmJiBDT05TUCAoWENEUiAodGFpbCkpKQorICAg IHsKKyAgICAgIGlmIChFUSAocHJvcCwgWENBUiAodGFpbCkpKQorICAgICAgICByZXR1cm4gWENB UiAoWENEUiAodGFpbCkpOworICAgICAgdGFpbCA9IFhDRFIgKFhDRFIgKHRhaWwpKTsKKyAgICAg IGhhbGZ0YWlsID0gWENEUiAoaGFsZnRhaWwpOworICAgICAgaWYgKEVRICh0YWlsLCBoYWxmdGFp bCkpCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgcmV0dXJuIFFuaWw7Cit9CisKKy8qIFJFR0lP TiBCRUdJTjogIG1jX3JlZ2lvbl9saW1pdCAoMSkKKyAgIFJFR0lPTiBFTkQ6ICBtY19yZWdpb25f bGltaXQgKDApICovCitwdHJkaWZmX3QKK21jX3JlZ2lvbl9saW1pdCAoYm9vbCBiZWdpbl9wKQor eworICBpZiAoIU5JTFAgKFZ0cmFuc2llbnRfbWFya19tb2RlKQorICAgICAgJiYgTklMUCAoVm1h cmtfZXZlbl9pZl9pbmFjdGl2ZSkKKyAgICAgICYmIE5JTFAgKEJWQVIgKGN1cnJlbnRfYnVmZmVy LCBtYXJrX2FjdGl2ZSkpKQorICAgIHhzaWduYWwwIChRbWFya19pbmFjdGl2ZSk7CisgIExpc3Bf T2JqZWN0IG1hcmtlciA9IEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBtYXJrKTsKKyAgaW50IG0gPSAo WE1BUktFUiAobWFya2VyKS0+YnVmZmVyKQorICAgICAgICAgID8gWE1BUktFUiAobWFya2VyKS0+ Y2hhcnBvcworICAgICAgICAgIDogLTE7CisgIHJldHVybiAobSA9PSAtMSkKKyAgICAgICAgICAg PyAtMQorICAgICAgICAgOiAoUFQgPCBtKSA9PSBiZWdpbl9wCisgICAgICAgICAgID8gUFQKKy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AgICAgICAgICAgICAgICAgICAgICAgICA6IE1PU1Rf UE9TSVRJVkVfRklYTlVNKTsKKyAgICAgIGlmICgocHJvcCA9IG1jX3BsaXN0X2dldCAocGxpc3Qs IFFDd2lkdGgpLCBSQU5HRURfRklYTlVNUCAoMCwgcHJvcCwgSU5UX01BWCkpCisgICAgICAgICAg fHwgKHByb3AgPSBtY19wbGlzdF9nZXQgKHBsaXN0LCBRQ3JlbGF0aXZlX3dpZHRoKSwKKyAgICAg ICAgICAgICAgUkFOR0VEX0ZJWE5VTVAgKDAsIHByb3AsIElOVF9NQVgpKSkKKyAgICAgICAgd2lk dGggPSBYRklYTlVNIChwcm9wKTsKKyAgICAgICAgZWxzZSBpZiAoRkxPQVRQIChwcm9wKSAmJiAw IDw9IFhGTE9BVF9EQVRBIChwcm9wKQorICAgICAgICAgICAgICAgICAmJiBYRkxPQVRfREFUQSAo cHJvcCkgPD0gSU5UX01BWCkKKyAgICAgICAgICB3aWR0aCA9IChpbnQpKFhGTE9BVF9EQVRBIChw cm9wKSArIDAuNSk7CisgICAgICAgICAgZWxzZSBpZiAoKHByb3AgPSBtY19wbGlzdF9nZXQgKHBs aXN0LCBRQ2FsaWduX3RvKSwKKyAgICAgICAgICAgICAgICAgICAgUkFOR0VEX0ZJWE5VTVAgKGNv bCwgcHJvcCwgYWxpZ25fdG9fbWF4KSkpCisgICAgICAgICAgICB3aWR0aCA9IFhGSVhOVU0gKHBy b3ApIC0gY29sOworICAgICAgICAgICAgICBlbHNlIGlmIChGTE9BVFAgKHByb3ApICYmIGNvbCA8 PSBYRkxPQVRfREFUQSAocHJvcCkKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgKFhGTE9BVF9E QVRBIChwcm9wKSA8PSBhbGlnbl90b19tYXgpKQorICAgICAgICAgICAgICAgIHdpZHRoID0gKGlu dCkoWEZMT0FUX0RBVEEgKHByb3ApICsgMC41KSAtIGNvbDsKKyAgICAgIGlmICh3aWR0aCA+PSAw KQorICAgICAgICB7CisgICAgICAgICAgcHRyZGlmZl90IHN0YXJ0OworICAgICAgICAgIGlmIChP VkVSTEFZUCAob3ZlcmxheSkpCisgICAgICAgICAgICAqZW5kcG9zID0gT1ZFUkxBWV9QT1NJVElP TiAoT1ZFUkxBWV9FTkQgKG92ZXJsYXkpKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgZ2V0X3Byb3BlcnR5X2FuZF9yYW5nZSAocG9zLCBRZGlzcGxheSwgJnZhbCwgJnN0YXJ0LCBl bmRwb3MsIFFuaWwpOworICAgICAgICAgIC8qIEZvciA6cmVsYXRpdmUtd2lkdGgsIHdlIG5lZWQg dG8gbXVsdGlwbHkgYnkgdGhlIGNvbHVtbgorICAgICAgICAgICAgIHdpZHRoIG9mIHRoZSBjaGFy YWN0ZXIgYXQgUE9TLCBpZiBpdCBpcyBncmVhdGVyIHRoYW4gMS4gKi8KKyAgICAgICAgICBpZiAo IU5JTFAgKG1jX3BsaXN0X2dldCAocGxpc3QsIFFDcmVsYXRpdmVfd2lkdGgpKQorICAgICAgICAg ICAgICAmJiAhTklMUCAoQlZBUiAoY3VycmVudF9idWZmZXIsIGVuYWJsZV9tdWx0aWJ5dGVfY2hh cmFjdGVycykpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpbnQgYiwgd2Q7CisgICAg ICAgICAgICAgIHVuc2lnbmVkIGNoYXIgKnAgPSBCWVRFX1BPU19BRERSIChDSEFSX1RPX0JZVEUg KHBvcykpOworICAgICAgICAgICAgICBNQ19NVUxUSUJZVEVfQllURVNfV0lEVEggKHAsIGJ1ZmZl cl9kaXNwbGF5X3RhYmxlICgpLCBiLCB3ZCk7CisgICAgICAgICAgICAgIHdpZHRoICo9IHdkOwor ICAgICAgICAgICAgfQorICAgICAgICAgIHJldHVybiB3aWR0aDsKKyAgICAgICAgfQorICAgIH0K KyAgcmV0dXJuIC0xOworfQorCisvKiBUcnkgdG8gY29tcG9zZSB0aGUgY2hhcmFjdGVycyBhdCBD SEFSU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9kYXRhICgpOworICByZSA9IEFSRUYg KHJ1bGUsIDApOworICBpZiAoTklMUCAocmUpKQorICAgIGxlbiA9IDE7CisgIGVsc2UgaWYgKCEg U1RSSU5HUCAocmUpKQorICAgIHJldHVybiB1bmJpbmRfdG8gKGNvdW50LCBRbmlsKTsKKyAgZWxz ZSBpZiAoKGxlbiA9IGZhc3RfbG9va2luZ19hdCAocmUsIGNoYXJwb3MsIGJ5dGVwb3MsIGxpbWl0 LCAtMSwgc3RyaW5nKSkKKyAgICAgICAgICAgPiAwKQorICAgIHsKKyAgICAgIGlmIChOSUxQIChz dHJpbmcpKQorICAgICAgICBsZW4gPSBCWVRFX1RPX0NIQVIgKGJ5dGVwb3MgKyBsZW4pIC0gY2hh cnBvczsKKyAgICAgIGVsc2UKKyAgICAgICAgbGVuID0gc3RyaW5nX2J5dGVfdG9fY2hhciAoc3Ry aW5nLCBieXRlcG9zICsgbGVuKSAtIGNoYXJwb3M7CisgICAgfQorICBpZiAobGVuIDw9IDApCisg ICAgcmV0dXJuIHVuYmluZF90byAoY291bnQsIFFuaWwpOworICB0byA9IGxpbWl0ID0gY2hhcnBv cyArIGxlbjsKKyNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KKyAgaWYgKEZSQU1FX1dJTkRPV19Q IChmKSkKKyAgICB7CisgICAgICBmb250X29iamVjdCA9IGZvbnRfcmFuZ2UgKGNoYXJwb3MsIGJ5 dGVwb3MsICZ0bywgd2luLCBmYWNlLCBzdHJpbmcpOworICAgICAgaWYgKCEgRk9OVF9PQkpFQ1Rf UCAoZm9udF9vYmplY3QpCisgICAgICAgICAgfHwgKCEgTklMUCAocmUpCisgICAgICAgICAgICAg ICYmIHRvIDwgbGltaXQKKyAgICAgICAgICAgICAgJiYgKGZhc3RfbG9va2luZ19hdCAocmUsIGNo YXJwb3MsIGJ5dGVwb3MsIHRvLCAtMSwgc3RyaW5nKSA8PSAwKSkpCisgICAgICAgIHJldHVybiB1 bmJpbmRfdG8gKGNvdW50LCBRbmlsKTsKKyAgICB9CisgIGVsc2UKKyNlbmRpZiAgICAgICAgLyog bm90IEhBVkVfV0lORE9XX1NZU1RFTSAqLworICAgIGZvbnRfb2JqZWN0ID0gd2luLT5mcmFtZTsK KyAgbGdzdHJpbmcgPSBGY29tcG9zaXRpb25fZ2V0X2dzdHJpbmcgKHBvcywgbWFrZV9maXhudW0g KHRvKSwgZm9udF9vYmplY3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBzdHJpbmcpOworICBpZiAoTklMUCAoTEdTVFJJTkdfSUQgKGxnc3RyaW5nKSkpCisgICAgewor ICAgICAgLyogU2F2ZSBwb2ludCBhcyBtYXJrZXIgYmVmb3JlIGNhbGxpbmcgb3V0IHRvIGxpc3Au ICAqLworICAgICAgaWYgKE5JTFAgKHN0cmluZykpCisgICAgICAgIHJlY29yZF91bndpbmRfcHJv dGVjdCAocmVzdG9yZV9wb2ludF91bndpbmQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgYnVpbGRfbWFya2VyIChjdXJyZW50X2J1ZmZlciwgcHQsIHB0X2J5dGUpKTsKKyAgICAgIGxn c3RyaW5nID0gc2FmZV9jYWxsICg2LCBWYXV0b19jb21wb3NpdGlvbl9mdW5jdGlvbiwgQVJFRiAo cnVsZSwgMiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zLCBtYWtlX2ZpeG51bSAo dG8pLCBmb250X29iamVjdCwgc3RyaW5nKTsKKyAgICB9CisgIHJldHVybiB1bmJpbmRfdG8gKGNv dW50LCBsZ3N0cmluZyk7Cit9CisKKy8qIENoZWNrIGlmIHRoZSBjaGFyYWN0ZXIgYXQgQ0hBUlBP UyAoYW5kIEJZVEVQT1MpIGlzIGNvbXBvc2VkCisgICAocG9zc2libHkgd2l0aCB0aGUgZm9sbG93 aW5nIGNoYXJhY3RlcnMpIG9uIHdpbmRvdyBXLiAgRU5EUE9TIGxpbWl0cworICAgY2hhcmFjdGVy cyB0byBi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G9zKQorICAgICAgICAvKiBUaGUgY3VycmVudCBw b3NpdGlvbiBpcyBub3QgY29tcG9zZWQuICAqLworICAgICAgICByZXR1cm4gMDsKKyAgICB9Cisg IGlmIChlbmRwb3MgPCAwKQorICAgIGVuZHBvcyA9IE5JTFAgKHN0cmluZykgPyBCRUdWIDogMDsK KyAgaWYgKGNtcF9pdC0+Y2ggPCAwKQorICAgIHsKKyAgICAgIC8qIFdlIGFyZSBsb29raW5nIGF0 IGEgc3RhdGljIGNvbXBvc2l0aW9uLiAgKi8KKyAgICAgIHB0cmRpZmZfdCBzdGFydCwgZW5kOwor ICAgICAgTGlzcF9PYmplY3QgcHJvcDsKKyAgICAgIGZpbmRfY29tcG9zaXRpb24gKGNoYXJwb3Ms IC0xLCAmc3RhcnQsICZlbmQsICZwcm9wLCBzdHJpbmcpOworICAgICAgY21wX2l0LT5pZCA9IGdl dF9jb21wb3NpdGlvbl9pZCAoY2hhcnBvcywgYnl0ZXBvcywgZW5kIC0gc3RhcnQsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9wLCBzdHJpbmcpOworICAgICAgaWYg KGNtcF9pdC0+aWQgPCAwKQorICAgICAgICBnb3RvIG5vX2NvbXBvc2l0aW9uOworICAgICAgY21w X2l0LT5uY2hhcnMgPSBlbmQgLSBzdGFydDsKKyAgICAgIGNtcF9pdC0+bmdseXBocyA9IGNvbXBv c2l0aW9uX3RhYmxlW2NtcF9pdC0+aWRdLT5nbHlwaF9sZW47CisgICAgfQorICBlbHNlIGlmICh3 KQorICAgIHsKKyAgICAgIExpc3BfT2JqZWN0IGxnc3RyaW5nID0gUW5pbDsKKyAgICAgIExpc3Bf T2JqZWN0IHZhbCwgZWx0OworICAgICAgcHRyZGlmZl90IGk7CisgICAgICB2YWwgPSBDSEFSX1RB QkxFX1JFRiAoVmNvbXBvc2l0aW9uX2Z1bmN0aW9uX3RhYmxlLCBjbXBfaXQtPmNoKTsKKyAgICAg IGZvciAoaSA9IDA7IGkgPCBjbXBfaXQtPnJ1bGVfaWR4OyBpKyssIHZhbCA9IFhDRFIgKHZhbCkp OworICAgICAgaWYgKGNoYXJwb3MgPCBlbmRwb3MpCisgICAgICAgIHsKKyAgICAgICAgICBmb3Ig KDsgQ09OU1AgKHZhbCk7IHZhbCA9IFhDRFIgKHZhbCkpCisgICAgICAgICAgICB7CisgICAgICAg ICAgICAgIGVsdCA9IFhDQVIgKHZhbCk7CisgICAgICAgICAgICAgIGlmICghIFZFQ1RPUlAgKGVs dCkgfHwgQVNJWkUgKGVsdCkgIT0gMworICAgICAgICAgICAgICAgICAgfHwgISBJTlRFR0VSUCAo QVJFRiAoZWx0LCAxKSkpCisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAg IGlmIChYRklYTkFUIChBUkVGIChlbHQsIDEpKSAhPSBjbXBfaXQtPmxvb2tiYWNrKQorICAgICAg ICAgICAgICAgIGdvdG8gbm9fY29tcG9zaXRpb247CisgICAgICAgICAgICAgIGxnc3RyaW5nID0g bWNfYXV0b2NtcF9jaGFycyAoZWx0LCBjaGFycG9zLCBieXRlcG9zLCBlbmRwb3MsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdywgZmFjZSwgc3RyaW5nKTsKKyAgICAg ICAgICAgICAgaWYgKGNvbXBvc2l0aW9uX2dzdHJpbmdfcCAobGdzdHJpbmcpKQorICAgICAgICAg ICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBsZ3N0cmluZyA9IFFuaWw7CisgICAgICAgICAg ICAgIC8qIENvbXBvc2l0aW9uIGZhaWxlZCBwZXJoYXBzIGJlY2F1c2UgdGhlIGZvbnQgZG9lc24n dAorICAgICAgICAgICAgICAgICBzdXBwb3J0IHN1ZmZpY2llbnQgcmFuZ2Ugb2YgY2hhcmFjdGVy cy4gIFRyeSB0aGUKKyAgICAgICAgICAgICAgICAgb3RoZXIgY29tcG9zaXRpb24gcnVsZXMgaWYg YW55LiAgKi8KKyAgICAgICAgICAgIH0KKyAgICAgICAgICBjbXBfaXQtPnJldmVyc2VkX3AgPSAw OworICAgICAgICB9CisgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICBwdHJkaWZmX3Qg Y3BvcyA9IGNoYXJwb3MsIGJwb3MgPSBieXRlcG9zOworICAgICAgICAgIGNtcF9pdC0+cmV2ZXJz ZWRfcCA9IDE7CisgICAgICAgICAgZWx0ID0gWENBUiAodmFsKTsKKyAgICAgICAgICBpZiAoY21w X2l0LT5sb29rYmFjayA+IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGNwb3MgPSBj aGFycG9zIC0gY21wX2l0LT5sb29rYmFjazsKKyAgICAgICAgICAgICAgaWYgKFNUUklOR1AgKHN0 cmluZykpCisgICAgICAgICAgICAgICAgYnBvcyA9IHN0cmluZ19jaGFyX3RvX2J5dGUgKHN0cmlu ZywgY3Bvcyk7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBicG9zID0gQ0hB Ul9UT19CWVRFIChjcG9zKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBsZ3N0cmluZyA9IG1j X2F1dG9jbXBfY2hhcnMgKGVsdCwgY3BvcywgYnBvcywgY2hhcnBvcyArIDEsIHcsIGZhY2UsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJpbmcpOworICAgICAgICAgIGlm ICghIGNvbXBvc2l0aW9uX2dzdHJpbmdfcCAobGdzdHJpbmcpCisgICAgICAgICAgICAgIHx8IGNw b3MgKyBMR1NUUklOR19DSEFSX0xFTiAobGdzdHJpbmcpIC0gMSAhPSBjaGFycG9zKQorICAgICAg ICAgICAgLyogQ29tcG9zaXRpb24gZmFpbGVkIG9yIGRpZG4ndCBjb3ZlciB0aGUgY3VycmVudAor ICAgICAgICAgICAgICAgY2hhcmFjdGVyLiAgKi8KKyAgICAgICAgICAgIGdvdG8gbm9fY29tcG9z aXRpb247CisgICAgICAgIH0KKyAgICAgIGlmIChOSUxQIChsZ3N0cmluZykpCisgICAgICAgIGdv dG8gbm9fY29tcG9zaXRpb247CisgICAgICBpZiAoTklMUCAoTEdTVFJJTkdfSUQgKGxnc3RyaW5n KSkpCisgICAgICAgIGxnc3RyaW5nID0gY29tcG9zaXRpb25fZ3N0cmluZ19wdXRfY2FjaGUgKGxn c3RyaW5nLCAtMSk7CisgICAgICBjbXBfaXQtPmlkID0gWEZJWE5VTSAoTEdTVFJJTkdfSUQgKGxn c3RyaW5nKSk7CisgICAgICBmb3IgKGkgPSAwOyBpIDwgTEdTVFJJTkdfR0xZUEhfTEVOIChsZ3N0 cmluZyk7IGkrKykKKyAgICAgICAgaWYgKE5JTFAgKExHU1RSSU5HX0dMWVBIIChsZ3N0cmluZywg aSkpKQorICAgICAgICAgIGJyZWFrOworICAgICAgY21wX2l0LT5uZ2x5cGhzID0gaTsKKyAgICAg IGNtcF9pdC0+ZnJvbSA9IDA7CisgICAgICBjbXBfaXQtPnRvID0gaTsKKyAgICB9CisgIGVsc2UK KyAgICBnb3RvIG5vX2NvbXBvc2l0aW9uOworICByZXR1cm4gMTsKKyBub19jb21wb3NpdGlvbjoK KyAgaWYgKGNoYXJwb3MgPT0gZW5kcG9zKQorICAgIHJldHVybiAwOworICBpZiAoY2hhcnBvcyA8 IGVuZHBvcykKKyAgICB7CisgICAgICBjaGFycG9zKys7CisgICAgICBpZiAoTklMUCAoc3RyaW5n KSkKKyAgICAgICAgSU5DX1BPUyAoYnl0ZXBvcyk7CisgICAgICBlbHNlCisgICAgICAgIGJ5dGVw b3MgKz0gQllURVNfQllfQ0hBUl9IRUFEICgqKFNEQVRBIChzdHJpbmcpICsgYnl0ZXBvcykpOwor ICAgIH0KKyAgZWxzZQorICAgIHsKKyAgICAgIGNoYXJwb3MtLTsKKyAgICAgIC8qIEJZVEVQT1Mg aXMgY2FsY3VsYXRlZCBpbiBjb21wb3NpdGlvbl9jb21wdXRlX3N0b3BfcG9zICovCisgICAgICBi eXRlcG9zID0g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2FuX2J5dGUsIGVuZCwgUW5p bCk7CisgIC8qIFNjYW4gZm9yd2FyZCB0byB0aGUgdGFyZ2V0IHBvc2l0aW9uLiAqLworICB3aGls ZSAoc2NhbiA8IGVuZCkKKyAgICB7CisgICAgICBpbnQgYzsKKyAgICAgIC8qIE9jY2FzaW9uYWxs eSB3ZSBtYXkgbmVlZCB0byBza2lwIGludmlzaWJsZSB0ZXh0LiAqLworICAgICAgd2hpbGUgKHNj YW4gPT0gbmV4dF9ib3VuZGFyeSkKKyAgICAgICAgeworICAgICAgICAgIHB0cmRpZmZfdCBvbGRf c2NhbiA9IHNjYW47CisgICAgICAgICAgLyogVGhpcyB1cGRhdGVzIE5FWFRfQk9VTkRBUlkgdG8g dGhlIG5leHQgcGxhY2UKKyAgICAgICAgICAgICB3aGVyZSB3ZSBtaWdodCBuZWVkIHRvIHNraXAg bW9yZSBpbnZpc2libGUgdGV4dC4gKi8KKyAgICAgICAgICBzY2FuID0gc2tpcF9pbnZpc2libGUg KHNjYW4sICZuZXh0X2JvdW5kYXJ5LCBlbmQsIFFuaWwpOworICAgICAgICAgIGlmIChzY2FuICE9 IG9sZF9zY2FuKQorICAgICAgICAgICAgc2Nhbl9ieXRlID0gQ0hBUl9UT19CWVRFIChzY2FuKTsK KyAgICAgICAgICBpZiAoc2NhbiA+PSBlbmQpCisgICAgICAgICAgICBnb3RvIGVuZGxvb3A7Cisg ICAgICAgIH0KKyAgICAgIC8qIFRlc3QgcmVhY2hpbmcgdGhlIGdvYWwgY29sdW1uLiAgV2UgZG8g dGhpcyBhZnRlciBza2lwcGluZworICAgaW52aXNpYmxlIGNoYXJhY3RlcnMsIHNvIHRoYXQgd2Ug cHV0IHBvaW50IGJlZm9yZSB0aGUKKyAgIGNoYXJhY3RlciBvbiB3aGljaCB0aGUgY3Vyc29yIHdp bGwgYXBwZWFyLiAqLworICAgICAgaWYgKGNvbCA+PSBnb2FsKQorICAgICAgICBicmVhazsKKyAg ICAgIHByZXZfY29sID0gY29sOworICAgICAgeyAvKiBDaGVjayBkaXNwbGF5IHByb3BlcnR5LiAq LworICAgICAgICBwdHJkaWZmX3QgZW5kcDsKKyAgICAgICAgaW50IHdpZHRoID0gbWNfY2hlY2tf ZGlzcGxheV93aWR0aCAoc2NhbiwgY29sLCAmZW5kcCk7CisgICAgICAgIGlmICh3aWR0aCA+PSAw KQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGNvbCArPSB3aWR0aDsKKyAgICAgICAgICAgIGlm IChlbmRwID4gc2NhbikgLyogQXZvaWQgaW5maW5pdGUgbG9vcHMgd2l0aCAwLXdpZHRoIG92ZXJs YXlzLiAqLworICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc2NhbiA9IGVuZHA7Cisg ICAgICAgICAgICAgICAgc2Nhbl9ieXRlID0gQ0hBUl9UT19CWVRFIChzY2FuKTsKKyAgICAgICAg ICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgIH0K KyAgICAgIC8qIENoZWNrIGNvbXBvc2l0aW9uIHNlcXVlbmNlLiAqLworICAgICAgaWYgKGNtcF9p dC5pZCA+PSAwCisgICAgICAgICAgfHwgKHNjYW4gPT0gY21wX2l0LnN0b3BfcG9zCisgICAgICAg ICAgICAgICYmIG1jX2NvbXBvc2l0aW9uX3Jlc2VhdF9pdCAoJmNtcF9pdCwgc2Nhbiwgc2Nhbl9i eXRlLCBlbmQsIHcsIE5VTEwsIFFuaWwpKSkKKyAgICAgICAgY29tcG9zaXRpb25fdXBkYXRlX2l0 ICgmY21wX2l0LCBzY2FuLCBzY2FuX2J5dGUsIFFuaWwpOworICAgICAgaWYgKGNtcF9pdC5pZCA+ PSAwKQorICAgICAgICB7CisgICAgICAgICAgc2NhbiArPSBjbXBfaXQubmNoYXJzOworICAgICAg ICAgIHNjYW5fYnl0ZSArPSBjbXBfaXQubmJ5dGVzOworICAgICAgICAgIGlmIChzY2FuIDw9IGVu ZCkKKyAgICAgICAgICAgIGNvbCArPSBjbXBfaXQud2lkdGg7CisgICAgICAgICAgaWYgKGNtcF9p dC50byA9PSBjbXBfaXQubmdseXBocykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY21w X2l0LmlkID0gLTE7CisgICAgICAgICAgICAgIGNvbXBvc2l0aW9uX2NvbXB1dGVfc3RvcF9wb3Mg KCZjbXBfaXQsIHNjYW4sIHNjYW5fYnl0ZSwgZW5kLCBRbmlsKTsKKyAgICAgICAgICAgIH0KKyAg ICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgY21wX2l0LmZyb20gPSBjbXBfaXQudG87Cisg ICAgICAgICAgY29udGludWU7CisgICAgICAgIH0KKyAgICAgIGMgPSBGRVRDSF9CWVRFIChzY2Fu X2J5dGUpOworICAgICAgLyogU2VlIGlmIHRoZXJlIGlzIGEgZGlzcGxheSB0YWJsZSBhbmQgaXQg cmVsYXRlcyB0byB0aGlzIGNoYXJhY3Rlci4gKi8KKyAgICAgIGlmIChkcCAhPSAwCisgICAgICAg ICAgJiYgISAobXVsdGlieXRlICYmIExFQURJTkdfQ09ERV9QIChjKSkKKyAgICAgICAgICAmJiBW RUNUT1JQIChESVNQX0NIQVJfVkVDVE9SIChkcCwgYykpKQorICAgICAgICB7CisgICAgICAgICAg TGlzcF9PYmplY3QgY2hhcnZlYzsKKyAgICAgICAgICBwdHJkaWZmX3QgaSwgbjsKKyAgICAgICAg ICAvKiBUaGlzIGNoYXJhY3RlciBpcyBkaXNwbGF5ZWQgdXNpbmcgYSB2ZWN0b3Igb2YgZ2x5cGhz LgorICAgICAgICAgICAgIFVwZGF0ZSB0aGUgY29sdW1uL3Bvc2l0aW9uIGJhc2VkIG9uIHRob3Nl IGdseXBocy4gKi8KKyAgICAgICAgICBjaGFydmVjID0gRElTUF9DSEFSX1ZFQ1RPUiAoZHAsIGMp OworICAgICAgICAgIG4gPSBBU0laRSAoY2hhcnZlYyk7CisgICAgICAgICAgZm9yIChpID0gMDsg aSA8IG47IGkrKykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyogVGhpcyBzaG91bGQg YmUgaGFuZGxlZCB0aGUgc2FtZSBhcworICAgICAgICAgICAgICBuZXh0X2VsZW1lbnRfZnJvbV9k aXNwbGF5X3ZlY3RvciBkb2VzIGl0LiAqLworICAgICAgICAgICAgICBMaXNwX09iamVjdCBlbnRy eSA9IEFSRUYgKGNoYXJ2ZWMsIGkpOworICAgICAgICAgICAgICBpZiAoR0xZUEhfQ09ERV9QIChl bnRyeSkpCisgICAgICAgICAgICAgICAgYyA9IEdMWVBIX0NPREVfQ0hBUiAoZW50cnkpOworICAg ICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgYyA9ICcgJzsKKyAgICAgICAgICAgICAg aWYgKGMgPT0gJ1xuJykKKyAgICAgICAgICAgICAgICBnb3RvIGVuZGxvb3A7CisgICAgICAgICAg ICAgIGlmIChjID09ICdccicgJiYgRVEgKEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBzZWxlY3RpdmVf ZGlzcGxheSksIFF0KSkKKyAgICAgICAgICAgICAgICBnb3RvIGVuZGxvb3A7CisgICAgICAgICAg ICAgIGlmIChjID09ICdcdCcpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg Y29sICs9IHRhYl93aWR0aDsKKyAgICAgICAgICAgICAgICAgIGNvbCA9IGNvbCAvIHRhYl93aWR0 aCAqIHRhYl93aWR0aDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQor ICAgICAgICAgICAgICAgICAgKytjb2w7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAg ICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIC8qIFRoZSBkaXNwbGF5IHRhYmxlIGRv ZXNuJ3QgYWZmZWN0IHRoaXMgY2hhcmFjdGVyOworICAgICAgICAgICAgICAgaXQgZGlzcGxheXMg YXMgaXRzZWxmLiAqLworICAgICAgICAgICAgaWYgKGMgPT0gJ1xuJykKKyAgICAgICAgICAgICAg Z290byBlbmRsb29wOworICAgICAgICAgICAgaWYgKGMgPT0gJ1xyJyAmJiBFUSAoQlZBUiAoY3Vy cmVudF9idWZmZXIsIHNlbGVjdGl2ZV9kaXNwbGF5KSwgUXQpKQorICAgICAgICAgICAgICBnb3Rv IGVuZGxvb3A7CisgICAgICAgICAgICBpZiAoYyA9PSAnXHQnKQorICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgY29sICs9IHRhYl93aWR0aDsKKyAgICAgICAgICAgICAgICBjb2wgPSBj b2wgLyB0YWJfd2lkdGggKiB0YWJfd2lkdGg7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAg ICAgZWxzZSBpZiAobXVsdGlieXRlICYmIExFQURJTkdfQ09ERV9QIChjKSkKKyAgICAgICAgICAg ICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBTdGFydCBvZiBtdWx0aS1ieXRlIGZvcm0uICov CisgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBjaGFyICpwdHI7CisgICAgICAgICAgICAgICAg ICBpbnQgYnl0ZXMsIHdpZHRoOworICAgICAgICAgICAgICAgICAgcHRyID0gQllURV9QT1NfQURE UiAoc2Nhbl9ieXRlKTsKKyAgICAgICAgICAgICAgICAgIE1DX01VTFRJQllURV9CWVRFU19XSURU SCAocHRyLCBkcCwgYnl0ZXMsIHdpZHRoKTsKKyAgICAgICAgICAgICAgICAgIC8qIFN1YnRyYWN0 IG9uZSB0byBjb21wZW5zYXRlIGZvciB0aGUgaW5jcmVtZW50CisgICAgICAgICAgICAgICAgICB0 aGF0IGlzIGdvaW5nIHRvIGhhcHBlbiBiZWxvdy4gKi8KKyAgICAgICAgICAgICAgICAgIHNjYW5f Ynl0ZSArPSBieXRlcyAtIDE7CisgICAgICAgICAgICAgICAgICBjb2wgKz0gd2lkdGg7CisgICAg ICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYgKGN0bF9hcnJvdyAmJiAoYyA8 IDA0MCB8fCBjID09IDAxNzcpKQorICAgICAgICAgICAgICAgICAgY29sICs9IDI7CisgICAgICAg ICAgICAgICAgICBlbHNlIGlmIChjIDwgMDQwIHx8IGMgPj0gMDE3NykKKyAgICAgICAgICAgICAg ICAgICAgY29sICs9IDQ7CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAg ICAgICAgICBjb2wrKzsKKyAgICAgICAgICB9CisgICAgICBzY2FuKys7CisgICAgICBzY2FuX2J5 dGUrKzsKKyAgICB9CisgZW5kbG9vcDoKKyAgbGFzdF9rbm93bl9jb2x1bW4gPSBjb2w7CisgIGxh c3Rfa25vd25fY29sdW1uX3BvaW50ID0gcHQ7CisgIGxhc3Rfa25vd25fY29sdW1uX21vZGlmaWVk ID0gTU9ESUZGOworICBpZiAoZ29hbGNvbCkKKyAgICAqZ29hbGNvbCA9IGNvbDsKKyAgaWYgKGVu ZHBvcykKKyAgICAqZW5kcG9zID0gc2NhbjsKKyAgaWYgKHByZXZjb2wpCisgICAgKnByZXZjb2wg PSBwcmV2X2NvbDsKK30KKworcHRyZGlmZl90CittY19jdXJyZW50X2NvbHVtbiAoc3RydWN0IHdp bmRvdyAqdywgcHRyZGlmZl90IHB0KQoreworICAvKiBgYnVmX2NoYXJwb3NfdG9fYnl0ZXBvcyc6 ICBlYXNzZXJ0IChCVUZfQkVHIChiKSA8PSBjaGFycG9zICYmIGNoYXJwb3MgPD0gQlVGX1ogKGIp KTsgKi8KKyAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKHctPmNvbnRlbnRzKTsKKyAgc3Ry dWN0IGJ1ZmZlciAqb2xkX2J1ZmZlciA9IE5VTEw7CisgIGlmIChiICE9IGN1cnJlbnRfYnVmZmVy KQorICAgIHsKKyAgICAgIG9sZF9idWZmZXIgPSBjdXJyZW50X2J1ZmZlcjsKKyAgICAgIHNldF9i dWZmZXJfaW50ZXJuYWwgKGIpOworICAgIH0KKyAgYm9vbCBi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29sID0gMCwgdGFiX3NlZW4g PSAwLCBwb3N0X3RhYiA9IDA7CisgIHdoaWxlICgxKQorICAgIHsKKyAgICAgIHB0cmRpZmZfdCBp LCBuOworICAgICAgTGlzcF9PYmplY3QgY2hhcnZlYzsKKyAgICAgIGlmIChwdHIgPT0gc3RvcCkK KyAgICAgICAgeworICAgICAgICAgIC8qIFdlIHN0b3BwZWQgZWl0aGVyIGZvciB0aGUgYmVnaW5u aW5nIG9mIHRoZSBidWZmZXIKKyAgICAgICAgICAgICBvciBmb3IgdGhlIGdhcC4gKi8KKyAgICAg ICAgICBpZiAocHRyID09IEJFR1ZfQUREUikKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAg IC8qIEl0IHdhcyB0aGUgZ2FwLiAgSnVtcCBiYWNrIG92ZXIgaXQuICovCisgICAgICAgICAgc3Rv cCA9IEJFR1ZfQUREUjsKKyAgICAgICAgICBwdHIgPSBHUFRfQUREUjsKKyAgICAgICAgICAvKiBD aGVjayB3aGV0aGVyIHRoYXQgYnJpbmdzIHVzIHRvIGJlZ2lubmluZyBvZiBidWZmZXIuICovCisg ICAgICAgICAgaWYgKEJFR1YgPj0gR1BUKQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0K KyAgICAgIGMgPSAqLS1wdHI7CisgICAgICBpZiAoZHAgJiYgVkVDVE9SUCAoRElTUF9DSEFSX1ZF Q1RPUiAoZHAsIGMpKSkKKyAgICAgICAgeworICAgICAgICAgIGNoYXJ2ZWMgPSBESVNQX0NIQVJf VkVDVE9SIChkcCwgYyk7CisgICAgICAgICAgbiA9IEFTSVpFIChjaGFydmVjKTsKKyAgICAgICAg fQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgY2hhcnZlYyA9IFFuaWw7 CisgICAgICAgICAgICBuID0gMTsKKyAgICAgICAgICB9CisgICAgICBmb3IgKGkgPSBuIC0gMTsg aSA+PSAwOyAtLWkpCisgICAgICAgIHsKKyAgICAgICAgICBpZiAoVkVDVE9SUCAoY2hhcnZlYykp CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIC8qIFRoaXMgc2hvdWxkIGJlIGhhbmRsZWQg dGhlIHNhbWUgYXMKKyAgICAgICAgICAgbmV4dF9lbGVtZW50X2Zyb21fZGlzcGxheV92ZWN0b3Ig ZG9lcyBpdC4gKi8KKyAgICAgICAgICAgICAgTGlzcF9PYmplY3QgZW50cnkgPSBBUkVGIChjaGFy dmVjLCBpKTsKKyAgICAgICAgICAgICAgaWYgKEdMWVBIX0NPREVfUCAoZW50cnkpKQorICAgICAg ICAgICAgICAgIGMgPSBHTFlQSF9DT0RFX0NIQVIgKGVudHJ5KTsKKyAgICAgICAgICAgICAgICBl bHNlCisgICAgICAgICAgICAgICAgICBjID0gJyAnOworICAgICAgICAgICAgfQorICAgICAgICAg IGlmIChjID49IDA0MCAmJiBjIDwgMDE3NykKKyAgICAgICAgICAgIGNvbCsrOworICAgICAgICAg ICAgZWxzZSBpZiAoYyA9PSAnXG4nCisgICAgICAgICAgICAgICAgICAgICB8fCAoYyA9PSAnXHIn CisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgRVEgKEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBz ZWxlY3RpdmVfZGlzcGxheSksIFF0KSkpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg ICBwdHIrKzsKKyAgICAgICAgICAgICAgICBnb3RvIHN0YXJ0X29mX2xpbmVfZm91bmQ7CisgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZSBpZiAoYyA9PSAnXHQnKQorICAgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGlmICh0YWJfc2VlbikKKyAgICAgICAgICAgICAg ICAgICAgY29sID0gKChjb2wgKyB0YWJfd2lkdGgpIC8gdGFiX3dpZHRoKSAqIHRhYl93aWR0aDsK KyAgICAgICAgICAgICAgICAgIHBvc3RfdGFiICs9IGNvbDsKKyAgICAgICAgICAgICAgICAgIGNv bCA9IDA7CisgICAgICAgICAgICAgICAgICB0YWJfc2VlbiA9IDE7CisgICAgICAgICAgICAgICAg fQorICAgICAgICAgICAgICAgIGVsc2UgaWYgKFZFQ1RPUlAgKGNoYXJ2ZWMpKQorICAgICAgICAg ICAgICAgICAgLyogV2l0aCBhIGRpc3BsYXkgdGFibGUgZW50cnksIEMgaXMgZGlzcGxheWVkIGFz IGlzLCBhbmQKKyAgICAgICAgICAgICAgICAgICAgIG5vdCBkaXNwbGF5ZWQgYXMgXE5OTiBvciBh cyBeTi4gIElmIEMgaXMgYSBzaW5nbGUtYnl0ZQorICAgICAgICAgICAgICAgICAgICAgY2hhcmFj dGVyLCBpdCB0YWtlcyBvbmUgY29sdW1uLiAgSWYgQyBpcyBtdWx0aS1ieXRlIGluCisgICAgICAg ICAgICAgICAgICAgICBhIHVuaWJ5dGUgYnVmZmVyLCBpdCdzIHRyYW5zbGF0ZWQgdG8gdW5pYnl0 ZSwgc28gaXQKKyAgICAgICAgICAgICAgICAgICAgIGFsc28gdGFrZXMgb25lIGNvbHVtbi4gKi8K KyAgICAgICAgICAgICAgICAgICsrY29sOworICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICAgICAgICBjb2wgKz0gKGN0bF9hcnJvdyAmJiBjIDwgMDIwMCkgPyAyIDogNDsKKyAg ICAgICAgfQorICAgIH0KKyBzdGFydF9vZl9saW5lX2ZvdW5kOgorICBpZiAodGFiX3NlZW4pCisg ICAgeworICAgICAgY29sID0gKChjb2wgKyB0YWJfd2lkdGgpIC8gdGFiX3dpZHRoKSAqIHRhYl93 aWR0aDsKKyAgICAgIGNvbCArPSBwb3N0X3RhYjsKKyAgICB9CisgIGxhc3Rfa25vd25fY29sdW1u ID0gY29sOworICBsYXN0X2tub3duX2NvbHVtbl9wb2ludCA9IHB0OworICBsYXN0X2tub3duX2Nv bHVtbl9tb2RpZmllZCA9IE1PRElGRjsKKyAgaWYgKG9sZF9idWZmZXIpCisgICAgc2V0X2J1ZmZl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iaWxpdHktc3BlYycgc3BlY2lmaWVzIHRoYXQgaXQgaXMgcmVwbGFjZWQgYnkgYW4gZWxs aXBzaXMuICAqLykKKyAgKExpc3BfT2JqZWN0IHdpbmRvdywgTGlzcF9PYmplY3QgcHQpCit7Cisg IHN0cnVjdCB3aW5kb3cgKncgPSBkZWNvZGVfbGl2ZV93aW5kb3cgKHdpbmRvdyk7CisgIExpc3Bf T2JqZWN0IHRlbXA7CisgIFhTRVRGQVNUSU5UICh0ZW1wLCBtY19jdXJyZW50X2NvbHVtbiAodywg WEZJWE5VTSAocHQpKSk7CisgIHJldHVybiB0ZW1wOworfQorCisvKiBVU0FHRTogIGZwcmludGYg KHN0ZGVyciwgIkZSQU1FICglcykiLCBtY19mcmFtZSAoZikpOyAqLworY2hhciAqCittY19mcmFt ZSAoc3RydWN0IGZyYW1lICpmKQoreworICBMaXNwX09iamVjdCBmcmFtZTsKKyAgWFNFVEZSQU1F IChmcmFtZSwgZik7CisgIHJldHVybiBTU0RBVEEgKEZwcmluMV90b19zdHJpbmcgKGZyYW1lLCBR bmlsKSk7Cit9CisKKy8qIFVTQUdFOiAgZnByaW50ZiAoc3RkZXJyLCAiV0lORE9XICglcykiLCBt Y193aW5kb3cgKHcpKTsgKi8KK2NoYXIgKgorbWNfd2luZG93IChzdHJ1Y3Qgd2luZG93ICp3KQor eworICBMaXNwX09iamVjdCB3aW5kb3c7CisgIFhTRVRXSU5ET1cgKHdpbmRvdywgdyk7CisgIHJl dHVybiBTU0RBVEEgKEZwcmluMV90b19zdHJpbmcgKHdpbmRvdywgUW5pbCkpOworfQorCisvKiBV U0FHRTogIGZwcmludGYgKHN0ZGVyciwgIkNIQVJBQ1RFUiAoJXMpIiwgbWNfY2hhcl90b19zdHJp bmcgKGdseXBoLT51LmNoKSk7ICovCitjaGFyICoKK21jX2NoYXJfdG9fc3RyaW5nIChpbnQgYXJn KQoreworICBMaXNwX09iamVjdCBjaGFyYWN0ZXIgPSAoMCA8PSBhcmcgJiYgYXJnIDw9IE1BWF9D SEFSKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBGY2hhcl90b19zdHJpbmcgKG1ha2Vf Zml4bnVtIChhcmcpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBRbmlsOworICBjaGFy ICogcmVzdWx0ID0gKCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAgICAgICAgJiYgYXJn ID09IDkpCisgICAgICAgICAgICAgICAgICAgID8gIlxcdCIKKyAgICAgICAgICAgICAgICAgIDog KCFOSUxQIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAgICAgICAgICAmJiBhcmcgPT0gMTApCisg ICAgICAgICAgICAgICAgICAgID8gIlxcbiIKKyAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChj aGFyYWN0ZXIpCisgICAgICAgICAgICAgICAgICAgICAmJiBhcmcgPT0gMzIpCisgICAgICAgICAg ICAgICAgICAgID8gIlxccyIKKyAgICAgICAgICAgICAgICAgIDogKCFOSUxQIChjaGFyYWN0ZXIp CisgICAgICAgICAgICAgICAgICAgICAmJiBhcmcgIT0gOQorICAgICAgICAgICAgICAgICAgICAg JiYgYXJnICE9IDEwCisgICAgICAgICAgICAgICAgICAgICAmJiBhcmcgIT0gMzIpCisgICAgICAg ICAgICAgICAgICAgID8gU1NEQVRBIChjaGFyYWN0ZXIpCisgICAgICAgICAgICAgICAgICA6ICJc XD8iOworICByZXR1cm4gcmVzdWx0OworfQorCitpbnQKK21jX2xpc3BfdG9fY3Vyc29yX3R5cGUg KExpc3BfT2JqZWN0IGFyZykKK3sKKyAgY2hhciAqc3RyOworICBpZiAoWFRZUEUgKGFyZykgPT0g TGlzcF9TdHJpbmcpCisgICAgc3RyID0gU1NEQVRBIChhcmcpOworICAgIGVsc2UgaWYgKFhUWVBF IChhcmcpID09IExpc3BfU3ltYm9sKQorICAgICAgc3RyID0gU1NEQVRBIChTWU1CT0xfTkFNRSAo YXJnKSk7CisgICAgICBlbHNlIHJldHVybiAtMT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nIChhcmcpKTsgKi8KK2NoYXIgKgorbWNfZHJh d19yb3dfdHlwZV90b19zdHJpbmcgKGVudW0gbWNfZHJhd19yb3dfdHlwZSBmcm9tX3doZXJlKQor eworICBzd2l0Y2ggKGZyb21fd2hlcmUpCisgICAgeworICAgICAgY2FzZSBOT1dIRVJFOiByZXR1 cm4gIk5PV0hFUkUiOworICAgICAgY2FzZSBTQ1JJQkVfT05FOiByZXR1cm4gIlNDUklCRV9PTkUi OworICAgICAgY2FzZSBTQ1JJQkVfVFdPOiByZXR1cm4gIlNDUklCRV9UV08iOworICAgICAgY2Fz ZSBTQ1JJQkVfVEhSRUU6IHJldHVybiAiU0NSSUJFX1RIUkVFIjsKKyAgICAgIGNhc2UgU0tJUFBF RDogcmV0dXJuICJTS0lQUEVEIjsKKyAgICAgIGNhc2UgUE9TVF9DSEFOR0VEOiByZXR1cm4gIlBP U1RfQ0hBTkdFRCI7CisgICAgICBjYXNlIFVOQ0hBTkdFRDogcmV0dXJuICJVTkNIQU5HRUQiOwor ICAgICAgY2FzZSBTRVRfQ1VSU09SX09ORTogcmV0dXJuICJTRVRfQ1VSU09SX09ORSI7CisgICAg ICBjYXNlIFNFVF9DVVJTT1JfVFdPOiByZXR1cm4gIlNFVF9DVVJTT1JfVFdPIjsKKyAgICAgIGRl ZmF1bHQ6CisgICAgICByZXR1cm4gIlVOS05PV04iOworICAgIH0KK30KKworLyogVVNBR0U6ICBm cHJpbnRmIChzdGRlcnIsICJGUk9NX1dIRVJFICglcykiLCBtY19kcmF3X3Jvd190eXBlX3RvX3N0 cmluZyAoYXJnKSk7ICovCitjaGFyICoKK21jX3JlZHJhd19yb3dfdHlwZV90b19zdHJpbmcgKGVu dW0gbWNfcmVkcmF3X3Jvd190eXBlIGZyb21fd2hlcmUpCit7CisgIHN3aXRjaCAoZnJvbV93aGVy ZSkKKyAgICB7CisgICAgICBjYXNlIFVQREFURV9XSU5ET1dfX1JFRFJBV19PVkVSTEFQUEVEX1JP V1M6IHJldHV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SA9IE1DX0NBQ0hFOworICAgICAgIGNhY2hlX3R5cGUgPCBOT19D QUNIRTsKKyAgICAgICArK2NhY2hlX3R5cGUpCisgICAgeworICAgICAgaW50IGN1cnNvcnNfdXNl ZCA9IHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVfdHlwZV07CisgICAgICBmcHJpbnRm IChzdGRlcnIsICIgIG1hdHJpeC5jdXJzb3JzX3VzZWRbJXNdICglZClcbiIsCisgICAgICAgICAg ICAgICAgICAgICAgIG1jX2NhY2hlX3R5cGVfdG9fc3RyaW5nIChjYWNoZV90eXBlKSwgY3Vyc29y c191c2VkKTsKKyAgICB9CisgIGZvciAoaW50IHZudGggPSAwOworICAgICAgIHZudGggPCB3LT5t Y19tYXRyaXgudnBvc191c2VkOworICAgICAgICsrdm50aCkKKyAgICB7CisgICAgICBmb3IgKGVu dW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7CisgICAgICAgICAgIGNhY2hl X3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICAgICAgKytjYWNoZV90eXBlKQorICAgICAgICB7Cisg ICAgICAgICAgaW50IGNhY2hlX2FsbG9jYXRlZCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlX2FsbG9jYXRlZFtjYWNoZV90eXBlXTsKKyAgICAgICAgICBpbnQgY2FjaGVfdXNlZCA9IHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV07CisgICAgICAgICAg ZnByaW50ZiAoc3RkZXJyLCAiICAgIHZudGggKCVkKSB8IGNhY2hlX2FsbG9jYXRlZFslc10gKCVk KSB8IGNhY2hlX3VzZWRbJXNdICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICB2 bnRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgbWNfY2FjaGVfdHlwZV90b19zdHJpbmcg KGNhY2hlX3R5cGUpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FjaGVfYWxsb2NhdGVk LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgbWNfY2FjaGVfdHlwZV90b19zdHJpbmcgKGNh Y2hlX3R5cGUpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FjaGVfdXNlZCk7CisgICAg ICAgIH0KKyAgICB9Cit9CisKK3ZvaWQKK21jX3NldF9sc2xfYmcgKHN0cnVjdCB3aW5kb3cgKncs IGVudW0gZmFjZV9pZCBmYWNlX2lkLCBzdHJ1Y3QgbWNfUkdCICpsc2wpCit7CisgIHN0cnVjdCBm cmFtZSAqZiA9IFhGUkFNRSAody0+ZnJhbWUpOworICBzdHJ1Y3QgZmFjZSAqZmFjZTsKKyAgaWYg KCFOSUxQIChWZmFjZV9yZW1hcHBpbmdfYWxpc3QpCisgICAgICAmJiAoZmFjZV9pZCA9PSBERUZB VUxUX0ZBQ0VfSUQgLyogUWRlZmF1bHQgKi8KKyAgICAgICAgICB8fCBmYWNlX2lkID09IE1PREVf TElORV9GQUNFX0lEIC8qIFFtb2RlX2xpbmUgKi8KKyAgICAgICAgICB8fCBmYWNlX2lkID09IE1P REVfTElORV9JTkFDVElWRV9GQUNFX0lEIC8qIFFtb2RlX2xpbmVfaW5hY3RpdmUgKi8KKyAgICAg ICAgICB8fCBmYWNlX2lkID09IEhFQURFUl9MSU5FX0ZBQ0VfSUQgLyogUWhlYWRlcl9saW5lICov CisgICAgICAgICAgfHwgZmFjZV9pZCA9PSBUT09MX0JBUl9GQUNFX0lEIC8qIFF0b29sX2JhciAq LworICAgICAgICAgIHx8IGZhY2VfaWQgPT0gRlJJTkdFX0ZBQ0VfSUQgLyogUWZyaW5nZSAqLwor ICAgICAgICAgIHx8IGZhY2VfaWQgPT0gU0NST0xMX0JBUl9GQUNFX0lEIC8qIFFzY3JvbGxfYmFy ICovCisgICAgICAgICAgfHwgZmFjZV9pZCA9PSBCT1JERVJfRkFDRV9JRCAvKiBRYm9yZGVyICov CisgICA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BtY194d19jb2xvcl92YWx1ZXMgKHcsIGNv bG9yLCBsc2wpOworfQorCit2b2lkCittY19zZXRfZXNzZW50aWFscyAoc3RydWN0IHdpbmRvdyAq dywgc3RydWN0IG1jX2Vzc2VudGlhbHMgKmVzc2VudGlhbHMpCit7CisgIGlmICghQlVGRkVSUCAo dy0+Y29udGVudHMpKQorICAgIHJldHVybjsKKyAgaWYgKE5JTFAgKEJWQVIgKFhCVUZGRVIgKHct PmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5j b250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+ Y29udGVudHMpLCBmY192aXNpYmxlKSkpCisgICAgcmV0dXJuOworICBzdHJ1Y3QgZnJhbWUgKmYg PSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgZXNzZW50aWFscy0+YWN0aXZlX3AgPSAodyA9PSBYV0lO RE9XIChmLT5zZWxlY3RlZF93aW5kb3cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGYg PT0gRlJBTUVfRElTUExBWV9JTkZPIChmKS0+aGlnaGxpZ2h0X2ZyYW1lKTsKKyAgc3RydWN0IGJ1 ZmZlciAqYiA9IFhCVUZGRVIgKHctPmNvbnRlbnRzKTsKKyAgc3RydWN0IGJ1ZmZlciAqb2xkX2J1 ZmZlciA9IE5VTEw7CisgIHB0cmRpZmZfdCBvcG9pbnQgPSAodyA9PSBYV0lORE9XIChzZWxlY3Rl ZF93aW5kb3cpKQorICAgICAgICAgICAgICAgICAgICAgPyBQVAorICAgICAgICAgICAgICAgICAg ICAgOiBYRklYTlVNIChGbWFya2VyX3Bvc2l0aW9uICh3LT5wb2ludG0pKTsKKyAgcHRyZGlmZl90 IGN1cnJlbnRfY29sID0gbWNfY3VycmVudF9jb2x1bW4gKHcsIG9wb2ludCk7CisgIGludCBmcmFt ZV9jaGFyX3dpZHRoID0gRlJBTUVfQ09MVU1OX1dJRFRIIChmKTsKKyAgYm9vbCBmaWxsX2NvbHVt bl9wID0gIU5JTFAgKEJWQVIgKGIsIGZpbGxfY29sdW1uKSk7CisgIGludCBmaWxsX2NvbCA9IFhG SVhOVU0gKEJWQVIgKGIsIGZpbGxfY29sdW1uKSk7CisgIGludCBoc2NsX3ggPSB3LT5oc2Nyb2xs ICogZnJhbWVfY2hhcl93aWR0aDsKKyAgaWYgKGIgIT0gY3VycmVudF9idWZmZXIpCisgICAgewor ICAgICAgb2xkX2J1ZmZlciA9IGN1cnJlbnRfYnVmZmVyOworICAgICAgc2V0X2J1ZmZlcl9pbnRl cm5hbCAoYik7CisgICAgfQorICBlc3NlbnRpYWxzLT56diA9IFpWOworICBlc3NlbnRpYWxzLT56 dl9ieXRlID0gWlZfQllURTsKKyAgZXNzZW50aWFscy0+ZmNfeCA9IChmaWxsX2NvbHVtbl9wCisg ICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKFZkaXNwbGF5X2xpbmVfbnVtYmVycykpCisg ICAgICAgICAgICAgICAgICAgICAgID8gKGZpbGxfY29sICogZnJhbWVfY2hhcl93aWR0aCkgKyB3 LT5tYy5sbnVtX3BpeGVsX3dpZHRoIC0gaHNjbF94CisgICAgICAgICAgICAgICAgICAgICA6IChm aWxsX2NvbHVtbl9wCisgICAgICAgICAgICAgICAgICAgICAgICAmJiBOSUxQIChWZGlzcGxheV9s aW5lX251bWJlcnMpKQorICAgICAgICAgICAgICAgICAgICAgICA/IChmaWxsX2NvbCAqIGZyYW1l X2NoYXJfd2lkdGgpIC0gaHNjbF94CisgICAgICAgICAgICAgICAgICAgICA6IDA7CisgIGlmIChv bGRfYnVmZmVyKQorICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworICBlbnVt IGZhY2VfaWQgZmlsbF9jb2x1bW5fcHJlX3p2X2ZhY2VfaWQgPQorICAgICghZXNzZW50aWFscy0+ YWN0aXZlX3AKKyAgICAg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yAgICA6IChlc3NlbnRpYWxz LT5hY3RpdmVfcAorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyks IGNyb3NzaGFpcnMpKQorICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxl cikpCisgICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gZXNzZW50aWFscy0+ZmNfeCkKKyAgICAgID8g bG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoImZjLW9wb2ludC1hdC16di1mYWNlIiks IHRydWUpCisgICAgOiAoIWVzc2VudGlhbHMtPmFjdGl2ZV9wCisgICAgICAgJiYgIU5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfaW5hY3RpdmVfd2luZG93cykpCisgICAgICAg JiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAg ICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAmJiB3LT5j dXJzb3IueCAhPSBlc3NlbnRpYWxzLT5mY194KQorICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAo dywgZiwgaW50ZXJuICgiZmMtaW5hY3RpdmUtYXQtenYtZmFjZSIpLCB0cnVlKQorICAgIDogKGVz c2VudGlhbHMtPmFjdGl2ZV9wCisgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNv bnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX3ZlcnRp Y2FsX3J1bGVyKSkKKyAgICAgICAmJiB3LT5jdXJzb3IueCAhPSBlc3NlbnRpYWxzLT5mY194KQor ICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiZmMtYXQtenYtZmFjZSIp LCB0cnVlKQorICAgIDogbG9va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KKyAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBmY19pbmFjdGl2ZV93aW5kb3dzKSkKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJV RkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAmJiAhTklMUCAoQlZBUiAo YiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICYmIHctPmN1cnNvci54ID09IGVzc2VudGlh bHMtPmZjX3gpCisgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCJmYy1v cG9pbnQtaW5hY3RpdmUtcG9zdC16di1mYWNlIiksIHRydWUpCisgICAgOiAoZXNzZW50aWFscy0+ YWN0aXZlX3AKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBj cm9zc2hhaXJzKSkKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIp KQorICAgICAgICYmIHctPmN1cnNvci54ID09IGVzc2VudGlhbHMtPmZjX3gpCisgICAgICA/IGxv b2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCJmYy1vcG9pbnQtcG9zdC16di1mYWNlIiks IHRydWUpCisgICAgOiAoIWVzc2VudGlhbHMtPmFjdGl2ZV9wCisgICAgICAgJiYgIU5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfaW5hY3RpdmVfd2luZG93cykpCisgICAgICAg JiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAg ICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAmJiB3LT5j dXJzb3IueCAhPSBlc3NlbnRpYWxzLT5mY194KQorICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSA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5fY29sb3IsICZl dmVuX2ZvcmVncm91bmQpOworICAgICAgZW51bSBmYWNlX2lkIG9kZF9mYWNlX2lkID0KKyAgICAg ICAgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkpCisgICAgICAgID8gbG9va3Vw X25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb2RkLWluYWN0aXZlLXByZS16di1mYWNlIiks IHRydWUpCisgICAgICAgIDogbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb2Rk LXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgc3RydWN0IGZhY2UgKm9kZF9mYWNlID0gRkFD RV9GUk9NX0lEIChmLCBvZGRfZmFjZV9pZCk7CisgICAgICBMaXNwX09iamVjdCBvZGRfY29sb3Ig PSBvZGRfZmFjZS0+bGZhY2VbTEZBQ0VfRk9SRUdST1VORF9JTkRFWF07CisgICAgICBzdHJ1Y3Qg bWNfUkdCIG9kZF9mb3JlZ3JvdW5kOworICAgICAgbWNfeHdfY29sb3JfdmFsdWVzICh3LCBvZGRf Y29sb3IsICZvZGRfZm9yZWdyb3VuZCk7CisgICAgICBlbnVtIGZhY2VfaWQgYmV5b25kX2ZpbGxf ZmFjZV9pZCA9CisgICAgICAgICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgJiYgIU5J TFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaW5hY3RpdmVfd2luZG93cykpKQor ICAgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXBvc3QtZmlsbC1p bmFjdGl2ZS1wcmUtenYtZmFjZSIpLCB0cnVlKQorICAgICAgICA6IGxvb2t1cF9uYW1lZF9mYWNl ICh3LCBmLCBpbnRlcm4gKCIrLXBvc3QtZmlsbC1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAg IHN0cnVjdCBmYWNlICpiZXlvbmRfZmlsbF9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBiZXlvbmRf ZmlsbF9mYWNlX2lkKTsKKyAgICAgIExpc3BfT2JqZWN0IGJleW9uZF9maWxsX2NvbG9yID0gYmV5 b25kX2ZpbGxfZmFjZS0+bGZhY2VbTEZBQ0VfRk9SRUdST1VORF9JTkRFWF07CisgICAgICBzdHJ1 Y3QgbWNfUkdCIGJleW9uZF9maWxsX2ZvcmVncm91bmQ7CisgICAgICBtY194d19jb2xvcl92YWx1 ZXMgKHcsIGJleW9uZF9maWxsX2NvbG9yLCAmYmV5b25kX2ZpbGxfZm9yZWdyb3VuZCk7CisgICAg ICAvKiByZWQgKi8KKyAgICAgIGlmICgoIWZpbGxfY29sdW1uX3AKKyAgICAgICAgICAgJiYgY3Vy cmVudF9jb2wgJSAyICE9IDAKKyAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVikK KyAgICAgICAgICB8fCAoZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAgICAmJiBjdXJyZW50X2Nv bCAlIDIgIT0gMAorICAgICAgICAgICAgICAmJiBjdXJyZW50X2NvbCA8PSBmaWxsX2NvbAorICAg ICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gPT0gUFJFX1pWKSkKKyAgICAgICAgeworICAgICAg ICAgIGxzbF9mZy0+cmVkID0gb2RkX2ZvcmVncm91bmQucmVkOworICAgICAgICAgIGxzbF9mZy0+ Z3JlZW4gPSBvZGRfZm9yZWdyb3VuZC5ncmVlbjsKKyAgICAgICAgICBsc2xfZmctPmJsdWUgPSBv ZGRfZm9yZWdyb3VuZC5ibHVlOworICAgICAgICB9CisgICAgICAgIC8qIHllbGxvdyAqLworICAg ICAgICBlbHNlIGlmICgoIWZpbGxfY29sdW1uX3AKKyAgICAgICAgICAgICAgICAgICYmIGN1cnJl bnRfY29sICUgMiA9PSAwCisgICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gPT0gUFJF X1pWKQorICAgICAgICAgICAgICAgICB8fCAoZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAgICAg ICAgICAgJiYgY3VycmVudF9jb2wgJSAyID09IDAKKyAgICAgICAgICAgICAgICAgICAgICYmIGN1 cnJlbnRfY29sIDw9IGZpbGxfY29sCisgICAgICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRp b24gPT0gUFJFX1pWKSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBsc2xfZmctPnJlZCA9IGV2 ZW5fZm9yZWdyb3VuZC5yZWQ7CisgICAgICAgICAgICBsc2xfZmctPmdyZWVuID0gZXZlbl9mb3Jl Z3JvdW5kLmdyZWVuOworICAgICAgICAgICAgbHNsX2ZnLT5ibHVlID0gZXZlbl9mb3JlZ3JvdW5k LmJsdWU7CisgICAgICAgICAgfQorICAgICAgICAgIC8qIGdyZWVuICovCisgICAgICAgICAgZWxz ZSBpZiAoZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAgICAgICAgICYmIGN1cnJlbnRfY29sID4g ZmlsbF9jb2wKKyAgICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gPT0gUFJFX1pWKQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICBsc2xfZmctPnJlZCA9IGJleW9uZF9maWxsX2Zv cmVncm91bmQucmVkOworICAgICAgICAgICAgICBsc2xfZmctPmdyZWVuID0gYmV5b25kX2ZpbGxf Zm9yZWdyb3VuZC5ncmVlbjsKKyAgICAgICAgICAgICAgbHNsX2ZnLT5ibHVlID0gYmV5b25kX2Zp bGxfZm9yZWdyb3VuZC5ibHVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAo cm93X3Bvc2l0aW9uID09IEFUX1pWKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg bHNsX2ZnLT5yZWQgPSBlc3NlbnRpYWxzLnNwX2ZnLnJlZDsKKyAgICAgICAgICAgICAgICBsc2xf ZmctPmdyZWVuID0gZXNzZW50aWFscy5zcF9mZy5ncmVlbjsKKyAgICAgICAgICAgICAgICBsc2xf ZmctPmJsdWUgPSBlc3NlbnRpYWxzLnNwX2ZnLmJsdWU7CisgICAgICAgICAgICAgIH0KKyAgICAg IGJyZWFrOworICAgIH0KKyAgICBjYXNlIEhPUklaT05UQUxfUlVMRVI6CisgICAgeworICAgICAg aWYgKGdseXBoICE9IE5VTEwKKyAgICAgICAgICAmJiBnbHlwaC0+dS5jaCA9PSA5NQorICAgICAg ICAgICYmIGN1cnNvcl90eXBlID09IE1DX0hCQVIpCisgICAgICAgIHsKKyAgICAgICAgICBsc2xf ZmctPnJlZCA9IGVzc2VudGlhbHMuc3BfZmcucmVkOworICAgICAgICAgIGxzbF9mZy0+Z3JlZW4g PSBlc3NlbnRpYWxzLnNwX2ZnLmdyZWVuOworICAgICAgICAgIGxzbF9mZy0+Ymx1ZSA9IGVzc2Vu dGlhbHMuc3BfZmcuYmx1ZTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgewor ICAgICAgICAgICAgbHNsX2ZnLT5yZWQgPSBlc3NlbnRpYWxzLmNoX2ZnW3Jvd19wb3NpdGlvbl0u cmVkOworICAgICAgICAgICAgbHNsX2ZnLT5ncmVlbiA9IGVzc2VudGlhbHMuY2hfZmdbcm93X3Bv c2l0aW9uXS5ncmVlbjsKKyAgICAgICAgICAgIGxzbF9mZy0+Ymx1ZSA9IGVzc2VudGlhbHMuY2hf Zmdbcm93X3Bvc2l0aW9uXS5ibHVlOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0K KyAgICBjYXNlIFZFUlRJQ0FMX1JVTEVSOgorICAgIHsKKyAgICAgIGxzbF9mZy0+cmVkID0gZXNz ZW50aWFscy5jaF9mZ1tyb3dfcG9zaXRpb25dLnJlZDsKKyAgICAgIGxzbF9mZy0+Z3JlZW4gPSBl c3NlbnRpYWxzLmNo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cmFzZWQgY3Vyc29yIGFyZWEKKyAgIFZhbHVlIGlzIHRoZSB4LXBvc2l0aW9uIHJl YWNoZWQsIHJlbGF0aXZlIHRvIEFSRUEgb2YgVy4gKi8KK2ludAorbWNfZHJhd19nbHlwaHMgKHN0 cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwgc3RydWN0IGdseXBo X3JvdyAqcm93LAorICAgICAgICAgICAgICAgIHN0cnVjdCBtY19tYXRyaXggbWNfbWF0cml4LCBp bnQgeCwgZW51bSBnbHlwaF9yb3dfYXJlYSBhcmVhLAorICAgICAgICAgICAgICAgIHB0cmRpZmZf dCBzdGFydCwgcHRyZGlmZl90IGVuZCwgZW51bSBkcmF3X2dseXBoc19mYWNlIGhsLAorICAgICAg ICAgICAgICAgIGludCBvdmVybGFwcywgaW50IHZwb3MsIHN0cnVjdCBtY19SR0IgbHNsLAorICAg ICAgICAgICAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciwgZW51bSBtY19jdXJzb3Jf dHlwZSBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICBpbnQgd2QsIGJvb2wgYWN0aXZlX3As IGJvb2wgY3Vyc29yX2djX3AsCisgICAgICAgICAgICAgICAgZW51bSBkcmF3X2dseXBoX2FjdGlv biBhY3Rpb25fdHlwZSwgYm9vbCBkcmF3X3ApCit7CisgIGludCBzdGFydF94ID0geDsKKyAgaW50 IHJlbGF0aXZlX3ggPSAwOworICBpbnQgbGVuZ3RoID0gMDsKKyAgLy8gIGlmIChtY19zdGRlcnJf cCkKKyAgLy8gICAgeworICAvLyAgICAgIGludCBzdGFydF9ocG9zID0gc3RhcnQ7CisgIC8vICAg ICAgaW50IGVuZF9ocG9zID0gZW5kOworICAvLyAgICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX2Ry YXdfZ2x5cGhzICglZCk6ICBzdGFydF94ICglZCkgfCBzdGFydF9ocG9zICglZCkgfCBlbmR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pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGNoZWNr X21vdXNlX2ZhY2UgPSB0cnVlOworICAgICAgICAgICAgICBtb3VzZV9iZWdfY29sID0gKHJvd192 cG9zID09IGhsaW5mby0+bW91c2VfZmFjZV9iZWdfcm93KQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBobGluZm8tPm1vdXNlX2ZhY2VfYmVnX2NvbAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiAwOworICAgICAgICAgICAgICBtb3VzZV9lbmRfY29sID0gKHJvd192cG9z ID09IGhsaW5mby0+bW91c2VfZmFjZV9lbmRfcm93KQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBobGluZm8tPm1vdXNlX2ZhY2VfZW5kX2NvbAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOiByb3ctPnVzZWRbVEVYVF9BUkVBXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAg fQorICAgICAgLyogQ29tcHV0ZSBvdmVyaGFuZ3MgZm9yIGFsbCBnbHlwaCBzdHJpbmdzLiAqLwor ICAgICAgaWYgKEZSQU1FX1JJRiAoZiktPmNvbXB1dGVfZ2x5cGhfc3RyaW5nX292ZXJoYW5ncykK KyAgICAgICAgZm9yIChzID0gaGVhZDsgczsgcyA9IHMtPm5leHQpCisgICAgICAgICAgRlJBTUVf UklGIChmKS0+Y29tcHV0ZV9nbHlwaF9zdHJpbmdfb3ZlcmhhbmdzIChzKTsKKyAgICAgIC8qIFBy ZXBlbmQgZ2x5cGggc3RyaW5ncyBmb3IgZ2x5cGhzIGluIGZyb250IG9mIHRoZSBmaXJzdCBnbHlw aAorICAgICAgc3RyaW5nIHRoYXQgYXJlIG92ZXJ3cml0dGVuIGJlY2F1c2Ugb2YgdGhlIGZpcnN0 IGdseXBoCisgICAgICBzdHJpbmcncyBsZWZ0IG92ZXJoYW5nLiAgVGhlIGJhY2tncm91bmQgb2Yg YWxsIHN0cmluZ3MKKyAgICAgI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yAgICAgICAgfQorICAgICAgdGFpbCA9IGdseXBoX3N0cmluZ19jb250YWluaW5nX2Jh Y2tncm91bmRfd2lkdGggKHRhaWwpOworICAgICAgaWYgKGNsaXBfdGFpbCkKKyAgICAgICAgY2xp cF90YWlsID0gZ2x5cGhfc3RyaW5nX2NvbnRhaW5pbmdfYmFja2dyb3VuZF93aWR0aCAoY2xpcF90 YWlsKTsKKyAgICAgIGlmIChjbGlwX2hlYWQgfHwgY2xpcF90YWlsKQorICAgICAgICBmb3IgKHMg PSBoZWFkOyBzOyBzID0gcy0+bmV4dCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBzLT5jbGlw X2hlYWQgPSBjbGlwX2hlYWQ7CisgICAgICAgICAgICBzLT5jbGlwX3RhaWwgPSBjbGlwX3RhaWw7 CisgICAgICAgICAgfQorICAgIH0KKyAgLyogRHJhdyBhbGwgc3RyaW5ncy4gKi8KKyAgZm9yIChz ID0gaGVhZDsgcyAmJiBkcmF3X3A7IHMgPSBzLT5uZXh0KQorICAgIEZSQU1FX1JJRiAoZiktPm1j X3NjcmliZV9zdHJpbmcgKHMsIG1hdHJpeCwgcm93LCBtY19tYXRyaXgsIGxzbCwgZ2x5cGhfZmxh dm9yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCB3 ZCwgYWN0aXZlX3AsIGN1cnNvcl9nY19wKTsKKyNpZm5kZWYgSEFWRV9OUworICAvKiBXaGVuIGZv Y3VzIGEgc29sZSBmcmFtZSBhbmQgbW92ZSBob3Jpem9udGFsbHksIHRoaXMgY2xlYXJzIG9uX3AK KyAgICAgY2F1c2luZyBhIGZhaWx1cmUgdG8gZXJhc2UgcHJldiBjdXJzb3IgcG9zaXRpb24uICov CisgIGlmIChhcmVhID09IFRFWFRfQVJFQQorICAgICAgJiYgIXJvdy0+ZnVsbF93aWR0aF9wCisg ICAgICAvKiBXaGVuIGRyYXdpbmcgb3ZlcmxhcHBpbmcgcm93cywgb25seS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AgICAgIGZwcmludGYgKHN0 ZGVyciwgIm1jX2VyYXNlX2N1cnNvcjogIHJldHVybiAoJWQpXG4iLCAxKTsKKyAgICAgIHJldHVy bjsKKyAgICB9CisgIC8qIFZQT1MgPj0gbWF0cml4LT5ucm93cyBtZWFucyB0aGF0IHdpbmRvdyBo YXMgYmVlbiByZXNpemVkLgorICAgICBEb24ndCBib3RoZXIgdG8gZXJhc2UgdGhlIGN1cnNvci4g Ki8KKyAgaWYgKHZwb3MgPj0gbWF0cml4LT5ucm93cykKKyAgICB7CisgICAgICBpZiAoZGVidWdf cCkKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZXJhc2VfY3Vyc29yOiAgcmV0dXJuICgl ZClcbiIsIDIpOworICAgICAgcmV0dXJuOworICAgIH0KKyAgLyogSWYgcm93IGNvbnRhaW5pbmcg Y3Vyc29yIGlzIG1hcmtlZCBpbnZhbGlkLCB0aGVyZSBpcyBub3RoaW5nIHdlCisgICAgIGNhbiBk by4gKi8KKyAgaWYgKCFyb3ctPmVuYWJsZWRfcCkKKyAgICB7CisgICAgICBpZiAoZGVidWdfcCkK KyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfZXJhc2VfY3Vyc29yOiAgcmV0dXJuICglZClc biIsIDMpOworICAgICAgcmV0dXJuOworICAgIH0KKyAgLyogSWYgbGluZSBzcGFjaW5nIGlzID4g MCwgb2xkIGN1cnNvciBtYXkgb25seSBiZSBwYXJ0aWFsbHkgdmlzaWJsZSBpbgorICAgICB3aW5k b3cgYWZ0ZXIgc3BsaXQtd2luZG93LiAgU28gYWRqdXN0IHZpc2libGUgaGVpZ2h0LiAqLworICBy b3ctPnZpc2libGVfaGVpZ2h0ID0gbWluIChyb3ctPnZpc2libGVfaGVpZ2h0LAorICAgICAgICAg ICAgd2luZG93X3RleHRfYm90dG9tX3kgKHcpIC0gcm93LT55KTsKKyAgLyogSWYgcm93IGlzIGNv bXBsZXRlbHkgaW52aXNpYmxlLCBkb24nd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AgICAgIGJvb2wgcmVtb3Zl X3ApCit7CisgIC8qIGBtYXRyaXhfcm93JyBpbiBgZGlzcG5ldy5jYCBjb250YWlucyB0aGUgZm9s bG93aW5nIHRlc3RzLAorICBlYXNzZXJ0IChtYXRyaXggJiYgbWF0cml4LT5yb3dzKTsKKyAgZWFz c2VydCAocm93ID49IDAgJiYgcm93IDwgbWF0cml4LT5ucm93cyk7ICovCisgIGJvb2wgYmFyZl9j cmFzaF9vbmUgPSAobWF0cml4ICYmIG1hdHJpeC0+cm93cykgPyBmYWxzZSA6IHRydWU7CisgIGlm IChiYXJmX2NyYXNoX29uZSkKKyAgICByZXR1cm47CisgIGJvb2wgYmFyZl9jcmFzaF90d28gPSAo dnBvcyA+PSAwICYmIHZwb3MgPCBtYXRyaXgtPm5yb3dzKSA/IGZhbHNlIDogdHJ1ZTsKKyAgaWYg KGJhcmZfY3Jhc2hfdHdvKQorICAgIHJldHVybjsKKyAgaWYgKHggPCAwCisgICAgICB8fCB5IDwg MAorICAgICAgfHwgaHBvcyA8IDAKKyAgICAgIHx8IHZwb3MgPCAwKQorICAgIHJldHVybjsKKyAg c3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIGJvb2wgYXV0b19oc2Nyb2xs X21vZGVfcCA9IEVRIChGYnVmZmVyX2xvY2FsX3ZhbHVlIChRYXV0b19oc2Nyb2xsX21vZGUsIHct PmNvbnRlbnRzKSwgUWN1cnJlbnRfbGluZSk7CisgIC8qIEVYQU1QTEU6ICAoc2Nyb2xsLWxlZnQg NSkgKi8KKyAgYm9vbCBoc2NsX2FsbF90ZW1wX3AgPSAody0+c3VzcGVuZF9hdXRvX2hzY3JvbGwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXgg PCBhbmQgZG8gbm90aGluZy4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzBfcCA9ICh3LT5zdXNw ZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1dG9faHNj cm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4g MAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IHctPmhzY3JvbGwp OworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBzb21ldGhpbmcgZWxzZSBiZXNpZGVz IGhvcml6b250YWxseSBzY3JvbGxpbmcgdGhlCisgICAgICAgICAgICAgICBjdXJyZW50IGxpbmUg ZGlmZmVyZW50bHkuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgaXMgX25vdF8gaG9yaXpv bnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfYWxsX3Blcm1fMV9w ID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Ny b2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09 IHctPmhzY3JvbGwpOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCAuLi4KKyAgICAgICAg ICAgICAgIEN1cnJlbnQgbGluZSBpcyBfbm90XyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVy ZW50bHkuICovCisgIGJvb2wgaHNjbF9hbGxfcGVybV8yX3AgPSAoIXctPnN1c3BlbmRfYXV0b19o c2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVf cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPT0gMAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhzY3JvbGwpOworICAvKiBF WEFNUExFOiAgKHNjcm9sbC1sZWZ0IDUpOyBhbmQsIHRoZW4gcHJlc3MgdGhlIGxlZnQgYXJyb3cg a2V5IG9uZSB0aW1lLgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIF9pc18gaG9yaXpvbnRh bGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiovCisgIGJvb2wgaHNjbF90ZW1wX3AgPSAoIXctPnN1 c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xs X21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAg ICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gMCk7CisgIC8qIEVYQU1QTEU6ICBD LXUgQy14IDwgYW5kIGRvIHNvbWV0aGluZyB0aGF0IGNhdXNlcyB0aGUgY3VycmVudCBsaW5lIHRv IGJlCisgICAgICAgICAgICAgICBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuCisg ICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgX2lzXyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlm ZmVyZW50bHkuICovCisgIGJvb2wgaHNjbF9wZXJtX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Ny b2xsCisgICAgICAgICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAg ICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAg JiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hz Y3JvbGwgIT0gdy0+aHNjcm9sbCk7CisgIGludCBmcmluZ2VfYml0bWFwID0gTUNfTk9fRlJJTkdF X0JJVE1BUDsKKyAgaW50IGZhY2VfaWQgPSBERUZBVUxUX0ZBQ0VfSUQ7CisgIGlmICghcmVtb3Zl X3AKKyAgICAgICYmIGdseXBoX2ZsYXZvciA9PSBNQ19PVkVSTEFZX0FSUk9XX0JJVE1BUAorICAg ICAgJiYgIWhzY2xfYWxsX3RlbXBfcAorICAgICAgJiYgIWhzY2xfdGVtcF9wCisgICAgICAmJiAh aHNjbF9wZXJtX3AKKyAgICAgICYmICFoc2NsX2FsbF9wZXJtXzBfcAorICAgICAgJiYgIWhzY2xf YWxsX3Blcm1fMV9wCisgICAgICAmJiAhaHNjbF9hbGxfcGVybV8yX3ApCisgICAgeworICAgICAg ZW51bSBmYWNlX2lkIG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICghYWN0aXZlX3AK KyAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2luYWN0 aXZlX3dpbmRvd3MpKSkKKyAgICAgICAgPyBsb29rdXBfZGVyaXZlZF9mYWNlICh3LCBmLCBpbnRl cm4gKCIrLW92ZXJsYXktYXJyb3ctaW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwgRlJJTkdFX0ZBQ0Vf SUQsIHRydWUpCisgICAgICAgIDogKGFjdGl2ZV9wKQorICAgICAgICAgID8gbG9va3VwX2Rlcml2 ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LXByZS16di1mYWNlIiksIEZS SU5HRV9GQUNFX0lELCB0cnVlKQorICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgIGZh Y2VfaWQgPSAoY3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAg ICAgICAgID8gb3ZlcmxheV9hcnJvd19mYWNlX2lkCisgICAgICAgICAgICAgICAgOiBERUZBVUxU X0ZBQ0VfSUQ7CisgICAgICBpZiAody0+aHNjcm9sbCAhPSAwKQorICAgICAgICBmcmluZ2VfYml0 bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistb3ZlcmxheS1hcnJvdyIp LCBmYWxzZSwgdHJ1ZSk7CisgICAgICAgIGVsc2UKKyAgICAgICAgICBmcmluZ2VfYml0bWFwID0g bWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistb3ZlcmxheS1hcnJvdyIpLCB0cnVl LCB0cnVlKTsKKyAgICAgIHJvdy0+bGVmdF9mcmluZ2VfYml0bWFwID0gKGN1cnNvcl90eXBlID09 IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBmcmluZ2VfYml0bWFwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfTk9f RlJJTkdFX0JJVE1BUDsKKyAgICAgIHJvdy0+bGVmdF9mcmluZ2VfZmFjZV9pZCA9IGZhY2VfaWQ7 CisgICAgICByb3ctPmxlZnRfZnJpbmdlX29mZnNldCA9IDA7CisgICAgICByb3ctPmZyaW5nZV9i aXRtYXBfcGVyaW9kaWNfcCA9IGZhbHNlOworICAgIH0KKyAgICBlbHNlIGlmICghcmVtb3ZlX3AK KyAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgPT0gTUNfT1ZFUkxBWV9BUlJPV19CSVRNQVAK KyAgICAgICAgICAgICAmJiAoaHNjbF9hbGxfdGVtcF9wCisgICAgICAgICAgICAgICAgIHx8IGhz Y2xfYWxsX3Blcm1fMF9wCisgICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxsX3Blcm1fMV9wCisg ICAgICAgICAgICAgICAgIHx8IGhzY2xfYWxsX3Blcm1fMl9wCisgICAgICAgICAgICAgICAgIHx8 IGhzY2xfdGVtcF9wCisgICAgICAgICAgICAgICAgIHx8IGhzY2xfcGVybV9wKSkKKyAgICAgIHsK KyAgICAgICAgZW51bSBmYWNlX2lkIG92ZXJsYXlfYXJyb3dfZmFjZV9pZCA9CisgICAgICAgICAg KCFhY3RpdmVfcAorICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkpCisgICAgICAgICAgPyBsb29rdXBfZGVyaXZlZF9m YWNlICh3LCBmLCBpbnRlcm4gKCIrLW92ZXJsYXktYXJyb3ctaHNjbC1pbmFjdGl2ZS1wcmUtenYt ZmFjZSIpLCBGUklOR0VfRkFDRV9JRCwgdHJ1ZSkKKyAgICAgICAgICA6IChhY3RpdmVfcCkKKyAg ICAgICAgICAgID8gbG9va3VwX2Rlcml2ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5 LWFycm93LWhzY2wtcHJlLXp2LWZhY2UiKSwgRlJJTkdFX0ZBQ0VfSUQsIHRydWUpCisgICAgICAg ICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgIGZhY2VfaWQgPSAoY3Vyc29yX3R5cGUgPT0g TUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAgPyBvdmVybGF5X2Fycm93 X2ZhY2VfaWQKKyAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICBp ZiAoaHNjbF9hbGxfcGVybV8wX3ApCisgICAgICAgICAgZnJpbmdlX2JpdG1hcCA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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBmcmluZ2Vf Yml0bWFwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19OT19GUklOR0Vf QklUTUFQOworICAgICAgICByb3ctPmxlZnRfZnJpbmdlX2ZhY2VfaWQgPSBmYWNlX2lkOworICAg ICAgICByb3ctPmxlZnRfZnJpbmdlX29mZnNldCA9IDA7CisgICAgICAgIHJvdy0+ZnJpbmdlX2Jp dG1hcF9wZXJpb2RpY19wID0gZmFsc2U7CisgICAgICB9CisgICAgICBlbHNlIGlmICghcmVtb3Zl X3AKKyAgICAgICAgICAgICAgICYmIChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdM RV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19S RVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAg fHwgZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEUKKyAgICAgICAgICAgICAgICAg ICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAg ICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9S SUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJU SUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJT RURfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1D X1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gpKQorICAgICAgICB7CisgICAgICAgICAgTGlzcF9PYmpl Y3QgYml0bWFwX2ZsYXZvciA9IChnbHlwaF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRV9S SUdIVF9BUlJPVykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNf aG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdM RV9SSUdIVF9BUlJPVykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IFFtY19yZXZlcnNlZF9ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVD VEFOR0xFKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX2hv bGxvd19yZWN0YW5nbGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAo Z2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVykKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXJfcmlnaHRfYXJy b3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9y ID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVykKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19yZXZlcnNlZF92ZXJ0aWNhbF9iYXJfcmln aHRfYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhf Zmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IFFtY192ZXJ0aWNhbF9iYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUikK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19yZXZlcnNlZF92 ZXJ0aWNhbF9iYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5 cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyX2JhY2tzbGFzaAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFFuaWw7CisgICAgICAgICAgZnJp bmdlX2JpdG1hcCA9IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQKQorICAg ICAgICAgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9mcmluZ2VfYml0bWFwIChiaXRtYXBfZmxh dm9yKQorICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7Cisg ICAgICAgICAgZmFjZV9pZCA9IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQ CisgICAgICAgICAgICAgICAgICAgICAmJiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX0hP TExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICB8fCBn bHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAg ICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJ Q0FMX0JBUikpCisgICAgICAgICAgICAgICAgICAgICAgPyBsb29rdXBfZGVyaXZlZF9mYWNlICh3 LCBmLCBpbnRlcm4gKCIrLXJldmVyc2VkLWJhci1wcmUtenYtZmFjZSIpLCBGUklOR0VfRkFDRV9J RCwgdHJ1ZSkKKyAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX3R5cGUgPT0gTUNfUklHSFRf RlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0g TUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAg ICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hU X0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZF UlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAgPyBsb29rdXBfZGVyaXZl ZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLWJhci1wcmUtenYtZmFjZSIpLCBGUklOR0VfRkFDRV9J RCwgdHJ1ZSkKKyAgICAgICAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAg ICAgcm93LT5jdXJzb3JfaW5fZnJpbmdlX3AgPSBmYWxzZTsKKyAgICAgICAgICByb3ctPnJpZ2h0 X2ZyaW5nZV9iaXRtYXAgPSBmcmluZ2VfYml0bWFwOworICAgICAgICAgIHJvdy0+cmlnaHRfZnJp bmdlX2ZhY2VfaWQgPSBmYWNlX2lkOworICAgICAgICAgIHJvdy0+cmlnaHRfZnJpbmdlX29mZnNl dCA9IDA7CisgICAgICAgICAgcm93LT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3AgPSBmYWxzZTsK KyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEgKKyAg ICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX0dMWVBITEVTUykKKyAgICAgICAg ICB7CisgICAgICAgICAgICBib29sIG9uX3AgPSB0cnVlOworICAgICAgICAgICAgRlJBTUVfUklG IChmKS0+bWNfc2NyaWJlX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBv cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZwb3MsIHdk LCBoLCBsc2wsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgY3Vyc29yX3dpZHRoLCBnbHlwaF9mbGF2b3IsIG9uX3AsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVfcCk7CisgICAgICAgICAg fQorfQorCisvKiBEdW1wIGNvbnRlbnRzIG9mIGdseXBoIEdMWVBIIHRvIHN0ZGVyci4gIFJPVyBh bmQgQVJFQSBhcmUKKyAgIHRoZSBnbHlwaCByb3cgYW5kIGFyZWEgd2hlcmUgdGhlIGdseXBoIGNv bWVzIGZyb20uICovCit2b2lkCittY19kdW1wX2dseXBoIChzdHJ1Y3QgZ2x5cGhfcm93ICpyb3cs IHN0cnVjdCBnbHlwaCAqZ2x5cGgsIGludCBhcmVhLAorICAgICAgICAgICAgICAgaW50IHJlbGF0 aXZlX3gsIGludCB2cG9zKQoreworICBib29sIGdseXBoX3p2X3AgPSAoZ2x5cGggLSByb3ctPmds eXBoc1thcmVhXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAm JiBNQVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpID09IFpWKTsKKyAgaWYgKGdseXBoLT50eXBl ID09IENIQVJfR0xZUEgKKyAgICAgIHx8IGdseXBoLT50eXBlID09IEdMWVBITEVTU19HTFlQSCkK KyAgICB7CisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICIgJTUicEQiZC8lLTVkICU1 ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNnggJTRkICUxLjFkJTEuMWQgICUzZCAlcyAlc1xuIiwK KyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+ dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVs YXRpdmVfeCwKKyAgICAgICAgKGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgICAgID8g J0MnCisgICAgICAgICA6ICdHJyksCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAo QlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJ TkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICAgIDogKE5J TFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICA/ICcwJworICAgICAgICAgICAgICAg OiAnLScpKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgZ2x5cGgtPnUu Y2gsCisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGlu ZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPmhw b3MsIGdseXBoX3p2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgbWNfY2hhcl90b19zdHJpbmcg KGdseXBoLT51LmNoKSk7CisgICAgfQorICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBTVFJFVENI X0dMWVBIKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIiAlNSJwRCJk LyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4xZCAgJTNkICVz ICVzXG4iLAorICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAg ICgocm93LT51c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAg ICAgICByZWxhdGl2ZV94LAorICAgICAgICAnUycsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAor ICAgICAgICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ0InCisgICAg ICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAg ICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJzAnCisgICAgICAg ICAgOiAnLScpKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgMHUsCisg ICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAor ICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPmhwb3MsIGds eXBoX3p2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgIlxcUyIpOworICAgIH0KKyAgZWxzZSBp ZiAoZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgICAgeworICAgICAgZnByaW50ZiAoc3Rk ZXJyLAorICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4 ICU0ZCAlMS4xZCUxLjFkICAlM2QgJXMgJWNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlw aHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93 LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdJJywKKyAg ICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQor ICAgICAgICAgICAgPyAnQicKKyAgICAgICAgICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQor ICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAg ICAgICAgICAgPyAnMCcKKyAgICAgICAgICA6ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVs X3dpZHRoLAorICAgICAgICAodW5zaWduZWQgaW50KSBnbHlwaC0+dS5pbWdfaWQsCisgICAgICAg IGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAg ICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPmhwb3MsIGdseXBoX3p2 X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgJy4nKTsKKyAgICB9CisgIGVsc2UgaWYgKGdseXBo LT50eXBlID09IENPTVBPU0lURV9HTFlQSCkKKyAgICB7CisgICAgICBmcHJpbnRmIChzdGRlcnIs CisgICAgICAgICIgJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNngiLAor ICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51 c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxh dGl2ZV94LAorICAgICAgICAnKycsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAo QlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ0InCisgICAgICAgICAgOiAo U1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgOiAo TklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgOiAnLScp KSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgKHVuc2lnbmVkIGludCkg Z2x5cGgtPnUuY21wLmlkKTsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAlNGQgJTEuMWQlMS4x ZCIsCisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGlu ZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCk7CisgICAgICBpZiAoZ2x5cGgt PnUuY21wLmF1dG9tYXRpYykKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICAlM2QgJXMgLiBb JWQtJWRdXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96 dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGgtPnNsaWNl LmNtcC5mcm9tLCBnbHlwaC0+c2xpY2UuY21wLnRvKTsKKyAgICAgICAgZWxzZQorICAgICAgICBm cHJpbnRmIChzdGRlcnIsICJcbiIpOworICAgIH0KKyAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0g WFdJREdFVF9HTFlQSCkKKyAgICB7CisjaWZuZGVmIEhBVkVfWFdJREdFVFMKKyAgICAgIGVhc3N1 bWUgKGZhbHNlKTsKKyNlbHNlCisgICAgICBmcHJpbnRmIChzdGRlcnIsCisgICAgICAgICIgICU1 ZC8lLTVkICU1ZCAlNGMgJTZkICVjICUzZCAweCUwNXggJTRkICUxLjFkJTEuMWQgICUzZCAlcyAl Y1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAo KHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAg ICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ1gnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAg ICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgID8gJ0InCisgICAgICAg ICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAg IDogJy0nKSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgZ2x5cGgtPmZh Y2VfaWQsCisgICAgICAgIGdseXBoLT5sZWZ0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5y aWdodF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+dS54d2lkZ2V0LAorICAgICAgICBnbHlw aC0+aHBvcywgZ2x5cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAnLicpOworI2VuZGlm CisgICAgfQorfQorCisvKiBEdW1wIHRoZSBjb250ZW50cyBvZiBnbHlwaCByb3cgYXQgVlBPUyBp biBNQVRSSVggdG8gc3RkZXJyLgorICAgR0xZUEhTIDAgbWVhbnMgZG9uJ3Qgc2hvdyBnbHlwaCBj b250ZW50cy4KKyAgIEdMWVBIUyAxIG1lYW5zIHNob3cgZ2x5cGhzIGluIHNob3J0IGZvcm0KKyAg IEdMWVBIUyA+IDEgbWVhbnMgc2hvdyBnbHlwaHMgaW4gbG9uZyBmb3JtLiAqLwordm9pZAorbWNf ZHVtcF9nbHlwaF9yb3cgKHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgaW50IHZwb3MsIGludCBnbHlw aHMpCit7CisgIGludCByZWxhdGl2ZV94ID0gMDsKKyAgaWYgKGdseXBocyAhPSAxKQorICAgIHsK KyAgICAgIGZwcmludGYgKHN0ZGVyciwgIlxuRFVNUCBHTFlQSCBST1dcbiIpOworICAgICAgZnBy aW50ZiAoc3RkZXJyLCAiUm93ICAgICBTdGFydCAgICAgICBFbmQgVXNlZCBvRT48XFxDVFpGZXNt ICAgICBYICAgIFkgICAgVyAgICBIICAgIFYgICAgQSAgICBQXG4iKTsKKyAgICAgIGZwcmludGYg KHN0ZGVyciwgIj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuIik7CisgICAgICBmcHJpbnRmIChzdGRl cnIsICIlM2QgJTkicEQiZCAlOSJwRCJkICU0ZCAlMS4xZCUxLjFkJTEuMWQlMS4xZFwKKyUxLjFk JTEuMWQlMS4xZCUxLjFkJTEuMWQlMS4xZCUxLjFkJTEuMWQgICU0ZCAlNGQgJTRkICU0ZCAlNGQg JTRkICU0ZFxuIiwKKyAgICAgICAgIHZwb3MsCisgICAgICAgICBNQVRSSVhfUk9XX1NUQVJUX0NI QVJQT1MgKHJvdyksCisgICAgICAgICBNQVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpLAorICAg ICAgICAgcm93LT51c2VkW1RFWFRfQVJFQV0sCisgICAgICAgICByb3ctPmNvbnRhaW5zX292ZXJs YXBwaW5nX2dseXBoc19wLAorICAgICAgICAgcm93LT5lbmFibGVkX3AsCisgICAgICAgICByb3ct PnRydW5jYXRlZF9vbl9sZWZ0X3AsCisgICAgICAgICByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9w LAorICAgICAgICAgcm93LT5jb250aW51ZWRfcCwKKyAgICAgICAgIE1BVFJJWF9ST1dfQ09OVElO VUFUSU9OX0xJTkVfUCAocm93KSwKKyAgICAgICAgIE1BVFJJWF9ST1dfRElTUExBWVNfVEVYVF9Q IChyb3cpLAorICAgICAgICAgcm93LT5lbmRzX2F0X3p2X3AsCisgICAgICAgICByb3ctPmZpbGxf bGluZV9wLAorICAgICAgICAgcm93LT5lbmRzX2luX21pZGRsZV9vZl9jaGFyX3AsCisgICAgICAg ICByb3ctPnN0YXJ0c19pbl9taWRkbGVfb2ZfY2hhcl9wLAorICAgICAgICAgcm93LT5tb3VzZV9m YWNlX3AsCisgICAgICAgICByb3ctPngsCisgICAgICAgICByb3ctPnksCisgICAgICAgICByb3ct PnBpeGVsX3dpZHRoLAorICAgICAgICAgcm93LT5oZWlnaHQsCisgICAgICAgICByb3ctPnZpc2li bGVfaGVpZ2h0LAorICAgICAgICAgcm93LT5hc2NlbnQsCisgICAgICAgICByb3ctPnBoeXNfYXNj ZW50KTsKKyAgICAgIC8qIFRoZSBuZXh0IDMgbGluZXMgc2hvdWxkIGFsaWduIHRvICJTdGFydCIg aW4gdGhlIGhlYWRlci4gKi8KKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgICAlOSJwRCJkICU5 InBEImRcdCU1ZFxuIiwgcm93LT5zdGFydC5vdmVybGF5X3N0cmluZ19pbmRleCwKKyAgICAgICAg IHJvdy0+ZW5kLm92ZXJsYXlfc3RyaW5nX2luZGV4LAorICAgICAgICAgcm93LT5jb250aW51YXRp b25fbGluZXNfd2lkdGgpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICAgICU5InBEImQgJTki cEQiZFxuIiwKKyAgICAgICAgIENIQVJQT1MgKHJvdy0+c3RhcnQuc3RyaW5nX3BvcyksCisgICAg ICAgICBDSEFSUE9TIChyb3ctPmVuZC5zdHJpbmdfcG9zKSk7CisgICAgICBmcHJpbnRmIChzdGRl cnIsICIgICAgJTlkICU5ZFxuIiwgcm93LT5zdGFydC5kcHZlY19pbmRleCwKKyAgICAgICAgIHJv dy0+ZW5kLmRwdmVjX2luZGV4KTsKKyAgICB9CisgIGlmIChnbHlwaHMgPiAxKQorICAgIHsKKyAg ICAgIGZvciAoaW50IGFyZWEgPSBMRUZUX01BUkdJTl9BUkVBOyBhcmVhIDwgTEFTVF9BUkVBOyAr K2FyZWEpCisgICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoID0gcm93LT5n bHlwaHNbYXJlYV07CisgICAgICAgICAgc3RydWN0IGdseXBoICpnbHlwaF9lbmQgPSBnbHlwaCAr IHJvdy0+dXNlZFthcmVhXTsKKyAgICAgICAgICAvKiBHbHlwaCBmb3IgYSBsaW5lIGVuZCBpbiB0 ZXh0LiAqLworICAgICAgICAgIGlmIChhcmVhID09IFRFWFRfQVJFQSAmJiBnbHlwaCA9PSBnbHlw aF9lbmQgJiYgZ2x5cGgtPmNoYXJwb3MgPiAwKQorICAgICAgICAgICAgKytnbHlwaF9lbmQ7Cisg ICAgICAgICAgaWYgKGdseXBoIDwgZ2x5cGhfZW5kKQorICAgICAgICAgICAgZnByaW50ZiAoc3Rk ZXJyLCAiR2x5cGgjL1RvdGFsIFJlbC5YIFQgICAgICAgUG9zIE8gICBXICAgICBDb2RlIEZhY2Ug TFIgSFBPUyBaViBDXG4iKTsKKyAgICAgICAgICBmb3IgKDsgZ2x5cGggPCBnbHlwaF9lbmQ7ICsr Z2x5cGgpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIG1jX2R1bXBfZ2x5cGggKHJvdywg Z2x5cGgsIGFyZWEsIHJlbGF0aXZlX3gsIHZwb3MpOworICAgICAgICAgICAgICByZWxhdGl2ZV94 ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0K KyAgICBlbHNlIGlmIChnbHlwaHMgPT0gMSkKKyAgICAgIHsKKyAgICAgICAgY2hhciBzW1NIUlRf TUFYICsgNF07CisgICAgICAgIGZvciAoaW50IGFyZWEgPSBMRUZUX01BUkdJTl9BUkVBOyBhcmVh IDwgTEFTVF9BUkVBOyArK2FyZWEpCisgICAgICAgICAgeworICAgICAgICAgICAgaW50IGk7Cisg ICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgcm93LT51c2VkW2FyZWFdOyArK2kpCisgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKmdseXBoID0gcm93LT5nbHlw aHNbYXJlYV0gKyBpOworICAgICAgICAgICAgICAgIGlmIChpID09IHJvdy0+dXNlZFthcmVhXSAt IDEKKyAgICAgICAgICAgICAgICAgICAgJiYgYXJlYSA9PSBURVhUX0FSRUEKKyAgICAgICAgICAg ICAgICAgICAgJiYgTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgICAgICAgJiYg Z2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaC0+ dS5jaCA9PSAnICcpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHN0 cmNweSAoJnNbaV0sICJbXFxuXSIpOworICAgICAgICAgICAgICAgICAgICBpICs9IDQ7CisgICAg ICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9 PSBDSEFSX0dMWVBICisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlwaC0+dS5jaCA8 IDB4ODAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT51LmNoID49ICcgJykK KyAgICAgICAgICAgICAgICAgICAgc1tpXSA9IGdseXBoLT51LmNoOworICAgICAgICAgICAgICAg ICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgc1tpXSA9ICcuJzsKKyAgICAgICAgICAg ICAgfQorICAgICAgICAgICAgc1tpXSA9ICdcMCc7CisgICAgICAgICAgICBmcHJpbnRmIChzdGRl cnIsICIlM2Q6ICglZCkgJyVzJ1xuIiwgdnBvcywgcm93LT5lbmFibGVkX3AsIHMpOworICAgICAg ICAgIH0KKyAgICAgIH0KK30KKworREVGVU4gKCJtYy1kdW1wLWdseXBoLXJvdyIsIEZtY19kdW1w X2dseXBoX3JvdywgU21jX2R1bXBfZ2x5cGhfcm93LCAxLCAyLCAiUCIsCisgICAgICAgZG9jOiAv KiBEdW1wIGdseXBoIHJvdyBST1cgdG8gc3RkZXJyLgorSW50ZXJhY3RpdmVseSwgUk9XIGlzIHRo ZSBwcmVmaXggbnVtZXJpYyBhcmd1bWVudCBhbmQgZGVmYXVsdHMgdG8KK3RoZSByb3cgd2hpY2gg ZGlzcGxheXMgcG9pbnQuCitPcHRpb25hbCBhcmd1bWVudCBHTFlQSFMgMCBtZWFucyBkb24ndCBk dW1wIGdseXBocy4KK0dMWVBIUyAxIG1lYW5zIGR1bXAgZ2x5cGhzIGluIHNob3J0IGZvcm0uCitH TFlQSFMgPiAxIG9yIG9taXR0ZWQgbWVhbnMgZHVtcCBnbHlwaHMgaW4gbG9uZyBmb3JtLiAgKi8p CisgIChMaXNwX09iamVjdCByb3csIExpc3BfT2JqZWN0IGdseXBocykKK3sKKyAgc3RydWN0IHdp bmRvdyAqdyA9IFhXSU5ET1cgKHNlbGVjdGVkX3dpbmRvdyk7CisgIHN0cnVjdCBnbHlwaF9tYXRy aXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4OworICBFTUFDU19JTlQgdnBvczsKKyAgaWYg KE5JTFAgKHJvdykpCisgICAgeworICAgICAgaW50IGQxLCBkMiwgZDMsIGQ0LCBkNSwgeXBvczsK KyAgICAgIGJvb2wgdmlzaWJsZV9wID0gcG9zX3Zpc2libGVfcCAodywgUFQsICZkMSwgJmQyLCAm ZDMsICZkNCwgJmQ1LCAmeXBvcyk7CisgICAgICBpbnQgaGVhZGVyX2xpbmVfaGVpZ2h0ID0gV0lO RE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgICAgICBpbnQgdm9mZnNldCA9IChoZWFkZXJf bGluZV9oZWlnaHQgPiAwCisgICAgICAgICAgICAgICAgICAgICAmJiB5cG9zID4gMCkKKyAgICAg ICAgICAgICAgICAgICAgICA/IHlwb3MgKyAxCisgICAgICAgICAgICAgICAgICAgICAgOiB5cG9z OworICAgICAgaWYgKHZpc2libGVfcCkKKyAgICAgICAgdnBvcyA9IHZvZmZzZXQ7CisgICAgICAg IGVsc2UKKyAgICAgICAgICB2cG9zID0gMDsKKyAgICB9CisgICAgZWxzZQorICAgICAgeworICAg ICAgICBDSEVDS19OVU1CRVIgKHJvdyk7CisgICAgICAgIHZwb3MgPSBYRklYTlVNIChyb3cpOwor ICAgICAgfQorICBpZiAodnBvcyA+PSAwICYmIHZwb3MgPCBtYXRyaXgtPm5yb3dzKQorICAgIG1j X2R1bXBfZ2x5cGhfcm93IChNQVRSSVhfUk9XIChtYXRyaXgsIHZwb3MpLAorICAgICAgICB2cG9z LAorICAgICAgICBUWVBFX1JBTkdFRF9GSVhOVU1QIChpbnQsIGdseXBocykgPyBYRklYTlVNIChn bHlwaHMpIDogMik7CisgIHJldHVybiBRbmlsOworfQorCit2b2lkCittY19kdW1wX2dseXBoX21h dHJpeCAoc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBpbnQgZ2x5cGhzKQoreworICBpbnQg aTsKKyAgZm9yIChpID0gMDsgaSA8IG1hdHJpeC0+bnJvd3M7ICsraSkKKyAgICBtY19kdW1wX2ds eXBoX3JvdyAoTUFUUklYX1JPVyAobWF0cml4LCBpKSwgaSwgZ2x5cGhzKTsKK30KKworREVGVU4g KCJtYy1kdW1wLWdseXBoLW1hdHJpeCIsIEZtY19kdW1wX2dseXBoX21hdHJpeCwKKyAgICAgICBT bWNfZHVtcF9nbHlwaF9tYXRyaXgsIDAsIDEsICJwIiwKKyAgICAgICBkb2M6IC8qIER1bXAgdGhl IGN1cnJlbnQgbWF0cml4IG9mIHRoZSBzZWxlY3RlZCB3aW5kb3cgdG8gc3RkZXJyLgorU2hvd3Mg Y29udGVudHMgb2YgZ2x5cGggcm93IHN0cnVjdHVyZXMuICBXaXRoIG5vbi1uaWwKK3BhcmFtZXRl ciBHTFlQSFMsIGR1bXAgZ2x5cGhzIGFzIHdlbGwuICBJZiBHTFlQSFMgaXMgMSBzaG93CitnbHlw aHMgaW4gc2hvcnQgZm9ybSwgb3RoZ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VtIG1jX2NhY2hlX3R5cGUgY2FjaGVf dHlwZSwKKyAgICAgICAgICAgICAgICAgICAgIGludCB2bnRoLCBpbnQgbnRoKQoreworICBpZiAo dm50aCA8IG1hdHJpeC52cG9zX3VzZWQKKyAgICAgICYmIG1hdHJpeC5jdXJzb3JzX3VzZWRbY2Fj aGVfdHlwZV0gPiAwCisgICAgICAmJiBudGggPCBtYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2Vk W2NhY2hlX3R5cGVdKQorICAgIHJldHVybiB0cnVlOworICAgIGVsc2UKKyAgICAgIHJldHVybiBm YWxzZTsKK30KKwordm9pZAorbWNfcmVzZXRfY2FjaGUgKHN0cnVjdCB3aW5kb3cgKncpCit7Cisg IGlmICghQlVGRkVSUCAody0+Y29udGVudHMpKQorICAgIHJldHVybjsKKyAgZm9yIChlbnVtIG1j X2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOworICAgICAgIGNhY2hlX3R5cGUgPCBO T19DQUNIRTsKKyAgICAgICArK2NhY2hlX3R5cGUpCisgICAgeworICAgICAgYm9vbCBidmFyX2Fj dGl2ZV9wOworICAgICAgc3dpdGNoIChjYWNoZV90eXBlKQorICAgICAgICB7CisgICAgICAgICAg Y2FzZSBOT19DQUNIRToKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgcmV0dXJuOworICAg ICAgICAgICAgfQorICAgICAgICAgIGNhc2UgTUNfQ0FDSEU6CisgICAgICAgICAgICB7CisgICAg ICAgICAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICYm IE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKQorICAgICAgICAg ICAgICAgIGJ2YXJfYWN0aXZlX3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBlbHNlIGlmIChC VUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBtY19jb25mKSkpCisgICAgICAgICAgICAgICAg ICBidmFyX2FjdGl2ZV9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAg ICB9CisgICAgICAgICAgY2FzZSBDSF9DQUNIRToKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgJiYgTklMUCAo QlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisgICAgICAgICAgICAg ICAgYnZhcl9hY3RpdmVfcCA9IGZhbHNlOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKEJVRkZF UlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICAgICAgICAgICAgICAg IGJ2YXJfYWN0aXZlX3AgPSB0cnVlOworICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAg IH0KKyAgICAgICAgICBjYXNlIEZDX0NBQ0hFOgorICAgICAgICAgICAgeworICAgICAgICAgICAg ICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAmJiBOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKSkKKyAgICAgICAgICAgICAg ICBidmFyX2FjdGl2ZV9wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoQlVGRkVS UCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpKQorICAgICAgICAgICAgICAgICAg YnZhcl9hY3RpdmVfcCA9IHRydWU7CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAg fQorICAgICAgICB9CisgICAgICBpZiAoIWJ2YXJfYWN0aXZlX3ApCisgICAgICAgIHsKKyAgICAg ICAgICAvKiBEZWNyZWFzZSB0aGUgc2l6ZSBvZiB0aGUgYXJyYXkgdG8gYSBiYXJlIG1pbmltdW0u ICovCisgICAgICAgICAgZm9yIChpbnQgdm50aCA9IDA7IHZudGggPCB3LT5tY19tYXRyaXgudnBv c191c2VkOyArK3ZudGgpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmICh3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV0gPiAxKQorICAgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdID0KKyAgICAgICAgICAgICAgICAgICAgeG5yZWFsbG9jICh3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXSwgMSwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBzaXplb2YgKnctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdKTsKKyAgICAgICAgICAgICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl X2FsbG9jYXRlZFtjYWNoZV90eXBlXSA9IDE7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdID0gMDsK KyAgICAgICAgICAgIH0KKyAgICAgICAgICB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW2NhY2hl X3R5cGVdID0gMDsKKyAgICAgICAgfQorICAgICAgICAvLyAgQWx0aG91Z2ggaXQgd291bGQgbm90 IGJlIHZlcnkgZWZmaWNpZW50LCBpdCBpcyBwb3N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dFRAorICAgICAg ICAgIHx8IGZyb21fd2hlcmUgPT0gU0VUX0NVUlNPUl9UV08pKQorICAgIHsKKyAgICAgIGJvb2wg c2FtZV9wID0gZmFsc2U7CisgICAgICBmb3IgKGludCBudGggPSAwOyBudGggPCB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdOyArK250aCkKKyAgICAgICAgewor ICAgICAgICAgIHNhbWVfcCB8PQorICAgICAgICAgICAgKHctPm1jX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF0uc2FtZV9wID09IHRydWUKKyAgICAgICAgICAgICAmJiB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLnR5cGUg PT0gZ2x5cGgtPnR5cGUKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLmJ5dGVwb3MgPT0gZ2x5cGgtPmJ5dGVwb3MKKyAg ICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhdLmdseXBoLmNoYXJwb3MgPT0gZ2x5cGgtPmNoYXJwb3MKKyAgICAgICAgICAgICAmJiB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoLnUudmFsID09 IGdseXBoLT51LnZhbAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGguZmFjZV9pZCA9PSBnbHlwaC0+ZmFjZV9pZAorICAg ICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF0uZ2x5cGgucGFkZGluZ19wID09IGdseXBoLT5wYW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ICAg ICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XS5yb3dfcG9zaXRpb24gPT0gcm93X3Bvc2l0aW9uCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFibGVkX3AgPT0gdHJ1ZSk7 CisgICAgICAgIH0KKyAgICAgIC8qIEluIGEgc2l0dWF0aW9uIHdoZXJlIHRoZXJlIGFyZSBubyBj aGFuZ2VzIChlLmcuLCBDLWcpLCB3ZSBzdGlsbCBuZWVkIHRvCisgICAgICByZXNldCB0aGUgbGVm dC9yaWdodCBmcmluZ2UgYml0bWFwIGluZGljYXRvcnMuICovCisgICAgICBpZiAoIXNhbWVfcAor ICAgICAgICAgIHx8IGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUAorICAgICAg ICAgIHx8IGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgIG1j X2RyYXdfZXJhc2VfaHlicmlkICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2 cG9zLCB3ZCwgaCwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBj dXJzb3Jfd2lkdGgsIGZvcmVncm91bmQsIGFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIHJlbW92ZV9w KTsKKyAgICAgIHJldHVybjsKKyAgICB9CisgICAgZWxzZSBpZiAoZHJhd19wCisgICAgICAgICAg ICAgJiYgKGZyb21fd2hlcmUgPT0gU0NSSUJFX09ORQorICAgICAgICAgICAgICAgICB8fCBmcm9t X3doZXJlID09IFNDUklCRV9UV08KKyAgICAgICAgICAgICAgICAgfHwgZnJvbV93aGVyZSA9PSBT Q1JJQkVfVEhSRUUKKyAgICAgICAgICAgICAgICAgfHwgZnJvbV93aGVyZSA9PSBOT1dIRVJFKSkK KyAgICAgIHsKKyAgICAgICAgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHcsIG1hdHJpeCwgcm93LCB4 LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgZm9yZWdyb3VuZCwgYWN0aXZlX3AsIGds eXBoX2ZsYXZvciwgcmVtb3ZlX3ApOworICAgICAgICByZXR1cm47CisgICAgICB9CisgIGlmIChj YWNoZV90eXBlID09IE5PX0NBQ0hFKQorICAgIHJldHVybjsKKyAgKyt3LT5tY19tYXRyaXguY3Vy c29yc191c2VkW2NhY2hlX3R5cGVdOworICBpZiAodm50aCA+PSB3LT5tY19tYXRyaXgudnBvc191 c2VkKQorICAgIHctPm1jX21hdHJpeC52cG9zX3VzZWQgPSB2bnRoICsgMTsKKyAgaWYgKHctPm1j X21hdHJpeC52cG9zX2FsbG9jYXRlZCA8IHctPm1jX21hdHJpeC52cG9zX3VzZWQpCisgICAgewor ICAgICAgaW50IG9sZF9hbGxvYyA9IHctPm1jX21hdHJpeC52cG9zX2FsbG9jYXRlZDsKKyAgICAg IGludCBuZXdfZWx0cyA9IHctPm1jX21hdHJpeC52cG9zX3VzZWQgLSB3LT5tY19tYXRyaXgudnBv c19hbGxvY2F0ZWQ7CisgICAgICB3LT5tY19tYXRyaXgudnBvcyA9IHhwYWxsb2MgKHctPm1jX21h dHJpeC52cG9zLCAmdy0+bWNfbWF0cml4LnZwb3NfYWxsb2NhdGVkLAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBuZXdfZWx0cywgSU5UX01BWCwgc2l6ZW9mICp3LT5tY19tYXRy aXgudnBvcyk7CisgICAgICBtZW1zZXQgKHctPm1jX21hdHJpeC52cG9zICsgb2xkX2FsbG9jLCAw LAorICAgICAgICAgICAgICAgKHctPm1jX21hdHJpeC52cG9zX2FsbG9jYXRlZCAtIG9sZF9hbGxv YykgKiBzaXplb2YgKnctPm1jX21hdHJpeC52cG9zKTsKKyAgICB9CisgICsrdy0+bWNfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXTsKKyAgaWYgKHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlX2FsbG9jYXRlZFtjYWNoZV90eXBlXSA8IHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV0pCisgICAgeworICAgICAgaW50IG9sZF9hbGxv YyA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX2FsbG9jYXRlZFtjYWNoZV90eXBlXTsK KyAgICAgIGludCBuZXdfZWx0cyA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX3VzZWRb Y2FjaGVfdHlwZV0gLSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2Fj aGVfdHlwZV07CisgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XSA9IHhwYWxsb2MgKHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVkW2NhY2hlX3R5cGVdLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBuZXdfZWx0cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgSU5UX01BWCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mICp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fdHlwZWAuCisgICBIOiAgTUNfSEJBUiBpcyAxIHBp eGVsLCBhbmQgYWxsIG90aGVycyBhcmUgUk9XLT5WSVNJQkxFX0hFSUdIVC4KKyAgICAgICBGSVhN RTogIEFkZCBjb25kaXRpb25zIGZvciB1c2VyLXNwZWNpZmllZCB0aGlja25lc3Mgb2YgTUNfQkFS IGFuZAorICAgICAgICAgICAgICAgTUNfSEJBUiBhcyB0byBgbWMtcmVhbC1mYWtlLWN1cnNvcicu CisgICBNVUxUSVBMRV9DVVJTT1JTOiAgV2UgZG8gbm90IHVzZSB0aGlzIGZ1bmN0aW9uLgorICAg SE9SSVpPTlRBTF9SVUxFUjogIFdlIHdhbnQgYSB1bml2ZXJzYWwgRlkgY29vcmRpbmF0ZSBmb3Ig YSBsZXZlbCBydWxlci4KKyAgIFZFUlRJQ0FMX1JVTEVSIGFuZCBGSUxMX0NPTFVNTjogIFdlIHdh bnQgYW4gSCB0aGF0IGVuc3VyZXMgbm8gZ2FwIGJldHdlZW4gdGhlCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBwcmV2aW91cy9uZXh0IGxpbmUuICBUaGUgRlggY29vcmRpbmF0 ZSBpcyBzZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V3aGVyZTog IGB3LT5jdXJzb3IueGAgLyBgbWMuZmNfeGAuICovCit2b2lkCittY19nZXRfY3Vyc29yX2dlb21l dHJ5IChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsCisgICAg ICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCB4LCBpbnQgKmZ4 LCBpbnQgeSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCAqZnksIGludCBocG9zLCBpbnQg dnBvcywgaW50ICpoLAorICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlw ZSBjdXJzb3JfdHlwZSwgaW50IGN1cnNvcl93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAg IGludCAqd2QpCit7CisgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSBtY19nZXRfY3Vyc29yX2dseXBo ICh3LCBtYXRyaXgsIHJvdywgaHBvcywgdnBvcyk7CisgIGlmIChnbHlwaCA9PSBOVUxMKQorICAg IHJldHVybjsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1dfRlJBTUUgKHcpKTsK KyAgKmZ4ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgeCk7CisgICpoID0gcm93 LT52aXNpYmxlX2hlaWdodDsKKyAgLyogRG9uJ3QgbGV0IHRoZSBjdXJzb3IgZXhjZWVkIHRoZSBk aW1lbnNpb25zIG9mIHRoZSByb3csIHNvIHRoYXQKKyAgdGhlIHVwcGVyL2xvd2VyIHNpZGUgb2Yg dGhlIGJveCBhcmVuJ3QgY2xpcHBlZC4gICovCisgIGludCB3X2hlYWRlcl9saW5lX2hlaWdodCA9 IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICBpbnQgd190ZXh0X2JvdHRvbV95ID0g d2luZG93X3RleHRfYm90dG9tX3kgKHcpIC0gKmg7CisgIGlmICh5IDwgd19oZWFkZXJfbGluZV9o ZWlnaHQpCisgICAgeworICAgICAgKmggPSBtYXggKCpoIC0gKHdfaGVhZGVyX2xpbmVfaGVpZ2h0 IC0geSkgKyAxLCAqaCk7CisgICAgICB5ID0gd19oZWFkZXJfbGluZV9oZWlnaHQgLSAxOworICAg ICAgLy8gZnByaW50ZiAoc3RkZXJyLCAiQ09ORElUSU9OICMgMVxuIik7CisgICAgfQorICAgZWxz ZSBpZiAoeSA+IHdfdGV4dF9ib3R0b21feSkKKyAgICAgeworICAgICAgICpoICs9IHkgLSB3X3Rl eHRfYm90dG9tX3k7CisgICAgICAgeSA9IHdfdGV4dF9ib3R0b21feTsKKyAgICAgICAvLyBmcHJp bnRmIChzdGRlcnIsICJDT05ESVRJT04gIyAyXG4iKTsKKyAgICAgfQorICAqZnkgPSBXSU5ET1df VE9fRlJBTUVfUElYRUxfWSAodywgeSk7CisgIHN3aXRjaCAoY3Vyc29yX3R5cGUpCisgICAgewor ICAgICAgY2FzZSBNQ19CQVI6CisgICAgICAgIHsKKyAgICAgICAgICBpZiAoY3Vyc29yX3dpZHRo IDwgMSkKKyAgICAgICAgICAgIGN1cnNvcl93aWR0aCA9IG1heCAoRlJBTUVfQ1VSU09SX1dJRFRI IChmKSwgMSk7CisgICAgICAgICAgaWYgKGN1cnNvcl93aWR0aCA8IGdseXBoLT5waXhlbF93aWR0 aCkKKyAgICAgICAgICAqd2QgPSBjdXJzb3Jfd2lkdGg7CisgICAgICAgICAgYnJlYWs7CisgICAg ICAgIH0KKyAgICAgIGNhc2UgTUNfSEJBUjoKKyAgICAgICAgeworICAgICAgICAgIGludCBjdXJz b3JfaGVpZ2h0ID0gKGN1cnNvcl93aWR0aCA8IDEpID8gbHJpbnQgKDAuMjUgKiAqaCkgOiBjdXJz b3Jfd2lkdGg7CisgICAgICAgICAgaWYgKGN1cnNvcl9oZWlnaHQgPiByb3ctPmhlaWdodCkKKyAg ICAgICAgICAgIGN1cnNvcl9oZWlnaHQgPSByb3ctPmhlaWdodDsKKyAgICAgICAgICAvKiBDdXJz b3Igc21hbGxlciB0aGFuIGxpbmUgaGVpZ2h0LCBzbyBtb3ZlIGRvd24uICovCisgICAgICAgICAg aWYgKCpoID4gY3Vyc29yX2hlaWdodCkKKyAgICAgICAgICAgICpmeSArPSAqaCAtIGN1cnNvcl9o ZWlnaHQ7CisgICAgICAgICAgKmggPSBjdXJzb3JfaGVpZ2h0OworICAgICAgICAgICp3ZCA9IGds eXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgY2Fz ZSBNQ19SSUdIVF9GUklOR0VfQklUTUFQOgorICAgICAgY2FzZSBNQ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VE9fRlJBTUVfUElYRUxfWCAodywgb3BvaW50X3gp OworICBpbnQgZmNfZnggPSBXSU5ET1dfVEVYVF9UT19GUkFNRV9QSVhFTF9YICh3LCBlc3NlbnRp YWxzLmZjX3gpOworICBib29sIGdseXBoX3p2X3AgPSAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhU X0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICYmIE1B VFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgPT0gWlYpOworICBzdHJ1Y3QgZnJhbWUgKmYgPSBY RlJBTUUgKHctPmZyYW1lKTsKKyAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKHctPmNvbnRl bnRzKTsKKyAgaW50IHRleHRfYXJlYV93aWR0aCA9IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRf QVJFQSk7CisgIHN0cnVjdCBnbHlwaF9yb3cgKmN1cnNvcl9yb3cgPSAody0+Y3Vyc29yLnZwb3Mg IT0gLTEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1BVFJJWF9ST1cgKGN1 cnNvcl9tYXRyaXgsIHctPmN1cnNvci52cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgOiBOVUxMOworICBzdHJ1Y3QgZ2x5cGggKmN1cnNvcl9nbHlwaCA9ICh3LT5jdXJzb3Iu dnBvcyAhPSAtMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IG1jX2dldF9jdXJz b3JfZ2x5cGggKHcsIGN1cnNvcl9tYXRyaXgsIGN1cnNvcl9yb3csCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5jdXJzb3IuaHBvcywgdy0+ Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBOVUxMOworICBi b29sIGN1cnNvcl9hdF9mcmluZ2VfcCA9IChjdXJzb3JfZ2x5cGggPT0gTlVMTAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93ICE9IE5VTEwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gY3Vyc29yX3Jvdy0+dXNlZFtURVhU X0FSRUFdCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3ctPmV4YWN0 X3dpbmRvd193aWR0aF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+ Y3Vyc29yLnggPT0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIHctPmN1cnNvci54ID09IGN1cnNvcl9yb3ctPnBpeGVsX3dpZHRoKTsKKyAgYm9vbCBjdXJz b3JfYmV5b25kX2ZyaW5nZV9wID0gKGN1cnNvcl9nbHlwaCA9PSBOVUxMCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93ICE9IE5VTEwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID09IGN1cnNvcl9yb3ctPnVzZWRb VEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIWN1cnNvcl9y b3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmIHctPmN1cnNvci54ID49IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0gY3Vyc29yX3Jvdy0+cGl4ZWxfd2lk dGgpOworICBpbnQgZnJhbWVfY2hhcl93aWR0aCA9IEZSQU1FX0NPTFVNTl9XSURUSCAoZik7Cisg IGludCB0ZW1wX2ZhY2VfaWQgPSBnbHlwaC0+ZmFjZV9pZDsKKyAgc3RydWN0IG1jX1JHQiBiYWNr Z3JvdW5kOworICBtY19zZXRfbHNsX2JnICh3LCB0ZW1wX2ZhY2VfaWQsICZiYWNrZ3JvdW5kKTsK KyAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3AgPSAob3BvaW50X3ggPT0gcmVsYXRpdmVfeAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfaHBvcyA9PSBocG9zCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF95ID09IHJvdy0+eQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfdnBvcyA9PSB2cG9zKTsKKworLyogLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgQkVHSU46ICBDSEFSX0dMWVBI IHwgR0xZUEhMRVNTX0dMWVBIICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLSAqLworICBpZiAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgfHwgZ2x5cGgt PnR5cGUgPT0gR0xZUEhMRVNTX0dMWVBIKQorICB7CisgICAgaWYgKG1jX3N0ZGVycl9wKQorICAg ICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiXG4gJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJw RCJkICVjICUzZCAweCUwNnggJTRkICUxLjFkJTEuMWQgICUzZCAlcyAlc1xuIiwKKyAgICAgICAg Z2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVh XSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwK KyAgICAgICAgKGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgICAgID8gJ0MnCisgICAg ICAgICA6ICdHJyksCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAoQlVGRkVSUCAo Z2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0InCisgICAgICAgICA6IChTVFJJTkdQIChnbHlw aC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICAgIDogKE5JTFAgKGdseXBo LT5vYmplY3QpCisgICAgICAgICAgICAgICA/ICcwJworICAgICAgICAgICAgICAgOiAnLScpKSks CisgICAgICAgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgZ2x5cGgtPnUuY2gs CisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9w LAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPmhwb3Ms IGdseXBoX3p2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgbWNfY2hhcl90b19zdHJpbmcgKGds eXBoLT51LmNoKSk7CisgIHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsKKy8qIC0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLSAqLworLyogICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTOiAgQ0hBUl9HTFlQ SCB8IEdMWVBITEVTU19HTFlQSCAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0g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3dpZHRoLCByb3dfcG9zaXRpb24sIGZvcmVncm91 bmQsCisgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZCwgZXNzZW50aWFscy5hY3RpdmVfcCwg TUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgICBjYWNoZV90 eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICBpZiAocmVsYXRpdmVfeCA8IHJvdy0+cGl4ZWxfd2lk dGgpCisgICAgICAgIHsKKyAgICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0 aDsKKyAgICAgICAgICBmeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgIH0KKyAgICAg IGlmIChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0g MQorICAgICAgICAgICYmIHJlbGF0aXZlX3ggPCB4X2xpbWl0KQorICAgICAgICBtY19oZWxwZXIg KHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9z LAorICAgICAgICAgICAgICAgICAgIHhfbGltaXQgLSByZWxhdGl2ZV94LCBoLCBjdXJzb3JfdHlw ZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sCisgICAgICAgICAgICAgICAgICAgZm9yZWdy b3VuZCwgYmFja2dyb3VuZCwgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEhMRVNTLAorICAg ICAgICAgICAgICAgICAgIGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwgYWN0aW9uX3R5 cGUpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAg ICAgICAgICAgICAgIFZFUlRJQ0FMX1JVTEVSOiAgQ0hBUl9HTFlQSCB8IEdMWVBITEVTU19HTFlQ SCAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2Ug VkVSVElDQUxfUlVMRVI6CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9y ID0gKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYXRfZnJpbmdlX3AK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+dHJ1bmNhdGVk X29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNf VkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6IChjdXJzb3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdI VF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2Jl eW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg Y3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdICE9IDEKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGggLSByb3ctPmdseXBo c1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF94ID49IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF96dl9wKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIGlmIChnbHlwaF9mbGF2b3Ig PT0gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9y ID09IE1DX1JFVkVSU0VEX1ZFUlR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gICAgeworICAgICAg ZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9B UkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID49IHJvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF96dl9wKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiAoIU5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIg KHctPmNvbnRlbnRzKSwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3kgPT0geQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3Zwb3MgPT0gdnBvcykKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogTUNfR0xZUEg7CisgICAgICB3ZCA9IDE7CisgICAgICBtY19o ZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZmNfZngsIHksIGZ5LCBo cG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93 aWR0aCwgcm93X3Bvc2l0aW9uLCB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LS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAq LworICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKQorICB7CisgICAgaWYg KG1jX3N0ZGVycl9wKQorICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiXG4gJTUicEQi ZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNnggJTRkICUxLjFkJTEuMWQgICUzZCAl cyAlc1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAg ICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAg ICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ1MnLAorICAgICAgICBnbHlwaC0+Y2hhcnBvcywK KyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICA/ICdCJworICAgICAg ICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAg ICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgICAgPyAnMCcKKyAgICAg ICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAg IDB1LAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtPmxlZnRfYm94X2xp bmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAgICAgIGdseXBoLT5o cG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICJcXFMiKTsKKyAgc3dpdGNo IChhY3Rpb25fdHlwZSkKKyAgeworLyogLS0tLS0tLS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ICAgY2FzZSBIT1JJWk9OVEFMX1JVTEVSOgorICAgIHsKKyAgICAgIGlmIChyZWxhdGl2ZV94IDwg cm93LT5waXhlbF93aWR0aAorICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAg ICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwg ZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNvcl90eXBlLCBj dXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgICAgICAg ICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBNQ19HTFlQSCwgZHJhd19wLCBmcm9t X3doZXJlLAorICAgICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAg ICAgIGlmIChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFd IC0gMQorICAgICAgICAgICYmIHJlbGF0aXZlX3ggPD0geF9saW1pdCkKKyAgICAgICAgeworICAg ICAgICAgIGlmIChyZWxhdGl2ZV94IDwgcm93LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAg ICAgICAgIGZ4ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAg ICB0ZW1wX2ZhY2VfaWQgPSAocm93LT5maWxsX2xpbmVfcCkKKyAgICAgICAgICAgICAgICAgICAg ICAgICA/IGdseXBoLT5mYWNlX2lkCisgICAgICAgICAgICAgICAgICAgICAgICAgOiBERUZBVUxU X0ZBQ0VfSUQ7CisgICAgICAgICAgc3RydWN0IG1jX1JHQiBiYWNrZ3JvdW5kOworICAgICAgICAg IG1jX3NldF9sc2xfYmcgKHcsIHRlbXBfZmFjZV9pZCwgJmJhY2tncm91bmQpOworICAgICAgICAg IG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94LCBmeCwgeSwgZnks IGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICB4X2xpbWl0IC0gcmVsYXRpdmVfeCwg aCwgY3Vyc29yX3R5cGUsIHhfbGltaXQgLSByZWxhdGl2ZV94LAorICAgICAgICAgICAgICAgICAg ICAgcm93X3Bvc2l0aW9uLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2 ZV9wLAorICAgICAgICAgICAgICAgICAgICAgTUNfR0xZUEhMRVNTLCBkcmF3X3AsIGZyb21fd2hl cmUsIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgICAgfQorICAgICAgYnJlYWs7Cisg ICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAg ICAgVkVSVElDQUxfUlVMRVI6ICBTVFJFVENIX0dMWVBIICAgICAgICAgICAgICAgICAgICAgKi8K Ky8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgVkVSVElDQUxfUlVMRVI6CisgICAg eworICAgICAgaWYgKHJvdy0+ZmlsbF9saW5lX3AKKyAgICAgICAgICAmJiBnbHlwaCAtIHJvdy0+ Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICYmIG9w b2ludF94ID4gcmVsYXRpdmVfeCArIGdseXBoLT5waXhlbF93aWR0aCkKKyAgICAgICAgdGVtcF9m YWNlX2lkID0gZ2x5cGgtPmZhY2VfaWQ7CisgICAgICAgIGVsc2UgaWYgKCFyb3ctPmZpbGxfbGlu ZV9wCisgICAgICAgICAgICAgICAgICYmIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9 PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICYmIG9wb2ludF94ID4gcmVs YXRpdmVfeCArIGdseXBoLT5waXhlbF93aWR0aCkKKyAgICAgICAgICB0ZW1wX2ZhY2VfaWQgPSBE RUZBVUxUX0ZBQ0VfSUQ7CisgICAgICBzdHJ1Y3QgbWNfUkdCIGJhY2tncm91bmQ7CisgICAgICBt Y19zZXRfbHNsX2JnICh3LCB0ZW1wX2ZhY2VfaWQsICZiYWNrZ3JvdW5kKTsKKyAgICAgIGVudW0g bWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPmNvbnRpbnVlZF9wKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2Vf cAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+Y29udGlu dWVkX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPnRy dW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25f cmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRVZF UlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXSAhPSAxCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRf b25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19S RVZFUlNFRF9WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogTUNfR0xZUEhMRVNTOworICAgICAgaWYgKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9C QVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURf VkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1D X1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNf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HglMDZ4ICU0ZCAlMS4xZCUxLjFkICAlM2Qg JXMgJWNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSwKKyAgICAg ICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFdIC0gMSksCisg ICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdJJywKKyAgICAgICAgZ2x5cGgtPmNoYXJwb3Ms CisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAnQicKKyAgICAg ICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdTJworICAgICAg ICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAgID8gJzAnCisgICAg ICAgICAgICAgICA6ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAgICAg ICAodW5zaWduZWQgaW50KSBnbHlwaC0+dS5pbWdfaWQsCisgICAgICAgIGdseXBoLT5mYWNlX2lk LAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRf Ym94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPmhwb3MsIGdseXBoX3p2X3AgPyAiWlYiIDogIi0t IiwKKyAgICAgICAgJy4nKTsKKyAgc3dpdGNoIChhY3Rpb25fdHlwZSkKKyAgeworLyogLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJT T1JTOiAgSU1BR0VfR0xZUEggICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0t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S0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgIH0KKyAgfQor LyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgRU5EOiAgSU1BR0VfR0xZUEggICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLSAqLworCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAg ICAgICAgICAgICAgICAgICAgICAgIEJFR0lOOiAgQ09NUE9TSVRFX0dMWVBIICAgICAgICAgICAg ICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgIGVsc2UgaWYgKGds eXBoLT50eXBlID09IENPTVBPU0lURV9HTFlQSCkKKyAgeworICAgIGlmIChtY19zdGRlcnJfcCkK KyAgICAgIHsKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAgICJcbiAlNSJwRCJk LyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCIsCisgICAgICAgICAgZ2x5cGggLSBy b3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAgICgocm93LT51c2VkW2FyZWFdID09IDAp ID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICAgIHJlbGF0aXZlX3gsCisgICAg ICAgICAgJysnLAorICAgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAgIChCVUZGRVJQ IChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICA/ICdCJworICAgICAgICAgICA6IChTVFJJTkdQ IChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgICA/ICdTJworICAgICAgICAgICAgICA6IChO SUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgICAgICA/ICcwJworICAgICAgICAgICAg ICAgICA6ICctJykpKSwKKyAgICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgsCisgICAgICAgICAg KHVuc2lnbmVkIGludCkgZ2x5cGgtPnUuY21wLmlkKTsKKyAgICAgICAgZnByaW50ZiAoc3RkZXJy LCAiICU0ZCAlMS4xZCUxLjFkIiwKKyAgICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAg ICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICAgIGdseXBoLT5yaWdodF9ib3hfbGlu ZV9wKTsKKyAgICAgIGlmIChnbHlwaC0+dS5jbXAuYXV0b21hdGljKQorICAgICAgICBmcHJpbnRm IChzdGRlcnIsICIgICUzZCAlcyAuIFslZC0lZF1cbiIsCisgICAgICAgICAgICAgICAgICAgICAg ICAgZ2x5cGgtPmhwb3MsIGdseXBoX3p2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgICAgICAg ICAgICAgICAgICBnbHlwaC0+c2xpY2UuY21wLmZyb20sIGdseXBoLT5zbGljZS5jbXAudG8pOwor ICAgICAgICBlbHNlCisgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiXG4iKTsKKyAgICAgIH0K KyAgc3dpdGNoIChhY3Rpb25fdHlwZSkKKyAgeworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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gICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAg ICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHks IGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwg Y3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAg ICAgYmFja2dyb3VuZCwgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwgZnJv bV93aGVyZSwKKyAgICAgICAgICAgICAgICAgICBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7Cisg ICAgICBpZiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVh XSAtIDEKKyAgICAgICAgICAmJiByZWxhdGl2ZV94IDw9IHhfbGltaXQpCisgICAgICAgIHsKKyAg ICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICB3aGls ZSAocmVsYXRpdmVfeCA8PSB4X2xpbWl0KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBt Y19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBo cG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwg Y3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAg ICAgICAgICAgYmFja2dyb3VuZCwgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEhMRVNTLCBk cmF3X3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwg YWN0aW9uX3R5cGUpOworICAgICAgICAgICAgICByZWxhdGl2ZV94ICs9IGZyYW1lX2NoYXJfd2lk dGg7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgVkVSVElDQUxf UlVMRVI6ICBDT01QT1NJVEVfR0xZUEggICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIFZFUlRJQ0FMX1JVTEVSOgorICAgIHsKKyAgICAgIGVu dW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChjdXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPmNvbnRpbnVlZF9wKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xB U0gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmlu Z2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+Y29u dGludWVkX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ct PnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRf b25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19S RVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXSAhPSAx CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0 ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBN Q19SRVZFUlNFRF9WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0g LSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvcG9pbnRfeCA+ PSByb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAo Z2x5cGhfenZfcCkKKyAgICAgICAgIC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tLSAqLworLyog ICAgICAgICAgICAgICAgICAgICAgICAgIEZJTExfQ09MVU1OOiAgQ09NUE9TSVRFX0dMWVBIICAg ICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNl IEZJTExfQ09MVU1OOgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9 IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+ IHJlbGF0aXZlX3gpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNf R0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF96 dl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVT UworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoIU5JTFAgKEJWQVIgKGIs IGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg IU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfdmVydGljYWxfcnVsZXIpKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3kgPT0geQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3Zwb3MgPT0g dnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExF U1MKKyAgICAgICAgICAgICAgICAgICAgICA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0tLS0gKi8K KworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgQkVHSU46ICBYV0lER0VUX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8q IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBYV0lER0VU X0dMWVBIKQorICB7CisjaWZuZGVmIEhBVkVfWFdJREdFVFMKKyAgICBlYXNzdW1lIChmYWxzZSk7 CisjZWxzZQorICAgIGlmIChtY19zdGRlcnJfcCkKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAg ICAgICAgIlxuICAlNWQvJS01ZCAlNWQgJTRjICU2ZCAlYyAlM2QgMHglMDV4ICU0ZCAlMS4xZCUx LjFkICAlM2QgJXMgJWNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVB XSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2FyZWFd IC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdYJywKKyAgICAgICAgZ2x5cGgt PmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgPyAn QicKKyAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ICdT JworICAgICAgICAgICAgOiAnLScpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dpZHRoLAorICAg ICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgtP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LS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgSE9S SVpPTlRBTF9SVUxFUjogIFhXSURHRVRfR0xZUEggICAgICAgICAgICAgICAgICAgICAqLworLyog LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBIT1JJWk9OVEFMX1JVTEVSOgorICAgIHsK KyAgICAgIGlmIChyZWxhdGl2ZV94IDw9IHhfbGltaXQKKyAgICAgICAgICAmJiAhcmVhbF9mYWtl X2N1cnNvcl9wKQorICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVs YXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgIHdkLCBo LCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisg ICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZCwgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZ UEgsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgICBjYWNoZV90eXBlLCBh Y3Rpb25fdHlwZSk7CisgICAgICBpZiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09 IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiByZWxhdGl2ZV94IDw9IHhfbGltaXQp CisgICAgICAgIHsKKyAgICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0aDsK KyAgICAgICAgICB3aGlsZSAocmVsYXRpdmVfeCA8PSB4X2xpbWl0KQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVf eCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgIHdkLCBo LCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisg ICAgICAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZCwgZXNzZW50aWFscy5hY3RpdmVfcCwg TUNfR0xZUEhMRVNTLCBkcmF3X3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgZnJvbV93aGVy ZSwgY2FjaGVfdHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAgICAgICAgICByZWxhdGl2ZV94ICs9 IGZyYW1lX2NoYXJfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGJyZWFr OworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAg ICAgICAgIFZFUlRJQ0FMX1JVTEVSOiAgWFdJREdFVF9HTFlQSCAgICAgICAgICAgICAgICAgICAg ICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIFZFUlRJQ0FMX1JVTEVSOgor ICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChjdXJzb3JfYXRfZnJp bmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPmNvbnRp bnVlZF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJ Q0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog KGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgIXJvdy0+Y29udGludWVkX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9SSUdI VF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2Jl eW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg cm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3ctPnVzZWRb VEVYVF9BUkVBXSAhPSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSBy b3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBvcG9pbnRfeCA+PSByb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiAoZ2x5cGhfenZfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDogTUNfR0xZUEg7CisgICAgICBpZiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JB Ul9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9W RVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNf VkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19W RVJUSUNBTF9CQVIKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVS VElDQUxfQkFSKQorICAgICAgICBjdXJzb3JfdHlwZSA9IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA7 CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgb3Bv aW50X2Z4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgd2QsIGgsIGN1cnNv cl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgZm9yZWdyb3VuZCwKKyAgICAgICAg ICAgICAgICAgYmFja2dyb3VuZCwgZXNzZW50aWFscy5hY3RpdmVfcCwgZ2x5cGhfZmxhdm9yLCBk cmF3X3AsIGZyb21fd2hlcmUsCisgICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUsIGFjdGlvbl90 eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyog ICAgICAgICAgICAgICAgICAgICAgICAgICBGSUxMX0NPTFVNTjogIFhXSURHRVRfR0xZUEggICAg ICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNl IEZJTExfQ09MVU1OOgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9 IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+ IHJlbGF0aXZlX3gpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNf R0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF96 dl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVT UworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoIU5JTFAgKEJWQVIgKGIs IGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg IU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfdmVydGljYWxfcnVsZXIpKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3kgPT0geQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3Zwb3MgPT0g dnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExF U1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfR0xZUEg7CisgICAg ICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZmNfZngsIHks IGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1 cnNvcl93aWR0aCwgcm93X3Bvc2l0aW9uLCBmb3JlZ3JvdW5kLAorICAgICAgICAgICAgICAgICBi YWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgZnJv bV93aGVyZSwKKyAgICAgICAgICAgICAgICAgY2FjaGVfdHlwZSwgYWN0aW9uX3R5cGUpOworICAg ICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBDVVJT T1JfSU5ESUNBVE9SOgorICAgIHsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLSAqLworICB9CisgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgRU5EOiAgWFdJREdFVF9HTFlQSCAgICAgICAgICAgICAg ICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KK30KKwordm9pZAorbWNf ZHJhd19yb3cgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwg c3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqc3RhcnQs IGludCB4LCBpbnQgaHBvc19sZW5ndGgsIGludCB2cG9zLAorICAgICAgICAgICAgIHN0cnVjdCBn bHlwaF9tYXRyaXggKmN1cnNvcl9tYXRyaXgsIHN0cnVjdCBtY19lc3NlbnRpYWxzIGVzc2VudGlh bHMsCisgICAgICAgICAgICAgZW51bSBtY19yb3dfcG9zaXRpb24gcm93X3Bvc2l0aW9uLCBib29s IGRyYXdfcCwgZW51bSBtY19kcmF3X3Jvd190eXBlIGZyb21fd2hlcmUpCit7CisgIC8vICBjbG9j a190IGNsb2NrX3N0YXJ0ID0gY2xvY2soKTsKKyAgLyogVzMyIEVtYWNzIGNyYXNoZXMgb24gc3Rh cnR1cCB3aXRob3V0IGEgYEJVRkZFUlAnIGNoZWNrIGluIGB1cGRhdGVfd2luZG93Jy4gKi8KKyAg aWYgKCFCVUZGRVJQICh3LT5jb250ZW50cykpCisgICAgcmV0dXJuOworICBzdHJ1Y3QgYnVmZmVy ICpiID0gWEJVRkZFUiAody0+Y29udGVudHMpOworICBpZiAoTklMUCAoQlZBUiAoYiwgbWNfY29u ZikpCisgICAgICAmJiBOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICYmIE5JTFAg KEJWQVIgKGIsIGZjX3Zpc2libGUpKSkKKyAgICByZXR1cm47CisgIHN0cnVjdCBnbHlwaF9yb3cg KmJvdHRvbV9yb3cgPSBNQVRSSVhfQk9UVE9NX1RFWFRfUk9XIChtYXRyaXgsIHcpOworICBpbnQg Ym90dG9tX3Zwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKGJvdHRvbV9yb3csIG1hdHJpeCk7CisgIGlm ICh2cG9zID09IGJvdHRvbV92cG9zKQorICAgIHJldHVybjsKKyAgaWYgKCFyb3ctPnVzZWRbVEVY VF9BUkVBXSkKKyAgICByZXR1cm47CisgIGludCBocG9zX3N0YXJ0ID0gc3RhcnQgLSByb3ctPmds eXBoc1tURVhUX0FSRUFdOworICBpZiAobWNfc3RkZXJyX3ApCisgICAgZnByaW50ZiAoc3RkZXJy LCAibWNfZHJhd19yb3cgKCVkKTogIGRyYXdfcCAoJXMpIHwgaHBvcyAoJWQpIHwgbGVuICglZClc biIsCisgICAgICAgICAgICAgICAgICAgICB2cG9zLCBkcmF3X3AgPyAieSIgOiAibiIsIGhwb3Nf c3RhcnQsIGhwb3NfbGVuZ3RoKTsKKyAgaW50IG9wb2ludF9meCwgb3BvaW50X2Z5LCBvcG9pbnRf d2QsIG9wb2ludF9oOworICBpbnQgdGV4dF9hcmVhX3dpZHRoID0gd2luZG93X2JveF93aWR0aCAo dywgVEVYVF9BUkVBKTsKKyAgaW50IGhlYWRlcl9saW5lX2Zvcm1hdCA9IFdJTkRPV19IRUFERVJf TElORV9IRUlHSFQgKHcpOworICBzdHJ1Y3QgZ2x5cGhfcm93ICpjdXJzb3Jfcm93ID0gKHctPmN1 cnNvci52cG9zICE9IC0xKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRS SVhfUk9XIChjdXJzb3JfbWF0cml4LCB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogTlVMTDsKKyAgc3RydWN0IGdseXBoICpjdXJzb3JfZ2x5cGggPSAo dy0+Y3Vyc29yLnZwb3MgIT0gLTEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBt Y19nZXRfY3Vyc29yX2dseXBoICh3LCBjdXJzb3JfbWF0cml4LCBjdXJzb3Jfcm93LAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29y Lmhwb3MsIHctPmN1cnNvci52cG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDog TlVMTDsKKyAgYm9vbCBjdXJzb3JfYXRfZnJpbmdlX3AgPSAoY3Vyc29yX2dseXBoID09IE5VTEwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3JvdyAhPSBOVUxMCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID09IGN1cnNvcl9yb3ct PnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jf cm93LT5leGFjdF93aW5kb3dfd2lkdGhfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHctPmN1cnNvci54ID09IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA9PSBjdXJzb3Jfcm93LT5waXhlbF93aWR0aCk7Cisg IGJvb2wgY3Vyc29yX2JleW9uZF9mcmluZ2VfcCA9IChjdXJzb3JfZ2x5cGggPT0gTlVMTAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3JvdyAhPSBOVUxMCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA9PSBjdXJzb3Jf cm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm ICFjdXJzb3Jfcm93LT5leGFjdF93aW5kb3dfd2lkdGhfbGluZV9wCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA+PSB0ZXh0X2FyZWFfd2lkdGgKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IGN1cnNvcl9yb3ct PnBpeGVsX3dpZHRoKTsKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAgICAg ICAgICAgICAgICBSRVBMQUNFIFRIRSBSRUFMIENVUlNPUgorKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisgIGVudW0gZmFjZV9pZCBiZ19mYWNlX2lkID0gKGN1cnNvcl9nbHlwaCAhPSBOVUxMKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gY3Vyc29yX2dseXBoLT5mYWNlX2lkCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgIHN0cnVjdCBtY19S R0IgY3Vyc29yX2JnOworICBtY19zZXRfbHNsX2JnICh3LCBiZ19mYWNlX2lkLCAmY3Vyc29yX2Jn KTsKKyAgLyogRklYTUU6ICBQdXQgaW4gc29tZSBjb2RlIHRvIGRlZmF1bHQgdG8gTUNfSE9MTE9X X0JPWCBpZiB0aGUgdXNlciBoYXMKKyAgdW53aXR0aW5nbHkgY29tZSB1cCB3aXRoIHNvbWUgdW5h Y2NlcHRhYmxlIGZvcm0gb2YgdW5yZWNvZ25pemVkIGN1cnNvciB0eXBlLiAqLworICBMaXNwX09i amVjdCBsaXNwX3R5cGUgPSBCVkFSIChiLCBtY19yZWFsX2Zha2VfY3Vyc29yKTsKKyAgZW51bSBt Y19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSA9IChDT05TUCAobGlzcF90eXBlKSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfbGlzcF90b19jdXJzb3JfdHlwZSAoWENB UiAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogbWNf bGlzcF90b19jdXJzb3JfdHlwZSAobGlzcF90eXBlKTsKKyAgaW50IGN1cnNvcl93aWR0aCA9IChD T05TUCAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgID8gWEZJWE5VTSAoWENBUiAo WENEUiAobGlzcF90eXBlKSkpCisgICAgICAgICAgICAgICAgICAgICA6IC0xOworICBzdHJ1Y3Qg bWNfUkdCIGN1cnNvcl9mZzsKKyAgbWNfY29sb3JfcGlja2VyICh3LCBjdXJzb3JfZ2x5cGgsIGVz c2VudGlhbHMsICZjdXJzb3JfZmcsIC0xLCBjdXJzb3JfdHlwZSwKKyAgICAgICAgICAgICAgICAg ICByb3dfcG9zaXRpb24sIENVUlNPUl9JTkRJQ0FUT1IpOworICBib29sIGZpbGxfY29sdW1uX3Ry dW1wc19wID0gKCFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGZjX3Zpc2libGUpKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID09IGVzc2VudGlhbHMu ZmNfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFjdXJzb3JfYXRfZnJpbmdl X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhY3Vyc29yX2JleW9uZF9mcmlu Z2VfcCk7CisgIC8qIFdlIHVzZSBhIHRlc3Qgc2ltaWxhciB0byB0aGUgcmVhbCBmYWtlIGN1cnNv ciBzbyB0aGF0IHRoZSBmcmluZ2UgYml0bWFwIGlzCisgIG9ubHkgZHJhd24gb25jZSBwZXIgd2lu ZG93LiAqLworICBpZiAodnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAgJiYgaHBvc19zdGFy dCArIGhwb3NfbGVuZ3RoID09IHJvdy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAmJiAhTklMUCAo QlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfaG9yaXpv bnRhbF9ydWxlcikpKQorICAgIHsKKyAgICAgIC8qIGZyaW5nZSBiaXRtYXBzIHVzZSBmYWNlX2lk IHRvIHNldCB0aGUgZm9yZWdyb3VuZCBjb2xvci4gIFRoZSBvdmVybGF5LWFycm93CisgICAgICBp cyBwcmVzZW50bHkgdGhlIG9ubHkgc2l0dWF0aW9uIHdoZXJlIHRoZSBgZXNzZW50aWFscy5hY3Rp dmVfcGAgYW5kIGBtaW5pbWFsX3BgIGFyZQorICAgICAgdXNlZCB0byBkZXRlcm1pbmUgdGhlIGFw cGxpY2FibGUgZmFjZV9pZC4gKi8KKyAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnID0gey5yZWQg PSAtMS4wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gLTEuMCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0gLTEuMH07CisgICAgICAvKiBXZSB1 c2UgdGhlIGZpcnN0IGdseXBoIGluIHRoZSByb3csIHdpdGggYW4gWCBhbmQgSFBPUyBvZiB6ZXJv LiAqLworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgcm93LT5nbHlwaHNbVEVYVF9B UkVBXSwgMCwgLTEsIHctPmN1cnNvci55LCAtMSwKKyAgICAgICAgICAgICAgICAgMCwgdy0+Y3Vy c29yLnZwb3MsIC0xLCAtMSwgTUNfTEVGVF9GUklOR0VfQklUTUFQLCAt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C1mYWtlLWN1cnNvcicsIG9yIHRoZQorICAgICAgdmFsdWUgaXMg YG5vYCBpbiB0aGUgZm9ybSBvZiBhIHN5bWJvbCBvciBzdHJpbmcsIHRoZW4gdGhlIGRlZmF1bHQg d2UgdXNlCisgICAgICBhbiBNQ19CQVIgYW5kIGFuIE1DX0hCQVIgLS0gYm90aCBoYXZpbmcgYSBj dXJzb3Jfd2lkdGggb2YgMS4gKi8KKyAgICAgIG1jX2dldF9jdXJzb3JfZ2VvbWV0cnkgKHcsIG1h dHJpeCwgcm93LCB3LT5jdXJzb3IueCwgJm9wb2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vy c29yLnZwb3MsICZvcG9pbnRfaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1DX0JB UiwgMSwgJm9wb2ludF93ZCk7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBjdXJz b3JfZ2x5cGgsIHctPmN1cnNvci54LCBvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAg ICAgICAgICBvcG9pbnRfZnksIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgb3BvaW50 X3dkLCBvcG9pbnRfaCwKKyAgICAgICAgICAgICAgICAgTUNfQkFSLCAxLCByb3dfcG9zaXRpb24s IGN1cnNvcl9mZywgY3Vyc29yX2JnLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLAorICAgICAgICAgICAg ICAgICBNQ19HTFlQSExFU1MsIGRyYXdfcCwgZnJvbV93aGVyZSwgTklMUCAoQlZBUiAoYiwgbWNf Y29uZikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IENIX0NBQ0hFCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IE1DX0NBQ0hFLCBDVVJTT1JfSU5ESUNBVE9SKTsKKyAgICAgIG1jX2dldF9jdXJz b3JfZ2VvbWV0cnkgKHcsIG1hdHJpeCwgcm93LCB3LT5jdXJzb3IueCwgJm9wb2ludF9meCwgdy0+ Y3Vyc29yLnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmb3BvaW50X2Z5LCB3LT5j dXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MsICZvcG9pbnRfaCwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIE1DX0hCQVIsIDEsICZvcG9pbnRfd2QpOworICAgICAgbWNfaGVscGVyICh3 LCBtYXRyaXgsIHJvdywgY3Vyc29yX2dseXBoLCB3LT5jdXJzb3IueCwgb3BvaW50X2Z4LCB3LT5j dXJzb3IueSwKKyAgICAgICAgICAgICAgICAgb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+ Y3Vyc29yLnZwb3MsIG9wb2ludF93ZCwgb3BvaW50X2gsCisgICAgICAgICAgICAgICAgIE1DX0hC QVIsIDEsIHJvd19wb3NpdGlvbiwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsIGVzc2VudGlhbHMuYWN0 aXZlX3AsCisgICAgICAgICAgICAgICAgIE1DX0dMWVBILCBkcmF3X3AsIGZyb21fd2hlcmUsIE5J TFAgKEJWQVIgKGIsIG1jX2NvbmYpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IENIX0NBQ0hFCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogTUNfQ0FDSEUsIENVUlNPUl9JTkRJQ0FUT1IpOworICAgIH0KKyAg ZWxzZSBpZiAoIWN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgg IT0gTlVMTAorICAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zCisgICAgICAgICAg ICYmIHctPmN1cnNvci5ocG9zID49IGhwb3Nfc3RhcnQKKyAgICAgICAgICAgJiYgdy0+Y3Vyc29y Lmhwb3MgPCBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGgKKyAgICAgICAgICAgJiYgY3Vyc29yX2ds eXBoLT50eXBlICE9IFNUUkVUQ0hfR0xZUEgpCisgICAgeworICAgICAgbWNfZ2V0X2N1cnNvcl9n ZW9tZXRyeSAodywgbWF0cml4LCByb3csIHctPmN1cnNvci54LCAmb3BvaW50X2Z4LCB3LT5jdXJz b3IueSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZvcG9pbnRfZnksIHctPmN1cnNv ci5ocG9zLCB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgJm9wb2ludF93ZCk7CisgICAgICBt Y19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1cnNvci54LCBvcG9p bnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICBvcG9pbnRfZnksIHctPmN1cnNv ci5ocG9zLCB3LT5jdXJzb3IudnBvcywgb3BvaW50X3dkLCBvcG9pbnRfaCwKKyAgICAgICAgICAg ICAgICAgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcm93X3Bvc2l0aW9uLCBjdXJzb3JfZmcs IGN1cnNvcl9iZywKKyAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZ UEgsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgTklMUCAoQlZBUiAoYiwg bWNfY29uZikpCisgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAgICAgICAgICAgICAg OiBNQ19DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgfQorICBlbHNlIGlmICghY3Vyc29y X2F0X2ZyaW5nZV9wCisgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaCAhPSBOVUxMCisgICAgICAg ICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhw b3MgPj0gaHBvc19zdGFydAorICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBvcyA8IGhwb3Nfc3Rh cnQgKyBocG9zX2xlbmd0aAorICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPnR5cGUgPT0gU1RS RVRDSF9HTFlQSCkKKyAgICB7CisgICAgICAvKiBJZiBhIHVzZXIgaGFzIHNldCBgeC1zdHJldGNo LWN1cnNvcicgdG8gYSBub24tbmlsIHZhbHVlLCBoZS9zaGUgY2hvc2UgdG8KKyAgICAgIGhhdmUg YSBjdXJzb3IgdGhhdCBzcGFucyB0aGUgZW50aXJlIGxlbmd0aCBvZiB0aGUgU1RSRVRDSF9HTFlQ SC4gKi8KKyAgICAgIGlmICgheF9zdHJldGNoX2N1cnNvcl9wKQorICAgICAgICB7CisgICAgICAg ICAgLyogVGhlIE1DX0hCQVIgc2hhbGwgaGF2ZSBhIGBjdXJzb3Jfd2lkdGhgIG9mIDEuICovCisg ICAgICAgICAgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeSAodywgbWF0cml4LCByb3csIHctPmN1cnNv ci54LCAmb3BvaW50X2Z4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPmN1 cnNvci55LCAmb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLCBNQ19IQkFSLCAxLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZvcG9pbnRfd2QpOworICAgICAgICAgIG1j X2hlbHBlciAodywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vyc29yLngsIG9wb2lu dF9meCwKKyAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci55LCBvcG9pbnRfZnksIHctPmN1 cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywKKyAgICAgICAgICAgICAgICAgICAgIG9wb2ludF93 ZCwgb3BvaW50X2gsIE1DX0hCQVIsIDEsIHJvd19wb3NpdGlvbiwgY3Vyc29yX2ZnLAorICAgICAg ICAgICAgICAgICAgICAgY3Vyc29yX2JnLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBNQ19HTFlQSCwg ZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICAgICAgTklMUCAoQlZBUiAoYiwg bWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICA/IENIX0NBQ0hFCisgICAgICAgICAgICAg ICAgICAgICA6IE1DX0NBQ0hFLCBDVVJTT1JfSU5ESUNBVE9SKTsKKyAgICAgICAgfQorICAgICAg bWNfZ2V0X2N1cnNvcl9nZW9tZXRyeSAodywgbWF0cml4LCByb3csIHctPmN1cnNvci54LCAmb3Bv aW50X2Z4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vyc29yLnksICZvcG9p bnRfZnksIHctPmN1cnNvci5ocG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+ Y3Vyc29yLnZwb3MsICZvcG9pbnRfaCwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBjdXJzb3Jfd2lkdGgsICZvcG9pbnRfd2QpOworICAgICAgbWNfaGVscGVyICh3 LCBtYXRyaXgsIHJvdywgY3Vyc29yX2dseXBoLCB3LT5jdXJzb3IueCwgb3BvaW50X2Z4LCB3LT5j dXJzb3IueSwKKyAgICAgICAgICAgICAgICAgb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+ Y3Vyc29yLnZwb3MsIG9wb2ludF93ZCwgb3BvaW50X2gsCisgICAgICAgICAgICAgICAgIGN1cnNv cl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcs CisgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dMWVBILCBkcmF3X3As IGZyb21fd2hlcmUsCisgICAgICAgICAgICAgICAgIE5JTFAgKEJWQVIgKGIsIG1jX2NvbmYpKQor ICAgICAgICAgICAgICAgICA/IENIX0NBQ0hFCisgICAgICAgICAgICAgICAgIDogTUNfQ0FDSEUs IENVUlNPUl9JTkRJQ0FUT1IpOworICAgIH0KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAg ICAgICAgICAgICAgICAgICAgICAgICBEUkFXIEFORCBSRUNPUkQgRkFLRSBDVVJTT1JTCisqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKyAgaWYgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAm JiBOSUxQIChCVkFSIChiLCBtY19pbmFjdGl2ZV93aW5kb3dzKSkKKyAgICAgICYmIE5JTFAgKEJW QVIgKGIsIGNoX2luYWN0aXZlX3dpbmRvd3MpKQorICAgICAgJiYgTklMUCAoQlZBUiAoYiwgZmNf aW5hY3RpdmVfd2luZG93cykpKQorICAgIHJldHVybjsKKyAgaWYgKGhwb3NfbGVuZ3RoID09IDEp CisgICAgeworICAgICAgaWYgKCFOSUxQIChCVkFSIChiLCBtY19jb25mKSkKKyAgICAgICAgICAm JiAoZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICB8fCAoIWVzc2VudGlhbHMuYWN0 aXZlX3AKKyAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBtY19pbmFjdGl2ZV93 aW5kb3dzKSkpKSkKKy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gICAgICAgICA6IE5V TEw7CisgICAgICAgICAgLy8gc3RydWN0IGdseXBoICpsYXN0X2dseXBoID0gcm93LT5nbHlwaHNb VEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMTsKKyAgICAgICAgICBib29sIHNr aXBfcCA9IChwcmV2aW91c19nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAg JiYgcHJldmlvdXNfZ2x5cGgtPmNoYXJwb3MgPT0gTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93 KSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiBzdGFydC0+Ynl0ZXBvcyAhPSBlc3Nl bnRpYWxzLnp2X2J5dGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgID8gdHJ1ZQorICAgICAg ICAgICAgICAgICAgICAgICAgLyogV2hlbiBhIGBidWZmZXItZGlzcGxheS10YWJsZScgZW50cnkg Y29udGFpbnMKKyAgICAgICAgICAgICAgICAgICAgICAgIGEgdmlzaWJsZSB0YWIgY2hhcmFjdGVy ICgiwrsiKSwgdGhlIHN1YnNlcXVlbnQKKyAgICAgICAgICAgICAgICAgICAgICAgIFNUUkVUQ0hf R0xZUEggd2lsbCBoYXZlIHRoZSBzYW1lIHN0YXJ0LT5jaGFycG9zCisgICAgICAgICAgICAgICAg ICAgICAgICBhcyB0aGUgYWZvcmVtZW50aW9uZWQgdmlzaWJsZSB0YWIgY2hhcmFjdGVyLiAqLwor ICAgICAgICAgICAgICAgICAgICAgICAgOiAocHJldmlvdXNfZ2x5cGggIT0gTlVMTAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgcHJldmlvdXNfZ2x5cGgtPmNoYXJwb3MgPT0gc3RhcnQt PmNoYXJwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgID8gdHJ1ZQorICAgICAgICAgICAg ICAgICAgICAgICAgOiBmYWxzZTsKKyAgICAgICAgICBpbnQgcG9zaW50ID0gKHJvd19wb3NpdGlv biA9PSBQT1NUX1pWKQorICAgICAgICAgICAgICAgICAgICAgICAgID8gLTEKKyAgICAgICAgICAg ICAgICAgICAgICAgOiAocm93X3Bvc2l0aW9uID09IEFUX1pWKQorICAgICAgICAgICAgICAgICAg ICAgICAgICA/IGVzc2VudGlhbHMuenYKKyAgICAgICAgICAgICAgICAgICAgICAgOiAoc3RhcnQt PmJ5dGVwb3MgIT0gZXNzZW50aWFscy56dl9ieXRlCisgICAgICAgICAgICAgICAgICAgICAgICAg ICYmIHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbVEVYVF9BUkVB XSAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9XX0VORF9DSEFSUE9T IChyb3cpIC0gMQorICAgICAgICAgICAgICAgICAgICAgICA6IChzdGFydC0+Ynl0ZXBvcyA9PSBl c3NlbnRpYWxzLnp2X2J5dGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgc3RhcnQgLSBy b3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICA/IGVzc2VudGlhbHMuenYKKyAgICAgICAgICAgICAgICAgICAg ICAgOiBzdGFydC0+Y2hhcnBvczsKKyAgICAgICAgICBMaXNwX09iamVjdCBzcGVjcyA9IG1jX2Fz c29jIChtYWtlX2ZpeG51bSAocG9zaW50KSwgQlZBUiAoYiwgbWNfY29uZikpOworICAgICAgICAg IGlmICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAgICAg ICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAgJiYgIU5JTFAgKHNw ZWNzKQorICAgICAgICAgICAgICAmJiByb3ctPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcp CisgICAgICAgICAgICAgICYmICFza2lwX3AKKyAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9u ICE9IFBPU1RfWlYpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIExpc3BfT2JqZWN0IGxp c3BfdHlwZSA9IG1jX250aCAoMSwgc3BlY3MpOworICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNv cl90eXBlIGN1cnNvcl90eXBlID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY19saXNwX3RvX2N1cnNvcl90eXBl IChYQ0FSIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiBtY19saXNwX3RvX2N1cnNvcl90eXBlIChsaXNwX3R5cGUpOworICAgICAg ICAgICAgICBjdXJzb3JfdHlwZSA9IChzdGFydC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0hPTExPV19CT1gKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IGN1cnNvcl90eXBlOworICAgICAgICAgICAgICBpbnQgY3Vyc29yX3dpZHRo ID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBYRklYTlVNIChYQ0FSIChYQ0RSIChsaXNwX3R5cGUpKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogLTE7CisgICAgICAgICAgICAgIExpc3BfT2JqZWN0IG1jX2ZvcmVncm91 bmQgPSBtY19udGggKDIsIHNwZWNzKTsKKyAgICAgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xf Zmc7CisgICAgICAgICAgICAgIGlmIChTVFJJTkdQIChtY19mb3JlZ3JvdW5kKSkKKyAgICAgICAg ICAgICAgICBtY194d19jb2xvcl92YWx1ZXMgKHcsIG1jX2ZvcmVncm91bmQsICZsc2xfZmcpOwor ICAgICAgICAgICAgICAgIGVsc2UgaWYgKFZFQ1RPUlAgKG1jX2ZvcmVncm91bmQpKQorICAgICAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBsc2xfZmcucmVkID0gWEZMT0FUX0RB VEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDApKTsKKyAgICAgICAgICAgICAgICAgICAgbHNsX2Zn LmdyZWVuID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDEpKTsKKyAgICAgICAg ICAgICAgICAgICAgbHNsX2ZnLmJsdWUgPSBYRkxPQVRfREFUQSAoQVJFRiAobWNfZm9yZWdyb3Vu ZCwgMikpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgZWxzZSBpZiAo TklMUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAgICAgIG1jX2NvbG9yX3BpY2tl ciAodywgc3RhcnQsIGVzc2VudGlhbHMsICZsc2xfZmcsIHBvc2ludCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgcm93X3Bvc2l0aW9uLCBNVUxUSVBM RV9DVVJTT1JTKTsKKyAgICAgICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKHJv dywgbWF0cml4KTsKKyAgICAgICAgICAgICAgaW50IHhfbGltaXQgPSB0ZXh0X2FyZWFfd2lkdGg7 CisgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIHN0YXJ0LCBURVhUX0FS RUEsIHgsIHhfbGltaXQsIHJvdy0+eSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydCAt IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sIHZwb3MsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAg ICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgcm93 X3Bvc2l0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgIGxzbF9mZywgTVVMVElQTEVfQ1VS U09SUywgZHJhd19wLCBmcm9tX3doZXJlLCBNQ19DQUNIRSk7CisgICAgICAgICAgICB9CisgICAg ICAgIH0KKyAgICAgIGlmICghTklMUCAoQlZBUiAoYiwgZmNfdmlzaWJsZSkpCisgICAgICAgICAg JiYgKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFj dGl2ZV9wCisgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgZmNfaW5hY3RpdmVf d2luZG93cykpKSkKKyAgICAgICAgICAvLyAmJiBlc3NlbnRpYWxzLmZjX3ggPD0gdGV4dF9hcmVh X3dpZHRoCisgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194IDwgdGV4dF9hcmVhX3dpZHRoCisg ICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID49IHctPm1jLmxudW1fcGl4ZWxfd2lkdGgpCisg ICAgICAgIHsKKyAgICAgICAgICBpbnQgeF9saW1pdCA9IHggKyBzdGFydC0+cGl4ZWxfd2lkdGg7 CisgICAgICAgICAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3AgPSAody0+Y3Vyc29yLnggPT0gZXNz ZW50aWFscy5mY194CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+ Y3Vyc29yLnkgPT0gcm93LT55CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgdy0+Y3Vyc29yLmhwb3MgPT0gc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnZwb3MgPT0gdnBv cyk7CisgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgbWNfY29sb3Jf cGlja2VyICh3LCBzdGFydCwgZXNzZW50aWFscywgJmxzbF9mZywgLTEsIE1DX0JBUiwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgRklMTF9DT0xVTU4pOworICAgICAg ICAgIGlmICh4IDwgdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgIC8vIHggKyBzdGFydC0+ cGl4ZWxfd2lkdGggPD0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICYmICgoaGVhZGVy X2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID4gMCkKKyAgICAgICAgICAgICAgICAgIHx8IGhlYWRl cl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAgICAmJiAoKHN0YXJ0ICE9IHJvdy0+Z2x5 cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEKKyAgICAgICAgICAgICAg ICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPj0geAorICAgICAgICAgICAgICAgICAgICYmIGVzc2Vu dGlhbHMuZmNfeCA8IHggKyBzdGFydC0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgICB8 fCAoc3RhcnQgPT0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFd IC0gMQorICAgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSB4KSkKKyAg ICAgICAgICAgICAgJiYgcm93LT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAgICAg ICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAgICAgbWNfZW5naW5lICh3 LCBtYXRyaXgsIHJvdywgc3RhcnQsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwgcm93LT55LAorICAg ICAgICAgICAgICAgICAgICAgICBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sIHZwb3Ms IE1DX0JBUiwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwgZXNzZW50 aWFscywgcm93X3Bvc2l0aW9uLCBsc2xfZmcsCisgICAgICAgICAgICAgICAgICAgICAgIEZJTExf Q09MVU1OLCBkcmF3X3AsIGZyb21fd2hlcmUsIEZDX0NBQ0hFKTsKKyAgICAgICAgfQorICAgICAg aWYgKCFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAmJiAhTklMUCAoQlZB UiAoYiwgY2hfaG9yaXpvbnRhbF9ydWxlcikpCisgICAgICAgICAgJiYgKGVzc2VudGlhbHMuYWN0 aXZlX3AKKyAgICAgICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAg ICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfaW5hY3RpdmVfd2luZG93cykpKSkKKyAgICAg ICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zKQorICAgICAgICB7CisgICAgICAgICAgaW50 IHhfbGltaXQgPSAoc3RhcnQgPT0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtU RVhUX0FSRUFdIC0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgID8gdGV4dF9hcmVhX3dpZHRo CisgICAgICAgICAgICAgICAgICAgICAgICA6IHggKyBzdGFydC0+cGl4ZWxfd2lkdGg7CisgICAg ICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgbWNfY29sb3JfcGlja2VyICh3 LCBzdGFydCwgZXNzZW50aWFscywgJmxzbF9mZywgLTEsIE1DX0hCQVIsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICByb3dfcG9zaXRpb24sIEhPUklaT05UQUxfUlVMRVIpOworICAgICAgICAg IC8qIFByZXNlcnZlIHN1cHBvcnQgZm9yIGRlZmF1bHQgYmVoYXZpb3Igc3VjaCB0aGF0IGEgdXNl ciBtYXkKKyAgICAgICAgICBzcGVjaWZ5IHRoZSBoZWlnaHQgb2YgYW4gTUNfSEJBUiwgd2hpY2gg YmVnaW5zIGl0cyBqb3VybmV5CisgICAgICAgICAgYXMgdGhlIGBjdXJzb3Jfd2lkdGgnLiAgYG1j X2dldF9jdXJzb3JfZ2VvbWV0cnknIHJlYWRqdXN0cy4gKi8KKyAgICAgICAgICBtY19lbmdpbmUg KHcsIG1hdHJpeCwgcm93LCBzdGFydCwgVEVYVF9BUkVBLCB4LCB4X2xpbWl0LCByb3ctPnksCisg ICAgICAgICAgICAgICAgICAgICBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sIHZwb3Ms IE1DX0hCQVIsIDEsCisgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBlc3NlbnRp YWxzLCByb3dfcG9zaXRpb24sIGxzbF9mZywKKyAgICAgICAgICAgICAgICAgICAgIEhPUklaT05U QUxfUlVMRVIsIGRyYXdfcCwgZnJvbV93aGVyZSwgQ0hfQ0FDSEUpOworICAgICAgICB9CisgICAg ICBpZiAoIU5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAgICAgICYmICFOSUxQIChC VkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgJiYgKGVzc2VudGlhbHMuYWN0 aXZlX3AKKyAgICAgICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAg ICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfaW5hY3RpdmVfd2luZG93cykpKSkKKyAgICAg ICAgICAmJiAhZmlsbF9jb2x1bW5fdHJ1bXBzX3ApCisgICAgICAgIHsKKyAgICAgICAgICBjdXJz b3JfdHlwZSA9IChzdGFydC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICAgICAgICAg ICAgICAgID8gTUNfSE9MTE9XX0JPWAorICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19CQVI7 CisgICAgICAgICAgaW50IHhfbGltaXQgPSB0ZXh0X2FyZWFfd2lkdGg7CisgICAgICAgICAgYm9v bCByZWFsX2Zha2VfY3Vyc29yX3AgPSAody0+Y3Vyc29yLnkgPT0gcm93LT55CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnZwb3MgPT0gdnBvcyk7Cisg ICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgbWNfY29sb3JfcGlja2Vy ICh3LCBzdGFydCwgZXNzZW50aWFscywgJmxzbF9mZywgLTEsIGN1cnNvcl90eXBlLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgcm93X3Bvc2l0aW9uLCBWRVJUSUNBTF9SVUxFUik7CisgICAg ICAgICAgaWYgKCgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID4gMCkKKyAgICAgICAg ICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAgICAmJiAoKHN0 YXJ0ICE9IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEK KyAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA+PSB4CisgICAgICAgICAgICAgICAg ICAgJiYgdy0+Y3Vyc29yLnggPCB4ICsgc3RhcnQtPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAg ICAgICAgfHwgKHN0YXJ0ID09IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVzZWRbVEVY VF9BUkVBXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA+PSB4KSkK KyAgICAgICAgICAgICAgJiYgcm93LT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KQorICAg ICAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAgICAgbWNfZW5naW5l ICh3LCBtYXRyaXgsIHJvdywgc3RhcnQsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwgcm93LT55LAor ICAgICAgICAgICAgICAgICAgICAgICBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sIHZw b3MsIGN1cnNvcl90eXBlLCAxLAorICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4 LCBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGxzbF9mZywKKyAgICAgICAgICAgICAgICAgICAg ICAgVkVSVElDQUxfUlVMRVIsIGRyYXdfcCwgZnJvbV93aGVyZSwgQ0hfQ0FDSEUpOworICAgICAg ICB9CisgICAgfQorICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgaW50IHJlbGF0aXZlX3ggPSAw OworICAgICAgICBmb3IgKGludCBhcmVhID0gTEVGVF9NQVJHSU5fQVJFQTsgYXJlYSA8IExBU1Rf QVJFQTsgKythcmVhKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5 cGggPSByb3ctPmdseXBoc1thcmVhXTsKKyAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGhf ZW5kID0gZ2x5cGggKyByb3ctPnVzZWRbYXJlYV07CisgICAgICAgICAgICAvKiBHbHlwaCBmb3Ig YSBsaW5lIGVuZCBpbiB0ZXh0LiAqLworICAgICAgICAgICAgaWYgKGFyZWEgPT0gVEVYVF9BUkVB ICYmIGdseXBoID09IGdseXBoX2VuZCAmJiBnbHlwaC0+Y2hhcnBvcyA+IDApCisgICAgICAgICAg ICAgICsrZ2x5cGhfZW5kOworICAgICAgICAgICAgZm9yICg7IGdseXBoIDwgZ2x5cGhfZW5kOyAr K2dseXBoKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKHZwb3MgIT0gdy0+ Y3Vyc29yLnZwb3MKKyAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGggIT0gZ2x5cGhfZW5kIC0g MQorICAgICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPCByZWxhdGl2ZV94Cisg ICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54IDwgcmVsYXRpdmVfeAorICAgICAgICAg ICAgICAgICAgICAmJiBOSUxQIChCVkFSIChiLCBtY19jb25mKSkpCisgICAgICAgICAgICAgICAg ICBicmVhazsKKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKGIsIG1jX2NvbmYpKQor ICAgICAgICAgICAgICAgICAgICAmJiAoZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAg ICAgICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIG1jX2luYWN0aXZlX3dpbmRvd3MpKSkpKQorICAg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvKiBUaGUgc3BhY2UgYXBwZW5k ZWQgdG8gYSByb3cgZW5kaW5nIHdpdGggYSBuZXcgbGluZSBkb2VzCisgICAgICAgICAgICAgICAg ICAgIG5vdCBoYXZlIGEgYGdseXBoLT5jaGFycG9zYCAoLTEsIDApIHRoYXQgd2UgY2FuIHVzZSBm b3IgdGhpcworICAgICAgICAgICAgICAgICAgICBwYXJ0aWN1bGFyIGFwcGxpY2F0aW9uLiAgV2hl biBhIGBidWZmZXItZGlzcGxheS10YWJsZScgZW50cnkKKyAgICAgICAgICAgICAgICAgICAgYXNz aWducyBhIHZpc2libGUgZ2x5cGggdG8gYSBuZXcgbGluZSwgdGhlcmUgaXMgbm8gcHJvYmxlbQor ICAgICAgICAgICAgICAgICAgICBiZWNhdXNlIHRoYXQgZ2x5cGggaGFzIGEgYGdseXBoLT5jaGFy cG9zJyB0aGF0IHdlIGNhbiB1c2UuCisgICAgICAgICAgICAgICAgICAgIFdoZW4gbm8gdmlzaWJs ZSBFT0wgZ2x5cGggZXhpc3RzLCB3ZSB1c2UgdGhlIGZvbGxvd2luZyB0ZXN0OgorICAgICAgICAg ICAgICAgICAgICB0aGUgYXBwZW5kZWQgc3BhY2UgaGFzIGEgcG9zaXRpb24gdGhhdCBpcyBvbmUg bGVzcyB0aGFuIHRoZQorICAgICAgICAgICAgICAgICAgICBlbmQgb2YgdGhlIG1hdHJpeCByb3cu ICovCisgICAgICAgICAgICAgICAgICAgIGludCBocG9zID0gZ2x5cGggLSByb3ctPmdseXBoc1tU RVhUX0FSRUFdOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKnByZXZpb3VzX2ds eXBoID0gKDAgPD0gaHBvcyAtIDEgJiYgaHBvcyAtIDEgPCByb3ctPnVzZWRbVEVYVF9BUkVBXSkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gcm93 LT5nbHlwaHNbVEVYVF9BUkVBXSArIGhwb3MgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgICAgICAgICAgICAgICAgICAgIC8v IHN0cnVjdCBnbHlwaCAqbGFzdF9nbHlwaCA9IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ct PnVzZWRbVEVYVF9BUkVBXSAtIDE7CisgICAgICAgICAgICAgICAgICAgIGJvb2wgc2tpcF9wID0g KHByZXZpb3VzX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgcHJldmlvdXNfZ2x5cGgtPmNoYXJwb3MgPT0gTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAo cm93KSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGgtPmJ5 dGVwb3MgIT0gZXNzZW50aWFscy56dl9ieXRlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyB0cnVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogV2hl biBhIGBidWZmZXItZGlzcGxheS10YWJsZScgZW50cnkgY29udGFpbnMKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBhIHZpc2libGUgdGFiIGNoYXJhY3RlciAoIsK7IiksIHRoZSBz dWJzZXF1ZW50CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU1RSRVRDSF9HTFlQ SCB3aWxsIGhhdmUgdGhlIHNhbWUgZ2x5cGgtPmNoYXJwb3MKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBhcyB0aGUgYWZvcmVtZW50aW9uZWQgdmlzaWJsZSB0YWIgY2hhcmFjdGVy LiAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKHByZXZpb3VzX2dseXBo ICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBwcmV2aW91 c19nbHlwaC0+Y2hhcnBvcyA9PSBnbHlwaC0+Y2hhcnBvcykKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gdHJ1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIGludCBwb3NpbnQgPSAocm93X3Bvc2l0aW9u ID09IFBPU1RfWlYpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gLTEKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKHJvd19wb3NpdGlvbiA9PSBBVF9aVikK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZXNzZW50aWFscy56dgorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGgtPmJ5dGVwb3MgIT0gZXNzZW50 aWFscy56dl9ieXRlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBnbHlw aCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1BVFJJWF9ST1dfRU5EX0NIQVJQ T1MgKHJvdykgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaC0+ Ynl0ZXBvcyA9PSBlc3NlbnRpYWxzLnp2X2J5dGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRb VEVYVF9BUkVBXSAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZXNz ZW50aWFscy56dgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBnbHlwaC0+Y2hh cnBvczsKKyAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3Qgc3BlY3MgPSBtY19hc3NvYyAo bWFrZV9maXhudW0gKHBvc2ludCksIEJWQVIgKGIsIG1jX2NvbmYpKTsKKyAgICAgICAgICAgICAg ICAgICAgaWYgKCgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID4gMCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAg ICAgICAgICAgICAgICYmICFOSUxQIChzcGVjcykKKyAgICAgICAgICAgICAgICAgICAgICAgICYm IHJvdy0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAgICAgICAgICAgICAg ICAgICYmICFza2lwX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiAh PSBQT1NUX1pWKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAg ICAgIExpc3BfT2JqZWN0IGxpc3BfdHlwZSA9IG1jX250aCAoMSwgc3BlY3MpOworICAgICAgICAg ICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSA9IChDT05TUCAo bGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKFhDQVIgKGxpc3BfdHlwZSkp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBtY19saXNwX3RvX2N1cnNvcl90eXBlIChsaXNwX3R5cGUpOworICAgICAgICAgICAgICAg ICAgICAgICAgY3Vyc29yX3R5cGUgPSAoZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEgpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfSE9MTE9XX0JPWAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGN1cnNvcl90eXBlOworICAgICAgICAg ICAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aCA9IChDT05TUCAobGlzcF90eXBlKSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFhGSVhOVU0gKFhDQVIg KFhDRFIgKGxpc3BfdHlwZSkpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogLTE7CisgICAgICAgICAgICAgICAgICAgICAgICBMaXNwX09iamVjdCBtY19mb3Jl Z3JvdW5kID0gbWNfbnRoICgyLCBzcGVjcyk7CisgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1 Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChTVFJJTkdQICht Y19mb3JlZ3JvdW5kKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgbWNfeHdfY29sb3JfdmFs dWVzICh3LCBtY19mb3JlZ3JvdW5kLCAmbHNsX2ZnKTsKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgZWxzZSBpZiAoVkVDVE9SUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNsX2ZnLnJlZCA9IFhG TE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3JvdW5kLCAwKSk7CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBsc2xfZmcuZ3JlZW4gPSBYRkxPQVRfREFUQSAoQVJFRiAobWNfZm9yZWdyb3Vu ZCwgMSkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNsX2ZnLmJsdWUgPSBYRkxP QVRfREFUQSAoQVJFRiAobWNfZm9yZWdyb3VuZCwgMikpOworICAgICAgICAgICAgICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChOSUxQIChtY19m b3JlZ3JvdW5kKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2NvbG9yX3BpY2tl ciAodywgZ2x5cGgsIGVzc2VudGlhbHMsICZsc2xfZmcsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2ludCwgY3Vyc29yX3R5cGUsIHJvd19wb3NpdGlv biwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTVVMVElQ TEVfQ1VSU09SUyk7CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgdnBvcyA9IE1BVFJJWF9S T1dfVlBPUyAocm93LCBtYXRyaXgpOworICAgICAgICAgICAgICAgICAgICAgICAgaW50IHhfbGlt aXQgPSB0ZXh0X2FyZWFfd2lkdGg7CisgICAgICAgICAgICAgICAgICAgICAgICBtY19lbmdpbmUg KHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgYXJlYSwgcmVsYXRpdmVfeCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgeF9saW1pdCwgcm93LT55LCBnbHlwaCAtIHJvdy0+Z2x5cGhz W1RFWFRfQVJFQV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZwb3MsIGN1 cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgbHNsX2ZnLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JTLCBkcmF3X3As IGZyb21fd2hlcmUsIE1DX0NBQ0hFKTsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKCFOSUxQIChCVkFSIChiLCBmY192aXNp YmxlKSkKKyAgICAgICAgICAgICAgICAgICAgJiYgKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAg ICAgICAgICAgICAgICAgICAgIHx8ICghZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBmY19pbmFjdGl2ZV93aW5kb3dzKSkp KQorICAgICAgICAgICAgICAgICAgICAvLyAmJiBlc3NlbnRpYWxzLmZjX3ggPD0gdGV4dF9hcmVh X3dpZHRoCisgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA8IHRleHRfYXJl YV93aWR0aAorICAgICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPj0gdy0+bWMu bG51bV9waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAg ICAgaW50IHhfbGltaXQgPSB0ZXh0X2FyZWFfd2lkdGg7CisgICAgICAgICAgICAgICAgICAgIGJv b2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKHctPmN1cnNvci54ID09IGVzc2VudGlhbHMuZmNfeAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJz b3IueSA9PSByb3ctPnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFd CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1 cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IGdseXBo IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IG1j X1JHQiBsc2xfZmc7CisgICAgICAgICAgICAgICAgICAgIG1jX2NvbG9yX3BpY2tlciAodywgZ2x5 cGgsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0xLCBNQ19CQVIsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgcm93X3Bvc2l0aW9uLCBGSUxMX0NPTFVNTik7CisgICAgICAgICAg ICAgICAgICAgIGlmIChocG9zID49IGhwb3Nfc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgICAg ICYmIGhwb3MgPCBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGgKKyAgICAgICAgICAgICAgICAgICAg ICAgIC8vICYmIHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGggPD0gdGV4dF9hcmVhX3dp ZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAmJiByZWxhdGl2ZV94IDwgdGV4dF9hcmVhX3dp ZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAg JiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgaGVhZGVyX2xpbmVf Zm9ybWF0ID09IDApCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoKGdseXBoICE9IGdseXBo X2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194 ID49IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFs cy5mY194IDwgcmVsYXRpdmVfeCArIGdseXBoLT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICB8fCAoZ2x5cGggPT0gZ2x5cGhfZW5kIC0gMQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPj0gcmVsYXRpdmVfeCkpCisgICAg ICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnkgPD0gd2luZG93X3RleHRfYm90dG9tX3kgKHcp CisgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAg ICAgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIGdseXBoLCBhcmVhLCBy ZWxhdGl2ZV94LCB4X2xpbWl0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93 LT55LCBocG9zLCB2cG9zLCBNQ19CQVIsIDEsIGN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGxzbF9mZywgRklM TF9DT0xVTU4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3X3AsIGZyb21f d2hlcmUsIEZDX0NBQ0hFKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBp ZiAoIU5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAmJiAh TklMUCAoQlZBUiAoYiwgY2hfaG9yaXpvbnRhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAg ICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICB8fCAoIWVz c2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAo QlZBUiAoYiwgY2hfaW5hY3RpdmVfd2luZG93cykpKSkKKyAgICAgICAgICAgICAgICAgICAgJiYg dnBvcyA9PSB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICAgICAgaW50IHhfbGltaXQgPSB0ZXh0X2FyZWFfd2lkdGg7CisgICAgICAgICAgICAgICAg ICAgIGludCBocG9zID0gZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAg ICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICAgICAgICAgICAgbWNf Y29sb3JfcGlja2VyICh3LCBnbHlwaCwgZXNzZW50aWFscywgJmxzbF9mZywgLTEsIE1DX0hCQVIs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93X3Bvc2l0aW9uLCBIT1JJ Wk9OVEFMX1JVTEVSKTsKKyAgICAgICAgICAgICAgICAgICAgLyogUHJlc2VydmUgc3VwcG9ydCBm b3IgZGVmYXVsdCBiZWhhdmlvciBzdWNoIHRoYXQgYSB1c2VyIG1heQorICAgICAgICAgICAgICAg ICAgICBzcGVjaWZ5IHRoZSBoZWlnaHQgb2YgYW4gTUNfSEJBUiwgd2hpY2ggYmVnaW5zIGl0cyBq b3VybmV5CisgICAgICAgICAgICAgICAgICAgIGFzIHRoZSBgY3Vyc29yX3dpZHRoJy4gIGBtY19n ZXRfY3Vyc29yX2dlb21ldHJ5JyByZWFkanVzdHMuICovCisgICAgICAgICAgICAgICAgICAgIGlm IChocG9zID49IGhwb3Nfc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIGhwb3MgPCBo cG9zX3N0YXJ0ICsgaHBvc19sZW5ndGgpCisgICAgICAgICAgICAgICAgICAgICAgbWNfZW5naW5l ICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIGFyZWEsIHJlbGF0aXZlX3gsIHhfbGltaXQsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb3ctPnksIGhwb3MsIHZwb3MsIE1DX0hCQVIs IDEsIGN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlc3Nl bnRpYWxzLCByb3dfcG9zaXRpb24sIGxzbF9mZywgSE9SSVpPTlRBTF9SVUxFUiwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdfcCwgZnJvbV93aGVyZSwgQ0hfQ0FDSEUpOwor ICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICghTklMUCAoQlZBUiAoYiwg Y3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92 ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2 ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICB8fCAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfaW5hY3RpdmVf d2luZG93cykpKSkKKyAgICAgICAgICAgICAgICAgICAgJiYgIWZpbGxfY29sdW1uX3RydW1wc19w KQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9 IChnbHlwaC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA/IE1DX0hPTExPV19CT1gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IE1DX0JBUjsKKyAgICAgICAgICAgICAgICAgICAgaW50IHhfbGltaXQgPSB0ZXh0X2FyZWFf d2lkdGg7CisgICAgICAgICAgICAgICAgICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKHct PmN1cnNvci55ID09IHJvdy0+eQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5jdXJzb3IudnBvcyA9PSB2cG9zKTsKKyAgICAgICAgICAgICAgICAg ICAgaW50IGhwb3MgPSBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICAgICAg ICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAgICAgICAgICAgICAgICAgICBtY19j b2xvcl9waWNrZXIgKHcsIGdseXBoLCBlc3NlbnRpYWxzLCAmbHNsX2ZnLCAtMSwgY3Vyc29yX3R5 cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93X3Bvc2l0aW9uLCBW RVJUSUNBTF9SVUxFUik7CisgICAgICAgICAgICAgICAgICAgIGlmIChocG9zID49IGhwb3Nfc3Rh cnQKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIGhwb3MgPCBocG9zX3N0YXJ0ICsgaHBvc19s ZW5ndGgKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICgoaGVhZGVyX2xpbmVfZm9ybWF0ID4g MCAmJiB2cG9zID4gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBoZWFkZXJfbGlu ZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICgoZ2x5cGggIT0gZ2x5 cGhfZW5kIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA+ PSByZWxhdGl2ZV94CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54 IDwgcmVsYXRpdmVfeCArIGdseXBoLT5waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICB8fCAoZ2x5cGggPT0gZ2x5cGhfZW5kIC0gMQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA+PSByZWxhdGl2ZV94KSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICYmIHJvdy0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAg ICAgICAgICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAgICAgICAgICAgICAg ICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIGFyZWEsIHJlbGF0aXZlX3gs IHhfbGltaXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb3ctPnksIGhwb3Ms IHZwb3MsIGN1cnNvcl90eXBlLCAxLCBjdXJzb3JfbWF0cml4LAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBsc2xfZmcsIFZFUlRJQ0FM X1JVTEVSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhd19wLCBmcm9tX3do ZXJlLCBDSF9DQUNIRSk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmVs YXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgIH0KKyAgICAgICAg ICB9CisgICAgICB9CisgIC8vICBjbG9ja190IGNsb2NrX2VuZCA9IGNsb2NrKCk7CisgIC8vICBk b3VibGUgY3B1X3RpbWVfdXNlZCA9ICgoZG91YmxlKSAoY2xvY2tfZW5kIC0gY2xvY2tfc3RhcnQp KSAvIENMT0NLU19QRVJfU0VDOworICAvLyAgZnByaW50ZiAoc3RkZXJyLCAibWNfZHJhd19yb3cg KCVzKTogIFRJTUUgKCVmKVxuIiwgbWNfd2luZG93ICh3KSwgY3B1X3RpbWVfdXNlZCk7Cit9CisK K2Jvb2wKK21jX3JlZHJhd19yb3cgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9tYXRy aXggKm1hdHJpeCwgc3RydWN0IGdseXBoX3JvdyAqcm93LAorICAgICAgICAgICAgICAgZW51bSBn bHlwaF9yb3dfYXJlYSBhcmVhLCBpbnQgc3RhcnRfeCwgaW50IHN0YXJ0X2hwb3MsIGludCBlbmRf aHBvcywKKyAgICAgICAgICAgICAgIGJvb2wgY2xlYXJfZW9sX3AsIGVudW0gZHJhd19nbHlwaHNf ZmFjZSBobCwKKyAgICAgICAgICAgICAgIGVudW0gbWNfcmVkcmF3X3Jvd190eXBlIGZyb21fd2hl cmUpCit7CisgIGJvb2wgZ29fcCA9ICgody0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtNQ19DQUNI RV0gPiAwCisgICAgICAgICAgICAgICAgfHwgdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtDSF9D QUNIRV0gPiAwCisgICAgICAgICAgICAgICAgfHwgdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtG Q19DQUNIRV0gPiAwKQorICAgICAgICAgICAgICAgJiYgYXJlYSA9PSBURVhUX0FSRUEKKyAgICAg ICAgICAgICAgICYmIHJvdy0+dXNlZFthcmVhXSk7CisgIGlmICghZ29fcCkKKyAgICByZXR1cm4g ZmFsc2U7CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAoV0lORE9XX0ZSQU1FICh3KSk7Cisg IGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7CisgIGlmIChtY19zdGRl cnJfcCkKKyAgICBmcHJpbnRmIChzdGRlcnIsICJtY19yZWRyYXdfcm93ICglZCk6ICAlc1xuXAor ICBzdGFydF94ICglZCkgfCBzdGFydF9ocG9zICgl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ICAgICAgeworICAgICAgICAgIGludCB4 ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS54OworICAg ICAgICAgIGludCBmeCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF0uZng7CisgICAgICAgICAgaW50IHkgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhdLnk7CisgICAgICAgICAgaW50IGZ5ID0gdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5meTsKKyAgICAgICAgICBpbnQgaHBvcyA9 IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uaHBvczsKKyAg ICAgICAgICBpbnQgdnBvcyA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF0udnBvczsKKyAgICAgICAgICBpbnQgd2QgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLndkOworICAgICAgICAgIGludCBoID0gdy0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5oOworICAgICAgICAgIGVudW0g bWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhdLmN1cnNvcl90eXBlOworICAgICAgICAgIGludCBjdXJzb3Jfd2lk dGggPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmN1cnNv cl93aWR0aDsKKyAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZyA9IHsucmVkID0gdy0+bWNf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5mZy5yZWQsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5mZy5ncmVlbiwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAuYmx1ZSA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF0uZmcuYmx1ZX07CisgICAgICAgICAgLy8gIHN0cnVjdCBtY19SR0IgbHNsX2Jn ID0gey5yZWQgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhd LmJnLnJlZCwKKyAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5iZy5ncmVlbiwK KyAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLmJsdWV9OworICAgICAgICAg IGJvb2wgYWN0aXZlX3AgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLmFjdGl2ZV9wOworICAgICAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9 IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGhfZmxh dm9yOworICAgICAgICAgIGJvb2wgZW5hYmxlZF9wID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFibGVkX3A7CisgICAgICAgICAgaWYgKHZwb3MgPT0g dm50aAorICAgICAgICAgICAgICAmJiAoKGhwb3MgPj0gc3RhcnRfaHBvcworICAgICAgICAgICAg ICAgICAgICYmIGhwb3MgPCBlbmRfaHBvcykKKyAgICAgICAgICAgICAgICAgIC8qIEEgZmxvYXRp bmcgY3Vyc29yIGJleW9uZCB0aGUgZW5kIG9mIHRoZSBnbHlwaCByb3cuICovCisgICAgICAgICAg ICAgICAgICB8fCAoaHBvcyArIDEgPT0gc3RhcnRfaHBvcworICAgICAgICAgICAgICAgICAgICAg ICYmIGhwb3MgKyAxID09IGVuZF9ocG9zKSkKKyAgICAgICAgICAgICAgJiYgZW5hYmxlZF9wKQor ICAgICAgICAgICAgeworICAgICAgICAgICAgICBib29sIHJlbW92ZV9wID0gZmFsc2U7CisgICAg ICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHks IGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGxzbF9mZywgYWN0aXZlX3AsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaF9mbGF2b3IsIHJlbW92ZV9wKTsKKyAg ICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgcmV0dXJuIHRydWU7CisgIC8vICBjbG9j a19lbmQgPSBjbG9jaygpOworICAvLyAgZG91YmxlIHRpbWVfY3Vyc29ycyA9ICgoZG91YmxlKSAo Y2xvY2tfZW5kIC0gY2xvY2tfc3RhcnQpKSAvIENMT0NLU19QRVJfU0VDOworICAvLyAgZnByaW50 ZiAoc3RkZXJyLCAibWNfcmVkcmF3X3JvdyAoJWQpOiAgaHBvcyAoJWQvJWQpIHwgZ2x5cGhzICgl ZikgfCBjdXJzb3JzICglZilcbiIsCisgIC8vICAgICAgICAgICAgICAgICAgIHZwb3MsIHN0YXJ0 X2h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nRoXS5mZy5ncmVlbiwKKyAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgLmJs dWUgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmZnLmJs dWV9OworICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2JnID0gey5yZWQgPSB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLnJlZCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5j YWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLmdyZWVuLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIC5ibHVlID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXS5iZy5ibHVlfTsKKyAgICAgICAgICBib29sIGFjdGl2ZV9wID0gdy0+bWNfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5hY3RpdmVfcDsKKyAgICAgICAgICBl bnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhdLmdseXBoX2ZsYXZvcjsKKyAgICAgICAgICBib29sIGVuYWJsZWRf cCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZW5hYmxl ZF9wOworICAgICAgICAgIC8qIGBtYXRyaXhfcm93JyBpbiBgZGlzcG5ldy5jYCBjb250YWlucyB0 aGUgZm9sbG93aW5nIHRlc3RzLAorICAgICAgICAgIGVhc3NlcnQgKG1hdHJpeCAmJiBtYXRyaXgt PnJvd3MpOworICAgICAgICAgIGVhc3NlcnQgKHJvdyA+PSAwICYmIHJvdyA8IG1hdHJpeC0+bnJv d3MpOyAqLworICAgICAgICAgIGJvb2wgYmFyZl9jcmFzaF9vbmUgPSAobWF0cml4ICYmIG1hdHJp eC0+cm93cykgPyBmYWxzZSA6IHRydWU7CisgICAgICAgICAgaWYgKGJhcmZfY3Jhc2hfb25lKQor ICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgYm9vbCBiYXJmX2NyYXNoX3R3byA9ICh2 cG9zID49IDAgJiYgdnBvcyA8IG1hdHJpeC0+bnJvd3MpID8gZmFsc2UgOiB0cnVlOworICAgICAg ICAgIGlmIChiYXJmX2NyYXNoX3R3bykKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAg IGlmICh2cG9zID09IHZudGgKKyAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yID09IE1DX0dM WVBICisgICAgICAgICAgICAgICYmIGVuYWJsZWRfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgbWNfZXJhc2VfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgdy0+bWNfbWF0cml4LCB4LCB5 LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZv ciwgY3Vyc29yX3R5cGUsIHdkKTsKKyAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFibGVkX3AgPSBmYWxzZTsKKyAgICAgICAgICAg ICAgLS13LT5tY19tYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5cGVdOworICAgICAgICAgICAg fQorICAgICAgICAgICAgZWxzZSBpZiAodnBvcyA9PSB2bnRoCisgICAgICAgICAgICAgICAgICAg ICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBib29sIHJl bW92ZV9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywg bWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGxz bF9iZywgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGds eXBoX2ZsYXZvciwgcmVtb3ZlX3ApOworICAgICAgICAgICAgICAgIHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZW5hYmxlZF9wID0gZmFsc2U7CisgICAgICAg ICAgICAgICAgLS13LT5tY19tYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5cGVdOworICAgICAg ICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl X3VzZWRbY2FjaGVfdHlwZV0gPSAwOworICAgIH0KK30KKworLyogRXJhc2UgZmFrZSBjdXJzb3Jz IGZyb20gKG1pbiwgcnVuLmN1cnJlbnRfeSwgcnVuLmRlc2lyZWRfeSkgdG8gZW5kIG9mIHdpbmRv dy4KKyAgVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX0RPV046CisgICAgcnVuLmhl aWdodCA9IGl0Lmxhc3RfdmlzaWJsZV95IC0gcnVuLmRlc2lyZWRfeQorICAgIFtlbWFjcyAtcTog IEhvbGQgdXAtYXJyb3cga2V5IHRyaWdnZXJpbmcgYXV0by1yZWNlbnRlciBhdCBzY3JvbGwtbWFy Z2luLl0KKyAgVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX1VQOgorICAgIHJ1bi5o ZWlnaHQgPSBpdC5sYXN0X3Zpc2libGVfeSAtIHJ1bi5jdXJyZW50X3k7CisgICAgW2VtYWNzIC1x OiAgSG9sZCB1cC1hcnJvdyBrZXkgdHJpZ2dlcmluZyBhdXRvLXJlY2VudGVyIGF0IHNjcm9sbC1t YXJnaW4uXQorICBUUllfV0lORE9XX0lEOgorICAgIHJ1bi5oZWlnaHQgPSBpdC5sYXN0X3Zpc2li bGVfeSAtIG1heCAocnVuLmN1cnJlbnRfeSwgcnVuLmRlc2lyZWRfeSkKKyAgICBbQWRkIG9yIHJl bW92ZSBsaW5lcyBmcm9tIHRoZSBidWZmZXI7IGUuZy4sIFJFVCBvciBERUwuXQorICArLS0tLS0t LS0tLS0tLSsgPD0gaXQuY3VycmVudF95ID09IDAKKyAgfCAgICAgICAgICAgICB8CisgIHwgICAg ICAgICAgICAgfCA8PSBydW4uZGVzaXJlZF95ID09IDI3MCBbdXAgKOKGkSldID09IHJ1bi5jdXJy ZW50X3kgPCBydW4uZGVzaXJlZF95CisgIHwgICAgICAgICAgICAgfCAgICBydW4uaGVpZ2h0ID0g aXQubGFzdF92aXNpYmxlX3kgLSBydW4uY3VycmVudF95OworICB8ICAgICAgICAgICAgIHwgICAg cnVuLmhlaWdodCA9PSAxMDgwIC0gNTQwID09IDU0MAorICB8ICAgICAgICAgICAgIHwgICAgW1Ro ZSBlbnRpcmUgYm90dG9tIHJlY3RhbmdsZSBnZXRzIGNvcGllZCB0byB1cHBlciBydW4uZGVzaXJl ZF95Ll0KKyAgfCAgICAgICAgICAgICB8CisgICstLS0tLS0tLS0tLS0tKyA8PSBydW4uY3VycmVu dF95ID09IDU0MAorICB8ICAgICAgICAgICAgIHwKKyAgfCAgICAgICAgICAgICB8IDw9IHJ1bi5k ZXNpcmVkX3kgPT0gODEwIFtkb3duICjihpMpXSA9PSBydW4uY3VycmVudF95ID4gcnVuLmRlc2ly ZWRfeQorICB8ICAgICAgICAgICAgIHwgICAgcnVuLmhlaWdodCA9IGl0Lmxhc3RfdmlzaWJsZV95 IC0gcnVuLmRlc2lyZWRfeQorICB8ICAgICAgICAgICAgIHwgICAgcnVuLmhlaWdodCA9PSAxMDgw IC0gODEwID09IDI3MAorICB8ICAgICAgICAgICAgIHwgICAgW1RvcCBwYXJ0IG9mIHRoZSBsb3dl ciByZWN0YW5nbGUgZ2V0cyBjb3BpZWQgdG8gbG93ZXIgcnVuLmRlc2lyZWRfeS5dCisgIHwgICAg ICAgICAgICAgfAorICArLS0tLS0tLS0tLS0tLSsgPD0gaXQubGFzdF92aXNpYmxlX3kgPT0gMTA4 MCAqLwordm9pZAorbWNfcHJlX3Njcm9sbF9jbGVhbiAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0 IHJ1biBydW4sIGludCBzdGFydF92cG9zLAorICAgICAgICAgICAgICAgICAgICAgaW50IG5yb3dz X3Njcm9sbGVkLCBlbnVtIG1jX3ByZV9zY3JvbGxfY2xlYW5fdHlwZSBmcm9tX3doZXJlKQorewor ICBpZiAoTUlOSV9XSU5ET1dfUCAodykpCisgICAgcmV0dXJuOworICBib29sIGdvX29uZV9wID0g KHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbTUNfQ0FDSEVdID4gMAorICAgICAgICAgICAgICAg ICAgIHx8IHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbQ0hfQ0FDSEVdID4gMAorICAgICAgICAg ICAgICAgICAgIHx8IHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbRkNfQ0FDSEVdID4gMCk7Cisg IGJvb2wgZ29fdHdvX3AgPSAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAg ICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQor ICAgICAgICAgICAgICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVu dHMpLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIg KFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKSk7CisgIGlmIChtY19zdGRlcnJfcCkK KyAgICBmcHJpbnRmIChzdGRlcnIsICJtY19wcmVfc2Nyb2xsX2NsZWFuICglcyk6XG5cCisgICVz IHwgZ29fb25lX3AgKCVzKSB8IGdvX3R3b19wICglcylcblwKKyAgc3RhcnRfdnBvcyAoJWQpIHwg bnJvd3Nfc2Nyb2xsZWQgKCVkKVxuXAorICAlczogIHJ1bi5jdXJyZW50L2Rlc2lyZWRfeSAoJWQv JWQpIHwgcnVuLmhlaWdodCAoJWQpXG4iLAorICAgIG1jX3dpbmRvdyAodyksIChmcm9tX3doZXJl ID09IFRSWV9XSU5ET1dfUkVVU0lOR19DVVJSRU5UX01BVFJJWF9ET1dOKQorICAgICAgICAgICAg ICAgICAgICAgPyAiVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX0RPV04iCisgICAg ICAgICAgICAgICAgICAgOiAoZnJvbV93aGVyZSA9PSBUUllfV0lORE9XX1JFVVNJTkdfQ1VSUkVO VF9NQVRSSVhfVVApCisgICAgICAgICAgICAgICAgICAgICA/ICJUUllfV0lORE9XX1JFVVNJTkdf Q1VSUkVOVF9NQVRSSVhfVVAiCisgICAgICAgICAgICAgICAgICAgOiAoZnJvbV93aGVyZSA9PSBU UllfV0lORE9XX0lEKQorICAgICAgICAgICAgICAgICAgICAgPyAiVFJZX1dJTkRPV19JRCIKKyAg ICAgICAgICAgICAgICAgICA6ICJVTktOT1dOIiwKKyAgICBnb19vbmVfcCA/ICJ5ZXMiIDogIm5v IiwgZ29fdHdvX3AgPyAieWVzIiA6ICJubyIsCisgICAgc3RhcnRfdnBvcywgbnJvd3Nfc2Nyb2xs ZWQsCisgICAgcnVuLmN1cnJlbnRfeSA8IHJ1bi5kZXNpcmVkX3kgPyAi4oaTIiA6ICLihpEiLAor ICAgIHJ1bi5jdXJyZW50X3ksIHJ1bi5kZXNpcmVkX3ksIHJ1bi5oZWlnaHQpOworICBpZiAoIWdv X29uZV9wICYmICFnb190d29fcCkKKyAgICByZXR1cm47CisgIGJvb2wgdXBkYXRpbmdfZnJhbWVf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biBpZiBhbmQgb25seSBpZiBBUkcgaXMgcG9z aXRpdmUuICovKQorICAoTGlzcF9PYmplY3QgYXJnKQoreworICBpZiAoTklMUCAoYXJnKSkKKyAg ICBtY19zdGRlcnJfcCA9ICFtY19zdGRlcnJfcDsKKyAgZWxzZQorICAgIHsKKyAgICAgIGFyZyA9 IEZwcmVmaXhfbnVtZXJpY192YWx1ZSAoYXJnKTsKKyAgICAgIG1jX3N0ZGVycl9wID0gWEZJWE5V TSAoYXJnKSA+IDA7CisgICAgfQorICByZXR1cm4gUW5pbDsKK30KKworLyogZW5kIE1VTFRJUExF LUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAwKIC8qKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKgogCQkgICAgICBXaW5kb3cgZGlzcGxheSBkaW1lbnNpb25zCkBAIC0xNDM5Nyw5ICsxOTI2 NSwyMiBAQCByZWRpc3BsYXlfaW50ZXJuYWwgKHZvaWQpCiAJICAgICAgKnctPmRlc2lyZWRfbWF0 cml4LT5tZXRob2QgPSAwOwogCSAgICAgIGRlYnVnX21ldGhvZF9hZGQgKHcsICJvcHRpbWl6YXRp b24gMSIpOwogI2VuZGlmCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KKyAgaWYgKEJVRkZFUlAg KHctPmNvbnRlbnRzKQorICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgY3Jvc3NoYWlycykpKQorICAgIG1jX3VwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgZmFsc2Up OworICAgIGVsc2UKIAkgICAgICB1cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIGZhbHNlKTsKICNl bmRpZgorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAgICAgZ290byB1cGRhdGU7 CiAJICAgIH0KIAkgIGVsc2UKQEAgLTE3NzkyLDEwICsyMjY3MywyMiBAQCByZWRpc3BsYXlfd2lu ZG93IChMaXNwX09iamVjdCB3aW5kb3csIGJvb2wganVzdF90aGlzX29uZV9wKQogICAgIH0KIAog I2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGJvb2wga2VlcF9jdXJyZW50X3AgPSAoanVzdF90 aGlzX29uZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKCF1c2VkX2N1cnJlbnRfbWF0 cml4X3AgJiYgIW92ZXJsYXlfYXJyb3dfc2VlbikKKyAgICAgICAgICAgICAgICAgICAgICAgICB8 fCB3LT5wc2V1ZG9fd2luZG93X3ApOworCisgIGJvb2wgZnJpbmdlc191cGRhdGVkX3AgPSAoQlVG RkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyBtY191cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIGtlZXBfY3VycmVu dF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgOiB1cGRhdGVfd2luZG93X2ZyaW5nZXMg KHcsIGtlZXBfY3VycmVudF9wKTsKKwogICBpZiAoRlJBTUVfV0lORE9XX1AgKGYpCi0gICAgICAm JiB1cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIChqdXN0X3RoaXNfb25lX3AKLQkJCQkgICAgfHwg KCF1c2VkX2N1cnJlbnRfbWF0cml4X3AgJiYgIW92ZXJsYXlfYXJyb3dfc2VlbikKLQkJCQkgICAg fHwgdy0+cHNldWRvX3dpbmRvd19wKSkpCisgICAgICAmJiBmcmluZ2VzX3VwZGF0ZWRfcCkKICAg ICB7CiAgICAgICB1cGRhdGVfYmVnaW4gKGYpOwogICAgICAgYmxvY2tfaW5wdXQgKCk7CkBAIC0x NzgxMCw2ICsyMjcwMyw5IEBAIHJlZGlzcGxheV93aW5kb3cgKExpc3BfT2JqZWN0IHdpbmRvdywg Ym9vbCBqdXN0X3RoaXNfb25lX3ApCiAgICAgICB1cGRhdGVfZW5kIChmKTsKICAgICB9CiAKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKICAgaWYgKFdJTkRPV19CT1RUT01fRElWSURFUl9X SURUSCAodykpCiAgICAgZ3VpX2RyYXdfYm90dG9tX2RpdmlkZXIgKHcpOwogI2VuZGlmIC8qIEhB VkVfV0lORE9XX1NZU1RFTSAqLwpAQCAtMTgxMjUsNiArMjMwMjEsMTYgQEAgdHJ5X3dpbmRvd19y ZXVzaW5nX2N1cnJlbnRfbWF0cml4IChzdHJ1Y3Qgd2luZG93ICp3KQogCSAgICAgIHVwZGF0ZV9i ZWdpbiAoZik7CiAJICAgICAgZ3VpX3VwZGF0ZV93aW5kb3dfYmVnaW4gKHcpOwogCSAgICAgIEZS QU1FX1JJRiAoZiktPmNsZWFyX3dpbmRvd19tb3VzZV9mYWNlICh3KTsKKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIG1jX3ByZV9zY3Jv bGxfY2xlYW4gKHcsIHJ1biwgc3RhcnRfdnBvcywgbnJvd3Nfc2Nyb2xsZWQsIFRSWV9XSU5ET1df UkVVU0lOR19DVVJSRU5UX01BVFJJWF9ET1dOKTsKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogCSAgICAgIEZSQU1FX1JJRiAoZiktPnNjcm9sbF9ydW5faG9vayAodywgJnJ1bik7CiAJ ICAgICAgZ3VpX3VwZGF0ZV93aW5kb3dfZW5kICh3LCBmYWxzZSwgZmFsc2UpOwogCSAgICAgIHVw ZGF0ZV9lbmQgKGYpOwpAQCAtMTgyOTEsNiArMjMxOTcsMTYgQEAgdHJ5X3dpbmRvd19yZXVzaW5n X2N1cnJlbnRfbWF0cml4IChzdHJ1Y3Qgd2luZG93ICp3KQogCSAgdXBkYXRlX2JlZ2luIChmKTsK IAkgIGd1aV91cGRhdGVfd2luZG93X2JlZ2luICh3KTsKIAkgIEZSQU1FX1JJRiAoZiktPmNsZWFy X3dpbmRvd19tb3VzZV9mYWNlICh3KTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIG1jX3ByZV9zY3JvbGxfY2xlYW4gKHcsIHJ1biwg c3RhcnRfdnBvcywgbnJvd3Nfc2Nyb2xsZWQsIFRSWV9XSU5ET1dfUkVVU0lOR19DVVJSRU5UX01B VFJJWF9VUCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgIEZSQU1FX1JJRiAo ZiktPnNjcm9sbF9ydW5faG9vayAodywgJnJ1bik7CiAJICBndWlfdXBkYXRlX3dpbmRvd19lbmQg KHcsIGZhbHNlLCBmYWxzZSk7CiAJICB1cGRhdGVfZW5kIChmKTsKQEAgLTE5MjQ1LDYgKzI0MTYx LDE2IEBAIHRyeV93aW5kb3dfaWQgKHN0cnVjdCB3aW5kb3cgKncpCiAjaWZkZWYgSEFWRV9XSU5E T1dfU1lTVEVNCiAJICBndWlfdXBkYXRlX3dpbmRvd19iZWdpbiAodyk7CiAJICBGUkFNRV9SSUYg KGYpLT5jbGVhcl93aW5kb3dfbW91c2VfZmFjZSAodyk7CisKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICBtY19wcmVfc2Nyb2xsX2NsZWFu ICh3LCBydW4sIGZpcnN0X3VuY2hhbmdlZF9hdF9lbmRfdnBvcywgZHZwb3MsIFRSWV9XSU5ET1df SUQpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICBGUkFNRV9SSUYgKGYpLT5z Y3JvbGxfcnVuX2hvb2sgKHcsICZydW4pOwogCSAgZ3VpX3VwZGF0ZV93aW5kb3dfZW5kICh3LCBm YWxzZSwgZmFsc2UpOwogI2VuZGlmCkBAIC0yMTUyOCw2ICsyNjQ1NCwxNyBAQCBtYXliZV9wcm9k dWNlX2xpbmVfbnVtYmVyIChzdHJ1Y3QgaXQgKml0KQogICAgICAgU0VUX1RFWFRfUE9TICh0ZW1f aXQucG9zaXRpb24sIC0xLCAtMSk7CiAgICAgICBQUk9EVUNFX0dMWVBIUyAoJnRlbV9pdCk7CiAK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAg ICAgIC8qIFRoaXMgcGVybWl0cyB1cyB0byBpbnNwZWN0IHRoZSBIUE9TIG9mIGxpbmUgbnVtYmVy IGdseXBocyBhbmQgdGhlIHNwYWNlCisgICAgICBwYWRkaW5nIGJlZm9yZS9hZnRlciB0aGUgbGlu ZSBudW1iZXJzLiAgV2Ugc2V0IGBnbHlwaC0+aHBvc2AgZWxzZXdoZXJlLiAqLworICAgICAgdGVt X2l0Lmhwb3MgKz0gMTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgLyog U3RvcCBwcm9kdWNpbmcgZ2x5cGhzLCBhbmQgcmVmcmFpbiBmcm9tIHByb2R1Y2luZyB0aGUgbGlu ZQogCSBudW1iZXIsIGlmIHdlIGRvbid0IGhhdmUgZW5vdWdoIHNwYWNlIG9uIHRoaXMgbGluZS4g ICovCiAgICAgICBpZiAodGVtX2l0LmN1cnJlbnRfeCA+PSB3aWR0aF9saW1pdCkKQEAgLTIxNTM5 LDYgKzI2NDc2LDM0IEBAIG1heWJlX3Byb2R1Y2VfbGluZV9udW1iZXIgKHN0cnVjdCBpdCAqaXQp CiAJfQogICAgIH0KIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKworICBzdHJ1Y3QgdGV4dF9wb3Mgd3N0YXJ0OworICBTRVRfVEVYVF9QT1NfRlJP TV9NQVJLRVIgKHdzdGFydCwgaXQtPnctPnN0YXJ0KTsKKyAgaWYgKGl0LT5hcmVhID09IFRFWFRf QVJFQQorICAgICAgJiYgSVRfQ0hBUlBPUyAoKml0KSA9PSB3c3RhcnQuY2hhcnBvcykKKyAgICB7 CisgICAgICBzdHJ1Y3QgYnVmZmVyICpiID0gWEJVRkZFUiAoaXQtPnctPmNvbnRlbnRzKTsKKyAg ICAgIHN0cnVjdCBidWZmZXIgKm9sZF9idWZmZXIgPSBOVUxMOworICAgICAgLyogTmVlZGVkIHNv IHRoYXQgYnVmZmVyLWxvY2FsIHZhbHVlcyBjYW4gYmUgZGV0ZXJtaW5lZDsgZS5nLiwgd2hlbgor ICAgICAgc3dpdGNoaW5nIHRvIHRoZSBtaW5pYnVmZmVyLiAqLworICAgICAgaWYgKGIgIT0gY3Vy cmVudF9idWZmZXIpCisgICAgICAgIHsKKyAgICAgICAgICBvbGRfYnVmZmVyID0gY3VycmVudF9i dWZmZXI7CisgICAgICAgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAoYik7CisgICAgICAgIH0KKyAg ICAgIGl0LT53LT5tYy5sbnVtX3BpeGVsX3dpZHRoID0gKCFOSUxQIChWZGlzcGxheV9saW5lX251 bWJlcnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IHRlbV9pdC5jdXJy ZW50X3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAwOworICAgICAgaWYg KG9sZF9idWZmZXIpCisgICAgICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOwor ICAgIH0KKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBSZWNvcmQgdGhlIHdp ZHRoIGluIHBpeGVscyB3ZSBuZWVkIGZvciB0aGUgbGluZSBudW1iZXIgZGlzcGxheS4gICovCiAg IGl0LT5sbnVtX3BpeGVsX3dpZHRoID0gdGVtX2l0LmN1cnJlbnRfeDsKICAgLyogQ29weSB0aGUg cHJvZHVjZWQgZ2x5cGhzIGludG8gSVQncyBnbHlwaF9yb3cuICAqLwpAQCAtMjczNjAsNiArMzIz MjUsMTcgQEAgYXBwZW5kX2dseXBoIChzdHJ1Y3QgaXQgKml0KQogCSAgICBnWzFdID0gKmc7CiAJ ICBnbHlwaCA9IGl0LT5nbHlwaF9yb3ctPmdseXBoc1thcmVhXTsKIAl9CisKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgICAgIGdseXBoLT5o cG9zID0gaXQtPmhwb3M7CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9IElUX0JZVEVQT1MgKCppdCk7 CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIGdseXBoLT5jaGFycG9zID0g Q0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5vYmplY3QgPSBpdC0+b2JqZWN0 OwogICAgICAgaWYgKGl0LT5waXhlbF93aWR0aCA+IDApCkBAIC0yNzQ0Miw2ICszMjQxOCwxNyBA QCBhcHBlbmRfY29tcG9zaXRlX2dseXBoIChzdHJ1Y3QgaXQgKml0KQogCSAgICBnWzFdID0gKmc7 CiAJICBnbHlwaCA9IGl0LT5nbHlwaF9yb3ctPmdseXBoc1tpdC0+YXJlYV07CiAJfQorCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBn bHlwaC0+aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPmJ5dGVwb3MgPSBJVF9CWVRFUE9T ICgqaXQpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICBnbHlwaC0+Y2hh cnBvcyA9IGl0LT5jbXBfaXQuY2hhcnBvczsKICAgICAgIGdseXBoLT5vYmplY3QgPSBpdC0+b2Jq ZWN0OwogICAgICAgZWFzc2VydCAoaXQtPnBpeGVsX3dpZHRoIDw9IFNIUlRfTUFYKTsKQEAgLTI3 NjUwLDYgKzMyNjM3LDE3IEBAIHByb2R1Y2VfaW1hZ2VfZ2x5cGggKHN0cnVjdCBpdCAqaXQpCiAJ fQogICAgICAgaWYgKGdseXBoIDwgaXQtPmdseXBoX3Jvdy0+Z2x5cGhzW2FyZWEgKyAxXSkKIAl7 CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisK KyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBnbHlwaC0+Ynl0ZXBvcyA9IElU X0JZVEVQT1MgKCppdCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgIGdseXBo LT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKIAkgIGdseXBoLT5vYmplY3QgPSBp dC0+b2JqZWN0OwogCSAgZ2x5cGgtPnBpeGVsX3dpZHRoID0gY2xpcF90b19ib3VuZHMgKC0xLCBp dC0+cGl4ZWxfd2lkdGgsIFNIUlRfTUFYKTsKQEAgLTI3NzUzLDYgKzMyNzUxLDE3IEBAIHByb2R1 Y2VfeHdpZGdldF9nbHlwaCAoc3RydWN0IGl0ICppdCkKIAl9CiAgICAgICBpZiAoZ2x5cGggPCBp dC0+Z2x5cGhfcm93LT5nbHlwaHNbYXJlYSArIDFdKQogCXsKKworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPmhwb3MgPSBp dC0+aHBvczsKKyAgICAgIGdseXBoLT5ieXRlcG9zID0gSVRfQllURVBPUyAoKml0KTsKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogCSAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChp dC0+cG9zaXRpb24pOwogCSAgZ2x5cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAJICBnbHlwaC0+ cGl4ZWxfd2lkdGggPSBjbGlwX3RvX2JvdW5kcyAoLTEsIGl0LT5waXhlbF93aWR0aCwgU0hSVF9N QVgpOwpAQCAtMjc4MzksNiArMzI4NDgsMTcgQEAgYXBwZW5kX3N0cmV0Y2hfZ2x5cGggKHN0cnVj dCBpdCAqaXQsIExpc3BfT2JqZWN0IG9iamVjdCwKIAkgICAgd2lkdGggLT0gaXQtPmZpcnN0X3Zp c2libGVfeCAtIGl0LT5jdXJyZW50X3g7CiAJICBlYXNzZXJ0ICh3aWR0aCA+IDApOwogCX0KKwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAg ICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBoLT5ieXRlcG9zID0gSVRfQllU RVBPUyAoKml0KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgZ2x5cGgt PmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9zaXRpb24pOwogICAgICAgZ2x5cGgtPm9iamVjdCA9 IG9iamVjdDsKICAgICAgIC8qIEZJWE1FOiBJdCB3b3VsZCBiZSBiZXR0ZXIgdG8gdXNlIFRZUEVf TUFYIGhlcmUsIGJ1dApAQCAtMjgyOTMsNiArMzMzMTMsMTcgQEAgYXBwZW5kX2dseXBobGVzc19n bHlwaCAoc3RydWN0IGl0ICppdCwgaW50IGZhY2VfaWQsIGJvb2wgZm9yX25vX2ZvbnQsIGludCBs ZW4sCiAJICAgIGdbMV0gPSAqZzsKIAkgIGdseXBoID0gaXQtPmdseXBoX3Jvdy0+Z2x5cGhzW2Fy ZWFdOwogCX0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNP UlMgKi8KKworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBoLT5ieXRl cG9zID0gSVRfQllURVBPUyAoKml0KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog ICAgICAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9zaXRpb24pOwogICAgICAgZ2x5 cGgtPm9iamVjdCA9IGl0LT5vYmplY3Q7CiAgICAgICBlYXNzZXJ0IChpdC0+cGl4ZWxfd2lkdGgg PD0gU0hSVF9NQVgpOwpAQCAtMjkzNDMsMTAgKzM0Mzc0LDIwIEBAIGd1aV9pbnNlcnRfZ2x5cGhz IChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfcm93ICp1cGRhdGVkX3JvdywKIAogICAv KiBXcml0ZSB0aGUgZ2x5cGhzLiAgKi8KICAgaHBvcyA9IHN0YXJ0IC0gcm93LT5nbHlwaHNbdXBk YXRlZF9hcmVhXTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKworICBpZiAoIW1jX3JlZHJhd19yb3cgKHcsIHctPmN1cnJlbnRfbWF0cml4LCBy b3csIHVwZGF0ZWRfYXJlYSwgdy0+b3V0cHV0X2N1cnNvci54LAorICAgICAgICAgICAgICAgICAg ICAgIGhwb3MsIGhwb3MgKyBsZW4sIGZhbHNlLCBEUkFXX05PUk1BTF9URVhULCBHVUlfSU5TRVJU X0dMWVBIUykpCiAgIGRyYXdfZ2x5cGhzICh3LCB3LT5vdXRwdXRfY3Vyc29yLngsIHJvdywgdXBk YXRlZF9hcmVhLAogCSAgICAgICBocG9zLCBocG9zICsgbGVuLAogCSAgICAgICBEUkFXX05PUk1B TF9URVhULCAwKTsKIAorLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBBZHZhbmNl IHRoZSBvdXRwdXQgY3Vyc29yLiAgKi8KICAgdy0+b3V0cHV0X2N1cnNvci5ocG9zICs9IGxlbjsK ICAgdy0+b3V0cHV0X2N1cnNvci54ICs9IHNoaWZ0X2J5X3dpZHRoOwpAQCAtMjk3NzIsOSArMzQ4 MTMsMTkgQEAgZ3VpX2ZpeF9vdmVybGFwcGluZ19hcmVhIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1 Y3QgZ2x5cGhfcm93ICpyb3csCiAJICB3aGlsZSAoaSA8IHJvdy0+dXNlZFthcmVhXQogCQkgJiYg cm93LT5nbHlwaHNbYXJlYV1baV0ub3ZlcmxhcHNfdmVydGljYWxseV9wKTsKIAorCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgaWYgKCFt Y19yZWRyYXdfcm93ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgcm93LCBhcmVhLCBzdGFydF94LCBz dGFydCwgaSwKKyAgICAgICAgICBmYWxzZSwgRFJBV19OT1JNQUxfVEVYVCwgR1VJX0ZJWF9PVkVS TEFQUElOR19BUkVBKSkKIAkgIGRyYXdfZ2x5cGhzICh3LCBzdGFydF94LCByb3csIGFyZWEsCiAJ CSAgICAgICBzdGFydCwgaSwKIAkJICAgICAgIERSQVdfTk9STUFMX1RFWFQsIG92ZXJsYXBzKTsK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCX0KICAgICAgIGVsc2UKIAl7CkBAIC0z MDAyNSwxMCArMzUwNzYsMjAgQEAgZGlzcGxheV9hbmRfc2V0X2N1cnNvciAoc3RydWN0IHdpbmRv dyAqdywgYm9vbCBvbiwKICAgbmV3X2N1cnNvcl90eXBlID0gZ2V0X3dpbmRvd19jdXJzb3JfdHlw ZSAodywgZ2x5cGgsCiAJCQkJCSAgICAmbmV3X2N1cnNvcl93aWR0aCwgJmFjdGl2ZV9jdXJzb3Ip OwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLwor CiAgIC8qIElmIGN1cnNvciBpcyBjdXJyZW50bHkgYmVpbmcgc2hvd24gYW5kIHdlIGRvbid0IHdh bnQgaXQgdG8gYmUgb3IKICAgICAgaXQgaXMgaW4gdGhlIHdyb25nIHBsYWNlLCBvciB0aGUgY3Vy c29yIHR5cGUgaXMgbm90IHdoYXQgd2Ugd2FudCwKICAgICAgZXJhc2UgaXQuICAqLwogICBpZiAo dy0+cGh5c19jdXJzb3Jfb25fcAorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiA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LDkgKzM1MTIzLDIzIEBAIGRpc3BsYXlfYW5kX3Nl dF9jdXJzb3IgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgb24sCiAgICAgICB3LT5waHlzX2N1cnNv ci52cG9zID0gdnBvczsKICAgICB9CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBN VUxUSVBMRS1DVVJTT1JTICovCisKKyAgaWYgKE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRl bnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIGZjX3Zpc2libGUpKQorICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29u dGVudHMpLCBtY19jb25mKSkKKyAgICAgICYmIHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbTUNf Q0FDSEVdID09IDAKKyAgICAgICYmIHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbQ0hfQ0FDSEVd ID09IDAKKyAgICAgICYmIHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbRkNfQ0FDSEVdID09IDAp CiAgIEZSQU1FX1JJRiAoZiktPmRyYXdfd2luZG93X2N1cnNvciAodywgZ2x5cGhfcm93LCB4LCB5 LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19jdXJzb3JfdHlwZSwg bmV3X2N1cnNvcl93aWR0aCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBv biwgYWN0aXZlX2N1cnNvcik7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIH0KIAog CkBAIC0zMDE1NCw3ICszNTIzMiwxOCBAQCBkcmF3X3Jvd193aXRoX21vdXNlX2ZhY2UgKHN0cnVj dCB3aW5kb3cgKncsIGludCBzdGFydF94LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCiAjaWZkZWYg SEFWRV9XSU5ET1dfU1lTVEVNCiAgIGlmIChGUkFNRV9XSU5ET1dfUCAoWEZSQU1FICh3LT5mcmFt ZSkpKQogICAgIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKworICAgICAgaWYgKCFtY19yZWRyYXdfcm93ICh3LCB3LT5jdXJyZW50X21hdHJp eCwgcm93LCBURVhUX0FSRUEsIHN0YXJ0X3gsCisgICAgICAgICAgICAgICAgICAgICAgICAgIHN0 YXJ0X2hwb3MsIGVuZF9ocG9zLCBmYWxzZSwgZHJhdywgRFJBV19ST1dfV0lUSF9NT1VTRV9GQUNF KSkKICAgICAgIGRyYXdfZ2x5cGhzICh3LCBzdGFydF94LCByb3csIFRFWFRfQVJFQSwgc3RhcnRf aHBvcywgZW5kX2hwb3MsIGRyYXcsIDApOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKwor CiAgICAgICByZXR1cm47CiAgICAgfQogI2VuZGlmCkBAIC0zMjIxNCwxMSArMzczMDMsMjMgQEAg ZXhwb3NlX2FyZWEgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgY29u c3QgRW1hY3NfUmVjdGFuZ2xlICpyLAogICBzdHJ1Y3QgZ2x5cGggKmxhc3Q7CiAgIGludCBmaXJz dF94LCBzdGFydF94LCB4OwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQ TEUtQ1VSU09SUyAqLworCiAgIGlmIChhcmVhID09IFRFWFRfQVJFQSAmJiByb3ctPmZpbGxfbGlu ZV9wKQorICAgIHsKKyAgICAgIGlmICghbWNfcmVkcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRy aXgsIHJvdywgYXJlYSwgMCwgMCwgcm93LT51c2VkW2FyZWFdLAorICAgICAgICAgICAgICAgICAg ICAgICAgICBmYWxzZSwgRFJBV19OT1JNQUxfVEVYVCwgRVhQT1NFX0FSRUFfT05FKSkKICAgICAv KiBJZiByb3cgZXh0ZW5kcyBmYWNlIHRvIGVuZCBvZiBsaW5lIHdyaXRlIHRoZSB3aG9sZSBsaW5l LiAgKi8KICAgICBkcmF3X2dseXBocyAodywgMCwgcm93LCBhcmVhLAogCQkgMCwgcm93LT51c2Vk W2FyZWFdLAogCQkgRFJBV19OT1JNQUxfVEVYVCwgMCk7CisgICAgfQorCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKworCiAgIGVsc2UKICAgICB7CiAgICAgICAvKiBTZXQgU1RBUlRfWCB0byB0 aGUgd2luZG93LXJlbGF0aXZlIHN0YXJ0IHBvc2l0aW9uIGZvciBkcmF3aW5nIGdseXBocyBvZgpA QCAtMzIyNTAsMTEgKzM3MzUxLDI0IEBAIGV4cG9zZV9hcmVhIChzdHJ1Y3Qgd2luZG93ICp3LCBz dHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGNvbnN0IEVtYWNzX1JlY3RhbmdsZSAqciwKIAkgICsrbGFz dDsKIAl9CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JT ICovCisKICAgICAgIC8qIFJlcGFpbnQuICAqLwotICAgICAgaWYgKGxhc3QgPiBmaXJzdCkKKwor ICAgICAgLyogRmxvYXRpbmcgZmFrZSBjdXJzb3JzIHdpbGwgZXhpc3Qgd2hlbiAobGFzdCA9PSBm aXJzdCkuICovCisgICAgICBpZiAoIW1jX3JlZHJhd19yb3cgKHcsIHctPmN1cnJlbnRfbWF0cml4 LCByb3csIGFyZWEsIGZpcnN0X3ggLSBzdGFydF94LAorICAgICAgICAgICAgICAgICAgICAgICAg ICBmaXJzdCAtIHJvdy0+Z2x5cGhzW2FyZWFdLCBsYXN0IC0gcm93LT5nbHlwaHNbYXJlYV0sCisg ICAgICAgICAgICAgICAgICAgICAgICAgIGZhbHNlLCBEUkFXX05PUk1BTF9URVhULCBFWFBPU0Vf QVJFQV9UV08pCisgICAgICAgICAgJiYgbGFzdCA+IGZpcnN0KQogCWRyYXdfZ2x5cGhzICh3LCBm aXJzdF94IC0gc3RhcnRfeCwgcm93LCBhcmVhLAogCQkgICAgIGZpcnN0IC0gcm93LT5nbHlwaHNb YXJlYV0sIGxhc3QgLSByb3ctPmdseXBoc1thcmVhXSwKIAkJICAgICBEUkFXX05PUk1BTF9URVhU LCAwKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgIH0KIH0KIApAQCAtMzIy NjgsMTAgKzM3MzgyLDIyIEBAIGV4cG9zZV9saW5lIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3Qg Z2x5cGhfcm93ICpyb3csIGNvbnN0IEVtYWNzX1JlY3RhbmdsZSAqcikKIHsKICAgZWFzc2VydCAo cm93LT5lbmFibGVkX3ApOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQ TEUtQ1VSU09SUyAqLworCiAgIGlmIChyb3ctPm1vZGVfbGluZV9wIHx8IHctPnBzZXVkb193aW5k b3dfcCkKKyAgICB7CisgICAgICBpZiAoIW1jX3JlZHJhd19yb3cgKHcsIHctPmN1cnJlbnRfbWF0 cml4LCByb3csIFRFWFRfQVJFQSwgMCwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcm93 LT51c2VkW1RFWFRfQVJFQV0sIGZhbHNlLCBEUkFXX05PUk1BTF9URVhULCBFWFBPU0VfTElORSkp CiAgICAgZHJhd19nbHlwaHMgKHcsIDAsIHJvdywgVEVYVF9BUkVBLAogCQkgMCwgcm93LT51c2Vk W1RFWFRfQVJFQV0sCiAJCSBEUkFXX05PUk1BTF9URVhULCAwKTsKKyAgICB9CisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgZWxzZQogICAgIHsKICAgICAgIGlmIChyb3ctPnVzZWRb TEVGVF9NQVJHSU5fQVJFQV0pCkBAIC0zMjgxOSw2ICszNzk0NSwyMiBAQCBndWlfaW50ZXJzZWN0 X3JlY3RhbmdsZXMgKGNvbnN0IEVtYWNzX1JlY3RhbmdsZSAqcjEsIGNvbnN0IEVtYWNzX1JlY3Rh bmdsZSAqcjIsCiB2b2lkCiBzeW1zX29mX3hkaXNwICh2b2lkKQogeworCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGRlZnN1YnIgKCZTbWNf ZHVtcF9nbHlwaF9yb3cpOworCisgIGRlZnN1YnIgKCZTbWNfZHVtcF9nbHlwaF9tYXRyaXgpOwor CisgIGRlZnN1YnIgKCZTbWNfY3VycmVudF9jb2x1bW4pOworCisgIGRlZnN1YnIgKCZTbWNfc3Rk ZXJyKTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov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bmQgPSBmYWNlLT5mb3JlZ3JvdW5kOworICAgICAgZWxzZQorICAg ICAgICB4Z2N2LmJhY2tncm91bmQgPSB4Z2N2LmZvcmVncm91bmQgPSBmLT5vdXRwdXRfZGF0YS54 LT5jdXJzb3JfcGl4ZWw7CisgICAgICB4Z2N2LmdyYXBoaWNzX2V4cG9zdXJlcyA9IEZhbHNlOwor ICAgICAgaWYgKGdjKQorICAgICAgICBYQ2hhbmdlR0MgKGRweSwgZ2MsIG1hc2ssICZ4Z2N2KTsK KyAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgIGdjID0gWENyZWF0ZUdDIChkcHksIHdp bmRvdywgbWFzaywgJnhnY3YpOworICAgICAgICAgIEZSQU1FX0RJU1BMQVlfSU5GTyAoZiktPnNj cmF0Y2hfY3Vyc29yX2djID0gZ2M7CisgICAgICAgIH0KKyAgICAgIHhfY2xpcF90b19yb3cgKHcs IHJvdywgVEVYVF9BUkVBLCBnYyk7CisgICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChmLCBnYywgZngs IGZ5LCB3ZCwgaCk7CisgICAgICB4X3Jlc2V0X2NsaXBfcmVjdGFuZ2xlcyAoZiwgZ2MpOworICAg IH0KK30KKworLyogUklGOiBEcmF3IGN1cnNvciBvbiB3aW5kb3cgVy4gKi8KK3N0YXRpYyB2b2lk CittY194X2RyYXdfd2luZG93X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBo X21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAg ICAgICAgICAgaW50IHgsIGludCBmeCwgaW50IHksIGludCBmeSwgaW50IGhwb3MsIGludCB2cG9z LCBpbnQgd2QsCisgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGgsIHN0cnVjdCBtY19SR0Ig bHNsLCBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAg ICAgICAg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gICAgICAgIH0K KyAgICAgICAgICAgICAgICBlbHNlIGlmIChhY3RpdmVfcCkKKyAgICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfZmFjZV9pZCA9 IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItcHJl LXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xs b3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7 CisgICAgICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYp LCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19hY3RpdmVfZmFjZS0+Zm9yZWdy b3VuZCk7CisgICAgICAgICAgICAgICAgICAgIFhTZXRCYWNrZ3JvdW5kIChGUkFNRV9YX0RJU1BM QVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19hY3RpdmVfZmFjZS0+ YmFja2dyb3VuZCk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNl IGlmICghYWN0aXZlX3ApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAg ICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRf ZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLXByZS16di1m YWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3df aW5hY3RpdmVfZmFjZSA9IEZBQ0VfRlJPTV9JRCAoZ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gICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91 dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9yZWdpb25fYmVnX2ZhY2UtPmZv cmVncm91bmQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlmIChy ZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcAorICAg ICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+Y2hhcnBvcyA9PSByZWdpb25f ZW5kKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2Vf aWQgaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAo dywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWF0LXJlZ2lvbi1wcmUtenYtZmFjZSIp LCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVf cmVnaW9uX2VuZF9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9l bmRfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0 aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFsLWZh a2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAgICAgICBzdHJ1 Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0 aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVf WF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfYWN0aXZl X2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgICAgICBYU2V0QmFja2dyb3VuZCAo RlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3df YWN0aXZlX3JlZ2lvbl9lbmRfZmFjZS0+YmFja2dyb3VuZCk7CisgICAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0aXZlX3AKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3MgPiByZWdpb25fYmVnCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3MgPCByZWdpb25fZW5kKQorICAgICAgICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19h Y3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBp bnRlcm4gKCIrLXJlYWwtZmFrZS1jdXJzb3ItaW4tcmVnaW9uLXByZS16di1mYWNlIiksIHRydWUp OworICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX3JlZ2lv bl9iZXR3ZWVuX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3RpdmVfcmVnaW9uX2Jl dHdlZW5fZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxv d19hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRl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jdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAg ICAgICAgICAgICAgIFhTZXRCYWNrZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRw dXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19hY3RpdmVfZmFjZS0+YmFja2dyb3VuZCk7Cisg ICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKCFh Y3RpdmVfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVk X2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1wcmUtenYt ZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhv bGxvd19pbmFjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfaW5hY3RpdmVfZmFj ZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9Y X0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19pbmFjdGl2 ZV9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgWFNldEJhY2tn cm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywg aG9sbG93X2luYWN0aXZlX2ZhY2UtPmJhY2tncm91bmQpOworICAgICAgICAgICAgICAgICAgICAg ICAgfQorICAgICAgICAgICAgICBibG9ja19pbnB1dCAoKTsKKyAgICAgICAgICAgICAgLyogRm9y Y2UgYG1jX3hfc2V0X2N1cnNvcl9nYycgdG8gdXNlIGBzLT5mLT5vdXRwdXRfZGF0YS54LT5jdXJz b3JfZ2MnLiAqLworICAgICAgICAgICAgICBib29sIGN1cnNvcl9nY19wID0gdHJ1ZTsKKyAgICAg ICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NVUlNP UiwgeCwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxz bCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9wLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX2djX3ApOworICAgICAgICAgICAgICBYU2V0 Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29y X2djLCB4Z2N2LmZvcmVncm91bmQpOworICAgICAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJB TUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCB4Z2N2LmJhY2tn cm91bmQpOworICAgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgICAgICAgICAv KiBEcmF3IHRoZSBmcmFtZSBhcm91bmQgdGhlIGJveC4gKi8KKyAgICAgICAgICAgICAgbWNfeF9k cmF3X2hvbGxvd19jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZw b3MsIHdkLCBoKTsKKyAgICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNl IE1DX0hPTExPV19CT1g6CisgICAgeworICAgICAgaWYgKGxzbC5yZWQgPj0gMCAmJiBsc2wuZ3Jl ZW4gPj0gMCAmJiBsc2wuYmx1ZSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgLyogVGVtcG9y YXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwnLiAqLworICAgICAg ICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCA9IGNvbG9yLnBpeGVsOworICAgICAg ICAgIG1jX3hfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5 LCBocG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29y X3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UK KyAgICAgICAgICBtY194X2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4 LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgYnJlYWs7CisgICAgfQorICAgIGNh c2UgTUNfRklMTEVEX0JPWDoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5n cmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFj ayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djJyBieSBib3Jyb3dpbmcgdGhlCisgICAgICAg IGZ1bmN0aW9uYWxpdHkgb2YgYHhfbWFrZV9nYycgaW4geGZucy5jLiAqLworICAgICAgICB7Cisg ICAgICAgICAgYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1F X1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgRlJBTUVfQkFDS0dS T1VORF9QSVhFTCAoZikpOworICAgICAgICAgIFhTZXRCYWNrZ3JvdW5kIChGUkFNRV9YX0RJU1BM QVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGNvbG9yLnBpeGVsKTsKKyAgICAg ICAgICAvKiBGb3JjZSBgbWNfeF9zZXRfY3Vyc29yX2djJyB0byB1c2UgYHMtPmYtPm91dHB1dF9k YXRhLngtPmN1cnNvcl9nYycuICovCisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfcCA9IHRydWU7 CisgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFXX0NV UlNPUiwgeCwgaHBvcywgdnBvcywgbHNsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsIGN1cnNvcl9nY19wKTsK KyAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0 X2RhdGEueC0+Y3Vyc29yX2djLCB4Z2N2LmZvcmVncm91bmQpOworICAgICAgICAgIFhTZXRCYWNr Z3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2Ms IHhnY3YuYmFja2dyb3VuZCk7CisgICAgICAgICAgdW5ibG9ja19pbnB1dCAoKTsKKyAgICAgICAg fQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2Nf cCA9IGZhbHNlOworICAgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwg cm93LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywgbHNsLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwg Y3Vyc29yX2djX3ApOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNl IE1DX0JBUjoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAw ICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBo aWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCcuICovCisgICAgICAgICAgZi0+ b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gY29sb3IucGl4ZWw7CisgICAgICAgICAgYm9v bCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IHRydWU7CisgICAgICAgICAgbWNfeF9kcmF3 X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdk LCBoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsIE1DX0JB UiwgY3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIGYtPm91dHB1dF9kYXRh LngtPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAg ICAgICBlbHNlCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNp YmxlX29rYXlfcCA9IGZhbHNlOworICAgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcs IG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl93aWR0aCwgTUNfQkFSLCBjdXJzb3JfZ2Nf aW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAg IGNhc2UgTUNfSEJBUjoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVl biA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3Jh cmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhlbCcuICovCisgICAgICAg ICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gY29sb3IucGl4ZWw7CisgICAgICAg ICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IHRydWU7CisgICAgICAgICAgbWNf eF9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZw b3MsIHdkLCBoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgs IE1DX0hCQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICBmLT5vdXRw dXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAg IH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgY3Vyc29yX2dj X2ludmlzaWJsZV9va2F5X3AgPSBmYWxzZTsKKyAgICAgICAgICAgIG1jX3hfZHJhd19iYXJfY3Vy c29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoLCBjdXJzb3Jfd2lkdGgsIE1DX0hCQVIsIGN1 cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICB9CisgICAgICBicmVhazsKKyAg ICB9CisgICAgZGVmYXVsdDoKKyAgICAgIGVtYWNzX2Fib3J0ICgpOworICB9CisgICAgICAgIH0K KyNpZmRlZiBIQVZFX1hfSTE4TgorICBpZiAodyA9PSBYV0lORE9XIChmLT5zZWxlY3RlZF93aW5k b3cpKQorICAgIGlmIChGUkFNRV9YSUMgKGYpICYmIChGUkFNRV9YSUNfU1RZTEUgKGYpICYgWElN UHJlZWRpdFBvc2l0aW9uKSkKKyAgICAgIHhpY19zZXRfcHJlZWRpdGFyZWEgKHcsIHgsIHkpOwor I2VuZGlmCisgICAgfQorICBYRmx1c2ggKEZSQU1FX1hfRElTUExBWSAoZikpOworfQorCisvKiBE cmF3IHN0cmV0Y2ggZ2x5cGggc3RyaW5nIFMuICovCitzdGF0aWMgdm9pZAorbWNfeF9kcmF3X3N0 cmV0Y2hfZ2x5cGhfc3RyaW5nIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzKQoreworICBlYXNzZXJ0 IChzLT5maXJzdF9nbHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKTsKKyAgaWYgKHMtPmhsID09 IERSQVdfQ1VSU09SCisgICAgICAmJiAheF9zdHJldGNoX2N1cnNvcl9wKQorICAgIHsKKyAgICAg IC8qIElmIGB4LXN0cmV0Y2gtY3Vyc29yJyBpcyBuaWwsIGRvbid0IGRyYXcgYSBibG9jayBjdXJz b3IgYXMgd2lkZSBhcyB0aGUKKyAgICAgIHN0cmV0Y2ggZ2x5cGguICovCisgICAgICBpbnQgd2lk dGgsIGJhY2tncm91bmRfd2lkdGggPSBzLT5iYWNrZ3JvdW5kX3dpZHRoOworICAgICAgaW50IHgg PSBzLT54OworICAgICAgaWYgKCFzLT5yb3ctPnJldmVyc2VkX3ApCisgICAgICAgIHsKKyAgICAg ICAgICBpbnQgbGVmdF94ID0gd2luZG93X2JveF9sZWZ0X29mZnNldCAocy0+dywgVEVYVF9BUkVB KTsKKyAgICAgICAgICBpZiAoeCA8IGxlZnRfeCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgYmFja2dyb3VuZF93aWR0aCAtPSBsZWZ0X3ggLSB4OworICAgICAgICAgICAgICB4ID0gbGVm dF94OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7 CisgICAgICAgICAgICAvKiBJbiBSMkwgcm93cywgZHJhdyB0aGUgY3Vyc29yIG9uIHRoZSByaWdo dCBlZGdlIG9mIHRoZQorICAgICAgICAgICAgICAgc3RyZXRjaCBnbHlwaC4gKi8KKyAgICAgICAg ICAgIGludCByaWdodF94ID0gd2luZG93X2JveF9yaWdodCAocy0+dywgVEVYVF9BUkVBKTsKKyAg ICAgICAgICAgIGlmICh4ICsgYmFja2dyb3VuZF93aWR0aCA+IHJpZ2h0X3gpCisgICAgICAgICAg ICAgIGJhY2tncm91bmRfd2lkdGggLT0geCAtIHJpZ2h0X3g7CisgICAgICAgICAgICB4ICs9IGJh Y2tncm91bmRfd2lkdGg7CisgICAgICAgICAgfQorICAgICAgd2lkdGggPSBtaW4gKEZSQU1FX0NP TFVNTl9XSURUSCAocy0+ZiksIGJhY2tncm91bmRfd2lkdGgpOworICAgICAgaWYgKHMtPnJvdy0+ cmV2ZXJzZWRfcCkKKyAgICAgICAgeCAtPSB3aWR0aDsKKyAgICAgIC8qIERyYXcgY3Vyc29yLiAq LworICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19iZ19yZWN0IChzLCB4LCBzLT55LCB3aWR0aCwg cy0+aGVpZ2h0KTsKKyAgICAgIC8qIENsZWFyIHJlc3QgdXNpbmcgdGhlIEdDIG9mIHRoZSBvcmln aW5hbCBub24tY3Vyc29yIGZhY2UuICovCisgICAgICBpZiAod2lkdGggPCBiYWNrZ3JvdW5kX3dp ZHRoKQorICAgICAgICB7CisgICAgICAgICAgaW50IHkgPSBzLT55OworICAgICAgICAgIGludCB3 ID0gYmFja2dyb3VuZF93aWR0aCAtIHdpZHRoLCBoID0gcy0+aGVpZ2h0OworICAgICAgICAgIFhS ZWN0YW5nbGUgcjsKKyAgICAgICAgICBHQyBnYzsKKyAgICAgICAgICBpZiAoIXMtPnJvdy0+cmV2 ZXJzZWRfcCkKKyAgICAgICAgICAgIHggKz0gd2lkdGg7CisgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgeCA9IHMtPng7CisgICAgICAgICAgaWYgKHMtPnJvdy0+bW91c2VfZmFjZV9wCisgICAg ICAgICAgICAgICYmIGN1cnNvcl9pbl9tb3VzZV9mYWNlX3AgKHMtPncpKQorICAgICAgICAgICAg eworICAgICAgICAgICAgICB4X3NldF9tb3VzZV9mYWNlX2djIChzKTsKKyAgICAgICAgICAgICAg Z2MgPSBzLT5nYzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICBn YyA9IHMtPmZhY2UtPmdjOworICAgICAgICAgIGdldF9nbHlwaF9zdHJpbmdfY2xpcF9yZWN0IChz LCAmcik7CisgICAgICAgICAgeF9zZXRfY2xpcF9yZWN0YW5nbGVzIChzLT5mLCBnYywgJnIsIDEp OworICAgICAgICAgIGlmIChzLT5mYWNlLT5zdGlwcGxlKQorICAgICAgICAgICAgeworICAgICAg ICAgICAgICAvKiBGaWxsIGJhY2tncm91bmQgd2l0aCBhIHN0aXBwbGUgcGF0dGVybi4gKi8KKyAg ICAgICAgICAgICAgWFNldEZpbGxTdHlsZSAoRlJBTUVfWF9ESVNQTEFZIChzLT5mKSwgZ2MsIEZp bGxPcGFxdWVTdGlwcGxlZCk7CisgICAgICAgICAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYs IGdjLCB4LCB5LCB3LCBoKTsKKyAgICAgICAgICAgICAgWFNldEZpbGxTdHlsZSAoRlJBTUVfWF9E SVNQTEFZIChzLT5mKSwgZ2MsIEZpbGxTb2xpZCk7CisgICAgICAgICAgICB9CisgICAgICAgICAg ZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBYR0NWYWx1ZXMgeGdjdjsKKyAgICAg ICAgICAgICAgWEdldEdDVmFsdWVzIChGUkFNRV9YX0RJU1BMQVkgKHMtPmYpLCBnYywgR0NGb3Jl Z3JvdW5kIHwgR0NCYWNrZ3JvdW5kLCAmeGdjdik7CisgICAgICAgICAgICAgIFhTZXRGb3JlZ3J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lU3RyaW5nLiAq LworICBpZiAocy0+bmV4dCAmJiBzLT5yaWdodF9vdmVyaGFuZyAmJiAhcy0+Zm9yX292ZXJsYXBz KQorICAgIHsKKyAgICAgIGludCB3aWR0aDsKKyAgICAgIHN0cnVjdCBnbHlwaF9zdHJpbmcgKm5l eHQ7CisgICAgICBmb3IgKHdpZHRoID0gMCwgbmV4dCA9IHMtPm5leHQ7CisgICAgICAgICAgIG5l eHQgJiYgd2lkdGggPCBzLT5yaWdodF9vdmVyaGFuZzsKKyAgICAgICAgICAgd2lkdGggKz0gbmV4 dC0+d2lkdGgsIG5leHQgPSBuZXh0LT5uZXh0KQorICAgICAgICBpZiAobmV4dC0+Zmlyc3RfZ2x5 cGgtPnR5cGUgIT0gSU1BR0VfR0xZUEgpCisgICAgICAgICAgeworICAgICAgICAgICAgbWNfeF9z ZXRfZ2x5cGhfc3RyaW5nX2djIChuZXh0LCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgICB4X3Nl dF9nbHlwaF9zdHJpbmdfY2xpcHBpbmcgKG5leHQpOworICAgICAgICAgICAgaWYgKG5leHQtPmZp cnN0X2dseXBoLT50eXBlID09IFNUUkVUQ0hfR0xZUEgpCisgICAgICAgICAgICAgIG1jX3hfZHJh d19zdHJldGNoX2dseXBoX3N0cmluZyAobmV4dCk7CisgICAgICAgICAgICBlbHNlCisgICAgICAg ICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAobmV4dCwgdHJ1ZSk7CisgICAg ICAgICAgICBuZXh0LT5udW1fY2xpcHMgPSAwOworICAgICAgICAgIH0KKyAgICB9CisgIC8qIFNl dCB1cCBTLT5nYywgc2V0IGNsaXBwaW5nIGFuZCBkcmF3IFMuICovCisgIG1jX3hfc2V0X2dseXBo X3N0cmluZ19nYyAocywgY3Vyc29yX2djX3ApOworICAvKiBEcmF3IHJlbGllZiAoaWYgYW55KSBp biBhZHZhbmNlIGZvciBjaGFyL2NvbXBvc2l0aW9uIHNvI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s IGJlCisgICAgICAgICBkcmF3biBsYXRlciB3aGVuIHMtPm5leHQgaXMgZHJhd24uICovCisgICAg ICB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywgcyk7CisgICAgICBlbHNl CisgICAgICAgIHhfc2V0X2dseXBoX3N0cmluZ19jbGlwcGluZyAocyk7CisgIHN3aXRjaCAocy0+ Zmlyc3RfZ2x5cGgtPnR5cGUpCisgICAgeworICAgIGNhc2UgSU1BR0VfR0xZUEg6CisgICAgICB4 X2RyYXdfaW1hZ2VfZ2x5cGhfc3RyaW5nIChzKTsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgWFdJ REdFVF9HTFlQSDoKKyAgICAgIHhfZHJhd194d2lkZ2V0X2dseXBoX3N0cmluZyAocyk7CisgICAg ICBicmVhazsKKyAgICBjYXNlIFNUUkVUQ0hfR0xZUEg6CisgICAgICBtY194X2RyYXdfc3RyZXRj aF9nbHlwaF9zdHJpbmcgKHMpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBDSEFSX0dMWVBIOgor ICAgICAgaWYgKHMtPmZvcl9vdmVybGFwcykKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRf cCA9IHRydWU7CisgICAgICBlbHNlCisgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dy b3VuZCAocywgZmFsc2UpOworICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChz KTsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgQ09NUE9TSVRFX0dMWVBIOgorICAgICAgaWYgKHMt PmZvcl9vdmVybGFwcyB8fCAocy0+Y21wX2Zyb20gPiAwCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAmJiAhIHMtPmZpcnN0X2dseXBoLT51LmNtcC5hdXRvbWF0aWMpKQorICAgICAgICBz LT5iYWNrZ3JvdW5kX2ZpbGxlZF9wID0gdHJ1ZTsKKyAgICAgIGVsc2UKKyAgICAgICAgeF9kcmF3 X2dseXBoX3N0cmluZ19iYWNrZ3JvdW5kIChzLCB0cnVlKTsKKyAgICAgIHhfZHJhd19jb21wb3Np dGVfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHMpOworICAgICAgYnJlYWs7CisgICAgY2FzZSBH TFlQSExFU1NfR0xZUEg6CisgICAgICBpZiAocy0+Zm9yX292ZXJsYXBzKQorICAgICAgICBzLT5i YWNrZ3JvdW5kX2ZpbGxlZF9wID0gdHJ1ZTsKKyAgICAgIGVsc2UKKyAgICAgICAgeF9kcmF3X2ds eXBoX3N0cmluZ19iYWNrZ3JvdW5kIChzLCB0cnVlKTsKKyAgICAgIHhfZHJhd19nbHlwaGxlc3Nf Z2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHMpOworICAgICAgYnJlYWs7CisgICAgZGVmYXVsdDoK KyAgICAgIGVtYWNzX2Fib3J0ICgpOworICAgIH0KKyAgaWYgKCFzLT5mb3Jfb3ZlcmxhcHMpCisg ICAgeworICAgICAgLyogRHJhdyB1bmRlcmxpbmUuICovCisgICAgICBpZiAocy0+ZmFjZS0+dW5k ZXJsaW5lX3ApCisgICAgICAgIHsKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3R5 cGUgPT0gRkFDRV9VTkRFUl9XQVZFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAo cy0+ZmFjZS0+dW5kZXJsaW5lX2RlZmF1bHRlZF9wKQorICAgICAgICAgICAgICAgIHhfZHJhd191 bmRlcndhdmUgKHMpOworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgWEdDVmFsdWVzIHhnY3Y7CisgICAgICAgICAgICAgICAgICBYR2V0R0NW YWx1ZXMgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMtPmdjLCBHQ0ZvcmVncm91bmQsICZ4Z2N2 KTsKKyAgICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKHMt PmYpLCBzLT5nYywgcy0+ZmFjZS0+dW5kZXJsaW5lX2NvbG9yKTsKKyAgICAgICAgICAgICAgICAg IHhfZHJhd191bmRlcndhdmUgKHMpOworICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQg KEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMtPmdjLCB4Z2N2LmZvcmVncm91bmQpOworICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmIChzLT5mYWNlLT51 bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgICB7CisgICAgICAg ICAgICAgIHVuc2lnbmVkIGxvbmcgdGhpY2tuZXNzLCBwb3NpdGlvbjsKKyAgICAgICAgICAgICAg aW50IHk7CisgICAgICAgICAgICAgIGlmIChzLT5wcmV2ICYmIHMtPnByZXYtPmZhY2UtPnVuZGVy bGluZV9wCisgICAgICAgICAgICAgICAgICAmJiBzLT5wcmV2LT5mYWNlLT51bmRlcmxpbmVfdHlw ZSA9PSBGQUNFX1VOREVSX0xJTkUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg ICAgLyogV2UgdXNlIHRoZSBzYW1lIHVuZGVybGluZSBzdHlsZSBhcyB0aGUgcHJldmlvdXMgb25l LiAqLworICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gcy0+cHJldi0+dW5kZXJsaW5lX3Ro aWNrbmVzczsKKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gcy0+cHJldi0+dW5kZXJsaW5l X3Bvc2l0aW9uOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgdW5kZXJsaW5lIHRoaWNr bmVzcy4gIERlZmF1bHQgaXMgMSBwaXhlbC4gKi8KKyAgICAgICAgICAgICAgICAgIGlmIChzLT5m b250ICYmIHMtPmZvbnQtPnVuZGVybGluZV90aGlja25lc3MgPiAwKQorICAgICAgICAgICAgICAg ICAgICB0aGlja25lc3MgPSBzLT5mb250LT51bmRlcmxpbmVfdGhpY2tuZXNzOworICAgICAgICAg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAxOworICAgICAg ICAgICAgICAgICAgaWYgKHhfdW5kZXJsaW5lX2F0X2Rlc2NlbnRfbGluZSkKKyAgICAgICAgICAg ICAgICAgICAgcG9zaXRpb24gPSAocy0+aGVpZ2h0IC0gdGhpY2tuZXNzKSAtIChzLT55YmFzZSAt IHMtPnkpOworICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgICAgICAgLyogR2V0IHRoZSB1bmRlcmxpbmUgcG9zaXRpb24uICBUaGlz IGlzIHRoZSByZWNvbW1lbmRlZAorICAgICAgICAgICAgICAgICAgICAgICAgIHZlcnRpY2FsIG9m ZnNldCBpbiBwaXhlbHMgZnJvbSB0aGUgYmFzZWxpbmUgdG8gdGhlIHRvcCBvZgorICAgICAgICAg ICAgICAgICAgICAgICAgIHRoZSB1bmRlcmxpbmUuICBUaGlzIGlzIGEgc2lnbmVkIHZhbHVlIGFj Y29yZGluZyB0byB0aGUKKyAgICAgICAgICAgICAgICAgICAgICAgICBzcGVjcywgYW5kIGl0cyBk ZWZhdWx0IGlzCisgICAgICAgICAgICAgICAgICAgICAgICAgUk9VTkQgKChtYXhpbXVtIGRlc2Nl bnQpIC8gMiksIHdpdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICBST1VORCh4KSA9IGZsb29y ICh4ICsgMC41KSAgKi8KKyAgICAgICAgICAgICAgICAgICAgICBpZiAoeF91c2VfdW5kZXJsaW5l X3Bvc2l0aW9uX3Byb3BlcnRpZXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcy0+Zm9u dCAmJiBzLT5mb250LT51bmRlcmxpbmVfcG9zaXRpb24gPj0gMCkKKyAgICAgICAgICAgICAgICAg ICAgICAgIHBvc2l0aW9uID0gcy0+Zm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uOworICAgICAgICAg ICAgICAgICAgICAgIGVsc2UgaWYgKHMtPmZvbnQpCisgICAgICAgICAgICAgICAgICAgICAgICBw b3NpdGlvbiA9IChzLT5mb250LT5kZXNjZW50ICsgMSkgLyAyOworICAgICAgICAgICAgICAgICAg ICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gdW5kZXJsaW5lX21p bmltdW1fb2Zmc2V0OworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBw b3NpdGlvbiA9IG1heCAocG9zaXRpb24sIHVuZGVybGluZV9taW5pbXVtX29mZnNldCk7CisgICAg ICAgICAgICAgICAgfQorICAgICAgICAgICAgICAvKiBDaGVjayB0aGUgc2FuaXR5IG9mIHRoaWNr bmVzcyBhbmQgcG9zaXRpb24uICBXZSBzaG91bGQKKyAgICAgICAgICAgICAgICAgYXZvaWQgZHJh d2luZyB1bmRlcmxpbmUgb3V0IG9mIHRoZSBjdXJyZW50IGxpbmUgYXJlYS4gKi8KKyAgICAgICAg ICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQgPD0gcy0+eWJhc2UgKyBwb3NpdGlvbikKKyAgICAg ICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5oZWlnaHQgLSAxKSAtIChzLT55YmFzZSAtIHMtPnkp OworICAgICAgICAgICAgICBpZiAocy0+eSArIHMtPmhlaWdodCA8IHMtPnliYXNlICsgcG9zaXRp b24gKyB0aGlja25lc3MpCisgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gKHMtPnkgKyBzLT5o ZWlnaHQpIC0gKHMtPnliYXNlICsgcG9zaXRpb24pOworICAgICAgICAgICAgICBzLT51bmRlcmxp bmVfdGhpY2tuZXNzID0gdGhpY2tuZXNzOworICAgICAgICAgICAgICBzLT51bmRlcmxpbmVfcG9z aXRpb24gPSBwb3NpdGlvbjsKKyAgICAgICAgICAgICAgeSA9IHMtPnliYXNlICsgcG9zaXRpb247 CisgICAgICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3ApCisgICAg ICAgICAgICAgICAgeF9maWxsX3JlY3RhbmdsZSAocy0+Ziwgcy0+Z2MsIHMtPngsIHksIHMtPndp ZHRoLCB0aGlja25lc3MpOworICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgICAgWEdDVmFsdWVzIHhnY3Y7CisgICAgICAgICAgICAgICAgICBYR2V0 R0NWYWx1ZXMgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMtPmdjLCBHQ0ZvcmVncm91bmQsICZ4 Z2N2KTsKKyAgICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkg KHMtPmYpLCBzLT5nYywgcy0+ZmFjZS0+dW5kZXJsaW5lX2NvbG9yKTsKKyAgICAgICAgICAgICAg ICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCB5LCBzLT53aWR0aCwgdGhp Y2tuZXNzKTsKKyAgICAgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BM QVkgKHMtPmYpLCBzLT5nYywgeGdjdi5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIC8qIERyYXcgb3ZlcmxpbmUuICovCisgICAg ICBpZiAocy0+ZmFjZS0+b3ZlcmxpbmVfcCkKKyAgICAgICAgeworICAgICAgICAgIHVuc2lnbmVk IGxvbmcgZHkgPSAwLCBoID0gMTsKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+b3ZlcmxpbmVfY29s b3JfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChzLT5mLCBzLT5n Yywgcy0+eCwgcy0+eSArIGR5LCBzLT53aWR0aCwgaCk7CisgICAgICAgICAgZWxzZQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICBYR0NWYWx1ZXMgeGdjdjsKKyAgICAgICAgICAgICAgWEdl dEdDVmFsdWVzIChGUkFNRV9YX0RJU1BMQVkgKHMtPmYpLCBzLT5nYywgR0NGb3JlZ3JvdW5kLCAm eGdjdik7CisgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKHMt PmYpLCBzLT5nYywgcy0+ZmFjZS0+b3ZlcmxpbmVfY29sb3IpOworICAgICAgICAgICAgICB4X2Zp bGxfcmVjdGFuZ2xlIChzLT5mLCBzLT5nYywgcy0+eCwgcy0+eSArIGR5LCBzLT53aWR0aCwgaCk7 CisgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKHMtPmYpLCBz LT5nYywgeGdjdi5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAg LyogRHJhdyBzdHJpa2UtdGhyb3VnaC4gKi8KKyAgICAgIGlmIChzLT5mYWNlLT5zdHJpa2VfdGhy b3VnaF9wKQorICAgICAgICB7CisgICAgICAgICAgdW5zaWduZWQgbG9uZyBoID0gMTsKKyAgICAg ICAgICB1bnNpZ25lZCBsb25nIGR5ID0gKHMtPmhlaWdodCAtIGgpIC8gMjsKKyAgICAgICAgICBp ZiAocy0+ZmFjZS0+c3RyaWtlX3Rocm91Z2hfY29sb3JfZGVmYXVsdGVkX3ApCisgICAgICAgICAg ICB4X2ZpbGxfcmVjdGFuZ2xlIChzLT5mLCBzLT5nYywgcy0+eCwgcy0+eSArIGR5LCBzLT53aWR0 aCwgaCk7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBYR0NW YWx1ZXMgeGdjdjsKKyAgICAgICAgICAgICAgWEdldEdDVmFsdWVzIChGUkFNRV9YX0RJU1BMQVkg KHMtPmYpLCBzLT5nYywgR0NGb3JlZ3JvdW5kLCAmeGdjdik7CisgICAgICAgICAgICAgIFhTZXRG b3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKHMtPmYpLCBzLT5nYywgcy0+ZmFjZS0+c3RyaWtl X3Rocm91Z2hfY29sb3IpOworICAgICAgICAgICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChzLT5mLCBz LT5nYywgcy0+eCwgcy0+eSArIGR5LCBzLT53aWR0aCwgaCk7CisgICAgICAgICAgICAgIFhTZXRG b3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKHMtPmYpLCBzLT5nYywgeGdjdi5mb3JlZ3JvdW5k KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgLyogRHJhdyByZWxpZWYgaWYgbm90 IHlldCBkcmF3bi4gKi8KKyAgICAgIGlmICghcmVsaWVmX2RyYXduX3AgJiYgcy0+ZmFjZS0+Ym94 ICE9IEZBQ0VfTk9fQk9YKQorICAgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfYm94IChzKTsK KyAgICAgIGlmIChzLT5wcmV2KQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGdseXBoX3N0 cmluZyAqcHJldjsKKyAgICAgICAgICBmb3IgKHByZXYgPSBzLT5wcmV2OyBwcmV2OyBwcmV2ID0g cHJldi0+cHJldikKKyAgICAgICAgICAgIGlmIChwcmV2LT5obCAhPSBzLT5obAorICAgICAgICAg ICAgICAgICYmIHByZXYtPnggKyBwcmV2LT53aWR0aCArIHByZXYtPnJpZ2h0X292ZXJoYW5nID4g cy0+eCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIEFzIHByZXYgd2FzIGRy YXduIHdoaWxlIGNsaXBwZWQgdG8gaXRzIG93biBhcmVhLCB3ZQorICAgICAgICAgICAgICAgICAg IG11c3QgZHJhdyB0aGUgcmlnaHRfb3ZlcmhhbmcgcGFydCB1c2luZyBzLT5obCBub3cuICovCisg ICAgICAgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIHNhdmUgPSBwcmV2LT5obDsKKyAg ICAgICAgICAgICAgICBwcmV2LT5obCA9IHMtPmhsOworICAgICAgICAgICAgICAgIG1jX3hfc2V0 X2dseXBoX3N0cmluZ19nYyAocHJldiwgY3Vyc29yX2djX3ApOworICAgICAgICAgICAgICAgIHhf c2V0X2dseXBoX3N0cmluZ19jbGlwcGluZ19leGFjdGx5IChzLCBwcmV2KTsKKyAgICAgICAgICAg ICAgICBpZiAocHJldi0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSCkKKyAgICAgICAg ICAgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocHJldik7CisgICAgICAg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgeF9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9z dHJpbmdfZm9yZWdyb3VuZCAocHJldik7CisgICAgICAgICAgICAgICAgeF9yZXNldF9jbGlwX3Jl Y3RhbmdsZXMgKHByZXYtPmYsIHByZXYtPmdjKTsKKyAgICAgICAgICAgICAgICBwcmV2LT5obCA9 IHNhdmU7CisgICAgICAgICAgICAgICAgcHJldi0+bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICAg ICAgfQorICAgICAgICB9CisgICAgICBpZiAocy0+bmV4dCkKKyAgICAgICAgeworICAgICAgICAg IHN0cnVjdCBnbHlwaF9zdHJpbmcgKm5leHQ7CisgICAgICAgICAgZm9yIChuZXh0ID0gcy0+bmV4 dDsgbmV4dDsgbmV4dCA9IG5leHQtPm5leHQpCisgICAgICAgICAgICBpZiAobmV4dC0+aGwgIT0g cy0+aGwKKyAgICAgICAgICAgICAgICAmJiBuZXh0LT54IC0gbmV4dC0+bGVmdF9vdmVyaGFuZyA8 IHMtPnggKyBzLT53aWR0aCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIEFz IG5leHQgd2lsbCBiZSBkcmF3biB3aGlsZSBjbGlwcGVkIHRvIGl0cyBvd24gYXJlYSwKKyAgICAg ICAgICAgICAgICAgICB3ZSBtdXN0IGRyYXcgdGhlIGxlZnRfb3ZlcmhhbmcgcGFydCB1c2luZyBz LT5obCBub3cuICovCisgICAgICAgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIHNhdmUg PSBuZXh0LT5obDsKKyAgICAgICAgICAgICAgICBuZXh0LT5obCA9IHMtPmhsOworICAgICAgICAg ICAgICAgIG1jX3hfc2V0X2dseXBoX3N0cmluZ19nYyAobmV4dCwgY3Vyc29yX2djX3ApOworICAg ICAgICAgICAgICAgIHhfc2V0X2dseXBoX3N0cmluZ19jbGlwcGluZ19leGFjdGx5IChzLCBuZXh0 KTsKKyAgICAgICAgICAgICAgICBpZiAobmV4dC0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ0hBUl9H TFlQSCkKKyAgICAgICAgICAgICAgICAgIHhfZHJhd19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAo bmV4dCk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgeF9kcmF3X2Nv bXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAobmV4dCk7CisgICAgICAgICAgICAgICAg eF9yZXNldF9jbGlwX3JlY3RhbmdsZXMgKG5leHQtPmYsIG5leHQtPmdjKTsKKyAgICAgICAgICAg ICAgICBuZXh0LT5obCA9IHNhdmU7CisgICAgICAgICAgICAgICAgbmV4dC0+bnVtX2NsaXBzID0g MDsKKyAgICAgICAgICAgICAgICBuZXh0LT5jbGlwX2hlYWQgPSBzLT5uZXh0OworICAgICAgICAg ICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIC8qIFJlc2V0IGNsaXBwaW5nLiAqLworICB4X3Jl c2V0X2NsaXBfcmVjdGFuZ2xlcyAocy0+Ziwgcy0+Z2MpOworICBzLT5udW1fY2xpcHMgPSAwOwor fQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisKKwogLyogRGVmYXVsdCB0byB1c2luZyBYSU0gaWYgYXZhaWxhYmxlLiAgKi8KICNpZmRlZiBV U0VfWElNCiBib29sIHVzZV94aW0gPSB0cnVlOwpAQCAtMTEwOSw2ICsyMDEwLDE2IEBAIHN0YXRp YyB2b2lkCiB4X3VwZGF0ZV9iZWdpbiAoc3RydWN0IGZyYW1lICpmKQogewogICAvKiBOb3RoaW5n IHRvIGRvLiAgKi8KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKworICBmLT5tY191cGRhdGluZ19mcmFtZSA9IGY7CisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKIH0KIAogLyogRHJhdyBhIHZlcnRpY2FsIHdpbmRvdyBib3JkZXIgZnJv bSAoeCx5MCkgdG8gKHgseTEpICAqLwpAQCAtMTI1NCw2ICsyMTY1LDE2IEBAIHhfdXBkYXRlX2Vu ZCAoc3RydWN0IGZyYW1lICpmKQogICBYRmx1c2ggKEZSQU1FX1hfRElTUExBWSAoZikpOwogICB1 bmJsb2NrX2lucHV0ICgpOwogI2VuZGlmCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisv KiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBOVUxMOwor CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiB9CiAKIC8qIFRoaXMgZnVuY3Rpb24gaXMg Y2FsbGVkIGZyb20gdmFyaW91cyBwbGFjZXMgaW4geGRpc3AuYwpAQCAtMTMyMzgsNiArMTQxNTks MjAgQEAgZXh0ZXJuIGZyYW1lX3Bhcm1faGFuZGxlciB4X2ZyYW1lX3Bhcm1faGFuZGxlcnNbXTsK IAogc3RhdGljIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlIHhfcmVkaXNwbGF5X2ludGVyZmFj ZSA9CiAgIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNP UlMgKi8KKworLyogYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGB4dGVybS5jYCBtdXN0IGJlIGlu IHRoZSBleGFjdCBzYW1lIG9yZGVyIGFzIHRoZQorYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGBk aXNwZXh0ZXJuLmhgISAqLworCisgIG1jX3hfZHJhd193aW5kb3dfY3Vyc29yLAorICBtY194X2Ry YXdfZ2x5cGhfc3RyaW5nLAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgeF9m cmFtZV9wYXJtX2hhbmRsZXJzLAogICAgIGd1aV9wcm9kdWNlX2dseXBocywKICAgICBndWlfd3Jp dGVfZ2x5cGhzLAo= --Multipart_Wed_Mar__4_01:03:10_2020-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs / fill-column). References: <m2oaayavh1.wl%esq@HIDDEN> In-Reply-To: <m2oaayavh1.wl%esq@HIDDEN> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sat, 02 May 2020 20:51:02 +0000 Resent-Message-ID: <handler.22873.B22873.158845262723943 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22873 <at> debbugs.gnu.org,17684 <at> debbugs.gnu.org Cc: mbork@HIDDEN, rms@HIDDEN, johnw@HIDDEN, akioburns@HIDDEN, eliz@HIDDEN, drew.adams@HIDDEN Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.158845262723943 (code B ref 22873); Sat, 02 May 2020 20:51:02 +0000 Received: (at 22873) by debbugs.gnu.org; 2 May 2020 20:50:27 +0000 Received: from localhost ([127.0.0.1]:54039 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1jUz5f-0006E7-KO for submit <at> debbugs.gnu.org; Sat, 02 May 2020 16:50:27 -0400 Received: from gateway23.websitewelcome.com ([192.185.49.180]:22606) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1jUz5d-0006Dt-4z for 22873 <at> debbugs.gnu.org; Sat, 02 May 2020 16:50:25 -0400 Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway23.websitewelcome.com (Postfix) with ESMTP id 723CC4693 for <22873 <at> debbugs.gnu.org>; Sat, 2 May 2020 15:50:24 -0500 (CDT) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id Uz5bjKJ8ZAGTXUz5bjc1eg; Sat, 02 May 2020 15:50:24 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Cc :To:From:Message-ID:Date:Sender:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=HLFRezrTpY4JbBgS2M+WUQJZ2G1e2V5RsdDdOTePI3k=; b=mLktv8Qt0Zhga0YUSFVyY8nrhi b4xH1++VTKurNKVHcMuxEbaU88VXiXQUK/2QeBPQc/6COcFYWcdqS9kbqNyvNF++FyMJA22Y58BRt kkB4T5z4vqeSCpV33GPSg5wigQWXmDKN2TmPribSvAqk/rWcUzPdfmvFO159KMCe1aGgExoSaynAa 7T9hNS8D5LWGfMTXjcr4Nnr/SIHxgSONcwsUrbQgPzAhHDGQ++O2nHhbbnxenaRgXReJPewZdZ+JJ S/GST6wX/pIpBcqqQeEUvpeAd4EYhdMLIxtDYFYY9EVyt6nIGmkw2etr+l3YKZChtpKwsmQ5A3Wis qkapojPQ==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:53077 helo=server.private) by gator3053.hostgator.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from <esq@HIDDEN>) id 1jUz5X-003qAY-OE; Sat, 02 May 2020 15:50:22 -0500 Date: Sat, 02 May 2020 13:50:18 -0700 Message-ID: <m2wo5uoyd1.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Sat_May__2_13:50:18_2020-1" Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1jUz5X-003qAY-OE X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.private) [45.48.239.195]:53077 X-Source-Auth: lawlist X-Email-Count: 8 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> --Multipart_Sat_May__2_13:50:18_2020-1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit VERSION: 022.008 [05/02/2020] CHANGELOG: - Calculate and set it->lnum when both NILP (Vdisplay_line_numbers) and features 22873 / 17684 are active. Line numbers are now recorded in the struct of each glyph: glyph->lnum = it->lnum. The cache of multiple fake cursors has been revised to also record the lnum of each fake cursor. The recorded lnum is used to test for a `same_p` fake cursor situation; i.e., whether fake cursors should be erased and/or redrawn. . The lnum is needed for an apparently uncommon, but nevertheless reproducible situation wherein a screen line is added/deleted and there are two or more subsequent consecutive lines having the same content; and, the character(s) added/deleted is/are the same size/shape of the subsequent consecutive screen lines. `mc_update_window_erase' will erase a fake cursor on one of those subsequent consecutive lines depending upon whether the a screen line above is added/deleted. With the unique exception of the recorded lnum, all other data in the cache of fake cursors will be identical as to one of those subsequent consecutive screen lines. . EXAMPLE (word-wrap is non-nil) -- modification of the first paragraph by adding/ deleting the word "boy" causes the screen line containing only the word group "fudge." to be added/deleted. The fake cursor for the first _or_ second line containing "~//" will be erased, but the fake cursor for said line will not be redrawn by `mc_helper' unless the lnum data was previously used by `mc_update_window_erase' to make a the `same_p` determination. In other words, the fake cursor at isue would be `same_p` _without_ using the lnum data, but is `!same_p` when we use the lnum data. Every good boy | deserves fudge. Every good boy deserves fudge. Every good ↩ boy deserves fudge.| Every good boy deserves fudge. Every good boy deserves ↩ fudge. | | ~// | <=== This fake cursor IF adding the whole word "boy" with redo; ~// | <=== or, this fake cursor IF deleting the whole word "boy". . The performance hit is zero when built-in line numbers are active, but perhaps mildly detectable when built-in line numbers are turned off. Although line numbers are not being generated on the glass in the latter situation, Emacs will nevertheless be calling `display_count_lines_visually/logically' at the same locations as if the built-in line numbers were turned on. . When `mc_update_text_area' processes the line containing the fake cursor that needs to be redrawn, the line is deemed to be UNCHANGED. `clear_end_of_line' is not triggered and no floating fake cursors are redrawn based thereon. This analysis was helpful in narrowing down the issue to the need for the lnum data as described hereinabove. VIDEOS: w32: https://youtu.be/r3BdJVlsAnQ ns: https://youtu.be/bc1h8jtbXmw x11: https://youtu.be/aCIFhD2Xz5s SCREENSHOTS: https://www.lawlist.com/images/22873_17684_light_dark_backgrounds.png SETUP: Step 1: git clone -b master git://git.sv.gnu.org/emacs.git Step 2: Due to lack of free time available to dedicate to the development of features 22873 / 17684, applicability of the patch to the master branch is frozen at 07/14/2019: ac57c5093829ee09084c562bbbc1c412179be13d In the new emacs repository folder, execute a hard reset to 07/14/2019: git reset --hard ac57c5093829ee09084c562bbbc1c412179be13d Step 3: From within the new emacs folder created in Step 1, apply the patch: git apply /path/to/the/patch.diff Step 4: ./autogen.sh Step 5: ./configure ... [your custom options] Step 6: make Step 7: make install USAGE: - For a minimal working example of built-in fake cursors, type: M-x mc-test ;;; TURN ON FAKE CURSORS (buffer position, cursor-type, cursor color): (setq mc-conf '((1 "hbar" "magenta") (2 "bar" "purple") (3 "box" "#00FF00") (4 "hollow" "#0000FF") (5 ("hbar" 3) [1.0 0.0 1.0]) (6 ("bar" 3) [0.0 1.0 1.0]) (7 "framed" "OrangeRed"))) ;;; TURN OFF FAKE CURSORS: (setq mc-conf nil) - To try out both the crosshairs feature and the visible fill column indicator feature, type: M-x +-mode - To try out just the visible fill column indicator feature, type: M-x fc-mode - To try out built-in fake cursors with Magnar Sveen's multiple-cursors package, that package must be installed. If the multiple-cursors package is already installed, then just (require '+-mode) and `+-mode.el` will redefine a few of the multiple-cursors functions and set up a few keyboard shortcuts. If the multiple-cursors package by Magnar Sveen is not already installed, then here are two easy ways to install that package: Type: M-x mc-install OR, evaluate the following snippet: (progn (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t) (package-initialize) (package-refresh-contents) (package-install 'multiple-cursors) (mc/built-in-cursors)) NOTES: - Our journey begins at the outset of `update_window' when `mc_update_window_dryrun' performs a `!draw_p` simulation to create a new cache of fake cursors that are stored in the `w->mc_matrix`. The cache of fake cursors from the previous redisplay is copied to a temporary `mc_matrix` under the name of `old_matrix`. `mc_update_text_area' (used for `!draw_p` / `draw_p` situations) calls `mc_draw_glyphs' (writes glyphs to the glass) followed by `mc_draw_row' (writes fake cursors to the glass immediately thereafter). At the tail end of `mc_update_window_dryrun', `mc_update_window_erase' compares the new `w->mc_matrix` with the `old_matrix` to determine which fake cursors are the same -- setting the `same_p` boolean struct member accordingly for each applicable fake cursor within the `w->mc_matrix`. All fake cursors in the `old_matrix` that are `!same_p` get erased at this juncture. [Fn 1.] After the dryrun is complete, `update_window' does the real thing -- `draw_p`. As to the `from_where` situations of SKIPPED, POST_CHANGED, UNCHANGED, and SET_CURSOR_TWO, `mc_helper' compares the incoming tentative fake cursor with the `w->mc_matrix` to see if it has previously been marked as `same_p` -- if it is `!same_p`, then the fake cursor is drawn and we `return`. Fake cursors that have a `cursor_type` of MC_LEFT_FRINGE_BITMAP or MC_RIGHT_FRINGE_BITMAP are always reset even if they are `same_p`. As to the `from_where` situations of SCRIBE_ONE, SCRIBE_TWO, SCRIBE_THREE, and NOWHERE, `mc_helper' always causes fake cursors to be drawn (because new glyphs were written to the glass, or the area to the right of the display line was cleared) and we `return`. . Fn. 1: Even though writing new glyphs to the glass (SCRIBE_ONE, SCRIBE_TWO, and SCRIBE_THREE) would erase fake cursors within those boundaries, it is still necessary to erase `!same_p` fake cursors prior thereto. This is because `scrolling_window' occurs before new glyphs are written and `rif->scroll_run_hook' may copy one or more rows to other areas of the glass. It is not worth the effort to programmatically track both the _copied_ fake cursors and the _original_ fake cursors from the previous redisplay cycle, whose glyphs may remain where they are in the current redisplay cycle because they satisfy the `GLYPH_EQUAL_P' test. - The rest of our journey takes place wherever `draw_glyphs' would ordinarily be called, excluding `update_text_area'. If features 17684/22873 are active, `mc_redraw_row' calls `mc_draw_glyphs' (writes glyphs to the glass) and fake cursors are written to the glass immediately thereafter (if the coordinates coincide with prerecorded data in the `w->mc_matrix`). The functions containing the aforementioned calls are: . `gui_insert_glyphs' . `gui_fix_overlapping_area' . `draw_row_with_mouse_face' . `expose_area' . `expose_line' . `redraw_overlapped_rows' [which has been incorporated into `update_window'] - As to `mc_scrolling_window', it would appear that there is no tangible benefit to rotating the current/prospective cache of fake cursors to compare the data before removing the fake cursors. When scrolling the display, only _some_ lines are copied to new locations. Areas that are not overwritten may have fake cursors and those may not necessarily be removed if desired/current matrix glyphs are equal. The test for `GLYPH_EQUAL_P' does not take into consideration the existence of a fake cursor, and the glyph (with a fake cursor) may not be updated as a result thereof. As to lines that are not copied, portions may be updated and fake cursors would be removed thereby. `mc_rotate_matrix' and `mc_reverse_vpos' were removed with patch v. 022.002. - NS: As of 09/28/2018 (7946445962372c4255180af45cb7c857f1b0b5fa), the NS port no longer does anything useful during `update_window' except mark dirty rectangles. All drawing is now done when the MacOS calls `drawRect', which in turn calls `expose_frame'. This was done to add support for MacOS Mojave .... TODO: - When an idle-timer fires and point is at the end of a horizontally scrolled line in a narrow window, the temporary horizontal scroll is canceled. Create a minimal working example and file a bug report. (progn (defun test () (interactive) (let ((ov (make-overlay (point) (1+ (point)) nil t t))) (overlay-put ov 'face '(:foreground "red")))) (global-set-key [f5] 'test) (split-window-horizontally) (switch-to-buffer (get-buffer-create "foo")) (setq bidi-display-reordering nil) (setq-local auto-hscroll-mode 'current-line) (dotimes (i 80) (insert (char-to-string (+ 65 i))))) - `ns_draw_window_cursor' calls `ns_clip_to_rect', which does _not_ take `row->clip` into consideration when drawing cursors with `NSRectFill'. When it comes time to draw glyphs on top of the box/hollow family of cursors, `row->clip` is taken into consideration by `get_glyph_string_clip'. Fake cursors can be drawn even though the glyphs cannot, resulting in hollow/box family of cursors without text. The issue can be reproduced with M-x mc-test. [A temporary workaround is to disable `row->clip` while drawing the glyphs.] https://lists.gnu.org/archive/html/emacs-devel/2019-04/msg00009.html - Deal with left/right overwritten glyphs in the w32 and X ports of Emacs. - The current test for `auto_hscroll_mode_p' only looks for `current_line` and all five related tests are based upon that assumption, which may not be true. - Multiple Cursors: If point is in the middle of a composite character, then select a fully composed character so that the fake cursor is visible. - Implement functionality similar to the Lisp multiple-cursors by Magnar Sveen. - Follow up with the Emacs team re bug#32177; i.e., (Current line number shifts one column to the left.) - Follow up with the Emacs team re bug#32060; i.e., Horizontal Scrolling (Current Line): Wrong line gets h-scrolled. - Determine if bug #28936 needs to be fixed and help the Emacs team re same. - Is there any additional meaningful optimization that can be added to the three calls of `mc_pre_scroll_clean'? - There is a bug affecting an older version of Emacs for the NS port that causes partial line flickering when the same characters are grouped together (;;;;;;) and MC_GLYPHLESS cursors are above or below -- having the same background color as the frame; e.g., black on black (used to erase a glyphless cursor). The partial flickering is only noticeable with rapid fire; e.g., holding down the right/left arrow key. When changing the color of the glyphless cursor, the issue is not present. [@lawlist has verified that the X and HPOS coordinates are accurate.] --Multipart_Sat_May__2_13:50:18_2020-1 Content-Type: application/diff; type=patch Content-Disposition: attachment; filename="2020_05_02__13_04_51_850.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvKy1tb2RlLmVsIGIvbGlzcC8rLW1vZGUuZWwKbmV3IGZpbGUgbW9k ZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uZjBiN2M4ZQotLS0gL2Rldi9udWxsCisrKyBiL2xpc3Av Ky1tb2RlLmVsCkBAIC0wLDAgKzEsMTI5MiBAQAorOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Cis7 OzsgRVhBTVBMRTogIFVsdHJhbGlnaHQgaW1wbGVtZW50YXRpb24gb2YgYSBob3Jpem9udGFsIHJ1 bGVyLgorOzs7Cis7OzsgKHNldHEgdHJ1bmNhdGUtbGluZXMgdAorOzs7ICAgICAgIGNyb3NzaGFp cnMgdAorOzs7ICAgICAgIGZjLXZpc2libGUgbmlsCis7OzsgICAgICAgY2gtaG9yaXpvbnRhbC1y dWxlciB0Cis7OzsgICAgICAgY2gtdmVydGljYWwtcnVsZXIgbmlsKQorCis7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7 Ozs7Ozs7Ozs7OzsKKzs7OyBCRUdJTiBtb2RpZmljYXRpb24gb2YgdGhlIE11bHRpcGxlIEN1cnNv cnMgbGlicmFyeSB3cml0dGVuIGJ5ICBNYWduYXIgU3ZlZW4uCisKKyhkZWZ2YXIgcGFja2FnZS1h cmNoaXZlcykKKworKGRlZnZhciBtYy0tbWF4LWN1cnNvcnMtb3JpZ2lu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gICAg IChzZXRxIG1jLS1tYXgtY3Vyc29ycy1vcmlnaW5hbCBtYy9tYXgtY3Vyc29ycykpCisgICAgKHdo ZW4gbWMvbWF4LWN1cnNvcnMKKyAgICAgICh1bmxlc3MgKDwgKG1jL251bS1jdXJzb3JzKSBtYy9t YXgtY3Vyc29ycykKKyAgICAgICAgKGlmICh5ZXMtb3Itbm8tcCAoZm9ybWF0ICIlZCBhY3RpdmUg Y3Vyc29ycy4gQ29udGludWU/ICIgKG1jL251bS1jdXJzb3JzKSkpCisgICAgICAgICAgICAoc2V0 cSBtYy9tYXgtY3Vyc29ycyAocmVhZC1udW1iZXIgIkVudGVyIGEgbmV3LCB0ZW1wb3JhcnkgbWF4 aW11bTogIikpCisgICAgICAgICAgKG1jL3JlbW92ZS1mYWtlLWN1cnNvcnMpCisgICAgICAgICAg KGVycm9yICJBYm9ydGVkOiB0b28gbWFueSBjdXJzb3JzIikpKSkKKyAgICAobGV0ICgob3Zlcmxh eQorICAgICAgICAgICAgKGlmIG1jL3VzZS1idWlsdC1pbi1jdXJzb3JzCisgICAgICAgICAgICAg IChtYWtlLW92ZXJsYXkgKHBvaW50KSAocG9pbnQpKQorICAgICAgICAgICAgICAobWMvbWFrZS1j dXJzb3Itb3ZlcmxheS1hdC1wb2ludCkpKSkKKyAgICAgIChvdmVybGF5LXB1dCBvdmVybGF5ICdt Yy1pZCAob3IgaWQgKG1jL2NyZWF0ZS1jdXJzb3ItaWQpKSkKKyAgICAgIChvdmVybGF5LXB1dCBv dmVybGF5ICd0eXBlICdmYWtlLWN1cnNvcikKKyAgICAgIChvdmVybGF5LXB1dCBvdmVybGF5ICdw cmlvcml0eSAxMDApCisgICAgICAobWMvc3RvcmUtY3VycmVudC1zdGF0ZS1pbi1vdmVybGF5IG92 ZXJsYXkpCisgICAgICAod2hlbiAodXNlLXJlZ2lvbi1wKQorICAgICAgICAob3ZlcmxheS1wdXQg b3ZlcmxheSAncmVnaW9uLW92ZXJsYXkKKyAgICAgICAgICAg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ZSBjb21t YW5kIGNvbXBhcmFibGUgYnkgYGVxJy4KKyAgICAgICAgICAgICAgICAoc2V0cSBvcmlnaW5hbC1j b21tYW5kIChpbnRlcm4gKHN5bWJvbC1uYW1lIG9yaWdpbmFsLWNvbW1hbmQpKSkKKyAgICAgICAg ICAgICAgICA7OyBvdGhlcndpc2UgaXQncyBhIHN5bWJvbCwgYW5kIHdlIGNhbiBiZSBtb3JlIHRo b3JvdWdoCisgICAgICAgICAgICAgICAgKGlmIChnZXQgb3JpZ2luYWwtY29tbWFuZCAnbWMtLXVu c3VwcG9ydGVkKQorICAgICAgICAgICAgICAgICAgICAobWVzc2FnZSAiJVMgaXMgbm90IHN1cHBv cnRlZCB3aXRoIG11bHRpcGxlIGN1cnNvcnMlcyIKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgb3JpZ2luYWwtY29tbWFuZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZ2V0IG9y aWdpbmFsLWNvbW1hbmQgJ21jLS11bnN1cHBvcnRlZCkpCisgICAgICAgICAgICAgICAgICAod2hl biAoYW5kIG9yaWdpbmFsLWNvbW1hbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG5v dCAobWVtcSBvcmlnaW5hbC1jb21tYW5kIG1jLS1kZWZhdWx0LWNtZHMtdG8tcnVuLW9uY2UpKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobm90IChtZW1xIG9yaWdpbmFsLWNvbW1hbmQg bWMvY21kcy10by1ydW4tb25jZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChvciBt Yy9hbHdheXMtcnVuLWZvci1hbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICht ZW1xIG9yaWdpbmFsLWNvbW1hbmQgbWMtLWRlZmF1bHQtY21kcy10by1ydW4tZm9yLWFsbCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtZW1xIG9yaWdpbmFsLWNvbW1hbmQgbWMv Y21kcy10by1ydW4tZm9yLWFsbCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICht Yy9wcm9tcHQtZm9yLWluY2x1c2lvbi1pbi13aGl0ZWxpc3Qgb3JpZ2luYWwtY29tbWFuZCkpKQor ICAgICAgICAgICAgICAgICAgICAobWMvZXhlY3V0ZS1jb21tYW5kLWZvci1hbGwtZmFrZS1jdXJz b3JzIG9yaWdpbmFsLWNvbW1hbmQpKSkpCisgICAgICAgICAgICAgICh3aGVuIG1jL3VzZS1idWls dC1pbi1jdXJzb3JzCisgICAgICAgICAgICAgICAgKHNldHEgbWMtY29uZgorICAgICAgICAgICAg ICAgICAgICAgICAgKG1hcGNhcgorICAgICAgICAgICAgICAgICAgICAgICAgICAobGFtYmRhICh4 KSAobGlzdCAob3ZlcmxheS1zdGFydCB4KSAiYmFyIiBuaWwpKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAobWMvYWxsLWZha2UtY3Vyc29ycykpKSkpKSkpKSkKKworICAoZGVmdW4gbWMvbWFy ay1uZXh0LWxpa2UtdGhpcy1jeWNsZS1mb3J3YXJkICgpCisgICJNYXJrcyBuZXh0IG9jY3VyZW5j ZSBvZiB3b3JkIGxpa2UgdGhpcyBhbmQgYWR2YW5jZXMgY3Vyc29yIHRvIHRoaXMgb2NjdXJyZW5j ZSIKKyAgKGludGVyYWN0aXZlKQorICAgIChtYy9tYXJrLW5leHQtbGlrZS10aGlzIDEpKQorCisg IChkZWZ1biBtYy9tYXJrLXByZXZpb3VzLWxpa2UtdGhpcy1jeWNsZS1mb3J3YXJkICgpCisgICJN YXJrcyBuZXh0IG9jY3VycmVuY2Ugb2Ygd29yZCBsaWtlIHRoaXMgYW5kIGFkdmFuY2VzIGN1cnNv ciB0byB0aGlzIG9jY3VycmVuY2UiCisgIChpbnRlcmFjdGl2ZSkKKyAgICAobWMvbWFyay1wcmV2 aW91cy1saWtlLXRoaXMgMSkpCisKKyAgKGFkZC10by1saXN0ICdtYy0tZGVmYXVsdC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IGlzIGRvbmUgaW50ZXJu YWxseSBieQorbXVsdGlwbHlpbmcgZWFjaCBlbGVtZW50IG9mIHRoZSBMU0wgY29sb3IgdmVjdG9y IGJ5IDI1NS4gIGB4dGVybS5jJyB1c2VzCitgeF9tYWtlX3RydWVjb2xvcl9waXhlbCcsIHdoaWNo IHVzZXMgMTYtYml0IFJHQiAtLSB0aGUgY29udmVyc2lvbiBmcm9tIExTTAoraGFwcGVucyBpbnRl cm5hbGx5IGJ5IG11bHRpcGx5aW5nIGVhY2ggZWxlbWVudCBvZiB0aGUgTFNMIGNvbG9yIHZlY3Rv ciBieSA2NTUzNS4iCisoaW50ZXJhY3RpdmUpCisgIChsZXQgKChidWZmZXIgKGdldC1idWZmZXIt Y3JlYXRlICIqTUMtVEVTVCoiKSkpCisgICAgKHdpdGgtY3VycmVudC1idWZmZXIgYnVmZmVyCisg ICAgICAoZXJhc2UtYnVmZmVyKQorICAgICAgKGluc2VydCAiVGhpcyBpcyBhIHRlc3QhIikKKyAg ICAgIChzZXRxIG1jLWNvbmYgJygoMSAiaGJhciIgIm1hZ2VudGEiKQorICAgICAgICAgICAgICAg ICAgICAgICgyICJiYXIiICJwdXJwbGUiKQorICAgICAgICAgICAgICAgICAgICAgICgzICJib3gi ICIjMDBGRjAwIikKKyAgICAgICAgICAgICAgICAgICAgICAoNCAiaG9sbG93IiAiIzAwMDBGRiIp CisgICAgICAgICAgICAgICAgICAgICAgKDUgKCJoYmFyIiAzKSBbMS4wIDAuMCAxLjBdKQorICAg ICAgICAgICAgICAgICAgICAgICg2ICgiYmFyIiAzKSBbMC4wIDEuMCAxLjBdKQorICAgICAgICAg ICAgICAgICAgICAgICg3ICJmcmFtZWQiICJPcmFuZ2VSZWQiKQorICAgICAgICAgICAgICAgICAg ICAgICg4ICJib3giICJncmV5MjUiKQorICAgICAgICAgICAgICAgICAgICAgICg5ICJib3giICJn cmV5NzUiKSkpKQorICAgIChzZWxlY3Qtd2luZG93IChkaXNwbGF5LWJ1ZmZ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5sZXNzIChvciAobWVtcSB0aGlzLWNvbW1hbmQgKy1wYXJlbnMtZXhj bHVzaW9ucykKKyAgICAgICAgICAgICAgICAoYW5kIChudWxsICstcGFyZW5zLWhpZ2hsaWdodCkK KyAgICAgICAgICAgICAgICAgICAgIChudWxsICstcGFyZW5zLW92ZXJsYXlzLWV4aXN0LXApKSkK KyAgICAgICgrLWRlbGV0ZS1wYXJlbnMtb3ZlcmxheXMpKQorICAgIChpZiBmb3JjZQorICAgICAg KHdoZW4gKy1wYXJlbnMtaGlnaGxpZ2h0CisgICAgICAgICgrLXBhcmVucy1mbikpCisgICAgICAo c2V0cSArLXRpbWVyLXZhciAocnVuLXdpdGgtaWRsZS10aW1lciArLWlkbGUtdGltZXItc2Vjb25k cyBuaWwgIycrLXRpbWVyLWZuKSkpKSkKKworKGRlZnZhciBmYy1tb2RlKQorCis7OzsjIyNhdXRv bG9hZAorKGRlZmluZS1taW5vci1tb2RlICstbW9kZQorIk1pbm9yIG1vZGUgZm9yIGRpc3BsYXlp bmcgYSBob3Jpem9udGFsIHJ1bGVyLiIKKyAgOmluaXQtdmFsdWUgbmlsCisgIDpsaWdodGVyICIg KyIKKyAgOmtleW1hcCBuaWwKKyAgOmdsb2JhbCBuaWwKKyAgOmdyb3VwICcrLW1vZGUKKyAgKGNv bmQKKyAgICAoKy1tb2RlCisgICAgICA7OzsgYCstbW9kZScgaGFzIHRoZSBhYmlsaXR5IHRvIGFs c28gZGlzcGxheSBhIGZpbGwgY29sdW1uIGluZGljYXRvci4KKyAgICAgIDs7OyBTZWUgdGhlIHZh cmlhYmxlIGArLWZpbGwtY29sdW1uJy4KKyAgICAgICh3aGVuIGZjLW1vZGUKKyAgICAgICAgKGZj LW1vZGUgLTEpKQorICAgICAgKHdoZW4gKGFuZCBnbG9iYWwtZWxkb2MtbW9kZQorICAgICAgICAg ICAgICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAgICAgICAgICAo ZXF1YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAoZ2xvYmFsLWVsZG9jLW1v ZGUgLTEpKQorICAgICAgKHdoZW4gKGFuZCBqaXQtbG9jay1jb250ZXh0LXRpbWVyCisgICAgICAg ICAgICAgICAgIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAg IChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVuICh0aW1lcnAg aml0LWxvY2stY29udGV4dC10aW1lcikKKyAgICAgICAgICAoY2FuY2VsLXRpbWVyIGppdC1sb2Nr LWNvbnRleHQtdGltZXIpKQorICAgICAgICA7OyAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVy IChydW4td2l0aC1pZGxlLXRpbWVyIDUuMCAncmVwZWF0ICdqaXQtbG9jay1jb250ZXh0LWZvbnRp ZnkpKQorICAgICAgICAoc2V0cSBqaXQtbG9jay1jb250ZXh0LXRpbWVyIG5pbCkpCisgICAgICAo d2hlbiAoYW5kIChjYWxsZWQtaW50ZXJhY3RpdmVseS1wICdhbnkpCisgICAgICAgICAgICAgICAg IChlcXVhbCBjdXJyZW50LXByZWZpeC1hcmcgJyg0KSkpCisgICAgICAgICh3aGVuICh0aW1lcnAg dW5kby1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpCisgICAgICAgICAgKGNhbmNlbC10aW1l ciB1bmRvLWF1dG8tY3VycmVudC1ib3VuZGFyeS10aW1lcikpCisgICAgICAgIChmc2V0ICd1bmRv LWF1dG8tLXVuZG9hYmxlLWNoYW5nZQorICAgICAgICAgICAgICAobGFtYmRhICgpIChhZGQtdG8t bGlzdCAndW5kby1hdXRvLS11bmRvYWJseS1jaGFuZ2VkLWJ1ZmZlcnMgKGN1cnJlbnQtYnVmZmVy KSkpKQorICAgICAgICAoZnNldCAndW5kby1hdXRvLWFtYWxnYW1hdGUgJ2lnbm9yZSkpCisgICAg ICAod2hlbiB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IG5vdCB3YW50IHRoaXMgcGFy dGljdWxhciBzZXR0aW5nLgorICAgICAgKHVubGVzcyAobnVsbCBiaWRpLWRpc3BsYXktcmVvcmRl cmluZykKKyAgICAgICAgKHNldHEgYmlkaS1kaXNwbGF5LXJlb3JkZXJpbmcgbmlsKSkKKyAgICAg IChzZXQgKG1ha2UtbG9jYWwtdmFyaWFibGUgJystLXNhdmVkLXN0YXRlKSBuaWwpCisgICAgICAo ZG9saXN0ICh2YXIgJyhidWZmZXItZGlzcGxheS10YWJsZQorICAgICAgICAgICAgICAgICAgICAg ZnJpbmdlLWluZGljYXRvci1hbGlzdAorICAgICAgICAgICAgICAgICAgICAgdGFiLXdpZHRoCisg ICAgICAgICAgICAgICAgICAgICBsaW5lLW1vdmUtdmlzdWFsCisgICAgICAgICAgICAgICAgICAg ICB0cnVuY2F0ZS1saW5lcworICAgICAgICAgICAgICAgICAgICAgdHJ1bmNhdGUtcGFydGlhbC13 aWR0aC13aW5kb3dzCisgICAgICAgICAgICAgICAgICAgICB3b3JkLXdyYXApKQorICAgICAgICAo d2hlbiAobG9jYWwtdmFyaWFibGUtcCB2YXIpCisgICAgICAgICAgKHB1c2ggKGNvbnMgdmFyIChz eW1ib2wtdmFsdWUgdmFyKSkgKy0tc2F2ZWQtc3RhdGUpKSkKKyAgICAgIChzZXRxIGZpbGwtY29s dW1uIDgwKQorICAgICAgKHNldHEgZGlzcGxheS1saW5lLW51bWJlcnMgdCkKKyAgICAgIChzZXRx LWxvY2FsIGF1dG8taHNjcm9sbC1tb2RlICdjdXJyZW50LWxpbmUpCisgICAgICAoc2V0cS1sb2Nh bCBoc2Nyb2xsLXN0ZXAgNSkKKyAgICAgIChzZXRxIGJ1ZmZlci1kaXNwbGF5LXRhYmxlICstYnVm ZmVyLWRpc3BsYXktdGFibGUpCisgICAgICAoc2V0cSB0YWItd2lkdGggNCkKKyAgICAgIChzZXQg KG1ha2UtbG9jYWwtdmFyaWFibGUgJ2xpbmUtbW92ZS12aXN1YWwpIHQpCisgICAgICAoc2V0cSB0 cnVuY2F0ZS1saW5lcworICAgICAgICAoY29uZAorICAgICAgICAgICgobGV0ICgobHN0ICstdHJ1 bmNhdGUtbGluZXMtZGVyaXZlZC1tb2RlcykKKyAgICAgICAgICAgICAgICAgIG1vZGUpCisgICAg ICAgICAgICAoY2F0Y2ggJ2ZvdW5kCisgICAgICAgICAgICAgICh3aGlsZSAoc2V0cSBtb2RlIChw b3AgbHN0KSkKKyAgICAgICAgICAgICAgICAod2hlbiAoZGVyaXZlZC1tb2RlLXAgbW9kZSkKKyAg ICAgICAgICAgICAgICAgICh0aHJvdyAnZm91bmQgdCkpKSkpKQorICAgICAgICAgICAoKG1lbXEg bWFqb3ItbW9kZSArLXRydW5jYXRlLWxpbmVzLW1ham9yLW1vZGVzKSkKKyAgICAgICAgICAgKHQK KyAgICAgICAgICAgICBuaWwpKSkKKyAgICAgIChzZXQgKG1ha2UtbG9jYWwtdmFyaWFibGUgJ3Ry dW5jYXRlLXBhcnRpYWwtd2lkdGgtd2luZG93cykgbmlsKQorICAgICAgKHNldHEgd29yZC13cmFw IHQpCisgICAgICAoc2V0cSBpbmRpY2F0ZS1lbXB0eS1saW5lcyB0KQorICAgICAgKHNldHEgaW5k aWNhdGUtYnVmZmVyLWJvdW5kYXJpZXMgJ2xlZnQpCisgICAgICAoc2V0cSBmcmluZ2UtaW5kaWNh dG9yLWFsaXN0CisgICAgICAgICAgOzs7IGhzY2xfYWxsX3RlbXBfcCB8IGhzY2xfdGVtcF9wCisg ICAgICAgICcoKCstaHNjbC10ZW1wIC4gKCstc2luZ2xlLWFuZ2xlLWxlZnQKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgKy1kb3VibGUtYW5nbGUtbGVmdCkpCisgICAgICAgICAgOzs7IGhzY2xf YWxsX3Blcm1fMF9wIHwgaHNjbF9hbGxfcGVybV8xX3AgfCBoc2NsX2FsbF9wZXJtXzJfcCB8IGhz Y2xfcGVybV9wCisgICAgICAgICAgKCstaHNjbC1wZXJtIC4gKCstc2luZ2xlLWFuZ2xlLXVwCisg ICAgICAgICAgICAgICAgICAgICAgICAgICstZG91YmxlLWFuZ2xlLXVwCisgICAgICAgICAgICAg ICAgICAgICAgICAgICstdHJpcGxlLWFuZ2xlLXVwCisgICAgICAgICAgICAgICAgICAgICAgICAg ICstcXVhZHJ1cGxlLWFuZ2xlLXVwKSkKKyAgICAgICAgICAoKy1vdmVybGF5LWFycm93IC4gKCst ZnJpbmdlLWxlZnQtYXJyb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICstZnJpbmdl LXJpZ2h0LWFycm93KSkKKyAgICAgICAgICAodHJ1bmNhdGlvbiAuICgrLWZyaW5nZS1sZWZ0LWFy cm93CisgICAgICAgICAgICAgICAgICAgICAgICAgKy1mcmluZ2UtcmlnaHQtYXJyb3cpKQorICAg ICAgICAgIChjb250aW51YXRpb24gLiAoKy1mcmluZ2UtbGVmdC1jdXJseS1hcnJvdworICAgICAg ICAgICAgICAgICAgICAgICAgICAgKy1iYWNrc2xhc2gpKQorICAgICAgICAgIChvdmVybGF5LWFy cm93IC4gKy1mcmluZ2UtcmlnaHQtdHJpYW5nbGUpCisgICAgICAgICAgKHVwIC4gKy1mcmluZ2Ut dXAtYXJyb3cpCisgICAgICAgICAgKGRvd24gLiArLWZyaW5nZS1kb3duLWFycm93KQorICAgICAg ICAgICh0b3AgLiArLWZyaW5nZS10b3AtbGVmdC1hbmdsZSkKKyAgICAgICAgICAoYm90dG9tIC4g Ky1mcmluZ2UtYm90dG9tLXJpZ2h0LWFuZ2xlKQorICAgICAgICAgICh0b3AtYm90dG9tIC4gKCst ZnJpbmdlLWxlZnQtYnJhY2tldAorICAgICAgICAgICAgICAgICAgICAgICAgICstZnJpbmdlLXJp Z2h0LWJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICArLWZyaW5nZS10b3AtcmlnaHQt YW5nbGUKKyAgICAgICAgICAgICAgICAgICAgICAgICArLWZyaW5nZS10b3AtbGVmdC1hbmdsZSkp CisgICAgICAgICAgKGVtcHR5LWxpbmUgLiArLWZyaW5nZS1lbXB0eS1saW5lKQorICAgICAgICAg ICh1bmtub3duIC4gKy1mcmluZ2UtcXVlc3Rpb24tbWFyaykpKQorICAgICAgKHNldHEgZnJpbmdl LWN1cnNvci1hbGlzdCAnKChib3ggLiArLWZyaW5nZS1sZWZ0LXRyaWFuZ2xlKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIChob2xsb3cgLiArLWhvbGxvdy1yZWN0YW5nbGUpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGJhciAuICstdmVydGljYWwtYmFyKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChoYmFyIC4gKy1mcmluZ2UtaG9yaXpv bnRhbC1iYXIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGhvbGxvdy1zbWFs bCAuICstZnJpbmdlLWhvbGxvdy1zcXVhcmUpKSkKKyAgICAgIChpZiAob3IgKy1mb3J0aHdpdGgK KyAgICAgICAgICAgICAgKGVxdWFsIGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAgICAgICAg KGFkZC1ob29rICdwb3N0LWNvbW1hbmQtaG9vayAnKy1kcmF3LWZvcnRod2l0aCAnYXBwZW5kICds b2NhbCkKKyAgICAgICAgKGFkZC1ob29rICdwb3N0LWNvbW1hbmQtaG9vayAnKy1kcmF3LWNyb3Nz aGFpcnMgJ2FwcGVuZCAnbG9jYWwpKQorICAgICAgKHdoZW4gKy1mb3J0aHdpdGgKKyAgICAgICAg KGFkZC1ob29rICd3aW5kb3ctY29uZmlndXJhdGlvbi1jaGFuZ2UtaG9vayAnKy1kcmF3LWZvcnRo d2l0aCBuaWwgJ2xvY2FsKSkKKyAgICAgIChhZGQtaG9vayAnY2hhbmdlLW1ham9yLW1vZGUtaG9v ayAndHVybi1vZmYtKy1tb2RlIG5pbCAnbG9jYWwpCisgICAgICA7Ozs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ZGVmdW4g Ky1wYXJlbnMtZm4gKCkKKyAgIkRvYy1zdHJpbmcuIgorICAobGV0KiAoKG9wb2ludCAocG9pbnQp KQorICAgICAgICAgKGZyb20gKGlmICstcGFyZW5zLWZyb20tZm4KKyAgICAgICAgICAgICAgICAg KGZ1bmNhbGwgKy1wYXJlbnMtZnJvbS1mbikKKyAgICAgICAgICAgICAgICAgKHBvaW50LW1pbikp KQorICAgICAgICAgKHdpbiAoc2VsZWN0ZWQtd2luZG93KSkKKyAgICAgICAgIChpIDApCisgICAg ICAgICAocHJlY2VkaW5nLWNoYXIgKHByZWNlZGluZy1jaGFyKSkKKyAgICAgICAgIChvY2hhciAo Y2hhci1hZnRlciBvcG9pbnQpKQorICAgICAgICAgKHBvczEKKyAgICAgICAgICAgKGNvbmQKKyAg ICAgICAgICAgICAoKGFuZCBvY2hhcgorICAgICAgICAgICAgICAgICAgIChvciA7OzsgKGNoYXIt dG8tc3RyaW5nIDQwKSA9PiBvcGVuaW5nIHBhcmVudGhlc2lzCisgICAgICAgICAgICAgICAgICAg ICAgICg9IG9jaGFyIDQwKQorICAgICAgICAgICAgICAgICAgICAgICA7OzsgKGNoYXItdG8tc3Ry aW5nIDkxKSA9PiBvcGVuaW5nIHNxdWFyZSBicmFja2V0CisgICAgICAgICAgICAgICAgICAgICAg ICg9IG9jaGFyIDkxKQorICAgICAgICAgICAgICAgICAgICAgICA7OzsgKGNoYXItdG8tc3RyaW5n IDEyMykgPT4gb3BlbmluZyB3YXZ5IGJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICAgICAgKD0g b2NoYXIgMTIzKSkpCisgICAgICAgICAgICAgICAgKG1pbiAoMSsgb3BvaW50KSAocG9pbnQtbWF4 KSkpCisgICAgICAgICAgICAgKChvciA7OzsgKGNoYXItdG8tc3RyaW5nIDQxKSA9PiBjbG9zaW5n IHBhcmVudGhlc2lzCisgICAgICAgICAgICAgICAgICAoPSBwcmVjZWRpbmctY2hhciA0MSkKKyAg ICAgICAgICAgICAgICAgIDs7OyAoY2hhci10by1zdHJpbmcgOTMpID0+IGNsb3Npbmcgc3F1YXJl IGJyYWNrZXQKKyAgICAgICAgICAgICAgICAgICg9IHByZWNlZGluZy1jaGFyIDkzKQorICAgICAg ICAgICAgICAgICAgOzs7IChjaGFyLXRvLXN0cmluZyAxMjUpID0+IGNsb3Npbmcgd2F2eSBicmFj a2V0CisgICAgICAgICAgICAgICAgICAoPSBwcmVjZWRpbmctY2hhciAxMjUpKQorICAgICAgICAg ICAgICAgIChtYXggKHBvaW50LW1pbikgKDEtIG9wb2ludCkpKQorICAgICAgICAgICAgICh0Cisg ICAgICAgICAgICAgICAgb3BvaW50KSkpCisgICAgICAgICBwb3MyCisgICAgICAgICBzZWxlY3Rl ZC1mYWNlKQorICAgIChzYXZlLWV4Y3Vyc2lvbgorICAgICAgKGNvbmRpdGlvbi1jYXNlIG5pbAor ICAgICAgICAod2hpbGUgKHNldHEgcG9zMSAobnRoIDEgKHBhcnNlLXBhcnRpYWwtc2V4cCBmcm9t IHBvczEpKSkKKyAgICAgICAgICAoc2V0cSBwb3MyIChzY2FuLXNleHBzIHBvczEgMSkpCisgICAg ICAgICAgKGlmICg9IGkgMTApCisgICAgICAgICAgICAoc2V0cSBpIDEpCisgICAgICAgICAgICAo c2V0cSBpICgxKyBpKSkpCisgICAgICAgICAgKHNldHEgc2VsZWN0ZWQtZmFjZSAoY29uZAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKD0gaSAxKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICcrLXBhcmVucy1vbmUtZmFjZSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgKCg9IGkgMikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAn Ky1wYXJlbnMtdHdvLWZhY2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBp IDMpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLXRocmVlLWZh Y2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoPSBpIDQpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgJystcGFyZW5zLWZvdXItZmFjZSkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgKCg9IGkgNSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAnKy1wYXJlbnMtZml2ZS1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAoKD0gaSA2KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcrLXBhcmVu cy1zaXgtZmFjZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgNykKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtc2V2ZW4tZmFjZSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg9IGkgOCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtZWlnaHQtZmFjZSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgKCg9IGkgOSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAnKy1wYXJlbnMtbmluZS1mYWNlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo KD0gaSAxMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnKy1wYXJlbnMtdGVu LWZhY2UpKSkKKyAgICAgICAgICAobGV0ICgob3YgKG1ha2Utb3ZlcmxheSBwb3MxICgxKyBwb3Mx KSkpKQorICAgICAgICAgICAgKHVubGVzcyArLXBhcmVucy1pbmFjdGl2ZS13aW5kb3dzCisgICAg ICAgICAgICAgIChvdmVybGF5LXB1dCBvdiAnd2luZG93IHdpbikpCisgICAgICAgICAgICAob3Zl cmxheS1wdXQgb3YgJ2ZhY2Ugc2VsZWN0ZWQtZmFjZSkpCisgICAgICAgICAgKHdoZW4gcG9zMgor ICAgICAgICAgICAgKGxldCAoKG92IChtYWtlLW92ZXJsYXkgKDEtIHBvczIpIHBvczIpKSkKKyAg ICAgICAgICAgICAgKHVubGVzcyArLXBhcmVucy1pbmFjdGl2ZS13aW5kb3dzCisgICAgICAgICAg ICAgICAgKG92ZXJsYXktcHV0IG92ICd3aW5kb3cgd2luKSkKKyAgICAgICAgICAgICAgKG92ZXJs YXktcHV0IG92ICdmYWNlIHNlbGVjdGVkLWZhY2UpKSkpCisgICAgICAgIChlcnJvciBuaWwpKSkK KyAgICAoc2V0cSArLXBhcmVucy1vdmVybGF5cy1leGlzdC1wIHQpKSkKKworKGRlZnVuICstcmVt b3ZlLW92ZXJsYXlzIChiZWcgZW5kIG5hbWUgdmFsKQorIlJlbW92ZSB0aGUgb3ZlcmxheXMgdGhh dCBhcmUgYGVxdWFsLWluY2x1ZGluZy1wcm9wZXJ0aWVzYC4KK0luY2x1ZGVzIGEgdW5pcXVlIHNp dHVhdGlvbiB3aGVuIGFuIG92ZXJsYXkgd2l0aCBhbiBgJ2FmdGVyLXN0cmluZ2AgcHJvcGVydHkK K2lzIGF0IHRoZSB2ZXJ5IGVuZCBvZiBhIG5hcnJvd2VkLWJ1ZmZlci4iCisgIChsZXQqICgocG9p bnQtbWF4IChwb2ludC1tYXgpKQorICAgICAgICAgKHBvaW50LW1pbiAocG9pbnQtbWluKSkKKyAg ICAgICAgIChuYXJyb3dlZC1wIChidWZmZXItbmFycm93ZWQtcCkpCisgICAgICAgICAoYmVnIChp ZiBiZWcgYmVnIHBvaW50LW1pbikpCisgICAgICAgICAoZW5kCisgICAgICAgICAgIChjb25kCisg ICAgICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgKG5vdCBuYXJyb3dlZC1wKQorICAg ICAgICAgICAgICAgICBlbmQpCisgICAgICAgICAgICAgICBlbmQpCisgICAgICAgICAgICAgKChh bmQKKyAgICAgICAgICAgICAgICAgKG5vdCBuYXJyb3dlZC1wKQorICAgICAgICAgICAgICAgICAo bnVsbCBlbmQpKQorICAgICAgICAgICAgICAgcG9pbnQtbWF4KQorICAgICAgICAgICAgICgoYW5k CisgICAgICAgICAgICAgICAgIG5hcnJvd2VkLXAKKyAgICAgICAgICAgICAgICAgZW5kCisgICAg ICAgICAgICAgICAgICg8IGVuZCBwb2ludC1tYXgpKQorICAgICAgICAgICAgICAgZW5kKQorICAg ICAgICAgICAgICgoYW5kCisgICAgICAgICAgICAgICAgIG5hcnJvd2VkLXAKKyAgICAgICAgICAg ICAgICAgZW5kCisgICAgICAgICAgICAgICAgICg9IGVuZCBwb2ludC1tYXgpKQorICAgICAgICAg ICAgICAgKDErIGVuZCkpCisgICAgICAgICAgICAgKChhbmQKKyAgICAgICAgICAgICAgICAgbmFy cm93ZWQtcAorICAgICAgICAgICAgICAgICAobnVsbCBlbmQpKQorICAgICAgICAgICAgICAgKDEr IHBvaW50LW1heCkpICkpCisgICAgICAgICAob3ZlcmxheXMKKyAgICAgICAgICAgKHByb2duCisg ICAgICAgICAgICAgKG92ZXJsYXktcmVjZW50ZXIgZW5kKQorICAgICAgICAgICAgIChvdmVybGF5 cy1pbiBiZWcgZW5kKSkpKQorICAgICh3aGVuIChhbmQgYmVnIGVuZCBuYW1lIHZhbCkKKyAgICAg IChkb2xpc3QgKG8gb3ZlcmxheXMpCisgICAgICAgIChjb25kCisgICAgICAgICAgKChhbmQgKGVx IG5hbWUgJ2ZhY2UpCisgICAgICAgICAgICAgICAgKGVxIChvdmVybGF5LWdldCBvIG5hbWUpIHZh bCkpCisgICAgICAgICAgICA7OyBFaXRoZXIgcHVzaCB0aGlzIG92ZXJsYXkgb3V0c2lkZSBiZWcu Li5lbmQKKyAgICAgICAgICAgIDs7IG9yIHNwbGl0IGl0IHRvIGV4Y2x1ZGUgYmVnLi4uZW5kCisg ICAgICAgICAgICA7OyBvciBkZWxldGUgaXQgZW50aXJlbHkgKGlmIGl0IGlzIGNvbnRhaW5lZCBp biBiZWcuLi5lbmQpLgorICAgICAgICAgICAgKGlmICg8IChvdmVybGF5LXN0YXJ0IG8pIGJlZykK KyAgICAgICAgICAgICAgICAoaWYgKD4gKG92ZXJsYXktZW5kIG8pIGVuZCkKKyAgICAgICAgICAg ICAgKHByb2duCisgICAgICAgICAgICAgICAgKG1vdmUtb3ZlcmxheSAoY29weS1vdmVybGF5IG8p CisgICAgICAgICAgICAgICAgICAob3ZlcmxheS1zdGFydCBvKSBiZWcpCisgICAgICAgICAgICAg ICAgKG1vdmUtb3ZlcmxheSBvIGVuZCAob3ZlcmxheS1lbmQgbykpKQorICAgICAgICAgICAgICAg ICAgKG1vdmUtb3ZlcmxheSBvIChvdmVybGF5LXN0YXJ0IG8pIGJlZykpCisgICAgICAgICAgICAg IChpZiAoPiAob3ZlcmxheS1lbmQgbykgZW5kKQorICAgICAgICAgICAgICAgICAgKG1vdmUtb3Zl cmxheSBvIGVuZCAob3ZlcmxheS1lbmQgbykpCisgICAgICAgICAgICAgICAgKGRlbGV0ZS1vdmVy bGF5IG8pKSkpCisgICAgICAgICAgKChhbmQgKG5vdCAoZXEgbmFtZSAnZmFjZSkpCisgICAgICAg ICAgICAgICAgKGVxdWFsLWluY2x1ZGluZy1wcm9wZXJ0aWVzIChvdmVybGF5LWdldCBvIG5hbWUp IHZhbCkpCisgICAgICAgICAgICAoZGVsZXRlLW92ZXJsYXkgbykpKSkpKSkKKworKGRlZnVuICst ZGVsZXRlLXBhcmVucy1vdmVybGF5cyAoKQorICAod2hlbiArLXBhcmVucy1vdmVybGF5cy1leGlz dC1wCisgICAgKGRvbGlzdCAoZmFjZSAnKCstcGFyZW5zLW9uZS1mYWNlCisgICAgICAgICAgICAg ICAgICAgICstcGFyZW5zLXR3by1mYWNlCisgICAgICAgICAgICAgICAgICAgICstcGFyZW5zLXRo cmVlLWZhY2UKKyAgICAgICAgICAgICAgICAgICAgKy1wYXJlbnMtZm91ci1mYWNlCisgICAgICAg ICAgICAgICAgICAgICstcGFyZW5zLWZpdmUt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ZnJpbmdlLWZpbGxlZC1yZWN0YW5nbGUgKCstZnJpbmdl LWhlbHBlci1kZWNpbWFsCisieHh4eHh4eC4iCisieHh4eHh4eC4iCisieHh4eHh4eC4iCisieHh4 eHh4eC4iCisieHh4eHh4eC4iCisieHh4eHh4eC4iCisieHh4eHh4eC4iCisieHh4eHh4eC4iCisi eHh4eHh4eC4iCisieHh4eHh4eC4iCisieHh4eHh4eC4iCisieHh4eHh4eC4iCisieHh4eHh4eC4i KSBuaWwgbmlsICdjZW50ZXIpCisKKyhkZWZpbmUtZnJpbmdlLWJpdG1hcCAnKy1mcmluZ2UtaG9s bG93LXNxdWFyZSAoKy1mcmluZ2UtaGVscGVyLWRlY2ltYWwKKyIueHh4eHh4LiIKKyIueC4uLi54 LiIKKyIueC4uLi54LiIKKyIueC4uLi54LiIKKyIueC4uLi54LiIKKyIueHh4eHh4LiIpIG5pbCBu aWwgJ2NlbnRlcikKKworKGRlZmluZS1mcmluZ2UtYml0bWFwICcrLWZyaW5nZS1maWxsZWQtc3F1 YXJlICgrLWZyaW5nZS1oZWxwZXItZGVjaW1hbAorIi54eHh4eHguIgorIi54eHh4eHguIgorIi54 eHh4eHguIgorIi54eHh4eHguIgorIi54eHh4eHguIgorIi54eHh4eHguIikgbmlsIG5pbCAnY2Vu dGVyKQorCisoZGVmaW5lLWZyaW5nZS1iaXRtYXAgJystZnJpbmdlLWhvcml6b250YWwtYmFyICgr LWZyaW5nZS1oZWxwZXItZGVjaW1hbAorInh4eHh4eHguIgorInh4eHh4eHguIikgbmlsIG5pbCAn Ym90dG9tKQorCisoZGVmaW5lLWZyaW5nZS1iaXRtYXAgJystZnJpbmdlLWVtcHR5LWxpbmUgKCst ZnJpbmdlLWhlbHBlci1kZWNpbWFsCisiLi4uLi4uLi4iCisiLi54eHh4Li4iCisiLi4uLi4uLi4i CisiLi4uLi4uLi4iCisiLi54eHh4Li4iCisiLi4uLi4uLi4iKSBuaWwgbmlsICcodG9wIHQpKQor Cis7Ozs7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tbi4iCisgIDppbml0LXZhbHVlIG5pbAorICA6bGlnaHRlciAi IEZDIgorICA6a2V5bWFwIG5pbAorICA6Z2xvYmFsIG5pbAorICA6Z3JvdXAgJ2ZjLW1vZGUKKyAg KGNvbmQKKyAgICA7OzsgYCstbW9kZScgaGFzIHRoZSBhYmlsaXR5IHRvIGFsc28gZGlzcGxheSBh IGZpbGwgY29sdW1uIGluZGljYXRvci4KKyAgICA7OzsgU2VlIHRoZSB2YXJpYWJsZSBgKy1maWxs LWNvbHVtbicuCisgICAgKChhbmQgZmMtbW9kZSArLW1vZGUpCisgICAgICAoc2V0cSBmYy1tb2Rl IG5pbCkKKyAgICAgIChtZXNzYWdlICJUdXJuZWQgT0ZGIGBmYy1tb2RlJyAoJXMpIC0tIHNlZSB0 aGUgdmFyaWFibGUgYCstZmlsbC1jb2x1bW4nLiIgKGN1cnJlbnQtYnVmZmVyKSkpCisgICAgKGZj LW1vZGUKKyAgICAgICh3aGVuIChhbmQgZ2xvYmFsLWVsZG9jLW1vZGUKKyAgICAgICAgICAgICAg ICAgKGNhbGxlZC1pbnRlcmFjdGl2ZWx5LXAgJ2FueSkKKyAgICAgICAgICAgICAgICAgKGVxdWFs IGN1cnJlbnQtcHJlZml4LWFyZyAnKDQpKSkKKyAgICAgICAgKGdsb2JhbC1lbGRvYy1tb2RlIC0x KSkKKyAgICAgICh3aGVuIChhbmQgaml0LWxvY2stY29udGV4dC10aW1lcgorICAgICAgICAgICAg ICAgICAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAgICAgICAgICAoZXF1 YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAod2hlbiAodGltZXJwIGppdC1s b2NrLWNvbnRleHQtdGltZXIpCisgICAgICAgICAgKGNhbmNlbC10aW1lciBqaXQtbG9jay1jb250 ZXh0LXRpbWVyKSkKKyAgICAgICAgOzsgKHNldHEgaml0LWxvY2stY29udGV4dC10aW1lciAocnVu LXdpdGgtaWRsZS10aW1lciA1LjAgJ3JlcGVhdCAnaml0LWxvY2stY29udGV4dC1mb250aWZ5KSkK KyAgICAgICAgKHNldHEgaml0LWxvY2stY29udGV4dC10aW1lciBuaWwpKQorICAgICAgKHdoZW4g KGFuZCAoY2FsbGVkLWludGVyYWN0aXZlbHktcCAnYW55KQorICAgICAgICAgICAgICAgICAoZXF1 YWwgY3VycmVudC1wcmVmaXgtYXJnICcoNCkpKQorICAgICAgICAod2hlbiAodGltZXJwIHVuZG8t YXV0by1jdXJyZW50LWJvdW5kYXJ5LXRpbWVyKQorICAgICAgICAgIChjYW5jZWwtdGltZXIgdW5k by1hdXRvLWN1cnJlbnQtYm91bmRhcnktdGltZXIpKQorICAgICAgICAoZnNldCAndW5kby1hdXRv LS11bmRvYWJsZS1jaGFuZ2UKKyAgICAgICAgICAgICAgKGxhbWJkYSAoKSAoYWRkLXRvLWxpc3Qg J3VuZG8tYXV0by0tdW5kb2FibHktY2hhbmdlZC1idWZmZXJzIChjdXJyZW50LWJ1ZmZlcikpKSkK KyAgICAgICAgKGZzZXQgJ3VuZG8tYXV0by1hbWFsZ2FtYXRlICdpZ25vcmUpKQorICAgICAgKHdo ZW4gYmxpbmstY3Vyc29yLW1vZGUKKyAgICAgICAgKGJsaW5rLWN1cnNvci1tb2RlIC0xKQorICAg ICAgICAod2hlbiAobWVtcSAnYmxpbmstY3Vyc29yLWNoZWNrIHBvc3QtY29tbWFuZC1ob29rKQor ICAgICAgICAgIChyZW1vdmUtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgJ2JsaW5rLWN1cnNvci1j aGVjaykpKQorICAgICAgKHNldHEgZmMtdmlzaWJsZSB0KQorICAgICAgOzs7IGBhdXRvLWNvbXBv c2l0aW9uLW1vZGUnIGlzIG5lZWRlZCBmb3IgY3Jvc3NoYWlycyB0byBwcm9wZXJseSBjYWxjdWxh dGUKKyAgICAgIDs7OyBjb29yZGluYXRlcyBvZiBjb21wb3NpdGlvbiBjaGFyYWN0ZXJzL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ICcrLW1vZGUpCisKKyhkZWZmYWNlICstZXZlbi1pbmFjdGl2ZS1wcmUtenYtZmFjZQorICAnKCgo KGNsYXNzIGNvbG9yKSAobWluLWNvbG9ycyA4OCkgKGJhY2tncm91bmQgZGFyaykpCisgICAgIDpm b3JlZ3JvdW5kICIjZWVlOGFhIikKKyAgICAoKChjbGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgODgp IChiYWNrZ3JvdW5kIGxpZ2h0KSkKKyAgICAgOmZvcmVncm91bmQgImJsdWUxIikKKyAgICAoKChj bGFzcyBjb2xvcikgKG1pbi1jb2xvcnMgMTYpIChiYWNrZ3JvdW5kIGRhcmspKQorICAgICA6Zm9y ZWdyb3VuZCAiI2VlZThhYSIpCisgICAgKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDE2KSAo YmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJibHVlMSIpCisgICAgKCgoY2xh c3MgY29sb3IpIChtaW4tY29sb3JzIDgpKQorICAgICA6Zm9yZWdyb3VuZCAid2hpdGUiKQorICAg ICgoKHR5cGUgdHR5KSAoY2xhc3MgbW9ubykpCisgICAgIDppbnZlcnNlLXZpZGVvIHQpCisgICAg KHQgOmZvcmVncm91bmQgInBpbmsiKSkKKyAgIkZhY2UgZm9yIGArLWV2ZW4taW5hY3RpdmUtcHJl LXp2LWZhY2UnLiIKKyAgOmdyb3VwICcrLW1vZGUpCisKKyhkZWZmYWNlICstZXZlbi1hdC16di1m YWNlCisgICcoKCgoY2xhc3MgY29sb3IpIChtaW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBkYXJr KSkKKyAgICAgOmZvcmVncm91bmQgIkRlZXBQaW5rMSIpCisgICAgKCgoY2xhc3MgY29sb3IpICht aW4tY29sb3JzIDg4KSAoYmFja2dyb3VuZCBsaWdodCkpCisgICAgIDpmb3JlZ3JvdW5kICJEZWVw UGluazEiKQorICAgICgoKGNsYXNzIGNvbG9yKSAobWluLWNvbG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HZhbDsKK30KKworc3RhdGljIHZvaWQKK2JzZXRfY2hf aG9yaXpvbnRhbF9ydWxlciAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFsKQorewor ICBiLT5jaF9ob3Jpem9udGFsX3J1bGVyXyA9IHZhbDsKK30KKworc3RhdGljIHZvaWQKK2JzZXRf Y2hfdmVydGljYWxfcnVsZXIgKHN0cnVjdCBidWZmZXIgKmIsIExpc3BfT2JqZWN0IHZhbCkKK3sK KyAgYi0+Y2hfdmVydGljYWxfcnVsZXJfID0gdmFsOworfQorCitzdGF0aWMgdm9pZAorYnNldF9j aF9pbmFjdGl2ZV93aW5kb3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7 CisgIGItPmNoX2luYWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQorCitzdGF0aWMgdm9pZAorYnNl dF9mY192aXNpYmxlIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7CisgIGIt PmZjX3Zpc2libGVfID0gdmFsOworfQorCitzdGF0aWMgdm9pZAorYnNldF9mY19pbmFjdGl2ZV93 aW5kb3dzIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7CisgIGItPmZjX2lu YWN0aXZlX3dpbmRvd3NfID0gdmFsOworfQorCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogc3RhdGljIHZvaWQKIGJzZXRfYWJicmV2X21v ZGUgKHN0cnVjdCBidWZmZXIgKmIsIExpc3BfT2JqZWN0IHZhbCkKIHsKQEAgLTUxNDUsNiArNTIw OCwyNCBAQCBpbml0X2J1ZmZlcl9vbmNlICh2b2lkKQogICBic2V0X2xhc3Rfc2VsZWN0ZWRfd2lu ZG93ICgmYnVmZmVy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2ZV93aW5kb3dzKSwgaWR4KTsgKytpZHg7CisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworCisKICAgWFNFVEZBU1RJTlQgKEJWQVIgKCZidWZmZXJfbG9jYWxfZmxh Z3MsIG1vZGVfbGluZV9mb3JtYXQpLCBpZHgpOyArK2lkeDsKICAgWFNFVEZBU1RJTlQgKEJWQVIg KCZidWZmZXJfbG9jYWxfZmxhZ3MsIGFiYnJldl9tb2RlKSwgaWR4KTsgKytpZHg7CiAgIFhTRVRG QVNUSU5UIChCVkFSICgmYnVmZmVyX2xvY2FsX2ZsYWdzLCBvdmVyd3JpdGVfbW9kZSksIGlkeCk7 ICsraWR4OwpAQCAtNTIzMSw2ICs1MzEyLDI0IEBAIGluaXRfYnVmZmVyX29uY2UgKHZvaWQpCiAg IC8qIE11c3QgZG8gdGhlc2UgYmVmb3JlIG1ha2luZyB0aGUgZmlyc3QgYnVmZmVyISAqLwogCiAg IC8qIHJlYWwgc2V0dXAgaXMgZG9uZSBpbiBiaW5kaW5ncy5lbCAqLworCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGJzZXRfbWNfcmVhbF9m YWtlX2N1cnNvciAoJmJ1ZmZlcl9kZWZhdWx0cywgUWhvbGxvdyk7CisgIGJzZXRfbWNfY29uZiAo JmJ1ZmZlcl9kZWZhdWx0cywgUW5pbCk7CisgIGJzZXRfbWNfaW5hY3RpdmVfd2luZG93cyAoJmJ1 ZmZlcl9kZWZhdWx0cywgUXQpOworICBic2V0X2Nyb3NzaGFpcnMgKCZidWZmZXJfZGVmYXVsdHMs IFFuaWwpOworICBic2V0X2NoX2hvcml6b250YWxfcnVsZXIgKCZidWZmZXJfZGVmYXVsdHMsIFF0 KTsKKyAgYnNldF9jaF92ZXJ0aWNhbF9ydWxlciAoJmJ1ZmZlcl9kZWZhdWx0cywgUXQpOworICBi c2V0X2NoX2luYWN0aXZlX3dpbmRvd3MgKCZidWZmZXJfZGVmYXVsdHMsIFF0KTsKKyAgYnNldF9m Y192aXNpYmxlICgmYnVmZmVyX2RlZmF1bHRzLCBRbmlsKTsKKyAgYnNldF9mY19pbmFjdGl2ZV93 aW5kb3dzICgmYnVmZmVyX2RlZmF1bHRzLCBRdCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworCisKICAgYnNldF9tb2RlX2xpbmVfZm9ybWF0ICgmYnVmZmVyX2RlZmF1bHRzLCBidWlsZF9w dXJlX2Nfc3RyaW5nICgiJS0iKSk7CiAgIGJzZXRfaGVhZGVyX2xpbmVfZm9ybWF0ICgmYnVmZmVy X2RlZmF1bHRzLCBRbmlsKTsKICAgYnNldF9hYmJyZXZfbW9kZSAoJmJ1ZmZlcl9kZWZhdWx0cywg UW5pbCk7CkBAIC01NDYxLDYgKzU1NjAsNTEgQEAgZGVmdmFyX3Blcl9idWZmZXIgKHN0cnVjdCBM aXNwX0J1ZmZlcl9PYmpmd2QgKmJvX2Z3ZCwgY29uc3QgY2hhciAqbmFtZXN0cmluZywKIHZvaWQK IHN5bXNfb2ZfYnVmZmVyICh2b2lkKQogeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIERFRlNZTSAoUW1jX3JlYWxfZmFrZV9jdXJzb3Is ICJtYy1yZWFsLWZha2UtY3Vyc29yIik7CisgIERFRlZBUl9QRVJfQlVGRkVSICgibWMtcmVhbC1m YWtlLWN1cnNvciIsICZCVkFSIChjdXJyZW50X2J1ZmZlciwgbWN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ItbG9jYWwgdmFyaWFibGUgdG8gdHVybiBvbi9vZmYgdGhlIG11bHRp cGxlIGN1cnNvcnMgZmlsbCBjb2x1bW4uICovKTsKKworICBERUZTWU0gKFFmY192aXNpYmxlX2lu YWN0aXZlX3dpbmRvdywgImZjLWluYWN0aXZlLXdpbmRvdyIpOworICBERUZWQVJfUEVSX0JVRkZF UiAoImZjLWluYWN0aXZlLXdpbmRvd3MiLCAmQlZBUiAoY3VycmVudF9idWZmZXIsIGZjX2luYWN0 aXZlX3dpbmRvd3MpLCBRbmlsLAorICAgIGRvYzogLyogV2hlbiBub24tbmlsLCBkcmF3IG11bHRp cGxlIGN1cnNvcnMgZmlsbCBjb2x1bW4gaW4gaW5hY3RpdmUgd2luZG93cy4gKi8pOworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAgIHN0YXRpY3BybyAoJmxhc3Rfb3ZlcmxheV9tb2Rp ZmljYXRpb25faG9va3MpOwogICBsYXN0X292ZXJsYXlfbW9kaWZpY2F0aW9uX2hvb2tzID0gbWFr ZV9uaWxfdmVjdG9yICgxMCk7CiAKZGlmZiAtLWdpdCBhL3NyYy9idWZmZXIuaCBiL3NyYy9idWZm ZXIuaAppbmRleCAyMDgwYTZmLi4xYWRhOTNlIDEwMDY0NAotLS0gYS9zcmMvYnVmZmVyLmgKKysr IGIvc3JjL2J1ZmZlci5oCkBAIC03NDAsNiArNzQwLDQwIEBAIHN0cnVjdCBidWZmZXIKICAgICAg aW4gdGhlIGRpc3BsYXkgb2YgdGhpcyBidWZmZXIuICAqLwogICBMaXNwX09iamVjdCBleHRyYV9s aW5lX3NwYWNpbmdfOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUt Q1VSU09SUyAqLworCisgIC8qIF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Rvd3NfOworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIEN1cnNvciB0eXBlIHRvIGRpc3BsYXkgaW4g bm9uLXNlbGVjdGVkIHdpbmRvd3MuCiAgICAgIHQgbWVhbnMgdG8gdXNlIGhvbGxvdyBib3ggY3Vy c29yLgogICAgICBTZWUgYGN1cnNvci10eXBlJyBmb3Igb3RoZXIgdmFsdWVzLiAgKi8KQEAgLTc5 MSwxNCArODI1LDIxIEBAIHN0cnVjdCBidWZmZXIKICAgICAgYW4gaW5kaXJlY3QgYnVmZmVyIHNp bmNlIGl0IGNvdW50cyBhcyBpdHMgYmFzZSBidWZmZXIuICAqLwogICBpbnQgd2luZG93X2NvdW50 OwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLwor CiAgIC8qIEEgbm9uLXplcm8gdmFsdWUgaW4gc2xvdCBJRFggbWVhbnMgdGhhdCBwZXItYnVmZmVy IHZhcmlhYmxlCiAgICAgIHdpdGggaW5kZXggSURYIGhhcyBhIGxvY2FsIHZhbHVlIGluIHRoaXMg YnVmZmVyLiAgVGhlIGluZGV4IElEWAogICAgICBmb3IgYSBidWZmZXItbG9jYWwgdmFyaWFibGUg aXMgc3RvcmVkIGluIHRoYXQgdmFyaWFibGUncyBzbG90CiAgICAgIGluIGJ1ZmZlcl9sb2NhbF9m bGFncyBhcyBhIExpc3AgaW50ZWdlci4gIElmIHRoZSBpbmRleCBpcyAtMSwKICAgICAgdGhpcyBt ZWFucyB0aGUgdmFyaWFibGUgaXMgYWx3YXlzIGxvY2FsIGluIGFsbCBidWZmZXJzLiAgKi8KLSNk ZWZpbmUgTUFYX1BFUl9CVUZGRVJfVkFSUyA1MAorI2RlZmluZSBNQVhfUEVSX0JVRkZFUl9WQVJT IDYwCiAgIGNoYXIgbG9jYWxfZmxhZ3NbTUFYX1BFUl9CVUZGRVJfVkFSU107CiAKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworCisKICAgLyogU2V0IHRvIHRoZSBtb2R0aW1lIG9mIHRoZSB2aXNp dGVkIGZpbGUgd2hlbiByZWFkIG9yIHdyaXR0ZW4uCiAgICAgIG1vZHRpbWUudHZfbnNlYyA9PSBO T05FWElTVEVOVF9NT0RUSU1FX05TRUNTIG1lYW5zCiAgICAgIHZpc2l0ZWQgZmlsZSB3YXMgbm9u ZXhpc3RlbnQuICBtb2R0aW1lLnR2X25zZWMgPT0KQEAgLTkwNyw2ICs5NDgsNjkgQEAgWEJVRkZF UiAoTGlzcF9PYmplY3QgYSkKIC8qIE1vc3QgY29kZSBzaG91bGQgdXNlIHRoZXNlIGZ1bmN0aW9u cyB0byBzZXQgTGlzcCBmaWVsZHMgaW4gc3RydWN0CiAgICBidWZmZXIuICAoU29tZSBzZXR0ZXJz IHRoYXQgYXJlIHByaXZhdGUgdG8gYSBzaW5nbGUgLmMgZmlsZSBhcmUKICAgIGRlZmluZWQgYXMg c3RhdGljIGluIHRob3NlIGZpbGVzLikgICovCisKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKK0lOTElORSB2b2lkCitic2V0X2Jsdl9t Y19yZWFsX2Zha2VfY3Vyc29yIChzdHJ1Y3QgYnVmZmVyICpiLCBMaXNwX09iamVjdCB2YWwpCit7 CisgIGItPm1jX3JlYWxfZmFrZV9jdXJzb3JfID0gdmFsOworfQorCitJTkxJTkUgdm9pZAorYnNl dF9ibHZfbWNfY29uZiAoc3RydWN0IGJ1ZmZlciAq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m Y19pbmFjdGl2ZV93aW5kb3dzXyA9IHZhbDsKK30KKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMg Ki8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIElOTElORSB2b2lkCiBic2V0X2JpZGlf cGFyYWdyYXBoX2RpcmVjdGlvbiAoc3RydWN0IGJ1ZmZlciAqYiwgTGlzcF9PYmplY3QgdmFsKQog ewpkaWZmIC0tZ2l0IGEvc3JjL2Rpc3BleHRlcm4uaCBiL3NyYy9kaXNwZXh0ZXJuLmgKaW5kZXgg NGU5NDdkYS4uMWE3OTcxMSAxMDA2NDQKLS0tIGEvc3JjL2Rpc3BleHRlcm4uaAorKysgYi9zcmMv ZGlzcGV4dGVybi5oCkBAIC0xNDUsNiArMTQ1LDEzMSBAQCB0eXBlZGVmIHZvaWQgKkVtYWNzX0N1 cnNvcjsKICNkZWZpbmUgTmF0aXZlUmVjdGFuZ2xlIGludAogI2VuZGlmCiAKKworLyogKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKK2V4dGVybiBi b29sIG1jX3N0ZGVycl9wIEVYVEVSTkFMTFlfVklTSUJMRTsKKworc3RydWN0IGdseXBoOworCitz dHJ1Y3QgZ2x5cGhfcm93OworCitzdHJ1Y3QgZ2x5cGhfbWF0cml4OworCitlbnVtIGRyYXdfZ2x5 cGhzX2ZhY2U7CisKK2VudW0gZ2x5cGhfcm93X2FyZWE7CisKK3N0cnVjdCBtY19tYXRyaXg7CisK K2VudW0gbWNfY2FjaGVfdHlwZTsKKworZW51bSBtY19jdXJzb3JfdHlwZTsKKworZW51bSBtY19m bGF2b3I7CisKK3N0cnVjdCBtY19SR0I7CisKK3N0cnVjdCBtY19lc3NlbnRp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fd2luZG93IChzdHJ1Y3Qgd2luZG93ICopOworCitleHRl cm4gY2hhciAqIG1jX2NoYXJfdG9fc3RyaW5nIChpbnQpOworCitleHRlcm4gY2hhciAqIG1jX2N1 cnNvcl90eXBlX3RvX3N0cmluZyAoZW51bSBtY19jdXJzb3JfdHlwZSk7CisKK2V4dGVybiBjaGFy ICogbWNfZmxhdm9yX3RvX3N0cmluZyAoZW51bSBtY19mbGF2b3IpOworCitleHRlcm4gY2hhciAq IG1jX2NhY2hlX3R5cGVfdG9fc3RyaW5nIChlbnVtIG1jX2NhY2hlX3R5cGUpOworCitleHRlcm4g Y2hhciAqIG1jX3JlZHJhd19yb3dfdHlwZV90b19zdHJpbmcgKGVudW0gbWNfcmVkcmF3X3Jvd190 eXBlKTsKKworZXh0ZXJuIHZvaWQgbWNfY2FjaGVfaW5zcGVjdG9yIChzdHJ1Y3Qgd2luZG93ICos IHN0cnVjdCBtY19tYXRyaXgpOworCitleHRlcm4gYm9vbCBtY190cmF2ZXJzZV9jYWNoZV9wIChz dHJ1Y3QgbWNfbWF0cml4LCBlbnVtIG1jX2NhY2hlX3R5cGUsIGludCwgaW50KTsKKworZXh0ZXJu IHZvaWQgbWNfZHJhd19mcmluZ2VfYml0bWFwIChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlw aF9yb3cgKiwgaW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1j X2N1cnNvcl90eXBlKTsKKworZXh0ZXJuIGludCBtY19nZXRfZnJpbmdlX2JpdG1hcCAoc3RydWN0 IHdpbmRvdyAqLCBMaXNwX09iamVjdCwgaW50LCBpbnQpOworCitleHRlcm4gdm9pZCBtY19lbmdp bmUgKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhf cm93ICosCisgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqLCBpbnQsIGludCwg aW50LCBpbnQsIGludCwgaW50LAorICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2N1cnNv cl90eXBlLCBpbnQsIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwKKyAgICAgICAgICAgICAgICAgICAg ICAgc3RydWN0IG1jX2Vzc2VudGlhbHMsIGVudW0gbWNfcm93X3Bvc2l0aW9uLCBzdHJ1Y3QgbWNf UkdCLAorICAgICAgICAgICAgICAgICAgICAgICBlbnVtIG1jX2VuZ2luZV90eXBlLCBib29sLCBl bnVtIG1jX2RyYXdfcm93X3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY2Fj aGVfdHlwZSk7CisKK2V4dGVybiB2b2lkIG1jX3NldF9lc3NlbnRpYWxzIChzdHJ1Y3Qgd2luZG93 ICosIHN0cnVjdCBtY19lc3NlbnRpYWxzICopOworCitleHRlcm4gdm9pZCBtY19kcmF3X3JvdyAo c3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlwaF9yb3cg KiwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGggKiwgaW50LCBpbnQsIGlu dCwgc3RydWN0IGdseXBoX21hdHJpeCAqLAorICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVj dCBtY19lc3NlbnRpYWxzLCBlbnVtIG1jX3Jvd19wb3NpdGlvbiwgYm9vbCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICBlbnVtIG1jX2RyYXdfcm93X3R5cGUpOworCitleHRlcm4gYm9vbCBtY19y ZWRyYXdfcm93IChzdHJ1Y3Qgd2luZG93ICosIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwgc3RydWN0 IGdseXBoX3JvdyAqLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBnbHlwaF9yb3df YXJlYSwgaW50LCBpbnQsIGludCwgYm9vbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGVu dW0gZHJhd19nbHlwaHNfZmFjZSwgZW51bSBtY19yZWRyYXdfcm93X3R5cGUpOworCitleHRlcm4g dm9pZCBtY19yZXNldF9jYWNoZSAoc3RydWN0IHdpbmRvdyAqKTsKKworZXh0ZXJuIHZvaWQgbWNf ZHJhd19jdXJzb3JfZ2x5cGggKHN0cnVjdCB3aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAq LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKiwg ZW51bSBkcmF3X2dseXBoc19mYWNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGludCwgaW50LCBpbnQsIHN0cnVjdCBtY19SR0IsIGVudW0gbWNfZmxhdm9yLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUsIGludCwgYm9vbCwg Ym9vbCk7CisKK2V4dGVybiB2b2lkIG1jX2VyYXNlX2N1cnNvciAoc3RydWN0IHdpbmRvdyAqLCBz dHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVjdCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgc3RydWN0IG1jX21hdHJpeCwgaW50LCBpbnQsIGludCwgaW50LCBlbnVt IG1jX2ZsYXZvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3Jf dHlwZSwgaW50KTsKKworZXh0ZXJuIHZvaWQgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHN0cnVjdCB3 aW5kb3cgKiwgc3RydWN0IGdseXBoX21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhfcm93ICosCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBpbnQsIGludCwgaW50LCBpbnQsIGlu dCwgaW50LCBpbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19j dXJzb3JfdHlwZSwgaW50LCBzdHJ1Y3QgbWNfUkdCLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGJvb2wsIGVudW0gbWNfZmxhdm9yLCBib29sKTsKKworZXh0ZXJuIGludCBtY19k cmF3X2dseXBocyAoc3RydWN0IHdpbmRvdyAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosIHN0cnVj dCBnbHlwaF9yb3cgKiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19tYXRy aXgsIGludCwgZW51bSBnbHlwaF9yb3dfYXJlYSwgcHRyZGlmZl90LAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgcHRyZGlmZl90LCBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2UsIGludCwgaW50LCBz dHJ1Y3QgbWNfUkdCLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19mbGF2b3Is IGVudW0gbWNfY3Vyc29yX3R5cGUsIGludCwgYm9vbCwgYm9vbCwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgIGVudW0gZHJhd19nbHlwaF9hY3Rpb24sIGJvb2wpOworCitleHRlcm4gc3RydWN0 IGdseXBoX21hdHJpeCAqIG1jX3NhdmVfZ2x5cGhfbWF0cml4IChzdHJ1Y3QgZ2x5cGhfbWF0cml4 ICopOworCitleHRlcm4gdm9pZCBtY19yZXN0b3JlX2dseXBoX21hdHJpeCAoc3RydWN0IGdseXBo X21hdHJpeCAqLCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICopOworCisvKiBlbmQgTVVMVElQTEUtQ1VS U09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogLyogVGV4dCBjdXJzb3IgdHlw ZXMuICAqLwogCiBlbnVtIHRleHRfY3Vyc29yX2tpbmRzCkBAIC00MDQsNiArNTI5LDIxIEBAIHN0 cnVjdCBnbHlwaF9zbGljZQogCiBzdHJ1Y3QgZ2x5cGgKIHsKKworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBpbnQgcmVsYXRpdmVfeCwgaHBv czsKKworICBwdHJkaWZmX3QgYnl0ZXBvczsKKworICAvKiBDdXJyZW50IGxpbmUgbnVtYmVyLCB6 ZXJvLWJhc2VkLiAqLworICBwdHJkaWZmX3QgbG51bTsKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogICAvKiBQb3NpdGlvbiBmcm9tIHdoaWNoIHRoaXMgZ2x5cGggd2FzIGRyYXduLiAg SWYgYG9iamVjdCcgYmVsb3cgaXMgYQogICAgICBMaXNwIHN0cmluZywgdGhpcyBpcyBhbiBpbmRl eCBpbnRvIHRoYXQgc3RyaW5nLiAgSWYgaXQgaXMgYQogICAgICBidWZmZXIsIHRoaXMgaXMgYSBw b3NpdGlvbiBpbiB0aGF0IGJ1ZmZlci4gIEluIGFkZGl0aW9uLCBzb21lCkBAIC0xMjcwLDYgKzE0 MTAsMjggQEAgZW51bSBkcmF3X2dseXBoc19mYWNlCiAKIHN0cnVjdCBnbHlwaF9zdHJpbmcKIHsK KworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwor ICAgIGJvb2xfYmYgbGVmdF9vdmVyd3JpdHRlbl9wIDogMTsKKworICAgIGJvb2xfYmYgcmlnaHRf b3ZlcndyaXR0ZW5fcCA6IDE7CisKKyAgICBib29sX2JmIHJlY3RhbmdsZV9udWtlZF9wIDogMTsK KworICAgIGJvb2xfYmYgYmFja2dyb3VuZF9udWtlZF9wIDogMTsKKworICAgIGVudW0gZHJhd19n bHlwaF9hY3Rpb24KKyAgICB7CisgICAgICBNQ19EUkFXX0dMWVBIX1NUUklORywKKyAgICAgIE1D X0VSQVNFX0dMWVBIX1NUUklORworICAgIH0gYWN0aW9uX3R5cGU7CisKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKICAgLyogWC1vcmlnaW4gb2YgdGhlIHN0cmluZy4gICovCiAgIGludCB4 OwogCkBAIC0yODM0LDYgKzI5OTYsMjkgQEAgdHlwZWRlZiB2b2lkICgqZnJhbWVfcGFybV9oYW5k bGVyKSAoc3RydWN0IGZyYW1lICosIExpc3BfT2JqZWN0LCBMaXNwX09iamVjdCk7CiAKIHN0cnVj dCByZWRpc3BsYXlfaW50ZXJmYWNlCiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisv KiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgbnN0 ZXJtLm1gIHwgYHczMnRlcm0uY2AgfCBgeHRlcm0uY2AgbXVzdCBiZSBpbiB0aGUKK2V4YWN0IHNh bWUgb3JkZXIgYXMgdGhlIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgZGlzcGV4dGVybi5oYCEg Ki8KKworICAvKiBgbWNfbnNfZHJhd193aW5kb3dfY3Vyc29yJyB8IGBtY193MzJfZHJhd193aW5k b3dfY3Vyc29yJyB8IGBtY194X2RyYXdfd2luZG93X2N1cnNvcicgKi8KKyAgdm9pZCAoKm1jX3Nj cmliZV9jdXJzb3IpIChzdHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRy aXgsCisgICAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKmdseXBoX3JvdywgaW50IHgsIGludCBmeCwg aW50IHksIGludCBmeSwgaW50IGhwb3MsCisgICAgICAgIGludCB2cG9zLCBpbnQgd2QsIGludCBo LCBzdHJ1Y3QgbWNfUkdCIGxzbCwgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSwKKyAg ICAgICAgaW50IGN1cnNvcl93aWR0aCwgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yLCBib29s IG9uX3AsIGJvb2wgYWN0aXZlX3ApOworCisgIC8qIGBtY19uc19kcmF3X2dseXBoX3N0cmluZycg fCBgbWNfdzMyX2RyYXdfZ2x5cGhfc3RyaW5nJyB8IGBtY194X2RyYXdfZ2x5cGhfc3RyaW5nJyAq LworICB2b2lkICgqbWNfc2NyaWJlX3N0cmluZykgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMsIHN0 cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCwKKyAgICAgICAgc3RydWN0IGdseXBoX3JvdyAqcm93 LCBzdHJ1Y3QgbWNfbWF0cml4IG1jX21hdHJpeCwgc3RydWN0IG1jX1JHQiBsc2wsCisgICAgICAg IGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciwgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3Jf dHlwZSwgaW50IHdkLAorICAgICAgICBib29sIGFjdGl2ZV9wLCBib29sIGN1cnNvcl9nY19wKTsK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBIYW5kbGVycyBmb3Igc2V0dGlu ZyBmcmFtZSBwYXJhbWV0ZXJzLiAgKi8KICAgZnJhbWVfcGFybV9oYW5kbGVyICpmcmFtZV9wYXJt X2hhbmRsZXJzOwogCmRpZmYgLS1naXQgYS9zcmMvZGlzcG5ldy5jIGIvc3JjL2Rpc3BuZXcuYwpp bmR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dfZW50cnkgKHN0cnVjdCBnbHlwaF9yb3cgKnJvdykKK3sKKyAgc3RydWN0IG1jX3Jvd19lbnRy eSAqZW50cnk7CisgIHB0cmRpZmZfdCBpID0gcm93LT5oYXNoICUgbWNfcm93X3RhYmxlX3NpemU7 CisgIGVudHJ5ID0gbWNfcm93X3RhYmxlW2ldOworICBlYXNzZXJ0IChlbnRyeSB8fCBtY192ZXJp Znlfcm93X2hhc2ggKHJvdykpOworICB3aGlsZSAoZW50cnkgJiYgIXJvd19lcXVhbF9wIChlbnRy eS0+cm93LCByb3csIDEpKQorICAgIGVudHJ5ID0gZW50cnktPm5leHQ7CisgIGlmIChlbnRyeSA9 PSBOVUxMKQorICAgIHsKKyAgICAgIGVudHJ5ID0gbWNfcm93X2VudHJ5X3Bvb2wgKyBtY19yb3df ZW50cnlfaWR4Kys7CisgICAgICBlbnRyeS0+cm93ID0gcm93OworICAgICAgZW50cnktPm9sZF91 c2VzID0gZW50cnktPm5ld191c2VzID0gMDsKKyAgICAgIGVudHJ5LT5uZXdfbGluZV9udW1iZXIg PSAwOworICAgICAgZW50cnktPmJ1Y2tldCA9IGk7CisgICAgICBlbnRyeS0+bmV4dCA9IG1jX3Jv d190YWJsZVtpXTsKKyAgICAgIG1jX3Jvd190YWJsZVtpXSA9IGVudHJ5OworICAgIH0KKyAgcmV0 dXJuIGVudHJ5OworfQorCitzdHJ1Y3QgbWNfbWF0cml4CittY19zYXZlX2NhY2hlX21hdHJpeCAo c3RydWN0IG1jX21hdHJpeCBtYXRyaXgpCit7CisgIHN0cnVjdCBtY19tYXRyaXggc2F2ZWQ7Cisg IHNhdmVkLnZwb3NfYWxsb2NhdGVkID0gbWF0cml4LnZwb3NfYWxsb2NhdGVkOworICBzYXZlZC52 cG9zX3VzZWQgPSBtYXRyaXgudnBvc191c2VkOworICBzYXZlZC52cG9zID0geHphbGxvYyAoc2F2 ZWQudnBvc19hbGxvY2F0ZWQgKiBzaXplb2YgKnNhdmVkLnZwb3MpOworICBm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kZXNp cmVkX21hdHJpeDsKKyAgc3RydWN0IGdseXBoX21hdHJpeCAqY3VycmVudF9tYXRyaXggPSB3LT5j dXJyZW50X21hdHJpeDsKKyAgaW50IHliID0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpOworICBw dHJkaWZmX3QgaTsKKyAgaW50IGosIGZpcnN0X29sZCwgZmlyc3RfbmV3LCBsYXN0X29sZCwgbGFz dF9uZXc7CisgIGludCBucnVucywgcnVuX2lkeDsKKyAgcHRyZGlmZl90IG47CisgIHN0cnVjdCBt Y19yb3dfZW50cnkgKmVudHJ5OworICAvLyBzdHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFjZSAqcmlm ID0gRlJBTUVfUklGIChYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpKTsKKyAgLyogU2tpcCBvdmVy IHJvd3MgZXF1YWwgYXQgdGhlIHN0YXJ0LiAqLworICBmb3IgKGkgPSBoZWFkZXJfbGluZV9wOyBp IDwgY3VycmVudF9tYXRyaXgtPm5yb3dzIC0gMTsgKytpKQorICAgIHsKKyAgICAgIHN0cnVjdCBn bHlwaF9yb3cgKmQgPSBNQVRSSVhfUk9XIChkZXNpcmVkX21hdHJpeCwgaSk7CisgICAgICBzdHJ1 Y3QgZ2x5cGhfcm93ICpjID0gTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIGkpOworICAgICAg aWYgKGMtPmVuYWJsZWRfcAorICAgICAgICAgICYmIGQtPmVuYWJsZWRfcAorICAgICAgICAgICYm ICFkLT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcAorICAgICAgICAgICYmIGMtPnkgPT0gZC0+eQor ICAgICAgICAgICYmIE1BVFJJWF9ST1dfQk9UVE9NX1kgKGMpIDw9IHliCisgICAgICAgICAgJiYg TUFUUklYX1JPV19CT1RUT01fWSAoZCkgPD0geWIKKyAgICAgICAgICAmJiByb3dfZXF1YWxfcCAo YywgZCwgMSkpCisgICAgICAgIHsKKyAgICAgICAgICBhc3NpZ25fcm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gICAgICAgKytpOworICAgICAgaWYgKGJvdHRvbSA+PSB5YikKKyAgICAg ICAgYnJlYWs7CisgICAgfQorICBsYXN0X25ldyA9IGk7CisgIC8qIFNldCBsYXN0X29sZCB0byB0 aGUgaW5kZXggKyAxIG9mIHRoZSByb3cgdGhhdCByZWFjaGVzIHRoZSBib3R0b20KKyAgICAgYm91 bmRhcnkgaW4gdGhlIGN1cnJlbnQgbWF0cml4LiAgV2UgZG9uJ3QgbG9vayBhdCB0aGUgZW5hYmxl ZAorICAgICBmbGFnIGhlcmUgYmVjYXVzZSB3ZSBwbGFuIHRvIHJldXNlIHBhcnQgb2YgdGhlIGRp c3BsYXkgZXZlbiBpZgorICAgICBvdGhlciBwYXJ0cyBhcmUgZGlzYWJsZWQuICovCisgIGkgPSBm aXJzdF9vbGQgKyAxOworICB3aGlsZSAoaSA8IGN1cnJlbnRfbWF0cml4LT5ucm93cyAtIDEpCisg ICAgeworICAgICAgaW50IGJvdHRvbSA9IE1BVFJJWF9ST1dfQk9UVE9NX1kgKE1BVFJJWF9ST1cg KGN1cnJlbnRfbWF0cml4LCBpKSk7CisgICAgICBpZiAoYm90dG9tIDw9IHliKQorICAgICAgICAr K2k7CisgICAgICBpZiAoYm90dG9tID49IHliKQorICAgICAgICBicmVhazsKKyAgICB9CisgIGxh c3Rfb2xkID0gaTsKKyAgLyogU2tpcCBvdmVyIHJvd3MgZXF1YWwgYXQgdGhlIGJvdHRvbS4gKi8K KyAgaSA9IGxhc3RfbmV3OworICBqID0gbGFzdF9vbGQ7CisgIHdoaWxlIChpIC0gMSA+IGZpcnN0 X25ldworICAgICAgICAgJiYgaiAtIDEgPiBmaXJzdF9vbGQKKyAgICAgICAgICYmIE1BVFJJWF9S T1dfRU5BQkxFRF9QIChjdXJyZW50X21hdHJpeCwgaiAtIDEpCisgICAgICAgICAmJiAoTUFUUklY X1JPVyAoY3VycmVudF9tYXRyaXgsIGogLSAxKS0+eQorICAgICAgICAgICAgID09IE1BVFJJWF9S T1c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KKyAgICAgYmVjYXVzZSBuZXh0X2FsbW9zdF9wcmlt ZSAoMTEzKSB3b3VsZCBiZSAxMjcuICovCisgIHsKKyAgICB2ZXJpZnkgKE5FWFRfQUxNT1NUX1BS SU1FX0xJTUlUID09IDExKTsKKyAgICBlbnVtIHsgbmV4dF9hbG1vc3RfcHJpbWVfaW5jcmVtZW50 X21heCA9IDEwIH07CisgICAgcHRyZGlmZl90IHJvd190YWJsZV9tYXggPQorICAgICAgKG1pbiAo UFRSRElGRl9NQVgsIFNJWkVfTUFYKSAvICgzICogc2l6ZW9mICptY19yb3dfdGFibGUpCisgICAg ICAgLSBuZXh0X2FsbW9zdF9wcmltZV9pbmNyZW1lbnRfbWF4KTsKKyAgICBwdHJkaWZmX3QgY3Vy cmVudF9ucm93c19tYXggPSByb3dfdGFibGVfbWF4IC0gZGVzaXJlZF9tYXRyaXgtPm5yb3dzOwor ICAgIGlmIChjdXJyZW50X25yb3dzX21heCA8IGN1cnJlbnRfbWF0cml4LT5ucm93cykKKyAgICAg IG1lbW9yeV9mdWxsIChTSVpFX01BWCk7CisgIH0KKyAgLyogUmVhbGxvY2F0ZSB2ZWN0b3JzLCB0 YWJsZXMgZXRjLiBpZiBuZWNlc3NhcnkuICovCisgIGlmIChjdXJyZW50X21hdHJpeC0+bnJvd3Mg PiBtY19vbGRfbGluZXNfc2l6ZSkKKyAgICBtY19vbGRfbGluZXMgPSB4cGFsbG9jIChtY19vbGRf bGluZXMsICZtY19vbGRfbGluZXNfc2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICBjdXJy ZW50X21hdHJpeC0+bnJvd3MgLSBtY19vbGRfbGluZXNfc2l6ZSwKKyAgICAgICAgICAgICAgICAg ICAgICAgICBJTlRfTUFYLCBzaXplb2YgKm1jX29sZF9saW5lcyk7CisgIGlmIChkZXNpcmVkX21h dHJpeC0+bnJvd3MgPiBtY19uZXdfbGluZXNfc2l6ZSkKKyAgICBtY19uZXdfbGluZXMgPSB4cGFs bG9jIChtY19uZXdfbGluZXMsICZtY19uZXdfbGluZXNfc2l6ZSwKKyAgICAgICAgICAgICAgICAg ICAgICAgICBkZXNpcmVkX21hdHJpeC0+bnJvd3MgLSBtY19uZXdfbGluZXNfc2l6ZSwKKyAgICAg ICAgICAgICAgICAgICAgICAgICBJTlRfTUFYLCBzaXplb2YgKm1jX25ld19saW5lcyk7CisgIG4g PSBkZXNpcmVkX21hdHJpeC0+bnJvd3M7CisgIG4gKz0gY3VycmVudF9tYXRyaXgtPm5yb3dzOwor ICBpZiAobWNfcm93X3RhYmxlX3NpemUgPCAzICogbikKKyAgICB7CisgICAgICBwdHJkaWZmX3Qg c2l6ZSA9IG5leHRfYWxtb3N0X3ByaW1lICgzICogbik7CisgICAgICBtY19yb3dfdGFibGUgPSB4 bnJlYWxsb2MgKG1jX3Jvd190YWJsZSwgc2l6ZSwgc2l6ZW9mICptY19yb3dfdGFibGUpOworICAg ICAgbWNfcm93X3RhYmxlX3NpemUgPSBzaXplOworICAgICAgbWVtc2V0IChtY19yb3dfdGFibGUs IDAsIHNpemUgKiBzaXplb2YgKm1jX3Jvd190YWJsZSk7CisgICAgfQorICBpZiAobiA+IG1jX3Jv d19lbnRyeV9wb29sX3NpemUpCisgICAgbWNfcm93X2VudHJ5X3Bvb2wgPSB4cGFsbG9jIChtY19y b3dfZW50cnlfcG9vbCwgJm1jX3Jvd19lbnRyeV9wb29sX3NpemUsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBuIC0gbWNfcm93X2VudHJ5X3Bvb2xfc2l6ZSwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIC0xLCBzaXplb2YgKm1jX3Jvd19lbnRyeV9wb29sKTsKKyAgaWYgKGRl c2lyZWRfbWF0cml4LT5ucm93cyA+IG1jX3J1bnNfc2l6ZSkKKyAgICB7CisgICAgICBtY19ydW5z ID0geG5yZWFsbG9jIChtY19ydW5zLCBkZXNpcmVkX21hdHJpeC0+bnJvd3MsIHNpemVvZiAqbWNf cnVucyk7CisgICAgICBtY19ydW5fcG9vbCA9IHhucmVhbGxvYyAobWNfcnVuX3Bvb2wsIGRlc2ly ZWRfbWF0cml4LT5ucm93cywgc2l6ZW9mICptY19ydW5fcG9vbCk7CisgICAgICBtY19ydW5zX3Np emUgPSBkZXNpcmVkX21hdHJpeC0+bnJvd3M7CisgICAgfQorICBucnVucyA9IHJ1bl9pZHggPSAw OworICBtY19yb3dfZW50cnlfaWR4ID0gMDsKKyAgLyogQWRkIHJvd3MgZnJvbSB0aGUgY3VycmVu dCBhbmQgZGVzaXJlZCBtYXRyaXggdG8gdGhlIGhhc2ggdGFibGUKKyAgICAgcm93X2hhc2hfdGFi bGUgdG8gYmUgYWJsZSB0byBmaW5kIGVxdWFsIG9uZXMgcXVpY2tseS4gKi8KKyAgZm9yIChpID0g Zmlyc3Rfb2xkOyBpIDwgbGFzdF9vbGQ7ICsraSkKKyAgICB7CisgICAgICBpZiAoTUFUUklYX1JP V19FTkFCTEVEX1AgKGN1cnJlbnRfbWF0cml4LCBpKSkKKyAgICAgICAgeworICAgICAgICAgIGVu dHJ5ID0gbWNfYWRkX3Jvd19lbnRyeSAoTUFUUklYX1JPVyAoY3VycmVudF9tYXRyaXgsIGkpKTsK KyAgICAgICAgICBtY19vbGRfbGluZXNbaV0gPSBlbnRyeTsKKyAgICAgICAgICArK2VudHJ5LT5v bGRfdXNlczsKKyAgICAgICAgfQorICAgICAgZWxzZQorICAgICAgICBtY19vbGRfbGluZXNbaV0g PSBOVUxMOworICAgIH0KKyAgZm9yIChpID0gZmlyc3RfbmV3OyBpIDwgbGFzdF9uZXc7ICsraSkK KyAgICB7CisgICAgICBlYXNzZXJ0IChNQVRSSVhfUk9XX0VOQUJMRURfUCAoZGVzaXJlZF9tYXRy aXgsIGkpKTsKKyAgICAgIGVudHJ5ID0gbWNfYWRkX3Jvd19lbnRyeSAoTUFUUklYX1JPVyAoZGVz aXJlZF9tYXRyaXgsIGkpKTsKKyAgICAgICsrZW50cnktPm5ld191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ICAgICBxID0gbmV3X2xpbmUgLSAxOworICAgICAgICB3aGlsZSAocCA+IGZp cnN0X29sZAorICAgICAgICAgICAgICAgJiYgcSA+IGZpcnN0X25ldworICAgICAgICAgICAgICAg JiYgbWNfb2xkX2xpbmVzW3BdID09IG1jX25ld19saW5lc1txXSkKKyAgICAgICAgICB7CisgICAg ICAgICAgICBpbnQgaCA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCBwKS0+aGVpZ2h0Owor ICAgICAgICAgICAgLS1ydW4tPmN1cnJlbnRfdnBvczsKKyAgICAgICAgICAgIC0tcnVuLT5kZXNp cmVkX3Zwb3M7CisgICAgICAgICAgICArK3J1bi0+bnJvd3M7CisgICAgICAgICAgICBydW4tPmhl aWdodCArPSBoOworICAgICAgICAgICAgcnVuLT5kZXNpcmVkX3kgLT0gaDsKKyAgICAgICAgICAg IHJ1bi0+Y3VycmVudF95IC09IGg7CisgICAgICAgICAgICAtLXAsIC0tcTsKKyAgICAgICAgICB9 CisgICAgICAgIC8qIEV4dGVuZCBmb3J3YXJkLiAqLworICAgICAgICBwID0gaSArIDE7CisgICAg ICAgIHEgPSBuZXdfbGluZSArIDE7CisgICAgICAgIHdoaWxlIChwIDwgbGFzdF9vbGQKKyAgICAg ICAgICAgICAgICYmIHEgPCBsYXN0X25ldworICAgICAgICAgICAgICAgJiYgbWNfb2xkX2xpbmVz W3BdID09IG1jX25ld19saW5lc1txXSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpbnQgaCA9 IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCBwKS0+aGVpZ2h0OworICAgICAgICAgICAgKyty dW4tPm5yb3dzOworICAgICAgICAgICAgcnVuLT5oZWlnaHQgKz0gaDsKKyAgICAgICAgICAgICsr cCwgKytxOworICAgICAgICAgIH0KKyAgICAgICAgLyogSW5zZXJ0IHJ1biBpbnRvIGxpc3Qgb2Yg YWxsIHJ1bnMuICBPcmRlciBydW5zIGJ5IGNvcGllZAorICAgICAgICAgICBwaXhlbCBsaW5lcy4g IE5vdGUgdGhhdCB3ZSByZWNvcmQgcnVucyB0aGF0IGRvbid0IGhhdmUgdG8KKyAgICAgICAgICAg YmUgY29waWVkIGJlY2F1c2UgdGhleSBhcmUgYWxyZWFkeSBpbiBwbGFjZS4gIFRoaXMgaXMgZG9u ZQorICAgICAgICAgICBiZWNhdXNlIHdlIGNhbiBhdm9pZCBjYWxsaW5nIHVwZGF0ZV93aW5kb3df bGluZSBpbiB0aGlzCisgICAgICAgICAgIGNhc2UuICovCisgICAgICAgIGZvciAocCA9IDA7IHAg PCBucnVucyAmJiBtY19ydW5zW3BdLT5oZWlnaHQgPiBydW4tPmhlaWdodDsgKytwKQorICAgICAg ICAgIDsKKyAgICAgICAgZm9yIChxID0gbnJ1bnM7IHEgPiBwOyAtLXEpCisgICAgICAgICAgbWNf cnVuc1txXSA9IG1jX3J1bnNbcSAtIDFdOworICAgICAgICBtY19ydW5zW3BdID0gcnVuOworICAg ICAgICArK25ydW5zOworICAgICAgICBpICs9IHJ1bi0+bnJvd3M7CisgICAgICB9CisgICAgICBl bHNlCisgICAgICAgICsraTsKKyAgLyogRG8gdGhlIG1vdmVzLiAgRG8gaXQgaW4gYSB3YXkgdGhh dCB3ZSBkb24ndCBvdmVyd3JpdGUgc29tZXRoaW5nCisgICAgIHdlIHdhbnQgdG8gY29weSBsYXRl ciBvbi4gIFRoaXMgaXMgbm90IHNvbHZhYmxlIGluIGdlbmVyYWwKKyAgICAgYmVjYXVzZSB0aGVy ZSBpcyBvbmx5IG9uZSBkaXNwbGF5IGFuZCB3ZSBkb24ndCBoYXZlIGEgd2F5IHRvCisgICAgIGV4 Y2hhbmdlIGFyZWFzIG9uIHRoaXMgZGlzcGxheS4gIEV4YW1wbGU6CisgICAgICAgICAgKy0tLS0t LS0tLS0tKyAgICAgICArLS0tLS0tLS0tLS0rCisgICAgICAgICAgfCAgICAgQSAgICAgfCAgICAg ICB8ICAgICBCICAgICB8CisgICAgICAgICAgKy0tLS0tLS0tLS0tKyAgLS0+ICArLS0tLS0tLS0t LS0rCisgICAgICAgICAgfCAgICAgQiAgICAgfCAgICAgICB8ICAgICBBICAgICB8CisgICAgICAg ICAgKy0tLS0tLS0tLS0tKyAgICAgICArLS0tLS0tLS0tLS0rCisgICAgIEluc3RlYWQsIHByZWZl ciBiaWdnZXIgbW92ZXMsIGFuZCBpbnZhbGlkYXRlIG1vdmVzIHRoYXQgd291bGQKKyAgICAgY29w eSBmcm9tIHdoZXJlIHdlIGNvcGllZCB0by4gKi8KKyAgZm9yIChpID0gMDsgaSA8IG5ydW5zOyAr K2kpCisgICAgaWYgKG1jX3J1bnNbaV0tPm5yb3dzID4gMCkKKyAgICAgIHsKKyAgICAgICAgc3Ry dWN0IHJ1biAqciA9IG1jX3J1bnNbaV07CisgICAgICAgIGlmIChyLT5jdXJyZW50X3kgIT0gci0+ ZGVzaXJlZF95KQorICAgICAgICAgIHsKKyAgICAgICAgICAgIC8vICBmcHJpbnRmIChzdGRlcnIs ICIlczogIHItPmN1cnJlbnQvZGVzaXJlZF92cG9zICglZC8lZCkgfCByLT5jdXJyZW50L2Rlc2ly ZWRfeSAoJWQvJWQpXG4iLAorICAgICAgICAgICAgLy8gICAgICAgICAgIHItPmN1cnJlbnRfeSA8 IHItPmRlc2lyZWRfeSA/ICLihpMiIDogIuKGkSIsCisgICAgICAgICAgICAvLyAgICAgICAgICAg ci0+Y3VycmVudF92cG9zLCByLT5kZXNpcmVkX3Zwb3MsIHItPmN1cnJlbnRfeSwgci0+ZGVzaXJl ZF95KTsKKyAgICAgICAgICAgIC8vICByaWYtPmNsZWFyX3dpbmRvd19tb3VzZV9mYWNlICh3KTsK KyAgICAgICAgICAgIC8vICByaWYtPnNjcm9sbF9ydW5faG9vayAodywgcik7CisgICAgICAgICAg fQorICAgICAgICAvKiBUcnVuY2F0ZSBydW5zIHRoYXQgY29weSB0byB3aGVyZSB3ZSBjb3BpZWQg dG8sIGFuZAorICAgICAgICAgICBpbnZhbGlkYXRlIHJ1bnMgdGhhdCBjb3B5IGZyb20gd2hlcmUg d2UgY29waWVkIHRvLiAqLworICAgICAgICBmb3IgKGogPSBucnVucyAtIDE7IGogPiBpOyAtLWop CisgICAgICAgICAgeworICAgICAgICAgICAgc3RydWN0IHJ1biAqcCA9IG1jX3J1bnNbal07Cisg ICAgICAgICAgICBib29sIHRydW5jYXRlZF9wID0gMDsKKyAgICAgICAgICAgIGlmIChwLT5ucm93 cyA+IDAKKyAgICAgICAgICAgICAgICAmJiBwLT5kZXNpcmVkX3kgPCByLT5kZXNpcmVkX3kgKyBy LT5oZWlnaHQKKyAgICAgICAgICAgICAgICAmJiBwLT5kZXNpcmVkX3kgKyBwLT5oZWlnaHQgPiBy LT5kZXNpcmVkX3kpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAocC0+ZGVz aXJlZF95IDwgci0+ZGVzaXJlZF95KQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgICAgICBwLT5ucm93cyA9IHItPmRlc2lyZWRfdnBvcyAtIHAtPmRlc2lyZWRfdnBvczsKKyAg ICAgICAgICAgICAgICAgICAgcC0+aGVpZ2h0ID0gci0+ZGVzaXJlZF95IC0gcC0+ZGVzaXJlZF95 OworICAgICAgICAgICAgICAgICAgICB0cnVuY2F0ZWRfcCA9IDE7CisgICAgICAgICAgICAgICAg ICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgICBpbnQgbnJvd3NfY29waWVkID0gKHItPmRlc2lyZWRfdnBvcyArIHItPm5yb3dz CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBwLT5kZXNpcmVkX3Zw b3MpOworICAgICAgICAgICAgICAgICAgICBpZiAocC0+bnJvd3MgPD0gbnJvd3NfY29waWVkKQor ICAgICAgICAgICAgICAgICAgICAgIHAtPm5yb3dzID0gMDsKKyAgICAgICAgICAgICAgICAgICAg ICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAg ICAgIGludCBoZWlnaHRfY29waWVkID0gKHItPmRlc2lyZWRfeSArIHItPmhlaWdodAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIHAtPmRlc2lyZWRfeSk7 CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmN1cnJlbnRfdnBvcyArPSBucm93c19jb3Bp ZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmRlc2lyZWRfdnBvcyArPSBucm93c19j b3BpZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPm5yb3dzIC09IG5yb3dzX2NvcGll ZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcC0+Y3VycmVudF95ICs9IGhlaWdodF9jb3Bp ZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmRlc2lyZWRfeSArPSBoZWlnaHRfY29w aWVkOworICAgICAgICAgICAgICAgICAgICAgICAgICBwLT5oZWlnaHQgLT0gaGVpZ2h0X2NvcGll ZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ1bmNhdGVkX3AgPSAxOworICAgICAgICAg ICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICBpZiAoci0+Y3VycmVudF95ICE9IHItPmRlc2lyZWRfeQorICAgICAgICAgICAg ICAgIC8qIFRoZSBjb25kaXRpb24gYmVsb3cgaXMgZXF1aXZhbGVudCB0bworICAgICAgICAgICAg ICAgICAgICgocC0+Y3VycmVudF95ID49IHItPmRlc2lyZWRfeQorICAgICAgICAgICAgICAgICAg ICAgJiYgcC0+Y3VycmVudF95IDwgci0+ZGVzaXJlZF95ICsgci0+aGVpZ2h0KQorICAgICAgICAg ICAgICAgICAgICB8fCAocC0+Y3VycmVudF95ICsgcC0+aGVpZ2h0ID4gci0+ZGVzaXJlZF95Cisg ICAgICAgICAgICAgICAgICAgICAgICAmJiAocC0+Y3VycmVudF95ICsgcC0+aGVpZ2h0CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPD0gci0+ZGVzaXJlZF95ICsgci0+aGVpZ2h0KSkpCisg ICAgICAgICAgICAgICAgICAgYmVjYXVzZSB3ZSBoYXZlIDAgPCBwLT5oZWlnaHQgPD0gci0+aGVp Z2h0LiAqLworICAgICAgICAgICAgICAgICYmIHAtPmN1cnJlbnRfeSA8IHItPmRlc2lyZWRfeSAr IHItPmhlaWdodAorICAgICAgICAgICAgICAgICYmIHAtPmN1cnJlbnRfeSArIHAtPmhlaWdodCA+ IHItPmRlc2lyZWRfeSkKKyAgICAgICAgICAgICAgcC0+bnJvd3MgPSAwOworICAgICAgICAgICAg LyogUmVvcmRlciBydW5zIGJ5IGNvcGllZCBwaXhlbCBsaW5lcyBpZiB0cnVuY2F0ZWQuICovCisg ICAgICAgICAgICBpZiAodHJ1bmNhdGVkX3AgJiYgcC0+bnJvd3MgPiAwKQorICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgaW50IGsgPSBucnVucyAtIDE7CisgICAgICAgICAgICAgICAg d2hpbGUgKG1jX3J1bnNba10tPm5yb3dzID09IDAgfHwgbWNfcnVuc1trXS0+aGVpZ2h0IDwgcC0+ aGVpZ2h0KQorICAgICAgICAgICAgICAgICAgay0tOworICAgICAgICAgICAgICAgIG1lbW1vdmUg KG1jX3J1bnMgKyBqLCBtY19ydW5zICsgaiArIDEsIChrIC0gaikgKiBzaXplb2YgKCptY19ydW5z KSk7CisgICAgICAgICAgICAgICAgbWNfcnVuc1trXSA9IHA7CisgICAgICAgICAgICAgIH0KKyAg ICAgICAgICB9CisgICAgICAgIC8qIEFzc2lnbiBtYXRyaXggcm93cy4gKi8KKyAgICAgICAgZm9y IChqID0gMDsgaiA8IHItPm5yb3dzOyArK2opCisgICAgICAgICAgeworICAgICAgICAgICAgc3Ry dWN0IGdseXBoX3JvdyAqZnJvbSwgKnRvOworICAgICAgICAgICAgYm9vbCB0b19vdmVybGFwcGVk X3A7CisgICAgICAgICAgICB0byA9IE1BVFJJWF9ST1cgKGN1cnJlbnRfbWF0cml4LCByLT5kZXNp cmVkX3Zwb3MgKyBqKTsKKyAgICAgICAgICAgIGZyb20gPSBNQVRSSVhfUk9XIChkZXNpcmVkX21h dHJpeCwgci0+ZGVzaXJlZF92cG9zICsgaik7CisgICAgICAgICAgICB0b19vdmVybGFwcGVkX3Ag PSB0by0+b3ZlcmxhcHBlZF9wOworICAgICAgICAgICAgZnJvbS0+cmVkcmF3X2ZyaW5nZV9iaXRt YXBzX3AgPSBmcm9tLT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3A7CisgICAgICAgICAgICBhc3Np Z25fcm93ICh0bywgZnJvbSk7CisgICAgICAgICAgICAvKiBUaGUgYWJvdmUgYGFzc2lnbl9yb3cn IGFjdHVhbGx5IGRvZXMgc3dhcCwgc28gaWYgd2UgaGFkCisgICAgICAgICAgICAgICBhbiBvdmVy bGFwIGluIHRoZSBjb3B5IGRlc3RpbmF0aW9uIG9mIHR3byBydW5zLCB0aGVuCisgICAgICAgICAg ICAgICB0aGUgc2Vjb25kIHJ1biB3b3VsZCBhc3NpZ24gYSBwcmV2aW91c2x5IGRpc2FibGVkIGJv Z3VzCisgICAgICAgICAgICAgICByb3cuICBCdXQgdGhhbmtzIHRvIHRoZSB0cnVuY2F0aW9uIGNv ZGUgaW4gdGhlCisgICAgICAgICAgICAgICBwcmVjZWRpbmcgZm9yLWxvb3AsIHdlIG5vIGxvbmdl ciBoYXZlIHN1Y2ggYW4gb3ZlcmxhcCwKKyAgICAgICAgICAgICAgIGFuZCB0aHVzIHRoZSBhc3Np Z25lZCByb3cgc2hvdWxkIGFsd2F5cyBiZSBlbmFibGVkLiAqLworICAgICAgICAgICAgZWFzc2Vy dCAodG8tPmVuYWJsZWRfcCk7CisgICAgICAgICAgICBmcm9tLT5lbmFibGVkX3AgPS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ZXQgYmVlbiBzd2FwcGVkIGJ5CisgIGBtYWtlX2N1cnJlbnQnIGluIGB1cGRhdGVfd2lu ZG93X2xpbmUnLCBvciBiZWNhdXNlIHRoZSBwcmV2aW91cyByb3cgd291bGQgYmUKKyAgdGhlIHNh bWUgaW4gYm90aCBtYXRyaWNlcyBpZiB3ZSBqdW1wZWQgdG8gYHNldF9jdXJzb3I6YCB3aXRoaW4g YHVwZGF0ZV93aW5kb3cnCisgIGFuZCBgbWNfdXBkYXRlX3dpbmRvd19kcnlydW4nLiAqLworICBp bnQgcHJldl9tYXRyaXhfcm93X3N0YXJ0X2J5dGVwb3MgPSAodnBvcyAhPSAwKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1BVFJJWF9ST1dfU1RBUlRfQllURVBPUyAo Y3VycmVudF9yb3cgLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IC0xOworICBpbnQgcHJldl9tYXRyaXhfcm93X2VuZF9ieXRlcG9zID0gKHZwb3MgIT0gMCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUFUUklYX1JPV19FTkRfQllURVBP UyAoY3VycmVudF9yb3cgLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiAtMTsKKyAgaW50IG1hdHJpeF9yb3dfc3RhcnRfYnl0ZXBvcyA9IE1BVFJJWF9ST1dfU1RBUlRf QllURVBPUyAoZGVzaXJlZF9yb3cpOworICBpbnQgbWF0cml4X3Jvd19lbmRfYnl0ZXBvcyA9IE1B VFJJWF9ST1dfRU5EX0JZVEVQT1MgKGRlc2lyZWRfcm93KTsKKyAgLyogVGhlIGZpcnN0IGNvbmRp dGlvbiB0ZXN0cyBmb3IgYSBzb2xpdGFyeSByb3cgY29udGFpbmluZyBaViwgcHJlY2VkZWQgYnkg YQorICByb3cgY29udGFpbmluZyBhIHBlbnVsdGltYXRlIGdseXBoIHdpdGggYSBjaGFycG9zIG9m IFpWIC0gMSBmb2xsb3dlZCBieSBhbiBlbmQKKyAgb2Ygcm93IHNwYWNlIGdseXBoIHdpdGggYSBj aGFycG9zIG9mIDAuICBUaGUgb3RoZXIgY29uZGl0aW9ucyB0ZXN0IGZvciBhbiBlbXB0eQorICBi dWZmZXIgKG5vdCBuYXJyb3dlZCksIG9yIGFuIGVtcHR5IG5hcnJvd2VkIGJ1ZmZlci4gKi8KKyAg Ym9vbCByb3dfYXRfenZfcCA9ICgodnBvcyAhPSAwCisgICAgICAgICAgICAgICAgICAgICAgICYm IChjdXJyZW50X3JvdyAtIDEpLT51c2VkW1RFWFRfQVJFQV0gPiAwCisgICAgICAgICAgICAgICAg ICAgICAgICYmIHByZXZfbWF0cml4X3Jvd19zdGFydF9ieXRlcG9zICE9IHByZXZfbWF0cml4X3Jv d19lbmRfYnl0ZXBvcworICAgICAgICAgICAgICAgICAgICAgICAmJiAhKGN1cnJlbnRfcm93IC0g MSktPmVuZHNfYXRfenZfcAorICAgICAgICAgICAgICAgICAgICAgICAmJiBtYXRyaXhfcm93X3N0 YXJ0X2J5dGVwb3MgPT0gbWF0cml4X3Jvd19lbmRfYnl0ZXBvcworICAgICAgICAgICAgICAgICAg ICAgICAmJiBkZXNpcmVkX3Jvdy0+ZW5kc19hdF96dl9wKQorICAgICAgICAgICAgICAgICAgICAg IHx8ICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA9PSAxKQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgfHwgKGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwICYmIHZwb3MgPT0gMCkp CisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGJ1ZmZlcl9uYXJyb3dlZF9wCisgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIGJvYl9yZXNwZWN0X25hcnJvdyA9PSBlb2JfcmVzcGVjdF9u YXJyb3cpCisgICAgICAgICAgICAgICAgICAgICAgfHwgKCgoaGVhZGVyX2xpb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F9tYXRyaXggPSB3LT5kZXNpcmVkX21hdHJpeDsKKyAgaWYgKGRl YnVnX3ApCisgICAgZnByaW50ZiAoc3RkZXJyLCAibWNfdXBkYXRlX3RleHRfYXJlYSAoJXMpOiAg dnBvcyAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgIG1jX3dpbmRvdyAodyksIHZwb3Mp OworICAvKiBJbmFzbXVjaCBhcyB3ZSBwcm9jZXNzIHRoZSBjdXJzb3Igcm93IGJlZm9yZSBhbGwg b3RoZXIgcm93cywgd2UgY2FuIHJlbHkKKyAgdXBvbiB0aGUgcHJldmlvdXMgYGRlc2lyZWRfcm93 YCB0byBiZSBhY2N1cmF0ZS4gKi8KKyAgZW51bSBtY19yb3dfcG9zaXRpb24gcm93X3Bvc2l0aW9u ID0gIG1jX3Jvd19wb3NpdGlvbiAodywgdnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGRlc2ly ZWRfcm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogY3VycmVudF9yb3csCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2lyZWRfcm93LCB2cG9zKTsKKyAgLyogSWYgcm93 cyBhcmUgYXQgZGlmZmVyZW50IFggb3IgWSwgb3Igcm93cyBoYXZlIGRpZmZlcmVudCBoZWlnaHQs CisgICAgIG9yIHRoZSBjdXJyZW50IHJvdyBpcyBtYXJrZWQgaW52YWxpZCwgd3JpdGUgdGhlIGVu dGlyZSBsaW5lLiAqLworICBpZiAoIWN1cnJlbnRfcm93LT5lbmFibGVkX3AKKyAgICAgIHx8IGRl c2lyZWRfcm93LT55ICE9IGN1cnJlbnRfcm93LT55CisgICAgICB8fCBkZXNpcmVkX3Jvdy0+YXNj ZW50ICE9IGN1cnJlbnRfc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CBkZXNpcmVkX3Jvdy0+eSwgZGVzaXJlZF9yb3ctPngp OworICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIldSSVRFIEVO VElSRSBST1c6XG5cCisgICAgICAgICAgdnBvcyAoJWQpIHwgY2hhciAoJWQvJXMpIHwgc3RhcnRf eDogKCVkKSB8IHN0YXJ0X2hwb3MgKCVkLyVkKVxuIiwKKyAgICAgICAgICB2cG9zLCBkZXNpcmVk X3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV0tPnUuY2gsCisgICAgICAgICAgbWNfY2hhcl90b19zdHJp bmcgKGRlc2lyZWRfcm93LT5nbHlwaHNbVEVYVF9BUkVBXS0+dS5jaCksCisgICAgICAgICAgZGVz aXJlZF9yb3ctPngsIDAsIGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKTsKKyAgICAg IGlmIChkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdKQorICAgICAgICB7CisgICAgICAgICAg YmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgaW50IGxlbiA9IGRlc2lyZWRfcm93LT51c2VkW1RF WFRfQVJFQV07CisgICAgICAgICAgaW50IGhwb3MgPSBkZXNpcmVkX3Jvdy0+Z2x5cGhzW1RFWFRf QVJFQV0gLSB1cGRhdGVkX3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV07CisgICAgICAgICAgdy0+b3V0 cHV0X2N1cnNvci54ID0KKyAgICAgICAgICAgIG1jX2RyYXdfZ2x5cGhzICh3LCBkZXNpcmVkX21h dHJpeCwgdXBkYXRlZF9yb3csIHctPm1jX21hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICB3LT5vdXRwdXRfY3Vyc29yLngsIFRFWFRfQVJFQSwgaHBvcywgaHBvcyArIGxlbiwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICBEUkFXX05PUk1BTF9URVhULCAwLCB2cG9zLCBsc2ws IGdse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isgICAgICAgIGN1cnJlbnQgcm93IGFsc28gZG9lcyBzbyBhdCB0aGUgc2FtZSBwb3NpdGlv biwgbWFrZSBzdXJlIHdlIHdyaXRlIGF0IGxlYXN0IG9uZQorICAgICAgICBnbHlwaCwgc28gdGhh dCB0aGUgZmFjZSBleHRlbnNpb24gYWN0dWFsbHkgdGFrZXMgcGxhY2UuICovCisgICAgICAgIGlm IChNQVRSSVhfUk9XX0VYVEVORFNfRkFDRV9QIChkZXNpcmVkX3JvdykKKyAgICAgICAgICAgICYm IChkZXNpcmVkX3N0b3BfcG9zIDwgY3VycmVudF9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAg ICAgICAgICAgIHx8IChkZXNpcmVkX3N0b3BfcG9zID09IGN1cnJlbnRfcm93LT51c2VkW1RFWFRf QVJFQV0KKyAgICAgICAgICAgICAgICAgICAgJiYgIU1BVFJJWF9ST1dfRVhURU5EU19GQUNFX1Ag KGN1cnJlbnRfcm93KSkpKQorICAgICAgICAgIC0tZGVzaXJlZF9zdG9wX3BvczsKKyAgICAgICAg c3RvcCA9IG1pbiAoY3VycmVudF9yb3ctPnVzZWRbVEVYVF9BUkVBXSwgZGVzaXJlZF9zdG9wX3Bv cyk7CisgICAgICAgIGkgPSAwOworICAgICAgICB4ID0gZGVzaXJlZF9yb3ctPng7CisgICAgICAg IGludCBjbGVhcl90b194ID0gMDsKKworICAgICAgICAvKiBMb29wIG92ZXIgZ2x5cGhzIHRoYXQg Y3VycmVudCBhbmQgZGVzaXJlZCByb3cgbWF5IGhhdmUgaW4gY29tbW9uLiAqLworICAgICAgICB3 aGlsZSAoaSA8IHN0b3ApCisgICAgICAgICAgeworICAgICAgICAgICAgYXJyYXlfZ2x5cGhzX3Nr aXBwZWQudXNlZCA9IDA7CisgICAgICAgICAgICBib29sIGNhbl9za2lwX3AgPSAhYWJvcnRfc2tp cHBpbmc7CisgICAgICAgICAgICAvKiBTa2lwIG92ZXIgZ2x5cGhzIHRoYXQgYm90aCByb3dzIGhh dmUgaW4gY29tbW9uLiAgVGhlc2UgZG9uJ3QgaGF2ZQorICAgICAgICAgICAgdG8gYmUgd3JpdHRl bi4gIFdlIGNhbid0IHNraXAgaWYgdGhlIGxhc3QgY3VycmVudCBnbHlwaCBvdmVybGFwcyB0aGUK KyAgICAgICAgICAgIGdseXBoIHRvIGl0cyByaWdodC4gIEZvciBleGFtcGxlLCBjb25zaWRlciBh IGN1cnJlbnQgcm93IG9mIGBpZicgd2l0aAorICAgICAgICAgICAgdGhlIGBmJyBpbiBDb3VyaWVy IGJvbGQgc28gdGhhdCBpdCBvdmVybGFwcyB0aGUgYCAnIHRvIGl0cyByaWdodC4KKyAgICAgICAg ICAgIElmIHRoZSBkZXNpcmVkIHJvdyBpcyBgICcsIHdlIHdvdWxkIHNraXAgb3ZlciB0aGUgc3Bh Y2UgYWZ0ZXIgdGhlCisgICAgICAgICAgICBgaWYnIGFuZCB0aGVyZSB3b3VsZCByZW1haW4gYSBw aXhlbCBmcm9tIHRoZSBgZicgb24gdGhlIHNjcmVlbi4gKi8KKyAgICAgICAgICAgIGlmIChvdmVy bGFwcGluZ19nbHlwaHNfcCAmJiBpID4gMCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAg ICAgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSAmY3VycmVudF9yb3ctPmdseXBoc1tURVhUX0FSRUFd W2kgLSAxXTsKKyAgICAgICAgICAgICAgICBpbnQgbGVmdCwgcmlnaHQ7CisgICAgICAgICAgICAg ICAgcmlmLT5nZXRfZ2x5cGhfb3ZlcmhhbmdzIChnbHlwaCwgWEZSQU1FICh3LT5mcmFtZSksICZs ZWZ0LCAmcmlnaHQpOworICAgICAgICAgICAgICAgIGNhbl9za2lwX3AgPSAocmlnaHQgPT0gMCAm JiAhYWJvcnRfc2tpcHBpbmcpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoY2Fu X3NraXBfcCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGludCBzdGFydF9ocG9z ID0gaTsKKyAgICAgICAgICAgICAgICB3aGlsZSAoaSA8IHN0b3AKKyAgICAgICAgICAgICAgICAg ICAgICAgJiYgR0xZUEhfRVFVQUxfUCAoZGVzaXJlZF9nbHlwaCwgY3VycmVudF9nbHlwaCkpCisg ICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICsrYXJyYXlfZ2x5cGhzX3Nr aXBwZWQudXNlZDsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGFycmF5X2dseXBoc19za2lwcGVk LmFsbG9jYXRlZCA8IGFycmF5X2dseXBoc19za2lwcGVkLnVzZWQpCisgICAgICAgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgaW50IG9sZF9hbGxvYyA9IGFycmF5X2ds eXBoc19za2lwcGVkLmFsbG9jYXRlZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBuZXdf ZWx0cyA9IGFycmF5X2dseXBoc19za2lwcGVkLnVzZWQgLSBhcnJheV9nbHlwaHNfc2tpcHBlZC5h bGxvY2F0ZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICBhcnJheV9nbHlwaHNfc2tpcHBlZC5z a2lwcGVkID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgeHBhbGxvYyAoYXJyYXlfZ2x5cGhz X3NraXBwZWQuc2tpcHBlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmFy cmF5X2dseXBoc19za2lwcGVkLmFsbG9jYXRlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgbmV3X2VsdHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElO VF9NQVgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZiAqYXJyYXlf Z2x5cGhzX3NraXBwZWQuc2tpcHBlZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBtZW1zZXQg KGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWQgKyBvbGRfYWxsb2MsIDAsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAoYXJyYXlfZ2x5cGhzX3NraXBwZWQuYWxsb2NhdGVkIC0g b2xkX2FsbG9jKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHNpemVvZiAq YXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBlZCk7CisgICAgICAgICAgICAgICAgICAgICAgfQor ICAgICAgICAgICAgICAgICAgICBpbnQgbnRoID0gYXJyYXlfZ2x5cGhzX3NraXBwZWQudXNlZCAt IDE7CisgICAgICAgICAgICAgICAgICAgIGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbbnRo XS54ID0geDsKKyAgICAgICAgICAgICAgICAgICAgYXJyYXlfZ2x5cGhzX3NraXBwZWQuc2tpcHBl ZFtudGhdLmhwb3MgPSBpOworICAgICAgICAgICAgICAgICAgICBhcnJheV9nbHlwaHNfc2tpcHBl ZC5za2lwcGVkW250aF0uZW5hYmxlZF9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgeCAr PSBkZXNpcmVkX2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgKytkZXNp cmVkX2dseXBoLCArK2N1cnJlbnRfZ2x5cGgsICsraTsKKyAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgICAvKiBDb25zaWRlciB0aGUgY2FzZSB0aGF0IHRoZSBjdXJyZW50IHJvdyBj b250YWlucyAieHh4IHBwcCBnZ2ciIGluCisgICAgICAgICAgICAgICAgaXRhbGljIENvdXJpZXIg Zm9udCwgYW5kIHRoZSBkZXNpcmVkIHJvdyBpcyAieHh4IGdnZyIuICBUaGUgY2hhcmFjdGVyIGBw JworICAgICAgICAgICAgICAgIGhhcyBsYmVhcmluZywgYGcnIGhhcyBub3QuICBUaGUgbG9vcCBh Ym92ZSB3aWxsIHN0b3AgaW4gZnJvbnQgb2YgdGhlCisgICAgICAgICAgICAgICAgZmlyc3QgYHAn IGluIHRoZSBjdXJyZW50IHJvdy4gIElmIHdlIHdvdWxkIHN0YXJ0IHdyaXRpbmcgZ2x5cGhzIHRo ZXJlLCB3ZQorICAgICAgICAgICAgICAgIHdvdWxkbid0IGVyYXNlIHRoZSBsYmVhcmluZyBvZiB0 aGUgYHAnLiAgVGhlIHJlc3Qgb2YgdGhlIGxiZWFyaW5nIHByb2JsZW0KKyAgICAgICAgICAgICAg ICBpcyB0aGVuIHRha2VuIGNhcmUgb2YgYnkgZHJhd19nbHlwaHMuICovCisgICAgICAgICAgICAg ICAgaWYgKG92ZXJsYXBwaW5nX2dseXBoc19wCisgICAgICAgICAgICAgICAgICAgICYmIGkgPiAw CisgICAgICAgICAgICAgICAgICAgICYmIGkgPCBjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFd CisgICAgICAgICAgICAgICAgICAgICYmIChjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdICE9 IGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0pKQorICAgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgICBpbnQgbGVmdCwgcmlnaHQ7CisgICAgICAgICAgICAgICAgICAgIHJp Zi0+Z2V0X2dseXBoX292ZXJoYW5ncyAoY3VycmVudF9nbHlwaCwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICBYRlJBTUUgKHctPmZyYW1lKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmbGVmdCwgJnJpZ2h0KTsKKyAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGxlZnQgPiAwICYm IGkgPiAwKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAg IC0taSwgLS1kZXNpcmVkX2dseXBoLCAtLWN1cnJlbnRfZ2x5cGg7CisgICAgICAgICAgICAgICAg ICAgICAgICB4IC09IGRlc2lyZWRfZ2x5cGgtPnBpeGVsX3dpZHRoOworICAgICAgICAgICAgICAg ICAgICAgICAgbGVmdCAtPSBkZXNpcmVkX2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAg ICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIC8qIEFib3J0IHRoZSBza2lwcGluZyBh bGdvcml0aG0gaWYgd2UgZW5kIHVwIGJlZm9yZQorICAgICAgICAgICAgICAgICAgICAgICBvdXIg c3RhcnRpbmcgcG9pbnQsIHRvIGF2b2lkIGxvb3BpbmcgKGJ1ZyMxMDcwKS4KKyAgICAgICAgICAg ICAgICAgICAgICAgVGhpcyBjYW4gaGFwcGVuIHdoZW4gdGhlIGxiZWFyaW5nIGlzIGxhcmdlciB0 aGFuCisgICAgICAgICAgICAgICAgICAgICAgIHRoZSBwaXhlbCB3aWR0aC4gKi8KKyAgICAgICAg ICAgICAgICAgICAgYWJvcnRfc2tpcHBpbmcgPSAoaSA8IHN0YXJ0X2hwb3MpOworICAgICAgICAg ICAgICAgICAgfQorICAgICAgICAgICAgICB9CisgICAgICAgICAgICAvKiBUcnkgdG8gYXZvaWQg d3JpdGluZyB0aGUgZW50aXJlIHJlc3Qgb2YgdGhlIGRlc2lyZWQgcm93CisgICAgICAgICAgICAg ICBieSBsb29raW5nIGZvciBhIHJlc3luYyBwb2ludC4gIFRoaXMgbWFpbmx5IHByZXZlbnRzCisg ICAgICAgICAgICAgICBtb2RlIGxpbmUgZmxpY2tlcmluZyBpbiB0aGUgY2FzZSB0aGUgbW9kZSBs aW5lIGlzIGluCisgICAgICAgICAgICAgICBmaXhlZC1waXRjaCBmb250LCB3aGljaCBpdCB1c3Vh bGx5IHdpbGwgYmUuICovCisgICAgICAgICAgICBpZiAoaSA8IGRlc2lyZWRfcm93LT51c2VkW1RF WFRfQVJFQV0pCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpbnQgc3RhcnRfeCA9 IHgsIHN0YXJ0X2hwb3MgPSBpOworICAgICAgICAgICAgICAgIHN0cnVjdCBnbHlwaCAqc3RhcnQg PSBkZXNpcmVkX2dseXBoOworICAgICAgICAgICAgICAgIGludCBjdXJyZW50X3ggPSB4OworICAg ICAgICAgICAgICAgIGJvb2wgc2tpcF9maXJzdF9wID0gIWNhbl9za2lwX3A7CisgICAgICAgICAg ICAgICAgLyogRmluZCB0aGUgbmV4dCBnbHlwaCB0aGF0J3MgZXF1YWwgYWdhaW4uICovCisgICAg ICAgICAgICAgICAgd2hpbGUgKGkgPCBzdG9wCisgICAgICAgICAgICAgICAgICAgICAgICYmIChz a2lwX2ZpcnN0X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICFHTFlQSF9FUVVBTF9Q IChkZXNpcmVkX2dseXBoLCBjdXJyZW50X2dseXBoKSkKKyAgICAgICAgICAgICAgICAgICAgICAg JiYgeCA9PSBjdXJyZW50X3gpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICAgIHggKz0gZGVzaXJlZF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgICAgICAg IGN1cnJlbnRfeCArPSBjdXJyZW50X2dseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAgICAg ICAgICAgKytkZXNpcmVkX2dseXBoLCArK2N1cnJlbnRfZ2x5cGgsICsraTsKKyAgICAgICAgICAg ICAgICAgICAgc2tpcF9maXJzdF9wID0gMDsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgICAgICBmb3IgKGludCBlbHQgPSAwOworICAgICAgICAgICAgICAgICAgICAgZWx0IDwgYXJy YXlfZ2x5cGhzX3NraXBwZWQudXNlZDsKKyAgICAgICAgICAgICAgICAgICAgICsrZWx0KQorICAg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpbnQgeCA9IGFycmF5X2dseXBo c19za2lwcGVkLnNraXBwZWRbZWx0XS54OworICAgICAgICAgICAgICAgICAgICBpbnQgaHBvcyA9 IGFycmF5X2dseXBoc19za2lwcGVkLnNraXBwZWRbZWx0XS5ocG9zOworICAgICAgICAgICAgICAg ICAgICBzdHJ1Y3QgZ2x5cGggKnRhcmdldF9nbHlwaCA9CisgICAgICAgICAgICAgICAgICAgICAg bWNfZ2V0X2N1cnNvcl9nbHlwaCAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCBocG9z LCB2cG9zKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgICAgICAg ICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiU0tJUFBFRDogIHZwb3MgKCVkKSB8IGNoYXIgKCVk LyVzKSB8IHg6ICglZCkgfCBocG9zICglZC8lZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICB2cG9zLCB0YXJnZXRfZ2x5cGgtPnUuY2gsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAodGFyZ2V0X2dseXBo LT51LmNoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHgsIGhwb3Ms IHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKTsKKyAgICAgICAgICAgICAgICAgICAg bWNfZHJhd19yb3cgKHcsIGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBo LCB4LCAxLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21h dHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBkcmF3X3AsIFNLSVBQRUQpOworICAgICAg ICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChpID09IHN0YXJ0X2hwb3MgfHwgeCAh PSBjdXJyZW50X3gpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGkg PSBzdGFydF9ocG9zOworICAgICAgICAgICAgICAgICAgICB4ID0gc3RhcnRfeDsKKyAgICAgICAg ICAgICAgICAgICAgZGVzaXJlZF9nbHlwaCA9IHN0YXJ0OworICAgICAgICAgICAgICAgICAgICBi cmVhazsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBvdXRwdXRfY3Vyc29y X3RvICh3LCB2cG9zLCBzdGFydF9ocG9zLCBkZXNpcmVkX3Jvdy0+eSwgc3RhcnRfeCk7CisgICAg ICAgICAgICAgICAgLyogUmUtZHJhdyBhIHBvcnRpb24gb2YgdGhlIHJvdy4gKi8KKyAgICAgICAg ICAgICAgICBpZiAoZGVidWdfcCkKKyAgICAgICAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwg IlJFRFJBVyBTRUdNRU5UOlxuXAorICAgICAgICAgICAgICAgICAgICB2cG9zICglZCkgfCBjaGFy ICglZC8lcykgfCB4OiAoJWQpIHwgaHBvcyAoJWQvJWQpIHwgbGVuZ3RoICglZClcbiIsCisgICAg ICAgICAgICAgICAgICAgIHZwb3MsIHN0YXJ0LT51LmNoLCBtY19jaGFyX3RvX3N0cmluZyAoc3Rh cnQtPnUuY2gpLAorICAgICAgICAgICAgICAgICAgICBzdGFydF94LCBzdGFydF9ocG9zLCB1cGRh dGVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSwgaSAtIHN0YXJ0X2hwb3MpOworICAgICAgICAg ICAgICAgIGJsb2NrX2lucHV0ICgpOworICAgICAgICAgICAgICAgIGludCBsZW4gPSBpIC0gc3Rh cnRfaHBvczsKKyAgICAgICAgICAgICAgICBpbnQgaHBvcyA9IHN0YXJ0IC0gdXBkYXRlZF9yb3ct PmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgICAgICAgIHctPm91dHB1dF9jdXJzb3IueCA9 CisgICAgICAgICAgICAgICAgICBtY19kcmF3X2dseXBocyAodywgZGVzaXJlZF9tYXRyaXgsIHVw ZGF0ZWRfcm93LCB3LT5tY19tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgdy0+b3V0cHV0X2N1cnNvci54LCBURVhUX0FSRUEsIGhwb3MsIGhwb3MgKyBsZW4sCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRFJBV19OT1JNQUxfVEVYVCwgMCwgdnBvcywg bHNsLCBnbHlwaF9mbGF2b3IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vy c29yX3R5cGUsIHdkLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGN1cnNvcl9nY19wLCBNQ19EUkFXX0dMWVBIX1NUUklORywgZHJhd19wKTsK KyAgICAgICAgICAgICAgICB3LT5vdXRwdXRfY3Vyc29yLmhwb3MgKz0gbGVuOworICAgICAgICAg ICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgICAgICAgbWNfZHJhd19yb3cgKHcs IGRlc2lyZWRfbWF0cml4LCB1cGRhdGVkX3Jvdywgc3RhcnQsIHN0YXJ0X3gsIGkgLSBzdGFydF9o cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2cG9zLCBjdXJzb3JfbWF0cml4LCBl c3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGRyYXdfcCwgU0NSSUJFX1RXTyk7CisgICAgICAgICAg ICAgICAgY2hhbmdlZF9wID0gMTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKworICAg ICAgICAvKiBXcml0ZSB0aGUgcmVzdC4gKi8KKyAgICAgICAgaWYgKGkgPCBkZXNpcmVkX3Jvdy0+ dXNlZFtURVhUX0FSRUFdKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIG91dHB1dF9jdXJzb3Jf dG8gKHcsIHZwb3MsIGksIGRlc2lyZWRfcm93LT55LCB4KTsKKyAgICAgICAgICAgIGlmIChkZWJ1 Z19wKQorICAgICAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJEUkFXIFJFTUFJTkRFUiBPRiBU SEUgUk9XOlxuXAorICAgICAgICAgICAgICAgIHZwb3MgKCVkKSB8IGNoYXIgKCVkLyVzKSB8IHg6 ICglZCkgfCBocG9zICglZC8lZCkgfCBsZW5ndGggKCVkKVxuIiwKKyAgICAgICAgICAgICAgICB2 cG9zLCBkZXNpcmVkX2dseXBoLT51LmNoLCBtY19jaGFyX3RvX3N0cmluZyAoZGVzaXJlZF9nbHlw aC0+dS5jaCksCisgICAgICAgICAgICAgICAgeCwgaSwgZGVzaXJlZF9yb3ctPnVzZWRbVEVYVF9B UkVBXSAtIDEsIGRlc2lyZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSBpKTsKKyAgICAgICAgICAg IGJsb2NrX2lucHV0ICgpOworICAgICAgICAgICAgaW50IGxlbiA9IGRlc2lyZWRfcm93LT51c2Vk W1RFWFRfQVJFQV0gLSBpOworICAgICAgICAgICAgaW50IGhwb3MgPSBkZXNpcmVkX2dseXBoIC0g dXBkYXRlZF9yb3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgICAgdy0+b3V0cHV0X2N1 cnNvci54ID0KKyAgICAgICAgICAgICAgbWNfZHJhd19nbHlwaHMgKHcsIGRlc2lyZWRfbWF0cml4 LCB1cGRhdGVkX3Jvdywgdy0+bWNfbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgdy0+b3V0cHV0X2N1cnNvci54LCBURVhUX0FSRUEsIGhwb3MsIGhwb3MgKyBsZW4sCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBEUkFXX05PUk1BTF9URVhULCAwLCB2cG9zLCBsc2ws IGdseXBoX2ZsYXZvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBl LCB3ZCwgZXNzZW50aWFscy5hY3RpdmVfcCwgY3Vyc29yX2djX3AsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBNQ19EUkFXX0dMWVBIX1NUUklORywgZHJhd19wKTsKKyAgICA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gICAgIHN0cnVjdCBn bHlwaCAqc3RhcnQgPSBtY19nZXRfY3Vyc29yX2dseXBoICh3LCBkZXNpcmVkX21hdHJpeCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVw ZGF0ZWRfcm93LCBocG9zLCB2cG9zKTsKKyAgICAgICAgICAgICAgaWYgKHctPm91dHB1dF9jdXJz b3IueCA9PSB1cGRhdGVkX3Jvdy0+cGl4ZWxfd2lkdGgpCisgICAgICAgICAgICAgICAgeCAtPSBz dGFydC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICAg ICAgICAgIGZwcmludGYgKHN0ZGVyciwgIlBPU1QtQ0hBTkdFRDogIHZwb3MgKCVkKSB8IHggKCVk KSB8IGhwb3MgKCVkLyVkKSB8IGNoYXIgKCVkLyVzKVxuIiwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHZwb3MsIHgsIGhwb3MsIHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0g LSAxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQtPnUuY2gsIG1jX2No YXJfdG9fc3RyaW5nIChzdGFydC0+dS5jaCkpOworICAgICAgICAgICAgICBtY19kcmF3X3JvdyAo dywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCBzdGFydCwgeCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgIHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSBocG9zLCB2cG9zLCBj dXJzb3JfbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscywgcm93 X3Bvc2l0aW9uLCBkcmF3X3AsIFBPU1RfQ0hBTkdFRCk7CisgICAgICAgICAgICB9CisgICAgICAg ICAgICAvKiBUaGVyZSB3ZXJlIG5vIGNoYW5nZXMgYW5kIGkgPT0gZGVzaXJlZF9yb3ctPnVzZWRb VEVYVF9BUkVBXSAqLworICAgICAgICAgICAgZWxzZSBpZiAoIWNoYW5nZWRfcCkKKyAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgIGlmIChkZWJ1Z19wKQorICAgICAgICAgICAgICAgICAg ZnByaW50ZiAoc3RkZXJyLCAiVU5DSEFOR0VEIC0tIFdSSVRFIEVOVElSRSBMSU5FOiAgdnBvcyAo JWQpIHwgcm93LT51c2VkICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHZwb3MsIHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxKTsKKyAgICAgICAgICAg ICAgICBtY19kcmF3X3JvdyAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCBkZXNpcmVk X3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRl c2lyZWRfcm93LT54LCBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdLCB2cG9zLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCByb3dfcG9z aXRpb24sIGRyYXdfcCwgVU5DSEFOR0VEKTsKKyAgICAgICAgICAgICAgfQorCisgICAgICAgIC8q IE1heWJlIGNsZWFyIHRvIGVuZCBvZiBsaW5lLiAqLworICAgICAgICBpZiAoTUFUUklYX1JPV19F WFRFTkRTX0ZBQ0VfUCAoZGVzaXJlZF9yb3cpKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIC8q IElmIG5ldyByb3cgZXh0ZW5kcyB0byB0aGUgZW5kIG9mIHRoZSB0ZXh0IGFyZWEsIG5vdGhpbmcK KyAgICAgICAgICAgICAgIGhhcyB0byBiZSBjbGVhcmVkLCBpZiBhbmQgb25seSBpZiB3ZSBkaWQg YSB3cml0ZV9nbHlwaHMKKyAgICAgICAgICAgICAgIGFib3ZlLiAgVGhpcyBpcyBtYWRlIHN1cmUg Ynkgc2V0dGluZyBkZXNpcmVkX3N0b3BfcG9zCisgICAgICAgICAgICAgICBhcHByb3ByaWF0ZWx5 IGFib3ZlLiAqLworICAgICAgICAgICAgZWFzc2VydCAoaSA8IGRlc2lyZWRfcm93LT51c2VkW1RF WFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICAgIHx8ICgoZGVzaXJlZF9yb3ctPnVzZWRbVEVY VF9BUkVBXSA9PSBjdXJyZW50X3Jvdy0+dXNlZFtURVhUX0FSRUFdKQorICAgICAgICAgICAgICAg ICAgICAgICAgICYmIE1BVFJJWF9ST1dfRVhURU5EU19GQUNFX1AgKGN1cnJlbnRfcm93KSkpOwor ICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmIChNQVRSSVhfUk9XX0VYVEVORFNfRkFDRV9Q IChjdXJyZW50X3JvdykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIC8qIElmIG9sZCBy b3cgZXh0ZW5kcyB0byB0aGUgZW5kIG9mIHRoZSB0ZXh0IGFyZWEsIGNsZWFyLiAqLworICAgICAg ICAgICAgICBpZiAoaSA+PSBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FSRUFdKQorICAgICAgICAg ICAgICAgIG91dHB1dF9jdXJzb3JfdG8gKHcsIHZwb3MsIGksIGRlc2lyZWRfcm93LT55LCBkZXNp cmVkX3Jvdy0+cGl4ZWxfd2lkdGgpOworICAgICAgICAgICAgICBpZiAoZHJhd19wKQorICAgICAg ICAgICAgICAgIHJpZi0+Y2xlYXJfZW5kX29mX2xpbmUgKHcsIHVwZGF0ZWRfcm93LCBURVhUX0FS RUEsIC0xKTsKKyAgICAgICAgICAgICAgY2xlYXJfdG9feCA9IC0xOworICAgICAgICAgICAgICBj aGFuZ2VkX3AgPSAxOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAoZGVzaXJl ZF9yb3ctPnBpeGVsX3dpZHRoIDwgY3VycmVudF9yb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAg ICAgICB7CisgICAgICAgICAgICAgICAgLyogT3RoZXJ3aXNlIGNsZWFyIHRvIHRoZSBlbmQgb2Yg dGhlIG9sZCByb3cuICBFdmVyeXRoaW5nCisgICAgICAgICAgICAgICAgICAgYWZ0ZXIgdGhhdCBw b3NpdGlvbiBzaG91bGQgYmUgY2xlYXIgYWxyZWFkeS4gKi8KKyAgICAgICAgICAgICAgICBpbnQg eGxpbTsKKyAgICAgICAgICAgICAgICBpZiAoaSA+PSBkZXNpcmVkX3Jvdy0+dXNlZFtURVhUX0FS RUFdKQorICAgICAgICAgICAgICAgICAgb3V0cHV0X2N1cnNvcl90byAodywgdnBvcywgaSwgZGVz aXJlZF9yb3ctPnksIGRlc2lyZWRfcm93LT5waXhlbF93aWR0aCk7CisgICAgICAgICAgICAgICAg LyogSWYgY3Vyc29yIGlzIGRpc3BsYXllZCBhdCB0aGUgZW5kIG9mIHRoZSBsaW5lLCBtYWtlIHN1 cmUKKyAgICAgICAgICAgICAgICAgICBpdCdzIGNsZWFyZWQuICBOb3dhZGF5cyB3ZSBkb24ndCBo YXZlIGEgcGh5c19jdXJzb3JfZ2x5cGgKKyAgICAgICAgICAgICAgICAgICB3aXRoIHdoaWNoIHRv IGVyYXNlIHRoZSBjdXJzb3IgKGJlY2F1c2UgdGhpcyBtZXRob2QKKyAgICAgICAgICAgICAgICAg ICBkb2Vzbid0IHdvcmsgd2l0aCBsYmVhcmluZy9yYmVhcmluZyksIHNvIHdlIG11c3QgZG8gaXQg dGhpcyB3YXkuICovCisgICAgICAgICAgICAgICAgaWYgKHZwb3MgPT0gdy0+cGh5c19jdXJzb3Iu dnBvcworICAgICAgICAgICAgICAgICAgICAmJiAoZGVzaXJlZF9yb3ctPnJldmVyc2VkX3AKKyAg ICAgICAgICAgICAgICAgICAgICAgID8gKHctPnBoeXNfY3Vyc29yLmhwb3MgPCAwKQorICAgICAg ICAgICAgICAgICAgICAgICAgOiAody0+cGh5c19jdXJzb3IuaHBvcyA+PSBkZXNpcmVkX3Jvdy0+ dXNlZFtURVhUX0FSRUFdKSkpCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICAgIHctPnBoeXNfY3Vyc29yX29uX3AgPSAwOworICAgICAgICAgICAgICAgICAgICB4bGltID0g LTE7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAg ICAgICAgICAgICAgIHhsaW0gPSBjdXJyZW50X3Jvdy0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAg ICAgICAgaWYgKGRyYXdfcCkKKyAgICAgICAgICAgICAgICAgIHJpZi0+Y2xlYXJfZW5kX29mX2xp bmUgKHcsIHVwZGF0ZWRfcm93LCBURVhUX0FSRUEsIHhsaW0pOworICAgICAgICAgICAgICAgIGNs ZWFyX3RvX3ggPSB4bGltOworICAgICAgICAgICAgICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAg ICAgICAgIH0KKworICAgICAgICBpZiAoY2hhbmdlZF9wCisgICAgICAgICAgICAmJiBjbGVhcl90 b194ICE9IDApCisgICAgICAgICAgeworICAgICAgICAgICAgaW50IHRleHRfYXJlYV93aWR0aCA9 IHdpbmRvd19ib3hfd2lkdGggKHcsIFRFWFRfQVJFQSk7CisgICAgICAgICAgICBzdHJ1Y3QgbWNf UkdCIGRlYnVnX2ZnID0gey5yZWQgPSAwLjg2NywgLmdyZWVuID0gMC44NjcsIC5ibHVlID0gMC44 Njd9OworICAgICAgICAgICAgc3RydWN0IGdseXBoICp0YXJnZXRfZ2x5cGggPQorICAgICAgICAg ICAgICB1cGRhdGVkX3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyB1cGRhdGVkX3Jvdy0+dXNlZFtU RVhUX0FSRUFdIC0gMTsKKyAgICAgICAgICAgIC8qIGBtY19lbmdpbmUnIG9ubHkgZHJhd3MgYW4g TUNfR0xZUEggd2hlbiB4IDwgdXBkYXRlZF9yb3ctPnBpeGVsX3dpZHRoLgorICAgICAgICAgICAg VGhlIGN1cnJlbnQgZGVzaWduIGluaGliaXRzIGRyYXdpbmcgb3ZlciBhbiBleGlzdGluZyBnbHlw aCBhdCB0aGUgZW5kIG9mIGEKKyAgICAgICAgICAgIHdvcmQtd3JhcHBlZCBsaW5lLiAgU2FpZCBn bHlwaCByZWNlaXZlcyBhIGZha2UgY3Vyc29yIGluIGVpdGhlciBvbmUgb2YgdGhlCisgICAgICAg ICAgICBwcmV2aW91cyBzZWN0aW9ucyBhYm92ZSwgYW5kIHNob3VsZCBub3QgYmUgb3ZlcndyaXR0 ZW4gd2l0aCBhbm90aGVyIG9uZS4KKyAgICAgICAgICAgIFRoaXMgZGVzaWduIGlzIG5lZWRlZCBi ZWNhdXNlIGEgd29yZC13cmFwcGVkIGxpbmUgZG9lcyBub3QgcmVjZWl2ZSBhbiBleHRyYQorICAg ICAgICAgICAgc3BhY2UgbGlrZSBub24td29yZC13cmFwcGVkIGxpbmVzIGRvLiAqLworICAgICAg ICAgICAgaW50IHggPSB1cGRhdGVkX3Jvdy0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICBpbnQg aHBvcyA9IHVwZGF0ZWRfcm93LT51c2VkW1RFWFRfQVJFQV0gLSAxOworICAgICAgICAgICAgaW50 IHhfbGltaXQgPSAoY2xlYXJfdG9feCA9PSAtMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg PyB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgOiBjbGVhcl90b194 OworICAgICAgICAgICAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKHctPmNvbnRlbnRzKTsK KyAgICAgICAgICAgIGJvb2wgZmlsbF9jb2x1bW5fdHJ1bXBzX3AgPSAoIU5JTFAgKEJWQVIgKGIs IGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGZjX3Zpc2libGUpKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA9PSBlc3NlbnRpYWxzLmZjX3gp OworICAgICAgICAgICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAgICAgICAgICBmcHJpbnRmIChz dGRlcnIsICJtY191cGRhdGVfdGV4dF9hcmVhIChmbG9hdGluZyk6ICB2cG9zICglZCkgfCB4X2xp bWl0ICglZClcbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdnBvcywgeF9saW1p dCk7CisgICAgICAgICAgICBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAg ICAgJiYgIU5JTFAgKEJWQVIgKGIsIGZjX3Zpc2libGUpKQorICAgICAgICAgICAgICAgICYmIChl c3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgIHx8ICghZXNzZW50aWFscy5h Y3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGZjX2lu YWN0aXZlX3dpbmRvd3MpKSkpCisgICAgICAgICAgICAgICAgJiYgeCA8IHRleHRfYXJlYV93aWR0 aAorICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNfeCA+PSB4CisgICAgICAgICAgICAg ICAgJiYgdGFyZ2V0X2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAgICAmJiBkcmF3X3ApCisg ICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgZGVzaXJlZF9tYXRyaXgsIHVwZGF0ZWRfcm93LCB0 YXJnZXRfZ2x5cGgsIFRFWFRfQVJFQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICB4LCB4X2xp bWl0LCB1cGRhdGVkX3Jvdy0+eSwgaHBvcywgdnBvcywgTUNfQkFSLCAxLAorICAgICAgICAgICAg ICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwKKyAg ICAgICAgICAgICAgICAgICAgICAgICBkZWJ1Z19wID8gZGVidWdfZmcgOiBlc3NlbnRpYWxzLmZj X2ZnW3Jvd19wb3NpdGlvbl0sCisgICAgICAgICAgICAgICAgICAgICAgICAgRklMTF9DT0xVTU4s IGRyYXdfcCwgTk9XSEVSRSwgTk9fQ0FDSEUpOworICAgICAgICAgICAgaWYgKEJVRkZFUlAgKHct PmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJz KSkKKyAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfaG9yaXpvbnRhbF9ydWxl cikpCisgICAgICAgICAgICAgICAgJiYgKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAg ICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAg ICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfaW5hY3RpdmVfd2luZG93cykpKSkKKyAgICAgICAgICAg ICAgICAmJiB4IDwgdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgJiYgdnBvcyA9PSB3 LT5jdXJzb3IudnBvcworICAgICAgICAgICAgICAgICYmIHRhcmdldF9nbHlwaCAhPSBOVUxMCisg ICAgICAgICAgICAgICAgJiYgZHJhd19wKQorICAgICAgICAgICAgICBtY19lbmdpbmUgKHcsIGRl c2lyZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBoLCBURVhUX0FSRUEsCisgICAg ICAgICAgICAgICAgICAgICAgICAgeCwgeF9saW1pdCwgdXBkYXRlZF9yb3ctPnksIGhwb3MsIHZw b3MsIE1DX0hCQVIsIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21hdHJpeCwg ZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgIGRlYnVn X3AgPyBkZWJ1Z19mZyA6IGVzc2VudGlhbHMuY2hfZmdbcm93X3Bvc2l0aW9uXSwKKyAgICAgICAg ICAgICAgICAgICAgICAgICBIT1JJWk9OVEFMX1JVTEVSLCBkcmF3X3AsIE5PV0hFUkUsIE5PX0NB Q0hFKTsKKyAgICAgICAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAg ICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgJiYg IU5JTFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAgICAgICAgICAmJiAo ZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICB8fCAoIWVzc2VudGlhbHMu YWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF9p bmFjdGl2ZV93aW5kb3dzKSkpKQorICAgICAgICAgICAgICAgICYmICFmaWxsX2NvbHVtbl90cnVt cHNfcAorICAgICAgICAgICAgICAgICYmIHggPCB0ZXh0X2FyZWFfd2lkdGgKKyAgICAgICAgICAg ICAgICAmJiB2cG9zICE9IHctPmN1cnNvci52cG9zCisgICAgICAgICAgICAgICAgJiYgdy0+Y3Vy c29yLnggPj0geAorICAgICAgICAgICAgICAgICYmIHRhcmdldF9nbHlwaCAhPSBOVUxMCisgICAg ICAgICAgICAgICAgJiYgZHJhd19wKQorICAgICAgICAgICAgICBtY19lbmdpbmUgKHcsIGRlc2ly ZWRfbWF0cml4LCB1cGRhdGVkX3JvdywgdGFyZ2V0X2dseXBoLCBURVhUX0FSRUEsCisgICAgICAg ICAgICAgICAgICAgICAgICAgeCwgeF9saW1pdCwgdXBkYXRlZF9yb3ctPnksIGhwb3MsIHZwb3Ms IE1DX0JBUiwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICB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IGNoYW5nZWRfcDsKK30KKwordm9pZAorbWNfdXBkYXRl X3dpbmRvd19lcmFzZSAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IG1jX21hdHJpeCBvbGRfbWF0 cml4KQoreworICBib29sIGRlYnVnX3AgPSBmYWxzZTsKKyAgYm9vbCBnb19vbmVfcCA9IChvbGRf bWF0cml4LmN1cnNvcnNfdXNlZFtNQ19DQUNIRV0gPiAwCisgICAgICAgICAgICAgICAgICAgfHwg b2xkX21hdHJpeC5jdXJzb3JzX3VzZWRbQ0hfQ0FDSEVdID4gMAorICAgICAgICAgICAgICAgICAg IHx8IG9sZF9tYXRyaXguY3Vyc29yc191c2VkW0ZDX0NBQ0hFXSA+IDApOworICBib29sIGdvX3R3 b19wID0gKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAgICAgICYmICghTklM UCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAg ICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlz aWJsZSkpCisgICAgICAgICAgICAgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVGRkVSICh3 LT5jb250ZW50cyksIG1jX2NvbmYpKSkpOworICBib29sIHVwZGF0aW5nX2ZyYW1lX3AgPSBmYWxz ZTsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIGlmIChYRlJBTUUg KHctPmZyYW1lKSAhPSBmLT5tY191cGRhdGluZ19mcmFtZQorICAgICAgJiYgKGdvX29uZV9wIHx8 IGdvX3R3b19wKSkKKyAgICB7CisgICAgICB1cGRhdGluZ19mcmFtZV9wID0gdHJ1ZTsKKyAgICAg IHVwZGF0ZV9iZWdpbiAoZik7CisgICAgfQorICBpZiAody0+cGh5c19jdXJzb3Jfb25fcAorICAg ICAgJiYgZ29fdHdvX3ApCisgICAgZXJhc2VfcGh5c19jdXJzb3IgKHcpOworICBmb3IgKGludCB2 bnRoID0gMDsKKyAgICAgICBnb19vbmVfcAorICAgICAgICYmIHZudGggPCB3LT5tY19tYXRyaXgu dnBvc191c2VkOworICAgICAgICsrdm50aCkKKyAgICB7CisgICAgICBmb3IgKGVudW0gbWNfY2Fj aGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7CisgICAgICAgICAgIGNhY2hlX3R5cGUgPCBO T19DQUNIRTsKKyAgICAgICAgICAgKytjYWNoZV90eXBlKQorICAgICAgICBmb3IgKGludCBudGhf MCA9IDA7CisgICAgICAgICAgICAgbWNfdHJhdmVyc2VfY2FjaGVfcCAob2xkX21hdHJpeCwgY2Fj aGVfdHlwZSwgdm50aCwgbnRoXzApOworICAgICAgICAgICAgICsrbnRoXzApCisgICAgICAgICAg eworICAgICAgICAgICAgYm9vbCBzYW1lX3AgPSBmYWxzZTsKKyAgICAgICAgICAgIGZvciAoaW50 IHdfbnRoID0gMDsgd19udGggPCB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2VkW2Nh Y2hlX3R5cGVdOyArK3dfbnRoKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc2Ft ZV9wIHw9IChvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmds eXBoLnR5cGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnR5cGUKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmICgob2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS5nbHlwaC5ieXRlcG9zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlw aC5ieXRlcG9zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLnJvd19wb3NpdGlvbiA9PSBBVF9a VgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0ucm93X3Bvc2l0aW9uID09IEFUX1pWKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLnJvd19wb3NpdGlvbiA9PSBQT1NUX1pWCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5yb3dfcG9zaXRpb24gPT0gUE9TVF9aVikpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiAoKG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMF0uZ2x5cGguY2hhcnBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0u Z2x5cGguY2hhcnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAob2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5yb3dfcG9zaXRpb24gPT0g QVRfWlYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLnJvd19wb3NpdGlvbiA9PSBBVF9a VikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAob2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5yb3dfcG9zaXRpb24gPT0gUE9TVF9aVgorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0ucm93X3Bvc2l0aW9uID09IFBPU1RfWlYpKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgKChvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLmxudW0KKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhd LmdseXBoLmxudW0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKG9sZF9tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0ucm93X3Bvc2l0aW9uID09IEFU X1pWCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5yb3dfcG9zaXRpb24gPT0gQVRfWlYp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKG9sZF9tYXRyaXgudnBvc1t2bnRo XS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0ucm93X3Bvc2l0aW9uID09IFBPU1RfWlYKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLnJvd19wb3NpdGlvbiA9PSBQT1NUX1pWKSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMF0uZ2x5cGgudS52YWwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBo LnUudmFsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLmZhY2VfaWQKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bd19udGhdLmdseXBoLmZhY2VfaWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9s ZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGgucGFkZGlu Z19wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5wYWRkaW5nX3AKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMF0uZ2x5cGgubGVmdF9ib3hfbGluZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5n bHlwaC5sZWZ0X2JveF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGgucmlnaHRfYm94 X2xpbmVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGgucmlnaHRfYm94X2xpbmVfcAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF8wXS5nbHlwaC52b2Zmc2V0CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRo XS5nbHlwaC52b2Zmc2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnBpeGVsX3dpZHRoCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC5waXhlbF93aWR0aAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8wXS5nbHlwaC5zbGljZS5pbWcueAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGguc2xp Y2UuaW1nLngKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZ2x5cGguc2xpY2UuaW1nLnkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bd19udGhdLmdseXBoLnNsaWNlLmltZy55CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmds eXBoLnNsaWNlLmltZy53aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGguc2xpY2Uu aW1nLndpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoLnNsaWNlLmltZy5oZWlnaHQKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnNsaWNlLmltZy5oZWlnaHQKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMF0uZ2x5cGguc2xpY2UuY21wLmZyb20KKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmds eXBoLnNsaWNlLmNtcC5mcm9tCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLngKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bd19udGhdLngKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZngKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19u dGhdLmZ4CisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLnkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNo ZVtjYWNoZV90eXBlXVtudGhfMF0uZnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmZ5CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bbnRoXzBdLmhwb3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmhwb3MKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMF0udnBvcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0udnBvcworICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8wXS53ZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0ud2QKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhfMF0uaAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uaAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8w XS5jdXJzb3JfdHlwZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uY3Vyc29yX3R5cGUKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMF0uY3Vyc29yX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5jdXJz b3Jfd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZmcucmVkCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3df bnRoXS5mZy5yZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZmcuZ3JlZW4KKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bd19udGhdLmZnLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmZnLmJsdWUKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2Fj aGVfdHlwZV1bd19udGhdLmZnLmJsdWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9s ZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uYmcucmVkCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID09IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW3dfbnRoXS5iZy5yZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uYmcuZ3JlZW4K KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmJnLmdyZWVuCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmJn LmJsdWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4LnZwb3Nb dm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmJnLmJsdWUKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhf MF0uYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT0gdy0+bWNfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bd19udGhdLmFjdGl2ZV9wCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXzBdLmdseXBoX2ZsYXZvcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PSB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0uZ2x5cGhfZmxh dm9yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmVuYWJsZWRfcAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA9PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250 aF0uZW5hYmxlZF9wKTsKKyAgICAgICAgICAgICAgICBpZiAoc2FtZV9wKQorICAgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZiAoZGVidWdfcCkKKyAgICAgICAgICAgICAg ICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJISVQgKCVzKTogIHZwb3MgKCVkKSB8IGhwb3MgKCVk KSB8IGNoYXIgKCVzKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IChjYWNoZV90eXBlID09IE1DX0NBQ0hFKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/ICJNQyIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogKGNhY2hlX3R5cGUgPT0gQ0hfQ0FDSEUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgID8gIkNIIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiAoY2FjaGVfdHlwZSA9PSBGQ19DQUNIRSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPyAiRkMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA6ICJOTyIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0udnBvcywKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5ocG9zLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgbWNfY2hhcl90b19zdHJpbmcgKHctPm1jX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5nbHlwaC51LmNoKSk7CisgICAgICAgICAgICAgICAg ICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW3dfbnRoXS5zYW1l X3AgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGRlYnVnX3ApCisgICAgICAgICAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBpbnQgb2xkX2NhY2hlX3VzZWQgPSBvbGRfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXTsKKyAgICAgICAgICAgICAgICAg ICAgICBpbnQgbmV3X2NhY2hlX3VzZWQgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91 c2VkW2NhY2hlX3R5cGVdOworICAgICAgICAgICAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwg Ik1JU1MgKCVzKTogIHZwb3MgKCVkKSB8IGhwb3MgKCVkIHYuICVkKSB8IGNoYXIgKCVzIHYuICVz KSB8IGNhY2hlX3VzZWQgKCVkIHYuICVkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIChjYWNoZV90eXBlID09IE1DX0NBQ0hFKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/ICJNQyIKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogKGNhY2hlX3R5cGUgPT0gQ0hfQ0FDSEUpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gIkNIIgorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAoY2FjaGVfdHlwZSA9PSBGQ19DQUNIRSkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAiRkMiCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6ICJOTyIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVt3X250aF0u dnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9sZF9tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uaHBvcywKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW3dfbnRoXS5ocG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgbWNfY2hhcl90b19zdHJpbmcgKG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMF0uZ2x5cGgudS5jaCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBtY19jaGFyX3RvX3N0cmluZyAody0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bd19udGhdLmdseXBoLnUuY2gpLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgb2xkX2NhY2hlX3VzZWQsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBuZXdfY2FjaGVfdXNlZCk7CisgICAgICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKCFzYW1lX3ApCisgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAvKiBgbWF0cml4X3JvdycgaW4gYGRpc3BuZXcuY2AgY29udGFp bnMgdGhlIGZvbGxvd2luZyB0ZXN0cywKKyAgICAgICAgICAgICAgICBlYXNzZXJ0IChtYXRyaXgg JiYgbWF0cml4LT5yb3dzKTsKKyAgICAgICAgICAgICAgICBlYXNzZXJ0IChyb3cgPj0gMCAmJiBy b3cgPCBtYXRyaXgtPm5yb3dzKTsgKi8KKyAgICAgICAgICAgICAgICBib29sIGJhcmZfY3Jhc2hf b25lID0gKHctPmN1cnJlbnRfbWF0cml4ICYmIHctPmN1cnJlbnRfbWF0cml4LT5yb3dzKSA/IGZh bHNlIDogdHJ1ZTsKKyAgICAgICAgICAgICAgICBpZiAoYmFyZl9jcmFzaF9vbmUpCisgICAgICAg ICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICBib29sIGJhcmZfY3Jhc2hfdHdv ID0gKHZudGggPj0gMCAmJiB2bnRoIDwgdy0+Y3VycmVudF9tYXRyaXgtPm5yb3dzKSA/IGZhbHNl IDogdHJ1ZTsKKyAgICAgICAgICAgICAgICBpZiAoYmFyZl9jcmFzaF90d28pCisgICAgICAgICAg ICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICp2bnRo X3JvdyA9IE1BVFJJWF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB2bnRoKTsKKyAgICAgICAgICAg ICAgICBpbnQgeF8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF8wXS54OworICAgICAgICAgICAgICAgIGludCBmeF8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5meDsKKyAgICAgICAgICAgICAgICBpbnQgeV8wID0g b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS55OworICAgICAg ICAgICAgICAgIGludCBmeV8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS5meTsKKyAgICAgICAgICAgICAgICBpbnQgaHBvc18wID0gb2xkX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5ocG9zOworICAgICAgICAgICAgICAg IGludCB2cG9zXzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XzBdLnZwb3M7CisgICAgICAgICAgICAgICAgaW50IHdkXzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLndkOworICAgICAgICAgICAgICAgIGludCBoXzAg PSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmg7CisgICAg ICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZV8wID0gb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8wXS5jdXJzb3JfdHlwZTsKKyAgICAg ICAgICAgICAgICBpbnQgY3Vyc29yX3dpZHRoXzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXzBdLmN1cnNvcl93aWR0aDsKKyAgICAgICAgICAgICAgICAvLyAg c3RydWN0IG1jX1JHQiBsc2xfZmdfMCA9IHsucmVkID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8wXS5mZy5yZWQsCisgICAgICAgICAgICAgICAgLy8gICAgICAg ICAgICAgICAgICAgICAgICAgICAgLmdyZWVuID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF8wXS5mZy5ncmVlbiwKKyAgICAgICAgICAgICAgICAvLyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhfMF0uZmcuYmx1ZX07CisgICAgICAgICAgICAgICAgc3RydWN0IG1jX1JH QiBsc2xfYmdfMCA9IHsucmVkID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF8wXS5iZy5yZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAuZ3JlZW4gPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XzBdLmJnLmdyZWVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg LmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmJn LmJsdWV9OworICAgICAgICAgICAgICAgIGJvb2wgYWN0aXZlX3BfMCA9IG9sZF9tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uYWN0aXZlX3A7CisgICAgICAgICAgICAg ICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yXzAgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXzBdLmdseXBoX2ZsYXZvcjsKKyAgICAgICAgICAgICAgICBi b29sIGVuYWJsZWRfcF8wID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF8wXS5lbmFibGVkX3A7CisgICAgICAgICAgICAgICAgaWYgKHZwb3NfMCA9PSB2bnRoCisg ICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvcl8wID09IE1DX0dMWVBICisgICAgICAg ICAgICAgICAgICAgICYmIGVuYWJsZWRfcF8wCisgICAgICAgICAgICAgICAgICAgICYmIHZudGhf cm93LT5lbmFibGVkX3ApCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAg IG1jX2VyYXNlX2N1cnNvciAodywgdy0+Y3VycmVudF9tYXRyaXgsIHZudGhfcm93LCBvbGRfbWF0 cml4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHhfMCwgeV8wLCBocG9z XzAsIHZwb3NfMCwgZ2x5cGhfZmxhdm9yXzAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgY3Vyc29yX3R5cGVfMCwgd2RfMCk7CisgICAgICAgICAgICAgICAgICAgIG9sZF9t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMF0uZW5hYmxlZF9wID0gZmFs c2U7CisgICAgICAgICAgICAgICAgICAgIC0tb2xkX21hdHJpeC5jdXJzb3JzX3VzZWRbY2FjaGVf dHlwZV07CisgICAgICAgICAgICAgICAgICAgIC8qIElmIHdlIGluYWR2ZXJ0ZW50bHkgZXJhc2Vk IGFub3RoZXIgZmFrZSBjdXJzb3IgYXQgdGhlIHNhbWUKKyAgICAgICAgICAgICAgICAgICAgSFBP UyB0aGF0IGlzIHN0aWxsIGVuYWJsZWRfcCBpbiB0aGUgYG9sZF9tYXRyaXhgLCB0aGVuIHJlZHJh dyBpdC4gKi8KKyAgICAgICAgICAgICAgICAgICAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2Fj aGVfdHlwZSA9IE1DX0NBQ0hFOworICAgICAgICAgICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUg PCBOT19DQUNIRTsKKyAgICAgICAgICAgICAgICAgICAgICAgICArK2NhY2hlX3R5cGUpCisgICAg ICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgbnRo XzEgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtY190cmF2ZXJzZV9jYWNoZV9w IChvbGRfbWF0cml4LCBjYWNoZV90eXBlLCB2bnRoLCBudGhfMSk7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICsrbnRoXzEpCisgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICBpbnQgeF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF8xXS54OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlu dCBmeF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5m eDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgeV8xID0gb2xkX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS55OworICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGludCBmeV8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF8xXS5meTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaHBvc18xID0gb2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5ocG9zOworICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGludCB2cG9zXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLnZwb3M7CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgaW50IHdkXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRo XzFdLndkOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBoXzEgPSBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmg7CisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZV8xID0gb2xkX21hdHJp eC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8xXS5jdXJzb3JfdHlwZTsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICBpbnQgY3Vyc29yX3dpZHRoXzEgPSBvbGRfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmN1cnNvcl93aWR0aDsKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZ18xID0gey5yZWQgPSBvbGRf bWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmZnLnJlZCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9 IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZmcuZ3JlZW4s CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAu Ymx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMV0uZmcu Ymx1ZX07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIHN0cnVjdCBtY19SR0IgbHNs X2JnXzEgPSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtu dGhfMV0uYmcucmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAg ICAgICAgICAgICAgICAgIC5ncmVlbiA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMV0uYmcuZ3JlZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8g ICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXzFdLmJnLmJsdWV9OworICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGJvb2wgYWN0aXZlX3BfMSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMV0uYWN0aXZlX3A7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51 bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yXzEgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXzFdLmdseXBoX2ZsYXZvcjsKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICBib29sIGVuYWJsZWRfcF8xID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF8xXS5lbmFibGVkX3A7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9v bCBnb19wXzEgPSAoaHBvc18wID09IGhwb3NfMQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIGVuYWJsZWRfcF8xKTsKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICBpZiAoIWdvX3BfMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVl OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgcmVtb3ZlX3BfMSA9IGZhbHNlOwor ICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCB3LT5j dXJyZW50X21hdHJpeCwgdm50aF9yb3csIHhfMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgZnhfMSwgeV8xLCBmeV8xLCBocG9zXzEsIHZwb3NfMSwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2RfMSwg aF8xLCBjdXJzb3JfdHlwZV8xLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGhfMSwgbHNsX2ZnXzEsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2ZV9wXzEsIGdseXBoX2ZsYXZv cl8xLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBy ZW1vdmVfcF8xKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAg ICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYg KHZwb3NfMCA9PSB2bnRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3Bf MAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdm50aF9yb3ctPmVuYWJsZWRfcCkKKyAg ICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGJvb2wgcmVtb3ZlX3Bf MCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgbWNfZHJhd19lcmFzZV9oeWJyaWQgKHcs IHctPmN1cnJlbnRfbWF0cml4LCB2bnRoX3JvdywgeF8wLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBmeF8wLCB5XzAsIGZ5XzAsIGhwb3NfMCwgdnBvc18wLCB3 ZF8wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoXzAsIGN1 cnNvcl90eXBlXzAsIGN1cnNvcl93aWR0aF8wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBsc2xfYmdfMCwgYWN0aXZlX3BfMCwgZ2x5cGhfZmxhdm9yXzAsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZV9wXzApOwor ICAgICAgICAgICAgICAgICAgICAgIG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90 eXBlXVtudGhfMF0uZW5hYmxlZF9wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgLS1v bGRfbWF0cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90eXBlXTsKKyAgICAgICAgICAgICAgICAgICAg ICAvKiBJZiB3ZSBpbmFkdmVydGVudGx5IGVyYXNlZCBhbm90aGVyIGZha2UgY3Vyc29yIGF0IHRo ZSBzYW1lCisgICAgICAgICAgICAgICAgICAgICAgSFBPUyB0aGF0IGlzIHN0aWxsIGVuYWJsZWRf cCBpbiB0aGUgYG9sZF9tYXRyaXhgLCB0aGVuIHJlZHJhdyBpdC4gKi8KKyAgICAgICAgICAgICAg ICAgICAgICBmb3IgKGVudW0gbWNfY2FjaGVfdHlwZSBjYWNoZV90eXBlID0gTUNfQ0FDSEU7Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7CisgICAgICAg ICAgICAgICAgICAgICAgICAgICArK2NhY2hlX3R5cGUpCisgICAgICAgICAgICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IG50aF8yID0gMDsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBtY190cmF2ZXJzZV9jYWNoZV9wIChvbGRfbWF0cml4 LCBjYWNoZV90eXBlLCB2bnRoLCBudGhfMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgKytudGhfMikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBpbnQgeF8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2Nh Y2hlX3R5cGVdW250aF8yXS54OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZ4 XzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmZ4Owor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHlfMiA9IG9sZF9tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0ueTsKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGludCBmeV8yID0gb2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF8yXS5meTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBocG9zXzIgPSBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmhwb3M7CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgdnBvc18yID0gb2xkX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS52cG9zOworICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgaW50IHdkXzIgPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV1bbnRoXzJdLndkOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGhfMiA9IG9s ZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uaDsKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGVfMiA9 IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0uY3Vyc29yX3R5 cGU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY3Vyc29yX3dpZHRoXzIgPSBv bGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmN1cnNvcl93aWR0 aDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnXzIg PSB7LnJlZCA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhfMl0u ZmcucmVkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAuZ3JlZW4gPSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXzJdLmZnLmdyZWVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAuYmx1ZSA9IG9sZF9tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhfMl0uZmcuYmx1ZX07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAv LyAgc3RydWN0IG1jX1JHQiBsc2xfYmdfMiA9IHsucmVkID0gb2xkX21hdHJpeC52cG9zW3ZudGhd LmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5iZy5yZWQsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSBvbGRfbWF0cml4 LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmJnLmdyZWVuLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUg PSBvbGRfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXzJdLmJnLmJsdWV9 OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBhY3RpdmVfcF8yID0gb2xkX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5hY3RpdmVfcDsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvcl8yID0g b2xkX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5nbHlwaF9mbGF2 b3I7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGVuYWJsZWRfcF8yID0gb2xk X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF8yXS5lbmFibGVkX3A7Cisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGdvX3BfMiA9IChocG9zXzAgPT0gaHBv c18yCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBmeF8w IDw9IGZ4XzIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IGZ4XzAgKyB3ZF8wID4gZnhfMiArIHdkXzIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIGVuYWJsZWRfcF8yKTsKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGlmICghZ29fcF8yKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250 aW51ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgcmVtb3ZlX3BfMiA9IGZh bHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWNfZHJhd19lcmFzZV9oeWJyaWQg KHcsIHctPmN1cnJlbnRfbWF0cml4LCB2bnRoX3JvdywgeF8yLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ4XzIsIHlfMiwgZnlfMiwgaHBvc18y LCB2cG9zXzIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgd2RfMiwgaF8yLCBjdXJzb3JfdHlwZV8yLAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aF8yLCBsc2xfZmdfMiwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVf cF8yLCBnbHlwaF9mbGF2b3JfMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICByZW1vdmVfcF8yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgIH0KKyAgaWYgKHVwZGF0aW5nX2ZyYW1l X3ApCisgICAgdXBkYXRlX2VuZCAoZik7Cit9CisKK3ZvaWQKK21jX3VwZGF0ZV93aW5kb3dfZHJ5 cnVuIChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3AsIHN0cnVjdCBtY19lc3NlbnRpYWxz IGVzc2VudGlhbHMpCit7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cnVjdCBnbHlwaF9yb3cgKnJvdyA9IE1BVFJJWF9ST1cgKGRlc2lyZWRfbWF0cml4 LCAwKTsKKyAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKmVuZCA9IE1BVFJJWF9NT0RFX0xJTkVfUk9X IChkZXNpcmVkX21hdHJpeCk7CisKKyAgICAgIC8qIFRha2Ugbm90ZSBvZiB0aGUgaGVhZGVyIGxp bmUsIGlmIHRoZXJlIGlzIG9uZS4gIFdlIHdpbGwKKyAgICAgICAgIHVwZGF0ZSBpdCBiZWxvdywg YWZ0ZXIgdXBkYXRpbmcgYWxsIG9mIHRoZSB3aW5kb3cncyBsaW5lcy4gKi8KKyAgICAgIGlmIChy b3ctPm1vZGVfbGluZV9wKQorICAgICAgICB7CisgICAgICAgICAgaGVhZGVyX2xpbmVfcm93ID0g cm93OworICAgICAgICAgICsrcm93OworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAg ICBoZWFkZXJfbGluZV9yb3cgPSBOVUxMOworCisgICAgICAvKiBVcGRhdGUgdGhlIG1vZGUgbGlu ZSwgaWYgbmVjZXNzYXJ5LiAqLworICAgICAgc3RydWN0IGdseXBoX3JvdyAqbW9kZV9saW5lX3Jv dyA9IE1BVFJJWF9NT0RFX0xJTkVfUk9XIChkZXNpcmVkX21hdHJpeCk7CisgICAgICBpZiAobW9k ZV9saW5lX3Jvdy0+bW9kZV9saW5lX3AgJiYgbW9kZV9saW5lX3Jvdy0+ZW5hYmxlZF9wKQorICAg ICAgICB7CisgICAgICAgICAgbW9kZV9saW5lX3Jvdy0+eSA9IHliICsgV0lORE9XX1NDUk9MTF9C QVJfQVJFQV9IRUlHSFQgKHcpOworICAgICAgICAgIHVwZGF0ZV93aW5kb3dfbGluZSAodywgTUFU UklYX1JPV19WUE9TIChtb2RlX2xpbmVfcm93LAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBkZXNpcmVkX21hdHJpeCksCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmbW91c2VfZmFjZV9vdmVyd3JpdHRlbl9wKTsKKyAgICAgICAgfQorCisg ICAgICAvKiBGaW5kIGZpcnN0IGVuYWJsZWQgcm93LiAgT3B0aW1pemF0aW9ucyBpbiByZWRpc3Bs YXlfaW50ZXJuYWwKKyAgICAgICAgIG1heSBsZWFkIHRvIGFuIHVwZGF0ZSB3aXRoIG9ubHkgb25l IHJvdyBlbmFibGVkLiAgVGhlcmUgbWF5CisgICAgICAgICBiZSBhbHNvIGNvbXBsZXRlbHkgZW1w dHkgbWF0cmljZXMuICovCisgICAgICB3aGlsZSAocm93IDwgZW5kICYmICFyb3ctPmVuYWJsZWRf cCkKKyAgICAgICAgKytyb3c7CisKKyAgICAgIC8qIFRyeSByZXVzaW5nIHBhcnQgb2YgdGhlIGRp c3BsYXkgYnkgY29weWluZy4gKi8KKyAgICAgIGlmIChyb3cgPCBlbmQgJiYgIXctPmRlc2lyZWRf bWF0cml4LT5ub19zY3JvbGxpbmdfcCkKKyAgICAgICAgeworICAgICAgICAgIGludCByYyA9IG1j X3Njcm9sbGluZ193aW5kb3cgKHcsIGhlYWRlcl9saW5lX3JvdyAhPSBOVUxMKTsKKyAgICAgICAg ICBpZiAocmMgPCAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBBbGwgcm93cyB3 ZXJlIGZvdW5kIHRvIGJlIGVxdWFsLiAqLworICAgICAgICAgICAgICBwYXVzZWRfcCA9IDA7Cisg ICAgICAgICAgICAgIGdvdG8gc2V0X2N1cnNvcjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAg IGVsc2UgaWYgKHJjID4gMCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIFdl J3ZlIHNjcm9sbGVkIHRoZSBkaXNwbGF5LiAqLworICAgICAgICAgICAgICAgIGZvcmNlX3AgPSAx OworICAgICAgICAgICAgICAgIGNoYW5nZWRfcCA9IDE7CisgICAgICAgICAgICAgIH0KKyA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YWJsZWRfcAorICAgICAgICAgICAgICAmJiB2cG9zID09IHctPmN1 cnNvci52cG9zKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBjdXJzb3JfbWF0cml4ID0g dy0+ZGVzaXJlZF9tYXRyaXg7CisgICAgICAgICAgICAgIGlmICghZm9yY2VfcCAmJiArK25fdXBk YXRlZCAlIHByZWVtcHRfY291bnQgPT0gMCkKKyAgICAgICAgICAgICAgICBkZXRlY3RfaW5wdXRf cGVuZGluZ19pZ25vcmVfc3F1ZWV6YWJsZXMgKCk7CisgICAgICAgICAgICAgIGNoYW5nZWRfcCB8 PSBtY191cGRhdGVfd2luZG93X2xpbmUgKHcsIHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3cml0dGVu X3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1 cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIGRyYXdfcCk7CisgICAgICAgICAgICAgIGlmIChNQVRS SVhfUk9XX0JPVFRPTV9ZIChyb3cpID49IHliKQorICAgICAgICAgICAgICAgIGZvciAoaW50IGkg PSB2cG9zICsgMTsgaSA8IHctPmN1cnJlbnRfbWF0cml4LT5ucm93cyAtIDE7ICsraSkKKyAgICAg ICAgICAgICAgICAgIFNFVF9NQVRSSVhfUk9XX0VOQUJMRURfUCAody0+Y3VycmVudF9tYXRyaXgs IGksIGZhbHNlKTsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAg IH0KKyAgICAgIGN1cnNvcl9tYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsKKyAgICAgIC8qIFVw ZGF0ZSB0aGUgcmVzdCBvZiB0aGUgbGluZXMuICovCisgICAgICBmb3IgKDsgcm93IDwgZW5kICYm IChmb3JjZV9wIHx8ICFpbnB1dF9wZW5kaW5nKTsgKytyb3cpCisgICAgICAgIC8qIHNjcm9sbGlu Z193aW5kb3cgcmVzZXRzIHRoZSBlbmFibGVkX3AgZmxhZyBvZiB0aGUgcm93cyBpdCByZXVzZXMg ZnJvbQorICAgICAgICBjdXJyZW50X21hdHJpeC4gKi8KKyAgICAgICAgaWYgKHJvdy0+ZW5hYmxl ZF9wKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9T IChyb3csIHctPmRlc2lyZWRfbWF0cml4KTsKKyAgICAgICAgICAgIC8qIElmIHRoZSBgY3Vyc29y X3Jvd2AgaXMgd2l0aGluIHRoZSBgZGVzaXJlZF9tYXRyaXhgLCB0aGVuIGl0IHdhcworICAgICAg ICAgICAgcHJvY2Vzc2VkIGhlcmVpbmFib3ZlIGFuZCBzaG91bGQgYmUgc2tpcHBlZCBhdCB0aGlz IHRpbWUuICovCisgICAgICAgICAgICBpZiAodnBvcyA9PSB3LT5jdXJzb3IudnBvcykKKyAgICAg ICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgaW50IGk7CisgICAgICAgICAgICAvKiBXZSds bCBoYXZlIHRvIHBsYXkgYSBsaXR0bGUgYml0IHdpdGggd2hlbiB0bworICAgICAgICAgICAgICAg ZGV0ZWN0X2lucHV0X3BlbmRpbmcuICBJZiBpdCdzIGRvbmUgdG9vIG9mdGVuLAorICAgICAgICAg ICAgICAgc2Nyb2xsaW5nIGxhcmdlIHdpbmRvd3Mgd2l0aCByZXBlYXRlZCBzY3JvbGwtdXAKKyAg ICAgICAgICAgICAgIGNvbW1hbmRzIHdpbGwgdG9vIHF1aWNrbHkgcGF1c2UgcmVkaXNwbGF5LiAq LworICAgICAgICAgICAgaWYgKCFmb3JjZV9wICYmICsrbl91cGRhdGVkICUgcHJlZW1wdF9jb3Vu dCA9PSAwKQorICAgICAgICAgICAgICBkZXRlY3RfaW5wdXRfcGVuZGluZ19pZ25vcmVfc3F1ZWV6 YWJsZXMgKCk7CisgICAgICAgICAgICBjaGFuZ2VkX3AgfD0gbWNfdXBkYXRlX3dpbmRvd19saW5l ICh3LCB2cG9z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AgICAgICAgICAgICAgICBT RVRfTUFUUklYX1JPV19FTkFCTEVEX1AgKHctPmN1cnJlbnRfbWF0cml4LCBpLCBmYWxzZSk7Cisg ICAgICAgICAgfQorICAgICAgLyogV2FzIGRpc3BsYXkgcHJlZW1wdGVkPyAqLworICAgICAgcGF1 c2VkX3AgPSByb3cgPCBlbmQ7CisgICAgICBzZXRfY3Vyc29yOgorICAgICAgLyogSWYgd2UganVt cGVkIGhlcmUgZnJvbSBgc2V0X2N1cnNvcmAsIHRoZW4gc2V0IHRoZSBgY3Vyc29yX21hdHJpeGAu ICovCisgICAgICBpZiAoY3Vyc29yX21hdHJpeCA9PSBOVUxMKQorICAgICAgICBjdXJzb3JfbWF0 cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisgICAgICAvKiBSZXNldCBgcm93YCB0byAwIHNvIHRo YXQgZmFrZSBjdXJzb3JzIGNhbiBiZSBkcmF3biBvbiByb3dzIHByZWNlZGluZyB0aGUKKyAgICAg IGZpcnN0IGByb3ctPmVuYWJsZWRfcGAuICBKdXN0IHByaW9yIHRvIHRoZSBjYWxsIHRvIGBzY3Jv bGxpbmdfd2luZG93JyBhYm92ZSwKKyAgICAgIGByb3dgIHdhcyBhZHZhbmNlZCB0byB0aGUgZmly c3QgYHJvdy0+ZW5hYmxlZF9wYC4gKi8KKyAgICAgIGZvciAoc3RydWN0IGdseXBoX3JvdyAqZGVz aXJlZF9yb3cgPSBNQVRSSVhfUk9XICh3LT5kZXNpcmVkX21hdHJpeCwgMCk7CisgICAgICAgICAg IGRlc2lyZWRfcm93IDwgZW5kCisgICAgICAgICAgICYmIChmb3JjZV9wIHx8ICFpbnB1dF9wZW5k aW5nKQorICAgICAgICAgICAvKiBXMzIgRW1hY3MgY3Jhc2hlcyBvbiBzdGFydHVwIHdpdGhvdXQg YSBCVUZGRVJQIGNoZWNrLiAqLworICAgICAgICAgICAmJiBCVUZGRVJQICh3LT5jb250ZW50cykK KyAgICAgICAgICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2Nv bmYpKQorICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRz KSwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpOworICAgICAgICAgICArK2Rlc2lyZWRfcm93KQor ICAgICAgICB7CisgICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKGRlc2lyZWRf cm93LCB3LT5kZXNpcmVkX21hdHJpeCk7CisgICAgICAgICAgaWYgKGRlc2lyZWRfcm93LT5lbmFi bGVkX3ApCisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93 ICpjdXJyZW50X3JvdyA9IE1BVFJJWF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB2cG9zKTsKKyAg ICAgICAgICBlbnVtIG1jX3Jvd19wb3NpdGlvbiByb3dfcG9zaXRpb24gPSBtY19yb3dfcG9zaXRp b24gKHcsIGN1cnJlbnRfcm93LCBjdXJyZW50X3JvdywgdnBvcyk7CisgICAgICAgICAgaWYgKGN1 cnJlbnRfcm93LT5lbmFibGVkX3ApCisgICAgICAgICAgICBtY19kcmF3X3JvdyAodywgdy0+Y3Vy cmVudF9tYXRyaXgsIGN1cnJlbnRfcm93LCBjdXJyZW50X3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV0s CisgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudF9yb3ctPngsIGN1cnJlbnRfcm93LT51 c2VkW1RFWFRfQVJFQV0sIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21h dHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBkcmF3X3AsCisgICAgICAgICAgICAgICAg ICAgICAgICAgU0VUX0NVUlN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WVfZ2x5 cGhfbWF0cml4ICh3LT5kZXNpcmVkX21hdHJpeCk7CiAJICB3LT5jdXJyZW50X21hdHJpeCA9IHct PmRlc2lyZWRfbWF0cml4ID0gTlVMTDsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBtY194ZnJlZV9jYWNoZV9tYXRyaXggKHcsICZ3LT5t Y19tYXRyaXgpOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJfQogCiAgICAgICAv KiBOZXh0IHdpbmRvdyBvbiBzYW1lIGxldmVsLiAgKi8KQEAgLTMzODcsNiArNTE3OSwyNiBAQCBj aGVja19jdXJyZW50X21hdHJpeF9mbGFncyAoc3RydWN0IHdpbmRvdyAqdykKIHN0YXRpYyBib29s CiB1cGRhdGVfd2luZG93IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3ApCiB7CisKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgaWYg KG1jX3N0ZGVycl9wKQorICAgIGZwcmludGYgKHN0ZGVyciwgInVwZGF0ZV93aW5kb3cgKCVzKVxu IiwgbWNfd2luZG93ICh3KSk7CisKKyAgc3RydWN0IG1jX2Vzc2VudGlhbHMgZXNzZW50aWFsczsK KyAgbWNfc2V0X2Vzc2VudGlhbHMgKHcsICZlc3NlbnRpYWxzKTsKKworICBtY191cGRhdGVfd2lu ZG93X2RyeXJ1biAodywgZm9yY2VfcCwgZXNzZW50aWFscyk7CisKKyAgc3RydWN0IGdseXBoX21h dHJpeCAqY3Vyc29yX21hdHJpeCA9IE5VTEw7CisKKyAgYm9vbCBkcmF3X3AgPSB0cnVlOworCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIHN0cnVjdCBnbHlwaF9tYXRyaXggKmRlc2ly ZWRfbWF0cml4ID0gdy0+ZGVzaXJlZF9tYXRyaXg7CiAgIGJvb2wgcGF1c2VkX3A7CiAgIGludCBw cmVlbXB0X2NvdW50ID0gY2xpcF90b19ib3VuZHMgKDEsIGJhdWRfcmF0ZSAvIDI0MDAgKyAxLCBJ TlRfTUFYKTsKQEAgLTM0NjQsNiArNTI3Niw0NyBAQCB1cGRhdGVfd2luZG93IChzdHJ1Y3Qgd2lu ZG93ICp3LCBib29sIGZvcmNlX3ApCiAJICAgIH0KIAl9CiAKKworLyogKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgLyogUHJvY2VzcyB0aGUgY3Vyc29y IHJvdyBhdCB0aGUgb3V0c2V0IGlmIGl0IGlzIHdpdGhpbiBgZGVzaXJlZF9tYXRyaXhgLgorICBX aGVuIHByb2Nlc3NpbmcgYWxsIG90aGVyIHJvd3MsIHdlIHdpbGwgcXVlcnkgdGhlIGB3LT5jdXJy ZW50X21hdHJpeGAgZm9yIGRhdGEKKyAgcmVsYXRpbmcgdG8gdGhlIGN1cnNvciByb3cuICBgbWFr ZV9jdXJyZW50YCAod2l0aGluIGB1cGRhdGVfd2luZG93X2xpbmUnKQorICB1cGRhdGVzIHRoZSBg dy0+Y3VycmVudF9tYXRyaXhgIGZvciB0aGUgYXBwbGljYWJsZSByb3cuICBJbiBkb2luZyBzbywg aG93ZXZlciwKKyAgdGhlIGFwcGxpY2FibGUgcm93IGluIHRoZSBkZXNpcmVkIG1hdHJpeCBpcyBh bHRlcmVkIHN1Y2ggdGhhdCB3ZSBjYW4gbm8gbG9uZ2VyCisgIHJlbHkgdXBvbiB0aGUgYWNjdXJh Y3kgb2YgYFJPVy0+dXNlZFtURVhUX0FSRUFdYC4gIFRoZXJlZm9yZSwgd2UgbXVzdCBub3cgcmVs eQorICBleGNsdXNpdmVseSB1cG9uIGB3LT5jdXJyZW50X21hdHJpeCcgZm9yIGN1cnNvciByb3cg YmFzZWQgZGVjaXNpb25zLiAqLworICBmb3IgKHN0cnVjdCBnbHlwaF9yb3cgKm1jX3JvdyA9IHJv dzsKKyAgICAgICBtY19yb3cgPCBlbmQgJiYgKGZvcmNlX3AgfHwgIWlucHV0X3BlbmRpbmcpOwor ICAgICAgICsrbWNfcm93KQorICAgIHsKKyAgICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9T IChtY19yb3csIGRlc2lyZWRfbWF0cml4KTsKKyAgICAgIGlmIChtY19yb3ctPmVuYWJsZWRfcAor ICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgIHsKKyAgICAgICAg ICBjdXJzb3JfbWF0cml4ID0gZGVzaXJlZF9tYXRyaXg7CisgICAgICAgICAgaWYgKCFmb3JjZV9w ICYmICsrbl91cGRhdGVkICUgcHJlZW1wdF9jb3VudCA9PSAwKQorICAgICAgICAgICAgZGV0ZWN0 X2lucHV0X3BlbmRpbmdfaWdub3JlX3NxdWVlemFibGVzICgpOworICAgICAgICAgIGNoYW5nZWRf cCB8PSAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAo IU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgfHwgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg Y3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgISBOSUxQIChCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2libGUpKSkpCisgICAgICAgICAgICAgICAg ICAgICAgID8gbWNfdXBkYXRlX3dpbmRvd19saW5lICh3LCB2cG9zLCAmbW91c2VfZmFjZV9vdmVy d3JpdHRlbl9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgY3Vyc29yX21hdHJpeCwgZXNzZW50aWFscywgZHJhd19wKQorICAgICAgICAgICAgICAgICAg ICAgICA6IHVwZGF0ZV93aW5kb3dfbGluZSAodywgdnBvcywgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0 ZW5fcCk7CisgICAgICAgICAgaWYgKE1BVFJJWF9ST1dfQk9UVE9NX1kgKHJvdykgPj0geWIpCisg ICAgICAgICAgICBmb3IgKGludCBpID0gdnBvcyArIDE7IGkgPCB3LT5jdXJyZW50X21hdHJpeC0+ bnJvd3MgLSAxOyArK2kpCisgICAgICAgICAgICAgIFNFVF9NQVRSSVhfUk9XX0VOQUJMRURfUCAo dy0+Y3VycmVudF9tYXRyaXgsIGksIGZhbHNlKTsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAg fQorICAgIH0KKworICBjdXJzb3JfbWF0cml4ID0gdy0+Y3VycmVudF9tYXRyaXg7CisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIC8qIFVwZGF0ZSB0aGUgcmVzdCBvZiB0aGUg bGluZXMuICAqLwogICAgICAgZm9yICg7IHJvdyA8IGVuZCAmJiAoZm9yY2VfcCB8fCAhaW5wdXRf cGVuZGluZyk7ICsrcm93KQogCS8qIHNjcm9sbGluZ193aW5kb3cgcmVzZXRzIHRoZSBlbmFibGVk X3AgZmxhZyBvZiB0aGUgcm93cyBpdApAQCAtMzQ3MSw2ICs1MzI0LDE5IEBAIHVwZGF0ZV93aW5k b3cgKHN0cnVjdCB3aW5kb3cgKncsIGJvb2wgZm9yY2VfcCkKIAlpZiAocm93LT5lbmFibGVkX3Ap CiAJICB7CiAJICAgIGludCB2cG9zID0gTUFUUklYX1JPV19WUE9TIChyb3csIGRlc2lyZWRfbWF0 cml4KTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMg Ki8KKworICAgICAgICAgIC8qIElmIHRoZSBgY3Vyc29yX3Jvd2AgaXMgd2l0aGluIHRoZSBgZGVz aXJlZF9tYXRyaXhgLCB0aGVuIGl0IHdhcworICAgICAgICAgIHByb2Nlc3NlZCBoZXJlaW5hYm92 ZSBhbmQgc2hvdWxkIGJlIHNraXBwZWQgYXQgdGhpcyB0aW1lLiAqLworICAgICAgICAgIGlmICh2 cG9zID09IHctPmN1cnNvci52cG9zKQorICAgICAgICAgIGNvbnRpbnVlOworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAJICAgIGludCBpOwogCiAJICAgIC8qIFdlJ2xsIGhhdmUgdG8g cGxheSBhIGxpdHRsZSBiaXQgd2l0aCB3aGVuIHRvCkBAIC0zNDc5LDggKzUzNDUsMjEgQEAgdXBk YXRlX3dpbmRvdyAoc3RydWN0IHdpbmRvdyAqdywgYm9vbCBmb3JjZV9wKQogCSAgICAgICBjb21t YW5kcyB3aWxsIHRvbyBxdWlja2x5IHBhdXNlIHJlZGlzcGxheS4gICovCiAJICAgIGlmICghZm9y Y2VfcCAmJiArK25fdXBkYXRlZCAlIHByZWVtcHRfY291bnQgPT0gMCkKIAkgICAgICBkZXRlY3Rf aW5wdXRfcGVuZGluZ19pZ25vcmVfc3F1ZWV6YWJsZXMgKCk7Ci0JICAgIGNoYW5nZWRfcCB8PSB1 cGRhdGVfd2luZG93X2xpbmUgKHcsIHZwb3MsCi0JCQkJCSAgICAgJm1vdXNlX2ZhY2Vfb3Zlcndy aXR0ZW5fcCk7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJT T1JTICovCisKKyAgICAgICAgICBjaGFuZ2VkX3AgfD0gKEJVRkZFUlAgKHctPmNvbnRlbnRzKQor ICAgICAgICAgICAgICAgICAgICAgICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIG1jX2NvbmYpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICFOSUxQIChC VkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHx8ICEgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192 aXNpYmxlKSkpKQorICAgICAgICAgICAgICAgICAgICAgICA/IG1jX3VwZGF0ZV93aW5kb3dfbGlu ZSAodywgdnBvcywgJm1vdXNlX2ZhY2Vfb3ZlcndyaXR0ZW5fcCwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMs IGRyYXdfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgOiB1cGRhdGVfd2luZG93X2xpbmUgKHcs IHZwb3MsICZtb3VzZV9mYWNlX292ZXJ3cml0dGVuX3ApOworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKwogCiAJICAgIC8qIE1hcmsgYWxsIHJvd3MgYmVsb3cgdGhlIGxhc3QgdmlzaWJsZSBv bmUgaW4gdGhlIGN1cnJlbnQKIAkgICAgICAgbW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AgICAm JiBCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAmJiAoIU5JTFAgKEJWQVIgKFhCVUZGRVIg KHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisgICAgICAgICAgIHx8ICFOSUxQIChCVkFSIChYQlVG RkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICAgICB8fCAhTklMUCAoQlZB UiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpOworICAgICAgICsrZGVzaXJl ZF9yb3cpCisgICAgeworICAgICAgaW50IHZwb3MgPSBNQVRSSVhfUk9XX1ZQT1MgKGRlc2lyZWRf cm93LCBkZXNpcmVkX21hdHJpeCk7CisgICAgICBpZiAoZGVzaXJlZF9yb3ctPmVuYWJsZWRfcCkK KyAgICAgICAgY29udGludWU7CisgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpjdXJyZW50X3JvdyA9 IE1BVFJJWF9ST1cgKHctPmN1cnJlbnRfbWF0cml4LCB2cG9zKTsKKyAgICAgIGVudW0gbWNfcm93 X3Bvc2l0aW9uIHJvd19wb3NpdGlvbiA9IG1jX3Jvd19wb3NpdGlvbiAodywgY3VycmVudF9yb3cs IGN1cnJlbnRfcm93LCB2cG9zKTsKKyAgICAgIGlmIChjdXJyZW50X3Jvdy0+ZW5hYmxlZF9wKQor ICAgICAgICBtY19kcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgsIGN1cnJlbnRfcm93LCBj dXJyZW50X3Jvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgICAgICAgICAgICBjdXJy ZW50X3Jvdy0+eCwgY3VycmVudF9yb3ctPnVzZWRbVEVYVF9BUkVBXSwgdnBvcywKKyAgICAgICAg ICAgICAgICAgICAgIGN1cnNvcl9tYXRyaXgsIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwgZHJh d19wLCBTRVRfQ1VSU09SX1RXTyk7CisgICAgfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K KworCiAgICAgICAvKiBVcGRhdGUgdGhlIGhlYWRlciBsaW5lIGFmdGVyIHNjcm9sbGluZyBiZWNh dXNlIGEgbmV3IGhlYWRlcgogCSBsaW5lIHdvdWxkIG90aGVyd2lzZSBvdmVyd3JpdGUgbGluZXMg YXQgdGhlIHRvcCBvZiB0aGUgd2luZG93CiAJIHRoYXQgY2FuIGJlIHNjcm9sbGVkLiAgKi8KQEAg LTM1MTYsNyArNTQzMCw0OSBAQCB1cGRhdGVfd2luZG93IChzdHJ1Y3Qgd2luZG93ICp3LCBib29s IGZvcmNlX3ApCiAjaWZkZWYgSEFWRV9XSU5ET1dfU1lTVEVNCiAJICBpZiAoY2hhbmdlZF9wICYm IHJpZi0+Zml4X292ZXJsYXBwaW5nX2FyZWEpCiAJICAgIHsKLQkgICAgICByZWRyYXdfb3Zlcmxh cHBlZF9yb3dzICh3LCB5Yik7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKy8qIGByZWRyYXdfb3ZlcmxhcHBlZF9yb3dzJzogIFJlZHJhdyBs aW5lcyBmcm9tIHRoZSBjdXJyZW50IG1hdHJpeCBvZiB3aW5kb3cgVwordGhhdCBhcmUgb3Zlcmxh cHBlZCBieSBvdGhlciByb3dzLiAgWUIgaXMgYm90dG9tLW1vc3QgeS1wb3NpdGlvbiBpbiBXLiAg SWYgcm93cworb3ZlcmxhcHBpbmcgb3RoZXJzIGhhdmUgYmVlbiBjaGFuZ2VkLCB0aGUgcm93cyBi ZWluZyBvdmVybGFwcGVkIGhhdmUgdG8gYmUKK3JlZHJhd24uICBUaGlzIHdvbid0IGRyYXcgbGlu ZXMgdGhhdCBoYXZlIGFscmVhZHkgYmVlbiBkcmF3biBpbiB1cGRhdGVfd2luZG93CitsaW5lIGJl Y2F1c2Ugb3ZlcmxhcHBlZF9wIGluIGRlc2lyZWQgcm93cyBpcyAwLCBzbyBhZnRlciByb3cgYXNz aWdubWVudAorb3ZlcmxhcHBlZF9wIGluIGN1cnJlbnQgcm93cyBpcyAwLiAqLworICBzdHJ1Y3Qg ZnJhbWUgKmYgPSBYRlJBTUUgKFdJTkRPV19GUkFNRSAodykpOworICBmb3IgKGludCBpID0gMDsg aSA8IHctPmN1cnJlbnRfbWF0cml4LT5ucm93czsgKytpKQorICAgIHsKKyAgICAgIHN0cnVjdCBn bHlwaF9yb3cgKnJvdyA9IHctPmN1cnJlbnRfbWF0cml4LT5yb3dzICsgaTsKKyAgICAgIGlmICgh cm93LT5lbmFibGVkX3ApCisgICAgICAgIGJyZWFrOworICAgICAgICBlbHNlIGlmIChyb3ctPm1v ZGVfbGluZV9wKQorICAgICAgICAgIGNvbnRpbnVlOworICAgICAgaWYgKHJvdy0+b3ZlcmxhcHBl ZF9wKQorICAgICAgICB7CisgICAgICAgICAgZm9yIChlbnVtIGdseXBoX3Jvd19hcmVhIGFyZWEg PSBMRUZUX01BUkdJTl9BUkVBOyBhcmVhIDwgTEFTVF9BUkVBOyArK2FyZWEpCisgICAgICAgICAg ICB7CisgICAgICAgICAgICAgIG91dHB1dF9jdXJzb3JfdG8gKHcsIGksIDAsIHJvdy0+eSwgYXJl YSA9PSBURVhUX0FSRUEgPyByb3ctPnggOiAwKTsKKyAgICAgICAgICAgICAgaWYgKCFtY19yZWRy YXdfcm93ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgcm93LCBhcmVhLCByb3ctPngsIDAsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93LT51c2VkW2FyZWFdLCB0cnVlLCBEUkFX X05PUk1BTF9URVhULAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVQREFURV9X SU5ET1dfX1JFRFJBV19PVkVSTEFQUEVEX1JPV1MpCisgICAgICAgICAgICAgICAgICAmJiByb3ct PnVzZWRbYXJlYV0pCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgRlJBTUVf UklGIChmKS0+d3JpdGVfZ2x5cGhzICh3LCByb3csIHJvdy0+Z2x5cGhzW2FyZWFdLCBhcmVhLAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb3ctPnVzZWRb YXJlYV0pOworICAgICAgICAgICAgICAgICAgRlJBTUVfUklGIChmKS0+Y2xlYXJfZW5kX29mX2xp bmUgKHcsIHJvdywgYXJlYSwgLTEpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0K KyAgICAgICAgICByb3ctPm92ZXJsYXBwZWRfcCA9IDA7CisgICAgICAgIH0KKyAgICAgIGlmIChN QVRSSVhfUk9XX0JPVFRPTV9ZIChyb3cpID49IHliKQorICAgICAgICBicmVhazsKKyAgICB9CisK Ky8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgICAgICByZWRyYXdfb3ZlcmxhcHBpbmdf cm93cyAodywgeWIpOwogCSAgICB9CiAjZW5kaWYKQEAgLTM1MzYsOCArNTQ5MiwyMCBAQCB1cGRh dGVfd2luZG93IChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIGZvcmNlX3ApCiAjZW5kaWYKIAogI2lm ZGVmIEhBVkVfV0lORE9XX1NZU1RFTQorCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyog TVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAg ICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAg ICBtY191cGRhdGVfd2luZG93X2ZyaW5nZXMgKHcsIDApOworICAgIGVsc2UKICAgICAgIHVwZGF0 ZV93aW5kb3dfZnJpbmdlcyAodywgMCk7CiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisK ICAgICAgIC8qIEVuZCB0aGUgdXBkYXRlIG9mIHdpbmRvdyBXLiAgRG9uJ3Qgc2V0IHRoZSBjdXJz b3IgaWYgd2UKICAgICAgICAgIHBhdXNlZCB1cGRhdGluZyB0aGUgZGlzcGxheSBiZWNhdXNlIGlu IHRoaXMgY2FzZSwKICAgICAgICAgIHNldF93aW5kb3dfY3Vyc29yX2FmdGVyX3VwZGF0ZSBoYXNu J3QgYmVlbiBjYWxsZWQsIGFuZApkaWZmIC0tZ2l0IGEvc3JjL2ZyYW1lLmggYi9zcmMvZnJhbWUu aAppbmRleCBmYTQ1YTMyLi41M2FkMTMxIDEwMDY0NAotLS0gYS9zcmMvZnJhbWUuaAorKysgYi9z cmMvZnJhbWUuaApAQCAtMjA1LDYgKzIwNSwxNiBAQCBzdHJ1Y3QgZnJhbWUKICAgTGlzcF9PYmpl Y3QgdG9vbF9iYXJfaXRlbXM7CiAgIC8qIHRvb2xfYmFyX2l0ZW1zIHNob3VsZCBiZSB0aGUgbGFz dCBMaXNwX09iamVjdCBtZW1iZXIuICAqLwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIC8qIE5vbi1uaWwgd2hlbiB0aGUgZnJhbWUgaXMg aW4gdGhlIHByb2Nlc3Mgb2YgYmVpbmcgdXBkYXRlZC4gKi8KKyAgc3RydWN0IGZyYW1lICptY191 cGRhdGluZ19mcmFtZTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBDYWNo ZSBvZiByZWFsaXplZCBmYWNlcy4gICovCiAgIHN0cnVjdCBmYWNlX2NhY2hlICpmYWNlX2NhY2hl OwogCmRpZmYgLS1naXQgYS9zcmMvZnJpbmdlLmMgYi9zcmMvZnJpbmdlLmMKaW5kZXggZDBkNTk5 Mi4uNjYzODVmZiAxMDA2NDQKLS0tIGEvc3JjL2ZyaW5nZS5jCisrKyBiL3NyYy9mcmluZ2UuYwpA QCAtNDM3LDggKzQzNyw0NjIgQEAgc3RhdGljIHVuc2lnbmVkIHNob3J0IGVtcHR5X2xpbmVfYml0 c1tdID0gewogI2RlZmluZSBTVEFOREFSRF9CSVRNQVBfSEVJR0hUKGJpdHMpIChzaXplb2YgKGJp dHMpL0JZVEVTX1BFUl9CSVRNQVBfUk9XKQogI2RlZmluZSBGUkJJVFMoYml0cykgIGJpdHMsIFNU QU5EQVJEX0JJVE1BUF9IRUlHSFQgKGJpdHMpCiAKKworLyogKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov CisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy8qIGArLWZyaW5nZS1oZWxwZXItZGVj aW1hbCcgZGVmaW5lZCBpbiBgKy1tb2RlLmVsYCAqLworCisvKiBUT0RPOiAgQ29uc2lkZXIgYWRk aW5nIHRoZSBmb2xsb3dpbmcgZnJpbmdlIGJpdG1hcHM6CisgIChkZWZpbmUtZnJpbmdlLWJpdG1h cCAnYnJlYWtwb2ludCAiXHgzY1x4N2VceGZmXHhmZlx4ZmZceGZmXHg3ZVx4M2MiKQorICAoZGVm aW5lLWZyaW5nZS1iaXRtYXAgJ2hvbGxvdy1yaWdodC10cmlhbmdsZSAiXHhlMFx4OTBceDg4XHg4 NFx4ODRceDg4XHg5MFx4ZTAiKSAqLworCisvKi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gMHgzLCAweDYzLCAweDMzLCAweDFiLCAweGZmLCAweGZmLCAweDFiLCAweDMzLCAweDYzLCAw eDMsIDB4MywgMHgzfTsKKworLyogMjYKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFs CisgICAgICAieHh4eHh4eHgiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisg ICAgICAieC4ueHguLngiCisgICAgICAieC4uLnh4LngiCisgICAgICAieC4uLi54eHgiCisgICAg ICAieC54eHh4eHgiCisgICAgICAieC54eHh4eHgiCisgICAgICAieC4uLi54eHgiCisgICAgICAi eC4uLnh4LngiCisgICAgICAieC4ueHguLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4u Li4uLngiCisgICAgICAieHh4eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19o b2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93X2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgx LCAweDk5LCAweDhkLCAweDg3LCAweGJmLAorICAweGJmLCAweDg3LCAweDhkLCAweDk5LCAweDgx LCAweDgxLCAweGZmfTsKKworLyogMjcKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFs CisgICAgICAieHh4eHh4eHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieC4uLi4ueHgiCisg ICAgICAieC54eC4ueHgiCisgICAgICAieC4ueHgueHgiCisgICAgICAieC4uLnh4eHgiCisgICAg ICAieHh4eHh4eHgiCisgICAgICAieHh4eHh4eHgiCisgICAgICAieC4uLnh4eHgiCisgICAgICAi eC4ueHgueHgiCisgICAgICAieC54eC4ueHgiCisgICAgICAieC4uLi4ueHgiCisgICAgICAieC4u Li4ueHgiCisgICAgICAieHh4eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19y ZXZlcnNlZF9ob2xsb3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93X2JpdHNbXSA9eworICAweGZmLCAw eDgxLCAweDgxLCAweGIxLCAweDk5LCAweDhkLCAweGZmLAorICAweGZmLCAweDhkLCAweDk5LCAw eGIxLCAweDgxLCAweDgxLCAweGZmfTsKKworLyogMjgKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhl eGFkZWNpbWFsCisgICAgICAieHh4eHh4eHgiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4u Li4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4u LngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngi CisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisgICAgICAieC4uLi4uLngiCisg ICAgICAieC4uLi4uLngiCisgICAgICAieHh4eHh4eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBz aG9ydCBtY19ob2xsb3dfcmVjdGFuZ2xlX2JpdHNbXSA9eworICAweGZmLCAweDgxLCAweDgxLCAw eDgxLCAweDgxLCAweDgxLCAweDgxLAorICAweDgxLCAweDgxLCAweDgxLCAweDgxLCAweDgxLCAw eDgxLCAweGZmfTsKKworLyogMjkKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisg ICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAg ICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAi eC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4u Li4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4uLi4iCisgICAgICAieC4uLi4u Li4iCisgICAgICAieC4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY192ZXJ0 aWNhbF9iYXJfYml0c1tdID17CisgIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAs IDB4ODAsCisgIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODAsIDB4ODB9OworCisv KiAzMAorICAgICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLi4uLi54eCIK KyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAg ICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAg ICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIu Li4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4u Li54eCIpCisqLworc3RhdGljIHVuc2lnbmVkIHNob3J0IG1jX3JldmVyc2VkX3ZlcnRpY2FsX2Jh cl9iaXRzW10gPXsKKyAgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDMsIDB4 MywgMHgzLCAweDMsIDB4MywgMHgzLCAweDN9OworCisvKiAzMQorICAgICgrLWZyaW5nZS1oZWxw ZXItaGV4YWRlY2ltYWwKKyAgICAgICJ4eC4uLi4uLiIKKyAgICAgICJ4eC4uLi4uLiIKKyAgICAg ICIgeHguLi4uLiIKKyAgICAgICIueHguLi4uLiIKKyAgICAgICIuLnh4Li4uLiIKKyAgICAgICIu Lnh4Li4uLiIKKyAgICAgICIuLi54eC4uLiIKKyAgICAgICIuLi54eC4uLiIKKyAgICAgICIuLi4u eHguLiIKKyAgICAgICIuLi4ueHguLiIKKyAgICAgICIuLi4uLnh4LiIKKyAgICAgICIuLi4uLnh4 LiIKKyAgICAgICIuLi4uLi54eCIKKyAgICAgICIuLi4uLi54eCIpCisqLworc3RhdGljIHVuc2ln bmVkIHNob3J0IG1jX2JhY2tzbGFzaF9iaXRzW10gPXsKKyAgMHhjMCwgMHhjMCwgMHhlMCwgMHg2 MCwgMHgzMCwgMHgzMCwgMHgxOCwgMHgxOCwgMHhjLCAweGMsIDB4NiwgMHg2LCAweDMsIDB4M307 CisKKy8qIDMyCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgInh4Li4u Li4uIgorICAgICAgInh4Li4uLi4uIgorICAgICAgInh4eC4uLi4uIgorICAgICAgInh4eC4uLi4u IgorICAgICAgIngueHguLi4uIgorICAgICAgIngueHguLi4uIgorICAgICAgInguLnh4Li4uIgor ICAgICAgInguLnh4Li4uIgorICAgICAgInguLi54eC4uIgorICAgICAgInguLi54eC4uIgorICAg ICAgInguLi4ueHguIgorICAgICAgInguLi4ueHguIgorICAgICAgInguLi4uLnh4IgorICAgICAg InguLi4uLnh4IikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdmVydGljYWxfYmFyX2Jh Y2tzbGFzaF9iaXRzW10gPXsKKyAgMHhjMCwgMHhjMCwgMHhlMCwgMHhlMCwgMHhiMCwgMHhiMCwg MHg5OCwKKyAgMHg5OCwgMHg4YywgMHg4YywgMHg4NiwgMHg4NiwgMHg4MywgMHg4M307CisKKy8q IDMzCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi54eHh4eHguIgor ICAgICAgInh4eHgueC4uIgorICAgICAgInh4eHgueC4uIgorICAgICAgInh4eHgueC4uIgorICAg ICAgIi54eHgueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAg Ii4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4uLngueC4uIgorICAgICAgIi4u LngueC4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfcGlsY3Jvd19iaXRzW10gPXsK KyAgMHg3ZSwgMHhmNCwgMHhmNCwgMHhmNCwgMHg3NCwgMHgxNCwgMHgxNCwgMHgxNCwgMHgxNCwg MHgxNCwgMHgxNH07CisKKy8qIDM0CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAor ICAgICAgIi4ueHh4eC4uIgorICAgICAgIi54eHh4eHguIgorICAgICAgInguLnh4Li54IgorICAg ICAgInguLnh4Li54IgorICAgICAgInh4eHh4eHh4IgorICAgICAgInh4Li4uLnh4IgorICAgICAg Inh4eC4ueHh4IgorICAgICAgIi54eHh4eHguIgorICAgICAgIi4ueHh4eC4uIikKKyovCitzdGF0 aWMgdW5zaWduZWQgc2hvcnQgbWNfc21pbGV5X2ZhY2VfYml0c1tdID17CisgIDB4M2MsIDB4N2Us IDB4OTksIDB4OTksIDB4ZmYsIDB4YzMsIDB4ZTcsIDB4N2UsIDB4M2N9OworCisvKiAzNQorICAg ICgrLWZyaW5nZS1oZWxwZXItaGV4YWRlY2ltYWwKKyAgICAgICIuLnguLi4uLiIKKyAgICAgICIu Li54Li4uLiIKKyAgICAgICIuLi4ueC4uLiIKKyAgICAgICIuLi4uLnguLiIKKyAgICAgICIuLi4u eC4uLiIKKyAgICAgICIuLi54Li4uLiIKKyAgICAgICIuLnguLi4uLiIpCisqLworc3RhdGljIHVu c2lnbmVkIHNob3J0IG1jX3NpbmdsZV9hbmdsZV9yaWdodF9iaXRzW10gPXsKKyAgMHgyMCwgMHgx MCwgMHg4LCAweDQsIDB4OCwgMHgxMCwgMHgyMH07CisKKy8qIDM2CisgICAgKCstZnJpbmdlLWhl bHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4ueC4uIgorICAgICAgIi4uLi54Li4uIgorICAg ICAgIi4uLnguLi4uIgorICAgICAgIi4ueC4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAg Ii4uLi54Li4uIgorICAgICAgIi4uLi4ueC4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQg bWNfc2luZ2xlX2FuZ2xlX2xlZnRfYml0c1tdID17CisgIDB4NCwgMHg4LCAweDEwLCAweDIwLCAw eDEwLCAweDgsIDB4NH07CisKKy8qIDM3CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1h bAorICAgICAgInh4Lnh4Li4uIgorICAgICAgIi54eC54eC4uIgorICAgICAgIi4ueHgueHguIgor ICAgICAgIi4uLnh4Lnh4IgorICAgICAgIi4ueHgueHguIgorICAgICAgIi54eC54eC4uIgorICAg ICAgInh4Lnh4Li4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xl X3JpZ2h0X2JpdHNbXSA9eworICAweGQ4LCAweDZjLCAweDM2LCAweDFiLCAweDM2LCAweDZjLCAw eGQ4fTsKKworLyogMzgKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAi Li4ueHgueHgiCisgICAgICAiLi54eC54eC4iCisgICAgICAiLnh4Lnh4Li4iCisgICAgICAieHgu eHguLi4iCisgICAgICAiLnh4Lnh4Li4iCisgICAgICAiLi54eC54eC4iCisgICAgICAiLi4ueHgu eHgiKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19kb3VibGVfYW5nbGVfbGVmdF9iaXRz W10gPXsKKyAgMHgxYiwgMHgzNiwgMHg2YywgMHhkOCwgMHg2YywgMHgzNiwgMHgxYn07CisKKy8q IDM5CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIngueC54Li4uIgor ICAgICAgIi54LngueC4uIgorICAgICAgIi4ueC54LnguIgorICAgICAgIi4uLngueC54IgorICAg ICAgIi4ueC54LnguIgorICAgICAgIi54LngueC4uIgorICAgICAgIngueC54Li4uIikKKyovCitz dGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfdHJpcGxlX2FuZ2xlX3JpZ2h0X2JpdHNbXSA9eworICAw eGE4LCAweDU0LCAweDJhLCAweDE1LCAweDJhLCAweDU0LCAweGE4fTsKKworLyogNDAKKyAgICAo Ky1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4ueC54LngiCisgICAgICAiLi54 LngueC4iCisgICAgICAiLngueC54Li4iCisgICAgICAieC54LnguLi4iCisgICAgICAiLngueC54 Li4iCisgICAgICAiLi54LngueC4iCisgICAgICAiLi4ueC54LngiKQorKi8KK3N0YXRpYyB1bnNp Z25lZCBzaG9ydCBtY190cmlwbGVfYW5nbGVfbGVmdF9iaXRzW10gPXsKKyAgMHgxNSwgMHgyYSwg MHg1NCwgMHhhOCwgMHg1NCwgMHgyYSwgMHgxNX07CisKKy8qIDQxCisgICAgKCstZnJpbmdlLWhl bHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAg ICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLnguLi4uIgorICAgICAg Ii4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLi4uLnguIgorICAgICAgIi4u Li4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4u Li4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfc2luZ2xlX2FuZ2xlX3VwX2JpdHNb XSA9eworICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDgyLCAw eDAwLCAweDAwLCAweDAwLCAweDAwfTsKKworLyogNDIKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhl eGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4u Li4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLnguLi54 Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLi4uLi4i CisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iKQor Ki8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19zaW5nbGVfYW5nbGVfZG93bl9iaXRzW10gPXsK KyAgMHgwMCwgMHgwMCwgMHgwMCwgMHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHgxMCwgMHgwMCwg MHgwMCwgMHgwMCwgMHgwMH07CisKKy8qIDQzCisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVj aW1hbAorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4u IgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgor ICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAg ICAgInguLi4uLnguIgorICAgICAgIi4uLi4uLi4uIgorICAgICAgIi4uLi4uLi4uIgorICAgICAg Ii4uLi4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQgbWNfZG91YmxlX2FuZ2xlX3Vw X2JpdHNbXSA9eworICAweDAwLCAweDAwLCAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAweDkyLCAw eDI4LCAweDQ0LCAweDgyLCAweDAwLCAweDAwLCAweDAwfTsKKworLyogNDQKKyAgICAoKy1mcmlu Z2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4i CisgICAgICAiLi4uLi4uLi4iCisgICAgICAieC4uLi4ueC4iCisgICAgICAiLnguLi54Li4iCisg ICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAg ICAiLi54LnguLi4iCisgICAgICAiLi4ueC4uLi4iCisgICAgICAiLi4uLi4uLi4iCisgICAgICAi Li4uLi4uLi4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBt Y19kb3VibGVfYW5nbGVfZG93bl9iaXRzW10gPXsKKyAgMHgwMCwgMHgwMCwgMHgwMCwgMHg4Miwg MHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHgxMCwgMHgwMCwgMHgwMCwgMHgwMH07CisK Ky8qIDQ1CisgICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLi4uLi4u IgorICAgICAgIi4uLnguLi4uIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgor ICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAg ICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAg InguLi4uLnguIgorICAgICAgIi4uLi4uLi4uIikKKyovCitzdGF0aWMgdW5zaWduZWQgc2hvcnQg bWNfdHJpcGxlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDAwLCAweDEwLCAweDI4LCAweDQ0LCAw eDkyLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDgyLCAweDAwfTsKKworLyogNDYK KyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAgICAiLi4uLi4uLi4iCisgICAg ICAieC4uLi4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAi eC4ueC4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4u eC4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLi4ueC4u Li4iCisgICAgICAiLi4uLi4uLi4iKQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY19xdWFk cnVwbGVfYW5nbGVfZG93bl9iaXRzW10gPXsKKyAgMHgwMCwgMHg4MiwgMHg0NCwgMHgyOCwgMHg5 MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHgxMCwgMHgwMH07CisKKy8qIDQ3Cisg ICAgKCstZnJpbmdlLWhlbHBlci1oZXhhZGVjaW1hbAorICAgICAgIi4uLnguLi4uIgorICAgICAg Ii4ueC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4u eC54Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54 Li4uIgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLnguLnguIgorICAgICAgIi4ueC54Li4u IgorICAgICAgIi54Li4ueC4uIgorICAgICAgInguLi4uLnguIikKKyovCitzdGF0aWMgdW5zaWdu ZWQgc2hvcnQgbWNfcXVhZHJ1cGxlX2FuZ2xlX3VwX2JpdHNbXSA9eworICAweDEwLCAweDI4LCAw eDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0LCAweDkyLCAweDI4LCAweDQ0 LCAweDgyfTsKKworLyogNDgKKyAgICAoKy1mcmluZ2UtaGVscGVyLWhleGFkZWNpbWFsCisgICAg ICAieC4uLi4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAi eC4ueC4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4u eC4ueC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAieC4ueC4u eC4iCisgICAgICAiLnguLi54Li4iCisgICAgICAiLi54LnguLi4iCisgICAgICAiLi4ueC4uLi4i KQorKi8KK3N0YXRpYyB1bnNpZ25lZCBzaG9ydCBtY190cmlwbGVfYW5nbGVfZG93bl9iaXRzW10g PXsKKyAgMHg4MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgyOCwgMHg5MiwgMHg0NCwgMHgy OCwgMHg5MiwgM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gICAgIGlmIChsbjEgPiBpeDIpCisgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICBibSA9IG1jX250aCAoaXgyLCBibTEpOworICAgICAg ICAgICAgICAgIGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgICAgICAgICAgICBnb3RvIGZvdW5k OworICAgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgaWYgKGxuMSA+IGl4MSkKKyAgICAgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgICAgICBibSA9IG1jX250aCAoaXgxLCBibTEpOworICAgICAgICAgICAgICAg ICAgaWYgKCFFUSAoYm0sIFF0KSkKKyAgICAgICAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAg ICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICB9CisgICAgZWxzZSBpZiAoKGJt ID0gYm0xLCAhRVEgKGJtLCBRdCkpKQorICAgICAgZ290byBmb3VuZDsKKyAgfQorICAgIH0KKyAg aWYgKCFFUSAoY21hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRvcl9h bGlzdCkpCisgICAgICAmJiAhTklMUCAoQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2lu ZGljYXRvcl9hbGlzdCkpKQorICAgIHsKKyAgICAgIGJtMiA9IG1jX2Fzc3EgKGJpdG1hcCwgQlZB UiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpOworICAgICAgaWYg KENPTlNQIChibTIpKQorICAgICAgICB7CisgICAgICAgICAgaWYgKChibTIgPSBYQ0RSIChibTIp KSwgIU5JTFAgKGJtMikpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmIChDT05TUCAo Ym0yKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBsbjIgPSBYRklYTlVN IChGbGVuZ3RoIChibTIpKTsKKyAgICAgICAgICAgICAgICAgIGlmIChwYXJ0aWFsX3ApCisgICAg ICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBpZiAobG4yID4gaXgyKQor ICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICBibSA9 IG1jX250aCAoaXgyLCBibTIpOworICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIUVRIChi bSwgUXQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAg ICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAg ICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIGlmIChsbjEgPiBpeDEpCisg ICAgeworICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0xKTsKKyAgICAgIGlmICghRVEgKGJtLCBR dCkpCisgICAgICAgIGdvdG8gZm91bmQ7CisgICAgfQorICBpZiAobG4yID4gaXgxKQorICAgIHsK KyAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMik7CisgICAgICBpZiAoIUVRIChibSwgUXQpKQor ICAgICAgICBnb3RvIGZvdW5kOworICAgICAgcmV0dXJuIE1DX05PX0ZSSU5HRV9CSVRNQVA7Cisg ICAgfQorICAgIGVsc2UgaWYgKChibSA9IGJtMiwgTklMUCAoYm0pKSkKKyAgICAgIHJldHVybiBN Q19OT19GUklOR0VfQklUTUFQOworICBmb3VuZDoKKyAgcmV0dXJuIGxvb2t1cF9mcmluZ2VfYml0 bWFwIChibSk7Cit9CisKK3N0YXRpYyBpbnQKK21jX2dldF9sb2dpY2FsX2N1cnNvcl9iaXRtYXAg KHN0cnVjdCB3aW5kb3cgKncsIExpc3BfT2JqZWN0IGN1cnNvcikKK3sKKyAgTGlzcF9PYmplY3Qg Y21hcCwgYm0gPSBRbmlsOworICBpZiAoKGNtYXAgPS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3AgPyAyIDogMCk7CisgIC8qIExvb2t1cCBpbiBidWZmZXItbG9jYWwgZnJpbmdlLWlu ZGljYXRvci1hbGlzdCBiZWZvcmUgZ2xvYmFsIGFsaXN0LgorICAgICBFbGVtZW50cyBhcmU6Cisg IEJJVE1BUCAgICAtLSB1c2UgZm9yIGFsbAorICAoTCBSKSAgICAtLSB1c2UgZm9yIGxlZnQgcmln aHQgKHdoZXRoZXIgcGFydGlhbCBvciBub3QpCisgIChMIFIgUEwgUFIpICAtLSB1c2UgZm9yIGxl ZnQgcmlnaHQgcGFydGlhbC1sZWZ0IHBhcnRpYWwtcmlnaHQKKyAgSWYgYW55IHZhbHVlIGluIGxv Y2FsIGJpbmRpbmcgaXMgbm90IHByZXNlbnQgb3IgdCwgdXNlIGdsb2JhbCB2YWx1ZS4KKyAgICAg SWYgcGFydGlhbCwgbG9va3VwIHBhcnRpYWwgYml0bWFwIGluIGRlZmF1bHQgdmFsdWUgaWYgbm90 IGZvdW5kIGhlcmUuCisgICAgIElmIG5vdCBwYXJ0aWFsLCBvciBubyBwYXJ0aWFsIHNwZWMgaXMg cHJlc2VudCwgdXNlIG5vbi1wYXJ0aWFsIGJpdG1hcC4gKi8KKyAgaWYgKChjbWFwID0gQlZBUiAo WEJVRkZFUiAody0+Y29udGVudHMpLCBmcmluZ2VfaW5kaWNhdG9yX2FsaXN0KSksICFOSUxQIChj bWFwKSkKKyAgICB7CisgICAgICBibTEgPSBtY19hc3NxIChiaXRtYXAsIGNtYXApOworICAgICAg aWYgKENPTlNQIChibTEpKQorICAgICAgICB7CisgICAgICAgICAgaWYgKChibTEgPSBYQ0RSIChi bTEpKSwgTklMUCAoYm0xKSkKKyAgICAgICAgICAgIHJldHVybiBNQ19OT19GUklOR0VfQklUTUFQ OworICAgICAgICAgIGlmIChDT05TUCAoYm0xKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgbG4xID0gWEZJWE5VTSAoRmxlbmd0aCAoYm0xKSk7CisgICAgICAgICAgICAgIGlmIChwYXJ0 aWFsX3ApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgaWYgKGxuMSA+IGl4 MikKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGJtID0gbWNf bnRoIChpeDIsIGJtMSk7CisgICAgICAgICAgICAgICAgICAgICAgaWYgKCFFUSAoYm0sIFF0KSkK KyAgICAgICAgICAgICAgICAgICAgICAgIGdvdG8gZm91bmQ7CisgICAgICAgICAgICAgICAgICAg IH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZiAobG4xID4gaXgxKQorICAgICAgICAgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJt MSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgICAg ICAgICAgICAgICAgICAgICBnb3RvIGZvdW5kOworICAgICAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKChi bSA9IGJtMSwgIUVRIChibSwgUXQpKSkKKyAgICAgICAgICAgICAgZ290byBmb3VuZDsKKyAgICAg ICAgfQorICAgIH0KKyAgaWYgKCFFUSAoY21hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJp bmdlX2luZGljYXRvcl9hbGlzdCkpCisgICAgICAmJiAhTklMUCAoQlZBUiAoJmJ1ZmZlcl9kZWZh dWx0cywgZnJpbmdlX2luZGljYXRvcl9hbGlzdCkpKQorICAgIHsKKyAgICAgIGJtMiA9IG1jX2Fz c3EgKGJpdG1hcCwgQlZBUiAoJmJ1ZmZlcl9kZWZhdWx0cywgZnJpbmdlX2luZGljYXRvcl9hbGlz dCkpOworICAgICAgaWYgKENPTlNQIChibTIpKQorICAgICAgICB7CisgICAgICAgICAgaWYgKChi bTIgPSBYQ0RSIChibTIpKSwgIU5JTFAgKGJtMikpCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIGlmIChDT05TUCAoYm0yKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICBsbjIgPSBYRklYTlVNIChGbGVuZ3RoIChibTIpKTsKKyAgICAgICAgICAgICAgICAgIGlmIChw YXJ0aWFsX3ApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBp ZiAobG4yID4gaXgyKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg ICAgICAgICAgICBibSA9IG1jX250aCAoaXgyLCBibTIpOworICAgICAgICAgICAgICAgICAgICAg ICAgICBpZiAoIUVRIChibSwgUXQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdvdG8g Zm91bmQ7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0K KyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgIGlm IChsbjEgPiBpeDEpCisgICAgeworICAgICAgYm0gPSBtY19udGggKGl4MSwgYm0xKTsKKyAgICAg IGlmICghRVEgKGJtLCBRdCkpCisgICAgICAgIGdvdG8gZm91bmQ7CisgICAgfQorICBpZiAobG4y ID4gaXgxKQorICAgIHsKKyAgICAgIGJtID0gbWNfbnRoIChpeDEsIGJtMik7CisgICAgICBpZiAo IUVRIChibSwgUXQpKQorICAgICAgICBnb3RvIGZvdW5kOworICAgICAgcmV0dXJuIE1DX05PX0ZS SU5HRV9CSVRNQVA7CisgICAgfQorICAgIGVsc2UgaWYgKChibSA9IGJtMiwgTklMUCAoYm0pKSkK KyAgICAgIHJldHVybiBNQ19OT19GUklOR0VfQklUTUFQOworICBmb3VuZDoKKyAgcmV0dXJuIGxv b2t1cF9mcmluZ2VfYml0bWFwIChib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CBzbyBpdCdz IE9LIHRoYXQgdG9wX3Jvd19lbmRzX2F0X3p2X3AKKyAgICAgaXMgbm90IGluaXRpYWxpemVkIGhl cmUuICBTaW1pbGFybHkgZm9yIGJvdF9pbmRfcm4sCisgICAgIHJvdy0+aW5kaWNhdGVfZW9iX3Ag YW5kIGJvdF9yb3dfZW5kc19hdF96dl9wLiAqLworICBpbnQgdG9wX3Jvd19lbmRzX2F0X3p2X3Ag TUNfSUZfTElOVCAoPSAwKSwgYm90X3Jvd19lbmRzX2F0X3p2X3AgTUNfSUZfTElOVCAoPSAwKTsK KyAgaWYgKHctPnBzZXVkb193aW5kb3dfcCkKKyAgICByZXR1cm4gMDsKKyAgaWYgKCFNSU5JX1dJ TkRPV19QICh3KQorICAgICAgJiYgKGluZCA9IEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwg aW5kaWNhdGVfYnVmZmVyX2JvdW5kYXJpZXMpLCAhTklMUCAoaW5kKSkpCisgICAgeworICAgICAg aWYgKEVRIChpbmQsIFFsZWZ0KSB8fCBFUSAoaW5kLCBRcmlnaHQpKQorICAgICAgICBib3VuZGFy eV90b3AgPSBib3VuZGFyeV9ib3QgPSBhcnJvd190b3AgPSBhcnJvd19ib3QgPSBpbmQ7CisgICAg ICAgIGVsc2UgaWYgKENPTlNQIChpbmQpCisgICAgICAgICAgICAgICAgICYmIENPTlNQIChYQ0FS IChpbmQpKSkKKyAgICAgICAgeworICAgICAgICAgIExpc3BfT2JqZWN0IHBvczsKKyAgICAgICAg ICBpZiAocG9zID0gbWNfYXNzcSAoUXQsIGluZCksICFOSUxQIChwb3MpKQorICAgICAgICAgICAg Ym91bmRhcnlfdG9wID0gYm91bmRhcnlfYm90ID0gYXJyb3dfdG9wID0gYXJyb3dfYm90ID0gWENE UiAocG9zKTsKKyAgICAgICAgICBpZiAocG9zID0gbWNfYXNzcSAoUXRvcCwgaW5kKSwgIU5JTFAg KHBvcykpCisgICAgICAgICAgICBib3VuZGFyeV90b3AgPSBYQ0RSIChwb3MpOworICAgICAgICAg IGlmIChwb3MgPSBtY19hc3NxIChRYm90dG9tLCBpbmQpLCAhTklMUCAocG9zKSkKKyAgICAgICAg ICAgIGJvdW5kYXJ5X2JvdCA9IFhDRFIgKHBvcyk7CisgICAgICAgICAgaWYgKHBvcyA9IG1jX2Fz c3EgKFF1cCwgaW5kKSwgIU5JTFAgKHBvcykpCisgICAgICAgICAgICBhcnJvd190b3AgPSBYQ0RS IChwb3MpOworICAgICAgICAgIGlmIChwb3MgPSBtY19hc3NxIChRZG93biwgaW5kKSwgIU5JTFAg KHBvcykpCisgICAgICAgICAgICBhcnJvd19ib3QgPSBYQ0RSIChwb3MpOworICAgICAgICB9Cisg ICAgICAgIGVsc2UKKyAgICAgICAgICAvKiBBbnl0aGluZyBlbHNlIG1lYW5zIGJvdW5kYXJ5IG9u IGxlZnQgYW5kIG5vIGFycm93cy4gKi8KKyAgICAgICAgICBib3VuZGFyeV90b3AgPSBib3VuZGFy eV9ib3QgPSBRbGVmdDsKKyAgICB9CisgIHRvcF9pbmRfcm4gPSBib3RfaW5kX3JuID0gLTE7Cisg IGlmICghTklMUCAoaW5kKSkKKyAgICB7CisgICAgICBmb3IgKHkgPSB3LT52c2Nyb2xsLCBybiA9 IDA7CisgICAgICAgICAgIHkgPCB5YiAmJiBybiA8IG5yb3dzOworICAgICAgICAgICB5ICs9IHJv dy0+aGVpZ2h0LCArK3JuKQorICAgICAgICB7CisgICAgICAgICAgcm93ID0gdy0+ZGVzaXJlZF9t YXRyaXgtPnJvd3MgKyBybjsKKyAgICAgICAgICBpZiAoIXJvdy0+ZW5hYmxlZF9wKQorICAgICAg ICAgICAgcm93ID0gdy0+Y3VycmVudF9tYXRyaXgtPnJvd3MgKyBybjsKKyAgICAgICAgICByb3ct PmluZGljYXRlX2JvYl9wID0gcm93LT5pbmRpY2F0ZV90b3BfbGluZV9wID0gMDsKKyAgICAgICAg ICByb3ctPmluZGljYXRlX2VvYl9wID0gcm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wID0gMDsK KyAgICAgICAgICBpZiAoIXJvdy0+bW9kZV9saW5lX3ApCisgICAgICAgICAgICB7CisgICAgICAg ICAgICAgIGlmICh0b3BfaW5kX3JuIDwgMCAmJiByb3ctPnZpc2libGVfaGVpZ2h0ID4gMCkKKyAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBpZiAoTUFUUklYX1JPV19TVEFSVF9D SEFSUE9TIChyb3cpIDw9IEJVRl9CRUdWIChYQlVGRkVSICh3LT5jb250ZW50cykpCisgICAgICAg ICAgICAgICAgICAgICAgJiYgIU1BVFJJWF9ST1dfUEFSVElBTExZX1ZJU0lCTEVfQVRfVE9QX1Ag KHcsIHJvdykpCisgICAgICAgICAgICAgICAgICAgIHJvdy0+aW5kaWNhdGVfYm9iX3AgPSAhTklM UCAoYm91bmRhcnlfdG9wKTsKKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICAgICAgICAgIHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVfcCA9ICFOSUxQIChhcnJvd190b3ApOwor ICAgICAgICAgICAgICAgICAgdG9wX2luZF9ybiA9IHJuOworICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgaWYgKGJvdF9pbmRfcm4gPCAwKQorICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgIGlmIChNQVRSSVhfUk9XX0VORF9DSEFSUE9TIChyb3cpID49IEJVRl9aViAo WEJVRkZFUiAody0+Y29udGVudHMpKQorICAgICAgICAgICAgICAgICAgICAgICYmICFNQVRSSVhf Uk9XX1BBUlRJQUxMWV9WSVNJQkxFX0FUX0JPVFRPTV9QICh3LCByb3cpKQorICAgICAgICAgICAg ICAgICAgICByb3ctPmluZGljYXRlX2VvYl9wID0gIU5JTFAgKGJvdW5kYXJ5X2JvdCksIGJvdF9p bmRfcm4gPSBybjsKKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoeSArIHJv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GJpdG1hcF9jYWNoZVtjYWNoZSo0KzIrcGFydGlhbF9wXSA9CQkJXAorICAg ICAgbWNfZ2V0X2xvZ2ljYWxfZnJpbmdlX2JpdG1hcCAodywgd2hpY2gsIDEsIHBhcnRpYWxfcCkp KQorICAvKiBFeHRlbmQgdG9wLWFsaWduZWQgdG9wIGluZGljYXRvciAob3IgYm90dG9tLWFsaWdu ZWQgYm90dG9tCisgICAgIGluZGljYXRvcikgdG8gYWRqYWNlbnQgcm93cyBpZiBpdCBkb2Vzbid0 IGZpdCBpbiBvbmUgcm93LiAqLworICB0b3BfaW5kX21pbl95ID0gYm90X2luZF9tYXhfeSA9IC0x OworICBpZiAodG9wX2luZF9ybiA+PSAwKQorICAgIHsKKyAgICAgIGludCBibiA9IE1DX05PX0ZS SU5HRV9CSVRNQVA7CisgICAgICByb3cgPSB3LT5kZXNpcmVkX21hdHJpeC0+cm93cyArIHRvcF9p bmRfcm47CisgICAgICBpZiAoIXJvdy0+ZW5hYmxlZF9wKQorICAgICAgICByb3cgPSB3LT5jdXJy ZW50X21hdHJpeC0+cm93cyArIHRvcF9pbmRfcm47CisgICAgICB0b3Bfcm93X2VuZHNfYXRfenZf cCA9IHJvdy0+ZW5kc19hdF96dl9wOworICAgICAgaWYgKHJvdy0+aW5kaWNhdGVfYm9iX3ApCisg ICAgICAgIHsKKyAgICAgICAgICBpZiAoRVEgKGJvdW5kYXJ5X3RvcCwgUWxlZnQpKQorICAgICAg ICAgICAgYm4gPSAoKHJvdy0+aW5kaWNhdGVfZW9iX3AgJiYgRVEgKGJvdW5kYXJ5X2JvdCwgUWxl ZnQpKQorICAgICAgICAgICAgICAgICAgPyBNQ19MRUZUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20s IHJvdy0+ZW5kc19hdF96dl9wKQorICAgICAgICAgICAgICAgICAgOiBNQ19MRUZUX0ZSSU5HRSAo MiwgUXRvcCwgMCkpOworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBibiA9ICgocm93 LT5pbmRpY2F0ZV9lb2JfcCAmJiBFUSAoYm91bmRhcnlfYm90LCBRcmlnaHQpKQorICAgICAgICAg ICAgICAgICAgICA/IE1DX1JJR0hUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20sIHJvdy0+ZW5kc19h dF96dl9wKQorICAgICAgICAgICAgICAgICAgICA6IE1DX1JJR0hUX0ZSSU5HRSAoMiwgUXRvcCwg MCkpOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKHJvdy0+aW5kaWNhdGVfdG9wX2xpbmVf cCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpZiAoRVEgKGFycm93X3RvcCwgUWxlZnQpKQor ICAgICAgICAgICAgICBibiA9IE1DX0xFRlRfRlJJTkdFICg2LCBRdXAsIDApOworICAgICAgICAg ICAgICBlbHNlCisgICAgICAgICAgICAgICAgYm4gPSBNQ19SSUdIVF9GUklOR0UgKDYsIFF1cCwg MCk7CisgICAgICAgICAgfQorICAgICAgaWYgKGJuICE9IE1DX05PX0ZSSU5HRV9CSVRNQVApCisg ICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZnJpbmdlX2JpdG1hcCAqZmIgPSBnZXRfZnJpbmdl X2JpdG1hcF9kYXRhIChibik7CisgICAgICAgICAgaWYgKGZiLT5hbGlnbiA9PSBBTElHTl9CSVRN QVBfVE9QICYmIGZiLT5wZXJpb2QgPT0gMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg c3RydWN0IGdseXBoX3JvdyAqcm93MTsKKyAgICAgICAgICAgICAgaW50IHRvcF9pbmRfbWF4X3k7 CisgICAgICAgICAgICAgIHRvcF9pbmRfbWluX3kgPSBXSU5ET1dfSEVBREVSX0xJTkVfSEVJR0hU ICh3KTsKKyAgICAgICAgICAgICAgdG9wX2luZF9tYXhfeSA9IHRvcF9pbmRfbWluX3kgKyBmYi0+ aGVpZ2h0OworICAgICAgICAgICAgICBpZiAodG9wX2luZF9tYXhfeSA+IHliKQorICAgICAgICAg ICAgICAgIHRvcF9pbmRfbWF4X3kgPSB5YjsKKyAgICAgICAgICAgICAgZm9yICh5ID0gcm93LT55 ICsgcm93LT5oZWlnaHQsIHJuID0gdG9wX2luZF9ybiArIDE7CisgICAgICAgICAgICAgICAgICAg eSA8IHRvcF9pbmRfbWF4X3kgJiYgcm4gPCBucm93czsKKyAgICAgICAgICAgICAgICAgICB5ICs9 IHJvdzEtPmhlaWdodCwgcm4rKykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICBpZiAoYm90X2luZF9ybiA+PSAwICYmIHJuID49IGJvdF9pbmRfcm4pCisgICAgICAgICAgICAg ICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgcm93MSA9IHctPmRlc2lyZWRfbWF0cml4 LT5yb3dzICsgcm47CisgICAgICAgICAgICAgICAgICBpZiAoIXJvdzEtPmVuYWJsZWRfcCkKKyAg ICAgICAgICAgICAgICAgICAgcm93MSA9IHctPmN1cnJlbnRfbWF0cml4LT5yb3dzICsgcm47Cisg ICAgICAgICAgICAgICAgICByb3cxLT5pbmRpY2F0ZV9ib2JfcCA9IHJvdy0+aW5kaWNhdGVfYm9i X3A7CisgICAgICAgICAgICAgICAgICByb3cxLT5pbmRpY2F0ZV90b3BfbGluZV9wID0gcm93LT5p bmRpY2F0ZV90b3BfbGluZV9wOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAg ICAgICAgfQorICAgIH0KKyAgaWYgKGJvdF9pbmRfcm4gPj0gMCkKKyAgICB7CisgICAgICBpbnQg Ym4gPSBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgcm93ID0gdy0+ZGVzaXJlZF9tYXRyaXgt PnJvd3MgKyBib3RfaW5kX3JuOworICAgICAgaWYgKCFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAg cm93ID0gdy0+Y3VycmVudF9tYXRyaXgtPnJvd3MgKyBib3RfaW5kX3JuOworICAgICAgYm90X3Jv d19lbmRzX2F0X3p2X3AgPSByb3ctPmVuZHNfYXRfenZfcDsKKyAgICAgIGlmIChyb3ctPmluZGlj YXRlX2VvYl9wKQorICAgICAgICB7CisgICAgICAgICAgaWYgKEVRIChib3VuZGFyeV9ib3QsIFFs ZWZ0KSkKKyAgICAgICAgICAgIGJuID0gTUNfTEVGVF9GUklOR0UgKDMsIFFib3R0b20sIHJvdy0+ ZW5kc19hdF96dl9wKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgYm4gPSBNQ19S SUdIVF9GUklOR0UgKDMsIFFib3R0b20sIHJvdy0+ZW5kc19hdF96dl9wKTsKKyAgICAgICAgfQor ICAgICAgICBlbHNlIGlmIChyb3ctPmluZGljYXRlX2JvdHRvbV9saW5lX3ApCisgICAgICAgICAg eworICAgICAgICAgICAgaWYgKEVRIChhcnJvd19ib3QsIFFsZWZ0KSkKKyAgICAgICAgICAgICAg Ym4gPSBNQ19MRUZUX0ZSSU5HRSAoNywgUWRvd24sIDApOworICAgICAgICAgICAgICBlbHNlCisg ICAgICAgICAgICAgICAgYm4gPSBNQ19SSUdIVF9GUklOR0UgKDcsIFFkb3duLCAwKTsKKyAgICAg ICAgICB9CisgICAgICBpZiAoYm4gIT0gTUNfTk9fRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgewor ICAgICAgICAgIHN0cnVjdCBmcmluZ2VfYml0bWFwICpmYiA9IGdldF9mcmluZ2VfYml0bWFwX2Rh dGEgKGJuKTsKKyAgICAgICAgICBpZiAoZmItPmFsaWduID09IEFMSUdOX0JJVE1BUF9CT1RUT00g JiYgZmItPnBlcmlvZCA9PSAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzdHJ1Y3Qg Z2x5cGhfcm93ICpyb3cxOworICAgICAgICAgICAgICBpbnQgYm90X2luZF9taW5feTsKKyAgICAg ICAgICAgICAgYm90X2luZF9tYXhfeSA9IHJvdy0+eSArIHJvdy0+dmlzaWJsZV9oZWlnaHQ7Cisg ICAgICAgICAgICAgIGJvdF9pbmRfbWluX3kgPSBib3RfaW5kX21heF95IC0gZmItPmhlaWdodDsK KyAgICAgICAgICAgICAgaWYgKGJvdF9pbmRfbWluX3kgPCBXSU5ET1dfSEVBREVSX0xJTkVfSEVJ R0hUICh3KSkKKyAgICAgICAgICAgICAgICBib3RfaW5kX21pbl95ID0gV0lORE9XX0hFQURFUl9M SU5FX0hFSUdIVCAodyk7CisgICAgICAgICAgICAgIGZvciAoeSA9IHJvdy0+eSwgcm4gPSBib3Rf aW5kX3JuIC0gMTsKKyAgICAgICAgICAgICAgICAgICB5ID49IGJvdF9pbmRfbWluX3kgJiYgcm4g Pj0gMDsKKyAgICAgICAgICAgICAgICAgICB5IC09IHJvdzEtPmhlaWdodCwgcm4tLSkKKyAgICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBpZiAodG9wX2luZF9ybiA+PSAwICYmIHJu IDw9IHRvcF9pbmRfcm4pCisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAg ICAgICAgcm93MSA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgICAg ICAgICBpZiAoIXJvdzEtPmVuYWJsZWRfcCkKKyAgICAgICAgICAgICAgICAgICAgcm93MSA9IHct PmN1cnJlbnRfbWF0cml4LT5yb3dzICsgcm47CisgICAgICAgICAgICAgICAgICByb3cxLT5pbmRp Y2F0ZV9lb2JfcCA9IHJvdy0+aW5kaWNhdGVfZW9iX3A7CisgICAgICAgICAgICAgICAgICByb3cx LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wID0gcm93LT5pbmRpY2F0ZV9ib3R0b21fbGluZV9wOwor ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgYm9v bCBhdXRvX2hzY3JvbGxfbW9kZV9wID0gRVEgKEZidWZmZXJfbG9jYWxfdmFsdWUgKFFhdXRvX2hz Y3JvbGxfbW9kZSwgdy0+Y29udGVudHMpLCBRY3VycmVudF9saW5lKTsKKyAgLyogRVhBTVBMRTog IChzY3JvbGwtbGVmdCA1KSAqLworICBib29sIGhzY2xfYWxsX3RlbXBfcCA9ICh3LT5zdXNwZW5k X2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxf bW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID09IDApOworICAvKiBFWEFN UExFOiAgQy11IEMteCA8IGFuZCBkbyBub3RoaW5nLiAqLworICBib29sIGhzY2xfYWxsX3Blcm1f MF9wID0gKHctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hz Y3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwg PT0gdy0+aHNjcm9sbCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIHNvbWV0aGlu ZyBlbHNlIGJlc2lkZXMgaG9yaXpvbnRhbGx5IHNjcm9sbGluZyB0aGUKKyAgICAgICAgICAgICAg IGN1cnJlbnQgbGluZSBkaWZmZXJlbnRseS4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBp cyBfbm90XyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuICovCisgIGJvb2wgaHNj bF9hbGxfcGVybV8xX3AgPSAoIXctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgYXV0b19oc2Nyb2xsX21vZGVfcAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmIHctPmhzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgdy0+bWluX2hzY3JvbGwgPiAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+ bWluX2hzY3JvbGwgPT0gdy0+aHNjcm9sbCk7CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5k IC4uLgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIGlzIF9ub3RfIGhvcml6b250YWxseSBz Y3JvbGxlZCBkaWZmZXJlbnRseS4gKi8KKyAgYm9vbCBoc2NsX2FsbF9wZXJtXzJfcCA9ICghdy0+ c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRv X2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9s bCA9PSAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPiAw CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgIT0gdy0+aHNj cm9sbCk7CisgIC8qIEVYQU1QTEU6ICAoc2Nyb2xsLWxlZnQgNSk7IGFuZCwgdGhlbiBwcmVzcyB0 aGUgbGVmdCBhcnJvdyBrZXkgb25lIHRpbWUuCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUg X2lzXyBob3Jpem9udGFsbHkgc2Nyb2xsZWQgZGlmZmVyZW50bHkuKi8KKyAgYm9vbCBoc2NsX3Rl bXBfcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAm JiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9s bCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSAwKTsKKyAg LyogRVhBTVBMRTogIEMtdSBDLXggPCBhbmQgZG8gc29tZXRoaW5nIHRoYXQgY2F1c2VzIHRoZSBj dXJyZW50IGxpbmUgdG8gYmUKKyAgICAgICAgICAgICAgIGhvcml6b250YWxseSBzY3JvbGxlZCBk aWZmZXJlbnRseS4KKyAgICAgICAgICAgICAgIEN1cnJlbnQgbGluZSBfaXNfIGhvcml6b250YWxs eSBzY3JvbGxlZCBkaWZmZXJlbnRseS4gKi8KKyAgYm9vbCBoc2NsX3Blcm1fcCA9ICghdy0+c3Vz cGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxf bW9kZV9wCisgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAg ICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAg ICAmJiB3LT5taW5faHNjcm9sbCAhPSB3LT5oc2Nyb2xsKTsKKyAgc3RydWN0IGZyYW1lICpmID0g WEZSQU1FICh3LT5mcmFtZSk7CisgIGZvciAoeSA9IHctPnZzY3JvbGwsIHJuID0gMDsKKyAgICAg ICB5IDwgeWIgJiYgcm4gPCBucm93czsKKyAgICAgICB5ICs9IHJvdy0+aGVpZ2h0LCBybisrKQor ICAgIHsKKyAgaW50IGxlZnQsIHJpZ2h0OworICB1bnNpZ25lZCBsZWZ0X2ZhY2VfaWQsIHJpZ2h0 X2ZhY2VfaWQ7CisgIGludCBsZWZ0X29mZnNldCwgcmlnaHRfb2Zmc2V0OworICBib29sIHBlcmlv ZGljX3A7CisgIHJvdyA9IHctPmRlc2lyZWRfbWF0cml4LT5yb3dzICsgcm47CisgIGN1ciA9IHct PmN1cnJlbnRfbWF0cml4LT5yb3dzICsgcm47CisgIGludCB2bnRoX2RtID0gTUFUUklYX1JPV19W UE9TICh3LT5kZXNpcmVkX21hdHJp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mx1ZX07CisgICAgICAvLyAgc3RydWN0IG1jX1JHQiBsc2xfYmcgPSB7 LnJlZCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhfY21dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0u YmcucmVkLAorICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgIC5ncmVlbiA9IHctPm1j X21hdHJpeC52cG9zW3ZudGhfY21dLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmcuZ3JlZW4sCisg ICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgLmJsdWUgPSB3LT5tY19tYXRyaXgudnBv c1t2bnRoX2NtXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLmJsdWV9OworICAgICAgYm9vbCBh Y3RpdmVfcCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhfY21dLmNhY2hlW2NhY2hlX3R5cGVdW250 aF0uYWN0aXZlX3A7CisgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSB3LT5tY19t YXRyaXgudnBvc1t2bnRoX2NtXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoX2ZsYXZvcjsK KyAgICAgIGJvb2wgZW5hYmxlZF9wID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF9jbV0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXS5lbmFibGVkX3A7CisgICAgICBpZiAoKHZwb3MgPT0gdm50aF9kbSB8 fCB2cG9zID09IHZudGhfY20pCisgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yID09IE1DX09WRVJM QVlfQVJST1dfQklUTUFQCisgICAgICAgICAgJiYgIWhzY2xfYWxsX3RlbXBfcAorICAgICAgICAg ICYmICFoc2NsX3RlbXBfcAorICAgICAgICAgICYmICFoc2NsX3Blcm1fcAorICAgICAgICAgICYm ICFoc2NsX2FsbF9wZXJtXzBfcAorICAgICAgICAgICYmICFoc2NsX2FsbF9wZXJtXzFfcAorICAg ICAgICAgICYmICFoc2NsX2FsbF9wZXJtXzJfcAorICAgICAgICAgICYmIGVuYWJsZWRfcCkKKyAg ICAgICAgeworICAgICAgICAgIGludCBmcmluZ2VfYml0bWFwID0gTUNfTk9fRlJJTkdFX0JJVE1B UDsKKyAgICAgICAgICBlbnVtIGZhY2VfaWQgb3ZlcmxheV9hcnJvd19mYWNlX2lkID0KKyAgICAg ICAgICAgICghYWN0aXZlX3AKKyAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAo dy0+Y29udGVudHMpLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkpCisgICAgICAgICAgICA/IGxvb2t1 cF9kZXJpdmVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1pbmFjdGl2ZS1w cmUtenYtZmFjZSIpLCBGUklOR0VfRkFDRV9JRCwgdHJ1ZSkKKyAgICAgICAgICAgIDogKGFjdGl2 ZV9wKQorICAgICAgICAgICAgICA/IGxvb2t1cF9kZXJpdmVkX2ZhY2UgKHcsIGYsIGludGVybiAo Iistb3ZlcmxheS1hcnJvdy1wcmUtenYtZmFjZSIpLCBGUklOR0VfRkFDRV9JRCwgdHJ1ZSkKKyAg ICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICAgIG1jX2xlZnRfZnJpbmdlX2Zh Y2VfaWQgPSAoY3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBvdmVybGF5X2Fycm93X2ZhY2VfaWQKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAg ICAgIGlmICh3LT5oc2Nyb2xsICE9IDApCisgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNf Z2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistb3ZlcmxheS1hcnJvdyIpLCBmYWxzZSwg dHJ1ZSk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBt Y19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1vdmVybGF5LWFycm93IiksIHRydWUs IHRydWUpOworICAgICAgICAgIG1jX2xlZnRfZnJpbmdlX2JpdG1hcCA9IChjdXJzb3JfdHlwZSA9 PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6 IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoKHZwb3Mg PT0gdm50aF9kbSB8fCB2cG9zID09IHZudGhfY20pCisgICAgICAgICAgICAgICAgICYmIGdseXBo X2ZsYXZvciA9PSBNQ19PVkVSTEFZX0FSUk9XX0JJVE1BUAorICAgICAgICAgICAgICAgICAmJiAo aHNjbF9hbGxfdGVtcF9wCisgICAgICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzBf cAorICAgICAgICAgICAgICAgICAgICAgfHwgaHNjbF9hbGxfcGVybV8xX3AKKyAgICAgICAgICAg ICAgICAgICAgIHx8IGhzY2xfYWxsX3Blcm1fMl9wCisgICAgICAgICAgICAgICAgICAgICB8fCBo c2NsX3RlbXBfcAorICAgICAgICAgICAgICAgICAgICAgfHwgaHNjbF9wZXJtX3ApCisgICAgICAg ICAgICAgICAgICYmIGVuYWJsZWRfcCkKKyAgICAgICAgICB7CisgICAgICAgICAgICBpbnQgZnJp bmdlX2JpdG1hcCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAgICAgICBlbnVtIGZhY2Vf aWQgb3ZlcmxheV9hcnJvd19mYWNlX2lkID0KKyAgICAgICAgICAgICAgKCFhY3RpdmVfcAorICAg ICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaW5h Y3RpdmVfd2luZG93cykpKQorICAgICAgICAgICAgICA/IGxvb2t1cF9kZXJpdmVkX2ZhY2UgKHcs IGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1oc2NsLWluYWN0aXZlLXByZS16di1mYWNlIiks IEZSSU5HRV9GQUNFX0lELCB0cnVlKQorICAgICAgICAgICAgICA6IChhY3RpdmVfcCkKKyAgICAg ICAgICAgICAgICA/IGxvb2t1cF9kZXJpdmVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb3Zlcmxh eS1hcnJvdy1oc2NsLXByZS16di1mYWNlIiksIEZSSU5HRV9GQUNFX0lELCB0cnVlKQorICAgICAg ICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICAgIG1jX2xlZnRfZnJpbmdlX2Zh Y2VfaWQgPSAoY3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IG92ZXJsYXlfYXJyb3dfZmFjZV9pZAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAg ICAgICAgICAgIGlmIChoc2NsX2FsbF9wZXJtXzBfcCkKKyAgICAgICAgICAgICAgZnJpbmdlX2Jp dG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4gKCIrLWhzY2wtcGVybSIpLCBm YWxzZSwgZmFsc2UpOworICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX2FsbF9wZXJtXzFfcCkK KyAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcs IGludGVybiAoIistaHNjbC1wZXJtIiksIHRydWUsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICBl bHNlIGlmIChoc2NsX2FsbF9wZXJtXzJfcCkKKyAgICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRt YXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgZmFs c2UsIHRydWUpOworICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF9wZXJtX3ApCisgICAg ICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywg aW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgdHJ1ZSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAg IGVsc2UgaWYgKGhzY2xfYWxsX3RlbXBfcCkKKyAgICAgICAgICAgICAgICAgICAgICBmcmluZ2Vf Yml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC10ZW1wIiks IGZhbHNlLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoaHNjbF90ZW1w X3ApCisgICAgICAgICAgICAgICAgICAgICAgICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5n ZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC10ZW1wIiksIHRydWUsIGZhbHNlKTsKKyAgICAg ICAgICAgIG1jX2xlZnRfZnJpbmdlX2JpdG1hcCA9IChjdXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZS SU5HRV9CSVRNQVApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBmcmlu Z2VfYml0bWFwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19OT19G UklOR0VfQklUTUFQOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmICgodnBvcyA9PSB2 bnRoX2RtIHx8IHZwb3MgPT0gdm50aF9jbSkKKyAgICAgICAgICAgICAgICAgICAgJiYgKGdseXBo X2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAg ICAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdM RV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09 IE1DX0hPTExPV19SRUNUQU5HTEUKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2Zs YXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAg ICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJS T1cKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNB TF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZF UlNFRF9WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZv ciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIKQorICAgICAgICAgICAgICAgICAgICAmJiBl bmFibGVkX3ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIExpc3BfT2JqZWN0IGJpdG1h cF9mbGF2b3IgPSAoZ2x5cGhfZmxhdm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJS T1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY19ob2xs b3dfcmVjdGFuZ2xlX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdM RV9SSUdIVF9BUlJPVykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBRbWNfcmV2ZXJzZWRfaG9sbG93X3JlY3RhbmdsZV9yaWdodF9hcnJvdworICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX0hP TExPV19SRUNUQU5HTEUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID8gUW1jX2hvbGxvd19yZWN0YW5nbGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfUklHSFRfQVJS T1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3Zl cnRpY2FsX2Jhcl9yaWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdI VF9BUlJPVykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBR bWNfcmV2ZXJzZWRfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFS KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFFtY192ZXJ0 aWNhbF9iYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGds eXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3JldmVyc2VkX3ZlcnRpY2FsX2Jhcgor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9y ID09IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gUW1jX3ZlcnRpY2FsX2Jhcl9iYWNrc2xhc2gKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogUW5pbDsKKyAgICAgICAgICAgICAg bWNfcmlnaHRfZnJpbmdlX2JpdG1hcCA9IChjdXJzb3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0Vf QklUTUFQKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbG9va3Vw X2ZyaW5nZV9iaXRtYXAgKGJpdG1hcF9mbGF2b3IpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgICAgICBtY19y aWdodF9mcmluZ2VfZmFjZV9pZCA9CisgICAgICAgICAgICAgICAgKGN1cnNvcl90eXBlID09IE1D X1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09 IFBSRV9aVgorICAgICAgICAgICAgICAgICAmJiAoZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VE X0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgIHx8IGds eXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAg ICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9C QVIpKQorICAgICAgICAgICAgICAgICAgPyBsb29rdXBfZGVyaXZlZF9mYWNlICh3LCBmLCBpbn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ikpCisgICAgICAgICAgICAgICAgICA/ IGxvb2t1cF9kZXJpdmVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmV2ZXJzZWQtYmFyLXBvc3Qt enYtZmFjZSIpLCBGUklOR0VfRkFDRV9JRCwgdHJ1ZSkKKyAgICAgICAgICAgICAgICA6IChjdXJz b3JfdHlwZSA9PSBNQ19SSUdIVF9GUklOR0VfQklUTUFQCisgICAgICAgICAgICAgICAgICAgJiYg cm93X3Bvc2l0aW9uID09IFBSRV9aVgorICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZv ciAhPSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAg ICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdI VF9BUlJPVworICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNF RF9WRVJUSUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9kZXJpdmVkX2ZhY2Ug KHcsIGYsIGludGVybiAoIistYmFyLXByZS16di1mYWNlIiksIEZSSU5HRV9GQUNFX0lELCB0cnVl KQorICAgICAgICAgICAgICAgIDogKGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRN QVAKKyAgICAgICAgICAgICAgICAgICAmJiByb3dfcG9zaXRpb24gPT0gQVRfWlYKKyAgICAgICAg ICAgICAgICAgICAmJiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdM RV9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19S RVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAmJiBn bHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAgICAg ICAgPyBsb29rdXBfZGVyaXZlZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLWJhci1hdC16di1mYWNl IiksIEZSSU5HRV9GQUNFX0lELCB0cnVlKQorICAgICAgICAgICAgICAgIDogKGN1cnNvcl90eXBl ID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAgICAmJiByb3dfcG9z aXRpb24gPT0gUE9TVF9aVgorICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBN Q19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAg ICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJP VworICAgICAgICAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAhPSBNQ19SRVZFUlNFRF9WRVJU SUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICA/IGxvb2t1cF9kZXJpdmVkX2ZhY2UgKHcsIGYs IGludGVybiAoIistYmFyLXBvc3QtenYtZmFjZSIpLCBGUklOR0VfRkFDRV9JRCwgdHJ1ZSkKKyAg ICAgICAgICAgICAgICA6IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgICAgICAgIH0KKyAgICAgICAg fQorICAgICAgaWYgKCFyb3ctPmVuYWJsZWRfcCkKKyAgICAgICAgcm93ID0gY3VyOworICAgICAg bGVmdF9mYWNlX2lkID0gcmlnaHRfZmFjZV9pZCA9IERFRkFVTFRfRkFDRV9JRDsKKyAgICAgIGxl ZnRfb2Zmc2V0ID0gcmlnaHRfb2Zmc2V0ID0gMDsKKyAgICAgIHBlcmlvZGljX3AgPSAwOworICAg ICAgLyogRGVjaWRlIHdoaWNoIGJpdG1hcCB0byBkcmF3IGluIHRoZSBsZWZ0IGZyaW5nZS4gKi8K KyAgICAgIGlmIChXSU5ET1dfTEVGVF9GUklOR0VfV0lEVEggKHcpID09IDApCisgICAgICAgIGxl ZnQgPSBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgZWxzZSBpZiAocm93LT5sZWZ0X3VzZXJf ZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICB7CisgICAgICAg ICAgbGVmdCA9IHJvdy0+bGVmdF91c2VyX2ZyaW5nZV9iaXRtYXA7CisgICAgICAgICAgbGVmdF9m YWNlX2lkID0gcm93LT5sZWZ0X3VzZXJfZnJpbmdlX2ZhY2VfaWQ7CisgICAgICAgIH0KKyAgICAg IGVsc2UgaWYgKCghcm93LT5yZXZlcnNlZF9wICYmIHJvdy0+dHJ1bmNhdGVkX29uX2xlZnRfcCkK KyAgICAgICAgICAgICAgIHx8IChyb3ctPnJldmVyc2VkX3AgJiYgcm93LT50cnVuY2F0ZWRfb25f cmlnaHRfcCkpCisgICAgICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAoMCwgUXRydW5jYXRpb24s IDApOworICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9ib2JfcCAmJiBFUSAoYm91bmRhcnlf dG9wLCBRbGVmdCkpCisgICAgICAgIHsKKyAgICAgICAgICBsZWZ0ID0gKChyb3ctPmluZGljYXRl X2VvYl9wICYmIEVRIChib3VuZGFyeV9ib3QsIFFsZWZ0KSkKKyAgICAgICAgICAgICAgICAgPyBN Q19MRUZUX0ZSSU5HRSAoMSwgUXRvcF9ib3R0b20sIHRvcF9yb3dfZW5kc19hdF96dl9wKQorICAg ICAgICAgICAgICAgICA6IE1DX0xFRlRfRlJJTkdFICgyLCBRdG9wLCAwKSk7CisgICAgICAgICAg aWYgKHRvcF9pbmRfbWluX3kgPj0gMCkKKyAgICAgICAgICAgIGxlZnRfb2Zmc2V0ID0gdG9wX2lu ZF9taW5feSAtIHJvdy0+eTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0 ZV9lb2JfcCAmJiBFUSAoYm91bmRhcnlfYm90LCBRbGVmdCkpCisgICAgICAgIHsKKyAgICAgICAg ICBsZWZ0ID0gTUNfTEVGVF9GUklOR0UgKDMsIFFib3R0b20sIGJvdF9yb3dfZW5kc19hdF96dl9w KTsKKyAgICAgICAgICBpZiAoYm90X2luZF9tYXhfeSA+PSAwKQorICAgICAgICAgICAgbGVmdF9v ZmZzZXQgPSBib3RfaW5kX21heF95IC0gKHJvdy0+eSArIHJvdy0+dmlzaWJsZV9oZWlnaHQpOwor ICAgICAgICB9CisgICAgICBlbHNlIGlmICgoIXJvdy0+cmV2ZXJzZWRfcCAmJiBNQVRSSVhfUk9X X0NPTlRJTlVBVElPTl9MSU5FX1AgKHJvdykpCisgICAgICAgICAgICAgICB8fCAocm93LT5yZXZl cnNlZF9wICYmIHJvdy0+Y29udGludWVkX3ApKQorICAgICAgICBsZWZ0ID0gTUNfTEVGVF9GUklO R0UgKDQsIFFjb250aW51YXRpb24sIDApOworICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9l bXB0eV9saW5lX3AgJiYgRVEgKGVtcHR5X3BvcywgUWxlZnQpKQorICAgICAgICBsZWZ0ID0gTUNf TEVGVF9GUklOR0UgKDUsIFFlbXB0eV9saW5lLCAwKTsKKyAgICAgIGVsc2UgaWYgKHJvdy0+aW5k aWNhdGVfdG9wX2xpbmVfcCAmJiBFUSAoYXJyb3dfdG9wLCBRbGVmdCkpCisgICAgICAgIHsKKyAg ICAgICAgICBsZWZ0ID0gTUNfTEVGVF9GUklOR0UgKDYsIFF1cCwgMCk7CisgICAgICAgICAgaWYg KHRvcF9pbmRfbWluX3kgPj0gMCkKKyAgICAgICAgICAgIGxlZnRfb2Zmc2V0ID0gdG9wX2luZF9t aW5feSAtIHJvdy0+eTsKKyAgICAgICAgfQorICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9i b3R0b21fbGluZV9wICYmIEVRIChhcnJvd19ib3QsIFFsZWZ0KSkKKyAgICAgICAgeworICAgICAg ICAgIGxlZnQgPSBNQ19MRUZUX0ZSSU5HRSAoNywgUWRvd24sIDApOworICAgICAgICAgIGlmIChi b3RfaW5kX21heF95ID49IDApCisgICAgICAgICAgICBsZWZ0X29mZnNldCA9IGJvdF9pbmRfbWF4 X3kgLSAocm93LT55ICsgcm93LT52aXNpYmxlX2hlaWdodCk7CisgICAgICAgIH0KKyAgICAgIGVs c2UKKyAgICAgICAgbGVmdCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICAvKiBEZWNpZGUg d2hpY2ggYml0bWFwIHRvIGRyYXcgaW4gdGhlIHJpZ2h0IGZyaW5nZS4gKi8KKyAgICAgIGlmIChX SU5ET1dfUklHSFRfRlJJTkdFX1dJRFRIICh3KSA9PSAwKQorICAgICAgICByaWdodCA9IE1DX05P X0ZSSU5HRV9CSVRNQVA7CisgICAgICBlbHNlIGlmIChyb3ctPnJpZ2h0X3VzZXJfZnJpbmdlX2Jp dG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgICAgICB7CisgICAgICAgICAgcmlnaHQg PSByb3ctPnJpZ2h0X3VzZXJfZnJpbmdlX2JpdG1hcDsKKyAgICAgICAgICByaWdodF9mYWNlX2lk ID0gcm93LT5yaWdodF91c2VyX2ZyaW5nZV9mYWNlX2lkOworICAgICAgICB9CisgICAgICBlbHNl IGlmICgoIXJvdy0+cmV2ZXJzZWRfcCAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAg ICAgICAgICAgICAgfHwgKHJvdy0+cmV2ZXJzZWRfcCAmJiByb3ctPnRydW5jYXRlZF9vbl9sZWZ0 X3ApKQorICAgICAgICByaWdodCA9IE1DX1JJR0hUX0ZSSU5HRSAoMCwgUXRydW5jYXRpb24sIDAp OworICAgICAgZWxzZSBpZiAocm93LT5pbmRpY2F0ZV9ib2JfcCAmJiBFUSAoYm91bmRhcnlfdG9w LCBRcmlnaHQpKQorIC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ICE9IGN1ci0+ZW5kc19hdF96dl9wCisgICAgICAgICAgfHwgbGVm dCAhPSBjdXItPmxlZnRfZnJpbmdlX2JpdG1hcAorICAgICAgICAgIHx8IHJpZ2h0ICE9IGN1ci0+ cmlnaHRfZnJpbmdlX2JpdG1hcAorICAgICAgICAgIHx8IGxlZnRfZmFjZV9pZCAhPSBjdXItPmxl ZnRfZnJpbmdlX2ZhY2VfaWQKKyAgICAgICAgICB8fCByaWdodF9mYWNlX2lkICE9IGN1ci0+cmln aHRfZnJpbmdlX2ZhY2VfaWQKKyAgICAgICAgICB8fCBsZWZ0X29mZnNldCAhPSBjdXItPmxlZnRf ZnJpbmdlX29mZnNldAorICAgICAgICAgIHx8IHJpZ2h0X29mZnNldCAhPSBjdXItPnJpZ2h0X2Zy aW5nZV9vZmZzZXQKKyAgICAgICAgICB8fCBwZXJpb2RpY19wICE9IGN1ci0+ZnJpbmdlX2JpdG1h cF9wZXJpb2RpY19wCisgICAgICAgICAgfHwgY3VyLT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcCkK KyAgICAgICAgeworICAgICAgICAgIHJlZHJhd19wID0gMSwgcm93LT5yZWRyYXdfZnJpbmdlX2Jp dG1hcHNfcCA9IDE7CisgICAgICAgICAgaWYgKCFrZWVwX2N1cnJlbnRfcCkKKyAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgY3VyLT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcCA9IDE7CisgICAg ICAgICAgICAgIGlmIChtY19sZWZ0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJVE1B UAorICAgICAgICAgICAgICAgICAgfHwgbWNfcmlnaHRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19G UklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgIGN1ci0+ZnJpbmdlX2JpdG1hcF9wZXJpb2Rp Y19wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgY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0+cmlnaHRfZnJpbmdlX2JpdG1hcCA9IHJp Z2h0OworICAgICAgICAgICAgICBpZiAobWNfcmlnaHRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19G UklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX2ZhY2VfaWQg PSBtY19yaWdodF9mcmluZ2VfZmFjZV9pZDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAg ICAgICAgICAgICBjdXItPnJpZ2h0X2ZyaW5nZV9mYWNlX2lkID0gcmlnaHRfZmFjZV9pZDsKKyAg ICAgICAgICAgICAgaWYgKG1jX3JpZ2h0X2ZyaW5nZV9iaXRtYXAgIT0gTUNfTk9fRlJJTkdFX0JJ VE1BUCkKKyAgICAgICAgICAgICAgICBjdXItPnJpZ2h0X2ZyaW5nZV9vZmZzZXQgPSAwOworICAg ICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIGN1ci0+cmlnaHRfZnJpbmdlX29m ZnNldCA9IHJpZ2h0X29mZnNldDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYg KHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAgPCAwKQorICAgICAgICByb3ctPm92ZXJsYXlfYXJy b3dfYml0bWFwID0gbWNfZ2V0X2xvZ2ljYWxfZnJpbmdlX2JpdG1hcCAodywgUW92ZXJsYXlfYXJy b3csIDAsIDApOworICAgICAgaWYgKHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXAgIT0gY3VyLT5v dmVybGF5X2Fycm93X2JpdG1hcCkKKyAgICAgICAgeworICAgICAgICAgIHJlZHJhd19wID0gMSwg cm93LT5yZWRyYXdfZnJpbmdlX2JpdG1hcHNfcCA9IDE7CisgICAgICAgICAgaWYgKCFrZWVwX2N1 cnJlbnRfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgY3VyLT5yZWRyYXdfZnJpbmdl X2JpdG1hcHNfcCA9IDE7CisgICAgICAgICAgICAgIGN1ci0+b3ZlcmxheV9hcnJvd19iaXRtYXAg PSByb3ctPm92ZXJsYXlfYXJyb3dfYml0bWFwOworICAgICAgICAgICAgfQorICAgICAgICB9Cisg ICAgICBpZiAobWNfbGVmdF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVAKKyAg ICAgICAgICB8fCBtY19yaWdodF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRNQVAp CisgICAgICAgIHJvdy0+ZnJpbmdlX2JpdG1hcF9wZXJpb2RpY19wID0gZmFsc2U7CisgICAgICAg IGVsc2UKKyAgICAgICAgICByb3ctPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcCA9IHBlcmlvZGlj X3A7CisgICAgICBpZiAobWNfbGVmdF9mcmluZ2VfYml0bWFwICE9IE1DX05PX0ZSSU5HRV9CSVRN QVApCisgICAgICAgIHJvdy0+bGVmdF9mcmluZ2VfYml0bWFwID0gbWNfbGVmdF9mcmluZ2VfYml0 bWFwOworICAgICAgICBlbHNlCisgICAgICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9iaXRtYXAgPSBs ZWZ0OworICAgICAgaWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19OT19GUklOR0VfQklU TUFQKQorICAgICAgICByb3ctPmxlZnRfZnJpbmdlX2ZhY2VfaWQgPSBtY19sZWZ0X2ZyaW5nZV9m YWNlX2lkOworICAgICAgICBlbHNlCisgICAgICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9mYWNlX2lk ID0gbGVmdF9mYWNlX2lkOworICAgICAgaWYgKG1jX2xlZnRfZnJpbmdlX2JpdG1hcCAhPSBNQ19O T19GUklOR0VfQklUTUFQKQorICAgICAgICByb3ctPmxlZnRfZnJpbmdlX29mZnNldCA9IDA7Cisg ICAgICAgIGVsc2UKKyAgICAgICAgICByb3ctPmxlZnRfZnJpbmdlX29mZnNldCA9IGxlZnRf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ICAgID8gTEVGVF9NQVJH SU5fQVJFQQorICAgICAgICAgICA6IFRFWFRfQVJFQSkpOworICAgICAgaWYgKHAud2QgPiB3ZCkK KyAgICAgICAgcC53ZCA9IHdkOworICAgICAgcC54ID0geCAtIHAud2QgLSAod2QgLSBwLndkKSAv IDI7CisgICAgICBpZiAocC53ZCA8IHdkIHx8IHAueSA+IHAuYnkgfHwgcC55ICsgcC5oIDwgcC5i eSArIHAubnkpCisgICAgICAgIHsKKyAgICAgICAgICAvKiBJZiBXIGhhcyBhIHZlcnRpY2FsIGJv cmRlciB0byBpdHMgbGVmdCwgZG9uJ3QgZHJhdyBvdmVyIGl0LiAqLworICAgICAgICAgIHdkIC09 ICgoIVdJTkRPV19MRUZUTU9TVF9QICh3KQorICAgICAgICAgICAgLyogVGhpcyBjb3VsZCBiZSB3 cm9uZyB3aGVuIHdlIGFsbG93IHdpbmRvdyBsb2NhbAorICAgICAgICAgICAgICAgcmlnaHQgZGl2 aWRlcnMgLSBidXQgdGhlIHdpbmRvdyBvbiB0aGUgbGVmdCBpcyBoYXJkCisgICAgICAgICAgICAg ICB0byBnZXQuICovCisgICAgICAgICAgICAmJiAhRlJBTUVfUklHSFRfRElWSURFUl9XSURUSCAo ZikKKyAgICAgICAgICAgICYmICFXSU5ET1dfSEFTX1ZFUlRJQ0FMX1NDUk9MTF9CQVIgKHcpCisg ICAgICAgICAgICAvKiBCdXQgZG9uJ3QgcmVkdWNlIHRoZSBmcmluZ2Ugd2lkdGggaWYgdGhlIHdp bmRvdworICAgICAgICAgICAgICAgaGFzIGEgbGVmdCBtYXJnaW4sIGJlY2F1c2UgdGhhdCBtZWFu cyB3ZSBhcmUgbm90CisgICAgICAgICAgICAgICBpbiBkYW5nZXIgb2YgZHJhd2luZyBvdmVyIHRo ZSB2ZXJ0aWNhbCBib3JkZXIsCisgICAgICAgICAgICAgICBhbmQgT1RPSCBsZWF2aW5nIG91dCB0 aGF0IG9uZSBwaXhlbCBsZWF2ZXMgYmVoaW5kCisgICAgICAgICAgICAgICB0cmFjZXMgb2YgdGhl IGN1cnNvciwgaWYgaXQgd2FzIGluIGNvbHVtbiB6ZXJvCisgICAgICAgICAgICAgICBiZWZvcmUg ZHJhd2luZyBub24tZW1wdHkgbWFyZ2luIGFyZWEuICovCisgICAgICAgICAgICAmJiB3LT5sZWZ0 X21hcmdpbl9jb2xzID09IDApCisgICAgICAgICAgID8gMSA6IDApOworICAgICAgICAgIHAuYngg PSB4IC0gd2Q7CisgICAgICAgICAgcC5ueCA9IHdkOworICAgICAgICB9CisgICAgfQorICBlbHNl CisgICAgeworICAgICAgaW50IHggPSB3aW5kb3dfYm94X3JpZ2h0ICh3LAorICAgICAgICAoV0lO RE9XX0hBU19GUklOR0VTX09VVFNJREVfTUFSR0lOUyAodykKKyAgICAgICAgID8gUklHSFRfTUFS R0lOX0FSRUEKKyAgICAgICAgIDogVEVYVF9BUkVBKSk7CisgICAgICBpbnQgd2QgPSBXSU5ET1df UklHSFRfRlJJTkdFX1dJRFRIICh3KTsKKyAgICAgIGlmIChwLndkID4gd2QpCisgICAgICAgIHAu d2QgPSB3ZDsKKyAgICAgIHAueCA9IHggKyAod2QgLSBwLndkKSAvIDI7CisgICAgICAvKiBDbGVh ciByaWdodCBmcmluZ2UgaWYgbm8gYml0bWFwIHRvIGRyYXcgb2YgaWYgYml0bWFwIGRvZXNuJ3Qg ZmlsbAorICAgdGhlIGZyaW5nZS4gKi8KKyAgICAgIGlmIChwLndkIDwgd2QgfHwgcC55ID4gcC5i eSB8fCBwLnkgKyBwLmggPCBwLmJ5ICsgcC5ueSkKKyAgICAgICAgeworICAgICAgICAgIHAuYngg PSB4OworICAgICAgICAgIHAubnggPSB3ZDsKKyAgICAgICAgfQorICAgIH0KKyAgaWYgKHAueCA+ PSBXSU5ET1dfQk9YX0xFRlRfRURHRV9YICh3KQorICAgICAgJiYgKHAueCArIHAud2QpIDw9IFdJ TkRPV19CT1hfTEVGVF9FREdFX1ggKHcpICsgV0lORE9XX1BJWEVMX1dJRFRIICh3KSkKKyAgICBG UkFNRV9SSUYgKGYpLT5kcmF3X2ZyaW5nZV9iaXRtYXAgKHcsIHJvdywgJnApOworfQorCit2b2lk CittY19kcmF3X2ZyaW5nZV9iaXRtYXAgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9y b3cgKnJvdywgaW50IGxlZnRfcCwgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSkKK3sK KyAgaW50IG92ZXJsYXkgPSAwOworICBpZiAobGVmdF9wID09IHJvdy0+cmV2ZXJzZWRfcCAmJiBy b3ctPmN1cnNvcl9pbl9mcmluZ2VfcCkKKyAgICB7CisgICAgICBMaXNwX09iamVjdCBjdXJzb3Ig PSBRbmlsOworICAgICAgc3dpdGNoIChjdXJzb3JfdHlwZSkKKyAgICAgICAgeworICAgICAgICBj YXNlIE1DX0ZSQU1FRF9CT1g6CisgICAgICAgICAgaWYgKHJvdy0+dmlzaWJsZV9oZWlnaHQgPj0g U1RBTkRBUkRfQklUTUFQX0hFSUdIVCAoaG9sbG93X3JlY3RhbmdsZV9iaXRzKSkKKyAgICAgICAg ICAgIGN1cnNvciA9IFFob2xsb3c7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgY3Vyc29y ID0gUWhvbGxvd19zbWFsbDsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNQ19IT0xM T1dfQk9YOgorICAgICAgICAgIGlmIChyb3ctPnZpc2libGVfaGVpZ2h0ID49IFNUQU5EQVJEX0JJ VE1BUF9IRUlHSFQgKGhvbGxvd19yZWN0YW5nbGVfYml0cykpCisgICAgICAgICAgICBjdXJzb3Ig PSBRaG9sbG93OworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGN1cnNvciA9IFFob2xsb3df c21hbGw7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTUNfRklMTEVEX0JPWDoKKyAg ICAgICAgICBjdXJzb3IgPSBRYm94OworICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1D X0JBUjoKKyAgICAgICAgICBjdXJzb3IgPSBRYmFyOworICAgICAgICAgIGJyZWFrOworICAgICAg ICBjYXNlIE1DX0hCQVI6CisgICAgICAgICAgY3Vyc29yID0gUWhiYXI7CisgICAgICAgICAgYnJl YWs7CisgICAgICAgIGNhc2UgTUNfTk9fRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgY2FzZSBNQ19O T19DVVJTT1I6CisgICAgICAgIGNhc2UgTUNfUklHSFRfRlJJTkdFX0JJVE1BUDoKKyAgICAgICAg Y2FzZSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVA6CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAg dy0+cGh5c19jdXJzb3Jfb25fcCA9IDA7CisgICAgICAgICAgcm93LT5jdXJzb3JfaW5fZnJpbmdl X3AgPSAwOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICBpZiAoIU5JTFAgKGN1 cnNvcikpCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgYm0gPSBtY19nZXRfbG9naWNhbF9jdXJz b3JfYml0bWFwICh3LCBjdXJzb3IpOworICAgICAgICAgIGlmIChibSAhPSBNQ19OT19GUklOR0Vf QklUTUFQKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBtY19kcmF3X2ZyaW5nZV9iaXRt YXBfMSAodywgcm93LCBsZWZ0X3AsIDIsIGJtKTsKKyAgICAgICAgICAgICAgb3ZlcmxheSA9IEVR IChjdXJzb3IsIFFib3gpID8gMyA6IDE7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9 CisgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcF8xICh3LCByb3csIGxlZnRfcCwgb3ZlcmxheSwgTUNf Tk9fRlJJTkdFX0JJVE1BUCk7CisgIGlmIChsZWZ0X3AgJiYgcm93LT5vdmVybGF5X2Fycm93X2Jp dG1hcCAhPSBNQ19OT19GUklOR0VfQklUTUFQKQorICAgIG1jX2RyYXdfZnJpbmdlX2JpdG1hcF8x ICh3LCByb3csIDEsIDEsIHJvdy0+b3ZlcmxheV9hcnJvd19iaXRtYXApOworfQorCisvKiBlbmQg TVVMVElQTEUtQ1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogI2RlZmlu ZSBOT19GUklOR0VfQklUTUFQIDAKICNkZWZpbmUgVU5ERUZfRlJJTkdFX0JJVE1BUCAxCiAjZGVm aW5lIE1BWF9TVEFOREFSRF9GUklOR0VfQklUTUFQUyBBUlJBWUVMVFMgKHN0YW5kYXJkX2JpdG1h cHMpCkBAIC0xNjk5LDYgKzMyMTcsMTY4IEBAIFJldHVybiBuaWwgaWYgUE9TIGlzIG5vdCB2aXNp YmxlIGluIFdJTkRPVy4gICovKQogdm9pZAogc3ltc19vZl9mcmluZ2UgKHZvaWQpCiB7CisKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisK KyAgLyogKGdldCAnZW1wdHktbGluZSAnZnJpbmdlKSA9PiAyMyA9PiB0aGUgbGFzdCBzdGFuZGFy ZC1iaXRtYXAgYmVmb3JlIHRoaXMgb25lLgorICBTZWUgYGZyaW5nZS5lbGAuICovCisKKyAgLyog MjQgKi8KKyAgREVGU1lNIChRbWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93LCAiKy12ZXJ0aWNh bC1iYXItcmlnaHQtYXJyb3ciKTsKKyAgVmZyaW5nZV9iaXRtYXBzID0gRmNvbnMgKFFtY192ZXJ0 aWNhbF9iYXJfcmlnaHRfYXJyb3csIFZmcmluZ2VfYml0bWFwcyk7CisgIEZwdXQgKFFtY192ZXJ0 aWNhbF9iYXJfcmlnaHRfYXJyb3csIFFm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92ZXJs YXktYXJyb3ciKTsKZGlmZiAtLWdpdCBhL3NyYy9uc3Rlcm0uaCBiL3NyYy9uc3Rlcm0uaAppbmRl eCA5NzczZWIzLi5lMzRhMTE2IDEwMDY0NAotLS0gYS9zcmMvbnN0ZXJtLmgKKysrIGIvc3JjL25z dGVybS5oCkBAIC02NjMsNiArNjYzLDE2IEBAIHR5cGVkZWYgaWQgaW5zdGFuY2V0eXBlOwogCiBA aW50ZXJmYWNlIEVtYWNzU2Nyb2xsZXIgOiBOU1Njcm9sbGVyCiAgIHsKKworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIE5TUmVjdCBtY19y ZWN0YW5nbGU7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgIHN0cnVjdCB3aW5k b3cgKndpbmRvdzsKICAgIHN0cnVjdCBmcmFtZSAqZnJhbWU7CiAgICBOU1Jlc3BvbmRlciAqcHJl dlJlc3BvbmRlcjsKQEAgLTY4Myw2ICs2OTMsMTggQEAgdHlwZWRlZiBpZCBpbnN0YW5jZXR5cGU7 CiAgICBpbnQgZW1fd2hvbGU7CiAgICB9CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisv KiBNVUxUSVBMRS1DVVJTT1JTICovCisKKy0gKHZvaWQpbWNfc2V0X3JlY3RhbmdsZTogKE5TUmVj dClyZWN0OworLSAoTlNSZWN0KW1jX2dldF9yZWN0YW5nbGU7CistIChzdHJ1Y3Qgd2luZG93ICop bWNfZ2V0X3dpbmRvdzsKKy0gKGJvb2wpbWNfanVkZ2U7CisKKy8qICoqKioqKioqKioqKioqKio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c3RydWN0IGZhY2UgKmZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIERFRkFVTFRf RkFDRV9JRCk7CisgIGludCB2bnRoID0gTUFUUklYX1JPV19WUE9TIChyb3csIG1hdHJpeCk7Cisg IC8qIFNUUkVUQ0hfR0xZUEggbWF5IGNvbnRhaW4gbW9yZSB0aGFuIG9uZSBmYWtlIGN1cnNvciBh dCB0aGUgc2FtZSBIUE9TLgorICBOT1RFOiAgQSBmYWtlIGN1cnNvciBmcm9tIG9uZSBjYWNoZSBt YXkgb3ZlcndyaXRlIGEgZmFrZSBjdXJzb3IgZnJvbSBhbm90aGVyCisgIGNhY2hlIC0tIHRodXMs IHdlIG11c3QgY2hlY2sgdGhlbSBhbGwgZm9yIG92ZXJ3cml0dGVuIGZha2UgY3Vyc29ycy4gKi8K KyAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1DX0NBQ0hFOworICAgICAg IGNhY2hlX3R5cGUgPCBOT19DQUNIRTsKKyAgICAgICArK2NhY2hlX3R5cGUpCisgICAgeworICAg ICAgZm9yIChpbnQgbnRoID0gMDsKKyAgICAgICAgICAgcworICAgICAgICAgICAmJiBtY190cmF2 ZXJzZV9jYWNoZV9wIChtY19tYXRyaXgsIGNhY2hlX3R5cGUsIHZudGgsIG50aCk7CisgICAgICAg ICAgICsrbnRoKQorICAgICAgICB7CisgICAgICAgICAgLy8gIGludCB4ID0gbWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS54OworICAgICAgICAgIGludCBmeCA9IG1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZng7CisgICAgICAgICAg Ly8gIGludCB5ID0gbWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS55 OworICAgICAgICAgIGludCBmeSA9IG1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2h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1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5 cGVdW250aF0uYmcucmVkLAorICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAu Z3JlZW4gPSBtY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLmdy ZWVuLAorICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICAuYmx1ZSA9IG1jX21h dHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYmcuYmx1ZX07CisgICAgICAg ICAgYm9vbCBhY3RpdmVfcCA9IG1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF0uYWN0aXZlX3A7CisgICAgICAgICAgLy8gIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZv ciA9IG1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZ2x5cGhfZmxh dm9yOworICAgICAgICAgIGJvb2wgZW5hYmxlZF9wID0gbWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFibGVkX3A7CisgICAgICAgICAgYm9vbCBnb19wID0gKHZw b3MgPT0gdm50aAorICAgICAgICAgICAgICAgICAgICAgICAmJiBocG9zID09IGN1cnNvcl9nbHlw aC0+aHBvcworICAgICAgICAgICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApOworICAgICAgICAg IGlmICghZ29fcCkKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgIE5TUmVjdCByOwor ICAgICAgICAgIHIub3JpZ2luLnggPSBmeDsKKyAgICAgICAgICByLm9yaWdpbi55ID0gZnk7Cisg ICAgICAgICAgci5zaXplLmhlaWdodCA9IGg7CisgICAgICAgICAgci5zaXplLndpZHRoID0gd2Q7 CisgICAgICAgICAgW1tOU0NvbG9yIGNvbG9yV2l0aENhbGlicmF0ZWRSZWQ6IGxzbF9mZy5yZWQK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBncmVlbjogbHNsX2ZnLmdyZWVu CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJsdWU6IGxzbF9mZy5ibHVl CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwaGE6IDEuMF0gc2V0XTsK KyAgICAgIGlmIChjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YKQorICAgICAgICB7CisgICAg ICAgICAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKHMtPnctPmNvbnRlbnRzKTsKKyAgICAg ICAgICBib29sIHJlZ2lvbl9hY3RpdmVfcCA9ICghTklMUCAoVnRyYW5zaWVudF9tYXJrX21vZGUp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIG1h cmtfYWN0aXZlKSkpOworICAgICAgICAgIHB0cmRpZmZfdCByZWdpb25fYmVnID0gKHJlZ2lvbl9h Y3RpdmVfcCkgPyBtY19yZWdpb25fbGltaXQgKDEpIDogLTE7CisgICAgICAgICAgcHRyZGlmZl90 IHJlZ2lvbl9lbmQgPSAocmVnaW9uX2FjdGl2ZV9wKSA/IG1jX3JlZ2lvbl9saW1pdCAoMCkgOiAt MTsKKyAgICAgICAgICBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAgICAgICAgICAgICYmIGFjdGl2 ZV9wCisgICAgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaC0+Y2hhcnBvcyA9PSByZWdpb25fYmVn KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2 ZV9yZWdpb25fYmVnX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ZiwgaW50 ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWF0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9uX2JldHdlZW5fZmFjZSksIHMtPmYpOworICAgICAgICAg ICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2FjdGl2ZV9yZWdpb25fYmV0d2Vlbl9jb2xv cjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoYWN0aXZlX3Ap CisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBo b2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ZiwgaW50 ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAg ICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lE IChzLT5mLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICBOU0Nv bG9yICpob2xsb3dfYWN0aXZlX2NvbG9yID0gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZB Q0VfQkFDS0dST1VORCAoaG9sbG93X2FjdGl2ZV9mYWNlKSwgcy0+Zik7CisgICAgICAgICAgICAg ICAgICAgIGhvbGxvd19jb2xvciA9IGhvbGxvd19hY3RpdmVfY29sb3I7CisgICAgICAgICAgICAg ICAgICB9CisgICAgICAgICAgICAgICAgICBlbHNlIGlmICghYWN0aXZlX3ApCisgICAgICAgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2lu YWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ZiwgaW50ZXJuICgi Ky1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAg ICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfaW5hY3RpdmVfZmFjZSA9IEZBQ0Vf RlJPTV9JRCAocy0+ZiwgaG9sbG93X2luYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAg ICAgICAgIE5TQ29sb3IgKmhvbGxvd19pbmFjdGl2ZV9jb2xvciA9IG5zX2xvb2t1cF9pbmRleGVk X2NvbG9yIChOU19GQUNFX0JBQ0tHUk9VTkQgKGhvbGxvd19pbmFjdGl2ZV9mYWNlKSwgcy0+Zik7 CisgICAgICAgICAgICAgICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2luYWN0aXZlX2Nv bG9yOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAo ZmFjZSAmJiBOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpID09IG5zX2luZGV4X2NvbG9yIChGUkFN RV9DVVJTT1JfQ09MT1IgKHMtPmYpLCBzLT5mKSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBb bnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoZmFjZSksIHMtPmYp IHNldF07CisgICAgICAgICAgICBob2xsb3dfY29sb3IgPSBGUkFNRV9DVVJTT1JfQ09MT1IgKHMt PmYpOworICAgICAgICAgIH0KKyAgICAgICAgICBzd2l0Y2ggKGN1cnNvcl90eXBlKQorICAgICAg ICAgICAgeworICAgICAgICAgICAgICBjYXNlIE1DX05PX0ZSSU5HRV9CSVRNQVA6CisgICAgICAg ICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgTUNfTk9fQ1VSU09SOgorICAgICAg ICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX1JJR0hUX0ZSSU5HRV9CSVRN QVA6CisgICAgICAgICAgICAgIGNhc2UgTUNfTEVGVF9GUklOR0VfQklUTUFQOgorICAgICAgICAg ICAgICBjYXNlIE1DX0ZJTExFRF9CT1g6CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7 CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgTUNfRlJBTUVEX0JP WDoKKyAgICAgICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgICAgICAgICBbaG9s bG93X2NvbG9yIHNldF07CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAoTlNJbnNldFJlY3Qg KHIsIDEsIDEpKTsKKyAgICAgICAgICAgICAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChzLT5mKSBz ZXRdOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX0hPTExP V19CT1g6CisgICAgICAgICAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgICAgICAgICAg W2hvbGxvd19jb2xvciBzZXRdOworICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKE5TSW5zZXRS ZWN0IChyLCAxLCAxKSk7CisgICAgICAgICAgICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAocy0+ Zikgc2V0XTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSBNQ19I QkFSOgorICAgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICAgICAgICAgIGJy ZWFrOworICAgICAgICAgICAgICBjYXNlIE1DX0JBUjoKKyAgICAgICAgICAgICAgICBOU1JlY3RG aWxsIChyKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAg ICAvKiBJZiBhIGdseXBoIGV4aXN0cyAocy0+Y2hhcjJiICE9IE5VTEwpLCB0aGVuIGRyYXcgdGhl IGdseXBoIG9uIHRvcCBvZiB0aGUKKyAgICAgICAgICBuZXdseSBkcmF3biByZWN0YW5nbGUgdGhh dCB3YXMgY3JlYXRlZCBoZXJlaW5hYm92ZS4gIFRvIHRoZSBleHRlbnQgdGhhdCB3ZQorICAgICAg ICAgIHdhbnQgdG8gZG91YmxlLWltcHJpbnQgZ2x5cGhzIHRvIG1ha2UgdGhlbSBhcHBlYXIgdG8g YmUgc2VtaS1ib2xkLCBpdCBjYW4KKyAgICAgICAgICBiZSBkb25lIGhlcmUgZm9yIGFsbCBjdXJz b3IgdHlwZXMuICBUaGUgYm94LXN0eWxlIGN1cnNvcnMgYXJlIGltcHJpbnRlZAorICAgICAgICAg IHdpdGggZ2x5cGhzIG9ubHkgb25lICgxKSB0aW1lLiAgVGhlIHNlbWktYm9sZCBhcHBlYXJhbmNl IGlzIGhlbHBmdWwgd2hlbgorICAgICAgICAgIGRlYnVnZ2luZyB0byBzZWUgdGhhdCB0aGUgY29v cmRpbmF0ZXMgYXJlIGNvcnJlY3QuICovCisgICAgICAgICAgaWYgKHMtPmNoYXIyYiAhPSBOVUxM CisgICAgICAgICAgICAgICYmIChjdXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9YCisgICAgICAg ICAgICAgICAgICB8fCBjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YCisgICAgICAgICAgICAg ICAgICB8fCBjdXJzb3JfdHlwZSA9PSBNQ19IT0xMT1dfQk9YKSkKKyAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgQk9PTCBpc0NvbXBvc2l0ZSA9IHMtPmZpcnN0X2dseXBoLT50eXBlID09IENP TVBPU0lURV9HTFlQSDsKKyAgICAgICAgICAgICAgaWYgKGlzQ29tcG9zaXRlKQorICAgICAgICAg ICAgICAgIG5zX2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAg ICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAg ICAgIHN0cnVjdCBmb250ICpmb250ID0gcy0+ZmFjZS0+Zm9udDsKKyAgICAgICAgICAgICAgICAg ICAgaWYgKCFmb250KQorICAgICAgICAgICAgICAgICAgICAgIGZvbnQgPSBGUkFNRV9GT05UIChz LT5mKTsKKyAgICAgICAgICAgICAgICAgICAgYm9vbCB3aXRoX2JnX3AgPSBmYWxzZTsKKyAgICAg ICAgICAgICAgICAgICAgZm9udC0+ZHJpdmVyLT5kcmF3IChzLCBzLT5jbXBfZnJvbSwgcy0+bmNo YXJzLCBzLT54LCBzLT55YmFzZSwgd2l0aF9iZ19wKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgLy8gIGNsb2NrX3QgY2xvY2tfZW5kID0g Y2xvY2soKTsKKyAgLy8gIGRvdWJsZSBjcHVfdGltZV91c2VkID0gKChkb3VibGUpIChjbG9ja19l bmQgLSBjbG9ja19zdGFydCkpIC8gQ0xPQ0tTX1BFUl9TRUM7CisgIC8vICBmcHJpbnRmIChzdGRl cnIsICJuc19kcmF3X292ZXJ3cml0dGVuICglZCk6ICBUSU1FICglZilcbiIsIHZwb3MsIGNwdV90 aW1lX3VzZWQpOworfQorCitzdGF0aWMgdm9pZAorbWNfbnNfZHJhd193aW5kb3dfY3Vyc29yIChz dHJ1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsIHN0cnVjdCBnbHlw aF9yb3cgKnJvdywKKyAgICAgICAgICAgICAgICAgIGludCB4LCBpbnQgZngsIGludCB5LCBpbnQg ZnksIGludCBocG9zLCBpbnQgdnBvcywgaW50IHdkLCBpbnQgaCwKKyAgICAgICAgICAgICAgICAg IHN0cnVjdCBtY19SR0IgbHNsLCBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlLAorICAg ICAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aCwgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxh dm9yLCBib29sIG9uX3AsIGJvb2wgYWN0aXZlX3ApCit7CisgIC8qIFRoZSBwcmlvciBidWcgb2Yg YSBkb3VibGUgaW1wcmludCBvb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E8gU1RERVJSOgorICAgICBMaXNwX09iamVjdCBmb3JlZ3JvdW5kID0gZmFjZS0+bGZhY2VbTEZB Q0VfRk9SRUdST1VORF9JTkRFWF07CisgICAgIExpc3BfT2JqZWN0IGJhY2tncm91bmQgPSBmYWNl LT5sZmFjZVtMRkFDRV9CQUNLR1JPVU5EX0lOREVYXTsKKyAgICAgZnByaW50ZiAoc3RkZXJyLCAi XG5mb3JlZ3JvdW5kICglcykgfCBiYWNrZ3JvdW5kICglcylcbiIsCisgICAgICAgICAgICAgICAg ICAgICAgKCFOSUxQIChmb3JlZ3JvdW5kKSA/IFNTREFUQSAoZm9yZWdyb3VuZCkgOiAiTklMUCIp LAorICAgICAgICAgICAgICAgICAgICAgICghTklMUCAoYmFja2dyb3VuZCkgPyBTU0RBVEEgKGJh Y2tncm91bmQpIDogIk5JTFAiKSk7CisgIC0gIEVYQU1QTEUgT0YgSE9XIFRPIENSRUFURSBBIENP TE9SIFdJVEggUkdCL0xTTCBmbG9hdCB2YWx1ZXM6CisgICAgIE5TQ29sb3IgKm15X2NvbG9yID0g W05TQ29sb3IgY29sb3JXaXRoQ2FsaWJyYXRlZFJlZDogMS4wCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBncmVlbjogMS4wCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmx1ZTogMS4wCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHBoYTogMS4wXTsK KyAgLSAgQUxURVJOQVRJVkUgRVhBTVBMRToKKyAgICAgZW51bSBmYWNlX2lkIGRlYnVnZ2luZ19m YWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAoIistZGVidWdn aW5nLWZhY2UiKSwgdHJ1ZSk7CisgICAgIHN0cnVjdCBmYWNlICpkZWJ1Z2dpbmdfZmFjZSA9IEZB Q0VfRlJPTV9JRCAocy0+ZiwgZGVidWdnaW5nX2ZhY2VfaWQpOworICAgICBOU0NvbG9yICpjb2xv ciA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQgKGRlYnVnZ2lu Z19mYWNlKSwgcy0+Zik7CisgICAgIFtjb2xvciBzZXRdOyAqLworICBpZiAoZ2x5cGhfZmxhdm9y ID09IE1DX0dMWVBICisgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEhMRVNTKQorICAg IFtbTlNDb2xvciBjb2xvcldpdGhDYWxpYnJhdGVkUmVkOiBsc2wucmVkCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgZ3JlZW46IGxzbC5ncmVlbgorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBibHVlOiBsc2wuYmx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGFscGhhOiAxLjBdIHNldF07CisgICAgZWxzZQorICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAo Zikgc2V0XTsKKyAgaWYgKGN1cnNvcl90eXBlID09IE1DX0ZSQU1FRF9CT1gpCisgICAgeworICAg ICAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKHctPmNvbnRlbnRzKTsKKyAgICAgIGJvb2wg cmVnaW9uX2FjdGl2ZV9wID0gKCFOSUxQIChWdHJhbnNpZW50X21hcmtfbW9kZSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBtYXJrX2FjdGl2ZSkpKTsK KyAgICAgIHB0cmRpZmZfdCByZWdpb25fYmVnID0gKHJlZ2lvbl9hY3RpdmVfcCkgPyBtY19yZWdp b25fbGltaXQgKDEpIDogLTE7CisgICAgICBwdHJkaWZmX3QgcmVnaW9uX2VuZCA9IChyZWdpb25f YWN0aXZlX3ApID8gbWNfcmVnaW9uX2xpbWl0ICgwKSA6IC0xOworICAgICAgaWY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AgTlNDb2xvciAqaG9sbG93X2Fj dGl2ZV9yZWdpb25fYmV0d2Vlbl9jb2xvciA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19G QUNFX0ZPUkVHUk9VTkQgKGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFjZSksIGYpOwor ICAgICAgICAgICAgICBob2xsb3dfY29sb3IgPSBob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZXR3ZWVu X2NvbG9yOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAoYWN0aXZlX3ApCisg ICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2 ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtl LWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFj ZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2Zh Y2VfaWQpOworICAgICAgICAgICAgICAgIE5TQ29sb3IgKmhvbGxvd19hY3RpdmVfY29sb3IgPSBu c19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5EIChob2xsb3dfYWN0aXZl X2ZhY2UpLCBmKTsKKyAgICAgICAgICAgICAgICBob2xsb3dfY29sb3IgPSBob2xsb3dfYWN0aXZl X2NvbG9yOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIC8qIFRoZSByZWdpb24gaXMg X25vdF8gdmlzaWJsZSBpbiB0aGUgaW5hY3RpdmUgd2luZG93IGJlY2F1c2UgdGhlIG92ZXJsYXkg d2luZG93IHByb3BlcnR5IGlzIHVzZWQuICovCisgICAgICAgICAgICAgIGVsc2UgaWYgKCFhY3Rp dmVfcCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQg aG9sbG93X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJu ICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpOworICAg ICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19pbmFjdGl2ZV9mYWNlID0gRkFDRV9G Uk9NX0lEIChmLCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICBO U0NvbG9yICpob2xsb3dfaW5hY3RpdmVfY29sb3IgPSBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAo TlNfRkFDRV9CQUNLR1JPVU5EIChob2xsb3dfaW5hY3RpdmVfZmFjZSksIGYpOworICAgICAgICAg ICAgICAgICAgaG9sbG93X2NvbG9yID0gaG9sbG93X2luYWN0aXZlX2NvbG9yOworICAgICAgICAg ICAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZiAoZmFjZSAmJiBOU19GQUNFX0JBQ0tHUk9VTkQg KGZhY2UpID09IG5zX2luZGV4X2NvbG9yIChGUkFNRV9DVVJTT1JfQ09MT1IgKGYpLCBmKSkKKyAg ICAgIHsKKyAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVHUk9V TkQgKGZhY2UpLCBmKSBzZXRdOworICAgICAgICBob2xsb3dfY29sb3IgPSBGUkFNRV9DVVJTT1Jf Q09MT1IgKGYpOworICAgICAgfQorI2lmZGVmIE5TX0lNUExfQ09DT0EKKyAgTlNEaXNhYmxlU2Ny ZWVuVXBkYXRlcyAoKTsKKyNlbmRpZgorICBzd2l0Y2ggKGN1cnNvcl90eXBlKQorICAgIHsKKyAg ICAgIGNhc2UgTUNfTk9fRlJJTkdFX0JJVE1BUDoKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNl IE1DX05PX0NVUlNPUjoKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1DX1JJR0hUX0ZSSU5H RV9CSVRNQVA6CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19MRUZUX0ZSSU5HRV9CSVRN QVA6CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19GSUxMRURfQk9YOgorICAgICAgICBO U1JlY3RGaWxsIChyKTsKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIE1DX0ZSQU1FRF9CT1g6 CisgICAgICAgIE5TUmVjdEZpbGwgKHIpOworICAgICAgICBbaG9sbG93X2NvbG9yIHNldF07Cisg ICAgICAgIE5TUmVjdEZpbGwgKE5TSW5zZXRSZWN0IChyLCAxLCAxKSk7CisgICAgICAgIFtGUkFN RV9DVVJTT1JfQ09MT1IgKGYpIHNldF07CisgICAgICAgIGJyZWFrOworICAgICAgY2FzZSBNQ19I T0xMT1dfQk9YOgorICAgICAgICBOU1JlY3RGaWxsIChyKTsKKyAgICAgICAgW2hvbGxvd19jb2xv ciBzZXRdOworICAgICAgICBOU1JlY3RGaWxsIChOU0luc2V0UmVjdCAociwgMSwgMSkpOworICAg ICAgICBbRlJBTUVfQ1VSU09SX0NPTE9SIChmKSBzZXRdOworICAgICAgICBicmVhazsKKyAgICAg IGNhc2UgTUNfSEJBUjoKKyAgICAgICAgTlNSZWN0RmlsbCAocik7CisgICAgICAgIGJyZWFrOwor ICAgICAgY2FzZSBNQ19CQVI6CisgICAgICAgIHMgPSByOworICAgICAgICAvKiBAbGF3bGlzdCBp cyBmb2N1c2luZyB0aGUgaW5pdGlhbCBkZXZlbG9wbWVudCBvZiBmZWF0dXJlIHJlcXVlc3RzCisg ICAgICAgICMxNzY4NCBhbmQgIzIyODczIG9uIEwyUiBsYW5ndWFnZXMuICovCisgICAgICAgIGlm IChnbHlwaF9mbGF2b3IgIT0gTUNfR0xZUEgKKyAgICAgICAgICAgICYmIGdseXBoX2ZsYXZvciAh PSBNQ19HTFlQSExFU1MpCisgICAgICAgICAgeworICAgICAgICAgICAgLyogSWYgdGhlIGNoYXJh Y3RlciB1bmRlciBjdXJzb3IgaXMgUjJMLCBkcmF3IHRoZSBiYXIgY3Vyc29yCisgICAgICAgICAg ICAgICBvbiB0aGUgcmlnaHQgb2YgaXRzIGdseXBoLCByYXRoZXIgdGhhbiBvbiB0aGUgbGVmdC4g Ki8KKyAgICAgICAgICAgIGlmICgoY3Vyc29yX2dseXBoLT5yZXNvbHZlZF9sZXZlbCAmIDEpICE9 IDApCisgICAgICAgICAgICAgIHMub3JpZ2luLnggKz0gY3Vyc29yX2dseXBoLT5waXhlbF93aWR0 aCAtIHMuc2l6ZS53aWR0aDsKKyAgICAgICAgICB9CisgICAgICAgIE5TUmVjdEZpbGwgKHMpOwor ICAgICAgICBicmVhazsKKyAgICB9CisgIG5zX3Jlc2V0X2NsaXBwaW5nIChmKTsKKyAgLyogZHJh dyB0aGUgY2hhcmFjdGVyIHVuZGVyIHRoZSBjdXJzb3IgKi8KKyAgaWYgKGdseXBoX2ZsYXZvciAh PSBNQ19HTFlQSExFU1MKKyAgICAgICYmIChjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURfQk9YCisg ICAgICAgICAgfHwgY3Vyc29yX3R5cGUgPT0gTUNfRklMTEVEX0JPWAorICAgICAgICAgIHx8IGN1 cnNvcl90eXBlID09IE1DX0hPTExPV19CT1gKKyAgICAgICAgICB8fCAoZGVidWdfcAorICAgICAg ICAgICAgICAmJiBjdXJzb3JfdHlwZSA9PSBNQ19IQkFSKQorICAgICAgICAgIHx8IChkZWJ1Z19w CisgICAgICAgICAgICAgICYmIGN1cnNvcl90eXBlID09IE1DX0JBUikpKQorICAgIHsKKyAgICAg IC8qIGBjdXJzb3JfZ2NfcGAgaXMgdXNlZCBvbmx5IGJ5IGB3MzJ0ZXJtLmNgIGFuZCBgeHRlcm0u YycuICovCisgICAgICBib29sIGN1cnNvcl9nY19wID0gZmFsc2U7CisgICAgICBjb25zd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LS0tLS0tLS0tLS0tLS0tLS0tICovCit7CisgIGlmIChzLT5mb3Jfb3Zlcmxh cHMpCisgICAgcmV0dXJuOworICAvKiBEbyB1bmRlcmxpbmUuICovCisgIGlmIChmYWNlLT51bmRl cmxpbmVfcCkKKyAgICB7CisgICAgICBpZiAocy0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFD RV9VTkRFUl9XQVZFKQorICAgICAgICB7CisgICAgICAgICAgaWYgKGZhY2UtPnVuZGVybGluZV9k ZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgIFtkZWZhdWx0Q29sIHNldF07CisgICAgICAgICAgICBl bHNlCisgICAgICAgICAgICAgIFtuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoZmFjZS0+dW5kZXJs aW5lX2NvbG9yLCBzLT5mKSBzZXRdOworICAgICAgICAgIG5zX2RyYXdfdW5kZXJ3YXZlIChzLCB3 aWR0aCwgeCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAocy0+ZmFjZS0+dW5kZXJsaW5l X3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIE5TUmVj dCByOworICAgICAgICAgICAgdW5zaWduZWQgbG9uZyB0aGlja25lc3MsIHBvc2l0aW9uOworICAg ICAgICAgICAgLyogSWYgdGhlIHByZXYgd2FzIHVuZGVybGluZWQsIG1hdGNoIGl0cyBhcHBlYXJh bmNlLiAqLworICAgICAgICAgICAgaWYgKHMtPnByZXYgJiYgcy0+cHJldi0+ZmFjZS0+dW5kZXJs aW5lX3AKKyAgICAgICAgICAgICAgICAmJiBzLT5wcmV2LT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9 PSBGQUNFX1VOREVSX0xJTkUKKyAgICAgICAgICAgICAgICAmJiBzLT5wcmV2LT51bmRlcmxpbmVf dGhpY2tuZXNzID4gMCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHRoaWNrbmVz cyA9IHMtPnByZXYtPnVuZGVybGluZV90aGlja25lc3M7CisgICAgICAgICAgICAgICAgcG9zaXRp b24gPSBzLT5wcmV2LT51bmRlcmxpbmVfcG9zaXRpb247CisgICAgICAgICAgICAgIH0KKyAgICAg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIHN0cnVj dCBmb250ICpmb250OworICAgICAgICAgICAgICAgICAgdW5zaWduZWQgbG9uZyBkZXNjZW50Owor ICAgICAgICAgICAgICAgICAgZm9udD1zLT5mb250OworICAgICAgICAgICAgICAgICAgZGVzY2Vu dCA9IHMtPnkgKyBzLT5oZWlnaHQgLSBzLT55YmFzZTsKKyAgICAgICAgICAgICAgICAgIC8qIFVz ZSB1bmRlcmxpbmUgdGhpY2tuZXNzIG9mIGZvbnQsIGRlZmF1bHRpbmcgdG8gMS4gKi8KKyAgICAg ICAgICAgICAgICAgIHRoaWNrbmVzcyA9IChmb250ICYmIGZvbnQtPnVuZGVybGluZV90aGlja25l c3MgPiAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBmb250LT51bmRlcmxpbmVf dGhpY2tuZXNzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IDE7CisgICAgICAgICAg ICAgICAgICAvKiBEZXRlcm1pbmUgdGhlIG9mZnNldCBvZiB1bmRlcmxpbmluZyBmcm9tIHRoZSBi YXNlbGluZS4gKi8KKyAgICAgICAgICAgICAgICAgIGlmICh4X3VuZGVybGluZV9hdF9kZXNjZW50 X2xpbmUpCisgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gZGVzY2VudCAtIHRoaWNrbmVz czsKKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoeF91c2VfdW5kZXJsaW5lX3Bvc2l0aW9u X3Byb3BlcnRpZXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZm9udCAmJiBmb250 LT51bmRlcmxpbmVfcG9zaXRpb24gPj0gMCkKKyAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlv biA9IGZvbnQtPnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgICAgICAgICBlbHNl IGlmIChmb250KQorICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBscm91bmQgKGZv bnQtPmRlc2NlbnQgLyAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSB1bmRlcmxpbmVfbWluaW11bV9vZmZzZXQ7Cisg ICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IG1heCAocG9zaXRpb24sIHVuZGVybGluZV9taW5p bXVtX29mZnNldCk7CisgICAgICAgICAgICAgICAgICAvKiBFbnN1cmUgdW5kZXJsaW5pbmcgaXMg bm90IGNyb3BwZWQuICovCisgICAgICAgICAgICAgICAgICBpZiAoZGVzY2VudCA8PSBwb3NpdGlv bikKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9u ID0gZGVzY2VudCAtIDE7CisgICAgICAgICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gMTsKKyAg ICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChkZXNjZW50 IDwgcG9zaXRpb24gKyB0aGlja25lc3MpCisgICAgICAgICAgICAgICAgICAgICAgdGhpY2tuZXNz ID0gMTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICBzLT51bmRlcmxpbmVfdGhpY2tu ZXNzID0gdGhpY2tuZXNzOworICAgICAgICAgICAgcy0+dW5kZXJsaW5lX3Bvc2l0aW9uID0gcG9z aXRpb247CisgICAgICAgICAgICByID0gTlNNYWtlUmVjdCAoeCwgcy0+eWJhc2UgKyBwb3NpdGlv biwgd2lkdGgsIHRoaWNrbmVzcyk7CisgICAgICAgICAgICBpZiAoZmFjZS0+dW5kZXJsaW5lX2Rl ZmF1bHRlZF9wKQorICAgICAgICAgICAgICBbZGVmYXVsdENvbCBzZXRdOworICAgICAgICAgICAg ICBlbHNlCisgICAgICAgICAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChmYWNlLT51 bmRlcmxpbmVfY29sb3IsIHMtPmYpIHNldF07CisgICAgICAgICAgICBOU1JlY3RGaWxsIChyKTsK KyAgICAgICAgICB9CisgICAgfQorICAvKiBEbyBvdmVybGluZS4gV2UgZm9sbG93IG90aGVyIHRl cm1zIGluIHVzaW5nIGEgdGhpY2tuZXNzIG9mIDEKKyAgICAgYW5kIGlnbm9yaW5nIG92ZXJsaW5l X21hcmdpbi4gKi8KKyAgaWYgKGZhY2UtPm92ZXJsaW5lX3ApCisgICAgeworICAgICAgTlNSZWN0 IHI7CisgICAgICByID0gTlNNYWtlUmVjdCAoeCwgcy0+eSwgd2lkdGgsIDEpOworICAgICAgaWYg KGZhY2UtPm92ZXJsaW5lX2NvbG9yX2RlZmF1bHRlZF9wKQorICAgICAgICBbZGVmYXVsdENvbCBz ZXRdOworICAgICAgICBlbHNlCisgICAgICAgICAgW25zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChm YWNlLT5vdmVybGluZV9jb2xvciwgcy0+Zikgc2V0XTsKKyAgICAgIE5TUmVjdEZpbGwgKHIpOwor ICAgIH0KKyAgLyogRG8gc3RyaWtlLXRocm91Z2guICBXZSBmb2xsb3cgb3RoZXIgdGVybXMgZm9y IHRoaWNrbmVzcyBhbmQKKyAgICAgdmVydGljYWwgcG9zaXRpb24uKi8KKyAgaWYgKGZhY2UtPnN0 cmlrZV90aHJvdWdoX3ApCisgICAgeworICAgICAgTlNSZWN0IHI7CisgICAgICB1bnNpZ25lZCBs b25nIGR5OworICAgICAgZHkgPSBscmludCAoKHMtPmhlaWdodCAtIDEpIC8gMik7CisgICAgICBy ID0gTlNNYWtlUmVjdCAoeCwgcy0+eSArIGR5LCB3aWR0aCwgMSk7CisgICAgICBpZiAoZmFjZS0+ c3RyaWtlX3R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UpCisgICAgICAgICAgICBm YWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBNT1VTRV9GQUNFX0lEKTsKKyAgICAgICAgfQorICAg ICAgICBlbHNlCisgICAgICAgICBmYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBzLT5maXJzdF9n bHlwaC0+ZmFjZV9pZCk7CisgICAgICBiZ0NvbCA9IG5zX2xvb2t1cF9pbmRleGVkX2NvbG9yIChO U19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpLCBzLT5mKTsKKyAgICAgIGZnQ29sID0gbnNfbG9va3Vw X2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAoZmFjZSksIHMtPmYpOworICAgICAg Zm9yIChpID0gMDsgaSA8IG47ICsraSkKKyAgICAgICAgeworICAgICAgICAgIGlmICghcy0+cm93 LT5mdWxsX3dpZHRoX3ApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGludCBvdmVycnVu LCBsZWZ0b3ZlcnJ1bjsKKyAgICAgICAgICAgICAgLyogdHJ1bmNhdGUgdG8gYXZvaWQgb3Zlcndy aXRpbmcgZnJpbmdlIGFuZC9vciBzY3JvbGxiYXIgKi8KKyAgICAgICAgICAgICAgb3ZlcnJ1biA9 IG1heCAoMCwgKHMtPnggKyBzLT5iYWNrZ3JvdW5kX3dpZHRoKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgLSAoV0lORE9XX0JPWF9SSUdIVF9FREdFX1ggKHMtPncpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAtIFdJTkRPV19SSUdIVF9GUklOR0VfV0lEVEggKHMtPncp KSk7CisgICAgICAgICAgICAgICAgICAgIHJbaV0uc2l6ZS53aWR0aCAtPSBvdmVycnVuOworICAg ICAgICAgICAgICAvKiB0cnVuY2F0ZSB0byBhdm9pZCBvdmVyd3JpdGluZyB0byBsZWZ0IG9mIHRo ZSB3aW5kb3cgYm94ICovCisgICAgICAgICAgICAgIGxlZnRvdmVycnVuID0gKFdJTkRPV19CT1hf TEVGVF9FREdFX1ggKHMtPncpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgV0lORE9X X0xFRlRfRlJJTkdFX1dJRFRIIChzLT53KSkgLSBzLT54OworICAgICAgICAgICAgICBpZiAobGVm dG92ZXJydW4gPiAwKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIHJbaV0u b3JpZ2luLnggKz0gbGVmdG92ZXJydW47CisgICAgICAgICAgICAgICAgICByW2ldLnNpemUud2lk dGggLT0gbGVmdG92ZXJydW47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAg ICAgICAgIFtiZ0NvbCBzZXRdOworICAgICAgICAgIC8qIE5PVEU6IHVuZGVyIE5TIHRoaXMgaXMg Tk9UIHVzZWQgdG8gZHJhdyBjdXJzb3JzLCBidXQgd2UgbXVzdCBhdm9pZAorICAgICAgICAgICAg IG92ZXJ3cml0aW5nIGN1cnNvciAodXN1YWxseSB3aGVuIGN1cnNvciBvbiBhIHRhYikgKi8KKyAg ICAgICAgICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IpCisgICAgICAgICAgICB7CisgICAgICAg ICAgICAgIC8qIEZJWE1FOiAgRG8gd2Ugc3RpbGwgbmVlZCB0byBwcmV2ZW50IHRoaXMgc2VjdGlv biBvZiBjb2RlIGZyb20KKyAgICAgICAgICAgICAgZXJhc2luZyB0aGUgZmFrZSBNQ19IQkFSIHRo YXQgZXh0ZW5kcyB0aGUgZW50aXJlIGxlbmd0aCBvZiB0aGUKKyAgICAgICAgICAgICAgU1RSRVRD SF9HTFlQSD8gIFRoaXMgbWF5IGhhdmUgYmVlbiBkb25lIHByaW9yIHRvIHRoZSBmaXggcmVsYXRp bmcKKyAgICAgICAgICAgICAgdG8gbGVmdC9yaWdodCBvdmVyd3JpdHRlbiBnbHlwaHMuICovCisg ICAgICAgICAgICAgIHJbaV0uc2l6ZS5oZWlnaHQgLT0gMTsKKyAgICAgICAgICAgICAgLy8gIGVu dW0gZmFjZV9pZCBkZWJ1Z2dpbmdfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlIChzLT53LCBz LT5mLCBpbnRlcm4gKCIrLWRlYnVnZ2luZy1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAv LyAgc3RydWN0IGZhY2UgKmRlYnVnZ2luZ19mYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBkZWJ1 Z2dpbmdfZmFjZV9pZCk7CisgICAgICAgICAgICAgIC8vICBOU0NvbG9yICpjb2xvciA9IG5zX2xv b2t1cF9pbmRleGVkX2NvbG9yIChOU19GQUNFX0ZPUkVHUk9VTkQgKGRlYnVnZ2luZ19mYWNlKSwg cy0+Zik7CisgICAgICAgICAgICAgIC8vICBbY29sb3Igc2V0XTsKKyAgICAgICAgICAgICAgQ0dG bG9hdCB4ID0gcltpXS5vcmlnaW4ueDsKKyAgICAgICAgICAgICAgQ0dGbG9hdCB3aWR0aCA9IHdk OworICAgICAgICAgICAgICByW2ldLnNpemUud2lkdGggLT0gd2lkdGg7CisgICAgICAgICAgICAg IHJbaV0ub3JpZ2luLnggKz0gd2lkdGg7CisgICAgICAgICAgICAgIE5TUmVjdEZpbGwgKHJbaV0p OworICAgICAgICAgICAgICAvKiBEcmF3IG92ZXJsaW5pbmcsIGV0Yy4gb24gdGhlIGN1cnNvci4g Ki8KKyAgICAgICAgICAgICAgaWYgKHMtPnctPnBoeXNfY3Vyc29yX3R5cGUgPT0gTUNfRklMTEVE X0JPWCkKKyAgICAgICAgICAgICAgICBtY19uc19kcmF3X3RleHRfZGVjb3JhdGlvbiAocywgZmFj ZSwgYmdDb2wsIHdpZHRoLCB4KTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAg ICAgICBtY19uc19kcmF3X3RleHRfZGVjb3JhdGlvbiAocywgZmFjZSwgZmdDb2wsIHdpZHRoLCB4 KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgIC8vICBp bnQgcnggPSByW2ldLm9yaWdpbi54OworICAvLyAgaW50IHJ5ID0gcltpXS5vcmlnaW4ueTsKKyAg Ly8gIGludCBydyA9IHJbaV0uc2l6ZS53aWR0aDsKKyAgLy8gIGludCByaCA9IHJbaV0uc2l6ZS5o ZWlnaHQ7CisgIC8vICBmcHJpbnRmIChzdGRlcnIsICJtY19uc19kdW1wZ2x5cGhzX3N0cmV0Y2g6 ICB2cG9zICglZCkgfCByeCAoJWQpIHwgcnkgKCVkKSB8IHJ3ICglZCkgfCByaCAoJWQpXG4iLAor ICAvLyAgICAgICAgICAgICAgICAgICBzLT5maXJzdF9nbHlwaC0+dnBvcywgcngsIHJ5LCBydywg cmgpOworICAgICAgICAgICAgICBOU1JlY3RGaWxsIChyW2ldKTsKKyAgICAgICAgICAgIH0KKyAg ICAgICAgICAvKiBEcmF3IG92ZXJsaW5pbmcsIGV0Yy4gb24gdGhlIHN0cmV0Y2ggZ2x5cGggKG9y IHRoZSBwYXJ0CisgICAgICAgICAgICAgb2YgdGhlIHN0cmV0Y2ggZ2x5cGggYWZ0ZXIgdGhlIGN1 cnNvcikuICovCisgICAgICAgICAgbWNfbnNfZHJhd190ZXh0X2RlY29yYXRpb24gKHMsIGZhY2Us IGZnQ29sLCByW2ldLnNpemUud2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHJbaV0ub3JpZ2luLngpOworICAgICAgICB9CisgICAgICBpZiAoKHMtPmxlZnRfb3Zl cndyaXR0ZW5fcCB8fCBzLT5yaWdodF9vdmVyd3JpdHRlbl9wKQorICAgICAgICAgICYmIChzLT5h Y3Rpb25fdHlwZSA9PSBNQ19EUkFXX0dMWVBIX1NUUklORyB8fCBzLT5hY3Rpb25fdHlwZSA9PSBN Q19FUkFTRV9HTFlQSF9TVFJJTkcpKQorICAgICAgICBtY19uc19kcmF3X292ZXJ3cml0dGVuIChz LCBtYXRyaXgsIHJvd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tPnNs aWNlLngsIHMtPnNsaWNlLnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzLT5zbGlj ZS53aWR0aCwgcy0+c2xpY2UuaGVpZ2h0KTsKKyAgICAgIFtpbWcgZHJhd0luUmVjdDogZHIKKyAg ICAgICAgICAgICBmcm9tUmVjdDogaXIKKyAgICAgICAgICAgICBvcGVyYXRpb246IE5TQ29tcG9z aXRlU291cmNlT3ZlcgorICAgICAgICAgICAgICBmcmFjdGlvbjogMS4wCisgICAgICAgICAgIHJl c3BlY3RGbGlwcGVkOiBZRVMKKyAgICAgICAgICAgICAgICBoaW50czogbmlsXTsKKyNlbHNlCisg ICAgICBbaW1nIGNvbXBvc2l0ZVRvUG9pbnQ6IE5TTWFrZVBvaW50ICh4LCB5ICsgcy0+c2xpY2Uu aGVpZ2h0KQorICAgICAgICAgICAgICAgICAgb3BlcmF0aW9uOiBOU0NvbXBvc2l0ZVNvdXJjZU92 ZXJdOworI2VuZGlmCisgICAgfQorICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IpCisgICAgewor ICAgICAgW0ZSQU1FX0NVUlNPUl9DT0xPUiAocy0+Zikgc2V0XTsKKyAgICAgIGlmIChzLT53LT5w aHlzX2N1cnNvcl90eXBlID09IE1DX0ZJTExFRF9CT1gpCisgICAgICAgIHRkQ29sID0gbnNfbG9v a3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfQkFDS0dST1VORCAoZmFjZSksIHMtPmYpOworICAg ICAgICBlbHNlCisgICAgICAgICAgLyogQ3VycmVudGx5IG9uIE5TIGltZy0+bWFzayBpcyBhbHdh eXMgMC4gU2luY2UKKyAgICAgICAgICAgICBnZXRfd2luZG93X2N1cnNvcl90eXBlIHNwZWNpZmll cyBhIGhvbGxvdyBib3ggY3Vyc29yIHdoZW4gb24KKyAgICAgICAgICAgICBhIG5vbi1tYXNrZWQg aW1hZ2Ugd2UgbmV2ZXIgcmVhY2ggdGhpcyBjbGF1c2UuIEJ1dCB3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TsKKyAgICAgICAgICAgIHJhaXNlZF9wID0gKHMtPmltZy0+cmVsaWVmID4g MCk7CisgICAgICAgICAgfQorICAgICAgci5vcmlnaW4ueCA9IHggLSB0aDsKKyAgICAgIHIub3Jp Z2luLnkgPSB5IC0gdGg7CisgICAgICByLnNpemUud2lkdGggPSBzLT5zbGljZS53aWR0aCArIDIq dGgtMTsKKyAgICAgIHIuc2l6ZS5oZWlnaHQgPSBzLT5zbGljZS5oZWlnaHQgKyAyKnRoLTE7Cisg ICAgICBuc19kcmF3X3JlbGllZiAociwgdGgsIHJhaXNlZF9wLAorICAgICAgICAgICAgICAgICAg ICAgIHMtPnNsaWNlLnkgPT0gMCwKKyAgICAgICAgICAgICAgICAgICAgICBzLT5zbGljZS55ICsg cy0+c2xpY2UuaGVpZ2h0ID09IHMtPmltZy0+aGVpZ2h0LAorICAgICAgICAgICAgICAgICAgICAg IHMtPnNsaWNlLnggPT0gMCwKKyAgICAgICAgICAgICAgICAgICAgICBzLT5zbGljZS54ICsgcy0+ c2xpY2Uud2lkdGggPT0gcy0+aW1nLT53aWR0aCwgcyk7CisgICAgfQorICAvKiBJZiB0aGVyZSBp cyBubyBtYXNrLCB0aGUgYmFja2dyb3VuZCB3b24ndCBiZSBzZWVuLAorICAgICBzbyBkcmF3IGEg cmVjdGFuZ2xlIG9uIHRoZSBpbWFnZSBmb3IgdGhlIGN1cnNvci4KKyAgICAgRG8gdGhpcyBmb3Ig YWxsIGltYWdlcywgZ2V0dGluZyB0cmFuc3BhcmVuY3kgcmlnaHQgaXMgbm90IHJlbGlhYmxlLiAq LworICBpZiAocy0+aGwgPT0gRFJBV19DVVJTT1IpCisgICAgeworICAgICAgaW50IHRoaWNrbmVz cyA9IGFicyAocy0+aW1nLT5yZWxpZWYpOworICAgICAgaWYgKHRoaWNrbmVzcyA9PSAwKSB0aGlj a25lc3MgPSAxOworICAgIGlmIChnbHlwaF9mbGF2b3IgPT0gTUNfR0xZUEgKKyAgICAgICAgfHwg Z2x5cGhfZmxhdm9yID09IE1DX0dMWVBITEVTUykKKyAgICAgIHsKKyAgICAgICAgTlNDb2xvciAq Ym9yZGVyX2NvbG9yID0gW05TQ29sb3IgY29sb3JXaXRoQ2FsaWJyYXRlZFJlZDogbHNsLnJlZAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGdyZWVuOiBsc2wuZ3JlZW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgYmx1ZTogbHNsLmJsdWUKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHBoYTogMS4wXTsKKyAgICAg ICAgbnNfZHJhd19ib3ggKGJyLCB0aGlja25lc3MsIGJvcmRlcl9jb2xvciwgMSwgMSk7CisgICAg ICB9CisgICAgICBlbHNlCisgICAgICAgIG5zX2RyYXdfYm94IChiciwgdGhpY2tuZXNzLCBGUkFN RV9DVVJTT1JfQ09MT1IgKHMtPmYpLCAxLCAxKTsKKyAgICB9Cit9CisKK3N0YXRpYyB2b2lkCitt Y19uc19tYXliZV9kdW1wZ2x5cGhzX2JhY2tncm91bmQgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMs IGNoYXIgZm9yY2VfcCkKK3sKKyAgTlNUUkFDRSAoIm1jX25zX21heWJlX2R1bXBnbHlwaHNfYmFj a2dyb3VuZCIpOworICBpZiAoIXMtPmJhY2tncm91bmRfZmlsbGVkX3AvKiB8fCBzLT5obCA9PSBE UkFXX01PVVNFX0ZBQ0UqLykKKyAgICB7CisgICAgICBpbnQgYm94X2xpbmVfd2lkdGggPSBtYXgg KHMtPmZhY2UtPmJveF9saW5lX3dpZHRoLCAwKTsKKyAgICAgIGlmIChGT05UX0hFSUdIVCAocy0+ Zm9udCkgPCBzLT5oZWlnaHQgLSAyICogYm94X2xpbmVfd2lkdGgKKyAgICAgICAgICAvKiBXaGVu IHhkaXNwLmMgaWdub3JlcyBGT05UX0hFSUdIVCwgd2UgY2Fubm90IHRydXN0IGZvbnQKKyAgICAg ICAgICAgICBkaW1lbnNpb25zLCBzaW5jZSB0aGUgYWN0dWFsIGdseXBocyBtaWdodCBiZSBtdWNo CisgICAgICAgICAgICAgc21hbGxlci4gIFNvIGluIHRoYXQgY2FzZSB3ZSBhbHdheXMgY2xlYXIg dGhlIHJlY3RhbmdsZQorICAgICAgICAgICAgIHdpdGggYmFja2dyb3VuZCBjb2xvci4gKi8KKyAg ICAgICAgICB8fCBGT05UX1RPT19ISUdIIChzLT5mb250KQorICAgICAgICAgIHx8IHMtPmZvbnRf bm90X2ZvdW5kX3AgfHwgcy0+ZXh0ZW5kc190b19lbmRfb2ZfbGluZV9wIHx8IGZvcmNlX3ApCisg ICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZmFjZSAqZmFjZTsKKyAgICAgICAgICBpZiAocy0+ aGwgPT0gRFJBV19NT1VTRV9GQUNFKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBmYWNl ID0gRkFDRV9GUk9NX0lEIChzLT5mLCBNT1VTRV9ITF9JTkZPIChzLT5mKS0+bW91c2VfZmFjZV9m YWNlX2lkKTsKKyAgICAgICAgICAgICAgaWYgKCFmYWNlKQorICAgICAgICAgICAgICAgIGZhY2Ug PSBGQUNFX0ZST01fSUQgKHMtPmYsIE1PVVNFX0ZBQ0VfSUQpOworICAgICAgICAgICAgfQorICAg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBmYWNlID0gRkFDRV9GUk9NX0lEIChzLT5mLCBz LT5maXJzdF9nbHlwaC0+ZmFjZV9pZCk7CisgICAgICAgICAgaWYgKCFmYWNlLT5zdGlwcGxlKQor ICAgICAgICAgICAgWyhOU19GQUNFX0JBQ0tHUk9VTkQgKGZhY2UpICE9IDAKKyAgICAgICAgICAg ICAgPyBuc19sb29rdXBfaW5kZXhlZF9jb2xvciAoTlNfRkFDRV9CQUNLR1JPVU5EIChmYWNlKSwg cy0+ZikKKyAgICAgICAgICAgICAgOiBGUkFNRV9CQUNLR1JPVU5EX0NPTE9SIChzLT5mKSkgc2V0 XTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0 cnVjdCBuc19kaXNwbGF5X2luZm8gKmRweWluZm8gPSBGUkFNRV9ESVNQTEFZX0lORk8gKHMtPmYp OworICAgICAgICAgICAgICAgIFtbZHB5aW5mby0+Yml0bWFwc1tmYWNlLT5zdGlwcGxlLTFdLmlt ZyBzdGlwcGxlTWFza10gc2V0XTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIGlmIChzLT5o bCAhPSBEUkFXX0NVUlNPUikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgcy0+cmVjdGFu Z2xlX251a2VkX3AgPSB0cnVlOworICAgICAgICAgICAgICBOU1JlY3QgciA9IE5TTWFrZVJlY3Qg KHMtPngsIHMtPnkgKyBib3hfbGluZV93aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHMtPmJhY2tncm91bmRfd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBzLT5oZWlnaHQtMipib3hfbGluZV93aWR0aCk7CisgICAgICAgICAgICAgIE5T UmVjdEZpbGwgKHIpOworICAgICAgICAgICAgfQorICAgICAgICAgIHMtPmJhY2tncm91bmRfZmls bGVkX3AgPSAxOworICAgICAgICB9CisgICAgfQorfQorCitzdGF0aWMgdm9pZAorbWNfbnNfZHJh d19nbHlwaF9zdHJpbmcgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMsIHN0cnVjdCBnbHlwaF9tYXRy aXggKm1hdHJpeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpy b3csIHN0cnVjdCBtY19tYXRyaXggbWNfbWF0cml4LAorICAgICAgICAgICAgICAgICAgICAgICAg IHN0cnVjdCB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uZXh0KQorICAgICAgICBpZiAobmV4 dC0+Zmlyc3RfZ2x5cGgtPnR5cGUgIT0gSU1BR0VfR0xZUEgpCisgICAgICAgICAgeworICAgICAg ICAgICAgaWYgKG5leHQtPmZpcnN0X2dseXBoLT50eXBlICE9IFNUUkVUQ0hfR0xZUEgpCisgICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBuID0gbnNfZ2V0X2dseXBoX3N0cmluZ19jbGlw X3JlY3QgKHMtPm5leHQsIHIpOworICAgICAgICAgICAgICAgIGlmICghbnNfY2xpcF90b19yZWN0 IChzLT5mLCByLCBuKSkKKyAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAg ICBtY19uc19tYXliZV9kdW1wZ2x5cGhzX2JhY2tncm91bmQgKHMtPm5leHQsIDEpOworICAgICAg ICAgICAgICAgIG5zX3Jlc2V0X2NsaXBwaW5nIChzLT5mKTsKKyAgICAgICAgICAgICAgfQorICAg ICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgbWNfbnNfZHVtcGdseXBoc19zdHJldGNo IChzLT5uZXh0LCBtYXRyaXgsIHJvdywgbWNfbWF0cml4LCB3ZCk7CisgICAgICAgICAgICBuZXh0 LT5udW1fY2xpcHMgPSAwOworICAgICAgICAgIH0KKyAgICB9CisgIGlmICghcy0+Zm9yX292ZXJs YXBzICYmIHMtPmZhY2UtPmJveCAhPSBGQUNFX05PX0JPWAorICAgICAgJiYgKHMtPmZpcnN0X2ds eXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgICAgICB8fCBzLT5maXJzdF9nbHlwaC0+dHlw ZSA9PSBDT01QT1NJVEVfR0xZUEgpKQorICAgIHsKKyAgICAgIG4gPSBuc19nZXRfZ2x5cGhfc3Ry aW5nX2NsaXBfcmVjdCAocywgcik7CisgICAgICBpZiAoIW5zX2NsaXBfdG9fcmVjdCAocy0+Ziwg ciwgbikpCisgICAgICAgIHJldHVybjsKKyAgICAgIG1jX25zX21heWJlX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bGxlZF9wID0gMTsKKyAgICAgICAgZWxzZQorICAgICAgICAg IG1jX25zX21heWJlX2R1bXBnbHlwaHNfYmFja2dyb3VuZCAocywgcy0+Zmlyc3RfZ2x5cGgtPnR5 cGUgPT0gQ09NUE9TSVRFX0dMWVBIKTsKKyAgICAgIGludCBmbGFncyA9IChzLT5obCA9PSBEUkFX X0NVUlNPUikKKyAgICAgICAgICAgICAgICAgICAgPyBOU19EVU1QR0xZUEhfQ1VSU09SCisgICAg ICAgICAgICAgICAgICA6IChzLT5obCA9PSBEUkFXX01PVVNFX0ZBQ0UpCisgICAgICAgICAgICAg ICAgICAgID8gTlNfRFVNUEdMWVBIX01PVVNFRkFDRQorICAgICAgICAgICAgICAgICAgOiAocy0+ Zm9yX292ZXJsYXBzKQorICAgICAgICAgICAgICAgICAgICA/IE5TX0RVTVBHTFlQSF9GT1JFR1JP VU5ECisgICAgICAgICAgICAgICAgICA6IE5TX0RVTVBHTFlQSF9OT1JNQUw7CisgICAgICB1bnNp Z25lZCBsb25nIHNhdmVkX2ZnID0gTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKTsKKyAgICAg IGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUiAmJiBjdXJzb3JfdHlwZSA9PSBNQ19GSUxMRURfQk9Y KQorICAgICAgICB7CisgICAgICAgICAgdW5zaWduZWQgbG9uZyB0bXAgPSBOU19GQUNFX0JBQ0tH Uk9VTkQgKHMtPmZhY2UpOworICAgICAgICAgIE5TX0ZBQ0VfQkFDS0dST1VORCAocy0+ZmFjZSkg PSBOU19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2UpOworICAgICAgICAgIE5TX0ZBQ0VfRk9SRUdS T1VORCAocy0+ZmFjZSkgPSB0bXA7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAocy0+aGwg PT0gRFJBV19DVVJTT1IKKyAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3R5cGUgPT0gTUNfRlJB TUVEX0JPWAorICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcCkKKyAgICAgICAgICB7CisgICAg ICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0KKyAgICAgICAgICAg ICAgbG9va3VwX25hbWVkX2ZhY2UgKHMtPncsIHMtPmYsIGludGVybiAoIistcmVhbC1mYWtlLWN1 cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xs b3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKHMtPmYsIGhvbGxvd19hY3RpdmVfZmFjZV9p ZCk7CisgICAgICAgICAgICBOU19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2UpID0gTlNfRkFDRV9G T1JFR1JPVU5EIChob2xsb3dfYWN0aXZlX2ZhY2UpOworICAgICAgICAgIH0KKyAgICAgICAgICBl bHNlIGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUgorICAgICAgICAgICAgICAgICAgICYmIGN1cnNv cl90eXBlID09IE1DX0ZSQU1FRF9CT1gKKyAgICAgICAgICAgICAgICAgICAmJiBhY3RpdmVfcCkK KyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFjdGl2 ZV9mYWNlX2lkID0KKyAgICAgICAgICAgICAgICBsb29rdXBfbmFtZWRfZmFjZSAocy0+dywgcy0+ ZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRy dWUpOworICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2luYWN0aXZlX2ZhY2UgPSBG QUNFX0ZST01fSUQgKHMtPmYsIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAg ICAgTlNfRkFDRV9GT1JFR1JPVU5EIChzLT5mYWNlKSA9IE5TX0ZBQ0VfRk9SRUdST1VORCAoaG9s bG93X2luYWN0aXZlX2ZhY2UpOworICAgICAgICAgICAgfQorICAgICAgaWYgKHMtPmZpcnN0X2ds eXBoLT50eXBlID09IENPTVBPU0lURV9HTFlQSCkKKyAgICAgICAgbnNfZHJhd19jb21wb3NpdGVf Z2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHMpOworICAgICAgICBlbHNlCisgICAgICAgICAgewor ICAgICAgICAgICAgYm9vbCB3aXRoX2JnX3AgPSAoKGZsYWdzID09IE5TX0RVTVBHTFlQSF9OT1JN QUwgJiYgIXMtPmJhY2tncm91bmRfZmlsbGVkX3ApCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICB8fCBmbGFncyA9PSBOU19EVU1QR0xZUEhfTU9VU0VGQUNFKTsKKyAgICAgICAgICAgIGlm ICh3aXRoX2JnX3ApCisgICAgICAgICAgICAgIHMtPmJhY2tncm91bmRfbnVrZWRfcCA9IHRydWU7 CisgICAgICAgICAgICBmb250LT5kcml2ZXItPmRyYXcgKHMsIHMtPmNtcF9mcm9tLCBzLT5uY2hh cnMsIHMtPngsIHMtPnliYXNlLCB3aXRoX2JnX3ApOworICAgICAgICAgIH0KKyAgICAgIE5TQ29s b3IgKmNvbCA9IChOU19GQUNFX0ZPUkVHUk9VTkQgKHMtPmZhY2UpICE9IDAKKyAgICAgICAgICAg ICAgICAgICAgID8gbnNfbG9va3VwX2luZGV4ZWRfY29sb3IgKE5TX0ZBQ0VfRk9SRUdST1VORCAo cy0+ZmFjZSksIHMtPmYpCisgICAgICAgICAgICAgICAgICAgICA6IEZSQU1FX0ZPUkVHUk9VTkRf Q09MT1IgKHMtPmYpKTsKKyAgICAgIFtjb2wgc2V0XTsKKyAgICAgIC8qIERyYXcgdW5kZXJsaW5l LCBvdmVybGluZSwgc3RyaWtlLXRocm91Z2guICovCisgICAgICBtY19uc19kcmF3X3RleHRfZGVj b3JhdGlvbiAocywgcy0+ZmFjZSwgY29sLCBzLT53aWR0aCwgcy0+eCk7CisgIC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gR0xZUEhMRVNTX0dMWVBIOgorICAgICAgbiA9IG5zX2dldF9nbHlw aF9zdHJpbmdfY2xpcF9yZWN0IChzLCByKTsKKyAgICAgIGlmICghbnNfY2xpcF90b19yZWN0IChz LT5mLCByLCBuKSkKKyAgICAgICAgcmV0dXJuOworICAgICAgaWYgKHMtPmZvcl9vdmVybGFwcwor ICAgICAgICAgIHx8IChzLT5jbXBfZnJvbSA+IDAKKyAgICAgICAgICAgICAgJiYgISBzLT5maXJz dF9nbHlwaC0+dS5jbXAuYXV0b21hdGljKSkKKyAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRf cCA9IDE7CisgICAgICBlbHNlCisgICAgICAgIG1jX25zX21heWJlX2R1bXBnbHlwaHNfYmFja2dy b3VuZCAocywgcy0+Zmlyc3RfZ2x5cGgtPnR5cGUgPT0gQ09NUE9TSVRFX0dMWVBIKTsKKyAgICAg IG5zX3Jlc2V0X2NsaXBwaW5nIChzLT5mKTsKKyAgICAgIGJyZWFrOworICAgIGRlZmF1bHQ6Cisg ICAgICBlbWFjc19hYm9ydCAoKTsKKyAgICB9CisgIC8qIERyYXcgYm94IGlmIG5vdCBkb25lIGFs cmVhZHkuICovCisgIGlmICghcy0+Zm9yX292ZXJsYXBzCisgICAgICAmJiAhYm94X2RyYXduX3AK KyAgICAgICYmIHMtPmZhY2UtPmJveCAhPSBGQUNFX05PX0JPWCkKKyAgICB7CisgICAgICBuID0g bnNfZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsIHIpOworICAgICAgaWYgKCFuc19jbGlw X3RvX3JlY3QgKHMtPmYsIHIsIG4pKQorICAgICAgICByZXR1cm47CisgICAgICBuc19kdW1wZ2x5 cGhzX2JveF9vcl9yZWxpZWYgKHMpOworICAgICAgbnNfcmVzZXRfY2xpcHBpbmcgKHMtPmYpOwor ICAgIH0KKyAgcy0+bnVtX2NsaXBzID0gMDsKK30KKworLyogZW5kIE1VTFRJUExFLUNVUlNPUlMg Ki8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIC8qID09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAK ICAgIE5TVFJBQ0UsIFRyYWNlIHN1cHBvcnQuCkBAIC0xMDc5LDYgKzIwNTIsMTYgQEAgc3RhdGlj IE5TUmVjdCBjb25zdHJhaW5fZnJhbWVfcmVjdChOU1JlY3QgZnJhbWVSZWN0LCBib29sIGlzRnVs bHNjcmVlbikKICAgIGV4dGVybmFsIChSSUYpIGNhbGw7IHdob2xlIGZyYW1lLCBjYWxsZWQgYmVm b3JlIGd1aV91cGRhdGVfd2luZG93X2JlZ2luCiAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLwogewor CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisg IGYtPm1jX3VwZGF0aW5nX2ZyYW1lID0gZjsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisK KwogI2lmZGVmIE5TX0lNUExfQ09DT0EKICAgRW1hY3NWaWV3ICp2aWV3ID0gRlJBTUVfTlNfVklF VyAoZik7CiAKQEAgLTExMDksNiArMjA5MiwxNiBAQCBzdGF0aWMgTlNSZWN0IGNvbnN0cmFpbl9m cmFtZV9yZWN0KE5TUmVjdCBmcmFtZVJlY3QsIGJvb2wgaXNGdWxsc2NyZWVuKQogCiAvKiAgIGlm IChmID09IE1PVVNFX0hMX0lORk8gKGYpLT5tb3VzZV9mYWNlX21vdXNlX2ZyYW1lKSAqLwogICBN T1VTRV9ITF9JTkZPIChmKS0+bW91c2VfZmFjZV9kZWZlciA9IDA7CisKKworLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdf ZnJhbWUgPSBOVUxMOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiB9CiAKIApAQCAt NDc1OSw2ICs1NzUyLDE3IEBAIGluIGNlcnRhaW4gc2l0dWF0aW9ucyAocmFwaWQgaW5jb21pbmcg ZXZlbnRzKS4KICAgICAgIGJhciA9IFtbRW1hY3NTY3JvbGxlciBhbGxvY10gaW5pdEZyYW1lOiBy IHdpbmRvdzogd2luXTsKICAgICAgIHdzZXRfdmVydGljYWxfc2Nyb2xsX2JhciAod2luZG93LCBt YWtlX21pbnRfcHRyIChiYXIpKTsKICAgICAgIHVwZGF0ZV9wID0gWUVTOworCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICAvKiBUaGlz IGlzIG9ubHkgZm9yIGRlYnVnZ2luZyBwdXJwb3Nlcy4gKi8KKyAgICAgIFtiYXIgbWNfc2V0X3Jl Y3RhbmdsZTogcl07CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICB9CiAgIGVs c2UKICAgICB7CkBAIC00NzY2LDEyICs1NzcwLDMwIEBAIGluIGNlcnRhaW4gc2l0dWF0aW9ucyAo cmFwaWQgaW5jb21pbmcgZXZlbnRzKS4KICAgICAgIGJhciA9IFhOU19TQ1JPTExfQkFSICh3aW5k b3ctPnZlcnRpY2FsX3Njcm9sbF9iYXIpOwogICAgICAgb2xkUmVjdCA9IFtiYXIgZnJhbWVdOwog ICAgICAgci5zaXplLndpZHRoID0gb2xkUmVjdC5zaXplLndpZHRoOworCisKKy8qICoqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCiAgICAgICBpZiAoRlJBTUVf TElWRV9QIChmKSAmJiAhTlNFcXVhbFJlY3RzIChvbGRSZWN0LCByKSkKICAgICAgICAgeworICAg ICAgICAgIC8qIFRoZSBtYWluIHdpbmRvdyBoYXMgcHJvYmFibHkgYmVlbiByZXNpemVkLiAgR3Jh Y2lvdXNseSBkZWxldGUgdGhlCisgICAgICAgICAgb2xkIHNjcm9sbCBiYXIgd2l0aG91dCByZXBh aW50aW5nIGl0cyByZWN0YW5nbGU7IGFuZCwgY3JlYXRlIGEgbmV3CisgICAgICAgICAgc2Nyb2xs IGJhciBlbHNld2hlcmUuKi8KICAgICAgICAgICBpZiAob2xkUmVjdC5vcmlnaW4ueCAhPSByLm9y aWdpbi54KQorICAgICAgICAgICAgewogICAgICAgICAgICAgICBuc19jbGVhcl9mcmFtZV9hcmVh IChmLCBsZWZ0LCB0b3AsIHdpZHRoLCBoZWlnaHQpOworICAgICAgICAgICAgICBbYmFyIG1jX2p1 ZGdlXTsKKyAgICAgICAgICAgICAgYmFyID0gW1tFbWFjc1Njcm9sbGVyIGFsbG9jXSBpbml0RnJh bWU6IHIgd2luZG93OiB3aW5dOworICAgICAgICAgICAgICB3c2V0X3ZlcnRpY2FsX3Njcm9sbF9i YXIgKHdpbmRvdywgbWFrZV9taW50X3B0ciAoYmFyKSk7CisgICAgICAgICAgICB9CisgICAgICAg ICAgICBlbHNlCiAgICAgICAgICAgW2JhciBzZXRGcmFtZTogcl07CiAgICAgICAgIH0KKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisKKwogICAgIH0KIAogICBpZiAodXBkYXRlX3ApCkBAIC00 OTMxLDkgKzU5NTMsNTcgQEAgaW4gY2VydGFpbiBzaXR1YXRpb25zIChyYXBpZCBpbmNvbWluZyBl dmVudHMpLgogICAgIHsKICAgICAgIHZpZXcgPSBbc3Vidmlld3Mgb2JqZWN0QXRJbmRleDogaV07 CiAgICAgICBpZiAoIVt2aWV3IGlzS2luZE9mQ2xhc3M6IFtFbWFjc1Njcm9sbGVyIGNsYXNzXV0p IGNvbnRpbnVlOwotICAgICAgaWYgKFt2aWV3IGp1ZGdlXSkKKworCisvKiAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAvKiBgWFNFVFdJTkRPVycgd2ls bCBzb21ldGltZXMgY2F1c2UgRW1hY3MgdG8gY3Jhc2ggd2hlbiBydW5uaW5nIHVuZGVyIGdkYiBl dmVuCisgIHRob3VnaCAodyAhPSBOVUxMKS4gIFRoZXJlZm9yZSwgd2UgY2Fubm90IHJlbGlhYmx5 IHVzZSBgV0lORE9XX0xJVkVfUCcuICovCisgIHN0cnVjdCB3aW5kb3cgKncgPSBbdmlldyBtY19n ZXRfd2luZG93XTsKKyAgaWYgKHcgIT0gTlVMTAorICAgICAgJiYgTklMUCAody0+Y29udGVudHMp KQorICAgIHsKKyAgICAgIEJPT0wgZGVidWdfcCA9IGZhbHNlOworICAgICAgaWYgKGRlYnVnX3AK KyAgICAgICAgICAvKiBgd2luZG93X2JveCcgY2FsbHMgYHdpbmRvd19ib3hfaGVpZ2h0Jywgd2hp Y2ggd2lsbCBjYXVzZSBFbWFjcyB0bworICAgICAgICAgIGNyYXNoIGlmIEZSQU1FUCAody0+ZnJh bWUpIGlzIG5vdCBzYXRpc2ZpZWQuICovCisgICAgICAgICAgJiYgRlJBTUVQICh3LT5mcmFtZSkp CisgICAgICAgIHsKKyAgICAgICAgICBOU1JlY3QgcjAgPSBbdmlldyBtY19nZXRfcmVjdGFuZ2xl XTsKKyAgICAgICAgICBpbnQgeDAgPSBOU01pblggKHIwKTsKKyAgICAgICAgICBpbnQgeTAgPSBO U01pblkgKHIwKTsKKyAgICAgICAgICBpbnQgd2QwID0gTlNXaWR0aCAocjApOworICAgICAgICAg IGludCBoMCA9IE5TSGVpZ2h0IChyMCk7CisgICAgICAgICAgaW50IHdpbmRvd195LCB3aW5kb3df aGVpZ2h0OworICAgICAgICAgIHdpbmRvd19ib3ggKHcsIEFOWV9BUkVBLCAwLCAmd2luZG93X3ks IDAsICZ3aW5kb3dfaGVpZ2h0KTsKKyAgICAgICAgICBpbnQgdG9wID0gd2luZG93X3k7CisgICAg ICAgICAgaW50IGhlaWdodCA9IHdpbmRvd19oZWlnaHQ7CisgICAgICAgICAgaW50IHdpZHRoID0g V0lORE9XX0NPTkZJR19TQ1JPTExfQkFSX0NPTFMgKHcpICogRlJBTUVfQ09MVU1OX1dJRFRIIChm KTsKKyAgICAgICAgICBpbnQgbGVmdCA9IFdJTkRPV19TQ1JPTExfQkFSX0FSRUFfWCAodyk7Cisg ICAgICAgICAgTlNSZWN0IHIxID0gTlNNYWtlUmVjdCAobGVmdCwgdG9wLCB3aWR0aCwgaGVpZ2h0 KTsKKyAgICAgICAgICAvKiBUaGUgcGFyZW50IHZpZXcgaXMgZmxpcHBlZCwgc28gd2UgbmVlZCB0 byBmbGlwIHkgdmFsdWUuICovCisgICAgICAgICAgRW1hY3NWaWV3ICpmcmFtZV92aWV3ID0gRlJB TUVfTlNfVklFVyAoZik7CisgICAgICAgICAgTlNSZWN0IHYgPSBbZnJhbWVfdmlldyBmcmFtZV07 CisgICAgICAgICAgcjEub3JpZ2luLnkgPSAodi5zaXplLmhlaWdodCAtIHIxLnNpemUuaGVpZ2h0 IC0gcjEub3JpZ2luLnkpOworICAgICAgICAgIGludCB4MSA9IE5TTWluWCAocjEpOworICAgICAg ICAgIGludCB5MSA9IE5TTWluWSAocjEpOworICAgICAgICAgIGludCB3ZDEgPSBOU1dpZHRoIChy MSk7CisgICAgICAgICAgaW50IGgxID0gTlNIZWlnaHQgKHIxKTsKKyAgICAgICAgICBmcHJpbnRm IChzdGRlcnIsICIlcyAtLSBERUFEOlxuXAorICAgICAgICAgIHgwL3gxICglZC8lZCkgfCB5MC95 MSAoJWQvJWQpIHwgd2QwL3dkMSAoJWQvJWQpIHwgaDAvaDEgKCVkLyVkKVxuIiwKKyAgICAgICAg ICBtY193aW5kb3cgKHcpLCB4MCwgeDEsIHkwLCB5MSwgd2QwLCB3ZDEsIGgwLCBoMSk7CisgICAg ICAgIH0KKyAgICAgIGlmIChbdmlldyBtY19qdWRnZV0pCiAgICAgICAgIHJlbW92ZWQgPSBZRVM7 CiAgICAgfQorICAgIGVsc2UgaWYgKFt2aWV3IGp1ZGdlXSkKKyAgICAgIHJlbW92ZWQgPSBZRVM7 CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKKyAgICB9CiAKICAgaWYgKHJlbW92ZWQp CiAgICAgW2V2aWV3IHVwZGF0ZUZyYW1lU2l6ZTogTk9dOwpAQCAtNTA3NCw2ICs2MTQ0LDIwIEBA IHN0YXRpYyBMaXNwX09iamVjdCBuc19zdHJpbmdfdG9fbGlzcG1vZCAoY29uc3QgY2hhciAqcykK IGV4dGVybiBmcmFtZV9wYXJtX2hhbmRsZXIgbnNfZnJhbWVfcGFybV9oYW5kbGVyc1tdOwogc3Rh dGljIHN0cnVjdCByZWRpc3BsYXlfaW50ZXJmYWNlIG5zX3JlZGlzcGxheV9pbnRlcmZhY2UgPQog eworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLwor CisvKiBgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYG5zdGVybS5tYCBtdXN0IGJlIGluIHRoZSBl eGFjdCBzYW1lIG9yZGVyIGFzIHRoZQorYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGBkaXNwZXh0 ZXJuLmhgISAqLworCisgIG1jX25zX2RyYXdfd2luZG93X2N1cnNvciwKKyAgbWNfbnNfZHJhd19n bHlwaF9zdHJpbmcsCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgbnNfZnJhbWVf cGFybV9oYW5kbGVycywKICAgZ3VpX3Byb2R1Y2VfZ2x5cGhzLAogICBndWlfd3JpdGVfZ2x5cGhz LApAQCAtODcxMSw2ICs5Nzk1LDQ5IEBAIC0gKEJPT0wpY2FuQmVjb21lTWFpbldpbmRvdwogCiBA aW1wbGVtZW50YXRpb24gRW1hY3NTY3JvbGxlcgogCisKKy8qICoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAq LworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCistICh2b2lkKW1jX3NldF9yZWN0YW5nbGU6IChO U1JlY3QpcmVjdAoreworICBtY19yZWN0YW5nbGUgPSByZWN0OworfQorCistIChOU1JlY3QpbWNf Z2V0X3JlY3RhbmdsZQoreworICByZXR1cm4gbWNfcmVjdGFuZ2xlOworfQorCistIChzdHJ1Y3Qg d2luZG93ICopbWNfZ2V0X3dpbmRvdworeworICByZXR1cm4gd2luZG93OworfQorCistIChib29s KW1jX2p1ZGdlCit7CisgIE5TVFJBQ0UgKCJbRW1hY3NTY3JvbGxlciBt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PTE9S KHBlLCBjb2xvcikgXAorICBkbyBcCisgICAgeyBcCisgICAgICBwZS5wZVJlZCA9IEdldFJWYWx1 ZSAoY29sb3IpOyBcCisgICAgICBwZS5wZUdyZWVuID0gR2V0R1ZhbHVlIChjb2xvcik7IFwKKyAg ICAgIHBlLnBlQmx1ZSA9IEdldEJWYWx1ZSAoY29sb3IpOyBcCisgICAgICBwZS5wZUZsYWdzID0g MDsgXAorICAgIH0gd2hpbGUgKDApCisKK3ZvaWQKK21jX3Byb2Nlc3NfcXVpdF9mbGFnICh2b2lk KQoreworICBMaXNwX09iamVjdCBmbGFnID0gVnF1aXRfZmxhZzsKKyAgVnF1aXRfZmxhZyA9IFFu aWw7CisgIGlmIChFUSAoZmxhZywgUWtpbGxfZW1hY3MpKQorICAgIEZraWxsX2VtYWNzIChRbmls KTsKKyAgaWYgKEVRIChWdGhyb3dfb25faW5wdXQsIGZsYWcpKQorICAgIEZ0aHJvdyAoVnRocm93 X29uX2lucHV0LCBRdCk7CisgIEZzaWduYWwgKFFxdWl0LCBRbmlsKTsKK30KKworI2RlZmluZSBN Q19RVUlUCQkJCQkJXAorICBkbyB7CQkJCQkJCVwKKyAgICBpZiAoIU5JTFAgKFZxdWl0X2ZsYWcp ICYmIE5JTFAgKFZpbmhpYml0X3F1aXQpKQlcCisgICAgICBtY19wcm9jZXNzX3F1aXRfZmxhZyAo KTsJCQkJXAorICAgIGVsc2UgaWYgKHBlbmRpbmdfc2lnbmFscykJCQkJXAorICAgICAgcHJvY2Vz c19wZW5kaW5nX3NpZ25hbHMgKCk7CQkJXAorICB9IHdoaWxlIChmYWxzZSkKKworc3RhdGljIExp c3BfT2JqZWN0CittY193MzJfY29sb3JfbWFwX2xvb2t1cCAoY29uc3QgY2hhciAqY29sb3JuYW1l KQoreworICBMaXNwX09iamVjdCB0YWlsLCByZXQgPSBRbmlsOworICBibG9ja19pbnB1dCAoKTsK KyAgZm9yICh0YWlsID0gVnczMl9jb2xvcl9tYXA7IENPTlNQICh0YWlsKTsgdGFpbCA9IFhDRFIg KHRhaWwpKQorICAgIHsKKyAgICAgIHJlZ2lzdGVyIExpc3BfT2JqZWN0IGVsdCwgdGVtOworICAg ICAgZWx0ID0gWENBUiAodGFpbCk7CisgICAgICBpZiAoIUNPTlNQIChlbHQpKSBjb250aW51ZTsK KyAgICAgIHRlbSA9IFhDQVIgKGVsdCk7CisgICAgICBpZiAobHN0cmNtcGkgKFNTREFUQSAodGVt KSwgY29sb3JuYW1lKSA9PSAwKQorICAgICAgICB7CisgICAgICAgICAgcmV0ID0gRmNkciAoZWx0 KTsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgTUNfUVVJVDsKKyAgICB9Cisg IHVuYmxvY2tfaW5wdXQgKCk7CisgIHJldHVybiByZXQ7Cit9CisKK3N0YXRpYyBMaXNwX09iamVj dAorbWNfeF90b193MzJfY29sb3IgKGNvbnN0IGNoYXIgKiBjb2xvcm5hbWUpCit7CisgIHJlZ2lz dGVyIExpc3BfT2JqZWN0IHJldCA9IFFuaWw7CisgIGJsb2NrX2lucHV0ICgpOworICBpZiAoY29s b3JuYW1lWzBdID09ICcjJykKKyAgICB7CisgICAgICAvKiBDb3VsZCBiZSBhbiBvbGQtc3R5bGUg UkdCIERldmljZSBzcGVjaWZpY2F0aW9uLiAqLworICAgICAgaW50IHNpemUgPSBzdHJsZW4gKGNv bG9ybmFtZSArIDEpOworICAgICAgY2hhciAqY29sb3IgPSBhbGxvY2EgKHNpemUgKyAxKTsKKyAg ICAgIHN0cmNweSAoY29sb3IsIGNvbG9ybmFtZSArIDEpOworICAgICAgaWYgKHNpemUgPT0gMyB8 fCBzaXplID09IDYgfHwgc2l6ZSA9PSA5IHx8IHNpemUgPT0gMTIpCisgICAgICAgIHsKKyAgICAg ICAgICBVSU5UIGNvbG9ydmFsOworICAgICAgICAgIGludCBpLCBwb3M7CisgICAgICAgICAgcG9z ID0gMDsKKyAgICAgICAgICBzaXplIC89IDM7CisgICAgICAgICAgY29sb3J2YWwgPSAwOworICAg ICAgICAgIGZvciAoaSA9IDA7IGkgPCAzOyBpKyspCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIGNoYXIgKmVuZDsKKyAgICAgICAgICAgICAgY2hhciB0OworICAgICAgICAgICAgICB1bnNp Z25lZCBsb25nIHZhbHVlOworICAgICAgICAgICAgICAvKiBUaGUgY2hlY2sgZm9yICd4JyBpbiB0 aGUgZm9sbG93aW5nIGNvbmRpdGlvbmFsIHRha2VzIGludG8KKyAgICAgICAgICAgICAgYWNjb3Vu dCB0aGUgZmFjdCB0aGF0IHN0cnRvbCBhbGxvd3MgYSAiMHgiIGluIGZyb250IG9mCisgICAgICAg ICAgICAgIG91ciBudW1iZXJzLCBhbmQgd2UgZG9uJ3QuICovCisgICAgICAgICAgICAgIGlmICgh aXN4ZGlnaXQgKGNvbG9yWzBdKSB8fCBjb2xvclsxXSA9PSAneCcpCisgICAgICAgICAgICAgICAg YnJlYWs7CisgICAgICAgICAgICAgIHQgPSBjb2xvcltzaXplXTsKKyAgICAgICAgICAgICAgY29s b3Jbc2l6ZV0gPSAnXDAnOworICAgICAgICAgICAgICB2YWx1ZSA9IHN0cnRvdWwgKGNvbG9yLCAm ZW5kLCAxNik7CisgICAgICAgICAgICAgIGNvbG9yW3NpemVdID0gdDsKKyAgICAgICAgICAgICAg aWYgKGVycm5vID09IEVSQU5HRSB8fCBlbmQgLSBjb2xvciAhPSBzaXplKQorICAgICAgICAgICAg ICAgIGJyZWFrOworICAgICAgICAgICAgICBzd2l0Y2ggKHNpemUpCisgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgIGNhc2UgMToKKyAgICAgICAgICAgICAgICAgIHZhbHVlID0gdmFs dWUgKiAweDEwOworICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2Fz ZSAyOgorICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSAzOgor ICAgICAgICAgICAgICAgICAgdmFsdWUgLz0gMHgxMDsKKyAgICAgICAgICAgICAgICAgIGJyZWFr OworICAgICAgICAgICAgICAgIGNhc2UgNDoKKyAgICAgICAgICAgICAgICAgIHZhbHVlIC89IDB4 MTAwOworICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAg ICAgICAgICBjb2xvcnZhbCB8PSAodmFsdWUgPDwgcG9zKTsKKyAgICAgICAgICAgICAgcG9zICs9 IDB4ODsKKyAgICAgICAgICAgICAgaWYgKGkgPT0gMikKKyAgICAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgICAgICAgICAgICAgWFNFVElO VCAocmV0LCBjb2xvcnZhbCk7CisgICAgICAgICAgICAgICAgICByZXR1cm4gcmV0OworICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgICAgY29sb3IgPSBlbmQ7CisgICAgICAgICAgICB9Cisg ICAgICAgIH0KKyAgICB9CisgIGVsc2UgaWYgKHN0cm5pY21wIChjb2xvcm5hbWUsICJyZ2I6Iiwg NCkgPT0gMCkKKyAgICB7CisgICAgICBjb25zdCBjaGFyICpjb2xvcjsKKyAgICAgIFVJTlQgY29s b3J2YWw7CisgICAgICBpbnQgaSwgcG9zOworICAgICAgcG9zID0gMDsKKyAgICAgIGNvbG9ydmFs ID0gMDsKKyAgICAgIGNvbG9yID0gY29sb3JuYW1lICsgNDsKKyAgICAgIGZvciAoaSA9IDA7IGkg PCAzOyBpKyspCisgICAgICAgIHsKKyAgICAgICAgICBjaGFyICplbmQ7CisgICAgICAgICAgdW5z aWduZWQgbG9uZyB2YWx1ZTsKKyAgICAgICAgICAvKiBUaGUgY2hlY2sgZm9yICd4JyBpbiB0aGUg Zm9sbG93aW5nIGNvbmRpdGlvbmFsIHRha2VzIGludG8KKyAgICAgICAgICAgICBhY2NvdW50IHRo ZSBmYWN0IHRoYXQgc3RydG9sIGFsbG93cyBhICIweCIgaW4gZnJvbnQgb2YKKyAgICAgICAgICAg ICBvdXIgbnVtYmVycywgYW5kIHdlIGRvbid0LiAqLworICAgICAgICAgIGlmICghaXN4ZGlnaXQg KGNvbG9yWzBdKSB8fCBjb2xvclsxXSA9PSAneCcpCisgICAgICAgICAgICBicmVhazsKKyAgICAg ICAgICB2YWx1ZSA9IHN0cnRvdWwgKGNvbG9yLCAmZW5kLCAxNik7CisgICAgICAgICAgaWYgKGVy cm5vID09IEVSQU5HRSkKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIHN3aXRjaCAoZW5k IC0gY29sb3IpCisgICAgICAgICAgICB7CisgICAgICAgICAgICBjYXNlIDE6CisgICAgICAgICAg ICAgIHZhbHVlID0gdmFsdWUgKiAweDEwICsgdmFsdWU7CisgICAgICAgICAgICAgIGJyZWFrOwor ICAgICAgICAgICAgY2FzZSAyOgorICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNh c2UgMzoKKyAgICAgICAgICAgICAgdmFsdWUgLz0gMHgxMDsKKyAgICAgICAgICAgICAgYnJlYWs7 CisgICAgICAgICAgICBjYXNlIDQ6CisgICAgICAgICAgICAgIHZhbHVlIC89IDB4MTAwOworICAg ICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgIHZh bHVlID0gVUxPTkdfTUFYOworICAgICAgICAgICAgfQorICAgICAgICAgIGlmICh2YWx1ZSA9PSBV TE9OR19NQVgpCisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBjb2xvcnZhbCB8PSAodmFs dWUgPDwgcG9zKTsKKyAgICAgICAgICBwb3MgKz0gMHg4OworICAgICAgICAgIGlmIChpID09IDIp CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmICgqZW5kICE9ICdcMCcpCisgICAgICAg ICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAg ICAgICAgIFhTRVRJTlQgKHJldCwgY29sb3J2YWwpOworICAgICAgICAgICAgICByZXR1cm4gcmV0 OworICAgICAgICAgICAgfQorICAgICAgICAgIGlmICgqZW5kICE9ICcvJykKKyAgICAgICAgICAg IGJyZWFrOworICAgICAgICAgIGNvbG9yID0gZW5kICsgMTsKKyAgICAgICAgfQorICAgIH0KKyAg ICBlbHNlIGlmIChzdHJuaWNtcCAoY29sb3JuYW1lLCAicmdiaToiLCA1KSA9PSAwKQorICAgICAg eworICAgICAgICAvKiBUaGlzIGlzIGFuIFJHQiBJbnRlbnNpdHkgc3BlY2lmaWNhdGlvbi4gKi8K KyAgICAgICAgY29uc3QgY2hhciAqY29sb3I7CisgICAgICAgIFVJTlQgY29sb3J2YWw7CisgICAg ICAgIGludCBpLCBwb3M7CisgICAgICAgIHBvcyA9IDA7CisgICAgICAgIGNvbG9ydmFsID0gMDsK KyAgICAgICAgY29sb3IgPSBjb2xvcm5hbWUgKyA1OworICAgICAgICBmb3IgKGkgPSAwOyBpIDwg MzsgaSsrKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGNoYXIgKmVuZDsKKyAgICAgICAgICAg IGRvdWJsZSB2YWx1ZTsKKyAgICAgICAgICAgIFVJTlQgdmFsOworICAgICAgICAgICAgdmFsdWUg PSBzdHJ0b2QgKGNvbG9yLCAmZW5kKTsKKyAgICAgICAgICAgIGlmIChlcnJubyA9PSBFUkFOR0Up CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgaWYgKHZhbHVlIDwgMC4wIHx8IHZh bHVlID4gMS4wKQorICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIHZhbCA9IChVSU5U KSgweDEwMCAqIHZhbHVlKTsKKyAgICAgICAgICAgIC8qIFdlIHVzZWQgMHgxMDAgaW5zdGVhZCBv ZiAweEZGIHRvIGdpdmUgYSBjb250aW51b3VzCisgICAgICAgICAgICAgICByYW5nZSBiZXR3ZWVu IDAuMCBhbmQgMS4wIGluY2x1c2l2ZS4gIFRoZSBuZXh0IHN0YXRlbWVudAorICAgICAgICAgICAg ICAgZml4ZXMgdGhlIDEuMCBjYXNlLiAqLworICAgICAgICAgICAgaWYgKHZhbCA9PSAweDEwMCkK KyAgICAgICAgICAgICAgdmFsID0gMHhGRjsKKyAgICAgICAgICAgIGNvbG9ydmFsIHw9ICh2YWwg PDwgcG9zKTsKKyAgICAgICAgICAgIHBvcyArPSAweDg7CisgICAgICAgICAgICBpZiAoaSA9PSAy KQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKCplbmQgIT0gJ1wwJykKKyAg ICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIHVuYmxvY2tfaW5wdXQgKCk7 CisgICAgICAgICAgICAgICAgWFNFVElOVCAocmV0LCBjb2xvcnZhbCk7CisgICAgICAgICAgICAg ICAgcmV0dXJuIHJldDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKCplbmQgIT0g Jy8nKQorICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNvbG9yID0gZW5kICsgMTsK KyAgICAgICAgICB9CisgICAgICB9CisgIC8qIEkgYW0gbm90IGdvaW5nIHRvIGF0dGVtcHQgdG8g aGFuZGxlIGFueSBvZiB0aGUgQ0lFIGNvbG9yIHNjaGVtZXMKKyAgICAgb3IgVGVrSFZDLCBzaW5j ZSBJIGRvbid0IGtub3cgdGhlIGFsZ29yaXRobXMgZm9yIGNvbnZlcnNpb24gdG8gUkdCLgorICAg ICBJZiB3ZSBmYWlsIHRvIGxvb2t1cCB0aGUgY29sb3IgbmFtZSBpbiB3MzJfY29sb3JfbWFwLCB0 aGVuIGNoZWNrIHRoZQorICAgICBjb2xvcm5hbWUgdG8gc2VlIGlmIGl0IGNhbiBiZSBjcnVkZWx5 IGFwcHJveGltYXRlZDogSWYgdGhlIFggY29sb3IKKyAgICAgZW5kcyBpbiBhIG51bWJlciAoZS5n LiwgImRhcmtzZWFncmVlbjIiKSwgc3RyaXAgdGhlIG51bWJlciBhbmQKKyAgICAgcmV0dXJuIHRo ZSByZXN1bHQgb2YgbG9va2luZyB1cCB0aGUgYmFzZSBjb2xvciBuYW1lLiAqLworICByZXQgPSBt Y193MzJfY29sb3JfbWFwX2xvb2t1cCAoY29sb3JuYW1lKTsKKyAgaWYgKE5JTFAgKHJldCkpCisg ICAgeworICAgICAgaW50IGxlbiA9IHN0cmxlbiAoY29sb3JuYW1lKTsKKyAgICAgIGlmIChpc2Rp Z2l0IChjb2xvcm5hbWVbbGVuIC0gMV0pKQorICAgICAgICB7CisgICAgICAgICAgY2hhciAqcHRy LCAqYXBwcm94ID0gYWxsb2NhIChsZW4gKyAxKTsKKyAgICAgICAgICBzdHJjcHkgKGFwcHJveCwg Y29sb3JuYW1lKTsKKyAgICAgICAgICBwdHIgPSAmYXBwcm94W2xlbiAtIDFdOworICAgICAgICAg IHdoaWxlIChwdHIgPiBhcHByb3ggJiYgaXNkaWdpdCAoKnB0cikpCisgICAgICAgICAgICAqcHRy LS0gPSAnXDAnOworICAgICAgICAgIHJldCA9IG1jX3czMl9jb2xvcl9tYXBfbG9va3VwIChhcHBy b3gpOworICAgICAgICB9CisgICAgfQorICB1bmJsb2NrX2lucHV0ICgpOworICByZXR1cm4gcmV0 OworfQorCisvKiBEZWNpZGUgaWYgY29sb3IgbmFtZWQgQ09MT1IgaXMgdmFsaWQgZm9yIHRoZSBk aXNwbGF5IGFzc29jaWF0ZWQgd2l0aAorICAgdGhlIHNlbGVjdGVkIGZyYW1lOyBpZiBzbywgcmV0 dXJuIHRoZSByZ2IgdmFsdWVzIGluIENPTE9SX0RFRi4KKyAgIElmIEFMTE9DIGlzIG5vbnplcm8s IGFsbG9jYXRlIGEgbmV3IGNvbG9ybWFwIGNlbGwuICovCitpbnQKK21jX3czMl9kZWZpbmVkX2Nv bG9yIChzdHJ1Y3QgZnJhbWUgKmYsIGNvbnN0IGNoYXIgKmNvbG9yLCBtY19YQ29sb3IgKmNvbG9y X2RlZiwgYm9vbCBhbGxvY19wKQoreworICByZWdpc3RlciBMaXNwX09iamVjdCB0ZW07CisgIENP TE9SUkVGIHczMl9jb2xvcl9yZWY7CisgIHRlbSA9IG1jX3hfdG9fdzMyX2NvbG9yIChjb2xvcik7 CisgIGlmICghTklMUCAodGVtKSkKKyAgICB7CisgICAgICBpZiAoZikKKyAgICAgICAgeworICAg ICAgICAgIC8qIEFwcGx5IGdhbW1hIGNvcnJlY3Rpb24uICovCisgICAgICAgICAgdzMyX2NvbG9y X3JlZiA9IFhVRklYTlVNX1JBVyAodGVtKTsKKyAgICAgICAgICBnYW1tYV9jb3JyZWN0IChmLCAm dzMyX2NvbG9yX3JlZik7CisgICAgICAgICAgWFNFVElOVCAodGVtLCB3MzJfY29sb3JfcmVmKTsK KyAgICAgICAgfQorICAgICAgLyogTWFwIHRoaXMgY29sb3IgdG8gdGhlIHBhbGV0dGUgaWYgaXQg aXMgZW5hYmxlZC4gKi8KKyAgICAgIGlmICghTklMUCAoVnczMl9lbmFibGVfcGFsZXR0ZSkpCisg ICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgdzMyX3BhbGV0dGVfZW50cnkgKiBlbnRyeSA9IG9u ZV93MzJfZGlzcGxheV9pbmZvLmNvbG9yX2xpc3Q7CisgICAgICAgICAgc3RydWN0IHczMl9wYWxl dHRlX2VudHJ5ICoqIHByZXYgPSAmb25lX3czMl9kaXNwbGF5X2luZm8uY29sb3JfbGlzdDsKKyAg ICAgICAgICAvKiBjaGVjayBpZiBjb2xvciBpcyBhbHJlYWR5IG1hcHBlZCAqLworICAgICAgICAg IHdoaWxlIChlbnRyeSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKE1DX1czMl9D T0xPUiAoZW50cnktPmVudHJ5KSA9PSBYVUZJWE5VTV9SQVcgKHRlbSkpCisgICAgICAgICAgICAg ICAgYnJlYWs7CisgICAgICAgICAgICAgIHByZXYgPSAmZW50cnktPm5leHQ7CisgICAgICAgICAg ICAgIGVudHJ5ID0gZW50cnktPm5leHQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgaWYgKGVu dHJ5ID09IE5VTEwgJiYgYWxsb2NfcCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgLyog bm90IGFscmVhZHkgbWFwcGVkLCBzbyBhZGQgdG8gbGlzdCAqLworICAgICAgICAgICAgICBlbnRy eSA9IHhtYWxsb2MgKHNpemVvZiAoc3RydWN0IHczMl9wYWxldHRlX2VudHJ5KSk7CisgICAgICAg ICAgICAgIE1DX1czMl9TRVRfQ09MT1IgKGVudHJ5LT5lbnRyeSwgWFVGSVhOVU1fUkFXICh0ZW0p KTsKKyAgICAgICAgICAgICAgZW50cnktPm5leHQgPSBOVUxMOworICAgICAgICAgICAgICAqcHJl diA9IGVudHJ5OworICAgICAgICAgICAgICBvbmVfdzMyX2Rpc3BsYXlfaW5mby5udW1fY29sb3Jz Kys7CisgICAgICAgICAgICAgIC8qIHNldCBmbGFnIHRoYXQgcGFsZXR0ZSBtdXN0IGJlIHJlZ2Vu ZXJhdGVkICovCisgICAgICAgICAgICAgIG9uZV93MzJfZGlzcGxheV9pbmZvLnJlZ2VuX3BhbGV0 dGUgPSBUUlVFOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAvKiBFbnN1cmUgQ09M T1JSRUYgdmFsdWUgaXMgc25hcHBlZCB0byBuZWFyZXN0IGNvbG9yIGluIChkZWZhdWx0KQorICAg ICAgICAgcGFsZXR0ZSBieSBzaW11bGF0aW5nIHRoZSBQQUxFVFRFUkdCIG1hY3JvLiAgVGhpcyB3 b3JrcyB3aGV0aGVyCisgICAgICAgICBvciBub3QgdGhlIGRpc3BsYXkgZGV2aWNlIGhhcyBhIHBh bGV0dGUuICovCisgICAgICB3MzJfY29sb3JfcmVmID0gWFVGSVhOVU1fUkFXICh0ZW0pIHwgMHgy MDAwMDAwOworICAgICAgY29sb3JfZGVmLT5waXhlbCA9IHczMl9jb2xvcl9yZWY7CisgICAgICBj b2xvcl9kZWYtPnJl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A9IC0xLjA7CisgICAgICAgIGxz bC0+Ymx1ZSA9IC0xLjA7CisgICAgICB9Cit9CisKKy8qIERyYXcgc3RyZXRjaCBnbHlwaCBzdHJp bmcgUy4gKi8KK3N0YXRpYyB2b2lkCittY193MzJfZHJhd19zdHJldGNoX2dseXBoX3N0cmluZyAo c3RydWN0IGdseXBoX3N0cmluZyAqcykKK3sKKyAgZWFzc2VydCAocy0+Zmlyc3RfZ2x5cGgtPnR5 cGUgPT0gU1RSRVRDSF9HTFlQSCk7CisgIGlmIChzLT5obCA9PSBEUkFXX0NVUlNPUgorICAgICAg JiYgIXhfc3RyZXRjaF9jdXJzb3JfcCkKKyAgICB7CisgICAgICAvKiBJZiBgeC1zdHJldGNoLWN1 cnNvcicgaXMgbmlsLCBkb24ndCBkcmF3IGEgYmxvY2sgY3Vyc29yIGFzIHdpZGUgYXMgdGhlCisg ICAgICBzdHJldGNoIGdseXBoLiAqLworICAgICAgaW50IHdpZHRoLCBiYWNrZ3JvdW5kX3dpZHRo ID0gcy0+YmFja2dyb3VuZF93aWR0aDsKKyAgICAgIGludCB4ID0gcy0+eDsKKyAgICAgIGlmICgh cy0+cm93LT5yZXZlcnNlZF9wKQorICAgICAgICB7CisgICAgICAgICAgaW50IGxlZnRfeCA9IHdp bmRvd19ib3hfbGVmdF9vZmZzZXQgKHMtPncsIFRFWFRfQVJFQSk7CisgICAgICAgICAgaWYgKHgg PCBsZWZ0X3gpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGJhY2tncm91bmRfd2lkdGgg LT0gbGVmdF94IC0geDsKKyAgICAgICAgICAgICAgeCA9IGxlZnRfeDsKKyAgICAgICAgICAgIH0K KyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICB7CisgICAgICAgICAgIC8qIEluIFIy TCByb3dzLCBkcmF3IHRoZSBjdXJzb3Igb24gdGhlIHJpZ2h0IGVkZ2Ugb2YgdGhlCisgICAgICAg ICAgICAgIHN0cmV0Y2ggZ2x5cGguICovCisgICAgICAgICAgIGludCByaWdodF94ID0gd2luZG93 X2JveF9yaWdodCAocy0+dywgVEVYVF9BUkVBKTsKKyAgICAgICAgICAgaWYgKHggKyBiYWNrZ3Jv dW5kX3dpZHRoID4gcmlnaHRfeCkKKyAgICAgICAgICAgICBiYWNrZ3JvdW5kX3dpZHRoIC09IHgg LSByaWdodF94OworICAgICAgICAgICB4ICs9IGJhY2tncm91bmRfd2lkdGg7CisgICAgICAgICB9 CisgICAgICB3aWR0aCA9IG1pbiAoRlJBTUVfQ09MVU1OX1dJRFRIIChzLT5mKSwgYmFja2dyb3Vu ZF93aWR0aCk7CisgICAgICBpZiAocy0+cm93LT5yZXZlcnNlZF9wKQorICAgICAgICB4IC09IHdp ZHRoOworICAgICAgLyogRHJhdyBjdXJzb3IuICovCisgICAgICB3MzJfZHJhd19nbHlwaF9zdHJp bmdfYmdfcmVjdCAocywgeCwgcy0+eSwgd2lkdGgsIHMtPmhlaWdodCk7CisgICAgICAvKiBDbGVh ciByZXN0IHVzaW5nIHRoZSBHQyBvZiB0aGUgb3JpZ2luYWwgbm9uLWN1cnNvciBmYWNlLiAqLwor ICAgICAgaWYgKHdpZHRoIDwgYmFja2dyb3VuZF93aWR0aCkKKyAgICAgICAgeworICAgICAgICAg IEVtYWNzX0dDICpnYyA9IHMtPmZhY2UtPmdjOworICAgICAgICAgIGludCB5ID0gcy0+eTsKKyAg ICAgICAgICBpbnQgdyA9IGJhY2tncm91bmRfd2lkdGggLSB3aWR0aCwgaCA9IHMtPmhlaWdodDsK KyAgICAgICAgICBSRUNUIHI7CisgICAgICAgICAgSERDIGhkYyA9IHMtPmhkYzsKKyAgICAgICAg ICBpZiAoIXMtPnJvdy0+cmV2ZXJzZWRfcCkKKyAgICAgICAgICAgIHggKz0gd2lkdGg7CisgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHggPSBzLT54OworICAgICAgICAgIGlmIChzLT5y b3ctPm1vdXNlX2ZhY2VfcAorICAgICAgICAgICAgICAmJiBjdXJzb3JfaW5fbW91c2VfZmFjZV9w IChzLT53KSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgdzMyX3NldF9tb3VzZV9mYWNl X2djIChzKTsKKyAgICAgICAgICAgICAgZ2MgPSBzLT5nYzsKKyAgICAgICAgICAgIH0KKyAgICAg ICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgZ2MgPSBzLT5mYWNlLT5nYzsKKyAgICAgICAgICBn ZXRfZ2x5cGhfc3RyaW5nX2NsaXBfcmVjdCAocywgJnIpOworICAgICAgICAgIHczMl9zZXRfY2xp cF9yZWN0YW5nbGUgKGhkYywgJnIpOworI2lmIDAgLyogVE9ETzogc3RpcHBsZSAqLworICAgICAg ICAgIGlmIChzLT5mYWNlLT5zdGlwcGxlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAv KiBGaWxsIGJhY2tncm91bmQgd2l0aCBhIHN0aXBwbGUgcGF0dGVybi4gKi8KKyAgICAgICAgICAg ICAgWFNldEZpbGxTdHlsZSAocy0+ZGlzcGxheSwgZ2MsIEZpbGxPcGFxdWVTdGlwcGxlZCk7Cisg ICAgICAgICAgICAgIFhGaWxsUmVjdGFuZ2xlIChzLT5kaXNwbGF5LCBzLT53aW5kb3csIGdjLCB4 LCB5LCB3LCBoKTsKKyAgICAgICAgICAgICAgWFNldEZpbGxTdHlsZSAocy0+ZGlzcGxheSwgZ2Ms IEZpbGxTb2xpZCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisjZW5kaWYKKyAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhk YywgZ2MtPmJhY2tncm91bmQsIHgsIHksIHcsIGgpOworICAgICAgICAgICAgICB9CisgICAgICAg IH0KKyAgICB9CisgICAgZWxzZSBpZiAoIXMtPmJhY2tncm91bmRfZmlsbGVkX3ApCisgICAgICB7 CisgICAgICAgIGludCBiYWNrZ3JvdW5kX3dpZHRoID0gcy0+YmFja2dyb3VuZF93aWR0aDsKKyAg ICAgICAgaW50IHggPSBzLT54LCBsZWZ0X3ggPSB3aW5kb3dfYm94X2xlZnRfb2Zmc2V0IChzLT53 LCBURVhUX0FSRUEpOworICAgICAgICAvKiBEb24ndCBkcmF3IGludG8gbGVmdCBtYXJnaW4sIGZy aW5nZSBvciBzY3JvbGxiYXIgYXJlYQorICAgICAgICAgICBleGNlcHQgZm9yIGhlYWRlciBsaW5l IGFuZCBtb2RlIGxpbmUuICovCisgICAgICAgIGlmICh4IDwgbGVmdF94ICYmICFzLT5yb3ctPm1v ZGVfbGluZV9wKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGJhY2tncm91bmRfd2lkdGggLT0g bGVmdF94IC0geDsKKyAgICAgICAgICAgIHggPSBsZWZ0X3g7CisgICAgICAgICAgfQorICAgICAg ICBpZiAoYmFja2dyb3VuZF93aWR0aCA+IDApCisgICAgICAgICAgdzMyX2RyYXdfZ2x5cGhfc3Ry aW5nX2JnX3JlY3QgKHMsIHgsIHMtPnksIGJhY2tncm91bmRfd2lkdGgsIHMtPmhlaWdodCk7Cisg ICAgICB9CisgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVlOworfQorCisvKiBTZXQgUy0+ Z2MgdG8gYSBzdWl0YWJsZSBHQyBmb3IgZHJhd2luZyBnbHlwaCBzdHJpbmcgUyBpbiBjdXJzb3IK KyAgIGZhY2UuICovCitzdGF0aWMgdm9pZAorbWNfdzMyX3NldF9jdXJzb3JfZ2MgKHN0cnVjdCBn bHlwaF9zdHJpbmcgKnMsIGJvb2wgY3Vyc29yX2djX3ApCit7CisgIGlmIChjdXJzb3JfZ2NfcCkK KyAgICB7CisgICAgICBzLT5nYyA9IHMtPmYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djOwor ICAgICAgcmV0dXJuOworICAgIH0KKyAgaWYgKHMtPmZvbnQgPT0gRlJBTUVfRk9OVCAocy0+ZikK KyAgICAgICYmIHMtPmZh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gPT0gRFJBV19DVVJTT1IpCisgICAgICAgIHsKKyAgICAgICAgICBtY193 MzJfc2V0X2N1cnNvcl9nYyAocywgY3Vyc29yX2djX3ApOworICAgICAgICAgIHMtPnN0aXBwbGVk X3AgPSBmYWxzZTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChzLT5obCA9PSBEUkFXX01P VVNFX0ZBQ0UpCisgICAgICAgICAgeworICAgICAgICAgICAgdzMyX3NldF9tb3VzZV9mYWNlX2dj IChzKTsKKyAgICAgICAgICAgIHMtPnN0aXBwbGVkX3AgPSBzLT5mYWNlLT5zdGlwcGxlICE9IDA7 CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYgKHMtPmhsID09IERSQVdfSU1BR0VfUkFJ U0VECisgICAgICAgICAgICAgICAgICAgfHwgcy0+aGwgPT0gRFJBV19JTUFHRV9TVU5LRU4pCisg ICAgICAgICAgICB7CisgICAgICAgICAgICAgIHMtPmdjID0gcy0+ZmFjZS0+Z2M7CisgICAgICAg ICAgICAgIHMtPnN0aXBwbGVkX3AgPSBzLT5mYWNlLT5zdGlwcGxlICE9IDA7CisgICAgICAgICAg ICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIGVtYWNzX2Fib3J0ICgpOworICAv KiBHQyBtdXN0IGhhdmUgYmVlbiBzZXQuICovCisgIGVhc3NlcnQgKHMtPmdjICE9IDApOworfQor CisvKiBEcmF3IGEgaG9sbG93IGJveCBjdXJzb3Igb24gd2luZG93IFcgaW4gZ2x5cGggcm93IFJP Vy4gKi8KK3N0YXRpYyB2b2lkCittY193MzJfZHJhd19ob2xsb3dfY3Vyc29yIChzdHJ1Y3Qgd2lu ZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csIGludCB4LCBpbnQgZngsIGludCB5LCBpbnQg ZnksCisgICAgICAgICAgICAg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jOworICAgICAgICAvKiBJ ZiB0aGUgZ2x5cGgncyBiYWNrZ3JvdW5kIGVxdWFscyB0aGUgY29sb3Igd2Ugbm9ybWFsbHkgZHJh dworICAgICAgICB0aGUgYmFyIGN1cnNvciBpbiwgdGhlIGJhciBjdXJzb3IgaW4gaXRzIG5vcm1h bCBjb2xvciBpcworICAgICAgICBpbnZpc2libGUuICBVc2UgdGhlIGdseXBoJ3MgZm9yZWdyb3Vu ZCBjb2xvciBpbnN0ZWFkIGluIHRoaXMKKyAgICAgICAgY2FzZSwgb24gdGhlIGFzc3VtcHRpb24g dGhhdCB0aGUgZ2x5cGgncyBjb2xvcnMgYXJlIGNob3NlbiBzbworICAgICAgICB0aGF0IHRoZSBn bHlwaCBpcyBsZWdpYmxlLiAqLworICAgICAgICBpZiAoZmFjZS0+YmFja2dyb3VuZCA9PSBjdXJz b3JfY29sb3IKKyAgICAgICAgICAgICYmICFjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCkKKyAg ICAgICAgICBjdXJzb3JfY29sb3IgPSBmYWNlLT5mb3JlZ3JvdW5kOworICAgICAgICBpbnQgZGVm YXVsdF9meCA9IFdJTkRPV19URVhUX1RPX0ZSQU1FX1BJWEVMX1ggKHcsIHgpOworICAgICAgICBo ZGMgPSBnZXRfZnJhbWVfZGMgKGYpOworICAgICAgICB3MzJfY2xpcF90b19yb3cgKHcsIHJvdywg VEVYVF9BUkVBLCBoZGMpOworICAgICAgICBpbnQgcnggPSBmeDsKKyAgICAgICAgaW50IHJ5ID0g Znk7CisgICAgICAgIGludCBydyA9IHdkOworICAgICAgICBpbnQgcmggPSBoOworICAgICAgICAv LyAgZnByaW50ZiAoc3RkZXJyLCAiTUNfSEJBUjogIGZ4ICglZCkgfCBmeSAoJWQpIHwgd2QgKCVk KSB8IGggKCVkKVxuIiwKKyAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgcngsIHJ5LCBydywg cmgpOworICAgICAgICB3MzJfZmlsbF9hcmVhIChmLCBoZ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NRSAodykpOworICAgICAgICAgIEhXTkQgaHduZCA9IEZSQU1FX1czMl9XSU5ET1cg KGYpOworICAgICAgICAgIHczMl9zeXN0ZW1fY2FyZXRfeAorICAgICAgICAgICAgPSBXSU5ET1df VEVYVF9UT19GUkFNRV9QSVhFTF9YICh3LCB4KTsKKyAgICAgICAgICAvKiBGSVhNRTogIFdoYXQg c2hvdWxkIHdlIHVzZSBpbnN0ZWFkIG9mIGB3LT5waHlzX2N1cnNvcl9hc2NlbnQnPyAqLworICAg ICAgICAgIHczMl9zeXN0ZW1fY2FyZXRfeQorICAgICAgICAgICAgPSAoV0lORE9XX1RPX0ZSQU1F X1BJWEVMX1kgKHcsIHkpCisgICAgICAgICAgICAgICArIHJvdy0+YXNjZW50IC0gdy0+cGh5c19j dXJzb3JfYXNjZW50KTsKKyAgICAgICAgICB3MzJfc3lzdGVtX2NhcmV0X3dpbmRvdyA9IHc7Cisg ICAgICAgICAgdzMyX3N5c3RlbV9jYXJldF9oZHJfaGVpZ2h0ID0gV0lORE9XX0hFQURFUl9MSU5F X0hFSUdIVCAodyk7CisgICAgICAgICAgdzMyX3N5c3RlbV9jYXJldF9tb2RlX2hlaWdodCA9IFdJ TkRPV19NT0RFX0xJTkVfSEVJR0hUICh3KTsKKyAgICAgICAgICBQb3N0TWVzc2FnZSAoaHduZCwg V01fSU1FX1NUQVJUQ09NUE9TSVRJT04sIDAsIDApOworICAgICAgICAgIC8qIElmIHRoZSBzaXpl IG9mIHRoZSBhY3RpdmUgY3Vyc29yIGNoYW5nZWQsIGRlc3Ryb3kgdGhlIG9sZAorICAgICAgICAg ICAgIHN5c3RlbSBjYXJldC4gKi8KKyAgICAgICAgICBpZiAodzMyX3N5c3RlbV9jYXJldF9od25k CisgICAgICAgICAgICAgICYmICh3MzJfc3lzdGVtX2NhcmV0X2hlaWdodCAhPSBoKSkKKyAgICAg ICAgICAgIFBvc3RNZXNzYWdlIChod25kLCBXTV9FTUFDU19ERVNUUk9ZX0NBUkVULCAwL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AgICAgICAgICAgICAgZ2NfdmFsdWVzLmZvcmVncm91bmQgPSBob2xsb3dfYWN0 aXZlX2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5iYWNr Z3JvdW5kID0gaG9sbG93X2FjdGl2ZV9mYWNlLT5iYWNrZ3JvdW5kOworICAgICAgICAgICAgICAg ICAgfQorICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoIWFjdGl2ZV9wKQorICAgICAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19pbmFj dGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1m YWtlLWN1cnNvci1pbmFjdGl2ZS1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAg ICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2luYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQg KGYsIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAgICBnY192 YWx1ZXMuZm9yZWdyb3VuZCA9IGhvbGxvd19pbmFjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kOworICAg ICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5iYWNrZ3JvdW5kID0gaG9sbG93X2luYWN0aXZl X2ZhY2UtPmJhY2tncm91bmQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICBmLT5v dXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYyA9IFhDcmVhdGVHQyAoTlVMTCwgRlJBTUVfVzMyX1dJ TkRPVyAoZiksIG1hc2ssICZnY192YWx1ZXMpOworICAgICAgICAgIGJsb2NrX2lucHV0ICgpOwor ICAgICAgICAgIC8qIEZvcmNlIGBtY193MzJfc2V0X2N1cnNvcl9nYycgdG8gdXNlIGBzLT5mLT5v dXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYycuICovCisgICAgICAgICAgYm9vbCBjdXJzb3JfZ2Nf cCA9IHRydWU7CisgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93 LCBEUkFXX0NVUlNPUiwgeCwgaHBvcywgdnBvcywgbHNsLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBlLCB3ZCwgYWN0aXZlX3AsIGN1cnNv cl9nY19wKTsKKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9nYyA9IG9yaWdp bmFsX2N1cnNvcl9nYzsKKyAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgICAgIC8q IFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwnLiAq LworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gY29sb3JfcGl4 ZWw7CisgICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3cs IHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgIGYtPm91dHB1dF9k YXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9 CisgICAgICAgIGVsc2UgaWYgKGN1cnNvcl9nbHlwaC0+dHlwZSA9PSBJTUFHRV9HTFlQSCAmJiBs c2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAg ICB7CisgICAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLncz Mi0+Y3Vyc29yX3BpeGVsJy4gKi8KKyAgICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vy c29yX3BpeGVsID0gY29sb3JfcGl4ZWw7CisgICAgICAgICAgICBtY193MzJfZHJhd19ob2xsb3df Y3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7 CisgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFs X2N1cnNvcl9waXhlbDsKKyAgICAgICAgICB9CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAg eworICAgICAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1dF9kYXRhLncz Mi0+Y3Vyc29yX2djJyBieSBib3Jyb3dpbmcgdGhlCisgICAgICAgICAgICAgIGZ1bmN0aW9uYWxp dHkgb2YgYHhfbWFrZV9nYycgaW4gdzMyZm5zLmMuICovCisgICAgICAgICAgICAgIGlmIChyZWdp b25fYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9wCisgICAgICAgICAgICAg ICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3MgPT0gcmVnaW9uX2JlZykKKyAgICAgICAgICAg ICAgICB7CisgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9yZWdp b25fYmVnX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZWFs LWZha2UtY3Vyc29yLWF0LXJlZ2lvbi1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAg ICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9iZWdfZmFjZSA9IEZBQ0Vf RlJPTV9JRCAoZiwgaG9sbG93X2FjdGl2ZV9yZWdpb25fYmVnX2ZhY2VfaWQpOworICAgICAgICAg ICAgICAgICAgZW51bSBmYWN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ICAgIGVu dW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywg ZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOworICAg ICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2FjdGl2ZV9mYWNlID0gRkFDRV9G Uk9NX0lEIChmLCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQpOworICAgICAgICAgICAgICAgICAgICBn Y192YWx1ZXMuZm9yZWdyb3VuZCA9IGhvbGxvd19hY3RpdmVfZmFjZS0+Zm9yZWdyb3VuZDsKKyAg ICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tncm91bmQgPSBob2xsb3dfYWN0aXZlX3Jl Z2lvbl9lbmRfZmFjZS0+YmFja2dyb3VuZDsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgICAgICAgIGVsc2UgaWYgKHJlZ2lvbl9hY3RpdmVfcAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9n bHlwaC0+Y2hhcnBvcyA+IHJlZ2lvbl9iZWcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IGN1cnNvcl9nbHlwaC0+Y2hhcnBvcyA8IHJlZ2lvbl9lbmQpCisgICAgICAgICAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9yZWdp b25fYmV0d2Vlbl9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIist cmVhbC1mYWtlLWN1cnNvci1pbi1yZWdpb24tcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAg ICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxv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gICAgICAgIGdjX3ZhbHVlcy5mb3JlZ3JvdW5kID0gaG9sbG93X2FjdGl2ZV9m YWNlLT5mb3JlZ3JvdW5kOworICAgICAgICAgICAgICAgICAgICAgICAgZ2NfdmFsdWVzLmJhY2tn cm91bmQgPSBob2xsb3dfYWN0aXZlX2ZhY2UtPmJhY2tncm91bmQ7CisgICAgICAgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKCFhY3RpdmVfcCkKKyAgICAg ICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBmYWNl X2lkIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGlu dGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1pbmFjdGl2ZS1wcmUtenYtZmFjZSIpLCB0cnVlKTsK KyAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19pbmFjdGl2ZV9m YWNlID0gRkFDRV9GUk9NX0lEIChmLCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCk7CisgICAgICAg ICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5mb3JlZ3JvdW5kID0gaG9sbG93X2luYWN0aXZl X2ZhY2UtPmZvcmVncm91bmQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGdjX3ZhbHVlcy5i YWNrZ3JvdW5kID0gaG9sbG93X2luYWN0aXZlX2ZhY2UtPmJhY2tncm91bmQ7CisgICAgICAgICAg ICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29y X2djID0gWENyZWF0ZUdDIChOVUxMLCBGUkFNRV9XMzJfV0lORE9XIChmKSwgbWFzaywgJmdjX3Zh bHVlcyk7CisgICAgICAgICAgICAgIGJsb2NrX2lucHV0ICgpOworICAgICAgICAgICAgICAvKiBG b3JjZSBgbWNfdzMyX3NldF9jdXJzb3JfZ2MnIHRvIHVzZSBgcy0+Zi0+b3V0cHV0X2RhdGEudzMy LT5jdXJzb3JfZ2MnLiAqLworICAgICAgICAgICAgICBib29sIGN1cnNvcl9nY19wID0gdHJ1ZTsK KyAgICAgICAgICAgICAgbWNfZHJhd19jdXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBEUkFX X0NVUlNPUiwgeCwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGxzbCwgZ2x5cGhfZmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9wLCBjdXJzb3Jf Z2NfcCk7CisgICAgICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djID0gb3Jp Z2luYWxfY3Vyc29yX2djOworICAgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAg ICAgICAgICBtY193MzJfZHJhd19ob2xsb3dfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngs IHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7CisgICAgICAgICAgICB9CisgICAgICBicmVhazsK KyAgICB9CisgICAgY2FzZSBNQ19IT0xMT1dfQk9YOgorICAgIHsKKyAgICAgIGlmIChsc2wucmVk ID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAgeworICAg ICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3Jf cGl4ZWwnLiAqLworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0g Y29sb3JfcGl4ZWw7CisgICAgICAgICAgbWNfdzMyX2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0 cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgIGYt Pm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVsOwor ICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICBtY193MzJfZHJhd19ob2xsb3dfY3Vy c29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCk7Cisg ICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBNQ19GSUxMRURfQk9YOgorICAgIHsKKyAgICAg IGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAg ICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEu dzMyLT5jdXJzb3JfZ2MnIGJ5IGJvcnJvd2luZyB0aGUKKyAgICAgICAgICBmdW5jdGlvbmFsaXR5 IG9mIGB4X21ha2VfZ2MnIGluIHczMmZucy5jLiAqLworICAgICAgICAgIGJsb2NrX2lucHV0ICgp OworICAgICAgICAgIEVtYWNzX0dDIGdjX3ZhbHVlczsKKyAgICAgICAgICB1bnNpZ25lZCBsb25n IG1hc2sgPSBHQ0ZvcmVncm91bmQgfCBHQ0JhY2tncm91bmQ7CisgICAgICAgICAgZ2NfdmFsdWVz LmZvcmVncm91bmQgPSBGUkFNRV9CQUNLR1JPVU5EX1BJWEVMIChmKTsKKyAgICAgICAgICBnY192 YWx1ZXMuYmFja2dyb3VuZCA9IGNvbG9yX3BpeGVsOworICAgICAgICAgIGYtPm91dHB1dF9kYXRh LnczMi0+Y3Vyc29yX2djID0gWENyZWF0ZUdDIChOVUxMLCBGUkFNRV9XMzJfV0lORE9XIChmKSwg bWFzaywgJmdjX3ZhbHVlcyk7CisgICAgICAgICAgLyogRm9yY2UgYG1jX3czMl9zZXRfY3Vyc29y X2djJyB0byB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX2djJy4gKi8KKyAgICAg ICAgICBib29sIGN1cnNvcl9nY19wID0gdHJ1ZTsKKyAgICAgICAgICBtY19kcmF3X2N1cnNvcl9n bHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4LCBocG9zLCB2cG9zLCBsc2wsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUs IHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLncz Mi0+Y3Vyc29yX2djID0gb3JpZ2luYWxfY3Vyc29yX2djOworICAgICAgICAgIHVuYmxvY2tfaW5w dXQgKCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAg IGJvb2wgY3Vyc29yX2djX3AgPSBmYWxzZTsKKyAgICAgICAgICAgIG1jX2RyYXdfY3Vyc29yX2ds eXBoICh3LCBtYXRyaXgsIHJvdywgRFJBV19DVVJTT1IsIHgsIGhwb3MsIHZwb3MsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNsLCBnbHlwaF9mbGF2b3IsIGN1cnNvcl90eXBl LCB3ZCwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29y X2djX3ApOworICAgICAgICAgIH0KKyAgICAgIGJyZWFrOworICAgIH0KKyAgICBjYXNlIE1DX0JB UjoKKyAgICB7CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxz bC5ibHVlID49IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sg YGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsJy4gKi8KKyAgICAgICAgICBmLT5vdXRw dXRfZGF0YS53MzItPmN1cnNvcl9waXhlbCA9IGNvbG9yX3BpeGVsOworICAgICAgICAgIGJvb2wg Y3Vyc29yX2djX2ludmlzaWJsZV9va2F5X3AgPSB0cnVlOworICAgICAgICAgIG1jX3czMl9kcmF3 X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdk LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGgsIGN1cnNvcl93aWR0aCwgTUNf QkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCk7CisgICAgICAgICAgZi0+b3V0cHV0X2Rh dGEudzMyLT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJzb3JfcGl4ZWw7CisgICAgICAgIH0K KyAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIGJvb2wgY3Vyc29yX2djX2lu dmlzaWJsZV9va2F5X3AgPSBmYWxzZTsKKyAgICAgICAgICAgIG1jX3czMl9kcmF3X2Jhcl9jdXJz b3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaCwgY3Vyc29yX3dpZHRoLCBNQ19CQVIsIGN1 cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAgICAgICAgICB9CisgICAgICBicmVhazsKKyAg ICB9CisgICAgY2FzZSBNQ19IQkFSOgorICAgIHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYg bHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAgICAgICAgeworICAgICAgICAgIC8q IFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEudzMyLT5jdXJzb3JfcGl4ZWwnLiAq LworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLnczMi0+Y3Vyc29yX3BpeGVsID0gY29sb3JfcGl4 ZWw7CisgICAgICAgICAgYm9vbCBjdXJ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TFlQSDoKKyAgICAgIHczMl9kcmF3X2ltYWdlX2ds eXBoX3N0cmluZyAocyk7CisgICAgICBicmVhazsKKyAgICBjYXNlIFNUUkVUQ0hfR0xZUEg6Cisg ICAgICBtY193MzJfZHJhd19zdHJldGNoX2dseXBoX3N0cmluZyAocyk7CisgICAgICBicmVhazsK KyAgICBjYXNlIENIQVJfR0xZUEg6CisgICAgICBpZiAocy0+Zm9yX292ZXJsYXBzKQorICAgICAg ICBzLT5iYWNrZ3JvdW5kX2ZpbGxlZF9wID0gdHJ1ZTsKKyAgICAgIGVsc2UKKyAgICAgICAgdzMy X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQgKHMsIGZhbHNlKTsKKyAgICAgIHczMl9kcmF3 X2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgQ09N UE9TSVRFX0dMWVBIOgorICAgICAgaWYgKHMtPmZvcl9vdmVybGFwcyB8fCAocy0+Y21wX2Zyb20g PiAwCisgICAgICAgICAgJiYgISBzLT5maXJzdF9nbHlwaC0+dS5jbXAuYXV0b21hdGljKSkKKyAg ICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAgICBlbHNlCisgICAgICAg IHczMl9kcmF3X2dseXBoX3N0cmluZ19iYWNrZ3JvdW5kIChzLCB0cnVlKTsKKyAgICAgIHczMl9k cmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocyk7CisgICAgICBicmVhazsK KyAgICBjYXNlIEdMWVBITEVTU19HTFlQSDoKKyAgICAgIGlmIChzLT5mb3Jfb3ZlcmxhcHMpCisg ICAgICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0cnVlOworICAgICAgZWxzZQorICAgICAg ICB3MzJfZHJhd19nbHlwaF9zdHJpbmdfYmFja2dyb3VuZCAocywgZmFsc2UpOworICAgICAgdzMy X2RyYXdfZ2x5cGhsZXNzX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChzKTsKKyAgICAgIGJyZWFr OworICAgIGRlZmF1bHQ6CisgICAgICBlbWFjc19hYm9ydCAoKTsKKyAgICB9CisgIGlmICghcy0+ Zm9yX292ZXJsYXBzKQorICAgIHsKKyAgICAgIC8qIERyYXcgdW5kZXJsaW5lLiAqLworICAgICAg aWYgKHMtPmZhY2UtPnVuZGVybGluZV9wKQorICAgICAgICB7CisgICAgICAgICAgaWYgKHMtPmZh Y2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfV0FWRSkKKyAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgQ09MT1JSRUYgY29sb3I7CisgICAgICAgICAgICAgIGlmIChzLT5mYWNlLT51 bmRlcmxpbmVfZGVmYXVsdGVkX3ApCisgICAgICAgICAgICAgICAgY29sb3IgPSBzLT5nYy0+Zm9y ZWdyb3VuZDsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBjb2xvciA9 IHMtPmZhY2UtPnVuZGVybGluZV9jb2xvcjsKKyAgICAgICAgICAgICAgdzMyX2RyYXdfdW5kZXJ3 YXZlIChzLCBjb2xvcik7CisgICAgICAgICAgICB9CisgICAgICAgICAgZWxzZSBpZiAocy0+ZmFj ZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAgICAgICAgeworICAg ICAgICAgICAgICB1bnNpZ25lZCBsb25nIHRoaWNrbmVzcywgcG9zaXRpb247CisgICAgICAgICAg ICAgIGludCB5OworICAgICAgICAgICAgICBpZiAocy0+cHJldiAmJiBzLT5wcmV2LT5mYWNlLT51 bmRlcmxpbmVfcAorICAgICAgICAgICAgICAgICAgJiYgcy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5l X3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICAgIC8qIFdlIHVzZSB0aGUgc2FtZSB1bmRlcmxpbmUgc3R5bGUgYXMgdGhlIHByZXZpb3Vz IG9uZS4gKi8KKyAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPnByZXYtPnVuZGVybGlu ZV90aGlja25lc3M7CisgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPnByZXYtPnVuZGVy bGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UKKyAg ICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVybGluZSB0 aGlja25lc3MuICBEZWZhdWx0IGlzIDEgcGl4ZWwuICovCisgICAgICAgICAgICAgICAgICBpZiAo cy0+Zm9udCAmJiBzLT5mb250LT51bmRlcmxpbmVfdGhpY2tuZXNzID4gMCkKKyAgICAgICAgICAg ICAgICAgICAgdGhpY2tuZXNzID0gcy0+Zm9udC0+dW5kZXJsaW5lX3RoaWNrbmVzczsKKyAgICAg ICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IDE7 CisgICAgICAgICAgICAgICAgICBpZiAoeF91bmRlcmxpbmVfYXRfZGVzY2VudF9saW5lKQorICAg ICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5oZWlnaHQgLSB0aGlja25lc3MpIC0gKHMt PnliYXNlIC0gcy0+eSk7CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIHVuZGVybGluZSBw b3NpdGlvbi4gIFRoaXMgaXMgdGhlIHJlY29tbWVuZGVkCisgICAgICAgICAgICAgICAgICAgICAg ICAgICB2ZXJ0aWNhbCBvZmZzZXQgaW4gcGl4ZWxzIGZyb20gdGhlIGJhc2VsaW5lIHRvIHRoZSB0 b3Agb2YKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSB1bmRlcmxpbmUuICBUaGlzIGlz IGEgc2lnbmVkIHZhbHVlIGFjY29yZGluZyB0byB0aGUKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgIHNwZWNzLCBhbmQgaXRzIGRlZmF1bHQgaXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAg IFJPVU5EICgobWF4aW11bV9kZXNjZW50KSAvIDIpLCB3aXRoCisgICAgICAgICAgICAgICAgICAg ICAgICAgICBST1VORCAoeCkgPSBmbG9vciAoeCArIDAuNSkgICovCisgICAgICAgICAgICAgICAg ICAgICAgICBpZiAoeF91c2VfdW5kZXJsaW5lX3Bvc2l0aW9uX3Byb3BlcnRpZXMKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiBzLT5mb250ICYmIHMtPmZvbnQtPnVuZGVybGluZV9wb3Np dGlvbiA+PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHMtPmZvbnQt PnVuZGVybGluZV9wb3NpdGlvbjsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHMt PmZvbnQpCisgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmZvbnQtPmRl c2NlbnQgKyAxKSAvIDI7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAg ICAgcG9zaXRpb24gPSBtYXggKHBvc2l0aW9uLCB1bmRlcmxpbmVfbWluaW11bV9vZmZzZXQpOwor ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgLyogQ2hlY2sgdGhlIHNhbml0eSBvZiB0 aGlja25lc3MgYW5kIHBvc2l0aW9uLiAgV2Ugc2hvdWxkCisgICAgICAgICAgICAgICAgIGF2b2lk IGRyYXdpbmcgdW5kZXJsaW5lIG91dCBvZiB0aGUgY3VycmVudCBsaW5lIGFyZWEuICovCisgICAg ICAgICAgICAgIGlmIChzLT55ICsgcy0+aGVpZ2h0IDw9IHMtPnliYXNlICsgcG9zaXRpb24pCisg ICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+aGVpZ2h0IC0gMSkgLSAocy0+eWJhc2UgLSBz LT55KTsKKyAgICAgICAgICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQgPCBzLT55YmFzZSArIHBv c2l0aW9uICsgdGhpY2tuZXNzKQorICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IChzLT55ICsg cy0+aGVpZ2h0KSAtIChzLT55YmFzZSArIHBvc2l0aW9uKTsKKyAgICAgICAgICAgICAgcy0+dW5k ZXJsaW5lX3RoaWNrbmVzcyA9IHRoaWNrbmVzczsKKyAgICAgICAgICAgICAgcy0+dW5kZXJsaW5l X3Bvc2l0aW9uID1wb3NpdGlvbjsKKyAgICAgICAgICAgICAgeSA9IHMtPnliYXNlICsgcG9zaXRp b247CisgICAgICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfZGVmYXVsdGVkX3ApCisg ICAgICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5nYy0+Zm9yZWdy b3VuZCwgcy0+eCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5LCBzLT53aWR0aCwg MSk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgdzMyX2ZpbGxfYXJl YSAocy0+Ziwgcy0+aGRjLCBzLT5mYWNlLT51bmRlcmxpbmVfY29sb3IsIHMtPngsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICB5LCBzLT53aWR0aCwgMSk7CisgICAgICAgICAgICB9 CisgICAgICAgIH0KKyAgICAgIC8qIERyYXcgb3ZlcmxpbmUuICovCisgICAgICBpZiAocy0+ZmFj ZS0+b3ZlcmxpbmVfcCkKKyAgICAgICAgeworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZHkgPSAw LCBoID0gMTsKKyAgICAgICAgICBpZiAocy0+ZmFjZS0+b3ZlcmxpbmVfY29sb3JfZGVmYXVsdGVk X3ApCisgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmdjLT5mb3Jl Z3JvdW5kLCBzLT54LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+eSArIGR5LCBzLT53 aWR0aCwgaCk7CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgIHczMl9maWxsX2FyZWEg KHMtPmYsIHMtPmhkYywgcy0+ZmFjZS0+b3ZlcmxpbmVfY29sb3IsIHMtPngsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHMtPnkgKyBkeSwgcy0+d2lkdGgsIGgpOworICAgICAgICB9Cisg ICAgICAvKiBEcmF3IHN0cmlrZS10aHJvdWdoLiAqLworICAgICAgaWYgKHMtPmZhY2UtPnN0cmlr ZV90aHJvdWdoX3AKKyAgICAgICAgICAmJiAhRk9OVF9URVhUTUVUUklDIChzLT5mb250KS50bVN0 cnVja091dCkKKyAgICAgICAgeworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgaCA9IDE7CisgICAg ICAgICAgdW5zaWduZWQgbG9uZyBkeSA9IChzLT5oZWlnaHQgLSBoKSAvIDI7CisgICAgICAgICAg aWYgKHMtPmZhY2UtPnN0cmlrZV90aHJvdWdoX2NvbG9yX2RlZmF1bHRlZF9wKQorICAgICAgICAg ICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5nYy0+Zm9yZWdyb3VuZCwgcy0+eCwg cy0+eSArIGR5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcy0+d2lkdGgsIGgpOworICAg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMs IHMtPmZhY2UtPnN0cmlrZV90aHJvdWdoX2NvbG9yLCBzLT54LAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBzLT55ICsgZHksIHMtPndpZHRoLCBoKTsKKyAgICAgICAgfQorICAgICAgLyog RHJhdyByZWxpZWYgaWYgbm90IHlldCBkcmF3bi4gKi8KKyAgICAgIGlmICghcmVsaWVmX2RyYXdu X3AgJiYgcy0+ZmFjZS0+Ym94ICE9IEZBQ0VfTk9fQk9YKQorICAgICAgICB3MzJfZHJhd19nbHlw aF9zdHJpbmdfYm94IChzKTsKKyAgICAgIGlmIChzLT5wcmV2KQorICAgICAgICB7CisgICAgICAg ICAgc3RydWN0IGdseXBoX3N0cmluZyAqcHJldjsKKyAgICAgICAgICBmb3IgKHByZXYgPSBzLT5w cmV2OyBwcmV2OyBwcmV2ID0gcHJldi0+cHJldikKKyAgICAgICAgICAgIGlmIChwcmV2LT5obCAh PSBzLT5obAorICAgICAgICAgICAgICAgICYmIHByZXYtPnggKyBwcmV2LT53aWR0aCArIHByZXYt PnJpZ2h0X292ZXJoYW5nID4gcy0+eCkKKyAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAg IC8qIEFzIHByZXYgd2FzIGRyYXduIHdoaWxlIGNsaXBwZWQgdG8gaXRzIG93biBhcmVhLCB3ZQor ICAgICAgICAgICAgICAgICAgIG11c3QgZHJhdyB0aGUgcmlnaHRfb3ZlcmhhbmcgcGFydCB1c2lu ZyBzLT5obCBub3cuICovCisgICAgICAgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIHNh dmUgPSBwcmV2LT5obDsKKyAgICAgICAgICAgICAgICBwcmV2LT5obCA9IHMtPmhsOworICAgICAg ICAgICAgICAgIG1jX3czMl9zZXRfZ2x5cGhfc3RyaW5nX2djIChwcmV2LCBjdXJzb3JfZ2NfcCk7 CisgICAgICAgICAgICAgICAgdzMyX3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmdfZXhhY3RseSAo cywgcHJldik7CisgICAgICAgICAgICAgICAgaWYgKHByZXYtPmZpcnN0X2dseXBoLT50eXBlID09 IENIQVJfR0xZUEgpCisgICAgICAgICAgICAgICAgICB3MzJfZHJhd19nbHlwaF9zdHJpbmdfZm9y ZWdyb3VuZCAocHJldik7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAg ICAgIHczMl9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAocHJldik7Cisg ICAgICAgICAgICAgICAgdzMyX3NldF9jbGlwX3JlY3RhbmdsZSAocHJldi0+aGRjLCBOVUxMKTsK KyAgICAgICAgICAgICAgICBwcmV2LT5obCA9IHNhdmU7CisgICAgICAgICAgICAgICAgcHJldi0+ bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICBpZiAocy0+ bmV4dCkKKyAgICAgICAgeworICAgICAgICAgIHN0cnVjdCBnbHlwaF9zdHJpbmcgKm5leHQ7Cisg ICAgICAgICAgZm9yIChuZXh0ID0gcy0+bmV4dDsgbmV4dDsgbmV4dCA9IG5leHQtPm5leHQpCisg ICAgICAgICAgICBpZiAobmV4dC0+aGwgIT0gcy0+aGwKKyAgICAgICAgICAgICAgICAmJiBuZXh0 LT54IC0gbmV4dC0+bGVmdF9vdmVyaGFuZyA8IHMtPnggKyBzLT53aWR0aCkKKyAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgIC8qIEFzIG5leHQgd2lsbCBiZSBkcmF3biB3aGlsZSBjbGlw cGVkIHRvIGl0cyBvd24gYXJlYSwKKyAgICAgICAgICAgICAgICAgICB3ZSBtdXN0IGRyYXcgdGhl IGxlZnRfb3ZlcmhhbmcgcGFydCB1c2luZyBzLT5obCBub3cuICovCisgICAgICAgICAgICAgICAg ZW51bSBkcmF3X2dseXBoc19mYWNlIHNhdmUgPSBuZXh0LT5obDsKKyAgICAgICAgICAgICAgICBu ZXh0LT5obCA9IHMtPmhsOworICAgICAgICAgICAgICAgIG1jX3czMl9zZXRfZ2x5cGhfc3RyaW5n X2djIChuZXh0LCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgICAgICAgdzMyX3NldF9nbHlwaF9z dHJpbmdfY2xpcHBpbmdfZXhhY3RseSAocywgbmV4dCk7CisgICAgICAgICAgICAgICAgaWYgKG5l eHQtPmZpcnN0X2dseXBoLT50eXBlID09IENIQVJfR0xZUEgpCisgICAgICAgICAgICAgICAgICB3 MzJfZHJhd19nbHlwaF9zdHJpbmdfZm9yZWdyb3VuZCAobmV4dCk7CisgICAgICAgICAgICAgICAg ICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHczMl9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJp bmdfZm9yZWdyb3VuZCAobmV4dCk7CisgICAgICAgICAgICAgICAgdzMyX3NldF9jbGlwX3JlY3Rh bmdsZSAobmV4dC0+aGRjLCBOVUxMKTsKKyAgICAgICAgICAgICAgICBuZXh0LT5obCA9IHNhdmU7 CisgICAgICAgICAgICAgICAgbmV4dC0+bnVtX2NsaXBzID0gMDsKKyAgICAgICAgICAgICAgICBu ZXh0LT5jbGlwX2hlYWQgPSBzLT5uZXh0OworICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAg ICB9CisgIC8qIFJlc2V0IGNsaXBwaW5nLiAqLworICB3MzJfc2V0X2NsaXBfcmVjdGFuZ2xlIChz LT5oZGMsIE5VTEwpOworICBzLT5udW1fY2xpcHMgPSAwOworfQorCisvKiBlbmQgTVVMVElQTEUt Q1VSU09SUyAqLworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogLyogRnJpbmdlIGJpdG1h cHMuICAqLwogCiBzdGF0aWMgaW50IG1heF9mcmluZ2VfYm1wID0gMDsKQEAgLTU0Miw2ICsxNzA0 LDE1IEBAIHczMl91cGRhdGVfYmVnaW4gKHN0cnVjdCBmcmFtZSAqZikKICAgaWYgKCEgRlJBTUVf VzMyX1AgKGYpKQogICAgIHJldHVybjsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFLUNVUlNPUlMgKi8KKworICBmLT5tY191cGRhdGluZ19mcmFtZSA9IGY7CisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKICAgLyogUmVnZW5lcmF0ZSBkaXNwbGF5IHBhbGV0 dGUgYmVmb3JlIGRyYXdpbmcgaWYgbGlzdCBvZiByZXF1ZXN0ZWQKICAgICAgY29sb3JzIGhhcyBj aGFuZ2VkLiAqLwogICBpZiAoZGlzcGxheV9pbmZvLT5yZWdlbl9wYWxldHRlKQpAQCAtNjc0LDYg KzE4NDUsMTYgQEAgdzMyX3VwZGF0ZV9lbmQgKHN0cnVjdCBmcmFtZSAqZikKIAogICAvKiBNb3Vz ZSBoaWdobGlnaHQgbWF5IGJlIGRpc3BsYXllZCBhZ2Fpbi4gICovCiAgIE1PVVNFX0hMX0lORk8g KGYpLT5tb3VzZV9mYWNlX2RlZmVyID0gZmFsc2U7CisKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgZi0+bWNfdXBkYXRpbmdfZnJhbWUgPSBO VUxMOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiB9CiAKIApAQCAtNDAwMiwxMyAr NTE4Myw3NCBAQCB3MzJfc2V0X3ZlcnRpY2FsX3Njcm9sbF9iYXIgKHN0cnVjdCB3aW5kb3cgKncs CiAJICAgICAgcmVsZWFzZV9mcmFtZV9kYyAoZiwgaGRjKTsKIAkgICAgICB3MzJfY2xlYXJfdW5k ZXJfaW50ZXJuYWxfYm9yZGVyIChmKTsKIAkgIC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gICAgICAgICAgU1dQX0ZSQU1FQ0hBTkdFRCk7CisgICAgICAgICAgaWYgKGxlZnQgPD0gYmFy LT5sZWZ0KQorICAgICAgICAgICAgbXlfc2hvd193aW5kb3cgKGYsIGh3bmQsIFNXX0hJREUpOwor ICAgICAgICAgIE1vdmVXaW5kb3cgKGh3bmQsIGxlZnQsIHRvcCwgd2lkdGgsIG1heCAoaGVpZ2h0 LCAxKSwgbGVmdCA8PSBiYXItPmxlZnQpOworCisvKiBlbmQgTVVMVElQTEUtQ1VSU09SUyAqLwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKIAogCSAgc2kuY2JTaXplID0gc2l6ZW9mIChzaSk7 CiAJICBzaS5mTWFzayA9IFNJRl9SQU5HRTsKQEAgLTQyNzcsNiArNTUxOSwyMSBAQCB3MzJfanVk Z2Vfc2Nyb2xsX2JhcnMgKHN0cnVjdCBmcmFtZSAqZikKICAgICB7CiAgICAgICBzdHJ1Y3Qgc2Ny b2xsX2JhciAqYiA9IFhTQ1JPTExfQkFSIChiYXIpOwogCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICAvKiBgRGVzdHJveVdpbmRvdycg d2l0aGluIGB4X3Njcm9sbF9iYXJfcmVtb3ZlJyByZXBhaW50cyB0aGUgcmVjdGFuZ2xlLgorICAg ICAgVGhlcmVmb3JlLCB3ZSBmaXJzdCBzZW5kIGEgbWVzc2FnZSB0byBpbmhpYml0IHJlcGFpbnRp bmcuICovCisgICAgICBpZiAoIVdJTkRPV19MSVZFX1AgKGItPndpbmRvdykpCisgICAgICAgIHsK KyAgICAgICAgICBIV05EIGh3bmQgPSBTQ1JPTExfQkFSX1czMl9XSU5ET1cgKGIpOworICAgICAg ICAgIFNlbmRNZXNzYWdlIChod25kLCBXTV9TRVRSRURSQVcsIGZhbHNlLCAwKTsKKyAgICAgICAg fQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICB3MzJfc2Nyb2xsX2Jhcl9y ZW1vdmUgKGIpOwogCiAgICAgICBuZXh0ID0gYi0+bmV4dDsKQEAgLTcwODgsNiArODM0NSwyMCBA QCBleHRlcm4gZnJhbWVfcGFybV9oYW5kbGVyIHczMl9mcmFtZV9wYXJtX2hhbmRsZXJzW107CiAK IHN0YXRpYyBzdHJ1Y3QgcmVkaXNwbGF5X2ludGVyZmFjZSB3MzJfcmVkaXNwbGF5X2ludGVyZmFj ZSA9CiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JT ICovCisKKy8qIGByZWRpc3BsYXlfaW50ZXJmYWNlJyBpbiBgdzMydGVybS5jYCBtdXN0IGJlIGlu IHRoZSBleGFjdCBzYW1lIG9yZGVyIGFzIHRoZQorYHJlZGlzcGxheV9pbnRlcmZhY2UnIGluIGBk aXNwZXh0ZXJuLmhgISAqLworCisgIG1jX3czMl9kcmF3X3dpbmRvd19jdXJzb3IsCisgIG1jX3cz Ml9kcmF3X2dseXBoX3N0cmluZywKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICB3 MzJfZnJhbWVfcGFybV9oYW5kbGVycywKICAgZ3VpX3Byb2R1Y2VfZ2x5cGhzLAogICBndWlfd3Jp dGVfZ2x5cGhzLApkaWZmIC0tZ2l0IGEvc3JjL3dpbmRvdy5oIGIvc3JjL3dpbmRvdy5oCmluZGV4 IDZiMGYwZTUuLjE0ZGQzOGEgMTAwNjQ0Ci0tLSBhL3NyYy93aW5kb3cuaAorKysgYi9zcmMvd2lu ZG93LmgKQEAgLTMyNCw2ICszMjQsMTQ3IEBAIHN0cnVjdCB3aW5kb3cKIAogI2lmZGVmIEhBVkVf V0lORE9XX1NZU1RFTQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4gTVVM VElQTEUtQ1VSU09SUyAqLworCisvKiBTdWZmaXhlcyBmb3IgdGhlIGBtY2Agd2luZG93IHBvaW50 ZXIgcHJlZml4LiAqLworc3RydWN0IG11bHRpcGxlX2N1cnNvcnMKK3sKKyAgLyogVGhlIHJlY29y ZGVkIHBpeGVsIHdpZHRoIG9mIHRoZSBsYXN0IGxpbmUgbnVtYmVyIGRyYXduIGR1cmluZyByZWRp c3BsYXkgKi8KKyAgaW50IGxudW1fcGl4ZWxfd2lkdGg7Cit9IG1jOworCitzdHJ1Y3QgbWNfbWF0 cml4Cit7CisgIHB0cmRpZmZfdCB2cG9zX2FsbG9jYXRlZDsKKyAgcHRyZGlmZl90IHZwb3NfdXNl ZDsKKyAgcHRyZGlmZl90IGN1cnNvcnNfdXNlZFs0XTsKKyAgZW51bSBtY19jYWNoZV90eXBlCisg IHsKKyAgICBNQ19DQUNIRSwKKyAgICBDSF9DQUNIRSwKKyAgICBGQ19DQUNIRSwKKyAgICBOT19D QUNIRQorICB9IGNhY2hlX3R5cGU7CisgIHN0cnVjdCBtY192cG9zCisgIHsKKyAgICBwdHJkaWZm X3QgY2FjaGVfYWxsb2NhdGVkWzRdOworICAgIHB0cmRpZmZfdCBjYWNoZV91c2VkWzRdOworICAg IHN0cnVjdCBtY19jb250ZW50cworICAgIHsKKyAgICAgIGJvb2xfYmYgc2FtZV9wIDogMTsKKyAg ICAgIHN0cnVjdCBnbHlwaCBnbHlwaDsKKyAgICAgIGludCB4OworICAgICAgaW50IGZ4OworICAg ICAgaW50IHk7CisgICAgICBpbnQgZnk7CisgICAgICBpbnQgaHBvczsKKyAgICAgIGludCB2cG9z OworICAgICAgaW50IHdkOworICAgICAgaW50IGg7CisgICAgICBlbnVtIG1jX2N1cnNvcl90eXBl CisgICAgICB7CisgICAgICAgIC8qIE5PVEU6ICBUaGUgZnJpbmdlIGJpdG1hcCBmcmFtZXdvcmsg cmVsaWVzIHVwb24gTUNfTk9fRlJJTkdFX0JJVE1BUAorICAgICAgICBoYXZpbmcgYSB2YWx1ZSBv ZiB6ZXJvICgwKS4gKi8KKyAgICAgICAgTUNfTk9fRlJJTkdFX0JJVE1BUCwKKyAgICAgICAgTUNf Tk9fQ1VSU09SLAorICAgICAgICBNQ19SSUdIVF9GUklOR0VfQklUTUFQLAorICAgICAgICBNQ19M RUZUX0ZSSU5HRV9CSVRNQVAsCisgICAgICAgIE1DX0ZSQU1FRF9CT1gsCisgICAgICAgIE1DX0ZJ TExFRF9CT1gsCisgICAgICAgIE1DX0hPTExPV19CT1gsCisgICAgICAgIE1DX0JBUiwKKyAgICAg ICAgTUNfSEJBUgorICAgICAgfSBjdXJzb3JfdHlwZTsKKyAgICAgIGludCBjdXJzb3Jfd2lkdGg7 CisgICAgICBzdHJ1Y3QgbWNfUkdCCisgICAgICB7CisgICAgICAgIGRvdWJsZSByZWQ7CisgICAg ICAgIGRvdWJsZSBncmVlbjsKKyAgICAgICAgZG91YmxlIGJsdWU7CisgICAgICB9IGZnLCBiZzsK KyAgICAgIGJvb2xfYmYgYWN0aXZlX3AgOiAxOworICAgICAgZW51bSBtY19mbGF2b3IKKyAgICAg IHsKKyAgICAgICAgTk9fRkxBVk9SLAorICAgICAgICBNQ19HTFlQSCwKKyAgICAgICAgTUNfR0xZ UEhMRVNTLAorICAgICAgICBNQ19PVkVSTEFZX0FSUk9XX0JJVE1BUCwKKyAgICAgICAgTUNfUElM Q1JPVywKKyAgICAgICAgTUNfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIV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gIC8qIFVzZWQgZWxzZXdoZXJlLiAqLworICBlbnVtIG1jX3ByZV9z Y3JvbGxfY2xlYW5fdHlwZQorICB7CisgICAgVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFU UklYX0RPV04sCisgICAgVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX1VQLAorICAg IFRSWV9XSU5ET1dfSUQKKyAgfSBtY19wcmVfc2Nyb2xsX2NsZWFuX3R5cGVfX2Zyb21fd2hlcmU7 CisgIC8qIFVzZWQgZWxzZXdoZXJlLiAqLworICBlbnVtIG1jX2RyYXdfcm93X3R5cGUKKyAgewor ICAgIE5PV0hFUkUsCisgICAgU0NSSUJFX09ORSwKKyAgICBTQ1JJQkVfVFdPLAorICAgIFNDUklC RV9USFJFRSwKKyAgICBTS0lQUEVELAorICAgIFBPU1RfQ0hBTkdFRCwKKyAgICBVTkNIQU5HRUQs CisgICAgU0VUX0NVUlNPUl9PTkUsCisgICAgU0VUX0NVUlNPUl9UV08KKyAgfSBtY19kcmF3X3Jv d190eXBlX19mcm9tX3doZXJlOworICAvKiBVc2VkIGVsc2V3aGVyZS4gKi8KKyAgZW51bSBtY19y ZWRyYXdfcm93X3R5cGUKKyAgeworICAgIFVQREFURV9XSU5ET1dfX1JFRFJBV19PVkVSTEFQUEVE X1JPV1MsCisgICAgR1VJX0lOU0VSVF9HTFlQSFMsCisgICAgR1VJX0ZJWF9PVkVSTEFQUElOR19B UkVBLAorICAgIERSQVdfUk9XX1dJVEhfTU9VU0VfRkFDRSwKKyAgICBFWFBPU0VfQVJFQV9PTkUs CisgICAgRVhQT1NFX0FSRUFfVFdPLAorICAgIEVYUE9TRV9MSU5FCisgIH0gbWNfcmVkcmF3X3Jv d190eXBlX19mcm9tX3doZXJlOworfSBtY19tYXRyaXg7CisKKy8qIGVuZCBNVUxUSVBMRS1DVVJT T1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgLyogQ3Vyc29yIHR5cGUg b2YgbGFzdCBjdXJzb3IgZHJhd24gb24gdGhlIHdpbmRvdy4gICovCiAgICAgZW51bSB0ZXh0X2N1 cnNvcl9raW5kcyBwaHlzX2N1cnNvcl90eXBlOwogCmRpZmYgLS1naXQgYS9zcmMveGRpc3AuYyBi L3NyYy94ZGlzcC5jCmluZGV4IDUwZjY0NDMuLmQxMGM5MjkgMTAwNjQ0Ci0tLSBhL3NyYy94ZGlz cC5jCisrKyBiL3NyYy94ZGlzcC5jCkBAIC05NjIsNiArOTYyLDQ5ODcgQEAgc3RhdGljIHZvaWQg c2hvd19tb3VzZV9mYWNlIChNb3VzZV9ITEluZm8gKiwgZW51bSBkcmF3X2dseXBoc19mYWNlKTsK IHN0YXRpYyBib29sIGNvb3Jkc19pbl9tb3VzZV9mYWNlX3AgKHN0cnVjdCB3aW5kb3cgKiwgaW50 LCBpbnQpOwogCiAKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogYmVnaW4gTVVMVElQTEUt Q1VSU09SUyAqLworCisvKiBNVUxUSVBMRS1DVVJTT1JTOiAgRW1hY3MgQnVnICMyMjg3MyAoZmVh dHVyZSByZXF1ZXN0KQorCisgIENST1NTSEFJUlM6ICBFbWFjcyBCdWcgIzE3Njg0IChmZWF0dXJl IHJlcXVlc3QpCisKKworVkVSU0lPTjogIDAyMi4wMDggWzA1LzAyLzIwMjBdCisKKworQ0hBTkdF TE9HOgorCistIENhbGN1bGF0ZSBhbmQgc2V0IGl0LT5sbnVtIHdoZW4gYm90aCBOSUxQIChWZGlz cGxheV9saW5lX251bWJlcnMpIGFuZCBmZWF0dXJlcworICAyMjg3MyAvIDE3Njg0IGFyZSBhY3Rp dmUuICBMaW5lIG51bWJlcnMgYXJlIG5vdyByZWNvcmRlZCBpbi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FTVF9YKTsJCVwKKwkgICAgICBicmVhazsJCQkJCQkJXAorCQkJCQkJCQkJXAor CSAgICBjYXNlIFNUUkVUQ0hfR0xZUEg6CQkJCQkJXAorCSAgICAgIE1DX0JVSUxEX1NUUkVUQ0hf R0xZUEhfU1RSSU5HIChTVEFSVCwgRU5ELCBIRUFELCBUQUlMLAlcCisJCQkJCSAgSEwsIFgsIExB U1RfWCk7CQlcCisJICAgICAgYnJlYWs7CQkJCQkJCVwKKwkJCQkJCQkJCVwKKwkgICAgY2FzZSBJ TUFHRV9HTFlQSDoJCQkJCQlcCisJICAgICAgTUNfQlVJTERfSU1BR0VfR0xZUEhfU1RSSU5HIChT VEFSVCwgRU5ELCBIRUFELCBUQUlMLAkJXAorCQkJCQlITCwgWCwgTEFTVF9YKTsJCQlcCisJICAg ICAgYnJlYWs7CisKKyNkZWZpbmUgTUNfQlVJTERfR0xZUEhfU1RSSU5HU19YVyhTVEFSVCwgRU5E LCBIRUFELCBUQUlMLCBITCwgWCwgTEFTVF9YKQlcCisgICAgICAgICAgICBjYXNlIFhXSURHRVRf R0xZUEg6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAg ICAgICAgIE1DX0JVSUxEX1hXSURHRVRfR0xZUEhfU1RSSU5HIChTVEFSVCwgRU5ELCBIRUFELCBU QUlMLCAgICAgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBI TCwgWCwgTEFTVF9YKTsgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgIGJyZWFrOworCisj ZGVmaW5lIE1DX0JVSUxEX0dMWVBIX1NUUklOR1NfMihTVEFSVCwgRU5ELCBIRUFELCBUQUlMLCBI TCwgWCwgTEFTVF9YKQlcCisJICAgIGNhc2UgR0xZUEhMRVNTX0dMWVBIOgkJCQkJXAorCSAgICAg IE1DX0JVSUxEX0dMWVBITEVTU19HTFlQSF9TVFJJTkcgKFNUQVJULCBFTkQsIEhFQUQs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xpc3QgYXA7CisgIHZhX3N0YXJ0IChhcCwgYXJnKTsKKyAgZm9yIChw dHJkaWZmX3QgaSA9IDE7IGkgPCBjb3VudDsgaSsrKQorICAgIHsKKyAgICAgIExpc3BfT2JqZWN0 IGVsZW0gPSBGY29ucyAodmFfYXJnIChhcCwgTGlzcF9PYmplY3QpLCBRbmlsKTsKKyAgICAgIFhT RVRDRFIgKHRhaWwsIGVsZW0pOworICAgICAgdGFpbCA9IGVsZW07CisgICAgfQorICB2YV9lbmQg KGFwKTsKKyAgcmV0dXJuIHZhbDsKK30KKworTGlzcF9PYmplY3QKK21jX21lbXEgKExpc3BfT2Jq ZWN0IGVsdCwgTGlzcF9PYmplY3QgbGlzdCkKK3sKKyAgd2hpbGUgKDEpCisgICAgeworICAgICAg aWYgKCFDT05TUCAobGlzdCkgfHwgRVEgKFhDQVIgKGxpc3QpLCBlbHQpKQorICAgICAgICBicmVh azsKKyAgICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpIHx8 IEVRIChYQ0FSIChsaXN0KSwgZWx0KSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENE UiAobGlzdCk7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KSB8fCBFUSAoWENBUiAobGlzdCksIGVs dCkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3QpOworICAgIH0KKyAg cmV0dXJuIGxpc3Q7Cit9CisKK0xpc3BfT2JqZWN0CittY19udGggKGludCBudW0sIExpc3BfT2Jq ZWN0IGxpc3QpCit7CisgIGZvciAoaW50IGkgPSAwOyBpIDwgbnVtICYmICFOSUxQIChsaXN0KTsg aSsrKQorICAgIGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgaWYgKENPTlNQIChsaXN0KSkKKyAgICBy ZXR1cm4gWENBUiAobGlzdCk7CisgICAgZWxzZQorICAgICAgcmV0dXJuIFFuaWw7Cit9CisKK0xp c3BfT2JqZWN0CittY19hc3NxIChMaXNwX09iamVjdCBrZXksIExpc3BfT2JqZWN0IGxpc3QpCit7 CisgIHdoaWxlICgxKQorICAgIHsKKyAgICAgIGlmICghQ09OU1AgKGxpc3QpCisgICAgICAgICAg fHwgKENPTlNQIChYQ0FSIChsaXN0KSkKKyAgICAgICAgICAgICAgJiYgRVEgKFhDQVIgKFhDQVIg KGxpc3QpKSwga2V5KSkpCisgICAgICAgIGJyZWFrOworICAgICAgbGlzdCA9IFhDRFIgKGxpc3Qp OworICAgICAgaWYgKCFDT05TUCAobGlzdCkKKyAgICAgICAgICB8fCAoQ09OU1AgKFhDQVIgKGxp c3QpKQorICAgICAgICAgICAgICAmJiBFUSAoWENBUiAoWENBUiAobGlzdCkpLCBrZXkpKSkKKyAg ICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNPTlNQ IChsaXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAg ICYmIEVRIChYQ0FSIChYQ0FSIChsaXN0KSksIGtleSkpKQorICAgICAgICBicmVhazsKKyAgICAg IGxpc3QgPSBYQ0RSIChsaXN0KTsKKyAgICB9CisgIGlmIChDT05TUCAobGlzdCkpCisgICAgcmV0 dXJuIFhDQVIgKGxpc3QpOworICAgIGVsc2UKKyAgICAgIHJldHVybiBRbmlsOworfQorCitMaXNw X09iamVjdAorbWNfYXNzb2MgKExpc3BfT2JqZWN0IGtleSwgTGlzcF9PYmplY3QgbGlzdCkKK3sK KyAgTGlzcF9PYmplY3QgY2FyOworICB3aGlsZSAoMSkKKyAgICB7CisgICAgICBpZiAoIUNPTlNQ IChsaXN0KQorICAgICAgICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAg ICYmIChjYXIgPSBYQ0FSIChYQ0FSIChsaXN0KSksCisgICAgICAgICAgICAgICAgICBFUSAoY2Fy LCBrZXkpIHx8ICFOSUxQIChGZXF1YWwgKGNhciwga2V5KSkpKSkKKyAgICAgICAgYnJlYWs7Cisg ICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KQorICAgICAg ICAgIHx8IChDT05TUCAoWENBUiAobGlzdCkpCisgICAgICAgICAgICAgICYmIChjYXIgPSBYQ0FS IChYQ0FSIChsaXN0KSksCisgICAgICAgICAgICAgICAgICBFUSAoY2FyLCBrZXkpIHx8ICFOSUxQ IChGZXF1YWwgKGNhciwga2V5KSkpKSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENE UiAobGlzdCk7CisgICAgICBpZiAoIUNPTlNQIChsaXN0KQorICAgICAgICAgIHx8IChDT05TUCAo WENBUiAobGlzdCkpCisgICAgICAgICAgICAgICYmIChjYXIgPSBYQ0FSIChYQ0FSIChsaXN0KSks CisgICAgICAgICAgICAgICAgICBFUSAoY2FyLCBrZXkpIHx8ICFOSUxQIChGZXF1YWwgKGNhciwg a2V5KSkpKSkKKyAgICAgICAgYnJlYWs7CisgICAgICBsaXN0ID0gWENEUiAobGlzdCk7CisgICAg fQorICBpZiAoQ09OU1AgKGxpc3QpKQorICAgIHJldHVybiBYQ0FSIChsaXN0KTsKKyAgICBlbHNl CisgICAgICByZXR1cm4gUW5pbDsKK30KKworTGlzcF9PYmplY3QKK21jX3BsaXN0X2dldCAoTGlz cF9PYmplY3QgcGxpc3QsIExpc3BfT2JqZWN0IHByb3ApCit7CisgIExpc3BfT2JqZWN0IHRhaWws IGhhbGZ0YWlsOworICAvKiBoYWxmdGFpbCBpcyB1c2VkIHRvIGRldGVjdCBjaXJjdWxhciBsaXN0 cy4gICovCisgIHRhaWwgPSBoYWxmdGFpbCA9IHBsaXN0OworICB3aGlsZSAoQ09OU1AgKHRhaWwp ICYmIENPTlNQIChYQ0RSICh0YWlsKSkpCisgICAgeworICAgICAgaWYgKEVRIChwcm9wLCBYQ0FS ICh0YWlsKSkpCisgICAgICAgIHJldHVybiBYQ0FSIChYQ0RSICh0YWlsKSk7CisgICAgICB0YWls ID0gWENEUiAoWENEUiAodGFpbCkpOworICAgICAgaGFsZnRhaWwgPSBYQ0RSIChoYWxmdGFpbCk7 CisgICAgICBpZiAoRVEgKHRhaWwsIGhhbGZ0YWlsKSkKKyAgICAgICAgYnJlYWs7CisgICAgfQor ICByZXR1cm4gUW5pbDsKK30KKworLyogUkVHSU9OIEJFR0lOOiAgbWNfcmVnaW9uX2xpbWl0ICgx KQorICAgUkVHSU9OIEVORDogIG1jX3JlZ2lvbl9saW1pdCAoMCkgKi8KK3B0cmRpZmZfdAorbWNf cmVnaW9uX2xpbWl0IChib29sIGJlZ2luX3ApCit7CisgIGlmICghTklMUCAoVnRyYW5zaWVudF9t YXJrX21vZGUpCisgICAgICAmJiBOSUxQIChWbWFya19ldmVuX2lmX2luYWN0aXZlKQorICAgICAg JiYgTklMUCAoQlZBUiAoY3VycmVudF9idWZmZXIsIG1hcmtfYWN0aXZlKSkpCisgICAgeHNpZ25h bDAgKFFtYXJrX2luYWN0aXZlKTsKKyAgTGlzcF9PYmplY3QgbWFya2VyID0gQlZBUiAoY3VycmVu dF9idWZmZXIsIG1hcmspOworICBpbnQgbSA9IChYTUFSS0VSIChtYXJrZXIpLT5idWZmZXIpCisg ICAgICAgICAgPyBYTUFSS0VSIChtYXJrZXIpLT5jaGFycG9zCisgICAgICAgICAgOiAtMTsKKyAg cmV0dXJuIChtID09IC0xKQorICAgICAgICAgICA/IC0xCisgICAgICAgICA6IChQVCA8IG0pID09 IGJlZ2luX3AKKyAgICAgICAgICAgPyBQVAorICAgICAgICAgOiBjbGlwX3RvX2JvdW5kcyAoQkVH ViwgbSwgWlYpOworfQorCisvKiBDaGVjayB0aGUgcHJlc2VuY2Ugb2YgYSBkaXNwbGF5IHByb3Bl cnR5IGFuZCBjb21wdXRlIGl0cyB3aWR0aC4KKyAgIElmIGEgcHJvcGVydHkgd2FzIGZvdW5kIGFu ZCBpdHMgd2lkdGggd2FzIGZvdW5kIGFzIHdlbGwsIHJldHVybgorICAgaXRzIHdpZHRoICg+PSAw KSBhbmQgc2V0IHRoZSBwb3NpdGlvbiBvZiB0aGUgZW5kIG9mIHRoZSBwcm9wZXJ0eQorICAgaW4g RU5EUE9TLgorICAgT3RoZXJ3aXNlIGp1c3QgcmV0dXJuIC0xLiAqLworc3RhdGljIGludAorbWNf Y2hlY2tfZGlzcGxheV93aWR0aCAocHRyZGlmZl90IHBvcywgcHRyZGlmZl90IGNvbCwgcHRyZGlm Zl90ICplbmRwb3MpCit7CisgIExpc3BfT2JqZWN0IHZhbCwgb3ZlcmxheTsKKyAgaWYgKENPTlNQ ICh2YWwgPSBnZXRfY2hhcl9wcm9wZXJ0eV9hbmRfb3ZlcmxheQorICAgICAgICAgICAgICAobWFr ZV9maXhudW0gKHBvcyksIFFkaXNwbGF5LCBRbmlsLCAmb3ZlcmxheSkpCisgICAgICAmJiBFUSAo UXNwYWNlLCBYQ0FSICh2YWwpKSkKKyAgICB7IC8qIEZJWE1FOiBVc2UgY2FsY19waXhlbF93aWR0 aF9vcl9oZWlnaHQuICovCisgICAgICBMaXNwX09iamVjdCBwbGlzdCA9IFhDRFIgKHZhbCksIHBy b3A7CisgICAgICBpbnQgd2lkdGggPSAtMTsKKyAgICAgIEVNQUNTX0lOVCBhbGlnbl90b19tYXgg PSAoY29sIDwgTU9TVF9QT1NJVElWRV9GSVhOVU0gLSBJTlRfTUFYCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IChFTUFDU19JTlQpIElOVF9NQVggKyBjb2wKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogTU9TVF9QT1NJVElWRV9GSVhOVU0pOworICAgICAgaWYg KChwcm9wID0gbWNfcGxpc3RfZ2V0IChwbGlzdCwgUUN3aWR0aCksIFJBTkdFRF9GSVhOVU1QICgw LCBwcm9wLCBJTlRfTUFYKSkKKyAgICAgICAgICB8fCAocHJvcCA9IG1jX3BsaXN0X2dldCAocGxp c3QsIFFDcmVsYXRpdmVfd2lkdGgpLAorICAgICAgICAgICAgICBSQU5HRURfRklYTlVNUCAoMCwg cHJvcCwgSU5UX01BWCkpKQorICAgICAgICB3aWR0aCA9IFhGSVhOVU0gKHByb3ApOworICAgICAg ICBlbHNlIGlmIChGTE9BVFAgKHByb3ApICYmIDAgPD0gWEZMT0FUX0RBVEEgKHByb3ApCisgICAg ICAgICAgICAgICAgICYmIFhGTE9BVF9EQVRBIChwcm9wKSA8PSBJTlRfTUFYKQorICAgICAgICAg IHdpZHRoID0gKGludCkoWEZMT0FUX0RBVEEgKHByb3ApICsgMC41KTsKKyAgICAgICAgICBlbHNl IGlmICgocHJvcCA9IG1jX3BsaXN0X2dldCAocGxpc3QsIFFDYWxpZ25fdG8pLAorICAgICAgICAg ICAgICAgICAgICBSQU5HRURfRklYTlVNUCAoY29sLCBwcm9wLCBhbGlnbl90b19tYXgpKSkKKyAg ICAgICAgICAgIHdpZHRoID0gWEZJWE5VTSAocHJvcCkgLSBjb2w7CisgICAgICAgICAgICAgIGVs c2UgaWYgKEZMT0FUUCAocHJvcCkgJiYgY29sIDw9IFhGTE9BVF9EQVRBIChwcm9wKQorICAgICAg ICAgICAgICAgICAgICAgICAmJiAoWEZMT0FUX0RBVEEgKHByb3ApIDw9IGFsaWduX3RvX21heCkp CisgICAgICAgICAgICAgICAgd2lkdGggPSAoaW50KShYRkxPQVRfREFUQSAocHJvcCkgKyAwLjUp IC0gY29sOworICAgICAgaWYgKHdpZHRoID49IDApCisgICAgICAgIHsKKyAgICAgICAgICBwdHJk aWZmX3Qgc3RhcnQ7CisgICAgICAgICAgaWYgKE9WRVJMQVlQIChvdmVybGF5KSkKKyAgICAgICAg ICAgICplbmRwb3MgPSBPVkVSTEFZX1BPU0lUSU9OIChPVkVSTEFZX0VORCAob3ZlcmxheSkpOwor ICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBnZXRfcHJvcGVydHlfYW5kX3JhbmdlIChw b3MsIFFkaXNwbGF5LCAmdmFsLCAmc3RhcnQsIGVuZHBvcywgUW5pbCk7CisgICAgICAgICAgLyog Rm9yIDpyZWxhdGl2ZS13aWR0aCwgd2UgbmVlZCB0byBtdWx0aXBseSBieSB0aGUgY29sdW1uCisg ICAgICAgICAgICAgd2lkdGggb2YgdGhlIGNoYXJhY3RlciBhdCBQT1MsIGlmIGl0IGlzIGdyZWF0 ZXIgdGhhbiAxLiAqLworICAgICAgICAgIGlmICghTklMUCAobWNfcGxpc3RfZ2V0IChwbGlzdCwg UUNyZWxhdGl2ZV93aWR0aCkpCisgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChjdXJyZW50 X2J1ZmZlciwgZW5hYmxlX211bHRpYnl0ZV9jaGFyYWN0ZXJzKSkpCisgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgIGludCBiLCB3ZDsKKyAgICAgICAgICAgICAgdW5zaWduZWQgY2hhciAqcCA9 IEJZVEVfUE9TX0FERFIgKENIQVJfVE9fQllURSAocG9zKSk7CisgICAgICAgICAgICAgIE1DX01V TFRJQllURV9CWVRFU19XSURUSCAocCwgYnVmZmVyX2Rpc3BsYXlfdGFibGUgKCksIGIsIHdkKTsK KyAgICAgICAgICAgICAgd2lkdGggKj0gd2Q7CisgICAgICAgICAgICB9CisgICAgICAgICAgcmV0 dXJuIHdpZHRoOworICAgICAgICB9CisgICAgfQorICByZXR1cm4gLTE7Cit9CisKKy8qIFRyeSB0 byBjb21wb3NlIHRoZSBjaGFyYWN0ZXJzIGF0IENIQVJQT1MgYWNjb3JkaW5nIHRvIGNvbXBvc2l0 aW9uCisgICBydWxlIFJVTEUgKFtQQVRURVJOIFBSRVYtQ0hBUlMgRlVOQ10pLiAgTElNSVQgbGlt aXRzIHRoZSBjaGFyYWN0ZXJzCisgICB0byBjb21wb3NlLiAgU1RSSU5HLCBpZiBub3QgbmlsLCBp cyBhIHRhcmdldCBzdHJpbmcuICBXSU4gaXMgYQorICAgd2luZG93IHdoZXJlIHRoZ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nBvcywgYnl0ZXBvcywgbGltaXQsIC0xLCBzdHJpbmcpKQorICAgICAgICAgICA+ IDApCisgICAgeworICAgICAgaWYgKE5JTFAgKHN0cmluZykpCisgICAgICAgIGxlbiA9IEJZVEVf VE9fQ0hBUiAoYnl0ZXBvcyArIGxlbikgLSBjaGFycG9zOworICAgICAgZWxzZQorICAgICAgICBs ZW4gPSBzdHJpbmdfYnl0ZV90b19jaGFyIChzdHJpbmcsIGJ5dGVwb3MgKyBsZW4pIC0gY2hhcnBv czsKKyAgICB9CisgIGlmIChsZW4gPD0gMCkKKyAgICByZXR1cm4gdW5iaW5kX3RvIChjb3VudCwg UW5pbCk7CisgIHRvID0gbGltaXQgPSBjaGFycG9zICsgbGVuOworI2lmZGVmIEhBVkVfV0lORE9X X1NZU1RFTQorICBpZiAoRlJBTUVfV0lORE9XX1AgKGYpKQorICAgIHsKKyAgICAgIGZvbnRfb2Jq ZWN0ID0gZm9udF9yYW5nZSAoY2hhcnBvcywgYnl0ZXBvcywgJnRvLCB3aW4sIGZhY2UsIHN0cmlu Zyk7CisgICAgICBpZiAoISBGT05UX09CSkVDVF9QIChmb250X29iamVjdCkKKyAgICAgICAgICB8 fCAoISBOSUxQIChyZSkKKyAgICAgICAgICAgICAgJiYgdG8gPCBsaW1pdAorICAgICAgICAgICAg ICAmJiAoZmFzdF9sb29raW5nX2F0IChyZSwgY2hhcnBvcywgYnl0ZXBvcywgdG8sIC0xLCBzdHJp bmcpIDw9IDApKSkKKyAgICAgICAgcmV0dXJuIHVuYmluZF90byAoY291bnQsIFFuaWwpOworICAg IH0KKyAgZWxzZQorI2VuZGlmICAgICAgICAvKiBub3QgSEFWRV9XSU5ET1dfU1lTVEVNICovCisg ICAgZm9udF9vYmplY3QgPSB3aW4tPmZyYW1lOworICBsZ3N0cmluZyA9IEZjb21wb3NpdGlvbl9n ZXRfZ3N0cmluZyAocG9zLCBtYWtlX2ZpeG51bSAodG8pLCBmb250X29iamVjdCwKKyAgICAgICAg ICAgIC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2UgYXJlIGxvb2tpbmcgYXQgYSBzdGF0aWMgY29tcG9zaXRpb24uICAqLwor ICAgICAgcHRyZGlmZl90IHN0YXJ0LCBlbmQ7CisgICAgICBMaXNwX09iamVjdCBwcm9wOworICAg ICAgZmluZF9jb21wb3NpdGlvbiAoY2hhcnBvcywgLTEsICZzdGFydCwgJmVuZCwgJnByb3AsIHN0 cmluZyk7CisgICAgICBjbXBfaXQtPmlkID0gZ2V0X2NvbXBvc2l0aW9uX2lkIChjaGFycG9zLCBi eXRlcG9zLCBlbmQgLSBzdGFydCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHByb3AsIHN0cmluZyk7CisgICAgICBpZiAoY21wX2l0LT5pZCA8IDApCisgICAgICAgIGdv dG8gbm9fY29tcG9zaXRpb247CisgICAgICBjbXBfaXQtPm5jaGFycyA9IGVuZCAtIHN0YXJ0Owor ICAgICAgY21wX2l0LT5uZ2x5cGhzID0gY29tcG9zaXRpb25fdGFibGVbY21wX2l0LT5pZF0tPmds eXBoX2xlbjsKKyAgICB9CisgIGVsc2UgaWYgKHcpCisgICAgeworICAgICAgTGlzcF9PYmplY3Qg bGdzdHJpbmcgPSBRbmlsOworICAgICAgTGlzcF9PYmplY3QgdmFsLCBlbHQ7CisgICAgICBwdHJk aWZmX3QgaTsKKyAgICAgIHZhbCA9IENIQVJfVEFCTEVfUkVGIChWY29tcG9zaXRpb25fZnVuY3Rp b25fdGFibGUsIGNtcF9pdC0+Y2gpOworICAgICAgZm9yIChpID0gMDsgaSA8IGNtcF9pdC0+cnVs ZV9pZHg7IGkrKywgdmFsID0gWENEUiAodmFsKSk7CisgICAgICBpZiAoY2hhcnBvcyA8IGVuZHBv cykKKyAgICAgICAgeworICAgICAgICAgIGZvciAoOyBDT05TUCAodmFsKTsgdmFsID0gWENEUiAo dmFsKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgZWx0ID0gWENBUiAodmFsKTsKKyAg ICAgICAgICAgICAgaWYgKCEgVkVDVE9SUCAoZWx0KSB8fCBBU0laRSAoZWx0KSAhPSAzCisgICAg ICAgICAgICAgICAgICB8fCAhIElOVEVHRVJQIChBUkVGIChlbHQsIDEpKSkKKyAgICAgICAgICAg ICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgaWYgKFhGSVhOQVQgKEFSRUYgKGVsdCwgMSkp ICE9IGNtcF9pdC0+bG9va2JhY2spCisgICAgICAgICAgICAgICAgZ290byBub19jb21wb3NpdGlv bjsKKyAgICAgICAgICAgICAgbGdzdHJpbmcgPSBtY19hdXRvY21wX2NoYXJzIChlbHQsIGNoYXJw b3MsIGJ5dGVwb3MsIGVuZHBvcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICB3LCBmYWNlLCBzdHJpbmcpOworICAgICAgICAgICAgICBpZiAoY29tcG9zaXRpb25fZ3N0 cmluZ19wIChsZ3N0cmluZykpCisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAg IGxnc3RyaW5nID0gUW5pbDsKKyAgICAgICAgICAgICAgLyogQ29tcG9zaXRpb24gZmFpbGVkIHBl cmhhcHMgYmVjYXVzZSB0aGUgZm9udCBkb2Vzbid0CisgICAgICAgICAgICAgICAgIHN1cHBvcnQg c3VmZmljaWVudCByYW5nZSBvZiBjaGFyYWN0ZXJzLiAgVHJ5IHRoZQorICAgICAgICAgICAgICAg ICBvdGhlciBjb21wb3NpdGlvbiBydWxlcyBpZiBhbnkuICAqLworICAgICAgICAgICAgfQorICAg ICAgICAgIGNtcF9pdC0+cmV2ZXJzZWRfcCA9IDA7CisgICAgICAgIH0KKyAgICAgIGVsc2UKKyAg ICAgICAgeworICAgICAgICAgIHB0cmRpZmZfdCBjcG9zID0gY2hhcnBvcywgYnBvcyA9IGJ5dGVw b3M7CisgICAgICAgICAgY21wX2l0LT5yZXZlcnNlZF9wID0gMTsKKyAgICAgICAgICBlbHQgPSBY Q0FSICh2YWwpOworICAgICAgICAgIGlmIChjbXBfaXQtPmxvb2tiYWNrID4gMCkKKyAgICAgICAg ICAgIHsKKyAgICAgICAgICAgICAgY3BvcyA9IGNoYXJwb3MgLSBjbXBfaXQtPmxvb2tiYWNrOwor ICAgICAgICAgICAgICBpZiAoU1RSSU5HUCAoc3RyaW5nKSkKKyAgICAgICAgICAgICAgICBicG9z ID0gc3RyaW5nX2NoYXJfdG9fYnl0ZSAoc3RyaW5nLCBjcG9zKTsKKyAgICAgICAgICAgICAgZWxz ZQorICAgICAgICAgICAgICAgIGJwb3MgPSBDSEFSX1RPX0JZVEUgKGNwb3MpOworICAgICAgICAg ICAgfQorICAgICAgICAgIGxnc3RyaW5nID0gbWNfYXV0b2NtcF9jaGFycyAoZWx0LCBjcG9zLCBi cG9zLCBjaGFycG9zICsgMSwgdywgZmFjZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHN0cmluZyk7CisgICAgICAgICAgaWYgKCEgY29tcG9zaXRpb25fZ3N0cmluZ19wIChs Z3N0cmluZykKKyAgICAgICAgICAgICAgfHwgY3BvcyArIExHU1RSSU5HX0NIQVJfTEVOIChsZ3N0 cmluZykgLSAxICE9IGNoYXJwb3MpCisgICAgICAgICAgICAvKiBDb21wb3NpdGlvbiBmYWlsZWQg b3IgZGlkbid0IGNvdmVyIHRoZSBjdXJyZW50CisgICAgICAgICAgICAgICBjaGFyYWN0ZXIuICAq LworICAgICAgICAgICAgZ290byBub19jb21wb3NpdGlvbjsKKyAgICAgICAgfQorICAgICAgaWYg KE5JTFAgKGxnc3RyaW5nKSkKKyAgICAgICAgZ290byBub19jb21wb3NpdGlvbjsKKyAgICAgIGlm IChOSUxQIChMR1NUUklOR19JRCAobGdzdHJpbmcpKSkKKyAgICAgICAgbGdzdHJpbmcgPSBjb21w b3NpdGlvbl9nc3RyaW5nX3B1dF9jYWNoZSAobGdzdHJpbmcsIC0xKTsKKyAgICAgIGNtcF9pdC0+ aWQgPSBYRklYTlVNIChMR1NUUklOR19JRCAobGdzdHJpbmcpKTsKKyAgICAgIGZvciAoaSA9IDA7 IGkgPCBMR1NUUklOR19HTFlQSF9MRU4gKGxnc3RyaW5nKTsgaSsrKQorICAgICAgICBpZiAoTklM UCAoTEdTVFJJTkdfR0xZUEggKGxnc3RyaW5nLCBpKSkpCisgICAgICAgICAgYnJlYWs7CisgICAg ICBjbXBfaXQtPm5nbHlwaHMgPSBpOworICAgICAgY21wX2l0LT5mcm9tID0gMDsKKyAgICAgIGNt cF9pdC0+dG8gPSBpOworICAgIH0KKyAgZWxzZQorICAgIGdvdG8gbm9fY29tcG9zaXRpb247Cisg IHJldHVybiAxOworIG5vX2NvbXBvc2l0aW9uOgorICBpZiAoY2hhcnBvcyA9PSBlbmRwb3MpCisg ICAgcmV0dXJuIDA7CisgIGlmIChjaGFycG9zIDwgZW5kcG9zKQorICAgIHsKKyAgICAgIGNoYXJw b3MrKzsKKyAgICAgIGlmIChOSUxQIChzdHJpbmcpKQorICAgICAgICBJTkNfUE9TIChieXRlcG9z KTsKKyAgICAgIGVsc2UKKyAgICAgICAgYnl0ZXBvcyArPSBCWVRFU19CWV9DSEFSX0hFQUQgKCoo U0RBVEEgKHN0cmluZykgKyBieXRlcG9zKSk7CisgICAgfQorICBlbHNlCisgICAgeworICAgICAg Y2hhcnBvcy0tOworICAgICAgLyogQllURVBPUyBpcyBjYWxjdWxhdGVkIGluIGNvbXBvc2l0aW9u X2NvbXB1dGVfc3RvcF9wb3MgKi8KKyAgICAgIGJ5dGVwb3MgPSAtMTsKKyAgICB9CisgIGlmIChj bXBfaXQtPnJldmVyc2VkX3ApCisgICAgZW5kcG9zID0gLTE7CisgIGNvbXBvc2l0aW9uX2NvbXB1 dGVfc3RvcF9wb3MgKGNtcF9pdCwgY2hhcnBvcywgYnl0ZXBvcywgZW5kcG9zLCBzdHJpbmcpOwor ICByZXR1cm4gMDsKK30KKworLyogU2Nhbm5pbmcgZnJvbSB0aGUgYmVnaW5uaW5nIG9mIHRoZSBj dXJyZW50IG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iA9PSBuZXh0X2JvdW5kYXJ5KQorICAgICAg ICB7CisgICAgICAgICAgcHRyZGlmZl90IG9sZF9zY2FuID0gc2NhbjsKKyAgICAgICAgICAvKiBU aGlzIHVwZGF0ZXMgTkVYVF9CT1VOREFSWSB0byB0aGUgbmV4dCBwbGFjZQorICAgICAgICAgICAg IHdoZXJlIHdlIG1pZ2h0IG5lZWQgdG8gc2tpcCBtb3JlIGludmlzaWJsZSB0ZXh0LiAqLworICAg ICAgICAgIHNjYW4gPSBza2lwX2ludmlzaWJsZSAoc2NhbiwgJm5leHRfYm91bmRhcnksIGVuZCwg UW5pbCk7CisgICAgICAgICAgaWYgKHNjYW4gIT0gb2xkX3NjYW4pCisgICAgICAgICAgICBzY2Fu X2J5dGUgPSBDSEFSX1RPX0JZVEUgKHNjYW4pOworICAgICAgICAgIGlmIChzY2FuID49IGVuZCkK KyAgICAgICAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgfQorICAgICAgLyogVGVzdCByZWFj aGluZyB0aGUgZ29hbCBjb2x1bW4uICBXZSBkbyB0aGlzIGFmdGVyIHNraXBwaW5nCisgICBpbnZp c2libGUgY2hhcmFjdGVycywgc28gdGhhdCB3ZSBwdXQgcG9pbnQgYmVmb3JlIHRoZQorICAgY2hh cmFjdGVyIG9uIHdoaWNoIHRoZSBjdXJzb3Igd2lsbCBhcHBlYXIuICovCisgICAgICBpZiAoY29s ID49IGdvYWwpCisgICAgICAgIGJyZWFrOworICAgICAgcHJldl9jb2wgPSBjb2w7CisgICAgICB7 IC8qIENoZWNrIGRpc3BsYXkgcHJvcGVydHkuICovCisgICAgICAgIHB0cmRpZmZfdCBlbmRwOwor ICAgICAgICBpbnQgd2lkdGggPSBtY19jaGVja19kaXNwbGF5X3dpZHRoIChzY2FuLCBjb2wsICZl bmRwKTsKKyAgICAgICAgaWYgKHdpZHRoID49IDApCisgICAgICAgICAgeworICAgICAgICAgICAg Y29sICs9IHdpZHRoOworICAgICAgICAgICAgaWYgKGVuZHAgPiBzY2FuKSAvKiBBdm9pZCBpbmZp bml0ZSBsb29wcyB3aXRoIDAtd2lkdGggb3ZlcmxheXMuICovCisgICAgICAgICAgICAgIHsKKyAg ICAgICAgICAgICAgICBzY2FuID0gZW5kcDsKKyAgICAgICAgICAgICAgICBzY2FuX2J5dGUgPSBD SEFSX1RPX0JZVEUgKHNjYW4pOworICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAg ICAgICB9CisgICAgICAgICAgfQorICAgICAgfQorICAgICAgLyogQ2hlY2sgY29tcG9zaXRpb24g c2VxdWVuY2UuICovCisgICAgICBpZiAoY21wX2l0LmlkID49IDAKKyAgICAgICAgICB8fCAoc2Nh biA9PSBjbXBfaXQuc3RvcF9wb3MKKyAgICAgICAgICAgICAgJiYgbWNfY29tcG9zaXRpb25fcmVz ZWF0X2l0ICgmY21wX2l0LCBzY2FuLCBzY2FuX2J5dGUsIGVuZCwgdywgTlVMTCwgUW5pbCkpKQor ICAgICAgICBjb21wb3NpdGlvbl91cGRhdGVfaXQgKCZjbXBfaXQsIHNjYW4sIHNjYW5fYnl0ZSwg UW5pbCk7CisgICAgICBpZiAoY21wX2l0LmlkID49IDApCisgICAgICAgIHsKKyAgICAgICAgICBz Y2FuICs9IGNtcF9pdC5uY2hhcnM7CisgICAgICAgICAgc2Nhbl9ieXRlICs9IGNtcF9pdC5uYnl0 ZXM7CisgICAgICAgICAgaWYgKHNjYW4gPD0gZW5kKQorICAgICAgICAgICAgY29sICs9IGNtcF9p dC53aWR0aDsKKyAgICAgICAgICBpZiAoY21wX2l0LnRvID09IGNtcF9pdC5uZ2x5cGhzKQorICAg ICAgICAgICAgeworICAgICAgICAgICAgICBjbXBfaXQuaWQgPSAtMTsKKyAgICAgICAgICAgICAg Y29tcG9zaXRpb25fY29tcHV0ZV9zdG9wX3BvcyAoJmNtcF9pdCwgc2Nhbiwgc2Nhbl9ieXRlLCBl bmQsIFFuaWwpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICBjbXBfaXQuZnJvbSA9IGNtcF9pdC50bzsKKyAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAg fQorICAgICAgYyA9IEZFVENIX0JZVEUgKHNjYW5fYnl0ZSk7CisgICAgICAvKiBTZWUgaWYgdGhl cmUgaXMgYSBkaXNwbGF5IHRhYmxlIGFuZCBpdCByZWxhdGVzIHRvIHRoaXMgY2hhcmFjdGVyLiAq LworICAgICAgaWYgKGRwICE9IDAKKyAgICAgICAgICAmJiAhIChtdWx0aWJ5dGUgJiYgTEVBRElO R19DT0RFX1AgKGMpKQorICAgICAgICAgICYmIFZFQ1RPUlAgKERJU1BfQ0hBUl9WRUNUT1IgKGRw LCBjKSkpCisgICAgICAgIHsKKyAgICAgICAgICBMaXNwX09iamVjdCBjaGFydmVjOworICAgICAg ICAgIHB0cmRpZmZfdCBpLCBuOworICAgICAgICAgIC8qIFRoaXMgY2hhcmFjdGVyIGlzIGRpc3Bs YXllZCB1c2luZyBhIHZlY3RvciBvZiBnbHlwaHMuCisgICAgICAgICAgICAgVXBkYXRlIHRoZSBj b2x1bW4vcG9zaXRpb24gYmFzZWQgb24gdGhvc2UgZ2x5cGhzLiAqLworICAgICAgICAgIGNoYXJ2 ZWMgPSBESVNQX0NIQVJfVkVDVE9SIChkcCwgYyk7CisgICAgICAgICAgbiA9IEFTSVpFIChjaGFy dmVjKTsKKyAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgbjsgaSsrKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICAvKiBUaGlzIHNob3VsZCBiZSBoYW5kbGVkIHRoZSBzYW1lIGFzCisgICAg ICAgICAgICAgIG5leHRfZWxlbWVudF9mcm9tX2Rpc3BsYXlfdmVjdG9yIGRvZXMgaXQuICovCisg ICAgICAgICAgICAgIExpc3BfT2JqZWN0IGVudHJ5ID0gQVJFRiAoY2hhcnZlYywgaSk7CisgICAg ICAgICAgICAgIGlmIChHTFlQSF9DT0RFX1AgKGVudHJ5KSkKKyAgICAgICAgICAgICAgICBjID0g R0xZUEhfQ09ERV9DSEFSIChlbnRyeSk7CisgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAg ICAgICBjID0gJyAnOworICAgICAgICAgICAgICBpZiAoYyA9PSAnXG4nKQorICAgICAgICAgICAg ICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgICAgICAgaWYgKGMgPT0gJ1xyJyAmJiBFUSAoQlZB UiAoY3VycmVudF9idWZmZXIsIHNlbGVjdGl2ZV9kaXNwbGF5KSwgUXQpKQorICAgICAgICAgICAg ICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgICAgICAgaWYgKGMgPT0gJ1x0JykKKyAgICAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICAgICBjb2wgKz0gdGFiX3dpZHRoOworICAgICAgICAg ICAgICAgICAgY29sID0gY29sIC8gdGFiX3dpZHRoICogdGFiX3dpZHRoOworICAgICAgICAgICAg ICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICArK2NvbDsKKyAg ICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgICAgeworICAgICAg ICAgICAgLyogVGhlIGRpc3BsYXkgdGFibGUgZG9lc24ndCBhZmZlY3QgdGhpcyBjaGFyYWN0ZXI7 CisgICAgICAgICAgICAgICBpdCBkaXNwbGF5cyBhcyBpdHNlbGYuICovCisgICAgICAgICAgICBp ZiAoYyA9PSAnXG4nKQorICAgICAgICAgICAgICBnb3RvIGVuZGxvb3A7CisgICAgICAgICAgICBp ZiAoYyA9PSAnXHInICYmIEVRIChCVkFSIChjdXJyZW50X2J1ZmZlciwgc2VsZWN0aXZlX2Rpc3Bs YXkpLCBRdCkpCisgICAgICAgICAgICAgIGdvdG8gZW5kbG9vcDsKKyAgICAgICAgICAgIGlmIChj ID09ICdcdCcpCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBjb2wgKz0gdGFiX3dp ZHRoOworICAgICAgICAgICAgICAgIGNvbCA9IGNvbCAvIHRhYl93aWR0aCAqIHRhYl93aWR0aDsK KyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlIGlmIChtdWx0aWJ5dGUgJiYgTEVB RElOR19DT0RFX1AgKGMpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIC8q IFN0YXJ0IG9mIG11bHRpLWJ5dGUgZm9ybS4gKi8KKyAgICAgICAgICAgICAgICAgIHVuc2lnbmVk IGNoYXIgKnB0cjsKKyAgICAgICAgICAgICAgICAgIGludCBieXRlcywgd2lkdGg7CisgICAgICAg ICAgICAgICAgICBwdHIgPSBCWVRFX1BPU19BRERSIChzY2FuX2J5dGUpOworICAgICAgICAgICAg ICAgICAgTUNfTVVMVElCWVRFX0JZVEVTX1dJRFRIIChwdHIsIGRwLCBieXRlcywgd2lkdGgpOwor ICAgICAgICAgICAgICAgICAgLyogU3VidHJhY3Qgb25lIHRvIGNvbXBlbnNhdGUgZm9yIHRoZSBp bmNyZW1lbnQKKyAgICAgICAgICAgICAgICAgIHRoYXQgaXMgZ29pbmcgdG8gaGFwcGVuIGJlbG93 LiAqLworICAgICAgICAgICAgICAgICAgc2Nhbl9ieXRlICs9IGJ5dGVzIC0gMTsKKyAgICAgICAg ICAgICAgICAgIGNvbCArPSB3aWR0aDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAg ICAgZWxzZSBpZiAoY3RsX2Fycm93ICYmIChjIDwgMDQwIHx8IGMgPT0gMDE3NykpCisgICAgICAg ICAgICAgICAgICBjb2wgKz0gMjsKKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGMgPCAwNDAg fHwgYyA+PSAwMTc3KQorICAgICAgICAgICAgICAgICAgICBjb2wgKz0gNDsKKyAgICAgICAgICAg ICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgIGNvbCsrOworICAgICAgICAgIH0K KyAgICAgIHNjYW4rKzsKKyAgICAgIHNjYW5fYnl0ZSsrOworICAgIH0KKyBlbmRsb29wOgorICBs YXN0X2tub3duX2NvbHVtbiA9IGNvbDsKKyAgbGFzdF9rbm93bl9jb2x1bW5fcG9pbnQgPSBwdDsK KyAgbGFzdF9rbm93bl9jb2x1bW5fbW9kaWZpZWQgPSBNT0RJRkY7CisgIGlmIChnb2FsY29sKQor ICAgICpnb2FsY29sID0gY29sOworICBpZiAoZW5kcG9zKQorICAgICplbmRwb3MgPSBzY2FuOwor ICBpZiAocHJldmNvbCkKKyAgICAqcHJldmNvbCA9IHByZXZfY29sOworfQorCitwdHJkaWZmX3QK K21jX2N1cnJlbnRfY29sdW1uIChzdHJ1Y3Qgd2luZG93ICp3LCBwdHJkaWZmX3QgcHQpCit7Cisg IC8qIGBidWZfY2hhcnBvc190b19ieXRlcG9zJzogIGVhc3NlcnQgKEJVRl9CRUcgKGIpIDw9IGNo YXJwb3MgJiYgY2hhcnBvcyA8PSBCVUZfWiAoYikpOyAqLworICBzdHJ1Y3QgYnVmZmVyICpiID0g WEJVRkZFUiAody0+Y29udGVudHMpOworICBzdHJ1Y3QgYnVmZmVyICpvbGRfYnVmZmVyID0gTlVM TDsKKyAgaWYgKGIgIT0gY3VycmVudF9idWZmZXIpCisgICAgeworICAgICAgb2xkX2J1ZmZlciA9 IGN1cnJlbnRfYnVmZmVyOworICAgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAoYik7CisgICAgfQor ICBib29sIGJhcmZfY3Jhc2ggPSAoQlVGX0JFRyAoYikgPD0gcHQgJiYgcHQgPD0gQlVGX1ogKGIp KSA/IGZhbHNlIDogdHJ1ZTsKKyAgaWYgKGJhcmZfY3Jhc2gpCisgICAgeworICAgICAgaWYgKG9s ZF9idWZmZXIpCisgICAgICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKG9sZF9idWZmZXIpOworICAg ICAgcmV0dXJuIDA7CisgICAgfQorICBFTUFDU19JTlQgbGFzdF9rbm93bl9jb2x1bW5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sKKyAgICAgIHsKKyAgICAgICAgaWYgKG9sZF9idWZm ZXIpCisgICAgICAgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7CisgICAgICAg IHJldHVybiBjb2w7CisgICAgICB9CisgICAgfQorICAvKiBTY2FuIGJhY2t3YXJkcyBmcm9tIHBv aW50IHRvIHRoZSBwcmV2aW91cyBuZXdsaW5lLAorICAgICBjb3VudGluZyB3aWR0aC4gIFRhYiBj aGFyYWN0ZXJzIGFyZSB0aGUgb25seSBjb21wbGljYXRlZCBjYXNlLiAqLworICAvKiBNYWtlIGEg cG9pbnRlciBmb3IgZGVjcmVtZW50aW5nIHRocm91Z2ggdGhlIGNoYXJzIGJlZm9yZSBwb2ludC4g Ki8KKyAgcHRyID0gQllURV9QT1NfQUREUiAoQ0hBUl9UT19CWVRFIChwdCkgLSAxKSArIDE7Cisg IC8qIE1ha2UgYSBwb2ludGVyIHRvIHdoZXJlIGNvbnNlY3V0aXZlIGNoYXJzIGxlYXZlIG9mZiwK KyAgICAgZ29pbmcgYmFja3dhcmRzIGZyb20gcG9pbnQuICovCisgIGlmIChwdCA9PSBCRUdWKQor ICAgIHN0b3AgPSBwdHI7CisgICAgZWxzZSBpZiAocHQgPD0gR1BUIHx8IEJFR1YgPiBHUFQpCisg ICAgICBzdG9wID0gQkVHVl9BRERSOworICAgICAgZWxzZQorICAgICAgICBzdG9wID0gR0FQX0VO RF9BRERSOworICBjb2wgPSAwLCB0YWJfc2VlbiA9IDAsIHBvc3RfdGFiID0gMDsKKyAgd2hpbGUg KDEpCisgICAgeworICAgICAgcHRyZGlmZl90IGksIG47CisgICAgICBMaXNwX09iamVjdCBjaGFy dmVjOworICAgICAgaWYgKHB0ciA9PSBzdG9wKQorICAgICAgICB7CisgICAgICAgICAgLyogV2Ug c3RvcHBlZCBlaXRoZXIgZm9yIHRoZSBiZWdpbm5pbmcgb2YgdGhlIGJ1ZmZlcgorICAgICAgICAg ICAgIG9yIGZvciB0aGUgZ2FwLiAqLworICAgICAgICAgIGlmIChwdHIgPT0gQkVHVl9BRERSKQor ICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgLyogSXQgd2FzIHRoZSBnYXAuICBKdW1wIGJh Y2sgb3ZlciBpdC4gKi8KKyAgICAgICAgICBzdG9wID0gQkVHVl9BRERSOworICAgICAgICAgIHB0 ciA9IEdQVF9BRERSOworICAgICAgICAgIC8qIENoZWNrIHdoZXRoZXIgdGhhdCBicmluZ3MgdXMg dG8gYmVnaW5uaW5nIG9mIGJ1ZmZlci4gKi8KKyAgICAgICAgICBpZiAoQkVHViA+PSBHUFQpCisg ICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgYyA9ICotLXB0cjsKKyAgICAgIGlm IChkcCAmJiBWRUNUT1JQIChESVNQX0NIQVJfVkVDVE9SIChkcCwgYykpKQorICAgICAgICB7Cisg ICAgICAgICAgY2hhcnZlYyA9IERJU1BfQ0hBUl9WRUNUT1IgKGRwLCBjKTsKKyAgICAgICAgICBu ID0gQVNJWkUgKGNoYXJ2ZWMpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7 CisgICAgICAgICAgICBjaGFydmVjID0gUW5pbDsKKyAgICAgICAgICAgIG4gPSAxOworICAgICAg ICAgIH0KKyAgICAgIGZvciAoaSA9IG4gLSAxOyBpID49IDA7IC0taSkKKyAgICAgICAgeworICAg ICAgICAgIGlmIChWRUNUT1JQIChjaGFydmVjKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgLyogVGhpcyBzaG91bGQgYmUgaGFuZGxlZCB0aGUgc2FtZSBhcworICAgICAgICAgICBuZXh0 X2VsZW1lbnRfZnJvbV9kaXNwbGF5X3ZlY3RvciBkb2VzIGl0LiAqLworICAgICAgICAgICAgICBM aXNwX09iamVjdCBlbnRyeSA9IEFSRUYgKGNoYXJ2ZWMsIGkpOworICAgICAgICAgICAgICBpZiAo R0xZUEhfQ09ERV9QIChlbnRyeSkpCisgICAgICAgICAgICAgICAgYyA9IEdMWVBIX0NPREVfQ0hB UiAoZW50cnkpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIGMgPSAn ICc7CisgICAgICAgICAgICB9CisgICAgICAgICAgaWYgKGMgPj0gMDQwICYmIGMgPCAwMTc3KQor ICAgICAgICAgICAgY29sKys7CisgICAgICAgICAgICBlbHNlIGlmIChjID09ICdcbicKKyAgICAg ICAgICAgICAgICAgICAgIHx8IChjID09ICdccicKKyAgICAgICAgICAgICAgICAgICAgICAgICAm JiBFUSAoQlZBUiAoY3VycmVudF9idWZmZXIsIHNlbGVjdGl2ZV9kaXNwbGF5KSwgUXQpKSkKKyAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHB0cisrOworICAgICAgICAgICAgICAgIGdv dG8gc3RhcnRfb2ZfbGluZV9mb3VuZDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBl bHNlIGlmIChjID09ICdcdCcpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg aWYgKHRhYl9zZWVuKQorICAgICAgICAgICAgICAgICAgICBjb2wgPSAoKGNvbCArIHRhYl93aWR0 aCkgLyB0YWJfd2lkdGgpICogdGFiX3dpZHRoOworICAgICAgICAgICAgICAgICAgcG9zdF90YWIg Kz0gY29sOworICAgICAgICAgICAgICAgICAgY29sID0gMDsKKyAgICAgICAgICAgICAgICAgIHRh Yl9zZWVuID0gMTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSBpZiAo VkVDVE9SUCAoY2hhcnZlYykpCisgICAgICAgICAgICAgICAgICAvKiBXaXRoIGEgZGlzcGxheSB0 YWJsZSBlbnRyeSwgQyBpcyBkaXNwbGF5ZWQgYXMgaXMsIGFuZAorICAgICAgICAgICAgICAgICAg ICAgbm90IGRpc3BsYXllZCBhcyBcTk5OIG9yIGFzIF5OLiAgSWYgQyBpcyBhIHNpbmdsZS1ieXRl CisgICAgICAgICAgICAgICAgICAgICBjaGFyYWN0ZXIsIGl0IHRha2VzIG9uZSBjb2x1bW4uICBJ ZiBDIGlzIG11bHRpLWJ5dGUgaW4KKyAgICAgICAgICAgICAgICAgICAgIGEgdW5pYnl0ZSBidWZm ZXIsIGl0J3MgdHJhbnNsYXRlZCB0byB1bmlieXRlLCBzbyBpdAorICAgICAgICAgICAgICAgICAg ICAgYWxzbyB0YWtlcyBvbmUgY29sdW1uLiAqLworICAgICAgICAgICAgICAgICAgKytjb2w7Cisg ICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIGNvbCArPSAoY3RsX2Fy cm93ICYmIGMgPCAwMjAwKSA/IDIgOiA0OworICAgICAgICB9CisgICAgfQorIHN0YXJ0X29mX2xp bmVfZm91bmQ6CisgIGlmICh0YWJfc2VlbikKKyAgICB7CisgICAgICBjb2wgPSAoKGNvbCArIHRh Yl93aWR0aCkgLyB0YWJfd2lkdGgpICogdGFiX3dpZHRoOworICAgICAgY29sICs9IHBvc3RfdGFi OworICAgIH0KKyAgbGFzdF9rbm93bl9jb2x1bW4gPSBjb2w7CisgIGxhc3Rfa25vd25fY29sdW1u X3BvaW50ID0gcHQ7CisgIGxhc3Rfa25vd25fY29sdW1uX21vZGlmaWVkID0gTU9ESUZGOworICBp ZiAob2xkX2J1ZmZlcikKKyAgICBzZXRfYnVmZmVyX2ludGVybmFsIChvbGRfYnVmZmVyKTsKKyAg cmV0dXJuIGNvbDsKK30KKworREVGVU4gKCJtYy1jdXJyZW50LWNvbHVtbiIsIEZtY19jdXJyZW50 X2NvbHVtbiwgU21jX2N1cnJlbnRfY29sdW1uLCAyLCAyLCAwLAorICAgICAgIGRvYzogLyogUmV0 dXJuIHRoZSBob3Jpem9udGFsIHBvc2l0aW9uIG9mIHBvaW50LiAgQmVnaW5uaW5nIG9mIGxpbmUg aXMgY29sdW1uIDAuCitUaGlzIGlzIGNhbGN1bGF0ZWQgYnkgYWRkaW5nIHRvZ2V0aGVyI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JuIHRl bXA7Cit9CisKK3N0YXRpYyB2b2lkCittY19saW5lX251bWJlciAoc3RydWN0IGl0ICppdCkKK3sK KyAgaWYgKCFCVUZGRVJQIChpdC0+dy0+Y29udGVudHMpKQorICAgIHJldHVybjsKKyAgaWYgKGl0 LT53LT5tY19tYXRyaXguY3Vyc29yc191c2VkW01DX0NBQ0hFXSA9PSAwCisgICAgICAmJiBpdC0+ dy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtDSF9DQUNIRV0gPT0gMAorICAgICAgJiYgaXQtPnct Pm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbRkNfQ0FDSEVdID09IDAKKyAgICAgICYmIE5JTFAgKEJW QVIgKFhCVUZGRVIgKGl0LT53LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAgICAgJiYgTklMUCAo QlZBUiAoWEJVRkZFUiAoaXQtPnctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAgICAmJiBO SUxQIChCVkFSIChYQlVGRkVSIChpdC0+dy0+Y29udGVudHMpLCBmY192aXNpYmxlKSkpCisgICAg cmV0dXJuOworICBwdHJkaWZmX3QgbGFzdF9saW5lID0gaXQtPmxudW07CisgIHB0cmRpZmZfdCBz dGFydF9mcm9tLCBieXRlcG9zOworICBwdHJkaWZmX3QgdGhpc19saW5lOworICBib29sIGZpcnN0 X3RpbWUgPSBmYWxzZTsKKyAgcHRyZGlmZl90IGJlZ19ieXRlID0gZGlzcGxheV9saW5lX251bWJl cnNfd2lkZW4gPyBCRUdfQllURSA6IEJFR1ZfQllURTsKKyAgcHRyZGlmZl90IHpfYnl0ZSA9IGRp c3BsYXlfbGluZV9udW1iZXJzX3dpZGVuID8gWl9CWVRFIDogWlZfQllURTsKKyAgdm9pZCAqaXRk YXRhID0gYmlkaV9zaGVsdmVfY2FjaGUgKCk7CisgIGlmIChFUSAoVmRpc3BsYXlfbGluZV9udW1i ZXJzLCBRdmlzdWFsKSkKKyAgICB0aGlzX2xpbmUgPSBkaXNwbGF5X2NvdW50X2xpbmVzX3Zpc3Vh bGx5IChpdCk7CisgICAgZWxzZQorICAgIHsKKyAgICAgIGlmICghbGFzdF9saW5lKQorICAgICAg ICB7CisgICAgICAgICAgLyogSWYgcG9zc2libGUsIHJldXNlIGRhdGEgY2FjaGVkIGJ5IGxpbmUt bnVtYmVyLW1vZGUuICovCisgICAgICAgICAgaWYgKGl0LT53LT5iYXNlX2xpbmVfbnVtYmVyID4g MAorICAgICAgICAgICAgICAmJiBpdC0+dy0+YmFzZV9saW5lX3BvcyA+IDAKKyAgICAgICAgICAg ICAgJiYgaXQtPnctPmJhc2VfbGluZV9wb3MgPD0gSVRfQ0hBUlBPUyAoKml0KQorICAgICAgICAg ICAgICAvKiBsaW5lLW51bWJlci1tb2RlIGFsd2F5cyBkaXNwbGF5cyBuYXJyb3dlZCBsaW5lCisg ICAgICAgICAgICAgIG51bWJlcnMsIHNvIHdlIGNhbm5vdCB1c2UgaXRzIGRhdGEgaWYgdGhlIHVz ZXIgd2FudHMKKyAgICAgICAgICAgICAgbGluZSBudW1iZXJzIHRoYXQgZGlzcmVnYXJkIG5hcnJv d2luZywgb3IgaWYgdGhlCisgICAgICAgICAgICAgIGJ1ZmZlcidzIG5hcnJvd2luZyBoYXMganVz dCBjaGFuZ2VkLiAqLworICAgICAgICAgICAgICAmJiAhKGRpc3BsYXlfbGluZV9udW1iZXJzX3dp ZGVuCisgICAgICAgICAgICAgICAgICAgJiYgKEJFR19CWVRFICE9IEJFR1ZfQllURSB8fCBaX0JZ VEUgIT0gWlZfQllURSkpCisgICAgICAgICAgICAgICYmICFjdXJyZW50X2J1ZmZlci0+Y2xpcF9j aGFuZ2VkKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBzdGFydF9mcm9tID0gQ0hBUl9U T19CWVRFIChpdC0+dy0+YmFzZV9saW5lX3Bvcyk7CisgICAgICAgICAgICAgIGxhc3RfbGluZSA9 IGl0LT53LT5iYXNlX2xpbmVfbnVtYmVyIC0gMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAg IGVsc2UKKyAgICAgICAgICAgICAgc3RhcnRfZnJvbSA9IGJlZ19ieXRlOworICAgICAgICAgIGlm ICghaXQtPmxudW1fYnl0ZXBvcykKKyAgICAgICAgICAgIGZpcnN0X3RpbWUgPSB0cnVlOworICAg ICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICBzdGFydF9mcm9tID0gaXQtPmxudW1fYnl0 ZXBvczsKKyAgICAgIC8qIFBhcmFub2lhOiB3aGF0IGlmIHNvbWVvbmUgY2hhbmdlcyB0aGUgbmFy cm93aW5nIHNpbmNlIHRoZQorICAgICAgbGFzdCB0aW1lIGRpc3BsYXlfbGluZSB3YXMgY2FsbGVk PyAgU2hvdWxkbid0IHJlYWxseSBoYXBwZW4sCisgICAgICBidXQgd2hvIGtub3dzIHdoYXQgc29t ZSBjcmF6eSBMaXNwIGludm9rZWQgYnkgOmV2YWwgY291bGQgZG8/ICAqLworICAgICAgaWYgKCEo YmVnX2J5dGUgPD0gc3RhcnRfZnJvbSAmJiBzdGFydF9mcm9tIDw9IHpfYnl0ZSkpCisgICAgICAg IHsKKyAgICAgICAgICBsYXN0X2xpbmUgPSAwOworICAgICAgICAgIHN0YXJ0X2Zyb20gPSBiZWdf Ynl0ZTsKKyAgICAgICAgfQorICAgICAgdGhpc19saW5lID0gbGFzdF9saW5lICsgZGlzcGxheV9j b3VudF9saW5lc19sb2dpY2FsbHkgKHN0YXJ0X2Zyb20sCisgICAgICAgICAgICAgICAgICAgSVRf QllURVBPUyAoKml0KSwgSVRfQ0hBUlBPUyAoKml0KSwgJmJ5dGVwb3MpOworICAgICAgZWFzc2Vy dCAodGhpc19saW5lID4gMCB8fCAodGhpc19saW5lID09IDAgJiYgc3RhcnRfZnJvbSA9PSBiZWdf Ynl0ZSkpOworICAgICAgZWFzc2VydCAoYnl0ZXBvcyA9PSBJVF9CWVRFUE9TICgqaXQpKTsKKyAg ICB9CisgIC8qIFJlY29yZCB0aGUgbGluZSBudW1iZXIgaW5mb3JtYXRpb24uICovCisgIGlmICh0 aGlzX2xpbmUgIT0gbGFzdF9saW5lIHx8ICFpdC0+bG51bV9ieXRlcG9zKQorICAgIHsKKyAgICAg IGl0LT5sbnVtID0gdGhpc19saW5lOworICAgICAgaXQtPmxudW1fYnl0ZXBvcyA9IElUX0JZVEVQ T1MgKCppdCk7CisgICAgfQorICBiaWRpX3Vuc2hlbHZlX2NhY2hlIChpdGRhdGEsIGZhbHNlKTsK K30KKworLyogVVNBR0U6ICBmcHJpbnRmIChzdGRlcnIsICJGUkFNRSAoJXMpIiwgbWNfZnJhbWUg KGYpKTsgKi8KK2NoYXIgKgorbWNfZnJhbWUgKHN0cnVjdCBmcmFtZSAqZikKK3sKKyAgTGlzcF9P YmplY3QgZnJhbWU7CisgIFhTRVRGUkFNRSAoZnJhbWUsIGYpOworICByZXR1cm4gU1NEQVRBIChG cHJpbjFfdG9fc3RyaW5nIChmcmFtZSwgUW5pbCkpOworfQorCisvKiBVU0FHRTogIGZwcmludGYg KHN0ZGVyciwgIldJTkRPVyAoJXMpIiwgbWNfd2luZG93ICh3KSk7ICovCitjaGFyICoKK21jX3dp bmRvdyAoc3RydWN0IHdpbmRvdyAqdykKK3sKKyAgTGlzcF9PYmplY3Qgd2luZG93OworICBYU0VU V0lORE9XICh3aW5kb3csIHcpOworICByZXR1cm4gU1NEQVRBIChGcHJpbjFfdG9fc3RyaW5nICh3 aW5kb3csIFFuaWwpKTsKK30KKworLyogVVNBR0U6ICBmcHJpbnRmIChzdGRlcnIsICJDSEFSQUNU RVIgKCVzKSIsIG1jX2NoYXJfdG9fc3RyaW5nIChnbHlwaC0+dS5jaCkpOyAqLworY2hhciAqCitt Y19jaGFyX3RvX3N0cmluZyAoaW50IGFyZykKK3sKKyAgTGlzcF9PYmplY3QgY2hhcmFjdGVyID0g KDAgPD0gYXJnICYmIGFyZyA8PSBNQVhfQ0hBUikKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ID8gRmNoYXJfdG9fc3RyaW5nIChtYWtlX2ZpeG51bSAoYXJnKSkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogUW5pbDsKKyAgY2hhciAqIHJlc3VsdCA9ICghTklMUCAoY2hhcmFjdGVyKQor ICAgICAgICAgICAgICAgICAgICYmIGFyZyA9PSA5KQorICAgICAgICAgICAgICAgICAgICA/ICJc XHQiCisgICAgICAgICAgICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAg ICAgICAgICAgJiYgYXJnID09IDEwKQorICAgICAgICAgICAgICAgICAgICA/ICJcXG4iCisgICAg ICAgICAgICAgICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICAg JiYgYXJnID09IDMyKQorICAgICAgICAgICAgICAgICAgICA/ICJcXHMiCisgICAgICAgICAgICAg ICAgICA6ICghTklMUCAoY2hhcmFjdGVyKQorICAgICAgICAgICAgICAgICAgICAgJiYgYXJnICE9 IDkKKyAgICAgICAgICAgICAgICAgICAgICYmIGFyZyAhPSAxMAorICAgICAgICAgICAgICAgICAg ICAgJiYgYXJnICE9IDMyKQorICAgICAgICAgICAgICAgICAgICA/IFNTREFUQSAoY2hhcmFjdGVy KQorICAgICAgICAgICAgICAgICAgOiAiXFw/IjsKKyAgcmV0dXJuIHJlc3VsdDsKK30KKworaW50 CittY19saXNwX3RvX2N1cnNvcl90eXBlIChMaXNwX09iamVjdCBhcmcpCit7CisgIGNoYXIgKnN0 cjsKKyAgaWYgKFhUWVBFIChhcmcpID09IExpc3BfU3RyaW5nKQorICAgIHN0ciA9IFNTREFUQSAo YXJnKTsKKyAgICBlbHNlIGlmIChYVFlQRSAoYXJnKSA9PSBMaXNwX1N5bWJvbCkKKyAgICAgIHN0 ciA9IFNTREFUQSAoU1lNQk9MX05BTUUgKGFyZykpOworICAgICAgZWxzZSByZXR1cm4gLTE7Cisg IGlmICghc3RyY21wIChzdHIsICJubyIpKQorICAgIHJldHVybiBNQ19OT19DVVJTT1I7CisgIGlm ICghc3RyY21wIChzdHIsICJtYy1sZWZ0LWZyaW5nZS1iaXRtYXAiKSkKKyAgICByZXR1cm4gTUNf TEVGVF9GUklOR0VfQklUTUFQOworICBpZiAoIXN0cmNtcCAoc3RyLCAibWMtcmlnaHQtZnJpbmdl LWJpdG1hcCIpKQorICAgIHJldHVybiBNQ19SSUdIVF9GUklOR0VfQklUTUFQOworICBpZiAoIXN0 cmNtcCAoc3RyLCAiYm94IikpCisgICAgcmV0dXJuIE1DX0ZJTExFRF9CT1g7CisgIGlmICghc3Ry Y21wIChzdHIsICJmcmFtZWQiKSkKKyAgICByZXR1cm4gTUNfRlJBTUVEX0JPWDsKKyAgaWYgKCFz dHJjbXAgKHN0ciwgImhvbGxvdyIpKQorICAgIHJldHVybiBNQ19IT0xMT1dfQk9YOworICBpZiAo IXN0cmNtcCAoc3RyLCAiYmFyIikpCisgICAgcmV0dXJuIE1DX0JBUjsKKyAgaWYgKCFzdHJjbXAg KHN0ciwgImhiYXIiKSkKKyAgICByZXR1cm4gTUNfSEJBUjsKKyAgcmV0dXJuIC0xOworfQorCisv KiBVU0FHRTogIGZwcmludGYgKHN0ZGVyciwgIkNVUlNPUiBUWVBFICglcykiLCBtY19jdXJzb3Jf dHlwZV90b19zdHJpbmcgKGFyZykpOyAqLworY2hhciAqCittY19jdXJzb3JfdHlwZV90b19zdHJp bmcgKGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUpCit7CisgIHN3aXRjaCAoY3Vyc29y X3R5cGUpCisgICAgeworICAgICAgY2FzZSBNQ19GSUxMRURfQk9YOiByZXR1cm4gIk1DX0ZJTExF RF9CT1giOworICAgICAgY2FzZSBNQ19GUkFNRURfQk9YOiByZXR1cm4gIk1DX0ZSQU1FRF9CT1gi OworICAgICAgY2FzZSBNQ19IT0xMT1dfQk9YOiByZXR1cm4gIk1DX0hPTExPV19CT1giOworICAg ICAgY2FzZSBNQ19CQVI6IHJldHVybiAi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JldHVybiAiTk9fQ0FDSEUiOworICAgICAgY2FzZSBNQ19DQUNIRTog cmV0dXJuICJNQ19DQUNIRSI7CisgICAgICBjYXNlIENIX0NBQ0hFOiByZXR1cm4gIkNIX0NBQ0hF IjsKKyAgICAgIGNhc2UgRkNfQ0FDSEU6IHJldHVybiAiRkNfQ0FDSEUiOworICAgICAgZGVmYXVs dDoKKyAgICAgIHJldHVybiAiVU5LTk9XTiI7CisgICAgfQorfQorCisvKiBVU0FHRTogIGZwcmlu dGYgKHN0ZGVyciwgIkFDVElPTi1UWVBFICglcykiLCBtY19lbmdpbmVfdHlwZV90b19zdHJpbmcg KGFyZykpOyAqLworY2hhciAqCittY19lbmdpbmVfdHlwZV90b19zdHJpbmcgKGVudW0gbWNfZW5n aW5lX3R5cGUgYWN0aW9uX3R5cGUpCit7CisgIHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgICAgewor ICAgICAgY2FzZSBNVUxUSVBMRV9DVVJTT1JTOiByZXR1cm4gIk1VTFRJUExFX0NVUlNPUlMiOwor ICAgICAgY2FzZSBIT1JJWk9OVEFMX1JVTEVSOiByZXR1cm4gIkhPUklaT05UQUxfUlVMRVIiOwor ICAgICAgY2FzZSBWRVJUSUNBTF9SVUxFUjogcmV0dXJuICJWRVJUSUNBTF9SVUxFUiI7CisgICAg ICBjYXNlIEZJTExfQ09MVU1OOiByZXR1cm4gIkZJTExfQ09MVU1OIjsKKyAgICAgIGNhc2UgQ1VS U09SX0lORElDQVRPUjogcmV0dXJuICJDVVJTT1JfSU5ESUNBVE9SIjsKKyAgICAgIGRlZmF1bHQ6 CisgICAgICByZXR1cm4gIlVOS05PV04iOworICAgIH0KK30KKworLyogVVNBR0U6ICBmcHJpbnRm IChzdGRlcnIsICJGUk9NX1dIRVJFICglcykiLCBtY19kcmF3X3Jvd190eXBlX3RvX3N0cmluZyAo YXJnKSk7ICovCitjaGFyICoKK21jX2RyYXdfcm93X3R5cGVfdG9fc3RyaW5nIChlbnVtIG1jX2Ry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ludCBjdXJzb3JzX3VzZWQgPSB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW2Nh Y2hlX3R5cGVdOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICBtYXRyaXguY3Vyc29yc191c2Vk WyVzXSAoJWQpXG4iLAorICAgICAgICAgICAgICAgICAgICAgICBtY19jYWNoZV90eXBlX3RvX3N0 cmluZyAoY2FjaGVfdHlwZSksIGN1cnNvcnNfdXNlZCk7CisgICAgfQorICBmb3IgKGludCB2bnRo ID0gMDsKKyAgICAgICB2bnRoIDwgdy0+bWNfbWF0cml4LnZwb3NfdXNlZDsKKyAgICAgICArK3Zu dGgpCisgICAgeworICAgICAgZm9yIChlbnVtIG1jX2NhY2hlX3R5cGUgY2FjaGVfdHlwZSA9IE1D X0NBQ0hFOworICAgICAgICAgICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7CisgICAgICAgICAgICsr Y2FjaGVfdHlwZSkKKyAgICAgICAgeworICAgICAgICAgIGludCBjYWNoZV9hbGxvY2F0ZWQgPSB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV07CisgICAg ICAgICAgaW50IGNhY2hlX3VzZWQgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV91c2Vk W2NhY2hlX3R5cGVdOworICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIiAgICB2bnRoICglZCkg fCBjYWNoZV9hbGxvY2F0ZWRbJXNdICglZCkgfCBjYWNoZV91c2VkWyVzXSAoJWQpXG4iLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgdm50aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg IG1jX2NhY2hlX3R5cGVfdG9fc3RyaW5nIChjYWNoZV90eXBlKSwKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgIGNhY2hlX2FsbG9jYXRlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG1j X2NhY2hlX3R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LCBmaWxsX2NvbHVt bikpOworICBpbnQgZmlsbF9jb2wgPSBYRklYTlVNIChCVkFSIChiLCBmaWxsX2NvbHVtbikpOwor ICBpbnQgaHNjbF94ID0gdy0+aHNjcm9sbCAqIGZyYW1lX2NoYXJfd2lkdGg7CisgIGlmIChiICE9 IGN1cnJlbnRfYnVmZmVyKQorICAgIHsKKyAgICAgIG9sZF9idWZmZXIgPSBjdXJyZW50X2J1ZmZl cjsKKyAgICAgIHNldF9idWZmZXJfaW50ZXJuYWwgKGIpOworICAgIH0KKyAgZXNzZW50aWFscy0+ enYgPSBaVjsKKyAgZXNzZW50aWFscy0+enZfYnl0ZSA9IFpWX0JZVEU7CisgIGVzc2VudGlhbHMt PmZjX3ggPSAoZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChW ZGlzcGxheV9saW5lX251bWJlcnMpKQorICAgICAgICAgICAgICAgICAgICAgICA/IChmaWxsX2Nv bCAqIGZyYW1lX2NoYXJfd2lkdGgpICsgdy0+bWMubG51bV9waXhlbF93aWR0aCAtIGhzY2xfeAor ICAgICAgICAgICAgICAgICAgICAgOiAoZmlsbF9jb2x1bW5fcAorICAgICAgICAgICAgICAgICAg ICAgICAgJiYgTklMUCAoVmRpc3BsYXlfbGluZV9udW1iZXJzKSkKKyAgICAgICAgICAgICAgICAg ICAgICAgPyAoZmlsbF9jb2wgKiBmcmFtZV9jaGFyX3dpZHRoKSAtIGhzY2xfeAorICAgICAgICAg ICAgICAgICAgICAgOiAwOworICBpZiAob2xkX2J1ZmZlcikKKyAgICBzZXRfYnVmZmVyX2ludGVy bmFsIChvbGRfYnVmZmVyKTsKKyAgZW51bSBmYWNlX2lkIGZpbGxfY29sdW1uX3ByZV96dl9mYWNl X2lkID0KKyAgICAoIWVzc2VudGlhbHMtPmFjdGl2ZV9wCisgICAgICYmICFOSUxQIChCVkFSIChY QlVGRkVSICh3LT5jb250ZW50cyksIGZjX2luYWN0aXZlX3dpbmRvd3MpKQorICAgICAmJiBOSUxQ IChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKSkKKyAgICAgID8gbG9v a3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoImZjLWluYWN0aXZlLXByZS16di1mYWNlIiks IHRydWUpCisgICAgOiAoIWVzc2VudGlhbHMtPmFjdGl2ZV9wCisgICAgICAgJiYgIU5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfaW5hY3RpdmVfd2luZG93cykpCisgICAgICAg JiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jvc3NoYWlycykpCisgICAg ICAgJiYgIU5JTFAgKEJWQVIgKGIsIGNoX3ZlcnRpY2FsX3J1bGVyKSkKKyAgICAgICAmJiB3LT5j dXJzb3IueCA9PSBlc3NlbnRpYWxzLT5mY194KQorICAgICAgPyBsb29rdXBfbmFtZWRfZmFjZSAo dywgZiwgaW50ZXJuICgiZmMtb3BvaW50LWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpCisg ICAgOiAoZXNzZW50aWFscy0+YWN0aXZlX3AKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwg Y2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICYmIHctPmN1cnNvci54ID09IGVzc2VudGlhbHMt PmZjX3gpCisgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCJmYy1vcG9p bnQtcHJlLXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICA6ICghZXNzZW50aWFscy0+YWN0aXZlX3AKKyAg ICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY19pbmFjdGl2ZV93 aW5kb3dzKSkKKyAgICAgICAmJiAh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ody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAgICAgICAmJiAhTklMUCAo QlZBUiAoYiwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICYmIHctPmN1cnNvci54ID09IGVz c2VudGlhbHMtPmZjX3gpCisgICAgICA/IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4g KCJmYy1vcG9pbnQtYXQtenYtZmFjZSIpLCB0cnVlKQorICAgIDogKCFlc3NlbnRpYWxzLT5hY3Rp dmVfcAorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX2lu YWN0aXZlX3dpbmRvd3MpKQorICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250 ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICYmICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNh bF9ydWxlcikpCisgICAgICAgJiYgdy0+Y3Vyc29yLnggIT0gZXNzZW50aWFscy0+ZmNfeCkKKyAg ICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoImZjLWluYWN0aXZlLWF0LXp2 LWZhY2UiKSwgdHJ1ZSkKKyAgICA6IChlc3NlbnRpYWxzLT5hY3RpdmVfcAorICAgICAgICYmICFO SUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQorICAgICAgICYm ICFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgJiYgdy0+Y3Vyc29y LnggIT0gZXNzZW50aWFscy0+ZmNfeCkKKyAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYs IGludGVybiAoImZjLWF0LXp2LWZhY2UiKSwgdHJ1ZSkKKyAgICA6IGxvb2t1cF9uYW1lZF9mYWNl ICh3LCBmLCBpbnRlcm4gKCJmYy1hdC16di1mYWNlIiksIHRydWUpOworICBzdHJ1Y3QgZm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KTsKKyAgICAgIHB0cmRpZmZfdCBjdXJyZW50X2NvbCA9IG1jX2N1cnJl bnRfY29sdW1uICh3LCBwb3NpbnQpOworICAgICAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIg KHctPmNvbnRlbnRzKTsKKyAgICAgIGJvb2wgZmlsbF9jb2x1bW5fcCA9ICFOSUxQIChCVkFSIChi LCBmaWxsX2NvbHVtbikpOworICAgICAgaW50IGZpbGxfY29sID0gKGZpbGxfY29sdW1uX3ApCisg ICAgICAgICAgICAgICAgICAgICA/IFhGSVhOVU0gKEJWQVIgKGIsIGZpbGxfY29sdW1uKSkKKyAg ICAgICAgICAgICAgICAgICAgIDogMDsKKyAgICAgIGVudW0gZmFjZV9pZCBldmVuX2ZhY2VfaWQg PQorICAgICAgICAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICYmICFOSUxQIChCVkFS IChYQlVGRkVSICh3LT5jb250ZW50cyksIGNoX2luYWN0aXZlX3dpbmRvd3MpKSkKKyAgICAgICAg PyBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1ldmVuLWluYWN0aXZlLXByZS16 di1mYWNlIiksIHRydWUpCisgICAgICAgIDogbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVy biAoIistZXZlbi1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgIHN0cnVjdCBmYWNlICpldmVu X2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGV2ZW5fZmFjZV9pZCk7CisgICAgICBMaXNwX09iamVj dCBldmVuX2NvbG9yID0gZXZlbl9mYWNlLT5sZmFjZVtMRkFDRV9GT1JFR1JPVU5EX0lOREVYXTsK KyAgICAgIHN0cnVjdCBtY19SR0IgZXZlbl9mb3JlZ3JvdW5kOworICAgICAgbWNfeHdfY29sb3Jf dmFsdWVzICh3LCBldmVuX2NvbG9yLCAmZXZlbl9mb3JlZ3JvdW5kKTsKKyAgICAgIGVudW0gZ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dHJ1ZSk7CisgICAgICBzdHJ1Y3QgZmFjZSAqYmV5b25kX2ZpbGxfZmFjZSA9 IEZBQ0VfRlJPTV9JRCAoZiwgYmV5b25kX2ZpbGxfZmFjZV9pZCk7CisgICAgICBMaXNwX09iamVj dCBiZXlvbmRfZmlsbF9jb2xvciA9IGJleW9uZF9maWxsX2ZhY2UtPmxmYWNlW0xGQUNFX0ZPUkVH Uk9VTkRfSU5ERVhdOworICAgICAgc3RydWN0IG1jX1JHQiBiZXlvbmRfZmlsbF9mb3JlZ3JvdW5k OworICAgICAgbWNfeHdfY29sb3JfdmFsdWVzICh3LCBiZXlvbmRfZmlsbF9jb2xvciwgJmJleW9u ZF9maWxsX2ZvcmVncm91bmQpOworICAgICAgLyogcmVkICovCisgICAgICBpZiAoKCFmaWxsX2Nv bHVtbl9wCisgICAgICAgICAgICYmIGN1cnJlbnRfY29sICUgMiAhPSAwCisgICAgICAgICAgICYm IHJvd19wb3NpdGlvbiA9PSBQUkVfWlYpCisgICAgICAgICAgfHwgKGZpbGxfY29sdW1uX3AKKyAg ICAgICAgICAgICAgJiYgY3VycmVudF9jb2wgJSAyICE9IDAKKyAgICAgICAgICAgICAgJiYgY3Vy cmVudF9jb2wgPD0gZmlsbF9jb2wKKyAgICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBS RV9aVikpCisgICAgICAgIHsKKyAgICAgICAgICBsc2xfZmctPnJlZCA9IG9kZF9mb3JlZ3JvdW5k LnJlZDsKKyAgICAgICAgICBsc2xfZmctPmdyZWVuID0gb2RkX2ZvcmVncm91bmQuZ3JlZW47Cisg ICAgICAgICAgbHNsX2ZnLT5ibHVlID0gb2RkX2ZvcmVncm91bmQuYmx1ZTsKKyAgICAgICAgfQor ICAgICAgICAvKiB5ZWxsb3cgKi8KKyAgICAgICAgZWxzZSBpZiAoKCFmaWxsX2NvbHVtbl9wCisg ICAgICAgICAgICAgICAgICAmJiBjdXJyZW50X2NvbCAlIDIgPT0gMAorICAgICAgICAgICAgICAg ICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVikKKyAgICAgICAgICAgICAgICAgfHwgKGZpbGxf Y29sdW1uX3AKKyAgICAgICAgICAgICAgICAgICAgICYmIGN1cnJlbnRfY29sICUgMiA9PSAwCisg ICAgICAgICAgICAgICAgICAgICAmJiBjdXJyZW50X2NvbCA8PSBmaWxsX2NvbAorICAgICAgICAg ICAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IFBSRV9aVikpCisgICAgICAgICAgeworICAg ICAgICAgICAgbHNsX2ZnLT5yZWQgPSBldmVuX2ZvcmVncm91bmQucmVkOworICAgICAgICAgICAg bHNsX2ZnLT5ncmVlbiA9IGV2ZW5fZm9yZWdyb3VuZC5ncmVlbjsKKyAgICAgICAgICAgIGxzbF9m Zy0+Ymx1ZSA9IGV2ZW5fZm9yZWdyb3VuZC5ibHVlOworICAgICAgICAgIH0KKyAgICAgICAgICAv KiBncmVlbiAqLworICAgICAgICAgIGVsc2UgaWYgKGZpbGxfY29sdW1uX3AKKyAgICAgICAgICAg ICAgICAgICAmJiBjdXJyZW50X2NvbCA+IGZpbGxfY29sCisgICAgICAgICAgICAgICAgICAgJiYg cm93X3Bvc2l0aW9uID09IFBSRV9aVikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgbHNs X2ZnLT5yZWQgPSBiZXlvbmRfZmlsbF9mb3JlZ3JvdW5kLnJlZDsKKyAgICAgICAgICAgICAgbHNs X2ZnLT5ncmVlbiA9IGJleW9uZF9maWxsX2ZvcmVncm91bmQuZ3JlZW47CisgICAgICAgICAgICAg IGxzbF9mZy0+Ymx1ZSA9IGJleW9uZF9maWxsX2ZvcmVncm91bmQuYmx1ZTsKKyAgICAgICAgICAg IH0KKyAgICAgICAgICAgIGVsc2UgaWYgKHJvd19wb3NpdGlvbiA9PSBBVF9aVikKKyAgICAgICAg ICAgICAgeworICAgICAgICAgICAgICAgIGxzbF9mZy0+cmVkID0gZXNzZW50aWFscy5zcF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Xp2LWZhY2UiKSwgdHJ1ZSkKKyAgICAgICAgOiAoIWVzc2VudGlhbHMuYWN0aXZlX3AK KyAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaW5h Y3RpdmVfd2luZG93cykpCisgICAgICAgICAgICYmIHJvd19wb3NpdGlvbiA9PSBBVF9aVikKKyAg ICAgICAgICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtl LWN1cnNvci1pbmFjdGl2ZS1hdC16di1mYWNlIiksIHRydWUpCisgICAgICAgIDogKGVzc2VudGlh bHMuYWN0aXZlX3AKKyAgICAgICAgICAgJiYgcm93X3Bvc2l0aW9uID09IEFUX1pWKQorICAgICAg ICAgID8gbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNv ci1hdC16di1mYWNlIiksIHRydWUpCisgICAgICAgIDogbG9va3VwX25hbWVkX2ZhY2UgKHcsIGYs IGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1hdC16di1mYWNlIiksIHRydWUpOworICAgICAg c3RydWN0IGZhY2UgKmN1cnNvcl9mYWNlID0gRkFDRV9GUk9NX0lEIChmLCBjdXJzb3JfZmFjZV9p ZCk7CisgICAgICBMaXNwX09iamVjdCBjdXJzb3JfY29sb3IgPSBjdXJzb3JfZmFjZS0+bGZhY2Vb TEZBQ0VfRk9SRUdST1VORF9JTkRFWF07CisgICAgICBtY194d19jb2xvcl92YWx1ZXMgKHcsIGN1 cnNvcl9jb2xvciwgbHNsX2ZnKTsKKyAgICAgIGJyZWFrOworICAgIH0KKyAgfQorfQorCisvKiBE cmF3IGdseXBocyBiZXR3ZWVuIFNUQVJUIGFuZCBFTkQgaW4gQVJFQSBvZiBST1cgb24gd2luZG93 IFcsCisgICBzdGFydGluZyBhdCB4LXBvc2l0aW9uIFguICBYIGlzIHJlbGF0aXZlIHRvIE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93KQorICAgICAgICAg ICAgeworICAgICAgICAgICAgICBjaGVja19tb3VzZV9mYWNlID0gdHJ1ZTsKKyAgICAgICAgICAg ICAgbW91c2VfYmVnX2NvbCA9IChyb3dfdnBvcyA9PSBobGluZm8tPm1vdXNlX2ZhY2VfYmVnX3Jv dykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gaGxpbmZvLT5tb3VzZV9mYWNlX2Jl Z19jb2wKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogMDsKKyAgICAgICAgICAgICAg bW91c2VfZW5kX2NvbCA9IChyb3dfdnBvcyA9PSBobGluZm8tPm1vdXNlX2ZhY2VfZW5kX3JvdykK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gaGxpbmZvLT5tb3VzZV9mYWNlX2VuZF9j b2wKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogcm93LT51c2VkW1RFWFRfQVJFQV07 CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIC8qIENvbXB1dGUgb3ZlcmhhbmdzIGZv ciBhbGwgZ2x5cGggc3RyaW5ncy4gKi8KKyAgICAgIGlmIChGUkFNRV9SSUYgKGYpLT5jb21wdXRl X2dseXBoX3N0cmluZ19vdmVyaGFuZ3MpCisgICAgICAgIGZvciAocyA9IGhlYWQ7IHM7IHMgPSBz LT5uZXh0KQorICAgICAgICAgIEZSQU1FX1JJRiAoZiktPmNvbXB1dGVfZ2x5cGhfc3RyaW5nX292 ZXJoYW5ncyAocyk7CisgICAgICAvKiBQcmVwZW5kIGdseXBoIHN0cmluZ3MgZm9yIGdseXBocyBp biBmcm9udCBvZiB0aGUgZmlyc3QgZ2x5cGgKKyAgICAgIHN0cmluZyB0aGF0IGFyZSBvdmVyd3Jp dHRlbiBiZWNhdXNlIG9mIHRoZSBmaXJzdCBnbHlwaAorICAgICAgc3RyaW5nJ3MgbGVmdCBvdmVy aGFuZy4gIFRoZSBiYWNrZ3JvdW5kIG9mIGFsbCBzd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KKyAgICAgICAgICAod2hpY2ggaGFzIG5vIGJ1ZmZl ciBwb3NpdGlvbikuICBXaGVuIHBsYWNpbmcgYSBmYWtlIGN1cnNvciBvbiB0aGUgIk0iLAorICAg ICAgICAgIGhsID09IERSQVdfQ1VSU09SIGFuZCB0aGUgU1RSRVRDSF9HTFlQSCBpcyBgbGVmdF9v dmVyd3JpdHRlbmAuICBEcmF3aW5nCisgICAgICAgICAgbm9ybWFsIHRleHQgZHVyaW5nIGB1cGRh dGVfd2luZG93JyAoRFJBV19OT1JNQUxfVEVYVCkgY2FuIGFsc28gZXJhc2UgZmFrZQorICAgICAg ICAgIGN1cnNvcnMgdGhhdCBhcmUgYGxlZnRfb3ZlcndyaXR0ZW4nLiAqLworICAgICAgICAgIGxl bmd0aCA9IDA7CisgICAgICAgICAgZm9yIChzID0gaDsgczsgcyA9IHMtPm5leHQpCisgICAgICAg ICAgICB7CisgICAgICAgICAgICAgIHMtPmxlZnRfb3ZlcndyaXR0ZW5fcCA9IHRydWU7CisgICAg ICAgICAgICAgIHMtPmFjdGlvbl90eXBlID0gYWN0aW9uX3R5cGU7CisgICAgICAgICAgICAgIGxl bmd0aCArPSBzLT5maXJzdF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICB9CisgICAg ICAgICAgcmVsYXRpdmVfeCA9IHN0YXJ0X3ggLSBsZW5ndGg7CisgICAgICAgICAgZm9yIChzID0g aDsgczsgcyA9IHMtPm5leHQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHMtPmZpcnN0 X2dseXBoLT5yZWxhdGl2ZV94ID0gcmVsYXRpdmVfeDsKKyAgICAgICAgICAgICAgcmVsYXRpdmVf eCArPSBzLT5maXJzdF9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAg ICAgc3RhcnQgPSBpOworICAgICAgICAgIGNvbXB1dGVfb3ZlcmhhbmdzX2FuZF94ICh0LCBoZWFk LT54LCB0cnVlKTsKKyAg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gICAgICAgICAgICAg b3ZlcmxhcF9obCA9IERSQVdfTk9STUFMX1RFWFQ7CisgICAgICAgICAgaWYgKGhsID09IG92ZXJs YXBfaGwgfHwgY2xpcF9oZWFkID09IE5VTEwpCisgICAgICAgICAgICBjbGlwX2hlYWQgPSBoZWFk OworICAgICAgICAgIE1DX0JVSUxEX0dMWVBIX1NUUklOR1MgKGksIHN0YXJ0LCBoLCB0LCBvdmVy bGFwX2hsLCBkdW1teV94LCBsYXN0X3gpOworICAgICAgICAgIGZvciAocyA9IGg7IHM7IHMgPSBz LT5uZXh0KQorICAgICAgICAgICAgcy0+YmFja2dyb3VuZF9maWxsZWRfcCA9IHRydWU7CisgICAg ICAgICAgY29tcHV0ZV9vdmVyaGFuZ3NfYW5kX3ggKHQsIGhlYWQtPngsIHRydWUpOworICAgICAg ICAgIHByZXBlbmRfZ2x5cGhfc3RyaW5nX2xpc3RzICgmaGVhZCwgJnRhaWwsIGgsIHQpOworICAg ICAgICB9CisgICAgICAvKiBBcHBlbmQgZ2x5cGhzIHN0cmluZ3MgZm9yIGdseXBocyBmb2xsb3dp bmcgdGhlIGxhc3QgZ2x5cGgKKyAgICAgIHN0cmluZyB0YWlsIHRoYXQgYXJlIG92ZXJ3cml0dGVu IGJ5IHRhaWwuICBUaGUgYmFja2dyb3VuZCBvZgorICAgICAgdGhlc2Ugc3RyaW5ncyBoYXMgdG8g YmUgZHJhd24gYmVjYXVzZSB0YWlsJ3MgZm9yZWdyb3VuZCBkcmF3cworICAgICAgb3ZlciBpdC4g Ki8KKyAgICAgIGkgPSByaWdodF9vdmVyd3JpdHRlbiAodGFpbCk7CisgICAgICBpZiAoaSA+PSAw KQorICAgICAgICB7CisgICAgICAgICAgZW51bSBkcmF3X2dseXBoc19mYWNlIG92ZXJsYXBfaGw7 CisgICAgICAgICAgaWYgKGNoZWNrX21vdXNlX2ZhY2UKKyAgICAgICAgICAgICAgJiYgbW91c2Vf YmVnX2NvbCA8IGkgJiYgbW91c2VfZW5kX2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291bGQKKyAgICAgIHBhaW50IG92ZXIgdGhlIGZv cmVncm91bmQgb2YgZm9sbG93aW5nIGdseXBocy4gKi8KKyAgICAgIGkgPSByaWdodF9vdmVyd3Jp dGluZyAodGFpbCk7CisgICAgICBpZiAoaSA+PSAwKQorICAgICAgICB7CisgICAgICAgICAgZW51 bSBkcmF3X2dseXBoc19mYWNlIG92ZXJsYXBfaGw7CisgICAgICAgICAgaWYgKGNoZWNrX21vdXNl X2ZhY2UKKyAgICAgICAgICAgICAgJiYgbW91c2VfYmVnX2NvbCA8IGkgJiYgbW91c2VfZW5kX2Nv bCA+IGVuZCkKKyAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX01PVVNFX0ZBQ0U7CisgICAg ICAgICAgICBlbHNlCisgICAgICAgICAgICAgIG92ZXJsYXBfaGwgPSBEUkFXX05PUk1BTF9URVhU OworICAgICAgICAgIGlmIChobCA9PSBvdmVybGFwX2hsIHx8IGNsaXBfdGFpbCA9PSBOVUxMKQor ICAgICAgICAgICAgY2xpcF90YWlsID0gdGFpbDsKKyAgICAgICAgICBpKys7ICAgICAgLyogV2Ug bXVzdCBpbmNsdWRlIHRoZSBJdGggZ2x5cGguICovCisgICAgICAgICAgTUNfQlVJTERfR0xZUEhf U1RSSU5HUyAoZW5kLCBpLCBoLCB0LCBvdmVybGFwX2hsLCB4LCBsYXN0X3gpOworICAgICAgICAg IGZvciAocyA9IGg7IHM7IHMgPSBzLT5uZXh0KQorICAgICAgICAgICAgcy0+YmFja2dyb3VuZF9m aWxsZWRfcCA9IHRydWU7CisgICAgICAgICAgY29tcHV0ZV9vdmVyaGFuZ3NfYW5kX3ggKGgsIHRh aWwtPnggKyB0YWlsLT53aWR0aCwgZmFsc2UpOworICAgICAgICAgIGFwcGVuZF9nbHlwaF9zdHJp bmdfbGlzdHMgKCZoZWFkLCAmdGFpbCwgaCwgdCk7CisgICAgICAgIH0KKyAgICAgIHRhaWwgPSBn bHlwaF9zdHJpbmdfY29udGFpbmlu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BpbiBnbHlwaCByb3cgUk9XLiAgU2VlIHRoZQorICAgY29tbWVu dCBvZiBkcmF3X2dseXBocyBmb3IgdGhlIG1lYW5pbmcgb2YgSEwuICovCit2b2lkCittY19kcmF3 X2N1cnNvcl9nbHlwaCAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0 cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpyb3csCisgICAgICAgICAgICAgICAgICAgICAgZW51bSBk cmF3X2dseXBoc19mYWNlIGhsLCBpbnQgeCwgaW50IGhwb3MsIGludCB2cG9zLAorICAgICAgICAg ICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsLCBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2 b3IsCisgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlw ZSwgaW50IHdkLCBib29sIGFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAgICAgIGJvb2wgY3Vy c29yX2djX3ApCit7CisgIC8vICBzdHJ1Y3QgZ2x5cGggKmN1cnNvcl9nbHlwaCA9IG1jX2dldF9j dXJzb3JfZ2x5cGggKHcsIG1hdHJpeCwgcm93LCBocG9zLCB2cG9zKTsKKyAgLy8gIGZwcmludGYg KHN0ZGVyciwgIm1jX2RyYXdfY3Vyc29yX2dseXBoOiAgY2ggKCVkKSB8IHggKCVkKSwgaHBvcyAo JWQpLCB2cG9zKCVkKSwgaGwgKCVkKVxuIiwKKyAgLy8gICAgICAgICAgICAgICAgICAgIGN1cnNv cl9nbHlwaC0+dS5jaCwgeCwgaHBvcywgdnBvcywgaGwpOworICBibG9ja19pbnB1dCAoKTsKKyAg Ym9vbCBkcmF3X3AgPSB0cnVlOworICBtY19kcmF3X2dseXBocyAodywgbWF0cml4LCByb3csIHct Pm1jX21hdHJpeCwgeCwgVEVYVF9BUkVBLCBocG9zLCBocG9zICsgMSwgaGwsCisgICAgICAgICAg ICAgIC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ByZXR1cm4g KCVkKVxuIiwgMSk7CisgICAgICByZXR1cm47CisgICAgfQorICAvKiBWUE9TID49IG1hdHJpeC0+ bnJvd3MgbWVhbnMgdGhhdCB3aW5kb3cgaGFzIGJlZW4gcmVzaXplZC4KKyAgICAgRG9uJ3QgYm90 aGVyIHRvIGVyYXNlIHRoZSBjdXJzb3IuICovCisgIGlmICh2cG9zID49IG1hdHJpeC0+bnJvd3Mp CisgICAgeworICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIm1j X2VyYXNlX2N1cnNvcjogIHJldHVybiAoJWQpXG4iLCAyKTsKKyAgICAgIHJldHVybjsKKyAgICB9 CisgIC8qIElmIHJvdyBjb250YWluaW5nIGN1cnNvciBpcyBtYXJrZWQgaW52YWxpZCwgdGhlcmUg aXMgbm90aGluZyB3ZQorICAgICBjYW4gZG8uICovCisgIGlmICghcm93LT5lbmFibGVkX3ApCisg ICAgeworICAgICAgaWYgKGRlYnVnX3ApCisgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIm1jX2Vy YXNlX2N1cnNvcjogIHJldHVybiAoJWQpXG4iLCAzKTsKKyAgICAgIHJldHVybjsKKyAgICB9Cisg IC8qIElmIGxpbmUgc3BhY2luZyBpcyA+IDAsIG9sZCBjdXJzb3IgbWF5IG9ubHkgYmUgcGFydGlh bGx5IHZpc2libGUgaW4KKyAgICAgd2luZG93IGFmdGVyIHNwbGl0LXdpbmRvdy4gIFNvIGFkanVz dCB2aXNpYmxlIGhlaWdodC4gKi8KKyAgcm93LT52aXNpYmxlX2hlaWdodCA9IG1pbiAocm93LT52 aXNpYmxlX2hlaWdodCwKKyAgICAgICAgICAgIHdpbmRvd190ZXh0X2JvdHRvbV95ICh3KSAtIHJv dy0+eSk7CisgIC8qIElmIHJvdyBpcyBjb21wbGV0ZWx5IGludmlzaWJsZSwgZG9uJ3QgYXR0ZW1w dCB0byBkZWxldGUgYSBjdXJzb3Igd2hpY2gKKyAgICAg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vKiBEb24ndCByZWRyYXcgdGhlIGN1cnNvcidzIHNwb3Qg aW4gbW91c2UgZmFjZSBpZiBpdCBpcyBhdCB0aGUKKyAgICAgIGVuZCBvZiBhIGxpbmUgKG9uIGEg bmV3bGluZSkuICBUaGUgY3Vyc29yIGFwcGVhcnMgdGhlcmUsIGJ1dAorICAgICAgbW91c2UgaGln aGxpZ2h0aW5nIGRvZXMgbm90LiAqLworICAgICAgJiYgcm93LT51c2VkW1RFWFRfQVJFQV0gPiBo cG9zICYmIGhwb3MgPj0gMCkKKyAgICBtb3VzZV9mYWNlX2hlcmVfcCA9IHRydWU7CisgIC8qIE1h eWJlIGNsZWFyIHRoZSBkaXNwbGF5IHVuZGVyIHRoZSBjdXJzb3IuICovCisgIGlmIChjdXJzb3Jf dHlwZSA9PSBNQ19IT0xMT1dfQk9YCisgICAgICB8fCBjdXJzb3JfdHlwZSA9PSBNQ19GUkFNRURf Qk9YKQorICAgIHsKKyAgICAgIGludCB0ZW1wX3ggPSB4OworICAgICAgaW50IGhlYWRlcl9saW5l X2hlaWdodCA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICAgICAgY3Vyc29yX2ds eXBoID0gbWNfZ2V0X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIGhwb3MsIHZwb3MpOwor ICAgICAgaWYgKGN1cnNvcl9nbHlwaCA9PSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgaWYg KGRlYnVnX3ApCisgICAgICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJtY19lcmFzZV9jdXJzb3I6 ICByZXR1cm4gKCVkKVxuIiwgNyk7CisgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAg ICBpbnQgdGVtcF93ZCA9IGN1cnNvcl9nbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICBpZiAodGVt cF94IDwgMCkKKyAgICAgICAgeworICAgICAgICAgIHRlbXBfd2QgKz0gdGVtcF94OworICAgICAg ICAgIHRlbX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0cywKKyAgZWFzc2VydCAobWF0cml4 ICYmIG1hdHJpeC0+cm93cyk7CisgIGVhc3NlcnQgKHJvdyA+PSAwICYmIHJvdyA8IG1hdHJpeC0+ bnJvd3MpOyAqLworICBib29sIGJhcmZfY3Jhc2hfb25lID0gKG1hdHJpeCAmJiBtYXRyaXgtPnJv d3MpID8gZmFsc2UgOiB0cnVlOworICBpZiAoYmFyZl9jcmFzaF9vbmUpCisgICAgcmV0dXJuOwor ICBib29sIGJhcmZfY3Jhc2hfdHdvID0gKHZwb3MgPj0gMCAmJiB2cG9zIDwgbWF0cml4LT5ucm93 cykgPyBmYWxzZSA6IHRydWU7CisgIGlmIChiYXJmX2NyYXNoX3R3bykKKyAgICByZXR1cm47Cisg IGlmICh4IDwgMAorICAgICAgfHwgeSA8IDAKKyAgICAgIHx8IGhwb3MgPCAwCisgICAgICB8fCB2 cG9zIDwgMCkKKyAgICByZXR1cm47CisgIHN0cnVjdCBmcmFtZSAqZiA9IFhGUkFNRSAody0+ZnJh bWUpOworICBib29sIGF1dG9faHNjcm9sbF9tb2RlX3AgPSBFUSAoRmJ1ZmZlcl9sb2NhbF92YWx1 ZSAoUWF1dG9faHNjcm9sbF9tb2RlLCB3LT5jb250ZW50cyksIFFjdXJyZW50X2xpbmUpOworICAv KiBFWEFNUExFOiAgKHNjcm9sbC1sZWZ0IDUpICovCisgIGJvb2wgaHNjbF9hbGxfdGVtcF9wID0g KHctPnN1c3BlbmRfYXV0b19oc2Nyb2xsCisgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGF1 dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9s bCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+bWluX2hzY3JvbGwgPT0gMCk7 CisgIC8qIEVYQU1QTEU6ICBDLXUgQy14IDwgYW5kIGRvIG5vdGhpbmcuICovCisgIGJvb2wgaHNj bF9hbGxfcGVybV8wX3AgPSAody0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5t aW5faHNjcm9sbCA9PSB3LT5oc2Nyb2xsKTsKKyAgLyogRVhBTVBMRTogIEMtdSBDLXggPCBhbmQg ZG8gc29tZXRoaW5nIGVsc2UgYmVzaWRlcyBob3Jpem9udGFsbHkgc2Nyb2xsaW5nIHRoZQorICAg ICAgICAgICAgICAgY3VycmVudCBsaW5lIGRpZmZlcmVudGx5LgorICAgICAgICAgICAgICAgQ3Vy cmVudCBsaW5lIGlzIF9ub3RfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4gKi8K KyAgYm9vbCBoc2NsX2FsbF9wZXJtXzFfcCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBhdXRvX2hzY3JvbGxfbW9kZV9wCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgdy0+aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiB3LT5taW5faHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiB3LT5taW5faHNjcm9sbCA9PSB3LT5oc2Nyb2xsKTsKKyAgLyogRVhBTVBMRTogIEMt dSBDLXggPCBhbmQgLi4uCisgICAgICAgICAgICAgICBDdXJyZW50IGxpbmUgaXMgX25vdF8gaG9y aXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfYWxsX3Blcm1f Ml9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiB3LT5oc2Nyb2xsID09IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5f aHNjcm9sbCA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5taW5faHNjcm9s bCAhPSB3LT5oc2Nyb2xsKTsKKyAgLyogRVhBTVBMRTogIChzY3JvbGwtbGVmdCA1KTsgYW5kLCB0 aGVuIHByZXNzIHRoZSBsZWZ0IGFycm93IGtleSBvbmUgdGltZS4KKyAgICAgICAgICAgICAgIEN1 cnJlbnQgbGluZSBfaXNfIGhvcml6b250YWxseSBzY3JvbGxlZCBkaWZmZXJlbnRseS4qLworICBi b29sIGhzY2xfdGVtcF9wID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAg ICAgICAgICAgICYmIGF1dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAm JiB3LT5oc2Nyb2xsID4gMAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xs ID09IDApOworICAvKiBFWEFNUExFOiAgQy11IEMteCA8IGFuZCBkbyBzb21ldGhpbmcgdGhhdCBj YXVzZXMgdGhlIGN1cnJlbnQgbGluZSB0byBiZQorICAgICAgICAgICAgICAgaG9yaXpvbnRhbGx5 IHNjcm9sbGVkIGRpZmZlcmVudGx5LgorICAgICAgICAgICAgICAgQ3VycmVudCBsaW5lIF9pc18g aG9yaXpvbnRhbGx5IHNjcm9sbGVkIGRpZmZlcmVudGx5LiAqLworICBib29sIGhzY2xfcGVybV9w ID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAorICAgICAgICAgICAgICAgICAgICAgICYmIGF1 dG9faHNjcm9sbF9tb2RlX3AKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4g MAorICAgICAgICAgICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsID4gMAorICAgICAgICAg ICAgICAgICAgICAgICYmIHctPm1pbl9oc2Nyb2xsICE9IHctPmhzY3JvbGwpOworICBpbnQgZnJp bmdlX2JpdG1hcCA9IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgIGludCBmYWNlX2lkID0gREVGQVVM VF9GQUNFX0lEOworICBpZiAoIXJlbW92ZV9wCisgICAgICAmJiBnbHlwaF9mbGF2b3IgPT0gTUNf T1ZFUkxBWV9BUlJPV19CSVRNQVAKKyAgICAgICYmICFoc2NsX2FsbF90ZW1wX3AKKyAgICAgICYm ICFoc2NsX3RlbXBfcAorICAgICAgJiYgIWhzY2xfcGVybV9wCisgICAgICAmJiAhaHNjbF9hbGxf cGVybV8wX3AKKyAgICAgICYmICFoc2NsX2FsbF9wZXJtXzFfcAorICAgICAgJiYgIWhzY2xfYWxs X3Blcm1fMl9wKQorICAgIHsKKyAgICAgIGVudW0gZmFjZV9pZCBvdmVybGF5X2Fycm93X2ZhY2Vf aWQgPQorICAgICAgICAoIWFjdGl2ZV9wCisgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBjaF9pbmFjdGl2ZV93aW5kb3dzKSkpCisgICAgICAgID8gbG9va3Vw X2Rlcml2ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFycm93LWluYWN0aXZlLXBy ZS16di1mYWNlIiksIEZSSU5HRV9GQUNFX0lELCB0cnVlKQorICAgICAgICA6IChhY3RpdmVfcCkK KyAgICAgICAgICA/IGxvb2t1cF9kZXJpdmVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistb3Zlcmxh eS1hcnJvdy1wcmUtenYtZmFjZSIpLCBGUklOR0VfRkFDRV9JRCwgdHJ1ZSkKKyAgICAgICAgOiBE RUZBVUxUX0ZBQ0VfSUQ7CisgICAgICBmYWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRf RlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICA/IG92ZXJsYXlfYXJyb3dfZmFjZV9pZAor ICAgICAgICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgaWYgKHctPmhzY3JvbGwg IT0gMCkKKyAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBp bnRlcm4gKCIrLW92ZXJsYXktYXJyb3ciKSwgZmFsc2UsIHRydWUpOworICAgICAgICBlbHNlCisg ICAgICAgICAgZnJpbmdlX2JpdG1hcCA9IG1jX2dldF9mcmluZ2VfYml0bWFwICh3LCBpbnRlcm4g KCIrLW92ZXJsYXktYXJyb3ciKSwgdHJ1ZSwgdHJ1ZSk7CisgICAgICByb3ctPmxlZnRfZnJpbmdl X2JpdG1hcCA9IChjdXJzb3JfdHlwZSA9PSBNQ19MRUZUX0ZSSU5HRV9CSVRNQVApCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IE1DX05PX0ZSSU5HRV9CSVRNQVA7CisgICAgICByb3ctPmxlZnRf ZnJpbmdlX2ZhY2VfaWQgPSBmYWNlX2lkOworICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9vZmZzZXQg PSAwOworICAgICAgcm93LT5mcmluZ2VfYml0bWFwX3BlcmlvZGljX3AgPSBmYWxzZTsKKyAgICB9 CisgICAgZWxzZSBpZiAoIXJlbW92ZV9wCisgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yID09 IE1DX09WRVJMQVlfQVJST1dfQklUTUFQCisgICAgICAgICAgICAgJiYgKGhzY2xfYWxsX3RlbXBf cAorICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJtXzBfcAorICAgICAgICAgICAgICAg ICB8fCBoc2NsX2FsbF9wZXJtXzFfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX2FsbF9wZXJt XzJfcAorICAgICAgICAgICAgICAgICB8fCBoc2NsX3RlbXBfcAorICAgICAgICAgICAgICAgICB8 fCBoc2NsX3Blcm1fcCkpCisgICAgICB7CisgICAgICAgIGVudW0gZmFjZV9pZCBvdmVybGF5X2Fy cm93X2ZhY2VfaWQgPQorICAgICAgICAgICghYWN0aXZlX3AKKyAgICAgICAgICAgJiYgIU5JTFAg KEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfaW5hY3RpdmVfd2luZG93cykpKQorICAg ICAgICAgID8gbG9va3VwX2Rlcml2ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1vdmVybGF5LWFy cm93LWhzY2wtaW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwgRlJJTkdFX0ZBQ0VfSUQsIHRydWUpCisg ICAgICAgICAgOiAoYWN0aXZlX3ApCisgICAgICAgICAgICA/IGxvb2t1cF9kZXJpdmVkX2ZhY2Ug KHcsIGYsIGludGVybiAoIistb3ZlcmxheS1hcnJvdy1oc2NsLXByZS16di1mYWNlIiksIEZSSU5H RV9GQUNFX0lELCB0cnVlKQorICAgICAgICAgIDogREVGQVVMVF9GQUNFX0lEOworICAgICAgICBm YWNlX2lkID0gKGN1cnNvcl90eXBlID09IE1DX0xFRlRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAg ICAgICAgICAgID8gb3ZlcmxheV9hcnJvd19mYWNlX2lkCisgICAgICAgICAgICAgICAgICA6IERF RkFVTFRfRkFDRV9JRDsKKyAgICAgICAgaWYgKGhzY2xfYWxsX3Blcm1fMF9wKQorICAgICAgICAg IGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2Ns LXBlcm0iKSwgZmFsc2UsIGZhbHNlKTsKKyAgICAgICAgICBlbHNlIGlmIChoc2NsX2FsbF9wZXJt XzFfcCkKKyAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdlX2JpdG1hcCAo dywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgdHJ1ZSwgZmFsc2UpOworICAgICAgICAgICAgZWxz ZSBpZiAoaHNjbF9hbGxfcGVybV8yX3ApCisgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBt Y19nZXRfZnJpbmdlX2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXBlcm0iKSwgZmFsc2UsIHRy dWUpOworICAgICAgICAgICAgICBlbHNlIGlmIChoc2NsX3Blcm1fcCkKKyAgICAgICAgICAgICAg ICBmcmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNj bC1wZXJtIiksIHRydWUsIHRydWUpOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xfYWxs X3RlbXBfcCkKKyAgICAgICAgICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSBtY19nZXRfZnJpbmdl X2JpdG1hcCAodywgaW50ZXJuICgiKy1oc2NsLXRlbXAiKSwgZmFsc2UsIGZhbHNlKTsKKyAgICAg ICAgICAgICAgICAgIGVsc2UgaWYgKGhzY2xfdGVtcF9wKQorICAgICAgICAgICAgICAgICAgICBm cmluZ2VfYml0bWFwID0gbWNfZ2V0X2ZyaW5nZV9iaXRtYXAgKHcsIGludGVybiAoIistaHNjbC10 ZW1wIiksIHRydWUsIGZhbHNlKTsKKyAgICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9iaXRtYXAgPSAo Y3Vyc29yX3R5cGUgPT0gTUNfTEVGVF9GUklOR0VfQklUTUFQKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgID8gZnJpbmdlX2JpdG1hcAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogTUNfTk9fRlJJTkdFX0JJVE1BUDsKKyAgICAgICAgcm93LT5sZWZ0X2ZyaW5n ZV9mYWNlX2lkID0gZmFjZV9pZDsKKyAgICAgICAgcm93LT5sZWZ0X2ZyaW5nZV9vZmZzZXQgPSAw OworICAgICAgICByb3ctPmZyaW5nZV9iaXRtYXBfcGVyaW9kaWNfcCA9IGZhbHNlOworICAgICAg fQorICAgICAgZWxzZSBpZiAoIXJlbW92ZV9wCisgICAgICAgICAgICAgICAmJiAoZ2x5cGhfZmxh dm9yID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAg ICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfSE9MTE9XX1JFQ1RBTkdMRV9SSUdIVF9B UlJPVworICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19IT0xMT1dfUkVD VEFOR0xFCisgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FM X0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBN Q19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICB8 fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgfHwg Z2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAg ICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFDS1NMQVNIKSkKKyAgICAg ICAgeworICAgICAgICAgIExpc3BfT2JqZWN0IGJpdG1hcF9mbGF2b3IgPSAoZ2x5cGhfZmxhdm9y ID09IE1DX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gUW1jX2hvbGxvd19yZWN0YW5nbGVfcmlnaHRfYXJyb3cKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfZmxhdm9yID09IE1D X1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfaG9sbG93X3JlY3RhbmdsZV9y aWdodF9hcnJvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlw aF9mbGF2b3IgPT0gTUNfSE9MTE9XX1JFQ1RBTkdMRSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IFFtY19ob2xsb3dfcmVjdGFuZ2xlCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJf UklHSFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBR bWNfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklH SFRfQVJST1cpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNf cmV2ZXJzZWRfdmVydGljYWxfYmFyX3JpZ2h0X2Fycm93CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVIpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBRbWNfdmVydGljYWxfYmFyCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBN Q19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBRbWNfcmV2ZXJzZWRfdmVydGljYWxfYmFyCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogKGdseXBoX2ZsYXZvciA9PSBNQ19WRVJUSUNBTF9CQVJfQkFD S1NMQVNIKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gUW1jX3Zl cnRpY2FsX2Jhcl9iYWNrc2xhc2gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgOiBRbmlsOworICAgICAgICAgIGZyaW5nZV9iaXRtYXAgPSAoY3Vyc29yX3R5cGUgPT0gTUNf UklHSFRfRlJJTkdFX0JJVE1BUCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgPyBsb29rdXBf ZnJpbmdlX2JpdG1hcCAoYml0bWFwX2ZsYXZvcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAg OiBNQ19OT19GUklOR0VfQklUTUFQOworICAgICAgICAgIGZhY2VfaWQgPSAoY3Vyc29yX3R5cGUg PT0gTUNfUklHSFRfRlJJTkdFX0JJVE1BUAorICAgICAgICAgICAgICAgICAgICAgJiYgKGdseXBo X2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9IT0xMT1dfUkVDVEFOR0xFX1JJR0hUX0FSUk9XCisgICAg ICAgICAgICAgICAgICAgICAgICAgfHwgZ2x5cGhfZmxhdm9yID09IE1DX1JFVkVSU0VEX1ZFUlRJ Q0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGdseXBoX2Zs YXZvciA9PSBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIpKQorICAgICAgICAgICAgICAgICAgICAg ID8gbG9va3VwX2Rlcml2ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1yZXZlcnNlZC1iYXItcHJl LXp2LWZhY2UiKSwgRlJJTkdFX0ZBQ0VfSUQsIHRydWUpCisgICAgICAgICAgICAgICAgICAgIDog KGN1cnNvcl90eXBlID09IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVAKKyAgICAgICAgICAgICAgICAg ICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JFVkVSU0VEX0hPTExPV19SRUNUQU5HTEVfUklH SFRfQVJST1cKKyAgICAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxhdm9yICE9IE1DX1JF VkVSU0VEX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAm JiBnbHlwaF9mbGF2b3IgIT0gTUNfUkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICAgICAg ICAgICAgICAgID8gbG9va3VwX2Rlcml2ZWRfZmFjZSAodywgZiwgaW50ZXJuICgiKy1iYXItcHJl LXp2LWZhY2UiKSwgRlJJTkdFX0ZBQ0VfSUQsIHRydWUpCisgICAgICAgICAgICAgICAgICAgIDog REVGQVVMVF9GQUNFX0lEOworICAgICAgICAgIHJvdy0+Y3Vyc29yX2luX2ZyaW5nZV9wID0gZmFs c2U7CisgICAgICAgICAgcm93LT5yaWdodF9mcmluZ2VfYml0bWFwID0gZnJpbmdlX2JpdG1hcDsK KyAgICAgICAgICByb3ctPnJpZ2h0X2ZyaW5nZV9mYWNlX2lkID0gZmFjZV9pZDsKKyAgICAgICAg ICByb3ctPnJpZ2h0X2ZyaW5nZV9vZmZzZXQgPSAwOworICAgICAgICAgIHJvdy0+ZnJpbmdlX2Jp dG1hcF9wZXJpb2RpY19wID0gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoZ2x5 cGhfZmxhdm9yID09IE1DX0dMWVBICisgICAgICAgICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9 PSBNQ19HTFlQSExFU1MpCisgICAgICAgICAgeworICAgICAgICAgICAgYm9vbCBvbl9wID0gdHJ1 ZTsKKyAgICAgICAgICAgIEZSQU1FX1JJRiAoZiktPm1jX3NjcmliZV9jdXJzb3IgKHcsIG1hdHJp eCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICB2cG9zLCB3ZCwgaCwgbHNsLCBjdXJzb3JfdHlwZSwKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgZ2x5cGhf Zmxhdm9yLCBvbl9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgYWN0aXZlX3ApOworICAgICAgICAgIH0KK30KKworLyogRHVtcCBjb250ZW50cyBvZiBnbHlw aCBHTFlQSCB0byBzdGRlcnIuICBST1cgYW5kIEFSRUEgYXJlCisgICB0aGUgZ2x5cGggcm93IGFu ZCBhcmVhIHdoZXJlIHRoZSBnbHlwaCBjb21lcyBmcm9tLiAqLwordm9pZAorbWNfZHVtcF9nbHlw aCAoc3RydWN0IGdseXBoX3JvdyAqcm93LCBzdHJ1Y3QgZ2x5cGggKmdseXBoLCBpbnQgYXJlYSwK KyAgICAgICAgICAgICAgIGludCByZWxhdGl2ZV94LCBpbnQgdnBvcykKK3sKKyAgYm9vbCBnbHlw aF96dl9wID0gKGdseXBoIC0gcm93LT5nbHlwaHNbYXJlYV0gPT0gcm93LT51c2VkW2FyZWFdIC0g MQorICAgICAgICAgICAgICAgICAgICAgJiYgTUFUUklYX1JPV19FTkRfQ0hBUlBPUyAocm93KSA9 PSBaVik7CisgIGlmIChnbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBICisgICAgICB8fCBnbHlwaC0+ dHlwZSA9PSBHTFlQSExFU1NfR0xZUEgpCisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJyLAor ICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAl MS4xZCUxLjFkICAlM2QgJXMgJXNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVY VF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2Vk W2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgIChnbHlwaC0+dHlwZSA9 PSBDSEFSX0dMWVBICisgICAgICAgICA/ICdDJworICAgICAgICAgOiAnRycpLAorICAgICAgICBn bHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICA/ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAg ID8gJ1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAg ICAgPyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxf d2lkdGgsCisgICAgICAgIGdseXBoLT51LmNoLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAg ICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9s aW5lX3AsCisgICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisg ICAgICAgIG1jX2NoYXJfdG9fc3RyaW5nIChnbHlwaC0+dS5jaCkpOworICAgIH0KKyAgZWxzZSBp ZiAoZ2x5cGgtPnR5cGUgPT0gU1RSRVRDSF9HTFlQSCkKKyAgICB7CisgICAgICBmcHJpbnRmIChz dGRlcnIsCisgICAgICAgICIgJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUw NnggJTRkICUxLjFkJTEuMWQgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmds eXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiBy b3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ1MnLAor ICAgICAgICBnbHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3Qp CisgICAgICAgICAgICA/ICdCJworICAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3Qp CisgICAgICAgICAgICA/ICdTJworICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisg ICAgICAgICAgICA/ICcwJworICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4 ZWxfd2lkdGgsCisgICAgICAgIDB1LAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAg Z2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3As CisgICAgICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAg ICJcXFMiKTsKKyAgICB9CisgIGVsc2UgaWYgKGdseXBoLT50eXBlID09IElNQUdFX0dMWVBIKQor ICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAgICAgIiAlNSJwRCJkLyUtNWQgJTVk ICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCAlNGQgJTEuMWQlMS4xZCAgJTNkICVzICVjXG4iLAor ICAgICAgICBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICgocm93LT51 c2VkW2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICByZWxh dGl2ZV94LAorICAgICAgICAnSScsCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAgICAo QlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ0InCisgICAgICAgICAgOiAo U1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJ1MnCisgICAgICAgICAgOiAo TklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8gJzAnCisgICAgICAgICAgOiAnLScp KSksCisgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAgKHVuc2lnbmVkIGludCkg Z2x5cGgtPnUuaW1nX2lkLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgt PmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAg ICAgIGdseXBoLT5ocG9zLCBnbHlwaF96dl9wID8gIlpWIiA6ICItLSIsCisgICAgICAgICcuJyk7 CisgICAgfQorICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBDT01QT1NJVEVfR0xZUEgpCisgICAg eworICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAiICU1InBEImQvJS01ZCAlNWQgJWMg JTkicEQiZCAlYyAlM2QgMHglMDZ4IiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhU X0FSRUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRb YXJlYV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJysnLAorICAgICAgICBn bHlwaC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICAgICA/ICdCJworICAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAg ICAgICA/ICdTJworICAgICAgICAgIDogKE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAg ICA/ICcwJworICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgs CisgICAgICAgICh1bnNpZ25lZCBpbnQpIGdseXBoLT51LmNtcC5pZCk7CisgICAgICBmcHJpbnRm IChzdGRlcnIsICIgJTRkICUxLjFkJTEuMWQiLAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAg ICAgICAgZ2x5cGgtPmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9s aW5lX3ApOworICAgICAgaWYgKGdseXBoLT51LmNtcC5hdXRvbWF0aWMpCisgICAgICAgIGZwcmlu dGYgKHN0ZGVyciwgIiAgJTNkICVzIC4gWyVkLSVkXVxuIiwKKyAgICAgICAgICAgICAgICAgICAg ICAgICBnbHlwaC0+aHBvcywgZ2x5cGhfenZfcCA/ICJaViIgOiAiLS0iLAorICAgICAgICAgICAg ICAgICAgICAgICAgIGdseXBoLT5zbGljZS5jbXAuZnJvbSwgZ2x5cGgtPnNsaWNlLmNtcC50byk7 CisgICAgICAgIGVsc2UKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiXG4iKTsKKyAgICB9Cisg IGVsc2UgaWYgKGdseXBoLT50eXBlID09IFhXSURHRVRfR0xZUEgpCisgICAgeworI2lmbmRlZiBI QVZFX1hXSURHRVRTCisgICAgICBlYXNzdW1lIChmYWxzZSk7CisjZWxzZQorICAgICAgZnByaW50 ZiAoc3RkZXJyLAorICAgICAgICAiICAlNWQvJS01ZCAlNWQgJTRjICU2ZCAlYyAlM2QgMHglMDV4 ICU0ZCAlMS4xZCUxLjFkICAlM2QgJXMgJWNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlw aHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93 LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdYJ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WCAgICBZICAgIFcgICAgSCAgICBWICAgIEEg ICAgUFxuIik7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICI9PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1c biIpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiJTNkICU5InBEImQgJTkicEQiZCAlNGQgJTEu MWQlMS4xZCUxLjFkJTEuMWRcCislMS4xZCUxLjFkJTEuMWQlMS4xZCUxLjFkJTEuMWQlMS4xZCUx LjFkICAlNGQgJTRkICU0ZCAlNGQgJTRkICU0ZCAlNGRcbiIsCisgICAgICAgICB2cG9zLAorICAg ICAgICAgTUFUUklYX1JPV19TVEFSVF9DSEFSUE9TIChyb3cpLAorICAgICAgICAgTUFUUklYX1JP V19FTkRfQ0hBUlBPUyAocm93KSwKKyAgICAgICAgIHJvdy0+dXNlZFtURVhUX0FSRUFdLAorICAg ICAgICAgcm93LT5jb250YWluc19vdmVybGFwcGluZ19nbHlwaHNfcCwKKyAgICAgICAgIHJvdy0+ ZW5hYmxlZF9wLAorICAgICAgICAgcm93LT50cnVuY2F0ZWRfb25fbGVmdF9wLAorICAgICAgICAg cm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCwKKyAgICAgICAgIHJvdy0+Y29udGludWVkX3AsCisg ICAgICAgICBNQVRSSVhfUk9XX0NPTlRJTlVBVElPTl9MSU5FX1AgKHJvdyksCisgICAgICAgICBN QVRSSVhfUk9XX0RJU1BMQVlTX1RFWFRfUCAocm93KSwKKyAgICAgICAgIHJvdy0+ZW5kc19hdF96 dl9wLAorICAgICAgICAgcm93LT5maWxsX2xpbmVfcCwKKyAgICAgICAgIHJvdy0+ZW5kc19pbl9t aWRkbGVfb2ZfY2hhcl9wLAorICAgICAgICAgcm93LT5zdGFydHNfaW5fbWlkZGxlX29mX2NoYXJf cCwKKyAgICAgICAgIHJvdy0+bW91c2VfZmFjZV9wLAorICAgICAgICAgcm93LT54LAorICAgICAg ICAgcm93LT55LAorICAgICAgICAgcm93LT5waXhlbF93aWR0aCwKKyAgICAgICAgIHJvdy0+aGVp Z2h0LAorICAgICAgICAgcm93LT52aXNpYmxlX2hlaWdodCwKKyAgICAgICAgIHJvdy0+YXNjZW50 LAorICAgICAgICAgcm93LT5waHlzX2FzY2VudCk7CisgICAgICAvKiBUaGUgbmV4dCAzIGxpbmVz IHNob3VsZCBhbGlnbiB0byAiU3RhcnQiIGluIHRoZSBoZWFkZXIuICovCisgICAgICBmcHJpbnRm IChzdGRlcnIsICIgICAgJTkicEQiZCAlOSJwRCJkXHQlNWRcbiIsIHJvdy0+c3RhcnQub3Zlcmxh eV9zdHJpbmdfaW5kZXgsCisgICAgICAgICByb3ctPmVuZC5vdmVybGF5X3N0cmluZ19pbmRleCwK KyAgICAgICAgIHJvdy0+Y29udGludWF0aW9uX2xpbmVzX3dpZHRoKTsKKyAgICAgIGZwcmludGYg KHN0ZGVyciwgIiAgICAlOSJwRCJkICU5InBEImRcbiIsCisgICAgICAgICBDSEFSUE9TIChyb3ct PnN0YXJ0LnN0cmluZ19wb3MpLAorICAgICAgICAgQ0hBUlBPUyAocm93LT5lbmQuc3RyaW5nX3Bv cykpOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiICAgICU5ZCAlOWRcbiIsIHJvdy0+c3RhcnQu ZHB2ZWNfaW5kZXgsCisgICAgICAgICByb3ctPmVuZC5kcHZlY19pbmRleCk7CisgICAgfQorICBp ZiAoZ2x5cGhzID4gMSkKKyAgICB7CisgICAgICBmb3IgKGludCBhcmVhID0gTEVGVF9NQVJHSU5f QVJFQTsgYXJlYSA8IExBU1RfQVJFQTsgKythcmVhKQorICAgICAgICB7CisgICAgICAgICAgc3Ry dWN0IGdseXBoICpnbHlwaCA9IHJvdy0+Z2x5cGhzW2FyZWFdOworICAgICAgICAgIHN0cnVjdCBn bHlwaCAqZ2x5cGhfZW5kID0gZ2x5cGggKyByb3ctPnVzZWRbYXJlYV07CisgICAgICAgICAgLyog R2x5cGggZm9yIGEgbGluZSBlbmQgaW4gdGV4dC4gKi8KKyAgICAgICAgICBpZiAoYXJlYSA9PSBU RVhUX0FSRUEgJiYgZ2x5cGggPT0gZ2x5cGhfZW5kICYmIGdseXBoLT5jaGFycG9zID4gMCkKKyAg ICAgICAgICAgICsrZ2x5cGhfZW5kOworICAgICAgICAgIGlmIChnbHlwaCA8IGdseXBoX2VuZCkK KyAgICAgICAgICAgIGZwcmludGYgKHN0ZGVyciwgIkdseXBoIy9Ub3RhbCBSZWwuWCBUICAgICAg IFBvcyBPICAgVyAgICAgQ29kZSBGYWNlIExSIEhQT1MgWlYgQ1xuIik7CisgICAgICAgICAgZm9y ICg7IGdseXBoIDwgZ2x5cGhfZW5kOyArK2dseXBoKQorICAgICAgICAgICAgeworICAgICAgICAg ICAgICBtY19kdW1wX2dseXBoIChyb3csIGdseXBoLCBhcmVhLCByZWxhdGl2ZV94LCB2cG9zKTsK KyAgICAgICAgICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAg ICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZiAoZ2x5cGhzID09IDEpCisgICAg ICB7CisgICAgICAgIGNoYXIgc1tTSFJUX01BWCArIDRdOworICAgICAgICBmb3IgKGludCBhcmVh ID0gTEVGVF9NQVJHSU5fQVJFQTsgYXJlYSA8IExBU1RfQVJFQTsgKythcmVhKQorICAgICAgICAg IHsKKyAgICAgICAgICAgIGludCBpOworICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHJvdy0+ dXNlZFthcmVhXTsgKytpKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RydWN0 IGdseXBoICpnbHlwaCA9IHJvdy0+Z2x5cGhzW2FyZWFdICsgaTsKKyAgICAgICAgICAgICAgICBp ZiAoaSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICYmIGFyZWEg PT0gVEVYVF9BUkVBCisgICAgICAgICAgICAgICAgICAgICYmIE5JTFAgKGdseXBoLT5vYmplY3Qp CisgICAgICAgICAgICAgICAgICAgICYmIGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAg ICAgICAgICAgICAgICAgJiYgZ2x5cGgtPnUuY2ggPT0gJyAnKQorICAgICAgICAgICAgICAgICAg eworICAgICAgICAgICAgICAgICAgICBzdHJjcHkgKCZzW2ldLCAiW1xcbl0iKTsKKyAgICAgICAg ICAgICAgICAgICAgaSArPSA0OworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAg ICAgZWxzZSBpZiAoZ2x5cGgtPnR5cGUgPT0gQ0hBUl9HTFlQSAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgZ2x5cGgtPnUuY2ggPCAweDgwCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBnbHlwaC0+dS5jaCA+PSAnICcpCisgICAgICAgICAgICAgICAgICAgIHNbaV0gPSBnbHlw aC0+dS5jaDsKKyAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAg IHNbaV0gPSAnLic7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHNbaV0gPSAnXDAnOwor ICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiJTNkOiAoJWQpICclcydcbiIsIHZwb3MsIHJv dy0+ZW5hYmxlZF9wLCBzKTsKKyAgICAgICAgICB9CisgICAgICB9Cit9CisKK0RFRlVOICgibWMt ZHVtcC1nbHlwaC1yb3ciLCBGbWNfZHVtcF9nbHlwaF9yb3csIFNtY19kdW1wX2dseXBoX3Jvdywg MSwgMiwgIlAiLAorICAgICAgIGRvYzogLyogRHVtcCBnbHlwaCByb3cgUk9XIHRvIHN0ZGVyci4K K0ludGVyYWN0aXZlbHksIFJPVyBpcyB0aGUgcHJlZml4IG51bWVyaWMgYXJndW1lbnQgYW5kIGRl ZmF1bHRzIHRvCit0aGUgcm93IHdoaWNoIGRpc3BsYXlzIHBvaW50LgorT3B0aW9uYWwgYXJndW1l bnQgR0xZUEhTIDAgbWVhbnMgZG9uJ3QgZHVtcCBnbHlwaHMuCitHTFlQSFMgMSBtZWFucyBkdW1w IGdseXBocyBpbiBzaG9ydCBmb3JtLgorR0xZUEhTID4gMSBvciBvbWl0dGVkIG1lYW5zIGR1bXAg Z2x5cGhzIGluIGxvbmcgZm9ybS4gICovKQorICAoTGlzcF9PYmplY3Qgcm93LCBMaXNwX09iamVj dCBnbHlwaHMpCit7CisgIHN0cnVjdCB3aW5kb3cgKncgPSBYV0lORE9XIChzZWxlY3RlZF93aW5k b3cpOworICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXggPSB3LT5jdXJyZW50X21hdHJpeDsK KyAgRU1BQ1NfSU5UIHZwb3M7CisgIGlmIChOSUxQIChyb3cpKQorICAgIHsKKyAgICAgIGludCBk MSwgZDIsIGQzLCBkNCwgZDUsIHlwb3M7CisgICAgICBib29sIHZpc2libGVfcCA9IHBvc192aXNp YmxlX3AgKHcsIFBULCAmZDEsICZkMiwgJmQzLCAmZDQsICZkNSwgJnlwb3MpOworICAgICAgaW50 IGhlYWRlcl9saW5lX2hlaWdodCA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICAg ICAgaW50IHZvZmZzZXQgPSAoaGVhZGVyX2xpbmVfaGVpZ2h0ID4gMAorICAgICAgICAgICAgICAg ICAgICAgJiYgeXBvcyA+IDApCisgICAgICAgICAgICAgICAgICAgICAgPyB5cG9zICsgMQorICAg ICAgICAgICAgICAgICAgICAgIDogeXBvczsKKyAgICAgIGlmICh2aXNpYmxlX3ApCisgICAgICAg IHZwb3MgPSB2b2Zmc2V0OworICAgICAgICBlbHNlCisgICAgICAgICAgdnBvcyA9IDA7CisgICAg fQorICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgQ0hFQ0tfTlVNQkVSIChyb3cpOworICAgICAg ICB2cG9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aXRoIG51bWVyaWMgYXJndW1lbnQsIGl0cyB2 YWx1ZSBpcyBwYXNzZWQgYXMgdGhlIEdMWVBIUyBmbGFnLiAgKi8pCisgIChMaXNwX09iamVjdCBn bHlwaHMpCit7CisgIHN0cnVjdCB3aW5kb3cgKncgPSBYV0lORE9XIChzZWxlY3RlZF93aW5kb3cp OworICBzdHJ1Y3QgYnVmZmVyICpidWZmZXIgPSBYQlVGRkVSICh3LT5jb250ZW50cyk7CisgIGZw cmludGYgKHN0ZGVyciwgIlBUID0gJSJwRCJkLCBCRUdWID0gJSJwRCJkLiBaViA9ICUicEQiZFxu IiwKKyAgICAgQlVGX1BUIChidWZmZXIpLCBCVUZfQkVHViAoYnVmZmVyKSwgQlVGX1pWIChidWZm ZXIpKTsKKyAgZnByaW50ZiAoc3RkZXJyLCAiQ3Vyc29yIHggPSAlZCwgeSA9ICVkLCBocG9zID0g JWQsIHZwb3MgPSAlZFxuIiwKKyAgICAgdy0+Y3Vyc29yLngsIHctPmN1cnNvci55LCB3LT5jdXJz b3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MpOworICBmcHJpbnRmIChzdGRlcnIsICI9PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiIpOworICBtY19kdW1wX2dseXBo X21hdHJpeCAody0+Y3VycmVudF9tYXRyaXgsCisgICAgICAgICBUWVBFX1JBTkdFRF9GSVhOVU1Q IChpbnQsIGdseXBocykgPyBYRklYTlVNIChnbHlwaHMpIDogMCk7CisgIHJldHVybiBRbmlsOwor fQorCitib29sCittY190cmF2ZXJzZV9jYWNoZV9wIChzdHJ1Y3QgbWNfbWF0cml4IG1hdHJpeCwg ZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICBpbnQg dm50aCwgaW50IG50aCkKK3sKKyAgaWYgKHZudGggPCBtYXRyaXgudnBvc191c2VkCisgICAgICAm JiBtYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5cGVdID4gMAorICAgICAgJiYgbnRoIDwgbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90eXBlXSkKKyAgICByZXR1cm4gdHJ1ZTsK KyAgICBlbHNlCisgICAgICByZXR1cm4gZmFsc2U7Cit9CisKK3ZvaWQKK21jX3Jlc2V0X2NhY2hl IChzdHJ1Y3Qgd2luZG93ICp3KQoreworICBpZiAoIUJVRkZFUlAgKHctPmNvbnRlbnRzKSkKKyAg ICByZXR1cm47CisgIGZvciAoZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUgPSBNQ19DQUNI RTsKKyAgICAgICBjYWNoZV90eXBlIDwgTk9fQ0FDSEU7CisgICAgICAgKytjYWNoZV90eXBlKQor ICAgIHsKKyAgICAgIGJvb2wgYnZhcl9hY3RpdmVfcDsKKyAgICAgIHN3aXRjaCAoY2FjaGVfdHlw ZSkKKyAgICAgICAgeworICAgICAgICAgIGNhc2UgTk9fQ0FDSEU6CisgICAgICAgICAgICB7Cisg ICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBjYXNlIE1DX0NB Q0hFOgorICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAoQlVGRkVSUCAody0+Y29udGVu dHMpCisgICAgICAgICAgICAgICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50 cyksIG1jX2NvbmYpKSkKKyAgICAgICAgICAgICAgICBidmFyX2FjdGl2ZV9wID0gZmFsc2U7Cisg ICAgICAgICAgICAgICAgZWxzZSBpZiAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNf Y29uZikpKQorICAgICAgICAgICAgICAgICAgYnZhcl9hY3RpdmVfcCA9IHRydWU7CisgICAgICAg ICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgIGNhc2UgQ0hfQ0FDSEU6Cisg ICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAg ICAgICAgICAgICAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY3Jv c3NoYWlycykpKQorICAgICAgICAgICAgICAgIGJ2YXJfYWN0aXZlX3AgPSBmYWxzZTsKKyAgICAg ICAgICAgICAgICBlbHNlIGlmIChCVUZGRVJQICh3LT5jb250ZW50cykKKyAgICAgICAgICAgICAg ICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hh aXJzKSkpCisgICAgICAgICAgICAgICAgICBidmFyX2FjdGl2ZV9wID0gdHJ1ZTsKKyAgICAgICAg ICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgY2FzZSBGQ19DQUNIRToKKyAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAg ICAgICAgICAgICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192 aXNpYmxlKSkpCisgICAgICAgICAgICAgICAgYnZhcl9hY3RpdmVfcCA9IGZhbHNlOworICAgICAg ICAgICAgICAgIGVsc2UgaWYgKEJVRkZFUlAgKHctPmNvbnRlbnRzKQorICAgICAgICAgICAgICAg ICAgICAgICAgICYmICFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGZjX3Zpc2li bGUpKSkKKyAgICAgICAgICAgICAgICAgIGJ2YXJfYWN0aXZlX3AgPSB0cnVlOworICAgICAgICAg ICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgaWYgKCFidmFyX2Fj dGl2ZV9wKQorICAgICAgICB7CisgICAgICAgICAgLyogRGVjcmVhc2UgdGhlIHNpemUgb2YgdGhl IGFycmF5IHRvIGEgYmFyZSBtaW5pbXVtLiAqLworICAgICAgICAgIGZvciAoaW50IHZudGggPSAw OyB2bnRoIDwgdy0+bWNfbWF0cml4LnZwb3NfdXNlZDsgKyt2bnRoKQorICAgICAgICAgICAgewor ICAgICAgICAgICAgICBpZiAody0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVk W2NhY2hlX3R5cGVdID4gMSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICB3 LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXSA9CisgICAgICAgICAgICAg ICAgICAgIHhucmVhbGxvYyAody0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlw ZV0sIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mICp3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXSk7CisgICAgICAgICAgICAgICAgICB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV0gPSAxOworICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVfdXNlZFtjYWNoZV90eXBlXSA9IDA7CisgICAgICAgICAgICB9CisgICAgICAgICAgdy0+bWNf bWF0cml4LmN1cnNvcnNfdXNlZFtjYWNoZV90eXBlXSA9IDA7CisgICAgICAgIH0KKyAgICAgICAg Ly8gIEFsdGhvdWdoIGl0IHdvdWxkIG5vdCBiZSB2ZXJ5IGVmZmljaWVudCwgaXQgaXMgcG9zc2li bGUgdG8gc2V0CisgICAgICAgIC8vICB0aGUgX3VzZWRfIGVsZW1lbnRzIG9mIHRoZSBhcnJheSB0 byB6ZXJvLiAgSW4gc3VjaCBhIGNhc2UsIHRoZQorICAgICAgICAvL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yaXgsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKKyAgICAgICAgICAgc3RydWN0IGds eXBoICpnbHlwaCwgaW50IHgsIGludCBmeCwgaW50IHksIGludCBmeSwgaW50IGhwb3MsIGludCB2 cG9zLAorICAgICAgICAgICBpbnQgd2QsIGludCBoLCBlbnVtIG1jX2N1cnNvcl90eXBlIGN1cnNv cl90eXBlLCBpbnQgY3Vyc29yX3dpZHRoLAorICAgICAgICAgICBlbnVtIG1jX3Jvd19wb3NpdGlv biByb3dfcG9zaXRpb24sIHN0cnVjdCBtY19SR0IgZm9yZWdyb3VuZCwKKyAgICAgICAgICAgc3Ry dWN0IG1jX1JHQiBiYWNrZ3JvdW5kLCBib29sIGFjdGl2ZV9wLCBlbnVtIG1jX2ZsYXZvciBnbHlw aF9mbGF2b3IsCisgICAgICAgICAgIGJvb2wgZHJhd19wLCBlbnVtIG1jX2RyYXdfcm93X3R5cGUg ZnJvbV93aGVyZSwKKyAgICAgICAgICAgZW51bSBtY19jYWNoZV90eXBlIGNhY2hlX3R5cGUsIGVu dW0gbWNfZW5naW5lX3R5cGUgYWN0aW9uX3R5cGUpCit7CisgIGludCB2bnRoID0gTUFUUklYX1JP V19WUE9TIChyb3csIG1hdHJpeCk7CisgIGlmIChtY19zdGRlcnJfcAorICAgICAgJiYgZHJhd19w KQorICAgIHsKKyAgICAgIGludCBjaGFycG9zID0gZ2x5cGgtPmNoYXJwb3M7CisgICAgICBpbnQg bG51bSA9IGdseXBoLT5sbnVtOworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiXG5tY19oZWxwZXIg KCVzKTogIGZyb21fd2hlcmUgKCVzKVxuXAorICBhY3Rpb25fdHlwZSAoJXMpIHwgZmxhdm9yICgl cykgfCBjaGFycG9zICglZCkgfCBsbnVtICglZClcblwKKyAgY2hhciAoJXMpIHwgeCAoJWQpIHwg ZnggKCVkKSB8IHkgKCVkKSB8IGZ5ICglZCkgfCBocG9zICglZC8lZCkgfCB2cG9zICglZClcbl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dHlwZV1bbnRoXS5nbHlwaC5zbGljZS5p bWcuaGVpZ2h0ID09IGdseXBoLT5zbGljZS5pbWcuaGVpZ2h0CisgICAgICAgICAgICAgJiYgdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5nbHlwaC5zbGljZS5j bXAuZnJvbSA9PSBnbHlwaC0+c2xpY2UuY21wLmZyb20KKyAgICAgICAgICAgICAmJiB3LT5tY19t YXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLnggPT0geAorICAgICAgICAg ICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZngg PT0gZngKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNo ZV90eXBlXVtudGhdLnkgPT0geQorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3Zu dGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZnkgPT0gZnkKKyAgICAgICAgICAgICAmJiB3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmhwb3MgPT0gaHBvcwor ICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF0udnBvcyA9PSB2cG9zCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS53ZCA9PSB3ZAorICAgICAgICAgICAgICYmIHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uaCA9PSBoCisgICAgICAg ICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5j dXJzb3JfdHlwZSA9PSBjdXJzb3JfdHlwZQorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52 cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uY3Vyc29yX3dpZHRoID09IGN1cnNvcl93 aWR0aAorICAgICAgICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hl X3R5cGVdW250aF0uZmcucmVkID09IGZvcmVncm91bmQucmVkCisgICAgICAgICAgICAgJiYgdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5mZy5ncmVlbiA9PSBm b3JlZ3JvdW5kLmdyZWVuCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5mZy5ibHVlID09IGZvcmVncm91bmQuYmx1ZQorICAgICAg ICAgICAgICYmIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0u YmcucmVkID09IGJhY2tncm91bmQucmVkCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZw b3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5iZy5ncmVlbiA9PSBiYWNrZ3JvdW5kLmdy ZWVuCisgICAgICAgICAgICAgJiYgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVf dHlwZV1bbnRoXS5iZy5ibHVlID09IGJhY2tncm91bmQuYmx1ZQorICAgICAgICAgICAgICYmIHct Pm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uYWN0aXZlX3AgPT0g YWN0aXZlX3AKKyAgICAgICAgICAgICAmJiB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtj YWNoZV90eXBlXVtudGhdLmdseXBoX2ZsYXZvciA9PSBnbHlwaF9mbGF2b3IKKyAgIC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cm9tX3doZXJlID09IE5PV0hFUkUpKQorICAgICAg eworICAgICAgICBtY19kcmF3X2VyYXNlX2h5YnJpZCAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5 LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsIGN1cnNvcl90eXBlLAorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgY3Vyc29yX3dpZHRoLCBmb3JlZ3JvdW5kLCBhY3RpdmVfcCwgZ2x5cGhfZmxh dm9yLCByZW1vdmVfcCk7CisgICAgICAgIHJldHVybjsKKyAgICAgIH0KKyAgaWYgKGNhY2hlX3R5 cGUgPT0gTk9fQ0FDSEUpCisgICAgcmV0dXJuOworICArK3ctPm1jX21hdHJpeC5jdXJzb3JzX3Vz ZWRbY2FjaGVfdHlwZV07CisgIGlmICh2bnRoID49IHctPm1jX21hdHJpeC52cG9zX3VzZWQpCisg ICAgdy0+bWNfbWF0cml4LnZwb3NfdXNlZCA9IHZudGggKyAxOworICBpZiAody0+bWNfbWF0cml4 LnZwb3NfYWxsb2NhdGVkIDwgdy0+bWNfbWF0cml4LnZwb3NfdXNlZCkKKyAgICB7CisgICAgICBp bnQgb2xkX2FsbG9jID0gdy0+bWNfbWF0cml4LnZwb3NfYWxsb2NhdGVkOworICAgICAgaW50IG5l d19lbHRzID0gdy0+bWNfbWF0cml4LnZwb3NfdXNlZCAtIHctPm1jX21hdHJpeC52cG9zX2FsbG9j YXRlZDsKKyAgICAgIHctPm1jX21hdHJpeC52cG9zID0geHBhbGxvYyAody0+bWNfbWF0cml4LnZw b3MsICZ3LT5tY19tYXRyaXgudnBvc19hbGxvY2F0ZWQsCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIG5ld19lbHRzLCBJTlRfTUFYLCBzaXplb2YgKnctPm1jX21hdHJpeC52cG9z KTsKKyAgICAgIG1lbXNldCAody0+bWNfbWF0cml4LnZwb3MgKyBvbGRfYWxsb2MsIDAsCisgICAg ICAgICAgICAgICAody0+bWNfbWF0cml4LnZwb3NfYWxsb2NhdGVkIC0gb2xkX2FsbG9jKSAqIHNp emVvZiAqdy0+bWNfbWF0cml4LnZwb3MpOworICAgIH0KKyAgKyt3LT5tY19tYXRyaXgudnBvc1t2 bnRoXS5jYWNoZV91c2VkW2NhY2hlX3R5cGVdOworICBpZiAody0+bWNfbWF0cml4LnZwb3Nbdm50 aF0uY2FjaGVfYWxsb2NhdGVkW2NhY2hlX3R5cGVdIDwgdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0u Y2FjaGVfdXNlZFtjYWNoZV90eXBlXSkKKyAgICB7CisgICAgICBpbnQgb2xkX2FsbG9jID0gdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfYWxsb2NhdGVkW2NhY2hlX3R5cGVdOworICAgICAg aW50IG5ld19lbHRzID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVfdXNlZFtjYWNoZV90 eXBlXSAtIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlX2FsbG9jYXRlZFtjYWNoZV90eXBl XTsKKyAgICAgIHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdID0geHBh bGxvYyAody0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV0sCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZ3LT5t Y19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZV9hbGxvY2F0ZWRbY2FjaGVfdHlwZV0sCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19l bHRzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBJTlRfTUFYLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBzaXplb2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AqZnksIGlu dCBocG9zLCBpbnQgdnBvcywgaW50ICpoLAorICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBt Y19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSwgaW50IGN1cnNvcl93aWR0aCwKKyAgICAgICAgICAg ICAgICAgICAgICAgIGludCAqd2QpCit7CisgIHN0cnVjdCBnbHlwaCAqZ2x5cGggPSBtY19nZXRf Y3Vyc29yX2dseXBoICh3LCBtYXRyaXgsIHJvdywgaHBvcywgdnBvcyk7CisgIGlmIChnbHlwaCA9 PSBOVUxMKQorICAgIHJldHVybjsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FIChXSU5ET1df RlJBTUUgKHcpKTsKKyAgKmZ4ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAodywgeCk7 CisgICpoID0gcm93LT52aXNpYmxlX2hlaWdodDsKKyAgLyogRG9uJ3QgbGV0IHRoZSBjdXJzb3Ig ZXhjZWVkIHRoZSBkaW1lbnNpb25zIG9mIHRoZSByb3csIHNvIHRoYXQKKyAgdGhlIHVwcGVyL2xv d2VyIHNpZGUgb2YgdGhlIGJveCBhcmVuJ3QgY2xpcHBlZC4gICovCisgIGludCB3X2hlYWRlcl9s aW5lX2hlaWdodCA9IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICBpbnQgd190ZXh0 X2JvdHRvbV95ID0gd2luZG93X3RleHRfYm90dG9tX3kgKHcpIC0gKmg7CisgIGlmICh5IDwgd19o ZWFkZXJfbGluZV9oZWlnaHQpCisgICAgeworICAgICAgKmggPSBtYXggKCpoIC0gKHdfaGVhZGVy X2xpbmVfaGVpZ2h0IC0geSkgKyAxLCAqaCk7CisgICAgICB5ID0gd19oZWFkZXJfbGluZV9oZWln aHQgLSAxOworICAgICAgLy8gZnByaW50ZiAoc3RkZXJyLCAiQ09ORElUSU9OICMgMVxuIik7Cisg ICAgfQorICAgZWxzZSBpZiAoeSA+IHdfdGV4dF9ib3R0b21feSkKKyAgICAgeworICAgICAgICpo ICs9IHkgLSB3X3RleHRfYm90dG9tX3k7CisgICAgICAgeSA9IHdfdGV4dF9ib3R0b21feTsKKyAg ICAgICAvLyBmcHJpbnRmIChzdGRlcnIsICJDT05ESVRJT04gIyAyXG4iKTsKKyAgICAgfQorICAq ZnkgPSBXSU5ET1dfVE9fRlJBTUVfUElYRUxfWSAodywgeSk7CisgIHN3aXRjaCAoY3Vyc29yX3R5 cGUpCisgICAgeworICAgICAgY2FzZSBNQ19CQVI6CisgICAgICAgIHsKKyAgICAgICAgICBpZiAo Y3Vyc29yX3dpZHRoIDwgMSkKKyAgICAgICAgICAgIGN1cnNvcl93aWR0aCA9IG1heCAoRlJBTUVf Q1VSU09SX1dJRFRIIChmKSwgMSk7CisgICAgICAgICAgaWYgKGN1cnNvcl93aWR0aCA8IGdseXBo LT5waXhlbF93aWR0aCkKKyAgICAgICAgICAqd2QgPSBjdXJzb3Jfd2lkdGg7CisgICAgICAgICAg YnJlYWs7CisgICAgICAgIH0KKyAgICAgIGNhc2UgTUNfSEJBUjoKKyAgICAgICAgeworICAgICAg ICAgIGludCBjdXJzb3JfaGVpZ2h0ID0gKGN1cnNvcl93aWR0aCA8IDEpID8gbHJpbnQgKDAuMjUg KiAqaCkgOiBjdXJzb3Jfd2lkdGg7CisgICAgICAgICAgaWYgKGN1cnNvcl9oZWlnaHQgPiByb3ct PmhlaWdodCkKKyAgICAgICAgICAgIGN1cnNvcl9oZWlnaHQgPSByb3ctPmhlaWdodDsKKyAgICAg ICAgICAvKiBDdXJzb3Igc21hbGxlciB0aGFuIGxpbmUgaGVpZ2h0LCBzbyBtb3ZlIGRvd24uICov CisgICAgICAgICAgaWYgKCpoID4gY3Vyc29yX2hlaWdodCkKKyAgICAgICAgICAgICpmeSArPSAq aCAtIGN1cnNvcl9oZWlnaHQ7CisgICAgICAgICAgKmggPSBjdXJzb3JfaGVpZ2h0OworICAgICAg ICAgICp3ZCA9IGdseXBoLT5waXhlbF93a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gICAgICAgICAgICAgICAgICZoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRo LCAmd2QpOworICBpbnQgb3BvaW50X2Z4ID0gV0lORE9XX1RFWFRfVE9fRlJBTUVfUElYRUxfWCAo dywgb3BvaW50X3gpOworICBpbnQgZmNfZnggPSBXSU5ET1dfVEVYVF9UT19GUkFNRV9QSVhFTF9Y ICh3LCBlc3NlbnRpYWxzLmZjX3gpOworICBib29sIGdseXBoX3p2X3AgPSAoZ2x5cGggLSByb3ct PmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAgICAg ICAgICAgICYmIE1BVFJJWF9ST1dfRU5EX0NIQVJQT1MgKHJvdykgPT0gWlYpOworICBzdHJ1Y3Qg ZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsKKyAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZG RVIgKHctPmNvbnRlbnRzKTsKKyAgaW50IHRleHRfYXJlYV93aWR0aCA9IHdpbmRvd19ib3hfd2lk dGggKHcsIFRFWFRfQVJFQSk7CisgIHN0cnVjdCBnbHlwaF9yb3cgKmN1cnNvcl9yb3cgPSAody0+ Y3Vyc29yLnZwb3MgIT0gLTEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1B VFJJWF9ST1cgKGN1cnNvcl9tYXRyaXgsIHctPmN1cnNvci52cG9zKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgOiBOVUxMOworICBzdHJ1Y3QgZ2x5cGggKmN1cnNvcl9nbHlwaCA9 ICh3LT5jdXJzb3IudnBvcyAhPSAtMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IG1jX2dldF9jdXJzb3JfZ2x5cGggKHcsIGN1cnNvcl9tYXRyaXgsIGN1cnNvcl9yb3csCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5jdXJz b3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiBOVUxMOworICBib29sIGN1cnNvcl9hdF9mcmluZ2VfcCA9IChjdXJzb3JfZ2x5cGggPT0gTlVM TAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93ICE9IE5VTEwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gY3Vyc29yX3Jv dy0+dXNlZFtURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNv cl9yb3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5lX3AKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgdy0+Y3Vyc29yLnggPT0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID09IGN1cnNvcl9yb3ctPnBpeGVsX3dpZHRoKTsK KyAgYm9vbCBjdXJzb3JfYmV5b25kX2ZyaW5nZV9wID0gKGN1cnNvcl9nbHlwaCA9PSBOVUxMCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjdXJzb3Jfcm93ICE9IE5VTEwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID09IGN1cnNv cl9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgIWN1cnNvcl9yb3ctPmV4YWN0X3dpbmRvd193aWR0aF9saW5lX3AKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49IHRleHRfYXJlYV93aWR0aAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPj0gY3Vyc29yX3Jv dy0+cGl4ZWxfd2lkdGg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UzZCAlcyAlc1xu IiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAoKHJv dy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJlYV0gLSAxKSwKKyAgICAgICAg cmVsYXRpdmVfeCwKKyAgICAgICAgKGdseXBoLT50eXBlID09IENIQVJfR0xZUEgKKyAgICAgICAg ID8gJ0MnCisgICAgICAgICA6ICdHJyksCisgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAg ICAoQlVGRkVSUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgID8gJ0InCisgICAgICAgICA6IChT VFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgPyAnUycKKyAgICAgICAgICAgIDog KE5JTFAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICAgICA/ICcwJworICAgICAgICAgICAg ICAgOiAnLScpKSksCisgICAgICAgICAgICAgIGdseXBoLT5waXhlbF93aWR0aCwKKyAgICAgICAg Z2x5cGgtPnUuY2gsCisgICAgICAgIGdseXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVm dF9ib3hfbGluZV9wLAorICAgICAgICBnbHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAg Z2x5cGgtPmhwb3MsIGdseXBoX3p2X3AgPyAiWlYiIDogIi0tIiwKKyAgICAgICAgbWNfY2hhcl90 b19zdHJpbmcgKGdseXBoLT51LmNoKSk7CisgIHN3aXRjaCAoYWN0aW9uX3R5cGUpCisgIHsKKy8q IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJTT1JT OiAgQ0hBUl9HTFlQSCB8IEdMWVBITEVTU19HTFlQSCAgICAgICAgICAgICAgIC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bHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAg ICAgICAgICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRp b24sIGZvcmVncm91bmQsCisgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZCwgZXNzZW50aWFs cy5hY3RpdmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAg ICAgICBjYWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICBpZiAocmVsYXRpdmVfeCA8IHJv dy0+cGl4ZWxfd2lkdGgpCisgICAgICAgIHsKKyAgICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBo LT5waXhlbF93aWR0aDsKKyAgICAgICAgICBmeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAg ICAgIH0KKyAgICAgIGlmIChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51 c2VkW2FyZWFdIC0gMQorICAgICAgICAgICYmIHJlbGF0aXZlX3ggPCB4X2xpbWl0KQorICAgICAg ICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5 LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgIHhfbGltaXQgLSByZWxhdGl2ZV94LCBo LCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sCisgICAgICAgICAgICAg ICAgICAgZm9yZWdyb3VuZCwgYmFja2dyb3VuZCwgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZ UEhMRVNTLAorICAgICAgICAgICAgICAgICAgIGRyYXdfcCwgZnJvbV93aGVyZSwgY2FjaGVfdHlw ZSwgYWN0aW9uX3R5cGUpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tICovCisvKiAgICAgICAgICAgICAgIFZFUlRJQ0FMX1JVTEVSOiAgQ0hBUl9HTFlQSCB8IEdM WVBITEVTU19HTFlQSCAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAq LworICAgIGNhc2UgVkVSVElDQUxfUlVMRVI6CisgICAgeworICAgICAgZW51bSBtY19mbGF2b3Ig Z2x5cGhfZmxhdm9yID0gKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHJvdy0+Y29udGludWVkX3ApCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgID8gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93LT5jb250aW51ZWRfcAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXJvdy0+dHJ1bmNhdGVkX29u X3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfVkVS VElDQUxfQkFSCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChjdXJzb3Jf YXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHJv dy0+dHJ1bmNhdGVkX29uX3JpZ2h0X3ApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gTUNfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA6IChjdXJzb3JfYmV5b25kX2ZyaW5nZV9wCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZFUlRJ Q0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgY3Vyc29yX3Jvdy0+dXNlZFtURVhUX0FSRUFdICE9IDEKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9w KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1JFVkVSU0VEX1ZF UlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGgg LSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG9wb2ludF94ID49IHJvdy0+cGl4ZWxf d2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhM RVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF96dl9wKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNQ19HTFlQSDsKKyAgICAgIGlmIChn bHlwaF9mbGF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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgRklMTF9DT0xVTU46Cisg ICAgeworICAgICAgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yID0gKGdseXBoIC0gcm93LT5n bHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID49IHJvdy0+cGl4ZWxfd2lk dGgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfR0xZUEhMRVNT CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChnbHlwaF96dl9wKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoIU5JTFAgKEJWQVIgKGIsIGNyb3NzaGFp cnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJW QVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfdmVydGljYWxfcnVsZXIpKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3kgPT0geQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3BvaW50X3Zwb3MgPT0gdnBvcykKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfR0xZUEg7CisgICAgICB3ZCA9IDE7 CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwgZmNf ZngsIHksIGZ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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgQkVHSU46 ICBTVFJFVENIX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qIC0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLSAqLworICBlbHNlIGlmIChnbHlwaC0+dHlwZSA9PSBTVFJFVENIX0dMWVBIKQor ICB7CisgICAgaWYgKG1jX3N0ZGVycl9wKQorICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAg ICAiXG4gJTUicEQiZC8lLTVkICU1ZCAlYyAlOSJwRCJkICVjICUzZCAweCUwNnggJTRkICUxLjFk JTEuMWQgICUzZCAlcyAlc1xuIiwKKyAgICAgICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FS RUFdLAorICAgICAgICAoKHJvdy0+dXNlZFthcmVhXSA9PSAwKSA/IDAgOiByb3ctPnVzZWRbYXJl YV0gLSAxKSwKKyAgICAgICAgcmVsYXRpdmVfeCwKKyAgICAgICAgJ1MnLAorICAgICAgICBnbHlw aC0+Y2hhcnBvcywKKyAgICAgICAgKEJVRkZFUlAgKGdseXBoLT5vYmplY3QpCisgICAgICAgICA/ ICdCJworICAgICAgICAgOiAoU1RSSU5HUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgID8g J1MnCisgICAgICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgICAg PyAnMCcKKyAgICAgICAgICAgICAgIDogJy0nKSkpLAorICAgICAgICBnbHlwaC0+cGl4ZWxfd2lk dGgsCisgICAgICAgIDB1LAorICAgICAgICBnbHlwaC0+ZmFjZV9pZCwKKyAgICAgICAgZ2x5cGgt PmxlZnRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPnJpZ2h0X2JveF9saW5lX3AsCisgICAg ICAgIGdseXBoLT5ocG9zLCB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tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tICovCisgICAgY2FzZSBIT1JJWk9OVEFMX1JVTEVSOgorICAgIHsKKyAgICAgIGlmIChy ZWxhdGl2ZV94IDwgcm93LT5waXhlbF93aWR0aAorICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vy c29yX3ApCisgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2 ZV94LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgd2QsIGgsIGN1 cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgZm9yZWdyb3VuZCwKKyAgICAg ICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBNQ19HTFlQSCwg ZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICAgIGNhY2hlX3R5cGUsIGFjdGlv bl90eXBlKTsKKyAgICAgIGlmIChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93 LT51c2VkW2FyZWFdIC0gMQorICAgICAgICAgICYmIHJlbGF0aXZlX3ggPD0geF9saW1pdCkKKyAg ICAgICAgeworICAgICAgICAgIGlmIChyZWxhdGl2ZV94IDwgcm93LT5waXhlbF93aWR0aCkKKyAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lk dGg7CisgICAgICAgICAgICAgIGZ4ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAgICAgICAgICAg IH0KKyAgICAgICAgICB0ZW1wX2ZhY2VfaWQgPSAocm93LT5maWxsX2xpbmVfcCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICA/IGdseXBoLT5mYWNlX2lkCisgICAgICAgICAgICAgICAgICAgICAg ICAgOiBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICAgICAgc3RydWN0IG1jX1JHQiBiYWNrZ3JvdW5k OworICAgICAgICAgIG1jX3NldF9sc2xfYmcgKHcsIHRlbXBfZmFjZV9pZCwgJmJhY2tncm91bmQp OworICAgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGdseXBoLCByZWxhdGl2ZV94 LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsCisgICAgICAgICAgICAgICAgICAgICB4X2xpbWl0IC0g cmVsYXRpdmVfeCwgaCwgY3Vyc29yX3R5cGUsIHhfbGltaXQgLSByZWxhdGl2ZV94LAorICAgICAg ICAgICAgICAgICAgICAgcm93X3Bvc2l0aW9uLCBmb3JlZ3JvdW5kLCBiYWNrZ3JvdW5kLCBlc3Nl bnRpYWxzLmFjdGl2ZV9wLAorICAgICAgICAgICAgICAgICAgICAgTUNfR0xZUEhMRVNTLCBkcmF3 X3AsIGZyb21fd2hlcmUsIGNhY2hlX3R5cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgICAgfQorICAg ICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAg ICAgICAgICAgICAgICAgVkVSVElDQUxfUlVMRVI6ICBTVFJFVENIX0dMWVBIICAgICAgICAgICAg ICAgICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICAgIGNhc2UgVkVSVElDQUxf UlVMRVI6CisgICAgeworICAgICAgaWYgKHJvdy0+ZmlsbF9saW5lX3AKKyAgICAgICAgICAmJiBn bHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW2FyZWFdIC0gMQorICAg ICAgICAgICYmIG9wb2ludF94ID4gcmVsYXRpdmVfeCArIGdseXBoLT5waXhlbF93aWR0aCkKKyAg ICAgICAgdGVtcF9mYWNlX2lkID0gZ2x5cGgtPmZhY2VfaWQ7CisgICAgICAgIGVsc2UgaWYgKCFy b3ctPmZpbGxfbGluZV9wCisgICAgICAgICAgICAgICAgICYmIGdseXBoIC0gcm93LT5nbHlwaHNb VEVYVF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICYmIG9w b2ludF94ID4gcmVsYXRpdmVfeCArIGdseXBoLT5waXhlbF93aWR0aCkKKyAgICAgICAgICB0ZW1w X2ZhY2VfaWQgPSBERUZBVUxUX0ZBQ0VfSUQ7CisgICAgICBzdHJ1Y3QgbWNfUkdCIGJhY2tncm91 bmQ7CisgICAgICBtY19zZXRfbHNsX2JnICh3LCB0ZW1wX2ZhY2VfaWQsICZiYWNrZ3JvdW5kKTsK KyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChjdXJzb3JfYXRfZnJpbmdlX3AK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPmNvbnRpbnVlZF9w KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JB Ul9CQUNLU0xBU0gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNv cl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYg IXJvdy0+Y29udGludWVkX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJP VworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9uZF9m cmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93LT50 cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9B UkVBXSAhPSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcm93 LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogTUNfR0xZUEhMRVNTOworICAgICAgaWYgKGdseXBoX2ZsYXZvciA9PSBN Q19WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0g TUNfUkVWRVJTRURfVkVSVElDQUxfQkFSX1JJR0hUX0FSUk9XCisgICAgICAgICAgfHwgZ2x5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lcnJfcCkKKyAgICAgIGZwcmludGYgKHN0ZGVyciwKKyAgICAg ICAgIlxuICU1InBEImQvJS01ZCAlNWQgJWMgJTkicEQiZCAlYyAlM2QgMHglMDZ4ICU0ZCAlMS4x ZCUxLjFkICAlM2QgJXMgJWNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9B UkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93LT51c2VkW2Fy ZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdJJywKKyAgICAgICAgZ2x5 cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAg PyAnQicKKyAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAgICAgICAgICA/ ICdTJworICAgICAgICAgICAgOiAoTklMUCAoZ2x5cGgtPm9iamVjdCkKKyAgICAgICAgICAgICAg ID8gJzAnCisgICAgICAgICAgICAgICA6ICctJykpKSwKKyAgICAgICAgZ2x5cGgtPnBpeGVsX3dp ZHRoLAorICAgICAgICAodW5zaWduZWQgaW50KSBnbHlwaC0+dS5pbWdfaWQsCisgICAgICAgIGds eXBoLT5mYWNlX2lkLAorICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICBn bHlwaC0+cmlnaHRfYm94X2xpbmVfcCwKKyAgICAgICAgZ2x5cGgtPmhwb3MsIGdseXBoX3p2X3Ag PyAiWlYiIDogIi0tIiwKKyAgICAgICAgJy4nKTsKKyAgc3dpdGNoIChhY3Rpb25fdHlwZSkKKyAg eworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAgICAgICAgICBN VUxUSVBMRV9DVVJ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NPUl9JTkRJQ0FU T1I6CisgICAgeworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICov CisgIH0KKyAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgRU5EOiAgSU1BR0VfR0xZUEggICAgICAgICAgICAgICAgICAgICAgICAg ICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0g Ki8KKy8qICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJFR0lOOiAgQ09NUE9TSVRFX0dMWVBI ICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisg IGVsc2UgaWYgKGdseXBoLT50eXBlID09IENPTVBPU0lURV9HTFlQSCkKKyAgeworICAgIGlmICht Y19zdGRlcnJfcCkKKyAgICAgIHsKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLAorICAgICAgICAg ICJcbiAlNSJwRCJkLyUtNWQgJTVkICVjICU5InBEImQgJWMgJTNkIDB4JTA2eCIsCisgICAgICAg ICAgZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdLAorICAgICAgICAgICgocm93LT51c2Vk W2FyZWFdID09IDApID8gMCA6IHJvdy0+dXNlZFthcmVhXSAtIDEpLAorICAgICAgICAgIHJlbGF0 aXZlX3gsCisgICAgICAgICAgJysnLAorICAgICAgICAgIGdseXBoLT5jaGFycG9zLAorICAgICAg ICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICA/ICdCJworICAgICAgICAg ICA6IChTVFJJTkdQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgICA/ICdTJworICAgICAg ICAgICAgICA6IChOSUxQIChnbHlwaC0+b2JqZWN0KQorICAgICAgICAgICAgICAgICA/ICcwJwor ICAgICAgICAgICAgICAgICA6ICctJykpKSwKKyAgICAgICAgICBnbHlwaC0+cGl4ZWxfd2lkdGgs CisgICAgICAgICAgKHVuc2lnbmVkIGludCkgZ2x5cGgtPnUuY21wLmlkKTsKKyAgICAgICAgZnBy aW50ZiAoc3RkZXJyLCAiICU0ZCAlMS4xZCUxLjFkIiwKKyAgICAgICAgICBnbHlwaC0+ZmFjZV9p ZCwKKyAgICAgICAgICBnbHlwaC0+bGVmdF9ib3hfbGluZV9wLAorICAgICAgICAgIGdseXBoLT5y aWdodF9ib3hfbGluZV9wKTsKKyAgICAgIGlmIChnbHlwaC0+dS5jbXAuYXV0b21hdGljKQorICAg ICAgICBmcHJpbnRmIChzdGRlcnIsICIgICUzZCAlcyAuIFslZC0lZF1cbiIsCisgICAgICAgICAg ICAgICAgICAgICAgICAgZ2x5cGgtPmhwb3MsIGdseXBoX3p2X3AgPyAiWlYiIDogIi0tIiwKKyAg ICAgICAgICAgICAgICAgICAgICAgICBnbHlwaC0+c2xpY2UuY21wLmZyb20sIGdseXBoLT5zbGlj ZS5jbXAudG8pOworICAgICAgICBlbHNlCisgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiXG4i KTsKKyAgICAgIH0KKyAgc3dpdGNoIChhY3Rpb25fdHlwZSkKKyAgeworL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LS0tICovCisgICAgY2FzZSBIT1JJWk9OVEFMX1JVTEVSOgorICAgIHsKKyAg ICAgIGlmIChyZWxhdGl2ZV94IDw9IHhfbGltaXQKKyAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1 cnNvcl9wKQorICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRp dmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgIHdkLCBoLCBj dXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAg ICAgICAgICAgICAgICAgYmFja2dyb3VuZCwgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNfR0xZUEgs IGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgICBjYWNoZV90eXBlLCBhY3Rp b25fdHlwZSk7CisgICAgICBpZiAoZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJv dy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiByZWxhdGl2ZV94IDw9IHhfbGltaXQpCisg ICAgICAgIHsKKyAgICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5waXhlbF93aWR0aDsKKyAg ICAgICAgICB3aGlsZSAocmVsYXRpdmVfeCA8PSB4X2xpbWl0KQorICAgICAgICAgICAgeworICAg ICAgICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVfeCwg ZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgIHdkLCBoLCBj dXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGZvcmVncm91bmQsCisgICAg ICAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZCwgZXNzZW50aWFscy5hY3RpdmVfcCwgTUNf R0xZUEhMRVNTLCBkcmF3X3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgZnJvbV93aGVyZSwg Y2FjaGVfdHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAgICAgICAgICByZWxhdGl2ZV94ICs9IGZy YW1lX2NoYXJfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIGJyZWFrOwor ICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAg ICAgVkVSVElDQUxfUlVMRVI6ICBDT01QT1NJVEVfR0xZUEggICAgICAgICAgICAgICAgICAgICov CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIFZFUlRJQ0FMX1JVTEVSOgorICAg IHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChjdXJzb3JfYXRfZnJpbmdl X3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPmNvbnRpbnVl ZF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FM X0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1 cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgIXJvdy0+Y29udGludWVkX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUl9SSUdIVF9B UlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2JleW9u ZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcm93 LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRfZnJpbmdlX3AKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNvcl9yb3ctPnVzZWRbVEVY VF9BUkVBXSAhPSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAh cm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogKGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ct PnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiBvcG9pbnRfeCA+PSByb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOiAoZ2x5cGhfenZfcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDogTUNfR0xZUEg7CisgICAgICBpZiAoZ2x5cGhfZmxhdm9yID09IE1DX1ZFUlRJQ0FMX0JBUl9S SUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19SRVZFUlNFRF9WRVJU SUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfVkVS VElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBNQ19WRVJU SUNBTF9CQVIKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNfUkVWRVJTRURfVkVSVElD QUxfQkFSKQorICAgICAgICBjdXJzb3JfdHlwZSA9IE1DX1JJR0hUX0ZSSU5HRV9CSVRNQVA7Cisg ICAgICB3ZCA9IDE7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVs YXRpdmVfeCwgb3BvaW50X2Z4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAg d2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgZm9yZWdyb3Vu ZCwKKyAgICAgICAgICAgICAgICAgYmFja2dyb3VuZCwgZXNzZW50aWFscy5hY3RpdmVfcCwgZ2x5 cGhfZmxhdm9yLCBkcmF3X3AsIGZyb21fd2hlcmUsCisgICAgICAgICAgICAgICAgIGNhY2hlX3R5 cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgIEZJTExfQ09MVU1OOiAgQ09NUE9T SVRFX0dMWVBIICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0g Ki8KKyAgICBjYXNlIEZJTExfQ09MVU1OOgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGds eXBoX2ZsYXZvciA9IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2Vk W2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGVzc2Vu dGlhbHMuZmNfeCA+IHJlbGF0aXZlX3gpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IChnbHlwaF96dl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoIU5J TFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfdmVydGlj YWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3Bv aW50X3kgPT0geQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3Bv aW50X3Zwb3MgPT0gdnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNf R0xZUEg7CisgICAgICB3ZCA9IDE7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBn bHlwaCwgcmVsYXRpdmVfeCwgZmNfZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAg ICAgICB3ZCwgaCwgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcm93X3Bvc2l0aW9uLCBmb3Jl Z3JvdW5kLAorICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2ZV9w LCBnbHlwaF9mbGF2b3IsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgY2Fj aGVfdHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tICovCisgICAgY2FzZSBDVVJTT1JfSU5ESUNBVE9SOgorICAgIHsKKyAgICAgIGJy ZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICB9CisgIH0KKy8qIC0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFTkQ6ICBD T01QT1NJVEVfR0xZUEggICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0gKi8KKworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisvKiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgQkVHSU46ICBYV0lER0VUX0dMWVBIICAgICAgICAgICAgICAgICAgICAg ICAgICAgKi8KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworICBlbHNlIGlmIChnbHlwaC0+dHlw ZSA9PSBYV0lER0VUX0dMWVBIKQorICB7CisjaWZuZGVmIEhBVkVfWFdJREdFVFMKKyAgICBlYXNz dW1lIChmYWxzZSk7CisjZWxzZQorICAgIGlmIChtY19zdGRlcnJfcCkKKyAgICAgIGZwcmludGYg KHN0ZGVyciwKKyAgICAgICAgIlxuICAlNWQvJS01ZCAlNWQgJTRjICU2ZCAlYyAlM2QgMHglMDV4 ICU0ZCAlMS4xZCUxLjFkICAlM2QgJXMgJWNcbiIsCisgICAgICAgIGdseXBoIC0gcm93LT5nbHlw aHNbVEVYVF9BUkVBXSwKKyAgICAgICAgKChyb3ctPnVzZWRbYXJlYV0gPT0gMCkgPyAwIDogcm93 LT51c2VkW2FyZWFdIC0gMSksCisgICAgICAgIHJlbGF0aXZlX3gsCisgICAgICAgICdYJywKKyAg ICAgICAgZ2x5cGgtPmNoYXJwb3MsCisgICAgICAgIChCVUZGRVJQIChnbHlwaC0+b2JqZWN0KQor ICAgICAgICAgPyAnQicKKyAgICAgICAgIDogKFNUUklOR1AgKGdseXBoLT5vYmplY3QpCisgICAg ICAgICAgICA/ICdTJworICAgICAgICAgICA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gICBi cmVhazsKKyAgICB9CisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKy8qICAgICAgICAgICAgICAg ICAgICAgICAgSE9SSVpPTlRBTF9SVUxFUjogIFhXSURHRVRfR0xZUEggICAgICAgICAgICAgICAg ICAgICAqLworLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisgICAgY2FzZSBIT1JJWk9OVEFMX1JV TEVSOgorICAgIHsKKyAgICAgIGlmIChyZWxhdGl2ZV94IDw9IHhfbGltaXQKKyAgICAgICAgICAm JiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93 LCBnbHlwaCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAg ICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGZv cmVncm91bmQsCisgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZCwgZXNzZW50aWFscy5hY3Rp dmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgICBj YWNoZV90eXBlLCBhY3Rpb25fdHlwZSk7CisgICAgICBpZiAoZ2x5cGggLSByb3ctPmdseXBoc1tU RVhUX0FSRUFdID09IHJvdy0+dXNlZFthcmVhXSAtIDEKKyAgICAgICAgICAmJiByZWxhdGl2ZV94 IDw9IHhfbGltaXQpCisgICAgICAgIHsKKyAgICAgICAgICByZWxhdGl2ZV94ICs9IGdseXBoLT5w aXhlbF93aWR0aDsKKyAgICAgICAgICB3aGlsZSAocmVsYXRpdmVfeCA8PSB4X2xpbWl0KQorICAg ICAgICAgICAgeworICAgICAgICAgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlw aCwgcmVsYXRpdmVfeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAg ICAgICAgIHdkLCBoLCBjdXJzb3JfdHlwZSwgY3Vyc29yX3dpZHRoLCByb3dfcG9zaXRpb24sIGZv cmVncm91bmQsCisgICAgICAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZCwgZXNzZW50aWFs cy5hY3RpdmVfcCwgTUNfR0xZUEhMRVNTLCBkcmF3X3AsCisgICAgICAgICAgICAgICAgICAgICAg ICAgZnJvbV93aGVyZSwgY2FjaGVfdHlwZSwgYWN0aW9uX3R5cGUpOworICAgICAgICAgICAgICBy ZWxhdGl2ZV94ICs9IGZyYW1lX2NoYXJfd2lkdGg7CisgICAgICAgICAgICB9CisgICAgICAgIH0K KyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLworLyogICAgICAg ICAgICAgICAgICAgICAgICAgIFZFUlRJQ0FMX1JVTEVSOiAgWFdJREdFVF9HTFlQSCAgICAgICAg ICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KKyAgICBjYXNlIFZFUlRJ Q0FMX1JVTEVSOgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGdseXBoX2ZsYXZvciA9IChj dXJzb3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm JiByb3ctPmNvbnRpbnVlZF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA/IE1DX1ZFUlRJQ0FMX0JBUl9CQUNLU0xBU0gKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogKGN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgIXJvdy0+Y29udGludWVkX3AKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICYmICFyb3ctPnRydW5jYXRlZF9vbl9yaWdodF9wKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJQ0FMX0JBUgorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnRydW5jYXRlZF9vbl9y aWdodF9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX1ZFUlRJ Q0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiAoY3Vyc29yX2JleW9uZF9mcmluZ2VfcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJS T1cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGN1cnNvcl9iZXlvbmRf ZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGN1cnNv cl9yb3ctPnVzZWRbVEVYVF9BUkVBXSAhPSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiAhcm93LT50cnVuY2F0ZWRfb25fcmlnaHRfcCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBNQ19SRVZFUlNFRF9WRVJUSUNBTF9CQVIKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGdseXBoIC0gcm93LT5nbHlwaHNbVEVY VF9BUkVBXSA9PSByb3ctPnVzZWRbYXJlYV0gLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmJiBvcG9pbnRfeCA+PSByb3ctPnBpeGVsX3dpZHRoKQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0dMWVBITEVTUworICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGhfenZfcCkKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDogTUNfR0xZUEg7CisgICAgICBpZiAoZ2x5cGhfZmxhdm9yID09IE1D X1ZFUlRJQ0FMX0JBUl9SSUdIVF9BUlJPVworICAgICAgICAgIHx8IGdseXBoX2ZsYXZvciA9PSBN Q19SRVZFUlNFRF9WRVJUSUNBTF9CQVJfUklHSFRfQVJST1cKKyAgICAgICAgICB8fCBnbHlwaF9m bGF2b3IgPT0gTUNfVkVSVElDQUxfQkFSX0JBQ0tTTEFTSAorICAgICAgICAgIHx8IGdseXBoX2Zs YXZvciA9PSBNQ19WRVJUSUNBTF9CQVIKKyAgICAgICAgICB8fCBnbHlwaF9mbGF2b3IgPT0gTUNf UkVWRVJTRURfVkVSVElDQUxfQkFSKQorICAgICAgICBjdXJzb3JfdHlwZSA9IE1DX1JJR0hUX0ZS SU5HRV9CSVRNQVA7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVs YXRpdmVfeCwgb3BvaW50X2Z4LCB5LCBmeSwgaHBvcywgdnBvcywKKyAgICAgICAgICAgICAgICAg d2QsIGgsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgZm9yZWdyb3Vu ZCwKKyAgICAgICAgICAgICAgICAgYmFja2dyb3VuZCwgZXNzZW50aWFscy5hY3RpdmVfcCwgZ2x5 cGhfZmxhdm9yLCBkcmF3X3AsIGZyb21fd2hlcmUsCisgICAgICAgICAgICAgICAgIGNhY2hlX3R5 cGUsIGFjdGlvbl90eXBlKTsKKyAgICAgIGJyZWFrOworICAgIH0KKy8qIC0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLSAqLworLyogICAgICAgICAgICAgICAgICAgICAgICAgICBGSUxMX0NPTFVNTjogIFhXSURH RVRfR0xZUEggICAgICAgICAgICAgICAgICAgICAgICovCisvKiAtLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0g Ki8KKyAgICBjYXNlIEZJTExfQ09MVU1OOgorICAgIHsKKyAgICAgIGVudW0gbWNfZmxhdm9yIGds eXBoX2ZsYXZvciA9IChnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2Vk W2FyZWFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGVzc2Vu dGlhbHMuZmNfeCA+IHJlbGF0aXZlX3gpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gTUNfR0xZUEhMRVNTCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IChnbHlwaF96dl9wKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ IE1DX0dMWVBITEVTUworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoIU5J TFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgY2hfdmVydGlj YWxfcnVsZXIpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3Bv aW50X3kgPT0geQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgb3Bv aW50X3Zwb3MgPT0gdnBvcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PyBNQ19HTFlQSExFU1MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNf R0xZUEg7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgcmVsYXRpdmVf eCwgZmNfZngsIHksIGZ5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICB3ZCwgaCwgY3Vy c29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcm93X3Bvc2l0aW9uLCBmb3JlZ3JvdW5kLAorICAgICAg ICAgICAgICAgICBiYWNrZ3JvdW5kLCBlc3NlbnRpYWxzLmFjdGl2ZV9wLCBnbHlwaF9mbGF2b3Is IGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgY2FjaGVfdHlwZSwgYWN0aW9u X3R5cGUpOworICAgICAgYnJlYWs7CisgICAgfQorLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCisg ICAgY2FzZSBDVVJTT1JfSU5ESUNBVE9SOgorICAgIHsKKyAgICAgIGJyZWFrOworICAgIH0KKy8q IC0tLS0tLS0tLS0tLS0tLS0tLS0tL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AgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPyBNQVRSSVhfUk9XIChjdXJzb3JfbWF0cml4LCB3LT5jdXJzb3IudnBvcykKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTlVMTDsKKyAgc3RydWN0IGdseXBoICpjdXJz b3JfZ2x5cGggPSAody0+Y3Vyc29yLnZwb3MgIT0gLTEpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgPyBtY19nZXRfY3Vyc29yX2dseXBoICh3LCBjdXJzb3JfbWF0cml4LCBjdXJzb3Jf cm93LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgdy0+Y3Vyc29yLmhwb3MsIHctPmN1cnNvci52cG9zKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDogTlVMTDsKKyAgYm9vbCBjdXJzb3JfYXRfZnJpbmdlX3AgPSAoY3Vyc29yX2ds eXBoID09IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3JvdyAh PSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID09 IGN1cnNvcl9yb3ctPnVzZWRbVEVYVF9BUkVBXQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBjdXJzb3Jfcm93LT5leGFjdF93aW5kb3dfd2lkdGhfbGluZV9wCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID09IHRleHRfYXJlYV93aWR0aAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA9PSBjdXJzb3Jfcm93LT5waXhl bF93aWR0aCk7CisgIGJvb2wgY3Vyc29yX2JleW9uZF9mcmluZ2VfcCA9IChjdXJzb3JfZ2x5cGgg PT0gTlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX3JvdyAh PSBOVUxMCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBv cyA9PSBjdXJzb3Jfcm93LT51c2VkW1RFWFRfQVJFQV0KKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICYmICFjdXJzb3Jfcm93LT5leGFjdF93aW5kb3dfd2lkdGhfbGluZV9wCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA+PSB0ZXh0X2FyZWFf d2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID49 IGN1cnNvcl9yb3ctPnBpeGVsX3dpZHRoKTsKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAg ICAgICAgICAgICAgICAgICAgICAgICBSRVBMQUNFIFRIRSBSRUFMIENVUlNPUgorKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqICovCisgIGVudW0gZmFjZV9pZCBiZ19mYWNlX2lkID0gKGN1cnNvcl9nbHlw aCAhPSBOVUxMKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gY3Vyc29yX2dseXBoLT5m YWNlX2lkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBERUZBVUxUX0ZBQ0VfSUQ7Cisg IHN0cnVjdCBtY19SR0IgY3Vyc29yX2JnOworICBtY19zZXRfbHNsX2JnICh3LCBiZ19mYWNlX2lk LCAmY3Vyc29yX2JnKTsKKyAgLyogRklYTUU6ICBQdXQgaW4gc29tZSBjb2RlIHRvIGRlZmF1bHQg dG8gTUNfSE9MTE9XX0JPWCBpZiB0aGUgdXNlciBoYXMKKyAgdW53aXR0aW5nbHkgY29tZSB1cCB3 aXRoIHNvbWUgdW5hY2NlcHRhYmxlIGZvcm0gb2YgdW5yZWNvZ25pemVkIGN1cnNvciB0eXBlLiAq LworICBMaXNwX09iamVjdCBsaXNwX3R5cGUgPSBCVkFSIChiLCBtY19yZWFsX2Zha2VfY3Vyc29y KTsKKyAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlwZSA9IChDT05TUCAobGlzcF90eXBl KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gbWNfbGlzcF90b19jdXJz b3JfdHlwZSAoWENBUiAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDogbWNfbGlzcF90b19jdXJzb3JfdHlwZSAobGlzcF90eXBlKTsKKyAgaW50IGN1cnNv cl93aWR0aCA9IChDT05TUCAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgID8gWEZJ WE5VTSAoWENBUiAoWENEUiAobGlzcF90eXBlKSkpCisgICAgICAgICAgICAgICAgICAgICA6IC0x OworICBzdHJ1Y3QgbWNfUkdCIGN1cnNvcl9mZzsKKyAgbWNfY29sb3JfcGlja2VyICh3LCBjdXJz b3JfZ2x5cGgsIGVzc2VudGlhbHMsICZjdXJzb3JfZmcsIC0xLCBjdXJzb3JfdHlwZSwKKyAgICAg ICAgICAgICAgICAgICByb3dfcG9zaXRpb24sIENVUlNPUl9JTkRJQ0FUT1IpOworICBib29sIGZp bGxfY29sdW1uX3RydW1wc19wID0gKCFOSUxQIChCVkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIGZjX3Zp c2libGUpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54ID09 IGVzc2VudGlhbHMuZmNfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFjdXJz b3JfYXRfZnJpbmdlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhY3Vyc29y X2JleW9uZF9mcmluZ2VfcCk7CisgIC8qIFdlIHVzZSBhIHRlc3Qgc2ltaWxhciB0byB0aGUgcmVh bCBmYWtlIGN1cnNvciBzbyB0aGF0IHRoZSBmcmluZ2UgYml0bWFwIGlzCisgIG9ubHkgZHJhd24g b25jZSBwZXIgd2luZG93LiAqLworICBpZiAodnBvcyA9PSB3LT5jdXJzb3IudnBvcworICAgICAg JiYgaHBvc19zdGFydCArIGhwb3NfbGVuZ3RoID09IHJvdy0+dXNlZFtURVhUX0FSRUFdCisgICAg ICAmJiAhTklMUCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAmJiAhTklMUCAoQlZBUiAo YiwgY2hfaG9yaXpvbnRhbF9ydWxlcikpKQorICAgIHsKKyAgICAgIC8qIGZyaW5nZSBiaXRtYXBz IHVzZSBmYWNlX2lkIHRvIHNldCB0aGUgZm9yZWdyb3VuZCBjb2xvci4gIFRoZSBvdmVybGF5LWFy cm93CisgICAgICBpcyBwcmVzZW50bHkgdGhlIG9ubHkgc2l0dWF0aW9uIHdoZXJlIHRoZSBgZXNz ZW50aWFscy5hY3RpdmVfcGAgYW5kIGBtaW5pbWFsX3BgIGFyZQorICAgICAgdXNlZCB0byBkZXRl cm1pbmUgdGhlIGFwcGxpY2FibGUgZmFjZV9pZC4gKi8KKyAgICAgIHN0cnVjdCBtY19SR0IgbHNs X2ZnID0gey5yZWQgPSAtMS4wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdyZWVu ID0gLTEuMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0gLTEuMH07Cisg ICAgICAvKiBXZSB1c2UgdGhlIGZpcnN0IGdseXBoIGluIHRoZSByb3csIHdpdGggYW4gWCBhbmQg SFBPUyBvZiB6ZXJvLiAqLworICAgICAgbWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgcm93LT5n bHlwaHNbVEVYVF9BUkVBXSwgMCwgLTEsIHctPmN1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gICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA/IENIX0NBQ0hFCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA6IE1DX0NBQ0hFLCBDVVJTT1JfSU5ESUNBVE9SKTsKKyAgICAg IG1jX2dldF9jdXJzb3JfZ2VvbWV0cnkgKHcsIG1hdHJpeCwgcm93LCB3LT5jdXJzb3IueCwgJm9w b2ludF9meCwgdy0+Y3Vyc29yLnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmb3Bv aW50X2Z5LCB3LT5jdXJzb3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MsICZvcG9pbnRfaCwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIE1DX0hCQVIsIDEsICZvcG9pbnRfd2QpOworICAgICAg bWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgY3Vyc29yX2dseXBoLCB3LT5jdXJzb3IueCwgb3Bv aW50X2Z4LCB3LT5jdXJzb3IueSwKKyAgICAgICAgICAgICAgICAgb3BvaW50X2Z5LCB3LT5jdXJz b3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MsIG9wb2ludF93ZCwgb3BvaW50X2gsCisgICAgICAgICAg ICAgICAgIE1DX0hCQVIsIDEsIHJvd19wb3NpdGlvbiwgY3Vyc29yX2ZnLCBjdXJzb3JfYmcsIGVz c2VudGlhbHMuYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgIE1DX0dMWVBILCBkcmF3X3AsIGZy b21fd2hlcmUsIE5JTFAgKEJWQVIgKGIsIG1jX2NvbmYpKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IENIX0NBQ0hFCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTUNfQ0FDSEUsIENVUlNPUl9JTkRJQ0FUT1Ip OworICAgIH0KKyAgZWxzZSBpZiAoIWN1cnNvcl9hdF9mcmluZ2VfcAorICAgICAgICAgICAmJiBj dXJzb3JfZ2x5cGggIT0gTlVMTAorICAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9z CisgICAgICAgICAgICYmIHctPmN1cnNvci5ocG9zID49IGhwb3Nfc3RhcnQKKyAgICAgICAgICAg JiYgdy0+Y3Vyc29yLmhwb3MgPCBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGgKKyAgICAgICAgICAg JiYgY3Vyc29yX2dseXBoLT50eXBlICE9IFNUUkVUQ0hfR0xZUEgpCisgICAgeworICAgICAgbWNf Z2V0X2N1cnNvcl9nZW9tZXRyeSAodywgbWF0cml4LCByb3csIHctPmN1cnNvci54LCAmb3BvaW50 X2Z4LCB3LT5jdXJzb3IueSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZvcG9pbnRf ZnksIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgJm9wb2ludF93 ZCk7CisgICAgICBtY19oZWxwZXIgKHcsIG1hdHJpeCwgcm93LCBjdXJzb3JfZ2x5cGgsIHctPmN1 cnNvci54LCBvcG9pbnRfZngsIHctPmN1cnNvci55LAorICAgICAgICAgICAgICAgICBvcG9pbnRf ZnksIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywgb3BvaW50X3dkLCBvcG9pbnRfaCwK KyAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUsIGN1cnNvcl93aWR0aCwgcm93X3Bvc2l0aW9u LCBjdXJzb3JfZmcsIGN1cnNvcl9iZywKKyAgICAgICAgICAgICAgICAgZXNzZW50aWFscy5hY3Rp dmVfcCwgTUNfR0xZUEgsIGRyYXdfcCwgZnJvbV93aGVyZSwKKyAgICAgICAgICAgICAgICAgTklM UCAoQlZBUiAoYiwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgID8gQ0hfQ0FDSEUKKyAgICAg ICAgICAgICAgICAgOiBNQ19DQUNIRSwgQ1VSU09SX0lORElDQVRPUik7CisgICAgfQorICBlbHNl IGlmICghY3Vyc29yX2F0X2ZyaW5nZV9wCisgICAgICAgICAgICYmIGN1cnNvcl9nbHlwaCAhPSBO VUxMCisgICAgICAgICAgICYmIHZwb3MgPT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAgICAgJiYg dy0+Y3Vyc29yLmhwb3MgPj0gaHBvc19zdGFydAorICAgICAgICAgICAmJiB3LT5jdXJzb3IuaHBv cyA8IGhwb3Nfc3RhcnQgKyBocG9zX2xlbmd0aAorICAgICAgICAgICAmJiBjdXJzb3JfZ2x5cGgt PnR5cGUgPT0gU1RSRVRDSF9HTFlQSCkKKyAgICB7CisgICAgICAvKiBJZiBhIHVzZXIgaGFzIHNl dCBgeC1zdHJldGNoLWN1cnNvcicgdG8gYSBub24tbmlsIHZhbHVlLCBoZS9zaGUgY2hvc2UgdG8K KyAgICAgIGhhdmUgYSBjdXJzb3IgdGhhdCBzcGFucyB0aGUgZW50aXJlIGxlbmd0aCBvZiB0aGUg U1RSRVRDSF9HTFlQSC4gKi8KKyAgICAgIGlmICgheF9zdHJldGNoX2N1cnNvcl9wKQorICAgICAg ICB7CisgICAgICAgICAgLyogVGhlIE1DX0hCQVIgc2hhbGwgaGF2ZSBhIGBjdXJzb3Jfd2lkdGhg IG9mIDEuICovCisgICAgICAgICAgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeSAodywgbWF0cml4LCBy b3csIHctPmN1cnNvci54LCAmb3BvaW50X2Z4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHctPmN1cnNvci55LCAmb3BvaW50X2Z5LCB3LT5jdXJzb3IuaHBvcywKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICB3LT5jdXJzb3IudnBvcywgJm9wb2ludF9oLCBNQ19I QkFSLCAxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZvcG9pbnRfd2QpOwor ICAgICAgICAgIG1jX2hlbHBlciAodywgbWF0cml4LCByb3csIGN1cnNvcl9nbHlwaCwgdy0+Y3Vy c29yLngsIG9wb2ludF9meCwKKyAgICAgICAgICAgICAgICAgICAgIHctPmN1cnNvci55LCBvcG9p bnRfZnksIHctPmN1cnNvci5ocG9zLCB3LT5jdXJzb3IudnBvcywKKyAgICAgICAgICAgICAgICAg ICAgIG9wb2ludF93ZCwgb3BvaW50X2gsIE1DX0hCQVIsIDEsIHJvd19wb3NpdGlvbiwgY3Vyc29y X2ZnLAorICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX2JnLCBlc3NlbnRpYWxzLmFjdGl2ZV9w LCBNQ19HTFlQSCwgZHJhd19wLCBmcm9tX3doZXJlLAorICAgICAgICAgICAgICAgICAgICAgTklM UCAoQlZBUiAoYiwgbWNfY29uZikpCisgICAgICAgICAgICAgICAgICAgICA/IENIX0NBQ0hFCisg ICAgICAgICAgICAgICAgICAgICA6IE1DX0NBQ0hFLCBDVVJTT1JfSU5ESUNBVE9SKTsKKyAgICAg ICAgfQorICAgICAgbWNfZ2V0X2N1cnNvcl9nZW9tZXRyeSAodywgbWF0cml4LCByb3csIHctPmN1 cnNvci54LCAmb3BvaW50X2Z4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy0+Y3Vy c29yLnksICZvcG9pbnRfZnksIHctPmN1cnNvci5ocG9zLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgdy0+Y3Vyc29yLnZwb3MsICZvcG9pbnRfaCwgY3Vyc29yX3R5cGUsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3Jfd2lkdGgsICZvcG9pbnRfd2QpOworICAgICAg bWNfaGVscGVyICh3LCBtYXRyaXgsIHJvdywgY3Vyc29yX2dseXBoLCB3LT5jdXJzb3IueCwgb3Bv aW50X2Z4LCB3LT5jdXJzb3IueSwKKyAgICAgICAgICAgICAgICAgb3BvaW50X2Z5LCB3LT5jdXJz b3IuaHBvcywgdy0+Y3Vyc29yLnZwb3MsIG9wb2ludF93ZCwgb3BvaW50X2gsCisgICAgICAgICAg ICAgICAgIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIHJvd19wb3NpdGlvbiwgY3Vyc29yX2Zn LCBjdXJzb3JfYmcsCisgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMuYWN0aXZlX3AsIE1DX0dM WVBILCBkcmF3X3AsIGZyb21fd2hlcmUsCisgICAgICAgICAgICAgICAgIE5JTFAgKEJWQVIgKGIs IG1jX2NvbmYpKQorICAgICAgICAgICAgICAgICA/IENIX0NBQ0hFCisgICAgICAgICAgICAgICAg IDogTUNfQ0FDSEUsIENVUlNPUl9JTkRJQ0FUT1IpOworICAgIH0KKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKgorICAgICAgICAgICAgICAgICAgICAgICAgICBEUkFXIEFORCBSRUNPUkQgRkFLRSBD VVJTT1JTCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAgaWYgKCFlc3NlbnRpYWxzLmFjdGl2 ZV9wCisgICAgICAmJiBOSUxQIChCVkFSIChiLCBtY19pbmFjdGl2ZV93aW5kb3dzKSkKKyAgICAg ICYmIE5JTFAgKEJWQVIgKGIsIGNoX2luYWN0aXZlX3dpbmRvd3MpKQorICAgICAgJiYgTklMUCAo QlZBUiAoYiwgZmNfaW5hY3RpdmVfd2luZG93cykpKQorICAgIHJldHVybjsKKyAgaWYgKGhwb3Nf bGVuZ3RoID09IDEpCisgICAgeworICAgICAgaWYgKCFOSUxQIChCVkFSIChiLCBtY19jb25mKSkK KyAgICAgICAgICAmJiAoZXNzZW50aWFscy5hY3RpdmVfcAorICAgICAgICAgICAgICB8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AgICAgICAgICAgICAgICAgICAgICAgICA/IHJvdy0+Z2x5cGhz W1RFWFRfQVJFQV0gKyBocG9zIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA6IE5VTEw7CisgICAgICAgICAgLy8gc3RydWN0IGdseXBoICpsYXN0X2dseXBoID0g cm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMTsKKyAgICAg ICAgICBib29sIHNraXBfcCA9IChwcmV2aW91c19nbHlwaCAhPSBOVUxMCisgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgcHJldmlvdXNfZ2x5cGgtPmNoYXJwb3MgPT0gTUFUUklYX1JPV19FTkRf Q0hBUlBPUyAocm93KSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAmJiBzdGFydC0+Ynl0 ZXBvcyAhPSBlc3NlbnRpYWxzLnp2X2J5dGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgID8g dHJ1ZQorICAgICAgICAgICAgICAgICAgICAgICAgLyogV2hlbiBhIGBidWZmZXItZGlzcGxheS10 YWJsZScgZW50cnkgY29udGFpbnMKKyAgICAgICAgICAgICAgICAgICAgICAgIGEgdmlzaWJsZSB0 YWIgY2hhcmFjdGVyICgiwrsiKSwgdGhlIHN1YnNlcXVlbnQKKyAgICAgICAgICAgICAgICAgICAg ICAgIFNUUkVUQ0hfR0xZUEggd2lsbCBoYXZlIHRoZSBzYW1lIHN0YXJ0LT5jaGFycG9zCisgICAg ICAgICAgICAgICAgICAgICAgICBhcyB0aGUgYWZvcmVtZW50aW9uZWQgdmlzaWJsZSB0YWIgY2hh cmFjdGVyLiAqLworICAgICAgICAgICAgICAgICAgICAgICAgOiAocHJldmlvdXNfZ2x5cGggIT0g TlVMTAorICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgcHJldmlvdXNfZ2x5cGgtPmNoYXJw b3MgPT0gc3RhcnQtPmNoYXJwb3MpCisgICAgICAgICAgICAgICAgICAgICAgICAgID8gdHJ1ZQor ICAgICAgICAgICAgICAgICAgICAgICAgOiBmYWxzZTsKKyAgICAgICAgICBpbnQgcG9zaW50ID0g KHJvd19wb3NpdGlvbiA9PSBQT1NUX1pWKQorICAgICAgICAgICAgICAgICAgICAgICAgID8gLTEK KyAgICAgICAgICAgICAgICAgICAgICAgOiAocm93X3Bvc2l0aW9uID09IEFUX1pWKQorICAgICAg ICAgICAgICAgICAgICAgICAgICA/IGVzc2VudGlhbHMuenYKKyAgICAgICAgICAgICAgICAgICAg ICAgOiAoc3RhcnQtPmJ5dGVwb3MgIT0gZXNzZW50aWFscy56dl9ieXRlCisgICAgICAgICAgICAg ICAgICAgICAgICAgICYmIHN0YXJ0IC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9PSByb3ctPnVz ZWRbVEVYVF9BUkVBXSAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgPyBNQVRSSVhfUk9X X0VORF9DSEFSUE9TIChyb3cpIC0gMQorICAgICAgICAgICAgICAgICAgICAgICA6IChzdGFydC0+ Ynl0ZXBvcyA9PSBlc3NlbnRpYWxzLnp2X2J5dGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgc3RhcnQgLSByb3ctPmdseXBoc1tURVhUX0FSRUFdID09IHJvdy0+dXNlZFtURVhUX0FSRUFd IC0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICA/IGVzc2VudGlhbHMuenYKKyAgICAgICAg ICAgICAgICAgICAgICAgOiBzdGFydC0+Y2hhcnBvczsKKyAgICAgICAgICBMaXNwX09iamVjdCBz cGVjcyA9IG1jX2Fzc29jIChtYWtlX2ZpeG51bSAocG9zaW50KSwgQlZBUiAoYiwgbWNfY29uZikp OworICAgICAgICAgIGlmICgoKGhlYWRlcl9saW5lX2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisg ICAgICAgICAgICAgICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAg JiYgIU5JTFAgKHNwZWNzKQorICAgICAgICAgICAgICAmJiByb3ctPnkgPD0gd2luZG93X3RleHRf Ym90dG9tX3kgKHcpCisgICAgICAgICAgICAgICYmICFza2lwX3AKKyAgICAgICAgICAgICAgJiYg cm93X3Bvc2l0aW9uICE9IFBPU1RfWlYpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIExp c3BfT2JqZWN0IGxpc3BfdHlwZSA9IG1jX250aCAoMSwgc3BlY3MpOworICAgICAgICAgICAgICBl bnVtIG1jX2N1cnNvcl90eXBlIGN1cnNvcl90eXBlID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtY19saXNwX3Rv X2N1cnNvcl90eXBlIChYQ0FSIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgOiBtY19saXNwX3RvX2N1cnNvcl90eXBlIChsaXNwX3R5 cGUpOworICAgICAgICAgICAgICBjdXJzb3JfdHlwZSA9IChzdGFydC0+dHlwZSA9PSBJTUFHRV9H TFlQSCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1DX0hPTExPV19CT1gKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IGN1cnNvcl90eXBlOworICAgICAgICAgICAgICBpbnQg Y3Vyc29yX3dpZHRoID0gKENPTlNQIChsaXNwX3R5cGUpKQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBYRklYTlVNIChYQ0FSIChYQ0RSIChsaXNwX3R5cGUpKSkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDogLTE7CisgICAgICAgICAgICAgIExpc3BfT2JqZWN0 IG1jX2ZvcmVncm91bmQgPSBtY19udGggKDIsIHNwZWNzKTsKKyAgICAgICAgICAgICAgc3RydWN0 IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgICAgIGlmIChTVFJJTkdQIChtY19mb3JlZ3JvdW5k KSkKKyAgICAgICAgICAgICAgICBtY194d19jb2xvcl92YWx1ZXMgKHcsIG1jX2ZvcmVncm91bmQs ICZsc2xfZmcpOworICAgICAgICAgICAgICAgIGVsc2UgaWYgKFZFQ1RPUlAgKG1jX2ZvcmVncm91 bmQpKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBsc2xfZmcucmVk ID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDApKTsKKyAgICAgICAgICAgICAg ICAgICAgbHNsX2ZnLmdyZWVuID0gWEZMT0FUX0RBVEEgKEFSRUYgKG1jX2ZvcmVncm91bmQsIDEp KTsKKyAgICAgICAgICAgICAgICAgICAgbHNsX2ZnLmJsdWUgPSBYRkxPQVRfREFUQSAoQVJFRiAo bWNfZm9yZWdyb3VuZCwgMikpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAg ICAgZWxzZSBpZiAoTklMUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAgICAgICAgICAgICAgIG1j X2NvbG9yX3BpY2tlciAodywgc3RhcnQsIGVzc2VudGlhbHMsICZsc2xfZmcsIHBvc2ludCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3JfdHlwZSwgcm93X3Bvc2l0 aW9uLCBNVUxUSVBMRV9DVVJTT1JTKTsKKyAgICAgICAgICAgICAgaW50IHZwb3MgPSBNQVRSSVhf Uk9XX1ZQT1MgKHJvdywgbWF0cml4KTsKKyAgICAgICAgICAgICAgaW50IHhfbGltaXQgPSB0ZXh0 X2FyZWFfd2lkdGg7CisgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIHN0 YXJ0LCBURVhUX0FSRUEsIHgsIHhfbGltaXQsIHJvdy0+eSwKKyAgICAgICAgICAgICAgICAgICAg ICAgICBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sIHZwb3MsIGN1cnNvcl90eXBlLAor ICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgY3Vyc29yX21hdHJpeCwgZXNz ZW50aWFscywgcm93X3Bvc2l0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgIGxzbF9mZywg TVVMVElQTEVfQ1VSU09SUywgZHJhd19wLCBmcm9tX3doZXJlLCBNQ19DQUNIRSk7CisgICAgICAg ICAgICB9CisgICAgICAgIH0KKyAgICAgIGlmICghTklMUCAoQlZBUiAoYiwgZmNfdmlzaWJsZSkp CisgICAgICAgICAgJiYgKGVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgfHwgKCFl c3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwg ZmNfaW5hY3RpdmVfd2luZG93cykpKSkKKyAgICAgICAgICAvLyAmJiBlc3NlbnRpYWxzLmZjX3gg PD0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194IDwgdGV4dF9h cmVhX3dpZHRoCisgICAgICAgICAgJiYgZXNzZW50aWFscy5mY194ID49IHctPm1jLmxudW1fcGl4 ZWxfd2lkdGgpCisgICAgICAgIHsKKyAgICAgICAgICBpbnQgeF9saW1pdCA9IHggKyBzdGFydC0+ cGl4ZWxfd2lkdGg7CisgICAgICAgICAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3AgPSAody0+Y3Vy c29yLnggPT0gZXNzZW50aWFscy5mY194CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgJiYgdy0+Y3Vyc29yLnkgPT0gcm93LT55CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gc3RhcnQgLSByb3ctPmdseXBoc1tURVhU X0FSRUFdCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29y LnZwb3MgPT0gdnBvcyk7CisgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAg ICAgbWNfY29sb3JfcGlja2VyICh3LCBzdGFydCwgZXNzZW50aWFscywgJmxzbF9mZywgLTEsIE1D X0JBUiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvd19wb3NpdGlvbiwgRklMTF9DT0xV TU4pOworICAgICAgICAgIGlmICh4IDwgdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgIC8v IHggKyBzdGFydC0+cGl4ZWxfd2lkdGggPD0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAg ICYmICgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID4gMCkKKyAgICAgICAgICAgICAg ICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAgICAgICAmJiAoKHN0YXJ0 ICE9IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEKKyAg ICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPj0geAorICAgICAgICAgICAgICAg ICAgICYmIGVzc2VudGlhbHMuZmNfeCA8IHggKyBzdGFydC0+cGl4ZWxfd2lkdGgpCisgICAgICAg ICAgICAgICAgICB8fCAoc3RhcnQgPT0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIHJvdy0+dXNl ZFtURVhUX0FSRUFdIC0gMQorICAgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNf eCA+PSB4KSkKKyAgICAgICAgICAgICAgJiYgcm93LT55IDw9IHdpbmRvd190ZXh0X2JvdHRvbV95 ICh3KQorICAgICAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAgICAg bWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgc3RhcnQsIFRFWFRfQVJFQSwgeCwgeF9saW1pdCwg cm93LT55LAorICAgICAgICAgICAgICAgICAgICAgICBzdGFydCAtIHJvdy0+Z2x5cGhzW1RFWFRf QVJFQV0sIHZwb3MsIE1DX0JBUiwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX21h dHJpeCwgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBsc2xfZmcsCisgICAgICAgICAgICAgICAg ICAgICAgIEZJTExfQ09MVU1OLCBkcmF3X3AsIGZyb21fd2hlcmUsIEZDX0NBQ0hFKTsKKyAgICAg ICAgfQorICAgICAgaWYgKCFOSUxQIChCVkFSIChiLCBjcm9zc2hhaXJzKSkKKyAgICAgICAgICAm JiAhTklMUCAoQlZBUiAoYiwgY2hfaG9yaXpvbnRhbF9ydWxlcikpCisgICAgICAgICAgJiYgKGVz c2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9w CisgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfaW5hY3RpdmVfd2luZG93 cykpKSkKKyAgICAgICAgICAmJiB2cG9zID09IHctPmN1cnNvci52cG9zKQorICAgICAgICB7Cisg ICAgICAgICAgaW50IHhfbGltaXQgPSAoc3RhcnQgPT0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSAr IHJvdy0+dXNlZFtURVhUX0FSRUFdIC0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgID8gdGV4 dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICA6IHggKyBzdGFydC0+cGl4ZWxf d2lkdGg7CisgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgbWNfY29s b3JfcGlja2VyICh3LCBzdGFydCwgZXNzZW50aWFscywgJmxzbF9mZywgLTEsIE1DX0hCQVIsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICByb3dfcG9zaXRpb24sIEh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ZSA9IChzdGFydC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkKKyAgICAg ICAgICAgICAgICAgICAgICAgID8gTUNfSE9MTE9XX0JPWAorICAgICAgICAgICAgICAgICAgICAg ICAgOiBNQ19CQVI7CisgICAgICAgICAgaW50IHhfbGltaXQgPSB0ZXh0X2FyZWFfd2lkdGg7Cisg ICAgICAgICAgYm9vbCByZWFsX2Zha2VfY3Vyc29yX3AgPSAody0+Y3Vyc29yLnkgPT0gcm93LT55 CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnZwb3Mg PT0gdnBvcyk7CisgICAgICAgICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgbWNf Y29sb3JfcGlja2VyICh3LCBzdGFydCwgZXNzZW50aWFscywgJmxzbF9mZywgLTEsIGN1cnNvcl90 eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93X3Bvc2l0aW9uLCBWRVJUSUNBTF9S VUxFUik7CisgICAgICAgICAgaWYgKCgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID4g MCkKKyAgICAgICAgICAgICAgIHx8IGhlYWRlcl9saW5lX2Zvcm1hdCA9PSAwKQorICAgICAgICAg ICAgICAmJiAoKHN0YXJ0ICE9IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyByb3ctPnVzZWRbVEVY VF9BUkVBXSAtIDEKKyAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA+PSB4CisgICAg ICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLnggPCB4ICsgc3RhcnQtPnBpeGVsX3dpZHRoKQor ICAgICAgICAgICAgICAgICAgfHwgKHN0YXJ0ID09IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gKyBy b3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJz b3IueCA+PSB4KSkKKyAgICAgICAgICAgICAgJiYgcm93LT55IDw9IHdpbmRvd190ZXh0X2JvdHRv bV95ICh3KQorICAgICAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNvcl9wKQorICAgICAgICAg ICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgc3RhcnQsIFRFWFRfQVJFQSwgeCwgeF9saW1p dCwgcm93LT55LAorICAgICAgICAgICAgICAgICAgICAgICBzdGFydCAtIHJvdy0+Z2x5cGhzW1RF WFRfQVJFQV0sIHZwb3MsIGN1cnNvcl90eXBlLCAxLAorICAgICAgICAgICAgICAgICAgICAgICBj dXJzb3JfbWF0cml4LCBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGxzbF9mZywKKyAgICAgICAg ICAgICAgICAgICAgICAgVkVSVElDQUxfUlVMRVIsIGRyYXdfcCwgZnJvbV93aGVyZSwgQ0hfQ0FD SEUpOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UKKyAgICAgIHsKKyAgICAgICAgaW50IHJl bGF0aXZlX3ggPSAwOworICAgICAgICBmb3IgKGludCBhcmVhID0gTEVGVF9NQVJHSU5fQVJFQTsg YXJlYSA8IExBU1RfQVJFQTsgKythcmVhKQorICAgICAgICAgIHsKKyAgICAgICAgICAgIHN0cnVj dCBnbHlwaCAqZ2x5cGggPSByb3ctPmdseXBoc1thcmVhXTsKKyAgICAgICAgICAgIHN0cnVjdCBn bHlwaCAqZ2x5cGhfZW5kID0gZ2x5cGggKyByb3ctPnVzZWRbYXJlYV07CisgICAgICAgICAgICAv KiBHbHlwaCBmb3IgYSBsaW5lIGVuZCBpbiB0ZXh0LiAqLworICAgICAgICAgICAgaWYgKGFyZWEg PT0gVEVYVF9BUkVBICYmIGdseXBoID09IGdseXBoX2VuZCAmJiBnbHlwaC0+Y2hhcnBvcyA+IDAp CisgICAgICAgICAgICAgICsrZ2x5cGhfZW5kOworICAgICAgICAgICAgZm9yICg7IGdseXBoIDwg Z2x5cGhfZW5kOyArK2dseXBoKQorICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYg KHZwb3MgIT0gdy0+Y3Vyc29yLnZwb3MKKyAgICAgICAgICAgICAgICAgICAgJiYgZ2x5cGggIT0g Z2x5cGhfZW5kIC0gMQorICAgICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPCBy ZWxhdGl2ZV94CisgICAgICAgICAgICAgICAgICAgICYmIHctPmN1cnNvci54IDwgcmVsYXRpdmVf eAorICAgICAgICAgICAgICAgICAgICAmJiBOSUxQIChCVkFSIChiLCBtY19jb25mKSkpCisgICAg ICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKGIs IG1jX2NvbmYpKQorICAgICAgICAgICAgICAgICAgICAmJiAoZXNzZW50aWFscy5hY3RpdmVfcAor ICAgICAgICAgICAgICAgICAgICAgICAgfHwgKCFlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJiYgIU5JTFAgKEJWQVIgKGIsIG1jX2luYWN0aXZlX3dpbmRv d3MpKSkpKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvKiBUaGUg c3BhY2UgYXBwZW5kZWQgdG8gYSByb3cgZW5kaW5nIHdpdGggYSBuZXcgbGluZSBkb2VzCisgICAg ICAgICAgICAgICAgICAgIG5vdCBoYXZlIGEgYGdseXBoLT5jaGFycG9zYCAoLTEsIDApIHRoYXQg d2UgY2FuIHVzZSBmb3IgdGhpcworICAgICAgICAgICAgICAgICAgICBwYXJ0aWN1bGFyIGFwcGxp Y2F0aW9uLiAgV2hlbiBhIGBidWZmZXItZGlzcGxheS10YWJsZScgZW50cnkKKyAgICAgICAgICAg ICAgICAgICAgYXNzaWducyBhIHZpc2libGUgZ2x5cGggdG8gYSBuZXcgbGluZSwgdGhlcmUgaXMg bm8gcHJvYmxlbQorICAgICAgICAgICAgICAgICAgICBiZWNhdXNlIHRoYXQgZ2x5cGggaGFzIGEg YGdseXBoLT5jaGFycG9zJyB0aGF0IHdlIGNhbiB1c2UuCisgICAgICAgICAgICAgICAgICAgIFdo ZW4gbm8gdmlzaWJsZSBFT0wgZ2x5cGggZXhpc3RzLCB3ZSB1c2UgdGhlIGZvbGxvd2luZyB0ZXN0 OgorICAgICAgICAgICAgICAgICAgICB0aGUgYXBwZW5kZWQgc3BhY2UgaGFzIGEgcG9zaXRpb24g dGhhdCBpcyBvbmUgbGVzcyB0aGFuIHRoZQorICAgICAgICAgICAgICAgICAgICBlbmQgb2YgdGhl IG1hdHJpeCByb3cuICovCisgICAgICAgICAgICAgICAgICAgIGludCBocG9zID0gZ2x5cGggLSBy b3ctPmdseXBoc1tURVhUX0FSRUFdOworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGgg KnByZXZpb3VzX2dseXBoID0gKDAgPD0gaHBvcyAtIDEgJiYgaHBvcyAtIDEgPCByb3ctPnVzZWRb VEVYVF9BUkVBXSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSArIGhwb3MgLSAxCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE5VTEw7CisgICAgICAgICAg ICAgICAgICAgIC8vIHN0cnVjdCBnbHlwaCAqbGFzdF9nbHlwaCA9IHJvdy0+Z2x5cGhzW1RFWFRf QVJFQV0gKyByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDE7CisgICAgICAgICAgICAgICAgICAgIGJv b2wgc2tpcF9wID0gKHByZXZpb3VzX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJiYgcHJldmlvdXNfZ2x5cGgtPmNoYXJwb3MgPT0gTUFUUklYX1JPV19F TkRfQ0hBUlBPUyAocm93KSAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgZ2x5cGgtPmJ5dGVwb3MgIT0gZXNzZW50aWFscy56dl9ieXRlKQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgPyB0cnVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgLyogV2hlbiBhIGBidWZmZXItZGlzcGxheS10YWJsZScgZW50cnkgY29udGFpbnMKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhIHZpc2libGUgdGFiIGNoYXJhY3RlciAo IsK7IiksIHRoZSBzdWJzZXF1ZW50CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg U1RSRVRDSF9HTFlQSCB3aWxsIGhhdmUgdGhlIHNhbWUgZ2x5cGgtPmNoYXJwb3MKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBhcyB0aGUgYWZvcmVtZW50aW9uZWQgdmlzaWJsZSB0 YWIgY2hhcmFjdGVyLiAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKHBy ZXZpb3VzX2dseXBoICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiBwcmV2aW91c19nbHlwaC0+Y2hhcnBvcyA9PSBnbHlwaC0+Y2hhcnBvcykKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gdHJ1ZQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDogZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIGludCBwb3NpbnQgPSAo cm93X3Bvc2l0aW9uID09IFBPU1RfWlYpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgID8gLTEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKHJvd19wb3NpdGlv biA9PSBBVF9aVikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZXNzZW50 aWFscy56dgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoZ2x5cGgtPmJ5dGVw b3MgIT0gZXNzZW50aWFscy56dl9ieXRlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmJiBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0gPT0gcm93LT51c2VkW1RFWFRf QVJFQV0gLSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1BVFJJWF9S T1dfRU5EX0NIQVJQT1MgKHJvdykgLSAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICA6IChnbHlwaC0+Ynl0ZXBvcyA9PSBlc3NlbnRpYWxzLnp2X2J5dGUKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICYmIGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXSA9 PSByb3ctPnVzZWRbVEVYVF9BUkVBXSAtIDEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgID8gZXNzZW50aWFscy56dgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiBnbHlwaC0+Y2hhcnBvczsKKyAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3Qgc3BlY3Mg PSBtY19hc3NvYyAobWFrZV9maXhudW0gKHBvc2ludCksIEJWQVIgKGIsIG1jX2NvbmYpKTsKKyAg ICAgICAgICAgICAgICAgICAgaWYgKCgoaGVhZGVyX2xpbmVfZm9ybWF0ID4gMCAmJiB2cG9zID4g MCkKKyAgICAgICAgICAgICAgICAgICAgICAgICB8fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkK KyAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChzcGVjcykKKyAgICAgICAgICAgICAg ICAgICAgICAgICYmIHJvdy0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAodykKKyAgICAgICAg ICAgICAgICAgICAgICAgICYmICFza2lwX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIHJv d19wb3NpdGlvbiAhPSBQT1NUX1pWKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAg ICAgICAgICAgICAgICAgIExpc3BfT2JqZWN0IGxpc3BfdHlwZSA9IG1jX250aCAoMSwgc3BlY3Mp OworICAgICAgICAgICAgICAgICAgICAgICAgZW51bSBtY19jdXJzb3JfdHlwZSBjdXJzb3JfdHlw ZSA9IChDT05TUCAobGlzcF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICA/IG1jX2xpc3BfdG9fY3Vyc29yX3R5cGUgKFhDQVIg KGxpc3BfdHlwZSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgOiBtY19saXNwX3RvX2N1cnNvcl90eXBlIChsaXNwX3R5cGUpOworICAg ICAgICAgICAgICAgICAgICAgICAgY3Vyc29yX3R5cGUgPSAoZ2x5cGgtPnR5cGUgPT0gSU1BR0Vf R0xZUEgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gTUNfSE9MTE9X X0JPWAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGN1cnNvcl90eXBl OworICAgICAgICAgICAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0aCA9IChDT05TUCAobGlz cF90eXBlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFhG SVhOVU0gKFhDQVIgKFhDRFIgKGxpc3BfdHlwZSkpKQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIDogLTE7CisgICAgICAgICAgICAgICAgICAgICAgICBMaXNwX09i amVjdCBtY19mb3JlZ3JvdW5kID0gbWNfbnRoICgyLCBzcGVjcyk7CisgICAgICAgICAgICAgICAg ICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlm IChTVFJJTkdQIChtY19mb3JlZ3JvdW5kKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgbWNf eHdfY29sb3JfdmFsdWVzICh3LCBtY19mb3JlZ3JvdW5kLCAmbHNsX2ZnKTsKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgZWxzZSBpZiAoVkVDVE9SUCAobWNfZm9yZWdyb3VuZCkpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNs X2ZnLnJlZCA9IFhGTE9BVF9EQVRBIChBUkVGIChtY19mb3JlZ3JvdW5kLCAwKSk7CisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBsc2xfZmcuZ3JlZW4gPSBYRkxPQVRfREFUQSAoQVJFRiAo bWNfZm9yZWdyb3VuZCwgMSkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNsX2Zn LmJsdWUgPSBYRkxPQVRfREFUQSAoQVJFRiAobWNfZm9yZWdyb3VuZCwgMikpOworICAgICAgICAg ICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlm IChOSUxQIChtY19mb3JlZ3JvdW5kKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1j X2NvbG9yX3BpY2tlciAodywgZ2x5cGgsIGVzc2VudGlhbHMsICZsc2xfZmcsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2ludCwgY3Vyc29yX3R5cGUs IHJvd19wb3NpdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgTVVMVElQTEVfQ1VSU09SUyk7CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgdnBv cyA9IE1BVFJJWF9ST1dfVlBPUyAocm93LCBtYXRyaXgpOworICAgICAgICAgICAgICAgICAgICAg ICAgaW50IHhfbGltaXQgPSB0ZXh0X2FyZWFfd2lkdGg7CisgICAgICAgICAgICAgICAgICAgICAg ICBtY19lbmdpbmUgKHcsIG1hdHJpeCwgcm93LCBnbHlwaCwgYXJlYSwgcmVsYXRpdmVfeCwKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeF9saW1pdCwgcm93LT55LCBnbHlwaCAt IHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHZwb3MsIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGN1cnNvcl9tYXRyaXgsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVzc2VudGlhbHMsIHJvd19wb3NpdGlvbiwg bHNsX2ZnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNVUxUSVBMRV9DVVJT T1JTLCBkcmF3X3AsIGZyb21fd2hlcmUsIE1DX0NBQ0hFKTsKKyAgICAgICAgICAgICAgICAgICAg ICB9CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKCFOSUxQIChCVkFS IChiLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAgICAgICAgICAgJiYgKGVzc2VudGlhbHMuYWN0 aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgIHx8ICghZXNzZW50aWFscy5hY3RpdmVfcAor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChCVkFSIChiLCBmY19pbmFjdGl2 ZV93aW5kb3dzKSkpKQorICAgICAgICAgICAgICAgICAgICAvLyAmJiBlc3NlbnRpYWxzLmZjX3gg PD0gdGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICYmIGVzc2VudGlhbHMuZmNf eCA8IHRleHRfYXJlYV93aWR0aAorICAgICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZj X3ggPj0gdy0+bWMubG51bV9waXhlbF93aWR0aCkKKyAgICAgICAgICAgICAgICAgIHsKKyAgICAg ICAgICAgICAgICAgICAgaW50IHhfbGltaXQgPSB0ZXh0X2FyZWFfd2lkdGg7CisgICAgICAgICAg ICAgICAgICAgIGJvb2wgcmVhbF9mYWtlX2N1cnNvcl9wID0gKHctPmN1cnNvci54ID09IGVzc2Vu dGlhbHMuZmNfeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiB3LT5jdXJzb3IueSA9PSByb3ctPnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgJiYgdy0+Y3Vyc29yLmhwb3MgPT0gZ2x5cGggLSByb3ctPmdseXBo c1tURVhUX0FSRUFdCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICYmIHctPmN1cnNvci52cG9zID09IHZwb3MpOworICAgICAgICAgICAgICAgICAgICBpbnQg aHBvcyA9IGdseXBoIC0gcm93LT5nbHlwaHNbVEVYVF9BUkVBXTsKKyAgICAgICAgICAgICAgICAg ICAgc3RydWN0IG1jX1JHQiBsc2xfZmc7CisgICAgICAgICAgICAgICAgICAgIG1jX2NvbG9yX3Bp Y2tlciAodywgZ2x5cGgsIGVzc2VudGlhbHMsICZsc2xfZmcsIC0xLCBNQ19CQVIsCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93X3Bvc2l0aW9uLCBGSUxMX0NPTFVNTik7 CisgICAgICAgICAgICAgICAgICAgIGlmIChocG9zID49IGhwb3Nfc3RhcnQKKyAgICAgICAgICAg ICAgICAgICAgICAgICYmIGhwb3MgPCBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGgKKyAgICAgICAg ICAgICAgICAgICAgICAgIC8vICYmIHJlbGF0aXZlX3ggKyBnbHlwaC0+cGl4ZWxfd2lkdGggPD0g dGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAmJiByZWxhdGl2ZV94IDwg dGV4dF9hcmVhX3dpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoKGhlYWRlcl9saW5l X2Zvcm1hdCA+IDAgJiYgdnBvcyA+IDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwg aGVhZGVyX2xpbmVfZm9ybWF0ID09IDApCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAoKGds eXBoICE9IGdseXBoX2VuZCAtIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZXNz ZW50aWFscy5mY194ID49IHJlbGF0aXZlX3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JiYgZXNzZW50aWFscy5mY194IDwgcmVsYXRpdmVfeCArIGdseXBoLT5waXhlbF93aWR0aCkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAoZ2x5cGggPT0gZ2x5cGhfZW5kIC0gMQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBlc3NlbnRpYWxzLmZjX3ggPj0gcmVsYXRp dmVfeCkpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiByb3ctPnkgPD0gd2luZG93X3RleHRf Ym90dG9tX3kgKHcpCisgICAgICAgICAgICAgICAgICAgICAgICAmJiAhcmVhbF9mYWtlX2N1cnNv cl9wKQorICAgICAgICAgICAgICAgICAgICAgIG1jX2VuZ2luZSAodywgbWF0cml4LCByb3csIGds eXBoLCBhcmVhLCByZWxhdGl2ZV94LCB4X2xpbWl0LAorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgcm93LT55LCBocG9zLCB2cG9zLCBNQ19CQVIsIDEsIGN1cnNvcl9tYXRyaXgsCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24s IGxzbF9mZywgRklMTF9DT0xVTU4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBk cmF3X3AsIGZyb21fd2hlcmUsIEZDX0NBQ0hFKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAg ICAgICAgICAgICBpZiAoIU5JTFAgKEJWQVIgKGIsIGNyb3NzaGFpcnMpKQorICAgICAgICAgICAg ICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfaG9yaXpvbnRhbF9ydWxlcikpCisgICAgICAg ICAgICAgICAgICAgICYmIChlc3NlbnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAg ICAgICB8fCAoIWVzc2VudGlhbHMuYWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAmJiAhTklMUCAoQlZBUiAoYiwgY2hfaW5hY3RpdmVfd2luZG93cykpKSkKKyAgICAgICAgICAg ICAgICAgICAgJiYgdnBvcyA9PSB3LT5jdXJzb3IudnBvcykKKyAgICAgICAgICAgICAgICAgIHsK KyAgICAgICAgICAgICAgICAgICAgaW50IHhfbGltaXQgPSB0ZXh0X2FyZWFfd2lkdGg7CisgICAg ICAgICAgICAgICAgICAgIGludCBocG9zID0gZ2x5cGggLSByb3ctPmdseXBoc1tURVhUX0FSRUFd OworICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWNfUkdCIGxzbF9mZzsKKyAgICAgICAgICAg ICAgICAgICAgbWNfY29sb3JfcGlja2VyICh3LCBnbHlwaCwgZXNzZW50aWFscywgJmxzbF9mZywg LTEsIE1DX0hCQVIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93X3Bv c2l0aW9uLCBIT1JJWk9OVEFMX1JVTEVSKTsKKyAgICAgICAgICAgICAgICAgICAgLyogUHJlc2Vy dmUgc3VwcG9ydCBmb3IgZGVmYXVsdCBiZWhhdmlvciBzdWNoIHRoYXQgYSB1c2VyIG1heQorICAg ICAgICAgICAgICAgICAgICBzcGVjaWZ5IHRoZSBoZWlnaHQgb2YgYW4gTUNfSEJBUiwgd2hpY2gg YmVnaW5zIGl0cyBqb3VybmV5CisgICAgICAgICAgICAgICAgICAgIGFzIHRoZSBgY3Vyc29yX3dp ZHRoJy4gIGBtY19nZXRfY3Vyc29yX2dlb21ldHJ5JyByZWFkanVzdHMuICovCisgICAgICAgICAg ICAgICAgICAgIGlmIChocG9zID49IGhwb3Nfc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgICAg ICYmIGhwb3MgPCBocG9zX3N0YXJ0ICsgaHBvc19sZW5ndGgpCisgICAgICAgICAgICAgICAgICAg ICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIGFyZWEsIHJlbGF0aXZlX3gsIHhf bGltaXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb3ctPnksIGhwb3MsIHZw b3MsIE1DX0hCQVIsIDEsIGN1cnNvcl9tYXRyaXgsCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBlc3NlbnRpYWxzLCByb3dfcG9zaXRpb24sIGxzbF9mZywgSE9SSVpPTlRBTF9SVUxF UiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdfcCwgZnJvbV93aGVyZSwg Q0hfQ0FDSEUpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICghTklM UCAoQlZBUiAoYiwgY3Jvc3NoYWlycykpCisgICAgICAgICAgICAgICAgICAgICYmICFOSUxQIChC VkFSIChiLCBjaF92ZXJ0aWNhbF9ydWxlcikpCisgICAgICAgICAgICAgICAgICAgICYmIChlc3Nl bnRpYWxzLmFjdGl2ZV9wCisgICAgICAgICAgICAgICAgICAgICAgICB8fCAoIWVzc2VudGlhbHMu YWN0aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoYiwg Y2hfaW5hY3RpdmVfd2luZG93cykpKSkKKyAgICAgICAgICAgICAgICAgICAgJiYgIWZpbGxfY29s dW1uX3RydW1wc19wKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBj dXJzb3JfdHlwZSA9IChnbHlwaC0+dHlwZSA9PSBJTUFHRV9HTFlQSCkKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA/IE1DX0hPTExPV19CT1gKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICA6IE1DX0JBUjsKKyAgICAgICAgICAgICAgICAgICAgaW50IHhfbGltaXQg PSB0ZXh0X2FyZWFfd2lkdGg7CisgICAgICAgICAgICAgICAgICAgIGJvb2wgcmVhbF9mYWtlX2N1 cnNvcl9wID0gKHctPmN1cnNvci55ID09IHJvdy0+eQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IudnBvcyA9PSB2cG9zKTsKKyAgICAg ICAgICAgICAgICAgICAgaW50IGhwb3MgPSBnbHlwaCAtIHJvdy0+Z2x5cGhzW1RFWFRfQVJFQV07 CisgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2ZnOworICAgICAgICAgICAg ICAgICAgICBtY19jb2xvcl9waWNrZXIgKHcsIGdseXBoLCBlc3NlbnRpYWxzLCAmbHNsX2ZnLCAt MSwgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm93 X3Bvc2l0aW9uLCBWRVJUSUNBTF9SVUxFUik7CisgICAgICAgICAgICAgICAgICAgIGlmIChocG9z ID49IGhwb3Nfc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIGhwb3MgPCBocG9zX3N0 YXJ0ICsgaHBvc19sZW5ndGgKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICgoaGVhZGVyX2xp bmVfZm9ybWF0ID4gMCAmJiB2cG9zID4gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8 fCBoZWFkZXJfbGluZV9mb3JtYXQgPT0gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICgo Z2x5cGggIT0gZ2x5cGhfZW5kIC0gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3 LT5jdXJzb3IueCA+PSByZWxhdGl2ZV94CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IHctPmN1cnNvci54IDwgcmVsYXRpdmVfeCArIGdseXBoLT5waXhlbF93aWR0aCkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICB8fCAoZ2x5cGggPT0gZ2x5cGhfZW5kIC0gMQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmJiB3LT5jdXJzb3IueCA+PSByZWxhdGl2ZV94KSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICYmIHJvdy0+eSA8PSB3aW5kb3dfdGV4dF9ib3R0b21feSAo dykKKyAgICAgICAgICAgICAgICAgICAgICAgICYmICFyZWFsX2Zha2VfY3Vyc29yX3ApCisgICAg ICAgICAgICAgICAgICAgICAgbWNfZW5naW5lICh3LCBtYXRyaXgsIHJvdywgZ2x5cGgsIGFyZWEs IHJlbGF0aXZlX3gsIHhfbGltaXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBy b3ctPnksIGhwb3MsIHZwb3MsIGN1cnNvcl90eXBlLCAxLCBjdXJzb3JfbWF0cml4LAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNzZW50aWFscywgcm93X3Bvc2l0aW9uLCBsc2xf ZmcsIFZFUlRJQ0FMX1JVTEVSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJh d19wLCBmcm9tX3doZXJlLCBDSF9DQUNIRSk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgICAgcmVsYXRpdmVfeCArPSBnbHlwaC0+cGl4ZWxfd2lkdGg7CisgICAgICAgICAgICAg IH0KKyAgICAgICAgICB9CisgICAgICB9CisgIC8vICBjbG9ja190IGNsb2NrX2VuZCA9IGNsb2Nr KCk7CisgIC8vICBkb3VibGUgY3B1X3RpbWVfdXNlZCA9ICgoZG91YmxlKSAoY2xvY2tfZW5k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aGVfcCAody0+bWNfbWF0cml4LCBj YWNoZV90eXBlLCB2bnRoLCBudGgpOworICAgICAgICAgICArK250aCkKKyAgICAgICAgeworICAg ICAgICAgIGludCB4ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1b bnRoXS54OworICAgICAgICAgIGludCBmeCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hl W2NhY2hlX3R5cGVdW250aF0uZng7CisgICAgICAgICAgaW50IHkgPSB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLnk7CisgICAgICAgICAgaW50IGZ5ID0gdy0+ bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5meTsKKyAgICAgICAg ICBpbnQgaHBvcyA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250 aF0uaHBvczsKKyAgICAgICAgICBpbnQgdnBvcyA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNh Y2hlW2NhY2hlX3R5cGVdW250aF0udnBvczsKKyAgICAgICAgICBpbnQgd2QgPSB3LT5tY19tYXRy aXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLndkOworICAgICAgICAgIGludCBo ID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5oOworICAg ICAgICAgIGVudW0gbWNfY3Vyc29yX3R5cGUgY3Vyc29yX3R5cGUgPSB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmN1cnNvcl90eXBlOworICAgICAgICAgIGlu dCBjdXJzb3Jfd2lkdGggPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLmN1cnNvcl93aWR0aDsKKyAgICAg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Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFibGVkX3A7CisgICAgICAgICAg aWYgKHZwb3MgPT0gdm50aAorICAgICAgICAgICAgICAmJiAoKGhwb3MgPj0gc3RhcnRfaHBvcwor ICAgICAgICAgICAgICAgICAgICYmIGhwb3MgPCBlbmRfaHBvcykKKyAgICAgICAgICAgICAgICAg IC8qIEEgZmxvYXRpbmcgY3Vyc29yIGJleW9uZCB0aGUgZW5kIG9mIHRoZSBnbHlwaCByb3cuICov CisgICAgICAgICAgICAgICAgICB8fCAoaHBvcyArIDEgPT0gc3RhcnRfaHBvcworICAgICAgICAg ICAgICAgICAgICAgICYmIGhwb3MgKyAxID09IGVuZF9ocG9zKSkKKyAgICAgICAgICAgICAgJiYg ZW5hYmxlZF9wKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBib29sIHJlbW92ZV9wID0g ZmFsc2U7CisgICAgICAgICAgICAgIG1jX2RyYXdfZXJhc2VfaHlicmlkICh3LCBtYXRyaXgsIHJv dywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3ZCwgaCwKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCBjdXJzb3Jfd2lkdGgsIGxzbF9mZywgYWN0aXZl X3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaF9mbGF2b3IsIHJl bW92ZV9wKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgcmV0dXJuIHRydWU7 CisgIC8vICBjbG9ja19lbmQgPSBjbG9jaygpOworICAvLyAgZG91YmxlIHRpbWVfY3Vyc29ycyA9 ICgoZG91YmxlKSAoY2xvY2tfZW5kIC0gY2xvY2tfc3RhcnQpKSAvIENMT0NLU19QRVJfU0VDOwor ICAvLyAgZnByaW50ZiAoc3RkZXJyLCAibWNfcmVkcmF3X3JvdyAoJWQpOiAgaHBvcyAoJWQvJWQp IHwgZ2x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AgICAgICAgICAgLmdyZWVuID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVb Y2FjaGVfdHlwZV1bbnRoXS5mZy5ncmVlbiwKKyAgICAgICAgICAvLyAgICAgICAgICAgICAgICAg ICAgICAgICAgLmJsdWUgPSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBl XVtudGhdLmZnLmJsdWV9OworICAgICAgICAgIHN0cnVjdCBtY19SR0IgbHNsX2JnID0gey5yZWQg PSB3LT5tY19tYXRyaXgudnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLnJlZCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ3JlZW4gPSB3LT5tY19tYXRyaXgu dnBvc1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmJnLmdyZWVuLAorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC5ibHVlID0gdy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2Fj aGVbY2FjaGVfdHlwZV1bbnRoXS5iZy5ibHVlfTsKKyAgICAgICAgICBib29sIGFjdGl2ZV9wID0g dy0+bWNfbWF0cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5hY3RpdmVfcDsK KyAgICAgICAgICBlbnVtIG1jX2ZsYXZvciBnbHlwaF9mbGF2b3IgPSB3LT5tY19tYXRyaXgudnBv c1t2bnRoXS5jYWNoZVtjYWNoZV90eXBlXVtudGhdLmdseXBoX2ZsYXZvcjsKKyAgICAgICAgICBi b29sIGVuYWJsZWRfcCA9IHctPm1jX21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVd W250aF0uZW5hYmxlZF9wOworICAgICAgICAgIC8qIGBtYXRyaXhfcm93JyBpbiBgZGlzcG5ldy5j YCBjb250YWlucyB0aGUgZm9sbG93aW5nIHRlc3RzLAorICAgICAgICAgIGVhc3NlcnQgKG1hdHJp eCAmJiBtYXRyaXgtPnJvd3MpOworICAgICAgICAgIGVhc3NlcnQgKHJvdyA+PSAwICYmIHJvdyA8 IG1hdHJpeC0+bnJvd3MpOyAqLworICAgICAgICAgIGJvb2wgYmFyZl9jcmFzaF9vbmUgPSAobWF0 cml4ICYmIG1hdHJpeC0+cm93cykgPyBmYWxzZSA6IHRydWU7CisgICAgICAgICAgaWYgKGJhcmZf Y3Jhc2hfb25lKQorICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgYm9vbCBiYXJmX2Ny YXNoX3R3byA9ICh2cG9zID49IDAgJiYgdnBvcyA8IG1hdHJpeC0+bnJvd3MpID8gZmFsc2UgOiB0 cnVlOworICAgICAgICAgIGlmIChiYXJmX2NyYXNoX3R3bykKKyAgICAgICAgICAgIGNvbnRpbnVl OworICAgICAgICAgIGlmICh2cG9zID09IHZudGgKKyAgICAgICAgICAgICAgJiYgZ2x5cGhfZmxh dm9yID09IE1DX0dMWVBICisgICAgICAgICAgICAgICYmIGVuYWJsZWRfcCkKKyAgICAgICAgICAg IHsKKyAgICAgICAgICAgICAgbWNfZXJhc2VfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgdy0+bWNf bWF0cml4LCB4LCB5LCBocG9zLCB2cG9zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkKTsKKyAgICAgICAgICAgICAgdy0+bWNfbWF0 cml4LnZwb3Nbdm50aF0uY2FjaGVbY2FjaGVfdHlwZV1bbnRoXS5lbmFibGVkX3AgPSBmYWxzZTsK KyAgICAgICAgICAgICAgLS13LT5tY19tYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5cGVdOwor ICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAodnBvcyA9PSB2bnRoCisgICAgICAg ICAgICAgICAgICAgICAmJiBlbmFibGVkX3ApCisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAg ICAgICBib29sIHJlbW92ZV9wID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICBtY19kcmF3X2VyYXNl X2h5YnJpZCAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgs CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl90eXBlLCBjdXJz b3Jfd2lkdGgsIGxzbF9iZywgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGdseXBoX2ZsYXZvciwgcmVtb3ZlX3ApOworICAgICAgICAgICAgICAgIHctPm1j X21hdHJpeC52cG9zW3ZudGhdLmNhY2hlW2NhY2hlX3R5cGVdW250aF0uZW5hYmxlZF9wID0gZmFs c2U7CisgICAgICAgICAgICAgICAgLS13LT5tY19tYXRyaXguY3Vyc29yc191c2VkW2NhY2hlX3R5 cGVdOworICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIHctPm1jX21hdHJpeC52cG9z W3ZudGhdLmNhY2hlX3VzZWRbY2FjaGVfdHlwZV0gPSAwOworICAgIH0KK30KKworLyogRXJhc2Ug ZmFrZSBjdXJzb3JzIGZyb20gKG1pbiwgcnVuLmN1cnJlbnRfeSwgcnVuLmRlc2lyZWRfeSkgdG8g ZW5kIG9mIHdpbmRvdy4KKyAgVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX0RPV046 CisgICAgcnVuLmhlaWdodCA9IGl0Lmxhc3RfdmlzaWJsZV95IC0gcnVuLmRlc2lyZWRfeQorICAg IFtlbWFjcyAtcTogIEhvbGQgdXAtYXJyb3cga2V5IHRyaWdnZXJpbmcgYXV0by1yZWNlbnRlciBh dCBzY3JvbGwtbWFyZ2luLl0KKyAgVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX1VQ OgorICAgIHJ1bi5oZWlnaHQgPSBpdC5sYXN0X3Zpc2libGVfeSAtIHJ1bi5jdXJyZW50X3k7Cisg ICAgW2VtYWNzIC1xOiAgSG9sZCB1cC1hcnJvdyBrZXkgdHJpZ2dlcmluZyBhdXRvLXJlY2VudGVy IGF0IHNjcm9sbC1tYXJnaW4uXQorICBUUllfV0lORE9XX0lEOgorICAgIHJ1bi5oZWlnaHQgPSBp dC5sYXN0X3Zpc2libGVfeSAtIG1heCAocnVuLmN1cnJlbnRfeSwgcnVuLmRlc2lyZWRfeSkKKyAg ICBbQWRkIG9yIHJlbW92ZSBsaW5lcyBmcm9tIHRoZSBidWZmZXI7IGUuZy4sIFJFVCBvciBERUwu XQorICArLS0tLS0tLS0tLS0tLSsgPD0gaXQuY3VycmVudF95ID09IDAKKyAgfCAgICAgICAgICAg ICB8CisgIHwgICAgICAgICAgICAgfCA8PSBydW4uZGVzaXJlZF95ID09IDI3MCBbdXAgKOKGkSld ID09IHJ1bi5jdXJyZW50X3kgPCBydW4uZGVzaXJlZF95CisgIHwgICAgICAgICAgICAgfCAgICBy dW4uaGVpZ2h0ID0gaXQubGFzdF92aXNpYmxlX3kgLSBydW4uY3VycmVudF95OworICB8ICAgICAg ICAgICAgIHwgICAgcnVuLmhlaWdodCA9PSAxMDgwIC0gNTQwID09IDU0MAorICB8ICAgICAgICAg ICAgIHwgICAgW1RoZSBlbnRpcmUgYm90dG9tIHJlY3RhbmdsZSBnZXRzIGNvcGllZCB0byB1cHBl ciBydW4uZGVzaXJlZF95Ll0KKyAgfCAgICAgICAgICAgICB8CisgICstLS0tLS0tLS0tLS0tKyA8 PSBydW4uY3VycmVudF95ID09IDU0MAorICB8ICAgICAgICAgICAgIHwKKyAgfCAgICAgICAgICAg ICB8IDw9IHJ1bi5kZXNpcmVkX3kgPT0gODEwIFtkb3duICjihpMpXSA9PSBydW4uY3VycmVudF95 ID4gcnVuLmRlc2lyZWRfeQorICB8ICAgICAgICAgICAgIHwgICAgcnVuLmhlaWdodCA9IGl0Lmxh c3RfdmlzaWJsZV95IC0gcnVuLmRlc2lyZWRfeQorICB8ICAgICAgICAgICAgIHwgICAgcnVuLmhl aWdodCA9PSAxMDgwIC0gODEwID09IDI3MAorICB8ICAgICAgICAgICAgIHwgICAgW1RvcCBwYXJ0 IG9mIHRoZSBsb3dlciByZWN0YW5nbGUgZ2V0cyBjb3BpZWQgdG8gbG93ZXIgcnVuLmRlc2lyZWRf eS5dCisgIHwgICAgICAgICAgICAgfAorICArLS0tLS0tLS0tLS0tLSsgPD0gaXQubGFzdF92aXNp YmxlX3kgPT0gMTA4MCAqLwordm9pZAorbWNfcHJlX3Njcm9sbF9jbGVhbiAoc3RydWN0IHdpbmRv dyAqdywgc3RydWN0IHJ1biBydW4sIGludCBzdGFydF92cG9zLAorICAgICAgICAgICAgICAgICAg ICAgaW50IG5yb3dzX3Njcm9sbGVkLCBlbnVtIG1jX3ByZV9zY3JvbGxfY2xlYW5fdHlwZSBmcm9t X3doZXJlKQoreworICBpZiAoTUlOSV9XSU5ET1dfUCAodykpCisgICAgcmV0dXJuOworICBib29s IGdvX29uZV9wID0gKHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbTUNfQ0FDSEVdID4gMAorICAg ICAgICAgICAgICAgICAgIHx8IHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbQ0hfQ0FDSEVdID4g MAorICAgICAgICAgICAgICAgICAgIHx8IHctPm1jX21hdHJpeC5jdXJzb3JzX3VzZWRbRkNfQ0FD SEVdID4gMCk7CisgIGJvb2wgZ29fdHdvX3AgPSAoQlVGRkVSUCAody0+Y29udGVudHMpCisgICAg ICAgICAgICAgICAgICAgJiYgKCFOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNy b3NzaGFpcnMpKQorICAgICAgICAgICAgICAgICAgICAgICB8fCAhTklMUCAoQlZBUiAoWEJVRkZF UiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgfHwg IU5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpKSk7CisgIGlmICht Y19zdGRlcnJfcCkKKyAgICBmcHJpbnRmIChzdGRlcnIsICJtY19wcmVfc2Nyb2xsX2NsZWFuICgl cyk6XG5cCisgICVzIHwgZ29fb25lX3AgKCVzKSB8IGdvX3R3b19wICglcylcblwKKyAgc3RhcnRf dnBvcyAoJWQpIHwgbnJvd3Nfc2Nyb2xsZWQgKCVkKVxuXAorICAlczogIHJ1bi5jdXJyZW50L2Rl c2lyZWRfeSAoJWQvJWQpIHwgcnVuLmhlaWdodCAoJWQpXG4iLAorICAgIG1jX3dpbmRvdyAodyks IChmcm9tX3doZXJlID09IFRSWV9XSU5ET1dfUkVVU0lOR19DVVJSRU5UX01BVFJJWF9ET1dOKQor ICAgICAgICAgICAgICAgICAgICAgPyAiVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklY X0RPV04iCisgICAgICAgICAgICAgICAgICAgOiAoZnJvbV93aGVyZSA9PSBUUllfV0lORE9XX1JF VVNJTkdfQ1VSUkVOVF9NQVRSSVhfVVApCisgICAgICAgICAgICAgICAgICAgICA/ICJUUllfV0lO RE9XX1JFVVNJTkdfQ1VSUkVOVF9NQVRSSVhfVVAiCisgICAgICAgICAgICAgICAgICAgOiAoZnJv bV93aGVyZSA9PSBUUllfV0lORE9XX0lEKQorICAgICAgICAgICAgICAgICAgICAgPyAiVFJZX1dJ TkRPV19JRCIKKyAgICAgICAgICAgICAgICAgICA6ICJVTktOT1dOIiwKKyAgICBnb19vbmVfcCA/ ICJ5ZXMiIDogIm5vIiwgZ29fdHdvX3AgPyAieWVzIiA6ICJubyIsCisgICAgc3RhcnRfdnBvcywg bnJvd3Nfc2Nyb2xsZWQsCisgICAgcnVuLmN1cnJlbnRfeSA8IHJ1bi5kZXNpcmVkX3kgPyAi4oaT IiA6ICLihpEiLAorICAgIHJ1bi5jdXJyZW50X3ksIHJ1bi5kZXNpcmVkX3ksIHJ1bi5oZWlnaHQp OworICBpZiAoIWdvX29uZV9wICYmICFnb190d29fcCkKKyAgICByZXR1cm47CisgIGJvb2wgdXBk YXRpbmdfZnJhbWVfcCA9IGZhbHNlOworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZy YW1lKTsKKyAgaWYgKFhGUkFNRSAody0+ZnJhbWUpICE9IGYtPm1jX3VwZGF0aW5nX2ZyYW1lCisg ICAgICAmJiAoZ29fb25lX3AgfHwgZ29fdHdvX3ApKQorICAgIHsKKyAgICAgIHVwZGF0aW5nX2Zy YW1lX3AgPSB0cnVlOworICAgICAgdXBkYXRlX2JlZ2luIChmKTsKKyAgICB9CisgIGlmICh3LT5w aHlzX2N1cnNvcl9vbl9wCisgICAgICAmJiBnb190d29fcCkKKyAgICBlcmFzZV9waHlzX2N1cnNv ciAodyk7CisgIHN0cnVjdCBnbHlwaF9tYXRyaXggKm1hdHJpeCA9IHctPmN1cnJlbnRfbWF0cml4 OworICBmb3IgKGludCB2bnRoID0gc3RhcnRfdnBvczsKKyAgICAgICBtYXRyaXggIT0gTlVMTAor ICAgICAgICYmIHZudGggPCBtYXRyaXgtPm5yb3dzCisgICAgICAgJiYgTUFUUklYX1JPVyAobWF0 cml4LCB2bnRoKS0+ZW5hYmxlZF9wCisgICAgICAgJiYgZ29fb25lX3A7CisgICAgICAgKyt2bnRo KQorICAgIHsKKyAgICAgIHN0cnVjdCBnbHlwaF9yb3cgKnJvdyA9IE1BVFJJWF9ST1cgKG1hdHJp eCwgdm50aCk7CisgICAgICBtY19lcmFzZV9yb3cgKHcsIG1hdHJpeCwgcm93KTsKKyAgICB9Cisg IGlmICh1cGRhdGluZ19mcmFtZV9wKQorICAgIHVwZGF0ZV9lbmQgKGYpOworICAvLyBtY19yZXNl dF9jYWNoZSAodyk7Cit9CisKK0RFRlVOICgibWMtc3RkZXJyIiwgRm1jX3N0ZGVyciwgU21jX3N0 ZGVyciwgMCwgMSwgIlAiLAorICAgICAgIGRvYzogLyogVG9nZ2xlIHRyYWNpbmcgb2YgbXVsdGlw bGUgZmFrZSBjdXJzb3JzLgorV2l0aCBBUkcsIHR1cm4gdHJhY2luZyBvbiBpZiBhbmQgb25seSBp ZiBBUkcgaXMgcG9zaXRpdmUuICovKQorICAoTGlzcF9PYmplY3QgYXJnKQoreworICBpZiAoTklM UCAoYXJnKSkKKyAgICBtY19zdGRlcnJfcCA9ICFtY19zdGRlcnJfcDsKKyAgZWxzZQorICAgIHsK KyAgICAgIGFyZyA9IEZwcmVmaXhfbnVtZXJpY192YWx1ZSAoYXJnKTsKKyAgICAgIG1jX3N0ZGVy cl9wID0gWEZJWE5VTSAoYXJnKSA+IDA7CisgICAgfQorICByZXR1cm4gUW5pbDsKK30KKworLyog ZW5kIE1VTFRJUExFLUNVUlNPUlMgKi8KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAwK IC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKgogCQkgICAgICBXaW5kb3cgZGlzcGxheSBkaW1lbnNpb25zCkBAIC04 ODYwLDYgKzEzODQxLDI3IEBAIG1vdmVfaXRfaW5fZGlzcGxheV9saW5lX3RvIChzdHJ1Y3QgaXQg Kml0LAogICAgICAgIHx8IChpdC0+bWV0aG9kID09IEdFVF9GUk9NX0RJU1BMQVlfVkVDVE9SCQlc CiAJICAgJiYgaXQtPmRwdmVjICsgaXQtPmN1cnJlbnQuZHB2ZWNfaW5kZXggKyAxID49IGl0LT5k cGVuZCkpKQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09S UyAqLworCisgIGJvb2wgbWNfbGluZV9udW1iZXJfcGVuZGluZyA9IGZhbHNlOworCisgIGlmIChp dC0+aHBvcyA9PSAwKQorICAgIHsKKyAgICAgIGlmICghKChvcCAmJiBNT1ZFX1RPX1gpICYmIHRv X3ggPT0gaXQtPmZpcnN0X3Zpc2libGVfeCkKKyAgICAgICAgICAmJiAhc2hvdWxkX3Byb2R1Y2Vf bGluZV9udW1iZXIgKGl0KSkKKyAgICAgICAgeworICAgICAgICAgIGlmIChpdC0+Y3VycmVudF94 ID09IGl0LT5maXJzdF92aXNpYmxlX3gpCisgICAgICAgICAgICBtY19saW5lX251bWJlciAoaXQp OworICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICBtY19saW5lX251bWJlcl9wZW5kaW5n ID0gdHJ1ZTsKKyAgICAgICAgfQorICAgIH0KKworLyogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisK KwogICBpZiAoaXQtPmhwb3MgPT0gMCkKICAgICB7CiAgICAgICAvKiBJZiBsaW5lIG51bWJlcnMg YXJlIGJlaW5nIGRpc3BsYXllZCwgcHJvZHVjZSBhIGxpbmUgbnVtYmVyLgpAQCAtOTI1MSw2ICsx NDI1MywyMiBAQCBtb3ZlX2l0X2luX2Rpc3BsYXlfbGluZV90byAoc3RydWN0IGl0ICppdCwKIAkJ ICAgIH0KIAkJfQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VS U09SUyAqLworCisgICAgICAgIGlmIChuZXdfeCA+IGl0LT5maXJzdF92aXNpYmxlX3gpCisgICAg ICAgICAgeworICAgICAgICAgICAgaWYgKG1jX2xpbmVfbnVtYmVyX3BlbmRpbmcpCisgICAgICAg ICAgICAgIHsKKyAgICAgICAgICAgICAgICBtY19saW5lX251bWJlcl9wZW5kaW5nID0gZmFsc2U7 CisgICAgICAgICAgICAgICAgbWNfbGluZV9udW1iZXIgKGl0KTsKKyAgICAgICAgICAgICAgfQor ICAgICAgICAgIH0KKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgICAgIGlmIChu ZXdfeCA+IGl0LT5maXJzdF92aXNpYmxlX3gpCiAJCXsKIAkJICAvKiBJZiB3ZSBoYXZlIHJlYWNo ZWQgdGhlIHZpc2libGUgcG9ydGlvbiBvZiB0aGUKQEAgLTE0Mzk3LDkgKzE5NDE1LDIyIEBAIHJl ZGlzcGxheV9pbnRlcm5hbCAodm9pZCkKIAkgICAgICAqdy0+ZGVzaXJlZF9tYXRyaXgtPm1ldGhv ZCA9IDA7CiAJICAgICAgZGVidWdfbWV0aG9kX2FkZCAodywgIm9wdGltaXphdGlvbiAxIik7CiAj ZW5kaWYKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMg Ki8KKwogI2lmZGVmIEhBVkVfV0lORE9XX1NZU1RFTQorICBpZiAoQlVGRkVSUCAody0+Y29udGVu dHMpCisgICAgICAmJiAhTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hh aXJzKSkpCisgICAgbWNfdXBkYXRlX3dpbmRvd19mcmluZ2VzICh3LCBmYWxzZSk7CisgICAgZWxz ZQogCSAgICAgIHVwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywgZmFsc2UpOwogI2VuZGlmCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgICAgICBnb3RvIHVwZGF0ZTsKIAkgICAgfQog CSAgZWxzZQpAQCAtMTc3OTIsMTAgKzIyODIzLDIyIEBAIHJlZGlzcGxheV93aW5kb3cgKExpc3Bf T2JqZWN0IHdpbmRvdywgYm9vbCBqdXN0X3RoaXNfb25lX3ApCiAgICAgfQogCiAjaWZkZWYgSEFW RV9XSU5ET1dfU1lTVEVNCisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBM RS1DVVJTT1JTICovCisKKyAgYm9vbCBrZWVwX2N1cnJlbnRfcCA9IChqdXN0X3RoaXNfb25lX3AK KyAgICAgICAgICAgICAgICAgICAgICAgICB8fCAoIXVzZWRfY3VycmVudF9tYXRyaXhfcCAmJiAh b3ZlcmxheV9hcnJvd19zZWVuKQorICAgICAgICAgICAgICAgICAgICAgICAgIHx8IHctPnBzZXVk b193aW5kb3dfcCk7CisKKyAgYm9vbCBmcmluZ2VzX3VwZGF0ZWRfcCA9IChCVUZGRVJQICh3LT5j b250ZW50cykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhTklMUCAoQlZBUiAoWEJV RkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICA/IG1jX3VwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywga2VlcF9jdXJyZW50X3ApCisgICAg ICAgICAgICAgICAgICAgICAgICAgICA6IHVwZGF0ZV93aW5kb3dfZnJpbmdlcyAodywga2VlcF9j dXJyZW50X3ApOworCiAgIGlmIChGUkFNRV9XSU5ET1dfUCAoZikKLSAgICAgICYmIHVwZGF0ZV93 aW5kb3dfZnJpbmdlcyAodywgKGp1c3RfdGhpc19vbmVfcAotCQkJCSAgICB8fCAoIXVzZWRfY3Vy cmVudF9tYXRyaXhfcCAmJiAhb3ZlcmxheV9hcnJvd19zZWVuKQotCQkJCSAgICB8fCB3LT5wc2V1 ZG9fd2luZG93X3ApKSkKKyAgICAgICYmIGZyaW5nZXNfdXBkYXRlZF9wKQogICAgIHsKICAgICAg IHVwZGF0ZV9iZWdpbiAoZik7CiAgICAgICBibG9ja19pbnB1dCAoKTsKQEAgLTE3ODEwLDYgKzIy ODUzLDkgQEAgcmVkaXNwbGF5X3dpbmRvdyAoTGlzcF9PYmplY3Qgd2luZG93LCBib29sIGp1c3Rf dGhpc19vbmVfcCkKICAgICAgIHVwZGF0ZV9lbmQgKGYpOwogICAgIH0KIAorLyogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqICovCisKKwogICBpZiAoV0lORE9XX0JPVFRPTV9ESVZJREVSX1dJRFRIICh3KSkK ICAgICBndWlfZHJhd19ib3R0b21fZGl2aWRlciAodyk7CiAjZW5kaWYgLyogSEFWRV9XSU5ET1df U1lTVEVNICovCkBAIC0xODEyNSw2ICsyMzE3MSwxNiBAQCB0cnlfd2luZG93X3JldXNpbmdfY3Vy cmVudF9tYXRyaXggKHN0cnVjdCB3aW5kb3cgKncpCiAJICAgICAgdXBkYXRlX2JlZ2luIChmKTsK IAkgICAgICBndWlfdXBkYXRlX3dpbmRvd19iZWdpbiAodyk7CiAJICAgICAgRlJBTUVfUklGIChm KS0+Y2xlYXJfd2luZG93X21vdXNlX2ZhY2UgKHcpOworCisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgbWNfcHJlX3Njcm9sbF9jbGVhbiAo dywgcnVuLCBzdGFydF92cG9zLCBucm93c19zY3JvbGxlZCwgVFJZX1dJTkRPV19SRVVTSU5HX0NV UlJFTlRfTUFUUklYX0RPV04pOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAJICAg ICAgRlJBTUVfUklGIChmKS0+c2Nyb2xsX3J1bl9ob29rICh3LCAmcnVuKTsKIAkgICAgICBndWlf dXBkYXRlX3dpbmRvd19lbmQgKHcsIGZhbHNlLCBmYWxzZSk7CiAJICAgICAgdXBkYXRlX2VuZCAo Zik7CkBAIC0xODI5MSw2ICsyMzM0NywxNiBAQCB0cnlfd2luZG93X3JldXNpbmdfY3VycmVudF9t YXRyaXggKHN0cnVjdCB3aW5kb3cgKncpCiAJICB1cGRhdGVfYmVnaW4gKGYpOwogCSAgZ3VpX3Vw ZGF0ZV93aW5kb3dfYmVnaW4gKHcpOwogCSAgRlJBTUVfUklGIChmKS0+Y2xlYXJfd2luZG93X21v dXNlX2ZhY2UgKHcpOworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUt Q1VSU09SUyAqLworCisgICAgbWNfcHJlX3Njcm9sbF9jbGVhbiAodywgcnVuLCBzdGFydF92cG9z LCBucm93c19zY3JvbGxlZCwgVFJZX1dJTkRPV19SRVVTSU5HX0NVUlJFTlRfTUFUUklYX1VQKTsK KworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgRlJBTUVfUklGIChmKS0+c2Nyb2xs X3J1bl9ob29rICh3LCAmcnVuKTsKIAkgIGd1aV91cGRhdGVfd2luZG93X2VuZCAodywgZmFsc2Us IGZhbHNlKTsKIAkgIHVwZGF0ZV9lbmQgKGYpOwpAQCAtMTkyNDUsNiArMjQzMTEsMTYgQEAgdHJ5 X3dpbmRvd19pZCAoc3RydWN0IHdpbmRvdyAqdykKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0K IAkgIGd1aV91cGRhdGVfd2luZG93X2JlZ2luICh3KTsKIAkgIEZSQU1FX1JJRiAoZiktPmNsZWFy X3dpbmRvd19tb3VzZV9mYWNlICh3KTsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8q IE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgIG1jX3ByZV9zY3JvbGxfY2xlYW4gKHcsIHJ1biwg Zmlyc3RfdW5jaGFuZ2VkX2F0X2VuZF92cG9zLCBkdnBvcywgVFJZX1dJTkRPV19JRCk7CisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgIEZSQU1FX1JJRiAoZiktPnNjcm9sbF9ydW5f aG9vayAodywgJnJ1bik7CiAJICBndWlfdXBkYXRlX3dpbmRvd19lbmQgKHcsIGZhbHNlLCBmYWxz ZSk7CiAjZW5kaWYKQEAgLTIxNTI4LDYgKzI2NjA0LDE3IEBAIG1heWJlX3Byb2R1Y2VfbGluZV9u dW1iZXIgKHN0cnVjdCBpdCAqaXQpCiAgICAgICBTRVRfVEVYVF9QT1MgKHRlbV9pdC5wb3NpdGlv biwgLTEsIC0xKTsKICAgICAgIFBST0RVQ0VfR0xZUEhTICgmdGVtX2l0KTsKIAorCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgLyogVGhp cyBwZXJtaXRzIHVzIHRvIGluc3BlY3QgdGhlIEhQT1Mgb2YgbGluZSBudW1iZXIgZ2x5cGhzIGFu ZCB0aGUgc3BhY2UKKyAgICAgIHBhZGRpbmcgYmVmb3JlL2FmdGVyIHRoZSBsaW5lIG51bWJlcnMu ICBXZSBzZXQgYGdseXBoLT5ocG9zYCBlbHNld2hlcmUuICovCisgICAgICB0ZW1faXQuaHBvcyAr PSAxOworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICAvKiBTdG9wIHByb2R1 Y2luZyBnbHlwaHMsIGFuZCByZWZyYWluIGZyb20gcHJvZHVjaW5nIHRoZSBsaW5lCiAJIG51bWJl ciwgaWYgd2UgZG9uJ3QgaGF2ZSBlbm91Z2ggc3BhY2Ugb24gdGhpcyBsaW5lLiAgKi8KICAgICAg IGlmICh0ZW1faXQuY3VycmVudF94ID49IHdpZHRoX2xpbWl0KQpAQCAtMjE1MzksNiArMjY2MjYs MzQgQEAgbWF5YmVfcHJvZHVjZV9saW5lX251bWJlciAoc3RydWN0IGl0ICppdCkKIAl9CiAgICAg fQogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLwor CisgIHN0cnVjdCB0ZXh0X3BvcyB3c3RhcnQ7CisgIFNFVF9URVhUX1BPU19GUk9NX01BUktFUiAo d3N0YXJ0LCBpdC0+dy0+c3RhcnQpOworICBpZiAoaXQtPmFyZWEgPT0gVEVYVF9BUkVBCisgICAg ICAmJiBJVF9DSEFSUE9TICgqaXQpID09IHdzdGFydC5jaGFycG9zKQorICAgIHsKKyAgICAgIHN0 cnVjdCBidWZmZXIgKmIgPSBYQlVGRkVSIChpdC0+dy0+Y29udGVudHMpOworICAgICAgc3RydWN0 IGJ1ZmZlciAqb2xkX2J1ZmZlciA9IE5VTEw7CisgICAgICAvKiBOZWVkZWQgc28gdGhhdCBidWZm ZXItbG9jYWwgdmFsdWVzIGNhbiBiZSBkZXRlcm1pbmVkOyBlLmcuLCB3aGVuCisgICAgICBzd2l0 Y2hpbmcgdG8gdGhlIG1pbmlidWZmZXIuICovCisgICAgICBpZiAoYiAhPSBjdXJyZW50X2J1ZmZl cikKKyAgICAgICAgeworICAgICAgICAgIG9sZF9idWZmZXIgPSBjdXJyZW50X2J1ZmZlcjsKKyAg ICAgICAgICBzZXRfYnVmZmVyX2ludGVybmFsIChiKTsKKyAgICAgICAgfQorICAgICAgaXQtPnct Pm1jLmxudW1fcGl4ZWxfd2lkdGggPSAoIU5JTFAgKFZkaXNwbGF5X2xpbmVfbnVtYmVycykpCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gdGVtX2l0LmN1cnJlbnRfeAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IDA7CisgICAgICBpZiAob2xkX2J1ZmZl cikKKyAgICAgICAgc2V0X2J1ZmZlcl9pbnRlcm5hbCAob2xkX2J1ZmZlcik7CisgICAgfQorCisv KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIC8qIFJlY29yZCB0aGUgd2lkdGggaW4gcGl4 ZWxzIHdlIG5lZWQgZm9yIHRoZSBsaW5lIG51bWJlciBkaXNwbGF5LiAgKi8KICAgaXQtPmxudW1f cGl4ZWxfd2lkdGggPSB0ZW1faXQuY3VycmVudF94OwogICAvKiBDb3B5IHRoZSBwcm9kdWNlZCBn bHlwaHMgaW50byBJVCdzIGdseXBoX3Jvdy4gICovCkBAIC0yMTcyOSw2ICsyNjg0NCwxNSBAQCBk aXNwbGF5X2xpbmUgKHN0cnVjdCBpdCAqaXQsIGludCBjdXJzb3JfdnBvcykKIAogICBib29sIGxp bmVfbnVtYmVyX25lZWRlZCA9IHNob3VsZF9wcm9kdWNlX2xpbmVfbnVtYmVyIChpdCk7CiAKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyAgYm9v bCBtY19saW5lX251bWJlcl9uZWVkZWQgPSAhc2hvdWxkX3Byb2R1Y2VfbGluZV9udW1iZXIgKGl0 KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAvKiBNb3ZlIG92ZXIgZGlzcGxh eSBlbGVtZW50cyB0aGF0IGFyZSBub3QgdmlzaWJsZSBiZWNhdXNlIHdlIGFyZQogICAgICBoc2Ny b2xsZWQuICBUaGlzIG1heSBzdG9wIGF0IGFuIHgtcG9zaXRpb24gPCBmaXJzdF92aXNpYmxlX3gK ICAgICAgaWYgdGhlIGZpcnN0IGdseXBoIGlzIHBhcnRpYWxseSB2aXNpYmxlIG9yIGlmIHdlIGhp dCBhIGxpbmUgZW5kLiAgKi8KQEAgLTIxNzY5LDEyICsyNjg5MywzMyBAQCBkaXNwbGF5X2xpbmUg KHN0cnVjdCBpdCAqaXQsIGludCBjdXJzb3JfdnBvcykKICAgICAgIG1pbl9wb3MgPSBDSEFSUE9T ICh0aGlzX2xpbmVfbWluX3Bvcyk7CiAgICAgICBtaW5fYnBvcyA9IEJZVEVQT1MgKHRoaXNfbGlu ZV9taW5fcG9zKTsKIAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNV UlNPUlMgKi8KKworICAgICAgaWYgKG1jX2xpbmVfbnVtYmVyX25lZWRlZCkKKyAgICAgICAgbWNf bGluZV9udW1iZXIgKGl0KTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAg LyogUHJvZHVjZSBsaW5lIG51bWJlciwgaWYgbmVlZGVkLiAgKi8KICAgICAgIGlmIChsaW5lX251 bWJlcl9uZWVkZWQpCiAJbWF5YmVfcHJvZHVjZV9saW5lX251bWJlciAoaXQpOwogICAgIH0KICAg ZWxzZSBpZiAoaXQtPmFyZWEgPT0gVEVYVF9BUkVBKQogICAgIHsKKworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMqLworCisgICAgICBpZiAobWNfbGluZV9u dW1iZXJfbmVlZGVkKQorICAgICAgICBtY19saW5lX251bWJlciAoaXQpOworCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKworCiAgICAgICAvKiBMaW5lIG51bWJlcnMgc2hvdWxkIHByZWNlZGUg dGhlIGxpbmUtcHJlZml4IG9yIHdyYXAtcHJlZml4LiAgKi8KICAgICAgIGlmIChsaW5lX251bWJl cl9uZWVkZWQpCiAJbWF5YmVfcHJvZHVjZV9saW5lX251bWJlciAoaXQpOwpAQCAtMjE5NDIsNiAr MjcwODcsMTcgQEAgZGlzcGxheV9saW5lIChzdHJ1Y3QgaXQgKml0LCBpbnQgY3Vyc29yX3Zwb3Mp CiAJICAgICBwcm9jZXNzIHRoZSBwcmVmaXggbm93LiAgKi8KIAkgIGlmIChpdC0+YXJlYSA9PSBU RVhUX0FSRUEgJiYgcGVuZGluZ19oYW5kbGVfbGluZV9wcmVmaXgpCiAJICAgIHsKKworCisvKiAq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgICBp ZiAobWNfbGluZV9udW1iZXJfbmVlZGVkKQorICAgICAgICAgIG1jX2xpbmVfbnVtYmVyIChpdCk7 CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgICAgICAvKiBMaW5lIG51bWJlcnMg c2hvdWxkIHByZWNlZGUgdGhlIGxpbmUtcHJlZml4IG9yIHdyYXAtcHJlZml4LiAgKi8KIAkgICAg ICBpZiAobGluZV9udW1iZXJfbmVlZGVkKQogCQltYXliZV9wcm9kdWNlX2xpbmVfbnVtYmVyIChp dCk7CkBAIC0yNzM2MCw2ICszMjUxNiwxOCBAQCBhcHBlbmRfZ2x5cGggKHN0cnVjdCBpdCAqaXQp CiAJICAgIGdbMV0gPSAqZzsKIAkgIGdseXBoID0gaXQtPmdseXBoX3Jvdy0+Z2x5cGhzW2FyZWFd OwogCX0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMg Ki8KKworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsKKyAgICAgIGdseXBoLT5ieXRlcG9z ID0gSVRfQllURVBPUyAoKml0KTsKKyAgICAgIGdseXBoLT5sbnVtID0gaXQtPmxudW07CisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIGdseXBoLT5jaGFycG9zID0gQ0hBUlBP UyAoaXQtPnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5vYmplY3QgPSBpdC0+b2JqZWN0OwogICAg ICAgaWYgKGl0LT5waXhlbF93aWR0aCA+IDApCkBAIC0yNzQ0Miw2ICszMjYxMCwxOCBAQCBhcHBl bmRfY29tcG9zaXRlX2dseXBoIChzdHJ1Y3QgaXQgKml0KQogCSAgICBnWzFdID0gKmc7CiAJICBn bHlwaCA9IGl0LT5nbHlwaF9yb3ctPmdseXBoc1tpdC0+YXJlYV07CiAJfQorCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+ aHBvcyA9IGl0LT5ocG9zOworICAgICAgZ2x5cGgtPmJ5dGVwb3MgPSBJVF9CWVRFUE9TICgqaXQp OworICAgICAgZ2x5cGgtPmxudW0gPSBpdC0+bG51bTsKKworLyogKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq ICovCisKKwogICAgICAgZ2x5cGgtPmNoYXJwb3MgPSBpdC0+Y21wX2l0LmNoYXJwb3M7CiAgICAg ICBnbHlwaC0+b2JqZWN0ID0gaXQtPm9iamVjdDsKICAgICAgIGVhc3NlcnQgKGl0LT5waXhlbF93 aWR0aCA8PSBTSFJUX01BWCk7CkBAIC0yNzY1MCw2ICszMjgzMCwxOCBAQCBwcm9kdWNlX2ltYWdl X2dseXBoIChzdHJ1Y3QgaXQgKml0KQogCX0KICAgICAgIGlmIChnbHlwaCA8IGl0LT5nbHlwaF9y b3ctPmdseXBoc1thcmVhICsgMV0pCiAJeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLwor LyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+aHBvcyA9IGl0LT5ocG9zOwor ICAgICAgZ2x5cGgtPmJ5dGVwb3MgPSBJVF9CWVRFUE9TICgqaXQpOworICAgICAgZ2x5cGgtPmxu dW0gPSBpdC0+bG51bTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogCSAgZ2x5cGgt PmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9zaXRpb24pOwogCSAgZ2x5cGgtPm9iamVjdCA9IGl0 LT5vYmplY3Q7CiAJICBnbHlwaC0+cGl4ZWxfd2lkdGggPSBjbGlwX3RvX2JvdW5kcyAoLTEsIGl0 LT5waXhlbF93aWR0aCwgU0hSVF9NQVgpOwpAQCAtMjc3NTMsNiArMzI5NDUsMTggQEAgcHJvZHVj ZV94d2lkZ2V0X2dseXBoIChzdHJ1Y3QgaXQgKml0KQogCX0KICAgICAgIGlmIChnbHlwaCA8IGl0 LT5nbHlwaF9yb3ctPmdseXBoc1thcmVhICsgMV0pCiAJeworCisKKy8qICoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBnbHlwaC0+aHBvcyA9IGl0 LT5ocG9zOworICAgICAgZ2x5cGgtPmJ5dGVwb3MgPSBJVF9CWVRFUE9TICgqaXQpOworICAgICAg Z2x5cGgtPmxudW0gPSBpdC0+bG51bTsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog CSAgZ2x5cGgtPmNoYXJwb3MgPSBDSEFSUE9TIChpdC0+cG9zaXRpb24pOwogCSAgZ2x5cGgtPm9i amVjdCA9IGl0LT5vYmplY3Q7CiAJICBnbHlwaC0+cGl4ZWxfd2lkdGggPSBjbGlwX3RvX2JvdW5k cyAoLTEsIGl0LT5waXhlbF93aWR0aCwgU0hSVF9NQVgpOwpAQCAtMjc4MzksNiArMzMwNDMsMTgg QEAgYXBwZW5kX3N0cmV0Y2hfZ2x5cGggKHN0cnVjdCBpdCAqaXQsIExpc3BfT2JqZWN0IG9iamVj dCwKIAkgICAgd2lkdGggLT0gaXQtPmZpcnN0X3Zpc2libGVfeCAtIGl0LT5jdXJyZW50X3g7CiAJ ICBlYXNzZXJ0ICh3aWR0aCA+IDApOwogCX0KKworCisvKiAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8K Ky8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKworICAgICAgZ2x5cGgtPmhwb3MgPSBpdC0+aHBvczsK KyAgICAgIGdseXBoLT5ieXRlcG9zID0gSVRfQllURVBPUyAoKml0KTsKKyAgICAgIGdseXBoLT5s bnVtID0gaXQtPmxudW07CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIGds eXBoLT5jaGFycG9zID0gQ0hBUlBPUyAoaXQtPnBvc2l0aW9uKTsKICAgICAgIGdseXBoLT5vYmpl Y3QgPSBvYmplY3Q7CiAgICAgICAvKiBGSVhNRTogSXQgd291bGQgYmUgYmV0dGVyIHRvIHVzZSBU WVBFX01BWCBoZXJlLCBidXQKQEAgLTI4MjkzLDYgKzMzNTA5LDE4IEBAIGFwcGVuZF9nbHlwaGxl c3NfZ2x5cGggKHN0cnVjdCBpdCAqaXQsIGludCBmYWNlX2lkLCBib29sIGZvcl9ub19mb250LCBp bnQgbGVuLAogCSAgICBnWzFdID0gKmc7CiAJICBnbHlwaCA9IGl0LT5nbHlwaF9yb3ctPmdseXBo c1thcmVhXTsKIAl9CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1D VVJTT1JTICovCisKKyAgICAgIGdseXBoLT5ocG9zID0gaXQtPmhwb3M7CisgICAgICBnbHlwaC0+ Ynl0ZXBvcyA9IElUX0JZVEVQT1MgKCppdCk7CisgICAgICBnbHlwaC0+bG51bSA9IGl0LT5sbnVt OworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgICAgICBnbHlwaC0+Y2hhcnBvcyA9 IENIQVJQT1MgKGl0LT5wb3NpdGlvbik7CiAgICAgICBnbHlwaC0+b2JqZWN0ID0gaXQtPm9iamVj dDsKICAgICAgIGVhc3NlcnQgKGl0LT5waXhlbF93aWR0aCA8PSBTSFJUX01BWCk7CkBAIC0yOTM0 MywxMCArMzQ1NzEsMjAgQEAgZ3VpX2luc2VydF9nbHlwaHMgKHN0cnVjdCB3aW5kb3cgKncsIHN0 cnVjdCBnbHlwaF9yb3cgKnVwZGF0ZWRfcm93LAogCiAgIC8qIFdyaXRlIHRoZSBnbHlwaHMuICAq LwogICBocG9zID0gc3RhcnQgLSByb3ctPmdseXBoc1t1cGRhdGVkX2FyZWFdOworCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGlmICghbWNf cmVkcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgsIHJvdywgdXBkYXRlZF9hcmVhLCB3LT5v dXRwdXRfY3Vyc29yLngsCisgICAgICAgICAgICAgICAgICAgICAgaHBvcywgaHBvcyArIGxlbiwg ZmFsc2UsIERSQVdfTk9STUFMX1RFWFQsIEdVSV9JTlNFUlRfR0xZUEhTKSkKICAgZHJhd19nbHlw aHMgKHcsIHctPm91dHB1dF9jdXJzb3IueCwgcm93LCB1cGRhdGVkX2FyZWEsCiAJICAgICAgIGhw b3MsIGhwb3MgKyBsZW4sCiAJICAgICAgIERSQVdfTk9STUFMX1RFWFQsIDApOwogCisvKiAqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiogKi8KKworCiAgIC8qIEFkdmFuY2UgdGhlIG91dHB1dCBjdXJzb3IuICAq LwogICB3LT5vdXRwdXRfY3Vyc29yLmhwb3MgKz0gbGVuOwogICB3LT5vdXRwdXRfY3Vyc29yLngg Kz0gc2hpZnRfYnlfd2lkdGg7CkBAIC0yOTc3Miw5ICszNTAxMCwxOSBAQCBndWlfZml4X292ZXJs YXBwaW5nX2FyZWEgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKIAkg IHdoaWxlIChpIDwgcm93LT51c2VkW2FyZWFdCiAJCSAmJiByb3ctPmdseXBoc1thcmVhXVtpXS5v dmVybGFwc192ZXJ0aWNhbGx5X3ApOwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyog TVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBpZiAoIW1jX3JlZHJhd19yb3cgKHcsIHctPmN1 cnJlbnRfbWF0cml4LCByb3csIGFyZWEsIHN0YXJ0X3gsIHN0YXJ0LCBpLAorICAgICAgICAgIGZh bHNlLCBEUkFXX05PUk1BTF9URVhULCBHVUlfRklYX09WRVJMQVBQSU5HX0FSRUEpKQogCSAgZHJh d19nbHlwaHMgKHcsIHN0YXJ0X3gsIHJvdywgYXJlYSwKIAkJICAgICAgIHN0YXJ0LCBpLAogCQkg ICAgICAgRFJBV19OT1JNQUxfVEVYVCwgb3ZlcmxhcHMpOworCisvKiAqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiogKi8KKworCiAJfQogICAgICAgZWxzZQogCXsKQEAgLTMwMDI1LDEwICszNTI3MywyMCBAQCBk aXNwbGF5X2FuZF9zZXRfY3Vyc29yIChzdHJ1Y3Qgd2luZG93ICp3LCBib29sIG9uLAogICBuZXdf Y3Vyc29yX3R5cGUgPSBnZXRfd2luZG93X2N1cnNvcl90eXBlICh3LCBnbHlwaCwKIAkJCQkJICAg ICZuZXdfY3Vyc29yX3dpZHRoLCAmYWN0aXZlX2N1cnNvcik7CiAKKworLyogKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgLyogSWYgY3Vyc29yIGlzIGN1 cnJlbnRseSBiZWluZyBzaG93biBhbmQgd2UgZG9uJ3Qgd2FudCBpdCB0byBiZSBvcgogICAgICBp dCBpcyBpbiB0aGUgd3JvbmcgcGxhY2UsIG9yIHRoZSBjdXJzb3IgdHlwZSBpcyBub3Qgd2hhdCB3 ZSB3YW50LAogICAgICBlcmFzZSBpdC4gICovCiAgIGlmICh3LT5waHlzX2N1cnNvcl9vbl9wCisg ICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIGNyb3NzaGFpcnMpKQor ICAgICAgJiYgTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBmY192aXNpYmxlKSkK KyAgICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgbWNfY29uZikpCisg ICAgICAmJiB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW01DX0NBQ0hFXSA9PSAwCisgICAgICAm JiB3LT5tY19tYXRyaXguY3Vyc29yc191c2VkW0NIX0NBQ0hFXSA9PSAwCisgICAgICAmJiB3LT5t Y19tYXRyaXguY3Vyc29yc191c2VkW0ZDX0NBQ0hFXSA9PSAwCiAgICAgICAmJiAoIW9uCiAJICB8 fCB3LT5waHlzX2N1cnNvci54ICE9IHgKIAkgIHx8IHctPnBoeXNfY3Vyc29yLnkgIT0geQpAQCAt MzAwNDEsNiArMzUyOTksOSBAQCBkaXNwbGF5X2FuZF9zZXRfY3Vyc29yIChzdHJ1Y3Qgd2luZG93 ICp3LCBib29sIG9uLAogCSAgICAgICYmIG5ld19jdXJzb3Jfd2lkdGggIT0gdy0+cGh5c19jdXJz b3Jfd2lkdGgpKSkKICAgICBlcmFzZV9waHlzX2N1cnNvciAodyk7CiAKKy8qICoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiAqLworCisKICAgLyogRG9uJ3QgY2hlY2sgcGh5c19jdXJzb3Jfb25fcCBoZXJlIGJl Y2F1c2UgdGhhdCBmbGFnIGlzIG9ubHkgc2V0CiAgICAgIHRvIGZhbHNlIGluIHNvbWUgY2FzZXMg d2hlcmUgd2Uga25vdyB0aGF0IHRoZSBjdXJzb3IgaGFzIGJlZW4KICAgICAgY29tcGxldGVseSBl cmFzZWQsIHRvIGF2b2lkIHRoZSBleHRyYSB3b3JrIG9mIGVyYXNpbmcgdGhlIGN1cnNvcgpAQCAt MzAwNTksOSArMzUzMjAsMjMgQEAgZGlzcGxheV9hbmRfc2V0X2N1cnNvciAoc3RydWN0IHdpbmRv dyAqdywgYm9vbCBvbiwKICAgICAgIHctPnBoeXNfY3Vyc29yLnZwb3MgPSB2cG9zOwogICAgIH0K IAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwor ICBpZiAoTklMUCAoQlZBUiAoWEJVRkZFUiAody0+Y29udGVudHMpLCBjcm9zc2hhaXJzKSkKKyAg ICAgICYmIE5JTFAgKEJWQVIgKFhCVUZGRVIgKHctPmNvbnRlbnRzKSwgZmNfdmlzaWJsZSkpCisg ICAgICAmJiBOSUxQIChCVkFSIChYQlVGRkVSICh3LT5jb250ZW50cyksIG1jX2NvbmYpKQorICAg ICAgJiYgdy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtNQ19DQUNIRV0gPT0gMAorICAgICAgJiYg dy0+bWNfbWF0cml4LmN1cnNvcnNfdXNlZFtDSF9DQUNIRV0gPT0gMAorICAgICAgJiYgdy0+bWNf bWF0cml4LmN1cnNvcnNfdXNlZFtGQ19DQUNIRV0gPT0gMCkKICAgRlJBTUVfUklGIChmKS0+ZHJh d193aW5kb3dfY3Vyc29yICh3LCBnbHlwaF9yb3csIHgsIHksCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgbmV3X2N1cnNvcl90eXBlLCBuZXdfY3Vyc29yX3dpZHRoLAogICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uLCBhY3RpdmVfY3Vyc29yKTsKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAKQEAgLTMwMTU0LDcgKzM1NDI5LDE4 IEBAIGRyYXdfcm93X3dpdGhfbW91c2VfZmFjZSAoc3RydWN0IHdpbmRvdyAqdywgaW50IHN0YXJ0 X3gsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywKICNpZmRlZiBIQVZFX1dJTkRPV19TWVNURU0KICAg aWYgKEZSQU1FX1dJTkRPV19QIChYRlJBTUUgKHctPmZyYW1lKSkpCiAgICAgeworCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgICAgICBpZiAo IW1jX3JlZHJhd19yb3cgKHcsIHctPmN1cnJlbnRfbWF0cml4LCByb3csIFRFWFRfQVJFQSwgc3Rh cnRfeCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnRfaHBvcywgZW5kX2hwb3MsIGZh bHNlLCBkcmF3LCBEUkFXX1JPV19XSVRIX01PVVNFX0ZBQ0UpKQogICAgICAgZHJhd19nbHlwaHMg KHcsIHN0YXJ0X3gsIHJvdywgVEVYVF9BUkVBLCBzdGFydF9ocG9zLCBlbmRfaHBvcywgZHJhdywg MCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIHJldHVybjsKICAgICB9 CiAjZW5kaWYKQEAgLTMyMjE0LDExICszNzUwMCwyMyBAQCBleHBvc2VfYXJlYSAoc3RydWN0IHdp bmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqcm93LCBjb25zdCBFbWFjc19SZWN0YW5nbGUgKnIs CiAgIHN0cnVjdCBnbHlwaCAqbGFzdDsKICAgaW50IGZpcnN0X3gsIHN0YXJ0X3gsIHg7CiAKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgaWYg KGFyZWEgPT0gVEVYVF9BUkVBICYmIHJvdy0+ZmlsbF9saW5lX3ApCisgICAgeworICAgICAgaWYg KCFtY19yZWRyYXdfcm93ICh3LCB3LT5jdXJyZW50X21hdHJpeCwgcm93LCBhcmVhLCAwLCAwLCBy b3ctPnVzZWRbYXJlYV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgIGZhbHNlLCBEUkFXX05P Uk1BTF9URVhULCBFWFBPU0VfQVJFQV9PTkUpKQogICAgIC8qIElmIHJvdyBleHRlbmRzIGZhY2Ug dG8gZW5kIG9mIGxpbmUgd3JpdGUgdGhlIHdob2xlIGxpbmUuICAqLwogICAgIGRyYXdfZ2x5cGhz ICh3LCAwLCByb3csIGFyZWEsCiAJCSAwLCByb3ctPnVzZWRbYXJlYV0sCiAJCSBEUkFXX05PUk1B TF9URVhULCAwKTsKKyAgICB9CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgZWxz ZQogICAgIHsKICAgICAgIC8qIFNldCBTVEFSVF9YIHRvIHRoZSB3aW5kb3ctcmVsYXRpdmUgc3Rh cnQgcG9zaXRpb24gZm9yIGRyYXdpbmcgZ2x5cGhzIG9mCkBAIC0zMjI1MCwxMSArMzc1NDgsMjQg QEAgZXhwb3NlX2FyZWEgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywg Y29uc3QgRW1hY3NfUmVjdGFuZ2xlICpyLAogCSAgKytsYXN0OwogCX0KIAorCisvKiAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8KKwogICAgICAgLyogUmVwYWlu dC4gICovCi0gICAgICBpZiAobGFzdCA+IGZpcnN0KQorCisgICAgICAvKiBGbG9hdGluZyBmYWtl IGN1cnNvcnMgd2lsbCBleGlzdCB3aGVuIChsYXN0ID09IGZpcnN0KS4gKi8KKyAgICAgIGlmICgh bWNfcmVkcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgsIHJvdywgYXJlYSwgZmlyc3RfeCAt IHN0YXJ0X3gsCisgICAgICAgICAgICAgICAgICAgICAgICAgIGZpcnN0IC0gcm93LT5nbHlwaHNb YXJlYV0sIGxhc3QgLSByb3ctPmdseXBoc1thcmVhXSwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgZmFsc2UsIERSQVdfTk9STUFMX1RFWFQsIEVYUE9TRV9BUkVBX1RXTykKKyAgICAgICAgICAm JiBsYXN0ID4gZmlyc3QpCiAJZHJhd19nbHlwaHMgKHcsIGZpcnN0X3ggLSBzdGFydF94LCByb3cs IGFyZWEsCiAJCSAgICAgZmlyc3QgLSByb3ctPmdseXBoc1thcmVhXSwgbGFzdCAtIHJvdy0+Z2x5 cGhzW2FyZWFdLAogCQkgICAgIERSQVdfTk9STUFMX1RFWFQsIDApOworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKworCiAgICAgfQogfQogCkBAIC0zMjI2OCwxMCArMzc1NzksMjIgQEAgZXhw b3NlX2xpbmUgKHN0cnVjdCB3aW5kb3cgKncsIHN0cnVjdCBnbHlwaF9yb3cgKnJvdywgY29uc3Qg RW1hY3NfUmVjdGFuZ2xlICpyKQogewogICBlYXNzZXJ0IChyb3ctPmVuYWJsZWRfcCk7CiAKKwor LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxUSVBMRS1DVVJTT1JTICovCisKICAgaWYg KHJvdy0+bW9kZV9saW5lX3AgfHwgdy0+cHNldWRvX3dpbmRvd19wKQorICAgIHsKKyAgICAgIGlm ICghbWNfcmVkcmF3X3JvdyAodywgdy0+Y3VycmVudF9tYXRyaXgsIHJvdywgVEVYVF9BUkVBLCAw LCAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICByb3ctPnVzZWRbVEVYVF9BUkVBXSwgZmFs c2UsIERSQVdfTk9STUFMX1RFWFQsIEVYUE9TRV9MSU5FKSkKICAgICBkcmF3X2dseXBocyAodywg MCwgcm93LCBURVhUX0FSRUEsCiAJCSAwLCByb3ctPnVzZWRbVEVYVF9BUkVBXSwKIAkJIERSQVdf Tk9STUFMX1RFWFQsIDApOworICAgIH0KKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwog ICBlbHNlCiAgICAgewogICAgICAgaWYgKHJvdy0+dXNlZFtMRUZUX01BUkdJTl9BUkVBXSkKQEAg LTMyODE5LDYgKzM4MTQyLDIyIEBAIGd1aV9pbnRlcnNlY3RfcmVjdGFuZ2xlcyAoY29uc3QgRW1h Y3NfUmVjdGFuZ2xlICpyMSwgY29uc3QgRW1hY3NfUmVjdGFuZ2xlICpyMiwKIHZvaWQKIHN5bXNf b2ZfeGRpc3AgKHZvaWQpCiB7CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBNVUxU SVBMRS1DVVJTT1JTICovCisKKyAgZGVmc3ViciAoJlNtY19kdW1wX2dseXBoX3Jvdyk7CisKKyAg ZGVmc3ViciAoJlNtY19kdW1wX2dseXBoX21hdHJpeCk7CisKKyAgZGVmc3ViciAoJlNtY19jdXJy ZW50X2NvbHVtbik7CisKKyAgZGVmc3ViciAoJlNtY19zdGRlcnIpOworCisvKiAqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiogKi8KKworCiAgIFZ3aXRoX2VjaG9fYXJlYV9zYXZlX3ZlY3RvciA9IFFuaWw7CiAg IHN0YXRpY3BybyAoJlZ3aXRoX2VjaG9fYXJlYV9zYXZlX3ZlY3Rvcik7CiAKZGlmZiAtLWdpdCBh L3NyYy94dGVybS5jIGIvc3JjL3h0ZXJtLmMKaW5kZXggYzk2YWE3NC4uZDM0ZDgxZCAxMDA2NDQK LS0tIGEvc3JjL3h0ZXJtLmMKKysrIGIvc3JjL3h0ZXJtLmMKQEAgLTEzMiw2ICsxMzIsOTA3IEBA IGFsb25nIHdpdGggR05VIEVtYWNzLiAgSWYgbm90LCBzZWUgPGh0dHBzOi8vd3d3LmdudS5vcmcv bGljZW5zZXMvPi4gICovCiAjaW5jbHVkZSA8WDExL1hLQmxpYi5oPgogI2VuZGlmCiAKKworLyog KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqICovCisvKiBiZWdpbiBNVUxUSVBMRS1DVVJTT1JTICovCisKKyNp ZmRlZiBHTFlQSF9ERUJVRworc3RhdGljIHZvaWQgeF9jaGVja19mb250IChzdHJ1Y3QgZnJhbWUg Kiwgc3RydWN0IGZvbnQgKik7CisjZW5kaWYKKworc3Rh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vf Z2MgKHMpOworICAgICAgcy0+c3RpcHBsZWRfcCA9IHMtPmZhY2UtPnN0aXBwbGUgIT0gMDsKKyAg ICB9CisgIGVsc2UgaWYgKHMtPmhsID09IERSQVdfQ1VSU09SKQorICAgIHsKKyAgICAgIG1jX3hf c2V0X2N1cnNvcl9nYyAocywgY3Vyc29yX2djX3ApOworICAgICAgcy0+c3RpcHBsZWRfcCA9IGZh bHNlOworICAgIH0KKyAgZWxzZSBpZiAocy0+aGwgPT0gRFJBV19NT1VTRV9GQUNFKQorICAgIHsK KyAgICAgIHhfc2V0X21vdXNlX2ZhY2VfZ2MgKHMpOworICAgICAgcy0+c3RpcHBsZWRfcCA9IHMt PmZhY2UtPnN0aXBwbGUgIT0gMDsKKyAgICB9CisgIGVsc2UgaWYgKHMtPmhsID09IERSQVdfSU1B R0VfUkFJU0VECisgICAgICAgICAgIHx8IHMtPmhsID09IERSQVdfSU1BR0VfU1VOS0VOKQorICAg IHsKKyAgICAgIHMtPmdjID0gcy0+ZmFjZS0+Z2M7CisgICAgICBzLT5zdGlwcGxlZF9wID0gcy0+ ZmFjZS0+c3RpcHBsZSAhPSAwOworICAgIH0KKyAgZWxzZQorICAgIGVtYWNzX2Fib3J0ICgpOwor ICAvKiBHQyBtdXN0IGhhdmUgYmVlbiBzZXQuICovCisgIGVhc3NlcnQgKHMtPmdjICE9IDApOwor fQorCisvKiBEcmF3IGEgaG9sbG93IGJveCBjdXJzb3Igb24gd2luZG93IFcgaW4gZ2x5cGggcm93 IFJPVy4gKi8KK3N0YXRpYyB2b2lkCittY194X2RyYXdfaG9sbG93X2N1cnNvciAoc3RydWN0IHdp bmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhfcm93ICpy b3csCisgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHgsIGludCBmeCwgaW50IHksIGludCBm eSwgaW50IGhwb3MsIGludCB2cG9zLCBpbnQgd2QsIGludCBoKQoreworIC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Ag ICAgIEdDRm9yZWdyb3VuZCwgJnhnY3YpOworICBnYyA9IGRweWluZm8tPnNjcmF0Y2hfY3Vyc29y X2djOworICAvKiBTZXQgY2xpcHBpbmcsIGRyYXcgdGhlIHJlY3RhbmdsZSwgYW5kIHJlc2V0IGNs aXBwaW5nIGFnYWluLiAqLworICB4X2NsaXBfdG9fcm93ICh3LCByb3csIFRFWFRfQVJFQSwgZ2Mp OworICAvKiBgeF9kcmF3X3JlY3RhbmdsZScgbmVlZHMgYSBXRCBhbmQgSCB0aGF0IGFyZSAxIHBp eGVsIGxlc3MuICovCisgIGludCByeCA9IGZ4OworICBpbnQgcnkgPSBmeTsKKyAgaW50IHJ3ID0g d2QgLSAxOworICBpbnQgcmggPSBoIC0gMTsKKyAgeF9kcmF3X3JlY3RhbmdsZSAoZiwgZ2MsIHJ4 LCByeSwgcncsIHJoKTsKKy8qCisgIGZwcmludGYgKHN0ZGVyciwgIm1jX3hfZHJhd19ob2xsb3df Y3Vyc29yOiAgcnggKCVkKSB8IHJ5ICglZCkgfCBydyAoJWQpIHwgcmggKCVkKVxuIiwKKyAgICAg ICAgICAgICAgICAgICAgcngsIHJ5LCBydywgcmgpOworKi8KKyAgeF9yZXNldF9jbGlwX3JlY3Rh bmdsZXMgKGYsIGdjKTsKK30KKworLyogRHJhdyBhIGJhciBjdXJzb3Igb24gd2luZG93IFcgaW4g Z2x5cGggcm93IFJPVy4gKi8KK3N0YXRpYyB2b2lkCittY194X2RyYXdfYmFyX2N1cnNvciAoc3Ry dWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4LCBzdHJ1Y3QgZ2x5cGhf cm93ICpyb3csCisgICAgICAgICAgICAgICAgICAgICAgaW50IHgsIGludCBmeCwgaW50IHksIGlu dCBmeSwgaW50IGhwb3MsIGludCB2cG9zLCBpbnQgd2QsIGludCBoLAorICAgICAgICAgICAgICAg ICAgICAgIGludCB3aWR0aCwgZW51bSBtY19jdXJzb3JfdHlw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1Y3Qgd2luZG93ICp3LCBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICptYXRyaXgsIHN0cnVj dCBnbHlwaF9yb3cgKnJvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgeCwgaW50IGZ4 LCBpbnQgeSwgaW50IGZ5LCBpbnQgaHBvcywgaW50IHZwb3MsIGludCB3ZCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICBpbnQgaCwgc3RydWN0IG1jX1JHQiBsc2wsIGVudW0gbWNfY3Vyc29yX3R5 cGUgY3Vyc29yX3R5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGN1cnNvcl93aWR0 aCwgZW51bSBtY19mbGF2b3IgZ2x5cGhfZmxhdm9yLCBib29sIG9uX3AsCisgICAgICAgICAgICAg ICAgICAgICAgICAgYm9vbCBhY3RpdmVfcCkKK3sKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1F IChXSU5ET1dfRlJBTUUgKHcpKTsKKyAgLyogVGhlIGZyaW5nZSBiaXRtYXBzIGFyZSBwcmVzZW50 bHkgaGFuZGxlZCBlbHNld2hlcmUsIGJ1dCBjb3VsZCBzb21lZGF5CisgIGJlIG1hbmFnZWQgKGlu IHBhcnQpIGF0IHRoaXMgc2VjdGlvbiBvZiBjb2RlLiAqLworICBpZiAob25fcCkKKyAgICB7Cisg ICAgICBpZiAocm93LT5leGFjdF93aW5kb3dfd2lkdGhfbGluZV9wCisgICAgICAgICAgJiYgKHJv dy0+cmV2ZXJzZWRfcAorICAgICAgICAgICAgICA/IChocG9zIDwgMCkKKyAgICAgICAgICAgICAg OiAoaHBvcyA+PSByb3ctPnVzZWRbVEVYVF9BUkVBXSkpKQorICAgICAgICB7CisgICAgICAgICAg cm93LT5jdXJzb3JfaW5fZnJpbmdlX3AgPSB0cnVlOworICAgICAgICAgIG1jX2RyYXdfZnJpbmdl X2JpdG1hcCAodywgcm93LCByb3ctPnJldmVyc2VkX3AsIGN1cnNvcl90eXBlKTsK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zm9y ZWdyb3VuZCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmIChyZWdpb25fYWN0 aXZlX3AKKyAgICAgICAgICAgICAgICAgICAgICYmIGFjdGl2ZV9wCisgICAgICAgICAgICAgICAg ICAgICAmJiBjdXJzb3JfZ2x5cGgtPmNoYXJwb3MgPT0gcmVnaW9uX2VuZCkKKyAgICAgICAgICAg ICAgeworICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX3JlZ2lvbl9l bmRfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIrLXJlYWwtZmFr ZS1jdXJzb3ItYXQtcmVnaW9uLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAgICAgICAgICAg IHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX3JlZ2lvbl9lbmRfZmFjZSA9IEZBQ0VfRlJPTV9J RCAoZiwgaG9sbG93X2FjdGl2ZV9yZWdpb25fZW5kX2ZhY2VfaWQpOworICAgICAgICAgICAgICAg IGVudW0gZmFjZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAo dywgZiwgaW50ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWUpOwor ICAgICAgICAgICAgICAgIHN0cnVjdCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZS T01fSUQgKGYsIGhvbGxvd19hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgWFNldEZv cmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9n YywgaG9sbG93X2FjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICBYU2V0 QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZ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Ag ICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1 dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAg ICAgICAgICAgICAgICAgIFhTZXRCYWNrZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5v dXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19hY3RpdmVfcmVnaW9uX2JldHdlZW5fZmFj ZS0+Zm9yZWdyb3VuZCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2Ug aWYgKGFjdGl2ZV9wKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBl bnVtIGZhY2VfaWQgaG9sbG93X2FjdGl2ZV9mYWNlX2lkID0gbG9va3VwX25hbWVkX2ZhY2UgKHcs IGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAg ICAgICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19hY3RpdmVfZmFjZSA9IEZBQ0Vf RlJPTV9JRCAoZiwgaG9sbG93X2FjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgICAg WFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1 cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9mYWNlLT5mb3JlZ3JvdW5kKTsKKyAgICAgICAgICAgICAg ICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRh LngtPmN1cnNvcl9nYywgaG9sbG93X2FjdGl2ZV9mYWNlLT5iYWNrZ3JvdW5kKTsKKyAgICAgICAg ICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKCFhY3RpdmVfcCkKKyAgICAg ICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIGVudW0gZmFjZV9pZCBob2xs b3dfaW5hY3RpdmVfZmFjZV9pZCA9IGxvb2t1cF9uYW1lZF9mYWNlICh3LCBmLCBpbnRlcm4gKCIr LXJlYWwtZmFrZS1jdXJzb3ItaW5hY3RpdmUtcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAg ICAgICAgICAgICAgICAgc3RydWN0IGZhY2UgKmhvbGxvd19pbmFjdGl2ZV9mYWNlID0gRkFDRV9G Uk9NX0lEIChmLCBob2xsb3dfaW5hY3RpdmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAg ICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngt PmN1cnNvcl9nYywgaG9sbG93X2luYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAg ICAgICAgICAgICAgIFhTZXRCYWNrZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRw dXRfZGF0YS54LT5jdXJzb3JfZ2MsIGhvbGxvd19pbmFjdGl2ZV9mYWNlLT5iYWNrZ3JvdW5kKTsK KyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgIGJsb2NrX2lucHV0ICgpOworICAgICAg ICAgIC8qIEZvcmNlIGBtY194X3NldF9jdXJzb3JfZ2MnIHRvIHVzZSBgcy0+Zi0+b3V0cHV0X2Rh dGEueC0+Y3Vyc29yX2djJy4gKi8KKyAgICAgICAgICBib29sIGN1cnNvcl9nY19wID0gdHJ1ZTsK KyAgICAgICAgICBtY19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VS U09SLCB4LCBocG9zLCB2cG9zLCBsc2wsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGdseXBoX2ZsYXZvciwgY3Vyc29yX3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOwor ICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRf ZGF0YS54LT5jdXJzb3JfZ2MsIHhnY3YuZm9yZWdyb3VuZCk7CisgICAgICAgICAgWFNldEJhY2tn cm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywg eGdjdi5iYWNrZ3JvdW5kKTsKKyAgICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgICAg IC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsJy4g Ki8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBjb2xvci5waXhl bDsKKyAgICAgICAgICBtY194X2RyYXdfaG9sbG93X2N1cnNvciAodywgbWF0cml4LCByb3csIHgs IGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAgIGYtPm91dHB1dF9kYXRh LngtPmN1cnNvcl9waXhlbCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAg ICAgICBlbHNlIGlmIChjdXJzb3JfZ2x5cGgtPnR5cGUgPT0gSU1BR0VfR0xZUEggJiYgbHNsLnJl ZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49IDApCisgICAgICAgICAgewor ICAgICAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5jdXJz b3JfcGl4ZWwnLiAqLworICAgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVs ID0gY29sb3IucGl4ZWw7CisgICAgICAgICAgICBtY194X2RyYXdfaG9sbG93X2N1cnNvciAodywg bWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAg ICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3JpZ2luYWxfY3Vyc29yX3BpeGVs OworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAg ICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djJyBi eSBib3Jyb3dpbmcgdGhlCisgICAgICAgICAgICAgIGZ1bmN0aW9uYWxpdHkgb2YgYHhfbWFrZV9n YycgaW4geGZucy5jLiAqLworICAgICAgICAgICAgICBpZiAocmVnaW9uX2FjdGl2ZV9wCisgICAg ICAgICAgICAgICAgICAmJiBhY3RpdmVfcAorICAgICAgICAgICAgICAgICAgJiYgY3Vyc29yX2ds eXBoLT5jaGFycG9zID09IHJlZ2lvbl9iZWcpCisgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgZW51bSBmYWNlX2lkIGhvbGxvd19hY3RpdmVfcmVnaW9uX2JlZ19mYWNlX2lkID0g bG9va3VwX25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1cnNvci1hdC1y ZWdpb24tcHJlLXp2LWZhY2UiKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFj ZSAqaG9sbG93X2FjdGl2ZV9yZWdpb25fYmVnX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxv d19hY3RpdmVfcmVnaW9uX2JlZ19mYWNlX2lkKTsKKyAgICAgICAgICAgICAgICAgIGVudW0gZmFj ZV9pZCBob2xsb3dfYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50 ZXJuICgiKy1yZWFsLWZha2UtY3Vyc29yLXByZS16di1mYWNlIiksIHRydWU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X25hbWVkX2ZhY2UgKHcsIGYsIGludGVybiAoIistcmVhbC1mYWtlLWN1 cnNvci1wcmUtenYtZmFjZSIpLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVj dCBmYWNlICpob2xsb3dfYWN0aXZlX2ZhY2UgPSBGQUNFX0ZST01fSUQgKGYsIGhvbGxvd19hY3Rp dmVfZmFjZV9pZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJB TUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfYWN0 aXZlX2ZhY2UtPmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgICAgICAgICAgWFNldEJhY2tn cm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywg aG9sbG93X2FjdGl2ZV9mYWNlLT5iYWNrZ3JvdW5kKTsKKyAgICAgICAgICAgICAgICAgICAgICB9 CisgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoIWFjdGl2ZV9wKQorICAgICAgICAgICAg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIGZhY2VfaWQgaG9s bG93X2luYWN0aXZlX2ZhY2VfaWQgPSBsb29rdXBfbmFtZWRfZmFjZSAodywgZiwgaW50ZXJuICgi Ky1yZWFsLWZha2UtY3Vyc29yLWluYWN0aXZlLXByZS16di1mYWNlIiksIHRydWUpOworICAgICAg ICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZmFjZSAqaG9sbG93X2luYWN0aXZlX2ZhY2UgPSBG QUNFX0ZST01fSUQgKGYsIGhvbGxvd19pbmFjdGl2ZV9mYWNlX2lkKTsKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1 dF9kYXRhLngtPmN1cnNvcl9nYywgaG9sbG93X2luYWN0aXZlX2ZhY2UtPmZvcmVncm91bmQpOwor ICAgICAgICAgICAgICAgICAgICAgICAgICBYU2V0QmFja2dyb3VuZCAoRlJBTUVfWF9ESVNQTEFZ IChmKSwgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBob2xsb3dfaW5hY3RpdmVfZmFjZS0+ YmFja2dyb3VuZCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGJs b2NrX2lucHV0ICgpOworICAgICAgICAgICAgICAvKiBGb3JjZSBgbWNfeF9zZXRfY3Vyc29yX2dj JyB0byB1c2UgYHMtPmYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYycuICovCisgICAgICAgICAg ICAgIGJvb2wgY3Vyc29yX2djX3AgPSB0cnVlOworICAgICAgICAgICAgICBtY19kcmF3X2N1cnNv cl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4LCBocG9zLCB2cG9zLAorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNsLCBnbHlwaF9mbGF2b3IsIGN1cnNv cl90eXBlLCB3ZCwgYWN0aXZlX3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgICAgIFhTZXRGb3JlZ3JvdW5kIChGUkFNRV9YX0RJ U1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIHhnY3YuZm9yZWdyb3VuZCk7 CisgICAgICAgICAgICAgIFhTZXRCYWNrZ3JvdW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5v dXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIHhnY3YuYmFja2dyb3VuZCk7CisgICAgICAgICAgICAg IHVuYmxvY2tfaW5wdXQgKCk7CisgICAgICAgICAgICAgIC8qIERyYXcgdGhlIGZyYW1lIGFyb3Vu ZCB0aGUgYm94LiAqLworICAgICAgICAgICAgICBtY194X2RyYXdfaG9sbG93X2N1cnNvciAodywg bWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgpOworICAgICAgICAg ICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfSE9MTE9XX0JPWDoKKyAgICB7 CisgICAgICBpZiAobHNsLnJlZCA+PSAwICYmIGxzbC5ncmVlbiA+PSAwICYmIGxzbC5ibHVlID49 IDApCisgICAgICAgIHsKKyAgICAgICAgICAvKiBUZW1wb3JhcmlseSBoaWphY2sgYGYtPm91dHB1 dF9kYXRhLngtPmN1cnNvcl9waXhlbCcuICovCisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+ Y3Vyc29yX3BpeGVsID0gY29sb3IucGl4ZWw7CisgICAgICAgICAgbWNfeF9kcmF3X2hvbGxvd19j dXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLCBoKTsK KyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfcGl4ZWwgPSBvcmlnaW5hbF9jdXJz b3JfcGl4ZWw7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIG1jX3hfZHJhd19o b2xsb3dfY3Vyc29yICh3LCBtYXRyaXgsIHJvdywgeCwgZngsIHksIGZ5LCBocG9zLCB2cG9zLCB3 ZCwgaCk7CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBNQ19GSUxMRURfQk9YOgorICAg IHsKKyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUg Pj0gMCkKKyAgICAgICAgLyogVGVtcG9yYXJpbHkgaGlqYWNrIGBmLT5vdXRwdXRfZGF0YS54LT5j dXJzb3JfZ2MnIGJ5IGJvcnJvd2luZyB0aGUKKyAgICAgICAgZnVuY3Rpb25hbGl0eSBvZiBgeF9t YWtlX2djJyBpbiB4Zm5zLmMuICovCisgICAgICAgIHsKKyAgICAgICAgICBibG9ja19pbnB1dCAo KTsKKyAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgZi0+b3V0 cHV0X2RhdGEueC0+Y3Vyc29yX2djLCBGUkFNRV9CQUNLR1JPVU5EX1BJWEVMIChmKSk7CisgICAg ICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExBWSAoZiksIGYtPm91dHB1dF9kYXRh LngtPmN1cnNvcl9nYywgY29sb3IucGl4ZWwpOworICAgICAgICAgIC8qIEZvcmNlIGBtY194X3Nl dF9jdXJzb3JfZ2MnIHRvIHVzZSBgcy0+Zi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX2djJy4gKi8K KyAgICAgICAgICBib29sIGN1cnNvcl9nY19wID0gdHJ1ZTsKKyAgICAgICAgICBtY19kcmF3X2N1 cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4LCBocG9zLCB2cG9zLCBs c2wsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoX2ZsYXZvciwgY3Vyc29y X3R5cGUsIHdkLCBhY3RpdmVfcCwgY3Vyc29yX2djX3ApOworICAgICAgICAgIFhTZXRGb3JlZ3Jv dW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3JfZ2MsIHhn Y3YuZm9yZWdyb3VuZCk7CisgICAgICAgICAgWFNldEJhY2tncm91bmQgKEZSQU1FX1hfRElTUExB WSAoZiksIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9nYywgeGdjdi5iYWNrZ3JvdW5kKTsKKyAg ICAgICAgICB1bmJsb2NrX2lucHV0ICgpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAg ICAgICB7CisgICAgICAgICAgICBib29sIGN1cnNvcl9nY19wID0gZmFsc2U7CisgICAgICAgICAg ICBtY19kcmF3X2N1cnNvcl9nbHlwaCAodywgbWF0cml4LCByb3csIERSQVdfQ1VSU09SLCB4LCBo cG9zLCB2cG9zLCBsc2wsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGhf Zmxhdm9yLCBjdXJzb3JfdHlwZSwgd2QsIGFjdGl2ZV9wLCBjdXJzb3JfZ2NfcCk7CisgICAgICAg ICAgfQorICAgICAgYnJlYWs7CisgICAgfQorICAgIGNhc2UgTUNfQkFSOgorICAgIHsKKyAgICAg IGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0gMCkKKyAg ICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0X2RhdGEu eC0+Y3Vyc29yX3BpeGVsJy4gKi8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5jdXJzb3Jf cGl4ZWwgPSBjb2xvci5waXhlbDsKKyAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVf b2theV9wID0gdHJ1ZTsKKyAgICAgICAgICBtY194X2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4 LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgTUNfQkFSLCBjdXJzb3JfZ2NfaW52aXNpYmxl X29rYXlfcCk7CisgICAgICAgICAgZi0+b3V0cHV0X2RhdGEueC0+Y3Vyc29yX3BpeGVsID0gb3Jp Z2luYWxfY3Vyc29yX3BpeGVsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICB7 CisgICAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wID0gZmFsc2U7Cisg ICAgICAgICAgICBtY194X2RyYXdfYmFyX2N1cnNvciAodywgbWF0cml4LCByb3csIHgsIGZ4LCB5 LCBmeSwgaHBvcywgdnBvcywgd2QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg aCwgY3Vyc29yX3dpZHRoLCBNQ19CQVIsIGN1cnNvcl9nY19pbnZpc2libGVfb2theV9wKTsKKyAg ICAgICAgICB9CisgICAgICBicmVhazsKKyAgICB9CisgICAgY2FzZSBNQ19IQkFSOgorICAgIHsK KyAgICAgIGlmIChsc2wucmVkID49IDAgJiYgbHNsLmdyZWVuID49IDAgJiYgbHNsLmJsdWUgPj0g MCkKKyAgICAgICAgeworICAgICAgICAgIC8qIFRlbXBvcmFyaWx5IGhpamFjayBgZi0+b3V0cHV0 X2RhdGEueC0+Y3Vyc29yX3BpeGVsJy4gKi8KKyAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT5j dXJzb3JfcGl4ZWwgPSBjb2xvci5waXhlbDsKKyAgICAgICAgICBib29sIGN1cnNvcl9nY19pbnZp c2libGVfb2theV9wID0gdHJ1ZTsKKyAgICAgICAgICBtY194X2RyYXdfYmFyX2N1cnNvciAodywg bWF0cml4LCByb3csIHgsIGZ4LCB5LCBmeSwgaHBvcywgdnBvcywgd2QsIGgsCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcl93aWR0aCwgTUNfSEJBUiwgY3Vyc29yX2djX2lu dmlzaWJsZV9va2F5X3ApOworICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPmN1cnNvcl9waXhl bCA9IG9yaWdpbmFsX2N1cnNvcl9waXhlbDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAg ICAgICAgeworICAgICAgICAgICAgYm9vbCBjdXJzb3JfZ2NfaW52aXNpYmxlX29rYXlfcCA9IGZh bHNlOworICAgICAgICAgICAgbWNfeF9kcmF3X2Jhcl9jdXJzb3IgKHcsIG1hdHJpeCwgcm93LCB4 LCBmeCwgeSwgZnksIGhwb3MsIHZwb3MsIHdkLAorICAgIC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XJzZWRfcCkKKyAgICAgICAgeworICAgICAgICAgIGludCBsZWZ0X3ggPSB3aW5k b3dfYm94X2xlZnRfb2Zmc2V0IChzLT53LCBURVhUX0FSRUEpOworICAgICAgICAgIGlmICh4IDwg bGVmdF94KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICBiYWNrZ3JvdW5kX3dpZHRoIC09 IGxlZnRfeCAtIHg7CisgICAgICAgICAgICAgIHggPSBsZWZ0X3g7CisgICAgICAgICAgICB9Cisg ICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgIHsKKyAgICAgICAgICAgIC8qIEluIFIy TCByb3dzLCBkcmF3IHRoZSBjdXJzb3Igb24gdGhlIHJpZ2h0IGVkZ2Ugb2YgdGhlCisgICAgICAg ICAgICAgICBzdHJldGNoIGdseXBoLiAqLworICAgICAgICAgICAgaW50IHJpZ2h0X3ggPSB3aW5k b3dfYm94X3JpZ2h0IChzLT53LCBURVhUX0FSRUEpOworICAgICAgICAgICAgaWYgKHggKyBiYWNr Z3JvdW5kX3dpZHRoID4gcmlnaHRfeCkKKyAgICAgICAgICAgICAgYmFja2dyb3VuZF93aWR0aCAt PSB4IC0gcmlnaHRfeDsKKyAgICAgICAgICAgIHggKz0gYmFja2dyb3VuZF93aWR0aDsKKyAgICAg ICAgICB9CisgICAgICB3aWR0aCA9IG1pbiAoRlJBTUVfQ09MVU1OX1dJRFRIIChzLT5mKSwgYmFj a2dyb3VuZF93aWR0aCk7CisgICAgICBpZiAocy0+cm93LT5yZXZlcnNlZF9wKQorICAgICAgICB4 IC09IHdpZHRoOworICAgICAgLyogRHJhdyBjdXJzb3IuICovCisgICAgICB4X2RyYXdfZ2x5cGhf c3RyaW5nX2JnX3JlY3QgKHMsIHgsIHMtPnksIHdpZHRoLCBzLT5oZWlnaHQpOworICAgICAgLyog Q2xlYXIgcmVzdCB1c2luZyB0aGUgR0Mgb2YgdGhlIG9yaWdpbmFsIG5vbi1jdXJzb3IgZmFjZS4g Ki8KKyAgICAgIGlmICh3aWR0aCA8IGJhY2tncm91bmRfd2lkdGgpCisgICAgICAgIHsKKyAgICAg ICAgICBpbnQgeSA9IHMtPnk7CisgICAgICAgICAgaW50IHcgPSBiYWNrZ3JvdW5kX3dpZHRoIC0g d2lkdGgsIGggPSBzLT5oZWlnaHQ7CisgICAgICAgICAgWFJlY3RhbmdsZSByOworICAgICAgICAg IEdDIGdjOworICAgICAgICAgIGlmICghcy0+cm93LT5yZXZlcnNlZF9wKQorICAgICAgICAgICAg eCArPSB3aWR0aDsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB4ID0gcy0+eDsKKyAgICAg ICAgICBpZiAocy0+cm93LT5tb3VzZV9mYWNlX3AKKyAgICAgICAgICAgICAgJiYgY3Vyc29yX2lu X21vdXNlX2ZhY2VfcCAocy0+dykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIHhfc2V0 X21vdXNlX2ZhY2VfZ2MgKHMpOworICAgICAgICAgICAgICBnYyA9IHMtPmdjOworICAgICAgICAg ICAgfQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGdjID0gcy0+ZmFjZS0+Z2M7CisgICAg ICAgICAgZ2V0X2dseXBoX3N0cmluZ19jbGlwX3JlY3QgKHMsICZyKTsKKyAgICAgICAgICB4X3Nl dF9jbGlwX3JlY3RhbmdsZXMgKHMtPmYsIGdjLCAmciwgMSk7CisgICAgICAgICAgaWYgKHMtPmZh Y2UtPnN0aXBwbGUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIC8qIEZpbGwgYmFja2dy b3VuZCB3aXRoIGEgc3RpcHBsZSBwYXR0ZXJuLiAqLworICAgICAgICAgICAgICBYU2V0RmlsbFN0 eWxlIChGUkFNRV9YX0RJU1BMQVkgKHMtPmYpLCBnYywgRmlsbE9wYXF1ZVN0aXBwbGVkKTsKKyAg ICAgICAgICAgICAgeF9maWxsX3JlY3RhbmdsZSAocy0+ZiwgZ2MsIHgsIHksIHcsIGgpOworICAg ICAgICAgICAg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mluZ19iYWNrZ3JvdW5kIChzLCBmYWxzZSk7CisgICAg ICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2ZvcmVncm91bmQgKHMpOworICAgICAgYnJlYWs7CisgICAg Y2FzZSBDT01QT1NJVEVfR0xZUEg6CisgICAgICBpZiAocy0+Zm9yX292ZXJsYXBzIHx8IChzLT5j bXBfZnJvbSA+IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICEgcy0+Zmlyc3Rf Z2x5cGgtPnUuY21wLmF1dG9tYXRpYykpCisgICAgICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3Ag PSB0cnVlOworICAgICAgZWxzZQorICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91 bmQgKHMsIHRydWUpOworICAgICAgeF9kcmF3X2NvbXBvc2l0ZV9nbHlwaF9zdHJpbmdfZm9yZWdy b3VuZCAocyk7CisgICAgICBicmVhazsKKyAgICBjYXNlIEdMWVBITEVTU19HTFlQSDoKKyAgICAg IGlmIChzLT5mb3Jfb3ZlcmxhcHMpCisgICAgICAgIHMtPmJhY2tncm91bmRfZmlsbGVkX3AgPSB0 cnVlOworICAgICAgZWxzZQorICAgICAgICB4X2RyYXdfZ2x5cGhfc3RyaW5nX2JhY2tncm91bmQg KHMsIHRydWUpOworICAgICAgeF9kcmF3X2dseXBobGVzc19nbHlwaF9zdHJpbmdfZm9yZWdyb3Vu ZCAocyk7CisgICAgICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAgZW1hY3NfYWJvcnQgKCk7 CisgICAgfQorICBpZiAoIXMtPmZvcl9vdmVybGFwcykKKyAgICB7CisgICAgICAvKiBEcmF3IHVu ZGVybGluZS4gKi8KKyAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfcCkKKyAgICAgICAgewor ICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX1dBVkUp CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfZGVm YXVsdGVkX3ApCisgICAgICAgICAgICAgICAgeF9kcmF3X3VuZGVyd2F2ZSAocyk7CisgICAgICAg ICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBYR0NWYWx1 ZXMgeGdjdjsKKyAgICAgICAgICAgICAgICAgIFhHZXRHQ1ZhbHVlcyAoRlJBTUVfWF9ESVNQTEFZ IChzLT5mKSwgcy0+Z2MsIEdDRm9yZWdyb3VuZCwgJnhnY3YpOworICAgICAgICAgICAgICAgICAg WFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMtPmdjLCBzLT5mYWNlLT51 bmRlcmxpbmVfY29sb3IpOworICAgICAgICAgICAgICAgICAgeF9kcmF3X3VuZGVyd2F2ZSAocyk7 CisgICAgICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAoRlJBTUVfWF9ESVNQTEFZIChzLT5m KSwgcy0+Z2MsIHhnY3YuZm9yZWdyb3VuZCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAg ICAgfQorICAgICAgICAgIGVsc2UgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0Vf VU5ERVJfTElORSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgdW5zaWduZWQgbG9uZyB0 aGlja25lc3MsIHBvc2l0aW9uOworICAgICAgICAgICAgICBpbnQgeTsKKyAgICAgICAgICAgICAg aWYgKHMtPnByZXYgJiYgcy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3AKKyAgICAgICAgICAgICAg ICAgICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkK KyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAvKiBXZSB1c2UgdGhlIHNhbWUg dW5kZXJsaW5lIHN0eWxlIGFzIHRoZSBwcmV2aW91cyBvbmUuICovCisgICAgICAgICAgICAgICAg ICB0aGlja25lc3MgPSBzLT5wcmV2LT51bmRlcmxpbmVfdGhpY2tuZXNzOworICAgICAgICAgICAg ICAgICAgcG9zaXRpb24gPSBzLT5wcmV2LT51bmRlcmxpbmVfcG9zaXRpb247CisgICAgICAgICAg ICAgICAgfQorICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgICAgLyogR2V0IHRoZSB1bmRlcmxpbmUgdGhpY2tuZXNzLiAgRGVmYXVsdCBpcyAxIHBp eGVsLiAqLworICAgICAgICAgICAgICAgICAgaWYgKHMtPmZvbnQgJiYgcy0+Zm9udC0+dW5kZXJs aW5lX3RoaWNrbmVzcyA+IDApCisgICAgICAgICAgICAgICAgICAgIHRoaWNrbmVzcyA9IHMtPmZv bnQtPnVuZGVybGluZV90aGlja25lc3M7CisgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAg ICAgICAgICAgICAgIHRoaWNrbmVzcyA9IDE7CisgICAgICAgICAgICAgICAgICBpZiAoeF91bmRl cmxpbmVfYXRfZGVzY2VudF9saW5lKQorICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IChz LT5oZWlnaHQgLSB0aGlja25lc3MpIC0gKHMtPnliYXNlIC0gcy0+eSk7CisgICAgICAgICAgICAg ICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAv KiBHZXQgdGhlIHVuZGVybGluZSBwb3NpdGlvbi4gIFRoaXMgaXMgdGhlIHJlY29tbWVuZGVkCisg ICAgICAgICAgICAgICAgICAgICAgICAgdmVydGljYWwgb2Zmc2V0IGluIHBpeGVscyBmcm9tIHRo ZSBiYXNlbGluZSB0byB0aGUgdG9wIG9mCisgICAgICAgICAgICAgICAgICAgICAgICAgdGhlIHVu ZGVybGluZS4gIFRoaXMgaXMgYSBzaWduZWQgdmFsdWUgYWNjb3JkaW5nIHRvIHRoZQorICAgICAg ICAgICAgICAgICAgICAgICAgIHNwZWNzLCBhbmQgaXRzIGRlZmF1bHQgaXMKKyAgICAgICAgICAg ICAgICAgICAgICAgICBST1VORCAoKG1heGltdW0gZGVzY2VudCkgLyAyKSwgd2l0aAorICAgICAg ICAgICAgICAgICAgICAgICAgIFJPVU5EKHgpID0gZmxvb3IgKHggKyAwLjUpICAqLworICAgICAg ICAgICAgICAgICAgICAgIGlmICh4X3VzZV91bmRlcmxpbmVfcG9zaXRpb25fcHJvcGVydGllcwor ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBzLT5mb250ICYmIHMtPmZvbnQtPnVuZGVybGlu ZV9wb3NpdGlvbiA+PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBzLT5m b250LT51bmRlcmxpbmVfcG9zaXRpb247CisgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAo cy0+Zm9udCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmZvbnQtPmRl c2NlbnQgKyAxKSAvIDI7CisgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAg ICAgICAgICAgICAgcG9zaXRpb24gPSB1bmRlcmxpbmVfbWluaW11bV9vZmZzZXQ7CisgICAgICAg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gbWF4IChwb3NpdGlv biwgdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAg ICAgICAgIC8qIENoZWNrIHRoZSBzYW5pdHkgb2YgdGhpY2tuZXNzIGFuZCBwb3NpdGlvbi4gIFdl IHNob3VsZAorICAgICAgICAgICAgICAgICBhdm9pZCBkcmF3aW5nIHVuZGVybGluZSBvdXQgb2Yg dGhlIGN1cnJlbnQgbGluZSBhcmVhLiAqLworICAgICAgICAgICAgICBpZiAocy0+eSArIHMtPmhl aWdodCA8PSBzLT55YmFzZSArIHBvc2l0aW9uKQorICAgICAgICAgICAgICAgIHBvc2l0aW9uID0g KHMtPmhlaWdodCAtIDEpIC0gKHMtPnliYXNlIC0gcy0+eSk7CisgICAgICAgICAgICAgIGlmIChz LT55ICsgcy0+aGVpZ2h0IDwgcy0+eWJhc2UgKyBwb3NpdGlvbiArIHRoaWNrbmVzcykKKyAgICAg ICAgICAgICAgICB0aGlja25lc3MgPSAocy0+eSArIHMtPmhlaWdodCkgLSAocy0+eWJhc2UgKyBw b3NpdGlvbik7CisgICAgICAgICAgICAgIHMtPnVuZGVybGluZV90aGlja25lc3MgPSB0aGlja25l c3M7CisgICAgICAgICAgICAgIHMtPnVuZGVybGluZV9wb3NpdGlvbiA9IHBvc2l0aW9uOworICAg ICAgICAgICAgICB5ID0gcy0+eWJhc2UgKyBwb3NpdGlvbjsKKyAgICAgICAgICAgICAgaWYgKHMt PmZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgICAgICB4X2ZpbGxfcmVj dGFuZ2xlIChzLT5mLCBzLT5nYywgcy0+eCwgeSwgcy0+d2lkdGgsIHRoaWNrbmVzcyk7CisgICAg ICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICBYR0NW YWx1ZXMgeGdjdjsKKyAgICAgICAgICAgICAgICAgIFhHZXRHQ1ZhbHVlcyAoRlJBTUVfWF9ESVNQ TEFZIChzLT5mKSwgcy0+Z2MsIEdDRm9yZWdyb3VuZCwgJnhnY3YpOworICAgICAgICAgICAgICAg ICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMtPmdjLCBzLT5mYWNl LT51bmRlcmxpbmVfY29sb3IpOworICAgICAgICAgICAgICAgICAgeF9maWxsX3JlY3RhbmdsZSAo cy0+Ziwgcy0+Z2MsIHMtPngsIHksIHMtPndpZHRoLCB0aGlja25lc3MpOworICAgICAgICAgICAg ICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMtPmdjLCB4Z2N2 LmZvcmVncm91bmQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAg fQorICAgICAgLyogRHJhdyBvdmVybGluZS4gKi8KKyAgICAgIGlmIChzLT5mYWNlLT5vdmVybGlu ZV9wKQorICAgICAgICB7CisgICAgICAgICAgdW5zaWduZWQgbG9uZyBkeSA9IDAsIGggPSAxOwor ICAgICAgICAgIGlmIChzLT5mYWNlLT5vdmVybGluZV9jb2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAg ICAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCBzLT55ICsgZHksIHMt PndpZHRoLCBoKTsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAg IFhHQ1ZhbHVlcyB4Z2N2OworICAgICAgICAgICAgICBYR2V0R0NWYWx1ZXMgKEZSQU1FX1hfRElT UExBWSAocy0+ZiksIHMtPmdjLCBHQ0ZvcmVncm91bmQsICZ4Z2N2KTsKKyAgICAgICAgICAgICAg WFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMtPmdjLCBzLT5mYWNlLT5v dmVybGluZV9jb2xvcik7CisgICAgICAgICAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMt PmdjLCBzLT54LCBzLT55ICsgZHksIHMtPndpZHRoLCBoKTsKKyAgICAgICAgICAgICAgWFNldEZv cmVncm91bmQgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMtPmdjLCB4Z2N2LmZvcmVncm91bmQp OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAvKiBEcmF3IHN0cmlrZS10aHJvdWdo LiAqLworICAgICAgaWYgKHMtPmZhY2UtPnN0cmlrZV90aHJvdWdoX3ApCisgICAgICAgIHsKKyAg ICAgICAgICB1bnNpZ25lZCBsb25nIGggPSAxOworICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZHkg PSAocy0+aGVpZ2h0IC0gaCkgLyAyOworICAgICAgICAgIGlmIChzLT5mYWNlLT5zdHJpa2VfdGhy b3VnaF9jb2xvcl9kZWZhdWx0ZWRfcCkKKyAgICAgICAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMt PmYsIHMtPmdjLCBzLT54LCBzLT55ICsgZHksIHMtPndpZHRoLCBoKTsKKyAgICAgICAgICBlbHNl CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIFhHQ1ZhbHVlcyB4Z2N2OworICAgICAgICAg ICAgICBYR2V0R0NWYWx1ZXMgKEZSQU1FX1hfRElTUExBWSAocy0+ZiksIHMtPmdjLCBHQ0ZvcmVn cm91bmQsICZ4Z2N2KTsKKyAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElT UExBWSAocy0+ZiksIHMtPmdjLCBzLT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9jb2xvcik7CisgICAg ICAgICAgICAgIHhfZmlsbF9yZWN0YW5nbGUgKHMtPmYsIHMtPmdjLCBzLT54LCBzLT55ICsgZHks IHMtPndpZHRoLCBoKTsKKyAgICAgICAgICAgICAgWFNldEZvcmVncm91bmQgKEZSQU1FX1hfRElT UExBWSAocy0+ZiksIHMtPmdjLCB4Z2N2LmZvcmVncm91bmQpOworICAgICAgICAgICAgfQorICAg ICAgICB9CisgICAgICAvKiBEcmF3IHJlbGllZiBpZiBub3QgeWV0IGRyYXduLiAqLworICAgICAg aWYgKCFyZWxpZWZfZHJhd25fcCAmJiBzLT5mYWNlLT5ib3ggIT0gRkFDRV9OT19CT1gpCisgICAg ICAgICAgeF9kcmF3X2dseXBoX3N0cmluZ19ib3ggKHMpOworICAgICAgaWYgKHMtPnByZXYpCisg ICAgICAgIHsKKyAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpwcmV2OworICAgICAgICAg IGZvciAocHJldiA9IHMtPnByZXY7IHByZXY7IHByZXYgPSBwcmV2LT5wcmV2KQorICAgICAgICAg ICAgaWYgKHByZXYtPmhsICE9IHMtPmhsCisgICAgICAgICAgICAgICAgJiYgcHJldi0+eCArIHBy ZXYtPndpZHRoICsgcHJldi0+cmlnaHRfb3ZlcmhhbmcgPiBzLT54KQorICAgICAgICAgICAgICB7 CisgICAgICAgICAgICAgICAgLyogQXMgcHJldiB3YXMgZHJhd24gd2hpbGUgY2xpcHBlZCB0byBp dHMgb3duIGFyZWEsIHdlCisgICAgICAgICAgICAgICAgICAgbXVzdCBkcmF3IHRoZSByaWdodF9v dmVyaGFuZyBwYXJ0IHVzaW5nIHMtPmhsIG5vdy4gKi8KKyAgICAgICAgICAgICAgICBlbnVtIGRy YXdfZ2x5cGhzX2ZhY2Ugc2F2ZSA9IHByZXYtPmhsOworICAgICAgICAgICAgICAgIHByZXYtPmhs ID0gcy0+aGw7CisgICAgICAgICAgICAgICAgbWNfeF9zZXRfZ2x5cGhfc3RyaW5nX2djIChwcmV2 LCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgICAgICAgeF9zZXRfZ2x5cGhfc3RyaW5nX2NsaXBw aW5nX2V4YWN0bHkgKHMsIHByZXYpOworICAgICAgICAgICAgICAgIGlmIChwcmV2LT5maXJzdF9n bHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBIKQorICAgICAgICAgICAgICAgICAgeF9kcmF3X2dseXBo X3N0cmluZ19mb3JlZ3JvdW5kIChwcmV2KTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAg ICAgICAgICAgICB4X2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChwcmV2 KTsKKyAgICAgICAgICAgICAgICB4X3Jlc2V0X2NsaXBfcmVjdGFuZ2xlcyAocHJldi0+ZiwgcHJl di0+Z2MpOworICAgICAgICAgICAgICAgIHByZXYtPmhsID0gc2F2ZTsKKyAgICAgICAgICAgICAg ICBwcmV2LT5udW1fY2xpcHMgPSAwOworICAgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAg IGlmIChzLT5uZXh0KQorICAgICAgICB7CisgICAgICAgICAgc3RydWN0IGdseXBoX3N0cmluZyAq bmV4dDsKKyAgICAgICAgICBmb3IgKG5leHQgPSBzLT5uZXh0OyBuZXh0OyBuZXh0ID0gbmV4dC0+ bmV4dCkKKyAgICAgICAgICAgIGlmIChuZXh0LT5obCAhPSBzLT5obAorICAgICAgICAgICAgICAg ICYmIG5leHQtPnggLSBuZXh0LT5sZWZ0X292ZXJoYW5nIDwgcy0+eCArIHMtPndpZHRoKQorICAg ICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogQXMgbmV4dCB3aWxsIGJlIGRyYXduIHdo aWxlIGNsaXBwZWQgdG8gaXRzIG93biBhcmVhLAorICAgICAgICAgICAgICAgICAgIHdlIG11c3Qg ZHJhdyB0aGUgbGVmdF9vdmVyaGFuZyBwYXJ0IHVzaW5nIHMtPmhsIG5vdy4gKi8KKyAgICAgICAg ICAgICAgICBlbnVtIGRyYXdfZ2x5cGhzX2ZhY2Ugc2F2ZSA9IG5leHQtPmhsOworICAgICAgICAg ICAgICAgIG5leHQtPmhsID0gcy0+aGw7CisgICAgICAgICAgICAgICAgbWNfeF9zZXRfZ2x5cGhf c3RyaW5nX2djIChuZXh0LCBjdXJzb3JfZ2NfcCk7CisgICAgICAgICAgICAgICAgeF9zZXRfZ2x5 cGhfc3RyaW5nX2NsaXBwaW5nX2V4YWN0bHkgKHMsIG5leHQpOworICAgICAgICAgICAgICAgIGlm IChuZXh0LT5maXJzdF9nbHlwaC0+dHlwZSA9PSBDSEFSX0dMWVBIKQorICAgICAgICAgICAgICAg ICAgeF9kcmF3X2dseXBoX3N0cmluZ19mb3JlZ3JvdW5kIChuZXh0KTsKKyAgICAgICAgICAgICAg ICBlbHNlCisgICAgICAgICAgICAgICAgICB4X2RyYXdfY29tcG9zaXRlX2dseXBoX3N0cmluZ19m b3JlZ3JvdW5kIChuZXh0KTsKKyAgICAgICAgICAgICAgICB4X3Jlc2V0X2NsaXBfcmVjdGFuZ2xl cyAobmV4dC0+ZiwgbmV4dC0+Z2MpOworICAgICAgICAgICAgICAgIG5leHQtPmhsID0gc2F2ZTsK KyAgICAgICAgICAgICAgICBuZXh0LT5udW1fY2xpcHMgPSAwOworICAgICAgICAgICAgICAgIG5l eHQtPmNsaXBfaGVhZCA9IHMtPm5leHQ7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAg IH0KKyAgLyogUmVzZXQgY2xpcHBpbmcuICovCisgIHhfcmVzZXRfY2xpcF9yZWN0YW5nbGVzIChz LT5mLCBzLT5nYyk7CisgIHMtPm51bV9jbGlwcyA9IDA7Cit9CisKKy8qIGVuZCBNVUxUSVBMRS1D VVJTT1JTICovCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiAvKiBEZWZhdWx0IHRvIHVz aW5nIFhJTSBpZiBhdmFpbGFibGUuICAqLwogI2lmZGVmIFVTRV9YSU0KIGJvb2wgdXNlX3hpbSA9 IHRydWU7CkBAIC0xMTA5LDYgKzIwMTAsMTYgQEAgc3RhdGljIHZvaWQKIHhfdXBkYXRlX2JlZ2lu IChzdHJ1Y3QgZnJhbWUgKmYpCiB7CiAgIC8qIE5vdGhpbmcgdG8gZG8uICAqLworCisKKy8qICoq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisgIGYtPm1jX3Vw ZGF0aW5nX2ZyYW1lID0gZjsKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisKKwogfQogCiAv KiBEcmF3IGEgdmVydGljYWwgd2luZG93IGJvcmRlciBmcm9tICh4LHkwKSB0byAoeCx5MSkgICov CkBAIC0xMjU0LDYgKzIxNjUsMTYgQEAgeF91cGRhdGVfZW5kIChzdHJ1Y3QgZnJhbWUgKmYpCiAg IFhGbHVzaCAoRlJBTUVfWF9ESVNQTEFZIChmKSk7CiAgIHVuYmxvY2tfaW5wdXQgKCk7CiAjZW5k aWYKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIE1VTFRJUExFLUNVUlNPUlMgKi8K KworICBmLT5tY191cGRhdGluZ19mcmFtZSA9IE5VTEw7CisKKy8qICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KiAqLworCisKIH0KIAogLyogVGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgZnJvbSB2YXJpb3VzIHBs YWNlcyBpbiB4ZGlzcC5jCkBAIC0xMzIzOCw2ICsxNDE1OSwyMCBAQCBleHRlcm4gZnJhbWVfcGFy bV9oYW5kbGVyIHhfZnJhbWVfcGFybV9oYW5kbGVyc1tdOwogCiBzdGF0aWMgc3RydWN0IHJlZGlz cGxheV9pbnRlcmZhY2UgeF9yZWRpc3BsYXlfaW50ZXJmYWNlID0KICAgeworCisKKy8qICoqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKiAqLworLyogTVVMVElQTEUtQ1VSU09SUyAqLworCisvKiBgcmVkaXNwbGF5 X2ludGVyZmFjZScgaW4gYHh0ZXJtLmNgIG11c3QgYmUgaW4gdGhlIGV4YWN0IHNhbWUgb3JkZXIg YXMgdGhlCitgcmVkaXNwbGF5X2ludGVyZmFjZScgaW4gYGRpc3BleHRlcm4uaGAhICovCisKKyAg bWNfeF9kcmF3X3dpbmRvd19jdXJzb3IsCisgIG1jX3hfZHJhd19nbHlwaF9zdHJpbmcsCisKKy8q ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICB4X2ZyYW1lX3Bhcm1faGFuZGxlcnMsCiAg ICAgZ3VpX3Byb2R1Y2VfZ2x5cGhzLAogICAgIGd1aV93cml0ZV9nbHlwaHMsCg== --Multipart_Sat_May__2_13:50:18_2020-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#22873: #22873 (multiple fake cursors); and, #17684 (crosshairs / fill-column). Resent-From: Lars Ingebrigtsen <larsi@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Thu, 01 Oct 2020 03:01:02 +0000 Resent-Message-ID: <handler.22873.B22873.160152122414684 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 22873 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Keith David Bershatsky <esq@HIDDEN> Cc: mbork@HIDDEN, 22873 <at> debbugs.gnu.org, johnw@HIDDEN, akioburns@HIDDEN, 17684 <at> debbugs.gnu.org, eliz@HIDDEN, drew.adams@HIDDEN, rms@HIDDEN Received: via spool by 22873-submit <at> debbugs.gnu.org id=B22873.160152122414684 (code B ref 22873); Thu, 01 Oct 2020 03:01:02 +0000 Received: (at 22873) by debbugs.gnu.org; 1 Oct 2020 03:00:24 +0000 Received: from localhost ([127.0.0.1]:33661 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1kNopU-0003oh-7g for submit <at> debbugs.gnu.org; Wed, 30 Sep 2020 23:00:24 -0400 Received: from quimby.gnus.org ([95.216.78.240]:53570) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <larsi@HIDDEN>) id 1kNopS-0003oK-0N; Wed, 30 Sep 2020 23:00:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ClK//VLNEXeQdQ9u0DTTDzPnAMp6l/2lS81fFOX5Y4g=; b=pmuTKxgWbqofuQoxizizmUL8Zj 2mJkHWvcik2iqUbz0QqENSW+KGHPrU+GkBlLvRzW7UCsOULuveI1a3kDSNcgs8VsoCrbkCX07cRTI I80keTbGamUeq72r2BJIFOTi7t1LKPGsnZtYn03olyyv5I9vkF0VnHjoX7MEX9TNPhCk=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <larsi@HIDDEN>) id 1kNopB-0001Dk-CK; Thu, 01 Oct 2020 05:00:08 +0200 From: Lars Ingebrigtsen <larsi@HIDDEN> References: <m2oaayavh1.wl%esq@HIDDEN> <m2wo5uoyd1.wl%esq@HIDDEN> X-Now-Playing: Barbara Morgenstern's _Beide_: "Gleich is gleicher als gleich" Date: Thu, 01 Oct 2020 05:00:02 +0200 In-Reply-To: <m2wo5uoyd1.wl%esq@HIDDEN> (Keith David Bershatsky's message of "Sat, 02 May 2020 13:50:18 -0700") Message-ID: <87h7retzv1.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Keith David Bershatsky <esq@HIDDEN> writes: > VERSION: 022.008 [05/02/2020] > > CHANGELOG: > > +(defgroup +-mode nil > + "Faces for the vertical ruler." > + :group 'convenience) This is a huge patch set, and I have not tried it. It seems like the general consensus is that, yes, we would like to have multiple cursors, but I'm not sure what this has to do with crosshairs? I've [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Keith David Bershatsky <esq@HIDDEN> writes: > VERSION: 022.008 [05/02/2020] > > CHANGELOG: > > +(defgroup +-mode nil > + "Faces for the vertical ruler." > + :group 'convenience) This is a huge patch set, and I have not tried it. It seems like the general consensus is that, yes, we would like to have multiple cursors, but I'm not sure what this has to do with crosshairs? I've just lightly skimmed this thread, though... Anyway, I'm not sure what the status is here. The naming standard doesn't seem to follow Emacs convention -- there's a mode called `+-mode', for instance, which would have to be renamed... Keith, is this still a work in progress, or is it something you think is ready to go, and would like a code review on? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.